@igne-agency/react-web-ui 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -1
- package/dist/components/accordion/accordion.css +24 -19
- package/dist/components/accordion/accordion.d.ts +19 -3
- package/dist/components/accordion/accordion.js +86 -32
- package/dist/components/accordion/accordion.module.js +8 -8
- package/dist/components/active-filters/active-filter-describers.d.ts +1 -1
- package/dist/components/active-filters/active-filter-describers.js +1 -1
- package/dist/components/active-filters/active-filters.d.ts +35 -2
- package/dist/components/active-filters/active-filters.js +57 -52
- package/dist/components/active-filters/index.js +2 -2
- package/dist/components/attachment-tile/attachment-preview.d.ts +11 -9
- package/dist/components/attachment-tile/attachment-preview.js +102 -68
- package/dist/components/attachment-tile/attachment-tile.css +22 -13
- package/dist/components/attachment-tile/attachment-tile.d.ts +51 -6
- package/dist/components/attachment-tile/attachment-tile.js +209 -85
- package/dist/components/attachment-tile/attachment-tile.module.js +10 -10
- package/dist/components/attachment-tile/index.d.ts +1 -1
- package/dist/components/attachment-tile/index.js +2 -2
- package/dist/components/avatar/avatar.d.ts +5 -5
- package/dist/components/avatar/avatar.js +64 -37
- package/dist/components/avatar-group/avatar-group.js +2 -2
- package/dist/components/badge/badge.js +1 -1
- package/dist/components/breadcrumbs/breadcrumbs.d.ts +22 -7
- package/dist/components/breadcrumbs/breadcrumbs.js +189 -170
- package/dist/components/button/button.d.ts +2 -3
- package/dist/components/button/button.js +58 -77
- package/dist/components/button/close-button.d.ts +4 -2
- package/dist/components/button/close-button.js +9 -9
- package/dist/components/checkbox-field/checkbox-field.d.ts +17 -3
- package/dist/components/checkbox-field/checkbox-field.js +108 -131
- package/dist/components/checkbox-field/checkbox.css +26 -34
- package/dist/components/checkbox-field/checkbox.d.ts +51 -8
- package/dist/components/checkbox-field/checkbox.js +221 -57
- package/dist/components/checkbox-field/checkbox.module.js +6 -8
- package/dist/components/checkbox-field/index.d.ts +0 -1
- package/dist/components/checkbox-field/index.js +1 -2
- package/dist/components/checkbox-field/tsf-checkbox-field.d.ts +2 -2
- package/dist/components/checkbox-group-field/checkbox-group-field.d.ts +4 -1
- package/dist/components/checkbox-group-field/checkbox-group-field.js +54 -50
- package/dist/components/checkbox-group-field/checkbox-group.d.ts +7 -2
- package/dist/components/checkbox-group-field/checkbox-group.js +8 -3
- package/dist/components/collapsible/collapsible.css +23 -18
- package/dist/components/collapsible/collapsible.d.ts +18 -3
- package/dist/components/collapsible/collapsible.js +85 -32
- package/dist/components/collapsible/collapsible.module.js +7 -7
- package/dist/components/combobox-field/combobox-field.d.ts +9 -1
- package/dist/components/combobox-field/combobox-field.js +195 -175
- package/dist/components/combobox-field/combobox-items.d.ts +2 -2
- package/dist/components/combobox-field/combobox-items.js +4 -4
- package/dist/components/combobox-field/combobox.css +99 -96
- package/dist/components/combobox-field/combobox.d.ts +94 -15
- package/dist/components/combobox-field/combobox.js +484 -159
- package/dist/components/combobox-field/combobox.module.js +21 -21
- package/dist/components/combobox-field/index.d.ts +0 -1
- package/dist/components/combobox-field/selection.d.ts +4 -1
- package/dist/components/combobox-field/value-state-view.css +7 -3
- package/dist/components/combobox-field/value-state-view.d.ts +4 -2
- package/dist/components/combobox-field/value-state-view.js +15 -15
- package/dist/components/combobox-field/value-state-view.module.js +6 -4
- package/dist/components/composer/composer-attachments.d.ts +11 -3
- package/dist/components/composer/composer-attachments.js +61 -47
- package/dist/components/composer/composer-editor.d.ts +2 -1
- package/dist/components/composer/composer-editor.js +79 -71
- package/dist/components/composer/composer-mentions.js +2 -2
- package/dist/components/composer/composer.d.ts +42 -21
- package/dist/components/composer/composer.js +201 -58
- package/dist/components/composer/mention-text.js +3 -3
- package/dist/components/confirm-dialog/confirm-dialog.d.ts +8 -7
- package/dist/components/confirm-dialog/confirm-dialog.js +10 -9
- package/dist/components/conversation/conversation.context.d.ts +0 -5
- package/dist/components/conversation/conversation.d.ts +63 -29
- package/dist/components/conversation/conversation.js +193 -82
- package/dist/components/conversation/index.d.ts +1 -1
- package/dist/components/date-field/date-field.d.ts +10 -4
- package/dist/components/date-field/date-field.js +57 -43
- package/dist/components/date-field/date-input.d.ts +20 -3
- package/dist/components/date-field/date-input.js +28 -13
- package/dist/components/date-field/index.d.ts +1 -1
- package/dist/components/date-field/tsf-date-field.d.ts +1 -1
- package/dist/components/date-field/tsf-date-field.js +1 -1
- package/dist/components/date-range-field/date-range-field.d.ts +8 -4
- package/dist/components/date-range-field/date-range-field.js +57 -45
- package/dist/components/date-range-field/date-range-input.d.ts +20 -3
- package/dist/components/date-range-field/date-range-input.js +27 -12
- package/dist/components/date-range-field/tsf-date-range-field.d.ts +1 -1
- package/dist/components/date-range-field/tsf-date-range-field.js +1 -1
- package/dist/components/detail-list/detail-list.d.ts +28 -27
- package/dist/components/detail-list/detail-list.js +177 -121
- package/dist/components/dialog/dialog.d.ts +47 -27
- package/dist/components/dialog/dialog.js +101 -38
- package/dist/components/divider/divider.js +1 -1
- package/dist/components/drawer/drawer.d.ts +48 -30
- package/dist/components/drawer/drawer.js +113 -41
- package/dist/components/email-field/email-field.d.ts +5 -3
- package/dist/components/email-field/email-field.js +1 -3
- package/dist/components/email-field/tsf-email-field.d.ts +3 -2
- package/dist/components/empty-message/empty-message.d.ts +3 -3
- package/dist/components/empty-message/empty-message.js +3 -3
- package/dist/components/error-boundary/error-boundary.d.ts +5 -2
- package/dist/components/error-boundary/error-boundary.js +2 -3
- package/dist/components/error-message/error-message.d.ts +1 -1
- package/dist/components/error-message/error-message.js +1 -1
- package/dist/components/error-text/error-text.js +3 -3
- package/dist/components/field/field.d.ts +5 -5
- package/dist/components/field/field.js +9 -9
- package/dist/components/field/index.js +2 -2
- package/dist/components/field/input-parts.js +1 -1
- package/dist/components/field-placeholder/field-placeholder.d.ts +4 -1
- package/dist/components/field-placeholder/field-placeholder.js +41 -26
- package/dist/components/fieldset/field-group.js +1 -1
- package/dist/components/fieldset/fieldset-root.js +1 -1
- package/dist/components/fieldset/fieldset.js +1 -1
- package/dist/components/file-field/file-field.css +19 -15
- package/dist/components/file-field/file-field.d.ts +10 -1
- package/dist/components/file-field/file-field.js +130 -109
- package/dist/components/file-field/file-field.module.js +6 -4
- package/dist/components/file-field/file-input.d.ts +32 -9
- package/dist/components/file-field/file-input.js +94 -74
- package/dist/components/filter-bar/filter-bar.d.ts +79 -51
- package/dist/components/filter-bar/filter-bar.js +552 -216
- package/dist/components/form/form.d.ts +4 -6
- package/dist/components/form/form.js +6 -8
- package/dist/components/icon/icon.d.ts +5 -10
- package/dist/components/icon/icon.js +4 -6
- package/dist/components/link/link.js +1 -1
- package/dist/components/link-button/link-button.d.ts +1 -2
- package/dist/components/link-button/link-button.js +12 -22
- package/dist/components/loading-message/loading-message.d.ts +2 -2
- package/dist/components/loading-message/loading-message.js +1 -1
- package/dist/components/locale-provider/locale-provider.js +1 -1
- package/dist/components/menu/menu.d.ts +40 -22
- package/dist/components/menu/menu.js +100 -40
- package/dist/components/nav/nav-context.d.ts +0 -1
- package/dist/components/nav/nav-context.js +1 -2
- package/dist/components/nav/nav-item-view.d.ts +7 -7
- package/dist/components/nav/nav-item-view.js +27 -51
- package/dist/components/nav/nav.css +72 -60
- package/dist/components/nav/nav.d.ts +15 -8
- package/dist/components/nav/nav.js +105 -52
- package/dist/components/nav/nav.module.js +14 -14
- package/dist/components/number-field/number-field.d.ts +7 -1
- package/dist/components/number-field/number-field.js +98 -82
- package/dist/components/number-field/number-input.d.ts +53 -4
- package/dist/components/number-field/number-input.js +68 -21
- package/dist/components/number-field/tsf-number-field.d.ts +1 -1
- package/dist/components/number-field/tsf-number-field.js +1 -1
- package/dist/components/otp-field/otp-input.d.ts +25 -0
- package/dist/components/otp-field/otp-input.js +26 -1
- package/dist/components/pagination/pagination.d.ts +82 -23
- package/dist/components/pagination/pagination.js +656 -229
- package/dist/components/password-field/password-field.d.ts +7 -1
- package/dist/components/password-field/password-field.js +117 -126
- package/dist/components/password-field/password-strength.js +1 -1
- package/dist/components/password-field/tsf-password-field.d.ts +1 -1
- package/dist/components/password-field/tsf-password-field.js +1 -1
- package/dist/components/photo-field/photo-field.d.ts +17 -3
- package/dist/components/photo-field/photo-field.js +168 -89
- package/dist/components/photo-field/photo-input-context.d.ts +25 -0
- package/dist/components/photo-field/photo-input-context.js +14 -0
- package/dist/components/photo-field/photo-input.d.ts +58 -23
- package/dist/components/photo-field/photo-input.js +459 -261
- package/dist/components/popover/popover.d.ts +55 -23
- package/dist/components/popover/popover.js +205 -61
- package/dist/components/radio-group-field/radio-group.js +1 -1
- package/dist/components/search-field/search-field.d.ts +7 -5
- package/dist/components/search-field/search-field.js +4 -6
- package/dist/components/search-field/tsf-search-field.d.ts +1 -1
- package/dist/components/search-field/tsf-search-field.js +1 -1
- package/dist/components/segmented-control-field/segmented-control.js +1 -1
- package/dist/components/select-field/select-field.d.ts +7 -1
- package/dist/components/select-field/select-field.js +151 -139
- package/dist/components/select-field/select.d.ts +28 -6
- package/dist/components/select-field/select.js +234 -149
- package/dist/components/skeleton/skeleton.js +1 -1
- package/dist/components/spinner/spinner.css +47 -1
- package/dist/components/spinner/spinner.js +28 -11
- package/dist/components/spinner/spinner.module.js +18 -3
- package/dist/components/stale/stale.d.ts +17 -21
- package/dist/components/stale/stale.js +307 -129
- package/dist/components/status-message/status-message.css +22 -21
- package/dist/components/status-message/status-message.d.ts +10 -5
- package/dist/components/status-message/status-message.js +20 -24
- package/dist/components/status-message/status-message.module.js +6 -6
- package/dist/components/status-message/status-preset.d.ts +4 -5
- package/dist/components/status-message/status-preset.js +3 -3
- package/dist/components/switch-field/switch.js +1 -1
- package/dist/components/tabs/tabs.d.ts +51 -28
- package/dist/components/tabs/tabs.js +219 -144
- package/dist/components/tag/tag.css +23 -21
- package/dist/components/tag/tag.d.ts +17 -15
- package/dist/components/tag/tag.js +140 -65
- package/dist/components/tag/tag.module.js +3 -3
- package/dist/components/tag-group/tag-group.css +30 -27
- package/dist/components/tag-group/tag-group.d.ts +10 -4
- package/dist/components/tag-group/tag-group.js +47 -35
- package/dist/components/tag-group/tag-group.module.js +4 -4
- package/dist/components/text-field/text-field.d.ts +14 -3
- package/dist/components/text-field/text-field.js +154 -133
- package/dist/components/text-field/text-input.d.ts +89 -3
- package/dist/components/text-field/text-input.js +184 -70
- package/dist/components/textarea-field/textarea.js +1 -1
- package/dist/components/time-field/time-input.d.ts +6 -0
- package/dist/components/time-field/time-input.js +6 -0
- package/dist/components/time-zone-provider/time-zone-provider.js +1 -1
- package/dist/components/toast/index.js +2 -2
- package/dist/components/toast/toast-provider.css +38 -34
- package/dist/components/toast/toast-provider.d.ts +65 -3
- package/dist/components/toast/toast-provider.js +313 -148
- package/dist/components/toast/toast-provider.module.js +11 -17
- package/dist/components/toast/toast.d.ts +5 -1
- package/dist/components/toast/toast.js +2 -1
- package/dist/components/toggle-group-field/toggle-group.js +1 -1
- package/dist/components/tooltip/tooltip.d.ts +6 -6
- package/dist/components/tooltip/tooltip.js +7 -7
- package/dist/data-table/data-table-content.d.ts +18 -10
- package/dist/data-table/data-table-content.js +145 -290
- package/dist/data-table/data-table-context.d.ts +4 -2
- package/dist/data-table/data-table-context.js +1 -1
- package/dist/data-table/data-table-parts.d.ts +99 -0
- package/dist/data-table/data-table-parts.js +1182 -0
- package/dist/data-table/data-table-selection.d.ts +7 -3
- package/dist/data-table/data-table-selection.js +62 -37
- package/dist/data-table/data-table.css +100 -95
- package/dist/data-table/data-table.d.ts +49 -25
- package/dist/data-table/data-table.js +95 -83
- package/dist/data-table/data-table.module.js +34 -34
- package/dist/data-table/index.d.ts +2 -1
- package/dist/data-table/index.js +2 -1
- package/dist/data-view/use-data-view.d.ts +2 -2
- package/dist/data-view/use-data-view.js +2 -2
- package/dist/index.js +7 -8
- package/dist/lib/calendar/calendar-navigation.d.ts +9 -2
- package/dist/lib/calendar/calendar-navigation.js +72 -73
- package/dist/lib/calendar/calendar-year.d.ts +4 -3
- package/dist/lib/calendar/calendar-year.js +137 -156
- package/dist/lib/calendar/temporal.d.ts +18 -12
- package/dist/lib/calendar/temporal.js +191 -147
- package/dist/lib/table-storage.d.ts +2 -2
- package/dist/lib/table-storage.js +2 -2
- package/dist/lib/unsaved-changes/leave-guard.js +1 -1
- package/dist/terrazzo/index.d.ts +16 -0
- package/dist/terrazzo/index.js +94 -2
- package/dist/tokens.css +71 -69
- package/package.json +3 -2
- package/tokens/ref.tokens.json +0 -30
- package/tokens/sys.tokens.json +0 -7
- package/dist/assets/spinner.js +0 -28
- package/dist/components/checkbox-field/checkbox-glyph.d.ts +0 -12
- package/dist/components/checkbox-field/checkbox-glyph.js +0 -38
- package/dist/components/combobox-field/combobox-popup-body.d.ts +0 -34
- package/dist/components/combobox-field/combobox-popup-body.js +0 -142
- package/dist/components/conversation/conversation.context.js +0 -4
- package/dist/vendor/@material-design-icons/svg/outlined/add.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/arrow_downward.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/arrow_forward.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/arrow_upward.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/attach_file.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/block.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/calendar_today.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/check.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/check_circle.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/chevron_left.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/chevron_right.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/close.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/content_copy.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/date_range.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/description.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/download.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/error.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/error_outline.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/expand_less.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/expand_more.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/filter_alt.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/filter_alt_off.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/first_page.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/info.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/keyboard_arrow_down.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/last_page.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/mail.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/more_horiz.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/photo_camera.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/remove.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/restart_alt.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/restore.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/search.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/unfold_more.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/upload_file.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/visibility.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/visibility_off.js +0 -12
- package/dist/vendor/@material-design-icons/svg/outlined/warning_amber.js +0 -12
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ReactNode } from "react";
|
|
1
|
+
import { type ComponentPropsWithRef, type ReactNode } from "react";
|
|
2
2
|
/** An image source for a preview, and whether one is still on its way. */
|
|
3
3
|
export type AttachmentPreviewSource = Readonly<{
|
|
4
4
|
src: string | undefined;
|
|
@@ -12,22 +12,24 @@ export type AttachmentPreviewSource = Readonly<{
|
|
|
12
12
|
* useAttachmentPreview(file); // -> { src: "data:image/png;base64,…", pending: false }
|
|
13
13
|
*/
|
|
14
14
|
export declare const useAttachmentPreview: (blob: Blob | undefined) => AttachmentPreviewSource;
|
|
15
|
-
export type AttachmentPreviewProps = Readonly<{
|
|
15
|
+
export type AttachmentPreviewProps = Omit<ComponentPropsWithRef<"span">, "children"> & Readonly<{
|
|
16
16
|
name: string;
|
|
17
17
|
/** Tooltip text for the preview. */
|
|
18
18
|
hint: string;
|
|
19
|
-
/** Image source; without one the tile shows
|
|
19
|
+
/** Image source; without one the tile shows its `icon` and the file's extension. */
|
|
20
20
|
src: string | undefined;
|
|
21
21
|
/** Whether an image source is still being produced. */
|
|
22
22
|
pending?: boolean;
|
|
23
|
+
/** A file-type glyph above the extension, where there is no image. */
|
|
24
|
+
icon?: ReactNode;
|
|
23
25
|
}>;
|
|
24
26
|
/**
|
|
25
|
-
* The inside of an attachment tile: an image preview where there is one,
|
|
26
|
-
*
|
|
27
|
-
* source that is still arriving shows a skeleton; one that fails to
|
|
28
|
-
* back to the
|
|
27
|
+
* The inside of an attachment tile: an image preview where there is one, the
|
|
28
|
+
* `icon` and the file's extension otherwise, plus the file name for assistive
|
|
29
|
+
* tech. A source that is still arriving shows a skeleton; one that fails to
|
|
30
|
+
* load falls back to the extension.
|
|
29
31
|
*
|
|
30
32
|
* @example
|
|
31
|
-
* <
|
|
33
|
+
* <AttachmentTile.Preview name="nota.pdf" hint="nota.pdf (12 kB)" src={undefined} />
|
|
32
34
|
*/
|
|
33
|
-
export declare const AttachmentPreview: ({ name, hint, src, pending, }: AttachmentPreviewProps) => ReactNode;
|
|
35
|
+
export declare const AttachmentPreview: ({ name, hint, src, pending, icon, className, ...props }: AttachmentPreviewProps) => ReactNode;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import SvgDescription from "../../vendor/@material-design-icons/svg/outlined/description.js";
|
|
2
1
|
import { useBusyPhase } from "../../lib/hooks/use-busy-phase.js";
|
|
3
|
-
import { Icon } from "../icon/icon.js";
|
|
4
2
|
import { Skeleton } from "../skeleton/skeleton.js";
|
|
5
3
|
import { Tooltip } from "../tooltip/tooltip.js";
|
|
6
4
|
import attachment_tile_module_default from "./attachment-tile.module.js";
|
|
7
5
|
import { c } from "react/compiler-runtime";
|
|
6
|
+
import { clsx } from "clsx";
|
|
7
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { useEffect, useState } from "react";
|
|
9
|
-
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
10
9
|
// src/components/attachment-tile/attachment-preview.tsx
|
|
11
10
|
var extensionOf = (name) => {
|
|
12
11
|
const dot = name.lastIndexOf(".");
|
|
@@ -66,38 +65,63 @@ var useAttachmentPreview = (blob) => {
|
|
|
66
65
|
return t3;
|
|
67
66
|
};
|
|
68
67
|
/**
|
|
69
|
-
* The inside of an attachment tile: an image preview where there is one,
|
|
70
|
-
*
|
|
71
|
-
* source that is still arriving shows a skeleton; one that fails to
|
|
72
|
-
* back to the
|
|
68
|
+
* The inside of an attachment tile: an image preview where there is one, the
|
|
69
|
+
* `icon` and the file's extension otherwise, plus the file name for assistive
|
|
70
|
+
* tech. A source that is still arriving shows a skeleton; one that fails to
|
|
71
|
+
* load falls back to the extension.
|
|
73
72
|
*
|
|
74
73
|
* @example
|
|
75
|
-
* <
|
|
74
|
+
* <AttachmentTile.Preview name="nota.pdf" hint="nota.pdf (12 kB)" src={undefined} />
|
|
76
75
|
*/
|
|
77
76
|
var AttachmentPreview = (t0) => {
|
|
78
|
-
const $ = c(
|
|
79
|
-
|
|
77
|
+
const $ = c(36);
|
|
78
|
+
let className;
|
|
79
|
+
let hint;
|
|
80
|
+
let icon;
|
|
81
|
+
let name;
|
|
82
|
+
let props;
|
|
83
|
+
let src;
|
|
84
|
+
let t1;
|
|
85
|
+
if ($[0] !== t0) {
|
|
86
|
+
({name, hint, src, pending: t1, icon, className, ...props} = t0);
|
|
87
|
+
$[0] = t0;
|
|
88
|
+
$[1] = className;
|
|
89
|
+
$[2] = hint;
|
|
90
|
+
$[3] = icon;
|
|
91
|
+
$[4] = name;
|
|
92
|
+
$[5] = props;
|
|
93
|
+
$[6] = src;
|
|
94
|
+
$[7] = t1;
|
|
95
|
+
} else {
|
|
96
|
+
className = $[1];
|
|
97
|
+
hint = $[2];
|
|
98
|
+
icon = $[3];
|
|
99
|
+
name = $[4];
|
|
100
|
+
props = $[5];
|
|
101
|
+
src = $[6];
|
|
102
|
+
t1 = $[7];
|
|
103
|
+
}
|
|
80
104
|
const pending = t1 === void 0 ? false : t1;
|
|
81
105
|
const [loadedSrc, setLoadedSrc] = useState();
|
|
82
106
|
const [brokenSrc, setBrokenSrc] = useState();
|
|
83
107
|
let t2;
|
|
84
|
-
if ($[
|
|
108
|
+
if ($[8] !== name) {
|
|
85
109
|
t2 = extensionOf(name);
|
|
86
|
-
$[
|
|
87
|
-
$[
|
|
88
|
-
} else t2 = $[
|
|
110
|
+
$[8] = name;
|
|
111
|
+
$[9] = t2;
|
|
112
|
+
} else t2 = $[9];
|
|
89
113
|
const extension = t2;
|
|
90
114
|
const image = src === brokenSrc ? void 0 : src;
|
|
91
115
|
const t3 = pending || image !== void 0 && image !== loadedSrc;
|
|
92
116
|
let t4;
|
|
93
|
-
if ($[
|
|
117
|
+
if ($[10] !== t3) {
|
|
94
118
|
t4 = { busy: t3 };
|
|
95
|
-
$[
|
|
96
|
-
$[
|
|
97
|
-
} else t4 = $[
|
|
119
|
+
$[10] = t3;
|
|
120
|
+
$[11] = t4;
|
|
121
|
+
} else t4 = $[11];
|
|
98
122
|
const busy = useBusyPhase(t4) !== "fresh";
|
|
99
123
|
let t5;
|
|
100
|
-
if ($[
|
|
124
|
+
if ($[12] !== image) {
|
|
101
125
|
t5 = (node) => {
|
|
102
126
|
if (image === void 0 || !node?.complete) return;
|
|
103
127
|
if (node.naturalWidth === 0) {
|
|
@@ -106,17 +130,23 @@ var AttachmentPreview = (t0) => {
|
|
|
106
130
|
}
|
|
107
131
|
setLoadedSrc(image);
|
|
108
132
|
};
|
|
109
|
-
$[
|
|
110
|
-
$[
|
|
111
|
-
} else t5 = $[
|
|
133
|
+
$[12] = image;
|
|
134
|
+
$[13] = t5;
|
|
135
|
+
} else t5 = $[13];
|
|
112
136
|
const settleAlreadyDecoded = t5;
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
137
|
+
let t6;
|
|
138
|
+
if ($[14] !== className) {
|
|
139
|
+
t6 = clsx(attachment_tile_module_default.preview, className);
|
|
140
|
+
$[14] = className;
|
|
141
|
+
$[15] = t6;
|
|
142
|
+
} else t6 = $[15];
|
|
143
|
+
const t7 = busy || void 0;
|
|
144
|
+
let t8;
|
|
145
|
+
if ($[16] !== extension || $[17] !== icon || $[18] !== image || $[19] !== pending || $[20] !== settleAlreadyDecoded) {
|
|
146
|
+
t8 = image === void 0 ? pending ? null : /* @__PURE__ */ jsxs(Fragment, { children: [icon === void 0 ? null : /* @__PURE__ */ jsx("span", {
|
|
147
|
+
"aria-hidden": "true",
|
|
148
|
+
className: attachment_tile_module_default.icon,
|
|
149
|
+
children: icon
|
|
120
150
|
}), extension === "" ? null : /* @__PURE__ */ jsx("span", {
|
|
121
151
|
className: attachment_tile_module_default.extension,
|
|
122
152
|
children: extension
|
|
@@ -128,54 +158,58 @@ var AttachmentPreview = (t0) => {
|
|
|
128
158
|
onLoad: () => setLoadedSrc(image),
|
|
129
159
|
onError: () => setBrokenSrc(image)
|
|
130
160
|
});
|
|
131
|
-
$[
|
|
132
|
-
$[
|
|
133
|
-
$[
|
|
134
|
-
$[
|
|
135
|
-
$[
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
if ($[11] !== busy) {
|
|
139
|
-
t8 = busy ? /* @__PURE__ */ jsx(Skeleton, { className: attachment_tile_module_default.imageSkeleton }) : null;
|
|
140
|
-
$[11] = busy;
|
|
141
|
-
$[12] = t8;
|
|
142
|
-
} else t8 = $[12];
|
|
161
|
+
$[16] = extension;
|
|
162
|
+
$[17] = icon;
|
|
163
|
+
$[18] = image;
|
|
164
|
+
$[19] = pending;
|
|
165
|
+
$[20] = settleAlreadyDecoded;
|
|
166
|
+
$[21] = t8;
|
|
167
|
+
} else t8 = $[21];
|
|
143
168
|
let t9;
|
|
144
|
-
if ($[
|
|
145
|
-
t9 = /* @__PURE__ */ jsx(
|
|
169
|
+
if ($[22] !== busy) {
|
|
170
|
+
t9 = busy ? /* @__PURE__ */ jsx(Skeleton, { className: attachment_tile_module_default.imageSkeleton }) : null;
|
|
171
|
+
$[22] = busy;
|
|
172
|
+
$[23] = t9;
|
|
173
|
+
} else t9 = $[23];
|
|
174
|
+
let t10;
|
|
175
|
+
if ($[24] !== name) {
|
|
176
|
+
t10 = /* @__PURE__ */ jsx("span", {
|
|
146
177
|
className: attachment_tile_module_default.name,
|
|
147
178
|
children: name
|
|
148
179
|
});
|
|
149
|
-
$[
|
|
150
|
-
$[
|
|
151
|
-
} else
|
|
152
|
-
let
|
|
153
|
-
if ($[
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
180
|
+
$[24] = name;
|
|
181
|
+
$[25] = t10;
|
|
182
|
+
} else t10 = $[25];
|
|
183
|
+
let t11;
|
|
184
|
+
if ($[26] !== props || $[27] !== t10 || $[28] !== t6 || $[29] !== t7 || $[30] !== t8 || $[31] !== t9) {
|
|
185
|
+
t11 = /* @__PURE__ */ jsxs("span", {
|
|
186
|
+
...props,
|
|
187
|
+
className: t6,
|
|
188
|
+
"aria-busy": t7,
|
|
157
189
|
children: [
|
|
158
|
-
t7,
|
|
159
190
|
t8,
|
|
160
|
-
t9
|
|
191
|
+
t9,
|
|
192
|
+
t10
|
|
161
193
|
]
|
|
162
194
|
});
|
|
163
|
-
$[
|
|
164
|
-
$[
|
|
165
|
-
$[
|
|
166
|
-
$[
|
|
167
|
-
$[
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
195
|
+
$[26] = props;
|
|
196
|
+
$[27] = t10;
|
|
197
|
+
$[28] = t6;
|
|
198
|
+
$[29] = t7;
|
|
199
|
+
$[30] = t8;
|
|
200
|
+
$[31] = t9;
|
|
201
|
+
$[32] = t11;
|
|
202
|
+
} else t11 = $[32];
|
|
203
|
+
let t12;
|
|
204
|
+
if ($[33] !== hint || $[34] !== t11) {
|
|
205
|
+
t12 = /* @__PURE__ */ jsx(Tooltip, {
|
|
172
206
|
content: hint,
|
|
173
|
-
children:
|
|
207
|
+
children: t11
|
|
174
208
|
});
|
|
175
|
-
$[
|
|
176
|
-
$[
|
|
177
|
-
$[
|
|
178
|
-
} else
|
|
179
|
-
return
|
|
209
|
+
$[33] = hint;
|
|
210
|
+
$[34] = t11;
|
|
211
|
+
$[35] = t12;
|
|
212
|
+
} else t12 = $[35];
|
|
213
|
+
return t12;
|
|
180
214
|
};
|
|
181
215
|
export { AttachmentPreview, useAttachmentPreview };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
@layer kit.reset, kit.base, kit.components;
|
|
2
2
|
@layer kit.components {
|
|
3
|
-
.
|
|
3
|
+
._tile_gqsrq_3 {
|
|
4
4
|
--_tile-size: var(--attachment-tile-size, 5rem);
|
|
5
5
|
--_tile-border-width: 1px;
|
|
6
6
|
--_tile-radius: var(
|
|
@@ -20,32 +20,32 @@
|
|
|
20
20
|
color: var(--attachment-tile-fg, var(--sys-color-text-muted));
|
|
21
21
|
cursor: default;
|
|
22
22
|
}
|
|
23
|
-
.
|
|
23
|
+
._tile_gqsrq_3 {
|
|
24
24
|
outline: 0 solid var(--sys-color-focus-ring);
|
|
25
25
|
outline-offset: var(--sys-focus-ring-offset);
|
|
26
26
|
}
|
|
27
|
-
.
|
|
27
|
+
._tile_gqsrq_3:focus-visible {
|
|
28
28
|
outline-width: var(--sys-focus-ring-width);
|
|
29
29
|
}
|
|
30
|
-
.
|
|
30
|
+
._tile_gqsrq_3[data-focus-visible] {
|
|
31
31
|
outline-width: var(--sys-focus-ring-width);
|
|
32
32
|
}
|
|
33
|
-
.
|
|
33
|
+
._tile_gqsrq_3[data-invalid] {
|
|
34
34
|
border-color: var(--sys-color-error-border);
|
|
35
35
|
background: var(--sys-color-error-bg);
|
|
36
36
|
color: var(--sys-color-error-fg);
|
|
37
37
|
}
|
|
38
|
-
.
|
|
38
|
+
._tile_gqsrq_3:any-link {
|
|
39
39
|
display: block;
|
|
40
40
|
color: var(--attachment-tile-fg, var(--sys-color-text-muted));
|
|
41
41
|
text-decoration: none;
|
|
42
42
|
cursor: pointer;
|
|
43
43
|
}
|
|
44
|
-
.
|
|
44
|
+
._tile_gqsrq_3:any-link:hover {
|
|
45
45
|
border-color: var(--attachment-tile-hover-border, var(--sys-color-primary));
|
|
46
46
|
color: var(--attachment-tile-fg, var(--sys-color-text-muted));
|
|
47
47
|
}
|
|
48
|
-
.
|
|
48
|
+
._preview_gqsrq_48 {
|
|
49
49
|
display: flex;
|
|
50
50
|
flex-direction: column;
|
|
51
51
|
align-items: center;
|
|
@@ -56,23 +56,32 @@
|
|
|
56
56
|
overflow: hidden;
|
|
57
57
|
border-radius: var(--_tile-inner-radius);
|
|
58
58
|
}
|
|
59
|
-
.
|
|
59
|
+
._image_gqsrq_59 {
|
|
60
60
|
inline-size: 100%;
|
|
61
61
|
block-size: 100%;
|
|
62
62
|
object-fit: cover;
|
|
63
63
|
}
|
|
64
|
-
.
|
|
64
|
+
._imageSkeleton_gqsrq_64 {
|
|
65
65
|
--skeleton-bg: var(--sys-color-outline);
|
|
66
66
|
position: absolute;
|
|
67
67
|
inset: 0;
|
|
68
68
|
border-radius: var(--_tile-inner-radius);
|
|
69
69
|
block-size: auto;
|
|
70
70
|
}
|
|
71
|
-
.
|
|
71
|
+
._icon_gqsrq_71 {
|
|
72
|
+
display: inline-flex;
|
|
73
|
+
font-size: var(--attachment-tile-icon-size, 1.5em);
|
|
74
|
+
}
|
|
75
|
+
._icon_gqsrq_71 > svg {
|
|
76
|
+
inline-size: 1em;
|
|
77
|
+
block-size: 1em;
|
|
78
|
+
fill: currentcolor;
|
|
79
|
+
}
|
|
80
|
+
._extension_gqsrq_80 {
|
|
72
81
|
font: var(--sys-font-label-small);
|
|
73
82
|
text-transform: uppercase;
|
|
74
83
|
}
|
|
75
|
-
.
|
|
84
|
+
._name_gqsrq_84 {
|
|
76
85
|
position: absolute;
|
|
77
86
|
overflow: hidden;
|
|
78
87
|
clip-path: inset(50%);
|
|
@@ -80,7 +89,7 @@
|
|
|
80
89
|
block-size: 1px;
|
|
81
90
|
white-space: nowrap;
|
|
82
91
|
}
|
|
83
|
-
.
|
|
92
|
+
._remove_gqsrq_92 {
|
|
84
93
|
display: grid;
|
|
85
94
|
place-items: center;
|
|
86
95
|
position: absolute;
|
|
@@ -1,30 +1,74 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
2
|
+
import { type ReactElement, type ReactNode } from "react";
|
|
3
|
+
import { AttachmentPreview } from "./attachment-preview.tsx";
|
|
4
|
+
export type AttachmentTileRootProps = useRender.ComponentProps<"span"> & Readonly<{
|
|
5
|
+
/** Renders with an error treatment, such as for an oversized file. */
|
|
6
|
+
invalid?: boolean;
|
|
7
|
+
}>;
|
|
8
|
+
/**
|
|
9
|
+
* The square frame of a tile. Render it as react-aria's `Tag` inside a
|
|
10
|
+
* `TagList` for a staged file, or as an `<a>` for a download.
|
|
11
|
+
*/
|
|
12
|
+
declare const Root: ({ invalid, className, render, ref, ...props }: AttachmentTileRootProps) => ReactElement;
|
|
13
|
+
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;
|
|
18
|
+
className?: string;
|
|
19
|
+
}>;
|
|
20
|
+
/**
|
|
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.
|
|
24
|
+
*/
|
|
25
|
+
declare const Remove: ({ label, children, className, }: AttachmentTileRemoveProps) => ReactNode;
|
|
2
26
|
export type AttachmentTileProps = Readonly<{
|
|
3
27
|
id: string;
|
|
4
28
|
file: File;
|
|
5
29
|
/** Tooltip text for the tile, e.g. "nota.pdf (12 kB)". */
|
|
6
30
|
hint: string;
|
|
7
|
-
/** Accessible name for the remove button; without one the tile is fixed. */
|
|
8
|
-
removeLabel?: string;
|
|
9
31
|
/** Renders with an error treatment (e.g. an oversized file). */
|
|
10
32
|
invalid: boolean;
|
|
11
33
|
disabled: boolean;
|
|
34
|
+
/** A file-type glyph, shown above the extension where the file is not an image. */
|
|
35
|
+
icon?: ReactNode;
|
|
36
|
+
className?: string;
|
|
37
|
+
}> & (Readonly<{
|
|
38
|
+
/** Accessible name for the remove button; without one the tile is fixed. */
|
|
39
|
+
removeLabel: string;
|
|
40
|
+
/** The remove button's glyph. */
|
|
41
|
+
removeIcon: ReactNode;
|
|
42
|
+
}> | Readonly<{
|
|
43
|
+
removeLabel?: undefined;
|
|
44
|
+
removeIcon?: undefined;
|
|
45
|
+
}>);
|
|
46
|
+
declare const Prefab: ({ id, file, hint, removeLabel, removeIcon, invalid, disabled, icon, className, }: AttachmentTileProps) => ReactNode;
|
|
47
|
+
/** The parts of an attachment tile, hanging off its prefab. */
|
|
48
|
+
export type AttachmentTileParts = typeof Prefab & Readonly<{
|
|
49
|
+
Root: typeof Root;
|
|
50
|
+
Preview: typeof AttachmentPreview;
|
|
51
|
+
Remove: typeof Remove;
|
|
12
52
|
}>;
|
|
13
53
|
/**
|
|
14
54
|
* A single staged attachment as a square thumbnail inside a `TagList`: an image
|
|
15
55
|
* preview where the file is one, its extension otherwise, and a pointer-only
|
|
16
56
|
* remove button in the corner. Removal is owned by the surrounding `TagGroup`.
|
|
57
|
+
* The parts hanging off it compose a tile by hand.
|
|
17
58
|
*
|
|
18
59
|
* @example
|
|
19
|
-
* <AttachmentTile id={id} file={file} hint={hint} removeLabel={
|
|
60
|
+
* <AttachmentTile id={id} file={file} hint={hint} removeLabel="Remove" removeIcon={<CloseIcon />} invalid={false} disabled={false} />
|
|
20
61
|
*/
|
|
21
|
-
export declare const AttachmentTile:
|
|
62
|
+
export declare const AttachmentTile: AttachmentTileParts;
|
|
22
63
|
export type SentAttachmentTileProps = Readonly<{
|
|
23
64
|
name: string;
|
|
24
65
|
/** Tooltip text for the tile. */
|
|
25
66
|
hint: string;
|
|
67
|
+
/** A file-type glyph, shown above the extension where there is no image. */
|
|
68
|
+
icon?: ReactNode;
|
|
69
|
+
className?: string;
|
|
26
70
|
}> & (Readonly<{
|
|
27
|
-
/** Image source; without one the tile shows
|
|
71
|
+
/** Image source; without one the tile shows its icon and the extension. */
|
|
28
72
|
src: string;
|
|
29
73
|
pending?: false;
|
|
30
74
|
}> | Readonly<{
|
|
@@ -49,3 +93,4 @@ export type SentAttachmentTileProps = Readonly<{
|
|
|
49
93
|
* <SentAttachmentTile name="nota.pdf" hint="nota.pdf (12 kB)" src={url} href={url} label="Download nota.pdf" />
|
|
50
94
|
*/
|
|
51
95
|
export declare const SentAttachmentTile: (props: SentAttachmentTileProps) => ReactNode;
|
|
96
|
+
export {};
|