@primer/components 0.0.0-20219283497 → 0.0.0-202192953933
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 +17 -1
- package/dist/browser.esm.js +147 -143
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +147 -143
- package/dist/browser.umd.js.map +1 -1
- package/lib/Autocomplete/Autocomplete.d.ts +28 -28
- package/lib/Autocomplete/AutocompleteInput.d.ts +28 -28
- package/lib/Button/Button.d.ts +26 -26
- package/lib/Button/ButtonBase.d.ts +1 -1
- package/lib/Button/ButtonClose.d.ts +27 -27
- package/lib/Button/ButtonDanger.d.ts +26 -26
- package/lib/Button/ButtonInvisible.d.ts +26 -26
- package/lib/Button/ButtonOutline.d.ts +26 -26
- package/lib/Button/ButtonPrimary.d.ts +26 -26
- package/lib/Button/ButtonStyles.js +1 -1
- package/lib/CircleBadge.d.ts +2 -2
- package/lib/CircleOcticon.d.ts +30 -30
- package/lib/Dialog.d.ts +33 -33
- package/lib/Dropdown.d.ts +114 -114
- package/lib/DropdownMenu/DropdownButton.d.ts +28 -28
- package/lib/FilterList.d.ts +25 -25
- package/lib/Flash.d.ts +1 -1
- package/lib/Label.d.ts +1 -1
- package/lib/NewButton/button.d.ts +65 -65
- package/lib/NewButton/button.js +62 -27
- package/lib/NewButton/buttonStyles.d.ts +2 -0
- package/lib/NewButton/buttonStyles.js +14 -0
- package/lib/Position.d.ts +4 -4
- package/lib/SelectMenu/SelectMenu.d.ts +159 -159
- package/lib/SelectMenu/SelectMenuItem.d.ts +1 -1
- package/lib/SelectMenu/SelectMenuModal.d.ts +1 -1
- package/lib/TextInputWithTokens.d.ts +32 -28
- package/lib/TextInputWithTokens.js +102 -29
- package/lib/Timeline.d.ts +31 -31
- package/lib/Token/AvatarToken.d.ts +1 -1
- package/lib/Token/IssueLabelToken.d.ts +1 -1
- package/lib/Token/Token.d.ts +1 -1
- package/lib/Token/Token.js +13 -2
- package/lib/Token/TokenBase.js +0 -4
- package/lib/Token/_RemoveTokenButton.js +15 -2
- package/lib/_TextInputWrapper.js +1 -1
- package/lib/sx.d.ts +8 -2
- package/lib/theme.d.ts +78 -0
- package/lib/theme.js +3 -1
- package/lib/utils/testing.d.ts +1 -1
- package/lib/utils/types/KeyPaths.d.ts +3 -0
- package/lib/utils/types/KeyPaths.js +1 -0
- package/lib-esm/Autocomplete/Autocomplete.d.ts +28 -28
- package/lib-esm/Autocomplete/AutocompleteInput.d.ts +28 -28
- package/lib-esm/Button/Button.d.ts +26 -26
- package/lib-esm/Button/ButtonBase.d.ts +1 -1
- package/lib-esm/Button/ButtonClose.d.ts +27 -27
- package/lib-esm/Button/ButtonDanger.d.ts +26 -26
- package/lib-esm/Button/ButtonInvisible.d.ts +26 -26
- package/lib-esm/Button/ButtonOutline.d.ts +26 -26
- package/lib-esm/Button/ButtonPrimary.d.ts +26 -26
- package/lib-esm/Button/ButtonStyles.js +1 -1
- package/lib-esm/CircleBadge.d.ts +2 -2
- package/lib-esm/CircleOcticon.d.ts +30 -30
- package/lib-esm/Dialog.d.ts +33 -33
- package/lib-esm/Dropdown.d.ts +114 -114
- package/lib-esm/DropdownMenu/DropdownButton.d.ts +28 -28
- package/lib-esm/FilterList.d.ts +25 -25
- package/lib-esm/Flash.d.ts +1 -1
- package/lib-esm/Label.d.ts +1 -1
- package/lib-esm/NewButton/button.d.ts +65 -65
- package/lib-esm/NewButton/button.js +62 -27
- package/lib-esm/NewButton/buttonStyles.d.ts +2 -0
- package/lib-esm/NewButton/buttonStyles.js +3 -0
- package/lib-esm/Position.d.ts +4 -4
- package/lib-esm/SelectMenu/SelectMenu.d.ts +159 -159
- package/lib-esm/SelectMenu/SelectMenuItem.d.ts +1 -1
- package/lib-esm/SelectMenu/SelectMenuModal.d.ts +1 -1
- package/lib-esm/TextInputWithTokens.d.ts +32 -28
- package/lib-esm/TextInputWithTokens.js +101 -30
- package/lib-esm/Timeline.d.ts +31 -31
- package/lib-esm/Token/AvatarToken.d.ts +1 -1
- package/lib-esm/Token/IssueLabelToken.d.ts +1 -1
- package/lib-esm/Token/Token.d.ts +1 -1
- package/lib-esm/Token/Token.js +13 -2
- package/lib-esm/Token/TokenBase.js +0 -4
- package/lib-esm/Token/_RemoveTokenButton.js +11 -2
- package/lib-esm/_TextInputWrapper.js +1 -1
- package/lib-esm/sx.d.ts +8 -2
- package/lib-esm/theme.d.ts +78 -0
- package/lib-esm/theme.js +2 -1
- package/lib-esm/utils/testing.d.ts +1 -1
- package/lib-esm/utils/types/KeyPaths.d.ts +3 -0
- package/lib-esm/utils/types/KeyPaths.js +1 -0
- package/package.json +2 -1
@@ -4,10 +4,10 @@ import { FontSizeProps } from 'styled-system';
|
|
4
4
|
import { SxProp } from '../sx';
|
5
5
|
import { ComponentProps } from '../utils/types';
|
6
6
|
declare type VariantType = 'default' | 'primary' | 'invisible' | 'danger';
|
7
|
-
export declare type
|
7
|
+
export declare type ButtonBaseProps = {
|
8
8
|
caret?: boolean;
|
9
|
-
variant
|
10
|
-
size
|
9
|
+
variant?: VariantType;
|
10
|
+
size?: 'small' | 'medium' | 'large';
|
11
11
|
icon?: React.FunctionComponent<IconProps>;
|
12
12
|
as?: 'button' | 'a' | 'summary' | 'input' | string | React.ReactType;
|
13
13
|
} & SxProp & FontSizeProps;
|
@@ -15,9 +15,13 @@ declare const Button: React.ForwardRefExoticComponent<Pick<{
|
|
15
15
|
color?: string | undefined;
|
16
16
|
fontSize?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
17
17
|
translate?: "yes" | "no" | undefined;
|
18
|
+
hidden?: boolean | undefined;
|
19
|
+
size?: "small" | "medium" | "large" | undefined;
|
20
|
+
style?: React.CSSProperties | undefined;
|
21
|
+
icon?: React.FunctionComponent<IconProps> | undefined;
|
22
|
+
caret?: boolean | undefined;
|
18
23
|
form?: string | undefined;
|
19
24
|
slot?: string | undefined;
|
20
|
-
style?: React.CSSProperties | undefined;
|
21
25
|
title?: string | undefined;
|
22
26
|
ref?: ((instance: HTMLButtonElement | null) => void) | React.RefObject<HTMLButtonElement> | null | undefined;
|
23
27
|
type?: "button" | "reset" | "submit" | undefined;
|
@@ -29,15 +33,14 @@ declare const Button: React.ForwardRefExoticComponent<Pick<{
|
|
29
33
|
suppressHydrationWarning?: boolean | undefined;
|
30
34
|
accessKey?: string | undefined;
|
31
35
|
className?: string | undefined;
|
32
|
-
contentEditable?:
|
36
|
+
contentEditable?: "inherit" | (boolean | "false" | "true") | undefined;
|
33
37
|
contextMenu?: string | undefined;
|
34
38
|
dir?: string | undefined;
|
35
|
-
draggable?: (boolean | "
|
36
|
-
hidden?: boolean | undefined;
|
39
|
+
draggable?: (boolean | "false" | "true") | undefined;
|
37
40
|
id?: string | undefined;
|
38
41
|
lang?: string | undefined;
|
39
42
|
placeholder?: string | undefined;
|
40
|
-
spellCheck?: (boolean | "
|
43
|
+
spellCheck?: (boolean | "false" | "true") | undefined;
|
41
44
|
tabIndex?: number | undefined;
|
42
45
|
radioGroup?: string | undefined;
|
43
46
|
role?: React.AriaRole | undefined;
|
@@ -60,50 +63,50 @@ declare const Button: React.ForwardRefExoticComponent<Pick<{
|
|
60
63
|
results?: number | undefined;
|
61
64
|
security?: string | undefined;
|
62
65
|
unselectable?: "on" | "off" | undefined;
|
63
|
-
inputMode?: "
|
66
|
+
inputMode?: "search" | "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
64
67
|
is?: string | undefined;
|
65
68
|
'aria-activedescendant'?: string | undefined;
|
66
|
-
'aria-atomic'?: boolean | "
|
67
|
-
'aria-autocomplete'?: "
|
68
|
-
'aria-busy'?: boolean | "
|
69
|
-
'aria-checked'?: boolean | "
|
69
|
+
'aria-atomic'?: boolean | "false" | "true" | undefined;
|
70
|
+
'aria-autocomplete'?: "none" | "both" | "inline" | "list" | undefined;
|
71
|
+
'aria-busy'?: boolean | "false" | "true" | undefined;
|
72
|
+
'aria-checked'?: boolean | "mixed" | "false" | "true" | undefined;
|
70
73
|
'aria-colcount'?: number | undefined;
|
71
74
|
'aria-colindex'?: number | undefined;
|
72
75
|
'aria-colspan'?: number | undefined;
|
73
76
|
'aria-controls'?: string | undefined;
|
74
|
-
'aria-current'?: boolean | "
|
77
|
+
'aria-current'?: boolean | "page" | "false" | "true" | "time" | "step" | "location" | "date" | undefined;
|
75
78
|
'aria-describedby'?: string | undefined;
|
76
79
|
'aria-details'?: string | undefined;
|
77
|
-
'aria-disabled'?: boolean | "
|
80
|
+
'aria-disabled'?: boolean | "false" | "true" | undefined;
|
78
81
|
'aria-dropeffect'?: "link" | "none" | "copy" | "move" | "execute" | "popup" | undefined;
|
79
82
|
'aria-errormessage'?: string | undefined;
|
80
|
-
'aria-expanded'?: boolean | "
|
83
|
+
'aria-expanded'?: boolean | "false" | "true" | undefined;
|
81
84
|
'aria-flowto'?: string | undefined;
|
82
|
-
'aria-grabbed'?: boolean | "
|
83
|
-
'aria-haspopup'?: boolean | "grid" | "
|
84
|
-
'aria-hidden'?: boolean | "
|
85
|
-
'aria-invalid'?: boolean | "
|
85
|
+
'aria-grabbed'?: boolean | "false" | "true" | undefined;
|
86
|
+
'aria-haspopup'?: boolean | "grid" | "listbox" | "menu" | "false" | "true" | "dialog" | "tree" | undefined;
|
87
|
+
'aria-hidden'?: boolean | "false" | "true" | undefined;
|
88
|
+
'aria-invalid'?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
|
86
89
|
'aria-keyshortcuts'?: string | undefined;
|
87
90
|
'aria-label'?: string | undefined;
|
88
91
|
'aria-labelledby'?: string | undefined;
|
89
92
|
'aria-level'?: number | undefined;
|
90
93
|
'aria-live'?: "off" | "assertive" | "polite" | undefined;
|
91
|
-
'aria-modal'?: boolean | "
|
92
|
-
'aria-multiline'?: boolean | "
|
93
|
-
'aria-multiselectable'?: boolean | "
|
94
|
+
'aria-modal'?: boolean | "false" | "true" | undefined;
|
95
|
+
'aria-multiline'?: boolean | "false" | "true" | undefined;
|
96
|
+
'aria-multiselectable'?: boolean | "false" | "true" | undefined;
|
94
97
|
'aria-orientation'?: "horizontal" | "vertical" | undefined;
|
95
98
|
'aria-owns'?: string | undefined;
|
96
99
|
'aria-placeholder'?: string | undefined;
|
97
100
|
'aria-posinset'?: number | undefined;
|
98
|
-
'aria-pressed'?: boolean | "
|
99
|
-
'aria-readonly'?: boolean | "
|
101
|
+
'aria-pressed'?: boolean | "mixed" | "false" | "true" | undefined;
|
102
|
+
'aria-readonly'?: boolean | "false" | "true" | undefined;
|
100
103
|
'aria-relevant'?: "all" | "text" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
|
101
|
-
'aria-required'?: boolean | "
|
104
|
+
'aria-required'?: boolean | "false" | "true" | undefined;
|
102
105
|
'aria-roledescription'?: string | undefined;
|
103
106
|
'aria-rowcount'?: number | undefined;
|
104
107
|
'aria-rowindex'?: number | undefined;
|
105
108
|
'aria-rowspan'?: number | undefined;
|
106
|
-
'aria-selected'?: boolean | "
|
109
|
+
'aria-selected'?: boolean | "false" | "true" | undefined;
|
107
110
|
'aria-setsize'?: number | undefined;
|
108
111
|
'aria-sort'?: "none" | "ascending" | "descending" | "other" | undefined;
|
109
112
|
'aria-valuemax'?: number | undefined;
|
@@ -274,10 +277,7 @@ declare const Button: React.ForwardRefExoticComponent<Pick<{
|
|
274
277
|
onAnimationIterationCapture?: React.AnimationEventHandler<HTMLButtonElement> | undefined;
|
275
278
|
onTransitionEnd?: React.TransitionEventHandler<HTMLButtonElement> | undefined;
|
276
279
|
onTransitionEndCapture?: React.TransitionEventHandler<HTMLButtonElement> | undefined;
|
277
|
-
|
278
|
-
icon?: React.FunctionComponent<IconProps> | undefined;
|
279
|
-
caret?: boolean | undefined;
|
280
|
-
sx?: import("@styled-system/css").SystemStyleObject | undefined;
|
280
|
+
sx?: import("../sx").BetterSystemStyleObject | undefined;
|
281
281
|
value?: string | number | readonly string[] | undefined;
|
282
282
|
autoFocus?: boolean | undefined;
|
283
283
|
disabled?: boolean | undefined;
|
@@ -286,19 +286,23 @@ declare const Button: React.ForwardRefExoticComponent<Pick<{
|
|
286
286
|
formMethod?: string | undefined;
|
287
287
|
formNoValidate?: boolean | undefined;
|
288
288
|
formTarget?: string | undefined;
|
289
|
-
|
290
|
-
variant: VariantType;
|
289
|
+
variant?: VariantType | undefined;
|
291
290
|
as?: string | React.ComponentClass<any, any> | React.FunctionComponent<any> | undefined;
|
291
|
+
iconOnly: boolean;
|
292
292
|
} & {
|
293
293
|
theme?: any;
|
294
|
-
}, "color" | "fontSize" | "translate" | "
|
294
|
+
}, "color" | "fontSize" | "translate" | "hidden" | "size" | "style" | "icon" | "caret" | "form" | "slot" | "title" | "theme" | "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" | "children" | "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" | "sx" | "value" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "variant" | "as" | "iconOnly"> & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
|
295
295
|
declare const NewButton: React.ForwardRefExoticComponent<Pick<{
|
296
296
|
color?: string | undefined;
|
297
297
|
fontSize?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
298
298
|
translate?: "yes" | "no" | undefined;
|
299
|
+
hidden?: boolean | undefined;
|
300
|
+
size?: "small" | "medium" | "large" | undefined;
|
301
|
+
style?: React.CSSProperties | undefined;
|
302
|
+
icon?: React.FunctionComponent<IconProps> | undefined;
|
303
|
+
caret?: boolean | undefined;
|
299
304
|
form?: string | undefined;
|
300
305
|
slot?: string | undefined;
|
301
|
-
style?: React.CSSProperties | undefined;
|
302
306
|
title?: string | undefined;
|
303
307
|
ref?: ((instance: HTMLButtonElement | null) => void) | React.RefObject<HTMLButtonElement> | null | undefined;
|
304
308
|
type?: "button" | "reset" | "submit" | undefined;
|
@@ -310,15 +314,14 @@ declare const NewButton: React.ForwardRefExoticComponent<Pick<{
|
|
310
314
|
suppressHydrationWarning?: boolean | undefined;
|
311
315
|
accessKey?: string | undefined;
|
312
316
|
className?: string | undefined;
|
313
|
-
contentEditable?:
|
317
|
+
contentEditable?: "inherit" | (boolean | "false" | "true") | undefined;
|
314
318
|
contextMenu?: string | undefined;
|
315
319
|
dir?: string | undefined;
|
316
|
-
draggable?: (boolean | "
|
317
|
-
hidden?: boolean | undefined;
|
320
|
+
draggable?: (boolean | "false" | "true") | undefined;
|
318
321
|
id?: string | undefined;
|
319
322
|
lang?: string | undefined;
|
320
323
|
placeholder?: string | undefined;
|
321
|
-
spellCheck?: (boolean | "
|
324
|
+
spellCheck?: (boolean | "false" | "true") | undefined;
|
322
325
|
tabIndex?: number | undefined;
|
323
326
|
radioGroup?: string | undefined;
|
324
327
|
role?: React.AriaRole | undefined;
|
@@ -341,50 +344,50 @@ declare const NewButton: React.ForwardRefExoticComponent<Pick<{
|
|
341
344
|
results?: number | undefined;
|
342
345
|
security?: string | undefined;
|
343
346
|
unselectable?: "on" | "off" | undefined;
|
344
|
-
inputMode?: "
|
347
|
+
inputMode?: "search" | "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
345
348
|
is?: string | undefined;
|
346
349
|
'aria-activedescendant'?: string | undefined;
|
347
|
-
'aria-atomic'?: boolean | "
|
348
|
-
'aria-autocomplete'?: "
|
349
|
-
'aria-busy'?: boolean | "
|
350
|
-
'aria-checked'?: boolean | "
|
350
|
+
'aria-atomic'?: boolean | "false" | "true" | undefined;
|
351
|
+
'aria-autocomplete'?: "none" | "both" | "inline" | "list" | undefined;
|
352
|
+
'aria-busy'?: boolean | "false" | "true" | undefined;
|
353
|
+
'aria-checked'?: boolean | "mixed" | "false" | "true" | undefined;
|
351
354
|
'aria-colcount'?: number | undefined;
|
352
355
|
'aria-colindex'?: number | undefined;
|
353
356
|
'aria-colspan'?: number | undefined;
|
354
357
|
'aria-controls'?: string | undefined;
|
355
|
-
'aria-current'?: boolean | "
|
358
|
+
'aria-current'?: boolean | "page" | "false" | "true" | "time" | "step" | "location" | "date" | undefined;
|
356
359
|
'aria-describedby'?: string | undefined;
|
357
360
|
'aria-details'?: string | undefined;
|
358
|
-
'aria-disabled'?: boolean | "
|
361
|
+
'aria-disabled'?: boolean | "false" | "true" | undefined;
|
359
362
|
'aria-dropeffect'?: "link" | "none" | "copy" | "move" | "execute" | "popup" | undefined;
|
360
363
|
'aria-errormessage'?: string | undefined;
|
361
|
-
'aria-expanded'?: boolean | "
|
364
|
+
'aria-expanded'?: boolean | "false" | "true" | undefined;
|
362
365
|
'aria-flowto'?: string | undefined;
|
363
|
-
'aria-grabbed'?: boolean | "
|
364
|
-
'aria-haspopup'?: boolean | "grid" | "
|
365
|
-
'aria-hidden'?: boolean | "
|
366
|
-
'aria-invalid'?: boolean | "
|
366
|
+
'aria-grabbed'?: boolean | "false" | "true" | undefined;
|
367
|
+
'aria-haspopup'?: boolean | "grid" | "listbox" | "menu" | "false" | "true" | "dialog" | "tree" | undefined;
|
368
|
+
'aria-hidden'?: boolean | "false" | "true" | undefined;
|
369
|
+
'aria-invalid'?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
|
367
370
|
'aria-keyshortcuts'?: string | undefined;
|
368
371
|
'aria-label'?: string | undefined;
|
369
372
|
'aria-labelledby'?: string | undefined;
|
370
373
|
'aria-level'?: number | undefined;
|
371
374
|
'aria-live'?: "off" | "assertive" | "polite" | undefined;
|
372
|
-
'aria-modal'?: boolean | "
|
373
|
-
'aria-multiline'?: boolean | "
|
374
|
-
'aria-multiselectable'?: boolean | "
|
375
|
+
'aria-modal'?: boolean | "false" | "true" | undefined;
|
376
|
+
'aria-multiline'?: boolean | "false" | "true" | undefined;
|
377
|
+
'aria-multiselectable'?: boolean | "false" | "true" | undefined;
|
375
378
|
'aria-orientation'?: "horizontal" | "vertical" | undefined;
|
376
379
|
'aria-owns'?: string | undefined;
|
377
380
|
'aria-placeholder'?: string | undefined;
|
378
381
|
'aria-posinset'?: number | undefined;
|
379
|
-
'aria-pressed'?: boolean | "
|
380
|
-
'aria-readonly'?: boolean | "
|
382
|
+
'aria-pressed'?: boolean | "mixed" | "false" | "true" | undefined;
|
383
|
+
'aria-readonly'?: boolean | "false" | "true" | undefined;
|
381
384
|
'aria-relevant'?: "all" | "text" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
|
382
|
-
'aria-required'?: boolean | "
|
385
|
+
'aria-required'?: boolean | "false" | "true" | undefined;
|
383
386
|
'aria-roledescription'?: string | undefined;
|
384
387
|
'aria-rowcount'?: number | undefined;
|
385
388
|
'aria-rowindex'?: number | undefined;
|
386
389
|
'aria-rowspan'?: number | undefined;
|
387
|
-
'aria-selected'?: boolean | "
|
390
|
+
'aria-selected'?: boolean | "false" | "true" | undefined;
|
388
391
|
'aria-setsize'?: number | undefined;
|
389
392
|
'aria-sort'?: "none" | "ascending" | "descending" | "other" | undefined;
|
390
393
|
'aria-valuemax'?: number | undefined;
|
@@ -555,10 +558,7 @@ declare const NewButton: React.ForwardRefExoticComponent<Pick<{
|
|
555
558
|
onAnimationIterationCapture?: React.AnimationEventHandler<HTMLButtonElement> | undefined;
|
556
559
|
onTransitionEnd?: React.TransitionEventHandler<HTMLButtonElement> | undefined;
|
557
560
|
onTransitionEndCapture?: React.TransitionEventHandler<HTMLButtonElement> | undefined;
|
558
|
-
|
559
|
-
icon?: React.FunctionComponent<IconProps> | undefined;
|
560
|
-
caret?: boolean | undefined;
|
561
|
-
sx?: import("@styled-system/css").SystemStyleObject | undefined;
|
561
|
+
sx?: import("../sx").BetterSystemStyleObject | undefined;
|
562
562
|
value?: string | number | readonly string[] | undefined;
|
563
563
|
autoFocus?: boolean | undefined;
|
564
564
|
disabled?: boolean | undefined;
|
@@ -567,12 +567,12 @@ declare const NewButton: React.ForwardRefExoticComponent<Pick<{
|
|
567
567
|
formMethod?: string | undefined;
|
568
568
|
formNoValidate?: boolean | undefined;
|
569
569
|
formTarget?: string | undefined;
|
570
|
-
|
571
|
-
variant: VariantType;
|
570
|
+
variant?: VariantType | undefined;
|
572
571
|
as?: string | React.ComponentClass<any, any> | React.FunctionComponent<any> | undefined;
|
572
|
+
iconOnly: boolean;
|
573
573
|
} & {
|
574
574
|
theme?: any;
|
575
|
-
}, "color" | "fontSize" | "translate" | "
|
575
|
+
}, "color" | "fontSize" | "translate" | "hidden" | "size" | "style" | "icon" | "caret" | "form" | "slot" | "title" | "theme" | "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" | "children" | "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" | "sx" | "value" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "variant" | "as" | "iconOnly"> & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>> & {
|
576
576
|
Counter: ({ count }: {
|
577
577
|
count: number;
|
578
578
|
}) => JSX.Element;
|
package/lib/NewButton/button.js
CHANGED
@@ -19,7 +19,7 @@ var _sx = _interopRequireDefault(require("../sx"));
|
|
19
19
|
|
20
20
|
var _constants = require("../constants");
|
21
21
|
|
22
|
-
var
|
22
|
+
var _buttonStyles = _interopRequireDefault(require("./buttonStyles"));
|
23
23
|
|
24
24
|
var _counter = _interopRequireDefault(require("./counter"));
|
25
25
|
|
@@ -35,15 +35,13 @@ const sizes = (0, _styledSystem.variant)({
|
|
35
35
|
prop: 'size',
|
36
36
|
variants: {
|
37
37
|
small: {
|
38
|
-
p: '4px 12px',
|
39
38
|
fontSize: 0
|
40
39
|
},
|
41
40
|
medium: {
|
42
41
|
fontSize: 1
|
43
42
|
},
|
44
43
|
large: {
|
45
|
-
fontSize: 2
|
46
|
-
p: '10px 20px'
|
44
|
+
fontSize: 2
|
47
45
|
}
|
48
46
|
}
|
49
47
|
});
|
@@ -51,7 +49,6 @@ const sizes = (0, _styledSystem.variant)({
|
|
51
49
|
const getVariantStyles = (theme, variant = 'default') => {
|
52
50
|
const style = {
|
53
51
|
default: `
|
54
|
-
padding: 5px 16px;
|
55
52
|
color: ${(0, _constants.get)('colors.btn.text')({
|
56
53
|
theme
|
57
54
|
})};
|
@@ -68,18 +65,18 @@ const getVariantStyles = (theme, variant = 'default') => {
|
|
68
65
|
}), (0, _constants.get)('shadows.btn.insetShadow')({
|
69
66
|
theme
|
70
67
|
}))};
|
71
|
-
&:hover {
|
68
|
+
&:hover:not([disabled]) {
|
72
69
|
background-color: ${(0, _constants.get)('colors.btn.hoverBg')({
|
73
70
|
theme
|
74
71
|
})};
|
75
72
|
}
|
76
73
|
// focus must come before :active so that the active box shadow overrides
|
77
|
-
&:focus {
|
74
|
+
&:focus:not([disabled]) {
|
78
75
|
box-shadow: ${(0, _constants.get)('shadows.btn.focusShadow')({
|
79
76
|
theme
|
80
77
|
})};
|
81
78
|
}
|
82
|
-
&:active {
|
79
|
+
&:active:not([disabled]) {
|
83
80
|
background-color: ${(0, _constants.get)('colors.btn.selectedBg')({
|
84
81
|
theme
|
85
82
|
})};
|
@@ -90,11 +87,13 @@ const getVariantStyles = (theme, variant = 'default') => {
|
|
90
87
|
&:disabled {
|
91
88
|
color: ${(0, _constants.get)('colors.primer.fg.disabled')({
|
92
89
|
theme
|
90
|
+
})};
|
91
|
+
background-color: ${(0, _constants.get)('colors.btn.disabledBg')({
|
92
|
+
theme
|
93
93
|
})};
|
94
94
|
}
|
95
95
|
`,
|
96
96
|
primary: `
|
97
|
-
padding: 5px 16px;
|
98
97
|
color: ${(0, _constants.get)('colors.btn.primary.text')({
|
99
98
|
theme
|
100
99
|
})};
|
@@ -110,7 +109,7 @@ const getVariantStyles = (theme, variant = 'default') => {
|
|
110
109
|
theme
|
111
110
|
})};
|
112
111
|
|
113
|
-
&:hover {
|
112
|
+
&:hover:not([disabled]) {
|
114
113
|
color: ${(0, _constants.get)('colors.btn.primary.hoverText')({
|
115
114
|
theme
|
116
115
|
})};
|
@@ -119,13 +118,13 @@ const getVariantStyles = (theme, variant = 'default') => {
|
|
119
118
|
})};
|
120
119
|
}
|
121
120
|
// focus must come before :active so that the active box shadow overrides
|
122
|
-
&:focus {
|
121
|
+
&:focus:not([disabled]) {
|
123
122
|
box-shadow: ${(0, _constants.get)('shadows.btn.primary.focusShadow')({
|
124
123
|
theme
|
125
124
|
})};
|
126
125
|
}
|
127
126
|
|
128
|
-
&:active {
|
127
|
+
&:active:not([disabled]) {
|
129
128
|
background-color: ${(0, _constants.get)('colors.btn.primary.selectedBg')({
|
130
129
|
theme
|
131
130
|
})};
|
@@ -143,7 +142,6 @@ const getVariantStyles = (theme, variant = 'default') => {
|
|
143
142
|
})};
|
144
143
|
}`,
|
145
144
|
danger: `
|
146
|
-
padding: 5px 16px;
|
147
145
|
color: ${(0, _constants.get)('colors.btn.danger.text')({
|
148
146
|
theme
|
149
147
|
})};
|
@@ -157,7 +155,7 @@ const getVariantStyles = (theme, variant = 'default') => {
|
|
157
155
|
theme
|
158
156
|
})};
|
159
157
|
|
160
|
-
&:hover {
|
158
|
+
&:hover:not([disabled]) {
|
161
159
|
color: ${(0, _constants.get)('colors.btn.danger.hoverText')({
|
162
160
|
theme
|
163
161
|
})};
|
@@ -172,7 +170,7 @@ const getVariantStyles = (theme, variant = 'default') => {
|
|
172
170
|
})};
|
173
171
|
}
|
174
172
|
// focus must come before :active so that the active box shadow overrides
|
175
|
-
&:focus {
|
173
|
+
&:focus:not([disabled]) {
|
176
174
|
border-color: ${(0, _constants.get)('colors.btn.danger.focusBorder')({
|
177
175
|
theme
|
178
176
|
})};
|
@@ -181,7 +179,7 @@ const getVariantStyles = (theme, variant = 'default') => {
|
|
181
179
|
})};
|
182
180
|
}
|
183
181
|
|
184
|
-
&:active {
|
182
|
+
&:active:not([disabled]) {
|
185
183
|
color: ${(0, _constants.get)('colors.btn.danger.selectedText')({
|
186
184
|
theme
|
187
185
|
})};
|
@@ -209,7 +207,6 @@ const getVariantStyles = (theme, variant = 'default') => {
|
|
209
207
|
}
|
210
208
|
`,
|
211
209
|
invisible: `
|
212
|
-
padding: 6px 16px;
|
213
210
|
color: ${(0, _constants.get)('colors.accent.fg')({
|
214
211
|
theme
|
215
212
|
})};
|
@@ -225,31 +222,63 @@ const getVariantStyles = (theme, variant = 'default') => {
|
|
225
222
|
theme
|
226
223
|
})};
|
227
224
|
}
|
228
|
-
&:focus {
|
225
|
+
&:focus:not([disabled]) {
|
229
226
|
box-shadow: ${(0, _constants.get)('shadows.btn.focusShadow')({
|
230
227
|
theme
|
231
228
|
})};
|
232
229
|
}
|
233
|
-
&:hover {
|
230
|
+
&:hover:not([disabled]) {
|
234
231
|
background-color: ${(0, _constants.get)('colors.btn.hoverBg')({
|
235
232
|
theme
|
236
233
|
})};
|
237
234
|
}
|
238
|
-
&:active {
|
235
|
+
&:active:not([disabled]) {
|
239
236
|
background-color: ${(0, _constants.get)('colors.btn.selectedBg')({
|
240
237
|
theme
|
241
238
|
})};
|
242
239
|
}
|
243
|
-
|
244
|
-
block: ``
|
240
|
+
`
|
245
241
|
};
|
246
242
|
return style[variant];
|
247
243
|
};
|
248
244
|
|
245
|
+
const getSizes = (size = 'medium', variant = 'default', iconOnly) => {
|
246
|
+
let paddingTop, paddingLeft;
|
247
|
+
|
248
|
+
switch (size) {
|
249
|
+
case 'small':
|
250
|
+
paddingTop = 3;
|
251
|
+
paddingLeft = 12;
|
252
|
+
break;
|
253
|
+
|
254
|
+
case 'large':
|
255
|
+
paddingTop = 9;
|
256
|
+
paddingLeft = 20;
|
257
|
+
break;
|
258
|
+
|
259
|
+
case 'medium':
|
260
|
+
default:
|
261
|
+
paddingTop = 5;
|
262
|
+
paddingLeft = 16;
|
263
|
+
}
|
264
|
+
|
265
|
+
if (iconOnly) {
|
266
|
+
paddingLeft = paddingTop + 2;
|
267
|
+
}
|
268
|
+
|
269
|
+
if (variant === 'invisible') {
|
270
|
+
paddingTop = paddingTop + 1;
|
271
|
+
}
|
272
|
+
|
273
|
+
return `
|
274
|
+
padding:${paddingTop}px ${paddingLeft}px;
|
275
|
+
`;
|
276
|
+
};
|
277
|
+
|
249
278
|
const ButtonBase = _styledComponents.default.button.withConfig({
|
250
279
|
displayName: "button__ButtonBase",
|
251
280
|
componentId: "sc-15k5iqk-0"
|
252
|
-
})(["", " ", " ", " ", " ", " ", ""],
|
281
|
+
})(["", " ", " ", " ", " ", " ", ""], _buttonStyles.default, props => getVariantStyles(props.theme, props.variant), props => getSizes(props.size, props.variant, props.iconOnly), sizes, _sx.default, _styledSystem.fontSize);
|
253
282
|
|
254
283
|
const Button = /*#__PURE__*/(0, _react.forwardRef)(({
|
255
284
|
children,
|
@@ -257,7 +286,8 @@ const Button = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
257
286
|
}, forwardedRef) => {
|
258
287
|
const {
|
259
288
|
icon: Icon,
|
260
|
-
caret
|
289
|
+
caret,
|
290
|
+
size
|
261
291
|
} = props;
|
262
292
|
let iconOnly = false;
|
263
293
|
|
@@ -278,17 +308,22 @@ const Button = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
278
308
|
}), Icon && /*#__PURE__*/_react.default.createElement(_Box.default, {
|
279
309
|
sx: iconWrapStyles,
|
280
310
|
"aria-hidden": !iconOnly
|
281
|
-
}, /*#__PURE__*/_react.default.createElement(Icon,
|
311
|
+
}, /*#__PURE__*/_react.default.createElement(Icon, {
|
312
|
+
size: size
|
313
|
+
})), children, caret && /*#__PURE__*/_react.default.createElement(_Box.default, {
|
282
314
|
sx: {
|
283
315
|
display: 'inline-block',
|
284
316
|
pl: 3
|
285
317
|
},
|
286
318
|
"aria-hidden": true
|
287
|
-
}, /*#__PURE__*/_react.default.createElement(_octiconsReact.TriangleDownIcon,
|
319
|
+
}, /*#__PURE__*/_react.default.createElement(_octiconsReact.TriangleDownIcon, {
|
320
|
+
size: size
|
321
|
+
})));
|
288
322
|
});
|
289
323
|
Button.displayName = 'Button';
|
290
324
|
Button.defaultProps = {
|
291
|
-
size: 'medium'
|
325
|
+
size: 'medium',
|
326
|
+
variant: 'default'
|
292
327
|
};
|
293
328
|
const NewButton = Object.assign(Button, {
|
294
329
|
Counter: _counter.default
|
@@ -0,0 +1,14 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
|
8
|
+
var _styledComponents = require("styled-components");
|
9
|
+
|
10
|
+
var _constants = require("../constants");
|
11
|
+
|
12
|
+
var _default = (0, _styledComponents.css)(["position:relative;display:inline-block;font-family:inherit;font-weight:", ";line-height:20px;white-space:nowrap;vertical-align:middle;cursor:pointer;user-select:none;border-radius:", ";appearance:none;text-decoration:none;text-align:center;&:hover{text-decoration:none;}&:focus{outline:none;}&:disabled{cursor:default;}&:disabled svg{opacity:0.6;}"], (0, _constants.get)('fontWeights.bold'), (0, _constants.get)('radii.2'));
|
13
|
+
|
14
|
+
exports.default = _default;
|