asheeui 0.6.15 → 0.7.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/dist/AsheeUIProvider.js +22 -24
- package/dist/components/accordion/Accordion.js +79 -173
- package/dist/components/accordion/accordion-config.js +12 -13
- package/dist/components/accordion/accordion-styles.js +21 -24
- package/dist/components/autocomplete/Autocomplete.js +78 -136
- package/dist/components/autocomplete/autocomplete-config.js +7 -12
- package/dist/components/button/Button.d.ts +29 -1
- package/dist/components/button/Button.d.ts.map +1 -1
- package/dist/components/button/Button.js +47 -108
- package/dist/components/button/button-config.js +16 -17
- package/dist/components/button/button-styles.js +10 -11
- package/dist/components/card/Card.d.ts +36 -16
- package/dist/components/card/Card.d.ts.map +1 -1
- package/dist/components/card/Card.js +115 -205
- package/dist/components/card/card-config.js +24 -21
- package/dist/components/card/card-styles.js +19 -22
- package/dist/components/carousel/Carousel.js +123 -248
- package/dist/components/carousel/carousel-config.js +24 -25
- package/dist/components/carousel/carousel-styles.js +14 -16
- package/dist/components/chip/Chip.js +84 -191
- package/dist/components/chip/chip-config.js +13 -14
- package/dist/components/chip/chip-styles.js +22 -26
- package/dist/components/date-picker/Calendar.d.ts +3 -3
- package/dist/components/date-picker/Calendar.d.ts.map +1 -1
- package/dist/components/date-picker/Calendar.js +141 -222
- package/dist/components/date-picker/DatePicker.d.ts +5 -5
- package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
- package/dist/components/date-picker/DatePicker.js +122 -220
- package/dist/components/date-picker/TimeSpinner.js +58 -82
- package/dist/components/date-picker/date-picker-config.d.ts +4 -4
- package/dist/components/date-picker/date-picker-config.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker-config.js +10 -11
- package/dist/components/date-picker/date-picker-styles.js +44 -45
- package/dist/components/date-picker/date-picker.helpers.d.ts +4 -4
- package/dist/components/date-picker/date-picker.helpers.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker.helpers.js +74 -102
- package/dist/components/drawer/Drawer.d.ts +26 -8
- package/dist/components/drawer/Drawer.d.ts.map +1 -1
- package/dist/components/drawer/Drawer.js +54 -131
- package/dist/components/drawer/drawer-config.js +14 -15
- package/dist/components/drawer/drawer-styles.js +38 -42
- package/dist/components/field/FieldShell.js +49 -56
- package/dist/components/field/field-config.js +17 -18
- package/dist/components/field/field-styles.js +8 -8
- package/dist/components/image/Image.d.ts +7 -7
- package/dist/components/image/Image.d.ts.map +1 -1
- package/dist/components/image/Image.js +65 -132
- package/dist/components/image/image-config.js +17 -18
- package/dist/components/image/image-styles.js +14 -15
- package/dist/components/input/Input.js +65 -150
- package/dist/components/input/PasswordInput.js +30 -49
- package/dist/components/input/input-config.js +7 -7
- package/dist/components/input/input-styles.js +9 -10
- package/dist/components/keyboard/KeyboardContext.js +10 -11
- package/dist/components/keyboard/KeyboardProvider.js +100 -181
- package/dist/components/keyboard/OnScreenKeyboard.d.ts.map +1 -1
- package/dist/components/keyboard/OnScreenKeyboard.js +159 -166
- package/dist/components/keyboard/keyboard-config.js +59 -57
- package/dist/components/keyboard/keyboard-styles.js +10 -11
- package/dist/components/keyboard/use-keyboard-field.js +29 -21
- package/dist/components/link/Link.js +47 -137
- package/dist/components/link/link-config.js +14 -15
- package/dist/components/link/link-styles.js +25 -29
- package/dist/components/marquee/Marquee.js +55 -144
- package/dist/components/marquee/marquee-config.js +18 -19
- package/dist/components/marquee/marquee-styles.js +13 -15
- package/dist/components/modal/Modal.d.ts +26 -10
- package/dist/components/modal/Modal.d.ts.map +1 -1
- package/dist/components/modal/Modal.js +56 -136
- package/dist/components/modal/modal-config.js +15 -16
- package/dist/components/modal/modal-styles.js +13 -14
- package/dist/components/multi-select/MultiSelect.d.ts +18 -2
- package/dist/components/multi-select/MultiSelect.d.ts.map +1 -1
- package/dist/components/multi-select/MultiSelect.js +149 -283
- package/dist/components/multi-select/multi-select-config.d.ts +23 -18
- package/dist/components/multi-select/multi-select-config.d.ts.map +1 -1
- package/dist/components/multi-select/multi-select-config.js +18 -21
- package/dist/components/multi-select/multi-select-styles.js +17 -20
- package/dist/components/radio/Radio.js +43 -80
- package/dist/components/radio/RadioGroup.js +57 -155
- package/dist/components/radio/radio-config.js +15 -16
- package/dist/components/radio/radio-context.js +6 -6
- package/dist/components/radio/radio-styles.js +55 -60
- package/dist/components/resizable-screen/ResizableScreen.js +87 -177
- package/dist/components/resizable-screen/resizable-screen-config.js +16 -17
- package/dist/components/select/Select.d.ts +3 -2
- package/dist/components/select/Select.d.ts.map +1 -1
- package/dist/components/select/Select.js +97 -195
- package/dist/components/select/select-config.js +8 -9
- package/dist/components/select/select-styles.js +5 -5
- package/dist/components/select-menu/SelectMenu.d.ts.map +1 -1
- package/dist/components/select-menu/SelectMenu.js +102 -196
- package/dist/components/select-menu/select-menu-config.js +12 -12
- package/dist/components/select-menu/use-select-floating.d.ts +11 -1
- package/dist/components/select-menu/use-select-floating.d.ts.map +1 -1
- package/dist/components/select-menu/use-select-floating.js +41 -48
- package/dist/components/sidebar/Sidebar.d.ts +43 -22
- package/dist/components/sidebar/Sidebar.d.ts.map +1 -1
- package/dist/components/sidebar/Sidebar.js +146 -331
- package/dist/components/sidebar/sidebar-config.d.ts +98 -31
- package/dist/components/sidebar/sidebar-config.d.ts.map +1 -1
- package/dist/components/sidebar/sidebar-config.js +47 -33
- package/dist/components/sidebar/sidebar-styles.js +27 -32
- package/dist/components/spinner/spinner-config.js +12 -13
- package/dist/components/spinner/spinner-styles.js +13 -14
- package/dist/components/spinner/spinner.js +39 -82
- package/dist/components/switch/Switch.js +62 -154
- package/dist/components/switch/switch-config.js +11 -12
- package/dist/components/switch/switch-styles.js +14 -16
- package/dist/components/table/Table.js +64 -186
- package/dist/components/table/table-config.js +17 -18
- package/dist/components/table/table-styles.js +48 -52
- package/dist/components/tabs/Tabs.d.ts +16 -8
- package/dist/components/tabs/Tabs.d.ts.map +1 -1
- package/dist/components/tabs/Tabs.js +93 -208
- package/dist/components/tabs/tabs-config.d.ts +42 -20
- package/dist/components/tabs/tabs-config.d.ts.map +1 -1
- package/dist/components/tabs/tabs-config.js +26 -18
- package/dist/components/tabs/tabs-styles.js +15 -17
- package/dist/components/textarea/Textarea.js +52 -138
- package/dist/components/textarea/textarea-config.js +10 -11
- package/dist/components/textarea/textarea-styles.js +9 -10
- package/dist/components/toast/ToastContext.js +22 -26
- package/dist/components/toast/ToastItem.js +82 -144
- package/dist/components/toast/ToastProvider.d.ts.map +1 -1
- package/dist/components/toast/ToastProvider.js +128 -190
- package/dist/components/toast/toast-config.js +23 -24
- package/dist/components/toast/toast-styles.js +50 -55
- package/dist/components/toast/use-pausable-timeout.js +17 -13
- package/dist/components/tooltip/Tooltip.d.ts +5 -0
- package/dist/components/tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/tooltip/Tooltip.js +68 -158
- package/dist/components/tooltip/tooltip-config.d.ts +25 -0
- package/dist/components/tooltip/tooltip-config.d.ts.map +1 -1
- package/dist/components/tooltip/tooltip-config.js +26 -22
- package/dist/components/tooltip/tooltip-styles.js +15 -17
- package/dist/config/default-config.js +11 -34
- package/dist/config/resolve-color.js +23 -23
- package/dist/config/resolve-config.d.ts.map +1 -1
- package/dist/config/resolve-config.js +14 -12
- package/dist/icons/ArrowLeftIcon.js +16 -19
- package/dist/icons/CalendarIcon.js +43 -24
- package/dist/icons/CheckIcon.js +16 -19
- package/dist/icons/ChevronDownIcon.js +15 -21
- package/dist/icons/ChevronLeftIcon.js +16 -19
- package/dist/icons/ChevronRightIcon.js +16 -19
- package/dist/icons/ChevronUpIcon.js +16 -19
- package/dist/icons/ClearIcon.js +26 -22
- package/dist/icons/ClockIcon.js +20 -22
- package/dist/icons/CloseIcon.js +26 -22
- package/dist/icons/ErrorIcon.js +16 -19
- package/dist/icons/ExternalLinkIcon.js +25 -23
- package/dist/icons/EyeIcon.js +20 -22
- package/dist/icons/EyeOffIcon.js +21 -22
- package/dist/icons/InfoIcon.js +16 -19
- package/dist/icons/SearchIcon.js +25 -22
- package/dist/icons/WarningIcon.js +16 -19
- package/dist/index.js +65 -163
- package/dist/libs/context.js +10 -13
- package/dist/libs/index.js +1 -0
- package/dist/libs/registry.js +10 -12
- package/dist/libs/use-floating-z-index.d.ts +32 -0
- package/dist/libs/use-floating-z-index.d.ts.map +1 -0
- package/dist/libs/use-floating-z-index.js +16 -0
- package/dist/libs/use-isomorphic-layout-effect.js +5 -5
- package/dist/scripts/AsheeThemeScript.js +35 -44
- package/dist/shared/radius.d.ts.map +1 -1
- package/dist/shared/radius.js +12 -13
- package/dist/shared/variant.js +46 -134
- package/dist/theme/color.js +28 -28
- package/dist/theme/controller.d.ts.map +1 -1
- package/dist/theme/controller.js +65 -178
- package/dist/theme/useTheme.js +13 -44
- package/dist/utils/cn.js +7 -7
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/merge-object.js +13 -14
- package/dist/utils/resolve-token.js +11 -14
- package/dist/utils/stacking.d.ts +76 -0
- package/dist/utils/stacking.d.ts.map +1 -0
- package/dist/utils/stacking.js +34 -0
- package/package.json +12 -11
|
@@ -1,192 +1,130 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { useAsheeConfig as
|
|
6
|
-
import { resolveCascade as
|
|
7
|
-
import { ToastContext as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
removeToast: b,
|
|
129
|
-
clearToasts: h,
|
|
130
|
-
portalTarget: x,
|
|
131
|
-
defaultPlacement: n,
|
|
132
|
-
defaultSize: c,
|
|
133
|
-
defaultVariant: i,
|
|
134
|
-
defaultRadius: m,
|
|
135
|
-
defaultAnimated: u
|
|
136
|
-
}),
|
|
137
|
-
[
|
|
138
|
-
f,
|
|
139
|
-
d,
|
|
140
|
-
j,
|
|
141
|
-
A,
|
|
142
|
-
P,
|
|
143
|
-
S,
|
|
144
|
-
b,
|
|
145
|
-
h,
|
|
146
|
-
x,
|
|
147
|
-
n,
|
|
148
|
-
c,
|
|
149
|
-
i,
|
|
150
|
-
m,
|
|
151
|
-
u
|
|
152
|
-
]
|
|
153
|
-
), W = U(() => {
|
|
154
|
-
const e = {};
|
|
155
|
-
for (const t of f) {
|
|
156
|
-
const r = t.placement ?? n, v = e[r] ?? [];
|
|
157
|
-
e[r] = v, v.push(t);
|
|
158
|
-
}
|
|
159
|
-
return e;
|
|
160
|
-
}, [f, n]), D = /* @__PURE__ */ p(g, { children: Object.entries(W).map(([e, t]) => /* @__PURE__ */ p(
|
|
161
|
-
"section",
|
|
162
|
-
{
|
|
163
|
-
"aria-label": "Notifications",
|
|
164
|
-
className: le(
|
|
165
|
-
"fixed z-99999 flex flex-col gap-3 pointer-events-none p-4 max-h-screen scrollbar-hide overflow-hidden",
|
|
166
|
-
oe[e],
|
|
167
|
-
I
|
|
168
|
-
),
|
|
169
|
-
children: t.map((r) => /* @__PURE__ */ p(
|
|
170
|
-
se,
|
|
171
|
-
{
|
|
172
|
-
...r,
|
|
173
|
-
onDismiss: b,
|
|
174
|
-
placement: e,
|
|
175
|
-
size: r.size ?? c,
|
|
176
|
-
variant: r.variant ?? i,
|
|
177
|
-
radius: r.radius ?? m,
|
|
178
|
-
animated: r.animated ?? u
|
|
179
|
-
},
|
|
180
|
-
r.id
|
|
181
|
-
))
|
|
182
|
-
},
|
|
183
|
-
e
|
|
184
|
-
)) });
|
|
185
|
-
return /* @__PURE__ */ C(de.Provider, { value: Q, children: [
|
|
186
|
-
E,
|
|
187
|
-
J ? /* @__PURE__ */ p(ee, { root: x, children: D }) : D
|
|
188
|
-
] });
|
|
2
|
+
"use client";
|
|
3
|
+
import { cn as e } from "../../utils/cn.js";
|
|
4
|
+
import { ASHEE_GLOBAL_LAYER as t } from "../../utils/stacking.js";
|
|
5
|
+
import { useAsheeConfig as n } from "../../libs/context.js";
|
|
6
|
+
import { resolveCascade as r, resolveRadiusKey as i } from "../../utils/resolve-token.js";
|
|
7
|
+
import { ToastContext as a } from "./ToastContext.js";
|
|
8
|
+
import { FALLBACK_TOAST_CONFIG as o } from "./toast-config.js";
|
|
9
|
+
import { PLACEMENT_CLASSES as s } from "./toast-styles.js";
|
|
10
|
+
import { ToastItem as c } from "./ToastItem.js";
|
|
11
|
+
import { useCallback as l, useMemo as u, useState as d } from "react";
|
|
12
|
+
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
13
|
+
import { FloatingPortal as h } from "@floating-ui/react";
|
|
14
|
+
//#region src/components/toast/ToastProvider.tsx
|
|
15
|
+
function g({ children: g, size: _, placement: v, variant: y, radius: b, defaultTimeout: x, maxToasts: S, animated: C, portal: w, portalTarget: T, className: E }) {
|
|
16
|
+
let [D, O] = d([]), k = n(), A = k.components?.toast, j = r(_, A?.size, void 0, o.size), M = r(v, A?.placement, void 0, o.placement), N = r(y, A?.variant, k.defaultVariant, o.variant), P = i(b, A?.radius, k.defaultRadius, o.radius), F = r(S, A?.maxToasts, void 0, o.maxToasts), I = r(x, A?.defaultTimeout, void 0, o.defaultTimeout), L = r(C, A?.animated, void 0, o.animated), R = r(w, A?.portal, void 0, o.portal), z = T ?? (typeof document < "u" ? document.body : null), B = l((e) => {
|
|
17
|
+
O((t) => t.filter((t) => t.id !== e));
|
|
18
|
+
}, []), V = l(() => {
|
|
19
|
+
O([]);
|
|
20
|
+
}, []), H = l((e) => {
|
|
21
|
+
let t = typeof e == "object" && e.id ? e.id : typeof window < "u" && window.crypto?.randomUUID ? window.crypto.randomUUID() : String(Date.now()), n = typeof e == "object" && e.placement ? e.placement : M, r = typeof e == "object" && e.size ? e.size : j, i = typeof e == "object" && e.variant ? e.variant : N, a = typeof e == "object" && e.radius ? e.radius : P, o = typeof e == "object" && e.animated !== void 0 ? e.animated : L, s = typeof e == "string" ? {
|
|
22
|
+
id: t,
|
|
23
|
+
message: e,
|
|
24
|
+
timeout: I,
|
|
25
|
+
type: "info",
|
|
26
|
+
placement: n,
|
|
27
|
+
size: r,
|
|
28
|
+
variant: i,
|
|
29
|
+
radius: a,
|
|
30
|
+
animated: o
|
|
31
|
+
} : {
|
|
32
|
+
...e,
|
|
33
|
+
id: t,
|
|
34
|
+
timeout: e.timeout ?? I,
|
|
35
|
+
type: e.type ?? "info",
|
|
36
|
+
placement: e.placement ?? n,
|
|
37
|
+
size: e.size ?? r,
|
|
38
|
+
variant: e.variant ?? i,
|
|
39
|
+
radius: e.radius ?? a,
|
|
40
|
+
animated: e.animated === void 0 ? o : e.animated
|
|
41
|
+
};
|
|
42
|
+
return O((e) => {
|
|
43
|
+
let n = e.filter((e) => e.id !== t);
|
|
44
|
+
return [s, ...n].slice(0, F);
|
|
45
|
+
}), t;
|
|
46
|
+
}, [
|
|
47
|
+
I,
|
|
48
|
+
F,
|
|
49
|
+
M,
|
|
50
|
+
j,
|
|
51
|
+
N,
|
|
52
|
+
P,
|
|
53
|
+
L
|
|
54
|
+
]), U = l((e, t) => H({
|
|
55
|
+
...t,
|
|
56
|
+
message: e,
|
|
57
|
+
type: "success"
|
|
58
|
+
}), [H]), W = l((e, t) => H({
|
|
59
|
+
...t,
|
|
60
|
+
message: e,
|
|
61
|
+
type: "error"
|
|
62
|
+
}), [H]), G = l((e, t) => H({
|
|
63
|
+
...t,
|
|
64
|
+
message: e,
|
|
65
|
+
type: "info"
|
|
66
|
+
}), [H]), K = l((e, t) => H({
|
|
67
|
+
...t,
|
|
68
|
+
message: e,
|
|
69
|
+
type: "warning"
|
|
70
|
+
}), [H]), q = u(() => ({
|
|
71
|
+
toasts: D,
|
|
72
|
+
toast: H,
|
|
73
|
+
success: U,
|
|
74
|
+
error: W,
|
|
75
|
+
info: G,
|
|
76
|
+
warning: K,
|
|
77
|
+
removeToast: B,
|
|
78
|
+
clearToasts: V,
|
|
79
|
+
portalTarget: z,
|
|
80
|
+
defaultPlacement: M,
|
|
81
|
+
defaultSize: j,
|
|
82
|
+
defaultVariant: N,
|
|
83
|
+
defaultRadius: P,
|
|
84
|
+
defaultAnimated: L
|
|
85
|
+
}), [
|
|
86
|
+
D,
|
|
87
|
+
H,
|
|
88
|
+
U,
|
|
89
|
+
W,
|
|
90
|
+
G,
|
|
91
|
+
K,
|
|
92
|
+
B,
|
|
93
|
+
V,
|
|
94
|
+
z,
|
|
95
|
+
M,
|
|
96
|
+
j,
|
|
97
|
+
N,
|
|
98
|
+
P,
|
|
99
|
+
L
|
|
100
|
+
]), J = u(() => {
|
|
101
|
+
let e = {};
|
|
102
|
+
for (let t of D) {
|
|
103
|
+
let n = t.placement ?? M, r = e[n] ?? [];
|
|
104
|
+
e[n] = r, r.push(t);
|
|
105
|
+
}
|
|
106
|
+
return e;
|
|
107
|
+
}, [D, M]), Y = /* @__PURE__ */ p(f, { children: Object.entries(J).map(([n, r]) => /* @__PURE__ */ p("section", {
|
|
108
|
+
"aria-label": "Notifications",
|
|
109
|
+
className: e("fixed flex flex-col gap-3 pointer-events-none p-4 max-h-screen scrollbar-hide overflow-hidden", s[n], E),
|
|
110
|
+
style: { zIndex: t.toast },
|
|
111
|
+
children: r.map((e) => /* @__PURE__ */ p(c, {
|
|
112
|
+
...e,
|
|
113
|
+
onDismiss: B,
|
|
114
|
+
placement: n,
|
|
115
|
+
size: e.size ?? j,
|
|
116
|
+
variant: e.variant ?? N,
|
|
117
|
+
radius: e.radius ?? P,
|
|
118
|
+
animated: e.animated ?? L
|
|
119
|
+
}, e.id))
|
|
120
|
+
}, n)) });
|
|
121
|
+
return /* @__PURE__ */ m(a.Provider, {
|
|
122
|
+
value: q,
|
|
123
|
+
children: [g, R ? /* @__PURE__ */ p(h, {
|
|
124
|
+
root: z,
|
|
125
|
+
children: Y
|
|
126
|
+
}) : Y]
|
|
127
|
+
});
|
|
189
128
|
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
};
|
|
129
|
+
//#endregion
|
|
130
|
+
export { g as ToastProvider };
|
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { registerComponentDefaults as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
t("toast", e);
|
|
23
|
-
export {
|
|
24
|
-
o as FALLBACK_TOAST_CONFIG,
|
|
25
|
-
e as defaultToastConfig
|
|
2
|
+
import { registerComponentDefaults as e } from "../../libs/registry.js";
|
|
3
|
+
//#region src/components/toast/toast-config.ts
|
|
4
|
+
var t = {
|
|
5
|
+
size: "md",
|
|
6
|
+
placement: "top-right",
|
|
7
|
+
variant: "bordered",
|
|
8
|
+
radius: "md",
|
|
9
|
+
animated: !0,
|
|
10
|
+
defaultTimeout: 3500,
|
|
11
|
+
maxToasts: 5,
|
|
12
|
+
portal: !0
|
|
13
|
+
}, n = {
|
|
14
|
+
size: "md",
|
|
15
|
+
placement: "top-right",
|
|
16
|
+
variant: "solid",
|
|
17
|
+
radius: "md",
|
|
18
|
+
animated: !0,
|
|
19
|
+
defaultTimeout: 3500,
|
|
20
|
+
maxToasts: 5,
|
|
21
|
+
portal: !0
|
|
26
22
|
};
|
|
23
|
+
e("toast", t);
|
|
24
|
+
//#endregion
|
|
25
|
+
export { n as FALLBACK_TOAST_CONFIG, t as defaultToastConfig };
|
|
@@ -1,58 +1,53 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"top-right": "top-0 right-0 items-end",
|
|
16
|
-
"top-left": "top-0 left-0 items-start",
|
|
17
|
-
"bottom-right": "bottom-0 right-0 items-end",
|
|
18
|
-
"bottom-left": "bottom-0 left-0 items-start",
|
|
19
|
-
"top-center": "top-0 left-1/2 -translate-x-1/2 items-center",
|
|
20
|
-
"bottom-center": "bottom-0 left-1/2 -translate-x-1/2 items-center"
|
|
21
|
-
}, m = {
|
|
22
|
-
sm: "text-xs font-semibold",
|
|
23
|
-
md: "text-sm font-semibold",
|
|
24
|
-
lg: "text-base font-semibold"
|
|
2
|
+
//#region src/components/toast/toast-styles.ts
|
|
3
|
+
var e = {
|
|
4
|
+
sm: "w-72 max-w-full",
|
|
5
|
+
md: "w-80 max-w-full",
|
|
6
|
+
lg: "w-96 max-w-full"
|
|
7
|
+
}, t = {
|
|
8
|
+
sm: "p-2.5",
|
|
9
|
+
md: "p-3.5",
|
|
10
|
+
lg: "p-4"
|
|
11
|
+
}, n = {
|
|
12
|
+
sm: "text-xs",
|
|
13
|
+
md: "text-sm",
|
|
14
|
+
lg: "text-base"
|
|
25
15
|
}, r = {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
16
|
+
"top-right": "top-0 right-0 items-end",
|
|
17
|
+
"top-left": "top-0 left-0 items-start",
|
|
18
|
+
"bottom-right": "bottom-0 right-0 items-end",
|
|
19
|
+
"bottom-left": "bottom-0 left-0 items-start",
|
|
20
|
+
"top-center": "top-0 left-1/2 -translate-x-1/2 items-center",
|
|
21
|
+
"bottom-center": "bottom-0 left-1/2 -translate-x-1/2 items-center"
|
|
22
|
+
}, i = {
|
|
23
|
+
sm: "text-xs font-semibold",
|
|
24
|
+
md: "text-sm font-semibold",
|
|
25
|
+
lg: "text-base font-semibold"
|
|
26
|
+
}, a = {
|
|
27
|
+
"top-right": {
|
|
28
|
+
enter: "toast-enter-top-right",
|
|
29
|
+
exit: "toast-exit-top-right"
|
|
30
|
+
},
|
|
31
|
+
"bottom-right": {
|
|
32
|
+
enter: "toast-enter-bottom-right",
|
|
33
|
+
exit: "toast-exit-bottom-right"
|
|
34
|
+
},
|
|
35
|
+
"top-left": {
|
|
36
|
+
enter: "toast-enter-top-left",
|
|
37
|
+
exit: "toast-exit-top-left"
|
|
38
|
+
},
|
|
39
|
+
"bottom-left": {
|
|
40
|
+
enter: "toast-enter-bottom-left",
|
|
41
|
+
exit: "toast-exit-bottom-left"
|
|
42
|
+
},
|
|
43
|
+
"top-center": {
|
|
44
|
+
enter: "toast-enter-top-center",
|
|
45
|
+
exit: "toast-exit-top-center"
|
|
46
|
+
},
|
|
47
|
+
"bottom-center": {
|
|
48
|
+
enter: "toast-enter-bottom-center",
|
|
49
|
+
exit: "toast-exit-bottom-center"
|
|
50
|
+
}
|
|
58
51
|
};
|
|
52
|
+
//#endregion
|
|
53
|
+
export { r as PLACEMENT_CLASSES, a as TOAST_ANIMATION_STATE, n as TOAST_FONT_CLASS, t as TOAST_PADDING_CLASS, i as TOAST_TITLE_FONT_CLASS, e as TOAST_WIDTH_CLASS };
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
"use client";
|
|
3
|
+
import { useCallback as e, useEffect as t, useRef as n } from "react";
|
|
4
|
+
//#region src/components/toast/use-pausable-timeout.ts
|
|
5
|
+
function r(r, i) {
|
|
6
|
+
let a = n(null), o = n(0), s = n(i ?? 0), c = e(() => {
|
|
7
|
+
!i || i <= 0 || a.current && (window.clearTimeout(a.current), a.current = null, s.current -= Date.now() - o.current);
|
|
8
|
+
}, [i]), l = e(() => {
|
|
9
|
+
!i || i <= 0 || s.current <= 0 || (o.current = Date.now(), a.current = window.setTimeout(r, s.current));
|
|
10
|
+
}, [r, i]);
|
|
11
|
+
return t(() => (i && i > 0 && l(), () => {
|
|
12
|
+
a.current && window.clearTimeout(a.current);
|
|
13
|
+
}), [l, i]), {
|
|
14
|
+
pause: c,
|
|
15
|
+
resume: l
|
|
16
|
+
};
|
|
12
17
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { r as usePausableTimeout };
|
|
@@ -47,6 +47,11 @@ export interface TooltipProps extends BaseTooltipProps {
|
|
|
47
47
|
* @param props.offset - Offset from the trigger. Defaults to 8.
|
|
48
48
|
* @param props.radius - Corner rounding. Defaults to "md".
|
|
49
49
|
* @param props.showArrow - Whether to show a pointer arrow. Defaults to false.
|
|
50
|
+
* @param props.portal - Whether to render the tooltip through `FloatingPortal`
|
|
51
|
+
* at the document body level. Defaults to false, which renders the tooltip in
|
|
52
|
+
* place so it follows the trigger's stacking context.
|
|
53
|
+
* @param props.zIndex - Layer delta added to the trigger's detected stacking
|
|
54
|
+
* context z-index. Defaults to `ASHEE_LAYER.tooltip`.
|
|
50
55
|
* @param props.className - Extra classes for the tooltip.
|
|
51
56
|
*
|
|
52
57
|
* @example
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/tooltip/Tooltip.tsx"],"names":[],"mappings":"AAyBA,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/tooltip/Tooltip.tsx"],"names":[],"mappings":"AAyBA,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AAef,OAAO,EAEL,KAAK,aAAa,EAGnB,MAAM,kBAAkB,CAAC;AAO1B,KAAK,gBAAgB,GAAG,aAAa,CAAC;AAEtC;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IACpD;;;OAGG;IACH,OAAO,EAAE,SAAS,CAAC;IAEnB;;;OAGG;IACH,QAAQ,EAAE,YAAY,GAAG,SAAS,CAAC;IAEnC;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,eAAO,MAAM,OAAO,yGA6OnB,CAAC"}
|