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