Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/rollup-2.79.2
Browse files Browse the repository at this point in the history
  • Loading branch information
bheston authored Oct 17, 2024
2 parents eed44f8 + 2234f96 commit 42da195
Show file tree
Hide file tree
Showing 25 changed files with 1,033 additions and 851 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Add support for margin properties",
"packageName": "@adaptive-web/adaptive-ui",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "AUI: Improve StyleProperty shorthand capabilities",
"packageName": "@adaptive-web/adaptive-ui",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "AUI: Improve StyleProperty shorthand capabilities",
"packageName": "@adaptive-web/adaptive-ui-designer-core",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Add support for margin properties",
"packageName": "@adaptive-web/adaptive-ui-designer-figma",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "AUI: Add support for looking up Token Groups in anatomy",
"packageName": "@adaptive-web/adaptive-ui",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "AUI: Improve StyleProperty shorthand capabilities",
"packageName": "@adaptive-web/adaptive-web-components",
"email": "[email protected]",
"dependentChangeType": "patch"
}
3 changes: 1 addition & 2 deletions examples/customize-component/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {
BorderFill,
createForegroundSet,
Styles
} from "@adaptive-web/adaptive-ui";
Expand Down Expand Up @@ -39,7 +38,7 @@ AdaptiveDesignSystem.defineComponents({
// Define a custom style module.
const accentOutlineReadableControlStyles: Styles = Styles.fromProperties({
backgroundFill: neutralFillSubtle,
...BorderFill.all(accentStrokeReadable),
borderFill: accentStrokeReadable,
foregroundFill: createForegroundSet(accentStrokeReadableRecipe, neutralFillSubtle),
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
Palette,
PaletteRGB,
StyleProperty,
stylePropertyBorderFillAll,
StylePropertyShorthand,
Swatch,
} from "@adaptive-web/adaptive-ui";
import {
Expand All @@ -34,7 +34,7 @@ export const docPalette = createNonCss<Palette>("doc-palette").withDefault(

export const docForegroundRecipe = createTokenColorRecipe(
"doc-foreground",
[...stylePropertyBorderFillAll, StyleProperty.foregroundFill],
[...StylePropertyShorthand.borderFill, StyleProperty.foregroundFill],
(resolve: DesignTokenResolver, params?: ColorRecipeParams) =>
contrastSwatch(
resolve(docPalette),
Expand Down
21 changes: 9 additions & 12 deletions packages/adaptive-ui-designer-figma-plugin/src/ui/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ import { css, customElement, FASTElement, html, observable, repeat, when } from
import { staticallyCompose } from "@microsoft/fast-foundation";
import {
StyleProperty,
stylePropertyBorderFillAll,
stylePropertyBorderThicknessAll,
stylePropertyCornerRadiusAll,
stylePropertyPaddingAll
StylePropertyShorthand,
} from "@adaptive-web/adaptive-ui";
import {
cornerRadiusControl,
Expand Down Expand Up @@ -283,7 +280,7 @@ const template = html<App>`
TokenGlyphType.backgroundSwatch)}
${(x) =>
availableTokensTemplate(
stylePropertyBorderFillAll,
StylePropertyShorthand.borderFill,
"Stroke",
"stack",
TokenGlyphType.borderSwatch
Expand Down Expand Up @@ -312,12 +309,12 @@ const template = html<App>`
${(x) => availableStylesTemplate("Shape")}
${(x) =>
availableTokensTemplate(
stylePropertyCornerRadiusAll,
StylePropertyShorthand.cornerRadius,
"Corner radius",
)}
${(x) =>
availableTokensTemplate(
stylePropertyBorderThicknessAll,
StylePropertyShorthand.borderThickness,
"Stroke thickness",
)}
</div>
Expand All @@ -336,7 +333,7 @@ const template = html<App>`
${(x) => availableStylesTemplate("Density")}
${(x) =>
availableTokensTemplate(
[...stylePropertyPaddingAll, StyleProperty.gap],
[...StylePropertyShorthand.padding, StyleProperty.gap],
"Density",
)}
</div>
Expand Down Expand Up @@ -673,10 +670,10 @@ export class App extends FASTElement {
private refreshObservables() {
this.backgroundTokens = this.controller.styles.getAppliedDesignTokens([StyleProperty.backgroundFill]);
this.foregroundTokens = this.controller.styles.getAppliedDesignTokens([StyleProperty.foregroundFill]);
this.borderFillTokens = this.controller.styles.getAppliedDesignTokens(stylePropertyBorderFillAll);
this.borderThicknessTokens = this.controller.styles.getAppliedDesignTokens(stylePropertyBorderThicknessAll);
this.densityTokens = this.controller.styles.getAppliedDesignTokens([...stylePropertyPaddingAll, StyleProperty.gap]);
this.cornerRadiusTokens = this.controller.styles.getAppliedDesignTokens(stylePropertyCornerRadiusAll);
this.borderFillTokens = this.controller.styles.getAppliedDesignTokens(StylePropertyShorthand.borderFill);
this.borderThicknessTokens = this.controller.styles.getAppliedDesignTokens(StylePropertyShorthand.borderThickness);
this.densityTokens = this.controller.styles.getAppliedDesignTokens([...StylePropertyShorthand.padding, StyleProperty.gap]);
this.cornerRadiusTokens = this.controller.styles.getAppliedDesignTokens(StylePropertyShorthand.cornerRadius);
this.textTokens = this.controller.styles.getAppliedDesignTokens([
StyleProperty.fontFamily,
StyleProperty.fontStyle,
Expand Down
2 changes: 1 addition & 1 deletion packages/adaptive-ui-designer-figma/src/lib/anatomy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ function parseComponent(node: PluginUINodeData): Anatomy {
function isContextNode(node: PluginUINodeData, componentName: string): boolean {
// Remove non-ascii characters (we tried a convention of decorating template node names)
const nodeName = node.name.replace(/[^\x20-\x7F]/g, "").trim();
return node.type === "COMPONENT" || nodeName.toLowerCase() === componentName.toLowerCase();
return node.type === "COMPONENT" || componentName.toLowerCase().indexOf(nodeName.toLowerCase()) !== -1;
}

function walkNode(node: PluginUINodeData, componentName: string, condition: Record<string, string | boolean> | undefined, anatomy: Anatomy): void {
Expand Down
Loading

0 comments on commit 42da195

Please sign in to comment.