@primer/components 0.0.0-20219293614 → 0.0.0-202192952423
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -1
- package/dist/browser.esm.js +142 -142
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +142 -142
- package/dist/browser.umd.js.map +1 -1
- package/lib/Button/ButtonStyles.js +1 -1
- package/lib/Dropdown.d.ts +4 -2
- package/lib/NewButton/button.d.ts +4 -2
- package/lib/NewButton/button.js +60 -26
- package/lib/NewButton/buttonStyles.d.ts +2 -0
- package/lib/NewButton/buttonStyles.js +14 -0
- package/lib-esm/Button/ButtonStyles.js +1 -1
- package/lib-esm/Dropdown.d.ts +4 -2
- package/lib-esm/NewButton/button.d.ts +4 -2
- package/lib-esm/NewButton/button.js +60 -26
- package/lib-esm/NewButton/buttonStyles.d.ts +2 -0
- package/lib-esm/NewButton/buttonStyles.js +3 -0
- package/package.json +1 -1
@@ -288,9 +288,10 @@ declare const Button: React.ForwardRefExoticComponent<Pick<{
|
|
288
288
|
formTarget?: string | undefined;
|
289
289
|
variant?: VariantType | undefined;
|
290
290
|
as?: string | React.ComponentClass<any, any> | React.FunctionComponent<any> | undefined;
|
291
|
+
iconOnly: boolean;
|
291
292
|
} & {
|
292
293
|
theme?: any;
|
293
|
-
}, "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" | "variant" | "as"> & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
|
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" | "variant" | "as" | "iconOnly"> & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
|
294
295
|
declare const NewButton: React.ForwardRefExoticComponent<Pick<{
|
295
296
|
color?: string | undefined;
|
296
297
|
fontSize?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
@@ -568,9 +569,10 @@ declare const NewButton: React.ForwardRefExoticComponent<Pick<{
|
|
568
569
|
formTarget?: string | undefined;
|
569
570
|
variant?: VariantType | undefined;
|
570
571
|
as?: string | React.ComponentClass<any, any> | React.FunctionComponent<any> | undefined;
|
572
|
+
iconOnly: boolean;
|
571
573
|
} & {
|
572
574
|
theme?: any;
|
573
|
-
}, "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" | "variant" | "as"> & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>> & {
|
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" | "variant" | "as" | "iconOnly"> & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>> & {
|
574
576
|
Counter: ({ count }: {
|
575
577
|
count: number;
|
576
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 '
|
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),
|
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,13 +285,17 @@ 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,
|
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,
|
296
|
+
}, /*#__PURE__*/React.createElement(TriangleDownIcon, {
|
297
|
+
size: size
|
298
|
+
})));
|
265
299
|
});
|
266
300
|
Button.displayName = 'Button';
|
267
301
|
Button.defaultProps = {
|
@@ -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'));
|