@eunomia/elements 1.0.0-beta.9 → 1.0.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 (322) hide show
  1. package/README.md +28 -6
  2. package/dist/angular/forms.d.ts +80 -0
  3. package/dist/angular/forms.js +267 -0
  4. package/dist/cdn/components/chunks/chunk-2XPIGFBD.js +1 -0
  5. package/dist/cdn/components/chunks/chunk-5IUNSTM3.js +1 -0
  6. package/dist/cdn/components/chunks/chunk-7HXPLZ7C.js +1 -0
  7. package/dist/cdn/components/chunks/{chunk-J3SZBXM6.js → chunk-A2NO4RSF.js} +7 -7
  8. package/dist/cdn/components/chunks/{chunk-Q34EQ5HZ.js → chunk-A623JJXJ.js} +1 -1
  9. package/dist/cdn/components/chunks/{chunk-Y3HOIL64.js → chunk-AW7PU43S.js} +2 -2
  10. package/dist/cdn/components/chunks/{chunk-FF3I7C3C.js → chunk-DWTNRFWW.js} +1 -3
  11. package/dist/cdn/components/chunks/chunk-FPNWPMHA.js +1 -0
  12. package/dist/cdn/components/chunks/chunk-GMWUHGNI.js +319 -0
  13. package/dist/cdn/components/chunks/{chunk-FQUWHNQT.js → chunk-GXOEPXDW.js} +1 -1
  14. package/dist/cdn/components/chunks/chunk-HXESKTK2.js +1 -0
  15. package/dist/cdn/components/chunks/chunk-JDUWKPHW.js +46 -0
  16. package/dist/cdn/components/chunks/{chunk-D3JJBHXN.js → chunk-JLKCBPD2.js} +2 -2
  17. package/dist/cdn/components/chunks/chunk-M6ZJHL4Q.js +1 -0
  18. package/dist/cdn/components/chunks/{chunk-TN3HGHQO.js → chunk-MDSUMP3O.js} +4 -4
  19. package/dist/cdn/components/chunks/chunk-MSQWOKBB.js +1 -0
  20. package/dist/cdn/components/chunks/{chunk-3UUZM7X2.js → chunk-NPXRQHUN.js} +3 -3
  21. package/dist/cdn/components/chunks/chunk-OB7DEGNX.js +1 -0
  22. package/dist/cdn/components/chunks/{chunk-JANNHW4Q.js → chunk-PADHCLBG.js} +4 -4
  23. package/dist/cdn/components/chunks/chunk-QMXE3KLT.js +1 -0
  24. package/dist/cdn/components/chunks/chunk-QNWKRPOW.js +1 -0
  25. package/dist/cdn/components/chunks/{chunk-KQUUMZ7U.js → chunk-RZF7QQDX.js} +7 -7
  26. package/dist/cdn/components/chunks/chunk-SCAP7J35.js +1 -0
  27. package/dist/cdn/components/chunks/chunk-TISMX7UL.js +1 -0
  28. package/dist/cdn/components/chunks/chunk-TWLI2ZOT.js +1 -0
  29. package/dist/cdn/components/chunks/chunk-W4VCWRY7.js +210 -0
  30. package/dist/cdn/components/chunks/{chunk-SZZRMJ65.js → chunk-WEG3KO6T.js} +3 -3
  31. package/dist/cdn/components/chunks/chunk-WP6ZYBAC.js +1 -0
  32. package/dist/cdn/components/chunks/{chunk-HGX6GPHM.js → chunk-XCBQ4CKH.js} +1 -1
  33. package/dist/cdn/components/chunks/{chunk-3UW2LJ7T.js → chunk-XZ3LFOQP.js} +2 -2
  34. package/dist/cdn/components/eun-alert.js +1 -1
  35. package/dist/cdn/components/eun-animate.js +92 -180
  36. package/dist/cdn/components/eun-breadcrumb.js +4 -4
  37. package/dist/cdn/components/eun-button.js +1 -1
  38. package/dist/cdn/components/eun-calendar.js +188 -115
  39. package/dist/cdn/components/eun-card.js +1 -1
  40. package/dist/cdn/components/eun-carousel.js +36 -28
  41. package/dist/cdn/components/eun-check-card.js +3 -3
  42. package/dist/cdn/components/eun-checkbox-list.js +2 -2
  43. package/dist/cdn/components/eun-checkbox.js +1 -1
  44. package/dist/cdn/components/eun-chip.js +11 -15
  45. package/dist/cdn/components/eun-collapse.js +21 -10
  46. package/dist/cdn/components/eun-color-picker.js +32 -32
  47. package/dist/cdn/components/eun-counter.js +8 -8
  48. package/dist/cdn/components/eun-date-picker.js +83 -79
  49. package/dist/cdn/components/eun-description-list.js +1 -1
  50. package/dist/cdn/components/eun-divider.js +9 -8
  51. package/dist/cdn/components/eun-drawer.js +8 -6
  52. package/dist/cdn/components/eun-dropdown-button.js +1 -1
  53. package/dist/cdn/components/eun-dropdown-item.js +4 -4
  54. package/dist/cdn/components/eun-fab.js +1 -1
  55. package/dist/cdn/components/eun-image-card.js +2 -2
  56. package/dist/cdn/components/eun-image-carousel.js +55 -29
  57. package/dist/cdn/components/eun-infinite-list.js +2 -2
  58. package/dist/cdn/components/eun-input-file.js +3 -3
  59. package/dist/cdn/components/eun-input-phone.js +6 -6
  60. package/dist/cdn/components/eun-input.js +1 -1
  61. package/dist/cdn/components/eun-label.js +1 -1
  62. package/dist/cdn/components/eun-link.js +18 -329
  63. package/dist/cdn/components/eun-loader.js +1 -1
  64. package/dist/cdn/components/eun-modal.js +9 -7
  65. package/dist/cdn/components/eun-nav-menu.js +363 -0
  66. package/dist/cdn/components/eun-pagination.js +4 -4
  67. package/dist/cdn/components/eun-password-strength.js +2 -2
  68. package/dist/cdn/components/eun-progress-bar.js +1 -1
  69. package/dist/cdn/components/eun-radio-card.js +4 -4
  70. package/dist/cdn/components/eun-radio-list.js +1 -1
  71. package/dist/cdn/components/eun-radio.js +1 -1
  72. package/dist/cdn/components/eun-rating.js +9 -9
  73. package/dist/cdn/components/eun-scheduler-event-editor.js +113 -77
  74. package/dist/cdn/components/eun-scheduler-event.js +1 -1
  75. package/dist/cdn/components/eun-scheduler.js +137 -79
  76. package/dist/cdn/components/eun-search.js +6 -6
  77. package/dist/cdn/components/eun-select.js +1 -1
  78. package/dist/cdn/components/eun-sidebar.js +23 -14
  79. package/dist/cdn/components/eun-slider.js +2 -2
  80. package/dist/cdn/components/eun-sliding-card.js +1 -1
  81. package/dist/cdn/components/eun-step.js +2 -2
  82. package/dist/cdn/components/eun-stepper.js +11 -12
  83. package/dist/cdn/components/eun-switch.js +2 -2
  84. package/dist/cdn/components/eun-tab-group.js +1 -1
  85. package/dist/cdn/components/eun-tab-panel.js +1 -1
  86. package/dist/cdn/components/eun-table-action-bar.js +1 -1
  87. package/dist/cdn/components/eun-table.js +13 -10
  88. package/dist/cdn/components/eun-tag.js +1 -1
  89. package/dist/cdn/components/eun-textarea.js +4 -4
  90. package/dist/cdn/components/eun-time-picker.js +28 -25
  91. package/dist/cdn/components/eun-toast.js +8 -8
  92. package/dist/cdn/components/eun-toggle-group.js +8 -2
  93. package/dist/cdn/components/eun-toggle-item.js +8 -2
  94. package/dist/cdn/components/eun-toggle.js +4 -1
  95. package/dist/cdn/components/eun-toolbar.js +114 -36
  96. package/dist/cdn/components/eun-tooltip.js +1 -1
  97. package/dist/cdn/styles/eunomia-themes.css +1 -1
  98. package/dist/cdn/styles/themes/eunomia-theme.css +1 -1
  99. package/dist/cdn/styles/themes/mixins/eunomia-neutrals.mixin.scss +2 -2
  100. package/dist/cdn/styles/themes/prebuilt-themes/eunomia/eunomia.theme.css +1 -1
  101. package/dist/cdn/styles/themes/prebuilt-themes/fire/eunomia-fire.theme.css +1 -1
  102. package/dist/cdn/styles/themes/prebuilt-themes/forest/eunomia-forest.theme.css +1 -1
  103. package/dist/cdn/styles/themes/prebuilt-themes/gold/eunomia-gold.theme.css +1 -1
  104. package/dist/cdn/styles/themes/prebuilt-themes/ocean/eunomia-ocean.theme.css +1 -1
  105. package/dist/cdn/styles/themes/prebuilt-themes/salmon/eunomia-salmon.theme.css +1 -1
  106. package/dist/cdn/styles/themes/prebuilt-themes/violet/eunomia-violet.theme.css +1 -1
  107. package/dist/cdn/styles/tools/mixins/layout/eunomia-grid.mixin.scss +116 -8
  108. package/dist/components/action/button/button.styles.js +2 -2
  109. package/dist/components/action/dropdown-button/dropdown-button.d.ts +4 -0
  110. package/dist/components/action/dropdown-button/dropdown-button.js +1 -0
  111. package/dist/components/action/dropdown-button/dropdown-button.styles.js +5 -4
  112. package/dist/components/action/dropdown-button/dropdown-item.d.ts +1 -0
  113. package/dist/components/action/dropdown-button/dropdown-item.js +1 -0
  114. package/dist/components/action/dropdown-button/dropdown-item.styles.js +4 -4
  115. package/dist/components/action/link/link.d.ts +2 -1
  116. package/dist/components/action/link/link.js +2 -1
  117. package/dist/components/action/link/link.styles.d.ts +40 -1
  118. package/dist/components/action/link/link.styles.js +83 -60
  119. package/dist/components/action/shared-styles/button-palette.styles.js +1 -1
  120. package/dist/components/action/toggle/toggle-group.d.ts +1 -0
  121. package/dist/components/action/toggle/toggle-group.js +1 -0
  122. package/dist/components/action/toggle/toggle-group.styles.d.ts +1 -0
  123. package/dist/components/action/toggle/toggle-group.styles.js +9 -2
  124. package/dist/components/action/toggle/toggle-item.styles.js +8 -2
  125. package/dist/components/action/toggle/toggle.d.ts +1 -0
  126. package/dist/components/action/toggle/toggle.js +1 -0
  127. package/dist/components/action/toggle/toggle.styles.d.ts +1 -0
  128. package/dist/components/action/toggle/toggle.styles.js +5 -1
  129. package/dist/components/alert/drawer/drawer.d.ts +14 -13
  130. package/dist/components/alert/drawer/drawer.js +20 -28
  131. package/dist/components/alert/modal/modal.d.ts +14 -13
  132. package/dist/components/alert/modal/modal.js +20 -28
  133. package/dist/components/alert/modal/modal.styles.js +1 -1
  134. package/dist/components/alert/toast/toast.d.ts +5 -5
  135. package/dist/components/alert/toast/toast.js +9 -10
  136. package/dist/components/alert/toast/toast.styles.js +3 -3
  137. package/dist/components/content/card/image-card.styles.js +1 -1
  138. package/dist/components/content/chip/chip.d.ts +7 -9
  139. package/dist/components/content/chip/chip.js +11 -14
  140. package/dist/components/content/chip/chip.styles.js +1 -5
  141. package/dist/components/content/collapse/collapse.d.ts +5 -0
  142. package/dist/components/content/collapse/collapse.js +7 -0
  143. package/dist/components/content/collapse/collapse.styles.d.ts +3 -0
  144. package/dist/components/content/collapse/collapse.styles.js +13 -1
  145. package/dist/components/content/description-list/description-list.styles.js +1 -1
  146. package/dist/components/content/image-carousel/image-carousel.d.ts +60 -13
  147. package/dist/components/content/image-carousel/image-carousel.js +100 -22
  148. package/dist/components/content/image-carousel/image-carousel.styles.js +32 -6
  149. package/dist/components/content/password-strength/password-strength.styles.js +1 -1
  150. package/dist/components/content/progress-bar/progress-bar.styles.js +1 -1
  151. package/dist/components/content/shared-styles/card-link.styles.js +1 -1
  152. package/dist/components/content/shared-styles/tone-surface.styles.js +1 -3
  153. package/dist/components/form/checkbox/check-card.styles.js +2 -2
  154. package/dist/components/form/checkbox/checkbox-list.d.ts +3 -1
  155. package/dist/components/form/checkbox/checkbox-list.js +3 -1
  156. package/dist/components/form/checkbox/checkbox.styles.js +1 -1
  157. package/dist/components/form/color-picker/color-picker.d.ts +28 -3
  158. package/dist/components/form/color-picker/color-picker.js +53 -7
  159. package/dist/components/form/counter/counter.js +1 -1
  160. package/dist/components/form/counter/counter.styles.js +2 -2
  161. package/dist/components/form/date-picker/date-picker-day-grid.styles.js +1 -1
  162. package/dist/components/form/date-picker/date-picker-month-grid.js +1 -1
  163. package/dist/components/form/date-picker/date-picker.d.ts +50 -13
  164. package/dist/components/form/date-picker/date-picker.js +178 -43
  165. package/dist/components/form/input/input.js +1 -4
  166. package/dist/components/form/input-file/input-file.styles.js +2 -2
  167. package/dist/components/form/input-phone/input-phone.js +4 -3
  168. package/dist/components/form/label/label.styles.js +1 -1
  169. package/dist/components/form/radio/radio-card.styles.js +2 -2
  170. package/dist/components/form/radio/radio.styles.js +1 -1
  171. package/dist/components/form/rating/rating.js +3 -5
  172. package/dist/components/form/rating/rating.styles.js +2 -2
  173. package/dist/components/form/search/search.d.ts +1 -7
  174. package/dist/components/form/search/search.js +2 -12
  175. package/dist/components/form/shared-styles/field.styles.js +2 -2
  176. package/dist/components/form/slider/slider.styles.js +1 -1
  177. package/dist/components/form/switch/switch.styles.js +1 -1
  178. package/dist/components/form/textarea/textarea.js +1 -5
  179. package/dist/components/form/textarea/textarea.styles.js +2 -2
  180. package/dist/components/form/time-picker/time-picker-columns.d.ts +4 -1
  181. package/dist/components/form/time-picker/time-picker-columns.js +64 -15
  182. package/dist/components/form/time-picker/time-picker-columns.styles.js +5 -1
  183. package/dist/components/form/time-picker/time-picker-list.d.ts +4 -1
  184. package/dist/components/form/time-picker/time-picker-list.js +15 -8
  185. package/dist/components/form/time-picker/time-picker.d.ts +11 -2
  186. package/dist/components/form/time-picker/time-picker.js +22 -8
  187. package/dist/components/layout/animate/animate.d.ts +35 -17
  188. package/dist/components/layout/animate/animate.js +27 -14
  189. package/dist/components/layout/animate/animate.styles.d.ts +2 -1
  190. package/dist/components/layout/animate/animate.styles.js +107 -179
  191. package/dist/components/layout/divider/divider.d.ts +1 -0
  192. package/dist/components/layout/divider/divider.js +2 -1
  193. package/dist/components/layout/divider/divider.styles.js +7 -6
  194. package/dist/components/layout/infinite-list/infinite-list.styles.js +1 -1
  195. package/dist/components/navigation/breadcrumb/breadcrumb.styles.js +3 -3
  196. package/dist/components/navigation/carousel/carousel.d.ts +23 -14
  197. package/dist/components/navigation/carousel/carousel.js +39 -27
  198. package/dist/components/navigation/carousel/carousel.styles.js +16 -8
  199. package/dist/components/navigation/nav-menu/nav-menu.d.ts +201 -0
  200. package/dist/components/navigation/nav-menu/nav-menu.js +673 -0
  201. package/dist/components/navigation/nav-menu/nav-menu.styles.d.ts +1 -0
  202. package/dist/components/navigation/nav-menu/nav-menu.styles.js +352 -0
  203. package/dist/components/navigation/pagination/pagination.d.ts +3 -0
  204. package/dist/components/navigation/pagination/pagination.styles.js +2 -2
  205. package/dist/components/navigation/sidebar/sidebar.d.ts +8 -10
  206. package/dist/components/navigation/sidebar/sidebar.js +12 -15
  207. package/dist/components/navigation/sidebar/sidebar.styles.js +13 -4
  208. package/dist/components/navigation/stepper/step.styles.js +2 -2
  209. package/dist/components/navigation/stepper/stepper.d.ts +24 -13
  210. package/dist/components/navigation/stepper/stepper.js +36 -23
  211. package/dist/components/navigation/stepper/stepper.styles.js +2 -2
  212. package/dist/components/navigation/tabs/tab-group/tab-group.js +1 -1
  213. package/dist/components/navigation/tabs/tab-panel/tab-panel.styles.js +1 -1
  214. package/dist/components/navigation/toolbar/toolbar.d.ts +121 -20
  215. package/dist/components/navigation/toolbar/toolbar.js +176 -45
  216. package/dist/components/navigation/toolbar/toolbar.styles.js +113 -28
  217. package/dist/events/editor-state-change.event.d.ts +28 -0
  218. package/dist/events/editor-state-change.event.js +22 -0
  219. package/dist/events/event-cancel.event.d.ts +20 -0
  220. package/dist/events/event-cancel.event.js +17 -0
  221. package/dist/events/period-change.event.d.ts +14 -6
  222. package/dist/events/period-change.event.js +9 -6
  223. package/dist/features/scheduler/calendar/calendar.d.ts +52 -20
  224. package/dist/features/scheduler/calendar/calendar.js +84 -36
  225. package/dist/features/scheduler/calendar/calendar.styles.js +5 -2
  226. package/dist/features/scheduler/scheduler/scheduler.d.ts +69 -4
  227. package/dist/features/scheduler/scheduler/scheduler.js +172 -47
  228. package/dist/features/scheduler/scheduler/scheduler.styles.js +6 -0
  229. package/dist/features/scheduler/scheduler-event/scheduler-event.d.ts +18 -20
  230. package/dist/features/scheduler/scheduler-event/scheduler-event.js +29 -38
  231. package/dist/features/scheduler/scheduler-event/scheduler-event.styles.js +2 -2
  232. package/dist/features/scheduler/scheduler-event-editor/scheduler-event-editor.d.ts +102 -18
  233. package/dist/features/scheduler/scheduler-event-editor/scheduler-event-editor.js +249 -112
  234. package/dist/features/scheduler/scheduler-event-editor/scheduler-event-editor.styles.js +11 -1
  235. package/dist/features/scheduler/shared/scheduler-event-popover.d.ts +9 -1
  236. package/dist/features/scheduler/shared/scheduler-event-popover.js +77 -42
  237. package/dist/features/scheduler/shared/scheduler-event-popover.styles.js +14 -3
  238. package/dist/features/scheduler/shared/scheduler-hour-grid.d.ts +3 -2
  239. package/dist/features/scheduler/shared/scheduler-hour-grid.js +53 -46
  240. package/dist/features/scheduler/shared/scheduler-hour-grid.styles.js +13 -7
  241. package/dist/features/scheduler/shared/scheduler-month-view.js +1 -1
  242. package/dist/features/scheduler/shared/scheduler-month-view.styles.js +13 -7
  243. package/dist/features/scheduler/shared/scheduler-year-view.d.ts +6 -5
  244. package/dist/features/scheduler/shared/scheduler-year-view.js +11 -7
  245. package/dist/features/scheduler/shared/scheduler-year-view.styles.js +57 -3
  246. package/dist/features/scheduler/shared/scheduler.types.d.ts +5 -9
  247. package/dist/features/scheduler/shared/scheduler.utils.d.ts +61 -0
  248. package/dist/features/scheduler/shared/scheduler.utils.js +78 -4
  249. package/dist/features/table/table/table-native.styles.js +8 -4
  250. package/dist/features/table/table/table.d.ts +2 -1
  251. package/dist/features/table/table/table.js +2 -1
  252. package/dist/features/table/table/table.styles.js +6 -4
  253. package/dist/i18n/en.d.ts +17 -0
  254. package/dist/i18n/en.js +17 -0
  255. package/dist/i18n/fr.js +17 -0
  256. package/dist/index.d.ts +6 -0
  257. package/dist/index.js +4 -0
  258. package/dist/jsx.d.ts +48 -6
  259. package/dist/mixins/anchor-position.mixin.d.ts +17 -0
  260. package/dist/mixins/anchor-position.mixin.js +45 -7
  261. package/dist/mixins/button.mixin.js +2 -1
  262. package/dist/mixins/check.mixin.js +14 -5
  263. package/dist/mixins/dialog-surface.mixin.d.ts +1 -1
  264. package/dist/mixins/dialog-surface.mixin.js +5 -5
  265. package/dist/mixins/form.mixin.js +33 -13
  266. package/dist/mixins/localizable.mixin.d.ts +1 -0
  267. package/dist/mixins/localizable.mixin.js +9 -2
  268. package/dist/mixins/radio.mixin.js +14 -5
  269. package/dist/mixins/validators.mixin.js +4 -3
  270. package/dist/react.d.ts +59 -0
  271. package/dist/react.js +42 -0
  272. package/dist/ssr/animate-ssr.css +35 -0
  273. package/dist/ssr/breadcrumb-ssr.css +3 -3
  274. package/dist/ssr/button-ssr.css +8 -2
  275. package/dist/ssr/card-ssr.css +1 -1
  276. package/dist/ssr/carousel-ssr.css +15 -4
  277. package/dist/ssr/chip-ssr.css +3 -3
  278. package/dist/ssr/collapse-ssr.css +2 -2
  279. package/dist/ssr/description-list-ssr.css +1 -1
  280. package/dist/ssr/divider-ssr.css +23 -0
  281. package/dist/ssr/field-ssr.css +245 -42
  282. package/dist/ssr/image-carousel-ssr.css +2 -4
  283. package/dist/ssr/links-ssr.css +17 -3
  284. package/dist/ssr/nav-menu-ssr.css +82 -0
  285. package/dist/ssr/overlay-ssr.css +4 -0
  286. package/dist/ssr/scheduler-ssr.css +182 -0
  287. package/dist/ssr/stepper-ssr.css +136 -0
  288. package/dist/ssr/table-ssr.css +7 -4
  289. package/dist/ssr/tag-ssr.css +1 -1
  290. package/dist/ssr/toolbar-ssr.css +7 -5
  291. package/dist/utils/css-length.utils.d.ts +14 -0
  292. package/dist/utils/css-length.utils.js +32 -0
  293. package/dist/utils/form-validation.utils.d.ts +36 -0
  294. package/dist/utils/form-validation.utils.js +113 -0
  295. package/dist/utils/implicit-submission.utils.js +2 -14
  296. package/dist/utils/interactive-content.utils.d.ts +10 -0
  297. package/dist/utils/interactive-content.utils.js +43 -0
  298. package/dist/utils/popover.utils.js +3 -2
  299. package/dist/utils/scroll-lock.utils.d.ts +9 -1
  300. package/dist/utils/scroll-lock.utils.js +21 -2
  301. package/dist/utils/theme-generator.utils.d.ts +1 -0
  302. package/dist/utils/theme-generator.utils.js +23 -10
  303. package/dist/utils/validity.utils.d.ts +18 -4
  304. package/dist/utils/validity.utils.js +74 -4
  305. package/package.json +34 -3
  306. package/styles/themes/mixins/eunomia-neutrals.mixin.scss +2 -2
  307. package/styles/tools/mixins/layout/eunomia-grid.mixin.scss +116 -8
  308. package/dist/cdn/components/chunks/chunk-4DRU3IYJ.js +0 -1
  309. package/dist/cdn/components/chunks/chunk-647ISUF4.js +0 -1
  310. package/dist/cdn/components/chunks/chunk-6TIEBY34.js +0 -1
  311. package/dist/cdn/components/chunks/chunk-E6UOI36Q.js +0 -1
  312. package/dist/cdn/components/chunks/chunk-GNAUNTS5.js +0 -1
  313. package/dist/cdn/components/chunks/chunk-IJJ67C66.js +0 -1
  314. package/dist/cdn/components/chunks/chunk-J7ETIRSK.js +0 -1
  315. package/dist/cdn/components/chunks/chunk-JGV7LHEI.js +0 -1
  316. package/dist/cdn/components/chunks/chunk-L74LXUGL.js +0 -1
  317. package/dist/cdn/components/chunks/chunk-MY6ORZJR.js +0 -46
  318. package/dist/cdn/components/chunks/chunk-QWTFP56P.js +0 -1
  319. package/dist/cdn/components/chunks/chunk-SFX2LQ4K.js +0 -205
  320. package/dist/cdn/components/chunks/chunk-WW4BTWMH.js +0 -1
  321. package/dist/utils/boolean.utils.d.ts +0 -14
  322. package/dist/utils/boolean.utils.js +0 -20
@@ -57,6 +57,12 @@ export const AnchorPositionMixin = (superClass) => {
57
57
  * @private
58
58
  */
59
59
  this.anchorPositionAxis = "vertical";
60
+ /**
61
+ * Side applied by the current fallback positioning,
62
+ * carried the same way as {@link anchorPositionGap}.
63
+ * @private
64
+ */
65
+ this.anchorPositionSide = "bottom";
60
66
  /**
61
67
  * Every shadow root between the tracked anchor and the document, also
62
68
  * listened to for `scroll` by the fallback path : a scroll event isn't
@@ -73,7 +79,7 @@ export const AnchorPositionMixin = (superClass) => {
73
79
  */
74
80
  this.handleAnchorReposition = () => {
75
81
  if (this.anchoredElement && this.anchoredFloatingElement) {
76
- this.applyFallbackPosition(this.anchoredElement, this.anchoredFloatingElement, this.anchorPositionGap, this.anchorPositionAxis);
82
+ this.applyFallbackPosition(this.anchoredElement, this.anchoredFloatingElement, this.anchorPositionGap, this.anchorPositionAxis, this.anchorPositionSide, this.anchorPositionAlign);
77
83
  }
78
84
  };
79
85
  }
@@ -124,11 +130,14 @@ export const AnchorPositionMixin = (superClass) => {
124
130
  this.applyNativePlacementAttribute(anchor, floating);
125
131
  return;
126
132
  }
133
+ const side = options.side ?? "bottom";
127
134
  this.anchorPositionGap = gap;
128
135
  this.anchorPositionAxis = axis;
136
+ this.anchorPositionSide = side;
137
+ this.anchorPositionAlign = options.align;
129
138
  this.anchoredElement = anchor;
130
139
  this.anchoredFloatingElement = floating;
131
- this.applyFallbackPosition(anchor, floating, gap, axis);
140
+ this.applyFallbackPosition(anchor, floating, gap, axis, side, options.align);
132
141
  window.addEventListener("resize", this.handleAnchorReposition);
133
142
  window.addEventListener("scroll", this.handleAnchorReposition, true);
134
143
  this.removeAnchorScrollRootListeners();
@@ -206,9 +215,11 @@ export const AnchorPositionMixin = (superClass) => {
206
215
  * @param floating the element being positioned.
207
216
  * @param gap the gap, in pixels, kept between them.
208
217
  * @param axis which pair of sides to flip between ; see {@link AnchorPositionOptions.axis}.
218
+ * @param side the preferred side on the vertical axis ; see {@link AnchorPositionOptions.side}.
219
+ * @param align the alignment on the vertical axis ; see {@link AnchorPositionOptions.align}.
209
220
  * @private
210
221
  */
211
- applyFallbackPosition(anchor, floating, gap, axis = "vertical") {
222
+ applyFallbackPosition(anchor, floating, gap, axis = "vertical", side = "bottom", align) {
212
223
  const anchorRect = anchor.getBoundingClientRect();
213
224
  const insetTop = this.readViewportInset(floating, "--eun-viewport-inset-top");
214
225
  const insetBottom = this.readViewportInset(floating, "--eun-viewport-inset-bottom");
@@ -251,17 +262,44 @@ export const AnchorPositionMixin = (superClass) => {
251
262
  }
252
263
  const spaceBelow = window.innerHeight - insetBottom - anchorRect.bottom;
253
264
  const spaceAbove = anchorRect.top - insetTop;
254
- const floatingHeight = floating.getBoundingClientRect().height;
255
- const opensUpward = spaceBelow < floatingHeight + gap && spaceAbove > spaceBelow;
265
+ const floatingRect = floating.getBoundingClientRect();
266
+ const floatingHeight = floatingRect.height;
267
+ const opensUpward = side === "top"
268
+ ? spaceAbove >= floatingHeight + gap || spaceAbove >= spaceBelow
269
+ : spaceBelow < floatingHeight + gap && spaceAbove > spaceBelow;
256
270
  floating.dataset.placement = opensUpward ? "top" : "bottom";
257
- floating.classList.toggle("flipped", opensUpward);
271
+ floating.classList.toggle("flipped", opensUpward !== (side === "top"));
258
272
  const top = opensUpward
259
273
  ? Math.max(anchorRect.top - floatingHeight - gap, insetTop)
260
274
  : Math.max(anchorRect.bottom + gap, insetTop);
261
275
  floating.style.setProperty("--_anchorTop", `${top}px`);
262
- floating.style.setProperty("--_anchorLeft", `${anchorRect.left}px`);
276
+ floating.style.setProperty("--_anchorLeft", `${this.alignedLeft(anchorRect, floatingRect.width, align)}px`);
263
277
  floating.style.setProperty("--_anchorWidth", `${anchorRect.width}px`);
264
278
  }
279
+ /**
280
+ * The fallback path's `left` on the vertical axis for `align` : the
281
+ * anchor's own left edge when `align` is unset, as before that option
282
+ * existed, otherwise the requested edge clamped to the viewport.
283
+ *
284
+ * @param anchorRect the anchor's bounding rect.
285
+ * @param width the floating element's width.
286
+ * @param align see {@link AnchorPositionOptions.align}.
287
+ * @private
288
+ */
289
+ alignedLeft(anchorRect, width, align) {
290
+ if (!align) {
291
+ return anchorRect.left;
292
+ }
293
+ let left = anchorRect.left;
294
+ if (align === "center") {
295
+ left = anchorRect.left + anchorRect.width / 2 - width / 2;
296
+ }
297
+ else if (align === "end") {
298
+ left = anchorRect.right - width;
299
+ }
300
+ const max = Math.max(document.documentElement.clientWidth - width, 0);
301
+ return Math.min(Math.max(left, 0), max);
302
+ }
265
303
  /**
266
304
  * Native-path counterpart to {@link applyFallbackPosition}'s
267
305
  * `data-placement`/`flipped` bookkeeping. The native path never chooses
@@ -5,6 +5,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
7
  import { property } from "lit/decorators.js";
8
+ import { reportingValidity } from "../utils/form-validation.utils.js";
8
9
  /**
9
10
  * ButtonMixin adds button behavior, including:
10
11
  * - keyboard accessibility
@@ -154,7 +155,7 @@ export const ButtonMixin = (superClass) => {
154
155
  form.reset();
155
156
  }
156
157
  if (this.type === "submit") {
157
- form.requestSubmit();
158
+ reportingValidity(form, () => form.requestSubmit());
158
159
  }
159
160
  return true;
160
161
  }
@@ -7,6 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { property } from "lit/decorators.js";
8
8
  import { hasErrorDisplayChange } from "./form.mixin.js";
9
9
  import { ChangeEvent } from "../events/change.event.js";
10
+ import { isFromInteractiveContent } from "../utils/interactive-content.utils.js";
10
11
  /**
11
12
  * Mixin adding "checkable" behavior to a component.
12
13
  * It allows to maintains the checked state, handle the interactions, send events and manage accessibility properly
@@ -86,13 +87,17 @@ export const CheckMixin = (superClass) => {
86
87
  * native form `reset()` — overrides `FormMixin`'s own
87
88
  * `formResetCallback`, which unconditionally forces checkable fields
88
89
  * to `false` with no notion of a default checked state. Also resets
89
- * `dirty`/`touched` itself, since it doesn't call `super` to reach
90
- * `FormMixin`'s own reset of those two.
90
+ * `dirty`/`touched`/`validationRequested` itself, since it doesn't
91
+ * call `super` to reach `FormMixin`'s own reset of those. Leaves
92
+ * `checked` untouched when `controlled` is set, as `FormMixin` does.
91
93
  */
92
94
  formResetCallback() {
93
- this.checked = this.defaultChecked ?? false;
95
+ if (!this.controlled) {
96
+ this.checked = this.defaultChecked ?? false;
97
+ }
94
98
  this.dirty = false;
95
99
  this.touched = false;
100
+ this.validationRequested = false;
96
101
  }
97
102
  /**
98
103
  * Lifecycle: Called when the component is disconnected from the DOM.
@@ -119,11 +124,15 @@ export const CheckMixin = (superClass) => {
119
124
  }
120
125
  /**
121
126
  * Handles click interactions.
122
- * Delegates the logic to `handleChange`.
127
+ * Delegates the logic to `handleChange`, unless the click comes from
128
+ * interactive content of the label, such as a link, left to act alone.
123
129
  *
124
130
  * @param event Mouse click event
125
131
  */
126
132
  handleClick(event) {
133
+ if (isFromInteractiveContent(event, this)) {
134
+ return;
135
+ }
127
136
  this.handleChange(event);
128
137
  }
129
138
  /**
@@ -153,7 +162,7 @@ export const CheckMixin = (superClass) => {
153
162
  * @private
154
163
  */
155
164
  handleKeydown(event) {
156
- if (event.key === " ") {
165
+ if (event.key === " " && !isFromInteractiveContent(event, this)) {
157
166
  event.preventDefault();
158
167
  this.handleChange(event);
159
168
  }
@@ -14,7 +14,7 @@ export declare class DialogSurfaceMixinInterface {
14
14
  protected beginSurfaceClosing(surface: HTMLElement | undefined): void;
15
15
  protected openDialogSurface(entry: DialogStackEntry): void;
16
16
  protected closeDialogSurface(fallbackFocusEl?: HTMLElement): void;
17
- protected teardownDialogSurface(open: boolean): void;
17
+ protected teardownDialogSurface(): void;
18
18
  }
19
19
  /**
20
20
  * Where focus lands when a dialog surface opens. `auto` keeps each
@@ -128,18 +128,18 @@ export const DialogSurfaceMixin = (superClass) => {
128
128
  * Releases the scroll lock, pending close timer, and dialog stack entry
129
129
  * left behind if the surface was still open when disconnected — meant to
130
130
  * be called from each consumer's own `disconnectedCallback`, alongside
131
- * whatever else it tears down.
131
+ * whatever else it tears down. The lock is tied to the dialog stack
132
+ * entry rather than to `open`, which already reads `false` while the
133
+ * exit transition plays, before the surface has actually closed.
132
134
  * @internal
133
135
  */
134
- teardownDialogSurface(open) {
135
- if (open) {
136
- unlockScroll();
137
- }
136
+ teardownDialogSurface() {
138
137
  if (this.closeTimer !== undefined) {
139
138
  window.clearTimeout(this.closeTimer);
140
139
  this.closeTimer = undefined;
141
140
  }
142
141
  if (this.dialogStackEntry) {
142
+ unlockScroll();
143
143
  popDialog(this.dialogStackEntry);
144
144
  this.dialogStackEntry = undefined;
145
145
  }
@@ -19,6 +19,7 @@ import { html, nothing } from "lit";
19
19
  import { property, state } from "lit/decorators.js";
20
20
  import { when } from "lit/directives/when.js";
21
21
  import { ChangeEvent } from "../events/change.event.js";
22
+ import { focusFirstInvalid, isReportingValidity, watchSubmissions, } from "../utils/form-validation.utils.js";
22
23
  /**
23
24
  * Every property {@link FormMixinInterface.showError} depends on, for
24
25
  * components mirroring it outside their template (e.g. onto the host's
@@ -44,7 +45,7 @@ export const ERROR_DISPLAY_PROPERTIES = [
44
45
  */
45
46
  export const hasErrorDisplayChange = (changed) => ERROR_DISPLAY_PROPERTIES.some((name) => changed.has(name));
46
47
  export const FormMixin = (superClass) => {
47
- var _FormMixinClass_instances, _FormMixinClass_fieldsetObserver, _FormMixinClass_markDirty, _FormMixinClass_markTouched, _FormMixinClass_markValidationRequested, _FormMixinClass_syncFieldsetHideError, _FormMixinClass_observeFieldsets;
48
+ var _FormMixinClass_instances, _FormMixinClass_fieldsetObserver, _FormMixinClass_markDirty, _FormMixinClass_markTouched, _FormMixinClass_handleInvalid, _FormMixinClass_syncFieldsetHideError, _FormMixinClass_observeFieldsets;
48
49
  class FormMixinClass extends superClass {
49
50
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
50
51
  constructor(...args) {
@@ -167,10 +168,30 @@ export const FormMixin = (superClass) => {
167
168
  });
168
169
  /**
169
170
  * Marks validation as requested when the form checks this field, which
170
- * fires `invalid` on it.
171
+ * fires `invalid` on it. On a submit attempt or a `reportValidity()`
172
+ * call, also cancels the browser's own bubble when the error is already
173
+ * shown under the field, and moves focus to the first invalid field
174
+ * (this one, for its own `reportValidity()`), since the browser no
175
+ * longer does it once the event is canceled.
176
+ *
177
+ * @param event - The `invalid` event.
171
178
  */
172
- _FormMixinClass_markValidationRequested.set(this, () => {
179
+ _FormMixinClass_handleInvalid.set(this, (event) => {
173
180
  this.validationRequested = true;
181
+ const { form } = this;
182
+ const submitting = !!form && isReportingValidity(form);
183
+ if (!submitting && !isReportingValidity(this)) {
184
+ return;
185
+ }
186
+ if (!this.errorsHidden) {
187
+ event.preventDefault();
188
+ }
189
+ if (submitting) {
190
+ focusFirstInvalid(form);
191
+ }
192
+ else {
193
+ this.focus();
194
+ }
174
195
  });
175
196
  /**
176
197
  * Syncs {@link fieldsetHideError} with the ancestor fieldsets.
@@ -326,7 +347,8 @@ export const FormMixin = (superClass) => {
326
347
  this.checkValidity(this.value);
327
348
  this.addEventListener(ChangeEvent.eventName, __classPrivateFieldGet(this, _FormMixinClass_markDirty, "f"));
328
349
  this.addEventListener("focusout", __classPrivateFieldGet(this, _FormMixinClass_markTouched, "f"));
329
- this.addEventListener("invalid", __classPrivateFieldGet(this, _FormMixinClass_markValidationRequested, "f"));
350
+ this.addEventListener("invalid", __classPrivateFieldGet(this, _FormMixinClass_handleInvalid, "f"));
351
+ watchSubmissions();
330
352
  __classPrivateFieldGet(this, _FormMixinClass_instances, "m", _FormMixinClass_observeFieldsets).call(this);
331
353
  }
332
354
  /**
@@ -337,7 +359,7 @@ export const FormMixin = (superClass) => {
337
359
  disconnectedCallback() {
338
360
  this.removeEventListener(ChangeEvent.eventName, __classPrivateFieldGet(this, _FormMixinClass_markDirty, "f"));
339
361
  this.removeEventListener("focusout", __classPrivateFieldGet(this, _FormMixinClass_markTouched, "f"));
340
- this.removeEventListener("invalid", __classPrivateFieldGet(this, _FormMixinClass_markValidationRequested, "f"));
362
+ this.removeEventListener("invalid", __classPrivateFieldGet(this, _FormMixinClass_handleInvalid, "f"));
341
363
  __classPrivateFieldGet(this, _FormMixinClass_fieldsetObserver, "f")?.disconnect();
342
364
  __classPrivateFieldSet(this, _FormMixinClass_fieldsetObserver, undefined, "f");
343
365
  super.disconnectedCallback?.();
@@ -399,16 +421,14 @@ export const FormMixin = (superClass) => {
399
421
  this.internals.setFormValue(formData);
400
422
  return;
401
423
  }
402
- if (Array.isArray(value)) {
424
+ if (this.checkable) {
425
+ formData.append(fieldName, value ? String(value) : "on");
426
+ }
427
+ else if (Array.isArray(value)) {
403
428
  value.forEach((v) => formData.append(fieldName, v instanceof File ? v : String(v)));
404
429
  }
405
430
  else if (value !== null && value !== undefined) {
406
- if (value instanceof File) {
407
- formData.append(fieldName, value);
408
- }
409
- else {
410
- formData.append(fieldName, this.checkable && !this.value ? "on" : String(value));
411
- }
431
+ formData.append(fieldName, value instanceof File ? value : String(value));
412
432
  }
413
433
  this.internals.setFormValue(formData);
414
434
  }
@@ -483,7 +503,7 @@ export const FormMixin = (superClass) => {
483
503
  `;
484
504
  }
485
505
  }
486
- _FormMixinClass_fieldsetObserver = new WeakMap(), _FormMixinClass_markDirty = new WeakMap(), _FormMixinClass_markTouched = new WeakMap(), _FormMixinClass_markValidationRequested = new WeakMap(), _FormMixinClass_syncFieldsetHideError = new WeakMap(), _FormMixinClass_instances = new WeakSet(), _FormMixinClass_observeFieldsets = function _FormMixinClass_observeFieldsets() {
506
+ _FormMixinClass_fieldsetObserver = new WeakMap(), _FormMixinClass_markDirty = new WeakMap(), _FormMixinClass_markTouched = new WeakMap(), _FormMixinClass_handleInvalid = new WeakMap(), _FormMixinClass_syncFieldsetHideError = new WeakMap(), _FormMixinClass_instances = new WeakSet(), _FormMixinClass_observeFieldsets = function _FormMixinClass_observeFieldsets() {
487
507
  __classPrivateFieldGet(this, _FormMixinClass_syncFieldsetHideError, "f").call(this);
488
508
  let fieldset = this.closest("fieldset");
489
509
  if (!fieldset || typeof MutationObserver === "undefined") {
@@ -6,6 +6,7 @@ import { Dictionary } from "../i18n/index.js";
6
6
  */
7
7
  export declare class LocalizableMixinInterface {
8
8
  locale?: string;
9
+ get resolvedLocale(): string;
9
10
  get dictionary(): Dictionary;
10
11
  }
11
12
  /**
@@ -32,13 +32,20 @@ import { dictionaries, getDefaultLocale } from "../i18n/index.js";
32
32
  */
33
33
  export const LocalizableMixin = (superClass) => {
34
34
  class LocalizableMixinClass extends superClass {
35
+ /**
36
+ * This instance's own `locale` when set, the shared default locale
37
+ * otherwise. Used for `Intl` formatting, so dates and numbers follow
38
+ * the same locale as {@link dictionary}.
39
+ */
40
+ get resolvedLocale() {
41
+ return this.locale ?? getDefaultLocale();
42
+ }
35
43
  /**
36
44
  * This instance's locale-resolved string dictionary — see the class
37
45
  * doc for the resolution order.
38
46
  */
39
47
  get dictionary() {
40
- const resolved = this.locale ?? getDefaultLocale();
41
- return dictionaries[resolved] ?? dictionaries.en;
48
+ return dictionaries[this.resolvedLocale] ?? dictionaries.en;
42
49
  }
43
50
  }
44
51
  __decorate([
@@ -7,6 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { property } from "lit/decorators.js";
8
8
  import { hasErrorDisplayChange } from "./form.mixin.js";
9
9
  import { ChangeEvent } from "../events/change.event.js";
10
+ import { isFromInteractiveContent } from "../utils/interactive-content.utils.js";
10
11
  /**
11
12
  * Mixin adding "radio selectable" behavior to a component.
12
13
  * It allows to maintain the checked state, handle the interactions, send
@@ -93,13 +94,17 @@ export const RadioMixin = (superClass) => {
93
94
  * native form `reset()` — overrides `FormMixin`'s own
94
95
  * `formResetCallback`, which unconditionally forces checkable fields
95
96
  * to `false` with no notion of a default checked state. Also resets
96
- * `dirty`/`touched` itself, since it doesn't call `super` to reach
97
- * `FormMixin`'s own reset of those two.
97
+ * `dirty`/`touched`/`validationRequested` itself, since it doesn't
98
+ * call `super` to reach `FormMixin`'s own reset of those. Leaves
99
+ * `checked` untouched when `controlled` is set, as `FormMixin` does.
98
100
  */
99
101
  formResetCallback() {
100
- this.checked = this.defaultChecked ?? false;
102
+ if (!this.controlled) {
103
+ this.checked = this.defaultChecked ?? false;
104
+ }
101
105
  this.dirty = false;
102
106
  this.touched = false;
107
+ this.validationRequested = false;
103
108
  }
104
109
  /**
105
110
  * Lifecycle: Called when the component is disconnected from the DOM.
@@ -123,11 +128,15 @@ export const RadioMixin = (superClass) => {
123
128
  }
124
129
  /**
125
130
  * Handles click interactions.
126
- * Delegates the logic to `handleChange`.
131
+ * Delegates the logic to `handleChange`, unless the click comes from
132
+ * interactive content of the label, such as a link, left to act alone.
127
133
  *
128
134
  * @param event Mouse click event
129
135
  */
130
136
  handleClick(event) {
137
+ if (isFromInteractiveContent(event, this)) {
138
+ return;
139
+ }
131
140
  this.handleChange(event);
132
141
  }
133
142
  /**
@@ -160,7 +169,7 @@ export const RadioMixin = (superClass) => {
160
169
  * @private
161
170
  */
162
171
  handleKeydown(event) {
163
- if (event.key === " ") {
172
+ if (event.key === " " && !isFromInteractiveContent(event, this)) {
164
173
  event.preventDefault();
165
174
  this.handleChange(event);
166
175
  }
@@ -6,6 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  };
7
7
  import { property, state } from "lit/decorators.js";
8
8
  import { dictionaries, getDefaultLocale } from "../i18n/index.js";
9
+ import { reportingValidity } from "../utils/form-validation.utils.js";
9
10
  /**
10
11
  * Mixin that adds validation capabilities to a LitElement.
11
12
  *
@@ -116,12 +117,12 @@ export const ValidatorsMixin = (superClass) => {
116
117
  message = errorMessages.join(" ; ");
117
118
  }
118
119
  this.valid = !Object.values(combinedValidity).some(Boolean);
119
- const anchor = this.getFocusAnchor?.();
120
+ const anchor = this.getFocusAnchor?.() ?? undefined;
120
121
  if (this.valid || anchor || !this.getFocusAnchor) {
121
122
  this.setValidity(combinedValidity, message, anchor);
122
123
  }
123
124
  else {
124
- void this.updateComplete.then(() => this.setValidity(combinedValidity, message, anchor));
125
+ void this.updateComplete.then(() => this.setValidity(combinedValidity, message, this.getFocusAnchor?.() ?? undefined));
125
126
  }
126
127
  return this.valid;
127
128
  }
@@ -134,7 +135,7 @@ export const ValidatorsMixin = (superClass) => {
134
135
  reportValidity(valToCheck = this.getValueToValidate()) {
135
136
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
136
137
  this.checkValidity(valToCheck);
137
- return this.internals.reportValidity();
138
+ return reportingValidity(this, () => this.internals.reportValidity());
138
139
  }
139
140
  /**
140
141
  * Helper to collect error messages from a validator.
@@ -0,0 +1,59 @@
1
+ /// <reference path="index.d.ts" />
2
+ /**
3
+ * Sets an element's properties and event listeners from a React ref, the
4
+ * one place React 19 reliably reaches a server-rendered custom element:
5
+ * on hydration, React applies none of the props it gives a custom element
6
+ * (neither `events={...}` nor an `oneunchange={...}` listener), and only
7
+ * sets them on a later render whose value changed. A ref callback runs
8
+ * once the element is attached, hydrated or not, so
9
+ * `<eun-calendar ref={eunProps({ events, oneunperiodchange })}>` works the
10
+ * same in a server-rendered page and in a client-only one.
11
+ *
12
+ * Doesn't import React at runtime: a ref callback is a plain function,
13
+ * and `react`'s types only describe its shape here, as in jsx.ts. The
14
+ * triple-slash reference pulls in, as there, every component's types and
15
+ * the event map below, never their `customElements.define(...)`.
16
+ */
17
+ import type { RefCallback } from "react";
18
+ /**
19
+ * The event names the library dispatches, each one mapped to its event
20
+ * class by its own module's `GlobalEventHandlersEventMap` entry.
21
+ */
22
+ type EunomiaEventName = Extract<keyof GlobalEventHandlersEventMap, `eun${string}` | "tabchange">;
23
+ type EunomiaEventProps = {
24
+ [E in EunomiaEventName as `on${E}`]?: (event: GlobalEventHandlersEventMap[E]) => void;
25
+ };
26
+ type IfEquals<X, Y, A, B> = (<V>() => V extends X ? 1 : 2) extends <V>() => V extends Y ? 1 : 2 ? A : B;
27
+ /**
28
+ * The element's own properties a script can assign: a getter-only one
29
+ * such as `visibleRange` would throw.
30
+ */
31
+ type WritableOwnKeys<T> = {
32
+ [K in Exclude<keyof T, keyof HTMLElement>]-?: IfEquals<{
33
+ [P in K]: T[K];
34
+ }, {
35
+ -readonly [P in K]: T[K];
36
+ }, K, never>;
37
+ }[Exclude<keyof T, keyof HTMLElement>];
38
+ /**
39
+ * What {@link eunProps} accepts for an element: its writable properties,
40
+ * by their property name (`displayedDate`, not `displayed-date`), and a
41
+ * listener for any library event, as `on` followed by the event name.
42
+ */
43
+ export type EunomiaRefProps<T extends HTMLElement> = {
44
+ [K in WritableOwnKeys<T>]?: T[K];
45
+ } & EunomiaEventProps;
46
+ /**
47
+ * Returns a ref callback assigning `props` to the element once React
48
+ * attaches it. A function under a key made of `on` and a lowercase event
49
+ * name (`oneunchange`) is added as a listener for that event, and removed
50
+ * when React detaches the element or renders a new callback, while every
51
+ * other key, `onClose` included, is assigned as a property. Before the
52
+ * element is defined, the assigned properties wait on the element and are
53
+ * applied when it upgrades.
54
+ *
55
+ * @param props the properties and listeners to set.
56
+ * @returns the ref callback to pass as the element's `ref`.
57
+ */
58
+ export declare function eunProps<T extends HTMLElement>(props: EunomiaRefProps<T>): RefCallback<T>;
59
+ export {};
package/dist/react.js ADDED
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Returns a ref callback assigning `props` to the element once React
3
+ * attaches it. A function under a key made of `on` and a lowercase event
4
+ * name (`oneunchange`) is added as a listener for that event, and removed
5
+ * when React detaches the element or renders a new callback, while every
6
+ * other key, `onClose` included, is assigned as a property. Before the
7
+ * element is defined, the assigned properties wait on the element and are
8
+ * applied when it upgrades.
9
+ *
10
+ * @param props the properties and listeners to set.
11
+ * @returns the ref callback to pass as the element's `ref`.
12
+ */
13
+ export function eunProps(props) {
14
+ let removeListeners;
15
+ return (element) => {
16
+ // React 18 calls the callback with null instead of its cleanup
17
+ removeListeners?.();
18
+ removeListeners = undefined;
19
+ if (!element) {
20
+ return undefined;
21
+ }
22
+ const listeners = [];
23
+ for (const [key, value] of Object.entries(props)) {
24
+ const eventName = key.slice(2);
25
+ if (key.startsWith("on") &&
26
+ typeof value === "function" &&
27
+ eventName === eventName.toLowerCase()) {
28
+ element.addEventListener(eventName, value);
29
+ listeners.push([eventName, value]);
30
+ }
31
+ else {
32
+ element[key] = value;
33
+ }
34
+ }
35
+ removeListeners = () => {
36
+ for (const [eventName, listener] of listeners) {
37
+ element.removeEventListener(eventName, listener);
38
+ }
39
+ };
40
+ return removeListeners;
41
+ };
42
+ }
@@ -33,6 +33,41 @@ eun-animate:not(:defined) {
33
33
  }
34
34
  }
35
35
 
36
+ @media (scripting: enabled) and (width < 1024px) {
37
+ eun-animate[laptop-animation="none"]:not(:defined) {
38
+ opacity: 1;
39
+ transform: none;
40
+ }
41
+
42
+ eun-animate[laptop-animation="fade"]:not(:defined),
43
+ eun-animate[laptop-animation="faded-scroll-right"]:not(:defined),
44
+ eun-animate[laptop-animation="faded-scroll-left"]:not(:defined),
45
+ eun-animate[laptop-animation="faded-scroll-top"]:not(:defined),
46
+ eun-animate[laptop-animation="faded-scroll-bottom"]:not(:defined) {
47
+ opacity: 0;
48
+ }
49
+
50
+ eun-animate[laptop-animation="scroll-right"]:not(:defined),
51
+ eun-animate[laptop-animation="faded-scroll-right"]:not(:defined) {
52
+ transform: translateX(calc(-1 * var(--_distance)));
53
+ }
54
+
55
+ eun-animate[laptop-animation="scroll-left"]:not(:defined),
56
+ eun-animate[laptop-animation="faded-scroll-left"]:not(:defined) {
57
+ transform: translateX(var(--_distance));
58
+ }
59
+
60
+ eun-animate[laptop-animation="scroll-top"]:not(:defined),
61
+ eun-animate[laptop-animation="faded-scroll-top"]:not(:defined) {
62
+ transform: translateY(var(--_distance));
63
+ }
64
+
65
+ eun-animate[laptop-animation="scroll-bottom"]:not(:defined),
66
+ eun-animate[laptop-animation="faded-scroll-bottom"]:not(:defined) {
67
+ transform: translateY(calc(-1 * var(--_distance)));
68
+ }
69
+ }
70
+
36
71
  @media (scripting: enabled) and (width < 768px) {
37
72
  eun-animate[tablet-animation="none"]:not(:defined) {
38
73
  opacity: 1;
@@ -14,7 +14,7 @@ eun-breadcrumb:not(:defined) {
14
14
  overflow: hidden;
15
15
  text-overflow: ellipsis;
16
16
  white-space: nowrap;
17
- color: var(--breadcrumb-current-color, var(--eun-text-secondary, #484e61));
17
+ color: var(--breadcrumb-current-color, var(--eun-text-secondary, #666e8a));
18
18
  font-weight: var(--eun-font-weight-m, 500);
19
19
  }
20
20
 
@@ -28,7 +28,7 @@ eun-breadcrumb:not(:defined) {
28
28
  eun-breadcrumb:not(:defined) > a[aria-current="page"],
29
29
  eun-breadcrumb:not(:defined):not(:has(> [aria-current="page"])) > a:last-child
30
30
  ) {
31
- color: var(--breadcrumb-current-color, var(--eun-text-secondary, #484e61));
31
+ color: var(--breadcrumb-current-color, var(--eun-text-secondary, #666e8a));
32
32
  font-weight: var(--eun-font-weight-m, 500);
33
33
  text-decoration: none;
34
34
  }
@@ -37,7 +37,7 @@ eun-breadcrumb:not(:defined) > :not(:last-child)::after {
37
37
  content: var(--breadcrumb-separator, "/");
38
38
  display: inline-block;
39
39
  margin-inline: var(--breadcrumb-separator-gap, var(--eun-space-s, 8px));
40
- color: var(--breadcrumb-separator-color, var(--eun-text-secondary, #484e61));
40
+ color: var(--breadcrumb-separator-color, var(--eun-text-secondary, #666e8a));
41
41
  font-weight: var(--eun-font-weight-m, 500);
42
42
  text-decoration: none;
43
43
  }
@@ -5,7 +5,7 @@
5
5
  --_tint: var(--eun-color-primary-alpha-20, #3d6fff33);
6
6
  --_fgTint: var(--_accent);
7
7
  --_flat: var(--eun-surface-sunken, #f7f8fa);
8
- --_flatFg: var(--eun-text-secondary, #484e61);
8
+ --_flatFg: var(--eun-text-secondary, #666e8a);
9
9
  }
10
10
  :is(eun-button, eun-dropdown-button, eun-fab)[color="secondary"]:not(:defined) {
11
11
  --_solid: var(--eun-color-secondary-500, #e5a030);
@@ -170,7 +170,7 @@
170
170
  :is(eun-button, eun-dropdown-button)[appearance="ghost"]:not([color]):not(
171
171
  :defined
172
172
  ) {
173
- --_accent: var(--eun-text-secondary, #484e61);
173
+ --_accent: var(--eun-text-secondary, #666e8a);
174
174
  }
175
175
  :is(eun-button, eun-dropdown-button)[appearance="raised"]:not(:defined) {
176
176
  --_bg: transparent;
@@ -281,6 +281,12 @@ eun-fab[disabled]:not(:defined) {
281
281
  box-shadow: none;
282
282
  cursor: not-allowed;
283
283
  }
284
+ eun-fab[icon]:not(:has(> [slot="icon"])):not(:defined)::before {
285
+ content: "";
286
+ flex-shrink: 0;
287
+ width: var(--icon-size);
288
+ height: var(--icon-size);
289
+ }
284
290
  :where(eun-fab:not(:defined) > [slot="icon"]) {
285
291
  display: inline-flex;
286
292
  align-items: center;
@@ -145,7 +145,7 @@ eun-image-card:not(:defined) > :not([slot]) {
145
145
  font-size: var(--image-card-description-size, var(--eun-font-size-s, 14px));
146
146
  color: var(
147
147
  --image-card-description-color,
148
- var(--eun-text-secondary, #484e61)
148
+ var(--eun-text-secondary, #666e8a)
149
149
  );
150
150
  }
151
151