@primer/components 0.0.0-20219818220 → 0.0.0-202198182351
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/CHANGELOG.md +1 -1
- package/dist/browser.esm.js +313 -297
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +387 -371
- package/dist/browser.umd.js.map +1 -1
- package/lib/AnchoredOverlay/AnchoredOverlay.d.ts +1 -2
- package/lib/AnchoredOverlay/AnchoredOverlay.js +3 -11
- package/lib/FilteredActionList/FilteredActionList.js +31 -5
- package/lib/Overlay.d.ts +1 -2
- package/lib/Overlay.js +5 -10
- package/lib/TextInput.d.ts +12 -4
- package/lib/TextInput.js +46 -4
- package/lib/Token/AvatarToken.d.ts +7 -0
- package/lib/Token/{ProfileToken.js → AvatarToken.js} +4 -4
- package/lib/Token/_TokenTextContainer.js +3 -14
- package/lib/Token/index.d.ts +1 -1
- package/lib/Token/index.js +3 -3
- package/lib/hooks/useOpenAndCloseFocus.d.ts +1 -2
- package/lib/hooks/useOpenAndCloseFocus.js +2 -7
- package/lib/hooks/useOverlay.d.ts +1 -2
- package/lib/hooks/useOverlay.js +2 -4
- package/lib/index.d.ts +1 -3
- package/lib/index.js +2 -18
- package/lib/utils/types/index.d.ts +0 -1
- package/lib/utils/types/index.js +0 -13
- package/lib-esm/AnchoredOverlay/AnchoredOverlay.d.ts +1 -2
- package/lib-esm/AnchoredOverlay/AnchoredOverlay.js +3 -11
- package/lib-esm/FilteredActionList/FilteredActionList.js +31 -3
- package/lib-esm/Overlay.d.ts +1 -2
- package/lib-esm/Overlay.js +5 -8
- package/lib-esm/TextInput.d.ts +12 -4
- package/lib-esm/TextInput.js +37 -4
- package/lib-esm/Token/AvatarToken.d.ts +7 -0
- package/lib-esm/Token/{ProfileToken.js → AvatarToken.js} +4 -4
- package/lib-esm/Token/_TokenTextContainer.js +2 -11
- package/lib-esm/Token/index.d.ts +1 -1
- package/lib-esm/Token/index.js +1 -1
- package/lib-esm/hooks/useOpenAndCloseFocus.d.ts +1 -2
- package/lib-esm/hooks/useOpenAndCloseFocus.js +2 -7
- package/lib-esm/hooks/useOverlay.d.ts +1 -2
- package/lib-esm/hooks/useOverlay.js +2 -4
- package/lib-esm/index.d.ts +1 -3
- package/lib-esm/index.js +1 -3
- package/lib-esm/utils/types/index.d.ts +0 -1
- package/lib-esm/utils/types/index.js +1 -2
- package/package.json +1 -1
- package/lib/Autocomplete/Autocomplete.d.ts +0 -40
- package/lib/Autocomplete/Autocomplete.js +0 -68
- package/lib/Autocomplete/AutocompleteContext.d.ts +0 -17
- package/lib/Autocomplete/AutocompleteContext.js +0 -11
- package/lib/Autocomplete/AutocompleteInput.d.ts +0 -9
- package/lib/Autocomplete/AutocompleteInput.js +0 -150
- package/lib/Autocomplete/AutocompleteMenu.d.ts +0 -71
- package/lib/Autocomplete/AutocompleteMenu.js +0 -223
- package/lib/Autocomplete/AutocompleteOverlay.d.ts +0 -17
- package/lib/Autocomplete/AutocompleteOverlay.js +0 -69
- package/lib/Autocomplete/index.d.ts +0 -2
- package/lib/Autocomplete/index.js +0 -15
- package/lib/TextInputWithTokens.d.ts +0 -323
- package/lib/TextInputWithTokens.js +0 -244
- package/lib/Token/ProfileToken.d.ts +0 -7
- package/lib/_TextInputWrapper.d.ts +0 -10
- package/lib/_TextInputWrapper.js +0 -51
- package/lib/_UnstyledTextInput.d.ts +0 -2
- package/lib/_UnstyledTextInput.js +0 -20
- package/lib/utils/scrollIntoViewingArea.d.ts +0 -1
- package/lib/utils/scrollIntoViewingArea.js +0 -39
- package/lib/utils/types/MandateProps.d.ts +0 -3
- package/lib/utils/types/MandateProps.js +0 -1
- package/lib-esm/Autocomplete/Autocomplete.d.ts +0 -40
- package/lib-esm/Autocomplete/Autocomplete.js +0 -47
- package/lib-esm/Autocomplete/AutocompleteContext.d.ts +0 -17
- package/lib-esm/Autocomplete/AutocompleteContext.js +0 -2
- package/lib-esm/Autocomplete/AutocompleteInput.d.ts +0 -9
- package/lib-esm/Autocomplete/AutocompleteInput.js +0 -131
- package/lib-esm/Autocomplete/AutocompleteMenu.d.ts +0 -71
- package/lib-esm/Autocomplete/AutocompleteMenu.js +0 -204
- package/lib-esm/Autocomplete/AutocompleteOverlay.d.ts +0 -17
- package/lib-esm/Autocomplete/AutocompleteOverlay.js +0 -51
- package/lib-esm/Autocomplete/index.d.ts +0 -2
- package/lib-esm/Autocomplete/index.js +0 -1
- package/lib-esm/TextInputWithTokens.d.ts +0 -323
- package/lib-esm/TextInputWithTokens.js +0 -219
- package/lib-esm/Token/ProfileToken.d.ts +0 -7
- package/lib-esm/_TextInputWrapper.d.ts +0 -10
- package/lib-esm/_TextInputWrapper.js +0 -31
- package/lib-esm/_UnstyledTextInput.d.ts +0 -2
- package/lib-esm/_UnstyledTextInput.js +0 -7
- package/lib-esm/utils/scrollIntoViewingArea.d.ts +0 -1
- package/lib-esm/utils/scrollIntoViewingArea.js +0 -30
- package/lib-esm/utils/types/MandateProps.d.ts +0 -3
- package/lib-esm/utils/types/MandateProps.js +0 -1
@@ -1,323 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { ComponentProps } from './utils/types';
|
3
|
-
import { TokenSizeKeys } from './Token/TokenBase';
|
4
|
-
declare type AnyReactComponent = React.ComponentType<any>;
|
5
|
-
declare const TextInputWithTokens: React.ForwardRefExoticComponent<Pick<{
|
6
|
-
/**
|
7
|
-
* The array of tokens to render
|
8
|
-
*/
|
9
|
-
tokens: any[];
|
10
|
-
/**
|
11
|
-
* The function that gets called when a token is removed
|
12
|
-
*/
|
13
|
-
onTokenRemove: (tokenId: string | number) => void;
|
14
|
-
/**
|
15
|
-
* The component used to render each token
|
16
|
-
*/
|
17
|
-
tokenComponent?: AnyReactComponent | undefined;
|
18
|
-
/**
|
19
|
-
* The maximum height of the component. If the content in the input exceeds this height,
|
20
|
-
* it will scroll vertically
|
21
|
-
*/
|
22
|
-
maxHeight?: React.CSSProperties['maxHeight'];
|
23
|
-
/**
|
24
|
-
* Whether tokens should render inline horizontally. By default, tokens wrap to new lines.
|
25
|
-
*/
|
26
|
-
preventTokenWrapping?: boolean | undefined;
|
27
|
-
/**
|
28
|
-
* The size of the tokens
|
29
|
-
*/
|
30
|
-
size?: TokenSizeKeys | undefined;
|
31
|
-
/**
|
32
|
-
* Whether the remove buttons should be rendered in the tokens
|
33
|
-
*/
|
34
|
-
hideTokenRemoveButtons?: boolean | undefined;
|
35
|
-
} & Pick<Omit<Pick<{
|
36
|
-
[x: string]: any;
|
37
|
-
[x: number]: any;
|
38
|
-
} & {
|
39
|
-
theme?: any;
|
40
|
-
} & {
|
41
|
-
as?: string | React.ComponentType<any> | undefined;
|
42
|
-
forwardedAs?: string | React.ComponentType<any> | undefined;
|
43
|
-
}, string | number | symbol>, "maxWidth" | "minWidth" | "width" | "theme" | "className" | "block" | "icon" | "sx" | "disabled" | "variant" | "contrast"> & {
|
44
|
-
className?: string | undefined;
|
45
|
-
icon?: React.ComponentType<{
|
46
|
-
className?: string | undefined;
|
47
|
-
}> | undefined;
|
48
|
-
} & Pick<{
|
49
|
-
color?: string | undefined;
|
50
|
-
maxWidth?: import("styled-system").ResponsiveValue<import("csstype").Property.MaxWidth<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
51
|
-
minWidth?: import("styled-system").ResponsiveValue<import("csstype").Property.MinWidth<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
52
|
-
translate?: "yes" | "no" | undefined;
|
53
|
-
width?: import("styled-system").ResponsiveValue<import("csstype").Property.Width<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
54
|
-
hidden?: boolean | undefined;
|
55
|
-
children?: React.ReactNode;
|
56
|
-
ref?: ((instance: HTMLSpanElement | null) => void) | React.RefObject<HTMLSpanElement> | null | undefined;
|
57
|
-
slot?: string | undefined;
|
58
|
-
style?: React.CSSProperties | undefined;
|
59
|
-
title?: string | undefined;
|
60
|
-
key?: React.Key | null | undefined;
|
61
|
-
defaultChecked?: boolean | undefined;
|
62
|
-
defaultValue?: string | number | readonly string[] | undefined;
|
63
|
-
suppressContentEditableWarning?: boolean | undefined;
|
64
|
-
suppressHydrationWarning?: boolean | undefined;
|
65
|
-
accessKey?: string | undefined;
|
66
|
-
className?: string | undefined;
|
67
|
-
contentEditable?: "inherit" | (boolean | "true" | "false") | undefined;
|
68
|
-
contextMenu?: string | undefined;
|
69
|
-
dir?: string | undefined;
|
70
|
-
draggable?: (boolean | "true" | "false") | undefined;
|
71
|
-
id?: string | undefined;
|
72
|
-
lang?: string | undefined;
|
73
|
-
placeholder?: string | undefined;
|
74
|
-
spellCheck?: (boolean | "true" | "false") | undefined;
|
75
|
-
tabIndex?: number | undefined;
|
76
|
-
radioGroup?: string | undefined;
|
77
|
-
role?: React.AriaRole | undefined;
|
78
|
-
about?: string | undefined;
|
79
|
-
datatype?: string | undefined;
|
80
|
-
inlist?: any;
|
81
|
-
prefix?: string | undefined;
|
82
|
-
property?: string | undefined;
|
83
|
-
resource?: string | undefined;
|
84
|
-
typeof?: string | undefined;
|
85
|
-
vocab?: string | undefined;
|
86
|
-
autoCapitalize?: string | undefined;
|
87
|
-
autoCorrect?: string | undefined;
|
88
|
-
autoSave?: string | undefined;
|
89
|
-
itemProp?: string | undefined;
|
90
|
-
itemScope?: boolean | undefined;
|
91
|
-
itemType?: string | undefined;
|
92
|
-
itemID?: string | undefined;
|
93
|
-
itemRef?: string | undefined;
|
94
|
-
results?: number | undefined;
|
95
|
-
security?: string | undefined;
|
96
|
-
unselectable?: "on" | "off" | undefined;
|
97
|
-
inputMode?: "none" | "text" | "search" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
98
|
-
is?: string | undefined;
|
99
|
-
'aria-activedescendant'?: string | undefined;
|
100
|
-
'aria-atomic'?: boolean | "true" | "false" | undefined;
|
101
|
-
'aria-autocomplete'?: "none" | "list" | "inline" | "both" | undefined;
|
102
|
-
'aria-busy'?: boolean | "true" | "false" | undefined;
|
103
|
-
'aria-checked'?: boolean | "true" | "false" | "mixed" | undefined;
|
104
|
-
'aria-colcount'?: number | undefined;
|
105
|
-
'aria-colindex'?: number | undefined;
|
106
|
-
'aria-colspan'?: number | undefined;
|
107
|
-
'aria-controls'?: string | undefined;
|
108
|
-
'aria-current'?: boolean | "time" | "true" | "false" | "page" | "step" | "location" | "date" | undefined;
|
109
|
-
'aria-describedby'?: string | undefined;
|
110
|
-
'aria-details'?: string | undefined;
|
111
|
-
'aria-disabled'?: boolean | "true" | "false" | undefined;
|
112
|
-
'aria-dropeffect'?: "none" | "link" | "copy" | "execute" | "move" | "popup" | undefined;
|
113
|
-
'aria-errormessage'?: string | undefined;
|
114
|
-
'aria-expanded'?: boolean | "true" | "false" | undefined;
|
115
|
-
'aria-flowto'?: string | undefined;
|
116
|
-
'aria-grabbed'?: boolean | "true" | "false" | undefined;
|
117
|
-
'aria-haspopup'?: boolean | "grid" | "dialog" | "menu" | "listbox" | "tree" | "true" | "false" | undefined;
|
118
|
-
'aria-hidden'?: boolean | "true" | "false" | undefined;
|
119
|
-
'aria-invalid'?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
|
120
|
-
'aria-keyshortcuts'?: string | undefined;
|
121
|
-
'aria-label'?: string | undefined;
|
122
|
-
'aria-labelledby'?: string | undefined;
|
123
|
-
'aria-level'?: number | undefined;
|
124
|
-
'aria-live'?: "off" | "assertive" | "polite" | undefined;
|
125
|
-
'aria-modal'?: boolean | "true" | "false" | undefined;
|
126
|
-
'aria-multiline'?: boolean | "true" | "false" | undefined;
|
127
|
-
'aria-multiselectable'?: boolean | "true" | "false" | undefined;
|
128
|
-
'aria-orientation'?: "horizontal" | "vertical" | undefined;
|
129
|
-
'aria-owns'?: string | undefined;
|
130
|
-
'aria-placeholder'?: string | undefined;
|
131
|
-
'aria-posinset'?: number | undefined;
|
132
|
-
'aria-pressed'?: boolean | "true" | "false" | "mixed" | undefined;
|
133
|
-
'aria-readonly'?: boolean | "true" | "false" | undefined;
|
134
|
-
'aria-relevant'?: "all" | "text" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
|
135
|
-
'aria-required'?: boolean | "true" | "false" | undefined;
|
136
|
-
'aria-roledescription'?: string | undefined;
|
137
|
-
'aria-rowcount'?: number | undefined;
|
138
|
-
'aria-rowindex'?: number | 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;
|
149
|
-
} | undefined;
|
150
|
-
onCopy?: React.ClipboardEventHandler<HTMLSpanElement> | undefined;
|
151
|
-
onCopyCapture?: React.ClipboardEventHandler<HTMLSpanElement> | undefined;
|
152
|
-
onCut?: React.ClipboardEventHandler<HTMLSpanElement> | undefined;
|
153
|
-
onCutCapture?: React.ClipboardEventHandler<HTMLSpanElement> | undefined;
|
154
|
-
onPaste?: React.ClipboardEventHandler<HTMLSpanElement> | undefined;
|
155
|
-
onPasteCapture?: React.ClipboardEventHandler<HTMLSpanElement> | undefined;
|
156
|
-
onCompositionEnd?: React.CompositionEventHandler<HTMLSpanElement> | undefined;
|
157
|
-
onCompositionEndCapture?: React.CompositionEventHandler<HTMLSpanElement> | undefined;
|
158
|
-
onCompositionStart?: React.CompositionEventHandler<HTMLSpanElement> | undefined;
|
159
|
-
onCompositionStartCapture?: React.CompositionEventHandler<HTMLSpanElement> | undefined;
|
160
|
-
onCompositionUpdate?: React.CompositionEventHandler<HTMLSpanElement> | undefined;
|
161
|
-
onCompositionUpdateCapture?: React.CompositionEventHandler<HTMLSpanElement> | undefined;
|
162
|
-
onFocus?: React.FocusEventHandler<HTMLSpanElement> | undefined;
|
163
|
-
onFocusCapture?: React.FocusEventHandler<HTMLSpanElement> | undefined;
|
164
|
-
onBlur?: React.FocusEventHandler<HTMLSpanElement> | undefined;
|
165
|
-
onBlurCapture?: React.FocusEventHandler<HTMLSpanElement> | undefined;
|
166
|
-
onChange?: React.FormEventHandler<HTMLSpanElement> | undefined;
|
167
|
-
onChangeCapture?: React.FormEventHandler<HTMLSpanElement> | undefined;
|
168
|
-
onBeforeInput?: React.FormEventHandler<HTMLSpanElement> | undefined;
|
169
|
-
onBeforeInputCapture?: React.FormEventHandler<HTMLSpanElement> | undefined;
|
170
|
-
onInput?: React.FormEventHandler<HTMLSpanElement> | undefined;
|
171
|
-
onInputCapture?: React.FormEventHandler<HTMLSpanElement> | undefined;
|
172
|
-
onReset?: React.FormEventHandler<HTMLSpanElement> | undefined;
|
173
|
-
onResetCapture?: React.FormEventHandler<HTMLSpanElement> | undefined;
|
174
|
-
onSubmit?: React.FormEventHandler<HTMLSpanElement> | undefined;
|
175
|
-
onSubmitCapture?: React.FormEventHandler<HTMLSpanElement> | undefined;
|
176
|
-
onInvalid?: React.FormEventHandler<HTMLSpanElement> | undefined;
|
177
|
-
onInvalidCapture?: React.FormEventHandler<HTMLSpanElement> | undefined;
|
178
|
-
onLoad?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
179
|
-
onLoadCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
180
|
-
onError?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
181
|
-
onErrorCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
182
|
-
onKeyDown?: React.KeyboardEventHandler<HTMLSpanElement> | undefined;
|
183
|
-
onKeyDownCapture?: React.KeyboardEventHandler<HTMLSpanElement> | undefined;
|
184
|
-
onKeyPress?: React.KeyboardEventHandler<HTMLSpanElement> | undefined;
|
185
|
-
onKeyPressCapture?: React.KeyboardEventHandler<HTMLSpanElement> | undefined;
|
186
|
-
onKeyUp?: React.KeyboardEventHandler<HTMLSpanElement> | undefined;
|
187
|
-
onKeyUpCapture?: React.KeyboardEventHandler<HTMLSpanElement> | undefined;
|
188
|
-
onAbort?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
189
|
-
onAbortCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
190
|
-
onCanPlay?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
191
|
-
onCanPlayCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
192
|
-
onCanPlayThrough?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
193
|
-
onCanPlayThroughCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
194
|
-
onDurationChange?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
195
|
-
onDurationChangeCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
196
|
-
onEmptied?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
197
|
-
onEmptiedCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
198
|
-
onEncrypted?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
199
|
-
onEncryptedCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
200
|
-
onEnded?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
201
|
-
onEndedCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
202
|
-
onLoadedData?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
203
|
-
onLoadedDataCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
204
|
-
onLoadedMetadata?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
205
|
-
onLoadedMetadataCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
206
|
-
onLoadStart?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
207
|
-
onLoadStartCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
208
|
-
onPause?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
209
|
-
onPauseCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
210
|
-
onPlay?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
211
|
-
onPlayCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
212
|
-
onPlaying?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
213
|
-
onPlayingCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
214
|
-
onProgress?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
215
|
-
onProgressCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
216
|
-
onRateChange?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
217
|
-
onRateChangeCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
218
|
-
onSeeked?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
219
|
-
onSeekedCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
220
|
-
onSeeking?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
221
|
-
onSeekingCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
222
|
-
onStalled?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
223
|
-
onStalledCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
224
|
-
onSuspend?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
225
|
-
onSuspendCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
226
|
-
onTimeUpdate?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
227
|
-
onTimeUpdateCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
228
|
-
onVolumeChange?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
229
|
-
onVolumeChangeCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
230
|
-
onWaiting?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
231
|
-
onWaitingCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
232
|
-
onAuxClick?: React.MouseEventHandler<HTMLSpanElement> | undefined;
|
233
|
-
onAuxClickCapture?: React.MouseEventHandler<HTMLSpanElement> | undefined;
|
234
|
-
onClick?: React.MouseEventHandler<HTMLSpanElement> | undefined;
|
235
|
-
onClickCapture?: React.MouseEventHandler<HTMLSpanElement> | undefined;
|
236
|
-
onContextMenu?: React.MouseEventHandler<HTMLSpanElement> | undefined;
|
237
|
-
onContextMenuCapture?: React.MouseEventHandler<HTMLSpanElement> | undefined;
|
238
|
-
onDoubleClick?: React.MouseEventHandler<HTMLSpanElement> | undefined;
|
239
|
-
onDoubleClickCapture?: React.MouseEventHandler<HTMLSpanElement> | undefined;
|
240
|
-
onDrag?: React.DragEventHandler<HTMLSpanElement> | undefined;
|
241
|
-
onDragCapture?: React.DragEventHandler<HTMLSpanElement> | undefined;
|
242
|
-
onDragEnd?: React.DragEventHandler<HTMLSpanElement> | undefined;
|
243
|
-
onDragEndCapture?: React.DragEventHandler<HTMLSpanElement> | undefined;
|
244
|
-
onDragEnter?: React.DragEventHandler<HTMLSpanElement> | undefined;
|
245
|
-
onDragEnterCapture?: React.DragEventHandler<HTMLSpanElement> | undefined;
|
246
|
-
onDragExit?: React.DragEventHandler<HTMLSpanElement> | undefined;
|
247
|
-
onDragExitCapture?: React.DragEventHandler<HTMLSpanElement> | undefined;
|
248
|
-
onDragLeave?: React.DragEventHandler<HTMLSpanElement> | undefined;
|
249
|
-
onDragLeaveCapture?: React.DragEventHandler<HTMLSpanElement> | undefined;
|
250
|
-
onDragOver?: React.DragEventHandler<HTMLSpanElement> | undefined;
|
251
|
-
onDragOverCapture?: React.DragEventHandler<HTMLSpanElement> | undefined;
|
252
|
-
onDragStart?: React.DragEventHandler<HTMLSpanElement> | undefined;
|
253
|
-
onDragStartCapture?: React.DragEventHandler<HTMLSpanElement> | undefined;
|
254
|
-
onDrop?: React.DragEventHandler<HTMLSpanElement> | undefined;
|
255
|
-
onDropCapture?: React.DragEventHandler<HTMLSpanElement> | undefined;
|
256
|
-
onMouseDown?: React.MouseEventHandler<HTMLSpanElement> | undefined;
|
257
|
-
onMouseDownCapture?: React.MouseEventHandler<HTMLSpanElement> | undefined;
|
258
|
-
onMouseEnter?: React.MouseEventHandler<HTMLSpanElement> | undefined;
|
259
|
-
onMouseLeave?: React.MouseEventHandler<HTMLSpanElement> | undefined;
|
260
|
-
onMouseMove?: React.MouseEventHandler<HTMLSpanElement> | undefined;
|
261
|
-
onMouseMoveCapture?: React.MouseEventHandler<HTMLSpanElement> | undefined;
|
262
|
-
onMouseOut?: React.MouseEventHandler<HTMLSpanElement> | undefined;
|
263
|
-
onMouseOutCapture?: React.MouseEventHandler<HTMLSpanElement> | undefined;
|
264
|
-
onMouseOver?: React.MouseEventHandler<HTMLSpanElement> | undefined;
|
265
|
-
onMouseOverCapture?: React.MouseEventHandler<HTMLSpanElement> | undefined;
|
266
|
-
onMouseUp?: React.MouseEventHandler<HTMLSpanElement> | undefined;
|
267
|
-
onMouseUpCapture?: React.MouseEventHandler<HTMLSpanElement> | undefined;
|
268
|
-
onSelect?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
269
|
-
onSelectCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
270
|
-
onTouchCancel?: React.TouchEventHandler<HTMLSpanElement> | undefined;
|
271
|
-
onTouchCancelCapture?: React.TouchEventHandler<HTMLSpanElement> | undefined;
|
272
|
-
onTouchEnd?: React.TouchEventHandler<HTMLSpanElement> | undefined;
|
273
|
-
onTouchEndCapture?: React.TouchEventHandler<HTMLSpanElement> | undefined;
|
274
|
-
onTouchMove?: React.TouchEventHandler<HTMLSpanElement> | undefined;
|
275
|
-
onTouchMoveCapture?: React.TouchEventHandler<HTMLSpanElement> | undefined;
|
276
|
-
onTouchStart?: React.TouchEventHandler<HTMLSpanElement> | undefined;
|
277
|
-
onTouchStartCapture?: React.TouchEventHandler<HTMLSpanElement> | undefined;
|
278
|
-
onPointerDown?: React.PointerEventHandler<HTMLSpanElement> | undefined;
|
279
|
-
onPointerDownCapture?: React.PointerEventHandler<HTMLSpanElement> | undefined;
|
280
|
-
onPointerMove?: React.PointerEventHandler<HTMLSpanElement> | undefined;
|
281
|
-
onPointerMoveCapture?: React.PointerEventHandler<HTMLSpanElement> | undefined;
|
282
|
-
onPointerUp?: React.PointerEventHandler<HTMLSpanElement> | undefined;
|
283
|
-
onPointerUpCapture?: React.PointerEventHandler<HTMLSpanElement> | undefined;
|
284
|
-
onPointerCancel?: React.PointerEventHandler<HTMLSpanElement> | undefined;
|
285
|
-
onPointerCancelCapture?: React.PointerEventHandler<HTMLSpanElement> | undefined;
|
286
|
-
onPointerEnter?: React.PointerEventHandler<HTMLSpanElement> | undefined;
|
287
|
-
onPointerEnterCapture?: React.PointerEventHandler<HTMLSpanElement> | undefined;
|
288
|
-
onPointerLeave?: React.PointerEventHandler<HTMLSpanElement> | undefined;
|
289
|
-
onPointerLeaveCapture?: React.PointerEventHandler<HTMLSpanElement> | undefined;
|
290
|
-
onPointerOver?: React.PointerEventHandler<HTMLSpanElement> | undefined;
|
291
|
-
onPointerOverCapture?: React.PointerEventHandler<HTMLSpanElement> | undefined;
|
292
|
-
onPointerOut?: React.PointerEventHandler<HTMLSpanElement> | undefined;
|
293
|
-
onPointerOutCapture?: React.PointerEventHandler<HTMLSpanElement> | undefined;
|
294
|
-
onGotPointerCapture?: React.PointerEventHandler<HTMLSpanElement> | undefined;
|
295
|
-
onGotPointerCaptureCapture?: React.PointerEventHandler<HTMLSpanElement> | undefined;
|
296
|
-
onLostPointerCapture?: React.PointerEventHandler<HTMLSpanElement> | undefined;
|
297
|
-
onLostPointerCaptureCapture?: React.PointerEventHandler<HTMLSpanElement> | undefined;
|
298
|
-
onScroll?: React.UIEventHandler<HTMLSpanElement> | undefined;
|
299
|
-
onScrollCapture?: React.UIEventHandler<HTMLSpanElement> | undefined;
|
300
|
-
onWheel?: React.WheelEventHandler<HTMLSpanElement> | undefined;
|
301
|
-
onWheelCapture?: React.WheelEventHandler<HTMLSpanElement> | undefined;
|
302
|
-
onAnimationStart?: React.AnimationEventHandler<HTMLSpanElement> | undefined;
|
303
|
-
onAnimationStartCapture?: React.AnimationEventHandler<HTMLSpanElement> | undefined;
|
304
|
-
onAnimationEnd?: React.AnimationEventHandler<HTMLSpanElement> | undefined;
|
305
|
-
onAnimationEndCapture?: React.AnimationEventHandler<HTMLSpanElement> | undefined;
|
306
|
-
onAnimationIteration?: React.AnimationEventHandler<HTMLSpanElement> | undefined;
|
307
|
-
onAnimationIterationCapture?: React.AnimationEventHandler<HTMLSpanElement> | undefined;
|
308
|
-
onTransitionEnd?: React.TransitionEventHandler<HTMLSpanElement> | undefined;
|
309
|
-
onTransitionEndCapture?: React.TransitionEventHandler<HTMLSpanElement> | undefined;
|
310
|
-
block?: boolean | undefined;
|
311
|
-
sx?: import("@styled-system/css").SystemStyleObject | undefined;
|
312
|
-
disabled?: boolean | undefined;
|
313
|
-
variant?: "large" | "small" | undefined;
|
314
|
-
hasIcon?: boolean | undefined;
|
315
|
-
contrast?: boolean | undefined;
|
316
|
-
} & {
|
317
|
-
theme?: any;
|
318
|
-
}, "maxWidth" | "minWidth" | "width" | "theme" | "block" | "sx" | "disabled" | "variant" | "contrast">, string | number | symbol> & React.RefAttributes<HTMLInputElement> & {
|
319
|
-
selectedTokenIndex: number | undefined;
|
320
|
-
setSelectedTokenIndex: React.Dispatch<React.SetStateAction<number | undefined>>;
|
321
|
-
}, string | number | symbol> & React.RefAttributes<HTMLInputElement>>;
|
322
|
-
export declare type TextInputWithTokensProps = ComponentProps<typeof TextInputWithTokens>;
|
323
|
-
export default TextInputWithTokens;
|
@@ -1,244 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.default = void 0;
|
7
|
-
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
9
|
-
|
10
|
-
var _props = require("@styled-system/props");
|
11
|
-
|
12
|
-
var _focusZone = require("./behaviors/focusZone");
|
13
|
-
|
14
|
-
var _useCombinedRefs = require("./hooks/useCombinedRefs");
|
15
|
-
|
16
|
-
var _useFocusZone = require("./hooks/useFocusZone");
|
17
|
-
|
18
|
-
var _Token = _interopRequireDefault(require("./Token/Token"));
|
19
|
-
|
20
|
-
var _hooks = require("./hooks");
|
21
|
-
|
22
|
-
var _UnstyledTextInput = _interopRequireDefault(require("./_UnstyledTextInput"));
|
23
|
-
|
24
|
-
var _TextInputWrapper = _interopRequireDefault(require("./_TextInputWrapper"));
|
25
|
-
|
26
|
-
var _Box = _interopRequireDefault(require("./Box"));
|
27
|
-
|
28
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
29
|
-
|
30
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
31
|
-
|
32
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
33
|
-
|
34
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
35
|
-
|
36
|
-
// using forwardRef is important so that other components (ex. Autocomplete) can use the ref
|
37
|
-
function TextInputWithTokensInnerComponent({
|
38
|
-
icon: IconComponent,
|
39
|
-
contrast,
|
40
|
-
className,
|
41
|
-
block,
|
42
|
-
disabled,
|
43
|
-
theme,
|
44
|
-
sx: sxProp,
|
45
|
-
tokens,
|
46
|
-
onTokenRemove,
|
47
|
-
tokenComponent: TokenComponent,
|
48
|
-
preventTokenWrapping,
|
49
|
-
size,
|
50
|
-
hideTokenRemoveButtons,
|
51
|
-
maxHeight,
|
52
|
-
width: widthProp,
|
53
|
-
minWidth: minWidthProp,
|
54
|
-
maxWidth: maxWidthProp,
|
55
|
-
variant: variantProp,
|
56
|
-
...rest
|
57
|
-
}, externalRef) {
|
58
|
-
const {
|
59
|
-
onFocus,
|
60
|
-
onKeyDown,
|
61
|
-
...inputPropsRest
|
62
|
-
} = (0, _props.omit)(rest);
|
63
|
-
const ref = (0, _hooks.useProvidedRefOrCreate)(externalRef);
|
64
|
-
const localInputRef = (0, _react.useRef)(null);
|
65
|
-
const combinedInputRef = (0, _useCombinedRefs.useCombinedRefs)(localInputRef, ref);
|
66
|
-
const [selectedTokenIndex, setSelectedTokenIndex] = (0, _react.useState)();
|
67
|
-
const {
|
68
|
-
containerRef
|
69
|
-
} = (0, _useFocusZone.useFocusZone)({
|
70
|
-
focusOutBehavior: 'wrap',
|
71
|
-
bindKeys: _focusZone.FocusKeys.ArrowHorizontal | _focusZone.FocusKeys.HomeAndEnd,
|
72
|
-
focusableElementFilter: element => {
|
73
|
-
return !element.getAttributeNames().includes('aria-hidden');
|
74
|
-
},
|
75
|
-
getNextFocusable: direction => {
|
76
|
-
var _containerRef$current;
|
77
|
-
|
78
|
-
if (!selectedTokenIndex && selectedTokenIndex !== 0) {
|
79
|
-
return undefined;
|
80
|
-
}
|
81
|
-
|
82
|
-
let nextIndex = selectedTokenIndex + 1; // "+ 1" accounts for the first element: the text input
|
83
|
-
|
84
|
-
if (direction === 'next') {
|
85
|
-
nextIndex += 1;
|
86
|
-
}
|
87
|
-
|
88
|
-
if (direction === 'previous') {
|
89
|
-
nextIndex -= 1;
|
90
|
-
}
|
91
|
-
|
92
|
-
if (nextIndex > tokens.length || nextIndex < 1) {
|
93
|
-
return combinedInputRef.current || undefined;
|
94
|
-
}
|
95
|
-
|
96
|
-
return (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.children[nextIndex];
|
97
|
-
}
|
98
|
-
}, [selectedTokenIndex]);
|
99
|
-
|
100
|
-
const handleTokenRemove = tokenId => {
|
101
|
-
onTokenRemove(tokenId);
|
102
|
-
|
103
|
-
if (selectedTokenIndex) {
|
104
|
-
var _containerRef$current2;
|
105
|
-
|
106
|
-
const nextElementToFocus = (_containerRef$current2 = containerRef.current) === null || _containerRef$current2 === void 0 ? void 0 : _containerRef$current2.children[selectedTokenIndex];
|
107
|
-
nextElementToFocus.focus();
|
108
|
-
}
|
109
|
-
};
|
110
|
-
|
111
|
-
const handleTokenFocus = tokenIndex => () => {
|
112
|
-
setSelectedTokenIndex(tokenIndex);
|
113
|
-
};
|
114
|
-
|
115
|
-
const handleTokenBlur = () => {
|
116
|
-
setSelectedTokenIndex(undefined);
|
117
|
-
};
|
118
|
-
|
119
|
-
const handleTokenKeyUp = e => {
|
120
|
-
if (e.key === 'Escape') {
|
121
|
-
var _ref$current;
|
122
|
-
|
123
|
-
(_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.focus();
|
124
|
-
}
|
125
|
-
};
|
126
|
-
|
127
|
-
const handleInputFocus = e => {
|
128
|
-
onFocus && onFocus(e);
|
129
|
-
setSelectedTokenIndex(undefined);
|
130
|
-
};
|
131
|
-
|
132
|
-
const handleInputKeyDown = e => {
|
133
|
-
var _ref$current2;
|
134
|
-
|
135
|
-
if (onKeyDown) {
|
136
|
-
onKeyDown(e);
|
137
|
-
}
|
138
|
-
|
139
|
-
if ((_ref$current2 = ref.current) !== null && _ref$current2 !== void 0 && _ref$current2.value) {
|
140
|
-
return;
|
141
|
-
}
|
142
|
-
|
143
|
-
const lastToken = tokens[tokens.length - 1];
|
144
|
-
|
145
|
-
if (e.key === 'Backspace' && lastToken) {
|
146
|
-
handleTokenRemove(lastToken.id);
|
147
|
-
|
148
|
-
if (ref.current) {
|
149
|
-
// TODO: eliminate the first hack by making changes to the Autocomplete component
|
150
|
-
//
|
151
|
-
// HACKS:
|
152
|
-
// 1. Directly setting `ref.current.value` instead of updating state because the autocomplete
|
153
|
-
// highlight behavior doesn't work correctly if we update the value with a setState action in onChange
|
154
|
-
// 2. Adding an extra space so that when I backspace, it doesn't delete the last letter
|
155
|
-
ref.current.value = `${lastToken.text} `;
|
156
|
-
} // HACK: for some reason we need to wait a tick for `.select()` to work
|
157
|
-
|
158
|
-
|
159
|
-
setTimeout(() => {
|
160
|
-
var _ref$current3;
|
161
|
-
|
162
|
-
(_ref$current3 = ref.current) === null || _ref$current3 === void 0 ? void 0 : _ref$current3.select();
|
163
|
-
}, 0);
|
164
|
-
}
|
165
|
-
};
|
166
|
-
|
167
|
-
return /*#__PURE__*/_react.default.createElement(_TextInputWrapper.default, {
|
168
|
-
block: block,
|
169
|
-
className: className,
|
170
|
-
contrast: contrast,
|
171
|
-
disabled: disabled,
|
172
|
-
hasIcon: !!IconComponent,
|
173
|
-
theme: theme,
|
174
|
-
width: widthProp,
|
175
|
-
minWidth: minWidthProp,
|
176
|
-
maxWidth: maxWidthProp,
|
177
|
-
variant: variantProp,
|
178
|
-
ref: containerRef,
|
179
|
-
sx: {
|
180
|
-
alignItems: 'center',
|
181
|
-
flexWrap: preventTokenWrapping ? 'nowrap' : 'wrap',
|
182
|
-
gap: '0.25rem',
|
183
|
-
'> *': {
|
184
|
-
flexShrink: 0
|
185
|
-
},
|
186
|
-
...(block ? {
|
187
|
-
display: 'flex',
|
188
|
-
width: '100%'
|
189
|
-
} : {}),
|
190
|
-
...(maxHeight ? {
|
191
|
-
maxHeight,
|
192
|
-
overflow: 'auto'
|
193
|
-
} : {}),
|
194
|
-
...(preventTokenWrapping ? {
|
195
|
-
overflow: 'auto'
|
196
|
-
} : {}),
|
197
|
-
...sxProp
|
198
|
-
}
|
199
|
-
}, /*#__PURE__*/_react.default.createElement(_Box.default, {
|
200
|
-
sx: {
|
201
|
-
order: 1,
|
202
|
-
flexGrow: 1
|
203
|
-
}
|
204
|
-
}, IconComponent && /*#__PURE__*/_react.default.createElement(IconComponent, {
|
205
|
-
className: "TextInput-icon"
|
206
|
-
}), /*#__PURE__*/_react.default.createElement(_UnstyledTextInput.default, _extends({
|
207
|
-
ref: combinedInputRef,
|
208
|
-
disabled: disabled,
|
209
|
-
onFocus: handleInputFocus,
|
210
|
-
onKeyDown: handleInputKeyDown,
|
211
|
-
type: "text",
|
212
|
-
sx: {
|
213
|
-
height: '100%'
|
214
|
-
}
|
215
|
-
}, inputPropsRest))), tokens.length && TokenComponent ? tokens.map(({
|
216
|
-
id,
|
217
|
-
...tokenRest
|
218
|
-
}, i) => /*#__PURE__*/_react.default.createElement(TokenComponent, _extends({
|
219
|
-
key: id,
|
220
|
-
onFocus: handleTokenFocus(i),
|
221
|
-
onBlur: handleTokenBlur,
|
222
|
-
onKeyUp: handleTokenKeyUp,
|
223
|
-
isSelected: selectedTokenIndex === i,
|
224
|
-
onRemove: () => {
|
225
|
-
handleTokenRemove(id);
|
226
|
-
},
|
227
|
-
hideRemoveButton: hideTokenRemoveButtons,
|
228
|
-
size: size,
|
229
|
-
tabIndex: 0
|
230
|
-
}, tokenRest))) : null);
|
231
|
-
}
|
232
|
-
|
233
|
-
TextInputWithTokensInnerComponent.displayName = "TextInputWithTokensInnerComponent";
|
234
|
-
|
235
|
-
const TextInputWithTokens = /*#__PURE__*/_react.default.forwardRef(TextInputWithTokensInnerComponent);
|
236
|
-
|
237
|
-
TextInputWithTokens.defaultProps = {
|
238
|
-
tokenComponent: _Token.default,
|
239
|
-
size: 'extralarge',
|
240
|
-
hideTokenRemoveButtons: false
|
241
|
-
};
|
242
|
-
TextInputWithTokens.displayName = 'TextInputWithTokens';
|
243
|
-
var _default = TextInputWithTokens;
|
244
|
-
exports.default = _default;
|
@@ -1,7 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { TokenBaseProps } from './TokenBase';
|
3
|
-
export interface ProfileTokenProps extends TokenBaseProps {
|
4
|
-
avatarSrc: string;
|
5
|
-
}
|
6
|
-
declare const ProfileToken: React.ForwardRefExoticComponent<Pick<ProfileTokenProps, "sizes" | "color" | "content" | "height" | "translate" | "width" | "hidden" | "children" | "value" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "text" | "list" | "default" | "type" | "name" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "start" | "step" | "size" | "wrap" | "open" | "max" | "media" | "method" | "min" | "target" | "crossOrigin" | "href" | "classID" | "useMap" | "wmode" | "download" | "hrefLang" | "rel" | "alt" | "coords" | "shape" | "autoPlay" | "controls" | "loop" | "mediaGroup" | "muted" | "playsInline" | "preload" | "src" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "dateTime" | "acceptCharset" | "action" | "autoComplete" | "encType" | "noValidate" | "manifest" | "allowFullScreen" | "allowTransparency" | "frameBorder" | "marginHeight" | "marginWidth" | "sandbox" | "scrolling" | "seamless" | "srcDoc" | "srcSet" | "async" | "accept" | "capture" | "checked" | "maxLength" | "minLength" | "multiple" | "readOnly" | "required" | "challenge" | "keyType" | "keyParams" | "htmlFor" | "as" | "integrity" | "charSet" | "httpEquiv" | "high" | "low" | "optimum" | "reversed" | "selected" | "defer" | "nonce" | "scoped" | "cellPadding" | "cellSpacing" | "colSpan" | "headers" | "rowSpan" | "scope" | "cols" | "rows" | "kind" | "srcLang" | "poster" | "onRemove" | "isSelected" | "avatarSrc"> & React.RefAttributes<HTMLElement>>;
|
7
|
-
export default ProfileToken;
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import { MaxWidthProps, MinWidthProps, WidthProps } from 'styled-system';
|
2
|
-
import { SxProp } from './sx';
|
3
|
-
declare const TextInputWrapper: import("styled-components").StyledComponent<"span", any, {
|
4
|
-
disabled?: boolean | undefined;
|
5
|
-
hasIcon?: boolean | undefined;
|
6
|
-
block?: boolean | undefined;
|
7
|
-
contrast?: boolean | undefined;
|
8
|
-
variant?: "large" | "small" | undefined;
|
9
|
-
} & WidthProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.Width<import("styled-system").TLengthStyledSystem>> & MinWidthProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.MinWidth<import("styled-system").TLengthStyledSystem>> & MaxWidthProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.MaxWidth<import("styled-system").TLengthStyledSystem>> & SxProp, never>;
|
10
|
-
export default TextInputWrapper;
|
package/lib/_TextInputWrapper.js
DELETED
@@ -1,51 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.default = void 0;
|
7
|
-
|
8
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
9
|
-
|
10
|
-
var _styledSystem = require("styled-system");
|
11
|
-
|
12
|
-
var _constants = require("./constants");
|
13
|
-
|
14
|
-
var _sx = _interopRequireDefault(require("./sx"));
|
15
|
-
|
16
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
17
|
-
|
18
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
19
|
-
|
20
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
21
|
-
|
22
|
-
const sizeVariants = (0, _styledSystem.variant)({
|
23
|
-
variants: {
|
24
|
-
small: {
|
25
|
-
minHeight: '28px',
|
26
|
-
px: 2,
|
27
|
-
py: '3px',
|
28
|
-
fontSize: 0,
|
29
|
-
lineHeight: '20px'
|
30
|
-
},
|
31
|
-
large: {
|
32
|
-
px: 2,
|
33
|
-
py: '10px',
|
34
|
-
fontSize: 3
|
35
|
-
}
|
36
|
-
}
|
37
|
-
});
|
38
|
-
|
39
|
-
const TextInputWrapper = _styledComponents.default.span.withConfig({
|
40
|
-
displayName: "_TextInputWrapper__TextInputWrapper",
|
41
|
-
componentId: "sc-5vfcis-0"
|
42
|
-
})(["display:inline-flex;align-items:stretch;min-height:34px;font-size:", ";line-height:20px;color:", ";vertical-align:middle;background-repeat:no-repeat;background-position:right 8px center;border:1px solid ", ";border-radius:", ";outline:none;box-shadow:", ";", " .TextInput-icon{align-self:center;color:", ";margin:0 ", ";flex-shrink:0;}&:focus-within{border-color:", ";box-shadow:", ";}", " ", " ", " @media (min-width:", "){font-size:", ";}", " ", " ", " ", " ", ";"], (0, _constants.get)('fontSizes.1'), (0, _constants.get)('colors.fg.default'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('radii.2'), (0, _constants.get)('shadows.primer.shadow.inset'), props => {
|
43
|
-
if (props.hasIcon) {
|
44
|
-
return (0, _styledComponents.css)(["padding:0;"]);
|
45
|
-
} else {
|
46
|
-
return (0, _styledComponents.css)(["padding:6px 12px;"]);
|
47
|
-
}
|
48
|
-
}, (0, _constants.get)('colors.fg.muted'), (0, _constants.get)('space.2'), (0, _constants.get)('colors.accent.emphasis'), (0, _constants.get)('shadows.primer.shadow.focus'), props => props.contrast && (0, _styledComponents.css)(["background-color:", ";"], (0, _constants.get)('colors.canvas.inset')), props => props.disabled && (0, _styledComponents.css)(["color:", ";background-color:", ";border-color:", ";"], (0, _constants.get)('colors.fg.muted'), (0, _constants.get)('colors.input.disabledBg'), (0, _constants.get)('colors.border.default')), props => props.block && (0, _styledComponents.css)(["display:block;width:100%;"]), (0, _constants.get)('breakpoints.1'), (0, _constants.get)('fontSizes.1'), _styledSystem.width, _styledSystem.minWidth, _styledSystem.maxWidth, sizeVariants, _sx.default);
|
49
|
-
|
50
|
-
var _default = TextInputWrapper;
|
51
|
-
exports.default = _default;
|