@primer/components 0.0.0-2021929153151 → 0.0.0-202192923313

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 (186) hide show
  1. package/CHANGELOG.md +1 -25
  2. package/dist/browser.esm.js +49 -53
  3. package/dist/browser.esm.js.map +1 -1
  4. package/dist/browser.umd.js +46 -50
  5. package/dist/browser.umd.js.map +1 -1
  6. package/lib/ActionList/Item.d.ts +0 -6
  7. package/lib/ActionList/Item.js +1 -5
  8. package/lib/AnchoredOverlay/AnchoredOverlay.d.ts +4 -2
  9. package/lib/Autocomplete/Autocomplete.d.ts +32 -30
  10. package/lib/Autocomplete/AutocompleteInput.d.ts +32 -30
  11. package/lib/Button/Button.d.ts +27 -27
  12. package/lib/Button/ButtonBase.d.ts +1 -1
  13. package/lib/Button/ButtonClose.d.ts +45 -45
  14. package/lib/Button/ButtonDanger.d.ts +27 -27
  15. package/lib/Button/ButtonInvisible.d.ts +27 -27
  16. package/lib/Button/ButtonOutline.d.ts +27 -27
  17. package/lib/Button/ButtonPrimary.d.ts +27 -27
  18. package/lib/CircleBadge.d.ts +2 -2
  19. package/lib/CircleOcticon.d.ts +43 -43
  20. package/lib/DatePicker/DatePicker.d.ts +48 -0
  21. package/lib/DatePicker/DatePicker.js +106 -0
  22. package/lib/DatePicker/DatePickerAnchor.d.ts +5 -0
  23. package/lib/DatePicker/DatePickerAnchor.js +223 -0
  24. package/lib/DatePicker/DatePickerOverlay.d.ts +3 -0
  25. package/lib/DatePicker/DatePickerOverlay.js +48 -0
  26. package/lib/DatePicker/DatePickerPanel.d.ts +2 -0
  27. package/lib/DatePicker/DatePickerPanel.js +126 -0
  28. package/lib/DatePicker/Day.d.ts +14 -0
  29. package/lib/DatePicker/Day.js +192 -0
  30. package/lib/DatePicker/Month.d.ts +9 -0
  31. package/lib/DatePicker/Month.js +122 -0
  32. package/lib/DatePicker/dateParser.d.ts +11 -0
  33. package/lib/DatePicker/dateParser.js +192 -0
  34. package/lib/DatePicker/index.d.ts +2 -0
  35. package/lib/DatePicker/index.js +13 -0
  36. package/lib/DatePicker/useDatePicker.d.ts +89 -0
  37. package/lib/DatePicker/useDatePicker.js +439 -0
  38. package/lib/Dialog.d.ts +46 -46
  39. package/lib/Dropdown.d.ts +178 -178
  40. package/lib/DropdownMenu/DropdownButton.d.ts +47 -47
  41. package/lib/FilterList.d.ts +42 -42
  42. package/lib/Flash.d.ts +1 -1
  43. package/lib/Label.d.ts +1 -1
  44. package/lib/Position.d.ts +4 -4
  45. package/lib/ProgressBar.d.ts +1 -1
  46. package/lib/SelectMenu/SelectMenu.d.ts +248 -246
  47. package/lib/SelectMenu/SelectMenuItem.d.ts +1 -1
  48. package/lib/SelectMenu/SelectMenuModal.d.ts +1 -1
  49. package/lib/TextInputWithTokens.d.ts +32 -34
  50. package/lib/TextInputWithTokens.js +29 -102
  51. package/lib/Timeline.d.ts +44 -44
  52. package/lib/Token/AvatarToken.d.ts +1 -1
  53. package/lib/Token/IssueLabelToken.d.ts +1 -1
  54. package/lib/Token/Token.d.ts +1 -1
  55. package/lib/Token/Token.js +2 -13
  56. package/lib/Token/TokenBase.js +4 -0
  57. package/lib/Token/_RemoveTokenButton.js +2 -15
  58. package/lib/_TextInputWrapper.d.ts +1 -1
  59. package/lib/_TextInputWrapper.js +1 -1
  60. package/lib/hooks/useDebounce.d.ts +2 -0
  61. package/lib/hooks/useDebounce.js +24 -0
  62. package/lib/sx.d.ts +2 -10
  63. package/lib/sx.js +0 -8
  64. package/lib/theme-preval.js +2 -2
  65. package/lib/theme.d.ts +0 -78
  66. package/lib/theme.js +1 -3
  67. package/lib/utils/testing.d.ts +1 -1
  68. package/lib-esm/ActionList/Item.d.ts +0 -6
  69. package/lib-esm/ActionList/Item.js +1 -5
  70. package/lib-esm/AnchoredOverlay/AnchoredOverlay.d.ts +4 -2
  71. package/lib-esm/Autocomplete/Autocomplete.d.ts +32 -30
  72. package/lib-esm/Autocomplete/AutocompleteInput.d.ts +32 -30
  73. package/lib-esm/Button/Button.d.ts +27 -27
  74. package/lib-esm/Button/ButtonBase.d.ts +1 -1
  75. package/lib-esm/Button/ButtonClose.d.ts +45 -45
  76. package/lib-esm/Button/ButtonDanger.d.ts +27 -27
  77. package/lib-esm/Button/ButtonInvisible.d.ts +27 -27
  78. package/lib-esm/Button/ButtonOutline.d.ts +27 -27
  79. package/lib-esm/Button/ButtonPrimary.d.ts +27 -27
  80. package/lib-esm/CircleBadge.d.ts +2 -2
  81. package/lib-esm/CircleOcticon.d.ts +43 -43
  82. package/lib-esm/DatePicker/DatePicker.d.ts +48 -0
  83. package/lib-esm/DatePicker/DatePicker.js +89 -0
  84. package/lib-esm/DatePicker/DatePickerAnchor.d.ts +5 -0
  85. package/lib-esm/DatePicker/DatePickerAnchor.js +196 -0
  86. package/lib-esm/DatePicker/DatePickerOverlay.d.ts +3 -0
  87. package/lib-esm/DatePicker/DatePickerOverlay.js +29 -0
  88. package/lib-esm/DatePicker/DatePickerPanel.d.ts +2 -0
  89. package/lib-esm/DatePicker/DatePickerPanel.js +100 -0
  90. package/lib-esm/DatePicker/Day.d.ts +14 -0
  91. package/lib-esm/DatePicker/Day.js +169 -0
  92. package/lib-esm/DatePicker/Month.d.ts +9 -0
  93. package/lib-esm/DatePicker/Month.js +98 -0
  94. package/lib-esm/DatePicker/dateParser.d.ts +11 -0
  95. package/lib-esm/DatePicker/dateParser.js +178 -0
  96. package/lib-esm/DatePicker/index.d.ts +2 -0
  97. package/lib-esm/DatePicker/index.js +1 -0
  98. package/lib-esm/DatePicker/useDatePicker.d.ts +89 -0
  99. package/lib-esm/DatePicker/useDatePicker.js +408 -0
  100. package/lib-esm/Dialog.d.ts +46 -46
  101. package/lib-esm/Dropdown.d.ts +178 -178
  102. package/lib-esm/DropdownMenu/DropdownButton.d.ts +47 -47
  103. package/lib-esm/FilterList.d.ts +42 -42
  104. package/lib-esm/Flash.d.ts +1 -1
  105. package/lib-esm/Label.d.ts +1 -1
  106. package/lib-esm/Position.d.ts +4 -4
  107. package/lib-esm/ProgressBar.d.ts +1 -1
  108. package/lib-esm/SelectMenu/SelectMenu.d.ts +248 -246
  109. package/lib-esm/SelectMenu/SelectMenuItem.d.ts +1 -1
  110. package/lib-esm/SelectMenu/SelectMenuModal.d.ts +1 -1
  111. package/lib-esm/TextInputWithTokens.d.ts +32 -34
  112. package/lib-esm/TextInputWithTokens.js +30 -101
  113. package/lib-esm/Timeline.d.ts +44 -44
  114. package/lib-esm/Token/AvatarToken.d.ts +1 -1
  115. package/lib-esm/Token/IssueLabelToken.d.ts +1 -1
  116. package/lib-esm/Token/Token.d.ts +1 -1
  117. package/lib-esm/Token/Token.js +2 -13
  118. package/lib-esm/Token/TokenBase.js +4 -0
  119. package/lib-esm/Token/_RemoveTokenButton.js +2 -11
  120. package/lib-esm/_TextInputWrapper.d.ts +1 -1
  121. package/lib-esm/_TextInputWrapper.js +1 -1
  122. package/lib-esm/hooks/useDebounce.d.ts +2 -0
  123. package/lib-esm/hooks/useDebounce.js +16 -0
  124. package/lib-esm/sx.d.ts +2 -10
  125. package/lib-esm/sx.js +1 -3
  126. package/lib-esm/theme-preval.js +2 -2
  127. package/lib-esm/theme.d.ts +0 -78
  128. package/lib-esm/theme.js +1 -2
  129. package/lib-esm/utils/testing.d.ts +1 -1
  130. package/package.json +14 -16
  131. package/lib/ActionList2/Description.d.ts +0 -6
  132. package/lib/ActionList2/Description.js +0 -53
  133. package/lib/ActionList2/Divider.d.ts +0 -5
  134. package/lib/ActionList2/Divider.js +0 -33
  135. package/lib/ActionList2/Group.d.ts +0 -11
  136. package/lib/ActionList2/Group.js +0 -55
  137. package/lib/ActionList2/Header.d.ts +0 -26
  138. package/lib/ActionList2/Header.js +0 -55
  139. package/lib/ActionList2/Item.d.ts +0 -48
  140. package/lib/ActionList2/Item.js +0 -204
  141. package/lib/ActionList2/List.d.ts +0 -26
  142. package/lib/ActionList2/List.js +0 -56
  143. package/lib/ActionList2/Selection.d.ts +0 -5
  144. package/lib/ActionList2/Selection.js +0 -73
  145. package/lib/ActionList2/Visuals.d.ts +0 -11
  146. package/lib/ActionList2/Visuals.js +0 -90
  147. package/lib/ActionList2/hacks.d.ts +0 -30
  148. package/lib/ActionList2/hacks.js +0 -38
  149. package/lib/ActionList2/index.d.ts +0 -28
  150. package/lib/ActionList2/index.js +0 -42
  151. package/lib/experiments.d.ts +0 -1
  152. package/lib/experiments.js +0 -18
  153. package/lib/utils/create-slots.d.ts +0 -17
  154. package/lib/utils/create-slots.js +0 -105
  155. package/lib/utils/types/KeyPaths.d.ts +0 -3
  156. package/lib/utils/types/KeyPaths.js +0 -1
  157. package/lib/utils/use-force-update.d.ts +0 -1
  158. package/lib/utils/use-force-update.js +0 -19
  159. package/lib-esm/ActionList2/Description.d.ts +0 -6
  160. package/lib-esm/ActionList2/Description.js +0 -37
  161. package/lib-esm/ActionList2/Divider.d.ts +0 -5
  162. package/lib-esm/ActionList2/Divider.js +0 -21
  163. package/lib-esm/ActionList2/Group.d.ts +0 -11
  164. package/lib-esm/ActionList2/Group.js +0 -38
  165. package/lib-esm/ActionList2/Header.d.ts +0 -26
  166. package/lib-esm/ActionList2/Header.js +0 -45
  167. package/lib-esm/ActionList2/Item.d.ts +0 -48
  168. package/lib-esm/ActionList2/Item.js +0 -176
  169. package/lib-esm/ActionList2/List.d.ts +0 -26
  170. package/lib-esm/ActionList2/List.js +0 -38
  171. package/lib-esm/ActionList2/Selection.d.ts +0 -5
  172. package/lib-esm/ActionList2/Selection.js +0 -55
  173. package/lib-esm/ActionList2/Visuals.d.ts +0 -11
  174. package/lib-esm/ActionList2/Visuals.js +0 -68
  175. package/lib-esm/ActionList2/hacks.d.ts +0 -30
  176. package/lib-esm/ActionList2/hacks.js +0 -30
  177. package/lib-esm/ActionList2/index.d.ts +0 -28
  178. package/lib-esm/ActionList2/index.js +0 -29
  179. package/lib-esm/experiments.d.ts +0 -1
  180. package/lib-esm/experiments.js +0 -2
  181. package/lib-esm/utils/create-slots.d.ts +0 -17
  182. package/lib-esm/utils/create-slots.js +0 -84
  183. package/lib-esm/utils/types/KeyPaths.d.ts +0 -3
  184. package/lib-esm/utils/types/KeyPaths.js +0 -1
  185. package/lib-esm/utils/use-force-update.d.ts +0 -1
  186. package/lib-esm/utils/use-force-update.js +0 -6
@@ -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" | "hidden" | "children" | "theme" | "slot" | "style" | "title" | "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" | "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" | "selected" | keyof SystemCommonProps | "media" | "target" | "href" | "hrefLang" | "referrerPolicy" | "rel" | "download" | "ping"> & React.RefAttributes<HTMLAnchorElement>>;
13
+ declare const SelectMenuItem: React.ForwardRefExoticComponent<Pick<SelectMenuItemInteralProps, "translate" | "hidden" | "children" | "theme" | "slot" | "style" | "title" | "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" | "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" | keyof SystemCommonProps | "sx" | "media" | "target" | "href" | "download" | "hrefLang" | "ping" | "rel" | "referrerPolicy" | "as" | "selected"> & 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" | "hidden" | "children" | "theme" | "p" | "slot" | "style" | "title" | "bg" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "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" | "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" | "hidden" | "children" | "theme" | "p" | "slot" | "style" | "title" | "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" | "bg" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "sx" | "align"> & React.RefAttributes<HTMLDivElement>>;
14
14
  export declare type SelectMenuModalProps = ComponentProps<typeof SelectMenuModal>;
15
15
  export default SelectMenuModal;
@@ -32,19 +32,17 @@ 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;
39
- } & Pick<Omit<Pick<{
35
+ } & Pick<Omit<Pick<({
40
36
  [x: string]: any;
41
37
  [x: number]: any;
42
38
  } & {
43
39
  theme?: any;
44
- } & {
40
+ } & ({} | {
41
+ children?: React.ReactNode;
42
+ })) & {
45
43
  as?: string | React.ComponentType<any> | undefined;
46
44
  forwardedAs?: string | React.ComponentType<any> | undefined;
47
- }, string | number | symbol>, "maxWidth" | "minWidth" | "width" | "theme" | "block" | "icon" | "className" | "sx" | "variant" | "disabled" | "contrast"> & {
45
+ }, string | number | symbol>, "maxWidth" | "minWidth" | "width" | "theme" | "className" | "block" | "icon" | "sx" | "disabled" | "variant" | "contrast"> & {
48
46
  className?: string | undefined;
49
47
  icon?: React.ComponentType<{
50
48
  className?: string | undefined;
@@ -61,7 +59,6 @@ declare const TextInputWithTokens: React.ForwardRefExoticComponent<Pick<{
61
59
  slot?: string | undefined;
62
60
  style?: React.CSSProperties | undefined;
63
61
  title?: string | undefined;
64
- block?: boolean | undefined;
65
62
  key?: React.Key | null | undefined;
66
63
  defaultChecked?: boolean | undefined;
67
64
  defaultValue?: string | number | readonly string[] | undefined;
@@ -69,14 +66,14 @@ declare const TextInputWithTokens: React.ForwardRefExoticComponent<Pick<{
69
66
  suppressHydrationWarning?: boolean | undefined;
70
67
  accessKey?: string | undefined;
71
68
  className?: string | undefined;
72
- contentEditable?: "inherit" | (boolean | "false" | "true") | undefined;
69
+ contentEditable?: "inherit" | (boolean | "true" | "false") | undefined;
73
70
  contextMenu?: string | undefined;
74
71
  dir?: string | undefined;
75
- draggable?: (boolean | "false" | "true") | undefined;
72
+ draggable?: (boolean | "true" | "false") | undefined;
76
73
  id?: string | undefined;
77
74
  lang?: string | undefined;
78
75
  placeholder?: string | undefined;
79
- spellCheck?: (boolean | "false" | "true") | undefined;
76
+ spellCheck?: (boolean | "true" | "false") | undefined;
80
77
  tabIndex?: number | undefined;
81
78
  radioGroup?: string | undefined;
82
79
  role?: React.AriaRole | undefined;
@@ -99,50 +96,50 @@ declare const TextInputWithTokens: React.ForwardRefExoticComponent<Pick<{
99
96
  results?: number | undefined;
100
97
  security?: string | undefined;
101
98
  unselectable?: "on" | "off" | undefined;
102
- inputMode?: "search" | "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
99
+ inputMode?: "none" | "text" | "search" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
103
100
  is?: string | undefined;
104
101
  'aria-activedescendant'?: string | undefined;
105
- 'aria-atomic'?: boolean | "false" | "true" | undefined;
106
- 'aria-autocomplete'?: "none" | "both" | "inline" | "list" | undefined;
107
- 'aria-busy'?: boolean | "false" | "true" | undefined;
108
- 'aria-checked'?: boolean | "mixed" | "false" | "true" | undefined;
102
+ 'aria-atomic'?: boolean | "true" | "false" | undefined;
103
+ 'aria-autocomplete'?: "none" | "list" | "inline" | "both" | undefined;
104
+ 'aria-busy'?: boolean | "true" | "false" | undefined;
105
+ 'aria-checked'?: boolean | "true" | "false" | "mixed" | undefined;
109
106
  'aria-colcount'?: number | undefined;
110
107
  'aria-colindex'?: number | undefined;
111
108
  'aria-colspan'?: number | undefined;
112
109
  'aria-controls'?: string | undefined;
113
- 'aria-current'?: boolean | "time" | "page" | "false" | "true" | "step" | "location" | "date" | undefined;
110
+ 'aria-current'?: boolean | "time" | "true" | "false" | "page" | "step" | "location" | "date" | undefined;
114
111
  'aria-describedby'?: string | undefined;
115
112
  'aria-details'?: string | undefined;
116
- 'aria-disabled'?: boolean | "false" | "true" | undefined;
117
- 'aria-dropeffect'?: "link" | "none" | "copy" | "move" | "execute" | "popup" | undefined;
113
+ 'aria-disabled'?: boolean | "true" | "false" | undefined;
114
+ 'aria-dropeffect'?: "none" | "link" | "copy" | "execute" | "move" | "popup" | undefined;
118
115
  'aria-errormessage'?: string | undefined;
119
- 'aria-expanded'?: boolean | "false" | "true" | undefined;
116
+ 'aria-expanded'?: boolean | "true" | "false" | undefined;
120
117
  'aria-flowto'?: string | undefined;
121
- 'aria-grabbed'?: boolean | "false" | "true" | undefined;
122
- 'aria-haspopup'?: boolean | "grid" | "dialog" | "menu" | "listbox" | "false" | "true" | "tree" | undefined;
123
- 'aria-hidden'?: boolean | "false" | "true" | undefined;
124
- 'aria-invalid'?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
118
+ 'aria-grabbed'?: boolean | "true" | "false" | undefined;
119
+ 'aria-haspopup'?: boolean | "grid" | "dialog" | "menu" | "listbox" | "tree" | "true" | "false" | undefined;
120
+ 'aria-hidden'?: boolean | "true" | "false" | undefined;
121
+ 'aria-invalid'?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
125
122
  'aria-keyshortcuts'?: string | undefined;
126
123
  'aria-label'?: string | undefined;
127
124
  'aria-labelledby'?: string | undefined;
128
125
  'aria-level'?: number | undefined;
129
126
  'aria-live'?: "off" | "assertive" | "polite" | undefined;
130
- 'aria-modal'?: boolean | "false" | "true" | undefined;
131
- 'aria-multiline'?: boolean | "false" | "true" | undefined;
132
- 'aria-multiselectable'?: boolean | "false" | "true" | undefined;
127
+ 'aria-modal'?: boolean | "true" | "false" | undefined;
128
+ 'aria-multiline'?: boolean | "true" | "false" | undefined;
129
+ 'aria-multiselectable'?: boolean | "true" | "false" | undefined;
133
130
  'aria-orientation'?: "horizontal" | "vertical" | undefined;
134
131
  'aria-owns'?: string | undefined;
135
132
  'aria-placeholder'?: string | undefined;
136
133
  'aria-posinset'?: number | undefined;
137
- 'aria-pressed'?: boolean | "mixed" | "false" | "true" | undefined;
138
- 'aria-readonly'?: boolean | "false" | "true" | undefined;
134
+ 'aria-pressed'?: boolean | "true" | "false" | "mixed" | undefined;
135
+ 'aria-readonly'?: boolean | "true" | "false" | undefined;
139
136
  'aria-relevant'?: "all" | "text" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
140
- 'aria-required'?: boolean | "false" | "true" | undefined;
137
+ 'aria-required'?: boolean | "true" | "false" | undefined;
141
138
  'aria-roledescription'?: string | undefined;
142
139
  'aria-rowcount'?: number | undefined;
143
140
  'aria-rowindex'?: number | undefined;
144
141
  'aria-rowspan'?: number | undefined;
145
- 'aria-selected'?: boolean | "false" | "true" | undefined;
142
+ 'aria-selected'?: boolean | "true" | "false" | undefined;
146
143
  'aria-setsize'?: number | undefined;
147
144
  'aria-sort'?: "none" | "ascending" | "descending" | "other" | undefined;
148
145
  'aria-valuemax'?: number | undefined;
@@ -312,14 +309,15 @@ declare const TextInputWithTokens: React.ForwardRefExoticComponent<Pick<{
312
309
  onAnimationIterationCapture?: React.AnimationEventHandler<HTMLSpanElement> | undefined;
313
310
  onTransitionEnd?: React.TransitionEventHandler<HTMLSpanElement> | undefined;
314
311
  onTransitionEndCapture?: React.TransitionEventHandler<HTMLSpanElement> | undefined;
315
- sx?: import("./sx").BetterSystemStyleObject | undefined;
316
- variant?: "small" | "large" | undefined;
312
+ block?: boolean | undefined;
313
+ sx?: import("@styled-system/css").SystemStyleObject | undefined;
317
314
  disabled?: boolean | undefined;
315
+ variant?: "large" | "small" | undefined;
318
316
  hasIcon?: boolean | undefined;
319
317
  contrast?: boolean | undefined;
320
318
  } & {
321
319
  theme?: any;
322
- }, "maxWidth" | "minWidth" | "width" | "theme" | "block" | "sx" | "variant" | "disabled" | "contrast">, string | number | symbol> & React.RefAttributes<HTMLInputElement> & {
320
+ }, "maxWidth" | "minWidth" | "width" | "theme" | "block" | "sx" | "disabled" | "variant" | "contrast">, string | number | symbol> & React.RefAttributes<HTMLInputElement> & {
323
321
  selectedTokenIndex: number | undefined;
324
322
  setSelectedTokenIndex: React.Dispatch<React.SetStateAction<number | undefined>>;
325
323
  }, string | number | symbol> & React.RefAttributes<HTMLInputElement>>;
@@ -9,17 +9,9 @@ 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';
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
12
+ import Box from './Box'; // eslint-disable-next-line @typescript-eslint/no-explicit-any
22
13
 
14
+ // using forwardRef is important so that other components (ex. Autocomplete) can use the ref
23
15
  function TextInputWithTokensInnerComponent({
24
16
  icon: IconComponent,
25
17
  contrast,
@@ -39,11 +31,9 @@ function TextInputWithTokensInnerComponent({
39
31
  minWidth: minWidthProp,
40
32
  maxWidth: maxWidthProp,
41
33
  variant: variantProp,
42
- visibleTokenCount,
43
34
  ...rest
44
35
  }, externalRef) {
45
36
  const {
46
- onBlur,
47
37
  onFocus,
48
38
  onKeyDown,
49
39
  ...inputPropsRest
@@ -52,7 +42,6 @@ function TextInputWithTokensInnerComponent({
52
42
  const localInputRef = useRef(null);
53
43
  const combinedInputRef = useCombinedRefs(localInputRef, ref);
54
44
  const [selectedTokenIndex, setSelectedTokenIndex] = useState();
55
- const [tokensAreTruncated, setTokensAreTruncated] = useState(Boolean(visibleTokenCount));
56
45
  const {
57
46
  containerRef
58
47
  } = useFocusZone({
@@ -87,25 +76,14 @@ function TextInputWithTokensInnerComponent({
87
76
  }, [selectedTokenIndex]);
88
77
 
89
78
  const handleTokenRemove = tokenId => {
90
- onTokenRemove(tokenId); // HACK: wait a tick for the the token node to be removed from the DOM
91
-
92
- setTimeout(() => {
93
- var _containerRef$current2, _containerRef$current3;
94
-
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
79
+ onTokenRemove(tokenId);
97
80
 
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));
81
+ if (selectedTokenIndex) {
82
+ var _containerRef$current2;
99
83
 
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);
84
+ const nextElementToFocus = (_containerRef$current2 = containerRef.current) === null || _containerRef$current2 === void 0 ? void 0 : _containerRef$current2.children[selectedTokenIndex];
85
+ nextElementToFocus.focus();
86
+ }
109
87
  };
110
88
 
111
89
  const handleTokenFocus = tokenIndex => () => {
@@ -113,55 +91,30 @@ function TextInputWithTokensInnerComponent({
113
91
  };
114
92
 
115
93
  const handleTokenBlur = () => {
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);
94
+ setSelectedTokenIndex(undefined);
127
95
  };
128
96
 
129
- const handleTokenKeyUp = event => {
130
- if (event.key === 'Escape') {
131
- var _ref$current2;
97
+ const handleTokenKeyUp = e => {
98
+ if (e.key === 'Escape') {
99
+ var _ref$current;
132
100
 
133
- (_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.focus();
101
+ (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.focus();
134
102
  }
135
103
  };
136
104
 
137
- const handleInputFocus = event => {
138
- onFocus && onFocus(event);
105
+ const handleInputFocus = e => {
106
+ onFocus && onFocus(e);
139
107
  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);
155
108
  };
156
109
 
157
110
  const handleInputKeyDown = e => {
158
- var _ref$current3;
111
+ var _ref$current2;
159
112
 
160
113
  if (onKeyDown) {
161
114
  onKeyDown(e);
162
115
  }
163
116
 
164
- if ((_ref$current3 = ref.current) !== null && _ref$current3 !== void 0 && _ref$current3.value) {
117
+ if ((_ref$current2 = ref.current) !== null && _ref$current2 !== void 0 && _ref$current2.value) {
165
118
  return;
166
119
  }
167
120
 
@@ -182,24 +135,13 @@ function TextInputWithTokensInnerComponent({
182
135
 
183
136
 
184
137
  setTimeout(() => {
185
- var _ref$current4;
138
+ var _ref$current3;
186
139
 
187
- (_ref$current4 = ref.current) === null || _ref$current4 === void 0 ? void 0 : _ref$current4.select();
140
+ (_ref$current3 = ref.current) === null || _ref$current3 === void 0 ? void 0 : _ref$current3.select();
188
141
  }, 0);
189
142
  }
190
143
  };
191
144
 
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;
203
145
  return /*#__PURE__*/React.createElement(TextInputWrapper, {
204
146
  block: block,
205
147
  className: className,
@@ -211,8 +153,15 @@ function TextInputWithTokensInnerComponent({
211
153
  minWidth: minWidthProp,
212
154
  maxWidth: maxWidthProp,
213
155
  variant: variantProp,
214
- onClick: focusInput,
215
- sx: { ...(block ? {
156
+ ref: containerRef,
157
+ sx: {
158
+ alignItems: 'center',
159
+ flexWrap: preventTokenWrapping ? 'nowrap' : 'wrap',
160
+ gap: '0.25rem',
161
+ '> *': {
162
+ flexShrink: 0
163
+ },
164
+ ...(block ? {
216
165
  display: 'flex',
217
166
  width: '100%'
218
167
  } : {}),
@@ -225,21 +174,6 @@ function TextInputWithTokensInnerComponent({
225
174
  } : {}),
226
175
  ...sxProp
227
176
  }
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
- }
243
177
  }, /*#__PURE__*/React.createElement(Box, {
244
178
  sx: {
245
179
  order: 1,
@@ -251,13 +185,12 @@ function TextInputWithTokensInnerComponent({
251
185
  ref: combinedInputRef,
252
186
  disabled: disabled,
253
187
  onFocus: handleInputFocus,
254
- onBlur: handleInputBlur,
255
188
  onKeyDown: handleInputKeyDown,
256
189
  type: "text",
257
190
  sx: {
258
191
  height: '100%'
259
192
  }
260
- }, inputPropsRest))), TokenComponent ? visibleTokens.map(({
193
+ }, inputPropsRest))), tokens.length && TokenComponent ? tokens.map(({
261
194
  id,
262
195
  ...tokenRest
263
196
  }, i) => /*#__PURE__*/React.createElement(TokenComponent, _extends({
@@ -265,7 +198,6 @@ function TextInputWithTokensInnerComponent({
265
198
  onFocus: handleTokenFocus(i),
266
199
  onBlur: handleTokenBlur,
267
200
  onKeyUp: handleTokenKeyUp,
268
- onClick: preventTokenClickPropagation,
269
201
  isSelected: selectedTokenIndex === i,
270
202
  onRemove: () => {
271
203
  handleTokenRemove(id);
@@ -273,10 +205,7 @@ function TextInputWithTokensInnerComponent({
273
205
  hideRemoveButton: hideTokenRemoveButtons,
274
206
  size: size,
275
207
  tabIndex: 0
276
- }, tokenRest))) : null, tokensAreTruncated ? /*#__PURE__*/React.createElement(Text, {
277
- color: "fg.muted",
278
- fontSize: size && overflowCountFontSizeMap[size]
279
- }, "+", tokens.length - visibleTokens.length) : null));
208
+ }, tokenRest))) : null);
280
209
  }
281
210
 
282
211
  TextInputWithTokensInnerComponent.displayName = "TextInputWithTokensInnerComponent";