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.
Files changed (70) hide show
  1. package/dist/components/accordion/Accordion.js +10 -10
  2. package/dist/components/autocomplete/Autocomplete.d.ts +8 -0
  3. package/dist/components/autocomplete/Autocomplete.d.ts.map +1 -1
  4. package/dist/components/autocomplete/Autocomplete.js +120 -118
  5. package/dist/components/autocomplete/autocomplete-config.d.ts +29 -3
  6. package/dist/components/autocomplete/autocomplete-config.d.ts.map +1 -1
  7. package/dist/components/autocomplete/autocomplete-config.js +14 -6
  8. package/dist/components/date-picker/DatePicker.d.ts +20 -0
  9. package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
  10. package/dist/components/date-picker/DatePicker.js +230 -229
  11. package/dist/components/date-picker/date-picker-config.d.ts +16 -0
  12. package/dist/components/date-picker/date-picker-config.d.ts.map +1 -1
  13. package/dist/components/date-picker/date-picker-config.js +14 -10
  14. package/dist/components/keyboard/OnScreenKeyboard.d.ts +16 -6
  15. package/dist/components/keyboard/OnScreenKeyboard.d.ts.map +1 -1
  16. package/dist/components/keyboard/OnScreenKeyboard.js +96 -90
  17. package/dist/components/keyboard/index.js +1 -0
  18. package/dist/components/keyboard/keyboard-config.d.ts +27 -1
  19. package/dist/components/keyboard/keyboard-config.d.ts.map +1 -1
  20. package/dist/components/keyboard/keyboard-config.js +12 -8
  21. package/dist/components/keyboard/keyboard-context.d.ts +4 -7
  22. package/dist/components/keyboard/keyboard-context.d.ts.map +1 -1
  23. package/dist/components/keyboard/keyboard-context.js +61 -58
  24. package/dist/components/keyboard/keyboard-styles.d.ts +13 -0
  25. package/dist/components/keyboard/keyboard-styles.d.ts.map +1 -0
  26. package/dist/components/keyboard/keyboard-styles.js +14 -0
  27. package/dist/components/multi-select/MultiSelect.d.ts +8 -0
  28. package/dist/components/multi-select/MultiSelect.d.ts.map +1 -1
  29. package/dist/components/multi-select/MultiSelect.js +186 -184
  30. package/dist/components/multi-select/multi-select-config.d.ts +18 -0
  31. package/dist/components/multi-select/multi-select-config.d.ts.map +1 -1
  32. package/dist/components/multi-select/multi-select-config.js +14 -10
  33. package/dist/components/resizable-screen/ResizableScreen.d.ts +23 -11
  34. package/dist/components/resizable-screen/ResizableScreen.d.ts.map +1 -1
  35. package/dist/components/resizable-screen/ResizableScreen.js +69 -60
  36. package/dist/components/select/Select.d.ts +8 -6
  37. package/dist/components/select/Select.d.ts.map +1 -1
  38. package/dist/components/select/Select.js +135 -135
  39. package/dist/components/select/select-config.d.ts +27 -1
  40. package/dist/components/select/select-config.d.ts.map +1 -1
  41. package/dist/components/select/select-config.js +14 -6
  42. package/dist/components/select-menu/SelectMenu.d.ts +23 -1
  43. package/dist/components/select-menu/SelectMenu.d.ts.map +1 -1
  44. package/dist/components/select-menu/SelectMenu.js +72 -67
  45. package/dist/components/select-menu/index.d.ts +1 -0
  46. package/dist/components/select-menu/index.d.ts.map +1 -1
  47. package/dist/components/select-menu/index.js +1 -0
  48. package/dist/components/select-menu/select-menu-config.d.ts +1 -1
  49. package/dist/components/select-menu/select-menu-config.js +3 -3
  50. package/dist/components/select-menu/use-select-floating.d.ts +95 -0
  51. package/dist/components/select-menu/use-select-floating.d.ts.map +1 -0
  52. package/dist/components/select-menu/use-select-floating.js +36 -0
  53. package/dist/components/toast/toast-config.d.ts +11 -0
  54. package/dist/components/toast/toast-config.d.ts.map +1 -1
  55. package/dist/components/toast/toast-config.js +4 -2
  56. package/dist/components/toast/toast-context.d.ts +21 -1
  57. package/dist/components/toast/toast-context.d.ts.map +1 -1
  58. package/dist/components/toast/toast-context.js +134 -114
  59. package/dist/components/tooltip/Tooltip.d.ts +19 -0
  60. package/dist/components/tooltip/Tooltip.d.ts.map +1 -1
  61. package/dist/components/tooltip/Tooltip.js +129 -121
  62. package/dist/components/tooltip/tooltip-config.d.ts +7 -3
  63. package/dist/components/tooltip/tooltip-config.d.ts.map +1 -1
  64. package/dist/components/tooltip/tooltip-config.js +5 -4
  65. package/dist/config/resolve-config.d.ts.map +1 -1
  66. package/dist/utils/merge-object.d.ts +7 -1
  67. package/dist/utils/merge-object.d.ts.map +1 -1
  68. package/dist/utils/types.d.ts +16 -4
  69. package/dist/utils/types.d.ts.map +1 -1
  70. package/package.json +1 -1
@@ -1,87 +1,90 @@
1
1
  "use client";
2
- import { jsx as y } from "react/jsx-runtime";
3
- import { createContext as z, useMemo as j, useState as i, useRef as F, useCallback as p, useContext as G } from "react";
4
- import { useAsheeConfig as H } from "../../libs/context.js";
5
- import { defaultKeyboardConfig as n } from "./keyboard-config.js";
6
- const q = z(null);
7
- function V({
8
- children: r,
9
- layouts: f,
10
- display: v,
11
- defaultLayout: d,
12
- heightClass: m,
13
- autoShiftBack: x,
14
- closeDelay: I = 120,
15
- variant: T,
16
- color: k,
17
- radius: w
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 s = H(), t = (R = s == null ? void 0 : s.components) == null ? void 0 : R.keyboard, A = j(
21
+ const n = N(), t = (R = n == null ? void 0 : n.components) == null ? void 0 : R.keyboard, S = j(
21
22
  () => ({
22
- layouts: f ?? (t == null ? void 0 : t.layouts) ?? n.layouts,
23
- display: v ?? (t == null ? void 0 : t.display) ?? n.display,
24
- defaultLayout: d ?? (t == null ? void 0 : t.defaultLayout) ?? n.defaultLayout,
25
- heightClass: m,
26
- autoShiftBack: x ?? (t == null ? void 0 : t.autoShiftBack) ?? n.autoShiftBack,
27
- variant: T ?? (t == null ? void 0 : t.variant),
28
- color: k ?? (t == null ? void 0 : t.color),
29
- radius: w ?? (t == null ? void 0 : t.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
- d,
36
- m,
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
- ), [E, c] = i(!1), [P, l] = i(null), [S, o] = i(
45
+ ), [m, c] = i(!1), [z, e] = i(null), [B, o] = i(
43
46
  null
44
- ), u = F(null), B = p((a, e) => {
45
- u.current && (clearTimeout(u.current), u.current = null), l(a), o(e), c(!0);
46
- }, []), L = p(
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
- l((e) => (e === a && (c(!1), o(null)), e)), u.current = null;
50
- }, I);
52
+ e((l) => (l === a && (c(!1), o(null)), l)), u.current = null;
53
+ }, d);
51
54
  },
52
- [I]
53
- ), O = p(() => {
54
- u.current && (clearTimeout(u.current), u.current = null), c(!1), o(null), l(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: E,
58
- activeInputId: P,
59
- activeElement: S,
60
- config: A,
61
- openKeyboard: B,
62
- requestClose: L,
63
- forceClose: O
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
- E,
67
- P,
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__ */ y(q.Provider, { value: M, children: r });
78
+ return /* @__PURE__ */ F(q.Provider, { value: M, children: s });
76
79
  }
77
- function W() {
78
- const r = G(q);
79
- if (!r)
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 r;
84
+ return s;
82
85
  }
83
86
  export {
84
87
  q as KeyboardContext,
85
- V as KeyboardProvider,
86
- W as useKeyboard
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":"AAsBA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAgBf,OAAO,KAAK,EAAE,gBAAgB,E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