asheeui 0.6.8 → 0.6.9
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/components/autocomplete/Autocomplete.d.ts +34 -17
- package/dist/components/autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/components/autocomplete/Autocomplete.js +86 -102
- package/dist/components/autocomplete/autocomplete-config.d.ts +2 -20
- package/dist/components/autocomplete/autocomplete-config.d.ts.map +1 -1
- package/dist/components/autocomplete/autocomplete-config.js +9 -13
- package/dist/components/button/Button.d.ts +31 -5
- package/dist/components/button/Button.d.ts.map +1 -1
- package/dist/components/button/Button.js +68 -64
- package/dist/components/card/Card.d.ts +58 -54
- package/dist/components/card/Card.d.ts.map +1 -1
- package/dist/components/card/Card.js +152 -158
- package/dist/components/card/card-config.d.ts +66 -33
- package/dist/components/card/card-config.d.ts.map +1 -1
- package/dist/components/card/card-config.js +9 -9
- package/dist/components/date-picker/Calendar.d.ts +57 -0
- package/dist/components/date-picker/Calendar.d.ts.map +1 -0
- package/dist/components/date-picker/Calendar.js +224 -0
- package/dist/components/date-picker/DatePicker.d.ts +68 -155
- package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
- package/dist/components/date-picker/DatePicker.js +194 -466
- package/dist/components/date-picker/TimeSpinner.d.ts +46 -0
- package/dist/components/date-picker/TimeSpinner.d.ts.map +1 -0
- package/dist/components/date-picker/TimeSpinner.js +84 -0
- package/dist/components/date-picker/date-picker-config.d.ts +21 -1
- package/dist/components/date-picker/date-picker-config.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker-config.js +10 -14
- package/dist/components/date-picker/date-picker-styles.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker-styles.js +4 -11
- package/dist/components/date-picker/date-picker.helpers.d.ts +111 -0
- package/dist/components/date-picker/date-picker.helpers.d.ts.map +1 -0
- package/dist/components/date-picker/date-picker.helpers.js +110 -0
- package/dist/components/date-picker/index.js +3 -0
- package/dist/components/input/Input.d.ts +13 -7
- package/dist/components/input/Input.d.ts.map +1 -1
- package/dist/components/input/Input.js +96 -91
- package/dist/components/keyboard/KeyboardContext.d.ts +130 -0
- package/dist/components/keyboard/KeyboardContext.d.ts.map +1 -0
- package/dist/components/keyboard/KeyboardContext.js +13 -0
- package/dist/components/keyboard/KeyboardProvider.d.ts +78 -0
- package/dist/components/keyboard/KeyboardProvider.d.ts.map +1 -0
- package/dist/components/keyboard/KeyboardProvider.js +183 -0
- package/dist/components/keyboard/OnScreenKeyboard.d.ts +65 -43
- package/dist/components/keyboard/OnScreenKeyboard.d.ts.map +1 -1
- package/dist/components/keyboard/OnScreenKeyboard.js +119 -113
- package/dist/components/keyboard/index.d.ts +2 -1
- package/dist/components/keyboard/index.d.ts.map +1 -1
- package/dist/components/keyboard/index.js +2 -1
- package/dist/components/keyboard/keyboard-config.d.ts +40 -36
- package/dist/components/keyboard/keyboard-config.d.ts.map +1 -1
- package/dist/components/keyboard/keyboard-config.js +15 -10
- package/dist/components/keyboard/use-keyboard-field.d.ts +6 -4
- package/dist/components/keyboard/use-keyboard-field.d.ts.map +1 -1
- package/dist/components/keyboard/use-keyboard-field.js +12 -12
- package/dist/components/multi-select/MultiSelect.d.ts +75 -40
- package/dist/components/multi-select/MultiSelect.d.ts.map +1 -1
- package/dist/components/multi-select/MultiSelect.js +188 -188
- package/dist/components/multi-select/multi-select-config.d.ts +2 -20
- package/dist/components/multi-select/multi-select-config.d.ts.map +1 -1
- package/dist/components/multi-select/multi-select-config.js +10 -14
- package/dist/components/select/Select.d.ts +60 -45
- package/dist/components/select/Select.d.ts.map +1 -1
- package/dist/components/select/Select.js +147 -159
- package/dist/components/select/select-config.d.ts +3 -29
- package/dist/components/select/select-config.d.ts.map +1 -1
- package/dist/components/select/select-config.js +6 -14
- package/dist/components/select/select-styles.js +1 -6
- package/dist/components/select-menu/SelectMenu.d.ts +45 -30
- package/dist/components/select-menu/SelectMenu.d.ts.map +1 -1
- package/dist/components/select-menu/SelectMenu.js +125 -124
- package/dist/components/select-menu/select-menu-config.d.ts +25 -2
- package/dist/components/select-menu/select-menu-config.d.ts.map +1 -1
- package/dist/components/select-menu/select-menu-config.js +4 -3
- package/dist/components/switch/Switch.d.ts +9 -33
- package/dist/components/switch/Switch.d.ts.map +1 -1
- package/dist/components/switch/Switch.js +68 -74
- package/dist/components/switch/switch-styles.d.ts +1 -6
- package/dist/components/switch/switch-styles.d.ts.map +1 -1
- package/dist/components/switch/switch-styles.js +6 -12
- package/dist/components/textarea/Textarea.d.ts +19 -1
- package/dist/components/textarea/Textarea.d.ts.map +1 -1
- package/dist/components/textarea/Textarea.js +95 -90
- package/dist/components/toast/ToastContext.d.ts +122 -0
- package/dist/components/toast/ToastContext.d.ts.map +1 -0
- package/dist/components/toast/ToastContext.js +28 -0
- package/dist/components/toast/ToastProvider.d.ts +98 -0
- package/dist/components/toast/ToastProvider.d.ts.map +1 -0
- package/dist/components/toast/ToastProvider.js +188 -0
- package/dist/components/toast/index.d.ts +2 -1
- package/dist/components/toast/index.d.ts.map +1 -1
- package/dist/components/toast/index.js +2 -1
- package/dist/components/toast/toast-config.d.ts +36 -0
- package/dist/components/toast/toast-config.d.ts.map +1 -1
- package/dist/icons/ChevronUpIcon.d.ts +3 -0
- package/dist/icons/ChevronUpIcon.d.ts.map +1 -0
- package/dist/icons/ChevronUpIcon.js +21 -0
- package/dist/icons/index.d.ts +2 -0
- package/dist/icons/index.d.ts.map +1 -1
- package/dist/index.js +62 -59
- package/dist/theme/color.js +2 -2
- package/package.json +1 -1
- package/dist/components/keyboard/keyboard-context.d.ts +0 -118
- package/dist/components/keyboard/keyboard-context.d.ts.map +0 -1
- package/dist/components/keyboard/keyboard-context.js +0 -90
- package/dist/components/toast/toast-context.d.ts +0 -163
- package/dist/components/toast/toast-context.d.ts.map +0 -1
- package/dist/components/toast/toast-context.js +0 -177
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as K, jsxs as J } from "react/jsx-runtime";
|
|
3
|
-
import { useState as Q, useCallback as n, useMemo as W, useContext as X, createContext as Y } from "react";
|
|
4
|
-
import { createPortal as Z } from "react-dom";
|
|
5
|
-
import { useAsheeConfig as $ } from "../../libs/context.js";
|
|
6
|
-
import { resolveCascade as l, resolveRadiusKey as C } from "../../utils/resolve-token.js";
|
|
7
|
-
import { ToastItem as tt } from "./ToastItem.js";
|
|
8
|
-
import { FALLBACK_TOAST_CONFIG as a } from "./toast-config.js";
|
|
9
|
-
import { cn as et } from "../../utils/cn.js";
|
|
10
|
-
const P = Y(null);
|
|
11
|
-
function dt({
|
|
12
|
-
children: i,
|
|
13
|
-
size: I,
|
|
14
|
-
placement: S,
|
|
15
|
-
variant: U,
|
|
16
|
-
radius: j,
|
|
17
|
-
defaultTimeout: N,
|
|
18
|
-
maxToasts: R,
|
|
19
|
-
animated: V,
|
|
20
|
-
portal: F,
|
|
21
|
-
portalTarget: L,
|
|
22
|
-
className: M
|
|
23
|
-
}) {
|
|
24
|
-
var A;
|
|
25
|
-
const [d, c] = Q([]), u = $(), t = (A = u.components) == null ? void 0 : A.toast, O = l(
|
|
26
|
-
I,
|
|
27
|
-
t == null ? void 0 : t.size,
|
|
28
|
-
void 0,
|
|
29
|
-
a.size
|
|
30
|
-
), s = l(
|
|
31
|
-
S,
|
|
32
|
-
t == null ? void 0 : t.placement,
|
|
33
|
-
void 0,
|
|
34
|
-
a.placement
|
|
35
|
-
), _ = l(
|
|
36
|
-
U,
|
|
37
|
-
t == null ? void 0 : t.variant,
|
|
38
|
-
u.defaultVariant,
|
|
39
|
-
a.variant
|
|
40
|
-
), g = C(
|
|
41
|
-
j,
|
|
42
|
-
t == null ? void 0 : t.radius,
|
|
43
|
-
u.defaultRadius,
|
|
44
|
-
a.radius
|
|
45
|
-
), T = l(
|
|
46
|
-
R,
|
|
47
|
-
t == null ? void 0 : t.maxToasts,
|
|
48
|
-
void 0,
|
|
49
|
-
a.maxToasts
|
|
50
|
-
), p = l(
|
|
51
|
-
N,
|
|
52
|
-
t == null ? void 0 : t.defaultTimeout,
|
|
53
|
-
void 0,
|
|
54
|
-
a.defaultTimeout
|
|
55
|
-
), k = l(
|
|
56
|
-
V,
|
|
57
|
-
t == null ? void 0 : t.animated,
|
|
58
|
-
void 0,
|
|
59
|
-
a.animated
|
|
60
|
-
), B = l(
|
|
61
|
-
F,
|
|
62
|
-
t == null ? void 0 : t.portal,
|
|
63
|
-
void 0,
|
|
64
|
-
a.portal
|
|
65
|
-
), m = L ?? (typeof document < "u" ? document.body : null), f = n((e) => {
|
|
66
|
-
c((o) => o.filter((v) => v.id !== e));
|
|
67
|
-
}, []), y = n(() => {
|
|
68
|
-
c([]);
|
|
69
|
-
}, []), r = n(
|
|
70
|
-
(e) => {
|
|
71
|
-
var D;
|
|
72
|
-
const o = typeof e == "object" && e.id ? e.id : typeof window < "u" && ((D = window.crypto) != null && D.randomUUID) ? window.crypto.randomUUID() : String(Date.now()), v = typeof e == "string" ? {
|
|
73
|
-
id: o,
|
|
74
|
-
message: e,
|
|
75
|
-
timeout: p,
|
|
76
|
-
type: "info"
|
|
77
|
-
} : {
|
|
78
|
-
...e,
|
|
79
|
-
id: o,
|
|
80
|
-
timeout: e.timeout ?? p,
|
|
81
|
-
type: e.type ?? "info"
|
|
82
|
-
};
|
|
83
|
-
return c((q) => {
|
|
84
|
-
const E = q.filter((H) => H.id !== o);
|
|
85
|
-
return [v, ...E].slice(0, T);
|
|
86
|
-
}), o;
|
|
87
|
-
},
|
|
88
|
-
[p, T]
|
|
89
|
-
), x = n(
|
|
90
|
-
(e, o) => r({ ...o, message: e, type: "success" }),
|
|
91
|
-
[r]
|
|
92
|
-
), w = n(
|
|
93
|
-
(e, o) => r({ ...o, message: e, type: "error" }),
|
|
94
|
-
[r]
|
|
95
|
-
), b = n(
|
|
96
|
-
(e, o) => r({ ...o, message: e, type: "info" }),
|
|
97
|
-
[r]
|
|
98
|
-
), h = n(
|
|
99
|
-
(e, o) => r({ ...o, message: e, type: "warning" }),
|
|
100
|
-
[r]
|
|
101
|
-
), G = W(
|
|
102
|
-
() => ({
|
|
103
|
-
toasts: d,
|
|
104
|
-
toast: r,
|
|
105
|
-
success: x,
|
|
106
|
-
error: w,
|
|
107
|
-
info: b,
|
|
108
|
-
warning: h,
|
|
109
|
-
removeToast: f,
|
|
110
|
-
clearToasts: y,
|
|
111
|
-
portalTarget: m
|
|
112
|
-
}),
|
|
113
|
-
[
|
|
114
|
-
d,
|
|
115
|
-
r,
|
|
116
|
-
x,
|
|
117
|
-
w,
|
|
118
|
-
b,
|
|
119
|
-
h,
|
|
120
|
-
f,
|
|
121
|
-
y,
|
|
122
|
-
m
|
|
123
|
-
]
|
|
124
|
-
), z = /* @__PURE__ */ K(
|
|
125
|
-
"section",
|
|
126
|
-
{
|
|
127
|
-
"aria-label": "Notifications",
|
|
128
|
-
className: et(
|
|
129
|
-
"fixed z-50 flex flex-col gap-3 pointer-events-none p-4 max-h-screen overflow-clip",
|
|
130
|
-
s === "top-right" && "top-0 right-0 items-end",
|
|
131
|
-
s === "top-left" && "top-0 left-0 items-start",
|
|
132
|
-
s === "bottom-right" && "bottom-0 right-0 items-end",
|
|
133
|
-
s === "bottom-left" && "bottom-0 left-0 items-start",
|
|
134
|
-
s === "top-center" && "top-0 left-1/2 -translate-x-1/2 items-center",
|
|
135
|
-
s === "bottom-center" && "bottom-0 left-1/2 -translate-x-1/2 items-center",
|
|
136
|
-
M
|
|
137
|
-
),
|
|
138
|
-
children: d.map((e) => /* @__PURE__ */ K(
|
|
139
|
-
tt,
|
|
140
|
-
{
|
|
141
|
-
...e,
|
|
142
|
-
placement: s,
|
|
143
|
-
size: O,
|
|
144
|
-
variant: _,
|
|
145
|
-
radius: g,
|
|
146
|
-
onDismiss: f,
|
|
147
|
-
animated: k
|
|
148
|
-
},
|
|
149
|
-
e.id
|
|
150
|
-
))
|
|
151
|
-
}
|
|
152
|
-
);
|
|
153
|
-
return /* @__PURE__ */ J(P.Provider, { value: G, children: [
|
|
154
|
-
i,
|
|
155
|
-
B && m ? Z(z, m) : z
|
|
156
|
-
] });
|
|
157
|
-
}
|
|
158
|
-
function ct() {
|
|
159
|
-
const i = X(P);
|
|
160
|
-
return i || {
|
|
161
|
-
toasts: [],
|
|
162
|
-
toast: () => "",
|
|
163
|
-
success: () => "",
|
|
164
|
-
error: () => "",
|
|
165
|
-
info: () => "",
|
|
166
|
-
warning: () => "",
|
|
167
|
-
removeToast: () => {
|
|
168
|
-
},
|
|
169
|
-
clearToasts: () => {
|
|
170
|
-
},
|
|
171
|
-
portalTarget: null
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
export {
|
|
175
|
-
dt as ToastProvider,
|
|
176
|
-
ct as useToast
|
|
177
|
-
};
|