@igne-agency/react-web-ui 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/accordion/accordion.css +21 -21
- package/dist/components/accordion/accordion.d.ts +17 -4
- package/dist/components/accordion/accordion.js +83 -36
- package/dist/components/accordion/accordion.module.js +6 -6
- package/dist/components/attachment-tile/attachment-preview.d.ts +56 -13
- package/dist/components/attachment-tile/attachment-preview.js +388 -119
- package/dist/components/attachment-tile/attachment-tile.css +31 -25
- package/dist/components/attachment-tile/attachment-tile.d.ts +32 -10
- package/dist/components/attachment-tile/attachment-tile.js +160 -43
- package/dist/components/attachment-tile/attachment-tile.module.js +8 -8
- package/dist/components/attachment-tile/index.d.ts +1 -1
- package/dist/components/avatar/avatar.css +9 -9
- package/dist/components/avatar/avatar.d.ts +50 -5
- package/dist/components/avatar/avatar.js +178 -64
- package/dist/components/avatar/avatar.module.js +3 -3
- package/dist/components/avatar-group/avatar-group-context.d.ts +2 -4
- package/dist/components/avatar-group/avatar-group-context.js +2 -2
- package/dist/components/avatar-group/avatar-group.css +26 -20
- package/dist/components/avatar-group/avatar-group.d.ts +85 -27
- package/dist/components/avatar-group/avatar-group.js +400 -246
- package/dist/components/avatar-group/avatar-group.module.js +8 -8
- package/dist/components/breadcrumbs/breadcrumbs.css +12 -12
- package/dist/components/breadcrumbs/breadcrumbs.d.ts +69 -23
- package/dist/components/breadcrumbs/breadcrumbs.js +299 -248
- package/dist/components/breadcrumbs/breadcrumbs.module.js +8 -8
- package/dist/components/button/button.css +29 -31
- package/dist/components/button/button.d.ts +20 -16
- package/dist/components/button/button.js +140 -145
- package/dist/components/button/button.module.js +1 -1
- package/dist/components/button/index.js +1 -1
- package/dist/components/checkbox-field/checkbox-field.js +63 -49
- package/dist/components/checkbox-field/checkbox.css +105 -56
- package/dist/components/checkbox-field/checkbox.d.ts +3 -2
- package/dist/components/checkbox-field/checkbox.js +12 -9
- package/dist/components/checkbox-field/checkbox.module.js +4 -4
- package/dist/components/checkbox-group-field/checkbox-group-field.js +78 -72
- package/dist/components/checkbox-group-field/checkbox-group.css +14 -10
- package/dist/components/checkbox-group-field/checkbox-group.d.ts +2 -2
- package/dist/components/checkbox-group-field/checkbox-group.js +2 -2
- package/dist/components/checkbox-group-field/checkbox-group.module.js +2 -2
- package/dist/components/collapsible/collapsible.css +20 -20
- package/dist/components/collapsible/collapsible.d.ts +17 -4
- package/dist/components/collapsible/collapsible.js +83 -36
- package/dist/components/collapsible/collapsible.module.js +5 -5
- package/dist/components/combobox-field/combobox-field.js +206 -158
- package/dist/components/combobox-field/combobox.css +492 -277
- package/dist/components/combobox-field/combobox.d.ts +148 -39
- package/dist/components/combobox-field/combobox.js +506 -206
- package/dist/components/combobox-field/combobox.module.js +21 -21
- package/dist/components/combobox-field/value-state-view.css +5 -5
- package/dist/components/combobox-field/value-state-view.module.js +4 -4
- package/dist/components/composer/composer-attachments.d.ts +30 -11
- package/dist/components/composer/composer-attachments.js +45 -40
- package/dist/components/composer/composer-editor.css +40 -35
- package/dist/components/composer/composer-editor.d.ts +14 -4
- package/dist/components/composer/composer-editor.js +134 -44
- package/dist/components/composer/composer-editor.module.js +5 -5
- package/dist/components/composer/composer.css +22 -22
- package/dist/components/composer/composer.d.ts +13 -2
- package/dist/components/composer/composer.js +78 -63
- package/dist/components/composer/composer.module.js +5 -5
- package/dist/components/composer/index.d.ts +2 -2
- package/dist/components/composer/mention-text.css +5 -5
- package/dist/components/composer/mention-text.module.js +1 -1
- package/dist/components/confirm-dialog/confirm-dialog.css +29 -29
- package/dist/components/confirm-dialog/confirm-dialog.d.ts +57 -3
- package/dist/components/confirm-dialog/confirm-dialog.js +266 -108
- package/dist/components/confirm-dialog/confirm-dialog.module.js +5 -5
- package/dist/components/conversation/conversation.css +52 -52
- package/dist/components/conversation/conversation.d.ts +43 -18
- package/dist/components/conversation/conversation.js +120 -78
- package/dist/components/conversation/conversation.module.js +15 -15
- package/dist/components/date-field/date-field.d.ts +1 -1
- package/dist/components/date-field/date-field.js +202 -100
- package/dist/components/date-field/date-input.d.ts +73 -37
- package/dist/components/date-field/date-input.js +72 -45
- package/dist/components/date-field/index.d.ts +1 -1
- package/dist/components/date-range-field/date-range-field.d.ts +1 -1
- package/dist/components/date-range-field/date-range-field.js +219 -107
- package/dist/components/date-range-field/date-range-input.d.ts +84 -40
- package/dist/components/date-range-field/date-range-input.js +83 -48
- package/dist/components/dialog/dialog.css +32 -32
- package/dist/components/dialog/dialog.d.ts +8 -7
- package/dist/components/dialog/dialog.js +8 -26
- package/dist/components/dialog/dialog.module.js +6 -6
- package/dist/components/divider/divider.css +6 -6
- package/dist/components/divider/divider.d.ts +36 -2
- package/dist/components/divider/divider.js +195 -29
- package/dist/components/divider/divider.module.js +3 -3
- package/dist/components/drawer/drawer.css +55 -56
- package/dist/components/drawer/drawer.d.ts +8 -7
- package/dist/components/drawer/drawer.js +8 -26
- package/dist/components/drawer/drawer.module.js +6 -6
- package/dist/components/field/field.css +34 -24
- package/dist/components/field/field.d.ts +60 -37
- package/dist/components/field/field.js +242 -157
- package/dist/components/field/field.module.js +12 -10
- package/dist/components/field/input-parts.d.ts +11 -13
- package/dist/components/field/input-parts.js +23 -42
- package/dist/components/field-placeholder/field-placeholder.css +6 -6
- package/dist/components/field-placeholder/field-placeholder.module.js +4 -4
- package/dist/components/fieldset/field-group.d.ts +1 -1
- package/dist/components/fieldset/field-group.js +48 -42
- package/dist/components/fieldset/fieldset-root.d.ts +1 -1
- package/dist/components/fieldset/fieldset-root.js +19 -17
- package/dist/components/fieldset/fieldset.d.ts +2 -2
- package/dist/components/fieldset/fieldset.js +2 -2
- package/dist/components/file-field/file-field.css +126 -60
- package/dist/components/file-field/file-field.js +201 -109
- package/dist/components/file-field/file-field.module.js +4 -4
- package/dist/components/file-field/file-input.d.ts +66 -40
- package/dist/components/file-field/file-input.js +188 -132
- package/dist/components/filter-bar/filter-bar.css +8 -8
- package/dist/components/filter-bar/filter-bar.d.ts +12 -3
- package/dist/components/filter-bar/filter-bar.js +23 -25
- package/dist/components/filter-bar/filter-bar.module.js +5 -5
- package/dist/components/form/form.d.ts +19 -7
- package/dist/components/form/form.js +80 -29
- package/dist/components/icon/icon.css +2 -2
- package/dist/components/icon/icon.module.js +1 -1
- package/dist/components/link/link.css +6 -5
- package/dist/components/link/link.module.js +1 -1
- package/dist/components/menu/menu.css +52 -47
- package/dist/components/menu/menu.d.ts +32 -25
- package/dist/components/menu/menu.js +75 -124
- package/dist/components/menu/menu.module.js +8 -8
- package/dist/components/nav/nav-context.d.ts +1 -1
- package/dist/components/nav/nav-item-view.d.ts +10 -13
- package/dist/components/nav/nav-item-view.js +42 -54
- package/dist/components/nav/nav.css +150 -119
- package/dist/components/nav/nav.d.ts +61 -17
- package/dist/components/nav/nav.js +271 -176
- package/dist/components/nav/nav.module.js +17 -15
- package/dist/components/number-field/number-field.css +153 -64
- package/dist/components/number-field/number-field.d.ts +2 -2
- package/dist/components/number-field/number-field.js +112 -91
- package/dist/components/number-field/number-field.module.js +6 -6
- package/dist/components/number-field/number-input.d.ts +43 -23
- package/dist/components/number-field/number-input.js +179 -125
- package/dist/components/otp-field/otp-field.css +153 -60
- package/dist/components/otp-field/otp-field.d.ts +2 -2
- package/dist/components/otp-field/otp-field.js +62 -46
- package/dist/components/otp-field/otp-field.module.js +4 -4
- package/dist/components/otp-field/otp-input.d.ts +8 -6
- package/dist/components/otp-field/otp-input.js +92 -92
- package/dist/components/pagination/pagination.d.ts +46 -15
- package/dist/components/pagination/pagination.js +217 -224
- package/dist/components/password-field/password-field.css +23 -23
- package/dist/components/password-field/password-field.js +107 -85
- package/dist/components/password-field/password-field.module.js +8 -8
- package/dist/components/password-field/password-strength.d.ts +107 -3
- package/dist/components/password-field/password-strength.js +569 -92
- package/dist/components/photo-field/photo-field.js +137 -112
- package/dist/components/photo-field/photo-input.css +67 -44
- package/dist/components/photo-field/photo-input.d.ts +59 -15
- package/dist/components/photo-field/photo-input.js +173 -86
- package/dist/components/photo-field/photo-input.module.js +10 -8
- package/dist/components/popover/popover.css +41 -41
- package/dist/components/popover/popover.d.ts +66 -25
- package/dist/components/popover/popover.js +332 -217
- package/dist/components/popover/popover.module.js +15 -19
- package/dist/components/radio-group-field/radio-group-field.js +80 -71
- package/dist/components/radio-group-field/radio-group.css +112 -60
- package/dist/components/radio-group-field/radio-group.d.ts +19 -3
- package/dist/components/radio-group-field/radio-group.js +66 -23
- package/dist/components/radio-group-field/radio-group.module.js +4 -4
- package/dist/components/segmented-control-field/segmented-control-field.d.ts +1 -1
- package/dist/components/segmented-control-field/segmented-control-field.js +111 -96
- package/dist/components/segmented-control-field/segmented-control.css +132 -79
- package/dist/components/segmented-control-field/segmented-control.d.ts +39 -15
- package/dist/components/segmented-control-field/segmented-control.js +124 -41
- package/dist/components/segmented-control-field/segmented-control.module.js +4 -4
- package/dist/components/select-field/select.css +214 -101
- package/dist/components/select-field/select.d.ts +43 -11
- package/dist/components/select-field/select.js +194 -109
- package/dist/components/select-field/select.module.js +14 -14
- package/dist/components/skeleton/skeleton.css +4 -4
- package/dist/components/skeleton/skeleton.module.js +3 -3
- package/dist/components/stale/stale.css +15 -15
- package/dist/components/stale/stale.d.ts +27 -3
- package/dist/components/stale/stale.js +147 -66
- package/dist/components/stale/stale.module.js +6 -6
- package/dist/components/status-message/status-message.css +22 -22
- package/dist/components/status-message/status-message.module.js +6 -6
- package/dist/components/switch-field/switch-field.js +77 -57
- package/dist/components/switch-field/switch.css +112 -63
- package/dist/components/switch-field/switch.d.ts +20 -3
- package/dist/components/switch-field/switch.js +70 -27
- package/dist/components/switch-field/switch.module.js +4 -4
- package/dist/components/tabs/tabs.css +32 -32
- package/dist/components/tabs/tabs.d.ts +21 -7
- package/dist/components/tabs/tabs.js +73 -14
- package/dist/components/tabs/tabs.module.js +7 -7
- package/dist/components/tag/tag.css +84 -84
- package/dist/components/tag/tag.module.js +3 -3
- package/dist/components/tag-group/tag-group.css +94 -94
- package/dist/components/tag-group/tag-group.module.js +4 -4
- package/dist/components/text-field/text-field.css +159 -82
- package/dist/components/text-field/text-field.d.ts +1 -1
- package/dist/components/text-field/text-field.js +139 -110
- package/dist/components/text-field/text-field.module.js +9 -9
- package/dist/components/text-field/text-input.d.ts +81 -45
- package/dist/components/text-field/text-input.js +366 -217
- package/dist/components/textarea-field/textarea-field.css +7 -2
- package/dist/components/textarea-field/textarea-field.js +72 -56
- package/dist/components/textarea-field/textarea-field.module.js +2 -2
- package/dist/components/time-field/time-field.js +153 -60
- package/dist/components/time-field/time-input.d.ts +21 -10
- package/dist/components/time-field/time-input.js +22 -11
- package/dist/components/toast/toast-provider.css +34 -31
- package/dist/components/toast/toast-provider.d.ts +63 -14
- package/dist/components/toast/toast-provider.js +174 -111
- package/dist/components/toast/toast-provider.module.js +7 -7
- package/dist/components/toggle-group-field/toggle-group-field.d.ts +1 -1
- package/dist/components/toggle-group-field/toggle-group-field.js +95 -89
- package/dist/components/toggle-group-field/toggle-group.css +117 -67
- package/dist/components/toggle-group-field/toggle-group.d.ts +2 -2
- package/dist/components/toggle-group-field/toggle-group.js +2 -2
- package/dist/components/toggle-group-field/toggle-group.module.js +2 -2
- package/dist/components/tooltip/tooltip.css +4 -4
- package/dist/components/tooltip/tooltip.module.js +1 -1
- package/dist/data-table/data-table-content.js +6 -5
- package/dist/data-table/data-table-parts.d.ts +41 -13
- package/dist/data-table/data-table-parts.js +213 -172
- package/dist/data-table/data-table-selection.d.ts +105 -3
- package/dist/data-table/data-table-selection.js +654 -145
- package/dist/data-table/data-table.css +125 -128
- package/dist/data-table/data-table.d.ts +21 -26
- package/dist/data-table/data-table.js +20 -23
- package/dist/data-table/data-table.module.js +32 -34
- package/dist/data-table/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/lib/calendar/calendar-navigation.d.ts +39 -5
- package/dist/lib/calendar/calendar-navigation.js +185 -118
- package/dist/lib/calendar/calendar-parts.d.ts +143 -0
- package/dist/lib/calendar/calendar-parts.js +540 -0
- package/dist/lib/calendar/calendar-prefab.d.ts +52 -0
- package/dist/lib/calendar/calendar-prefab.js +311 -0
- package/dist/lib/calendar/calendar-year.d.ts +3 -1
- package/dist/lib/calendar/calendar-year.js +139 -131
- package/dist/lib/calendar/temporal.css +325 -232
- package/dist/lib/calendar/temporal.d.ts +67 -82
- package/dist/lib/calendar/temporal.js +258 -569
- package/dist/lib/calendar/temporal.module.js +38 -38
- package/dist/lib/forms/use-connected-field.d.ts +1 -1
- package/dist/lib/forms/use-connected-field.js +1 -1
- package/dist/lib/render-as.d.ts +13 -0
- package/dist/lib/render-as.js +46 -0
- package/dist/tokens.css +6 -3
- package/package.json +1 -1
- package/tokens/dark.tokens.json +6 -0
- package/tokens/sys.tokens.json +7 -0
- package/dist/components/button/close-button.d.ts +0 -16
- 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
|
|
15
|
-
|
|
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
|
|
22
|
-
*
|
|
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: ({
|
|
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 {
|
|
2
|
-
import {
|
|
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
|
|
74
|
-
*
|
|
75
|
-
*
|
|
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(
|
|
79
|
-
const {
|
|
145
|
+
const $ = c(6);
|
|
146
|
+
const { render, className } = t0;
|
|
80
147
|
const removeId = useId();
|
|
81
148
|
let t1;
|
|
82
|
-
if ($[0] !==
|
|
83
|
-
t1 =
|
|
84
|
-
$[0] =
|
|
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] =
|
|
96
|
-
$[3] =
|
|
97
|
-
|
|
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
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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
|
-
$[
|
|
120
|
-
$[
|
|
121
|
-
$[
|
|
122
|
-
|
|
123
|
-
|
|
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(
|
|
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(
|
|
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 = "
|
|
3
|
-
var preview = "
|
|
4
|
-
var image = "
|
|
5
|
-
var imageSkeleton = "
|
|
6
|
-
var icon = "
|
|
7
|
-
var extension = "
|
|
8
|
-
var name = "
|
|
9
|
-
var remove = "
|
|
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
|
-
.
|
|
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
|
-
.
|
|
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
|
-
.
|
|
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
|
-
.
|
|
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
|
-
.
|
|
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
|
-
.
|
|
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
|
-
.
|
|
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
|
|
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
|
-
|
|
8
|
-
|
|
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:
|
|
63
|
+
export declare const Avatar: AvatarParts;
|
|
64
|
+
export {};
|