@primer/components 0.0.0-202195193757 → 0.0.0-202195195659

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.
Files changed (61) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/dist/browser.esm.js +93 -74
  3. package/dist/browser.esm.js.map +1 -1
  4. package/dist/browser.umd.js +85 -66
  5. package/dist/browser.umd.js.map +1 -1
  6. package/lib/Autocomplete/AutocompleteInput.d.ts +1 -1
  7. package/lib/Autocomplete/AutocompleteInput.js +12 -12
  8. package/lib/Autocomplete/AutocompleteMenu.js +4 -6
  9. package/lib/Autocomplete/AutocompleteOverlay.js +1 -1
  10. package/lib/Autocomplete/index.d.ts +1 -1
  11. package/lib/TextInput.d.ts +1 -1
  12. package/lib/TextInputWithTokens.d.ts +298 -16
  13. package/lib/TextInputWithTokens.js +34 -26
  14. package/lib/Token/IssueLabelToken.d.ts +14 -0
  15. package/lib/Token/{TokenLabel.js → IssueLabelToken.js} +35 -28
  16. package/lib/Token/{TokenProfile.d.ts → ProfileToken.d.ts} +3 -3
  17. package/lib/Token/{TokenProfile.js → ProfileToken.js} +7 -7
  18. package/lib/Token/Token.d.ts +2 -2
  19. package/lib/Token/Token.js +34 -22
  20. package/lib/Token/TokenBase.d.ts +5 -5
  21. package/lib/Token/TokenBase.js +41 -25
  22. package/lib/Token/_RemoveTokenButton.d.ts +11 -2
  23. package/lib/Token/_RemoveTokenButton.js +53 -22
  24. package/lib/Token/_TokenTextContainer.d.ts +3 -0
  25. package/lib/Token/_TokenTextContainer.js +34 -0
  26. package/lib/Token/index.d.ts +2 -2
  27. package/lib/Token/index.js +6 -6
  28. package/lib/index.d.ts +1 -1
  29. package/lib/index.js +4 -4
  30. package/lib-esm/Autocomplete/AutocompleteInput.d.ts +1 -1
  31. package/lib-esm/Autocomplete/AutocompleteInput.js +12 -12
  32. package/lib-esm/Autocomplete/AutocompleteMenu.js +4 -6
  33. package/lib-esm/Autocomplete/AutocompleteOverlay.js +1 -1
  34. package/lib-esm/Autocomplete/index.d.ts +1 -1
  35. package/lib-esm/TextInput.d.ts +1 -1
  36. package/lib-esm/TextInputWithTokens.d.ts +298 -16
  37. package/lib-esm/TextInputWithTokens.js +34 -26
  38. package/lib-esm/Token/IssueLabelToken.d.ts +14 -0
  39. package/lib-esm/Token/{TokenLabel.js → IssueLabelToken.js} +34 -28
  40. package/lib-esm/Token/{TokenProfile.d.ts → ProfileToken.d.ts} +3 -3
  41. package/lib-esm/Token/{TokenProfile.js → ProfileToken.js} +7 -7
  42. package/lib-esm/Token/Token.d.ts +2 -2
  43. package/lib-esm/Token/Token.js +33 -22
  44. package/lib-esm/Token/TokenBase.d.ts +5 -5
  45. package/lib-esm/Token/TokenBase.js +41 -25
  46. package/lib-esm/Token/_RemoveTokenButton.d.ts +11 -2
  47. package/lib-esm/Token/_RemoveTokenButton.js +52 -22
  48. package/lib-esm/Token/_TokenTextContainer.d.ts +3 -0
  49. package/lib-esm/Token/_TokenTextContainer.js +21 -0
  50. package/lib-esm/Token/index.d.ts +2 -2
  51. package/lib-esm/Token/index.js +2 -2
  52. package/lib-esm/_UnstyledTextInput.js +1 -1
  53. package/lib-esm/index.d.ts +1 -1
  54. package/lib-esm/index.js +1 -1
  55. package/package.json +1 -1
  56. package/lib/Token/TokenLabel.d.ts +0 -14
  57. package/lib/Token/_tokenButtonUtils.d.ts +0 -10
  58. package/lib/Token/_tokenButtonUtils.js +0 -42
  59. package/lib-esm/Token/TokenLabel.d.ts +0 -14
  60. package/lib-esm/Token/_tokenButtonUtils.d.ts +0 -10
  61. package/lib-esm/Token/_tokenButtonUtils.js +0 -26
@@ -1,17 +1,11 @@
1
- import React, { ComponentPropsWithoutRef } from 'react';
2
- import { ComponentProps, MandateProps } from './utils/types';
3
- import Token, { TokenProps } from './Token/Token';
4
- import TokenLabel, { TokenLabelProps } from './Token/TokenLabel';
5
- import TokenProfile, { TokenProfileProps } from './Token/TokenProfile';
1
+ import React from 'react';
2
+ import { ComponentProps } from './utils/types';
6
3
  import { TokenSizeKeys } from './Token/TokenBase';
7
- import { TextInputProps } from './TextInput';
8
- declare type AnyTokenProps = Partial<TokenProps & TokenLabelProps & TokenProfileProps>;
9
- declare type TokenDatum = MandateProps<AnyTokenProps, 'id' | 'text'>;
10
- declare type TextInputWithTokensInternalProps = {
4
+ declare const TextInputWithTokens: React.ForwardRefExoticComponent<Pick<{
11
5
  /**
12
6
  * The array of tokens to render
13
7
  */
14
- tokens: TokenDatum[];
8
+ tokens: any[];
15
9
  /**
16
10
  * The function that gets called when a token is removed
17
11
  */
@@ -19,7 +13,7 @@ declare type TextInputWithTokensInternalProps = {
19
13
  /**
20
14
  * The component used to render each token
21
15
  */
22
- tokenComponent?: React.ComponentType<ComponentPropsWithoutRef<typeof Token> | ComponentPropsWithoutRef<typeof TokenLabel> | ComponentPropsWithoutRef<typeof TokenProfile>>;
16
+ tokenComponent?: React.ComponentType<any> | undefined;
23
17
  /**
24
18
  * The maximum height of the component. If the content in the input exceeds this height,
25
19
  * it will scroll vertically
@@ -28,16 +22,304 @@ declare type TextInputWithTokensInternalProps = {
28
22
  /**
29
23
  * Whether tokens should render inline horizontally. By default, tokens wrap to new lines.
30
24
  */
31
- preventTokenWrapping?: boolean;
25
+ preventTokenWrapping?: boolean | undefined;
32
26
  /**
33
27
  * The size of the tokens
34
28
  */
35
- tokenSizeVariant?: TokenSizeKeys;
29
+ size?: TokenSizeKeys | undefined;
36
30
  /**
37
31
  * Whether the remove buttons should be rendered in the tokens
38
32
  */
39
- hideTokenRemoveButtons?: boolean;
40
- } & TextInputProps;
41
- declare const TextInputWithTokens: React.ForwardRefExoticComponent<Pick<TextInputWithTokensInternalProps, string | number | symbol> & React.RefAttributes<HTMLInputElement>>;
33
+ hideTokenRemoveButtons?: boolean | undefined;
34
+ } & Omit<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof React.InputHTMLAttributes<HTMLInputElement>> & {
35
+ ref?: ((instance: HTMLInputElement | null) => void) | React.RefObject<HTMLInputElement> | null | undefined;
36
+ }, string | number | symbol> & {
37
+ className?: string | undefined;
38
+ icon?: React.ComponentType<{
39
+ className?: string | undefined;
40
+ }> | undefined;
41
+ inputComponent?: React.ComponentType<HTMLInputElement> | undefined;
42
+ wrapperRef?: React.RefObject<HTMLSpanElement> | undefined;
43
+ } & Pick<{
44
+ color?: string | undefined;
45
+ maxWidth?: import("styled-system").ResponsiveValue<import("csstype").Property.MaxWidth<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
46
+ minWidth?: import("styled-system").ResponsiveValue<import("csstype").Property.MinWidth<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
47
+ translate?: "yes" | "no" | undefined;
48
+ width?: import("styled-system").ResponsiveValue<import("csstype").Property.Width<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
49
+ hidden?: boolean | undefined;
50
+ children?: React.ReactNode;
51
+ ref?: ((instance: HTMLSpanElement | null) => void) | React.RefObject<HTMLSpanElement> | null | undefined;
52
+ slot?: string | undefined;
53
+ style?: React.CSSProperties | undefined;
54
+ title?: string | undefined;
55
+ key?: React.Key | null | undefined;
56
+ defaultChecked?: boolean | undefined;
57
+ defaultValue?: string | number | readonly string[] | undefined;
58
+ suppressContentEditableWarning?: boolean | undefined;
59
+ suppressHydrationWarning?: boolean | undefined;
60
+ accessKey?: string | undefined;
61
+ className?: string | undefined;
62
+ contentEditable?: "inherit" | (boolean | "true" | "false") | undefined;
63
+ contextMenu?: string | undefined;
64
+ dir?: string | undefined;
65
+ draggable?: (boolean | "true" | "false") | undefined;
66
+ id?: string | undefined;
67
+ lang?: string | undefined;
68
+ placeholder?: string | undefined;
69
+ spellCheck?: (boolean | "true" | "false") | undefined;
70
+ tabIndex?: number | undefined;
71
+ radioGroup?: string | undefined;
72
+ role?: React.AriaRole | undefined;
73
+ about?: string | undefined;
74
+ datatype?: string | undefined;
75
+ inlist?: any;
76
+ prefix?: string | undefined;
77
+ property?: string | undefined;
78
+ resource?: string | undefined;
79
+ typeof?: string | undefined;
80
+ vocab?: string | undefined;
81
+ autoCapitalize?: string | undefined;
82
+ autoCorrect?: string | undefined;
83
+ autoSave?: string | undefined;
84
+ itemProp?: string | undefined;
85
+ itemScope?: boolean | undefined;
86
+ itemType?: string | undefined;
87
+ itemID?: string | undefined;
88
+ itemRef?: string | undefined;
89
+ results?: number | undefined;
90
+ security?: string | undefined;
91
+ unselectable?: "on" | "off" | undefined;
92
+ inputMode?: "none" | "text" | "search" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
93
+ is?: string | undefined;
94
+ 'aria-activedescendant'?: string | undefined;
95
+ 'aria-atomic'?: boolean | "true" | "false" | undefined;
96
+ 'aria-autocomplete'?: "none" | "list" | "inline" | "both" | undefined;
97
+ 'aria-busy'?: boolean | "true" | "false" | undefined;
98
+ 'aria-checked'?: boolean | "true" | "false" | "mixed" | undefined;
99
+ 'aria-colcount'?: number | undefined;
100
+ 'aria-colindex'?: number | undefined;
101
+ 'aria-colspan'?: number | undefined;
102
+ 'aria-controls'?: string | undefined;
103
+ 'aria-current'?: boolean | "time" | "true" | "false" | "page" | "step" | "location" | "date" | undefined;
104
+ 'aria-describedby'?: string | undefined;
105
+ 'aria-details'?: string | undefined;
106
+ 'aria-disabled'?: boolean | "true" | "false" | undefined;
107
+ 'aria-dropeffect'?: "none" | "link" | "copy" | "execute" | "move" | "popup" | undefined;
108
+ 'aria-errormessage'?: string | undefined;
109
+ 'aria-expanded'?: boolean | "true" | "false" | undefined;
110
+ 'aria-flowto'?: string | undefined;
111
+ 'aria-grabbed'?: boolean | "true" | "false" | undefined;
112
+ 'aria-haspopup'?: boolean | "grid" | "dialog" | "menu" | "listbox" | "tree" | "true" | "false" | undefined;
113
+ 'aria-hidden'?: boolean | "true" | "false" | undefined;
114
+ 'aria-invalid'?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
115
+ 'aria-keyshortcuts'?: string | undefined;
116
+ 'aria-label'?: string | undefined;
117
+ 'aria-labelledby'?: string | undefined;
118
+ 'aria-level'?: number | undefined;
119
+ 'aria-live'?: "off" | "assertive" | "polite" | undefined;
120
+ 'aria-modal'?: boolean | "true" | "false" | undefined;
121
+ 'aria-multiline'?: boolean | "true" | "false" | undefined;
122
+ 'aria-multiselectable'?: boolean | "true" | "false" | undefined;
123
+ 'aria-orientation'?: "horizontal" | "vertical" | undefined;
124
+ 'aria-owns'?: string | undefined;
125
+ 'aria-placeholder'?: string | undefined;
126
+ 'aria-posinset'?: number | undefined;
127
+ 'aria-pressed'?: boolean | "true" | "false" | "mixed" | undefined;
128
+ 'aria-readonly'?: boolean | "true" | "false" | undefined;
129
+ 'aria-relevant'?: "all" | "text" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
130
+ 'aria-required'?: boolean | "true" | "false" | undefined;
131
+ 'aria-roledescription'?: string | undefined;
132
+ 'aria-rowcount'?: number | undefined;
133
+ 'aria-rowindex'?: number | undefined;
134
+ 'aria-rowspan'?: number | undefined;
135
+ 'aria-selected'?: boolean | "true" | "false" | undefined;
136
+ 'aria-setsize'?: number | undefined;
137
+ 'aria-sort'?: "none" | "ascending" | "descending" | "other" | undefined;
138
+ 'aria-valuemax'?: number | undefined;
139
+ 'aria-valuemin'?: number | undefined;
140
+ 'aria-valuenow'?: number | undefined;
141
+ 'aria-valuetext'?: string | undefined;
142
+ dangerouslySetInnerHTML?: {
143
+ __html: string;
144
+ } | undefined;
145
+ onCopy?: React.ClipboardEventHandler<HTMLSpanElement> | undefined;
146
+ onCopyCapture?: React.ClipboardEventHandler<HTMLSpanElement> | undefined;
147
+ onCut?: React.ClipboardEventHandler<HTMLSpanElement> | undefined;
148
+ onCutCapture?: React.ClipboardEventHandler<HTMLSpanElement> | undefined;
149
+ onPaste?: React.ClipboardEventHandler<HTMLSpanElement> | undefined;
150
+ onPasteCapture?: React.ClipboardEventHandler<HTMLSpanElement> | undefined;
151
+ onCompositionEnd?: React.CompositionEventHandler<HTMLSpanElement> | undefined;
152
+ onCompositionEndCapture?: React.CompositionEventHandler<HTMLSpanElement> | undefined;
153
+ onCompositionStart?: React.CompositionEventHandler<HTMLSpanElement> | undefined;
154
+ onCompositionStartCapture?: React.CompositionEventHandler<HTMLSpanElement> | undefined;
155
+ onCompositionUpdate?: React.CompositionEventHandler<HTMLSpanElement> | undefined;
156
+ onCompositionUpdateCapture?: React.CompositionEventHandler<HTMLSpanElement> | undefined;
157
+ onFocus?: React.FocusEventHandler<HTMLSpanElement> | undefined;
158
+ onFocusCapture?: React.FocusEventHandler<HTMLSpanElement> | undefined;
159
+ onBlur?: React.FocusEventHandler<HTMLSpanElement> | undefined;
160
+ onBlurCapture?: React.FocusEventHandler<HTMLSpanElement> | undefined;
161
+ onChange?: React.FormEventHandler<HTMLSpanElement> | undefined;
162
+ onChangeCapture?: React.FormEventHandler<HTMLSpanElement> | undefined;
163
+ onBeforeInput?: React.FormEventHandler<HTMLSpanElement> | undefined;
164
+ onBeforeInputCapture?: React.FormEventHandler<HTMLSpanElement> | undefined;
165
+ onInput?: React.FormEventHandler<HTMLSpanElement> | undefined;
166
+ onInputCapture?: React.FormEventHandler<HTMLSpanElement> | undefined;
167
+ onReset?: React.FormEventHandler<HTMLSpanElement> | undefined;
168
+ onResetCapture?: React.FormEventHandler<HTMLSpanElement> | undefined;
169
+ onSubmit?: React.FormEventHandler<HTMLSpanElement> | undefined;
170
+ onSubmitCapture?: React.FormEventHandler<HTMLSpanElement> | undefined;
171
+ onInvalid?: React.FormEventHandler<HTMLSpanElement> | undefined;
172
+ onInvalidCapture?: React.FormEventHandler<HTMLSpanElement> | undefined;
173
+ onLoad?: React.ReactEventHandler<HTMLSpanElement> | undefined;
174
+ onLoadCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
175
+ onError?: React.ReactEventHandler<HTMLSpanElement> | undefined;
176
+ onErrorCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
177
+ onKeyDown?: React.KeyboardEventHandler<HTMLSpanElement> | undefined;
178
+ onKeyDownCapture?: React.KeyboardEventHandler<HTMLSpanElement> | undefined;
179
+ onKeyPress?: React.KeyboardEventHandler<HTMLSpanElement> | undefined;
180
+ onKeyPressCapture?: React.KeyboardEventHandler<HTMLSpanElement> | undefined;
181
+ onKeyUp?: React.KeyboardEventHandler<HTMLSpanElement> | undefined;
182
+ onKeyUpCapture?: React.KeyboardEventHandler<HTMLSpanElement> | undefined;
183
+ onAbort?: React.ReactEventHandler<HTMLSpanElement> | undefined;
184
+ onAbortCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
185
+ onCanPlay?: React.ReactEventHandler<HTMLSpanElement> | undefined;
186
+ onCanPlayCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
187
+ onCanPlayThrough?: React.ReactEventHandler<HTMLSpanElement> | undefined;
188
+ onCanPlayThroughCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
189
+ onDurationChange?: React.ReactEventHandler<HTMLSpanElement> | undefined;
190
+ onDurationChangeCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
191
+ onEmptied?: React.ReactEventHandler<HTMLSpanElement> | undefined;
192
+ onEmptiedCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
193
+ onEncrypted?: React.ReactEventHandler<HTMLSpanElement> | undefined;
194
+ onEncryptedCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
195
+ onEnded?: React.ReactEventHandler<HTMLSpanElement> | undefined;
196
+ onEndedCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
197
+ onLoadedData?: React.ReactEventHandler<HTMLSpanElement> | undefined;
198
+ onLoadedDataCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
199
+ onLoadedMetadata?: React.ReactEventHandler<HTMLSpanElement> | undefined;
200
+ onLoadedMetadataCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
201
+ onLoadStart?: React.ReactEventHandler<HTMLSpanElement> | undefined;
202
+ onLoadStartCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
203
+ onPause?: React.ReactEventHandler<HTMLSpanElement> | undefined;
204
+ onPauseCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
205
+ onPlay?: React.ReactEventHandler<HTMLSpanElement> | undefined;
206
+ onPlayCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
207
+ onPlaying?: React.ReactEventHandler<HTMLSpanElement> | undefined;
208
+ onPlayingCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
209
+ onProgress?: React.ReactEventHandler<HTMLSpanElement> | undefined;
210
+ onProgressCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
211
+ onRateChange?: React.ReactEventHandler<HTMLSpanElement> | undefined;
212
+ onRateChangeCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
213
+ onSeeked?: React.ReactEventHandler<HTMLSpanElement> | undefined;
214
+ onSeekedCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
215
+ onSeeking?: React.ReactEventHandler<HTMLSpanElement> | undefined;
216
+ onSeekingCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
217
+ onStalled?: React.ReactEventHandler<HTMLSpanElement> | undefined;
218
+ onStalledCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
219
+ onSuspend?: React.ReactEventHandler<HTMLSpanElement> | undefined;
220
+ onSuspendCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
221
+ onTimeUpdate?: React.ReactEventHandler<HTMLSpanElement> | undefined;
222
+ onTimeUpdateCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
223
+ onVolumeChange?: React.ReactEventHandler<HTMLSpanElement> | undefined;
224
+ onVolumeChangeCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
225
+ onWaiting?: React.ReactEventHandler<HTMLSpanElement> | undefined;
226
+ onWaitingCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
227
+ onAuxClick?: React.MouseEventHandler<HTMLSpanElement> | undefined;
228
+ onAuxClickCapture?: React.MouseEventHandler<HTMLSpanElement> | undefined;
229
+ onClick?: React.MouseEventHandler<HTMLSpanElement> | undefined;
230
+ onClickCapture?: React.MouseEventHandler<HTMLSpanElement> | undefined;
231
+ onContextMenu?: React.MouseEventHandler<HTMLSpanElement> | undefined;
232
+ onContextMenuCapture?: React.MouseEventHandler<HTMLSpanElement> | undefined;
233
+ onDoubleClick?: React.MouseEventHandler<HTMLSpanElement> | undefined;
234
+ onDoubleClickCapture?: React.MouseEventHandler<HTMLSpanElement> | undefined;
235
+ onDrag?: React.DragEventHandler<HTMLSpanElement> | undefined;
236
+ onDragCapture?: React.DragEventHandler<HTMLSpanElement> | undefined;
237
+ onDragEnd?: React.DragEventHandler<HTMLSpanElement> | undefined;
238
+ onDragEndCapture?: React.DragEventHandler<HTMLSpanElement> | undefined;
239
+ onDragEnter?: React.DragEventHandler<HTMLSpanElement> | undefined;
240
+ onDragEnterCapture?: React.DragEventHandler<HTMLSpanElement> | undefined;
241
+ onDragExit?: React.DragEventHandler<HTMLSpanElement> | undefined;
242
+ onDragExitCapture?: React.DragEventHandler<HTMLSpanElement> | undefined;
243
+ onDragLeave?: React.DragEventHandler<HTMLSpanElement> | undefined;
244
+ onDragLeaveCapture?: React.DragEventHandler<HTMLSpanElement> | undefined;
245
+ onDragOver?: React.DragEventHandler<HTMLSpanElement> | undefined;
246
+ onDragOverCapture?: React.DragEventHandler<HTMLSpanElement> | undefined;
247
+ onDragStart?: React.DragEventHandler<HTMLSpanElement> | undefined;
248
+ onDragStartCapture?: React.DragEventHandler<HTMLSpanElement> | undefined;
249
+ onDrop?: React.DragEventHandler<HTMLSpanElement> | undefined;
250
+ onDropCapture?: React.DragEventHandler<HTMLSpanElement> | undefined;
251
+ onMouseDown?: React.MouseEventHandler<HTMLSpanElement> | undefined;
252
+ onMouseDownCapture?: React.MouseEventHandler<HTMLSpanElement> | undefined;
253
+ onMouseEnter?: React.MouseEventHandler<HTMLSpanElement> | undefined;
254
+ onMouseLeave?: React.MouseEventHandler<HTMLSpanElement> | undefined;
255
+ onMouseMove?: React.MouseEventHandler<HTMLSpanElement> | undefined;
256
+ onMouseMoveCapture?: React.MouseEventHandler<HTMLSpanElement> | undefined;
257
+ onMouseOut?: React.MouseEventHandler<HTMLSpanElement> | undefined;
258
+ onMouseOutCapture?: React.MouseEventHandler<HTMLSpanElement> | undefined;
259
+ onMouseOver?: React.MouseEventHandler<HTMLSpanElement> | undefined;
260
+ onMouseOverCapture?: React.MouseEventHandler<HTMLSpanElement> | undefined;
261
+ onMouseUp?: React.MouseEventHandler<HTMLSpanElement> | undefined;
262
+ onMouseUpCapture?: React.MouseEventHandler<HTMLSpanElement> | undefined;
263
+ onSelect?: React.ReactEventHandler<HTMLSpanElement> | undefined;
264
+ onSelectCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
265
+ onTouchCancel?: React.TouchEventHandler<HTMLSpanElement> | undefined;
266
+ onTouchCancelCapture?: React.TouchEventHandler<HTMLSpanElement> | undefined;
267
+ onTouchEnd?: React.TouchEventHandler<HTMLSpanElement> | undefined;
268
+ onTouchEndCapture?: React.TouchEventHandler<HTMLSpanElement> | undefined;
269
+ onTouchMove?: React.TouchEventHandler<HTMLSpanElement> | undefined;
270
+ onTouchMoveCapture?: React.TouchEventHandler<HTMLSpanElement> | undefined;
271
+ onTouchStart?: React.TouchEventHandler<HTMLSpanElement> | undefined;
272
+ onTouchStartCapture?: React.TouchEventHandler<HTMLSpanElement> | undefined;
273
+ onPointerDown?: React.PointerEventHandler<HTMLSpanElement> | undefined;
274
+ onPointerDownCapture?: React.PointerEventHandler<HTMLSpanElement> | undefined;
275
+ onPointerMove?: React.PointerEventHandler<HTMLSpanElement> | undefined;
276
+ onPointerMoveCapture?: React.PointerEventHandler<HTMLSpanElement> | undefined;
277
+ onPointerUp?: React.PointerEventHandler<HTMLSpanElement> | undefined;
278
+ onPointerUpCapture?: React.PointerEventHandler<HTMLSpanElement> | undefined;
279
+ onPointerCancel?: React.PointerEventHandler<HTMLSpanElement> | undefined;
280
+ onPointerCancelCapture?: React.PointerEventHandler<HTMLSpanElement> | undefined;
281
+ onPointerEnter?: React.PointerEventHandler<HTMLSpanElement> | undefined;
282
+ onPointerEnterCapture?: React.PointerEventHandler<HTMLSpanElement> | undefined;
283
+ onPointerLeave?: React.PointerEventHandler<HTMLSpanElement> | undefined;
284
+ onPointerLeaveCapture?: React.PointerEventHandler<HTMLSpanElement> | undefined;
285
+ onPointerOver?: React.PointerEventHandler<HTMLSpanElement> | undefined;
286
+ onPointerOverCapture?: React.PointerEventHandler<HTMLSpanElement> | undefined;
287
+ onPointerOut?: React.PointerEventHandler<HTMLSpanElement> | undefined;
288
+ onPointerOutCapture?: React.PointerEventHandler<HTMLSpanElement> | undefined;
289
+ onGotPointerCapture?: React.PointerEventHandler<HTMLSpanElement> | undefined;
290
+ onGotPointerCaptureCapture?: React.PointerEventHandler<HTMLSpanElement> | undefined;
291
+ onLostPointerCapture?: React.PointerEventHandler<HTMLSpanElement> | undefined;
292
+ onLostPointerCaptureCapture?: React.PointerEventHandler<HTMLSpanElement> | undefined;
293
+ onScroll?: React.UIEventHandler<HTMLSpanElement> | undefined;
294
+ onScrollCapture?: React.UIEventHandler<HTMLSpanElement> | undefined;
295
+ onWheel?: React.WheelEventHandler<HTMLSpanElement> | undefined;
296
+ onWheelCapture?: React.WheelEventHandler<HTMLSpanElement> | undefined;
297
+ onAnimationStart?: React.AnimationEventHandler<HTMLSpanElement> | undefined;
298
+ onAnimationStartCapture?: React.AnimationEventHandler<HTMLSpanElement> | undefined;
299
+ onAnimationEnd?: React.AnimationEventHandler<HTMLSpanElement> | undefined;
300
+ onAnimationEndCapture?: React.AnimationEventHandler<HTMLSpanElement> | undefined;
301
+ onAnimationIteration?: React.AnimationEventHandler<HTMLSpanElement> | undefined;
302
+ onAnimationIterationCapture?: React.AnimationEventHandler<HTMLSpanElement> | undefined;
303
+ onTransitionEnd?: React.TransitionEventHandler<HTMLSpanElement> | undefined;
304
+ onTransitionEndCapture?: React.TransitionEventHandler<HTMLSpanElement> | undefined;
305
+ block?: boolean | undefined;
306
+ sx?: import("@styled-system/css").SystemStyleObject | undefined;
307
+ disabled?: boolean | undefined;
308
+ variant?: "large" | "small" | undefined;
309
+ hasIcon?: boolean | undefined;
310
+ contrast?: boolean | undefined;
311
+ } & {
312
+ theme?: any;
313
+ }, "maxWidth" | "minWidth" | "width" | "theme" | "block" | "sx" | "disabled" | "variant" | "contrast"> & Omit<Pick<{
314
+ [x: string]: any;
315
+ [x: number]: any;
316
+ } & {
317
+ theme?: any;
318
+ } & {
319
+ as?: string | React.ComponentType<any> | undefined;
320
+ forwardedAs?: string | React.ComponentType<any> | undefined;
321
+ }, string | number | symbol>, "maxWidth" | "minWidth" | "width" | "theme" | "className" | "block" | "icon" | "sx" | "disabled" | "variant" | "contrast" | "inputComponent" | "wrapperRef"> & {
322
+ as?: "input" | undefined;
323
+ }, string | number | symbol> & React.RefAttributes<HTMLInputElement>>;
42
324
  export declare type TextInputWithTokensProps = ComponentProps<typeof TextInputWithTokens>;
43
325
  export default TextInputWithTokens;
@@ -13,9 +13,11 @@ import UnstyledTextInput from './_UnstyledTextInput';
13
13
  const InputWrapper = styled.div.withConfig({
14
14
  displayName: "TextInputWithTokens__InputWrapper",
15
15
  componentId: "sc-8z94t5-0"
16
- })(["order:1;flex-grow:1;"]);
16
+ })(["order:1;flex-grow:1;"]); // type AnyTokenProps = Partial<TokenProps & IssueLabelTokenProps & ProfileTokenProps>
17
+ // type TokenDatum = MandateProps<AnyTokenProps, 'id' | 'text'>
18
+
17
19
  // using forwardRef is important so that other components (ex. Autocomplete) can use the ref
18
- const TextInputWithTokensComponent = /*#__PURE__*/React.forwardRef(({
20
+ function TextInputWithTokensInnerComponent({
19
21
  icon: IconComponent,
20
22
  contrast,
21
23
  className,
@@ -27,12 +29,12 @@ const TextInputWithTokensComponent = /*#__PURE__*/React.forwardRef(({
27
29
  onTokenRemove,
28
30
  tokenComponent: TokenComponent,
29
31
  preventTokenWrapping,
30
- tokenSizeVariant,
32
+ size,
31
33
  hideTokenRemoveButtons,
32
34
  selectedTokenIdx,
33
35
  setSelectedTokenIdx,
34
36
  ...rest
35
- }, externalRef) => {
37
+ }, externalRef) {
36
38
  const ref = useProvidedRefOrCreate(externalRef);
37
39
  const {
38
40
  onFocus,
@@ -40,8 +42,8 @@ const TextInputWithTokensComponent = /*#__PURE__*/React.forwardRef(({
40
42
  ...inputPropsRest
41
43
  } = omit(rest);
42
44
 
43
- const handleTokenFocus = tokenIdx => () => {
44
- setSelectedTokenIdx(tokenIdx);
45
+ const handleTokenFocus = tokenIndex => () => {
46
+ setSelectedTokenIdx(tokenIndex);
45
47
  };
46
48
 
47
49
  const handleTokenBlur = () => {
@@ -52,7 +54,7 @@ const TextInputWithTokensComponent = /*#__PURE__*/React.forwardRef(({
52
54
  if (e.key === 'Escape') {
53
55
  var _ref$current;
54
56
 
55
- ref === null || ref === void 0 ? void 0 : (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.focus();
57
+ (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.focus();
56
58
  }
57
59
  };
58
60
 
@@ -68,7 +70,7 @@ const TextInputWithTokensComponent = /*#__PURE__*/React.forwardRef(({
68
70
  onKeyDown(e);
69
71
  }
70
72
 
71
- if (ref !== null && ref !== void 0 && (_ref$current2 = ref.current) !== null && _ref$current2 !== void 0 && _ref$current2.value) {
73
+ if ((_ref$current2 = ref.current) !== null && _ref$current2 !== void 0 && _ref$current2.value) {
72
74
  return;
73
75
  }
74
76
 
@@ -77,11 +79,11 @@ const TextInputWithTokensComponent = /*#__PURE__*/React.forwardRef(({
77
79
  if (e.key === 'Backspace' && lastToken) {
78
80
  onTokenRemove(lastToken.id);
79
81
 
80
- if (ref !== null && ref !== void 0 && ref.current) {
82
+ if (ref.current) {
81
83
  // TODO: eliminate the first hack by making changes to the Autocomplete component
82
84
  //
83
85
  // HACKS:
84
- // 1. Directly setting `ref.current.value` instead of updating state because the autocomplete
86
+ // 1. Directly setting `ref.current.value` instead of updating state because the autocomplete
85
87
  // highlight behavior doesn't work correctly if we update the value with a setState action in onChange
86
88
  // 2. Adding an extra space so that when I backspace, it doesn't delete the last letter
87
89
  ref.current.value = `${lastToken.text} `;
@@ -91,7 +93,7 @@ const TextInputWithTokensComponent = /*#__PURE__*/React.forwardRef(({
91
93
  setTimeout(() => {
92
94
  var _ref$current3;
93
95
 
94
- ref === null || ref === void 0 ? void 0 : (_ref$current3 = ref.current) === null || _ref$current3 === void 0 ? void 0 : _ref$current3.select();
96
+ (_ref$current3 = ref.current) === null || _ref$current3 === void 0 ? void 0 : _ref$current3.select();
95
97
  }, 1);
96
98
  }
97
99
  };
@@ -107,7 +109,7 @@ const TextInputWithTokensComponent = /*#__PURE__*/React.forwardRef(({
107
109
  sx: {
108
110
  height: '100%'
109
111
  }
110
- }, inputPropsRest))), tokens !== null && tokens !== void 0 && tokens.length && TokenComponent ? tokens.map(({
112
+ }, inputPropsRest))), tokens.length && TokenComponent ? tokens.map(({
111
113
  id,
112
114
  ...tokenRest
113
115
  }, i) => /*#__PURE__*/React.createElement(TokenComponent, _extends({
@@ -116,20 +118,23 @@ const TextInputWithTokensComponent = /*#__PURE__*/React.forwardRef(({
116
118
  onBlur: handleTokenBlur,
117
119
  onKeyUp: handleTokenKeyUp,
118
120
  isSelected: selectedTokenIdx === i,
119
- handleRemove: () => {
121
+ onRemove: () => {
120
122
  onTokenRemove(id);
121
123
  },
122
124
  hideRemoveButton: hideTokenRemoveButtons,
123
- variant: tokenSizeVariant,
125
+ size: size,
124
126
  tabIndex: 0
125
127
  }, tokenRest))) : null);
126
- });
127
- const TextInputWithTokens = /*#__PURE__*/React.forwardRef(({
128
+ }
129
+
130
+ const TextInputWithTokensInnerComponentWithRef = /*#__PURE__*/React.forwardRef(TextInputWithTokensInnerComponent);
131
+
132
+ function TextInputWithTokensComponent({
128
133
  tokens,
129
134
  onTokenRemove,
130
135
  sx: sxProp,
131
136
  ...props
132
- }, ref) => {
137
+ }, ref) {
133
138
  const localInputRef = useRef(null);
134
139
  const combinedInputRef = useCombinedRefs(localInputRef, ref);
135
140
  const [selectedTokenIdx, setSelectedTokenIdx] = useState();
@@ -162,7 +167,7 @@ const TextInputWithTokens = /*#__PURE__*/React.forwardRef(({
162
167
  return combinedInputRef.current || undefined;
163
168
  }
164
169
 
165
- return containerRef === null || containerRef === void 0 ? void 0 : (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.children[nextIndex];
170
+ return (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.children[nextIndex];
166
171
  }
167
172
  }, [selectedTokenIdx]);
168
173
 
@@ -172,7 +177,7 @@ const TextInputWithTokens = /*#__PURE__*/React.forwardRef(({
172
177
  if (selectedTokenIdx) {
173
178
  var _containerRef$current2;
174
179
 
175
- const nextElementToFocus = containerRef === null || containerRef === void 0 ? void 0 : (_containerRef$current2 = containerRef.current) === null || _containerRef$current2 === void 0 ? void 0 : _containerRef$current2.children[selectedTokenIdx];
180
+ const nextElementToFocus = (_containerRef$current2 = containerRef.current) === null || _containerRef$current2 === void 0 ? void 0 : _containerRef$current2.children[selectedTokenIdx];
176
181
  nextElementToFocus.focus();
177
182
  }
178
183
  };
@@ -180,17 +185,17 @@ const TextInputWithTokens = /*#__PURE__*/React.forwardRef(({
180
185
  return /*#__PURE__*/React.createElement(TextInput, _extends({
181
186
  ref: combinedInputRef,
182
187
  wrapperRef: containerRef,
183
- as: TextInputWithTokensComponent,
188
+ as: TextInputWithTokensInnerComponentWithRef,
184
189
  selectedTokenIdx: selectedTokenIdx,
185
190
  setSelectedTokenIdx: setSelectedTokenIdx,
186
191
  tokens: tokens,
187
192
  onTokenRemove: handleTokenRemove,
188
193
  sx: {
189
- 'alignItems': 'center',
190
- 'flexWrap': props.preventTokenWrapping ? 'nowrap' : 'wrap',
191
- 'gap': '0.25rem',
194
+ alignItems: 'center',
195
+ flexWrap: props.preventTokenWrapping ? 'nowrap' : 'wrap',
196
+ gap: '0.25rem',
192
197
  '> *': {
193
- 'flexShrink': 0
198
+ flexShrink: 0
194
199
  },
195
200
  ...(props.block ? {
196
201
  display: 'flex',
@@ -199,10 +204,13 @@ const TextInputWithTokens = /*#__PURE__*/React.forwardRef(({
199
204
  ...sxProp
200
205
  }
201
206
  }, props));
202
- });
207
+ }
208
+
209
+ TextInputWithTokensComponent.displayName = "TextInputWithTokensComponent";
210
+ const TextInputWithTokens = /*#__PURE__*/React.forwardRef(TextInputWithTokensComponent);
203
211
  TextInputWithTokens.defaultProps = {
204
212
  tokenComponent: Token,
205
- tokenSizeVariant: "xl",
213
+ size: 'xlarge',
206
214
  hideTokenRemoveButtons: false
207
215
  };
208
216
  TextInputWithTokens.displayName = 'TextInputWithTokens';
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { TokenBaseProps } from './TokenBase';
3
+ export interface IssueLabelTokenProps extends TokenBaseProps {
4
+ /**
5
+ * The color that corresponds to the label
6
+ */
7
+ fillColor?: string;
8
+ /**
9
+ * Whether the remove button should be rendered in the token
10
+ */
11
+ hideRemoveButton?: boolean;
12
+ }
13
+ declare const IssueLabelToken: React.ForwardRefExoticComponent<Pick<IssueLabelTokenProps, "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" | "hideRemoveButton" | "fillColor"> & React.RefAttributes<HTMLElement>>;
14
+ export default IssueLabelToken;