@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.
Files changed (90) hide show
  1. package/CHANGELOG.md +17 -1
  2. package/dist/browser.esm.js +147 -143
  3. package/dist/browser.esm.js.map +1 -1
  4. package/dist/browser.umd.js +147 -143
  5. package/dist/browser.umd.js.map +1 -1
  6. package/lib/Autocomplete/Autocomplete.d.ts +28 -28
  7. package/lib/Autocomplete/AutocompleteInput.d.ts +28 -28
  8. package/lib/Button/Button.d.ts +26 -26
  9. package/lib/Button/ButtonBase.d.ts +1 -1
  10. package/lib/Button/ButtonClose.d.ts +27 -27
  11. package/lib/Button/ButtonDanger.d.ts +26 -26
  12. package/lib/Button/ButtonInvisible.d.ts +26 -26
  13. package/lib/Button/ButtonOutline.d.ts +26 -26
  14. package/lib/Button/ButtonPrimary.d.ts +26 -26
  15. package/lib/Button/ButtonStyles.js +1 -1
  16. package/lib/CircleBadge.d.ts +2 -2
  17. package/lib/CircleOcticon.d.ts +30 -30
  18. package/lib/Dialog.d.ts +33 -33
  19. package/lib/Dropdown.d.ts +114 -114
  20. package/lib/DropdownMenu/DropdownButton.d.ts +28 -28
  21. package/lib/FilterList.d.ts +25 -25
  22. package/lib/Flash.d.ts +1 -1
  23. package/lib/Label.d.ts +1 -1
  24. package/lib/NewButton/button.d.ts +65 -65
  25. package/lib/NewButton/button.js +62 -27
  26. package/lib/NewButton/buttonStyles.d.ts +2 -0
  27. package/lib/NewButton/buttonStyles.js +14 -0
  28. package/lib/Position.d.ts +4 -4
  29. package/lib/SelectMenu/SelectMenu.d.ts +159 -159
  30. package/lib/SelectMenu/SelectMenuItem.d.ts +1 -1
  31. package/lib/SelectMenu/SelectMenuModal.d.ts +1 -1
  32. package/lib/TextInputWithTokens.d.ts +32 -28
  33. package/lib/TextInputWithTokens.js +102 -29
  34. package/lib/Timeline.d.ts +31 -31
  35. package/lib/Token/AvatarToken.d.ts +1 -1
  36. package/lib/Token/IssueLabelToken.d.ts +1 -1
  37. package/lib/Token/Token.d.ts +1 -1
  38. package/lib/Token/Token.js +13 -2
  39. package/lib/Token/TokenBase.js +0 -4
  40. package/lib/Token/_RemoveTokenButton.js +15 -2
  41. package/lib/_TextInputWrapper.js +1 -1
  42. package/lib/sx.d.ts +8 -2
  43. package/lib/theme.d.ts +78 -0
  44. package/lib/theme.js +3 -1
  45. package/lib/utils/testing.d.ts +1 -1
  46. package/lib/utils/types/KeyPaths.d.ts +3 -0
  47. package/lib/utils/types/KeyPaths.js +1 -0
  48. package/lib-esm/Autocomplete/Autocomplete.d.ts +28 -28
  49. package/lib-esm/Autocomplete/AutocompleteInput.d.ts +28 -28
  50. package/lib-esm/Button/Button.d.ts +26 -26
  51. package/lib-esm/Button/ButtonBase.d.ts +1 -1
  52. package/lib-esm/Button/ButtonClose.d.ts +27 -27
  53. package/lib-esm/Button/ButtonDanger.d.ts +26 -26
  54. package/lib-esm/Button/ButtonInvisible.d.ts +26 -26
  55. package/lib-esm/Button/ButtonOutline.d.ts +26 -26
  56. package/lib-esm/Button/ButtonPrimary.d.ts +26 -26
  57. package/lib-esm/Button/ButtonStyles.js +1 -1
  58. package/lib-esm/CircleBadge.d.ts +2 -2
  59. package/lib-esm/CircleOcticon.d.ts +30 -30
  60. package/lib-esm/Dialog.d.ts +33 -33
  61. package/lib-esm/Dropdown.d.ts +114 -114
  62. package/lib-esm/DropdownMenu/DropdownButton.d.ts +28 -28
  63. package/lib-esm/FilterList.d.ts +25 -25
  64. package/lib-esm/Flash.d.ts +1 -1
  65. package/lib-esm/Label.d.ts +1 -1
  66. package/lib-esm/NewButton/button.d.ts +65 -65
  67. package/lib-esm/NewButton/button.js +62 -27
  68. package/lib-esm/NewButton/buttonStyles.d.ts +2 -0
  69. package/lib-esm/NewButton/buttonStyles.js +3 -0
  70. package/lib-esm/Position.d.ts +4 -4
  71. package/lib-esm/SelectMenu/SelectMenu.d.ts +159 -159
  72. package/lib-esm/SelectMenu/SelectMenuItem.d.ts +1 -1
  73. package/lib-esm/SelectMenu/SelectMenuModal.d.ts +1 -1
  74. package/lib-esm/TextInputWithTokens.d.ts +32 -28
  75. package/lib-esm/TextInputWithTokens.js +101 -30
  76. package/lib-esm/Timeline.d.ts +31 -31
  77. package/lib-esm/Token/AvatarToken.d.ts +1 -1
  78. package/lib-esm/Token/IssueLabelToken.d.ts +1 -1
  79. package/lib-esm/Token/Token.d.ts +1 -1
  80. package/lib-esm/Token/Token.js +13 -2
  81. package/lib-esm/Token/TokenBase.js +0 -4
  82. package/lib-esm/Token/_RemoveTokenButton.js +11 -2
  83. package/lib-esm/_TextInputWrapper.js +1 -1
  84. package/lib-esm/sx.d.ts +8 -2
  85. package/lib-esm/theme.d.ts +78 -0
  86. package/lib-esm/theme.js +2 -1
  87. package/lib-esm/utils/testing.d.ts +1 -1
  88. package/lib-esm/utils/types/KeyPaths.d.ts +3 -0
  89. package/lib-esm/utils/types/KeyPaths.js +1 -0
  90. 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 Props = {
7
+ export declare type ButtonBaseProps = {
8
8
  caret?: boolean;
9
- variant: VariantType;
10
- size: 'small' | 'medium' | 'large';
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?: (boolean | "true" | "false") | "inherit" | undefined;
36
+ contentEditable?: "inherit" | (boolean | "false" | "true") | undefined;
33
37
  contextMenu?: string | undefined;
34
38
  dir?: string | undefined;
35
- draggable?: (boolean | "true" | "false") | undefined;
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 | "true" | "false") | undefined;
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?: "none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
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 | "true" | "false" | undefined;
67
- 'aria-autocomplete'?: "list" | "none" | "inline" | "both" | undefined;
68
- 'aria-busy'?: boolean | "true" | "false" | undefined;
69
- 'aria-checked'?: boolean | "true" | "false" | "mixed" | undefined;
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 | "time" | "true" | "false" | "page" | "step" | "location" | "date" | undefined;
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 | "true" | "false" | undefined;
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 | "true" | "false" | undefined;
83
+ 'aria-expanded'?: boolean | "false" | "true" | undefined;
81
84
  'aria-flowto'?: string | undefined;
82
- 'aria-grabbed'?: boolean | "true" | "false" | undefined;
83
- 'aria-haspopup'?: boolean | "grid" | "dialog" | "listbox" | "menu" | "tree" | "true" | "false" | undefined;
84
- 'aria-hidden'?: boolean | "true" | "false" | undefined;
85
- 'aria-invalid'?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
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 | "true" | "false" | undefined;
92
- 'aria-multiline'?: boolean | "true" | "false" | undefined;
93
- 'aria-multiselectable'?: boolean | "true" | "false" | undefined;
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 | "true" | "false" | "mixed" | undefined;
99
- 'aria-readonly'?: boolean | "true" | "false" | undefined;
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 | "true" | "false" | undefined;
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 | "true" | "false" | undefined;
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
- size: 'small' | 'medium' | 'large';
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
- iconOnly: boolean;
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" | "form" | "slot" | "style" | "title" | "theme" | "type" | "name" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "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" | "size" | "icon" | "caret" | "sx" | "value" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "iconOnly" | "variant" | "as"> & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
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?: (boolean | "true" | "false") | "inherit" | undefined;
317
+ contentEditable?: "inherit" | (boolean | "false" | "true") | undefined;
314
318
  contextMenu?: string | undefined;
315
319
  dir?: string | undefined;
316
- draggable?: (boolean | "true" | "false") | undefined;
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 | "true" | "false") | undefined;
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?: "none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
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 | "true" | "false" | undefined;
348
- 'aria-autocomplete'?: "list" | "none" | "inline" | "both" | undefined;
349
- 'aria-busy'?: boolean | "true" | "false" | undefined;
350
- 'aria-checked'?: boolean | "true" | "false" | "mixed" | undefined;
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 | "time" | "true" | "false" | "page" | "step" | "location" | "date" | undefined;
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 | "true" | "false" | undefined;
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 | "true" | "false" | undefined;
364
+ 'aria-expanded'?: boolean | "false" | "true" | undefined;
362
365
  'aria-flowto'?: string | undefined;
363
- 'aria-grabbed'?: boolean | "true" | "false" | undefined;
364
- 'aria-haspopup'?: boolean | "grid" | "dialog" | "listbox" | "menu" | "tree" | "true" | "false" | undefined;
365
- 'aria-hidden'?: boolean | "true" | "false" | undefined;
366
- 'aria-invalid'?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
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 | "true" | "false" | undefined;
373
- 'aria-multiline'?: boolean | "true" | "false" | undefined;
374
- 'aria-multiselectable'?: boolean | "true" | "false" | undefined;
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 | "true" | "false" | "mixed" | undefined;
380
- 'aria-readonly'?: boolean | "true" | "false" | undefined;
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 | "true" | "false" | undefined;
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 | "true" | "false" | undefined;
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
- size: 'small' | 'medium' | 'large';
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
- iconOnly: boolean;
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" | "form" | "slot" | "style" | "title" | "theme" | "type" | "name" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "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" | "size" | "icon" | "caret" | "sx" | "value" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "iconOnly" | "variant" | "as"> & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>> & {
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;
@@ -7,21 +7,19 @@ import { fontSize, variant as variantFn } from 'styled-system';
7
7
  import styled from 'styled-components';
8
8
  import sx from '../sx';
9
9
  import { get } from '../constants';
10
- import buttonBaseStyles from '../Button/ButtonStyles';
10
+ import buttonBaseStyles from './buttonStyles';
11
11
  import Counter from './counter';
12
12
  const sizes = variantFn({
13
13
  prop: 'size',
14
14
  variants: {
15
15
  small: {
16
- p: '4px 12px',
17
16
  fontSize: 0
18
17
  },
19
18
  medium: {
20
19
  fontSize: 1
21
20
  },
22
21
  large: {
23
- fontSize: 2,
24
- p: '10px 20px'
22
+ fontSize: 2
25
23
  }
26
24
  }
27
25
  });
@@ -29,7 +27,6 @@ const sizes = variantFn({
29
27
  const getVariantStyles = (theme, variant = 'default') => {
30
28
  const style = {
31
29
  default: `
32
- padding: 5px 16px;
33
30
  color: ${get('colors.btn.text')({
34
31
  theme
35
32
  })};
@@ -46,18 +43,18 @@ const getVariantStyles = (theme, variant = 'default') => {
46
43
  }), get('shadows.btn.insetShadow')({
47
44
  theme
48
45
  }))};
49
- &:hover {
46
+ &:hover:not([disabled]) {
50
47
  background-color: ${get('colors.btn.hoverBg')({
51
48
  theme
52
49
  })};
53
50
  }
54
51
  // focus must come before :active so that the active box shadow overrides
55
- &:focus {
52
+ &:focus:not([disabled]) {
56
53
  box-shadow: ${get('shadows.btn.focusShadow')({
57
54
  theme
58
55
  })};
59
56
  }
60
- &:active {
57
+ &:active:not([disabled]) {
61
58
  background-color: ${get('colors.btn.selectedBg')({
62
59
  theme
63
60
  })};
@@ -68,11 +65,13 @@ const getVariantStyles = (theme, variant = 'default') => {
68
65
  &:disabled {
69
66
  color: ${get('colors.primer.fg.disabled')({
70
67
  theme
68
+ })};
69
+ background-color: ${get('colors.btn.disabledBg')({
70
+ theme
71
71
  })};
72
72
  }
73
73
  `,
74
74
  primary: `
75
- padding: 5px 16px;
76
75
  color: ${get('colors.btn.primary.text')({
77
76
  theme
78
77
  })};
@@ -88,7 +87,7 @@ const getVariantStyles = (theme, variant = 'default') => {
88
87
  theme
89
88
  })};
90
89
 
91
- &:hover {
90
+ &:hover:not([disabled]) {
92
91
  color: ${get('colors.btn.primary.hoverText')({
93
92
  theme
94
93
  })};
@@ -97,13 +96,13 @@ const getVariantStyles = (theme, variant = 'default') => {
97
96
  })};
98
97
  }
99
98
  // focus must come before :active so that the active box shadow overrides
100
- &:focus {
99
+ &:focus:not([disabled]) {
101
100
  box-shadow: ${get('shadows.btn.primary.focusShadow')({
102
101
  theme
103
102
  })};
104
103
  }
105
104
 
106
- &:active {
105
+ &:active:not([disabled]) {
107
106
  background-color: ${get('colors.btn.primary.selectedBg')({
108
107
  theme
109
108
  })};
@@ -121,7 +120,6 @@ const getVariantStyles = (theme, variant = 'default') => {
121
120
  })};
122
121
  }`,
123
122
  danger: `
124
- padding: 5px 16px;
125
123
  color: ${get('colors.btn.danger.text')({
126
124
  theme
127
125
  })};
@@ -135,7 +133,7 @@ const getVariantStyles = (theme, variant = 'default') => {
135
133
  theme
136
134
  })};
137
135
 
138
- &:hover {
136
+ &:hover:not([disabled]) {
139
137
  color: ${get('colors.btn.danger.hoverText')({
140
138
  theme
141
139
  })};
@@ -150,7 +148,7 @@ const getVariantStyles = (theme, variant = 'default') => {
150
148
  })};
151
149
  }
152
150
  // focus must come before :active so that the active box shadow overrides
153
- &:focus {
151
+ &:focus:not([disabled]) {
154
152
  border-color: ${get('colors.btn.danger.focusBorder')({
155
153
  theme
156
154
  })};
@@ -159,7 +157,7 @@ const getVariantStyles = (theme, variant = 'default') => {
159
157
  })};
160
158
  }
161
159
 
162
- &:active {
160
+ &:active:not([disabled]) {
163
161
  color: ${get('colors.btn.danger.selectedText')({
164
162
  theme
165
163
  })};
@@ -187,7 +185,6 @@ const getVariantStyles = (theme, variant = 'default') => {
187
185
  }
188
186
  `,
189
187
  invisible: `
190
- padding: 6px 16px;
191
188
  color: ${get('colors.accent.fg')({
192
189
  theme
193
190
  })};
@@ -203,38 +200,71 @@ const getVariantStyles = (theme, variant = 'default') => {
203
200
  theme
204
201
  })};
205
202
  }
206
- &:focus {
203
+ &:focus:not([disabled]) {
207
204
  box-shadow: ${get('shadows.btn.focusShadow')({
208
205
  theme
209
206
  })};
210
207
  }
211
- &:hover {
208
+ &:hover:not([disabled]) {
212
209
  background-color: ${get('colors.btn.hoverBg')({
213
210
  theme
214
211
  })};
215
212
  }
216
- &:active {
213
+ &:active:not([disabled]) {
217
214
  background-color: ${get('colors.btn.selectedBg')({
218
215
  theme
219
216
  })};
220
217
  }
221
- `,
222
- block: ``
218
+ `
223
219
  };
224
220
  return style[variant];
225
221
  };
226
222
 
223
+ const getSizes = (size = 'medium', variant = 'default', iconOnly) => {
224
+ let paddingTop, paddingLeft;
225
+
226
+ switch (size) {
227
+ case 'small':
228
+ paddingTop = 3;
229
+ paddingLeft = 12;
230
+ break;
231
+
232
+ case 'large':
233
+ paddingTop = 9;
234
+ paddingLeft = 20;
235
+ break;
236
+
237
+ case 'medium':
238
+ default:
239
+ paddingTop = 5;
240
+ paddingLeft = 16;
241
+ }
242
+
243
+ if (iconOnly) {
244
+ paddingLeft = paddingTop + 2;
245
+ }
246
+
247
+ if (variant === 'invisible') {
248
+ paddingTop = paddingTop + 1;
249
+ }
250
+
251
+ return `
252
+ padding:${paddingTop}px ${paddingLeft}px;
253
+ `;
254
+ };
255
+
227
256
  const ButtonBase = styled.button.withConfig({
228
257
  displayName: "button__ButtonBase",
229
258
  componentId: "sc-15k5iqk-0"
230
- })(["", " ", " ", " ", " ", " ", ""], buttonBaseStyles, props => getVariantStyles(props.theme, props.variant), sizes, props => props.iconOnly ? `padding: 4px 6px;` : '', sx, fontSize);
259
+ })(["", " ", " ", " ", " ", " ", ""], buttonBaseStyles, props => getVariantStyles(props.theme, props.variant), props => getSizes(props.size, props.variant, props.iconOnly), sizes, sx, fontSize);
231
260
  const Button = /*#__PURE__*/forwardRef(({
232
261
  children,
233
262
  ...props
234
263
  }, forwardedRef) => {
235
264
  const {
236
265
  icon: Icon,
237
- caret
266
+ caret,
267
+ size
238
268
  } = props;
239
269
  let iconOnly = false;
240
270
 
@@ -255,17 +285,22 @@ const Button = /*#__PURE__*/forwardRef(({
255
285
  }), Icon && /*#__PURE__*/React.createElement(Box, {
256
286
  sx: iconWrapStyles,
257
287
  "aria-hidden": !iconOnly
258
- }, /*#__PURE__*/React.createElement(Icon, null)), children, caret && /*#__PURE__*/React.createElement(Box, {
288
+ }, /*#__PURE__*/React.createElement(Icon, {
289
+ size: size
290
+ })), children, caret && /*#__PURE__*/React.createElement(Box, {
259
291
  sx: {
260
292
  display: 'inline-block',
261
293
  pl: 3
262
294
  },
263
295
  "aria-hidden": true
264
- }, /*#__PURE__*/React.createElement(TriangleDownIcon, null)));
296
+ }, /*#__PURE__*/React.createElement(TriangleDownIcon, {
297
+ size: size
298
+ })));
265
299
  });
266
300
  Button.displayName = 'Button';
267
301
  Button.defaultProps = {
268
- size: 'medium'
302
+ size: 'medium',
303
+ variant: 'default'
269
304
  };
270
305
  const NewButton = Object.assign(Button, {
271
306
  Counter
@@ -0,0 +1,2 @@
1
+ declare const _default: import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<any>>;
2
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import { css } from 'styled-components';
2
+ import { get } from '../constants';
3
+ export default 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;}"], get('fontWeights.bold'), get('radii.2'));