@primer/components 0.0.0-20211030164933 → 0.0.0-20211030172251
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 +2 -2
- package/dist/browser.esm.js +581 -585
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +199 -203
- package/dist/browser.umd.js.map +1 -1
- package/lib/ActionList2/Divider.d.ts +3 -2
- package/lib/ActionList2/Divider.js +10 -5
- package/lib/ActionList2/Item.js +21 -5
- package/lib/ActionList2/List.js +11 -1
- package/lib/ActionList2/MenuContext.d.ts +10 -0
- package/lib/{_InputField/InputFieldValidation.js → ActionList2/MenuContext.js} +4 -6
- package/lib/ActionList2/Selection.js +11 -0
- package/lib/ActionList2/index.d.ts +1 -2
- package/lib/ActionMenu2.d.ts +310 -0
- package/lib/ActionMenu2.js +91 -0
- package/lib/Autocomplete/AutocompleteMenu.js +13 -6
- package/lib/Checkbox.d.ts +1 -1
- package/lib/drafts.d.ts +1 -0
- package/lib/drafts.js +13 -0
- package/lib/index.d.ts +0 -3
- package/lib/index.js +0 -24
- package/lib-esm/ActionList2/Divider.d.ts +3 -2
- package/lib-esm/ActionList2/Divider.js +8 -5
- package/lib-esm/ActionList2/Item.js +19 -5
- package/lib-esm/ActionList2/List.js +9 -1
- package/lib-esm/ActionList2/MenuContext.d.ts +10 -0
- package/lib-esm/ActionList2/MenuContext.js +3 -0
- package/lib-esm/ActionList2/Selection.js +9 -0
- package/lib-esm/ActionList2/index.d.ts +1 -2
- package/lib-esm/ActionMenu2.d.ts +310 -0
- package/lib-esm/ActionMenu2.js +67 -0
- package/lib-esm/Autocomplete/AutocompleteMenu.js +13 -3
- package/lib-esm/Checkbox.d.ts +1 -1
- package/lib-esm/drafts.d.ts +1 -0
- package/lib-esm/drafts.js +2 -1
- package/lib-esm/index.d.ts +0 -3
- package/lib-esm/index.js +0 -3
- package/package.json +2 -2
- package/lib/CheckboxInputField.d.ts +0 -10
- package/lib/CheckboxInputField.js +0 -73
- package/lib/RadioInputField.d.ts +0 -8
- package/lib/RadioInputField.js +0 -82
- package/lib/TextInputField.d.ts +0 -581
- package/lib/TextInputField.js +0 -66
- package/lib/_InputCaption.d.ts +0 -13
- package/lib/_InputCaption.js +0 -26
- package/lib/_InputField/InputField.d.ts +0 -39
- package/lib/_InputField/InputField.js +0 -90
- package/lib/_InputField/InputFieldCaption.d.ts +0 -3
- package/lib/_InputField/InputFieldCaption.js +0 -30
- package/lib/_InputField/InputFieldLabel.d.ts +0 -9
- package/lib/_InputField/InputFieldLabel.js +0 -34
- package/lib/_InputField/InputFieldValidation.d.ts +0 -6
- package/lib/_InputField/ToggleInputField.d.ts +0 -13
- package/lib/_InputField/ToggleInputField.js +0 -71
- package/lib/_InputField/ToggleInputLeadingVisual.d.ts +0 -3
- package/lib/_InputField/ToggleInputLeadingVisual.js +0 -22
- package/lib/_InputField/ValidationAnimationContainer.d.ts +0 -6
- package/lib/_InputField/ValidationAnimationContainer.js +0 -48
- package/lib/_InputField/index.d.ts +0 -1
- package/lib/_InputField/index.js +0 -15
- package/lib/_InputField/slots.d.ts +0 -13
- package/lib/_InputField/slots.js +0 -17
- package/lib/_InputLabel.d.ts +0 -8
- package/lib/_InputLabel.js +0 -44
- package/lib/_InputValidation.d.ts +0 -8
- package/lib/_InputValidation.js +0 -56
- package/lib/_VisuallyHidden.d.ts +0 -6
- package/lib/_VisuallyHidden.js +0 -39
- package/lib/utils/types/FormValidationStatus.d.ts +0 -1
- package/lib/utils/types/FormValidationStatus.js +0 -1
- package/lib-esm/CheckboxInputField.d.ts +0 -10
- package/lib-esm/CheckboxInputField.js +0 -56
- package/lib-esm/RadioInputField.d.ts +0 -8
- package/lib-esm/RadioInputField.js +0 -65
- package/lib-esm/TextInputField.d.ts +0 -581
- package/lib-esm/TextInputField.js +0 -50
- package/lib-esm/_InputCaption.d.ts +0 -13
- package/lib-esm/_InputCaption.js +0 -15
- package/lib-esm/_InputField/InputField.d.ts +0 -39
- package/lib-esm/_InputField/InputField.js +0 -70
- package/lib-esm/_InputField/InputFieldCaption.d.ts +0 -3
- package/lib-esm/_InputField/InputFieldCaption.js +0 -18
- package/lib-esm/_InputField/InputFieldLabel.d.ts +0 -9
- package/lib-esm/_InputField/InputFieldLabel.js +0 -22
- package/lib-esm/_InputField/InputFieldValidation.d.ts +0 -6
- package/lib-esm/_InputField/InputFieldValidation.js +0 -7
- package/lib-esm/_InputField/ToggleInputField.d.ts +0 -13
- package/lib-esm/_InputField/ToggleInputField.js +0 -54
- package/lib-esm/_InputField/ToggleInputLeadingVisual.d.ts +0 -3
- package/lib-esm/_InputField/ToggleInputLeadingVisual.js +0 -11
- package/lib-esm/_InputField/ValidationAnimationContainer.d.ts +0 -6
- package/lib-esm/_InputField/ValidationAnimationContainer.js +0 -33
- package/lib-esm/_InputField/index.d.ts +0 -1
- package/lib-esm/_InputField/index.js +0 -1
- package/lib-esm/_InputField/slots.d.ts +0 -13
- package/lib-esm/_InputField/slots.js +0 -5
- package/lib-esm/_InputLabel.d.ts +0 -8
- package/lib-esm/_InputLabel.js +0 -32
- package/lib-esm/_InputValidation.d.ts +0 -8
- package/lib-esm/_InputValidation.js +0 -43
- package/lib-esm/_VisuallyHidden.d.ts +0 -6
- package/lib-esm/_VisuallyHidden.js +0 -26
- package/lib-esm/utils/types/FormValidationStatus.d.ts +0 -1
- package/lib-esm/utils/types/FormValidationStatus.js +0 -1
@@ -0,0 +1,310 @@
|
|
1
|
+
import { ButtonProps } from './Button';
|
2
|
+
import React from 'react';
|
3
|
+
import { OverlayProps } from './Overlay';
|
4
|
+
import { AnchoredOverlayWrapperAnchorProps } from './AnchoredOverlay/AnchoredOverlay';
|
5
|
+
declare type ActionMenuBaseProps = {
|
6
|
+
/**
|
7
|
+
* Recommended: `ActionMenu.Button` or `ActionMenu.Anchor` with ActionList`
|
8
|
+
*/
|
9
|
+
children: React.ReactElement[] | React.ReactElement;
|
10
|
+
/**
|
11
|
+
* If defined, will control the open/closed state of the overlay. Must be used in conjuction with `onOpenChange`.
|
12
|
+
*/
|
13
|
+
open?: boolean;
|
14
|
+
/**
|
15
|
+
* If defined, will control the open/closed state of the overlay. Must be used in conjuction with `open`.
|
16
|
+
*/
|
17
|
+
onOpenChange?: (s: boolean) => void;
|
18
|
+
/**
|
19
|
+
* Props to be spread on the internal `Overlay` component.
|
20
|
+
*/
|
21
|
+
overlayProps?: Partial<OverlayProps>;
|
22
|
+
};
|
23
|
+
export declare type ActionMenuProps = ActionMenuBaseProps & AnchoredOverlayWrapperAnchorProps;
|
24
|
+
export declare type MenuAnchorProps = {
|
25
|
+
children: React.ReactElement;
|
26
|
+
};
|
27
|
+
/** this component is syntactical sugar 🍭 */
|
28
|
+
export declare type MenuButtonProps = ButtonProps;
|
29
|
+
export declare const ActionMenu: React.FC<ActionMenuProps> & {
|
30
|
+
Button: React.ForwardRefExoticComponent<Pick<{
|
31
|
+
color?: string | undefined;
|
32
|
+
translate?: "yes" | "no" | undefined;
|
33
|
+
hidden?: boolean | undefined;
|
34
|
+
children?: React.ReactNode;
|
35
|
+
value?: string | number | readonly string[] | undefined;
|
36
|
+
ref?: ((instance: HTMLButtonElement | null) => void) | React.RefObject<HTMLButtonElement> | null | undefined;
|
37
|
+
form?: string | undefined;
|
38
|
+
slot?: string | undefined;
|
39
|
+
style?: React.CSSProperties | undefined;
|
40
|
+
title?: string | undefined;
|
41
|
+
variant?: "small" | "medium" | "large" | undefined;
|
42
|
+
role?: React.AriaRole | undefined;
|
43
|
+
sx?: import("./sx").BetterSystemStyleObject | undefined;
|
44
|
+
type?: "button" | "reset" | "submit" | undefined;
|
45
|
+
name?: string | undefined;
|
46
|
+
key?: React.Key | null | undefined;
|
47
|
+
defaultChecked?: boolean | undefined;
|
48
|
+
defaultValue?: string | number | readonly string[] | undefined;
|
49
|
+
suppressContentEditableWarning?: boolean | undefined;
|
50
|
+
suppressHydrationWarning?: boolean | undefined;
|
51
|
+
accessKey?: string | undefined;
|
52
|
+
className?: string | undefined;
|
53
|
+
contentEditable?: "inherit" | (boolean | "false" | "true") | undefined;
|
54
|
+
contextMenu?: string | undefined;
|
55
|
+
dir?: string | undefined;
|
56
|
+
draggable?: (boolean | "false" | "true") | undefined;
|
57
|
+
id?: string | undefined;
|
58
|
+
lang?: string | undefined;
|
59
|
+
placeholder?: string | undefined;
|
60
|
+
spellCheck?: (boolean | "false" | "true") | undefined;
|
61
|
+
tabIndex?: number | undefined;
|
62
|
+
radioGroup?: string | undefined;
|
63
|
+
about?: string | undefined;
|
64
|
+
datatype?: string | undefined;
|
65
|
+
inlist?: any;
|
66
|
+
prefix?: string | undefined;
|
67
|
+
property?: string | undefined;
|
68
|
+
resource?: string | undefined;
|
69
|
+
typeof?: string | undefined;
|
70
|
+
vocab?: string | undefined;
|
71
|
+
autoCapitalize?: string | undefined;
|
72
|
+
autoCorrect?: string | undefined;
|
73
|
+
autoSave?: string | undefined;
|
74
|
+
itemProp?: string | undefined;
|
75
|
+
itemScope?: boolean | undefined;
|
76
|
+
itemType?: string | undefined;
|
77
|
+
itemID?: string | undefined;
|
78
|
+
itemRef?: string | undefined;
|
79
|
+
results?: number | undefined;
|
80
|
+
security?: string | undefined;
|
81
|
+
unselectable?: "on" | "off" | undefined;
|
82
|
+
inputMode?: "search" | "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
83
|
+
is?: string | undefined;
|
84
|
+
'aria-activedescendant'?: string | undefined;
|
85
|
+
'aria-atomic'?: boolean | "false" | "true" | undefined;
|
86
|
+
'aria-autocomplete'?: "none" | "both" | "inline" | "list" | undefined;
|
87
|
+
'aria-busy'?: boolean | "false" | "true" | undefined;
|
88
|
+
'aria-checked'?: boolean | "mixed" | "false" | "true" | undefined;
|
89
|
+
'aria-colcount'?: number | undefined;
|
90
|
+
'aria-colindex'?: number | undefined;
|
91
|
+
'aria-colspan'?: number | undefined;
|
92
|
+
'aria-controls'?: string | undefined;
|
93
|
+
'aria-current'?: boolean | "time" | "page" | "false" | "true" | "step" | "location" | "date" | undefined;
|
94
|
+
'aria-describedby'?: string | undefined;
|
95
|
+
'aria-details'?: string | undefined;
|
96
|
+
'aria-disabled'?: boolean | "false" | "true" | undefined;
|
97
|
+
'aria-dropeffect'?: "link" | "none" | "copy" | "move" | "execute" | "popup" | undefined;
|
98
|
+
'aria-errormessage'?: string | undefined;
|
99
|
+
'aria-expanded'?: boolean | "false" | "true" | undefined;
|
100
|
+
'aria-flowto'?: string | undefined;
|
101
|
+
'aria-grabbed'?: boolean | "false" | "true" | undefined;
|
102
|
+
'aria-haspopup'?: boolean | "grid" | "dialog" | "menu" | "listbox" | "false" | "true" | "tree" | undefined;
|
103
|
+
'aria-hidden'?: boolean | "false" | "true" | undefined;
|
104
|
+
'aria-invalid'?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
|
105
|
+
'aria-keyshortcuts'?: string | undefined;
|
106
|
+
'aria-label'?: string | undefined;
|
107
|
+
'aria-labelledby'?: string | undefined;
|
108
|
+
'aria-level'?: number | undefined;
|
109
|
+
'aria-live'?: "off" | "assertive" | "polite" | undefined;
|
110
|
+
'aria-modal'?: boolean | "false" | "true" | undefined;
|
111
|
+
'aria-multiline'?: boolean | "false" | "true" | undefined;
|
112
|
+
'aria-multiselectable'?: boolean | "false" | "true" | undefined;
|
113
|
+
'aria-orientation'?: "horizontal" | "vertical" | undefined;
|
114
|
+
'aria-owns'?: string | undefined;
|
115
|
+
'aria-placeholder'?: string | undefined;
|
116
|
+
'aria-posinset'?: number | undefined;
|
117
|
+
'aria-pressed'?: boolean | "mixed" | "false" | "true" | undefined;
|
118
|
+
'aria-readonly'?: boolean | "false" | "true" | undefined;
|
119
|
+
'aria-relevant'?: "all" | "text" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
|
120
|
+
'aria-required'?: boolean | "false" | "true" | undefined;
|
121
|
+
'aria-roledescription'?: string | undefined;
|
122
|
+
'aria-rowcount'?: number | undefined;
|
123
|
+
'aria-rowindex'?: number | undefined;
|
124
|
+
'aria-rowspan'?: number | undefined;
|
125
|
+
'aria-selected'?: boolean | "false" | "true" | undefined;
|
126
|
+
'aria-setsize'?: number | undefined;
|
127
|
+
'aria-sort'?: "none" | "ascending" | "descending" | "other" | undefined;
|
128
|
+
'aria-valuemax'?: number | undefined;
|
129
|
+
'aria-valuemin'?: number | undefined;
|
130
|
+
'aria-valuenow'?: number | undefined;
|
131
|
+
'aria-valuetext'?: string | undefined;
|
132
|
+
dangerouslySetInnerHTML?: {
|
133
|
+
__html: string;
|
134
|
+
} | undefined;
|
135
|
+
onCopy?: React.ClipboardEventHandler<HTMLButtonElement> | undefined;
|
136
|
+
onCopyCapture?: React.ClipboardEventHandler<HTMLButtonElement> | undefined;
|
137
|
+
onCut?: React.ClipboardEventHandler<HTMLButtonElement> | undefined;
|
138
|
+
onCutCapture?: React.ClipboardEventHandler<HTMLButtonElement> | undefined;
|
139
|
+
onPaste?: React.ClipboardEventHandler<HTMLButtonElement> | undefined;
|
140
|
+
onPasteCapture?: React.ClipboardEventHandler<HTMLButtonElement> | undefined;
|
141
|
+
onCompositionEnd?: React.CompositionEventHandler<HTMLButtonElement> | undefined;
|
142
|
+
onCompositionEndCapture?: React.CompositionEventHandler<HTMLButtonElement> | undefined;
|
143
|
+
onCompositionStart?: React.CompositionEventHandler<HTMLButtonElement> | undefined;
|
144
|
+
onCompositionStartCapture?: React.CompositionEventHandler<HTMLButtonElement> | undefined;
|
145
|
+
onCompositionUpdate?: React.CompositionEventHandler<HTMLButtonElement> | undefined;
|
146
|
+
onCompositionUpdateCapture?: React.CompositionEventHandler<HTMLButtonElement> | undefined;
|
147
|
+
onFocus?: React.FocusEventHandler<HTMLButtonElement> | undefined;
|
148
|
+
onFocusCapture?: React.FocusEventHandler<HTMLButtonElement> | undefined;
|
149
|
+
onBlur?: React.FocusEventHandler<HTMLButtonElement> | undefined;
|
150
|
+
onBlurCapture?: React.FocusEventHandler<HTMLButtonElement> | undefined;
|
151
|
+
onChange?: React.FormEventHandler<HTMLButtonElement> | undefined;
|
152
|
+
onChangeCapture?: React.FormEventHandler<HTMLButtonElement> | undefined;
|
153
|
+
onBeforeInput?: React.FormEventHandler<HTMLButtonElement> | undefined;
|
154
|
+
onBeforeInputCapture?: React.FormEventHandler<HTMLButtonElement> | undefined;
|
155
|
+
onInput?: React.FormEventHandler<HTMLButtonElement> | undefined;
|
156
|
+
onInputCapture?: React.FormEventHandler<HTMLButtonElement> | undefined;
|
157
|
+
onReset?: React.FormEventHandler<HTMLButtonElement> | undefined;
|
158
|
+
onResetCapture?: React.FormEventHandler<HTMLButtonElement> | undefined;
|
159
|
+
onSubmit?: React.FormEventHandler<HTMLButtonElement> | undefined;
|
160
|
+
onSubmitCapture?: React.FormEventHandler<HTMLButtonElement> | undefined;
|
161
|
+
onInvalid?: React.FormEventHandler<HTMLButtonElement> | undefined;
|
162
|
+
onInvalidCapture?: React.FormEventHandler<HTMLButtonElement> | undefined;
|
163
|
+
onLoad?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
164
|
+
onLoadCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
165
|
+
onError?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
166
|
+
onErrorCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
167
|
+
onKeyDown?: React.KeyboardEventHandler<HTMLButtonElement> | undefined;
|
168
|
+
onKeyDownCapture?: React.KeyboardEventHandler<HTMLButtonElement> | undefined;
|
169
|
+
onKeyPress?: React.KeyboardEventHandler<HTMLButtonElement> | undefined;
|
170
|
+
onKeyPressCapture?: React.KeyboardEventHandler<HTMLButtonElement> | undefined;
|
171
|
+
onKeyUp?: React.KeyboardEventHandler<HTMLButtonElement> | undefined;
|
172
|
+
onKeyUpCapture?: React.KeyboardEventHandler<HTMLButtonElement> | undefined;
|
173
|
+
onAbort?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
174
|
+
onAbortCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
175
|
+
onCanPlay?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
176
|
+
onCanPlayCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
177
|
+
onCanPlayThrough?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
178
|
+
onCanPlayThroughCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
179
|
+
onDurationChange?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
180
|
+
onDurationChangeCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
181
|
+
onEmptied?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
182
|
+
onEmptiedCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
183
|
+
onEncrypted?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
184
|
+
onEncryptedCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
185
|
+
onEnded?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
186
|
+
onEndedCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
187
|
+
onLoadedData?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
188
|
+
onLoadedDataCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
189
|
+
onLoadedMetadata?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
190
|
+
onLoadedMetadataCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
191
|
+
onLoadStart?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
192
|
+
onLoadStartCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
193
|
+
onPause?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
194
|
+
onPauseCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
195
|
+
onPlay?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
196
|
+
onPlayCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
197
|
+
onPlaying?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
198
|
+
onPlayingCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
199
|
+
onProgress?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
200
|
+
onProgressCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
201
|
+
onRateChange?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
202
|
+
onRateChangeCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
203
|
+
onSeeked?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
204
|
+
onSeekedCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
205
|
+
onSeeking?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
206
|
+
onSeekingCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
207
|
+
onStalled?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
208
|
+
onStalledCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
209
|
+
onSuspend?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
210
|
+
onSuspendCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
211
|
+
onTimeUpdate?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
212
|
+
onTimeUpdateCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
213
|
+
onVolumeChange?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
214
|
+
onVolumeChangeCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
215
|
+
onWaiting?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
216
|
+
onWaitingCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
217
|
+
onAuxClick?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
218
|
+
onAuxClickCapture?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
219
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
220
|
+
onClickCapture?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
221
|
+
onContextMenu?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
222
|
+
onContextMenuCapture?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
223
|
+
onDoubleClick?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
224
|
+
onDoubleClickCapture?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
225
|
+
onDrag?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
226
|
+
onDragCapture?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
227
|
+
onDragEnd?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
228
|
+
onDragEndCapture?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
229
|
+
onDragEnter?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
230
|
+
onDragEnterCapture?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
231
|
+
onDragExit?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
232
|
+
onDragExitCapture?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
233
|
+
onDragLeave?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
234
|
+
onDragLeaveCapture?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
235
|
+
onDragOver?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
236
|
+
onDragOverCapture?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
237
|
+
onDragStart?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
238
|
+
onDragStartCapture?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
239
|
+
onDrop?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
240
|
+
onDropCapture?: React.DragEventHandler<HTMLButtonElement> | undefined;
|
241
|
+
onMouseDown?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
242
|
+
onMouseDownCapture?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
243
|
+
onMouseEnter?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
244
|
+
onMouseLeave?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
245
|
+
onMouseMove?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
246
|
+
onMouseMoveCapture?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
247
|
+
onMouseOut?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
248
|
+
onMouseOutCapture?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
249
|
+
onMouseOver?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
250
|
+
onMouseOverCapture?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
251
|
+
onMouseUp?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
252
|
+
onMouseUpCapture?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
253
|
+
onSelect?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
254
|
+
onSelectCapture?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
255
|
+
onTouchCancel?: React.TouchEventHandler<HTMLButtonElement> | undefined;
|
256
|
+
onTouchCancelCapture?: React.TouchEventHandler<HTMLButtonElement> | undefined;
|
257
|
+
onTouchEnd?: React.TouchEventHandler<HTMLButtonElement> | undefined;
|
258
|
+
onTouchEndCapture?: React.TouchEventHandler<HTMLButtonElement> | undefined;
|
259
|
+
onTouchMove?: React.TouchEventHandler<HTMLButtonElement> | undefined;
|
260
|
+
onTouchMoveCapture?: React.TouchEventHandler<HTMLButtonElement> | undefined;
|
261
|
+
onTouchStart?: React.TouchEventHandler<HTMLButtonElement> | undefined;
|
262
|
+
onTouchStartCapture?: React.TouchEventHandler<HTMLButtonElement> | undefined;
|
263
|
+
onPointerDown?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
264
|
+
onPointerDownCapture?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
265
|
+
onPointerMove?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
266
|
+
onPointerMoveCapture?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
267
|
+
onPointerUp?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
268
|
+
onPointerUpCapture?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
269
|
+
onPointerCancel?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
270
|
+
onPointerCancelCapture?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
271
|
+
onPointerEnter?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
272
|
+
onPointerEnterCapture?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
273
|
+
onPointerLeave?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
274
|
+
onPointerLeaveCapture?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
275
|
+
onPointerOver?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
276
|
+
onPointerOverCapture?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
277
|
+
onPointerOut?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
278
|
+
onPointerOutCapture?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
279
|
+
onGotPointerCapture?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
280
|
+
onGotPointerCaptureCapture?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
281
|
+
onLostPointerCapture?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
282
|
+
onLostPointerCaptureCapture?: React.PointerEventHandler<HTMLButtonElement> | undefined;
|
283
|
+
onScroll?: React.UIEventHandler<HTMLButtonElement> | undefined;
|
284
|
+
onScrollCapture?: React.UIEventHandler<HTMLButtonElement> | undefined;
|
285
|
+
onWheel?: React.WheelEventHandler<HTMLButtonElement> | undefined;
|
286
|
+
onWheelCapture?: React.WheelEventHandler<HTMLButtonElement> | undefined;
|
287
|
+
onAnimationStart?: React.AnimationEventHandler<HTMLButtonElement> | undefined;
|
288
|
+
onAnimationStartCapture?: React.AnimationEventHandler<HTMLButtonElement> | undefined;
|
289
|
+
onAnimationEnd?: React.AnimationEventHandler<HTMLButtonElement> | undefined;
|
290
|
+
onAnimationEndCapture?: React.AnimationEventHandler<HTMLButtonElement> | undefined;
|
291
|
+
onAnimationIteration?: React.AnimationEventHandler<HTMLButtonElement> | undefined;
|
292
|
+
onAnimationIterationCapture?: React.AnimationEventHandler<HTMLButtonElement> | undefined;
|
293
|
+
onTransitionEnd?: React.TransitionEventHandler<HTMLButtonElement> | undefined;
|
294
|
+
onTransitionEndCapture?: React.TransitionEventHandler<HTMLButtonElement> | undefined;
|
295
|
+
css?: import("@emotion/core").InterpolationWithTheme<any>;
|
296
|
+
as?: string | React.ComponentClass<any, any> | React.FunctionComponent<any> | undefined;
|
297
|
+
disabled?: boolean | undefined;
|
298
|
+
autoFocus?: boolean | undefined;
|
299
|
+
formAction?: string | undefined;
|
300
|
+
formEncType?: string | undefined;
|
301
|
+
formMethod?: string | undefined;
|
302
|
+
formNoValidate?: boolean | undefined;
|
303
|
+
formTarget?: string | undefined;
|
304
|
+
} & {
|
305
|
+
theme?: any;
|
306
|
+
}, "color" | "translate" | "hidden" | "children" | "theme" | "value" | "form" | "slot" | "style" | "title" | "variant" | "role" | "sx" | "type" | "name" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "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" | "css" | "as" | "disabled" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget"> & React.RefAttributes<React.RefObject<HTMLElement> | undefined>>;
|
307
|
+
Anchor: React.ForwardRefExoticComponent<MenuAnchorProps & React.RefAttributes<React.RefObject<HTMLElement> | undefined>>;
|
308
|
+
Divider: React.FC<import("./sx").SxProp>;
|
309
|
+
};
|
310
|
+
export {};
|
@@ -0,0 +1,67 @@
|
|
1
|
+
import Button from './Button';
|
2
|
+
import React from 'react';
|
3
|
+
import { AnchoredOverlay } from './AnchoredOverlay';
|
4
|
+
import { useProvidedStateOrCreate } from './hooks/useProvidedStateOrCreate';
|
5
|
+
import { useProvidedRefOrCreate } from './hooks';
|
6
|
+
import { Divider } from './ActionList2/Divider';
|
7
|
+
import { MenuContext as ActionListMenuContext } from './ActionList2/MenuContext';
|
8
|
+
|
9
|
+
const ActionMenuBase = ({
|
10
|
+
anchorRef: externalAnchorRef,
|
11
|
+
open,
|
12
|
+
onOpenChange,
|
13
|
+
overlayProps,
|
14
|
+
children
|
15
|
+
}) => {
|
16
|
+
const [combinedOpenState, setCombinedOpenState] = useProvidedStateOrCreate(open, onOpenChange, false);
|
17
|
+
const anchorRef = useProvidedRefOrCreate(externalAnchorRef);
|
18
|
+
const onOpen = React.useCallback(() => setCombinedOpenState(true), [setCombinedOpenState]);
|
19
|
+
const onClose = React.useCallback(() => setCombinedOpenState(false), [setCombinedOpenState]);
|
20
|
+
let renderAnchor = null;
|
21
|
+
const contents = [];
|
22
|
+
React.Children.map(children, child => {
|
23
|
+
if (child.type === MenuButton || child.type === Anchor) {
|
24
|
+
renderAnchor = anchorProps => /*#__PURE__*/React.cloneElement(child, anchorProps);
|
25
|
+
} else {
|
26
|
+
contents.push(child);
|
27
|
+
}
|
28
|
+
});
|
29
|
+
return /*#__PURE__*/React.createElement(AnchoredOverlay, {
|
30
|
+
renderAnchor: renderAnchor,
|
31
|
+
anchorRef: anchorRef,
|
32
|
+
open: combinedOpenState,
|
33
|
+
onOpen: onOpen,
|
34
|
+
onClose: onClose,
|
35
|
+
overlayProps: overlayProps
|
36
|
+
}, /*#__PURE__*/React.createElement(ActionListMenuContext.Provider, {
|
37
|
+
value: {
|
38
|
+
parent: 'ActionMenu',
|
39
|
+
listRole: 'menu',
|
40
|
+
itemRole: 'menuitem',
|
41
|
+
afterSelect: onClose
|
42
|
+
}
|
43
|
+
}, contents));
|
44
|
+
};
|
45
|
+
|
46
|
+
ActionMenuBase.displayName = "ActionMenuBase";
|
47
|
+
const Anchor = /*#__PURE__*/React.forwardRef(({
|
48
|
+
children,
|
49
|
+
...anchorProps
|
50
|
+
}, anchorRef) => {
|
51
|
+
return /*#__PURE__*/React.cloneElement(children, { ...anchorProps,
|
52
|
+
ref: anchorRef
|
53
|
+
});
|
54
|
+
});
|
55
|
+
/** this component is syntactical sugar 🍭 */
|
56
|
+
|
57
|
+
const MenuButton = /*#__PURE__*/React.forwardRef((props, anchorRef) => {
|
58
|
+
return /*#__PURE__*/React.createElement(Anchor, {
|
59
|
+
ref: anchorRef
|
60
|
+
}, /*#__PURE__*/React.createElement(Button, props));
|
61
|
+
});
|
62
|
+
ActionMenuBase.displayName = 'ActionMenu';
|
63
|
+
export const ActionMenu = Object.assign(ActionMenuBase, {
|
64
|
+
Button: MenuButton,
|
65
|
+
Anchor,
|
66
|
+
Divider
|
67
|
+
});
|
@@ -6,7 +6,6 @@ import { AutocompleteContext } from './AutocompleteContext';
|
|
6
6
|
import { PlusIcon } from '@primer/octicons-react';
|
7
7
|
import { uniqueId } from '../utils/uniqueId';
|
8
8
|
import { scrollIntoViewingArea } from '../behaviors/scrollIntoViewingArea';
|
9
|
-
import VisuallyHidden from '../_VisuallyHidden';
|
10
9
|
|
11
10
|
const getDefaultSortFn = isItemSelectedFn => (itemIdA, itemIdB) => isItemSelectedFn(itemIdA) === isItemSelectedFn(itemIdB) ? 0 : isItemSelectedFn(itemIdA) ? -1 : 1;
|
12
11
|
|
@@ -165,8 +164,19 @@ function AutocompleteMenu(props) {
|
|
165
164
|
setSelectedItemLength(selectedItemIds.length);
|
166
165
|
}
|
167
166
|
}, [selectedItemIds, setSelectedItemLength]);
|
168
|
-
return /*#__PURE__*/React.createElement(
|
169
|
-
|
167
|
+
return /*#__PURE__*/React.createElement(Box, {
|
168
|
+
sx: !showMenu ? {
|
169
|
+
// visually hides this label for sighted users
|
170
|
+
position: 'absolute',
|
171
|
+
width: '1px',
|
172
|
+
height: '1px',
|
173
|
+
padding: '0',
|
174
|
+
margin: '-1px',
|
175
|
+
overflow: 'hidden',
|
176
|
+
clip: 'rect(0, 0, 0, 0)',
|
177
|
+
whiteSpace: 'nowrap',
|
178
|
+
borderWidth: '0'
|
179
|
+
} : {}
|
170
180
|
}, loading ? /*#__PURE__*/React.createElement(Box, {
|
171
181
|
p: 3,
|
172
182
|
display: "flex",
|
package/lib-esm/Checkbox.d.ts
CHANGED
@@ -25,5 +25,5 @@ export declare type CheckboxProps = {
|
|
25
25
|
/**
|
26
26
|
* An accessible, native checkbox component
|
27
27
|
*/
|
28
|
-
declare const Checkbox: React.ForwardRefExoticComponent<Pick<CheckboxProps, "sx" | keyof React.InputHTMLAttributes<HTMLInputElement> | "
|
28
|
+
declare const Checkbox: React.ForwardRefExoticComponent<Pick<CheckboxProps, "sx" | keyof React.InputHTMLAttributes<HTMLInputElement> | "indeterminate" | "validationStatus"> & React.RefAttributes<HTMLInputElement>>;
|
29
29
|
export default Checkbox;
|
package/lib-esm/drafts.d.ts
CHANGED
package/lib-esm/drafts.js
CHANGED
package/lib-esm/index.d.ts
CHANGED
@@ -46,7 +46,6 @@ export { default as CircleBadge } from './CircleBadge';
|
|
46
46
|
export type { CircleBadgeProps, CircleBadgeIconProps } from './CircleBadge';
|
47
47
|
export { default as CircleOcticon } from './CircleOcticon';
|
48
48
|
export type { CircleOcticonProps } from './CircleOcticon';
|
49
|
-
export { default as CheckboxInputField } from './CheckboxInputField';
|
50
49
|
export { default as CounterLabel } from './CounterLabel';
|
51
50
|
export type { CounterLabelProps } from './CounterLabel';
|
52
51
|
export { default as Details } from './Details';
|
@@ -87,7 +86,6 @@ export { default as Popover } from './Popover';
|
|
87
86
|
export type { PopoverProps, PopoverContentProps } from './Popover';
|
88
87
|
export { default as ProgressBar } from './ProgressBar';
|
89
88
|
export type { ProgressBarProps } from './ProgressBar';
|
90
|
-
export { default as RadioInputField } from './RadioInputField';
|
91
89
|
export { default as SelectMenu } from './SelectMenu';
|
92
90
|
export type { SelectMenuProps, SelectMenuDividerProps, SelectMenuFilterProps, SelectMenuFooterProps, SelectMenuItemProps, SelectMenuListProps, SelectMenuModalProps, SelectMenuTabsProps, SelectMenuHeaderProps, SelectMenuTabProps, SelectMenuTabPanelProps, SelectMenuLoadingAnimationProps } from './SelectMenu';
|
93
91
|
export { default as SideNav } from './SideNav';
|
@@ -104,7 +102,6 @@ export { default as TabNav } from './TabNav';
|
|
104
102
|
export type { TabNavProps, TabNavLinkProps } from './TabNav';
|
105
103
|
export { default as TextInput } from './TextInput';
|
106
104
|
export type { TextInputProps } from './TextInput';
|
107
|
-
export { default as TextInputField } from './TextInputField';
|
108
105
|
export { default as TextInputWithTokens } from './TextInputWithTokens';
|
109
106
|
export type { TextInputWithTokensProps } from './TextInputWithTokens';
|
110
107
|
export { default as Text } from './Text';
|
package/lib-esm/index.js
CHANGED
@@ -30,7 +30,6 @@ export { NewButton } from './NewButton';
|
|
30
30
|
export { default as Caret } from './Caret';
|
31
31
|
export { default as CircleBadge } from './CircleBadge';
|
32
32
|
export { default as CircleOcticon } from './CircleOcticon';
|
33
|
-
export { default as CheckboxInputField } from './CheckboxInputField';
|
34
33
|
export { default as CounterLabel } from './CounterLabel';
|
35
34
|
export { default as Details } from './Details';
|
36
35
|
export { default as Dialog } from './Dialog';
|
@@ -56,7 +55,6 @@ export { default as Popover } from './Popover';
|
|
56
55
|
// export {default as Portal, registerPortalRoot} from './Portal'
|
57
56
|
// export type {PortalProps} from './Portal'
|
58
57
|
export { default as ProgressBar } from './ProgressBar';
|
59
|
-
export { default as RadioInputField } from './RadioInputField';
|
60
58
|
export { default as SelectMenu } from './SelectMenu';
|
61
59
|
export { default as SideNav } from './SideNav';
|
62
60
|
export { default as Spinner } from './Spinner';
|
@@ -65,7 +63,6 @@ export { default as StyledOcticon } from './StyledOcticon';
|
|
65
63
|
export { default as SubNav } from './SubNav';
|
66
64
|
export { default as TabNav } from './TabNav';
|
67
65
|
export { default as TextInput } from './TextInput';
|
68
|
-
export { default as TextInputField } from './TextInputField';
|
69
66
|
export { default as TextInputWithTokens } from './TextInputWithTokens';
|
70
67
|
export { default as Text } from './Text';
|
71
68
|
export { default as Timeline } from './Timeline';
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@primer/components",
|
3
|
-
"version": "0.0.0-
|
3
|
+
"version": "0.0.0-20211030172251",
|
4
4
|
"description": "Primer react components",
|
5
5
|
"main": "lib/index.js",
|
6
6
|
"module": "lib-esm/index.js",
|
@@ -43,7 +43,7 @@
|
|
43
43
|
"author": "GitHub, Inc.",
|
44
44
|
"license": "MIT",
|
45
45
|
"dependencies": {
|
46
|
-
"@primer/octicons-react": "16.1.
|
46
|
+
"@primer/octicons-react": "^16.1.0",
|
47
47
|
"@primer/primitives": "7.1.1",
|
48
48
|
"@radix-ui/react-polymorphic": "0.0.14",
|
49
49
|
"@react-aria/ssr": "3.1.0",
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
declare const _default: React.FC<import("./_InputField/ToggleInputField").Props> & {
|
3
|
-
Input: React.FC<Omit<React.HTMLProps<HTMLInputElement>, "ref"> & {
|
4
|
-
ref?: React.Ref<HTMLInputElement> | undefined;
|
5
|
-
}>;
|
6
|
-
Caption: React.FC<{}>;
|
7
|
-
Label: React.FC<import("./_InputField/InputFieldLabel").Props>;
|
8
|
-
LeadingVisual: React.FC<{}>;
|
9
|
-
};
|
10
|
-
export default _default;
|
@@ -1,73 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.default = void 0;
|
7
|
-
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
9
|
-
|
10
|
-
var _ = require(".");
|
11
|
-
|
12
|
-
var _InputField = _interopRequireDefault(require("./_InputField/InputField"));
|
13
|
-
|
14
|
-
var _slots = require("./_InputField/slots");
|
15
|
-
|
16
|
-
var _ToggleInputField = _interopRequireDefault(require("./_InputField/ToggleInputField"));
|
17
|
-
|
18
|
-
var _ToggleInputLeadingVisual = _interopRequireDefault(require("./_InputField/ToggleInputLeadingVisual"));
|
19
|
-
|
20
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
21
|
-
|
22
|
-
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); }
|
23
|
-
|
24
|
-
const Input = ({
|
25
|
-
id: idProp,
|
26
|
-
required: requiredProp,
|
27
|
-
disabled: disabledProp,
|
28
|
-
...rest
|
29
|
-
}) => {
|
30
|
-
if (idProp) {
|
31
|
-
// eslint-disable-next-line no-console
|
32
|
-
console.warn("instead of passing the 'id' prop directly to <TextInputField.Input>, it should be passed to the parent component, <TextInputField>");
|
33
|
-
}
|
34
|
-
|
35
|
-
if (disabledProp) {
|
36
|
-
// eslint-disable-next-line no-console
|
37
|
-
console.warn("instead of passing the 'disabled' prop directly to <TextInputField.Input>, it should be passed to the parent component, <TextInputField>");
|
38
|
-
}
|
39
|
-
|
40
|
-
if (requiredProp) {
|
41
|
-
// eslint-disable-next-line no-console
|
42
|
-
console.warn("instead of passing the 'required' prop directly to <TextInputField.Input>, it should be passed to the parent component, <TextInputField>");
|
43
|
-
}
|
44
|
-
|
45
|
-
return /*#__PURE__*/_react.default.createElement(_slots.Slot, {
|
46
|
-
name: "Input"
|
47
|
-
}, ({
|
48
|
-
disabled,
|
49
|
-
id,
|
50
|
-
required,
|
51
|
-
captionId
|
52
|
-
}) => /*#__PURE__*/_react.default.createElement(_.Checkbox, _extends({
|
53
|
-
"aria-describedby": captionId,
|
54
|
-
id: id,
|
55
|
-
required: required,
|
56
|
-
disabled: disabled
|
57
|
-
}, rest)));
|
58
|
-
};
|
59
|
-
|
60
|
-
Input.displayName = "Input";
|
61
|
-
|
62
|
-
const CheckboxInputField = props => /*#__PURE__*/_react.default.createElement(_ToggleInputField.default, props);
|
63
|
-
|
64
|
-
CheckboxInputField.displayName = "CheckboxInputField";
|
65
|
-
|
66
|
-
var _default = Object.assign(CheckboxInputField, {
|
67
|
-
Input,
|
68
|
-
Caption: _InputField.default.Caption,
|
69
|
-
Label: _InputField.default.Label,
|
70
|
-
LeadingVisual: _ToggleInputLeadingVisual.default
|
71
|
-
});
|
72
|
-
|
73
|
-
exports.default = _default;
|
package/lib/RadioInputField.d.ts
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
declare const _default: React.FC<import("./_InputField/ToggleInputField").Props> & {
|
3
|
-
Input: React.FC<React.HTMLProps<HTMLInputElement>>;
|
4
|
-
Caption: React.FC<{}>;
|
5
|
-
Label: React.FC<import("./_InputField/InputFieldLabel").Props>;
|
6
|
-
LeadingVisual: React.FC<{}>;
|
7
|
-
};
|
8
|
-
export default _default;
|