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.
Files changed (184) hide show
  1. package/README.md +1 -14
  2. package/dist/AsheeUIProvider.js +22 -24
  3. package/dist/components/accordion/Accordion.js +79 -173
  4. package/dist/components/accordion/accordion-config.js +12 -13
  5. package/dist/components/accordion/accordion-styles.js +21 -24
  6. package/dist/components/autocomplete/Autocomplete.js +78 -136
  7. package/dist/components/autocomplete/autocomplete-config.js +7 -12
  8. package/dist/components/button/Button.d.ts +29 -1
  9. package/dist/components/button/Button.d.ts.map +1 -1
  10. package/dist/components/button/Button.js +47 -108
  11. package/dist/components/button/button-config.js +16 -17
  12. package/dist/components/button/button-styles.js +10 -11
  13. package/dist/components/card/Card.d.ts +36 -16
  14. package/dist/components/card/Card.d.ts.map +1 -1
  15. package/dist/components/card/Card.js +115 -205
  16. package/dist/components/card/card-config.js +24 -21
  17. package/dist/components/card/card-styles.js +19 -22
  18. package/dist/components/carousel/Carousel.js +123 -248
  19. package/dist/components/carousel/carousel-config.js +24 -25
  20. package/dist/components/carousel/carousel-styles.js +14 -16
  21. package/dist/components/chip/Chip.js +84 -191
  22. package/dist/components/chip/chip-config.js +13 -14
  23. package/dist/components/chip/chip-styles.js +22 -26
  24. package/dist/components/date-picker/Calendar.d.ts +3 -3
  25. package/dist/components/date-picker/Calendar.d.ts.map +1 -1
  26. package/dist/components/date-picker/Calendar.js +141 -222
  27. package/dist/components/date-picker/DatePicker.d.ts +5 -5
  28. package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
  29. package/dist/components/date-picker/DatePicker.js +122 -220
  30. package/dist/components/date-picker/TimeSpinner.js +58 -82
  31. package/dist/components/date-picker/date-picker-config.d.ts +4 -4
  32. package/dist/components/date-picker/date-picker-config.d.ts.map +1 -1
  33. package/dist/components/date-picker/date-picker-config.js +10 -11
  34. package/dist/components/date-picker/date-picker-styles.js +44 -45
  35. package/dist/components/date-picker/date-picker.helpers.d.ts +4 -4
  36. package/dist/components/date-picker/date-picker.helpers.d.ts.map +1 -1
  37. package/dist/components/date-picker/date-picker.helpers.js +74 -102
  38. package/dist/components/drawer/Drawer.d.ts +26 -8
  39. package/dist/components/drawer/Drawer.d.ts.map +1 -1
  40. package/dist/components/drawer/Drawer.js +54 -131
  41. package/dist/components/drawer/drawer-config.js +14 -15
  42. package/dist/components/drawer/drawer-styles.js +38 -42
  43. package/dist/components/field/FieldShell.js +49 -56
  44. package/dist/components/field/field-config.js +17 -18
  45. package/dist/components/field/field-styles.js +8 -8
  46. package/dist/components/image/Image.d.ts +7 -7
  47. package/dist/components/image/Image.d.ts.map +1 -1
  48. package/dist/components/image/Image.js +65 -132
  49. package/dist/components/image/image-config.js +17 -18
  50. package/dist/components/image/image-styles.js +14 -15
  51. package/dist/components/input/Input.js +65 -150
  52. package/dist/components/input/PasswordInput.js +30 -49
  53. package/dist/components/input/input-config.js +7 -7
  54. package/dist/components/input/input-styles.js +9 -10
  55. package/dist/components/keyboard/KeyboardContext.js +10 -11
  56. package/dist/components/keyboard/KeyboardProvider.js +100 -181
  57. package/dist/components/keyboard/OnScreenKeyboard.d.ts.map +1 -1
  58. package/dist/components/keyboard/OnScreenKeyboard.js +159 -166
  59. package/dist/components/keyboard/keyboard-config.js +59 -57
  60. package/dist/components/keyboard/keyboard-styles.js +10 -11
  61. package/dist/components/keyboard/use-keyboard-field.js +29 -21
  62. package/dist/components/link/Link.js +47 -137
  63. package/dist/components/link/link-config.js +14 -15
  64. package/dist/components/link/link-styles.js +25 -29
  65. package/dist/components/marquee/Marquee.js +55 -144
  66. package/dist/components/marquee/marquee-config.js +18 -19
  67. package/dist/components/marquee/marquee-styles.js +13 -15
  68. package/dist/components/modal/Modal.d.ts +26 -10
  69. package/dist/components/modal/Modal.d.ts.map +1 -1
  70. package/dist/components/modal/Modal.js +56 -136
  71. package/dist/components/modal/modal-config.js +15 -16
  72. package/dist/components/modal/modal-styles.js +13 -14
  73. package/dist/components/multi-select/MultiSelect.d.ts +18 -2
  74. package/dist/components/multi-select/MultiSelect.d.ts.map +1 -1
  75. package/dist/components/multi-select/MultiSelect.js +149 -283
  76. package/dist/components/multi-select/multi-select-config.d.ts +23 -18
  77. package/dist/components/multi-select/multi-select-config.d.ts.map +1 -1
  78. package/dist/components/multi-select/multi-select-config.js +18 -21
  79. package/dist/components/multi-select/multi-select-styles.js +17 -20
  80. package/dist/components/radio/Radio.js +43 -80
  81. package/dist/components/radio/RadioGroup.js +57 -155
  82. package/dist/components/radio/radio-config.js +15 -16
  83. package/dist/components/radio/radio-context.js +6 -6
  84. package/dist/components/radio/radio-styles.js +55 -60
  85. package/dist/components/resizable-screen/ResizableScreen.js +87 -177
  86. package/dist/components/resizable-screen/resizable-screen-config.js +16 -17
  87. package/dist/components/select/Select.d.ts +3 -2
  88. package/dist/components/select/Select.d.ts.map +1 -1
  89. package/dist/components/select/Select.js +97 -195
  90. package/dist/components/select/select-config.js +8 -9
  91. package/dist/components/select/select-styles.js +5 -5
  92. package/dist/components/select-menu/SelectMenu.d.ts.map +1 -1
  93. package/dist/components/select-menu/SelectMenu.js +102 -196
  94. package/dist/components/select-menu/select-menu-config.js +12 -12
  95. package/dist/components/select-menu/use-select-floating.d.ts +11 -1
  96. package/dist/components/select-menu/use-select-floating.d.ts.map +1 -1
  97. package/dist/components/select-menu/use-select-floating.js +41 -48
  98. package/dist/components/sidebar/Sidebar.d.ts +43 -22
  99. package/dist/components/sidebar/Sidebar.d.ts.map +1 -1
  100. package/dist/components/sidebar/Sidebar.js +146 -331
  101. package/dist/components/sidebar/sidebar-config.d.ts +98 -31
  102. package/dist/components/sidebar/sidebar-config.d.ts.map +1 -1
  103. package/dist/components/sidebar/sidebar-config.js +47 -33
  104. package/dist/components/sidebar/sidebar-styles.js +27 -32
  105. package/dist/components/spinner/spinner-config.js +12 -13
  106. package/dist/components/spinner/spinner-styles.js +13 -14
  107. package/dist/components/spinner/spinner.js +39 -82
  108. package/dist/components/switch/Switch.js +62 -154
  109. package/dist/components/switch/switch-config.js +11 -12
  110. package/dist/components/switch/switch-styles.js +14 -16
  111. package/dist/components/table/Table.js +64 -186
  112. package/dist/components/table/table-config.js +17 -18
  113. package/dist/components/table/table-styles.js +48 -52
  114. package/dist/components/tabs/Tabs.d.ts +16 -8
  115. package/dist/components/tabs/Tabs.d.ts.map +1 -1
  116. package/dist/components/tabs/Tabs.js +93 -208
  117. package/dist/components/tabs/tabs-config.d.ts +42 -20
  118. package/dist/components/tabs/tabs-config.d.ts.map +1 -1
  119. package/dist/components/tabs/tabs-config.js +26 -18
  120. package/dist/components/tabs/tabs-styles.js +15 -17
  121. package/dist/components/textarea/Textarea.js +52 -138
  122. package/dist/components/textarea/textarea-config.js +10 -11
  123. package/dist/components/textarea/textarea-styles.js +9 -10
  124. package/dist/components/toast/ToastContext.js +22 -26
  125. package/dist/components/toast/ToastItem.js +82 -144
  126. package/dist/components/toast/ToastProvider.d.ts.map +1 -1
  127. package/dist/components/toast/ToastProvider.js +128 -190
  128. package/dist/components/toast/toast-config.js +23 -24
  129. package/dist/components/toast/toast-styles.js +50 -55
  130. package/dist/components/toast/use-pausable-timeout.js +17 -13
  131. package/dist/components/tooltip/Tooltip.d.ts +5 -0
  132. package/dist/components/tooltip/Tooltip.d.ts.map +1 -1
  133. package/dist/components/tooltip/Tooltip.js +68 -158
  134. package/dist/components/tooltip/tooltip-config.d.ts +25 -0
  135. package/dist/components/tooltip/tooltip-config.d.ts.map +1 -1
  136. package/dist/components/tooltip/tooltip-config.js +26 -22
  137. package/dist/components/tooltip/tooltip-styles.js +15 -17
  138. package/dist/config/default-config.js +11 -34
  139. package/dist/config/resolve-color.js +23 -23
  140. package/dist/config/resolve-config.d.ts.map +1 -1
  141. package/dist/config/resolve-config.js +14 -12
  142. package/dist/icons/ArrowLeftIcon.js +16 -19
  143. package/dist/icons/CalendarIcon.js +43 -24
  144. package/dist/icons/CheckIcon.js +16 -19
  145. package/dist/icons/ChevronDownIcon.js +15 -21
  146. package/dist/icons/ChevronLeftIcon.js +16 -19
  147. package/dist/icons/ChevronRightIcon.js +16 -19
  148. package/dist/icons/ChevronUpIcon.js +16 -19
  149. package/dist/icons/ClearIcon.js +26 -22
  150. package/dist/icons/ClockIcon.js +20 -22
  151. package/dist/icons/CloseIcon.js +26 -22
  152. package/dist/icons/ErrorIcon.js +16 -19
  153. package/dist/icons/ExternalLinkIcon.js +25 -23
  154. package/dist/icons/EyeIcon.js +20 -22
  155. package/dist/icons/EyeOffIcon.js +21 -22
  156. package/dist/icons/InfoIcon.js +16 -19
  157. package/dist/icons/SearchIcon.js +25 -22
  158. package/dist/icons/WarningIcon.js +16 -19
  159. package/dist/index.js +65 -163
  160. package/dist/libs/context.js +10 -13
  161. package/dist/libs/index.js +1 -0
  162. package/dist/libs/registry.js +10 -12
  163. package/dist/libs/use-floating-z-index.d.ts +32 -0
  164. package/dist/libs/use-floating-z-index.d.ts.map +1 -0
  165. package/dist/libs/use-floating-z-index.js +16 -0
  166. package/dist/libs/use-isomorphic-layout-effect.js +5 -5
  167. package/dist/scripts/AsheeThemeScript.js +35 -44
  168. package/dist/shared/radius.d.ts.map +1 -1
  169. package/dist/shared/radius.js +12 -13
  170. package/dist/shared/variant.js +46 -134
  171. package/dist/theme/color.js +28 -28
  172. package/dist/theme/controller.d.ts.map +1 -1
  173. package/dist/theme/controller.js +65 -178
  174. package/dist/theme/useTheme.js +13 -44
  175. package/dist/utils/cn.js +7 -7
  176. package/dist/utils/index.d.ts +1 -0
  177. package/dist/utils/index.d.ts.map +1 -1
  178. package/dist/utils/index.js +1 -0
  179. package/dist/utils/merge-object.js +13 -14
  180. package/dist/utils/resolve-token.js +11 -14
  181. package/dist/utils/stacking.d.ts +76 -0
  182. package/dist/utils/stacking.d.ts.map +1 -0
  183. package/dist/utils/stacking.js +34 -0
  184. package/package.json +12 -11
@@ -1,172 +1,165 @@
1
1
  "use client";
2
- import { jsx as p } from "react/jsx-runtime";
3
- import { FloatingPortal as V } from "@floating-ui/react";
4
- import { useState as R, useEffect as k, useMemo as W, useCallback as v } from "react";
5
- import { Button as X } from "../button/Button.js";
6
- import { KEYBOARD_KEY_SIZE_CLASS as D, KEYBOARD_SIZE_CLASS as N } from "./keyboard-styles.js";
7
- import { cn as B } from "../../utils/cn.js";
8
- function z(r) {
9
- return r === "{space}" ? "flex-[4]" : ["{bksp}", "{enter}", "{shift}", "{symbols}", "{abc}", "{clear}"].includes(
10
- r
11
- ) ? "flex-[1.6]" : "flex-1";
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 P(r, e, i) {
14
- var h;
15
- const t = Object.getPrototypeOf(r), c = (h = Object.getOwnPropertyDescriptor(t, "value")) == null ? void 0 : h.set;
16
- c ? c.call(r, e) : r.value = e, r.dispatchEvent(new Event("input", { bubbles: !0 })), requestAnimationFrame(() => {
17
- r.focus(), r.setSelectionRange(i, i);
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 G(r, e, i) {
21
- return e !== i ? { value: r.slice(0, e) + r.slice(i), cursor: e } : e === 0 ? { value: r, cursor: 0 } : {
22
- value: r.slice(0, e - 1) + r.slice(i),
23
- cursor: e - 1
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 T(r) {
27
- return (e, i, t) => ({
28
- value: e.slice(0, i) + r + e.slice(t),
29
- cursor: i + r.length
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 ne({
33
- isOpen: r,
34
- activeElement: e,
35
- config: i,
36
- currentLayout: t,
37
- setLayout: c,
38
- forceClose: h,
39
- size: S,
40
- variant: $,
41
- color: j,
42
- radius: _,
43
- portal: H,
44
- className: M,
45
- keyClassName: O,
46
- disabled: w = !1
47
- }) {
48
- const b = i.layouts ?? {}, Y = i.display ?? {}, f = i.defaultLayout ?? "default", x = i.autoShiftBack ?? !0, [F, K] = R(/* @__PURE__ */ new Set()), [I, g] = R(null);
49
- k(() => {
50
- r && c(f);
51
- }, [r, f, c]);
52
- const Z = W(() => (b[t] || b[f] || []).map((l, n) => ({
53
- id: `${t}-row-${n}`,
54
- keys: l.split(" ").map((u, a) => ({
55
- id: `${t}-r${n}-k${a}-${u}`,
56
- token: u
57
- }))
58
- })), [b, t, f]);
59
- k(() => {
60
- if (!r || w) return;
61
- const l = (b[t] || []).join(" ").split(" "), n = (o) => o === "Backspace" ? "{bksp}" : o === "Enter" ? "{enter}" : o === " " ? "{space}" : o === "Shift" ? "{shift}" : o.length === 1 && l.includes(o) ? o : null, u = (o) => {
62
- if (o.key === "Escape") {
63
- h();
64
- return;
65
- }
66
- const d = n(o.key);
67
- d && K((m) => new Set(m).add(d));
68
- }, a = (o) => {
69
- const d = n(o.key);
70
- d && K((m) => {
71
- const A = new Set(m);
72
- return A.delete(d), A;
73
- });
74
- };
75
- return window.addEventListener("keydown", u), window.addEventListener("keyup", a), () => {
76
- window.removeEventListener("keydown", u), window.removeEventListener("keyup", a);
77
- };
78
- }, [r, t, b, h, w]);
79
- const y = v(
80
- (s) => {
81
- if (!e) return;
82
- const l = e.value, n = e.selectionStart ?? l.length, u = e.selectionEnd ?? l.length, { value: a, cursor: o } = s(l, n, u);
83
- P(e, a, o);
84
- },
85
- [e]
86
- ), q = v(
87
- (s) => {
88
- if (w) return;
89
- if (s === "{shift}") {
90
- c(t === "shift" ? f : t === f ? "shift" : t);
91
- return;
92
- }
93
- if (s === "{symbols}") {
94
- c("symbols");
95
- return;
96
- }
97
- if (s === "{abc}") {
98
- c(f);
99
- return;
100
- }
101
- if (s === "{clear}") {
102
- e && P(e, "", 0);
103
- return;
104
- }
105
- if (s === "{enter}") {
106
- (e == null ? void 0 : e.tagName) === "TEXTAREA" ? y(T(`
107
- `)) : e == null || e.blur();
108
- return;
109
- }
110
- if (s === "{bksp}") {
111
- y(G);
112
- return;
113
- }
114
- y(T(s === "{space}" ? " " : s)), t === "shift" && x && c(f);
115
- },
116
- [
117
- e,
118
- y,
119
- t,
120
- x,
121
- f,
122
- w,
123
- c
124
- ]
125
- );
126
- if (!r || w) return null;
127
- const E = N[S] || N.md, U = D[S] || D.md, C = /* @__PURE__ */ p(
128
- "section",
129
- {
130
- "aria-label": "Virtual Keyboard",
131
- className: "fixed inset-x-0 bottom-0 z-9999 pointer-events-auto",
132
- onMouseDown: (s) => s.preventDefault(),
133
- children: /* @__PURE__ */ p(
134
- "div",
135
- {
136
- className: B(
137
- "w-full bg-background border-t border-border shadow-2xl flex flex-col select-none",
138
- E,
139
- M
140
- ),
141
- children: /* @__PURE__ */ p("div", { className: "flex flex-col gap-1.5 p-2 flex-1 min-h-0", children: Z.map((s) => /* @__PURE__ */ p("div", { className: "flex gap-1.5 flex-1", children: s.keys.map(({ id: l, token: n }) => {
142
- const o = F.has(n) || I === n, d = Y[n] ?? n;
143
- return /* @__PURE__ */ p(
144
- X,
145
- {
146
- variant: $,
147
- color: o ? j : "secondary",
148
- radius: _,
149
- size: S,
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
- export {
171
- ne as OnScreenKeyboard
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
- const a = {
4
- default: [
5
- "1 2 3 4 5 6 7 8 9 0 {bksp}",
6
- "q w e r t y u i o p",
7
- "a s d f g h j k l",
8
- "{shift} z x c v b n m {shift}",
9
- "{symbols} , {space} . {enter}"
10
- ],
11
- shift: [
12
- "1 2 3 4 5 6 7 8 9 0 {bksp}",
13
- "Q W E R T Y U I O P",
14
- "A S D F G H J K L",
15
- "{shift} Z X C V B N M {shift}",
16
- "{symbols} , {space} . {enter}"
17
- ],
18
- symbols: [
19
- "1 2 3 4 5 6 7 8 9 0 {bksp}",
20
- "@ # $ _ & - + ( )",
21
- `* " ' : ; ! ? %`,
22
- "{abc} / \\ ~ ` = {abc}",
23
- "{abc} , {space} . {enter}"
24
- ],
25
- numeric: ["1 2 3 {bksp}", "4 5 6 {clear}", "7 8 9 {enter}", "0 . {space}"]
26
- }, s = {
27
- "{bksp}": "⌫",
28
- "{enter}": "↵",
29
- "{shift}": "⇧",
30
- "{symbols}": "?123",
31
- "{abc}": "ABC",
32
- "{space}": "space",
33
- "{clear}": "C"
34
- }, t = {
35
- layouts: a,
36
- display: s,
37
- defaultLayout: "default",
38
- closeDelay: 500,
39
- autoShiftBack: !0,
40
- size: "md",
41
- portal: !0,
42
- disabled: !1
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", t);
45
- const o = {
46
- defaultLayout: "default",
47
- size: "md",
48
- variant: "solid",
49
- color: "primary",
50
- radius: "md",
51
- portal: !0,
52
- disabled: !1,
53
- closeDelay: 500,
54
- autoShiftBack: !0
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
- const s = {
3
- sm: "h-48 sm:h-56",
4
- md: "h-56 sm:h-64",
5
- lg: "h-64 sm:h-72"
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
- 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
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
- import { useContext as i, useCallback as a } from "react";
3
- import { KeyboardContext as m } from "./KeyboardContext.js";
4
- function y(t, r, e = !1, n) {
5
- const o = i(m), c = a(
6
- (s) => {
7
- if (!e || !o || o.isDisabled) return;
8
- const u = (s == null ? void 0 : s.currentTarget) ?? (r == null ? void 0 : r.current);
9
- u && o.openKeyboard(t, u, n);
10
- },
11
- [t, r, e, o, n]
12
- ), l = a(() => {
13
- !e || !o || o.isDisabled || o.requestClose(t);
14
- }, [t, e, o]);
15
- return {
16
- handleFocus: c,
17
- handleBlur: l,
18
- hasProvider: !!o
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
- export {
22
- y as useKeyboardField
23
- };
30
+ //#endregion
31
+ export { r as useKeyboardField };