@vonage/vivid 3.0.0 → 3.0.1

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 (323) hide show
  1. package/README.md +176 -4
  2. package/accordion/index.js +22 -61
  3. package/accordion-item/index.js +16 -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 +10 -133
  14. package/checkbox/index.js +16 -0
  15. package/combobox/index.js +35 -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 +6 -0
  22. package/icon/index.js +8 -36
  23. package/index.js +76 -26
  24. package/layout/index.js +4 -52
  25. package/lib/accordion/accordion.d.ts +3 -7
  26. package/lib/accordion/accordion.template.d.ts +1 -2
  27. package/lib/accordion/definition.d.ts +1 -0
  28. package/lib/accordion/index.d.ts +1 -2
  29. package/lib/accordion-item/accordion-item.d.ts +2 -6
  30. package/lib/accordion-item/accordion-item.template.d.ts +4 -4
  31. package/lib/accordion-item/definition.d.ts +1 -0
  32. package/lib/accordion-item/index.d.ts +1 -3
  33. package/lib/action-group/action-group.d.ts +10 -0
  34. package/lib/{sidenav-item/sidenav-item.template.d.ts → action-group/action-group.template.d.ts} +2 -2
  35. package/lib/action-group/definition.d.ts +1 -0
  36. package/lib/action-group/index.d.ts +1 -0
  37. package/lib/avatar/avatar.d.ts +15 -0
  38. package/lib/avatar/avatar.template.d.ts +4 -0
  39. package/lib/avatar/definition.d.ts +1 -0
  40. package/lib/avatar/index.d.ts +1 -0
  41. package/lib/badge/badge.d.ts +2 -4
  42. package/lib/badge/definition.d.ts +3 -0
  43. package/lib/badge/index.d.ts +1 -3
  44. package/lib/banner/banner.d.ts +1 -1
  45. package/lib/banner/banner.template.d.ts +0 -2
  46. package/lib/banner/definition.d.ts +1 -0
  47. package/lib/banner/index.d.ts +1 -2
  48. package/lib/breadcrumb/breadcrumb.template.d.ts +4 -0
  49. package/lib/breadcrumb/definition.d.ts +1 -0
  50. package/lib/breadcrumb/index.d.ts +1 -2
  51. package/lib/breadcrumb-item/definition.d.ts +1 -0
  52. package/lib/breadcrumb-item/index.d.ts +1 -3
  53. package/lib/button/button.d.ts +3 -2
  54. package/lib/button/definition.d.ts +1 -0
  55. package/lib/button/index.d.ts +1 -21
  56. package/lib/calendar/calendar.d.ts +3 -1
  57. package/lib/calendar/definition.d.ts +1 -0
  58. package/lib/calendar/index.d.ts +1 -3
  59. package/lib/calendar-event/calendar-event.d.ts +14 -0
  60. package/lib/calendar-event/calendar-event.template.d.ts +4 -0
  61. package/lib/calendar-event/definition.d.ts +1 -0
  62. package/lib/calendar-event/index.d.ts +1 -0
  63. package/lib/card/card.d.ts +2 -2
  64. package/lib/card/definition.d.ts +1 -0
  65. package/lib/card/index.d.ts +1 -5
  66. package/lib/checkbox/checkbox.d.ts +5 -0
  67. package/lib/checkbox/checkbox.template.d.ts +4 -0
  68. package/lib/checkbox/definition.d.ts +1 -0
  69. package/lib/checkbox/index.d.ts +1 -0
  70. package/lib/combobox/combobox.d.ts +14 -0
  71. package/lib/combobox/combobox.template.d.ts +4 -0
  72. package/lib/combobox/definition.d.ts +3 -0
  73. package/lib/combobox/index.d.ts +1 -0
  74. package/lib/components.d.ts +44 -16
  75. package/lib/dialog/definition.d.ts +1 -0
  76. package/lib/dialog/dialog.d.ts +23 -0
  77. package/lib/dialog/dialog.template.d.ts +4 -0
  78. package/lib/dialog/index.d.ts +1 -0
  79. package/lib/divider/definition.d.ts +1 -0
  80. package/lib/divider/divider.d.ts +3 -0
  81. package/lib/divider/divider.template.d.ts +4 -0
  82. package/lib/divider/index.d.ts +1 -0
  83. package/lib/elevation/definition.d.ts +1 -0
  84. package/lib/elevation/elevation.d.ts +1 -0
  85. package/lib/elevation/index.d.ts +1 -2
  86. package/lib/enums.d.ts +19 -6
  87. package/lib/fab/definition.d.ts +3 -0
  88. package/lib/fab/fab.d.ts +13 -0
  89. package/lib/fab/fab.template.d.ts +4 -0
  90. package/lib/fab/index.d.ts +1 -0
  91. package/lib/focus/definition.d.ts +3 -0
  92. package/lib/focus/index.d.ts +1 -2
  93. package/lib/{sidenav-item/index.d.ts → header/definition.d.ts} +2 -2
  94. package/lib/header/header.d.ts +5 -0
  95. package/lib/header/header.template.d.ts +4 -0
  96. package/lib/header/index.d.ts +1 -0
  97. package/lib/icon/definition.d.ts +3 -0
  98. package/lib/icon/icon.d.ts +5 -6
  99. package/lib/icon/index.d.ts +1 -2
  100. package/lib/layout/definition.d.ts +3 -0
  101. package/lib/layout/index.d.ts +1 -2
  102. package/lib/layout/layout.d.ts +4 -4
  103. package/lib/listbox/definition.d.ts +3 -0
  104. package/lib/listbox/index.d.ts +1 -0
  105. package/lib/listbox/listbox.d.ts +6 -0
  106. package/lib/listbox/listbox.template.d.ts +4 -0
  107. package/lib/menu/definition.d.ts +11 -0
  108. package/lib/menu/index.d.ts +1 -0
  109. package/lib/menu/menu.d.ts +10 -0
  110. package/lib/menu/menu.template.d.ts +3 -0
  111. package/lib/menu-item/definition.d.ts +3 -0
  112. package/lib/menu-item/index.d.ts +1 -0
  113. package/lib/menu-item/menu-item.d.ts +8 -0
  114. package/lib/menu-item/menu-item.template.d.ts +5 -0
  115. package/lib/nav/definition.d.ts +3 -0
  116. package/lib/nav/index.d.ts +1 -0
  117. package/lib/nav/nav.d.ts +3 -0
  118. package/lib/nav/nav.template.d.ts +4 -0
  119. package/lib/nav-disclosure/definition.d.ts +3 -0
  120. package/lib/nav-disclosure/index.d.ts +1 -0
  121. package/lib/nav-disclosure/nav-disclosure.d.ts +10 -0
  122. package/lib/nav-disclosure/nav-disclosure.template.d.ts +4 -0
  123. package/lib/nav-item/definition.d.ts +3 -0
  124. package/lib/nav-item/index.d.ts +1 -0
  125. package/lib/{sidenav-item/sidenav-item.d.ts → nav-item/nav-item.d.ts} +2 -2
  126. package/lib/nav-item/nav-item.template.d.ts +4 -0
  127. package/lib/note/definition.d.ts +3 -0
  128. package/lib/note/index.d.ts +1 -0
  129. package/lib/note/note.d.ts +10 -0
  130. package/lib/{text/text.template.d.ts → note/note.template.d.ts} +2 -2
  131. package/lib/number-field/definition.d.ts +4 -0
  132. package/lib/number-field/index.d.ts +1 -0
  133. package/lib/number-field/number-field.d.ts +14 -0
  134. package/lib/number-field/number-field.template.d.ts +4 -0
  135. package/lib/option/definition.d.ts +3 -0
  136. package/lib/option/index.d.ts +1 -0
  137. package/lib/option/option.d.ts +9 -0
  138. package/lib/option/option.template.d.ts +4 -0
  139. package/lib/popup/definition.d.ts +4 -0
  140. package/lib/popup/index.d.ts +1 -4
  141. package/lib/popup/popup.d.ts +8 -4
  142. package/lib/progress/definition.d.ts +3 -0
  143. package/lib/progress/index.d.ts +1 -2
  144. package/lib/progress/progress.d.ts +1 -1
  145. package/lib/progress-ring/definition.d.ts +3 -0
  146. package/lib/progress-ring/index.d.ts +1 -2
  147. package/lib/progress-ring/progress-ring.d.ts +2 -1
  148. package/lib/radio/definition.d.ts +3 -0
  149. package/lib/radio/index.d.ts +1 -0
  150. package/lib/radio/radio.d.ts +4 -0
  151. package/lib/radio/radio.template.d.ts +4 -0
  152. package/lib/radio-group/definition.d.ts +11 -0
  153. package/lib/radio-group/index.d.ts +1 -0
  154. package/lib/radio-group/radio-group.d.ts +4 -0
  155. package/lib/radio-group/radio-group.template.d.ts +4 -0
  156. package/lib/select/definition.d.ts +3 -0
  157. package/lib/select/index.d.ts +1 -0
  158. package/lib/select/select.d.ts +17 -0
  159. package/lib/select/select.template.d.ts +4 -0
  160. package/lib/side-drawer/definition.d.ts +3 -0
  161. package/lib/side-drawer/index.d.ts +1 -2
  162. package/lib/side-drawer/side-drawer.d.ts +3 -2
  163. package/lib/slider/definition.d.ts +3 -0
  164. package/lib/slider/index.d.ts +1 -0
  165. package/lib/slider/slider.d.ts +4 -0
  166. package/lib/slider/slider.template.d.ts +4 -0
  167. package/lib/switch/definition.d.ts +3 -0
  168. package/lib/switch/index.d.ts +1 -0
  169. package/lib/switch/switch.d.ts +7 -0
  170. package/lib/switch/switch.template.d.ts +4 -0
  171. package/lib/tab/definition.d.ts +3 -0
  172. package/lib/tab/index.d.ts +1 -0
  173. package/lib/tab/tab.d.ts +9 -0
  174. package/lib/tab/tab.template.d.ts +3 -0
  175. package/lib/tab-panel/definition.d.ts +3 -0
  176. package/lib/tab-panel/index.d.ts +1 -0
  177. package/lib/tab-panel/tab-panel.d.ts +3 -0
  178. package/lib/tab-panel/tab-panel.template.d.ts +2 -0
  179. package/lib/tabs/definition.d.ts +3 -0
  180. package/lib/tabs/index.d.ts +1 -0
  181. package/lib/tabs/tabs.d.ts +10 -0
  182. package/lib/tabs/tabs.template.d.ts +2 -0
  183. package/lib/text-anchor/definition.d.ts +3 -0
  184. package/lib/text-anchor/index.d.ts +1 -2
  185. package/lib/text-area/definition.d.ts +3 -0
  186. package/lib/text-area/index.d.ts +1 -0
  187. package/lib/text-area/text-area.d.ts +9 -0
  188. package/lib/text-area/text-area.template.d.ts +4 -0
  189. package/lib/text-field/definition.d.ts +3 -0
  190. package/lib/text-field/index.d.ts +1 -0
  191. package/lib/text-field/text-field.d.ts +14 -0
  192. package/lib/text-field/text-field.template.d.ts +4 -0
  193. package/lib/tooltip/definition.d.ts +3 -0
  194. package/lib/tooltip/index.d.ts +1 -3
  195. package/lib/tooltip/tooltip.d.ts +6 -6
  196. package/listbox/index.js +27 -0
  197. package/menu/index.js +30 -0
  198. package/menu-item/index.js +20 -0
  199. package/nav/index.js +4 -0
  200. package/nav-disclosure/index.js +17 -0
  201. package/nav-item/index.js +22 -0
  202. package/note/index.js +15 -0
  203. package/number-field/index.js +459 -0
  204. package/option/index.js +21 -0
  205. package/package.json +29 -18
  206. package/popup/index.js +21 -2062
  207. package/progress/index.js +6 -98
  208. package/progress-ring/index.js +6 -75
  209. package/radio/index.js +12 -0
  210. package/radio-group/index.js +11 -0
  211. package/select/index.js +34 -0
  212. package/shared/affix.js +2 -8
  213. package/shared/anchor.js +10 -2
  214. package/shared/apply-mixins.js +5 -4
  215. package/shared/aria-global.js +2 -86
  216. package/shared/aria.js +9 -0
  217. package/shared/base-progress.js +5 -0
  218. package/shared/breadcrumb-item.js +1 -1
  219. package/shared/button.js +200 -0
  220. package/shared/calendar-event.js +19 -0
  221. package/shared/definition.js +225 -0
  222. package/shared/definition10.js +99 -0
  223. package/shared/definition11.js +48 -0
  224. package/shared/definition12.js +1523 -0
  225. package/shared/definition13.js +111 -0
  226. package/shared/definition14.js +114 -0
  227. package/shared/definition15.js +32 -0
  228. package/shared/definition16.js +172 -0
  229. package/shared/definition17.js +727 -0
  230. package/shared/definition18.js +1842 -0
  231. package/shared/definition19.js +261 -0
  232. package/shared/definition2.js +150 -0
  233. package/shared/definition20.js +221 -0
  234. package/shared/definition21.js +78 -0
  235. package/shared/definition22.js +87 -0
  236. package/shared/definition23.js +58 -0
  237. package/shared/definition24.js +44 -0
  238. package/shared/definition25.js +58 -0
  239. package/shared/definition26.js +348 -0
  240. package/shared/definition27.js +363 -0
  241. package/shared/definition28.js +21 -0
  242. package/shared/definition29.js +75 -0
  243. package/shared/definition3.js +29 -0
  244. package/shared/definition30.js +31 -0
  245. package/shared/definition31.js +49 -0
  246. package/shared/definition32.js +94 -0
  247. package/shared/definition33.js +77 -0
  248. package/shared/definition34.js +45 -0
  249. package/shared/definition35.js +435 -0
  250. package/shared/definition36.js +634 -0
  251. package/shared/definition37.js +86 -0
  252. package/shared/definition38.js +592 -0
  253. package/shared/definition39.js +147 -0
  254. package/shared/definition4.js +19 -0
  255. package/shared/definition40.js +67 -0
  256. package/shared/definition41.js +32 -0
  257. package/shared/definition42.js +440 -0
  258. package/shared/definition43.js +282 -0
  259. package/shared/definition44.js +119 -0
  260. package/shared/definition45.js +77 -0
  261. package/shared/definition5.js +38 -0
  262. package/shared/definition6.js +60 -0
  263. package/shared/definition7.js +45 -0
  264. package/shared/definition8.js +113 -0
  265. package/shared/definition9.js +107 -0
  266. package/shared/design-system/index.d.ts +1 -1
  267. package/shared/dialog-polyfill.esm.js +858 -0
  268. package/shared/direction.js +20 -0
  269. package/shared/dom.js +8 -0
  270. package/shared/enums.js +70 -0
  271. package/shared/es.object.assign.js +2 -3
  272. package/shared/es.regexp.to-string.js +59 -0
  273. package/shared/focus.js +5 -0
  274. package/shared/focus2.js +11 -0
  275. package/shared/form-associated.js +466 -0
  276. package/shared/form-elements.js +127 -0
  277. package/shared/icon.js +538 -567
  278. package/shared/index.js +1664 -83
  279. package/shared/key-codes.js +97 -0
  280. package/shared/listbox.js +995 -0
  281. package/shared/numbers.js +34 -0
  282. package/shared/patterns/affix.d.ts +1 -1
  283. package/shared/patterns/focus.d.ts +3 -0
  284. package/shared/patterns/form-elements/form-elements.d.ts +43 -0
  285. package/shared/patterns/form-elements/index.d.ts +1 -0
  286. package/shared/patterns/index.d.ts +2 -0
  287. package/shared/radio.js +127 -0
  288. package/shared/ref.js +41 -0
  289. package/shared/select.options.js +10 -0
  290. package/shared/start-end.js +50 -0
  291. package/shared/string-trim.js +40 -0
  292. package/shared/strings.js +9 -0
  293. package/shared/text-anchor.js +0 -2
  294. package/shared/text-anchor.template.js +6 -5
  295. package/shared/text-field.js +3 -0
  296. package/shared/text-field2.js +225 -0
  297. package/shared/to-string.js +51 -0
  298. package/side-drawer/index.js +5 -81
  299. package/slider/index.js +17 -0
  300. package/styles/core/all.css +83 -0
  301. package/styles/core/theme.css +11 -0
  302. package/styles/core/typography.css +77 -0
  303. package/styles/tokens/theme-dark.css +228 -0
  304. package/styles/tokens/theme-light.css +228 -0
  305. package/switch/index.js +18 -0
  306. package/tab/index.js +16 -0
  307. package/tab-panel/index.js +4 -0
  308. package/tabs/index.js +24 -0
  309. package/text-anchor/index.js +11 -6
  310. package/text-area/index.js +23 -0
  311. package/text-field/index.js +24 -0
  312. package/tooltip/index.js +18 -55
  313. package/lib/text/index.d.ts +0 -2
  314. package/lib/text/text.d.ts +0 -10
  315. package/shared/index2.js +0 -21
  316. package/shared/object-set-prototype-of.js +0 -1009
  317. package/shared/style-inject.es.js +0 -28
  318. package/shared/web.dom-collections.iterator.js +0 -473
  319. package/sidenav-item/index.js +0 -39
  320. package/styles/fonts/spezia.css +0 -23
  321. package/styles/themes/dark.css +0 -205
  322. package/styles/themes/light.css +0 -205
  323. package/text/index.js +0 -46
@@ -0,0 +1,94 @@
1
+ import { c as classofRaw, G as _export, k as functionUncurryThis, _ as __decorate, a as attr, b as __metadata, h as html, r as registerFactory } from './index.js';
2
+ import { B as BaseProgress } from './base-progress.js';
3
+ import { w as when } from './when.js';
4
+ import { c as classNames } from './class-names.js';
5
+
6
+ var css_248z = "/**\n * Do not edit directly\n * Generated on Mon, 30 Jan 2023 11:28:31 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 --_connotation-color-primary: var(--vvd-color-cta-500);\n}\n.base:not(.connotation-pacific).connotation-alert {\n --_connotation-color-primary: var(--vvd-color-alert-500);\n}\n.base:not(.connotation-pacific).connotation-success {\n --_connotation-color-primary: var(--vvd-color-success-500);\n}\n.base:not(.connotation-pacific):not(.connotation-cta, .connotation-alert, .connotation-success) {\n --_connotation-color-primary: var(--vvd-color-canvas-text);\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 background-color: var(--vvd-color-neutral-100);\n block-size: 100%;\n inline-size: 100%;\n /* Shape */\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-color: 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}";
7
+
8
+ var classof = classofRaw;
9
+
10
+ // `IsArray` abstract operation
11
+ // https://tc39.es/ecma262/#sec-isarray
12
+ // eslint-disable-next-line es/no-array-isarray -- safe
13
+ var isArray$1 = Array.isArray || function isArray(argument) {
14
+ return classof(argument) == 'Array';
15
+ };
16
+
17
+ var $ = _export;
18
+ var uncurryThis = functionUncurryThis;
19
+ var isArray = isArray$1;
20
+
21
+ var nativeReverse = uncurryThis([].reverse);
22
+ var test = [1, 2];
23
+
24
+ // `Array.prototype.reverse` method
25
+ // https://tc39.es/ecma262/#sec-array.prototype.reverse
26
+ // fix for Safari 12.0 bug
27
+ // https://bugs.webkit.org/show_bug.cgi?id=188794
28
+ $({ target: 'Array', proto: true, forced: String(test) === String(test.reverse()) }, {
29
+ reverse: function reverse() {
30
+ // eslint-disable-next-line no-self-assign -- dirty hack
31
+ if (isArray(this)) this.length = this.length;
32
+ return nativeReverse(this);
33
+ }
34
+ });
35
+
36
+ class Progress extends BaseProgress {
37
+ constructor() {
38
+ super(...arguments);
39
+ this.reverse = false;
40
+ }
41
+ }
42
+ __decorate([attr(), __metadata("design:type", String)], Progress.prototype, "shape", void 0);
43
+ __decorate([attr(), __metadata("design:type", String)], Progress.prototype, "connotation", void 0);
44
+ __decorate([attr({
45
+ mode: 'boolean'
46
+ }), __metadata("design:type", Object)], Progress.prototype, "reverse", void 0);
47
+
48
+ let _2 = t => t,
49
+ _t,
50
+ _t2,
51
+ _t3;
52
+ const getClasses = ({
53
+ connotation,
54
+ shape,
55
+ reverse,
56
+ paused
57
+ }) => classNames('base', [`connotation-${connotation}`, Boolean(connotation)], [`shape-${shape}`, Boolean(shape)], ['reverse', Boolean(reverse)], ['paused', Boolean(paused)]);
58
+ function determinate() {
59
+ return html(_t || (_t = _2`
60
+ <span class="determinate" style="width: ${0}%"></span>`), x => x.percentComplete);
61
+ }
62
+ function indeterminate() {
63
+ return html(_t2 || (_t2 = _2`
64
+ <span class="indeterminate" name="indeterminate">
65
+ <span class="indicator-1"></span>
66
+ <span class="indicator-2"></span>
67
+ </span>`));
68
+ }
69
+ const ProgressTemplate = _ => {
70
+ return html(_t3 || (_t3 = _2`
71
+ <div
72
+ role="progressbar"
73
+ aria-valuenow="${0}"
74
+ aria-valuemin="${0}"
75
+ aria-valuemax="${0}"
76
+ class="${0}"
77
+ >
78
+ <div class="progress">
79
+ ${0}
80
+ ${0}
81
+ </div>
82
+ </div>
83
+ `), x => x.value, x => x.min, x => x.max, getClasses, when(x => typeof x.value === 'number', determinate()), when(x => typeof x.value !== 'number', indeterminate()));
84
+ };
85
+
86
+ const progressDefinition = Progress.compose({
87
+ baseName: 'progress',
88
+ template: ProgressTemplate,
89
+ styles: css_248z
90
+ });
91
+ const progressRegistries = [progressDefinition()];
92
+ const registerProgress = registerFactory(progressRegistries);
93
+
94
+ export { progressRegistries as a, progressDefinition as p, registerProgress as r };
@@ -0,0 +1,77 @@
1
+ import { _ as __decorate, a as attr, b as __metadata, h as html, r as registerFactory } from './index.js';
2
+ import { B as BaseProgress } from './base-progress.js';
3
+ import { w as when } from './when.js';
4
+ import { c as classNames } from './class-names.js';
5
+
6
+ var css_248z = "/**\n * Do not edit directly\n * Generated on Mon, 30 Jan 2023 11:28:31 GMT\n */\n.base {\n align-items: center;\n block-size: var(--_size);\n color: var(--_appearance-color-text);\n inline-size: var(--_size);\n outline: none;\n}\n.base.connotation-cta {\n --_connotation-color-primary: var(--vvd-color-cta-500);\n}\n.base.connotation-alert {\n --_connotation-color-primary: var(--vvd-color-alert-500);\n}\n.base.connotation-success {\n --_connotation-color-primary: var(--vvd-color-success-500);\n}\n.base:not(.connotation-cta, .connotation-alert, .connotation-success) {\n --_connotation-color-primary: var(--vvd-color-canvas-text);\n}\n.base {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base:where(:disabled, .disabled) {\n --_appearance-color-text: var(--vvd-color-neutral-400);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base.size--5 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 20));\n}\n.base.size--4 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 16));\n}\n.base.size--3 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 12));\n}\n.base.size--2 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 8));\n}\n.base.size--1 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 4));\n}\n.base.size-1 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 4));\n}\n.base.size-2 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 8));\n}\n.base.size-3 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 12));\n}\n.base.size-4 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 16));\n}\n.base.size-5 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 20));\n}\n.base:not(.size--5, .size--4, .size--3, .size--2, .size--1, .size-1, .size-2, .size-3, .size-4, .size-5) {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2)));\n}\n\n.progress {\n width: 100%;\n height: 100%;\n}\n\n.background {\n fill: none;\n stroke: transparent;\n stroke-width: 1px;\n}\n\n.determinate {\n fill: none;\n stroke: currentColor;\n stroke-linecap: round;\n stroke-width: 1px;\n transform: rotate(-90deg);\n transform-origin: 50% 50%;\n transition: all 0.2s ease-in-out;\n}\n\n.indeterminate-indicator-1 {\n animation: spin-infinite 2s linear infinite;\n fill: none;\n stroke: currentColor;\n stroke-linecap: round;\n stroke-width: 1px;\n transform: rotate(-90deg);\n transform-origin: 50% 50%;\n transition: all 0.2s ease-in-out;\n}\n\n.base.paused .indeterminate-indicator-1 {\n animation-play-state: paused;\n}\n\n@keyframes spin-infinite {\n 0% {\n stroke-dasharray: 0.01px 43.97px;\n transform: rotate(0deg);\n }\n 50% {\n stroke-dasharray: 21.99px 21.99px;\n transform: rotate(450deg);\n }\n 100% {\n stroke-dasharray: 0.01px 43.97px;\n transform: rotate(1080deg);\n }\n}";
7
+
8
+ class ProgressRing extends BaseProgress {}
9
+ __decorate([attr, __metadata("design:type", String)], ProgressRing.prototype, "connotation", void 0);
10
+ __decorate([attr, __metadata("design:type", Number)], ProgressRing.prototype, "size", void 0);
11
+
12
+ let _2 = t => t,
13
+ _t,
14
+ _t2,
15
+ _t3;
16
+ const getClasses = ({
17
+ connotation,
18
+ size,
19
+ paused
20
+ }) => classNames('base', ['disabled', !!paused], [`connotation-${connotation}`, !!connotation], [`size-${size}`, !!size]);
21
+ const progressSegments = 44;
22
+ const ProgressRingTemplate = _ => html(_t || (_t = _2`
23
+ <div
24
+ role="progressbar"
25
+ aria-valuenow="${0}"
26
+ aria-valuemin="${0}"
27
+ aria-valuemax="${0}"
28
+ class="${0} ${0}"
29
+ >
30
+ ${0}
31
+ ${0}
32
+ </div>
33
+ `), x => x.value, x => x.min, x => x.max, x => x.paused ? 'paused' : '', getClasses, when(x => typeof x.value === 'number', html(_t2 || (_t2 = _2`
34
+ <svg
35
+ class="progress"
36
+ viewBox="0 0 16 16"
37
+ >
38
+ <circle
39
+ class="background"
40
+ cx="8px"
41
+ cy="8px"
42
+ r="7px"
43
+ ></circle>
44
+ <circle
45
+ class="determinate"
46
+ style="stroke-dasharray: ${0}px ${0}px"
47
+ cx="8px"
48
+ cy="8px"
49
+ r="7px"
50
+ ></circle>
51
+ </svg>
52
+ `), x => progressSegments * x.percentComplete / 100, progressSegments)), when(x => typeof x.value !== 'number', html(_t3 || (_t3 = _2`
53
+ <svg class="progress" viewBox="0 0 16 16">
54
+ <circle
55
+ class="background"
56
+ cx="8px"
57
+ cy="8px"
58
+ r="7px"
59
+ ></circle>
60
+ <circle
61
+ class="indeterminate-indicator-1"
62
+ cx="8px"
63
+ cy="8px"
64
+ r="7px"
65
+ ></circle>
66
+ </svg>
67
+ `))));
68
+
69
+ const progressRingDefinition = ProgressRing.compose({
70
+ baseName: 'progress-ring',
71
+ template: ProgressRingTemplate,
72
+ styles: css_248z
73
+ });
74
+ const progressRingRegistries = [progressRingDefinition()];
75
+ const registerProgressRing = registerFactory(progressRingRegistries);
76
+
77
+ export { progressRingRegistries as a, progressRingDefinition as p, registerProgressRing as r };
@@ -0,0 +1,45 @@
1
+ import { h as html, r as registerFactory } from './index.js';
2
+ import { f as focusRegistries } from './definition4.js';
3
+ import { R as Radio } from './radio.js';
4
+ import { f as focusTemplateFactory } from './focus2.js';
5
+ import { w as when } from './when.js';
6
+ import { c as classNames } from './class-names.js';
7
+
8
+ var css_248z = "/**\n * Do not edit directly\n * Generated on Mon, 30 Jan 2023 11:28:31 GMT\n */\n@supports selector(:focus-visible) {\n :host(:focus) {\n outline: none;\n }\n}\n.base {\n display: inline-flex;\n align-items: center;\n cursor: pointer;\n gap: 8px;\n}\n.base {\n --_connotation-color-primary: var(--vvd-color-canvas-text);\n --_connotation-color-firm: var(--vvd-color-canvas-text);\n --_connotation-color-faint: var(--vvd-color-neutral-50);\n --_connotation-color-soft: var(--vvd-color-neutral-100);\n}\n.base {\n --_appearance-color-text: var(--_connotation-color-firm);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: var(--_connotation-color-firm);\n}\n.base:where(:hover, .hover):where(:not(:disabled, .disabled, .readonly)) {\n --_appearance-color-text: var(--_connotation-color-firm);\n --_appearance-color-fill: var(--_connotation-color-faint);\n --_appearance-color-outline: var(--_connotation-color-firm);\n}\n.base:where(:active, .active):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--_connotation-color-firm);\n --_appearance-color-fill: var(--_connotation-color-soft);\n --_appearance-color-outline: var(--_connotation-color-firm);\n}\n.base:where(:checked, .checked):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: var(--_connotation-color-primary);\n}\n.base:where(:checked, .checked):where(:hover, .hover) {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-faint);\n --_appearance-color-outline: var(--_connotation-color-primary);\n}\n.base:where(:disabled, .disabled) {\n --_appearance-color-text: var(--vvd-color-neutral-400);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: var(--vvd-color-neutral-400);\n}\n.base:where(.readonly):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--vvd-color-neutral-400);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: var(--vvd-color-neutral-400);\n}\n@supports (user-select: none) {\n .base {\n user-select: none;\n }\n}\n.base.disabled {\n cursor: not-allowed;\n pointer-events: none;\n}\n\n.control {\n position: relative;\n flex-shrink: 0;\n background-color: var(--_appearance-color-fill);\n block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 20));\n border-radius: 50%;\n box-shadow: inset 0 0 0 2px var(--_appearance-color-outline);\n inline-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 20));\n}\n.control::after {\n position: absolute;\n background-color: var(--_appearance-color-text);\n border-radius: inherit;\n content: \"\";\n inset: 5px;\n}\n.base:not(.checked) .control::after {\n display: none;\n}\n\nlabel {\n color: var(--vvd-color-canvas-text);\n cursor: pointer;\n font: var(--vvd-typography-base);\n}\n\n.focus-indicator {\n --focus-inset: -3px;\n --focus-stroke-gap-color: transparent;\n border-radius: 50%;\n}\n:host(:not(:focus-visible)) .focus-indicator {\n display: none;\n}";
9
+
10
+ let _ = t => t,
11
+ _t,
12
+ _t2;
13
+ const getClasses = ({
14
+ checked,
15
+ readOnly,
16
+ disabled
17
+ }) => classNames('base', ['checked', Boolean(checked)], ['readonly', Boolean(readOnly)], ['disabled', Boolean(disabled)]);
18
+ const RadioTemplate = context => {
19
+ const focusTemplate = focusTemplateFactory(context);
20
+ return html(_t || (_t = _`
21
+ <span class="${0}"
22
+ role="radio"
23
+ aria-checked="${0}"
24
+ aria-required="${0}"
25
+ aria-disabled="${0}"
26
+ @keypress="${0}"
27
+ @click="${0}"
28
+ >
29
+ <div class="control">
30
+ ${0}
31
+ </div>
32
+ ${0}
33
+ </span>
34
+ `), getClasses, x => x.checked, x => x.required, x => x.disabled, (x, c) => x.keypressHandler(c.event), (x, c) => x.clickHandler(c.event), () => focusTemplate, when(x => x.label, html(_t2 || (_t2 = _`<label class="label">${0}</label>`), x => x.label)));
35
+ };
36
+
37
+ const radioDefinition = Radio.compose({
38
+ baseName: 'radio',
39
+ template: RadioTemplate,
40
+ styles: css_248z
41
+ });
42
+ const radioRegistries = [radioDefinition(), ...focusRegistries];
43
+ const registerRadio = registerFactory(radioRegistries);
44
+
45
+ export { radioDefinition as a, radioRegistries as b, registerRadio as r };
@@ -0,0 +1,435 @@
1
+ import { F as FoundationElement, _ as __decorate, a as attr, o as observable, b as __metadata, h as html, r as registerFactory } from './index.js';
2
+ import { D as Direction, g as getDirection } from './direction.js';
3
+ import { i as keyArrowRight, h as keyArrowLeft, A as ArrowKeys, c as keyArrowUp, b as keyArrowDown, d as keyEnter } from './key-codes.js';
4
+ import { O as Orientation } from './aria.js';
5
+ import { R as Radio } from './radio.js';
6
+ import { s as slotted, e as elements } from './slotted.js';
7
+ import { w as when } from './when.js';
8
+
9
+ /**
10
+ * An Radio Group Custom HTML Element.
11
+ * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#radiogroup | ARIA radiogroup }.
12
+ *
13
+ * @slot label - The slot for the label
14
+ * @slot - The default slot for radio buttons
15
+ * @csspart positioning-region - The positioning region for laying out the radios
16
+ * @fires change - Fires a custom 'change' event when the value changes
17
+ *
18
+ * @public
19
+ */
20
+ class RadioGroup$1 extends FoundationElement {
21
+ constructor() {
22
+ super(...arguments);
23
+ /**
24
+ * The orientation of the group
25
+ *
26
+ * @public
27
+ * @remarks
28
+ * HTML Attribute: orientation
29
+ */
30
+ this.orientation = Orientation.horizontal;
31
+ this.radioChangeHandler = (e) => {
32
+ const changedRadio = e.target;
33
+ if (changedRadio.checked) {
34
+ this.slottedRadioButtons.forEach((radio) => {
35
+ if (radio !== changedRadio) {
36
+ radio.checked = false;
37
+ if (!this.isInsideFoundationToolbar) {
38
+ radio.setAttribute("tabindex", "-1");
39
+ }
40
+ }
41
+ });
42
+ this.selectedRadio = changedRadio;
43
+ this.value = changedRadio.value;
44
+ changedRadio.setAttribute("tabindex", "0");
45
+ this.focusedRadio = changedRadio;
46
+ }
47
+ e.stopPropagation();
48
+ };
49
+ this.moveToRadioByIndex = (group, index) => {
50
+ const radio = group[index];
51
+ if (!this.isInsideToolbar) {
52
+ radio.setAttribute("tabindex", "0");
53
+ if (radio.readOnly) {
54
+ this.slottedRadioButtons.forEach((nextRadio) => {
55
+ if (nextRadio !== radio) {
56
+ nextRadio.setAttribute("tabindex", "-1");
57
+ }
58
+ });
59
+ }
60
+ else {
61
+ radio.checked = true;
62
+ this.selectedRadio = radio;
63
+ }
64
+ }
65
+ this.focusedRadio = radio;
66
+ radio.focus();
67
+ };
68
+ this.moveRightOffGroup = () => {
69
+ var _a;
70
+ (_a = this.nextElementSibling) === null || _a === void 0 ? void 0 : _a.focus();
71
+ };
72
+ this.moveLeftOffGroup = () => {
73
+ var _a;
74
+ (_a = this.previousElementSibling) === null || _a === void 0 ? void 0 : _a.focus();
75
+ };
76
+ /**
77
+ * @internal
78
+ */
79
+ this.focusOutHandler = (e) => {
80
+ const group = this.slottedRadioButtons;
81
+ const radio = e.target;
82
+ const index = radio !== null ? group.indexOf(radio) : 0;
83
+ const focusedIndex = this.focusedRadio
84
+ ? group.indexOf(this.focusedRadio)
85
+ : -1;
86
+ if ((focusedIndex === 0 && index === focusedIndex) ||
87
+ (focusedIndex === group.length - 1 && focusedIndex === index)) {
88
+ if (!this.selectedRadio) {
89
+ this.focusedRadio = group[0];
90
+ this.focusedRadio.setAttribute("tabindex", "0");
91
+ group.forEach((nextRadio) => {
92
+ if (nextRadio !== this.focusedRadio) {
93
+ nextRadio.setAttribute("tabindex", "-1");
94
+ }
95
+ });
96
+ }
97
+ else {
98
+ this.focusedRadio = this.selectedRadio;
99
+ if (!this.isInsideFoundationToolbar) {
100
+ this.selectedRadio.setAttribute("tabindex", "0");
101
+ group.forEach((nextRadio) => {
102
+ if (nextRadio !== this.selectedRadio) {
103
+ nextRadio.setAttribute("tabindex", "-1");
104
+ }
105
+ });
106
+ }
107
+ }
108
+ }
109
+ return true;
110
+ };
111
+ /**
112
+ * @internal
113
+ */
114
+ this.clickHandler = (e) => {
115
+ const radio = e.target;
116
+ if (radio) {
117
+ const group = this.slottedRadioButtons;
118
+ if (radio.checked || group.indexOf(radio) === 0) {
119
+ radio.setAttribute("tabindex", "0");
120
+ this.selectedRadio = radio;
121
+ }
122
+ else {
123
+ radio.setAttribute("tabindex", "-1");
124
+ this.selectedRadio = null;
125
+ }
126
+ this.focusedRadio = radio;
127
+ }
128
+ e.preventDefault();
129
+ };
130
+ this.shouldMoveOffGroupToTheRight = (index, group, key) => {
131
+ return index === group.length && this.isInsideToolbar && key === keyArrowRight;
132
+ };
133
+ this.shouldMoveOffGroupToTheLeft = (group, key) => {
134
+ const index = this.focusedRadio ? group.indexOf(this.focusedRadio) - 1 : 0;
135
+ return index < 0 && this.isInsideToolbar && key === keyArrowLeft;
136
+ };
137
+ this.checkFocusedRadio = () => {
138
+ if (this.focusedRadio !== null &&
139
+ !this.focusedRadio.readOnly &&
140
+ !this.focusedRadio.checked) {
141
+ this.focusedRadio.checked = true;
142
+ this.focusedRadio.setAttribute("tabindex", "0");
143
+ this.focusedRadio.focus();
144
+ this.selectedRadio = this.focusedRadio;
145
+ }
146
+ };
147
+ this.moveRight = (e) => {
148
+ const group = this.slottedRadioButtons;
149
+ let index = 0;
150
+ index = this.focusedRadio ? group.indexOf(this.focusedRadio) + 1 : 1;
151
+ if (this.shouldMoveOffGroupToTheRight(index, group, e.key)) {
152
+ this.moveRightOffGroup();
153
+ return;
154
+ }
155
+ else if (index === group.length) {
156
+ index = 0;
157
+ }
158
+ /* looping to get to next radio that is not disabled */
159
+ /* matching native radio/radiogroup which does not select an item if there is only 1 in the group */
160
+ while (index < group.length && group.length > 1) {
161
+ if (!group[index].disabled) {
162
+ this.moveToRadioByIndex(group, index);
163
+ break;
164
+ }
165
+ else if (this.focusedRadio && index === group.indexOf(this.focusedRadio)) {
166
+ break;
167
+ }
168
+ else if (index + 1 >= group.length) {
169
+ if (this.isInsideToolbar) {
170
+ break;
171
+ }
172
+ else {
173
+ index = 0;
174
+ }
175
+ }
176
+ else {
177
+ index += 1;
178
+ }
179
+ }
180
+ };
181
+ this.moveLeft = (e) => {
182
+ const group = this.slottedRadioButtons;
183
+ let index = 0;
184
+ index = this.focusedRadio ? group.indexOf(this.focusedRadio) - 1 : 0;
185
+ index = index < 0 ? group.length - 1 : index;
186
+ if (this.shouldMoveOffGroupToTheLeft(group, e.key)) {
187
+ this.moveLeftOffGroup();
188
+ return;
189
+ }
190
+ /* looping to get to next radio that is not disabled */
191
+ while (index >= 0 && group.length > 1) {
192
+ if (!group[index].disabled) {
193
+ this.moveToRadioByIndex(group, index);
194
+ break;
195
+ }
196
+ else if (this.focusedRadio && index === group.indexOf(this.focusedRadio)) {
197
+ break;
198
+ }
199
+ else if (index - 1 < 0) {
200
+ index = group.length - 1;
201
+ }
202
+ else {
203
+ index -= 1;
204
+ }
205
+ }
206
+ };
207
+ /**
208
+ * keyboard handling per https://w3c.github.io/aria-practices/#for-radio-groups-not-contained-in-a-toolbar
209
+ * navigation is different when there is an ancestor with role='toolbar'
210
+ *
211
+ * @internal
212
+ */
213
+ this.keydownHandler = (e) => {
214
+ const key = e.key;
215
+ if (key in ArrowKeys && this.isInsideFoundationToolbar) {
216
+ return true;
217
+ }
218
+ switch (key) {
219
+ case keyEnter: {
220
+ this.checkFocusedRadio();
221
+ break;
222
+ }
223
+ case keyArrowRight:
224
+ case keyArrowDown: {
225
+ if (this.direction === Direction.ltr) {
226
+ this.moveRight(e);
227
+ }
228
+ else {
229
+ this.moveLeft(e);
230
+ }
231
+ break;
232
+ }
233
+ case keyArrowLeft:
234
+ case keyArrowUp: {
235
+ if (this.direction === Direction.ltr) {
236
+ this.moveLeft(e);
237
+ }
238
+ else {
239
+ this.moveRight(e);
240
+ }
241
+ break;
242
+ }
243
+ default: {
244
+ return true;
245
+ }
246
+ }
247
+ };
248
+ }
249
+ readOnlyChanged() {
250
+ if (this.slottedRadioButtons !== undefined) {
251
+ this.slottedRadioButtons.forEach((radio) => {
252
+ if (this.readOnly) {
253
+ radio.readOnly = true;
254
+ }
255
+ else {
256
+ radio.readOnly = false;
257
+ }
258
+ });
259
+ }
260
+ }
261
+ disabledChanged() {
262
+ if (this.slottedRadioButtons !== undefined) {
263
+ this.slottedRadioButtons.forEach((radio) => {
264
+ if (this.disabled) {
265
+ radio.disabled = true;
266
+ }
267
+ else {
268
+ radio.disabled = false;
269
+ }
270
+ });
271
+ }
272
+ }
273
+ nameChanged() {
274
+ if (this.slottedRadioButtons) {
275
+ this.slottedRadioButtons.forEach((radio) => {
276
+ radio.setAttribute("name", this.name);
277
+ });
278
+ }
279
+ }
280
+ valueChanged() {
281
+ if (this.slottedRadioButtons) {
282
+ this.slottedRadioButtons.forEach((radio) => {
283
+ if (radio.value === this.value) {
284
+ radio.checked = true;
285
+ this.selectedRadio = radio;
286
+ }
287
+ });
288
+ }
289
+ this.$emit("change");
290
+ }
291
+ slottedRadioButtonsChanged(oldValue, newValue) {
292
+ if (this.slottedRadioButtons && this.slottedRadioButtons.length > 0) {
293
+ this.setupRadioButtons();
294
+ }
295
+ }
296
+ get parentToolbar() {
297
+ return this.closest('[role="toolbar"]');
298
+ }
299
+ get isInsideToolbar() {
300
+ var _a;
301
+ return ((_a = this.parentToolbar) !== null && _a !== void 0 ? _a : false);
302
+ }
303
+ get isInsideFoundationToolbar() {
304
+ var _a;
305
+ return !!((_a = this.parentToolbar) === null || _a === void 0 ? void 0 : _a["$fastController"]);
306
+ }
307
+ /**
308
+ * @internal
309
+ */
310
+ connectedCallback() {
311
+ super.connectedCallback();
312
+ this.direction = getDirection(this);
313
+ this.setupRadioButtons();
314
+ }
315
+ disconnectedCallback() {
316
+ this.slottedRadioButtons.forEach((radio) => {
317
+ radio.removeEventListener("change", this.radioChangeHandler);
318
+ });
319
+ }
320
+ setupRadioButtons() {
321
+ const checkedRadios = this.slottedRadioButtons.filter((radio) => {
322
+ return radio.hasAttribute("checked");
323
+ });
324
+ const numberOfCheckedRadios = checkedRadios ? checkedRadios.length : 0;
325
+ if (numberOfCheckedRadios > 1) {
326
+ const lastCheckedRadio = checkedRadios[numberOfCheckedRadios - 1];
327
+ lastCheckedRadio.checked = true;
328
+ }
329
+ let foundMatchingVal = false;
330
+ this.slottedRadioButtons.forEach((radio) => {
331
+ if (this.name !== undefined) {
332
+ radio.setAttribute("name", this.name);
333
+ }
334
+ if (this.disabled) {
335
+ radio.disabled = true;
336
+ }
337
+ if (this.readOnly) {
338
+ radio.readOnly = true;
339
+ }
340
+ if (this.value && this.value === radio.value) {
341
+ this.selectedRadio = radio;
342
+ this.focusedRadio = radio;
343
+ radio.checked = true;
344
+ radio.setAttribute("tabindex", "0");
345
+ foundMatchingVal = true;
346
+ }
347
+ else {
348
+ if (!this.isInsideFoundationToolbar) {
349
+ radio.setAttribute("tabindex", "-1");
350
+ }
351
+ radio.checked = false;
352
+ }
353
+ radio.addEventListener("change", this.radioChangeHandler);
354
+ });
355
+ if (this.value === undefined && this.slottedRadioButtons.length > 0) {
356
+ const checkedRadios = this.slottedRadioButtons.filter((radio) => {
357
+ return radio.hasAttribute("checked");
358
+ });
359
+ const numberOfCheckedRadios = checkedRadios !== null ? checkedRadios.length : 0;
360
+ if (numberOfCheckedRadios > 0 && !foundMatchingVal) {
361
+ const lastCheckedRadio = checkedRadios[numberOfCheckedRadios - 1];
362
+ lastCheckedRadio.checked = true;
363
+ this.focusedRadio = lastCheckedRadio;
364
+ lastCheckedRadio.setAttribute("tabindex", "0");
365
+ }
366
+ else {
367
+ this.slottedRadioButtons[0].setAttribute("tabindex", "0");
368
+ this.focusedRadio = this.slottedRadioButtons[0];
369
+ }
370
+ }
371
+ }
372
+ }
373
+ __decorate([
374
+ attr({ attribute: "readonly", mode: "boolean" })
375
+ ], RadioGroup$1.prototype, "readOnly", void 0);
376
+ __decorate([
377
+ attr({ attribute: "disabled", mode: "boolean" })
378
+ ], RadioGroup$1.prototype, "disabled", void 0);
379
+ __decorate([
380
+ attr
381
+ ], RadioGroup$1.prototype, "name", void 0);
382
+ __decorate([
383
+ attr
384
+ ], RadioGroup$1.prototype, "value", void 0);
385
+ __decorate([
386
+ attr
387
+ ], RadioGroup$1.prototype, "orientation", void 0);
388
+ __decorate([
389
+ observable
390
+ ], RadioGroup$1.prototype, "childItems", void 0);
391
+ __decorate([
392
+ observable
393
+ ], RadioGroup$1.prototype, "slottedRadioButtons", void 0);
394
+
395
+ var css_248z = "/**\n * Do not edit directly\n * Generated on Mon, 30 Jan 2023 11:28:31 GMT\n */\n.positioning-region {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n}\n.positioning-region.vertical {\n flex-direction: column;\n}\nlabel + .positioning-region {\n margin-block-start: 8px;\n}\n\nlabel {\n color: var(--vvd-color-canvas-text);\n font: var(--vvd-typography-base);\n}";
396
+
397
+ class RadioGroup extends RadioGroup$1 {}
398
+ __decorate([attr, __metadata("design:type", String)], RadioGroup.prototype, "label", void 0);
399
+
400
+ let _ = t => t,
401
+ _t,
402
+ _t2;
403
+ const RadioGroupTemplate = context => {
404
+ return html(_t || (_t = _`
405
+ <template
406
+ role="radiogroup"
407
+ aria-disabled="${0}"
408
+ aria-readonly="${0}"
409
+ aria-orientation="${0}"
410
+ @click="${0}"
411
+ @keydown="${0}"
412
+ @focusout="${0}"
413
+ >
414
+
415
+ ${0}
416
+
417
+ <div class="positioning-region ${0}">
418
+ <slot ${0}></slot>
419
+ </div>
420
+ </template>
421
+ `), x => x.disabled, x => x.readOnly, x => x.orientation, (x, c) => x.clickHandler(c.event), (x, c) => x.keydownHandler(c.event), (x, c) => x.focusOutHandler(c.event), when(x => x.label, html(_t2 || (_t2 = _`<label>${0}</label>`), x => x.label)), x => x.orientation === Orientation.horizontal ? 'horizontal' : 'vertical', slotted({
422
+ property: 'slottedRadioButtons',
423
+ filter: elements(context.tagFor(Radio))
424
+ }));
425
+ };
426
+
427
+ const radioGroupDefinition = RadioGroup.compose({
428
+ baseName: 'radio-group',
429
+ template: RadioGroupTemplate,
430
+ styles: css_248z
431
+ });
432
+ const radioGroupRegistries = [radioGroupDefinition()];
433
+ const registerRadioGroup = registerFactory(radioGroupRegistries);
434
+
435
+ export { radioGroupDefinition as a, radioGroupRegistries as b, registerRadioGroup as r };