@igne-agency/react-web-ui 0.4.0 → 0.6.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 (257) hide show
  1. package/dist/base.css +3 -0
  2. package/dist/components/accordion/accordion.css +21 -21
  3. package/dist/components/accordion/accordion.d.ts +17 -4
  4. package/dist/components/accordion/accordion.js +83 -36
  5. package/dist/components/accordion/accordion.module.js +6 -6
  6. package/dist/components/attachment-tile/attachment-preview.d.ts +56 -13
  7. package/dist/components/attachment-tile/attachment-preview.js +388 -119
  8. package/dist/components/attachment-tile/attachment-tile.css +31 -25
  9. package/dist/components/attachment-tile/attachment-tile.d.ts +32 -10
  10. package/dist/components/attachment-tile/attachment-tile.js +160 -43
  11. package/dist/components/attachment-tile/attachment-tile.module.js +8 -8
  12. package/dist/components/attachment-tile/index.d.ts +1 -1
  13. package/dist/components/avatar/avatar.css +9 -9
  14. package/dist/components/avatar/avatar.d.ts +50 -5
  15. package/dist/components/avatar/avatar.js +178 -64
  16. package/dist/components/avatar/avatar.module.js +3 -3
  17. package/dist/components/avatar-group/avatar-group-context.d.ts +2 -4
  18. package/dist/components/avatar-group/avatar-group-context.js +2 -2
  19. package/dist/components/avatar-group/avatar-group.css +26 -20
  20. package/dist/components/avatar-group/avatar-group.d.ts +85 -27
  21. package/dist/components/avatar-group/avatar-group.js +400 -246
  22. package/dist/components/avatar-group/avatar-group.module.js +8 -8
  23. package/dist/components/breadcrumbs/breadcrumbs.css +12 -12
  24. package/dist/components/breadcrumbs/breadcrumbs.d.ts +69 -23
  25. package/dist/components/breadcrumbs/breadcrumbs.js +299 -248
  26. package/dist/components/breadcrumbs/breadcrumbs.module.js +8 -8
  27. package/dist/components/button/button.css +29 -31
  28. package/dist/components/button/button.d.ts +20 -16
  29. package/dist/components/button/button.js +140 -145
  30. package/dist/components/button/button.module.js +1 -1
  31. package/dist/components/button/index.js +1 -1
  32. package/dist/components/checkbox-field/checkbox-field.js +63 -49
  33. package/dist/components/checkbox-field/checkbox.css +105 -56
  34. package/dist/components/checkbox-field/checkbox.d.ts +3 -2
  35. package/dist/components/checkbox-field/checkbox.js +12 -9
  36. package/dist/components/checkbox-field/checkbox.module.js +4 -4
  37. package/dist/components/checkbox-group-field/checkbox-group-field.js +78 -72
  38. package/dist/components/checkbox-group-field/checkbox-group.css +14 -10
  39. package/dist/components/checkbox-group-field/checkbox-group.d.ts +2 -2
  40. package/dist/components/checkbox-group-field/checkbox-group.js +2 -2
  41. package/dist/components/checkbox-group-field/checkbox-group.module.js +2 -2
  42. package/dist/components/collapsible/collapsible.css +20 -20
  43. package/dist/components/collapsible/collapsible.d.ts +17 -4
  44. package/dist/components/collapsible/collapsible.js +83 -36
  45. package/dist/components/collapsible/collapsible.module.js +5 -5
  46. package/dist/components/combobox-field/combobox-field.js +206 -158
  47. package/dist/components/combobox-field/combobox.css +492 -277
  48. package/dist/components/combobox-field/combobox.d.ts +148 -39
  49. package/dist/components/combobox-field/combobox.js +506 -206
  50. package/dist/components/combobox-field/combobox.module.js +21 -21
  51. package/dist/components/combobox-field/value-state-view.css +5 -5
  52. package/dist/components/combobox-field/value-state-view.module.js +4 -4
  53. package/dist/components/composer/composer-attachments.d.ts +30 -11
  54. package/dist/components/composer/composer-attachments.js +45 -40
  55. package/dist/components/composer/composer-editor.css +40 -35
  56. package/dist/components/composer/composer-editor.d.ts +14 -4
  57. package/dist/components/composer/composer-editor.js +134 -44
  58. package/dist/components/composer/composer-editor.module.js +5 -5
  59. package/dist/components/composer/composer.css +22 -22
  60. package/dist/components/composer/composer.d.ts +13 -2
  61. package/dist/components/composer/composer.js +78 -63
  62. package/dist/components/composer/composer.module.js +5 -5
  63. package/dist/components/composer/index.d.ts +2 -2
  64. package/dist/components/composer/mention-text.css +5 -5
  65. package/dist/components/composer/mention-text.module.js +1 -1
  66. package/dist/components/confirm-dialog/confirm-dialog.css +29 -29
  67. package/dist/components/confirm-dialog/confirm-dialog.d.ts +57 -3
  68. package/dist/components/confirm-dialog/confirm-dialog.js +266 -108
  69. package/dist/components/confirm-dialog/confirm-dialog.module.js +5 -5
  70. package/dist/components/conversation/conversation.css +52 -52
  71. package/dist/components/conversation/conversation.d.ts +43 -18
  72. package/dist/components/conversation/conversation.js +120 -78
  73. package/dist/components/conversation/conversation.module.js +15 -15
  74. package/dist/components/date-field/date-field.d.ts +1 -1
  75. package/dist/components/date-field/date-field.js +202 -100
  76. package/dist/components/date-field/date-input.d.ts +73 -37
  77. package/dist/components/date-field/date-input.js +72 -45
  78. package/dist/components/date-field/index.d.ts +1 -1
  79. package/dist/components/date-range-field/date-range-field.d.ts +1 -1
  80. package/dist/components/date-range-field/date-range-field.js +219 -107
  81. package/dist/components/date-range-field/date-range-input.d.ts +84 -40
  82. package/dist/components/date-range-field/date-range-input.js +83 -48
  83. package/dist/components/dialog/dialog.css +32 -32
  84. package/dist/components/dialog/dialog.d.ts +8 -7
  85. package/dist/components/dialog/dialog.js +8 -26
  86. package/dist/components/dialog/dialog.module.js +6 -6
  87. package/dist/components/divider/divider.css +6 -6
  88. package/dist/components/divider/divider.d.ts +36 -2
  89. package/dist/components/divider/divider.js +195 -29
  90. package/dist/components/divider/divider.module.js +3 -3
  91. package/dist/components/drawer/drawer.css +55 -56
  92. package/dist/components/drawer/drawer.d.ts +8 -7
  93. package/dist/components/drawer/drawer.js +8 -26
  94. package/dist/components/drawer/drawer.module.js +6 -6
  95. package/dist/components/field/field.css +34 -24
  96. package/dist/components/field/field.d.ts +60 -37
  97. package/dist/components/field/field.js +242 -157
  98. package/dist/components/field/field.module.js +12 -10
  99. package/dist/components/field/input-parts.d.ts +11 -13
  100. package/dist/components/field/input-parts.js +23 -42
  101. package/dist/components/field-placeholder/field-placeholder.css +6 -6
  102. package/dist/components/field-placeholder/field-placeholder.module.js +4 -4
  103. package/dist/components/fieldset/field-group.d.ts +1 -1
  104. package/dist/components/fieldset/field-group.js +48 -42
  105. package/dist/components/fieldset/fieldset-root.d.ts +1 -1
  106. package/dist/components/fieldset/fieldset-root.js +19 -17
  107. package/dist/components/fieldset/fieldset.d.ts +2 -2
  108. package/dist/components/fieldset/fieldset.js +2 -2
  109. package/dist/components/file-field/file-field.css +126 -60
  110. package/dist/components/file-field/file-field.js +201 -109
  111. package/dist/components/file-field/file-field.module.js +4 -4
  112. package/dist/components/file-field/file-input.d.ts +66 -40
  113. package/dist/components/file-field/file-input.js +188 -132
  114. package/dist/components/filter-bar/filter-bar.css +8 -8
  115. package/dist/components/filter-bar/filter-bar.d.ts +12 -3
  116. package/dist/components/filter-bar/filter-bar.js +23 -25
  117. package/dist/components/filter-bar/filter-bar.module.js +5 -5
  118. package/dist/components/form/form.d.ts +19 -7
  119. package/dist/components/form/form.js +80 -29
  120. package/dist/components/icon/icon.css +2 -2
  121. package/dist/components/icon/icon.module.js +1 -1
  122. package/dist/components/link/link.css +6 -5
  123. package/dist/components/link/link.module.js +1 -1
  124. package/dist/components/menu/menu.css +52 -47
  125. package/dist/components/menu/menu.d.ts +32 -25
  126. package/dist/components/menu/menu.js +75 -124
  127. package/dist/components/menu/menu.module.js +8 -8
  128. package/dist/components/nav/nav-context.d.ts +1 -1
  129. package/dist/components/nav/nav-item-view.d.ts +10 -13
  130. package/dist/components/nav/nav-item-view.js +42 -54
  131. package/dist/components/nav/nav.css +150 -119
  132. package/dist/components/nav/nav.d.ts +61 -17
  133. package/dist/components/nav/nav.js +271 -176
  134. package/dist/components/nav/nav.module.js +17 -15
  135. package/dist/components/number-field/number-field.css +153 -64
  136. package/dist/components/number-field/number-field.d.ts +2 -2
  137. package/dist/components/number-field/number-field.js +112 -91
  138. package/dist/components/number-field/number-field.module.js +6 -6
  139. package/dist/components/number-field/number-input.d.ts +43 -23
  140. package/dist/components/number-field/number-input.js +179 -125
  141. package/dist/components/otp-field/otp-field.css +153 -60
  142. package/dist/components/otp-field/otp-field.d.ts +2 -2
  143. package/dist/components/otp-field/otp-field.js +62 -46
  144. package/dist/components/otp-field/otp-field.module.js +4 -4
  145. package/dist/components/otp-field/otp-input.d.ts +8 -6
  146. package/dist/components/otp-field/otp-input.js +92 -92
  147. package/dist/components/pagination/pagination.d.ts +46 -15
  148. package/dist/components/pagination/pagination.js +217 -224
  149. package/dist/components/password-field/password-field.css +23 -23
  150. package/dist/components/password-field/password-field.js +107 -85
  151. package/dist/components/password-field/password-field.module.js +8 -8
  152. package/dist/components/password-field/password-strength.d.ts +107 -3
  153. package/dist/components/password-field/password-strength.js +569 -92
  154. package/dist/components/photo-field/photo-field.js +137 -112
  155. package/dist/components/photo-field/photo-input.css +67 -44
  156. package/dist/components/photo-field/photo-input.d.ts +59 -15
  157. package/dist/components/photo-field/photo-input.js +173 -86
  158. package/dist/components/photo-field/photo-input.module.js +10 -8
  159. package/dist/components/popover/popover.css +41 -41
  160. package/dist/components/popover/popover.d.ts +66 -25
  161. package/dist/components/popover/popover.js +332 -217
  162. package/dist/components/popover/popover.module.js +15 -19
  163. package/dist/components/radio-group-field/radio-group-field.js +80 -71
  164. package/dist/components/radio-group-field/radio-group.css +112 -60
  165. package/dist/components/radio-group-field/radio-group.d.ts +19 -3
  166. package/dist/components/radio-group-field/radio-group.js +66 -23
  167. package/dist/components/radio-group-field/radio-group.module.js +4 -4
  168. package/dist/components/segmented-control-field/segmented-control-field.d.ts +1 -1
  169. package/dist/components/segmented-control-field/segmented-control-field.js +111 -96
  170. package/dist/components/segmented-control-field/segmented-control.css +132 -79
  171. package/dist/components/segmented-control-field/segmented-control.d.ts +39 -15
  172. package/dist/components/segmented-control-field/segmented-control.js +124 -41
  173. package/dist/components/segmented-control-field/segmented-control.module.js +4 -4
  174. package/dist/components/select-field/select.css +214 -101
  175. package/dist/components/select-field/select.d.ts +43 -11
  176. package/dist/components/select-field/select.js +194 -109
  177. package/dist/components/select-field/select.module.js +14 -14
  178. package/dist/components/skeleton/skeleton.css +4 -4
  179. package/dist/components/skeleton/skeleton.module.js +3 -3
  180. package/dist/components/stale/stale.css +15 -15
  181. package/dist/components/stale/stale.d.ts +27 -3
  182. package/dist/components/stale/stale.js +147 -66
  183. package/dist/components/stale/stale.module.js +6 -6
  184. package/dist/components/status-message/status-message.css +22 -22
  185. package/dist/components/status-message/status-message.module.js +6 -6
  186. package/dist/components/switch-field/switch-field.js +77 -57
  187. package/dist/components/switch-field/switch.css +112 -63
  188. package/dist/components/switch-field/switch.d.ts +20 -3
  189. package/dist/components/switch-field/switch.js +70 -27
  190. package/dist/components/switch-field/switch.module.js +4 -4
  191. package/dist/components/tabs/tabs.css +32 -32
  192. package/dist/components/tabs/tabs.d.ts +21 -7
  193. package/dist/components/tabs/tabs.js +73 -14
  194. package/dist/components/tabs/tabs.module.js +7 -7
  195. package/dist/components/tag/tag.css +84 -84
  196. package/dist/components/tag/tag.module.js +3 -3
  197. package/dist/components/tag-group/tag-group.css +94 -94
  198. package/dist/components/tag-group/tag-group.module.js +4 -4
  199. package/dist/components/text-field/text-field.css +159 -82
  200. package/dist/components/text-field/text-field.d.ts +1 -1
  201. package/dist/components/text-field/text-field.js +139 -110
  202. package/dist/components/text-field/text-field.module.js +9 -9
  203. package/dist/components/text-field/text-input.d.ts +81 -45
  204. package/dist/components/text-field/text-input.js +366 -217
  205. package/dist/components/textarea-field/textarea-field.css +7 -2
  206. package/dist/components/textarea-field/textarea-field.js +72 -56
  207. package/dist/components/textarea-field/textarea-field.module.js +2 -2
  208. package/dist/components/time-field/time-field.js +153 -60
  209. package/dist/components/time-field/time-input.d.ts +21 -10
  210. package/dist/components/time-field/time-input.js +22 -11
  211. package/dist/components/toast/toast-provider.css +34 -31
  212. package/dist/components/toast/toast-provider.d.ts +63 -14
  213. package/dist/components/toast/toast-provider.js +174 -111
  214. package/dist/components/toast/toast-provider.module.js +7 -7
  215. package/dist/components/toggle-group-field/toggle-group-field.d.ts +1 -1
  216. package/dist/components/toggle-group-field/toggle-group-field.js +95 -89
  217. package/dist/components/toggle-group-field/toggle-group.css +117 -67
  218. package/dist/components/toggle-group-field/toggle-group.d.ts +2 -2
  219. package/dist/components/toggle-group-field/toggle-group.js +2 -2
  220. package/dist/components/toggle-group-field/toggle-group.module.js +2 -2
  221. package/dist/components/tooltip/tooltip.css +4 -4
  222. package/dist/components/tooltip/tooltip.module.js +1 -1
  223. package/dist/data-table/data-table-content.js +6 -5
  224. package/dist/data-table/data-table-parts.d.ts +41 -13
  225. package/dist/data-table/data-table-parts.js +213 -172
  226. package/dist/data-table/data-table-selection.d.ts +105 -3
  227. package/dist/data-table/data-table-selection.js +654 -145
  228. package/dist/data-table/data-table.css +125 -128
  229. package/dist/data-table/data-table.d.ts +21 -26
  230. package/dist/data-table/data-table.js +20 -23
  231. package/dist/data-table/data-table.module.js +32 -34
  232. package/dist/data-table/index.d.ts +2 -2
  233. package/dist/index.js +3 -3
  234. package/dist/lib/calendar/calendar-navigation.d.ts +39 -5
  235. package/dist/lib/calendar/calendar-navigation.js +185 -118
  236. package/dist/lib/calendar/calendar-parts.d.ts +143 -0
  237. package/dist/lib/calendar/calendar-parts.js +540 -0
  238. package/dist/lib/calendar/calendar-prefab.d.ts +52 -0
  239. package/dist/lib/calendar/calendar-prefab.js +311 -0
  240. package/dist/lib/calendar/calendar-year.d.ts +3 -1
  241. package/dist/lib/calendar/calendar-year.js +139 -131
  242. package/dist/lib/calendar/temporal.css +325 -232
  243. package/dist/lib/calendar/temporal.d.ts +67 -82
  244. package/dist/lib/calendar/temporal.js +258 -569
  245. package/dist/lib/calendar/temporal.module.js +38 -38
  246. package/dist/lib/forms/use-connected-field.d.ts +1 -1
  247. package/dist/lib/forms/use-connected-field.js +1 -1
  248. package/dist/lib/render-as.d.ts +13 -0
  249. package/dist/lib/render-as.js +46 -0
  250. package/dist/terrazzo/index.d.ts +4 -3
  251. package/dist/terrazzo/index.js +17 -6
  252. package/dist/tokens.css +28 -4
  253. package/package.json +2 -2
  254. package/tokens/dark.tokens.json +6 -0
  255. package/tokens/sys.tokens.json +7 -0
  256. package/dist/components/button/close-button.d.ts +0 -16
  257. package/dist/components/button/close-button.js +0 -30
@@ -1,37 +1,38 @@
1
1
  @layer kit.reset, kit.base, kit.components;
2
2
  @layer kit.components {
3
- ._root_1ietq_3 {
3
+ ._root_1wavl_3 {
4
4
  display: inline-flex;
5
5
  flex-direction: column;
6
6
  align-items: flex-start;
7
7
  gap: var(--switch-gap, var(--sys-unit-8));
8
8
  }
9
- ._label_1ietq_9 {
9
+ ._label_1wavl_9 {
10
10
  cursor: pointer;
11
11
  }
12
- ._label_1ietq_9:hover ._control_1ietq_12 {
13
- border-color: var(--sys-color-primary);
12
+ ._label_1wavl_9:hover ._control_1wavl_12 {
13
+ border-color: var(--checkbox-hover-border, var(--sys-color-primary));
14
14
  }
15
- :where([data-readonly], [data-disabled]) ._label_1ietq_9 {
15
+ :where([data-readonly], [data-disabled]) ._label_1wavl_9 {
16
16
  cursor: default;
17
17
  }
18
- :where([data-readonly], [data-disabled]) ._label_1ietq_9:hover ._control_1ietq_12:not([data-checked]) {
19
- border-color: var(--box-border, var(--sys-color-border));
18
+ :where([data-readonly], [data-disabled]) ._label_1wavl_9:hover ._control_1wavl_12:not([data-checked]) {
19
+ border-color: var(--_checkbox-border, var(--checkbox-border, var(--sys-color-border)));
20
20
  }
21
- ._label_1ietq_9 {
21
+ ._label_1wavl_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
- gap: var(--sys-unit-1) var(--sys-unit-6);
26
+ gap: var(--checkbox-label-row-gap, var(--sys-unit-1)) var(--checkbox-label-gap, var(--sys-unit-6));
27
+ font: var(--checkbox-label-font, inherit);
27
28
  }
28
- ._label_1ietq_9:has(> [data-optional-suffix]) {
29
+ ._label_1wavl_9:has(> [data-optional-suffix]) {
29
30
  grid-template-areas: "control text" "control optional";
30
31
  }
31
- ._label_1ietq_9 {
32
- min-block-size: var(--sys-unit-20);
32
+ ._label_1wavl_9 {
33
+ min-block-size: var(--switch-label-min-block-size, var(--sys-unit-20));
33
34
  }
34
- ._control_1ietq_12 {
35
+ ._control_1wavl_12 {
35
36
  --_switch-track-inline-size: var(
36
37
  --switch-track-inline-size,
37
38
  var(--sys-unit-26)
@@ -40,14 +41,24 @@
40
41
  --switch-track-block-size,
41
42
  var(--sys-unit-16)
42
43
  );
43
- --_switch-track-inset: calc(1px + var(--sys-unit-2));
44
- --_switch-thumb-size: calc(
45
- var(--_switch-track-block-size) - 2 *
46
- var(--_switch-track-inset)
44
+ --_switch-track-inset-x: calc(
45
+ var(--switch-border-width, 1px) +
46
+ var(--switch-pad-x, var(--sys-unit-2))
47
+ );
48
+ --_switch-track-inset-y: calc(
49
+ var(--switch-border-width, 1px) +
50
+ var(--switch-pad-y, var(--sys-unit-2))
51
+ );
52
+ --_switch-thumb-size: var(
53
+ --switch-thumb-size,
54
+ calc(
55
+ var(--_switch-track-block-size) - 2 *
56
+ var(--_switch-track-inset-y)
57
+ )
47
58
  );
48
59
  --_switch-travel: calc(
49
60
  var(--_switch-track-inline-size) - 2 *
50
- var(--_switch-track-inset) -
61
+ var(--_switch-track-inset-x) -
51
62
  var(--_switch-thumb-size)
52
63
  );
53
64
  --_switch-thumb-bg: var(
@@ -68,77 +79,115 @@
68
79
  box-sizing: border-box;
69
80
  inline-size: var(--_switch-track-inline-size);
70
81
  block-size: var(--_switch-track-block-size);
71
- border: 1px solid var(--switch-border, var(--sys-color-border));
72
- border-radius: var(--sys-radius-full);
82
+ border: var(--switch-border-width, 1px) solid var(--switch-border, var(--sys-color-border));
83
+ border-radius: var(--switch-radius, var(--sys-radius-full));
73
84
  background: var(--switch-track-bg, var(--sys-color-surface));
74
- padding: var(--sys-unit-2);
75
- color: var(--switch-on-thumb-bg, var(--sys-color-on-primary));
85
+ padding: var(--switch-pad-y, var(--sys-unit-2)) var(--switch-pad-x, var(--sys-unit-2));
86
+ color: var(--switch-thumb-on-bg, var(--sys-color-on-primary));
76
87
  }
77
- ._control_1ietq_12 {
88
+ ._control_1wavl_12 {
78
89
  outline: 0 solid var(--sys-color-focus-ring);
79
90
  outline-offset: var(--sys-focus-ring-offset);
80
91
  }
81
- ._control_1ietq_12[data-focus-visible] {
92
+ ._control_1wavl_12[data-focus-visible] {
82
93
  outline-width: var(--sys-focus-ring-width);
83
94
  }
84
95
  @media not (prefers-reduced-motion) {
85
- ._control_1ietq_12 {
96
+ ._control_1wavl_12 {
86
97
  transition: background var(--sys-motion-instant) var(--sys-motion-standard), border-color var(--sys-motion-instant) var(--sys-motion-standard);
87
98
  }
88
99
  }
89
- ._control_1ietq_12[data-focused] {
90
- border-color: var(--_switch-on-bg);
100
+ ._control_1wavl_12[data-focused] {
101
+ border-color: var(--switch-focus-border, var(--_switch-on-bg));
91
102
  }
92
- ._control_1ietq_12[data-checked] {
103
+ ._control_1wavl_12[data-checked] {
93
104
  border-color: var(--_switch-on-bg);
94
105
  background: var(--_switch-on-bg);
95
106
  }
96
- ._control_1ietq_12[data-invalid] {
97
- --field-fg: var(--sys-color-error-fg);
98
- --field-muted-fg: var(--sys-color-error-fg);
99
- --field-placeholder-fg: var(--sys-color-error-fg);
100
- border-color: var(--sys-color-error-fg);
101
- background-color: var(--sys-color-error-bg);
102
- color: var(--field-fg);
103
- --_switch-thumb-bg: var(--sys-color-error-outline);
104
- }
105
- ._control_1ietq_12[data-invalid][data-checked] {
106
- background: var(--sys-color-error-fg);
107
- color: var(--sys-color-error-bg);
108
- }
109
- ._control_1ietq_12[data-readonly] {
110
- --field-fg: var(--sys-color-text);
111
- border-style: dashed;
112
- border-color: var(--sys-color-outline);
113
- background: var(--sys-color-surface-high);
114
- color: var(--field-fg);
115
- }
116
- ._control_1ietq_12[data-readonly][data-checked] {
117
- background: var(--sys-color-primary-container);
118
- }
119
- ._control_1ietq_12[data-disabled], ._control_1ietq_12[data-disabled][data-checked] {
120
- --field-fg: var(--sys-color-disabled-fg);
121
- --field-muted-fg: var(--sys-color-disabled-fg);
122
- --field-placeholder-fg: var(--sys-color-disabled-fg);
123
- color: var(--sys-color-disabled-fg);
107
+ ._control_1wavl_12[data-invalid] {
108
+ --_field-fg: var(
109
+ --field-invalid-fg,
110
+ var(--sys-color-error-fg)
111
+ );
112
+ --_field-muted-fg: var(
113
+ --field-invalid-muted-fg,
114
+ var(--field-invalid-fg, var(--sys-color-error-fg))
115
+ );
116
+ --_field-placeholder-fg: var(
117
+ --field-invalid-placeholder-fg,
118
+ var(--field-invalid-fg, var(--sys-color-error-fg))
119
+ );
120
+ --_field-fill: var(
121
+ --field-invalid-bg,
122
+ var(--sys-color-error-bg)
123
+ );
124
+ border-color: var(--field-invalid-border, var(--sys-color-error-fg));
125
+ background-color: var(--_field-fill);
126
+ color: var(--_field-fg);
127
+ --_switch-thumb-bg: var(
128
+ --switch-thumb-invalid-bg,
129
+ var(--sys-color-error-outline)
130
+ );
131
+ }
132
+ ._control_1wavl_12[data-invalid][data-checked] {
133
+ background: var(--switch-invalid-on-bg, var(--sys-color-error-fg));
134
+ color: var(--switch-thumb-invalid-on-bg, var(--sys-color-error-bg));
135
+ }
136
+ ._control_1wavl_12[data-readonly] {
137
+ --_field-fg: var(
138
+ --field-readonly-fg,
139
+ var(--sys-color-text)
140
+ );
141
+ --_field-fill: var(
142
+ --field-readonly-bg,
143
+ var(--sys-color-surface-high)
144
+ );
145
+ border-style: var(--field-readonly-border-style, dashed);
146
+ border-color: var(--field-readonly-border, var(--sys-color-outline));
147
+ background: var(--_field-fill);
148
+ color: var(--_field-fg);
149
+ }
150
+ ._control_1wavl_12[data-readonly][data-checked] {
151
+ background: var(--switch-readonly-on-bg, var(--sys-color-primary-container));
152
+ }
153
+ ._control_1wavl_12[data-disabled], ._control_1wavl_12[data-disabled][data-checked] {
154
+ --_field-fg: var(
155
+ --field-disabled-fg,
156
+ var(--sys-color-disabled-fg)
157
+ );
158
+ --_field-muted-fg: var(
159
+ --field-disabled-muted-fg,
160
+ var(--field-disabled-fg, var(--sys-color-disabled-fg))
161
+ );
162
+ --_field-placeholder-fg: var(
163
+ --field-disabled-placeholder-fg,
164
+ var(--field-disabled-fg, var(--sys-color-disabled-fg))
165
+ );
166
+ color: var(--field-disabled-fg, var(--sys-color-disabled-fg));
124
167
  cursor: not-allowed;
125
- --_switch-on-bg: var(--sys-color-disabled-bg);
126
- --_switch-thumb-bg: var(--sys-color-disabled-fg);
127
- background: var(--sys-color-disabled-bg);
168
+ --_switch-on-bg: var(
169
+ --switch-disabled-on-border,
170
+ var(--sys-color-disabled-bg)
171
+ );
172
+ --_switch-thumb-bg: var(
173
+ --switch-thumb-disabled-bg,
174
+ var(--sys-color-disabled-fg)
175
+ );
176
+ background: var(--switch-disabled-bg, var(--sys-color-disabled-bg));
128
177
  }
129
- ._thumb_1ietq_129 {
178
+ ._thumb_1wavl_178 {
130
179
  inline-size: var(--_switch-thumb-size);
131
180
  block-size: var(--_switch-thumb-size);
132
- border-radius: var(--sys-radius-circle);
181
+ border-radius: var(--switch-thumb-radius, var(--sys-radius-circle));
133
182
  background: var(--_switch-thumb-bg);
134
183
  translate: 0;
135
184
  }
136
185
  @media not (prefers-reduced-motion) {
137
- ._thumb_1ietq_129 {
186
+ ._thumb_1wavl_178 {
138
187
  transition: translate var(--sys-motion-short) var(--sys-motion-emphasized), background var(--sys-motion-instant) var(--sys-motion-standard);
139
188
  }
140
189
  }
141
- ._thumb_1ietq_129[data-checked] {
190
+ ._thumb_1wavl_178[data-checked] {
142
191
  background: currentcolor;
143
192
  translate: var(--_switch-travel);
144
193
  }
@@ -9,12 +9,26 @@ export type SwitchRootProps = FieldRootProps & Pick<FieldProps, "errors" | "requ
9
9
  }>;
10
10
  declare const SwitchRoot: ({ errors, requiredness, dirty, touched, pending, filled, readOnly, disabled, className, ...props }: SwitchRootProps) => ReactNode;
11
11
  declare const SwitchLabel: ({ className, ...props }: BaseField.Label.Props) => ReactNode;
12
+ /**
13
+ * The track, which takes a `Switch.Thumb` as its child.
14
+ *
15
+ * @example
16
+ * <Switch.Control checked={enabled} onCheckedChange={setEnabled}><Switch.Thumb /></Switch.Control>
17
+ */
12
18
  declare const SwitchControl: ({ className, ...props }: BaseSwitch.Root.Props) => ReactNode;
19
+ /**
20
+ * The thumb that slides along the track.
21
+ *
22
+ * @example
23
+ * <Switch.Thumb />
24
+ */
25
+ declare const SwitchThumb: ({ className, ...props }: BaseSwitch.Thumb.Props) => ReactNode;
13
26
  /** The parts of a switch. */
14
27
  export type SwitchParts = Readonly<{
15
28
  Root: typeof SwitchRoot;
16
29
  Label: typeof SwitchLabel;
17
30
  Control: typeof SwitchControl;
31
+ Thumb: typeof SwitchThumb;
18
32
  Description: typeof Field.Description;
19
33
  Error: typeof Field.Error;
20
34
  }>;
@@ -24,10 +38,13 @@ export type SwitchParts = Readonly<{
24
38
  * share one hit area. For the ordinary case, use `SwitchField`.
25
39
  *
26
40
  * @example
27
- * <Switch.Root filled={enabled}>
41
+ * <Switch.Root filled={enabled} requiredness="optional">
28
42
  * <Switch.Label>
29
- * <Switch.Control checked={enabled} onCheckedChange={setEnabled} />
30
- * Email me about new messages
43
+ * <Switch.Control checked={enabled} onCheckedChange={setEnabled}>
44
+ * <Switch.Thumb />
45
+ * </Switch.Control>
46
+ * <Field.InlineLabelText>Email me about new messages <Field.RequiredMark /></Field.InlineLabelText>
47
+ * <Field.InlineOptional optionalLabel="optional" />
31
48
  * </Switch.Label>
32
49
  * </Switch.Root>
33
50
  */
@@ -10,7 +10,7 @@ import { Field } from "@base-ui/react/field";
10
10
  import { Switch } from "@base-ui/react/switch";
11
11
  // src/components/switch-field/switch.tsx
12
12
  var SwitchRoot = (t0) => {
13
- const $ = c(32);
13
+ const $ = c(33);
14
14
  let className;
15
15
  let dirty;
16
16
  let disabled;
@@ -84,11 +84,12 @@ var SwitchRoot = (t0) => {
84
84
  $[23] = t5;
85
85
  } else t5 = $[23];
86
86
  let t6;
87
- if ($[24] !== dirty || $[25] !== field.disabled || $[26] !== field.invalid || $[27] !== props || $[28] !== t2 || $[29] !== t5 || $[30] !== touched) {
87
+ if ($[24] !== dirty || $[25] !== field.disabled || $[26] !== field.invalid || $[27] !== props || $[28] !== requiredness || $[29] !== t2 || $[30] !== t5 || $[31] !== touched) {
88
88
  t6 = /* @__PURE__ */ jsx(Field$1.Root, {
89
89
  className: t2,
90
90
  disabled: t3,
91
91
  invalid: t4,
92
+ requiredness,
92
93
  dirty,
93
94
  touched,
94
95
  ...t5,
@@ -98,11 +99,12 @@ var SwitchRoot = (t0) => {
98
99
  $[25] = field.disabled;
99
100
  $[26] = field.invalid;
100
101
  $[27] = props;
101
- $[28] = t2;
102
- $[29] = t5;
103
- $[30] = touched;
104
- $[31] = t6;
105
- } else t6 = $[31];
102
+ $[28] = requiredness;
103
+ $[29] = t2;
104
+ $[30] = t5;
105
+ $[31] = touched;
106
+ $[32] = t6;
107
+ } else t6 = $[32];
106
108
  return t6;
107
109
  };
108
110
  var SwitchLabel = (t0) => {
@@ -136,8 +138,14 @@ var SwitchLabel = (t0) => {
136
138
  } else t2 = $[7];
137
139
  return t2;
138
140
  };
141
+ /**
142
+ * The track, which takes a `Switch.Thumb` as its child.
143
+ *
144
+ * @example
145
+ * <Switch.Control checked={enabled} onCheckedChange={setEnabled}><Switch.Thumb /></Switch.Control>
146
+ */
139
147
  var SwitchControl = (t0) => {
140
- const $ = c(13);
148
+ const $ = c(12);
141
149
  let className;
142
150
  let props;
143
151
  if ($[0] !== t0) {
@@ -163,26 +171,57 @@ var SwitchControl = (t0) => {
163
171
  $[6] = t2;
164
172
  } else t2 = $[6];
165
173
  let t3;
166
- if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
167
- t3 = /* @__PURE__ */ jsx(Switch.Thumb, { className: switch_module_default.thumb });
168
- $[7] = t3;
169
- } else t3 = $[7];
170
- let t4;
171
- if ($[8] !== focus.props || $[9] !== props || $[10] !== t1 || $[11] !== t2) {
172
- t4 = /* @__PURE__ */ jsx(Switch.Root, {
174
+ if ($[7] !== focus.props || $[8] !== props || $[9] !== t1 || $[10] !== t2) {
175
+ t3 = /* @__PURE__ */ jsx(Switch.Root, {
173
176
  className: t1,
174
177
  ...t2,
175
178
  ...props,
176
- ...focus.props,
177
- children: t3
179
+ ...focus.props
178
180
  });
179
- $[8] = focus.props;
180
- $[9] = props;
181
- $[10] = t1;
182
- $[11] = t2;
183
- $[12] = t4;
184
- } else t4 = $[12];
185
- return t4;
181
+ $[7] = focus.props;
182
+ $[8] = props;
183
+ $[9] = t1;
184
+ $[10] = t2;
185
+ $[11] = t3;
186
+ } else t3 = $[11];
187
+ return t3;
188
+ };
189
+ /**
190
+ * The thumb that slides along the track.
191
+ *
192
+ * @example
193
+ * <Switch.Thumb />
194
+ */
195
+ var SwitchThumb = (t0) => {
196
+ const $ = c(8);
197
+ let className;
198
+ let props;
199
+ if ($[0] !== t0) {
200
+ ({className, ...props} = t0);
201
+ $[0] = t0;
202
+ $[1] = className;
203
+ $[2] = props;
204
+ } else {
205
+ className = $[1];
206
+ props = $[2];
207
+ }
208
+ let t1;
209
+ if ($[3] !== className) {
210
+ t1 = clsx(switch_module_default.thumb, className);
211
+ $[3] = className;
212
+ $[4] = t1;
213
+ } else t1 = $[4];
214
+ let t2;
215
+ if ($[5] !== props || $[6] !== t1) {
216
+ t2 = /* @__PURE__ */ jsx(Switch.Thumb, {
217
+ className: t1,
218
+ ...props
219
+ });
220
+ $[5] = props;
221
+ $[6] = t1;
222
+ $[7] = t2;
223
+ } else t2 = $[7];
224
+ return t2;
186
225
  };
187
226
  /**
188
227
  * The styled parts of a base-ui Switch: a track with a sliding thumb that
@@ -190,10 +229,13 @@ var SwitchControl = (t0) => {
190
229
  * share one hit area. For the ordinary case, use `SwitchField`.
191
230
  *
192
231
  * @example
193
- * <Switch.Root filled={enabled}>
232
+ * <Switch.Root filled={enabled} requiredness="optional">
194
233
  * <Switch.Label>
195
- * <Switch.Control checked={enabled} onCheckedChange={setEnabled} />
196
- * Email me about new messages
234
+ * <Switch.Control checked={enabled} onCheckedChange={setEnabled}>
235
+ * <Switch.Thumb />
236
+ * </Switch.Control>
237
+ * <Field.InlineLabelText>Email me about new messages <Field.RequiredMark /></Field.InlineLabelText>
238
+ * <Field.InlineOptional optionalLabel="optional" />
197
239
  * </Switch.Label>
198
240
  * </Switch.Root>
199
241
  */
@@ -201,6 +243,7 @@ var Switch$1 = {
201
243
  Root: SwitchRoot,
202
244
  Label: SwitchLabel,
203
245
  Control: SwitchControl,
246
+ Thumb: SwitchThumb,
204
247
  Description: Field$1.Description,
205
248
  Error: Field$1.Error
206
249
  };
@@ -1,8 +1,8 @@
1
1
  import './switch.css';// src/components/switch-field/switch.module.scss
2
- var root = "_root_1ietq_3";
3
- var label = "_label_1ietq_9";
4
- var control = "_control_1ietq_12";
5
- var thumb = "_thumb_1ietq_129";
2
+ var root = "_root_1wavl_3";
3
+ var label = "_label_1wavl_9";
4
+ var control = "_control_1wavl_12";
5
+ var thumb = "_thumb_1wavl_178";
6
6
  var switch_module_default = {
7
7
  root,
8
8
  label,
@@ -1,59 +1,59 @@
1
1
  @layer kit.reset, kit.base, kit.components;
2
2
  @layer kit.components {
3
- ._root_1jg47_3 {
3
+ ._root_pzyl1_3 {
4
4
  display: flex;
5
5
  flex-direction: column;
6
6
  gap: var(--tabs-gap, var(--sys-unit-8));
7
7
  }
8
- ._scroller_1jg47_8 {
8
+ ._scroller_pzyl1_8 {
9
9
  overflow-x: auto;
10
10
  overscroll-behavior-x: contain;
11
11
  }
12
- ._list_1jg47_12 {
12
+ ._list_pzyl1_12 {
13
13
  position: relative;
14
14
  display: flex;
15
15
  gap: var(--tab-gap, var(--sys-unit-2));
16
16
  min-inline-size: max-content;
17
17
  }
18
- ._tab_1jg47_18 {
18
+ ._tab_pzyl1_18 {
19
19
  display: inline-flex;
20
20
  align-items: center;
21
- gap: var(--sys-unit-4);
22
- padding: var(--sys-unit-6) var(--sys-unit-10);
23
- border-radius: var(--sys-radius-full);
21
+ gap: var(--tab-icon-gap, var(--sys-unit-4));
22
+ padding: var(--tab-pad-y, var(--sys-unit-6)) var(--tab-pad-x, var(--sys-unit-10));
23
+ border-radius: var(--tab-radius, var(--sys-radius-full));
24
24
  color: var(--tab-fg, var(--sys-color-text-muted));
25
- font: var(--sys-font-label-medium);
25
+ font: var(--tab-font, var(--sys-font-label-medium));
26
26
  text-decoration: none;
27
27
  white-space: nowrap;
28
28
  cursor: pointer;
29
29
  }
30
- ._tab_1jg47_18 {
30
+ ._tab_pzyl1_18 {
31
31
  outline: 0 solid var(--sys-color-focus-ring);
32
32
  outline-offset: var(--sys-focus-ring-offset);
33
33
  }
34
- ._tab_1jg47_18:focus-visible {
34
+ ._tab_pzyl1_18:focus-visible {
35
35
  outline-width: var(--sys-focus-ring-width);
36
36
  }
37
- ._tab_1jg47_18 {
37
+ ._tab_pzyl1_18 {
38
38
  outline-offset: calc(-1 * var(--sys-focus-ring-width));
39
39
  }
40
40
  @media not (prefers-reduced-motion) {
41
- ._tab_1jg47_18 {
41
+ ._tab_pzyl1_18 {
42
42
  transition: background-color var(--sys-motion-instant) var(--sys-motion-standard);
43
43
  }
44
44
  }
45
- ._tab_1jg47_18:hover {
46
- background: var(--tab-bg-hover, var(--sys-color-primary-container));
45
+ ._tab_pzyl1_18:hover {
46
+ background: var(--tab-hover-bg, var(--sys-color-primary-container));
47
47
  }
48
- ._tab_1jg47_18 {
48
+ ._tab_pzyl1_18 {
49
49
  border: none;
50
50
  background: none;
51
51
  }
52
- ._tab_1jg47_18[data-disabled] {
52
+ ._tab_pzyl1_18[data-disabled] {
53
53
  color: var(--tab-disabled-fg, var(--sys-color-disabled-fg));
54
54
  cursor: not-allowed;
55
55
  }
56
- ._indicator_1jg47_56 {
56
+ ._indicator_pzyl1_56 {
57
57
  --_indicator-slack: var(
58
58
  --sliding-indicator-slack,
59
59
  0px
@@ -71,27 +71,27 @@
71
71
  pointer-events: none;
72
72
  }
73
73
  @media not (prefers-reduced-motion) {
74
- ._indicator_1jg47_56 {
74
+ ._indicator_pzyl1_56 {
75
75
  transition: inset-inline-start var(--_indicator-slide), inset-block-start var(--_indicator-slide), inline-size var(--_indicator-slide), block-size var(--_indicator-slide), opacity var(--sys-motion-instant) var(--sys-motion-standard), scale var(--sys-motion-short) var(--sys-motion-overshoot);
76
76
  }
77
77
  }
78
- ._indicator_1jg47_56[data-jump] {
78
+ ._indicator_pzyl1_56[data-jump] {
79
79
  --_indicator-slide: 0s;
80
80
  }
81
- ._indicator_1jg47_56[data-empty] {
81
+ ._indicator_pzyl1_56[data-empty] {
82
82
  opacity: 0;
83
83
  scale: 0;
84
84
  }
85
85
  @media not (prefers-reduced-motion) {
86
- ._indicator_1jg47_56[data-empty] {
86
+ ._indicator_pzyl1_56[data-empty] {
87
87
  transition: opacity var(--sys-motion-instant) var(--sys-motion-standard), scale var(--sys-motion-instant) var(--sys-motion-standard);
88
88
  }
89
89
  }
90
- ._indicator_1jg47_56 {
91
- border-radius: var(--sys-radius-full);
90
+ ._indicator_pzyl1_56 {
91
+ border-radius: var(--tab-indicator-radius, var(--sys-radius-full));
92
92
  background: var(--tab-indicator, var(--sys-color-primary));
93
93
  }
94
- ._indicatorLabels_1jg47_94 {
94
+ ._indicatorLabels_pzyl1_94 {
95
95
  position: absolute;
96
96
  inset-inline-start: calc(var(--_indicator-slack) - var(--active-tab-left, 0));
97
97
  inset-block-start: calc(var(--_indicator-slack) - var(--active-tab-top, 0));
@@ -99,24 +99,24 @@
99
99
  inline-size: max-content;
100
100
  }
101
101
  @media not (prefers-reduced-motion) {
102
- ._indicatorLabels_1jg47_94 {
102
+ ._indicatorLabels_pzyl1_94 {
103
103
  transition: inset-inline-start var(--_indicator-slide), inset-block-start var(--_indicator-slide);
104
104
  }
105
105
  }
106
- ._indicatorLabels_1jg47_94 {
106
+ ._indicatorLabels_pzyl1_94 {
107
107
  gap: var(--tab-gap, var(--sys-unit-2));
108
108
  }
109
- ._indicatorLabels_1jg47_94 ._tab_1jg47_18 {
110
- color: var(--tab-fg-active, var(--sys-color-on-primary));
109
+ ._indicatorLabels_pzyl1_94 ._tab_pzyl1_18 {
110
+ color: var(--tab-active-fg, var(--sys-color-on-primary));
111
111
  }
112
- ._panel_1jg47_112 {
113
- border-radius: var(--sys-radius-sm);
112
+ ._panel_pzyl1_112 {
113
+ border-radius: var(--tabs-panel-radius, var(--sys-radius-sm));
114
114
  }
115
- ._panel_1jg47_112 {
115
+ ._panel_pzyl1_112 {
116
116
  outline: 0 solid var(--sys-color-focus-ring);
117
117
  outline-offset: var(--sys-focus-ring-offset);
118
118
  }
119
- ._panel_1jg47_112:focus-visible {
119
+ ._panel_pzyl1_112:focus-visible {
120
120
  outline-width: var(--sys-focus-ring-width);
121
121
  }
122
122
  }
@@ -1,5 +1,6 @@
1
1
  import { Tabs as BaseTabs } from "@base-ui/react/tabs";
2
- import { type ReactNode } from "react";
2
+ import { useRender } from "@base-ui/react/use-render";
3
+ import { type ReactElement, type ReactNode } from "react";
3
4
  import { type BadgeProps } from "../badge/badge.tsx";
4
5
  export type TabsRootProps = Omit<BaseTabs.Root.Props, "className" | "value" | "defaultValue" | "onValueChange" | "orientation" | "children"> & Readonly<{
5
6
  /** The `Tabs.List` and the `Tabs.Panel`s it opens. */
@@ -21,12 +22,22 @@ export type TabsRootProps = Omit<BaseTabs.Root.Props, "className" | "value" | "d
21
22
  }>);
22
23
  /** The tabs and the panels they open. */
23
24
  declare const Root: ({ value, defaultValue, onValueChange, className, ...props }: TabsRootProps) => ReactNode;
25
+ export type TabsScrollerProps = useRender.ComponentProps<"div">;
26
+ /**
27
+ * Lets the `List` scroll sideways once it outgrows its room.
28
+ *
29
+ * @example
30
+ * <Tabs.Scroller>
31
+ * <Tabs.List label="Invoice">…</Tabs.List>
32
+ * </Tabs.Scroller>
33
+ */
34
+ declare const Scroller: ({ render, className, ref, ...props }: TabsScrollerProps) => ReactElement;
24
35
  export type TabsListProps = Omit<BaseTabs.List.Props, "className" | "aria-label"> & Readonly<{
25
36
  /** What the tabs switch between, such as "Invoice". */
26
37
  label: string;
27
38
  className?: string;
28
39
  }>;
29
- /** The row of tabs, scrolling sideways when it outgrows its room. */
40
+ /** The row of tabs; put it in a `Scroller` where it may outgrow its room. */
30
41
  declare const List: ({ label, className, children, ...props }: TabsListProps) => ReactNode;
31
42
  export type TabsTabProps = Omit<BaseTabs.Tab.Props, "className" | "value"> & Readonly<{
32
43
  /** The `value` of the panel this tab opens. */
@@ -55,6 +66,7 @@ export type TabsPanelProps = Omit<BaseTabs.Panel.Props, "className" | "value"> &
55
66
  declare const Panel: ({ className, ...props }: TabsPanelProps) => ReactNode;
56
67
  type TabsParts = Readonly<{
57
68
  Root: typeof Root;
69
+ Scroller: typeof Scroller;
58
70
  List: typeof List;
59
71
  Tab: typeof Tab;
60
72
  Count: typeof Count;
@@ -67,11 +79,13 @@ type TabsParts = Readonly<{
67
79
  *
68
80
  * @example
69
81
  * <Tabs.Root defaultValue="details">
70
- * <Tabs.List label="Invoice">
71
- * <Tabs.Tab value="details">Details</Tabs.Tab>
72
- * <Tabs.Tab value="history">History<Tabs.Count>3</Tabs.Count></Tabs.Tab>
73
- * <Tabs.Indicator />
74
- * </Tabs.List>
82
+ * <Tabs.Scroller>
83
+ * <Tabs.List label="Invoice">
84
+ * <Tabs.Tab value="details">Details</Tabs.Tab>
85
+ * <Tabs.Tab value="history">History<Tabs.Count>3</Tabs.Count></Tabs.Tab>
86
+ * <Tabs.Indicator />
87
+ * </Tabs.List>
88
+ * </Tabs.Scroller>
75
89
  * <Tabs.Panel value="details">…</Tabs.Panel>
76
90
  * <Tabs.Panel value="history">…</Tabs.Panel>
77
91
  * </Tabs.Root>