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,138 +1,48 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { FALLBACK_LINK_CONFIG as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
e == null ? void 0 : e.underline,
|
|
50
|
-
void 0,
|
|
51
|
-
r.underline
|
|
52
|
-
), l = h ?? (e == null ? void 0 : e.isExternal) ?? r.isExternal, D = u === "muted" ? k.muted : s(
|
|
53
|
-
n(
|
|
54
|
-
R,
|
|
55
|
-
M,
|
|
56
|
-
r.color
|
|
57
|
-
),
|
|
58
|
-
n(
|
|
59
|
-
u,
|
|
60
|
-
k,
|
|
61
|
-
r.variant
|
|
62
|
-
)
|
|
63
|
-
), F = n(
|
|
64
|
-
L,
|
|
65
|
-
Q,
|
|
66
|
-
r.size
|
|
67
|
-
), a = n(
|
|
68
|
-
L,
|
|
69
|
-
W,
|
|
70
|
-
r.size
|
|
71
|
-
), U = n(
|
|
72
|
-
w,
|
|
73
|
-
X,
|
|
74
|
-
r.underline
|
|
75
|
-
), v = E ?? (l ? "_blank" : void 0), V = z ?? (l || v === "_blank" ? "noopener noreferrer" : void 0), Z = (N) => {
|
|
76
|
-
if (o) {
|
|
77
|
-
N.preventDefault();
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
t == null || t(N);
|
|
81
|
-
}, B = s(
|
|
82
|
-
"inline-flex items-center transition-colors duration-200 outline-none select-none shrink-0",
|
|
83
|
-
"focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 rounded-xs",
|
|
84
|
-
F,
|
|
85
|
-
D,
|
|
86
|
-
U,
|
|
87
|
-
o && "opacity-50 pointer-events-none cursor-not-allowed",
|
|
88
|
-
K
|
|
89
|
-
), G = {
|
|
90
|
-
...{
|
|
91
|
-
href: o ? void 0 : _,
|
|
92
|
-
target: v,
|
|
93
|
-
rel: V,
|
|
94
|
-
"aria-disabled": o,
|
|
95
|
-
onClick: Z,
|
|
96
|
-
className: B,
|
|
97
|
-
style: y,
|
|
98
|
-
ref: P,
|
|
99
|
-
// forward ref to the custom component if it accepts it
|
|
100
|
-
...O
|
|
101
|
-
// any other native anchor attributes
|
|
102
|
-
},
|
|
103
|
-
...j || {}
|
|
104
|
-
};
|
|
105
|
-
return /* @__PURE__ */ T(b || "a", { ...G, children: [
|
|
106
|
-
m && /* @__PURE__ */ c(
|
|
107
|
-
"span",
|
|
108
|
-
{
|
|
109
|
-
className: s(
|
|
110
|
-
"inline-flex items-center justify-center shrink-0",
|
|
111
|
-
a
|
|
112
|
-
),
|
|
113
|
-
children: m
|
|
114
|
-
}
|
|
115
|
-
),
|
|
116
|
-
C,
|
|
117
|
-
d ? /* @__PURE__ */ c(
|
|
118
|
-
"span",
|
|
119
|
-
{
|
|
120
|
-
className: s(
|
|
121
|
-
"inline-flex items-center justify-center shrink-0",
|
|
122
|
-
a
|
|
123
|
-
),
|
|
124
|
-
children: d
|
|
125
|
-
}
|
|
126
|
-
) : l && /* @__PURE__ */ c(
|
|
127
|
-
H,
|
|
128
|
-
{
|
|
129
|
-
className: s("inline-block shrink-0", a)
|
|
130
|
-
}
|
|
131
|
-
)
|
|
132
|
-
] });
|
|
133
|
-
}
|
|
134
|
-
);
|
|
135
|
-
Y.displayName = "Link";
|
|
136
|
-
export {
|
|
137
|
-
Y as Link
|
|
138
|
-
};
|
|
2
|
+
"use client";
|
|
3
|
+
import { cn as e } from "../../utils/cn.js";
|
|
4
|
+
import { useAsheeConfig as t } from "../../libs/context.js";
|
|
5
|
+
import { resolveCascade as n, resolveClassKey as r } from "../../utils/resolve-token.js";
|
|
6
|
+
import { ExternalLinkIcon as i } from "../../icons/ExternalLinkIcon.js";
|
|
7
|
+
import { FALLBACK_LINK_CONFIG as a } from "./link-config.js";
|
|
8
|
+
import { LINK_COLOR_CLASS as o, LINK_ICON_SIZE_CLASS as s, LINK_SIZE_CLASS as c, LINK_UNDERLINE_CLASS as l, LINK_VARIANT_CLASS as u } from "./link-styles.js";
|
|
9
|
+
import { forwardRef as d } from "react";
|
|
10
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
11
|
+
//#region src/components/link/Link.tsx
|
|
12
|
+
var m = d(({ href: d, variant: m, color: h, size: g, underline: _, isExternal: v, disabled: y = !1, startIcon: b, endIcon: x, children: S, className: C, style: w, target: T, rel: E, onClick: D, linkComponent: O, linkProps: k, ...A }, j) => {
|
|
13
|
+
let M = t(), N = M.components?.link, P = n(g, N?.size, void 0, a.size), F = n(m, N?.variant, void 0, a.variant), I = n(h, N?.color, M.defaultColor, a.color), L = n(_, N?.underline, void 0, a.underline), R = v ?? N?.isExternal ?? a.isExternal, z = F === "muted" ? u.muted : e(r(I, o, a.color), r(F, u, a.variant)), B = r(P, c, a.size), V = r(P, s, a.size), H = r(L, l, a.underline), U = T ?? (R ? "_blank" : void 0), W = E ?? (R || U === "_blank" ? "noopener noreferrer" : void 0), G = (e) => {
|
|
14
|
+
if (y) {
|
|
15
|
+
e.preventDefault();
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
D?.(e);
|
|
19
|
+
}, K = e("inline-flex items-center transition-colors duration-200 outline-none select-none shrink-0", "focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 rounded-xs", B, z, H, y && "opacity-50 pointer-events-none cursor-not-allowed", C), q = {
|
|
20
|
+
href: y ? void 0 : d,
|
|
21
|
+
target: U,
|
|
22
|
+
rel: W,
|
|
23
|
+
"aria-disabled": y,
|
|
24
|
+
onClick: G,
|
|
25
|
+
className: K,
|
|
26
|
+
style: w,
|
|
27
|
+
ref: j,
|
|
28
|
+
...A,
|
|
29
|
+
...k || {}
|
|
30
|
+
};
|
|
31
|
+
return /* @__PURE__ */ p(O || "a", {
|
|
32
|
+
...q,
|
|
33
|
+
children: [
|
|
34
|
+
b && /* @__PURE__ */ f("span", {
|
|
35
|
+
className: e("inline-flex items-center justify-center shrink-0", V),
|
|
36
|
+
children: b
|
|
37
|
+
}),
|
|
38
|
+
S,
|
|
39
|
+
x ? /* @__PURE__ */ f("span", {
|
|
40
|
+
className: e("inline-flex items-center justify-center shrink-0", V),
|
|
41
|
+
children: x
|
|
42
|
+
}) : R && /* @__PURE__ */ f(i, { className: e("inline-block shrink-0", V) })
|
|
43
|
+
]
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
m.displayName = "Link";
|
|
47
|
+
//#endregion
|
|
48
|
+
export { m as Link };
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { registerComponentDefaults as e } from "../../libs/registry.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
e("link", n);
|
|
15
|
-
export {
|
|
16
|
-
i as FALLBACK_LINK_CONFIG,
|
|
17
|
-
n as defaultLinkConfig
|
|
3
|
+
//#region src/components/link/link-config.ts
|
|
4
|
+
var t = {
|
|
5
|
+
size: "md",
|
|
6
|
+
underline: "hover",
|
|
7
|
+
isExternal: !1
|
|
8
|
+
}, n = {
|
|
9
|
+
size: "md",
|
|
10
|
+
variant: "default",
|
|
11
|
+
color: "primary",
|
|
12
|
+
underline: "hover",
|
|
13
|
+
isExternal: !1
|
|
18
14
|
};
|
|
15
|
+
e("link", t);
|
|
16
|
+
//#endregion
|
|
17
|
+
export { n as FALLBACK_LINK_CONFIG, t as defaultLinkConfig };
|
|
@@ -1,33 +1,29 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
//#region src/components/link/link-styles.ts
|
|
3
|
+
var e = {
|
|
4
|
+
sm: "text-xs gap-1.5",
|
|
5
|
+
md: "text-sm gap-2",
|
|
6
|
+
lg: "text-base gap-2.5"
|
|
6
7
|
}, t = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}, r = {
|
|
11
|
-
none: "text-foreground hover:text-foreground/80",
|
|
12
|
-
default: "text-foreground hover:text-foreground/80",
|
|
13
|
-
primary: "text-primary hover:text-primary/80",
|
|
14
|
-
secondary: "text-secondary hover:text-secondary/80",
|
|
15
|
-
success: "text-success hover:text-success/80",
|
|
16
|
-
warning: "text-warning hover:text-warning/80",
|
|
17
|
-
danger: "text-danger hover:text-danger/80"
|
|
8
|
+
sm: "size-3.5",
|
|
9
|
+
md: "size-4",
|
|
10
|
+
lg: "size-4.5"
|
|
18
11
|
}, n = {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
12
|
+
none: "text-foreground hover:text-foreground/80",
|
|
13
|
+
default: "text-foreground hover:text-foreground/80",
|
|
14
|
+
primary: "text-primary hover:text-primary/80",
|
|
15
|
+
secondary: "text-secondary hover:text-secondary/80",
|
|
16
|
+
success: "text-success hover:text-success/80",
|
|
17
|
+
warning: "text-warning hover:text-warning/80",
|
|
18
|
+
danger: "text-danger hover:text-danger/80"
|
|
19
|
+
}, r = {
|
|
20
|
+
default: "",
|
|
21
|
+
muted: "text-foreground/70 hover:text-foreground",
|
|
22
|
+
subtle: "opacity-80 hover:opacity-100"
|
|
23
|
+
}, i = {
|
|
24
|
+
always: "underline underline-offset-4 decoration-current",
|
|
25
|
+
hover: "no-underline hover:underline underline-offset-4 decoration-current",
|
|
26
|
+
never: "no-underline"
|
|
33
27
|
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { n as LINK_COLOR_CLASS, t as LINK_ICON_SIZE_CLASS, e as LINK_SIZE_CLASS, i as LINK_UNDERLINE_CLASS, r as LINK_VARIANT_CLASS };
|
|
@@ -1,145 +1,56 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import { useAsheeConfig as
|
|
5
|
-
import { resolveCascade as
|
|
6
|
-
import { FALLBACK_MARQUEE_CONFIG as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
"div",
|
|
58
|
-
{
|
|
59
|
-
className: s(
|
|
60
|
-
"flex shrink-0",
|
|
61
|
-
t ? "flex-col" : "flex-row"
|
|
62
|
-
),
|
|
63
|
-
style: {
|
|
64
|
-
gap: d
|
|
65
|
-
},
|
|
66
|
-
"aria-hidden": u === 1,
|
|
67
|
-
children: $.map((n, b) => {
|
|
68
|
-
const L = T(n) && n.key ? `${c}-${n.key}` : `${c}-item-${b}`;
|
|
69
|
-
return /* @__PURE__ */ r("div", { className: s("shrink-0", p), children: n }, L);
|
|
70
|
-
})
|
|
71
|
-
},
|
|
72
|
-
`${c}-set`
|
|
73
|
-
);
|
|
74
|
-
}),
|
|
75
|
-
[i, t, d, p]
|
|
76
|
-
);
|
|
77
|
-
return /* @__PURE__ */ f(
|
|
78
|
-
"div",
|
|
79
|
-
{
|
|
80
|
-
ref: D,
|
|
81
|
-
className: s(
|
|
82
|
-
"group relative scrollbar-hide overflow-hidden",
|
|
83
|
-
t ? "h-full" : "w-full",
|
|
84
|
-
N
|
|
85
|
-
),
|
|
86
|
-
...q,
|
|
87
|
-
children: [
|
|
88
|
-
/* @__PURE__ */ r("style", { children: `
|
|
89
|
-
@keyframes marquee-x {
|
|
90
|
-
from { transform: translateX(0%); }
|
|
91
|
-
to { transform: translateX(-50%); }
|
|
92
|
-
}
|
|
93
|
-
@keyframes marquee-y {
|
|
94
|
-
from { transform: translateY(0%); }
|
|
95
|
-
to { transform: translateY(-50%); }
|
|
96
|
-
}
|
|
97
|
-
` }),
|
|
98
|
-
/* @__PURE__ */ r(
|
|
99
|
-
"div",
|
|
100
|
-
{
|
|
101
|
-
className: s(
|
|
102
|
-
"flex",
|
|
103
|
-
t ? "flex-col" : "flex-row w-max",
|
|
104
|
-
M && "group-hover:[animation-play-state:paused]"
|
|
105
|
-
),
|
|
106
|
-
style: {
|
|
107
|
-
gap: d,
|
|
108
|
-
animationName: t ? "marquee-y" : "marquee-x",
|
|
109
|
-
animationDuration: `${k}s`,
|
|
110
|
-
animationTimingFunction: "linear",
|
|
111
|
-
animationIterationCount: "infinite",
|
|
112
|
-
animationDirection: F === "reverse" ? "reverse" : "normal"
|
|
113
|
-
},
|
|
114
|
-
children: w
|
|
115
|
-
}
|
|
116
|
-
),
|
|
117
|
-
R && /* @__PURE__ */ f(O, { children: [
|
|
118
|
-
/* @__PURE__ */ r(
|
|
119
|
-
"div",
|
|
120
|
-
{
|
|
121
|
-
className: s(
|
|
122
|
-
"absolute z-10 pointer-events-none",
|
|
123
|
-
g[l]
|
|
124
|
-
)
|
|
125
|
-
}
|
|
126
|
-
),
|
|
127
|
-
/* @__PURE__ */ r(
|
|
128
|
-
"div",
|
|
129
|
-
{
|
|
130
|
-
className: s(
|
|
131
|
-
"absolute z-10 pointer-events-none",
|
|
132
|
-
H[l]
|
|
133
|
-
)
|
|
134
|
-
}
|
|
135
|
-
)
|
|
136
|
-
] })
|
|
137
|
-
]
|
|
138
|
-
}
|
|
139
|
-
);
|
|
140
|
-
}
|
|
141
|
-
);
|
|
142
|
-
j.displayName = "Marquee";
|
|
143
|
-
export {
|
|
144
|
-
j as Marquee
|
|
145
|
-
};
|
|
2
|
+
"use client";
|
|
3
|
+
import { cn as e } from "../../utils/cn.js";
|
|
4
|
+
import { useAsheeConfig as t } from "../../libs/context.js";
|
|
5
|
+
import { resolveCascade as n } from "../../utils/resolve-token.js";
|
|
6
|
+
import { FALLBACK_MARQUEE_CONFIG as r } from "./marquee-config.js";
|
|
7
|
+
import { MARQUEE_FADE_END_CLASS as i, MARQUEE_FADE_START_CLASS as a, MARQUEE_SPEED_PRESETS as o } from "./marquee-styles.js";
|
|
8
|
+
import { forwardRef as s, isValidElement as c, useMemo as l } from "react";
|
|
9
|
+
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
10
|
+
//#region src/components/marquee/Marquee.tsx
|
|
11
|
+
var p = s(({ children: s, axis: p, direction: m, speed: h, gap: g, pauseOnHover: _, fadeEdges: v, className: y, itemClassName: b, ...x }, S) => {
|
|
12
|
+
let C = t().components?.marquee, w = n(p, C?.axis, void 0, r.axis), T = n(m, C?.direction, void 0, r.direction), E = n(h, C?.speed, void 0, r.speed), D = n(g, C?.gap, void 0, r.gap), O = n(_, C?.pauseOnHover, void 0, r.pauseOnHover), k = n(v, C?.fadeEdges, void 0, r.fadeEdges), A = typeof E == "number" ? E : o[E] ?? o.normal, j = w === "y", M = l(() => [s, s].map((t, n) => {
|
|
13
|
+
let r = n === 0 ? "primary" : "secondary";
|
|
14
|
+
return /* @__PURE__ */ d("div", {
|
|
15
|
+
className: e("flex shrink-0", j ? "flex-col" : "flex-row"),
|
|
16
|
+
style: { gap: D },
|
|
17
|
+
"aria-hidden": n === 1,
|
|
18
|
+
children: t.map((t, n) => {
|
|
19
|
+
let i = c(t) && t.key ? `${r}-${t.key}` : `${r}-item-${n}`;
|
|
20
|
+
return /* @__PURE__ */ d("div", {
|
|
21
|
+
className: e("shrink-0", b),
|
|
22
|
+
children: t
|
|
23
|
+
}, i);
|
|
24
|
+
})
|
|
25
|
+
}, `${r}-set`);
|
|
26
|
+
}), [
|
|
27
|
+
s,
|
|
28
|
+
j,
|
|
29
|
+
D,
|
|
30
|
+
b
|
|
31
|
+
]);
|
|
32
|
+
return /* @__PURE__ */ f("div", {
|
|
33
|
+
ref: S,
|
|
34
|
+
className: e("group relative scrollbar-hide overflow-hidden", j ? "h-full" : "w-full", y),
|
|
35
|
+
...x,
|
|
36
|
+
children: [
|
|
37
|
+
/* @__PURE__ */ d("style", { children: "\n @keyframes marquee-x {\n from { transform: translateX(0%); }\n to { transform: translateX(-50%); }\n }\n @keyframes marquee-y {\n from { transform: translateY(0%); }\n to { transform: translateY(-50%); }\n }\n " }),
|
|
38
|
+
/* @__PURE__ */ d("div", {
|
|
39
|
+
className: e("flex", j ? "flex-col" : "flex-row w-max", O && "group-hover:[animation-play-state:paused]"),
|
|
40
|
+
style: {
|
|
41
|
+
gap: D,
|
|
42
|
+
animationName: j ? "marquee-y" : "marquee-x",
|
|
43
|
+
animationDuration: `${A}s`,
|
|
44
|
+
animationTimingFunction: "linear",
|
|
45
|
+
animationIterationCount: "infinite",
|
|
46
|
+
animationDirection: T === "reverse" ? "reverse" : "normal"
|
|
47
|
+
},
|
|
48
|
+
children: M
|
|
49
|
+
}),
|
|
50
|
+
k && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { className: e("absolute z-10 pointer-events-none", a[w]) }), /* @__PURE__ */ d("div", { className: e("absolute z-10 pointer-events-none", i[w]) })] })
|
|
51
|
+
]
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
p.displayName = "Marquee";
|
|
55
|
+
//#endregion
|
|
56
|
+
export { p as Marquee };
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { registerComponentDefaults as e } from "../../libs/registry.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
e("marquee", r);
|
|
19
|
-
export {
|
|
20
|
-
o as FALLBACK_MARQUEE_CONFIG,
|
|
21
|
-
r as defaultMarqueeConfig
|
|
3
|
+
//#region src/components/marquee/marquee-config.ts
|
|
4
|
+
var t = {
|
|
5
|
+
axis: "x",
|
|
6
|
+
direction: "forward",
|
|
7
|
+
speed: "normal",
|
|
8
|
+
gap: "1.5rem",
|
|
9
|
+
pauseOnHover: !1,
|
|
10
|
+
fadeEdges: !1
|
|
11
|
+
}, n = {
|
|
12
|
+
axis: "x",
|
|
13
|
+
direction: "forward",
|
|
14
|
+
speed: "normal",
|
|
15
|
+
gap: "1.5rem",
|
|
16
|
+
pauseOnHover: !0,
|
|
17
|
+
fadeEdges: !0
|
|
22
18
|
};
|
|
19
|
+
e("marquee", t);
|
|
20
|
+
//#endregion
|
|
21
|
+
export { n as FALLBACK_MARQUEE_CONFIG, t as defaultMarqueeConfig };
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export {
|
|
14
|
-
r as MARQUEE_FADE_END_CLASS,
|
|
15
|
-
o as MARQUEE_FADE_START_CLASS,
|
|
16
|
-
t as MARQUEE_SPEED_PRESETS
|
|
2
|
+
//#region src/components/marquee/marquee-styles.ts
|
|
3
|
+
var e = {
|
|
4
|
+
slow: 50,
|
|
5
|
+
normal: 30,
|
|
6
|
+
fast: 15
|
|
7
|
+
}, t = {
|
|
8
|
+
x: "top-0 left-0 h-full w-24 bg-linear-to-r from-background to-transparent",
|
|
9
|
+
y: "top-0 left-0 w-full h-24 bg-linear-to-b from-background to-transparent"
|
|
10
|
+
}, n = {
|
|
11
|
+
x: "top-0 -right-5 h-full w-24 bg-linear-to-l from-background to-transparent",
|
|
12
|
+
y: "bottom-0 left-0 w-full h-24 bg-linear-to-t from-background to-transparent"
|
|
17
13
|
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { n as MARQUEE_FADE_END_CLASS, t as MARQUEE_FADE_START_CLASS, e as MARQUEE_SPEED_PRESETS };
|
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import { ModalConfig } from './modal-config';
|
|
3
|
-
type BaseModalProps = ModalConfig & Omit<HTMLAttributes<HTMLDivElement>, "size">;
|
|
3
|
+
type BaseModalProps = ModalConfig & Omit<HTMLAttributes<HTMLDivElement>, "size" | "content">;
|
|
4
|
+
/**
|
|
5
|
+
* Props for the modal's backdrop overlay.
|
|
6
|
+
*/
|
|
7
|
+
export interface ModalOverlayProps {
|
|
8
|
+
/**
|
|
9
|
+
* Extra classes applied to the backdrop element.
|
|
10
|
+
*/
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Props for the modal's content container.
|
|
15
|
+
*/
|
|
16
|
+
export interface ModalContentProps {
|
|
17
|
+
/**
|
|
18
|
+
* Extra classes applied to the modal content container.
|
|
19
|
+
*/
|
|
20
|
+
className?: string;
|
|
21
|
+
}
|
|
4
22
|
/**
|
|
5
23
|
* Configuration options for the Modal component.
|
|
6
24
|
*/
|
|
@@ -32,15 +50,13 @@ export interface ModalProps extends BaseModalProps {
|
|
|
32
50
|
*/
|
|
33
51
|
height?: string;
|
|
34
52
|
/**
|
|
35
|
-
* Backdrop overlay
|
|
36
|
-
* Extra classes applied to the backdrop element.
|
|
53
|
+
* Backdrop overlay overrides, including its class override.
|
|
37
54
|
*/
|
|
38
|
-
|
|
55
|
+
overlay?: ModalOverlayProps;
|
|
39
56
|
/**
|
|
40
|
-
* Content container
|
|
41
|
-
* Extra classes applied to the modal content container.
|
|
57
|
+
* Content container overrides, including its class override.
|
|
42
58
|
*/
|
|
43
|
-
|
|
59
|
+
content?: ModalContentProps;
|
|
44
60
|
}
|
|
45
61
|
/**
|
|
46
62
|
* A dialog overlay with backdrop, scroll locking, and configurable animations.
|
|
@@ -68,8 +84,8 @@ export interface ModalProps extends BaseModalProps {
|
|
|
68
84
|
* @param props.closeOnEscape - Whether pressing Escape closes the modal. Defaults to true.
|
|
69
85
|
* @param props.width - Width override for the modal.
|
|
70
86
|
* @param props.height - Height override for the modal.
|
|
71
|
-
* @param props.
|
|
72
|
-
* @param props.
|
|
87
|
+
* @param props.overlay - Backdrop overlay overrides (className).
|
|
88
|
+
* @param props.content - Content container overrides (className).
|
|
73
89
|
* @param props.children - The modal content.
|
|
74
90
|
*
|
|
75
91
|
* @example
|
|
@@ -118,7 +134,7 @@ export interface ModalProps extends BaseModalProps {
|
|
|
118
134
|
* @see ModalConfig - The configuration type for component defaults.
|
|
119
135
|
* @see useAsheeConfig - Hook for accessing the global configuration.
|
|
120
136
|
*/
|
|
121
|
-
export declare function Modal({ isOpen, onClose, children, width, height, size, position: positionProp, radius, animated: animatedProp, closeOnBackdropClick: closeOnBackdropClickProp, closeOnEscape: closeOnEscapeProp,
|
|
137
|
+
export declare function Modal({ isOpen, onClose, children, width, height, size, position: positionProp, radius, animated: animatedProp, closeOnBackdropClick: closeOnBackdropClickProp, closeOnEscape: closeOnEscapeProp, overlay, content, className, style, ...props }: ModalProps): import("react").JSX.Element | null;
|
|
122
138
|
export declare namespace Modal {
|
|
123
139
|
var displayName: string;
|
|
124
140
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/components/modal/Modal.tsx"],"names":[],"mappings":"AASA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/components/modal/Modal.tsx"],"names":[],"mappings":"AASA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AAUf,OAAO,EAEL,KAAK,WAAW,EAGjB,MAAM,gBAAgB,CAAC;AAGxB,KAAK,cAAc,GAAG,WAAW,GAC/B,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,UAAW,SAAQ,cAAc;IAChD;;;OAGG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB;;;OAGG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAE5B;;OAEG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2EG;AACH,wBAAgB,KAAK,CAAC,EACpB,MAAM,EACN,OAAO,EACP,QAAQ,EACR,KAAK,EACL,MAAM,EACN,IAAI,EACJ,QAAQ,EAAE,YAAY,EACtB,MAAM,EACN,QAAQ,EAAE,YAAY,EACtB,oBAAoB,EAAE,wBAAwB,EAC9C,aAAa,EAAE,iBAAiB,EAChC,OAAO,EACP,OAAO,EACP,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EAAE,UAAU,sCAkKZ;yBAnLe,KAAK"}
|