@igne-agency/react-web-ui 0.3.0 → 0.4.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 (292) hide show
  1. package/README.md +32 -1
  2. package/dist/components/accordion/accordion.css +24 -19
  3. package/dist/components/accordion/accordion.d.ts +19 -3
  4. package/dist/components/accordion/accordion.js +86 -32
  5. package/dist/components/accordion/accordion.module.js +8 -8
  6. package/dist/components/active-filters/active-filter-describers.d.ts +1 -1
  7. package/dist/components/active-filters/active-filter-describers.js +1 -1
  8. package/dist/components/active-filters/active-filters.d.ts +35 -2
  9. package/dist/components/active-filters/active-filters.js +57 -52
  10. package/dist/components/active-filters/index.js +2 -2
  11. package/dist/components/attachment-tile/attachment-preview.d.ts +11 -9
  12. package/dist/components/attachment-tile/attachment-preview.js +102 -68
  13. package/dist/components/attachment-tile/attachment-tile.css +22 -13
  14. package/dist/components/attachment-tile/attachment-tile.d.ts +51 -6
  15. package/dist/components/attachment-tile/attachment-tile.js +209 -85
  16. package/dist/components/attachment-tile/attachment-tile.module.js +10 -10
  17. package/dist/components/attachment-tile/index.d.ts +1 -1
  18. package/dist/components/attachment-tile/index.js +2 -2
  19. package/dist/components/avatar/avatar.d.ts +5 -5
  20. package/dist/components/avatar/avatar.js +64 -37
  21. package/dist/components/avatar-group/avatar-group.js +2 -2
  22. package/dist/components/badge/badge.js +1 -1
  23. package/dist/components/breadcrumbs/breadcrumbs.d.ts +22 -7
  24. package/dist/components/breadcrumbs/breadcrumbs.js +189 -170
  25. package/dist/components/button/button.d.ts +2 -3
  26. package/dist/components/button/button.js +58 -77
  27. package/dist/components/button/close-button.d.ts +4 -2
  28. package/dist/components/button/close-button.js +9 -9
  29. package/dist/components/checkbox-field/checkbox-field.d.ts +17 -3
  30. package/dist/components/checkbox-field/checkbox-field.js +108 -131
  31. package/dist/components/checkbox-field/checkbox.css +26 -34
  32. package/dist/components/checkbox-field/checkbox.d.ts +51 -8
  33. package/dist/components/checkbox-field/checkbox.js +221 -57
  34. package/dist/components/checkbox-field/checkbox.module.js +6 -8
  35. package/dist/components/checkbox-field/index.d.ts +0 -1
  36. package/dist/components/checkbox-field/index.js +1 -2
  37. package/dist/components/checkbox-field/tsf-checkbox-field.d.ts +2 -2
  38. package/dist/components/checkbox-group-field/checkbox-group-field.d.ts +4 -1
  39. package/dist/components/checkbox-group-field/checkbox-group-field.js +54 -50
  40. package/dist/components/checkbox-group-field/checkbox-group.d.ts +7 -2
  41. package/dist/components/checkbox-group-field/checkbox-group.js +8 -3
  42. package/dist/components/collapsible/collapsible.css +23 -18
  43. package/dist/components/collapsible/collapsible.d.ts +18 -3
  44. package/dist/components/collapsible/collapsible.js +85 -32
  45. package/dist/components/collapsible/collapsible.module.js +7 -7
  46. package/dist/components/combobox-field/combobox-field.d.ts +9 -1
  47. package/dist/components/combobox-field/combobox-field.js +195 -175
  48. package/dist/components/combobox-field/combobox-items.d.ts +2 -2
  49. package/dist/components/combobox-field/combobox-items.js +4 -4
  50. package/dist/components/combobox-field/combobox.css +99 -96
  51. package/dist/components/combobox-field/combobox.d.ts +94 -15
  52. package/dist/components/combobox-field/combobox.js +484 -159
  53. package/dist/components/combobox-field/combobox.module.js +21 -21
  54. package/dist/components/combobox-field/index.d.ts +0 -1
  55. package/dist/components/combobox-field/selection.d.ts +4 -1
  56. package/dist/components/combobox-field/value-state-view.css +7 -3
  57. package/dist/components/combobox-field/value-state-view.d.ts +4 -2
  58. package/dist/components/combobox-field/value-state-view.js +15 -15
  59. package/dist/components/combobox-field/value-state-view.module.js +6 -4
  60. package/dist/components/composer/composer-attachments.d.ts +11 -3
  61. package/dist/components/composer/composer-attachments.js +61 -47
  62. package/dist/components/composer/composer-editor.d.ts +2 -1
  63. package/dist/components/composer/composer-editor.js +79 -71
  64. package/dist/components/composer/composer-mentions.js +2 -2
  65. package/dist/components/composer/composer.d.ts +42 -21
  66. package/dist/components/composer/composer.js +201 -58
  67. package/dist/components/composer/mention-text.js +3 -3
  68. package/dist/components/confirm-dialog/confirm-dialog.d.ts +8 -7
  69. package/dist/components/confirm-dialog/confirm-dialog.js +10 -9
  70. package/dist/components/conversation/conversation.context.d.ts +0 -5
  71. package/dist/components/conversation/conversation.d.ts +63 -29
  72. package/dist/components/conversation/conversation.js +193 -82
  73. package/dist/components/conversation/index.d.ts +1 -1
  74. package/dist/components/date-field/date-field.d.ts +10 -4
  75. package/dist/components/date-field/date-field.js +57 -43
  76. package/dist/components/date-field/date-input.d.ts +20 -3
  77. package/dist/components/date-field/date-input.js +28 -13
  78. package/dist/components/date-field/index.d.ts +1 -1
  79. package/dist/components/date-field/tsf-date-field.d.ts +1 -1
  80. package/dist/components/date-field/tsf-date-field.js +1 -1
  81. package/dist/components/date-range-field/date-range-field.d.ts +8 -4
  82. package/dist/components/date-range-field/date-range-field.js +57 -45
  83. package/dist/components/date-range-field/date-range-input.d.ts +20 -3
  84. package/dist/components/date-range-field/date-range-input.js +27 -12
  85. package/dist/components/date-range-field/tsf-date-range-field.d.ts +1 -1
  86. package/dist/components/date-range-field/tsf-date-range-field.js +1 -1
  87. package/dist/components/detail-list/detail-list.d.ts +28 -27
  88. package/dist/components/detail-list/detail-list.js +177 -121
  89. package/dist/components/dialog/dialog.d.ts +47 -27
  90. package/dist/components/dialog/dialog.js +101 -38
  91. package/dist/components/divider/divider.js +1 -1
  92. package/dist/components/drawer/drawer.d.ts +48 -30
  93. package/dist/components/drawer/drawer.js +113 -41
  94. package/dist/components/email-field/email-field.d.ts +5 -3
  95. package/dist/components/email-field/email-field.js +1 -3
  96. package/dist/components/email-field/tsf-email-field.d.ts +3 -2
  97. package/dist/components/empty-message/empty-message.d.ts +3 -3
  98. package/dist/components/empty-message/empty-message.js +3 -3
  99. package/dist/components/error-boundary/error-boundary.d.ts +5 -2
  100. package/dist/components/error-boundary/error-boundary.js +2 -3
  101. package/dist/components/error-message/error-message.d.ts +1 -1
  102. package/dist/components/error-message/error-message.js +1 -1
  103. package/dist/components/error-text/error-text.js +3 -3
  104. package/dist/components/field/field.d.ts +5 -5
  105. package/dist/components/field/field.js +9 -9
  106. package/dist/components/field/index.js +2 -2
  107. package/dist/components/field/input-parts.js +1 -1
  108. package/dist/components/field-placeholder/field-placeholder.d.ts +4 -1
  109. package/dist/components/field-placeholder/field-placeholder.js +41 -26
  110. package/dist/components/fieldset/field-group.js +1 -1
  111. package/dist/components/fieldset/fieldset-root.js +1 -1
  112. package/dist/components/fieldset/fieldset.css +4 -3
  113. package/dist/components/fieldset/fieldset.js +1 -1
  114. package/dist/components/fieldset/fieldset.module.js +2 -2
  115. package/dist/components/file-field/file-field.css +19 -15
  116. package/dist/components/file-field/file-field.d.ts +10 -1
  117. package/dist/components/file-field/file-field.js +130 -109
  118. package/dist/components/file-field/file-field.module.js +6 -4
  119. package/dist/components/file-field/file-input.d.ts +32 -9
  120. package/dist/components/file-field/file-input.js +94 -74
  121. package/dist/components/filter-bar/filter-bar.d.ts +79 -51
  122. package/dist/components/filter-bar/filter-bar.js +552 -216
  123. package/dist/components/form/form.d.ts +4 -6
  124. package/dist/components/form/form.js +6 -8
  125. package/dist/components/icon/icon.d.ts +5 -10
  126. package/dist/components/icon/icon.js +4 -6
  127. package/dist/components/link/link.js +1 -1
  128. package/dist/components/link-button/link-button.d.ts +1 -2
  129. package/dist/components/link-button/link-button.js +12 -22
  130. package/dist/components/loading-message/loading-message.d.ts +2 -2
  131. package/dist/components/loading-message/loading-message.js +1 -1
  132. package/dist/components/locale-provider/locale-provider.js +1 -1
  133. package/dist/components/menu/menu.d.ts +40 -22
  134. package/dist/components/menu/menu.js +100 -40
  135. package/dist/components/nav/nav-context.d.ts +0 -1
  136. package/dist/components/nav/nav-context.js +1 -2
  137. package/dist/components/nav/nav-item-view.d.ts +7 -7
  138. package/dist/components/nav/nav-item-view.js +27 -51
  139. package/dist/components/nav/nav.css +72 -60
  140. package/dist/components/nav/nav.d.ts +15 -8
  141. package/dist/components/nav/nav.js +105 -52
  142. package/dist/components/nav/nav.module.js +14 -14
  143. package/dist/components/number-field/number-field.d.ts +7 -1
  144. package/dist/components/number-field/number-field.js +98 -82
  145. package/dist/components/number-field/number-input.d.ts +53 -4
  146. package/dist/components/number-field/number-input.js +68 -21
  147. package/dist/components/number-field/tsf-number-field.d.ts +1 -1
  148. package/dist/components/number-field/tsf-number-field.js +1 -1
  149. package/dist/components/otp-field/otp-input.d.ts +25 -0
  150. package/dist/components/otp-field/otp-input.js +26 -1
  151. package/dist/components/pagination/pagination.d.ts +82 -23
  152. package/dist/components/pagination/pagination.js +656 -229
  153. package/dist/components/password-field/password-field.d.ts +7 -1
  154. package/dist/components/password-field/password-field.js +117 -126
  155. package/dist/components/password-field/password-strength.js +1 -1
  156. package/dist/components/password-field/tsf-password-field.d.ts +1 -1
  157. package/dist/components/password-field/tsf-password-field.js +1 -1
  158. package/dist/components/photo-field/photo-field.d.ts +17 -3
  159. package/dist/components/photo-field/photo-field.js +168 -89
  160. package/dist/components/photo-field/photo-input-context.d.ts +25 -0
  161. package/dist/components/photo-field/photo-input-context.js +14 -0
  162. package/dist/components/photo-field/photo-input.d.ts +58 -23
  163. package/dist/components/photo-field/photo-input.js +459 -261
  164. package/dist/components/popover/popover.d.ts +55 -23
  165. package/dist/components/popover/popover.js +205 -61
  166. package/dist/components/radio-group-field/radio-group.js +1 -1
  167. package/dist/components/search-field/search-field.d.ts +7 -5
  168. package/dist/components/search-field/search-field.js +4 -6
  169. package/dist/components/search-field/tsf-search-field.d.ts +1 -1
  170. package/dist/components/search-field/tsf-search-field.js +1 -1
  171. package/dist/components/segmented-control-field/segmented-control.js +1 -1
  172. package/dist/components/select-field/select-field.d.ts +7 -1
  173. package/dist/components/select-field/select-field.js +151 -139
  174. package/dist/components/select-field/select.d.ts +28 -6
  175. package/dist/components/select-field/select.js +234 -149
  176. package/dist/components/skeleton/skeleton.js +1 -1
  177. package/dist/components/spinner/spinner.css +47 -1
  178. package/dist/components/spinner/spinner.js +28 -11
  179. package/dist/components/spinner/spinner.module.js +18 -3
  180. package/dist/components/stale/stale.d.ts +17 -21
  181. package/dist/components/stale/stale.js +307 -129
  182. package/dist/components/status-message/status-message.css +22 -21
  183. package/dist/components/status-message/status-message.d.ts +10 -5
  184. package/dist/components/status-message/status-message.js +20 -24
  185. package/dist/components/status-message/status-message.module.js +6 -6
  186. package/dist/components/status-message/status-preset.d.ts +4 -5
  187. package/dist/components/status-message/status-preset.js +3 -3
  188. package/dist/components/switch-field/switch.js +1 -1
  189. package/dist/components/tabs/tabs.d.ts +51 -28
  190. package/dist/components/tabs/tabs.js +219 -144
  191. package/dist/components/tag/tag.css +23 -21
  192. package/dist/components/tag/tag.d.ts +17 -15
  193. package/dist/components/tag/tag.js +140 -65
  194. package/dist/components/tag/tag.module.js +3 -3
  195. package/dist/components/tag-group/tag-group.css +30 -27
  196. package/dist/components/tag-group/tag-group.d.ts +10 -4
  197. package/dist/components/tag-group/tag-group.js +47 -35
  198. package/dist/components/tag-group/tag-group.module.js +4 -4
  199. package/dist/components/text-field/text-field.d.ts +14 -3
  200. package/dist/components/text-field/text-field.js +154 -133
  201. package/dist/components/text-field/text-input.d.ts +89 -3
  202. package/dist/components/text-field/text-input.js +184 -70
  203. package/dist/components/textarea-field/textarea.js +1 -1
  204. package/dist/components/time-field/time-input.d.ts +6 -0
  205. package/dist/components/time-field/time-input.js +6 -0
  206. package/dist/components/time-zone-provider/time-zone-provider.js +1 -1
  207. package/dist/components/toast/index.js +2 -2
  208. package/dist/components/toast/toast-provider.css +38 -34
  209. package/dist/components/toast/toast-provider.d.ts +65 -3
  210. package/dist/components/toast/toast-provider.js +313 -148
  211. package/dist/components/toast/toast-provider.module.js +11 -17
  212. package/dist/components/toast/toast.d.ts +5 -1
  213. package/dist/components/toast/toast.js +2 -1
  214. package/dist/components/toggle-group-field/toggle-group.js +1 -1
  215. package/dist/components/tooltip/tooltip.d.ts +6 -6
  216. package/dist/components/tooltip/tooltip.js +7 -7
  217. package/dist/data-table/data-table-content.d.ts +18 -10
  218. package/dist/data-table/data-table-content.js +145 -290
  219. package/dist/data-table/data-table-context.d.ts +4 -2
  220. package/dist/data-table/data-table-context.js +1 -1
  221. package/dist/data-table/data-table-parts.d.ts +99 -0
  222. package/dist/data-table/data-table-parts.js +1182 -0
  223. package/dist/data-table/data-table-selection.d.ts +7 -3
  224. package/dist/data-table/data-table-selection.js +62 -37
  225. package/dist/data-table/data-table.css +100 -95
  226. package/dist/data-table/data-table.d.ts +49 -25
  227. package/dist/data-table/data-table.js +95 -83
  228. package/dist/data-table/data-table.module.js +34 -34
  229. package/dist/data-table/index.d.ts +2 -1
  230. package/dist/data-table/index.js +2 -1
  231. package/dist/data-view/use-data-view.d.ts +2 -2
  232. package/dist/data-view/use-data-view.js +2 -2
  233. package/dist/index.js +7 -8
  234. package/dist/lib/calendar/calendar-navigation.d.ts +9 -2
  235. package/dist/lib/calendar/calendar-navigation.js +72 -73
  236. package/dist/lib/calendar/calendar-year.d.ts +4 -3
  237. package/dist/lib/calendar/calendar-year.js +137 -156
  238. package/dist/lib/calendar/temporal.d.ts +18 -12
  239. package/dist/lib/calendar/temporal.js +191 -147
  240. package/dist/lib/table-storage.d.ts +2 -2
  241. package/dist/lib/table-storage.js +2 -2
  242. package/dist/lib/unsaved-changes/leave-guard.js +1 -1
  243. package/dist/terrazzo/index.d.ts +16 -0
  244. package/dist/terrazzo/index.js +94 -2
  245. package/dist/tokens.css +71 -69
  246. package/package.json +3 -2
  247. package/tokens/ref.tokens.json +0 -30
  248. package/tokens/sys.tokens.json +0 -7
  249. package/dist/assets/spinner.js +0 -28
  250. package/dist/components/checkbox-field/checkbox-glyph.d.ts +0 -12
  251. package/dist/components/checkbox-field/checkbox-glyph.js +0 -38
  252. package/dist/components/combobox-field/combobox-popup-body.d.ts +0 -34
  253. package/dist/components/combobox-field/combobox-popup-body.js +0 -142
  254. package/dist/components/conversation/conversation.context.js +0 -4
  255. package/dist/vendor/@material-design-icons/svg/outlined/add.js +0 -12
  256. package/dist/vendor/@material-design-icons/svg/outlined/arrow_downward.js +0 -12
  257. package/dist/vendor/@material-design-icons/svg/outlined/arrow_forward.js +0 -12
  258. package/dist/vendor/@material-design-icons/svg/outlined/arrow_upward.js +0 -12
  259. package/dist/vendor/@material-design-icons/svg/outlined/attach_file.js +0 -12
  260. package/dist/vendor/@material-design-icons/svg/outlined/block.js +0 -12
  261. package/dist/vendor/@material-design-icons/svg/outlined/calendar_today.js +0 -12
  262. package/dist/vendor/@material-design-icons/svg/outlined/check.js +0 -12
  263. package/dist/vendor/@material-design-icons/svg/outlined/check_circle.js +0 -12
  264. package/dist/vendor/@material-design-icons/svg/outlined/chevron_left.js +0 -12
  265. package/dist/vendor/@material-design-icons/svg/outlined/chevron_right.js +0 -12
  266. package/dist/vendor/@material-design-icons/svg/outlined/close.js +0 -12
  267. package/dist/vendor/@material-design-icons/svg/outlined/content_copy.js +0 -12
  268. package/dist/vendor/@material-design-icons/svg/outlined/date_range.js +0 -12
  269. package/dist/vendor/@material-design-icons/svg/outlined/description.js +0 -12
  270. package/dist/vendor/@material-design-icons/svg/outlined/download.js +0 -12
  271. package/dist/vendor/@material-design-icons/svg/outlined/error.js +0 -12
  272. package/dist/vendor/@material-design-icons/svg/outlined/error_outline.js +0 -12
  273. package/dist/vendor/@material-design-icons/svg/outlined/expand_less.js +0 -12
  274. package/dist/vendor/@material-design-icons/svg/outlined/expand_more.js +0 -12
  275. package/dist/vendor/@material-design-icons/svg/outlined/filter_alt.js +0 -12
  276. package/dist/vendor/@material-design-icons/svg/outlined/filter_alt_off.js +0 -12
  277. package/dist/vendor/@material-design-icons/svg/outlined/first_page.js +0 -12
  278. package/dist/vendor/@material-design-icons/svg/outlined/info.js +0 -12
  279. package/dist/vendor/@material-design-icons/svg/outlined/keyboard_arrow_down.js +0 -12
  280. package/dist/vendor/@material-design-icons/svg/outlined/last_page.js +0 -12
  281. package/dist/vendor/@material-design-icons/svg/outlined/mail.js +0 -12
  282. package/dist/vendor/@material-design-icons/svg/outlined/more_horiz.js +0 -12
  283. package/dist/vendor/@material-design-icons/svg/outlined/photo_camera.js +0 -12
  284. package/dist/vendor/@material-design-icons/svg/outlined/remove.js +0 -12
  285. package/dist/vendor/@material-design-icons/svg/outlined/restart_alt.js +0 -12
  286. package/dist/vendor/@material-design-icons/svg/outlined/restore.js +0 -12
  287. package/dist/vendor/@material-design-icons/svg/outlined/search.js +0 -12
  288. package/dist/vendor/@material-design-icons/svg/outlined/unfold_more.js +0 -12
  289. package/dist/vendor/@material-design-icons/svg/outlined/upload_file.js +0 -12
  290. package/dist/vendor/@material-design-icons/svg/outlined/visibility.js +0 -12
  291. package/dist/vendor/@material-design-icons/svg/outlined/visibility_off.js +0 -12
  292. package/dist/vendor/@material-design-icons/svg/outlined/warning_amber.js +0 -12
@@ -1,4 +1,19 @@
1
1
  import './spinner.css';// src/components/spinner/spinner.module.scss
2
- var spinner = "_spinner_1old1_3";
3
- var spinner_module_default = { spinner };
4
- export { spinner_module_default as default, spinner };
2
+ var spinner = "_spinner_1ojim_27";
3
+ var ring = "_ring_1ojim_31";
4
+ var arc = "_arc_1ojim_34";
5
+ var loadingPulse = "_loading-pulse_1ojim_1";
6
+ var spinnerTurn = "_spinner-turn_1ojim_1";
7
+ var spinnerSweep = "_spinner-sweep_1ojim_1";
8
+ var spinner_module_default = {
9
+ spinner,
10
+ ring,
11
+ arc,
12
+ "loading-pulse": "_loading-pulse_1ojim_1",
13
+ loadingPulse,
14
+ "spinner-turn": "_spinner-turn_1ojim_1",
15
+ spinnerTurn,
16
+ "spinner-sweep": "_spinner-sweep_1ojim_1",
17
+ spinnerSweep
18
+ };
19
+ export { arc, spinner_module_default as default, loadingPulse, ring, spinner, spinnerSweep, spinnerTurn };
@@ -1,5 +1,6 @@
1
- import { type ReactNode } from "react";
2
- export type StaleRootProps = Readonly<{
1
+ import { useRender } from "@base-ui/react/use-render";
2
+ import { type ComponentProps, type ReactElement, type ReactNode } from "react";
3
+ export type StaleRootProps = useRender.ComponentProps<"div"> & Readonly<{
3
4
  /** Whether a background refresh is in flight. */
4
5
  busy: boolean;
5
6
  /** Ms of `busy` before anything is shown at all. @default 150 */
@@ -13,35 +14,30 @@ export type StaleRootProps = Readonly<{
13
14
  slowAfter?: number;
14
15
  /** Ms of `busy` before the retry appears. @default 8000 */
15
16
  stuckAfter?: number;
16
- children?: ReactNode;
17
- className?: string;
18
17
  }>;
19
- export type StaleContentProps = Readonly<{
20
- children?: ReactNode;
21
- className?: string;
22
- }>;
23
- export type StaleOverlayProps = Readonly<{
24
- children?: ReactNode;
25
- className?: string;
26
- }>;
27
- export type StaleMessageProps = Readonly<{
18
+ export type StaleContentProps = useRender.ComponentProps<"div">;
19
+ export type StaleOverlayProps = useRender.ComponentProps<"div">;
20
+ export type StaleMessageProps = useRender.ComponentProps<"p"> & Readonly<{
28
21
  /** The moving indicator above the copy, such as the app's animated logo. @default <Spinner size={2} /> */
29
22
  illustration?: ReactNode;
30
23
  /** What the overlay says, such as "This is taking longer than usual." */
31
24
  children: ReactNode;
32
- className?: string;
33
25
  }>;
34
- export type StaleRetryProps = Readonly<{
26
+ export type StaleRetryProps = Omit<ComponentProps<"button">, "ref" | "children" | "onClick"> & Readonly<{
35
27
  onRetry: () => void;
36
28
  /** The retry's label, such as "Try again". */
37
29
  children: ReactNode;
38
- className?: string;
39
30
  }>;
40
- declare const Root: ({ busy, busyAfter, busyMinDuration, slowAfter, stuckAfter, children, className, }: StaleRootProps) => ReactNode;
41
- declare const Content: ({ children, className, }: StaleContentProps) => ReactNode;
42
- declare const Overlay: ({ children, className, }: StaleOverlayProps) => ReactNode;
43
- declare const Message: ({ illustration, children, className, }: StaleMessageProps) => ReactNode;
44
- declare const Retry: ({ onRetry, children, className, }: StaleRetryProps) => ReactNode;
31
+ /** The region that refreshes, holding how long the refresh has run in its `data-phase`. */
32
+ declare const Root: ({ busy, busyAfter, busyMinDuration, slowAfter, stuckAfter, render, className, ref, ...props }: StaleRootProps) => ReactNode;
33
+ /** The content that stays on screen: dimmed and busy once the refresh is seen, inert once overlaid. */
34
+ declare const Content: ({ render, className, ref, ...props }: StaleContentProps) => ReactElement;
35
+ /** What covers the content once the refresh is slow, fading in and out. */
36
+ declare const Overlay: ({ render, className, ref, ...props }: StaleOverlayProps) => ReactElement | null;
37
+ /** The overlay's status: a moving indicator over its copy. */
38
+ declare const Message: ({ illustration, render, className, ref, children, ...props }: StaleMessageProps) => ReactElement;
39
+ /** The way out once the refresh looks stuck: a button that appears only then. */
40
+ declare const Retry: ({ onRetry, children, className, ...props }: StaleRetryProps) => ReactNode;
45
41
  type StaleNamespace = Readonly<{
46
42
  Root: typeof Root;
47
43
  Content: typeof Content;
@@ -5,20 +5,53 @@ import { Button } from "../button/button.js";
5
5
  import { Spinner } from "../spinner/spinner.js";
6
6
  import stale_module_default from "./stale.module.js";
7
7
  import { c } from "react/compiler-runtime";
8
- import { createContext, useRef } from "react";
9
- import { jsx, jsxs } from "react/jsx-runtime";
8
+ import { useRender } from "@base-ui/react/use-render";
10
9
  import { clsx } from "clsx";
10
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
11
+ import { createContext, useRef } from "react";
11
12
  // src/components/stale/stale.tsx
12
13
  var StaleContext = createContext(null);
13
14
  var usePhase = () => {
14
15
  return useRequiredContext(StaleContext, "Stale.* must be rendered inside <Stale.Root>.");
15
16
  };
16
17
  var isOverlaid = (phase) => phase === "slow" || phase === "stuck";
18
+ /** The region that refreshes, holding how long the refresh has run in its `data-phase`. */
17
19
  var Root = (t0) => {
18
- const $ = c(15);
19
- const { busy, busyAfter, busyMinDuration, slowAfter, stuckAfter, children, className } = t0;
20
+ const $ = c(29);
21
+ let busy;
22
+ let busyAfter;
23
+ let busyMinDuration;
24
+ let className;
25
+ let props;
26
+ let ref;
27
+ let render;
28
+ let slowAfter;
29
+ let stuckAfter;
30
+ if ($[0] !== t0) {
31
+ ({busy, busyAfter, busyMinDuration, slowAfter, stuckAfter, render, className, ref, ...props} = t0);
32
+ $[0] = t0;
33
+ $[1] = busy;
34
+ $[2] = busyAfter;
35
+ $[3] = busyMinDuration;
36
+ $[4] = className;
37
+ $[5] = props;
38
+ $[6] = ref;
39
+ $[7] = render;
40
+ $[8] = slowAfter;
41
+ $[9] = stuckAfter;
42
+ } else {
43
+ busy = $[1];
44
+ busyAfter = $[2];
45
+ busyMinDuration = $[3];
46
+ className = $[4];
47
+ props = $[5];
48
+ ref = $[6];
49
+ render = $[7];
50
+ slowAfter = $[8];
51
+ stuckAfter = $[9];
52
+ }
20
53
  let t1;
21
- if ($[0] !== busy || $[1] !== busyAfter || $[2] !== busyMinDuration || $[3] !== slowAfter || $[4] !== stuckAfter) {
54
+ if ($[10] !== busy || $[11] !== busyAfter || $[12] !== busyMinDuration || $[13] !== slowAfter || $[14] !== stuckAfter) {
22
55
  t1 = {
23
56
  busy,
24
57
  busyAfter,
@@ -26,184 +59,329 @@ var Root = (t0) => {
26
59
  slowAfter,
27
60
  stuckAfter
28
61
  };
29
- $[0] = busy;
30
- $[1] = busyAfter;
31
- $[2] = busyMinDuration;
32
- $[3] = slowAfter;
33
- $[4] = stuckAfter;
34
- $[5] = t1;
35
- } else t1 = $[5];
62
+ $[10] = busy;
63
+ $[11] = busyAfter;
64
+ $[12] = busyMinDuration;
65
+ $[13] = slowAfter;
66
+ $[14] = stuckAfter;
67
+ $[15] = t1;
68
+ } else t1 = $[15];
36
69
  const phase = useBusyPhase(t1);
37
70
  let t2;
38
- if ($[6] !== className) {
71
+ if ($[16] !== className) {
39
72
  t2 = clsx(stale_module_default.root, className);
40
- $[6] = className;
41
- $[7] = t2;
42
- } else t2 = $[7];
73
+ $[16] = className;
74
+ $[17] = t2;
75
+ } else t2 = $[17];
43
76
  let t3;
44
- if ($[8] !== children || $[9] !== phase || $[10] !== t2) {
45
- t3 = /* @__PURE__ */ jsx("div", {
46
- className: t2,
77
+ if ($[18] !== phase || $[19] !== props || $[20] !== t2) {
78
+ t3 = {
79
+ ...props,
47
80
  "data-phase": phase,
48
- children
49
- });
50
- $[8] = children;
51
- $[9] = phase;
52
- $[10] = t2;
53
- $[11] = t3;
54
- } else t3 = $[11];
81
+ className: t2
82
+ };
83
+ $[18] = phase;
84
+ $[19] = props;
85
+ $[20] = t2;
86
+ $[21] = t3;
87
+ } else t3 = $[21];
55
88
  let t4;
56
- if ($[12] !== phase || $[13] !== t3) {
57
- t4 = /* @__PURE__ */ jsx(StaleContext, {
89
+ if ($[22] !== ref || $[23] !== render || $[24] !== t3) {
90
+ t4 = {
91
+ defaultTagName: "div",
92
+ render,
93
+ ref,
94
+ props: t3
95
+ };
96
+ $[22] = ref;
97
+ $[23] = render;
98
+ $[24] = t3;
99
+ $[25] = t4;
100
+ } else t4 = $[25];
101
+ const element = useRender(t4);
102
+ let t5;
103
+ if ($[26] !== element || $[27] !== phase) {
104
+ t5 = /* @__PURE__ */ jsx(StaleContext, {
58
105
  value: phase,
59
- children: t3
106
+ children: element
60
107
  });
61
- $[12] = phase;
62
- $[13] = t3;
63
- $[14] = t4;
64
- } else t4 = $[14];
65
- return t4;
108
+ $[26] = element;
109
+ $[27] = phase;
110
+ $[28] = t5;
111
+ } else t5 = $[28];
112
+ return t5;
66
113
  };
114
+ /** The content that stays on screen: dimmed and busy once the refresh is seen, inert once overlaid. */
67
115
  var Content = (t0) => {
68
- const $ = c(10);
69
- const { children, className } = t0;
116
+ const $ = c(19);
117
+ let className;
118
+ let props;
119
+ let ref;
120
+ let render;
121
+ if ($[0] !== t0) {
122
+ ({render, className, ref, ...props} = t0);
123
+ $[0] = t0;
124
+ $[1] = className;
125
+ $[2] = props;
126
+ $[3] = ref;
127
+ $[4] = render;
128
+ } else {
129
+ className = $[1];
130
+ props = $[2];
131
+ ref = $[3];
132
+ render = $[4];
133
+ }
70
134
  const phase = usePhase();
71
135
  const busy = phase !== "fresh";
72
- let t1;
73
- if ($[0] !== className) {
74
- t1 = clsx(stale_module_default.content, className);
75
- $[0] = className;
76
- $[1] = t1;
77
- } else t1 = $[1];
136
+ const t1 = busy || void 0;
78
137
  const t2 = busy || void 0;
79
- const t3 = busy || void 0;
138
+ let t3;
139
+ if ($[5] !== phase) {
140
+ t3 = isOverlaid(phase);
141
+ $[5] = phase;
142
+ $[6] = t3;
143
+ } else t3 = $[6];
80
144
  let t4;
81
- if ($[2] !== phase) {
82
- t4 = isOverlaid(phase);
83
- $[2] = phase;
84
- $[3] = t4;
85
- } else t4 = $[3];
86
- let t5;
87
- if ($[4] !== children || $[5] !== t1 || $[6] !== t2 || $[7] !== t3 || $[8] !== t4) {
88
- t5 = /* @__PURE__ */ jsx("div", {
89
- className: t1,
90
- "data-busy": t2,
91
- "aria-busy": t3,
92
- inert: t4,
93
- children
94
- });
95
- $[4] = children;
96
- $[5] = t1;
97
- $[6] = t2;
98
- $[7] = t3;
145
+ if ($[7] !== className) {
146
+ t4 = clsx(stale_module_default.content, className);
147
+ $[7] = className;
99
148
  $[8] = t4;
100
- $[9] = t5;
101
- } else t5 = $[9];
102
- return t5;
149
+ } else t4 = $[8];
150
+ let t5;
151
+ if ($[9] !== props || $[10] !== t1 || $[11] !== t2 || $[12] !== t3 || $[13] !== t4) {
152
+ t5 = {
153
+ ...props,
154
+ "data-busy": t1,
155
+ "aria-busy": t2,
156
+ inert: t3,
157
+ className: t4
158
+ };
159
+ $[9] = props;
160
+ $[10] = t1;
161
+ $[11] = t2;
162
+ $[12] = t3;
163
+ $[13] = t4;
164
+ $[14] = t5;
165
+ } else t5 = $[14];
166
+ let t6;
167
+ if ($[15] !== ref || $[16] !== render || $[17] !== t5) {
168
+ t6 = {
169
+ defaultTagName: "div",
170
+ render,
171
+ ref,
172
+ props: t5
173
+ };
174
+ $[15] = ref;
175
+ $[16] = render;
176
+ $[17] = t5;
177
+ $[18] = t6;
178
+ } else t6 = $[18];
179
+ return useRender(t6);
103
180
  };
181
+ /** What covers the content once the refresh is slow, fading in and out. */
104
182
  var Overlay = (t0) => {
105
- const $ = c(8);
106
- const { children, className } = t0;
183
+ const $ = c(20);
184
+ let className;
185
+ let props;
186
+ let ref;
187
+ let render;
188
+ if ($[0] !== t0) {
189
+ ({render, className, ref, ...props} = t0);
190
+ $[0] = t0;
191
+ $[1] = className;
192
+ $[2] = props;
193
+ $[3] = ref;
194
+ $[4] = render;
195
+ } else {
196
+ className = $[1];
197
+ props = $[2];
198
+ ref = $[3];
199
+ render = $[4];
200
+ }
107
201
  const phase = usePhase();
108
202
  const overlayRef = useRef(null);
109
203
  let t1;
110
- if ($[0] !== phase) {
204
+ if ($[5] !== phase) {
111
205
  t1 = isOverlaid(phase);
112
- $[0] = phase;
113
- $[1] = t1;
114
- } else t1 = $[1];
206
+ $[5] = phase;
207
+ $[6] = t1;
208
+ } else t1 = $[6];
115
209
  const presence = usePresence(t1, overlayRef);
116
- if (!presence.mounted) return null;
117
210
  let t2;
118
- if ($[2] !== className) {
119
- t2 = clsx(stale_module_default.overlay, className);
120
- $[2] = className;
121
- $[3] = t2;
122
- } else t2 = $[3];
123
- let t3;
124
- if ($[4] !== children || $[5] !== presence.props || $[6] !== t2) {
125
- t3 = /* @__PURE__ */ jsx("div", {
126
- ref: overlayRef,
127
- className: t2,
128
- ...presence.props,
129
- children
130
- });
131
- $[4] = children;
132
- $[5] = presence.props;
133
- $[6] = t2;
134
- $[7] = t3;
135
- } else t3 = $[7];
136
- return t3;
211
+ if ($[7] !== ref) {
212
+ t2 = ref === void 0 ? overlayRef : [overlayRef, ref];
213
+ $[7] = ref;
214
+ $[8] = t2;
215
+ } else t2 = $[8];
216
+ const t3 = presence.mounted;
217
+ const t4 = presence.props;
218
+ let t5;
219
+ if ($[9] !== className) {
220
+ t5 = clsx(stale_module_default.overlay, className);
221
+ $[9] = className;
222
+ $[10] = t5;
223
+ } else t5 = $[10];
224
+ let t6;
225
+ if ($[11] !== presence.props || $[12] !== props || $[13] !== t5) {
226
+ t6 = {
227
+ ...props,
228
+ ...t4,
229
+ className: t5
230
+ };
231
+ $[11] = presence.props;
232
+ $[12] = props;
233
+ $[13] = t5;
234
+ $[14] = t6;
235
+ } else t6 = $[14];
236
+ let t7;
237
+ if ($[15] !== presence.mounted || $[16] !== render || $[17] !== t2 || $[18] !== t6) {
238
+ t7 = {
239
+ defaultTagName: "div",
240
+ render,
241
+ ref: t2,
242
+ enabled: t3,
243
+ props: t6
244
+ };
245
+ $[15] = presence.mounted;
246
+ $[16] = render;
247
+ $[17] = t2;
248
+ $[18] = t6;
249
+ $[19] = t7;
250
+ } else t7 = $[19];
251
+ return useRender(t7);
137
252
  };
253
+ /** The overlay's status: a moving indicator over its copy. */
138
254
  var Message = (t0) => {
139
- const $ = c(10);
140
- const { illustration, children, className } = t0;
255
+ const $ = c(24);
256
+ let children;
257
+ let className;
258
+ let illustration;
259
+ let props;
260
+ let ref;
261
+ let render;
262
+ if ($[0] !== t0) {
263
+ ({illustration, render, className, ref, children, ...props} = t0);
264
+ $[0] = t0;
265
+ $[1] = children;
266
+ $[2] = className;
267
+ $[3] = illustration;
268
+ $[4] = props;
269
+ $[5] = ref;
270
+ $[6] = render;
271
+ } else {
272
+ children = $[1];
273
+ className = $[2];
274
+ illustration = $[3];
275
+ props = $[4];
276
+ ref = $[5];
277
+ render = $[6];
278
+ }
141
279
  let t1;
142
- if ($[0] !== className) {
280
+ if ($[7] !== className) {
143
281
  t1 = clsx(stale_module_default.message, className);
144
- $[0] = className;
145
- $[1] = t1;
146
- } else t1 = $[1];
282
+ $[7] = className;
283
+ $[8] = t1;
284
+ } else t1 = $[8];
147
285
  let t2;
148
- if ($[2] !== illustration) {
286
+ if ($[9] !== illustration) {
149
287
  t2 = illustration ?? /* @__PURE__ */ jsx(Spinner, { size: 2 });
150
- $[2] = illustration;
151
- $[3] = t2;
152
- } else t2 = $[3];
288
+ $[9] = illustration;
289
+ $[10] = t2;
290
+ } else t2 = $[10];
153
291
  let t3;
154
- if ($[4] !== t2) {
292
+ if ($[11] !== t2) {
155
293
  t3 = /* @__PURE__ */ jsx("span", {
156
294
  className: stale_module_default.illustration,
157
295
  "aria-hidden": "true",
158
296
  children: t2
159
297
  });
160
- $[4] = t2;
161
- $[5] = t3;
162
- } else t3 = $[5];
298
+ $[11] = t2;
299
+ $[12] = t3;
300
+ } else t3 = $[12];
163
301
  let t4;
164
- if ($[6] !== children || $[7] !== t1 || $[8] !== t3) {
165
- t4 = /* @__PURE__ */ jsxs("p", {
166
- className: t1,
302
+ if ($[13] !== children || $[14] !== t3) {
303
+ t4 = /* @__PURE__ */ jsxs(Fragment, { children: [t3, children] });
304
+ $[13] = children;
305
+ $[14] = t3;
306
+ $[15] = t4;
307
+ } else t4 = $[15];
308
+ let t5;
309
+ if ($[16] !== props || $[17] !== t1 || $[18] !== t4) {
310
+ t5 = {
167
311
  role: "status",
168
- children: [t3, children]
169
- });
170
- $[6] = children;
171
- $[7] = t1;
172
- $[8] = t3;
173
- $[9] = t4;
174
- } else t4 = $[9];
175
- return t4;
312
+ ...props,
313
+ className: t1,
314
+ children: t4
315
+ };
316
+ $[16] = props;
317
+ $[17] = t1;
318
+ $[18] = t4;
319
+ $[19] = t5;
320
+ } else t5 = $[19];
321
+ let t6;
322
+ if ($[20] !== ref || $[21] !== render || $[22] !== t5) {
323
+ t6 = {
324
+ defaultTagName: "p",
325
+ render,
326
+ ref,
327
+ props: t5
328
+ };
329
+ $[20] = ref;
330
+ $[21] = render;
331
+ $[22] = t5;
332
+ $[23] = t6;
333
+ } else t6 = $[23];
334
+ return useRender(t6);
176
335
  };
336
+ /** The way out once the refresh looks stuck: a button that appears only then. */
177
337
  var Retry = (t0) => {
178
- const $ = c(7);
179
- const { onRetry, children, className } = t0;
338
+ const $ = c(13);
339
+ let children;
340
+ let className;
341
+ let onRetry;
342
+ let props;
343
+ if ($[0] !== t0) {
344
+ ({onRetry, children, className, ...props} = t0);
345
+ $[0] = t0;
346
+ $[1] = children;
347
+ $[2] = className;
348
+ $[3] = onRetry;
349
+ $[4] = props;
350
+ } else {
351
+ children = $[1];
352
+ className = $[2];
353
+ onRetry = $[3];
354
+ props = $[4];
355
+ }
180
356
  const phase = usePhase();
181
357
  const retryRef = useRef(null);
182
358
  const presence = usePresence(phase === "stuck", retryRef);
183
359
  if (!presence.mounted) return null;
184
360
  let t1;
185
- if ($[0] !== className) {
361
+ if ($[5] !== className) {
186
362
  t1 = clsx(stale_module_default.retry, className);
187
- $[0] = className;
188
- $[1] = t1;
189
- } else t1 = $[1];
363
+ $[5] = className;
364
+ $[6] = t1;
365
+ } else t1 = $[6];
190
366
  let t2;
191
- if ($[2] !== children || $[3] !== onRetry || $[4] !== presence.props || $[5] !== t1) {
367
+ if ($[7] !== children || $[8] !== onRetry || $[9] !== presence.props || $[10] !== props || $[11] !== t1) {
192
368
  t2 = /* @__PURE__ */ jsx(Button, {
193
- ref: retryRef,
194
369
  variant: "tertiary",
195
370
  size: "sm",
371
+ ...props,
372
+ ref: retryRef,
196
373
  onClick: onRetry,
197
374
  className: t1,
198
375
  ...presence.props,
199
376
  children
200
377
  });
201
- $[2] = children;
202
- $[3] = onRetry;
203
- $[4] = presence.props;
204
- $[5] = t1;
205
- $[6] = t2;
206
- } else t2 = $[6];
378
+ $[7] = children;
379
+ $[8] = onRetry;
380
+ $[9] = presence.props;
381
+ $[10] = props;
382
+ $[11] = t1;
383
+ $[12] = t2;
384
+ } else t2 = $[12];
207
385
  return t2;
208
386
  };
209
387
  /**