@vonage/vivid 3.0.0-next.9 → 3.0.0-next.90

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 (190) hide show
  1. package/README.md +141 -4
  2. package/accordion/index.js +3 -12
  3. package/accordion-item/index.js +30 -38
  4. package/action-group/index.js +41 -0
  5. package/avatar/index.js +60 -0
  6. package/badge/index.js +16 -30
  7. package/banner/index.js +25 -111
  8. package/breadcrumb/index.js +21 -18
  9. package/breadcrumb-item/index.js +23 -20
  10. package/button/index.js +19 -757
  11. package/calendar/index.js +72 -67
  12. package/calendar-event/index.js +112 -0
  13. package/card/index.js +113 -0
  14. package/checkbox/index.js +176 -0
  15. package/dialog/index.js +229 -0
  16. package/divider/index.js +4 -0
  17. package/elevation/index.js +3 -31
  18. package/fab/index.js +99 -0
  19. package/focus/index.js +18 -3
  20. package/header/index.js +61 -0
  21. package/icon/index.js +10 -9
  22. package/index.js +57 -20
  23. package/layout/index.js +5 -15
  24. package/lib/accordion-item/accordion-item.d.ts +2 -2
  25. package/lib/accordion-item/index.d.ts +2 -1
  26. package/lib/action-group/action-group.d.ts +10 -0
  27. package/lib/{sidenav-item/sidenav-item.template.d.ts → action-group/action-group.template.d.ts} +2 -2
  28. package/lib/{sidenav-item → action-group}/index.d.ts +1 -2
  29. package/lib/avatar/avatar.d.ts +15 -0
  30. package/lib/avatar/avatar.template.d.ts +4 -0
  31. package/lib/avatar/index.d.ts +3 -0
  32. package/lib/badge/badge.d.ts +3 -5
  33. package/lib/badge/index.d.ts +1 -1
  34. package/lib/banner/banner.d.ts +1 -1
  35. package/lib/banner/banner.template.d.ts +0 -2
  36. package/lib/banner/index.d.ts +1 -0
  37. package/lib/breadcrumb/breadcrumb.template.d.ts +4 -0
  38. package/lib/breadcrumb-item/breadcrumb-item.d.ts +1 -1
  39. package/lib/breadcrumb-item/index.d.ts +1 -0
  40. package/lib/button/button.d.ts +6 -5
  41. package/lib/button/index.d.ts +2 -19
  42. package/lib/calendar/calendar.d.ts +3 -1
  43. package/lib/calendar/index.d.ts +0 -1
  44. package/lib/calendar-event/calendar-event.d.ts +14 -0
  45. package/lib/calendar-event/calendar-event.template.d.ts +4 -0
  46. package/lib/calendar-event/index.d.ts +2 -0
  47. package/lib/card/card.d.ts +10 -0
  48. package/lib/{text/text.template.d.ts → card/card.template.d.ts} +2 -2
  49. package/lib/card/index.d.ts +4 -0
  50. package/lib/checkbox/checkbox.d.ts +5 -0
  51. package/lib/checkbox/checkbox.template.d.ts +4 -0
  52. package/lib/checkbox/index.d.ts +4 -0
  53. package/lib/components.d.ts +29 -10
  54. package/lib/dialog/dialog.d.ts +20 -0
  55. package/lib/dialog/dialog.template.d.ts +4 -0
  56. package/lib/dialog/index.d.ts +5 -0
  57. package/lib/divider/divider.d.ts +3 -0
  58. package/lib/divider/divider.template.d.ts +4 -0
  59. package/lib/divider/index.d.ts +2 -0
  60. package/lib/elevation/elevation.d.ts +1 -0
  61. package/lib/elevation/index.d.ts +1 -1
  62. package/lib/enums.d.ts +11 -6
  63. package/lib/fab/fab.d.ts +13 -0
  64. package/lib/fab/fab.template.d.ts +4 -0
  65. package/lib/fab/index.d.ts +4 -0
  66. package/lib/focus/index.d.ts +1 -1
  67. package/lib/header/header.d.ts +5 -0
  68. package/lib/header/header.template.d.ts +4 -0
  69. package/lib/header/index.d.ts +3 -0
  70. package/lib/icon/icon.d.ts +4 -3
  71. package/lib/layout/index.d.ts +1 -1
  72. package/lib/layout/layout.d.ts +3 -3
  73. package/lib/listbox-option/index.d.ts +4 -0
  74. package/lib/listbox-option/listbox-option.d.ts +7 -0
  75. package/lib/listbox-option/listbox-option.template.d.ts +4 -0
  76. package/lib/menu/index.d.ts +12 -0
  77. package/lib/menu/menu.d.ts +10 -0
  78. package/lib/menu/menu.template.d.ts +3 -0
  79. package/lib/menu-item/index.d.ts +3 -0
  80. package/lib/menu-item/menu-item.d.ts +7 -0
  81. package/lib/menu-item/menu-item.template.d.ts +5 -0
  82. package/lib/nav/index.d.ts +2 -0
  83. package/lib/nav/nav.d.ts +3 -0
  84. package/lib/nav/nav.template.d.ts +4 -0
  85. package/lib/nav-disclosure/index.d.ts +4 -0
  86. package/lib/nav-disclosure/nav-disclosure.d.ts +10 -0
  87. package/lib/nav-disclosure/nav-disclosure.template.d.ts +4 -0
  88. package/lib/nav-item/index.d.ts +4 -0
  89. package/lib/{sidenav-item/sidenav-item.d.ts → nav-item/nav-item.d.ts} +2 -2
  90. package/lib/nav-item/nav-item.template.d.ts +4 -0
  91. package/lib/{text → note}/index.d.ts +1 -1
  92. package/lib/note/note.d.ts +10 -0
  93. package/lib/note/note.template.d.ts +5 -0
  94. package/lib/number-field/index.d.ts +4 -0
  95. package/lib/number-field/number-field.d.ts +14 -0
  96. package/lib/number-field/number-field.template.d.ts +4 -0
  97. package/lib/popup/index.d.ts +1 -1
  98. package/lib/popup/popup.d.ts +2 -1
  99. package/lib/progress/progress.d.ts +1 -1
  100. package/lib/progress-ring/progress-ring.d.ts +2 -1
  101. package/lib/radio/index.d.ts +3 -0
  102. package/lib/radio/radio.d.ts +4 -0
  103. package/lib/radio/radio.template.d.ts +4 -0
  104. package/lib/radio-group/index.d.ts +10 -0
  105. package/lib/radio-group/radio-group.d.ts +4 -0
  106. package/lib/radio-group/radio-group.template.d.ts +4 -0
  107. package/lib/side-drawer/index.d.ts +1 -1
  108. package/lib/side-drawer/side-drawer.d.ts +3 -2
  109. package/lib/text-anchor/text-anchor.d.ts +1 -1
  110. package/lib/text-area/index.d.ts +4 -0
  111. package/lib/text-area/text-area.d.ts +9 -0
  112. package/lib/text-area/text-area.template.d.ts +4 -0
  113. package/lib/text-field/index.d.ts +4 -0
  114. package/lib/text-field/text-field.d.ts +14 -0
  115. package/lib/text-field/text-field.template.d.ts +5 -0
  116. package/lib/tooltip/tooltip.d.ts +2 -2
  117. package/listbox-option/index.js +248 -0
  118. package/menu/index.js +376 -0
  119. package/menu-item/index.js +20 -0
  120. package/nav/index.js +17 -0
  121. package/nav-disclosure/index.js +81 -0
  122. package/nav-item/index.js +45 -0
  123. package/note/index.js +58 -0
  124. package/number-field/index.js +516 -0
  125. package/package.json +58 -10
  126. package/popup/index.js +22 -2061
  127. package/progress/index.js +35 -36
  128. package/progress-ring/index.js +11 -11
  129. package/radio/index.js +50 -0
  130. package/radio-group/index.js +435 -0
  131. package/shared/affix.js +1 -6
  132. package/shared/anchor.js +10 -2
  133. package/shared/apply-mixins.js +5 -4
  134. package/shared/aria-global.js +2 -86
  135. package/shared/aria.js +9 -0
  136. package/shared/base-progress.js +5 -0
  137. package/shared/breadcrumb-item.js +1 -1
  138. package/shared/button.js +200 -0
  139. package/shared/calendar-event.js +19 -0
  140. package/shared/dialog-polyfill.esm.js +858 -0
  141. package/shared/direction.js +20 -0
  142. package/shared/enums.js +62 -0
  143. package/shared/es.object.assign.js +3 -2
  144. package/shared/export.js +1017 -0
  145. package/shared/focus.js +5 -0
  146. package/shared/focus2.js +11 -0
  147. package/shared/form-associated.js +466 -0
  148. package/shared/form-elements.js +331 -0
  149. package/shared/icon.js +534 -531
  150. package/shared/index.js +108 -79
  151. package/shared/index2.js +100 -14
  152. package/shared/index3.js +31 -0
  153. package/shared/index4.js +77 -0
  154. package/shared/index5.js +1525 -0
  155. package/shared/index6.js +349 -0
  156. package/shared/iterators.js +61 -0
  157. package/shared/key-codes.js +96 -0
  158. package/shared/object-keys.js +13 -0
  159. package/shared/patterns/focus.d.ts +3 -0
  160. package/shared/patterns/form-elements/form-elements.d.ts +28 -0
  161. package/shared/patterns/form-elements/index.d.ts +1 -0
  162. package/shared/patterns/index.d.ts +2 -0
  163. package/shared/radio.js +127 -0
  164. package/shared/ref.js +41 -0
  165. package/shared/slotted.js +1 -1
  166. package/shared/start-end.js +50 -0
  167. package/shared/text-anchor.js +2 -13
  168. package/shared/text-anchor.template.js +6 -5
  169. package/shared/to-string.js +51 -0
  170. package/shared/web.dom-collections.iterator.js +74 -1081
  171. package/side-drawer/index.js +41 -33
  172. package/styles/core/all.css +75 -0
  173. package/styles/core/theme.css +11 -0
  174. package/styles/core/typography.css +69 -0
  175. package/styles/fonts/SpeziaCompleteVariableItalicWeb.woff2 +0 -0
  176. package/styles/fonts/SpeziaCompleteVariableUprightWeb.woff2 +0 -0
  177. package/styles/fonts/SpeziaMonoCompleteVariableWeb.woff2 +0 -0
  178. package/styles/fonts/spezia.css +9 -12
  179. package/styles/tokens/theme-dark.css +230 -0
  180. package/styles/tokens/theme-light.css +230 -0
  181. package/text-anchor/index.js +9 -1
  182. package/text-area/index.js +288 -0
  183. package/text-field/index.js +129 -0
  184. package/tooltip/index.js +23 -24
  185. package/lib/text/text.d.ts +0 -10
  186. package/shared/style-inject.es.js +0 -28
  187. package/sidenav-item/index.js +0 -38
  188. package/styles/themes/dark.css +0 -205
  189. package/styles/themes/light.css +0 -205
  190. package/text/index.js +0 -45
@@ -0,0 +1,516 @@
1
+ import { F as FoundationElement, D as DOM, _ as __decorate, a as attr, n as nullableNumberConverter, o as observable, b as __metadata, h as html, d as designSystem } from '../shared/index.js';
2
+ import { B as Button } from '../shared/index2.js';
3
+ import { D as Divider } from '../shared/index4.js';
4
+ import { b as AffixIcon } from '../shared/affix.js';
5
+ import '../shared/focus.js';
6
+ import { D as DelegatesARIATextbox, f as formElements, g as getFeedbackTemplate } from '../shared/form-elements.js';
7
+ import { S as StartEnd } from '../shared/start-end.js';
8
+ import { a as applyMixins } from '../shared/apply-mixins.js';
9
+ import { F as FormAssociated } from '../shared/form-associated.js';
10
+ import { e as keyArrowDown, d as keyArrowUp } from '../shared/key-codes.js';
11
+ import { j as anObject$2, x as functionCall, q as hasOwnProperty_1, b as objectIsPrototypeOf, D as functionName, v as defineBuiltIn$1, e as fails$1 } from '../shared/export.js';
12
+ import { t as toString } from '../shared/to-string.js';
13
+ import { S as Shape } from '../shared/enums.js';
14
+ import { f as focusTemplateFactory } from '../shared/focus2.js';
15
+ import { w as when } from '../shared/when.js';
16
+ import { r as ref } from '../shared/ref.js';
17
+ import { c as classNames } from '../shared/class-names.js';
18
+ import '../icon/index.js';
19
+ import '../shared/icon.js';
20
+ import '../shared/iterators.js';
21
+ import '../shared/_has.js';
22
+ import '../focus/index.js';
23
+ import '../shared/web.dom-collections.iterator.js';
24
+ import '../shared/object-keys.js';
25
+ import '../shared/button.js';
26
+ import '../shared/aria-global.js';
27
+ import '../shared/aria.js';
28
+
29
+ class _NumberField extends FoundationElement {
30
+ }
31
+ /**
32
+ * A form-associated base class for the {@link @microsoft/fast-foundation#(NumberField:class)} component.
33
+ *
34
+ * @internal
35
+ */
36
+ class FormAssociatedNumberField extends FormAssociated(_NumberField) {
37
+ constructor() {
38
+ super(...arguments);
39
+ this.proxy = document.createElement("input");
40
+ }
41
+ }
42
+
43
+ /**
44
+ * A Number Field Custom HTML Element.
45
+ * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number | <input type="number" /> element }.
46
+ *
47
+ * @slot start - Content which can be provided before the number field input
48
+ * @slot end - Content which can be provided after the number field input
49
+ * @slot - The default slot for the label
50
+ * @slot step-up-glyph - The glyph for the step up control
51
+ * @slot step-down-glyph - The glyph for the step down control
52
+ * @csspart label - The label
53
+ * @csspart root - The element wrapping the control, including start and end slots
54
+ * @csspart control - The element representing the input
55
+ * @csspart controls - The step up and step down controls
56
+ * @csspart step-up - The step up control
57
+ * @csspart step-down - The step down control
58
+ * @fires input - Fires a custom 'input' event when the value has changed
59
+ * @fires change - Fires a custom 'change' event when the value has changed
60
+ *
61
+ * @public
62
+ */
63
+ class NumberField$1 extends FormAssociatedNumberField {
64
+ constructor() {
65
+ super(...arguments);
66
+ /**
67
+ * When true, spin buttons will not be rendered
68
+ * @public
69
+ * @remarks
70
+ * HTML Attribute: autofocus
71
+ */
72
+ this.hideStep = false;
73
+ /**
74
+ * Amount to increment or decrement the value by
75
+ * @public
76
+ * @remarks
77
+ * HTMLAttribute: step
78
+ */
79
+ this.step = 1;
80
+ /**
81
+ * Flag to indicate that the value change is from the user input
82
+ * @internal
83
+ */
84
+ this.isUserInput = false;
85
+ }
86
+ /**
87
+ * Ensures that the max is greater than the min and that the value
88
+ * is less than the max
89
+ * @param previous - the previous max value
90
+ * @param next - updated max value
91
+ *
92
+ * @internal
93
+ */
94
+ maxChanged(previous, next) {
95
+ var _a;
96
+ this.max = Math.max(next, (_a = this.min) !== null && _a !== void 0 ? _a : next);
97
+ const min = Math.min(this.min, this.max);
98
+ if (this.min !== undefined && this.min !== min) {
99
+ this.min = min;
100
+ }
101
+ this.value = this.getValidValue(this.value);
102
+ }
103
+ /**
104
+ * Ensures that the min is less than the max and that the value
105
+ * is greater than the min
106
+ * @param previous - previous min value
107
+ * @param next - updated min value
108
+ *
109
+ * @internal
110
+ */
111
+ minChanged(previous, next) {
112
+ var _a;
113
+ this.min = Math.min(next, (_a = this.max) !== null && _a !== void 0 ? _a : next);
114
+ const max = Math.max(this.min, this.max);
115
+ if (this.max !== undefined && this.max !== max) {
116
+ this.max = max;
117
+ }
118
+ this.value = this.getValidValue(this.value);
119
+ }
120
+ /**
121
+ * The value property, typed as a number.
122
+ *
123
+ * @public
124
+ */
125
+ get valueAsNumber() {
126
+ return parseFloat(super.value);
127
+ }
128
+ set valueAsNumber(next) {
129
+ this.value = next.toString();
130
+ }
131
+ /**
132
+ * Validates that the value is a number between the min and max
133
+ * @param previous - previous stored value
134
+ * @param next - value being updated
135
+ * @param updateControl - should the text field be updated with value, defaults to true
136
+ * @internal
137
+ */
138
+ valueChanged(previous, next) {
139
+ this.value = this.getValidValue(next);
140
+ if (next !== this.value) {
141
+ return;
142
+ }
143
+ if (this.control && !this.isUserInput) {
144
+ this.control.value = this.value;
145
+ }
146
+ super.valueChanged(previous, this.value);
147
+ if (previous !== undefined && !this.isUserInput) {
148
+ this.$emit("input");
149
+ this.$emit("change");
150
+ }
151
+ this.isUserInput = false;
152
+ }
153
+ /** {@inheritDoc (FormAssociated:interface).validate} */
154
+ validate() {
155
+ super.validate(this.control);
156
+ }
157
+ /**
158
+ * Sets the internal value to a valid number between the min and max properties
159
+ * @param value - user input
160
+ *
161
+ * @internal
162
+ */
163
+ getValidValue(value) {
164
+ var _a, _b;
165
+ let validValue = parseFloat(parseFloat(value).toPrecision(12));
166
+ if (isNaN(validValue)) {
167
+ validValue = "";
168
+ }
169
+ else {
170
+ validValue = Math.min(validValue, (_a = this.max) !== null && _a !== void 0 ? _a : validValue);
171
+ validValue = Math.max(validValue, (_b = this.min) !== null && _b !== void 0 ? _b : validValue).toString();
172
+ }
173
+ return validValue;
174
+ }
175
+ /**
176
+ * Increments the value using the step value
177
+ *
178
+ * @public
179
+ */
180
+ stepUp() {
181
+ const value = parseFloat(this.value);
182
+ const stepUpValue = !isNaN(value)
183
+ ? value + this.step
184
+ : this.min > 0
185
+ ? this.min
186
+ : this.max < 0
187
+ ? this.max
188
+ : !this.min
189
+ ? this.step
190
+ : 0;
191
+ this.value = stepUpValue.toString();
192
+ }
193
+ /**
194
+ * Decrements the value using the step value
195
+ *
196
+ * @public
197
+ */
198
+ stepDown() {
199
+ const value = parseFloat(this.value);
200
+ const stepDownValue = !isNaN(value)
201
+ ? value - this.step
202
+ : this.min > 0
203
+ ? this.min
204
+ : this.max < 0
205
+ ? this.max
206
+ : !this.min
207
+ ? 0 - this.step
208
+ : 0;
209
+ this.value = stepDownValue.toString();
210
+ }
211
+ /**
212
+ * Sets up the initial state of the number field
213
+ * @internal
214
+ */
215
+ connectedCallback() {
216
+ super.connectedCallback();
217
+ this.proxy.setAttribute("type", "number");
218
+ this.validate();
219
+ this.control.value = this.value;
220
+ if (this.autofocus) {
221
+ DOM.queueUpdate(() => {
222
+ this.focus();
223
+ });
224
+ }
225
+ }
226
+ /**
227
+ * Selects all the text in the number field
228
+ *
229
+ * @public
230
+ */
231
+ select() {
232
+ this.control.select();
233
+ /**
234
+ * The select event does not permeate the shadow DOM boundary.
235
+ * This fn effectively proxies the select event,
236
+ * emitting a `select` event whenever the internal
237
+ * control emits a `select` event
238
+ */
239
+ this.$emit("select");
240
+ }
241
+ /**
242
+ * Handles the internal control's `input` event
243
+ * @internal
244
+ */
245
+ handleTextInput() {
246
+ this.control.value = this.control.value.replace(/[^0-9\-+e.]/g, "");
247
+ this.isUserInput = true;
248
+ this.value = this.control.value;
249
+ }
250
+ /**
251
+ * Change event handler for inner control.
252
+ * @remarks
253
+ * "Change" events are not `composable` so they will not
254
+ * permeate the shadow DOM boundary. This fn effectively proxies
255
+ * the change event, emitting a `change` event whenever the internal
256
+ * control emits a `change` event
257
+ * @internal
258
+ */
259
+ handleChange() {
260
+ this.$emit("change");
261
+ }
262
+ /**
263
+ * Handles the internal control's `keydown` event
264
+ * @internal
265
+ */
266
+ handleKeyDown(e) {
267
+ const key = e.key;
268
+ switch (key) {
269
+ case keyArrowUp:
270
+ this.stepUp();
271
+ return false;
272
+ case keyArrowDown:
273
+ this.stepDown();
274
+ return false;
275
+ }
276
+ return true;
277
+ }
278
+ /**
279
+ * Handles populating the input field with a validated value when
280
+ * leaving the input field.
281
+ * @internal
282
+ */
283
+ handleBlur() {
284
+ this.control.value = this.value;
285
+ }
286
+ }
287
+ __decorate([
288
+ attr({ attribute: "readonly", mode: "boolean" })
289
+ ], NumberField$1.prototype, "readOnly", void 0);
290
+ __decorate([
291
+ attr({ mode: "boolean" })
292
+ ], NumberField$1.prototype, "autofocus", void 0);
293
+ __decorate([
294
+ attr({ attribute: "hide-step", mode: "boolean" })
295
+ ], NumberField$1.prototype, "hideStep", void 0);
296
+ __decorate([
297
+ attr
298
+ ], NumberField$1.prototype, "placeholder", void 0);
299
+ __decorate([
300
+ attr
301
+ ], NumberField$1.prototype, "list", void 0);
302
+ __decorate([
303
+ attr({ converter: nullableNumberConverter })
304
+ ], NumberField$1.prototype, "maxlength", void 0);
305
+ __decorate([
306
+ attr({ converter: nullableNumberConverter })
307
+ ], NumberField$1.prototype, "minlength", void 0);
308
+ __decorate([
309
+ attr({ converter: nullableNumberConverter })
310
+ ], NumberField$1.prototype, "size", void 0);
311
+ __decorate([
312
+ attr({ converter: nullableNumberConverter })
313
+ ], NumberField$1.prototype, "step", void 0);
314
+ __decorate([
315
+ attr({ converter: nullableNumberConverter })
316
+ ], NumberField$1.prototype, "max", void 0);
317
+ __decorate([
318
+ attr({ converter: nullableNumberConverter })
319
+ ], NumberField$1.prototype, "min", void 0);
320
+ __decorate([
321
+ observable
322
+ ], NumberField$1.prototype, "defaultSlottedNodes", void 0);
323
+ applyMixins(NumberField$1, StartEnd, DelegatesARIATextbox);
324
+
325
+ var css_248z = "/**\n * Do not edit directly\n * Generated on Thu, 03 Nov 2022 17:18:46 GMT\n */\n:host {\n display: inline-block;\n}\n\n.base {\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(--vvd-color-canvas);\n --_appearance-color-outline: var(--vvd-color-neutral-400);\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)) {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--vvd-color-canvas);\n --_appearance-color-outline: var(--vvd-color-canvas-text);\n}\n.base:where(:hover, .hover):where(:not(:disabled, .disabled)).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-400);\n --_appearance-color-fill: var(--vvd-color-neutral-100);\n --_appearance-color-outline: var(--vvd-color-neutral-400);\n}\n.base:where(:disabled, .disabled).appearance-ghost {\n --_appearance-color-text: var(--vvd-color-neutral-400);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base:where(:readonly, .readonly):where(:not(:disabled, .disabled, :hover, .hover, :active, .active)) {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--vvd-color-neutral-100);\n --_appearance-color-outline: var(--vvd-color-neutral-400);\n}\n.base:where(:readonly, .readonly):where(:not(:disabled, .disabled, :hover, .hover, :active, .active)).appearance-ghost {\n --_appearance-color-text: var(--vvd-color-neutral-400);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base:where(.error):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--vvd-color-alert-500);\n --_appearance-color-fill: var(--vvd-color-alert-100);\n --_appearance-color-outline: var(--vvd-color-alert-500);\n}\n.base:where(.error):where(:not(:disabled, .disabled)).appearance-ghost {\n --_appearance-color-text: transparent;\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base:where(.success):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--vvd-color-success-100);\n --_appearance-color-outline: var(--vvd-color-success-500);\n}\n.base:where(.success):where(:not(:disabled, .disabled)).appearance-ghost {\n --_appearance-color-text: transparent;\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\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(--vvd-color-neutral-400);\n}\n\n.label {\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.base:not(.disabled) .label {\n color: var(--vvd-color-canvas-text);\n}\n.base.disabled .label {\n color: var(--vvd-color-neutral-400);\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 color: var(--_appearance-color-text);\n grid-column: 1/4;\n transition: color 0.2s;\n /* Shape */\n}\n.success .fieldset {\n --focus-stroke-color: var(--vvd-color-success-500);\n}\n.error .fieldset {\n --focus-stroke-color: var(--vvd-color-alert-500);\n}\n.base > .fieldset {\n block-size: calc(1px * (40 + 8 * clamp(-1, var(--vvd-size-density, 0), 1)));\n}\n.base:not(.shape-pill) .fieldset {\n border-radius: 6px;\n}\n.base.shape-pill .fieldset {\n border-radius: 24px;\n}\n\n.control {\n width: 100%;\n border: 0 none;\n background-color: var(--_appearance-color-fill);\n block-size: 100%;\n border-radius: inherit;\n box-shadow: inset 0 0 0 1px var(--_appearance-color-outline);\n color: inherit;\n font: var(--vvd-typography-base);\n padding-inline-end: 16px;\n padding-inline-start: 16px;\n transition: box-shadow 0.2s, background-color 0.2s;\n}\n@supports selector(:focus-visible) {\n .control:focus {\n outline: none;\n }\n}\n.control::placeholder {\n color: var(--_low-ink-color);\n}\n\n.icon {\n position: absolute;\n z-index: 1;\n color: var(--_low-ink-color);\n font-size: 20px;\n inset-inline-start: 16px;\n}\n.icon + .control {\n padding-inline-start: 44px;\n}\n\n.focus-indicator {\n --focus-stroke-gap-color: transparent;\n pointer-events: none;\n}\n.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}";
326
+
327
+ let NumberField = class NumberField extends NumberField$1 {};
328
+ __decorate([attr, __metadata("design:type", String)], NumberField.prototype, "appearance", void 0);
329
+ __decorate([attr, __metadata("design:type", String)], NumberField.prototype, "shape", void 0);
330
+ __decorate([attr, __metadata("design:type", String)], NumberField.prototype, "autoComplete", void 0);
331
+ NumberField = __decorate([formElements], NumberField);
332
+ applyMixins(NumberField, AffixIcon);
333
+
334
+ var anObject$1 = anObject$2;
335
+
336
+ // `RegExp.prototype.flags` getter implementation
337
+ // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
338
+ var regexpFlags = function () {
339
+ var that = anObject$1(this);
340
+ var result = '';
341
+ if (that.hasIndices) result += 'd';
342
+ if (that.global) result += 'g';
343
+ if (that.ignoreCase) result += 'i';
344
+ if (that.multiline) result += 'm';
345
+ if (that.dotAll) result += 's';
346
+ if (that.unicode) result += 'u';
347
+ if (that.unicodeSets) result += 'v';
348
+ if (that.sticky) result += 'y';
349
+ return result;
350
+ };
351
+
352
+ var call = functionCall;
353
+ var hasOwn = hasOwnProperty_1;
354
+ var isPrototypeOf = objectIsPrototypeOf;
355
+ var regExpFlags = regexpFlags;
356
+
357
+ var RegExpPrototype$1 = RegExp.prototype;
358
+
359
+ var regexpGetFlags = function (R) {
360
+ var flags = R.flags;
361
+ return flags === undefined && !('flags' in RegExpPrototype$1) && !hasOwn(R, 'flags') && isPrototypeOf(RegExpPrototype$1, R)
362
+ ? call(regExpFlags, R) : flags;
363
+ };
364
+
365
+ var PROPER_FUNCTION_NAME = functionName.PROPER;
366
+ var defineBuiltIn = defineBuiltIn$1;
367
+ var anObject = anObject$2;
368
+ var $toString = toString;
369
+ var fails = fails$1;
370
+ var getRegExpFlags = regexpGetFlags;
371
+
372
+ var TO_STRING = 'toString';
373
+ var RegExpPrototype = RegExp.prototype;
374
+ var nativeToString = RegExpPrototype[TO_STRING];
375
+
376
+ var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
377
+ // FF44- RegExp#toString has a wrong name
378
+ var INCORRECT_NAME = PROPER_FUNCTION_NAME && nativeToString.name != TO_STRING;
379
+
380
+ // `RegExp.prototype.toString` method
381
+ // https://tc39.es/ecma262/#sec-regexp.prototype.tostring
382
+ if (NOT_GENERIC || INCORRECT_NAME) {
383
+ defineBuiltIn(RegExp.prototype, TO_STRING, function toString() {
384
+ var R = anObject(this);
385
+ var pattern = $toString(R.source);
386
+ var flags = $toString(getRegExpFlags(R));
387
+ return '/' + pattern + '/' + flags;
388
+ }, { unsafe: true });
389
+ }
390
+
391
+ let _ = t => t,
392
+ _t,
393
+ _t2,
394
+ _t3;
395
+ const ADD = 1;
396
+ const SUBTRACT = -1;
397
+ const getStateClasses = ({
398
+ errorValidationMessage,
399
+ disabled,
400
+ value,
401
+ readOnly,
402
+ placeholder,
403
+ appearance,
404
+ shape,
405
+ label,
406
+ successText
407
+ }) => classNames(['error', Boolean(errorValidationMessage)], ['disabled', disabled], ['has-value', Boolean(value)], ['readonly', readOnly], ['placeholder', Boolean(placeholder)], [`appearance-${appearance}`, Boolean(appearance)], [`shape-${shape}`, Boolean(shape)], ['no-label', !label], ['success', !!successText]);
408
+ function renderLabel() {
409
+ return html(_t || (_t = _`
410
+ <label for="control" class="label">
411
+ ${0}
412
+ </label>`), x => x.label);
413
+ }
414
+ function adjustValueByStep(numberField, direction = ADD) {
415
+ numberField.value = (Number(numberField.value) + direction * (numberField.step ? numberField.step : 1)).toString();
416
+ }
417
+ function setControlButtonShape(numberField) {
418
+ return numberField.shape === Shape.Pill ? Shape.Pill : null;
419
+ }
420
+ function getTabIndex(numberField) {
421
+ return numberField.disabled || numberField.readOnly ? '-1' : null;
422
+ }
423
+ function numberControlButtons(context) {
424
+ const buttonTag = context.tagFor(Button);
425
+ const dividerTag = context.tagFor(Divider);
426
+ return html(_t2 || (_t2 = _`
427
+ <div class="control-buttons"
428
+ ?inert="${0}">
429
+ <${0} id="subtract" icon="minus-line"
430
+ aria-controls="control"
431
+ shape="${0}"
432
+ density="condensed"
433
+ tabindex="${0}"
434
+ @click="${0}"></${0}>
435
+ <${0} class="divider" orientation="vertical"></${0}>
436
+ <${0} id="add" icon="plus-line"
437
+ aria-controls="control"
438
+ shape="${0}"
439
+ density="condensed"
440
+ tabindex="${0}"
441
+ @click="${0}"></${0}>
442
+ </div>
443
+ `), x => x.disabled || x.readOnly, buttonTag, setControlButtonShape, getTabIndex, x => adjustValueByStep(x, SUBTRACT), buttonTag, dividerTag, dividerTag, buttonTag, setControlButtonShape, getTabIndex, x => adjustValueByStep(x), buttonTag);
444
+ }
445
+ const NumberFieldTemplate = context => {
446
+ const focusTemplate = focusTemplateFactory(context);
447
+ return html(_t3 || (_t3 = _`
448
+ <div class="base ${0}">
449
+ ${0}
450
+ <div class="fieldset">
451
+ <input class="control"
452
+ id="control"
453
+ @input="${0}"
454
+ @change="${0}"
455
+ ?autofocus="${0}"
456
+ ?disabled="${0}"
457
+ list="${0}"
458
+ step="${0}"
459
+ max="${0}"
460
+ min="${0}"
461
+ maxlength="${0}"
462
+ minlength="${0}"
463
+ placeholder="${0}"
464
+ ?readonly="${0}"
465
+ ?required="${0}"
466
+ size="${0}"
467
+ autocomplete="${0}"
468
+ name="${0}"
469
+ ?spellcheck="${0}"
470
+ :value="${0}"
471
+ type="text"
472
+ aria-atomic="${0}"
473
+ aria-busy="${0}"
474
+ aria-controls="${0}"
475
+ aria-current="${0}"
476
+ aria-describedby="${0}"
477
+ aria-details="${0}"
478
+ aria-disabled="${0}"
479
+ aria-errormessage="${0}"
480
+ aria-flowto="${0}"
481
+ aria-haspopup="${0}"
482
+ aria-hidden="${0}"
483
+ aria-invalid="${0}"
484
+ aria-keyshortcuts="${0}"
485
+ aria-label="${0}"
486
+ aria-labelledby="${0}"
487
+ aria-live="${0}"
488
+ aria-owns="${0}"
489
+ aria-relevant="${0}"
490
+ aria-roledescription="${0}"
491
+ ${0}
492
+ />
493
+ ${0}
494
+ ${0}
495
+ </div>
496
+ ${0}
497
+ ${0}
498
+ ${0}
499
+ </div>
500
+ `), getStateClasses, when(x => x.label, renderLabel()), x => x.handleTextInput(), x => x.handleChange(), x => x.autofocus, x => x.disabled, x => x.list, x => x.step ? x.step : null, x => x.max, x => x.min, x => x.maxlength, x => x.minlength, x => x.placeholder, x => x.readOnly, x => x.required, x => x.size, x => x.autoComplete, x => x.name, x => x.spellcheck, x => x.value, x => x.ariaAtomic, x => x.ariaBusy, x => x.ariaControls, x => x.ariaCurrent, x => x.ariaDescribedby, x => x.ariaDetails, x => x.ariaDisabled, x => x.ariaErrormessage, x => x.ariaFlowto, x => x.ariaHaspopup, x => x.ariaHidden, x => x.ariaInvalid, x => x.ariaKeyshortcuts, x => x.ariaLabel, x => x.ariaLabelledby, x => x.ariaLive, x => x.ariaOwns, x => x.ariaRelevant, x => x.ariaRoledescription, ref('control'), () => focusTemplate, () => numberControlButtons(context), when(x => {
501
+ var _a;
502
+ return !x.successText && !x.errorValidationMessage && ((_a = x.helperText) === null || _a === void 0 ? void 0 : _a.length);
503
+ }, getFeedbackTemplate('helper', context)), when(x => !x.successText && x.errorValidationMessage, getFeedbackTemplate('error', context)), when(x => x.successText, getFeedbackTemplate('success', context)));
504
+ };
505
+
506
+ const vividNumberField = NumberField.compose({
507
+ baseName: 'number-field',
508
+ template: NumberFieldTemplate,
509
+ styles: css_248z,
510
+ shadowOptions: {
511
+ delegatesFocus: true
512
+ }
513
+ });
514
+ designSystem.register(vividNumberField());
515
+
516
+ export { vividNumberField };
package/package.json CHANGED
@@ -1,19 +1,67 @@
1
1
  {
2
2
  "name": "@vonage/vivid",
3
- "version": "3.0.0-next.9",
3
+ "version": "3.0.0-next.90",
4
4
  "type": "module",
5
- "module": "./index.esm.js",
6
- "main": "index.js",
5
+ "module": "./index.js",
6
+ "main": "./index.js",
7
+ "homepage": "https://vivid.deno.dev",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/vonage/vivid-3",
11
+ "directory": "libs/components"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/Vonage/vivid-3/issues"
15
+ },
16
+ "license": "Apache-2.0",
7
17
  "exports": {
8
- "import": "./index.js"
18
+ "./accordion": "./accordion",
19
+ "./accordion-item": "./accordion-item",
20
+ "./action-group": "./action-group",
21
+ "./avatar": "./avatar",
22
+ "./badge": "./badge",
23
+ "./banner": "./banner",
24
+ "./breadcrumb": "./breadcrumb",
25
+ "./breadcrumb-item": "./breadcrumb-item",
26
+ "./button": "./button",
27
+ "./calendar": "./calendar",
28
+ "./calendar-event": "./calendar-event",
29
+ "./card": "./card",
30
+ "./checkbox": "./checkbox",
31
+ "./elevation": "./elevation",
32
+ "./dialog": "./dialog",
33
+ "./divider": "./divider",
34
+ "./fab": "./fab",
35
+ "./icon": "./icon",
36
+ "./layout": "./layout",
37
+ "./menu": "./menu",
38
+ "./menu-item": "./menu-item",
39
+ "./nav": "./nav",
40
+ "./nav-disclosure": "./nav-disclosure",
41
+ "./nav-item": "./nav-item",
42
+ "./note": "./note",
43
+ "./option": "./listbox-option",
44
+ "./popup": "./popup",
45
+ "./progress": "./progress",
46
+ "./progress-ring": "./progress-ring",
47
+ "./radio": "./radio",
48
+ "./radio-group": "./radio-group",
49
+ "./side-drawer": "./side-drawer",
50
+ "./text-field": "./text-field",
51
+ "./text-area": "./text-area",
52
+ "./tooltip": "./tooltip",
53
+ "./number-field": "./number-field"
9
54
  },
10
- "typings": "./index.d.ts",
55
+ "types": "./index.d.ts",
11
56
  "dependencies": {
12
- "@microsoft/fast-element": "^1.9.0",
13
- "@microsoft/fast-foundation": "^2.41.1",
14
- "@microsoft/fast-web-utilities": "^5.2.0",
15
- "ramda": "^0.27.2",
16
- "@floating-ui/dom": "^0.4.0"
57
+ "rollup-plugin-postcss": "4.0.2",
58
+ "@microsoft/fast-element": "1.11.0",
59
+ "@microsoft/fast-foundation": "2.47.0",
60
+ "@microsoft/fast-web-utilities": "5.4.1",
61
+ "ramda": "0.27.2",
62
+ "dialog-polyfill": "0.5.6",
63
+ "@floating-ui/dom": "0.5.4",
64
+ "markdown-it": "12.3.2"
17
65
  },
18
66
  "peerDependencies": {}
19
67
  }