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,172 +1,165 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { Button as
|
|
6
|
-
import { KEYBOARD_KEY_SIZE_CLASS as
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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 { Button as n } from "../button/Button.js";
|
|
6
|
+
import { KEYBOARD_KEY_SIZE_CLASS as r, KEYBOARD_SIZE_CLASS as i } from "./keyboard-styles.js";
|
|
7
|
+
import { useCallback as a, useEffect as o, useMemo as s, useState as c } from "react";
|
|
8
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
9
|
+
import { FloatingPortal as u } from "@floating-ui/react";
|
|
10
|
+
//#region src/components/keyboard/OnScreenKeyboard.tsx
|
|
11
|
+
function d(e) {
|
|
12
|
+
return e === "{space}" ? "flex-[4]" : [
|
|
13
|
+
"{bksp}",
|
|
14
|
+
"{enter}",
|
|
15
|
+
"{shift}",
|
|
16
|
+
"{symbols}",
|
|
17
|
+
"{abc}",
|
|
18
|
+
"{clear}"
|
|
19
|
+
].includes(e) ? "flex-[1.6]" : "flex-1";
|
|
12
20
|
}
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
});
|
|
21
|
+
function f(e, t, n) {
|
|
22
|
+
let r = Object.getPrototypeOf(e), i = Object.getOwnPropertyDescriptor(r, "value")?.set;
|
|
23
|
+
i ? i.call(e, t) : e.value = t, e.dispatchEvent(new Event("input", { bubbles: !0 })), requestAnimationFrame(() => {
|
|
24
|
+
e.focus(), e.setSelectionRange(n, n);
|
|
25
|
+
});
|
|
19
26
|
}
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
27
|
+
function p(e, t, n) {
|
|
28
|
+
return t === n ? t === 0 ? {
|
|
29
|
+
value: e,
|
|
30
|
+
cursor: 0
|
|
31
|
+
} : {
|
|
32
|
+
value: e.slice(0, t - 1) + e.slice(n),
|
|
33
|
+
cursor: t - 1
|
|
34
|
+
} : {
|
|
35
|
+
value: e.slice(0, t) + e.slice(n),
|
|
36
|
+
cursor: t
|
|
37
|
+
};
|
|
25
38
|
}
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
39
|
+
function m(e) {
|
|
40
|
+
return (t, n, r) => ({
|
|
41
|
+
value: t.slice(0, n) + e + t.slice(r),
|
|
42
|
+
cursor: n + e.length
|
|
43
|
+
});
|
|
31
44
|
}
|
|
32
|
-
function
|
|
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
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
onClick: () => q(n),
|
|
151
|
-
onMouseEnter: () => g(n),
|
|
152
|
-
onMouseLeave: () => g(null),
|
|
153
|
-
className: B(
|
|
154
|
-
"font-medium p-0 flex items-center justify-center",
|
|
155
|
-
U,
|
|
156
|
-
z(n),
|
|
157
|
-
O
|
|
158
|
-
),
|
|
159
|
-
children: d
|
|
160
|
-
},
|
|
161
|
-
l
|
|
162
|
-
);
|
|
163
|
-
}) }, s.id)) })
|
|
164
|
-
}
|
|
165
|
-
)
|
|
166
|
-
}
|
|
167
|
-
);
|
|
168
|
-
return H ? /* @__PURE__ */ p(V, { children: C }) : C;
|
|
45
|
+
function h({ isOpen: h, activeElement: g, config: _, currentLayout: v, setLayout: y, forceClose: b, size: x, variant: S, color: C, radius: w, portal: T, className: E, keyClassName: D, disabled: O = !1 }) {
|
|
46
|
+
let k = _.layouts ?? {}, A = _.display ?? {}, j = _.defaultLayout ?? "default", M = _.autoShiftBack ?? !0, [N, P] = c(/* @__PURE__ */ new Set()), [F, I] = c(null);
|
|
47
|
+
o(() => {
|
|
48
|
+
h && y(j);
|
|
49
|
+
}, [
|
|
50
|
+
h,
|
|
51
|
+
j,
|
|
52
|
+
y
|
|
53
|
+
]);
|
|
54
|
+
let L = s(() => (k[v] || k[j] || []).map((e, t) => ({
|
|
55
|
+
id: `${v}-row-${t}`,
|
|
56
|
+
keys: e.split(" ").map((e, n) => ({
|
|
57
|
+
id: `${v}-r${t}-k${n}-${e}`,
|
|
58
|
+
token: e
|
|
59
|
+
}))
|
|
60
|
+
})), [
|
|
61
|
+
k,
|
|
62
|
+
v,
|
|
63
|
+
j
|
|
64
|
+
]);
|
|
65
|
+
o(() => {
|
|
66
|
+
if (!h || O) return;
|
|
67
|
+
let e = (k[v] || []).join(" ").split(" "), t = (t) => t === "Backspace" ? "{bksp}" : t === "Enter" ? "{enter}" : t === " " ? "{space}" : t === "Shift" ? "{shift}" : t.length === 1 && e.includes(t) ? t : null, n = (e) => {
|
|
68
|
+
if (e.key === "Escape") {
|
|
69
|
+
b();
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
let n = t(e.key);
|
|
73
|
+
n && P((e) => new Set(e).add(n));
|
|
74
|
+
}, r = (e) => {
|
|
75
|
+
let n = t(e.key);
|
|
76
|
+
n && P((e) => {
|
|
77
|
+
let t = new Set(e);
|
|
78
|
+
return t.delete(n), t;
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
return window.addEventListener("keydown", n), window.addEventListener("keyup", r), () => {
|
|
82
|
+
window.removeEventListener("keydown", n), window.removeEventListener("keyup", r);
|
|
83
|
+
};
|
|
84
|
+
}, [
|
|
85
|
+
h,
|
|
86
|
+
v,
|
|
87
|
+
k,
|
|
88
|
+
b,
|
|
89
|
+
O
|
|
90
|
+
]);
|
|
91
|
+
let R = a((e) => {
|
|
92
|
+
if (!g) return;
|
|
93
|
+
let t = g.value, { value: n, cursor: r } = e(t, g.selectionStart ?? t.length, g.selectionEnd ?? t.length);
|
|
94
|
+
f(g, n, r);
|
|
95
|
+
}, [g]), z = a((e) => {
|
|
96
|
+
if (!O) {
|
|
97
|
+
if (e === "{shift}") {
|
|
98
|
+
y(v === "shift" ? j : v === j ? "shift" : v);
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
if (e === "{symbols}") {
|
|
102
|
+
y("symbols");
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
if (e === "{abc}") {
|
|
106
|
+
y(j);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
if (e === "{clear}") {
|
|
110
|
+
g && f(g, "", 0);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
if (e === "{enter}") {
|
|
114
|
+
g?.tagName === "TEXTAREA" ? R(m("\n")) : g?.blur();
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
if (e === "{bksp}") {
|
|
118
|
+
R(p);
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
R(m(e === "{space}" ? " " : e)), v === "shift" && M && y(j);
|
|
122
|
+
}
|
|
123
|
+
}, [
|
|
124
|
+
g,
|
|
125
|
+
R,
|
|
126
|
+
v,
|
|
127
|
+
M,
|
|
128
|
+
j,
|
|
129
|
+
O,
|
|
130
|
+
y
|
|
131
|
+
]);
|
|
132
|
+
if (!h || O) return null;
|
|
133
|
+
let B = i[x] || i.md, V = r[x] || r.md, H = /* @__PURE__ */ l("section", {
|
|
134
|
+
"aria-label": "Virtual Keyboard",
|
|
135
|
+
className: "fixed inset-x-0 bottom-0 pointer-events-auto",
|
|
136
|
+
style: { zIndex: t.docked },
|
|
137
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
138
|
+
children: /* @__PURE__ */ l("div", {
|
|
139
|
+
className: e("w-full bg-background border-t border-border shadow-2xl flex flex-col select-none", B, E),
|
|
140
|
+
children: /* @__PURE__ */ l("div", {
|
|
141
|
+
className: "flex flex-col gap-1.5 p-2 flex-1 min-h-0",
|
|
142
|
+
children: L.map((t) => /* @__PURE__ */ l("div", {
|
|
143
|
+
className: "flex gap-1.5 flex-1",
|
|
144
|
+
children: t.keys.map(({ id: t, token: r }) => {
|
|
145
|
+
let i = N.has(r) || F === r, a = A[r] ?? r;
|
|
146
|
+
return /* @__PURE__ */ l(n, {
|
|
147
|
+
variant: S,
|
|
148
|
+
color: i ? C : "secondary",
|
|
149
|
+
radius: w,
|
|
150
|
+
size: x,
|
|
151
|
+
onClick: () => z(r),
|
|
152
|
+
onMouseEnter: () => I(r),
|
|
153
|
+
onMouseLeave: () => I(null),
|
|
154
|
+
className: e("font-medium p-0 flex items-center justify-center", V, d(r), D),
|
|
155
|
+
children: a
|
|
156
|
+
}, t);
|
|
157
|
+
})
|
|
158
|
+
}, t.id))
|
|
159
|
+
})
|
|
160
|
+
})
|
|
161
|
+
});
|
|
162
|
+
return T ? /* @__PURE__ */ l(u, { children: H }) : H;
|
|
169
163
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
};
|
|
164
|
+
//#endregion
|
|
165
|
+
export { h as OnScreenKeyboard };
|
|
@@ -1,61 +1,63 @@
|
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
3
|
+
//#region src/components/keyboard/keyboard-config.ts
|
|
4
|
+
var t = {
|
|
5
|
+
default: [
|
|
6
|
+
"1 2 3 4 5 6 7 8 9 0 {bksp}",
|
|
7
|
+
"q w e r t y u i o p",
|
|
8
|
+
"a s d f g h j k l",
|
|
9
|
+
"{shift} z x c v b n m {shift}",
|
|
10
|
+
"{symbols} , {space} . {enter}"
|
|
11
|
+
],
|
|
12
|
+
shift: [
|
|
13
|
+
"1 2 3 4 5 6 7 8 9 0 {bksp}",
|
|
14
|
+
"Q W E R T Y U I O P",
|
|
15
|
+
"A S D F G H J K L",
|
|
16
|
+
"{shift} Z X C V B N M {shift}",
|
|
17
|
+
"{symbols} , {space} . {enter}"
|
|
18
|
+
],
|
|
19
|
+
symbols: [
|
|
20
|
+
"1 2 3 4 5 6 7 8 9 0 {bksp}",
|
|
21
|
+
"@ # $ _ & - + ( )",
|
|
22
|
+
"* \" ' : ; ! ? %",
|
|
23
|
+
"{abc} / \\ ~ ` = {abc}",
|
|
24
|
+
"{abc} , {space} . {enter}"
|
|
25
|
+
],
|
|
26
|
+
numeric: [
|
|
27
|
+
"1 2 3 {bksp}",
|
|
28
|
+
"4 5 6 {clear}",
|
|
29
|
+
"7 8 9 {enter}",
|
|
30
|
+
"0 . {space}"
|
|
31
|
+
]
|
|
32
|
+
}, n = {
|
|
33
|
+
"{bksp}": "⌫",
|
|
34
|
+
"{enter}": "↵",
|
|
35
|
+
"{shift}": "⇧",
|
|
36
|
+
"{symbols}": "?123",
|
|
37
|
+
"{abc}": "ABC",
|
|
38
|
+
"{space}": "space",
|
|
39
|
+
"{clear}": "C"
|
|
40
|
+
}, r = {
|
|
41
|
+
layouts: t,
|
|
42
|
+
display: n,
|
|
43
|
+
defaultLayout: "default",
|
|
44
|
+
closeDelay: 500,
|
|
45
|
+
autoShiftBack: !0,
|
|
46
|
+
size: "md",
|
|
47
|
+
portal: !0,
|
|
48
|
+
disabled: !1
|
|
43
49
|
};
|
|
44
|
-
e("keyboard",
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
};
|
|
56
|
-
export {
|
|
57
|
-
o as FALLBACK_KEYBOARD_CONFIG,
|
|
58
|
-
s as defaultKeyDisplay,
|
|
59
|
-
t as defaultKeyboardConfig,
|
|
60
|
-
a as defaultKeyboardLayouts
|
|
50
|
+
e("keyboard", r);
|
|
51
|
+
var i = {
|
|
52
|
+
defaultLayout: "default",
|
|
53
|
+
size: "md",
|
|
54
|
+
variant: "solid",
|
|
55
|
+
color: "primary",
|
|
56
|
+
radius: "md",
|
|
57
|
+
portal: !0,
|
|
58
|
+
disabled: !1,
|
|
59
|
+
closeDelay: 500,
|
|
60
|
+
autoShiftBack: !0
|
|
61
61
|
};
|
|
62
|
+
//#endregion
|
|
63
|
+
export { i as FALLBACK_KEYBOARD_CONFIG, n as defaultKeyDisplay, r as defaultKeyboardConfig, t as defaultKeyboardLayouts };
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
//#region src/components/keyboard/keyboard-styles.ts
|
|
3
|
+
var e = {
|
|
4
|
+
sm: "h-48 sm:h-56",
|
|
5
|
+
md: "h-56 sm:h-64",
|
|
6
|
+
lg: "h-64 sm:h-72"
|
|
6
7
|
}, t = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
export {
|
|
12
|
-
t as KEYBOARD_KEY_SIZE_CLASS,
|
|
13
|
-
s as KEYBOARD_SIZE_CLASS
|
|
8
|
+
sm: "text-xs gap-1",
|
|
9
|
+
md: "text-sm sm:text-base gap-1.5",
|
|
10
|
+
lg: "text-base sm:text-lg gap-2"
|
|
14
11
|
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { t as KEYBOARD_KEY_SIZE_CLASS, e as KEYBOARD_SIZE_CLASS };
|
|
@@ -1,23 +1,31 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
import { KeyboardContext as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
2
|
+
"use client";
|
|
3
|
+
import { KeyboardContext as e } from "./KeyboardContext.js";
|
|
4
|
+
import { useCallback as t, useContext as n } from "react";
|
|
5
|
+
//#region src/components/keyboard/use-keyboard-field.ts
|
|
6
|
+
function r(r, i, a = !1, o) {
|
|
7
|
+
let s = n(e);
|
|
8
|
+
return {
|
|
9
|
+
handleFocus: t((e) => {
|
|
10
|
+
if (!a || !s || s.isDisabled) return;
|
|
11
|
+
let t = e?.currentTarget ?? i?.current;
|
|
12
|
+
t && s.openKeyboard(r, t, o);
|
|
13
|
+
}, [
|
|
14
|
+
r,
|
|
15
|
+
i,
|
|
16
|
+
a,
|
|
17
|
+
s,
|
|
18
|
+
o
|
|
19
|
+
]),
|
|
20
|
+
handleBlur: t(() => {
|
|
21
|
+
a && s && !s.isDisabled && s.requestClose(r);
|
|
22
|
+
}, [
|
|
23
|
+
r,
|
|
24
|
+
a,
|
|
25
|
+
s
|
|
26
|
+
]),
|
|
27
|
+
hasProvider: !!s
|
|
28
|
+
};
|
|
20
29
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
};
|
|
30
|
+
//#endregion
|
|
31
|
+
export { r as useKeyboardField };
|