@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,4 +1,19 @@
|
|
|
1
1
|
import './spinner.css';// src/components/spinner/spinner.module.scss
|
|
2
|
-
var spinner = "
|
|
3
|
-
var
|
|
4
|
-
|
|
2
|
+
var spinner = "_spinner_1ojim_27";
|
|
3
|
+
var ring = "_ring_1ojim_31";
|
|
4
|
+
var arc = "_arc_1ojim_34";
|
|
5
|
+
var loadingPulse = "_loading-pulse_1ojim_1";
|
|
6
|
+
var spinnerTurn = "_spinner-turn_1ojim_1";
|
|
7
|
+
var spinnerSweep = "_spinner-sweep_1ojim_1";
|
|
8
|
+
var spinner_module_default = {
|
|
9
|
+
spinner,
|
|
10
|
+
ring,
|
|
11
|
+
arc,
|
|
12
|
+
"loading-pulse": "_loading-pulse_1ojim_1",
|
|
13
|
+
loadingPulse,
|
|
14
|
+
"spinner-turn": "_spinner-turn_1ojim_1",
|
|
15
|
+
spinnerTurn,
|
|
16
|
+
"spinner-sweep": "_spinner-sweep_1ojim_1",
|
|
17
|
+
spinnerSweep
|
|
18
|
+
};
|
|
19
|
+
export { arc, spinner_module_default as default, loadingPulse, ring, spinner, spinnerSweep, spinnerTurn };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
2
|
+
import { type ComponentProps, type ReactElement, type ReactNode } from "react";
|
|
3
|
+
export type StaleRootProps = useRender.ComponentProps<"div"> & Readonly<{
|
|
3
4
|
/** Whether a background refresh is in flight. */
|
|
4
5
|
busy: boolean;
|
|
5
6
|
/** Ms of `busy` before anything is shown at all. @default 150 */
|
|
@@ -13,35 +14,30 @@ export type StaleRootProps = Readonly<{
|
|
|
13
14
|
slowAfter?: number;
|
|
14
15
|
/** Ms of `busy` before the retry appears. @default 8000 */
|
|
15
16
|
stuckAfter?: number;
|
|
16
|
-
children?: ReactNode;
|
|
17
|
-
className?: string;
|
|
18
17
|
}>;
|
|
19
|
-
export type StaleContentProps =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}>;
|
|
23
|
-
export type StaleOverlayProps = Readonly<{
|
|
24
|
-
children?: ReactNode;
|
|
25
|
-
className?: string;
|
|
26
|
-
}>;
|
|
27
|
-
export type StaleMessageProps = Readonly<{
|
|
18
|
+
export type StaleContentProps = useRender.ComponentProps<"div">;
|
|
19
|
+
export type StaleOverlayProps = useRender.ComponentProps<"div">;
|
|
20
|
+
export type StaleMessageProps = useRender.ComponentProps<"p"> & Readonly<{
|
|
28
21
|
/** The moving indicator above the copy, such as the app's animated logo. @default <Spinner size={2} /> */
|
|
29
22
|
illustration?: ReactNode;
|
|
30
23
|
/** What the overlay says, such as "This is taking longer than usual." */
|
|
31
24
|
children: ReactNode;
|
|
32
|
-
className?: string;
|
|
33
25
|
}>;
|
|
34
|
-
export type StaleRetryProps = Readonly<{
|
|
26
|
+
export type StaleRetryProps = Omit<ComponentProps<"button">, "ref" | "children" | "onClick"> & Readonly<{
|
|
35
27
|
onRetry: () => void;
|
|
36
28
|
/** The retry's label, such as "Try again". */
|
|
37
29
|
children: ReactNode;
|
|
38
|
-
className?: string;
|
|
39
30
|
}>;
|
|
40
|
-
|
|
41
|
-
declare const
|
|
42
|
-
|
|
43
|
-
declare const
|
|
44
|
-
|
|
31
|
+
/** The region that refreshes, holding how long the refresh has run in its `data-phase`. */
|
|
32
|
+
declare const Root: ({ busy, busyAfter, busyMinDuration, slowAfter, stuckAfter, render, className, ref, ...props }: StaleRootProps) => ReactNode;
|
|
33
|
+
/** The content that stays on screen: dimmed and busy once the refresh is seen, inert once overlaid. */
|
|
34
|
+
declare const Content: ({ render, className, ref, ...props }: StaleContentProps) => ReactElement;
|
|
35
|
+
/** What covers the content once the refresh is slow, fading in and out. */
|
|
36
|
+
declare const Overlay: ({ render, className, ref, ...props }: StaleOverlayProps) => ReactElement | null;
|
|
37
|
+
/** The overlay's status: a moving indicator over its copy. */
|
|
38
|
+
declare const Message: ({ illustration, render, className, ref, children, ...props }: StaleMessageProps) => ReactElement;
|
|
39
|
+
/** The way out once the refresh looks stuck: a button that appears only then. */
|
|
40
|
+
declare const Retry: ({ onRetry, children, className, ...props }: StaleRetryProps) => ReactNode;
|
|
45
41
|
type StaleNamespace = Readonly<{
|
|
46
42
|
Root: typeof Root;
|
|
47
43
|
Content: typeof Content;
|
|
@@ -5,20 +5,53 @@ import { Button } from "../button/button.js";
|
|
|
5
5
|
import { Spinner } from "../spinner/spinner.js";
|
|
6
6
|
import stale_module_default from "./stale.module.js";
|
|
7
7
|
import { c } from "react/compiler-runtime";
|
|
8
|
-
import {
|
|
9
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
10
9
|
import { clsx } from "clsx";
|
|
10
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
import { createContext, useRef } from "react";
|
|
11
12
|
// src/components/stale/stale.tsx
|
|
12
13
|
var StaleContext = createContext(null);
|
|
13
14
|
var usePhase = () => {
|
|
14
15
|
return useRequiredContext(StaleContext, "Stale.* must be rendered inside <Stale.Root>.");
|
|
15
16
|
};
|
|
16
17
|
var isOverlaid = (phase) => phase === "slow" || phase === "stuck";
|
|
18
|
+
/** The region that refreshes, holding how long the refresh has run in its `data-phase`. */
|
|
17
19
|
var Root = (t0) => {
|
|
18
|
-
const $ = c(
|
|
19
|
-
|
|
20
|
+
const $ = c(29);
|
|
21
|
+
let busy;
|
|
22
|
+
let busyAfter;
|
|
23
|
+
let busyMinDuration;
|
|
24
|
+
let className;
|
|
25
|
+
let props;
|
|
26
|
+
let ref;
|
|
27
|
+
let render;
|
|
28
|
+
let slowAfter;
|
|
29
|
+
let stuckAfter;
|
|
30
|
+
if ($[0] !== t0) {
|
|
31
|
+
({busy, busyAfter, busyMinDuration, slowAfter, stuckAfter, render, className, ref, ...props} = t0);
|
|
32
|
+
$[0] = t0;
|
|
33
|
+
$[1] = busy;
|
|
34
|
+
$[2] = busyAfter;
|
|
35
|
+
$[3] = busyMinDuration;
|
|
36
|
+
$[4] = className;
|
|
37
|
+
$[5] = props;
|
|
38
|
+
$[6] = ref;
|
|
39
|
+
$[7] = render;
|
|
40
|
+
$[8] = slowAfter;
|
|
41
|
+
$[9] = stuckAfter;
|
|
42
|
+
} else {
|
|
43
|
+
busy = $[1];
|
|
44
|
+
busyAfter = $[2];
|
|
45
|
+
busyMinDuration = $[3];
|
|
46
|
+
className = $[4];
|
|
47
|
+
props = $[5];
|
|
48
|
+
ref = $[6];
|
|
49
|
+
render = $[7];
|
|
50
|
+
slowAfter = $[8];
|
|
51
|
+
stuckAfter = $[9];
|
|
52
|
+
}
|
|
20
53
|
let t1;
|
|
21
|
-
if ($[
|
|
54
|
+
if ($[10] !== busy || $[11] !== busyAfter || $[12] !== busyMinDuration || $[13] !== slowAfter || $[14] !== stuckAfter) {
|
|
22
55
|
t1 = {
|
|
23
56
|
busy,
|
|
24
57
|
busyAfter,
|
|
@@ -26,184 +59,329 @@ var Root = (t0) => {
|
|
|
26
59
|
slowAfter,
|
|
27
60
|
stuckAfter
|
|
28
61
|
};
|
|
29
|
-
$[
|
|
30
|
-
$[
|
|
31
|
-
$[
|
|
32
|
-
$[
|
|
33
|
-
$[
|
|
34
|
-
$[
|
|
35
|
-
} else t1 = $[
|
|
62
|
+
$[10] = busy;
|
|
63
|
+
$[11] = busyAfter;
|
|
64
|
+
$[12] = busyMinDuration;
|
|
65
|
+
$[13] = slowAfter;
|
|
66
|
+
$[14] = stuckAfter;
|
|
67
|
+
$[15] = t1;
|
|
68
|
+
} else t1 = $[15];
|
|
36
69
|
const phase = useBusyPhase(t1);
|
|
37
70
|
let t2;
|
|
38
|
-
if ($[
|
|
71
|
+
if ($[16] !== className) {
|
|
39
72
|
t2 = clsx(stale_module_default.root, className);
|
|
40
|
-
$[
|
|
41
|
-
$[
|
|
42
|
-
} else t2 = $[
|
|
73
|
+
$[16] = className;
|
|
74
|
+
$[17] = t2;
|
|
75
|
+
} else t2 = $[17];
|
|
43
76
|
let t3;
|
|
44
|
-
if ($[
|
|
45
|
-
t3 =
|
|
46
|
-
|
|
77
|
+
if ($[18] !== phase || $[19] !== props || $[20] !== t2) {
|
|
78
|
+
t3 = {
|
|
79
|
+
...props,
|
|
47
80
|
"data-phase": phase,
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
$[
|
|
51
|
-
$[
|
|
52
|
-
$[
|
|
53
|
-
$[
|
|
54
|
-
} else t3 = $[
|
|
81
|
+
className: t2
|
|
82
|
+
};
|
|
83
|
+
$[18] = phase;
|
|
84
|
+
$[19] = props;
|
|
85
|
+
$[20] = t2;
|
|
86
|
+
$[21] = t3;
|
|
87
|
+
} else t3 = $[21];
|
|
55
88
|
let t4;
|
|
56
|
-
if ($[
|
|
57
|
-
t4 =
|
|
89
|
+
if ($[22] !== ref || $[23] !== render || $[24] !== t3) {
|
|
90
|
+
t4 = {
|
|
91
|
+
defaultTagName: "div",
|
|
92
|
+
render,
|
|
93
|
+
ref,
|
|
94
|
+
props: t3
|
|
95
|
+
};
|
|
96
|
+
$[22] = ref;
|
|
97
|
+
$[23] = render;
|
|
98
|
+
$[24] = t3;
|
|
99
|
+
$[25] = t4;
|
|
100
|
+
} else t4 = $[25];
|
|
101
|
+
const element = useRender(t4);
|
|
102
|
+
let t5;
|
|
103
|
+
if ($[26] !== element || $[27] !== phase) {
|
|
104
|
+
t5 = /* @__PURE__ */ jsx(StaleContext, {
|
|
58
105
|
value: phase,
|
|
59
|
-
children:
|
|
106
|
+
children: element
|
|
60
107
|
});
|
|
61
|
-
$[
|
|
62
|
-
$[
|
|
63
|
-
$[
|
|
64
|
-
} else
|
|
65
|
-
return
|
|
108
|
+
$[26] = element;
|
|
109
|
+
$[27] = phase;
|
|
110
|
+
$[28] = t5;
|
|
111
|
+
} else t5 = $[28];
|
|
112
|
+
return t5;
|
|
66
113
|
};
|
|
114
|
+
/** The content that stays on screen: dimmed and busy once the refresh is seen, inert once overlaid. */
|
|
67
115
|
var Content = (t0) => {
|
|
68
|
-
const $ = c(
|
|
69
|
-
|
|
116
|
+
const $ = c(19);
|
|
117
|
+
let className;
|
|
118
|
+
let props;
|
|
119
|
+
let ref;
|
|
120
|
+
let render;
|
|
121
|
+
if ($[0] !== t0) {
|
|
122
|
+
({render, className, ref, ...props} = t0);
|
|
123
|
+
$[0] = t0;
|
|
124
|
+
$[1] = className;
|
|
125
|
+
$[2] = props;
|
|
126
|
+
$[3] = ref;
|
|
127
|
+
$[4] = render;
|
|
128
|
+
} else {
|
|
129
|
+
className = $[1];
|
|
130
|
+
props = $[2];
|
|
131
|
+
ref = $[3];
|
|
132
|
+
render = $[4];
|
|
133
|
+
}
|
|
70
134
|
const phase = usePhase();
|
|
71
135
|
const busy = phase !== "fresh";
|
|
72
|
-
|
|
73
|
-
if ($[0] !== className) {
|
|
74
|
-
t1 = clsx(stale_module_default.content, className);
|
|
75
|
-
$[0] = className;
|
|
76
|
-
$[1] = t1;
|
|
77
|
-
} else t1 = $[1];
|
|
136
|
+
const t1 = busy || void 0;
|
|
78
137
|
const t2 = busy || void 0;
|
|
79
|
-
|
|
138
|
+
let t3;
|
|
139
|
+
if ($[5] !== phase) {
|
|
140
|
+
t3 = isOverlaid(phase);
|
|
141
|
+
$[5] = phase;
|
|
142
|
+
$[6] = t3;
|
|
143
|
+
} else t3 = $[6];
|
|
80
144
|
let t4;
|
|
81
|
-
if ($[
|
|
82
|
-
t4 =
|
|
83
|
-
$[
|
|
84
|
-
$[3] = t4;
|
|
85
|
-
} else t4 = $[3];
|
|
86
|
-
let t5;
|
|
87
|
-
if ($[4] !== children || $[5] !== t1 || $[6] !== t2 || $[7] !== t3 || $[8] !== t4) {
|
|
88
|
-
t5 = /* @__PURE__ */ jsx("div", {
|
|
89
|
-
className: t1,
|
|
90
|
-
"data-busy": t2,
|
|
91
|
-
"aria-busy": t3,
|
|
92
|
-
inert: t4,
|
|
93
|
-
children
|
|
94
|
-
});
|
|
95
|
-
$[4] = children;
|
|
96
|
-
$[5] = t1;
|
|
97
|
-
$[6] = t2;
|
|
98
|
-
$[7] = t3;
|
|
145
|
+
if ($[7] !== className) {
|
|
146
|
+
t4 = clsx(stale_module_default.content, className);
|
|
147
|
+
$[7] = className;
|
|
99
148
|
$[8] = t4;
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
149
|
+
} else t4 = $[8];
|
|
150
|
+
let t5;
|
|
151
|
+
if ($[9] !== props || $[10] !== t1 || $[11] !== t2 || $[12] !== t3 || $[13] !== t4) {
|
|
152
|
+
t5 = {
|
|
153
|
+
...props,
|
|
154
|
+
"data-busy": t1,
|
|
155
|
+
"aria-busy": t2,
|
|
156
|
+
inert: t3,
|
|
157
|
+
className: t4
|
|
158
|
+
};
|
|
159
|
+
$[9] = props;
|
|
160
|
+
$[10] = t1;
|
|
161
|
+
$[11] = t2;
|
|
162
|
+
$[12] = t3;
|
|
163
|
+
$[13] = t4;
|
|
164
|
+
$[14] = t5;
|
|
165
|
+
} else t5 = $[14];
|
|
166
|
+
let t6;
|
|
167
|
+
if ($[15] !== ref || $[16] !== render || $[17] !== t5) {
|
|
168
|
+
t6 = {
|
|
169
|
+
defaultTagName: "div",
|
|
170
|
+
render,
|
|
171
|
+
ref,
|
|
172
|
+
props: t5
|
|
173
|
+
};
|
|
174
|
+
$[15] = ref;
|
|
175
|
+
$[16] = render;
|
|
176
|
+
$[17] = t5;
|
|
177
|
+
$[18] = t6;
|
|
178
|
+
} else t6 = $[18];
|
|
179
|
+
return useRender(t6);
|
|
103
180
|
};
|
|
181
|
+
/** What covers the content once the refresh is slow, fading in and out. */
|
|
104
182
|
var Overlay = (t0) => {
|
|
105
|
-
const $ = c(
|
|
106
|
-
|
|
183
|
+
const $ = c(20);
|
|
184
|
+
let className;
|
|
185
|
+
let props;
|
|
186
|
+
let ref;
|
|
187
|
+
let render;
|
|
188
|
+
if ($[0] !== t0) {
|
|
189
|
+
({render, className, ref, ...props} = t0);
|
|
190
|
+
$[0] = t0;
|
|
191
|
+
$[1] = className;
|
|
192
|
+
$[2] = props;
|
|
193
|
+
$[3] = ref;
|
|
194
|
+
$[4] = render;
|
|
195
|
+
} else {
|
|
196
|
+
className = $[1];
|
|
197
|
+
props = $[2];
|
|
198
|
+
ref = $[3];
|
|
199
|
+
render = $[4];
|
|
200
|
+
}
|
|
107
201
|
const phase = usePhase();
|
|
108
202
|
const overlayRef = useRef(null);
|
|
109
203
|
let t1;
|
|
110
|
-
if ($[
|
|
204
|
+
if ($[5] !== phase) {
|
|
111
205
|
t1 = isOverlaid(phase);
|
|
112
|
-
$[
|
|
113
|
-
$[
|
|
114
|
-
} else t1 = $[
|
|
206
|
+
$[5] = phase;
|
|
207
|
+
$[6] = t1;
|
|
208
|
+
} else t1 = $[6];
|
|
115
209
|
const presence = usePresence(t1, overlayRef);
|
|
116
|
-
if (!presence.mounted) return null;
|
|
117
210
|
let t2;
|
|
118
|
-
if ($[
|
|
119
|
-
t2 =
|
|
120
|
-
$[
|
|
121
|
-
$[
|
|
122
|
-
} else t2 = $[
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
211
|
+
if ($[7] !== ref) {
|
|
212
|
+
t2 = ref === void 0 ? overlayRef : [overlayRef, ref];
|
|
213
|
+
$[7] = ref;
|
|
214
|
+
$[8] = t2;
|
|
215
|
+
} else t2 = $[8];
|
|
216
|
+
const t3 = presence.mounted;
|
|
217
|
+
const t4 = presence.props;
|
|
218
|
+
let t5;
|
|
219
|
+
if ($[9] !== className) {
|
|
220
|
+
t5 = clsx(stale_module_default.overlay, className);
|
|
221
|
+
$[9] = className;
|
|
222
|
+
$[10] = t5;
|
|
223
|
+
} else t5 = $[10];
|
|
224
|
+
let t6;
|
|
225
|
+
if ($[11] !== presence.props || $[12] !== props || $[13] !== t5) {
|
|
226
|
+
t6 = {
|
|
227
|
+
...props,
|
|
228
|
+
...t4,
|
|
229
|
+
className: t5
|
|
230
|
+
};
|
|
231
|
+
$[11] = presence.props;
|
|
232
|
+
$[12] = props;
|
|
233
|
+
$[13] = t5;
|
|
234
|
+
$[14] = t6;
|
|
235
|
+
} else t6 = $[14];
|
|
236
|
+
let t7;
|
|
237
|
+
if ($[15] !== presence.mounted || $[16] !== render || $[17] !== t2 || $[18] !== t6) {
|
|
238
|
+
t7 = {
|
|
239
|
+
defaultTagName: "div",
|
|
240
|
+
render,
|
|
241
|
+
ref: t2,
|
|
242
|
+
enabled: t3,
|
|
243
|
+
props: t6
|
|
244
|
+
};
|
|
245
|
+
$[15] = presence.mounted;
|
|
246
|
+
$[16] = render;
|
|
247
|
+
$[17] = t2;
|
|
248
|
+
$[18] = t6;
|
|
249
|
+
$[19] = t7;
|
|
250
|
+
} else t7 = $[19];
|
|
251
|
+
return useRender(t7);
|
|
137
252
|
};
|
|
253
|
+
/** The overlay's status: a moving indicator over its copy. */
|
|
138
254
|
var Message = (t0) => {
|
|
139
|
-
const $ = c(
|
|
140
|
-
|
|
255
|
+
const $ = c(24);
|
|
256
|
+
let children;
|
|
257
|
+
let className;
|
|
258
|
+
let illustration;
|
|
259
|
+
let props;
|
|
260
|
+
let ref;
|
|
261
|
+
let render;
|
|
262
|
+
if ($[0] !== t0) {
|
|
263
|
+
({illustration, render, className, ref, children, ...props} = t0);
|
|
264
|
+
$[0] = t0;
|
|
265
|
+
$[1] = children;
|
|
266
|
+
$[2] = className;
|
|
267
|
+
$[3] = illustration;
|
|
268
|
+
$[4] = props;
|
|
269
|
+
$[5] = ref;
|
|
270
|
+
$[6] = render;
|
|
271
|
+
} else {
|
|
272
|
+
children = $[1];
|
|
273
|
+
className = $[2];
|
|
274
|
+
illustration = $[3];
|
|
275
|
+
props = $[4];
|
|
276
|
+
ref = $[5];
|
|
277
|
+
render = $[6];
|
|
278
|
+
}
|
|
141
279
|
let t1;
|
|
142
|
-
if ($[
|
|
280
|
+
if ($[7] !== className) {
|
|
143
281
|
t1 = clsx(stale_module_default.message, className);
|
|
144
|
-
$[
|
|
145
|
-
$[
|
|
146
|
-
} else t1 = $[
|
|
282
|
+
$[7] = className;
|
|
283
|
+
$[8] = t1;
|
|
284
|
+
} else t1 = $[8];
|
|
147
285
|
let t2;
|
|
148
|
-
if ($[
|
|
286
|
+
if ($[9] !== illustration) {
|
|
149
287
|
t2 = illustration ?? /* @__PURE__ */ jsx(Spinner, { size: 2 });
|
|
150
|
-
$[
|
|
151
|
-
$[
|
|
152
|
-
} else t2 = $[
|
|
288
|
+
$[9] = illustration;
|
|
289
|
+
$[10] = t2;
|
|
290
|
+
} else t2 = $[10];
|
|
153
291
|
let t3;
|
|
154
|
-
if ($[
|
|
292
|
+
if ($[11] !== t2) {
|
|
155
293
|
t3 = /* @__PURE__ */ jsx("span", {
|
|
156
294
|
className: stale_module_default.illustration,
|
|
157
295
|
"aria-hidden": "true",
|
|
158
296
|
children: t2
|
|
159
297
|
});
|
|
160
|
-
$[
|
|
161
|
-
$[
|
|
162
|
-
} else t3 = $[
|
|
298
|
+
$[11] = t2;
|
|
299
|
+
$[12] = t3;
|
|
300
|
+
} else t3 = $[12];
|
|
163
301
|
let t4;
|
|
164
|
-
if ($[
|
|
165
|
-
t4 = /* @__PURE__ */ jsxs(
|
|
166
|
-
|
|
302
|
+
if ($[13] !== children || $[14] !== t3) {
|
|
303
|
+
t4 = /* @__PURE__ */ jsxs(Fragment, { children: [t3, children] });
|
|
304
|
+
$[13] = children;
|
|
305
|
+
$[14] = t3;
|
|
306
|
+
$[15] = t4;
|
|
307
|
+
} else t4 = $[15];
|
|
308
|
+
let t5;
|
|
309
|
+
if ($[16] !== props || $[17] !== t1 || $[18] !== t4) {
|
|
310
|
+
t5 = {
|
|
167
311
|
role: "status",
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
$[
|
|
173
|
-
$[
|
|
174
|
-
|
|
175
|
-
|
|
312
|
+
...props,
|
|
313
|
+
className: t1,
|
|
314
|
+
children: t4
|
|
315
|
+
};
|
|
316
|
+
$[16] = props;
|
|
317
|
+
$[17] = t1;
|
|
318
|
+
$[18] = t4;
|
|
319
|
+
$[19] = t5;
|
|
320
|
+
} else t5 = $[19];
|
|
321
|
+
let t6;
|
|
322
|
+
if ($[20] !== ref || $[21] !== render || $[22] !== t5) {
|
|
323
|
+
t6 = {
|
|
324
|
+
defaultTagName: "p",
|
|
325
|
+
render,
|
|
326
|
+
ref,
|
|
327
|
+
props: t5
|
|
328
|
+
};
|
|
329
|
+
$[20] = ref;
|
|
330
|
+
$[21] = render;
|
|
331
|
+
$[22] = t5;
|
|
332
|
+
$[23] = t6;
|
|
333
|
+
} else t6 = $[23];
|
|
334
|
+
return useRender(t6);
|
|
176
335
|
};
|
|
336
|
+
/** The way out once the refresh looks stuck: a button that appears only then. */
|
|
177
337
|
var Retry = (t0) => {
|
|
178
|
-
const $ = c(
|
|
179
|
-
|
|
338
|
+
const $ = c(13);
|
|
339
|
+
let children;
|
|
340
|
+
let className;
|
|
341
|
+
let onRetry;
|
|
342
|
+
let props;
|
|
343
|
+
if ($[0] !== t0) {
|
|
344
|
+
({onRetry, children, className, ...props} = t0);
|
|
345
|
+
$[0] = t0;
|
|
346
|
+
$[1] = children;
|
|
347
|
+
$[2] = className;
|
|
348
|
+
$[3] = onRetry;
|
|
349
|
+
$[4] = props;
|
|
350
|
+
} else {
|
|
351
|
+
children = $[1];
|
|
352
|
+
className = $[2];
|
|
353
|
+
onRetry = $[3];
|
|
354
|
+
props = $[4];
|
|
355
|
+
}
|
|
180
356
|
const phase = usePhase();
|
|
181
357
|
const retryRef = useRef(null);
|
|
182
358
|
const presence = usePresence(phase === "stuck", retryRef);
|
|
183
359
|
if (!presence.mounted) return null;
|
|
184
360
|
let t1;
|
|
185
|
-
if ($[
|
|
361
|
+
if ($[5] !== className) {
|
|
186
362
|
t1 = clsx(stale_module_default.retry, className);
|
|
187
|
-
$[
|
|
188
|
-
$[
|
|
189
|
-
} else t1 = $[
|
|
363
|
+
$[5] = className;
|
|
364
|
+
$[6] = t1;
|
|
365
|
+
} else t1 = $[6];
|
|
190
366
|
let t2;
|
|
191
|
-
if ($[
|
|
367
|
+
if ($[7] !== children || $[8] !== onRetry || $[9] !== presence.props || $[10] !== props || $[11] !== t1) {
|
|
192
368
|
t2 = /* @__PURE__ */ jsx(Button, {
|
|
193
|
-
ref: retryRef,
|
|
194
369
|
variant: "tertiary",
|
|
195
370
|
size: "sm",
|
|
371
|
+
...props,
|
|
372
|
+
ref: retryRef,
|
|
196
373
|
onClick: onRetry,
|
|
197
374
|
className: t1,
|
|
198
375
|
...presence.props,
|
|
199
376
|
children
|
|
200
377
|
});
|
|
201
|
-
$[
|
|
202
|
-
$[
|
|
203
|
-
$[
|
|
204
|
-
$[
|
|
205
|
-
$[
|
|
206
|
-
|
|
378
|
+
$[7] = children;
|
|
379
|
+
$[8] = onRetry;
|
|
380
|
+
$[9] = presence.props;
|
|
381
|
+
$[10] = props;
|
|
382
|
+
$[11] = t1;
|
|
383
|
+
$[12] = t2;
|
|
384
|
+
} else t2 = $[12];
|
|
207
385
|
return t2;
|
|
208
386
|
};
|
|
209
387
|
/**
|