@hopper-ui/components 1.0.4 → 1.0.6

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 (262) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +3 -0
  3. package/dist/Avatar/src/AnonymousAvatar.css +69 -0
  4. package/dist/Avatar/src/AnonymousAvatar.d.ts +29 -0
  5. package/dist/Avatar/src/AnonymousAvatar.js +7 -0
  6. package/dist/Avatar/src/Avatar.css +265 -0
  7. package/dist/Avatar/src/Avatar.d.ts +60 -0
  8. package/dist/Avatar/src/Avatar.js +11 -0
  9. package/dist/Avatar/src/AvatarContext.d.ts +12 -0
  10. package/dist/Avatar/src/AvatarContext.js +2 -0
  11. package/dist/Avatar/src/DeletedAvatar.css +69 -0
  12. package/dist/Avatar/src/DeletedAvatar.d.ts +29 -0
  13. package/dist/Avatar/src/DeletedAvatar.js +7 -0
  14. package/dist/Avatar/src/RichIconAvatarImage.css +69 -0
  15. package/dist/Avatar/src/RichIconAvatarImage.d.ts +32 -0
  16. package/dist/Avatar/src/RichIconAvatarImage.js +5 -0
  17. package/dist/Avatar/src/RichIconAvatarImageContext.d.ts +14 -0
  18. package/dist/Avatar/src/RichIconAvatarImageContext.js +2 -0
  19. package/dist/Avatar/src/index.css +265 -0
  20. package/dist/Avatar/src/index.d.ts +14 -0
  21. package/dist/Avatar/src/index.js +13 -0
  22. package/dist/Avatar/src/useImageFallback.d.ts +34 -0
  23. package/dist/Avatar/src/useImageFallback.js +2 -0
  24. package/dist/{badge → Badge}/src/Badge.css +11 -11
  25. package/dist/{badge → Badge}/src/Badge.d.ts +1 -1
  26. package/dist/{badge → Badge}/src/Badge.js +4 -3
  27. package/dist/Badge/src/BadgeContext.js +2 -0
  28. package/dist/{badge → Badge}/src/index.css +11 -11
  29. package/dist/{badge → Badge}/src/index.js +4 -3
  30. package/dist/{chip → Chip}/src/Chip.css +34 -34
  31. package/dist/{chip → Chip}/src/Chip.js +6 -6
  32. package/dist/Chip/src/ChipContext.js +2 -0
  33. package/dist/{chip → Chip}/src/index.css +34 -34
  34. package/dist/{chip → Chip}/src/index.js +6 -6
  35. package/dist/Divider/src/Divider.css +32 -0
  36. package/dist/Divider/src/Divider.d.ts +15 -0
  37. package/dist/Divider/src/Divider.js +4 -0
  38. package/dist/Divider/src/DividerContext.d.ts +8 -0
  39. package/dist/Divider/src/DividerContext.js +2 -0
  40. package/dist/Divider/src/index.css +32 -0
  41. package/dist/Divider/src/index.d.ts +5 -0
  42. package/dist/Divider/src/index.js +4 -0
  43. package/dist/{errorMessage → ErrorMessage}/src/ErrorMessage.css +12 -12
  44. package/dist/{errorMessage → ErrorMessage}/src/ErrorMessage.js +5 -5
  45. package/dist/ErrorMessage/src/ErrorMessageContext.js +2 -0
  46. package/dist/{errorMessage → ErrorMessage}/src/index.css +12 -12
  47. package/dist/{errorMessage → ErrorMessage}/src/index.js +5 -5
  48. package/dist/Header/src/Header.d.ts +17 -0
  49. package/dist/Header/src/Header.js +3 -0
  50. package/dist/Header/src/HeaderContext.d.ts +10 -0
  51. package/dist/Header/src/HeaderContext.js +2 -0
  52. package/dist/Header/src/index.d.ts +7 -0
  53. package/dist/Header/src/index.js +3 -0
  54. package/dist/{helperMessage → HelperMessage}/src/HelperMessage.css +12 -12
  55. package/dist/{helperMessage → HelperMessage}/src/HelperMessage.js +5 -5
  56. package/dist/HelperMessage/src/HelperMessageContext.js +2 -0
  57. package/dist/{helperMessage → HelperMessage}/src/index.css +12 -12
  58. package/dist/{helperMessage → HelperMessage}/src/index.js +5 -5
  59. package/dist/HopperProvider/src/HopperProvider.d.ts +1 -1
  60. package/dist/HopperProvider/src/HopperProvider.js +1 -1
  61. package/dist/HopperProvider/src/index.js +1 -1
  62. package/dist/IconList/src/IconList.css +1 -1
  63. package/dist/IconList/src/IconList.js +2 -2
  64. package/dist/IconList/src/index.css +1 -1
  65. package/dist/IconList/src/index.js +2 -2
  66. package/dist/Link/src/Link.css +31 -31
  67. package/dist/Link/src/Link.js +7 -7
  68. package/dist/Link/src/index.css +31 -31
  69. package/dist/Link/src/index.js +7 -7
  70. package/dist/ListBox/src/ListBox.css +1434 -0
  71. package/dist/ListBox/src/ListBox.d.ts +48 -0
  72. package/dist/ListBox/src/ListBox.js +34 -0
  73. package/dist/ListBox/src/ListBoxContext.d.ts +10 -0
  74. package/dist/ListBox/src/ListBoxContext.js +2 -0
  75. package/dist/ListBox/src/ListBoxItem.css +1297 -0
  76. package/dist/ListBox/src/ListBoxItem.d.ts +39 -0
  77. package/dist/ListBox/src/ListBoxItem.js +27 -0
  78. package/dist/ListBox/src/ListBoxItemContext.d.ts +9 -0
  79. package/dist/ListBox/src/ListBoxItemContext.js +2 -0
  80. package/dist/ListBox/src/ListBoxItemSkeleton.css +56 -0
  81. package/dist/ListBox/src/ListBoxItemSkeleton.d.ts +23 -0
  82. package/dist/ListBox/src/ListBoxItemSkeleton.js +4 -0
  83. package/dist/ListBox/src/ListBoxItemSkeletonContext.d.ts +10 -0
  84. package/dist/ListBox/src/ListBoxItemSkeletonContext.js +2 -0
  85. package/dist/ListBox/src/index.css +1434 -0
  86. package/dist/ListBox/src/index.d.ts +8 -0
  87. package/dist/ListBox/src/index.js +34 -0
  88. package/dist/ListBox/src/useLoadOnScroll.d.ts +16 -0
  89. package/dist/ListBox/src/useLoadOnScroll.js +2 -0
  90. package/dist/Section/src/Section.d.ts +19 -0
  91. package/dist/Section/src/Section.js +3 -0
  92. package/dist/Section/src/SectionContext.d.ts +9 -0
  93. package/dist/Section/src/SectionContext.js +2 -0
  94. package/dist/Section/src/index.d.ts +6 -0
  95. package/dist/Section/src/index.js +3 -0
  96. package/dist/Spinner/src/Spinner.css +19 -19
  97. package/dist/Spinner/src/Spinner.js +3 -3
  98. package/dist/Spinner/src/index.css +19 -19
  99. package/dist/Spinner/src/index.js +3 -3
  100. package/dist/buttons/src/Button.css +103 -103
  101. package/dist/buttons/src/Button.d.ts +2 -2
  102. package/dist/buttons/src/Button.js +12 -12
  103. package/dist/buttons/src/ButtonGroup.css +11 -11
  104. package/dist/buttons/src/ButtonGroup.js +3 -3
  105. package/dist/buttons/src/ClearButton.css +12 -12
  106. package/dist/buttons/src/ClearButton.js +4 -4
  107. package/dist/buttons/src/EmbeddedButton.css +12 -12
  108. package/dist/buttons/src/EmbeddedButton.js +2 -2
  109. package/dist/buttons/src/index.css +126 -126
  110. package/dist/buttons/src/index.js +16 -16
  111. package/dist/checkbox/src/Checkbox.css +81 -96
  112. package/dist/checkbox/src/Checkbox.d.ts +3 -1
  113. package/dist/checkbox/src/Checkbox.js +6 -6
  114. package/dist/checkbox/src/CheckboxContext.d.ts +2 -0
  115. package/dist/checkbox/src/CheckboxField.css +15 -15
  116. package/dist/checkbox/src/CheckboxField.js +2 -2
  117. package/dist/checkbox/src/CheckboxGroup.css +118 -133
  118. package/dist/checkbox/src/CheckboxGroup.js +4 -4
  119. package/dist/checkbox/src/index.css +118 -133
  120. package/dist/checkbox/src/index.js +10 -10
  121. package/dist/{chunk-BGESEKEN.js → chunk-2XUHTPCX.js} +13 -7
  122. package/dist/{chunk-FGDSWA7S.js → chunk-37NW34QM.js} +5 -5
  123. package/dist/{chunk-F7HR3VI4.js → chunk-3A6TTZAA.js} +2 -2
  124. package/dist/{chunk-LSVXKVG4.js → chunk-3LH2JHUO.js} +4 -4
  125. package/dist/{chunk-ZAJJD5FY.js → chunk-4JAV3FIH.js} +6 -6
  126. package/dist/chunk-4TXFHYHL.js +52 -0
  127. package/dist/{chunk-OMBQ3J4O.js → chunk-53FHDOG7.js} +13 -7
  128. package/dist/chunk-5H5AZJPQ.js +7 -0
  129. package/dist/{chunk-WTKIUAHI.js → chunk-632B5YBQ.js} +1 -1
  130. package/dist/{chunk-XSASR6CK.js → chunk-6QMIRVLY.js} +2 -2
  131. package/dist/chunk-7JOGKC3W.js +7 -0
  132. package/dist/chunk-AES7QBQE.js +7 -0
  133. package/dist/chunk-BC5A7RHI.js +1260 -0
  134. package/dist/{chunk-HDYG2F3D.js → chunk-BKC74M6Y.js} +3 -3
  135. package/dist/{chunk-ZSFJVMJN.js → chunk-CQDLZ42T.js} +1 -1
  136. package/dist/chunk-E4ALW4MZ.js +250 -0
  137. package/dist/chunk-E4WFKXW4.js +161 -0
  138. package/dist/{chunk-PEPKE5SW.js → chunk-F2URSFJA.js} +5 -5
  139. package/dist/{chunk-ACVMW6YD.js → chunk-FAE27DLF.js} +1 -1
  140. package/dist/chunk-FYIHMKHI.js +7 -0
  141. package/dist/{chunk-Y7XWWUMU.js → chunk-G242LPQE.js} +2 -2
  142. package/dist/chunk-GFHBDUJD.js +17 -0
  143. package/dist/{chunk-2CKDJG6R.js → chunk-HR25MLRP.js} +1 -1
  144. package/dist/{chunk-ESVVLTEN.js → chunk-HZKFQ33E.js} +1 -1
  145. package/dist/chunk-I4VPBQI7.js +7 -0
  146. package/dist/chunk-ITQK6JTD.js +81 -0
  147. package/dist/chunk-J33IFG4U.js +46 -0
  148. package/dist/chunk-J53HGLCT.js +49 -0
  149. package/dist/{chunk-PDYU6DNF.js → chunk-JRDN364E.js} +5 -5
  150. package/dist/chunk-JTNMFPM4.js +41 -0
  151. package/dist/chunk-JUMJ6A3K.js +46 -0
  152. package/dist/chunk-JWW56J7M.js +7 -0
  153. package/dist/{chunk-BCHUEONM.js → chunk-K4ZGI7DJ.js} +1 -1
  154. package/dist/chunk-L5A2UTQV.js +43 -0
  155. package/dist/{chunk-6MSYEF4W.js → chunk-MED2BIDV.js} +2 -2
  156. package/dist/{chunk-QJBQRYJS.js → chunk-MVRI6GLQ.js} +3 -3
  157. package/dist/{chunk-Z3ID4UEE.js → chunk-N77LTZ4U.js} +3 -15
  158. package/dist/{chunk-ANVMQBBG.js → chunk-NMKBUGSO.js} +12 -1
  159. package/dist/chunk-NS3XVOQ7.js +53 -0
  160. package/dist/chunk-O5PTD6IN.js +41 -0
  161. package/dist/{chunk-5GRWAXTT.js → chunk-OHB5QR5P.js} +2 -2
  162. package/dist/chunk-OKZYR4RF.js +7 -0
  163. package/dist/{chunk-GBABMUAI.js → chunk-P5CWOV3L.js} +3 -3
  164. package/dist/{chunk-RCFB4SN4.js → chunk-QBCCF2C2.js} +6 -6
  165. package/dist/chunk-RA7PM75O.js +142 -0
  166. package/dist/{chunk-TSXPLL55.js → chunk-RCX5B3S3.js} +4 -4
  167. package/dist/{chunk-WGDP4ECF.js → chunk-RG4JKE4N.js} +3 -3
  168. package/dist/{chunk-LRXYIR2A.js → chunk-SOSHKMNI.js} +6 -5
  169. package/dist/chunk-UIEP5BA5.js +7 -0
  170. package/dist/{chunk-DZTMUFVC.js → chunk-V5GOY6TV.js} +2 -2
  171. package/dist/{chunk-Y3L6TPP3.js → chunk-XGKPMLYD.js} +8 -8
  172. package/dist/{chunk-N745TDH5.js → chunk-XRC7XE6B.js} +2 -2
  173. package/dist/chunk-Y2POLIXK.js +7 -0
  174. package/dist/{chunk-H6CDFWVR.js → chunk-ZOTVZM6F.js} +6 -2
  175. package/dist/i18n/src/index.js +1 -1
  176. package/dist/i18n/src/useLocalizedString.js +1 -1
  177. package/dist/inputs/src/InputGroup.css +12 -12
  178. package/dist/inputs/src/InputGroup.js +2 -2
  179. package/dist/inputs/src/PasswordField.css +1340 -570
  180. package/dist/inputs/src/PasswordField.js +80 -164
  181. package/dist/inputs/src/SearchField.css +1325 -576
  182. package/dist/inputs/src/SearchField.d.ts +2 -2
  183. package/dist/inputs/src/SearchField.js +80 -164
  184. package/dist/inputs/src/TextField.css +1337 -571
  185. package/dist/inputs/src/TextField.js +79 -56
  186. package/dist/inputs/src/index.css +1237 -471
  187. package/dist/inputs/src/index.d.ts +4 -0
  188. package/dist/inputs/src/index.js +79 -56
  189. package/dist/layout/src/Grid.d.ts +2 -22
  190. package/dist/layout/src/Grid.js +1 -1
  191. package/dist/layout/src/grid-helpers.d.ts +24 -0
  192. package/dist/layout/src/grid-helpers.js +2 -0
  193. package/dist/overlays/Popover/src/Popover.css +1480 -639
  194. package/dist/overlays/Popover/src/Popover.d.ts +5 -6
  195. package/dist/overlays/Popover/src/Popover.js +80 -54
  196. package/dist/overlays/Popover/src/PopoverContext.d.ts +1 -2
  197. package/dist/overlays/Popover/src/PopoverTrigger.d.ts +8 -0
  198. package/dist/overlays/Popover/src/PopoverTrigger.js +2 -0
  199. package/dist/overlays/Popover/src/index.css +1480 -639
  200. package/dist/overlays/Popover/src/index.d.ts +3 -2
  201. package/dist/overlays/Popover/src/index.js +80 -54
  202. package/dist/radio/src/Radio.css +69 -81
  203. package/dist/radio/src/Radio.d.ts +3 -1
  204. package/dist/radio/src/Radio.js +6 -6
  205. package/dist/radio/src/RadioContext.d.ts +2 -0
  206. package/dist/radio/src/RadioField.css +15 -15
  207. package/dist/radio/src/RadioField.js +4 -4
  208. package/dist/radio/src/RadioGroup.css +106 -118
  209. package/dist/radio/src/RadioGroup.js +5 -5
  210. package/dist/radio/src/index.css +106 -118
  211. package/dist/radio/src/index.js +11 -11
  212. package/dist/switch/src/Switch.css +27 -28
  213. package/dist/switch/src/Switch.js +6 -6
  214. package/dist/switch/src/SwitchField.css +15 -15
  215. package/dist/switch/src/SwitchField.js +2 -2
  216. package/dist/switch/src/index.css +33 -34
  217. package/dist/switch/src/index.js +7 -7
  218. package/dist/tag/src/Tag.css +1550 -633
  219. package/dist/tag/src/Tag.js +80 -52
  220. package/dist/tag/src/TagGroup.css +30 -30
  221. package/dist/tag/src/TagGroup.js +5 -5
  222. package/dist/tag/src/index.css +1550 -633
  223. package/dist/tag/src/index.js +80 -52
  224. package/dist/typography/Heading/src/Heading.css +1439 -522
  225. package/dist/typography/Heading/src/Heading.js +80 -52
  226. package/dist/typography/Heading/src/index.css +1439 -522
  227. package/dist/typography/Heading/src/index.js +80 -52
  228. package/dist/typography/Label/src/Label.css +9 -9
  229. package/dist/typography/Label/src/Label.js +1 -1
  230. package/dist/typography/Label/src/index.css +9 -9
  231. package/dist/typography/Label/src/index.js +1 -1
  232. package/dist/typography/OverlineText/src/OverlineText.css +6 -6
  233. package/dist/typography/OverlineText/src/OverlineText.js +1 -1
  234. package/dist/typography/OverlineText/src/index.css +6 -6
  235. package/dist/typography/OverlineText/src/index.js +1 -1
  236. package/dist/typography/Text/src/Text.css +9 -9
  237. package/dist/typography/Text/src/Text.js +3 -3
  238. package/dist/typography/Text/src/index.css +9 -9
  239. package/dist/typography/Text/src/index.js +3 -3
  240. package/dist/utils/src/index.d.ts +1 -1
  241. package/dist/utils/src/index.js +3 -3
  242. package/dist/utils/src/types.d.ts +16 -1
  243. package/package.json +5 -4
  244. package/dist/badge/src/BadgeContext.js +0 -2
  245. package/dist/chip/src/ChipContext.js +0 -2
  246. package/dist/chunk-CPWTHZGJ.js +0 -156
  247. package/dist/chunk-LJXTJRSB.js +0 -1
  248. package/dist/chunk-SWMFTL46.js +0 -373
  249. package/dist/chunk-TR7YX3IZ.js +0 -96
  250. package/dist/errorMessage/src/ErrorMessageContext.js +0 -2
  251. package/dist/helperMessage/src/HelperMessageContext.js +0 -2
  252. /package/dist/{badge → Badge}/src/BadgeContext.d.ts +0 -0
  253. /package/dist/{badge → Badge}/src/index.d.ts +0 -0
  254. /package/dist/{chip → Chip}/src/Chip.d.ts +0 -0
  255. /package/dist/{chip → Chip}/src/ChipContext.d.ts +0 -0
  256. /package/dist/{chip → Chip}/src/index.d.ts +0 -0
  257. /package/dist/{errorMessage → ErrorMessage}/src/ErrorMessage.d.ts +0 -0
  258. /package/dist/{errorMessage → ErrorMessage}/src/ErrorMessageContext.d.ts +0 -0
  259. /package/dist/{errorMessage → ErrorMessage}/src/index.d.ts +0 -0
  260. /package/dist/{helperMessage → HelperMessage}/src/HelperMessage.d.ts +0 -0
  261. /package/dist/{helperMessage → HelperMessage}/src/HelperMessageContext.d.ts +0 -0
  262. /package/dist/{helperMessage → HelperMessage}/src/index.d.ts +0 -0
@@ -0,0 +1,46 @@
1
+ import { AvatarContext } from './chunk-AES7QBQE.js';
2
+ import { _RichIconAvatarImage } from './chunk-ITQK6JTD.js';
3
+ import { DeletedUserRichIcon } from '@hopper-ui/icons';
4
+ import { useStyledSystem, useResponsiveValue } from '@hopper-ui/styled-system';
5
+ import clsx from 'clsx';
6
+ import { forwardRef } from 'react';
7
+ import { useContextProps } from 'react-aria-components';
8
+ import { jsx } from 'react/jsx-runtime';
9
+
10
+ var GlobalDeletedAvatarCssSelector = "hop-DeletedAvatar";
11
+ function DeletedAvatar(props, ref) {
12
+ var _a;
13
+ [props, ref] = useContextProps(props, ref, AvatarContext);
14
+ const { stylingProps, ...ownProps } = useStyledSystem(props);
15
+ const {
16
+ className,
17
+ size: sizeValue,
18
+ style,
19
+ ...otherProps
20
+ } = ownProps;
21
+ const size = (_a = useResponsiveValue(sizeValue)) != null ? _a : "md";
22
+ const classNames = clsx(
23
+ className,
24
+ GlobalDeletedAvatarCssSelector,
25
+ stylingProps.className
26
+ );
27
+ const mergedStyles = {
28
+ ...stylingProps.style,
29
+ ...style
30
+ };
31
+ return /* @__PURE__ */ jsx(
32
+ _RichIconAvatarImage,
33
+ {
34
+ ...otherProps,
35
+ className: classNames,
36
+ ref,
37
+ size,
38
+ style: mergedStyles,
39
+ children: /* @__PURE__ */ jsx(DeletedUserRichIcon, {})
40
+ }
41
+ );
42
+ }
43
+ var _DeletedAvatar = forwardRef(DeletedAvatar);
44
+ _DeletedAvatar.displayName = "DeletedAvatar";
45
+
46
+ export { GlobalDeletedAvatarCssSelector, _DeletedAvatar };
@@ -0,0 +1,49 @@
1
+ import { DividerContext } from './chunk-FYIHMKHI.js';
2
+ import { cssModule } from './chunk-KVDXQMWI.js';
3
+ import { useStyledSystem } from '@hopper-ui/styled-system';
4
+ import clsx from 'clsx';
5
+ import { forwardRef } from 'react';
6
+ import { useContextProps, Separator } from 'react-aria-components';
7
+ import { jsx } from 'react/jsx-runtime';
8
+
9
+ // css-module:./Divider.module.css#css-module
10
+ var Divider_module_default = { "hop-Divider": "Divider-module__hop-Divider___lUCFu", "hop-Divider--vertical": "Divider-module__hop-Divider--vertical___uIryJ" };
11
+ var GlobalDividerCssSelector = "hop-Divider";
12
+ function Divider(props, ref) {
13
+ [props, ref] = useContextProps(props, ref, DividerContext);
14
+ const { stylingProps, ...ownProps } = useStyledSystem(props);
15
+ const {
16
+ className,
17
+ style,
18
+ orientation,
19
+ ...otherProps
20
+ } = ownProps;
21
+ const classNames = clsx(
22
+ GlobalDividerCssSelector,
23
+ cssModule(
24
+ Divider_module_default,
25
+ "hop-Divider",
26
+ orientation
27
+ ),
28
+ stylingProps.className,
29
+ className
30
+ );
31
+ const mergedStyles = {
32
+ ...stylingProps.style,
33
+ ...style
34
+ };
35
+ return /* @__PURE__ */ jsx(
36
+ Separator,
37
+ {
38
+ ...otherProps,
39
+ ref,
40
+ className: classNames,
41
+ style: mergedStyles,
42
+ orientation
43
+ }
44
+ );
45
+ }
46
+ var _Divider = forwardRef(Divider);
47
+ _Divider.displayName = "Divider";
48
+
49
+ export { GlobalDividerCssSelector, _Divider };
@@ -1,20 +1,20 @@
1
+ import { RadioFieldContext } from './chunk-DGLAGYBD.js';
1
2
  import { RadioGroupContext } from './chunk-5MBJWRZD.js';
2
3
  import { RadioListContext } from './chunk-A7TZHALP.js';
3
4
  import { RadioContext } from './chunk-FU5CCPLP.js';
4
- import { RadioFieldContext } from './chunk-DGLAGYBD.js';
5
- import { ErrorMessageContext } from './chunk-ACVMW6YD.js';
6
- import { HelperMessageContext } from './chunk-ESVVLTEN.js';
7
5
  import { LabelContext } from './chunk-QCA3ZR56.js';
8
6
  import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
9
- import { cssModule } from './chunk-KVDXQMWI.js';
7
+ import { ErrorMessageContext } from './chunk-FAE27DLF.js';
8
+ import { HelperMessageContext } from './chunk-HZKFQ33E.js';
10
9
  import { SlotProvider } from './chunk-M36KANKC.js';
10
+ import { cssModule } from './chunk-KVDXQMWI.js';
11
11
  import { useStyledSystem, useResponsiveValue } from '@hopper-ui/styled-system';
12
12
  import { forwardRef } from 'react';
13
13
  import { useContextProps, composeRenderProps, RadioGroup as RadioGroup$1 } from 'react-aria-components';
14
14
  import { jsx } from 'react/jsx-runtime';
15
15
 
16
16
  // css-module:./RadioGroup.module.css#css-module
17
- var RadioGroup_module_default = { "hop-RadioGroup": "RadioGroup-module__hop-RadioGroup___BeZQs", "hop-RadioGroup--bordered": "RadioGroup-module__hop-RadioGroup--bordered___cZzyV", "hop-RadioGroup--sm": "RadioGroup-module__hop-RadioGroup--sm___IUAVE", "hop-RadioGroup--md": "RadioGroup-module__hop-RadioGroup--md___-Nt39", "hop-RadioGroup__label": "RadioGroup-module__hop-RadioGroup__label___jqTEX", "hop-RadioGroup__list": "RadioGroup-module__hop-RadioGroup__list___xrMDx", "hop-RadioGroup__radio": "RadioGroup-module__hop-RadioGroup__radio___g5qwi", "hop-RadioGroup__error-message": "RadioGroup-module__hop-RadioGroup__error-message___bXfiF", "hop-RadioGroup__helper-message": "RadioGroup-module__hop-RadioGroup__helper-message___l-UB6" };
17
+ var RadioGroup_module_default = { "hop-RadioGroup": "RadioGroup-module__hop-RadioGroup___S6s5y", "hop-RadioGroup--bordered": "RadioGroup-module__hop-RadioGroup--bordered___CFrBV", "hop-RadioGroup--sm": "RadioGroup-module__hop-RadioGroup--sm___2p7Wk", "hop-RadioGroup--md": "RadioGroup-module__hop-RadioGroup--md___eqGjG", "hop-RadioGroup__label": "RadioGroup-module__hop-RadioGroup__label___7-iXB", "hop-RadioGroup__list": "RadioGroup-module__hop-RadioGroup__list___C5N0N", "hop-RadioGroup__radio": "RadioGroup-module__hop-RadioGroup__radio___k3eYk", "hop-RadioGroup__error-message": "RadioGroup-module__hop-RadioGroup__error-message___vOUPq", "hop-RadioGroup__helper-message": "RadioGroup-module__hop-RadioGroup__helper-message___uQgIj" };
18
18
  var GlobalRadioGroupCssSelector = "hop-RadioGroup";
19
19
  function RadioGroup(props, ref) {
20
20
  var _a, _b;
@@ -0,0 +1,41 @@
1
+ import { useIsomorphicLayoutEffect } from '@hopper-ui/styled-system';
2
+ import { useState, useRef, useCallback } from 'react';
3
+
4
+ // src/ListBox/src/useLoadOnScroll.ts
5
+ function useLoadOnScroll(props, ref) {
6
+ const { isLoading, onLoadMore, scrollOffset = 5 } = props;
7
+ const [hasLoaded, setHasLoaded] = useState(false);
8
+ const isLoadingRef = useRef(isLoading);
9
+ const prevProps = useRef(props);
10
+ const onScroll = useCallback(() => {
11
+ if (ref.current && !isLoadingRef.current && onLoadMore) {
12
+ const shouldLoadMore = ref.current.scrollHeight - ref.current.scrollTop - ref.current.clientHeight < scrollOffset;
13
+ if (shouldLoadMore) {
14
+ isLoadingRef.current = true;
15
+ onLoadMore();
16
+ }
17
+ }
18
+ }, [onLoadMore, ref, scrollOffset]);
19
+ const lastContentSize = useRef(0);
20
+ useIsomorphicLayoutEffect(() => {
21
+ var _a;
22
+ const wasLoading = isLoadingRef.current;
23
+ if (props !== prevProps.current) {
24
+ isLoadingRef.current = isLoading;
25
+ prevProps.current = props;
26
+ }
27
+ const shouldLoadMore = !hasLoaded && (ref == null ? void 0 : ref.current) && !isLoadingRef.current && onLoadMore && ref.current.clientHeight === ref.current.scrollHeight && (wasLoading || ref.current.scrollHeight !== lastContentSize.current);
28
+ if (shouldLoadMore) {
29
+ isLoadingRef.current = true;
30
+ onLoadMore == null ? void 0 : onLoadMore();
31
+ setHasLoaded(true);
32
+ }
33
+ lastContentSize.current = ((_a = ref.current) == null ? void 0 : _a.scrollHeight) || 0;
34
+ return () => {
35
+ setHasLoaded(false);
36
+ };
37
+ }, [isLoading, onLoadMore, props, ref]);
38
+ return onScroll;
39
+ }
40
+
41
+ export { useLoadOnScroll };
@@ -0,0 +1,46 @@
1
+ import { AvatarContext } from './chunk-AES7QBQE.js';
2
+ import { _RichIconAvatarImage } from './chunk-ITQK6JTD.js';
3
+ import { AnonymousRichIcon } from '@hopper-ui/icons';
4
+ import { useStyledSystem, useResponsiveValue } from '@hopper-ui/styled-system';
5
+ import clsx from 'clsx';
6
+ import { forwardRef } from 'react';
7
+ import { useContextProps } from 'react-aria-components';
8
+ import { jsx } from 'react/jsx-runtime';
9
+
10
+ var GlobalAnonymousAvatarCssSelector = "hop-AnonymousAvatar";
11
+ function AnonymousAvatar(props, ref) {
12
+ var _a;
13
+ [props, ref] = useContextProps(props, ref, AvatarContext);
14
+ const { stylingProps, ...ownProps } = useStyledSystem(props);
15
+ const {
16
+ className,
17
+ size: sizeValue,
18
+ style,
19
+ ...otherProps
20
+ } = ownProps;
21
+ const size = (_a = useResponsiveValue(sizeValue)) != null ? _a : "md";
22
+ const classNames = clsx(
23
+ className,
24
+ GlobalAnonymousAvatarCssSelector,
25
+ stylingProps.className
26
+ );
27
+ const mergedStyles = {
28
+ ...stylingProps.style,
29
+ ...style
30
+ };
31
+ return /* @__PURE__ */ jsx(
32
+ _RichIconAvatarImage,
33
+ {
34
+ ...otherProps,
35
+ className: classNames,
36
+ ref,
37
+ size,
38
+ style: mergedStyles,
39
+ children: /* @__PURE__ */ jsx(AnonymousRichIcon, {})
40
+ }
41
+ );
42
+ }
43
+ var _AnonymousAvatar = forwardRef(AnonymousAvatar);
44
+ _AnonymousAvatar.displayName = "AnonymousAvatar";
45
+
46
+ export { GlobalAnonymousAvatarCssSelector, _AnonymousAvatar };
@@ -0,0 +1,7 @@
1
+ import { createContext } from 'react';
2
+
3
+ // src/Avatar/src/RichIconAvatarImageContext.ts
4
+ var RichIconAvatarImageContext = createContext({});
5
+ RichIconAvatarImageContext.displayName = "RichIconAvatarImageContext";
6
+
7
+ export { RichIconAvatarImageContext };
@@ -7,7 +7,7 @@ import { useContextProps, Text } from 'react-aria-components';
7
7
  import { jsx } from 'react/jsx-runtime';
8
8
 
9
9
  // css-module:./OverlineText.module.css#css-module
10
- var OverlineText_module_default = { "hop-OverlineText": "OverlineText-module__hop-OverlineText___lA54v", "hop-OverlineText__text": "OverlineText-module__hop-OverlineText__text___Z9gJ6" };
10
+ var OverlineText_module_default = { "hop-OverlineText": "OverlineText-module__hop-OverlineText___a5x6R", "hop-OverlineText__text": "OverlineText-module__hop-OverlineText__text___TV62d" };
11
11
  var GlobalOverlineTextCssSelector = "hop-OverlineText";
12
12
  function OverlineText(props, ref) {
13
13
  [props, ref] = useContextProps(props, ref, OverlineTextContext);
@@ -0,0 +1,43 @@
1
+ import { HeaderContext } from './chunk-7JOGKC3W.js';
2
+ import { useStyledSystem } from '@hopper-ui/styled-system';
3
+ import clsx from 'clsx';
4
+ import { forwardRef } from 'react';
5
+ import { useContextProps, Header as Header$1 } from 'react-aria-components';
6
+ import { jsx } from 'react/jsx-runtime';
7
+
8
+ var GlobalHeaderCssSelector = "hop-Header";
9
+ function Header(props, ref) {
10
+ [props, ref] = useContextProps(props, ref, HeaderContext);
11
+ const { stylingProps, ...ownProps } = useStyledSystem(props);
12
+ const {
13
+ className,
14
+ children,
15
+ style,
16
+ slot,
17
+ ...otherProps
18
+ } = ownProps;
19
+ const classNames = clsx(
20
+ GlobalHeaderCssSelector,
21
+ stylingProps.className,
22
+ className
23
+ );
24
+ const mergedStyles = {
25
+ ...stylingProps.style,
26
+ ...style
27
+ };
28
+ return /* @__PURE__ */ jsx(
29
+ Header$1,
30
+ {
31
+ ...otherProps,
32
+ ref,
33
+ className: classNames,
34
+ style: mergedStyles,
35
+ slot: slot || void 0,
36
+ children
37
+ }
38
+ );
39
+ }
40
+ var _Header = forwardRef(Header);
41
+ _Header.displayName = "Header";
42
+
43
+ export { GlobalHeaderCssSelector, _Header };
@@ -1,7 +1,7 @@
1
1
  import { EmbeddedButtonContext } from './chunk-O7IJYNVQ.js';
2
2
  import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
3
- import { cssModule } from './chunk-KVDXQMWI.js';
4
3
  import { SlotProvider } from './chunk-M36KANKC.js';
4
+ import { cssModule } from './chunk-KVDXQMWI.js';
5
5
  import { IconContext } from '@hopper-ui/icons';
6
6
  import { useStyledSystem, useResponsiveValue } from '@hopper-ui/styled-system';
7
7
  import { forwardRef } from 'react';
@@ -9,7 +9,7 @@ import { useContextProps, composeRenderProps, Button } from 'react-aria-componen
9
9
  import { jsx } from 'react/jsx-runtime';
10
10
 
11
11
  // css-module:./EmbeddedButton.module.css#css-module
12
- var EmbeddedButton_module_default = { "hop-EmbeddedButton": "EmbeddedButton-module__hop-EmbeddedButton___OMar5", "hop-EmbeddedButton--md": "EmbeddedButton-module__hop-EmbeddedButton--md___YBpcJ", "hop-EmbeddedButton--lg": "EmbeddedButton-module__hop-EmbeddedButton--lg___dFa3L", "hop-EmbeddedButton__icon": "EmbeddedButton-module__hop-EmbeddedButton__icon___QZTts" };
12
+ var EmbeddedButton_module_default = { "hop-EmbeddedButton": "EmbeddedButton-module__hop-EmbeddedButton___-vxw3", "hop-EmbeddedButton--md": "EmbeddedButton-module__hop-EmbeddedButton--md___-R-Cb", "hop-EmbeddedButton--lg": "EmbeddedButton-module__hop-EmbeddedButton--lg___RoLAu", "hop-EmbeddedButton__icon": "EmbeddedButton-module__hop-EmbeddedButton__icon___JHGDE" };
13
13
  var GlobalEmbeddedButtonCssSelector = "hop-EmbeddedButton";
14
14
  function EmbeddedButton(props, ref) {
15
15
  var _a;
@@ -1,6 +1,6 @@
1
- import { ErrorMessageContext } from './chunk-ACVMW6YD.js';
2
1
  import { useRenderProps } from './chunk-NH3IVMXB.js';
3
- import { _Text } from './chunk-WGDP4ECF.js';
2
+ import { ErrorMessageContext } from './chunk-FAE27DLF.js';
3
+ import { _Text } from './chunk-RG4JKE4N.js';
4
4
  import { cssModule } from './chunk-KVDXQMWI.js';
5
5
  import { WarningIcon } from '@hopper-ui/icons';
6
6
  import { useStyledSystem } from '@hopper-ui/styled-system';
@@ -10,7 +10,7 @@ import { FieldErrorContext, useContextProps } from 'react-aria-components';
10
10
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
11
11
 
12
12
  // css-module:./ErrorMessage.module.css#css-module
13
- var ErrorMessage_module_default = { "hop-ErrorMessage": "ErrorMessage-module__hop-ErrorMessage___mRyMK", "hop-ErrorMessage__icon": "ErrorMessage-module__hop-ErrorMessage__icon___w9R-k" };
13
+ var ErrorMessage_module_default = { "hop-ErrorMessage": "ErrorMessage-module__hop-ErrorMessage___SA3fD", "hop-ErrorMessage__icon": "ErrorMessage-module__hop-ErrorMessage__icon___cB2Bk" };
14
14
  var GlobalErrorMessageCssSelector = "hop-ErrorMessage";
15
15
  function ErrorMessage(props, ref) {
16
16
  const validation = useContext(FieldErrorContext);
@@ -1,4 +1,4 @@
1
- import { Div, getSizingValue } from '@hopper-ui/styled-system';
1
+ import { Div } from '@hopper-ui/styled-system';
2
2
  import { forwardRef } from 'react';
3
3
  import { jsx } from 'react/jsx-runtime';
4
4
 
@@ -37,19 +37,7 @@ function Grid(props, ref) {
37
37
  }
38
38
  );
39
39
  }
40
- function repeat(count, repetition) {
41
- return `repeat(${count}, ${Array.isArray(repetition) ? interpolateGridTemplateArray(repetition) : getSizingValue(repetition)})`;
42
- }
43
- function minmax(min, max) {
44
- return `minmax(${getSizingValue(min)}, ${getSizingValue(max)})`;
45
- }
46
- function fitContent(dimension) {
47
- return `fit-content(${getSizingValue(dimension)})`;
48
- }
49
- function interpolateGridTemplateArray(values) {
50
- return values.map((x) => getSizingValue(x)).join(" ");
51
- }
52
40
  var _Grid = forwardRef(Grid);
53
- _Grid.displayName = "Inline";
41
+ _Grid.displayName = "Grid";
54
42
 
55
- export { _Grid, fitContent, minmax, repeat };
43
+ export { _Grid };
@@ -26,7 +26,18 @@ var HopperProvider = (props, ref) => {
26
26
  if (navigate) {
27
27
  content = /* @__PURE__ */ jsx(RouterProvider, { navigate, useHref, children });
28
28
  }
29
- return /* @__PURE__ */ jsx(StyledSystemProvider, { ref, withBodyStyle, colorScheme, withCssVariables, className: classNames, ...rest, children: /* @__PURE__ */ jsx(I18nProvider, { locale, children: content }) });
29
+ return /* @__PURE__ */ jsx(
30
+ StyledSystemProvider,
31
+ {
32
+ ref,
33
+ withBodyStyle,
34
+ colorScheme,
35
+ withCssVariables,
36
+ className: classNames,
37
+ ...rest,
38
+ children: /* @__PURE__ */ jsx(I18nProvider, { locale, children: content })
39
+ }
40
+ );
30
41
  };
31
42
  var _HopperProvider = forwardRef(HopperProvider);
32
43
  _HopperProvider.displayName = "HopperProvider";
@@ -0,0 +1,53 @@
1
+ import { useIsomorphicLayoutEffect } from '@hopper-ui/styled-system';
2
+ import { useState, useRef, useCallback } from 'react';
3
+
4
+ // src/Avatar/src/useImageFallback.ts
5
+ function useImageFallback(props) {
6
+ const { src, fallbackSrc, onError, onLoad } = props;
7
+ const [status, setStatus] = useState(src ? "loading" : "pending");
8
+ const [imageUrl, setImageUrl] = useState(src != null ? src : "");
9
+ const imageRef = useRef();
10
+ const load = useCallback(() => {
11
+ if (!src) {
12
+ return;
13
+ }
14
+ flush();
15
+ const image = new Image();
16
+ image.src = src;
17
+ setImageUrl(src);
18
+ image.onload = (event) => {
19
+ flush();
20
+ setStatus("loaded");
21
+ onLoad == null ? void 0 : onLoad(event);
22
+ };
23
+ image.onerror = (event) => {
24
+ if (src !== fallbackSrc && image.src === src && fallbackSrc) {
25
+ setImageUrl(fallbackSrc);
26
+ image.src = fallbackSrc;
27
+ } else {
28
+ setStatus("failed");
29
+ flush();
30
+ }
31
+ onError == null ? void 0 : onError(event);
32
+ };
33
+ imageRef.current = image;
34
+ }, [src, onLoad, fallbackSrc, onError]);
35
+ const flush = () => {
36
+ if (imageRef.current) {
37
+ imageRef.current.onload = null;
38
+ imageRef.current.onerror = null;
39
+ imageRef.current = null;
40
+ }
41
+ };
42
+ useIsomorphicLayoutEffect(() => {
43
+ if (status === "loading") {
44
+ load();
45
+ }
46
+ return () => {
47
+ flush();
48
+ };
49
+ }, [status, load]);
50
+ return { imageUrl, status };
51
+ }
52
+
53
+ export { useImageFallback };
@@ -0,0 +1,41 @@
1
+ import { SectionContext } from './chunk-5H5AZJPQ.js';
2
+ import { useStyledSystem } from '@hopper-ui/styled-system';
3
+ import clsx from 'clsx';
4
+ import { forwardRef } from 'react';
5
+ import { useContextProps, Section as Section$1 } from 'react-aria-components';
6
+ import { jsx } from 'react/jsx-runtime';
7
+
8
+ var GlobalSectionCssSelector = "hop-Section";
9
+ function Section(props, ref) {
10
+ [props, ref] = useContextProps(props, ref, SectionContext);
11
+ const { stylingProps, ...ownProps } = useStyledSystem(props);
12
+ const {
13
+ className,
14
+ children,
15
+ style,
16
+ ...otherProps
17
+ } = ownProps;
18
+ const classNames = clsx(
19
+ GlobalSectionCssSelector,
20
+ stylingProps.className,
21
+ className
22
+ );
23
+ const mergedStyles = {
24
+ ...stylingProps.style,
25
+ ...style
26
+ };
27
+ return /* @__PURE__ */ jsx(
28
+ Section$1,
29
+ {
30
+ ...otherProps,
31
+ ref,
32
+ className: classNames,
33
+ style: mergedStyles,
34
+ children
35
+ }
36
+ );
37
+ }
38
+ var _Section = forwardRef(Section);
39
+ _Section.displayName = "Section";
40
+
41
+ export { GlobalSectionCssSelector, _Section };
@@ -1,6 +1,6 @@
1
1
  import { ClearButtonContext } from './chunk-DXVKHP4V.js';
2
- import { _EmbeddedButton } from './chunk-6MSYEF4W.js';
3
- import { useLocalizedString } from './chunk-H6CDFWVR.js';
2
+ import { _EmbeddedButton } from './chunk-MED2BIDV.js';
3
+ import { useLocalizedString } from './chunk-ZOTVZM6F.js';
4
4
  import { DismissIcon } from '@hopper-ui/icons';
5
5
  import { forwardRef } from 'react';
6
6
  import { useContextProps } from 'react-aria-components';
@@ -0,0 +1,7 @@
1
+ import { createContext } from 'react';
2
+
3
+ // src/ListBox/src/ListBoxItemSkeletonContext.ts
4
+ var ListBoxItemSkeletonContext = createContext({});
5
+ ListBoxItemSkeletonContext.displayName = "ListBoxItemSkeletonContext";
6
+
7
+ export { ListBoxItemSkeletonContext };
@@ -1,5 +1,5 @@
1
- import { HelperMessageContext } from './chunk-ESVVLTEN.js';
2
- import { _Text } from './chunk-WGDP4ECF.js';
1
+ import { HelperMessageContext } from './chunk-HZKFQ33E.js';
2
+ import { _Text } from './chunk-RG4JKE4N.js';
3
3
  import { cssModule } from './chunk-KVDXQMWI.js';
4
4
  import { InfoIcon } from '@hopper-ui/icons';
5
5
  import { useStyledSystem } from '@hopper-ui/styled-system';
@@ -9,7 +9,7 @@ import { useContextProps, FieldErrorContext } from 'react-aria-components';
9
9
  import { jsxs, jsx } from 'react/jsx-runtime';
10
10
 
11
11
  // css-module:./HelperMessage.module.css#css-module
12
- var HelperMessage_module_default = { "hop-HelperMessage": "HelperMessage-module__hop-HelperMessage___VrfVI", "hop-HelperMessage__icon": "HelperMessage-module__hop-HelperMessage__icon___mVrpO" };
12
+ var HelperMessage_module_default = { "hop-HelperMessage": "HelperMessage-module__hop-HelperMessage___msUnY", "hop-HelperMessage__icon": "HelperMessage-module__hop-HelperMessage__icon___-GUWj" };
13
13
  var GlobalHelperMessageCssSelector = "hop-HelperMessage";
14
14
  function HelperMessage(props, ref) {
15
15
  const validation = useContext(FieldErrorContext);
@@ -1,11 +1,11 @@
1
+ import { LinkContext } from './chunk-4VVNSXIB.js';
2
+ import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
1
3
  import { isTextOnlyChildren } from './chunk-ZWU6DRRZ.js';
2
- import { _Text } from './chunk-WGDP4ECF.js';
4
+ import { IconListContext } from './chunk-DHVVYSLB.js';
5
+ import { _Text } from './chunk-RG4JKE4N.js';
3
6
  import { TextContext } from './chunk-X6SER3TZ.js';
4
- import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
5
- import { cssModule } from './chunk-KVDXQMWI.js';
6
7
  import { SlotProvider } from './chunk-M36KANKC.js';
7
- import { IconListContext } from './chunk-DHVVYSLB.js';
8
- import { LinkContext } from './chunk-4VVNSXIB.js';
8
+ import { cssModule } from './chunk-KVDXQMWI.js';
9
9
  import { IconContext } from '@hopper-ui/icons';
10
10
  import { useStyledSystem, useResponsiveValue } from '@hopper-ui/styled-system';
11
11
  import { forwardRef } from 'react';
@@ -13,7 +13,7 @@ import { useContextProps, composeRenderProps, DEFAULT_SLOT, Link as Link$1 } fro
13
13
  import { jsx } from 'react/jsx-runtime';
14
14
 
15
15
  // css-module:./Link.module.css#css-module
16
- var Link_module_default = { "hop-Link": "Link-module__hop-Link___aLbeK", "hop-Link--quiet": "Link-module__hop-Link--quiet___7n7m5", "hop-Link--primary": "Link-module__hop-Link--primary___-xcuv", "hop-Link--secondary": "Link-module__hop-Link--secondary___4z2HJ", "hop-Link__icon": "Link-module__hop-Link__icon___Y38KO", "hop-Link__icon-list": "Link-module__hop-Link__icon-list___4UNng", "hop-Link__text": "Link-module__hop-Link__text___RyiFE", "hop-Link__start-icon": "Link-module__hop-Link__start-icon___Z6aUG", "hop-Link__start-icon-list": "Link-module__hop-Link__start-icon-list___wmb1h" };
16
+ var Link_module_default = { "hop-Link": "Link-module__hop-Link___m4HlM", "hop-Link--quiet": "Link-module__hop-Link--quiet___PEKek", "hop-Link--primary": "Link-module__hop-Link--primary___-EqWZ", "hop-Link--secondary": "Link-module__hop-Link--secondary___UNknc", "hop-Link__icon": "Link-module__hop-Link__icon___KiZR6", "hop-Link__icon-list": "Link-module__hop-Link__icon-list___eu2Y4", "hop-Link__text": "Link-module__hop-Link__text___I34XD", "hop-Link__start-icon": "Link-module__hop-Link__start-icon___Klqm6", "hop-Link__start-icon-list": "Link-module__hop-Link__start-icon-list___23TDM" };
17
17
  var GlobalLinkCssSelector = "hop-Link";
18
18
  var LinkToIconSizeAdapter = {
19
19
  inherit: void 0,
@@ -0,0 +1,142 @@
1
+ import { isFunction } from './chunk-TIPN4VYD.js';
2
+ import { useLoadOnScroll } from './chunk-JTNMFPM4.js';
3
+ import { SectionContext } from './chunk-5H5AZJPQ.js';
4
+ import { ListBoxContext } from './chunk-UIEP5BA5.js';
5
+ import { _ListBoxItem } from './chunk-E4ALW4MZ.js';
6
+ import { useLocalizedString } from './chunk-ZOTVZM6F.js';
7
+ import { ListBoxItemContext } from './chunk-Y2POLIXK.js';
8
+ import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
9
+ import { HeaderContext } from './chunk-7JOGKC3W.js';
10
+ import { DividerContext } from './chunk-FYIHMKHI.js';
11
+ import { _Text } from './chunk-RG4JKE4N.js';
12
+ import { SlotProvider } from './chunk-M36KANKC.js';
13
+ import { cssModule } from './chunk-KVDXQMWI.js';
14
+ import { useStyledSystem, useResponsiveValue } from '@hopper-ui/styled-system';
15
+ import clsx from 'clsx';
16
+ import { forwardRef } from 'react';
17
+ import { useContextProps, composeRenderProps, ListBox as ListBox$1, Collection } from 'react-aria-components';
18
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
19
+
20
+ // css-module:./ListBox.module.css#css-module
21
+ var ListBox_module_default = { "hop-ListBox": "ListBox-module__hop-ListBox___SARwA", "hop-ListBox--fluid": "ListBox-module__hop-ListBox--fluid___Imbbr", "hop-ListBox__section": "ListBox-module__hop-ListBox__section___EdImM", "hop-ListBox__item": "ListBox-module__hop-ListBox__item___-dZ1Z", "hop-ListBox__section-header": "ListBox-module__hop-ListBox__section-header___F18mO", "hop-ListBox__divider": "ListBox-module__hop-ListBox__divider___5vc2s" };
22
+ var GlobalListBoxCssSelector = "hop-ListBox";
23
+ var GlobalListBoxEmptyItemCssSelector = "hop-ListBox__empty-item";
24
+ var ListBoxToTextSizeAdapter = {
25
+ xs: "sm",
26
+ sm: "sm",
27
+ md: "sm",
28
+ lg: "md"
29
+ };
30
+ function ListBox(props, ref) {
31
+ var _a, _b;
32
+ [props, ref] = useContextProps(props, ref, ListBoxContext);
33
+ const { stylingProps, ...ownProps } = useStyledSystem(props);
34
+ const {
35
+ className,
36
+ children,
37
+ disallowEmptySelection: disallowEmptySelectionProp,
38
+ isFluid: isFluidProp,
39
+ isInvalid,
40
+ isLoading,
41
+ onLoadMore,
42
+ renderEmptyState,
43
+ size: sizeProp,
44
+ style: styleProp,
45
+ selectionIndicator = "check",
46
+ selectionMode,
47
+ ...otherProps
48
+ } = ownProps;
49
+ const size = (_a = useResponsiveValue(sizeProp)) != null ? _a : "sm";
50
+ const isFluid = (_b = useResponsiveValue(isFluidProp)) != null ? _b : false;
51
+ const disallowEmptySelection = disallowEmptySelectionProp != null ? disallowEmptySelectionProp : selectionIndicator === "input" && selectionMode === "single";
52
+ const stringFormatter = useLocalizedString();
53
+ const classNames = composeClassnameRenderProps(
54
+ className,
55
+ GlobalListBoxCssSelector,
56
+ cssModule(
57
+ ListBox_module_default,
58
+ "hop-ListBox",
59
+ size,
60
+ isFluid && "fluid"
61
+ ),
62
+ stylingProps.className
63
+ );
64
+ const emptyItemClassNames = clsx(
65
+ GlobalListBoxEmptyItemCssSelector,
66
+ cssModule(
67
+ ListBox_module_default,
68
+ "hop-ListBox__empty-item",
69
+ size
70
+ )
71
+ );
72
+ const style = composeRenderProps(styleProp, (prev) => {
73
+ return {
74
+ ...stylingProps.style,
75
+ ...prev
76
+ };
77
+ });
78
+ const onScroll = useLoadOnScroll({ isLoading, onLoadMore }, ref);
79
+ const renderChildren = () => {
80
+ if (props.items) {
81
+ return /* @__PURE__ */ jsx(Collection, { items: props.items, children: (item) => isFunction(children) ? children(item) : children });
82
+ }
83
+ return /* @__PURE__ */ jsx(Fragment, { children });
84
+ };
85
+ const handleRenderEmptyState = (renderProps) => {
86
+ let result = null;
87
+ if (renderEmptyState && isFunction(renderEmptyState)) {
88
+ result = renderEmptyState(renderProps);
89
+ if (result) {
90
+ return /* @__PURE__ */ jsx(_Text, { className: emptyItemClassNames, size: ListBoxToTextSizeAdapter[size], children: result });
91
+ }
92
+ }
93
+ return result;
94
+ };
95
+ return /* @__PURE__ */ jsx(
96
+ SlotProvider,
97
+ {
98
+ values: [
99
+ [HeaderContext, {
100
+ className: ListBox_module_default["hop-ListBox__section-header"]
101
+ }],
102
+ [SectionContext, {
103
+ className: ListBox_module_default["hop-ListBox__section"]
104
+ }],
105
+ [DividerContext, {
106
+ className: ListBox_module_default["hop-ListBox__divider"]
107
+ }],
108
+ [ListBoxItemContext, {
109
+ className: ListBox_module_default["hop-ListBox__item"],
110
+ size,
111
+ selectionIndicator,
112
+ isInvalid
113
+ }]
114
+ ],
115
+ children: /* @__PURE__ */ jsxs(
116
+ ListBox$1,
117
+ {
118
+ ...otherProps,
119
+ ref,
120
+ className: classNames,
121
+ disallowEmptySelection,
122
+ renderEmptyState: handleRenderEmptyState,
123
+ selectionMode,
124
+ style,
125
+ onScroll,
126
+ "data-loading": isLoading,
127
+ shouldSelectOnPressUp: true,
128
+ children: [
129
+ renderChildren(),
130
+ isLoading && Array.from({ length: 5 }).map((_, index) => {
131
+ return /* @__PURE__ */ jsx(_ListBoxItem, { id: `loadingListItem_${index.toString()}`, isLoading, size, textValue: stringFormatter.format("ListBoxItem.loadingTextValue") }, `loadingListItem_${index.toString()}`);
132
+ })
133
+ ]
134
+ }
135
+ )
136
+ }
137
+ );
138
+ }
139
+ var _ListBox = forwardRef(ListBox);
140
+ _ListBox.displayName = "ListBox";
141
+
142
+ export { GlobalListBoxCssSelector, GlobalListBoxEmptyItemCssSelector, _ListBox };