@primer/components 0.0.0-202192952423 → 0.0.0-202192953933

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/CHANGELOG.md +17 -1
  2. package/dist/browser.esm.js +16 -12
  3. package/dist/browser.esm.js.map +1 -1
  4. package/dist/browser.umd.js +16 -12
  5. package/dist/browser.umd.js.map +1 -1
  6. package/lib/Autocomplete/Autocomplete.d.ts +28 -28
  7. package/lib/Autocomplete/AutocompleteInput.d.ts +28 -28
  8. package/lib/Button/Button.d.ts +26 -26
  9. package/lib/Button/ButtonBase.d.ts +1 -1
  10. package/lib/Button/ButtonClose.d.ts +27 -27
  11. package/lib/Button/ButtonDanger.d.ts +26 -26
  12. package/lib/Button/ButtonInvisible.d.ts +26 -26
  13. package/lib/Button/ButtonOutline.d.ts +26 -26
  14. package/lib/Button/ButtonPrimary.d.ts +26 -26
  15. package/lib/CircleBadge.d.ts +2 -2
  16. package/lib/CircleOcticon.d.ts +30 -30
  17. package/lib/Dialog.d.ts +33 -33
  18. package/lib/Dropdown.d.ts +112 -112
  19. package/lib/DropdownMenu/DropdownButton.d.ts +28 -28
  20. package/lib/FilterList.d.ts +25 -25
  21. package/lib/Flash.d.ts +1 -1
  22. package/lib/Label.d.ts +1 -1
  23. package/lib/NewButton/button.d.ts +58 -58
  24. package/lib/Position.d.ts +4 -4
  25. package/lib/SelectMenu/SelectMenu.d.ts +159 -159
  26. package/lib/SelectMenu/SelectMenuItem.d.ts +1 -1
  27. package/lib/SelectMenu/SelectMenuModal.d.ts +1 -1
  28. package/lib/TextInputWithTokens.d.ts +32 -28
  29. package/lib/TextInputWithTokens.js +102 -29
  30. package/lib/Timeline.d.ts +31 -31
  31. package/lib/Token/AvatarToken.d.ts +1 -1
  32. package/lib/Token/IssueLabelToken.d.ts +1 -1
  33. package/lib/Token/Token.d.ts +1 -1
  34. package/lib/Token/Token.js +13 -2
  35. package/lib/Token/TokenBase.js +0 -4
  36. package/lib/Token/_RemoveTokenButton.js +15 -2
  37. package/lib/_TextInputWrapper.js +1 -1
  38. package/lib/sx.d.ts +8 -2
  39. package/lib/theme.d.ts +78 -0
  40. package/lib/theme.js +3 -1
  41. package/lib/utils/testing.d.ts +1 -1
  42. package/lib/utils/types/KeyPaths.d.ts +3 -0
  43. package/lib/utils/types/KeyPaths.js +1 -0
  44. package/lib-esm/Autocomplete/Autocomplete.d.ts +28 -28
  45. package/lib-esm/Autocomplete/AutocompleteInput.d.ts +28 -28
  46. package/lib-esm/Button/Button.d.ts +26 -26
  47. package/lib-esm/Button/ButtonBase.d.ts +1 -1
  48. package/lib-esm/Button/ButtonClose.d.ts +27 -27
  49. package/lib-esm/Button/ButtonDanger.d.ts +26 -26
  50. package/lib-esm/Button/ButtonInvisible.d.ts +26 -26
  51. package/lib-esm/Button/ButtonOutline.d.ts +26 -26
  52. package/lib-esm/Button/ButtonPrimary.d.ts +26 -26
  53. package/lib-esm/CircleBadge.d.ts +2 -2
  54. package/lib-esm/CircleOcticon.d.ts +30 -30
  55. package/lib-esm/Dialog.d.ts +33 -33
  56. package/lib-esm/Dropdown.d.ts +112 -112
  57. package/lib-esm/DropdownMenu/DropdownButton.d.ts +28 -28
  58. package/lib-esm/FilterList.d.ts +25 -25
  59. package/lib-esm/Flash.d.ts +1 -1
  60. package/lib-esm/Label.d.ts +1 -1
  61. package/lib-esm/NewButton/button.d.ts +58 -58
  62. package/lib-esm/Position.d.ts +4 -4
  63. package/lib-esm/SelectMenu/SelectMenu.d.ts +159 -159
  64. package/lib-esm/SelectMenu/SelectMenuItem.d.ts +1 -1
  65. package/lib-esm/SelectMenu/SelectMenuModal.d.ts +1 -1
  66. package/lib-esm/TextInputWithTokens.d.ts +32 -28
  67. package/lib-esm/TextInputWithTokens.js +101 -30
  68. package/lib-esm/Timeline.d.ts +31 -31
  69. package/lib-esm/Token/AvatarToken.d.ts +1 -1
  70. package/lib-esm/Token/IssueLabelToken.d.ts +1 -1
  71. package/lib-esm/Token/Token.d.ts +1 -1
  72. package/lib-esm/Token/Token.js +13 -2
  73. package/lib-esm/Token/TokenBase.js +0 -4
  74. package/lib-esm/Token/_RemoveTokenButton.js +11 -2
  75. package/lib-esm/_TextInputWrapper.js +1 -1
  76. package/lib-esm/sx.d.ts +8 -2
  77. package/lib-esm/theme.d.ts +78 -0
  78. package/lib-esm/theme.js +2 -1
  79. package/lib-esm/utils/testing.d.ts +1 -1
  80. package/lib-esm/utils/types/KeyPaths.d.ts +3 -0
  81. package/lib-esm/utils/types/KeyPaths.js +1 -0
  82. package/package.json +2 -1
@@ -10,6 +10,6 @@ declare type SelectMenuItemInteralProps = {
10
10
  as?: React.ElementType;
11
11
  selected?: boolean;
12
12
  } & ComponentProps<typeof StyledItem>;
13
- declare const SelectMenuItem: React.ForwardRefExoticComponent<Pick<SelectMenuItemInteralProps, "translate" | "slot" | "style" | "title" | "theme" | "type" | "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" | "sx" | "as" | keyof SystemCommonProps | "media" | "target" | "href" | "referrerPolicy" | "hrefLang" | "rel" | "selected" | "download" | "ping"> & React.RefAttributes<HTMLAnchorElement>>;
13
+ declare const SelectMenuItem: React.ForwardRefExoticComponent<Pick<SelectMenuItemInteralProps, "translate" | "hidden" | "style" | "slot" | "title" | "theme" | "type" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | "as" | keyof SystemCommonProps | "media" | "target" | "href" | "hrefLang" | "referrerPolicy" | "rel" | "selected" | "download" | "ping"> & React.RefAttributes<HTMLAnchorElement>>;
14
14
  export declare type SelectMenuItemProps = ComponentProps<typeof SelectMenuItem>;
15
15
  export default SelectMenuItem;
@@ -10,6 +10,6 @@ declare const ModalWrapper: import("styled-components").StyledComponent<"div", a
10
10
  align?: "left" | "right" | undefined;
11
11
  } & SystemCommonProps & SxProp, never>;
12
12
  declare type SelectMenuModalInternalProps = Pick<StyledModalProps, 'width'> & ComponentProps<typeof ModalWrapper>;
13
- declare const SelectMenuModal: React.ForwardRefExoticComponent<Pick<SelectMenuModalInternalProps, "backgroundColor" | "color" | "display" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "opacity" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "translate" | "width" | "margin" | "padding" | "bg" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "slot" | "style" | "title" | "theme" | "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" | "sx" | "align"> & React.RefAttributes<HTMLDivElement>>;
13
+ declare const SelectMenuModal: React.ForwardRefExoticComponent<Pick<SelectMenuModalInternalProps, "backgroundColor" | "color" | "display" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "opacity" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "translate" | "width" | "margin" | "padding" | "bg" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "hidden" | "style" | "slot" | "title" | "theme" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | "align"> & React.RefAttributes<HTMLDivElement>>;
14
14
  export declare type SelectMenuModalProps = ComponentProps<typeof SelectMenuModal>;
15
15
  export default SelectMenuModal;
@@ -32,6 +32,10 @@ declare const TextInputWithTokens: React.ForwardRefExoticComponent<Pick<{
32
32
  * Whether the remove buttons should be rendered in the tokens
33
33
  */
34
34
  hideTokenRemoveButtons?: boolean | undefined;
35
+ /**
36
+ * The number of tokens to display before truncating
37
+ */
38
+ visibleTokenCount?: number | undefined;
35
39
  } & Pick<Omit<Pick<{
36
40
  [x: string]: any;
37
41
  [x: number]: any;
@@ -40,7 +44,7 @@ declare const TextInputWithTokens: React.ForwardRefExoticComponent<Pick<{
40
44
  } & {
41
45
  as?: string | React.ComponentType<any> | undefined;
42
46
  forwardedAs?: string | React.ComponentType<any> | undefined;
43
- }, string | number | symbol>, "maxWidth" | "minWidth" | "width" | "theme" | "className" | "block" | "icon" | "sx" | "disabled" | "variant" | "contrast"> & {
47
+ }, string | number | symbol>, "maxWidth" | "minWidth" | "width" | "block" | "icon" | "theme" | "className" | "sx" | "disabled" | "variant" | "contrast"> & {
44
48
  className?: string | undefined;
45
49
  icon?: React.ComponentType<{
46
50
  className?: string | undefined;
@@ -51,8 +55,10 @@ declare const TextInputWithTokens: React.ForwardRefExoticComponent<Pick<{
51
55
  minWidth?: import("styled-system").ResponsiveValue<import("csstype").Property.MinWidth<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
52
56
  translate?: "yes" | "no" | undefined;
53
57
  width?: import("styled-system").ResponsiveValue<import("csstype").Property.Width<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
54
- slot?: string | undefined;
58
+ hidden?: boolean | undefined;
55
59
  style?: React.CSSProperties | undefined;
60
+ block?: boolean | undefined;
61
+ slot?: string | undefined;
56
62
  title?: string | undefined;
57
63
  ref?: ((instance: HTMLSpanElement | null) => void) | React.RefObject<HTMLSpanElement> | null | undefined;
58
64
  key?: React.Key | null | undefined;
@@ -62,15 +68,14 @@ declare const TextInputWithTokens: React.ForwardRefExoticComponent<Pick<{
62
68
  suppressHydrationWarning?: boolean | undefined;
63
69
  accessKey?: string | undefined;
64
70
  className?: string | undefined;
65
- contentEditable?: (boolean | "true" | "false") | "inherit" | undefined;
71
+ contentEditable?: "inherit" | (boolean | "false" | "true") | undefined;
66
72
  contextMenu?: string | undefined;
67
73
  dir?: string | undefined;
68
- draggable?: (boolean | "true" | "false") | undefined;
69
- hidden?: boolean | undefined;
74
+ draggable?: (boolean | "false" | "true") | undefined;
70
75
  id?: string | undefined;
71
76
  lang?: string | undefined;
72
77
  placeholder?: string | undefined;
73
- spellCheck?: (boolean | "true" | "false") | undefined;
78
+ spellCheck?: (boolean | "false" | "true") | undefined;
74
79
  tabIndex?: number | undefined;
75
80
  radioGroup?: string | undefined;
76
81
  role?: React.AriaRole | undefined;
@@ -93,50 +98,50 @@ declare const TextInputWithTokens: React.ForwardRefExoticComponent<Pick<{
93
98
  results?: number | undefined;
94
99
  security?: string | undefined;
95
100
  unselectable?: "on" | "off" | undefined;
96
- inputMode?: "none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
101
+ inputMode?: "search" | "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
97
102
  is?: string | undefined;
98
103
  'aria-activedescendant'?: string | undefined;
99
- 'aria-atomic'?: boolean | "true" | "false" | undefined;
100
- 'aria-autocomplete'?: "list" | "none" | "inline" | "both" | undefined;
101
- 'aria-busy'?: boolean | "true" | "false" | undefined;
102
- 'aria-checked'?: boolean | "true" | "false" | "mixed" | undefined;
104
+ 'aria-atomic'?: boolean | "false" | "true" | undefined;
105
+ 'aria-autocomplete'?: "none" | "both" | "inline" | "list" | undefined;
106
+ 'aria-busy'?: boolean | "false" | "true" | undefined;
107
+ 'aria-checked'?: boolean | "mixed" | "false" | "true" | undefined;
103
108
  'aria-colcount'?: number | undefined;
104
109
  'aria-colindex'?: number | undefined;
105
110
  'aria-colspan'?: number | undefined;
106
111
  'aria-controls'?: string | undefined;
107
- 'aria-current'?: boolean | "time" | "true" | "false" | "page" | "step" | "location" | "date" | undefined;
112
+ 'aria-current'?: boolean | "page" | "false" | "true" | "time" | "step" | "location" | "date" | undefined;
108
113
  'aria-describedby'?: string | undefined;
109
114
  'aria-details'?: string | undefined;
110
- 'aria-disabled'?: boolean | "true" | "false" | undefined;
115
+ 'aria-disabled'?: boolean | "false" | "true" | undefined;
111
116
  'aria-dropeffect'?: "link" | "none" | "copy" | "move" | "execute" | "popup" | undefined;
112
117
  'aria-errormessage'?: string | undefined;
113
- 'aria-expanded'?: boolean | "true" | "false" | undefined;
118
+ 'aria-expanded'?: boolean | "false" | "true" | undefined;
114
119
  'aria-flowto'?: string | undefined;
115
- 'aria-grabbed'?: boolean | "true" | "false" | undefined;
116
- 'aria-haspopup'?: boolean | "grid" | "dialog" | "listbox" | "menu" | "tree" | "true" | "false" | undefined;
117
- 'aria-hidden'?: boolean | "true" | "false" | undefined;
118
- 'aria-invalid'?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
120
+ 'aria-grabbed'?: boolean | "false" | "true" | undefined;
121
+ 'aria-haspopup'?: boolean | "grid" | "listbox" | "menu" | "false" | "true" | "dialog" | "tree" | undefined;
122
+ 'aria-hidden'?: boolean | "false" | "true" | undefined;
123
+ 'aria-invalid'?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
119
124
  'aria-keyshortcuts'?: string | undefined;
120
125
  'aria-label'?: string | undefined;
121
126
  'aria-labelledby'?: string | undefined;
122
127
  'aria-level'?: number | undefined;
123
128
  'aria-live'?: "off" | "assertive" | "polite" | undefined;
124
- 'aria-modal'?: boolean | "true" | "false" | undefined;
125
- 'aria-multiline'?: boolean | "true" | "false" | undefined;
126
- 'aria-multiselectable'?: boolean | "true" | "false" | undefined;
129
+ 'aria-modal'?: boolean | "false" | "true" | undefined;
130
+ 'aria-multiline'?: boolean | "false" | "true" | undefined;
131
+ 'aria-multiselectable'?: boolean | "false" | "true" | undefined;
127
132
  'aria-orientation'?: "horizontal" | "vertical" | undefined;
128
133
  'aria-owns'?: string | undefined;
129
134
  'aria-placeholder'?: string | undefined;
130
135
  'aria-posinset'?: number | undefined;
131
- 'aria-pressed'?: boolean | "true" | "false" | "mixed" | undefined;
132
- 'aria-readonly'?: boolean | "true" | "false" | undefined;
136
+ 'aria-pressed'?: boolean | "mixed" | "false" | "true" | undefined;
137
+ 'aria-readonly'?: boolean | "false" | "true" | undefined;
133
138
  'aria-relevant'?: "all" | "text" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
134
- 'aria-required'?: boolean | "true" | "false" | undefined;
139
+ 'aria-required'?: boolean | "false" | "true" | undefined;
135
140
  'aria-roledescription'?: string | undefined;
136
141
  'aria-rowcount'?: number | undefined;
137
142
  'aria-rowindex'?: number | undefined;
138
143
  'aria-rowspan'?: number | undefined;
139
- 'aria-selected'?: boolean | "true" | "false" | undefined;
144
+ 'aria-selected'?: boolean | "false" | "true" | undefined;
140
145
  'aria-setsize'?: number | undefined;
141
146
  'aria-sort'?: "none" | "ascending" | "descending" | "other" | undefined;
142
147
  'aria-valuemax'?: number | undefined;
@@ -307,15 +312,14 @@ declare const TextInputWithTokens: React.ForwardRefExoticComponent<Pick<{
307
312
  onAnimationIterationCapture?: React.AnimationEventHandler<HTMLSpanElement> | undefined;
308
313
  onTransitionEnd?: React.TransitionEventHandler<HTMLSpanElement> | undefined;
309
314
  onTransitionEndCapture?: React.TransitionEventHandler<HTMLSpanElement> | undefined;
310
- block?: boolean | undefined;
311
- sx?: import("@styled-system/css").SystemStyleObject | undefined;
315
+ sx?: import("./sx").BetterSystemStyleObject | undefined;
312
316
  disabled?: boolean | undefined;
313
317
  variant?: "small" | "large" | undefined;
314
318
  hasIcon?: boolean | undefined;
315
319
  contrast?: boolean | undefined;
316
320
  } & {
317
321
  theme?: any;
318
- }, "maxWidth" | "minWidth" | "width" | "theme" | "block" | "sx" | "disabled" | "variant" | "contrast">, string | number | symbol> & React.RefAttributes<HTMLInputElement> & {
322
+ }, "maxWidth" | "minWidth" | "width" | "block" | "theme" | "sx" | "disabled" | "variant" | "contrast">, string | number | symbol> & React.RefAttributes<HTMLInputElement> & {
319
323
  selectedTokenIndex: number | undefined;
320
324
  setSelectedTokenIndex: React.Dispatch<React.SetStateAction<number | undefined>>;
321
325
  }, string | number | symbol> & React.RefAttributes<HTMLInputElement>>;
@@ -9,9 +9,17 @@ import Token from './Token/Token';
9
9
  import { useProvidedRefOrCreate } from './hooks';
10
10
  import UnstyledTextInput from './_UnstyledTextInput';
11
11
  import TextInputWrapper from './_TextInputWrapper';
12
- import Box from './Box'; // eslint-disable-next-line @typescript-eslint/no-explicit-any
12
+ import Box from './Box';
13
+ import Text from './Text';
14
+ import { isFocusable } from './utils/iterateFocusableElements'; // eslint-disable-next-line @typescript-eslint/no-explicit-any
15
+
16
+ const overflowCountFontSizeMap = {
17
+ small: 0,
18
+ medium: 1,
19
+ large: 1,
20
+ extralarge: 2
21
+ }; // using forwardRef is important so that other components (ex. Autocomplete) can use the ref
13
22
 
14
- // using forwardRef is important so that other components (ex. Autocomplete) can use the ref
15
23
  function TextInputWithTokensInnerComponent({
16
24
  icon: IconComponent,
17
25
  contrast,
@@ -31,9 +39,11 @@ function TextInputWithTokensInnerComponent({
31
39
  minWidth: minWidthProp,
32
40
  maxWidth: maxWidthProp,
33
41
  variant: variantProp,
42
+ visibleTokenCount,
34
43
  ...rest
35
44
  }, externalRef) {
36
45
  const {
46
+ onBlur,
37
47
  onFocus,
38
48
  onKeyDown,
39
49
  ...inputPropsRest
@@ -42,6 +52,7 @@ function TextInputWithTokensInnerComponent({
42
52
  const localInputRef = useRef(null);
43
53
  const combinedInputRef = useCombinedRefs(localInputRef, ref);
44
54
  const [selectedTokenIndex, setSelectedTokenIndex] = useState();
55
+ const [tokensAreTruncated, setTokensAreTruncated] = useState(Boolean(visibleTokenCount));
45
56
  const {
46
57
  containerRef
47
58
  } = useFocusZone({
@@ -76,14 +87,25 @@ function TextInputWithTokensInnerComponent({
76
87
  }, [selectedTokenIndex]);
77
88
 
78
89
  const handleTokenRemove = tokenId => {
79
- onTokenRemove(tokenId);
90
+ onTokenRemove(tokenId); // HACK: wait a tick for the the token node to be removed from the DOM
80
91
 
81
- if (selectedTokenIndex) {
82
- var _containerRef$current2;
92
+ setTimeout(() => {
93
+ var _containerRef$current2, _containerRef$current3;
83
94
 
84
- const nextElementToFocus = (_containerRef$current2 = containerRef.current) === null || _containerRef$current2 === void 0 ? void 0 : _containerRef$current2.children[selectedTokenIndex];
85
- nextElementToFocus.focus();
86
- }
95
+ const nextElementToFocus = (_containerRef$current2 = containerRef.current) === null || _containerRef$current2 === void 0 ? void 0 : _containerRef$current2.children[selectedTokenIndex || 0]; // when removing the first token by keying "Backspace" or "Delete",
96
+ // `nextFocusableElement` is the div that wraps the input
97
+
98
+ const firstFocusable = nextElementToFocus && isFocusable(nextElementToFocus) ? nextElementToFocus : Array.from(((_containerRef$current3 = containerRef.current) === null || _containerRef$current3 === void 0 ? void 0 : _containerRef$current3.children) || []).find(el => isFocusable(el));
99
+
100
+ if (firstFocusable) {
101
+ firstFocusable.focus();
102
+ } else {
103
+ var _ref$current;
104
+
105
+ // if there are no tokens left, focus the input
106
+ (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.focus();
107
+ }
108
+ }, 0);
87
109
  };
88
110
 
89
111
  const handleTokenFocus = tokenIndex => () => {
@@ -91,30 +113,55 @@ function TextInputWithTokensInnerComponent({
91
113
  };
92
114
 
93
115
  const handleTokenBlur = () => {
94
- setSelectedTokenIndex(undefined);
116
+ setSelectedTokenIndex(undefined); // HACK: wait a tick and check the focused element before hiding truncated tokens
117
+ // this prevents the tokens from hiding when the user is moving focus between tokens,
118
+ // but still hides the tokens when the user blurs the token by tabbing out or clicking somewhere else on the page
119
+
120
+ setTimeout(() => {
121
+ var _containerRef$current4;
122
+
123
+ if (!((_containerRef$current4 = containerRef.current) !== null && _containerRef$current4 !== void 0 && _containerRef$current4.contains(document.activeElement)) && visibleTokenCount) {
124
+ setTokensAreTruncated(true);
125
+ }
126
+ }, 0);
95
127
  };
96
128
 
97
- const handleTokenKeyUp = e => {
98
- if (e.key === 'Escape') {
99
- var _ref$current;
129
+ const handleTokenKeyUp = event => {
130
+ if (event.key === 'Escape') {
131
+ var _ref$current2;
100
132
 
101
- (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.focus();
133
+ (_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.focus();
102
134
  }
103
135
  };
104
136
 
105
- const handleInputFocus = e => {
106
- onFocus && onFocus(e);
137
+ const handleInputFocus = event => {
138
+ onFocus && onFocus(event);
107
139
  setSelectedTokenIndex(undefined);
140
+ visibleTokenCount && setTokensAreTruncated(false);
141
+ };
142
+
143
+ const handleInputBlur = event => {
144
+ onBlur && onBlur(event); // HACK: wait a tick and check the focused element before hiding truncated tokens
145
+ // this prevents the tokens from hiding when the user is moving focus from the input to a token,
146
+ // but still hides the tokens when the user blurs the input by tabbing out or clicking somewhere else on the page
147
+
148
+ setTimeout(() => {
149
+ var _containerRef$current5;
150
+
151
+ if (!((_containerRef$current5 = containerRef.current) !== null && _containerRef$current5 !== void 0 && _containerRef$current5.contains(document.activeElement)) && visibleTokenCount) {
152
+ setTokensAreTruncated(true);
153
+ }
154
+ }, 0);
108
155
  };
109
156
 
110
157
  const handleInputKeyDown = e => {
111
- var _ref$current2;
158
+ var _ref$current3;
112
159
 
113
160
  if (onKeyDown) {
114
161
  onKeyDown(e);
115
162
  }
116
163
 
117
- if ((_ref$current2 = ref.current) !== null && _ref$current2 !== void 0 && _ref$current2.value) {
164
+ if ((_ref$current3 = ref.current) !== null && _ref$current3 !== void 0 && _ref$current3.value) {
118
165
  return;
119
166
  }
120
167
 
@@ -135,13 +182,24 @@ function TextInputWithTokensInnerComponent({
135
182
 
136
183
 
137
184
  setTimeout(() => {
138
- var _ref$current3;
185
+ var _ref$current4;
139
186
 
140
- (_ref$current3 = ref.current) === null || _ref$current3 === void 0 ? void 0 : _ref$current3.select();
187
+ (_ref$current4 = ref.current) === null || _ref$current4 === void 0 ? void 0 : _ref$current4.select();
141
188
  }, 0);
142
189
  }
143
190
  };
144
191
 
192
+ const focusInput = () => {
193
+ var _combinedInputRef$cur;
194
+
195
+ (_combinedInputRef$cur = combinedInputRef.current) === null || _combinedInputRef$cur === void 0 ? void 0 : _combinedInputRef$cur.focus();
196
+ };
197
+
198
+ const preventTokenClickPropagation = event => {
199
+ event.stopPropagation();
200
+ };
201
+
202
+ const visibleTokens = tokensAreTruncated ? tokens.slice(0, visibleTokenCount) : tokens;
145
203
  return /*#__PURE__*/React.createElement(TextInputWrapper, {
146
204
  block: block,
147
205
  className: className,
@@ -153,15 +211,8 @@ function TextInputWithTokensInnerComponent({
153
211
  minWidth: minWidthProp,
154
212
  maxWidth: maxWidthProp,
155
213
  variant: variantProp,
156
- ref: containerRef,
157
- sx: {
158
- alignItems: 'center',
159
- flexWrap: preventTokenWrapping ? 'nowrap' : 'wrap',
160
- gap: '0.25rem',
161
- '> *': {
162
- flexShrink: 0
163
- },
164
- ...(block ? {
214
+ onClick: focusInput,
215
+ sx: { ...(block ? {
165
216
  display: 'flex',
166
217
  width: '100%'
167
218
  } : {}),
@@ -174,6 +225,21 @@ function TextInputWithTokensInnerComponent({
174
225
  } : {}),
175
226
  ...sxProp
176
227
  }
228
+ }, /*#__PURE__*/React.createElement(Box, {
229
+ ref: containerRef,
230
+ display: "flex",
231
+ sx: {
232
+ alignItems: 'center',
233
+ flexWrap: preventTokenWrapping ? 'nowrap' : 'wrap',
234
+ marginLeft: '-0.25rem',
235
+ marginBottom: '-0.25rem',
236
+ flexGrow: 1,
237
+ '> *': {
238
+ flexShrink: 0,
239
+ marginLeft: '0.25rem',
240
+ marginBottom: '0.25rem'
241
+ }
242
+ }
177
243
  }, /*#__PURE__*/React.createElement(Box, {
178
244
  sx: {
179
245
  order: 1,
@@ -185,12 +251,13 @@ function TextInputWithTokensInnerComponent({
185
251
  ref: combinedInputRef,
186
252
  disabled: disabled,
187
253
  onFocus: handleInputFocus,
254
+ onBlur: handleInputBlur,
188
255
  onKeyDown: handleInputKeyDown,
189
256
  type: "text",
190
257
  sx: {
191
258
  height: '100%'
192
259
  }
193
- }, inputPropsRest))), tokens.length && TokenComponent ? tokens.map(({
260
+ }, inputPropsRest))), TokenComponent ? visibleTokens.map(({
194
261
  id,
195
262
  ...tokenRest
196
263
  }, i) => /*#__PURE__*/React.createElement(TokenComponent, _extends({
@@ -198,6 +265,7 @@ function TextInputWithTokensInnerComponent({
198
265
  onFocus: handleTokenFocus(i),
199
266
  onBlur: handleTokenBlur,
200
267
  onKeyUp: handleTokenKeyUp,
268
+ onClick: preventTokenClickPropagation,
201
269
  isSelected: selectedTokenIndex === i,
202
270
  onRemove: () => {
203
271
  handleTokenRemove(id);
@@ -205,7 +273,10 @@ function TextInputWithTokensInnerComponent({
205
273
  hideRemoveButton: hideTokenRemoveButtons,
206
274
  size: size,
207
275
  tabIndex: 0
208
- }, tokenRest))) : null);
276
+ }, tokenRest))) : null, tokensAreTruncated ? /*#__PURE__*/React.createElement(Text, {
277
+ color: "fg.muted",
278
+ fontSize: size && overflowCountFontSizeMap[size]
279
+ }, "+", tokens.length - visibleTokens.length) : null));
209
280
  }
210
281
 
211
282
  TextInputWithTokensInnerComponent.displayName = "TextInputWithTokensInnerComponent";
@@ -22,6 +22,8 @@ declare const _default: string & import("styled-components").StyledComponentBase
22
22
  Item: import("styled-components").StyledComponent<"div", any, import("styled-system").SpaceProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("styled-system").ColorProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("styled-system").TypographyProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").LayoutProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").FlexboxProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").GridProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").BackgroundProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.Background<import("styled-system").TLengthStyledSystem>> & import("styled-system").BorderProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.Border<import("styled-system").TLengthStyledSystem>> & import("styled-system").PositionProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").ShadowProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("./sx").SxProp & StyledTimelineItemProps, never>;
23
23
  Badge: {
24
24
  (props: {
25
+ lineHeight?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
26
+ border?: import("styled-system").ResponsiveValue<import("csstype").Property.Border<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
25
27
  boxShadow?: import("styled-system").ResponsiveValue<number | import("csstype").Property.BoxShadow, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
26
28
  fontWeight?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
27
29
  zIndex?: import("styled-system").ResponsiveValue<import("csstype").Property.ZIndex, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
@@ -71,7 +73,6 @@ declare const _default: string & import("styled-components").StyledComponentBase
71
73
  justifySelf?: import("styled-system").ResponsiveValue<import("csstype").Property.JustifySelf, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
72
74
  left?: import("styled-system").ResponsiveValue<import("csstype").Property.Left<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
73
75
  letterSpacing?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
74
- lineHeight?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
75
76
  marginBottom?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
76
77
  marginLeft?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
77
78
  marginRight?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
@@ -98,7 +99,6 @@ declare const _default: string & import("styled-components").StyledComponentBase
98
99
  width?: import("styled-system").ResponsiveValue<import("csstype").Property.Width<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
99
100
  background?: import("styled-system").ResponsiveValue<import("csstype").Property.Background<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
100
101
  backgroundPosition?: import("styled-system").ResponsiveValue<import("csstype").Property.BackgroundPosition<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
101
- border?: import("styled-system").ResponsiveValue<import("csstype").Property.Border<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
102
102
  borderBottom?: import("styled-system").ResponsiveValue<import("csstype").Property.BorderBottom<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
103
103
  borderColor?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
104
104
  borderLeft?: import("styled-system").ResponsiveValue<import("csstype").Property.BorderLeft<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
@@ -133,8 +133,13 @@ declare const _default: string & import("styled-components").StyledComponentBase
133
133
  paddingX?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
134
134
  py?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
135
135
  paddingY?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
136
- slot?: string | undefined;
136
+ hidden?: boolean | undefined;
137
+ size?: import("styled-system").ResponsiveValue<import("csstype").Property.Height<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
137
138
  style?: React.CSSProperties | undefined;
139
+ gridColumnGap?: import("styled-system").ResponsiveValue<import("csstype").Property.GridColumnGap<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
140
+ gridGap?: import("styled-system").ResponsiveValue<import("csstype").Property.GridGap<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
141
+ gridRowGap?: import("styled-system").ResponsiveValue<import("csstype").Property.GridRowGap<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
142
+ slot?: string | undefined;
138
143
  title?: string | undefined;
139
144
  ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
140
145
  key?: React.Key | null | undefined;
@@ -144,15 +149,14 @@ declare const _default: string & import("styled-components").StyledComponentBase
144
149
  suppressHydrationWarning?: boolean | undefined;
145
150
  accessKey?: string | undefined;
146
151
  className?: string | undefined;
147
- contentEditable?: (boolean | "true" | "false") | "inherit" | undefined;
152
+ contentEditable?: "inherit" | (boolean | "false" | "true") | undefined;
148
153
  contextMenu?: string | undefined;
149
154
  dir?: string | undefined;
150
- draggable?: (boolean | "true" | "false") | undefined;
151
- hidden?: boolean | undefined;
155
+ draggable?: (boolean | "false" | "true") | undefined;
152
156
  id?: string | undefined;
153
157
  lang?: string | undefined;
154
158
  placeholder?: string | undefined;
155
- spellCheck?: (boolean | "true" | "false") | undefined;
159
+ spellCheck?: (boolean | "false" | "true") | undefined;
156
160
  tabIndex?: number | undefined;
157
161
  radioGroup?: string | undefined;
158
162
  role?: React.AriaRole | undefined;
@@ -175,50 +179,50 @@ declare const _default: string & import("styled-components").StyledComponentBase
175
179
  results?: number | undefined;
176
180
  security?: string | undefined;
177
181
  unselectable?: "on" | "off" | undefined;
178
- inputMode?: "none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
182
+ inputMode?: "search" | "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
179
183
  is?: string | undefined;
180
184
  'aria-activedescendant'?: string | undefined;
181
- 'aria-atomic'?: boolean | "true" | "false" | undefined;
182
- 'aria-autocomplete'?: "list" | "none" | "inline" | "both" | undefined;
183
- 'aria-busy'?: boolean | "true" | "false" | undefined;
184
- 'aria-checked'?: boolean | "true" | "false" | "mixed" | undefined;
185
+ 'aria-atomic'?: boolean | "false" | "true" | undefined;
186
+ 'aria-autocomplete'?: "none" | "both" | "inline" | "list" | undefined;
187
+ 'aria-busy'?: boolean | "false" | "true" | undefined;
188
+ 'aria-checked'?: boolean | "mixed" | "false" | "true" | undefined;
185
189
  'aria-colcount'?: number | undefined;
186
190
  'aria-colindex'?: number | undefined;
187
191
  'aria-colspan'?: number | undefined;
188
192
  'aria-controls'?: string | undefined;
189
- 'aria-current'?: boolean | "time" | "true" | "false" | "page" | "step" | "location" | "date" | undefined;
193
+ 'aria-current'?: boolean | "page" | "false" | "true" | "time" | "step" | "location" | "date" | undefined;
190
194
  'aria-describedby'?: string | undefined;
191
195
  'aria-details'?: string | undefined;
192
- 'aria-disabled'?: boolean | "true" | "false" | undefined;
196
+ 'aria-disabled'?: boolean | "false" | "true" | undefined;
193
197
  'aria-dropeffect'?: "link" | "none" | "copy" | "move" | "execute" | "popup" | undefined;
194
198
  'aria-errormessage'?: string | undefined;
195
- 'aria-expanded'?: boolean | "true" | "false" | undefined;
199
+ 'aria-expanded'?: boolean | "false" | "true" | undefined;
196
200
  'aria-flowto'?: string | undefined;
197
- 'aria-grabbed'?: boolean | "true" | "false" | undefined;
198
- 'aria-haspopup'?: boolean | "grid" | "dialog" | "listbox" | "menu" | "tree" | "true" | "false" | undefined;
199
- 'aria-hidden'?: boolean | "true" | "false" | undefined;
200
- 'aria-invalid'?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
201
+ 'aria-grabbed'?: boolean | "false" | "true" | undefined;
202
+ 'aria-haspopup'?: boolean | "grid" | "listbox" | "menu" | "false" | "true" | "dialog" | "tree" | undefined;
203
+ 'aria-hidden'?: boolean | "false" | "true" | undefined;
204
+ 'aria-invalid'?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
201
205
  'aria-keyshortcuts'?: string | undefined;
202
206
  'aria-label'?: string | undefined;
203
207
  'aria-labelledby'?: string | undefined;
204
208
  'aria-level'?: number | undefined;
205
209
  'aria-live'?: "off" | "assertive" | "polite" | undefined;
206
- 'aria-modal'?: boolean | "true" | "false" | undefined;
207
- 'aria-multiline'?: boolean | "true" | "false" | undefined;
208
- 'aria-multiselectable'?: boolean | "true" | "false" | undefined;
210
+ 'aria-modal'?: boolean | "false" | "true" | undefined;
211
+ 'aria-multiline'?: boolean | "false" | "true" | undefined;
212
+ 'aria-multiselectable'?: boolean | "false" | "true" | undefined;
209
213
  'aria-orientation'?: "horizontal" | "vertical" | undefined;
210
214
  'aria-owns'?: string | undefined;
211
215
  'aria-placeholder'?: string | undefined;
212
216
  'aria-posinset'?: number | undefined;
213
- 'aria-pressed'?: boolean | "true" | "false" | "mixed" | undefined;
214
- 'aria-readonly'?: boolean | "true" | "false" | undefined;
217
+ 'aria-pressed'?: boolean | "mixed" | "false" | "true" | undefined;
218
+ 'aria-readonly'?: boolean | "false" | "true" | undefined;
215
219
  'aria-relevant'?: "all" | "text" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
216
- 'aria-required'?: boolean | "true" | "false" | undefined;
220
+ 'aria-required'?: boolean | "false" | "true" | undefined;
217
221
  'aria-roledescription'?: string | undefined;
218
222
  'aria-rowcount'?: number | undefined;
219
223
  'aria-rowindex'?: number | undefined;
220
224
  'aria-rowspan'?: number | undefined;
221
- 'aria-selected'?: boolean | "true" | "false" | undefined;
225
+ 'aria-selected'?: boolean | "false" | "true" | undefined;
222
226
  'aria-setsize'?: number | undefined;
223
227
  'aria-sort'?: "none" | "ascending" | "descending" | "other" | undefined;
224
228
  'aria-valuemax'?: number | undefined;
@@ -389,13 +393,9 @@ declare const _default: string & import("styled-components").StyledComponentBase
389
393
  onAnimationIterationCapture?: React.AnimationEventHandler<HTMLDivElement> | undefined;
390
394
  onTransitionEnd?: React.TransitionEventHandler<HTMLDivElement> | undefined;
391
395
  onTransitionEndCapture?: React.TransitionEventHandler<HTMLDivElement> | undefined;
392
- gridColumnGap?: import("styled-system").ResponsiveValue<import("csstype").Property.GridColumnGap<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
393
- gridGap?: import("styled-system").ResponsiveValue<import("csstype").Property.GridGap<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
394
- gridRowGap?: import("styled-system").ResponsiveValue<import("csstype").Property.GridRowGap<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
395
- size?: import("styled-system").ResponsiveValue<import("csstype").Property.Height<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
396
396
  borderX?: import("styled-system").ResponsiveValue<import("csstype").Property.Border<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
397
397
  borderY?: import("styled-system").ResponsiveValue<import("csstype").Property.Border<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
398
- sx?: import("@styled-system/css").SystemStyleObject | undefined;
398
+ sx?: import("./sx").BetterSystemStyleObject | undefined;
399
399
  } & {
400
400
  theme?: any;
401
401
  }): JSX.Element;