@igne-agency/react-web-ui 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (257) hide show
  1. package/dist/base.css +3 -0
  2. package/dist/components/accordion/accordion.css +21 -21
  3. package/dist/components/accordion/accordion.d.ts +17 -4
  4. package/dist/components/accordion/accordion.js +83 -36
  5. package/dist/components/accordion/accordion.module.js +6 -6
  6. package/dist/components/attachment-tile/attachment-preview.d.ts +56 -13
  7. package/dist/components/attachment-tile/attachment-preview.js +388 -119
  8. package/dist/components/attachment-tile/attachment-tile.css +31 -25
  9. package/dist/components/attachment-tile/attachment-tile.d.ts +32 -10
  10. package/dist/components/attachment-tile/attachment-tile.js +160 -43
  11. package/dist/components/attachment-tile/attachment-tile.module.js +8 -8
  12. package/dist/components/attachment-tile/index.d.ts +1 -1
  13. package/dist/components/avatar/avatar.css +9 -9
  14. package/dist/components/avatar/avatar.d.ts +50 -5
  15. package/dist/components/avatar/avatar.js +178 -64
  16. package/dist/components/avatar/avatar.module.js +3 -3
  17. package/dist/components/avatar-group/avatar-group-context.d.ts +2 -4
  18. package/dist/components/avatar-group/avatar-group-context.js +2 -2
  19. package/dist/components/avatar-group/avatar-group.css +26 -20
  20. package/dist/components/avatar-group/avatar-group.d.ts +85 -27
  21. package/dist/components/avatar-group/avatar-group.js +400 -246
  22. package/dist/components/avatar-group/avatar-group.module.js +8 -8
  23. package/dist/components/breadcrumbs/breadcrumbs.css +12 -12
  24. package/dist/components/breadcrumbs/breadcrumbs.d.ts +69 -23
  25. package/dist/components/breadcrumbs/breadcrumbs.js +299 -248
  26. package/dist/components/breadcrumbs/breadcrumbs.module.js +8 -8
  27. package/dist/components/button/button.css +29 -31
  28. package/dist/components/button/button.d.ts +20 -16
  29. package/dist/components/button/button.js +140 -145
  30. package/dist/components/button/button.module.js +1 -1
  31. package/dist/components/button/index.js +1 -1
  32. package/dist/components/checkbox-field/checkbox-field.js +63 -49
  33. package/dist/components/checkbox-field/checkbox.css +105 -56
  34. package/dist/components/checkbox-field/checkbox.d.ts +3 -2
  35. package/dist/components/checkbox-field/checkbox.js +12 -9
  36. package/dist/components/checkbox-field/checkbox.module.js +4 -4
  37. package/dist/components/checkbox-group-field/checkbox-group-field.js +78 -72
  38. package/dist/components/checkbox-group-field/checkbox-group.css +14 -10
  39. package/dist/components/checkbox-group-field/checkbox-group.d.ts +2 -2
  40. package/dist/components/checkbox-group-field/checkbox-group.js +2 -2
  41. package/dist/components/checkbox-group-field/checkbox-group.module.js +2 -2
  42. package/dist/components/collapsible/collapsible.css +20 -20
  43. package/dist/components/collapsible/collapsible.d.ts +17 -4
  44. package/dist/components/collapsible/collapsible.js +83 -36
  45. package/dist/components/collapsible/collapsible.module.js +5 -5
  46. package/dist/components/combobox-field/combobox-field.js +206 -158
  47. package/dist/components/combobox-field/combobox.css +492 -277
  48. package/dist/components/combobox-field/combobox.d.ts +148 -39
  49. package/dist/components/combobox-field/combobox.js +506 -206
  50. package/dist/components/combobox-field/combobox.module.js +21 -21
  51. package/dist/components/combobox-field/value-state-view.css +5 -5
  52. package/dist/components/combobox-field/value-state-view.module.js +4 -4
  53. package/dist/components/composer/composer-attachments.d.ts +30 -11
  54. package/dist/components/composer/composer-attachments.js +45 -40
  55. package/dist/components/composer/composer-editor.css +40 -35
  56. package/dist/components/composer/composer-editor.d.ts +14 -4
  57. package/dist/components/composer/composer-editor.js +134 -44
  58. package/dist/components/composer/composer-editor.module.js +5 -5
  59. package/dist/components/composer/composer.css +22 -22
  60. package/dist/components/composer/composer.d.ts +13 -2
  61. package/dist/components/composer/composer.js +78 -63
  62. package/dist/components/composer/composer.module.js +5 -5
  63. package/dist/components/composer/index.d.ts +2 -2
  64. package/dist/components/composer/mention-text.css +5 -5
  65. package/dist/components/composer/mention-text.module.js +1 -1
  66. package/dist/components/confirm-dialog/confirm-dialog.css +29 -29
  67. package/dist/components/confirm-dialog/confirm-dialog.d.ts +57 -3
  68. package/dist/components/confirm-dialog/confirm-dialog.js +266 -108
  69. package/dist/components/confirm-dialog/confirm-dialog.module.js +5 -5
  70. package/dist/components/conversation/conversation.css +52 -52
  71. package/dist/components/conversation/conversation.d.ts +43 -18
  72. package/dist/components/conversation/conversation.js +120 -78
  73. package/dist/components/conversation/conversation.module.js +15 -15
  74. package/dist/components/date-field/date-field.d.ts +1 -1
  75. package/dist/components/date-field/date-field.js +202 -100
  76. package/dist/components/date-field/date-input.d.ts +73 -37
  77. package/dist/components/date-field/date-input.js +72 -45
  78. package/dist/components/date-field/index.d.ts +1 -1
  79. package/dist/components/date-range-field/date-range-field.d.ts +1 -1
  80. package/dist/components/date-range-field/date-range-field.js +219 -107
  81. package/dist/components/date-range-field/date-range-input.d.ts +84 -40
  82. package/dist/components/date-range-field/date-range-input.js +83 -48
  83. package/dist/components/dialog/dialog.css +32 -32
  84. package/dist/components/dialog/dialog.d.ts +8 -7
  85. package/dist/components/dialog/dialog.js +8 -26
  86. package/dist/components/dialog/dialog.module.js +6 -6
  87. package/dist/components/divider/divider.css +6 -6
  88. package/dist/components/divider/divider.d.ts +36 -2
  89. package/dist/components/divider/divider.js +195 -29
  90. package/dist/components/divider/divider.module.js +3 -3
  91. package/dist/components/drawer/drawer.css +55 -56
  92. package/dist/components/drawer/drawer.d.ts +8 -7
  93. package/dist/components/drawer/drawer.js +8 -26
  94. package/dist/components/drawer/drawer.module.js +6 -6
  95. package/dist/components/field/field.css +34 -24
  96. package/dist/components/field/field.d.ts +60 -37
  97. package/dist/components/field/field.js +242 -157
  98. package/dist/components/field/field.module.js +12 -10
  99. package/dist/components/field/input-parts.d.ts +11 -13
  100. package/dist/components/field/input-parts.js +23 -42
  101. package/dist/components/field-placeholder/field-placeholder.css +6 -6
  102. package/dist/components/field-placeholder/field-placeholder.module.js +4 -4
  103. package/dist/components/fieldset/field-group.d.ts +1 -1
  104. package/dist/components/fieldset/field-group.js +48 -42
  105. package/dist/components/fieldset/fieldset-root.d.ts +1 -1
  106. package/dist/components/fieldset/fieldset-root.js +19 -17
  107. package/dist/components/fieldset/fieldset.d.ts +2 -2
  108. package/dist/components/fieldset/fieldset.js +2 -2
  109. package/dist/components/file-field/file-field.css +126 -60
  110. package/dist/components/file-field/file-field.js +201 -109
  111. package/dist/components/file-field/file-field.module.js +4 -4
  112. package/dist/components/file-field/file-input.d.ts +66 -40
  113. package/dist/components/file-field/file-input.js +188 -132
  114. package/dist/components/filter-bar/filter-bar.css +8 -8
  115. package/dist/components/filter-bar/filter-bar.d.ts +12 -3
  116. package/dist/components/filter-bar/filter-bar.js +23 -25
  117. package/dist/components/filter-bar/filter-bar.module.js +5 -5
  118. package/dist/components/form/form.d.ts +19 -7
  119. package/dist/components/form/form.js +80 -29
  120. package/dist/components/icon/icon.css +2 -2
  121. package/dist/components/icon/icon.module.js +1 -1
  122. package/dist/components/link/link.css +6 -5
  123. package/dist/components/link/link.module.js +1 -1
  124. package/dist/components/menu/menu.css +52 -47
  125. package/dist/components/menu/menu.d.ts +32 -25
  126. package/dist/components/menu/menu.js +75 -124
  127. package/dist/components/menu/menu.module.js +8 -8
  128. package/dist/components/nav/nav-context.d.ts +1 -1
  129. package/dist/components/nav/nav-item-view.d.ts +10 -13
  130. package/dist/components/nav/nav-item-view.js +42 -54
  131. package/dist/components/nav/nav.css +150 -119
  132. package/dist/components/nav/nav.d.ts +61 -17
  133. package/dist/components/nav/nav.js +271 -176
  134. package/dist/components/nav/nav.module.js +17 -15
  135. package/dist/components/number-field/number-field.css +153 -64
  136. package/dist/components/number-field/number-field.d.ts +2 -2
  137. package/dist/components/number-field/number-field.js +112 -91
  138. package/dist/components/number-field/number-field.module.js +6 -6
  139. package/dist/components/number-field/number-input.d.ts +43 -23
  140. package/dist/components/number-field/number-input.js +179 -125
  141. package/dist/components/otp-field/otp-field.css +153 -60
  142. package/dist/components/otp-field/otp-field.d.ts +2 -2
  143. package/dist/components/otp-field/otp-field.js +62 -46
  144. package/dist/components/otp-field/otp-field.module.js +4 -4
  145. package/dist/components/otp-field/otp-input.d.ts +8 -6
  146. package/dist/components/otp-field/otp-input.js +92 -92
  147. package/dist/components/pagination/pagination.d.ts +46 -15
  148. package/dist/components/pagination/pagination.js +217 -224
  149. package/dist/components/password-field/password-field.css +23 -23
  150. package/dist/components/password-field/password-field.js +107 -85
  151. package/dist/components/password-field/password-field.module.js +8 -8
  152. package/dist/components/password-field/password-strength.d.ts +107 -3
  153. package/dist/components/password-field/password-strength.js +569 -92
  154. package/dist/components/photo-field/photo-field.js +137 -112
  155. package/dist/components/photo-field/photo-input.css +67 -44
  156. package/dist/components/photo-field/photo-input.d.ts +59 -15
  157. package/dist/components/photo-field/photo-input.js +173 -86
  158. package/dist/components/photo-field/photo-input.module.js +10 -8
  159. package/dist/components/popover/popover.css +41 -41
  160. package/dist/components/popover/popover.d.ts +66 -25
  161. package/dist/components/popover/popover.js +332 -217
  162. package/dist/components/popover/popover.module.js +15 -19
  163. package/dist/components/radio-group-field/radio-group-field.js +80 -71
  164. package/dist/components/radio-group-field/radio-group.css +112 -60
  165. package/dist/components/radio-group-field/radio-group.d.ts +19 -3
  166. package/dist/components/radio-group-field/radio-group.js +66 -23
  167. package/dist/components/radio-group-field/radio-group.module.js +4 -4
  168. package/dist/components/segmented-control-field/segmented-control-field.d.ts +1 -1
  169. package/dist/components/segmented-control-field/segmented-control-field.js +111 -96
  170. package/dist/components/segmented-control-field/segmented-control.css +132 -79
  171. package/dist/components/segmented-control-field/segmented-control.d.ts +39 -15
  172. package/dist/components/segmented-control-field/segmented-control.js +124 -41
  173. package/dist/components/segmented-control-field/segmented-control.module.js +4 -4
  174. package/dist/components/select-field/select.css +214 -101
  175. package/dist/components/select-field/select.d.ts +43 -11
  176. package/dist/components/select-field/select.js +194 -109
  177. package/dist/components/select-field/select.module.js +14 -14
  178. package/dist/components/skeleton/skeleton.css +4 -4
  179. package/dist/components/skeleton/skeleton.module.js +3 -3
  180. package/dist/components/stale/stale.css +15 -15
  181. package/dist/components/stale/stale.d.ts +27 -3
  182. package/dist/components/stale/stale.js +147 -66
  183. package/dist/components/stale/stale.module.js +6 -6
  184. package/dist/components/status-message/status-message.css +22 -22
  185. package/dist/components/status-message/status-message.module.js +6 -6
  186. package/dist/components/switch-field/switch-field.js +77 -57
  187. package/dist/components/switch-field/switch.css +112 -63
  188. package/dist/components/switch-field/switch.d.ts +20 -3
  189. package/dist/components/switch-field/switch.js +70 -27
  190. package/dist/components/switch-field/switch.module.js +4 -4
  191. package/dist/components/tabs/tabs.css +32 -32
  192. package/dist/components/tabs/tabs.d.ts +21 -7
  193. package/dist/components/tabs/tabs.js +73 -14
  194. package/dist/components/tabs/tabs.module.js +7 -7
  195. package/dist/components/tag/tag.css +84 -84
  196. package/dist/components/tag/tag.module.js +3 -3
  197. package/dist/components/tag-group/tag-group.css +94 -94
  198. package/dist/components/tag-group/tag-group.module.js +4 -4
  199. package/dist/components/text-field/text-field.css +159 -82
  200. package/dist/components/text-field/text-field.d.ts +1 -1
  201. package/dist/components/text-field/text-field.js +139 -110
  202. package/dist/components/text-field/text-field.module.js +9 -9
  203. package/dist/components/text-field/text-input.d.ts +81 -45
  204. package/dist/components/text-field/text-input.js +366 -217
  205. package/dist/components/textarea-field/textarea-field.css +7 -2
  206. package/dist/components/textarea-field/textarea-field.js +72 -56
  207. package/dist/components/textarea-field/textarea-field.module.js +2 -2
  208. package/dist/components/time-field/time-field.js +153 -60
  209. package/dist/components/time-field/time-input.d.ts +21 -10
  210. package/dist/components/time-field/time-input.js +22 -11
  211. package/dist/components/toast/toast-provider.css +34 -31
  212. package/dist/components/toast/toast-provider.d.ts +63 -14
  213. package/dist/components/toast/toast-provider.js +174 -111
  214. package/dist/components/toast/toast-provider.module.js +7 -7
  215. package/dist/components/toggle-group-field/toggle-group-field.d.ts +1 -1
  216. package/dist/components/toggle-group-field/toggle-group-field.js +95 -89
  217. package/dist/components/toggle-group-field/toggle-group.css +117 -67
  218. package/dist/components/toggle-group-field/toggle-group.d.ts +2 -2
  219. package/dist/components/toggle-group-field/toggle-group.js +2 -2
  220. package/dist/components/toggle-group-field/toggle-group.module.js +2 -2
  221. package/dist/components/tooltip/tooltip.css +4 -4
  222. package/dist/components/tooltip/tooltip.module.js +1 -1
  223. package/dist/data-table/data-table-content.js +6 -5
  224. package/dist/data-table/data-table-parts.d.ts +41 -13
  225. package/dist/data-table/data-table-parts.js +213 -172
  226. package/dist/data-table/data-table-selection.d.ts +105 -3
  227. package/dist/data-table/data-table-selection.js +654 -145
  228. package/dist/data-table/data-table.css +125 -128
  229. package/dist/data-table/data-table.d.ts +21 -26
  230. package/dist/data-table/data-table.js +20 -23
  231. package/dist/data-table/data-table.module.js +32 -34
  232. package/dist/data-table/index.d.ts +2 -2
  233. package/dist/index.js +3 -3
  234. package/dist/lib/calendar/calendar-navigation.d.ts +39 -5
  235. package/dist/lib/calendar/calendar-navigation.js +185 -118
  236. package/dist/lib/calendar/calendar-parts.d.ts +143 -0
  237. package/dist/lib/calendar/calendar-parts.js +540 -0
  238. package/dist/lib/calendar/calendar-prefab.d.ts +52 -0
  239. package/dist/lib/calendar/calendar-prefab.js +311 -0
  240. package/dist/lib/calendar/calendar-year.d.ts +3 -1
  241. package/dist/lib/calendar/calendar-year.js +139 -131
  242. package/dist/lib/calendar/temporal.css +325 -232
  243. package/dist/lib/calendar/temporal.d.ts +67 -82
  244. package/dist/lib/calendar/temporal.js +258 -569
  245. package/dist/lib/calendar/temporal.module.js +38 -38
  246. package/dist/lib/forms/use-connected-field.d.ts +1 -1
  247. package/dist/lib/forms/use-connected-field.js +1 -1
  248. package/dist/lib/render-as.d.ts +13 -0
  249. package/dist/lib/render-as.js +46 -0
  250. package/dist/terrazzo/index.d.ts +4 -3
  251. package/dist/terrazzo/index.js +17 -6
  252. package/dist/tokens.css +28 -4
  253. package/package.json +2 -2
  254. package/tokens/dark.tokens.json +6 -0
  255. package/tokens/sys.tokens.json +7 -0
  256. package/dist/components/button/close-button.d.ts +0 -16
  257. package/dist/components/button/close-button.js +0 -30
@@ -1,6 +1,6 @@
1
1
  import { useRender } from "@base-ui/react/use-render";
2
2
  import { type ReactElement, type ReactNode } from "react";
3
- import { AttachmentPreview } from "./attachment-preview.tsx";
3
+ import { AttachmentExtension, AttachmentIcon, AttachmentImage, AttachmentName, AttachmentPreview, AttachmentSkeleton } from "./attachment-preview.tsx";
4
4
  export type AttachmentTileRootProps = useRender.ComponentProps<"span"> & Readonly<{
5
5
  /** Renders with an error treatment, such as for an oversized file. */
6
6
  invalid?: boolean;
@@ -10,19 +10,33 @@ export type AttachmentTileRootProps = useRender.ComponentProps<"span"> & Readonl
10
10
  * `TagList` for a staged file, or as an `<a>` for a download.
11
11
  */
12
12
  declare const Root: ({ invalid, className, render, ref, ...props }: AttachmentTileRootProps) => ReactElement;
13
+ /**
14
+ * The corner of a tile that a remove button sits in.
15
+ *
16
+ * @example
17
+ * <AttachmentTile.Corner><AttachmentTile.Remove render={…} /></AttachmentTile.Corner>
18
+ */
19
+ declare const Corner: ({ className, render, ref, ...props }: useRender.ComponentProps<"span">) => ReactElement;
13
20
  export type AttachmentTileRemoveProps = Readonly<{
14
- /** The button's accessible name and tooltip, such as "Remove". */
15
- label: string;
16
- /** The remove glyph. */
17
- children: ReactNode;
21
+ /** The button to render, such as `<IconButton label="Remove" variant="tertiary" size="sm"><CloseIcon /></IconButton>`. */
22
+ render: useRender.RenderProp;
18
23
  className?: string;
19
24
  }>;
20
25
  /**
21
- * The pointer-only remove button in a staged tile's corner, its children the
22
- * glyph. The surrounding `TagGroup` owns the removal, and the keyboard removes
23
- * with Delete.
26
+ * The pointer-only remove button of a staged tile, as react-aria's remove
27
+ * slot. It renders whichever button it is given. The surrounding `TagGroup`
28
+ * owns the removal, and the keyboard removes with Delete.
29
+ *
30
+ * @example
31
+ * <AttachmentTile.Remove
32
+ * render={
33
+ * <IconButton label="Remove" variant="tertiary" size="sm">
34
+ * <CloseIcon />
35
+ * </IconButton>
36
+ * }
37
+ * />
24
38
  */
25
- declare const Remove: ({ label, children, className, }: AttachmentTileRemoveProps) => ReactNode;
39
+ declare const Remove: ({ render, className, }: AttachmentTileRemoveProps) => ReactNode;
26
40
  export type AttachmentTileProps = Readonly<{
27
41
  id: string;
28
42
  file: File;
@@ -48,13 +62,21 @@ declare const Prefab: ({ id, file, hint, removeLabel, removeIcon, invalid, disab
48
62
  export type AttachmentTileParts = typeof Prefab & Readonly<{
49
63
  Root: typeof Root;
50
64
  Preview: typeof AttachmentPreview;
65
+ Image: typeof AttachmentImage;
66
+ Icon: typeof AttachmentIcon;
67
+ Extension: typeof AttachmentExtension;
68
+ Skeleton: typeof AttachmentSkeleton;
69
+ Name: typeof AttachmentName;
70
+ Corner: typeof Corner;
51
71
  Remove: typeof Remove;
52
72
  }>;
53
73
  /**
54
74
  * A single staged attachment as a square thumbnail inside a `TagList`: an image
55
75
  * preview where the file is one, its extension otherwise, and a pointer-only
56
76
  * remove button in the corner. Removal is owned by the surrounding `TagGroup`.
57
- * The parts hanging off it compose a tile by hand.
77
+ * The parts hanging off it compose a tile by hand: a `Preview` holding the
78
+ * `Image`, or the `Icon` and `Extension`, a `Skeleton` and the `Name`, and a
79
+ * `Remove` button in the `Corner`.
58
80
  *
59
81
  * @example
60
82
  * <AttachmentTile id={id} file={file} hint={hint} removeLabel="Remove" removeIcon={<CloseIcon />} invalid={false} disabled={false} />
@@ -1,5 +1,7 @@
1
- import { Button as Button$1 } from "../button/button.js";
2
- import { AttachmentPreview, useAttachmentPreview } from "./attachment-preview.js";
1
+ import { renderAs } from "../../lib/render-as.js";
2
+ import { IconButton } from "../button/button.js";
3
+ import { Tooltip } from "../tooltip/tooltip.js";
4
+ import { AttachmentExtension, AttachmentIcon, AttachmentImage, AttachmentName, AttachmentPreview, AttachmentSkeleton, useAttachmentPreview } from "./attachment-preview.js";
3
5
  import attachment_tile_module_default from "./attachment-tile.module.js";
4
6
  import { c } from "react/compiler-runtime";
5
7
  import { useRender } from "@base-ui/react/use-render";
@@ -70,57 +72,162 @@ var Root = (t0) => {
70
72
  return useRender(t5);
71
73
  };
72
74
  /**
73
- * The pointer-only remove button in a staged tile's corner, its children the
74
- * glyph. The surrounding `TagGroup` owns the removal, and the keyboard removes
75
- * with Delete.
75
+ * The corner of a tile that a remove button sits in.
76
+ *
77
+ * @example
78
+ * <AttachmentTile.Corner><AttachmentTile.Remove render={…} /></AttachmentTile.Corner>
79
+ */
80
+ var Corner = (t0) => {
81
+ const $ = c(14);
82
+ let className;
83
+ let props;
84
+ let ref;
85
+ let render;
86
+ if ($[0] !== t0) {
87
+ ({className, render, ref, ...props} = t0);
88
+ $[0] = t0;
89
+ $[1] = className;
90
+ $[2] = props;
91
+ $[3] = ref;
92
+ $[4] = render;
93
+ } else {
94
+ className = $[1];
95
+ props = $[2];
96
+ ref = $[3];
97
+ render = $[4];
98
+ }
99
+ let t1;
100
+ if ($[5] !== className) {
101
+ t1 = clsx(attachment_tile_module_default.remove, className);
102
+ $[5] = className;
103
+ $[6] = t1;
104
+ } else t1 = $[6];
105
+ let t2;
106
+ if ($[7] !== props || $[8] !== t1) {
107
+ t2 = {
108
+ ...props,
109
+ className: t1
110
+ };
111
+ $[7] = props;
112
+ $[8] = t1;
113
+ $[9] = t2;
114
+ } else t2 = $[9];
115
+ let t3;
116
+ if ($[10] !== ref || $[11] !== render || $[12] !== t2) {
117
+ t3 = {
118
+ defaultTagName: "span",
119
+ render,
120
+ ref,
121
+ props: t2
122
+ };
123
+ $[10] = ref;
124
+ $[11] = render;
125
+ $[12] = t2;
126
+ $[13] = t3;
127
+ } else t3 = $[13];
128
+ return useRender(t3);
129
+ };
130
+ /**
131
+ * The pointer-only remove button of a staged tile, as react-aria's remove
132
+ * slot. It renders whichever button it is given. The surrounding `TagGroup`
133
+ * owns the removal, and the keyboard removes with Delete.
134
+ *
135
+ * @example
136
+ * <AttachmentTile.Remove
137
+ * render={
138
+ * <IconButton label="Remove" variant="tertiary" size="sm">
139
+ * <CloseIcon />
140
+ * </IconButton>
141
+ * }
142
+ * />
76
143
  */
77
144
  var Remove = (t0) => {
78
- const $ = c(11);
79
- const { label, children, className } = t0;
145
+ const $ = c(6);
146
+ const { render, className } = t0;
80
147
  const removeId = useId();
81
148
  let t1;
82
- if ($[0] !== className) {
83
- t1 = clsx(attachment_tile_module_default.remove, className);
84
- $[0] = className;
149
+ if ($[0] !== render) {
150
+ t1 = renderAs(render);
151
+ $[0] = render;
85
152
  $[1] = t1;
86
153
  } else t1 = $[1];
87
154
  let t2;
88
- if ($[2] !== removeId) {
155
+ if ($[2] !== className || $[3] !== removeId || $[4] !== t1) {
89
156
  t2 = /* @__PURE__ */ jsx(Button, {
90
157
  slot: "remove",
91
158
  id: removeId,
92
159
  "aria-labelledby": removeId,
93
- excludeFromTabOrder: true
160
+ excludeFromTabOrder: true,
161
+ className,
162
+ render: t1
94
163
  });
95
- $[2] = removeId;
96
- $[3] = t2;
97
- } else t2 = $[3];
164
+ $[2] = className;
165
+ $[3] = removeId;
166
+ $[4] = t1;
167
+ $[5] = t2;
168
+ } else t2 = $[5];
169
+ return t2;
170
+ };
171
+ var PreviewContent = (t0) => {
172
+ const $ = c(14);
173
+ const { name, hint, src, pending, icon } = t0;
174
+ let t1;
175
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
176
+ t1 = /* @__PURE__ */ jsx(AttachmentImage, {});
177
+ $[0] = t1;
178
+ } else t1 = $[0];
179
+ let t2;
180
+ if ($[1] !== icon) {
181
+ t2 = /* @__PURE__ */ jsx(AttachmentIcon, { children: icon });
182
+ $[1] = icon;
183
+ $[2] = t2;
184
+ } else t2 = $[2];
98
185
  let t3;
99
- if ($[4] !== children || $[5] !== label || $[6] !== t2) {
100
- t3 = /* @__PURE__ */ jsx(Button$1, {
101
- variant: "tertiary",
102
- size: "sm",
103
- iconOnly: true,
104
- icon: children,
105
- label,
106
- render: t2
107
- });
108
- $[4] = children;
109
- $[5] = label;
110
- $[6] = t2;
111
- $[7] = t3;
112
- } else t3 = $[7];
113
186
  let t4;
114
- if ($[8] !== t1 || $[9] !== t3) {
115
- t4 = /* @__PURE__ */ jsx("span", {
116
- className: t1,
117
- children: t3
187
+ let t5;
188
+ if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
189
+ t3 = /* @__PURE__ */ jsx(AttachmentExtension, {});
190
+ t4 = /* @__PURE__ */ jsx(AttachmentSkeleton, {});
191
+ t5 = /* @__PURE__ */ jsx(AttachmentName, {});
192
+ $[3] = t3;
193
+ $[4] = t4;
194
+ $[5] = t5;
195
+ } else {
196
+ t3 = $[3];
197
+ t4 = $[4];
198
+ t5 = $[5];
199
+ }
200
+ let t6;
201
+ if ($[6] !== name || $[7] !== pending || $[8] !== src || $[9] !== t2) {
202
+ t6 = /* @__PURE__ */ jsxs(AttachmentPreview, {
203
+ name,
204
+ src,
205
+ pending,
206
+ children: [
207
+ t1,
208
+ t2,
209
+ t3,
210
+ t4,
211
+ t5
212
+ ]
118
213
  });
119
- $[8] = t1;
120
- $[9] = t3;
121
- $[10] = t4;
122
- } else t4 = $[10];
123
- return t4;
214
+ $[6] = name;
215
+ $[7] = pending;
216
+ $[8] = src;
217
+ $[9] = t2;
218
+ $[10] = t6;
219
+ } else t6 = $[10];
220
+ let t7;
221
+ if ($[11] !== hint || $[12] !== t6) {
222
+ t7 = /* @__PURE__ */ jsx(Tooltip, {
223
+ content: hint,
224
+ children: t6
225
+ });
226
+ $[11] = hint;
227
+ $[12] = t6;
228
+ $[13] = t7;
229
+ } else t7 = $[13];
230
+ return t7;
124
231
  };
125
232
  var Prefab = (t0) => {
126
233
  const $ = c(19);
@@ -140,7 +247,7 @@ var Prefab = (t0) => {
140
247
  } else t1 = $[3];
141
248
  let t2;
142
249
  if ($[4] !== file.name || $[5] !== hint || $[6] !== icon || $[7] !== preview.pending || $[8] !== preview.src) {
143
- t2 = /* @__PURE__ */ jsx(AttachmentPreview, {
250
+ t2 = /* @__PURE__ */ jsx(PreviewContent, {
144
251
  name: file.name,
145
252
  hint,
146
253
  src: preview.src,
@@ -156,10 +263,12 @@ var Prefab = (t0) => {
156
263
  } else t2 = $[9];
157
264
  let t3;
158
265
  if ($[10] !== removeIcon || $[11] !== removeLabel) {
159
- t3 = removeLabel === void 0 ? null : /* @__PURE__ */ jsx(Remove, {
266
+ t3 = removeLabel === void 0 ? null : /* @__PURE__ */ jsx(Corner, { children: /* @__PURE__ */ jsx(Remove, { render: /* @__PURE__ */ jsx(IconButton, {
267
+ variant: "tertiary",
268
+ size: "sm",
160
269
  label: removeLabel,
161
270
  children: removeIcon
162
- });
271
+ }) }) });
163
272
  $[10] = removeIcon;
164
273
  $[11] = removeLabel;
165
274
  $[12] = t3;
@@ -185,7 +294,9 @@ var Prefab = (t0) => {
185
294
  * A single staged attachment as a square thumbnail inside a `TagList`: an image
186
295
  * preview where the file is one, its extension otherwise, and a pointer-only
187
296
  * remove button in the corner. Removal is owned by the surrounding `TagGroup`.
188
- * The parts hanging off it compose a tile by hand.
297
+ * The parts hanging off it compose a tile by hand: a `Preview` holding the
298
+ * `Image`, or the `Icon` and `Extension`, a `Skeleton` and the `Name`, and a
299
+ * `Remove` button in the `Corner`.
189
300
  *
190
301
  * @example
191
302
  * <AttachmentTile id={id} file={file} hint={hint} removeLabel="Remove" removeIcon={<CloseIcon />} invalid={false} disabled={false} />
@@ -193,6 +304,12 @@ var Prefab = (t0) => {
193
304
  var AttachmentTile = Object.assign(Prefab, {
194
305
  Root,
195
306
  Preview: AttachmentPreview,
307
+ Image: AttachmentImage,
308
+ Icon: AttachmentIcon,
309
+ Extension: AttachmentExtension,
310
+ Skeleton: AttachmentSkeleton,
311
+ Name: AttachmentName,
312
+ Corner,
196
313
  Remove
197
314
  });
198
315
  /**
@@ -219,7 +336,7 @@ var SentAttachmentTile = (props) => {
219
336
  } else t0 = $[3];
220
337
  let t1;
221
338
  if ($[4] !== props.hint || $[5] !== props.icon || $[6] !== props.name || $[7] !== props.pending || $[8] !== props.src) {
222
- t1 = /* @__PURE__ */ jsx(AttachmentPreview, {
339
+ t1 = /* @__PURE__ */ jsx(PreviewContent, {
223
340
  name: props.name,
224
341
  hint: props.hint,
225
342
  src: props.src,
@@ -1,12 +1,12 @@
1
1
  import './attachment-tile.css';// src/components/attachment-tile/attachment-tile.module.scss
2
- var tile = "_tile_gqsrq_3";
3
- var preview = "_preview_gqsrq_48";
4
- var image = "_image_gqsrq_59";
5
- var imageSkeleton = "_imageSkeleton_gqsrq_64";
6
- var icon = "_icon_gqsrq_71";
7
- var extension = "_extension_gqsrq_80";
8
- var name = "_name_gqsrq_84";
9
- var remove = "_remove_gqsrq_92";
2
+ var tile = "_tile_1h7zv_3";
3
+ var preview = "_preview_1h7zv_51";
4
+ var image = "_image_1h7zv_62";
5
+ var imageSkeleton = "_imageSkeleton_1h7zv_67";
6
+ var icon = "_icon_1h7zv_77";
7
+ var extension = "_extension_1h7zv_86";
8
+ var name = "_name_1h7zv_90";
9
+ var remove = "_remove_1h7zv_98";
10
10
  var attachment_tile_module_default = {
11
11
  tile,
12
12
  preview,
@@ -1,2 +1,2 @@
1
- export { type AttachmentPreviewProps, type AttachmentPreviewSource, useAttachmentPreview, } from "./attachment-preview.tsx";
1
+ export { type AttachmentImageProps, type AttachmentPreviewProps, type AttachmentPreviewSource, type AttachmentSkeletonProps, type AttachmentTextProps, useAttachmentPreview, } from "./attachment-preview.tsx";
2
2
  export * from "./attachment-tile.tsx";
@@ -1,6 +1,6 @@
1
1
  @layer kit.reset, kit.base, kit.components;
2
2
  @layer kit.components {
3
- ._avatar_1sy4c_3 {
3
+ ._avatar_18yef_3 {
4
4
  --_avatar-bg: var(--sys-color-primary-container);
5
5
  --_avatar-fg: var(--sys-color-on-primary-container);
6
6
  position: relative;
@@ -8,37 +8,37 @@
8
8
  flex-shrink: 0;
9
9
  align-items: center;
10
10
  justify-content: center;
11
- border-radius: var(--sys-radius-circle);
11
+ border-radius: var(--avatar-radius, var(--sys-radius-circle));
12
12
  background-color: var(--avatar-bg, var(--_avatar-bg));
13
13
  color: var(--avatar-fg, var(--_avatar-fg));
14
- font-weight: 600;
14
+ font-weight: var(--avatar-font-weight, 600);
15
15
  line-height: 1;
16
16
  text-transform: uppercase;
17
17
  overflow: hidden;
18
18
  }
19
- ._avatar_1sy4c_3[data-tone="1"] {
19
+ ._avatar_18yef_3[data-tone="1"] {
20
20
  --_avatar-bg: var(--sys-color-identity-1-bg);
21
21
  --_avatar-fg: var(--sys-color-identity-1-fg);
22
22
  }
23
- ._avatar_1sy4c_3[data-tone="2"] {
23
+ ._avatar_18yef_3[data-tone="2"] {
24
24
  --_avatar-bg: var(--sys-color-identity-2-bg);
25
25
  --_avatar-fg: var(--sys-color-identity-2-fg);
26
26
  }
27
- ._avatar_1sy4c_3[data-tone="3"] {
27
+ ._avatar_18yef_3[data-tone="3"] {
28
28
  --_avatar-bg: var(--sys-color-identity-3-bg);
29
29
  --_avatar-fg: var(--sys-color-identity-3-fg);
30
30
  }
31
- ._avatar_1sy4c_3[data-tone="4"] {
31
+ ._avatar_18yef_3[data-tone="4"] {
32
32
  --_avatar-bg: var(--sys-color-identity-4-bg);
33
33
  --_avatar-fg: var(--sys-color-identity-4-fg);
34
34
  }
35
- ._image_1sy4c_35 {
35
+ ._image_18yef_35 {
36
36
  inline-size: 100%;
37
37
  block-size: 100%;
38
38
  border-radius: inherit;
39
39
  object-fit: cover;
40
40
  }
41
- ._fallback_1sy4c_41 {
41
+ ._fallback_18yef_41 {
42
42
  display: inline-flex;
43
43
  align-items: center;
44
44
  justify-content: center;
@@ -1,19 +1,64 @@
1
+ import { Avatar as BaseAvatar } from "@base-ui/react/avatar";
1
2
  import type { ComponentPropsWithRef, ReactNode } from "react";
2
- export type AvatarProps = Omit<ComponentPropsWithRef<"span">, "children"> & Readonly<{
3
+ export type AvatarRootProps = ComponentPropsWithRef<"span"> & Readonly<{
4
+ /** Display name; drives the (stable) tone. */
5
+ name: string;
6
+ /** Diameter relative to the surrounding font size (in `em`). @default 2.5 */
7
+ size?: number;
8
+ }>;
9
+ /**
10
+ * The circle, in a colour that stays the same for the same `name`. Decorative:
11
+ * the name it stands for is always beside it, so it is not announced.
12
+ *
13
+ * @example
14
+ * <Avatar.Root name="Ada Lovelace">
15
+ * <Avatar.Image src={colleague.portraitUrl} />
16
+ * <Avatar.Fallback>AL</Avatar.Fallback>
17
+ * </Avatar.Root>
18
+ */
19
+ declare const Root: ({ name, size, className, style: inlineStyle, ...props }: AvatarRootProps) => ReactNode;
20
+ export type AvatarImageProps = Omit<BaseAvatar.Image.Props, "className"> & Readonly<{
21
+ className?: string;
22
+ }>;
23
+ /**
24
+ * The portrait, shown once it has loaded.
25
+ *
26
+ * @example
27
+ * <Avatar.Image src={colleague.portraitUrl} />
28
+ */
29
+ declare const Image: ({ alt, className, ...props }: AvatarImageProps) => ReactNode;
30
+ export type AvatarFallbackProps = Omit<BaseAvatar.Fallback.Props, "className"> & Readonly<{
31
+ className?: string;
32
+ }>;
33
+ /**
34
+ * What shows while there is no portrait, or while it loads or fails, such as
35
+ * the initials.
36
+ *
37
+ * @example
38
+ * <Avatar.Fallback>AL</Avatar.Fallback>
39
+ */
40
+ declare const Fallback: ({ className, ...props }: AvatarFallbackProps) => ReactNode;
41
+ export type AvatarProps = Omit<AvatarRootProps, "children"> & Readonly<{
3
42
  /** Display name; drives the initials and the (stable) tone. */
4
43
  name: string;
5
44
  /** Portrait to show in place of the initials, where there is one. */
6
45
  src?: string;
7
- /** Diameter relative to the surrounding font size (in `em`). @default 2.5 */
8
- size?: number;
46
+ }>;
47
+ declare const Prefab: ({ name, src, ...props }: AvatarProps) => ReactNode;
48
+ /** The parts of an avatar, hanging off its prefab. */
49
+ export type AvatarParts = typeof Prefab & Readonly<{
50
+ Root: typeof Root;
51
+ Image: typeof Image;
52
+ Fallback: typeof Fallback;
9
53
  }>;
10
54
  /**
11
55
  * A small circular avatar: the portrait at `src`, falling back to initials over
12
56
  * a colour that stays the same for the same name. Decorative: the name it
13
57
  * stands for is always beside it, so it is not announced. Other props go to
14
- * the `<span>`.
58
+ * the `<span>`. The parts hanging off it compose one by hand.
15
59
  *
16
60
  * @example
17
61
  * <Avatar name="Ada Lovelace" src={colleague.portraitUrl} />
18
62
  */
19
- export declare const Avatar: ({ name, src, size, className, style: inlineStyle, ...props }: AvatarProps) => ReactNode;
63
+ export declare const Avatar: AvatarParts;
64
+ export {};