@vonage/vivid 5.3.0 → 5.5.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.js +1 -1
- package/alert/definition.cjs +1 -1
- package/alert/definition.js +2 -2
- package/badge/definition.js +1 -1
- package/banner/definition.js +1 -1
- package/bundled/base-color-picker.cjs +18 -13
- package/bundled/base-color-picker.js +98 -81
- package/bundled/calendar-picker.template.cjs +7 -7
- package/bundled/calendar-picker.template.js +102 -102
- package/bundled/char-count.cjs +1 -1
- package/bundled/char-count.js +1 -1
- package/bundled/definition10.cjs +1 -1
- package/bundled/definition10.js +2 -2
- package/bundled/definition11.cjs +12 -19
- package/bundled/definition11.js +87 -66
- package/bundled/definition12.cjs +19 -10
- package/bundled/definition12.js +217 -36
- package/bundled/definition13.cjs +10 -1
- package/bundled/definition13.js +38 -14
- package/bundled/definition14.cjs +1 -5
- package/bundled/definition14.js +15 -24
- package/bundled/definition15.cjs +5 -30
- package/bundled/definition15.js +22 -73
- package/bundled/definition16.cjs +30 -19
- package/bundled/definition16.js +74 -97
- package/bundled/definition17.cjs +19 -13
- package/bundled/definition17.js +83 -117
- package/bundled/definition18.cjs +13 -12
- package/bundled/definition18.js +114 -71
- package/bundled/definition19.cjs +26 -27
- package/bundled/definition19.js +171 -180
- package/bundled/definition2.cjs +9 -9
- package/bundled/definition2.js +84 -129
- package/bundled/definition3.cjs +1 -1
- package/bundled/definition3.js +1 -1
- package/bundled/definition6.cjs +3 -3
- package/bundled/definition6.js +19 -19
- package/bundled/definition9.cjs +5 -5
- package/bundled/definition9.js +394 -392
- package/bundled/listbox.cjs +1 -1
- package/bundled/listbox.js +82 -102
- package/bundled/localized.cjs +1 -1
- package/bundled/localized.js +48 -31
- package/bundled/mixins.cjs +1 -1
- package/bundled/mixins.js +1 -1
- package/bundled/picker-field.template.cjs +14 -14
- package/bundled/picker-field.template.js +35 -56
- package/bundled/time-selection-picker.template.cjs +12 -12
- package/bundled/time-selection-picker.template.js +13 -12
- package/bundled/trapped-focus.cjs +1 -0
- package/bundled/trapped-focus.js +26 -0
- package/bundled/vivid-element.cjs +5 -1
- package/bundled/vivid-element.js +401 -358
- package/calendar/index.cjs +13 -13
- package/calendar/index.js +171 -143
- package/card/definition.cjs +1 -1
- package/card/definition.js +1 -1
- package/color-picker/definition.cjs +209 -113
- package/color-picker/definition.js +209 -113
- package/color-picker/index.cjs +104 -75
- package/color-picker/index.js +412 -326
- package/combobox/definition.cjs +7 -27
- package/combobox/definition.js +8 -28
- package/combobox/index.cjs +6 -6
- package/combobox/index.js +57 -71
- package/contextual-help/index.cjs +1 -1
- package/contextual-help/index.js +1 -1
- package/custom-elements.json +354 -2
- package/data-grid/index.cjs +1 -1
- package/data-grid/index.js +1 -1
- 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 +139 -0
- package/dial-pad/definition.js +139 -0
- package/dial-pad/index.cjs +27 -20
- package/dial-pad/index.js +177 -100
- package/dialog/definition.cjs +2 -2
- package/dialog/definition.js +2 -2
- package/dialog/index.cjs +7 -7
- package/dialog/index.js +6 -6
- package/divider/index.cjs +1 -1
- package/divider/index.js +1 -1
- package/elevation/definition.cjs +1 -1
- package/elevation/definition.js +1 -1
- package/fab/definition.js +1 -1
- package/header/definition.cjs +1 -1
- package/header/definition.js +1 -1
- package/icon/definition.cjs +56 -22
- package/icon/definition.js +56 -22
- package/index.cjs +3 -4
- package/index.js +2 -3
- package/lib/accordion/accordion.d.ts +1 -1
- package/lib/accordion/definition.d.ts +1 -1
- package/lib/audio-player/audio-player.d.ts +1 -1
- package/lib/color-picker/color-picker.d.ts +390 -12
- package/lib/color-picker/locale.d.ts +4 -0
- package/lib/combobox/combobox.d.ts +1 -0
- package/lib/combobox/combobox.options.d.ts +1 -1
- package/lib/date-picker/date-picker.d.ts +38 -38
- package/lib/date-range-picker/date-range-picker.d.ts +20 -20
- package/lib/date-time-picker/date-time-picker.d.ts +40 -40
- package/lib/dial-pad/dial-pad.d.ts +1 -0
- package/lib/divider/divider.d.ts +1 -1
- package/lib/icon/icon.d.ts +1 -0
- package/lib/menu-item/menu-item-role.d.ts +1 -1
- package/lib/popup/popup.d.ts +1 -1
- package/lib/searchable-select/locale.d.ts +4 -0
- package/lib/searchable-select/searchable-select.d.ts +3 -0
- package/lib/select/select.d.ts +3 -1
- package/lib/simple-color-picker/simple-color-picker.d.ts +2 -1
- package/lib/slider/slider.d.ts +1 -1
- package/lib/tabs/tabs.d.ts +2 -2
- package/lib/text-area/text-area.d.ts +1 -1
- package/lib/text-field/text-field.d.ts +1 -1
- package/lib/time-picker/time-picker.d.ts +20 -20
- package/locales/de-DE.cjs +20 -3
- package/locales/de-DE.js +20 -3
- package/locales/en-GB.cjs +21 -4
- package/locales/en-GB.js +21 -4
- package/locales/en-US.cjs +21 -4
- package/locales/en-US.js +21 -4
- package/locales/ja-JP.cjs +20 -3
- package/locales/ja-JP.js +20 -3
- package/locales/zh-CN.cjs +19 -2
- package/locales/zh-CN.js +19 -2
- package/menu/definition.cjs +4 -4
- package/menu/definition.js +4 -4
- package/nav-disclosure/definition.js +1 -1
- package/nav-item/definition.js +1 -1
- package/note/definition.js +1 -1
- package/number-field/definition.js +1 -1
- package/number-field/index.cjs +1 -1
- package/number-field/index.js +3 -3
- 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 +31 -5
- package/popup/definition.cjs +2 -2
- package/popup/definition.js +2 -2
- package/progress-ring/index.cjs +1 -1
- package/progress-ring/index.js +1 -1
- package/radio/index.cjs +1 -1
- package/radio/index.js +1 -1
- package/radio-group/index.cjs +1 -1
- package/radio-group/index.js +1 -1
- package/range-slider/definition.cjs +1 -1
- package/range-slider/definition.js +1 -1
- package/rich-text-editor/definition.cjs +2 -3
- package/rich-text-editor/definition.js +1 -2
- package/rich-text-editor/index.cjs +27 -27
- package/rich-text-editor/index.js +1209 -1199
- package/searchable-select/definition.cjs +103 -11
- package/searchable-select/definition.js +103 -11
- package/searchable-select/index.cjs +81 -69
- package/searchable-select/index.js +359 -273
- package/select/definition.cjs +30 -44
- package/select/definition.js +30 -44
- package/selectable-box/definition.cjs +1 -1
- package/selectable-box/definition.js +1 -1
- package/selectable-box/index.cjs +1 -1
- package/selectable-box/index.js +2 -2
- package/shared/aria/aria-mixin.d.ts +1 -1
- package/shared/color-picker/base-color-picker.d.ts +2 -1
- package/shared/foundation/listbox/listbox.d.ts +4 -0
- package/shared/picker-field/mixins/calendar-picker.d.ts +10 -10
- package/shared/picker-field/mixins/calendar-picker.template.d.ts +10 -10
- package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +20 -20
- package/shared/picker-field/mixins/single-date-picker.d.ts +28 -28
- package/shared/picker-field/mixins/single-value-picker.d.ts +8 -8
- package/shared/picker-field/mixins/time-selection-picker.d.ts +20 -20
- package/shared/picker-field/mixins/time-selection-picker.template.d.ts +20 -20
- package/simple-color-picker/definition.cjs +9 -7
- package/simple-color-picker/definition.js +9 -7
- package/simple-color-picker/index.cjs +6 -6
- package/simple-color-picker/index.js +41 -39
- 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/tab/definition.js +1 -1
- package/tag/definition.cjs +34 -14
- package/tag/definition.js +35 -15
- package/tag/index.cjs +25 -12
- package/tag/index.js +64 -47
- package/tag-group/definition.cjs +1 -2
- package/tag-group/definition.js +1 -2
- package/tag-group/index.cjs +1 -1
- package/tag-group/index.js +11 -12
- package/text-area/index.cjs +1 -1
- package/text-area/index.js +2 -2
- package/text-field/definition.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 +1 -1
- package/toggletip/definition.cjs +1 -1
- package/toggletip/definition.js +1 -1
- package/toggletip/index.cjs +1 -1
- package/toggletip/index.js +1 -1
- package/tooltip/definition.cjs +3 -3
- package/tooltip/definition.js +3 -3
- package/tooltip/index.cjs +1 -1
- package/tooltip/index.js +1 -1
- package/tree-item/definition.cjs +1 -1
- package/tree-item/definition.js +1 -1
- package/tree-view/definition.cjs +1 -1
- package/tree-view/definition.js +1 -1
- package/unbundled/affix.js +1 -1
- package/unbundled/base-color-picker.cjs +36 -18
- package/unbundled/base-color-picker.js +36 -18
- package/unbundled/calendar-picker.template.cjs +2 -2
- package/unbundled/calendar-picker.template.js +2 -2
- package/unbundled/definition.js +1 -1
- package/unbundled/definition2.js +1 -1
- package/unbundled/definition3.cjs +222 -141
- package/unbundled/definition3.js +220 -139
- 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/listbox.cjs +41 -63
- package/unbundled/listbox.js +39 -61
- package/unbundled/picker-field.template.cjs +3 -36
- package/unbundled/picker-field.template.js +3 -35
- package/unbundled/slider.template.cjs +1 -1
- package/unbundled/slider.template.js +1 -1
- package/unbundled/time-selection-picker.template.cjs +2 -1
- package/unbundled/time-selection-picker.template.js +2 -1
- package/unbundled/trapped-focus.cjs +37 -0
- package/unbundled/trapped-focus.js +34 -0
- package/unbundled/vivid-element.cjs +1 -1
- package/unbundled/vivid-element.js +1 -1
- package/video-player/definition.cjs +56 -16
- package/video-player/definition.js +56 -16
- package/video-player/index.cjs +36 -36
- package/video-player/index.js +2461 -2445
- package/visually-hidden/index.cjs +1 -1
- package/visually-hidden/index.js +1 -1
- package/vivid.api.json +285 -38
- package/bundled/_has.cjs +0 -1
- package/bundled/_has.js +0 -34
- package/bundled/option.cjs +0 -1
- package/bundled/option.js +0 -158
- package/unbundled/option.cjs +0 -217
- package/unbundled/option.js +0 -214
package/bundled/definition19.js
CHANGED
|
@@ -1,45 +1,44 @@
|
|
|
1
|
-
import { P as
|
|
2
|
-
import { i as
|
|
3
|
-
import { l as
|
|
4
|
-
import { U as
|
|
5
|
-
import { a as
|
|
6
|
-
import { L as
|
|
7
|
-
import { H as
|
|
8
|
-
import { F as
|
|
1
|
+
import { P as D, p as H } from "./definition9.js";
|
|
2
|
+
import { i as E } from "./definition2.js";
|
|
3
|
+
import { L as V, l as F } from "./definition12.js";
|
|
4
|
+
import { U as z, O as u, o as p, a as c, v as T, h, c as W, d as L } from "./vivid-element.js";
|
|
5
|
+
import { a as P, f as B } from "./mixins.js";
|
|
6
|
+
import { L as S } from "./listbox.js";
|
|
7
|
+
import { H as N, a as M } from "./host-semantics.js";
|
|
8
|
+
import { F as j } from "./form-associated.js";
|
|
9
9
|
import { i as v } from "./numbers.js";
|
|
10
|
-
import { W as
|
|
11
|
-
import { W as
|
|
12
|
-
import { W as
|
|
13
|
-
import { F as
|
|
14
|
-
import { A as
|
|
15
|
-
import { u as
|
|
16
|
-
import { l as
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return o && i && te(e, t, i), i;
|
|
10
|
+
import { W as K } from "./with-contextual-help.js";
|
|
11
|
+
import { W as R } from "./with-error-text.js";
|
|
12
|
+
import { W as U } from "./with-success-text.js";
|
|
13
|
+
import { F as q } from "./form-element.js";
|
|
14
|
+
import { A as X, a as G, I as J } from "./affix.js";
|
|
15
|
+
import { u as Q } from "./strings.js";
|
|
16
|
+
import { l as g, d as y, m as _, k, c as I, b as w, a as O, f as Y } from "./key-codes.js";
|
|
17
|
+
import { c as Z } from "./definition3.js";
|
|
18
|
+
import { h as ee } from "./index.js";
|
|
19
|
+
import { r as b } from "./ref.js";
|
|
20
|
+
import { w as f } from "./when.js";
|
|
21
|
+
import { s as x } from "./slotted.js";
|
|
22
|
+
import { c as te } from "./class-names.js";
|
|
23
|
+
const oe = ".chevron{display:flex;flex-shrink:0;font:var(--vvd-typography-base-extended);transform:rotate(0);transition:transform .2s}:host([data-expanded=true]) .chevron,:host([open]) .chevron{transform:rotate(180deg)}:host(:focus-visible){outline:none}:host{display:inline-flex;flex-direction:column;gap:4px;--_low-ink-color: var(--vvd-color-neutral-600);--focus-stroke-gap-color: transparent}:host([disabled]){--_low-ink-color: var(--vvd-color-neutral-400);cursor:not-allowed}.label{color:var(--vvd-color-canvas-text);contain:inline-size;font:var(--vvd-typography-base)}.control{--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--vvd-color-neutral-500)}.control.appearance-ghost{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}@media (hover: hover){.control:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--vvd-color-neutral-700)}.control:hover:where(:not(.disabled,:disabled,.readonly)).appearance-ghost{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}}.control.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--vvd-color-neutral-700)}.control.hover:where(:not(.disabled,:disabled,.readonly)).appearance-ghost{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.control:disabled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-100);--_appearance-color-outline: var(--vvd-color-neutral-300)}.control:disabled.appearance-ghost{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.control.disabled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-100);--_appearance-color-outline: var(--vvd-color-neutral-300)}.control.disabled.appearance-ghost{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.control.readonly:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: var(--vvd-color-neutral-400)}.control.readonly:where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: var(--vvd-color-neutral-600);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.control.error:where(:not(.disabled,:disabled)){--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-alert-50);--_appearance-color-outline: var(--vvd-color-alert-500)}.control.error:where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-alert-50);--_appearance-color-outline: transparent}.control.success:where(:not(.disabled,:disabled)){--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-success-50);--_appearance-color-outline: var(--vvd-color-success-500)}.control.success:where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-success-50);--_appearance-color-outline: transparent}.control{--_connotation-color-primary: var(--vvd-select-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-text: var(--vvd-select-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-select-accent-primary-increment, var(--vvd-color-neutral-800));--_connotation-color-intermediate: var(--vvd-select-accent-intermediate, var(--vvd-color-neutral-500));--_connotation-color-faint: var(--vvd-select-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-select-accent-soft, var(--vvd-color-neutral-100));--_connotation-color-firm: var(--vvd-select-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-fierce: var(--vvd-select-accent-fierce, var(--vvd-color-neutral-700))}.control{border-radius:var(--_select-control-border-radius);block-size:var(--_select-block-size);padding-inline:var(--_select-padding-inline)}.control{--_select-icon-size: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))/2) ;--_select-block-size: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) ;--_select-padding-inline: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))*.4) ;display:flex;align-items:center;justify-content:space-between;background-color:var(--_appearance-color-fill);box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);color:var(--_appearance-color-text);font:var(--vvd-typography-base);gap:8px;transition:box-shadow .2s,background-color .2s}.control.size-condensed{--_select-icon-size: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))*.4) ;--_select-block-size: calc(1px*(32 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) ;--_select-padding-inline: calc(1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2))/2) }.control.size-condensed:not(.shape-pill){--_select-control-border-radius: 4px}.control-wrapper{position:relative}.control:not(.disabled){cursor:pointer}.control.disabled{pointer-events:none}.control:not(.shape-pill){--_select-control-border-radius: 8px}.control.shape-pill{--_select-control-border-radius: 24px}.listbox{display:flex;max-height:var(--select-height, 408px);flex-direction:column;padding:4px;gap:2px;overflow-y:auto}:host([multiple]:focus-visible) .listbox{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));border-radius:8px}.selected-value{display:flex;overflow:hidden;flex-grow:1;align-items:center;column-gap:12px;white-space:nowrap}.selected-value .text{overflow:hidden;max-inline-size:100%;text-overflow:ellipsis}.control.shows-placeholder .selected-value .text{color:var(--vvd-color-neutral-600)}.selected-value slot[name=icon]{flex:0 0 var(--_select-icon-size);font-size:var(--_select-icon-size);line-height:1}.control.has-meta .selected-value{padding-inline-end:8px}.feedback-wrapper{display:contents}::part(popup-base){inline-size:max-content;min-inline-size:var(--_select-fixed-width, 100%)}:host([multiple]) ::part(popup-base){position:static}:host(:focus-within) .control:not(.has-activedescendant){--focus-stroke-gap-color: transparent;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))}:host(:not([multiple])) ::slotted([data-vvd-component=option][current-selected]){border-radius:8px;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}.label-wrapper{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:var(--label-wrapper-gap, 8px)}.label-wrapper[hidden]{display:none}.label-wrapper .label{flex:1 1 auto}.label-wrapper slot[name=contextual-help]::slotted([data-vvd-component=contextual-help]){margin-inline-start:auto}";
|
|
24
|
+
var ae = Object.defineProperty, re = Object.getOwnPropertyDescriptor, l = (r, e, t, o) => {
|
|
25
|
+
for (var a = o > 1 ? void 0 : o ? re(e, t) : e, n = r.length - 1, s; n >= 0; n--)
|
|
26
|
+
(s = r[n]) && (a = (o ? s(e, t, a) : s(a)) || a);
|
|
27
|
+
return o && a && ae(e, t, a), a;
|
|
29
28
|
};
|
|
30
|
-
class
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
class i extends P(
|
|
30
|
+
K(
|
|
31
|
+
R(
|
|
32
|
+
U(
|
|
33
|
+
q(
|
|
34
|
+
N(X(j(S)))
|
|
36
35
|
)
|
|
37
36
|
)
|
|
38
37
|
)
|
|
39
38
|
)
|
|
40
39
|
) {
|
|
41
40
|
constructor() {
|
|
42
|
-
super(...arguments), this.proxy = document.createElement("select"), this.activeIndex = -1, this.rangeStartIndex = -1, this.open = !1, this.listboxId =
|
|
41
|
+
super(...arguments), this.proxy = document.createElement("select"), this.activeIndex = -1, this.rangeStartIndex = -1, this.open = !1, this.listboxId = Q("listbox-"), this.maxHeight = 0, this.fixedDropdown = !1, this._feedbackWrapper = null;
|
|
43
42
|
}
|
|
44
43
|
/**
|
|
45
44
|
* Returns the last checked option.
|
|
@@ -200,8 +199,8 @@ class r extends T(
|
|
|
200
199
|
return;
|
|
201
200
|
}
|
|
202
201
|
if (this.$fastController.isConnected) {
|
|
203
|
-
const o = this.getTypeaheadMatches(),
|
|
204
|
-
|
|
202
|
+
const o = this.getTypeaheadMatches(), a = this.options.indexOf(o[0]);
|
|
203
|
+
a > -1 && (this.activeIndex = a, this.uncheckAllOptions(), this.checkActiveIndex()), this.typeaheadExpired = !1;
|
|
205
204
|
}
|
|
206
205
|
}
|
|
207
206
|
/**
|
|
@@ -226,11 +225,11 @@ class r extends T(
|
|
|
226
225
|
if (!this.collapsible)
|
|
227
226
|
return;
|
|
228
227
|
if (this.open) {
|
|
229
|
-
this.focusAndScrollOptionIntoView(), this.indexWhenOpened = this.selectedIndex,
|
|
228
|
+
this.focusAndScrollOptionIntoView(), this.indexWhenOpened = this.selectedIndex, z.enqueue(() => this.focus());
|
|
230
229
|
return;
|
|
231
230
|
}
|
|
232
|
-
const o = e === !0 && t === !1,
|
|
233
|
-
o &&
|
|
231
|
+
const o = e === !0 && t === !1, a = this.indexWhenOpened !== this.selectedIndex;
|
|
232
|
+
o && a && this.updateValue(!0);
|
|
234
233
|
}
|
|
235
234
|
get collapsible() {
|
|
236
235
|
return !this.multiple;
|
|
@@ -239,16 +238,8 @@ class r extends T(
|
|
|
239
238
|
* @internal
|
|
240
239
|
*/
|
|
241
240
|
valueChanged(e, t) {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
const i = this._options.findIndex((x) => x.value === t), l = this._options[this.selectedIndex]?.value ?? null, s = this._options[i]?.value ?? null;
|
|
245
|
-
(i === -1 || l !== s) && (o = "", this.selectedIndex = i), o = this.firstSelectedOption?.value ?? o;
|
|
246
|
-
}
|
|
247
|
-
if (t !== o) {
|
|
248
|
-
this.value = o;
|
|
249
|
-
return;
|
|
250
|
-
}
|
|
251
|
-
super.valueChanged(e, t), this.updateDisplayValue();
|
|
241
|
+
const o = this.options.findIndex((s) => s.value === t), a = this._validSelectedIndex(o), n = this.options[a]?.value ?? "";
|
|
242
|
+
this.selectedIndex !== a && (this.selectedIndex = a), t === n && (super.valueChanged(e, t), this.updateDisplayValue());
|
|
252
243
|
}
|
|
253
244
|
/**
|
|
254
245
|
* Sets the value and display value to match the first selected option.
|
|
@@ -343,9 +334,9 @@ class r extends T(
|
|
|
343
334
|
* @internal
|
|
344
335
|
*/
|
|
345
336
|
selectedOptionsChanged(e, t) {
|
|
346
|
-
super.selectedOptionsChanged(e, t), this.options.forEach((o,
|
|
347
|
-
const
|
|
348
|
-
|
|
337
|
+
super.selectedOptionsChanged(e, t), this.options.forEach((o, a) => {
|
|
338
|
+
const n = this.proxy.options.item(a);
|
|
339
|
+
n && (n.selected = o.selected);
|
|
349
340
|
});
|
|
350
341
|
}
|
|
351
342
|
/**
|
|
@@ -369,31 +360,31 @@ class r extends T(
|
|
|
369
360
|
return;
|
|
370
361
|
const { key: t, shiftKey: o } = e;
|
|
371
362
|
switch (this.shouldSkipFocus = !1, t) {
|
|
372
|
-
case
|
|
363
|
+
case O: {
|
|
373
364
|
this.checkFirstOption(o);
|
|
374
365
|
return;
|
|
375
366
|
}
|
|
376
|
-
case
|
|
367
|
+
case w: {
|
|
377
368
|
this.checkNextOption(o);
|
|
378
369
|
return;
|
|
379
370
|
}
|
|
380
|
-
case
|
|
371
|
+
case I: {
|
|
381
372
|
this.checkPreviousOption(o);
|
|
382
373
|
return;
|
|
383
374
|
}
|
|
384
|
-
case
|
|
375
|
+
case k: {
|
|
385
376
|
this.checkLastOption(o);
|
|
386
377
|
return;
|
|
387
378
|
}
|
|
388
|
-
case
|
|
379
|
+
case _: {
|
|
389
380
|
this.focusAndScrollOptionIntoView();
|
|
390
381
|
return;
|
|
391
382
|
}
|
|
392
|
-
case
|
|
383
|
+
case y: {
|
|
393
384
|
this.uncheckAllOptions(), this.checkActiveIndex();
|
|
394
385
|
return;
|
|
395
386
|
}
|
|
396
|
-
case
|
|
387
|
+
case g:
|
|
397
388
|
if (e.preventDefault(), this.typeaheadExpired) {
|
|
398
389
|
this.toggleSelectedForAllCheckedOptions();
|
|
399
390
|
return;
|
|
@@ -413,27 +404,27 @@ class r extends T(
|
|
|
413
404
|
keydownHandler(e) {
|
|
414
405
|
const t = this.selectedIndex;
|
|
415
406
|
switch (this.multiple ? this.multipleKeydownHandler(e) : super.keydownHandler(e), e.key) {
|
|
416
|
-
case
|
|
407
|
+
case g: {
|
|
417
408
|
e.preventDefault(), this.collapsible && this.typeaheadExpired && (this.open = !this.open);
|
|
418
409
|
break;
|
|
419
410
|
}
|
|
420
|
-
case
|
|
421
|
-
case
|
|
411
|
+
case O:
|
|
412
|
+
case k: {
|
|
422
413
|
e.preventDefault();
|
|
423
414
|
break;
|
|
424
415
|
}
|
|
425
|
-
case
|
|
416
|
+
case Y: {
|
|
426
417
|
e.preventDefault(), this.open = !this.open;
|
|
427
418
|
break;
|
|
428
419
|
}
|
|
429
|
-
case
|
|
420
|
+
case y: {
|
|
430
421
|
this.collapsible && this.open && (e.preventDefault(), this.open = !1);
|
|
431
422
|
break;
|
|
432
423
|
}
|
|
433
|
-
case
|
|
424
|
+
case _:
|
|
434
425
|
return this.collapsible && this.open && (e.preventDefault(), this.open = !1), !0;
|
|
435
426
|
}
|
|
436
|
-
return this.collapsible && !this.open && this.selectedIndex !== t && this.updateValue(!0), !(e.key ===
|
|
427
|
+
return this.collapsible && !this.open && this.selectedIndex !== t && this.updateValue(!0), !(e.key === w || e.key === I);
|
|
437
428
|
}
|
|
438
429
|
connectedCallback() {
|
|
439
430
|
super.connectedCallback(), this.addEventListener("focusout", this.focusoutHandler), this.addEventListener("contentchange", this.updateDisplayValue);
|
|
@@ -451,150 +442,150 @@ class r extends T(
|
|
|
451
442
|
get displayValue() {
|
|
452
443
|
return u.track(this, "displayValue"), this.firstSelectedOption?.getAttribute("label") ?? this.firstSelectedOption?.text ?? this.placeholder ?? "";
|
|
453
444
|
}
|
|
454
|
-
|
|
455
|
-
const
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
445
|
+
_newDefaultSelectedIndex(e, t, o) {
|
|
446
|
+
const a = super._newDefaultSelectedIndex(
|
|
447
|
+
e,
|
|
448
|
+
t,
|
|
449
|
+
o
|
|
459
450
|
);
|
|
460
|
-
if (
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
if (t !== -1 || this.placeholder !== "") {
|
|
465
|
-
this.selectedIndex = t;
|
|
466
|
-
return;
|
|
451
|
+
if (a === null && o === -1 && !this.placeholder) {
|
|
452
|
+
const n = this.getNextSelectableIndex(0);
|
|
453
|
+
if (n !== -1)
|
|
454
|
+
return n;
|
|
467
455
|
}
|
|
456
|
+
return a;
|
|
457
|
+
}
|
|
458
|
+
_isDefaultSelected(e) {
|
|
459
|
+
return super._isDefaultSelected(e) || e.value === this.initialValue;
|
|
468
460
|
}
|
|
469
461
|
/*
|
|
470
462
|
* @internal
|
|
471
463
|
*/
|
|
472
464
|
slottedOptionsChanged(e, t) {
|
|
473
|
-
this.options.forEach((
|
|
474
|
-
u.getNotifier(
|
|
475
|
-
}), super.slottedOptionsChanged(e, t), this.options.forEach((
|
|
476
|
-
u.getNotifier(
|
|
465
|
+
this.options.forEach((a) => {
|
|
466
|
+
u.getNotifier(a).unsubscribe(this, "value");
|
|
467
|
+
}), super.slottedOptionsChanged(e, t), this.options.forEach((a) => {
|
|
468
|
+
u.getNotifier(a).subscribe(this, "value");
|
|
477
469
|
}), this.setProxyOptions(), this.updateValue();
|
|
478
470
|
const o = this.getAttribute("scale") || this.scale;
|
|
479
|
-
t.forEach((
|
|
480
|
-
o && (
|
|
471
|
+
t.forEach((a) => {
|
|
472
|
+
o && (a.setAttribute("scale", o), a.scale = o);
|
|
481
473
|
}), this.proxy.value = this.value, this.validate();
|
|
482
474
|
}
|
|
483
475
|
formResetCallback() {
|
|
484
|
-
this.setProxyOptions(),
|
|
476
|
+
this.setProxyOptions(), this.selectedIndex = this._newDefaultSelectedIndex([], this.options, -1) ?? -1;
|
|
485
477
|
}
|
|
486
478
|
}
|
|
487
|
-
|
|
488
|
-
c
|
|
489
|
-
], r.prototype, "activeIndex", 2);
|
|
490
|
-
n([
|
|
491
|
-
p({ mode: "boolean" })
|
|
492
|
-
], r.prototype, "multiple", 2);
|
|
493
|
-
n([
|
|
494
|
-
p({ attribute: "open", mode: "boolean" })
|
|
495
|
-
], r.prototype, "open", 2);
|
|
496
|
-
n([
|
|
497
|
-
V
|
|
498
|
-
], r.prototype, "collapsible", 1);
|
|
499
|
-
n([
|
|
500
|
-
c
|
|
501
|
-
], r.prototype, "control", 2);
|
|
502
|
-
n([
|
|
503
|
-
c
|
|
504
|
-
], r.prototype, "maxHeight", 2);
|
|
505
|
-
n([
|
|
506
|
-
c
|
|
507
|
-
], r.prototype, "_anchor", 2);
|
|
508
|
-
n([
|
|
509
|
-
p()
|
|
510
|
-
], r.prototype, "scale", 2);
|
|
511
|
-
n([
|
|
479
|
+
l([
|
|
512
480
|
p
|
|
513
|
-
],
|
|
514
|
-
|
|
481
|
+
], i.prototype, "activeIndex", 2);
|
|
482
|
+
l([
|
|
483
|
+
c({ mode: "boolean" })
|
|
484
|
+
], i.prototype, "multiple", 2);
|
|
485
|
+
l([
|
|
486
|
+
c({ attribute: "open", mode: "boolean" })
|
|
487
|
+
], i.prototype, "open", 2);
|
|
488
|
+
l([
|
|
489
|
+
T
|
|
490
|
+
], i.prototype, "collapsible", 1);
|
|
491
|
+
l([
|
|
515
492
|
p
|
|
516
|
-
],
|
|
517
|
-
|
|
518
|
-
p({ mode: "boolean", attribute: "fixed-dropdown" })
|
|
519
|
-
], r.prototype, "fixedDropdown", 2);
|
|
520
|
-
n([
|
|
493
|
+
], i.prototype, "control", 2);
|
|
494
|
+
l([
|
|
521
495
|
p
|
|
522
|
-
],
|
|
523
|
-
|
|
496
|
+
], i.prototype, "maxHeight", 2);
|
|
497
|
+
l([
|
|
498
|
+
p
|
|
499
|
+
], i.prototype, "_anchor", 2);
|
|
500
|
+
l([
|
|
501
|
+
c()
|
|
502
|
+
], i.prototype, "scale", 2);
|
|
503
|
+
l([
|
|
524
504
|
c
|
|
525
|
-
],
|
|
526
|
-
|
|
505
|
+
], i.prototype, "appearance", 2);
|
|
506
|
+
l([
|
|
527
507
|
c
|
|
528
|
-
],
|
|
529
|
-
|
|
508
|
+
], i.prototype, "shape", 2);
|
|
509
|
+
l([
|
|
510
|
+
c({ mode: "boolean", attribute: "fixed-dropdown" })
|
|
511
|
+
], i.prototype, "fixedDropdown", 2);
|
|
512
|
+
l([
|
|
530
513
|
c
|
|
531
|
-
],
|
|
532
|
-
|
|
533
|
-
|
|
514
|
+
], i.prototype, "placeholder", 2);
|
|
515
|
+
l([
|
|
516
|
+
p
|
|
517
|
+
], i.prototype, "_feedbackWrapper", 2);
|
|
518
|
+
l([
|
|
519
|
+
p
|
|
520
|
+
], i.prototype, "metaSlottedContent", 2);
|
|
521
|
+
const ne = ({
|
|
522
|
+
shape: r,
|
|
534
523
|
disabled: e,
|
|
535
524
|
appearance: t,
|
|
536
525
|
metaSlottedContent: o,
|
|
537
|
-
errorValidationMessage:
|
|
538
|
-
successText:
|
|
526
|
+
errorValidationMessage: a,
|
|
527
|
+
successText: n,
|
|
539
528
|
placeholder: s,
|
|
540
|
-
value:
|
|
541
|
-
scale:
|
|
542
|
-
|
|
529
|
+
value: $,
|
|
530
|
+
scale: m,
|
|
531
|
+
_activeDescendant: C,
|
|
532
|
+
open: A
|
|
533
|
+
}) => te(
|
|
534
|
+
["has-activedescendant", !!C && A],
|
|
543
535
|
["disabled", e],
|
|
544
536
|
[`appearance-${t}`, !!t],
|
|
545
|
-
[`shape-${
|
|
537
|
+
[`shape-${r}`, !!r],
|
|
546
538
|
["has-meta", !!o?.length],
|
|
547
|
-
["error", !!
|
|
548
|
-
["success", !!
|
|
549
|
-
["shows-placeholder", !!s &&
|
|
550
|
-
[`size-${
|
|
539
|
+
["error", !!a],
|
|
540
|
+
["success", !!n],
|
|
541
|
+
["shows-placeholder", !!s && !$],
|
|
542
|
+
[`size-${m}`, !!m]
|
|
551
543
|
);
|
|
552
544
|
function ie() {
|
|
553
545
|
return h` <label
|
|
554
|
-
for="${(
|
|
546
|
+
for="${(r) => r.multiple ? null : "control"}"
|
|
555
547
|
class="label"
|
|
556
548
|
id="label"
|
|
557
549
|
>
|
|
558
|
-
${(
|
|
550
|
+
${(r) => r.label}
|
|
559
551
|
</label>`;
|
|
560
552
|
}
|
|
561
|
-
function
|
|
562
|
-
const e =
|
|
553
|
+
function le(r) {
|
|
554
|
+
const e = r.tagFor(V);
|
|
563
555
|
return h`
|
|
564
|
-
<${e} ${
|
|
565
|
-
text="${(t) => t.placeholder}" hidden disabled>
|
|
556
|
+
<${e} text="${(t) => t.placeholder}" hidden disabled>
|
|
566
557
|
</${e}>`;
|
|
567
558
|
}
|
|
568
|
-
function
|
|
569
|
-
const e =
|
|
559
|
+
function se(r) {
|
|
560
|
+
const e = G(r), t = Z(r);
|
|
570
561
|
return h` <div
|
|
571
|
-
class="control ${
|
|
572
|
-
${
|
|
562
|
+
class="control ${ne}"
|
|
563
|
+
${b("_anchor")}
|
|
573
564
|
id="control"
|
|
574
565
|
?disabled="${(o) => o.disabled}"
|
|
575
566
|
>
|
|
576
567
|
<div class="selected-value">
|
|
577
|
-
${(o) => e(o.icon,
|
|
568
|
+
${(o) => e(o.icon, J.Slot)}
|
|
578
569
|
<span class="text">${(o) => o.displayValue}</span>
|
|
579
|
-
<slot name="meta" ${
|
|
570
|
+
<slot name="meta" ${x("metaSlottedContent")}></slot>
|
|
580
571
|
</div>
|
|
581
572
|
${t}
|
|
582
573
|
</div>`;
|
|
583
574
|
}
|
|
584
|
-
function
|
|
585
|
-
return
|
|
575
|
+
function ce(r) {
|
|
576
|
+
return r.open && r.fixedDropdown ? `--_select-fixed-width: ${Math.round(r.getBoundingClientRect().width)}px` : null;
|
|
586
577
|
}
|
|
587
|
-
function
|
|
588
|
-
const e =
|
|
578
|
+
function pe(r) {
|
|
579
|
+
const e = r.tagFor(D);
|
|
589
580
|
return h`
|
|
590
581
|
<div class="label-wrapper" ?hidden=${(t) => !t.label && !t._hasContextualHelp}>
|
|
591
|
-
${
|
|
592
|
-
<slot name="contextual-help" ${
|
|
582
|
+
${f((t) => t.label, ie())}
|
|
583
|
+
<slot name="contextual-help" ${x("_contextualHelpSlottedContent")}></slot>
|
|
593
584
|
</div>
|
|
594
585
|
<div class="control-wrapper">
|
|
595
|
-
${
|
|
586
|
+
${f((t) => !t.multiple, se(r))}
|
|
596
587
|
<${e} class="popup"
|
|
597
|
-
style="${
|
|
588
|
+
style="${ce}"
|
|
598
589
|
?open="${(t) => t.collapsible ? t.open : !0}"
|
|
599
590
|
:anchor="${(t) => t._anchor}"
|
|
600
591
|
placement="bottom-start"
|
|
@@ -607,11 +598,11 @@ function se(a) {
|
|
|
607
598
|
aria-labelledby="${(t) => t.multiple && t.label ? "label" : null}"
|
|
608
599
|
?disabled="${(t) => t.disabled}"
|
|
609
600
|
?hidden="${(t) => t.collapsible ? !t.open : !1}"
|
|
610
|
-
${
|
|
611
|
-
${
|
|
601
|
+
${b("listbox")}>
|
|
602
|
+
${f((t) => t.placeholder, le(r))}
|
|
612
603
|
<slot
|
|
613
|
-
${
|
|
614
|
-
filter:
|
|
604
|
+
${x({
|
|
605
|
+
filter: S.slottedOptionFilter,
|
|
615
606
|
flatten: !0,
|
|
616
607
|
property: "slottedOptions"
|
|
617
608
|
})}>
|
|
@@ -621,13 +612,13 @@ function se(a) {
|
|
|
621
612
|
</div>
|
|
622
613
|
`;
|
|
623
614
|
}
|
|
624
|
-
function d(
|
|
625
|
-
return (e, t) => t.event.composedPath().includes(e._feedbackWrapper) ? !0 :
|
|
615
|
+
function d(r) {
|
|
616
|
+
return (e, t) => t.event.composedPath().includes(e._feedbackWrapper) ? !0 : r(e, t.event);
|
|
626
617
|
}
|
|
627
|
-
const
|
|
618
|
+
const de = (r) => h`
|
|
628
619
|
<template
|
|
629
620
|
class="base"
|
|
630
|
-
${
|
|
621
|
+
${M({
|
|
631
622
|
role: "combobox",
|
|
632
623
|
ariaLabel: (e) => e.ariaLabel ?? e.label,
|
|
633
624
|
ariaHasPopup: (e) => e.collapsible ? "listbox" : "false",
|
|
@@ -635,7 +626,7 @@ const ce = (a) => h`
|
|
|
635
626
|
ariaDisabled: (e) => e.disabled
|
|
636
627
|
})}
|
|
637
628
|
aria-controls="${(e) => e.listboxId}"
|
|
638
|
-
aria-activedescendant="${(e) => e._activeDescendant}"
|
|
629
|
+
aria-activedescendant="${(e) => e.open ? e._activeDescendant : null}"
|
|
639
630
|
aria-describedby="${(e) => e._feedbackDescribedBy}"
|
|
640
631
|
tabindex="${(e) => e.disabled ? null : "0"}"
|
|
641
632
|
@click="${d((e, t) => e.clickHandler(t))}"
|
|
@@ -643,32 +634,32 @@ const ce = (a) => h`
|
|
|
643
634
|
@focusout="${d(
|
|
644
635
|
(e, t) => e.focusoutHandler(t)
|
|
645
636
|
)}"
|
|
646
|
-
@keydown="${d((e, t) => (e.open &&
|
|
637
|
+
@keydown="${d((e, t) => (e.open && ee(t), e.keydownHandler(t)))}"
|
|
647
638
|
@mousedown="${d(
|
|
648
639
|
(e, t) => e.mousedownHandler(t)
|
|
649
640
|
)}"
|
|
650
641
|
>
|
|
651
|
-
${
|
|
652
|
-
<div class="feedback-wrapper" ${
|
|
653
|
-
${(e) => e._getFeedbackTemplate(
|
|
642
|
+
${pe(r)}
|
|
643
|
+
<div class="feedback-wrapper" ${b("_feedbackWrapper")}>
|
|
644
|
+
${(e) => e._getFeedbackTemplate(r)}
|
|
654
645
|
</div>
|
|
655
646
|
</template>
|
|
656
|
-
`,
|
|
647
|
+
`, he = L(
|
|
657
648
|
"select",
|
|
658
|
-
|
|
659
|
-
|
|
649
|
+
i,
|
|
650
|
+
de,
|
|
660
651
|
[
|
|
661
|
-
A,
|
|
662
652
|
H,
|
|
663
|
-
|
|
664
|
-
|
|
653
|
+
E,
|
|
654
|
+
F,
|
|
655
|
+
B
|
|
665
656
|
],
|
|
666
657
|
{
|
|
667
|
-
styles:
|
|
658
|
+
styles: oe
|
|
668
659
|
}
|
|
669
|
-
),
|
|
660
|
+
), ze = W(he);
|
|
670
661
|
export {
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
662
|
+
i as S,
|
|
663
|
+
ze as r,
|
|
664
|
+
he as s
|
|
674
665
|
};
|
package/bundled/definition2.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const i=require("./vivid-element.cjs"),m=require("./definition14.cjs"),u=require("./class-names.cjs"),d=require("./when.cjs"),_=":host{display:inline-block;vertical-align:sub}.control.connotation-accent{--_connotation-color-primary: var(--vvd-icon-accent-primary, var(--vvd-color-canvas-text))}.control.connotation-announcement{--_connotation-color-primary: var(--vvd-icon-announcement-primary, var(--vvd-color-announcement-500))}.control.connotation-cta{--_connotation-color-primary: var(--vvd-icon-cta-primary, var(--vvd-color-cta-500))}.control.connotation-success{--_connotation-color-primary: var(--vvd-icon-success-primary, var(--vvd-color-success-500))}.control.connotation-warning{--_connotation-color-primary: var(--vvd-icon-warning-primary, var(--vvd-color-warning-300))}.control.connotation-alert{--_connotation-color-primary: var(--vvd-icon-alert-primary, var(--vvd-color-alert-500))}.control.connotation-information{--_connotation-color-primary: var(--vvd-icon-information-primary, var(--vvd-color-information-500))}.control.size--6{--_icon-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)))) }.control.size--5{--_icon-block-size: calc(1px*(20 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size--4{--_icon-block-size: calc(1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size--3{--_icon-block-size: calc(1px*(28 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size--2{--_icon-block-size: calc(1px*(32 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size--1{--_icon-block-size: calc(1px*(36 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size-0{--_icon-block-size: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size-1{--_icon-block-size: calc(1px*(44 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size-2{--_icon-block-size: calc(1px*(48 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size-3{--_icon-block-size: calc(1px*(52 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size-4{--_icon-block-size: calc(1px*(56 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size-5{--_icon-block-size: calc(1px*(60 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control:not(.size--6,.size--5,.size--4,.size--3,.size--2,.size--1,.size-0,.size-1,.size-2,.size-3,.size-4,.size-5){--_icon-block-size: 1em}.control{display:flex;margin:unset;block-size:var(--_icon-block-size);color:currentColor;contain:strict;inline-size:var(--_icon-block-size)}.control[class*=connotation]{color:var(--_connotation-color-primary)}slot,svg,::slotted(:where(svg,img)){margin:auto;block-size:inherit;inline-size:inherit}",b="https://icon.resources.vonage.com",h="4.6.9",f={toView(o){return o===void 0?null:o.toString()},fromView(o){if(typeof o=="string"&&(o=parseFloat(o.toString())),typeof o=="number")return isNaN(o)||!isFinite(o)?void 0:o}},p=`<svg width="80%" height="80%" viewBox="0 0 64 64">
|
|
2
2
|
<g>
|
|
3
3
|
<g stroke-width="6" stroke-linecap="round" fill="none">
|
|
4
4
|
<path stroke="currentColor" d="M4,32 c0,15,12,28,28,28c8,0,16-4,21-9">
|
|
@@ -9,16 +9,16 @@
|
|
|
9
9
|
</animateTransform>
|
|
10
10
|
</g>
|
|
11
11
|
</g>
|
|
12
|
-
</svg>`;var
|
|
12
|
+
</svg>`;var w=Object.defineProperty,x=Object.getOwnPropertyDescriptor,l=(o,t,n,e)=>{for(var r=e>1?void 0:e?x(t,n):t,a=o.length-1,c;a>=0;a--)(c=o[a])&&(r=(e?c(t,n,r):c(r))||r);return e&&r&&w(t,n,r),r};const k=500,C=2e3,z=(o,t)=>[b,`v${t}`,o].join("/"),$=({ok:o,headers:t})=>{if(!o||t.get("content-type")!=="image/svg+xml")throw new Error("Something went wrong")},E=o=>($(o),o.text()),L=(o,t)=>fetch(z(`${o}.svg`,h),{signal:t}).then(E),g=o=>(o??"").trim(),v=new Map,I=(o,t)=>{const n=g(o);if(!n)return Promise.resolve("");const e=v.get(n);if(e&&!e.signal?.aborted)return e.promise;const r=L(n,t).then(a=>{const c=v.get(n);if(c&&c.promise===r&&t.aborted)throw v.delete(n),t.reason??new DOMException("Aborted","AbortError");return a}).catch(a=>{const c=v.get(n);throw c&&c.promise===r&&v.delete(n),a});return v.set(n,{promise:r,signal:t}),r};class s extends i.VividElement{constructor(){super(...arguments),this.iconLoaded=!1,this.#o=0,this.#t=null}#o;get iconUrl(){const t=g(this.name);return t?z(`${t}.svg`,h):this._svg}#t;async nameChanged(){const t=++this.#o;this.#t&&this.#t.abort(),this.#t=new AbortController,this._svg=void 0,this.iconLoaded=!1;let n=setTimeout(()=>{this.#o===t&&(this._svg=p,n=setTimeout(()=>{this.#o===t&&this._svg===p&&(this._svg=void 0)},C))},k);try{const e=await I(this.name,this.#t.signal);this.#o===t&&(this._svg=e)}catch{this.#o===t&&(this._svg=void 0)}finally{this.#o===t&&(clearTimeout(n),this.iconLoaded=!0)}}}l([i.attr],s.prototype,"connotation",2);l([i.attr({converter:f})],s.prototype,"size",2);l([i.observable],s.prototype,"_svg",2);l([i.observable],s.prototype,"iconLoaded",2);l([i.attr],s.prototype,"label",2);l([i.attr],s.prototype,"name",2);l([i.volatile],s.prototype,"iconUrl",1);const O=({connotation:o,size:t})=>u.classNames("control",[`connotation-${o}`,!!o],[`size-${t}`,typeof t=="number"]),D=o=>{const t=o.tagFor(m.VisuallyHidden),n=e=>!e.label||e.label.trim().length===0;return i.html`
|
|
13
13
|
<figure
|
|
14
|
-
class="${
|
|
15
|
-
?aria-hidden="${
|
|
16
|
-
?aria-busy="${
|
|
14
|
+
class="${O}"
|
|
15
|
+
?aria-hidden="${e=>n(e)}"
|
|
16
|
+
?aria-busy="${e=>!e?.iconLoaded}"
|
|
17
17
|
>
|
|
18
18
|
<slot>
|
|
19
|
-
${d.when(
|
|
20
|
-
${d.when(
|
|
19
|
+
${d.when(e=>!e?.iconLoaded,i.html`<img alt="${e=>e?.name}" src="${e=>e?.iconUrl}" />`)}
|
|
20
|
+
${d.when(e=>e?.iconLoaded&&e?._svg,e=>i.html`${i.html.partial(e._svg)}`)}
|
|
21
21
|
</slot>
|
|
22
|
-
<${
|
|
22
|
+
<${t} class="label">${e=>e?.label}</${t}>
|
|
23
23
|
</figure>
|
|
24
|
-
`},
|
|
24
|
+
`},y=i.defineVividComponent("icon",s,D,[m.visuallyHiddenDefinition],{styles:_}),S=i.createRegisterFunction(y);exports.Icon=s;exports.iconDefinition=y;exports.registerIcon=S;
|