@fluentui/web-components 3.0.0-beta.10 → 3.0.0-beta.11

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 (73) hide show
  1. package/CHANGELOG.md +11 -2
  2. package/dist/dts/index.d.ts +3 -0
  3. package/dist/dts/utils/behaviors/match-media-stylesheet-behavior.d.ts +124 -0
  4. package/dist/dts/utils/display.d.ts +17 -0
  5. package/dist/dts/utils/index.d.ts +2 -0
  6. package/dist/esm/accordion/accordion.styles.js +1 -1
  7. package/dist/esm/accordion/accordion.styles.js.map +1 -1
  8. package/dist/esm/accordion-item/accordion-item.styles.js +1 -1
  9. package/dist/esm/accordion-item/accordion-item.styles.js.map +1 -1
  10. package/dist/esm/avatar/avatar.styles.js +1 -1
  11. package/dist/esm/avatar/avatar.styles.js.map +1 -1
  12. package/dist/esm/button/button.styles.js +1 -1
  13. package/dist/esm/button/button.styles.js.map +1 -1
  14. package/dist/esm/checkbox/checkbox.styles.js +1 -1
  15. package/dist/esm/checkbox/checkbox.styles.js.map +1 -1
  16. package/dist/esm/dialog/dialog.styles.js +1 -1
  17. package/dist/esm/dialog/dialog.styles.js.map +1 -1
  18. package/dist/esm/divider/divider.styles.js +1 -1
  19. package/dist/esm/divider/divider.styles.js.map +1 -1
  20. package/dist/esm/index.js +3 -0
  21. package/dist/esm/index.js.map +1 -1
  22. package/dist/esm/label/label.styles.js +1 -1
  23. package/dist/esm/label/label.styles.js.map +1 -1
  24. package/dist/esm/menu-item/menu-item.styles.js +1 -1
  25. package/dist/esm/menu-item/menu-item.styles.js.map +1 -1
  26. package/dist/esm/menu-list/menu-list.styles.js +1 -1
  27. package/dist/esm/menu-list/menu-list.styles.js.map +1 -1
  28. package/dist/esm/progress-bar/progress-bar.styles.js +1 -1
  29. package/dist/esm/progress-bar/progress-bar.styles.js.map +1 -1
  30. package/dist/esm/radio/radio.styles.js +1 -1
  31. package/dist/esm/radio/radio.styles.js.map +1 -1
  32. package/dist/esm/radio-group/radio-group.styles.js +1 -1
  33. package/dist/esm/radio-group/radio-group.styles.js.map +1 -1
  34. package/dist/esm/slider/slider.styles.js +1 -1
  35. package/dist/esm/slider/slider.styles.js.map +1 -1
  36. package/dist/esm/spinner/spinner.styles.js +1 -1
  37. package/dist/esm/spinner/spinner.styles.js.map +1 -1
  38. package/dist/esm/styles/partials/badge.partials.js +1 -1
  39. package/dist/esm/styles/partials/badge.partials.js.map +1 -1
  40. package/dist/esm/switch/switch.styles.js +1 -1
  41. package/dist/esm/switch/switch.styles.js.map +1 -1
  42. package/dist/esm/tab/tab.styles.js +1 -1
  43. package/dist/esm/tab/tab.styles.js.map +1 -1
  44. package/dist/esm/tab-panel/tab-panel.styles.js +1 -1
  45. package/dist/esm/tab-panel/tab-panel.styles.js.map +1 -1
  46. package/dist/esm/tabs/tabs.styles.js +1 -1
  47. package/dist/esm/tabs/tabs.styles.js.map +1 -1
  48. package/dist/esm/text/text.styles.js +1 -1
  49. package/dist/esm/text/text.styles.js.map +1 -1
  50. package/dist/esm/text-input/text-input.styles.js +1 -1
  51. package/dist/esm/text-input/text-input.styles.js.map +1 -1
  52. package/dist/esm/toggle-button/toggle-button.styles.js +1 -1
  53. package/dist/esm/toggle-button/toggle-button.styles.js.map +1 -1
  54. package/dist/esm/utils/behaviors/match-media-stylesheet-behavior.js +142 -0
  55. package/dist/esm/utils/behaviors/match-media-stylesheet-behavior.js.map +1 -0
  56. package/dist/esm/utils/display.js +15 -0
  57. package/dist/esm/utils/display.js.map +1 -0
  58. package/dist/esm/utils/index.js +2 -0
  59. package/dist/esm/utils/index.js.map +1 -1
  60. package/dist/fluent-web-components.api.json +773 -0
  61. package/dist/storybook/{284.0946b1fb.iframe.bundle.js → 289.703b1698.iframe.bundle.js} +2 -2
  62. package/dist/storybook/{284.0946b1fb.iframe.bundle.js.LICENSE.txt → 289.703b1698.iframe.bundle.js.LICENSE.txt} +1 -1
  63. package/dist/storybook/iframe.html +1 -1
  64. package/dist/storybook/main.81e47c59.iframe.bundle.js +2 -0
  65. package/dist/storybook/project.json +1 -1
  66. package/dist/web-components.d.ts +161 -0
  67. package/dist/web-components.js +490 -361
  68. package/dist/web-components.min.js +137 -137
  69. package/docs/api-report.md +46 -0
  70. package/package.json +2 -2
  71. package/tensile.config.js +0 -2
  72. package/dist/storybook/main.b9de79ac.iframe.bundle.js +0 -2
  73. /package/dist/storybook/{main.b9de79ac.iframe.bundle.js.LICENSE.txt → main.81e47c59.iframe.bundle.js.LICENSE.txt} +0 -0
@@ -1 +1 @@
1
- {"generatedAt":1712635583202,"builder":{"name":"webpack5"},"hasCustomBabel":false,"hasCustomWebpack":true,"hasStaticDirs":true,"hasStorybookEslint":false,"refCount":0,"monorepo":"Nx","packageManager":{"type":"yarn","version":"1.23.34"},"storybookVersion":"6.5.15","language":"typescript","storybookPackages":{"@storybook/html":{"version":null}},"framework":{"name":"html"},"addons":{"@storybook/addon-docs":{"version":"6.5.15"},"@storybook/addon-essentials":{"options":{"backgrounds":false,"viewport":false,"toolbars":false,"actions":true},"version":"6.5.15"}}}
1
+ {"generatedAt":1713154074770,"builder":{"name":"webpack5"},"hasCustomBabel":false,"hasCustomWebpack":true,"hasStaticDirs":true,"hasStorybookEslint":false,"refCount":0,"monorepo":"Nx","packageManager":{"type":"yarn","version":"1.23.34"},"storybookVersion":"6.5.15","language":"typescript","storybookPackages":{"@storybook/html":{"version":null}},"framework":{"name":"html"},"addons":{"@storybook/addon-docs":{"version":"6.5.15"},"@storybook/addon-essentials":{"options":{"backgrounds":false,"viewport":false,"toolbars":false,"actions":true},"version":"6.5.15"}}}
@@ -4,6 +4,8 @@ import { ElementStyles } from '@microsoft/fast-element';
4
4
  import { ElementViewTemplate } from '@microsoft/fast-element';
5
5
  import { FASTElement } from '@microsoft/fast-element';
6
6
  import { FASTElementDefinition } from '@microsoft/fast-element';
7
+ import type { HostBehavior } from '@microsoft/fast-element';
8
+ import type { HostController } from '@microsoft/fast-element';
7
9
  import { HTMLDirective } from '@microsoft/fast-element';
8
10
  import { Orientation } from '@microsoft/fast-web-utilities';
9
11
  import type { SyntheticViewTemplate } from '@microsoft/fast-element';
@@ -2488,6 +2490,12 @@ export declare const CounterBadgeStyles: ElementStyles;
2488
2490
  */
2489
2491
  export declare const CounterBadgeTemplate: ElementViewTemplate<CounterBadge>;
2490
2492
 
2493
+ /**
2494
+ * Define all possible CSS display values.
2495
+ * @public
2496
+ */
2497
+ export declare type CSSDisplayPropertyValue = 'block' | 'contents' | 'flex' | 'grid' | 'inherit' | 'initial' | 'inline' | 'inline-block' | 'inline-flex' | 'inline-grid' | 'inline-table' | 'list-item' | 'none' | 'run-in' | 'table' | 'table-caption' | 'table-cell' | 'table-column' | 'table-column-group' | 'table-footer-group' | 'table-header-group' | 'table-row' | 'table-row-group';
2498
+
2491
2499
  export declare const curveAccelerateMax = "var(--curveAccelerateMax)";
2492
2500
 
2493
2501
  export declare const curveAccelerateMid = "var(--curveAccelerateMid)";
@@ -2506,6 +2514,12 @@ export declare const curveEasyEaseMax = "var(--curveEasyEaseMax)";
2506
2514
 
2507
2515
  export declare const curveLinear = "var(--curveLinear)";
2508
2516
 
2517
+ /**
2518
+ * This can be used to construct a behavior to apply a prefers color scheme: dark only stylesheet.
2519
+ * @public
2520
+ */
2521
+ export declare const darkModeStylesheetBehavior: (styles: ElementStyles) => MatchMediaStyleSheetBehavior;
2522
+
2509
2523
  /**
2510
2524
  * Includes ARIA states and properties relating to the ARIA button role
2511
2525
  *
@@ -2794,6 +2808,14 @@ export declare const DialogStyles: ElementStyles;
2794
2808
  */
2795
2809
  export declare const DialogTemplate: ElementViewTemplate<Dialog>;
2796
2810
 
2811
+ /**
2812
+ * Applies a CSS display property.
2813
+ * Also adds CSS rules to not display the element when the [hidden] attribute is applied to the element.
2814
+ * @param display - The CSS display property value
2815
+ * @public
2816
+ */
2817
+ export declare function display(displayValue: CSSDisplayPropertyValue): string;
2818
+
2797
2819
  /**
2798
2820
  * @class Divider component
2799
2821
  *
@@ -3051,6 +3073,12 @@ export declare const fontWeightRegular = "var(--fontWeightRegular)";
3051
3073
 
3052
3074
  export declare const fontWeightSemibold = "var(--fontWeightSemibold)";
3053
3075
 
3076
+ /**
3077
+ * This can be used to construct a behavior to apply a forced-colors only stylesheet.
3078
+ * @public
3079
+ */
3080
+ export declare const forcedColorsStylesheetBehavior: (styles: ElementStyles) => MatchMediaStyleSheetBehavior;
3081
+
3054
3082
  /**
3055
3083
  * Base function for providing Custom Element Form Association.
3056
3084
  *
@@ -3147,6 +3175,22 @@ declare class FormAssociatedTextField extends FormAssociatedTextField_base {
3147
3175
 
3148
3176
  declare const FormAssociatedTextField_base: typeof _TextField;
3149
3177
 
3178
+ /**
3179
+ * Determines the current localization direction of an element.
3180
+ *
3181
+ * @param rootNode - the HTMLElement to begin the query from, usually "this" when used in a component controller
3182
+ * @returns the localization direction of the element
3183
+ *
3184
+ * @public
3185
+ */
3186
+ export declare const getDirection: (rootNode: HTMLElement) => Direction;
3187
+
3188
+ /**
3189
+ * A CSS fragment to set `display: none;` when the host is hidden using the [hidden] attribute.
3190
+ * @public
3191
+ */
3192
+ export declare const hidden = ":host([hidden]){display:none}";
3193
+
3150
3194
  /**
3151
3195
  * The base class used for constucting a fluent image custom element
3152
3196
  * @public
@@ -3333,6 +3377,12 @@ declare const LabelWeight: {
3333
3377
  */
3334
3378
  declare type LabelWeight = ValuesOf<typeof LabelWeight>;
3335
3379
 
3380
+ /**
3381
+ * This can be used to construct a behavior to apply a prefers color scheme: light only stylesheet.
3382
+ * @public
3383
+ */
3384
+ export declare const lightModeStylesheetBehavior: (styles: ElementStyles) => MatchMediaStyleSheetBehavior;
3385
+
3336
3386
  export declare const lineHeightBase100 = "var(--lineHeightBase100)";
3337
3387
 
3338
3388
  export declare const lineHeightBase200 = "var(--lineHeightBase200)";
@@ -3353,6 +3403,117 @@ export declare const lineHeightHero800 = "var(--lineHeightHero800)";
3353
3403
 
3354
3404
  export declare const lineHeightHero900 = "var(--lineHeightHero900)";
3355
3405
 
3406
+ /**
3407
+ * An abstract behavior to react to media queries. Implementations should implement
3408
+ * the `constructListener` method to perform some action based on media query changes.
3409
+ *
3410
+ * @public
3411
+ */
3412
+ export declare abstract class MatchMediaBehavior implements HostBehavior {
3413
+ /**
3414
+ * The behavior needs to operate on element instances but elements might share a behavior instance.
3415
+ * To ensure proper attachment / detachment per instance, we construct a listener for
3416
+ * each bind invocation and cache the listeners by element reference.
3417
+ */
3418
+ private listenerCache;
3419
+ /**
3420
+ * The media query that the behavior operates on.
3421
+ */
3422
+ readonly query: MediaQueryList;
3423
+ /**
3424
+ *
3425
+ * @param query - The media query to operate from.
3426
+ */
3427
+ constructor(query: MediaQueryList);
3428
+ /**
3429
+ * Constructs a function that will be invoked with the MediaQueryList context
3430
+ * @param controller - The host controller orchestrating this behavior.
3431
+ */
3432
+ protected abstract constructListener(controller: HostController): MediaQueryListListener;
3433
+ /**
3434
+ * Binds the behavior to the element.
3435
+ * @param controller - The host controller orchestrating this behavior.
3436
+ */
3437
+ connectedCallback(controller: HostController): void;
3438
+ /**
3439
+ * Unbinds the behavior from the element.
3440
+ * @param controller - The host controller orchestrating this behavior.
3441
+ */
3442
+ disconnectedCallback(controller: HostController): void;
3443
+ }
3444
+
3445
+ /**
3446
+ * A behavior to add or remove a stylesheet from an element based on a media query. The behavior ensures that
3447
+ * styles are applied while the a query matches the environment and that styles are not applied if the query does
3448
+ * not match the environment.
3449
+ *
3450
+ * @public
3451
+ */
3452
+ export declare class MatchMediaStyleSheetBehavior extends MatchMediaBehavior {
3453
+ /**
3454
+ * The media query that the behavior operates on.
3455
+ */
3456
+ readonly query: MediaQueryList;
3457
+ /**
3458
+ * The styles object to be managed by the behavior.
3459
+ */
3460
+ readonly styles: ElementStyles;
3461
+ /**
3462
+ * Constructs a {@link MatchMediaStyleSheetBehavior} instance.
3463
+ * @param query - The media query to operate from.
3464
+ * @param styles - The styles to coordinate with the query.
3465
+ */
3466
+ constructor(query: MediaQueryList, styles: ElementStyles);
3467
+ /**
3468
+ * Defines a function to construct {@link MatchMediaStyleSheetBehavior | MatchMediaStyleSheetBehaviors} for
3469
+ * a provided query.
3470
+ * @param query - The media query to operate from.
3471
+ *
3472
+ * @public
3473
+ * @example
3474
+ *
3475
+ * ```ts
3476
+ * import { css } from "@microsoft/fast-element";
3477
+ * import { MatchMediaStyleSheetBehavior } from "@fluentui/web-components";
3478
+ *
3479
+ * const landscapeBehavior = MatchMediaStyleSheetBehavior.with(
3480
+ * window.matchMedia("(orientation: landscape)")
3481
+ * );
3482
+ *
3483
+ * const styles = css`
3484
+ * :host {
3485
+ * width: 200px;
3486
+ * height: 400px;
3487
+ * }
3488
+ * `
3489
+ * .withBehaviors(landscapeBehavior(css`
3490
+ * :host {
3491
+ * width: 400px;
3492
+ * height: 200px;
3493
+ * }
3494
+ * `))
3495
+ * ```
3496
+ */
3497
+ static with(query: MediaQueryList): (styles: ElementStyles) => MatchMediaStyleSheetBehavior;
3498
+ /**
3499
+ * Constructs a match-media listener for a provided element.
3500
+ * @param source - the element for which to attach or detach styles.
3501
+ */
3502
+ protected constructListener(controller: HostController): MediaQueryListListener;
3503
+ /**
3504
+ * Unbinds the behavior from the element.
3505
+ * @param controller - The host controller orchestrating this behavior.
3506
+ * @internal
3507
+ */
3508
+ removedCallback(controller: HostController<any>): void;
3509
+ }
3510
+
3511
+ /**
3512
+ * An event listener fired by a {@link https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList | MediaQueryList }.
3513
+ * @public
3514
+ */
3515
+ export declare type MediaQueryListListener = (this: MediaQueryList, ev?: MediaQueryListEvent) => void;
3516
+
3356
3517
  /**
3357
3518
  * The Menu class represents a menu component.
3358
3519
  * @public