@igne-agency/react-web-ui 0.3.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (291) hide show
  1. package/README.md +32 -1
  2. package/dist/base.css +3 -0
  3. package/dist/components/accordion/accordion.css +24 -19
  4. package/dist/components/accordion/accordion.d.ts +19 -3
  5. package/dist/components/accordion/accordion.js +86 -32
  6. package/dist/components/accordion/accordion.module.js +8 -8
  7. package/dist/components/active-filters/active-filter-describers.d.ts +1 -1
  8. package/dist/components/active-filters/active-filter-describers.js +1 -1
  9. package/dist/components/active-filters/active-filters.d.ts +35 -2
  10. package/dist/components/active-filters/active-filters.js +57 -52
  11. package/dist/components/active-filters/index.js +2 -2
  12. package/dist/components/attachment-tile/attachment-preview.d.ts +11 -9
  13. package/dist/components/attachment-tile/attachment-preview.js +102 -68
  14. package/dist/components/attachment-tile/attachment-tile.css +22 -13
  15. package/dist/components/attachment-tile/attachment-tile.d.ts +51 -6
  16. package/dist/components/attachment-tile/attachment-tile.js +209 -85
  17. package/dist/components/attachment-tile/attachment-tile.module.js +10 -10
  18. package/dist/components/attachment-tile/index.d.ts +1 -1
  19. package/dist/components/attachment-tile/index.js +2 -2
  20. package/dist/components/avatar/avatar.d.ts +5 -5
  21. package/dist/components/avatar/avatar.js +64 -37
  22. package/dist/components/avatar-group/avatar-group.js +2 -2
  23. package/dist/components/badge/badge.js +1 -1
  24. package/dist/components/breadcrumbs/breadcrumbs.d.ts +22 -7
  25. package/dist/components/breadcrumbs/breadcrumbs.js +189 -170
  26. package/dist/components/button/button.d.ts +2 -3
  27. package/dist/components/button/button.js +58 -77
  28. package/dist/components/button/close-button.d.ts +4 -2
  29. package/dist/components/button/close-button.js +9 -9
  30. package/dist/components/checkbox-field/checkbox-field.d.ts +17 -3
  31. package/dist/components/checkbox-field/checkbox-field.js +108 -131
  32. package/dist/components/checkbox-field/checkbox.css +26 -34
  33. package/dist/components/checkbox-field/checkbox.d.ts +51 -8
  34. package/dist/components/checkbox-field/checkbox.js +221 -57
  35. package/dist/components/checkbox-field/checkbox.module.js +6 -8
  36. package/dist/components/checkbox-field/index.d.ts +0 -1
  37. package/dist/components/checkbox-field/index.js +1 -2
  38. package/dist/components/checkbox-field/tsf-checkbox-field.d.ts +2 -2
  39. package/dist/components/checkbox-group-field/checkbox-group-field.d.ts +4 -1
  40. package/dist/components/checkbox-group-field/checkbox-group-field.js +54 -50
  41. package/dist/components/checkbox-group-field/checkbox-group.d.ts +7 -2
  42. package/dist/components/checkbox-group-field/checkbox-group.js +8 -3
  43. package/dist/components/collapsible/collapsible.css +23 -18
  44. package/dist/components/collapsible/collapsible.d.ts +18 -3
  45. package/dist/components/collapsible/collapsible.js +85 -32
  46. package/dist/components/collapsible/collapsible.module.js +7 -7
  47. package/dist/components/combobox-field/combobox-field.d.ts +9 -1
  48. package/dist/components/combobox-field/combobox-field.js +195 -175
  49. package/dist/components/combobox-field/combobox-items.d.ts +2 -2
  50. package/dist/components/combobox-field/combobox-items.js +4 -4
  51. package/dist/components/combobox-field/combobox.css +99 -96
  52. package/dist/components/combobox-field/combobox.d.ts +94 -15
  53. package/dist/components/combobox-field/combobox.js +484 -159
  54. package/dist/components/combobox-field/combobox.module.js +21 -21
  55. package/dist/components/combobox-field/index.d.ts +0 -1
  56. package/dist/components/combobox-field/selection.d.ts +4 -1
  57. package/dist/components/combobox-field/value-state-view.css +7 -3
  58. package/dist/components/combobox-field/value-state-view.d.ts +4 -2
  59. package/dist/components/combobox-field/value-state-view.js +15 -15
  60. package/dist/components/combobox-field/value-state-view.module.js +6 -4
  61. package/dist/components/composer/composer-attachments.d.ts +11 -3
  62. package/dist/components/composer/composer-attachments.js +61 -47
  63. package/dist/components/composer/composer-editor.d.ts +2 -1
  64. package/dist/components/composer/composer-editor.js +79 -71
  65. package/dist/components/composer/composer-mentions.js +2 -2
  66. package/dist/components/composer/composer.d.ts +42 -21
  67. package/dist/components/composer/composer.js +201 -58
  68. package/dist/components/composer/mention-text.js +3 -3
  69. package/dist/components/confirm-dialog/confirm-dialog.d.ts +8 -7
  70. package/dist/components/confirm-dialog/confirm-dialog.js +10 -9
  71. package/dist/components/conversation/conversation.context.d.ts +0 -5
  72. package/dist/components/conversation/conversation.d.ts +63 -29
  73. package/dist/components/conversation/conversation.js +193 -82
  74. package/dist/components/conversation/index.d.ts +1 -1
  75. package/dist/components/date-field/date-field.d.ts +10 -4
  76. package/dist/components/date-field/date-field.js +57 -43
  77. package/dist/components/date-field/date-input.d.ts +20 -3
  78. package/dist/components/date-field/date-input.js +28 -13
  79. package/dist/components/date-field/index.d.ts +1 -1
  80. package/dist/components/date-field/tsf-date-field.d.ts +1 -1
  81. package/dist/components/date-field/tsf-date-field.js +1 -1
  82. package/dist/components/date-range-field/date-range-field.d.ts +8 -4
  83. package/dist/components/date-range-field/date-range-field.js +57 -45
  84. package/dist/components/date-range-field/date-range-input.d.ts +20 -3
  85. package/dist/components/date-range-field/date-range-input.js +27 -12
  86. package/dist/components/date-range-field/tsf-date-range-field.d.ts +1 -1
  87. package/dist/components/date-range-field/tsf-date-range-field.js +1 -1
  88. package/dist/components/detail-list/detail-list.d.ts +28 -27
  89. package/dist/components/detail-list/detail-list.js +177 -121
  90. package/dist/components/dialog/dialog.d.ts +47 -27
  91. package/dist/components/dialog/dialog.js +101 -38
  92. package/dist/components/divider/divider.js +1 -1
  93. package/dist/components/drawer/drawer.d.ts +48 -30
  94. package/dist/components/drawer/drawer.js +113 -41
  95. package/dist/components/email-field/email-field.d.ts +5 -3
  96. package/dist/components/email-field/email-field.js +1 -3
  97. package/dist/components/email-field/tsf-email-field.d.ts +3 -2
  98. package/dist/components/empty-message/empty-message.d.ts +3 -3
  99. package/dist/components/empty-message/empty-message.js +3 -3
  100. package/dist/components/error-boundary/error-boundary.d.ts +5 -2
  101. package/dist/components/error-boundary/error-boundary.js +2 -3
  102. package/dist/components/error-message/error-message.d.ts +1 -1
  103. package/dist/components/error-message/error-message.js +1 -1
  104. package/dist/components/error-text/error-text.js +3 -3
  105. package/dist/components/field/field.d.ts +5 -5
  106. package/dist/components/field/field.js +9 -9
  107. package/dist/components/field/index.js +2 -2
  108. package/dist/components/field/input-parts.js +1 -1
  109. package/dist/components/field-placeholder/field-placeholder.d.ts +4 -1
  110. package/dist/components/field-placeholder/field-placeholder.js +41 -26
  111. package/dist/components/fieldset/field-group.js +1 -1
  112. package/dist/components/fieldset/fieldset-root.js +1 -1
  113. package/dist/components/fieldset/fieldset.js +1 -1
  114. package/dist/components/file-field/file-field.css +19 -15
  115. package/dist/components/file-field/file-field.d.ts +10 -1
  116. package/dist/components/file-field/file-field.js +130 -109
  117. package/dist/components/file-field/file-field.module.js +6 -4
  118. package/dist/components/file-field/file-input.d.ts +32 -9
  119. package/dist/components/file-field/file-input.js +94 -74
  120. package/dist/components/filter-bar/filter-bar.d.ts +79 -51
  121. package/dist/components/filter-bar/filter-bar.js +552 -216
  122. package/dist/components/form/form.d.ts +4 -6
  123. package/dist/components/form/form.js +6 -8
  124. package/dist/components/icon/icon.d.ts +5 -10
  125. package/dist/components/icon/icon.js +4 -6
  126. package/dist/components/link/link.js +1 -1
  127. package/dist/components/link-button/link-button.d.ts +1 -2
  128. package/dist/components/link-button/link-button.js +12 -22
  129. package/dist/components/loading-message/loading-message.d.ts +2 -2
  130. package/dist/components/loading-message/loading-message.js +1 -1
  131. package/dist/components/locale-provider/locale-provider.js +1 -1
  132. package/dist/components/menu/menu.d.ts +40 -22
  133. package/dist/components/menu/menu.js +100 -40
  134. package/dist/components/nav/nav-context.d.ts +0 -1
  135. package/dist/components/nav/nav-context.js +1 -2
  136. package/dist/components/nav/nav-item-view.d.ts +7 -7
  137. package/dist/components/nav/nav-item-view.js +27 -51
  138. package/dist/components/nav/nav.css +72 -60
  139. package/dist/components/nav/nav.d.ts +15 -8
  140. package/dist/components/nav/nav.js +105 -52
  141. package/dist/components/nav/nav.module.js +14 -14
  142. package/dist/components/number-field/number-field.d.ts +7 -1
  143. package/dist/components/number-field/number-field.js +98 -82
  144. package/dist/components/number-field/number-input.d.ts +53 -4
  145. package/dist/components/number-field/number-input.js +68 -21
  146. package/dist/components/number-field/tsf-number-field.d.ts +1 -1
  147. package/dist/components/number-field/tsf-number-field.js +1 -1
  148. package/dist/components/otp-field/otp-input.d.ts +25 -0
  149. package/dist/components/otp-field/otp-input.js +26 -1
  150. package/dist/components/pagination/pagination.d.ts +82 -23
  151. package/dist/components/pagination/pagination.js +656 -229
  152. package/dist/components/password-field/password-field.d.ts +7 -1
  153. package/dist/components/password-field/password-field.js +117 -126
  154. package/dist/components/password-field/password-strength.js +1 -1
  155. package/dist/components/password-field/tsf-password-field.d.ts +1 -1
  156. package/dist/components/password-field/tsf-password-field.js +1 -1
  157. package/dist/components/photo-field/photo-field.d.ts +17 -3
  158. package/dist/components/photo-field/photo-field.js +168 -89
  159. package/dist/components/photo-field/photo-input-context.d.ts +25 -0
  160. package/dist/components/photo-field/photo-input-context.js +14 -0
  161. package/dist/components/photo-field/photo-input.d.ts +58 -23
  162. package/dist/components/photo-field/photo-input.js +459 -261
  163. package/dist/components/popover/popover.d.ts +55 -23
  164. package/dist/components/popover/popover.js +205 -61
  165. package/dist/components/radio-group-field/radio-group.js +1 -1
  166. package/dist/components/search-field/search-field.d.ts +7 -5
  167. package/dist/components/search-field/search-field.js +4 -6
  168. package/dist/components/search-field/tsf-search-field.d.ts +1 -1
  169. package/dist/components/search-field/tsf-search-field.js +1 -1
  170. package/dist/components/segmented-control-field/segmented-control.js +1 -1
  171. package/dist/components/select-field/select-field.d.ts +7 -1
  172. package/dist/components/select-field/select-field.js +151 -139
  173. package/dist/components/select-field/select.d.ts +28 -6
  174. package/dist/components/select-field/select.js +234 -149
  175. package/dist/components/skeleton/skeleton.js +1 -1
  176. package/dist/components/spinner/spinner.css +47 -1
  177. package/dist/components/spinner/spinner.js +28 -11
  178. package/dist/components/spinner/spinner.module.js +18 -3
  179. package/dist/components/stale/stale.d.ts +17 -21
  180. package/dist/components/stale/stale.js +307 -129
  181. package/dist/components/status-message/status-message.css +22 -21
  182. package/dist/components/status-message/status-message.d.ts +10 -5
  183. package/dist/components/status-message/status-message.js +20 -24
  184. package/dist/components/status-message/status-message.module.js +6 -6
  185. package/dist/components/status-message/status-preset.d.ts +4 -5
  186. package/dist/components/status-message/status-preset.js +3 -3
  187. package/dist/components/switch-field/switch.js +1 -1
  188. package/dist/components/tabs/tabs.d.ts +51 -28
  189. package/dist/components/tabs/tabs.js +219 -144
  190. package/dist/components/tag/tag.css +23 -21
  191. package/dist/components/tag/tag.d.ts +17 -15
  192. package/dist/components/tag/tag.js +140 -65
  193. package/dist/components/tag/tag.module.js +3 -3
  194. package/dist/components/tag-group/tag-group.css +30 -27
  195. package/dist/components/tag-group/tag-group.d.ts +10 -4
  196. package/dist/components/tag-group/tag-group.js +47 -35
  197. package/dist/components/tag-group/tag-group.module.js +4 -4
  198. package/dist/components/text-field/text-field.d.ts +14 -3
  199. package/dist/components/text-field/text-field.js +154 -133
  200. package/dist/components/text-field/text-input.d.ts +89 -3
  201. package/dist/components/text-field/text-input.js +184 -70
  202. package/dist/components/textarea-field/textarea.js +1 -1
  203. package/dist/components/time-field/time-input.d.ts +6 -0
  204. package/dist/components/time-field/time-input.js +6 -0
  205. package/dist/components/time-zone-provider/time-zone-provider.js +1 -1
  206. package/dist/components/toast/index.js +2 -2
  207. package/dist/components/toast/toast-provider.css +38 -34
  208. package/dist/components/toast/toast-provider.d.ts +65 -3
  209. package/dist/components/toast/toast-provider.js +313 -148
  210. package/dist/components/toast/toast-provider.module.js +11 -17
  211. package/dist/components/toast/toast.d.ts +5 -1
  212. package/dist/components/toast/toast.js +2 -1
  213. package/dist/components/toggle-group-field/toggle-group.js +1 -1
  214. package/dist/components/tooltip/tooltip.d.ts +6 -6
  215. package/dist/components/tooltip/tooltip.js +7 -7
  216. package/dist/data-table/data-table-content.d.ts +18 -10
  217. package/dist/data-table/data-table-content.js +145 -290
  218. package/dist/data-table/data-table-context.d.ts +4 -2
  219. package/dist/data-table/data-table-context.js +1 -1
  220. package/dist/data-table/data-table-parts.d.ts +99 -0
  221. package/dist/data-table/data-table-parts.js +1182 -0
  222. package/dist/data-table/data-table-selection.d.ts +7 -3
  223. package/dist/data-table/data-table-selection.js +62 -37
  224. package/dist/data-table/data-table.css +100 -95
  225. package/dist/data-table/data-table.d.ts +49 -25
  226. package/dist/data-table/data-table.js +95 -83
  227. package/dist/data-table/data-table.module.js +34 -34
  228. package/dist/data-table/index.d.ts +2 -1
  229. package/dist/data-table/index.js +2 -1
  230. package/dist/data-view/use-data-view.d.ts +2 -2
  231. package/dist/data-view/use-data-view.js +2 -2
  232. package/dist/index.js +7 -8
  233. package/dist/lib/calendar/calendar-navigation.d.ts +9 -2
  234. package/dist/lib/calendar/calendar-navigation.js +72 -73
  235. package/dist/lib/calendar/calendar-year.d.ts +4 -3
  236. package/dist/lib/calendar/calendar-year.js +137 -156
  237. package/dist/lib/calendar/temporal.d.ts +18 -12
  238. package/dist/lib/calendar/temporal.js +191 -147
  239. package/dist/lib/table-storage.d.ts +2 -2
  240. package/dist/lib/table-storage.js +2 -2
  241. package/dist/lib/unsaved-changes/leave-guard.js +1 -1
  242. package/dist/terrazzo/index.d.ts +20 -3
  243. package/dist/terrazzo/index.js +110 -7
  244. package/dist/tokens.css +94 -71
  245. package/package.json +4 -3
  246. package/tokens/ref.tokens.json +0 -30
  247. package/tokens/sys.tokens.json +0 -7
  248. package/dist/assets/spinner.js +0 -28
  249. package/dist/components/checkbox-field/checkbox-glyph.d.ts +0 -12
  250. package/dist/components/checkbox-field/checkbox-glyph.js +0 -38
  251. package/dist/components/combobox-field/combobox-popup-body.d.ts +0 -34
  252. package/dist/components/combobox-field/combobox-popup-body.js +0 -142
  253. package/dist/components/conversation/conversation.context.js +0 -4
  254. package/dist/vendor/@material-design-icons/svg/outlined/add.js +0 -12
  255. package/dist/vendor/@material-design-icons/svg/outlined/arrow_downward.js +0 -12
  256. package/dist/vendor/@material-design-icons/svg/outlined/arrow_forward.js +0 -12
  257. package/dist/vendor/@material-design-icons/svg/outlined/arrow_upward.js +0 -12
  258. package/dist/vendor/@material-design-icons/svg/outlined/attach_file.js +0 -12
  259. package/dist/vendor/@material-design-icons/svg/outlined/block.js +0 -12
  260. package/dist/vendor/@material-design-icons/svg/outlined/calendar_today.js +0 -12
  261. package/dist/vendor/@material-design-icons/svg/outlined/check.js +0 -12
  262. package/dist/vendor/@material-design-icons/svg/outlined/check_circle.js +0 -12
  263. package/dist/vendor/@material-design-icons/svg/outlined/chevron_left.js +0 -12
  264. package/dist/vendor/@material-design-icons/svg/outlined/chevron_right.js +0 -12
  265. package/dist/vendor/@material-design-icons/svg/outlined/close.js +0 -12
  266. package/dist/vendor/@material-design-icons/svg/outlined/content_copy.js +0 -12
  267. package/dist/vendor/@material-design-icons/svg/outlined/date_range.js +0 -12
  268. package/dist/vendor/@material-design-icons/svg/outlined/description.js +0 -12
  269. package/dist/vendor/@material-design-icons/svg/outlined/download.js +0 -12
  270. package/dist/vendor/@material-design-icons/svg/outlined/error.js +0 -12
  271. package/dist/vendor/@material-design-icons/svg/outlined/error_outline.js +0 -12
  272. package/dist/vendor/@material-design-icons/svg/outlined/expand_less.js +0 -12
  273. package/dist/vendor/@material-design-icons/svg/outlined/expand_more.js +0 -12
  274. package/dist/vendor/@material-design-icons/svg/outlined/filter_alt.js +0 -12
  275. package/dist/vendor/@material-design-icons/svg/outlined/filter_alt_off.js +0 -12
  276. package/dist/vendor/@material-design-icons/svg/outlined/first_page.js +0 -12
  277. package/dist/vendor/@material-design-icons/svg/outlined/info.js +0 -12
  278. package/dist/vendor/@material-design-icons/svg/outlined/keyboard_arrow_down.js +0 -12
  279. package/dist/vendor/@material-design-icons/svg/outlined/last_page.js +0 -12
  280. package/dist/vendor/@material-design-icons/svg/outlined/mail.js +0 -12
  281. package/dist/vendor/@material-design-icons/svg/outlined/more_horiz.js +0 -12
  282. package/dist/vendor/@material-design-icons/svg/outlined/photo_camera.js +0 -12
  283. package/dist/vendor/@material-design-icons/svg/outlined/remove.js +0 -12
  284. package/dist/vendor/@material-design-icons/svg/outlined/restart_alt.js +0 -12
  285. package/dist/vendor/@material-design-icons/svg/outlined/restore.js +0 -12
  286. package/dist/vendor/@material-design-icons/svg/outlined/search.js +0 -12
  287. package/dist/vendor/@material-design-icons/svg/outlined/unfold_more.js +0 -12
  288. package/dist/vendor/@material-design-icons/svg/outlined/upload_file.js +0 -12
  289. package/dist/vendor/@material-design-icons/svg/outlined/visibility.js +0 -12
  290. package/dist/vendor/@material-design-icons/svg/outlined/visibility_off.js +0 -12
  291. package/dist/vendor/@material-design-icons/svg/outlined/warning_amber.js +0 -12
@@ -1,40 +1,41 @@
1
- import type { ReactNode } from "react";
2
- import { type SvgComponent } from "../icon/icon.tsx";
3
- type PartProps = Readonly<{
4
- className?: string;
5
- children?: ReactNode;
6
- }>;
7
- type RowAction = Readonly<{
8
- /** A control at the row's end, whose label names the term it acts on. */
9
- action?: ReactNode;
10
- }>;
11
- export type DetailListRootProps = PartProps;
12
- export type DetailListRowProps = PartProps & RowAction & Readonly<{
13
- /** What the detail is, such as "Phone number". */
14
- term: ReactNode;
15
- }>;
16
- export type DetailListIconRowProps = PartProps & RowAction & Readonly<{
17
- /** The pictogram that stands for the term. */
18
- svg: SvgComponent;
19
- /** The term the pictogram stands for, as its accessible name. */
20
- label: string;
21
- }>;
22
- declare const Root: ({ className, children, }: DetailListRootProps) => ReactNode;
23
- declare const Row: ({ term, action, className, children, }: DetailListRowProps) => ReactNode;
24
- declare const IconRow: ({ svg, label, action, className, children, }: DetailListIconRowProps) => ReactNode;
1
+ import type { ComponentPropsWithRef, ReactNode } from "react";
2
+ export type DetailListRootProps = ComponentPropsWithRef<"dl">;
3
+ export type DetailListRowProps = ComponentPropsWithRef<"div">;
4
+ export type DetailListIconRowProps = ComponentPropsWithRef<"div">;
5
+ export type DetailListTermProps = ComponentPropsWithRef<"dt">;
6
+ export type DetailListDetailProps = ComponentPropsWithRef<"dd">;
7
+ export type DetailListActionProps = ComponentPropsWithRef<"dd">;
8
+ /** The list: a `<dl>` of rows. */
9
+ declare const Root: ({ className, ...props }: DetailListRootProps) => ReactNode;
10
+ /** One row: a `Term`, its `Detail`, and an optional `Action`. The term takes a third of the row. */
11
+ declare const Row: ({ className, ...props }: DetailListRowProps) => ReactNode;
12
+ /** A row whose `Term` is a pictogram, which takes only its own width. */
13
+ declare const IconRow: ({ className, ...props }: DetailListIconRowProps) => ReactNode;
14
+ /** What the detail is, such as "Phone number", or a pictogram with that as its accessible name. */
15
+ declare const Term: ({ className, ...props }: DetailListTermProps) => ReactNode;
16
+ /** The stored information that answers the term. */
17
+ declare const Detail: ({ className, ...props }: DetailListDetailProps) => ReactNode;
18
+ /** A control at the row's end, whose label names the term it acts on. */
19
+ declare const Action: ({ className, ...props }: DetailListActionProps) => ReactNode;
25
20
  type DetailListNamespace = Readonly<{
26
21
  Root: typeof Root;
27
22
  Row: typeof Row;
28
23
  IconRow: typeof IconRow;
24
+ Term: typeof Term;
25
+ Detail: typeof Detail;
26
+ Action: typeof Action;
29
27
  }>;
30
28
  /**
31
29
  * Stored information, as the terms that name it and the details that answer
32
- * them, in a description list. `IconRow` is a row whose term is a pictogram.
33
- * A row's `action` sits at its end, and its control names the term it acts on.
30
+ * them, in a description list. Each row groups a `Term`, its `Detail` and an
31
+ * optional `Action`; an `IconRow` is a row whose term is a pictogram.
34
32
  *
35
33
  * @example
36
34
  * <DetailList.Root>
37
- * <DetailList.Row term="Phone number">{client.phone}</DetailList.Row>
35
+ * <DetailList.Row>
36
+ * <DetailList.Term>Phone number</DetailList.Term>
37
+ * <DetailList.Detail>{client.phone}</DetailList.Detail>
38
+ * </DetailList.Row>
38
39
  * </DetailList.Root>
39
40
  */
40
41
  export declare const DetailList: DetailListNamespace;
@@ -1,163 +1,219 @@
1
- import { Icon } from "../icon/icon.js";
2
1
  import detail_list_module_default from "./detail-list.module.js";
3
2
  import { c } from "react/compiler-runtime";
4
- import { jsx, jsxs } from "react/jsx-runtime";
5
3
  import { clsx } from "clsx";
4
+ import { jsx } from "react/jsx-runtime";
6
5
  // src/components/detail-list/detail-list.tsx
6
+ /** The list: a `<dl>` of rows. */
7
7
  var Root = (t0) => {
8
- const $ = c(5);
9
- const { className, children } = t0;
8
+ const $ = c(8);
9
+ let className;
10
+ let props;
11
+ if ($[0] !== t0) {
12
+ ({className, ...props} = t0);
13
+ $[0] = t0;
14
+ $[1] = className;
15
+ $[2] = props;
16
+ } else {
17
+ className = $[1];
18
+ props = $[2];
19
+ }
10
20
  let t1;
11
- if ($[0] !== className) {
21
+ if ($[3] !== className) {
12
22
  t1 = clsx(detail_list_module_default.list, className);
13
- $[0] = className;
14
- $[1] = t1;
15
- } else t1 = $[1];
23
+ $[3] = className;
24
+ $[4] = t1;
25
+ } else t1 = $[4];
16
26
  let t2;
17
- if ($[2] !== children || $[3] !== t1) {
27
+ if ($[5] !== props || $[6] !== t1) {
18
28
  t2 = /* @__PURE__ */ jsx("dl", {
19
29
  className: t1,
20
- children
30
+ ...props
21
31
  });
22
- $[2] = children;
23
- $[3] = t1;
24
- $[4] = t2;
25
- } else t2 = $[4];
32
+ $[5] = props;
33
+ $[6] = t1;
34
+ $[7] = t2;
35
+ } else t2 = $[7];
26
36
  return t2;
27
37
  };
28
- var ActionSlot = (t0) => {
29
- const $ = c(2);
30
- const { action } = t0;
31
- let t1;
32
- if ($[0] !== action) {
33
- t1 = action === void 0 ? null : /* @__PURE__ */ jsx("dd", {
34
- className: detail_list_module_default.action,
35
- children: action
36
- });
37
- $[0] = action;
38
- $[1] = t1;
39
- } else t1 = $[1];
40
- return t1;
41
- };
38
+ /** One row: a `Term`, its `Detail`, and an optional `Action`. The term takes a third of the row. */
42
39
  var Row = (t0) => {
43
- const $ = c(13);
44
- const { term, action, className, children } = t0;
40
+ const $ = c(8);
41
+ let className;
42
+ let props;
43
+ if ($[0] !== t0) {
44
+ ({className, ...props} = t0);
45
+ $[0] = t0;
46
+ $[1] = className;
47
+ $[2] = props;
48
+ } else {
49
+ className = $[1];
50
+ props = $[2];
51
+ }
45
52
  let t1;
46
- if ($[0] !== className) {
53
+ if ($[3] !== className) {
47
54
  t1 = clsx(detail_list_module_default.row, className);
48
- $[0] = className;
49
- $[1] = t1;
50
- } else t1 = $[1];
55
+ $[3] = className;
56
+ $[4] = t1;
57
+ } else t1 = $[4];
51
58
  let t2;
52
- if ($[2] !== term) {
53
- t2 = /* @__PURE__ */ jsx("dt", {
54
- className: detail_list_module_default.term,
55
- children: term
56
- });
57
- $[2] = term;
58
- $[3] = t2;
59
- } else t2 = $[3];
60
- let t3;
61
- if ($[4] !== children) {
62
- t3 = /* @__PURE__ */ jsx("dd", {
63
- className: detail_list_module_default.detail,
64
- children
65
- });
66
- $[4] = children;
67
- $[5] = t3;
68
- } else t3 = $[5];
69
- let t4;
70
- if ($[6] !== action) {
71
- t4 = /* @__PURE__ */ jsx(ActionSlot, { action });
72
- $[6] = action;
73
- $[7] = t4;
74
- } else t4 = $[7];
75
- let t5;
76
- if ($[8] !== t1 || $[9] !== t2 || $[10] !== t3 || $[11] !== t4) {
77
- t5 = /* @__PURE__ */ jsxs("div", {
59
+ if ($[5] !== props || $[6] !== t1) {
60
+ t2 = /* @__PURE__ */ jsx("div", {
78
61
  className: t1,
79
- children: [
80
- t2,
81
- t3,
82
- t4
83
- ]
62
+ ...props
84
63
  });
85
- $[8] = t1;
86
- $[9] = t2;
87
- $[10] = t3;
88
- $[11] = t4;
89
- $[12] = t5;
90
- } else t5 = $[12];
91
- return t5;
64
+ $[5] = props;
65
+ $[6] = t1;
66
+ $[7] = t2;
67
+ } else t2 = $[7];
68
+ return t2;
92
69
  };
70
+ /** A row whose `Term` is a pictogram, which takes only its own width. */
93
71
  var IconRow = (t0) => {
94
- const $ = c(14);
95
- const { svg, label, action, className, children } = t0;
72
+ const $ = c(8);
73
+ let className;
74
+ let props;
75
+ if ($[0] !== t0) {
76
+ ({className, ...props} = t0);
77
+ $[0] = t0;
78
+ $[1] = className;
79
+ $[2] = props;
80
+ } else {
81
+ className = $[1];
82
+ props = $[2];
83
+ }
96
84
  let t1;
97
- if ($[0] !== className) {
85
+ if ($[3] !== className) {
98
86
  t1 = clsx(detail_list_module_default.iconRow, className);
99
- $[0] = className;
100
- $[1] = t1;
101
- } else t1 = $[1];
87
+ $[3] = className;
88
+ $[4] = t1;
89
+ } else t1 = $[4];
90
+ let t2;
91
+ if ($[5] !== props || $[6] !== t1) {
92
+ t2 = /* @__PURE__ */ jsx("div", {
93
+ className: t1,
94
+ ...props
95
+ });
96
+ $[5] = props;
97
+ $[6] = t1;
98
+ $[7] = t2;
99
+ } else t2 = $[7];
100
+ return t2;
101
+ };
102
+ /** What the detail is, such as "Phone number", or a pictogram with that as its accessible name. */
103
+ var Term = (t0) => {
104
+ const $ = c(8);
105
+ let className;
106
+ let props;
107
+ if ($[0] !== t0) {
108
+ ({className, ...props} = t0);
109
+ $[0] = t0;
110
+ $[1] = className;
111
+ $[2] = props;
112
+ } else {
113
+ className = $[1];
114
+ props = $[2];
115
+ }
116
+ let t1;
117
+ if ($[3] !== className) {
118
+ t1 = clsx(detail_list_module_default.term, className);
119
+ $[3] = className;
120
+ $[4] = t1;
121
+ } else t1 = $[4];
102
122
  let t2;
103
- if ($[2] !== label || $[3] !== svg) {
123
+ if ($[5] !== props || $[6] !== t1) {
104
124
  t2 = /* @__PURE__ */ jsx("dt", {
105
- className: detail_list_module_default.term,
106
- children: /* @__PURE__ */ jsx(Icon, {
107
- svg,
108
- label
109
- })
125
+ className: t1,
126
+ ...props
110
127
  });
111
- $[2] = label;
112
- $[3] = svg;
113
- $[4] = t2;
114
- } else t2 = $[4];
115
- let t3;
116
- if ($[5] !== children) {
117
- t3 = /* @__PURE__ */ jsx("dd", {
118
- className: detail_list_module_default.detail,
119
- children
128
+ $[5] = props;
129
+ $[6] = t1;
130
+ $[7] = t2;
131
+ } else t2 = $[7];
132
+ return t2;
133
+ };
134
+ /** The stored information that answers the term. */
135
+ var Detail = (t0) => {
136
+ const $ = c(8);
137
+ let className;
138
+ let props;
139
+ if ($[0] !== t0) {
140
+ ({className, ...props} = t0);
141
+ $[0] = t0;
142
+ $[1] = className;
143
+ $[2] = props;
144
+ } else {
145
+ className = $[1];
146
+ props = $[2];
147
+ }
148
+ let t1;
149
+ if ($[3] !== className) {
150
+ t1 = clsx(detail_list_module_default.detail, className);
151
+ $[3] = className;
152
+ $[4] = t1;
153
+ } else t1 = $[4];
154
+ let t2;
155
+ if ($[5] !== props || $[6] !== t1) {
156
+ t2 = /* @__PURE__ */ jsx("dd", {
157
+ className: t1,
158
+ ...props
120
159
  });
121
- $[5] = children;
122
- $[6] = t3;
123
- } else t3 = $[6];
124
- let t4;
125
- if ($[7] !== action) {
126
- t4 = /* @__PURE__ */ jsx(ActionSlot, { action });
127
- $[7] = action;
128
- $[8] = t4;
129
- } else t4 = $[8];
130
- let t5;
131
- if ($[9] !== t1 || $[10] !== t2 || $[11] !== t3 || $[12] !== t4) {
132
- t5 = /* @__PURE__ */ jsxs("div", {
160
+ $[5] = props;
161
+ $[6] = t1;
162
+ $[7] = t2;
163
+ } else t2 = $[7];
164
+ return t2;
165
+ };
166
+ /** A control at the row's end, whose label names the term it acts on. */
167
+ var Action = (t0) => {
168
+ const $ = c(8);
169
+ let className;
170
+ let props;
171
+ if ($[0] !== t0) {
172
+ ({className, ...props} = t0);
173
+ $[0] = t0;
174
+ $[1] = className;
175
+ $[2] = props;
176
+ } else {
177
+ className = $[1];
178
+ props = $[2];
179
+ }
180
+ let t1;
181
+ if ($[3] !== className) {
182
+ t1 = clsx(detail_list_module_default.action, className);
183
+ $[3] = className;
184
+ $[4] = t1;
185
+ } else t1 = $[4];
186
+ let t2;
187
+ if ($[5] !== props || $[6] !== t1) {
188
+ t2 = /* @__PURE__ */ jsx("dd", {
133
189
  className: t1,
134
- children: [
135
- t2,
136
- t3,
137
- t4
138
- ]
190
+ ...props
139
191
  });
140
- $[9] = t1;
141
- $[10] = t2;
142
- $[11] = t3;
143
- $[12] = t4;
144
- $[13] = t5;
145
- } else t5 = $[13];
146
- return t5;
192
+ $[5] = props;
193
+ $[6] = t1;
194
+ $[7] = t2;
195
+ } else t2 = $[7];
196
+ return t2;
147
197
  };
148
198
  /**
149
199
  * Stored information, as the terms that name it and the details that answer
150
- * them, in a description list. `IconRow` is a row whose term is a pictogram.
151
- * A row's `action` sits at its end, and its control names the term it acts on.
200
+ * them, in a description list. Each row groups a `Term`, its `Detail` and an
201
+ * optional `Action`; an `IconRow` is a row whose term is a pictogram.
152
202
  *
153
203
  * @example
154
204
  * <DetailList.Root>
155
- * <DetailList.Row term="Phone number">{client.phone}</DetailList.Row>
205
+ * <DetailList.Row>
206
+ * <DetailList.Term>Phone number</DetailList.Term>
207
+ * <DetailList.Detail>{client.phone}</DetailList.Detail>
208
+ * </DetailList.Row>
156
209
  * </DetailList.Root>
157
210
  */
158
211
  var DetailList = {
159
212
  Root,
160
213
  Row,
161
- IconRow
214
+ IconRow,
215
+ Term,
216
+ Detail,
217
+ Action
162
218
  };
163
219
  export { DetailList };
@@ -1,26 +1,49 @@
1
1
  import { Dialog as BaseDialog } from "@base-ui/react/dialog";
2
2
  import type { ComponentProps, ReactNode } from "react";
3
3
  import { type CloseButtonProps } from "../button/close-button.tsx";
4
+ export type DialogRootProps<Payload = unknown> = Omit<BaseDialog.Root.Props<Payload>, "open" | "defaultOpen" | "onOpenChange" | "modal" | "children"> & Readonly<{
5
+ /** Whether the dialog is open. Leave it out for a dialog that keeps its own state. */
6
+ open?: boolean;
7
+ /** Whether the dialog starts open, when it keeps its own state. @default false */
8
+ defaultOpen?: boolean;
9
+ /** Called with the new open state when the dialog opens or closes. */
10
+ onOpenChange?: BaseDialog.Root.Props<Payload>["onOpenChange"];
11
+ /** Whether focus stays inside the dialog and the page behind it is inert while it is open. @default true */
12
+ modal?: BaseDialog.Root.Props<Payload>["modal"];
13
+ /** The trigger and the dialog's content. */
14
+ children?: BaseDialog.Root.Props<Payload>["children"];
15
+ }>;
16
+ /** Holds the dialog's open state for its parts. It renders no element of its own. */
17
+ declare const Root: <Payload>(props: DialogRootProps<Payload>) => ReactNode;
18
+ /** The dimmed layer behind a modal dialog. */
4
19
  declare const Backdrop: ({ className, ...props }: ComponentProps<typeof BaseDialog.Backdrop>) => ReactNode;
20
+ /** The dialog's surface. */
5
21
  declare const Popup: ({ className, ...props }: ComponentProps<typeof BaseDialog.Popup>) => ReactNode;
22
+ /** The dialog's heading, which names it. */
6
23
  declare const Title: ({ className, ...props }: ComponentProps<typeof BaseDialog.Title>) => ReactNode;
7
- export type DialogHeaderProps = Readonly<{
8
- children?: ReactNode;
9
- className?: string;
10
- }>;
24
+ export type DialogHeaderProps = ComponentProps<"div">;
11
25
  /** The title's line. Put a `Dialog.CloseButton` in it to trail a way out. */
12
- declare const Header: ({ children, className, }: DialogHeaderProps) => ReactNode;
13
- export type DialogCloseButtonProps = Pick<CloseButtonProps, "closeLabel">;
14
- /** The icon-only way out, for a header or a footer. */
15
- declare const CloseButton: ({ closeLabel, }: DialogCloseButtonProps) => ReactNode;
26
+ declare const Header: ({ className, ...props }: DialogHeaderProps) => ReactNode;
27
+ export type DialogCloseButtonProps = Pick<CloseButtonProps, "closeLabel" | "icon">;
28
+ /** The icon-only way out, for a header or a footer, drawn with the app's `icon`. */
29
+ declare const CloseButton: ({ closeLabel, icon, }: DialogCloseButtonProps) => ReactNode;
30
+ export type DialogContentProps = ComponentProps<typeof BaseDialog.Popup> & Readonly<{
31
+ /** The element the dialog is portalled into. @default document.body */
32
+ container?: BaseDialog.Portal.Props["container"];
33
+ }>;
34
+ /** `Portal`, `Backdrop` and `Popup` in one: the dialog's surface, above the page. */
35
+ declare const Content: ({ container, ...props }: DialogContentProps) => ReactNode;
36
+ /** The dialog's content, scrolling when it outgrows the surface. */
16
37
  declare const Body: ({ className, ...props }: ComponentProps<"div">) => ReactNode;
38
+ /** The row the dialog's actions sit on. */
17
39
  declare const Footer: ({ className, ...props }: ComponentProps<"div">) => ReactNode;
18
40
  type DialogParts = Readonly<{
19
- Root: typeof BaseDialog.Root;
41
+ Root: typeof Root;
20
42
  Trigger: typeof BaseDialog.Trigger;
21
43
  Portal: typeof BaseDialog.Portal;
22
44
  Backdrop: typeof Backdrop;
23
45
  Popup: typeof Popup;
46
+ Content: typeof Content;
24
47
  Title: typeof Title;
25
48
  Description: typeof BaseDialog.Description;
26
49
  Close: typeof BaseDialog.Close;
@@ -31,28 +54,25 @@ type DialogParts = Readonly<{
31
54
  createHandle: typeof BaseDialog.createHandle;
32
55
  }>;
33
56
  /**
34
- * Dialog chrome over base-ui's Dialog. Provides `Header` / `Body` / `Footer`
35
- * regions plus a styled `Backdrop` and `Popup`. Footer actions are a slot.
57
+ * A dialog over base-ui's `Dialog`, in `Header`, `Body` and `Footer` regions.
58
+ * `Content` bundles the portal, backdrop and popup; the unbundled parts stay.
36
59
  *
37
60
  * @example
38
61
  * <Dialog.Root>
39
62
  * <Dialog.Trigger>Edit</Dialog.Trigger>
40
- * <Dialog.Portal>
41
- * <Dialog.Backdrop />
42
- * <Dialog.Popup>
43
- * <Dialog.Header>
44
- * <Dialog.Title>Discard changes?</Dialog.Title>
45
- * <Dialog.CloseButton closeLabel="Close" />
46
- * </Dialog.Header>
47
- * <Dialog.Body>
48
- * <Dialog.Description>Your edits will be lost.</Dialog.Description>
49
- * </Dialog.Body>
50
- * <Dialog.Footer>
51
- * <Dialog.Close>Keep editing</Dialog.Close>
52
- * <button onClick={discard}>Discard</button>
53
- * </Dialog.Footer>
54
- * </Dialog.Popup>
55
- * </Dialog.Portal>
63
+ * <Dialog.Content>
64
+ * <Dialog.Header>
65
+ * <Dialog.Title>Discard changes?</Dialog.Title>
66
+ * <Dialog.CloseButton closeLabel="Close" icon={<CloseIcon />} />
67
+ * </Dialog.Header>
68
+ * <Dialog.Body>
69
+ * <Dialog.Description>Your edits will be lost.</Dialog.Description>
70
+ * </Dialog.Body>
71
+ * <Dialog.Footer>
72
+ * <Dialog.Close>Keep editing</Dialog.Close>
73
+ * <button onClick={discard}>Discard</button>
74
+ * </Dialog.Footer>
75
+ * </Dialog.Content>
56
76
  * </Dialog.Root>
57
77
  */
58
78
  export declare const Dialog: DialogParts;