wimui 0.72.0 → 0.74.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/WimProvider.d.ts +5 -0
- package/dist/components/_internal/FeedbackCloseButton.cjs +1 -1
- package/dist/components/_internal/FeedbackCloseButton.d.ts +2 -1
- package/dist/components/_internal/FeedbackCloseButton.js +27 -15
- package/dist/components/_internal/OverlayBase.cjs +1 -1
- package/dist/components/_internal/OverlayBase.js +34 -38
- package/dist/components/_internal/bodyScrollLock.cjs +2 -0
- package/dist/components/_internal/bodyScrollLock.d.ts +11 -0
- package/dist/components/_internal/bodyScrollLock.js +29 -0
- package/dist/components/_internal/choice-label.module.cjs +1 -1
- package/dist/components/_internal/choice-label.module.js +1 -1
- package/dist/components/_internal/focusHandoff.cjs +2 -0
- package/dist/components/_internal/focusHandoff.d.ts +9 -0
- package/dist/components/_internal/focusHandoff.js +20 -0
- package/dist/components/_internal/useAnnounce.d.ts +18 -1
- package/dist/components/_internal/weekStart.cjs +2 -0
- package/dist/components/_internal/weekStart.d.ts +6 -0
- package/dist/components/_internal/weekStart.js +18 -0
- package/dist/components/ai/AIResponseFeedback/airesponse-feedback.module.cjs +1 -1
- package/dist/components/ai/AIResponseFeedback/airesponse-feedback.module.js +1 -1
- package/dist/components/ai/AgentStatus/agent-status.module.cjs +1 -1
- package/dist/components/ai/AgentStatus/agent-status.module.js +3 -3
- package/dist/components/ai/CodeDiffViewer/code-diff-viewer.module.cjs +1 -1
- package/dist/components/ai/CodeDiffViewer/code-diff-viewer.module.js +2 -2
- package/dist/components/ai/StreamingText/streaming-text.module.cjs +1 -1
- package/dist/components/ai/StreamingText/streaming-text.module.js +1 -1
- package/dist/components/ai/ThoughtProcess/thought-process.module.cjs +1 -1
- package/dist/components/ai/ThoughtProcess/thought-process.module.js +4 -4
- package/dist/components/ai/ThreadList/ThreadList.cjs +1 -1
- package/dist/components/ai/ThreadList/ThreadList.js +80 -72
- package/dist/components/ai/ThreadList/thread-list.module.cjs +1 -1
- package/dist/components/ai/ThreadList/thread-list.module.js +8 -8
- package/dist/components/ai/UsageMeter/usage-meter.module.cjs +1 -1
- package/dist/components/ai/UsageMeter/usage-meter.module.js +1 -1
- package/dist/components/charts/GanttChart/GanttChart.cjs +1 -1
- package/dist/components/charts/GanttChart/GanttChart.js +1 -2
- package/dist/components/charts/GanttChart/gantt-chart.module.cjs +1 -1
- package/dist/components/charts/GanttChart/gantt-chart.module.js +1 -1
- package/dist/components/data-display/AvatarGroup/AvatarGroup.cjs +1 -1
- package/dist/components/data-display/AvatarGroup/AvatarGroup.js +5 -5
- package/dist/components/data-display/Calendar/Calendar.cjs +1 -1
- package/dist/components/data-display/Calendar/Calendar.d.ts +1 -1
- package/dist/components/data-display/Calendar/Calendar.js +261 -142
- package/dist/components/data-display/Calendar/RangeCalendar.d.ts +2 -1
- package/dist/components/data-display/Calendar/calendar.module.cjs +1 -1
- package/dist/components/data-display/Calendar/calendar.module.js +16 -13
- package/dist/components/data-display/Calendar/useCalendar.d.ts +5 -1
- package/dist/components/data-display/CalendarHeatmap/calendar-heatmap.module.cjs +1 -1
- package/dist/components/data-display/CalendarHeatmap/calendar-heatmap.module.js +1 -1
- package/dist/components/data-display/Carousel/carousel.module.cjs +1 -1
- package/dist/components/data-display/Carousel/carousel.module.js +1 -1
- package/dist/components/data-display/InfiniteScroll/InfiniteScroll.cjs +1 -1
- package/dist/components/data-display/InfiniteScroll/InfiniteScroll.js +4 -4
- package/dist/components/data-display/JsonViewer/JsonViewer.cjs +1 -1
- package/dist/components/data-display/JsonViewer/JsonViewer.js +5 -1
- package/dist/components/data-display/Kanban/Kanban.cjs +1 -1
- package/dist/components/data-display/Kanban/Kanban.d.ts +4 -1
- package/dist/components/data-display/Kanban/Kanban.js +142 -97
- package/dist/components/data-display/Kanban/kanban.module.cjs +1 -1
- package/dist/components/data-display/Kanban/kanban.module.js +7 -6
- package/dist/components/data-display/Reaction/reaction.module.cjs +1 -1
- package/dist/components/data-display/Reaction/reaction.module.js +1 -1
- package/dist/components/data-display/SwipeAction/SwipeAction.cjs +1 -1
- package/dist/components/data-display/SwipeAction/SwipeAction.js +75 -74
- package/dist/components/data-display/Table/useTableSort.d.ts +9 -3
- package/dist/components/data-display/Timeline/timeline.module.cjs +1 -1
- package/dist/components/data-display/Timeline/timeline.module.js +1 -1
- package/dist/components/data-display/TreeDiagram/tree-diagram.module.cjs +1 -1
- package/dist/components/data-display/TreeDiagram/tree-diagram.module.js +9 -9
- package/dist/components/data-display/TreeView/tree-view.module.cjs +1 -1
- package/dist/components/data-display/TreeView/tree-view.module.js +9 -9
- package/dist/components/feedback/Alert/Alert.d.ts +1 -1
- package/dist/components/feedback/Banner/Banner.d.ts +1 -1
- package/dist/components/feedback/Indicator/indicator.module.cjs +1 -1
- package/dist/components/feedback/Indicator/indicator.module.js +6 -6
- package/dist/components/feedback/Loader/loader.module.cjs +1 -1
- package/dist/components/feedback/Loader/loader.module.js +4 -4
- package/dist/components/feedback/Notification/Notification.d.ts +14 -1
- package/dist/components/feedback/Progress/progress.module.cjs +1 -1
- package/dist/components/feedback/Progress/progress.module.js +2 -2
- package/dist/components/feedback/Snackbar/Snackbar.d.ts +14 -0
- package/dist/components/feedback/Toast/Toast.cjs +1 -1
- package/dist/components/feedback/Toast/Toast.d.ts +14 -1
- package/dist/components/feedback/Toast/Toast.js +42 -27
- package/dist/components/form/ColorPicker/ColorPicker.cjs +1 -1
- package/dist/components/form/ColorPicker/ColorPicker.d.ts +38 -1
- package/dist/components/form/ColorPicker/ColorPicker.js +75 -15
- package/dist/components/form/ColorPicker/color-picker.module.cjs +1 -1
- package/dist/components/form/ColorPicker/color-picker.module.js +8 -2
- package/dist/components/form/CopyButton/CopyButton.cjs +1 -1
- package/dist/components/form/CopyButton/CopyButton.js +1 -1
- package/dist/components/form/InputBase/InputBase.cjs +1 -1
- package/dist/components/form/InputBase/InputBase.js +3 -1
- package/dist/components/form/NumberInput/NumberInput.cjs +1 -1
- package/dist/components/form/NumberInput/NumberInput.d.ts +1 -1
- package/dist/components/form/NumberInput/NumberInput.js +18 -16
- package/dist/components/form/QueryBuilder/QueryBuilder.cjs +1 -1
- package/dist/components/form/QueryBuilder/QueryBuilder.js +8 -7
- package/dist/components/form/Radio/radio.module.cjs +1 -1
- package/dist/components/form/Radio/radio.module.js +1 -1
- package/dist/components/form/RangeSlider/range-slider.module.cjs +1 -1
- package/dist/components/form/RangeSlider/range-slider.module.js +1 -1
- package/dist/components/form/SegmentedControl/segmented-control.module.cjs +1 -1
- package/dist/components/form/SegmentedControl/segmented-control.module.js +1 -1
- package/dist/components/form/Slider/slider.module.cjs +1 -1
- package/dist/components/form/Slider/slider.module.js +1 -1
- package/dist/components/form/Switch/switch.module.cjs +1 -1
- package/dist/components/form/Switch/switch.module.js +1 -1
- package/dist/components/form/ThemeToggle/theme-toggle.module.cjs +1 -1
- package/dist/components/form/ThemeToggle/theme-toggle.module.js +1 -1
- package/dist/components/form/ToggleGroup/toggle-group.module.cjs +1 -1
- package/dist/components/form/ToggleGroup/toggle-group.module.js +1 -1
- package/dist/components/layout/Dashboard/Dashboard.cjs +1 -1
- package/dist/components/layout/Dashboard/Dashboard.js +70 -68
- package/dist/components/media/ImageCompare/image-compare.module.cjs +1 -1
- package/dist/components/media/ImageCompare/image-compare.module.js +6 -6
- package/dist/components/media/Lightbox/Lightbox.cjs +1 -1
- package/dist/components/media/Lightbox/Lightbox.d.ts +0 -13
- package/dist/components/media/Lightbox/Lightbox.js +1 -1
- package/dist/components/navigation/Anchor/anchor.module.cjs +1 -1
- package/dist/components/navigation/Anchor/anchor.module.js +1 -1
- package/dist/components/navigation/HamburgerMenu/hamburger-menu.module.cjs +1 -1
- package/dist/components/navigation/HamburgerMenu/hamburger-menu.module.js +1 -1
- package/dist/components/navigation/Pagination/pagination.module.cjs +1 -1
- package/dist/components/navigation/Pagination/pagination.module.js +6 -6
- package/dist/components/navigation/TabNavigation/tab-navigation.module.cjs +1 -1
- package/dist/components/navigation/TabNavigation/tab-navigation.module.js +1 -1
- package/dist/components/navigation/Tabs/tabs.module.cjs +1 -1
- package/dist/components/navigation/Tabs/tabs.module.js +1 -1
- package/dist/components/overlay/BottomSheet/bottom-sheet.module.cjs +1 -1
- package/dist/components/overlay/BottomSheet/bottom-sheet.module.js +1 -1
- package/dist/components/overlay/Dialog/Dialog.cjs +1 -1
- package/dist/components/overlay/Dialog/Dialog.d.ts +0 -9
- package/dist/components/overlay/Dialog/Dialog.js +1 -1
- package/dist/components/overlay/Drawer/Drawer.cjs +1 -1
- package/dist/components/overlay/Drawer/Drawer.d.ts +0 -10
- package/dist/components/overlay/Drawer/Drawer.js +1 -1
- package/dist/components/overlay/Tooltip/Tooltip.cjs +1 -1
- package/dist/components/overlay/Tooltip/Tooltip.js +99 -65
- package/dist/hooks/useAutoResize.d.ts +8 -2
- package/dist/i18n/generated/data-display.cjs +1 -1
- package/dist/i18n/generated/data-display.d.ts +1 -1
- package/dist/i18n/generated/data-display.js +36 -3
- package/dist/i18n/generated/form.cjs +1 -1
- package/dist/i18n/generated/form.d.ts +1 -1
- package/dist/i18n/generated/form.js +6 -3
- package/dist/i18n/instance.cjs +1 -1
- package/dist/i18n/instance.d.ts +6 -0
- package/dist/i18n/instance.js +21 -18
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +232 -231
- package/dist/llms/Alert.md +1 -1
- package/dist/llms/Banner.md +1 -1
- package/dist/llms/Calendar.md +2 -2
- package/dist/llms/ColorPicker.md +3 -1
- package/dist/llms/Kanban.md +2 -2
- package/dist/llms/Notification.md +1 -1
- package/dist/llms/NumberInput.md +1 -1
- package/dist/llms/RangeCalendar.md +1 -1
- package/dist/llms/Switch.md +1 -1
- package/dist/llms/Toast.md +1 -1
- package/dist/llms-full.txt +111 -9
- package/dist/llms.txt +17 -1
- package/dist/locales/en/data-display.json +12 -1
- package/dist/locales/en/form.json +3 -0
- package/dist/locales/ja/data-display.json +12 -1
- package/dist/locales/ja/form.json +3 -0
- package/dist/locales/pt/data-display.json +12 -1
- package/dist/locales/pt/form.json +3 -0
- package/dist/media.cjs +1 -1
- package/dist/media.js +4 -4
- package/dist/overlay.cjs +1 -1
- package/dist/overlay.js +11 -11
- package/dist/styles.css +1 -1
- package/dist/wimui.umd.css +1 -1
- package/dist/wimui.umd.js +5 -5
- package/package.json +10 -7
|
@@ -1,112 +1,113 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Root as e } from "../../../node_modules/@radix-ui/react-slot/dist/index.js";
|
|
3
3
|
import { composeEventHandlers as t } from "../../_internal/composeEventHandlers.js";
|
|
4
|
-
import {
|
|
5
|
-
import r from "
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import d from "
|
|
9
|
-
import
|
|
4
|
+
import { useFocusHandoff as n } from "../../_internal/focusHandoff.js";
|
|
5
|
+
import { Icon as r } from "../../media/Icon/Icon.js";
|
|
6
|
+
import i from "./swipe-action.module.js";
|
|
7
|
+
import { useSwipeableList as a } from "./SwipeableList.js";
|
|
8
|
+
import o, { useEffect as s, useId as c, useImperativeHandle as l, useRef as u, useState as d } from "react";
|
|
9
|
+
import f from "classnames";
|
|
10
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
10
11
|
//#region src/components/data-display/SwipeAction/SwipeAction.tsx
|
|
11
|
-
var
|
|
12
|
-
let
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
var h = o.forwardRef(({ as: o = "div", leftActions: h = [], rightActions: g = [], children: _, asChild: v = !1, id: y, closeOnAction: b = !0, fullSwipe: x, className: S, ...C }, w) => {
|
|
13
|
+
let T = c(), E = y || T, D = a(), [O, k] = d(0), [A, j] = d(!1), M = u(0), N = u(0), P = u(null);
|
|
14
|
+
n(P), l(w, () => ({ close: () => {
|
|
15
|
+
k(0), D?.reportClose(E);
|
|
15
16
|
} }));
|
|
16
|
-
let
|
|
17
|
-
|
|
18
|
-
if (
|
|
17
|
+
let F = u(!1);
|
|
18
|
+
s(() => {
|
|
19
|
+
if (A) F.current = !0;
|
|
19
20
|
else {
|
|
20
|
-
if (
|
|
21
|
+
if (F.current) {
|
|
21
22
|
let e = setTimeout(() => {
|
|
22
|
-
|
|
23
|
+
F.current = !1;
|
|
23
24
|
}, 100);
|
|
24
25
|
return () => clearTimeout(e);
|
|
25
26
|
}
|
|
26
|
-
|
|
27
|
+
D?.openedId && D.openedId !== E && k(0);
|
|
27
28
|
}
|
|
28
29
|
}, [
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
D?.openedId,
|
|
31
|
+
E,
|
|
32
|
+
A
|
|
32
33
|
]);
|
|
33
|
-
let
|
|
34
|
-
|
|
35
|
-
},
|
|
36
|
-
if (!
|
|
37
|
-
let t = ("touches" in e ? e.touches[0].clientX : e.clientX) -
|
|
38
|
-
Math.abs(t) > 5 &&
|
|
39
|
-
},
|
|
40
|
-
if (
|
|
41
|
-
if (
|
|
42
|
-
let t =
|
|
34
|
+
let I = h.length * 80, L = g.length * 80, R = I > 0 && (x === "left" || x === "both"), z = L > 0 && (x === "right" || x === "both"), B = P.current?.offsetWidth ?? 0, V = (e) => Math.max(e + 40, B / 2), H = A && R && O >= V(I) ? "left" : A && z && -O >= V(L) ? "right" : null, U = (e) => {
|
|
35
|
+
M.current = "touches" in e ? e.touches[0].clientX : e.clientX, N.current = O, j(!0);
|
|
36
|
+
}, W = (e) => {
|
|
37
|
+
if (!A) return;
|
|
38
|
+
let t = ("touches" in e ? e.touches[0].clientX : e.clientX) - M.current, n = N.current + t;
|
|
39
|
+
Math.abs(t) > 5 && D?.openedId !== E && D?.reportOpen(E), n > I && !R && (n = I + (n - I) * .3), n < -L && !z && (n = -L + (n + L) * .3), k(n);
|
|
40
|
+
}, G = (e = !0) => {
|
|
41
|
+
if (A) {
|
|
42
|
+
if (j(!1), H) {
|
|
43
|
+
let t = H === "left" ? h[0] : g[g.length - 1];
|
|
43
44
|
if (e) {
|
|
44
|
-
|
|
45
|
+
Z(t), b || (k(H === "left" ? I : -L), D?.reportOpen(E));
|
|
45
46
|
return;
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
|
-
|
|
49
|
+
O > I / 2 ? (k(I), D?.reportOpen(E)) : O < -L / 2 ? (k(-L), D?.reportOpen(E)) : (k(0), D?.reportClose(E));
|
|
49
50
|
}
|
|
50
|
-
},
|
|
51
|
-
let t = e === "left" ?
|
|
52
|
-
|
|
53
|
-
},
|
|
51
|
+
}, K = v ? e : "div", q = u(null), J = I > 0 || L > 0, Y = (e) => {
|
|
52
|
+
let t = e === "left" ? I : -L;
|
|
53
|
+
O !== t && k(t), D?.reportOpen(E);
|
|
54
|
+
}, X = (e) => {
|
|
54
55
|
let t = e.relatedTarget;
|
|
55
|
-
t &&
|
|
56
|
-
},
|
|
57
|
-
e.onClick(),
|
|
58
|
-
},
|
|
59
|
-
let a = e === "left" ?
|
|
60
|
-
return /* @__PURE__ */
|
|
61
|
-
className:
|
|
56
|
+
t && P.current?.contains(t) || O !== 0 && !A && (k(0), D?.reportClose(E));
|
|
57
|
+
}, Z = (e, t) => {
|
|
58
|
+
e.onClick(), b && (k(0), D?.reportClose(E), t && document.activeElement === t && q.current?.focus());
|
|
59
|
+
}, Q = (e, t, n) => {
|
|
60
|
+
let a = e === "left" ? R : z, o = e === "left" ? Math.max(0, O) : Math.max(0, -O), s = e === "left" ? 0 : t.length - 1;
|
|
61
|
+
return /* @__PURE__ */ p("div", {
|
|
62
|
+
className: f(i.actions, i[e], a && o > n && i.stretched, H === e && i.armed),
|
|
62
63
|
style: {
|
|
63
|
-
width: a ? Math.max(
|
|
64
|
+
width: a ? Math.max(n, o) : n,
|
|
64
65
|
"--_action-w": "80px"
|
|
65
66
|
},
|
|
66
|
-
children: t.map((t,
|
|
67
|
-
className:
|
|
67
|
+
children: t.map((t, n) => /* @__PURE__ */ m("button", {
|
|
68
|
+
className: f(i.action, t.intent && i[t.intent], a && n === s && i.outer),
|
|
68
69
|
style: { backgroundColor: t.color },
|
|
69
|
-
onFocus: () =>
|
|
70
|
-
onClick: (e) =>
|
|
70
|
+
onFocus: () => Y(e),
|
|
71
|
+
onClick: (e) => Z(t, e.currentTarget),
|
|
71
72
|
type: "button",
|
|
72
|
-
children: [/* @__PURE__ */
|
|
73
|
+
children: [/* @__PURE__ */ p(r, {
|
|
73
74
|
name: t.icon,
|
|
74
75
|
size: "md"
|
|
75
|
-
}), /* @__PURE__ */
|
|
76
|
-
className:
|
|
76
|
+
}), /* @__PURE__ */ p("span", {
|
|
77
|
+
className: i.label,
|
|
77
78
|
children: t.label
|
|
78
79
|
})]
|
|
79
|
-
},
|
|
80
|
+
}, n))
|
|
80
81
|
});
|
|
81
82
|
};
|
|
82
|
-
return /* @__PURE__ */
|
|
83
|
-
ref:
|
|
84
|
-
className:
|
|
85
|
-
...
|
|
86
|
-
onMouseLeave: t(
|
|
87
|
-
onBlur: t(
|
|
83
|
+
return /* @__PURE__ */ m(o, {
|
|
84
|
+
ref: P,
|
|
85
|
+
className: f("wim-swipe-action", i.container, S),
|
|
86
|
+
...C,
|
|
87
|
+
onMouseLeave: t(C.onMouseLeave, () => G(!1)),
|
|
88
|
+
onBlur: t(C.onBlur, X),
|
|
88
89
|
children: [
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
ref:
|
|
91
|
-
className:
|
|
92
|
-
tabIndex:
|
|
90
|
+
/* @__PURE__ */ p(K, {
|
|
91
|
+
ref: q,
|
|
92
|
+
className: i.content,
|
|
93
|
+
tabIndex: J ? -1 : void 0,
|
|
93
94
|
style: {
|
|
94
|
-
transform: `translateX(${
|
|
95
|
-
transition:
|
|
95
|
+
transform: `translateX(${O}px)`,
|
|
96
|
+
transition: A ? "none" : "transform 0.4s cubic-bezier(0.16, 1, 0.3, 1)"
|
|
96
97
|
},
|
|
97
|
-
onTouchStart:
|
|
98
|
-
onTouchMove:
|
|
99
|
-
onTouchEnd: () =>
|
|
100
|
-
onMouseDown:
|
|
101
|
-
onMouseMove:
|
|
102
|
-
onMouseUp: () =>
|
|
103
|
-
children:
|
|
98
|
+
onTouchStart: U,
|
|
99
|
+
onTouchMove: W,
|
|
100
|
+
onTouchEnd: () => G(),
|
|
101
|
+
onMouseDown: U,
|
|
102
|
+
onMouseMove: W,
|
|
103
|
+
onMouseUp: () => G(),
|
|
104
|
+
children: _
|
|
104
105
|
}),
|
|
105
|
-
|
|
106
|
-
|
|
106
|
+
I > 0 && Q("left", h, I),
|
|
107
|
+
L > 0 && Q("right", g, L)
|
|
107
108
|
]
|
|
108
109
|
});
|
|
109
110
|
});
|
|
110
|
-
|
|
111
|
+
h.displayName = "SwipeAction";
|
|
111
112
|
//#endregion
|
|
112
|
-
export {
|
|
113
|
+
export { h as SwipeAction };
|
|
@@ -18,9 +18,15 @@ export interface UseTableSortReturn<T> {
|
|
|
18
18
|
getSortDirection: (key: keyof T) => SortDirection;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* Sort rows on the client for `Table`: clicking the same column cycles ascending → descending → unsorted.
|
|
22
|
+
* For server-side sorting, keep the state yourself and pass `onSortChange`.
|
|
23
|
+
*
|
|
22
24
|
* @param data - The data array to sort
|
|
23
|
-
* @param options -
|
|
24
|
-
* @returns
|
|
25
|
+
* @param options - `initialSort` and `onSortChange`
|
|
26
|
+
* @returns `sortedData`, `sortConfig`, `handleSort(key)` and `getSortDirection(key)`
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* const { sortedData, handleSort, getSortDirection } = useTableSort(rows);
|
|
30
|
+
* // <Table.Head sortable sortDirection={getSortDirection("name")} onSort={() => handleSort("name")}>
|
|
25
31
|
*/
|
|
26
32
|
export declare function useTableSort<T extends Record<string, unknown>>(data: T[], options?: UseTableSortOptions<T>): UseTableSortReturn<T>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_root_fqd4f_3`,t=`_left_fqd4f_11`,n=`_right_fqd4f_14`,r=`_alternate_fqd4f_17`,i=`_item_fqd4f_20`,a=`_connector_fqd4f_33`,o=`_content_fqd4f_45`,s=`_oppositeContent_fqd4f_48`,c=`_separator_fqd4f_60`,l=`_point_fqd4f_79`,u=`_primary_fqd4f_96`,d=`_success_fqd4f_99`,f=`_warning_fqd4f_102`,p=`_danger_fqd4f_105`,m=`_info_fqd4f_108`,h=`_neutral_fqd4f_111`,g=`_icon_fqd4f_119`,_=`_secondary_fqd4f_139`,v={root:e,left:t,right:n,alternate:r,item:i,connector:a,content:o,oppositeContent:s,separator:c,point:l,primary:u,success:d,warning:f,danger:p,info:m,neutral:h,icon:g,secondary:_};exports.alternate=r,exports.connector=a,exports.content=o,exports.danger=p,exports.default=v,exports.icon=g,exports.info=m,exports.item=i,exports.left=t,exports.neutral=h,exports.oppositeContent=s,exports.point=l,exports.primary=u,exports.right=n,exports.root=e,exports.secondary=_,exports.separator=c,exports.success=d,exports.warning=f;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
//#region src/components/data-display/Timeline/timeline.module.scss
|
|
3
|
-
var e = "
|
|
3
|
+
var e = "_root_fqd4f_3", t = "_left_fqd4f_11", n = "_right_fqd4f_14", r = "_alternate_fqd4f_17", i = "_item_fqd4f_20", a = "_connector_fqd4f_33", o = "_content_fqd4f_45", s = "_oppositeContent_fqd4f_48", c = "_separator_fqd4f_60", l = "_point_fqd4f_79", u = "_primary_fqd4f_96", d = "_success_fqd4f_99", f = "_warning_fqd4f_102", p = "_danger_fqd4f_105", m = "_info_fqd4f_108", h = "_neutral_fqd4f_111", g = "_icon_fqd4f_119", _ = "_secondary_fqd4f_139", v = {
|
|
4
4
|
root: e,
|
|
5
5
|
left: t,
|
|
6
6
|
right: n,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_root_1j22e_4`,t=`_canvas_1j22e_10`,n=`_edges_1j22e_14`,r=`_node_1j22e_25`,i=`_selectable_1j22e_42`,a=`_selected_1j22e_51`,o=`_description_1j22e_64`,s=`_toggle_1j22e_67`,c=`_content_1j22e_93`,l=`_custom_1j22e_94`,u=`_avatar_1j22e_101`,d=`_text_1j22e_105`,f=`_label_1j22e_111`,p=`_vertical_1j22e_150`,m=`_horizontal_1j22e_155`,h={root:e,canvas:t,edges:n,node:r,selectable:i,selected:a,description:o,toggle:s,content:c,custom:l,avatar:u,text:d,label:f,vertical:p,horizontal:m};exports.avatar=u,exports.canvas=t,exports.content=c,exports.custom=l,exports.default=h,exports.description=o,exports.edges=n,exports.horizontal=m,exports.label=f,exports.node=r,exports.root=e,exports.selectable=i,exports.selected=a,exports.text=d,exports.toggle=s,exports.vertical=p;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
//#region src/components/data-display/TreeDiagram/tree-diagram.module.scss
|
|
3
|
-
var e = "
|
|
3
|
+
var e = "_root_1j22e_4", t = "_canvas_1j22e_10", n = "_edges_1j22e_14", r = "_node_1j22e_25", i = "_selectable_1j22e_42", a = "_selected_1j22e_51", o = "_description_1j22e_64", s = "_toggle_1j22e_67", c = "_content_1j22e_93", l = "_custom_1j22e_94", u = "_avatar_1j22e_101", d = "_text_1j22e_105", f = "_label_1j22e_111", p = "_vertical_1j22e_150", m = "_horizontal_1j22e_155", h = {
|
|
4
4
|
root: e,
|
|
5
5
|
canvas: t,
|
|
6
6
|
edges: n,
|
|
7
7
|
node: r,
|
|
8
8
|
selectable: i,
|
|
9
9
|
selected: a,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
description: o,
|
|
11
|
+
toggle: s,
|
|
12
|
+
content: c,
|
|
13
|
+
custom: l,
|
|
14
|
+
avatar: u,
|
|
15
|
+
text: d,
|
|
16
|
+
label: f,
|
|
17
17
|
vertical: p,
|
|
18
18
|
horizontal: m
|
|
19
19
|
};
|
|
20
20
|
//#endregion
|
|
21
|
-
export {
|
|
21
|
+
export { u as avatar, t as canvas, c as content, l as custom, h as default, o as description, n as edges, m as horizontal, f as label, r as node, e as root, i as selectable, a as selected, d as text, s as toggle, p as vertical };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_root_jhsq5_23`,t=`_dataDriven_jhsq5_40`,n=`_item_jhsq5_35`,r=`_enter_jhsq5_1`,i=`_search_jhsq5_43`,a=`_searchInput_jhsq5_46`,o=`_selected_jhsq5_101`,s=`_labelContainer_jhsq5_35`,c=`_expandBtn_jhsq5_111`,l=`_icon_jhsq5_112`,u=`_checkbox_jhsq5_120`,d=`_disabled_jhsq5_135`,f=`_iconWrapper_jhsq5_188`,p=`_expanded_jhsq5_237`,m=`_spacer_jhsq5_243`,h=`_label_jhsq5_35`,g=`_children_jhsq5_272`,_=`_childrenInner_jhsq5_281`,v={root:e,dataDriven:t,item:n,enter:r,search:i,searchInput:a,selected:o,labelContainer:s,expandBtn:c,icon:l,checkbox:u,disabled:d,iconWrapper:f,expanded:p,spacer:m,label:h,children:g,childrenInner:_};exports.checkbox=u,exports.children=g,exports.childrenInner=_,exports.dataDriven=t,exports.default=v,exports.disabled=d,exports.enter=r,exports.expandBtn=c,exports.expanded=p,exports.icon=l,exports.iconWrapper=f,exports.item=n,exports.label=h,exports.labelContainer=s,exports.root=e,exports.search=i,exports.searchInput=a,exports.selected=o,exports.spacer=m;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
//#region src/components/data-display/TreeView/tree-view.module.scss
|
|
3
|
-
var e = "
|
|
3
|
+
var e = "_root_jhsq5_23", t = "_dataDriven_jhsq5_40", n = "_item_jhsq5_35", r = "_enter_jhsq5_1", i = "_search_jhsq5_43", a = "_searchInput_jhsq5_46", o = "_selected_jhsq5_101", s = "_labelContainer_jhsq5_35", c = "_expandBtn_jhsq5_111", l = "_icon_jhsq5_112", u = "_checkbox_jhsq5_120", d = "_disabled_jhsq5_135", f = "_iconWrapper_jhsq5_188", p = "_expanded_jhsq5_237", m = "_spacer_jhsq5_243", h = "_label_jhsq5_35", g = "_children_jhsq5_272", _ = "_childrenInner_jhsq5_281", v = {
|
|
4
4
|
root: e,
|
|
5
5
|
dataDriven: t,
|
|
6
6
|
item: n,
|
|
@@ -9,16 +9,16 @@ var e = "_root_tc35p_23", t = "_dataDriven_tc35p_40", n = "_item_tc35p_35", r =
|
|
|
9
9
|
searchInput: a,
|
|
10
10
|
selected: o,
|
|
11
11
|
labelContainer: s,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
expandBtn: c,
|
|
13
|
+
icon: l,
|
|
14
|
+
checkbox: u,
|
|
15
|
+
disabled: d,
|
|
16
|
+
iconWrapper: f,
|
|
17
|
+
expanded: p,
|
|
18
|
+
spacer: m,
|
|
19
19
|
label: h,
|
|
20
20
|
children: g,
|
|
21
21
|
childrenInner: _
|
|
22
22
|
};
|
|
23
23
|
//#endregion
|
|
24
|
-
export {
|
|
24
|
+
export { u as checkbox, g as children, _ as childrenInner, t as dataDriven, v as default, d as disabled, r as enter, c as expandBtn, p as expanded, l as icon, f as iconWrapper, n as item, h as label, s as labelContainer, e as root, i as search, a as searchInput, o as selected, m as spacer };
|
|
@@ -31,7 +31,7 @@ type AlertProps = React.ComponentPropsWithoutRef<"div"> & {
|
|
|
31
31
|
*/
|
|
32
32
|
icon?: React.ReactNode;
|
|
33
33
|
/**
|
|
34
|
-
* Called when the close button is clicked. Providing it shows the close button.
|
|
34
|
+
* Called when the close button is clicked. Providing it shows the close button. When the close button disappears while it has focus, focus moves to the focusable element just before the component. To send it somewhere else, move focus inside this callback.
|
|
35
35
|
*/
|
|
36
36
|
onClose?: () => void;
|
|
37
37
|
/**
|
|
@@ -24,7 +24,7 @@ type BannerProps = {
|
|
|
24
24
|
*/
|
|
25
25
|
extra?: React.ReactNode;
|
|
26
26
|
/**
|
|
27
|
-
* Called when the close button is clicked. Providing it shows the close button.
|
|
27
|
+
* Called when the close button is clicked. Providing it shows the close button. When the close button disappears while it has focus, focus moves to the focusable element just before the component. To send it somewhere else, move focus inside this callback.
|
|
28
28
|
*/
|
|
29
29
|
onClose?: () => void;
|
|
30
30
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_root_l2e4e_3`,t=`_inlineRoot_l2e4e_9`,n=`_dot_l2e4e_12`,r=`_sm_l2e4e_29`,i=`_md_l2e4e_33`,a=`_lg_l2e4e_37`,o=`_primary_l2e4e_41`,s=`_success_l2e4e_44`,c=`_danger_l2e4e_47`,l=`_warning_l2e4e_50`,u=`_neutral_l2e4e_53`,d=`_pulse_l2e4e_86`,f={root:e,inlineRoot:t,dot:n,sm:r,md:i,lg:a,primary:o,success:s,danger:c,warning:l,neutral:u,"top-right":`_top-right_l2e4e_66`,"top-left":`_top-left_l2e4e_71`,"bottom-right":`_bottom-right_l2e4e_76`,"bottom-left":`_bottom-left_l2e4e_81`,pulse:d,"wim-indicator-pulse":`_wim-indicator-pulse_l2e4e_1`};exports.danger=c,exports.default=f,exports.dot=n,exports.inlineRoot=t,exports.lg=a,exports.md=i,exports.neutral=u,exports.primary=o,exports.pulse=d,exports.root=e,exports.sm=r,exports.success=s,exports.warning=l;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
//#region src/components/feedback/Indicator/indicator.module.scss
|
|
3
|
-
var e = "
|
|
3
|
+
var e = "_root_l2e4e_3", t = "_inlineRoot_l2e4e_9", n = "_dot_l2e4e_12", r = "_sm_l2e4e_29", i = "_md_l2e4e_33", a = "_lg_l2e4e_37", o = "_primary_l2e4e_41", s = "_success_l2e4e_44", c = "_danger_l2e4e_47", l = "_warning_l2e4e_50", u = "_neutral_l2e4e_53", d = "_pulse_l2e4e_86", f = {
|
|
4
4
|
root: e,
|
|
5
5
|
inlineRoot: t,
|
|
6
6
|
dot: n,
|
|
@@ -12,12 +12,12 @@ var e = "_root_12ex5_3", t = "_inlineRoot_12ex5_9", n = "_dot_12ex5_12", r = "_s
|
|
|
12
12
|
danger: c,
|
|
13
13
|
warning: l,
|
|
14
14
|
neutral: u,
|
|
15
|
-
"top-right": "_top-
|
|
16
|
-
"top-left": "_top-
|
|
17
|
-
"bottom-right": "_bottom-
|
|
18
|
-
"bottom-left": "_bottom-
|
|
15
|
+
"top-right": "_top-right_l2e4e_66",
|
|
16
|
+
"top-left": "_top-left_l2e4e_71",
|
|
17
|
+
"bottom-right": "_bottom-right_l2e4e_76",
|
|
18
|
+
"bottom-left": "_bottom-left_l2e4e_81",
|
|
19
19
|
pulse: d,
|
|
20
|
-
"wim-indicator-pulse": "_wim-indicator-
|
|
20
|
+
"wim-indicator-pulse": "_wim-indicator-pulse_l2e4e_1"
|
|
21
21
|
};
|
|
22
22
|
//#endregion
|
|
23
23
|
export { c as danger, f as default, n as dot, t as inlineRoot, a as lg, i as md, u as neutral, o as primary, d as pulse, e as root, r as sm, s as success, l as warning };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_root_zwrnf_3`,t=`_primary_zwrnf_9`,n=`_secondary_zwrnf_12`,r=`_success_zwrnf_15`,i=`_warning_zwrnf_18`,a=`_danger_zwrnf_21`,o=`_neutral_zwrnf_24`,s=`_currentColor_zwrnf_27`,c=`_bars_zwrnf_30`,l=`_item_zwrnf_33`,u=`_sm_zwrnf_46`,d=`_md_zwrnf_53`,f=`_lg_zwrnf_60`,p=`_xl_zwrnf_67`,m=`_dots_zwrnf_74`,h=`_pulse_zwrnf_118`,g={root:e,primary:t,secondary:n,success:r,warning:i,danger:a,neutral:o,currentColor:s,bars:c,item:l,"wim-loader-bars":`_wim-loader-bars_zwrnf_1`,sm:u,md:d,lg:f,xl:p,dots:m,"wim-loader-dots":`_wim-loader-dots_zwrnf_1`,pulse:h,"wim-loader-pulse":`_wim-loader-pulse_zwrnf_1`};exports.bars=c,exports.currentColor=s,exports.danger=a,exports.default=g,exports.dots=m,exports.item=l,exports.lg=f,exports.md=d,exports.neutral=o,exports.primary=t,exports.pulse=h,exports.root=e,exports.secondary=n,exports.sm=u,exports.success=r,exports.warning=i,exports.xl=p;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
//#region src/components/feedback/Loader/loader.module.scss
|
|
3
|
-
var e = "
|
|
3
|
+
var e = "_root_zwrnf_3", t = "_primary_zwrnf_9", n = "_secondary_zwrnf_12", r = "_success_zwrnf_15", i = "_warning_zwrnf_18", a = "_danger_zwrnf_21", o = "_neutral_zwrnf_24", s = "_currentColor_zwrnf_27", c = "_bars_zwrnf_30", l = "_item_zwrnf_33", u = "_sm_zwrnf_46", d = "_md_zwrnf_53", f = "_lg_zwrnf_60", p = "_xl_zwrnf_67", m = "_dots_zwrnf_74", h = "_pulse_zwrnf_118", g = {
|
|
4
4
|
root: e,
|
|
5
5
|
primary: t,
|
|
6
6
|
secondary: n,
|
|
@@ -11,15 +11,15 @@ var e = "_root_48aga_3", t = "_primary_48aga_9", n = "_secondary_48aga_12", r =
|
|
|
11
11
|
currentColor: s,
|
|
12
12
|
bars: c,
|
|
13
13
|
item: l,
|
|
14
|
-
"wim-loader-bars": "_wim-loader-
|
|
14
|
+
"wim-loader-bars": "_wim-loader-bars_zwrnf_1",
|
|
15
15
|
sm: u,
|
|
16
16
|
md: d,
|
|
17
17
|
lg: f,
|
|
18
18
|
xl: p,
|
|
19
19
|
dots: m,
|
|
20
|
-
"wim-loader-dots": "_wim-loader-
|
|
20
|
+
"wim-loader-dots": "_wim-loader-dots_zwrnf_1",
|
|
21
21
|
pulse: h,
|
|
22
|
-
"wim-loader-pulse": "_wim-loader-
|
|
22
|
+
"wim-loader-pulse": "_wim-loader-pulse_zwrnf_1"
|
|
23
23
|
};
|
|
24
24
|
//#endregion
|
|
25
25
|
export { c as bars, s as currentColor, a as danger, g as default, m as dots, l as item, f as lg, d as md, o as neutral, t as primary, h as pulse, e as root, n as secondary, u as sm, r as success, i as warning, p as xl };
|
|
@@ -24,7 +24,7 @@ export type NotificationProps = {
|
|
|
24
24
|
*/
|
|
25
25
|
intent?: FeedbackIntent;
|
|
26
26
|
/**
|
|
27
|
-
* Callback when notification is closed
|
|
27
|
+
* Callback when notification is closed. When the close button disappears while it has focus, focus moves to the focusable element just before the component. To send it somewhere else, move focus inside this callback.
|
|
28
28
|
*/
|
|
29
29
|
onClose?: (id?: string) => void;
|
|
30
30
|
/**
|
|
@@ -52,5 +52,18 @@ export declare const NotificationProvider: ({ children, placement, }: {
|
|
|
52
52
|
children: React.ReactNode;
|
|
53
53
|
placement?: NotificationPlacement;
|
|
54
54
|
}) => React.JSX.Element;
|
|
55
|
+
/**
|
|
56
|
+
* Show a notification card in a corner of the screen from anywhere under `NotificationProvider`.
|
|
57
|
+
* Notifications stack, carry a title and a body, and suit events that happened elsewhere
|
|
58
|
+
* (a finished export, a new comment) rather than the result of the user's last action.
|
|
59
|
+
*
|
|
60
|
+
* Throws when called outside `NotificationProvider`.
|
|
61
|
+
*
|
|
62
|
+
* @returns `show(notification)` — the `Notification` props without `onClose` — and `remove(id)`.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* const { show } = useNotification();
|
|
66
|
+
* show({ title: "Export finished", description: "report.csv is ready." });
|
|
67
|
+
*/
|
|
55
68
|
export declare const useNotification: () => NotificationContextType;
|
|
56
69
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_root_1ybyw_3`,t=`_header_1ybyw_9`,n=`_track_1ybyw_16`,r=`_bar_1ybyw_23`,i=`_sm_1ybyw_29`,a=`_md_1ybyw_32`,o=`_lg_1ybyw_35`,s=`_primary_1ybyw_38`,c=`_success_1ybyw_41`,l=`_warning_1ybyw_44`,u=`_danger_1ybyw_47`,d=`_neutral_1ybyw_50`,f=`_info_1ybyw_53`,p=`_indeterminate_1ybyw_56`,m={root:e,header:t,track:n,bar:r,sm:i,md:a,lg:o,primary:s,success:c,warning:l,danger:u,neutral:d,info:f,indeterminate:p,"progress-indeterminate":`_progress-indeterminate_1ybyw_1`};exports.bar=r,exports.danger=u,exports.default=m,exports.header=t,exports.indeterminate=p,exports.info=f,exports.lg=o,exports.md=a,exports.neutral=d,exports.primary=s,exports.root=e,exports.sm=i,exports.success=c,exports.track=n,exports.warning=l;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
//#region src/components/feedback/Progress/progress.module.scss
|
|
3
|
-
var e = "
|
|
3
|
+
var e = "_root_1ybyw_3", t = "_header_1ybyw_9", n = "_track_1ybyw_16", r = "_bar_1ybyw_23", i = "_sm_1ybyw_29", a = "_md_1ybyw_32", o = "_lg_1ybyw_35", s = "_primary_1ybyw_38", c = "_success_1ybyw_41", l = "_warning_1ybyw_44", u = "_danger_1ybyw_47", d = "_neutral_1ybyw_50", f = "_info_1ybyw_53", p = "_indeterminate_1ybyw_56", m = {
|
|
4
4
|
root: e,
|
|
5
5
|
header: t,
|
|
6
6
|
track: n,
|
|
@@ -15,7 +15,7 @@ var e = "_root_j69f6_2", t = "_header_j69f6_8", n = "_track_j69f6_15", r = "_bar
|
|
|
15
15
|
neutral: d,
|
|
16
16
|
info: f,
|
|
17
17
|
indeterminate: p,
|
|
18
|
-
"progress-indeterminate": "_progress-
|
|
18
|
+
"progress-indeterminate": "_progress-indeterminate_1ybyw_1"
|
|
19
19
|
};
|
|
20
20
|
//#endregion
|
|
21
21
|
export { r as bar, u as danger, m as default, t as header, p as indeterminate, f as info, o as lg, a as md, d as neutral, s as primary, e as root, i as sm, c as success, n as track, l as warning };
|
|
@@ -49,5 +49,19 @@ type SnackbarContextType = {
|
|
|
49
49
|
export declare const SnackbarProvider: ({ children, }: {
|
|
50
50
|
children: React.ReactNode;
|
|
51
51
|
}) => React.JSX.Element;
|
|
52
|
+
/**
|
|
53
|
+
* Show a single message bar at the edge of the screen from anywhere under `SnackbarProvider`.
|
|
54
|
+
* One message at a time: showing a new one replaces the current one. Use it when the message
|
|
55
|
+
* may carry one action (for example "Undo").
|
|
56
|
+
*
|
|
57
|
+
* Throws when called outside `SnackbarProvider`.
|
|
58
|
+
*
|
|
59
|
+
* @returns `showMessage(message)` — a string, or the `Snackbar` props without `open` / `onClose` —
|
|
60
|
+
* and `hideMessage()`.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* const { showMessage } = useSnackbar();
|
|
64
|
+
* showMessage("Message archived");
|
|
65
|
+
*/
|
|
52
66
|
export declare const useSnackbar: () => SnackbarContextType;
|
|
53
67
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../layout/Transition/Transition.cjs"),n=require("../../_internal/useAnnounce.cjs"),r=require("../../_internal/FeedbackIcon.cjs"),i=require("../../_internal/FeedbackCloseButton.cjs"),a=require("./toast.module.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("classnames");s=e.__toESM(s,1);let c=require("react/jsx-runtime");var l=({id:e,title:l,description:d,intent:p=`default`,duration:m=3e3,open:h=!0,onClose:g,className:_,"aria-label":v,"aria-labelledby":y})=>{let[b,x]=(0,o.useState)(!0),S=(0,o.useCallback)(()=>{x(!1),g&&g(e)},[g,e]);(0,o.useEffect)(()=>{if(h&&m>0&&b){let e=setTimeout(()=>{S()},
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../layout/Transition/Transition.cjs"),n=require("../../_internal/useAnnounce.cjs"),r=require("../../_internal/FeedbackIcon.cjs"),i=require("../../_internal/FeedbackCloseButton.cjs"),a=require("./toast.module.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("classnames");s=e.__toESM(s,1);let c=require("react/jsx-runtime");var l=({id:e,title:l,description:d,intent:p=`default`,duration:m=3e3,open:h=!0,onClose:g,className:_,"aria-label":v,"aria-labelledby":y})=>{let[b,x]=(0,o.useState)(!0),S=(0,o.useCallback)(()=>{x(!1),g&&g(e)},[g,e]),C=(0,o.useRef)(!1),w=(0,o.useRef)(!1),[T,E]=(0,o.useState)(!1),D=()=>E(C.current||w.current),O=(0,o.useRef)(m+300);(0,o.useEffect)(()=>{h&&(O.current=m+300)},[h,m]),(0,o.useEffect)(()=>{if(h&&m>0&&b&&!T){let e=Date.now(),t=setTimeout(()=>{S()},O.current);return()=>{clearTimeout(t),O.current=Math.max(0,O.current-(Date.now()-e))}}},[h,m,b,S,T]);let k=(0,o.useContext)(f),A=n.useAnnounceValue(h&&b?u(l,d):``,{initial:!0}),j=(0,c.jsxs)(t.Transition,{show:h&&b,enter:a.default.enter,enterFrom:a.default.enterFrom,enterTo:a.default.enterTo,leave:a.default.leave,leaveFrom:a.default.leaveFrom,leaveTo:a.default.leaveTo,className:(0,s.default)(`wim-toast`,a.default.root,a.default[p],_),role:v||y?`group`:void 0,"aria-label":y?void 0:v,"aria-labelledby":y,onMouseEnter:()=>{C.current=!0,D()},onMouseLeave:()=>{C.current=!1,D()},onFocus:()=>{w.current=!0,D()},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(w.current=!1,D())},children:[(p===`success`||p===`warning`||p===`danger`||p===`info`)&&(0,c.jsx)(`div`,{className:a.default.icon,children:(0,c.jsx)(r.FeedbackIcon,{intent:p,size:`sm`})}),(0,c.jsxs)(`div`,{className:a.default.content,children:[l&&(0,c.jsx)(`div`,{className:a.default.title,children:l}),d&&(0,c.jsx)(`p`,{className:a.default.description,children:d})]}),(0,c.jsx)(i.FeedbackCloseButton,{onClose:g?S:void 0,id:e,className:a.default.closeButton,size:`md`})]});return k?j:(0,c.jsxs)(`div`,{className:a.default.live,children:[A,j]})},u=(e,t)=>[e,t].filter(Boolean).join(`: `),d=(0,o.createContext)(void 0),f=(0,o.createContext)(!1),p=({children:e,position:t=`top-right`})=>{let[r,i]=(0,o.useState)([]),{announce:p,clear:m,region:h}=n.useAnnounce(),g=(0,o.useRef)(null),_=(0,o.useCallback)(e=>{let t=Math.random().toString(36).substr(2,9);i(n=>[...n,{...e,id:t}]),g.current=t,p(u(e.title,e.description))},[p]),v=(0,o.useCallback)(e=>{i(t=>t.filter(t=>t.id!==e)),g.current===e&&(g.current=null,m())},[m]);return(0,c.jsxs)(d.Provider,{value:{show:_,remove:v},children:[e,(0,c.jsxs)(`div`,{className:(0,s.default)(a.default.container,a.default[t]),children:[h,(0,c.jsx)(f.Provider,{value:!0,children:r.map(e=>(0,c.jsx)(l,{...e,onClose:()=>v(e.id)},e.id))})]})]})},m=()=>{let e=(0,o.useContext)(d);if(!e)throw Error(`useToast must be used within a ToastProvider`);return e};exports.Toast=l,exports.ToastProvider=p,exports.useToast=m;
|
|
@@ -20,7 +20,7 @@ export type ToastProps = {
|
|
|
20
20
|
*/
|
|
21
21
|
intent?: FeedbackIntent;
|
|
22
22
|
/**
|
|
23
|
-
* Time in milliseconds before the toast closes automatically. Set 0 to disable auto-close.
|
|
23
|
+
* Time in milliseconds before the toast closes automatically. The timer pauses while the pointer is over the toast or focus is inside it, and resumes from the remaining time. Set 0 to disable auto-close.
|
|
24
24
|
* @default 3000
|
|
25
25
|
*/
|
|
26
26
|
duration?: number;
|
|
@@ -61,5 +61,18 @@ export declare const ToastProvider: ({ children, position, }: {
|
|
|
61
61
|
children: React.ReactNode;
|
|
62
62
|
position?: ToastPosition;
|
|
63
63
|
}) => React.JSX.Element;
|
|
64
|
+
/**
|
|
65
|
+
* Show a short, self-dismissing message (a toast) from anywhere under `ToastProvider`.
|
|
66
|
+
* Use it for a one-off confirmation of something the user just did; for state that stays
|
|
67
|
+
* true (a limit, an outage), render an inline `Alert` instead.
|
|
68
|
+
*
|
|
69
|
+
* Throws when called outside `ToastProvider`.
|
|
70
|
+
*
|
|
71
|
+
* @returns `show(toast)` — `{ title?, description?, intent?, duration? }` — and `remove(id)`.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* const { show } = useToast();
|
|
75
|
+
* show({ title: "Saved", intent: "success" });
|
|
76
|
+
*/
|
|
64
77
|
export declare const useToast: () => ToastContextType;
|
|
65
78
|
export {};
|