@vonage/vivid 3.0.0-next.12 → 3.0.0-next.120

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 (291) hide show
  1. package/README.md +170 -4
  2. package/accordion/index.js +4 -60
  3. package/accordion-item/index.js +14 -118
  4. package/action-group/index.js +5 -0
  5. package/avatar/index.js +11 -0
  6. package/badge/index.js +9 -53
  7. package/banner/index.js +20 -210
  8. package/breadcrumb/index.js +7 -96
  9. package/breadcrumb-item/index.js +15 -46
  10. package/button/index.js +19 -751
  11. package/calendar/index.js +5 -1520
  12. package/calendar-event/index.js +9 -0
  13. package/card/index.js +13 -0
  14. package/checkbox/index.js +16 -0
  15. package/custom-elements.json +5784 -0
  16. package/dialog/index.js +24 -0
  17. package/divider/index.js +6 -0
  18. package/elevation/index.js +4 -30
  19. package/fab/index.js +22 -0
  20. package/focus/index.js +4 -2
  21. package/header/index.js +58 -0
  22. package/icon/index.js +8 -36
  23. package/index.js +65 -26
  24. package/layout/index.js +4 -52
  25. package/lib/accordion/definition.d.ts +3 -0
  26. package/lib/accordion/index.d.ts +1 -2
  27. package/lib/accordion-item/definition.d.ts +3 -0
  28. package/lib/accordion-item/index.d.ts +1 -3
  29. package/lib/action-group/action-group.d.ts +10 -0
  30. package/lib/{sidenav-item/sidenav-item.template.d.ts → action-group/action-group.template.d.ts} +2 -2
  31. package/lib/action-group/definition.d.ts +3 -0
  32. package/lib/action-group/index.d.ts +1 -0
  33. package/lib/avatar/avatar.d.ts +15 -0
  34. package/lib/avatar/avatar.template.d.ts +4 -0
  35. package/lib/avatar/definition.d.ts +3 -0
  36. package/lib/avatar/index.d.ts +1 -0
  37. package/lib/badge/badge.d.ts +2 -4
  38. package/lib/badge/definition.d.ts +3 -0
  39. package/lib/badge/index.d.ts +1 -3
  40. package/lib/banner/banner.d.ts +1 -1
  41. package/lib/banner/banner.template.d.ts +0 -2
  42. package/lib/banner/definition.d.ts +3 -0
  43. package/lib/banner/index.d.ts +1 -2
  44. package/lib/breadcrumb/breadcrumb.template.d.ts +4 -0
  45. package/lib/breadcrumb/definition.d.ts +3 -0
  46. package/lib/breadcrumb/index.d.ts +1 -2
  47. package/lib/breadcrumb-item/definition.d.ts +3 -0
  48. package/lib/breadcrumb-item/index.d.ts +1 -3
  49. package/lib/button/button.d.ts +3 -2
  50. package/lib/button/definition.d.ts +3 -0
  51. package/lib/button/index.d.ts +1 -21
  52. package/lib/calendar/calendar.d.ts +3 -1
  53. package/lib/calendar/definition.d.ts +3 -0
  54. package/lib/calendar/index.d.ts +1 -3
  55. package/lib/calendar-event/calendar-event.d.ts +14 -0
  56. package/lib/calendar-event/calendar-event.template.d.ts +4 -0
  57. package/lib/calendar-event/definition.d.ts +3 -0
  58. package/lib/calendar-event/index.d.ts +1 -0
  59. package/lib/card/card.d.ts +10 -0
  60. package/lib/{text/text.template.d.ts → card/card.template.d.ts} +2 -2
  61. package/lib/card/definition.d.ts +3 -0
  62. package/lib/card/index.d.ts +1 -0
  63. package/lib/checkbox/checkbox.d.ts +5 -0
  64. package/lib/checkbox/checkbox.template.d.ts +4 -0
  65. package/lib/checkbox/definition.d.ts +3 -0
  66. package/lib/checkbox/index.d.ts +1 -0
  67. package/lib/components.d.ts +38 -16
  68. package/lib/dialog/definition.d.ts +3 -0
  69. package/lib/dialog/dialog.d.ts +23 -0
  70. package/lib/dialog/dialog.template.d.ts +4 -0
  71. package/lib/dialog/index.d.ts +1 -0
  72. package/lib/divider/definition.d.ts +3 -0
  73. package/lib/divider/divider.d.ts +3 -0
  74. package/lib/divider/divider.template.d.ts +4 -0
  75. package/lib/divider/index.d.ts +1 -0
  76. package/lib/elevation/definition.d.ts +3 -0
  77. package/lib/elevation/elevation.d.ts +1 -0
  78. package/lib/elevation/index.d.ts +1 -2
  79. package/lib/enums.d.ts +19 -6
  80. package/lib/fab/definition.d.ts +3 -0
  81. package/lib/fab/fab.d.ts +13 -0
  82. package/lib/fab/fab.template.d.ts +4 -0
  83. package/lib/fab/index.d.ts +1 -0
  84. package/lib/focus/definition.d.ts +3 -0
  85. package/lib/focus/index.d.ts +1 -2
  86. package/lib/header/definition.d.ts +3 -0
  87. package/lib/header/header.d.ts +5 -0
  88. package/lib/header/header.template.d.ts +4 -0
  89. package/lib/header/index.d.ts +1 -0
  90. package/lib/icon/definition.d.ts +3 -0
  91. package/lib/icon/icon.d.ts +5 -6
  92. package/lib/icon/index.d.ts +1 -2
  93. package/lib/layout/definition.d.ts +3 -0
  94. package/lib/layout/index.d.ts +1 -2
  95. package/lib/layout/layout.d.ts +4 -4
  96. package/lib/listbox/definition.d.ts +3 -0
  97. package/lib/listbox/index.d.ts +1 -0
  98. package/lib/listbox/listbox.d.ts +9 -0
  99. package/lib/listbox/listbox.template.d.ts +4 -0
  100. package/lib/menu/definition.d.ts +7 -0
  101. package/lib/menu/index.d.ts +1 -0
  102. package/lib/menu/menu.d.ts +10 -0
  103. package/lib/menu/menu.template.d.ts +3 -0
  104. package/lib/menu-item/definition.d.ts +3 -0
  105. package/lib/menu-item/index.d.ts +1 -0
  106. package/lib/menu-item/menu-item.d.ts +7 -0
  107. package/lib/menu-item/menu-item.template.d.ts +5 -0
  108. package/lib/nav/definition.d.ts +3 -0
  109. package/lib/nav/index.d.ts +1 -0
  110. package/lib/nav/nav.d.ts +3 -0
  111. package/lib/nav/nav.template.d.ts +4 -0
  112. package/lib/nav-disclosure/definition.d.ts +3 -0
  113. package/lib/nav-disclosure/index.d.ts +1 -0
  114. package/lib/nav-disclosure/nav-disclosure.d.ts +10 -0
  115. package/lib/nav-disclosure/nav-disclosure.template.d.ts +4 -0
  116. package/lib/nav-item/definition.d.ts +3 -0
  117. package/lib/nav-item/index.d.ts +1 -0
  118. package/lib/{sidenav-item/sidenav-item.d.ts → nav-item/nav-item.d.ts} +2 -2
  119. package/lib/nav-item/nav-item.template.d.ts +4 -0
  120. package/lib/note/definition.d.ts +3 -0
  121. package/lib/note/index.d.ts +1 -0
  122. package/lib/note/note.d.ts +10 -0
  123. package/lib/note/note.template.d.ts +4 -0
  124. package/lib/number-field/definition.d.ts +3 -0
  125. package/lib/number-field/index.d.ts +1 -0
  126. package/lib/number-field/number-field.d.ts +14 -0
  127. package/lib/number-field/number-field.template.d.ts +4 -0
  128. package/lib/option/definition.d.ts +3 -0
  129. package/lib/option/index.d.ts +1 -0
  130. package/lib/option/option.d.ts +9 -0
  131. package/lib/option/option.template.d.ts +4 -0
  132. package/lib/popup/definition.d.ts +4 -0
  133. package/lib/popup/index.d.ts +1 -4
  134. package/lib/popup/popup.d.ts +6 -4
  135. package/lib/progress/definition.d.ts +3 -0
  136. package/lib/progress/index.d.ts +1 -2
  137. package/lib/progress/progress.d.ts +1 -1
  138. package/lib/progress-ring/definition.d.ts +3 -0
  139. package/lib/progress-ring/index.d.ts +1 -2
  140. package/lib/progress-ring/progress-ring.d.ts +2 -1
  141. package/lib/radio/definition.d.ts +3 -0
  142. package/lib/radio/index.d.ts +1 -0
  143. package/lib/radio/radio.d.ts +4 -0
  144. package/lib/radio/radio.template.d.ts +4 -0
  145. package/lib/radio-group/definition.d.ts +7 -0
  146. package/lib/radio-group/index.d.ts +1 -0
  147. package/lib/radio-group/radio-group.d.ts +4 -0
  148. package/lib/radio-group/radio-group.template.d.ts +4 -0
  149. package/lib/side-drawer/definition.d.ts +3 -0
  150. package/lib/side-drawer/index.d.ts +1 -2
  151. package/lib/side-drawer/side-drawer.d.ts +3 -2
  152. package/lib/slider/definition.d.ts +3 -0
  153. package/lib/slider/index.d.ts +1 -0
  154. package/lib/slider/slider.d.ts +4 -0
  155. package/lib/slider/slider.template.d.ts +4 -0
  156. package/lib/switch/definition.d.ts +3 -0
  157. package/lib/switch/index.d.ts +1 -0
  158. package/lib/switch/switch.d.ts +7 -0
  159. package/lib/switch/switch.template.d.ts +4 -0
  160. package/lib/text-anchor/definition.d.ts +3 -0
  161. package/lib/text-anchor/index.d.ts +1 -2
  162. package/lib/text-area/definition.d.ts +3 -0
  163. package/lib/text-area/index.d.ts +1 -0
  164. package/lib/text-area/text-area.d.ts +9 -0
  165. package/lib/text-area/text-area.template.d.ts +4 -0
  166. package/lib/text-field/definition.d.ts +3 -0
  167. package/lib/text-field/index.d.ts +1 -0
  168. package/lib/text-field/text-field.d.ts +14 -0
  169. package/lib/text-field/text-field.template.d.ts +4 -0
  170. package/lib/tooltip/definition.d.ts +3 -0
  171. package/lib/tooltip/index.d.ts +1 -3
  172. package/lib/tooltip/tooltip.d.ts +6 -6
  173. package/listbox/index.js +24 -0
  174. package/menu/index.js +30 -0
  175. package/menu-item/index.js +20 -0
  176. package/nav/index.js +4 -0
  177. package/nav-disclosure/index.js +17 -0
  178. package/nav-item/index.js +22 -0
  179. package/note/index.js +15 -0
  180. package/number-field/index.js +458 -0
  181. package/option/index.js +20 -0
  182. package/package.json +62 -10
  183. package/popup/index.js +21 -2062
  184. package/progress/index.js +6 -98
  185. package/progress-ring/index.js +6 -75
  186. package/radio/index.js +12 -0
  187. package/radio-group/index.js +11 -0
  188. package/shared/affix.js +2 -8
  189. package/shared/anchor.js +11 -3
  190. package/shared/apply-mixins.js +5 -4
  191. package/shared/aria-global.js +2 -86
  192. package/shared/aria.js +9 -0
  193. package/shared/base-progress.js +6 -1
  194. package/shared/breadcrumb-item.js +2 -2
  195. package/shared/button.js +200 -0
  196. package/shared/calendar-event.js +19 -0
  197. package/shared/definition.js +53 -0
  198. package/shared/definition10.js +99 -0
  199. package/shared/definition11.js +48 -0
  200. package/shared/definition12.js +1523 -0
  201. package/shared/definition13.js +111 -0
  202. package/shared/definition14.js +114 -0
  203. package/shared/definition15.js +32 -0
  204. package/shared/definition16.js +172 -0
  205. package/shared/definition17.js +223 -0
  206. package/shared/definition18.js +78 -0
  207. package/shared/definition19.js +87 -0
  208. package/shared/definition2.js +106 -0
  209. package/shared/definition20.js +44 -0
  210. package/shared/definition21.js +1078 -0
  211. package/shared/definition22.js +261 -0
  212. package/shared/definition23.js +348 -0
  213. package/shared/definition24.js +1529 -0
  214. package/shared/definition25.js +351 -0
  215. package/shared/definition26.js +18 -0
  216. package/shared/definition27.js +75 -0
  217. package/shared/definition28.js +31 -0
  218. package/shared/definition29.js +56 -0
  219. package/shared/definition3.js +29 -0
  220. package/shared/definition30.js +94 -0
  221. package/shared/definition31.js +77 -0
  222. package/shared/definition32.js +45 -0
  223. package/shared/definition33.js +435 -0
  224. package/shared/definition34.js +86 -0
  225. package/shared/definition35.js +592 -0
  226. package/shared/definition36.js +147 -0
  227. package/shared/definition37.js +279 -0
  228. package/shared/definition38.js +119 -0
  229. package/shared/definition39.js +77 -0
  230. package/shared/definition4.js +19 -0
  231. package/shared/definition5.js +38 -0
  232. package/shared/definition6.js +60 -0
  233. package/shared/definition7.js +45 -0
  234. package/shared/definition8.js +113 -0
  235. package/shared/definition9.js +107 -0
  236. package/shared/design-system/index.d.ts +1 -2
  237. package/shared/dialog-polyfill.esm.js +858 -0
  238. package/shared/direction.js +20 -0
  239. package/shared/dom.js +8 -0
  240. package/shared/enums.js +70 -0
  241. package/shared/es.object.assign.js +2 -3
  242. package/shared/es.regexp.to-string.js +59 -0
  243. package/shared/focus.js +5 -0
  244. package/shared/focus2.js +11 -0
  245. package/shared/form-associated.js +466 -0
  246. package/shared/form-elements.js +343 -0
  247. package/shared/icon.js +538 -567
  248. package/shared/index.js +1664 -83
  249. package/shared/key-codes.js +97 -0
  250. package/shared/numbers.js +25 -0
  251. package/shared/patterns/affix.d.ts +1 -1
  252. package/shared/patterns/focus.d.ts +3 -0
  253. package/shared/patterns/form-elements/form-elements.d.ts +31 -0
  254. package/shared/patterns/form-elements/index.d.ts +1 -0
  255. package/shared/patterns/index.d.ts +2 -0
  256. package/shared/radio.js +127 -0
  257. package/shared/ref.js +41 -0
  258. package/shared/slotted.js +1 -1
  259. package/shared/start-end.js +50 -0
  260. package/shared/string-trim.js +40 -0
  261. package/shared/text-anchor.js +0 -2
  262. package/shared/text-anchor.template.js +6 -5
  263. package/shared/to-string.js +51 -0
  264. package/side-drawer/index.js +5 -81
  265. package/slider/index.js +17 -0
  266. package/styles/core/all.css +86 -0
  267. package/styles/core/theme.css +11 -0
  268. package/styles/core/typography.css +80 -0
  269. package/styles/fonts/SpeziaCompleteVariableItalicWeb.woff2 +0 -0
  270. package/styles/fonts/SpeziaCompleteVariableUprightWeb.woff2 +0 -0
  271. package/styles/fonts/SpeziaMonoCompleteVariableWeb.woff2 +0 -0
  272. package/styles/fonts/spezia.css +9 -12
  273. package/styles/tokens/theme-dark.css +230 -0
  274. package/styles/tokens/theme-light.css +230 -0
  275. package/switch/index.js +17 -0
  276. package/text-anchor/index.js +12 -7
  277. package/text-area/index.js +22 -0
  278. package/text-field/index.js +22 -0
  279. package/tooltip/index.js +18 -55
  280. package/vivid.api.json +3769 -0
  281. package/lib/sidenav-item/index.d.ts +0 -3
  282. package/lib/text/index.d.ts +0 -2
  283. package/lib/text/text.d.ts +0 -10
  284. package/shared/index2.js +0 -21
  285. package/shared/object-set-prototype-of.js +0 -1009
  286. package/shared/style-inject.es.js +0 -28
  287. package/shared/web.dom-collections.iterator.js +0 -473
  288. package/sidenav-item/index.js +0 -39
  289. package/styles/themes/dark.css +0 -205
  290. package/styles/themes/light.css +0 -205
  291. package/text/index.js +0 -46
@@ -0,0 +1,458 @@
1
+ import { F as FoundationElement, U as DOM, _ as __decorate, a as attr, Z as nullableNumberConverter, N as observable, b as __metadata, h as html, r as registerFactorial } from '../shared/index.js';
2
+ import { B as Button, b as buttonElements } from '../shared/definition9.js';
3
+ import { D as Divider, d as dividerElements } from '../shared/definition18.js';
4
+ import { b as AffixIcon } from '../shared/affix.js';
5
+ import '../shared/focus.js';
6
+ import { D as DelegatesARIATextbox, f as formElements, g as getFeedbackTemplate } from '../shared/form-elements.js';
7
+ import { S as StartEnd } from '../shared/start-end.js';
8
+ import { a as applyMixins } from '../shared/apply-mixins.js';
9
+ import { F as FormAssociated } from '../shared/form-associated.js';
10
+ import { f as keyArrowDown, e as keyArrowUp } from '../shared/key-codes.js';
11
+ import '../shared/es.regexp.to-string.js';
12
+ import { S as Shape } from '../shared/enums.js';
13
+ import { f as focusTemplateFactory } from '../shared/focus2.js';
14
+ import { w as when } from '../shared/when.js';
15
+ import { r as ref } from '../shared/ref.js';
16
+ import { c as classNames } from '../shared/class-names.js';
17
+ import '../shared/definition3.js';
18
+ import '../shared/icon.js';
19
+ import '../shared/to-string.js';
20
+ import '../shared/string-trim.js';
21
+ import '../shared/_has.js';
22
+ import '../shared/definition4.js';
23
+ import '../shared/button.js';
24
+ import '../shared/aria-global.js';
25
+ import '../shared/aria.js';
26
+
27
+ class _NumberField extends FoundationElement {
28
+ }
29
+ /**
30
+ * A form-associated base class for the {@link @microsoft/fast-foundation#(NumberField:class)} component.
31
+ *
32
+ * @internal
33
+ */
34
+ class FormAssociatedNumberField extends FormAssociated(_NumberField) {
35
+ constructor() {
36
+ super(...arguments);
37
+ this.proxy = document.createElement("input");
38
+ }
39
+ }
40
+
41
+ /**
42
+ * A Number Field Custom HTML Element.
43
+ * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number | <input type="number" /> element }.
44
+ *
45
+ * @slot start - Content which can be provided before the number field input
46
+ * @slot end - Content which can be provided after the number field input
47
+ * @slot - The default slot for the label
48
+ * @slot step-up-glyph - The glyph for the step up control
49
+ * @slot step-down-glyph - The glyph for the step down control
50
+ * @csspart label - The label
51
+ * @csspart root - The element wrapping the control, including start and end slots
52
+ * @csspart control - The element representing the input
53
+ * @csspart controls - The step up and step down controls
54
+ * @csspart step-up - The step up control
55
+ * @csspart step-down - The step down control
56
+ * @fires input - Fires a custom 'input' event when the value has changed
57
+ * @fires change - Fires a custom 'change' event when the value has changed
58
+ *
59
+ * @public
60
+ */
61
+ class NumberField$1 extends FormAssociatedNumberField {
62
+ constructor() {
63
+ super(...arguments);
64
+ /**
65
+ * When true, spin buttons will not be rendered
66
+ * @public
67
+ * @remarks
68
+ * HTML Attribute: autofocus
69
+ */
70
+ this.hideStep = false;
71
+ /**
72
+ * Amount to increment or decrement the value by
73
+ * @public
74
+ * @remarks
75
+ * HTMLAttribute: step
76
+ */
77
+ this.step = 1;
78
+ /**
79
+ * Flag to indicate that the value change is from the user input
80
+ * @internal
81
+ */
82
+ this.isUserInput = false;
83
+ }
84
+ /**
85
+ * Ensures that the max is greater than the min and that the value
86
+ * is less than the max
87
+ * @param previous - the previous max value
88
+ * @param next - updated max value
89
+ *
90
+ * @internal
91
+ */
92
+ maxChanged(previous, next) {
93
+ var _a;
94
+ this.max = Math.max(next, (_a = this.min) !== null && _a !== void 0 ? _a : next);
95
+ const min = Math.min(this.min, this.max);
96
+ if (this.min !== undefined && this.min !== min) {
97
+ this.min = min;
98
+ }
99
+ this.value = this.getValidValue(this.value);
100
+ }
101
+ /**
102
+ * Ensures that the min is less than the max and that the value
103
+ * is greater than the min
104
+ * @param previous - previous min value
105
+ * @param next - updated min value
106
+ *
107
+ * @internal
108
+ */
109
+ minChanged(previous, next) {
110
+ var _a;
111
+ this.min = Math.min(next, (_a = this.max) !== null && _a !== void 0 ? _a : next);
112
+ const max = Math.max(this.min, this.max);
113
+ if (this.max !== undefined && this.max !== max) {
114
+ this.max = max;
115
+ }
116
+ this.value = this.getValidValue(this.value);
117
+ }
118
+ /**
119
+ * The value property, typed as a number.
120
+ *
121
+ * @public
122
+ */
123
+ get valueAsNumber() {
124
+ return parseFloat(super.value);
125
+ }
126
+ set valueAsNumber(next) {
127
+ this.value = next.toString();
128
+ }
129
+ /**
130
+ * Validates that the value is a number between the min and max
131
+ * @param previous - previous stored value
132
+ * @param next - value being updated
133
+ * @param updateControl - should the text field be updated with value, defaults to true
134
+ * @internal
135
+ */
136
+ valueChanged(previous, next) {
137
+ this.value = this.getValidValue(next);
138
+ if (next !== this.value) {
139
+ return;
140
+ }
141
+ if (this.control && !this.isUserInput) {
142
+ this.control.value = this.value;
143
+ }
144
+ super.valueChanged(previous, this.value);
145
+ if (previous !== undefined && !this.isUserInput) {
146
+ this.$emit("input");
147
+ this.$emit("change");
148
+ }
149
+ this.isUserInput = false;
150
+ }
151
+ /** {@inheritDoc (FormAssociated:interface).validate} */
152
+ validate() {
153
+ super.validate(this.control);
154
+ }
155
+ /**
156
+ * Sets the internal value to a valid number between the min and max properties
157
+ * @param value - user input
158
+ *
159
+ * @internal
160
+ */
161
+ getValidValue(value) {
162
+ var _a, _b;
163
+ let validValue = parseFloat(parseFloat(value).toPrecision(12));
164
+ if (isNaN(validValue)) {
165
+ validValue = "";
166
+ }
167
+ else {
168
+ validValue = Math.min(validValue, (_a = this.max) !== null && _a !== void 0 ? _a : validValue);
169
+ validValue = Math.max(validValue, (_b = this.min) !== null && _b !== void 0 ? _b : validValue).toString();
170
+ }
171
+ return validValue;
172
+ }
173
+ /**
174
+ * Increments the value using the step value
175
+ *
176
+ * @public
177
+ */
178
+ stepUp() {
179
+ const value = parseFloat(this.value);
180
+ const stepUpValue = !isNaN(value)
181
+ ? value + this.step
182
+ : this.min > 0
183
+ ? this.min
184
+ : this.max < 0
185
+ ? this.max
186
+ : !this.min
187
+ ? this.step
188
+ : 0;
189
+ this.value = stepUpValue.toString();
190
+ }
191
+ /**
192
+ * Decrements the value using the step value
193
+ *
194
+ * @public
195
+ */
196
+ stepDown() {
197
+ const value = parseFloat(this.value);
198
+ const stepDownValue = !isNaN(value)
199
+ ? value - this.step
200
+ : this.min > 0
201
+ ? this.min
202
+ : this.max < 0
203
+ ? this.max
204
+ : !this.min
205
+ ? 0 - this.step
206
+ : 0;
207
+ this.value = stepDownValue.toString();
208
+ }
209
+ /**
210
+ * Sets up the initial state of the number field
211
+ * @internal
212
+ */
213
+ connectedCallback() {
214
+ super.connectedCallback();
215
+ this.proxy.setAttribute("type", "number");
216
+ this.validate();
217
+ this.control.value = this.value;
218
+ if (this.autofocus) {
219
+ DOM.queueUpdate(() => {
220
+ this.focus();
221
+ });
222
+ }
223
+ }
224
+ /**
225
+ * Selects all the text in the number field
226
+ *
227
+ * @public
228
+ */
229
+ select() {
230
+ this.control.select();
231
+ /**
232
+ * The select event does not permeate the shadow DOM boundary.
233
+ * This fn effectively proxies the select event,
234
+ * emitting a `select` event whenever the internal
235
+ * control emits a `select` event
236
+ */
237
+ this.$emit("select");
238
+ }
239
+ /**
240
+ * Handles the internal control's `input` event
241
+ * @internal
242
+ */
243
+ handleTextInput() {
244
+ this.control.value = this.control.value.replace(/[^0-9\-+e.]/g, "");
245
+ this.isUserInput = true;
246
+ this.value = this.control.value;
247
+ }
248
+ /**
249
+ * Change event handler for inner control.
250
+ * @remarks
251
+ * "Change" events are not `composable` so they will not
252
+ * permeate the shadow DOM boundary. This fn effectively proxies
253
+ * the change event, emitting a `change` event whenever the internal
254
+ * control emits a `change` event
255
+ * @internal
256
+ */
257
+ handleChange() {
258
+ this.$emit("change");
259
+ }
260
+ /**
261
+ * Handles the internal control's `keydown` event
262
+ * @internal
263
+ */
264
+ handleKeyDown(e) {
265
+ const key = e.key;
266
+ switch (key) {
267
+ case keyArrowUp:
268
+ this.stepUp();
269
+ return false;
270
+ case keyArrowDown:
271
+ this.stepDown();
272
+ return false;
273
+ }
274
+ return true;
275
+ }
276
+ /**
277
+ * Handles populating the input field with a validated value when
278
+ * leaving the input field.
279
+ * @internal
280
+ */
281
+ handleBlur() {
282
+ this.control.value = this.value;
283
+ }
284
+ }
285
+ __decorate([
286
+ attr({ attribute: "readonly", mode: "boolean" })
287
+ ], NumberField$1.prototype, "readOnly", void 0);
288
+ __decorate([
289
+ attr({ mode: "boolean" })
290
+ ], NumberField$1.prototype, "autofocus", void 0);
291
+ __decorate([
292
+ attr({ attribute: "hide-step", mode: "boolean" })
293
+ ], NumberField$1.prototype, "hideStep", void 0);
294
+ __decorate([
295
+ attr
296
+ ], NumberField$1.prototype, "placeholder", void 0);
297
+ __decorate([
298
+ attr
299
+ ], NumberField$1.prototype, "list", void 0);
300
+ __decorate([
301
+ attr({ converter: nullableNumberConverter })
302
+ ], NumberField$1.prototype, "maxlength", void 0);
303
+ __decorate([
304
+ attr({ converter: nullableNumberConverter })
305
+ ], NumberField$1.prototype, "minlength", void 0);
306
+ __decorate([
307
+ attr({ converter: nullableNumberConverter })
308
+ ], NumberField$1.prototype, "size", void 0);
309
+ __decorate([
310
+ attr({ converter: nullableNumberConverter })
311
+ ], NumberField$1.prototype, "step", void 0);
312
+ __decorate([
313
+ attr({ converter: nullableNumberConverter })
314
+ ], NumberField$1.prototype, "max", void 0);
315
+ __decorate([
316
+ attr({ converter: nullableNumberConverter })
317
+ ], NumberField$1.prototype, "min", void 0);
318
+ __decorate([
319
+ observable
320
+ ], NumberField$1.prototype, "defaultSlottedNodes", void 0);
321
+ applyMixins(NumberField$1, StartEnd, DelegatesARIATextbox);
322
+
323
+ var css_248z = "/**\n * Do not edit directly\n * Generated on Wed, 14 Dec 2022 16:38:57 GMT\n */\n:host {\n display: inline-block;\n}\n\n.base {\n display: inline-grid;\n width: 100%;\n gap: 4px;\n grid-template-columns: min-content 1fr max-content;\n}\n.base {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--_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-neutral-800);\n --_appearance-color-fill: var(--vvd-color-neutral-200);\n --_appearance-color-outline: var(--vvd-color-neutral-500);\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}\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}\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}\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: 16px;\n padding-inline-start: 16px;\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: 20px;\n inset-inline-start: 16px;\n}\n.icon + .control {\n padding-inline-start: 44px;\n}\n\n.focus-indicator {\n --focus-stroke-gap-color: transparent;\n pointer-events: none;\n}\n.fieldset:not(:focus-visible, :focus-within) > .focus-indicator {\n display: none;\n}\n\n.control {\n padding-inline-end: 70px;\n}\n.control::-webkit-outer-spin-button, .control::-webkit-inner-spin-button {\n appearance: none;\n}\n.control-buttons {\n position: absolute;\n z-index: 1;\n right: 3px;\n display: flex;\n}\n.readonly .control-buttons, .disabled .control-buttons {\n pointer-events: none;\n}\n.control-buttons .divider {\n margin-block: 8px;\n}\n.control-buttons > * {\n flex-shrink: 0;\n}\n\n.disabled .focus-indicator {\n display: none;\n pointer-events: none;\n}";
324
+
325
+ let NumberField = class NumberField extends NumberField$1 {};
326
+ __decorate([attr, __metadata("design:type", String)], NumberField.prototype, "appearance", void 0);
327
+ __decorate([attr, __metadata("design:type", String)], NumberField.prototype, "shape", void 0);
328
+ __decorate([attr, __metadata("design:type", String)], NumberField.prototype, "autoComplete", void 0);
329
+ NumberField = __decorate([formElements], NumberField);
330
+ applyMixins(NumberField, AffixIcon);
331
+
332
+ let _ = t => t,
333
+ _t,
334
+ _t2,
335
+ _t3;
336
+ const ADD = 1;
337
+ const SUBTRACT = -1;
338
+ const getStateClasses = ({
339
+ errorValidationMessage,
340
+ disabled,
341
+ value,
342
+ readOnly,
343
+ placeholder,
344
+ appearance,
345
+ shape,
346
+ label,
347
+ successText
348
+ }) => 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]);
349
+ function renderLabel() {
350
+ return html(_t || (_t = _`
351
+ <label for="control" class="label">
352
+ ${0}
353
+ </label>`), x => x.label);
354
+ }
355
+ function adjustValueByStep(numberField, direction = ADD) {
356
+ numberField.value = (Number(numberField.value) + direction * (numberField.step ? numberField.step : 1)).toString();
357
+ }
358
+ function setControlButtonShape(numberField) {
359
+ return numberField.shape === Shape.Pill ? Shape.Pill : null;
360
+ }
361
+ function getTabIndex(numberField) {
362
+ return numberField.disabled || numberField.readOnly ? '-1' : null;
363
+ }
364
+ function numberControlButtons(context) {
365
+ const buttonTag = context.tagFor(Button);
366
+ const dividerTag = context.tagFor(Divider);
367
+ return html(_t2 || (_t2 = _`
368
+ <div class="control-buttons"
369
+ ?inert="${0}">
370
+ <${0} id="subtract" icon="minus-line"
371
+ aria-controls="control"
372
+ shape="${0}"
373
+ size="condensed"
374
+ tabindex="${0}"
375
+ @click="${0}"></${0}>
376
+ <${0} class="divider" orientation="vertical"></${0}>
377
+ <${0} id="add" icon="plus-line"
378
+ aria-controls="control"
379
+ shape="${0}"
380
+ size="condensed"
381
+ tabindex="${0}"
382
+ @click="${0}"></${0}>
383
+ </div>
384
+ `), x => x.disabled || x.readOnly, buttonTag, setControlButtonShape, getTabIndex, x => adjustValueByStep(x, SUBTRACT), buttonTag, dividerTag, dividerTag, buttonTag, setControlButtonShape, getTabIndex, x => adjustValueByStep(x), buttonTag);
385
+ }
386
+ const NumberFieldTemplate = context => {
387
+ const focusTemplate = focusTemplateFactory(context);
388
+ return html(_t3 || (_t3 = _`
389
+ <div class="base ${0}">
390
+ ${0}
391
+ <div class="fieldset">
392
+ <input class="control"
393
+ id="control"
394
+ @input="${0}"
395
+ @change="${0}"
396
+ ?autofocus="${0}"
397
+ ?disabled="${0}"
398
+ list="${0}"
399
+ step="${0}"
400
+ max="${0}"
401
+ min="${0}"
402
+ maxlength="${0}"
403
+ minlength="${0}"
404
+ placeholder="${0}"
405
+ ?readonly="${0}"
406
+ ?required="${0}"
407
+ size="${0}"
408
+ autocomplete="${0}"
409
+ name="${0}"
410
+ ?spellcheck="${0}"
411
+ :value="${0}"
412
+ type="text"
413
+ aria-atomic="${0}"
414
+ aria-busy="${0}"
415
+ aria-controls="${0}"
416
+ aria-current="${0}"
417
+ aria-describedby="${0}"
418
+ aria-details="${0}"
419
+ aria-disabled="${0}"
420
+ aria-errormessage="${0}"
421
+ aria-flowto="${0}"
422
+ aria-haspopup="${0}"
423
+ aria-hidden="${0}"
424
+ aria-invalid="${0}"
425
+ aria-keyshortcuts="${0}"
426
+ aria-label="${0}"
427
+ aria-labelledby="${0}"
428
+ aria-live="${0}"
429
+ aria-owns="${0}"
430
+ aria-relevant="${0}"
431
+ aria-roledescription="${0}"
432
+ ${0}
433
+ />
434
+ ${0}
435
+ ${0}
436
+ </div>
437
+ ${0}
438
+ ${0}
439
+ ${0}
440
+ </div>
441
+ `), 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 => {
442
+ var _a;
443
+ return !x.successText && !x.errorValidationMessage && ((_a = x.helperText) === null || _a === void 0 ? void 0 : _a.length);
444
+ }, getFeedbackTemplate('helper', context)), when(x => !x.successText && x.errorValidationMessage, getFeedbackTemplate('error', context)), when(x => x.successText, getFeedbackTemplate('success', context)));
445
+ };
446
+
447
+ const numberField = NumberField.compose({
448
+ baseName: 'number-field',
449
+ template: NumberFieldTemplate,
450
+ styles: css_248z,
451
+ shadowOptions: {
452
+ delegatesFocus: true
453
+ }
454
+ })();
455
+ const numberFieldElement = [numberField, ...buttonElements, ...dividerElements];
456
+ const registerNumberField = registerFactorial(numberFieldElement);
457
+
458
+ registerNumberField();
@@ -0,0 +1,20 @@
1
+ import { r as registerOption } from '../shared/definition22.js';
2
+ import '../shared/index.js';
3
+ import '../shared/definition3.js';
4
+ import '../shared/icon.js';
5
+ import '../shared/to-string.js';
6
+ import '../shared/string-trim.js';
7
+ import '../shared/_has.js';
8
+ import '../shared/when.js';
9
+ import '../shared/class-names.js';
10
+ import '../shared/definition4.js';
11
+ import '../shared/focus.js';
12
+ import '../shared/affix.js';
13
+ import '../shared/aria-global.js';
14
+ import '../shared/start-end.js';
15
+ import '../shared/ref.js';
16
+ import '../shared/apply-mixins.js';
17
+ import '../shared/dom.js';
18
+ import '../shared/focus2.js';
19
+
20
+ registerOption();
package/package.json CHANGED
@@ -1,19 +1,71 @@
1
1
  {
2
2
  "name": "@vonage/vivid",
3
- "version": "3.0.0-next.12",
3
+ "version": "3.0.0-next.120",
4
4
  "type": "module",
5
- "module": "./index.esm.js",
6
- "main": "index.js",
5
+ "module": "./index.js",
6
+ "main": "./index.js",
7
+ "customElements": "./custom-elements.json",
8
+ "homepage": "https://vivid.deno.dev",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/vonage/vivid-3",
12
+ "directory": "libs/components"
13
+ },
14
+ "bugs": {
15
+ "url": "https://github.com/Vonage/vivid-3/issues"
16
+ },
17
+ "license": "Apache-2.0",
7
18
  "exports": {
8
- "import": "./index.js"
19
+ ".": "./index.js",
20
+ "./accordion": "./accordion",
21
+ "./accordion-item": "./accordion-item",
22
+ "./action-group": "./action-group",
23
+ "./avatar": "./avatar",
24
+ "./badge": "./badge",
25
+ "./banner": "./banner",
26
+ "./breadcrumb": "./breadcrumb",
27
+ "./breadcrumb-item": "./breadcrumb-item",
28
+ "./button": "./button",
29
+ "./calendar": "./calendar",
30
+ "./calendar-event": "./calendar-event",
31
+ "./card": "./card",
32
+ "./checkbox": "./checkbox",
33
+ "./elevation": "./elevation",
34
+ "./dialog": "./dialog",
35
+ "./divider": "./divider",
36
+ "./fab": "./fab",
37
+ "./icon": "./icon",
38
+ "./layout": "./layout",
39
+ "./listbox": "./listbox",
40
+ "./menu": "./menu",
41
+ "./menu-item": "./menu-item",
42
+ "./nav": "./nav",
43
+ "./nav-disclosure": "./nav-disclosure",
44
+ "./nav-item": "./nav-item",
45
+ "./number-field": "./number-field",
46
+ "./note": "./note",
47
+ "./option": "./option",
48
+ "./popup": "./popup",
49
+ "./progress": "./progress",
50
+ "./progress-ring": "./progress-ring",
51
+ "./radio": "./radio",
52
+ "./radio-group": "./radio-group",
53
+ "./side-drawer": "./side-drawer",
54
+ "./slider": "./slider",
55
+ "./switch": "./switch",
56
+ "./text-field": "./text-field",
57
+ "./text-area": "./text-area",
58
+ "./tooltip": "./tooltip"
9
59
  },
10
- "typings": "./index.d.ts",
60
+ "types": "./index.d.ts",
11
61
  "dependencies": {
12
- "@microsoft/fast-element": "^1.9.0",
13
- "@microsoft/fast-foundation": "^2.41.1",
14
- "@microsoft/fast-web-utilities": "^5.2.0",
15
- "ramda": "^0.27.2",
16
- "@floating-ui/dom": "^0.4.0"
62
+ "rollup-plugin-postcss": "4.0.2",
63
+ "@microsoft/fast-element": "1.11.0",
64
+ "@microsoft/fast-foundation": "2.47.0",
65
+ "@microsoft/fast-web-utilities": "5.4.1",
66
+ "ramda": "0.27.2",
67
+ "dialog-polyfill": "0.5.6",
68
+ "@floating-ui/dom": "0.5.4"
17
69
  },
18
70
  "peerDependencies": {}
19
71
  }