@rovula/ui 0.0.5 → 0.0.6

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.
@@ -0,0 +1,338 @@
1
+ import React from "react";
2
+ declare const meta: {
3
+ title: string;
4
+ component: React.FC<{
5
+ id?: string | undefined;
6
+ label?: string | undefined;
7
+ size?: "sm" | "md" | "lg" | undefined;
8
+ rounded?: "none" | "normal" | "full" | undefined;
9
+ variant?: "outline" | "flat" | "underline" | undefined;
10
+ type?: React.HTMLInputTypeAttribute | undefined;
11
+ helperText?: string | undefined;
12
+ errorMessage?: string | undefined;
13
+ fullwidth?: boolean | undefined;
14
+ disabled?: boolean | undefined;
15
+ error?: boolean | undefined;
16
+ required?: boolean | undefined;
17
+ hasClearIcon?: boolean | undefined;
18
+ className?: string | undefined;
19
+ } & Omit<React.InputHTMLAttributes<HTMLInputElement>, "size">>;
20
+ tags: string[];
21
+ parameters: {
22
+ layout: string;
23
+ };
24
+ decorators: ((Story: import("@storybook/types").PartialStoryFn<import("@storybook/react").ReactRenderer, {
25
+ id?: string | undefined;
26
+ label?: string | undefined;
27
+ size?: "sm" | "md" | "lg" | undefined;
28
+ rounded?: "none" | "normal" | "full" | undefined;
29
+ variant?: "outline" | "flat" | "underline" | undefined;
30
+ type?: React.HTMLInputTypeAttribute | undefined;
31
+ helperText?: string | undefined;
32
+ errorMessage?: string | undefined;
33
+ fullwidth?: boolean | undefined;
34
+ disabled?: boolean | undefined;
35
+ error?: boolean | undefined;
36
+ required?: boolean | undefined;
37
+ hasClearIcon?: boolean | undefined;
38
+ className?: string | undefined;
39
+ color?: string | undefined;
40
+ title?: string | undefined;
41
+ children?: React.ReactNode;
42
+ form?: string | undefined;
43
+ formAction?: string | undefined;
44
+ formEncType?: string | undefined;
45
+ formMethod?: string | undefined;
46
+ formNoValidate?: boolean | undefined;
47
+ formTarget?: string | undefined;
48
+ name?: string | undefined;
49
+ value?: string | number | readonly string[] | undefined;
50
+ defaultChecked?: boolean | undefined;
51
+ defaultValue?: string | number | readonly string[] | undefined;
52
+ suppressContentEditableWarning?: boolean | undefined;
53
+ suppressHydrationWarning?: boolean | undefined;
54
+ accessKey?: string | undefined;
55
+ autoFocus?: boolean | undefined;
56
+ contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
57
+ contextMenu?: string | undefined;
58
+ dir?: string | undefined;
59
+ draggable?: (boolean | "true" | "false") | undefined;
60
+ hidden?: boolean | undefined;
61
+ lang?: string | undefined;
62
+ nonce?: string | undefined;
63
+ slot?: string | undefined;
64
+ spellCheck?: (boolean | "true" | "false") | undefined;
65
+ style?: React.CSSProperties | undefined;
66
+ tabIndex?: number | undefined;
67
+ translate?: "yes" | "no" | undefined;
68
+ radioGroup?: string | undefined;
69
+ role?: React.AriaRole | undefined;
70
+ about?: string | undefined;
71
+ content?: string | undefined;
72
+ datatype?: string | undefined;
73
+ inlist?: any;
74
+ prefix?: string | undefined;
75
+ property?: string | undefined;
76
+ rel?: string | undefined;
77
+ resource?: string | undefined;
78
+ rev?: string | undefined;
79
+ typeof?: string | undefined;
80
+ vocab?: string | undefined;
81
+ autoCapitalize?: string | undefined;
82
+ autoCorrect?: string | undefined;
83
+ autoSave?: string | undefined;
84
+ itemProp?: string | undefined;
85
+ itemScope?: boolean | undefined;
86
+ itemType?: string | undefined;
87
+ itemID?: string | undefined;
88
+ itemRef?: string | undefined;
89
+ results?: number | undefined;
90
+ security?: string | undefined;
91
+ unselectable?: "on" | "off" | undefined;
92
+ inputMode?: "search" | "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
93
+ is?: string | undefined;
94
+ "aria-activedescendant"?: string | undefined;
95
+ "aria-atomic"?: (boolean | "true" | "false") | undefined;
96
+ "aria-autocomplete"?: "list" | "none" | "inline" | "both" | undefined;
97
+ "aria-braillelabel"?: string | undefined;
98
+ "aria-brailleroledescription"?: string | undefined;
99
+ "aria-busy"?: (boolean | "true" | "false") | undefined;
100
+ "aria-checked"?: boolean | "true" | "false" | "mixed" | undefined;
101
+ "aria-colcount"?: number | undefined;
102
+ "aria-colindex"?: number | undefined;
103
+ "aria-colindextext"?: string | undefined;
104
+ "aria-colspan"?: number | undefined;
105
+ "aria-controls"?: string | undefined;
106
+ "aria-current"?: boolean | "true" | "false" | "date" | "time" | "page" | "step" | "location" | undefined;
107
+ "aria-describedby"?: string | undefined;
108
+ "aria-description"?: string | undefined;
109
+ "aria-details"?: string | undefined;
110
+ "aria-disabled"?: (boolean | "true" | "false") | undefined;
111
+ "aria-dropeffect"?: "link" | "none" | "copy" | "execute" | "move" | "popup" | undefined;
112
+ "aria-errormessage"?: string | undefined;
113
+ "aria-expanded"?: (boolean | "true" | "false") | undefined;
114
+ "aria-flowto"?: string | undefined;
115
+ "aria-grabbed"?: (boolean | "true" | "false") | undefined;
116
+ "aria-haspopup"?: boolean | "true" | "false" | "dialog" | "grid" | "listbox" | "menu" | "tree" | undefined;
117
+ "aria-hidden"?: (boolean | "true" | "false") | undefined;
118
+ "aria-invalid"?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
119
+ "aria-keyshortcuts"?: string | undefined;
120
+ "aria-label"?: string | undefined;
121
+ "aria-labelledby"?: string | undefined;
122
+ "aria-level"?: number | undefined;
123
+ "aria-live"?: "off" | "assertive" | "polite" | undefined;
124
+ "aria-modal"?: (boolean | "true" | "false") | undefined;
125
+ "aria-multiline"?: (boolean | "true" | "false") | undefined;
126
+ "aria-multiselectable"?: (boolean | "true" | "false") | undefined;
127
+ "aria-orientation"?: "horizontal" | "vertical" | undefined;
128
+ "aria-owns"?: string | undefined;
129
+ "aria-placeholder"?: string | undefined;
130
+ "aria-posinset"?: number | undefined;
131
+ "aria-pressed"?: boolean | "true" | "false" | "mixed" | undefined;
132
+ "aria-readonly"?: (boolean | "true" | "false") | undefined;
133
+ "aria-relevant"?: "text" | "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
134
+ "aria-required"?: (boolean | "true" | "false") | undefined;
135
+ "aria-roledescription"?: string | undefined;
136
+ "aria-rowcount"?: number | undefined;
137
+ "aria-rowindex"?: number | undefined;
138
+ "aria-rowindextext"?: string | undefined;
139
+ "aria-rowspan"?: number | undefined;
140
+ "aria-selected"?: (boolean | "true" | "false") | undefined;
141
+ "aria-setsize"?: number | undefined;
142
+ "aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
143
+ "aria-valuemax"?: number | undefined;
144
+ "aria-valuemin"?: number | undefined;
145
+ "aria-valuenow"?: number | undefined;
146
+ "aria-valuetext"?: string | undefined;
147
+ dangerouslySetInnerHTML?: {
148
+ __html: string | TrustedHTML;
149
+ } | undefined;
150
+ onCopy?: React.ClipboardEventHandler<HTMLInputElement> | undefined;
151
+ onCopyCapture?: React.ClipboardEventHandler<HTMLInputElement> | undefined;
152
+ onCut?: React.ClipboardEventHandler<HTMLInputElement> | undefined;
153
+ onCutCapture?: React.ClipboardEventHandler<HTMLInputElement> | undefined;
154
+ onPaste?: React.ClipboardEventHandler<HTMLInputElement> | undefined;
155
+ onPasteCapture?: React.ClipboardEventHandler<HTMLInputElement> | undefined;
156
+ onCompositionEnd?: React.CompositionEventHandler<HTMLInputElement> | undefined;
157
+ onCompositionEndCapture?: React.CompositionEventHandler<HTMLInputElement> | undefined;
158
+ onCompositionStart?: React.CompositionEventHandler<HTMLInputElement> | undefined;
159
+ onCompositionStartCapture?: React.CompositionEventHandler<HTMLInputElement> | undefined;
160
+ onCompositionUpdate?: React.CompositionEventHandler<HTMLInputElement> | undefined;
161
+ onCompositionUpdateCapture?: React.CompositionEventHandler<HTMLInputElement> | undefined;
162
+ onFocus?: React.FocusEventHandler<HTMLInputElement> | undefined;
163
+ onFocusCapture?: React.FocusEventHandler<HTMLInputElement> | undefined;
164
+ onBlur?: React.FocusEventHandler<HTMLInputElement> | undefined;
165
+ onBlurCapture?: React.FocusEventHandler<HTMLInputElement> | undefined;
166
+ onChange?: React.ChangeEventHandler<HTMLInputElement> | undefined;
167
+ onChangeCapture?: React.FormEventHandler<HTMLInputElement> | undefined;
168
+ onBeforeInput?: React.FormEventHandler<HTMLInputElement> | undefined;
169
+ onBeforeInputCapture?: React.FormEventHandler<HTMLInputElement> | undefined;
170
+ onInput?: React.FormEventHandler<HTMLInputElement> | undefined;
171
+ onInputCapture?: React.FormEventHandler<HTMLInputElement> | undefined;
172
+ onReset?: React.FormEventHandler<HTMLInputElement> | undefined;
173
+ onResetCapture?: React.FormEventHandler<HTMLInputElement> | undefined;
174
+ onSubmit?: React.FormEventHandler<HTMLInputElement> | undefined;
175
+ onSubmitCapture?: React.FormEventHandler<HTMLInputElement> | undefined;
176
+ onInvalid?: React.FormEventHandler<HTMLInputElement> | undefined;
177
+ onInvalidCapture?: React.FormEventHandler<HTMLInputElement> | undefined;
178
+ onLoad?: React.ReactEventHandler<HTMLInputElement> | undefined;
179
+ onLoadCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
180
+ onError?: React.ReactEventHandler<HTMLInputElement> | undefined;
181
+ onErrorCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
182
+ onKeyDown?: React.KeyboardEventHandler<HTMLInputElement> | undefined;
183
+ onKeyDownCapture?: React.KeyboardEventHandler<HTMLInputElement> | undefined;
184
+ onKeyPress?: React.KeyboardEventHandler<HTMLInputElement> | undefined;
185
+ onKeyPressCapture?: React.KeyboardEventHandler<HTMLInputElement> | undefined;
186
+ onKeyUp?: React.KeyboardEventHandler<HTMLInputElement> | undefined;
187
+ onKeyUpCapture?: React.KeyboardEventHandler<HTMLInputElement> | undefined;
188
+ onAbort?: React.ReactEventHandler<HTMLInputElement> | undefined;
189
+ onAbortCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
190
+ onCanPlay?: React.ReactEventHandler<HTMLInputElement> | undefined;
191
+ onCanPlayCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
192
+ onCanPlayThrough?: React.ReactEventHandler<HTMLInputElement> | undefined;
193
+ onCanPlayThroughCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
194
+ onDurationChange?: React.ReactEventHandler<HTMLInputElement> | undefined;
195
+ onDurationChangeCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
196
+ onEmptied?: React.ReactEventHandler<HTMLInputElement> | undefined;
197
+ onEmptiedCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
198
+ onEncrypted?: React.ReactEventHandler<HTMLInputElement> | undefined;
199
+ onEncryptedCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
200
+ onEnded?: React.ReactEventHandler<HTMLInputElement> | undefined;
201
+ onEndedCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
202
+ onLoadedData?: React.ReactEventHandler<HTMLInputElement> | undefined;
203
+ onLoadedDataCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
204
+ onLoadedMetadata?: React.ReactEventHandler<HTMLInputElement> | undefined;
205
+ onLoadedMetadataCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
206
+ onLoadStart?: React.ReactEventHandler<HTMLInputElement> | undefined;
207
+ onLoadStartCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
208
+ onPause?: React.ReactEventHandler<HTMLInputElement> | undefined;
209
+ onPauseCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
210
+ onPlay?: React.ReactEventHandler<HTMLInputElement> | undefined;
211
+ onPlayCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
212
+ onPlaying?: React.ReactEventHandler<HTMLInputElement> | undefined;
213
+ onPlayingCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
214
+ onProgress?: React.ReactEventHandler<HTMLInputElement> | undefined;
215
+ onProgressCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
216
+ onRateChange?: React.ReactEventHandler<HTMLInputElement> | undefined;
217
+ onRateChangeCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
218
+ onResize?: React.ReactEventHandler<HTMLInputElement> | undefined;
219
+ onResizeCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
220
+ onSeeked?: React.ReactEventHandler<HTMLInputElement> | undefined;
221
+ onSeekedCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
222
+ onSeeking?: React.ReactEventHandler<HTMLInputElement> | undefined;
223
+ onSeekingCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
224
+ onStalled?: React.ReactEventHandler<HTMLInputElement> | undefined;
225
+ onStalledCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
226
+ onSuspend?: React.ReactEventHandler<HTMLInputElement> | undefined;
227
+ onSuspendCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
228
+ onTimeUpdate?: React.ReactEventHandler<HTMLInputElement> | undefined;
229
+ onTimeUpdateCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
230
+ onVolumeChange?: React.ReactEventHandler<HTMLInputElement> | undefined;
231
+ onVolumeChangeCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
232
+ onWaiting?: React.ReactEventHandler<HTMLInputElement> | undefined;
233
+ onWaitingCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
234
+ onAuxClick?: React.MouseEventHandler<HTMLInputElement> | undefined;
235
+ onAuxClickCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
236
+ onClick?: React.MouseEventHandler<HTMLInputElement> | undefined;
237
+ onClickCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
238
+ onContextMenu?: React.MouseEventHandler<HTMLInputElement> | undefined;
239
+ onContextMenuCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
240
+ onDoubleClick?: React.MouseEventHandler<HTMLInputElement> | undefined;
241
+ onDoubleClickCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
242
+ onDrag?: React.DragEventHandler<HTMLInputElement> | undefined;
243
+ onDragCapture?: React.DragEventHandler<HTMLInputElement> | undefined;
244
+ onDragEnd?: React.DragEventHandler<HTMLInputElement> | undefined;
245
+ onDragEndCapture?: React.DragEventHandler<HTMLInputElement> | undefined;
246
+ onDragEnter?: React.DragEventHandler<HTMLInputElement> | undefined;
247
+ onDragEnterCapture?: React.DragEventHandler<HTMLInputElement> | undefined;
248
+ onDragExit?: React.DragEventHandler<HTMLInputElement> | undefined;
249
+ onDragExitCapture?: React.DragEventHandler<HTMLInputElement> | undefined;
250
+ onDragLeave?: React.DragEventHandler<HTMLInputElement> | undefined;
251
+ onDragLeaveCapture?: React.DragEventHandler<HTMLInputElement> | undefined;
252
+ onDragOver?: React.DragEventHandler<HTMLInputElement> | undefined;
253
+ onDragOverCapture?: React.DragEventHandler<HTMLInputElement> | undefined;
254
+ onDragStart?: React.DragEventHandler<HTMLInputElement> | undefined;
255
+ onDragStartCapture?: React.DragEventHandler<HTMLInputElement> | undefined;
256
+ onDrop?: React.DragEventHandler<HTMLInputElement> | undefined;
257
+ onDropCapture?: React.DragEventHandler<HTMLInputElement> | undefined;
258
+ onMouseDown?: React.MouseEventHandler<HTMLInputElement> | undefined;
259
+ onMouseDownCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
260
+ onMouseEnter?: React.MouseEventHandler<HTMLInputElement> | undefined;
261
+ onMouseLeave?: React.MouseEventHandler<HTMLInputElement> | undefined;
262
+ onMouseMove?: React.MouseEventHandler<HTMLInputElement> | undefined;
263
+ onMouseMoveCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
264
+ onMouseOut?: React.MouseEventHandler<HTMLInputElement> | undefined;
265
+ onMouseOutCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
266
+ onMouseOver?: React.MouseEventHandler<HTMLInputElement> | undefined;
267
+ onMouseOverCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
268
+ onMouseUp?: React.MouseEventHandler<HTMLInputElement> | undefined;
269
+ onMouseUpCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
270
+ onSelect?: React.ReactEventHandler<HTMLInputElement> | undefined;
271
+ onSelectCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
272
+ onTouchCancel?: React.TouchEventHandler<HTMLInputElement> | undefined;
273
+ onTouchCancelCapture?: React.TouchEventHandler<HTMLInputElement> | undefined;
274
+ onTouchEnd?: React.TouchEventHandler<HTMLInputElement> | undefined;
275
+ onTouchEndCapture?: React.TouchEventHandler<HTMLInputElement> | undefined;
276
+ onTouchMove?: React.TouchEventHandler<HTMLInputElement> | undefined;
277
+ onTouchMoveCapture?: React.TouchEventHandler<HTMLInputElement> | undefined;
278
+ onTouchStart?: React.TouchEventHandler<HTMLInputElement> | undefined;
279
+ onTouchStartCapture?: React.TouchEventHandler<HTMLInputElement> | undefined;
280
+ onPointerDown?: React.PointerEventHandler<HTMLInputElement> | undefined;
281
+ onPointerDownCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
282
+ onPointerMove?: React.PointerEventHandler<HTMLInputElement> | undefined;
283
+ onPointerMoveCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
284
+ onPointerUp?: React.PointerEventHandler<HTMLInputElement> | undefined;
285
+ onPointerUpCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
286
+ onPointerCancel?: React.PointerEventHandler<HTMLInputElement> | undefined;
287
+ onPointerCancelCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
288
+ onPointerEnter?: React.PointerEventHandler<HTMLInputElement> | undefined;
289
+ onPointerLeave?: React.PointerEventHandler<HTMLInputElement> | undefined;
290
+ onPointerOver?: React.PointerEventHandler<HTMLInputElement> | undefined;
291
+ onPointerOverCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
292
+ onPointerOut?: React.PointerEventHandler<HTMLInputElement> | undefined;
293
+ onPointerOutCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
294
+ onGotPointerCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
295
+ onGotPointerCaptureCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
296
+ onLostPointerCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
297
+ onLostPointerCaptureCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
298
+ onScroll?: React.UIEventHandler<HTMLInputElement> | undefined;
299
+ onScrollCapture?: React.UIEventHandler<HTMLInputElement> | undefined;
300
+ onWheel?: React.WheelEventHandler<HTMLInputElement> | undefined;
301
+ onWheelCapture?: React.WheelEventHandler<HTMLInputElement> | undefined;
302
+ onAnimationStart?: React.AnimationEventHandler<HTMLInputElement> | undefined;
303
+ onAnimationStartCapture?: React.AnimationEventHandler<HTMLInputElement> | undefined;
304
+ onAnimationEnd?: React.AnimationEventHandler<HTMLInputElement> | undefined;
305
+ onAnimationEndCapture?: React.AnimationEventHandler<HTMLInputElement> | undefined;
306
+ onAnimationIteration?: React.AnimationEventHandler<HTMLInputElement> | undefined;
307
+ onAnimationIterationCapture?: React.AnimationEventHandler<HTMLInputElement> | undefined;
308
+ onTransitionEnd?: React.TransitionEventHandler<HTMLInputElement> | undefined;
309
+ onTransitionEndCapture?: React.TransitionEventHandler<HTMLInputElement> | undefined;
310
+ list?: string | undefined;
311
+ placeholder?: string | undefined;
312
+ pattern?: string | undefined;
313
+ autoComplete?: React.HTMLInputAutoCompleteAttribute | undefined;
314
+ alt?: string | undefined;
315
+ accept?: string | undefined;
316
+ capture?: boolean | "user" | "environment" | undefined;
317
+ checked?: boolean | undefined;
318
+ enterKeyHint?: "search" | "enter" | "done" | "go" | "next" | "previous" | "send" | undefined;
319
+ multiple?: boolean | undefined;
320
+ maxLength?: number | undefined;
321
+ minLength?: number | undefined;
322
+ src?: string | undefined;
323
+ step?: string | number | undefined;
324
+ height?: string | number | undefined;
325
+ max?: string | number | undefined;
326
+ min?: string | number | undefined;
327
+ readOnly?: boolean | undefined;
328
+ width?: string | number | undefined;
329
+ }>) => import("react/jsx-runtime").JSX.Element)[];
330
+ };
331
+ export default meta;
332
+ export declare const Default: {
333
+ args: {
334
+ label: string;
335
+ fullwidth: boolean;
336
+ };
337
+ render: (args: {}) => import("react/jsx-runtime").JSX.Element;
338
+ };
@@ -0,0 +1,26 @@
1
+ export declare const inputVariant: (props?: ({
2
+ size?: "sm" | "md" | "lg" | null | undefined;
3
+ rounded?: "none" | "normal" | "full" | null | undefined;
4
+ variant?: "outline" | "flat" | "underline" | null | undefined;
5
+ fullwidth?: boolean | null | undefined;
6
+ disabled?: boolean | null | undefined;
7
+ error?: boolean | null | undefined;
8
+ hasClearIcon?: boolean | null | undefined;
9
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
10
+ export declare const labelVariant: (props?: ({
11
+ size?: "sm" | "md" | "lg" | null | undefined;
12
+ disabled?: boolean | null | undefined;
13
+ error?: boolean | null | undefined;
14
+ isFloating?: boolean | null | undefined;
15
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
16
+ export declare const helperTextVariant: (props?: ({
17
+ size?: "sm" | "md" | "lg" | null | undefined;
18
+ disabled?: boolean | null | undefined;
19
+ error?: boolean | null | undefined;
20
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
21
+ export declare const iconWrapperVariant: (props?: ({
22
+ size?: "sm" | "md" | "lg" | null | undefined;
23
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
24
+ export declare const iconVariant: (props?: ({
25
+ size?: "sm" | "md" | "lg" | null | undefined;
26
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
@@ -0,0 +1,61 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
+ import { forwardRef, useImperativeHandle, useRef } from "react";
25
+ import { helperTextVariant, iconVariant, iconWrapperVariant, inputVariant, labelVariant, } from "./TextInput.styles";
26
+ import { twMerge } from "tailwind-merge";
27
+ import { XCircleIcon, ExclamationCircleIcon } from "@heroicons/react/16/solid";
28
+ var TextInput = forwardRef(function (_a, ref) {
29
+ var _b;
30
+ var id = _a.id, label = _a.label, _c = _a.size, size = _c === void 0 ? "md" : _c, _d = _a.rounded, rounded = _d === void 0 ? "normal" : _d, _e = _a.variant, variant = _e === void 0 ? "outline" : _e, _f = _a.type, type = _f === void 0 ? "text" : _f, helperText = _a.helperText, errorMessage = _a.errorMessage, _g = _a.fullwidth, fullwidth = _g === void 0 ? false : _g, _h = _a.disabled, disabled = _h === void 0 ? false : _h, _j = _a.error, error = _j === void 0 ? false : _j, _k = _a.required, required = _k === void 0 ? true : _k, _l = _a.hasClearIcon, hasClearIcon = _l === void 0 ? true : _l, props = __rest(_a, ["id", "label", "size", "rounded", "variant", "type", "helperText", "errorMessage", "fullwidth", "disabled", "error", "required", "hasClearIcon"]);
31
+ var inputRef = useRef(null);
32
+ var _id = id || "".concat(type, "-").concat(label, "-input");
33
+ var inputClassname = inputVariant({
34
+ size: size,
35
+ rounded: rounded,
36
+ variant: variant,
37
+ fullwidth: fullwidth,
38
+ disabled: disabled,
39
+ error: error,
40
+ hasClearIcon: hasClearIcon,
41
+ });
42
+ var labelClassname = labelVariant({
43
+ size: size,
44
+ disabled: disabled,
45
+ error: error,
46
+ isFloating: (_b = !!props.value) !== null && _b !== void 0 ? _b : false,
47
+ });
48
+ var helperTextClassname = helperTextVariant({ size: size, error: error, disabled: disabled });
49
+ var iconWrapperClassname = iconWrapperVariant({ size: size });
50
+ var iconClassname = iconVariant({ size: size });
51
+ useImperativeHandle(ref, function () { return ({
52
+ clearInput: handleClearInput,
53
+ }); });
54
+ var handleClearInput = function () {
55
+ if (inputRef.current) {
56
+ inputRef.current.value = "";
57
+ }
58
+ };
59
+ return (_jsxs("div", { className: "flex flex-col ".concat(fullwidth ? "w-full" : ""), children: [_jsxs("div", { className: "relative", children: [_jsx("input", __assign({}, props, { ref: inputRef, type: type, id: _id, disabled: disabled, className: twMerge(inputClassname, props.className) })), hasClearIcon && (_jsx("div", { className: iconWrapperClassname, children: _jsx(XCircleIcon, { type: "button", className: iconClassname, onMouseDown: handleClearInput }) })), _jsxs("label", { htmlFor: _id, className: labelClassname, children: [label, " ", required && _jsx("span", { className: "text-error", children: "*" })] })] }), (errorMessage || helperText) && (_jsxs("span", { className: helperTextClassname, children: [_jsx(ExclamationCircleIcon, { width: 16, height: 16, className: error ? "fill-error" : "" }), " ", errorMessage || helperText] }))] }));
60
+ });
61
+ export default TextInput;
@@ -0,0 +1,39 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import TextInput from "./TextInput";
14
+ // More on how to set up stories at: https://storybook.js.org/docs/7.0/react/writing-stories/introduction
15
+ var meta = {
16
+ title: "Components/TextInput",
17
+ component: TextInput,
18
+ tags: ["autodocs"],
19
+ parameters: {
20
+ // More on how to position stories at: https://storybook.js.org/docs/7.0/react/configure/story-layout
21
+ layout: "fullscreen",
22
+ },
23
+ decorators: [
24
+ function (Story) { return (_jsx("div", { className: "p-5 flex w-full", children: _jsx(Story, {}) })); },
25
+ ],
26
+ };
27
+ export default meta;
28
+ export var Default = {
29
+ args: {
30
+ label: "Lorem Ipsum",
31
+ // value: "Lorem Ipsum",
32
+ fullwidth: true,
33
+ },
34
+ render: function (args) {
35
+ console.log("args ", args);
36
+ var props = __assign({}, args);
37
+ return (_jsxs("div", { className: "flex flex-row gap-4 w-full", children: [_jsx(TextInput, __assign({ id: "1", placeholder: "placeholder", size: "lg" }, args)), _jsx(TextInput, __assign({ id: "2", placeholder: "placeholder", size: "md" }, args)), _jsx(TextInput, __assign({ id: "3", placeholder: "placeholder", size: "sm" }, args))] }));
38
+ },
39
+ };
@@ -0,0 +1,155 @@
1
+ import { cva } from "class-variance-authority";
2
+ export var inputVariant = cva([
3
+ "border-0 outline-none",
4
+ "p-1 flex",
5
+ "peer text-black placeholder:text-transparent",
6
+ ], {
7
+ variants: {
8
+ size: {
9
+ sm: "p-2 px-3 typography-small1",
10
+ md: "py-2 px-3 typography-subtitile4",
11
+ lg: "p-4 typography-subtitile1",
12
+ },
13
+ rounded: {
14
+ none: "rounded-none",
15
+ normal: "rounded-xl",
16
+ full: "rounded-full",
17
+ },
18
+ variant: {
19
+ flat: "",
20
+ outline: "ring-1 ring-inset ring-input-stroke hover:ring-input-active focus:ring-2 focus:ring-inset focus:ring-input-active",
21
+ underline: "border-b-2 border-input-stroke transition-colors hover:border-input-stroke-active focus:border-input-stroke",
22
+ },
23
+ fullwidth: {
24
+ true: "w-full",
25
+ },
26
+ disabled: {
27
+ true: "text-input-text-disabled ring-input-stroke-disabled placeholder:text-input-text-disabled",
28
+ },
29
+ error: {
30
+ true: "ring-error",
31
+ },
32
+ hasClearIcon: {
33
+ true: "",
34
+ },
35
+ },
36
+ compoundVariants: [
37
+ {
38
+ variant: "underline",
39
+ className: "rounded-none",
40
+ },
41
+ {
42
+ hasClearIcon: true,
43
+ size: "sm",
44
+ class: "focus:pe-6",
45
+ },
46
+ {
47
+ hasClearIcon: true,
48
+ size: "md",
49
+ class: "focus:pe-8",
50
+ },
51
+ {
52
+ hasClearIcon: true,
53
+ size: "lg",
54
+ class: "focus:pe-10",
55
+ },
56
+ ],
57
+ defaultVariants: {
58
+ size: "md",
59
+ variant: "outline",
60
+ rounded: "normal",
61
+ fullwidth: false,
62
+ disabled: false,
63
+ error: false,
64
+ hasClearIcon: false,
65
+ },
66
+ });
67
+ export var labelVariant = cva([
68
+ "absolute block transition-all px-[2px] text-input-text peer-focus:text-input-text-active peer-focus:bg-input-label-background",
69
+ ], {
70
+ variants: {
71
+ size: {
72
+ sm: [
73
+ "left-3 top-2 typography-small1 peer-focus:-top-1.5 peer-focus:typography-label2",
74
+ "bg-input-label-background peer-[:not(:placeholder-shown)]:-top-1.5 peer-[:not(:placeholder-shown)]:typography-label2",
75
+ ],
76
+ md: [
77
+ "left-3 top-2 typography-subtitile4 peer-focus:-top-1.5 peer-focus:typography-label1",
78
+ "bg-input-label-background peer-[:not(:placeholder-shown)]:-top-1.5 peer-[:not(:placeholder-shown)]:typography-label1",
79
+ ],
80
+ lg: [
81
+ "left-4 top-4 typography-subtitile1 peer-focus:-top-1.5 peer-focus:typography-label1",
82
+ "bg-input-label-background peer-[:not(:placeholder-shown)]:-top-1.5 peer-[:not(:placeholder-shown)]:typography-label1",
83
+ ],
84
+ },
85
+ disabled: {
86
+ true: "text-input-text-disabled ring-input-stroke-disabled placeholder:text-input-text-disabled",
87
+ },
88
+ error: {
89
+ true: "ring-error",
90
+ },
91
+ isFloating: {
92
+ true: "-top-1.5 typography-label1 bg-input-label-background",
93
+ },
94
+ },
95
+ compoundVariants: [
96
+ {
97
+ size: "sm",
98
+ isFloating: true,
99
+ class: "-top-1.5 typography-label2 bg-input-label-background",
100
+ },
101
+ ],
102
+ defaultVariants: {
103
+ size: "md",
104
+ disabled: false,
105
+ error: false,
106
+ isFloating: false,
107
+ },
108
+ });
109
+ export var helperTextVariant = cva(["text-small1 flex flex-row items-center gap-1"], {
110
+ variants: {
111
+ size: {
112
+ sm: "mt-1",
113
+ md: "mt-[6px]",
114
+ lg: "mt-[6px]",
115
+ },
116
+ disabled: {
117
+ true: "text-input-text-disabled",
118
+ },
119
+ error: {
120
+ true: "text-error",
121
+ false: "text-input-text",
122
+ },
123
+ },
124
+ defaultVariants: {
125
+ size: "md",
126
+ disabled: false,
127
+ error: false,
128
+ },
129
+ });
130
+ export var iconWrapperVariant = cva([
131
+ "absolute inset-y-0 right-0 items-center justify-center hidden peer-focus:flex",
132
+ ], {
133
+ variants: {
134
+ size: {
135
+ sm: "mr-2",
136
+ md: "mr-3",
137
+ lg: "mr-4",
138
+ },
139
+ },
140
+ defaultVariants: {
141
+ size: "md",
142
+ },
143
+ });
144
+ export var iconVariant = cva(["cursor-pointer z-50 fill-input-stroke-active hover:fill-input-text"], {
145
+ variants: {
146
+ size: {
147
+ sm: "size-3",
148
+ md: "size-4",
149
+ lg: "size-5",
150
+ },
151
+ },
152
+ defaultVariants: {
153
+ size: "md",
154
+ },
155
+ });