asheeui 0.6.3 → 0.6.6
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/accordion/Accordion.js +10 -10
- package/dist/components/autocomplete/Autocomplete.d.ts +8 -0
- package/dist/components/autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/components/autocomplete/Autocomplete.js +120 -118
- package/dist/components/autocomplete/autocomplete-config.d.ts +29 -3
- package/dist/components/autocomplete/autocomplete-config.d.ts.map +1 -1
- package/dist/components/autocomplete/autocomplete-config.js +14 -6
- package/dist/components/date-picker/DatePicker.d.ts +20 -0
- package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
- package/dist/components/date-picker/DatePicker.js +230 -229
- package/dist/components/date-picker/date-picker-config.d.ts +16 -0
- package/dist/components/date-picker/date-picker-config.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker-config.js +14 -10
- package/dist/components/keyboard/OnScreenKeyboard.d.ts +16 -6
- package/dist/components/keyboard/OnScreenKeyboard.d.ts.map +1 -1
- package/dist/components/keyboard/OnScreenKeyboard.js +96 -90
- package/dist/components/keyboard/index.js +1 -0
- package/dist/components/keyboard/keyboard-config.d.ts +27 -1
- package/dist/components/keyboard/keyboard-config.d.ts.map +1 -1
- package/dist/components/keyboard/keyboard-config.js +12 -8
- package/dist/components/keyboard/keyboard-context.d.ts +4 -7
- package/dist/components/keyboard/keyboard-context.d.ts.map +1 -1
- package/dist/components/keyboard/keyboard-context.js +61 -58
- package/dist/components/keyboard/keyboard-styles.d.ts +13 -0
- package/dist/components/keyboard/keyboard-styles.d.ts.map +1 -0
- package/dist/components/keyboard/keyboard-styles.js +14 -0
- package/dist/components/multi-select/MultiSelect.d.ts +8 -0
- package/dist/components/multi-select/MultiSelect.d.ts.map +1 -1
- package/dist/components/multi-select/MultiSelect.js +186 -184
- package/dist/components/multi-select/multi-select-config.d.ts +18 -0
- package/dist/components/multi-select/multi-select-config.d.ts.map +1 -1
- package/dist/components/multi-select/multi-select-config.js +14 -10
- package/dist/components/resizable-screen/ResizableScreen.d.ts +23 -11
- package/dist/components/resizable-screen/ResizableScreen.d.ts.map +1 -1
- package/dist/components/resizable-screen/ResizableScreen.js +69 -60
- package/dist/components/select/Select.d.ts +8 -6
- package/dist/components/select/Select.d.ts.map +1 -1
- package/dist/components/select/Select.js +135 -135
- package/dist/components/select/select-config.d.ts +27 -1
- package/dist/components/select/select-config.d.ts.map +1 -1
- package/dist/components/select/select-config.js +14 -6
- package/dist/components/select-menu/SelectMenu.d.ts +23 -1
- package/dist/components/select-menu/SelectMenu.d.ts.map +1 -1
- package/dist/components/select-menu/SelectMenu.js +72 -67
- package/dist/components/select-menu/index.d.ts +1 -0
- package/dist/components/select-menu/index.d.ts.map +1 -1
- package/dist/components/select-menu/index.js +1 -0
- package/dist/components/select-menu/select-menu-config.d.ts +1 -1
- package/dist/components/select-menu/select-menu-config.js +3 -3
- package/dist/components/select-menu/use-select-floating.d.ts +95 -0
- package/dist/components/select-menu/use-select-floating.d.ts.map +1 -0
- package/dist/components/select-menu/use-select-floating.js +36 -0
- package/dist/components/toast/toast-config.d.ts +11 -0
- package/dist/components/toast/toast-config.d.ts.map +1 -1
- package/dist/components/toast/toast-config.js +4 -2
- package/dist/components/toast/toast-context.d.ts +21 -1
- package/dist/components/toast/toast-context.d.ts.map +1 -1
- package/dist/components/toast/toast-context.js +134 -114
- package/dist/components/tooltip/Tooltip.d.ts +19 -0
- package/dist/components/tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/tooltip/Tooltip.js +129 -121
- package/dist/components/tooltip/tooltip-config.d.ts +7 -3
- package/dist/components/tooltip/tooltip-config.d.ts.map +1 -1
- package/dist/components/tooltip/tooltip-config.js +5 -4
- package/dist/config/resolve-config.d.ts.map +1 -1
- package/dist/utils/merge-object.d.ts +7 -1
- package/dist/utils/merge-object.d.ts.map +1 -1
- package/dist/utils/types.d.ts +16 -4
- package/dist/utils/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,87 +1,90 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { createContext as
|
|
4
|
-
import { useAsheeConfig as
|
|
5
|
-
import { defaultKeyboardConfig as
|
|
6
|
-
const q =
|
|
7
|
-
function
|
|
8
|
-
children:
|
|
9
|
-
layouts:
|
|
10
|
-
display:
|
|
11
|
-
defaultLayout:
|
|
12
|
-
|
|
13
|
-
autoShiftBack:
|
|
14
|
-
closeDelay:
|
|
15
|
-
variant:
|
|
16
|
-
color:
|
|
17
|
-
radius:
|
|
2
|
+
import { jsx as F } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as G, useMemo as j, useState as i, useRef as H, useCallback as p, useContext as J } from "react";
|
|
4
|
+
import { useAsheeConfig as N } from "../../libs/context.js";
|
|
5
|
+
import { defaultKeyboardConfig as r } from "./keyboard-config.js";
|
|
6
|
+
const q = G(null);
|
|
7
|
+
function X({
|
|
8
|
+
children: s,
|
|
9
|
+
layouts: v,
|
|
10
|
+
display: f,
|
|
11
|
+
defaultLayout: x,
|
|
12
|
+
size: I,
|
|
13
|
+
autoShiftBack: T,
|
|
14
|
+
closeDelay: d = 120,
|
|
15
|
+
variant: k,
|
|
16
|
+
color: w,
|
|
17
|
+
radius: A,
|
|
18
|
+
portal: E
|
|
18
19
|
}) {
|
|
19
20
|
var R;
|
|
20
|
-
const
|
|
21
|
+
const n = N(), t = (R = n == null ? void 0 : n.components) == null ? void 0 : R.keyboard, S = j(
|
|
21
22
|
() => ({
|
|
22
|
-
layouts:
|
|
23
|
-
display:
|
|
24
|
-
defaultLayout:
|
|
25
|
-
|
|
26
|
-
autoShiftBack:
|
|
27
|
-
variant:
|
|
28
|
-
color:
|
|
29
|
-
radius:
|
|
23
|
+
layouts: v ?? (t == null ? void 0 : t.layouts) ?? r.layouts,
|
|
24
|
+
display: f ?? (t == null ? void 0 : t.display) ?? r.display,
|
|
25
|
+
defaultLayout: x ?? (t == null ? void 0 : t.defaultLayout) ?? r.defaultLayout,
|
|
26
|
+
size: I ?? (t == null ? void 0 : t.size) ?? r.size,
|
|
27
|
+
autoShiftBack: T ?? (t == null ? void 0 : t.autoShiftBack) ?? r.autoShiftBack,
|
|
28
|
+
variant: k ?? (t == null ? void 0 : t.variant),
|
|
29
|
+
color: w ?? (t == null ? void 0 : t.color),
|
|
30
|
+
radius: A ?? (t == null ? void 0 : t.radius),
|
|
31
|
+
portal: E ?? (t == null ? void 0 : t.portal) ?? r.portal
|
|
30
32
|
}),
|
|
31
33
|
[
|
|
32
|
-
f,
|
|
33
|
-
t,
|
|
34
34
|
v,
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
t,
|
|
36
|
+
f,
|
|
37
37
|
x,
|
|
38
|
+
I,
|
|
38
39
|
T,
|
|
39
40
|
k,
|
|
40
|
-
w
|
|
41
|
+
w,
|
|
42
|
+
A,
|
|
43
|
+
E
|
|
41
44
|
]
|
|
42
|
-
), [
|
|
45
|
+
), [m, c] = i(!1), [z, e] = i(null), [B, o] = i(
|
|
43
46
|
null
|
|
44
|
-
), u =
|
|
45
|
-
u.current && (clearTimeout(u.current), u.current = null),
|
|
46
|
-
}, []),
|
|
47
|
+
), u = H(null), L = p((a, l) => {
|
|
48
|
+
u.current && (clearTimeout(u.current), u.current = null), e(a), o(l), c(!0);
|
|
49
|
+
}, []), O = p(
|
|
47
50
|
(a) => {
|
|
48
51
|
u.current && clearTimeout(u.current), u.current = setTimeout(() => {
|
|
49
|
-
|
|
50
|
-
},
|
|
52
|
+
e((l) => (l === a && (c(!1), o(null)), l)), u.current = null;
|
|
53
|
+
}, d);
|
|
51
54
|
},
|
|
52
|
-
[
|
|
53
|
-
),
|
|
54
|
-
u.current && (clearTimeout(u.current), u.current = null), c(!1), o(null),
|
|
55
|
+
[d]
|
|
56
|
+
), P = p(() => {
|
|
57
|
+
u.current && (clearTimeout(u.current), u.current = null), c(!1), o(null), e(null);
|
|
55
58
|
}, []), M = j(
|
|
56
59
|
() => ({
|
|
57
|
-
isOpen:
|
|
58
|
-
activeInputId:
|
|
59
|
-
activeElement:
|
|
60
|
-
config:
|
|
61
|
-
openKeyboard:
|
|
62
|
-
requestClose:
|
|
63
|
-
forceClose:
|
|
60
|
+
isOpen: m,
|
|
61
|
+
activeInputId: z,
|
|
62
|
+
activeElement: B,
|
|
63
|
+
config: S,
|
|
64
|
+
openKeyboard: L,
|
|
65
|
+
requestClose: O,
|
|
66
|
+
forceClose: P
|
|
64
67
|
}),
|
|
65
68
|
[
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
S,
|
|
69
|
-
A,
|
|
69
|
+
m,
|
|
70
|
+
z,
|
|
70
71
|
B,
|
|
72
|
+
S,
|
|
71
73
|
L,
|
|
72
|
-
O
|
|
74
|
+
O,
|
|
75
|
+
P
|
|
73
76
|
]
|
|
74
77
|
);
|
|
75
|
-
return /* @__PURE__ */
|
|
78
|
+
return /* @__PURE__ */ F(q.Provider, { value: M, children: s });
|
|
76
79
|
}
|
|
77
|
-
function
|
|
78
|
-
const
|
|
79
|
-
if (!
|
|
80
|
+
function Y() {
|
|
81
|
+
const s = J(q);
|
|
82
|
+
if (!s)
|
|
80
83
|
throw new Error("useKeyboard must be used within a <KeyboardProvider>");
|
|
81
|
-
return
|
|
84
|
+
return s;
|
|
82
85
|
}
|
|
83
86
|
export {
|
|
84
87
|
q as KeyboardContext,
|
|
85
|
-
|
|
86
|
-
|
|
88
|
+
X as KeyboardProvider,
|
|
89
|
+
Y as useKeyboard
|
|
87
90
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Size } from '../../shared';
|
|
2
|
+
/**
|
|
3
|
+
* CSS classes for keyboard height based on size.
|
|
4
|
+
* Maps size keys to Tailwind height classes for the keyboard container.
|
|
5
|
+
*/
|
|
6
|
+
export declare const KEYBOARD_SIZE_CLASS: Record<Size, string>;
|
|
7
|
+
/**
|
|
8
|
+
* CSS classes for keyboard key sizes.
|
|
9
|
+
* Maps size keys to Tailwind classes that control the font size
|
|
10
|
+
* and padding of individual keys.
|
|
11
|
+
*/
|
|
12
|
+
export declare const KEYBOARD_KEY_SIZE_CLASS: Record<Size, string>;
|
|
13
|
+
//# sourceMappingURL=keyboard-styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyboard-styles.d.ts","sourceRoot":"","sources":["../../../src/components/keyboard/keyboard-styles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAIpD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAIxD,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const s = {
|
|
3
|
+
sm: "h-48 sm:h-56",
|
|
4
|
+
md: "h-56 sm:h-64",
|
|
5
|
+
lg: "h-64 sm:h-72"
|
|
6
|
+
}, t = {
|
|
7
|
+
sm: "text-xs gap-1",
|
|
8
|
+
md: "text-sm sm:text-base gap-1.5",
|
|
9
|
+
lg: "text-base sm:text-lg gap-2"
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
t as KEYBOARD_KEY_SIZE_CLASS,
|
|
13
|
+
s as KEYBOARD_SIZE_CLASS
|
|
14
|
+
};
|
|
@@ -118,6 +118,12 @@ export interface MultiSelectProps extends BaseMultiSelectProps {
|
|
|
118
118
|
* and integrates with the FieldShell for consistent label and validation
|
|
119
119
|
* handling.
|
|
120
120
|
*
|
|
121
|
+
* By default, the dropdown menu uses React's createPortal to render at the
|
|
122
|
+
* document body level. This ensures the menu escapes CSS containment, overflow
|
|
123
|
+
* clipping, and stacking context issues. The portal can be disabled via the
|
|
124
|
+
* `portal` prop or `components.multiSelect.portal` in the config if the menu
|
|
125
|
+
* needs to stay within a specific parent container.
|
|
126
|
+
*
|
|
121
127
|
* @param props - MultiSelect configuration options.
|
|
122
128
|
* @param props.options - Available options to select from.
|
|
123
129
|
* @param props.value - Controlled selected values.
|
|
@@ -138,6 +144,8 @@ export interface MultiSelectProps extends BaseMultiSelectProps {
|
|
|
138
144
|
* @param props.color - Theme accent color. Defaults to "primary".
|
|
139
145
|
* @param props.status - Validation status.
|
|
140
146
|
* @param props.labelAlign - Alignment of the label. Defaults to "left".
|
|
147
|
+
* @param props.portal - Whether to render the dropdown in a portal. Defaults to true.
|
|
148
|
+
* @param props.portalTarget - Custom portal target element. Defaults to document.body.
|
|
141
149
|
*
|
|
142
150
|
* @example
|
|
143
151
|
* ```tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiSelect.d.ts","sourceRoot":"","sources":["../../../src/components/multi-select/MultiSelect.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MultiSelect.d.ts","sourceRoot":"","sources":["../../../src/components/multi-select/MultiSelect.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAgBf,OAAO,EAAE,KAAK,gBAAgB,EAAqB,MAAM,gBAAgB,CAAC;AAE1E,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,uBAAuB,CAAC;AAU/B,KAAK,oBAAoB,GAAG,iBAAiB,GAC3C,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,UAAU,CAAC,CAAC;AAEtE;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,oBAAoB;IAC5D;;;OAGG;IACH,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAE5B;;;OAGG;IACH,KAAK,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAE5B;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,MAAM,GAA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