asheeui 0.6.14 → 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/README.md +1 -14
- 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,151 +1,66 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import { useAsheeConfig as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
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
|
-
e == null ? void 0 : e.color,
|
|
68
|
-
d.defaultColor,
|
|
69
|
-
r.color
|
|
70
|
-
), J = te(
|
|
71
|
-
typeof f == "string" ? f : void 0,
|
|
72
|
-
typeof (e == null ? void 0 : e.radius) == "string" ? e.radius : void 0,
|
|
73
|
-
d.defaultRadius,
|
|
74
|
-
r.radius
|
|
75
|
-
), s = z ?? r.status, M = s === "error" ? "danger" : s === "success" ? "success" : s === "warning" ? "warning" : Z, Q = u(
|
|
76
|
-
j,
|
|
77
|
-
e == null ? void 0 : e.labelAlign,
|
|
78
|
-
void 0,
|
|
79
|
-
r.labelAlign
|
|
80
|
-
), W = pe(
|
|
81
|
-
R,
|
|
82
|
-
M
|
|
83
|
-
), X = s !== "default" ? ne[s] : "", Y = R === "underlined" ? "rounded-none" : ie(
|
|
84
|
-
J,
|
|
85
|
-
me,
|
|
86
|
-
r.radius
|
|
87
|
-
);
|
|
88
|
-
return /* @__PURE__ */ c(
|
|
89
|
-
de,
|
|
90
|
-
{
|
|
91
|
-
id: l,
|
|
92
|
-
label: E,
|
|
93
|
-
labelAlign: Q,
|
|
94
|
-
description: v,
|
|
95
|
-
descriptionId: I,
|
|
96
|
-
message: y,
|
|
97
|
-
messageId: S,
|
|
98
|
-
status: s,
|
|
99
|
-
required: b,
|
|
100
|
-
isLoading: h,
|
|
101
|
-
children: /* @__PURE__ */ q("div", { className: "relative flex items-center w-full", children: [
|
|
102
|
-
p && /* @__PURE__ */ c("span", { className: "absolute left-3 z-10 flex items-center pointer-events-none text-foreground/50", children: p }),
|
|
103
|
-
/* @__PURE__ */ c(
|
|
104
|
-
"input",
|
|
105
|
-
{
|
|
106
|
-
ref: m,
|
|
107
|
-
id: l,
|
|
108
|
-
disabled: T,
|
|
109
|
-
required: b,
|
|
110
|
-
autoComplete: "off",
|
|
111
|
-
"aria-invalid": s === "error",
|
|
112
|
-
"aria-describedby": P,
|
|
113
|
-
"aria-busy": h,
|
|
114
|
-
onFocus: G,
|
|
115
|
-
onBlur: H,
|
|
116
|
-
className: N(
|
|
117
|
-
"w-full text-foreground outline-none transition-colors shrink-0",
|
|
118
|
-
"focus-visible:ring-2 focus-visible:ring-offset-2",
|
|
119
|
-
"disabled:pointer-events-none disabled:opacity-50",
|
|
120
|
-
ce[V],
|
|
121
|
-
W,
|
|
122
|
-
X,
|
|
123
|
-
Y,
|
|
124
|
-
p && "pl-11",
|
|
125
|
-
o && "pr-11",
|
|
126
|
-
F
|
|
127
|
-
),
|
|
128
|
-
style: U,
|
|
129
|
-
...k
|
|
130
|
-
}
|
|
131
|
-
),
|
|
132
|
-
o && /* @__PURE__ */ c(
|
|
133
|
-
"span",
|
|
134
|
-
{
|
|
135
|
-
className: N(
|
|
136
|
-
"absolute right-3 z-10 flex items-center",
|
|
137
|
-
typeof o == "string" || ee.isValidElement(o) && o.type === "span" ? "pointer-events-none" : "",
|
|
138
|
-
"text-foreground/50"
|
|
139
|
-
),
|
|
140
|
-
children: o
|
|
141
|
-
}
|
|
142
|
-
)
|
|
143
|
-
] })
|
|
144
|
-
}
|
|
145
|
-
);
|
|
146
|
-
}
|
|
147
|
-
);
|
|
148
|
-
fe.displayName = "Input";
|
|
149
|
-
export {
|
|
150
|
-
fe as Input
|
|
151
|
-
};
|
|
2
|
+
"use client";
|
|
3
|
+
import { cn as e } from "../../utils/cn.js";
|
|
4
|
+
import { useAsheeConfig as t } from "../../libs/context.js";
|
|
5
|
+
import { RADIUS_CLASS as n } from "../../shared/radius.js";
|
|
6
|
+
import { resolveVariantClass as r } from "../../shared/variant.js";
|
|
7
|
+
import { resolveCascade as i, resolveClassKey as a, resolveRadiusKey as o } from "../../utils/resolve-token.js";
|
|
8
|
+
import { FieldShell as s } from "../field/FieldShell.js";
|
|
9
|
+
import { FALLBACK_FIELD_CONFIG as c } from "../field/field-config.js";
|
|
10
|
+
import { useKeyboardField as l } from "../keyboard/use-keyboard-field.js";
|
|
11
|
+
import { INPUT_SIZE_CLASS as u, INPUT_STATUS_BORDER_CLASS as ee } from "./input-styles.js";
|
|
12
|
+
import d, { forwardRef as f, useCallback as p, useId as m, useImperativeHandle as h, useRef as te } from "react";
|
|
13
|
+
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
14
|
+
//#region src/components/input/Input.tsx
|
|
15
|
+
var v = f(({ size: f, radius: v, variant: y, color: b, status: x, label: S, labelAlign: C, description: w, message: T, required: E, isLoading: D, id: O, className: k, disabled: A, startContent: j, endContent: M, style: N, onFocus: P, onBlur: F, enableVirtualKeyboard: I = !0, ...L }, R) => {
|
|
16
|
+
let z = t(), B = z.components?.input, V = te(null);
|
|
17
|
+
h(R, () => V.current);
|
|
18
|
+
let H = m(), U = O ?? H, W = w ? `${U}-description` : void 0, G = T ? `${U}-message` : void 0, K = [W, G].filter(Boolean).join(" ") || void 0, { handleFocus: q, handleBlur: J } = l(U, V, !!I, typeof I == "object" && I ? I : void 0), Y = p((e) => {
|
|
19
|
+
q(e), P?.(e);
|
|
20
|
+
}, [q, P]), X = p((e) => {
|
|
21
|
+
J(), F?.(e);
|
|
22
|
+
}, [J, F]), Z = i(f, B?.size, void 0, c.size), Q = i(y, B?.variant, z.defaultVariant, c.variant), ne = i(b, B?.color, z.defaultColor, c.color), re = o(typeof v == "string" ? v : void 0, typeof B?.radius == "string" ? B.radius : void 0, z.defaultRadius, c.radius), $ = x ?? c.status, ie = $ === "error" ? "danger" : $ === "success" ? "success" : $ === "warning" ? "warning" : ne, ae = i(C, B?.labelAlign, void 0, c.labelAlign), oe = r(Q, ie), se = $ === "default" ? "" : ee[$], ce = Q === "underlined" ? "rounded-none" : a(re, n, c.radius);
|
|
23
|
+
return /* @__PURE__ */ g(s, {
|
|
24
|
+
id: U,
|
|
25
|
+
label: S,
|
|
26
|
+
labelAlign: ae,
|
|
27
|
+
description: w,
|
|
28
|
+
descriptionId: W,
|
|
29
|
+
message: T,
|
|
30
|
+
messageId: G,
|
|
31
|
+
status: $,
|
|
32
|
+
required: E,
|
|
33
|
+
isLoading: D,
|
|
34
|
+
children: /* @__PURE__ */ _("div", {
|
|
35
|
+
className: "relative flex items-center w-full",
|
|
36
|
+
children: [
|
|
37
|
+
j && /* @__PURE__ */ g("span", {
|
|
38
|
+
className: "absolute left-3 z-10 flex items-center pointer-events-none text-foreground/50",
|
|
39
|
+
children: j
|
|
40
|
+
}),
|
|
41
|
+
/* @__PURE__ */ g("input", {
|
|
42
|
+
ref: V,
|
|
43
|
+
id: U,
|
|
44
|
+
disabled: A,
|
|
45
|
+
required: E,
|
|
46
|
+
autoComplete: "off",
|
|
47
|
+
"aria-invalid": $ === "error",
|
|
48
|
+
"aria-describedby": K,
|
|
49
|
+
"aria-busy": D,
|
|
50
|
+
onFocus: Y,
|
|
51
|
+
onBlur: X,
|
|
52
|
+
className: e("w-full text-foreground outline-none transition-colors shrink-0", "focus-visible:ring-2 focus-visible:ring-offset-2", "disabled:pointer-events-none disabled:opacity-50", u[Z], oe, se, ce, j && "pl-11", M && "pr-11", k),
|
|
53
|
+
style: N,
|
|
54
|
+
...L
|
|
55
|
+
}),
|
|
56
|
+
M && /* @__PURE__ */ g("span", {
|
|
57
|
+
className: e("absolute right-3 z-10 flex items-center", typeof M == "string" || d.isValidElement(M) && M.type === "span" ? "pointer-events-none" : "", "text-foreground/50"),
|
|
58
|
+
children: M
|
|
59
|
+
})
|
|
60
|
+
]
|
|
61
|
+
})
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
v.displayName = "Input";
|
|
65
|
+
//#endregion
|
|
66
|
+
export { v as Input };
|
|
@@ -1,51 +1,32 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
import { forwardRef as d, useState as w } from "react";
|
|
4
|
-
import { EyeIcon as l } from "../../icons/EyeIcon.js";
|
|
5
|
-
import { EyeOffIcon as y } from "../../icons/EyeOffIcon.js";
|
|
6
|
-
import { Input as x } from "./Input.js";
|
|
2
|
+
"use client";
|
|
7
3
|
import { cn as e } from "../../utils/cn.js";
|
|
8
|
-
|
|
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
|
-
"focus:outline-none focus-visible:ring-2 focus-visible:ring-primary",
|
|
38
|
-
t && "pointer-events-none opacity-50"
|
|
39
|
-
),
|
|
40
|
-
children: o ? p ?? /* @__PURE__ */ r(y, {}) : i ?? /* @__PURE__ */ r(l, {})
|
|
41
|
-
}
|
|
42
|
-
),
|
|
43
|
-
...c
|
|
44
|
-
}
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
);
|
|
48
|
-
I.displayName = "PasswordInput";
|
|
49
|
-
export {
|
|
50
|
-
I as PasswordInput
|
|
51
|
-
};
|
|
4
|
+
import { Input as t } from "./Input.js";
|
|
5
|
+
import { EyeIcon as n } from "../../icons/EyeIcon.js";
|
|
6
|
+
import { EyeOffIcon as r } from "../../icons/EyeOffIcon.js";
|
|
7
|
+
import { forwardRef as i, useState as a } from "react";
|
|
8
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
9
|
+
//#region src/components/input/PasswordInput.tsx
|
|
10
|
+
var s = i(({ disabled: i, className: s, toggleAriaLabel: c, offIcon: l, onIcon: u, autoComplete: d = "current-password", ...f }, p) => {
|
|
11
|
+
let [m, h] = a(!1);
|
|
12
|
+
return /* @__PURE__ */ o(t, {
|
|
13
|
+
ref: p,
|
|
14
|
+
type: m ? "text" : "password",
|
|
15
|
+
disabled: i,
|
|
16
|
+
autoComplete: d,
|
|
17
|
+
className: e("pr-10", s),
|
|
18
|
+
endContent: /* @__PURE__ */ o("button", {
|
|
19
|
+
type: "button",
|
|
20
|
+
tabIndex: -1,
|
|
21
|
+
disabled: i,
|
|
22
|
+
onClick: () => h((e) => !e),
|
|
23
|
+
"aria-label": c ? c(m) : m ? "Hide password" : "Show password",
|
|
24
|
+
className: e("p-1 rounded text-foreground/70 hover:text-foreground transition-colors", "focus:outline-none focus-visible:ring-2 focus-visible:ring-primary", i && "pointer-events-none opacity-50"),
|
|
25
|
+
children: m ? l ?? /* @__PURE__ */ o(r, {}) : u ?? /* @__PURE__ */ o(n, {})
|
|
26
|
+
}),
|
|
27
|
+
...f
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
s.displayName = "PasswordInput";
|
|
31
|
+
//#endregion
|
|
32
|
+
export { s as PasswordInput };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { registerComponentDefaults as
|
|
3
|
-
import { defaultFieldConfig as
|
|
4
|
-
|
|
5
|
-
t
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
2
|
+
import { registerComponentDefaults as e } from "../../libs/registry.js";
|
|
3
|
+
import { defaultFieldConfig as t } from "../field/field-config.js";
|
|
4
|
+
//#region src/components/input/input-config.ts
|
|
5
|
+
var n = t;
|
|
6
|
+
e("input", n);
|
|
7
|
+
//#endregion
|
|
8
|
+
export { n as defaultInputConfig };
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { FIELD_STATUS_BORDER_CLASS as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
2
|
+
import { FIELD_STATUS_BORDER_CLASS as e } from "../field/field-styles.js";
|
|
3
|
+
//#region src/components/input/input-styles.ts
|
|
4
|
+
var t = {
|
|
5
|
+
sm: "h-8 px-2.5 text-xs",
|
|
6
|
+
md: "h-10 px-3 text-sm",
|
|
7
|
+
lg: "h-12 px-4 text-base"
|
|
8
|
+
}, n = e;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { t as INPUT_SIZE_CLASS, n as INPUT_STATUS_BORDER_CLASS };
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
"use client";
|
|
3
|
+
import { createContext as e, useContext as t } from "react";
|
|
4
|
+
//#region src/components/keyboard/KeyboardContext.tsx
|
|
5
|
+
var n = e(null);
|
|
6
|
+
function r() {
|
|
7
|
+
let e = t(n);
|
|
8
|
+
if (!e) throw Error("useKeyboard must be used within a <KeyboardProvider>");
|
|
9
|
+
return e;
|
|
9
10
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
u as useKeyboard
|
|
13
|
-
};
|
|
11
|
+
//#endregion
|
|
12
|
+
export { n as KeyboardContext, r as useKeyboard };
|
|
@@ -1,183 +1,102 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
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
|
-
|
|
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
|
-
i,
|
|
101
|
-
r
|
|
102
|
-
]
|
|
103
|
-
), _ = y(
|
|
104
|
-
(p, k, L) => {
|
|
105
|
-
if (r) return;
|
|
106
|
-
s.current && (clearTimeout(s.current), s.current = null), S(p), A(k), B(L || {});
|
|
107
|
-
const lt = (L == null ? void 0 : L.layout) ?? d;
|
|
108
|
-
F(lt), O(!0);
|
|
109
|
-
},
|
|
110
|
-
[r, d]
|
|
111
|
-
), q = y(
|
|
112
|
-
(p) => {
|
|
113
|
-
r || (s.current && clearTimeout(s.current), s.current = setTimeout(() => {
|
|
114
|
-
S((k) => (k === p && (O(!1), A(null), B({})), k)), s.current = null;
|
|
115
|
-
}, E));
|
|
116
|
-
},
|
|
117
|
-
[r, E]
|
|
118
|
-
), T = y(() => {
|
|
119
|
-
s.current && (clearTimeout(s.current), s.current = null), O(!1), A(null), S(null), B({});
|
|
120
|
-
}, []), x = y((p) => {
|
|
121
|
-
F(p);
|
|
122
|
-
}, []), K = M(
|
|
123
|
-
() => ({
|
|
124
|
-
isOpen: D,
|
|
125
|
-
activeInputId: j,
|
|
126
|
-
activeElement: z,
|
|
127
|
-
config: I,
|
|
128
|
-
resolvedSize: a,
|
|
129
|
-
resolvedVariant: u,
|
|
130
|
-
resolvedColor: c,
|
|
131
|
-
resolvedRadius: n,
|
|
132
|
-
resolvedPortal: i,
|
|
133
|
-
openKeyboard: _,
|
|
134
|
-
requestClose: q,
|
|
135
|
-
forceClose: T,
|
|
136
|
-
setLayout: x,
|
|
137
|
-
currentLayout: R,
|
|
138
|
-
isDisabled: r
|
|
139
|
-
}),
|
|
140
|
-
[
|
|
141
|
-
D,
|
|
142
|
-
j,
|
|
143
|
-
z,
|
|
144
|
-
I,
|
|
145
|
-
a,
|
|
146
|
-
u,
|
|
147
|
-
c,
|
|
148
|
-
n,
|
|
149
|
-
i,
|
|
150
|
-
_,
|
|
151
|
-
q,
|
|
152
|
-
T,
|
|
153
|
-
x,
|
|
154
|
-
R,
|
|
155
|
-
r
|
|
156
|
-
]
|
|
157
|
-
), h = v.size ?? a, g = v.variant ?? u, tt = v.color ?? c, st = v.radius ?? n, rt = v.portal ?? i;
|
|
158
|
-
return /* @__PURE__ */ ot(nt.Provider, { value: K, children: [
|
|
159
|
-
U,
|
|
160
|
-
/* @__PURE__ */ et(
|
|
161
|
-
it,
|
|
162
|
-
{
|
|
163
|
-
isOpen: D,
|
|
164
|
-
activeElement: z,
|
|
165
|
-
config: I,
|
|
166
|
-
currentLayout: R,
|
|
167
|
-
setLayout: x,
|
|
168
|
-
forceClose: T,
|
|
169
|
-
size: h,
|
|
170
|
-
variant: g,
|
|
171
|
-
color: tt,
|
|
172
|
-
radius: st,
|
|
173
|
-
portal: rt,
|
|
174
|
-
className: b,
|
|
175
|
-
keyClassName: C,
|
|
176
|
-
disabled: r
|
|
177
|
-
}
|
|
178
|
-
)
|
|
179
|
-
] });
|
|
2
|
+
"use client";
|
|
3
|
+
import { useAsheeConfig as e } from "../../libs/context.js";
|
|
4
|
+
import { resolveCascade as t, resolveRadiusKey as n } from "../../utils/resolve-token.js";
|
|
5
|
+
import { KeyboardContext as r } from "./KeyboardContext.js";
|
|
6
|
+
import { FALLBACK_KEYBOARD_CONFIG as i, defaultKeyboardConfig as a } from "./keyboard-config.js";
|
|
7
|
+
import { OnScreenKeyboard as o } from "./OnScreenKeyboard.js";
|
|
8
|
+
import { useCallback as s, useMemo as c, useRef as l, useState as u } from "react";
|
|
9
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
10
|
+
//#region src/components/keyboard/KeyboardProvider.tsx
|
|
11
|
+
function p({ children: p, layouts: m, display: h, defaultLayout: g, size: _, autoShiftBack: v, closeDelay: y = 120, variant: b, color: x, radius: S, portal: C, disabled: w = !1, className: T, keyClassName: E }) {
|
|
12
|
+
let D = e(), O = D?.components?.keyboard, k = t(_, O?.size, void 0, i.size), A = t(b, O?.variant, D.defaultVariant, i.variant), j = t(x, O?.color, D.defaultColor, i.color), M = n(S, O?.radius, D.defaultRadius, i.radius), N = t(C, O?.portal, void 0, i.portal), P = t(w, O?.disabled, void 0, i.disabled), F = t(g, O?.defaultLayout, void 0, i.defaultLayout), I = t(v, O?.autoShiftBack, void 0, i.autoShiftBack), L = t(y, O?.closeDelay, void 0, i.closeDelay), [R, z] = u(!1), [B, V] = u(null), [H, U] = u(null), [W, G] = u(F), [K, q] = u({}), J = l(null), Y = c(() => ({
|
|
13
|
+
layouts: m ?? O?.layouts ?? a.layouts,
|
|
14
|
+
display: h ?? O?.display ?? a.display,
|
|
15
|
+
defaultLayout: F,
|
|
16
|
+
size: k,
|
|
17
|
+
autoShiftBack: I,
|
|
18
|
+
variant: A,
|
|
19
|
+
color: j,
|
|
20
|
+
radius: M,
|
|
21
|
+
portal: N,
|
|
22
|
+
disabled: P
|
|
23
|
+
}), [
|
|
24
|
+
m,
|
|
25
|
+
O,
|
|
26
|
+
h,
|
|
27
|
+
F,
|
|
28
|
+
k,
|
|
29
|
+
I,
|
|
30
|
+
A,
|
|
31
|
+
j,
|
|
32
|
+
M,
|
|
33
|
+
N,
|
|
34
|
+
P
|
|
35
|
+
]), X = s((e, t, n) => {
|
|
36
|
+
if (P) return;
|
|
37
|
+
J.current &&= (clearTimeout(J.current), null), V(e), U(t), q(n || {});
|
|
38
|
+
let r = n?.layout ?? F;
|
|
39
|
+
G(r), z(!0);
|
|
40
|
+
}, [P, F]), Z = s((e) => {
|
|
41
|
+
P || (J.current && clearTimeout(J.current), J.current = setTimeout(() => {
|
|
42
|
+
V((t) => (t === e && (z(!1), U(null), q({})), t)), J.current = null;
|
|
43
|
+
}, L));
|
|
44
|
+
}, [P, L]), Q = s(() => {
|
|
45
|
+
J.current &&= (clearTimeout(J.current), null), z(!1), U(null), V(null), q({});
|
|
46
|
+
}, []), $ = s((e) => {
|
|
47
|
+
G(e);
|
|
48
|
+
}, []), ee = c(() => ({
|
|
49
|
+
isOpen: R,
|
|
50
|
+
activeInputId: B,
|
|
51
|
+
activeElement: H,
|
|
52
|
+
config: Y,
|
|
53
|
+
resolvedSize: k,
|
|
54
|
+
resolvedVariant: A,
|
|
55
|
+
resolvedColor: j,
|
|
56
|
+
resolvedRadius: M,
|
|
57
|
+
resolvedPortal: N,
|
|
58
|
+
openKeyboard: X,
|
|
59
|
+
requestClose: Z,
|
|
60
|
+
forceClose: Q,
|
|
61
|
+
setLayout: $,
|
|
62
|
+
currentLayout: W,
|
|
63
|
+
isDisabled: P
|
|
64
|
+
}), [
|
|
65
|
+
R,
|
|
66
|
+
B,
|
|
67
|
+
H,
|
|
68
|
+
Y,
|
|
69
|
+
k,
|
|
70
|
+
A,
|
|
71
|
+
j,
|
|
72
|
+
M,
|
|
73
|
+
N,
|
|
74
|
+
X,
|
|
75
|
+
Z,
|
|
76
|
+
Q,
|
|
77
|
+
$,
|
|
78
|
+
W,
|
|
79
|
+
P
|
|
80
|
+
]), te = K.size ?? k, ne = K.variant ?? A, re = K.color ?? j, ie = K.radius ?? M, ae = K.portal ?? N;
|
|
81
|
+
return /* @__PURE__ */ f(r.Provider, {
|
|
82
|
+
value: ee,
|
|
83
|
+
children: [p, /* @__PURE__ */ d(o, {
|
|
84
|
+
isOpen: R,
|
|
85
|
+
activeElement: H,
|
|
86
|
+
config: Y,
|
|
87
|
+
currentLayout: W,
|
|
88
|
+
setLayout: $,
|
|
89
|
+
forceClose: Q,
|
|
90
|
+
size: te,
|
|
91
|
+
variant: ne,
|
|
92
|
+
color: re,
|
|
93
|
+
radius: ie,
|
|
94
|
+
portal: ae,
|
|
95
|
+
className: T,
|
|
96
|
+
keyClassName: E,
|
|
97
|
+
disabled: P
|
|
98
|
+
})]
|
|
99
|
+
});
|
|
180
100
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
};
|
|
101
|
+
//#endregion
|
|
102
|
+
export { p as KeyboardProvider };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OnScreenKeyboard.d.ts","sourceRoot":"","sources":["../../../src/components/keyboard/OnScreenKeyboard.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"OnScreenKeyboard.d.ts","sourceRoot":"","sources":["../../../src/components/keyboard/OnScreenKeyboard.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAI3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,UAAU,EACX,MAAM,mBAAmB,CAAC;AA0E3B;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,aAAa,EAAE,eAAe,GAAG,IAAI,CAAC;IAEtC;;OAEG;IACH,MAAM,EAAE,cAAc,CAAC;IAEvB;;OAEG;IACH,aAAa,EAAE,UAAU,CAAC;IAE1B;;OAEG;IACH,SAAS,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;IAExC;;OAEG;IACH,UAAU,EAAE,MAAM,IAAI,CAAC;IAEvB;;OAEG;IACH,IAAI,EAAE,eAAe,CAAC;IAEtB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,KAAK,EAAE,KAAK,CAAC;IAEb;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EACN,aAAa,EACb,MAAM,EACN,aAAa,EACb,SAAS,EACT,UAAU,EACV,IAAI,EACJ,OAAO,EACP,KAAK,EACL,MAAM,EACN,MAAM,EACN,SAAS,EACT,YAAY,EACZ,QAAgB,GACjB,EAAE,qBAAqB,sCAwNvB"}
|