@primer/components 0.0.0-202194183411 → 0.0.0-202194215436
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 +295 -299
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +358 -362
- package/dist/browser.umd.js.map +1 -1
- package/lib/AnchoredOverlay/AnchoredOverlay.d.ts +1 -2
- package/lib/AnchoredOverlay/AnchoredOverlay.js +3 -11
- package/lib/FilteredActionList/FilteredActionList.js +31 -5
- package/lib/Overlay.d.ts +1 -2
- package/lib/Overlay.js +5 -10
- package/lib/SelectMenu/SelectMenu.d.ts +2 -8
- package/lib/TextInput.d.ts +3 -6
- package/lib/TextInput.js +10 -9
- package/{lib-esm/Token/TokenLabel.d.ts → lib/Token/LabelToken.d.ts} +3 -3
- package/lib/Token/{TokenLabel.js → LabelToken.js} +23 -23
- package/lib/Token/Token.d.ts +2 -2
- package/lib/Token/Token.js +13 -13
- package/lib/Token/TokenBase.d.ts +3 -3
- package/lib/Token/TokenBase.js +17 -16
- package/lib/Token/TokenProfile.d.ts +1 -1
- package/lib/Token/TokenProfile.js +3 -3
- package/lib/Token/_RemoveTokenButton.d.ts +7 -1
- package/lib/Token/_RemoveTokenButton.js +40 -11
- package/lib/Token/index.d.ts +1 -1
- package/lib/Token/index.js +3 -3
- package/lib/hooks/useOverlay.d.ts +1 -2
- package/lib/hooks/useOverlay.js +6 -11
- package/lib/index.d.ts +1 -3
- package/lib/index.js +2 -18
- package/lib/utils/types.d.ts +0 -3
- package/lib-esm/AnchoredOverlay/AnchoredOverlay.d.ts +1 -2
- package/lib-esm/AnchoredOverlay/AnchoredOverlay.js +3 -11
- package/lib-esm/FilteredActionList/FilteredActionList.js +31 -3
- package/lib-esm/Overlay.d.ts +1 -2
- package/lib-esm/Overlay.js +5 -8
- package/lib-esm/SelectMenu/SelectMenu.d.ts +2 -8
- package/lib-esm/TextInput.d.ts +3 -6
- package/lib-esm/TextInput.js +9 -8
- package/{lib/Token/TokenLabel.d.ts → lib-esm/Token/LabelToken.d.ts} +3 -3
- package/lib-esm/Token/{TokenLabel.js → LabelToken.js} +23 -23
- package/lib-esm/Token/Token.d.ts +2 -2
- package/lib-esm/Token/Token.js +13 -13
- package/lib-esm/Token/TokenBase.d.ts +3 -3
- package/lib-esm/Token/TokenBase.js +17 -16
- package/lib-esm/Token/TokenProfile.d.ts +1 -1
- package/lib-esm/Token/TokenProfile.js +3 -3
- package/lib-esm/Token/_RemoveTokenButton.d.ts +7 -1
- package/lib-esm/Token/_RemoveTokenButton.js +36 -10
- package/lib-esm/Token/index.d.ts +1 -1
- package/lib-esm/Token/index.js +1 -1
- package/lib-esm/hooks/useOverlay.d.ts +1 -2
- package/lib-esm/hooks/useOverlay.js +6 -11
- package/lib-esm/index.d.ts +1 -3
- package/lib-esm/index.js +1 -3
- package/lib-esm/utils/types.d.ts +0 -3
- package/package.json +1 -1
- package/lib/Autocomplete/Autocomplete.d.ts +0 -40
- package/lib/Autocomplete/Autocomplete.js +0 -68
- package/lib/Autocomplete/AutocompleteContext.d.ts +0 -17
- package/lib/Autocomplete/AutocompleteContext.js +0 -11
- package/lib/Autocomplete/AutocompleteInput.d.ts +0 -9
- package/lib/Autocomplete/AutocompleteInput.js +0 -146
- package/lib/Autocomplete/AutocompleteMenu.d.ts +0 -71
- package/lib/Autocomplete/AutocompleteMenu.js +0 -223
- package/lib/Autocomplete/AutocompleteOverlay.d.ts +0 -17
- package/lib/Autocomplete/AutocompleteOverlay.js +0 -71
- package/lib/Autocomplete/index.d.ts +0 -2
- package/lib/Autocomplete/index.js +0 -15
- package/lib/TextInputWithTokens.d.ts +0 -43
- package/lib/TextInputWithTokens.js +0 -236
- package/lib/Token/_tokenButtonUtils.d.ts +0 -10
- package/lib/Token/_tokenButtonUtils.js +0 -42
- package/lib/_UnstyledTextInput.d.ts +0 -2
- package/lib/_UnstyledTextInput.js +0 -20
- package/lib/utils/scrollIntoViewingArea.d.ts +0 -1
- package/lib/utils/scrollIntoViewingArea.js +0 -39
- package/lib-esm/Autocomplete/Autocomplete.d.ts +0 -40
- package/lib-esm/Autocomplete/Autocomplete.js +0 -47
- package/lib-esm/Autocomplete/AutocompleteContext.d.ts +0 -17
- package/lib-esm/Autocomplete/AutocompleteContext.js +0 -2
- package/lib-esm/Autocomplete/AutocompleteInput.d.ts +0 -9
- package/lib-esm/Autocomplete/AutocompleteInput.js +0 -127
- package/lib-esm/Autocomplete/AutocompleteMenu.d.ts +0 -71
- package/lib-esm/Autocomplete/AutocompleteMenu.js +0 -202
- package/lib-esm/Autocomplete/AutocompleteOverlay.d.ts +0 -17
- package/lib-esm/Autocomplete/AutocompleteOverlay.js +0 -53
- package/lib-esm/Autocomplete/index.d.ts +0 -2
- package/lib-esm/Autocomplete/index.js +0 -1
- package/lib-esm/TextInputWithTokens.d.ts +0 -43
- package/lib-esm/TextInputWithTokens.js +0 -209
- package/lib-esm/Token/_tokenButtonUtils.d.ts +0 -10
- package/lib-esm/Token/_tokenButtonUtils.js +0 -26
- package/lib-esm/_UnstyledTextInput.d.ts +0 -2
- package/lib-esm/_UnstyledTextInput.js +0 -7
- package/lib-esm/utils/scrollIntoViewingArea.d.ts +0 -1
- package/lib-esm/utils/scrollIntoViewingArea.js +0 -30
package/lib/Token/TokenBase.js
CHANGED
@@ -14,10 +14,10 @@ var _constants = require("../constants");
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
15
15
|
|
16
16
|
const tokenSizes = {
|
17
|
-
sm:
|
18
|
-
md:
|
19
|
-
lg:
|
20
|
-
xl:
|
17
|
+
sm: '16px',
|
18
|
+
md: '20px',
|
19
|
+
lg: '24px',
|
20
|
+
xl: '32px'
|
21
21
|
};
|
22
22
|
exports.tokenSizes = tokenSizes;
|
23
23
|
const defaultTokenSize = 'md';
|
@@ -32,32 +32,33 @@ const isTokenInteractive = ({
|
|
32
32
|
|
33
33
|
exports.isTokenInteractive = isTokenInteractive;
|
34
34
|
const variants = (0, _styledSystem.variant)({
|
35
|
+
prop: 'size',
|
35
36
|
variants: {
|
36
37
|
sm: {
|
37
38
|
fontSize: 0,
|
38
39
|
gap: 1,
|
39
|
-
height:
|
40
|
+
height: tokenSizes.sm,
|
40
41
|
paddingLeft: 1,
|
41
42
|
paddingRight: 1
|
42
43
|
},
|
43
44
|
md: {
|
44
45
|
fontSize: 0,
|
45
46
|
gap: 1,
|
46
|
-
height:
|
47
|
+
height: tokenSizes.md,
|
47
48
|
paddingLeft: 2,
|
48
49
|
paddingRight: 2
|
49
50
|
},
|
50
51
|
lg: {
|
51
52
|
fontSize: 0,
|
52
53
|
gap: 2,
|
53
|
-
height:
|
54
|
+
height: tokenSizes.lg,
|
54
55
|
paddingLeft: 2,
|
55
56
|
paddingRight: 2
|
56
57
|
},
|
57
58
|
xl: {
|
58
59
|
fontSize: 1,
|
59
60
|
gap: 2,
|
60
|
-
height:
|
61
|
+
height: tokenSizes.xl,
|
61
62
|
paddingLeft: 3,
|
62
63
|
paddingRight: 3
|
63
64
|
}
|
@@ -66,17 +67,17 @@ const variants = (0, _styledSystem.variant)({
|
|
66
67
|
|
67
68
|
const TokenBase = _styledComponents.default.span.attrs(({
|
68
69
|
text,
|
69
|
-
|
70
|
-
|
70
|
+
onRemove,
|
71
|
+
onKeyDown
|
71
72
|
}) => ({
|
72
|
-
|
73
|
-
|
73
|
+
onKeyDown: event => {
|
74
|
+
onKeyDown && onKeyDown(event);
|
74
75
|
|
75
|
-
if ((
|
76
|
-
|
76
|
+
if ((event.key === 'Backspace' || event.key === 'Delete') && onRemove) {
|
77
|
+
onRemove();
|
77
78
|
}
|
78
79
|
},
|
79
|
-
'aria-label':
|
80
|
+
'aria-label': onRemove ? `${text}, press backspace or delete to remove` : undefined
|
80
81
|
})).withConfig({
|
81
82
|
displayName: "TokenBase",
|
82
83
|
componentId: "opajvp-0"
|
@@ -84,7 +85,7 @@ const TokenBase = _styledComponents.default.span.attrs(({
|
|
84
85
|
|
85
86
|
TokenBase.defaultProps = {
|
86
87
|
as: 'span',
|
87
|
-
|
88
|
+
size: defaultTokenSize
|
88
89
|
};
|
89
90
|
var _default = TokenBase;
|
90
91
|
exports.default = _default;
|
@@ -3,5 +3,5 @@ import { TokenBaseProps } from './TokenBase';
|
|
3
3
|
export interface TokenProfileProps extends TokenBaseProps {
|
4
4
|
avatarSrc: string;
|
5
5
|
}
|
6
|
-
declare const TokenProfile: React.ForwardRefExoticComponent<Pick<TokenProfileProps, "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" | "step" | "wrap" | "open" | "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" | "disabled" | "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" | "multiple" | "readOnly" | "required" | "challenge" | "keyType" | "keyParams" | "htmlFor" | "as" | "integrity" | "charSet" | "httpEquiv" | "high" | "low" | "optimum" | "reversed" | "selected" | "defer" | "nonce" | "scoped" | "cellPadding" | "cellSpacing" | "colSpan" | "headers" | "rowSpan" | "scope" | "cols" | "rows" | "kind" | "srcLang" | "poster" | "
|
6
|
+
declare const TokenProfile: React.ForwardRefExoticComponent<Pick<TokenProfileProps, "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" | "step" | "size" | "wrap" | "open" | "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" | "disabled" | "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" | "multiple" | "readOnly" | "required" | "challenge" | "keyType" | "keyParams" | "htmlFor" | "as" | "integrity" | "charSet" | "httpEquiv" | "high" | "low" | "optimum" | "reversed" | "selected" | "defer" | "nonce" | "scoped" | "cellPadding" | "cellSpacing" | "colSpan" | "headers" | "rowSpan" | "scope" | "cols" | "rows" | "kind" | "srcLang" | "poster" | "onRemove" | "isSelected" | "avatarSrc"> & React.RefAttributes<HTMLElement>>;
|
7
7
|
export default TokenProfile;
|
@@ -35,14 +35,14 @@ const TokenProfile = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
35
35
|
avatarSrc,
|
36
36
|
id,
|
37
37
|
ref,
|
38
|
-
|
38
|
+
size,
|
39
39
|
...rest
|
40
40
|
}, forwardedRef) => /*#__PURE__*/_react.default.createElement(StyledToken, _extends({
|
41
41
|
leadingVisual: () => /*#__PURE__*/_react.default.createElement(_.Avatar, {
|
42
42
|
src: avatarSrc,
|
43
|
-
size: _TokenBase.tokenSizes[
|
43
|
+
size: parseInt(_TokenBase.tokenSizes[size || _TokenBase.defaultTokenSize], 10) - parseInt(_primitives.default.spacing.normal.spacer[1], 10) * 2
|
44
44
|
}),
|
45
|
-
|
45
|
+
size: size,
|
46
46
|
id: id === null || id === void 0 ? void 0 : id.toString(),
|
47
47
|
ref: forwardedRef
|
48
48
|
}, rest)));
|
@@ -1,3 +1,9 @@
|
|
1
|
-
import {
|
1
|
+
import { TokenSizeKeys } from './TokenBase';
|
2
|
+
interface TokenButtonProps {
|
3
|
+
borderOffset?: number;
|
4
|
+
parentTokenTag: 'span' | 'button' | 'a';
|
5
|
+
size?: TokenSizeKeys;
|
6
|
+
isParentInteractive?: boolean;
|
7
|
+
}
|
2
8
|
declare const RemoveTokenButton: import("styled-components").StyledComponent<"span", any, TokenButtonProps, never>;
|
3
9
|
export default RemoveTokenButton;
|
@@ -7,38 +7,67 @@ exports.default = void 0;
|
|
7
7
|
|
8
8
|
var _octiconsReact = require("@primer/octicons-react");
|
9
9
|
|
10
|
-
var _styledComponents =
|
10
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
11
|
+
|
12
|
+
var _styledSystem = require("styled-system");
|
13
|
+
|
14
|
+
var _constants = require("../constants");
|
11
15
|
|
12
16
|
var _TokenBase = require("./TokenBase");
|
13
17
|
|
14
|
-
|
18
|
+
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); }
|
19
|
+
|
20
|
+
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; }
|
21
|
+
|
22
|
+
const variants = (0, _styledSystem.variant)({
|
23
|
+
prop: 'size',
|
24
|
+
variants: {
|
25
|
+
sm: {
|
26
|
+
height: _TokenBase.tokenSizes.sm,
|
27
|
+
width: _TokenBase.tokenSizes.sm
|
28
|
+
},
|
29
|
+
md: {
|
30
|
+
height: _TokenBase.tokenSizes.md,
|
31
|
+
width: _TokenBase.tokenSizes.md
|
32
|
+
},
|
33
|
+
lg: {
|
34
|
+
height: _TokenBase.tokenSizes.lg,
|
35
|
+
width: _TokenBase.tokenSizes.lg
|
36
|
+
},
|
37
|
+
xl: {
|
38
|
+
height: _TokenBase.tokenSizes.xl,
|
39
|
+
width: _TokenBase.tokenSizes.xl
|
40
|
+
}
|
41
|
+
}
|
42
|
+
});
|
43
|
+
const tokenButtonStyles = (0, _styledComponents.css)(["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;align-self:baseline;border:0;border-radius:999px;&:hover,&:focus{background-color:", ";}&:active{background-color:", ";}"], (0, _constants.get)('colors.fade.fg10'), (0, _constants.get)('colors.fade.fg15'));
|
15
44
|
|
16
|
-
|
45
|
+
const getTokenButtonIconSize = variant => parseInt(_TokenBase.tokenSizes[variant || _TokenBase.defaultTokenSize], 10) * 0.75;
|
17
46
|
|
18
47
|
const RemoveTokenButton = _styledComponents.default.span.attrs(({
|
19
48
|
borderOffset,
|
20
49
|
parentTokenTag,
|
21
|
-
|
22
|
-
|
50
|
+
size,
|
51
|
+
isParentInteractive,
|
23
52
|
...rest
|
24
53
|
}) => {
|
25
54
|
delete rest.children;
|
26
55
|
return {
|
27
56
|
borderOffset,
|
28
|
-
as:
|
29
|
-
tabIndex:
|
30
|
-
'aria-label': !
|
57
|
+
as: isParentInteractive ? 'span' : 'button',
|
58
|
+
tabIndex: isParentInteractive ? -1 : undefined,
|
59
|
+
'aria-label': !isParentInteractive ? 'Remove token' : undefined,
|
31
60
|
children: /*#__PURE__*/React.createElement(_octiconsReact.XIcon, {
|
32
|
-
size:
|
61
|
+
size: getTokenButtonIconSize(size)
|
33
62
|
})
|
34
63
|
};
|
35
64
|
}).withConfig({
|
36
65
|
displayName: "_RemoveTokenButton__RemoveTokenButton",
|
37
66
|
componentId: "sc-14lvcw1-0"
|
38
|
-
})(["", " ", " transform:", ";"],
|
67
|
+
})(["", " ", " transform:", ";"], tokenButtonStyles, variants, props => `translate(${props.borderOffset}px, -${props.borderOffset}px)`);
|
39
68
|
|
40
69
|
RemoveTokenButton.defaultProps = {
|
41
|
-
|
70
|
+
size: _TokenBase.defaultTokenSize
|
42
71
|
};
|
43
72
|
var _default = RemoveTokenButton;
|
44
73
|
exports.default = _default;
|
package/lib/Token/index.d.ts
CHANGED
package/lib/Token/index.js
CHANGED
@@ -9,10 +9,10 @@ Object.defineProperty(exports, "default", {
|
|
9
9
|
return _Token.default;
|
10
10
|
}
|
11
11
|
});
|
12
|
-
Object.defineProperty(exports, "
|
12
|
+
Object.defineProperty(exports, "LabelToken", {
|
13
13
|
enumerable: true,
|
14
14
|
get: function () {
|
15
|
-
return
|
15
|
+
return _LabelToken.default;
|
16
16
|
}
|
17
17
|
});
|
18
18
|
Object.defineProperty(exports, "TokenProfile", {
|
@@ -24,7 +24,7 @@ Object.defineProperty(exports, "TokenProfile", {
|
|
24
24
|
|
25
25
|
var _Token = _interopRequireDefault(require("./Token"));
|
26
26
|
|
27
|
-
var
|
27
|
+
var _LabelToken = _interopRequireDefault(require("./LabelToken"));
|
28
28
|
|
29
29
|
var _TokenProfile = _interopRequireDefault(require("./TokenProfile"));
|
30
30
|
|
@@ -7,9 +7,8 @@ export declare type UseOverlaySettings = {
|
|
7
7
|
onEscape: (e: KeyboardEvent) => void;
|
8
8
|
onClickOutside: (e: TouchOrMouseEvent) => void;
|
9
9
|
overlayRef?: React.RefObject<HTMLDivElement>;
|
10
|
-
preventFocusOnOpen?: boolean;
|
11
10
|
};
|
12
11
|
export declare type OverlayReturnProps = {
|
13
12
|
ref: React.RefObject<HTMLDivElement>;
|
14
13
|
};
|
15
|
-
export declare const useOverlay: ({ overlayRef: _overlayRef, returnFocusRef, initialFocusRef, onEscape, ignoreClickRefs, onClickOutside
|
14
|
+
export declare const useOverlay: ({ overlayRef: _overlayRef, returnFocusRef, initialFocusRef, onEscape, ignoreClickRefs, onClickOutside }: UseOverlaySettings) => OverlayReturnProps;
|
package/lib/hooks/useOverlay.js
CHANGED
@@ -19,19 +19,14 @@ const useOverlay = ({
|
|
19
19
|
initialFocusRef,
|
20
20
|
onEscape,
|
21
21
|
ignoreClickRefs,
|
22
|
-
onClickOutside
|
23
|
-
preventFocusOnOpen
|
22
|
+
onClickOutside
|
24
23
|
}) => {
|
25
24
|
const overlayRef = (0, _useProvidedRefOrCreate.useProvidedRefOrCreate)(_overlayRef);
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
initialFocusRef
|
32
|
-
});
|
33
|
-
}
|
34
|
-
|
25
|
+
(0, _useOpenAndCloseFocus.useOpenAndCloseFocus)({
|
26
|
+
containerRef: overlayRef,
|
27
|
+
returnFocusRef,
|
28
|
+
initialFocusRef
|
29
|
+
});
|
35
30
|
(0, _useOnOutsideClick.useOnOutsideClick)({
|
36
31
|
containerRef: overlayRef,
|
37
32
|
ignoreClickRefs,
|
package/lib/index.d.ts
CHANGED
@@ -24,7 +24,6 @@ export { useConfirm } from './Dialog/ConfirmationDialog';
|
|
24
24
|
export { ActionList } from './ActionList';
|
25
25
|
export { ActionMenu } from './ActionMenu';
|
26
26
|
export type { ActionMenuProps } from './ActionMenu';
|
27
|
-
export { default as Autocomplete } from './Autocomplete';
|
28
27
|
export { default as Avatar } from './Avatar';
|
29
28
|
export type { AvatarProps } from './Avatar';
|
30
29
|
export { default as AvatarPair } from './AvatarPair';
|
@@ -99,12 +98,11 @@ export { default as TabNav } from './TabNav';
|
|
99
98
|
export type { TabNavProps, TabNavLinkProps } from './TabNav';
|
100
99
|
export { default as TextInput } from './TextInput';
|
101
100
|
export type { TextInputProps } from './TextInput';
|
102
|
-
export { default as TextInputWithTokens } from './TextInputWithTokens';
|
103
101
|
export { default as Text } from './Text';
|
104
102
|
export type { TextProps } from './Text';
|
105
103
|
export { default as Timeline } from './Timeline';
|
106
104
|
export type { TimelineProps, TimelineBadgeProps, TimelineBodyProps, TimelineBreakProps, TimelineItemsProps } from './Timeline';
|
107
|
-
export { default as Token,
|
105
|
+
export { default as Token, LabelToken, TokenProfile } from './Token';
|
108
106
|
export { default as Tooltip } from './Tooltip';
|
109
107
|
export type { TooltipProps } from './Tooltip';
|
110
108
|
export { default as Truncate } from './Truncate';
|
package/lib/index.js
CHANGED
@@ -153,12 +153,6 @@ Object.defineProperty(exports, "ActionMenu", {
|
|
153
153
|
return _ActionMenu.ActionMenu;
|
154
154
|
}
|
155
155
|
});
|
156
|
-
Object.defineProperty(exports, "Autocomplete", {
|
157
|
-
enumerable: true,
|
158
|
-
get: function () {
|
159
|
-
return _Autocomplete.default;
|
160
|
-
}
|
161
|
-
});
|
162
156
|
Object.defineProperty(exports, "Avatar", {
|
163
157
|
enumerable: true,
|
164
158
|
get: function () {
|
@@ -435,12 +429,6 @@ Object.defineProperty(exports, "TextInput", {
|
|
435
429
|
return _TextInput.default;
|
436
430
|
}
|
437
431
|
});
|
438
|
-
Object.defineProperty(exports, "TextInputWithTokens", {
|
439
|
-
enumerable: true,
|
440
|
-
get: function () {
|
441
|
-
return _TextInputWithTokens.default;
|
442
|
-
}
|
443
|
-
});
|
444
432
|
Object.defineProperty(exports, "Text", {
|
445
433
|
enumerable: true,
|
446
434
|
get: function () {
|
@@ -459,10 +447,10 @@ Object.defineProperty(exports, "Token", {
|
|
459
447
|
return _Token.default;
|
460
448
|
}
|
461
449
|
});
|
462
|
-
Object.defineProperty(exports, "
|
450
|
+
Object.defineProperty(exports, "LabelToken", {
|
463
451
|
enumerable: true,
|
464
452
|
get: function () {
|
465
|
-
return _Token.
|
453
|
+
return _Token.LabelToken;
|
466
454
|
}
|
467
455
|
});
|
468
456
|
Object.defineProperty(exports, "TokenProfile", {
|
@@ -538,8 +526,6 @@ var _ActionList = require("./ActionList");
|
|
538
526
|
|
539
527
|
var _ActionMenu = require("./ActionMenu");
|
540
528
|
|
541
|
-
var _Autocomplete = _interopRequireDefault(require("./Autocomplete"));
|
542
|
-
|
543
529
|
var _Avatar = _interopRequireDefault(require("./Avatar"));
|
544
530
|
|
545
531
|
var _AvatarPair = _interopRequireDefault(require("./AvatarPair"));
|
@@ -614,8 +600,6 @@ var _TabNav = _interopRequireDefault(require("./TabNav"));
|
|
614
600
|
|
615
601
|
var _TextInput = _interopRequireDefault(require("./TextInput"));
|
616
602
|
|
617
|
-
var _TextInputWithTokens = _interopRequireDefault(require("./TextInputWithTokens"));
|
618
|
-
|
619
603
|
var _Text = _interopRequireDefault(require("./Text"));
|
620
604
|
|
621
605
|
var _Timeline = _interopRequireDefault(require("./Timeline"));
|
package/lib/utils/types.d.ts
CHANGED
@@ -12,6 +12,3 @@ export declare type ComponentProps<T> = T extends React.ComponentType<infer Prop
|
|
12
12
|
*/
|
13
13
|
export declare type Flatten<T extends unknown> = T extends (infer U)[] ? U : never;
|
14
14
|
export declare type AriaRole = 'alert' | 'alertdialog' | 'application' | 'article' | 'banner' | 'button' | 'cell' | 'checkbox' | 'columnheader' | 'combobox' | 'complementary' | 'contentinfo' | 'definition' | 'dialog' | 'directory' | 'document' | 'feed' | 'figure' | 'form' | 'grid' | 'gridcell' | 'group' | 'heading' | 'img' | 'link' | 'list' | 'listbox' | 'listitem' | 'log' | 'main' | 'marquee' | 'math' | 'menu' | 'menubar' | 'menuitem' | 'menuitemcheckbox ' | 'menuitemradio' | 'navigation' | 'none' | 'note' | 'option' | 'presentation' | 'progressbar' | 'radio' | 'radiogroup' | 'region' | 'row' | 'rowgroup' | 'rowheader' | 'scrollbar' | 'search' | 'searchbox' | 'separator' | 'slider' | 'spinbutton' | 'status' | 'switch' | 'tab' | 'table' | 'tablist' | 'tabpanel' | 'term' | 'textbox' | 'timer' | 'toolbar' | 'tooltip' | 'tree' | 'treegrid' | 'treeitem';
|
15
|
-
export declare type MandateProps<T extends {}, K extends keyof T> = Omit<T, K> & {
|
16
|
-
[MK in K]-?: NonNullable<T[MK]>;
|
17
|
-
};
|
@@ -2,7 +2,6 @@ import React from 'react';
|
|
2
2
|
import { OverlayProps } from '../Overlay';
|
3
3
|
import { FocusTrapHookSettings } from '../hooks/useFocusTrap';
|
4
4
|
import { FocusZoneHookSettings } from '../hooks/useFocusZone';
|
5
|
-
import { PositionSettings } from '../behaviors/anchoredPosition';
|
6
5
|
interface AnchoredOverlayPropsWithAnchor {
|
7
6
|
/**
|
8
7
|
* A custom function component used to render the anchor element.
|
@@ -53,7 +52,7 @@ interface AnchoredOverlayBaseProps extends Pick<OverlayProps, 'height' | 'width'
|
|
53
52
|
*/
|
54
53
|
focusZoneSettings?: Partial<FocusZoneHookSettings>;
|
55
54
|
}
|
56
|
-
export declare type AnchoredOverlayProps = AnchoredOverlayBaseProps & (AnchoredOverlayPropsWithAnchor | AnchoredOverlayPropsWithoutAnchor)
|
55
|
+
export declare type AnchoredOverlayProps = AnchoredOverlayBaseProps & (AnchoredOverlayPropsWithAnchor | AnchoredOverlayPropsWithoutAnchor);
|
57
56
|
/**
|
58
57
|
* An `AnchoredOverlay` provides an anchor that will open a floating overlay positioned relative to the anchor.
|
59
58
|
* The overlay can be opened and navigated using keyboard or mouse.
|
@@ -22,9 +22,7 @@ export const AnchoredOverlay = ({
|
|
22
22
|
width,
|
23
23
|
overlayProps,
|
24
24
|
focusTrapSettings,
|
25
|
-
focusZoneSettings
|
26
|
-
side,
|
27
|
-
align
|
25
|
+
focusZoneSettings
|
28
26
|
}) => {
|
29
27
|
const anchorRef = useProvidedRefOrCreate(externalAnchorRef);
|
30
28
|
const [overlayRef, updateOverlayRef] = useRenderForcingRef();
|
@@ -54,9 +52,7 @@ export const AnchoredOverlay = ({
|
|
54
52
|
position
|
55
53
|
} = useAnchoredPosition({
|
56
54
|
anchorElementRef: anchorRef,
|
57
|
-
floatingElementRef: overlayRef
|
58
|
-
side,
|
59
|
-
align
|
55
|
+
floatingElementRef: overlayRef
|
60
56
|
}, [overlayRef.current]);
|
61
57
|
useEffect(() => {
|
62
58
|
// ensure overlay ref gets cleared when closed, so position can reset between closing/re-opening
|
@@ -97,8 +93,4 @@ export const AnchoredOverlay = ({
|
|
97
93
|
anchorSide: position === null || position === void 0 ? void 0 : position.anchorSide
|
98
94
|
}, overlayProps), children) : null);
|
99
95
|
};
|
100
|
-
AnchoredOverlay.displayName = 'AnchoredOverlay';
|
101
|
-
AnchoredOverlay.defaultProps = {
|
102
|
-
side: 'outside-bottom',
|
103
|
-
align: 'start'
|
104
|
-
};
|
96
|
+
AnchoredOverlay.displayName = 'AnchoredOverlay';
|
@@ -1,7 +1,6 @@
|
|
1
1
|
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); }
|
2
2
|
|
3
3
|
import React, { useCallback, useEffect, useRef } from 'react';
|
4
|
-
import { useSSRSafeId } from '@react-aria/ssr';
|
5
4
|
import TextInput from '../TextInput';
|
6
5
|
import Box from '../Box';
|
7
6
|
import { ActionList } from '../ActionList';
|
@@ -12,7 +11,36 @@ import styled from 'styled-components';
|
|
12
11
|
import { get } from '../constants';
|
13
12
|
import { useProvidedRefOrCreate } from '../hooks/useProvidedRefOrCreate';
|
14
13
|
import useScrollFlash from '../hooks/useScrollFlash';
|
15
|
-
import {
|
14
|
+
import { useSSRSafeId } from '@react-aria/ssr';
|
15
|
+
|
16
|
+
function scrollIntoViewingArea(child, container, margin = 8, behavior = 'smooth') {
|
17
|
+
const {
|
18
|
+
top: childTop,
|
19
|
+
bottom: childBottom
|
20
|
+
} = child.getBoundingClientRect();
|
21
|
+
const {
|
22
|
+
top: containerTop,
|
23
|
+
bottom: containerBottom
|
24
|
+
} = container.getBoundingClientRect();
|
25
|
+
const isChildTopAboveViewingArea = childTop < containerTop + margin;
|
26
|
+
const isChildBottomBelowViewingArea = childBottom > containerBottom - margin;
|
27
|
+
|
28
|
+
if (isChildTopAboveViewingArea) {
|
29
|
+
const scrollHeightToChildTop = childTop - containerTop + container.scrollTop;
|
30
|
+
container.scrollTo({
|
31
|
+
behavior,
|
32
|
+
top: scrollHeightToChildTop - margin
|
33
|
+
});
|
34
|
+
} else if (isChildBottomBelowViewingArea) {
|
35
|
+
const scrollHeightToChildBottom = childBottom - containerBottom + container.scrollTop;
|
36
|
+
container.scrollTo({
|
37
|
+
behavior,
|
38
|
+
top: scrollHeightToChildBottom + margin
|
39
|
+
});
|
40
|
+
} // either completely in view or outside viewing area on both ends, don't scroll
|
41
|
+
|
42
|
+
}
|
43
|
+
|
16
44
|
const StyledHeader = styled.div.withConfig({
|
17
45
|
displayName: "FilteredActionList__StyledHeader",
|
18
46
|
componentId: "yg3jkv-0"
|
@@ -66,7 +94,7 @@ export function FilteredActionList({
|
|
66
94
|
useEffect(() => {
|
67
95
|
// if items changed, we want to instantly move active descendant into view
|
68
96
|
if (activeDescendantRef.current && scrollContainerRef.current) {
|
69
|
-
scrollIntoViewingArea(activeDescendantRef.current, scrollContainerRef.current,
|
97
|
+
scrollIntoViewingArea(activeDescendantRef.current, scrollContainerRef.current, undefined, 'auto');
|
70
98
|
}
|
71
99
|
}, [items]);
|
72
100
|
useScrollFlash(scrollContainerRef);
|
package/lib-esm/Overlay.d.ts
CHANGED
@@ -4,7 +4,7 @@ import { ComponentProps } from './utils/types';
|
|
4
4
|
import { TouchOrMouseEvent } from './hooks';
|
5
5
|
import { SxProp } from './sx';
|
6
6
|
import { AnchorSide } from './behaviors/anchoredPosition';
|
7
|
-
|
7
|
+
declare type StyledOverlayProps = {
|
8
8
|
width?: keyof typeof widthMap;
|
9
9
|
height?: keyof typeof heightMap;
|
10
10
|
maxHeight?: keyof Omit<typeof heightMap, 'auto' | 'initial'>;
|
@@ -40,7 +40,6 @@ export declare type OverlayProps = {
|
|
40
40
|
top: number;
|
41
41
|
left: number;
|
42
42
|
portalContainerName?: string;
|
43
|
-
preventFocusOnOpen?: boolean;
|
44
43
|
} & Omit<ComponentProps<typeof StyledOverlay>, 'visibility' | keyof SystemPositionProps>;
|
45
44
|
/**
|
46
45
|
* An `Overlay` is a flexible floating surface, used to display transient content such as menus,
|
package/lib-esm/Overlay.js
CHANGED
@@ -92,7 +92,6 @@ const Overlay = /*#__PURE__*/React.forwardRef(({
|
|
92
92
|
left,
|
93
93
|
anchorSide,
|
94
94
|
portalContainerName,
|
95
|
-
preventFocusOnOpen,
|
96
95
|
...rest
|
97
96
|
}, forwardedRef) => {
|
98
97
|
const overlayRef = useRef(null);
|
@@ -108,8 +107,7 @@ const Overlay = /*#__PURE__*/React.forwardRef(({
|
|
108
107
|
onEscape,
|
109
108
|
ignoreClickRefs,
|
110
109
|
onClickOutside,
|
111
|
-
initialFocusRef
|
112
|
-
preventFocusOnOpen
|
110
|
+
initialFocusRef
|
113
111
|
});
|
114
112
|
useEffect(() => {
|
115
113
|
var _combinedRef$current;
|
@@ -138,7 +136,9 @@ const Overlay = /*#__PURE__*/React.forwardRef(({
|
|
138
136
|
easing: slideAnimationEasing
|
139
137
|
});
|
140
138
|
}, [anchorSide, slideAnimationDistance, slideAnimationEasing, visibility]);
|
141
|
-
|
139
|
+
return /*#__PURE__*/React.createElement(Portal, {
|
140
|
+
containerName: portalContainerName
|
141
|
+
}, /*#__PURE__*/React.createElement(StyledOverlay, _extends({
|
142
142
|
height: height,
|
143
143
|
role: role
|
144
144
|
}, rest, {
|
@@ -149,10 +149,7 @@ const Overlay = /*#__PURE__*/React.forwardRef(({
|
|
149
149
|
...rest.style,
|
150
150
|
'--styled-overlay-visibility': visibility
|
151
151
|
}
|
152
|
-
}));
|
153
|
-
return /*#__PURE__*/React.createElement(Portal, {
|
154
|
-
containerName: portalContainerName
|
155
|
-
}, styledOverlay);
|
152
|
+
})));
|
156
153
|
});
|
157
154
|
Overlay.defaultProps = {
|
158
155
|
height: 'auto',
|
@@ -32,15 +32,11 @@ declare const _default: React.ForwardRefExoticComponent<Pick<SelectMenuInternalP
|
|
32
32
|
Divider: import("styled-components").StyledComponent<"div", any, SystemCommonProps & SxProp, never>;
|
33
33
|
Filter: React.ForwardRefExoticComponent<Pick<{
|
34
34
|
value?: string | undefined;
|
35
|
-
} &
|
36
|
-
ref?: ((instance: HTMLInputElement | null) => void) | React.RefObject<HTMLInputElement> | null | undefined;
|
37
|
-
}, string | number | symbol> & {
|
35
|
+
} & Pick<{
|
38
36
|
className?: string | undefined;
|
39
37
|
icon?: React.ComponentType<{
|
40
38
|
className?: string | undefined;
|
41
39
|
}> | undefined;
|
42
|
-
inputComponent?: React.ComponentType<HTMLInputElement> | undefined;
|
43
|
-
wrapperRef?: React.RefObject<HTMLSpanElement> | undefined;
|
44
40
|
} & Pick<{
|
45
41
|
color?: string | undefined;
|
46
42
|
maxWidth?: import("styled-system").ResponsiveValue<import("csstype").Property.MaxWidth<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
@@ -319,9 +315,7 @@ declare const _default: React.ForwardRefExoticComponent<Pick<SelectMenuInternalP
|
|
319
315
|
} & {
|
320
316
|
as?: string | React.ComponentType<any> | undefined;
|
321
317
|
forwardedAs?: string | React.ComponentType<any> | undefined;
|
322
|
-
}, string | number | symbol>, "maxWidth" | "minWidth" | "width" | "theme" | "className" | "block" | "icon" | "sx" | "disabled" | "variant" | "contrast" |
|
323
|
-
as?: "input" | undefined;
|
324
|
-
}, string | number | symbol> & React.RefAttributes<HTMLInputElement>>;
|
318
|
+
}, string | number | symbol>, "maxWidth" | "minWidth" | "width" | "theme" | "className" | "block" | "icon" | "sx" | "disabled" | "variant" | "contrast">, string | number | symbol> & React.RefAttributes<HTMLInputElement>, string | number | symbol> & React.RefAttributes<HTMLInputElement>>;
|
325
319
|
Footer: import("styled-components").StyledComponent<"footer", any, SystemCommonProps & SxProp, never>;
|
326
320
|
Item: React.ForwardRefExoticComponent<Pick<{
|
327
321
|
as?: React.ElementType<any> | undefined;
|
package/lib-esm/TextInput.d.ts
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { MaxWidthProps, MinWidthProps, WidthProps } from 'styled-system';
|
3
|
-
import type * as Polymorphic from "@radix-ui/react-polymorphic";
|
4
3
|
import { SxProp } from './sx';
|
5
4
|
import { ComponentProps } from './utils/types';
|
6
|
-
import
|
5
|
+
declare const Input: import("styled-components").StyledComponent<"input", any, {}, never>;
|
7
6
|
declare const Wrapper: import("styled-components").StyledComponent<"span", any, {
|
8
7
|
disabled?: boolean | undefined;
|
9
8
|
hasIcon?: boolean | undefined;
|
@@ -16,10 +15,8 @@ declare type NonPassthroughProps = {
|
|
16
15
|
icon?: React.ComponentType<{
|
17
16
|
className?: string;
|
18
17
|
}>;
|
19
|
-
inputComponent?: React.ComponentType<HTMLInputElement>;
|
20
|
-
wrapperRef?: React.RefObject<HTMLSpanElement>;
|
21
18
|
} & Pick<ComponentProps<typeof Wrapper>, 'block' | 'contrast' | 'disabled' | 'sx' | 'theme' | 'width' | 'maxWidth' | 'minWidth' | 'variant'>;
|
22
|
-
declare type TextInputInternalProps = NonPassthroughProps & Omit<React.ComponentPropsWithoutRef<typeof
|
23
|
-
declare const TextInput:
|
19
|
+
declare type TextInputInternalProps = NonPassthroughProps & Omit<React.ComponentPropsWithoutRef<typeof Input>, keyof NonPassthroughProps>;
|
20
|
+
declare const TextInput: React.ForwardRefExoticComponent<Pick<TextInputInternalProps, string | number | symbol> & React.RefAttributes<HTMLInputElement>>;
|
24
21
|
export declare type TextInputProps = ComponentProps<typeof TextInput>;
|
25
22
|
export default TextInput;
|