@vonage/vivid 3.1.0 → 3.1.2

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 (73) hide show
  1. package/README.md +2 -2
  2. package/custom-elements.json +0 -8
  3. package/data-grid/index.js +2 -2
  4. package/index.js +18 -16
  5. package/lib/components.d.ts +1 -0
  6. package/number-field/index.js +18 -448
  7. package/package.json +4 -4
  8. package/progress/index.js +1 -1
  9. package/progress-ring/index.js +1 -1
  10. package/radio/index.js +1 -1
  11. package/radio-group/index.js +2 -1
  12. package/select/index.js +1 -1
  13. package/shared/aria2.js +9 -0
  14. package/shared/definition.js +1 -1
  15. package/shared/definition11.js +1 -1
  16. package/shared/definition12.js +44 -35
  17. package/shared/definition13.js +1 -1
  18. package/shared/definition14.js +1 -1
  19. package/shared/definition16.js +1 -1
  20. package/shared/definition17.js +1 -1
  21. package/shared/definition18.js +589 -527
  22. package/shared/definition19.js +1 -1
  23. package/shared/definition2.js +1 -1
  24. package/shared/definition20.js +24 -28
  25. package/shared/definition21.js +1 -1
  26. package/shared/definition22.js +1 -1
  27. package/shared/definition23.js +1 -1
  28. package/shared/definition25.js +1 -1
  29. package/shared/definition27.js +1 -1
  30. package/shared/definition29.js +1 -1
  31. package/shared/definition30.js +1 -1
  32. package/shared/definition31.js +1 -1
  33. package/shared/definition32.js +432 -76
  34. package/shared/definition33.js +76 -59
  35. package/shared/definition34.js +67 -35
  36. package/shared/definition35.js +31 -421
  37. package/shared/definition36.js +357 -555
  38. package/shared/definition37.js +618 -70
  39. package/shared/definition38.js +70 -572
  40. package/shared/definition39.js +527 -81
  41. package/shared/definition4.js +1 -1
  42. package/shared/definition40.js +127 -47
  43. package/shared/definition41.js +51 -16
  44. package/shared/definition42.js +17 -425
  45. package/shared/definition43.js +367 -209
  46. package/shared/definition44.js +248 -85
  47. package/shared/definition45.js +110 -68
  48. package/shared/definition46.js +77 -0
  49. package/shared/definition5.js +1 -1
  50. package/shared/definition6.js +1 -1
  51. package/shared/definition7.js +1 -1
  52. package/shared/definition8.js +1 -1
  53. package/shared/definition9.js +1 -1
  54. package/shared/form-elements.js +1 -1
  55. package/shared/icon.js +18 -6
  56. package/shared/index.js +10 -19
  57. package/shared/patterns/form-elements/form-elements.d.ts +2 -2
  58. package/shared/text-field.js +1 -1
  59. package/side-drawer/index.js +1 -1
  60. package/slider/index.js +2 -1
  61. package/styles/core/all.css +1 -1
  62. package/styles/core/theme.css +1 -1
  63. package/styles/core/typography.css +1 -1
  64. package/styles/tokens/theme-dark.css +4 -4
  65. package/styles/tokens/theme-light.css +4 -4
  66. package/switch/index.js +1 -1
  67. package/tab/index.js +1 -1
  68. package/tab-panel/index.js +1 -1
  69. package/tabs/index.js +3 -3
  70. package/text-area/index.js +1 -1
  71. package/text-field/index.js +1 -1
  72. package/tooltip/index.js +1 -1
  73. package/vivid.api.json +164 -0
package/README.md CHANGED
@@ -167,10 +167,10 @@ The following snippet fully renders a Vivid button component
167
167
  <link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600&family=Roboto+Mono:wght@400;500&display=swap" rel="stylesheet">
168
168
 
169
169
  <!-- import light theme style tokens -->
170
- <link rel="stylesheet" href="https://unpkg.com/@vonage/vivid@next/styles/tokens/theme-light.css">
170
+ <link rel="stylesheet" href="https://unpkg.com/@vonage/vivid@3.x/styles/tokens/theme-light.css">
171
171
 
172
172
  <!-- import Vivid button component -->
173
- <script type="module" src="https://unpkg.com/@vonage/vivid@next/button/index.js"></script>
173
+ <script type="module" src="https://unpkg.com/@vonage/vivid@3.x/button/index.js"></script>
174
174
 
175
175
  <!-- Part of the app (or a whole app) that contains vivid components -->
176
176
  <div class="vvd-root">
@@ -2241,14 +2241,6 @@
2241
2241
  "name": "showModal"
2242
2242
  }
2243
2243
  ],
2244
- "events": [
2245
- {
2246
- "name": "close",
2247
- "type": {
2248
- "text": "CustomEvent"
2249
- }
2250
- }
2251
- ],
2252
2244
  "attributes": [
2253
2245
  {
2254
2246
  "type": {
@@ -961,9 +961,9 @@ __decorate([
961
961
 
962
962
  var css_248z$2 = ":host {\n position: relative;\n display: block;\n}\n\n:host([generate-header=sticky]) {\n max-height: var(--data-grid-max-height, 200px);\n overflow-y: auto;\n}";
963
963
 
964
- var css_248z$1 = "/**\n * Do not edit directly\n * Generated on Fri, 03 Feb 2023 15:57:56 GMT\n */\n:host {\n display: grid;\n width: 100%;\n box-sizing: border-box;\n color: var(--vvd-color-canvas-text);\n}\n\n:host([row-type=sticky-header]) {\n position: sticky;\n z-index: 999;\n top: 0;\n background: var(--vvd-color-canvas);\n}";
964
+ var css_248z$1 = "/**\n * Do not edit directly\n * Generated on Wed, 15 Feb 2023 11:31:49 GMT\n */\n:host {\n display: grid;\n width: 100%;\n box-sizing: border-box;\n color: var(--vvd-color-canvas-text);\n}\n\n:host([row-type=sticky-header]) {\n position: sticky;\n z-index: 999;\n top: 0;\n background: var(--vvd-color-canvas);\n}";
965
965
 
966
- var css_248z = "/**\n * Do not edit directly\n * Generated on Fri, 03 Feb 2023 15:57:56 GMT\n */\n:host {\n position: relative;\n display: flex;\n overflow: hidden;\n box-sizing: border-box;\n align-items: center;\n padding: 8px 12px;\n border-bottom: 1px solid var(--vvd-color-neutral-100);\n block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 8));\n color: var(--vvd-color-canvas-text);\n font: var(--vvd-typography-base);\n outline: none;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n:host([cell-type=columnheader]) {\n border-color: currentColor;\n font: var(--vvd-typography-base-bold);\n}\n\n.focus-indicator {\n --focus-stroke-gap-color: transparent;\n pointer-events: none;\n}\n#focus-wrapper:not(.active) > .focus-indicator {\n display: none;\n}";
966
+ var css_248z = "/**\n * Do not edit directly\n * Generated on Wed, 15 Feb 2023 11:31:49 GMT\n */\n:host {\n position: relative;\n display: flex;\n overflow: hidden;\n box-sizing: border-box;\n align-items: center;\n padding: 8px 12px;\n border-bottom: 1px solid var(--vvd-color-neutral-100);\n block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 8));\n color: var(--vvd-color-canvas-text);\n font: var(--vvd-typography-base);\n outline: none;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n:host([cell-type=columnheader]) {\n border-color: currentColor;\n font: var(--vvd-typography-base-bold);\n}\n\n.focus-indicator {\n --focus-stroke-gap-color: transparent;\n pointer-events: none;\n}\n#focus-wrapper:not(.active) > .focus-indicator {\n display: none;\n}";
967
967
 
968
968
  class DataGrid extends DataGrid$1 {}
969
969
 
package/index.js CHANGED
@@ -27,21 +27,22 @@ export { n as navDefinition, a as navRegistries, r as registerNav } from './shar
27
27
  export { n as navDisclosureDefinition, a as navDisclosureRegistries, r as registerNavDisclosure } from './shared/definition29.js';
28
28
  export { n as navItemDefinition, a as navItemRegistries, r as registerNavItem } from './shared/definition30.js';
29
29
  export { n as noteDefinition, a as noteRegistries, r as registerNote } from './shared/definition31.js';
30
+ export { n as numberFieldDefinition, a as numberFieldRegistries, r as registerNumberField } from './shared/definition32.js';
30
31
  export { a as popupDefinition, p as popupRegistries, r as registerPopup } from './shared/definition18.js';
31
- export { p as progressDefinition, a as progressRegistries, r as registerProgress } from './shared/definition32.js';
32
- export { p as progressRingDefinition, a as progressRingRegistries, r as registerProgressRing } from './shared/definition33.js';
33
- export { a as radioDefinition, b as radioRegistries, r as registerRadio } from './shared/definition34.js';
34
- export { a as radioGroupDefinition, b as radioGroupRegistries, r as registerRadioGroup } from './shared/definition35.js';
35
- export { r as registerSelect, s as selectDefinition, a as selectRegistries } from './shared/definition36.js';
36
- export { r as registerSideDrawer, s as sideDrawerDefinition, a as sideDrawerRegistries } from './shared/definition37.js';
37
- export { r as registerSlider, s as sliderDefinition, a as sliderRegistries } from './shared/definition38.js';
38
- export { r as registerSwitch, s as switchDefinition, a as switchRegistries } from './shared/definition39.js';
39
- export { r as registerTextField, t as textFieldDefinition, a as textFieldRegistries } from './shared/definition44.js';
40
- export { r as registerTextArea, t as textAreaDefinition, a as textAreaRegistries } from './shared/definition43.js';
41
- export { r as registerTooltip, t as tooltipDefinition, a as tooltipRegistries } from './shared/definition45.js';
42
- export { r as registerTabs, t as tabsDefinition, a as tabsRegistries } from './shared/definition42.js';
43
- export { r as registerTab, a as tabDefinition, t as tabRegistries } from './shared/definition40.js';
44
- export { r as registerTabPanel, a as tabPanelDefinition, t as tabPanelRegistries } from './shared/definition41.js';
32
+ export { p as progressDefinition, a as progressRegistries, r as registerProgress } from './shared/definition33.js';
33
+ export { p as progressRingDefinition, a as progressRingRegistries, r as registerProgressRing } from './shared/definition34.js';
34
+ export { a as radioDefinition, b as radioRegistries, r as registerRadio } from './shared/definition35.js';
35
+ export { a as radioGroupDefinition, b as radioGroupRegistries, r as registerRadioGroup } from './shared/definition36.js';
36
+ export { r as registerSelect, s as selectDefinition, a as selectRegistries } from './shared/definition37.js';
37
+ export { r as registerSideDrawer, s as sideDrawerDefinition, a as sideDrawerRegistries } from './shared/definition38.js';
38
+ export { r as registerSlider, s as sliderDefinition, a as sliderRegistries } from './shared/definition39.js';
39
+ export { r as registerSwitch, s as switchDefinition, a as switchRegistries } from './shared/definition40.js';
40
+ export { r as registerTextField, t as textFieldDefinition, a as textFieldRegistries } from './shared/definition45.js';
41
+ export { r as registerTextArea, t as textAreaDefinition, a as textAreaRegistries } from './shared/definition44.js';
42
+ export { r as registerTooltip, t as tooltipDefinition, a as tooltipRegistries } from './shared/definition46.js';
43
+ export { r as registerTabs, t as tabsDefinition, a as tabsRegistries } from './shared/definition43.js';
44
+ export { r as registerTab, a as tabDefinition, t as tabRegistries } from './shared/definition41.js';
45
+ export { r as registerTabPanel, a as tabPanelDefinition, t as tabPanelRegistries } from './shared/definition42.js';
45
46
  export { a7 as designSystem, r as registerFactory } from './shared/index.js';
46
47
  import './shared/key-codes.js';
47
48
  import './shared/numbers.js';
@@ -78,7 +79,8 @@ import './shared/aria.js';
78
79
  import './shared/dom.js';
79
80
  import './shared/direction.js';
80
81
  import './shared/text-anchor.js';
82
+ import './shared/text-field2.js';
83
+ import './shared/es.regexp.to-string.js';
81
84
  import './shared/base-progress.js';
82
85
  import './shared/radio.js';
83
- import './shared/es.regexp.to-string.js';
84
- import './shared/text-field2.js';
86
+ import './shared/aria2.js';
@@ -27,6 +27,7 @@ export * from './nav/definition';
27
27
  export * from './nav-disclosure/definition';
28
28
  export * from './nav-item/definition';
29
29
  export * from './note/definition';
30
+ export * from './number-field/definition';
30
31
  export * from './popup/definition';
31
32
  export * from './progress/definition';
32
33
  export * from './progress-ring/definition';
@@ -1,459 +1,29 @@
1
- import { F as FoundationElement, W as DOM, _ as __decorate, a as attr, n as nullableNumberConverter, o as observable, b as __metadata, h as html, r as registerFactory } from '../shared/index.js';
2
- import { B as Button, b as buttonRegistries } from '../shared/definition9.js';
3
- import { D as Divider, d as dividerRegistries } from '../shared/definition21.js';
4
- import { b as AffixIcon } from '../shared/affix.js';
5
- import '../shared/focus.js';
6
- import { f as formElements, F as FormElementSuccessText, a as FormElementHelperText, b as FormElementCharCount, 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 { D as DelegatesARIATextbox } from '../shared/text-field2.js';
10
- import { F as FormAssociated } from '../shared/form-associated.js';
11
- import { b as keyArrowDown, c as keyArrowUp } from '../shared/key-codes.js';
12
- import '../shared/es.regexp.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';
1
+ import { r as registerNumberField } from '../shared/definition32.js';
2
+ import '../shared/index.js';
3
+ import '../shared/definition9.js';
18
4
  import '../shared/definition3.js';
19
5
  import '../shared/icon.js';
20
6
  import '../shared/to-string.js';
21
7
  import '../shared/string-trim.js';
22
8
  import '../shared/_has.js';
9
+ import '../shared/class-names.js';
10
+ import '../shared/when.js';
23
11
  import '../shared/definition4.js';
12
+ import '../shared/focus.js';
13
+ import '../shared/affix.js';
24
14
  import '../shared/button.js';
15
+ import '../shared/apply-mixins.js';
16
+ import '../shared/form-associated.js';
17
+ import '../shared/key-codes.js';
25
18
  import '../shared/aria-global.js';
19
+ import '../shared/start-end.js';
20
+ import '../shared/ref.js';
21
+ import '../shared/focus2.js';
22
+ import '../shared/definition21.js';
26
23
  import '../shared/aria.js';
27
-
28
- class _NumberField extends FoundationElement {
29
- }
30
- /**
31
- * A form-associated base class for the {@link @microsoft/fast-foundation#(NumberField:class)} component.
32
- *
33
- * @internal
34
- */
35
- class FormAssociatedNumberField extends FormAssociated(_NumberField) {
36
- constructor() {
37
- super(...arguments);
38
- this.proxy = document.createElement("input");
39
- }
40
- }
41
-
42
- /**
43
- * A Number Field Custom HTML Element.
44
- * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number | <input type="number" /> element }.
45
- *
46
- * @slot start - Content which can be provided before the number field input
47
- * @slot end - Content which can be provided after the number field input
48
- * @slot - The default slot for the label
49
- * @slot step-up-glyph - The glyph for the step up control
50
- * @slot step-down-glyph - The glyph for the step down control
51
- * @csspart label - The label
52
- * @csspart root - The element wrapping the control, including start and end slots
53
- * @csspart control - The element representing the input
54
- * @csspart controls - The step up and step down controls
55
- * @csspart step-up - The step up control
56
- * @csspart step-down - The step down control
57
- * @fires input - Fires a custom 'input' event when the value has changed
58
- * @fires change - Fires a custom 'change' event when the value has changed
59
- *
60
- * @public
61
- */
62
- class NumberField$1 extends FormAssociatedNumberField {
63
- constructor() {
64
- super(...arguments);
65
- /**
66
- * When true, spin buttons will not be rendered
67
- * @public
68
- * @remarks
69
- * HTML Attribute: autofocus
70
- */
71
- this.hideStep = false;
72
- /**
73
- * Amount to increment or decrement the value by
74
- * @public
75
- * @remarks
76
- * HTMLAttribute: step
77
- */
78
- this.step = 1;
79
- /**
80
- * Flag to indicate that the value change is from the user input
81
- * @internal
82
- */
83
- this.isUserInput = false;
84
- }
85
- /**
86
- * Ensures that the max is greater than the min and that the value
87
- * is less than the max
88
- * @param previous - the previous max value
89
- * @param next - updated max value
90
- *
91
- * @internal
92
- */
93
- maxChanged(previous, next) {
94
- var _a;
95
- this.max = Math.max(next, (_a = this.min) !== null && _a !== void 0 ? _a : next);
96
- const min = Math.min(this.min, this.max);
97
- if (this.min !== undefined && this.min !== min) {
98
- this.min = min;
99
- }
100
- this.value = this.getValidValue(this.value);
101
- }
102
- /**
103
- * Ensures that the min is less than the max and that the value
104
- * is greater than the min
105
- * @param previous - previous min value
106
- * @param next - updated min value
107
- *
108
- * @internal
109
- */
110
- minChanged(previous, next) {
111
- var _a;
112
- this.min = Math.min(next, (_a = this.max) !== null && _a !== void 0 ? _a : next);
113
- const max = Math.max(this.min, this.max);
114
- if (this.max !== undefined && this.max !== max) {
115
- this.max = max;
116
- }
117
- this.value = this.getValidValue(this.value);
118
- }
119
- /**
120
- * The value property, typed as a number.
121
- *
122
- * @public
123
- */
124
- get valueAsNumber() {
125
- return parseFloat(super.value);
126
- }
127
- set valueAsNumber(next) {
128
- this.value = next.toString();
129
- }
130
- /**
131
- * Validates that the value is a number between the min and max
132
- * @param previous - previous stored value
133
- * @param next - value being updated
134
- * @param updateControl - should the text field be updated with value, defaults to true
135
- * @internal
136
- */
137
- valueChanged(previous, next) {
138
- this.value = this.getValidValue(next);
139
- if (next !== this.value) {
140
- return;
141
- }
142
- if (this.control && !this.isUserInput) {
143
- this.control.value = this.value;
144
- }
145
- super.valueChanged(previous, this.value);
146
- if (previous !== undefined && !this.isUserInput) {
147
- this.$emit("input");
148
- this.$emit("change");
149
- }
150
- this.isUserInput = false;
151
- }
152
- /** {@inheritDoc (FormAssociated:interface).validate} */
153
- validate() {
154
- super.validate(this.control);
155
- }
156
- /**
157
- * Sets the internal value to a valid number between the min and max properties
158
- * @param value - user input
159
- *
160
- * @internal
161
- */
162
- getValidValue(value) {
163
- var _a, _b;
164
- let validValue = parseFloat(parseFloat(value).toPrecision(12));
165
- if (isNaN(validValue)) {
166
- validValue = "";
167
- }
168
- else {
169
- validValue = Math.min(validValue, (_a = this.max) !== null && _a !== void 0 ? _a : validValue);
170
- validValue = Math.max(validValue, (_b = this.min) !== null && _b !== void 0 ? _b : validValue).toString();
171
- }
172
- return validValue;
173
- }
174
- /**
175
- * Increments the value using the step value
176
- *
177
- * @public
178
- */
179
- stepUp() {
180
- const value = parseFloat(this.value);
181
- const stepUpValue = !isNaN(value)
182
- ? value + this.step
183
- : this.min > 0
184
- ? this.min
185
- : this.max < 0
186
- ? this.max
187
- : !this.min
188
- ? this.step
189
- : 0;
190
- this.value = stepUpValue.toString();
191
- }
192
- /**
193
- * Decrements the value using the step value
194
- *
195
- * @public
196
- */
197
- stepDown() {
198
- const value = parseFloat(this.value);
199
- const stepDownValue = !isNaN(value)
200
- ? value - this.step
201
- : this.min > 0
202
- ? this.min
203
- : this.max < 0
204
- ? this.max
205
- : !this.min
206
- ? 0 - this.step
207
- : 0;
208
- this.value = stepDownValue.toString();
209
- }
210
- /**
211
- * Sets up the initial state of the number field
212
- * @internal
213
- */
214
- connectedCallback() {
215
- super.connectedCallback();
216
- this.proxy.setAttribute("type", "number");
217
- this.validate();
218
- this.control.value = this.value;
219
- if (this.autofocus) {
220
- DOM.queueUpdate(() => {
221
- this.focus();
222
- });
223
- }
224
- }
225
- /**
226
- * Selects all the text in the number field
227
- *
228
- * @public
229
- */
230
- select() {
231
- this.control.select();
232
- /**
233
- * The select event does not permeate the shadow DOM boundary.
234
- * This fn effectively proxies the select event,
235
- * emitting a `select` event whenever the internal
236
- * control emits a `select` event
237
- */
238
- this.$emit("select");
239
- }
240
- /**
241
- * Handles the internal control's `input` event
242
- * @internal
243
- */
244
- handleTextInput() {
245
- this.control.value = this.control.value.replace(/[^0-9\-+e.]/g, "");
246
- this.isUserInput = true;
247
- this.value = this.control.value;
248
- }
249
- /**
250
- * Change event handler for inner control.
251
- * @remarks
252
- * "Change" events are not `composable` so they will not
253
- * permeate the shadow DOM boundary. This fn effectively proxies
254
- * the change event, emitting a `change` event whenever the internal
255
- * control emits a `change` event
256
- * @internal
257
- */
258
- handleChange() {
259
- this.$emit("change");
260
- }
261
- /**
262
- * Handles the internal control's `keydown` event
263
- * @internal
264
- */
265
- handleKeyDown(e) {
266
- const key = e.key;
267
- switch (key) {
268
- case keyArrowUp:
269
- this.stepUp();
270
- return false;
271
- case keyArrowDown:
272
- this.stepDown();
273
- return false;
274
- }
275
- return true;
276
- }
277
- /**
278
- * Handles populating the input field with a validated value when
279
- * leaving the input field.
280
- * @internal
281
- */
282
- handleBlur() {
283
- this.control.value = this.value;
284
- }
285
- }
286
- __decorate([
287
- attr({ attribute: "readonly", mode: "boolean" })
288
- ], NumberField$1.prototype, "readOnly", void 0);
289
- __decorate([
290
- attr({ mode: "boolean" })
291
- ], NumberField$1.prototype, "autofocus", void 0);
292
- __decorate([
293
- attr({ attribute: "hide-step", mode: "boolean" })
294
- ], NumberField$1.prototype, "hideStep", void 0);
295
- __decorate([
296
- attr
297
- ], NumberField$1.prototype, "placeholder", void 0);
298
- __decorate([
299
- attr
300
- ], NumberField$1.prototype, "list", void 0);
301
- __decorate([
302
- attr({ converter: nullableNumberConverter })
303
- ], NumberField$1.prototype, "maxlength", void 0);
304
- __decorate([
305
- attr({ converter: nullableNumberConverter })
306
- ], NumberField$1.prototype, "minlength", void 0);
307
- __decorate([
308
- attr({ converter: nullableNumberConverter })
309
- ], NumberField$1.prototype, "size", void 0);
310
- __decorate([
311
- attr({ converter: nullableNumberConverter })
312
- ], NumberField$1.prototype, "step", void 0);
313
- __decorate([
314
- attr({ converter: nullableNumberConverter })
315
- ], NumberField$1.prototype, "max", void 0);
316
- __decorate([
317
- attr({ converter: nullableNumberConverter })
318
- ], NumberField$1.prototype, "min", void 0);
319
- __decorate([
320
- observable
321
- ], NumberField$1.prototype, "defaultSlottedNodes", void 0);
322
- applyMixins(NumberField$1, StartEnd, DelegatesARIATextbox);
323
-
324
- var css_248z = "/**\n * Do not edit directly\n * Generated on Fri, 03 Feb 2023 15:57:56 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-400);\n --_appearance-color-fill: var(--vvd-color-neutral-200);\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):where(:not(:disabled, .disabled)) {\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):where(:not(: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.connotation-success {\n --_connotation-color-primary: var(--vvd-color-success-500);\n --_connotation-color-backdrop: var(--vvd-color-success-50);\n --_connotation-color-intermediate: var(--vvd-color-success-500);\n --_connotation-color-firm: var(--vvd-color-success-600);\n --_connotation-color-faint: var(--vvd-color-success-50);\n --_connotation-color-soft: var(--vvd-color-success-100);\n}\n.base.connotation-alert {\n --_connotation-color-primary: var(--vvd-color-alert-500);\n --_connotation-color-backdrop: var(--vvd-color-alert-50);\n --_connotation-color-intermediate: var(--vvd-color-alert-500);\n --_connotation-color-firm: var(--vvd-color-alert-600);\n --_connotation-color-faint: var(--vvd-color-alert-50);\n --_connotation-color-soft: var(--vvd-color-alert-100);\n}\n.base:not(.connotation-success, .connotation-alert) {\n --_connotation-color-primary: var(--vvd-color-canvas-text);\n --_connotation-color-backdrop: var(--vvd-color-canvas);\n --_connotation-color-intermediate: var(--vvd-color-neutral-500);\n --_connotation-color-firm: var(--vvd-color-canvas-text);\n --_connotation-color-faint: var(--vvd-color-neutral-50);\n --_connotation-color-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 grid-column: 1/4;\n transition: color 0.2s;\n /* Shape */\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.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: var(--_appearance-color-text);\n font: var(--vvd-typography-base);\n padding-inline-end: var(--_text-field-gutter);\n padding-inline-start: var(--_text-field-gutter);\n transition: box-shadow 0.2s, background-color 0.2s;\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@supports selector(:focus-visible) {\n .control:focus {\n outline: none;\n }\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-inline-start: var(--_text-field-gutter);\n line-height: 1;\n}\n.icon + .control {\n padding-inline-start: calc(var(--_text-field-icon-size) + var(--_text-field-gutter) * 2);\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}";
325
-
326
- let NumberField = class NumberField extends NumberField$1 {};
327
- __decorate([attr, __metadata("design:type", String)], NumberField.prototype, "appearance", void 0);
328
- __decorate([attr, __metadata("design:type", String)], NumberField.prototype, "shape", void 0);
329
- __decorate([attr, __metadata("design:type", String)], NumberField.prototype, "autoComplete", void 0);
330
- NumberField = __decorate([formElements], NumberField);
331
- applyMixins(NumberField, AffixIcon, FormElementCharCount, FormElementHelperText, FormElementSuccessText);
332
-
333
- let _ = t => t,
334
- _t,
335
- _t2,
336
- _t3;
337
- const ADD = 1;
338
- const SUBTRACT = -1;
339
- const getStateClasses = ({
340
- errorValidationMessage,
341
- disabled,
342
- value,
343
- readOnly,
344
- placeholder,
345
- appearance,
346
- shape,
347
- label,
348
- successText
349
- }) => classNames(['error connotation-alert', 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 connotation-success', !!successText]);
350
- function renderLabel() {
351
- return html(_t || (_t = _`
352
- <label for="control" class="label">
353
- ${0}
354
- </label>`), x => x.label);
355
- }
356
- function adjustValueByStep(numberField, direction = ADD) {
357
- numberField.value = (Number(numberField.value) + direction * (numberField.step ? numberField.step : 1)).toString();
358
- }
359
- function setControlButtonShape(numberField) {
360
- return numberField.shape === Shape.Pill ? Shape.Pill : null;
361
- }
362
- function getTabIndex(numberField) {
363
- return numberField.disabled || numberField.readOnly ? '-1' : null;
364
- }
365
- function numberControlButtons(context) {
366
- const buttonTag = context.tagFor(Button);
367
- const dividerTag = context.tagFor(Divider);
368
- return html(_t2 || (_t2 = _`
369
- <div class="control-buttons"
370
- ?inert="${0}">
371
- <${0} id="subtract" icon="minus-line"
372
- aria-controls="control"
373
- shape="${0}"
374
- size="condensed"
375
- tabindex="${0}"
376
- @click="${0}"></${0}>
377
- <${0} class="divider" orientation="vertical"></${0}>
378
- <${0} id="add" icon="plus-line"
379
- aria-controls="control"
380
- shape="${0}"
381
- size="condensed"
382
- tabindex="${0}"
383
- @click="${0}"></${0}>
384
- </div>
385
- `), x => x.disabled || x.readOnly, buttonTag, setControlButtonShape, getTabIndex, x => adjustValueByStep(x, SUBTRACT), buttonTag, dividerTag, dividerTag, buttonTag, setControlButtonShape, getTabIndex, x => adjustValueByStep(x), buttonTag);
386
- }
387
- const NumberFieldTemplate = context => {
388
- const focusTemplate = focusTemplateFactory(context);
389
- return html(_t3 || (_t3 = _`
390
- <div class="base ${0}">
391
- ${0}
392
- <div class="fieldset">
393
- <input class="control"
394
- id="control"
395
- @input="${0}"
396
- @change="${0}"
397
- ?autofocus="${0}"
398
- ?disabled="${0}"
399
- list="${0}"
400
- step="${0}"
401
- max="${0}"
402
- min="${0}"
403
- maxlength="${0}"
404
- minlength="${0}"
405
- placeholder="${0}"
406
- ?readonly="${0}"
407
- ?required="${0}"
408
- size="${0}"
409
- autocomplete="${0}"
410
- name="${0}"
411
- ?spellcheck="${0}"
412
- :value="${0}"
413
- type="text"
414
- aria-atomic="${0}"
415
- aria-busy="${0}"
416
- aria-controls="${0}"
417
- aria-current="${0}"
418
- aria-describedby="${0}"
419
- aria-details="${0}"
420
- aria-disabled="${0}"
421
- aria-errormessage="${0}"
422
- aria-flowto="${0}"
423
- aria-haspopup="${0}"
424
- aria-hidden="${0}"
425
- aria-invalid="${0}"
426
- aria-keyshortcuts="${0}"
427
- aria-label="${0}"
428
- aria-labelledby="${0}"
429
- aria-live="${0}"
430
- aria-owns="${0}"
431
- aria-relevant="${0}"
432
- aria-roledescription="${0}"
433
- ${0}
434
- />
435
- ${0}
436
- ${0}
437
- </div>
438
- ${0}
439
- ${0}
440
- ${0}
441
- </div>
442
- `), 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 => {
443
- var _a;
444
- return !x.successText && !x.errorValidationMessage && ((_a = x.helperText) === null || _a === void 0 ? void 0 : _a.length);
445
- }, getFeedbackTemplate('helper', context)), when(x => !x.successText && x.errorValidationMessage, getFeedbackTemplate('error', context)), when(x => x.successText, getFeedbackTemplate('success', context)));
446
- };
447
-
448
- const numberFieldDefinition = NumberField.compose({
449
- baseName: 'number-field',
450
- template: NumberFieldTemplate,
451
- styles: css_248z,
452
- shadowOptions: {
453
- delegatesFocus: true
454
- }
455
- });
456
- const numberFieldRegistries = [numberFieldDefinition(), ...buttonRegistries, ...dividerRegistries];
457
- const registerNumberField = registerFactory(numberFieldRegistries);
24
+ import '../shared/form-elements.js';
25
+ import '../shared/text-field2.js';
26
+ import '../shared/es.regexp.to-string.js';
27
+ import '../shared/enums.js';
458
28
 
459
29
  registerNumberField();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vonage/vivid",
3
- "version": "3.1.0",
3
+ "version": "3.1.2",
4
4
  "type": "module",
5
5
  "module": "./index.js",
6
6
  "main": "./index.js",
@@ -18,12 +18,12 @@
18
18
  "types": "./index.d.ts",
19
19
  "dependencies": {
20
20
  "rollup-plugin-postcss": "4.0.2",
21
- "@microsoft/fast-foundation": "2.47.0",
21
+ "@microsoft/fast-foundation": "2.47.1-0",
22
22
  "@microsoft/fast-element": "1.11.0",
23
23
  "@microsoft/fast-web-utilities": "5.4.1",
24
- "ramda": "0.27.2",
24
+ "ramda": "0.28.0",
25
25
  "dialog-polyfill": "0.5.6",
26
- "@floating-ui/dom": "0.5.4"
26
+ "@floating-ui/dom": "1.2.0"
27
27
  },
28
28
  "peerDependencies": {}
29
29
  }
package/progress/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { r as registerProgress } from '../shared/definition32.js';
1
+ import { r as registerProgress } from '../shared/definition33.js';
2
2
  import '../shared/index.js';
3
3
  import '../shared/base-progress.js';
4
4
  import '../shared/when.js';
@@ -1,4 +1,4 @@
1
- import { r as registerProgressRing } from '../shared/definition33.js';
1
+ import { r as registerProgressRing } from '../shared/definition34.js';
2
2
  import '../shared/index.js';
3
3
  import '../shared/base-progress.js';
4
4
  import '../shared/when.js';
package/radio/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { r as registerRadio } from '../shared/definition34.js';
1
+ import { r as registerRadio } from '../shared/definition35.js';
2
2
  import '../shared/index.js';
3
3
  import '../shared/definition4.js';
4
4
  import '../shared/focus.js';
@@ -1,4 +1,4 @@
1
- import { r as registerRadioGroup } from '../shared/definition35.js';
1
+ import { r as registerRadioGroup } from '../shared/definition36.js';
2
2
  import '../shared/index.js';
3
3
  import '../shared/direction.js';
4
4
  import '../shared/key-codes.js';
@@ -6,6 +6,7 @@ import '../shared/aria.js';
6
6
  import '../shared/radio.js';
7
7
  import '../shared/form-associated.js';
8
8
  import '../shared/slotted.js';
9
+ import '../shared/aria2.js';
9
10
  import '../shared/when.js';
10
11
 
11
12
  registerRadioGroup();
package/select/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { r as registerSelect } from '../shared/definition36.js';
1
+ import { r as registerSelect } from '../shared/definition37.js';
2
2
  import '../shared/index.js';
3
3
  import '../shared/definition4.js';
4
4
  import '../shared/focus.js';