@vonage/vivid 3.39.0 → 3.41.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 (182) hide show
  1. package/accordion/index.js +2 -2
  2. package/accordion-item/index.js +2 -2
  3. package/alert/index.js +7 -5
  4. package/audio-player/index.js +33 -0
  5. package/avatar/index.js +2 -2
  6. package/badge/index.js +2 -2
  7. package/banner/index.js +9 -5
  8. package/breadcrumb/index.js +1 -1
  9. package/breadcrumb-item/index.js +3 -3
  10. package/button/index.js +5 -4
  11. package/calendar/index.js +1 -1
  12. package/calendar-event/index.js +1 -1
  13. package/card/index.js +4 -3
  14. package/checkbox/index.js +3 -3
  15. package/combobox/index.js +9 -7
  16. package/custom-elements.json +809 -5
  17. package/data-grid/index.js +3 -2
  18. package/date-picker/index.js +11 -9
  19. package/date-range-picker/index.js +11 -9
  20. package/dialog/index.js +10 -6
  21. package/divider/index.js +1 -1
  22. package/elevation/index.js +1 -1
  23. package/empty-state/index.js +2 -2
  24. package/fab/index.js +3 -3
  25. package/file-picker/index.js +6 -5
  26. package/focus/index.js +1 -1
  27. package/header/index.js +2 -2
  28. package/icon/index.js +1 -1
  29. package/index.js +60 -55
  30. package/layout/index.js +1 -1
  31. package/lib/alert/alert.d.ts +3 -1
  32. package/lib/alert/locale.d.ts +3 -0
  33. package/lib/audio-player/audio-player.d.ts +17 -0
  34. package/lib/audio-player/audio-player.template.d.ts +4 -0
  35. package/lib/audio-player/definition.d.ts +4 -0
  36. package/lib/audio-player/locale.d.ts +5 -0
  37. package/lib/banner/banner.d.ts +3 -1
  38. package/lib/banner/locale.d.ts +3 -0
  39. package/lib/card/card.d.ts +3 -0
  40. package/lib/card/card.template.d.ts +1 -1
  41. package/lib/card/definition.d.ts +1 -0
  42. package/lib/checkbox/checkbox.d.ts +2 -0
  43. package/lib/components.d.ts +2 -0
  44. package/lib/dialog/dialog.d.ts +4 -0
  45. package/lib/dialog/locale.d.ts +3 -0
  46. package/lib/enums.d.ts +2 -1
  47. package/lib/menu/menu.d.ts +1 -0
  48. package/lib/number-field/locale.d.ts +4 -0
  49. package/lib/number-field/number-field.d.ts +4 -2
  50. package/lib/progress/progress.d.ts +1 -0
  51. package/lib/progress-ring/progress-ring.d.ts +1 -0
  52. package/lib/radio/radio.d.ts +1 -0
  53. package/lib/selectable-box/definition.d.ts +3 -0
  54. package/lib/selectable-box/selectable-box.d.ts +12 -0
  55. package/lib/selectable-box/selectable-box.template.d.ts +4 -0
  56. package/lib/slider/definition.d.ts +1 -0
  57. package/lib/slider/slider.d.ts +5 -0
  58. package/lib/split-button/locale.d.ts +3 -0
  59. package/lib/split-button/split-button.d.ts +3 -1
  60. package/lib/text-area/text-area.d.ts +3 -0
  61. package/lib/text-field/text-field.d.ts +5 -2
  62. package/listbox/index.js +5 -4
  63. package/locales/en-GB.js +21 -0
  64. package/locales/en-US.js +21 -0
  65. package/locales/ja-JP.js +21 -0
  66. package/locales/zh-CN.js +21 -0
  67. package/menu/index.js +9 -8
  68. package/menu-item/index.js +3 -3
  69. package/nav/index.js +1 -1
  70. package/nav-disclosure/index.js +3 -3
  71. package/nav-item/index.js +3 -3
  72. package/note/index.js +2 -2
  73. package/number-field/index.js +8 -6
  74. package/option/index.js +3 -3
  75. package/package.json +1 -1
  76. package/pagination/index.js +6 -5
  77. package/popup/index.js +7 -6
  78. package/progress/index.js +1 -1
  79. package/progress-ring/index.js +1 -1
  80. package/radio/index.js +2 -2
  81. package/radio-group/index.js +2 -2
  82. package/select/index.js +10 -8
  83. package/selectable-box/index.js +23 -0
  84. package/shared/Reflector.js +65 -0
  85. package/shared/date-picker/calendar/segment.d.ts +21 -0
  86. package/shared/date-picker/date-picker-base.d.ts +1 -0
  87. package/shared/definition.js +3 -3
  88. package/shared/definition10.js +89 -227
  89. package/shared/definition11.js +151 -29
  90. package/shared/definition12.js +37 -766
  91. package/shared/definition13.js +747 -106
  92. package/shared/definition14.js +122 -192
  93. package/shared/definition15.js +156 -664
  94. package/shared/definition16.js +576 -1123
  95. package/shared/definition17.js +1278 -143
  96. package/shared/definition18.js +64 -298
  97. package/shared/definition19.js +358 -211
  98. package/shared/definition2.js +2 -2
  99. package/shared/definition20.js +259 -67
  100. package/shared/definition21.js +66 -58
  101. package/shared/definition22.js +43 -84
  102. package/shared/definition23.js +76 -2352
  103. package/shared/definition24.js +2362 -45
  104. package/shared/definition25.js +63 -27
  105. package/shared/definition26.js +24 -51
  106. package/shared/definition27.js +36 -813
  107. package/shared/definition28.js +837 -49
  108. package/shared/definition29.js +52 -89
  109. package/shared/definition3.js +1 -1
  110. package/shared/definition30.js +88 -24
  111. package/shared/definition31.js +25 -12
  112. package/shared/definition32.js +12 -52
  113. package/shared/definition33.js +28 -487
  114. package/shared/definition34.js +442 -197
  115. package/shared/definition35.js +260 -185
  116. package/shared/definition36.js +188 -69
  117. package/shared/definition37.js +72 -52
  118. package/shared/definition38.js +65 -421
  119. package/shared/definition39.js +435 -35
  120. package/shared/definition4.js +44 -16
  121. package/shared/definition40.js +32 -680
  122. package/shared/definition41.js +661 -77
  123. package/shared/definition42.js +103 -555
  124. package/shared/definition43.js +76 -103
  125. package/shared/definition44.js +522 -87
  126. package/shared/definition45.js +133 -22
  127. package/shared/definition46.js +131 -58
  128. package/shared/definition47.js +16 -501
  129. package/shared/definition48.js +69 -23
  130. package/shared/definition49.js +477 -108
  131. package/shared/definition5.js +160 -44
  132. package/shared/definition50.js +25 -271
  133. package/shared/definition51.js +103 -122
  134. package/shared/definition52.js +277 -122
  135. package/shared/definition53.js +274 -103
  136. package/shared/definition54.js +126 -71
  137. package/shared/definition55.js +128 -294
  138. package/shared/definition56.js +91 -13
  139. package/shared/definition57.js +298 -39
  140. package/shared/definition58.js +11 -175
  141. package/shared/definition59.js +47 -0
  142. package/shared/definition6.js +43 -33
  143. package/shared/definition60.js +181 -0
  144. package/shared/definition7.js +39 -105
  145. package/shared/definition8.js +122 -38
  146. package/shared/definition9.js +56 -89
  147. package/shared/enums.js +72 -0
  148. package/shared/icon.js +2 -2
  149. package/shared/index2.js +28 -1
  150. package/shared/key-codes.js +1 -1
  151. package/shared/key-codes2.js +9 -0
  152. package/shared/listbox.js +3 -8
  153. package/shared/localization/Locale.d.ts +12 -0
  154. package/shared/patterns/form-elements/form-elements.d.ts +6 -6
  155. package/shared/presentationDate.js +196 -143
  156. package/shared/radio.js +7 -0
  157. package/shared/text-field.js +1 -1
  158. package/shared/utils/Reflector.d.ts +8 -0
  159. package/shared/utils/randomId.d.ts +1 -0
  160. package/side-drawer/index.js +1 -1
  161. package/slider/index.js +3 -3
  162. package/split-button/index.js +6 -3
  163. package/style.css +889 -722
  164. package/styles/core/all.css +1 -1
  165. package/styles/core/theme.css +1 -1
  166. package/styles/core/typography.css +1 -1
  167. package/styles/tokens/theme-dark.css +4 -4
  168. package/styles/tokens/theme-light.css +4 -4
  169. package/styles/tokens/vivid-2-compat.css +1 -1
  170. package/switch/index.js +3 -3
  171. package/tab/index.js +3 -3
  172. package/tab-panel/index.js +1 -1
  173. package/tabs/index.js +5 -5
  174. package/tag/index.js +3 -3
  175. package/tag-group/index.js +1 -1
  176. package/text-area/index.js +4 -3
  177. package/text-field/index.js +4 -3
  178. package/toggletip/index.js +8 -7
  179. package/tooltip/index.js +8 -7
  180. package/tree-item/index.js +3 -3
  181. package/tree-view/index.js +1 -1
  182. package/vivid.api.json +392 -0
@@ -1,209 +1,317 @@
1
- import { F as FoundationElement, O as Observable, _ as __decorate, o as observable, a as attr, h as html, r as registerFactory } from './index.js';
2
- import { a as iconRegistries } from './definition25.js';
3
- import { f as focusRegistries } from './definition56.js';
4
- import { b as AffixIconWithTrailing, a as affixIconTemplateFactory, I as IconWrapper } from './affix.js';
5
- import { A as ARIAGlobalStatesAndProperties } from './aria-global.js';
1
+ import { F as FoundationElement, D as DOM, _ as __decorate, a as attr, n as nullableNumberConverter, o as observable, h as html, r as registerFactory } from './index.js';
2
+ import { B as Button, a as buttonRegistries } from './definition11.js';
3
+ import { D as Divider, a as dividerRegistries } from './definition21.js';
4
+ import { A as AffixIcon } from './affix.js';
5
+ import { e as errorText, f as formElements, F as FormElementSuccessText, a as FormElementHelperText, b as FormElementCharCount, g as getFeedbackTemplate } from './index2.js';
6
+ import { L as Localized } from './localized.js';
6
7
  import { S as StartEnd } from './start-end.js';
7
8
  import { a as applyMixins } from './apply-mixins.js';
8
- import { i as isHTMLElement } from './dom.js';
9
+ import { D as DelegatesARIATextbox } from './text-field2.js';
10
+ import { F as FormAssociated } from './form-associated.js';
11
+ import { f as keyArrowDown, e as keyArrowUp } from './key-codes.js';
12
+ import { S as Shape } from './enums.js';
9
13
  import { f as focusTemplateFactory } from './focus2.js';
10
- import './index2.js';
11
14
  import { w as when } from './when.js';
15
+ import { r as ref } from './ref.js';
12
16
  import { c as classNames } from './class-names.js';
13
17
 
18
+ class _NumberField extends FoundationElement {
19
+ }
14
20
  /**
15
- * Determines if the element is a {@link (ListboxOption:class)}
21
+ * A form-associated base class for the {@link @microsoft/fast-foundation#(NumberField:class)} component.
16
22
  *
17
- * @param element - the element to test.
18
- * @public
23
+ * @internal
19
24
  */
20
- function isListboxOption(el) {
21
- return (isHTMLElement(el) &&
22
- (el.getAttribute("role") === "option" ||
23
- el instanceof HTMLOptionElement));
25
+ class FormAssociatedNumberField extends FormAssociated(_NumberField) {
26
+ constructor() {
27
+ super(...arguments);
28
+ this.proxy = document.createElement("input");
29
+ }
24
30
  }
31
+
25
32
  /**
26
- * An Option Custom HTML Element.
27
- * Implements {@link https://www.w3.org/TR/wai-aria-1.1/#option | ARIA option }.
33
+ * A Number Field Custom HTML Element.
34
+ * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number | <input type="number" /> element }.
28
35
  *
29
- * @slot start - Content which can be provided before the listbox option content
30
- * @slot end - Content which can be provided after the listbox option content
31
- * @slot - The default slot for listbox option content
32
- * @csspart content - Wraps the listbox option content
36
+ * @slot start - Content which can be provided before the number field input
37
+ * @slot end - Content which can be provided after the number field input
38
+ * @slot - The default slot for the label
39
+ * @slot step-up-glyph - The glyph for the step up control
40
+ * @slot step-down-glyph - The glyph for the step down control
41
+ * @csspart label - The label
42
+ * @csspart root - The element wrapping the control, including start and end slots
43
+ * @csspart control - The element representing the input
44
+ * @csspart controls - The step up and step down controls
45
+ * @csspart step-up - The step up control
46
+ * @csspart step-down - The step down control
47
+ * @fires input - Fires a custom 'input' event when the value has changed
48
+ * @fires change - Fires a custom 'change' event when the value has changed
33
49
  *
34
50
  * @public
35
51
  */
36
- let ListboxOption$1 = class ListboxOption extends FoundationElement {
37
- constructor(text, value, defaultSelected, selected) {
38
- super();
52
+ let NumberField$1 = class NumberField extends FormAssociatedNumberField {
53
+ constructor() {
54
+ super(...arguments);
39
55
  /**
40
- * The defaultSelected state of the option.
56
+ * When true, spin buttons will not be rendered
41
57
  * @public
58
+ * @remarks
59
+ * HTML Attribute: autofocus
42
60
  */
43
- this.defaultSelected = false;
44
- /**
45
- * Tracks whether the "selected" property has been changed.
46
- * @internal
47
- */
48
- this.dirtySelected = false;
61
+ this.hideStep = false;
49
62
  /**
50
- * The checked state of the control.
51
- *
63
+ * Amount to increment or decrement the value by
52
64
  * @public
65
+ * @remarks
66
+ * HTMLAttribute: step
53
67
  */
54
- this.selected = this.defaultSelected;
68
+ this.step = 1;
55
69
  /**
56
- * Track whether the value has been changed from the initial value
70
+ * Flag to indicate that the value change is from the user input
71
+ * @internal
57
72
  */
58
- this.dirtyValue = false;
59
- if (text) {
60
- this.textContent = text;
61
- }
62
- if (value) {
63
- this.initialValue = value;
64
- }
65
- if (defaultSelected) {
66
- this.defaultSelected = defaultSelected;
67
- }
68
- if (selected) {
69
- this.selected = selected;
73
+ this.isUserInput = false;
74
+ }
75
+ /**
76
+ * Ensures that the max is greater than the min and that the value
77
+ * is less than the max
78
+ * @param previous - the previous max value
79
+ * @param next - updated max value
80
+ *
81
+ * @internal
82
+ */
83
+ maxChanged(previous, next) {
84
+ var _a;
85
+ this.max = Math.max(next, (_a = this.min) !== null && _a !== void 0 ? _a : next);
86
+ const min = Math.min(this.min, this.max);
87
+ if (this.min !== undefined && this.min !== min) {
88
+ this.min = min;
70
89
  }
71
- this.proxy = new Option(`${this.textContent}`, this.initialValue, this.defaultSelected, this.selected);
72
- this.proxy.disabled = this.disabled;
90
+ this.value = this.getValidValue(this.value);
73
91
  }
74
92
  /**
75
- * Updates the ariaChecked property when the checked property changes.
93
+ * Ensures that the min is less than the max and that the value
94
+ * is greater than the min
95
+ * @param previous - previous min value
96
+ * @param next - updated min value
76
97
  *
77
- * @param prev - the previous checked value
78
- * @param next - the current checked value
98
+ * @internal
99
+ */
100
+ minChanged(previous, next) {
101
+ var _a;
102
+ this.min = Math.min(next, (_a = this.max) !== null && _a !== void 0 ? _a : next);
103
+ const max = Math.max(this.min, this.max);
104
+ if (this.max !== undefined && this.max !== max) {
105
+ this.max = max;
106
+ }
107
+ this.value = this.getValidValue(this.value);
108
+ }
109
+ /**
110
+ * The value property, typed as a number.
79
111
  *
80
112
  * @public
81
113
  */
82
- checkedChanged(prev, next) {
83
- if (typeof next === "boolean") {
84
- this.ariaChecked = next ? "true" : "false";
114
+ get valueAsNumber() {
115
+ return parseFloat(super.value);
116
+ }
117
+ set valueAsNumber(next) {
118
+ this.value = next.toString();
119
+ }
120
+ /**
121
+ * Validates that the value is a number between the min and max
122
+ * @param previous - previous stored value
123
+ * @param next - value being updated
124
+ * @param updateControl - should the text field be updated with value, defaults to true
125
+ * @internal
126
+ */
127
+ valueChanged(previous, next) {
128
+ this.value = this.getValidValue(next);
129
+ if (next !== this.value) {
85
130
  return;
86
131
  }
87
- this.ariaChecked = null;
132
+ if (this.control && !this.isUserInput) {
133
+ this.control.value = this.value;
134
+ }
135
+ super.valueChanged(previous, this.value);
136
+ if (previous !== undefined && !this.isUserInput) {
137
+ this.$emit("input");
138
+ this.$emit("change");
139
+ }
140
+ this.isUserInput = false;
141
+ }
142
+ /** {@inheritDoc (FormAssociated:interface).validate} */
143
+ validate() {
144
+ super.validate(this.control);
88
145
  }
89
146
  /**
90
- * Updates the proxy's text content when the default slot changes.
91
- * @param prev - the previous content value
92
- * @param next - the current content value
147
+ * Sets the internal value to a valid number between the min and max properties
148
+ * @param value - user input
93
149
  *
94
150
  * @internal
95
151
  */
96
- contentChanged(prev, next) {
97
- if (this.proxy instanceof HTMLOptionElement) {
98
- this.proxy.textContent = this.textContent;
152
+ getValidValue(value) {
153
+ var _a, _b;
154
+ let validValue = parseFloat(parseFloat(value).toPrecision(12));
155
+ if (isNaN(validValue)) {
156
+ validValue = "";
99
157
  }
100
- this.$emit("contentchange", null, { bubbles: true });
101
- }
102
- defaultSelectedChanged() {
103
- if (!this.dirtySelected) {
104
- this.selected = this.defaultSelected;
105
- if (this.proxy instanceof HTMLOptionElement) {
106
- this.proxy.selected = this.defaultSelected;
107
- }
158
+ else {
159
+ validValue = Math.min(validValue, (_a = this.max) !== null && _a !== void 0 ? _a : validValue);
160
+ validValue = Math.max(validValue, (_b = this.min) !== null && _b !== void 0 ? _b : validValue).toString();
108
161
  }
162
+ return validValue;
109
163
  }
110
- disabledChanged(prev, next) {
111
- this.ariaDisabled = this.disabled ? "true" : "false";
112
- if (this.proxy instanceof HTMLOptionElement) {
113
- this.proxy.disabled = this.disabled;
114
- }
164
+ /**
165
+ * Increments the value using the step value
166
+ *
167
+ * @public
168
+ */
169
+ stepUp() {
170
+ const value = parseFloat(this.value);
171
+ const stepUpValue = !isNaN(value)
172
+ ? value + this.step
173
+ : this.min > 0
174
+ ? this.min
175
+ : this.max < 0
176
+ ? this.max
177
+ : !this.min
178
+ ? this.step
179
+ : 0;
180
+ this.value = stepUpValue.toString();
115
181
  }
116
- selectedAttributeChanged() {
117
- this.defaultSelected = this.selectedAttribute;
118
- if (this.proxy instanceof HTMLOptionElement) {
119
- this.proxy.defaultSelected = this.defaultSelected;
120
- }
182
+ /**
183
+ * Decrements the value using the step value
184
+ *
185
+ * @public
186
+ */
187
+ stepDown() {
188
+ const value = parseFloat(this.value);
189
+ const stepDownValue = !isNaN(value)
190
+ ? value - this.step
191
+ : this.min > 0
192
+ ? this.min
193
+ : this.max < 0
194
+ ? this.max
195
+ : !this.min
196
+ ? 0 - this.step
197
+ : 0;
198
+ this.value = stepDownValue.toString();
121
199
  }
122
- selectedChanged() {
123
- this.ariaSelected = this.selected ? "true" : "false";
124
- if (!this.dirtySelected) {
125
- this.dirtySelected = true;
126
- }
127
- if (this.proxy instanceof HTMLOptionElement) {
128
- this.proxy.selected = this.selected;
200
+ /**
201
+ * Sets up the initial state of the number field
202
+ * @internal
203
+ */
204
+ connectedCallback() {
205
+ super.connectedCallback();
206
+ this.proxy.setAttribute("type", "number");
207
+ this.validate();
208
+ this.control.value = this.value;
209
+ if (this.autofocus) {
210
+ DOM.queueUpdate(() => {
211
+ this.focus();
212
+ });
129
213
  }
130
214
  }
131
- initialValueChanged(previous, next) {
132
- // If the value is clean and the component is connected to the DOM
133
- // then set value equal to the attribute value.
134
- if (!this.dirtyValue) {
135
- this.value = this.initialValue;
136
- this.dirtyValue = false;
137
- }
215
+ /**
216
+ * Selects all the text in the number field
217
+ *
218
+ * @public
219
+ */
220
+ select() {
221
+ this.control.select();
222
+ /**
223
+ * The select event does not permeate the shadow DOM boundary.
224
+ * This fn effectively proxies the select event,
225
+ * emitting a `select` event whenever the internal
226
+ * control emits a `select` event
227
+ */
228
+ this.$emit("select");
138
229
  }
139
- get label() {
140
- var _a;
141
- return (_a = this.value) !== null && _a !== void 0 ? _a : this.text;
230
+ /**
231
+ * Handles the internal control's `input` event
232
+ * @internal
233
+ */
234
+ handleTextInput() {
235
+ this.control.value = this.control.value.replace(/[^0-9\-+e.]/g, "");
236
+ this.isUserInput = true;
237
+ this.value = this.control.value;
142
238
  }
143
- get text() {
144
- var _a, _b;
145
- return (_b = (_a = this.textContent) === null || _a === void 0 ? void 0 : _a.replace(/\s+/g, " ").trim()) !== null && _b !== void 0 ? _b : "";
239
+ /**
240
+ * Change event handler for inner control.
241
+ * @remarks
242
+ * "Change" events are not `composable` so they will not
243
+ * permeate the shadow DOM boundary. This fn effectively proxies
244
+ * the change event, emitting a `change` event whenever the internal
245
+ * control emits a `change` event
246
+ * @internal
247
+ */
248
+ handleChange() {
249
+ this.$emit("change");
146
250
  }
147
- set value(next) {
148
- const newValue = `${next !== null && next !== void 0 ? next : ""}`;
149
- this._value = newValue;
150
- this.dirtyValue = true;
151
- if (this.proxy instanceof HTMLOptionElement) {
152
- this.proxy.value = newValue;
251
+ /**
252
+ * Handles the internal control's `keydown` event
253
+ * @internal
254
+ */
255
+ handleKeyDown(e) {
256
+ const key = e.key;
257
+ switch (key) {
258
+ case keyArrowUp:
259
+ this.stepUp();
260
+ return false;
261
+ case keyArrowDown:
262
+ this.stepDown();
263
+ return false;
153
264
  }
154
- Observable.notify(this, "value");
155
- }
156
- get value() {
157
- var _a;
158
- Observable.track(this, "value");
159
- return (_a = this._value) !== null && _a !== void 0 ? _a : this.text;
265
+ return true;
160
266
  }
161
- get form() {
162
- return this.proxy ? this.proxy.form : null;
267
+ /**
268
+ * Handles populating the input field with a validated value when
269
+ * leaving the input field.
270
+ * @internal
271
+ */
272
+ handleBlur() {
273
+ this.control.value = this.value;
163
274
  }
164
275
  };
165
276
  __decorate([
166
- observable
167
- ], ListboxOption$1.prototype, "checked", void 0);
277
+ attr({ attribute: "readonly", mode: "boolean" })
278
+ ], NumberField$1.prototype, "readOnly", void 0);
168
279
  __decorate([
169
- observable
170
- ], ListboxOption$1.prototype, "content", void 0);
280
+ attr({ mode: "boolean" })
281
+ ], NumberField$1.prototype, "autofocus", void 0);
171
282
  __decorate([
172
- observable
173
- ], ListboxOption$1.prototype, "defaultSelected", void 0);
283
+ attr({ attribute: "hide-step", mode: "boolean" })
284
+ ], NumberField$1.prototype, "hideStep", void 0);
174
285
  __decorate([
175
- attr({ mode: "boolean" })
176
- ], ListboxOption$1.prototype, "disabled", void 0);
286
+ attr
287
+ ], NumberField$1.prototype, "placeholder", void 0);
177
288
  __decorate([
178
- attr({ attribute: "selected", mode: "boolean" })
179
- ], ListboxOption$1.prototype, "selectedAttribute", void 0);
289
+ attr
290
+ ], NumberField$1.prototype, "list", void 0);
180
291
  __decorate([
181
- observable
182
- ], ListboxOption$1.prototype, "selected", void 0);
292
+ attr({ converter: nullableNumberConverter })
293
+ ], NumberField$1.prototype, "maxlength", void 0);
183
294
  __decorate([
184
- attr({ attribute: "value", mode: "fromView" })
185
- ], ListboxOption$1.prototype, "initialValue", void 0);
186
- /**
187
- * States and properties relating to the ARIA `option` role.
188
- *
189
- * @public
190
- */
191
- class DelegatesARIAListboxOption {
192
- }
295
+ attr({ converter: nullableNumberConverter })
296
+ ], NumberField$1.prototype, "minlength", void 0);
193
297
  __decorate([
194
- observable
195
- ], DelegatesARIAListboxOption.prototype, "ariaChecked", void 0);
298
+ attr({ converter: nullableNumberConverter })
299
+ ], NumberField$1.prototype, "size", void 0);
196
300
  __decorate([
197
- observable
198
- ], DelegatesARIAListboxOption.prototype, "ariaPosInSet", void 0);
301
+ attr({ converter: nullableNumberConverter })
302
+ ], NumberField$1.prototype, "step", void 0);
199
303
  __decorate([
200
- observable
201
- ], DelegatesARIAListboxOption.prototype, "ariaSelected", void 0);
304
+ attr({ converter: nullableNumberConverter })
305
+ ], NumberField$1.prototype, "max", void 0);
306
+ __decorate([
307
+ attr({ converter: nullableNumberConverter })
308
+ ], NumberField$1.prototype, "min", void 0);
202
309
  __decorate([
203
310
  observable
204
- ], DelegatesARIAListboxOption.prototype, "ariaSetSize", void 0);
205
- applyMixins(DelegatesARIAListboxOption, ARIAGlobalStatesAndProperties);
206
- applyMixins(ListboxOption$1, StartEnd, DelegatesARIAListboxOption);
311
+ ], NumberField$1.prototype, "defaultSlottedNodes", void 0);
312
+ applyMixins(NumberField$1, StartEnd, DelegatesARIATextbox);
313
+
314
+ const styles = "/**\n * Do not edit directly\n * Generated on Wed, 22 Nov 2023 16:09:43 GMT\n */\n:host {\n display: inline-block;\n}\n\n.base {\n --_text-field-gutter: calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2))) / 2.5);\n --_text-field-icon-size: calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2))) / 2);\n display: inline-grid;\n width: 100%;\n gap: 4px;\n grid-template-columns: min-content 1fr max-content;\n}\n.base {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--_connotation-color-backdrop);\n --_appearance-color-outline: var(--_connotation-color-intermediate);\n}\n.base.appearance-ghost {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base:where(:hover, .hover):where(:not(:disabled, .disabled, .readonly)) {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--_connotation-color-backdrop);\n --_appearance-color-outline: var(--_connotation-color-firm);\n}\n.base:where(:hover, .hover):where(:not(:disabled, .disabled, .readonly)).appearance-ghost {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-faint);\n --_appearance-color-outline: transparent;\n}\n.base:where(:disabled, .disabled) {\n --_appearance-color-text: var(--vvd-color-neutral-300);\n --_appearance-color-fill: var(--vvd-color-neutral-100);\n --_appearance-color-outline: var(--vvd-color-neutral-300);\n}\n.base:where(:disabled, .disabled).appearance-ghost {\n --_appearance-color-text: var(--vvd-color-neutral-300);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base:where(.readonly):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--vvd-color-neutral-200);\n --_appearance-color-outline: var(--vvd-color-neutral-400);\n}\n.base:where(.readonly):where(:not(:disabled, .disabled)).appearance-ghost {\n --_appearance-color-text: var(--vvd-color-neutral-600);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base.connotation-success {\n /* @cssprop [--vvd-text-field-success-primary=var(--vvd-color-success-500)] */\n --_connotation-color-primary: var(--vvd-text-field-success-primary, var(--vvd-color-success-500));\n /* @cssprop [--vvd-text-field-success-backdrop=var(--vvd-color-success-50)] */\n --_connotation-color-backdrop: var(--vvd-text-field-success-backdrop, var(--vvd-color-success-50));\n /* @cssprop [--vvd-text-field-success-intermediate=var(--vvd-color-success-500)] */\n --_connotation-color-intermediate: var(--vvd-text-field-success-intermediate, var(--vvd-color-success-500));\n /* @cssprop [--vvd-text-field-success-firm=var(--vvd-color-success-600)] */\n --_connotation-color-firm: var(--vvd-text-field-success-firm, var(--vvd-color-success-600));\n /* @cssprop [--vvd-text-field-success-faint=var(--vvd-color-success-50)] */\n --_connotation-color-faint: var(--vvd-text-field-success-faint, var(--vvd-color-success-50));\n /* @cssprop [--vvd-text-field-success-soft=var(--vvd-color-success-100)] */\n --_connotation-color-soft: var(--vvd-text-field-success-soft, var(--vvd-color-success-100));\n}\n.base.connotation-alert {\n /* @cssprop [--vvd-text-field-alert-primary=var(--vvd-color-alert-500)] */\n --_connotation-color-primary: var(--vvd-text-field-alert-primary, var(--vvd-color-alert-500));\n /* @cssprop [--vvd-text-field-alert-backdrop=var(--vvd-color-alert-50)] */\n --_connotation-color-backdrop: var(--vvd-text-field-alert-backdrop, var(--vvd-color-alert-50));\n /* @cssprop [--vvd-text-field-alert-intermediate=var(--vvd-color-alert-500)] */\n --_connotation-color-intermediate: var(--vvd-text-field-alert-intermediate, var(--vvd-color-alert-500));\n /* @cssprop [--vvd-text-field-alert-firm=var(--vvd-color-alert-600)] */\n --_connotation-color-firm: var(--vvd-text-field-alert-firm, var(--vvd-color-alert-600));\n /* @cssprop [--vvd-text-field-alert-faint=var(--vvd-color-alert-50)] */\n --_connotation-color-faint: var(--vvd-text-field-alert-faint, var(--vvd-color-alert-50));\n /* @cssprop [--vvd-text-field-alert-soft=var(--vvd-color-alert-100)] */\n --_connotation-color-soft: var(--vvd-text-field-alert-soft, var(--vvd-color-alert-100));\n}\n.base:not(.connotation-success, .connotation-alert) {\n /* @cssprop [--vvd-text-field-accent-primary=var(--vvd-color-canvas-text)] */\n --_connotation-color-primary: var(--vvd-text-field-accent-primary, var(--vvd-color-canvas-text));\n /* @cssprop [--vvd-text-field-accent-backdrop=var(--vvd-color-canvas)] */\n --_connotation-color-backdrop: var(--vvd-text-field-accent-backdrop, var(--vvd-color-canvas));\n /* @cssprop [--vvd-text-field-accent-intermediate=var(--vvd-color-neutral-500)] */\n --_connotation-color-intermediate: var(--vvd-text-field-accent-intermediate, var(--vvd-color-neutral-500));\n /* @cssprop [--vvd-text-field-accent-firm=var(--vvd-color-canvas-text)] */\n --_connotation-color-firm: var(--vvd-text-field-accent-firm, var(--vvd-color-canvas-text));\n /* @cssprop [--vvd-text-field-accent-faint=var(--vvd-color-neutral-50)] */\n --_connotation-color-faint: var(--vvd-text-field-accent-faint, var(--vvd-color-neutral-50));\n /* @cssprop [--vvd-text-field-accent-soft=var(--vvd-color-neutral-100)] */\n --_connotation-color-soft: var(--vvd-text-field-accent-soft, var(--vvd-color-neutral-100));\n}\n@supports (user-select: none) {\n .base {\n user-select: none;\n }\n}\n.base:not(.disabled) {\n --_low-ink-color: var(--vvd-color-neutral-600);\n}\n.base.disabled {\n --_low-ink-color: var(--_appearance-color-text);\n}\n\n.label:not(slot),\n.label::slotted(label) {\n color: var(--vvd-color-canvas-text);\n contain: inline-size;\n font: var(--vvd-typography-base);\n grid-column: 1/4;\n grid-row: 1;\n}\n.char-count + .label:not(slot),\n.char-count + .label::slotted(label) {\n grid-column: 1/3;\n}\n\n.char-count {\n color: var(--_low-ink-color);\n font: var(--vvd-typography-base);\n grid-column: 3/4;\n}\n\n.fieldset {\n position: relative;\n display: flex;\n align-items: center;\n background-color: var(--_appearance-color-fill);\n font: var(--vvd-typography-base);\n grid-column: 1/4;\n padding-block: 0;\n transition: color 0.2s, background-color 0.2s;\n /* Shape */\n}\n.fieldset::after {\n position: absolute;\n display: block;\n block-size: 100%;\n border-radius: inherit;\n box-shadow: inset 0 0 0 1px var(--_appearance-color-outline);\n content: \"\";\n inline-size: 100%;\n pointer-events: none;\n transition: box-shadow 0.2s;\n}\n.fieldset:focus-visible {\n outline: none;\n}\n.base > .fieldset {\n block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2)));\n}\n.base:not(.shape-pill) .fieldset {\n border-radius: 6px;\n}\n.base.shape-pill .fieldset {\n border-radius: 24px;\n}\n\n.wrapper {\n block-size: 100%;\n border-radius: inherit;\n inline-size: 100%;\n}\n.wrapper:focus-visible {\n outline: none;\n}\n\n.control:not(slot), .control::slotted(input) {\n width: 100%;\n box-sizing: border-box;\n border: 0 none;\n appearance: none; /* for box-shadow visibility on IOS */\n background-color: transparent;\n block-size: 100%;\n border-radius: inherit;\n color: inherit;\n font: inherit;\n padding-block: 0;\n padding-inline-end: var(--_text-field-gutter);\n padding-inline-start: var(--_text-field-gutter);\n}\n.control:not(slot):disabled, .control::slotted(input:disabled) {\n cursor: not-allowed;\n opacity: 1; /* 2. correct opacity on iOS */\n -webkit-text-fill-color: var(--_appearance-color-text); /* 1. sets text fill to current `color` for safari */\n}\n.control:not(slot)::placeholder {\n opacity: 1 !important; /* 2. correct opacity on iOS */\n -webkit-text-fill-color: var(--_low-ink-color) !important; /* 1. sets text fill to current `color` for safari */\n}\n.control:not(slot):focus-visible, .control::slotted(input:focus-visible) {\n outline: none;\n}\n.has-icon .control:not(slot), .has-icon .control::slotted(input) {\n padding-inline-start: calc(var(--_text-field-icon-size) + var(--_text-field-gutter) * 2);\n}\n\n.icon {\n position: absolute;\n z-index: 1;\n color: var(--_low-ink-color);\n font-size: var(--_text-field-icon-size);\n inset-block-start: 50%;\n inset-inline-start: calc(100% + var(--_text-field-gutter));\n line-height: 1;\n transform: translateY(-50%);\n}\n\n.leading-items-wrapper {\n position: relative;\n}\n.base.no-leading .leading-items-wrapper {\n display: none;\n}\n\n.action-items-wrapper {\n margin-inline-end: 4px;\n}\n.base:not(.action-items) .action-items-wrapper {\n display: none;\n}\n\n.focus-indicator {\n --focus-stroke-gap-color: transparent;\n pointer-events: none;\n}\n.wrapper:not(:focus-visible, :focus-within) > .focus-indicator, .fieldset:not(:focus-visible, :focus-within) > .focus-indicator {\n display: none;\n}\n\n.control {\n padding-inline-end: 70px !important;\n}\n.control::-webkit-outer-spin-button, .control::-webkit-inner-spin-button {\n appearance: none;\n}\n.control-buttons {\n position: absolute;\n z-index: 1;\n right: 3px;\n display: flex;\n}\n.readonly .control-buttons, .disabled .control-buttons {\n pointer-events: none;\n}\n.control-buttons .divider {\n margin-block: 8px;\n}\n.control-buttons > * {\n flex-shrink: 0;\n}\n\n.disabled .focus-indicator {\n display: none;\n pointer-events: none;\n}";
207
315
 
208
316
  var __defProp = Object.defineProperty;
209
317
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -216,74 +324,211 @@ var __decorateClass = (decorators, target, key, kind) => {
216
324
  __defProp(target, key, result);
217
325
  return result;
218
326
  };
219
- class ListboxOption extends ListboxOption$1 {
220
- // #region overrides base class accessor
221
- set text(value) {
222
- this._text = value;
327
+ const STEP_DIRECTION = {
328
+ up: 1,
329
+ down: -1
330
+ };
331
+ const PROXY_REFLECTED_ATTRIBUTES = {
332
+ max: true,
333
+ min: true
334
+ };
335
+ function makeStep(element, direction) {
336
+ const value = parseFloat(element.value);
337
+ const stepUpValue = !isNaN(value) ? value + direction * element.step : element.min > 0 ? element.min : element.max < 0 ? element.max : !element.min ? direction * element.step : 0;
338
+ element.value = Number(stepUpValue.toFixed(12)).toString();
339
+ }
340
+ let NumberField = class extends NumberField$1 {
341
+ constructor() {
342
+ super(...arguments);
343
+ this.incrementButtonAriaLabel = null;
344
+ this.decrementButtonAriaLabel = null;
223
345
  }
224
- get text() {
225
- return this._text ?? "";
346
+ stepChanged(_previous, next) {
347
+ this.proxy.setAttribute("step", Number.isFinite(next) ? next.toString() : "");
226
348
  }
227
- get label() {
228
- return this._label ?? this.text;
349
+ attributeChangedCallback(name, previous, next) {
350
+ super.attributeChangedCallback(name, previous, next);
351
+ if (PROXY_REFLECTED_ATTRIBUTES[name]) {
352
+ this.proxy.setAttribute(name, next);
353
+ }
229
354
  }
230
- set label(value) {
231
- this._label = value;
355
+ stepUp() {
356
+ makeStep(this, STEP_DIRECTION.up);
232
357
  }
233
- // #endregion overrides
234
- }
358
+ stepDown() {
359
+ makeStep(this, STEP_DIRECTION.down);
360
+ }
361
+ };
362
+ __decorateClass([
363
+ attr({ attribute: "increment-button-aria-label" })
364
+ ], NumberField.prototype, "incrementButtonAriaLabel", 2);
365
+ __decorateClass([
366
+ attr({ attribute: "decrement-button-aria-label" })
367
+ ], NumberField.prototype, "decrementButtonAriaLabel", 2);
235
368
  __decorateClass([
236
- attr({
237
- attribute: "text"
238
- })
239
- ], ListboxOption.prototype, "_text", 2);
369
+ attr
370
+ ], NumberField.prototype, "appearance", 2);
240
371
  __decorateClass([
241
- attr({
242
- attribute: "label"
243
- })
244
- ], ListboxOption.prototype, "_label", 2);
245
- applyMixins(ListboxOption, AffixIconWithTrailing);
372
+ attr
373
+ ], NumberField.prototype, "shape", 2);
374
+ __decorateClass([
375
+ attr
376
+ ], NumberField.prototype, "autoComplete", 2);
377
+ NumberField = __decorateClass([
378
+ errorText,
379
+ formElements
380
+ ], NumberField);
381
+ const numberInput = document.createElement("input");
382
+ numberInput.type = "number";
383
+ NumberField.prototype.getValidValue = function(value) {
384
+ if (!this.isUserInput) {
385
+ numberInput.value = value;
386
+ return numberInput.value;
387
+ }
388
+ if (value === "" || value === "-" || value === ".") {
389
+ return value;
390
+ }
391
+ const decimalSplit = value.split(".");
392
+ let valueSuffix = "";
393
+ if (decimalSplit.length === 2 && decimalSplit[1] === "") {
394
+ valueSuffix = ".";
395
+ numberInput.value = value.slice(0, -1);
396
+ } else {
397
+ numberInput.value = value;
398
+ }
399
+ if (numberInput.value === "") {
400
+ return this.currentValue;
401
+ }
402
+ return numberInput.value + valueSuffix;
403
+ };
404
+ applyMixins(NumberField, Localized, AffixIcon, FormElementCharCount, FormElementHelperText, FormElementSuccessText);
246
405
 
247
- const getClasses = ({
248
- icon,
406
+ const getStateClasses = ({
407
+ errorValidationMessage,
249
408
  disabled,
250
- selected,
251
- checked
409
+ value,
410
+ readOnly,
411
+ placeholder,
412
+ appearance,
413
+ shape,
414
+ label,
415
+ successText
252
416
  }) => classNames(
253
- "base",
417
+ ["error connotation-alert", Boolean(errorValidationMessage)],
254
418
  ["disabled", disabled],
255
- ["selected", Boolean(selected)],
256
- ["active", Boolean(checked)],
257
- ["icon", Boolean(icon)]
419
+ ["has-value", Boolean(value)],
420
+ ["readonly", readOnly],
421
+ ["placeholder", Boolean(placeholder)],
422
+ [`appearance-${appearance}`, Boolean(appearance)],
423
+ [`shape-${shape}`, Boolean(shape)],
424
+ ["no-label", !label],
425
+ ["success connotation-success", !!successText]
258
426
  );
259
- const ListboxOptionTemplate = (context) => {
260
- const affixIconTemplate = affixIconTemplateFactory(context);
261
- const focusTemplate = focusTemplateFactory(context);
427
+ function renderLabel() {
262
428
  return html`
263
- <template
264
- aria-checked="${(x) => x.ariaChecked}"
265
- aria-disabled="${(x) => x.ariaDisabled}"
266
- aria-posinset="${(x) => x.ariaPosInSet}"
267
- aria-selected="${(x) => x.ariaSelected}"
268
- aria-setsize="${(x) => x.ariaSetSize}"
269
- role="option">
270
- <div class="${getClasses}">
271
- ${() => focusTemplate}
272
- ${(x) => affixIconTemplate(x.icon, IconWrapper.Slot)}
273
- ${when((x) => x.text, html`<div class="text">${(x) => x.text}</div>`)}
274
- </div>
275
- </template>
429
+ <label for="control" class="label">
430
+ ${(x) => x.label}
431
+ </label>`;
432
+ }
433
+ function setControlButtonShape(numberField) {
434
+ return numberField.shape === Shape.Pill ? Shape.Pill : null;
435
+ }
436
+ function getTabIndex(numberField) {
437
+ return numberField.disabled || numberField.readOnly ? "-1" : null;
438
+ }
439
+ function numberControlButtons(context) {
440
+ const buttonTag = context.tagFor(Button);
441
+ const dividerTag = context.tagFor(Divider);
442
+ return html`
443
+ <div class="control-buttons"
444
+ ?inert="${(x) => x.disabled || x.readOnly}">
445
+ <${buttonTag} id="subtract" icon="minus-line"
446
+ aria-label=${(x) => x.decrementButtonAriaLabel || x.locale.numberField.decrementButtonLabel}
447
+ shape="${setControlButtonShape}"
448
+ type="button"
449
+ size="condensed"
450
+ tabindex="${getTabIndex}"
451
+ @click="${(x) => x.stepDown()}"></${buttonTag}>
452
+ <${dividerTag} class="divider" orientation="vertical"></${dividerTag}>
453
+ <${buttonTag} id="add" icon="plus-line"
454
+ aria-label=${(x) => x.incrementButtonAriaLabel || x.locale.numberField.incrementButtonLabel}
455
+ shape="${setControlButtonShape}"
456
+ type="button"
457
+ size="condensed"
458
+ tabindex="${getTabIndex}"
459
+ @click="${(x) => x.stepUp()}"></${buttonTag}>
460
+ </div>
276
461
  `;
462
+ }
463
+ const NumberFieldTemplate = (context) => {
464
+ const focusTemplate = focusTemplateFactory(context);
465
+ return html`
466
+ <div class="base ${getStateClasses}">
467
+ ${when((x) => x.label, renderLabel())}
468
+ <div class="fieldset">
469
+ <div class="wrapper">
470
+ <input class="control"
471
+ id="control"
472
+ @input="${(x) => x.handleTextInput()}"
473
+ @change="${(x) => x.handleChange()}"
474
+ ?autofocus="${(x) => x.autofocus}"
475
+ ?disabled="${(x) => x.disabled}"
476
+ list="${(x) => x.list}"
477
+ step="${(x) => x.step ? x.step : null}"
478
+ max="${(x) => x.max}"
479
+ min="${(x) => x.min}"
480
+ maxlength="${(x) => x.maxlength}"
481
+ minlength="${(x) => x.minlength}"
482
+ placeholder="${(x) => x.placeholder}"
483
+ ?readonly="${(x) => x.readOnly}"
484
+ ?required="${(x) => x.required}"
485
+ size="${(x) => x.size}"
486
+ autocomplete="${(x) => x.autoComplete}"
487
+ name="${(x) => x.name}"
488
+ ?spellcheck="${(x) => x.spellcheck}"
489
+ :value="${(x) => x.value}"
490
+ type="text"
491
+ aria-atomic="${(x) => x.ariaAtomic}"
492
+ aria-busy="${(x) => x.ariaBusy}"
493
+ aria-controls="${(x) => x.ariaControls}"
494
+ aria-current="${(x) => x.ariaCurrent}"
495
+ aria-describedby="${(x) => x.ariaDescribedby}"
496
+ aria-details="${(x) => x.ariaDetails}"
497
+ aria-disabled="${(x) => x.ariaDisabled}"
498
+ aria-errormessage="${(x) => x.ariaErrormessage}"
499
+ aria-flowto="${(x) => x.ariaFlowto}"
500
+ aria-haspopup="${(x) => x.ariaHaspopup}"
501
+ aria-hidden="${(x) => x.ariaHidden}"
502
+ aria-invalid="${(x) => x.ariaInvalid}"
503
+ aria-keyshortcuts="${(x) => x.ariaKeyshortcuts}"
504
+ aria-label="${(x) => x.ariaLabel}"
505
+ aria-labelledby="${(x) => x.ariaLabelledby}"
506
+ aria-live="${(x) => x.ariaLive}"
507
+ aria-owns="${(x) => x.ariaOwns}"
508
+ aria-relevant="${(x) => x.ariaRelevant}"
509
+ aria-roledescription="${(x) => x.ariaRoledescription}"
510
+ ${ref("control")}
511
+ />
512
+ ${() => focusTemplate}
513
+ </div>
514
+ ${() => numberControlButtons(context)}
515
+ </div>
516
+ ${when((x) => !x.successText && !x.errorValidationMessage && x.helperText?.length, getFeedbackTemplate("helper", context))}
517
+ ${when((x) => !x.successText && x.errorValidationMessage, getFeedbackTemplate("error", context))}
518
+ ${when((x) => x.successText, getFeedbackTemplate("success", context))}
519
+ </div>
520
+ `;
277
521
  };
278
522
 
279
- const styles = "/**\n * Do not edit directly\n * Generated on Tue, 17 Oct 2023 15:27:52 GMT\n */\n:host([disabled]) {\n cursor: not-allowed;\n}\n\n.base {\n position: relative; /* this is needed for the focus */\n display: flex;\n box-sizing: border-box;\n align-items: center;\n background-color: var(--_appearance-color-fill);\n border-radius: 6px;\n box-shadow: inset 0 0 0 1px var(--_appearance-color-outline);\n color: var(--_option-appearance-color-text, var(--_appearance-color-text));\n font: var(--vvd-typography-base);\n gap: 12px;\n hyphens: auto;\n inline-size: 100%;\n min-block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2)));\n padding-inline: 16px;\n vertical-align: middle;\n word-break: break-word;\n}\n.base {\n /* @cssprop [--vvd-option-accent-primary=var(--vvd-color-canvas-text)] */\n --_connotation-color-primary: var(--vvd-option-accent-primary, var(--vvd-color-canvas-text));\n /* @cssprop [--vvd-option-accent-primary-text=var(--vvd-color-canvas)] */\n --_connotation-color-primary-text: var(--vvd-option-accent-primary-text, var(--vvd-color-canvas));\n /* @cssprop [--vvd-option-accent-primary-increment=var(--vvd-color-neutral-800)] */\n --_connotation-color-primary-increment: var(--vvd-option-accent-primary-increment, var(--vvd-color-neutral-800));\n /* @cssprop [--vvd-option-accent-faint=var(--vvd-color-neutral-50)] */\n --_connotation-color-faint: var(--vvd-option-accent-faint, var(--vvd-color-neutral-50));\n /* @cssprop [--vvd-option-accent-soft=var(--vvd-color-neutral-100)] */\n --_connotation-color-soft: var(--vvd-option-accent-soft, var(--vvd-color-neutral-100));\n /* @cssprop [--vvd-option-accent-pale=var(--vvd-color-neutral-300)] */\n --_connotation-color-pale: var(--vvd-option-accent-pale, var(--vvd-color-neutral-300));\n /* @cssprop [--vvd-option-accent-dim=var(--vvd-color-neutral-200)] */\n --_connotation-color-dim: var(--vvd-option-accent-dim, var(--vvd-color-neutral-200));\n}\n.base {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base:where(:hover, .hover):where(:not(:disabled, .disabled, .readonly)) {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-faint);\n --_appearance-color-outline: transparent;\n}\n.base:where(:disabled, .disabled) {\n --_appearance-color-text: var(--vvd-color-neutral-300);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base:where(:active, .active):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-soft);\n --_appearance-color-outline: transparent;\n}\n.base:where(.selected, [aria-current]):where(:not(:disabled, .disabled, :hover, .hover)) {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-dim);\n --_appearance-color-outline: transparent;\n}\n.base:where(.selected, [aria-current]):where(:hover, .hover) {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-pale);\n --_appearance-color-outline: transparent;\n}\n@supports (user-select: none) {\n .base {\n user-select: none;\n }\n}\n.base:not(.disabled) {\n cursor: pointer;\n}\n.base.disabled {\n pointer-events: none;\n}\n.base .text {\n font: var(--vvd-typography-base);\n}\n\nslot[name=icon] {\n font-size: 20px;\n line-height: 1;\n}\n.base:not(.disabled, .selected) slot[name=icon] {\n color: var(--vvd-color-neutral-600);\n}\n\n.focus-indicator {\n --focus-stroke-color: var(--vvd-color-neutral-500);\n --focus-stroke-gap-color: transparent;\n}\n:host(:not([aria-checked=true])) .focus-indicator {\n display: none;\n}";
280
-
281
- const listboxOptionDefinition = ListboxOption.compose({
282
- baseName: "option",
283
- template: ListboxOptionTemplate,
284
- styles
523
+ const numberFieldDefinition = NumberField.compose({
524
+ baseName: "number-field",
525
+ template: NumberFieldTemplate,
526
+ styles,
527
+ shadowOptions: {
528
+ delegatesFocus: true
529
+ }
285
530
  });
286
- const listboxOptionRegistries = [listboxOptionDefinition(), ...iconRegistries, ...focusRegistries];
287
- const registerOption = registerFactory(listboxOptionRegistries);
531
+ const numberFieldRegistries = [numberFieldDefinition(), ...buttonRegistries, ...dividerRegistries];
532
+ const registerNumberField = registerFactory(numberFieldRegistries);
288
533
 
289
- export { ListboxOption as L, listboxOptionRegistries as a, isListboxOption as i, listboxOptionDefinition as l, registerOption as r };
534
+ export { numberFieldRegistries as a, numberFieldDefinition as n, registerNumberField as r };