@algolia/satellite 1.0.0-beta.131 → 1.0.0-beta.134

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 (586) hide show
  1. package/README.md +33 -28
  2. package/cjs/AnnouncementBadge/AnnouncementBadge.d.ts +8 -3
  3. package/cjs/AnnouncementBadge/AnnouncementBadge.js +25 -7
  4. package/cjs/AutoComplete/AutoComplete.d.ts +23 -17
  5. package/cjs/AutoComplete/AutoComplete.js +180 -124
  6. package/cjs/AutoComplete/AutoComplete.tailwind.d.ts +4 -4
  7. package/cjs/AutoComplete/AutoComplete.tailwind.js +10 -13
  8. package/cjs/AutoComplete/components/AutoCompleteEmptyState.d.ts +4 -4
  9. package/cjs/AutoComplete/components/AutoCompleteEmptyState.js +16 -13
  10. package/cjs/AutoComplete/components/DefaultOptionItem.d.ts +6 -2
  11. package/cjs/AutoComplete/components/DefaultOptionItem.js +24 -17
  12. package/cjs/AutoComplete/types.d.ts +33 -25
  13. package/cjs/AutoComplete/utils.d.ts +5 -4
  14. package/cjs/AutoComplete/utils.js +22 -2
  15. package/cjs/Avatars/ApplicationAvatar.js +7 -6
  16. package/cjs/Avatars/UserAvatar.js +19 -20
  17. package/cjs/Avatars/utils.d.ts +1 -1
  18. package/cjs/Badge/Badge.d.ts +5 -5
  19. package/cjs/Badge/Badge.js +21 -12
  20. package/cjs/Banner/Banner.d.ts +5 -4
  21. package/cjs/Banner/Banner.js +30 -25
  22. package/cjs/Banners/Alert/Alert.d.ts +5 -4
  23. package/cjs/Banners/Alert/Alert.js +29 -23
  24. package/cjs/Banners/BigBertha/BigBertha.d.ts +3 -2
  25. package/cjs/Banners/BigBertha/BigBertha.js +11 -9
  26. package/cjs/Banners/Promote/Promote.d.ts +6 -5
  27. package/cjs/Banners/Promote/Promote.js +38 -30
  28. package/cjs/Button/Button.js +23 -17
  29. package/cjs/Button/Button.tailwind.d.ts +4 -4
  30. package/cjs/Button/Button.tailwind.js +11 -14
  31. package/cjs/Button/ButtonGroup.d.ts +2 -1
  32. package/cjs/Button/ButtonGroup.js +6 -5
  33. package/cjs/Button/IconButton.d.ts +2 -2
  34. package/cjs/Button/IconButton.js +24 -22
  35. package/cjs/Button/styles.d.ts +1 -1
  36. package/cjs/Button/types.d.ts +5 -5
  37. package/cjs/Card/Card.d.ts +3 -3
  38. package/cjs/Card/Card.js +8 -11
  39. package/cjs/Card/Card.tailwind.d.ts +4 -4
  40. package/cjs/Card/Card.tailwind.js +5 -8
  41. package/cjs/Card/components/CardHeader.js +8 -4
  42. package/cjs/Card/components/CardTitle.d.ts +4 -2
  43. package/cjs/Card/components/CardTitle.js +11 -6
  44. package/cjs/Checkbox/Checkbox.d.ts +3 -3
  45. package/cjs/Checkbox/Checkbox.js +33 -30
  46. package/cjs/Checkbox/Checkbox.tailwind.d.ts +5 -5
  47. package/cjs/Checkbox/Checkbox.tailwind.js +11 -14
  48. package/cjs/ClickAwayContainer/ClickAwayContainer.d.ts +3 -2
  49. package/cjs/ClickAwayContainer/ClickAwayContainer.js +6 -9
  50. package/cjs/DatePicker/DatePicker/DatePicker.d.ts +13 -19
  51. package/cjs/DatePicker/DatePicker/DatePicker.js +90 -63
  52. package/cjs/DatePicker/DatePicker/datePickerReducer.d.ts +2 -2
  53. package/cjs/DatePicker/DatePicker/datePickerReducer.js +2 -2
  54. package/cjs/DatePicker/DatePicker.tailwind.d.ts +4 -4
  55. package/cjs/DatePicker/DatePicker.tailwind.js +19 -14
  56. package/cjs/DatePicker/DateRangePicker/DateRangePicker.d.ts +11 -17
  57. package/cjs/DatePicker/DateRangePicker/DateRangePicker.js +101 -70
  58. package/cjs/DatePicker/DateRangePicker/DateRangePickerDisplay.d.ts +4 -1
  59. package/cjs/DatePicker/DateRangePicker/DateRangePickerDisplay.js +18 -12
  60. package/cjs/DatePicker/DateRangePicker/dateRangePickerReducer.d.ts +3 -3
  61. package/cjs/DatePicker/DateRangePicker/dateRangePickerReducer.js +5 -5
  62. package/cjs/DatePicker/components/Calendar.d.ts +6 -2
  63. package/cjs/DatePicker/components/Calendar.js +12 -10
  64. package/cjs/DatePicker/components/Display.d.ts +3 -3
  65. package/cjs/DatePicker/components/Display.js +6 -5
  66. package/cjs/DatePicker/components/Footer.d.ts +2 -2
  67. package/cjs/DatePicker/components/Footer.js +6 -5
  68. package/cjs/DatePicker/components/FooterActions.d.ts +4 -1
  69. package/cjs/DatePicker/components/FooterActions.js +17 -13
  70. package/cjs/DatePicker/components/Modal.d.ts +5 -5
  71. package/cjs/DatePicker/components/Modal.js +18 -16
  72. package/cjs/DatePicker/components/NavBar.d.ts +7 -3
  73. package/cjs/DatePicker/components/NavBar.js +42 -41
  74. package/cjs/DatePicker/components/SidePanel.d.ts +2 -2
  75. package/cjs/DatePicker/components/SidePanel.js +9 -7
  76. package/cjs/DatePicker/types.d.ts +17 -0
  77. package/cjs/{tailwind-types.js → DatePicker/types.js} +0 -0
  78. package/cjs/DatePicker/utils.d.ts +2 -0
  79. package/cjs/DatePicker/utils.js +10 -2
  80. package/cjs/Dropdown/Dropdown.d.ts +8 -8
  81. package/cjs/Dropdown/Dropdown.js +49 -40
  82. package/cjs/Dropdown/DropdownButton.d.ts +4 -3
  83. package/cjs/Dropdown/DropdownButton.js +15 -9
  84. package/cjs/Dropdown/DropdownContext.d.ts +2 -2
  85. package/cjs/Dropdown/DropdownContext.js +2 -9
  86. package/cjs/Dropdown/components/DropdownButtonItem.d.ts +1 -1
  87. package/cjs/Dropdown/components/DropdownButtonItem.js +14 -14
  88. package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItem.d.ts +4 -4
  89. package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItem.js +30 -29
  90. package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsGroup.d.ts +1 -1
  91. package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsGroup.js +6 -7
  92. package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsMultiGroup.d.ts +1 -1
  93. package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsMultiGroup.js +6 -9
  94. package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsSingleGroup.d.ts +1 -1
  95. package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsSingleGroup.js +6 -9
  96. package/cjs/Dropdown/components/DropdownDivider.js +3 -3
  97. package/cjs/Dropdown/components/DropdownFooterItem.d.ts +2 -2
  98. package/cjs/Dropdown/components/DropdownFooterItem.js +11 -5
  99. package/cjs/Dropdown/components/DropdownLinkItem.js +14 -13
  100. package/cjs/Dropdown/components/DropdownRadioItem.d.ts +2 -2
  101. package/cjs/Dropdown/components/DropdownRadioItem.js +17 -16
  102. package/cjs/Dropdown/components/DropdownTitle.d.ts +4 -2
  103. package/cjs/Dropdown/components/DropdownTitle.js +8 -4
  104. package/cjs/Dropdown/components/DropdownToggleItem.d.ts +3 -3
  105. package/cjs/Dropdown/components/DropdownToggleItem.js +16 -16
  106. package/cjs/Dropdown/useDropdownItemProps.d.ts +3 -3
  107. package/cjs/Dropzone/Dropzone.d.ts +7 -3
  108. package/cjs/Dropzone/Dropzone.js +70 -56
  109. package/cjs/EmptyState/EmptyState.d.ts +1 -1
  110. package/cjs/EmptyState/EmptyState.js +29 -22
  111. package/cjs/EmptyState/EmptyState.tailwind.d.ts +4 -4
  112. package/cjs/EmptyState/EmptyState.tailwind.js +5 -8
  113. package/cjs/EmptyState/types.d.ts +7 -7
  114. package/cjs/Field/Field.d.ts +4 -3
  115. package/cjs/Field/Field.js +33 -26
  116. package/cjs/Flag/Flag.d.ts +3 -2
  117. package/cjs/Flag/Flag.js +58 -38
  118. package/cjs/Flag/Flag.tailwind.d.ts +4 -4
  119. package/cjs/Flag/Flag.tailwind.js +8 -15
  120. package/cjs/Flag/Flags.d.ts +3 -3
  121. package/cjs/Flag/Flags.js +32 -22
  122. package/cjs/Flag/types.d.ts +8 -4
  123. package/cjs/FlexGrid/FlexGrid.d.ts +2 -1
  124. package/cjs/FlexGrid/FlexGrid.js +15 -9
  125. package/cjs/FlexGrid/FlexGrid.tailwind.d.ts +6 -3
  126. package/cjs/FlexGrid/FlexGrid.tailwind.js +10 -13
  127. package/cjs/HelpUnderline/HelpUnderline.d.ts +2 -1
  128. package/cjs/HelpUnderline/HelpUnderline.js +9 -7
  129. package/cjs/HelpUnderline/HelpUnderline.tailwind.d.ts +4 -4
  130. package/cjs/HelpUnderline/HelpUnderline.tailwind.js +3 -6
  131. package/cjs/Input/Input.d.ts +11 -5
  132. package/cjs/Input/Input.js +131 -115
  133. package/cjs/Input/Input.tailwind.d.ts +4 -4
  134. package/cjs/Input/Input.tailwind.js +12 -15
  135. package/cjs/Insert/Insert.d.ts +3 -2
  136. package/cjs/Insert/Insert.js +29 -23
  137. package/cjs/InstantSearch/InstantSearch.tailwind.d.ts +4 -5
  138. package/cjs/InstantSearch/InstantSearch.tailwind.js +34 -32
  139. package/cjs/KeyboardKey/KeyboardKey.d.ts +2 -1
  140. package/cjs/KeyboardKey/KeyboardKey.js +11 -13
  141. package/cjs/KeyboardKey/KeyboardKey.tailwind.d.ts +4 -4
  142. package/cjs/KeyboardKey/KeyboardKey.tailwind.js +5 -8
  143. package/cjs/Link/BaseLink.d.ts +3 -3
  144. package/cjs/Link/BaseLink.js +7 -7
  145. package/cjs/Link/ButtonLink.d.ts +1 -1
  146. package/cjs/Link/ButtonLink.js +9 -5
  147. package/cjs/Link/IconButtonLink.d.ts +1 -1
  148. package/cjs/Link/IconButtonLink.js +8 -4
  149. package/cjs/Link/Link.d.ts +5 -5
  150. package/cjs/Link/Link.js +16 -15
  151. package/cjs/Medallion/Medallion.d.ts +2 -2
  152. package/cjs/Medallion/Medallion.js +8 -7
  153. package/cjs/Medallion/Medallion.tailwind.d.ts +4 -4
  154. package/cjs/Medallion/Medallion.tailwind.js +8 -11
  155. package/cjs/Modal/Modal.d.ts +8 -5
  156. package/cjs/Modal/Modal.js +60 -47
  157. package/cjs/Modal/Modal.tailwind.d.ts +4 -4
  158. package/cjs/Modal/Modal.tailwind.js +9 -18
  159. package/cjs/Modal/components/ModalFooter.d.ts +4 -2
  160. package/cjs/Modal/components/ModalFooter.js +16 -10
  161. package/cjs/Modal/components/ModalSection.d.ts +1 -1
  162. package/cjs/Modal/components/ModalSection.js +6 -5
  163. package/cjs/Pagination/CompactPagination/CompactPagination.d.ts +8 -0
  164. package/cjs/Pagination/CompactPagination/CompactPagination.js +62 -36
  165. package/cjs/Pagination/DotPagination/DotPagination.d.ts +5 -1
  166. package/cjs/Pagination/DotPagination/DotPagination.js +36 -16
  167. package/cjs/Pagination/Pagination/Pagination.d.ts +7 -1
  168. package/cjs/Pagination/Pagination/Pagination.js +79 -49
  169. package/cjs/ProgressBar/ProgressBar.d.ts +2 -2
  170. package/cjs/ProgressBar/ProgressBar.js +16 -11
  171. package/cjs/ProgressBar/ProgressBar.tailwind.d.ts +5 -5
  172. package/cjs/ProgressBar/ProgressBar.tailwind.js +7 -10
  173. package/cjs/ProgressSpinner/ProgressSpinner.d.ts +2 -2
  174. package/cjs/ProgressSpinner/ProgressSpinner.js +18 -11
  175. package/cjs/ProgressSpinner/ProgressSpinner.tailwind.d.ts +5 -5
  176. package/cjs/ProgressSpinner/ProgressSpinner.tailwind.js +4 -7
  177. package/cjs/RadioGroup/RadioButton.d.ts +3 -3
  178. package/cjs/RadioGroup/RadioButton.js +8 -8
  179. package/cjs/RadioGroup/RadioButton.tailwind.d.ts +4 -4
  180. package/cjs/RadioGroup/RadioButton.tailwind.js +11 -14
  181. package/cjs/RadioGroup/RadioGroup.d.ts +4 -3
  182. package/cjs/RadioGroup/RadioGroup.js +36 -34
  183. package/cjs/RangeSlider/RangeSlider.d.ts +3 -3
  184. package/cjs/RangeSlider/RangeSlider.js +37 -36
  185. package/cjs/RangeSlider/RangeSlider.tailwind.d.ts +4 -4
  186. package/cjs/RangeSlider/RangeSlider.tailwind.js +21 -24
  187. package/cjs/Satellite/Satellite.d.ts +5 -2
  188. package/cjs/Satellite/Satellite.js +13 -7
  189. package/cjs/Satellite/SatelliteContext.d.ts +3 -1
  190. package/cjs/Satellite/SatelliteContext.js +4 -3
  191. package/cjs/Satellite/SatelliteRouter.d.ts +1 -1
  192. package/cjs/Satellite/index.d.ts +1 -0
  193. package/cjs/Satellite/index.js +14 -0
  194. package/cjs/Satellite/locale.d.ts +27 -0
  195. package/cjs/Satellite/locale.js +21 -0
  196. package/cjs/ScrollIndicator/ScrollIndicator.d.ts +6 -3
  197. package/cjs/ScrollIndicator/ScrollIndicator.js +13 -16
  198. package/cjs/ScrollIndicator/ScrollIndicator.tailwind.d.ts +4 -4
  199. package/cjs/ScrollIndicator/ScrollIndicator.tailwind.js +8 -11
  200. package/cjs/Select/Select.d.ts +3 -3
  201. package/cjs/Select/Select.js +8 -8
  202. package/cjs/Select/Select.tailwind.d.ts +5 -5
  203. package/cjs/Select/Select.tailwind.js +5 -8
  204. package/cjs/Sidebar/Sidebar.d.ts +6 -4
  205. package/cjs/Sidebar/Sidebar.js +18 -10
  206. package/cjs/Sidebar/Sidebar.tailwind.d.ts +4 -4
  207. package/cjs/Sidebar/Sidebar.tailwind.js +5 -8
  208. package/cjs/Sidebar/SidebarContext.d.ts +1 -1
  209. package/cjs/Sidebar/components/SidebarHeader.d.ts +2 -2
  210. package/cjs/Sidebar/components/SidebarHeader.js +11 -6
  211. package/cjs/Sidebar/components/SidebarLink.d.ts +4 -3
  212. package/cjs/Sidebar/components/SidebarLink.js +32 -22
  213. package/cjs/Switch/Switch.d.ts +3 -3
  214. package/cjs/Switch/Switch.js +17 -19
  215. package/cjs/Switch/Switch.tailwind.d.ts +5 -5
  216. package/cjs/Switch/Switch.tailwind.js +7 -8
  217. package/cjs/Switch/SwitchOption.d.ts +2 -1
  218. package/cjs/Switch/SwitchOption.js +25 -17
  219. package/cjs/Tables/DataTable/DataTable.d.ts +15 -5
  220. package/cjs/Tables/DataTable/DataTable.js +79 -60
  221. package/cjs/Tables/DataTable/DataTable.tailwind.d.ts +4 -4
  222. package/cjs/Tables/DataTable/DataTable.tailwind.js +3 -6
  223. package/cjs/Tables/DataTable/components/Body.d.ts +7 -6
  224. package/cjs/Tables/DataTable/components/Body.js +62 -47
  225. package/cjs/Tables/DataTable/components/Footer.d.ts +1 -1
  226. package/cjs/Tables/DataTable/components/Footer.js +6 -6
  227. package/cjs/Tables/DataTable/components/Header.js +24 -20
  228. package/cjs/Tables/DataTable/components/HeaderCell.d.ts +3 -3
  229. package/cjs/Tables/DataTable/components/HeaderCell.js +20 -14
  230. package/cjs/Tables/DataTable/components/Loader.d.ts +3 -1
  231. package/cjs/Tables/DataTable/components/Loader.js +19 -20
  232. package/cjs/Tables/DataTable/types.d.ts +3 -3
  233. package/cjs/Tables/DataTable/utils.d.ts +1 -1
  234. package/cjs/Tables/Table/Table.d.ts +3 -3
  235. package/cjs/Tables/Table/Table.js +19 -12
  236. package/cjs/Tables/Table/Table.tailwind.d.ts +4 -4
  237. package/cjs/Tables/Table/Table.tailwind.js +3 -6
  238. package/cjs/Tables/Table/components/Footer.d.ts +2 -2
  239. package/cjs/Tables/Table/components/Footer.js +6 -5
  240. package/cjs/Tabs/ContentTabs.d.ts +1 -1
  241. package/cjs/Tabs/ContentTabs.js +39 -38
  242. package/cjs/Tabs/LinkTabs.d.ts +1 -1
  243. package/cjs/Tabs/LinkTabs.js +16 -16
  244. package/cjs/Tabs/Tabs.tailwind.d.ts +4 -4
  245. package/cjs/Tabs/Tabs.tailwind.js +5 -8
  246. package/cjs/Tabs/components/LinkTab.d.ts +3 -3
  247. package/cjs/Tabs/components/LinkTab.js +18 -12
  248. package/cjs/Tabs/types.d.ts +6 -6
  249. package/cjs/Tabs/utils.d.ts +1 -1
  250. package/cjs/Tag/Tag.d.ts +8 -4
  251. package/cjs/Tag/Tag.js +36 -24
  252. package/cjs/Tag/Tag.tailwind.d.ts +4 -4
  253. package/cjs/Tag/Tag.tailwind.js +6 -9
  254. package/cjs/TextArea/TextArea.d.ts +3 -3
  255. package/cjs/TextArea/TextArea.js +8 -8
  256. package/cjs/TextArea/TextArea.tailwind.d.ts +4 -4
  257. package/cjs/TextArea/TextArea.tailwind.js +4 -7
  258. package/cjs/TextWrap/TextWrap.js +20 -20
  259. package/cjs/Toggle/Toggle.d.ts +3 -3
  260. package/cjs/Toggle/Toggle.js +23 -21
  261. package/cjs/Toggle/Toggle.tailwind.d.ts +5 -5
  262. package/cjs/Toggle/Toggle.tailwind.js +19 -22
  263. package/cjs/Tooltip/OverflowTooltipWrapper.d.ts +3 -2
  264. package/cjs/Tooltip/OverflowTooltipWrapper.js +32 -24
  265. package/cjs/Tooltip/Tooltip.d.ts +3 -3
  266. package/cjs/Tooltip/Tooltip.js +8 -8
  267. package/cjs/Tooltip/Tooltip.tailwind.d.ts +4 -4
  268. package/cjs/Tooltip/Tooltip.tailwind.js +19 -18
  269. package/cjs/Tooltip/TooltipWrapper.d.ts +4 -3
  270. package/cjs/Tooltip/TooltipWrapper.js +47 -39
  271. package/cjs/Tooltip/types.d.ts +4 -2
  272. package/cjs/Typography/Typography.tailwind.d.ts +5 -17
  273. package/cjs/Typography/Typography.tailwind.js +125 -135
  274. package/cjs/UserContent/UserContent.js +3 -3
  275. package/cjs/UserContent/UserContent.tailwind.d.ts +4 -1
  276. package/cjs/UserContent/UserContent.tailwind.js +13 -13
  277. package/cjs/styles/base.tailwind.d.ts +4 -4
  278. package/cjs/styles/base.tailwind.js +3 -6
  279. package/cjs/styles/tailwind.config.d.ts +2 -198
  280. package/cjs/styles/tailwind.config.js +27 -31
  281. package/cjs/types.d.ts +10 -3
  282. package/cjs/utilities/utilities.tailwind.d.ts +4 -1
  283. package/cjs/utilities/utilities.tailwind.js +4 -6
  284. package/cjs/utils/genericChangeHandler.d.ts +3 -3
  285. package/cjs/utils/isCssPropertySupported.d.ts +1 -1
  286. package/cjs/utils/isRenderedChild.d.ts +2 -2
  287. package/cjs/utils/pluralize.js +6 -1
  288. package/cjs/utils/useForwardedRef.d.ts +2 -2
  289. package/cjs/utils/useLinkProps.d.ts +2 -2
  290. package/cjs/utils/useTriggerInputChange.d.ts +2 -2
  291. package/esm/AnnouncementBadge/AnnouncementBadge.d.ts +8 -3
  292. package/esm/AnnouncementBadge/AnnouncementBadge.js +23 -6
  293. package/esm/AutoComplete/AutoComplete.d.ts +23 -17
  294. package/esm/AutoComplete/AutoComplete.js +184 -115
  295. package/esm/AutoComplete/AutoComplete.tailwind.d.ts +4 -4
  296. package/esm/AutoComplete/AutoComplete.tailwind.js +10 -13
  297. package/esm/AutoComplete/components/AutoCompleteEmptyState.d.ts +4 -4
  298. package/esm/AutoComplete/components/AutoCompleteEmptyState.js +16 -12
  299. package/esm/AutoComplete/components/DefaultOptionItem.d.ts +6 -2
  300. package/esm/AutoComplete/components/DefaultOptionItem.js +25 -16
  301. package/esm/AutoComplete/types.d.ts +33 -25
  302. package/esm/AutoComplete/utils.d.ts +5 -4
  303. package/esm/AutoComplete/utils.js +16 -0
  304. package/esm/Avatars/ApplicationAvatar.js +6 -5
  305. package/esm/Avatars/UserAvatar.js +19 -14
  306. package/esm/Avatars/utils.d.ts +1 -1
  307. package/esm/Badge/Badge.d.ts +5 -5
  308. package/esm/Badge/Badge.js +21 -11
  309. package/esm/Banner/Banner.d.ts +5 -4
  310. package/esm/Banner/Banner.js +31 -25
  311. package/esm/Banners/Alert/Alert.d.ts +5 -4
  312. package/esm/Banners/Alert/Alert.js +30 -23
  313. package/esm/Banners/BigBertha/BigBertha.d.ts +3 -2
  314. package/esm/Banners/BigBertha/BigBertha.js +11 -8
  315. package/esm/Banners/Promote/Promote.d.ts +6 -5
  316. package/esm/Banners/Promote/Promote.js +37 -28
  317. package/esm/Button/Button.js +23 -16
  318. package/esm/Button/Button.tailwind.d.ts +4 -4
  319. package/esm/Button/Button.tailwind.js +13 -16
  320. package/esm/Button/ButtonGroup.d.ts +2 -1
  321. package/esm/Button/ButtonGroup.js +5 -4
  322. package/esm/Button/IconButton.d.ts +2 -2
  323. package/esm/Button/IconButton.js +24 -19
  324. package/esm/Button/styles.d.ts +1 -1
  325. package/esm/Button/types.d.ts +5 -5
  326. package/esm/Card/Card.d.ts +3 -3
  327. package/esm/Card/Card.js +6 -4
  328. package/esm/Card/Card.tailwind.d.ts +4 -4
  329. package/esm/Card/Card.tailwind.js +6 -9
  330. package/esm/Card/components/CardHeader.js +8 -3
  331. package/esm/Card/components/CardTitle.d.ts +4 -2
  332. package/esm/Card/components/CardTitle.js +11 -5
  333. package/esm/Checkbox/Checkbox.d.ts +3 -3
  334. package/esm/Checkbox/Checkbox.js +35 -26
  335. package/esm/Checkbox/Checkbox.tailwind.d.ts +5 -5
  336. package/esm/Checkbox/Checkbox.tailwind.js +11 -14
  337. package/esm/ClickAwayContainer/ClickAwayContainer.d.ts +3 -2
  338. package/esm/ClickAwayContainer/ClickAwayContainer.js +6 -4
  339. package/esm/DatePicker/DatePicker/DatePicker.d.ts +13 -19
  340. package/esm/DatePicker/DatePicker/DatePicker.js +92 -59
  341. package/esm/DatePicker/DatePicker/datePickerReducer.d.ts +2 -2
  342. package/esm/DatePicker/DatePicker/datePickerReducer.js +2 -2
  343. package/esm/DatePicker/DatePicker.tailwind.d.ts +4 -4
  344. package/esm/DatePicker/DatePicker.tailwind.js +19 -15
  345. package/esm/DatePicker/DateRangePicker/DateRangePicker.d.ts +11 -17
  346. package/esm/DatePicker/DateRangePicker/DateRangePicker.js +105 -67
  347. package/esm/DatePicker/DateRangePicker/DateRangePickerDisplay.d.ts +4 -1
  348. package/esm/DatePicker/DateRangePicker/DateRangePickerDisplay.js +19 -11
  349. package/esm/DatePicker/DateRangePicker/dateRangePickerReducer.d.ts +3 -3
  350. package/esm/DatePicker/DateRangePicker/dateRangePickerReducer.js +4 -4
  351. package/esm/DatePicker/components/Calendar.d.ts +6 -2
  352. package/esm/DatePicker/components/Calendar.js +13 -5
  353. package/esm/DatePicker/components/Display.d.ts +3 -3
  354. package/esm/DatePicker/components/Display.js +5 -4
  355. package/esm/DatePicker/components/Footer.d.ts +2 -2
  356. package/esm/DatePicker/components/Footer.js +5 -4
  357. package/esm/DatePicker/components/FooterActions.d.ts +4 -1
  358. package/esm/DatePicker/components/FooterActions.js +18 -13
  359. package/esm/DatePicker/components/Modal.d.ts +5 -5
  360. package/esm/DatePicker/components/Modal.js +19 -12
  361. package/esm/DatePicker/components/NavBar.d.ts +7 -3
  362. package/esm/DatePicker/components/NavBar.js +42 -35
  363. package/esm/DatePicker/components/SidePanel.d.ts +2 -2
  364. package/esm/DatePicker/components/SidePanel.js +8 -6
  365. package/esm/DatePicker/types.d.ts +17 -0
  366. package/esm/{tailwind-types.js → DatePicker/types.js} +0 -0
  367. package/esm/DatePicker/utils.d.ts +2 -0
  368. package/esm/DatePicker/utils.js +7 -0
  369. package/esm/Dropdown/Dropdown.d.ts +8 -8
  370. package/esm/Dropdown/Dropdown.js +45 -30
  371. package/esm/Dropdown/DropdownButton.d.ts +4 -3
  372. package/esm/Dropdown/DropdownButton.js +15 -8
  373. package/esm/Dropdown/DropdownContext.d.ts +2 -2
  374. package/esm/Dropdown/DropdownContext.js +2 -2
  375. package/esm/Dropdown/components/DropdownButtonItem.d.ts +1 -1
  376. package/esm/Dropdown/components/DropdownButtonItem.js +14 -12
  377. package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItem.d.ts +4 -4
  378. package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItem.js +29 -22
  379. package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsGroup.d.ts +1 -1
  380. package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsGroup.js +5 -4
  381. package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsMultiGroup.d.ts +1 -1
  382. package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsMultiGroup.js +6 -4
  383. package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsSingleGroup.d.ts +1 -1
  384. package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsSingleGroup.js +6 -4
  385. package/esm/Dropdown/components/DropdownDivider.js +2 -2
  386. package/esm/Dropdown/components/DropdownFooterItem.d.ts +2 -2
  387. package/esm/Dropdown/components/DropdownFooterItem.js +11 -4
  388. package/esm/Dropdown/components/DropdownLinkItem.js +14 -11
  389. package/esm/Dropdown/components/DropdownRadioItem.d.ts +2 -2
  390. package/esm/Dropdown/components/DropdownRadioItem.js +17 -14
  391. package/esm/Dropdown/components/DropdownTitle.d.ts +4 -2
  392. package/esm/Dropdown/components/DropdownTitle.js +8 -3
  393. package/esm/Dropdown/components/DropdownToggleItem.d.ts +3 -3
  394. package/esm/Dropdown/components/DropdownToggleItem.js +16 -14
  395. package/esm/Dropdown/useDropdownItemProps.d.ts +3 -3
  396. package/esm/Dropzone/Dropzone.d.ts +7 -3
  397. package/esm/Dropzone/Dropzone.js +69 -49
  398. package/esm/EmptyState/EmptyState.d.ts +1 -1
  399. package/esm/EmptyState/EmptyState.js +29 -21
  400. package/esm/EmptyState/EmptyState.tailwind.d.ts +4 -4
  401. package/esm/EmptyState/EmptyState.tailwind.js +6 -9
  402. package/esm/EmptyState/types.d.ts +7 -7
  403. package/esm/Field/Field.d.ts +4 -3
  404. package/esm/Field/Field.js +33 -25
  405. package/esm/Flag/Flag.d.ts +3 -2
  406. package/esm/Flag/Flag.js +57 -33
  407. package/esm/Flag/Flag.tailwind.d.ts +4 -4
  408. package/esm/Flag/Flag.tailwind.js +9 -16
  409. package/esm/Flag/Flags.d.ts +3 -3
  410. package/esm/Flag/Flags.js +30 -21
  411. package/esm/Flag/types.d.ts +8 -4
  412. package/esm/FlexGrid/FlexGrid.d.ts +2 -1
  413. package/esm/FlexGrid/FlexGrid.js +13 -8
  414. package/esm/FlexGrid/FlexGrid.tailwind.d.ts +6 -3
  415. package/esm/FlexGrid/FlexGrid.tailwind.js +10 -13
  416. package/esm/HelpUnderline/HelpUnderline.d.ts +2 -1
  417. package/esm/HelpUnderline/HelpUnderline.js +8 -6
  418. package/esm/HelpUnderline/HelpUnderline.tailwind.d.ts +4 -4
  419. package/esm/HelpUnderline/HelpUnderline.tailwind.js +4 -7
  420. package/esm/Input/Input.d.ts +11 -5
  421. package/esm/Input/Input.js +131 -109
  422. package/esm/Input/Input.tailwind.d.ts +4 -4
  423. package/esm/Input/Input.tailwind.js +14 -17
  424. package/esm/Insert/Insert.d.ts +3 -2
  425. package/esm/Insert/Insert.js +28 -21
  426. package/esm/InstantSearch/InstantSearch.tailwind.d.ts +4 -5
  427. package/esm/InstantSearch/InstantSearch.tailwind.js +35 -33
  428. package/esm/KeyboardKey/KeyboardKey.d.ts +2 -1
  429. package/esm/KeyboardKey/KeyboardKey.js +9 -6
  430. package/esm/KeyboardKey/KeyboardKey.tailwind.d.ts +4 -4
  431. package/esm/KeyboardKey/KeyboardKey.tailwind.js +6 -9
  432. package/esm/Link/BaseLink.d.ts +3 -3
  433. package/esm/Link/BaseLink.js +9 -3
  434. package/esm/Link/ButtonLink.d.ts +1 -1
  435. package/esm/Link/ButtonLink.js +9 -4
  436. package/esm/Link/IconButtonLink.d.ts +1 -1
  437. package/esm/Link/IconButtonLink.js +9 -4
  438. package/esm/Link/Link.d.ts +5 -5
  439. package/esm/Link/Link.js +18 -10
  440. package/esm/Medallion/Medallion.d.ts +2 -2
  441. package/esm/Medallion/Medallion.js +7 -6
  442. package/esm/Medallion/Medallion.tailwind.d.ts +4 -4
  443. package/esm/Medallion/Medallion.tailwind.js +8 -11
  444. package/esm/Modal/Modal.d.ts +8 -5
  445. package/esm/Modal/Modal.js +58 -39
  446. package/esm/Modal/Modal.tailwind.d.ts +4 -4
  447. package/esm/Modal/Modal.tailwind.js +10 -19
  448. package/esm/Modal/components/ModalFooter.d.ts +4 -2
  449. package/esm/Modal/components/ModalFooter.js +16 -9
  450. package/esm/Modal/components/ModalSection.d.ts +1 -1
  451. package/esm/Modal/components/ModalSection.js +5 -4
  452. package/esm/Pagination/CompactPagination/CompactPagination.d.ts +8 -0
  453. package/esm/Pagination/CompactPagination/CompactPagination.js +61 -37
  454. package/esm/Pagination/DotPagination/DotPagination.d.ts +5 -1
  455. package/esm/Pagination/DotPagination/DotPagination.js +33 -16
  456. package/esm/Pagination/Pagination/Pagination.d.ts +7 -1
  457. package/esm/Pagination/Pagination/Pagination.js +78 -48
  458. package/esm/ProgressBar/ProgressBar.d.ts +2 -2
  459. package/esm/ProgressBar/ProgressBar.js +16 -10
  460. package/esm/ProgressBar/ProgressBar.tailwind.d.ts +5 -5
  461. package/esm/ProgressBar/ProgressBar.tailwind.js +7 -10
  462. package/esm/ProgressSpinner/ProgressSpinner.d.ts +2 -2
  463. package/esm/ProgressSpinner/ProgressSpinner.js +18 -10
  464. package/esm/ProgressSpinner/ProgressSpinner.tailwind.d.ts +5 -5
  465. package/esm/ProgressSpinner/ProgressSpinner.tailwind.js +5 -8
  466. package/esm/RadioGroup/RadioButton.d.ts +3 -3
  467. package/esm/RadioGroup/RadioButton.js +9 -3
  468. package/esm/RadioGroup/RadioButton.tailwind.d.ts +4 -4
  469. package/esm/RadioGroup/RadioButton.tailwind.js +13 -16
  470. package/esm/RadioGroup/RadioGroup.d.ts +4 -3
  471. package/esm/RadioGroup/RadioGroup.js +36 -28
  472. package/esm/RangeSlider/RangeSlider.d.ts +3 -3
  473. package/esm/RangeSlider/RangeSlider.js +39 -31
  474. package/esm/RangeSlider/RangeSlider.tailwind.d.ts +4 -4
  475. package/esm/RangeSlider/RangeSlider.tailwind.js +21 -24
  476. package/esm/Satellite/Satellite.d.ts +5 -2
  477. package/esm/Satellite/Satellite.js +11 -6
  478. package/esm/Satellite/SatelliteContext.d.ts +3 -1
  479. package/esm/Satellite/SatelliteContext.js +4 -3
  480. package/esm/Satellite/SatelliteRouter.d.ts +1 -1
  481. package/esm/Satellite/index.d.ts +1 -0
  482. package/esm/Satellite/index.js +1 -0
  483. package/esm/Satellite/locale.d.ts +27 -0
  484. package/esm/Satellite/locale.js +8 -0
  485. package/esm/ScrollIndicator/ScrollIndicator.d.ts +6 -3
  486. package/esm/ScrollIndicator/ScrollIndicator.js +12 -10
  487. package/esm/ScrollIndicator/ScrollIndicator.tailwind.d.ts +4 -4
  488. package/esm/ScrollIndicator/ScrollIndicator.tailwind.js +8 -11
  489. package/esm/Select/Select.d.ts +3 -3
  490. package/esm/Select/Select.js +8 -3
  491. package/esm/Select/Select.tailwind.d.ts +5 -5
  492. package/esm/Select/Select.tailwind.js +5 -8
  493. package/esm/Sidebar/Sidebar.d.ts +6 -4
  494. package/esm/Sidebar/Sidebar.js +16 -8
  495. package/esm/Sidebar/Sidebar.tailwind.d.ts +4 -4
  496. package/esm/Sidebar/Sidebar.tailwind.js +6 -9
  497. package/esm/Sidebar/SidebarContext.d.ts +1 -1
  498. package/esm/Sidebar/components/SidebarHeader.d.ts +2 -2
  499. package/esm/Sidebar/components/SidebarHeader.js +11 -5
  500. package/esm/Sidebar/components/SidebarLink.d.ts +4 -3
  501. package/esm/Sidebar/components/SidebarLink.js +34 -21
  502. package/esm/Switch/Switch.d.ts +3 -3
  503. package/esm/Switch/Switch.js +16 -12
  504. package/esm/Switch/Switch.tailwind.d.ts +5 -5
  505. package/esm/Switch/Switch.tailwind.js +7 -8
  506. package/esm/Switch/SwitchOption.d.ts +2 -1
  507. package/esm/Switch/SwitchOption.js +25 -16
  508. package/esm/Tables/DataTable/DataTable.d.ts +15 -5
  509. package/esm/Tables/DataTable/DataTable.js +77 -54
  510. package/esm/Tables/DataTable/DataTable.tailwind.d.ts +4 -4
  511. package/esm/Tables/DataTable/DataTable.tailwind.js +4 -7
  512. package/esm/Tables/DataTable/components/Body.d.ts +7 -6
  513. package/esm/Tables/DataTable/components/Body.js +60 -45
  514. package/esm/Tables/DataTable/components/Footer.d.ts +1 -1
  515. package/esm/Tables/DataTable/components/Footer.js +5 -5
  516. package/esm/Tables/DataTable/components/Header.js +22 -18
  517. package/esm/Tables/DataTable/components/HeaderCell.d.ts +3 -3
  518. package/esm/Tables/DataTable/components/HeaderCell.js +20 -13
  519. package/esm/Tables/DataTable/components/Loader.d.ts +3 -1
  520. package/esm/Tables/DataTable/components/Loader.js +18 -14
  521. package/esm/Tables/DataTable/types.d.ts +3 -3
  522. package/esm/Tables/DataTable/utils.d.ts +1 -1
  523. package/esm/Tables/Table/Table.d.ts +3 -3
  524. package/esm/Tables/Table/Table.js +20 -11
  525. package/esm/Tables/Table/Table.tailwind.d.ts +4 -4
  526. package/esm/Tables/Table/Table.tailwind.js +4 -7
  527. package/esm/Tables/Table/components/Footer.d.ts +2 -2
  528. package/esm/Tables/Table/components/Footer.js +5 -4
  529. package/esm/Tabs/ContentTabs.d.ts +1 -1
  530. package/esm/Tabs/ContentTabs.js +38 -31
  531. package/esm/Tabs/LinkTabs.d.ts +1 -1
  532. package/esm/Tabs/LinkTabs.js +14 -14
  533. package/esm/Tabs/Tabs.tailwind.d.ts +4 -4
  534. package/esm/Tabs/Tabs.tailwind.js +6 -9
  535. package/esm/Tabs/components/LinkTab.d.ts +3 -3
  536. package/esm/Tabs/components/LinkTab.js +18 -11
  537. package/esm/Tabs/types.d.ts +6 -6
  538. package/esm/Tabs/utils.d.ts +1 -1
  539. package/esm/Tag/Tag.d.ts +8 -4
  540. package/esm/Tag/Tag.js +36 -19
  541. package/esm/Tag/Tag.tailwind.d.ts +4 -4
  542. package/esm/Tag/Tag.tailwind.js +7 -10
  543. package/esm/TextArea/TextArea.d.ts +3 -3
  544. package/esm/TextArea/TextArea.js +9 -3
  545. package/esm/TextArea/TextArea.tailwind.d.ts +4 -4
  546. package/esm/TextArea/TextArea.tailwind.js +6 -9
  547. package/esm/TextWrap/TextWrap.js +22 -17
  548. package/esm/Toggle/Toggle.d.ts +3 -3
  549. package/esm/Toggle/Toggle.js +25 -16
  550. package/esm/Toggle/Toggle.tailwind.d.ts +5 -5
  551. package/esm/Toggle/Toggle.tailwind.js +19 -22
  552. package/esm/Tooltip/OverflowTooltipWrapper.d.ts +3 -2
  553. package/esm/Tooltip/OverflowTooltipWrapper.js +35 -19
  554. package/esm/Tooltip/Tooltip.d.ts +3 -3
  555. package/esm/Tooltip/Tooltip.js +8 -3
  556. package/esm/Tooltip/Tooltip.tailwind.d.ts +4 -4
  557. package/esm/Tooltip/Tooltip.tailwind.js +20 -19
  558. package/esm/Tooltip/TooltipWrapper.d.ts +4 -3
  559. package/esm/Tooltip/TooltipWrapper.js +48 -33
  560. package/esm/Tooltip/types.d.ts +4 -2
  561. package/esm/Typography/Typography.tailwind.d.ts +5 -17
  562. package/esm/Typography/Typography.tailwind.js +126 -136
  563. package/esm/UserContent/UserContent.js +2 -2
  564. package/esm/UserContent/UserContent.tailwind.d.ts +4 -1
  565. package/esm/UserContent/UserContent.tailwind.js +14 -14
  566. package/esm/styles/base.tailwind.d.ts +4 -4
  567. package/esm/styles/base.tailwind.js +4 -7
  568. package/esm/styles/tailwind.config.d.ts +2 -198
  569. package/esm/styles/tailwind.config.js +29 -32
  570. package/esm/types.d.ts +10 -3
  571. package/esm/utilities/utilities.tailwind.d.ts +4 -1
  572. package/esm/utilities/utilities.tailwind.js +4 -6
  573. package/esm/utils/genericChangeHandler.d.ts +3 -3
  574. package/esm/utils/isCssPropertySupported.d.ts +1 -1
  575. package/esm/utils/isRenderedChild.d.ts +2 -2
  576. package/esm/utils/pluralize.js +6 -1
  577. package/esm/utils/useForwardedRef.d.ts +2 -2
  578. package/esm/utils/useForwardedRef.js +1 -1
  579. package/esm/utils/useLinkProps.d.ts +2 -2
  580. package/esm/utils/useTriggerInputChange.d.ts +2 -2
  581. package/package.json +11 -14
  582. package/satellite.min.css +2 -4
  583. package/scss/colors.scss +1 -0
  584. package/cjs/tailwind-types.d.ts +0 -52
  585. package/esm/tailwind-types.d.ts +0 -52
  586. package/satellite.css +0 -196852
@@ -1,13 +1,24 @@
1
- import _extends from "@babel/runtime/helpers/extends";
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
3
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
4
- var _excluded = ["size", "text", "variant", "className"];
4
+ var _excluded = ["size", "text", "variant", "className", "locale"];
5
5
 
6
6
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
7
7
 
8
- import React from "react";
8
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
9
+
10
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
11
+
9
12
  import cx from "classnames";
13
+ import { useLocale } from "../Satellite";
10
14
  import stl from "../styles/helpers/satellitePrefixer";
15
+ import { jsx as _jsx } from "react/jsx-runtime";
16
+ var DEFAULT_LOCALE = {
17
+ beta: "beta",
18
+ internal: "internal",
19
+ "new": "new",
20
+ pilot: "pilot"
21
+ };
11
22
  var DEFAULT_CLASSNAME = stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["capitalize inline-block rounded-full text-white select-none"])));
12
23
  var SIZE_CLASSNAMES = {
13
24
  "default": stl(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["display-body h-6 leading-md px-2"]))),
@@ -20,11 +31,17 @@ export var AnnouncementBadge = function AnnouncementBadge(_ref) {
20
31
  text = _ref$text === void 0 ? "new" : _ref$text,
21
32
  variantProp = _ref.variant,
22
33
  className = _ref.className,
34
+ propsLocale = _ref.locale,
23
35
  props = _objectWithoutProperties(_ref, _excluded);
24
36
 
37
+ var contextLocale = useLocale("announcementBadge");
38
+
39
+ var locale = _objectSpread(_objectSpread(_objectSpread({}, DEFAULT_LOCALE), contextLocale), propsLocale);
40
+
25
41
  var variant = typeof variantProp === "string" ? variantProp : text === "internal" ? "red" : "accent";
26
- return /*#__PURE__*/React.createElement("span", _extends({}, props, {
27
- className: cx(DEFAULT_CLASSNAME, variant === "red" ? stl(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["bg-red-600"]))) : stl(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["bg-accent-600"]))), SIZE_CLASSNAMES[size], className)
28
- }), text);
42
+ return /*#__PURE__*/_jsx("span", _objectSpread(_objectSpread({}, props), {}, {
43
+ className: cx(DEFAULT_CLASSNAME, variant === "red" ? stl(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["bg-red-600"]))) : stl(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["bg-accent-600"]))), SIZE_CLASSNAMES[size], className),
44
+ children: locale[text]
45
+ }));
29
46
  };
30
47
  export default AnnouncementBadge;
@@ -1,13 +1,17 @@
1
- import React, { Component } from "react";
2
- import { ControllerStateAndHelpers } from "downshift";
1
+ import type { A11yStatusMessageOptions, ControllerStateAndHelpers } from "downshift";
2
+ import { Component } from "react";
3
+ import type { ChangeEvent, FocusEvent, KeyboardEvent, MouseEvent } from "react";
3
4
  import { FieldState } from "../Field/FieldStateContext";
4
- import { Option, AutoCompleteProps } from "./types";
5
+ import type { AutoCompleteLocale, AutoCompleteProps, Option, OptionItemProps } from "./types";
5
6
  interface State {
6
7
  inputFocused: boolean;
7
8
  inputValue: string;
8
9
  inputWidth?: number;
9
10
  showAllResults: boolean;
10
11
  }
12
+ declare type DefaultOptionProps = OptionItemProps & {
13
+ optionItemPrefix?: AutoCompleteLocale["optionItemPrefix"];
14
+ };
11
15
  /**
12
16
  * Autocomplete is a search-as-you-type function that matches what a person types, usually the beginning of a word, or a prefix, with a word list. Not to be confused with auto-suggestion that predicts the end of a query.
13
17
  *
@@ -24,37 +28,39 @@ interface State {
24
28
  * - Provide matching results quickly
25
29
  * - Style different data
26
30
  */
27
- export declare class AutoComplete<T extends Option> extends Component<AutoCompleteProps, State> {
31
+ export declare class AutoComplete<T extends Option = Option> extends Component<AutoCompleteProps<T>, State> {
32
+ static contextType: import("react").Context<import("../Satellite").SatelliteContextType>;
28
33
  static defaultProps: {
29
34
  clearable: boolean;
30
35
  creatable: boolean;
31
36
  multiple: boolean;
32
37
  maxResults: number;
33
- emptyState: JSX.Element;
34
- createFromInputValue: import("./types").CreateFromInputValue;
38
+ createFromInputValue: <T_1 extends Option = Option>(options: T_1[] | undefined, inputValue: string) => Option[];
35
39
  options: never[];
36
40
  separatorKeyCodes: never[];
37
41
  separatorKeys: never[];
38
- optionItemComponent: import("./types").OptionItemComponentType;
42
+ optionItemComponent: ({ optionItemPrefix, ...props }: DefaultOptionProps) => JSX.Element;
39
43
  noWrap: boolean;
40
44
  };
41
45
  state: State;
42
46
  inputContainerRef: HTMLDivElement | null;
43
47
  inputRef: HTMLInputElement | null;
44
- componentDidUpdate(prevProps: AutoCompleteProps): void;
48
+ componentDidUpdate(prevProps: AutoCompleteProps<T>): void;
45
49
  handleClearClick: () => void;
46
50
  handleFakeInputClick: () => void | null;
47
- handleInputBlur: (state: ControllerStateAndHelpers<Option>) => (evt: React.FocusEvent<HTMLInputElement>) => void;
48
- handleInputChange: (evt: React.ChangeEvent<HTMLInputElement>) => void;
51
+ handleInputBlur: (state: ControllerStateAndHelpers<T | Option>) => (evt: FocusEvent<HTMLInputElement>) => void;
52
+ handleInputChange: (evt: ChangeEvent<HTMLInputElement>) => void;
49
53
  handleInputContainerRefUpdate: (el: HTMLDivElement | null) => void;
50
54
  updateInputWidth: () => void;
51
- handleKeyDown: (state: ControllerStateAndHelpers<Option>) => (evt: React.KeyboardEvent<any>) => void;
52
- handleChange: (option: Option) => void;
53
- handleShowAllResults: (evt: React.MouseEvent<HTMLButtonElement>) => void;
54
- removeValue: (removedOption: Option) => void;
55
- renderInput: (results: Option[], autocompleteHelpers: ControllerStateAndHelpers<Option>, fieldState: FieldState) => JSX.Element;
56
- renderMenu: (results: Option[], autocompleteHelpers: ControllerStateAndHelpers<Option>) => JSX.Element;
57
- renderSelect: (autocompleteHelpers: ControllerStateAndHelpers<Option>, fieldState: FieldState) => JSX.Element;
55
+ handleKeyDown: (state: ControllerStateAndHelpers<T | Option>) => (evt: KeyboardEvent<any>) => void;
56
+ handleChange: (option: T) => void;
57
+ handleShowAllResults: (evt: MouseEvent<HTMLButtonElement>) => void;
58
+ removeValue: (removedOption: T) => void;
59
+ getA11yStatusMessage: (options: A11yStatusMessageOptions<Option>) => any;
60
+ renderInput: (results: T[], autocompleteHelpers: ControllerStateAndHelpers<T | Option>, fieldState: FieldState) => JSX.Element;
61
+ renderMenu: (results: T[], autocompleteHelpers: ControllerStateAndHelpers<T | Option>) => JSX.Element;
62
+ renderSelect: (autocompleteHelpers: ControllerStateAndHelpers<T | Option>, fieldState: FieldState) => JSX.Element;
63
+ private get locale();
58
64
  render(): JSX.Element;
59
65
  }
60
66
  export default AutoComplete;
@@ -1,4 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
3
2
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
4
3
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
@@ -9,40 +8,45 @@ import _inherits from "@babel/runtime/helpers/inherits";
9
8
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
10
9
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
11
10
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
11
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
12
12
 
13
13
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16;
14
14
 
15
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
16
-
17
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
15
+ var _excluded = ["optionItemPrefix"];
18
16
 
19
17
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
20
18
 
21
19
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
22
20
 
21
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
22
+
23
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
24
+
23
25
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
24
26
 
25
27
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
26
28
 
27
29
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
28
30
 
29
- import React, { Component } from "react";
30
- import { createPortal } from "react-dom";
31
- import { Popper } from "react-popper";
32
- import Downshift from "downshift";
33
31
  import cx from "classnames";
32
+ import Downshift from "downshift";
33
+ import { Component } from "react";
34
+ import { createPortal } from "react-dom";
34
35
  import { X } from "react-feather";
35
- import stl from "../styles/helpers/satellitePrefixer";
36
- import pluralize from "../utils/pluralize";
37
- import uniqBy from "../utils/uniqBy";
38
- import Card from "../Card";
36
+ import { Popper } from "react-popper";
39
37
  import Button from "../Button";
38
+ import Card from "../Card";
39
+ import { FieldStateContext } from "../Field/FieldStateContext";
40
+ import { SatelliteContext } from "../Satellite";
40
41
  import ScrollIndicator from "../ScrollIndicator";
42
+ import stl from "../styles/helpers/satellitePrefixer";
41
43
  import Tag from "../Tag";
42
- import { FieldStateContext } from "../Field/FieldStateContext";
43
- import { defaultCreateFromInputValue, isAutoCompleteMultiProps } from "./utils";
44
- import DefaultOptionItem from "./components/DefaultOptionItem";
44
+ import uniqBy from "../utils/uniqBy";
45
45
  import AutoCompleteEmptyState from "./components/AutoCompleteEmptyState";
46
+ import DefaultOptionItem from "./components/DefaultOptionItem";
47
+ import { DEFAULT_AUTOCOMPLETE_LOCALE, defaultCreateFromInputValue, isAutoCompleteMultiProps } from "./utils";
48
+ import { jsx as _jsx } from "react/jsx-runtime";
49
+ import { jsxs as _jsxs } from "react/jsx-runtime";
46
50
 
47
51
  function optionToString(option) {
48
52
  return option ? option.label : "";
@@ -105,9 +109,25 @@ var MENU_POPPER_MODFIERS = [{
105
109
  }
106
110
  }];
107
111
  var BACKSPACE_KEY_CODE = 8;
108
- var defaultEmptyState = /*#__PURE__*/React.createElement(AutoCompleteEmptyState, {
109
- title: "No matches found"
110
- });
112
+
113
+ /** @ignore */
114
+ var DefaultEmptyState = function DefaultEmptyState(_ref) {
115
+ var emptyStateTitle = _ref.emptyStateTitle;
116
+ return /*#__PURE__*/_jsx(AutoCompleteEmptyState, {
117
+ title: emptyStateTitle
118
+ });
119
+ };
120
+
121
+ var DefaultOption = function DefaultOption(_ref2) {
122
+ var optionItemPrefix = _ref2.optionItemPrefix,
123
+ props = _objectWithoutProperties(_ref2, _excluded);
124
+
125
+ return /*#__PURE__*/_jsx(DefaultOptionItem, _objectSpread(_objectSpread({}, props), {}, {
126
+ locale: {
127
+ optionItemPrefix: optionItemPrefix !== null && optionItemPrefix !== void 0 ? optionItemPrefix : DEFAULT_AUTOCOMPLETE_LOCALE.optionItemPrefix
128
+ }
129
+ }));
130
+ };
111
131
  /**
112
132
  * Autocomplete is a search-as-you-type function that matches what a person types, usually the beginning of a word, or a prefix, with a word list. Not to be confused with auto-suggestion that predicts the end of a query.
113
133
  *
@@ -125,6 +145,7 @@ var defaultEmptyState = /*#__PURE__*/React.createElement(AutoCompleteEmptyState,
125
145
  * - Style different data
126
146
  */
127
147
 
148
+
128
149
  export var AutoComplete = /*#__PURE__*/function (_Component) {
129
150
  _inherits(AutoComplete, _Component);
130
151
 
@@ -312,6 +333,22 @@ export var AutoComplete = /*#__PURE__*/function (_Component) {
312
333
  _this.props.onChange(newOptions);
313
334
  });
314
335
 
336
+ _defineProperty(_assertThisInitialized(_this), "getA11yStatusMessage", function (options) {
337
+ if (!options.isOpen) {
338
+ return "";
339
+ }
340
+
341
+ if (!options.resultCount) {
342
+ return _this.locale.emptyStateTitle;
343
+ }
344
+
345
+ if (options.resultCount > 0) {
346
+ return _this.locale.itemsAvailable(options.resultCount);
347
+ }
348
+
349
+ return "";
350
+ });
351
+
315
352
  _defineProperty(_assertThisInitialized(_this), "renderInput", function (results, autocompleteHelpers, fieldState) {
316
353
  var _this$props3 = _this.props,
317
354
  id = _this$props3.id,
@@ -373,45 +410,50 @@ export var AutoComplete = /*#__PURE__*/function (_Component) {
373
410
  autoComplete: "off",
374
411
  autoFocus: autoFocus
375
412
  });
376
- return /*#__PURE__*/React.createElement("div", {
413
+ return /*#__PURE__*/_jsxs("div", {
377
414
  className: inputContainerClassName,
378
415
  onClick: _this.handleFakeInputClick,
379
- ref: _this.handleInputContainerRefUpdate
380
- }, Icon && /*#__PURE__*/React.createElement(Icon, {
381
- className: stl(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["mr-4 flex-shrink-0 ", ""])), disabled ? "text-grey-200" : inputFocused ? "text-accent-600" : "text-grey-500"),
382
- size: "1rem"
383
- }), /*#__PURE__*/React.createElement("div", {
384
- className: cx(stl(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["flex items-center flex-1 ", " ", ""])), !noWrap && "flex-wrap", multiple && "-ml-1"), valuesClassName)
385
- }, multiple && Array.isArray(value) && value.map(function (option) {
386
- return renderValueTemplate ? renderValueTemplate({
387
- option: option,
388
- key: String(option.value),
389
- editable: !disabled
390
- }) : /*#__PURE__*/React.createElement(Tag, {
391
- key: String(option.value),
392
- onDelete: disabled ? undefined : function () {
393
- return _this.removeValue(option);
394
- },
395
- className: stl(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["m-1 max-w-48 ", ""])), disabled && "opacity-50")
396
- }, option.label);
397
- }), shouldRenderCustomTemplate && renderValueTemplate({
398
- option: value,
399
- key: String(value),
400
- editable: !disabled
401
- }), /*#__PURE__*/React.createElement("input", _extends({}, inputProps, {
402
- "data-lpignore": true
403
- }))), (showClearButton || endItem) && /*#__PURE__*/React.createElement("div", {
404
- className: cx(showClearButton && endItem && stl(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["my-2 flex self-end space-x-4"]))))
405
- }, endItem && /*#__PURE__*/React.createElement("div", {
406
- className: stl(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["text-grey-700 my-auto"])))
407
- }, endItem), showClearButton && /*#__PURE__*/React.createElement("button", {
408
- type: "button",
409
- className: stl(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["w-6 flex items-center justify-center text-grey-500"]))),
410
- onClick: _this.handleClearClick,
411
- "aria-label": "Clear input value"
412
- }, /*#__PURE__*/React.createElement(X, {
413
- size: ".75rem"
414
- }))));
416
+ ref: _this.handleInputContainerRefUpdate,
417
+ children: [Icon && /*#__PURE__*/_jsx(Icon, {
418
+ className: stl(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["mr-4 shrink-0 ", ""])), disabled ? "text-grey-200" : inputFocused ? "text-accent-600" : "text-grey-500"),
419
+ size: "1rem"
420
+ }), /*#__PURE__*/_jsxs("div", {
421
+ className: cx(stl(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["flex items-center flex-1 ", " ", ""])), !noWrap && "flex-wrap", multiple && "-ml-1"), valuesClassName),
422
+ children: [multiple && Array.isArray(value) && value.map(function (option) {
423
+ return renderValueTemplate ? renderValueTemplate({
424
+ option: option,
425
+ key: String(option.value),
426
+ editable: !disabled
427
+ }) : /*#__PURE__*/_jsx(Tag, {
428
+ onDelete: disabled ? undefined : function () {
429
+ return _this.removeValue(option);
430
+ },
431
+ className: stl(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["m-1 max-w-48 ", ""])), disabled && "opacity-50"),
432
+ children: option.label
433
+ }, String(option.value));
434
+ }), shouldRenderCustomTemplate && renderValueTemplate({
435
+ option: value,
436
+ key: String(value),
437
+ editable: !disabled
438
+ }), /*#__PURE__*/_jsx("input", _objectSpread(_objectSpread({}, inputProps), {}, {
439
+ "data-lpignore": true
440
+ }))]
441
+ }), (showClearButton || endItem) && /*#__PURE__*/_jsxs("div", {
442
+ className: cx(showClearButton && endItem && stl(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["my-2 flex self-end space-x-4"])))),
443
+ children: [endItem && /*#__PURE__*/_jsx("div", {
444
+ className: stl(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["text-grey-700 my-auto"]))),
445
+ children: endItem
446
+ }), showClearButton && /*#__PURE__*/_jsx("button", {
447
+ type: "button",
448
+ className: stl(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["w-6 flex items-center justify-center text-grey-500"]))),
449
+ onClick: _this.handleClearClick,
450
+ "aria-label": _this.locale.clearInputButton,
451
+ children: /*#__PURE__*/_jsx(X, {
452
+ size: ".75rem"
453
+ })
454
+ })]
455
+ })]
456
+ });
415
457
  });
416
458
 
417
459
  _defineProperty(_assertThisInitialized(_this), "renderMenu", function (results, autocompleteHelpers) {
@@ -422,12 +464,17 @@ export var AutoComplete = /*#__PURE__*/function (_Component) {
422
464
  highlightedIndex = autocompleteHelpers.highlightedIndex,
423
465
  inputValue = autocompleteHelpers.inputValue,
424
466
  isOpen = autocompleteHelpers.isOpen;
467
+
468
+ var defaultEmptyState = /*#__PURE__*/_jsx(DefaultEmptyState, {
469
+ emptyStateTitle: _this.locale.emptyStateTitle
470
+ });
471
+
425
472
  var _this$props4 = _this.props,
426
473
  menuClassName = _this$props4.menuClassName,
427
474
  menuSize = _this$props4.menuSize,
428
- _this$props4$emptySta = _this$props4.emptyState,
429
- emptyState = _this$props4$emptySta === void 0 ? AutoComplete.defaultProps.emptyState : _this$props4$emptySta,
430
475
  menuFooter = _this$props4.menuFooter,
476
+ _this$props4$emptySta = _this$props4.emptyState,
477
+ emptyState = _this$props4$emptySta === void 0 ? defaultEmptyState : _this$props4$emptySta,
431
478
  _this$props4$maxResul = _this$props4.maxResults,
432
479
  maxResults = _this$props4$maxResul === void 0 ? AutoComplete.defaultProps.maxResults : _this$props4$maxResul,
433
480
  _this$props4$multiple = _this$props4.multiple,
@@ -451,49 +498,60 @@ export var AutoComplete = /*#__PURE__*/function (_Component) {
451
498
  var showResults = results.length > 0;
452
499
 
453
500
  if (!isOpen || !showResults && !shouldShowEmptyState && !shouldShowDefaultEmptyState) {
454
- return /*#__PURE__*/React.createElement("ul", _extends({}, getMenuProps(), {
501
+ return /*#__PURE__*/_jsx("ul", _objectSpread(_objectSpread({}, getMenuProps()), {}, {
455
502
  className: stl(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["hidden h-0"])))
456
503
  }));
457
504
  }
458
505
 
459
- return /*#__PURE__*/React.createElement(Popper, {
506
+ return /*#__PURE__*/_jsx(Popper, {
460
507
  placement: "bottom-start",
461
508
  strategy: "fixed",
462
509
  referenceElement: (_this$inputContainerR3 = _this.inputContainerRef) !== null && _this$inputContainerR3 !== void 0 ? _this$inputContainerR3 : undefined,
463
- modifiers: MENU_POPPER_MODFIERS
464
- }, function (popper) {
465
- return /*#__PURE__*/React.createElement("div", {
466
- className: cx(stl(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["z-dropdown"]))), menuClassName),
467
- style: _objectSpread(_objectSpread({}, popper.style), dropdownStyle),
468
- "data-popper-placement": popper.placement,
469
- ref: popper.ref
470
- }, /*#__PURE__*/React.createElement(Card, {
471
- fullBleed: true,
472
- elevation: "300"
473
- }, results.length === 0 ? /*#__PURE__*/React.createElement("div", _extends({}, getMenuProps(), {
474
- className: stl(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["min-h-10"])))
475
- }), emptyState) : /*#__PURE__*/React.createElement(ScrollIndicator, {
476
- className: menuSize === "large" ? stl(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["max-h-96"]))) : stl(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["max-h-64"])))
477
- }, /*#__PURE__*/React.createElement("ul", getMenuProps(), results.slice(0, showAllResults ? Number.MAX_SAFE_INTEGER : maxResults).map(function (result, index) {
478
- return /*#__PURE__*/React.createElement("li", _extends({
479
- key: result.value
480
- }, getItemProps({
481
- item: result,
482
- disabled: result.disabled,
483
- className: stl(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n autocomplete-result\n flex items-center min-h-10 px-4 cursor-pointer\n ", "\n ", "\n "])), index === highlightedIndex && "bg-grey-100", result.disabled && "cursor-not-allowed")
484
- })), /*#__PURE__*/React.createElement(OptionItem, _extends({}, optionItemProps, {
485
- highlighted: index === highlightedIndex,
486
- option: result
487
- })));
488
- }), extraResults > 0 && !showAllResults && /*#__PURE__*/React.createElement("li", {
489
- className: stl(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["p-2 text-right"])))
490
- }, /*#__PURE__*/React.createElement(Button, {
491
- variant: "subtle",
492
- size: "small",
493
- onMouseDown: _this.handleShowAllResults
494
- }, "Show ", pluralize(extraResults, "result"), " more")))), menuFooter && /*#__PURE__*/React.createElement("footer", {
495
- className: stl(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["flex items-center justify-center min-h-12 p-4 bg-grey-100 border-t border-grey-200 text-grey-600"])))
496
- }, menuFooter)));
510
+ modifiers: MENU_POPPER_MODFIERS,
511
+ children: function children(popper) {
512
+ return /*#__PURE__*/_jsx("div", {
513
+ className: cx(stl(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["z-dropdown"]))), menuClassName),
514
+ style: _objectSpread(_objectSpread({}, popper.style), dropdownStyle),
515
+ "data-popper-placement": popper.placement,
516
+ ref: popper.ref,
517
+ children: /*#__PURE__*/_jsxs(Card, {
518
+ fullBleed: true,
519
+ elevation: "300",
520
+ children: [results.length === 0 ? /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({}, getMenuProps()), {}, {
521
+ className: stl(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["min-h-10"]))),
522
+ children: emptyState
523
+ })) : /*#__PURE__*/_jsx(ScrollIndicator, {
524
+ className: menuSize === "large" ? stl(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["max-h-96"]))) : stl(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["max-h-64"]))),
525
+ children: /*#__PURE__*/_jsxs("ul", _objectSpread(_objectSpread({}, getMenuProps()), {}, {
526
+ children: [results.slice(0, showAllResults ? Number.MAX_SAFE_INTEGER : maxResults).map(function (result, index) {
527
+ return /*#__PURE__*/_jsx("li", _objectSpread(_objectSpread({}, getItemProps({
528
+ item: result,
529
+ disabled: result.disabled,
530
+ className: stl(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n autocomplete-result\n flex items-center min-h-10 px-4 cursor-pointer\n ", "\n ", "\n "])), index === highlightedIndex && "bg-grey-100", result.disabled && "cursor-not-allowed")
531
+ })), {}, {
532
+ children: /*#__PURE__*/_jsx(OptionItem, _objectSpread(_objectSpread({}, optionItemProps), {}, {
533
+ highlighted: index === highlightedIndex,
534
+ option: result,
535
+ optionItemPrefix: _this.locale.optionItemPrefix
536
+ }))
537
+ }), result.value);
538
+ }), extraResults > 0 && !showAllResults && /*#__PURE__*/_jsx("li", {
539
+ className: stl(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["p-2 text-right"]))),
540
+ children: /*#__PURE__*/_jsx(Button, {
541
+ variant: "subtle",
542
+ size: "small",
543
+ onMouseDown: _this.handleShowAllResults,
544
+ children: _this.locale.showMoreButton(extraResults)
545
+ })
546
+ })]
547
+ }))
548
+ }), menuFooter && /*#__PURE__*/_jsx("footer", {
549
+ className: stl(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["flex items-center justify-center min-h-12 p-4 bg-grey-100 border-t border-grey-200 text-grey-600"]))),
550
+ children: menuFooter
551
+ })]
552
+ })
553
+ });
554
+ }
497
555
  });
498
556
  });
499
557
 
@@ -513,9 +571,10 @@ export var AutoComplete = /*#__PURE__*/function (_Component) {
513
571
  results.unshift.apply(results, _toConsumableArray(createFromInputValue(options, inputValue)));
514
572
  }
515
573
 
516
- return /*#__PURE__*/React.createElement("div", {
517
- className: className
518
- }, _this.renderInput(results, autocompleteHelpers, fieldState), _this.inputContainerRef && /*#__PURE__*/createPortal(_this.renderMenu(results, autocompleteHelpers), document.body));
574
+ return /*#__PURE__*/_jsxs("div", {
575
+ className: className,
576
+ children: [_this.renderInput(results, autocompleteHelpers, fieldState), _this.inputContainerRef && /*#__PURE__*/createPortal(_this.renderMenu(results, autocompleteHelpers), document.body)]
577
+ });
519
578
  });
520
579
 
521
580
  return _this;
@@ -537,29 +596,38 @@ export var AutoComplete = /*#__PURE__*/function (_Component) {
537
596
  });
538
597
  }
539
598
  }
599
+ }, {
600
+ key: "locale",
601
+ get: function get() {
602
+ return _objectSpread(_objectSpread(_objectSpread({}, DEFAULT_AUTOCOMPLETE_LOCALE), this.context["locales"]), this.props.locale);
603
+ }
540
604
  }, {
541
605
  key: "render",
542
606
  value: function render() {
543
607
  var _this2 = this;
544
608
 
545
609
  var inputValue = (this.props.inputValue !== undefined ? this.props.inputValue : this.state.inputValue) || "";
546
- return /*#__PURE__*/React.createElement(FieldStateContext.Consumer, null, function (fieldState) {
547
- return /*#__PURE__*/React.createElement(Downshift, {
548
- inputValue: inputValue
549
- /*
550
- * See https://github.com/algolia/AlgoliaWeb/issues/9045
551
- * See multi-select example
552
- * https://github.com/downshift-js/downshift#examples
553
- * https://codesandbox.io/s/github/kentcdodds/downshift-examples/tree/master/?module=/src/ordered-examples/04-multi-select.js&moduleview=1&file=/src/ordered-examples/04-multi-select.js:2482-2509
554
- */
555
- ,
556
- selectedItem: null,
557
- onChange: _this2.handleChange,
558
- itemToString: optionToString,
559
- defaultHighlightedIndex: 0
560
- }, function (autocompleteHelpers) {
561
- return _this2.renderSelect(autocompleteHelpers, fieldState);
562
- });
610
+ return /*#__PURE__*/_jsx(FieldStateContext.Consumer, {
611
+ children: function children(fieldState) {
612
+ return /*#__PURE__*/_jsx(Downshift, {
613
+ inputValue: inputValue
614
+ /*
615
+ * See https://github.com/algolia/AlgoliaWeb/issues/9045
616
+ * See multi-select example
617
+ * https://github.com/downshift-js/downshift#examples
618
+ * https://codesandbox.io/s/github/kentcdodds/downshift-examples/tree/master/?module=/src/ordered-examples/04-multi-select.js&moduleview=1&file=/src/ordered-examples/04-multi-select.js:2482-2509
619
+ */
620
+ ,
621
+ selectedItem: null,
622
+ getA11yStatusMessage: _this2.getA11yStatusMessage,
623
+ onChange: _this2.handleChange,
624
+ itemToString: optionToString,
625
+ defaultHighlightedIndex: 0,
626
+ children: function children(autocompleteHelpers) {
627
+ return _this2.renderSelect(autocompleteHelpers, fieldState);
628
+ }
629
+ });
630
+ }
563
631
  });
564
632
  }
565
633
  }]);
@@ -567,17 +635,18 @@ export var AutoComplete = /*#__PURE__*/function (_Component) {
567
635
  return AutoComplete;
568
636
  }(Component);
569
637
 
638
+ _defineProperty(AutoComplete, "contextType", SatelliteContext);
639
+
570
640
  _defineProperty(AutoComplete, "defaultProps", {
571
641
  clearable: false,
572
642
  creatable: false,
573
643
  multiple: false,
574
644
  maxResults: 7,
575
- emptyState: defaultEmptyState,
576
645
  createFromInputValue: defaultCreateFromInputValue,
577
646
  options: [],
578
647
  separatorKeyCodes: [],
579
648
  separatorKeys: [],
580
- optionItemComponent: DefaultOptionItem,
649
+ optionItemComponent: DefaultOption,
581
650
  noWrap: false
582
651
  });
583
652
 
@@ -1,5 +1,5 @@
1
1
  export = autoCompletePlugin;
2
- /**
3
- * @type {import('../tailwind-types').TailwindPlugin}
4
- */
5
- declare const autoCompletePlugin: import('../tailwind-types').TailwindPlugin;
2
+ declare const autoCompletePlugin: {
3
+ handler: import("tailwindcss/types/config").PluginCreator;
4
+ config?: import("tailwindcss").Config | undefined;
5
+ };
@@ -1,13 +1,11 @@
1
1
  import _rgba from "../styles/rgba";
2
2
  import _disabledColor from "../styles/disabledColor";
3
+ import _plugin from "tailwindcss/plugin";
3
4
  // @ts-check
5
+ var plugin = _plugin;
4
6
  var disabledColor = _disabledColor;
5
7
  var rgba = _rgba;
6
- /**
7
- * @type {import('../tailwind-types').TailwindPlugin}
8
- */
9
-
10
- var autoCompletePlugin = function autoCompletePlugin(_ref) {
8
+ var autoCompletePlugin = plugin(function (_ref) {
11
9
  var addComponents = _ref.addComponents,
12
10
  theme = _ref.theme;
13
11
  addComponents({
@@ -30,14 +28,14 @@ var autoCompletePlugin = function autoCompletePlugin(_ref) {
30
28
  "&::after": {
31
29
  content: '" "',
32
30
  display: "block",
33
- minHeight: 30,
31
+ minHeight: "30px",
34
32
  // don't ask me why 30
35
- fontSize: 0
33
+ fontSize: "0px"
36
34
  },
37
35
  "&.autocomplete-large": {
38
36
  minHeight: "3rem",
39
37
  "&::after": {
40
- minHeight: 38 // don't ask me why 38
38
+ minHeight: "38px" // don't ask me why 38
41
39
 
42
40
  }
43
41
  }
@@ -67,12 +65,12 @@ var autoCompletePlugin = function autoCompletePlugin(_ref) {
67
65
  scrollbarWidth: "none",
68
66
  msOverflowStyle: "-ms-autohiding-scrollbar",
69
67
  "&::-webkit-scrollbar": {
70
- width: 0,
71
- height: 0
68
+ width: "0px",
69
+ height: "0px"
72
70
  }
73
71
  },
74
72
  ".autocomplete-input": {
75
- flex: 1,
73
+ flex: "1",
76
74
  backgroundColor: "transparent",
77
75
  caretColor: theme("colors.grey.600"),
78
76
  color: theme("colors.grey.900"),
@@ -92,6 +90,5 @@ var autoCompletePlugin = function autoCompletePlugin(_ref) {
92
90
  }
93
91
  }
94
92
  });
95
- };
96
-
93
+ });
97
94
  export default autoCompletePlugin;