@igne-agency/react-web-ui 0.3.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -1
- package/dist/base.css +3 -0
- 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 +20 -3
- package/dist/terrazzo/index.js +110 -7
- package/dist/tokens.css +94 -71
- package/package.json +4 -3
- 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,9 +1,9 @@
|
|
|
1
|
-
import { type ComponentProps, type ReactNode } from "react";
|
|
1
|
+
import { type ComponentProps, type ComponentPropsWithRef, type ReactNode } from "react";
|
|
2
2
|
import { type ComposerContent, type ComposerSendPayload } from "./composer.context.ts";
|
|
3
3
|
import { type ComposerHandle, createComposerHandle } from "./composer.handle.ts";
|
|
4
|
-
import { ComposerAttachButton, ComposerAttachments, ComposerAttachmentsError } from "./composer-attachments.tsx";
|
|
5
|
-
import { ComposerEditor } from "./composer-editor.tsx";
|
|
6
|
-
import { ComposerMentions } from "./composer-mentions.tsx";
|
|
4
|
+
import { ComposerAttachButton, type ComposerAttachButtonProps, ComposerAttachments, ComposerAttachmentsError, type ComposerAttachmentsErrorProps, type ComposerAttachmentsProps } from "./composer-attachments.tsx";
|
|
5
|
+
import { ComposerEditor, type ComposerEditorProps } from "./composer-editor.tsx";
|
|
6
|
+
import { ComposerMentions, type ComposerMentionsProps } from "./composer-mentions.tsx";
|
|
7
7
|
export type ComposerRootProps = Readonly<{
|
|
8
8
|
children: ReactNode;
|
|
9
9
|
/** The starting draft, with mentions as `@[label](id)`. */
|
|
@@ -33,17 +33,40 @@ export type ComposerToolbarProps = Readonly<{
|
|
|
33
33
|
}>;
|
|
34
34
|
/** The row under the editor holding the counter and the buttons. */
|
|
35
35
|
declare const Toolbar: ({ children, className, }: ComposerToolbarProps) => ReactNode;
|
|
36
|
+
export type ComposerMaxLengthProps = Omit<ComponentPropsWithRef<"span">, "children">;
|
|
36
37
|
/** The `length/maxLength` counter, warning near the limit. Renders nothing without a `maxLength`. */
|
|
37
|
-
declare const MaxLength: () => ReactNode;
|
|
38
|
+
declare const MaxLength: ({ className, ...props }: ComposerMaxLengthProps) => ReactNode;
|
|
38
39
|
export type ComposerSendButtonProps = Readonly<{
|
|
39
40
|
/** The button's accessible name and tooltip, such as "Send". */
|
|
40
41
|
label: string;
|
|
41
42
|
/** @default "primary" */
|
|
42
43
|
variant?: "primary" | "secondary";
|
|
44
|
+
/** The send glyph. */
|
|
45
|
+
children: ReactNode;
|
|
43
46
|
}> & Omit<ComponentProps<"button">, "children">;
|
|
44
|
-
/** The icon button that sends the message; disabled while it can't be sent. */
|
|
45
|
-
declare const SendButton: ({ label, variant, ...props }: ComposerSendButtonProps) => ReactNode;
|
|
46
|
-
|
|
47
|
+
/** The icon button that sends the message, its children the glyph; disabled while it can't be sent. */
|
|
48
|
+
declare const SendButton: ({ label, variant, children, ...props }: ComposerSendButtonProps) => ReactNode;
|
|
49
|
+
/** The attachment controls the `Composer` prefab renders, and what they say. */
|
|
50
|
+
export type ComposerAttachmentOptions = Omit<ComposerAttachmentsProps, "className"> & ComposerAttachmentsErrorProps & Readonly<{
|
|
51
|
+
/** The attach button's accessible name and tooltip, such as "Add attachment". */
|
|
52
|
+
attachLabel: string;
|
|
53
|
+
/** The attach button's glyph. */
|
|
54
|
+
attachIcon: ReactNode;
|
|
55
|
+
accept?: ComposerAttachButtonProps["accept"];
|
|
56
|
+
}>;
|
|
57
|
+
export type ComposerProps = Omit<ComposerRootProps, "children"> & Omit<ComposerEditorProps, "children" | "className"> & Readonly<{
|
|
58
|
+
/** The `@` typeahead, where the composer takes mentions. */
|
|
59
|
+
mentions?: ComposerMentionsProps;
|
|
60
|
+
/** The staged files and the button that adds them, where the composer takes attachments. */
|
|
61
|
+
attachments?: ComposerAttachmentOptions;
|
|
62
|
+
/** The send button's accessible name and tooltip, such as "Send". */
|
|
63
|
+
sendLabel: string;
|
|
64
|
+
/** The send button's glyph. */
|
|
65
|
+
sendIcon: ReactNode;
|
|
66
|
+
}>;
|
|
67
|
+
declare const Prefab: ({ label, placeholder, minLines, maxLines, mentions, attachments, sendLabel, sendIcon, ...props }: ComposerProps) => ReactNode;
|
|
68
|
+
/** The parts of a composer, hanging off its prefab. */
|
|
69
|
+
export type ComposerParts = typeof Prefab & Readonly<{
|
|
47
70
|
Root: typeof Root;
|
|
48
71
|
Editor: typeof ComposerEditor;
|
|
49
72
|
Mentions: typeof ComposerMentions;
|
|
@@ -58,20 +81,18 @@ type ComposerNamespace = Readonly<{
|
|
|
58
81
|
/**
|
|
59
82
|
* A message composer: a plain-text editor with `@` mentions, staged
|
|
60
83
|
* attachments, a length counter, and Enter to send (Shift+Enter for a new
|
|
61
|
-
* line).
|
|
84
|
+
* line). The prefab wires the editor, the attachments and the send button
|
|
85
|
+
* into one; the parts hanging off it compose a composer by hand.
|
|
62
86
|
*
|
|
63
87
|
* @example
|
|
64
|
-
* <Composer
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
* <Composer.SendButton label="Send" />
|
|
73
|
-
* </Composer.Toolbar>
|
|
74
|
-
* </Composer.Root>
|
|
88
|
+
* <Composer
|
|
89
|
+
* label="Comment"
|
|
90
|
+
* onSend={send}
|
|
91
|
+
* maxLength={2000}
|
|
92
|
+
* mentions={{ label: "People to mention", sources: [people] }}
|
|
93
|
+
* sendLabel="Send"
|
|
94
|
+
* sendIcon={<SendIcon />}
|
|
95
|
+
* />
|
|
75
96
|
*/
|
|
76
|
-
export declare const Composer:
|
|
97
|
+
export declare const Composer: ComposerParts;
|
|
77
98
|
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import SvgArrowForward from "../../vendor/@material-design-icons/svg/outlined/arrow_forward.js";
|
|
2
1
|
import { lengthTone } from "../../lib/text-length.js";
|
|
3
2
|
import { Button } from "../button/button.js";
|
|
4
3
|
import { fieldStateAttributes } from "../field/field-state.js";
|
|
@@ -11,9 +10,9 @@ import { ComposerEditor } from "./composer-editor.js";
|
|
|
11
10
|
import { ComposerMentions } from "./composer-mentions.js";
|
|
12
11
|
import { parseMentionString, toPlainText } from "./mention-text.js";
|
|
13
12
|
import { c } from "react/compiler-runtime";
|
|
14
|
-
import { useEffect, useRef, useState } from "react";
|
|
15
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
16
13
|
import { clsx } from "clsx";
|
|
14
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
+
import { useEffect, useRef, useState } from "react";
|
|
17
16
|
// src/components/composer/composer.tsx
|
|
18
17
|
var defaultCanSubmit = ({ value, files }) => value.trim() !== "" || files.length > 0;
|
|
19
18
|
var INTERACTIVE = "button, a, input, textarea, [contenteditable], [tabindex]";
|
|
@@ -308,103 +307,247 @@ var Toolbar = (t0) => {
|
|
|
308
307
|
return t2;
|
|
309
308
|
};
|
|
310
309
|
/** The `length/maxLength` counter, warning near the limit. Renders nothing without a `maxLength`. */
|
|
311
|
-
var MaxLength = () => {
|
|
312
|
-
const $ = c(
|
|
310
|
+
var MaxLength = (t0) => {
|
|
311
|
+
const $ = c(14);
|
|
312
|
+
let className;
|
|
313
|
+
let props;
|
|
314
|
+
if ($[0] !== t0) {
|
|
315
|
+
({className, ...props} = t0);
|
|
316
|
+
$[0] = t0;
|
|
317
|
+
$[1] = className;
|
|
318
|
+
$[2] = props;
|
|
319
|
+
} else {
|
|
320
|
+
className = $[1];
|
|
321
|
+
props = $[2];
|
|
322
|
+
}
|
|
313
323
|
const { maxLength, textLength } = useComposerContext();
|
|
314
324
|
if (maxLength === void 0) return null;
|
|
315
|
-
let t0;
|
|
316
|
-
if ($[0] !== maxLength || $[1] !== textLength) {
|
|
317
|
-
t0 = lengthTone(textLength, maxLength);
|
|
318
|
-
$[0] = maxLength;
|
|
319
|
-
$[1] = textLength;
|
|
320
|
-
$[2] = t0;
|
|
321
|
-
} else t0 = $[2];
|
|
322
325
|
let t1;
|
|
323
|
-
if ($[3] !==
|
|
324
|
-
t1 =
|
|
325
|
-
|
|
326
|
-
|
|
326
|
+
if ($[3] !== className) {
|
|
327
|
+
t1 = clsx(composer_module_default.counter, className);
|
|
328
|
+
$[3] = className;
|
|
329
|
+
$[4] = t1;
|
|
330
|
+
} else t1 = $[4];
|
|
331
|
+
let t2;
|
|
332
|
+
if ($[5] !== maxLength || $[6] !== textLength) {
|
|
333
|
+
t2 = lengthTone(textLength, maxLength);
|
|
334
|
+
$[5] = maxLength;
|
|
335
|
+
$[6] = textLength;
|
|
336
|
+
$[7] = t2;
|
|
337
|
+
} else t2 = $[7];
|
|
338
|
+
let t3;
|
|
339
|
+
if ($[8] !== maxLength || $[9] !== props || $[10] !== t1 || $[11] !== t2 || $[12] !== textLength) {
|
|
340
|
+
t3 = /* @__PURE__ */ jsxs("span", {
|
|
341
|
+
...props,
|
|
342
|
+
className: t1,
|
|
343
|
+
"data-tone": t2,
|
|
327
344
|
children: [
|
|
328
345
|
textLength,
|
|
329
346
|
"/",
|
|
330
347
|
maxLength
|
|
331
348
|
]
|
|
332
349
|
});
|
|
333
|
-
$[
|
|
334
|
-
$[
|
|
335
|
-
$[
|
|
336
|
-
$[
|
|
337
|
-
|
|
338
|
-
|
|
350
|
+
$[8] = maxLength;
|
|
351
|
+
$[9] = props;
|
|
352
|
+
$[10] = t1;
|
|
353
|
+
$[11] = t2;
|
|
354
|
+
$[12] = textLength;
|
|
355
|
+
$[13] = t3;
|
|
356
|
+
} else t3 = $[13];
|
|
357
|
+
return t3;
|
|
339
358
|
};
|
|
340
|
-
/** The icon button that sends the message; disabled while it can't be sent. */
|
|
359
|
+
/** The icon button that sends the message, its children the glyph; disabled while it can't be sent. */
|
|
341
360
|
var SendButton = (t0) => {
|
|
342
|
-
const $ = c(
|
|
361
|
+
const $ = c(14);
|
|
362
|
+
let children;
|
|
343
363
|
let label;
|
|
344
364
|
let props;
|
|
345
365
|
let t1;
|
|
346
366
|
if ($[0] !== t0) {
|
|
347
|
-
({label, variant: t1, ...props} = t0);
|
|
367
|
+
({label, variant: t1, children, ...props} = t0);
|
|
348
368
|
$[0] = t0;
|
|
349
|
-
$[1] =
|
|
350
|
-
$[2] =
|
|
351
|
-
$[3] =
|
|
369
|
+
$[1] = children;
|
|
370
|
+
$[2] = label;
|
|
371
|
+
$[3] = props;
|
|
372
|
+
$[4] = t1;
|
|
352
373
|
} else {
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
374
|
+
children = $[1];
|
|
375
|
+
label = $[2];
|
|
376
|
+
props = $[3];
|
|
377
|
+
t1 = $[4];
|
|
356
378
|
}
|
|
357
379
|
const variant = t1 === void 0 ? "primary" : t1;
|
|
358
380
|
const { submit, canSend } = useComposerContext();
|
|
359
381
|
const t2 = !canSend;
|
|
360
382
|
let t3;
|
|
361
|
-
if ($[
|
|
383
|
+
if ($[5] !== submit) {
|
|
362
384
|
t3 = () => {
|
|
363
385
|
submit();
|
|
364
386
|
};
|
|
365
|
-
$[
|
|
366
|
-
$[
|
|
367
|
-
} else t3 = $[
|
|
387
|
+
$[5] = submit;
|
|
388
|
+
$[6] = t3;
|
|
389
|
+
} else t3 = $[6];
|
|
368
390
|
let t4;
|
|
369
|
-
if ($[
|
|
391
|
+
if ($[7] !== children || $[8] !== label || $[9] !== props || $[10] !== t2 || $[11] !== t3 || $[12] !== variant) {
|
|
370
392
|
t4 = /* @__PURE__ */ jsx(Button, {
|
|
371
393
|
variant,
|
|
372
394
|
size: "md",
|
|
373
395
|
iconOnly: true,
|
|
374
|
-
icon:
|
|
396
|
+
icon: children,
|
|
375
397
|
label,
|
|
376
398
|
disabled: t2,
|
|
377
399
|
onClick: t3,
|
|
378
400
|
...props
|
|
379
401
|
});
|
|
380
|
-
$[
|
|
381
|
-
$[
|
|
382
|
-
$[
|
|
383
|
-
$[
|
|
384
|
-
$[
|
|
385
|
-
$[
|
|
386
|
-
|
|
402
|
+
$[7] = children;
|
|
403
|
+
$[8] = label;
|
|
404
|
+
$[9] = props;
|
|
405
|
+
$[10] = t2;
|
|
406
|
+
$[11] = t3;
|
|
407
|
+
$[12] = variant;
|
|
408
|
+
$[13] = t4;
|
|
409
|
+
} else t4 = $[13];
|
|
387
410
|
return t4;
|
|
388
411
|
};
|
|
412
|
+
var Prefab = (t0) => {
|
|
413
|
+
const $ = c(34);
|
|
414
|
+
let attachments;
|
|
415
|
+
let label;
|
|
416
|
+
let maxLines;
|
|
417
|
+
let mentions;
|
|
418
|
+
let minLines;
|
|
419
|
+
let placeholder;
|
|
420
|
+
let props;
|
|
421
|
+
let sendIcon;
|
|
422
|
+
let sendLabel;
|
|
423
|
+
if ($[0] !== t0) {
|
|
424
|
+
({label, placeholder, minLines, maxLines, mentions, attachments, sendLabel, sendIcon, ...props} = t0);
|
|
425
|
+
$[0] = t0;
|
|
426
|
+
$[1] = attachments;
|
|
427
|
+
$[2] = label;
|
|
428
|
+
$[3] = maxLines;
|
|
429
|
+
$[4] = mentions;
|
|
430
|
+
$[5] = minLines;
|
|
431
|
+
$[6] = placeholder;
|
|
432
|
+
$[7] = props;
|
|
433
|
+
$[8] = sendIcon;
|
|
434
|
+
$[9] = sendLabel;
|
|
435
|
+
} else {
|
|
436
|
+
attachments = $[1];
|
|
437
|
+
label = $[2];
|
|
438
|
+
maxLines = $[3];
|
|
439
|
+
mentions = $[4];
|
|
440
|
+
minLines = $[5];
|
|
441
|
+
placeholder = $[6];
|
|
442
|
+
props = $[7];
|
|
443
|
+
sendIcon = $[8];
|
|
444
|
+
sendLabel = $[9];
|
|
445
|
+
}
|
|
446
|
+
let t1;
|
|
447
|
+
if ($[10] !== attachments) {
|
|
448
|
+
t1 = attachments === void 0 ? null : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ComposerAttachments, {
|
|
449
|
+
label: attachments.label,
|
|
450
|
+
removeLabel: attachments.removeLabel,
|
|
451
|
+
removeIcon: attachments.removeIcon,
|
|
452
|
+
fileIcon: attachments.fileIcon,
|
|
453
|
+
fileHint: attachments.fileHint
|
|
454
|
+
}), /* @__PURE__ */ jsx(ComposerAttachmentsError, { tooLargeError: attachments.tooLargeError })] });
|
|
455
|
+
$[10] = attachments;
|
|
456
|
+
$[11] = t1;
|
|
457
|
+
} else t1 = $[11];
|
|
458
|
+
let t2;
|
|
459
|
+
if ($[12] !== mentions) {
|
|
460
|
+
t2 = mentions === void 0 ? null : /* @__PURE__ */ jsx(ComposerMentions, { ...mentions });
|
|
461
|
+
$[12] = mentions;
|
|
462
|
+
$[13] = t2;
|
|
463
|
+
} else t2 = $[13];
|
|
464
|
+
let t3;
|
|
465
|
+
if ($[14] !== label || $[15] !== maxLines || $[16] !== minLines || $[17] !== placeholder || $[18] !== t2) {
|
|
466
|
+
t3 = /* @__PURE__ */ jsx(ComposerEditor, {
|
|
467
|
+
label,
|
|
468
|
+
placeholder,
|
|
469
|
+
minLines,
|
|
470
|
+
maxLines,
|
|
471
|
+
children: t2
|
|
472
|
+
});
|
|
473
|
+
$[14] = label;
|
|
474
|
+
$[15] = maxLines;
|
|
475
|
+
$[16] = minLines;
|
|
476
|
+
$[17] = placeholder;
|
|
477
|
+
$[18] = t2;
|
|
478
|
+
$[19] = t3;
|
|
479
|
+
} else t3 = $[19];
|
|
480
|
+
let t4;
|
|
481
|
+
if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
|
|
482
|
+
t4 = /* @__PURE__ */ jsx(MaxLength, {});
|
|
483
|
+
$[20] = t4;
|
|
484
|
+
} else t4 = $[20];
|
|
485
|
+
let t5;
|
|
486
|
+
if ($[21] !== attachments) {
|
|
487
|
+
t5 = attachments === void 0 ? null : /* @__PURE__ */ jsx(ComposerAttachButton, {
|
|
488
|
+
label: attachments.attachLabel,
|
|
489
|
+
accept: attachments.accept,
|
|
490
|
+
children: attachments.attachIcon
|
|
491
|
+
});
|
|
492
|
+
$[21] = attachments;
|
|
493
|
+
$[22] = t5;
|
|
494
|
+
} else t5 = $[22];
|
|
495
|
+
let t6;
|
|
496
|
+
if ($[23] !== sendIcon || $[24] !== sendLabel) {
|
|
497
|
+
t6 = /* @__PURE__ */ jsx(SendButton, {
|
|
498
|
+
label: sendLabel,
|
|
499
|
+
children: sendIcon
|
|
500
|
+
});
|
|
501
|
+
$[23] = sendIcon;
|
|
502
|
+
$[24] = sendLabel;
|
|
503
|
+
$[25] = t6;
|
|
504
|
+
} else t6 = $[25];
|
|
505
|
+
let t7;
|
|
506
|
+
if ($[26] !== t5 || $[27] !== t6) {
|
|
507
|
+
t7 = /* @__PURE__ */ jsxs(Toolbar, { children: [
|
|
508
|
+
t4,
|
|
509
|
+
t5,
|
|
510
|
+
t6
|
|
511
|
+
] });
|
|
512
|
+
$[26] = t5;
|
|
513
|
+
$[27] = t6;
|
|
514
|
+
$[28] = t7;
|
|
515
|
+
} else t7 = $[28];
|
|
516
|
+
let t8;
|
|
517
|
+
if ($[29] !== props || $[30] !== t1 || $[31] !== t3 || $[32] !== t7) {
|
|
518
|
+
t8 = /* @__PURE__ */ jsxs(Root, {
|
|
519
|
+
...props,
|
|
520
|
+
children: [
|
|
521
|
+
t1,
|
|
522
|
+
t3,
|
|
523
|
+
t7
|
|
524
|
+
]
|
|
525
|
+
});
|
|
526
|
+
$[29] = props;
|
|
527
|
+
$[30] = t1;
|
|
528
|
+
$[31] = t3;
|
|
529
|
+
$[32] = t7;
|
|
530
|
+
$[33] = t8;
|
|
531
|
+
} else t8 = $[33];
|
|
532
|
+
return t8;
|
|
533
|
+
};
|
|
389
534
|
/**
|
|
390
535
|
* A message composer: a plain-text editor with `@` mentions, staged
|
|
391
536
|
* attachments, a length counter, and Enter to send (Shift+Enter for a new
|
|
392
|
-
* line).
|
|
537
|
+
* line). The prefab wires the editor, the attachments and the send button
|
|
538
|
+
* into one; the parts hanging off it compose a composer by hand.
|
|
393
539
|
*
|
|
394
540
|
* @example
|
|
395
|
-
* <Composer
|
|
396
|
-
*
|
|
397
|
-
*
|
|
398
|
-
*
|
|
399
|
-
*
|
|
400
|
-
*
|
|
401
|
-
*
|
|
402
|
-
*
|
|
403
|
-
* <Composer.SendButton label="Send" />
|
|
404
|
-
* </Composer.Toolbar>
|
|
405
|
-
* </Composer.Root>
|
|
541
|
+
* <Composer
|
|
542
|
+
* label="Comment"
|
|
543
|
+
* onSend={send}
|
|
544
|
+
* maxLength={2000}
|
|
545
|
+
* mentions={{ label: "People to mention", sources: [people] }}
|
|
546
|
+
* sendLabel="Send"
|
|
547
|
+
* sendIcon={<SendIcon />}
|
|
548
|
+
* />
|
|
406
549
|
*/
|
|
407
|
-
var Composer = {
|
|
550
|
+
var Composer = Object.assign(Prefab, {
|
|
408
551
|
Root,
|
|
409
552
|
Editor: ComposerEditor,
|
|
410
553
|
Mentions: ComposerMentions,
|
|
@@ -415,7 +558,7 @@ var Composer = {
|
|
|
415
558
|
MaxLength,
|
|
416
559
|
SendButton,
|
|
417
560
|
createHandle: createComposerHandle
|
|
418
|
-
};
|
|
561
|
+
});
|
|
419
562
|
function _temp(attachment) {
|
|
420
563
|
return attachment.file;
|
|
421
564
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import mention_text_module_default from "./mention-text.module.js";
|
|
2
2
|
import { c } from "react/compiler-runtime";
|
|
3
|
-
import { Fragment } from "react";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
5
3
|
import { clsx } from "clsx";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { Fragment as Fragment$1 } from "react";
|
|
6
6
|
// src/components/composer/mention-text.tsx
|
|
7
7
|
var MENTION_PATTERN = /@\[(?<name>[^\]]+)\]\((?<id>[^)]+)\)/g;
|
|
8
8
|
/**
|
|
@@ -90,6 +90,6 @@ var MentionPill = (t0) => {
|
|
|
90
90
|
*/
|
|
91
91
|
var MentionText = ({ children, renderMention }) => parseMentionString(children).map((token, index) => {
|
|
92
92
|
const content = token.type === "text" ? token.text : renderMention === void 0 ? /* @__PURE__ */ jsx(MentionPill, { children: token.label }) : renderMention(token);
|
|
93
|
-
return /* @__PURE__ */ jsx(Fragment, { children: content }, index);
|
|
93
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children: content }, index);
|
|
94
94
|
});
|
|
95
95
|
export { MentionPill, MentionText, parseMentionString, serializeMention, toPlainText };
|
|
@@ -10,8 +10,11 @@ export type ConfirmDialogRootProps = Readonly<{
|
|
|
10
10
|
onOpenChange: (open: boolean) => void;
|
|
11
11
|
children: ReactNode;
|
|
12
12
|
}>;
|
|
13
|
+
/** The controlled alert dialog: its portal, backdrop and surface. */
|
|
13
14
|
declare const ConfirmDialogRoot: ({ open, onOpenChange, children, }: ConfirmDialogRootProps) => ReactNode;
|
|
15
|
+
/** The question the dialog asks. */
|
|
14
16
|
declare const ConfirmDialogTitle: ({ className, ...props }: AlertDialog.Title.Props) => ReactNode;
|
|
17
|
+
/** What confirming does; renders nothing without children. */
|
|
15
18
|
declare const ConfirmDialogDescription: ({ className, children, ...props }: AlertDialog.Description.Props) => ReactNode;
|
|
16
19
|
/** The row the actions sit on, the way out first. */
|
|
17
20
|
declare const ConfirmDialogFooter: ({ className, ...props }: ComponentProps<"div">) => ReactNode;
|
|
@@ -53,21 +56,19 @@ type ConfirmDialogParts = typeof ConfirmDialogShorthand & Readonly<{
|
|
|
53
56
|
Confirm: typeof ConfirmDialogConfirm;
|
|
54
57
|
}>;
|
|
55
58
|
/**
|
|
56
|
-
*
|
|
57
|
-
* `
|
|
58
|
-
*
|
|
59
|
-
* it rejects. `tone="danger"` repoints the confirm action to the error role. The
|
|
60
|
-
* parts hanging off it compose a confirmation with a body of its own.
|
|
59
|
+
* A controlled confirmation over base-ui's `AlertDialog`. A promise from
|
|
60
|
+
* `onConfirm` keeps it busy until it settles, closing on resolve and staying open
|
|
61
|
+
* on reject; the parts hanging off it build one by hand.
|
|
61
62
|
*
|
|
62
63
|
* @example
|
|
63
64
|
* <ConfirmDialog
|
|
64
65
|
* open={open}
|
|
65
66
|
* onOpenChange={setOpen}
|
|
66
|
-
* title="Delete this
|
|
67
|
+
* title="Delete this invoice?"
|
|
67
68
|
* description="This cannot be undone."
|
|
68
69
|
* confirmLabel="Delete"
|
|
69
70
|
* cancelLabel="Cancel"
|
|
70
|
-
* onConfirm={() =>
|
|
71
|
+
* onConfirm={() => deleteInvoice(id)}
|
|
71
72
|
* tone="danger"
|
|
72
73
|
* />
|
|
73
74
|
*/
|
|
@@ -3,9 +3,9 @@ import { Button } from "../button/button.js";
|
|
|
3
3
|
import { Spinner } from "../spinner/spinner.js";
|
|
4
4
|
import confirm_dialog_module_default from "./confirm-dialog.module.js";
|
|
5
5
|
import { c } from "react/compiler-runtime";
|
|
6
|
-
import { createContext, useContext, useRef, useState } from "react";
|
|
7
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
6
|
import { clsx } from "clsx";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { createContext, useContext, useRef, useState } from "react";
|
|
9
9
|
import { AlertDialog } from "@base-ui/react/alert-dialog";
|
|
10
10
|
// src/components/confirm-dialog/confirm-dialog.tsx
|
|
11
11
|
var ConfirmContext = createContext({
|
|
@@ -72,6 +72,7 @@ var useConfirmAttempt = (close) => {
|
|
|
72
72
|
} else t3 = $[8];
|
|
73
73
|
return t3;
|
|
74
74
|
};
|
|
75
|
+
/** The controlled alert dialog: its portal, backdrop and surface. */
|
|
75
76
|
var ConfirmDialogRoot = (t0) => {
|
|
76
77
|
const $ = c(19);
|
|
77
78
|
const { open, onOpenChange, children } = t0;
|
|
@@ -142,6 +143,7 @@ var ConfirmDialogRoot = (t0) => {
|
|
|
142
143
|
} else t8 = $[18];
|
|
143
144
|
return t8;
|
|
144
145
|
};
|
|
146
|
+
/** The question the dialog asks. */
|
|
145
147
|
var ConfirmDialogTitle = (t0) => {
|
|
146
148
|
const $ = c(8);
|
|
147
149
|
let className;
|
|
@@ -173,6 +175,7 @@ var ConfirmDialogTitle = (t0) => {
|
|
|
173
175
|
} else t2 = $[7];
|
|
174
176
|
return t2;
|
|
175
177
|
};
|
|
178
|
+
/** What confirming does; renders nothing without children. */
|
|
176
179
|
var ConfirmDialogDescription = (t0) => {
|
|
177
180
|
const $ = c(8);
|
|
178
181
|
let children;
|
|
@@ -370,21 +373,19 @@ var ConfirmDialogShorthand = (t0) => {
|
|
|
370
373
|
return t6;
|
|
371
374
|
};
|
|
372
375
|
/**
|
|
373
|
-
*
|
|
374
|
-
* `
|
|
375
|
-
*
|
|
376
|
-
* it rejects. `tone="danger"` repoints the confirm action to the error role. The
|
|
377
|
-
* parts hanging off it compose a confirmation with a body of its own.
|
|
376
|
+
* A controlled confirmation over base-ui's `AlertDialog`. A promise from
|
|
377
|
+
* `onConfirm` keeps it busy until it settles, closing on resolve and staying open
|
|
378
|
+
* on reject; the parts hanging off it build one by hand.
|
|
378
379
|
*
|
|
379
380
|
* @example
|
|
380
381
|
* <ConfirmDialog
|
|
381
382
|
* open={open}
|
|
382
383
|
* onOpenChange={setOpen}
|
|
383
|
-
* title="Delete this
|
|
384
|
+
* title="Delete this invoice?"
|
|
384
385
|
* description="This cannot be undone."
|
|
385
386
|
* confirmLabel="Delete"
|
|
386
387
|
* cancelLabel="Cancel"
|
|
387
|
-
* onConfirm={() =>
|
|
388
|
+
* onConfirm={() => deleteInvoice(id)}
|
|
388
389
|
* tone="danger"
|
|
389
390
|
* />
|
|
390
391
|
*/
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import { type Context } from "react";
|
|
2
1
|
/** Whose message it is: the viewer's, the other party's, or a colleague's. */
|
|
3
2
|
export type ConversationMessageSide = "own" | "other" | "colleague";
|
|
4
3
|
/** Whether the other party has read a message. */
|
|
5
4
|
export type ConversationMessageStatus = "read" | "unread";
|
|
6
|
-
export type ConversationMessageContextValue = Readonly<{
|
|
7
|
-
side: ConversationMessageSide;
|
|
8
|
-
}>;
|
|
9
|
-
export declare const ConversationMessageContext: Context<ConversationMessageContextValue | null>;
|