@vonage/vivid 3.51.0 → 3.52.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.
Files changed (261) hide show
  1. package/alert/index.cjs +1 -1
  2. package/alert/index.js +1 -1
  3. package/appearance-ui/index.cjs +19 -11
  4. package/appearance-ui/index.js +19 -11
  5. package/audio-player/index.cjs +2 -1
  6. package/audio-player/index.js +2 -1
  7. package/card/index.cjs +1 -1
  8. package/card/index.js +1 -1
  9. package/combobox/index.cjs +2 -5
  10. package/combobox/index.js +2 -5
  11. package/custom-elements.json +1357 -529
  12. package/date-picker/index.cjs +3 -6
  13. package/date-picker/index.js +3 -6
  14. package/date-range-picker/index.cjs +2 -5
  15. package/date-range-picker/index.js +2 -5
  16. package/dialog/index.cjs +1 -1
  17. package/dialog/index.js +1 -1
  18. package/elevation/index.cjs +1 -1
  19. package/elevation/index.js +1 -1
  20. package/file-picker/index.cjs +0 -2
  21. package/file-picker/index.js +0 -2
  22. package/header/index.cjs +1 -1
  23. package/header/index.js +1 -1
  24. package/index.cjs +60 -58
  25. package/index.js +22 -23
  26. package/lib/avatar/definition.d.ts +1 -1
  27. package/lib/button/button.d.ts +1 -0
  28. package/lib/button/definition.d.ts +1 -1
  29. package/lib/calendar-event/definition.d.ts +1 -1
  30. package/lib/components.d.ts +1 -0
  31. package/lib/layout/definition.d.ts +1 -1
  32. package/lib/menu-item/menu-item.d.ts +3 -0
  33. package/lib/range-slider/definition.d.ts +3 -0
  34. package/lib/range-slider/locale.d.ts +4 -0
  35. package/lib/range-slider/range-slider.d.ts +32 -0
  36. package/lib/range-slider/range-slider.form-associated.d.ts +10 -0
  37. package/lib/range-slider/range-slider.template.d.ts +4 -0
  38. package/lib/range-slider/utils/lerp.d.ts +2 -0
  39. package/lib/range-slider/utils/roundToStepValue.d.ts +1 -0
  40. package/lib/slider/slider.template.d.ts +1 -0
  41. package/lib/split-button/definition.d.ts +1 -1
  42. package/listbox/index.cjs +23 -22
  43. package/listbox/index.js +23 -22
  44. package/locales/en-GB.cjs +4 -0
  45. package/locales/en-GB.js +4 -0
  46. package/locales/en-US.cjs +4 -0
  47. package/locales/en-US.js +4 -0
  48. package/locales/ja-JP.cjs +5 -1
  49. package/locales/ja-JP.js +5 -1
  50. package/locales/zh-CN.cjs +4 -0
  51. package/locales/zh-CN.js +4 -0
  52. package/menu/index.cjs +3 -3
  53. package/menu/index.js +3 -3
  54. package/menu-item/index.cjs +2 -2
  55. package/menu-item/index.js +2 -2
  56. package/number-field/index.cjs +0 -2
  57. package/number-field/index.js +0 -2
  58. package/package.json +34 -34
  59. package/popup/index.cjs +2 -2
  60. package/popup/index.js +2 -2
  61. package/range-slider/index.cjs +22 -0
  62. package/range-slider/index.js +20 -0
  63. package/select/index.cjs +3 -3
  64. package/select/index.js +3 -3
  65. package/selectable-box/index.cjs +1 -1
  66. package/selectable-box/index.js +1 -1
  67. package/shared/Reflector.cjs +5 -1
  68. package/shared/Reflector.js +5 -1
  69. package/shared/affix.cjs +11 -4
  70. package/shared/affix.js +12 -4
  71. package/shared/anchored.cjs +8 -2
  72. package/shared/anchored.js +8 -2
  73. package/shared/definition.cjs +8 -3
  74. package/shared/definition.js +8 -3
  75. package/shared/definition10.cjs +5 -5
  76. package/shared/definition10.js +5 -5
  77. package/shared/definition11.cjs +75 -47
  78. package/shared/definition11.js +76 -48
  79. package/shared/definition12.cjs +12 -14
  80. package/shared/definition12.js +12 -14
  81. package/shared/definition13.cjs +118 -75
  82. package/shared/definition13.js +118 -75
  83. package/shared/definition14.cjs +33 -32
  84. package/shared/definition14.js +33 -32
  85. package/shared/definition15.cjs +20 -7
  86. package/shared/definition15.js +20 -7
  87. package/shared/definition16.cjs +37 -42
  88. package/shared/definition16.js +36 -41
  89. package/shared/definition17.cjs +125 -65
  90. package/shared/definition17.js +126 -66
  91. package/shared/definition18.cjs +30 -14
  92. package/shared/definition18.js +30 -14
  93. package/shared/definition19.cjs +116 -80
  94. package/shared/definition19.js +116 -80
  95. package/shared/definition2.cjs +10 -5
  96. package/shared/definition2.js +10 -5
  97. package/shared/definition20.cjs +16 -15
  98. package/shared/definition20.js +16 -15
  99. package/shared/definition21.cjs +6 -10
  100. package/shared/definition21.js +6 -10
  101. package/shared/definition22.cjs +14 -18
  102. package/shared/definition22.js +14 -18
  103. package/shared/definition23.cjs +34 -35
  104. package/shared/definition23.js +34 -35
  105. package/shared/definition24.cjs +116 -69
  106. package/shared/definition24.js +116 -69
  107. package/shared/definition25.cjs +2 -4
  108. package/shared/definition25.js +2 -4
  109. package/shared/definition26.cjs +9 -8
  110. package/shared/definition26.js +9 -8
  111. package/shared/definition27.cjs +7 -5
  112. package/shared/definition27.js +7 -5
  113. package/shared/definition28.cjs +209 -143
  114. package/shared/definition28.js +209 -143
  115. package/shared/definition29.cjs +10 -4
  116. package/shared/definition29.js +10 -4
  117. package/shared/definition3.cjs +7 -10
  118. package/shared/definition3.js +7 -10
  119. package/shared/definition30.cjs +7 -5
  120. package/shared/definition30.js +7 -5
  121. package/shared/definition31.cjs +2 -4
  122. package/shared/definition31.js +2 -4
  123. package/shared/definition32.cjs +1 -3
  124. package/shared/definition32.js +1 -3
  125. package/shared/definition33.cjs +7 -10
  126. package/shared/definition33.js +7 -10
  127. package/shared/definition34.cjs +76 -59
  128. package/shared/definition34.js +76 -59
  129. package/shared/definition35.cjs +19 -20
  130. package/shared/definition35.js +19 -20
  131. package/shared/definition36.cjs +30 -14
  132. package/shared/definition36.js +30 -14
  133. package/shared/definition37.cjs +33 -46
  134. package/shared/definition37.js +33 -46
  135. package/shared/definition38.cjs +31 -33
  136. package/shared/definition38.js +31 -33
  137. package/shared/definition39.cjs +13 -4
  138. package/shared/definition39.js +13 -4
  139. package/shared/definition4.cjs +23 -11
  140. package/shared/definition4.js +23 -11
  141. package/shared/definition40.cjs +19 -14
  142. package/shared/definition40.js +19 -14
  143. package/shared/definition41.cjs +534 -635
  144. package/shared/definition41.js +534 -635
  145. package/shared/definition42.cjs +674 -106
  146. package/shared/definition42.js +673 -105
  147. package/shared/definition43.cjs +122 -79
  148. package/shared/definition43.js +120 -77
  149. package/shared/definition44.cjs +72 -567
  150. package/shared/definition44.js +71 -565
  151. package/shared/definition45.cjs +520 -118
  152. package/shared/definition45.js +518 -117
  153. package/shared/definition46.cjs +117 -130
  154. package/shared/definition46.js +116 -129
  155. package/shared/definition47.cjs +152 -18
  156. package/shared/definition47.js +151 -17
  157. package/shared/definition48.cjs +20 -77
  158. package/shared/definition48.js +19 -76
  159. package/shared/definition49.cjs +52 -495
  160. package/shared/definition49.js +51 -494
  161. package/shared/definition5.cjs +20 -17
  162. package/shared/definition5.js +20 -17
  163. package/shared/definition50.cjs +525 -24
  164. package/shared/definition50.js +524 -23
  165. package/shared/definition51.cjs +28 -119
  166. package/shared/definition51.js +26 -118
  167. package/shared/definition52.cjs +113 -266
  168. package/shared/definition52.js +113 -265
  169. package/shared/definition53.cjs +285 -245
  170. package/shared/definition53.js +285 -245
  171. package/shared/definition54.cjs +285 -751
  172. package/shared/definition54.js +284 -750
  173. package/shared/definition55.cjs +828 -99
  174. package/shared/definition55.js +827 -98
  175. package/shared/definition56.cjs +126 -77
  176. package/shared/definition56.js +125 -76
  177. package/shared/definition57.cjs +125 -71
  178. package/shared/definition57.js +124 -70
  179. package/shared/definition58.cjs +73 -287
  180. package/shared/definition58.js +74 -288
  181. package/shared/definition59.cjs +298 -40
  182. package/shared/definition59.js +297 -39
  183. package/shared/definition6.cjs +3 -4
  184. package/shared/definition6.js +3 -4
  185. package/shared/definition60.cjs +24 -1784
  186. package/shared/definition60.js +23 -1783
  187. package/shared/definition61.cjs +1819 -11
  188. package/shared/definition61.js +1818 -11
  189. package/shared/definition7.cjs +6 -4
  190. package/shared/definition7.js +6 -4
  191. package/shared/definition8.cjs +25 -18
  192. package/shared/definition8.js +25 -18
  193. package/shared/definition9.cjs +6 -9
  194. package/shared/definition9.js +6 -9
  195. package/shared/icon.cjs +7 -2
  196. package/shared/icon.js +7 -2
  197. package/shared/index2.cjs +1 -1
  198. package/shared/index2.js +1 -1
  199. package/shared/key-codes2.cjs +8 -0
  200. package/shared/key-codes2.js +5 -1
  201. package/shared/localization/Locale.d.ts +2 -0
  202. package/shared/patterns/index.d.ts +0 -1
  203. package/shared/presentationDate.cjs +126 -78
  204. package/shared/presentationDate.js +126 -78
  205. package/shared/slider.template.cjs +71 -0
  206. package/shared/slider.template.js +67 -0
  207. package/shared/text-anchor.template.cjs +30 -35
  208. package/shared/text-anchor.template.js +30 -35
  209. package/shared/text-field.cjs +1 -1
  210. package/shared/text-field.js +1 -1
  211. package/side-drawer/index.cjs +1 -1
  212. package/side-drawer/index.js +1 -1
  213. package/slider/index.cjs +2 -1
  214. package/slider/index.js +2 -1
  215. package/split-button/index.cjs +1 -1
  216. package/split-button/index.js +1 -1
  217. package/styles/core/all.css +1 -1
  218. package/styles/core/theme.css +1 -1
  219. package/styles/core/typography.css +1 -1
  220. package/styles/fonts/spezia-variable.css +39 -13
  221. package/styles/tokens/theme-dark.css +4 -4
  222. package/styles/tokens/theme-light.css +4 -4
  223. package/styles/tokens/vivid-2-compat.css +4 -2
  224. package/switch/index.cjs +1 -1
  225. package/switch/index.js +1 -1
  226. package/tab/index.cjs +1 -1
  227. package/tab/index.js +1 -1
  228. package/tab-panel/index.cjs +1 -1
  229. package/tab-panel/index.js +1 -1
  230. package/tabs/index.cjs +3 -3
  231. package/tabs/index.js +3 -3
  232. package/tag/index.cjs +1 -1
  233. package/tag/index.js +1 -1
  234. package/tag-group/index.cjs +1 -1
  235. package/tag-group/index.js +1 -1
  236. package/text-area/index.cjs +1 -1
  237. package/text-area/index.js +1 -1
  238. package/text-field/index.cjs +1 -4
  239. package/text-field/index.js +1 -4
  240. package/time-picker/index.cjs +4 -7
  241. package/time-picker/index.js +4 -7
  242. package/toggletip/index.cjs +3 -3
  243. package/toggletip/index.js +3 -3
  244. package/tooltip/index.cjs +3 -3
  245. package/tooltip/index.js +3 -3
  246. package/tree-item/index.cjs +1 -1
  247. package/tree-item/index.js +1 -1
  248. package/tree-view/index.cjs +1 -1
  249. package/tree-view/index.js +1 -1
  250. package/vivid.api.json +117 -1
  251. package/focus/index.cjs +0 -7
  252. package/focus/index.js +0 -5
  253. package/lib/focus/definition.d.ts +0 -3
  254. package/lib/focus/focus.d.ts +0 -3
  255. package/lib/focus/focus.template.d.ts +0 -4
  256. package/lib/popup/popup.d.ts +0 -21
  257. package/shared/focus.cjs +0 -8
  258. package/shared/focus.js +0 -6
  259. package/shared/focus2.cjs +0 -11
  260. package/shared/focus2.js +0 -9
  261. package/shared/patterns/focus.d.ts +0 -3
@@ -1,14 +1,521 @@
1
1
  'use strict';
2
2
 
3
3
  const index = require('./index.cjs');
4
- const definition = require('./definition15.cjs');
5
- const definition$1 = require('./definition40.cjs');
6
- const enums = require('./enums.cjs');
7
- const radio$1 = require('./radio.cjs');
8
- const classNames = require('./class-names.cjs');
4
+ const definition = require('./definition61.cjs');
5
+ const definition$2 = require('./definition26.cjs');
6
+ const definition$1 = require('./definition35.cjs');
7
+ const affix = require('./affix.cjs');
8
+ const index$1 = require('./index2.cjs');
9
+ const listbox = require('./listbox.cjs');
10
+ const startEnd = require('./start-end.cjs');
11
+ const applyMixins = require('./apply-mixins.cjs');
12
+ const formAssociated = require('./form-associated.cjs');
13
+ const select_options = require('./select.options.cjs');
14
+ const strings = require('./strings.cjs');
15
+ const keyCodes = require('./key-codes.cjs');
9
16
  const when = require('./when.cjs');
17
+ const ref = require('./ref.cjs');
18
+ const slotted = require('./slotted.cjs');
19
+ const classNames = require('./class-names.cjs');
10
20
 
11
- const styles = ":host{display:flex}.base{position:relative;padding:var(--selectable-box-spacing, 16px);border:1px solid var(--_appearance-color-outline);background-color:var(--_appearance-color-fill);border-radius:8px;inline-size:100%;padding-block-start:calc(var(--selectable-box-spacing, 16px) + 36px);text-align:start}.base.connotation-cta{--_connotation-color-firm-all: var(--vvd-selectable-box-cta-firm-all, var(--vvd-color-cta-600));--_connotation-color-pale: var(--vvd-selectable-box-cta-pale, var(--vvd-color-cta-300));--_connotation-color-fierce: var(--vvd-selectable-box-cta-fierce, var(--vvd-color-cta-700));--_connotation-color-faint: var(--vvd-selectable-box-cta-faint, var(--vvd-color-cta-50));--_connotation-color-soft: var(--vvd-selectable-box-cta-soft, var(--vvd-color-cta-100))}.base:not(.connotation-cta){--_connotation-color-firm-all: var(--vvd-selectable-box-accent-firm-all, var(--vvd-color-neutral-600));--_connotation-color-pale: var(--vvd-selectable-box-accent-pale, var(--vvd-color-neutral-300));--_connotation-color-fierce: var(--vvd-selectable-box-accent-fierce, var(--vvd-color-neutral-700));--_connotation-color-faint: var(--vvd-selectable-box-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-selectable-box-accent-soft, var(--vvd-color-neutral-100))}.base{--_appearance-color-text: var(--_connotation-color-firm-all);--_appearance-color-fill: transparent;--_appearance-color-outline: var(--_connotation-color-pale)}.base:where(:hover,.hover):where(:not(:disabled,.disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm-all);--_appearance-color-fill: transparent;--_appearance-color-outline: var(--_connotation-color-firm-all)}.base:where(.selected,[aria-current]):where(:not(:disabled,.disabled)){--_appearance-color-text: var(--_connotation-color-firm-all);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: var(--_connotation-color-pale)}.base:where(.selected,[aria-current]):where(:hover,.hover):where(:not(:disabled,.disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm-all);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: var(--_connotation-color-firm-all)}.base:focus-visible{--focus-stroke-gap-color: transparent;box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px))}.base.tight{overflow:hidden;min-height:calc(var(--selectable-box-spacing, 16px) * 2 + 22px);padding:0}.base.clickable{cursor:pointer}.control{position:absolute;inset-block-start:var(--selectable-box-spacing, 16px);inset-inline-end:var(--selectable-box-spacing, 16px)}\n";
21
+ class _Select extends listbox.ListboxElement {
22
+ }
23
+ /**
24
+ * A form-associated base class for the {@link @microsoft/fast-foundation#(Select:class)} component.
25
+ *
26
+ * @internal
27
+ */
28
+ class FormAssociatedSelect extends formAssociated.FormAssociated(_Select) {
29
+ constructor() {
30
+ super(...arguments);
31
+ this.proxy = document.createElement("select");
32
+ }
33
+ }
34
+
35
+ /**
36
+ * A Select Custom HTML Element.
37
+ * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#select | ARIA select }.
38
+ *
39
+ * @slot start - Content which can be provided before the button content
40
+ * @slot end - Content which can be provided after the button content
41
+ * @slot button-container - The element representing the select button
42
+ * @slot selected-value - The selected value
43
+ * @slot indicator - The visual indicator for the expand/collapse state of the button
44
+ * @slot - The default slot for slotted options
45
+ * @csspart control - The element representing the select invoking element
46
+ * @csspart selected-value - The element wrapping the selected value
47
+ * @csspart indicator - The element wrapping the visual indicator
48
+ * @csspart listbox - The listbox element
49
+ * @fires input - Fires a custom 'input' event when the value updates
50
+ * @fires change - Fires a custom 'change' event when the value updates
51
+ *
52
+ * @public
53
+ */
54
+ let Select$1 = class Select extends FormAssociatedSelect {
55
+ constructor() {
56
+ super(...arguments);
57
+ /**
58
+ * The open attribute.
59
+ *
60
+ * @public
61
+ * @remarks
62
+ * HTML Attribute: open
63
+ */
64
+ this.open = false;
65
+ /**
66
+ * Indicates the initial state of the position attribute.
67
+ *
68
+ * @internal
69
+ */
70
+ this.forcedPosition = false;
71
+ /**
72
+ * The unique id for the internal listbox element.
73
+ *
74
+ * @internal
75
+ */
76
+ this.listboxId = strings.uniqueId("listbox-");
77
+ /**
78
+ * The max height for the listbox when opened.
79
+ *
80
+ * @internal
81
+ */
82
+ this.maxHeight = 0;
83
+ }
84
+ /**
85
+ * Sets focus and synchronizes ARIA attributes when the open property changes.
86
+ *
87
+ * @param prev - the previous open value
88
+ * @param next - the current open value
89
+ *
90
+ * @internal
91
+ */
92
+ openChanged(prev, next) {
93
+ if (!this.collapsible) {
94
+ return;
95
+ }
96
+ if (this.open) {
97
+ this.ariaControls = this.listboxId;
98
+ this.ariaExpanded = "true";
99
+ this.setPositioning();
100
+ this.focusAndScrollOptionIntoView();
101
+ this.indexWhenOpened = this.selectedIndex;
102
+ // focus is directed to the element when `open` is changed programmatically
103
+ index.DOM.queueUpdate(() => this.focus());
104
+ return;
105
+ }
106
+ this.ariaControls = "";
107
+ this.ariaExpanded = "false";
108
+ }
109
+ /**
110
+ * The component is collapsible when in single-selection mode with no size attribute.
111
+ *
112
+ * @internal
113
+ */
114
+ get collapsible() {
115
+ return !(this.multiple || typeof this.size === "number");
116
+ }
117
+ /**
118
+ * The value property.
119
+ *
120
+ * @public
121
+ */
122
+ get value() {
123
+ index.Observable.track(this, "value");
124
+ return this._value;
125
+ }
126
+ set value(next) {
127
+ var _a, _b, _c, _d, _e, _f, _g;
128
+ const prev = `${this._value}`;
129
+ if ((_a = this._options) === null || _a === void 0 ? void 0 : _a.length) {
130
+ const selectedIndex = this._options.findIndex(el => el.value === next);
131
+ const prevSelectedValue = (_c = (_b = this._options[this.selectedIndex]) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : null;
132
+ const nextSelectedValue = (_e = (_d = this._options[selectedIndex]) === null || _d === void 0 ? void 0 : _d.value) !== null && _e !== void 0 ? _e : null;
133
+ if (selectedIndex === -1 || prevSelectedValue !== nextSelectedValue) {
134
+ next = "";
135
+ this.selectedIndex = selectedIndex;
136
+ }
137
+ next = (_g = (_f = this.firstSelectedOption) === null || _f === void 0 ? void 0 : _f.value) !== null && _g !== void 0 ? _g : next;
138
+ }
139
+ if (prev !== next) {
140
+ this._value = next;
141
+ super.valueChanged(prev, next);
142
+ index.Observable.notify(this, "value");
143
+ this.updateDisplayValue();
144
+ }
145
+ }
146
+ /**
147
+ * Sets the value and display value to match the first selected option.
148
+ *
149
+ * @param shouldEmit - if true, the input and change events will be emitted
150
+ *
151
+ * @internal
152
+ */
153
+ updateValue(shouldEmit) {
154
+ var _a, _b;
155
+ if (this.$fastController.isConnected) {
156
+ this.value = (_b = (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : "";
157
+ }
158
+ if (shouldEmit) {
159
+ this.$emit("input");
160
+ this.$emit("change", this, {
161
+ bubbles: true,
162
+ composed: undefined,
163
+ });
164
+ }
165
+ }
166
+ /**
167
+ * Updates the proxy value when the selected index changes.
168
+ *
169
+ * @param prev - the previous selected index
170
+ * @param next - the next selected index
171
+ *
172
+ * @internal
173
+ */
174
+ selectedIndexChanged(prev, next) {
175
+ super.selectedIndexChanged(prev, next);
176
+ this.updateValue();
177
+ }
178
+ positionChanged(prev, next) {
179
+ this.positionAttribute = next;
180
+ this.setPositioning();
181
+ }
182
+ /**
183
+ * Calculate and apply listbox positioning based on available viewport space.
184
+ *
185
+ * @public
186
+ */
187
+ setPositioning() {
188
+ const currentBox = this.getBoundingClientRect();
189
+ const viewportHeight = window.innerHeight;
190
+ const availableBottom = viewportHeight - currentBox.bottom;
191
+ this.position = this.forcedPosition
192
+ ? this.positionAttribute
193
+ : currentBox.top > availableBottom
194
+ ? select_options.SelectPosition.above
195
+ : select_options.SelectPosition.below;
196
+ this.positionAttribute = this.forcedPosition
197
+ ? this.positionAttribute
198
+ : this.position;
199
+ this.maxHeight =
200
+ this.position === select_options.SelectPosition.above ? ~~currentBox.top : ~~availableBottom;
201
+ }
202
+ /**
203
+ * The value displayed on the button.
204
+ *
205
+ * @public
206
+ */
207
+ get displayValue() {
208
+ var _a, _b;
209
+ index.Observable.track(this, "displayValue");
210
+ return (_b = (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.text) !== null && _b !== void 0 ? _b : "";
211
+ }
212
+ /**
213
+ * Synchronize the `aria-disabled` property when the `disabled` property changes.
214
+ *
215
+ * @param prev - The previous disabled value
216
+ * @param next - The next disabled value
217
+ *
218
+ * @internal
219
+ */
220
+ disabledChanged(prev, next) {
221
+ if (super.disabledChanged) {
222
+ super.disabledChanged(prev, next);
223
+ }
224
+ this.ariaDisabled = this.disabled ? "true" : "false";
225
+ }
226
+ /**
227
+ * Reset the element to its first selectable option when its parent form is reset.
228
+ *
229
+ * @internal
230
+ */
231
+ formResetCallback() {
232
+ this.setProxyOptions();
233
+ // Call the base class's implementation setDefaultSelectedOption instead of the select's
234
+ // override, in order to reset the selectedIndex without using the value property.
235
+ super.setDefaultSelectedOption();
236
+ if (this.selectedIndex === -1) {
237
+ this.selectedIndex = 0;
238
+ }
239
+ }
240
+ /**
241
+ * Handle opening and closing the listbox when the select is clicked.
242
+ *
243
+ * @param e - the mouse event
244
+ * @internal
245
+ */
246
+ clickHandler(e) {
247
+ // do nothing if the select is disabled
248
+ if (this.disabled) {
249
+ return;
250
+ }
251
+ if (this.open) {
252
+ const captured = e.target.closest(`option,[role=option]`);
253
+ if (captured && captured.disabled) {
254
+ return;
255
+ }
256
+ }
257
+ super.clickHandler(e);
258
+ this.open = this.collapsible && !this.open;
259
+ if (!this.open && this.indexWhenOpened !== this.selectedIndex) {
260
+ this.updateValue(true);
261
+ }
262
+ return true;
263
+ }
264
+ /**
265
+ * Handles focus state when the element or its children lose focus.
266
+ *
267
+ * @param e - The focus event
268
+ * @internal
269
+ */
270
+ focusoutHandler(e) {
271
+ var _a;
272
+ super.focusoutHandler(e);
273
+ if (!this.open) {
274
+ return true;
275
+ }
276
+ const focusTarget = e.relatedTarget;
277
+ if (this.isSameNode(focusTarget)) {
278
+ this.focus();
279
+ return;
280
+ }
281
+ if (!((_a = this.options) === null || _a === void 0 ? void 0 : _a.includes(focusTarget))) {
282
+ this.open = false;
283
+ if (this.indexWhenOpened !== this.selectedIndex) {
284
+ this.updateValue(true);
285
+ }
286
+ }
287
+ }
288
+ /**
289
+ * Updates the value when an option's value changes.
290
+ *
291
+ * @param source - the source object
292
+ * @param propertyName - the property to evaluate
293
+ *
294
+ * @internal
295
+ * @override
296
+ */
297
+ handleChange(source, propertyName) {
298
+ super.handleChange(source, propertyName);
299
+ if (propertyName === "value") {
300
+ this.updateValue();
301
+ }
302
+ }
303
+ /**
304
+ * Synchronize the form-associated proxy and updates the value property of the element.
305
+ *
306
+ * @param prev - the previous collection of slotted option elements
307
+ * @param next - the next collection of slotted option elements
308
+ *
309
+ * @internal
310
+ */
311
+ slottedOptionsChanged(prev, next) {
312
+ this.options.forEach(o => {
313
+ const notifier = index.Observable.getNotifier(o);
314
+ notifier.unsubscribe(this, "value");
315
+ });
316
+ super.slottedOptionsChanged(prev, next);
317
+ this.options.forEach(o => {
318
+ const notifier = index.Observable.getNotifier(o);
319
+ notifier.subscribe(this, "value");
320
+ });
321
+ this.setProxyOptions();
322
+ this.updateValue();
323
+ }
324
+ /**
325
+ * Prevents focus when size is set and a scrollbar is clicked.
326
+ *
327
+ * @param e - the mouse event object
328
+ *
329
+ * @override
330
+ * @internal
331
+ */
332
+ mousedownHandler(e) {
333
+ var _a;
334
+ if (e.offsetX >= 0 && e.offsetX <= ((_a = this.listbox) === null || _a === void 0 ? void 0 : _a.scrollWidth)) {
335
+ return super.mousedownHandler(e);
336
+ }
337
+ return this.collapsible;
338
+ }
339
+ /**
340
+ * Sets the multiple property on the proxy element.
341
+ *
342
+ * @param prev - the previous multiple value
343
+ * @param next - the current multiple value
344
+ */
345
+ multipleChanged(prev, next) {
346
+ super.multipleChanged(prev, next);
347
+ if (this.proxy) {
348
+ this.proxy.multiple = next;
349
+ }
350
+ }
351
+ /**
352
+ * Updates the selectedness of each option when the list of selected options changes.
353
+ *
354
+ * @param prev - the previous list of selected options
355
+ * @param next - the current list of selected options
356
+ *
357
+ * @override
358
+ * @internal
359
+ */
360
+ selectedOptionsChanged(prev, next) {
361
+ var _a;
362
+ super.selectedOptionsChanged(prev, next);
363
+ (_a = this.options) === null || _a === void 0 ? void 0 : _a.forEach((o, i) => {
364
+ var _a;
365
+ const proxyOption = (_a = this.proxy) === null || _a === void 0 ? void 0 : _a.options.item(i);
366
+ if (proxyOption) {
367
+ proxyOption.selected = o.selected;
368
+ }
369
+ });
370
+ }
371
+ /**
372
+ * Sets the selected index to match the first option with the selected attribute, or
373
+ * the first selectable option.
374
+ *
375
+ * @override
376
+ * @internal
377
+ */
378
+ setDefaultSelectedOption() {
379
+ var _a;
380
+ const options = (_a = this.options) !== null && _a !== void 0 ? _a : Array.from(this.children).filter(listbox.Listbox$1.slottedOptionFilter);
381
+ const selectedIndex = options === null || options === void 0 ? void 0 : options.findIndex(el => el.hasAttribute("selected") || el.selected || el.value === this.value);
382
+ if (selectedIndex !== -1) {
383
+ this.selectedIndex = selectedIndex;
384
+ return;
385
+ }
386
+ this.selectedIndex = 0;
387
+ }
388
+ /**
389
+ * Resets and fills the proxy to match the component's options.
390
+ *
391
+ * @internal
392
+ */
393
+ setProxyOptions() {
394
+ if (this.proxy instanceof HTMLSelectElement && this.options) {
395
+ this.proxy.options.length = 0;
396
+ this.options.forEach(option => {
397
+ const proxyOption = option.proxy ||
398
+ (option instanceof HTMLOptionElement ? option.cloneNode() : null);
399
+ if (proxyOption) {
400
+ this.proxy.options.add(proxyOption);
401
+ }
402
+ });
403
+ }
404
+ }
405
+ /**
406
+ * Handle keyboard interaction for the select.
407
+ *
408
+ * @param e - the keyboard event
409
+ * @internal
410
+ */
411
+ keydownHandler(e) {
412
+ super.keydownHandler(e);
413
+ const key = e.key || e.key.charCodeAt(0);
414
+ switch (key) {
415
+ case keyCodes.keySpace: {
416
+ e.preventDefault();
417
+ if (this.collapsible && this.typeAheadExpired) {
418
+ this.open = !this.open;
419
+ }
420
+ break;
421
+ }
422
+ case keyCodes.keyHome:
423
+ case keyCodes.keyEnd: {
424
+ e.preventDefault();
425
+ break;
426
+ }
427
+ case keyCodes.keyEnter: {
428
+ e.preventDefault();
429
+ this.open = !this.open;
430
+ break;
431
+ }
432
+ case keyCodes.keyEscape: {
433
+ if (this.collapsible && this.open) {
434
+ e.preventDefault();
435
+ this.open = false;
436
+ }
437
+ break;
438
+ }
439
+ case keyCodes.keyTab: {
440
+ if (this.collapsible && this.open) {
441
+ e.preventDefault();
442
+ this.open = false;
443
+ }
444
+ return true;
445
+ }
446
+ }
447
+ if (!this.open && this.indexWhenOpened !== this.selectedIndex) {
448
+ this.updateValue(true);
449
+ this.indexWhenOpened = this.selectedIndex;
450
+ }
451
+ return !(key === keyCodes.keyArrowDown || key === keyCodes.keyArrowUp);
452
+ }
453
+ connectedCallback() {
454
+ super.connectedCallback();
455
+ this.forcedPosition = !!this.positionAttribute;
456
+ this.addEventListener("contentchange", this.updateDisplayValue);
457
+ }
458
+ disconnectedCallback() {
459
+ this.removeEventListener("contentchange", this.updateDisplayValue);
460
+ super.disconnectedCallback();
461
+ }
462
+ /**
463
+ * Updates the proxy's size property when the size attribute changes.
464
+ *
465
+ * @param prev - the previous size
466
+ * @param next - the current size
467
+ *
468
+ * @override
469
+ * @internal
470
+ */
471
+ sizeChanged(prev, next) {
472
+ super.sizeChanged(prev, next);
473
+ if (this.proxy) {
474
+ this.proxy.size = next;
475
+ }
476
+ }
477
+ /**
478
+ *
479
+ * @internal
480
+ */
481
+ updateDisplayValue() {
482
+ if (this.collapsible) {
483
+ index.Observable.notify(this, "displayValue");
484
+ }
485
+ }
486
+ };
487
+ index.__decorate([
488
+ index.attr({ attribute: "open", mode: "boolean" })
489
+ ], Select$1.prototype, "open", void 0);
490
+ index.__decorate([
491
+ index.volatile
492
+ ], Select$1.prototype, "collapsible", null);
493
+ index.__decorate([
494
+ index.observable
495
+ ], Select$1.prototype, "control", void 0);
496
+ index.__decorate([
497
+ index.attr({ attribute: "position" })
498
+ ], Select$1.prototype, "positionAttribute", void 0);
499
+ index.__decorate([
500
+ index.observable
501
+ ], Select$1.prototype, "position", void 0);
502
+ index.__decorate([
503
+ index.observable
504
+ ], Select$1.prototype, "maxHeight", void 0);
505
+ /**
506
+ * Includes ARIA states and properties relating to the ARIA select role.
507
+ *
508
+ * @public
509
+ */
510
+ class DelegatesARIASelect {
511
+ }
512
+ index.__decorate([
513
+ index.observable
514
+ ], DelegatesARIASelect.prototype, "ariaControls", void 0);
515
+ applyMixins.applyMixins(DelegatesARIASelect, listbox.DelegatesARIAListbox);
516
+ applyMixins.applyMixins(Select$1, startEnd.StartEnd, DelegatesARIASelect);
517
+
518
+ const styles = "@supports selector(:focus-visible){: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{display:flex;align-items:center;justify-content:space-between;border-radius:var(--_select-control-border-radius);background-color:var(--_appearance-color-fill);block-size:calc(1px*(40 + 4*clamp(-1,var(--vvd-size-density, 0),2)));box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);color:var(--_appearance-color-text);font:var(--vvd-typography-base);gap:8px;padding-inline:16px;transition:box-shadow .2s,background-color .2s}.control{--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--_connotation-color-intermediate)}.control.appearance-ghost{--_appearance-color-text: var(--_connotation-color-primary);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.control:where(.hover,: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(--_connotation-color-fierce)}.control:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)).appearance-ghost{--_appearance-color-text: var(--_connotation-color-primary);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.control:where(.disabled,: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:where(.disabled,:disabled).appearance-ghost{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.control:where(.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:where(.readonly):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: var(--vvd-color-neutral-600);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.control:where(.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:where(.error):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-alert-50);--_appearance-color-outline: transparent}.control:where(.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:where(.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-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-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}:host(:focus-visible) .control{box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px))}.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:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px));border-radius:8px}.icon{display:flex;flex-shrink:0}.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}.selected-value slot[name=icon]{flex:0 0 20px;font-size:20px;line-height:1}.control.has-meta .selected-value{padding-inline-end:8px}::part(popup-base){inline-size:max-content;min-inline-size:var(--_select-fixed-width, 100%)}:host([multiple]) ::part(popup-base){position:static}\n";
12
519
 
13
520
  var __defProp = Object.defineProperty;
14
521
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -21,127 +528,188 @@ var __decorateClass = (decorators, target, key, kind) => {
21
528
  __defProp(target, key, result);
22
529
  return result;
23
530
  };
24
- class SelectableBox extends index.FoundationElement {
531
+ let Select = class extends Select$1 {
25
532
  constructor() {
26
533
  super(...arguments);
27
- this.ariaLabel = null;
28
- this.checked = false;
29
- this.clickable = false;
30
- this.clickableBox = false;
31
- this.tight = false;
534
+ this.fixedDropdown = false;
535
+ this.placeholderOption = null;
32
536
  }
33
- /**
34
- * @internal
35
- */
36
- _handleCheckedChange() {
37
- if (this.controlType === "radio" && this.checked)
38
- return;
39
- this.checked = !this.checked;
40
- if (this.clickableBox || this.clickable)
41
- this.$emit("change");
537
+ connectedCallback() {
538
+ super.connectedCallback();
42
539
  }
43
- /**
44
- * @internal
45
- */
46
- _handleKeydown(event) {
47
- if ((event.code === "Space" || event.code === "Enter") && (this.clickableBox || this.clickable))
48
- return this._handleCheckedChange();
49
- return true;
540
+ get displayValue() {
541
+ index.Observable.track(this, "displayValue");
542
+ return this.firstSelectedOption?.getAttribute("label") ?? this.firstSelectedOption?.text ?? this.placeholder ?? "";
50
543
  }
51
- }
544
+ setDefaultSelectedOption() {
545
+ const options = Array.from(this.children).filter(
546
+ listbox.Listbox.slottedOptionFilter
547
+ );
548
+ const selectedIndex = options.findIndex(
549
+ (el) => el.hasAttribute("selected") || el.selected || el.value === this.value
550
+ );
551
+ if (selectedIndex === -1 && !this.placeholderOption) {
552
+ this.selectedIndex = 0;
553
+ return;
554
+ }
555
+ if (selectedIndex !== -1 || this.placeholder !== "") {
556
+ this.selectedIndex = selectedIndex;
557
+ return;
558
+ }
559
+ }
560
+ };
52
561
  __decorateClass([
53
- index.attr({ attribute: "aria-label" })
54
- ], SelectableBox.prototype, "ariaLabel", 2);
562
+ index.observable
563
+ ], Select.prototype, "_anchor", 2);
55
564
  __decorateClass([
56
- index.attr({ mode: "boolean" })
57
- ], SelectableBox.prototype, "checked", 2);
565
+ index.attr
566
+ ], Select.prototype, "appearance", 2);
58
567
  __decorateClass([
59
- index.attr({ mode: "boolean" })
60
- ], SelectableBox.prototype, "clickable", 2);
568
+ index.attr
569
+ ], Select.prototype, "shape", 2);
61
570
  __decorateClass([
62
- index.attr({ attribute: "clickable-box", mode: "boolean" })
63
- ], SelectableBox.prototype, "clickableBox", 2);
571
+ index.attr({ mode: "boolean", attribute: "fixed-dropdown" })
572
+ ], Select.prototype, "fixedDropdown", 2);
64
573
  __decorateClass([
65
574
  index.attr
66
- ], SelectableBox.prototype, "connotation", 2);
575
+ ], Select.prototype, "placeholder", 2);
67
576
  __decorateClass([
68
- index.attr({ attribute: "control-type" })
69
- ], SelectableBox.prototype, "controlType", 2);
577
+ index.observable
578
+ ], Select.prototype, "placeholderOption", 2);
70
579
  __decorateClass([
71
- index.attr({ mode: "boolean" })
72
- ], SelectableBox.prototype, "tight", 2);
580
+ index.observable
581
+ ], Select.prototype, "metaSlottedContent", 2);
582
+ Select = __decorateClass([
583
+ index$1.errorText,
584
+ index$1.formElements
585
+ ], Select);
586
+ applyMixins.applyMixins(
587
+ Select,
588
+ affix.AffixIconWithTrailing,
589
+ index$1.FormElementHelperText,
590
+ index$1.FormElementSuccessText
591
+ );
73
592
 
74
- const getClasses = ({ connotation, tight, checked, clickableBox, clickable }) => classNames.classNames(
75
- "base",
76
- [`connotation-${connotation}`, Boolean(connotation)],
77
- ["tight", tight],
78
- ["selected", checked],
79
- ["clickable", clickableBox || clickable],
80
- ["readonly", !clickableBox && !clickable]
593
+ const getStateClasses = ({
594
+ shape,
595
+ disabled,
596
+ appearance,
597
+ metaSlottedContent,
598
+ errorValidationMessage,
599
+ successText
600
+ }) => classNames.classNames(
601
+ ["disabled", disabled],
602
+ [`appearance-${appearance}`, Boolean(appearance)],
603
+ [`shape-${shape}`, Boolean(shape)],
604
+ ["has-meta", Boolean(metaSlottedContent?.length)],
605
+ ["error", Boolean(errorValidationMessage)],
606
+ ["success", !!successText],
607
+ ["has-meta", Boolean(metaSlottedContent?.length)]
81
608
  );
82
- function handleControlChange(x) {
83
- if (!x.clickableBox)
84
- x._handleCheckedChange();
609
+ function renderLabel() {
610
+ return index.html` <label for="control" class="label" id="label">
611
+ ${(x) => x.label}
612
+ </label>`;
613
+ }
614
+ function renderPlaceholder(context) {
615
+ const optionTag = context.tagFor(definition$1.ListboxOption);
616
+ return index.html`
617
+ <${optionTag} ${ref.ref("placeholderOption")}
618
+ text="${(x) => x.placeholder}" hidden disabled>
619
+ </${optionTag}>`;
85
620
  }
86
- function checkbox(context) {
87
- const checkboxTag = context.tagFor(definition.Checkbox);
88
- return index.html`${when.when((x) => x.controlType !== "radio", index.html`
89
- <${checkboxTag}
90
- aria-label="${(x) => !x.clickableBox && !x.clickable && x.ariaLabel ? x.ariaLabel : null}"
91
- @change="${(x) => handleControlChange(x)}"
92
- class="control checkbox"
93
- connotation="${(x) => x.connotation === "cta" ? enums.Connotation.CTA : enums.Connotation.Accent}"
94
- :checked="${(x) => x.checked}"
95
- inert="${(x) => x.clickableBox || x.clickable ? true : null}"
96
- ></${checkboxTag}>`)}
97
- `;
621
+ function selectValue(context) {
622
+ const affixIconTemplate = affix.affixIconTemplateFactory(context);
623
+ return index.html` <div
624
+ class="control ${getStateClasses}"
625
+ ${ref.ref("_anchor")}
626
+ id="control"
627
+ ?disabled="${(x) => x.disabled}"
628
+ >
629
+ <div class="selected-value">
630
+ ${(x) => affixIconTemplate(x.icon, affix.IconWrapper.Slot)}
631
+ <span class="text">${(x) => x.displayValue}</span>
632
+ <slot name="meta" ${slotted.slotted("metaSlottedContent")}></slot>
633
+ </div>
634
+ ${() => affixIconTemplate("chevron-down-line")}
635
+ </div>`;
98
636
  }
99
- function radio(context) {
100
- const radioTag = context.tagFor(radio$1.Radio);
101
- return index.html`${when.when((x) => x.controlType === "radio", index.html`
102
- <${radioTag}
103
- aria-label="${(x) => !x.clickableBox && !x.clickable && x.ariaLabel ? x.ariaLabel : null}"
104
- @change="${(x) => handleControlChange(x)}"
105
- class="control radio"
106
- connotation="${(x) => x.connotation === "cta" ? enums.Connotation.CTA : enums.Connotation.Accent}"
107
- :checked="${(x) => x.checked}"
108
- inert="${(x) => x.clickableBox || x.clickable ? true : null}"
109
- ></${radioTag}>`)}
110
- `;
637
+ function setFixedDropdownVarWidth(x) {
638
+ return x.open && x.fixedDropdown ? `--_select-fixed-width: ${Math.round(x.getBoundingClientRect().width)}px` : null;
111
639
  }
112
- const SelectableBoxTemplate = (context) => {
113
- return index.html`<template role="presentation">
114
- <div
115
- class="${getClasses}"
116
- tabindex="${(x) => x.clickableBox || x.clickable ? "0" : null}"
117
- role="${(x) => x.clickableBox || x.clickable ? "button" : null}"
118
- aria-pressed="${(x) => (x.clickableBox || x.clickable) && x.checked ? x.checked : null}"
119
- aria-label="${(x) => x.clickableBox || x.clickable ? x.ariaLabel : null}"
120
- @keydown="${(x, c) => x._handleKeydown(c.event)}"
121
- @click="${(x) => x.clickableBox || x.clickable ? x._handleCheckedChange() : null}"
640
+ function renderControl(context) {
641
+ const popupTag = context.tagFor(definition.Popup);
642
+ return index.html`
643
+ ${when.when((x) => x.label, renderLabel())}
644
+ <div class="control-wrapper">
645
+ ${when.when((x) => !x.multiple, selectValue(context))}
646
+ <${popupTag} class="popup"
647
+ style="${setFixedDropdownVarWidth}"
648
+ ?open="${(x) => x.collapsible ? x.open : true}"
649
+ :anchor="${(x) => x._anchor}"
650
+ placement="bottom-start"
651
+ strategy="${(x) => x.fixedDropdown ? null : "absolute"}">
652
+ <div class="listbox"
653
+ id="${(x) => x.listboxId}"
654
+ role="listbox"
655
+ ?disabled="${(x) => x.disabled}"
656
+ ?hidden="${(x) => x.collapsible ? !x.open : false}"
657
+ ${ref.ref("listbox")}>
658
+ ${when.when((x) => x.placeholder, renderPlaceholder(context))}
659
+ <slot
660
+ ${slotted.slotted({
661
+ filter: listbox.Listbox.slottedOptionFilter,
662
+ flatten: true,
663
+ property: "slottedOptions"
664
+ })}>
665
+ </slot>
666
+ </div>
667
+ </${popupTag}>
668
+ </div>
669
+ ${when.when((x) => x.helperText?.length, index$1.getFeedbackTemplate("helper", context))}
670
+ ${when.when(
671
+ (x) => !x.successText && x.errorValidationMessage,
672
+ index$1.getFeedbackTemplate("error", context)
673
+ )}
674
+ ${when.when((x) => x.successText, index$1.getFeedbackTemplate("success", context))}
675
+ `;
676
+ }
677
+ const SelectTemplate = (context) => {
678
+ return index.html` <template
679
+ class="base"
680
+ aria-label="${(x) => x.ariaLabel}"
681
+ aria-activedescendant="${(x) => x.ariaActiveDescendant}"
682
+ aria-controls="${(x) => x.ariaControls}"
683
+ aria-disabled="${(x) => x.ariaDisabled}"
684
+ aria-expanded="${(x) => x.ariaExpanded}"
685
+ aria-haspopup="${(x) => x.collapsible ? "listbox" : null}"
686
+ aria-multiselectable="${(x) => x.ariaMultiSelectable}"
687
+ ?open="${(x) => x.open}"
688
+ role="combobox"
689
+ tabindex="${(x) => !x.disabled ? "0" : null}"
690
+ @click="${(x, c) => x.clickHandler(c.event)}"
691
+ @focusin="${(x, c) => x.focusinHandler(c.event)}"
692
+ @focusout="${(x, c) => x.focusoutHandler(c.event)}"
693
+ @keydown="${(x, c) => x.keydownHandler(c.event)}"
694
+ @mousedown="${(x, c) => x.mousedownHandler(c.event)}"
122
695
  >
123
- ${checkbox(context)}
124
- ${radio(context)}
125
- <slot></slot>
126
- </div>
127
- </template>`;
696
+ ${renderControl(context)}
697
+ </template>`;
128
698
  };
129
699
 
130
- const selectableBoxDefinition = SelectableBox.compose({
131
- baseName: "selectable-box",
132
- template: SelectableBoxTemplate,
133
- styles,
134
- shadowOptions: {
135
- delegatesFocus: true
136
- }
700
+ const selectDefinition = Select.compose({
701
+ baseName: "select",
702
+ template: SelectTemplate,
703
+ styles
137
704
  });
138
- const selectableBoxRegistries = [
139
- selectableBoxDefinition(),
140
- ...definition.checkboxRegistries,
141
- ...definition$1.radioRegistries
705
+ const selectRegistries = [
706
+ selectDefinition(),
707
+ ...definition.popupRegistries,
708
+ ...definition$2.iconRegistries,
709
+ ...definition$1.listboxOptionRegistries
142
710
  ];
143
- const registerSelectableBox = index.registerFactory(selectableBoxRegistries);
711
+ const registerSelect = index.registerFactory(selectRegistries);
144
712
 
145
- exports.registerSelectableBox = registerSelectableBox;
146
- exports.selectableBoxDefinition = selectableBoxDefinition;
147
- exports.selectableBoxRegistries = selectableBoxRegistries;
713
+ exports.registerSelect = registerSelect;
714
+ exports.selectDefinition = selectDefinition;
715
+ exports.selectRegistries = selectRegistries;