@igne-agency/react-web-ui 0.5.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 (254) hide show
  1. package/dist/components/accordion/accordion.css +21 -21
  2. package/dist/components/accordion/accordion.d.ts +17 -4
  3. package/dist/components/accordion/accordion.js +83 -36
  4. package/dist/components/accordion/accordion.module.js +6 -6
  5. package/dist/components/attachment-tile/attachment-preview.d.ts +56 -13
  6. package/dist/components/attachment-tile/attachment-preview.js +388 -119
  7. package/dist/components/attachment-tile/attachment-tile.css +31 -25
  8. package/dist/components/attachment-tile/attachment-tile.d.ts +32 -10
  9. package/dist/components/attachment-tile/attachment-tile.js +160 -43
  10. package/dist/components/attachment-tile/attachment-tile.module.js +8 -8
  11. package/dist/components/attachment-tile/index.d.ts +1 -1
  12. package/dist/components/avatar/avatar.css +9 -9
  13. package/dist/components/avatar/avatar.d.ts +50 -5
  14. package/dist/components/avatar/avatar.js +178 -64
  15. package/dist/components/avatar/avatar.module.js +3 -3
  16. package/dist/components/avatar-group/avatar-group-context.d.ts +2 -4
  17. package/dist/components/avatar-group/avatar-group-context.js +2 -2
  18. package/dist/components/avatar-group/avatar-group.css +26 -20
  19. package/dist/components/avatar-group/avatar-group.d.ts +85 -27
  20. package/dist/components/avatar-group/avatar-group.js +400 -246
  21. package/dist/components/avatar-group/avatar-group.module.js +8 -8
  22. package/dist/components/breadcrumbs/breadcrumbs.css +12 -12
  23. package/dist/components/breadcrumbs/breadcrumbs.d.ts +69 -23
  24. package/dist/components/breadcrumbs/breadcrumbs.js +299 -248
  25. package/dist/components/breadcrumbs/breadcrumbs.module.js +8 -8
  26. package/dist/components/button/button.css +29 -31
  27. package/dist/components/button/button.d.ts +20 -16
  28. package/dist/components/button/button.js +140 -145
  29. package/dist/components/button/button.module.js +1 -1
  30. package/dist/components/button/index.js +1 -1
  31. package/dist/components/checkbox-field/checkbox-field.js +63 -49
  32. package/dist/components/checkbox-field/checkbox.css +105 -56
  33. package/dist/components/checkbox-field/checkbox.d.ts +3 -2
  34. package/dist/components/checkbox-field/checkbox.js +12 -9
  35. package/dist/components/checkbox-field/checkbox.module.js +4 -4
  36. package/dist/components/checkbox-group-field/checkbox-group-field.js +78 -72
  37. package/dist/components/checkbox-group-field/checkbox-group.css +14 -10
  38. package/dist/components/checkbox-group-field/checkbox-group.d.ts +2 -2
  39. package/dist/components/checkbox-group-field/checkbox-group.js +2 -2
  40. package/dist/components/checkbox-group-field/checkbox-group.module.js +2 -2
  41. package/dist/components/collapsible/collapsible.css +20 -20
  42. package/dist/components/collapsible/collapsible.d.ts +17 -4
  43. package/dist/components/collapsible/collapsible.js +83 -36
  44. package/dist/components/collapsible/collapsible.module.js +5 -5
  45. package/dist/components/combobox-field/combobox-field.js +206 -158
  46. package/dist/components/combobox-field/combobox.css +492 -277
  47. package/dist/components/combobox-field/combobox.d.ts +148 -39
  48. package/dist/components/combobox-field/combobox.js +506 -206
  49. package/dist/components/combobox-field/combobox.module.js +21 -21
  50. package/dist/components/combobox-field/value-state-view.css +5 -5
  51. package/dist/components/combobox-field/value-state-view.module.js +4 -4
  52. package/dist/components/composer/composer-attachments.d.ts +30 -11
  53. package/dist/components/composer/composer-attachments.js +45 -40
  54. package/dist/components/composer/composer-editor.css +40 -35
  55. package/dist/components/composer/composer-editor.d.ts +14 -4
  56. package/dist/components/composer/composer-editor.js +134 -44
  57. package/dist/components/composer/composer-editor.module.js +5 -5
  58. package/dist/components/composer/composer.css +22 -22
  59. package/dist/components/composer/composer.d.ts +13 -2
  60. package/dist/components/composer/composer.js +78 -63
  61. package/dist/components/composer/composer.module.js +5 -5
  62. package/dist/components/composer/index.d.ts +2 -2
  63. package/dist/components/composer/mention-text.css +5 -5
  64. package/dist/components/composer/mention-text.module.js +1 -1
  65. package/dist/components/confirm-dialog/confirm-dialog.css +29 -29
  66. package/dist/components/confirm-dialog/confirm-dialog.d.ts +57 -3
  67. package/dist/components/confirm-dialog/confirm-dialog.js +266 -108
  68. package/dist/components/confirm-dialog/confirm-dialog.module.js +5 -5
  69. package/dist/components/conversation/conversation.css +52 -52
  70. package/dist/components/conversation/conversation.d.ts +43 -18
  71. package/dist/components/conversation/conversation.js +120 -78
  72. package/dist/components/conversation/conversation.module.js +15 -15
  73. package/dist/components/date-field/date-field.d.ts +1 -1
  74. package/dist/components/date-field/date-field.js +202 -100
  75. package/dist/components/date-field/date-input.d.ts +73 -37
  76. package/dist/components/date-field/date-input.js +72 -45
  77. package/dist/components/date-field/index.d.ts +1 -1
  78. package/dist/components/date-range-field/date-range-field.d.ts +1 -1
  79. package/dist/components/date-range-field/date-range-field.js +219 -107
  80. package/dist/components/date-range-field/date-range-input.d.ts +84 -40
  81. package/dist/components/date-range-field/date-range-input.js +83 -48
  82. package/dist/components/dialog/dialog.css +32 -32
  83. package/dist/components/dialog/dialog.d.ts +8 -7
  84. package/dist/components/dialog/dialog.js +8 -26
  85. package/dist/components/dialog/dialog.module.js +6 -6
  86. package/dist/components/divider/divider.css +6 -6
  87. package/dist/components/divider/divider.d.ts +36 -2
  88. package/dist/components/divider/divider.js +195 -29
  89. package/dist/components/divider/divider.module.js +3 -3
  90. package/dist/components/drawer/drawer.css +55 -56
  91. package/dist/components/drawer/drawer.d.ts +8 -7
  92. package/dist/components/drawer/drawer.js +8 -26
  93. package/dist/components/drawer/drawer.module.js +6 -6
  94. package/dist/components/field/field.css +34 -24
  95. package/dist/components/field/field.d.ts +60 -37
  96. package/dist/components/field/field.js +242 -157
  97. package/dist/components/field/field.module.js +12 -10
  98. package/dist/components/field/input-parts.d.ts +11 -13
  99. package/dist/components/field/input-parts.js +23 -42
  100. package/dist/components/field-placeholder/field-placeholder.css +6 -6
  101. package/dist/components/field-placeholder/field-placeholder.module.js +4 -4
  102. package/dist/components/fieldset/field-group.d.ts +1 -1
  103. package/dist/components/fieldset/field-group.js +48 -42
  104. package/dist/components/fieldset/fieldset-root.d.ts +1 -1
  105. package/dist/components/fieldset/fieldset-root.js +19 -17
  106. package/dist/components/fieldset/fieldset.d.ts +2 -2
  107. package/dist/components/fieldset/fieldset.js +2 -2
  108. package/dist/components/file-field/file-field.css +126 -60
  109. package/dist/components/file-field/file-field.js +201 -109
  110. package/dist/components/file-field/file-field.module.js +4 -4
  111. package/dist/components/file-field/file-input.d.ts +66 -40
  112. package/dist/components/file-field/file-input.js +188 -132
  113. package/dist/components/filter-bar/filter-bar.css +8 -8
  114. package/dist/components/filter-bar/filter-bar.d.ts +12 -3
  115. package/dist/components/filter-bar/filter-bar.js +23 -25
  116. package/dist/components/filter-bar/filter-bar.module.js +5 -5
  117. package/dist/components/form/form.d.ts +19 -7
  118. package/dist/components/form/form.js +80 -29
  119. package/dist/components/icon/icon.css +2 -2
  120. package/dist/components/icon/icon.module.js +1 -1
  121. package/dist/components/link/link.css +6 -5
  122. package/dist/components/link/link.module.js +1 -1
  123. package/dist/components/menu/menu.css +52 -47
  124. package/dist/components/menu/menu.d.ts +32 -25
  125. package/dist/components/menu/menu.js +75 -124
  126. package/dist/components/menu/menu.module.js +8 -8
  127. package/dist/components/nav/nav-context.d.ts +1 -1
  128. package/dist/components/nav/nav-item-view.d.ts +10 -13
  129. package/dist/components/nav/nav-item-view.js +42 -54
  130. package/dist/components/nav/nav.css +150 -119
  131. package/dist/components/nav/nav.d.ts +61 -17
  132. package/dist/components/nav/nav.js +271 -176
  133. package/dist/components/nav/nav.module.js +17 -15
  134. package/dist/components/number-field/number-field.css +153 -64
  135. package/dist/components/number-field/number-field.d.ts +2 -2
  136. package/dist/components/number-field/number-field.js +112 -91
  137. package/dist/components/number-field/number-field.module.js +6 -6
  138. package/dist/components/number-field/number-input.d.ts +43 -23
  139. package/dist/components/number-field/number-input.js +179 -125
  140. package/dist/components/otp-field/otp-field.css +153 -60
  141. package/dist/components/otp-field/otp-field.d.ts +2 -2
  142. package/dist/components/otp-field/otp-field.js +62 -46
  143. package/dist/components/otp-field/otp-field.module.js +4 -4
  144. package/dist/components/otp-field/otp-input.d.ts +8 -6
  145. package/dist/components/otp-field/otp-input.js +92 -92
  146. package/dist/components/pagination/pagination.d.ts +46 -15
  147. package/dist/components/pagination/pagination.js +217 -224
  148. package/dist/components/password-field/password-field.css +23 -23
  149. package/dist/components/password-field/password-field.js +107 -85
  150. package/dist/components/password-field/password-field.module.js +8 -8
  151. package/dist/components/password-field/password-strength.d.ts +107 -3
  152. package/dist/components/password-field/password-strength.js +569 -92
  153. package/dist/components/photo-field/photo-field.js +137 -112
  154. package/dist/components/photo-field/photo-input.css +67 -44
  155. package/dist/components/photo-field/photo-input.d.ts +59 -15
  156. package/dist/components/photo-field/photo-input.js +173 -86
  157. package/dist/components/photo-field/photo-input.module.js +10 -8
  158. package/dist/components/popover/popover.css +41 -41
  159. package/dist/components/popover/popover.d.ts +66 -25
  160. package/dist/components/popover/popover.js +332 -217
  161. package/dist/components/popover/popover.module.js +15 -19
  162. package/dist/components/radio-group-field/radio-group-field.js +80 -71
  163. package/dist/components/radio-group-field/radio-group.css +112 -60
  164. package/dist/components/radio-group-field/radio-group.d.ts +19 -3
  165. package/dist/components/radio-group-field/radio-group.js +66 -23
  166. package/dist/components/radio-group-field/radio-group.module.js +4 -4
  167. package/dist/components/segmented-control-field/segmented-control-field.d.ts +1 -1
  168. package/dist/components/segmented-control-field/segmented-control-field.js +111 -96
  169. package/dist/components/segmented-control-field/segmented-control.css +132 -79
  170. package/dist/components/segmented-control-field/segmented-control.d.ts +39 -15
  171. package/dist/components/segmented-control-field/segmented-control.js +124 -41
  172. package/dist/components/segmented-control-field/segmented-control.module.js +4 -4
  173. package/dist/components/select-field/select.css +214 -101
  174. package/dist/components/select-field/select.d.ts +43 -11
  175. package/dist/components/select-field/select.js +194 -109
  176. package/dist/components/select-field/select.module.js +14 -14
  177. package/dist/components/skeleton/skeleton.css +4 -4
  178. package/dist/components/skeleton/skeleton.module.js +3 -3
  179. package/dist/components/stale/stale.css +15 -15
  180. package/dist/components/stale/stale.d.ts +27 -3
  181. package/dist/components/stale/stale.js +147 -66
  182. package/dist/components/stale/stale.module.js +6 -6
  183. package/dist/components/status-message/status-message.css +22 -22
  184. package/dist/components/status-message/status-message.module.js +6 -6
  185. package/dist/components/switch-field/switch-field.js +77 -57
  186. package/dist/components/switch-field/switch.css +112 -63
  187. package/dist/components/switch-field/switch.d.ts +20 -3
  188. package/dist/components/switch-field/switch.js +70 -27
  189. package/dist/components/switch-field/switch.module.js +4 -4
  190. package/dist/components/tabs/tabs.css +32 -32
  191. package/dist/components/tabs/tabs.d.ts +21 -7
  192. package/dist/components/tabs/tabs.js +73 -14
  193. package/dist/components/tabs/tabs.module.js +7 -7
  194. package/dist/components/tag/tag.css +84 -84
  195. package/dist/components/tag/tag.module.js +3 -3
  196. package/dist/components/tag-group/tag-group.css +94 -94
  197. package/dist/components/tag-group/tag-group.module.js +4 -4
  198. package/dist/components/text-field/text-field.css +159 -82
  199. package/dist/components/text-field/text-field.d.ts +1 -1
  200. package/dist/components/text-field/text-field.js +139 -110
  201. package/dist/components/text-field/text-field.module.js +9 -9
  202. package/dist/components/text-field/text-input.d.ts +81 -45
  203. package/dist/components/text-field/text-input.js +366 -217
  204. package/dist/components/textarea-field/textarea-field.css +7 -2
  205. package/dist/components/textarea-field/textarea-field.js +72 -56
  206. package/dist/components/textarea-field/textarea-field.module.js +2 -2
  207. package/dist/components/time-field/time-field.js +153 -60
  208. package/dist/components/time-field/time-input.d.ts +21 -10
  209. package/dist/components/time-field/time-input.js +22 -11
  210. package/dist/components/toast/toast-provider.css +34 -31
  211. package/dist/components/toast/toast-provider.d.ts +63 -14
  212. package/dist/components/toast/toast-provider.js +174 -111
  213. package/dist/components/toast/toast-provider.module.js +7 -7
  214. package/dist/components/toggle-group-field/toggle-group-field.d.ts +1 -1
  215. package/dist/components/toggle-group-field/toggle-group-field.js +95 -89
  216. package/dist/components/toggle-group-field/toggle-group.css +117 -67
  217. package/dist/components/toggle-group-field/toggle-group.d.ts +2 -2
  218. package/dist/components/toggle-group-field/toggle-group.js +2 -2
  219. package/dist/components/toggle-group-field/toggle-group.module.js +2 -2
  220. package/dist/components/tooltip/tooltip.css +4 -4
  221. package/dist/components/tooltip/tooltip.module.js +1 -1
  222. package/dist/data-table/data-table-content.js +6 -5
  223. package/dist/data-table/data-table-parts.d.ts +41 -13
  224. package/dist/data-table/data-table-parts.js +213 -172
  225. package/dist/data-table/data-table-selection.d.ts +105 -3
  226. package/dist/data-table/data-table-selection.js +654 -145
  227. package/dist/data-table/data-table.css +125 -128
  228. package/dist/data-table/data-table.d.ts +21 -26
  229. package/dist/data-table/data-table.js +20 -23
  230. package/dist/data-table/data-table.module.js +32 -34
  231. package/dist/data-table/index.d.ts +2 -2
  232. package/dist/index.js +3 -3
  233. package/dist/lib/calendar/calendar-navigation.d.ts +39 -5
  234. package/dist/lib/calendar/calendar-navigation.js +185 -118
  235. package/dist/lib/calendar/calendar-parts.d.ts +143 -0
  236. package/dist/lib/calendar/calendar-parts.js +540 -0
  237. package/dist/lib/calendar/calendar-prefab.d.ts +52 -0
  238. package/dist/lib/calendar/calendar-prefab.js +311 -0
  239. package/dist/lib/calendar/calendar-year.d.ts +3 -1
  240. package/dist/lib/calendar/calendar-year.js +139 -131
  241. package/dist/lib/calendar/temporal.css +325 -232
  242. package/dist/lib/calendar/temporal.d.ts +67 -82
  243. package/dist/lib/calendar/temporal.js +258 -569
  244. package/dist/lib/calendar/temporal.module.js +38 -38
  245. package/dist/lib/forms/use-connected-field.d.ts +1 -1
  246. package/dist/lib/forms/use-connected-field.js +1 -1
  247. package/dist/lib/render-as.d.ts +13 -0
  248. package/dist/lib/render-as.js +46 -0
  249. package/dist/tokens.css +6 -3
  250. package/package.json +1 -1
  251. package/tokens/dark.tokens.json +6 -0
  252. package/tokens/sys.tokens.json +7 -0
  253. package/dist/components/button/close-button.d.ts +0 -16
  254. package/dist/components/button/close-button.js +0 -30
@@ -1,4 +1,8 @@
1
+ import { TemporalCalendar } from "../../lib/calendar/calendar-prefab.js";
1
2
  import { dayToIso, isoToDay } from "../../lib/calendar/temporal-value.js";
3
+ import { Spinner } from "../spinner/spinner.js";
4
+ import { IconButton } from "../button/button.js";
5
+ import { Field } from "../field/field.js";
2
6
  import { useFieldState } from "../field/use-field-state.js";
3
7
  import { useTimeZone } from "../time-zone-provider/time-zone-provider.js";
4
8
  import { DateInput } from "./date-input.js";
@@ -29,7 +33,7 @@ import { useRef } from "react";
29
33
  * />
30
34
  */
31
35
  var DateField = (t0) => {
32
- const $ = c(49);
36
+ const $ = c(80);
33
37
  const { label, description, errors, requiredness, optionalLabel, dirty, touched, pending, openCalendarLabel, previousMonthLabel, nextMonthLabel, monthLabel, yearLabel, noMatchingYearLabel, openCalendarIcon, previousIcon, nextIcon, checkIcon, expandIcon, value, defaultValue, onValueChange, onBlur, minValue, maxValue, name, disabled, readOnly, className } = t0;
34
38
  const triggerRef = useRef(null);
35
39
  const timeZone = useTimeZone();
@@ -67,110 +71,208 @@ var DateField = (t0) => {
67
71
  const field = useFieldState(t3);
68
72
  const { phase } = field;
69
73
  const fieldState = field.state;
70
- let t4;
71
- if ($[12] !== checkIcon || $[13] !== day || $[14] !== defaultValue || $[15] !== expandIcon || $[16] !== field.disabled || $[17] !== field.invalid || $[18] !== fieldState || $[19] !== maxValue || $[20] !== minValue || $[21] !== monthLabel || $[22] !== name || $[23] !== nextIcon || $[24] !== nextMonthLabel || $[25] !== noMatchingYearLabel || $[26] !== onBlur || $[27] !== onValueChange || $[28] !== openCalendarIcon || $[29] !== openCalendarLabel || $[30] !== phase || $[31] !== previousIcon || $[32] !== previousMonthLabel || $[33] !== readOnly || $[34] !== requiredness || $[35] !== timeZone || $[36] !== value || $[37] !== yearLabel) {
72
- t4 = (t5) => {
73
- const { labelId, describedBy, controlId } = t5;
74
- return /* @__PURE__ */ jsx(DateInput.Root, {
75
- state: fieldState,
76
- "aria-labelledby": labelId,
77
- "aria-describedby": describedBy,
78
- value: value === void 0 ? void 0 : day,
79
- defaultValue: isoToDay(defaultValue, timeZone) ?? void 0,
80
- onChange: (next) => onValueChange?.(dayToIso(next)),
81
- onBlur,
82
- minValue: isoToDay(minValue, timeZone) ?? void 0,
83
- maxValue: isoToDay(maxValue, timeZone) ?? void 0,
84
- name: name ?? controlId,
85
- isDisabled: field.disabled,
86
- isReadOnly: readOnly,
87
- isRequired: requiredness === "required",
88
- isInvalid: field.invalid,
89
- children: (t6) => {
90
- const { isFocusWithin } = t6;
91
- return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(DateInput.Group, {
92
- state: {
93
- ...fieldState,
94
- focused: isFocusWithin
95
- },
96
- children: [
97
- /* @__PURE__ */ jsx(DateInput.Input, {}),
98
- phase !== "fresh" && /* @__PURE__ */ jsx(DateInput.Pending, {}),
99
- /* @__PURE__ */ jsx(DateInput.Trigger, {
100
- label: openCalendarLabel,
101
- ref: triggerRef,
102
- children: openCalendarIcon
103
- })
104
- ]
105
- }), /* @__PURE__ */ jsx(DateInput.Popup, {
106
- triggerRef,
107
- children: /* @__PURE__ */ jsx(DateInput.Calendar, {
108
- previousMonthLabel,
109
- nextMonthLabel,
110
- monthLabel,
111
- yearLabel,
112
- noMatchingYearLabel,
113
- previousIcon,
114
- nextIcon,
115
- checkIcon,
116
- expandIcon
74
+ const ids = DateInput.useIds();
75
+ const t4 = field.invalid;
76
+ const t5 = field.disabled;
77
+ let t6;
78
+ if ($[12] !== optionalLabel) {
79
+ t6 = /* @__PURE__ */ jsx(Field.Requiredness, { optionalLabel });
80
+ $[12] = optionalLabel;
81
+ $[13] = t6;
82
+ } else t6 = $[13];
83
+ let t7;
84
+ if ($[14] !== ids.labelId || $[15] !== label || $[16] !== t6) {
85
+ t7 = /* @__PURE__ */ jsxs(DateInput.Label, {
86
+ id: ids.labelId,
87
+ children: [
88
+ label,
89
+ " ",
90
+ t6
91
+ ]
92
+ });
93
+ $[14] = ids.labelId;
94
+ $[15] = label;
95
+ $[16] = t6;
96
+ $[17] = t7;
97
+ } else t7 = $[17];
98
+ const t8 = ids.labelId;
99
+ let t9;
100
+ if ($[18] !== description || $[19] !== field.invalid || $[20] !== ids) {
101
+ t9 = ids.describedBy(description !== void 0, field.invalid);
102
+ $[18] = description;
103
+ $[19] = field.invalid;
104
+ $[20] = ids;
105
+ $[21] = t9;
106
+ } else t9 = $[21];
107
+ const t10 = value === void 0 ? void 0 : day;
108
+ let t11;
109
+ if ($[22] !== defaultValue || $[23] !== timeZone) {
110
+ t11 = isoToDay(defaultValue, timeZone) ?? void 0;
111
+ $[22] = defaultValue;
112
+ $[23] = timeZone;
113
+ $[24] = t11;
114
+ } else t11 = $[24];
115
+ let t12;
116
+ if ($[25] !== onValueChange) {
117
+ t12 = (next) => onValueChange?.(dayToIso(next));
118
+ $[25] = onValueChange;
119
+ $[26] = t12;
120
+ } else t12 = $[26];
121
+ let t13;
122
+ if ($[27] !== minValue || $[28] !== timeZone) {
123
+ t13 = isoToDay(minValue, timeZone) ?? void 0;
124
+ $[27] = minValue;
125
+ $[28] = timeZone;
126
+ $[29] = t13;
127
+ } else t13 = $[29];
128
+ let t14;
129
+ if ($[30] !== maxValue || $[31] !== timeZone) {
130
+ t14 = isoToDay(maxValue, timeZone) ?? void 0;
131
+ $[30] = maxValue;
132
+ $[31] = timeZone;
133
+ $[32] = t14;
134
+ } else t14 = $[32];
135
+ const t15 = name ?? ids.controlId;
136
+ const t16 = requiredness === "required";
137
+ let t17;
138
+ if ($[33] !== checkIcon || $[34] !== expandIcon || $[35] !== fieldState || $[36] !== monthLabel || $[37] !== nextIcon || $[38] !== nextMonthLabel || $[39] !== noMatchingYearLabel || $[40] !== openCalendarIcon || $[41] !== openCalendarLabel || $[42] !== phase || $[43] !== previousIcon || $[44] !== previousMonthLabel || $[45] !== yearLabel) {
139
+ t17 = (t18) => {
140
+ const { isFocusWithin } = t18;
141
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(DateInput.Group, {
142
+ state: {
143
+ ...fieldState,
144
+ focused: isFocusWithin
145
+ },
146
+ children: [
147
+ /* @__PURE__ */ jsx(DateInput.Input, { children: _temp }),
148
+ phase !== "fresh" && /* @__PURE__ */ jsx(DateInput.Pending, { children: /* @__PURE__ */ jsx(Spinner, { size: 1 }) }),
149
+ /* @__PURE__ */ jsx(DateInput.Trigger, {
150
+ ref: triggerRef,
151
+ render: /* @__PURE__ */ jsx(IconButton, {
152
+ label: openCalendarLabel,
153
+ variant: "tertiary",
154
+ size: "sm",
155
+ children: openCalendarIcon
117
156
  })
118
- })] });
119
- }
120
- });
157
+ })
158
+ ]
159
+ }), /* @__PURE__ */ jsx(DateInput.Popup, {
160
+ triggerRef,
161
+ children: /* @__PURE__ */ jsx(TemporalCalendar, {
162
+ previousMonthLabel,
163
+ nextMonthLabel,
164
+ monthLabel,
165
+ yearLabel,
166
+ noMatchingYearLabel,
167
+ previousIcon,
168
+ nextIcon,
169
+ checkIcon,
170
+ expandIcon
171
+ })
172
+ })] });
121
173
  };
122
- $[12] = checkIcon;
123
- $[13] = day;
124
- $[14] = defaultValue;
125
- $[15] = expandIcon;
126
- $[16] = field.disabled;
127
- $[17] = field.invalid;
128
- $[18] = fieldState;
129
- $[19] = maxValue;
130
- $[20] = minValue;
131
- $[21] = monthLabel;
132
- $[22] = name;
133
- $[23] = nextIcon;
134
- $[24] = nextMonthLabel;
135
- $[25] = noMatchingYearLabel;
136
- $[26] = onBlur;
137
- $[27] = onValueChange;
138
- $[28] = openCalendarIcon;
139
- $[29] = openCalendarLabel;
140
- $[30] = phase;
141
- $[31] = previousIcon;
142
- $[32] = previousMonthLabel;
143
- $[33] = readOnly;
144
- $[34] = requiredness;
145
- $[35] = timeZone;
146
- $[36] = value;
147
- $[37] = yearLabel;
148
- $[38] = t4;
149
- } else t4 = $[38];
150
- let t5;
151
- if ($[39] !== className || $[40] !== description || $[41] !== dirty || $[42] !== errors || $[43] !== label || $[44] !== optionalLabel || $[45] !== requiredness || $[46] !== t4 || $[47] !== touched) {
152
- t5 = /* @__PURE__ */ jsx(DateInput.Frame, {
153
- label,
154
- description,
155
- errors,
174
+ $[33] = checkIcon;
175
+ $[34] = expandIcon;
176
+ $[35] = fieldState;
177
+ $[36] = monthLabel;
178
+ $[37] = nextIcon;
179
+ $[38] = nextMonthLabel;
180
+ $[39] = noMatchingYearLabel;
181
+ $[40] = openCalendarIcon;
182
+ $[41] = openCalendarLabel;
183
+ $[42] = phase;
184
+ $[43] = previousIcon;
185
+ $[44] = previousMonthLabel;
186
+ $[45] = yearLabel;
187
+ $[46] = t17;
188
+ } else t17 = $[46];
189
+ let t18;
190
+ if ($[47] !== field.disabled || $[48] !== field.invalid || $[49] !== fieldState || $[50] !== ids.labelId || $[51] !== onBlur || $[52] !== readOnly || $[53] !== t10 || $[54] !== t11 || $[55] !== t12 || $[56] !== t13 || $[57] !== t14 || $[58] !== t15 || $[59] !== t16 || $[60] !== t17 || $[61] !== t9) {
191
+ t18 = /* @__PURE__ */ jsx(DateInput.Root, {
192
+ state: fieldState,
193
+ "aria-labelledby": t8,
194
+ "aria-describedby": t9,
195
+ value: t10,
196
+ defaultValue: t11,
197
+ onChange: t12,
198
+ onBlur,
199
+ minValue: t13,
200
+ maxValue: t14,
201
+ name: t15,
202
+ isDisabled: field.disabled,
203
+ isReadOnly: readOnly,
204
+ isRequired: t16,
205
+ isInvalid: field.invalid,
206
+ children: t17
207
+ });
208
+ $[47] = field.disabled;
209
+ $[48] = field.invalid;
210
+ $[49] = fieldState;
211
+ $[50] = ids.labelId;
212
+ $[51] = onBlur;
213
+ $[52] = readOnly;
214
+ $[53] = t10;
215
+ $[54] = t11;
216
+ $[55] = t12;
217
+ $[56] = t13;
218
+ $[57] = t14;
219
+ $[58] = t15;
220
+ $[59] = t16;
221
+ $[60] = t17;
222
+ $[61] = t9;
223
+ $[62] = t18;
224
+ } else t18 = $[62];
225
+ let t19;
226
+ if ($[63] !== description || $[64] !== ids.descriptionId) {
227
+ t19 = /* @__PURE__ */ jsx(DateInput.Description, {
228
+ id: ids.descriptionId,
229
+ children: description
230
+ });
231
+ $[63] = description;
232
+ $[64] = ids.descriptionId;
233
+ $[65] = t19;
234
+ } else t19 = $[65];
235
+ let t20;
236
+ if ($[66] !== errors || $[67] !== ids.errorId) {
237
+ t20 = /* @__PURE__ */ jsx(DateInput.Error, {
238
+ id: ids.errorId,
239
+ children: errors
240
+ });
241
+ $[66] = errors;
242
+ $[67] = ids.errorId;
243
+ $[68] = t20;
244
+ } else t20 = $[68];
245
+ let t21;
246
+ if ($[69] !== className || $[70] !== dirty || $[71] !== field.disabled || $[72] !== field.invalid || $[73] !== requiredness || $[74] !== t18 || $[75] !== t19 || $[76] !== t20 || $[77] !== t7 || $[78] !== touched) {
247
+ t21 = /* @__PURE__ */ jsxs(Field.Root, {
248
+ className,
249
+ invalid: t4,
250
+ disabled: t5,
156
251
  requiredness,
157
- optionalLabel,
158
252
  dirty,
159
253
  touched,
160
- className,
161
- children: t4
254
+ children: [
255
+ t7,
256
+ t18,
257
+ t19,
258
+ t20
259
+ ]
162
260
  });
163
- $[39] = className;
164
- $[40] = description;
165
- $[41] = dirty;
166
- $[42] = errors;
167
- $[43] = label;
168
- $[44] = optionalLabel;
169
- $[45] = requiredness;
170
- $[46] = t4;
171
- $[47] = touched;
172
- $[48] = t5;
173
- } else t5 = $[48];
174
- return t5;
261
+ $[69] = className;
262
+ $[70] = dirty;
263
+ $[71] = field.disabled;
264
+ $[72] = field.invalid;
265
+ $[73] = requiredness;
266
+ $[74] = t18;
267
+ $[75] = t19;
268
+ $[76] = t20;
269
+ $[77] = t7;
270
+ $[78] = touched;
271
+ $[79] = t21;
272
+ } else t21 = $[79];
273
+ return t21;
175
274
  };
275
+ function _temp(segment) {
276
+ return /* @__PURE__ */ jsx(DateInput.Segment, { segment });
277
+ }
176
278
  export { DateField };
@@ -1,7 +1,10 @@
1
+ import { TemporalCalendar } from "../../lib/calendar/calendar-prefab.tsx";
1
2
  import type { CalendarDate } from "@internationalized/date";
2
- import { type ReactNode, type Ref } from "react";
3
+ import { type ReactNode } from "react";
3
4
  import { type DatePickerProps as AriaDatePickerProps } from "react-aria-components";
4
- import { TemporalCalendar, TemporalFrame, TemporalGroup, TemporalInput, TemporalPopup, type TemporalStateProps } from "../../lib/calendar/temporal.tsx";
5
+ import { CalendarMonthPicker, CalendarPickers, CalendarYearPicker } from "../../lib/calendar/calendar-navigation.tsx";
6
+ import { CalendarCell, CalendarGrid, CalendarGridBody, CalendarGridHeader, CalendarHeader, CalendarHeaderCell, CalendarHeading, CalendarNext, CalendarPrevious, CalendarRoot } from "../../lib/calendar/calendar-parts.tsx";
7
+ import { TemporalDialog, TemporalGroup, TemporalInput, TemporalLabel, TemporalPopover, TemporalPopup, TemporalSegment, type TemporalStateProps, TemporalTrigger } from "../../lib/calendar/temporal.tsx";
5
8
  import { Field } from "../field/index.ts";
6
9
  export type DateInputRootProps = AriaDatePickerProps<CalendarDate> & TemporalStateProps;
7
10
  /**
@@ -12,52 +15,85 @@ export type DateInputRootProps = AriaDatePickerProps<CalendarDate> & TemporalSta
12
15
  * <DateInput.Root aria-labelledby={labelId}>…</DateInput.Root>
13
16
  */
14
17
  declare const DateInputRoot: ({ state, ...props }: DateInputRootProps) => ReactNode;
15
- export type DateInputTriggerProps = Readonly<{
16
- /** Accessible name, such as "Open calendar". */
17
- label: string;
18
- ref?: Ref<HTMLButtonElement>;
19
- /** The icon the button shows. */
20
- children: ReactNode;
21
- }>;
22
- /**
23
- * The icon-only button that opens the calendar.
24
- *
25
- * @example
26
- * <DateInput.Trigger label="Open calendar"><CalendarTodayIcon /></DateInput.Trigger>
27
- */
28
- declare const DateInputTrigger: ({ label, ref, children, }: DateInputTriggerProps) => ReactNode;
29
18
  /** The parts of a date input. */
30
19
  export type DateInputParts = Readonly<{
31
- Frame: typeof TemporalFrame;
32
20
  Root: typeof DateInputRoot;
21
+ Label: typeof TemporalLabel;
33
22
  Group: typeof TemporalGroup;
34
23
  Input: typeof TemporalInput;
35
- Trigger: typeof DateInputTrigger;
36
- Popup: typeof TemporalPopup;
37
- Calendar: typeof TemporalCalendar;
24
+ Segment: typeof TemporalSegment;
25
+ Trigger: typeof TemporalTrigger;
38
26
  Pending: typeof Field.Pending;
27
+ Popup: typeof TemporalPopup;
28
+ Popover: typeof TemporalPopover;
29
+ Dialog: typeof TemporalDialog;
30
+ Calendar: typeof CalendarRoot;
31
+ StandardCalendar: typeof TemporalCalendar;
32
+ CalendarHeader: typeof CalendarHeader;
33
+ Heading: typeof CalendarHeading;
34
+ Previous: typeof CalendarPrevious;
35
+ Next: typeof CalendarNext;
36
+ Pickers: typeof CalendarPickers;
37
+ MonthPicker: typeof CalendarMonthPicker;
38
+ YearPicker: typeof CalendarYearPicker;
39
+ Grid: typeof CalendarGrid;
40
+ GridHeader: typeof CalendarGridHeader;
41
+ HeaderCell: typeof CalendarHeaderCell;
42
+ GridBody: typeof CalendarGridBody;
43
+ Cell: typeof CalendarCell;
44
+ Description: typeof Field.Description;
45
+ Error: typeof Field.Error;
46
+ useIds: typeof Field.useIds;
39
47
  }>;
40
48
  /**
41
49
  * The styled parts of a react-aria `DatePicker`, a date entry plus a calendar
42
- * popover, carrying the field frame's ids rather than a label of their own.
43
- * For the ordinary case, use `DateField`.
50
+ * popover, following react-aria's own anatomy. It sits in a `Field.Root` and
51
+ * names itself through `Label`'s id. For the ordinary case, use `DateField`,
52
+ * which is assembled from exactly these parts. `StandardCalendar` is the whole
53
+ * calendar, its header, pickers and grid, assembled from them.
44
54
  *
45
55
  * @example
46
- * <DateInput.Root aria-labelledby={labelId}>
47
- * {({ isFocusWithin }) => (
48
- * <>
49
- * <DateInput.Group state={{ focused: isFocusWithin }}>
50
- * <DateInput.Input />
51
- * <DateInput.Trigger label="Open calendar">
52
- * <CalendarTodayIcon />
53
- * </DateInput.Trigger>
54
- * </DateInput.Group>
55
- * <DateInput.Popup>
56
- * <DateInput.Calendar {...calendarLabels} {...calendarIcons} />
57
- * </DateInput.Popup>
58
- * </>
59
- * )}
60
- * </DateInput.Root>
56
+ * const ids = DateInput.useIds();
57
+ *
58
+ * <Field.Root>
59
+ * <DateInput.Label id={ids.labelId}>Service date</DateInput.Label>
60
+ * <DateInput.Root aria-labelledby={ids.labelId}>
61
+ * {({ isFocusWithin }) => (
62
+ * <>
63
+ * <DateInput.Group state={{ focused: isFocusWithin }}>
64
+ * <DateInput.Input>
65
+ * {segment => <DateInput.Segment segment={segment} />}
66
+ * </DateInput.Input>
67
+ * <DateInput.Trigger
68
+ * ref={triggerRef}
69
+ * render={
70
+ * <IconButton label="Open calendar" variant="tertiary" size="sm">
71
+ * <CalendarTodayIcon />
72
+ * </IconButton>
73
+ * }
74
+ * />
75
+ * </DateInput.Group>
76
+ * <DateInput.Popup triggerRef={triggerRef}>
77
+ * <DateInput.Calendar>
78
+ * <DateInput.CalendarHeader>
79
+ * <DateInput.Previous render={<IconButton label="Previous month"><ChevronLeftIcon /></IconButton>} />
80
+ * <DateInput.Heading />
81
+ * <DateInput.Next render={<IconButton label="Next month"><ChevronRightIcon /></IconButton>} />
82
+ * </DateInput.CalendarHeader>
83
+ * <DateInput.Grid>
84
+ * <DateInput.GridHeader>
85
+ * {day => <DateInput.HeaderCell>{day}</DateInput.HeaderCell>}
86
+ * </DateInput.GridHeader>
87
+ * <DateInput.GridBody>
88
+ * {date => <DateInput.Cell date={date} />}
89
+ * </DateInput.GridBody>
90
+ * </DateInput.Grid>
91
+ * </DateInput.Calendar>
92
+ * </DateInput.Popup>
93
+ * </>
94
+ * )}
95
+ * </DateInput.Root>
96
+ * </Field.Root>
61
97
  */
62
98
  export declare const DateInput: DateInputParts;
63
99
  export {};
@@ -1,5 +1,8 @@
1
+ import { TemporalCalendar } from "../../lib/calendar/calendar-prefab.js";
2
+ import { CalendarMonthPicker, CalendarPickers, CalendarYearPicker } from "../../lib/calendar/calendar-navigation.js";
3
+ import { CalendarCell as CalendarCell$1, CalendarGrid as CalendarGrid$1, CalendarGridBody as CalendarGridBody$1, CalendarGridHeader as CalendarGridHeader$1, CalendarHeader, CalendarHeaderCell as CalendarHeaderCell$1, CalendarHeading, CalendarNext, CalendarPrevious, CalendarRoot } from "../../lib/calendar/calendar-parts.js";
1
4
  import { todayIn } from "../../lib/calendar/temporal-value.js";
2
- import { TemporalCalendar, TemporalFrame, TemporalGroup, TemporalInput, TemporalPopup, TemporalTrigger } from "../../lib/calendar/temporal.js";
5
+ import { TemporalDialog, TemporalGroup, TemporalInput, TemporalLabel, TemporalPopover, TemporalPopup, TemporalSegment, TemporalTrigger } from "../../lib/calendar/temporal.js";
3
6
  import { Field } from "../field/field.js";
4
7
  import { fieldStateAttributes } from "../field/field-state.js";
5
8
  import { useTimeZone } from "../time-zone-provider/time-zone-provider.js";
@@ -67,58 +70,82 @@ var DateInputRoot = (t0) => {
67
70
  return t6;
68
71
  };
69
72
  /**
70
- * The icon-only button that opens the calendar.
71
- *
72
- * @example
73
- * <DateInput.Trigger label="Open calendar"><CalendarTodayIcon /></DateInput.Trigger>
74
- */
75
- var DateInputTrigger = (t0) => {
76
- const $ = c(4);
77
- const { label, ref, children } = t0;
78
- let t1;
79
- if ($[0] !== children || $[1] !== label || $[2] !== ref) {
80
- t1 = /* @__PURE__ */ jsx(TemporalTrigger, {
81
- label,
82
- ref,
83
- children
84
- });
85
- $[0] = children;
86
- $[1] = label;
87
- $[2] = ref;
88
- $[3] = t1;
89
- } else t1 = $[3];
90
- return t1;
91
- };
92
- /**
93
73
  * The styled parts of a react-aria `DatePicker`, a date entry plus a calendar
94
- * popover, carrying the field frame's ids rather than a label of their own.
95
- * For the ordinary case, use `DateField`.
74
+ * popover, following react-aria's own anatomy. It sits in a `Field.Root` and
75
+ * names itself through `Label`'s id. For the ordinary case, use `DateField`,
76
+ * which is assembled from exactly these parts. `StandardCalendar` is the whole
77
+ * calendar, its header, pickers and grid, assembled from them.
96
78
  *
97
79
  * @example
98
- * <DateInput.Root aria-labelledby={labelId}>
99
- * {({ isFocusWithin }) => (
100
- * <>
101
- * <DateInput.Group state={{ focused: isFocusWithin }}>
102
- * <DateInput.Input />
103
- * <DateInput.Trigger label="Open calendar">
104
- * <CalendarTodayIcon />
105
- * </DateInput.Trigger>
106
- * </DateInput.Group>
107
- * <DateInput.Popup>
108
- * <DateInput.Calendar {...calendarLabels} {...calendarIcons} />
109
- * </DateInput.Popup>
110
- * </>
111
- * )}
112
- * </DateInput.Root>
80
+ * const ids = DateInput.useIds();
81
+ *
82
+ * <Field.Root>
83
+ * <DateInput.Label id={ids.labelId}>Service date</DateInput.Label>
84
+ * <DateInput.Root aria-labelledby={ids.labelId}>
85
+ * {({ isFocusWithin }) => (
86
+ * <>
87
+ * <DateInput.Group state={{ focused: isFocusWithin }}>
88
+ * <DateInput.Input>
89
+ * {segment => <DateInput.Segment segment={segment} />}
90
+ * </DateInput.Input>
91
+ * <DateInput.Trigger
92
+ * ref={triggerRef}
93
+ * render={
94
+ * <IconButton label="Open calendar" variant="tertiary" size="sm">
95
+ * <CalendarTodayIcon />
96
+ * </IconButton>
97
+ * }
98
+ * />
99
+ * </DateInput.Group>
100
+ * <DateInput.Popup triggerRef={triggerRef}>
101
+ * <DateInput.Calendar>
102
+ * <DateInput.CalendarHeader>
103
+ * <DateInput.Previous render={<IconButton label="Previous month"><ChevronLeftIcon /></IconButton>} />
104
+ * <DateInput.Heading />
105
+ * <DateInput.Next render={<IconButton label="Next month"><ChevronRightIcon /></IconButton>} />
106
+ * </DateInput.CalendarHeader>
107
+ * <DateInput.Grid>
108
+ * <DateInput.GridHeader>
109
+ * {day => <DateInput.HeaderCell>{day}</DateInput.HeaderCell>}
110
+ * </DateInput.GridHeader>
111
+ * <DateInput.GridBody>
112
+ * {date => <DateInput.Cell date={date} />}
113
+ * </DateInput.GridBody>
114
+ * </DateInput.Grid>
115
+ * </DateInput.Calendar>
116
+ * </DateInput.Popup>
117
+ * </>
118
+ * )}
119
+ * </DateInput.Root>
120
+ * </Field.Root>
113
121
  */
114
122
  var DateInput$1 = {
115
- Frame: TemporalFrame,
116
123
  Root: DateInputRoot,
124
+ Label: TemporalLabel,
117
125
  Group: TemporalGroup,
118
126
  Input: TemporalInput,
119
- Trigger: DateInputTrigger,
127
+ Segment: TemporalSegment,
128
+ Trigger: TemporalTrigger,
129
+ Pending: Field.Pending,
120
130
  Popup: TemporalPopup,
121
- Calendar: TemporalCalendar,
122
- Pending: Field.Pending
131
+ Popover: TemporalPopover,
132
+ Dialog: TemporalDialog,
133
+ Calendar: CalendarRoot,
134
+ StandardCalendar: TemporalCalendar,
135
+ CalendarHeader,
136
+ Heading: CalendarHeading,
137
+ Previous: CalendarPrevious,
138
+ Next: CalendarNext,
139
+ Pickers: CalendarPickers,
140
+ MonthPicker: CalendarMonthPicker,
141
+ YearPicker: CalendarYearPicker,
142
+ Grid: CalendarGrid$1,
143
+ GridHeader: CalendarGridHeader$1,
144
+ HeaderCell: CalendarHeaderCell$1,
145
+ GridBody: CalendarGridBody$1,
146
+ Cell: CalendarCell$1,
147
+ Description: Field.Description,
148
+ Error: Field.Error,
149
+ useIds: Field.useIds
123
150
  };
124
151
  export { DateInput$1 as DateInput };
@@ -1,4 +1,4 @@
1
- export type { CalendarIcons, CalendarLabels, } from "../../lib/calendar/temporal.tsx";
1
+ export type { CalendarIcons, CalendarLabels, } from "../../lib/calendar/calendar-prefab.tsx";
2
2
  export * from "./date-field.tsx";
3
3
  export * from "./date-input.tsx";
4
4
  export * from "./tsf-date-field.tsx";
@@ -1,5 +1,5 @@
1
1
  import { type ReactNode } from "react";
2
- import type { CalendarIcons, CalendarLabels } from "../../lib/calendar/temporal.tsx";
2
+ import { type CalendarIcons, type CalendarLabels } from "../../lib/calendar/calendar-prefab.tsx";
3
3
  import { type IsoDateRange } from "../../lib/calendar/temporal-value.ts";
4
4
  import { type FieldBlurHandler, type FieldProps } from "../field/index.ts";
5
5
  export type DateRangeFieldProps = FieldProps & CalendarLabels & CalendarIcons & Readonly<{