@igne-agency/react-web-ui 0.3.1 → 0.5.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 (291) hide show
  1. package/README.md +32 -1
  2. package/dist/base.css +3 -0
  3. package/dist/components/accordion/accordion.css +24 -19
  4. package/dist/components/accordion/accordion.d.ts +19 -3
  5. package/dist/components/accordion/accordion.js +86 -32
  6. package/dist/components/accordion/accordion.module.js +8 -8
  7. package/dist/components/active-filters/active-filter-describers.d.ts +1 -1
  8. package/dist/components/active-filters/active-filter-describers.js +1 -1
  9. package/dist/components/active-filters/active-filters.d.ts +35 -2
  10. package/dist/components/active-filters/active-filters.js +57 -52
  11. package/dist/components/active-filters/index.js +2 -2
  12. package/dist/components/attachment-tile/attachment-preview.d.ts +11 -9
  13. package/dist/components/attachment-tile/attachment-preview.js +102 -68
  14. package/dist/components/attachment-tile/attachment-tile.css +22 -13
  15. package/dist/components/attachment-tile/attachment-tile.d.ts +51 -6
  16. package/dist/components/attachment-tile/attachment-tile.js +209 -85
  17. package/dist/components/attachment-tile/attachment-tile.module.js +10 -10
  18. package/dist/components/attachment-tile/index.d.ts +1 -1
  19. package/dist/components/attachment-tile/index.js +2 -2
  20. package/dist/components/avatar/avatar.d.ts +5 -5
  21. package/dist/components/avatar/avatar.js +64 -37
  22. package/dist/components/avatar-group/avatar-group.js +2 -2
  23. package/dist/components/badge/badge.js +1 -1
  24. package/dist/components/breadcrumbs/breadcrumbs.d.ts +22 -7
  25. package/dist/components/breadcrumbs/breadcrumbs.js +189 -170
  26. package/dist/components/button/button.d.ts +2 -3
  27. package/dist/components/button/button.js +58 -77
  28. package/dist/components/button/close-button.d.ts +4 -2
  29. package/dist/components/button/close-button.js +9 -9
  30. package/dist/components/checkbox-field/checkbox-field.d.ts +17 -3
  31. package/dist/components/checkbox-field/checkbox-field.js +108 -131
  32. package/dist/components/checkbox-field/checkbox.css +26 -34
  33. package/dist/components/checkbox-field/checkbox.d.ts +51 -8
  34. package/dist/components/checkbox-field/checkbox.js +221 -57
  35. package/dist/components/checkbox-field/checkbox.module.js +6 -8
  36. package/dist/components/checkbox-field/index.d.ts +0 -1
  37. package/dist/components/checkbox-field/index.js +1 -2
  38. package/dist/components/checkbox-field/tsf-checkbox-field.d.ts +2 -2
  39. package/dist/components/checkbox-group-field/checkbox-group-field.d.ts +4 -1
  40. package/dist/components/checkbox-group-field/checkbox-group-field.js +54 -50
  41. package/dist/components/checkbox-group-field/checkbox-group.d.ts +7 -2
  42. package/dist/components/checkbox-group-field/checkbox-group.js +8 -3
  43. package/dist/components/collapsible/collapsible.css +23 -18
  44. package/dist/components/collapsible/collapsible.d.ts +18 -3
  45. package/dist/components/collapsible/collapsible.js +85 -32
  46. package/dist/components/collapsible/collapsible.module.js +7 -7
  47. package/dist/components/combobox-field/combobox-field.d.ts +9 -1
  48. package/dist/components/combobox-field/combobox-field.js +195 -175
  49. package/dist/components/combobox-field/combobox-items.d.ts +2 -2
  50. package/dist/components/combobox-field/combobox-items.js +4 -4
  51. package/dist/components/combobox-field/combobox.css +99 -96
  52. package/dist/components/combobox-field/combobox.d.ts +94 -15
  53. package/dist/components/combobox-field/combobox.js +484 -159
  54. package/dist/components/combobox-field/combobox.module.js +21 -21
  55. package/dist/components/combobox-field/index.d.ts +0 -1
  56. package/dist/components/combobox-field/selection.d.ts +4 -1
  57. package/dist/components/combobox-field/value-state-view.css +7 -3
  58. package/dist/components/combobox-field/value-state-view.d.ts +4 -2
  59. package/dist/components/combobox-field/value-state-view.js +15 -15
  60. package/dist/components/combobox-field/value-state-view.module.js +6 -4
  61. package/dist/components/composer/composer-attachments.d.ts +11 -3
  62. package/dist/components/composer/composer-attachments.js +61 -47
  63. package/dist/components/composer/composer-editor.d.ts +2 -1
  64. package/dist/components/composer/composer-editor.js +79 -71
  65. package/dist/components/composer/composer-mentions.js +2 -2
  66. package/dist/components/composer/composer.d.ts +42 -21
  67. package/dist/components/composer/composer.js +201 -58
  68. package/dist/components/composer/mention-text.js +3 -3
  69. package/dist/components/confirm-dialog/confirm-dialog.d.ts +8 -7
  70. package/dist/components/confirm-dialog/confirm-dialog.js +10 -9
  71. package/dist/components/conversation/conversation.context.d.ts +0 -5
  72. package/dist/components/conversation/conversation.d.ts +63 -29
  73. package/dist/components/conversation/conversation.js +193 -82
  74. package/dist/components/conversation/index.d.ts +1 -1
  75. package/dist/components/date-field/date-field.d.ts +10 -4
  76. package/dist/components/date-field/date-field.js +57 -43
  77. package/dist/components/date-field/date-input.d.ts +20 -3
  78. package/dist/components/date-field/date-input.js +28 -13
  79. package/dist/components/date-field/index.d.ts +1 -1
  80. package/dist/components/date-field/tsf-date-field.d.ts +1 -1
  81. package/dist/components/date-field/tsf-date-field.js +1 -1
  82. package/dist/components/date-range-field/date-range-field.d.ts +8 -4
  83. package/dist/components/date-range-field/date-range-field.js +57 -45
  84. package/dist/components/date-range-field/date-range-input.d.ts +20 -3
  85. package/dist/components/date-range-field/date-range-input.js +27 -12
  86. package/dist/components/date-range-field/tsf-date-range-field.d.ts +1 -1
  87. package/dist/components/date-range-field/tsf-date-range-field.js +1 -1
  88. package/dist/components/detail-list/detail-list.d.ts +28 -27
  89. package/dist/components/detail-list/detail-list.js +177 -121
  90. package/dist/components/dialog/dialog.d.ts +47 -27
  91. package/dist/components/dialog/dialog.js +101 -38
  92. package/dist/components/divider/divider.js +1 -1
  93. package/dist/components/drawer/drawer.d.ts +48 -30
  94. package/dist/components/drawer/drawer.js +113 -41
  95. package/dist/components/email-field/email-field.d.ts +5 -3
  96. package/dist/components/email-field/email-field.js +1 -3
  97. package/dist/components/email-field/tsf-email-field.d.ts +3 -2
  98. package/dist/components/empty-message/empty-message.d.ts +3 -3
  99. package/dist/components/empty-message/empty-message.js +3 -3
  100. package/dist/components/error-boundary/error-boundary.d.ts +5 -2
  101. package/dist/components/error-boundary/error-boundary.js +2 -3
  102. package/dist/components/error-message/error-message.d.ts +1 -1
  103. package/dist/components/error-message/error-message.js +1 -1
  104. package/dist/components/error-text/error-text.js +3 -3
  105. package/dist/components/field/field.d.ts +5 -5
  106. package/dist/components/field/field.js +9 -9
  107. package/dist/components/field/index.js +2 -2
  108. package/dist/components/field/input-parts.js +1 -1
  109. package/dist/components/field-placeholder/field-placeholder.d.ts +4 -1
  110. package/dist/components/field-placeholder/field-placeholder.js +41 -26
  111. package/dist/components/fieldset/field-group.js +1 -1
  112. package/dist/components/fieldset/fieldset-root.js +1 -1
  113. package/dist/components/fieldset/fieldset.js +1 -1
  114. package/dist/components/file-field/file-field.css +19 -15
  115. package/dist/components/file-field/file-field.d.ts +10 -1
  116. package/dist/components/file-field/file-field.js +130 -109
  117. package/dist/components/file-field/file-field.module.js +6 -4
  118. package/dist/components/file-field/file-input.d.ts +32 -9
  119. package/dist/components/file-field/file-input.js +94 -74
  120. package/dist/components/filter-bar/filter-bar.d.ts +79 -51
  121. package/dist/components/filter-bar/filter-bar.js +552 -216
  122. package/dist/components/form/form.d.ts +4 -6
  123. package/dist/components/form/form.js +6 -8
  124. package/dist/components/icon/icon.d.ts +5 -10
  125. package/dist/components/icon/icon.js +4 -6
  126. package/dist/components/link/link.js +1 -1
  127. package/dist/components/link-button/link-button.d.ts +1 -2
  128. package/dist/components/link-button/link-button.js +12 -22
  129. package/dist/components/loading-message/loading-message.d.ts +2 -2
  130. package/dist/components/loading-message/loading-message.js +1 -1
  131. package/dist/components/locale-provider/locale-provider.js +1 -1
  132. package/dist/components/menu/menu.d.ts +40 -22
  133. package/dist/components/menu/menu.js +100 -40
  134. package/dist/components/nav/nav-context.d.ts +0 -1
  135. package/dist/components/nav/nav-context.js +1 -2
  136. package/dist/components/nav/nav-item-view.d.ts +7 -7
  137. package/dist/components/nav/nav-item-view.js +27 -51
  138. package/dist/components/nav/nav.css +72 -60
  139. package/dist/components/nav/nav.d.ts +15 -8
  140. package/dist/components/nav/nav.js +105 -52
  141. package/dist/components/nav/nav.module.js +14 -14
  142. package/dist/components/number-field/number-field.d.ts +7 -1
  143. package/dist/components/number-field/number-field.js +98 -82
  144. package/dist/components/number-field/number-input.d.ts +53 -4
  145. package/dist/components/number-field/number-input.js +68 -21
  146. package/dist/components/number-field/tsf-number-field.d.ts +1 -1
  147. package/dist/components/number-field/tsf-number-field.js +1 -1
  148. package/dist/components/otp-field/otp-input.d.ts +25 -0
  149. package/dist/components/otp-field/otp-input.js +26 -1
  150. package/dist/components/pagination/pagination.d.ts +82 -23
  151. package/dist/components/pagination/pagination.js +656 -229
  152. package/dist/components/password-field/password-field.d.ts +7 -1
  153. package/dist/components/password-field/password-field.js +117 -126
  154. package/dist/components/password-field/password-strength.js +1 -1
  155. package/dist/components/password-field/tsf-password-field.d.ts +1 -1
  156. package/dist/components/password-field/tsf-password-field.js +1 -1
  157. package/dist/components/photo-field/photo-field.d.ts +17 -3
  158. package/dist/components/photo-field/photo-field.js +168 -89
  159. package/dist/components/photo-field/photo-input-context.d.ts +25 -0
  160. package/dist/components/photo-field/photo-input-context.js +14 -0
  161. package/dist/components/photo-field/photo-input.d.ts +58 -23
  162. package/dist/components/photo-field/photo-input.js +459 -261
  163. package/dist/components/popover/popover.d.ts +55 -23
  164. package/dist/components/popover/popover.js +205 -61
  165. package/dist/components/radio-group-field/radio-group.js +1 -1
  166. package/dist/components/search-field/search-field.d.ts +7 -5
  167. package/dist/components/search-field/search-field.js +4 -6
  168. package/dist/components/search-field/tsf-search-field.d.ts +1 -1
  169. package/dist/components/search-field/tsf-search-field.js +1 -1
  170. package/dist/components/segmented-control-field/segmented-control.js +1 -1
  171. package/dist/components/select-field/select-field.d.ts +7 -1
  172. package/dist/components/select-field/select-field.js +151 -139
  173. package/dist/components/select-field/select.d.ts +28 -6
  174. package/dist/components/select-field/select.js +234 -149
  175. package/dist/components/skeleton/skeleton.js +1 -1
  176. package/dist/components/spinner/spinner.css +47 -1
  177. package/dist/components/spinner/spinner.js +28 -11
  178. package/dist/components/spinner/spinner.module.js +18 -3
  179. package/dist/components/stale/stale.d.ts +17 -21
  180. package/dist/components/stale/stale.js +307 -129
  181. package/dist/components/status-message/status-message.css +22 -21
  182. package/dist/components/status-message/status-message.d.ts +10 -5
  183. package/dist/components/status-message/status-message.js +20 -24
  184. package/dist/components/status-message/status-message.module.js +6 -6
  185. package/dist/components/status-message/status-preset.d.ts +4 -5
  186. package/dist/components/status-message/status-preset.js +3 -3
  187. package/dist/components/switch-field/switch.js +1 -1
  188. package/dist/components/tabs/tabs.d.ts +51 -28
  189. package/dist/components/tabs/tabs.js +219 -144
  190. package/dist/components/tag/tag.css +23 -21
  191. package/dist/components/tag/tag.d.ts +17 -15
  192. package/dist/components/tag/tag.js +140 -65
  193. package/dist/components/tag/tag.module.js +3 -3
  194. package/dist/components/tag-group/tag-group.css +30 -27
  195. package/dist/components/tag-group/tag-group.d.ts +10 -4
  196. package/dist/components/tag-group/tag-group.js +47 -35
  197. package/dist/components/tag-group/tag-group.module.js +4 -4
  198. package/dist/components/text-field/text-field.d.ts +14 -3
  199. package/dist/components/text-field/text-field.js +154 -133
  200. package/dist/components/text-field/text-input.d.ts +89 -3
  201. package/dist/components/text-field/text-input.js +184 -70
  202. package/dist/components/textarea-field/textarea.js +1 -1
  203. package/dist/components/time-field/time-input.d.ts +6 -0
  204. package/dist/components/time-field/time-input.js +6 -0
  205. package/dist/components/time-zone-provider/time-zone-provider.js +1 -1
  206. package/dist/components/toast/index.js +2 -2
  207. package/dist/components/toast/toast-provider.css +38 -34
  208. package/dist/components/toast/toast-provider.d.ts +65 -3
  209. package/dist/components/toast/toast-provider.js +313 -148
  210. package/dist/components/toast/toast-provider.module.js +11 -17
  211. package/dist/components/toast/toast.d.ts +5 -1
  212. package/dist/components/toast/toast.js +2 -1
  213. package/dist/components/toggle-group-field/toggle-group.js +1 -1
  214. package/dist/components/tooltip/tooltip.d.ts +6 -6
  215. package/dist/components/tooltip/tooltip.js +7 -7
  216. package/dist/data-table/data-table-content.d.ts +18 -10
  217. package/dist/data-table/data-table-content.js +145 -290
  218. package/dist/data-table/data-table-context.d.ts +4 -2
  219. package/dist/data-table/data-table-context.js +1 -1
  220. package/dist/data-table/data-table-parts.d.ts +99 -0
  221. package/dist/data-table/data-table-parts.js +1182 -0
  222. package/dist/data-table/data-table-selection.d.ts +7 -3
  223. package/dist/data-table/data-table-selection.js +62 -37
  224. package/dist/data-table/data-table.css +100 -95
  225. package/dist/data-table/data-table.d.ts +49 -25
  226. package/dist/data-table/data-table.js +95 -83
  227. package/dist/data-table/data-table.module.js +34 -34
  228. package/dist/data-table/index.d.ts +2 -1
  229. package/dist/data-table/index.js +2 -1
  230. package/dist/data-view/use-data-view.d.ts +2 -2
  231. package/dist/data-view/use-data-view.js +2 -2
  232. package/dist/index.js +7 -8
  233. package/dist/lib/calendar/calendar-navigation.d.ts +9 -2
  234. package/dist/lib/calendar/calendar-navigation.js +72 -73
  235. package/dist/lib/calendar/calendar-year.d.ts +4 -3
  236. package/dist/lib/calendar/calendar-year.js +137 -156
  237. package/dist/lib/calendar/temporal.d.ts +18 -12
  238. package/dist/lib/calendar/temporal.js +191 -147
  239. package/dist/lib/table-storage.d.ts +2 -2
  240. package/dist/lib/table-storage.js +2 -2
  241. package/dist/lib/unsaved-changes/leave-guard.js +1 -1
  242. package/dist/terrazzo/index.d.ts +20 -3
  243. package/dist/terrazzo/index.js +110 -7
  244. package/dist/tokens.css +94 -71
  245. package/package.json +4 -3
  246. package/tokens/ref.tokens.json +0 -30
  247. package/tokens/sys.tokens.json +0 -7
  248. package/dist/assets/spinner.js +0 -28
  249. package/dist/components/checkbox-field/checkbox-glyph.d.ts +0 -12
  250. package/dist/components/checkbox-field/checkbox-glyph.js +0 -38
  251. package/dist/components/combobox-field/combobox-popup-body.d.ts +0 -34
  252. package/dist/components/combobox-field/combobox-popup-body.js +0 -142
  253. package/dist/components/conversation/conversation.context.js +0 -4
  254. package/dist/vendor/@material-design-icons/svg/outlined/add.js +0 -12
  255. package/dist/vendor/@material-design-icons/svg/outlined/arrow_downward.js +0 -12
  256. package/dist/vendor/@material-design-icons/svg/outlined/arrow_forward.js +0 -12
  257. package/dist/vendor/@material-design-icons/svg/outlined/arrow_upward.js +0 -12
  258. package/dist/vendor/@material-design-icons/svg/outlined/attach_file.js +0 -12
  259. package/dist/vendor/@material-design-icons/svg/outlined/block.js +0 -12
  260. package/dist/vendor/@material-design-icons/svg/outlined/calendar_today.js +0 -12
  261. package/dist/vendor/@material-design-icons/svg/outlined/check.js +0 -12
  262. package/dist/vendor/@material-design-icons/svg/outlined/check_circle.js +0 -12
  263. package/dist/vendor/@material-design-icons/svg/outlined/chevron_left.js +0 -12
  264. package/dist/vendor/@material-design-icons/svg/outlined/chevron_right.js +0 -12
  265. package/dist/vendor/@material-design-icons/svg/outlined/close.js +0 -12
  266. package/dist/vendor/@material-design-icons/svg/outlined/content_copy.js +0 -12
  267. package/dist/vendor/@material-design-icons/svg/outlined/date_range.js +0 -12
  268. package/dist/vendor/@material-design-icons/svg/outlined/description.js +0 -12
  269. package/dist/vendor/@material-design-icons/svg/outlined/download.js +0 -12
  270. package/dist/vendor/@material-design-icons/svg/outlined/error.js +0 -12
  271. package/dist/vendor/@material-design-icons/svg/outlined/error_outline.js +0 -12
  272. package/dist/vendor/@material-design-icons/svg/outlined/expand_less.js +0 -12
  273. package/dist/vendor/@material-design-icons/svg/outlined/expand_more.js +0 -12
  274. package/dist/vendor/@material-design-icons/svg/outlined/filter_alt.js +0 -12
  275. package/dist/vendor/@material-design-icons/svg/outlined/filter_alt_off.js +0 -12
  276. package/dist/vendor/@material-design-icons/svg/outlined/first_page.js +0 -12
  277. package/dist/vendor/@material-design-icons/svg/outlined/info.js +0 -12
  278. package/dist/vendor/@material-design-icons/svg/outlined/keyboard_arrow_down.js +0 -12
  279. package/dist/vendor/@material-design-icons/svg/outlined/last_page.js +0 -12
  280. package/dist/vendor/@material-design-icons/svg/outlined/mail.js +0 -12
  281. package/dist/vendor/@material-design-icons/svg/outlined/more_horiz.js +0 -12
  282. package/dist/vendor/@material-design-icons/svg/outlined/photo_camera.js +0 -12
  283. package/dist/vendor/@material-design-icons/svg/outlined/remove.js +0 -12
  284. package/dist/vendor/@material-design-icons/svg/outlined/restart_alt.js +0 -12
  285. package/dist/vendor/@material-design-icons/svg/outlined/restore.js +0 -12
  286. package/dist/vendor/@material-design-icons/svg/outlined/search.js +0 -12
  287. package/dist/vendor/@material-design-icons/svg/outlined/unfold_more.js +0 -12
  288. package/dist/vendor/@material-design-icons/svg/outlined/upload_file.js +0 -12
  289. package/dist/vendor/@material-design-icons/svg/outlined/visibility.js +0 -12
  290. package/dist/vendor/@material-design-icons/svg/outlined/visibility_off.js +0 -12
  291. package/dist/vendor/@material-design-icons/svg/outlined/warning_amber.js +0 -12
@@ -1,34 +1,34 @@
1
1
  @layer kit.reset, kit.base, kit.components;
2
2
  @layer kit.components {
3
- ._root_1px3l_3 {
3
+ ._root_oql8l_3 {
4
4
  display: inline-flex;
5
5
  flex-direction: column;
6
6
  align-items: flex-start;
7
7
  gap: var(--checkbox-gap, var(--sys-unit-8));
8
8
  }
9
- ._label_1px3l_9 {
9
+ ._label_oql8l_9 {
10
10
  cursor: pointer;
11
11
  }
12
- ._label_1px3l_9:hover ._control_1px3l_12 {
12
+ ._label_oql8l_9:hover ._control_oql8l_12 {
13
13
  border-color: var(--sys-color-primary);
14
14
  }
15
- :where([data-readonly], [data-disabled]) ._label_1px3l_9 {
15
+ :where([data-readonly], [data-disabled]) ._label_oql8l_9 {
16
16
  cursor: default;
17
17
  }
18
- :where([data-readonly], [data-disabled]) ._label_1px3l_9:hover ._control_1px3l_12:not([data-checked]) {
18
+ :where([data-readonly], [data-disabled]) ._label_oql8l_9:hover ._control_oql8l_12:not([data-checked]) {
19
19
  border-color: var(--box-border, var(--sys-color-border));
20
20
  }
21
- ._label_1px3l_9 {
21
+ ._label_oql8l_9 {
22
22
  display: inline-grid;
23
23
  grid-template-columns: auto 1fr;
24
24
  grid-template-areas: "control text";
25
25
  align-items: center;
26
26
  gap: var(--sys-unit-1) var(--sys-unit-6);
27
27
  }
28
- ._label_1px3l_9:has(> [data-optional-suffix]) {
28
+ ._label_oql8l_9:has(> [data-optional-suffix]) {
29
29
  grid-template-areas: "control text" "control optional";
30
30
  }
31
- ._control_1px3l_12 {
31
+ ._control_oql8l_12 {
32
32
  --box-border: var(--sys-color-border);
33
33
  --box-bg: var(--sys-color-surface);
34
34
  --box-fg: var(--sys-color-on-primary);
@@ -45,84 +45,76 @@
45
45
  color: var(--box-fg);
46
46
  }
47
47
  @media not (prefers-reduced-motion) {
48
- ._control_1px3l_12 {
48
+ ._control_oql8l_12 {
49
49
  transition: background var(--sys-motion-instant) var(--sys-motion-standard), border-color var(--sys-motion-instant) var(--sys-motion-standard);
50
50
  }
51
51
  }
52
- ._control_1px3l_12:focus-visible {
52
+ ._control_oql8l_12:focus-visible {
53
53
  border-color: var(--sys-color-primary);
54
54
  }
55
- ._control_1px3l_12 {
55
+ ._control_oql8l_12 {
56
56
  outline: 0 solid var(--sys-color-focus-ring);
57
57
  outline-offset: var(--sys-focus-ring-offset);
58
58
  }
59
- ._control_1px3l_12[data-focus-visible] {
59
+ ._control_oql8l_12[data-focus-visible] {
60
60
  outline-width: var(--sys-focus-ring-width);
61
61
  }
62
- ._control_1px3l_12 {
62
+ ._control_oql8l_12 {
63
63
  position: relative;
64
64
  grid-area: control;
65
65
  align-self: center;
66
66
  justify-self: center;
67
67
  }
68
- ._control_1px3l_12[data-invalid], ._control_1px3l_12[aria-invalid=true] {
68
+ ._control_oql8l_12[data-invalid], ._control_oql8l_12[aria-invalid=true] {
69
69
  --box-border: var(--sys-color-error-fg);
70
70
  --box-bg: var(--sys-color-error-bg);
71
71
  --box-checked-bg: var(--sys-color-error-fg);
72
72
  --box-fg: var(--sys-color-error-bg);
73
73
  }
74
- ._control_1px3l_12[data-readonly] {
74
+ ._control_oql8l_12[data-readonly] {
75
75
  --box-border: var(--sys-color-outline);
76
76
  --box-bg: var(--sys-color-surface-high);
77
77
  --box-checked-bg: var(--sys-color-primary-container);
78
78
  --box-fg: var(--sys-color-on-primary-container);
79
79
  border-style: dashed;
80
80
  }
81
- ._control_1px3l_12[data-checked], ._control_1px3l_12[data-indeterminate] {
81
+ ._control_oql8l_12[data-checked], ._control_oql8l_12[data-indeterminate] {
82
82
  --box-border: var(--box-checked-bg);
83
83
  --box-bg: var(--box-checked-bg);
84
84
  }
85
- ._control_1px3l_12[data-disabled], ._control_1px3l_12:has(~ :disabled) {
85
+ ._control_oql8l_12[data-disabled], ._control_oql8l_12:has(~ :disabled) {
86
86
  --box-bg: var(--sys-color-disabled-bg);
87
87
  --box-checked-bg: var(--sys-color-disabled-bg);
88
88
  --box-fg: var(--sys-color-disabled-fg);
89
89
  cursor: not-allowed;
90
90
  }
91
- ._indicator_1px3l_91 {
91
+ ._indicator_oql8l_91 {
92
92
  display: grid;
93
93
  place-items: center;
94
94
  }
95
- ._indicator_1px3l_91 svg {
95
+ ._indicator_oql8l_91 svg {
96
96
  inline-size: calc(var(--checkbox-size, var(--sys-unit-16)) * 0.7);
97
97
  block-size: calc(var(--checkbox-size, var(--sys-unit-16)) * 0.7);
98
98
  }
99
- ._indicator_1px3l_91 {
99
+ ._indicator_oql8l_91 {
100
100
  opacity: 0;
101
101
  scale: 0;
102
102
  }
103
103
  @media not (prefers-reduced-motion) {
104
- ._indicator_1px3l_91 {
104
+ ._indicator_oql8l_91 {
105
105
  transition: opacity var(--sys-motion-instant) var(--sys-motion-standard), scale var(--sys-motion-instant) var(--sys-motion-standard);
106
106
  }
107
107
  }
108
- ._indicator_1px3l_91[data-checked], ._indicator_1px3l_91[data-indeterminate] {
108
+ ._indicator_oql8l_91 {
109
+ font-size: calc(var(--checkbox-size, var(--sys-unit-16)) * 0.7);
110
+ }
111
+ ._indicator_oql8l_91[data-checked], ._indicator_oql8l_91[data-indeterminate] {
109
112
  opacity: 1;
110
113
  scale: 1;
111
114
  }
112
115
  @media not (prefers-reduced-motion) {
113
- ._indicator_1px3l_91[data-checked], ._indicator_1px3l_91[data-indeterminate] {
116
+ ._indicator_oql8l_91[data-checked], ._indicator_oql8l_91[data-indeterminate] {
114
117
  transition: opacity var(--sys-motion-instant) var(--sys-motion-standard), scale var(--sys-motion-short) var(--sys-motion-overshoot);
115
118
  }
116
119
  }
117
- ._glyph_1px3l_117 path {
118
- d: path("M9.9997 15.1709L19.1921 5.97852L20.6063 7.39273L9.9997 17.9993L3.63574 11.6354L5.04996 10.2212L9.9997 15.1709Z");
119
- }
120
- @media not (prefers-reduced-motion) {
121
- ._glyph_1px3l_117 path {
122
- transition: d var(--sys-motion-short) var(--sys-motion-emphasized);
123
- }
124
- }
125
- ._indicator_1px3l_91[data-indeterminate] ._glyph_1px3l_117 path {
126
- d: path("M12 11L20 11L20 13L12 13L4 13L4 11L12 11Z");
127
- }
128
120
  }
@@ -1,14 +1,57 @@
1
1
  import { Checkbox as BaseCheckbox } from "@base-ui/react/checkbox";
2
+ import { Field as BaseField } from "@base-ui/react/field";
2
3
  import type { ReactNode } from "react";
3
- export type CheckboxProps = BaseCheckbox.Root.Props;
4
+ import { Field, type FieldProps, type FieldRootProps } from "../field/index.ts";
5
+ export type CheckboxRootProps = FieldRootProps & Pick<FieldProps, "errors" | "requiredness" | "dirty" | "touched" | "pending"> & Readonly<{
6
+ /** The box is checked. */
7
+ filled?: boolean;
8
+ readOnly?: boolean;
9
+ }>;
10
+ /** The field around one checkbox, which projects its state as `data-*` attributes. */
11
+ declare const CheckboxRoot: ({ errors, requiredness, dirty, touched, pending, filled, readOnly, disabled, className, ...props }: CheckboxRootProps) => ReactNode;
12
+ /** The label beside the box, which wraps the control and its text so the two share one hit area. */
13
+ declare const CheckboxLabel: ({ className, ...props }: BaseField.Label.Props) => ReactNode;
14
+ export type CheckboxControlProps = Omit<BaseCheckbox.Root.Props, "checked" | "defaultChecked" | "onCheckedChange" | "indeterminate" | "disabled"> & Readonly<{
15
+ /** Whether the box is checked, when controlled. */
16
+ checked?: boolean;
17
+ /** Whether the box starts checked, when uncontrolled. */
18
+ defaultChecked?: boolean;
19
+ /** Called with the new checked state when the box is toggled. */
20
+ onCheckedChange?: BaseCheckbox.Root.Props["onCheckedChange"];
21
+ /** The box shows neither checked nor unchecked, for a parent over a mixed set. */
22
+ indeterminate?: boolean;
23
+ /** Whether the box ignores input. A busy form disables it too. @default false */
24
+ disabled?: boolean;
25
+ }>;
26
+ /** The box itself, which takes a `Checkbox.Indicator` as its child. */
27
+ declare const CheckboxControl: ({ className, disabled, ...props }: CheckboxControlProps) => ReactNode;
28
+ export type CheckboxIndicatorProps = BaseCheckbox.Indicator.Props;
29
+ /** The mark inside the box, which pops in while it is checked or indeterminate. Its children are the mark. */
30
+ declare const CheckboxIndicator: ({ className, keepMounted, ...props }: CheckboxIndicatorProps) => ReactNode;
31
+ /** The parts of a checkbox. */
32
+ export type CheckboxParts = Readonly<{
33
+ Root: typeof CheckboxRoot;
34
+ Label: typeof CheckboxLabel;
35
+ Control: typeof CheckboxControl;
36
+ Indicator: typeof CheckboxIndicator;
37
+ Description: typeof Field.Description;
38
+ Error: typeof Field.Error;
39
+ }>;
4
40
  /**
5
- * The checkbox control over base-ui's, drawing a tick, or a dash when
6
- * `indeterminate`. Name it with a wrapping label, or use `CheckboxField`.
41
+ * The styled parts of a base-ui Checkbox: a box that fills when checked, with
42
+ * the mark the app passes to `Indicator`. `Label` wraps the control and its
43
+ * text, so the two share one hit area. For the ordinary case, use
44
+ * `CheckboxField`.
7
45
  *
8
46
  * @example
9
- * <label>
10
- * <Checkbox checked={agreed} onCheckedChange={setAgreed} />
11
- * I agree to the terms
12
- * </label>
47
+ * <Checkbox.Root filled={agreed}>
48
+ * <Checkbox.Label>
49
+ * <Checkbox.Control checked={agreed} onCheckedChange={setAgreed}>
50
+ * <Checkbox.Indicator><CheckIcon /></Checkbox.Indicator>
51
+ * </Checkbox.Control>
52
+ * I agree to the terms
53
+ * </Checkbox.Label>
54
+ * </Checkbox.Root>
13
55
  */
14
- export declare const Checkbox: ({ className, indeterminate, disabled, ...props }: CheckboxProps) => ReactNode;
56
+ export declare const Checkbox: CheckboxParts;
57
+ export {};
@@ -1,91 +1,255 @@
1
+ import { Field as Field$1 } from "../field/field.js";
1
2
  import { fieldStateAttributes } from "../field/field-state.js";
2
3
  import { useFieldFocus } from "../field/use-field-focus.js";
4
+ import { useFieldState } from "../field/use-field-state.js";
3
5
  import { useFormDisabled } from "../form/form-context.js";
4
- import { CheckboxGlyph } from "./checkbox-glyph.js";
5
6
  import checkbox_module_default from "./checkbox.module.js";
6
7
  import { c } from "react/compiler-runtime";
7
- import { jsx } from "react/jsx-runtime";
8
8
  import { clsx } from "clsx";
9
+ import { jsx } from "react/jsx-runtime";
9
10
  import { Checkbox } from "@base-ui/react/checkbox";
11
+ import { Field } from "@base-ui/react/field";
10
12
  // src/components/checkbox-field/checkbox.tsx
11
- /**
12
- * The checkbox control over base-ui's, drawing a tick, or a dash when
13
- * `indeterminate`. Name it with a wrapping label, or use `CheckboxField`.
14
- *
15
- * @example
16
- * <label>
17
- * <Checkbox checked={agreed} onCheckedChange={setAgreed} />
18
- * I agree to the terms
19
- * </label>
20
- */
21
- var Checkbox$1 = (t0) => {
22
- const $ = c(19);
13
+ /** The field around one checkbox, which projects its state as `data-*` attributes. */
14
+ var CheckboxRoot = (t0) => {
15
+ const $ = c(32);
23
16
  let className;
24
- let indeterminate;
17
+ let dirty;
18
+ let disabled;
19
+ let errors;
20
+ let filled;
21
+ let pending;
25
22
  let props;
23
+ let readOnly;
24
+ let requiredness;
25
+ let touched;
26
+ if ($[0] !== t0) {
27
+ ({errors, requiredness, dirty, touched, pending, filled, readOnly, disabled, className, ...props} = t0);
28
+ $[0] = t0;
29
+ $[1] = className;
30
+ $[2] = dirty;
31
+ $[3] = disabled;
32
+ $[4] = errors;
33
+ $[5] = filled;
34
+ $[6] = pending;
35
+ $[7] = props;
36
+ $[8] = readOnly;
37
+ $[9] = requiredness;
38
+ $[10] = touched;
39
+ } else {
40
+ className = $[1];
41
+ dirty = $[2];
42
+ disabled = $[3];
43
+ errors = $[4];
44
+ filled = $[5];
45
+ pending = $[6];
46
+ props = $[7];
47
+ readOnly = $[8];
48
+ requiredness = $[9];
49
+ touched = $[10];
50
+ }
26
51
  let t1;
52
+ if ($[11] !== dirty || $[12] !== disabled || $[13] !== errors || $[14] !== filled || $[15] !== pending || $[16] !== readOnly || $[17] !== requiredness || $[18] !== touched) {
53
+ t1 = {
54
+ errors,
55
+ requiredness,
56
+ dirty,
57
+ touched,
58
+ pending,
59
+ disabled,
60
+ readOnly,
61
+ filled
62
+ };
63
+ $[11] = dirty;
64
+ $[12] = disabled;
65
+ $[13] = errors;
66
+ $[14] = filled;
67
+ $[15] = pending;
68
+ $[16] = readOnly;
69
+ $[17] = requiredness;
70
+ $[18] = touched;
71
+ $[19] = t1;
72
+ } else t1 = $[19];
73
+ const field = useFieldState(t1);
74
+ let t2;
75
+ if ($[20] !== className) {
76
+ t2 = clsx(checkbox_module_default.root, className);
77
+ $[20] = className;
78
+ $[21] = t2;
79
+ } else t2 = $[21];
80
+ const t3 = field.disabled;
81
+ const t4 = field.invalid;
82
+ let t5;
83
+ if ($[22] !== field.state) {
84
+ t5 = fieldStateAttributes(field.state);
85
+ $[22] = field.state;
86
+ $[23] = t5;
87
+ } else t5 = $[23];
88
+ let t6;
89
+ if ($[24] !== dirty || $[25] !== field.disabled || $[26] !== field.invalid || $[27] !== props || $[28] !== t2 || $[29] !== t5 || $[30] !== touched) {
90
+ t6 = /* @__PURE__ */ jsx(Field$1.Root, {
91
+ className: t2,
92
+ disabled: t3,
93
+ invalid: t4,
94
+ dirty,
95
+ touched,
96
+ ...t5,
97
+ ...props
98
+ });
99
+ $[24] = dirty;
100
+ $[25] = field.disabled;
101
+ $[26] = field.invalid;
102
+ $[27] = props;
103
+ $[28] = t2;
104
+ $[29] = t5;
105
+ $[30] = touched;
106
+ $[31] = t6;
107
+ } else t6 = $[31];
108
+ return t6;
109
+ };
110
+ /** The label beside the box, which wraps the control and its text so the two share one hit area. */
111
+ var CheckboxLabel = (t0) => {
112
+ const $ = c(8);
113
+ let className;
114
+ let props;
27
115
  if ($[0] !== t0) {
28
- ({className, indeterminate, disabled: t1, ...props} = t0);
116
+ ({className, ...props} = t0);
29
117
  $[0] = t0;
30
118
  $[1] = className;
31
- $[2] = indeterminate;
32
- $[3] = props;
119
+ $[2] = props;
120
+ } else {
121
+ className = $[1];
122
+ props = $[2];
123
+ }
124
+ let t1;
125
+ if ($[3] !== className) {
126
+ t1 = clsx(checkbox_module_default.label, className);
127
+ $[3] = className;
33
128
  $[4] = t1;
129
+ } else t1 = $[4];
130
+ let t2;
131
+ if ($[5] !== props || $[6] !== t1) {
132
+ t2 = /* @__PURE__ */ jsx(Field.Label, {
133
+ className: t1,
134
+ ...props
135
+ });
136
+ $[5] = props;
137
+ $[6] = t1;
138
+ $[7] = t2;
139
+ } else t2 = $[7];
140
+ return t2;
141
+ };
142
+ /** The box itself, which takes a `Checkbox.Indicator` as its child. */
143
+ var CheckboxControl = (t0) => {
144
+ const $ = c(14);
145
+ let className;
146
+ let props;
147
+ let t1;
148
+ if ($[0] !== t0) {
149
+ ({className, disabled: t1, ...props} = t0);
150
+ $[0] = t0;
151
+ $[1] = className;
152
+ $[2] = props;
153
+ $[3] = t1;
34
154
  } else {
35
155
  className = $[1];
36
- indeterminate = $[2];
37
- props = $[3];
38
- t1 = $[4];
156
+ props = $[2];
157
+ t1 = $[3];
39
158
  }
40
159
  const disabled = t1 === void 0 ? false : t1;
41
160
  const focus = useFieldFocus(props);
42
161
  const formDisabled = useFormDisabled();
43
162
  let t2;
44
- if ($[5] !== className) {
163
+ if ($[4] !== className) {
45
164
  t2 = clsx(checkbox_module_default.control, className);
46
- $[5] = className;
47
- $[6] = t2;
48
- } else t2 = $[6];
165
+ $[4] = className;
166
+ $[5] = t2;
167
+ } else t2 = $[5];
49
168
  const t3 = disabled || formDisabled;
50
169
  let t4;
51
- if ($[7] !== focus) {
170
+ if ($[6] !== focus) {
52
171
  t4 = fieldStateAttributes(focus);
53
- $[7] = focus;
54
- $[8] = t4;
55
- } else t4 = $[8];
172
+ $[6] = focus;
173
+ $[7] = t4;
174
+ } else t4 = $[7];
56
175
  let t5;
57
- if ($[9] !== indeterminate) {
58
- t5 = /* @__PURE__ */ jsx(Checkbox.Indicator, {
59
- keepMounted: true,
60
- className: checkbox_module_default.indicator,
61
- children: /* @__PURE__ */ jsx(CheckboxGlyph, {
62
- indeterminate,
63
- className: checkbox_module_default.glyph
64
- })
65
- });
66
- $[9] = indeterminate;
67
- $[10] = t5;
68
- } else t5 = $[10];
69
- let t6;
70
- if ($[11] !== focus.props || $[12] !== indeterminate || $[13] !== props || $[14] !== t2 || $[15] !== t3 || $[16] !== t4 || $[17] !== t5) {
71
- t6 = /* @__PURE__ */ jsx(Checkbox.Root, {
176
+ if ($[8] !== focus.props || $[9] !== props || $[10] !== t2 || $[11] !== t3 || $[12] !== t4) {
177
+ t5 = /* @__PURE__ */ jsx(Checkbox.Root, {
72
178
  className: t2,
73
- indeterminate,
74
179
  disabled: t3,
75
180
  ...t4,
76
181
  ...props,
77
- ...focus.props,
78
- children: t5
182
+ ...focus.props
79
183
  });
80
- $[11] = focus.props;
81
- $[12] = indeterminate;
82
- $[13] = props;
83
- $[14] = t2;
84
- $[15] = t3;
85
- $[16] = t4;
86
- $[17] = t5;
87
- $[18] = t6;
88
- } else t6 = $[18];
89
- return t6;
184
+ $[8] = focus.props;
185
+ $[9] = props;
186
+ $[10] = t2;
187
+ $[11] = t3;
188
+ $[12] = t4;
189
+ $[13] = t5;
190
+ } else t5 = $[13];
191
+ return t5;
192
+ };
193
+ /** The mark inside the box, which pops in while it is checked or indeterminate. Its children are the mark. */
194
+ var CheckboxIndicator = (t0) => {
195
+ const $ = c(10);
196
+ let className;
197
+ let props;
198
+ let t1;
199
+ if ($[0] !== t0) {
200
+ ({className, keepMounted: t1, ...props} = t0);
201
+ $[0] = t0;
202
+ $[1] = className;
203
+ $[2] = props;
204
+ $[3] = t1;
205
+ } else {
206
+ className = $[1];
207
+ props = $[2];
208
+ t1 = $[3];
209
+ }
210
+ const keepMounted = t1 === void 0 ? true : t1;
211
+ let t2;
212
+ if ($[4] !== className) {
213
+ t2 = clsx(checkbox_module_default.indicator, className);
214
+ $[4] = className;
215
+ $[5] = t2;
216
+ } else t2 = $[5];
217
+ let t3;
218
+ if ($[6] !== keepMounted || $[7] !== props || $[8] !== t2) {
219
+ t3 = /* @__PURE__ */ jsx(Checkbox.Indicator, {
220
+ keepMounted,
221
+ className: t2,
222
+ ...props
223
+ });
224
+ $[6] = keepMounted;
225
+ $[7] = props;
226
+ $[8] = t2;
227
+ $[9] = t3;
228
+ } else t3 = $[9];
229
+ return t3;
230
+ };
231
+ /**
232
+ * The styled parts of a base-ui Checkbox: a box that fills when checked, with
233
+ * the mark the app passes to `Indicator`. `Label` wraps the control and its
234
+ * text, so the two share one hit area. For the ordinary case, use
235
+ * `CheckboxField`.
236
+ *
237
+ * @example
238
+ * <Checkbox.Root filled={agreed}>
239
+ * <Checkbox.Label>
240
+ * <Checkbox.Control checked={agreed} onCheckedChange={setAgreed}>
241
+ * <Checkbox.Indicator><CheckIcon /></Checkbox.Indicator>
242
+ * </Checkbox.Control>
243
+ * I agree to the terms
244
+ * </Checkbox.Label>
245
+ * </Checkbox.Root>
246
+ */
247
+ var Checkbox$1 = {
248
+ Root: CheckboxRoot,
249
+ Label: CheckboxLabel,
250
+ Control: CheckboxControl,
251
+ Indicator: CheckboxIndicator,
252
+ Description: Field$1.Description,
253
+ Error: Field$1.Error
90
254
  };
91
255
  export { Checkbox$1 as Checkbox };
@@ -1,14 +1,12 @@
1
1
  import './checkbox.css';// src/components/checkbox-field/checkbox.module.scss
2
- var root = "_root_1px3l_3";
3
- var label = "_label_1px3l_9";
4
- var control = "_control_1px3l_12";
5
- var indicator = "_indicator_1px3l_91";
6
- var glyph = "_glyph_1px3l_117";
2
+ var root = "_root_oql8l_3";
3
+ var label = "_label_oql8l_9";
4
+ var control = "_control_oql8l_12";
5
+ var indicator = "_indicator_oql8l_91";
7
6
  var checkbox_module_default = {
8
7
  root,
9
8
  label,
10
9
  control,
11
- indicator,
12
- glyph
10
+ indicator
13
11
  };
14
- export { control, checkbox_module_default as default, glyph, indicator, label, root };
12
+ export { control, checkbox_module_default as default, indicator, label, root };
@@ -1,4 +1,3 @@
1
1
  export * from "./checkbox.tsx";
2
2
  export * from "./checkbox-field.tsx";
3
- export * from "./checkbox-glyph.tsx";
4
3
  export * from "./tsf-checkbox-field.tsx";
@@ -1,5 +1,4 @@
1
1
  import { Checkbox } from "./checkbox.js";
2
2
  import { CheckboxField } from "./checkbox-field.js";
3
- import { CheckboxGlyph } from "./checkbox-glyph.js";
4
3
  import { TSFCheckboxField } from "./tsf-checkbox-field.js";
5
- export { Checkbox, CheckboxField, CheckboxGlyph, TSFCheckboxField };
4
+ export { Checkbox, CheckboxField, TSFCheckboxField };
@@ -1,7 +1,7 @@
1
1
  import type { ReactNode } from "react";
2
2
  import { type ConnectedFieldProps } from "../../lib/forms/use-connected-field.ts";
3
- import { type CheckboxFieldProps } from "./checkbox-field.tsx";
4
- export type TSFCheckboxFieldProps = Omit<CheckboxFieldProps, keyof ConnectedFieldProps | "checked" | "defaultChecked" | "onCheckedChange">;
3
+ import { type CheckboxFieldBaseProps, type CheckboxFieldIndeterminateProps } from "./checkbox-field.tsx";
4
+ export type TSFCheckboxFieldProps = Omit<CheckboxFieldBaseProps, keyof ConnectedFieldProps | "checked" | "defaultChecked" | "onCheckedChange"> & CheckboxFieldIndeterminateProps;
5
5
  /**
6
6
  * `CheckboxField` bound to the TanStack Form field it renders in, whose value
7
7
  * is a boolean. Reach it as `field.CheckboxField` inside `form.AppField`.
@@ -9,6 +9,8 @@ export type CheckboxGroupItem = Readonly<{
9
9
  export type CheckboxGroupFieldProps = FieldProps & Pick<BaseCheckboxGroup.Props, "value" | "defaultValue" | "onValueChange" | "disabled"> & Readonly<{
10
10
  /** The boxes, in the order they read. */
11
11
  items: readonly CheckboxGroupItem[];
12
+ /** The mark a ticked box shows, such as a tick. */
13
+ checkIcon: ReactNode;
12
14
  readOnly?: boolean;
13
15
  /** Prefixes each box's id, so ids stay stable across renders. */
14
16
  name?: string;
@@ -26,8 +28,9 @@ export type CheckboxGroupFieldProps = FieldProps & Pick<BaseCheckboxGroup.Props,
26
28
  * label="Statuses"
27
29
  * optionalLabel="optional"
28
30
  * items={[{ label: "Open", value: "open" }]}
31
+ * checkIcon={<CheckIcon />}
29
32
  * value={statuses}
30
33
  * onValueChange={setStatuses}
31
34
  * />
32
35
  */
33
- export declare const CheckboxGroupField: ({ label, description, errors, requiredness, optionalLabel, dirty, touched, pending, items, readOnly, name, onBlur, className, value, defaultValue, onValueChange, disabled, }: CheckboxGroupFieldProps) => ReactNode;
36
+ export declare const CheckboxGroupField: ({ label, description, errors, requiredness, optionalLabel, dirty, touched, pending, items, checkIcon, readOnly, name, onBlur, className, value, defaultValue, onValueChange, disabled, }: CheckboxGroupFieldProps) => ReactNode;