Skip to content

Commit 42da195

Browse files
authored
Merge branch 'main' into dependabot/npm_and_yarn/rollup-2.79.2
2 parents eed44f8 + 2234f96 commit 42da195

25 files changed

+1033
-851
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "Add support for margin properties",
4+
"packageName": "@adaptive-web/adaptive-ui",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "minor",
3+
"comment": "AUI: Improve StyleProperty shorthand capabilities",
4+
"packageName": "@adaptive-web/adaptive-ui",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "minor",
3+
"comment": "AUI: Improve StyleProperty shorthand capabilities",
4+
"packageName": "@adaptive-web/adaptive-ui-designer-core",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "Add support for margin properties",
4+
"packageName": "@adaptive-web/adaptive-ui-designer-figma",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "minor",
3+
"comment": "AUI: Add support for looking up Token Groups in anatomy",
4+
"packageName": "@adaptive-web/adaptive-ui",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "minor",
3+
"comment": "AUI: Improve StyleProperty shorthand capabilities",
4+
"packageName": "@adaptive-web/adaptive-web-components",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

examples/customize-component/src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {
2-
BorderFill,
32
createForegroundSet,
43
Styles
54
} from "@adaptive-web/adaptive-ui";
@@ -39,7 +38,7 @@ AdaptiveDesignSystem.defineComponents({
3938
// Define a custom style module.
4039
const accentOutlineReadableControlStyles: Styles = Styles.fromProperties({
4140
backgroundFill: neutralFillSubtle,
42-
...BorderFill.all(accentStrokeReadable),
41+
borderFill: accentStrokeReadable,
4342
foregroundFill: createForegroundSet(accentStrokeReadableRecipe, neutralFillSubtle),
4443
});
4544

packages/adaptive-ui-designer-core/src/registry/custom-recipes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
Palette,
1010
PaletteRGB,
1111
StyleProperty,
12-
stylePropertyBorderFillAll,
12+
StylePropertyShorthand,
1313
Swatch,
1414
} from "@adaptive-web/adaptive-ui";
1515
import {
@@ -34,7 +34,7 @@ export const docPalette = createNonCss<Palette>("doc-palette").withDefault(
3434

3535
export const docForegroundRecipe = createTokenColorRecipe(
3636
"doc-foreground",
37-
[...stylePropertyBorderFillAll, StyleProperty.foregroundFill],
37+
[...StylePropertyShorthand.borderFill, StyleProperty.foregroundFill],
3838
(resolve: DesignTokenResolver, params?: ColorRecipeParams) =>
3939
contrastSwatch(
4040
resolve(docPalette),

packages/adaptive-ui-designer-figma-plugin/src/ui/app.ts

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@ import { css, customElement, FASTElement, html, observable, repeat, when } from
22
import { staticallyCompose } from "@microsoft/fast-foundation";
33
import {
44
StyleProperty,
5-
stylePropertyBorderFillAll,
6-
stylePropertyBorderThicknessAll,
7-
stylePropertyCornerRadiusAll,
8-
stylePropertyPaddingAll
5+
StylePropertyShorthand,
96
} from "@adaptive-web/adaptive-ui";
107
import {
118
cornerRadiusControl,
@@ -283,7 +280,7 @@ const template = html<App>`
283280
TokenGlyphType.backgroundSwatch)}
284281
${(x) =>
285282
availableTokensTemplate(
286-
stylePropertyBorderFillAll,
283+
StylePropertyShorthand.borderFill,
287284
"Stroke",
288285
"stack",
289286
TokenGlyphType.borderSwatch
@@ -312,12 +309,12 @@ const template = html<App>`
312309
${(x) => availableStylesTemplate("Shape")}
313310
${(x) =>
314311
availableTokensTemplate(
315-
stylePropertyCornerRadiusAll,
312+
StylePropertyShorthand.cornerRadius,
316313
"Corner radius",
317314
)}
318315
${(x) =>
319316
availableTokensTemplate(
320-
stylePropertyBorderThicknessAll,
317+
StylePropertyShorthand.borderThickness,
321318
"Stroke thickness",
322319
)}
323320
</div>
@@ -336,7 +333,7 @@ const template = html<App>`
336333
${(x) => availableStylesTemplate("Density")}
337334
${(x) =>
338335
availableTokensTemplate(
339-
[...stylePropertyPaddingAll, StyleProperty.gap],
336+
[...StylePropertyShorthand.padding, StyleProperty.gap],
340337
"Density",
341338
)}
342339
</div>
@@ -673,10 +670,10 @@ export class App extends FASTElement {
673670
private refreshObservables() {
674671
this.backgroundTokens = this.controller.styles.getAppliedDesignTokens([StyleProperty.backgroundFill]);
675672
this.foregroundTokens = this.controller.styles.getAppliedDesignTokens([StyleProperty.foregroundFill]);
676-
this.borderFillTokens = this.controller.styles.getAppliedDesignTokens(stylePropertyBorderFillAll);
677-
this.borderThicknessTokens = this.controller.styles.getAppliedDesignTokens(stylePropertyBorderThicknessAll);
678-
this.densityTokens = this.controller.styles.getAppliedDesignTokens([...stylePropertyPaddingAll, StyleProperty.gap]);
679-
this.cornerRadiusTokens = this.controller.styles.getAppliedDesignTokens(stylePropertyCornerRadiusAll);
673+
this.borderFillTokens = this.controller.styles.getAppliedDesignTokens(StylePropertyShorthand.borderFill);
674+
this.borderThicknessTokens = this.controller.styles.getAppliedDesignTokens(StylePropertyShorthand.borderThickness);
675+
this.densityTokens = this.controller.styles.getAppliedDesignTokens([...StylePropertyShorthand.padding, StyleProperty.gap]);
676+
this.cornerRadiusTokens = this.controller.styles.getAppliedDesignTokens(StylePropertyShorthand.cornerRadius);
680677
this.textTokens = this.controller.styles.getAppliedDesignTokens([
681678
StyleProperty.fontFamily,
682679
StyleProperty.fontStyle,

packages/adaptive-ui-designer-figma/src/lib/anatomy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ function parseComponent(node: PluginUINodeData): Anatomy {
230230
function isContextNode(node: PluginUINodeData, componentName: string): boolean {
231231
// Remove non-ascii characters (we tried a convention of decorating template node names)
232232
const nodeName = node.name.replace(/[^\x20-\x7F]/g, "").trim();
233-
return node.type === "COMPONENT" || nodeName.toLowerCase() === componentName.toLowerCase();
233+
return node.type === "COMPONENT" || componentName.toLowerCase().indexOf(nodeName.toLowerCase()) !== -1;
234234
}
235235

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

0 commit comments

Comments
 (0)