@eunomia/elements 1.0.0-beta.6 → 1.0.0-beta.8

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 (327) hide show
  1. package/README.md +1 -1
  2. package/dist/cdn/components/chunks/{chunk-KDN4O5W2.js → chunk-32L2QYWQ.js} +5 -5
  3. package/dist/cdn/components/chunks/{chunk-JYIIWN2P.js → chunk-36KLGY6U.js} +8 -8
  4. package/dist/cdn/components/chunks/chunk-3BMACIDO.js +1 -0
  5. package/dist/cdn/components/chunks/{chunk-2Y2EU2CI.js → chunk-3UUZM7X2.js} +1 -1
  6. package/dist/cdn/components/chunks/chunk-55PUDL7D.js +109 -0
  7. package/dist/cdn/components/chunks/chunk-5LA5DQMP.js +1 -0
  8. package/dist/cdn/components/chunks/chunk-5LXGJVJR.js +1 -0
  9. package/dist/cdn/components/chunks/{chunk-ZKZV2YG5.js → chunk-5XPOGBPL.js} +1 -1
  10. package/dist/cdn/components/chunks/{chunk-LMVW522V.js → chunk-62RLISRD.js} +1 -1
  11. package/dist/cdn/components/chunks/{chunk-PMPSJG5V.js → chunk-6FYW5TQU.js} +3 -3
  12. package/dist/cdn/components/chunks/chunk-6TIEBY34.js +1 -0
  13. package/dist/cdn/components/chunks/{chunk-MOMYII3P.js → chunk-AH2SKZ7T.js} +14 -1
  14. package/dist/cdn/components/chunks/chunk-AK2DIJX7.js +1 -0
  15. package/dist/cdn/components/chunks/chunk-B5XMGWM7.js +10 -0
  16. package/dist/cdn/components/chunks/chunk-GVS6IUKC.js +1 -0
  17. package/dist/cdn/components/chunks/chunk-GWLD2I3P.js +8 -0
  18. package/dist/cdn/components/chunks/{chunk-UDVB4LAE.js → chunk-I4ERDXSM.js} +5 -3
  19. package/dist/cdn/components/chunks/{chunk-QZ5SHR3I.js → chunk-J3SZBXM6.js} +2 -2
  20. package/dist/cdn/components/chunks/chunk-JAGZL7JH.js +1 -0
  21. package/dist/cdn/components/chunks/{chunk-VYFR364B.js → chunk-LD35BFNK.js} +18 -17
  22. package/dist/cdn/components/chunks/{chunk-XDPRWUKN.js → chunk-MQQJ6DID.js} +1 -1
  23. package/dist/cdn/components/chunks/chunk-P6LGU3FT.js +1 -0
  24. package/dist/cdn/components/chunks/chunk-QL5GSW2A.js +1 -0
  25. package/dist/cdn/components/chunks/{chunk-UYZR4JXZ.js → chunk-QSZO4GIH.js} +45 -9
  26. package/dist/cdn/components/chunks/{chunk-7KKWYPHY.js → chunk-QXQ25SQS.js} +21 -19
  27. package/dist/cdn/components/chunks/{chunk-SZYEBMG6.js → chunk-QYB6Z6FG.js} +5 -5
  28. package/dist/cdn/components/chunks/{chunk-RIFF2D2F.js → chunk-RGC3I6MK.js} +1 -1
  29. package/dist/cdn/components/chunks/{chunk-L2ADCEN7.js → chunk-SVGWCKWT.js} +1 -1
  30. package/dist/cdn/components/chunks/{chunk-N6ZW5CDN.js → chunk-TCSB2MLU.js} +1 -1
  31. package/dist/cdn/components/chunks/{chunk-MQQ4BGVJ.js → chunk-TFTRCIIK.js} +7 -6
  32. package/dist/cdn/components/chunks/chunk-TLBXTBMM.js +46 -0
  33. package/dist/cdn/components/chunks/chunk-UVHVQRPT.js +1 -0
  34. package/dist/cdn/components/chunks/chunk-WIUERJII.js +1 -0
  35. package/dist/cdn/components/chunks/chunk-WW4BTWMH.js +1 -0
  36. package/dist/cdn/components/eun-alert.js +13 -6
  37. package/dist/cdn/components/eun-animate.js +6 -6
  38. package/dist/cdn/components/eun-badge.js +1 -1
  39. package/dist/cdn/components/eun-button.js +1 -1
  40. package/dist/cdn/components/eun-calendar.js +2 -2
  41. package/dist/cdn/components/eun-card.js +4 -4
  42. package/dist/cdn/components/eun-carousel.js +26 -22
  43. package/dist/cdn/components/eun-check-card.js +1 -1
  44. package/dist/cdn/components/eun-checkbox-list.js +11 -8
  45. package/dist/cdn/components/eun-checkbox.js +1 -1
  46. package/dist/cdn/components/eun-chip.js +17 -11
  47. package/dist/cdn/components/eun-collapse.js +1 -1
  48. package/dist/cdn/components/eun-color-picker.js +74 -69
  49. package/dist/cdn/components/eun-counter.js +16 -14
  50. package/dist/cdn/components/eun-date-picker.js +67 -63
  51. package/dist/cdn/components/eun-description-list.js +2 -2
  52. package/dist/cdn/components/eun-divider.js +3 -3
  53. package/dist/cdn/components/eun-drawer.js +21 -22
  54. package/dist/cdn/components/eun-dropdown-button.js +1 -1
  55. package/dist/cdn/components/eun-dropdown-item.js +3 -3
  56. package/dist/cdn/components/eun-fab.js +2 -2
  57. package/dist/cdn/components/eun-icon.js +1 -1
  58. package/dist/cdn/components/eun-image-card.js +1 -1
  59. package/dist/cdn/components/eun-image-carousel.js +10 -10
  60. package/dist/cdn/components/eun-infinite-list.js +1 -1
  61. package/dist/cdn/components/eun-input-file.js +21 -21
  62. package/dist/cdn/components/eun-input-phone.js +16 -12
  63. package/dist/cdn/components/eun-input.js +1 -1
  64. package/dist/cdn/components/eun-link.js +59 -13
  65. package/dist/cdn/components/eun-loader.js +1 -1
  66. package/dist/cdn/components/eun-modal.js +33 -23
  67. package/dist/cdn/components/eun-pagination.js +16 -16
  68. package/dist/cdn/components/eun-password-strength.js +14 -10
  69. package/dist/cdn/components/eun-radio-card.js +1 -1
  70. package/dist/cdn/components/eun-radio-list.js +11 -8
  71. package/dist/cdn/components/eun-radio.js +1 -1
  72. package/dist/cdn/components/eun-rating.js +276 -0
  73. package/dist/cdn/components/eun-scheduler-event-editor.js +11 -11
  74. package/dist/cdn/components/eun-scheduler-event.js +1 -1
  75. package/dist/cdn/components/eun-scheduler.js +28 -28
  76. package/dist/cdn/components/eun-search.js +36 -32
  77. package/dist/cdn/components/eun-select.js +27 -27
  78. package/dist/cdn/components/eun-sidebar.js +73 -26
  79. package/dist/cdn/components/eun-skeleton.js +1 -1
  80. package/dist/cdn/components/eun-slider.js +3 -3
  81. package/dist/cdn/components/eun-sliding-card.js +1 -1
  82. package/dist/cdn/components/eun-step.js +5 -4
  83. package/dist/cdn/components/eun-stepper.js +30 -30
  84. package/dist/cdn/components/eun-switch.js +1 -1
  85. package/dist/cdn/components/eun-tab-group.js +4 -4
  86. package/dist/cdn/components/eun-tab-panel.js +1 -1
  87. package/dist/cdn/components/eun-tab.js +1 -1
  88. package/dist/cdn/components/eun-table-action-bar.js +1 -1
  89. package/dist/cdn/components/eun-table.js +2 -2
  90. package/dist/cdn/components/eun-tag.js +3 -3
  91. package/dist/cdn/components/eun-textarea.js +36 -28
  92. package/dist/cdn/components/eun-time-picker.js +31 -28
  93. package/dist/cdn/components/eun-toast.js +24 -15
  94. package/dist/cdn/components/eun-toggle-group.js +75 -37
  95. package/dist/cdn/components/eun-toggle-item.js +9 -9
  96. package/dist/cdn/components/eun-toggle.js +2 -2
  97. package/dist/cdn/components/eun-toolbar.js +22 -22
  98. package/dist/cdn/components/eun-tooltip.js +6 -6
  99. package/dist/cdn/styles/eunomia-themes.css +1 -1
  100. package/dist/cdn/styles/themes/mixins/eunomia-neutrals.mixin.scss +6 -2
  101. package/dist/cdn/styles/themes/prebuilt-themes/eunomia/eunomia-dark.mixin.scss +6 -2
  102. package/dist/cdn/styles/themes/prebuilt-themes/eunomia/eunomia.theme.css +1 -1
  103. package/dist/cdn/styles/themes/prebuilt-themes/fire/eunomia-fire-dark.mixin.scss +6 -2
  104. package/dist/cdn/styles/themes/prebuilt-themes/fire/eunomia-fire.theme.css +1 -1
  105. package/dist/cdn/styles/themes/prebuilt-themes/forest/eunomia-forest-dark.mixin.scss +6 -2
  106. package/dist/cdn/styles/themes/prebuilt-themes/forest/eunomia-forest.theme.css +1 -1
  107. package/dist/cdn/styles/themes/prebuilt-themes/gold/eunomia-gold-dark.mixin.scss +6 -2
  108. package/dist/cdn/styles/themes/prebuilt-themes/gold/eunomia-gold.theme.css +1 -1
  109. package/dist/cdn/styles/themes/prebuilt-themes/ocean/eunomia-ocean-dark.mixin.scss +6 -2
  110. package/dist/cdn/styles/themes/prebuilt-themes/ocean/eunomia-ocean.theme.css +1 -1
  111. package/dist/cdn/styles/themes/prebuilt-themes/salmon/eunomia-salmon-dark.mixin.scss +6 -2
  112. package/dist/cdn/styles/themes/prebuilt-themes/salmon/eunomia-salmon.theme.css +1 -1
  113. package/dist/cdn/styles/themes/prebuilt-themes/violet/eunomia-violet-dark.mixin.scss +6 -2
  114. package/dist/cdn/styles/themes/prebuilt-themes/violet/eunomia-violet.theme.css +1 -1
  115. package/dist/components/action/button/button.d.ts +4 -3
  116. package/dist/components/action/button/button.js +6 -9
  117. package/dist/components/action/button/button.styles.js +13 -8
  118. package/dist/components/action/dropdown-button/dropdown-button.d.ts +4 -6
  119. package/dist/components/action/dropdown-button/dropdown-button.js +16 -13
  120. package/dist/components/action/dropdown-button/dropdown-item.d.ts +10 -2
  121. package/dist/components/action/dropdown-button/dropdown-item.js +24 -9
  122. package/dist/components/action/link/link.d.ts +10 -1
  123. package/dist/components/action/link/link.js +13 -1
  124. package/dist/components/action/link/link.styles.js +50 -3
  125. package/dist/components/action/toggle/toggle-group.d.ts +12 -2
  126. package/dist/components/action/toggle/toggle-group.js +18 -3
  127. package/dist/components/action/toggle/toggle-group.styles.js +58 -20
  128. package/dist/components/action/toggle/toggle-item.js +1 -3
  129. package/dist/components/action/toggle/toggle-item.styles.js +7 -7
  130. package/dist/components/action/toggle/toggle.js +1 -1
  131. package/dist/components/alert/alert/alert.d.ts +9 -7
  132. package/dist/components/alert/alert/alert.js +11 -14
  133. package/dist/components/alert/alert/alert.styles.js +9 -2
  134. package/dist/components/alert/drawer/drawer.d.ts +30 -5
  135. package/dist/components/alert/drawer/drawer.js +48 -13
  136. package/dist/components/alert/drawer/drawer.styles.js +7 -7
  137. package/dist/components/alert/modal/modal.d.ts +35 -10
  138. package/dist/components/alert/modal/modal.js +55 -28
  139. package/dist/components/alert/modal/modal.styles.js +17 -6
  140. package/dist/components/alert/toast/toast.d.ts +7 -5
  141. package/dist/components/alert/toast/toast.js +12 -15
  142. package/dist/components/alert/toast/toast.styles.js +18 -9
  143. package/dist/components/content/badge/badge.js +2 -2
  144. package/dist/components/content/card/card.js +1 -1
  145. package/dist/components/content/card/card.styles.js +2 -2
  146. package/dist/components/content/chip/chip.d.ts +4 -4
  147. package/dist/components/content/chip/chip.js +11 -10
  148. package/dist/components/content/chip/chip.styles.js +9 -3
  149. package/dist/components/content/description-list/description-list.js +3 -3
  150. package/dist/components/content/icon/icon.d.ts +3 -0
  151. package/dist/components/content/icon/icon.js +3 -0
  152. package/dist/components/content/icon/icon.style.d.ts +2 -0
  153. package/dist/components/content/icon/icon.style.js +4 -0
  154. package/dist/components/content/image-carousel/image-carousel.d.ts +12 -12
  155. package/dist/components/content/image-carousel/image-carousel.js +29 -28
  156. package/dist/components/content/password-strength/password-strength.d.ts +21 -6
  157. package/dist/components/content/password-strength/password-strength.js +37 -16
  158. package/dist/components/content/password-strength/password-strength.styles.js +4 -0
  159. package/dist/components/content/tag/tag.js +2 -2
  160. package/dist/components/content/tooltip/tooltip.d.ts +16 -9
  161. package/dist/components/content/tooltip/tooltip.js +31 -15
  162. package/dist/components/content/tooltip/tooltip.styles.js +1 -1
  163. package/dist/components/form/checkbox/check-card.d.ts +1 -0
  164. package/dist/components/form/checkbox/check-card.js +1 -0
  165. package/dist/components/form/checkbox/checkbox-list.d.ts +17 -0
  166. package/dist/components/form/checkbox/checkbox-list.js +39 -10
  167. package/dist/components/form/checkbox/checkbox.d.ts +1 -0
  168. package/dist/components/form/checkbox/checkbox.js +3 -1
  169. package/dist/components/form/checkbox/checkbox.styles.js +3 -2
  170. package/dist/components/form/color-picker/color-picker.d.ts +47 -28
  171. package/dist/components/form/color-picker/color-picker.js +73 -51
  172. package/dist/components/form/color-picker/color-picker.styles.js +14 -1
  173. package/dist/components/form/counter/counter.d.ts +24 -18
  174. package/dist/components/form/counter/counter.js +61 -61
  175. package/dist/components/form/counter/counter.styles.js +6 -4
  176. package/dist/components/form/date-picker/date-picker.d.ts +33 -7
  177. package/dist/components/form/date-picker/date-picker.js +82 -56
  178. package/dist/components/form/date-picker/date-picker.styles.js +9 -6
  179. package/dist/components/form/input/input.d.ts +43 -39
  180. package/dist/components/form/input/input.js +91 -110
  181. package/dist/components/form/input-file/input-file.d.ts +26 -13
  182. package/dist/components/form/input-file/input-file.js +35 -35
  183. package/dist/components/form/input-file/input-file.styles.js +4 -4
  184. package/dist/components/form/input-phone/input-phone.d.ts +28 -5
  185. package/dist/components/form/input-phone/input-phone.js +47 -13
  186. package/dist/components/form/input-phone/input-phone.styles.js +6 -3
  187. package/dist/components/form/radio/radio-card.d.ts +1 -0
  188. package/dist/components/form/radio/radio-card.js +1 -0
  189. package/dist/components/form/radio/radio-list.d.ts +23 -7
  190. package/dist/components/form/radio/radio-list.js +47 -22
  191. package/dist/components/form/radio/radio.d.ts +1 -0
  192. package/dist/components/form/radio/radio.js +1 -0
  193. package/dist/components/form/rating/rating.d.ts +349 -0
  194. package/dist/components/form/rating/rating.js +665 -0
  195. package/dist/components/form/rating/rating.styles.d.ts +1 -0
  196. package/dist/components/form/rating/rating.styles.js +213 -0
  197. package/dist/components/form/search/search.d.ts +72 -18
  198. package/dist/components/form/search/search.js +135 -72
  199. package/dist/components/form/search/search.styles.js +2 -0
  200. package/dist/components/form/select/select.d.ts +29 -10
  201. package/dist/components/form/select/select.js +65 -41
  202. package/dist/components/form/shared-styles/field.styles.js +45 -8
  203. package/dist/components/form/shared-styles/listbox.styles.js +15 -1
  204. package/dist/components/form/slider/slider.d.ts +7 -8
  205. package/dist/components/form/slider/slider.js +9 -12
  206. package/dist/components/form/switch/switch.d.ts +1 -0
  207. package/dist/components/form/switch/switch.js +1 -0
  208. package/dist/components/form/textarea/textarea.d.ts +90 -23
  209. package/dist/components/form/textarea/textarea.js +194 -44
  210. package/dist/components/form/textarea/textarea.styles.js +3 -0
  211. package/dist/components/form/time-picker/time-picker-columns.d.ts +2 -2
  212. package/dist/components/form/time-picker/time-picker-columns.js +8 -8
  213. package/dist/components/form/time-picker/time-picker.d.ts +30 -9
  214. package/dist/components/form/time-picker/time-picker.js +66 -40
  215. package/dist/components/form/time-picker/time-picker.styles.js +7 -5
  216. package/dist/components/layout/animate/animate.js +3 -2
  217. package/dist/components/layout/animate/animate.styles.js +2 -2
  218. package/dist/components/layout/divider/divider.js +1 -1
  219. package/dist/components/layout/divider/divider.styles.js +1 -1
  220. package/dist/components/loader/loader/loader.js +2 -2
  221. package/dist/components/loader/loader/loader.styles.js +14 -12
  222. package/dist/components/loader/skeleton/skeleton.js +1 -1
  223. package/dist/components/navigation/carousel/carousel.d.ts +32 -9
  224. package/dist/components/navigation/carousel/carousel.js +88 -41
  225. package/dist/components/navigation/carousel/carousel.styles.js +10 -6
  226. package/dist/components/navigation/pagination/pagination.d.ts +23 -21
  227. package/dist/components/navigation/pagination/pagination.js +30 -53
  228. package/dist/components/navigation/sidebar/sidebar.d.ts +113 -65
  229. package/dist/components/navigation/sidebar/sidebar.js +161 -118
  230. package/dist/components/navigation/sidebar/sidebar.styles.d.ts +1 -1
  231. package/dist/components/navigation/sidebar/sidebar.styles.js +74 -24
  232. package/dist/components/navigation/stepper/step.js +9 -8
  233. package/dist/components/navigation/stepper/stepper.d.ts +1 -3
  234. package/dist/components/navigation/stepper/stepper.js +15 -26
  235. package/dist/components/navigation/tabs/tab-group/tab-group.js +2 -2
  236. package/dist/components/navigation/tabs/tab-group/tab-group.styles.js +2 -2
  237. package/dist/components/navigation/toolbar/toolbar.d.ts +23 -13
  238. package/dist/components/navigation/toolbar/toolbar.js +28 -35
  239. package/dist/components/navigation/toolbar/toolbar.styles.js +18 -17
  240. package/dist/events/select.event.d.ts +3 -2
  241. package/dist/events/select.event.js +2 -1
  242. package/dist/features/scheduler/calendar/calendar.js +1 -1
  243. package/dist/features/scheduler/scheduler/scheduler.d.ts +7 -7
  244. package/dist/features/scheduler/scheduler/scheduler.js +15 -24
  245. package/dist/features/scheduler/scheduler-event/scheduler-event.js +3 -3
  246. package/dist/features/scheduler/scheduler-event/scheduler-event.styles.js +1 -1
  247. package/dist/features/scheduler/scheduler-event-editor/scheduler-event-editor.d.ts +6 -4
  248. package/dist/features/scheduler/scheduler-event-editor/scheduler-event-editor.js +7 -8
  249. package/dist/features/table/table/table.js +1 -1
  250. package/dist/features/table/table-action-bar/table-action-bar.js +2 -2
  251. package/dist/i18n/en.d.ts +68 -0
  252. package/dist/i18n/en.js +68 -0
  253. package/dist/i18n/fr.js +68 -2
  254. package/dist/index.d.ts +3 -0
  255. package/dist/index.js +1 -0
  256. package/dist/mixins/button.mixin.d.ts +1 -1
  257. package/dist/mixins/button.mixin.js +9 -6
  258. package/dist/mixins/check.mixin.js +11 -10
  259. package/dist/mixins/dialog-surface.mixin.d.ts +8 -0
  260. package/dist/mixins/disabled.mixin.d.ts +5 -0
  261. package/dist/mixins/disabled.mixin.js +21 -1
  262. package/dist/mixins/editable.mixin.js +28 -5
  263. package/dist/mixins/field-appearance.mixin.js +3 -2
  264. package/dist/mixins/field-size.mixin.d.ts +19 -0
  265. package/dist/mixins/field-size.mixin.js +33 -0
  266. package/dist/mixins/form.mixin.d.ts +4 -0
  267. package/dist/mixins/form.mixin.js +87 -13
  268. package/dist/mixins/localizable.mixin.d.ts +1 -1
  269. package/dist/mixins/localizable.mixin.js +1 -1
  270. package/dist/mixins/radio.mixin.js +11 -10
  271. package/dist/mixins/readonly.mixin.d.ts +2 -1
  272. package/dist/mixins/readonly.mixin.js +10 -3
  273. package/dist/mixins/rounded.mixin.d.ts +18 -0
  274. package/dist/mixins/rounded.mixin.js +32 -0
  275. package/dist/ssr/alert-ssr.css +187 -0
  276. package/dist/ssr/badge-ssr.css +67 -0
  277. package/dist/ssr/breadcrumb-ssr.css +41 -0
  278. package/dist/ssr/button-ssr.css +5 -5
  279. package/dist/ssr/card-ssr.css +27 -15
  280. package/dist/ssr/carousel-ssr.css +247 -0
  281. package/dist/ssr/checkbox-ssr.css +67 -0
  282. package/dist/ssr/chip-ssr.css +250 -0
  283. package/dist/ssr/collapse-ssr.css +180 -0
  284. package/dist/ssr/field-ssr.css +202 -0
  285. package/dist/ssr/icon-ssr.css +266 -0
  286. package/dist/ssr/image-carousel-ssr.css +34 -0
  287. package/dist/ssr/links-ssr.css +44 -1
  288. package/dist/ssr/pagination-ssr.css +4 -0
  289. package/dist/ssr/rating-ssr.css +254 -0
  290. package/dist/ssr/sidebar-ssr.css +102 -3
  291. package/dist/ssr/skeleton-ssr.css +63 -0
  292. package/dist/ssr/tabs-ssr.css +129 -0
  293. package/dist/ssr/toggle-group-ssr.css +233 -0
  294. package/dist/ssr/toolbar-ssr.css +81 -2
  295. package/dist/types/variant.type.d.ts +4 -1
  296. package/dist/utils/boolean.utils.d.ts +14 -0
  297. package/dist/utils/boolean.utils.js +20 -0
  298. package/dist/utils/dropdown-menu.utils.d.ts +1 -1
  299. package/dist/utils/focusable-elements.utils.d.ts +12 -0
  300. package/dist/utils/focusable-elements.utils.js +26 -0
  301. package/dist/utils/implicit-submission.utils.d.ts +18 -0
  302. package/dist/utils/implicit-submission.utils.js +79 -0
  303. package/dist/utils/input-modality.utils.d.ts +13 -0
  304. package/dist/utils/input-modality.utils.js +34 -0
  305. package/dist/utils/listbox-options.utils.d.ts +11 -0
  306. package/dist/utils/listbox-options.utils.js +41 -3
  307. package/dist/utils/theme-generator.utils.d.ts +8 -2
  308. package/dist/utils/theme-generator.utils.js +30 -9
  309. package/package.json +26 -7
  310. package/styles/themes/mixins/eunomia-neutrals.mixin.scss +6 -2
  311. package/styles/themes/prebuilt-themes/eunomia/eunomia-dark.mixin.scss +6 -2
  312. package/styles/themes/prebuilt-themes/fire/eunomia-fire-dark.mixin.scss +6 -2
  313. package/styles/themes/prebuilt-themes/forest/eunomia-forest-dark.mixin.scss +6 -2
  314. package/styles/themes/prebuilt-themes/gold/eunomia-gold-dark.mixin.scss +6 -2
  315. package/styles/themes/prebuilt-themes/ocean/eunomia-ocean-dark.mixin.scss +6 -2
  316. package/styles/themes/prebuilt-themes/salmon/eunomia-salmon-dark.mixin.scss +6 -2
  317. package/styles/themes/prebuilt-themes/violet/eunomia-violet-dark.mixin.scss +6 -2
  318. package/dist/cdn/components/chunks/chunk-4PI6RDUS.js +0 -1
  319. package/dist/cdn/components/chunks/chunk-6VK6SHCG.js +0 -1
  320. package/dist/cdn/components/chunks/chunk-A3X4KD2X.js +0 -1
  321. package/dist/cdn/components/chunks/chunk-BQFJR2UP.js +0 -110
  322. package/dist/cdn/components/chunks/chunk-G5SBDQQ3.js +0 -1
  323. package/dist/cdn/components/chunks/chunk-KSZRQRN4.js +0 -1
  324. package/dist/cdn/components/chunks/chunk-PE4DAXHQ.js +0 -3
  325. package/dist/cdn/components/chunks/chunk-RS7TWEMQ.js +0 -1
  326. package/dist/cdn/components/chunks/chunk-UDOZRIJZ.js +0 -1
  327. package/dist/cdn/components/chunks/chunk-VOTRXBDS.js +0 -38
@@ -33,20 +33,64 @@ export const toggleGroupStyles = css `
33
33
  --toggle-group-arrows-color,
34
34
  var(--eun-surface-color, #ffffff)
35
35
  );
36
+ --_toggleDefaultRadius: var(--eun-border-radius-m, 8px);
37
+ --_toggleRadius: var(
38
+ --toggle-group-border-radius,
39
+ var(--_toggleDefaultRadius)
40
+ );
41
+ --_toggleFontSize: var(--eun-font-size-s, 14px);
42
+ --_toggleButtonPaddingBlock: var(--eun-space-s, 8px);
43
+ --_toggleOptionPaddingInline: calc(var(--eun-space-l, 32px) / 2);
44
+ --_toggleLineHeight: 1rem;
36
45
  --_trackPaddingBlock: var(
37
46
  --toggle-group-padding,
38
- var(--toggle-group-padding-block, 4px)
47
+ var(
48
+ --toggle-group-padding-block,
49
+ calc(var(--_toggleButtonPaddingBlock) / 2)
50
+ )
39
51
  );
40
52
  --_trackPaddingInline: var(
41
53
  --toggle-group-padding,
42
54
  var(--toggle-group-padding-inline, 4px)
43
55
  );
56
+ --_toggleOptionPaddingBlock: max(
57
+ 0px,
58
+ calc(var(--_toggleButtonPaddingBlock) - var(--_trackPaddingBlock))
59
+ );
44
60
  --_focusRoom: 0px;
45
61
  font-family: var(--eun-font-family, "Mulish", sans-serif);
46
- font-size: var(--eun-font-size-s, 14px);
62
+ font-size: var(--_toggleFontSize);
63
+ }
64
+ :host([rounded]) {
65
+ --_toggleDefaultRadius: var(--eun-border-radius-xl, 999px);
66
+ }
67
+ :host([size="xs"]) {
68
+ --_toggleFontSize: var(--eun-font-size-xs, 10px);
69
+ --_toggleButtonPaddingBlock: var(--eun-space-xxs, 1.6px);
70
+ --_toggleOptionPaddingInline: var(--eun-space-xs, 4px);
71
+ --_toggleLineHeight: 10px;
72
+ }
73
+ :host([size="s"]) {
74
+ --_toggleFontSize: var(--eun-font-size-xs, 10px);
75
+ --_toggleButtonPaddingBlock: calc(var(--eun-space-s, 8px) / 2);
76
+ --_toggleOptionPaddingInline: var(--eun-space-s, 8px);
77
+ --_toggleLineHeight: 10px;
78
+ }
79
+ :host([size="l"]) {
80
+ --_toggleFontSize: var(--eun-font-size-m, 16px);
81
+ --_toggleButtonPaddingBlock: calc(var(--eun-space-s, 8px) * 1.25);
82
+ --_toggleOptionPaddingInline: calc(var(--eun-space-m, 16px) * 1.25);
83
+ --_toggleLineHeight: 1.1rem;
84
+ }
85
+ :host([size="xl"]) {
86
+ --_toggleFontSize: var(--eun-font-size-l, 1.3rem);
87
+ --_toggleButtonPaddingBlock: calc(var(--eun-space-s, 8px) * 1.5);
88
+ --_toggleOptionPaddingInline: calc(var(--eun-space-m, 16px) * 1.5);
89
+ --_toggleLineHeight: 1.3rem;
47
90
  }
48
91
  :host([appearance="outline"]),
49
92
  :host([appearance="flat"]) {
93
+ --_toggleOptionPaddingBlock: var(--_toggleButtonPaddingBlock);
50
94
  --_focusRoom: 4px;
51
95
  --_arrowsColor: var(
52
96
  --toggle-group-arrows-color,
@@ -74,10 +118,7 @@ export const toggleGroupStyles = css `
74
118
  max-width: 100%;
75
119
  gap: var(--toggle-group-gap, var(--eun-space-xs, 4px));
76
120
  padding: var(--_trackPaddingBlock) var(--_trackPaddingInline);
77
- border-radius: var(
78
- --toggle-group-border-radius,
79
- var(--eun-border-radius-m, 8px)
80
- );
121
+ border-radius: var(--_toggleRadius);
81
122
  background: var(
82
123
  --toggle-group-background,
83
124
  var(--eun-surface-sunken, #f7f8fa)
@@ -178,9 +219,7 @@ export const toggleGroupStyles = css `
178
219
  width: 0;
179
220
  opacity: 0;
180
221
  z-index: 0;
181
- border-radius: calc(
182
- var(--toggle-group-border-radius, var(--eun-border-radius-m, 8px)) - 3px
183
- );
222
+ border-radius: calc(var(--_toggleRadius) - 3px);
184
223
  background: var(
185
224
  --toggle-group-active-background,
186
225
  var(--eun-color-primary-500, #3d6fff)
@@ -232,12 +271,12 @@ export const toggleGroupStyles = css `
232
271
  border: none;
233
272
  background: transparent;
234
273
  color: var(--toggle-group-color, var(--eun-color-grey-600, #666e8a));
235
- padding: calc(var(--eun-space-xs, 4px) * 1.5) var(--eun-space-m, 16px);
274
+ --icon-size: var(--_toggleLineHeight);
275
+ padding: var(--_toggleOptionPaddingBlock) var(--_toggleOptionPaddingInline);
276
+ line-height: var(--_toggleLineHeight);
236
277
  font-weight: var(--eun-font-weight-m, 500);
237
278
  outline: 2px solid transparent;
238
- border-radius: calc(
239
- var(--toggle-group-border-radius, var(--eun-border-radius-m, 8px)) - 3px
240
- );
279
+ border-radius: calc(var(--_toggleRadius) - 3px);
241
280
  box-shadow: var(--_boxShadow);
242
281
  transition: var(
243
282
  --_toggleTransition,
@@ -272,13 +311,15 @@ export const toggleGroupStyles = css `
272
311
  button[disabled] {
273
312
  cursor: not-allowed;
274
313
  }
275
- :host([appearance="default"]) #scrollable:has(#indicator) button.active {
314
+ :host(:is([appearance="default"], :not([appearance])))
315
+ #scrollable:has(#indicator)
316
+ button.active {
276
317
  color: var(
277
318
  --toggle-group-active-color,
278
319
  var(--eun-color-on-primary-500, #ffffff)
279
320
  );
280
321
  }
281
- :host([appearance="default"])
322
+ :host(:is([appearance="default"], :not([appearance])))
282
323
  #scrollable:not(:has(#indicator))
283
324
  button.active {
284
325
  background: var(
@@ -292,7 +333,7 @@ export const toggleGroupStyles = css `
292
333
  }
293
334
  button.icon-only {
294
335
  justify-content: center;
295
- padding: 6px;
336
+ padding: var(--_toggleOptionPaddingBlock);
296
337
  }
297
338
 
298
339
  button[data-color="secondary"] {
@@ -313,10 +354,7 @@ export const toggleGroupStyles = css `
313
354
  }
314
355
  :host([appearance="outline"]) button,
315
356
  :host([appearance="flat"]) button {
316
- border-radius: var(
317
- --toggle-group-border-radius,
318
- var(--eun-border-radius-m, 8px)
319
- );
357
+ border-radius: var(--_toggleRadius);
320
358
  }
321
359
  :host([appearance="outline"]) button {
322
360
  border: var(--eun-border-width-s, 1px) solid
@@ -105,9 +105,7 @@ let EunomiaToggleItem = class EunomiaToggleItem extends DisabledMixin(LitElement
105
105
  return html `
106
106
  <div id="item" part="item">
107
107
  <slot name="icon">
108
- ${this.icon
109
- ? html `<eun-icon name=${this.icon} size="16"></eun-icon>`
110
- : nothing}
108
+ ${this.icon ? html `<eun-icon name=${this.icon}></eun-icon>` : nothing}
111
109
  </slot>
112
110
  <slot></slot>
113
111
  </div>
@@ -28,15 +28,18 @@ export const toggleItemStyles = css `
28
28
  display: inline-flex;
29
29
  align-items: center;
30
30
  gap: var(--eun-space-xs, 4px);
31
+ --icon-size: var(--_toggleLineHeight, 1rem);
31
32
  font-family: var(--eun-font-family, "Mulish", sans-serif);
32
- font-size: var(--eun-font-size-s, 14px);
33
+ font-size: var(--_toggleFontSize, var(--eun-font-size-s, 14px));
34
+ line-height: var(--_toggleLineHeight, 1rem);
33
35
  font-weight: var(--eun-font-weight-m, 500);
34
36
  white-space: nowrap;
35
37
  cursor: pointer;
36
38
  color: var(--toggle-group-color, var(--eun-color-grey-600, #666e8a));
37
- padding: 6px 14px;
39
+ padding: var(--_toggleOptionPaddingBlock, calc(var(--eun-space-s, 8px) / 2))
40
+ var(--_toggleOptionPaddingInline, calc(var(--eun-space-l, 32px) / 2));
38
41
  border-radius: calc(
39
- var(--toggle-group-border-radius, var(--eun-border-radius-m, 8px)) - 3px
42
+ var(--_toggleRadius, var(--eun-border-radius-m, 8px)) - 3px
40
43
  );
41
44
  outline: 2px solid transparent;
42
45
  box-shadow: var(--_boxShadow);
@@ -116,10 +119,7 @@ export const toggleItemStyles = css `
116
119
  }
117
120
  :host([appearance="outline"]) #item,
118
121
  :host([appearance="flat"]) #item {
119
- border-radius: var(
120
- --toggle-group-border-radius,
121
- var(--eun-border-radius-m, 8px)
122
- );
122
+ border-radius: var(--_toggleRadius, var(--eun-border-radius-m, 8px));
123
123
  }
124
124
  :host([appearance="outline"]) #item {
125
125
  border: var(--eun-border-width-s, 1px) solid
@@ -161,7 +161,7 @@ __decorate([
161
161
  property({ type: Boolean, reflect: true })
162
162
  ], EunomiaToggle.prototype, "swap", void 0);
163
163
  __decorate([
164
- property({ reflect: true })
164
+ property({ reflect: true, useDefault: true })
165
165
  ], EunomiaToggle.prototype, "appearance", void 0);
166
166
  EunomiaToggle = __decorate([
167
167
  customElement(EunomiaToggleTagName)
@@ -13,6 +13,7 @@ type AlertSeverity = EunomiaSeverity;
13
13
  * All available alert surface treatments.
14
14
  */
15
15
  type AlertAppearance = EunomiaDisplayAppearance;
16
+ declare const EunomiaAlert_base: import("../../../utils/constructor.type.js").Constructor<import("../../../mixins/localizable.mixin.js").LocalizableMixinInterface> & typeof LitElement;
16
17
  /**
17
18
  * An inline banner that relays information to the user without
18
19
  * interrupting their current task, such as a form submission result, a
@@ -44,8 +45,8 @@ type AlertAppearance = EunomiaDisplayAppearance;
44
45
  * @prop {string} [richText] - Lightweight formatted content rendered above the description slot, combining with it. Supports simple lists, links, bold, and italic text
45
46
  * @attr {string} [rich-text] - Lightweight formatted content rendered above the description slot
46
47
  * @prop {boolean} [closeable=false] - Shows a close button. Clicking it fires the close event without changing the alert's own rendering
47
- * @prop {string} [ariaLabelClose='Close'] - The accessible label of the close button
48
- * @attr {string} [aria-label-close='Close'] - The accessible label of the close button
48
+ * @prop {string} [closeLabel] - The accessible label of the close button. Defaults to the localized string for the current locale (English: "Close")
49
+ * @attr {string} [close-label] - The accessible label of the close button. Defaults to the localized string for the current locale (English: "Close")
49
50
  * @cssprop [--alert-background-color] - Sets the background color, for every appearance and severity
50
51
  * @cssprop [--alert-border-color] - Sets the border color, for every appearance and severity: the leading accent of the default appearance, and the border of every other one
51
52
  * @cssprop [--alert-border-width] - Sets the border width, for every appearance. The border takes room out of the padding, so it keeps its size
@@ -58,10 +59,10 @@ type AlertAppearance = EunomiaDisplayAppearance;
58
59
  * @cssprop [--alert-padding-inline] - Sets the horizontal padding, as one length applied to both sides. Ignored when --alert-padding is set
59
60
  * @cssprop [--alert-gap] - Sets the gap between the icon column and the heading and content column
60
61
  * @cssprop [--alert-row-gap] - Sets the gap between the heading, description, and action rows
61
- * @cssprop [--alert-focus-outline-color] - Sets the focus outline color of the close button
62
+ * @cssprop [--alert-focus-outline-color] - Sets the focus outline color of the close button, and of the alert itself when it's given focus
62
63
  * @element eun-alert
63
64
  */
64
- export declare class EunomiaAlert extends LitElement {
65
+ export declare class EunomiaAlert extends EunomiaAlert_base {
65
66
  /**
66
67
  * Styles to import to the component.
67
68
  *
@@ -75,7 +76,8 @@ export declare class EunomiaAlert extends LitElement {
75
76
  */
76
77
  severity?: AlertSeverity;
77
78
  /**
78
- * The surface treatment of the alert.
79
+ * The surface treatment of the alert. The default isn't reflected, so an
80
+ * SSR framework doesn't see an attribute it never rendered.
79
81
  * @default default
80
82
  */
81
83
  appearance: AlertAppearance;
@@ -108,9 +110,9 @@ export declare class EunomiaAlert extends LitElement {
108
110
  closeable: boolean;
109
111
  /**
110
112
  * Accessible label of the close button.
111
- * @default Close
113
+ * Falls back to the localized string for the current locale when unset.
112
114
  */
113
- ariaLabelClose: string;
115
+ closeLabel?: string;
114
116
  /**
115
117
  * Elements assigned to the `description` slot, if any ; queried live so
116
118
  * {@link render} can decide whether the description row should render at
@@ -12,6 +12,7 @@ import { CloseEvent } from "../../../events/close.event.js";
12
12
  import { formatRichText } from "../../../utils/rich-text.utils.js";
13
13
  import { resolveIcon } from "../../../utils/severity-icon.utils.js";
14
14
  import { alertStyles } from "./alert.styles.js";
15
+ import { LocalizableMixin } from "../../../mixins/localizable.mixin.js";
15
16
  /**
16
17
  * Tag name of the alert component.
17
18
  */
@@ -47,8 +48,8 @@ export const EunomiaAlertTagName = "eun-alert";
47
48
  * @prop {string} [richText] - Lightweight formatted content rendered above the description slot, combining with it. Supports simple lists, links, bold, and italic text
48
49
  * @attr {string} [rich-text] - Lightweight formatted content rendered above the description slot
49
50
  * @prop {boolean} [closeable=false] - Shows a close button. Clicking it fires the close event without changing the alert's own rendering
50
- * @prop {string} [ariaLabelClose='Close'] - The accessible label of the close button
51
- * @attr {string} [aria-label-close='Close'] - The accessible label of the close button
51
+ * @prop {string} [closeLabel] - The accessible label of the close button. Defaults to the localized string for the current locale (English: "Close")
52
+ * @attr {string} [close-label] - The accessible label of the close button. Defaults to the localized string for the current locale (English: "Close")
52
53
  * @cssprop [--alert-background-color] - Sets the background color, for every appearance and severity
53
54
  * @cssprop [--alert-border-color] - Sets the border color, for every appearance and severity: the leading accent of the default appearance, and the border of every other one
54
55
  * @cssprop [--alert-border-width] - Sets the border width, for every appearance. The border takes room out of the padding, so it keeps its size
@@ -61,14 +62,15 @@ export const EunomiaAlertTagName = "eun-alert";
61
62
  * @cssprop [--alert-padding-inline] - Sets the horizontal padding, as one length applied to both sides. Ignored when --alert-padding is set
62
63
  * @cssprop [--alert-gap] - Sets the gap between the icon column and the heading and content column
63
64
  * @cssprop [--alert-row-gap] - Sets the gap between the heading, description, and action rows
64
- * @cssprop [--alert-focus-outline-color] - Sets the focus outline color of the close button
65
+ * @cssprop [--alert-focus-outline-color] - Sets the focus outline color of the close button, and of the alert itself when it's given focus
65
66
  * @element eun-alert
66
67
  */
67
- let EunomiaAlert = class EunomiaAlert extends LitElement {
68
+ let EunomiaAlert = class EunomiaAlert extends LocalizableMixin(LitElement) {
68
69
  constructor() {
69
70
  super(...arguments);
70
71
  /**
71
- * The surface treatment of the alert.
72
+ * The surface treatment of the alert. The default isn't reflected, so an
73
+ * SSR framework doesn't see an attribute it never rendered.
72
74
  * @default default
73
75
  */
74
76
  this.appearance = "default";
@@ -83,11 +85,6 @@ let EunomiaAlert = class EunomiaAlert extends LitElement {
83
85
  * @default false
84
86
  */
85
87
  this.closeable = false;
86
- /**
87
- * Accessible label of the close button.
88
- * @default Close
89
- */
90
- this.ariaLabelClose = "Close";
91
88
  /**
92
89
  * Re-renders when a named slot's assigned content changes, so the
93
90
  * description/action rows correctly appear/disappear as content is slotted
@@ -179,7 +176,7 @@ let EunomiaAlert = class EunomiaAlert extends LitElement {
179
176
  appearance="ghost"
180
177
  rounded
181
178
  size="xs"
182
- aria-label=${this.ariaLabelClose}
179
+ aria-label=${this.closeLabel ?? this.dictionary.common.close}
183
180
  @click=${this.handleClose}
184
181
  >
185
182
  <eun-icon name="close" size="16"></eun-icon>
@@ -235,7 +232,7 @@ __decorate([
235
232
  property({ reflect: true })
236
233
  ], EunomiaAlert.prototype, "severity", void 0);
237
234
  __decorate([
238
- property({ reflect: true })
235
+ property({ reflect: true, useDefault: true })
239
236
  ], EunomiaAlert.prototype, "appearance", void 0);
240
237
  __decorate([
241
238
  property()
@@ -253,8 +250,8 @@ __decorate([
253
250
  property({ type: Boolean, reflect: true })
254
251
  ], EunomiaAlert.prototype, "closeable", void 0);
255
252
  __decorate([
256
- property({ attribute: "aria-label-close" })
257
- ], EunomiaAlert.prototype, "ariaLabelClose", void 0);
253
+ property({ attribute: "close-label" })
254
+ ], EunomiaAlert.prototype, "closeLabel", void 0);
258
255
  __decorate([
259
256
  queryAssignedElements({ slot: "description" })
260
257
  ], EunomiaAlert.prototype, "descriptionSlotEls", void 0);
@@ -15,7 +15,7 @@ import { css } from "lit";
15
15
  * [--alert-padding-inline] - Set a custom horizontal padding, as one length applied to both sides. Ignored when --alert-padding is set
16
16
  * [--alert-gap] - Set a custom gap between the icon column and the heading/content column
17
17
  * [--alert-row-gap] - Set a custom gap between the heading, description, and action rows
18
- * [--alert-focus-outline-color] - Set a custom focus outline color for the close button
18
+ * [--alert-focus-outline-color] - Set a custom focus outline color for the close button, and for the alert itself when it's given focus
19
19
  */
20
20
  const base = css `
21
21
  :host {
@@ -23,6 +23,12 @@ const base = css `
23
23
  width: 100%;
24
24
  box-sizing: border-box;
25
25
  font-family: var(--eun-font-family, "Mulish", sans-serif);
26
+ border-radius: var(--alert-border-radius, var(--eun-border-radius-m, 8px));
27
+ }
28
+ :host(:focus-visible) {
29
+ outline: 2px solid
30
+ var(--alert-focus-outline-color, var(--eun-color-primary-500, #3d6fff));
31
+ outline-offset: 2px;
26
32
  }
27
33
 
28
34
  :host(:not([severity])) {
@@ -98,7 +104,8 @@ const base = css `
98
104
  grid-column: 1;
99
105
  }
100
106
 
101
- :host([appearance="default"]) #alert {
107
+ :host([appearance="default"]) #alert,
108
+ :host(:not([appearance])) #alert {
102
109
  background: linear-gradient(
103
110
  to right,
104
111
  var(--alert-border-color, var(--_borderColor)) 4px,
@@ -1,4 +1,5 @@
1
1
  import { LitElement, PropertyValues, TemplateResult } from "lit";
2
+ import { EunomiaDialogInitialFocus } from "../../../mixins/dialog-surface.mixin.js";
2
3
  /**
3
4
  * Tag name of the drawer component.
4
5
  */
@@ -7,7 +8,7 @@ export declare const EunomiaDrawerTagName = "eun-drawer";
7
8
  * Which edge of the viewport the drawer slides in from.
8
9
  */
9
10
  export type EunomiaDrawerPosition = "start" | "end";
10
- declare const EunomiaDrawer_base: import("../../../utils/constructor.type.js").Constructor<import("../../../mixins/dialog-surface.mixin.js").DialogSurfaceMixinInterface> & typeof LitElement;
11
+ declare const EunomiaDrawer_base: import("../../../utils/constructor.type.js").Constructor<import("../../../mixins/dialog-surface.mixin.js").DialogSurfaceMixinInterface> & import("../../../utils/constructor.type.js").Constructor<import("../../../mixins/localizable.mixin.js").LocalizableMixinInterface> & typeof LitElement;
11
12
  /**
12
13
  * A full-height side panel that behaves as a modal overlay, sliding in from
13
14
  * an edge of the screen. It's the same idea as a modal turned into a
@@ -32,8 +33,9 @@ declare const EunomiaDrawer_base: import("../../../utils/constructor.type.js").C
32
33
  * @prop {boolean} [open=false] - Whether the drawer is open
33
34
  * @prop {boolean} [closeOnBackdrop=true] - Whether clicking outside the drawer requests a close
34
35
  * @prop {boolean} [dirty=false] - Marks the drawer as having unsaved changes, requiring confirmation before it closes
35
- * @prop {string} ariaLabelClose - The accessible label of the close button
36
- * @attr {string} [aria-label-close='Close'] - The accessible label of the close button
36
+ * @prop {'auto' | 'first-field'} [initialFocus='auto'] - Where focus lands on open. First-field focuses the first focusable element of the body when the drawer was opened from the keyboard, and behaves like auto after a click or a touch, so a mobile virtual keyboard doesn't pop up on its own. A slotted autofocus element always wins
37
+ * @prop {string} [closeLabel] - The accessible label of the close button. Defaults to the localized string for the current locale (English: "Close")
38
+ * @attr {string} [close-label] - The accessible label of the close button. Defaults to the localized string for the current locale (English: "Close")
37
39
  * @prop {string} [confirmCloseHeading='Discard changes?'] - The heading of the internal discard confirmation dialog
38
40
  * @attr {string} [confirm-close-heading='Discard changes?'] - The heading of the internal discard confirmation dialog
39
41
  * @prop {string} confirmCloseDescription - The description of the internal discard confirmation dialog
@@ -52,6 +54,7 @@ declare const EunomiaDrawer_base: import("../../../utils/constructor.type.js").C
52
54
  * @cssprop [--drawer-padding-block] - Sets the vertical padding, as one length applied to both sides. Ignored when --drawer-padding is set
53
55
  * @cssprop [--drawer-padding-inline] - Sets the horizontal padding, as one length applied to both sides. Ignored when --drawer-padding is set
54
56
  * @cssprop [--drawer-gap] - Sets the gap inside the header and footer rows
57
+ * @cssprop [--drawer-header-padding-bottom] - Sets the padding below the header, --drawer-gap by default
55
58
  * @cssprop [--drawer-transition-duration] - Sets the duration of the slide transition
56
59
  * @element eun-drawer
57
60
  */
@@ -96,11 +99,26 @@ export declare class EunomiaDrawer extends EunomiaDrawer_base {
96
99
  * @default false
97
100
  */
98
101
  dirty: boolean;
102
+ /**
103
+ * Where focus lands on open. `auto` keeps the default target described
104
+ * on {@link focusInitialElement}. `first-field` focuses the first
105
+ * focusable element of the body when the drawer was opened from the
106
+ * keyboard, and behaves like `auto` after a click or a touch, so a
107
+ * mobile virtual keyboard doesn't pop up on its own. A slotted
108
+ * `[autofocus]` element always wins.
109
+ * @default auto
110
+ */
111
+ initialFocus: EunomiaDialogInitialFocus;
112
+ /**
113
+ * The body wrapping the default slot, searched by `initial-focus="first-field"`.
114
+ * @internal
115
+ */
116
+ private readonly bodyEl?;
99
117
  /**
100
118
  * Accessible label of the close (X) button.
101
- * @default Close
119
+ * Falls back to the localized string for the current locale when unset.
102
120
  */
103
- ariaLabelClose: string;
121
+ closeLabel?: string;
104
122
  /**
105
123
  * Heading of the internal discard-confirmation dialog.
106
124
  * @default Discard changes?
@@ -252,6 +270,13 @@ export declare class EunomiaDrawer extends EunomiaDrawer_base {
252
270
  * @private
253
271
  */
254
272
  private readonly handleDiscardConfirmed;
273
+ /**
274
+ * Focuses the body's first focusable element when `initialFocus` is
275
+ * `first-field` and the latest interaction came from the keyboard.
276
+ * @returns whether an element was focused.
277
+ * @private
278
+ */
279
+ private focusFirstField;
255
280
  /**
256
281
  * Focuses the `[autofocus]` slotted element if present, otherwise the
257
282
  * drawer panel itself.
@@ -10,8 +10,12 @@ import { ifDefined } from "lit/directives/if-defined.js";
10
10
  import { DialogCancelEvent } from "../../../events/dialog-cancel.event.js";
11
11
  import { DirtyCloseEvent } from "../../../events/dirty-close.event.js";
12
12
  import { handleDialogCommand } from "../../../utils/command.utils.js";
13
- import { DialogSurfaceMixin } from "../../../mixins/dialog-surface.mixin.js";
13
+ import { DialogSurfaceMixin, } from "../../../mixins/dialog-surface.mixin.js";
14
+ import { getFocusableElements } from "../../../utils/focusable-elements.utils.js";
15
+ import { isKeyboardModality, trackInputModality, } from "../../../utils/input-modality.utils.js";
14
16
  import { drawerStyles } from "./drawer.styles.js";
17
+ import { LocalizableMixin } from "../../../mixins/localizable.mixin.js";
18
+ import { defaultTrueConverter } from "../../../utils/boolean.utils.js";
15
19
  /**
16
20
  * Tag name of the drawer component.
17
21
  */
@@ -40,8 +44,9 @@ export const EunomiaDrawerTagName = "eun-drawer";
40
44
  * @prop {boolean} [open=false] - Whether the drawer is open
41
45
  * @prop {boolean} [closeOnBackdrop=true] - Whether clicking outside the drawer requests a close
42
46
  * @prop {boolean} [dirty=false] - Marks the drawer as having unsaved changes, requiring confirmation before it closes
43
- * @prop {string} ariaLabelClose - The accessible label of the close button
44
- * @attr {string} [aria-label-close='Close'] - The accessible label of the close button
47
+ * @prop {'auto' | 'first-field'} [initialFocus='auto'] - Where focus lands on open. First-field focuses the first focusable element of the body when the drawer was opened from the keyboard, and behaves like auto after a click or a touch, so a mobile virtual keyboard doesn't pop up on its own. A slotted autofocus element always wins
48
+ * @prop {string} [closeLabel] - The accessible label of the close button. Defaults to the localized string for the current locale (English: "Close")
49
+ * @attr {string} [close-label] - The accessible label of the close button. Defaults to the localized string for the current locale (English: "Close")
45
50
  * @prop {string} [confirmCloseHeading='Discard changes?'] - The heading of the internal discard confirmation dialog
46
51
  * @attr {string} [confirm-close-heading='Discard changes?'] - The heading of the internal discard confirmation dialog
47
52
  * @prop {string} confirmCloseDescription - The description of the internal discard confirmation dialog
@@ -60,10 +65,11 @@ export const EunomiaDrawerTagName = "eun-drawer";
60
65
  * @cssprop [--drawer-padding-block] - Sets the vertical padding, as one length applied to both sides. Ignored when --drawer-padding is set
61
66
  * @cssprop [--drawer-padding-inline] - Sets the horizontal padding, as one length applied to both sides. Ignored when --drawer-padding is set
62
67
  * @cssprop [--drawer-gap] - Sets the gap inside the header and footer rows
68
+ * @cssprop [--drawer-header-padding-bottom] - Sets the padding below the header, --drawer-gap by default
63
69
  * @cssprop [--drawer-transition-duration] - Sets the duration of the slide transition
64
70
  * @element eun-drawer
65
71
  */
66
- let EunomiaDrawer = class EunomiaDrawer extends DialogSurfaceMixin(LitElement) {
72
+ let EunomiaDrawer = class EunomiaDrawer extends DialogSurfaceMixin(LocalizableMixin(LitElement)) {
67
73
  constructor() {
68
74
  super(...arguments);
69
75
  /**
@@ -94,10 +100,15 @@ let EunomiaDrawer = class EunomiaDrawer extends DialogSurfaceMixin(LitElement) {
94
100
  */
95
101
  this.dirty = false;
96
102
  /**
97
- * Accessible label of the close (X) button.
98
- * @default Close
103
+ * Where focus lands on open. `auto` keeps the default target described
104
+ * on {@link focusInitialElement}. `first-field` focuses the first
105
+ * focusable element of the body when the drawer was opened from the
106
+ * keyboard, and behaves like `auto` after a click or a touch, so a
107
+ * mobile virtual keyboard doesn't pop up on its own. A slotted
108
+ * `[autofocus]` element always wins.
109
+ * @default auto
99
110
  */
100
- this.ariaLabelClose = "Close";
111
+ this.initialFocus = "auto";
101
112
  /**
102
113
  * Heading of the internal discard-confirmation dialog.
103
114
  * @default Discard changes?
@@ -233,6 +244,7 @@ let EunomiaDrawer = class EunomiaDrawer extends DialogSurfaceMixin(LitElement) {
233
244
  */
234
245
  connectedCallback() {
235
246
  super.connectedCallback?.();
247
+ trackInputModality();
236
248
  this.addEventListener("command", this.handleCommandEvent);
237
249
  }
238
250
  /**
@@ -327,6 +339,20 @@ let EunomiaDrawer = class EunomiaDrawer extends DialogSurfaceMixin(LitElement) {
327
339
  this.dirty = false;
328
340
  this.attemptClose();
329
341
  }
342
+ /**
343
+ * Focuses the body's first focusable element when `initialFocus` is
344
+ * `first-field` and the latest interaction came from the keyboard.
345
+ * @returns whether an element was focused.
346
+ * @private
347
+ */
348
+ focusFirstField() {
349
+ if (this.initialFocus !== "first-field" || !isKeyboardModality()) {
350
+ return false;
351
+ }
352
+ const [first] = this.bodyEl ? getFocusableElements(this.bodyEl) : [];
353
+ first?.focus();
354
+ return first !== undefined;
355
+ }
330
356
  /**
331
357
  * Focuses the `[autofocus]` slotted element if present, otherwise the
332
358
  * drawer panel itself.
@@ -338,6 +364,9 @@ let EunomiaDrawer = class EunomiaDrawer extends DialogSurfaceMixin(LitElement) {
338
364
  autofocusTarget.focus();
339
365
  return;
340
366
  }
367
+ if (this.focusFirstField()) {
368
+ return;
369
+ }
341
370
  (this.panelEl ?? this.surfaceEl)?.focus();
342
371
  }
343
372
  /**
@@ -404,7 +433,7 @@ let EunomiaDrawer = class EunomiaDrawer extends DialogSurfaceMixin(LitElement) {
404
433
  appearance="ghost"
405
434
  rounded
406
435
  size="xs"
407
- aria-label=${this.ariaLabelClose}
436
+ aria-label=${this.closeLabel ?? this.dictionary.common.close}
408
437
  @click=${() => this.requestClose()}
409
438
  >
410
439
  <eun-icon name="close" size="16"></eun-icon>
@@ -491,26 +520,32 @@ let EunomiaDrawer = class EunomiaDrawer extends DialogSurfaceMixin(LitElement) {
491
520
  */
492
521
  EunomiaDrawer.styles = drawerStyles;
493
522
  __decorate([
494
- property({ reflect: true })
523
+ property({ reflect: true, useDefault: true })
495
524
  ], EunomiaDrawer.prototype, "position", void 0);
496
525
  __decorate([
497
526
  property()
498
527
  ], EunomiaDrawer.prototype, "heading", void 0);
499
528
  __decorate([
500
- property({ type: Boolean })
529
+ property({ converter: defaultTrueConverter })
501
530
  ], EunomiaDrawer.prototype, "closeable", void 0);
502
531
  __decorate([
503
532
  property({ type: Boolean, reflect: true })
504
533
  ], EunomiaDrawer.prototype, "open", void 0);
505
534
  __decorate([
506
- property({ type: Boolean, attribute: "close-on-backdrop" })
535
+ property({ converter: defaultTrueConverter, attribute: "close-on-backdrop" })
507
536
  ], EunomiaDrawer.prototype, "closeOnBackdrop", void 0);
508
537
  __decorate([
509
538
  property({ type: Boolean, reflect: true })
510
539
  ], EunomiaDrawer.prototype, "dirty", void 0);
511
540
  __decorate([
512
- property({ attribute: "aria-label-close" })
513
- ], EunomiaDrawer.prototype, "ariaLabelClose", void 0);
541
+ property({ attribute: "initial-focus", reflect: true, useDefault: true })
542
+ ], EunomiaDrawer.prototype, "initialFocus", void 0);
543
+ __decorate([
544
+ query("#body")
545
+ ], EunomiaDrawer.prototype, "bodyEl", void 0);
546
+ __decorate([
547
+ property({ attribute: "close-label" })
548
+ ], EunomiaDrawer.prototype, "closeLabel", void 0);
514
549
  __decorate([
515
550
  property({ attribute: "confirm-close-heading" })
516
551
  ], EunomiaDrawer.prototype, "confirmCloseHeading", void 0);
@@ -11,6 +11,7 @@ import { css } from "lit";
11
11
  * [--drawer-padding-block] - Set a custom vertical padding, as one length applied to both sides. Ignored when --drawer-padding is set
12
12
  * [--drawer-padding-inline] - Set a custom horizontal padding, as one length applied to both sides. Ignored when --drawer-padding is set
13
13
  * [--drawer-gap] - Set a custom gap inside the header/footer rows
14
+ * [--drawer-header-padding-bottom] - Set a custom padding below the header, --drawer-gap by default
14
15
  * [--drawer-transition-duration] - Set a custom duration for the slide transition
15
16
  */
16
17
  const base = css `
@@ -20,11 +21,11 @@ const base = css `
20
21
  --_color: var(--drawer-color, var(--eun-text-color, #071621));
21
22
  --_paddingBlock: var(
22
23
  --drawer-padding,
23
- var(--drawer-padding-block, var(--eun-space-m, 16px))
24
+ var(--drawer-padding-block, var(--eun-space-l, 32px))
24
25
  );
25
26
  --_paddingInline: var(
26
27
  --drawer-padding,
27
- var(--drawer-padding-inline, var(--eun-space-m, 16px))
28
+ var(--drawer-padding-inline, var(--eun-space-l, 32px))
28
29
  );
29
30
  --_gap: var(--drawer-gap, var(--eun-space-m, 16px));
30
31
  --_transitionDuration: var(
@@ -72,7 +73,7 @@ const base = css `
72
73
  #surface[closing]::backdrop {
73
74
  background-color: rgba(7, 22, 33, 0);
74
75
  }
75
- :host([position="end"]) #surface {
76
+ :host(:is([position="end"], :not([position]))) #surface {
76
77
  justify-content: flex-end;
77
78
  }
78
79
  :host([position="start"]) #surface {
@@ -117,7 +118,8 @@ const base = css `
117
118
  align-items: flex-start;
118
119
  justify-content: space-between;
119
120
  gap: var(--_gap);
120
- padding: var(--_paddingBlock) var(--_paddingInline) 0;
121
+ padding: var(--_paddingBlock) var(--_paddingInline)
122
+ var(--drawer-header-padding-bottom, var(--_gap));
121
123
  }
122
124
  #heading {
123
125
  margin: 0;
@@ -132,7 +134,7 @@ const base = css `
132
134
  flex: 1;
133
135
  min-height: 0;
134
136
  overflow-y: auto;
135
- padding: var(--_gap) var(--_paddingInline);
137
+ padding: var(--eun-space-xs, 4px) var(--_paddingInline);
136
138
  font-size: var(--eun-font-size-s, 14px);
137
139
  }
138
140
  #footer {
@@ -144,8 +146,6 @@ const base = css `
144
146
  }
145
147
 
146
148
  #confirm-close-modal {
147
- --modal-padding: var(--eun-space-l, 32px) var(--eun-space-m, 16px)
148
- var(--eun-space-m, 16px) var(--eun-space-l, 32px);
149
149
  --modal-gap: var(--eun-space-m, 16px);
150
150
  --modal-backdrop-blur: 6px;
151
151
  }