@igne-agency/react-web-ui 0.3.0 → 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.css +4 -3
- package/dist/components/fieldset/fieldset.js +1 -1
- package/dist/components/fieldset/fieldset.module.js +2 -2
- 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,147 +1,301 @@
|
|
|
1
|
-
import
|
|
2
|
-
import SvgClose from "../../vendor/@material-design-icons/svg/outlined/close.js";
|
|
3
|
-
import SvgError from "../../vendor/@material-design-icons/svg/outlined/error.js";
|
|
4
|
-
import SvgInfo from "../../vendor/@material-design-icons/svg/outlined/info.js";
|
|
5
|
-
import SvgWarningAmber from "../../vendor/@material-design-icons/svg/outlined/warning_amber.js";
|
|
1
|
+
import { useRequiredContext } from "../../lib/use-required-context.js";
|
|
6
2
|
import { Button } from "../button/button.js";
|
|
7
|
-
import { Icon } from "../icon/icon.js";
|
|
8
3
|
import { flushBufferedToasts, toastManager } from "./toast.js";
|
|
9
4
|
import toast_provider_module_default from "./toast-provider.module.js";
|
|
10
5
|
import { c } from "react/compiler-runtime";
|
|
11
|
-
import {
|
|
12
|
-
import { Fragment
|
|
6
|
+
import { clsx } from "clsx";
|
|
7
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { Fragment as Fragment$1, createContext, useEffect } from "react";
|
|
13
9
|
import { Toast } from "@base-ui/react/toast";
|
|
14
10
|
// src/components/toast/toast-provider.tsx
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
var ToastIdContext = createContext(null);
|
|
12
|
+
/** A toast's frame, in its tone: a dialog that holds the other parts. */
|
|
13
|
+
var Root = (t0) => {
|
|
14
|
+
const $ = c(14);
|
|
15
|
+
let className;
|
|
16
|
+
let props;
|
|
17
|
+
let toast;
|
|
18
|
+
if ($[0] !== t0) {
|
|
19
|
+
({toast, className, ...props} = t0);
|
|
20
|
+
$[0] = t0;
|
|
21
|
+
$[1] = className;
|
|
22
|
+
$[2] = props;
|
|
23
|
+
$[3] = toast;
|
|
24
|
+
} else {
|
|
25
|
+
className = $[1];
|
|
26
|
+
props = $[2];
|
|
27
|
+
toast = $[3];
|
|
28
|
+
}
|
|
29
|
+
const t1 = toast.id;
|
|
30
|
+
const t2 = toast.data?.tone;
|
|
31
|
+
let t3;
|
|
32
|
+
if ($[4] !== className) {
|
|
33
|
+
t3 = clsx(toast_provider_module_default.toast, className);
|
|
34
|
+
$[4] = className;
|
|
35
|
+
$[5] = t3;
|
|
36
|
+
} else t3 = $[5];
|
|
37
|
+
let t4;
|
|
38
|
+
if ($[6] !== props || $[7] !== t2 || $[8] !== t3 || $[9] !== toast) {
|
|
39
|
+
t4 = /* @__PURE__ */ jsx(Toast.Root, {
|
|
40
|
+
toast,
|
|
41
|
+
"data-tone": t2,
|
|
42
|
+
...props,
|
|
43
|
+
className: t3
|
|
44
|
+
});
|
|
45
|
+
$[6] = props;
|
|
46
|
+
$[7] = t2;
|
|
47
|
+
$[8] = t3;
|
|
48
|
+
$[9] = toast;
|
|
49
|
+
$[10] = t4;
|
|
50
|
+
} else t4 = $[10];
|
|
51
|
+
let t5;
|
|
52
|
+
if ($[11] !== t4 || $[12] !== toast.id) {
|
|
53
|
+
t5 = /* @__PURE__ */ jsx(ToastIdContext, {
|
|
54
|
+
value: t1,
|
|
55
|
+
children: t4
|
|
56
|
+
});
|
|
57
|
+
$[11] = t4;
|
|
58
|
+
$[12] = toast.id;
|
|
59
|
+
$[13] = t5;
|
|
60
|
+
} else t5 = $[13];
|
|
61
|
+
return t5;
|
|
20
62
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
63
|
+
/** The caller's glyph before the title, sized and coloured by the toast. Renders nothing without children. */
|
|
64
|
+
var Icon = (t0) => {
|
|
65
|
+
const $ = c(8);
|
|
66
|
+
let children;
|
|
67
|
+
let className;
|
|
68
|
+
let props;
|
|
69
|
+
if ($[0] !== t0) {
|
|
70
|
+
({className, children, ...props} = t0);
|
|
71
|
+
$[0] = t0;
|
|
72
|
+
$[1] = children;
|
|
73
|
+
$[2] = className;
|
|
74
|
+
$[3] = props;
|
|
75
|
+
} else {
|
|
76
|
+
children = $[1];
|
|
77
|
+
className = $[2];
|
|
78
|
+
props = $[3];
|
|
79
|
+
}
|
|
80
|
+
let t1;
|
|
81
|
+
if ($[4] !== children || $[5] !== className || $[6] !== props) {
|
|
82
|
+
t1 = children === void 0 || children === null || children === false ? null : /* @__PURE__ */ jsx("span", {
|
|
83
|
+
"aria-hidden": "true",
|
|
84
|
+
...props,
|
|
85
|
+
className: clsx(toast_provider_module_default.icon, className),
|
|
86
|
+
children
|
|
87
|
+
});
|
|
88
|
+
$[4] = children;
|
|
89
|
+
$[5] = className;
|
|
90
|
+
$[6] = props;
|
|
91
|
+
$[7] = t1;
|
|
92
|
+
} else t1 = $[7];
|
|
93
|
+
return t1;
|
|
94
|
+
};
|
|
95
|
+
/** The toast's heading, which names its dialog. */
|
|
96
|
+
var Title = (t0) => {
|
|
97
|
+
const $ = c(8);
|
|
98
|
+
let className;
|
|
99
|
+
let props;
|
|
100
|
+
if ($[0] !== t0) {
|
|
101
|
+
({className, ...props} = t0);
|
|
102
|
+
$[0] = t0;
|
|
103
|
+
$[1] = className;
|
|
104
|
+
$[2] = props;
|
|
105
|
+
} else {
|
|
106
|
+
className = $[1];
|
|
107
|
+
props = $[2];
|
|
108
|
+
}
|
|
109
|
+
let t1;
|
|
110
|
+
if ($[3] !== className) {
|
|
111
|
+
t1 = clsx(toast_provider_module_default.title, className);
|
|
112
|
+
$[3] = className;
|
|
113
|
+
$[4] = t1;
|
|
114
|
+
} else t1 = $[4];
|
|
26
115
|
let t2;
|
|
27
|
-
if ($[
|
|
28
|
-
t2 = /* @__PURE__ */ jsx(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
label: ""
|
|
116
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
117
|
+
t2 = /* @__PURE__ */ jsx(Toast.Title, {
|
|
118
|
+
...props,
|
|
119
|
+
className: t1
|
|
32
120
|
});
|
|
33
|
-
$[
|
|
34
|
-
$[
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
121
|
+
$[5] = props;
|
|
122
|
+
$[6] = t1;
|
|
123
|
+
$[7] = t2;
|
|
124
|
+
} else t2 = $[7];
|
|
125
|
+
return t2;
|
|
126
|
+
};
|
|
127
|
+
/** The text under the title, which describes its dialog. */
|
|
128
|
+
var Description = (t0) => {
|
|
129
|
+
const $ = c(8);
|
|
130
|
+
let className;
|
|
131
|
+
let props;
|
|
132
|
+
if ($[0] !== t0) {
|
|
133
|
+
({className, ...props} = t0);
|
|
134
|
+
$[0] = t0;
|
|
135
|
+
$[1] = className;
|
|
136
|
+
$[2] = props;
|
|
137
|
+
} else {
|
|
138
|
+
className = $[1];
|
|
139
|
+
props = $[2];
|
|
140
|
+
}
|
|
141
|
+
let t1;
|
|
142
|
+
if ($[3] !== className) {
|
|
143
|
+
t1 = clsx(toast_provider_module_default.description, className);
|
|
144
|
+
$[3] = className;
|
|
145
|
+
$[4] = t1;
|
|
146
|
+
} else t1 = $[4];
|
|
147
|
+
let t2;
|
|
148
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
149
|
+
t2 = /* @__PURE__ */ jsx(Toast.Description, {
|
|
150
|
+
...props,
|
|
151
|
+
className: t1
|
|
42
152
|
});
|
|
43
|
-
$[
|
|
44
|
-
$[
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
153
|
+
$[5] = props;
|
|
154
|
+
$[6] = t1;
|
|
155
|
+
$[7] = t2;
|
|
156
|
+
} else t2 = $[7];
|
|
157
|
+
return t2;
|
|
158
|
+
};
|
|
159
|
+
/** The row of buttons under the text, re-coloured for the toast's tone. */
|
|
160
|
+
var Actions = (t0) => {
|
|
161
|
+
const $ = c(8);
|
|
162
|
+
let className;
|
|
163
|
+
let props;
|
|
164
|
+
if ($[0] !== t0) {
|
|
165
|
+
({className, ...props} = t0);
|
|
166
|
+
$[0] = t0;
|
|
167
|
+
$[1] = className;
|
|
168
|
+
$[2] = props;
|
|
169
|
+
} else {
|
|
170
|
+
className = $[1];
|
|
171
|
+
props = $[2];
|
|
172
|
+
}
|
|
173
|
+
let t1;
|
|
174
|
+
if ($[3] !== className) {
|
|
175
|
+
t1 = clsx(toast_provider_module_default.actions, className);
|
|
176
|
+
$[3] = className;
|
|
177
|
+
$[4] = t1;
|
|
178
|
+
} else t1 = $[4];
|
|
179
|
+
let t2;
|
|
180
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
181
|
+
t2 = /* @__PURE__ */ jsx("div", {
|
|
182
|
+
...props,
|
|
183
|
+
className: t1
|
|
51
184
|
});
|
|
185
|
+
$[5] = props;
|
|
186
|
+
$[6] = t1;
|
|
187
|
+
$[7] = t2;
|
|
188
|
+
} else t2 = $[7];
|
|
189
|
+
return t2;
|
|
190
|
+
};
|
|
191
|
+
/** The icon-only button that closes the toast, named for every input. */
|
|
192
|
+
var Close = (t0) => {
|
|
193
|
+
const $ = c(10);
|
|
194
|
+
const { label, children, className } = t0;
|
|
195
|
+
const id = useRequiredContext(ToastIdContext, "Toast.Close must be rendered inside <Toast.Root>.");
|
|
196
|
+
const { close } = Toast.useToastManager();
|
|
197
|
+
let t1;
|
|
198
|
+
if ($[0] !== className) {
|
|
199
|
+
t1 = clsx(toast_provider_module_default.close, className);
|
|
200
|
+
$[0] = className;
|
|
201
|
+
$[1] = t1;
|
|
202
|
+
} else t1 = $[1];
|
|
203
|
+
let t2;
|
|
204
|
+
if ($[2] !== close || $[3] !== id) {
|
|
205
|
+
t2 = () => {
|
|
206
|
+
close(id);
|
|
207
|
+
};
|
|
208
|
+
$[2] = close;
|
|
209
|
+
$[3] = id;
|
|
52
210
|
$[4] = t2;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
t6 = /* @__PURE__ */ jsx(Button, {
|
|
59
|
-
className: toast_provider_module_default.closeButton,
|
|
211
|
+
} else t2 = $[4];
|
|
212
|
+
let t3;
|
|
213
|
+
if ($[5] !== children || $[6] !== label || $[7] !== t1 || $[8] !== t2) {
|
|
214
|
+
t3 = /* @__PURE__ */ jsx(Button, {
|
|
215
|
+
className: t1,
|
|
60
216
|
variant: "tertiary",
|
|
61
217
|
size: "sm",
|
|
62
218
|
iconOnly: true,
|
|
63
|
-
icon:
|
|
64
|
-
label
|
|
65
|
-
onClick:
|
|
66
|
-
});
|
|
67
|
-
$[7] = closeLabel;
|
|
68
|
-
$[8] = onClose;
|
|
69
|
-
$[9] = t6;
|
|
70
|
-
} else t6 = $[9];
|
|
71
|
-
let t7;
|
|
72
|
-
if ($[10] !== t5 || $[11] !== t6) {
|
|
73
|
-
t7 = /* @__PURE__ */ jsxs("div", {
|
|
74
|
-
className: toast_provider_module_default.header,
|
|
75
|
-
children: [t5, t6]
|
|
76
|
-
});
|
|
77
|
-
$[10] = t5;
|
|
78
|
-
$[11] = t6;
|
|
79
|
-
$[12] = t7;
|
|
80
|
-
} else t7 = $[12];
|
|
81
|
-
let t8;
|
|
82
|
-
if ($[13] !== data.body || $[14] !== data.title) {
|
|
83
|
-
t8 = data.title !== void 0 && /* @__PURE__ */ jsx(Toast.Description, {
|
|
84
|
-
className: toast_provider_module_default.description,
|
|
85
|
-
children: data.body
|
|
219
|
+
icon: children,
|
|
220
|
+
label,
|
|
221
|
+
onClick: t2
|
|
86
222
|
});
|
|
87
|
-
$[
|
|
88
|
-
$[
|
|
89
|
-
$[
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
className: toast_provider_module_default.actions,
|
|
95
|
-
children: data.actions.map(_temp)
|
|
96
|
-
});
|
|
97
|
-
$[16] = data.actions;
|
|
98
|
-
$[17] = t9;
|
|
99
|
-
} else t9 = $[17];
|
|
100
|
-
let t10;
|
|
101
|
-
if ($[18] !== t7 || $[19] !== t8 || $[20] !== t9) {
|
|
102
|
-
t10 = /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
103
|
-
t7,
|
|
104
|
-
t8,
|
|
105
|
-
t9
|
|
106
|
-
] });
|
|
107
|
-
$[18] = t7;
|
|
108
|
-
$[19] = t8;
|
|
109
|
-
$[20] = t9;
|
|
110
|
-
$[21] = t10;
|
|
111
|
-
} else t10 = $[21];
|
|
112
|
-
return t10;
|
|
223
|
+
$[5] = children;
|
|
224
|
+
$[6] = label;
|
|
225
|
+
$[7] = t1;
|
|
226
|
+
$[8] = t2;
|
|
227
|
+
$[9] = t3;
|
|
228
|
+
} else t3 = $[9];
|
|
229
|
+
return t3;
|
|
113
230
|
};
|
|
114
|
-
|
|
231
|
+
/**
|
|
232
|
+
* The parts of one toast: the `Root` frame in its tone, the `Icon`, `Title`,
|
|
233
|
+
* `Description` and `Actions`, and the `Close` button.
|
|
234
|
+
*
|
|
235
|
+
* @example
|
|
236
|
+
* <Toast.Root toast={toast}>
|
|
237
|
+
* <Toast.Title>{toast.data?.body}</Toast.Title>
|
|
238
|
+
* <Toast.Close label="Close"><CloseIcon /></Toast.Close>
|
|
239
|
+
* </Toast.Root>
|
|
240
|
+
*/
|
|
241
|
+
var Toast$1 = {
|
|
242
|
+
Root,
|
|
243
|
+
Icon,
|
|
244
|
+
Title,
|
|
245
|
+
Description,
|
|
246
|
+
Actions,
|
|
247
|
+
Close
|
|
248
|
+
};
|
|
249
|
+
var DefaultToast = (t0) => {
|
|
115
250
|
const $ = c(7);
|
|
116
|
-
const { closeLabel } = t0;
|
|
117
|
-
const {
|
|
251
|
+
const { toast, closeLabel, closeIcon } = t0;
|
|
252
|
+
const { data } = toast;
|
|
118
253
|
let t1;
|
|
119
|
-
if ($[0] !==
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
onClose: () => close(toast.id)
|
|
132
|
-
})
|
|
133
|
-
})
|
|
134
|
-
}, toast.id);
|
|
135
|
-
$[4] = close;
|
|
136
|
-
$[5] = closeLabel;
|
|
137
|
-
$[6] = t2;
|
|
138
|
-
} else t2 = $[6];
|
|
139
|
-
t1 = toasts.map(t2);
|
|
140
|
-
$[0] = close;
|
|
254
|
+
if ($[0] !== closeIcon || $[1] !== closeLabel || $[2] !== data) {
|
|
255
|
+
t1 = data === void 0 ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
256
|
+
/* @__PURE__ */ jsx(Icon, { children: data.icon }),
|
|
257
|
+
/* @__PURE__ */ jsx(Title, { children: data.title ?? data.body }),
|
|
258
|
+
/* @__PURE__ */ jsx(Close, {
|
|
259
|
+
label: closeLabel,
|
|
260
|
+
children: closeIcon
|
|
261
|
+
}),
|
|
262
|
+
data.title === void 0 ? null : /* @__PURE__ */ jsx(Description, { children: data.body }),
|
|
263
|
+
data.actions && data.actions.length > 0 ? /* @__PURE__ */ jsx(Actions, { children: data.actions.map(_temp) }) : null
|
|
264
|
+
] });
|
|
265
|
+
$[0] = closeIcon;
|
|
141
266
|
$[1] = closeLabel;
|
|
142
|
-
$[2] =
|
|
267
|
+
$[2] = data;
|
|
143
268
|
$[3] = t1;
|
|
144
269
|
} else t1 = $[3];
|
|
270
|
+
let t2;
|
|
271
|
+
if ($[4] !== t1 || $[5] !== toast) {
|
|
272
|
+
t2 = /* @__PURE__ */ jsx(Root, {
|
|
273
|
+
toast,
|
|
274
|
+
children: t1
|
|
275
|
+
});
|
|
276
|
+
$[4] = t1;
|
|
277
|
+
$[5] = toast;
|
|
278
|
+
$[6] = t2;
|
|
279
|
+
} else t2 = $[6];
|
|
280
|
+
return t2;
|
|
281
|
+
};
|
|
282
|
+
var ToastList = (t0) => {
|
|
283
|
+
const $ = c(5);
|
|
284
|
+
const { renderToast } = t0;
|
|
285
|
+
const { toasts } = Toast.useToastManager();
|
|
286
|
+
let t1;
|
|
287
|
+
if ($[0] !== renderToast || $[1] !== toasts) {
|
|
288
|
+
let t2;
|
|
289
|
+
if ($[3] !== renderToast) {
|
|
290
|
+
t2 = (toast) => /* @__PURE__ */ jsx(Fragment$1, { children: renderToast(toast) }, toast.id);
|
|
291
|
+
$[3] = renderToast;
|
|
292
|
+
$[4] = t2;
|
|
293
|
+
} else t2 = $[4];
|
|
294
|
+
t1 = toasts.map(t2);
|
|
295
|
+
$[0] = renderToast;
|
|
296
|
+
$[1] = toasts;
|
|
297
|
+
$[2] = t1;
|
|
298
|
+
} else t1 = $[2];
|
|
145
299
|
return t1;
|
|
146
300
|
};
|
|
147
301
|
/**
|
|
@@ -149,13 +303,13 @@ var ToastList = (t0) => {
|
|
|
149
303
|
* {@link toastManager} to base-ui and renders the viewport alongside the app.
|
|
150
304
|
*
|
|
151
305
|
* @example
|
|
152
|
-
* <ToastProvider closeLabel="Close" viewportLabel="Notifications">
|
|
306
|
+
* <ToastProvider closeLabel="Close" closeIcon={<CloseIcon />} viewportLabel="Notifications">
|
|
153
307
|
* <App />
|
|
154
308
|
* </ToastProvider>
|
|
155
309
|
*/
|
|
156
310
|
var ToastProvider = (t0) => {
|
|
157
|
-
const $ = c(
|
|
158
|
-
const { closeLabel, viewportLabel, children } = t0;
|
|
311
|
+
const $ = c(13);
|
|
312
|
+
const { closeLabel, closeIcon, viewportLabel, renderToast, children } = t0;
|
|
159
313
|
let t1;
|
|
160
314
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
161
315
|
t1 = [];
|
|
@@ -163,41 +317,52 @@ var ToastProvider = (t0) => {
|
|
|
163
317
|
} else t1 = $[0];
|
|
164
318
|
useEffect(flushBufferedToasts, t1);
|
|
165
319
|
let t2;
|
|
166
|
-
if ($[1] !== closeLabel) {
|
|
167
|
-
t2 = /* @__PURE__ */ jsx(
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
320
|
+
if ($[1] !== closeIcon || $[2] !== closeLabel || $[3] !== renderToast) {
|
|
321
|
+
t2 = renderToast ?? ((toast) => /* @__PURE__ */ jsx(DefaultToast, {
|
|
322
|
+
toast,
|
|
323
|
+
closeLabel,
|
|
324
|
+
closeIcon
|
|
325
|
+
}));
|
|
326
|
+
$[1] = closeIcon;
|
|
327
|
+
$[2] = closeLabel;
|
|
328
|
+
$[3] = renderToast;
|
|
329
|
+
$[4] = t2;
|
|
330
|
+
} else t2 = $[4];
|
|
171
331
|
let t3;
|
|
172
|
-
if ($[
|
|
173
|
-
t3 = /* @__PURE__ */ jsx(
|
|
332
|
+
if ($[5] !== t2) {
|
|
333
|
+
t3 = /* @__PURE__ */ jsx(ToastList, { renderToast: t2 });
|
|
334
|
+
$[5] = t2;
|
|
335
|
+
$[6] = t3;
|
|
336
|
+
} else t3 = $[6];
|
|
337
|
+
let t4;
|
|
338
|
+
if ($[7] !== t3 || $[8] !== viewportLabel) {
|
|
339
|
+
t4 = /* @__PURE__ */ jsx(Toast.Portal, { children: /* @__PURE__ */ jsx(Toast.Viewport, {
|
|
174
340
|
className: toast_provider_module_default.viewport,
|
|
175
341
|
"aria-label": viewportLabel,
|
|
176
|
-
children:
|
|
342
|
+
children: t3
|
|
177
343
|
}) });
|
|
178
|
-
$[
|
|
179
|
-
$[
|
|
180
|
-
$[
|
|
181
|
-
} else
|
|
182
|
-
let
|
|
183
|
-
if ($[
|
|
184
|
-
|
|
344
|
+
$[7] = t3;
|
|
345
|
+
$[8] = viewportLabel;
|
|
346
|
+
$[9] = t4;
|
|
347
|
+
} else t4 = $[9];
|
|
348
|
+
let t5;
|
|
349
|
+
if ($[10] !== children || $[11] !== t4) {
|
|
350
|
+
t5 = /* @__PURE__ */ jsxs(Toast.Provider, {
|
|
185
351
|
toastManager,
|
|
186
|
-
children: [children,
|
|
352
|
+
children: [children, t4]
|
|
187
353
|
});
|
|
188
|
-
$[
|
|
189
|
-
$[
|
|
190
|
-
$[
|
|
191
|
-
} else
|
|
192
|
-
return
|
|
354
|
+
$[10] = children;
|
|
355
|
+
$[11] = t4;
|
|
356
|
+
$[12] = t5;
|
|
357
|
+
} else t5 = $[12];
|
|
358
|
+
return t5;
|
|
193
359
|
};
|
|
194
360
|
function _temp(action) {
|
|
195
361
|
return /* @__PURE__ */ jsx(Button, {
|
|
196
|
-
className: toast_provider_module_default.action,
|
|
197
362
|
size: "sm",
|
|
198
363
|
variant: action.variant ?? "secondary",
|
|
199
364
|
onClick: action.onClick,
|
|
200
365
|
children: action.label
|
|
201
366
|
}, action.label);
|
|
202
367
|
}
|
|
203
|
-
export { ToastProvider };
|
|
368
|
+
export { Toast$1 as Toast, ToastProvider };
|
|
@@ -1,24 +1,18 @@
|
|
|
1
1
|
import './toast-provider.css';// src/components/toast/toast-provider.module.scss
|
|
2
|
-
var viewport = "
|
|
3
|
-
var toast = "
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var actions = "_actions_r09x9_79";
|
|
10
|
-
var closeButton = "_closeButton_r09x9_84";
|
|
11
|
-
var action = "_action_r09x9_79";
|
|
2
|
+
var viewport = "_viewport_x67qw_3";
|
|
3
|
+
var toast = "_toast_x67qw_19";
|
|
4
|
+
var icon = "_icon_x67qw_59";
|
|
5
|
+
var title = "_title_x67qw_71";
|
|
6
|
+
var close = "_close_x67qw_76";
|
|
7
|
+
var description = "_description_x67qw_81";
|
|
8
|
+
var actions = "_actions_x67qw_86";
|
|
12
9
|
var toast_provider_module_default = {
|
|
13
10
|
viewport,
|
|
14
11
|
toast,
|
|
15
|
-
|
|
16
|
-
header,
|
|
17
|
-
headingMain,
|
|
12
|
+
icon,
|
|
18
13
|
title,
|
|
14
|
+
close,
|
|
19
15
|
description,
|
|
20
|
-
actions
|
|
21
|
-
closeButton,
|
|
22
|
-
action
|
|
16
|
+
actions
|
|
23
17
|
};
|
|
24
|
-
export {
|
|
18
|
+
export { actions, close, toast_provider_module_default as default, description, icon, title, toast, viewport };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ToastManager } from "@base-ui/react/toast";
|
|
2
2
|
import type { ReactNode } from "react";
|
|
3
3
|
import type { Tone } from "../../lib/tone.ts";
|
|
4
|
-
/** A toast's status role; drives its colour
|
|
4
|
+
/** A toast's status role; drives its colour. */
|
|
5
5
|
export type ToastTone = Exclude<Tone, "neutral">;
|
|
6
6
|
/** An action button rendered inside a toast, such as Retry on a failed send. */
|
|
7
7
|
export type ToastAction = Readonly<{
|
|
@@ -15,6 +15,8 @@ export type ToastAction = Readonly<{
|
|
|
15
15
|
/** The data every kit toast carries. */
|
|
16
16
|
export type ToastData = Readonly<{
|
|
17
17
|
tone: ToastTone;
|
|
18
|
+
/** A glyph before the title, such as one for the tone. */
|
|
19
|
+
icon?: ReactNode;
|
|
18
20
|
/** Heading above the body, where one line will not carry the news. */
|
|
19
21
|
title?: ReactNode;
|
|
20
22
|
body: ReactNode;
|
|
@@ -32,6 +34,8 @@ export type ToastOptions = Readonly<{
|
|
|
32
34
|
* copy short enough to read at a glance.
|
|
33
35
|
*/
|
|
34
36
|
title?: ReactNode;
|
|
37
|
+
/** A glyph before the title, such as one for the tone. Left out, none shows. */
|
|
38
|
+
icon?: ReactNode;
|
|
35
39
|
/** Action buttons rendered in the toast. */
|
|
36
40
|
actions?: ReadonlyArray<ToastAction>;
|
|
37
41
|
/**
|
|
@@ -19,7 +19,7 @@ var flushBufferedToasts = () => {
|
|
|
19
19
|
for (const add of buffered.splice(0)) add();
|
|
20
20
|
};
|
|
21
21
|
var push = (tone, body, options = {}) => {
|
|
22
|
-
const { key, title, actions, timeout } = options;
|
|
22
|
+
const { key, title, icon, actions, timeout } = options;
|
|
23
23
|
if (key !== void 0) {
|
|
24
24
|
const existing = activeKeys.get(key);
|
|
25
25
|
if (existing !== void 0) return existing;
|
|
@@ -33,6 +33,7 @@ var push = (tone, body, options = {}) => {
|
|
|
33
33
|
timeout: resolvedTimeout,
|
|
34
34
|
data: {
|
|
35
35
|
tone,
|
|
36
|
+
icon,
|
|
36
37
|
title,
|
|
37
38
|
body,
|
|
38
39
|
actions
|
|
@@ -5,8 +5,8 @@ import { FieldsetLegend, FieldsetRoot } from "../fieldset/fieldset-root.js";
|
|
|
5
5
|
import { useFormDisabled } from "../form/form-context.js";
|
|
6
6
|
import toggle_group_module_default from "./toggle-group.module.js";
|
|
7
7
|
import { c } from "react/compiler-runtime";
|
|
8
|
-
import { jsx } from "react/jsx-runtime";
|
|
9
8
|
import { clsx } from "clsx";
|
|
9
|
+
import { jsx } from "react/jsx-runtime";
|
|
10
10
|
import { Toggle } from "@base-ui/react/toggle";
|
|
11
11
|
import { ToggleGroup } from "@base-ui/react/toggle-group";
|
|
12
12
|
// src/components/toggle-group-field/toggle-group.tsx
|
|
@@ -5,8 +5,11 @@ export type TooltipTriggerProps = BaseTooltip.Trigger.Props & Readonly<{
|
|
|
5
5
|
/** Called once a pointer rests on the trigger or it takes focus, to warm what the hint shows. */
|
|
6
6
|
onIntent?: () => void;
|
|
7
7
|
}>;
|
|
8
|
+
/** The element the hint describes, warming what it shows on intent. */
|
|
8
9
|
declare const TooltipTrigger: ({ onIntent, onPointerEnter, onPointerLeave, onFocus, ...props }: TooltipTriggerProps) => ReactNode;
|
|
10
|
+
/** Places the hint against its trigger. */
|
|
9
11
|
declare const TooltipPositioner: ({ sideOffset, ...props }: BaseTooltip.Positioner.Props) => ReactNode;
|
|
12
|
+
/** The hint's surface. */
|
|
10
13
|
declare const TooltipPopup: ({ className, ...props }: BaseTooltip.Popup.Props) => ReactNode;
|
|
11
14
|
export type TooltipProps = Readonly<{
|
|
12
15
|
/** The tooltip content; also serves as the visual hint for the trigger. */
|
|
@@ -30,12 +33,9 @@ type TooltipParts = typeof TooltipRoot & Omit<typeof BaseTooltip, "Trigger" | "P
|
|
|
30
33
|
Popup: typeof TooltipPopup;
|
|
31
34
|
}>;
|
|
32
35
|
/**
|
|
33
|
-
* A hint on
|
|
34
|
-
* once near the app root
|
|
35
|
-
*
|
|
36
|
-
* it, which stay reachable for a controlled `open`, an `align`, a
|
|
37
|
-
* `collisionPadding`, or a `Handle` shared by a group of triggers. There is no
|
|
38
|
-
* `Arrow`: a tooltip is an unarrowed popup with its own `box-shadow`.
|
|
36
|
+
* A hint on the trigger given as `children`, wired to describe it. Mount
|
|
37
|
+
* `Tooltip.Provider` once near the app root; the parts hanging off it build a
|
|
38
|
+
* tooltip by hand.
|
|
39
39
|
*
|
|
40
40
|
* @example
|
|
41
41
|
* <Tooltip content="Previous page">
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { useIntent } from "../../lib/use-intent.js";
|
|
2
2
|
import tooltip_module_default from "./tooltip.module.js";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
4
|
import { clsx } from "clsx";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { mergeProps } from "@base-ui/react/merge-props";
|
|
7
7
|
import { Tooltip } from "@base-ui/react/tooltip";
|
|
8
8
|
// src/components/tooltip/tooltip.tsx
|
|
9
9
|
var DEFAULT_SIDE_OFFSET = 8;
|
|
10
|
+
/** The element the hint describes, warming what it shows on intent. */
|
|
10
11
|
var TooltipTrigger = (t0) => {
|
|
11
12
|
const $ = c(14);
|
|
12
13
|
let onFocus;
|
|
@@ -55,6 +56,7 @@ var TooltipTrigger = (t0) => {
|
|
|
55
56
|
} else t2 = $[13];
|
|
56
57
|
return t2;
|
|
57
58
|
};
|
|
59
|
+
/** Places the hint against its trigger. */
|
|
58
60
|
var TooltipPositioner = (t0) => {
|
|
59
61
|
const $ = c(6);
|
|
60
62
|
let props;
|
|
@@ -81,6 +83,7 @@ var TooltipPositioner = (t0) => {
|
|
|
81
83
|
} else t2 = $[5];
|
|
82
84
|
return t2;
|
|
83
85
|
};
|
|
86
|
+
/** The hint's surface. */
|
|
84
87
|
var TooltipPopup = (t0) => {
|
|
85
88
|
const $ = c(8);
|
|
86
89
|
let className;
|
|
@@ -154,12 +157,9 @@ var TooltipRoot = (t0) => {
|
|
|
154
157
|
return t5;
|
|
155
158
|
};
|
|
156
159
|
/**
|
|
157
|
-
* A hint on
|
|
158
|
-
* once near the app root
|
|
159
|
-
*
|
|
160
|
-
* it, which stay reachable for a controlled `open`, an `align`, a
|
|
161
|
-
* `collisionPadding`, or a `Handle` shared by a group of triggers. There is no
|
|
162
|
-
* `Arrow`: a tooltip is an unarrowed popup with its own `box-shadow`.
|
|
160
|
+
* A hint on the trigger given as `children`, wired to describe it. Mount
|
|
161
|
+
* `Tooltip.Provider` once near the app root; the parts hanging off it build a
|
|
162
|
+
* tooltip by hand.
|
|
163
163
|
*
|
|
164
164
|
* @example
|
|
165
165
|
* <Tooltip content="Previous page">
|