@fluentui/web-components 3.0.0-beta.35 → 3.0.0-beta.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/CHANGELOG.md +24 -2
  2. package/dist/dts/drawer/define.d.ts +1 -0
  3. package/dist/dts/drawer/drawer.d.ts +93 -0
  4. package/dist/dts/drawer/drawer.definition.d.ts +8 -0
  5. package/dist/dts/drawer/drawer.options.d.ts +40 -0
  6. package/dist/dts/drawer/drawer.styles.d.ts +4 -0
  7. package/dist/dts/drawer/drawer.template.d.ts +8 -0
  8. package/dist/dts/drawer/index.d.ts +5 -0
  9. package/dist/dts/drawer-body/define.d.ts +1 -0
  10. package/dist/dts/drawer-body/drawer-body.d.ts +3 -0
  11. package/dist/dts/drawer-body/drawer-body.definition.d.ts +8 -0
  12. package/dist/dts/drawer-body/drawer-body.styles.d.ts +4 -0
  13. package/dist/dts/drawer-body/drawer-body.template.d.ts +8 -0
  14. package/dist/dts/drawer-body/index.d.ts +4 -0
  15. package/dist/dts/index-rollup.d.ts +3 -0
  16. package/dist/dts/index.d.ts +2 -0
  17. package/dist/dts/message-bar/define.d.ts +1 -0
  18. package/dist/dts/message-bar/index.d.ts +5 -0
  19. package/dist/dts/message-bar/message-bar.bench.d.ts +3 -0
  20. package/dist/dts/message-bar/message-bar.d.ts +66 -0
  21. package/dist/dts/message-bar/message-bar.definition.d.ts +9 -0
  22. package/dist/dts/message-bar/message-bar.options.d.ts +30 -0
  23. package/dist/dts/message-bar/message-bar.styles.d.ts +7 -0
  24. package/dist/dts/message-bar/message-bar.template.d.ts +14 -0
  25. package/dist/dts/rating-display/define.d.ts +1 -0
  26. package/dist/dts/rating-display/index.d.ts +5 -0
  27. package/dist/dts/rating-display/rating-display.d.ts +94 -0
  28. package/dist/dts/rating-display/rating-display.definition.d.ts +9 -0
  29. package/dist/dts/rating-display/rating-display.options.d.ts +29 -0
  30. package/dist/dts/rating-display/rating-display.styles.d.ts +6 -0
  31. package/dist/dts/rating-display/rating-display.template.d.ts +14 -0
  32. package/dist/dts/styles/states/index.d.ts +20 -0
  33. package/dist/dts/theme/set-theme.bench.d.ts +3 -0
  34. package/dist/esm/drawer/define.js +4 -0
  35. package/dist/esm/drawer/define.js.map +1 -0
  36. package/dist/esm/drawer/drawer.definition.js +16 -0
  37. package/dist/esm/drawer/drawer.definition.js.map +1 -0
  38. package/dist/esm/drawer/drawer.js +132 -0
  39. package/dist/esm/drawer/drawer.js.map +1 -0
  40. package/dist/esm/drawer/drawer.options.js +25 -0
  41. package/dist/esm/drawer/drawer.options.js.map +1 -0
  42. package/dist/esm/drawer/drawer.styles.js +138 -0
  43. package/dist/esm/drawer/drawer.styles.js.map +1 -0
  44. package/dist/esm/drawer/drawer.template.js +28 -0
  45. package/dist/esm/drawer/drawer.template.js.map +1 -0
  46. package/dist/esm/drawer/index.js +6 -0
  47. package/dist/esm/drawer/index.js.map +1 -0
  48. package/dist/esm/drawer-body/define.js +4 -0
  49. package/dist/esm/drawer-body/define.js.map +1 -0
  50. package/dist/esm/drawer-body/drawer-body.definition.js +16 -0
  51. package/dist/esm/drawer-body/drawer-body.definition.js.map +1 -0
  52. package/dist/esm/drawer-body/drawer-body.js +4 -0
  53. package/dist/esm/drawer-body/drawer-body.js.map +1 -0
  54. package/dist/esm/drawer-body/drawer-body.styles.js +31 -0
  55. package/dist/esm/drawer-body/drawer-body.styles.js.map +1 -0
  56. package/dist/esm/drawer-body/drawer-body.template.js +21 -0
  57. package/dist/esm/drawer-body/drawer-body.template.js.map +1 -0
  58. package/dist/esm/drawer-body/index.js +5 -0
  59. package/dist/esm/drawer-body/index.js.map +1 -0
  60. package/dist/esm/index-rollup.js +3 -0
  61. package/dist/esm/index-rollup.js.map +1 -1
  62. package/dist/esm/index.js +2 -0
  63. package/dist/esm/index.js.map +1 -1
  64. package/dist/esm/menu/menu.js +5 -1
  65. package/dist/esm/menu/menu.js.map +1 -1
  66. package/dist/esm/message-bar/define.js +4 -0
  67. package/dist/esm/message-bar/define.js.map +1 -0
  68. package/dist/esm/message-bar/index.js +6 -0
  69. package/dist/esm/message-bar/index.js.map +1 -0
  70. package/dist/esm/message-bar/message-bar.bench.js +56 -0
  71. package/dist/esm/message-bar/message-bar.bench.js.map +1 -0
  72. package/dist/esm/message-bar/message-bar.definition.js +20 -0
  73. package/dist/esm/message-bar/message-bar.definition.js.map +1 -0
  74. package/dist/esm/message-bar/message-bar.js +79 -0
  75. package/dist/esm/message-bar/message-bar.js.map +1 -0
  76. package/dist/esm/message-bar/message-bar.options.js +27 -0
  77. package/dist/esm/message-bar/message-bar.options.js.map +1 -0
  78. package/dist/esm/message-bar/message-bar.styles.js +108 -0
  79. package/dist/esm/message-bar/message-bar.styles.js.map +1 -0
  80. package/dist/esm/message-bar/message-bar.template.js +25 -0
  81. package/dist/esm/message-bar/message-bar.template.js.map +1 -0
  82. package/dist/esm/rating-display/define.js +4 -0
  83. package/dist/esm/rating-display/define.js.map +1 -0
  84. package/dist/esm/rating-display/index.js +6 -0
  85. package/dist/esm/rating-display/index.js.map +1 -0
  86. package/dist/esm/rating-display/rating-display.definition.js +17 -0
  87. package/dist/esm/rating-display/rating-display.definition.js.map +1 -0
  88. package/dist/esm/rating-display/rating-display.js +97 -0
  89. package/dist/esm/rating-display/rating-display.js.map +1 -0
  90. package/dist/esm/rating-display/rating-display.options.js +19 -0
  91. package/dist/esm/rating-display/rating-display.options.js.map +1 -0
  92. package/dist/esm/rating-display/rating-display.styles.js +120 -0
  93. package/dist/esm/rating-display/rating-display.styles.js.map +1 -0
  94. package/dist/esm/rating-display/rating-display.template.js +32 -0
  95. package/dist/esm/rating-display/rating-display.template.js.map +1 -0
  96. package/dist/esm/styles/partials/badge.partials.js +4 -5
  97. package/dist/esm/styles/partials/badge.partials.js.map +1 -1
  98. package/dist/esm/styles/states/index.js +20 -0
  99. package/dist/esm/styles/states/index.js.map +1 -1
  100. package/dist/esm/theme/set-theme.bench.js +23 -0
  101. package/dist/esm/theme/set-theme.bench.js.map +1 -0
  102. package/dist/esm/theme/set-theme.js +35 -19
  103. package/dist/esm/theme/set-theme.js.map +1 -1
  104. package/dist/web-components.d.ts +300 -0
  105. package/dist/web-components.js +713 -393
  106. package/dist/web-components.min.js +303 -294
  107. package/package.json +20 -3
@@ -0,0 +1,32 @@
1
+ import { html } from '@microsoft/fast-element';
2
+ /**
3
+ * Reusable star icon symbol
4
+ */
5
+ const star = html `
6
+ <svg xmlns="http://www.w3.org/2000/svg" style="display: none">
7
+ <symbol id="star" viewBox="0 0 12 12">
8
+ <path
9
+ d="M5.28347 1.54556C5.57692 0.95096 6.42479 0.950961 6.71825 1.54556L7.82997 3.79817L10.3159 4.15939C10.9721 4.25474 11.2341 5.06112 10.7592 5.52394L8.96043 7.27736L9.38507 9.75321C9.49716 10.4067 8.81122 10.9051 8.22431 10.5966L6.00086 9.42761L3.7774 10.5966C3.19049 10.9051 2.50455 10.4067 2.61664 9.75321L3.04128 7.27736L1.24246 5.52394C0.767651 5.06111 1.02966 4.25474 1.68584 4.15939L4.17174 3.79817L5.28347 1.54556Z"
10
+ />
11
+ </symbol>
12
+ </svg>
13
+ `;
14
+ /**
15
+ * Generates a template for the Rating Display component.
16
+ *
17
+ * @public
18
+ */
19
+ export function ratingDisplayTemplate() {
20
+ return html `
21
+ ${star} ${x => html `${html.partial(x.generateIcons())}`}
22
+ <slot name="value"><span class="value-label" aria-hidden="true">${x => x.value}</span></slot>
23
+ <slot name="count"><span class="count-label" aria-hidden="true">${x => x.formattedCount}</span></slot>
24
+ `;
25
+ }
26
+ /**
27
+ * The template for the Rating Display component.
28
+ *
29
+ * @public
30
+ */
31
+ export const template = ratingDisplayTemplate();
32
+ //# sourceMappingURL=rating-display.template.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rating-display.template.js","sourceRoot":"","sources":["../../../src/rating-display/rating-display.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAGpE;;GAEG;AACH,MAAM,IAAI,GAAG,IAAI,CAAA;;;;;;;;CAQhB,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,qBAAqB;IACnC,OAAO,IAAI,CAAG;MACV,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,CAAA,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC,EAAE;sEACW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK;sEACZ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc;GACxF,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAuC,qBAAqB,EAAE,CAAC"}
@@ -2,7 +2,6 @@ import { css } from '@microsoft/fast-element';
2
2
  import { display } from '../../utils/index.js';
3
3
  import { borderRadiusCircular, colorBrandBackground, colorBrandBackground2, colorBrandForeground1, colorBrandForeground2, colorBrandStroke2, colorNeutralBackground1, colorNeutralBackground4, colorNeutralBackground5, colorNeutralForeground1, colorNeutralForeground1Static, colorNeutralForeground3, colorNeutralForegroundInverted, colorNeutralForegroundOnBrand, colorNeutralForegroundStaticInverted, colorNeutralStroke2, colorNeutralStrokeAccessible, colorPaletteDarkOrangeBackground1, colorPaletteDarkOrangeBackground3, colorPaletteDarkOrangeBorder1, colorPaletteDarkOrangeForeground1, colorPaletteDarkOrangeForeground3, colorPaletteGreenBackground1, colorPaletteGreenBackground3, colorPaletteGreenBorder2, colorPaletteGreenForeground1, colorPaletteGreenForeground2, colorPaletteGreenForeground3, colorPaletteRedBackground1, colorPaletteRedBackground3, colorPaletteRedBorder1, colorPaletteRedForeground1, colorPaletteRedForeground3, colorPaletteYellowBackground1, colorPaletteYellowBackground3, colorPaletteYellowBorder1, colorPaletteYellowForeground2, colorTransparentStroke, fontFamilyBase, fontSizeBase100, fontSizeBase200, fontWeightSemibold, lineHeightBase100, lineHeightBase200, spacingHorizontalSNudge, spacingHorizontalXS, spacingHorizontalXXS, strokeWidthThin, } from '../../theme/design-tokens.js';
4
4
  import { dangerState, extraLargeState, extraSmallState, ghostState, importantState, informativeState, largeState, outlineState, severeState, smallState, subtleState, successState, tintState, tinyState, warningState, } from '../states/index.js';
5
- const textPadding = spacingHorizontalXXS;
6
5
  export const badgeBaseStyles = css.partial `
7
6
  ${display('inline-flex')} :host {
8
7
  position: relative;
@@ -15,7 +14,7 @@ export const badgeBaseStyles = css.partial `
15
14
  line-height: ${lineHeightBase200};
16
15
  min-width: 20px;
17
16
  height: 20px;
18
- padding-inline: calc(${spacingHorizontalXS} + ${textPadding});
17
+ padding-inline: calc(${spacingHorizontalXS} + ${spacingHorizontalXXS});
19
18
  border-radius: ${borderRadiusCircular};
20
19
  border-color: ${colorTransparentStroke};
21
20
  background-color: ${colorBrandBackground};
@@ -72,7 +71,7 @@ export const badgeSizeStyles = css.partial `
72
71
  height: 16px;
73
72
  font-size: ${fontSizeBase100};
74
73
  line-height: ${lineHeightBase100};
75
- padding-inline: calc(${spacingHorizontalXXS} + ${textPadding});
74
+ padding-inline: calc(${spacingHorizontalXXS} + ${spacingHorizontalXXS});
76
75
  }
77
76
  :host(${smallState}) ::slotted(svg) {
78
77
  font-size: 12px;
@@ -82,7 +81,7 @@ export const badgeSizeStyles = css.partial `
82
81
  height: 24px;
83
82
  font-size: ${fontSizeBase200};
84
83
  line-height: ${lineHeightBase200};
85
- padding-inline: calc(${spacingHorizontalXS} + ${textPadding});
84
+ padding-inline: calc(${spacingHorizontalXS} + ${spacingHorizontalXXS});
86
85
  }
87
86
  :host(${largeState}) ::slotted(svg) {
88
87
  font-size: 16px;
@@ -92,7 +91,7 @@ export const badgeSizeStyles = css.partial `
92
91
  height: 32px;
93
92
  font-size: ${fontSizeBase200};
94
93
  line-height: ${lineHeightBase200};
95
- padding-inline: calc(${spacingHorizontalSNudge} + ${textPadding});
94
+ padding-inline: calc(${spacingHorizontalSNudge} + ${spacingHorizontalXXS});
96
95
  }
97
96
  :host(${extraLargeState}) ::slotted(svg) {
98
97
  font-size: 20px;
@@ -1 +1 @@
1
- {"version":3,"file":"badge.partials.js","sourceRoot":"","sources":["../../../../src/styles/partials/badge.partials.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EACjB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,6BAA6B,EAC7B,uBAAuB,EACvB,8BAA8B,EAC9B,6BAA6B,EAC7B,oCAAoC,EACpC,mBAAmB,EACnB,4BAA4B,EAC5B,iCAAiC,EACjC,iCAAiC,EACjC,6BAA6B,EAC7B,iCAAiC,EACjC,iCAAiC,EACjC,4BAA4B,EAC5B,4BAA4B,EAC5B,wBAAwB,EACxB,4BAA4B,EAC5B,4BAA4B,EAC5B,4BAA4B,EAC5B,0BAA0B,EAC1B,0BAA0B,EAC1B,sBAAsB,EACtB,0BAA0B,EAC1B,0BAA0B,EAC1B,6BAA6B,EAC7B,6BAA6B,EAC7B,yBAAyB,EACzB,6BAA6B,EAC7B,sBAAsB,EACtB,cAAc,EACd,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,GAChB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,WAAW,EACX,eAAe,EACf,eAAe,EACf,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,WAAW,EACX,UAAU,EACV,WAAW,EACX,YAAY,EACZ,SAAS,EACT,SAAS,EACT,YAAY,GACb,MAAM,oBAAoB,CAAC;AAE5B,MAAM,WAAW,GAAG,oBAAoB,CAAC;AAEzC,MAAM,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AmB;;;UAG7B,SAAS,GAAG,YAAY;wBACV,4BAA4B;aACvC,4BAA4B;oBACrB,wBAAwB;;;UAGlC,SAAS,GAAG,YAAY;wBACV,6BAA6B;aACxC,6BAA6B;oBACtB,yBAAyB;;CAE5C,CAAC"}
1
+ {"version":3,"file":"badge.partials.js","sourceRoot":"","sources":["../../../../src/styles/partials/badge.partials.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EACjB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,6BAA6B,EAC7B,uBAAuB,EACvB,8BAA8B,EAC9B,6BAA6B,EAC7B,oCAAoC,EACpC,mBAAmB,EACnB,4BAA4B,EAC5B,iCAAiC,EACjC,iCAAiC,EACjC,6BAA6B,EAC7B,iCAAiC,EACjC,iCAAiC,EACjC,4BAA4B,EAC5B,4BAA4B,EAC5B,wBAAwB,EACxB,4BAA4B,EAC5B,4BAA4B,EAC5B,4BAA4B,EAC5B,0BAA0B,EAC1B,0BAA0B,EAC1B,sBAAsB,EACtB,0BAA0B,EAC1B,0BAA0B,EAC1B,6BAA6B,EAC7B,6BAA6B,EAC7B,yBAAyB,EACzB,6BAA6B,EAC7B,sBAAsB,EACtB,cAAc,EACd,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,GAChB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,WAAW,EACX,eAAe,EACf,eAAe,EACf,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,WAAW,EACX,UAAU,EACV,WAAW,EACX,YA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oBAC1B,6BAA6B;;;UAGvC,SAAS,GAAG,WAAW;wBACT,uBAAuB;aAClC,uBAAuB;oBAChB,mBAAmB;;;UAG7B,SAAS,GAAG,YAAY;wBACV,4BAA4B;aACvC,4BAA4B;oBACrB,wBAAwB;;;UAGlC,SAAS,GAAG,YAAY;wBACV,6BAA6B;aACxC,6BAA6B;oBACtB,yBAAyB;;CAE5C,CAAC"}
@@ -149,6 +149,16 @@ export const importantState = css.partial `:is([state--important], :state(import
149
149
  * @public
150
150
  */
151
151
  export const informativeState = css.partial `:is([state--informative], :state(informative))`;
152
+ /**
153
+ * Selector for the `marigold` state.
154
+ * @public
155
+ */
156
+ export const marigoldState = css.partial `:is([state--marigold], :state(marigold))`;
157
+ /**
158
+ * Selector for the `neutral` state.
159
+ * @public
160
+ */
161
+ export const neutralState = css.partial `:is([state--neutral], :state(neutral))`;
152
162
  /**
153
163
  * Selector for the `severe` state.
154
164
  * @public
@@ -174,4 +184,14 @@ export const verticalState = css.partial `:is([state--vertical], :state(vertical
174
184
  * @public
175
185
  */
176
186
  export const horizontalState = css.partial `:is([state--horizontal], :state(horizontal))`;
187
+ /**
188
+ * Selector for the `singleline` state.
189
+ * @public
190
+ */
191
+ export const singleLineState = css.partial `:is([state--singleline], :state(singleline))`;
192
+ /**
193
+ * Selector for the `multiline` state.
194
+ * @public
195
+ */
196
+ export const multiLineState = css.partial `:is([state--multiline], :state(multiline))`;
177
197
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/styles/states/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAE9C;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAC,OAAO,CAAA,sDAAsD,CAAC;AAEpG;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAC,OAAO,CAAA,oDAAoD,CAAC;AAEjG;;;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CAAA,wCAAwC,CAAC;AAEhF;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAC,OAAO,CAAA,0CAA0C,CAAC;AAEnF;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAC,OAAO,CAAA,8CAA8C,CAAC;AAEzF;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAC,OAAO,CAAA,8CAA8C,CAAC;AAEzF;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAC,OAAO,CAAA,4CAA4C,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { measurePerformance } from '@tensile-perf/web-components';
2
+ import { teamsDarkTheme, teamsLightTheme, webDarkTheme, webLightTheme } from '@fluentui/tokens';
3
+ import { setTheme } from './set-theme.js';
4
+ const tests = {
5
+ mount: ({ onComplete }) => {
6
+ const { startMeasure, endMeasure } = measurePerformance();
7
+ startMeasure();
8
+ // Newly set themes
9
+ setTheme(webLightTheme);
10
+ setTheme(webDarkTheme);
11
+ setTheme(teamsDarkTheme);
12
+ setTheme(teamsLightTheme);
13
+ // Cached themes
14
+ setTheme(webLightTheme);
15
+ setTheme(webDarkTheme);
16
+ setTheme(teamsDarkTheme);
17
+ setTheme(teamsLightTheme);
18
+ endMeasure();
19
+ onComplete();
20
+ },
21
+ };
22
+ export { tests };
23
+ //# sourceMappingURL=set-theme.bench.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"set-theme.bench.js","sourceRoot":"","sources":["../../../src/theme/set-theme.bench.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAA2B,MAAM,8BAA8B,CAAC;AAC3F,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEhG,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,MAAM,KAAK,GAAuC;IAChD,KAAK,EAAE,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE;QACxB,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,GAAG,kBAAkB,EAAE,CAAC;QAE1D,YAAY,EAAE,CAAC;QAEf,mBAAmB;QACnB,QAAQ,CAAC,aAAa,CAAC,CAAC;QACxB,QAAQ,CAAC,YAAY,CAAC,CAAC;QACvB,QAAQ,CAAC,cAAc,CAAC,CAAC;QACzB,QAAQ,CAAC,eAAe,CAAC,CAAC;QAE1B,gBAAgB;QAChB,QAAQ,CAAC,aAAa,CAAC,CAAC;QACxB,QAAQ,CAAC,YAAY,CAAC,CAAC;QACvB,QAAQ,CAAC,cAAc,CAAC,CAAC;QACzB,QAAQ,CAAC,eAAe,CAAC,CAAC;QAE1B,UAAU,EAAE,CAAC;QAEb,UAAU,EAAE,CAAC;IACf,CAAC;CACF,CAAC;AAEF,OAAO,EAAE,KAAK,EAAE,CAAC"}
@@ -1,32 +1,48 @@
1
1
  import * as tokens from './design-tokens.js';
2
2
  const tokenNames = Object.keys(tokens);
3
+ const SUPPORTS_REGISTER_PROPERTY = 'registerProperty' in CSS;
4
+ const SUPPORTS_ADOPTED_STYLE_SHEETS = 'adoptedStyleSheets' in document;
5
+ const themeStyleSheet = new CSSStyleSheet();
6
+ const themeStyleTextMap = new Map();
3
7
  /**
4
8
  * Sets the theme tokens on defaultNode.
5
9
  * @param theme - Flat object of theme token values.
6
10
  * @internal
7
11
  */
8
12
  export const setTheme = (theme) => {
9
- for (const t of tokenNames) {
10
- let registered = false;
11
- if ('registerProperty' in CSS) {
12
- try {
13
- CSS.registerProperty({
14
- name: `--${t}`,
15
- inherits: true,
16
- initialValue: theme[t],
17
- });
18
- registered = true;
19
- }
20
- catch {
21
- // Do nothing.
13
+ // Fallback to setting token custom properties on `<html>` element’s `style`
14
+ // attribute, only checking the support of `document.adoptedStyleSheets`
15
+ // here because it has broader support than `CSS.registerProperty()`, which
16
+ // is checked later.
17
+ if (!SUPPORTS_ADOPTED_STYLE_SHEETS) {
18
+ setThemeFor(document.documentElement, theme);
19
+ return;
20
+ }
21
+ if (!themeStyleTextMap.has(theme)) {
22
+ const tokenDeclarations = [];
23
+ for (const t of tokenNames) {
24
+ if (SUPPORTS_REGISTER_PROPERTY) {
25
+ try {
26
+ CSS.registerProperty({
27
+ name: `--${t}`,
28
+ inherits: true,
29
+ initialValue: theme[t],
30
+ });
31
+ }
32
+ catch { }
22
33
  }
34
+ tokenDeclarations.push(`--${t}: ${theme[t]};`);
23
35
  }
24
- if (!registered) {
25
- // TODO: Find a better way to update the values. Current approach adds
26
- // lots of code to the `style` attribute on `<body>`. Maybe look into
27
- // `document.adoptedStyleSheets`.
28
- setThemeFor(document.body, theme);
29
- }
36
+ themeStyleTextMap.set(theme, `html{${tokenDeclarations.join('')}}`);
37
+ }
38
+ if (!document.adoptedStyleSheets.includes(themeStyleSheet)) {
39
+ document.adoptedStyleSheets.push(themeStyleSheet);
40
+ }
41
+ else {
42
+ // The very first call to `setTheme()` within a document doesn’t need to
43
+ // call `replaceSync()`, because `CSS.registerProperty()` above is
44
+ // sufficient to set the tokens.
45
+ themeStyleSheet.replaceSync(themeStyleTextMap.get(theme));
30
46
  }
31
47
  };
32
48
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"set-theme.js","sourceRoot":"","sources":["../../../src/theme/set-theme.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAE7C,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAoB,CAAC;AAE1D;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAY,EAAE,EAAE;IACvC,KAAK,MAAM,CAAC,IAAI,UAAU,EAAE;QAC1B,IAAI,UAAU,GAAG,KAAK,CAAC;QAEvB,IAAI,kBAAkB,IAAI,GAAG,EAAE;YAC7B,IAAI;gBACF,GAAG,CAAC,gBAAgB,CAAC;oBACnB,IAAI,EAAE,KAAK,CAAC,EAAE;oBACd,Q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AiB,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;QACjC,MAAM,iBAAiB,GAAa,EAAE,CAAC;QAEvC,KAAK,MAAM,CAAC,IAAI,UAAU,EAAE;YAC1B,IAAI,0BAA0B,EAAE;gBAC9B,IAAI;oBACF,GAAG,CAAC,gBAAgB,CAAC;wBACnB,IAAI,EAAE,KAAK,CAAC,EAAE;wBACd,QAAQ,EAAE,IAAI;wBACd,YAAY,EAAE,KAAK,CAAC,CAAC,CAAW;qBACjC,CAAC,CAAC;iBACJ;gBAAC,MAAM,GAAE;aACX;YACD,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC,CAAC,CAAW,GAAG,CAAC,CAAC;SAC1D;QAED,iBAAiB,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;KACrE;IAED,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE;QAC1D,QAAQ,CAAC,kBAAkB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;KACnD;SAAM;QACL,wEAAwE;QACxE,kEAAkE;QAClE,gCAAgC;QAChC,eAAe,CAAC,WAAW,CAAC,iBAAiB,CAAC,GAAG,CAAC,KAAK,CAAE,CAAC,CAAC;KAC5D;AACH,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,OAAoB,EAAE,KAAY,EAAE,EAAE;IAChE,KAAK,MAAM,CAAC,IAAI,UAAU,EAAE;QAC1B,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAW,CAAC,CAAC;KACzD;AACH,CAAC,CAAC"}
@@ -4655,6 +4655,158 @@ export declare const DividerStyles: ElementStyles;
4655
4655
  */
4656
4656
  export declare const DividerTemplate: ElementViewTemplate<Divider>;
4657
4657
 
4658
+ /**
4659
+ * A Drawer component that allows content to be displayed in a side panel. It can be rendered as modal or non-modal.
4660
+ * @extends FASTElement
4661
+ *
4662
+ * @attr {DrawerType} type - Determines whether the drawer should be displayed as modal, non-modal, or alert.
4663
+ * @attr {DrawerPosition} position - Sets the position of the drawer (start/end).
4664
+ * @attr {DrawerSize} size - Sets the size of the drawer (small/medium/large).
4665
+ * @attr {string} ariaDescribedby - The ID of the element that describes the drawer.
4666
+ * @attr {string} ariaLabelledby - The ID of the element that labels the drawer.
4667
+ *
4668
+ * @csspart dialog - The dialog element of the drawer.
4669
+ *
4670
+ * @slot - Default slot for the content of the drawer.
4671
+ *
4672
+ * @fires toggle - Event emitted after the dialog's open state changes.
4673
+ * @fires beforetoggle - Event emitted before the dialog's open state changes.
4674
+ *
4675
+ * @method show - Method to show the drawer.
4676
+ * @method hide - Method to hide the drawer.
4677
+ * @method clickHandler - Handles click events on the drawer.
4678
+ * @method emitToggle - Emits an event after the dialog's open state changes.
4679
+ * @method emitBeforeToggle - Emits an event before the dialog's open state changes.
4680
+ *
4681
+ * @summary A component that provides a drawer for displaying content in a side panel.
4682
+ *
4683
+ * @tag fluent-drawer
4684
+ */
4685
+ export declare class Drawer extends FASTElement {
4686
+ /**
4687
+ * @public
4688
+ * Determines whether the drawer should be displayed as modal or non-modal
4689
+ * When rendered as a modal, an overlay is applied over the rest of the view.
4690
+ */
4691
+ type: DrawerType;
4692
+ /**
4693
+ * @public
4694
+ * The ID of the element that labels the drawer.
4695
+ */
4696
+ ariaLabelledby?: string;
4697
+ /**
4698
+ * @public
4699
+ * The ID of the element that describes the drawer.
4700
+ */
4701
+ ariaDescribedby?: string;
4702
+ /**""
4703
+ * @public
4704
+ * @defaultValue start
4705
+ * Sets the position of the drawer (start/end).
4706
+ */
4707
+ position: DrawerPosition;
4708
+ /**
4709
+ * @public
4710
+ * @defaultValue medium
4711
+ * Sets the size of the drawer (small/medium/large).
4712
+ */
4713
+ size: DrawerSize;
4714
+ /**
4715
+ * @public
4716
+ * The dialog element.
4717
+ */
4718
+ dialog: HTMLDialogElement;
4719
+ /**
4720
+ * @public
4721
+ * Method to emit an event after the dialog's open state changes
4722
+ * HTML spec proposal: https://github.com/whatwg/html/issues/9733
4723
+ */
4724
+ emitToggle: () => void;
4725
+ /**
4726
+ * @public
4727
+ * Method to emit an event before the dialog's open state changes
4728
+ * HTML spec proposal: https://github.com/whatwg/html/issues/9733
4729
+ */
4730
+ emitBeforeToggle: () => void;
4731
+ /**
4732
+ * @public
4733
+ * Method to show the drawer
4734
+ */
4735
+ show(): void;
4736
+ /**
4737
+ * @public
4738
+ * Method to hide the drawer
4739
+ */
4740
+ hide(): void;
4741
+ /**
4742
+ * @public
4743
+ * @param event - The click event
4744
+ * @returns boolean - Always returns true
4745
+ * Handles click events on the drawer.
4746
+ */
4747
+ clickHandler(event: Event): boolean;
4748
+ }
4749
+
4750
+ /**
4751
+ *
4752
+ * @public
4753
+ * @remarks
4754
+ * HTML Element: <fluent-drawer>
4755
+ */
4756
+ export declare const DrawerDefinition: FASTElementDefinition<typeof Drawer>;
4757
+
4758
+ /**
4759
+ * A drawer can be positioned on the left or right side of the viewport.
4760
+ */
4761
+ export declare const DrawerPosition: {
4762
+ readonly start: "start";
4763
+ readonly end: "end";
4764
+ };
4765
+
4766
+ /**
4767
+ * The position of the drawer.
4768
+ * @public
4769
+ */
4770
+ export declare type DrawerPosition = ValuesOf<typeof DrawerPosition>;
4771
+
4772
+ /**
4773
+ * A drawer can be different sizes
4774
+ */
4775
+ export declare const DrawerSize: {
4776
+ readonly small: "small";
4777
+ readonly medium: "medium";
4778
+ readonly large: "large";
4779
+ readonly full: "full";
4780
+ };
4781
+
4782
+ /**
4783
+ * The size of the drawer.
4784
+ * @public
4785
+ */
4786
+ export declare type DrawerSize = ValuesOf<typeof DrawerSize>;
4787
+
4788
+ /** Drawer styles
4789
+ * @public
4790
+ */
4791
+ export declare const DrawerStyles: ElementStyles;
4792
+
4793
+ export declare const DrawerTemplate: ElementViewTemplate<Drawer>;
4794
+
4795
+ /**
4796
+ * A drawer can be different sizes
4797
+ */
4798
+ export declare const DrawerType: {
4799
+ readonly nonModal: "non-modal";
4800
+ readonly modal: "modal";
4801
+ readonly inline: "inline";
4802
+ };
4803
+
4804
+ /**
4805
+ * The size of the drawer.
4806
+ * @public
4807
+ */
4808
+ export declare type DrawerType = ValuesOf<typeof DrawerType>;
4809
+
4658
4810
  /**
4659
4811
  * CSS custom property value for the {@link @fluentui/tokens#durationFast | `durationFast`} design token.
4660
4812
  * @public
@@ -6455,6 +6607,154 @@ export declare const RadioStyles: ElementStyles;
6455
6607
 
6456
6608
  export declare const RadioTemplate: ElementViewTemplate<Radio>;
6457
6609
 
6610
+ /**
6611
+ * The base class used for constructing a fluent-rating-display custom element
6612
+ * @public
6613
+ */
6614
+ export declare class RatingDisplay extends FASTElement {
6615
+ /**
6616
+ * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
6617
+ *
6618
+ * @internal
6619
+ */
6620
+ elementInternals: ElementInternals;
6621
+ /**
6622
+ * The color of the rating display icons.
6623
+ *
6624
+ * @public
6625
+ * @default `marigold`
6626
+ * @remarks
6627
+ * HTML Attribute: `color`
6628
+ */
6629
+ color?: RatingDisplayColor;
6630
+ /**
6631
+ * Handles changes to the color attribute.
6632
+ *
6633
+ * @param prev - The previous state
6634
+ * @param next - The next state
6635
+ */
6636
+ colorChanged(prev: RatingDisplayColor | undefined, next: RatingDisplayColor | undefined): void;
6637
+ /**
6638
+ * Renders a single filled icon with a label next to it.
6639
+ *
6640
+ * @public
6641
+ * @remarks
6642
+ * HTML Attribute: `compact`
6643
+ */
6644
+ compact: boolean;
6645
+ /**
6646
+ * The number of ratings.
6647
+ *
6648
+ * @public
6649
+ * @remarks
6650
+ * HTML Attribute: `count`
6651
+ */
6652
+ count?: number;
6653
+ /**
6654
+ * The maximum possible value of the rating.
6655
+ * This attribute determines the number of icons displayed.
6656
+ * Must be a whole number greater than 1.
6657
+ *
6658
+ * @public
6659
+ * @remarks
6660
+ * HTML Attribute: `max`
6661
+ */
6662
+ max?: number;
6663
+ /**
6664
+ * The size of the component.
6665
+ *
6666
+ * @public
6667
+ * @default 'medium'
6668
+ * @remarks
6669
+ * HTML Attribute: `size`
6670
+ */
6671
+ size?: RatingDisplaySize;
6672
+ /**
6673
+ * Handles changes to the size attribute.
6674
+ *
6675
+ * @param prev - The previous state
6676
+ * @param next - The next state
6677
+ */
6678
+ sizeChanged(prev: RatingDisplaySize | undefined, next: RatingDisplaySize | undefined): void;
6679
+ /**
6680
+ * The value of the rating.
6681
+ *
6682
+ * @public
6683
+ * @remarks
6684
+ * HTML Attribute: `value`
6685
+ */
6686
+ value?: number;
6687
+ private intlNumberFormatter;
6688
+ constructor();
6689
+ /**
6690
+ * Returns "count" as string, formatted according to the locale.
6691
+ *
6692
+ * @internal
6693
+ */
6694
+ get formattedCount(): string;
6695
+ /**
6696
+ * Generates the icon SVG elements based on the "max" attribute.
6697
+ *
6698
+ * @internal
6699
+ */
6700
+ generateIcons(): string;
6701
+ }
6702
+
6703
+ /**
6704
+ * The color of the Rating Display items can be `neutral`, `brand`, or `marigold`.
6705
+ * @public
6706
+ */
6707
+ export declare const RatingDisplayColor: {
6708
+ readonly neutral: "neutral";
6709
+ readonly brand: "brand";
6710
+ readonly marigold: "marigold";
6711
+ };
6712
+
6713
+ /**
6714
+ * The Rating Display items can be one of several colors.
6715
+ * @public
6716
+ */
6717
+ export declare type RatingDisplayColor = ValuesOf<typeof RatingDisplayColor>;
6718
+
6719
+ /**
6720
+ * The definition for the Fluent Rating Display component.
6721
+ *
6722
+ * @public
6723
+ * @remarks
6724
+ * HTML Element: `<fluent-rating-display>`
6725
+ */
6726
+ export declare const RatingDisplayDefinition: FASTElementDefinition<typeof RatingDisplay>;
6727
+
6728
+ /**
6729
+ * The size of a Rating Display can be `small`, `medium`, or `large`.
6730
+ * @public
6731
+ */
6732
+ export declare const RatingDisplaySize: {
6733
+ readonly small: "small";
6734
+ readonly medium: "medium";
6735
+ readonly large: "large";
6736
+ };
6737
+
6738
+ /**
6739
+ * A Rating Display can be one of several preset sizes.
6740
+ * @public
6741
+ */
6742
+ export declare type RatingDisplaySize = ValuesOf<typeof RatingDisplaySize>;
6743
+
6744
+ /**
6745
+ * The styles for the Rating Display component.
6746
+ *
6747
+ * @public
6748
+ */
6749
+ export declare const RatingDisplayStyles: ElementStyles;
6750
+
6751
+ /**
6752
+ * The template for the Rating Display component.
6753
+ *
6754
+ * @public
6755
+ */
6756
+ export declare const RatingDisplayTemplate: ElementViewTemplate<RatingDisplay>;
6757
+
6458
6758
  /**
6459
6759
  * @internal
6460
6760
  */