@vonage/vivid 5.2.0 → 5.4.0
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/accordion-item/definition.cjs +2 -1
- package/accordion-item/definition.js +3 -2
- package/alert/definition.cjs +1 -1
- package/alert/definition.js +2 -2
- package/alert/index.cjs +1 -1
- package/alert/index.js +1 -1
- package/audio-player/definition.cjs +4 -2
- package/audio-player/definition.js +4 -2
- package/audio-player/index.cjs +5 -3
- package/audio-player/index.js +5 -3
- package/badge/definition.js +1 -1
- package/badge/index.cjs +2 -2
- package/badge/index.js +4 -4
- package/banner/definition.js +1 -1
- package/banner/index.cjs +3 -3
- package/banner/index.js +6 -6
- package/breadcrumb-item/index.cjs +1 -1
- package/breadcrumb-item/index.js +1 -1
- package/bundled/affix.cjs +7 -7
- package/bundled/affix.js +5 -5
- package/bundled/anchored.cjs +1 -1
- package/bundled/anchored.js +6 -6
- package/bundled/attribute-binding-behaviour.cjs +1 -1
- package/bundled/attribute-binding-behaviour.js +15 -13
- package/bundled/base-color-picker.cjs +13 -0
- package/bundled/base-color-picker.js +194 -0
- package/bundled/button.cjs +1 -1
- package/bundled/button.js +2 -2
- package/bundled/calendar-picker.template.cjs +7 -7
- package/bundled/calendar-picker.template.js +118 -118
- package/bundled/char-count.cjs +1 -1
- package/bundled/char-count.js +1 -1
- package/bundled/children.cjs +1 -1
- package/bundled/children.js +28 -20
- package/bundled/definition.cjs +3 -3
- package/bundled/definition.js +38 -38
- package/bundled/definition10.cjs +72 -18
- package/bundled/definition10.js +351 -65
- package/bundled/definition11.cjs +19 -10
- package/bundled/definition11.js +217 -36
- package/bundled/definition12.cjs +10 -1
- package/bundled/definition12.js +38 -14
- package/bundled/definition13.cjs +1 -73
- package/bundled/definition13.js +15 -354
- package/bundled/definition15.cjs +1 -1
- package/bundled/definition15.js +1 -1
- package/bundled/definition16.cjs +2 -2
- package/bundled/definition16.js +8 -8
- package/bundled/definition17.cjs +7 -7
- package/bundled/definition17.js +17 -17
- package/bundled/definition19.cjs +23 -24
- package/bundled/definition19.js +151 -163
- package/bundled/definition2.cjs +9 -5
- package/bundled/definition2.js +21 -17
- package/bundled/definition22.cjs +9 -9
- package/bundled/definition22.js +31 -31
- package/bundled/definition3.cjs +1 -1
- package/bundled/definition3.js +1 -1
- package/bundled/definition6.cjs +3 -3
- package/bundled/definition6.js +28 -28
- package/bundled/definition7.cjs +1 -1
- package/bundled/definition7.js +6 -6
- package/bundled/definition8.cjs +2 -2
- package/bundled/definition8.js +4 -4
- package/bundled/definition9.cjs +5 -5
- package/bundled/definition9.js +394 -392
- package/bundled/delegates-aria.cjs +1 -1
- package/bundled/delegates-aria.js +59 -46
- package/bundled/form-associated.cjs +1 -1
- package/bundled/form-associated.js +3 -3
- package/bundled/host-semantics.cjs +1 -1
- package/bundled/host-semantics.js +48 -34
- package/bundled/listbox.cjs +1 -1
- package/bundled/listbox.js +82 -102
- package/bundled/localized.cjs +1 -1
- package/bundled/localized.js +51 -36
- package/bundled/mixins.cjs +18 -18
- package/bundled/mixins.js +99 -93
- package/bundled/normalize.cjs +1 -0
- package/bundled/normalize.js +7 -0
- package/bundled/picker-field.template.cjs +1 -1
- package/bundled/picker-field.template.js +4 -4
- package/bundled/ref.cjs +1 -1
- package/bundled/ref.js +8 -25
- package/bundled/repeat.cjs +1 -1
- package/bundled/repeat.js +459 -233
- package/bundled/slider.template.cjs +1 -1
- package/bundled/slider.template.js +2 -2
- package/bundled/slotted.cjs +1 -1
- package/bundled/slotted.js +62 -45
- package/bundled/time-selection-picker.template.cjs +1 -1
- package/bundled/time-selection-picker.template.js +5 -5
- package/bundled/vivid-element.cjs +5 -1
- package/bundled/vivid-element.js +2159 -1162
- package/bundled/when.cjs +1 -1
- package/bundled/when.js +8 -7
- package/calendar/definition.cjs +1 -1
- package/calendar/definition.js +2 -2
- package/calendar/index.cjs +1 -1
- package/calendar/index.js +15 -15
- package/calendar-event/index.cjs +1 -1
- package/calendar-event/index.js +1 -1
- package/card/definition.cjs +11 -3
- package/card/definition.js +11 -3
- package/card/index.cjs +19 -11
- package/card/index.js +35 -27
- package/color-picker/definition.cjs +1079 -0
- package/color-picker/definition.js +1073 -0
- package/color-picker/index.cjs +127 -0
- package/color-picker/index.js +726 -0
- package/combobox/definition.cjs +8 -28
- package/combobox/definition.js +10 -30
- package/combobox/index.cjs +7 -7
- package/combobox/index.js +60 -74
- package/contextual-help/index.cjs +1 -1
- package/contextual-help/index.js +1 -1
- package/custom-elements.json +1670 -163
- package/data-grid/definition.cjs +862 -27
- package/data-grid/definition.js +863 -28
- package/data-grid/index.cjs +25 -25
- package/data-grid/index.js +175 -168
- package/date-picker/definition.cjs +1 -1
- package/date-picker/definition.js +1 -1
- package/date-picker/index.cjs +1 -1
- package/date-picker/index.js +2 -2
- package/date-range-picker/definition.cjs +1 -1
- package/date-range-picker/definition.js +1 -1
- package/date-range-picker/index.cjs +1 -1
- package/date-range-picker/index.js +2 -2
- package/date-time-picker/definition.cjs +1 -1
- package/date-time-picker/definition.js +1 -1
- package/date-time-picker/index.cjs +1 -1
- package/date-time-picker/index.js +2 -2
- package/dial-pad/definition.cjs +4 -0
- package/dial-pad/definition.js +4 -0
- package/dial-pad/index.cjs +3 -3
- package/dial-pad/index.js +42 -39
- package/dialog/definition.cjs +6 -3
- package/dialog/definition.js +6 -3
- package/dialog/index.cjs +22 -19
- package/dialog/index.js +48 -45
- package/elevation/definition.cjs +1 -1
- package/elevation/definition.js +1 -1
- package/empty-state/definition.cjs +7 -2
- package/empty-state/definition.js +7 -2
- package/empty-state/index.cjs +10 -5
- package/empty-state/index.js +18 -13
- package/fab/definition.js +1 -1
- package/fab/index.cjs +2 -2
- package/fab/index.js +4 -4
- package/file-picker/definition.cjs +2 -2
- package/file-picker/definition.js +3 -3
- package/file-picker/index.cjs +1 -1
- package/file-picker/index.js +4 -4
- package/header/definition.cjs +1 -1
- package/header/definition.js +1 -1
- package/icon/definition.cjs +10 -6
- package/icon/definition.js +10 -6
- package/index.cjs +7 -4
- package/index.js +3 -3
- package/lib/accordion/accordion.d.ts +1 -1
- package/lib/accordion/definition.d.ts +1 -1
- package/lib/accordion-item/accordion-item.d.ts +2 -2
- package/lib/action-group/action-group.d.ts +2 -2
- package/lib/alert/alert.d.ts +4 -4
- package/lib/audio-player/audio-player.d.ts +3 -3
- package/lib/avatar/avatar.d.ts +2 -2
- package/lib/badge/badge.d.ts +2 -2
- package/lib/banner/banner.d.ts +6 -6
- package/lib/breadcrumb/breadcrumb.d.ts +2 -2
- package/lib/breadcrumb-item/breadcrumb-item.d.ts +2 -2
- package/lib/button/button.d.ts +6 -6
- package/lib/button/button.template.d.ts +2 -1
- package/lib/calendar/calendar.d.ts +1 -1
- package/lib/calendar-event/calendar-event.d.ts +2 -2
- package/lib/card/card.d.ts +2 -2
- package/lib/checkbox/checkbox.d.ts +12 -12
- package/lib/color-picker/color-picker.d.ts +2420 -0
- package/lib/color-picker/color-picker.template.d.ts +3 -0
- package/lib/color-picker/definition.d.ts +4 -0
- package/lib/color-picker/locale.d.ts +9 -0
- package/lib/combobox/combobox.d.ts +15 -14
- package/lib/combobox/combobox.options.d.ts +1 -1
- package/lib/components.d.ts +1 -0
- package/lib/data-grid/data-grid-cell.d.ts +4 -4
- package/lib/data-grid/data-grid-row.d.ts +3 -4
- package/lib/data-grid/data-grid.d.ts +1 -2
- package/lib/date-picker/date-picker.d.ts +54 -54
- package/lib/date-range-picker/date-range-picker.d.ts +28 -28
- package/lib/date-time-picker/date-time-picker.d.ts +56 -56
- package/lib/dial-pad/dial-pad.d.ts +3 -2
- package/lib/dialog/dialog.d.ts +4 -4
- package/lib/divider/divider.d.ts +3 -3
- package/lib/fab/fab.d.ts +2 -2
- package/lib/file-picker/file-picker.d.ts +14 -14
- package/lib/header/header.d.ts +2 -2
- package/lib/menu/menu.d.ts +4 -4
- package/lib/menu-item/menu-item-role.d.ts +1 -1
- package/lib/menu-item/menu-item.d.ts +4 -4
- package/lib/nav/nav.d.ts +2 -2
- package/lib/nav-disclosure/nav-disclosure.d.ts +4 -4
- package/lib/nav-item/nav-item.d.ts +4 -4
- package/lib/note/note.d.ts +2 -2
- package/lib/number-field/number-field.d.ts +18 -18
- package/lib/option/option.d.ts +4 -4
- package/lib/pagination/pagination.d.ts +2 -2
- package/lib/popup/popup.d.ts +1 -1
- package/lib/progress/progress.d.ts +2 -2
- package/lib/progress-ring/progress-ring.d.ts +2 -2
- package/lib/radio/radio.d.ts +6 -6
- package/lib/radio-group/radio-group.d.ts +2 -2
- package/lib/range-slider/range-slider.d.ts +6 -6
- package/lib/rich-text-editor/menubar/menubar.d.ts +2 -2
- package/lib/rich-text-editor/rich-text-editor.d.ts +2 -2
- package/lib/searchable-select/locale.d.ts +4 -0
- package/lib/searchable-select/option-tag.d.ts +2 -2
- package/lib/searchable-select/searchable-select.d.ts +21 -18
- package/lib/select/select.d.ts +19 -17
- package/lib/selectable-box/selectable-box.d.ts +2 -2
- package/lib/simple-color-picker/locale.d.ts +0 -1
- package/lib/simple-color-picker/simple-color-picker.d.ts +47 -821
- package/lib/slider/slider.d.ts +7 -7
- package/lib/split-button/split-button.d.ts +6 -6
- package/lib/switch/switch.d.ts +4 -4
- package/lib/tab/tab.d.ts +6 -6
- package/lib/tab-panel/tab-panel.d.ts +2 -2
- package/lib/tabs/tabs.d.ts +2 -2
- package/lib/tag/tag.d.ts +6 -6
- package/lib/tag-group/tag-group.d.ts +2 -2
- package/lib/tag-name-map.d.ts +2 -1
- package/lib/text-area/text-area.d.ts +17 -17
- package/lib/text-field/text-field.d.ts +19 -19
- package/lib/time-picker/time-picker.d.ts +28 -28
- package/lib/toggletip/toggletip.d.ts +4 -4
- package/lib/tooltip/tooltip.d.ts +2 -2
- package/lib/tree-item/tree-item.d.ts +4 -4
- package/lib/tree-view/tree-view.d.ts +2 -2
- package/lib/video-player/video-player.d.ts +2 -2
- package/locales/de-DE.cjs +17 -2
- package/locales/de-DE.js +17 -2
- package/locales/en-GB.cjs +17 -2
- package/locales/en-GB.js +17 -2
- package/locales/en-US.cjs +17 -2
- package/locales/en-US.js +17 -2
- package/locales/ja-JP.cjs +17 -2
- package/locales/ja-JP.js +17 -2
- package/locales/zh-CN.cjs +17 -2
- package/locales/zh-CN.js +17 -2
- package/menu/definition.cjs +6 -6
- package/menu/definition.js +7 -7
- package/nav-disclosure/definition.js +1 -1
- package/nav-item/definition.js +1 -1
- package/note/definition.js +1 -1
- package/note/index.cjs +2 -2
- package/note/index.js +4 -4
- package/number-field/definition.cjs +1 -1
- package/number-field/definition.js +3 -3
- package/number-field/index.cjs +5 -5
- package/number-field/index.js +21 -21
- package/option/definition.cjs +6 -77
- package/option/definition.js +3 -78
- package/option/index.cjs +1 -1
- package/option/index.js +1 -1
- package/package.json +34 -8
- package/pagination/definition.cjs +2 -1
- package/pagination/definition.js +2 -1
- package/pagination/index.cjs +12 -12
- package/pagination/index.js +59 -59
- package/popup/definition.cjs +2 -2
- package/popup/definition.js +2 -2
- package/progress/index.cjs +1 -1
- package/progress/index.js +1 -1
- package/radio/definition.cjs +9 -9
- package/radio/definition.js +10 -10
- package/radio-group/definition.cjs +2 -1
- package/radio-group/definition.js +2 -1
- package/radio-group/index.cjs +5 -5
- package/radio-group/index.js +80 -77
- package/range-slider/definition.cjs +1 -1
- package/range-slider/definition.js +1 -1
- package/range-slider/index.cjs +1 -1
- package/range-slider/index.js +1 -1
- package/rich-text-editor/definition.cjs +3 -4
- package/rich-text-editor/definition.js +3 -4
- package/rich-text-editor/index.cjs +27 -27
- package/rich-text-editor/index.js +1208 -1198
- package/searchable-select/definition.cjs +106 -14
- package/searchable-select/definition.js +107 -15
- package/searchable-select/index.cjs +81 -69
- package/searchable-select/index.js +362 -276
- package/select/definition.cjs +25 -42
- package/select/definition.js +26 -43
- package/selectable-box/definition.cjs +1 -1
- package/selectable-box/definition.js +1 -1
- package/selectable-box/index.cjs +3 -3
- package/selectable-box/index.js +20 -20
- package/shared/aria/aria-change-subscription.d.ts +0 -1
- package/shared/aria/aria-mixin.d.ts +3 -3
- package/shared/aria/delegate-aria-behavior.d.ts +5 -10
- package/shared/aria/delegates-aria.d.ts +3 -3
- package/shared/aria/host-semantics-behavior.d.ts +5 -8
- package/shared/aria/host-semantics.d.ts +3 -3
- package/shared/color-picker/base-color-picker.d.ts +436 -0
- package/shared/color-picker/index.d.ts +1 -0
- package/shared/color-picker/locale.d.ts +3 -0
- package/shared/color-picker/utils.d.ts +1 -0
- package/shared/deprecation/replaced-props.d.ts +317 -2
- package/shared/design-system/defineVividComponent.d.ts +2 -2
- package/shared/feedback/feedback-message.d.ts +2 -2
- package/shared/feedback/mixins.d.ts +4 -4
- package/shared/foundation/button/button.d.ts +4 -4
- package/shared/foundation/form-associated/form-associated.d.ts +4 -4
- package/shared/foundation/listbox/listbox.d.ts +4 -0
- package/shared/foundation/vivid-element/vivid-element.d.ts +335 -8
- package/shared/localization/Locale.d.ts +4 -0
- package/shared/patterns/affix.d.ts +4 -4
- package/shared/patterns/anchored.d.ts +4 -4
- package/shared/patterns/char-count/char-count.d.ts +2 -2
- package/shared/patterns/form-elements/form-element.d.ts +4 -4
- package/shared/patterns/form-elements/with-contextual-help.d.ts +6 -6
- package/shared/patterns/form-elements/with-error-text.d.ts +6 -6
- package/shared/patterns/form-elements/with-success-text.d.ts +2 -2
- package/shared/patterns/linkable.d.ts +2 -2
- package/shared/patterns/localized.d.ts +2 -2
- package/shared/patterns/trapped-focus.d.ts +2 -2
- package/shared/picker-field/mixins/calendar-picker.d.ts +14 -14
- package/shared/picker-field/mixins/calendar-picker.template.d.ts +14 -14
- package/shared/picker-field/mixins/inline-time-picker/inline-time-picker.d.ts +2 -2
- package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +28 -28
- package/shared/picker-field/mixins/single-date-picker.d.ts +40 -40
- package/shared/picker-field/mixins/single-value-picker.d.ts +12 -12
- package/shared/picker-field/mixins/time-selection-picker.d.ts +29 -29
- package/shared/picker-field/mixins/time-selection-picker.template.d.ts +28 -28
- package/shared/picker-field/picker-field.d.ts +14 -14
- package/shared/templating/attribute-binding-behaviour.d.ts +3 -4
- package/shared/templating/render-in-light-dom.d.ts +13 -12
- package/side-drawer/index.cjs +1 -1
- package/side-drawer/index.js +1 -1
- package/simple-color-picker/definition.cjs +29 -216
- package/simple-color-picker/definition.js +30 -217
- package/simple-color-picker/index.cjs +9 -21
- package/simple-color-picker/index.js +71 -185
- package/slider/definition.cjs +1 -1
- package/slider/definition.js +1 -1
- package/split-button/definition.js +1 -1
- package/styles/core/all.css +1 -1
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +1 -1
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +1 -1
- package/switch/index.cjs +2 -2
- package/switch/index.js +4 -4
- package/tab/definition.js +1 -1
- package/tabs/definition.cjs +1 -1
- package/tabs/definition.js +2 -2
- package/tabs/index.cjs +2 -2
- package/tabs/index.js +16 -16
- package/tag/definition.js +1 -1
- package/tag/index.cjs +1 -1
- package/tag/index.js +1 -1
- package/text-area/index.cjs +3 -3
- package/text-area/index.js +8 -8
- package/text-field/definition.cjs +2 -2
- package/text-field/definition.js +4 -4
- package/text-field/index.cjs +1 -1
- package/text-field/index.js +1 -1
- package/time-picker/definition.cjs +1 -1
- package/time-picker/definition.js +1 -1
- package/time-picker/index.cjs +1 -1
- package/time-picker/index.js +2 -2
- package/toggletip/definition.cjs +2 -2
- package/toggletip/definition.js +3 -3
- package/tooltip/definition.cjs +1 -1
- package/tooltip/definition.js +1 -1
- package/tree-item/definition.cjs +1 -1
- package/tree-item/definition.js +1 -1
- package/tree-view/definition.cjs +2 -2
- package/tree-view/definition.js +3 -3
- package/tree-view/index.cjs +2 -2
- package/tree-view/index.js +6 -6
- package/unbundled/_commonjsHelpers.cjs +36 -0
- package/unbundled/_commonjsHelpers.js +32 -0
- package/unbundled/affix.cjs +1 -1
- package/unbundled/affix.js +2 -2
- package/unbundled/attribute-binding-behaviour.cjs +11 -10
- package/unbundled/attribute-binding-behaviour.js +11 -10
- package/unbundled/base-color-picker.cjs +278 -0
- package/unbundled/base-color-picker.js +275 -0
- package/unbundled/button.cjs +1 -1
- package/unbundled/button.js +2 -2
- package/unbundled/calendar-picker.template.cjs +4 -4
- package/unbundled/calendar-picker.template.js +5 -5
- package/unbundled/definition.js +1 -1
- package/unbundled/definition2.cjs +1 -1
- package/unbundled/definition2.js +3 -3
- package/unbundled/definition3.cjs +222 -140
- package/unbundled/definition3.js +220 -138
- package/unbundled/definition4.cjs +145 -235
- package/unbundled/definition4.js +143 -233
- package/unbundled/definition5.cjs +269 -27
- package/unbundled/definition5.js +267 -26
- package/unbundled/definition6.cjs +56 -0
- package/unbundled/definition6.js +52 -0
- package/unbundled/delegates-aria.cjs +67 -33
- package/unbundled/delegates-aria.js +69 -35
- package/unbundled/form-associated.cjs +2 -2
- package/unbundled/form-associated.js +3 -3
- package/unbundled/host-semantics.cjs +47 -22
- package/unbundled/host-semantics.js +48 -23
- package/unbundled/listbox.cjs +41 -63
- package/unbundled/listbox.js +39 -61
- package/unbundled/mixins.cjs +34 -27
- package/unbundled/mixins.js +35 -28
- package/unbundled/picker-field.template.cjs +3 -3
- package/unbundled/picker-field.template.js +4 -4
- package/unbundled/slider.template.cjs +1 -1
- package/unbundled/slider.template.js +1 -1
- package/unbundled/time-selection-picker.template.cjs +4 -4
- package/unbundled/time-selection-picker.template.js +5 -5
- package/unbundled/vivid-element.cjs +22 -15
- package/unbundled/vivid-element.js +23 -15
- package/video-player/definition.cjs +69047 -1
- package/video-player/definition.js +69047 -1
- package/video-player/index.cjs +36 -36
- package/video-player/index.js +1895 -1905
- package/visually-hidden/index.cjs +1 -1
- package/visually-hidden/index.js +1 -1
- package/vivid.api.json +719 -224
- package/bundled/option.cjs +0 -1
- package/bundled/option.js +0 -158
- package/unbundled/option.cjs +0 -217
- package/unbundled/option.js +0 -214
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import { Updates, when, html, attr, observable } from '@microsoft/fast-element';
|
|
2
|
+
import { classNames } from '@microsoft/fast-web-utilities';
|
|
3
|
+
import { F as FormAssociated } from './form-associated.js';
|
|
4
|
+
import { L as Localized } from './localized.js';
|
|
5
|
+
import { F as FormElement } from './form-element.js';
|
|
6
|
+
|
|
7
|
+
function parseHexColor(input) {
|
|
8
|
+
if (!input) return null;
|
|
9
|
+
const hex = input.trim().replace(/^#/, "");
|
|
10
|
+
if (/^[0-9a-fA-F]{3}$/.test(hex)) {
|
|
11
|
+
return hex.split("").map((char) => char + char).join("").toLowerCase();
|
|
12
|
+
}
|
|
13
|
+
if (/^[0-9a-fA-F]{6}$/.test(hex)) {
|
|
14
|
+
return hex.toLowerCase();
|
|
15
|
+
}
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
function isValidHexColor(input) {
|
|
19
|
+
return parseHexColor(input) !== null;
|
|
20
|
+
}
|
|
21
|
+
function getLuminance(hexColor) {
|
|
22
|
+
const hex = parseHexColor(hexColor);
|
|
23
|
+
if (!hex) return 0;
|
|
24
|
+
const r = parseInt(hex.slice(0, 2), 16) / 255;
|
|
25
|
+
const g = parseInt(hex.slice(2, 4), 16) / 255;
|
|
26
|
+
const b = parseInt(hex.slice(4, 6), 16) / 255;
|
|
27
|
+
const sR = r <= 0.03928 ? r / 12.92 : Math.pow((r + 0.055) / 1.055, 2.4);
|
|
28
|
+
const sG = g <= 0.03928 ? g / 12.92 : Math.pow((g + 0.055) / 1.055, 2.4);
|
|
29
|
+
const sB = b <= 0.03928 ? b / 12.92 : Math.pow((b + 0.055) / 1.055, 2.4);
|
|
30
|
+
return 0.2126 * sR + 0.7152 * sG + 0.0722 * sB;
|
|
31
|
+
}
|
|
32
|
+
function getContrastRatio(color1, color2) {
|
|
33
|
+
const lum1 = getLuminance(color1);
|
|
34
|
+
const lum2 = getLuminance(color2);
|
|
35
|
+
const brightest = Math.max(lum1, lum2);
|
|
36
|
+
const darkest = Math.min(lum1, lum2);
|
|
37
|
+
return (brightest + 0.05) / (darkest + 0.05);
|
|
38
|
+
}
|
|
39
|
+
function getCSSCustomProperty(propertyName, element) {
|
|
40
|
+
if (!element) {
|
|
41
|
+
element = document.querySelector(".vvd-root") || document.documentElement;
|
|
42
|
+
}
|
|
43
|
+
return getComputedStyle(element).getPropertyValue(propertyName).trim();
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
var __defProp = Object.defineProperty;
|
|
47
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
48
|
+
var result = void 0 ;
|
|
49
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
50
|
+
if (decorator = decorators[i])
|
|
51
|
+
result = (decorator(target, key, result) ) || result;
|
|
52
|
+
if (result) __defProp(target, key, result);
|
|
53
|
+
return result;
|
|
54
|
+
};
|
|
55
|
+
const BaseColorPicker = (Base) => {
|
|
56
|
+
class BaseColorPickerElement extends Localized(
|
|
57
|
+
FormElement(FormAssociated(Base))
|
|
58
|
+
) {
|
|
59
|
+
constructor() {
|
|
60
|
+
super(...arguments);
|
|
61
|
+
/**
|
|
62
|
+
* @internal
|
|
63
|
+
*/
|
|
64
|
+
this.proxy = document.createElement("input");
|
|
65
|
+
this.open = false;
|
|
66
|
+
this.swatches = [];
|
|
67
|
+
/**
|
|
68
|
+
* @internal
|
|
69
|
+
*/
|
|
70
|
+
this._canvasColor = "";
|
|
71
|
+
}
|
|
72
|
+
connectedCallback() {
|
|
73
|
+
super.connectedCallback();
|
|
74
|
+
this._refreshCanvasColor();
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* @internal
|
|
78
|
+
*/
|
|
79
|
+
_refreshCanvasColor() {
|
|
80
|
+
this._canvasColor = getCSSCustomProperty("--vvd-color-canvas", this);
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* @internal
|
|
84
|
+
*/
|
|
85
|
+
_applyContrastClass(color, threshold = 3) {
|
|
86
|
+
if (!color || !this._canvasColor) return false;
|
|
87
|
+
const ratio = getContrastRatio(color, this._canvasColor);
|
|
88
|
+
return ratio < threshold;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* @internal
|
|
92
|
+
*/
|
|
93
|
+
_getRowLength() {
|
|
94
|
+
return 7;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* @internal
|
|
98
|
+
*/
|
|
99
|
+
_handleSwatchSelection(value) {
|
|
100
|
+
if (this.value === value) {
|
|
101
|
+
this.value = "";
|
|
102
|
+
} else {
|
|
103
|
+
this.value = value;
|
|
104
|
+
}
|
|
105
|
+
this.$emit("change");
|
|
106
|
+
this.open = false;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* @internal
|
|
110
|
+
*/
|
|
111
|
+
_handleColorSaving() {
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* @internal
|
|
115
|
+
*/
|
|
116
|
+
_getFocusReturnEl() {
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* @internal
|
|
121
|
+
*/
|
|
122
|
+
_returnFocusToAnchor() {
|
|
123
|
+
const el = this._getFocusReturnEl();
|
|
124
|
+
if (!el) return;
|
|
125
|
+
Updates.enqueue(() => el.focus());
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* @internal
|
|
129
|
+
*/
|
|
130
|
+
_getGridCells() {
|
|
131
|
+
const grid = this.shadowRoot?.querySelector('[role="grid"]');
|
|
132
|
+
return grid ? Array.from(
|
|
133
|
+
grid.querySelectorAll(
|
|
134
|
+
'[role="gridcell"], [data-vvd-role="gridcell"]'
|
|
135
|
+
)
|
|
136
|
+
) : [];
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* @internal
|
|
140
|
+
*/
|
|
141
|
+
_handleCellKeydown(event, value, index, isSaveCell) {
|
|
142
|
+
const rowLength = this._getRowLength();
|
|
143
|
+
const totalCells = this._getGridCells().length;
|
|
144
|
+
const currentRow = Math.floor(index / rowLength);
|
|
145
|
+
const currentCol = index % rowLength;
|
|
146
|
+
const totalRows = Math.ceil(totalCells / rowLength);
|
|
147
|
+
switch (event.key) {
|
|
148
|
+
case "ArrowRight":
|
|
149
|
+
if (currentCol < rowLength - 1 && index + 1 < totalCells) {
|
|
150
|
+
this._focusSwatchByIndex(index + 1);
|
|
151
|
+
}
|
|
152
|
+
return false;
|
|
153
|
+
case "ArrowLeft":
|
|
154
|
+
if (currentCol > 0) {
|
|
155
|
+
this._focusSwatchByIndex(index - 1);
|
|
156
|
+
}
|
|
157
|
+
return false;
|
|
158
|
+
case "ArrowDown":
|
|
159
|
+
if (currentRow < totalRows - 1 && index + rowLength < totalCells) {
|
|
160
|
+
this._focusSwatchByIndex(index + rowLength);
|
|
161
|
+
}
|
|
162
|
+
return false;
|
|
163
|
+
case "ArrowUp":
|
|
164
|
+
if (currentRow > 0) {
|
|
165
|
+
this._focusSwatchByIndex(index - rowLength);
|
|
166
|
+
}
|
|
167
|
+
return false;
|
|
168
|
+
case "PageDown": {
|
|
169
|
+
const lastRowStart = (totalRows - 1) * rowLength;
|
|
170
|
+
const targetIndex = Math.min(
|
|
171
|
+
lastRowStart + currentCol,
|
|
172
|
+
totalCells - 1
|
|
173
|
+
);
|
|
174
|
+
if (index !== targetIndex) {
|
|
175
|
+
this._focusSwatchByIndex(targetIndex);
|
|
176
|
+
}
|
|
177
|
+
return false;
|
|
178
|
+
}
|
|
179
|
+
case "PageUp": {
|
|
180
|
+
const targetIndex = Math.min(currentCol, totalCells - 1);
|
|
181
|
+
if (index !== targetIndex) {
|
|
182
|
+
this._focusSwatchByIndex(targetIndex);
|
|
183
|
+
}
|
|
184
|
+
return false;
|
|
185
|
+
}
|
|
186
|
+
case "Home":
|
|
187
|
+
if (event.ctrlKey) {
|
|
188
|
+
this._focusSwatchByIndex(0);
|
|
189
|
+
} else {
|
|
190
|
+
this._focusSwatchByIndex(currentRow * rowLength);
|
|
191
|
+
}
|
|
192
|
+
return false;
|
|
193
|
+
case "End":
|
|
194
|
+
if (event.ctrlKey) {
|
|
195
|
+
this._focusSwatchByIndex(totalCells - 1);
|
|
196
|
+
} else {
|
|
197
|
+
const rowEnd = Math.min(
|
|
198
|
+
(currentRow + 1) * rowLength - 1,
|
|
199
|
+
totalCells - 1
|
|
200
|
+
);
|
|
201
|
+
this._focusSwatchByIndex(rowEnd);
|
|
202
|
+
}
|
|
203
|
+
return false;
|
|
204
|
+
case "Enter":
|
|
205
|
+
case " ":
|
|
206
|
+
if (isSaveCell) {
|
|
207
|
+
this._handleColorSaving();
|
|
208
|
+
}
|
|
209
|
+
if (value && !isSaveCell) {
|
|
210
|
+
this._handleSwatchSelection(value);
|
|
211
|
+
this._returnFocusToAnchor();
|
|
212
|
+
}
|
|
213
|
+
return false;
|
|
214
|
+
case "Escape":
|
|
215
|
+
this.open = false;
|
|
216
|
+
this._returnFocusToAnchor();
|
|
217
|
+
return false;
|
|
218
|
+
case "Tab":
|
|
219
|
+
this.open = false;
|
|
220
|
+
return true;
|
|
221
|
+
default:
|
|
222
|
+
return true;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* @internal
|
|
227
|
+
*/
|
|
228
|
+
_focusSwatchByIndex(index) {
|
|
229
|
+
const cells = this._getGridCells();
|
|
230
|
+
if (index < 0 || index >= cells.length) return;
|
|
231
|
+
cells[index]?.focus();
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* @internal
|
|
235
|
+
*/
|
|
236
|
+
_renderColorSwatch(iconTag) {
|
|
237
|
+
return html`
|
|
238
|
+
<button
|
|
239
|
+
class="swatch ${(x, c) => classNames(
|
|
240
|
+
c.parent.value === x.value ? "selected" : "",
|
|
241
|
+
c.parent._applyContrastClass(x.value) ? "contrast" : ""
|
|
242
|
+
)}"
|
|
243
|
+
role="gridcell"
|
|
244
|
+
style="--swatch-color: ${(x) => x.value};"
|
|
245
|
+
tabindex="${(x, c) => c.index === 0 ? "0" : "-1"}"
|
|
246
|
+
aria-label="${(x, c) => c.parent.locale.baseColorPicker.colorSwatchLabel(
|
|
247
|
+
x.value,
|
|
248
|
+
x.label,
|
|
249
|
+
c.parent.value === x.value
|
|
250
|
+
)}"
|
|
251
|
+
@click="${(x, c) => c.parent._handleSwatchSelection(x.value)}"
|
|
252
|
+
@keydown="${(x, c) => c.parent._handleCellKeydown(
|
|
253
|
+
c.event,
|
|
254
|
+
x.value,
|
|
255
|
+
c.index
|
|
256
|
+
)}"
|
|
257
|
+
>
|
|
258
|
+
${when(
|
|
259
|
+
(x, c) => c.parent.value === x.value,
|
|
260
|
+
html`<${iconTag} size="-6" name="check-solid" aria-hidden="true"></${iconTag}>`
|
|
261
|
+
)}
|
|
262
|
+
</button>
|
|
263
|
+
`;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
__decorateClass([
|
|
267
|
+
attr({ mode: "boolean" })
|
|
268
|
+
], BaseColorPickerElement.prototype, "open");
|
|
269
|
+
__decorateClass([
|
|
270
|
+
observable
|
|
271
|
+
], BaseColorPickerElement.prototype, "swatches");
|
|
272
|
+
return BaseColorPickerElement;
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
export { BaseColorPicker as B, isValidHexColor as i };
|
package/unbundled/button.cjs
CHANGED
|
@@ -120,7 +120,7 @@ class VividFoundationButton extends delegatesAria.DelegatesAria(
|
|
|
120
120
|
this.proxy.setAttribute("type", this.type);
|
|
121
121
|
this.handleUnsupportedDelegatesFocus();
|
|
122
122
|
if (this.autofocus) {
|
|
123
|
-
fastElement.
|
|
123
|
+
fastElement.Updates.enqueue(() => {
|
|
124
124
|
this.focus();
|
|
125
125
|
});
|
|
126
126
|
}
|
package/unbundled/button.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Updates, attr } from '@microsoft/fast-element';
|
|
2
2
|
import { D as DelegatesAria } from './delegates-aria.js';
|
|
3
3
|
import { V as VividElement } from './vivid-element.js';
|
|
4
4
|
import { F as FormAssociated } from './form-associated.js';
|
|
@@ -118,7 +118,7 @@ class VividFoundationButton extends DelegatesAria(
|
|
|
118
118
|
this.proxy.setAttribute("type", this.type);
|
|
119
119
|
this.handleUnsupportedDelegatesFocus();
|
|
120
120
|
if (this.autofocus) {
|
|
121
|
-
|
|
121
|
+
Updates.enqueue(() => {
|
|
122
122
|
this.focus();
|
|
123
123
|
});
|
|
124
124
|
}
|
|
@@ -226,7 +226,7 @@ const CalendarPicker = (Base) => {
|
|
|
226
226
|
_onPickerButtonClick() {
|
|
227
227
|
super._onPickerButtonClick();
|
|
228
228
|
if (this._popupOpen) {
|
|
229
|
-
fastElement.
|
|
229
|
+
fastElement.Updates.process();
|
|
230
230
|
const tabbableDate = this._tabbableDate;
|
|
231
231
|
if (tabbableDate)
|
|
232
232
|
this.shadowRoot.querySelector(
|
|
@@ -402,7 +402,7 @@ const CalendarPicker = (Base) => {
|
|
|
402
402
|
}
|
|
403
403
|
if (newDate && this._isDateInValidRange(newDate)) {
|
|
404
404
|
if (this._adjustSelectedMonthToEnsureVisibilityOf(newDate)) {
|
|
405
|
-
fastElement.
|
|
405
|
+
fastElement.Updates.process();
|
|
406
406
|
}
|
|
407
407
|
this._dialogEl.querySelector(
|
|
408
408
|
`[data-date="${newDate}"]`
|
|
@@ -457,7 +457,7 @@ const CalendarPicker = (Base) => {
|
|
|
457
457
|
_onMonthKeydown(month, event) {
|
|
458
458
|
let newMonth = null;
|
|
459
459
|
if (event.key === "ArrowUp") {
|
|
460
|
-
newMonth = addMonths(month, -
|
|
460
|
+
newMonth = addMonths(month, -MonthsPerRow);
|
|
461
461
|
} else if (event.key === "ArrowDown") {
|
|
462
462
|
newMonth = addMonths(month, MonthsPerRow);
|
|
463
463
|
} else if (event.key === "ArrowLeft") {
|
|
@@ -468,7 +468,7 @@ const CalendarPicker = (Base) => {
|
|
|
468
468
|
if (newMonth && this._isMonthInValidRange(newMonth)) {
|
|
469
469
|
if (newMonth.year !== this._monthPickerYear) {
|
|
470
470
|
this._monthPickerYear = newMonth.year;
|
|
471
|
-
fastElement.
|
|
471
|
+
fastElement.Updates.process();
|
|
472
472
|
}
|
|
473
473
|
this._dialogEl.querySelector(
|
|
474
474
|
`[data-month="${monthToStr(newMonth)}"]`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { formatISO, format, parse, addDays as addDays$1 } from 'date-fns';
|
|
2
|
-
import { observable, volatile,
|
|
2
|
+
import { observable, volatile, Updates, attr, repeat, when, html } from '@microsoft/fast-element';
|
|
3
3
|
import { classNames } from '@microsoft/fast-web-utilities';
|
|
4
4
|
import { D as Divider } from './divider.js';
|
|
5
5
|
import { B as Button } from './definition.js';
|
|
@@ -224,7 +224,7 @@ const CalendarPicker = (Base) => {
|
|
|
224
224
|
_onPickerButtonClick() {
|
|
225
225
|
super._onPickerButtonClick();
|
|
226
226
|
if (this._popupOpen) {
|
|
227
|
-
|
|
227
|
+
Updates.process();
|
|
228
228
|
const tabbableDate = this._tabbableDate;
|
|
229
229
|
if (tabbableDate)
|
|
230
230
|
this.shadowRoot.querySelector(
|
|
@@ -400,7 +400,7 @@ const CalendarPicker = (Base) => {
|
|
|
400
400
|
}
|
|
401
401
|
if (newDate && this._isDateInValidRange(newDate)) {
|
|
402
402
|
if (this._adjustSelectedMonthToEnsureVisibilityOf(newDate)) {
|
|
403
|
-
|
|
403
|
+
Updates.process();
|
|
404
404
|
}
|
|
405
405
|
this._dialogEl.querySelector(
|
|
406
406
|
`[data-date="${newDate}"]`
|
|
@@ -455,7 +455,7 @@ const CalendarPicker = (Base) => {
|
|
|
455
455
|
_onMonthKeydown(month, event) {
|
|
456
456
|
let newMonth = null;
|
|
457
457
|
if (event.key === "ArrowUp") {
|
|
458
|
-
newMonth = addMonths(month, -
|
|
458
|
+
newMonth = addMonths(month, -MonthsPerRow);
|
|
459
459
|
} else if (event.key === "ArrowDown") {
|
|
460
460
|
newMonth = addMonths(month, MonthsPerRow);
|
|
461
461
|
} else if (event.key === "ArrowLeft") {
|
|
@@ -466,7 +466,7 @@ const CalendarPicker = (Base) => {
|
|
|
466
466
|
if (newMonth && this._isMonthInValidRange(newMonth)) {
|
|
467
467
|
if (newMonth.year !== this._monthPickerYear) {
|
|
468
468
|
this._monthPickerYear = newMonth.year;
|
|
469
|
-
|
|
469
|
+
Updates.process();
|
|
470
470
|
}
|
|
471
471
|
this._dialogEl.querySelector(
|
|
472
472
|
`[data-month="${monthToStr(newMonth)}"]`
|
package/unbundled/definition.js
CHANGED
|
@@ -3,7 +3,7 @@ import { VwcProgressRingElement as ProgressRing, progressRingDefinition } from '
|
|
|
3
3
|
import { d as defineVividComponent, c as createRegisterFunction } from './vivid-element.js';
|
|
4
4
|
import { attr, html, when, ref } from '@microsoft/fast-element';
|
|
5
5
|
import { V as VividFoundationButton } from './button.js';
|
|
6
|
-
import {
|
|
6
|
+
import { b as AffixIconWithTrailing, a as affixIconTemplateFactory, I as IconWrapper } from './affix.js';
|
|
7
7
|
import { L as Localized } from './localized.js';
|
|
8
8
|
import { L as Linkable } from './linkable.js';
|
|
9
9
|
import { classNames } from '@microsoft/fast-web-utilities';
|
|
@@ -167,7 +167,7 @@ class MenuItem extends hostSemantics.HostSemantics(affix.AffixIcon(vividElement.
|
|
|
167
167
|
*/
|
|
168
168
|
connectedCallback() {
|
|
169
169
|
super.connectedCallback();
|
|
170
|
-
fastElement.
|
|
170
|
+
fastElement.Updates.enqueue(() => {
|
|
171
171
|
this._isPresentational = this._isPresentational ?? true;
|
|
172
172
|
this.#ensureRoleMatchesPresentational();
|
|
173
173
|
});
|
package/unbundled/definition2.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { VwcIconElement as Icon, iconDefinition } from '../icon/definition.js';
|
|
2
2
|
import { V as VividElement, r as replaces, d as defineVividComponent, c as createRegisterFunction } from './vivid-element.js';
|
|
3
|
-
import {
|
|
3
|
+
import { Updates, attr, observable, slotted, when, html, elements } from '@microsoft/fast-element';
|
|
4
4
|
import { keySpace, keyEnter, classNames } from '@microsoft/fast-web-utilities';
|
|
5
5
|
import { a as keyArrowLeft, k as keyArrowRight } from './key-codes.js';
|
|
6
|
-
import {
|
|
6
|
+
import { A as AffixIcon, a as affixIconTemplateFactory } from './affix.js';
|
|
7
7
|
import { H as HostSemantics, a as applyHostSemantics } from './host-semantics.js';
|
|
8
8
|
|
|
9
9
|
const styles = ":host(:focus-visible){outline:none}:host([disabled]){pointer-events:none}.base{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}@media (hover: hover){.base:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}}.base.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.base:disabled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.base.disabled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.base:active:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.base.active:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.base.selected:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}@media (hover: hover){.base.selected:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-dim);--_appearance-color-outline: transparent}}.base.selected.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-dim);--_appearance-color-outline: transparent}.base.connotation-cta{--_connotation-color-primary: var(--vvd-menu-item-cta-primary, var(--vvd-color-cta-500));--_connotation-color-primary-text: var(--vvd-menu-item-cta-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-menu-item-cta-primary-increment, var(--vvd-color-cta-600));--_connotation-color-firm: var(--vvd-menu-item-cta-firm, var(--vvd-color-cta-600));--_connotation-color-faint: var(--vvd-menu-item-cta-faint, var(--vvd-color-cta-50));--_connotation-color-soft: var(--vvd-menu-item-cta-soft, var(--vvd-color-cta-100));--_connotation-color-pale: var(--vvd-menu-item-cta-pale, var(--vvd-color-cta-300));--_connotation-color-dim: var(--vvd-menu-item-cta-dim, var(--vvd-color-cta-200))}.base:not(.connotation-cta){--_connotation-color-primary: var(--vvd-menu-item-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-text: var(--vvd-menu-item-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-menu-item-accent-primary-increment, var(--vvd-color-neutral-800));--_connotation-color-firm: var(--vvd-menu-item-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-faint: var(--vvd-menu-item-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-menu-item-accent-soft, var(--vvd-color-neutral-100));--_connotation-color-pale: var(--vvd-menu-item-accent-pale, var(--vvd-color-neutral-300));--_connotation-color-dim: var(--vvd-menu-item-accent-dim, var(--vvd-color-neutral-200))}.base{--_menu-item-padding-inline: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))*.4) }.base{display:flex;box-sizing:border-box;align-items:center;border-radius:8px;background-color:var(--_appearance-color-fill);box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);inline-size:100%}.base:not(.two-lines){gap:12px;min-block-size:calc(1px*(40 + 4*clamp(-1,var(--vvd-size-density, 0),2)));padding-block:8px;padding-inline:var(--_menu-item-padding-inline)}.base.two-lines{gap:16px;min-block-size:calc(1px*(40 + 4*clamp(-1,var(--vvd-size-density, 0),2)) + 1px*(24 + 4*clamp(-1,var(--vvd-size-density, 0),2)));padding-block:12px;padding-inline:var(--_menu-item-padding-inline)}@supports (user-select: none){.base{user-select:none}}.base:not(.disabled){cursor:pointer}:host(:not([role=presentation]):focus-visible) .base{box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px));--focus-stroke-gap-color: transparent}.icon{flex-shrink:0;font-size:calc(1px*(40 + 4*clamp(-1,var(--vvd-size-density, 0),2))/2);line-height:1}.action,.decorative{display:flex;place-content:center}.action{color:var(--_appearance-color-text)}.base.trailing .action,.base.has-meta .action{order:2}:host(:not([check-appearance],[checked],[disabled])) .action{color:var(--vvd-color-neutral-500)}.base:not(.disabled) .decorative{color:var(--vvd-color-neutral-600)}.base.disabled .decorative{color:var(--vvd-color-neutral-200)}.base.has-meta .decorative{order:1}.chevron{order:3}.text{display:flex;overflow:hidden;flex-direction:column;gap:4px;margin-inline-end:auto}.text-primary,.text-secondary{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;font:var(--vvd-typography-base)}.text-primary{font:var(--vvd-typography-base);-webkit-line-clamp:var(--text-primary-line-clamp, 1)}.base:not(.disabled) .text-primary{color:var(--vvd-color-canvas-text)}.base.disabled .text-primary{color:var(--_appearance-color-text)}.base.two-lines .text-primary{font:var(--vvd-typography-base-bold)}.text-secondary{color:var(--vvd-color-neutral-800);font:var(--vvd-typography-base-condensed);-webkit-line-clamp:var(--text-secondary-line-clamp, 1)}.base.two-lines .text-secondary{color:var(--vvd-color-neutral-600)}.base.disabled .text-secondary{color:var(--_appearance-color-text)}.base.selected:not(.disabled) .text-secondary{color:var(--vvd-color-neutral-800)}:host([internal-part]) .text-primary{font:var(--_text-primary-custom-size, var--vvd-typography-base)}";
|
|
@@ -165,7 +165,7 @@ class MenuItem extends HostSemantics(AffixIcon(VividElement)) {
|
|
|
165
165
|
*/
|
|
166
166
|
connectedCallback() {
|
|
167
167
|
super.connectedCallback();
|
|
168
|
-
|
|
168
|
+
Updates.enqueue(() => {
|
|
169
169
|
this._isPresentational = this._isPresentational ?? true;
|
|
170
170
|
this.#ensureRoleMatchesPresentational();
|
|
171
171
|
});
|