@vonage/vivid 3.40.0 → 3.41.0

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