@vonage/vivid 3.51.0 → 3.53.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 (340) hide show
  1. package/README.md +1 -1
  2. package/accordion/index.cjs +1 -1
  3. package/accordion/index.js +1 -1
  4. package/accordion-item/index.cjs +1 -1
  5. package/accordion-item/index.js +1 -1
  6. package/alert/index.cjs +3 -3
  7. package/alert/index.js +3 -3
  8. package/appearance-ui/index.cjs +19 -11
  9. package/appearance-ui/index.js +19 -11
  10. package/audio-player/index.cjs +4 -3
  11. package/audio-player/index.js +4 -3
  12. package/avatar/index.cjs +1 -1
  13. package/avatar/index.js +1 -1
  14. package/badge/index.cjs +1 -1
  15. package/badge/index.js +1 -1
  16. package/banner/index.cjs +2 -2
  17. package/banner/index.js +2 -2
  18. package/breadcrumb-item/index.cjs +1 -1
  19. package/breadcrumb-item/index.js +1 -1
  20. package/button/index.cjs +2 -2
  21. package/button/index.js +2 -2
  22. package/card/index.cjs +2 -2
  23. package/card/index.js +2 -2
  24. package/checkbox/index.cjs +3 -2
  25. package/checkbox/index.js +3 -2
  26. package/combobox/index.cjs +5 -8
  27. package/combobox/index.js +5 -8
  28. package/custom-elements.json +2310 -769
  29. package/data-grid/index.cjs +1 -1
  30. package/data-grid/index.js +1 -1
  31. package/date-picker/index.cjs +7 -9
  32. package/date-picker/index.js +7 -9
  33. package/date-range-picker/index.cjs +7 -9
  34. package/date-range-picker/index.js +7 -9
  35. package/dial-pad/index.cjs +33 -0
  36. package/dial-pad/index.js +31 -0
  37. package/dialog/index.cjs +4 -4
  38. package/dialog/index.js +4 -4
  39. package/divider/index.cjs +1 -1
  40. package/divider/index.js +1 -1
  41. package/elevation/index.cjs +1 -1
  42. package/elevation/index.js +1 -1
  43. package/empty-state/index.cjs +2 -2
  44. package/empty-state/index.js +2 -2
  45. package/fab/index.cjs +2 -2
  46. package/fab/index.js +2 -2
  47. package/file-picker/index.cjs +4 -5
  48. package/file-picker/index.js +4 -5
  49. package/header/index.cjs +2 -2
  50. package/header/index.js +2 -2
  51. package/icon/index.cjs +1 -1
  52. package/icon/index.js +1 -1
  53. package/index.cjs +135 -123
  54. package/index.js +48 -46
  55. package/layout/index.cjs +1 -1
  56. package/layout/index.js +1 -1
  57. package/lib/avatar/definition.d.ts +1 -1
  58. package/lib/button/button.d.ts +1 -0
  59. package/lib/button/definition.d.ts +1 -1
  60. package/lib/calendar-event/definition.d.ts +1 -1
  61. package/lib/components.d.ts +3 -0
  62. package/lib/dial-pad/definition.d.ts +3 -0
  63. package/lib/dial-pad/dial-pad.d.ts +14 -0
  64. package/lib/dial-pad/dial-pad.template.d.ts +4 -0
  65. package/lib/dial-pad/locale.d.ts +18 -0
  66. package/lib/enums.d.ts +6 -0
  67. package/lib/layout/definition.d.ts +1 -1
  68. package/lib/menu-item/menu-item.d.ts +3 -0
  69. package/lib/range-slider/definition.d.ts +3 -0
  70. package/lib/range-slider/locale.d.ts +4 -0
  71. package/lib/range-slider/range-slider.d.ts +32 -0
  72. package/lib/range-slider/range-slider.form-associated.d.ts +10 -0
  73. package/lib/range-slider/range-slider.template.d.ts +4 -0
  74. package/lib/range-slider/utils/lerp.d.ts +2 -0
  75. package/lib/range-slider/utils/roundToStepValue.d.ts +1 -0
  76. package/lib/slider/slider.template.d.ts +1 -0
  77. package/lib/split-button/definition.d.ts +1 -1
  78. package/lib/text-anchor/definition.d.ts +1 -0
  79. package/lib/text-anchor/text-anchor.d.ts +5 -0
  80. package/lib/video-player/definition.d.ts +3 -0
  81. package/lib/video-player/locale.d.ts +1 -0
  82. package/lib/video-player/video-player.d.ts +17 -0
  83. package/lib/video-player/video-player.template.d.ts +4 -0
  84. package/listbox/index.cjs +25 -24
  85. package/listbox/index.js +25 -24
  86. package/locales/en-GB.cjs +34 -0
  87. package/locales/en-GB.js +34 -0
  88. package/locales/en-US.cjs +202 -0
  89. package/locales/en-US.js +202 -0
  90. package/locales/ja-JP.cjs +202 -1
  91. package/locales/ja-JP.js +202 -1
  92. package/locales/zh-CN.cjs +203 -0
  93. package/locales/zh-CN.js +203 -0
  94. package/menu/index.cjs +7 -7
  95. package/menu/index.js +7 -7
  96. package/menu-item/index.cjs +4 -4
  97. package/menu-item/index.js +4 -4
  98. package/nav/index.cjs +1 -1
  99. package/nav/index.js +1 -1
  100. package/nav-disclosure/index.cjs +2 -2
  101. package/nav-disclosure/index.js +2 -2
  102. package/nav-item/index.cjs +2 -2
  103. package/nav-item/index.js +2 -2
  104. package/note/index.cjs +2 -2
  105. package/note/index.js +2 -2
  106. package/number-field/index.cjs +5 -6
  107. package/number-field/index.js +5 -6
  108. package/option/index.cjs +2 -2
  109. package/option/index.js +2 -2
  110. package/package.json +34 -34
  111. package/pagination/index.cjs +3 -3
  112. package/pagination/index.js +3 -3
  113. package/popup/index.cjs +4 -4
  114. package/popup/index.js +4 -4
  115. package/progress/index.cjs +1 -1
  116. package/progress/index.js +1 -1
  117. package/progress-ring/index.cjs +1 -1
  118. package/progress-ring/index.js +1 -1
  119. package/radio/index.cjs +1 -1
  120. package/radio/index.js +1 -1
  121. package/radio-group/index.cjs +1 -1
  122. package/radio-group/index.js +1 -1
  123. package/range-slider/index.cjs +22 -0
  124. package/range-slider/index.js +20 -0
  125. package/select/index.cjs +7 -6
  126. package/select/index.js +7 -6
  127. package/selectable-box/index.cjs +5 -4
  128. package/selectable-box/index.js +5 -4
  129. package/shared/Reflector.cjs +5 -1
  130. package/shared/Reflector.js +5 -1
  131. package/shared/affix.cjs +11 -4
  132. package/shared/affix.js +12 -4
  133. package/shared/anchored.cjs +8 -2
  134. package/shared/anchored.js +8 -2
  135. package/shared/applyMixinsWithObservables.cjs +15 -0
  136. package/shared/applyMixinsWithObservables.js +13 -0
  137. package/shared/definition.cjs +9 -4
  138. package/shared/definition.js +9 -4
  139. package/shared/definition10.cjs +5 -5
  140. package/shared/definition10.js +5 -5
  141. package/shared/definition11.cjs +77 -49
  142. package/shared/definition11.js +78 -50
  143. package/shared/definition12.cjs +12 -14
  144. package/shared/definition12.js +12 -14
  145. package/shared/definition13.cjs +118 -75
  146. package/shared/definition13.js +118 -75
  147. package/shared/definition14.cjs +34 -33
  148. package/shared/definition14.js +34 -33
  149. package/shared/definition15.cjs +24 -12
  150. package/shared/definition15.js +24 -12
  151. package/shared/definition16.cjs +38 -43
  152. package/shared/definition16.js +38 -43
  153. package/shared/definition17.cjs +126 -66
  154. package/shared/definition17.js +127 -67
  155. package/shared/definition18.cjs +31 -15
  156. package/shared/definition18.js +31 -15
  157. package/shared/definition19.cjs +117 -81
  158. package/shared/definition19.js +117 -81
  159. package/shared/definition2.cjs +10 -5
  160. package/shared/definition2.js +10 -5
  161. package/shared/definition20.cjs +187 -227
  162. package/shared/definition20.js +183 -223
  163. package/shared/definition21.cjs +262 -69
  164. package/shared/definition21.js +261 -67
  165. package/shared/definition22.cjs +66 -61
  166. package/shared/definition22.js +64 -60
  167. package/shared/definition23.cjs +42 -77
  168. package/shared/definition23.js +41 -76
  169. package/shared/definition24.cjs +65 -2350
  170. package/shared/definition24.js +64 -2349
  171. package/shared/definition25.cjs +2402 -48
  172. package/shared/definition25.js +2401 -47
  173. package/shared/definition26.cjs +62 -28
  174. package/shared/definition26.js +61 -27
  175. package/shared/definition27.cjs +28 -54
  176. package/shared/definition27.js +27 -53
  177. package/shared/definition28.cjs +39 -819
  178. package/shared/definition28.js +38 -817
  179. package/shared/definition29.cjs +893 -54
  180. package/shared/definition29.js +893 -55
  181. package/shared/definition3.cjs +7 -10
  182. package/shared/definition3.js +7 -10
  183. package/shared/definition30.cjs +69 -85
  184. package/shared/definition30.js +68 -84
  185. package/shared/definition31.cjs +86 -23
  186. package/shared/definition31.js +86 -23
  187. package/shared/definition32.cjs +24 -14
  188. package/shared/definition32.js +23 -13
  189. package/shared/definition33.cjs +11 -53
  190. package/shared/definition33.js +10 -52
  191. package/shared/definition34.cjs +28 -500
  192. package/shared/definition34.js +28 -500
  193. package/shared/definition35.cjs +447 -194
  194. package/shared/definition35.js +447 -192
  195. package/shared/definition36.cjs +258 -188
  196. package/shared/definition36.js +255 -187
  197. package/shared/definition37.cjs +204 -78
  198. package/shared/definition37.js +203 -76
  199. package/shared/definition38.cjs +55 -51
  200. package/shared/definition38.js +52 -49
  201. package/shared/definition39.cjs +65 -423
  202. package/shared/definition39.js +64 -422
  203. package/shared/definition4.cjs +24 -12
  204. package/shared/definition4.js +24 -12
  205. package/shared/definition40.cjs +447 -35
  206. package/shared/definition40.js +444 -32
  207. package/shared/definition41.cjs +35 -678
  208. package/shared/definition41.js +34 -677
  209. package/shared/definition42.cjs +544 -99
  210. package/shared/definition42.js +543 -98
  211. package/shared/definition43.cjs +696 -77
  212. package/shared/definition43.js +695 -76
  213. package/shared/definition44.cjs +113 -563
  214. package/shared/definition44.js +112 -561
  215. package/shared/definition45.cjs +77 -117
  216. package/shared/definition45.js +75 -115
  217. package/shared/definition46.cjs +474 -86
  218. package/shared/definition46.js +474 -87
  219. package/shared/definition47.cjs +140 -23
  220. package/shared/definition47.js +139 -22
  221. package/shared/definition48.cjs +132 -57
  222. package/shared/definition48.js +131 -56
  223. package/shared/definition49.cjs +18 -524
  224. package/shared/definition49.js +17 -523
  225. package/shared/definition5.cjs +20 -17
  226. package/shared/definition5.js +20 -17
  227. package/shared/definition50.cjs +73 -25
  228. package/shared/definition50.js +72 -24
  229. package/shared/definition51.cjs +506 -99
  230. package/shared/definition51.js +505 -99
  231. package/shared/definition52.cjs +29 -277
  232. package/shared/definition52.js +28 -276
  233. package/shared/definition53.cjs +97 -256
  234. package/shared/definition53.js +97 -255
  235. package/shared/definition54.cjs +287 -769
  236. package/shared/definition54.js +287 -769
  237. package/shared/definition55.cjs +305 -105
  238. package/shared/definition55.js +304 -104
  239. package/shared/definition56.cjs +841 -81
  240. package/shared/definition56.js +840 -80
  241. package/shared/definition57.cjs +153 -69
  242. package/shared/definition57.js +152 -68
  243. package/shared/definition58.cjs +138 -299
  244. package/shared/definition58.js +137 -298
  245. package/shared/definition59.cjs +72 -27
  246. package/shared/definition59.js +71 -26
  247. package/shared/definition6.cjs +4 -5
  248. package/shared/definition6.js +4 -5
  249. package/shared/definition60.cjs +279 -1780
  250. package/shared/definition60.js +278 -1779
  251. package/shared/definition61.cjs +65870 -11
  252. package/shared/definition61.js +65869 -11
  253. package/shared/definition62.cjs +50 -0
  254. package/shared/definition62.js +46 -0
  255. package/shared/definition63.cjs +1828 -0
  256. package/shared/definition63.js +1824 -0
  257. package/shared/definition7.cjs +8 -6
  258. package/shared/definition7.js +8 -6
  259. package/shared/definition8.cjs +27 -20
  260. package/shared/definition8.js +27 -20
  261. package/shared/definition9.cjs +7 -10
  262. package/shared/definition9.js +7 -10
  263. package/shared/enums.cjs +8 -0
  264. package/shared/enums.js +8 -1
  265. package/shared/icon.cjs +7 -2
  266. package/shared/icon.js +7 -2
  267. package/shared/index2.cjs +67 -38
  268. package/shared/index2.js +67 -38
  269. package/shared/key-codes2.cjs +8 -0
  270. package/shared/key-codes2.js +5 -1
  271. package/shared/listbox.cjs +1 -1
  272. package/shared/listbox.js +1 -1
  273. package/shared/localization/Locale.d.ts +6 -0
  274. package/shared/patterns/form-elements/form-elements.d.ts +2 -3
  275. package/shared/patterns/index.d.ts +0 -1
  276. package/shared/presentationDate.cjs +140 -81
  277. package/shared/presentationDate.js +140 -81
  278. package/shared/slider.template.cjs +71 -0
  279. package/shared/slider.template.js +67 -0
  280. package/shared/text-anchor.cjs +6 -0
  281. package/shared/text-anchor.js +6 -0
  282. package/shared/text-anchor.template.cjs +33 -33
  283. package/shared/text-anchor.template.js +33 -33
  284. package/shared/text-field.cjs +1 -1
  285. package/shared/text-field.js +1 -1
  286. package/shared/utils/applyMixinsWithObservables.d.ts +1 -0
  287. package/side-drawer/index.cjs +1 -1
  288. package/side-drawer/index.js +1 -1
  289. package/slider/index.cjs +2 -1
  290. package/slider/index.js +2 -1
  291. package/split-button/index.cjs +2 -2
  292. package/split-button/index.js +2 -2
  293. package/style.css +1 -0
  294. package/styles/core/all.css +1 -1
  295. package/styles/core/theme.css +1 -1
  296. package/styles/core/typography.css +1 -1
  297. package/styles/fonts/spezia-variable.css +39 -13
  298. package/styles/tokens/theme-dark.css +4 -4
  299. package/styles/tokens/theme-light.css +4 -4
  300. package/styles/tokens/vivid-2-compat.css +4 -2
  301. package/switch/index.cjs +2 -2
  302. package/switch/index.js +2 -2
  303. package/tab/index.cjs +2 -2
  304. package/tab/index.js +2 -2
  305. package/tab-panel/index.cjs +1 -1
  306. package/tab-panel/index.js +1 -1
  307. package/tabs/index.cjs +4 -4
  308. package/tabs/index.js +4 -4
  309. package/tag/index.cjs +2 -2
  310. package/tag/index.js +2 -2
  311. package/tag-group/index.cjs +1 -1
  312. package/tag-group/index.js +1 -1
  313. package/text-area/index.cjs +4 -3
  314. package/text-area/index.js +4 -3
  315. package/text-field/index.cjs +4 -6
  316. package/text-field/index.js +4 -6
  317. package/time-picker/index.cjs +8 -10
  318. package/time-picker/index.js +8 -10
  319. package/toggletip/index.cjs +5 -5
  320. package/toggletip/index.js +5 -5
  321. package/tooltip/index.cjs +5 -5
  322. package/tooltip/index.js +5 -5
  323. package/tree-item/index.cjs +2 -2
  324. package/tree-item/index.js +2 -2
  325. package/tree-view/index.cjs +1 -1
  326. package/tree-view/index.js +1 -1
  327. package/video-player/index.cjs +17 -0
  328. package/video-player/index.js +15 -0
  329. package/vivid.api.json +428 -1
  330. package/focus/index.cjs +0 -7
  331. package/focus/index.js +0 -5
  332. package/lib/focus/definition.d.ts +0 -3
  333. package/lib/focus/focus.d.ts +0 -3
  334. package/lib/focus/focus.template.d.ts +0 -4
  335. package/lib/popup/popup.d.ts +0 -21
  336. package/shared/focus.cjs +0 -8
  337. package/shared/focus.js +0 -6
  338. package/shared/focus2.cjs +0 -11
  339. package/shared/focus2.js +0 -9
  340. package/shared/patterns/focus.d.ts +0 -3
@@ -1,653 +1,6 @@
1
- import { F as FoundationElement, D as DOM, _ as __decorate, a as attr, o as observable, h as html, r as registerFactory } from './index.js';
2
- import { a as iconRegistries } from './definition26.js';
3
- import { A as AffixIcon, a as affixIconTemplateFactory } from './affix.js';
4
- import { a as applyMixins } from './apply-mixins.js';
5
- import { S as StartEnd } from './start-end.js';
6
- import { D as Direction, g as getDirection } from './direction.js';
7
- import { i as keyArrowLeft, h as keyArrowRight, a as keySpace, k as keyEnter, g as keyHome, d as keyEnd, e as keyArrowUp, f as keyArrowDown } from './key-codes.js';
8
- import { I as Icon } from './icon.js';
9
- import { b as anchored } from './anchored.js';
10
- import { i as isHTMLElement } from './dom.js';
11
- import { s as slotted, e as elements } from './slotted.js';
12
- import { w as when } from './when.js';
1
+ import { a as attr, F as FoundationElement, h as html, r as registerFactory } from './index.js';
13
2
  import { c as classNames } from './class-names.js';
14
3
 
15
- /**
16
- * Menu items roles.
17
- * @public
18
- */
19
- const MenuItemRole$1 = {
20
- /**
21
- * The menu item has a "menuitem" role
22
- */
23
- menuitem: "menuitem",
24
- /**
25
- * The menu item has a "menuitemcheckbox" role
26
- */
27
- menuitemcheckbox: "menuitemcheckbox",
28
- /**
29
- * The menu item has a "menuitemradio" role
30
- */
31
- menuitemradio: "menuitemradio",
32
- };
33
- /**
34
- * @internal
35
- */
36
- const roleForMenuItem = {
37
- [MenuItemRole$1.menuitem]: "menuitem",
38
- [MenuItemRole$1.menuitemcheckbox]: "menuitemcheckbox",
39
- [MenuItemRole$1.menuitemradio]: "menuitemradio",
40
- };
41
-
42
- /**
43
- * A Switch Custom HTML Element.
44
- * Implements {@link https://www.w3.org/TR/wai-aria-1.1/#menuitem | ARIA menuitem }, {@link https://www.w3.org/TR/wai-aria-1.1/#menuitemcheckbox | ARIA menuitemcheckbox}, or {@link https://www.w3.org/TR/wai-aria-1.1/#menuitemradio | ARIA menuitemradio }.
45
- *
46
- * @slot checked-indicator - The checked indicator
47
- * @slot radio-indicator - The radio indicator
48
- * @slot start - Content which can be provided before the menu item content
49
- * @slot end - Content which can be provided after the menu item content
50
- * @slot - The default slot for menu item content
51
- * @slot expand-collapse-indicator - The expand/collapse indicator
52
- * @slot submenu - Used to nest menu's within menu items
53
- * @csspart input-container - The element representing the visual checked or radio indicator
54
- * @csspart checkbox - The element wrapping the `menuitemcheckbox` indicator
55
- * @csspart radio - The element wrapping the `menuitemradio` indicator
56
- * @csspart content - The element wrapping the menu item content
57
- * @csspart expand-collapse-glyph-container - The element wrapping the expand collapse element
58
- * @csspart expand-collapse - The expand/collapse element
59
- * @csspart submenu-region - The container for the submenu, used for positioning
60
- * @fires expanded-change - Fires a custom 'expanded-change' event when the expanded state changes
61
- * @fires change - Fires a custom 'change' event when a non-submenu item with a role of `menuitemcheckbox`, `menuitemradio`, or `menuitem` is invoked
62
- *
63
- * @public
64
- */
65
- let MenuItem$1 = class MenuItem extends FoundationElement {
66
- constructor() {
67
- super(...arguments);
68
- /**
69
- * The role of the element.
70
- *
71
- * @public
72
- * @remarks
73
- * HTML Attribute: role
74
- */
75
- this.role = MenuItemRole$1.menuitem;
76
- /**
77
- * @internal
78
- */
79
- this.hasSubmenu = false;
80
- /**
81
- * Track current direction to pass to the anchored region
82
- *
83
- * @internal
84
- */
85
- this.currentDirection = Direction.ltr;
86
- this.focusSubmenuOnLoad = false;
87
- /**
88
- * @internal
89
- */
90
- this.handleMenuItemKeyDown = (e) => {
91
- if (e.defaultPrevented) {
92
- return false;
93
- }
94
- switch (e.key) {
95
- case keyEnter:
96
- case keySpace:
97
- this.invoke();
98
- return false;
99
- case keyArrowRight:
100
- //open/focus on submenu
101
- this.expandAndFocus();
102
- return false;
103
- case keyArrowLeft:
104
- //close submenu
105
- if (this.expanded) {
106
- this.expanded = false;
107
- this.focus();
108
- return false;
109
- }
110
- }
111
- return true;
112
- };
113
- /**
114
- * @internal
115
- */
116
- this.handleMenuItemClick = (e) => {
117
- if (e.defaultPrevented || this.disabled) {
118
- return false;
119
- }
120
- this.invoke();
121
- return false;
122
- };
123
- /**
124
- * @internal
125
- */
126
- this.submenuLoaded = () => {
127
- if (!this.focusSubmenuOnLoad) {
128
- return;
129
- }
130
- this.focusSubmenuOnLoad = false;
131
- if (this.hasSubmenu) {
132
- this.submenu.focus();
133
- this.setAttribute("tabindex", "-1");
134
- }
135
- };
136
- /**
137
- * @internal
138
- */
139
- this.handleMouseOver = (e) => {
140
- if (this.disabled || !this.hasSubmenu || this.expanded) {
141
- return false;
142
- }
143
- this.expanded = true;
144
- return false;
145
- };
146
- /**
147
- * @internal
148
- */
149
- this.handleMouseOut = (e) => {
150
- if (!this.expanded || this.contains(document.activeElement)) {
151
- return false;
152
- }
153
- this.expanded = false;
154
- return false;
155
- };
156
- /**
157
- * @internal
158
- */
159
- this.expandAndFocus = () => {
160
- if (!this.hasSubmenu) {
161
- return;
162
- }
163
- this.focusSubmenuOnLoad = true;
164
- this.expanded = true;
165
- };
166
- /**
167
- * @internal
168
- */
169
- this.invoke = () => {
170
- if (this.disabled) {
171
- return;
172
- }
173
- switch (this.role) {
174
- case MenuItemRole$1.menuitemcheckbox:
175
- this.checked = !this.checked;
176
- break;
177
- case MenuItemRole$1.menuitem:
178
- // update submenu
179
- this.updateSubmenu();
180
- if (this.hasSubmenu) {
181
- this.expandAndFocus();
182
- }
183
- else {
184
- this.$emit("change");
185
- }
186
- break;
187
- case MenuItemRole$1.menuitemradio:
188
- if (!this.checked) {
189
- this.checked = true;
190
- }
191
- break;
192
- }
193
- };
194
- /**
195
- * Gets the submenu element if any
196
- *
197
- * @internal
198
- */
199
- this.updateSubmenu = () => {
200
- this.submenu = this.domChildren().find((element) => {
201
- return element.getAttribute("role") === "menu";
202
- });
203
- this.hasSubmenu = this.submenu === undefined ? false : true;
204
- };
205
- }
206
- expandedChanged(oldValue) {
207
- if (this.$fastController.isConnected) {
208
- if (this.submenu === undefined) {
209
- return;
210
- }
211
- if (this.expanded === false) {
212
- this.submenu.collapseExpandedItem();
213
- }
214
- else {
215
- this.currentDirection = getDirection(this);
216
- }
217
- this.$emit("expanded-change", this, { bubbles: false });
218
- }
219
- }
220
- checkedChanged(oldValue, newValue) {
221
- if (this.$fastController.isConnected) {
222
- this.$emit("change");
223
- }
224
- }
225
- /**
226
- * @internal
227
- */
228
- connectedCallback() {
229
- super.connectedCallback();
230
- DOM.queueUpdate(() => {
231
- this.updateSubmenu();
232
- });
233
- if (!this.startColumnCount) {
234
- this.startColumnCount = 1;
235
- }
236
- this.observer = new MutationObserver(this.updateSubmenu);
237
- }
238
- /**
239
- * @internal
240
- */
241
- disconnectedCallback() {
242
- super.disconnectedCallback();
243
- this.submenu = undefined;
244
- if (this.observer !== undefined) {
245
- this.observer.disconnect();
246
- this.observer = undefined;
247
- }
248
- }
249
- /**
250
- * get an array of valid DOM children
251
- */
252
- domChildren() {
253
- return Array.from(this.children).filter(child => !child.hasAttribute("hidden"));
254
- }
255
- };
256
- __decorate([
257
- attr({ mode: "boolean" })
258
- ], MenuItem$1.prototype, "disabled", void 0);
259
- __decorate([
260
- attr({ mode: "boolean" })
261
- ], MenuItem$1.prototype, "expanded", void 0);
262
- __decorate([
263
- observable
264
- ], MenuItem$1.prototype, "startColumnCount", void 0);
265
- __decorate([
266
- attr
267
- ], MenuItem$1.prototype, "role", void 0);
268
- __decorate([
269
- attr({ mode: "boolean" })
270
- ], MenuItem$1.prototype, "checked", void 0);
271
- __decorate([
272
- observable
273
- ], MenuItem$1.prototype, "submenuRegion", void 0);
274
- __decorate([
275
- observable
276
- ], MenuItem$1.prototype, "hasSubmenu", void 0);
277
- __decorate([
278
- observable
279
- ], MenuItem$1.prototype, "currentDirection", void 0);
280
- __decorate([
281
- observable
282
- ], MenuItem$1.prototype, "submenu", void 0);
283
- applyMixins(MenuItem$1, StartEnd);
284
-
285
- /**
286
- * A Menu Custom HTML Element.
287
- * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#menu | ARIA menu }.
288
- *
289
- * @slot - The default slot for the menu items
290
- *
291
- * @public
292
- */
293
- let Menu$1 = class Menu extends FoundationElement {
294
- constructor() {
295
- super(...arguments);
296
- this.expandedItem = null;
297
- /**
298
- * The index of the focusable element in the items array
299
- * defaults to -1
300
- */
301
- this.focusIndex = -1;
302
- /**
303
- * @internal
304
- */
305
- this.isNestedMenu = () => {
306
- return (this.parentElement !== null &&
307
- isHTMLElement(this.parentElement) &&
308
- this.parentElement.getAttribute("role") === "menuitem");
309
- };
310
- /**
311
- * if focus is moving out of the menu, reset to a stable initial state
312
- * @internal
313
- */
314
- this.handleFocusOut = (e) => {
315
- if (!this.contains(e.relatedTarget) && this.menuItems !== undefined) {
316
- this.collapseExpandedItem();
317
- // find our first focusable element
318
- const focusIndex = this.menuItems.findIndex(this.isFocusableElement);
319
- // set the current focus index's tabindex to -1
320
- this.menuItems[this.focusIndex].setAttribute("tabindex", "-1");
321
- // set the first focusable element tabindex to 0
322
- this.menuItems[focusIndex].setAttribute("tabindex", "0");
323
- // set the focus index
324
- this.focusIndex = focusIndex;
325
- }
326
- };
327
- this.handleItemFocus = (e) => {
328
- const targetItem = e.target;
329
- if (this.menuItems !== undefined &&
330
- targetItem !== this.menuItems[this.focusIndex]) {
331
- this.menuItems[this.focusIndex].setAttribute("tabindex", "-1");
332
- this.focusIndex = this.menuItems.indexOf(targetItem);
333
- targetItem.setAttribute("tabindex", "0");
334
- }
335
- };
336
- this.handleExpandedChanged = (e) => {
337
- if (e.defaultPrevented ||
338
- e.target === null ||
339
- this.menuItems === undefined ||
340
- this.menuItems.indexOf(e.target) < 0) {
341
- return;
342
- }
343
- e.preventDefault();
344
- const changedItem = e.target;
345
- // closing an expanded item without opening another
346
- if (this.expandedItem !== null &&
347
- changedItem === this.expandedItem &&
348
- changedItem.expanded === false) {
349
- this.expandedItem = null;
350
- return;
351
- }
352
- if (changedItem.expanded) {
353
- if (this.expandedItem !== null && this.expandedItem !== changedItem) {
354
- this.expandedItem.expanded = false;
355
- }
356
- this.menuItems[this.focusIndex].setAttribute("tabindex", "-1");
357
- this.expandedItem = changedItem;
358
- this.focusIndex = this.menuItems.indexOf(changedItem);
359
- changedItem.setAttribute("tabindex", "0");
360
- }
361
- };
362
- this.removeItemListeners = () => {
363
- if (this.menuItems !== undefined) {
364
- this.menuItems.forEach((item) => {
365
- item.removeEventListener("expanded-change", this.handleExpandedChanged);
366
- item.removeEventListener("focus", this.handleItemFocus);
367
- });
368
- }
369
- };
370
- this.setItems = () => {
371
- const newItems = this.domChildren();
372
- this.removeItemListeners();
373
- this.menuItems = newItems;
374
- const menuItems = this.menuItems.filter(this.isMenuItemElement);
375
- // if our focus index is not -1 we have items
376
- if (menuItems.length) {
377
- this.focusIndex = 0;
378
- }
379
- function elementIndent(el) {
380
- const role = el.getAttribute("role");
381
- const startSlot = el.querySelector("[slot=start]");
382
- if (role !== MenuItemRole$1.menuitem && startSlot === null) {
383
- return 1;
384
- }
385
- else if (role === MenuItemRole$1.menuitem && startSlot !== null) {
386
- return 1;
387
- }
388
- else if (role !== MenuItemRole$1.menuitem && startSlot !== null) {
389
- return 2;
390
- }
391
- else {
392
- return 0;
393
- }
394
- }
395
- const indent = menuItems.reduce((accum, current) => {
396
- const elementValue = elementIndent(current);
397
- return accum > elementValue ? accum : elementValue;
398
- }, 0);
399
- menuItems.forEach((item, index) => {
400
- item.setAttribute("tabindex", index === 0 ? "0" : "-1");
401
- item.addEventListener("expanded-change", this.handleExpandedChanged);
402
- item.addEventListener("focus", this.handleItemFocus);
403
- if (item instanceof MenuItem$1) {
404
- item.startColumnCount = indent;
405
- }
406
- });
407
- };
408
- /**
409
- * handle change from child element
410
- */
411
- this.changeHandler = (e) => {
412
- if (this.menuItems === undefined) {
413
- return;
414
- }
415
- const changedMenuItem = e.target;
416
- const changeItemIndex = this.menuItems.indexOf(changedMenuItem);
417
- if (changeItemIndex === -1) {
418
- return;
419
- }
420
- if (changedMenuItem.role === "menuitemradio" &&
421
- changedMenuItem.checked === true) {
422
- for (let i = changeItemIndex - 1; i >= 0; --i) {
423
- const item = this.menuItems[i];
424
- const role = item.getAttribute("role");
425
- if (role === MenuItemRole$1.menuitemradio) {
426
- item.checked = false;
427
- }
428
- if (role === "separator") {
429
- break;
430
- }
431
- }
432
- const maxIndex = this.menuItems.length - 1;
433
- for (let i = changeItemIndex + 1; i <= maxIndex; ++i) {
434
- const item = this.menuItems[i];
435
- const role = item.getAttribute("role");
436
- if (role === MenuItemRole$1.menuitemradio) {
437
- item.checked = false;
438
- }
439
- if (role === "separator") {
440
- break;
441
- }
442
- }
443
- }
444
- };
445
- /**
446
- * check if the item is a menu item
447
- */
448
- this.isMenuItemElement = (el) => {
449
- return (isHTMLElement(el) &&
450
- Menu.focusableElementRoles.hasOwnProperty(el.getAttribute("role")));
451
- };
452
- /**
453
- * check if the item is focusable
454
- */
455
- this.isFocusableElement = (el) => {
456
- return this.isMenuItemElement(el);
457
- };
458
- }
459
- itemsChanged(oldValue, newValue) {
460
- // only update children after the component is connected and
461
- // the setItems has run on connectedCallback
462
- // (menuItems is undefined until then)
463
- if (this.$fastController.isConnected && this.menuItems !== undefined) {
464
- this.setItems();
465
- }
466
- }
467
- /**
468
- * @internal
469
- */
470
- connectedCallback() {
471
- super.connectedCallback();
472
- DOM.queueUpdate(() => {
473
- // wait until children have had a chance to
474
- // connect before setting/checking their props/attributes
475
- this.setItems();
476
- });
477
- this.addEventListener("change", this.changeHandler);
478
- }
479
- /**
480
- * @internal
481
- */
482
- disconnectedCallback() {
483
- super.disconnectedCallback();
484
- this.removeItemListeners();
485
- this.menuItems = undefined;
486
- this.removeEventListener("change", this.changeHandler);
487
- }
488
- /**
489
- * Focuses the first item in the menu.
490
- *
491
- * @public
492
- */
493
- focus() {
494
- this.setFocus(0, 1);
495
- }
496
- /**
497
- * Collapses any expanded menu items.
498
- *
499
- * @public
500
- */
501
- collapseExpandedItem() {
502
- if (this.expandedItem !== null) {
503
- this.expandedItem.expanded = false;
504
- this.expandedItem = null;
505
- }
506
- }
507
- /**
508
- * @internal
509
- */
510
- handleMenuKeyDown(e) {
511
- if (e.defaultPrevented || this.menuItems === undefined) {
512
- return;
513
- }
514
- switch (e.key) {
515
- case keyArrowDown:
516
- // go forward one index
517
- this.setFocus(this.focusIndex + 1, 1);
518
- return;
519
- case keyArrowUp:
520
- // go back one index
521
- this.setFocus(this.focusIndex - 1, -1);
522
- return;
523
- case keyEnd:
524
- // set focus on last item
525
- this.setFocus(this.menuItems.length - 1, -1);
526
- return;
527
- case keyHome:
528
- // set focus on first item
529
- this.setFocus(0, 1);
530
- return;
531
- default:
532
- // if we are not handling the event, do not prevent default
533
- return true;
534
- }
535
- }
536
- /**
537
- * get an array of valid DOM children
538
- */
539
- domChildren() {
540
- return Array.from(this.children).filter(child => !child.hasAttribute("hidden"));
541
- }
542
- setFocus(focusIndex, adjustment) {
543
- if (this.menuItems === undefined) {
544
- return;
545
- }
546
- while (focusIndex >= 0 && focusIndex < this.menuItems.length) {
547
- const child = this.menuItems[focusIndex];
548
- if (this.isFocusableElement(child)) {
549
- // change the previous index to -1
550
- if (this.focusIndex > -1 &&
551
- this.menuItems.length >= this.focusIndex - 1) {
552
- this.menuItems[this.focusIndex].setAttribute("tabindex", "-1");
553
- }
554
- // update the focus index
555
- this.focusIndex = focusIndex;
556
- // update the tabindex of next focusable element
557
- child.setAttribute("tabindex", "0");
558
- // focus the element
559
- child.focus();
560
- break;
561
- }
562
- focusIndex += adjustment;
563
- }
564
- }
565
- };
566
- Menu$1.focusableElementRoles = roleForMenuItem;
567
- __decorate([
568
- observable
569
- ], Menu$1.prototype, "items", void 0);
570
-
571
- const styles = ":host(:focus-visible){outline:none}:host([disabled]){pointer-events:none}.base{display:flex;box-sizing:border-box;align-items:center;background-color:var(--_appearance-color-fill);box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);gap:12px;inline-size:100%;padding-block:2px;padding-inline:16px}.base{--_appearance-color-text: var(--_connotation-color-primary);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.base:where(:hover,.hover):where(:not(:disabled,.disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-primary);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.base:where(:disabled,.disabled){--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.base:where(:active,.active):where(:not(:disabled,.disabled)){--_appearance-color-text: var(--_connotation-color-primary);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.base:where(.selected,[aria-current]):where(:not(:disabled,.disabled)){--_appearance-color-text: var(--_connotation-color-primary);--_appearance-color-fill: var(--_connotation-color-dim);--_appearance-color-outline: transparent}.base:where(.selected,[aria-current]):where(:hover,.hover):where(:not(:disabled,.disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-primary);--_appearance-color-fill: var(--_connotation-color-pale);--_appearance-color-outline: transparent}.base{--_connotation-color-primary: var(--vvd-menu-item-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-text: var(--vvd-menu-item-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-menu-item-accent-primary-increment, var(--vvd-color-neutral-800));--_connotation-color-faint: var(--vvd-menu-item-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-menu-item-accent-soft, var(--vvd-color-neutral-100));--_connotation-color-pale: var(--vvd-menu-item-accent-pale, var(--vvd-color-neutral-300));--_connotation-color-dim: var(--vvd-menu-item-accent-dim, var(--vvd-color-neutral-200))}.base:not(.two-lines){min-block-size:calc(1px*(40 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}.base.two-lines{min-block-size:calc(1px*(40 + 4*clamp(-1,var(--vvd-size-density, 0),2)) + 1px*(24 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}@supports (user-select: none){.base{user-select:none}}.base:not(.disabled){cursor:pointer}:host(:not([role=presentation]):focus-visible) .base{box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px));--focus-stroke-gap-color: transparent;border-radius:8px}.icon{flex-shrink:0;font-size:calc(1px*(40 + 4*clamp(-1,var(--vvd-size-density, 0),2))/2);line-height:1}.action,.decorative{display:flex;place-content:center}.action{color:var(--_appearance-color-text)}:host(:not([check-appearance],[aria-checked=true])) .action{color:var(--vvd-color-neutral-500)}.base.trailing .action,.base.has-meta .action{order:2}.base:not(.disabled) .decorative{color:var(--vvd-color-neutral-600)}.base.disabled .decorative{color:var(--vvd-color-neutral-200)}.base.has-meta .decorative{order:1}.chevron{order:3}.text{display:flex;overflow:hidden;flex-direction:column;margin-inline-end:auto}.text-primary,.text-secondary{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;color:var(--_appearance-color-text);font:var(--vvd-typography-base)}.text-primary{-webkit-line-clamp:var(--text-primary-line-clamp, 1)}.base.two-lines .text-primary{font:var(--vvd-typography-base-bold)}.text-secondary{-webkit-line-clamp:var(--text-secondary-line-clamp, 1)}.base.two-lines:not(.disabled) .text-secondary{color:var(--vvd-color-neutral-600)}\n";
572
-
573
- var __defProp$1 = Object.defineProperty;
574
- var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
575
- var __decorateClass$1 = (decorators, target, key, kind) => {
576
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target;
577
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
578
- if (decorator = decorators[i])
579
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
580
- if (kind && result)
581
- __defProp$1(target, key, result);
582
- return result;
583
- };
584
- const MenuItemRole = {
585
- ...MenuItemRole$1,
586
- presentation: "presentation"
587
- };
588
- var CheckAppearance = /* @__PURE__ */ ((CheckAppearance2) => {
589
- CheckAppearance2["Normal"] = "normal";
590
- CheckAppearance2["TickOnly"] = "tick-only";
591
- return CheckAppearance2;
592
- })(CheckAppearance || {});
593
- class MenuItem extends MenuItem$1 {
594
- constructor() {
595
- super();
596
- this.checkTrailing = false;
597
- this.#submenuArray = [];
598
- this.updateSubmenu = () => this.#updateSubmenu();
599
- this.addEventListener("expanded-change", this.#expandedChange);
600
- }
601
- #submenuArray;
602
- /**
603
- *
604
- *
605
- * @internal
606
- */
607
- slottedSubmenuChanged(_oldValue, newValue) {
608
- this.#submenuArray = newValue;
609
- }
610
- #updateSubmenu() {
611
- for (const submenu of this.#submenuArray) {
612
- this.submenu = submenu;
613
- this.submenu.anchor = this;
614
- this.submenu.placement = "right-start";
615
- this.submenu.collapseExpandedItem = () => this.#collapseExpandedItem();
616
- }
617
- this.hasSubmenu = this.submenu === void 0 ? false : true;
618
- }
619
- #collapseExpandedItem() {
620
- this.expanded = false;
621
- }
622
- #expandedChange() {
623
- if (this.hasSubmenu) {
624
- this.submenu.open = this.expanded;
625
- }
626
- }
627
- }
628
- __decorateClass$1([
629
- attr
630
- ], MenuItem.prototype, "text", 2);
631
- __decorateClass$1([
632
- attr({ attribute: "text-secondary" })
633
- ], MenuItem.prototype, "textSecondary", 2);
634
- __decorateClass$1([
635
- attr({ mode: "boolean", attribute: "check-trailing" })
636
- ], MenuItem.prototype, "checkTrailing", 2);
637
- __decorateClass$1([
638
- attr({ attribute: "check-appearance" })
639
- ], MenuItem.prototype, "checkedAppearance", 2);
640
- __decorateClass$1([
641
- observable
642
- ], MenuItem.prototype, "metaSlottedContent", 2);
643
- __decorateClass$1([
644
- observable
645
- ], MenuItem.prototype, "trailingMetaSlottedContent", 2);
646
- __decorateClass$1([
647
- observable
648
- ], MenuItem.prototype, "slottedSubmenu", 2);
649
- applyMixins(MenuItem, AffixIcon);
650
-
651
4
  var __defProp = Object.defineProperty;
652
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
653
6
  var __decorateClass = (decorators, target, key, kind) => {
@@ -659,185 +12,53 @@ var __decorateClass = (decorators, target, key, kind) => {
659
12
  __defProp(target, key, result);
660
13
  return result;
661
14
  };
662
- let Menu = class extends Menu$1 {
663
- constructor() {
664
- super();
665
- this.ariaLabel = null;
666
- this.placement = "bottom";
667
- this.autoDismiss = false;
668
- this.open = false;
669
- this.#openIfClosed = () => {
670
- if (!this.open)
671
- DOM.queueUpdate(() => this.open = true);
672
- };
673
- this.#updateClickOutsideListener = () => {
674
- document.removeEventListener("click", this.#closeOnClickOutside);
675
- if (this.autoDismiss && this.isConnected) {
676
- document.addEventListener("click", this.#closeOnClickOutside);
677
- }
678
- };
679
- this.#closeOnClickOutside = (e) => {
680
- if (!this.contains(e.target))
681
- this.open = false;
682
- };
683
- const handleFocusOut = this.handleFocusOut;
684
- this.handleFocusOut = (e) => {
685
- const privates = this;
686
- const isSafeToCallSuper = privates.menuItems.some(privates.isFocusableElement);
687
- if (!isSafeToCallSuper) {
688
- return;
689
- }
690
- handleFocusOut(e);
691
- };
692
- }
693
- autoDismissChanged(oldValue) {
694
- if (oldValue === void 0)
695
- return;
696
- this.#updateClickOutsideListener();
697
- }
698
- openChanged(_, newValue) {
699
- newValue ? this.$emit("open", void 0, { bubbles: false }) : this.$emit("close", void 0, { bubbles: false });
700
- if (this._anchorEl) {
701
- this.#updateAnchor(this._anchorEl);
702
- }
703
- }
704
- connectedCallback() {
705
- super.connectedCallback();
706
- this.#updateClickOutsideListener();
707
- }
708
- disconnectedCallback() {
709
- super.disconnectedCallback();
710
- this.#updateClickOutsideListener();
711
- }
712
- /**
713
- * @internal
714
- */
715
- _anchorElChanged(oldValue, newValue) {
716
- if (oldValue)
717
- this.#cleanupAnchor(oldValue);
718
- if (newValue)
719
- this.#setupAnchor(newValue);
720
- }
721
- #setupAnchor(a) {
722
- a.addEventListener("click", this.#openIfClosed, true);
723
- a.setAttribute("aria-haspopup", "menu");
724
- this.#updateAnchor(a);
725
- }
726
- #updateAnchor(a) {
727
- a.setAttribute("aria-expanded", this.open.toString());
728
- }
729
- #cleanupAnchor(a) {
730
- a.removeEventListener("click", this.#openIfClosed, true);
731
- a.removeAttribute("aria-hasPopup");
732
- a.removeAttribute("aria-expanded");
733
- }
734
- #openIfClosed;
735
- #updateClickOutsideListener;
736
- #closeOnClickOutside;
737
- };
738
- __decorateClass([
739
- attr({ attribute: "aria-label" })
740
- ], Menu.prototype, "ariaLabel", 2);
15
+ class Layout extends FoundationElement {
16
+ }
741
17
  __decorateClass([
742
- attr({ mode: "fromView" })
743
- ], Menu.prototype, "placement", 2);
18
+ attr
19
+ ], Layout.prototype, "gutters", 2);
744
20
  __decorateClass([
745
- attr({ mode: "boolean", attribute: "auto-dismiss" })
746
- ], Menu.prototype, "autoDismiss", 2);
21
+ attr({ attribute: "column-basis" })
22
+ ], Layout.prototype, "columnBasis", 2);
747
23
  __decorateClass([
748
- attr({ mode: "boolean" })
749
- ], Menu.prototype, "open", 2);
24
+ attr({ attribute: "column-spacing" })
25
+ ], Layout.prototype, "columnSpacing", 2);
750
26
  __decorateClass([
751
- observable
752
- ], Menu.prototype, "headerSlottedContent", 2);
27
+ attr({ attribute: "row-spacing" })
28
+ ], Layout.prototype, "rowSpacing", 2);
753
29
  __decorateClass([
754
- observable
755
- ], Menu.prototype, "actionItemsSlottedContent", 2);
756
- Menu = __decorateClass([
757
- anchored
758
- ], Menu);
30
+ attr({ attribute: "auto-sizing" })
31
+ ], Layout.prototype, "autoSizing", 2);
32
+
33
+ const styles = ".control{display:grid;grid-auto-rows:var(--layout-grid-template-rows, min-content)}.control.column-basis-small{grid-template-columns:var(--layout-grid-template-columns, repeat(var(--_auto-sizing), minmax(160px, 1fr)))}.control:not(.column-basis-small):not(.column-basis-medium):not(.column-basis-large):not(.column-basis-block),.control.column-basis-medium{grid-template-columns:var(--layout-grid-template-columns, repeat(var(--_auto-sizing), minmax(320px, 1fr)))}.control.column-basis-large{grid-template-columns:var(--layout-grid-template-columns, repeat(var(--_auto-sizing), minmax(380px, 1fr)))}.control.column-basis-block{grid-template-columns:var(--layout-grid-template-columns, repeat(var(--_auto-sizing), minmax(1fr, 1fr)))}.control.column-spacing-small{column-gap:var(--layout-column-gap, calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2)) - (1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2)))))}.control.column-spacing-small-inline{column-gap:var(--layout-column-gap, 0 calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2)) - (1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2)))))}.control.column-spacing-small-block{column-gap:var(--layout-column-gap, calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2)) - (1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2)))) 0)}.control:not(.column-spacing-small):not(.column-spacing-small-inline):not(.column-spacing-small-block):not(.column-spacing-medium):not(.column-spacing-medium-inline):not(.column-spacing-medium-block):not(.column-spacing-large):not(.column-spacing-large-inline):not(.column-spacing-large-block),.control.column-spacing-medium{column-gap:var(--layout-column-gap, calc(1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2))))}.control.column-spacing-medium-inline{column-gap:var(--layout-column-gap, 0 calc(1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2))))}.control.column-spacing-medium-block{column-gap:var(--layout-column-gap, calc(1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) 0)}.control.column-spacing-large{column-gap:var(--layout-column-gap, calc(1px*(32 + 4*clamp(-1, var(--vvd-size-density, 0), 2))))}.control.column-spacing-large-inline{column-gap:var(--layout-column-gap, 0 calc(1px*(32 + 4*clamp(-1, var(--vvd-size-density, 0), 2))))}.control.column-spacing-large-block{column-gap:var(--layout-column-gap, calc(1px*(32 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) 0)}.control.row-spacing-small{row-gap:var(--layout-row-gap, calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2)) - (1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2)))))}.control.row-spacing-small-inline{row-gap:var(--layout-row-gap, 0 calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2)) - (1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2)))))}.control.row-spacing-small-block{row-gap:var(--layout-row-gap, calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2)) - (1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2)))) 0)}.control:not(.row-spacing-small):not(.row-spacing-small-inline):not(.row-spacing-small-block):not(.row-spacing-medium):not(.row-spacing-medium-inline):not(.row-spacing-medium-block):not(.row-spacing-large):not(.row-spacing-large-inline):not(.row-spacing-large-block),.control.row-spacing-medium{row-gap:var(--layout-row-gap, calc(1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2))))}.control.row-spacing-medium-inline{row-gap:var(--layout-row-gap, 0 calc(1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2))))}.control.row-spacing-medium-block{row-gap:var(--layout-row-gap, calc(1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) 0)}.control.row-spacing-large{row-gap:var(--layout-row-gap, calc(1px*(32 + 4*clamp(-1, var(--vvd-size-density, 0), 2))))}.control.row-spacing-large-inline{row-gap:var(--layout-row-gap, 0 calc(1px*(32 + 4*clamp(-1, var(--vvd-size-density, 0), 2))))}.control.row-spacing-large-block{row-gap:var(--layout-row-gap, calc(1px*(32 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) 0)}.control.gutters-small{margin:calc(1px*(40 + 4*clamp(-1,var(--vvd-size-density, 0),2)) - (1px*(24 + 4*clamp(-1,var(--vvd-size-density, 0),2))))}.control.gutters-small-inline{margin:0 calc(1px*(40 + 4*clamp(-1,var(--vvd-size-density, 0),2)) - (1px*(24 + 4*clamp(-1,var(--vvd-size-density, 0),2))))}.control.gutters-small-block{margin:calc(1px*(40 + 4*clamp(-1,var(--vvd-size-density, 0),2)) - (1px*(24 + 4*clamp(-1,var(--vvd-size-density, 0),2)))) 0}.control.gutters-medium{margin:calc(1px*(24 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}.control.gutters-medium-inline{margin:0 calc(1px*(24 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}.control.gutters-medium-block{margin:calc(1px*(24 + 4*clamp(-1,var(--vvd-size-density, 0),2))) 0}.control.gutters-large{margin:calc(1px*(32 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}.control.gutters-large-inline{margin:0 calc(1px*(32 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}.control.gutters-large-block{margin:calc(1px*(32 + 4*clamp(-1,var(--vvd-size-density, 0),2))) 0}.control.auto-sizing-fill{--_auto-sizing: auto-fill}.control:not(.auto-sizing-fill):not(.auto-sizing-fit),.control.auto-sizing-fit{--_auto-sizing: auto-fit}\n";
759
34
 
760
- const getIndicatorIcon = (x) => {
761
- if (x.checkedAppearance === CheckAppearance.TickOnly) {
762
- return x.checked ? "check-line" : "";
763
- }
764
- const iconType = x.role === MenuItemRole.menuitemcheckbox ? "checkbox" : "radio";
765
- const iconStatus = x.checked ? "checked" : "unchecked";
766
- return `${iconType}-${iconStatus}-2-line`;
767
- };
768
35
  const getClasses = ({
769
- disabled,
770
- checked,
771
- role,
772
- text: text2,
773
- textSecondary,
774
- icon,
775
- metaSlottedContent,
776
- checkTrailing
36
+ columnBasis,
37
+ gutters,
38
+ columnSpacing,
39
+ autoSizing,
40
+ rowSpacing
777
41
  }) => classNames(
778
- "base",
779
- ["disabled", Boolean(disabled)],
780
- ["selected", role !== MenuItemRole.menuitem && Boolean(checked)],
781
- ["trailing", role !== MenuItemRole.menuitem && (checkTrailing || Boolean(icon))],
782
- ["item-checkbox", role === MenuItemRole.menuitemcheckbox],
783
- ["item-radio", role === MenuItemRole.menuitemradio],
784
- ["two-lines", Boolean(text2?.length) && Boolean(textSecondary?.length)],
785
- ["has-meta", Boolean(metaSlottedContent?.length)]
42
+ "control",
43
+ [`column-basis-${columnBasis}`, Boolean(columnBasis)],
44
+ [`gutters-${gutters}`, Boolean(gutters)],
45
+ [`column-spacing-${columnSpacing}`, Boolean(columnSpacing)],
46
+ [
47
+ `row-spacing-${rowSpacing ? rowSpacing : columnSpacing}`,
48
+ Boolean(rowSpacing) || Boolean(columnSpacing)
49
+ ],
50
+ [`auto-sizing-${autoSizing}`, Boolean(autoSizing)]
786
51
  );
787
- function handleClick(x, { event }) {
788
- x.handleMenuItemClick(event);
789
- return x.role === MenuItemRole.presentation;
790
- }
791
- function checkIndicator(context) {
792
- const iconTag = context.tagFor(Icon);
793
- return html`${when(
794
- (x) => x.role === MenuItemRole.menuitemcheckbox || x.role === MenuItemRole.menuitemradio,
795
- html`<span class="action"><${iconTag} class="icon" name="${(x) => getIndicatorIcon(x)}"></${iconTag}></span>`
796
- )}`;
797
- }
798
- function text() {
799
- return html`${when(
800
- (x) => x.text || x.textSecondary,
801
- html`<span class="text">
802
- ${when((x) => x.text, html`<span class="text-primary">${(x) => x.text}</span>`)}
803
- ${when((x) => x.textSecondary, html`<span class="text-secondary">${(x) => x.textSecondary}</span>`)}
804
- </span>`
805
- )}`;
806
- }
807
- const MenuItemTemplate = (context) => {
808
- const affixIconTemplate = affixIconTemplateFactory(context);
809
- const iconTag = context.tagFor(Icon);
810
- return html`
811
- <template
812
- role="${(x) => x.role ? x.role : MenuItemRole.menuitem}"
813
- aria-haspopup="${(x) => x.hasSubmenu ? "menu" : void 0}"
814
- aria-checked="${(x) => x.role !== MenuItemRole.menuitem ? x.checked : void 0}"
815
- aria-disabled="${(x) => x.disabled}"
816
- aria-expanded="${(x) => x.expanded}"
817
- @keydown="${(x, c) => x.handleMenuItemKeyDown(c.event)}"
818
- @click="${handleClick}"
819
- @mouseover="${(x, c) => x.handleMouseOver(c.event)}"
820
- @mouseout="${(x, c) => x.handleMouseOut(c.event)}"
821
- >
822
- <div class="${getClasses}">
823
- <slot name="meta" ${slotted("metaSlottedContent")}></slot>
824
- ${checkIndicator(context)}
825
- ${when((x) => x.icon, html`<span class="decorative">${(x) => affixIconTemplate(x.icon)}</span>`)}
826
- ${text()}
827
- <slot name="trailing-meta" ${slotted("trailingMetaSlottedContent")}></slot>
828
- ${when((x) => x.hasSubmenu, html`<${iconTag} class="chevron" name="chevron-right-line"></${iconTag}>`)}
829
- </div>
830
- <slot name="submenu" ${slotted({ property: "slottedSubmenu", filter: elements(context.tagFor(Menu)) })}></slot>
831
- </template>
832
- `;
833
- };
52
+ const layoutTemplate = () => html` <div class="${getClasses}">
53
+ <slot></slot>
54
+ </div>`;
834
55
 
835
- const menuItemDefinition = MenuItem.compose({
836
- baseName: "menu-item",
837
- template: MenuItemTemplate,
56
+ const layoutDefinition = Layout.compose({
57
+ baseName: "layout",
58
+ template: layoutTemplate,
838
59
  styles
839
60
  });
840
- const menuItemRegistries = [menuItemDefinition(), ...iconRegistries];
841
- const registerMenuItem = registerFactory(menuItemRegistries);
61
+ const layoutRegistries = [layoutDefinition()];
62
+ const registerLayout = registerFactory(layoutRegistries);
842
63
 
843
- export { MenuItemRole as M, menuItemRegistries as a, Menu as b, menuItemDefinition as m, registerMenuItem as r };
64
+ export { layoutRegistries as a, layoutDefinition as l, registerLayout as r };