@fluentui/web-components 2.5.11 → 3.0.0-alpha.1
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.
- package/CHANGELOG.json +16 -47
- package/CHANGELOG.md +6 -24
- package/dist/dts/index-rollup.d.ts +0 -7
- package/dist/dts/index.d.ts +1 -49
- package/dist/dts/theme/design-tokens.d.ts +379 -0
- package/dist/dts/theme/index.d.ts +2 -0
- package/dist/dts/theme/set-theme.d.ts +6 -0
- package/dist/dts/{anchored-region/anchored-region.stories.d.ts → theme/theme.stories.d.ts} +1 -2
- package/dist/esm/index-rollup.js +0 -11
- package/dist/esm/index.js +1 -49
- package/dist/esm/theme/design-tokens.js +381 -0
- package/dist/esm/theme/index.js +2 -0
- package/dist/esm/theme/set-theme.js +11 -0
- package/dist/esm/theme/theme.stories.js +21 -0
- package/dist/fluent-web-components.api.json +6 -19807
- package/dist/web-components.d.ts +1 -2980
- package/dist/web-components.js +2 -21988
- package/dist/web-components.min.js +1 -254
- package/docs/api-report.md +1 -1723
- package/package.json +14 -6
- package/public/theme-switch.ts +13 -0
- package/dist/dts/_docs/design-system/color-explorer/app.d.ts +0 -25
- package/dist/dts/_docs/design-system/color-explorer/colors.d.ts +0 -13
- package/dist/dts/_docs/design-system/color-explorer/component-types.d.ts +0 -6
- package/dist/dts/_docs/design-system/color-explorer/components/color-block.d.ts +0 -10
- package/dist/dts/_docs/design-system/color-explorer/components/color-picker/color-picker.d.ts +0 -190
- package/dist/dts/_docs/design-system/color-explorer/components/color-picker/color-picker.form-associated.d.ts +0 -15
- package/dist/dts/_docs/design-system/color-explorer/components/color-picker/color-picker.styles.d.ts +0 -3
- package/dist/dts/_docs/design-system/color-explorer/components/color-picker/color-picker.template.d.ts +0 -8
- package/dist/dts/_docs/design-system/color-explorer/components/color-picker/index.d.ts +0 -9
- package/dist/dts/_docs/design-system/color-explorer/components/control-pane/control-pane.d.ts +0 -8
- package/dist/dts/_docs/design-system/color-explorer/components/control-pane/control-pane.styles.d.ts +0 -1
- package/dist/dts/_docs/design-system/color-explorer/components/control-pane/control-pane.template.d.ts +0 -2
- package/dist/dts/_docs/design-system/color-explorer/components/control-pane/index.d.ts +0 -6
- package/dist/dts/_docs/design-system/color-explorer/components/gradient/gradient.d.ts +0 -5
- package/dist/dts/_docs/design-system/color-explorer/components/gradient/gradient.styles.d.ts +0 -1
- package/dist/dts/_docs/design-system/color-explorer/components/gradient/gradient.template.d.ts +0 -2
- package/dist/dts/_docs/design-system/color-explorer/components/gradient/index.d.ts +0 -6
- package/dist/dts/_docs/design-system/color-explorer/components/layer-background/index.d.ts +0 -21
- package/dist/dts/_docs/design-system/color-explorer/components/sample-app/index.d.ts +0 -6
- package/dist/dts/_docs/design-system/color-explorer/components/sample-app/sample-app.d.ts +0 -3
- package/dist/dts/_docs/design-system/color-explorer/components/sample-app/sample-app.styles.d.ts +0 -1
- package/dist/dts/_docs/design-system/color-explorer/components/sample-app/sample-app.template.d.ts +0 -1
- package/dist/dts/_docs/design-system/color-explorer/components/sample-page/index.d.ts +0 -6
- package/dist/dts/_docs/design-system/color-explorer/components/sample-page/sample-page.d.ts +0 -3
- package/dist/dts/_docs/design-system/color-explorer/components/sample-page/sample-page.styles.d.ts +0 -1
- package/dist/dts/_docs/design-system/color-explorer/components/sample-page/sample-page.template.d.ts +0 -1
- package/dist/dts/_docs/design-system/color-explorer/components/swatch.d.ts +0 -30
- package/dist/dts/_docs/design-system/color-explorer/custom-elements.d.ts +0 -7
- package/dist/dts/_docs/design-system/color-explorer/index.d.ts +0 -2
- package/dist/dts/accordion/accordion-item/accordion-item.styles.d.ts +0 -3
- package/dist/dts/accordion/accordion-item/index.d.ts +0 -17
- package/dist/dts/accordion/accordion.stories.d.ts +0 -15
- package/dist/dts/accordion/accordion.styles.d.ts +0 -3
- package/dist/dts/accordion/index.d.ts +0 -22
- package/dist/dts/anchor/anchor.stories.d.ts +0 -14
- package/dist/dts/anchor/anchor.styles.d.ts +0 -3
- package/dist/dts/anchor/index.d.ts +0 -49
- package/dist/dts/anchored-region/anchored-region.styles.d.ts +0 -3
- package/dist/dts/anchored-region/index.d.ts +0 -21
- package/dist/dts/badge/badge.stories.d.ts +0 -14
- package/dist/dts/badge/badge.styles.d.ts +0 -3
- package/dist/dts/badge/index.d.ts +0 -29
- package/dist/dts/breadcrumb/breadcrumb.stories.d.ts +0 -15
- package/dist/dts/breadcrumb/breadcrumb.styles.d.ts +0 -3
- package/dist/dts/breadcrumb/index.d.ts +0 -21
- package/dist/dts/breadcrumb-item/breadcrumb-item.stories.d.ts +0 -15
- package/dist/dts/breadcrumb-item/breadcrumb-item.styles.d.ts +0 -3
- package/dist/dts/breadcrumb-item/index.d.ts +0 -21
- package/dist/dts/button/button.stories.d.ts +0 -21
- package/dist/dts/button/button.styles.d.ts +0 -3
- package/dist/dts/button/index.d.ts +0 -48
- package/dist/dts/calendar/calendar.stories.d.ts +0 -86
- package/dist/dts/calendar/calendar.styles.d.ts +0 -7
- package/dist/dts/calendar/index.d.ts +0 -18
- package/dist/dts/card/card.stories.d.ts +0 -15
- package/dist/dts/card/card.styles.d.ts +0 -3
- package/dist/dts/card/index.d.ts +0 -46
- package/dist/dts/checkbox/checkbox.stories.d.ts +0 -28
- package/dist/dts/checkbox/checkbox.styles.d.ts +0 -3
- package/dist/dts/checkbox/index.d.ts +0 -16
- package/dist/dts/color/palette.d.ts +0 -73
- package/dist/dts/color/recipe.d.ts +0 -20
- package/dist/dts/color/recipes/contrast-and-delta-swatch-set.d.ts +0 -11
- package/dist/dts/color/recipes/contrast-swatch.d.ts +0 -12
- package/dist/dts/color/recipes/delta-swatch-set.d.ts +0 -36
- package/dist/dts/color/recipes/delta-swatch.d.ts +0 -12
- package/dist/dts/color/recipes/focus-stroke.d.ts +0 -10
- package/dist/dts/color/recipes/foreground-on-accent.d.ts +0 -11
- package/dist/dts/color/recipes/gradient-shadow-stroke.d.ts +0 -7
- package/dist/dts/color/recipes/gradient-swatch.d.ts +0 -36
- package/dist/dts/color/recipes/neutral-layer-1.d.ts +0 -10
- package/dist/dts/color/recipes/neutral-layer-2.d.ts +0 -6
- package/dist/dts/color/recipes/neutral-layer-3.d.ts +0 -6
- package/dist/dts/color/recipes/neutral-layer-4.d.ts +0 -6
- package/dist/dts/color/recipes/neutral-layer-floating.d.ts +0 -6
- package/dist/dts/color/recipes/underline-stroke.d.ts +0 -7
- package/dist/dts/color/swatch.d.ts +0 -31
- package/dist/dts/color/utilities/base-layer-luminance.d.ts +0 -11
- package/dist/dts/color/utilities/binary-search.d.ts +0 -4
- package/dist/dts/color/utilities/color-constants.d.ts +0 -14
- package/dist/dts/color/utilities/direction-by-is-dark.d.ts +0 -5
- package/dist/dts/color/utilities/is-dark.d.ts +0 -9
- package/dist/dts/color/utilities/relative-luminance.d.ts +0 -13
- package/dist/dts/combobox/combobox.stories.d.ts +0 -36
- package/dist/dts/combobox/combobox.styles.d.ts +0 -3
- package/dist/dts/combobox/index.d.ts +0 -43
- package/dist/dts/component-definitions.d.ts +0 -43
- package/dist/dts/custom-elements.d.ts +0 -103
- package/dist/dts/data-grid/data-grid-cell.styles.d.ts +0 -3
- package/dist/dts/data-grid/data-grid-row.styles.d.ts +0 -3
- package/dist/dts/data-grid/data-grid.stories.d.ts +0 -15
- package/dist/dts/data-grid/data-grid.styles.d.ts +0 -3
- package/dist/dts/data-grid/index.d.ts +0 -45
- package/dist/dts/design-system-provider/index.d.ts +0 -582
- package/dist/dts/design-tokens.d.ts +0 -519
- package/dist/dts/dialog/dialog.stories.d.ts +0 -25
- package/dist/dts/dialog/dialog.styles.d.ts +0 -3
- package/dist/dts/dialog/index.d.ts +0 -21
- package/dist/dts/divider/divider.stories.d.ts +0 -6
- package/dist/dts/divider/divider.styles.d.ts +0 -3
- package/dist/dts/divider/index.d.ts +0 -21
- package/dist/dts/flipper/flipper.stories.d.ts +0 -17
- package/dist/dts/flipper/flipper.styles.d.ts +0 -3
- package/dist/dts/flipper/index.d.ts +0 -21
- package/dist/dts/fluent-design-system.d.ts +0 -9
- package/dist/dts/horizontal-scroll/horizontal-scroll.stories.d.ts +0 -15
- package/dist/dts/horizontal-scroll/horizontal-scroll.styles.d.ts +0 -12
- package/dist/dts/horizontal-scroll/index.d.ts +0 -25
- package/dist/dts/listbox/index.d.ts +0 -19
- package/dist/dts/listbox/listbox.stories.d.ts +0 -6
- package/dist/dts/listbox/listbox.styles.d.ts +0 -3
- package/dist/dts/listbox-option/index.d.ts +0 -17
- package/dist/dts/listbox-option/listbox-option.stories.d.ts +0 -23
- package/dist/dts/listbox-option/listbox-option.styles.d.ts +0 -3
- package/dist/dts/menu/index.d.ts +0 -26
- package/dist/dts/menu/menu.stories.d.ts +0 -6
- package/dist/dts/menu/menu.styles.d.ts +0 -3
- package/dist/dts/menu-item/index.d.ts +0 -21
- package/dist/dts/menu-item/menu-item.stories.d.ts +0 -18
- package/dist/dts/menu-item/menu-item.styles.d.ts +0 -3
- package/dist/dts/number-field/index.d.ts +0 -41
- package/dist/dts/number-field/number-field.stories.d.ts +0 -71
- package/dist/dts/number-field/number-field.styles.d.ts +0 -3
- package/dist/dts/progress/index.d.ts +0 -2
- package/dist/dts/progress/progress/index.d.ts +0 -22
- package/dist/dts/progress/progress/progress.stories.d.ts +0 -15
- package/dist/dts/progress/progress/progress.styles.d.ts +0 -3
- package/dist/dts/progress/progress-ring/index.d.ts +0 -22
- package/dist/dts/progress/progress-ring/progress-ring.stories.d.ts +0 -15
- package/dist/dts/progress/progress-ring/progress-ring.styles.d.ts +0 -3
- package/dist/dts/radio/index.d.ts +0 -21
- package/dist/dts/radio/radio.stories.d.ts +0 -23
- package/dist/dts/radio/radio.styles.d.ts +0 -3
- package/dist/dts/radio-group/index.d.ts +0 -21
- package/dist/dts/radio-group/radio-group.stories.d.ts +0 -18
- package/dist/dts/radio-group/radio-group.styles.d.ts +0 -3
- package/dist/dts/search/index.d.ts +0 -38
- package/dist/dts/search/search.stories.d.ts +0 -75
- package/dist/dts/search/search.styles.d.ts +0 -3
- package/dist/dts/search/search.template.d.ts +0 -6
- package/dist/dts/select/index.d.ts +0 -44
- package/dist/dts/select/select.stories.d.ts +0 -28
- package/dist/dts/select/select.styles.d.ts +0 -13
- package/dist/dts/skeleton/index.d.ts +0 -21
- package/dist/dts/skeleton/skeleton.stories.d.ts +0 -20
- package/dist/dts/skeleton/skeleton.styles.d.ts +0 -3
- package/dist/dts/slider/index.d.ts +0 -21
- package/dist/dts/slider/slider.stories.d.ts +0 -14
- package/dist/dts/slider/slider.styles.d.ts +0 -3
- package/dist/dts/slider-label/index.d.ts +0 -21
- package/dist/dts/slider-label/slider-label.stories.d.ts +0 -23
- package/dist/dts/slider-label/slider-label.styles.d.ts +0 -3
- package/dist/dts/styles/direction.d.ts +0 -34
- package/dist/dts/styles/elevation.d.ts +0 -64
- package/dist/dts/styles/focus.d.ts +0 -13
- package/dist/dts/styles/index.d.ts +0 -5
- package/dist/dts/styles/patterns/button.styles.d.ts +0 -31
- package/dist/dts/styles/patterns/index.d.ts +0 -3
- package/dist/dts/styles/patterns/input.styles.d.ts +0 -30
- package/dist/dts/styles/patterns/type-ramp.d.ts +0 -18
- package/dist/dts/styles/size.d.ts +0 -7
- package/dist/dts/switch/index.d.ts +0 -21
- package/dist/dts/switch/switch.stories.d.ts +0 -18
- package/dist/dts/switch/switch.styles.d.ts +0 -3
- package/dist/dts/tabs/index.d.ts +0 -23
- package/dist/dts/tabs/tab/index.d.ts +0 -21
- package/dist/dts/tabs/tab/tab.styles.d.ts +0 -3
- package/dist/dts/tabs/tab-panel/index.d.ts +0 -21
- package/dist/dts/tabs/tab-panel/tab-panel.styles.d.ts +0 -3
- package/dist/dts/tabs/tabs.stories.d.ts +0 -19
- package/dist/dts/tabs/tabs.styles.d.ts +0 -3
- package/dist/dts/text-area/index.d.ts +0 -45
- package/dist/dts/text-area/text-area.stories.d.ts +0 -41
- package/dist/dts/text-area/text-area.styles.d.ts +0 -3
- package/dist/dts/text-field/index.d.ts +0 -45
- package/dist/dts/text-field/text-field.stories.d.ts +0 -81
- package/dist/dts/text-field/text-field.styles.d.ts +0 -3
- package/dist/dts/toolbar/index.d.ts +0 -17
- package/dist/dts/toolbar/toolbar.stories.d.ts +0 -9
- package/dist/dts/toolbar/toolbar.styles.d.ts +0 -3
- package/dist/dts/tooltip/index.d.ts +0 -21
- package/dist/dts/tooltip/tooltip.stories.d.ts +0 -14
- package/dist/dts/tooltip/tooltip.styles.d.ts +0 -3
- package/dist/dts/tree-item/index.d.ts +0 -22
- package/dist/dts/tree-item/tree-item.stories.d.ts +0 -18
- package/dist/dts/tree-item/tree-item.styles.d.ts +0 -4
- package/dist/dts/tree-view/index.d.ts +0 -22
- package/dist/dts/tree-view/tree-view.stories.d.ts +0 -13
- package/dist/dts/tree-view/tree-view.styles.d.ts +0 -3
- package/dist/dts/utilities/behaviors.d.ts +0 -12
- package/dist/dts/utilities/type-ramp.d.ts +0 -12
- package/dist/esm/_docs/design-system/color-explorer/app.js +0 -247
- package/dist/esm/_docs/design-system/color-explorer/colors.js +0 -24
- package/dist/esm/_docs/design-system/color-explorer/component-types.js +0 -7
- package/dist/esm/_docs/design-system/color-explorer/components/color-block.js +0 -408
- package/dist/esm/_docs/design-system/color-explorer/components/color-picker/color-picker.form-associated.js +0 -16
- package/dist/esm/_docs/design-system/color-explorer/components/color-picker/color-picker.js +0 -297
- package/dist/esm/_docs/design-system/color-explorer/components/color-picker/color-picker.styles.js +0 -124
- package/dist/esm/_docs/design-system/color-explorer/components/color-picker/color-picker.template.js +0 -130
- package/dist/esm/_docs/design-system/color-explorer/components/color-picker/index.js +0 -15
- package/dist/esm/_docs/design-system/color-explorer/components/control-pane/control-pane.js +0 -24
- package/dist/esm/_docs/design-system/color-explorer/components/control-pane/control-pane.styles.js +0 -19
- package/dist/esm/_docs/design-system/color-explorer/components/control-pane/control-pane.template.js +0 -52
- package/dist/esm/_docs/design-system/color-explorer/components/control-pane/index.js +0 -18
- package/dist/esm/_docs/design-system/color-explorer/components/gradient/gradient.js +0 -11
- package/dist/esm/_docs/design-system/color-explorer/components/gradient/gradient.styles.js +0 -31
- package/dist/esm/_docs/design-system/color-explorer/components/gradient/gradient.template.js +0 -21
- package/dist/esm/_docs/design-system/color-explorer/components/gradient/index.js +0 -18
- package/dist/esm/_docs/design-system/color-explorer/components/layer-background/index.js +0 -70
- package/dist/esm/_docs/design-system/color-explorer/components/sample-app/index.js +0 -18
- package/dist/esm/_docs/design-system/color-explorer/components/sample-app/sample-app.js +0 -3
- package/dist/esm/_docs/design-system/color-explorer/components/sample-app/sample-app.styles.js +0 -166
- package/dist/esm/_docs/design-system/color-explorer/components/sample-app/sample-app.template.js +0 -97
- package/dist/esm/_docs/design-system/color-explorer/components/sample-page/index.js +0 -18
- package/dist/esm/_docs/design-system/color-explorer/components/sample-page/sample-page.js +0 -3
- package/dist/esm/_docs/design-system/color-explorer/components/sample-page/sample-page.styles.js +0 -130
- package/dist/esm/_docs/design-system/color-explorer/components/sample-page/sample-page.template.js +0 -82
- package/dist/esm/_docs/design-system/color-explorer/components/swatch.js +0 -163
- package/dist/esm/_docs/design-system/color-explorer/custom-elements.js +0 -3
- package/dist/esm/_docs/design-system/color-explorer/index.js +0 -14
- package/dist/esm/accordion/accordion-item/accordion-item.styles.js +0 -154
- package/dist/esm/accordion/accordion-item/accordion-item.vscode.definition.json +0 -67
- package/dist/esm/accordion/accordion-item/index.js +0 -32
- package/dist/esm/accordion/accordion.stories.js +0 -66
- package/dist/esm/accordion/accordion.styles.js +0 -13
- package/dist/esm/accordion/accordion.vscode.definition.json +0 -35
- package/dist/esm/accordion/index.js +0 -27
- package/dist/esm/anchor/anchor.stories.js +0 -34
- package/dist/esm/anchor/anchor.styles.js +0 -5
- package/dist/esm/anchor/anchor.vscode.definition.json +0 -138
- package/dist/esm/anchor/index.js +0 -67
- package/dist/esm/anchored-region/anchored-region.stories.js +0 -133
- package/dist/esm/anchored-region/anchored-region.styles.js +0 -7
- package/dist/esm/anchored-region/anchored-region.vscode.definition.json +0 -140
- package/dist/esm/anchored-region/index.js +0 -26
- package/dist/esm/badge/badge.stories.js +0 -27
- package/dist/esm/badge/badge.styles.js +0 -40
- package/dist/esm/badge/badge.vscode.definition.json +0 -60
- package/dist/esm/badge/index.js +0 -45
- package/dist/esm/breadcrumb/breadcrumb.stories.js +0 -20
- package/dist/esm/breadcrumb/breadcrumb.styles.js +0 -13
- package/dist/esm/breadcrumb/breadcrumb.vscode.definition.json +0 -18
- package/dist/esm/breadcrumb/index.js +0 -26
- package/dist/esm/breadcrumb-item/breadcrumb-item.stories.js +0 -16
- package/dist/esm/breadcrumb-item/breadcrumb-item.styles.js +0 -96
- package/dist/esm/breadcrumb-item/breadcrumb-item.vscode.definition.json +0 -50
- package/dist/esm/breadcrumb-item/index.js +0 -34
- package/dist/esm/button/button.stories.js +0 -40
- package/dist/esm/button/button.styles.js +0 -24
- package/dist/esm/button/button.vscode.definition.json +0 -158
- package/dist/esm/button/index.js +0 -67
- package/dist/esm/calendar/calendar.stories.js +0 -115
- package/dist/esm/calendar/calendar.styles.js +0 -132
- package/dist/esm/calendar/index.js +0 -31
- package/dist/esm/card/card.stories.js +0 -30
- package/dist/esm/card/card.styles.js +0 -28
- package/dist/esm/card/card.vscode.definition.json +0 -33
- package/dist/esm/card/index.js +0 -79
- package/dist/esm/checkbox/checkbox.stories.js +0 -43
- package/dist/esm/checkbox/checkbox.styles.js +0 -161
- package/dist/esm/checkbox/checkbox.vscode.definition.json +0 -69
- package/dist/esm/checkbox/index.js +0 -31
- package/dist/esm/color/palette.js +0 -250
- package/dist/esm/color/recipe.js +0 -1
- package/dist/esm/color/recipes/contrast-and-delta-swatch-set.js +0 -28
- package/dist/esm/color/recipes/contrast-swatch.js +0 -12
- package/dist/esm/color/recipes/delta-swatch-set.js +0 -53
- package/dist/esm/color/recipes/delta-swatch.js +0 -13
- package/dist/esm/color/recipes/focus-stroke.js +0 -14
- package/dist/esm/color/recipes/foreground-on-accent.js +0 -21
- package/dist/esm/color/recipes/gradient-shadow-stroke.js +0 -54
- package/dist/esm/color/recipes/gradient-swatch.js +0 -36
- package/dist/esm/color/recipes/neutral-layer-1.js +0 -13
- package/dist/esm/color/recipes/neutral-layer-2.js +0 -7
- package/dist/esm/color/recipes/neutral-layer-3.js +0 -7
- package/dist/esm/color/recipes/neutral-layer-4.js +0 -7
- package/dist/esm/color/recipes/neutral-layer-floating.js +0 -7
- package/dist/esm/color/recipes/underline-stroke.js +0 -31
- package/dist/esm/color/swatch.js +0 -53
- package/dist/esm/color/utilities/base-layer-luminance.js +0 -14
- package/dist/esm/color/utilities/binary-search.js +0 -15
- package/dist/esm/color/utilities/color-constants.js +0 -19
- package/dist/esm/color/utilities/direction-by-is-dark.js +0 -7
- package/dist/esm/color/utilities/is-dark.js +0 -17
- package/dist/esm/color/utilities/relative-luminance.js +0 -8
- package/dist/esm/combobox/combobox.stories.js +0 -84
- package/dist/esm/combobox/combobox.styles.js +0 -40
- package/dist/esm/combobox/combobox.vscode.definition.json +0 -121
- package/dist/esm/combobox/index.js +0 -63
- package/dist/esm/component-definitions.js +0 -84
- package/dist/esm/custom-elements.js +0 -102
- package/dist/esm/data-grid/data-grid-cell.styles.js +0 -36
- package/dist/esm/data-grid/data-grid-cell.vscode.definition.json +0 -34
- package/dist/esm/data-grid/data-grid-row.styles.js +0 -24
- package/dist/esm/data-grid/data-grid-row.vscode.definition.json +0 -34
- package/dist/esm/data-grid/data-grid.stories.js +0 -381
- package/dist/esm/data-grid/data-grid.styles.js +0 -8
- package/dist/esm/data-grid/data-grid.vscode.definition.json +0 -34
- package/dist/esm/data-grid/index.js +0 -60
- package/dist/esm/design-system-provider/design-system-provider.vscode.definition.json +0 -510
- package/dist/esm/design-system-provider/index.js +0 -518
- package/dist/esm/design-tokens.js +0 -685
- package/dist/esm/dialog/dialog.stories.js +0 -36
- package/dist/esm/dialog/dialog.styles.js +0 -47
- package/dist/esm/dialog/dialog.vscode.definition.json +0 -67
- package/dist/esm/dialog/index.js +0 -26
- package/dist/esm/divider/divider.stories.js +0 -17
- package/dist/esm/divider/divider.styles.js +0 -11
- package/dist/esm/divider/divider.vscode.definition.json +0 -29
- package/dist/esm/divider/index.js +0 -26
- package/dist/esm/flipper/flipper.stories.js +0 -31
- package/dist/esm/flipper/flipper.styles.js +0 -84
- package/dist/esm/flipper/flipper.vscode.definition.json +0 -56
- package/dist/esm/flipper/index.js +0 -36
- package/dist/esm/fluent-design-system.js +0 -11
- package/dist/esm/horizontal-scroll/horizontal-scroll.stories.js +0 -81
- package/dist/esm/horizontal-scroll/horizontal-scroll.styles.js +0 -138
- package/dist/esm/horizontal-scroll/horizontal-scroll.vscode.definition.json +0 -85
- package/dist/esm/horizontal-scroll/index.js +0 -47
- package/dist/esm/listbox/index.js +0 -24
- package/dist/esm/listbox/listbox.stories.js +0 -29
- package/dist/esm/listbox/listbox.styles.js +0 -21
- package/dist/esm/listbox/listbox.vscode.definition.json +0 -40
- package/dist/esm/listbox-option/index.js +0 -22
- package/dist/esm/listbox-option/listbox-option.stories.js +0 -38
- package/dist/esm/listbox-option/listbox-option.styles.js +0 -133
- package/dist/esm/listbox-option/listbox-option.vscode.definition.json +0 -45
- package/dist/esm/menu/index.js +0 -36
- package/dist/esm/menu/menu.stories.js +0 -56
- package/dist/esm/menu/menu.styles.js +0 -42
- package/dist/esm/menu/menu.vscode.definition.json +0 -18
- package/dist/esm/menu-item/index.js +0 -41
- package/dist/esm/menu-item/menu-item.stories.js +0 -34
- package/dist/esm/menu-item/menu-item.styles.js +0 -265
- package/dist/esm/menu-item/menu-item.vscode.definition.json +0 -82
- package/dist/esm/number-field/index.js +0 -57
- package/dist/esm/number-field/number-field.stories.js +0 -83
- package/dist/esm/number-field/number-field.styles.js +0 -71
- package/dist/esm/number-field/number-field.vscode.definition.json +0 -167
- package/dist/esm/progress/index.js +0 -2
- package/dist/esm/progress/progress/index.js +0 -33
- package/dist/esm/progress/progress/progress.stories.js +0 -59
- package/dist/esm/progress/progress/progress.styles.js +0 -119
- package/dist/esm/progress/progress/progress.vscode.definition.json +0 -56
- package/dist/esm/progress/progress-ring/index.js +0 -45
- package/dist/esm/progress/progress-ring/progress-ring.stories.js +0 -59
- package/dist/esm/progress/progress-ring/progress-ring.styles.js +0 -79
- package/dist/esm/progress/progress-ring/progress-ring.vscode.definition.json +0 -56
- package/dist/esm/radio/index.js +0 -31
- package/dist/esm/radio/radio.stories.js +0 -41
- package/dist/esm/radio/radio.styles.js +0 -152
- package/dist/esm/radio/radio.vscode.definition.json +0 -63
- package/dist/esm/radio-group/index.js +0 -26
- package/dist/esm/radio-group/radio-group.stories.js +0 -42
- package/dist/esm/radio-group/radio-group.styles.js +0 -21
- package/dist/esm/radio-group/radio-group.vscode.definition.json +0 -64
- package/dist/esm/search/index.js +0 -52
- package/dist/esm/search/search.stories.js +0 -83
- package/dist/esm/search/search.styles.js +0 -104
- package/dist/esm/search/search.template.js +0 -82
- package/dist/esm/search/search.vscode.definition.json +0 -145
- package/dist/esm/select/index.js +0 -61
- package/dist/esm/select/select.stories.js +0 -53
- package/dist/esm/select/select.styles.js +0 -139
- package/dist/esm/select/select.vscode.definition.json +0 -79
- package/dist/esm/skeleton/index.js +0 -26
- package/dist/esm/skeleton/skeleton.stories.js +0 -37
- package/dist/esm/skeleton/skeleton.styles.js +0 -77
- package/dist/esm/skeleton/skeleton.vscode.definition.json +0 -49
- package/dist/esm/slider/index.js +0 -29
- package/dist/esm/slider/slider.stories.js +0 -40
- package/dist/esm/slider/slider.styles.js +0 -162
- package/dist/esm/slider/slider.vscode.definition.json +0 -101
- package/dist/esm/slider-label/index.js +0 -26
- package/dist/esm/slider-label/slider-label.stories.js +0 -40
- package/dist/esm/slider-label/slider-label.styles.js +0 -77
- package/dist/esm/slider-label/slider-label.vscode.definition.json +0 -43
- package/dist/esm/styles/direction.js +0 -73
- package/dist/esm/styles/elevation.js +0 -74
- package/dist/esm/styles/focus.js +0 -21
- package/dist/esm/styles/index.js +0 -5
- package/dist/esm/styles/patterns/button.styles.js +0 -427
- package/dist/esm/styles/patterns/index.js +0 -3
- package/dist/esm/styles/patterns/input.styles.js +0 -227
- package/dist/esm/styles/patterns/type-ramp.js +0 -74
- package/dist/esm/styles/size.js +0 -9
- package/dist/esm/switch/index.js +0 -31
- package/dist/esm/switch/switch.stories.js +0 -42
- package/dist/esm/switch/switch.styles.js +0 -213
- package/dist/esm/switch/switch.vscode.definition.json +0 -68
- package/dist/esm/tabs/index.js +0 -28
- package/dist/esm/tabs/tab/index.js +0 -26
- package/dist/esm/tabs/tab/tab.styles.js +0 -75
- package/dist/esm/tabs/tab/tab.vscode.definition.json +0 -17
- package/dist/esm/tabs/tab-panel/index.js +0 -26
- package/dist/esm/tabs/tab-panel/tab-panel.styles.js +0 -11
- package/dist/esm/tabs/tab-panel/tab-panel.vscode.definition.json +0 -17
- package/dist/esm/tabs/tabs.stories.js +0 -105
- package/dist/esm/tabs/tabs.styles.js +0 -98
- package/dist/esm/tabs/tabs.vscode.definition.json +0 -50
- package/dist/esm/text-area/index.js +0 -56
- package/dist/esm/text-area/text-area.stories.js +0 -56
- package/dist/esm/text-area/text-area.styles.js +0 -39
- package/dist/esm/text-area/text-area.vscode.definition.json +0 -141
- package/dist/esm/text-field/index.js +0 -56
- package/dist/esm/text-field/text-field.stories.js +0 -88
- package/dist/esm/text-field/text-field.styles.js +0 -48
- package/dist/esm/text-field/text-field.vscode.definition.json +0 -150
- package/dist/esm/toolbar/index.js +0 -23
- package/dist/esm/toolbar/toolbar.stories.js +0 -9
- package/dist/esm/toolbar/toolbar.styles.js +0 -73
- package/dist/esm/tooltip/index.js +0 -31
- package/dist/esm/tooltip/tooltip.stories.js +0 -34
- package/dist/esm/tooltip/tooltip.styles.js +0 -107
- package/dist/esm/tooltip/tooltip.vscode.definition.json +0 -56
- package/dist/esm/tree-item/index.js +0 -32
- package/dist/esm/tree-item/tree-item.stories.js +0 -34
- package/dist/esm/tree-item/tree-item.styles.js +0 -227
- package/dist/esm/tree-item/tree-item.vscode.definition.json +0 -63
- package/dist/esm/tree-view/index.js +0 -27
- package/dist/esm/tree-view/tree-view.stories.js +0 -99
- package/dist/esm/tree-view/tree-view.styles.js +0 -14
- package/dist/esm/tree-view/tree-view.vscode.definition.json +0 -26
- package/dist/esm/utilities/behaviors.js +0 -13
- package/dist/esm/utilities/type-ramp.js +0 -12
- package/public/switches.ts +0 -24
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { FormAssociated, FoundationElement } from '@microsoft/fast-foundation';
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
class _ColorPicker extends FoundationElement {
|
|
4
|
-
}
|
|
5
|
-
/* eslint-enable */
|
|
6
|
-
/**
|
|
7
|
-
* A form-associated base class for the component.
|
|
8
|
-
*
|
|
9
|
-
* @internal
|
|
10
|
-
*/
|
|
11
|
-
export class FormAssociatedColorPicker extends FormAssociated(_ColorPicker) {
|
|
12
|
-
constructor() {
|
|
13
|
-
super(...arguments);
|
|
14
|
-
this.proxy = document.createElement('input');
|
|
15
|
-
}
|
|
16
|
-
}
|
|
@@ -1,297 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { ColorHSV, ColorRGBA64, hsvToRGB, parseColor, rgbToHSV } from '@microsoft/fast-colors';
|
|
3
|
-
import { attr, DOM, observable } from '@microsoft/fast-element';
|
|
4
|
-
import { isNullOrWhiteSpace } from '@microsoft/fast-web-utilities';
|
|
5
|
-
import { FormAssociatedColorPicker } from './color-picker.form-associated';
|
|
6
|
-
/**
|
|
7
|
-
* This is currently experimental, any use of the color picker must include the following
|
|
8
|
-
* imports and register with the DesignSystem
|
|
9
|
-
*
|
|
10
|
-
* import { fastTextField } from "@microsoft/fast-components";
|
|
11
|
-
* import { DesignSystem } from "@microsoft/fast-foundation";
|
|
12
|
-
* DesignSystem.getOrCreate().register(fastTextField());
|
|
13
|
-
*/
|
|
14
|
-
/**
|
|
15
|
-
* Simple class for storing all of the color picker UI observable values.
|
|
16
|
-
*/
|
|
17
|
-
class ColorPickerUI {
|
|
18
|
-
constructor(rgbColor, hsvColor) {
|
|
19
|
-
this.RGBColor = rgbColor;
|
|
20
|
-
this.HSVColor = hsvColor;
|
|
21
|
-
this.HueCSSColor = hsvToRGB(new ColorHSV(this.HSVColor.h, 1, 1)).toStringHexRGB();
|
|
22
|
-
this.HuePosition = (this.HSVColor.h / 360) * 100;
|
|
23
|
-
this.SatValLeftPos = this.HSVColor.s * 100;
|
|
24
|
-
this.SatValTopPos = 100 - this.HSVColor.v * 100;
|
|
25
|
-
this.AlphaPos = this.RGBColor.a * 100;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* A Color Picker Custom HTML Element.
|
|
30
|
-
*
|
|
31
|
-
* @public
|
|
32
|
-
*/
|
|
33
|
-
export class ColorPicker extends FormAssociatedColorPicker {
|
|
34
|
-
constructor() {
|
|
35
|
-
super(...arguments);
|
|
36
|
-
/**
|
|
37
|
-
* Flag indicating that the color UI is activily listening for mouse move and up events.
|
|
38
|
-
*/
|
|
39
|
-
this.mouseActive = false;
|
|
40
|
-
/**
|
|
41
|
-
* Object containing all of the properties displayed in the color picker UI.
|
|
42
|
-
*/
|
|
43
|
-
this.uiValues = new ColorPickerUI(new ColorRGBA64(1, 0, 0), new ColorHSV(0, 1, 1));
|
|
44
|
-
/**
|
|
45
|
-
* A reference to the HTMLElement that is the current target of mouse move events.
|
|
46
|
-
*/
|
|
47
|
-
this.currentMouseTarget = null;
|
|
48
|
-
}
|
|
49
|
-
readOnlyChanged() {
|
|
50
|
-
if (this.proxy instanceof HTMLElement) {
|
|
51
|
-
this.proxy.readOnly = this.readOnly;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
autofocusChanged() {
|
|
55
|
-
if (this.proxy instanceof HTMLElement) {
|
|
56
|
-
this.proxy.autofocus = this.autofocus;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
placeholderChanged() {
|
|
60
|
-
if (this.proxy instanceof HTMLElement) {
|
|
61
|
-
this.proxy.placeholder = this.placeholder;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* @internal
|
|
66
|
-
*/
|
|
67
|
-
connectedCallback() {
|
|
68
|
-
super.connectedCallback();
|
|
69
|
-
this.open = false;
|
|
70
|
-
this.initColorValues();
|
|
71
|
-
this.proxy.setAttribute('type', 'color');
|
|
72
|
-
if (this.autofocus) {
|
|
73
|
-
DOM.queueUpdate(() => {
|
|
74
|
-
this.focus();
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Handles the focus event. When the template has focus the color UI will be visable.
|
|
80
|
-
* @internal
|
|
81
|
-
*/
|
|
82
|
-
handleFocus() {
|
|
83
|
-
// Re-init colors in case the value changed externally since the UI was last visible.
|
|
84
|
-
this.initColorValues();
|
|
85
|
-
this.open = true;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Handles the blur event. Hides the color UI when the template loses focus.
|
|
89
|
-
* @internal
|
|
90
|
-
*/
|
|
91
|
-
handleBlur() {
|
|
92
|
-
this.open = false;
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Handles the internal control's `input` event. This event is fired whenever a user types directly into the primary text field.
|
|
96
|
-
* @internal
|
|
97
|
-
*/
|
|
98
|
-
handleTextInput() {
|
|
99
|
-
this.initialValue = this.control.value;
|
|
100
|
-
if (this.isValideCSSColor(this.value)) {
|
|
101
|
-
this.currentRGBColor = parseColor(this.value);
|
|
102
|
-
this.currentHSVColor = rgbToHSV(this.currentRGBColor);
|
|
103
|
-
this.updateUIValues(false);
|
|
104
|
-
this.$emit('change');
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Handles the mouse down event on the Sat/Val square and Hue and Alpha sliders. Sets the current targeted element and begins listening for mouse move events.
|
|
109
|
-
* @param param ['sv','h','a'] - string specifying which color property is being modified with the mouse.
|
|
110
|
-
* @param e - A reference to the mouse event.
|
|
111
|
-
*/
|
|
112
|
-
handleMouseDown(param, e) {
|
|
113
|
-
this.currentMouseTarget = e.composedPath()[0];
|
|
114
|
-
this.currentMouseParam = param;
|
|
115
|
-
this.updateFromMouseEvent(e.pageX, e.pageY);
|
|
116
|
-
this.mouseActive = true;
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Handles the mouse move event within the color UI. Is only called once the mouseActive is set to true.
|
|
120
|
-
* @param e - Reference to the Mouse Event
|
|
121
|
-
*/
|
|
122
|
-
handleMouseMove(e) {
|
|
123
|
-
this.updateFromMouseEvent(e.pageX, e.pageY);
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Handles the mouse up event within the color UI. Disables listening for mouse move events.
|
|
127
|
-
* @param e - Reference to the Mouse Event
|
|
128
|
-
*/
|
|
129
|
-
handleMouseUp(e) {
|
|
130
|
-
this.updateFromMouseEvent(e.pageX, e.pageY);
|
|
131
|
-
this.currentMouseTarget = null;
|
|
132
|
-
this.currentMouseParam = null;
|
|
133
|
-
this.mouseActive = false;
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Handles changes to any of the color property text inputs typed by the user.
|
|
137
|
-
* @param param ['r','g','b','a','h','s','v'] - String specifying which color value is being modified.
|
|
138
|
-
* @param e - Reference to the event.
|
|
139
|
-
*/
|
|
140
|
-
handleTextValueInput(param, e) {
|
|
141
|
-
const inputVal = e.composedPath()[0].value;
|
|
142
|
-
if (isNullOrWhiteSpace(inputVal) || Number.isNaN(inputVal)) {
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
const newVal = parseInt(inputVal, 10);
|
|
146
|
-
if (['r', 'g', 'b', 'a'].includes(param)) {
|
|
147
|
-
if ((param !== 'a' && this.isValidRGB(newVal)) || (param === 'a' && this.isValidAlpha(newVal))) {
|
|
148
|
-
this.currentRGBColor = new ColorRGBA64(param === 'r' ? newVal / 255 : this.currentRGBColor.r, param === 'g' ? newVal / 255 : this.currentRGBColor.g, param === 'b' ? newVal / 255 : this.currentRGBColor.b, param === 'a' ? newVal / 100 : this.currentRGBColor.a);
|
|
149
|
-
this.currentHSVColor = rgbToHSV(this.currentRGBColor);
|
|
150
|
-
this.updateUIValues(true);
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
else if (['h', 's', 'v'].includes(param)) {
|
|
154
|
-
if ((param !== 'h' && this.isValidSaturationValue(newVal)) || (param === 'h' && this.isValidHue(newVal))) {
|
|
155
|
-
this.updateHSV(param === 'h' ? newVal : this.currentHSVColor.h, param === 's' ? newVal / 100 : this.currentHSVColor.s, param === 'v' ? newVal / 100 : this.currentHSVColor.v);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* Change event handler for inner control.
|
|
161
|
-
* @remarks
|
|
162
|
-
* "Change" events are not `composable` so they will not
|
|
163
|
-
* permeate the shadow DOM boundary. This fn effectively proxies
|
|
164
|
-
* the change event, emitting a `change` event whenever the internal
|
|
165
|
-
* control emits a `change` event
|
|
166
|
-
* @internal
|
|
167
|
-
*/
|
|
168
|
-
handleChange() {
|
|
169
|
-
this.$emit('change');
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* Initialize internal color values based on input value and set the UI elements
|
|
173
|
-
* to the correct positions / values.
|
|
174
|
-
*/
|
|
175
|
-
initColorValues() {
|
|
176
|
-
if (!isNullOrWhiteSpace(this.value)) {
|
|
177
|
-
this.currentRGBColor = parseColor(this.value);
|
|
178
|
-
}
|
|
179
|
-
else {
|
|
180
|
-
this.currentRGBColor = new ColorRGBA64(1, 0, 0, 1);
|
|
181
|
-
}
|
|
182
|
-
this.currentHSVColor = rgbToHSV(this.currentRGBColor);
|
|
183
|
-
this.updateUIValues(false);
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* Determines if a number value is within the valid range for an R, G, or B color channel.
|
|
187
|
-
* @param val - Number to be evaluated.
|
|
188
|
-
*/
|
|
189
|
-
isValidRGB(val) {
|
|
190
|
-
return val >= 0 && val <= 255;
|
|
191
|
-
}
|
|
192
|
-
/**
|
|
193
|
-
* Determines if a number value is within the valid range for the alpha channel.
|
|
194
|
-
* @param val - Number to be evaluated.
|
|
195
|
-
*/
|
|
196
|
-
isValidAlpha(val) {
|
|
197
|
-
return val >= 0 && val <= 100;
|
|
198
|
-
}
|
|
199
|
-
/**
|
|
200
|
-
* Determines if a number value is within the valid range for the saturation or value color channels.
|
|
201
|
-
* @param val - Number to be evaluated.
|
|
202
|
-
*/
|
|
203
|
-
isValidSaturationValue(val) {
|
|
204
|
-
return val >= 0 && val <= 100;
|
|
205
|
-
}
|
|
206
|
-
/**
|
|
207
|
-
* Determines if a number value is within the valid range for the hue color channel.
|
|
208
|
-
* @param val - Number to be evaluated.
|
|
209
|
-
*/
|
|
210
|
-
isValidHue(val) {
|
|
211
|
-
return val >= 0 && val <= 359;
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
|
-
* Checks if input is a valid CSS color.
|
|
215
|
-
* After placing an invalid css color value into a color style property the value will be an empty string when read back.
|
|
216
|
-
* @internal
|
|
217
|
-
*/
|
|
218
|
-
isValideCSSColor(testValue) {
|
|
219
|
-
/* Set the background color of the proxy element since it is not visible in the UI. */
|
|
220
|
-
this.proxy.style.backgroundColor = '';
|
|
221
|
-
this.proxy.style.backgroundColor = testValue;
|
|
222
|
-
/* Read the value back out. If it was not a valid color value then it will be an empty string when read back out. */
|
|
223
|
-
return this.proxy.style.backgroundColor !== '';
|
|
224
|
-
}
|
|
225
|
-
/**
|
|
226
|
-
* Update the current color values to a new HSV color.
|
|
227
|
-
* @param hue The new Hue value.
|
|
228
|
-
* @param sat The new saturation value.
|
|
229
|
-
* @param val The new Value value.
|
|
230
|
-
*/
|
|
231
|
-
updateHSV(hue, sat, val) {
|
|
232
|
-
this.currentHSVColor = new ColorHSV(hue, sat, val);
|
|
233
|
-
this.currentRGBColor = hsvToRGB(this.currentHSVColor, this.currentRGBColor.a);
|
|
234
|
-
this.updateUIValues(true);
|
|
235
|
-
}
|
|
236
|
-
/**
|
|
237
|
-
* Update the current color values based on the mouse position over one of the three UI elements (hue, saturation/value, or alpha).
|
|
238
|
-
* @param pageX The pageX position of the mouse.
|
|
239
|
-
* @param pageY The pageY position of the mouse.
|
|
240
|
-
*/
|
|
241
|
-
updateFromMouseEvent(pageX, pageY) {
|
|
242
|
-
const pos = this.currentMouseTarget.getBoundingClientRect();
|
|
243
|
-
let x = pageX - pos.left;
|
|
244
|
-
let y = pageY - pos.top;
|
|
245
|
-
const width = pos.width;
|
|
246
|
-
const height = pos.height;
|
|
247
|
-
if (x > width)
|
|
248
|
-
x = width;
|
|
249
|
-
if (y > height)
|
|
250
|
-
y = height;
|
|
251
|
-
if (x < 0)
|
|
252
|
-
x = 0;
|
|
253
|
-
if (y < 0)
|
|
254
|
-
y = 0;
|
|
255
|
-
if (this.currentMouseParam === 'h') {
|
|
256
|
-
this.updateHSV((359 * x) / width, this.currentHSVColor.s, this.currentHSVColor.v);
|
|
257
|
-
}
|
|
258
|
-
else if (this.currentMouseParam === 'sv') {
|
|
259
|
-
this.updateHSV(this.currentHSVColor.h, Math.round((x * 100) / width) / 100, Math.round(100 - (y * 100) / height) / 100);
|
|
260
|
-
}
|
|
261
|
-
else if (this.currentMouseParam === 'a') {
|
|
262
|
-
this.currentRGBColor = new ColorRGBA64(this.currentRGBColor.r, this.currentRGBColor.g, this.currentRGBColor.b, Math.round((x * 100) / width) / 100);
|
|
263
|
-
this.updateUIValues(true);
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
/**
|
|
267
|
-
* Update the UI values with the current color. This updates the position of the indicators over the Sat/Val, Hue and Alpha elements
|
|
268
|
-
* and the values in all of the text fields at once.
|
|
269
|
-
* @param updateValue - Flag to trigger updating of the main text field value and emitting the change event.
|
|
270
|
-
*/
|
|
271
|
-
updateUIValues(updateValue) {
|
|
272
|
-
this.uiValues = new ColorPickerUI(this.currentRGBColor, this.currentHSVColor);
|
|
273
|
-
if (updateValue) {
|
|
274
|
-
this.initialValue =
|
|
275
|
-
this.currentRGBColor.a !== 1 ? this.currentRGBColor.toStringWebRGBA() : this.currentRGBColor.toStringHexRGB();
|
|
276
|
-
this.$emit('change');
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
__decorate([
|
|
281
|
-
attr({ attribute: 'readonly', mode: 'boolean' })
|
|
282
|
-
], ColorPicker.prototype, "readOnly", void 0);
|
|
283
|
-
__decorate([
|
|
284
|
-
attr({ mode: 'boolean' })
|
|
285
|
-
], ColorPicker.prototype, "autofocus", void 0);
|
|
286
|
-
__decorate([
|
|
287
|
-
attr
|
|
288
|
-
], ColorPicker.prototype, "placeholder", void 0);
|
|
289
|
-
__decorate([
|
|
290
|
-
observable
|
|
291
|
-
], ColorPicker.prototype, "open", void 0);
|
|
292
|
-
__decorate([
|
|
293
|
-
observable
|
|
294
|
-
], ColorPicker.prototype, "mouseActive", void 0);
|
|
295
|
-
__decorate([
|
|
296
|
-
observable
|
|
297
|
-
], ColorPicker.prototype, "uiValues", void 0);
|
package/dist/esm/_docs/design-system/color-explorer/components/color-picker/color-picker.styles.js
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { css } from "@microsoft/fast-element";
|
|
2
|
-
export const colorPickerStyles = () => css `
|
|
3
|
-
.popup,
|
|
4
|
-
.popup__open {
|
|
5
|
-
display: none;
|
|
6
|
-
padding: 2px;
|
|
7
|
-
flex-direction: row;
|
|
8
|
-
background-color: var(--neutral-layer-floating);
|
|
9
|
-
border: calc(var(--outline-width) * 1px) solid var(--neutral-outline-rest);
|
|
10
|
-
border-radius: calc(var(--corner-radius) * 1px);
|
|
11
|
-
}
|
|
12
|
-
.popup__open {
|
|
13
|
-
display: flex;
|
|
14
|
-
position: absolute;
|
|
15
|
-
z-index: 1;
|
|
16
|
-
margin-left: -32px;
|
|
17
|
-
}
|
|
18
|
-
.pickers {
|
|
19
|
-
margin: 4px 6px 4px 4px;
|
|
20
|
-
}
|
|
21
|
-
.inputs {
|
|
22
|
-
width: 65px;
|
|
23
|
-
margin: 0 4px 4px 0;
|
|
24
|
-
}
|
|
25
|
-
.pickers-saturation {
|
|
26
|
-
position: relative;
|
|
27
|
-
width: 200px;
|
|
28
|
-
height: 200px;
|
|
29
|
-
margin-bottom: 17px;
|
|
30
|
-
background: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0) 100%),
|
|
31
|
-
linear-gradient(to right, #fff 0%, rgba(255, 255, 255, 0) 100%);
|
|
32
|
-
background-color: #f00;
|
|
33
|
-
border: 1px solid #fff;
|
|
34
|
-
}
|
|
35
|
-
.saturation-indicator {
|
|
36
|
-
position: absolute;
|
|
37
|
-
top: 0;
|
|
38
|
-
left: 0;
|
|
39
|
-
border: 1px solid #fff;
|
|
40
|
-
border-radius: 3px;
|
|
41
|
-
width: 4px;
|
|
42
|
-
height: 4px;
|
|
43
|
-
pointer-events: none;
|
|
44
|
-
}
|
|
45
|
-
.pickers-hue {
|
|
46
|
-
position: relative;
|
|
47
|
-
width: 200px;
|
|
48
|
-
height: 30px;
|
|
49
|
-
margin-bottom: 17px;
|
|
50
|
-
border: 1px solid #fff;
|
|
51
|
-
background: linear-gradient(
|
|
52
|
-
to right,
|
|
53
|
-
#f00 0%,
|
|
54
|
-
#ff0 16.66%,
|
|
55
|
-
#0f0 33.33%,
|
|
56
|
-
#0ff 50%,
|
|
57
|
-
#00f 66.66%,
|
|
58
|
-
#f0f 83.33%,
|
|
59
|
-
#f00 100%
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
.hue-indicator,
|
|
63
|
-
.alpha-indicator {
|
|
64
|
-
position: absolute;
|
|
65
|
-
left: 0;
|
|
66
|
-
top: -2px;
|
|
67
|
-
border: 1px solid #fff;
|
|
68
|
-
width: 1px;
|
|
69
|
-
height: 32px;
|
|
70
|
-
pointer-events: none;
|
|
71
|
-
margin-left: 1px;
|
|
72
|
-
}
|
|
73
|
-
.pickers-alpha {
|
|
74
|
-
position: relative;
|
|
75
|
-
width: 200px;
|
|
76
|
-
height: 30px;
|
|
77
|
-
border: 1px solid #fff;
|
|
78
|
-
background-image: linear-gradient(45deg, #999 25%, transparent 25%),
|
|
79
|
-
linear-gradient(-45deg, #999 25%, transparent 25%),
|
|
80
|
-
linear-gradient(45deg, transparent 75%, #999 75%),
|
|
81
|
-
linear-gradient(-45deg, transparent 75%, #999 75%);
|
|
82
|
-
background-size: 20px 20px;
|
|
83
|
-
background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
|
|
84
|
-
background-color: #fff;
|
|
85
|
-
}
|
|
86
|
-
.alpha-mask {
|
|
87
|
-
width: 100%;
|
|
88
|
-
height: 100%;
|
|
89
|
-
background-image: linear-gradient(to right, transparent, #f00);
|
|
90
|
-
margin-bottom: 5px;
|
|
91
|
-
}
|
|
92
|
-
.control-color {
|
|
93
|
-
position: relative;
|
|
94
|
-
display: inline-block;
|
|
95
|
-
width: 25px;
|
|
96
|
-
height: 25px;
|
|
97
|
-
margin-top: auto;
|
|
98
|
-
margin-bottom: auto;
|
|
99
|
-
border: 1px solid var(--fast-tooling-l1-color, #333333);
|
|
100
|
-
}
|
|
101
|
-
.control-color::before {
|
|
102
|
-
position: absolute;
|
|
103
|
-
content: "";
|
|
104
|
-
left: 0;
|
|
105
|
-
right: 0;
|
|
106
|
-
top: 0;
|
|
107
|
-
bottom: 0;
|
|
108
|
-
background-image: linear-gradient(
|
|
109
|
-
to bottom left,
|
|
110
|
-
transparent calc(50% - 1px),
|
|
111
|
-
var(--fast-tooling-l1-color, #333333),
|
|
112
|
-
transparent calc(50% + 1px)
|
|
113
|
-
);
|
|
114
|
-
}
|
|
115
|
-
.control-color::after {
|
|
116
|
-
position: absolute;
|
|
117
|
-
content: "";
|
|
118
|
-
left: 0;
|
|
119
|
-
right: 0;
|
|
120
|
-
top: 0;
|
|
121
|
-
bottom: 0;
|
|
122
|
-
background-color: var(--selected-color-value);
|
|
123
|
-
}
|
|
124
|
-
`;
|
package/dist/esm/_docs/design-system/color-explorer/components/color-picker/color-picker.template.js
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import { html, ref } from '@microsoft/fast-element';
|
|
2
|
-
import { TextField } from '@microsoft/fast-foundation';
|
|
3
|
-
/**
|
|
4
|
-
* The template for the color picker component.
|
|
5
|
-
* @public
|
|
6
|
-
*/
|
|
7
|
-
export const colorPickerTemplate = context => {
|
|
8
|
-
return html `
|
|
9
|
-
<template
|
|
10
|
-
@focus="${x => x.handleFocus()}"
|
|
11
|
-
@blur="${x => x.handleBlur()}"
|
|
12
|
-
@mousemove="${(x, c) => (x.mouseActive ? x.handleMouseMove(c.event) : null)}"
|
|
13
|
-
@mouseup="${(x, c) => (x.mouseActive ? x.handleMouseUp(c.event) : null)}"
|
|
14
|
-
style="--selected-color-value: ${x => (x.value ? x.value : 'transparent')}"
|
|
15
|
-
>
|
|
16
|
-
<div class="root" part="root">
|
|
17
|
-
<${context.tagFor(TextField)}
|
|
18
|
-
class="root-control"
|
|
19
|
-
part="control"
|
|
20
|
-
id="control"
|
|
21
|
-
@input="${x => x.handleTextInput()}"
|
|
22
|
-
@change="${x => x.handleChange()}"
|
|
23
|
-
?autofocus="${x => x.autofocus}"
|
|
24
|
-
?disabled="${x => x.disabled}"
|
|
25
|
-
placeholder="${x => x.placeholder}"
|
|
26
|
-
?readonly="${x => x.readOnly}"
|
|
27
|
-
?required="${x => x.required}"
|
|
28
|
-
:value="${x => x.value}"
|
|
29
|
-
${ref('control')}
|
|
30
|
-
>
|
|
31
|
-
<div slot="start" class="control-color"></div>
|
|
32
|
-
</${context.tagFor(TextField)}>
|
|
33
|
-
<div class="${x => (x.open ? 'popup__open' : 'popup')}">
|
|
34
|
-
<div class="pickers">
|
|
35
|
-
<div
|
|
36
|
-
class="pickers-saturation"
|
|
37
|
-
style="background-color:${x => x.uiValues.HueCSSColor}"
|
|
38
|
-
@mousedown="${(x, c) => x.handleMouseDown('sv', c.event)}"
|
|
39
|
-
>
|
|
40
|
-
<div
|
|
41
|
-
class="saturation-indicator"
|
|
42
|
-
style="left: ${x => x.uiValues.SatValLeftPos - 2}%; top: ${x => x.uiValues.SatValTopPos - 2}%"
|
|
43
|
-
></div>
|
|
44
|
-
</div>
|
|
45
|
-
<div
|
|
46
|
-
class="pickers-hue"
|
|
47
|
-
@mousedown="${(x, c) => x.handleMouseDown('h', c.event)}"
|
|
48
|
-
>
|
|
49
|
-
<div
|
|
50
|
-
class="hue-indicator"
|
|
51
|
-
style="left: ${x => x.uiValues.HuePosition - 1}%"
|
|
52
|
-
></div>
|
|
53
|
-
</div>
|
|
54
|
-
<div
|
|
55
|
-
class="pickers-alpha"
|
|
56
|
-
@mousedown="${(x, c) => x.handleMouseDown('a', c.event)}"
|
|
57
|
-
>
|
|
58
|
-
<div
|
|
59
|
-
class="alpha-mask"
|
|
60
|
-
style="background-image: linear-gradient(to right, transparent, ${x => x.uiValues.HueCSSColor})"
|
|
61
|
-
></div>
|
|
62
|
-
<div
|
|
63
|
-
class="alpha-indicator"
|
|
64
|
-
style="left: ${x => x.uiValues.AlphaPos - 1}%"
|
|
65
|
-
></div>
|
|
66
|
-
</div>
|
|
67
|
-
</div>
|
|
68
|
-
<div class="inputs">
|
|
69
|
-
<${context.tagFor(TextField)}
|
|
70
|
-
maxlength="3"
|
|
71
|
-
size="3"
|
|
72
|
-
@input="${(x, c) => x.handleTextValueInput('r', c.event)}"
|
|
73
|
-
:value="${x => Math.round(x.uiValues.RGBColor.r * 255)}"
|
|
74
|
-
>
|
|
75
|
-
<span slot="start">R:</span>
|
|
76
|
-
</${context.tagFor(TextField)}>
|
|
77
|
-
<${context.tagFor(TextField)}
|
|
78
|
-
maxlength="3"
|
|
79
|
-
size="3"
|
|
80
|
-
@input="${(x, c) => x.handleTextValueInput('g', c.event)}"
|
|
81
|
-
:value="${x => Math.round(x.uiValues.RGBColor.g * 255)}"
|
|
82
|
-
>
|
|
83
|
-
<span slot="start">G:</span>
|
|
84
|
-
</${context.tagFor(TextField)}>
|
|
85
|
-
<${context.tagFor(TextField)}
|
|
86
|
-
maxlength="3"
|
|
87
|
-
size="3"
|
|
88
|
-
@input="${(x, c) => x.handleTextValueInput('b', c.event)}"
|
|
89
|
-
:value="${x => Math.round(x.uiValues.RGBColor.b * 255)}"
|
|
90
|
-
>
|
|
91
|
-
<span slot="start">B:</span>
|
|
92
|
-
</${context.tagFor(TextField)}>
|
|
93
|
-
<${context.tagFor(TextField)}
|
|
94
|
-
maxlength="3"
|
|
95
|
-
size="3"
|
|
96
|
-
@input="${(x, c) => x.handleTextValueInput('h', c.event)}"
|
|
97
|
-
:value="${x => Math.round(x.uiValues.HSVColor.h)}"
|
|
98
|
-
>
|
|
99
|
-
<span slot="start">H:</span>
|
|
100
|
-
</${context.tagFor(TextField)}>
|
|
101
|
-
<${context.tagFor(TextField)}
|
|
102
|
-
maxlength="3"
|
|
103
|
-
size="3"
|
|
104
|
-
@input="${(x, c) => x.handleTextValueInput('s', c.event)}"
|
|
105
|
-
:value="${x => Math.round(x.uiValues.HSVColor.s * 100)}"
|
|
106
|
-
>
|
|
107
|
-
<span slot="start">S:</span>
|
|
108
|
-
</${context.tagFor(TextField)}>
|
|
109
|
-
<${context.tagFor(TextField)}
|
|
110
|
-
maxlength="3"
|
|
111
|
-
size="3"
|
|
112
|
-
@input="${(x, c) => x.handleTextValueInput('v', c.event)}"
|
|
113
|
-
:value="${x => Math.round(x.uiValues.HSVColor.v * 100)}"
|
|
114
|
-
>
|
|
115
|
-
<span slot="start">V:</span>
|
|
116
|
-
</${context.tagFor(TextField)}>
|
|
117
|
-
<${context.tagFor(TextField)}
|
|
118
|
-
maxlength="3"
|
|
119
|
-
size="3"
|
|
120
|
-
@input="${(x, c) => x.handleTextValueInput('a', c.event)}"
|
|
121
|
-
:value="${x => Math.round(x.uiValues.RGBColor.a * 100)}"
|
|
122
|
-
>
|
|
123
|
-
<span slot="start">A:</span>
|
|
124
|
-
</${context.tagFor(TextField)}>
|
|
125
|
-
</div>
|
|
126
|
-
</div>
|
|
127
|
-
</div>
|
|
128
|
-
</template>
|
|
129
|
-
`;
|
|
130
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ColorPicker } from './color-picker';
|
|
2
|
-
import { colorPickerTemplate as template } from './color-picker.template';
|
|
3
|
-
import { colorPickerStyles as styles } from './color-picker.styles';
|
|
4
|
-
/**
|
|
5
|
-
* A web component used for updating color values.
|
|
6
|
-
*
|
|
7
|
-
* @alpha
|
|
8
|
-
* @remarks
|
|
9
|
-
* HTML Element: \<color-picker\>
|
|
10
|
-
*/
|
|
11
|
-
export const fastToolingColorPicker = ColorPicker.compose({
|
|
12
|
-
baseName: 'color-picker',
|
|
13
|
-
template,
|
|
14
|
-
styles,
|
|
15
|
-
});
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { observable } from '@microsoft/fast-element';
|
|
3
|
-
import { FoundationElement } from '@microsoft/fast-foundation';
|
|
4
|
-
export class ControlPane extends FoundationElement {
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.showOnlyLayerBackgrounds = true;
|
|
8
|
-
}
|
|
9
|
-
updateFormValue(field, value) {
|
|
10
|
-
this.$emit('formvaluechange', { field: field, value: value });
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
__decorate([
|
|
14
|
-
observable
|
|
15
|
-
], ControlPane.prototype, "componentType", void 0);
|
|
16
|
-
__decorate([
|
|
17
|
-
observable
|
|
18
|
-
], ControlPane.prototype, "accentColor", void 0);
|
|
19
|
-
__decorate([
|
|
20
|
-
observable
|
|
21
|
-
], ControlPane.prototype, "neutralColor", void 0);
|
|
22
|
-
__decorate([
|
|
23
|
-
observable
|
|
24
|
-
], ControlPane.prototype, "showOnlyLayerBackgrounds", void 0);
|
package/dist/esm/_docs/design-system/color-explorer/components/control-pane/control-pane.styles.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { css } from "@microsoft/fast-element";
|
|
2
|
-
import { display } from "@microsoft/fast-foundation";
|
|
3
|
-
import { typeRampPlus1FontSize, typeRampPlus1LineHeight } from "../../../../../index-rollup";
|
|
4
|
-
export const controlPaneStyles = css `
|
|
5
|
-
${display("flex")} :host {
|
|
6
|
-
flex: 0 1 auto;
|
|
7
|
-
flex-direction: column;
|
|
8
|
-
gap: 24px;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.title {
|
|
12
|
-
font-size: ${typeRampPlus1FontSize};
|
|
13
|
-
line-height: ${typeRampPlus1LineHeight};
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
fluent-radio-group::part(positioning-region) {
|
|
17
|
-
gap: 8px;
|
|
18
|
-
}
|
|
19
|
-
`;
|
package/dist/esm/_docs/design-system/color-explorer/components/control-pane/control-pane.template.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { html, repeat } from '@microsoft/fast-element';
|
|
2
|
-
import { ComponentTypes } from '../../component-types';
|
|
3
|
-
function titleCase(str) {
|
|
4
|
-
return str.split('').reduce((accumulated, value, index) => {
|
|
5
|
-
return accumulated.concat(index === 0 ? value.toUpperCase() : value);
|
|
6
|
-
}, '');
|
|
7
|
-
}
|
|
8
|
-
export const controlPaneTemplate = html `
|
|
9
|
-
<template>
|
|
10
|
-
<p class="title">Settings</p>
|
|
11
|
-
<fluent-radio-group
|
|
12
|
-
name="componentType"
|
|
13
|
-
orientation="vertical"
|
|
14
|
-
@change="${(x, c) => {
|
|
15
|
-
x.updateFormValue('componentType', c.event.target.value);
|
|
16
|
-
}}"
|
|
17
|
-
>
|
|
18
|
-
<label slot="label">Component type</label>
|
|
19
|
-
${repeat(x => Object.keys(ComponentTypes), html `
|
|
20
|
-
<fluent-radio value="${x => x}" ?checked="${(x, c) => c.parent.componentType === x}">
|
|
21
|
-
${x => titleCase(x)}
|
|
22
|
-
</fluent-radio>
|
|
23
|
-
`)}
|
|
24
|
-
</fluent-radio-group>
|
|
25
|
-
<div>
|
|
26
|
-
<label>Neutral base color</label>
|
|
27
|
-
<fast-tooling-color-picker
|
|
28
|
-
value="${x => x.neutralColor}"
|
|
29
|
-
@change="${(x, c) => {
|
|
30
|
-
x.updateFormValue('neutralColor', c.event.target.value);
|
|
31
|
-
}}"
|
|
32
|
-
></fast-tooling-color-picker>
|
|
33
|
-
</div>
|
|
34
|
-
<fluent-checkbox
|
|
35
|
-
checked="${x => x.showOnlyLayerBackgrounds}"
|
|
36
|
-
@change="${(x, c) => {
|
|
37
|
-
x.updateFormValue('showOnlyLayerBackgrounds', c.event.target.checked);
|
|
38
|
-
}}"
|
|
39
|
-
>
|
|
40
|
-
Show layer backgrounds only
|
|
41
|
-
</fluent-checkbox>
|
|
42
|
-
<div>
|
|
43
|
-
<label>Accent base color</label>
|
|
44
|
-
<fast-tooling-color-picker
|
|
45
|
-
value="${x => x.accentColor}"
|
|
46
|
-
@change="${(x, c) => {
|
|
47
|
-
x.updateFormValue('accentColor', c.event.target.value);
|
|
48
|
-
}}"
|
|
49
|
-
></fast-tooling-color-picker>
|
|
50
|
-
</div>
|
|
51
|
-
</template>
|
|
52
|
-
`;
|