@vonage/vivid 4.17.0 → 4.19.0-preview.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 (364) hide show
  1. package/custom-elements.json +4248 -4149
  2. package/date-time-picker/index.cjs +5 -0
  3. package/date-time-picker/index.js +3 -0
  4. package/dial-pad/index.cjs +1 -1
  5. package/dial-pad/index.js +1 -1
  6. package/dialog/index.cjs +1 -1
  7. package/dialog/index.js +1 -1
  8. package/divider/index.cjs +1 -1
  9. package/divider/index.js +1 -1
  10. package/elevation/index.cjs +1 -1
  11. package/elevation/index.js +1 -1
  12. package/empty-state/index.cjs +1 -1
  13. package/empty-state/index.js +1 -1
  14. package/fab/index.cjs +1 -1
  15. package/fab/index.js +1 -1
  16. package/file-picker/index.cjs +1 -1
  17. package/file-picker/index.js +1 -1
  18. package/header/index.cjs +1 -1
  19. package/header/index.js +1 -1
  20. package/icon/index.cjs +1 -1
  21. package/icon/index.js +1 -1
  22. package/index.cjs +136 -133
  23. package/index.js +45 -44
  24. package/layout/index.cjs +1 -1
  25. package/layout/index.js +1 -1
  26. package/lib/action-group/action-group.d.ts +449 -3
  27. package/lib/banner/banner.d.ts +449 -3
  28. package/lib/breadcrumb-item/breadcrumb-item.d.ts +449 -1
  29. package/lib/checkbox/checkbox.d.ts +449 -4
  30. package/lib/components.d.ts +1 -0
  31. package/lib/date-picker/date-picker.d.ts +2182 -4
  32. package/lib/date-picker/date-picker.template.d.ts +2 -0
  33. package/lib/date-range-picker/date-range-picker.d.ts +1110 -4
  34. package/lib/date-range-picker/date-range-picker.template.d.ts +2 -0
  35. package/lib/date-time-picker/date-time-picker.d.ts +2175 -0
  36. package/lib/date-time-picker/date-time-picker.template.d.ts +2 -0
  37. package/lib/date-time-picker/definition.d.ts +1 -0
  38. package/lib/date-time-picker/locale.d.ts +9 -0
  39. package/lib/dialog/dialog.d.ts +449 -2
  40. package/lib/divider/divider.d.ts +448 -1
  41. package/lib/menu/menu.d.ts +446 -1
  42. package/lib/nav-disclosure/nav-disclosure.d.ts +449 -2
  43. package/lib/number-field/number-field.d.ts +450 -3
  44. package/lib/option/option.d.ts +4 -11
  45. package/lib/progress/progress.d.ts +449 -2
  46. package/lib/progress-ring/progress-ring.d.ts +449 -2
  47. package/lib/rich-text-editor/facades/vivid-prose-mirror.facade.d.ts +1 -0
  48. package/lib/rich-text-editor/rich-text-editor.d.ts +7 -4
  49. package/lib/searchable-select/searchable-select.d.ts +3 -0
  50. package/lib/select/select.d.ts +1 -5
  51. package/lib/selectable-box/selectable-box.d.ts +449 -2
  52. package/lib/slider/slider.d.ts +449 -3
  53. package/lib/split-button/split-button.d.ts +449 -3
  54. package/lib/switch/switch.d.ts +449 -2
  55. package/lib/tag-group/tag-group.d.ts +449 -2
  56. package/lib/text-anchor/text-anchor.d.ts +449 -1
  57. package/lib/text-area/text-area.d.ts +450 -3
  58. package/lib/text-field/text-field.d.ts +450 -7
  59. package/lib/time-picker/locale.d.ts +0 -2
  60. package/lib/time-picker/time-picker.d.ts +1053 -9
  61. package/lib/time-picker/time-picker.template.d.ts +2 -1
  62. package/locales/de-DE.cjs +29 -5
  63. package/locales/de-DE.js +29 -5
  64. package/locales/en-GB.cjs +29 -5
  65. package/locales/en-GB.js +29 -5
  66. package/locales/en-US.cjs +29 -5
  67. package/locales/en-US.js +29 -5
  68. package/locales/ja-JP.cjs +29 -5
  69. package/locales/ja-JP.js +29 -5
  70. package/locales/zh-CN.cjs +29 -5
  71. package/locales/zh-CN.js +29 -5
  72. package/menu/index.cjs +1 -1
  73. package/menu/index.js +1 -1
  74. package/menu-item/index.cjs +1 -1
  75. package/menu-item/index.js +1 -1
  76. package/nav/index.cjs +1 -1
  77. package/nav/index.js +1 -1
  78. package/nav-disclosure/index.cjs +1 -1
  79. package/nav-disclosure/index.js +1 -1
  80. package/nav-item/index.cjs +1 -1
  81. package/nav-item/index.js +1 -1
  82. package/note/index.cjs +1 -1
  83. package/note/index.js +1 -1
  84. package/number-field/index.cjs +1 -1
  85. package/number-field/index.js +1 -1
  86. package/option/index.cjs +1 -1
  87. package/option/index.js +1 -1
  88. package/package.json +1 -1
  89. package/pagination/index.cjs +1 -1
  90. package/pagination/index.js +1 -1
  91. package/popup/index.cjs +1 -1
  92. package/popup/index.js +1 -1
  93. package/progress/index.cjs +1 -1
  94. package/progress/index.js +1 -1
  95. package/progress-ring/index.cjs +1 -1
  96. package/progress-ring/index.js +1 -1
  97. package/radio/index.cjs +1 -1
  98. package/radio/index.js +1 -1
  99. package/radio-group/index.cjs +1 -1
  100. package/radio-group/index.js +1 -1
  101. package/range-slider/index.cjs +1 -1
  102. package/range-slider/index.js +1 -1
  103. package/rich-text-editor/index.cjs +1 -1
  104. package/rich-text-editor/index.js +1 -1
  105. package/searchable-select/index.cjs +1 -1
  106. package/searchable-select/index.js +1 -1
  107. package/select/index.cjs +1 -1
  108. package/select/index.js +1 -1
  109. package/selectable-box/index.cjs +1 -1
  110. package/selectable-box/index.js +1 -1
  111. package/shared/Reflector.cjs +71 -0
  112. package/shared/Reflector.js +69 -0
  113. package/shared/affix.cjs +1 -1
  114. package/shared/affix.js +1 -1
  115. package/shared/anchor.cjs +0 -10
  116. package/shared/anchor.js +0 -10
  117. package/shared/aria/delegates-aria.d.ts +454 -0
  118. package/shared/base-progress.js +1 -1
  119. package/shared/breadcrumb-item.cjs +2 -1
  120. package/shared/breadcrumb-item.js +2 -1
  121. package/shared/button.cjs +2 -13
  122. package/shared/button.js +2 -13
  123. package/shared/{presentationDate.cjs → calendar-picker.template.cjs} +730 -900
  124. package/shared/{presentationDate.js → calendar-picker.template.js} +672 -845
  125. package/shared/datetime/dateTimeStr.d.ts +6 -0
  126. package/shared/datetime/presentationDate.d.ts +4 -0
  127. package/shared/{date-picker/calendar → datetime}/presentationDateRange.d.ts +3 -3
  128. package/shared/datetime/presentationDateTime.d.ts +4 -0
  129. package/{lib/time-picker/time → shared/datetime}/time.d.ts +1 -0
  130. package/shared/definition.cjs +1 -1
  131. package/shared/definition.js +1 -1
  132. package/shared/definition11.cjs +8 -11
  133. package/shared/definition11.js +8 -11
  134. package/shared/definition14.cjs +2 -2
  135. package/shared/definition14.js +2 -2
  136. package/shared/definition15.cjs +3 -10
  137. package/shared/definition15.js +3 -10
  138. package/shared/definition16.cjs +29 -33
  139. package/shared/definition16.js +29 -33
  140. package/shared/definition17.cjs +1 -1
  141. package/shared/definition17.js +1 -1
  142. package/shared/definition18.cjs +56 -91
  143. package/shared/definition18.js +56 -91
  144. package/shared/definition19.cjs +68 -32
  145. package/shared/definition19.js +58 -22
  146. package/shared/definition20.cjs +253 -220
  147. package/shared/definition20.js +254 -220
  148. package/shared/definition21.cjs +200 -286
  149. package/shared/definition21.js +198 -284
  150. package/shared/definition22.cjs +302 -31
  151. package/shared/definition22.js +301 -30
  152. package/shared/definition23.cjs +37 -58
  153. package/shared/definition23.js +36 -57
  154. package/shared/definition24.cjs +50 -70
  155. package/shared/definition24.js +49 -69
  156. package/shared/definition25.cjs +75 -2475
  157. package/shared/definition25.js +74 -2475
  158. package/shared/definition26.cjs +2480 -50
  159. package/shared/definition26.js +2479 -48
  160. package/shared/definition27.cjs +53 -271
  161. package/shared/definition27.js +52 -269
  162. package/shared/definition28.cjs +271 -48
  163. package/shared/definition28.js +269 -47
  164. package/shared/definition29.cjs +37 -764
  165. package/shared/definition29.js +36 -758
  166. package/shared/definition3.cjs +2 -9
  167. package/shared/definition3.js +2 -9
  168. package/shared/definition30.cjs +739 -57
  169. package/shared/definition30.js +733 -56
  170. package/shared/definition31.cjs +93 -22
  171. package/shared/definition31.js +92 -21
  172. package/shared/definition32.cjs +28 -10
  173. package/shared/definition32.js +27 -9
  174. package/shared/definition33.cjs +10 -52
  175. package/shared/definition33.js +9 -51
  176. package/shared/definition34.cjs +30 -411
  177. package/shared/definition34.js +30 -412
  178. package/shared/definition35.cjs +422 -52
  179. package/shared/definition35.js +423 -53
  180. package/shared/definition36.cjs +54 -216
  181. package/shared/definition36.js +54 -215
  182. package/shared/definition37.cjs +201 -71
  183. package/shared/definition37.js +200 -70
  184. package/shared/definition38.cjs +53 -48
  185. package/shared/definition38.js +51 -46
  186. package/shared/definition39.cjs +57 -263
  187. package/shared/definition39.js +56 -262
  188. package/shared/definition4.cjs +2 -2
  189. package/shared/definition4.js +2 -2
  190. package/shared/definition40.cjs +220 -148
  191. package/shared/definition40.js +220 -148
  192. package/shared/definition41.cjs +143 -567
  193. package/shared/definition41.js +143 -568
  194. package/shared/definition42.cjs +596 -12573
  195. package/shared/definition42.js +596 -12573
  196. package/shared/definition43.cjs +13489 -1058
  197. package/shared/definition43.js +13489 -1059
  198. package/shared/definition44.cjs +968 -696
  199. package/shared/definition44.js +970 -697
  200. package/shared/definition45.cjs +850 -105
  201. package/shared/definition45.js +850 -104
  202. package/shared/definition46.cjs +110 -90
  203. package/shared/definition46.js +108 -88
  204. package/shared/definition47.cjs +88 -464
  205. package/shared/definition47.js +87 -463
  206. package/shared/definition48.cjs +457 -111
  207. package/shared/definition48.js +456 -110
  208. package/shared/definition49.cjs +103 -109
  209. package/shared/definition49.js +102 -108
  210. package/shared/definition5.cjs +3 -3
  211. package/shared/definition5.js +3 -3
  212. package/shared/definition50.cjs +136 -14
  213. package/shared/definition50.js +135 -13
  214. package/shared/definition51.cjs +16 -115
  215. package/shared/definition51.js +15 -114
  216. package/shared/definition52.cjs +79 -486
  217. package/shared/definition52.js +78 -485
  218. package/shared/definition53.cjs +503 -24
  219. package/shared/definition53.js +502 -23
  220. package/shared/definition54.cjs +23 -137
  221. package/shared/definition54.js +22 -136
  222. package/shared/definition55.cjs +96 -241
  223. package/shared/definition55.js +95 -241
  224. package/shared/definition56.cjs +261 -61
  225. package/shared/definition56.js +260 -60
  226. package/shared/definition57.cjs +419 -788
  227. package/shared/definition57.js +420 -789
  228. package/shared/definition58.cjs +27 -144
  229. package/shared/definition58.js +27 -143
  230. package/shared/definition59.cjs +83 -54
  231. package/shared/definition59.js +82 -53
  232. package/shared/definition6.cjs +1 -1
  233. package/shared/definition6.js +1 -1
  234. package/shared/definition60.cjs +80 -165
  235. package/shared/definition60.js +79 -163
  236. package/shared/definition61.cjs +143 -230
  237. package/shared/definition61.js +141 -229
  238. package/shared/definition62.cjs +233 -69344
  239. package/shared/definition62.js +232 -69343
  240. package/shared/definition63.cjs +69381 -28
  241. package/shared/definition63.js +69379 -26
  242. package/shared/definition64.cjs +28 -2168
  243. package/shared/definition64.js +27 -2166
  244. package/shared/definition65.cjs +2195 -0
  245. package/shared/definition65.js +2190 -0
  246. package/shared/definition7.cjs +1 -1
  247. package/shared/definition7.js +1 -1
  248. package/shared/definition8.cjs +3 -9
  249. package/shared/definition8.js +3 -9
  250. package/shared/definition9.cjs +1 -1
  251. package/shared/definition9.js +1 -1
  252. package/shared/delegates-aria.cjs +69 -0
  253. package/shared/delegates-aria.js +67 -0
  254. package/shared/form-associated.js +1 -1
  255. package/shared/form-elements.cjs +1 -1
  256. package/shared/form-elements.js +1 -1
  257. package/shared/foundation/anchor/anchor.d.ts +0 -8
  258. package/shared/foundation/button/button.d.ts +449 -7
  259. package/shared/foundation/listbox/listbox.d.ts +0 -9
  260. package/shared/listbox.cjs +4 -30
  261. package/shared/listbox.js +4 -30
  262. package/shared/localization/Locale.d.ts +6 -2
  263. package/shared/option.cjs +38 -50
  264. package/shared/option.js +39 -51
  265. package/shared/picker-field/locale.d.ts +4 -0
  266. package/shared/picker-field/mixins/calendar-picker.d.ts +558 -0
  267. package/shared/{date-picker/locale.d.ts → picker-field/mixins/calendar-picker.locale.d.ts} +1 -3
  268. package/shared/picker-field/mixins/calendar-picker.template.d.ts +555 -0
  269. package/shared/picker-field/mixins/calendar-segments/calendarGrid.d.ts +17 -0
  270. package/shared/{date-picker/calendar → picker-field/mixins/calendar-segments}/monthPickerGrid.d.ts +3 -3
  271. package/{lib/time-picker → shared/picker-field/mixins}/inline-time-picker/columns.d.ts +1 -1
  272. package/{lib/time-picker → shared/picker-field/mixins}/inline-time-picker/inline-time-picker.d.ts +2 -2
  273. package/{lib/time-picker/time/picker.d.ts → shared/picker-field/mixins/inline-time-picker/picker-option.d.ts} +1 -1
  274. package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +1110 -0
  275. package/shared/picker-field/mixins/single-date-picker.d.ts +1626 -0
  276. package/shared/picker-field/mixins/single-value-picker.d.ts +518 -0
  277. package/shared/picker-field/mixins/time-selection-picker.d.ts +1053 -0
  278. package/shared/picker-field/mixins/time-selection-picker.template.d.ts +1050 -0
  279. package/shared/picker-field/picker-field.d.ts +11 -0
  280. package/shared/picker-field/picker-field.form-associated.d.ts +11 -0
  281. package/shared/picker-field/picker-field.template.d.ts +7 -0
  282. package/shared/picker-field.template.cjs +315 -0
  283. package/shared/picker-field.template.js +310 -0
  284. package/shared/single-date-picker.cjs +46 -0
  285. package/shared/single-date-picker.js +44 -0
  286. package/shared/single-value-picker.cjs +77 -0
  287. package/shared/single-value-picker.js +75 -0
  288. package/shared/slider.template.cjs +3 -3
  289. package/shared/slider.template.js +3 -3
  290. package/shared/text-anchor.cjs +2 -1
  291. package/shared/text-anchor.js +2 -1
  292. package/shared/text-anchor.template.cjs +3 -5
  293. package/shared/text-anchor.template.js +3 -5
  294. package/shared/text-field.cjs +2 -555
  295. package/shared/text-field.js +2 -554
  296. package/shared/time-selection-picker.template.cjs +776 -0
  297. package/shared/time-selection-picker.template.js +767 -0
  298. package/shared/vivid-element.cjs +1 -1
  299. package/shared/vivid-element.js +1 -1
  300. package/side-drawer/index.cjs +1 -1
  301. package/side-drawer/index.js +1 -1
  302. package/slider/index.cjs +1 -1
  303. package/slider/index.js +1 -1
  304. package/split-button/index.cjs +1 -1
  305. package/split-button/index.js +1 -1
  306. package/styles/core/all.css +1 -1
  307. package/styles/core/theme.css +1 -1
  308. package/styles/core/typography.css +1 -1
  309. package/styles/tokens/theme-dark.css +4 -4
  310. package/styles/tokens/theme-light.css +4 -4
  311. package/styles/tokens/vivid-2-compat.css +1 -1
  312. package/switch/index.cjs +1 -1
  313. package/switch/index.js +1 -1
  314. package/tab/index.cjs +1 -1
  315. package/tab/index.js +1 -1
  316. package/tab-panel/index.cjs +1 -1
  317. package/tab-panel/index.js +1 -1
  318. package/tabs/index.cjs +1 -1
  319. package/tabs/index.js +1 -1
  320. package/tag/index.cjs +1 -1
  321. package/tag/index.js +1 -1
  322. package/tag-group/index.cjs +1 -1
  323. package/tag-group/index.js +1 -1
  324. package/text-anchor/index.cjs +1 -1
  325. package/text-anchor/index.js +1 -1
  326. package/text-area/index.cjs +1 -1
  327. package/text-area/index.js +1 -1
  328. package/text-field/index.cjs +1 -1
  329. package/text-field/index.js +1 -1
  330. package/time-picker/index.cjs +1 -1
  331. package/time-picker/index.js +1 -1
  332. package/toggletip/index.cjs +1 -1
  333. package/toggletip/index.js +1 -1
  334. package/tooltip/index.cjs +1 -1
  335. package/tooltip/index.js +1 -1
  336. package/tree-item/index.cjs +1 -1
  337. package/tree-item/index.js +1 -1
  338. package/tree-view/index.cjs +1 -1
  339. package/tree-view/index.js +1 -1
  340. package/video-player/index.cjs +1 -1
  341. package/video-player/index.js +1 -1
  342. package/vivid.api.json +286 -1144
  343. package/lib/time-picker/time-picker.form-associated.d.ts +0 -11
  344. package/shared/aria-global.cjs +0 -93
  345. package/shared/aria-global.js +0 -91
  346. package/shared/date-picker/calendar/calendarGrid.d.ts +0 -17
  347. package/shared/date-picker/calendar/presentationDate.d.ts +0 -4
  348. package/shared/date-picker/date-picker-base.d.ts +0 -21
  349. package/shared/date-picker/date-picker-base.form-associated.d.ts +0 -11
  350. package/shared/date-picker/date-picker-base.template.d.ts +0 -3
  351. package/shared/foundation/patterns/aria-global.d.ts +0 -21
  352. package/shared/foundation/patterns/index.d.ts +0 -1
  353. package/shared/text-field2.cjs +0 -5
  354. package/shared/text-field2.js +0 -3
  355. package/shared/trapped-focus.cjs +0 -35
  356. package/shared/trapped-focus.js +0 -33
  357. /package/shared/{date-picker/calendar → datetime}/dateRange.d.ts +0 -0
  358. /package/shared/{date-picker/calendar → datetime}/dateStr.d.ts +0 -0
  359. /package/shared/{date-picker/calendar → datetime}/month.d.ts +0 -0
  360. /package/{lib/time-picker/time → shared/datetime}/presentationTime.d.ts +0 -0
  361. /package/shared/{date-picker/calendar → datetime}/year.d.ts +0 -0
  362. /package/shared/{date-picker/calendar → picker-field/mixins/calendar-segments}/segment.d.ts +0 -0
  363. /package/{lib/time-picker → shared/picker-field/mixins}/inline-time-picker/definition.d.ts +0 -0
  364. /package/{lib/time-picker → shared/picker-field/mixins}/inline-time-picker/inline-time-picker.template.d.ts +0 -0
@@ -1,354 +1,5 @@
1
- import { P as Popup, p as popupDefinition } from './definition64.js';
2
- import { I as Icon, i as iconDefinition } from './definition27.js';
3
- import { D as DOM, V as VividElement, o as observable, a as attr, h as html, d as createRegisterFunction, f as defineVividComponent } from './vivid-element.js';
4
- import { g as keyHome, d as keyEnd, e as keyArrowUp, f as keyArrowDown, h as keyArrowLeft, i as keyArrowRight, a as keySpace, k as keyEnter } from './key-codes.js';
5
- import { b as AffixIcon, a as affixIconTemplateFactory } from './affix.js';
6
- import { a as applyMixins } from './apply-mixins.js';
7
- import { D as Direction, g as getDirection } from './direction.js';
8
- import { A as Anchored, a as anchorSlotTemplateFactory } from './anchored.js';
9
- import { i as isHTMLElement } from './dom.js';
10
- import { h as handleEscapeKeyAndStopPropogation } from './index.js';
11
- import { r as ref } from './ref.js';
1
+ import { V as VividElement, a as attr, h as html, d as createRegisterFunction, f as defineVividComponent } from './vivid-element.js';
12
2
  import { c as classNames } from './class-names.js';
13
- import { s as slotted, e as elements } from './slotted.js';
14
- import { w as when } from './when.js';
15
-
16
- const styles$1 = ":host(:focus-visible){outline:none}:host([disabled]){pointer-events:none}.base{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.base:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_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-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.base:where(.selected):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.base:where(.selected):where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-dim);--_appearance-color-outline: transparent}.base.connotation-cta{--_connotation-color-primary: var(--vvd-menu-item-cta-primary, var(--vvd-color-cta-500));--_connotation-color-primary-text: var(--vvd-menu-item-cta-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-menu-item-cta-primary-increment, var(--vvd-color-cta-600));--_connotation-color-firm: var(--vvd-menu-item-cta-firm, var(--vvd-color-cta-600));--_connotation-color-faint: var(--vvd-menu-item-cta-faint, var(--vvd-color-cta-50));--_connotation-color-soft: var(--vvd-menu-item-cta-soft, var(--vvd-color-cta-100));--_connotation-color-pale: var(--vvd-menu-item-cta-pale, var(--vvd-color-cta-300));--_connotation-color-dim: var(--vvd-menu-item-cta-dim, var(--vvd-color-cta-200))}.base:not(.connotation-cta){--_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-firm: var(--vvd-menu-item-accent-firm, var(--vvd-color-canvas-text));--_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{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);inline-size:100%}.base:not(.two-lines){gap:12px;min-block-size:calc(1px*(40 + 4*clamp(-1,var(--vvd-size-density, 0),2)));padding-block:8px;padding-inline:12px}.base.two-lines{padding:12px;gap:16px;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}.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)}.base.trailing .action,.base.has-meta .action{order:2}:host(:not([check-appearance],[aria-checked=true],[disabled])) .action{color:var(--vvd-color-neutral-500)}.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;gap:4px;margin-inline-end:auto}.text-primary,.text-secondary{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;font:var(--vvd-typography-base)}.text-primary{font:var(--vvd-typography-base);-webkit-line-clamp:var(--text-primary-line-clamp, 1)}.base:not(.disabled) .text-primary{color:var(--vvd-color-canvas-text)}.base.disabled .text-primary{color:var(--_appearance-color-text)}.base.two-lines .text-primary{font:var(--vvd-typography-base-bold)}.text-secondary{color:var(--vvd-color-neutral-800);font:var(--vvd-typography-base-condensed);-webkit-line-clamp:var(--text-secondary-line-clamp, 1)}.base.two-lines .text-secondary{color:var(--vvd-color-neutral-600)}.base.disabled .text-secondary{color:var(--_appearance-color-text)}.base.selected:not(.disabled) .text-secondary{color:var(--vvd-color-neutral-800)}";
17
-
18
- const MenuItemRole = {
19
- menuitem: "menuitem",
20
- menuitemcheckbox: "menuitemcheckbox",
21
- menuitemradio: "menuitemradio",
22
- presentation: "presentation"
23
- };
24
- const roleForMenuItem = {
25
- [MenuItemRole.menuitem]: "menuitem",
26
- [MenuItemRole.menuitemcheckbox]: "menuitemcheckbox",
27
- [MenuItemRole.menuitemradio]: "menuitemradio",
28
- [MenuItemRole.presentation]: "presentation"
29
- };
30
-
31
- var __defProp$1 = Object.defineProperty;
32
- var __decorateClass$1 = (decorators, target, key, kind) => {
33
- var result = void 0 ;
34
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
35
- if (decorator = decorators[i])
36
- result = (decorator(target, key, result) ) || result;
37
- if (result) __defProp$1(target, key, result);
38
- return result;
39
- };
40
- const _Menu = class _Menu extends Anchored(VividElement) {
41
- constructor() {
42
- super(...arguments);
43
- this.expandedItem = null;
44
- /**
45
- * The index of the focusable element in the items array
46
- * defaults to -1
47
- */
48
- this.focusIndex = -1;
49
- /**
50
- * if focus is moving out of the menu, reset to a stable initial state
51
- * @internal
52
- */
53
- this.handleFocusOut = (e) => {
54
- if (!this.contains(e.relatedTarget) && this.menuItems !== void 0 && this.menuItems.length) {
55
- this.collapseExpandedItem();
56
- const focusIndex = this.menuItems.findIndex(
57
- this.isFocusableElement
58
- );
59
- this.menuItems[this.focusIndex].setAttribute("tabindex", "-1");
60
- this.menuItems[focusIndex].setAttribute("tabindex", "0");
61
- this.focusIndex = focusIndex;
62
- }
63
- };
64
- this.handleItemFocus = (e) => {
65
- const targetItem = e.target;
66
- if (this.menuItems !== void 0 && targetItem !== this.menuItems[this.focusIndex]) {
67
- this.menuItems[this.focusIndex].setAttribute("tabindex", "-1");
68
- this.focusIndex = this.menuItems.indexOf(targetItem);
69
- targetItem.setAttribute("tabindex", "0");
70
- }
71
- };
72
- this.handleExpandedChanged = (e) => {
73
- const changedItem = e.target;
74
- if (this.expandedItem !== null && changedItem === this.expandedItem && changedItem.expanded === false) {
75
- this.expandedItem = null;
76
- }
77
- if (changedItem.expanded) {
78
- this.expandedItem = changedItem;
79
- }
80
- };
81
- this.removeItemListeners = () => {
82
- if (this.menuItems !== void 0) {
83
- this.menuItems.forEach((item) => {
84
- item.removeEventListener("expanded-change", this.handleExpandedChanged);
85
- item.removeEventListener(
86
- "focus",
87
- this.handleItemFocus
88
- );
89
- });
90
- }
91
- };
92
- this.setItems = () => {
93
- const newItems = this.domChildren();
94
- this.removeItemListeners();
95
- this.menuItems = newItems;
96
- const menuItems = this.menuItems.filter(this.isMenuItemElement);
97
- if (menuItems.length) {
98
- this.focusIndex = 0;
99
- }
100
- menuItems.forEach((item, index) => {
101
- item.setAttribute("tabindex", index === 0 ? "0" : "-1");
102
- item.addEventListener("expanded-change", this.handleExpandedChanged);
103
- item.addEventListener("focus", this.handleItemFocus);
104
- });
105
- };
106
- /**
107
- * check if the item is a menu item
108
- */
109
- this.isMenuItemElement = (el) => {
110
- return isHTMLElement(el) && Object.prototype.hasOwnProperty.call(
111
- _Menu.focusableElementRoles,
112
- el.getAttribute("role")
113
- );
114
- };
115
- /**
116
- * check if the item is focusable
117
- */
118
- this.isFocusableElement = (el) => {
119
- return this.isMenuItemElement(el);
120
- };
121
- this.ariaLabel = null;
122
- this.placement = "bottom";
123
- this.autoDismiss = false;
124
- this.positionStrategy = "fixed";
125
- this.open = false;
126
- this.#onAnchorClick = () => {
127
- if (this.#triggerBehaviour === "off") {
128
- return;
129
- }
130
- if (this.#triggerBehaviour === "legacy" && this.open) {
131
- return;
132
- }
133
- const newValue = !this.open;
134
- DOM.queueUpdate(() => this.open = newValue);
135
- };
136
- this._onFocusout = (e) => {
137
- const focusTarget = e.relatedTarget;
138
- const focusMovedAway = !this.contains(focusTarget) && !this._anchorEl?.contains(focusTarget);
139
- if (this.autoDismiss && focusMovedAway) {
140
- this.open = false;
141
- }
142
- };
143
- }
144
- /**
145
- * @internal
146
- */
147
- itemsChanged() {
148
- if (this.$fastController.isConnected && this.menuItems !== void 0) {
149
- this.setItems();
150
- }
151
- }
152
- static {
153
- this.focusableElementRoles = roleForMenuItem;
154
- }
155
- /**
156
- * @internal
157
- */
158
- connectedCallback() {
159
- super.connectedCallback();
160
- DOM.queueUpdate(() => {
161
- this.setItems();
162
- });
163
- }
164
- /**
165
- * @internal
166
- */
167
- disconnectedCallback() {
168
- super.disconnectedCallback();
169
- this.removeItemListeners();
170
- this.menuItems = void 0;
171
- }
172
- /**
173
- * Moves focus into the menu. If there is a child with the `autofocus` attribute, it will be focused.
174
- * Otherwise, the first focusable child will be focused.
175
- *
176
- * @public
177
- */
178
- focus() {
179
- const autoFocusElement = this.querySelector(
180
- '[autofocus]:not([slot="anchor"])'
181
- );
182
- if (autoFocusElement instanceof HTMLElement) {
183
- autoFocusElement.focus();
184
- } else {
185
- this.setFocus(0, 1);
186
- }
187
- }
188
- /**
189
- * Collapses any expanded Menu Items.
190
- *
191
- * @public
192
- */
193
- collapseExpandedItem() {
194
- if (this.expandedItem !== null) {
195
- this.expandedItem.expanded = false;
196
- this.expandedItem = null;
197
- }
198
- }
199
- /**
200
- * @internal
201
- */
202
- handleMenuKeyDown(e) {
203
- if (e.defaultPrevented || this.menuItems === void 0) {
204
- return;
205
- }
206
- switch (e.key) {
207
- case keyArrowDown:
208
- this.setFocus(this.focusIndex + 1, 1);
209
- return;
210
- case keyArrowUp:
211
- this.setFocus(this.focusIndex - 1, -1);
212
- return;
213
- case keyEnd:
214
- this.setFocus(this.menuItems.length - 1, -1);
215
- return;
216
- case keyHome:
217
- this.setFocus(0, 1);
218
- return;
219
- default:
220
- return true;
221
- }
222
- }
223
- /**
224
- * get an array of valid DOM children
225
- */
226
- domChildren() {
227
- return Array.from(this.children).filter((child) => !child.hasAttribute("hidden")).filter((child) => !child.hasAttribute("slot"));
228
- }
229
- setFocus(focusIndex, adjustment) {
230
- if (this.menuItems === void 0) {
231
- return;
232
- }
233
- while (focusIndex >= 0 && focusIndex < this.menuItems.length) {
234
- const child = this.menuItems[focusIndex];
235
- if (this.isFocusableElement(child)) {
236
- if (this.focusIndex > -1 && this.menuItems.length >= this.focusIndex - 1) {
237
- this.menuItems[this.focusIndex].setAttribute("tabindex", "-1");
238
- }
239
- this.focusIndex = focusIndex;
240
- child.setAttribute("tabindex", "0");
241
- child.focus();
242
- break;
243
- }
244
- focusIndex += adjustment;
245
- }
246
- }
247
- get #triggerBehaviour() {
248
- return this.trigger ?? "legacy";
249
- }
250
- openChanged(_, newValue) {
251
- if (newValue) {
252
- this._popupEl?.show().then(() => this.focus());
253
- }
254
- newValue ? this.$emit("open", void 0, { bubbles: false }) : this.$emit("close", void 0, { bubbles: false });
255
- if (this._anchorEl) {
256
- this.#updateAnchor(this._anchorEl);
257
- }
258
- }
259
- /**
260
- * @internal
261
- */
262
- _anchorElChanged(oldValue, newValue) {
263
- if (oldValue) this.#cleanupAnchor(oldValue);
264
- if (newValue) this.#setupAnchor(newValue);
265
- }
266
- #setupAnchor(a) {
267
- a.addEventListener("click", this.#onAnchorClick, true);
268
- a.addEventListener("focusout", this._onFocusout);
269
- a.setAttribute("aria-haspopup", "menu");
270
- this.#updateAnchor(a);
271
- }
272
- #updateAnchor(a) {
273
- a.setAttribute("aria-expanded", this.open.toString());
274
- }
275
- #cleanupAnchor(a) {
276
- a.removeEventListener("click", this.#onAnchorClick, true);
277
- a.removeEventListener("focusout", this._onFocusout);
278
- a.removeAttribute("aria-hasPopup");
279
- a.removeAttribute("aria-expanded");
280
- }
281
- #onAnchorClick;
282
- /**
283
- * @internal
284
- */
285
- _onChange(e) {
286
- if (this.menuItems === void 0) {
287
- return;
288
- }
289
- const clickedOnNonCheckboxMenuItem = e.target instanceof HTMLElement && (e.target.role === "menuitem" || e.target.role === "menuitemradio");
290
- if (this.#triggerBehaviour === "auto" && clickedOnNonCheckboxMenuItem) {
291
- this.open = false;
292
- }
293
- const changedMenuItem = e.target;
294
- const changeItemIndex = this.menuItems.indexOf(changedMenuItem);
295
- if (changeItemIndex === -1) {
296
- return;
297
- }
298
- if (changedMenuItem.role === "menuitemradio" && changedMenuItem.checked) {
299
- for (let i = changeItemIndex - 1; i >= 0; --i) {
300
- const item = this.menuItems[i];
301
- const role = item.getAttribute("role");
302
- if (role === MenuItemRole.menuitemradio) {
303
- item.checked = false;
304
- }
305
- if (role === "separator") {
306
- break;
307
- }
308
- }
309
- const maxIndex = this.menuItems.length - 1;
310
- for (let i = changeItemIndex + 1; i <= maxIndex; ++i) {
311
- const item = this.menuItems[i];
312
- const role = item.getAttribute("role");
313
- if (role === MenuItemRole.menuitemradio) {
314
- item.checked = false;
315
- }
316
- if (role === "separator") {
317
- break;
318
- }
319
- }
320
- }
321
- return true;
322
- }
323
- };
324
- __decorateClass$1([
325
- observable
326
- ], _Menu.prototype, "items");
327
- __decorateClass$1([
328
- attr({ attribute: "aria-label" })
329
- ], _Menu.prototype, "ariaLabel");
330
- __decorateClass$1([
331
- attr({ mode: "fromView" })
332
- ], _Menu.prototype, "placement");
333
- __decorateClass$1([
334
- attr
335
- ], _Menu.prototype, "trigger");
336
- __decorateClass$1([
337
- attr({ mode: "boolean", attribute: "auto-dismiss" })
338
- ], _Menu.prototype, "autoDismiss");
339
- __decorateClass$1([
340
- attr({ mode: "fromView", attribute: "position-strategy" })
341
- ], _Menu.prototype, "positionStrategy");
342
- __decorateClass$1([
343
- attr({ mode: "boolean" })
344
- ], _Menu.prototype, "open");
345
- __decorateClass$1([
346
- observable
347
- ], _Menu.prototype, "headerSlottedContent");
348
- __decorateClass$1([
349
- observable
350
- ], _Menu.prototype, "actionItemsSlottedContent");
351
- let Menu = _Menu;
352
3
 
353
4
  var __defProp = Object.defineProperty;
354
5
  var __decorateClass = (decorators, target, key, kind) => {
@@ -359,429 +10,56 @@ var __decorateClass = (decorators, target, key, kind) => {
359
10
  if (result) __defProp(target, key, result);
360
11
  return result;
361
12
  };
362
- var CheckAppearance = /* @__PURE__ */ ((CheckAppearance2) => {
363
- CheckAppearance2["Normal"] = "normal";
364
- CheckAppearance2["TickOnly"] = "tick-only";
365
- return CheckAppearance2;
366
- })(CheckAppearance || {});
367
- class MenuItem extends VividElement {
368
- constructor() {
369
- super();
370
- // eslint-disable-next-line @nrwl/nx/workspace/no-attribute-default-value
371
- this.role = MenuItemRole.menuitem;
372
- this.hasSubmenu = false;
373
- this.currentDirection = Direction.ltr;
374
- /**
375
- * @internal
376
- */
377
- this.handleMenuItemClick = (e) => {
378
- if (e.defaultPrevented || this.disabled) {
379
- return false;
380
- }
381
- this.invoke();
382
- return false;
383
- };
384
- /**
385
- * @internal
386
- */
387
- this.handleMouseOver = (_) => {
388
- if (this.disabled || !this.hasSubmenu || this.expanded) {
389
- return false;
390
- }
391
- this.expanded = true;
392
- return false;
393
- };
394
- /**
395
- * @internal
396
- */
397
- this.handleMouseOut = (_) => {
398
- if (!this.expanded || this.contains(document.activeElement)) {
399
- return false;
400
- }
401
- this.expanded = false;
402
- return false;
403
- };
404
- this.invoke = () => {
405
- if (this.disabled) {
406
- return;
407
- }
408
- switch (this.role) {
409
- case MenuItemRole.menuitemcheckbox:
410
- this.checked = !this.checked;
411
- break;
412
- case MenuItemRole.menuitem:
413
- this.updateSubmenu();
414
- if (this.hasSubmenu) {
415
- this.expanded = true;
416
- } else {
417
- this.$emit("change");
418
- }
419
- break;
420
- case MenuItemRole.menuitemradio:
421
- if (!this.checked) {
422
- this.checked = true;
423
- }
424
- break;
425
- }
426
- };
427
- this.checkTrailing = false;
428
- this.#submenuArray = [];
429
- /**
430
- * @internal
431
- */
432
- this.handleMenuItemKeyDown = (e) => {
433
- if (e.defaultPrevented) {
434
- return false;
435
- }
436
- switch (e.key) {
437
- case keyEnter:
438
- case keySpace:
439
- this.invoke();
440
- if (!this.disabled) {
441
- this.#emitSyntheticClick();
442
- }
443
- return false;
444
- case keyArrowRight:
445
- if (this.hasSubmenu) {
446
- this.expanded = true;
447
- this.#emitSyntheticClick();
448
- }
449
- return false;
450
- case keyArrowLeft:
451
- if (this.expanded) {
452
- this.#emitSyntheticClick();
453
- this.expanded = false;
454
- this.focus();
455
- return false;
456
- }
457
- }
458
- return true;
459
- };
460
- this.#syntheticClickEvents = /* @__PURE__ */ new WeakSet();
461
- this.addEventListener("expanded-change", this.#expandedChange);
462
- }
463
- /**
464
- * @internal
465
- */
466
- expandedChanged() {
467
- if (this.$fastController.isConnected) {
468
- if (this.submenu === void 0) {
469
- return;
470
- }
471
- if (this.expanded === false) {
472
- this.submenu.collapseExpandedItem();
473
- } else {
474
- this.currentDirection = getDirection(this);
475
- }
476
- this.$emit("expanded-change", this, { bubbles: false });
477
- }
478
- }
479
- /**
480
- * @internal
481
- */
482
- checkedChanged() {
483
- if (this.$fastController.isConnected) {
484
- this.$emit("change");
485
- }
486
- }
487
- /**
488
- * @internal
489
- */
490
- connectedCallback() {
491
- super.connectedCallback();
492
- DOM.queueUpdate(() => {
493
- this.updateSubmenu();
494
- });
495
- this.observer = new MutationObserver(this.updateSubmenu);
496
- }
497
- /**
498
- * @internal
499
- */
500
- disconnectedCallback() {
501
- super.disconnectedCallback();
502
- this.submenu = void 0;
503
- if (this.observer !== void 0) {
504
- this.observer.disconnect();
505
- this.observer = void 0;
506
- }
507
- }
508
- #submenuArray;
509
- /**
510
- *
511
- *
512
- * @internal
513
- */
514
- slottedSubmenuChanged(_oldValue, newValue) {
515
- this.#submenuArray = newValue;
516
- }
517
- updateSubmenu() {
518
- for (const submenu of this.#submenuArray) {
519
- this.submenu = submenu;
520
- this.submenu.anchor = this;
521
- this.submenu.placement = "right-start";
522
- this.submenu.collapseExpandedItem = () => this.#collapseExpandedItem();
523
- }
524
- this.hasSubmenu = this.submenu === void 0 ? false : true;
525
- }
526
- #collapseExpandedItem() {
527
- this.expanded = false;
528
- }
529
- #expandedChange() {
530
- if (this.hasSubmenu) {
531
- this.submenu.open = this.expanded;
532
- }
533
- }
534
- #syntheticClickEvents;
535
- /**
536
- * @internal
537
- */
538
- _isSyntheticClickEvent(event) {
539
- return this.#syntheticClickEvents.has(event);
540
- }
541
- #emitSyntheticClick() {
542
- const mouseEvent = new MouseEvent("click", {
543
- bubbles: true,
544
- composed: true
545
- });
546
- this.#syntheticClickEvents.add(mouseEvent);
547
- this.dispatchEvent(mouseEvent);
548
- }
13
+ class Layout extends VividElement {
549
14
  }
550
- __decorateClass([
551
- attr({ mode: "boolean" })
552
- ], MenuItem.prototype, "disabled");
553
- __decorateClass([
554
- attr({ mode: "boolean" })
555
- ], MenuItem.prototype, "expanded");
556
15
  __decorateClass([
557
16
  attr
558
- ], MenuItem.prototype, "role");
17
+ ], Layout.prototype, "gutters");
559
18
  __decorateClass([
560
- attr({ mode: "boolean" })
561
- ], MenuItem.prototype, "checked");
19
+ attr({ attribute: "column-basis" })
20
+ ], Layout.prototype, "columnBasis");
562
21
  __decorateClass([
563
- observable
564
- ], MenuItem.prototype, "hasSubmenu");
22
+ attr({ attribute: "column-spacing" })
23
+ ], Layout.prototype, "columnSpacing");
565
24
  __decorateClass([
566
- observable
567
- ], MenuItem.prototype, "currentDirection");
25
+ attr({ attribute: "row-spacing" })
26
+ ], Layout.prototype, "rowSpacing");
568
27
  __decorateClass([
569
- observable
570
- ], MenuItem.prototype, "submenu");
571
- __decorateClass([
572
- attr
573
- ], MenuItem.prototype, "text");
574
- __decorateClass([
575
- attr({ attribute: "text-secondary" })
576
- ], MenuItem.prototype, "textSecondary");
577
- __decorateClass([
578
- attr
579
- ], MenuItem.prototype, "connotation");
580
- __decorateClass([
581
- attr({ mode: "boolean", attribute: "check-trailing" })
582
- ], MenuItem.prototype, "checkTrailing");
583
- __decorateClass([
584
- attr({ attribute: "check-appearance" })
585
- ], MenuItem.prototype, "checkedAppearance");
586
- __decorateClass([
587
- observable
588
- ], MenuItem.prototype, "metaSlottedContent");
589
- __decorateClass([
590
- observable
591
- ], MenuItem.prototype, "trailingMetaSlottedContent");
592
- __decorateClass([
593
- observable
594
- ], MenuItem.prototype, "slottedSubmenu");
595
- applyMixins(MenuItem, AffixIcon);
28
+ attr({ attribute: "auto-sizing" })
29
+ ], Layout.prototype, "autoSizing");
596
30
 
597
- const getIndicatorIcon = (x) => {
598
- if (x.checkedAppearance === CheckAppearance.TickOnly) {
599
- return x.checked ? "check-line" : "";
600
- }
601
- const iconType = x.role === MenuItemRole.menuitemcheckbox ? "checkbox" : "radio";
602
- const iconStatus = x.checked ? "checked" : "unchecked";
603
- return `${iconType}-${iconStatus}-2-line`;
604
- };
605
- const getClasses$1 = ({
606
- connotation,
607
- disabled,
608
- checked,
609
- role,
610
- text: text2,
611
- textSecondary,
612
- icon,
613
- metaSlottedContent,
614
- checkTrailing
615
- }) => classNames(
616
- "base",
617
- [`connotation-${connotation}`, Boolean(connotation)],
618
- ["disabled", Boolean(disabled)],
619
- ["selected", role !== MenuItemRole.menuitem && Boolean(checked)],
620
- [
621
- "trailing",
622
- role !== MenuItemRole.menuitem && (checkTrailing || Boolean(icon))
623
- ],
624
- ["item-checkbox", role === MenuItemRole.menuitemcheckbox],
625
- ["item-radio", role === MenuItemRole.menuitemradio],
626
- ["two-lines", Boolean(text2?.length) && Boolean(textSecondary?.length)],
627
- ["has-meta", Boolean(metaSlottedContent?.length)]
628
- );
629
- function handleClick(x, { event }) {
630
- if (x._isSyntheticClickEvent(event)) {
631
- return true;
632
- }
633
- x.handleMenuItemClick(event);
634
- return x.role === MenuItemRole.presentation;
635
- }
636
- function checkIndicator(context) {
637
- const iconTag = context.tagFor(Icon);
638
- return html`${when(
639
- (x) => x.role === MenuItemRole.menuitemcheckbox || x.role === MenuItemRole.menuitemradio,
640
- html`<span class="action"><${iconTag} class="icon" name="${(x) => getIndicatorIcon(x)}"></${iconTag}></span>`
641
- )}`;
642
- }
643
- function text() {
644
- return html`${when(
645
- (x) => x.text || x.textSecondary,
646
- html`<span class="text">
647
- ${when(
648
- (x) => x.text,
649
- html`<span class="text-primary">${(x) => x.text}</span>`
650
- )}
651
- ${when(
652
- (x) => x.textSecondary,
653
- html`<span class="text-secondary">${(x) => x.textSecondary}</span>`
654
- )}
655
- </span>`
656
- )}`;
657
- }
658
- const MenuItemTemplate = (context) => {
659
- const affixIconTemplate = affixIconTemplateFactory(context);
660
- const iconTag = context.tagFor(Icon);
661
- return html`
662
- <template
663
- role="${(x) => x.role ? x.role : MenuItemRole.menuitem}"
664
- aria-haspopup="${(x) => x.hasSubmenu ? "menu" : void 0}"
665
- aria-checked="${(x) => x.role !== MenuItemRole.menuitem ? x.checked : void 0}"
666
- aria-disabled="${(x) => x.disabled}"
667
- aria-expanded="${(x) => x.expanded}"
668
- @keydown="${(x, c) => x.handleMenuItemKeyDown(c.event)}"
669
- @click="${handleClick}"
670
- @mouseover="${(x, c) => x.handleMouseOver(c.event)}"
671
- @mouseout="${(x, c) => x.handleMouseOut(c.event)}"
672
- >
673
- <div class="${getClasses$1}">
674
- <slot name="meta" ${slotted("metaSlottedContent")}></slot>
675
- ${checkIndicator(context)}
676
- ${when(
677
- (x) => x.icon,
678
- html`<span class="decorative"
679
- >${(x) => affixIconTemplate(x.icon)}</span
680
- >`
681
- )}
682
- ${text()}
683
- <slot
684
- name="trailing-meta"
685
- ${slotted("trailingMetaSlottedContent")}
686
- ></slot>
687
- ${when(
688
- (x) => x.hasSubmenu,
689
- html`<${iconTag} class="chevron" name="chevron-right-line"></${iconTag}>`
690
- )}
691
- </div>
692
- <slot
693
- name="submenu"
694
- ${slotted({
695
- property: "slottedSubmenu",
696
- filter: elements(context.tagForNonDependency(menuName))
697
- })}
698
- ></slot>
699
- </template>
700
- `;
701
- };
702
-
703
- const menuItemDefinition = defineVividComponent(
704
- "menu-item",
705
- MenuItem,
706
- MenuItemTemplate,
707
- [iconDefinition],
708
- {
709
- styles: styles$1
710
- }
711
- );
712
- const registerMenuItem = createRegisterFunction(menuItemDefinition);
713
-
714
- const styles = ":host{display:var(--_popup-display, inline)}:host([slotted-anchor]){--_popup-display: contents}.base{display:flex;overflow:hidden auto;box-sizing:border-box;flex-direction:column;gap:8px;inline-size:max-content;max-block-size:var(--menu-block-size, 408px);min-inline-size:var(--menu-min-inline-size);padding-block:8px}@media not all and (width >= 600px){.base{max-inline-size:var(--menu-max-inline-size, 300px)}}@media (width >= 600px){.base{max-inline-size:var(--menu-max-inline-size)}}::slotted(a){color:var(--vvd-color-canvas-text);text-decoration:none}::slotted(a[role=menuitem]:focus-visible){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;display:block}.header{padding-block-start:4px;padding-inline:12px}.hide-header .header{display:none}.body{display:flex;flex-direction:column;row-gap:1px}.hide-body .body{display:none}.action-items{display:flex;justify-content:flex-end;gap:8px;padding-block-end:4px;padding-inline:12px}.hide-actions .action-items{display:none}";
31
+ const styles = ".control{display:grid;grid-auto-rows:var(--layout-grid-template-rows, min-content)}@media not all and (width >= 600px){.control.column-basis-medium,.control.column-basis-large{grid-template-columns:var(--layout-grid-template-columns, repeat(var(--_auto-sizing), minmax(100%, 1fr)))}}@media (width >= 600px){.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}";
715
32
 
716
33
  const getClasses = ({
717
- headerSlottedContent,
718
- actionItemsSlottedContent,
719
- items
34
+ columnBasis,
35
+ gutters,
36
+ columnSpacing,
37
+ autoSizing,
38
+ rowSpacing
720
39
  }) => classNames(
721
- "base",
722
- ["hide-header", !headerSlottedContent?.length],
723
- ["hide-actions", !actionItemsSlottedContent?.length],
724
- ["hide-body", items && !items.length]
40
+ "control",
41
+ [`column-basis-${columnBasis}`, Boolean(columnBasis)],
42
+ [`gutters-${gutters}`, Boolean(gutters)],
43
+ [`column-spacing-${columnSpacing}`, Boolean(columnSpacing)],
44
+ [
45
+ `row-spacing-${rowSpacing ? rowSpacing : columnSpacing}`,
46
+ Boolean(rowSpacing) || Boolean(columnSpacing)
47
+ ],
48
+ [`auto-sizing-${autoSizing}`, Boolean(autoSizing)]
725
49
  );
726
- function handleEscapeKey(menu, event) {
727
- if (menu.open && handleEscapeKeyAndStopPropogation(event)) {
728
- menu.open = false;
729
- }
730
- return true;
731
- }
732
- const MenuTemplate = (context) => {
733
- const popupTag = context.tagFor(Popup);
734
- const anchorSlotTemplate = anchorSlotTemplateFactory();
735
- function handlePopupEvents(x, e, state) {
736
- e.stopPropagation();
737
- x.open = state;
738
- }
739
- return html`
740
- <template role="presentation"
741
- @change="${(x, c) => x._onChange(c.event)}"
742
- @focusout="${(x, c) => x._onFocusout(c.event)}">
743
- ${anchorSlotTemplate}
744
- <${popupTag}
745
- ${ref("_popupEl")}
746
- :placement=${(x) => x.placement}
747
- :open=${(x) => x.open}
748
- :anchor=${(x) => x._anchorEl}
749
- :strategy="${(x) => x.positionStrategy}"
750
- @keydown="${(x, c) => handleEscapeKey(x, c.event)}"
751
- @vwc-popup:open="${(x, c) => handlePopupEvents(x, c.event, true)}"
752
- @vwc-popup:close="${(x, c) => handlePopupEvents(x, c.event, false)}"
753
- >
754
- <div class="${getClasses}">
755
- <div class="header">
756
- <slot name="header" ${slotted("headerSlottedContent")}></slot>
757
- </div>
758
- <div
759
- class="body"
760
- role="menu"
761
- aria-label="${(x) => x.ariaLabel}"
762
- @keydown="${(x, c) => x.handleMenuKeyDown(c.event)}"
763
- @focusout="${(x, c) => x.handleFocusOut(c.event)}"
764
- >
765
- <slot ${slotted("items")}></slot>
766
- </div>
767
- <footer class="action-items"><slot name="action-items" ${slotted(
768
- "actionItemsSlottedContent"
769
- )}></slot></footer>
770
- </div>
771
- </${popupTag}>
772
- </template>`;
773
- };
50
+ const layoutTemplate = html` <div class="${getClasses}">
51
+ <slot></slot>
52
+ </div>`;
774
53
 
775
- const menuName = "menu";
776
- const menuDefinition = defineVividComponent(
777
- menuName,
778
- Menu,
779
- MenuTemplate,
780
- [popupDefinition, menuItemDefinition],
54
+ const layoutDefinition = defineVividComponent(
55
+ "layout",
56
+ Layout,
57
+ layoutTemplate,
58
+ [],
781
59
  {
782
60
  styles
783
61
  }
784
62
  );
785
- const registerMenu = createRegisterFunction(menuDefinition);
63
+ const registerLayout = createRegisterFunction(layoutDefinition);
786
64
 
787
- export { MenuItem as M, MenuItemRole as a, menuName as b, menuDefinition as c, registerMenu as d, Menu as e, menuItemDefinition as m, registerMenuItem as r };
65
+ export { Layout as L, layoutDefinition as l, registerLayout as r };