@dxos/react-ui 0.1.2 → 0.1.3
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/src/components/AlertDialog/AlertDialog.js +1 -1
- package/dist/src/components/Heading/Heading.d.ts +1 -1
- package/dist/src/components/Heading/Heading.stories.d.ts +1 -1
- package/dist/src/components/Input/BarePinInput.d.ts +310 -0
- package/dist/src/components/Input/BarePinInput.d.ts.map +1 -0
- package/dist/src/components/Input/BarePinInput.js +62 -0
- package/dist/src/components/Input/BarePinInput.js.map +1 -0
- package/dist/src/components/Input/BareTextInput.d.ts +5 -0
- package/dist/src/components/Input/BareTextInput.d.ts.map +1 -0
- package/dist/src/components/Input/BareTextInput.js +22 -0
- package/dist/src/components/Input/BareTextInput.js.map +1 -0
- package/dist/src/components/Input/Input.d.ts +3 -16
- package/dist/src/components/Input/Input.d.ts.map +1 -1
- package/dist/src/components/Input/Input.js +22 -10
- package/dist/src/components/Input/Input.js.map +1 -1
- package/dist/src/components/Input/Input.stories.d.ts +7 -3
- package/dist/src/components/Input/Input.stories.d.ts.map +1 -1
- package/dist/src/components/Input/Input.stories.js +15 -2
- package/dist/src/components/Input/Input.stories.js.map +1 -1
- package/dist/src/components/Input/InputProps.d.ts +17 -0
- package/dist/src/components/Input/InputProps.d.ts.map +1 -0
- package/dist/src/components/Input/InputProps.js +6 -0
- package/dist/src/components/Input/InputProps.js.map +1 -0
- package/dist/src/hooks/index.d.ts +2 -0
- package/dist/src/hooks/index.d.ts.map +1 -1
- package/dist/src/hooks/index.js +2 -0
- package/dist/src/hooks/index.js.map +1 -1
- package/dist/src/hooks/useForwardedRef.d.ts +2 -0
- package/dist/src/hooks/useForwardedRef.d.ts.map +1 -0
- package/dist/src/hooks/useForwardedRef.js +24 -0
- package/dist/src/hooks/useForwardedRef.js.map +1 -0
- package/dist/src/hooks/useIsFocused.d.ts +3 -0
- package/dist/src/hooks/useIsFocused.d.ts.map +1 -0
- package/dist/src/hooks/useIsFocused.js +34 -0
- package/dist/src/hooks/useIsFocused.js.map +1 -0
- package/dist/src/plugin.d.ts.map +1 -1
- package/dist/src/plugin.js +9 -1
- package/dist/src/plugin.js.map +1 -1
- package/dist/src/styles/focus.d.ts +1 -0
- package/dist/src/styles/focus.d.ts.map +1 -1
- package/dist/src/styles/focus.js +2 -1
- package/dist/src/styles/focus.js.map +1 -1
- package/dist/src/styles/index.d.ts +1 -0
- package/dist/src/styles/index.d.ts.map +1 -1
- package/dist/src/styles/index.js +1 -0
- package/dist/src/styles/index.js.map +1 -1
- package/dist/src/styles/input.d.ts +11 -0
- package/dist/src/styles/input.d.ts.map +1 -0
- package/dist/src/styles/input.js +24 -0
- package/dist/src/styles/input.js.map +1 -0
- package/dist/src/styles/shimmer.d.ts +2 -0
- package/dist/src/styles/shimmer.d.ts.map +1 -0
- package/dist/src/styles/shimmer.js +8 -0
- package/dist/src/styles/shimmer.js.map +1 -0
- package/package.json +3 -2
- package/src/components/AlertDialog/AlertDialog.tsx +1 -1
- package/src/components/Input/BarePinInput.tsx +62 -0
- package/src/components/Input/BareTextInput.tsx +31 -0
- package/src/components/Input/Input.stories.tsx +18 -1
- package/src/components/Input/Input.tsx +33 -54
- package/src/components/Input/InputProps.ts +23 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useForwardedRef.ts +22 -0
- package/src/hooks/useIsFocused.ts +38 -0
- package/src/plugin.ts +9 -1
- package/src/styles/focus.ts +3 -0
- package/src/styles/index.ts +1 -0
- package/src/styles/input.ts +47 -0
- package/src/styles/shimmer.ts +6 -0
|
@@ -51,7 +51,7 @@ const AlertDialog = ({ title, titleVisuallyHidden, description, openTrigger, can
|
|
|
51
51
|
react_2.default.createElement(react_1.Transition.Child, { as: react_2.Fragment, enter: 'ease-out duration-300', enterFrom: 'opacity-0 scale-95', enterTo: 'opacity-100 scale-100', leave: 'ease-in duration-200', leaveFrom: 'opacity-100 scale-100', leaveTo: 'opacity-0 scale-95' },
|
|
52
52
|
react_2.default.createElement(AlertDialogPrimitive.Content, { forceMount: true, className: (0, classnames_1.default)('fixed z-50', 'w-[95vw] max-w-md rounded-xl p-4 md:w-full', 'top-[50%] left-[50%] -translate-x-[50%] -translate-y-[50%]', 'shadow-2xl bg-white dark:bg-neutral-800 elevated-buttons', styles_1.defaultFocus) },
|
|
53
53
|
react_2.default.createElement(AlertDialogPrimitive.Title, { className: (0, classnames_1.default)('text-2xl font-display font-medium text-neutral-900 dark:text-neutral-100 rounded-md', titleVisuallyHidden && 'sr-only', styles_1.defaultFocus), tabIndex: 0 }, title),
|
|
54
|
-
description && (react_2.default.createElement(AlertDialogPrimitive.Description, { className: (0, classnames_1.default)('
|
|
54
|
+
description && (react_2.default.createElement(AlertDialogPrimitive.Description, { className: (0, classnames_1.default)('my-2', styles_1.defaultDescription) }, description)),
|
|
55
55
|
children,
|
|
56
56
|
destructiveConfirmInputProps && react_2.default.createElement(Input_1.Input, { ...destructiveConfirmInputProps, onChange: setConfirmStringValue }),
|
|
57
57
|
react_2.default.createElement("div", { className: 'flex flex-wrap justify-end gap-4' },
|
|
@@ -64,7 +64,7 @@ export declare const Heading: ({ level, ...props }: PropsWithChildren<HeadingPro
|
|
|
64
64
|
'aria-describedby'?: string | undefined;
|
|
65
65
|
'aria-details'?: string | undefined;
|
|
66
66
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
67
|
-
'aria-dropeffect'?: "
|
|
67
|
+
'aria-dropeffect'?: "copy" | "link" | "none" | "execute" | "move" | "popup" | undefined;
|
|
68
68
|
'aria-errormessage'?: string | undefined;
|
|
69
69
|
'aria-expanded'?: (boolean | "true" | "false") | undefined;
|
|
70
70
|
'aria-flowto'?: string | undefined;
|
|
@@ -64,7 +64,7 @@ declare const _default: {
|
|
|
64
64
|
'aria-describedby'?: string | undefined;
|
|
65
65
|
'aria-details'?: string | undefined;
|
|
66
66
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
67
|
-
'aria-dropeffect'?: "
|
|
67
|
+
'aria-dropeffect'?: "copy" | "link" | "none" | "execute" | "move" | "popup" | undefined;
|
|
68
68
|
'aria-errormessage'?: string | undefined;
|
|
69
69
|
'aria-expanded'?: (boolean | "true" | "false") | undefined;
|
|
70
70
|
'aria-flowto'?: string | undefined;
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
import { CodeInput } from 'rci';
|
|
2
|
+
import React, { ComponentProps } from 'react';
|
|
3
|
+
import { InputProps } from './InputProps';
|
|
4
|
+
export declare type BarePinInputProps = Omit<InputProps, 'ref' | 'label' | 'onChange'> & Pick<ComponentProps<typeof CodeInput>, 'onChange' | 'value' | 'length'>;
|
|
5
|
+
export declare const BarePinInput: React.ForwardRefExoticComponent<Omit<InputProps, "label" | "ref" | "onChange"> & Pick<{
|
|
6
|
+
disabled?: boolean | undefined;
|
|
7
|
+
form?: string | undefined;
|
|
8
|
+
slot?: string | undefined;
|
|
9
|
+
style?: React.CSSProperties | undefined;
|
|
10
|
+
title?: string | undefined;
|
|
11
|
+
pattern?: string | undefined;
|
|
12
|
+
ref?: React.RefObject<HTMLInputElement> | ((instance: HTMLInputElement | null) => void) | null | undefined;
|
|
13
|
+
key?: React.Key | null | undefined;
|
|
14
|
+
defaultChecked?: boolean | undefined;
|
|
15
|
+
defaultValue?: string | number | readonly string[] | undefined;
|
|
16
|
+
suppressContentEditableWarning?: boolean | undefined;
|
|
17
|
+
suppressHydrationWarning?: boolean | undefined;
|
|
18
|
+
accessKey?: string | undefined;
|
|
19
|
+
className?: string | undefined;
|
|
20
|
+
contentEditable?: (boolean | "true" | "false") | "inherit" | undefined;
|
|
21
|
+
contextMenu?: string | undefined;
|
|
22
|
+
dir?: string | undefined;
|
|
23
|
+
draggable?: (boolean | "true" | "false") | undefined;
|
|
24
|
+
hidden?: boolean | undefined;
|
|
25
|
+
id?: string | undefined;
|
|
26
|
+
lang?: string | undefined;
|
|
27
|
+
placeholder?: string | undefined;
|
|
28
|
+
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
29
|
+
tabIndex?: number | undefined;
|
|
30
|
+
translate?: "yes" | "no" | undefined;
|
|
31
|
+
radioGroup?: string | undefined;
|
|
32
|
+
role?: React.AriaRole | undefined;
|
|
33
|
+
about?: string | undefined;
|
|
34
|
+
datatype?: string | undefined;
|
|
35
|
+
inlist?: any;
|
|
36
|
+
prefix?: string | undefined;
|
|
37
|
+
property?: string | undefined;
|
|
38
|
+
resource?: string | undefined;
|
|
39
|
+
typeof?: string | undefined;
|
|
40
|
+
vocab?: string | undefined;
|
|
41
|
+
autoCapitalize?: string | undefined;
|
|
42
|
+
autoCorrect?: string | undefined;
|
|
43
|
+
autoSave?: string | undefined;
|
|
44
|
+
color?: string | undefined;
|
|
45
|
+
itemProp?: string | undefined;
|
|
46
|
+
itemScope?: boolean | undefined;
|
|
47
|
+
itemType?: string | undefined;
|
|
48
|
+
itemID?: string | undefined;
|
|
49
|
+
itemRef?: string | undefined;
|
|
50
|
+
results?: number | undefined;
|
|
51
|
+
security?: string | undefined;
|
|
52
|
+
unselectable?: "on" | "off" | undefined;
|
|
53
|
+
inputMode?: "text" | "search" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
|
54
|
+
is?: string | undefined;
|
|
55
|
+
'aria-activedescendant'?: string | undefined;
|
|
56
|
+
'aria-atomic'?: (boolean | "true" | "false") | undefined;
|
|
57
|
+
'aria-autocomplete'?: "list" | "none" | "inline" | "both" | undefined;
|
|
58
|
+
'aria-busy'?: (boolean | "true" | "false") | undefined;
|
|
59
|
+
'aria-checked'?: boolean | "true" | "false" | "mixed" | undefined;
|
|
60
|
+
'aria-colcount'?: number | undefined;
|
|
61
|
+
'aria-colindex'?: number | undefined;
|
|
62
|
+
'aria-colspan'?: number | undefined;
|
|
63
|
+
'aria-controls'?: string | undefined;
|
|
64
|
+
'aria-current'?: boolean | "time" | "true" | "false" | "page" | "step" | "location" | "date" | undefined;
|
|
65
|
+
'aria-describedby'?: string | undefined;
|
|
66
|
+
'aria-details'?: string | undefined;
|
|
67
|
+
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
68
|
+
'aria-dropeffect'?: "copy" | "link" | "none" | "execute" | "move" | "popup" | undefined;
|
|
69
|
+
'aria-errormessage'?: string | undefined;
|
|
70
|
+
'aria-expanded'?: (boolean | "true" | "false") | undefined;
|
|
71
|
+
'aria-flowto'?: string | undefined;
|
|
72
|
+
'aria-grabbed'?: (boolean | "true" | "false") | undefined;
|
|
73
|
+
'aria-haspopup'?: boolean | "dialog" | "menu" | "grid" | "listbox" | "tree" | "true" | "false" | undefined;
|
|
74
|
+
'aria-hidden'?: (boolean | "true" | "false") | undefined;
|
|
75
|
+
'aria-invalid'?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
|
|
76
|
+
'aria-keyshortcuts'?: string | undefined;
|
|
77
|
+
'aria-label'?: string | undefined;
|
|
78
|
+
'aria-labelledby'?: string | undefined;
|
|
79
|
+
'aria-level'?: number | undefined;
|
|
80
|
+
'aria-live'?: "assertive" | "off" | "polite" | undefined;
|
|
81
|
+
'aria-modal'?: (boolean | "true" | "false") | undefined;
|
|
82
|
+
'aria-multiline'?: (boolean | "true" | "false") | undefined;
|
|
83
|
+
'aria-multiselectable'?: (boolean | "true" | "false") | undefined;
|
|
84
|
+
'aria-orientation'?: "horizontal" | "vertical" | undefined;
|
|
85
|
+
'aria-owns'?: string | undefined;
|
|
86
|
+
'aria-placeholder'?: string | undefined;
|
|
87
|
+
'aria-posinset'?: number | undefined;
|
|
88
|
+
'aria-pressed'?: boolean | "true" | "false" | "mixed" | undefined;
|
|
89
|
+
'aria-readonly'?: (boolean | "true" | "false") | undefined;
|
|
90
|
+
'aria-relevant'?: "text" | "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
|
|
91
|
+
'aria-required'?: (boolean | "true" | "false") | undefined;
|
|
92
|
+
'aria-roledescription'?: string | undefined;
|
|
93
|
+
'aria-rowcount'?: number | undefined;
|
|
94
|
+
'aria-rowindex'?: number | undefined;
|
|
95
|
+
'aria-rowspan'?: number | undefined;
|
|
96
|
+
'aria-selected'?: (boolean | "true" | "false") | undefined;
|
|
97
|
+
'aria-setsize'?: number | undefined;
|
|
98
|
+
'aria-sort'?: "none" | "ascending" | "descending" | "other" | undefined;
|
|
99
|
+
'aria-valuemax'?: number | undefined;
|
|
100
|
+
'aria-valuemin'?: number | undefined;
|
|
101
|
+
'aria-valuenow'?: number | undefined;
|
|
102
|
+
'aria-valuetext'?: string | undefined;
|
|
103
|
+
dangerouslySetInnerHTML?: {
|
|
104
|
+
__html: string;
|
|
105
|
+
} | undefined;
|
|
106
|
+
onCopy?: React.ClipboardEventHandler<HTMLInputElement> | undefined;
|
|
107
|
+
onCopyCapture?: React.ClipboardEventHandler<HTMLInputElement> | undefined;
|
|
108
|
+
onCut?: React.ClipboardEventHandler<HTMLInputElement> | undefined;
|
|
109
|
+
onCutCapture?: React.ClipboardEventHandler<HTMLInputElement> | undefined;
|
|
110
|
+
onPaste?: React.ClipboardEventHandler<HTMLInputElement> | undefined;
|
|
111
|
+
onPasteCapture?: React.ClipboardEventHandler<HTMLInputElement> | undefined;
|
|
112
|
+
onCompositionEnd?: React.CompositionEventHandler<HTMLInputElement> | undefined;
|
|
113
|
+
onCompositionEndCapture?: React.CompositionEventHandler<HTMLInputElement> | undefined;
|
|
114
|
+
onCompositionStart?: React.CompositionEventHandler<HTMLInputElement> | undefined;
|
|
115
|
+
onCompositionStartCapture?: React.CompositionEventHandler<HTMLInputElement> | undefined;
|
|
116
|
+
onCompositionUpdate?: React.CompositionEventHandler<HTMLInputElement> | undefined;
|
|
117
|
+
onCompositionUpdateCapture?: React.CompositionEventHandler<HTMLInputElement> | undefined;
|
|
118
|
+
onFocus?: React.FocusEventHandler<HTMLInputElement> | undefined;
|
|
119
|
+
onFocusCapture?: React.FocusEventHandler<HTMLInputElement> | undefined;
|
|
120
|
+
onBlur?: React.FocusEventHandler<HTMLInputElement> | undefined;
|
|
121
|
+
onBlurCapture?: React.FocusEventHandler<HTMLInputElement> | undefined;
|
|
122
|
+
onChange?: React.ChangeEventHandler<HTMLInputElement> | undefined;
|
|
123
|
+
onChangeCapture?: React.FormEventHandler<HTMLInputElement> | undefined;
|
|
124
|
+
onBeforeInput?: React.FormEventHandler<HTMLInputElement> | undefined;
|
|
125
|
+
onBeforeInputCapture?: React.FormEventHandler<HTMLInputElement> | undefined;
|
|
126
|
+
onInput?: React.FormEventHandler<HTMLInputElement> | undefined;
|
|
127
|
+
onInputCapture?: React.FormEventHandler<HTMLInputElement> | undefined;
|
|
128
|
+
onReset?: React.FormEventHandler<HTMLInputElement> | undefined;
|
|
129
|
+
onResetCapture?: React.FormEventHandler<HTMLInputElement> | undefined;
|
|
130
|
+
onSubmit?: React.FormEventHandler<HTMLInputElement> | undefined;
|
|
131
|
+
onSubmitCapture?: React.FormEventHandler<HTMLInputElement> | undefined;
|
|
132
|
+
onInvalid?: React.FormEventHandler<HTMLInputElement> | undefined;
|
|
133
|
+
onInvalidCapture?: React.FormEventHandler<HTMLInputElement> | undefined;
|
|
134
|
+
onLoad?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
135
|
+
onLoadCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
136
|
+
onError?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
137
|
+
onErrorCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
138
|
+
onKeyDown?: React.KeyboardEventHandler<HTMLInputElement> | undefined;
|
|
139
|
+
onKeyDownCapture?: React.KeyboardEventHandler<HTMLInputElement> | undefined;
|
|
140
|
+
onKeyPress?: React.KeyboardEventHandler<HTMLInputElement> | undefined;
|
|
141
|
+
onKeyPressCapture?: React.KeyboardEventHandler<HTMLInputElement> | undefined;
|
|
142
|
+
onKeyUp?: React.KeyboardEventHandler<HTMLInputElement> | undefined;
|
|
143
|
+
onKeyUpCapture?: React.KeyboardEventHandler<HTMLInputElement> | undefined;
|
|
144
|
+
onAbort?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
145
|
+
onAbortCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
146
|
+
onCanPlay?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
147
|
+
onCanPlayCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
148
|
+
onCanPlayThrough?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
149
|
+
onCanPlayThroughCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
150
|
+
onDurationChange?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
151
|
+
onDurationChangeCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
152
|
+
onEmptied?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
153
|
+
onEmptiedCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
154
|
+
onEncrypted?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
155
|
+
onEncryptedCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
156
|
+
onEnded?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
157
|
+
onEndedCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
158
|
+
onLoadedData?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
159
|
+
onLoadedDataCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
160
|
+
onLoadedMetadata?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
161
|
+
onLoadedMetadataCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
162
|
+
onLoadStart?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
163
|
+
onLoadStartCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
164
|
+
onPause?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
165
|
+
onPauseCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
166
|
+
onPlay?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
167
|
+
onPlayCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
168
|
+
onPlaying?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
169
|
+
onPlayingCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
170
|
+
onProgress?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
171
|
+
onProgressCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
172
|
+
onRateChange?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
173
|
+
onRateChangeCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
174
|
+
onSeeked?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
175
|
+
onSeekedCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
176
|
+
onSeeking?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
177
|
+
onSeekingCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
178
|
+
onStalled?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
179
|
+
onStalledCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
180
|
+
onSuspend?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
181
|
+
onSuspendCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
182
|
+
onTimeUpdate?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
183
|
+
onTimeUpdateCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
184
|
+
onVolumeChange?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
185
|
+
onVolumeChangeCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
186
|
+
onWaiting?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
187
|
+
onWaitingCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
188
|
+
onAuxClick?: React.MouseEventHandler<HTMLInputElement> | undefined;
|
|
189
|
+
onAuxClickCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
|
|
190
|
+
onClick?: React.MouseEventHandler<HTMLInputElement> | undefined;
|
|
191
|
+
onClickCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
|
|
192
|
+
onContextMenu?: React.MouseEventHandler<HTMLInputElement> | undefined;
|
|
193
|
+
onContextMenuCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
|
|
194
|
+
onDoubleClick?: React.MouseEventHandler<HTMLInputElement> | undefined;
|
|
195
|
+
onDoubleClickCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
|
|
196
|
+
onDrag?: React.DragEventHandler<HTMLInputElement> | undefined;
|
|
197
|
+
onDragCapture?: React.DragEventHandler<HTMLInputElement> | undefined;
|
|
198
|
+
onDragEnd?: React.DragEventHandler<HTMLInputElement> | undefined;
|
|
199
|
+
onDragEndCapture?: React.DragEventHandler<HTMLInputElement> | undefined;
|
|
200
|
+
onDragEnter?: React.DragEventHandler<HTMLInputElement> | undefined;
|
|
201
|
+
onDragEnterCapture?: React.DragEventHandler<HTMLInputElement> | undefined;
|
|
202
|
+
onDragExit?: React.DragEventHandler<HTMLInputElement> | undefined;
|
|
203
|
+
onDragExitCapture?: React.DragEventHandler<HTMLInputElement> | undefined;
|
|
204
|
+
onDragLeave?: React.DragEventHandler<HTMLInputElement> | undefined;
|
|
205
|
+
onDragLeaveCapture?: React.DragEventHandler<HTMLInputElement> | undefined;
|
|
206
|
+
onDragOver?: React.DragEventHandler<HTMLInputElement> | undefined;
|
|
207
|
+
onDragOverCapture?: React.DragEventHandler<HTMLInputElement> | undefined;
|
|
208
|
+
onDragStart?: React.DragEventHandler<HTMLInputElement> | undefined;
|
|
209
|
+
onDragStartCapture?: React.DragEventHandler<HTMLInputElement> | undefined;
|
|
210
|
+
onDrop?: React.DragEventHandler<HTMLInputElement> | undefined;
|
|
211
|
+
onDropCapture?: React.DragEventHandler<HTMLInputElement> | undefined;
|
|
212
|
+
onMouseDown?: React.MouseEventHandler<HTMLInputElement> | undefined;
|
|
213
|
+
onMouseDownCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
|
|
214
|
+
onMouseEnter?: React.MouseEventHandler<HTMLInputElement> | undefined;
|
|
215
|
+
onMouseLeave?: React.MouseEventHandler<HTMLInputElement> | undefined;
|
|
216
|
+
onMouseMove?: React.MouseEventHandler<HTMLInputElement> | undefined;
|
|
217
|
+
onMouseMoveCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
|
|
218
|
+
onMouseOut?: React.MouseEventHandler<HTMLInputElement> | undefined;
|
|
219
|
+
onMouseOutCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
|
|
220
|
+
onMouseOver?: React.MouseEventHandler<HTMLInputElement> | undefined;
|
|
221
|
+
onMouseOverCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
|
|
222
|
+
onMouseUp?: React.MouseEventHandler<HTMLInputElement> | undefined;
|
|
223
|
+
onMouseUpCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
|
|
224
|
+
onSelect?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
225
|
+
onSelectCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
226
|
+
onTouchCancel?: React.TouchEventHandler<HTMLInputElement> | undefined;
|
|
227
|
+
onTouchCancelCapture?: React.TouchEventHandler<HTMLInputElement> | undefined;
|
|
228
|
+
onTouchEnd?: React.TouchEventHandler<HTMLInputElement> | undefined;
|
|
229
|
+
onTouchEndCapture?: React.TouchEventHandler<HTMLInputElement> | undefined;
|
|
230
|
+
onTouchMove?: React.TouchEventHandler<HTMLInputElement> | undefined;
|
|
231
|
+
onTouchMoveCapture?: React.TouchEventHandler<HTMLInputElement> | undefined;
|
|
232
|
+
onTouchStart?: React.TouchEventHandler<HTMLInputElement> | undefined;
|
|
233
|
+
onTouchStartCapture?: React.TouchEventHandler<HTMLInputElement> | undefined;
|
|
234
|
+
onPointerDown?: React.PointerEventHandler<HTMLInputElement> | undefined;
|
|
235
|
+
onPointerDownCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
|
|
236
|
+
onPointerMove?: React.PointerEventHandler<HTMLInputElement> | undefined;
|
|
237
|
+
onPointerMoveCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
|
|
238
|
+
onPointerUp?: React.PointerEventHandler<HTMLInputElement> | undefined;
|
|
239
|
+
onPointerUpCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
|
|
240
|
+
onPointerCancel?: React.PointerEventHandler<HTMLInputElement> | undefined;
|
|
241
|
+
onPointerCancelCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
|
|
242
|
+
onPointerEnter?: React.PointerEventHandler<HTMLInputElement> | undefined;
|
|
243
|
+
onPointerEnterCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
|
|
244
|
+
onPointerLeave?: React.PointerEventHandler<HTMLInputElement> | undefined;
|
|
245
|
+
onPointerLeaveCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
|
|
246
|
+
onPointerOver?: React.PointerEventHandler<HTMLInputElement> | undefined;
|
|
247
|
+
onPointerOverCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
|
|
248
|
+
onPointerOut?: React.PointerEventHandler<HTMLInputElement> | undefined;
|
|
249
|
+
onPointerOutCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
|
|
250
|
+
onGotPointerCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
|
|
251
|
+
onGotPointerCaptureCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
|
|
252
|
+
onLostPointerCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
|
|
253
|
+
onLostPointerCaptureCapture?: React.PointerEventHandler<HTMLInputElement> | undefined;
|
|
254
|
+
onScroll?: React.UIEventHandler<HTMLInputElement> | undefined;
|
|
255
|
+
onScrollCapture?: React.UIEventHandler<HTMLInputElement> | undefined;
|
|
256
|
+
onWheel?: React.WheelEventHandler<HTMLInputElement> | undefined;
|
|
257
|
+
onWheelCapture?: React.WheelEventHandler<HTMLInputElement> | undefined;
|
|
258
|
+
onAnimationStart?: React.AnimationEventHandler<HTMLInputElement> | undefined;
|
|
259
|
+
onAnimationStartCapture?: React.AnimationEventHandler<HTMLInputElement> | undefined;
|
|
260
|
+
onAnimationEnd?: React.AnimationEventHandler<HTMLInputElement> | undefined;
|
|
261
|
+
onAnimationEndCapture?: React.AnimationEventHandler<HTMLInputElement> | undefined;
|
|
262
|
+
onAnimationIteration?: React.AnimationEventHandler<HTMLInputElement> | undefined;
|
|
263
|
+
onAnimationIterationCapture?: React.AnimationEventHandler<HTMLInputElement> | undefined;
|
|
264
|
+
onTransitionEnd?: React.TransitionEventHandler<HTMLInputElement> | undefined;
|
|
265
|
+
onTransitionEndCapture?: React.TransitionEventHandler<HTMLInputElement> | undefined;
|
|
266
|
+
list?: string | undefined;
|
|
267
|
+
step?: string | number | undefined;
|
|
268
|
+
value?: string | number | readonly string[] | undefined;
|
|
269
|
+
size?: number | undefined;
|
|
270
|
+
accept?: string | undefined;
|
|
271
|
+
alt?: string | undefined;
|
|
272
|
+
autoComplete?: string | undefined;
|
|
273
|
+
autoFocus?: boolean | undefined;
|
|
274
|
+
capture?: boolean | "user" | "environment" | undefined;
|
|
275
|
+
checked?: boolean | undefined;
|
|
276
|
+
crossOrigin?: string | undefined;
|
|
277
|
+
enterKeyHint?: "search" | "enter" | "done" | "go" | "next" | "previous" | "send" | undefined;
|
|
278
|
+
formAction?: string | undefined;
|
|
279
|
+
formEncType?: string | undefined;
|
|
280
|
+
formMethod?: string | undefined;
|
|
281
|
+
formNoValidate?: boolean | undefined;
|
|
282
|
+
formTarget?: string | undefined;
|
|
283
|
+
height?: string | number | undefined;
|
|
284
|
+
max?: string | number | undefined;
|
|
285
|
+
min?: string | number | undefined;
|
|
286
|
+
minLength?: number | undefined;
|
|
287
|
+
multiple?: boolean | undefined;
|
|
288
|
+
name?: string | undefined;
|
|
289
|
+
readOnly?: boolean | undefined;
|
|
290
|
+
required?: boolean | undefined;
|
|
291
|
+
src?: string | undefined;
|
|
292
|
+
type?: React.HTMLInputTypeAttribute | undefined;
|
|
293
|
+
width?: string | number | undefined;
|
|
294
|
+
} & {
|
|
295
|
+
inputRef: React.RefObject<HTMLInputElement>;
|
|
296
|
+
renderSegment: (segmentProps: import("rci").SegmentProps) => React.ReactNode;
|
|
297
|
+
length?: number | undefined;
|
|
298
|
+
fontFamily?: string | undefined;
|
|
299
|
+
fontSize?: string | undefined;
|
|
300
|
+
padding?: string | undefined;
|
|
301
|
+
paddingY?: string | undefined;
|
|
302
|
+
paddingX?: string | undefined;
|
|
303
|
+
spacing?: string | undefined;
|
|
304
|
+
characterWidth?: string | undefined;
|
|
305
|
+
segmentWidth?: string | undefined;
|
|
306
|
+
inputWidth?: string | undefined;
|
|
307
|
+
inputClassName?: string | undefined;
|
|
308
|
+
inputStyle?: React.CSSProperties | undefined;
|
|
309
|
+
}, "onChange" | "length" | "value"> & React.RefAttributes<HTMLInputElement>>;
|
|
310
|
+
//# sourceMappingURL=BarePinInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BarePinInput.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/BarePinInput.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAsB,MAAM,KAAK,CAAC;AACpD,OAAO,KAAK,EAAE,EAA2B,cAAc,EAAE,MAAM,OAAO,CAAC;AAIvE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAQ1C,oBAAY,iBAAiB,GAAG,IAAI,CAAC,UAAU,EAAE,KAAK,GAAG,OAAO,GAAG,UAAU,CAAC,GAC5E,IAAI,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,EAAE,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAC,CAAC;AAG1E,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4EAuCxB,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//
|
|
3
|
+
// Copyright 2022 DXOS.org
|
|
4
|
+
//
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
29
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
|
+
};
|
|
31
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
+
exports.BarePinInput = void 0;
|
|
33
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
34
|
+
const rci_1 = require("rci");
|
|
35
|
+
const react_1 = __importStar(require("react"));
|
|
36
|
+
const hooks_1 = require("../../hooks");
|
|
37
|
+
const input_1 = require("../../styles/input");
|
|
38
|
+
const bareInputStyleProps = {
|
|
39
|
+
padding: '8px',
|
|
40
|
+
spacing: '8px',
|
|
41
|
+
fontFamily: ''
|
|
42
|
+
};
|
|
43
|
+
// TODO(thure): supplying a `value` prop to CodeInput does not yield correct controlled input interactivity; this may be an issue with RCI (filed as https://github.com/leonardodino/rci/issues/25).
|
|
44
|
+
exports.BarePinInput = (0, react_1.forwardRef)(({ initialValue, size, validationMessage, validationValence, value, ...inputProps }, ref) => {
|
|
45
|
+
const width = (0, rci_1.getSegmentCssWidth)('13px');
|
|
46
|
+
const inputRef = (0, hooks_1.useForwardedRef)(ref);
|
|
47
|
+
const inputFocused = (0, hooks_1.useIsFocused)(inputRef);
|
|
48
|
+
const renderSegment = (0, react_1.useCallback)(({ state, index }) => (react_1.default.createElement("div", { key: index, className: (0, input_1.staticInput)({
|
|
49
|
+
focused: inputFocused && !!state,
|
|
50
|
+
disabled: inputProps.disabled,
|
|
51
|
+
...(validationMessage && { validationValence })
|
|
52
|
+
}), "data-state": state, style: { width, height: '100%' } })), [inputFocused, validationValence, validationMessage, inputProps.disabled]);
|
|
53
|
+
return (react_1.default.createElement(rci_1.CodeInput, { ...{
|
|
54
|
+
spellCheck: false,
|
|
55
|
+
...inputProps,
|
|
56
|
+
...bareInputStyleProps,
|
|
57
|
+
inputRef,
|
|
58
|
+
className: (0, classnames_1.default)('font-mono selection:bg-transparent', inputProps.disabled && 'cursor-not-allowed', inputProps.className),
|
|
59
|
+
renderSegment
|
|
60
|
+
} }));
|
|
61
|
+
});
|
|
62
|
+
//# sourceMappingURL=BarePinInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BarePinInput.js","sourceRoot":"","sources":["../../../../src/components/Input/BarePinInput.tsx"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEF,4DAA4B;AAC5B,6BAAoD;AACpD,+CAAuE;AAEvE,uCAA4D;AAC5D,8CAAiD;AAGjD,MAAM,mBAAmB,GAAG;IAC1B,OAAO,EAAE,KAAK;IACd,OAAO,EAAE,KAAK;IACd,UAAU,EAAE,EAAE;CACf,CAAC;AAKF,oMAAoM;AACvL,QAAA,YAAY,GAAG,IAAA,kBAAU,EACpC,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,KAAK,EAAE,GAAG,UAAU,EAAE,EAAE,GAAG,EAAE,EAAE;IAC1F,MAAM,KAAK,GAAG,IAAA,wBAAkB,EAAC,MAAM,CAAC,CAAC;IACzC,MAAM,QAAQ,GAAG,IAAA,uBAAe,EAAC,GAAG,CAAC,CAAC;IACtC,MAAM,YAAY,GAAG,IAAA,oBAAY,EAAC,QAAQ,CAAC,CAAC;IAE5C,MAAM,aAAa,GAAG,IAAA,mBAAW,EAC/B,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CACpB,uCACE,GAAG,EAAE,KAAK,EACV,SAAS,EAAE,IAAA,mBAAW,EAAC;YACrB,OAAO,EAAE,YAAY,IAAI,CAAC,CAAC,KAAK;YAChC,QAAQ,EAAE,UAAU,CAAC,QAAQ;YAC7B,GAAG,CAAC,iBAAiB,IAAI,EAAE,iBAAiB,EAAE,CAAC;SAChD,CAAC,gBACU,KAAK,EACjB,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,GAChC,CACH,EACD,CAAC,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,UAAU,CAAC,QAAQ,CAAC,CAC1E,CAAC;IAEF,OAAO,CACL,8BAAC,eAAS,OACJ;YACF,UAAU,EAAE,KAAK;YACjB,GAAG,UAAU;YACb,GAAG,mBAAmB;YACtB,QAAQ;YACR,SAAS,EAAE,IAAA,oBAAE,EACX,oCAAoC,EACpC,UAAU,CAAC,QAAQ,IAAI,oBAAoB,EAC3C,UAAU,CAAC,SAAS,CACrB;YACD,aAAa;SACd,GACD,CACH,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
import { InputProps } from './InputProps';
|
|
3
|
+
export declare type BareTextInputProps = Omit<InputProps, 'label' | 'initialValue' | 'onChange'> & Pick<ComponentProps<'input'>, 'onChange'>;
|
|
4
|
+
export declare const BareTextInput: ({ validationValence, validationMessage, size, ...inputProps }: BareTextInputProps) => JSX.Element;
|
|
5
|
+
//# sourceMappingURL=BareTextInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BareTextInput.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/BareTextInput.tsx"],"names":[],"mappings":"AAKA,OAAc,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAG9C,OAAO,EAAE,UAAU,EAAa,MAAM,cAAc,CAAC;AAQrD,oBAAY,kBAAkB,GAAG,IAAI,CAAC,UAAU,EAAE,OAAO,GAAG,cAAc,GAAG,UAAU,CAAC,GACtF,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,UAAU,CAAC,CAAC;AAE5C,eAAO,MAAM,aAAa,kEAAmE,kBAAkB,gBAW9G,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//
|
|
3
|
+
// Copyright 2022 DXOS.org
|
|
4
|
+
//
|
|
5
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.BareTextInput = void 0;
|
|
10
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
11
|
+
const react_1 = __importDefault(require("react"));
|
|
12
|
+
const input_1 = require("../../styles/input");
|
|
13
|
+
const sizeMap = {
|
|
14
|
+
md: 'text-sm',
|
|
15
|
+
lg: 'text-base',
|
|
16
|
+
pin: ''
|
|
17
|
+
};
|
|
18
|
+
const BareTextInput = ({ validationValence, validationMessage, size, ...inputProps }) => {
|
|
19
|
+
return (react_1.default.createElement("input", { ...inputProps, className: (0, classnames_1.default)((0, input_1.defaultInput)({ disabled: inputProps.disabled, ...(validationMessage && { validationValence }) }), 'block w-full px-2.5 py-2', sizeMap[size !== null && size !== void 0 ? size : 'md']) }));
|
|
20
|
+
};
|
|
21
|
+
exports.BareTextInput = BareTextInput;
|
|
22
|
+
//# sourceMappingURL=BareTextInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BareTextInput.js","sourceRoot":"","sources":["../../../../src/components/Input/BareTextInput.tsx"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,4DAA4B;AAC5B,kDAA8C;AAE9C,8CAAkD;AAGlD,MAAM,OAAO,GAA8B;IACzC,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,WAAW;IACf,GAAG,EAAE,EAAE;CACR,CAAC;AAKK,MAAM,aAAa,GAAG,CAAC,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,IAAI,EAAE,GAAG,UAAU,EAAsB,EAAE,EAAE;IACjH,OAAO,CACL,4CACM,UAAU,EACd,SAAS,EAAE,IAAA,oBAAE,EACX,IAAA,oBAAY,EAAC,EAAE,QAAQ,EAAE,UAAU,CAAC,QAAQ,EAAE,GAAG,CAAC,iBAAiB,IAAI,EAAE,iBAAiB,EAAE,CAAC,EAAE,CAAC,EAChG,0BAA0B,EAC1B,OAAO,CAAC,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,IAAI,CAAC,CACtB,GACD,CACH,CAAC;AACJ,CAAC,CAAC;AAXW,QAAA,aAAa,iBAWxB"}
|
|
@@ -1,17 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export declare
|
|
4
|
-
export interface InputProps extends Omit<ComponentProps<'input'>, 'value' | 'onChange' | 'size'> {
|
|
5
|
-
label: ReactNode;
|
|
6
|
-
labelVisuallyHidden?: boolean;
|
|
7
|
-
description?: ReactNode;
|
|
8
|
-
descriptionVisuallyHidden?: boolean;
|
|
9
|
-
initialValue?: string;
|
|
10
|
-
onChange?: (value: string) => void;
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
size?: InputSize;
|
|
13
|
-
validationMessage?: ReactNode;
|
|
14
|
-
validationValence?: MessageValence;
|
|
15
|
-
}
|
|
16
|
-
export declare const Input: ({ label, labelVisuallyHidden, placeholder, description, descriptionVisuallyHidden, required, initialValue, onChange, disabled, className, size, validationMessage, validationValence, ...inputProps }: InputProps) => JSX.Element;
|
|
1
|
+
import { InputProps as NaturalInputProps } from './InputProps';
|
|
2
|
+
export declare type InputProps = NaturalInputProps;
|
|
3
|
+
export declare const Input: ({ label, labelVisuallyHidden, placeholder, description, descriptionVisuallyHidden, required, initialValue, onChange, disabled, className, size, length, validationMessage, validationValence, ...inputProps }: InputProps) => JSX.Element;
|
|
17
4
|
//# sourceMappingURL=Input.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/Input.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/Input.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,UAAU,IAAI,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAE/D,oBAAY,UAAU,GAAG,iBAAiB,CAAC;AAE3C,eAAO,MAAM,KAAK,kNAgBf,UAAU,gBA+EZ,CAAC"}
|
|
@@ -34,14 +34,13 @@ const classnames_1 = __importDefault(require("classnames"));
|
|
|
34
34
|
const react_1 = __importStar(require("react"));
|
|
35
35
|
const hooks_1 = require("../../hooks");
|
|
36
36
|
const styles_1 = require("../../styles");
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
]);
|
|
41
|
-
const Input = ({ label, labelVisuallyHidden, placeholder, description, descriptionVisuallyHidden, required, initialValue, onChange, disabled, className, size, validationMessage, validationValence, ...inputProps }) => {
|
|
37
|
+
const BarePinInput_1 = require("./BarePinInput");
|
|
38
|
+
const BareTextInput_1 = require("./BareTextInput");
|
|
39
|
+
const Input = ({ label, labelVisuallyHidden, placeholder, description, descriptionVisuallyHidden, required, initialValue, onChange, disabled, className, size, length = 6, validationMessage, validationValence, ...inputProps }) => {
|
|
42
40
|
const inputId = inputProps.id || (0, hooks_1.useId)('input');
|
|
43
41
|
const descriptionId = (0, hooks_1.useId)('input-description');
|
|
44
42
|
const validationId = (0, hooks_1.useId)('input-validation');
|
|
43
|
+
const isInvalid = !!validationMessage && validationValence === 'error';
|
|
45
44
|
const [_isPending, startTransition] = (0, react_1.useTransition)();
|
|
46
45
|
const [internalValue, setInternalValue] = (0, react_1.useState)((initialValue === null || initialValue === void 0 ? void 0 : initialValue.toString()) || '');
|
|
47
46
|
const onInternalChange = (0, react_1.useCallback)((e) => {
|
|
@@ -53,13 +52,26 @@ const Input = ({ label, labelVisuallyHidden, placeholder, description, descripti
|
|
|
53
52
|
onChange(nextValue);
|
|
54
53
|
});
|
|
55
54
|
}, [onChange]);
|
|
56
|
-
const
|
|
55
|
+
const bareInputBaseProps = {
|
|
56
|
+
...inputProps,
|
|
57
|
+
id: inputId,
|
|
58
|
+
...(required && { required: true }),
|
|
59
|
+
...(disabled && { disabled: true }),
|
|
60
|
+
...(description && { 'aria-describedby': descriptionId }),
|
|
61
|
+
...(isInvalid && {
|
|
62
|
+
'aria-invalid': 'true',
|
|
63
|
+
'aria-errormessage': validationId
|
|
64
|
+
}),
|
|
65
|
+
...(placeholder && { placeholder }),
|
|
66
|
+
value: internalValue,
|
|
67
|
+
onChange: onInternalChange,
|
|
68
|
+
validationMessage,
|
|
69
|
+
validationValence
|
|
70
|
+
};
|
|
71
|
+
const bareInput = size === 'pin' ? (react_1.default.createElement(BarePinInput_1.BarePinInput, { ...bareInputBaseProps, length: length })) : (react_1.default.createElement(BareTextInput_1.BareTextInput, { ...bareInputBaseProps, size: size }));
|
|
57
72
|
return (react_1.default.createElement("div", { className: (0, classnames_1.default)('my-4', className), role: 'none' },
|
|
58
73
|
react_1.default.createElement("label", { htmlFor: inputId, className: (0, classnames_1.default)('block mb-1 text-sm font-medium text-neutral-900 dark:text-neutral-100', labelVisuallyHidden && 'sr-only') }, label),
|
|
59
|
-
|
|
60
|
-
'aria-invalid': 'true',
|
|
61
|
-
'aria-errormessage': validationId
|
|
62
|
-
}), value: internalValue, onChange: onInternalChange }),
|
|
74
|
+
bareInput,
|
|
63
75
|
(description || validationMessage) && (react_1.default.createElement("p", { ...(!isInvalid && { id: descriptionId }), className: (0, classnames_1.default)(descriptionVisuallyHidden && !isInvalid && 'sr-only') },
|
|
64
76
|
validationMessage && (react_1.default.createElement("span", { id: validationId, className: (0, styles_1.valenceColorText)(validationValence) },
|
|
65
77
|
validationMessage,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.js","sourceRoot":"","sources":["../../../../src/components/Input/Input.tsx"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEF,4DAA4B;AAC5B,+
|
|
1
|
+
{"version":3,"file":"Input.js","sourceRoot":"","sources":["../../../../src/components/Input/Input.tsx"],"names":[],"mappings":"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"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import '@dxosTheme';
|
|
2
|
-
import { InputProps } from './Input';
|
|
3
2
|
declare const _default: {
|
|
4
3
|
title: string;
|
|
5
|
-
component: ({ label, labelVisuallyHidden, placeholder, description, descriptionVisuallyHidden, required, initialValue, onChange, disabled, className, size, validationMessage, validationValence, ...inputProps }: InputProps) => JSX.Element;
|
|
4
|
+
component: ({ label, labelVisuallyHidden, placeholder, description, descriptionVisuallyHidden, required, initialValue, onChange, disabled, className, size, length, validationMessage, validationValence, ...inputProps }: import("./InputProps").InputProps) => JSX.Element;
|
|
6
5
|
argTypes: {
|
|
7
6
|
description: {
|
|
8
7
|
control: string;
|
|
@@ -11,13 +10,18 @@ declare const _default: {
|
|
|
11
10
|
control: string;
|
|
12
11
|
options: string[];
|
|
13
12
|
};
|
|
13
|
+
size: {
|
|
14
|
+
control: string;
|
|
15
|
+
options: string[];
|
|
16
|
+
};
|
|
14
17
|
};
|
|
15
18
|
};
|
|
16
19
|
export default _default;
|
|
17
|
-
export declare const Default: import("@storybook/react").Story<InputProps>;
|
|
20
|
+
export declare const Default: import("@storybook/react").Story<import("./InputProps").InputProps>;
|
|
18
21
|
export declare const Disabled: () => JSX.Element;
|
|
19
22
|
export declare const LabelVisuallyHidden: () => JSX.Element;
|
|
20
23
|
export declare const InputWithDescription: () => JSX.Element;
|
|
21
24
|
export declare const InputWithErrorAndDescription: () => JSX.Element;
|
|
22
25
|
export declare const InputWithValidationAndDescription: () => JSX.Element;
|
|
26
|
+
export declare const PinInput: () => JSX.Element;
|
|
23
27
|
//# sourceMappingURL=Input.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/Input.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC
|
|
1
|
+
{"version":3,"file":"Input.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/Input.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;;;;;;;;;;;;;;;;;;AAMpB,wBAcE;AAMF,eAAO,MAAM,OAAO,qEAAgD,CAAC;AAarE,eAAO,MAAM,QAAQ,mBAQpB,CAAC;AAEF,eAAO,MAAM,mBAAmB,mBAQ/B,CAAC;AAEF,eAAO,MAAM,oBAAoB,mBAQhC,CAAC;AAEF,eAAO,MAAM,4BAA4B,mBAUxC,CAAC;AAEF,eAAO,MAAM,iCAAiC,mBAU7C,CAAC;AAEF,eAAO,MAAM,QAAQ,mBAUpB,CAAC"}
|