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