asheeui 0.6.8 → 0.6.10

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 (116) hide show
  1. package/dist/components/autocomplete/Autocomplete.d.ts +34 -17
  2. package/dist/components/autocomplete/Autocomplete.d.ts.map +1 -1
  3. package/dist/components/autocomplete/Autocomplete.js +86 -102
  4. package/dist/components/autocomplete/autocomplete-config.d.ts +4 -22
  5. package/dist/components/autocomplete/autocomplete-config.d.ts.map +1 -1
  6. package/dist/components/autocomplete/autocomplete-config.js +8 -11
  7. package/dist/components/button/Button.d.ts +31 -5
  8. package/dist/components/button/Button.d.ts.map +1 -1
  9. package/dist/components/button/Button.js +68 -64
  10. package/dist/components/card/Card.d.ts +58 -54
  11. package/dist/components/card/Card.d.ts.map +1 -1
  12. package/dist/components/card/Card.js +152 -158
  13. package/dist/components/card/card-config.d.ts +66 -33
  14. package/dist/components/card/card-config.d.ts.map +1 -1
  15. package/dist/components/card/card-config.js +9 -9
  16. package/dist/components/date-picker/Calendar.d.ts +57 -0
  17. package/dist/components/date-picker/Calendar.d.ts.map +1 -0
  18. package/dist/components/date-picker/Calendar.js +224 -0
  19. package/dist/components/date-picker/DatePicker.d.ts +68 -155
  20. package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
  21. package/dist/components/date-picker/DatePicker.js +194 -466
  22. package/dist/components/date-picker/TimeSpinner.d.ts +46 -0
  23. package/dist/components/date-picker/TimeSpinner.d.ts.map +1 -0
  24. package/dist/components/date-picker/TimeSpinner.js +84 -0
  25. package/dist/components/date-picker/date-picker-config.d.ts +24 -3
  26. package/dist/components/date-picker/date-picker-config.d.ts.map +1 -1
  27. package/dist/components/date-picker/date-picker-config.js +9 -12
  28. package/dist/components/date-picker/date-picker-styles.d.ts.map +1 -1
  29. package/dist/components/date-picker/date-picker-styles.js +4 -11
  30. package/dist/components/date-picker/date-picker.helpers.d.ts +111 -0
  31. package/dist/components/date-picker/date-picker.helpers.d.ts.map +1 -0
  32. package/dist/components/date-picker/date-picker.helpers.js +110 -0
  33. package/dist/components/date-picker/index.js +3 -0
  34. package/dist/components/input/Input.d.ts +13 -7
  35. package/dist/components/input/Input.d.ts.map +1 -1
  36. package/dist/components/input/Input.js +96 -91
  37. package/dist/components/keyboard/KeyboardContext.d.ts +130 -0
  38. package/dist/components/keyboard/KeyboardContext.d.ts.map +1 -0
  39. package/dist/components/keyboard/KeyboardContext.js +13 -0
  40. package/dist/components/keyboard/KeyboardProvider.d.ts +78 -0
  41. package/dist/components/keyboard/KeyboardProvider.d.ts.map +1 -0
  42. package/dist/components/keyboard/KeyboardProvider.js +183 -0
  43. package/dist/components/keyboard/OnScreenKeyboard.d.ts +65 -43
  44. package/dist/components/keyboard/OnScreenKeyboard.d.ts.map +1 -1
  45. package/dist/components/keyboard/OnScreenKeyboard.js +119 -113
  46. package/dist/components/keyboard/index.d.ts +2 -1
  47. package/dist/components/keyboard/index.d.ts.map +1 -1
  48. package/dist/components/keyboard/index.js +2 -1
  49. package/dist/components/keyboard/keyboard-config.d.ts +40 -36
  50. package/dist/components/keyboard/keyboard-config.d.ts.map +1 -1
  51. package/dist/components/keyboard/keyboard-config.js +15 -10
  52. package/dist/components/keyboard/use-keyboard-field.d.ts +6 -4
  53. package/dist/components/keyboard/use-keyboard-field.d.ts.map +1 -1
  54. package/dist/components/keyboard/use-keyboard-field.js +12 -12
  55. package/dist/components/multi-select/MultiSelect.d.ts +75 -40
  56. package/dist/components/multi-select/MultiSelect.d.ts.map +1 -1
  57. package/dist/components/multi-select/MultiSelect.js +188 -187
  58. package/dist/components/multi-select/multi-select-config.d.ts +4 -22
  59. package/dist/components/multi-select/multi-select-config.d.ts.map +1 -1
  60. package/dist/components/multi-select/multi-select-config.js +11 -14
  61. package/dist/components/radio/radio-config.d.ts +3 -2
  62. package/dist/components/radio/radio-config.d.ts.map +1 -1
  63. package/dist/components/radio/radio-config.js +9 -8
  64. package/dist/components/select/Select.d.ts +60 -45
  65. package/dist/components/select/Select.d.ts.map +1 -1
  66. package/dist/components/select/Select.js +147 -159
  67. package/dist/components/select/select-config.d.ts +5 -33
  68. package/dist/components/select/select-config.d.ts.map +1 -1
  69. package/dist/components/select/select-config.js +6 -13
  70. package/dist/components/select/select-styles.js +1 -6
  71. package/dist/components/select-menu/SelectMenu.d.ts +45 -30
  72. package/dist/components/select-menu/SelectMenu.d.ts.map +1 -1
  73. package/dist/components/select-menu/SelectMenu.js +125 -124
  74. package/dist/components/select-menu/select-menu-config.d.ts +25 -2
  75. package/dist/components/select-menu/select-menu-config.d.ts.map +1 -1
  76. package/dist/components/select-menu/select-menu-config.js +4 -3
  77. package/dist/components/switch/Switch.d.ts +9 -33
  78. package/dist/components/switch/Switch.d.ts.map +1 -1
  79. package/dist/components/switch/Switch.js +68 -74
  80. package/dist/components/switch/switch-config.d.ts +3 -2
  81. package/dist/components/switch/switch-config.d.ts.map +1 -1
  82. package/dist/components/switch/switch-config.js +6 -5
  83. package/dist/components/switch/switch-styles.d.ts +1 -6
  84. package/dist/components/switch/switch-styles.d.ts.map +1 -1
  85. package/dist/components/switch/switch-styles.js +6 -12
  86. package/dist/components/textarea/Textarea.d.ts +19 -1
  87. package/dist/components/textarea/Textarea.d.ts.map +1 -1
  88. package/dist/components/textarea/Textarea.js +95 -90
  89. package/dist/components/toast/ToastContext.d.ts +122 -0
  90. package/dist/components/toast/ToastContext.d.ts.map +1 -0
  91. package/dist/components/toast/ToastContext.js +28 -0
  92. package/dist/components/toast/ToastProvider.d.ts +98 -0
  93. package/dist/components/toast/ToastProvider.d.ts.map +1 -0
  94. package/dist/components/toast/ToastProvider.js +192 -0
  95. package/dist/components/toast/index.d.ts +2 -1
  96. package/dist/components/toast/index.d.ts.map +1 -1
  97. package/dist/components/toast/index.js +2 -1
  98. package/dist/components/toast/toast-config.d.ts +36 -0
  99. package/dist/components/toast/toast-config.d.ts.map +1 -1
  100. package/dist/components/toast/toast-styles.d.ts +8 -0
  101. package/dist/components/toast/toast-styles.d.ts.map +1 -1
  102. package/dist/components/toast/toast-styles.js +11 -3
  103. package/dist/icons/ChevronUpIcon.d.ts +3 -0
  104. package/dist/icons/ChevronUpIcon.d.ts.map +1 -0
  105. package/dist/icons/ChevronUpIcon.js +21 -0
  106. package/dist/icons/index.d.ts +2 -0
  107. package/dist/icons/index.d.ts.map +1 -1
  108. package/dist/index.js +62 -59
  109. package/dist/theme/color.js +2 -2
  110. package/package.json +1 -1
  111. package/dist/components/keyboard/keyboard-context.d.ts +0 -118
  112. package/dist/components/keyboard/keyboard-context.d.ts.map +0 -1
  113. package/dist/components/keyboard/keyboard-context.js +0 -90
  114. package/dist/components/toast/toast-context.d.ts +0 -163
  115. package/dist/components/toast/toast-context.d.ts.map +0 -1
  116. package/dist/components/toast/toast-context.js +0 -177
@@ -1,89 +1,85 @@
1
1
  "use client";
2
- import { jsx as r, jsxs as P } from "react/jsx-runtime";
3
- import { forwardRef as Q, useId as X, useState as Y, useCallback as $ } from "react";
4
- import { useAsheeConfig as q } from "../../libs/context.js";
5
- import { resolveCascade as S, resolveRadiusKey as ee, resolveClassKey as l } from "../../utils/resolve-token.js";
6
- import { FieldShell as se } from "../field/FieldShell.js";
2
+ import { jsx as r, jsxs as Z } from "react/jsx-runtime";
3
+ import { forwardRef as G, useId as O, useState as V, useCallback as J } from "react";
4
+ import { useAsheeConfig as P } from "../../libs/context.js";
5
+ import { resolveCascade as u, resolveRadiusKey as Q, resolveClassKey as l } from "../../utils/resolve-token.js";
6
+ import { FieldShell as X } from "../field/FieldShell.js";
7
7
  import { FALLBACK_SWITCH_CONFIG as s } from "./switch-config.js";
8
- import { SWITCH_TRACK_SIZE_CLASS as re, SWITCH_THUMB_SIZE_CLASS as te, SWITCH_THUMB_TRANSLATE_CLASS as oe, SWITCH_STATUS_BORDER_CLASS as A } from "./switch-styles.js";
9
- import { RADIUS_CLASS as ie } from "../../shared/radius.js";
10
- import { resolveVariantClass as le } from "../../shared/variant.js";
8
+ import { SWITCH_TRACK_SIZE_CLASS as Y, SWITCH_THUMB_SIZE_CLASS as $, SWITCH_THUMB_TRANSLATE_CLASS as q } from "./switch-styles.js";
9
+ import { RADIUS_CLASS as ee } from "../../shared/radius.js";
10
+ import { resolveVariantClass as se } from "../../shared/variant.js";
11
11
  import { cn as a } from "../../utils/cn.js";
12
- const ae = Q(
12
+ const re = G(
13
13
  ({
14
- size: k,
15
- color: _,
16
- radius: I,
17
- status: y,
18
- label: T,
19
- labelAlign: z,
20
- description: x,
21
- message: N,
14
+ size: C,
15
+ color: k,
16
+ radius: A,
17
+ label: y,
18
+ labelAlign: I,
19
+ description: _,
22
20
  required: p,
23
21
  isLoading: n,
24
- id: R,
25
- className: w,
26
- style: H,
27
- disabled: K,
22
+ id: z,
23
+ className: T,
24
+ style: x,
25
+ disabled: N,
28
26
  checked: c,
29
- defaultChecked: L = !1,
30
- onChange: t,
31
- ...B
32
- }, U) => {
33
- var h;
34
- const v = q(), e = (h = v.components) == null ? void 0 : h.switch, W = X(), d = R ?? W, [g, E] = Y(L), o = c ?? g, m = S(
35
- k,
27
+ defaultChecked: w = !1,
28
+ onChange: o,
29
+ ...K
30
+ }, H) => {
31
+ var b;
32
+ const S = P(), e = (b = S.components) == null ? void 0 : b.switch, L = O(), d = z ?? L, [R, g] = V(w), t = c ?? R, m = u(
33
+ C,
36
34
  e == null ? void 0 : e.size,
37
35
  void 0,
38
36
  s.size
39
- ), F = S(
40
- _,
37
+ ), F = u(
38
+ k,
41
39
  e == null ? void 0 : e.color,
42
- v.defaultColor,
40
+ S.defaultColor,
43
41
  s.color
44
- ), D = ee(
45
- I,
42
+ ), U = Q(
43
+ A,
46
44
  e == null ? void 0 : e.radius,
47
45
  void 0,
48
46
  s.radius
49
- ), u = y ?? s.status, j = S(
50
- z,
47
+ ), W = u(
48
+ I,
51
49
  e == null ? void 0 : e.labelAlign,
52
50
  void 0,
53
51
  s.labelAlign
54
- ), M = l(
52
+ ), B = l(
55
53
  m,
56
- re,
54
+ Y,
57
55
  s.size
58
- ), O = l(
56
+ ), E = l(
59
57
  m,
60
- te,
58
+ $,
61
59
  s.size
62
- ), Z = l(
60
+ ), j = l(
63
61
  m,
64
- oe,
62
+ q,
65
63
  s.size
66
- ), f = l(
67
- D,
68
- ie,
64
+ ), h = l(
65
+ U,
66
+ ee,
69
67
  s.radius
70
- ), G = A[u] ?? A.default, V = le("solid", F), i = K || n, J = $(
71
- (b) => {
68
+ ), D = se("solid", F), i = N || n, M = J(
69
+ (f) => {
72
70
  if (i) return;
73
- const C = b.target.checked;
74
- c === void 0 && E(C), t == null || t(C, b);
71
+ const v = f.target.checked;
72
+ c === void 0 && g(v), o == null || o(v, f);
75
73
  },
76
- [c, i, t]
74
+ [c, i, o]
77
75
  );
78
76
  return /* @__PURE__ */ r(
79
- se,
77
+ X,
80
78
  {
81
79
  id: d,
82
- label: T,
83
- labelAlign: j,
84
- description: x,
85
- message: N,
86
- status: u,
80
+ label: y,
81
+ labelAlign: W,
82
+ description: _,
87
83
  required: p,
88
84
  isLoading: n,
89
85
  children: /* @__PURE__ */ r(
@@ -94,44 +90,42 @@ const ae = Q(
94
90
  "inline-flex items-center gap-3 select-none cursor-pointer shrink-0",
95
91
  i && "opacity-50 pointer-events-none cursor-not-allowed"
96
92
  ),
97
- children: /* @__PURE__ */ P(
93
+ children: /* @__PURE__ */ Z(
98
94
  "div",
99
95
  {
100
96
  className: a(
101
97
  "relative shrink-0 inline-flex items-center",
102
- M
98
+ B
103
99
  ),
104
100
  children: [
105
101
  /* @__PURE__ */ r(
106
102
  "input",
107
103
  {
108
- ref: U,
104
+ ref: H,
109
105
  id: d,
110
106
  type: "checkbox",
111
107
  role: "switch",
112
- checked: o,
108
+ checked: t,
113
109
  disabled: i,
114
110
  required: p,
115
- "aria-checked": o,
116
- "aria-invalid": u === "error",
111
+ "aria-checked": t,
117
112
  "aria-busy": n,
118
- onChange: J,
113
+ onChange: M,
119
114
  className: "sr-only peer",
120
- ...B
115
+ ...K
121
116
  }
122
117
  ),
123
118
  /* @__PURE__ */ r(
124
119
  "div",
125
120
  {
126
121
  className: a(
127
- "absolute inset-0 border transition-colors duration-200 shrink-0",
122
+ "absolute inset-0 border border-border/60 transition-colors duration-200 shrink-0",
128
123
  "peer-focus-visible:ring-2 peer-focus-visible:ring-primary peer-focus-visible:ring-offset-2",
129
- G,
130
- f,
131
- o ? V : "bg-secondary/60",
132
- w
124
+ h,
125
+ t ? D : "bg-secondary",
126
+ T
133
127
  ),
134
- style: H
128
+ style: x
135
129
  }
136
130
  ),
137
131
  /* @__PURE__ */ r(
@@ -140,9 +134,9 @@ const ae = Q(
140
134
  className: a(
141
135
  "relative z-10 bg-background shadow-sm pointer-events-none shrink-0",
142
136
  "transition-transform duration-200 ease-in-out transform-gpu",
143
- f,
144
- O,
145
- o ? Z : "translate-x-0"
137
+ h,
138
+ E,
139
+ t ? j : "translate-x-0"
146
140
  )
147
141
  }
148
142
  )
@@ -155,7 +149,7 @@ const ae = Q(
155
149
  );
156
150
  }
157
151
  );
158
- ae.displayName = "Switch";
152
+ re.displayName = "Switch";
159
153
  export {
160
- ae as Switch
154
+ re as Switch
161
155
  };
@@ -1,4 +1,5 @@
1
- import { FieldConfig, FieldSizeKey } from '../field/field-config';
1
+ import { FieldSizeKey } from '../field/field-config';
2
+ import { InputConfig } from '../input';
2
3
  /**
3
4
  * Size key for the switch component.
4
5
  * Maps to the FieldSizeKey type: "sm", "md", or "lg".
@@ -10,7 +11,7 @@ export type SwitchSizeKey = FieldSizeKey;
10
11
  * Set under `components.switch` in the AsheeUI config. Values feed the
11
12
  * component-level fallback tier of the theme cascade.
12
13
  */
13
- export interface SwitchConfig extends FieldConfig {
14
+ export interface SwitchConfig extends InputConfig {
14
15
  }
15
16
  /**
16
17
  * Default config values registered for the Switch component.
@@ -1 +1 @@
1
- {"version":3,"file":"switch-config.d.ts","sourceRoot":"","sources":["../../../src/components/switch/switch-config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAE/B;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,YAAY,CAAC;AAEzC;;;;;GAKG;AACH,MAAM,WAAW,YAAa,SAAQ,WAAW;CAAG;AAEpD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,YAGjC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,YAAY,CACnC,CAAC;AAExB,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,2BAA2B;QACnC,MAAM,EAAE,YAAY,CAAC;KACtB;CACF"}
1
+ {"version":3,"file":"switch-config.d.ts","sourceRoot":"","sources":["../../../src/components/switch/switch-config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAEL,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAEhE;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,YAAY,CAAC;AAEzC;;;;;GAKG;AACH,MAAM,WAAW,YAAa,SAAQ,WAAW;CAAG;AAEpD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,YAGjC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,YAAY,CACnC,CAAC;AAExB,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,2BAA2B;QACnC,MAAM,EAAE,YAAY,CAAC;KACtB;CACF"}
@@ -1,12 +1,13 @@
1
1
  "use client";
2
2
  import { registerComponentDefaults as t } from "../../libs/registry.js";
3
- import { FALLBACK_FIELD_CONFIG as o, defaultFieldConfig as e } from "../field/field-config.js";
4
- const i = {
5
- ...e,
3
+ import { FALLBACK_FIELD_CONFIG as o } from "../field/field-config.js";
4
+ import { defaultInputConfig as i } from "../input/input-config.js";
5
+ const r = {
6
+ ...i,
6
7
  radius: "full"
7
8
  }, C = o;
8
- t("switch", i);
9
+ t("switch", r);
9
10
  export {
10
11
  C as FALLBACK_SWITCH_CONFIG,
11
- i as defaultSwitchConfig
12
+ r as defaultSwitchConfig
12
13
  };
@@ -1,4 +1,4 @@
1
- import { FieldSizeKey, FieldStatus } from '../field/field-config';
1
+ import { FieldSizeKey } from '../field/field-config';
2
2
  /**
3
3
  * CSS classes for switch track size.
4
4
  * Maps size keys to Tailwind width, height, and padding classes.
@@ -15,9 +15,4 @@ export declare const SWITCH_THUMB_SIZE_CLASS: Record<FieldSizeKey, string>;
15
15
  * the thumb moves when checked.
16
16
  */
17
17
  export declare const SWITCH_THUMB_TRANSLATE_CLASS: Record<FieldSizeKey, string>;
18
- /**
19
- * CSS classes for switch status border styles.
20
- * Re-exports the FIELD_STATUS_BORDER_CLASS for consistent validation styling.
21
- */
22
- export declare const SWITCH_STATUS_BORDER_CLASS: Record<FieldStatus, string>;
23
18
  //# sourceMappingURL=switch-styles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"switch-styles.d.ts","sourceRoot":"","sources":["../../../src/components/switch/switch-styles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEvE;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAIhE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAIhE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAIrE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAKlE,CAAC"}
1
+ {"version":3,"file":"switch-styles.d.ts","sourceRoot":"","sources":["../../../src/components/switch/switch-styles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAIhE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAIhE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAIrE,CAAC"}
@@ -1,25 +1,19 @@
1
1
  "use client";
2
- const r = {
2
+ const s = {
3
3
  sm: "w-8 h-4.5 p-0.5",
4
4
  md: "w-11 h-6 p-0.5",
5
5
  lg: "w-14 h-7.5 p-1"
6
- }, s = {
6
+ }, S = {
7
7
  sm: "size-3.5",
8
8
  md: "size-5",
9
9
  lg: "size-5.5"
10
- }, e = {
10
+ }, t = {
11
11
  sm: "translate-x-3.5",
12
12
  md: "translate-x-5",
13
13
  lg: "translate-x-6"
14
- }, S = {
15
- default: "border-border/60",
16
- error: "border-danger",
17
- warning: "border-warning",
18
- success: "border-success"
19
14
  };
20
15
  export {
21
- S as SWITCH_STATUS_BORDER_CLASS,
22
- s as SWITCH_THUMB_SIZE_CLASS,
23
- e as SWITCH_THUMB_TRANSLATE_CLASS,
24
- r as SWITCH_TRACK_SIZE_CLASS
16
+ S as SWITCH_THUMB_SIZE_CLASS,
17
+ t as SWITCH_THUMB_TRANSLATE_CLASS,
18
+ s as SWITCH_TRACK_SIZE_CLASS
25
19
  };
@@ -1,4 +1,5 @@
1
1
  import { default as React, TextareaHTMLAttributes } from 'react';
2
+ import { KeyboardOpenOptions } from '../keyboard';
2
3
  import { TextAreaConfig } from './textarea-config';
3
4
  type BaseTextAreaProps = TextAreaConfig & Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "size" | "color" | "children">;
4
5
  /**
@@ -38,9 +39,12 @@ export interface TextAreaProps extends BaseTextAreaProps {
38
39
  * Whether the virtual keyboard should be enabled for mobile devices.
39
40
  * Controls the inputmode attribute.
40
41
  *
42
+ * When enabled, the textarea will use the virtual keyboard system.
43
+ * Can also be an object to configure the keyboard behavior.
44
+ *
41
45
  * @default true
42
46
  */
43
- enableVirtualKeyboard?: boolean;
47
+ enableVirtualKeyboard?: boolean | KeyboardOpenOptions;
44
48
  }
45
49
  /**
46
50
  * A multi-line text input with label, description, validation message,
@@ -106,9 +110,23 @@ export interface TextAreaProps extends BaseTextAreaProps {
106
110
  * />
107
111
  * ```
108
112
  *
113
+ * @example
114
+ * ```tsx
115
+ * // With virtual keyboard configuration
116
+ * <TextArea
117
+ * label="Numeric Input"
118
+ * enableVirtualKeyboard={{
119
+ * layout: "numeric",
120
+ * size: "lg",
121
+ * color: "primary"
122
+ * }}
123
+ * />
124
+ * ```
125
+ *
109
126
  * @see TextAreaConfig - The configuration type for component defaults.
110
127
  * @see FieldShell - The wrapper component for label and validation.
111
128
  * @see useAsheeConfig - Hook for accessing the global configuration.
129
+ * @see useKeyboardField - Hook for connecting inputs to the virtual keyboard.
112
130
  */
113
131
  export declare const TextArea: React.ForwardRefExoticComponent<TextAreaProps & React.RefAttributes<HTMLTextAreaElement>>;
114
132
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../../src/components/textarea/Textarea.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,EAEZ,KAAK,sBAAsB,EAK5B,MAAM,OAAO,CAAC;AAkBf,OAAO,EAEL,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;AAQ3B,KAAK,iBAAiB,GAAG,cAAc,GACrC,IAAI,CACF,sBAAsB,CAAC,mBAAmB,CAAC,EAC3C,MAAM,GAAG,OAAO,GAAG,UAAU,CAC9B,CAAC;AAEJ;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,iBAAiB;IACtD;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;OAKG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AACH,eAAO,MAAM,QAAQ,2FA4KpB,CAAC"}
1
+ {"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../../src/components/textarea/Textarea.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,EAEZ,KAAK,sBAAsB,EAK5B,MAAM,OAAO,CAAC;AAiBf,OAAO,EAAE,KAAK,mBAAmB,EAAoB,MAAM,aAAa,CAAC;AACzE,OAAO,EAEL,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;AAQ3B,KAAK,iBAAiB,GAAG,cAAc,GACrC,IAAI,CACF,sBAAsB,CAAC,mBAAmB,CAAC,EAC3C,MAAM,GAAG,OAAO,GAAG,UAAU,CAC9B,CAAC;AAEJ;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,iBAAiB;IACtD;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;;;;OAQG;IACH,qBAAqB,CAAC,EAAE,OAAO,GAAG,mBAAmB,CAAC;CACvD;AAID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiFG;AACH,eAAO,MAAM,QAAQ,2FAyLpB,CAAC"}
@@ -1,134 +1,139 @@
1
1
  "use client";
2
- import { jsx as h } from "react/jsx-runtime";
3
- import { forwardRef as W, useRef as Y, useImperativeHandle as g, useId as q, useCallback as K } from "react";
4
- import { useAsheeConfig as ee } from "../../libs/context.js";
5
- import { resolveCascade as o, resolveRadiusKey as re, resolveClassKey as se } from "../../utils/resolve-token.js";
2
+ import { jsx as T } from "react/jsx-runtime";
3
+ import { forwardRef as q, useRef as V, useImperativeHandle as ee, useId as re, useCallback as E } from "react";
4
+ import { useAsheeConfig as se } from "../../libs/context.js";
5
+ import { resolveCascade as t, resolveRadiusKey as oe, resolveClassKey as te } from "../../utils/resolve-token.js";
6
6
  import { FieldShell as ae } from "../field/FieldShell.js";
7
7
  import { FALLBACK_TEXTAREA_CONFIG as r } from "./textarea-config.js";
8
- import { TEXTAREA_STATUS_BORDER_CLASS as oe, TEXTAREA_SIZE_CLASS as le } from "./textarea-styles.js";
9
- import { useKeyboardField as te } from "../keyboard/use-keyboard-field.js";
10
- import { resolveVariantClass as de } from "../../shared/variant.js";
11
- import { RADIUS_CLASS as ie } from "../../shared/radius.js";
12
- import { cn as ne } from "../../utils/cn.js";
13
- const ue = W(
8
+ import { TEXTAREA_STATUS_BORDER_CLASS as le, TEXTAREA_SIZE_CLASS as de } from "./textarea-styles.js";
9
+ import { useKeyboardField as ie } from "../keyboard/use-keyboard-field.js";
10
+ import { resolveVariantClass as ne } from "../../shared/variant.js";
11
+ import { RADIUS_CLASS as ce } from "../../shared/radius.js";
12
+ import { cn as ue } from "../../utils/cn.js";
13
+ const me = q(
14
14
  ({
15
- size: T,
16
- radius: I,
17
- variant: x,
18
- color: E,
19
- status: _,
20
- label: w,
21
- labelAlign: L,
15
+ size: I,
16
+ radius: x,
17
+ variant: K,
18
+ color: _,
19
+ status: w,
20
+ label: L,
21
+ labelAlign: z,
22
22
  description: u,
23
- message: c,
24
- required: m,
25
- isLoading: v,
26
- rows: z,
23
+ message: m,
24
+ required: v,
25
+ isLoading: f,
26
+ rows: B,
27
27
  id: C,
28
- className: B,
29
- disabled: F,
30
- style: N,
31
- onFocus: l,
32
- onBlur: t,
33
- enableVirtualKeyboard: X = !0,
34
- ...j
35
- }, k) => {
36
- var S;
37
- const d = ee(), e = (S = d.components) == null ? void 0 : S.textarea, n = Y(null);
38
- g(k, () => n.current);
39
- const D = q(), a = C ?? D, f = u ? `${a}-description` : void 0, A = c ? `${a}-message` : void 0, O = [f, A].filter(Boolean).join(" ") || void 0, { handleFocus: p, handleBlur: b } = te(a, n, X), U = K(
28
+ className: j,
29
+ disabled: k,
30
+ style: F,
31
+ onFocus: a,
32
+ onBlur: l,
33
+ enableVirtualKeyboard: d = !0,
34
+ ...N
35
+ }, O) => {
36
+ var h;
37
+ const i = se(), e = (h = i.components) == null ? void 0 : h.textarea, c = V(null);
38
+ ee(O, () => c.current);
39
+ const X = re(), o = C ?? X, p = u ? `${o}-description` : void 0, A = m ? `${o}-message` : void 0, D = [p, A].filter(Boolean).join(" ") || void 0, U = !!d, $ = typeof d == "object" && d !== null ? d : void 0, { handleFocus: y, handleBlur: b } = ie(
40
+ o,
41
+ c,
42
+ U,
43
+ $
44
+ ), G = E(
40
45
  (s) => {
41
- p(s), l == null || l(s);
46
+ y(s), a == null || a(s);
42
47
  },
43
- [p, l]
44
- ), V = K(
48
+ [y, a]
49
+ ), H = E(
45
50
  (s) => {
46
- b(), t == null || t(s);
51
+ b(), l == null || l(s);
47
52
  },
48
- [b, t]
49
- ), $ = o(
50
- T,
53
+ [b, l]
54
+ ), Z = t(
55
+ I,
51
56
  e == null ? void 0 : e.size,
52
57
  void 0,
53
58
  r.size
54
- ), y = o(
55
- x,
59
+ ), R = t(
60
+ K,
56
61
  e == null ? void 0 : e.variant,
57
- d.defaultVariant,
62
+ i.defaultVariant,
58
63
  r.variant
59
- ), G = o(
60
- E,
64
+ ), J = t(
65
+ _,
61
66
  e == null ? void 0 : e.color,
62
- d.defaultColor,
67
+ i.defaultColor,
63
68
  r.color
64
- ), R = (s) => s === "full" ? "xl" : s, H = re(
65
- R(I),
66
- R(e == null ? void 0 : e.radius),
67
- d.defaultRadius,
69
+ ), S = (s) => s === "full" ? "xl" : s, M = oe(
70
+ S(x),
71
+ S(e == null ? void 0 : e.radius),
72
+ i.defaultRadius,
68
73
  r.radius
69
- ), i = _ ?? r.status, Z = o(
70
- L,
74
+ ), n = w ?? r.status, P = t(
75
+ z,
71
76
  e == null ? void 0 : e.labelAlign,
72
77
  void 0,
73
78
  r.labelAlign
74
- ), J = o(
75
- z,
79
+ ), Q = t(
80
+ B,
76
81
  e == null ? void 0 : e.rows,
77
82
  void 0,
78
83
  r.rows
79
- ), M = de(
80
- y,
81
- G
82
- ), P = i !== "default" ? oe[i] : "", Q = y === "underlined" ? "rounded-none" : se(
83
- H,
84
- ie,
84
+ ), W = ne(
85
+ R,
86
+ J
87
+ ), Y = n !== "default" ? le[n] : "", g = R === "underlined" ? "rounded-none" : te(
88
+ M,
89
+ ce,
85
90
  r.radius
86
91
  );
87
- return /* @__PURE__ */ h(
92
+ return /* @__PURE__ */ T(
88
93
  ae,
89
94
  {
90
- id: a,
91
- label: w,
92
- labelAlign: Z,
95
+ id: o,
96
+ label: L,
97
+ labelAlign: P,
93
98
  description: u,
94
- descriptionId: f,
95
- message: c,
99
+ descriptionId: p,
100
+ message: m,
96
101
  messageId: A,
97
- status: i,
98
- required: m,
99
- isLoading: v,
100
- children: /* @__PURE__ */ h(
102
+ status: n,
103
+ required: v,
104
+ isLoading: f,
105
+ children: /* @__PURE__ */ T(
101
106
  "textarea",
102
107
  {
103
- ref: n,
104
- id: a,
105
- disabled: F,
106
- required: m,
107
- rows: J,
108
- "aria-busy": v,
109
- "aria-invalid": i === "error",
110
- "aria-describedby": O,
111
- onFocus: U,
112
- onBlur: V,
113
- className: ne(
108
+ ref: c,
109
+ id: o,
110
+ disabled: k,
111
+ required: v,
112
+ rows: Q,
113
+ "aria-busy": f,
114
+ "aria-invalid": n === "error",
115
+ "aria-describedby": D,
116
+ onFocus: G,
117
+ onBlur: H,
118
+ className: ue(
114
119
  "resize-y w-full text-foreground outline-none transition-colors shrink-0",
115
120
  "focus-visible:ring-2 focus-visible:ring-offset-2",
116
121
  "disabled:pointer-events-none disabled:opacity-50",
117
- le[$],
118
- M,
119
- P,
120
- Q,
121
- B
122
+ de[Z],
123
+ W,
124
+ Y,
125
+ g,
126
+ j
122
127
  ),
123
- style: N,
124
- ...j
128
+ style: F,
129
+ ...N
125
130
  }
126
131
  )
127
132
  }
128
133
  );
129
134
  }
130
135
  );
131
- ue.displayName = "TextArea";
136
+ me.displayName = "TextArea";
132
137
  export {
133
- ue as TextArea
138
+ me as TextArea
134
139
  };