@algolia/satellite 1.0.0-beta.132 → 1.0.0-beta.135

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 (437) hide show
  1. package/README.md +33 -28
  2. package/cjs/AnnouncementBadge/AnnouncementBadge.d.ts +6 -1
  3. package/cjs/AnnouncementBadge/AnnouncementBadge.js +15 -2
  4. package/cjs/AutoComplete/AutoComplete.d.ts +19 -14
  5. package/cjs/AutoComplete/AutoComplete.js +65 -18
  6. package/cjs/AutoComplete/AutoComplete.tailwind.d.ts +4 -4
  7. package/cjs/AutoComplete/AutoComplete.tailwind.js +10 -13
  8. package/cjs/AutoComplete/components/DefaultOptionItem.d.ts +6 -2
  9. package/cjs/AutoComplete/components/DefaultOptionItem.js +5 -2
  10. package/cjs/AutoComplete/types.d.ts +26 -18
  11. package/cjs/AutoComplete/utils.d.ts +5 -4
  12. package/cjs/AutoComplete/utils.js +22 -2
  13. package/cjs/Avatars/ApplicationAvatar.js +1 -1
  14. package/cjs/Banners/Alert/Alert.d.ts +1 -0
  15. package/cjs/Banners/Alert/Alert.js +1 -1
  16. package/cjs/Banners/BigBertha/BigBertha.d.ts +2 -1
  17. package/cjs/Banners/Promote/Promote.d.ts +1 -0
  18. package/cjs/Button/Button.js +2 -2
  19. package/cjs/Button/Button.tailwind.d.ts +4 -4
  20. package/cjs/Button/Button.tailwind.js +11 -14
  21. package/cjs/Button/ButtonGroup.d.ts +2 -1
  22. package/cjs/Card/Card.tailwind.d.ts +4 -4
  23. package/cjs/Card/Card.tailwind.js +5 -8
  24. package/cjs/Card/components/CardTitle.d.ts +4 -2
  25. package/cjs/Checkbox/Checkbox.d.ts +1 -1
  26. package/cjs/Checkbox/Checkbox.tailwind.d.ts +5 -5
  27. package/cjs/Checkbox/Checkbox.tailwind.js +11 -14
  28. package/cjs/ClickAwayContainer/ClickAwayContainer.d.ts +2 -1
  29. package/cjs/DatePicker/DatePicker/DatePicker.d.ts +5 -11
  30. package/cjs/DatePicker/DatePicker/DatePicker.js +17 -7
  31. package/cjs/DatePicker/DatePicker.tailwind.d.ts +4 -4
  32. package/cjs/DatePicker/DatePicker.tailwind.js +19 -14
  33. package/cjs/DatePicker/DateRangePicker/DateRangePicker.d.ts +5 -11
  34. package/cjs/DatePicker/DateRangePicker/DateRangePicker.js +25 -8
  35. package/cjs/DatePicker/DateRangePicker/DateRangePickerDisplay.d.ts +3 -0
  36. package/cjs/DatePicker/DateRangePicker/DateRangePickerDisplay.js +3 -2
  37. package/cjs/DatePicker/components/Calendar.d.ts +5 -1
  38. package/cjs/DatePicker/components/Calendar.js +3 -1
  39. package/cjs/DatePicker/components/Display.d.ts +1 -1
  40. package/cjs/DatePicker/components/FooterActions.d.ts +3 -0
  41. package/cjs/DatePicker/components/FooterActions.js +4 -3
  42. package/cjs/DatePicker/components/Modal.d.ts +2 -2
  43. package/cjs/DatePicker/components/Modal.js +5 -4
  44. package/cjs/DatePicker/components/NavBar.d.ts +5 -1
  45. package/cjs/DatePicker/components/NavBar.js +4 -3
  46. package/cjs/DatePicker/types.d.ts +17 -0
  47. package/cjs/{tailwind-types.js → DatePicker/types.js} +0 -0
  48. package/cjs/DatePicker/utils.d.ts +2 -0
  49. package/cjs/DatePicker/utils.js +10 -2
  50. package/cjs/Dropdown/Dropdown.d.ts +1 -1
  51. package/cjs/Dropdown/Dropdown.js +5 -4
  52. package/cjs/Dropdown/DropdownButton.d.ts +1 -0
  53. package/cjs/Dropdown/components/DropdownButtonItem.js +2 -2
  54. package/cjs/Dropdown/components/DropdownLinkItem.js +1 -2
  55. package/cjs/Dropdown/components/DropdownTitle.d.ts +4 -2
  56. package/cjs/Dropdown/components/DropdownToggleItem.js +2 -2
  57. package/cjs/Dropdown/useDropdownItemProps.d.ts +9 -1
  58. package/cjs/Dropdown/useDropdownItemProps.js +16 -7
  59. package/cjs/Dropzone/Dropzone.d.ts +5 -1
  60. package/cjs/Dropzone/Dropzone.js +14 -5
  61. package/cjs/EmptyState/EmptyState.tailwind.d.ts +4 -4
  62. package/cjs/EmptyState/EmptyState.tailwind.js +5 -8
  63. package/cjs/Field/Field.d.ts +1 -0
  64. package/cjs/Flag/Flag.d.ts +1 -0
  65. package/cjs/Flag/Flag.js +17 -2
  66. package/cjs/Flag/Flag.tailwind.d.ts +4 -4
  67. package/cjs/Flag/Flag.tailwind.js +8 -15
  68. package/cjs/Flag/Flags.d.ts +1 -1
  69. package/cjs/Flag/Flags.js +5 -4
  70. package/cjs/Flag/types.d.ts +4 -0
  71. package/cjs/FlexGrid/FlexGrid.d.ts +2 -1
  72. package/cjs/FlexGrid/FlexGrid.tailwind.d.ts +6 -3
  73. package/cjs/FlexGrid/FlexGrid.tailwind.js +8 -11
  74. package/cjs/HelpUnderline/HelpUnderline.d.ts +1 -0
  75. package/cjs/HelpUnderline/HelpUnderline.tailwind.d.ts +4 -4
  76. package/cjs/HelpUnderline/HelpUnderline.tailwind.js +3 -6
  77. package/cjs/Input/Input.d.ts +6 -0
  78. package/cjs/Input/Input.js +15 -4
  79. package/cjs/Input/Input.tailwind.d.ts +4 -4
  80. package/cjs/Input/Input.tailwind.js +12 -15
  81. package/cjs/Insert/Insert.d.ts +1 -0
  82. package/cjs/InstantSearch/InstantSearch.tailwind.d.ts +4 -5
  83. package/cjs/InstantSearch/InstantSearch.tailwind.js +34 -32
  84. package/cjs/KeyboardKey/KeyboardKey.d.ts +1 -0
  85. package/cjs/KeyboardKey/KeyboardKey.js +3 -2
  86. package/cjs/KeyboardKey/KeyboardKey.tailwind.d.ts +4 -4
  87. package/cjs/KeyboardKey/KeyboardKey.tailwind.js +5 -8
  88. package/cjs/Link/ButtonLink.js +1 -10
  89. package/cjs/Medallion/Medallion.tailwind.d.ts +4 -4
  90. package/cjs/Medallion/Medallion.tailwind.js +8 -11
  91. package/cjs/Modal/Modal.d.ts +5 -2
  92. package/cjs/Modal/Modal.js +16 -9
  93. package/cjs/Modal/Modal.tailwind.d.ts +4 -4
  94. package/cjs/Modal/Modal.tailwind.js +9 -18
  95. package/cjs/Modal/components/ModalFooter.d.ts +4 -2
  96. package/cjs/Pagination/CompactPagination/CompactPagination.d.ts +8 -0
  97. package/cjs/Pagination/CompactPagination/CompactPagination.js +29 -5
  98. package/cjs/Pagination/DotPagination/DotPagination.d.ts +5 -1
  99. package/cjs/Pagination/DotPagination/DotPagination.js +21 -2
  100. package/cjs/Pagination/Pagination/Pagination.d.ts +7 -1
  101. package/cjs/Pagination/Pagination/Pagination.js +32 -8
  102. package/cjs/ProgressBar/ProgressBar.tailwind.d.ts +5 -5
  103. package/cjs/ProgressBar/ProgressBar.tailwind.js +7 -10
  104. package/cjs/ProgressSpinner/ProgressSpinner.tailwind.d.ts +5 -5
  105. package/cjs/ProgressSpinner/ProgressSpinner.tailwind.js +4 -7
  106. package/cjs/RadioGroup/RadioButton.d.ts +1 -1
  107. package/cjs/RadioGroup/RadioButton.tailwind.d.ts +4 -4
  108. package/cjs/RadioGroup/RadioButton.tailwind.js +11 -14
  109. package/cjs/RadioGroup/RadioGroup.d.ts +1 -0
  110. package/cjs/RadioGroup/RadioGroup.js +1 -1
  111. package/cjs/RangeSlider/RangeSlider.d.ts +1 -1
  112. package/cjs/RangeSlider/RangeSlider.tailwind.d.ts +4 -4
  113. package/cjs/RangeSlider/RangeSlider.tailwind.js +21 -24
  114. package/cjs/Satellite/Satellite.d.ts +5 -1
  115. package/cjs/Satellite/Satellite.js +9 -2
  116. package/cjs/Satellite/SatelliteContext.d.ts +4 -1
  117. package/cjs/Satellite/SatelliteContext.js +2 -1
  118. package/cjs/Satellite/index.d.ts +2 -0
  119. package/cjs/Satellite/index.js +28 -0
  120. package/cjs/Satellite/locale.d.ts +29 -0
  121. package/cjs/Satellite/locale.js +21 -0
  122. package/cjs/Satellite/useCreatePortal.d.ts +4 -0
  123. package/cjs/Satellite/useCreatePortal.js +29 -0
  124. package/cjs/ScrollIndicator/ScrollIndicator.d.ts +4 -1
  125. package/cjs/ScrollIndicator/ScrollIndicator.js +2 -1
  126. package/cjs/ScrollIndicator/ScrollIndicator.tailwind.d.ts +4 -4
  127. package/cjs/ScrollIndicator/ScrollIndicator.tailwind.js +8 -11
  128. package/cjs/Select/Select.tailwind.d.ts +5 -5
  129. package/cjs/Select/Select.tailwind.js +5 -8
  130. package/cjs/Sidebar/Sidebar.d.ts +33 -10
  131. package/cjs/Sidebar/Sidebar.js +48 -38
  132. package/cjs/Sidebar/SidebarButtonLink.d.ts +14 -0
  133. package/cjs/Sidebar/SidebarButtonLink.js +110 -0
  134. package/cjs/Sidebar/SidebarContext.d.ts +7 -8
  135. package/cjs/Sidebar/SidebarContext.js +10 -11
  136. package/cjs/Sidebar/SidebarHeader.d.ts +6 -0
  137. package/cjs/Sidebar/SidebarHeader.js +29 -0
  138. package/cjs/Sidebar/SidebarHeading.d.ts +6 -0
  139. package/cjs/Sidebar/SidebarHeading.js +35 -0
  140. package/cjs/Sidebar/SidebarLink.d.ts +8 -0
  141. package/cjs/Sidebar/SidebarLink.js +58 -0
  142. package/cjs/Sidebar/SidebarLinksGroup/ActiveLinkIndicator.d.ts +8 -0
  143. package/cjs/Sidebar/SidebarLinksGroup/ActiveLinkIndicator.js +47 -0
  144. package/cjs/Sidebar/SidebarLinksGroup/SidebarGroupLink.d.ts +7 -0
  145. package/cjs/Sidebar/{components/SidebarHeader.js → SidebarLinksGroup/SidebarGroupLink.js} +14 -23
  146. package/cjs/Sidebar/SidebarLinksGroup/SidebarLinksGroup.d.ts +23 -0
  147. package/cjs/Sidebar/SidebarLinksGroup/SidebarLinksGroup.js +120 -0
  148. package/cjs/Sidebar/SidebarLinksGroup/index.d.ts +2 -0
  149. package/cjs/Sidebar/SidebarLinksGroup/index.js +18 -0
  150. package/cjs/Sidebar/SidebarLinksGroup/types.d.ts +10 -0
  151. package/cjs/Sidebar/SidebarLinksGroup/types.js +5 -0
  152. package/cjs/Sidebar/SidebarNav.d.ts +9 -0
  153. package/cjs/Sidebar/SidebarNav.js +46 -0
  154. package/cjs/Sidebar/index.d.ts +7 -4
  155. package/cjs/Sidebar/index.js +61 -21
  156. package/cjs/Sidebar/types.d.ts +6 -2
  157. package/cjs/Switch/Switch.tailwind.d.ts +5 -5
  158. package/cjs/Switch/Switch.tailwind.js +7 -8
  159. package/cjs/Switch/SwitchOption.d.ts +2 -1
  160. package/cjs/Switch/SwitchOption.js +1 -1
  161. package/cjs/Tables/DataTable/DataTable.d.ts +11 -1
  162. package/cjs/Tables/DataTable/DataTable.js +25 -7
  163. package/cjs/Tables/DataTable/DataTable.tailwind.d.ts +4 -4
  164. package/cjs/Tables/DataTable/DataTable.tailwind.js +3 -6
  165. package/cjs/Tables/DataTable/components/Body.d.ts +3 -2
  166. package/cjs/Tables/DataTable/components/Body.js +6 -5
  167. package/cjs/Tables/DataTable/components/Loader.d.ts +3 -1
  168. package/cjs/Tables/DataTable/components/Loader.js +4 -3
  169. package/cjs/Tables/Table/Table.tailwind.d.ts +4 -4
  170. package/cjs/Tables/Table/Table.tailwind.js +3 -6
  171. package/cjs/Tabs/Tabs.tailwind.d.ts +4 -4
  172. package/cjs/Tabs/Tabs.tailwind.js +13 -16
  173. package/cjs/Tabs/components/LinkTab.js +7 -9
  174. package/cjs/Tag/Tag.d.ts +5 -1
  175. package/cjs/Tag/Tag.js +15 -6
  176. package/cjs/Tag/Tag.tailwind.d.ts +4 -4
  177. package/cjs/Tag/Tag.tailwind.js +6 -9
  178. package/cjs/TextArea/TextArea.tailwind.d.ts +4 -4
  179. package/cjs/TextArea/TextArea.tailwind.js +4 -7
  180. package/cjs/Toggle/Toggle.d.ts +1 -1
  181. package/cjs/Toggle/Toggle.tailwind.d.ts +5 -5
  182. package/cjs/Toggle/Toggle.tailwind.js +19 -22
  183. package/cjs/Tooltip/OverflowTooltipWrapper.d.ts +1 -0
  184. package/cjs/Tooltip/OverflowTooltipWrapper.js +6 -4
  185. package/cjs/Tooltip/Tooltip.d.ts +1 -1
  186. package/cjs/Tooltip/Tooltip.tailwind.d.ts +4 -4
  187. package/cjs/Tooltip/Tooltip.tailwind.js +19 -18
  188. package/cjs/Tooltip/TooltipWrapper.d.ts +1 -0
  189. package/cjs/Tooltip/TooltipWrapper.js +5 -4
  190. package/cjs/Tooltip/types.d.ts +2 -0
  191. package/cjs/Typography/Typography.tailwind.d.ts +5 -17
  192. package/cjs/Typography/Typography.tailwind.js +123 -133
  193. package/cjs/UserContent/UserContent.tailwind.d.ts +4 -1
  194. package/cjs/UserContent/UserContent.tailwind.js +11 -9
  195. package/cjs/index.d.ts +0 -1
  196. package/cjs/index.js +0 -14
  197. package/cjs/styles/base.tailwind.d.ts +4 -4
  198. package/cjs/styles/base.tailwind.js +3 -6
  199. package/cjs/styles/tailwind.config.d.ts +2 -198
  200. package/cjs/styles/tailwind.config.js +25 -29
  201. package/cjs/types.d.ts +7 -0
  202. package/cjs/utilities/utilities.tailwind.d.ts +4 -1
  203. package/cjs/utilities/utilities.tailwind.js +4 -6
  204. package/cjs/utils/isCssPropertySupported.d.ts +1 -1
  205. package/cjs/utils/pluralize.js +6 -1
  206. package/cjs/utils/useLinkProps.d.ts +5 -2
  207. package/cjs/utils/useLinkProps.js +9 -2
  208. package/esm/AnnouncementBadge/AnnouncementBadge.d.ts +6 -1
  209. package/esm/AnnouncementBadge/AnnouncementBadge.js +14 -2
  210. package/esm/AutoComplete/AutoComplete.d.ts +19 -14
  211. package/esm/AutoComplete/AutoComplete.js +67 -18
  212. package/esm/AutoComplete/AutoComplete.tailwind.d.ts +4 -4
  213. package/esm/AutoComplete/AutoComplete.tailwind.js +10 -13
  214. package/esm/AutoComplete/components/DefaultOptionItem.d.ts +6 -2
  215. package/esm/AutoComplete/components/DefaultOptionItem.js +5 -2
  216. package/esm/AutoComplete/types.d.ts +26 -18
  217. package/esm/AutoComplete/utils.d.ts +5 -4
  218. package/esm/AutoComplete/utils.js +16 -0
  219. package/esm/Avatars/ApplicationAvatar.js +1 -1
  220. package/esm/Banners/Alert/Alert.d.ts +1 -0
  221. package/esm/Banners/Alert/Alert.js +1 -1
  222. package/esm/Banners/BigBertha/BigBertha.d.ts +2 -1
  223. package/esm/Banners/Promote/Promote.d.ts +1 -0
  224. package/esm/Button/Button.js +2 -2
  225. package/esm/Button/Button.tailwind.d.ts +4 -4
  226. package/esm/Button/Button.tailwind.js +13 -16
  227. package/esm/Button/ButtonGroup.d.ts +2 -1
  228. package/esm/Card/Card.tailwind.d.ts +4 -4
  229. package/esm/Card/Card.tailwind.js +6 -9
  230. package/esm/Card/components/CardTitle.d.ts +4 -2
  231. package/esm/Checkbox/Checkbox.d.ts +1 -1
  232. package/esm/Checkbox/Checkbox.tailwind.d.ts +5 -5
  233. package/esm/Checkbox/Checkbox.tailwind.js +11 -14
  234. package/esm/ClickAwayContainer/ClickAwayContainer.d.ts +2 -1
  235. package/esm/DatePicker/DatePicker/DatePicker.d.ts +5 -11
  236. package/esm/DatePicker/DatePicker/DatePicker.js +16 -7
  237. package/esm/DatePicker/DatePicker.tailwind.d.ts +4 -4
  238. package/esm/DatePicker/DatePicker.tailwind.js +19 -15
  239. package/esm/DatePicker/DateRangePicker/DateRangePicker.d.ts +5 -11
  240. package/esm/DatePicker/DateRangePicker/DateRangePicker.js +23 -7
  241. package/esm/DatePicker/DateRangePicker/DateRangePickerDisplay.d.ts +3 -0
  242. package/esm/DatePicker/DateRangePicker/DateRangePickerDisplay.js +3 -2
  243. package/esm/DatePicker/components/Calendar.d.ts +5 -1
  244. package/esm/DatePicker/components/Calendar.js +3 -1
  245. package/esm/DatePicker/components/Display.d.ts +1 -1
  246. package/esm/DatePicker/components/FooterActions.d.ts +3 -0
  247. package/esm/DatePicker/components/FooterActions.js +4 -3
  248. package/esm/DatePicker/components/Modal.d.ts +2 -2
  249. package/esm/DatePicker/components/Modal.js +4 -3
  250. package/esm/DatePicker/components/NavBar.d.ts +5 -1
  251. package/esm/DatePicker/components/NavBar.js +4 -3
  252. package/esm/DatePicker/types.d.ts +17 -0
  253. package/esm/{tailwind-types.js → DatePicker/types.js} +0 -0
  254. package/esm/DatePicker/utils.d.ts +2 -0
  255. package/esm/DatePicker/utils.js +7 -0
  256. package/esm/Dropdown/Dropdown.d.ts +1 -1
  257. package/esm/Dropdown/Dropdown.js +4 -3
  258. package/esm/Dropdown/DropdownButton.d.ts +1 -0
  259. package/esm/Dropdown/components/DropdownButtonItem.js +2 -2
  260. package/esm/Dropdown/components/DropdownLinkItem.js +1 -2
  261. package/esm/Dropdown/components/DropdownTitle.d.ts +4 -2
  262. package/esm/Dropdown/components/DropdownToggleItem.js +2 -2
  263. package/esm/Dropdown/useDropdownItemProps.d.ts +9 -1
  264. package/esm/Dropdown/useDropdownItemProps.js +15 -7
  265. package/esm/Dropzone/Dropzone.d.ts +5 -1
  266. package/esm/Dropzone/Dropzone.js +13 -4
  267. package/esm/EmptyState/EmptyState.tailwind.d.ts +4 -4
  268. package/esm/EmptyState/EmptyState.tailwind.js +6 -9
  269. package/esm/Field/Field.d.ts +1 -0
  270. package/esm/Flag/Flag.d.ts +1 -0
  271. package/esm/Flag/Flag.js +15 -2
  272. package/esm/Flag/Flag.tailwind.d.ts +4 -4
  273. package/esm/Flag/Flag.tailwind.js +9 -16
  274. package/esm/Flag/Flags.d.ts +1 -1
  275. package/esm/Flag/Flags.js +4 -3
  276. package/esm/Flag/types.d.ts +4 -0
  277. package/esm/FlexGrid/FlexGrid.d.ts +2 -1
  278. package/esm/FlexGrid/FlexGrid.tailwind.d.ts +6 -3
  279. package/esm/FlexGrid/FlexGrid.tailwind.js +8 -11
  280. package/esm/HelpUnderline/HelpUnderline.d.ts +1 -0
  281. package/esm/HelpUnderline/HelpUnderline.tailwind.d.ts +4 -4
  282. package/esm/HelpUnderline/HelpUnderline.tailwind.js +4 -7
  283. package/esm/Input/Input.d.ts +6 -0
  284. package/esm/Input/Input.js +15 -4
  285. package/esm/Input/Input.tailwind.d.ts +4 -4
  286. package/esm/Input/Input.tailwind.js +14 -17
  287. package/esm/Insert/Insert.d.ts +1 -0
  288. package/esm/InstantSearch/InstantSearch.tailwind.d.ts +4 -5
  289. package/esm/InstantSearch/InstantSearch.tailwind.js +35 -33
  290. package/esm/KeyboardKey/KeyboardKey.d.ts +1 -0
  291. package/esm/KeyboardKey/KeyboardKey.js +3 -2
  292. package/esm/KeyboardKey/KeyboardKey.tailwind.d.ts +4 -4
  293. package/esm/KeyboardKey/KeyboardKey.tailwind.js +6 -9
  294. package/esm/Link/ButtonLink.js +1 -10
  295. package/esm/Medallion/Medallion.tailwind.d.ts +4 -4
  296. package/esm/Medallion/Medallion.tailwind.js +8 -11
  297. package/esm/Modal/Modal.d.ts +5 -2
  298. package/esm/Modal/Modal.js +14 -8
  299. package/esm/Modal/Modal.tailwind.d.ts +4 -4
  300. package/esm/Modal/Modal.tailwind.js +10 -19
  301. package/esm/Modal/components/ModalFooter.d.ts +4 -2
  302. package/esm/Pagination/CompactPagination/CompactPagination.d.ts +8 -0
  303. package/esm/Pagination/CompactPagination/CompactPagination.js +26 -5
  304. package/esm/Pagination/DotPagination/DotPagination.d.ts +5 -1
  305. package/esm/Pagination/DotPagination/DotPagination.js +18 -2
  306. package/esm/Pagination/Pagination/Pagination.d.ts +7 -1
  307. package/esm/Pagination/Pagination/Pagination.js +30 -8
  308. package/esm/ProgressBar/ProgressBar.tailwind.d.ts +5 -5
  309. package/esm/ProgressBar/ProgressBar.tailwind.js +7 -10
  310. package/esm/ProgressSpinner/ProgressSpinner.tailwind.d.ts +5 -5
  311. package/esm/ProgressSpinner/ProgressSpinner.tailwind.js +5 -8
  312. package/esm/RadioGroup/RadioButton.d.ts +1 -1
  313. package/esm/RadioGroup/RadioButton.tailwind.d.ts +4 -4
  314. package/esm/RadioGroup/RadioButton.tailwind.js +13 -16
  315. package/esm/RadioGroup/RadioGroup.d.ts +1 -0
  316. package/esm/RadioGroup/RadioGroup.js +1 -1
  317. package/esm/RangeSlider/RangeSlider.d.ts +1 -1
  318. package/esm/RangeSlider/RangeSlider.tailwind.d.ts +4 -4
  319. package/esm/RangeSlider/RangeSlider.tailwind.js +21 -24
  320. package/esm/Satellite/Satellite.d.ts +5 -1
  321. package/esm/Satellite/Satellite.js +8 -2
  322. package/esm/Satellite/SatelliteContext.d.ts +4 -1
  323. package/esm/Satellite/SatelliteContext.js +2 -1
  324. package/esm/Satellite/index.d.ts +2 -0
  325. package/esm/Satellite/index.js +2 -0
  326. package/esm/Satellite/locale.d.ts +29 -0
  327. package/esm/Satellite/locale.js +8 -0
  328. package/esm/Satellite/useCreatePortal.d.ts +4 -0
  329. package/esm/Satellite/useCreatePortal.js +16 -0
  330. package/esm/ScrollIndicator/ScrollIndicator.d.ts +4 -1
  331. package/esm/ScrollIndicator/ScrollIndicator.js +2 -1
  332. package/esm/ScrollIndicator/ScrollIndicator.tailwind.d.ts +4 -4
  333. package/esm/ScrollIndicator/ScrollIndicator.tailwind.js +8 -11
  334. package/esm/Select/Select.tailwind.d.ts +5 -5
  335. package/esm/Select/Select.tailwind.js +5 -8
  336. package/esm/Sidebar/Sidebar.d.ts +33 -10
  337. package/esm/Sidebar/Sidebar.js +44 -29
  338. package/esm/Sidebar/SidebarButtonLink.d.ts +14 -0
  339. package/esm/Sidebar/SidebarButtonLink.js +92 -0
  340. package/esm/Sidebar/SidebarContext.d.ts +7 -8
  341. package/esm/Sidebar/SidebarContext.js +9 -8
  342. package/esm/Sidebar/SidebarHeader.d.ts +6 -0
  343. package/esm/Sidebar/SidebarHeader.js +15 -0
  344. package/esm/Sidebar/SidebarHeading.d.ts +6 -0
  345. package/esm/Sidebar/SidebarHeading.js +20 -0
  346. package/esm/Sidebar/SidebarLink.d.ts +8 -0
  347. package/esm/Sidebar/SidebarLink.js +42 -0
  348. package/esm/Sidebar/SidebarLinksGroup/ActiveLinkIndicator.d.ts +8 -0
  349. package/esm/Sidebar/SidebarLinksGroup/ActiveLinkIndicator.js +32 -0
  350. package/esm/Sidebar/SidebarLinksGroup/SidebarGroupLink.d.ts +7 -0
  351. package/esm/Sidebar/{components/SidebarHeader.js → SidebarLinksGroup/SidebarGroupLink.js} +13 -19
  352. package/esm/Sidebar/SidebarLinksGroup/SidebarLinksGroup.d.ts +23 -0
  353. package/esm/Sidebar/SidebarLinksGroup/SidebarLinksGroup.js +100 -0
  354. package/esm/Sidebar/SidebarLinksGroup/index.d.ts +2 -0
  355. package/esm/Sidebar/SidebarLinksGroup/index.js +2 -0
  356. package/esm/Sidebar/SidebarLinksGroup/types.d.ts +10 -0
  357. package/esm/Sidebar/SidebarLinksGroup/types.js +1 -0
  358. package/esm/Sidebar/SidebarNav.d.ts +9 -0
  359. package/esm/Sidebar/SidebarNav.js +31 -0
  360. package/esm/Sidebar/index.d.ts +7 -4
  361. package/esm/Sidebar/index.js +7 -4
  362. package/esm/Sidebar/types.d.ts +6 -2
  363. package/esm/Switch/Switch.tailwind.d.ts +5 -5
  364. package/esm/Switch/Switch.tailwind.js +7 -8
  365. package/esm/Switch/SwitchOption.d.ts +2 -1
  366. package/esm/Switch/SwitchOption.js +1 -1
  367. package/esm/Tables/DataTable/DataTable.d.ts +11 -1
  368. package/esm/Tables/DataTable/DataTable.js +22 -6
  369. package/esm/Tables/DataTable/DataTable.tailwind.d.ts +4 -4
  370. package/esm/Tables/DataTable/DataTable.tailwind.js +4 -7
  371. package/esm/Tables/DataTable/components/Body.d.ts +3 -2
  372. package/esm/Tables/DataTable/components/Body.js +6 -5
  373. package/esm/Tables/DataTable/components/Loader.d.ts +3 -1
  374. package/esm/Tables/DataTable/components/Loader.js +4 -3
  375. package/esm/Tables/Table/Table.tailwind.d.ts +4 -4
  376. package/esm/Tables/Table/Table.tailwind.js +4 -7
  377. package/esm/Tabs/Tabs.tailwind.d.ts +4 -4
  378. package/esm/Tabs/Tabs.tailwind.js +14 -17
  379. package/esm/Tabs/components/LinkTab.js +7 -9
  380. package/esm/Tag/Tag.d.ts +5 -1
  381. package/esm/Tag/Tag.js +14 -6
  382. package/esm/Tag/Tag.tailwind.d.ts +4 -4
  383. package/esm/Tag/Tag.tailwind.js +7 -10
  384. package/esm/TextArea/TextArea.tailwind.d.ts +4 -4
  385. package/esm/TextArea/TextArea.tailwind.js +6 -9
  386. package/esm/Toggle/Toggle.d.ts +1 -1
  387. package/esm/Toggle/Toggle.tailwind.d.ts +5 -5
  388. package/esm/Toggle/Toggle.tailwind.js +19 -22
  389. package/esm/Tooltip/OverflowTooltipWrapper.d.ts +1 -0
  390. package/esm/Tooltip/OverflowTooltipWrapper.js +6 -3
  391. package/esm/Tooltip/Tooltip.d.ts +1 -1
  392. package/esm/Tooltip/Tooltip.tailwind.d.ts +4 -4
  393. package/esm/Tooltip/Tooltip.tailwind.js +20 -19
  394. package/esm/Tooltip/TooltipWrapper.d.ts +1 -0
  395. package/esm/Tooltip/TooltipWrapper.js +4 -3
  396. package/esm/Tooltip/types.d.ts +2 -0
  397. package/esm/Typography/Typography.tailwind.d.ts +5 -17
  398. package/esm/Typography/Typography.tailwind.js +124 -134
  399. package/esm/UserContent/UserContent.tailwind.d.ts +4 -1
  400. package/esm/UserContent/UserContent.tailwind.js +12 -10
  401. package/esm/index.d.ts +0 -1
  402. package/esm/index.js +0 -1
  403. package/esm/styles/base.tailwind.d.ts +4 -4
  404. package/esm/styles/base.tailwind.js +4 -7
  405. package/esm/styles/tailwind.config.d.ts +2 -198
  406. package/esm/styles/tailwind.config.js +27 -30
  407. package/esm/types.d.ts +7 -0
  408. package/esm/utilities/utilities.tailwind.d.ts +4 -1
  409. package/esm/utilities/utilities.tailwind.js +4 -6
  410. package/esm/utils/isCssPropertySupported.d.ts +1 -1
  411. package/esm/utils/pluralize.js +6 -1
  412. package/esm/utils/useLinkProps.d.ts +5 -2
  413. package/esm/utils/useLinkProps.js +9 -2
  414. package/package.json +8 -11
  415. package/satellite.min.css +2 -4
  416. package/scss/colors.scss +1 -0
  417. package/cjs/Banner/Banner.d.ts +0 -85
  418. package/cjs/Banner/Banner.js +0 -176
  419. package/cjs/Banner/index.d.ts +0 -2
  420. package/cjs/Banner/index.js +0 -32
  421. package/cjs/Sidebar/Sidebar.tailwind.d.ts +0 -5
  422. package/cjs/Sidebar/Sidebar.tailwind.js +0 -69
  423. package/cjs/Sidebar/components/SidebarHeader.d.ts +0 -5
  424. package/cjs/Sidebar/components/SidebarLink.d.ts +0 -9
  425. package/cjs/Sidebar/components/SidebarLink.js +0 -98
  426. package/cjs/tailwind-types.d.ts +0 -52
  427. package/esm/Banner/Banner.d.ts +0 -85
  428. package/esm/Banner/Banner.js +0 -161
  429. package/esm/Banner/index.d.ts +0 -2
  430. package/esm/Banner/index.js +0 -2
  431. package/esm/Sidebar/Sidebar.tailwind.d.ts +0 -5
  432. package/esm/Sidebar/Sidebar.tailwind.js +0 -67
  433. package/esm/Sidebar/components/SidebarHeader.d.ts +0 -5
  434. package/esm/Sidebar/components/SidebarLink.d.ts +0 -9
  435. package/esm/Sidebar/components/SidebarLink.js +0 -78
  436. package/esm/tailwind-types.d.ts +0 -52
  437. package/satellite.css +0 -196852
package/README.md CHANGED
@@ -82,39 +82,24 @@ yarn add -D tailwindcss
82
82
  Example `main.css`
83
83
 
84
84
  ```css
85
- @import "tailwindcss/base";
85
+ @tailwind base;
86
+ @tailwind components;
87
+ @tailwind utilities;
86
88
 
87
- @import "tailwindcss/components";
88
-
89
- @import "tailwindcss/utilities";
89
+ @layer components {
90
+ /* your custom components */
91
+ }
90
92
  ```
91
93
 
92
94
  Example `postcss.config.js`
93
95
 
94
96
  ```js
95
- const purgecss = require("@fullhuman/postcss-purgecss");
96
- const cssnano = require("cssnano");
97
-
98
- // Feel free to customize it
99
- const tailwindConfig = require("@algolia/satellite/cjs/styles/tailwind.config.js");
100
-
101
- // If you're gonna use purge css, you need to configure a custom extractor to avoid removing classes used in the Satellite components.
102
- const { makePurgeCssExtractor } = require("@algolia/satellite");
103
- const PurgeCssExtractor = makePurgeCssExtractor(tailwindConfig.prefix);
97
+ // ...
104
98
 
105
99
  const plugins = [
106
100
  require("postcss-import"),
107
101
  require("tailwindcss")(tailwindConfig),
108
102
  require("autoprefixer"),
109
- purgecss({
110
- content: ["./dist/**/*.{js,html}"],
111
- defaultExtractor: PurgeCssExtractor,
112
- // This entry will allow you to safelist some prefix in order to avoid some classnames to be wiped out.
113
- // Here, it will keep all the classnames starting with:
114
- // - 'ais-*' to preserve the instant-search widgets style
115
- // - 'DayPicker*' to preserve all the DatePicker styles (used in the DatePicker and DateRangePicker)
116
- whitelistPatterns: [/^ais-/, /^DayPicker/],
117
- }),
118
103
  cssnano({ preset: "default" }),
119
104
  ];
120
105
 
@@ -124,11 +109,31 @@ module.exports = { plugins };
124
109
  Example `tailwind.config.js`
125
110
 
126
111
  ```js
127
- const config = require("@algolia/satellite/cjs/styles/tailwind.config.js");
128
-
129
- config.variants.backgroundColor = ["responsive", "hover", "focus", "active"];
130
-
131
- module.exports = config;
112
+ const { makePurgeCssExtractor } = require('@algolia/satellite');
113
+ const satelliteConfig = require("@algolia/satellite/cjs/styles/tailwind.config.js");
114
+
115
+ module.exports = {
116
+ presets: [satellite],
117
+ content: [
118
+ files: [
119
+ `node_modules/@algolia/satellite/**/*.js`,
120
+ `node_modules/react-day-picker/lib/style.css`,
121
+ `node_modules/react-day-picker/src/**/*.js`,
122
+
123
+ `src/**/*.{ts,tsx,js,jsx}`,
124
+ // Any other sources files
125
+ ],
126
+ extract: makePurgeCssExtractor(prefix),
127
+ ],
128
+ theme: {
129
+ extend: {
130
+ // any colors, fonts... you want to add
131
+ }
132
+ },
133
+ plugins: [
134
+ // extra plugins you want to add
135
+ ]
136
+ };
132
137
  ```
133
138
 
134
139
  Example `index.jsx`
@@ -139,7 +144,7 @@ import ReactDOM from "react-dom";
139
144
 
140
145
  import "./main.css";
141
146
 
142
- import { Button, stl } from "@algolia/satellite/Button";
147
+ import { Button, stl } from "@algolia/satellite";
143
148
 
144
149
  const loading = true;
145
150
 
@@ -1,9 +1,14 @@
1
1
  import type { FunctionComponent, HTMLAttributes } from "react";
2
2
  export declare type AnnouncementBadgeSizes = "default" | "small";
3
+ export declare type AnnouncementBadgeTexts = "new" | "beta" | "internal" | "pilot";
4
+ export declare type AnnouncementBadgeLocale = {
5
+ [key in AnnouncementBadgeTexts]?: string;
6
+ };
3
7
  export interface AnnouncementBadgeProps extends HTMLAttributes<HTMLSpanElement> {
4
8
  size?: AnnouncementBadgeSizes;
5
- text?: "new" | "beta" | "internal" | "pilot";
9
+ text?: AnnouncementBadgeTexts;
6
10
  variant?: "accent" | "red";
11
+ locale?: AnnouncementBadgeLocale;
7
12
  children?: never;
8
13
  }
9
14
  export declare const AnnouncementBadge: FunctionComponent<AnnouncementBadgeProps>;
@@ -15,11 +15,13 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
15
15
 
16
16
  var _classnames = _interopRequireDefault(require("classnames"));
17
17
 
18
+ var _Satellite = require("../Satellite");
19
+
18
20
  var _satellitePrefixer = _interopRequireDefault(require("../styles/helpers/satellitePrefixer"));
19
21
 
20
22
  var _jsxRuntime = require("react/jsx-runtime");
21
23
 
22
- var _excluded = ["size", "text", "variant", "className"];
24
+ var _excluded = ["size", "text", "variant", "className", "locale"];
23
25
 
24
26
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
25
27
 
@@ -27,6 +29,12 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
27
29
 
28
30
  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) { (0, _defineProperty2["default"])(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; }
29
31
 
32
+ var DEFAULT_LOCALE = {
33
+ beta: "beta",
34
+ internal: "internal",
35
+ "new": "new",
36
+ pilot: "pilot"
37
+ };
30
38
  var DEFAULT_CLASSNAME = (0, _satellitePrefixer["default"])(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["capitalize inline-block rounded-full text-white select-none"])));
31
39
  var SIZE_CLASSNAMES = {
32
40
  "default": (0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["display-body h-6 leading-md px-2"]))),
@@ -40,11 +48,16 @@ var AnnouncementBadge = function AnnouncementBadge(_ref) {
40
48
  text = _ref$text === void 0 ? "new" : _ref$text,
41
49
  variantProp = _ref.variant,
42
50
  className = _ref.className,
51
+ propsLocale = _ref.locale,
43
52
  props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
53
+ var contextLocale = (0, _Satellite.useLocale)("announcementBadge");
54
+
55
+ var locale = _objectSpread(_objectSpread(_objectSpread({}, DEFAULT_LOCALE), contextLocale), propsLocale);
56
+
44
57
  var variant = typeof variantProp === "string" ? variantProp : text === "internal" ? "red" : "accent";
45
58
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", _objectSpread(_objectSpread({}, props), {}, {
46
59
  className: (0, _classnames["default"])(DEFAULT_CLASSNAME, variant === "red" ? (0, _satellitePrefixer["default"])(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["bg-red-600"]))) : (0, _satellitePrefixer["default"])(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["bg-accent-600"]))), SIZE_CLASSNAMES[size], className),
47
- children: text
60
+ children: locale[text]
48
61
  }));
49
62
  };
50
63
 
@@ -1,14 +1,17 @@
1
- import { ControllerStateAndHelpers } from "downshift";
1
+ import type { A11yStatusMessageOptions, ControllerStateAndHelpers } from "downshift";
2
2
  import { Component } from "react";
3
3
  import type { ChangeEvent, FocusEvent, KeyboardEvent, MouseEvent } from "react";
4
4
  import { FieldState } from "../Field/FieldStateContext";
5
- import type { AutoCompleteProps, Option } from "./types";
5
+ import type { AutoCompleteLocale, AutoCompleteProps, Option, OptionItemProps } from "./types";
6
6
  interface State {
7
7
  inputFocused: boolean;
8
8
  inputValue: string;
9
9
  inputWidth?: number;
10
10
  showAllResults: boolean;
11
11
  }
12
+ declare type DefaultOptionProps = OptionItemProps & {
13
+ optionItemPrefix?: AutoCompleteLocale["optionItemPrefix"];
14
+ };
12
15
  /**
13
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.
14
17
  *
@@ -25,37 +28,39 @@ interface State {
25
28
  * - Provide matching results quickly
26
29
  * - Style different data
27
30
  */
28
- 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>;
29
33
  static defaultProps: {
30
34
  clearable: boolean;
31
35
  creatable: boolean;
32
36
  multiple: boolean;
33
37
  maxResults: number;
34
- emptyState: JSX.Element;
35
- createFromInputValue: import("./types").CreateFromInputValue;
38
+ createFromInputValue: <T_1 extends Option = Option>(options: T_1[] | undefined, inputValue: string) => Option[];
36
39
  options: never[];
37
40
  separatorKeyCodes: never[];
38
41
  separatorKeys: never[];
39
- optionItemComponent: import("./types").OptionItemComponentType;
42
+ optionItemComponent: ({ optionItemPrefix, ...props }: DefaultOptionProps) => JSX.Element;
40
43
  noWrap: boolean;
41
44
  };
42
45
  state: State;
43
46
  inputContainerRef: HTMLDivElement | null;
44
47
  inputRef: HTMLInputElement | null;
45
- componentDidUpdate(prevProps: AutoCompleteProps): void;
48
+ componentDidUpdate(prevProps: AutoCompleteProps<T>): void;
46
49
  handleClearClick: () => void;
47
50
  handleFakeInputClick: () => void | null;
48
- handleInputBlur: (state: ControllerStateAndHelpers<Option>) => (evt: FocusEvent<HTMLInputElement>) => void;
51
+ handleInputBlur: (state: ControllerStateAndHelpers<T | Option>) => (evt: FocusEvent<HTMLInputElement>) => void;
49
52
  handleInputChange: (evt: ChangeEvent<HTMLInputElement>) => void;
50
53
  handleInputContainerRefUpdate: (el: HTMLDivElement | null) => void;
51
54
  updateInputWidth: () => void;
52
- handleKeyDown: (state: ControllerStateAndHelpers<Option>) => (evt: KeyboardEvent<any>) => void;
53
- handleChange: (option: Option) => void;
55
+ handleKeyDown: (state: ControllerStateAndHelpers<T | Option>) => (evt: KeyboardEvent<any>) => void;
56
+ handleChange: (option: T) => void;
54
57
  handleShowAllResults: (evt: MouseEvent<HTMLButtonElement>) => void;
55
- removeValue: (removedOption: Option) => void;
56
- renderInput: (results: Option[], autocompleteHelpers: ControllerStateAndHelpers<Option>, fieldState: FieldState) => JSX.Element;
57
- renderMenu: (results: Option[], autocompleteHelpers: ControllerStateAndHelpers<Option>) => JSX.Element;
58
- renderSelect: (autocompleteHelpers: ControllerStateAndHelpers<Option>, fieldState: FieldState) => JSX.Element;
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();
59
64
  render(): JSX.Element;
60
65
  }
61
66
  export default AutoComplete;
@@ -27,6 +27,8 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
27
27
 
28
28
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
29
29
 
30
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
31
+
30
32
  var _classnames = _interopRequireDefault(require("classnames"));
31
33
 
32
34
  var _downshift = _interopRequireDefault(require("downshift"));
@@ -45,14 +47,14 @@ var _Card = _interopRequireDefault(require("../Card"));
45
47
 
46
48
  var _FieldStateContext = require("../Field/FieldStateContext");
47
49
 
50
+ var _Satellite = require("../Satellite");
51
+
48
52
  var _ScrollIndicator = _interopRequireDefault(require("../ScrollIndicator"));
49
53
 
50
54
  var _satellitePrefixer = _interopRequireDefault(require("../styles/helpers/satellitePrefixer"));
51
55
 
52
56
  var _Tag = _interopRequireDefault(require("../Tag"));
53
57
 
54
- var _pluralize = _interopRequireDefault(require("../utils/pluralize"));
55
-
56
58
  var _uniqBy = _interopRequireDefault(require("../utils/uniqBy"));
57
59
 
58
60
  var _AutoCompleteEmptyState = _interopRequireDefault(require("./components/AutoCompleteEmptyState"));
@@ -65,14 +67,16 @@ var _jsxRuntime = require("react/jsx-runtime");
65
67
 
66
68
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16;
67
69
 
68
- 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; }
69
-
70
- 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) { (0, _defineProperty2["default"])(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; }
70
+ var _excluded = ["optionItemPrefix"];
71
71
 
72
72
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
73
73
 
74
74
  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; } }
75
75
 
76
+ 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; }
77
+
78
+ 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) { (0, _defineProperty2["default"])(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; }
79
+
76
80
  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; } } }; }
77
81
 
78
82
  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); }
@@ -140,9 +144,24 @@ var MENU_POPPER_MODFIERS = [{
140
144
  }
141
145
  }];
142
146
  var BACKSPACE_KEY_CODE = 8;
143
- var defaultEmptyState = /*#__PURE__*/(0, _jsxRuntime.jsx)(_AutoCompleteEmptyState["default"], {
144
- title: "No matches found"
145
- });
147
+
148
+ /** @ignore */
149
+ var DefaultEmptyState = function DefaultEmptyState(_ref) {
150
+ var emptyStateTitle = _ref.emptyStateTitle;
151
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_AutoCompleteEmptyState["default"], {
152
+ title: emptyStateTitle
153
+ });
154
+ };
155
+
156
+ var DefaultOption = function DefaultOption(_ref2) {
157
+ var optionItemPrefix = _ref2.optionItemPrefix,
158
+ props = (0, _objectWithoutProperties2["default"])(_ref2, _excluded);
159
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_DefaultOptionItem["default"], _objectSpread(_objectSpread({}, props), {}, {
160
+ locale: {
161
+ optionItemPrefix: optionItemPrefix !== null && optionItemPrefix !== void 0 ? optionItemPrefix : _utils.DEFAULT_AUTOCOMPLETE_LOCALE.optionItemPrefix
162
+ }
163
+ }));
164
+ };
146
165
  /**
147
166
  * 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.
148
167
  *
@@ -160,6 +179,7 @@ var defaultEmptyState = /*#__PURE__*/(0, _jsxRuntime.jsx)(_AutoCompleteEmptyStat
160
179
  * - Style different data
161
180
  */
162
181
 
182
+
163
183
  var AutoComplete = /*#__PURE__*/function (_Component) {
164
184
  (0, _inherits2["default"])(AutoComplete, _Component);
165
185
 
@@ -333,6 +353,21 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
333
353
 
334
354
  _this.props.onChange(newOptions);
335
355
  });
356
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getA11yStatusMessage", function (options) {
357
+ if (!options.isOpen) {
358
+ return "";
359
+ }
360
+
361
+ if (!options.resultCount) {
362
+ return _this.locale.emptyStateTitle;
363
+ }
364
+
365
+ if (options.resultCount > 0) {
366
+ return _this.locale.itemsAvailable(options.resultCount);
367
+ }
368
+
369
+ return "";
370
+ });
336
371
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "renderInput", function (results, autocompleteHelpers, fieldState) {
337
372
  var _this$props3 = _this.props,
338
373
  id = _this$props3.id,
@@ -399,7 +434,7 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
399
434
  onClick: _this.handleFakeInputClick,
400
435
  ref: _this.handleInputContainerRefUpdate,
401
436
  children: [Icon && /*#__PURE__*/(0, _jsxRuntime.jsx)(Icon, {
402
- className: (0, _satellitePrefixer["default"])(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["mr-4 flex-shrink-0 ", ""])), disabled ? "text-grey-200" : inputFocused ? "text-accent-600" : "text-grey-500"),
437
+ className: (0, _satellitePrefixer["default"])(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["mr-4 shrink-0 ", ""])), disabled ? "text-grey-200" : inputFocused ? "text-accent-600" : "text-grey-500"),
403
438
  size: "1rem"
404
439
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
405
440
  className: (0, _classnames["default"])((0, _satellitePrefixer["default"])(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["flex items-center flex-1 ", " ", ""])), !noWrap && "flex-wrap", multiple && "-ml-1"), valuesClassName),
@@ -431,7 +466,7 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
431
466
  type: "button",
432
467
  className: (0, _satellitePrefixer["default"])(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["w-6 flex items-center justify-center text-grey-500"]))),
433
468
  onClick: _this.handleClearClick,
434
- "aria-label": "Clear input value",
469
+ "aria-label": _this.locale.clearInputButton,
435
470
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFeather.X, {
436
471
  size: ".75rem"
437
472
  })
@@ -447,12 +482,15 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
447
482
  highlightedIndex = autocompleteHelpers.highlightedIndex,
448
483
  inputValue = autocompleteHelpers.inputValue,
449
484
  isOpen = autocompleteHelpers.isOpen;
485
+ var defaultEmptyState = /*#__PURE__*/(0, _jsxRuntime.jsx)(DefaultEmptyState, {
486
+ emptyStateTitle: _this.locale.emptyStateTitle
487
+ });
450
488
  var _this$props4 = _this.props,
451
489
  menuClassName = _this$props4.menuClassName,
452
490
  menuSize = _this$props4.menuSize,
453
- _this$props4$emptySta = _this$props4.emptyState,
454
- emptyState = _this$props4$emptySta === void 0 ? AutoComplete.defaultProps.emptyState : _this$props4$emptySta,
455
491
  menuFooter = _this$props4.menuFooter,
492
+ _this$props4$emptySta = _this$props4.emptyState,
493
+ emptyState = _this$props4$emptySta === void 0 ? defaultEmptyState : _this$props4$emptySta,
456
494
  _this$props4$maxResul = _this$props4.maxResults,
457
495
  maxResults = _this$props4$maxResul === void 0 ? AutoComplete.defaultProps.maxResults : _this$props4$maxResul,
458
496
  _this$props4$multiple = _this$props4.multiple,
@@ -509,16 +547,17 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
509
547
  })), {}, {
510
548
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(OptionItem, _objectSpread(_objectSpread({}, optionItemProps), {}, {
511
549
  highlighted: index === highlightedIndex,
512
- option: result
550
+ option: result,
551
+ optionItemPrefix: _this.locale.optionItemPrefix
513
552
  }))
514
553
  }), result.value);
515
554
  }), extraResults > 0 && !showAllResults && /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
516
555
  className: (0, _satellitePrefixer["default"])(_templateObject15 || (_templateObject15 = (0, _taggedTemplateLiteral2["default"])(["p-2 text-right"]))),
517
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Button["default"], {
556
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button["default"], {
518
557
  variant: "subtle",
519
558
  size: "small",
520
559
  onMouseDown: _this.handleShowAllResults,
521
- children: ["Show ", (0, _pluralize["default"])(extraResults, "result"), " more"]
560
+ children: _this.locale.showMoreButton(extraResults)
522
561
  })
523
562
  })]
524
563
  }))
@@ -532,6 +571,8 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
532
571
  });
533
572
  });
534
573
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "renderSelect", function (autocompleteHelpers, fieldState) {
574
+ var _this$context$portalT;
575
+
535
576
  var _this$props5 = _this.props,
536
577
  className = _this$props5.className,
537
578
  options = _this$props5.options,
@@ -549,7 +590,7 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
549
590
 
550
591
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
551
592
  className: className,
552
- children: [_this.renderInput(results, autocompleteHelpers, fieldState), _this.inputContainerRef && /*#__PURE__*/(0, _reactDom.createPortal)(_this.renderMenu(results, autocompleteHelpers), document.body)]
593
+ children: [_this.renderInput(results, autocompleteHelpers, fieldState), _this.inputContainerRef && /*#__PURE__*/(0, _reactDom.createPortal)(_this.renderMenu(results, autocompleteHelpers), (_this$context$portalT = _this.context["portalTarget"]) !== null && _this$context$portalT !== void 0 ? _this$context$portalT : document.body)]
553
594
  });
554
595
  });
555
596
  return _this;
@@ -571,6 +612,11 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
571
612
  });
572
613
  }
573
614
  }
615
+ }, {
616
+ key: "locale",
617
+ get: function get() {
618
+ return _objectSpread(_objectSpread(_objectSpread({}, _utils.DEFAULT_AUTOCOMPLETE_LOCALE), this.context["locales"]), this.props.locale);
619
+ }
574
620
  }, {
575
621
  key: "render",
576
622
  value: function render() {
@@ -589,6 +635,7 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
589
635
  */
590
636
  ,
591
637
  selectedItem: null,
638
+ getA11yStatusMessage: _this2.getA11yStatusMessage,
592
639
  onChange: _this2.handleChange,
593
640
  itemToString: optionToString,
594
641
  defaultHighlightedIndex: 0,
@@ -604,17 +651,17 @@ var AutoComplete = /*#__PURE__*/function (_Component) {
604
651
  }(_react.Component);
605
652
 
606
653
  exports.AutoComplete = AutoComplete;
654
+ (0, _defineProperty2["default"])(AutoComplete, "contextType", _Satellite.SatelliteContext);
607
655
  (0, _defineProperty2["default"])(AutoComplete, "defaultProps", {
608
656
  clearable: false,
609
657
  creatable: false,
610
658
  multiple: false,
611
659
  maxResults: 7,
612
- emptyState: defaultEmptyState,
613
660
  createFromInputValue: _utils.defaultCreateFromInputValue,
614
661
  options: [],
615
662
  separatorKeyCodes: [],
616
663
  separatorKeys: [],
617
- optionItemComponent: _DefaultOptionItem["default"],
664
+ optionItemComponent: DefaultOption,
618
665
  noWrap: false
619
666
  });
620
667
  var _default = AutoComplete;
@@ -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,15 +1,13 @@
1
1
  "use strict";
2
2
 
3
3
  // @ts-check
4
+ var plugin = require("tailwindcss/plugin");
5
+
4
6
  var disabledColor = require("../styles/disabledColor");
5
7
 
6
8
  var rgba = require("../styles/rgba");
7
- /**
8
- * @type {import('../tailwind-types').TailwindPlugin}
9
- */
10
-
11
9
 
12
- var autoCompletePlugin = function autoCompletePlugin(_ref) {
10
+ var autoCompletePlugin = plugin(function (_ref) {
13
11
  var addComponents = _ref.addComponents,
14
12
  theme = _ref.theme;
15
13
  addComponents({
@@ -32,14 +30,14 @@ var autoCompletePlugin = function autoCompletePlugin(_ref) {
32
30
  "&::after": {
33
31
  content: '" "',
34
32
  display: "block",
35
- minHeight: 30,
33
+ minHeight: "30px",
36
34
  // don't ask me why 30
37
- fontSize: 0
35
+ fontSize: "0px"
38
36
  },
39
37
  "&.autocomplete-large": {
40
38
  minHeight: "3rem",
41
39
  "&::after": {
42
- minHeight: 38 // don't ask me why 38
40
+ minHeight: "38px" // don't ask me why 38
43
41
 
44
42
  }
45
43
  }
@@ -69,12 +67,12 @@ var autoCompletePlugin = function autoCompletePlugin(_ref) {
69
67
  scrollbarWidth: "none",
70
68
  msOverflowStyle: "-ms-autohiding-scrollbar",
71
69
  "&::-webkit-scrollbar": {
72
- width: 0,
73
- height: 0
70
+ width: "0px",
71
+ height: "0px"
74
72
  }
75
73
  },
76
74
  ".autocomplete-input": {
77
- flex: 1,
75
+ flex: "1",
78
76
  backgroundColor: "transparent",
79
77
  caretColor: theme("colors.grey.600"),
80
78
  color: theme("colors.grey.900"),
@@ -94,6 +92,5 @@ var autoCompletePlugin = function autoCompletePlugin(_ref) {
94
92
  }
95
93
  }
96
94
  });
97
- };
98
-
95
+ });
99
96
  module.exports = autoCompletePlugin;
@@ -1,3 +1,7 @@
1
- import type { OptionItemComponentType } from "../types";
2
- declare const DefaultOptionItem: OptionItemComponentType;
1
+ /// <reference types="react" />
2
+ import type { AutoCompleteLocale, OptionItemProps } from "../types";
3
+ declare type DefaultOptionItemProps = OptionItemProps & {
4
+ locale?: AutoCompleteLocale;
5
+ };
6
+ declare const DefaultOptionItem: ({ option, multiple, locale }: DefaultOptionItemProps) => JSX.Element;
3
7
  export default DefaultOptionItem;
@@ -21,13 +21,16 @@ var metadataSpacer = /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
21
21
  });
22
22
 
23
23
  var DefaultOptionItem = function DefaultOptionItem(_ref) {
24
+ var _locale$optionItemPre;
25
+
24
26
  var option = _ref.option,
25
- multiple = _ref.multiple;
27
+ multiple = _ref.multiple,
28
+ locale = _ref.locale;
26
29
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
27
30
  className: (0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["truncate py-2"]))),
28
31
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
29
32
  className: (0, _satellitePrefixer["default"])(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["font-semibold text-md text-grey-900"]))),
30
- children: option["new"] ? "".concat(multiple ? "Add " : "Use ", " ").concat(option.label) : option.label
33
+ children: option["new"] ? "".concat(locale === null || locale === void 0 ? void 0 : (_locale$optionItemPre = locale.optionItemPrefix) === null || _locale$optionItemPre === void 0 ? void 0 : _locale$optionItemPre.call(locale, multiple), " ").concat(option.label) : option.label
31
34
  }), option.metadata && option.metadata.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)("ul", {
32
35
  className: (0, _satellitePrefixer["default"])(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["flex text-grey-600"]))),
33
36
  children: option.metadata.map(function (metadata, idx) {
@@ -1,7 +1,14 @@
1
1
  import type { ComponentType, FocusEventHandler, ReactNode } from "react";
2
2
  import type { IconComponentType } from "../types";
3
3
  export declare type AutoCompleteVariant = "medium" | "large";
4
- export interface AutoCompleteBaseProps {
4
+ export declare type AutoCompleteLocale = {
5
+ emptyStateTitle?: string;
6
+ clearInputButton?: string;
7
+ itemsAvailable?: (resultCount: number) => string;
8
+ showMoreButton?: (extraResults: number) => string;
9
+ optionItemPrefix?: (multiple: boolean) => string;
10
+ };
11
+ export interface AutoCompleteBaseProps<T extends Option = Option> {
5
12
  id?: string;
6
13
  icon?: IconComponentType;
7
14
  name?: string;
@@ -12,7 +19,7 @@ export interface AutoCompleteBaseProps {
12
19
  placeholder?: string;
13
20
  disabled?: boolean;
14
21
  autoFocus?: boolean;
15
- options?: Option[];
22
+ options?: T[];
16
23
  inputValue?: string;
17
24
  onTextChange?: (text: string) => any;
18
25
  onFocus?: FocusEventHandler<HTMLInputElement>;
@@ -21,13 +28,13 @@ export interface AutoCompleteBaseProps {
21
28
  clearable?: boolean;
22
29
  selectOnBlur?: boolean;
23
30
  maxResults?: number;
24
- createFromInputValue?: CreateFromInputValue;
31
+ createFromInputValue?: CreateFromInputValue<T>;
25
32
  separatorKeyCodes?: number[];
26
33
  separatorKeys?: string[];
27
- renderValueTemplate?: (args: RenderValueTemplateArgs) => JSX.Element;
34
+ renderValueTemplate?: (args: RenderValueTemplateArgs<T>) => JSX.Element;
28
35
  emptyState?: ReactNode;
29
36
  menuFooter?: ReactNode;
30
- optionItemComponent?: OptionItemComponentType;
37
+ optionItemComponent?: OptionItemComponentType<T>;
31
38
  /** Keep the input on a single line */
32
39
  noWrap?: boolean;
33
40
  endItem?: ReactNode;
@@ -36,18 +43,19 @@ export interface AutoCompleteBaseProps {
36
43
  * @default "medium"
37
44
  */
38
45
  menuSize?: "medium" | "large";
46
+ locale?: AutoCompleteLocale;
39
47
  }
40
- export interface AutoCompleteSingleProps extends AutoCompleteBaseProps {
48
+ export interface AutoCompleteSingleProps<T extends Option = Option> extends AutoCompleteBaseProps<T> {
41
49
  multiple?: false;
42
- value?: Option;
43
- onChange: (option: Option | null) => void;
50
+ value?: T;
51
+ onChange: (option: T | null) => void;
44
52
  }
45
- export interface AutoCompleteMultiProps extends AutoCompleteBaseProps {
53
+ export interface AutoCompleteMultiProps<T extends Option = Option> extends AutoCompleteBaseProps<T> {
46
54
  multiple: true;
47
- value?: Option[];
48
- onChange: (option: Option[] | null) => void;
55
+ value?: T[];
56
+ onChange: (option: T[] | null) => void;
49
57
  }
50
- export declare type AutoCompleteProps = AutoCompleteMultiProps | AutoCompleteSingleProps;
58
+ export declare type AutoCompleteProps<T extends Option = Option> = AutoCompleteMultiProps<T> | AutoCompleteSingleProps<T>;
51
59
  declare type OptionsValue = string | number | boolean;
52
60
  export interface Option {
53
61
  value: OptionsValue;
@@ -57,22 +65,22 @@ export interface Option {
57
65
  disabled?: boolean;
58
66
  bypassNeedleMatch?: boolean;
59
67
  }
60
- export interface OptionItemProps {
61
- option: Option;
68
+ export interface OptionItemProps<T extends Option = Option> {
69
+ option: T;
62
70
  multiple: boolean;
63
71
  inputValue: string;
64
72
  highlighted: boolean;
65
73
  }
66
- export declare type OptionItemComponentType = ComponentType<OptionItemProps>;
74
+ export declare type OptionItemComponentType<T extends Option = Option> = ComponentType<OptionItemProps<T>>;
67
75
  export interface OptionRendererParams {
68
76
  multiple: boolean;
69
77
  inputValue: string;
70
78
  highlighted: boolean;
71
79
  }
72
- export interface RenderValueTemplateArgs {
73
- option: Option;
80
+ export interface RenderValueTemplateArgs<T extends Option = Option> {
81
+ option: T;
74
82
  key: string;
75
83
  editable: boolean;
76
84
  }
77
- export declare type CreateFromInputValue = (options: Option[] | undefined, inputValue: string) => Option[];
85
+ export declare type CreateFromInputValue<T extends Option = Option> = (options: T[] | undefined, inputValue: string) => Option[];
78
86
  export {};