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

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 (245) hide show
  1. package/README.md +1 -1
  2. package/dist/cdn/components/chunks/{chunk-JYIIWN2P.js → chunk-36KLGY6U.js} +8 -8
  3. package/dist/cdn/components/chunks/chunk-3BMACIDO.js +1 -0
  4. package/dist/cdn/components/chunks/{chunk-KDN4O5W2.js → chunk-3PNGQEG4.js} +3 -3
  5. package/dist/cdn/components/chunks/{chunk-ZKZV2YG5.js → chunk-5XPOGBPL.js} +1 -1
  6. package/dist/cdn/components/chunks/{chunk-LMVW522V.js → chunk-62RLISRD.js} +1 -1
  7. package/dist/cdn/components/chunks/{chunk-PMPSJG5V.js → chunk-6FYW5TQU.js} +3 -3
  8. package/dist/cdn/components/chunks/chunk-AK2DIJX7.js +1 -0
  9. package/dist/cdn/components/chunks/chunk-B5XMGWM7.js +10 -0
  10. package/dist/cdn/components/chunks/chunk-BVASCT2V.js +109 -0
  11. package/dist/cdn/components/chunks/{chunk-VYFR364B.js → chunk-DGI7TKCU.js} +14 -9
  12. package/dist/cdn/components/chunks/chunk-GVS6IUKC.js +1 -0
  13. package/dist/cdn/components/chunks/chunk-GWLD2I3P.js +8 -0
  14. package/dist/cdn/components/chunks/{chunk-UDVB4LAE.js → chunk-I4ERDXSM.js} +5 -3
  15. package/dist/cdn/components/chunks/{chunk-QZ5SHR3I.js → chunk-J3SZBXM6.js} +2 -2
  16. package/dist/cdn/components/chunks/{chunk-MOMYII3P.js → chunk-LVKMAHMU.js} +10 -0
  17. package/dist/cdn/components/chunks/{chunk-XDPRWUKN.js → chunk-MQQJ6DID.js} +1 -1
  18. package/dist/cdn/components/chunks/{chunk-SZYEBMG6.js → chunk-PXF554MD.js} +1 -1
  19. package/dist/cdn/components/chunks/chunk-QL5GSW2A.js +1 -0
  20. package/dist/cdn/components/chunks/{chunk-7KKWYPHY.js → chunk-QXQ25SQS.js} +21 -19
  21. package/dist/cdn/components/chunks/{chunk-L2ADCEN7.js → chunk-SVGWCKWT.js} +1 -1
  22. package/dist/cdn/components/chunks/{chunk-MQQ4BGVJ.js → chunk-TFTRCIIK.js} +7 -6
  23. package/dist/cdn/components/chunks/chunk-TLBXTBMM.js +46 -0
  24. package/dist/cdn/components/chunks/chunk-UVHVQRPT.js +1 -0
  25. package/dist/cdn/components/chunks/chunk-WW4BTWMH.js +1 -0
  26. package/dist/cdn/components/chunks/{chunk-2Y2EU2CI.js → chunk-Z3OFIE7S.js} +1 -1
  27. package/dist/cdn/components/eun-alert.js +13 -6
  28. package/dist/cdn/components/eun-animate.js +3 -3
  29. package/dist/cdn/components/eun-badge.js +1 -1
  30. package/dist/cdn/components/eun-button.js +1 -1
  31. package/dist/cdn/components/eun-calendar.js +2 -2
  32. package/dist/cdn/components/eun-card.js +4 -4
  33. package/dist/cdn/components/eun-carousel.js +21 -18
  34. package/dist/cdn/components/eun-check-card.js +1 -1
  35. package/dist/cdn/components/eun-checkbox-list.js +11 -8
  36. package/dist/cdn/components/eun-checkbox.js +1 -1
  37. package/dist/cdn/components/eun-chip.js +3 -3
  38. package/dist/cdn/components/eun-color-picker.js +60 -68
  39. package/dist/cdn/components/eun-counter.js +10 -10
  40. package/dist/cdn/components/eun-date-picker.js +47 -46
  41. package/dist/cdn/components/eun-description-list.js +2 -2
  42. package/dist/cdn/components/eun-divider.js +3 -3
  43. package/dist/cdn/components/eun-drawer.js +5 -5
  44. package/dist/cdn/components/eun-dropdown-button.js +1 -1
  45. package/dist/cdn/components/eun-fab.js +2 -2
  46. package/dist/cdn/components/eun-icon.js +1 -1
  47. package/dist/cdn/components/eun-image-card.js +1 -1
  48. package/dist/cdn/components/eun-image-carousel.js +10 -10
  49. package/dist/cdn/components/eun-infinite-list.js +1 -1
  50. package/dist/cdn/components/eun-input-file.js +21 -21
  51. package/dist/cdn/components/eun-input-phone.js +10 -9
  52. package/dist/cdn/components/eun-input.js +1 -1
  53. package/dist/cdn/components/eun-link.js +2 -2
  54. package/dist/cdn/components/eun-loader.js +1 -1
  55. package/dist/cdn/components/eun-modal.js +13 -13
  56. package/dist/cdn/components/eun-pagination.js +16 -16
  57. package/dist/cdn/components/eun-password-strength.js +14 -10
  58. package/dist/cdn/components/eun-radio-card.js +1 -1
  59. package/dist/cdn/components/eun-radio-list.js +11 -8
  60. package/dist/cdn/components/eun-radio.js +1 -1
  61. package/dist/cdn/components/eun-rating.js +276 -0
  62. package/dist/cdn/components/eun-scheduler-event-editor.js +10 -10
  63. package/dist/cdn/components/eun-scheduler-event.js +1 -1
  64. package/dist/cdn/components/eun-scheduler.js +28 -28
  65. package/dist/cdn/components/eun-search.js +19 -21
  66. package/dist/cdn/components/eun-select.js +27 -27
  67. package/dist/cdn/components/eun-sidebar.js +10 -8
  68. package/dist/cdn/components/eun-skeleton.js +1 -1
  69. package/dist/cdn/components/eun-slider.js +3 -3
  70. package/dist/cdn/components/eun-sliding-card.js +1 -1
  71. package/dist/cdn/components/eun-step.js +5 -4
  72. package/dist/cdn/components/eun-stepper.js +25 -25
  73. package/dist/cdn/components/eun-switch.js +1 -1
  74. package/dist/cdn/components/eun-tab-group.js +4 -4
  75. package/dist/cdn/components/eun-tab.js +1 -1
  76. package/dist/cdn/components/eun-table-action-bar.js +1 -1
  77. package/dist/cdn/components/eun-table.js +1 -1
  78. package/dist/cdn/components/eun-tag.js +3 -3
  79. package/dist/cdn/components/eun-textarea.js +39 -34
  80. package/dist/cdn/components/eun-time-picker.js +15 -14
  81. package/dist/cdn/components/eun-toast.js +19 -10
  82. package/dist/cdn/components/eun-toggle-group.js +6 -4
  83. package/dist/cdn/components/eun-toggle-item.js +1 -1
  84. package/dist/cdn/components/eun-toggle.js +2 -2
  85. package/dist/cdn/components/eun-toolbar.js +5 -5
  86. package/dist/cdn/components/eun-tooltip.js +3 -3
  87. package/dist/components/action/button/button.d.ts +2 -1
  88. package/dist/components/action/button/button.js +3 -2
  89. package/dist/components/action/button/button.styles.js +10 -5
  90. package/dist/components/action/dropdown-button/dropdown-button.js +10 -5
  91. package/dist/components/action/toggle/toggle-group.js +1 -1
  92. package/dist/components/action/toggle/toggle-group.styles.js +4 -2
  93. package/dist/components/action/toggle/toggle.js +1 -1
  94. package/dist/components/alert/alert/alert.d.ts +9 -7
  95. package/dist/components/alert/alert/alert.js +11 -14
  96. package/dist/components/alert/alert/alert.styles.js +9 -2
  97. package/dist/components/alert/drawer/drawer.d.ts +5 -5
  98. package/dist/components/alert/drawer/drawer.js +8 -12
  99. package/dist/components/alert/drawer/drawer.styles.js +1 -1
  100. package/dist/components/alert/modal/modal.d.ts +10 -10
  101. package/dist/components/alert/modal/modal.js +13 -25
  102. package/dist/components/alert/toast/toast.d.ts +7 -5
  103. package/dist/components/alert/toast/toast.js +9 -13
  104. package/dist/components/alert/toast/toast.styles.js +15 -6
  105. package/dist/components/content/badge/badge.js +2 -2
  106. package/dist/components/content/card/card.js +1 -1
  107. package/dist/components/content/card/card.styles.js +2 -2
  108. package/dist/components/content/chip/chip.d.ts +4 -4
  109. package/dist/components/content/chip/chip.js +8 -8
  110. package/dist/components/content/description-list/description-list.js +3 -3
  111. package/dist/components/content/icon/icon.d.ts +3 -0
  112. package/dist/components/content/icon/icon.js +3 -0
  113. package/dist/components/content/icon/icon.style.d.ts +2 -0
  114. package/dist/components/content/icon/icon.style.js +4 -0
  115. package/dist/components/content/image-carousel/image-carousel.d.ts +12 -12
  116. package/dist/components/content/image-carousel/image-carousel.js +24 -24
  117. package/dist/components/content/password-strength/password-strength.d.ts +21 -6
  118. package/dist/components/content/password-strength/password-strength.js +37 -16
  119. package/dist/components/content/password-strength/password-strength.styles.js +4 -0
  120. package/dist/components/content/tag/tag.js +2 -2
  121. package/dist/components/content/tooltip/tooltip.js +3 -3
  122. package/dist/components/form/checkbox/check-card.d.ts +1 -0
  123. package/dist/components/form/checkbox/check-card.js +1 -0
  124. package/dist/components/form/checkbox/checkbox-list.d.ts +17 -0
  125. package/dist/components/form/checkbox/checkbox-list.js +39 -10
  126. package/dist/components/form/checkbox/checkbox.d.ts +1 -0
  127. package/dist/components/form/checkbox/checkbox.js +3 -1
  128. package/dist/components/form/checkbox/checkbox.styles.js +3 -2
  129. package/dist/components/form/color-picker/color-picker.d.ts +41 -28
  130. package/dist/components/form/color-picker/color-picker.js +66 -50
  131. package/dist/components/form/color-picker/color-picker.styles.js +1 -1
  132. package/dist/components/form/counter/counter.d.ts +22 -18
  133. package/dist/components/form/counter/counter.js +59 -61
  134. package/dist/components/form/date-picker/date-picker.d.ts +27 -6
  135. package/dist/components/form/date-picker/date-picker.js +75 -54
  136. package/dist/components/form/input/input.d.ts +38 -39
  137. package/dist/components/form/input/input.js +85 -109
  138. package/dist/components/form/input-file/input-file.d.ts +26 -13
  139. package/dist/components/form/input-file/input-file.js +35 -35
  140. package/dist/components/form/input-file/input-file.styles.js +4 -4
  141. package/dist/components/form/input-phone/input-phone.d.ts +22 -5
  142. package/dist/components/form/input-phone/input-phone.js +41 -13
  143. package/dist/components/form/radio/radio-card.d.ts +1 -0
  144. package/dist/components/form/radio/radio-card.js +1 -0
  145. package/dist/components/form/radio/radio-list.d.ts +23 -7
  146. package/dist/components/form/radio/radio-list.js +47 -22
  147. package/dist/components/form/radio/radio.d.ts +1 -0
  148. package/dist/components/form/radio/radio.js +1 -0
  149. package/dist/components/form/rating/rating.d.ts +349 -0
  150. package/dist/components/form/rating/rating.js +665 -0
  151. package/dist/components/form/rating/rating.styles.d.ts +1 -0
  152. package/dist/components/form/rating/rating.styles.js +213 -0
  153. package/dist/components/form/search/search.d.ts +8 -8
  154. package/dist/components/form/search/search.js +23 -41
  155. package/dist/components/form/select/select.d.ts +23 -10
  156. package/dist/components/form/select/select.js +59 -41
  157. package/dist/components/form/shared-styles/listbox.styles.js +10 -0
  158. package/dist/components/form/slider/slider.d.ts +7 -8
  159. package/dist/components/form/slider/slider.js +9 -12
  160. package/dist/components/form/switch/switch.d.ts +1 -0
  161. package/dist/components/form/switch/switch.js +1 -0
  162. package/dist/components/form/textarea/textarea.d.ts +89 -23
  163. package/dist/components/form/textarea/textarea.js +192 -43
  164. package/dist/components/form/time-picker/time-picker-columns.d.ts +2 -2
  165. package/dist/components/form/time-picker/time-picker-columns.js +8 -8
  166. package/dist/components/form/time-picker/time-picker.d.ts +24 -8
  167. package/dist/components/form/time-picker/time-picker.js +59 -38
  168. package/dist/components/layout/animate/animate.js +1 -1
  169. package/dist/components/layout/animate/animate.styles.js +2 -2
  170. package/dist/components/layout/divider/divider.js +1 -1
  171. package/dist/components/layout/divider/divider.styles.js +1 -1
  172. package/dist/components/loader/loader/loader.js +2 -2
  173. package/dist/components/loader/loader/loader.styles.js +14 -12
  174. package/dist/components/loader/skeleton/skeleton.js +1 -1
  175. package/dist/components/navigation/carousel/carousel.d.ts +31 -7
  176. package/dist/components/navigation/carousel/carousel.js +74 -35
  177. package/dist/components/navigation/carousel/carousel.styles.js +5 -2
  178. package/dist/components/navigation/pagination/pagination.d.ts +23 -21
  179. package/dist/components/navigation/pagination/pagination.js +30 -53
  180. package/dist/components/navigation/sidebar/sidebar.d.ts +15 -13
  181. package/dist/components/navigation/sidebar/sidebar.js +21 -33
  182. package/dist/components/navigation/sidebar/sidebar.styles.js +5 -3
  183. package/dist/components/navigation/stepper/step.js +9 -8
  184. package/dist/components/navigation/stepper/stepper.js +12 -5
  185. package/dist/components/navigation/tabs/tab-group/tab-group.js +2 -2
  186. package/dist/components/navigation/tabs/tab-group/tab-group.styles.js +2 -2
  187. package/dist/components/navigation/toolbar/toolbar.d.ts +13 -13
  188. package/dist/components/navigation/toolbar/toolbar.js +20 -34
  189. package/dist/features/scheduler/calendar/calendar.js +1 -1
  190. package/dist/features/scheduler/scheduler/scheduler.d.ts +7 -7
  191. package/dist/features/scheduler/scheduler/scheduler.js +15 -24
  192. package/dist/features/scheduler/scheduler-event/scheduler-event.js +3 -3
  193. package/dist/features/scheduler/scheduler-event/scheduler-event.styles.js +1 -1
  194. package/dist/features/scheduler/scheduler-event-editor/scheduler-event-editor.d.ts +6 -4
  195. package/dist/features/scheduler/scheduler-event-editor/scheduler-event-editor.js +6 -7
  196. package/dist/i18n/en.d.ts +68 -0
  197. package/dist/i18n/en.js +68 -0
  198. package/dist/i18n/fr.js +68 -2
  199. package/dist/index.d.ts +2 -0
  200. package/dist/index.js +1 -0
  201. package/dist/mixins/button.mixin.js +3 -2
  202. package/dist/mixins/check.mixin.js +11 -10
  203. package/dist/mixins/disabled.mixin.d.ts +5 -0
  204. package/dist/mixins/disabled.mixin.js +21 -1
  205. package/dist/mixins/editable.mixin.js +28 -5
  206. package/dist/mixins/field-appearance.mixin.js +3 -2
  207. package/dist/mixins/form.mixin.d.ts +4 -0
  208. package/dist/mixins/form.mixin.js +87 -13
  209. package/dist/mixins/localizable.mixin.d.ts +1 -1
  210. package/dist/mixins/localizable.mixin.js +1 -1
  211. package/dist/mixins/radio.mixin.js +11 -10
  212. package/dist/mixins/readonly.mixin.d.ts +2 -1
  213. package/dist/mixins/readonly.mixin.js +10 -3
  214. package/dist/ssr/alert-ssr.css +187 -0
  215. package/dist/ssr/badge-ssr.css +67 -0
  216. package/dist/ssr/breadcrumb-ssr.css +41 -0
  217. package/dist/ssr/card-ssr.css +27 -15
  218. package/dist/ssr/carousel-ssr.css +238 -0
  219. package/dist/ssr/checkbox-ssr.css +67 -0
  220. package/dist/ssr/chip-ssr.css +242 -0
  221. package/dist/ssr/collapse-ssr.css +151 -0
  222. package/dist/ssr/field-ssr.css +163 -0
  223. package/dist/ssr/icon-ssr.css +266 -0
  224. package/dist/ssr/image-carousel-ssr.css +24 -0
  225. package/dist/ssr/links-ssr.css +7 -1
  226. package/dist/ssr/pagination-ssr.css +4 -0
  227. package/dist/ssr/rating-ssr.css +254 -0
  228. package/dist/ssr/sidebar-ssr.css +9 -1
  229. package/dist/ssr/skeleton-ssr.css +63 -0
  230. package/dist/ssr/tabs-ssr.css +129 -0
  231. package/dist/ssr/toggle-group-ssr.css +182 -0
  232. package/dist/ssr/toolbar-ssr.css +31 -2
  233. package/dist/utils/implicit-submission.utils.d.ts +18 -0
  234. package/dist/utils/implicit-submission.utils.js +79 -0
  235. package/dist/utils/listbox-options.utils.d.ts +11 -0
  236. package/dist/utils/listbox-options.utils.js +41 -3
  237. package/package.json +26 -7
  238. package/dist/cdn/components/chunks/chunk-4PI6RDUS.js +0 -1
  239. package/dist/cdn/components/chunks/chunk-A3X4KD2X.js +0 -1
  240. package/dist/cdn/components/chunks/chunk-BQFJR2UP.js +0 -110
  241. package/dist/cdn/components/chunks/chunk-G5SBDQQ3.js +0 -1
  242. package/dist/cdn/components/chunks/chunk-KSZRQRN4.js +0 -1
  243. package/dist/cdn/components/chunks/chunk-PE4DAXHQ.js +0 -3
  244. package/dist/cdn/components/chunks/chunk-RS7TWEMQ.js +0 -1
  245. package/dist/cdn/components/chunks/chunk-VOTRXBDS.js +0 -38
@@ -0,0 +1,213 @@
1
+ import { css } from "lit";
2
+ /**
3
+ * Base style for rating.
4
+ *
5
+ * Custom css variables:
6
+ * [--rating-size] - Set a custom width/height for each icon
7
+ * [--rating-gap] - Set a custom space between two icons
8
+ * [--rating-color] - Set a custom color to the filled icons
9
+ * [--rating-empty-color] - Set a custom color to the empty icons
10
+ * [--rating-error-color] - Set a custom color to the error message, and to the empty icons while in error
11
+ * [--rating-hint-color] - Set a custom color to the hint message
12
+ * [--rating-focus-outline-color] - Set a custom color to the focus outline drawn around the focused icon and the clear button
13
+ */
14
+ const base = css `
15
+ :host {
16
+ --_iconSize: var(--rating-size, 24px);
17
+ --_gap: var(--rating-gap, var(--eun-space-xs, 4px));
18
+ --_color: var(--rating-color, var(--eun-color-primary-500, #3d6fff));
19
+ --_emptyColor: var(
20
+ --rating-empty-color,
21
+ color-mix(
22
+ in srgb,
23
+ var(--eun-text-color, #071621) 55%,
24
+ var(--eun-surface-color, #ffffff)
25
+ )
26
+ );
27
+ --_errorColor: var(
28
+ --rating-error-color,
29
+ var(--eun-color-critical-100, #aa0014)
30
+ );
31
+ --_hintColor: var(--rating-hint-color, var(--eun-text-secondary, #484e61));
32
+ --_focusIndicator: var(
33
+ --rating-focus-outline-color,
34
+ var(--eun-color-primary-500, #3d6fff)
35
+ );
36
+ font-family: var(--eun-font-family, "Mulish", sans-serif);
37
+ font-size: var(--eun-font-size-s, 14px);
38
+ display: inline-block;
39
+ vertical-align: middle;
40
+ outline: none;
41
+ }
42
+
43
+ #wrapper {
44
+ display: flex;
45
+ flex-direction: column;
46
+ gap: var(--eun-space-xs, 4px);
47
+ }
48
+
49
+ #control {
50
+ display: flex;
51
+ align-items: center;
52
+ gap: var(--eun-space-s, 8px);
53
+ }
54
+
55
+ #items {
56
+ display: flex;
57
+ gap: var(--_gap);
58
+ cursor: pointer;
59
+ }
60
+
61
+ .item {
62
+ position: relative;
63
+ flex: none;
64
+ width: var(--_iconSize);
65
+ height: var(--_iconSize);
66
+ }
67
+
68
+ :host([display-only]) #items {
69
+ cursor: default;
70
+ }
71
+
72
+ .icon {
73
+ position: absolute;
74
+ inset: 0;
75
+ pointer-events: none;
76
+ }
77
+
78
+ .icon eun-icon {
79
+ --icon-size: var(--_iconSize);
80
+ display: block;
81
+ width: var(--_iconSize);
82
+ height: var(--_iconSize);
83
+ }
84
+
85
+ .empty {
86
+ --icon-color: var(--_emptyColor);
87
+ }
88
+
89
+ .fill {
90
+ position: absolute;
91
+ inset-block: 0;
92
+ inset-inline-start: 0;
93
+ overflow: hidden;
94
+ --icon-color: var(--_color);
95
+ }
96
+
97
+ .fill eun-icon {
98
+ flex: none;
99
+ }
100
+
101
+ input {
102
+ position: absolute;
103
+ inset-block: 0;
104
+ inset-inline-start: 0;
105
+ width: 100%;
106
+ height: 100%;
107
+ margin: 0;
108
+ opacity: 0;
109
+ appearance: none;
110
+ pointer-events: none;
111
+ }
112
+
113
+ input.half {
114
+ width: 50%;
115
+ }
116
+
117
+ input.end {
118
+ inset-inline-start: 50%;
119
+ width: 50%;
120
+ }
121
+
122
+ .focus-ring {
123
+ position: absolute;
124
+ inset: -3px;
125
+ border-radius: var(--eun-border-radius-s, 4px);
126
+ outline: 2px solid transparent;
127
+ pointer-events: none;
128
+ transition: outline-color var(--eun-duration-s, 150ms)
129
+ var(--eun-easing-default, ease);
130
+ }
131
+
132
+ .focus-ring.half {
133
+ inset-inline-end: 50%;
134
+ }
135
+
136
+ input:focus-visible + .focus-ring {
137
+ outline-color: var(--_focusIndicator);
138
+ }
139
+
140
+ #clear {
141
+ display: inline-flex;
142
+ align-items: center;
143
+ justify-content: center;
144
+ min-width: 24px;
145
+ min-height: 24px;
146
+ padding: 2px;
147
+ border: none;
148
+ border-radius: 50%;
149
+ background: transparent;
150
+ color: var(--eun-text-secondary, #484e61);
151
+ cursor: pointer;
152
+ outline: 2px solid transparent;
153
+ outline-offset: 2px;
154
+ --icon-size: 18px;
155
+ transition:
156
+ background-color var(--eun-duration-s, 150ms)
157
+ var(--eun-easing-default, ease),
158
+ outline-color var(--eun-duration-s, 150ms) var(--eun-easing-default, ease);
159
+ }
160
+
161
+ #clear:hover {
162
+ background: var(--eun-content-hover, #9696961a);
163
+ }
164
+
165
+ #clear:active {
166
+ background: var(--eun-content-pressed, #e4e6e8);
167
+ }
168
+
169
+ #clear:focus-visible {
170
+ outline-color: var(--_focusIndicator);
171
+ }
172
+
173
+ #items[aria-invalid="true"] {
174
+ --_emptyColor: var(--_errorColor);
175
+ }
176
+
177
+ :host([aria-readonly="true"]) {
178
+ --_color: var(--eun-readonly-color, #666e8a);
179
+ }
180
+
181
+ :host([aria-readonly="true"]) #items {
182
+ cursor: default;
183
+ }
184
+
185
+ :host([aria-disabled="true"]) {
186
+ --_color: var(--eun-text-disabled-color, #8d93aa);
187
+ --_emptyColor: var(--eun-disabled-content, #c1c9d6);
188
+ }
189
+
190
+ :host([aria-disabled="true"]) #items {
191
+ cursor: not-allowed;
192
+ }
193
+
194
+ @media (forced-colors: active) {
195
+ .fill {
196
+ --icon-color: CanvasText;
197
+ }
198
+
199
+ .empty {
200
+ --icon-color: CanvasText;
201
+ }
202
+
203
+ input:focus-visible + .focus-ring,
204
+ #clear:focus-visible {
205
+ outline-color: Highlight;
206
+ }
207
+
208
+ :host([aria-disabled="true"]) .icon eun-icon {
209
+ --icon-color: GrayText;
210
+ }
211
+ }
212
+ `;
213
+ export const ratingStyles = base;
@@ -26,7 +26,7 @@ declare const EunomiaSearch_base: import("../../../utils/constructor.type.js").C
26
26
  * @slot results - Content rendered below the field inside the panel, such as a result list. Only relevant when panel is set
27
27
  * @prop {boolean} [shortcut=false] - Enables the Ctrl+K or Cmd+K global shortcut and its visual key hint badge
28
28
  * @prop {boolean} [panel=false] - Opens a modal command palette panel on shortcut or click instead of focusing inline
29
- * @prop {string} [ariaLabelPanel='Search'] - The accessible name of the panel's dialog, used when label isn't set
29
+ * @prop {string} [panelLabel] - The accessible name of the panel's dialog, used when label isn't set. Defaults to the localized string for the current locale (English: "Search")
30
30
  * @prop {boolean} [loading=false] - Whether a search request is currently in flight. Shows a spinning loading indicator in place of the clear button or shortcut hint on the inline field only. Ignored on the panel trigger and the panel's own field, which stay static, so reflect the loading state on the results slot instead
31
31
  * @prop {string} [loadingLabel='Loading…'] - The accessible label announced by the loading indicator while loading is set
32
32
  * @prop {boolean} [suggestions=false] - Opens a dropdown listbox showing light DOM option and optgroup children matching the typed value, highlighting the matched substring. Ignored while panel is set
@@ -54,7 +54,8 @@ export declare class EunomiaSearch extends EunomiaSearch_base {
54
54
  /**
55
55
  * Always `"search"` — enforced in `willUpdate`, since `EunomiaInput` declares
56
56
  * `type` as a plain property (not an accessor), which TypeScript doesn't
57
- * allow overriding as a getter/setter pair from a subclass.
57
+ * allow overriding as a getter/setter pair from a subclass. Never
58
+ * reflected, since it can't differ from its default.
58
59
  * @default search
59
60
  */
60
61
  type: EunomiaInputType;
@@ -91,9 +92,9 @@ export declare class EunomiaSearch extends EunomiaSearch_base {
91
92
  * Accessible name of the panel's dialog, used as `eun-modal`'s `aria-label`
92
93
  * since the panel renders no visible heading. Ignored when `label` is set
93
94
  * (used instead, since it already names the field itself).
94
- * @default Search
95
+ * Falls back to the localized string for the current locale when unset.
95
96
  */
96
- ariaLabelPanel: string;
97
+ panelLabel?: string;
97
98
  /**
98
99
  * Indicates whether a search request is currently in flight. Shows a
99
100
  * spinning `eun-loader` in place of the clear button/shortcut hint on the
@@ -200,7 +201,7 @@ export declare class EunomiaSearch extends EunomiaSearch_base {
200
201
  */
201
202
  protected willUpdate(changedProperties: PropertyValues): void;
202
203
  /**
203
- * Redirects the host's own focus (see `EunomiaInput.handleHostFocus`) to
204
+ * Sends a direct `focus()` call on the host to
204
205
  * the collapsed trigger button while `panel` is set, instead of the
205
206
  * inherited default (the native field) : that field lives inside the
206
207
  * still-closed modal at this point, and focusing hidden popover content
@@ -360,9 +361,8 @@ export declare class EunomiaSearch extends EunomiaSearch_base {
360
361
  */
361
362
  private readonly handleSuggestionsPopoverToggle;
362
363
  /**
363
- * Renders the dropdown's option rows, inserting a non-interactive group
364
- * heading whenever an option's `group` differs from the previous row's,
365
- * and highlighting the matched substring — same rendering as
364
+ * Renders the dropdown's option rows, grouped under their `optgroup`
365
+ * label (see {@link renderListboxRows}), and highlighting the matched substring — same rendering as
366
366
  * `eun-select`'s own `renderOptionRows`, minus the `multiple` checkbox
367
367
  * (search has no multi-select concept) and the `selected` state now
368
368
  * meaning "exactly matches the current value" rather than "is the stored
@@ -14,7 +14,7 @@ import { searchStyles } from "./search.styles.js";
14
14
  import { AnchorPositionMixin } from "../../../mixins/anchor-position.mixin.js";
15
15
  import { ChangeEvent } from "../../../events/change.event.js";
16
16
  import { listboxStyles, listboxAnchorPositioningStyles, } from "../shared-styles/listbox.styles.js";
17
- import { parseListboxOptions, renderHighlightedLabel, } from "../../../utils/listbox-options.utils.js";
17
+ import { parseListboxOptions, renderHighlightedLabel, renderListboxRows, } from "../../../utils/listbox-options.utils.js";
18
18
  import { isWebKit } from "../../../utils/browser.utils.js";
19
19
  import { resolveDurationMs, resolveEasing, } from "../../../utils/motion.utils.js";
20
20
  /**
@@ -41,7 +41,7 @@ export const EunomiaSearchTagName = "eun-search";
41
41
  * @slot results - Content rendered below the field inside the panel, such as a result list. Only relevant when panel is set
42
42
  * @prop {boolean} [shortcut=false] - Enables the Ctrl+K or Cmd+K global shortcut and its visual key hint badge
43
43
  * @prop {boolean} [panel=false] - Opens a modal command palette panel on shortcut or click instead of focusing inline
44
- * @prop {string} [ariaLabelPanel='Search'] - The accessible name of the panel's dialog, used when label isn't set
44
+ * @prop {string} [panelLabel] - The accessible name of the panel's dialog, used when label isn't set. Defaults to the localized string for the current locale (English: "Search")
45
45
  * @prop {boolean} [loading=false] - Whether a search request is currently in flight. Shows a spinning loading indicator in place of the clear button or shortcut hint on the inline field only. Ignored on the panel trigger and the panel's own field, which stay static, so reflect the loading state on the results slot instead
46
46
  * @prop {string} [loadingLabel='Loading…'] - The accessible label announced by the loading indicator while loading is set
47
47
  * @prop {boolean} [suggestions=false] - Opens a dropdown listbox showing light DOM option and optgroup children matching the typed value, highlighting the matched substring. Ignored while panel is set
@@ -64,7 +64,8 @@ let EunomiaSearch = EunomiaSearch_1 = class EunomiaSearch extends AnchorPosition
64
64
  /**
65
65
  * Always `"search"` — enforced in `willUpdate`, since `EunomiaInput` declares
66
66
  * `type` as a plain property (not an accessor), which TypeScript doesn't
67
- * allow overriding as a getter/setter pair from a subclass.
67
+ * allow overriding as a getter/setter pair from a subclass. Never
68
+ * reflected, since it can't differ from its default.
68
69
  * @default search
69
70
  */
70
71
  this.type = "search";
@@ -97,13 +98,6 @@ let EunomiaSearch = EunomiaSearch_1 = class EunomiaSearch extends AnchorPosition
97
98
  * @default false
98
99
  */
99
100
  this.panel = false;
100
- /**
101
- * Accessible name of the panel's dialog, used as `eun-modal`'s `aria-label`
102
- * since the panel renders no visible heading. Ignored when `label` is set
103
- * (used instead, since it already names the field itself).
104
- * @default Search
105
- */
106
- this.ariaLabelPanel = "Search";
107
101
  /**
108
102
  * Indicates whether a search request is currently in flight. Shows a
109
103
  * spinning `eun-loader` in place of the clear button/shortcut hint on the
@@ -313,7 +307,7 @@ let EunomiaSearch = EunomiaSearch_1 = class EunomiaSearch extends AnchorPosition
313
307
  }
314
308
  }
315
309
  /**
316
- * Redirects the host's own focus (see `EunomiaInput.handleHostFocus`) to
310
+ * Sends a direct `focus()` call on the host to
317
311
  * the collapsed trigger button while `panel` is set, instead of the
318
312
  * inherited default (the native field) : that field lives inside the
319
313
  * still-closed modal at this point, and focusing hidden popover content
@@ -520,9 +514,8 @@ let EunomiaSearch = EunomiaSearch_1 = class EunomiaSearch extends AnchorPosition
520
514
  this.closeSuggestions();
521
515
  }
522
516
  /**
523
- * Renders the dropdown's option rows, inserting a non-interactive group
524
- * heading whenever an option's `group` differs from the previous row's,
525
- * and highlighting the matched substring — same rendering as
517
+ * Renders the dropdown's option rows, grouped under their `optgroup`
518
+ * label (see {@link renderListboxRows}), and highlighting the matched substring — same rendering as
526
519
  * `eun-select`'s own `renderOptionRows`, minus the `multiple` checkbox
527
520
  * (search has no multi-select concept) and the `selected` state now
528
521
  * meaning "exactly matches the current value" rather than "is the stored
@@ -533,40 +526,27 @@ let EunomiaSearch = EunomiaSearch_1 = class EunomiaSearch extends AnchorPosition
533
526
  * @private
534
527
  */
535
528
  renderSuggestionOptionRows(options) {
536
- const rows = [];
537
529
  const query = this.effectiveQuery;
538
- let lastGroup;
539
- options.forEach((option, index) => {
540
- if (option.group !== lastGroup) {
541
- lastGroup = option.group;
542
- if (option.group) {
543
- rows.push(html `<li class="group-label" role="presentation">
544
- ${option.group}
545
- </li>`);
546
- }
547
- }
548
- rows.push(html `
530
+ return renderListboxRows(options, (option, index) => html `
549
531
  <li
550
532
  id="listbox-option-${index}"
551
533
  role="option"
552
534
  aria-selected=${option.label.toLowerCase() === query}
553
535
  class=${classMap({
554
- highlighted: index === this.highlightedIndex,
555
- selected: option.label.toLowerCase() === query,
556
- })}
536
+ highlighted: index === this.highlightedIndex,
537
+ selected: option.label.toLowerCase() === query,
538
+ })}
557
539
  @mousedown=${(event) => {
558
- event.preventDefault();
559
- this.handleSelect(option);
560
- }}
540
+ event.preventDefault();
541
+ this.handleSelect(option);
542
+ }}
561
543
  @mouseenter=${() => {
562
- this.highlightedIndex = index;
563
- }}
544
+ this.highlightedIndex = index;
545
+ }}
564
546
  >
565
547
  ${renderHighlightedLabel(option.label, query)}
566
548
  </li>
567
549
  `);
568
- });
569
- return rows;
570
550
  }
571
551
  /**
572
552
  * Renders the suggestions dropdown panel itself — only ever rendered
@@ -782,10 +762,12 @@ let EunomiaSearch = EunomiaSearch_1 = class EunomiaSearch extends AnchorPosition
782
762
  field.removeAttribute("role");
783
763
  field.removeAttribute("aria-expanded");
784
764
  field.removeAttribute("aria-controls");
765
+ field.removeAttribute("aria-autocomplete");
785
766
  field.removeAttribute("aria-activedescendant");
786
767
  return;
787
768
  }
788
769
  field.setAttribute("role", "combobox");
770
+ field.setAttribute("aria-autocomplete", "list");
789
771
  field.setAttribute("aria-expanded", this.isOpen ? "true" : "false");
790
772
  field.setAttribute("aria-controls", "listbox");
791
773
  if (this.highlightedIndex >= 0) {
@@ -835,7 +817,8 @@ let EunomiaSearch = EunomiaSearch_1 = class EunomiaSearch extends AnchorPosition
835
817
  kind="search"
836
818
  hide-actions
837
819
  .closeable=${false}
838
- aria-label=${this.label || this.ariaLabelPanel}
820
+ aria-label=${this.label ||
821
+ (this.panelLabel ?? this.dictionary.search.panel)}
839
822
  >
840
823
  <div id="panel-field">
841
824
  ${this.renderField(description !== nothing)}
@@ -858,7 +841,6 @@ let EunomiaSearch = EunomiaSearch_1 = class EunomiaSearch extends AnchorPosition
858
841
  EunomiaSearch.styles = [
859
842
  EunomiaInput.styles,
860
843
  listboxStyles,
861
- // Never shipped to WebKit — see listboxAnchorPositioningStyles's own doc.
862
844
  ...(isWebKit ? [] : [listboxAnchorPositioningStyles]),
863
845
  searchStyles,
864
846
  ];
@@ -869,7 +851,7 @@ EunomiaSearch.styles = [
869
851
  */
870
852
  EunomiaSearch.FIELD_POINTER_DOWN_WINDOW_MS = 100;
871
853
  __decorate([
872
- property({ reflect: true })
854
+ property({ reflect: true, converter: { toAttribute: () => null } })
873
855
  ], EunomiaSearch.prototype, "type", void 0);
874
856
  __decorate([
875
857
  property()
@@ -884,8 +866,8 @@ __decorate([
884
866
  property({ type: Boolean })
885
867
  ], EunomiaSearch.prototype, "panel", void 0);
886
868
  __decorate([
887
- property({ attribute: "aria-label-panel" })
888
- ], EunomiaSearch.prototype, "ariaLabelPanel", void 0);
869
+ property({ attribute: "panel-label" })
870
+ ], EunomiaSearch.prototype, "panelLabel", void 0);
889
871
  __decorate([
890
872
  property({ type: Boolean, reflect: true })
891
873
  ], EunomiaSearch.prototype, "loading", void 0);
@@ -9,6 +9,7 @@ import { FieldAppearanceMixinInterface } from "../../../mixins/field-appearance.
9
9
  import { AnchorPositionMixinInterface } from "../../../mixins/anchor-position.mixin.js";
10
10
  import { EunomiaIconName } from "../../content/icon/icon.type.js";
11
11
  import { Constructor } from "../../../utils/constructor.type.js";
12
+ import { LocalizableMixinInterface } from "../../../mixins/localizable.mixin.js";
12
13
  /**
13
14
  * Tag name of the select component.
14
15
  */
@@ -22,7 +23,7 @@ type SelectValue = string | string[];
22
23
  * Type of the select base used to declare every necessary Mixin interface elements.
23
24
  * @internal
24
25
  */
25
- type EunomiaSelectBase = LitElement & DisabledMixinInterface & ReadonlyMixinInterface & ValidatorsMixinInterface<SelectValue> & FormMixinInterface<SelectValue> & EditableMixinInterface & FormLabelMixinInterface & FieldAppearanceMixinInterface & AnchorPositionMixinInterface;
26
+ type EunomiaSelectBase = LitElement & DisabledMixinInterface & ReadonlyMixinInterface & ValidatorsMixinInterface<SelectValue> & FormMixinInterface<SelectValue> & EditableMixinInterface & FormLabelMixinInterface & FieldAppearanceMixinInterface & AnchorPositionMixinInterface & LocalizableMixinInterface;
26
27
  declare const EunomiaSelectMixinBase: Constructor<EunomiaSelectBase>;
27
28
  /**
28
29
  * A field that picks one or more values from a list of option and optgroup
@@ -60,6 +61,7 @@ declare const EunomiaSelectMixinBase: Constructor<EunomiaSelectBase>;
60
61
  * @prop {boolean} [readonly=false] - Whether the field is read only
61
62
  * @prop {boolean} [required=false] - Whether a selection is required
62
63
  * @prop {boolean} [hideError=false] - Whether the errors are hidden. The hint stays visible
64
+ * @prop {boolean} [invalid=false] - Shows the field as invalid without any message, for an error displayed elsewhere
63
65
  * @prop {string} [error] - An error computed outside the field, by the form or by the server. While set, the field is invalid and shows this message right away
64
66
  * @prop {Array<Validators<string | string[]>>} validators - The list of validation rules applied to the field value
65
67
  * @prop {EunomiaIconName} icon - An optional leading icon
@@ -70,10 +72,10 @@ declare const EunomiaSelectMixinBase: Constructor<EunomiaSelectBase>;
70
72
  * @attr {string} [select-placeholder='Select…'] - The fallback for placeholder when searchable isn't set
71
73
  * @prop {boolean} [readonlyAvailable=false] - Whether the field can switch between a static display and an editable one
72
74
  * @attr {boolean} [readonly-available=false] - Whether the field can switch between a static display and an editable one
73
- * @prop {string} [emptyValueLabel='No value set'] - Text displayed in place of the value when readonly and empty
75
+ * @prop {string} [emptyValueLabel] - Text displayed in place of the value when readonly and empty. Defaults to the localized string for the current locale (English: "No value set")
74
76
  * @prop {string} [noResultsLabel='No results'] - Text displayed in the dropdown when no option matches the search
75
- * @prop {string} [confirmLabel='Confirm'] - The label of the confirm button, shown while editing in readonlyAvailable mode or while multiple and the dropdown is open. Set to an empty string to hide the button entirely
76
- * @attr {string} [confirm-label='Confirm'] - The label of the confirm button, shown while editing in readonlyAvailable mode or while multiple and the dropdown is open. Set to an empty string to hide the button entirely
77
+ * @prop {string} [confirmLabel] - The label of the confirm button, shown while editing in readonlyAvailable mode or while multiple and the dropdown is open. Set to an empty string to hide the button entirely. Defaults to the localized string for the current locale (English: "Confirm")
78
+ * @attr {string} [confirm-label] - The label of the confirm button, shown while editing in readonlyAvailable mode or while multiple and the dropdown is open. Set to an empty string to hide the button entirely. Defaults to the localized string for the current locale (English: "Confirm")
77
79
  * @prop {boolean} [noAnimation=false] - Disables the dropdown panel's open and close height transition, on top of the automatic reduced motion handling
78
80
  * @prop {boolean} [loading=false] - Whether options are currently being fetched. Shows a spinning loading indicator in place of the dropdown arrow, and a single disabled loading row instead of the option list. Has no effect while native, beyond the arrow swap
79
81
  * @prop {string} [loadingLabel='Loading…'] - The accessible label announced by the loading indicator while loading is set
@@ -119,6 +121,11 @@ export declare class EunomiaSelect extends EunomiaSelectMixinBase {
119
121
  * @readonly
120
122
  */
121
123
  static readonly styles: (import("lit").CSSResult | import("lit").CSSResult[])[];
124
+ /**
125
+ * Every change is a complete choice, so its error shows right away.
126
+ * @internal
127
+ */
128
+ errorOnChange: boolean;
122
129
  /**
123
130
  * The default value applied on connection and form reset. Overrides the
124
131
  * `defaultValue` accessor inherited from `FormMixin` only to drop its
@@ -215,9 +222,9 @@ export declare class EunomiaSelect extends EunomiaSelectMixinBase {
215
222
  selectPlaceholder: string;
216
223
  /**
217
224
  * Text displayed in place of the value when readonly and empty.
218
- * @default No value set
225
+ * Falls back to the localized string for the current locale when unset.
219
226
  */
220
- emptyValueLabel: string;
227
+ emptyValueLabel?: string;
221
228
  /**
222
229
  * Text displayed in the dropdown when no option matches the search.
223
230
  * @default No results
@@ -231,9 +238,9 @@ export declare class EunomiaSelect extends EunomiaSelectMixinBase {
231
238
  * Set to an empty string to hide the button entirely — e.g. for a
232
239
  * `readonlyAvailable` field where picking an option is already confirmation
233
240
  * enough on its own, and the extra button would just be clutter.
234
- * @default Confirm
241
+ * Falls back to the localized string for the current locale when unset.
235
242
  */
236
- confirmLabel: string;
243
+ confirmLabel?: string;
237
244
  /**
238
245
  * Indicates whether options are currently being fetched (e.g. a
239
246
  * server-filtered `searchable` field). Shows a spinning `eun-loader` in
@@ -483,6 +490,12 @@ export declare class EunomiaSelect extends EunomiaSelectMixinBase {
483
490
  * @param _changedProperties - Map of changed properties
484
491
  */
485
492
  protected updated(_changedProperties: PropertyValues): void;
493
+ /**
494
+ * The host is never a tab stop of its own : sequential navigation goes
495
+ * straight to the controls inside, in both directions, and
496
+ * {@link focus} covers a direct call on the host.
497
+ */
498
+ protected get hostTabStop(): boolean;
486
499
  /**
487
500
  * Returns the field element to focus/anchor on validation errors.
488
501
  *
@@ -707,8 +720,8 @@ export declare class EunomiaSelect extends EunomiaSelectMixinBase {
707
720
  */
708
721
  private renderHighlighted;
709
722
  /**
710
- * Renders the dropdown's option rows, inserting a non-interactive group
711
- * heading whenever an option's `group` differs from the previous row's.
723
+ * Renders the dropdown's option rows, grouped under their `optgroup`
724
+ * label (see {@link renderListboxRows}).
712
725
  *
713
726
  * @param options the options to render, already filtered.
714
727
  * @returns the rendered rows.