@spark-ui/components 10.22.1 → 11.0.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.
- package/package.json +5 -5
- package/dist/DialogTrigger-woU7vsJi.d.ts +0 -142
- package/dist/Input-N8AWWSmt.d.ts +0 -41
- package/dist/InputTrailingIcon-ZZx8PoJy.d.ts +0 -20
- package/dist/LabelRequiredIndicator-DRnCzHMU.d.ts +0 -19
- package/dist/accordion/index.d.ts +0 -73
- package/dist/accordion/index.js +0 -325
- package/dist/accordion/index.js.map +0 -1
- package/dist/alert-dialog/index.d.ts +0 -119
- package/dist/alert-dialog/index.js +0 -1554
- package/dist/alert-dialog/index.js.map +0 -1
- package/dist/avatar/index.d.ts +0 -66
- package/dist/avatar/index.js +0 -1303
- package/dist/avatar/index.js.map +0 -1
- package/dist/badge/index.d.ts +0 -47
- package/dist/badge/index.js +0 -122
- package/dist/badge/index.js.map +0 -1
- package/dist/breadcrumb/index.d.ts +0 -64
- package/dist/breadcrumb/index.js +0 -327
- package/dist/breadcrumb/index.js.map +0 -1
- package/dist/button/index.d.ts +0 -41
- package/dist/button/index.js +0 -935
- package/dist/button/index.js.map +0 -1
- package/dist/card/index.d.ts +0 -61
- package/dist/card/index.js +0 -502
- package/dist/card/index.js.map +0 -1
- package/dist/carousel/index.d.ts +0 -261
- package/dist/carousel/index.js +0 -1801
- package/dist/carousel/index.js.map +0 -1
- package/dist/checkbox/index.d.ts +0 -120
- package/dist/checkbox/index.js +0 -511
- package/dist/checkbox/index.js.map +0 -1
- package/dist/chip/index.d.ts +0 -97
- package/dist/chip/index.js +0 -908
- package/dist/chip/index.js.map +0 -1
- package/dist/collapsible/index.d.ts +0 -43
- package/dist/collapsible/index.js +0 -109
- package/dist/collapsible/index.js.map +0 -1
- package/dist/combobox/index.d.ts +0 -287
- package/dist/combobox/index.js +0 -2588
- package/dist/combobox/index.js.map +0 -1
- package/dist/dialog/index.d.ts +0 -33
- package/dist/dialog/index.js +0 -1389
- package/dist/dialog/index.js.map +0 -1
- package/dist/divider/index.d.ts +0 -61
- package/dist/divider/index.js +0 -224
- package/dist/divider/index.js.map +0 -1
- package/dist/drawer/index.d.ts +0 -152
- package/dist/drawer/index.js +0 -1400
- package/dist/drawer/index.js.map +0 -1
- package/dist/dropdown/index.d.ts +0 -233
- package/dist/dropdown/index.js +0 -2051
- package/dist/dropdown/index.js.map +0 -1
- package/dist/form-field/index.d.ts +0 -186
- package/dist/form-field/index.js +0 -553
- package/dist/form-field/index.js.map +0 -1
- package/dist/icon/index.d.ts +0 -28
- package/dist/icon/index.js +0 -127
- package/dist/icon/index.js.map +0 -1
- package/dist/icon-button/index.d.ts +0 -16
- package/dist/icon-button/index.js +0 -980
- package/dist/icon-button/index.js.map +0 -1
- package/dist/input/index.d.ts +0 -78
- package/dist/input/index.js +0 -724
- package/dist/input/index.js.map +0 -1
- package/dist/kbd/index.d.ts +0 -9
- package/dist/kbd/index.js +0 -47
- package/dist/kbd/index.js.map +0 -1
- package/dist/label/index.d.ts +0 -11
- package/dist/label/index.js +0 -78
- package/dist/label/index.js.map +0 -1
- package/dist/link-box/index.d.ts +0 -34
- package/dist/link-box/index.js +0 -92
- package/dist/link-box/index.js.map +0 -1
- package/dist/pagination/index.d.ts +0 -143
- package/dist/pagination/index.js +0 -1353
- package/dist/pagination/index.js.map +0 -1
- package/dist/popover/index.d.ts +0 -93
- package/dist/popover/index.js +0 -1339
- package/dist/popover/index.js.map +0 -1
- package/dist/portal/index.d.ts +0 -13
- package/dist/portal/index.js +0 -37
- package/dist/portal/index.js.map +0 -1
- package/dist/progress/index.d.ts +0 -48
- package/dist/progress/index.js +0 -223
- package/dist/progress/index.js.map +0 -1
- package/dist/progress-tracker/index.d.ts +0 -80
- package/dist/progress-tracker/index.js +0 -571
- package/dist/progress-tracker/index.js.map +0 -1
- package/dist/radio-group/index.d.ts +0 -100
- package/dist/radio-group/index.js +0 -318
- package/dist/radio-group/index.js.map +0 -1
- package/dist/rating/index.d.ts +0 -78
- package/dist/rating/index.js +0 -363
- package/dist/rating/index.js.map +0 -1
- package/dist/scrolling-list/index.d.ts +0 -118
- package/dist/scrolling-list/index.js +0 -1426
- package/dist/scrolling-list/index.js.map +0 -1
- package/dist/segmented-gauge/index.d.ts +0 -100
- package/dist/segmented-gauge/index.js +0 -277
- package/dist/segmented-gauge/index.js.map +0 -1
- package/dist/select/index.d.ts +0 -167
- package/dist/select/index.js +0 -581
- package/dist/select/index.js.map +0 -1
- package/dist/skeleton/index.d.ts +0 -67
- package/dist/skeleton/index.js +0 -206
- package/dist/skeleton/index.js.map +0 -1
- package/dist/slider/index.d.ts +0 -97
- package/dist/slider/index.js +0 -220
- package/dist/slider/index.js.map +0 -1
- package/dist/slot/index.d.ts +0 -16
- package/dist/slot/index.js +0 -51
- package/dist/slot/index.js.map +0 -1
- package/dist/snackbar/index.d.ts +0 -158
- package/dist/snackbar/index.js +0 -1756
- package/dist/snackbar/index.js.map +0 -1
- package/dist/spinner/index.d.ts +0 -21
- package/dist/spinner/index.js +0 -139
- package/dist/spinner/index.js.map +0 -1
- package/dist/stepper/index.d.ts +0 -81
- package/dist/stepper/index.js +0 -1847
- package/dist/stepper/index.js.map +0 -1
- package/dist/switch/index.d.ts +0 -64
- package/dist/switch/index.js +0 -327
- package/dist/switch/index.js.map +0 -1
- package/dist/tabs/index.d.ts +0 -103
- package/dist/tabs/index.js +0 -1376
- package/dist/tabs/index.js.map +0 -1
- package/dist/tag/index.d.ts +0 -29
- package/dist/tag/index.js +0 -283
- package/dist/tag/index.js.map +0 -1
- package/dist/text-link/index.d.ts +0 -20
- package/dist/text-link/index.js +0 -100
- package/dist/text-link/index.js.map +0 -1
- package/dist/textarea/index.d.ts +0 -57
- package/dist/textarea/index.js +0 -797
- package/dist/textarea/index.js.map +0 -1
- package/dist/toast/index.d.ts +0 -56
- package/dist/toast/index.js +0 -1412
- package/dist/toast/index.js.map +0 -1
- package/dist/visually-hidden/index.d.ts +0 -16
- package/dist/visually-hidden/index.js +0 -67
- package/dist/visually-hidden/index.js.map +0 -1
package/dist/textarea/index.js
DELETED
|
@@ -1,797 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/textarea/index.ts
|
|
21
|
-
var textarea_exports = {};
|
|
22
|
-
__export(textarea_exports, {
|
|
23
|
-
Textarea: () => Textarea,
|
|
24
|
-
TextareaGroup: () => TextareaGroup2
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(textarea_exports);
|
|
27
|
-
|
|
28
|
-
// src/input/InputClearButton.tsx
|
|
29
|
-
var import_DeleteOutline = require("@spark-ui/icons/DeleteOutline");
|
|
30
|
-
var import_class_variance_authority2 = require("class-variance-authority");
|
|
31
|
-
|
|
32
|
-
// src/icon/Icon.tsx
|
|
33
|
-
var import_react2 = require("react");
|
|
34
|
-
|
|
35
|
-
// src/slot/Slot.tsx
|
|
36
|
-
var import_radix_ui = require("radix-ui");
|
|
37
|
-
var import_react = require("react");
|
|
38
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
39
|
-
var Slottable = import_radix_ui.Slot.Slottable;
|
|
40
|
-
var Slot = ({ ref, ...props }) => {
|
|
41
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_radix_ui.Slot.Root, { ref, ...props });
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
// src/visually-hidden/VisuallyHidden.tsx
|
|
45
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
46
|
-
var VisuallyHidden = ({ asChild = false, ref, ...props }) => {
|
|
47
|
-
const Component = asChild ? Slot : "span";
|
|
48
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
49
|
-
Component,
|
|
50
|
-
{
|
|
51
|
-
...props,
|
|
52
|
-
ref,
|
|
53
|
-
style: {
|
|
54
|
-
// See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
|
|
55
|
-
position: "absolute",
|
|
56
|
-
border: 0,
|
|
57
|
-
width: 1,
|
|
58
|
-
height: 1,
|
|
59
|
-
padding: 0,
|
|
60
|
-
margin: -1,
|
|
61
|
-
overflow: "hidden",
|
|
62
|
-
clip: "rect(0, 0, 0, 0)",
|
|
63
|
-
whiteSpace: "nowrap",
|
|
64
|
-
wordWrap: "normal",
|
|
65
|
-
...props.style
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
);
|
|
69
|
-
};
|
|
70
|
-
VisuallyHidden.displayName = "VisuallyHidden";
|
|
71
|
-
|
|
72
|
-
// src/icon/Icon.styles.tsx
|
|
73
|
-
var import_internal_utils = require("@spark-ui/internal-utils");
|
|
74
|
-
var import_class_variance_authority = require("class-variance-authority");
|
|
75
|
-
var iconStyles = (0, import_class_variance_authority.cva)(["fill-current shrink-0"], {
|
|
76
|
-
variants: {
|
|
77
|
-
/**
|
|
78
|
-
* Color scheme of the icon.
|
|
79
|
-
*/
|
|
80
|
-
intent: (0, import_internal_utils.makeVariants)({
|
|
81
|
-
current: ["text-current"],
|
|
82
|
-
main: ["text-main"],
|
|
83
|
-
support: ["text-support"],
|
|
84
|
-
accent: ["text-accent"],
|
|
85
|
-
basic: ["text-basic"],
|
|
86
|
-
success: ["text-success"],
|
|
87
|
-
alert: ["text-alert"],
|
|
88
|
-
error: ["text-error"],
|
|
89
|
-
info: ["text-info"],
|
|
90
|
-
neutral: ["text-neutral"]
|
|
91
|
-
}),
|
|
92
|
-
/**
|
|
93
|
-
* Sets the size of the icon.
|
|
94
|
-
*/
|
|
95
|
-
size: (0, import_internal_utils.makeVariants)({
|
|
96
|
-
current: ["u-current-font-size"],
|
|
97
|
-
sm: ["w-sz-16", "h-sz-16"],
|
|
98
|
-
md: ["w-sz-24", "h-sz-24"],
|
|
99
|
-
lg: ["w-sz-32", "h-sz-32"],
|
|
100
|
-
xl: ["w-sz-40", "h-sz-40"]
|
|
101
|
-
})
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
// src/icon/Icon.tsx
|
|
106
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
107
|
-
var Icon = ({
|
|
108
|
-
label,
|
|
109
|
-
className,
|
|
110
|
-
size = "current",
|
|
111
|
-
intent = "current",
|
|
112
|
-
children,
|
|
113
|
-
...others
|
|
114
|
-
}) => {
|
|
115
|
-
const child = import_react2.Children.only(children);
|
|
116
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
117
|
-
(0, import_react2.cloneElement)(child, {
|
|
118
|
-
className: iconStyles({ className, size, intent }),
|
|
119
|
-
"data-spark-component": "icon",
|
|
120
|
-
"aria-hidden": "true",
|
|
121
|
-
focusable: "false",
|
|
122
|
-
...others
|
|
123
|
-
}),
|
|
124
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(VisuallyHidden, { children: label })
|
|
125
|
-
] });
|
|
126
|
-
};
|
|
127
|
-
Icon.displayName = "Icon";
|
|
128
|
-
|
|
129
|
-
// src/input/InputGroupContext.ts
|
|
130
|
-
var import_react3 = require("react");
|
|
131
|
-
var InputGroupContext = (0, import_react3.createContext)(null);
|
|
132
|
-
var useInputGroup = () => {
|
|
133
|
-
const context = (0, import_react3.useContext)(InputGroupContext);
|
|
134
|
-
return context || { isStandalone: true };
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
// src/input/InputClearButton.tsx
|
|
138
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
139
|
-
var Root = ({
|
|
140
|
-
className,
|
|
141
|
-
tabIndex = -1,
|
|
142
|
-
onClick,
|
|
143
|
-
inline = false,
|
|
144
|
-
ref,
|
|
145
|
-
...others
|
|
146
|
-
}) => {
|
|
147
|
-
const { onClear, hasTrailingIcon } = useInputGroup();
|
|
148
|
-
const handleClick = (event) => {
|
|
149
|
-
if (onClick) {
|
|
150
|
-
onClick(event);
|
|
151
|
-
}
|
|
152
|
-
if (onClear) {
|
|
153
|
-
onClear();
|
|
154
|
-
}
|
|
155
|
-
};
|
|
156
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
157
|
-
"button",
|
|
158
|
-
{
|
|
159
|
-
ref,
|
|
160
|
-
"data-spark-component": "input-clear-button",
|
|
161
|
-
className: (0, import_class_variance_authority2.cx)(
|
|
162
|
-
className,
|
|
163
|
-
"pointer-events-auto absolute",
|
|
164
|
-
inline ? "h-sz-44 top-0 -translate-y-0" : "top-1/2 -translate-y-1/2",
|
|
165
|
-
"inline-flex h-full items-center justify-center outline-hidden",
|
|
166
|
-
"text-neutral hover:text-neutral-hovered",
|
|
167
|
-
hasTrailingIcon ? "right-3xl px-sz-12" : "pl-md pr-lg right-0"
|
|
168
|
-
),
|
|
169
|
-
tabIndex,
|
|
170
|
-
onClick: handleClick,
|
|
171
|
-
type: "button",
|
|
172
|
-
...others,
|
|
173
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_DeleteOutline.DeleteOutline, {}) })
|
|
174
|
-
}
|
|
175
|
-
);
|
|
176
|
-
};
|
|
177
|
-
var InputClearButton = Object.assign(Root, {
|
|
178
|
-
id: "ClearButton"
|
|
179
|
-
});
|
|
180
|
-
Root.displayName = "InputGroup.ClearButton";
|
|
181
|
-
|
|
182
|
-
// src/input/InputGroup.tsx
|
|
183
|
-
var import_form_field = require("@spark-ui/components/form-field");
|
|
184
|
-
var import_use_combined_state = require("@spark-ui/hooks/use-combined-state");
|
|
185
|
-
var import_use_merge_refs = require("@spark-ui/hooks/use-merge-refs");
|
|
186
|
-
var import_react4 = require("react");
|
|
187
|
-
|
|
188
|
-
// src/input/InputGroup.styles.ts
|
|
189
|
-
var import_class_variance_authority3 = require("class-variance-authority");
|
|
190
|
-
var inputGroupStyles = (0, import_class_variance_authority3.cva)(["relative inline-flex w-full"], {
|
|
191
|
-
variants: {
|
|
192
|
-
/**
|
|
193
|
-
* When `true`, prevents the user from interacting.
|
|
194
|
-
*/
|
|
195
|
-
disabled: {
|
|
196
|
-
true: [
|
|
197
|
-
"cursor-not-allowed",
|
|
198
|
-
"relative",
|
|
199
|
-
"after:absolute",
|
|
200
|
-
"after:top-0",
|
|
201
|
-
"after:h-full",
|
|
202
|
-
"after:w-full",
|
|
203
|
-
"after:border-sm after:border-outline",
|
|
204
|
-
"after:rounded-lg"
|
|
205
|
-
],
|
|
206
|
-
false: "after:hidden"
|
|
207
|
-
},
|
|
208
|
-
/**
|
|
209
|
-
* Sets the component as interactive or not.
|
|
210
|
-
*/
|
|
211
|
-
readOnly: {
|
|
212
|
-
true: [
|
|
213
|
-
"relative",
|
|
214
|
-
"after:absolute",
|
|
215
|
-
"after:top-0",
|
|
216
|
-
"after:h-full",
|
|
217
|
-
"after:w-full",
|
|
218
|
-
"after:border-sm after:border-outline",
|
|
219
|
-
"after:rounded-lg"
|
|
220
|
-
],
|
|
221
|
-
false: "after:hidden"
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
});
|
|
225
|
-
|
|
226
|
-
// src/input/InputGroup.tsx
|
|
227
|
-
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
228
|
-
var InputGroup = ({
|
|
229
|
-
className,
|
|
230
|
-
children: childrenProp,
|
|
231
|
-
state: stateProp,
|
|
232
|
-
disabled: disabledProp,
|
|
233
|
-
readOnly: readOnlyProp,
|
|
234
|
-
onClear,
|
|
235
|
-
ref: forwardedRef,
|
|
236
|
-
...others
|
|
237
|
-
}) => {
|
|
238
|
-
const getElementId = (element) => {
|
|
239
|
-
return element ? element.type.id : "";
|
|
240
|
-
};
|
|
241
|
-
const findElement = (...values) => {
|
|
242
|
-
return children.find((child) => values.includes(getElementId(child) || ""));
|
|
243
|
-
};
|
|
244
|
-
const children = import_react4.Children.toArray(childrenProp).filter(import_react4.isValidElement);
|
|
245
|
-
const input = findElement("Input");
|
|
246
|
-
const props = input?.props || {};
|
|
247
|
-
const inputRef = (0, import_react4.useRef)(null);
|
|
248
|
-
const onClearRef = (0, import_react4.useRef)(onClear);
|
|
249
|
-
const ref = (0, import_use_merge_refs.useMergeRefs)(input?.ref, inputRef);
|
|
250
|
-
const [value, onChange] = (0, import_use_combined_state.useCombinedState)(
|
|
251
|
-
props.value,
|
|
252
|
-
props.defaultValue,
|
|
253
|
-
props.onValueChange
|
|
254
|
-
);
|
|
255
|
-
const field = (0, import_form_field.useFormFieldControl)();
|
|
256
|
-
const state = field.state ?? stateProp;
|
|
257
|
-
const disabled = field.disabled || !!disabledProp;
|
|
258
|
-
const readOnly = field.readOnly || !!readOnlyProp;
|
|
259
|
-
const leadingAddon = findElement("LeadingAddon");
|
|
260
|
-
const leadingIcon = findElement("LeadingIcon");
|
|
261
|
-
const clearButton = findElement("ClearButton");
|
|
262
|
-
const trailingIcon = findElement("TrailingIcon");
|
|
263
|
-
const trailingAddon = findElement("TrailingAddon");
|
|
264
|
-
const hasLeadingAddon = !!leadingAddon;
|
|
265
|
-
const hasTrailingAddon = !!trailingAddon;
|
|
266
|
-
const hasLeadingIcon = !!leadingIcon;
|
|
267
|
-
const hasTrailingIcon = !!trailingIcon;
|
|
268
|
-
const hasClearButton = !!value && !!clearButton && !disabled && !readOnly;
|
|
269
|
-
const handleChange = (event) => {
|
|
270
|
-
if (props.onChange) {
|
|
271
|
-
props.onChange(event);
|
|
272
|
-
}
|
|
273
|
-
onChange(event.target.value);
|
|
274
|
-
};
|
|
275
|
-
const handleClear = (0, import_react4.useCallback)(() => {
|
|
276
|
-
if (onClearRef.current) {
|
|
277
|
-
onClearRef.current();
|
|
278
|
-
}
|
|
279
|
-
onChange("");
|
|
280
|
-
inputRef.current.focus();
|
|
281
|
-
}, [onChange]);
|
|
282
|
-
const current = (0, import_react4.useMemo)(() => {
|
|
283
|
-
return {
|
|
284
|
-
state,
|
|
285
|
-
disabled,
|
|
286
|
-
readOnly,
|
|
287
|
-
hasLeadingIcon,
|
|
288
|
-
hasTrailingIcon,
|
|
289
|
-
hasLeadingAddon,
|
|
290
|
-
hasTrailingAddon,
|
|
291
|
-
hasClearButton,
|
|
292
|
-
onClear: handleClear
|
|
293
|
-
};
|
|
294
|
-
}, [
|
|
295
|
-
state,
|
|
296
|
-
disabled,
|
|
297
|
-
readOnly,
|
|
298
|
-
hasLeadingIcon,
|
|
299
|
-
hasTrailingIcon,
|
|
300
|
-
hasLeadingAddon,
|
|
301
|
-
hasTrailingAddon,
|
|
302
|
-
hasClearButton,
|
|
303
|
-
handleClear
|
|
304
|
-
]);
|
|
305
|
-
(0, import_react4.useEffect)(() => {
|
|
306
|
-
onClearRef.current = onClear;
|
|
307
|
-
}, [onClear]);
|
|
308
|
-
const inputRefValue = inputRef.current?.value;
|
|
309
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(InputGroupContext.Provider, { value: current, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
310
|
-
"div",
|
|
311
|
-
{
|
|
312
|
-
"data-spark-component": "input-group",
|
|
313
|
-
ref: forwardedRef,
|
|
314
|
-
className: inputGroupStyles({ disabled, readOnly, className }),
|
|
315
|
-
...others,
|
|
316
|
-
children: [
|
|
317
|
-
hasLeadingAddon && leadingAddon,
|
|
318
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "relative inline-flex w-full", children: [
|
|
319
|
-
input && (0, import_react4.cloneElement)(input, {
|
|
320
|
-
value: value ?? inputRefValue ?? "",
|
|
321
|
-
ref,
|
|
322
|
-
defaultValue: void 0,
|
|
323
|
-
onChange: handleChange
|
|
324
|
-
}),
|
|
325
|
-
leadingIcon,
|
|
326
|
-
hasClearButton && clearButton,
|
|
327
|
-
trailingIcon
|
|
328
|
-
] }),
|
|
329
|
-
hasTrailingAddon && trailingAddon
|
|
330
|
-
]
|
|
331
|
-
}
|
|
332
|
-
) });
|
|
333
|
-
};
|
|
334
|
-
InputGroup.displayName = "InputGroup";
|
|
335
|
-
|
|
336
|
-
// src/input/InputLeadingAddon.tsx
|
|
337
|
-
var import_class_variance_authority5 = require("class-variance-authority");
|
|
338
|
-
|
|
339
|
-
// src/input/InputAddon.tsx
|
|
340
|
-
var import_react5 = require("react");
|
|
341
|
-
|
|
342
|
-
// src/input/InputAddon.styles.ts
|
|
343
|
-
var import_class_variance_authority4 = require("class-variance-authority");
|
|
344
|
-
var inputAddonStyles = (0, import_class_variance_authority4.cva)(
|
|
345
|
-
[
|
|
346
|
-
"overflow-hidden",
|
|
347
|
-
"border-sm",
|
|
348
|
-
"shrink-0",
|
|
349
|
-
"h-full",
|
|
350
|
-
"focus-visible:relative focus-visible:z-raised",
|
|
351
|
-
"mx-0"
|
|
352
|
-
],
|
|
353
|
-
{
|
|
354
|
-
variants: {
|
|
355
|
-
/**
|
|
356
|
-
* Change the component to the HTML tag or custom component of the only child.
|
|
357
|
-
*/
|
|
358
|
-
asChild: { false: ["flex", "items-center", "px-lg"] },
|
|
359
|
-
intent: {
|
|
360
|
-
neutral: "border-outline",
|
|
361
|
-
error: "border-error",
|
|
362
|
-
alert: "border-alert",
|
|
363
|
-
success: "border-success"
|
|
364
|
-
},
|
|
365
|
-
/**
|
|
366
|
-
* Disable the input addon, preventing user interaction and adding opacity.
|
|
367
|
-
*/
|
|
368
|
-
disabled: {
|
|
369
|
-
true: ["pointer-events-none border-outline!"]
|
|
370
|
-
},
|
|
371
|
-
/**
|
|
372
|
-
* Changes input addon styles based on the read only status from the input.
|
|
373
|
-
*/
|
|
374
|
-
readOnly: {
|
|
375
|
-
true: ["pointer-events-none"]
|
|
376
|
-
},
|
|
377
|
-
/**
|
|
378
|
-
* Main style of the input addon.
|
|
379
|
-
*/
|
|
380
|
-
design: {
|
|
381
|
-
text: "",
|
|
382
|
-
solid: "",
|
|
383
|
-
inline: ""
|
|
384
|
-
}
|
|
385
|
-
},
|
|
386
|
-
compoundVariants: [
|
|
387
|
-
{
|
|
388
|
-
disabled: false,
|
|
389
|
-
readOnly: false,
|
|
390
|
-
design: "text",
|
|
391
|
-
class: ["bg-surface", "text-on-surface"]
|
|
392
|
-
},
|
|
393
|
-
{
|
|
394
|
-
disabled: true,
|
|
395
|
-
design: "text",
|
|
396
|
-
class: ["text-on-surface/dim-3"]
|
|
397
|
-
},
|
|
398
|
-
{
|
|
399
|
-
disabled: true,
|
|
400
|
-
design: ["solid", "inline"],
|
|
401
|
-
class: ["opacity-dim-3"]
|
|
402
|
-
}
|
|
403
|
-
],
|
|
404
|
-
defaultVariants: {
|
|
405
|
-
intent: "neutral"
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
);
|
|
409
|
-
|
|
410
|
-
// src/input/InputAddon.tsx
|
|
411
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
412
|
-
var InputAddon = ({
|
|
413
|
-
asChild: asChildProp,
|
|
414
|
-
className,
|
|
415
|
-
children,
|
|
416
|
-
ref,
|
|
417
|
-
...others
|
|
418
|
-
}) => {
|
|
419
|
-
const { state, disabled, readOnly } = useInputGroup();
|
|
420
|
-
const isRawText = typeof children === "string";
|
|
421
|
-
const asChild = !!(isRawText ? false : asChildProp);
|
|
422
|
-
const child = isRawText ? children : import_react5.Children.only(children);
|
|
423
|
-
const Component = asChild && !isRawText ? Slot : "div";
|
|
424
|
-
const getDesign = () => {
|
|
425
|
-
if (isRawText) return "text";
|
|
426
|
-
return asChild ? "solid" : "inline";
|
|
427
|
-
};
|
|
428
|
-
const design = getDesign();
|
|
429
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
430
|
-
Component,
|
|
431
|
-
{
|
|
432
|
-
ref,
|
|
433
|
-
"data-spark-component": "input-addon",
|
|
434
|
-
className: inputAddonStyles({
|
|
435
|
-
className,
|
|
436
|
-
intent: state,
|
|
437
|
-
disabled,
|
|
438
|
-
readOnly,
|
|
439
|
-
asChild,
|
|
440
|
-
design
|
|
441
|
-
}),
|
|
442
|
-
...disabled && { tabIndex: -1 },
|
|
443
|
-
...others,
|
|
444
|
-
children: child
|
|
445
|
-
}
|
|
446
|
-
);
|
|
447
|
-
};
|
|
448
|
-
InputAddon.displayName = "InputGroup.Addon";
|
|
449
|
-
|
|
450
|
-
// src/input/InputLeadingAddon.tsx
|
|
451
|
-
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
452
|
-
var Root2 = ({ className, ref, ...others }) => {
|
|
453
|
-
const { disabled, readOnly } = useInputGroup();
|
|
454
|
-
const isInactive = disabled || readOnly;
|
|
455
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: (0, import_class_variance_authority5.cx)("rounded-l-lg", isInactive ? "bg-on-surface/dim-5" : null), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
456
|
-
InputAddon,
|
|
457
|
-
{
|
|
458
|
-
ref,
|
|
459
|
-
className: (0, import_class_variance_authority5.cx)(className, "rounded-r-0! mr-[-1px] rounded-l-lg"),
|
|
460
|
-
...others
|
|
461
|
-
}
|
|
462
|
-
) });
|
|
463
|
-
};
|
|
464
|
-
var InputLeadingAddon = Object.assign(Root2, {
|
|
465
|
-
id: "LeadingAddon"
|
|
466
|
-
});
|
|
467
|
-
Root2.displayName = "InputGroup.LeadingAddon";
|
|
468
|
-
|
|
469
|
-
// src/input/InputLeadingIcon.tsx
|
|
470
|
-
var import_class_variance_authority7 = require("class-variance-authority");
|
|
471
|
-
|
|
472
|
-
// src/input/InputIcon.tsx
|
|
473
|
-
var import_class_variance_authority6 = require("class-variance-authority");
|
|
474
|
-
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
475
|
-
var InputIcon = ({ className, intent, children, ...others }) => {
|
|
476
|
-
const { disabled, readOnly } = useInputGroup();
|
|
477
|
-
const isInactive = disabled || readOnly;
|
|
478
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
479
|
-
Icon,
|
|
480
|
-
{
|
|
481
|
-
"data-spark-component": "input-icon",
|
|
482
|
-
intent,
|
|
483
|
-
className: (0, import_class_variance_authority6.cx)(
|
|
484
|
-
className,
|
|
485
|
-
"pointer-events-none absolute top-[calc(var(--spacing-sz-44)/2)] -translate-y-1/2",
|
|
486
|
-
intent ? void 0 : "text-neutral peer-focus:text-outline-high",
|
|
487
|
-
isInactive ? "opacity-dim-3" : void 0
|
|
488
|
-
),
|
|
489
|
-
...others,
|
|
490
|
-
children
|
|
491
|
-
}
|
|
492
|
-
);
|
|
493
|
-
};
|
|
494
|
-
InputIcon.displayName = "InputGroup.Icon";
|
|
495
|
-
|
|
496
|
-
// src/input/InputLeadingIcon.tsx
|
|
497
|
-
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
498
|
-
var InputLeadingIcon = ({ className, ...others }) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(InputIcon, { className: (0, import_class_variance_authority7.cx)(className, "left-lg text-body-1"), ...others });
|
|
499
|
-
InputLeadingIcon.id = "LeadingIcon";
|
|
500
|
-
InputLeadingIcon.displayName = "InputGroup.LeadingIcon";
|
|
501
|
-
|
|
502
|
-
// src/input/InputTrailingAddon.tsx
|
|
503
|
-
var import_class_variance_authority8 = require("class-variance-authority");
|
|
504
|
-
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
505
|
-
var Root3 = ({ className, ref, ...others }) => {
|
|
506
|
-
const { disabled, readOnly } = useInputGroup();
|
|
507
|
-
const isInactive = disabled || readOnly;
|
|
508
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: (0, import_class_variance_authority8.cx)("rounded-r-lg", isInactive ? "bg-on-surface/dim-5" : null), children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
509
|
-
InputAddon,
|
|
510
|
-
{
|
|
511
|
-
ref,
|
|
512
|
-
className: (0, import_class_variance_authority8.cx)(className, "rounded-l-0! ml-[-1px] rounded-r-lg"),
|
|
513
|
-
...others
|
|
514
|
-
}
|
|
515
|
-
) });
|
|
516
|
-
};
|
|
517
|
-
var InputTrailingAddon = Object.assign(Root3, {
|
|
518
|
-
id: "TrailingAddon"
|
|
519
|
-
});
|
|
520
|
-
Root3.displayName = "InputGroup.TrailingAddon";
|
|
521
|
-
|
|
522
|
-
// src/input/InputTrailingIcon.tsx
|
|
523
|
-
var import_class_variance_authority9 = require("class-variance-authority");
|
|
524
|
-
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
525
|
-
var InputTrailingIcon = ({ className, ...others }) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(InputIcon, { className: (0, import_class_variance_authority9.cx)(className, "right-lg text-body-1"), ...others });
|
|
526
|
-
InputTrailingIcon.id = "TrailingIcon";
|
|
527
|
-
InputTrailingIcon.displayName = "InputGroup.TrailingIcon";
|
|
528
|
-
|
|
529
|
-
// src/input/Input.tsx
|
|
530
|
-
var import_form_field2 = require("@spark-ui/components/form-field");
|
|
531
|
-
|
|
532
|
-
// src/input/Input.styles.ts
|
|
533
|
-
var import_class_variance_authority10 = require("class-variance-authority");
|
|
534
|
-
var inputStyles = (0, import_class_variance_authority10.cva)(
|
|
535
|
-
[
|
|
536
|
-
"relative",
|
|
537
|
-
"border-sm",
|
|
538
|
-
"peer",
|
|
539
|
-
"w-full",
|
|
540
|
-
"appearance-none outline-hidden",
|
|
541
|
-
"bg-surface",
|
|
542
|
-
"text-ellipsis text-body-1 text-on-surface",
|
|
543
|
-
"caret-neutral",
|
|
544
|
-
"[&:-webkit-autofill]:[-webkit-text-fill-color:var(--color-on-surface)]",
|
|
545
|
-
"autofill:shadow-surface autofill:shadow-[inset_0_0_0px_1000px]",
|
|
546
|
-
"disabled:cursor-not-allowed disabled:border-outline disabled:bg-on-surface/dim-5 disabled:text-on-surface/dim-3",
|
|
547
|
-
"read-only:cursor-default read-only:pointer-events-none read-only:bg-on-surface/dim-5",
|
|
548
|
-
"focus:ring-1 focus:ring-inset focus:ring-focus focus:border-focus"
|
|
549
|
-
],
|
|
550
|
-
{
|
|
551
|
-
variants: {
|
|
552
|
-
/**
|
|
553
|
-
* Change the component to the HTML tag or custom component of the only child.
|
|
554
|
-
*/
|
|
555
|
-
asChild: {
|
|
556
|
-
true: ["min-h-sz-44"],
|
|
557
|
-
false: ["h-sz-44"]
|
|
558
|
-
},
|
|
559
|
-
/**
|
|
560
|
-
* Color scheme of the button.
|
|
561
|
-
*/
|
|
562
|
-
intent: {
|
|
563
|
-
neutral: ["border-outline", "default:hover:border-outline-high"],
|
|
564
|
-
success: ["default:border-success"],
|
|
565
|
-
alert: ["default:border-alert"],
|
|
566
|
-
error: ["default:border-error"]
|
|
567
|
-
},
|
|
568
|
-
/**
|
|
569
|
-
* Sets if there is an addon before the input text.
|
|
570
|
-
*/
|
|
571
|
-
hasLeadingAddon: {
|
|
572
|
-
true: ["rounded-l-0"],
|
|
573
|
-
false: ["rounded-l-lg"]
|
|
574
|
-
},
|
|
575
|
-
/**
|
|
576
|
-
* Sets if there is an addon after the input text.
|
|
577
|
-
*/
|
|
578
|
-
hasTrailingAddon: {
|
|
579
|
-
true: ["rounded-r-0"],
|
|
580
|
-
false: ["rounded-r-lg"]
|
|
581
|
-
},
|
|
582
|
-
/**
|
|
583
|
-
* Sets if there is an icon before the input text.
|
|
584
|
-
*/
|
|
585
|
-
hasLeadingIcon: {
|
|
586
|
-
true: ["pl-3xl"],
|
|
587
|
-
false: ["pl-lg"]
|
|
588
|
-
},
|
|
589
|
-
/**
|
|
590
|
-
* Sets if there is an icon after the input text.
|
|
591
|
-
*/
|
|
592
|
-
hasTrailingIcon: { true: "" },
|
|
593
|
-
/**
|
|
594
|
-
* Sets if there is a button to clear the input text.
|
|
595
|
-
*/
|
|
596
|
-
hasClearButton: { true: "" }
|
|
597
|
-
},
|
|
598
|
-
compoundVariants: [
|
|
599
|
-
{
|
|
600
|
-
hasTrailingIcon: false,
|
|
601
|
-
hasClearButton: false,
|
|
602
|
-
class: "pr-lg"
|
|
603
|
-
},
|
|
604
|
-
{
|
|
605
|
-
hasTrailingIcon: true,
|
|
606
|
-
hasClearButton: false,
|
|
607
|
-
class: "pr-3xl"
|
|
608
|
-
},
|
|
609
|
-
{
|
|
610
|
-
hasTrailingIcon: false,
|
|
611
|
-
hasClearButton: true,
|
|
612
|
-
class: "pr-3xl"
|
|
613
|
-
},
|
|
614
|
-
{
|
|
615
|
-
hasTrailingIcon: true,
|
|
616
|
-
hasClearButton: true,
|
|
617
|
-
class: "pr-[calc(var(--spacing-3xl)*2)]"
|
|
618
|
-
}
|
|
619
|
-
],
|
|
620
|
-
defaultVariants: {
|
|
621
|
-
intent: "neutral"
|
|
622
|
-
}
|
|
623
|
-
}
|
|
624
|
-
);
|
|
625
|
-
|
|
626
|
-
// src/input/Input.tsx
|
|
627
|
-
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
628
|
-
var Root4 = ({
|
|
629
|
-
className,
|
|
630
|
-
asChild = false,
|
|
631
|
-
onValueChange,
|
|
632
|
-
onChange,
|
|
633
|
-
onKeyDown,
|
|
634
|
-
disabled: disabledProp,
|
|
635
|
-
readOnly: readOnlyProp,
|
|
636
|
-
ref,
|
|
637
|
-
...others
|
|
638
|
-
}) => {
|
|
639
|
-
const field = (0, import_form_field2.useFormFieldControl)();
|
|
640
|
-
const group = useInputGroup();
|
|
641
|
-
const { id, name, isInvalid, isRequired, description } = field;
|
|
642
|
-
const {
|
|
643
|
-
hasLeadingAddon,
|
|
644
|
-
hasTrailingAddon,
|
|
645
|
-
hasLeadingIcon,
|
|
646
|
-
hasTrailingIcon,
|
|
647
|
-
hasClearButton,
|
|
648
|
-
onClear
|
|
649
|
-
} = group;
|
|
650
|
-
const Component = asChild ? Slot : "input";
|
|
651
|
-
const state = field.state || group.state;
|
|
652
|
-
const disabled = field.disabled || group.disabled || disabledProp;
|
|
653
|
-
const readOnly = field.readOnly || group.readOnly || readOnlyProp;
|
|
654
|
-
const handleChange = (event) => {
|
|
655
|
-
if (onChange) {
|
|
656
|
-
onChange(event);
|
|
657
|
-
}
|
|
658
|
-
if (onValueChange) {
|
|
659
|
-
onValueChange(event.target.value);
|
|
660
|
-
}
|
|
661
|
-
};
|
|
662
|
-
const handleKeyDown = (event) => {
|
|
663
|
-
if (onKeyDown) {
|
|
664
|
-
onKeyDown(event);
|
|
665
|
-
}
|
|
666
|
-
if (hasClearButton && onClear && event.key === "Escape") {
|
|
667
|
-
onClear();
|
|
668
|
-
}
|
|
669
|
-
};
|
|
670
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
671
|
-
Component,
|
|
672
|
-
{
|
|
673
|
-
"data-spark-component": "input",
|
|
674
|
-
ref,
|
|
675
|
-
id,
|
|
676
|
-
name,
|
|
677
|
-
className: inputStyles({
|
|
678
|
-
asChild,
|
|
679
|
-
className,
|
|
680
|
-
intent: state,
|
|
681
|
-
hasLeadingAddon: !!hasLeadingAddon,
|
|
682
|
-
hasTrailingAddon: !!hasTrailingAddon,
|
|
683
|
-
hasLeadingIcon: !!hasLeadingIcon,
|
|
684
|
-
hasTrailingIcon: !!hasTrailingIcon,
|
|
685
|
-
hasClearButton: !!hasClearButton
|
|
686
|
-
}),
|
|
687
|
-
disabled,
|
|
688
|
-
readOnly,
|
|
689
|
-
required: isRequired,
|
|
690
|
-
"aria-describedby": description,
|
|
691
|
-
"aria-invalid": isInvalid,
|
|
692
|
-
onChange: handleChange,
|
|
693
|
-
onKeyDown: handleKeyDown,
|
|
694
|
-
...others
|
|
695
|
-
}
|
|
696
|
-
);
|
|
697
|
-
};
|
|
698
|
-
var Input = Object.assign(Root4, {
|
|
699
|
-
id: "Input"
|
|
700
|
-
});
|
|
701
|
-
Root4.displayName = "Input";
|
|
702
|
-
|
|
703
|
-
// src/input/index.ts
|
|
704
|
-
var InputGroup2 = Object.assign(InputGroup, {
|
|
705
|
-
LeadingAddon: InputLeadingAddon,
|
|
706
|
-
TrailingAddon: InputTrailingAddon,
|
|
707
|
-
LeadingIcon: InputLeadingIcon,
|
|
708
|
-
TrailingIcon: InputTrailingIcon,
|
|
709
|
-
ClearButton: InputClearButton
|
|
710
|
-
});
|
|
711
|
-
InputGroup2.displayName = "InputGroup";
|
|
712
|
-
InputLeadingAddon.displayName = "InputGroup.LeadingAddon";
|
|
713
|
-
InputTrailingAddon.displayName = "InputGroup.TrailingAddon";
|
|
714
|
-
InputLeadingIcon.displayName = "InputGroup.LeadingIcon";
|
|
715
|
-
InputTrailingIcon.displayName = "InputGroup.TrailingIcon";
|
|
716
|
-
InputClearButton.displayName = "InputGroup.ClearButton";
|
|
717
|
-
|
|
718
|
-
// src/textarea/TextareaClearButton.tsx
|
|
719
|
-
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
720
|
-
var TextareaClearButton = (props) => {
|
|
721
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(InputGroup2.ClearButton, { inline: true, "data-spark-component": "textarea-group-trailing-icon", ...props });
|
|
722
|
-
};
|
|
723
|
-
TextareaClearButton.id = InputGroup2.ClearButton.id;
|
|
724
|
-
TextareaClearButton.displayName = "TextareaGroup.ClearButton";
|
|
725
|
-
|
|
726
|
-
// src/textarea/TextareaGroup.tsx
|
|
727
|
-
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
728
|
-
var TextareaGroup = (props) => {
|
|
729
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(InputGroup2, { ...props });
|
|
730
|
-
};
|
|
731
|
-
TextareaGroup.displayName = "TextareaGroup";
|
|
732
|
-
|
|
733
|
-
// src/textarea/TextareaLeadingIcon.tsx
|
|
734
|
-
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
735
|
-
var TextareaLeadingIcon = (props) => {
|
|
736
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(InputGroup2.LeadingIcon, { "data-spark-component": "textarea-group-leading-icon", ...props });
|
|
737
|
-
};
|
|
738
|
-
TextareaLeadingIcon.id = InputGroup2.LeadingIcon.id;
|
|
739
|
-
TextareaLeadingIcon.displayName = "TextareaGroup.LeadingIcon";
|
|
740
|
-
|
|
741
|
-
// src/textarea/TextareaTrailingIcon.tsx
|
|
742
|
-
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
743
|
-
var TextareaTrailingIcon = (props) => {
|
|
744
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(InputGroup2.TrailingIcon, { "data-spark-component": "textarea-group-trailing-icon", ...props });
|
|
745
|
-
};
|
|
746
|
-
TextareaTrailingIcon.id = InputGroup2.TrailingIcon.id;
|
|
747
|
-
TextareaTrailingIcon.displayName = "TextareaGroup.TrailingIcon";
|
|
748
|
-
|
|
749
|
-
// src/textarea/Textarea.tsx
|
|
750
|
-
var import_class_variance_authority11 = require("class-variance-authority");
|
|
751
|
-
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
752
|
-
var Root5 = ({
|
|
753
|
-
className,
|
|
754
|
-
disabled,
|
|
755
|
-
rows = 1,
|
|
756
|
-
isResizable = true,
|
|
757
|
-
ref,
|
|
758
|
-
onValueChange,
|
|
759
|
-
...others
|
|
760
|
-
}) => {
|
|
761
|
-
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
762
|
-
Input,
|
|
763
|
-
{
|
|
764
|
-
className: (0, import_class_variance_authority11.cx)(
|
|
765
|
-
className,
|
|
766
|
-
"py-[var(--spacing-sz-10)]",
|
|
767
|
-
isResizable ? "resize-y" : "resize-none"
|
|
768
|
-
),
|
|
769
|
-
"data-spark-component": "textarea",
|
|
770
|
-
disabled,
|
|
771
|
-
asChild: true,
|
|
772
|
-
onValueChange,
|
|
773
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("textarea", { ref, rows, ...others })
|
|
774
|
-
}
|
|
775
|
-
);
|
|
776
|
-
};
|
|
777
|
-
var Textarea = Object.assign(Root5, {
|
|
778
|
-
id: Input.id
|
|
779
|
-
});
|
|
780
|
-
Root5.displayName = "Textarea";
|
|
781
|
-
|
|
782
|
-
// src/textarea/index.ts
|
|
783
|
-
var TextareaGroup2 = Object.assign(TextareaGroup, {
|
|
784
|
-
LeadingIcon: TextareaLeadingIcon,
|
|
785
|
-
TrailingIcon: TextareaTrailingIcon,
|
|
786
|
-
ClearButton: TextareaClearButton
|
|
787
|
-
});
|
|
788
|
-
TextareaGroup2.displayName = "TextareaGroup";
|
|
789
|
-
TextareaLeadingIcon.displayName = "TextareaGroup.LeadingIcon";
|
|
790
|
-
TextareaTrailingIcon.displayName = "TextareaGroup.TrailingIcon";
|
|
791
|
-
TextareaClearButton.displayName = "TextareaGroup.ClearButton";
|
|
792
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
793
|
-
0 && (module.exports = {
|
|
794
|
-
Textarea,
|
|
795
|
-
TextareaGroup
|
|
796
|
-
});
|
|
797
|
-
//# sourceMappingURL=index.js.map
|