asheeui 0.6.5 → 0.6.7

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 (64) 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 +27 -1
  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/config/resolve-config.d.ts.map +1 -1
  60. package/dist/utils/merge-object.d.ts +7 -1
  61. package/dist/utils/merge-object.d.ts.map +1 -1
  62. package/dist/utils/types.d.ts +16 -4
  63. package/dist/utils/types.d.ts.map +1 -1
  64. package/package.json +1 -1
@@ -1,144 +1,163 @@
1
1
  "use client";
2
- import { jsxs as G, jsx as A } from "react/jsx-runtime";
3
- import { useState as g, useCallback as a, useMemo as q, useContext as E, createContext as H } from "react";
4
- import { useAsheeConfig as J } from "../../libs/context.js";
5
- import { resolveCascade as i, resolveRadiusKey as Q } from "../../utils/resolve-token.js";
6
- import { ToastItem as W } from "./ToastItem.js";
7
- import { FALLBACK_TOAST_CONFIG as n } from "./toast-config.js";
8
- import { cn as X } from "../../utils/cn.js";
9
- const D = H(null);
10
- function st({
11
- children: m,
12
- size: K,
13
- placement: I,
14
- variant: S,
15
- radius: U,
16
- defaultTimeout: j,
17
- maxToasts: N,
18
- animated: P,
19
- className: R
2
+ import { jsx as K, jsxs as J } from "react/jsx-runtime";
3
+ import { useState as Q, useCallback as n, useMemo as W, useContext as X, createContext as Y } from "react";
4
+ import { createPortal as Z } from "react-dom";
5
+ import { useAsheeConfig as $ } from "../../libs/context.js";
6
+ import { resolveCascade as l, resolveRadiusKey as C } from "../../utils/resolve-token.js";
7
+ import { ToastItem as tt } from "./ToastItem.js";
8
+ import { FALLBACK_TOAST_CONFIG as a } from "./toast-config.js";
9
+ import { cn as et } from "../../utils/cn.js";
10
+ const P = Y(null);
11
+ function dt({
12
+ children: i,
13
+ size: I,
14
+ placement: S,
15
+ variant: U,
16
+ radius: j,
17
+ defaultTimeout: N,
18
+ maxToasts: R,
19
+ animated: V,
20
+ portal: F,
21
+ portalTarget: L,
22
+ className: M
20
23
  }) {
21
- var h;
22
- const [c, l] = g([]), d = J(), t = (h = d.components) == null ? void 0 : h.toast, V = i(
23
- K,
24
+ var A;
25
+ const [d, c] = Q([]), u = $(), t = (A = u.components) == null ? void 0 : A.toast, O = l(
26
+ I,
24
27
  t == null ? void 0 : t.size,
25
28
  void 0,
26
- n.size
27
- ), r = i(
28
- I,
29
+ a.size
30
+ ), s = l(
31
+ S,
29
32
  t == null ? void 0 : t.placement,
30
33
  void 0,
31
- n.placement
32
- ), F = i(
33
- S,
34
- t == null ? void 0 : t.variant,
35
- d.defaultVariant,
36
- n.variant
37
- ), L = Q(
34
+ a.placement
35
+ ), _ = l(
38
36
  U,
37
+ t == null ? void 0 : t.variant,
38
+ u.defaultVariant,
39
+ a.variant
40
+ ), g = C(
41
+ j,
39
42
  t == null ? void 0 : t.radius,
40
- d.defaultRadius,
41
- n.radius
42
- ), v = i(
43
- N,
43
+ u.defaultRadius,
44
+ a.radius
45
+ ), T = l(
46
+ R,
44
47
  t == null ? void 0 : t.maxToasts,
45
48
  void 0,
46
- n.maxToasts
47
- ), u = i(
48
- j,
49
+ a.maxToasts
50
+ ), p = l(
51
+ N,
49
52
  t == null ? void 0 : t.defaultTimeout,
50
53
  void 0,
51
- n.defaultTimeout
52
- ), M = i(
53
- P,
54
+ a.defaultTimeout
55
+ ), k = l(
56
+ V,
54
57
  t == null ? void 0 : t.animated,
55
58
  void 0,
56
- n.animated
57
- ), p = a((e) => {
58
- l((o) => o.filter((f) => f.id !== e));
59
- }, []), x = a(() => {
60
- l([]);
61
- }, []), s = a(
59
+ a.animated
60
+ ), B = l(
61
+ F,
62
+ t == null ? void 0 : t.portal,
63
+ void 0,
64
+ a.portal
65
+ ), m = L ?? (typeof document < "u" ? document.body : null), f = n((e) => {
66
+ c((o) => o.filter((v) => v.id !== e));
67
+ }, []), y = n(() => {
68
+ c([]);
69
+ }, []), r = n(
62
70
  (e) => {
63
- var z;
64
- const o = typeof e == "object" && e.id ? e.id : typeof window < "u" && ((z = window.crypto) != null && z.randomUUID) ? window.crypto.randomUUID() : String(Date.now()), f = typeof e == "string" ? {
71
+ var D;
72
+ const o = typeof e == "object" && e.id ? e.id : typeof window < "u" && ((D = window.crypto) != null && D.randomUUID) ? window.crypto.randomUUID() : String(Date.now()), v = typeof e == "string" ? {
65
73
  id: o,
66
74
  message: e,
67
- timeout: u,
75
+ timeout: p,
68
76
  type: "info"
69
77
  } : {
70
78
  ...e,
71
79
  id: o,
72
- timeout: e.timeout ?? u,
80
+ timeout: e.timeout ?? p,
73
81
  type: e.type ?? "info"
74
82
  };
75
- return l((_) => {
76
- const k = _.filter((B) => B.id !== o);
77
- return [f, ...k].slice(0, v);
83
+ return c((q) => {
84
+ const E = q.filter((H) => H.id !== o);
85
+ return [v, ...E].slice(0, T);
78
86
  }), o;
79
87
  },
80
- [u, v]
81
- ), T = a(
82
- (e, o) => s({ ...o, message: e, type: "success" }),
83
- [s]
84
- ), y = a(
85
- (e, o) => s({ ...o, message: e, type: "error" }),
86
- [s]
87
- ), w = a(
88
- (e, o) => s({ ...o, message: e, type: "info" }),
89
- [s]
90
- ), b = a(
91
- (e, o) => s({ ...o, message: e, type: "warning" }),
92
- [s]
93
- ), O = q(
88
+ [p, T]
89
+ ), x = n(
90
+ (e, o) => r({ ...o, message: e, type: "success" }),
91
+ [r]
92
+ ), w = n(
93
+ (e, o) => r({ ...o, message: e, type: "error" }),
94
+ [r]
95
+ ), b = n(
96
+ (e, o) => r({ ...o, message: e, type: "info" }),
97
+ [r]
98
+ ), h = n(
99
+ (e, o) => r({ ...o, message: e, type: "warning" }),
100
+ [r]
101
+ ), G = W(
94
102
  () => ({
95
- toasts: c,
96
- toast: s,
97
- success: T,
98
- error: y,
99
- info: w,
100
- warning: b,
101
- removeToast: p,
102
- clearToasts: x
103
+ toasts: d,
104
+ toast: r,
105
+ success: x,
106
+ error: w,
107
+ info: b,
108
+ warning: h,
109
+ removeToast: f,
110
+ clearToasts: y,
111
+ portalTarget: m
103
112
  }),
104
- [c, s, T, y, w, b, p, x]
113
+ [
114
+ d,
115
+ r,
116
+ x,
117
+ w,
118
+ b,
119
+ h,
120
+ f,
121
+ y,
122
+ m
123
+ ]
124
+ ), z = /* @__PURE__ */ K(
125
+ "section",
126
+ {
127
+ "aria-label": "Notifications",
128
+ className: et(
129
+ "fixed z-50 flex flex-col gap-3 pointer-events-none p-4 max-h-screen overflow-clip",
130
+ s === "top-right" && "top-0 right-0 items-end",
131
+ s === "top-left" && "top-0 left-0 items-start",
132
+ s === "bottom-right" && "bottom-0 right-0 items-end",
133
+ s === "bottom-left" && "bottom-0 left-0 items-start",
134
+ s === "top-center" && "top-0 left-1/2 -translate-x-1/2 items-center",
135
+ s === "bottom-center" && "bottom-0 left-1/2 -translate-x-1/2 items-center",
136
+ M
137
+ ),
138
+ children: d.map((e) => /* @__PURE__ */ K(
139
+ tt,
140
+ {
141
+ ...e,
142
+ placement: s,
143
+ size: O,
144
+ variant: _,
145
+ radius: g,
146
+ onDismiss: f,
147
+ animated: k
148
+ },
149
+ e.id
150
+ ))
151
+ }
105
152
  );
106
- return /* @__PURE__ */ G(D.Provider, { value: O, children: [
107
- m,
108
- /* @__PURE__ */ A(
109
- "section",
110
- {
111
- "aria-label": "Notifications",
112
- className: X(
113
- "fixed z-50 flex flex-col gap-3 pointer-events-none p-4 max-h-screen overflow-clip",
114
- r === "top-right" && "top-0 right-0 items-end",
115
- r === "top-left" && "top-0 left-0 items-start",
116
- r === "bottom-right" && "bottom-0 right-0 items-end",
117
- r === "bottom-left" && "bottom-0 left-0 items-start",
118
- r === "top-center" && "top-0 left-1/2 -translate-x-1/2 items-center",
119
- r === "bottom-center" && "bottom-0 left-1/2 -translate-x-1/2 items-center",
120
- R
121
- ),
122
- children: c.map((e) => /* @__PURE__ */ A(
123
- W,
124
- {
125
- ...e,
126
- placement: r,
127
- size: V,
128
- variant: F,
129
- radius: L,
130
- onDismiss: p,
131
- animated: M
132
- },
133
- e.id
134
- ))
135
- }
136
- )
153
+ return /* @__PURE__ */ J(P.Provider, { value: G, children: [
154
+ i,
155
+ B && m ? Z(z, m) : z
137
156
  ] });
138
157
  }
139
- function rt() {
140
- const m = E(D);
141
- return m || {
158
+ function ct() {
159
+ const i = X(P);
160
+ return i || {
142
161
  toasts: [],
143
162
  toast: () => "",
144
163
  success: () => "",
@@ -148,10 +167,11 @@ function rt() {
148
167
  removeToast: () => {
149
168
  },
150
169
  clearToasts: () => {
151
- }
170
+ },
171
+ portalTarget: null
152
172
  };
153
173
  }
154
174
  export {
155
- st as ToastProvider,
156
- rt as useToast
175
+ dt as ToastProvider,
176
+ ct as useToast
157
177
  };
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-config.d.ts","sourceRoot":"","sources":["../../src/config/resolve-config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAIvD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,aAAa,CAAC,cAAc,EAAE,cAAc,GAAG,MAAM,CAYpE"}
1
+ {"version":3,"file":"resolve-config.d.ts","sourceRoot":"","sources":["../../src/config/resolve-config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAIvD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,aAAa,CAAC,cAAc,EAAE,cAAc,GAAG,MAAM,CAiBpE"}
@@ -7,6 +7,12 @@ import { DeepPartial } from './types';
7
7
  * user value is `undefined` are skipped, leaving the default intact.
8
8
  * The `defaults` object is not mutated.
9
9
  *
10
+ * `T` is inferred exclusively from `defaults`; `U` (the override type) is a
11
+ * separate type parameter constrained to a deep partial of `T`. This keeps
12
+ * TypeScript from ever inferring `T` from the `userConfig` argument, which
13
+ * would otherwise force a full `DeepPartial<T>` instantiation at every call
14
+ * site (the source of "excessively deep type instantiation" errors).
15
+ *
10
16
  * @param defaults - Baseline object providing fallback values.
11
17
  * @param userConfig - Optional partial override object.
12
18
  * @returns A new object with the user overrides applied.
@@ -20,5 +26,5 @@ import { DeepPartial } from './types';
20
26
  * // -> { theme: { color: "primary", radius: "lg" } }
21
27
  * ```
22
28
  */
23
- export declare function mergeObject<T extends Record<string, unknown>>(defaults: T, userConfig?: DeepPartial<T>): T;
29
+ export declare function mergeObject<T extends Record<string, unknown>, U extends DeepPartial<T> = DeepPartial<T>>(defaults: T, userConfig?: U): T;
24
30
  //# sourceMappingURL=merge-object.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"merge-object.d.ts","sourceRoot":"","sources":["../../src/utils/merge-object.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAY3C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC3D,QAAQ,EAAE,CAAC,EACX,UAAU,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,GAC1B,CAAC,CAuBH"}
1
+ {"version":3,"file":"merge-object.d.ts","sourceRoot":"","sources":["../../src/utils/merge-object.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAY3C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,WAAW,CACzB,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,CAAC,SAAS,WAAW,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,EACzC,QAAQ,EAAE,CAAC,EAAE,UAAU,CAAC,EAAE,CAAC,GAAG,CAAC,CAuBhC"}
@@ -1,10 +1,22 @@
1
+ /**
2
+ * Built-in types that should never be recursed into.
3
+ *
4
+ * Functions (including React components/render callbacks), primitives, and
5
+ * well-known built-in objects are terminal values for the deep mapping, so
6
+ * `DeepPartial` stops instead of walking their members. This prevents
7
+ * excessively deep/infinite type instantiation when configs reference React
8
+ * nodes, DOM elements, or function-valued fields.
9
+ */
10
+ type Builtin = Date | Error | RegExp | boolean | number | string | symbol | null | undefined;
1
11
  /**
2
12
  * Recursively make every property of `T` optional.
3
13
  *
4
- * Arrays and primitives are left untouched; only object properties are
5
- * mapped. Useful for typed partial configuration overrides.
14
+ * Built-ins (primitives, functions, dates, etc.) are left untouched and
15
+ * arrays are mapped element-wise; only plain object properties are mapped
16
+ * with optional keys. Useful for typed partial configuration overrides.
6
17
  */
7
- export type DeepPartial<T> = T extends object ? {
8
- [P in keyof T]?: DeepPartial<T[P]>;
18
+ export type DeepPartial<T> = T extends Builtin ? T : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends object ? {
19
+ [K in keyof T]?: DeepPartial<T[K]>;
9
20
  } : T;
21
+ export {};
10
22
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/utils/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GACzC;KACG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACnC,GACD,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/utils/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,KAAK,OAAO,GACR,IAAI,GACJ,KAAK,GACL,MAAM,GACN,OAAO,GACP,MAAM,GACN,MAAM,GACN,MAAM,GACN,IAAI,GACJ,SAAS,CAAC;AAEd;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,OAAO,GAC1C,CAAC,GACD,CAAC,SAAS,KAAK,CAAC,MAAM,CAAC,CAAC,GACtB,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,GACrB,CAAC,SAAS,aAAa,CAAC,MAAM,CAAC,CAAC,GAC9B,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,GAC7B,CAAC,SAAS,MAAM,GACd;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GACtC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asheeui",
3
- "version": "0.6.5",
3
+ "version": "0.6.7",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",