asheeui 0.6.7 → 0.6.9
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/autocomplete/Autocomplete.d.ts +34 -17
- package/dist/components/autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/components/autocomplete/Autocomplete.js +90 -106
- package/dist/components/autocomplete/autocomplete-config.d.ts +2 -20
- package/dist/components/autocomplete/autocomplete-config.d.ts.map +1 -1
- package/dist/components/autocomplete/autocomplete-config.js +9 -13
- package/dist/components/button/Button.d.ts +31 -5
- package/dist/components/button/Button.d.ts.map +1 -1
- package/dist/components/button/Button.js +68 -64
- package/dist/components/card/Card.d.ts +58 -54
- package/dist/components/card/Card.d.ts.map +1 -1
- package/dist/components/card/Card.js +152 -158
- package/dist/components/card/card-config.d.ts +66 -33
- package/dist/components/card/card-config.d.ts.map +1 -1
- package/dist/components/card/card-config.js +9 -9
- package/dist/components/date-picker/Calendar.d.ts +57 -0
- package/dist/components/date-picker/Calendar.d.ts.map +1 -0
- package/dist/components/date-picker/Calendar.js +224 -0
- package/dist/components/date-picker/DatePicker.d.ts +68 -155
- package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
- package/dist/components/date-picker/DatePicker.js +194 -466
- package/dist/components/date-picker/TimeSpinner.d.ts +46 -0
- package/dist/components/date-picker/TimeSpinner.d.ts.map +1 -0
- package/dist/components/date-picker/TimeSpinner.js +84 -0
- package/dist/components/date-picker/date-picker-config.d.ts +21 -1
- package/dist/components/date-picker/date-picker-config.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker-config.js +10 -14
- package/dist/components/date-picker/date-picker-styles.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker-styles.js +4 -11
- package/dist/components/date-picker/date-picker.helpers.d.ts +111 -0
- package/dist/components/date-picker/date-picker.helpers.d.ts.map +1 -0
- package/dist/components/date-picker/date-picker.helpers.js +110 -0
- package/dist/components/date-picker/index.js +3 -0
- package/dist/components/input/Input.d.ts +13 -7
- package/dist/components/input/Input.d.ts.map +1 -1
- package/dist/components/input/Input.js +96 -91
- package/dist/components/keyboard/KeyboardContext.d.ts +130 -0
- package/dist/components/keyboard/KeyboardContext.d.ts.map +1 -0
- package/dist/components/keyboard/KeyboardContext.js +13 -0
- package/dist/components/keyboard/KeyboardProvider.d.ts +78 -0
- package/dist/components/keyboard/KeyboardProvider.d.ts.map +1 -0
- package/dist/components/keyboard/KeyboardProvider.js +183 -0
- package/dist/components/keyboard/OnScreenKeyboard.d.ts +65 -43
- package/dist/components/keyboard/OnScreenKeyboard.d.ts.map +1 -1
- package/dist/components/keyboard/OnScreenKeyboard.js +119 -113
- package/dist/components/keyboard/index.d.ts +2 -1
- package/dist/components/keyboard/index.d.ts.map +1 -1
- package/dist/components/keyboard/index.js +2 -1
- package/dist/components/keyboard/keyboard-config.d.ts +40 -36
- package/dist/components/keyboard/keyboard-config.d.ts.map +1 -1
- package/dist/components/keyboard/keyboard-config.js +15 -10
- package/dist/components/keyboard/use-keyboard-field.d.ts +6 -4
- package/dist/components/keyboard/use-keyboard-field.d.ts.map +1 -1
- package/dist/components/keyboard/use-keyboard-field.js +12 -12
- package/dist/components/modal/Modal.d.ts.map +1 -1
- package/dist/components/modal/Modal.js +59 -65
- package/dist/components/multi-select/MultiSelect.d.ts +75 -40
- package/dist/components/multi-select/MultiSelect.d.ts.map +1 -1
- package/dist/components/multi-select/MultiSelect.js +188 -188
- package/dist/components/multi-select/multi-select-config.d.ts +2 -20
- package/dist/components/multi-select/multi-select-config.d.ts.map +1 -1
- package/dist/components/multi-select/multi-select-config.js +10 -14
- package/dist/components/select/Select.d.ts +60 -45
- package/dist/components/select/Select.d.ts.map +1 -1
- package/dist/components/select/Select.js +149 -161
- package/dist/components/select/select-config.d.ts +3 -29
- package/dist/components/select/select-config.d.ts.map +1 -1
- package/dist/components/select/select-config.js +6 -14
- package/dist/components/select/select-styles.js +1 -6
- package/dist/components/select-menu/SelectMenu.d.ts +48 -42
- package/dist/components/select-menu/SelectMenu.d.ts.map +1 -1
- package/dist/components/select-menu/SelectMenu.js +137 -123
- package/dist/components/select-menu/select-menu-config.d.ts +33 -2
- package/dist/components/select-menu/select-menu-config.d.ts.map +1 -1
- package/dist/components/select-menu/select-menu-config.js +3 -1
- package/dist/components/sidebar/Sidebar.js +1 -1
- package/dist/components/switch/Switch.d.ts +9 -33
- package/dist/components/switch/Switch.d.ts.map +1 -1
- package/dist/components/switch/Switch.js +68 -74
- package/dist/components/switch/switch-styles.d.ts +1 -6
- package/dist/components/switch/switch-styles.d.ts.map +1 -1
- package/dist/components/switch/switch-styles.js +6 -12
- package/dist/components/tabs/Tabs.js +1 -1
- package/dist/components/textarea/Textarea.d.ts +19 -1
- package/dist/components/textarea/Textarea.d.ts.map +1 -1
- package/dist/components/textarea/Textarea.js +95 -90
- package/dist/components/toast/ToastContext.d.ts +122 -0
- package/dist/components/toast/ToastContext.d.ts.map +1 -0
- package/dist/components/toast/ToastContext.js +28 -0
- package/dist/components/toast/ToastProvider.d.ts +98 -0
- package/dist/components/toast/ToastProvider.d.ts.map +1 -0
- package/dist/components/toast/ToastProvider.js +188 -0
- package/dist/components/toast/index.d.ts +2 -1
- package/dist/components/toast/index.d.ts.map +1 -1
- package/dist/components/toast/index.js +2 -1
- package/dist/components/toast/toast-config.d.ts +36 -0
- package/dist/components/toast/toast-config.d.ts.map +1 -1
- package/dist/icons/ChevronUpIcon.d.ts +3 -0
- package/dist/icons/ChevronUpIcon.d.ts.map +1 -0
- package/dist/icons/ChevronUpIcon.js +21 -0
- package/dist/icons/index.d.ts +2 -0
- package/dist/icons/index.d.ts.map +1 -1
- package/dist/index.css +24 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +62 -59
- package/dist/theme/color.js +2 -2
- package/package.json +1 -1
- package/dist/components/keyboard/keyboard-context.d.ts +0 -118
- package/dist/components/keyboard/keyboard-context.d.ts.map +0 -1
- package/dist/components/keyboard/keyboard-context.js +0 -90
- package/dist/components/toast/toast-context.d.ts +0 -163
- package/dist/components/toast/toast-context.d.ts.map +0 -1
- package/dist/components/toast/toast-context.js +0 -177
|
@@ -1,89 +1,85 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as r, jsxs as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { useAsheeConfig as
|
|
5
|
-
import { resolveCascade as
|
|
6
|
-
import { FieldShell as
|
|
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
|
|
9
|
-
import { RADIUS_CLASS as
|
|
10
|
-
import { resolveVariantClass as
|
|
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
|
|
12
|
+
const re = G(
|
|
13
13
|
({
|
|
14
|
-
size:
|
|
15
|
-
color:
|
|
16
|
-
radius:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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:
|
|
25
|
-
className:
|
|
26
|
-
style:
|
|
27
|
-
disabled:
|
|
22
|
+
id: z,
|
|
23
|
+
className: T,
|
|
24
|
+
style: x,
|
|
25
|
+
disabled: N,
|
|
28
26
|
checked: c,
|
|
29
|
-
defaultChecked:
|
|
30
|
-
onChange:
|
|
31
|
-
...
|
|
32
|
-
},
|
|
33
|
-
var
|
|
34
|
-
const
|
|
35
|
-
|
|
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 =
|
|
40
|
-
|
|
37
|
+
), F = u(
|
|
38
|
+
k,
|
|
41
39
|
e == null ? void 0 : e.color,
|
|
42
|
-
|
|
40
|
+
S.defaultColor,
|
|
43
41
|
s.color
|
|
44
|
-
),
|
|
45
|
-
|
|
42
|
+
), U = Q(
|
|
43
|
+
A,
|
|
46
44
|
e == null ? void 0 : e.radius,
|
|
47
45
|
void 0,
|
|
48
46
|
s.radius
|
|
49
|
-
),
|
|
50
|
-
|
|
47
|
+
), W = u(
|
|
48
|
+
I,
|
|
51
49
|
e == null ? void 0 : e.labelAlign,
|
|
52
50
|
void 0,
|
|
53
51
|
s.labelAlign
|
|
54
|
-
),
|
|
52
|
+
), B = l(
|
|
55
53
|
m,
|
|
56
|
-
|
|
54
|
+
Y,
|
|
57
55
|
s.size
|
|
58
|
-
),
|
|
56
|
+
), E = l(
|
|
59
57
|
m,
|
|
60
|
-
|
|
58
|
+
$,
|
|
61
59
|
s.size
|
|
62
|
-
),
|
|
60
|
+
), j = l(
|
|
63
61
|
m,
|
|
64
|
-
|
|
62
|
+
q,
|
|
65
63
|
s.size
|
|
66
|
-
),
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
), h = l(
|
|
65
|
+
U,
|
|
66
|
+
ee,
|
|
69
67
|
s.radius
|
|
70
|
-
),
|
|
71
|
-
(
|
|
68
|
+
), D = se("solid", F), i = N || n, M = J(
|
|
69
|
+
(f) => {
|
|
72
70
|
if (i) return;
|
|
73
|
-
const
|
|
74
|
-
c === void 0 &&
|
|
71
|
+
const v = f.target.checked;
|
|
72
|
+
c === void 0 && g(v), o == null || o(v, f);
|
|
75
73
|
},
|
|
76
|
-
[c, i,
|
|
74
|
+
[c, i, o]
|
|
77
75
|
);
|
|
78
76
|
return /* @__PURE__ */ r(
|
|
79
|
-
|
|
77
|
+
X,
|
|
80
78
|
{
|
|
81
79
|
id: d,
|
|
82
|
-
label:
|
|
83
|
-
labelAlign:
|
|
84
|
-
description:
|
|
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__ */
|
|
93
|
+
children: /* @__PURE__ */ Z(
|
|
98
94
|
"div",
|
|
99
95
|
{
|
|
100
96
|
className: a(
|
|
101
97
|
"relative shrink-0 inline-flex items-center",
|
|
102
|
-
|
|
98
|
+
B
|
|
103
99
|
),
|
|
104
100
|
children: [
|
|
105
101
|
/* @__PURE__ */ r(
|
|
106
102
|
"input",
|
|
107
103
|
{
|
|
108
|
-
ref:
|
|
104
|
+
ref: H,
|
|
109
105
|
id: d,
|
|
110
106
|
type: "checkbox",
|
|
111
107
|
role: "switch",
|
|
112
|
-
checked:
|
|
108
|
+
checked: t,
|
|
113
109
|
disabled: i,
|
|
114
110
|
required: p,
|
|
115
|
-
"aria-checked":
|
|
116
|
-
"aria-invalid": u === "error",
|
|
111
|
+
"aria-checked": t,
|
|
117
112
|
"aria-busy": n,
|
|
118
|
-
onChange:
|
|
113
|
+
onChange: M,
|
|
119
114
|
className: "sr-only peer",
|
|
120
|
-
...
|
|
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
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
w
|
|
124
|
+
h,
|
|
125
|
+
t ? D : "bg-secondary",
|
|
126
|
+
T
|
|
133
127
|
),
|
|
134
|
-
style:
|
|
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
|
-
|
|
144
|
-
|
|
145
|
-
|
|
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
|
-
|
|
152
|
+
re.displayName = "Switch";
|
|
159
153
|
export {
|
|
160
|
-
|
|
154
|
+
re as Switch
|
|
161
155
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FieldSizeKey
|
|
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,
|
|
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
|
|
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
|
-
},
|
|
6
|
+
}, S = {
|
|
7
7
|
sm: "size-3.5",
|
|
8
8
|
md: "size-5",
|
|
9
9
|
lg: "size-5.5"
|
|
10
|
-
},
|
|
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
|
|
22
|
-
|
|
23
|
-
|
|
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
|
};
|
|
@@ -138,7 +138,7 @@ const pe = ae(
|
|
|
138
138
|
role: "tablist",
|
|
139
139
|
"aria-orientation": "horizontal",
|
|
140
140
|
className: g(
|
|
141
|
-
"flex flex-row w-full items-center overflow-x-auto
|
|
141
|
+
"flex flex-row w-full items-center overflow-x-auto scrollable-hidden shrink-0",
|
|
142
142
|
le,
|
|
143
143
|
v !== "underline" && ie,
|
|
144
144
|
F
|
|
@@ -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;
|
|
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
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { useAsheeConfig as
|
|
5
|
-
import { resolveCascade as
|
|
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
|
|
9
|
-
import { useKeyboardField as
|
|
10
|
-
import { resolveVariantClass as
|
|
11
|
-
import { RADIUS_CLASS as
|
|
12
|
-
import { cn as
|
|
13
|
-
const
|
|
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:
|
|
16
|
-
radius:
|
|
17
|
-
variant:
|
|
18
|
-
color:
|
|
19
|
-
status:
|
|
20
|
-
label:
|
|
21
|
-
labelAlign:
|
|
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:
|
|
24
|
-
required:
|
|
25
|
-
isLoading:
|
|
26
|
-
rows:
|
|
23
|
+
message: m,
|
|
24
|
+
required: v,
|
|
25
|
+
isLoading: f,
|
|
26
|
+
rows: B,
|
|
27
27
|
id: C,
|
|
28
|
-
className:
|
|
29
|
-
disabled:
|
|
30
|
-
style:
|
|
31
|
-
onFocus:
|
|
32
|
-
onBlur:
|
|
33
|
-
enableVirtualKeyboard:
|
|
34
|
-
...
|
|
35
|
-
},
|
|
36
|
-
var
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
const
|
|
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
|
-
|
|
46
|
+
y(s), a == null || a(s);
|
|
42
47
|
},
|
|
43
|
-
[
|
|
44
|
-
),
|
|
48
|
+
[y, a]
|
|
49
|
+
), H = E(
|
|
45
50
|
(s) => {
|
|
46
|
-
b(),
|
|
51
|
+
b(), l == null || l(s);
|
|
47
52
|
},
|
|
48
|
-
[b,
|
|
49
|
-
),
|
|
50
|
-
|
|
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
|
-
),
|
|
55
|
-
|
|
59
|
+
), R = t(
|
|
60
|
+
K,
|
|
56
61
|
e == null ? void 0 : e.variant,
|
|
57
|
-
|
|
62
|
+
i.defaultVariant,
|
|
58
63
|
r.variant
|
|
59
|
-
),
|
|
60
|
-
|
|
64
|
+
), J = t(
|
|
65
|
+
_,
|
|
61
66
|
e == null ? void 0 : e.color,
|
|
62
|
-
|
|
67
|
+
i.defaultColor,
|
|
63
68
|
r.color
|
|
64
|
-
),
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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
|
-
),
|
|
70
|
-
|
|
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
|
-
),
|
|
75
|
-
|
|
79
|
+
), Q = t(
|
|
80
|
+
B,
|
|
76
81
|
e == null ? void 0 : e.rows,
|
|
77
82
|
void 0,
|
|
78
83
|
r.rows
|
|
79
|
-
),
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
),
|
|
83
|
-
|
|
84
|
-
|
|
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__ */
|
|
92
|
+
return /* @__PURE__ */ T(
|
|
88
93
|
ae,
|
|
89
94
|
{
|
|
90
|
-
id:
|
|
91
|
-
label:
|
|
92
|
-
labelAlign:
|
|
95
|
+
id: o,
|
|
96
|
+
label: L,
|
|
97
|
+
labelAlign: P,
|
|
93
98
|
description: u,
|
|
94
|
-
descriptionId:
|
|
95
|
-
message:
|
|
99
|
+
descriptionId: p,
|
|
100
|
+
message: m,
|
|
96
101
|
messageId: A,
|
|
97
|
-
status:
|
|
98
|
-
required:
|
|
99
|
-
isLoading:
|
|
100
|
-
children: /* @__PURE__ */
|
|
102
|
+
status: n,
|
|
103
|
+
required: v,
|
|
104
|
+
isLoading: f,
|
|
105
|
+
children: /* @__PURE__ */ T(
|
|
101
106
|
"textarea",
|
|
102
107
|
{
|
|
103
|
-
ref:
|
|
104
|
-
id:
|
|
105
|
-
disabled:
|
|
106
|
-
required:
|
|
107
|
-
rows:
|
|
108
|
-
"aria-busy":
|
|
109
|
-
"aria-invalid":
|
|
110
|
-
"aria-describedby":
|
|
111
|
-
onFocus:
|
|
112
|
-
onBlur:
|
|
113
|
-
className:
|
|
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
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
+
de[Z],
|
|
123
|
+
W,
|
|
124
|
+
Y,
|
|
125
|
+
g,
|
|
126
|
+
j
|
|
122
127
|
),
|
|
123
|
-
style:
|
|
124
|
-
...
|
|
128
|
+
style: F,
|
|
129
|
+
...N
|
|
125
130
|
}
|
|
126
131
|
)
|
|
127
132
|
}
|
|
128
133
|
);
|
|
129
134
|
}
|
|
130
135
|
);
|
|
131
|
-
|
|
136
|
+
me.displayName = "TextArea";
|
|
132
137
|
export {
|
|
133
|
-
|
|
138
|
+
me as TextArea
|
|
134
139
|
};
|