@primer/components 0.0.0-20219283497 → 0.0.0-2021929114541
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 +447 -440
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +446 -439
- package/dist/browser.umd.js.map +1 -1
- package/lib/ActionList2/Description.d.ts +6 -0
- package/lib/ActionList2/Description.js +53 -0
- package/lib/ActionList2/Divider.d.ts +5 -0
- package/lib/ActionList2/Divider.js +33 -0
- package/lib/ActionList2/Group.d.ts +11 -0
- package/lib/ActionList2/Group.js +55 -0
- package/lib/ActionList2/Header.d.ts +26 -0
- package/lib/ActionList2/Header.js +55 -0
- package/lib/ActionList2/Item.d.ts +48 -0
- package/lib/ActionList2/Item.js +204 -0
- package/lib/ActionList2/List.d.ts +26 -0
- package/lib/ActionList2/List.js +56 -0
- package/lib/ActionList2/Selection.d.ts +5 -0
- package/lib/ActionList2/Selection.js +73 -0
- package/lib/ActionList2/Visuals.d.ts +11 -0
- package/lib/ActionList2/Visuals.js +90 -0
- package/lib/ActionList2/hacks.d.ts +30 -0
- package/lib/ActionList2/hacks.js +38 -0
- package/lib/ActionList2/index.d.ts +28 -0
- package/lib/ActionList2/index.js +42 -0
- package/lib/ActionMenu.js +2 -2
- package/lib/Autocomplete/Autocomplete.d.ts +11 -11
- package/lib/Autocomplete/AutocompleteInput.d.ts +11 -11
- package/lib/Button/Button.d.ts +13 -13
- package/lib/Button/ButtonBase.d.ts +1 -1
- package/lib/Button/ButtonClose.d.ts +16 -16
- package/lib/Button/ButtonDanger.d.ts +13 -13
- package/lib/Button/ButtonInvisible.d.ts +13 -13
- package/lib/Button/ButtonOutline.d.ts +13 -13
- package/lib/Button/ButtonPrimary.d.ts +13 -13
- package/lib/Button/ButtonStyles.js +1 -1
- package/lib/CircleBadge.d.ts +2 -2
- package/lib/CircleOcticon.d.ts +19 -19
- package/lib/Dialog/Dialog.d.ts +4 -4
- package/lib/Dialog/Dialog.js +22 -12
- package/lib/Dialog.d.ts +21 -21
- package/lib/Dropdown.d.ts +141 -63
- package/lib/Dropdown.js +5 -6
- package/lib/DropdownMenu/DropdownButton.d.ts +18 -18
- package/lib/FilterList.d.ts +12 -12
- package/lib/Label.d.ts +1 -1
- package/lib/Position.d.ts +4 -4
- package/lib/ProgressBar.d.ts +1 -1
- package/lib/SelectMenu/SelectMenu.d.ts +81 -81
- package/lib/SelectMenu/SelectMenuItem.d.ts +1 -1
- package/lib/SelectMenu/SelectMenuModal.d.ts +1 -1
- package/lib/TextInputWithTokens.d.ts +15 -11
- package/lib/TextInputWithTokens.js +102 -29
- package/lib/Timeline.d.ts +19 -19
- 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.d.ts +1 -1
- package/lib/_TextInputWrapper.js +1 -1
- package/lib/constants.js +1 -3
- package/lib/experiments.d.ts +1 -0
- package/lib/experiments.js +13 -0
- package/lib/index.d.ts +0 -2
- package/lib/index.js +0 -8
- package/lib/sx.d.ts +2 -0
- package/lib/sx.js +8 -0
- package/lib/utils/create-slots.d.ts +17 -0
- package/lib/utils/create-slots.js +105 -0
- package/lib/utils/testing.d.ts +1 -1
- package/lib/utils/use-force-update.d.ts +1 -0
- package/lib/utils/use-force-update.js +19 -0
- package/lib-esm/ActionList2/Description.d.ts +6 -0
- package/lib-esm/ActionList2/Description.js +37 -0
- package/lib-esm/ActionList2/Divider.d.ts +5 -0
- package/lib-esm/ActionList2/Divider.js +21 -0
- package/lib-esm/ActionList2/Group.d.ts +11 -0
- package/lib-esm/ActionList2/Group.js +38 -0
- package/lib-esm/ActionList2/Header.d.ts +26 -0
- package/lib-esm/ActionList2/Header.js +45 -0
- package/lib-esm/ActionList2/Item.d.ts +48 -0
- package/lib-esm/ActionList2/Item.js +176 -0
- package/lib-esm/ActionList2/List.d.ts +26 -0
- package/lib-esm/ActionList2/List.js +38 -0
- package/lib-esm/ActionList2/Selection.d.ts +5 -0
- package/lib-esm/ActionList2/Selection.js +55 -0
- package/lib-esm/ActionList2/Visuals.d.ts +11 -0
- package/lib-esm/ActionList2/Visuals.js +68 -0
- package/lib-esm/ActionList2/hacks.d.ts +30 -0
- package/lib-esm/ActionList2/hacks.js +30 -0
- package/lib-esm/ActionList2/index.d.ts +28 -0
- package/lib-esm/ActionList2/index.js +29 -0
- package/lib-esm/ActionMenu.js +2 -2
- package/lib-esm/Autocomplete/Autocomplete.d.ts +11 -11
- package/lib-esm/Autocomplete/AutocompleteInput.d.ts +11 -11
- package/lib-esm/Button/Button.d.ts +13 -13
- package/lib-esm/Button/ButtonBase.d.ts +1 -1
- package/lib-esm/Button/ButtonClose.d.ts +16 -16
- package/lib-esm/Button/ButtonDanger.d.ts +13 -13
- package/lib-esm/Button/ButtonInvisible.d.ts +13 -13
- package/lib-esm/Button/ButtonOutline.d.ts +13 -13
- package/lib-esm/Button/ButtonPrimary.d.ts +13 -13
- package/lib-esm/Button/ButtonStyles.js +1 -1
- package/lib-esm/CircleBadge.d.ts +2 -2
- package/lib-esm/CircleOcticon.d.ts +19 -19
- package/lib-esm/Dialog/Dialog.d.ts +4 -4
- package/lib-esm/Dialog/Dialog.js +21 -12
- package/lib-esm/Dialog.d.ts +21 -21
- package/lib-esm/Dropdown.d.ts +141 -63
- package/lib-esm/Dropdown.js +3 -4
- package/lib-esm/DropdownMenu/DropdownButton.d.ts +18 -18
- package/lib-esm/FilterList.d.ts +12 -12
- package/lib-esm/Label.d.ts +1 -1
- package/lib-esm/Position.d.ts +4 -4
- package/lib-esm/ProgressBar.d.ts +1 -1
- package/lib-esm/SelectMenu/SelectMenu.d.ts +81 -81
- package/lib-esm/SelectMenu/SelectMenuItem.d.ts +1 -1
- package/lib-esm/SelectMenu/SelectMenuModal.d.ts +1 -1
- package/lib-esm/TextInputWithTokens.d.ts +15 -11
- package/lib-esm/TextInputWithTokens.js +101 -30
- package/lib-esm/Timeline.d.ts +19 -19
- 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.d.ts +1 -1
- package/lib-esm/_TextInputWrapper.js +1 -1
- package/lib-esm/constants.js +1 -3
- package/lib-esm/experiments.d.ts +1 -0
- package/lib-esm/experiments.js +2 -0
- package/lib-esm/index.d.ts +0 -2
- package/lib-esm/index.js +0 -1
- package/lib-esm/sx.d.ts +2 -0
- package/lib-esm/sx.js +3 -1
- package/lib-esm/utils/create-slots.d.ts +17 -0
- package/lib-esm/utils/create-slots.js +84 -0
- package/lib-esm/utils/testing.d.ts +1 -1
- package/lib-esm/utils/use-force-update.d.ts +1 -0
- package/lib-esm/utils/use-force-update.js +6 -0
- package/package.json +2 -1
- package/lib/NewButton/button.d.ts +0 -581
- package/lib/NewButton/button.js +0 -297
- package/lib/NewButton/counter.d.ts +0 -6
- package/lib/NewButton/counter.js +0 -33
- package/lib/NewButton/index.d.ts +0 -4
- package/lib/NewButton/index.js +0 -21
- package/lib-esm/NewButton/button.d.ts +0 -581
- package/lib-esm/NewButton/button.js +0 -273
- package/lib-esm/NewButton/counter.d.ts +0 -6
- package/lib-esm/NewButton/counter.js +0 -21
- package/lib-esm/NewButton/index.d.ts +0 -4
- package/lib-esm/NewButton/index.js +0 -3
@@ -3,5 +3,5 @@ import { TokenBaseProps } from './TokenBase';
|
|
3
3
|
export interface AvatarTokenProps extends TokenBaseProps {
|
4
4
|
avatarSrc: string;
|
5
5
|
}
|
6
|
-
declare const AvatarToken: React.ForwardRefExoticComponent<Pick<AvatarTokenProps, "color" | "content" | "height" | "translate" | "width" | "
|
6
|
+
declare const AvatarToken: React.ForwardRefExoticComponent<Pick<AvatarTokenProps, "sizes" | "color" | "content" | "height" | "translate" | "width" | "hidden" | "children" | "value" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "text" | "list" | "default" | "type" | "name" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "start" | "size" | "wrap" | "open" | "multiple" | "as" | "step" | "disabled" | "selected" | "max" | "media" | "method" | "min" | "target" | "crossOrigin" | "href" | "classID" | "useMap" | "wmode" | "download" | "hrefLang" | "rel" | "alt" | "coords" | "shape" | "autoPlay" | "controls" | "loop" | "mediaGroup" | "muted" | "playsInline" | "preload" | "src" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "dateTime" | "acceptCharset" | "action" | "autoComplete" | "encType" | "noValidate" | "manifest" | "allowFullScreen" | "allowTransparency" | "frameBorder" | "marginHeight" | "marginWidth" | "sandbox" | "scrolling" | "seamless" | "srcDoc" | "srcSet" | "async" | "accept" | "capture" | "checked" | "maxLength" | "minLength" | "readOnly" | "required" | "challenge" | "keyType" | "keyParams" | "htmlFor" | "integrity" | "charSet" | "httpEquiv" | "high" | "low" | "optimum" | "reversed" | "defer" | "nonce" | "scoped" | "cellPadding" | "cellSpacing" | "colSpan" | "headers" | "rowSpan" | "scope" | "cols" | "rows" | "kind" | "srcLang" | "poster" | "onRemove" | "isSelected" | "avatarSrc"> & React.RefAttributes<HTMLElement>>;
|
7
7
|
export default AvatarToken;
|
@@ -10,5 +10,5 @@ export interface IssueLabelTokenProps extends TokenBaseProps {
|
|
10
10
|
*/
|
11
11
|
hideRemoveButton?: boolean;
|
12
12
|
}
|
13
|
-
declare const IssueLabelToken: React.ForwardRefExoticComponent<Pick<IssueLabelTokenProps, "color" | "content" | "height" | "translate" | "width" | "
|
13
|
+
declare const IssueLabelToken: React.ForwardRefExoticComponent<Pick<IssueLabelTokenProps, "sizes" | "color" | "content" | "height" | "translate" | "width" | "hidden" | "children" | "value" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "text" | "list" | "default" | "type" | "name" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "start" | "size" | "wrap" | "open" | "multiple" | "as" | "step" | "disabled" | "selected" | "max" | "media" | "method" | "min" | "target" | "crossOrigin" | "href" | "classID" | "useMap" | "wmode" | "download" | "hrefLang" | "rel" | "alt" | "coords" | "shape" | "autoPlay" | "controls" | "loop" | "mediaGroup" | "muted" | "playsInline" | "preload" | "src" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "dateTime" | "acceptCharset" | "action" | "autoComplete" | "encType" | "noValidate" | "manifest" | "allowFullScreen" | "allowTransparency" | "frameBorder" | "marginHeight" | "marginWidth" | "sandbox" | "scrolling" | "seamless" | "srcDoc" | "srcSet" | "async" | "accept" | "capture" | "checked" | "maxLength" | "minLength" | "readOnly" | "required" | "challenge" | "keyType" | "keyParams" | "htmlFor" | "integrity" | "charSet" | "httpEquiv" | "high" | "low" | "optimum" | "reversed" | "defer" | "nonce" | "scoped" | "cellPadding" | "cellSpacing" | "colSpan" | "headers" | "rowSpan" | "scope" | "cols" | "rows" | "kind" | "srcLang" | "poster" | "onRemove" | "isSelected" | "hideRemoveButton" | "fillColor"> & React.RefAttributes<HTMLElement>>;
|
14
14
|
export default IssueLabelToken;
|
package/lib/Token/Token.d.ts
CHANGED
@@ -11,5 +11,5 @@ export interface TokenProps extends TokenBaseProps {
|
|
11
11
|
*/
|
12
12
|
hideRemoveButton?: boolean;
|
13
13
|
}
|
14
|
-
declare const Token: React.ForwardRefExoticComponent<Pick<TokenProps & SxProp, "color" | "content" | "height" | "translate" | "width" | "
|
14
|
+
declare const Token: React.ForwardRefExoticComponent<Pick<TokenProps & SxProp, "sizes" | "color" | "content" | "height" | "translate" | "width" | "hidden" | "children" | "value" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "text" | "list" | "default" | "type" | "name" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "start" | "size" | "wrap" | "open" | "sx" | "multiple" | "as" | "step" | "disabled" | "selected" | "max" | "media" | "method" | "min" | "target" | "crossOrigin" | "href" | "classID" | "useMap" | "wmode" | "download" | "hrefLang" | "rel" | "alt" | "coords" | "shape" | "autoPlay" | "controls" | "loop" | "mediaGroup" | "muted" | "playsInline" | "preload" | "src" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "dateTime" | "acceptCharset" | "action" | "autoComplete" | "encType" | "noValidate" | "manifest" | "allowFullScreen" | "allowTransparency" | "frameBorder" | "marginHeight" | "marginWidth" | "sandbox" | "scrolling" | "seamless" | "srcDoc" | "srcSet" | "async" | "accept" | "capture" | "checked" | "maxLength" | "minLength" | "readOnly" | "required" | "challenge" | "keyType" | "keyParams" | "htmlFor" | "integrity" | "charSet" | "httpEquiv" | "high" | "low" | "optimum" | "reversed" | "defer" | "nonce" | "scoped" | "cellPadding" | "cellSpacing" | "colSpan" | "headers" | "rowSpan" | "scope" | "cols" | "rows" | "kind" | "srcLang" | "poster" | "leadingVisual" | "onRemove" | "isSelected" | "hideRemoveButton"> & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement | HTMLSpanElement>>;
|
15
15
|
export default Token;
|
package/lib/Token/Token.js
CHANGED
@@ -39,7 +39,16 @@ const DefaultTokenStyled = (0, _styledComponents.default)(_TokenBase.default).wi
|
|
39
39
|
const LeadingVisualContainer = (0, _styledComponents.default)('span').withConfig({
|
40
40
|
displayName: "Token__LeadingVisualContainer",
|
41
41
|
componentId: "sc-1dg52pw-1"
|
42
|
-
})(["flex-shrink:0;line-height:0;"]
|
42
|
+
})(["flex-shrink:0;line-height:0;", ""], props => {
|
43
|
+
switch (props.size) {
|
44
|
+
case 'large':
|
45
|
+
case 'extralarge':
|
46
|
+
return (0, _styledComponents.css)(["margin-right:", ";"], (0, _constants.get)('space.2'));
|
47
|
+
|
48
|
+
default:
|
49
|
+
return (0, _styledComponents.css)(["margin-right:", ";"], (0, _constants.get)('space.1'));
|
50
|
+
}
|
51
|
+
});
|
43
52
|
const Token = /*#__PURE__*/(0, _react.forwardRef)((props, forwardedRef) => {
|
44
53
|
const {
|
45
54
|
as,
|
@@ -74,7 +83,9 @@ const Token = /*#__PURE__*/(0, _react.forwardRef)((props, forwardedRef) => {
|
|
74
83
|
isTokenInteractive: (0, _TokenBase.isTokenInteractive)(props)
|
75
84
|
}, !hasMultipleActionTargets ? interactiveTokenProps : {}, rest, {
|
76
85
|
ref: forwardedRef
|
77
|
-
}), LeadingVisual ? /*#__PURE__*/_react.default.createElement(LeadingVisualContainer,
|
86
|
+
}), LeadingVisual ? /*#__PURE__*/_react.default.createElement(LeadingVisualContainer, {
|
87
|
+
size: size
|
88
|
+
}, /*#__PURE__*/_react.default.createElement(LeadingVisual, null)) : null, /*#__PURE__*/_react.default.createElement(_TokenTextContainer.default, hasMultipleActionTargets ? interactiveTokenProps : {}, text), !hideRemoveButton && onRemove ? /*#__PURE__*/_react.default.createElement(_RemoveTokenButton.default, {
|
78
89
|
borderOffset: tokenBorderWidthPx,
|
79
90
|
onClick: onRemoveClick,
|
80
91
|
size: size,
|
package/lib/Token/TokenBase.js
CHANGED
@@ -38,7 +38,6 @@ const variants = (0, _styledSystem.variant)({
|
|
38
38
|
variants: {
|
39
39
|
small: {
|
40
40
|
fontSize: 0,
|
41
|
-
gap: 1,
|
42
41
|
height: tokenSizes.small,
|
43
42
|
// without setting lineHeight to match height, the "x" appears vertically mis-aligned
|
44
43
|
lineHeight: tokenSizes.small,
|
@@ -51,7 +50,6 @@ const variants = (0, _styledSystem.variant)({
|
|
51
50
|
},
|
52
51
|
medium: {
|
53
52
|
fontSize: 0,
|
54
|
-
gap: 1,
|
55
53
|
height: tokenSizes.medium,
|
56
54
|
lineHeight: tokenSizes.medium,
|
57
55
|
paddingLeft: 2,
|
@@ -61,7 +59,6 @@ const variants = (0, _styledSystem.variant)({
|
|
61
59
|
},
|
62
60
|
large: {
|
63
61
|
fontSize: 0,
|
64
|
-
gap: 2,
|
65
62
|
height: tokenSizes.large,
|
66
63
|
lineHeight: tokenSizes.large,
|
67
64
|
paddingLeft: 2,
|
@@ -71,7 +68,6 @@ const variants = (0, _styledSystem.variant)({
|
|
71
68
|
},
|
72
69
|
extralarge: {
|
73
70
|
fontSize: 1,
|
74
|
-
gap: 2,
|
75
71
|
height: tokenSizes.extralarge,
|
76
72
|
lineHeight: tokenSizes.extralarge,
|
77
73
|
paddingLeft: 3,
|
@@ -9,7 +9,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
10
10
|
var _octiconsReact = require("@primer/octicons-react");
|
11
11
|
|
12
|
-
var _styledComponents =
|
12
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
13
13
|
|
14
14
|
var _styledSystem = require("styled-system");
|
15
15
|
|
@@ -19,6 +19,10 @@ var _sx = _interopRequireDefault(require("../sx"));
|
|
19
19
|
|
20
20
|
var _TokenBase = require("./TokenBase");
|
21
21
|
|
22
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
23
|
+
|
24
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
25
|
+
|
22
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
23
27
|
|
24
28
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
@@ -50,7 +54,16 @@ const getTokenButtonIconSize = size => parseInt(_TokenBase.tokenSizes[size || _T
|
|
50
54
|
const StyledTokenButton = _styledComponents.default.span.withConfig({
|
51
55
|
displayName: "_RemoveTokenButton__StyledTokenButton",
|
52
56
|
componentId: "sc-14lvcw1-0"
|
53
|
-
})(["background-color:transparent;font-family:inherit;color:currentColor;cursor:pointer;display:inline-flex;justify-content:center;align-items:center;user-select:none;appearance:none;text-decoration:none;padding:0;transform:", ";align-self:baseline;border:0;border-radius:999px
|
57
|
+
})(["background-color:transparent;font-family:inherit;color:currentColor;cursor:pointer;display:inline-flex;justify-content:center;align-items:center;user-select:none;appearance:none;text-decoration:none;padding:0;transform:", ";align-self:baseline;border:0;border-radius:999px;", " &:hover,&:focus{background-color:", ";}&:active{background-color:", ";}", " ", ""], props => `translate(${props.borderOffset}px, -${props.borderOffset}px)`, props => {
|
58
|
+
switch (props.size) {
|
59
|
+
case 'large':
|
60
|
+
case 'extralarge':
|
61
|
+
return (0, _styledComponents.css)(["margin-left:", ";"], (0, _constants.get)('space.2'));
|
62
|
+
|
63
|
+
default:
|
64
|
+
return (0, _styledComponents.css)(["margin-left:", ";"], (0, _constants.get)('space.1'));
|
65
|
+
}
|
66
|
+
}, (0, _constants.get)('colors.neutral.muted'), (0, _constants.get)('colors.neutral.subtle'), variants, _sx.default);
|
54
67
|
|
55
68
|
const RemoveTokenButton = ({
|
56
69
|
'aria-label': ariaLabel,
|
@@ -5,6 +5,6 @@ declare const TextInputWrapper: import("styled-components").StyledComponent<"spa
|
|
5
5
|
hasIcon?: boolean | undefined;
|
6
6
|
block?: boolean | undefined;
|
7
7
|
contrast?: boolean | undefined;
|
8
|
-
variant?: "
|
8
|
+
variant?: "large" | "small" | undefined;
|
9
9
|
} & WidthProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.Width<import("styled-system").TLengthStyledSystem>> & MinWidthProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.MinWidth<import("styled-system").TLengthStyledSystem>> & MaxWidthProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.MaxWidth<import("styled-system").TLengthStyledSystem>> & SxProp, never>;
|
10
10
|
export default TextInputWrapper;
|
package/lib/_TextInputWrapper.js
CHANGED
@@ -39,7 +39,7 @@ const sizeVariants = (0, _styledSystem.variant)({
|
|
39
39
|
const TextInputWrapper = _styledComponents.default.span.withConfig({
|
40
40
|
displayName: "_TextInputWrapper__TextInputWrapper",
|
41
41
|
componentId: "sc-5vfcis-0"
|
42
|
-
})(["display:inline-flex;align-items:stretch;min-height:34px;font-size:", ";line-height:20px;color:", ";vertical-align:middle;background-repeat:no-repeat;background-position:right 8px center;border:1px solid ", ";border-radius:", ";outline:none;box-shadow:", ";", " .TextInput-icon{align-self:center;color:", ";margin:0 ", ";flex-shrink:0;}&:focus-within{border-color:", ";box-shadow:", ";}", " ", " ", " @media (min-width:", "){font-size:", ";}", " ", " ", " ", " ", ";"], (0, _constants.get)('fontSizes.1'), (0, _constants.get)('colors.fg.default'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('radii.2'), (0, _constants.get)('shadows.primer.shadow.inset'), props => {
|
42
|
+
})(["display:inline-flex;align-items:stretch;min-height:34px;font-size:", ";line-height:20px;color:", ";vertical-align:middle;background-repeat:no-repeat;background-position:right 8px center;border:1px solid ", ";border-radius:", ";outline:none;box-shadow:", ";cursor:text;", " .TextInput-icon{align-self:center;color:", ";margin:0 ", ";flex-shrink:0;}&:focus-within{border-color:", ";box-shadow:", ";}", " ", " ", " @media (min-width:", "){font-size:", ";}", " ", " ", " ", " ", ";"], (0, _constants.get)('fontSizes.1'), (0, _constants.get)('colors.fg.default'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('radii.2'), (0, _constants.get)('shadows.primer.shadow.inset'), props => {
|
43
43
|
if (props.hasIcon) {
|
44
44
|
return (0, _styledComponents.css)(["padding:0;"]);
|
45
45
|
} else {
|
package/lib/constants.js
CHANGED
@@ -24,9 +24,7 @@ const {
|
|
24
24
|
system
|
25
25
|
} = styledSystem;
|
26
26
|
|
27
|
-
const get = key =>
|
28
|
-
return (0, _themeGet.themeGet)(key, getKey(_theme.default, key));
|
29
|
-
}; // Common props
|
27
|
+
const get = key => (0, _themeGet.themeGet)(key, getKey(_theme.default, key)); // Common props
|
30
28
|
|
31
29
|
|
32
30
|
exports.get = get;
|
@@ -0,0 +1 @@
|
|
1
|
+
export { ActionList } from './ActionList2';
|
@@ -0,0 +1,13 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
Object.defineProperty(exports, "ActionList", {
|
7
|
+
enumerable: true,
|
8
|
+
get: function () {
|
9
|
+
return _ActionList.ActionList;
|
10
|
+
}
|
11
|
+
});
|
12
|
+
|
13
|
+
var _ActionList = require("./ActionList2");
|
package/lib/index.d.ts
CHANGED
@@ -37,8 +37,6 @@ export type { BranchNameProps } from './BranchName';
|
|
37
37
|
export { default as Breadcrumbs, Breadcrumb } from './Breadcrumbs';
|
38
38
|
export type { BreadcrumbsProps, BreadcrumbsItemProps, BreadcrumbProps, BreadcrumbItemProps } from './Breadcrumbs';
|
39
39
|
export { default as Button, ButtonDanger, ButtonOutline, ButtonPrimary, ButtonInvisible, ButtonTableList, ButtonClose, ButtonGroup } from './Button';
|
40
|
-
export { default as NewButton } from './NewButton';
|
41
|
-
export type { ButtonProps as NewButtonProps } from './NewButton';
|
42
40
|
export type { ButtonProps, ButtonDangerProps, ButtonOutlineProps, ButtonPrimaryProps, ButtonInvisibleProps, ButtonTableListProps, ButtonCloseProps, ButtonGroupProps } from './Button';
|
43
41
|
export { default as Caret } from './Caret';
|
44
42
|
export type { CaretProps } from './Caret';
|
package/lib/index.js
CHANGED
@@ -243,12 +243,6 @@ Object.defineProperty(exports, "ButtonGroup", {
|
|
243
243
|
return _Button.ButtonGroup;
|
244
244
|
}
|
245
245
|
});
|
246
|
-
Object.defineProperty(exports, "NewButton", {
|
247
|
-
enumerable: true,
|
248
|
-
get: function () {
|
249
|
-
return _NewButton.default;
|
250
|
-
}
|
251
|
-
});
|
252
246
|
Object.defineProperty(exports, "Caret", {
|
253
247
|
enumerable: true,
|
254
248
|
get: function () {
|
@@ -558,8 +552,6 @@ var _Breadcrumbs = _interopRequireWildcard(require("./Breadcrumbs"));
|
|
558
552
|
|
559
553
|
var _Button = _interopRequireWildcard(require("./Button"));
|
560
554
|
|
561
|
-
var _NewButton = _interopRequireDefault(require("./NewButton"));
|
562
|
-
|
563
555
|
var _Caret = _interopRequireDefault(require("./Caret"));
|
564
556
|
|
565
557
|
var _CircleBadge = _interopRequireDefault(require("./CircleBadge"));
|
package/lib/sx.d.ts
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
import { SystemStyleObject } from '@styled-system/css';
|
2
|
+
import merge from 'deepmerge';
|
2
3
|
export interface SxProp {
|
3
4
|
sx?: SystemStyleObject;
|
4
5
|
}
|
5
6
|
declare const sx: (props: SxProp) => import("@styled-system/css").CssFunctionReturnType;
|
6
7
|
export default sx;
|
8
|
+
export { merge };
|
package/lib/sx.js
CHANGED
@@ -3,10 +3,18 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
+
Object.defineProperty(exports, "merge", {
|
7
|
+
enumerable: true,
|
8
|
+
get: function () {
|
9
|
+
return _deepmerge.default;
|
10
|
+
}
|
11
|
+
});
|
6
12
|
exports.default = void 0;
|
7
13
|
|
8
14
|
var _css = _interopRequireDefault(require("@styled-system/css"));
|
9
15
|
|
16
|
+
var _deepmerge = _interopRequireDefault(require("deepmerge"));
|
17
|
+
|
10
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
11
19
|
|
12
20
|
const sx = props => (0, _css.default)(props.sx);
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
/** createSlots is a factory that can create a
|
3
|
+
* typesafe Slots + Slot pair to use in a component definition
|
4
|
+
* For example: ActionList.Item uses createSlots to get a Slots wrapper
|
5
|
+
* + Slot component that is used by LeadingVisual, Description
|
6
|
+
*/
|
7
|
+
declare const createSlots: <SlotNames extends string>(slotNames: SlotNames[]) => {
|
8
|
+
Slots: React.FC<{
|
9
|
+
context: Record<string, unknown>;
|
10
|
+
children: (slots: { [key in SlotNames]?: React.ReactNode; }) => React.ReactNode;
|
11
|
+
}>;
|
12
|
+
Slot: React.FC<{
|
13
|
+
name: SlotNames;
|
14
|
+
children: React.ReactNode | ((context: Record<string, unknown>) => React.ReactNode);
|
15
|
+
}>;
|
16
|
+
};
|
17
|
+
export default createSlots;
|
@@ -0,0 +1,105 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
9
|
+
|
10
|
+
var _useForceUpdate = require("./use-force-update");
|
11
|
+
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13
|
+
|
14
|
+
/** createSlots is a factory that can create a
|
15
|
+
* typesafe Slots + Slot pair to use in a component definition
|
16
|
+
* For example: ActionList.Item uses createSlots to get a Slots wrapper
|
17
|
+
* + Slot component that is used by LeadingVisual, Description
|
18
|
+
*/
|
19
|
+
const createSlots = slotNames => {
|
20
|
+
const SlotsContext = /*#__PURE__*/_react.default.createContext({
|
21
|
+
registerSlot: () => null,
|
22
|
+
unregisterSlot: () => null,
|
23
|
+
context: {}
|
24
|
+
});
|
25
|
+
/** Slots uses a Double render strategy inspired by [reach-ui/descendants](https://github.com/reach/reach-ui/tree/develop/packages/descendants)
|
26
|
+
* Slot registers themself with the Slots parent.
|
27
|
+
* When all the children have mounted = registered themselves in slot,
|
28
|
+
* we re-render the parent component to render with slots
|
29
|
+
*/
|
30
|
+
|
31
|
+
|
32
|
+
const Slots = ({
|
33
|
+
context,
|
34
|
+
children
|
35
|
+
}) => {
|
36
|
+
// initialise slots
|
37
|
+
const slotsDefinition = {};
|
38
|
+
slotNames.map(name => slotsDefinition[name] = null);
|
39
|
+
|
40
|
+
const slotsRef = _react.default.useRef(slotsDefinition);
|
41
|
+
|
42
|
+
const rerenderWithSlots = (0, _useForceUpdate.useForceUpdate)();
|
43
|
+
|
44
|
+
const [isMounted, setIsMounted] = _react.default.useState(false); // fires after all the effects in children
|
45
|
+
|
46
|
+
|
47
|
+
_react.default.useEffect(() => {
|
48
|
+
rerenderWithSlots();
|
49
|
+
setIsMounted(true);
|
50
|
+
}, [rerenderWithSlots]);
|
51
|
+
|
52
|
+
const registerSlot = _react.default.useCallback((name, contents) => {
|
53
|
+
slotsRef.current[name] = contents; // don't render until the component mounts = all slots are registered
|
54
|
+
|
55
|
+
if (isMounted) rerenderWithSlots();
|
56
|
+
}, [isMounted, rerenderWithSlots]); // Slot can be removed from the tree as well,
|
57
|
+
// we need to unregister them from the slot
|
58
|
+
|
59
|
+
|
60
|
+
const unregisterSlot = _react.default.useCallback(name => {
|
61
|
+
slotsRef.current[name] = null;
|
62
|
+
rerenderWithSlots();
|
63
|
+
}, [rerenderWithSlots]);
|
64
|
+
/**
|
65
|
+
* Slots uses a render prop API so abstract the
|
66
|
+
* implementation detail of using a context provider.
|
67
|
+
*/
|
68
|
+
|
69
|
+
|
70
|
+
const slots = slotsRef.current;
|
71
|
+
return /*#__PURE__*/_react.default.createElement(SlotsContext.Provider, {
|
72
|
+
value: {
|
73
|
+
registerSlot,
|
74
|
+
unregisterSlot,
|
75
|
+
context
|
76
|
+
}
|
77
|
+
}, children(slots));
|
78
|
+
};
|
79
|
+
|
80
|
+
const Slot = ({
|
81
|
+
name,
|
82
|
+
children
|
83
|
+
}) => {
|
84
|
+
const {
|
85
|
+
registerSlot,
|
86
|
+
unregisterSlot,
|
87
|
+
context
|
88
|
+
} = _react.default.useContext(SlotsContext);
|
89
|
+
|
90
|
+
_react.default.useEffect(() => {
|
91
|
+
registerSlot(name, typeof children === 'function' ? children(context) : children);
|
92
|
+
return () => unregisterSlot(name);
|
93
|
+
}, [name, children, registerSlot, unregisterSlot, context]);
|
94
|
+
|
95
|
+
return null;
|
96
|
+
};
|
97
|
+
|
98
|
+
return {
|
99
|
+
Slots,
|
100
|
+
Slot
|
101
|
+
};
|
102
|
+
};
|
103
|
+
|
104
|
+
var _default = createSlots;
|
105
|
+
exports.default = _default;
|
package/lib/utils/testing.d.ts
CHANGED
@@ -53,7 +53,7 @@ export declare function render(component: React.ReactElement, theme?: {
|
|
53
53
|
xlarge: string;
|
54
54
|
};
|
55
55
|
space: string[];
|
56
|
-
colorSchemes: Record<"
|
56
|
+
colorSchemes: Record<"light" | "light_protanopia" | "dark" | "dark_dimmed" | "dark_high_contrast" | "dark_protanopia", Record<"colors" | "shadows", Partial<{
|
57
57
|
canvasDefaultTransparent: string;
|
58
58
|
marketingIcon: {
|
59
59
|
primary: string;
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const useForceUpdate: () => () => void;
|
@@ -0,0 +1,19 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.useForceUpdate = void 0;
|
7
|
+
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
9
|
+
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
11
|
+
|
12
|
+
// Inspired from reach-ui: https://github.com/reach/reach-ui/blob/develop/packages/utils/src/use-force-update.ts
|
13
|
+
const useForceUpdate = () => {
|
14
|
+
const [, rerender] = _react.default.useState({});
|
15
|
+
|
16
|
+
return _react.default.useCallback(() => rerender({}), []);
|
17
|
+
};
|
18
|
+
|
19
|
+
exports.useForceUpdate = useForceUpdate;
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import Box from '../Box';
|
3
|
+
import { merge } from '../sx';
|
4
|
+
import Truncate from '../Truncate';
|
5
|
+
import { Slot } from './Item';
|
6
|
+
export const Description = ({
|
7
|
+
variant = 'inline',
|
8
|
+
sx = {},
|
9
|
+
...props
|
10
|
+
}) => {
|
11
|
+
const styles = {
|
12
|
+
color: 'fg.muted',
|
13
|
+
fontSize: 0,
|
14
|
+
lineHeight: '16px',
|
15
|
+
flexGrow: 1,
|
16
|
+
flexBasis: 0,
|
17
|
+
minWidth: 0,
|
18
|
+
marginLeft: variant === 'block' ? 0 : 2
|
19
|
+
};
|
20
|
+
return /*#__PURE__*/React.createElement(Slot, {
|
21
|
+
name: variant === 'block' ? 'BlockDescription' : 'InlineDescription'
|
22
|
+
}, ({
|
23
|
+
blockDescriptionId,
|
24
|
+
inlineDescriptionId
|
25
|
+
}) => variant === 'block' ? /*#__PURE__*/React.createElement(Box, {
|
26
|
+
as: "span",
|
27
|
+
sx: merge(styles, sx),
|
28
|
+
id: blockDescriptionId
|
29
|
+
}, props.children) : /*#__PURE__*/React.createElement(Truncate, {
|
30
|
+
id: inlineDescriptionId,
|
31
|
+
sx: merge(styles, sx),
|
32
|
+
title: props.children,
|
33
|
+
inline: true,
|
34
|
+
maxWidth: "100%"
|
35
|
+
}, props.children));
|
36
|
+
};
|
37
|
+
Description.displayName = "Description";
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import Box from '../Box';
|
3
|
+
import { get } from '../constants';
|
4
|
+
|
5
|
+
/**
|
6
|
+
* Visually separates `Item`s or `Group`s in an `ActionList`.
|
7
|
+
*/
|
8
|
+
export function Divider() {
|
9
|
+
return /*#__PURE__*/React.createElement(Box, {
|
10
|
+
as: "li",
|
11
|
+
role: "separator",
|
12
|
+
sx: {
|
13
|
+
height: 1,
|
14
|
+
backgroundColor: 'border.muted',
|
15
|
+
marginTop: theme => `calc(${get('space.2')(theme)} - 1px)`,
|
16
|
+
marginBottom: 2
|
17
|
+
},
|
18
|
+
"data-component": "ActionList.Divider"
|
19
|
+
});
|
20
|
+
}
|
21
|
+
Divider.displayName = "Divider";
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { SxProp } from '../sx';
|
3
|
+
import { HeaderProps } from './Header';
|
4
|
+
import { ListProps } from './List';
|
5
|
+
export declare type GroupProps = HeaderProps & SxProp & {
|
6
|
+
selectionVariant?: ListProps['selectionVariant'] | false;
|
7
|
+
};
|
8
|
+
declare type ContextProps = Pick<GroupProps, 'selectionVariant'>;
|
9
|
+
export declare const GroupContext: React.Context<ContextProps>;
|
10
|
+
export declare const Group: React.FC<GroupProps>;
|
11
|
+
export {};
|