@rovula/ui 0.0.5 → 0.0.7
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/cjs/bundle.css +272 -2
- package/dist/cjs/bundle.js +1 -1
- package/dist/cjs/bundle.js.map +1 -1
- package/dist/cjs/types/components/Button/Buttons.stories.d.ts +1 -1
- package/dist/cjs/types/components/TextInput/TextInput.d.ts +19 -0
- package/dist/cjs/types/components/TextInput/TextInput.stories.d.ts +338 -0
- package/dist/cjs/types/components/TextInput/TextInput.styles.d.ts +26 -0
- package/dist/cjs/types/index.d.ts +1 -1
- package/dist/components/TextInput/TextInput.js +61 -0
- package/dist/components/TextInput/TextInput.stories.js +39 -0
- package/dist/components/TextInput/TextInput.styles.js +155 -0
- package/dist/esm/bundle.css +272 -2
- package/dist/esm/bundle.js +1 -1
- package/dist/esm/bundle.js.map +1 -1
- package/dist/esm/types/components/Button/Buttons.stories.d.ts +1 -1
- package/dist/esm/types/components/TextInput/TextInput.d.ts +19 -0
- package/dist/esm/types/components/TextInput/TextInput.stories.d.ts +338 -0
- package/dist/esm/types/components/TextInput/TextInput.styles.d.ts +26 -0
- package/dist/esm/types/index.d.ts +1 -1
- package/dist/index.d.ts +15 -7
- package/dist/index.js +1 -1
- package/dist/src/theme/global.css +341 -1
- package/dist/theme/global.css +15 -2
- package/dist/theme/presets/colors.js +26 -0
- package/package.json +1 -1
- package/src/components/TextInput/TextInput.stories.tsx +44 -0
- package/src/components/TextInput/TextInput.styles.ts +177 -0
- package/src/components/TextInput/TextInput.tsx +119 -0
- package/src/index.ts +1 -1
- package/src/theme/global.css +15 -2
- package/src/theme/presets/colors.js +26 -0
|
@@ -95,7 +95,7 @@ declare const meta: {
|
|
|
95
95
|
"aria-colindextext"?: string | undefined;
|
|
96
96
|
"aria-colspan"?: number | undefined;
|
|
97
97
|
"aria-controls"?: string | undefined;
|
|
98
|
-
"aria-current"?: boolean | "true" | "false" | "date" | "time" | "
|
|
98
|
+
"aria-current"?: boolean | "true" | "false" | "date" | "time" | "step" | "page" | "location" | undefined;
|
|
99
99
|
"aria-describedby"?: string | undefined;
|
|
100
100
|
"aria-description"?: string | undefined;
|
|
101
101
|
"aria-details"?: string | undefined;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React, { FC } from "react";
|
|
2
|
+
type InputProps = {
|
|
3
|
+
id?: string;
|
|
4
|
+
label?: string;
|
|
5
|
+
size?: "sm" | "md" | "lg";
|
|
6
|
+
rounded?: "none" | "normal" | "full";
|
|
7
|
+
variant?: "flat" | "outline" | "underline";
|
|
8
|
+
type?: React.HTMLInputTypeAttribute;
|
|
9
|
+
helperText?: string;
|
|
10
|
+
errorMessage?: string;
|
|
11
|
+
fullwidth?: boolean;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
error?: boolean;
|
|
14
|
+
required?: boolean;
|
|
15
|
+
hasClearIcon?: boolean;
|
|
16
|
+
className?: string;
|
|
17
|
+
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, "size">;
|
|
18
|
+
declare const TextInput: FC<InputProps>;
|
|
19
|
+
export default TextInput;
|
|
@@ -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" | "step" | "page" | "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
|
+
accept?: string | undefined;
|
|
312
|
+
alt?: string | undefined;
|
|
313
|
+
autoComplete?: React.HTMLInputAutoCompleteAttribute | undefined;
|
|
314
|
+
capture?: boolean | "user" | "environment" | undefined;
|
|
315
|
+
checked?: boolean | undefined;
|
|
316
|
+
enterKeyHint?: "search" | "enter" | "done" | "go" | "next" | "previous" | "send" | undefined;
|
|
317
|
+
height?: string | number | undefined;
|
|
318
|
+
max?: string | number | undefined;
|
|
319
|
+
maxLength?: number | undefined;
|
|
320
|
+
min?: string | number | undefined;
|
|
321
|
+
minLength?: number | undefined;
|
|
322
|
+
multiple?: boolean | undefined;
|
|
323
|
+
pattern?: string | undefined;
|
|
324
|
+
placeholder?: string | undefined;
|
|
325
|
+
readOnly?: boolean | undefined;
|
|
326
|
+
src?: string | undefined;
|
|
327
|
+
step?: string | number | 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;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./theme/global.css";
|
|
2
2
|
export { default as Button } from "./components/Button/Button";
|
|
3
3
|
export { default as Table } from "./components/Table/Table";
|
|
4
|
-
export { default as TextInput } from "./components/
|
|
4
|
+
export { default as TextInput } from "./components/TextInput/TextInput";
|
|
5
5
|
export { default as Text } from "./components/Text/Text";
|
|
6
6
|
export { default as Tabs } from "./components/Tabs/Tabs";
|
|
7
7
|
export { resloveTimestamp, getStartDateOfDay, getEndDateOfDay, getStartEndTimestampOfDay, getTimestampUTC, } from "./utils/datetime";
|
|
@@ -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
|
+
};
|