@hopper-ui/components 1.0.6 → 1.0.7

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 (237) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/Avatar/src/AnonymousAvatar.css +10 -10
  3. package/dist/Avatar/src/AnonymousAvatar.js +3 -3
  4. package/dist/Avatar/src/Avatar.css +37 -37
  5. package/dist/Avatar/src/Avatar.js +5 -5
  6. package/dist/Avatar/src/AvatarContext.js +1 -1
  7. package/dist/Avatar/src/DeletedAvatar.css +10 -10
  8. package/dist/Avatar/src/DeletedAvatar.js +3 -3
  9. package/dist/Avatar/src/RichIconAvatarImage.css +10 -10
  10. package/dist/Avatar/src/RichIconAvatarImage.js +2 -2
  11. package/dist/Avatar/src/RichIconAvatarImageContext.js +1 -1
  12. package/dist/Avatar/src/index.css +37 -37
  13. package/dist/Avatar/src/index.js +7 -7
  14. package/dist/Avatar/src/useImageFallback.js +1 -1
  15. package/dist/Badge/src/Badge.css +10 -10
  16. package/dist/Badge/src/Badge.js +3 -3
  17. package/dist/Badge/src/BadgeContext.js +1 -1
  18. package/dist/Badge/src/index.css +10 -10
  19. package/dist/Badge/src/index.js +3 -3
  20. package/dist/Chip/src/Chip.css +33 -33
  21. package/dist/Chip/src/Chip.js +3 -3
  22. package/dist/Chip/src/ChipContext.js +1 -1
  23. package/dist/Chip/src/index.css +33 -33
  24. package/dist/Chip/src/index.js +3 -3
  25. package/dist/Divider/src/Divider.css +2 -2
  26. package/dist/Divider/src/Divider.js +2 -2
  27. package/dist/Divider/src/DividerContext.js +1 -1
  28. package/dist/Divider/src/index.css +2 -2
  29. package/dist/Divider/src/index.js +2 -2
  30. package/dist/ErrorMessage/src/ErrorMessage.css +11 -11
  31. package/dist/ErrorMessage/src/ErrorMessage.js +3 -3
  32. package/dist/ErrorMessage/src/ErrorMessageContext.js +1 -1
  33. package/dist/ErrorMessage/src/index.css +11 -11
  34. package/dist/ErrorMessage/src/index.js +3 -3
  35. package/dist/Header/src/Header.js +1 -1
  36. package/dist/Header/src/HeaderContext.js +1 -1
  37. package/dist/Header/src/index.js +1 -1
  38. package/dist/HelperMessage/src/HelperMessage.css +11 -11
  39. package/dist/HelperMessage/src/HelperMessage.js +3 -3
  40. package/dist/HelperMessage/src/HelperMessageContext.js +1 -1
  41. package/dist/HelperMessage/src/index.css +11 -11
  42. package/dist/HelperMessage/src/index.js +3 -3
  43. package/dist/HopperProvider/src/HopperProvider.js +1 -1
  44. package/dist/HopperProvider/src/index.js +1 -1
  45. package/dist/IconList/src/IconList.css +1 -1
  46. package/dist/IconList/src/IconList.js +2 -2
  47. package/dist/IconList/src/IconListContext.js +1 -1
  48. package/dist/IconList/src/index.css +1 -1
  49. package/dist/IconList/src/index.js +2 -2
  50. package/dist/Link/src/Link.css +31 -31
  51. package/dist/Link/src/Link.js +3 -3
  52. package/dist/Link/src/LinkContext.js +1 -1
  53. package/dist/Link/src/index.css +31 -31
  54. package/dist/Link/src/index.js +3 -3
  55. package/dist/ListBox/src/ListBox.css +175 -175
  56. package/dist/ListBox/src/ListBox.js +11 -11
  57. package/dist/ListBox/src/ListBoxContext.js +1 -1
  58. package/dist/ListBox/src/ListBoxItem.css +160 -160
  59. package/dist/ListBox/src/ListBoxItem.js +10 -10
  60. package/dist/ListBox/src/ListBoxItemContext.js +1 -1
  61. package/dist/ListBox/src/ListBoxItemSkeleton.css +7 -7
  62. package/dist/ListBox/src/ListBoxItemSkeleton.js +2 -2
  63. package/dist/ListBox/src/ListBoxItemSkeletonContext.js +1 -1
  64. package/dist/ListBox/src/index.css +175 -175
  65. package/dist/ListBox/src/index.js +11 -11
  66. package/dist/ListBox/src/useLoadOnScroll.js +1 -1
  67. package/dist/Section/src/Section.js +1 -1
  68. package/dist/Section/src/SectionContext.js +1 -1
  69. package/dist/Section/src/index.js +1 -1
  70. package/dist/Spinner/src/Spinner.css +19 -19
  71. package/dist/Spinner/src/Spinner.js +3 -3
  72. package/dist/Spinner/src/SpinnerContext.js +1 -1
  73. package/dist/Spinner/src/index.css +19 -19
  74. package/dist/Spinner/src/index.js +3 -3
  75. package/dist/buttons/src/Button.css +103 -103
  76. package/dist/buttons/src/Button.js +6 -6
  77. package/dist/buttons/src/ButtonContext.js +1 -1
  78. package/dist/buttons/src/ButtonGroup.css +11 -11
  79. package/dist/buttons/src/ButtonGroup.js +2 -2
  80. package/dist/buttons/src/ButtonGroupContext.js +1 -1
  81. package/dist/buttons/src/ClearButton.css +12 -12
  82. package/dist/buttons/src/ClearButton.js +4 -4
  83. package/dist/buttons/src/ClearButtonContext.js +1 -1
  84. package/dist/buttons/src/EmbeddedButton.css +12 -12
  85. package/dist/buttons/src/EmbeddedButton.js +2 -2
  86. package/dist/buttons/src/EmbeddedButtonContext.js +1 -1
  87. package/dist/buttons/src/index.css +126 -126
  88. package/dist/buttons/src/index.js +9 -9
  89. package/dist/checkbox/src/Checkbox.css +31 -31
  90. package/dist/checkbox/src/Checkbox.js +3 -3
  91. package/dist/checkbox/src/CheckboxContext.js +1 -1
  92. package/dist/checkbox/src/CheckboxField.css +15 -15
  93. package/dist/checkbox/src/CheckboxField.js +2 -2
  94. package/dist/checkbox/src/CheckboxFieldContext.js +1 -1
  95. package/dist/checkbox/src/CheckboxGroup.css +66 -66
  96. package/dist/checkbox/src/CheckboxGroup.js +4 -4
  97. package/dist/checkbox/src/CheckboxGroupContext.js +1 -1
  98. package/dist/checkbox/src/CheckboxList.js +1 -1
  99. package/dist/checkbox/src/CheckboxListContext.js +1 -1
  100. package/dist/checkbox/src/index.css +66 -66
  101. package/dist/checkbox/src/index.js +8 -8
  102. package/dist/{chunk-53FHDOG7.js → chunk-2NJ3RDMJ.js} +2 -2
  103. package/dist/chunk-3LGP5T4C.js +625 -0
  104. package/dist/{chunk-JRDN364E.js → chunk-3WUDQLLR.js} +2 -2
  105. package/dist/{chunk-MED2BIDV.js → chunk-4TJUYXYN.js} +1 -1
  106. package/dist/{chunk-MVRI6GLQ.js → chunk-4V75RYJN.js} +2 -2
  107. package/dist/{chunk-QBCCF2C2.js → chunk-5CIADHZR.js} +2 -2
  108. package/dist/{chunk-6QMIRVLY.js → chunk-666H6UTL.js} +1 -1
  109. package/dist/{chunk-J53HGLCT.js → chunk-AE24HPDG.js} +1 -1
  110. package/dist/chunk-CK5HMGDC.js +156 -0
  111. package/dist/{chunk-HR25MLRP.js → chunk-COBPJHIY.js} +1 -1
  112. package/dist/{chunk-XRC7XE6B.js → chunk-CXIMLIUB.js} +2 -2
  113. package/dist/{chunk-RA7PM75O.js → chunk-DESANYPD.js} +5 -5
  114. package/dist/{chunk-RG4JKE4N.js → chunk-E7Y25WJE.js} +1 -1
  115. package/dist/{chunk-K4ZGI7DJ.js → chunk-EBXHYPDU.js} +1 -1
  116. package/dist/{chunk-BKC74M6Y.js → chunk-FMSIW5AX.js} +1 -1
  117. package/dist/{chunk-OHB5QR5P.js → chunk-HVUX7ZQ3.js} +2 -2
  118. package/dist/{chunk-37NW34QM.js → chunk-IUQNDY3E.js} +3 -3
  119. package/dist/{chunk-2P3A4VVY.js → chunk-JSBRDJBE.js} +1 -6
  120. package/dist/{chunk-J33IFG4U.js → chunk-LIUW56HE.js} +1 -1
  121. package/dist/chunk-LJXTJRSB.js +1 -0
  122. package/dist/{chunk-SOSHKMNI.js → chunk-LM4HMPSD.js} +2 -2
  123. package/dist/{chunk-2XUHTPCX.js → chunk-NQOLP5NY.js} +2 -2
  124. package/dist/{chunk-XGKPMLYD.js → chunk-OKAYIZ45.js} +4 -4
  125. package/dist/{chunk-ITQK6JTD.js → chunk-QACERXDV.js} +1 -1
  126. package/dist/{chunk-JUMJ6A3K.js → chunk-R2UVMOIP.js} +1 -1
  127. package/dist/{chunk-4TXFHYHL.js → chunk-RW4GDPRX.js} +1 -1
  128. package/dist/{chunk-E4WFKXW4.js → chunk-SHVSB6MD.js} +4 -4
  129. package/dist/{chunk-3LH2JHUO.js → chunk-SSCPXYN6.js} +3 -3
  130. package/dist/{chunk-E4ALW4MZ.js → chunk-SXPMPVDJ.js} +8 -8
  131. package/dist/chunk-U4NXU44C.js +118 -0
  132. package/dist/{chunk-F2URSFJA.js → chunk-UUUU6SUW.js} +2 -2
  133. package/dist/chunk-W2ZCHVKP.js +119 -0
  134. package/dist/{chunk-3A6TTZAA.js → chunk-WSNJNUUA.js} +1 -1
  135. package/dist/{chunk-P5CWOV3L.js → chunk-WXJ3U2DV.js} +2 -2
  136. package/dist/{chunk-RCX5B3S3.js → chunk-XC7OT325.js} +1 -1
  137. package/dist/{chunk-G242LPQE.js → chunk-XVKZ3Q3B.js} +2 -2
  138. package/dist/{chunk-ZOTVZM6F.js → chunk-YEYNRBMQ.js} +1 -1
  139. package/dist/{chunk-4JAV3FIH.js → chunk-YTPFSLHU.js} +2 -2
  140. package/dist/{chunk-V5GOY6TV.js → chunk-YZRL7TXT.js} +1 -1
  141. package/dist/chunk-ZMDHYGEP.js +57 -0
  142. package/dist/i18n/src/index.js +2 -2
  143. package/dist/i18n/src/useLocalizedString.js +2 -2
  144. package/dist/index.css +3297 -0
  145. package/dist/index.d.ts +113 -0
  146. package/dist/index.js +107 -0
  147. package/dist/inputs/src/InputGroup.css +12 -12
  148. package/dist/inputs/src/InputGroup.js +2 -2
  149. package/dist/inputs/src/InputGroupContext.js +1 -1
  150. package/dist/inputs/src/PasswordField.css +229 -2405
  151. package/dist/inputs/src/PasswordField.js +12 -91
  152. package/dist/inputs/src/PasswordFieldContext.js +1 -1
  153. package/dist/inputs/src/SearchField.css +235 -2390
  154. package/dist/inputs/src/SearchField.js +13 -90
  155. package/dist/inputs/src/SearchFieldContext.js +1 -1
  156. package/dist/inputs/src/TextField.css +230 -2402
  157. package/dist/inputs/src/TextField.js +13 -89
  158. package/dist/inputs/src/TextFieldContext.js +1 -1
  159. package/dist/inputs/src/index.css +219 -2302
  160. package/dist/inputs/src/index.js +16 -88
  161. package/dist/layout/src/Content.js +1 -1
  162. package/dist/layout/src/ContentContext.js +1 -1
  163. package/dist/layout/src/Flex.js +1 -1
  164. package/dist/layout/src/Footer.js +1 -1
  165. package/dist/layout/src/FooterContext.js +1 -1
  166. package/dist/layout/src/Grid.js +1 -1
  167. package/dist/layout/src/Inline.js +1 -1
  168. package/dist/layout/src/Stack.js +1 -1
  169. package/dist/layout/src/grid-helpers.js +1 -1
  170. package/dist/overlays/Popover/src/Popover.css +457 -457
  171. package/dist/overlays/Popover/src/Popover.js +52 -47
  172. package/dist/overlays/Popover/src/PopoverContext.js +1 -1
  173. package/dist/overlays/Popover/src/PopoverTrigger.js +1 -1
  174. package/dist/overlays/Popover/src/index.css +457 -457
  175. package/dist/overlays/Popover/src/index.js +52 -47
  176. package/dist/radio/src/Radio.css +31 -31
  177. package/dist/radio/src/Radio.js +3 -3
  178. package/dist/radio/src/RadioContext.js +1 -1
  179. package/dist/radio/src/RadioField.css +15 -15
  180. package/dist/radio/src/RadioField.js +2 -2
  181. package/dist/radio/src/RadioFieldContext.js +1 -1
  182. package/dist/radio/src/RadioGroup.css +66 -66
  183. package/dist/radio/src/RadioGroup.js +3 -3
  184. package/dist/radio/src/RadioGroupContext.js +1 -1
  185. package/dist/radio/src/RadioList.js +1 -1
  186. package/dist/radio/src/RadioListContext.js +1 -1
  187. package/dist/radio/src/index.css +66 -66
  188. package/dist/radio/src/index.js +6 -6
  189. package/dist/switch/src/Switch.css +25 -25
  190. package/dist/switch/src/Switch.js +3 -3
  191. package/dist/switch/src/SwitchContext.js +1 -1
  192. package/dist/switch/src/SwitchField.css +15 -15
  193. package/dist/switch/src/SwitchField.js +3 -3
  194. package/dist/switch/src/SwitchFieldContext.js +1 -1
  195. package/dist/switch/src/index.css +31 -31
  196. package/dist/switch/src/index.js +5 -5
  197. package/dist/tag/src/Tag.css +457 -457
  198. package/dist/tag/src/Tag.js +52 -47
  199. package/dist/tag/src/TagContext.js +1 -1
  200. package/dist/tag/src/TagGroup.css +28 -28
  201. package/dist/tag/src/TagGroup.js +4 -4
  202. package/dist/tag/src/TagGroupContext.js +1 -1
  203. package/dist/tag/src/TagList.js +1 -1
  204. package/dist/tag/src/TagListContext.js +1 -1
  205. package/dist/tag/src/index.css +457 -457
  206. package/dist/tag/src/index.js +52 -47
  207. package/dist/typography/Heading/src/Heading.css +9 -3222
  208. package/dist/typography/Heading/src/Heading.js +2 -100
  209. package/dist/typography/Heading/src/HeadingContext.js +1 -1
  210. package/dist/typography/Heading/src/index.css +9 -3222
  211. package/dist/typography/Heading/src/index.js +2 -100
  212. package/dist/typography/Label/src/Label.css +9 -9
  213. package/dist/typography/Label/src/Label.js +2 -2
  214. package/dist/typography/Label/src/LabelContext.js +1 -1
  215. package/dist/typography/Label/src/index.css +9 -9
  216. package/dist/typography/Label/src/index.js +2 -2
  217. package/dist/typography/OverlineText/src/OverlineText.css +6 -6
  218. package/dist/typography/OverlineText/src/OverlineText.js +2 -2
  219. package/dist/typography/OverlineText/src/OverlineTextContext.js +1 -1
  220. package/dist/typography/OverlineText/src/index.css +6 -6
  221. package/dist/typography/OverlineText/src/index.js +2 -2
  222. package/dist/typography/Text/src/Text.css +9 -9
  223. package/dist/typography/Text/src/Text.js +2 -2
  224. package/dist/typography/Text/src/TextContext.js +1 -1
  225. package/dist/typography/Text/src/index.css +9 -9
  226. package/dist/typography/Text/src/index.js +2 -2
  227. package/dist/utils/src/ClearSlots.js +1 -1
  228. package/dist/utils/src/SlotProvider.js +1 -1
  229. package/dist/utils/src/assertion.js +1 -1
  230. package/dist/utils/src/composeClassnameRenderProps.js +1 -1
  231. package/dist/utils/src/cssModule.js +1 -1
  232. package/dist/utils/src/index.js +1 -1
  233. package/dist/utils/src/isTextOnlyChildren.js +1 -1
  234. package/dist/utils/src/useRenderProps.js +1 -1
  235. package/dist/utils/src/useSlot.js +1 -1
  236. package/package.json +1 -1
  237. package/dist/chunk-BC5A7RHI.js +0 -1260
@@ -0,0 +1,625 @@
1
+ import { PopoverContext } from './chunk-SC6ZK5ON.js';
2
+ import { TagContext } from './chunk-EWMWQ2MC.js';
3
+ import { FooterContext } from './chunk-I67NHYK4.js';
4
+ import { ContentContext } from './chunk-IXB2WK56.js';
5
+ import { HeadingContext } from './chunk-TXZ6BMFR.js';
6
+ import { ButtonContext } from './chunk-WMTWFKKP.js';
7
+ import { ButtonGroupContext } from './chunk-VJQ7M2BK.js';
8
+ import { _ClearButton } from './chunk-HVUX7ZQ3.js';
9
+ import { _Spinner } from './chunk-XVKZ3Q3B.js';
10
+ import { LinkContext } from './chunk-4VVNSXIB.js';
11
+ import { isFunction, isNil } from './chunk-TIPN4VYD.js';
12
+ import { useLocalizedString } from './chunk-YEYNRBMQ.js';
13
+ import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
14
+ import { _HopperProvider } from './chunk-NMKBUGSO.js';
15
+ import { BadgeContext } from './chunk-CQDLZ42T.js';
16
+ import { isTextOnlyChildren } from './chunk-ZWU6DRRZ.js';
17
+ import { IconListContext } from './chunk-DHVVYSLB.js';
18
+ import { _Text } from './chunk-E7Y25WJE.js';
19
+ import { TextContext } from './chunk-X6SER3TZ.js';
20
+ import { ClearContainerSlots } from './chunk-HXI3MEEK.js';
21
+ import { SlotProvider } from './chunk-M36KANKC.js';
22
+ import { cssModule } from './chunk-KVDXQMWI.js';
23
+ import { IconContext } from '@hopper-ui/icons';
24
+ import { useStyledSystem, useResponsiveValue, useColorSchemeContext } from '@hopper-ui/styled-system';
25
+ export * from '@hopper-ui/styled-system';
26
+ import { forwardRef, useReducer, useRef, useEffect } from 'react';
27
+ import { useContextProps, composeRenderProps, Tag as Tag$1, Popover as Popover$1, Dialog } from 'react-aria-components';
28
+ export { Collection } from 'react-aria-components';
29
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
30
+ import clsx from 'clsx';
31
+
32
+ // css-module:./Tag.module.css#css-module
33
+ var Tag_module_default = { "hop-Tag": "Tag-module__hop-Tag___44f2t", "hop-Tag--md": "Tag-module__hop-Tag--md___a-8Gl", "hop-Tag__icon": "Tag-module__hop-Tag__icon___Flh-O", "hop-Tag__icon-list": "Tag-module__hop-Tag__icon-list___DwhHI", "hop-Tag__badge": "Tag-module__hop-Tag__badge___T-TB5", "hop-Tag__remove-btn": "Tag-module__hop-Tag__remove-btn___p33BD", "hop-Tag__Spinner": "Tag-module__hop-Tag__Spinner___qNetT", "hop-Tag--lg": "Tag-module__hop-Tag--lg___7bKF1", "hop-Tag__text": "Tag-module__hop-Tag__text___5AXmt", "hop-Badge--secondary": "Tag-module__hop-Badge--secondary___t5ajm" };
34
+ var GlobalTagCssSelector = "hop-Tag";
35
+ var TagToTextSizeAdapter = {
36
+ md: "xs",
37
+ lg: "sm"
38
+ };
39
+ function Tag(props, ref) {
40
+ var _a;
41
+ [props, ref] = useContextProps(props, ref, TagContext);
42
+ const { stylingProps, ...ownProps } = useStyledSystem(props);
43
+ const {
44
+ className,
45
+ children: childrenProp,
46
+ isInvalid,
47
+ isLoading,
48
+ size: sizeProp = "md",
49
+ style: styleProp,
50
+ textValue: textValueProp,
51
+ ...otherProps
52
+ } = ownProps;
53
+ const stringFormatter = useLocalizedString();
54
+ const size = (_a = useResponsiveValue(sizeProp)) != null ? _a : "md";
55
+ const textValue = textValueProp != null ? textValueProp : typeof childrenProp === "string" ? childrenProp : void 0;
56
+ const classNames = composeClassnameRenderProps(
57
+ className,
58
+ GlobalTagCssSelector,
59
+ cssModule(
60
+ Tag_module_default,
61
+ "hop-Tag",
62
+ size
63
+ ),
64
+ stylingProps.className
65
+ );
66
+ const style = composeRenderProps(styleProp, (prev) => {
67
+ return {
68
+ ...stylingProps.style,
69
+ ...prev
70
+ };
71
+ });
72
+ const children = composeRenderProps(childrenProp, (prev) => {
73
+ if (prev && isTextOnlyChildren(prev)) {
74
+ return /* @__PURE__ */ jsx(_Text, { children: prev });
75
+ }
76
+ return prev;
77
+ });
78
+ return /* @__PURE__ */ jsx(
79
+ Tag$1,
80
+ {
81
+ ...otherProps,
82
+ ref,
83
+ className: classNames,
84
+ style,
85
+ textValue,
86
+ "data-invalid": isInvalid || void 0,
87
+ "data-loading": isLoading || void 0,
88
+ children: (tagProps) => {
89
+ const { allowsRemoving, isDisabled } = tagProps;
90
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
91
+ /* @__PURE__ */ jsx(ClearContainerSlots, { children: /* @__PURE__ */ jsx(
92
+ SlotProvider,
93
+ {
94
+ values: [
95
+ [TextContext, {
96
+ className: Tag_module_default["hop-Tag__text"],
97
+ size: TagToTextSizeAdapter[size]
98
+ }],
99
+ [IconListContext, {
100
+ className: Tag_module_default["hop-Tag__icon-list"],
101
+ size: "sm"
102
+ }],
103
+ [IconContext, {
104
+ className: Tag_module_default["hop-Tag__icon"],
105
+ size: "sm"
106
+ }],
107
+ [BadgeContext, {
108
+ className: Tag_module_default["hop-Tag__badge"],
109
+ isDisabled
110
+ }]
111
+ ],
112
+ children: children(tagProps)
113
+ }
114
+ ) }),
115
+ allowsRemoving && !isLoading && /* @__PURE__ */ jsx(
116
+ _ClearButton,
117
+ {
118
+ slot: "remove",
119
+ isDisabled,
120
+ className: Tag_module_default["hop-Tag__remove-btn"],
121
+ "aria-label": stringFormatter.format("Tag.removeAriaLabel"),
122
+ size
123
+ }
124
+ ),
125
+ isLoading && /* @__PURE__ */ jsx(
126
+ _Spinner,
127
+ {
128
+ "aria-label": stringFormatter.format("Tag.spinnerAriaLabel"),
129
+ size: "sm",
130
+ className: Tag_module_default["hop-Tag__Spinner"]
131
+ }
132
+ )
133
+ ] });
134
+ }
135
+ }
136
+ );
137
+ }
138
+ var _Tag = forwardRef(Tag);
139
+ _Tag.displayName = "Tag";
140
+ function $0d86e9c8f07f9a7b$export$79c0c687a5963b0a(opts, dispatch) {
141
+ let { cursor, getKey } = opts;
142
+ return {
143
+ setSelectedKeys(selectedKeys) {
144
+ dispatch((state) => ({
145
+ ...state,
146
+ selectedKeys
147
+ }));
148
+ },
149
+ setFilterText(filterText) {
150
+ dispatch((state) => ({
151
+ ...state,
152
+ filterText
153
+ }));
154
+ },
155
+ insert(index, ...values) {
156
+ dispatch((state) => $0d86e9c8f07f9a7b$var$insert(state, index, ...values));
157
+ },
158
+ insertBefore(key, ...values) {
159
+ dispatch((state) => {
160
+ let index = state.items.findIndex((item) => getKey(item) === key);
161
+ if (index === -1) {
162
+ if (state.items.length === 0) index = 0;
163
+ else return state;
164
+ }
165
+ return $0d86e9c8f07f9a7b$var$insert(state, index, ...values);
166
+ });
167
+ },
168
+ insertAfter(key, ...values) {
169
+ dispatch((state) => {
170
+ let index = state.items.findIndex((item) => getKey(item) === key);
171
+ if (index === -1) {
172
+ if (state.items.length === 0) index = 0;
173
+ else return state;
174
+ }
175
+ return $0d86e9c8f07f9a7b$var$insert(state, index + 1, ...values);
176
+ });
177
+ },
178
+ prepend(...values) {
179
+ dispatch((state) => $0d86e9c8f07f9a7b$var$insert(state, 0, ...values));
180
+ },
181
+ append(...values) {
182
+ dispatch((state) => $0d86e9c8f07f9a7b$var$insert(state, state.items.length, ...values));
183
+ },
184
+ remove(...keys) {
185
+ dispatch((state) => {
186
+ let keySet = new Set(keys);
187
+ let items = state.items.filter((item) => !keySet.has(getKey(item)));
188
+ let selection = "all";
189
+ if (state.selectedKeys !== "all") {
190
+ selection = new Set(state.selectedKeys);
191
+ for (let key of keys) selection.delete(key);
192
+ }
193
+ if (cursor == null && items.length === 0) selection = /* @__PURE__ */ new Set();
194
+ return {
195
+ ...state,
196
+ items,
197
+ selectedKeys: selection
198
+ };
199
+ });
200
+ },
201
+ removeSelectedItems() {
202
+ dispatch((state) => {
203
+ if (state.selectedKeys === "all") return {
204
+ ...state,
205
+ items: [],
206
+ selectedKeys: /* @__PURE__ */ new Set()
207
+ };
208
+ let selectedKeys = state.selectedKeys;
209
+ let items = state.items.filter((item) => !selectedKeys.has(getKey(item)));
210
+ return {
211
+ ...state,
212
+ items,
213
+ selectedKeys: /* @__PURE__ */ new Set()
214
+ };
215
+ });
216
+ },
217
+ move(key, toIndex) {
218
+ dispatch((state) => {
219
+ let index = state.items.findIndex((item2) => getKey(item2) === key);
220
+ if (index === -1) return state;
221
+ let copy = state.items.slice();
222
+ let [item] = copy.splice(index, 1);
223
+ copy.splice(toIndex, 0, item);
224
+ return {
225
+ ...state,
226
+ items: copy
227
+ };
228
+ });
229
+ },
230
+ moveBefore(key, keys) {
231
+ dispatch((state) => {
232
+ let toIndex = state.items.findIndex((item) => getKey(item) === key);
233
+ if (toIndex === -1) return state;
234
+ let keyArray = Array.isArray(keys) ? keys : [
235
+ ...keys
236
+ ];
237
+ let indices = keyArray.map((key2) => state.items.findIndex((item) => getKey(item) === key2)).sort((a, b) => a - b);
238
+ return $0d86e9c8f07f9a7b$var$move(state, indices, toIndex);
239
+ });
240
+ },
241
+ moveAfter(key, keys) {
242
+ dispatch((state) => {
243
+ let toIndex = state.items.findIndex((item) => getKey(item) === key);
244
+ if (toIndex === -1) return state;
245
+ let keyArray = Array.isArray(keys) ? keys : [
246
+ ...keys
247
+ ];
248
+ let indices = keyArray.map((key2) => state.items.findIndex((item) => getKey(item) === key2)).sort((a, b) => a - b);
249
+ return $0d86e9c8f07f9a7b$var$move(state, indices, toIndex + 1);
250
+ });
251
+ },
252
+ update(key, newValue) {
253
+ dispatch((state) => {
254
+ let index = state.items.findIndex((item) => getKey(item) === key);
255
+ if (index === -1) return state;
256
+ return {
257
+ ...state,
258
+ items: [
259
+ ...state.items.slice(0, index),
260
+ newValue,
261
+ ...state.items.slice(index + 1)
262
+ ]
263
+ };
264
+ });
265
+ }
266
+ };
267
+ }
268
+ function $0d86e9c8f07f9a7b$var$insert(state, index, ...values) {
269
+ return {
270
+ ...state,
271
+ items: [
272
+ ...state.items.slice(0, index),
273
+ ...values,
274
+ ...state.items.slice(index)
275
+ ]
276
+ };
277
+ }
278
+ function $0d86e9c8f07f9a7b$var$move(state, indices, toIndex) {
279
+ toIndex -= indices.filter((index) => index < toIndex).length;
280
+ let moves = indices.map((from) => ({
281
+ from,
282
+ to: toIndex++
283
+ }));
284
+ for (let i = 0; i < moves.length; i++) {
285
+ let a = moves[i].from;
286
+ for (let j = i; j < moves.length; j++) {
287
+ let b = moves[j].from;
288
+ if (b > a) moves[j].from--;
289
+ }
290
+ }
291
+ for (let i = 0; i < moves.length; i++) {
292
+ let a = moves[i];
293
+ for (let j = moves.length - 1; j > i; j--) {
294
+ let b = moves[j];
295
+ if (b.from < a.to) a.to++;
296
+ else b.from++;
297
+ }
298
+ }
299
+ let copy = state.items.slice();
300
+ for (let move of moves) {
301
+ let [item] = copy.splice(move.from, 1);
302
+ copy.splice(move.to, 0, item);
303
+ }
304
+ return {
305
+ ...state,
306
+ items: copy
307
+ };
308
+ }
309
+ function $f86e6c1ec7da6ebb$var$reducer(data, action) {
310
+ let selectedKeys;
311
+ switch (data.state) {
312
+ case "idle":
313
+ case "error":
314
+ switch (action.type) {
315
+ case "loading":
316
+ case "loadingMore":
317
+ case "sorting":
318
+ case "filtering":
319
+ var _action_filterText, _action_sortDescriptor;
320
+ return {
321
+ ...data,
322
+ filterText: (_action_filterText = action.filterText) !== null && _action_filterText !== void 0 ? _action_filterText : data.filterText,
323
+ state: action.type,
324
+ // Reset items to an empty list if loading, but not when sorting.
325
+ items: action.type === "loading" ? [] : data.items,
326
+ sortDescriptor: (_action_sortDescriptor = action.sortDescriptor) !== null && _action_sortDescriptor !== void 0 ? _action_sortDescriptor : data.sortDescriptor,
327
+ abortController: action.abortController
328
+ };
329
+ case "update":
330
+ return {
331
+ ...data,
332
+ ...action.updater(data)
333
+ };
334
+ case "success":
335
+ case "error":
336
+ return data;
337
+ default:
338
+ throw new Error(`Invalid action "${action.type}" in state "${data.state}"`);
339
+ }
340
+ case "loading":
341
+ case "sorting":
342
+ case "filtering":
343
+ switch (action.type) {
344
+ case "success":
345
+ if (action.abortController !== data.abortController) return data;
346
+ var _action_selectedKeys;
347
+ selectedKeys = (_action_selectedKeys = action.selectedKeys) !== null && _action_selectedKeys !== void 0 ? _action_selectedKeys : data.selectedKeys;
348
+ var _action_filterText1, _action_sortDescriptor1;
349
+ return {
350
+ ...data,
351
+ filterText: (_action_filterText1 = action.filterText) !== null && _action_filterText1 !== void 0 ? _action_filterText1 : data.filterText,
352
+ state: "idle",
353
+ items: [
354
+ ...action.items
355
+ ],
356
+ selectedKeys: selectedKeys === "all" ? "all" : new Set(selectedKeys),
357
+ sortDescriptor: (_action_sortDescriptor1 = action.sortDescriptor) !== null && _action_sortDescriptor1 !== void 0 ? _action_sortDescriptor1 : data.sortDescriptor,
358
+ abortController: null,
359
+ cursor: action.cursor
360
+ };
361
+ case "error":
362
+ if (action.abortController !== data.abortController) return data;
363
+ return {
364
+ ...data,
365
+ state: "error",
366
+ error: action.error,
367
+ abortController: null
368
+ };
369
+ case "loading":
370
+ case "loadingMore":
371
+ case "sorting":
372
+ case "filtering":
373
+ data.abortController.abort();
374
+ var _action_filterText2;
375
+ return {
376
+ ...data,
377
+ filterText: (_action_filterText2 = action.filterText) !== null && _action_filterText2 !== void 0 ? _action_filterText2 : data.filterText,
378
+ state: action.type,
379
+ // Reset items to an empty list if loading, but not when sorting.
380
+ items: action.type === "loading" ? [] : data.items,
381
+ abortController: action.abortController
382
+ };
383
+ case "update":
384
+ return {
385
+ ...data,
386
+ ...action.updater(data)
387
+ };
388
+ default:
389
+ throw new Error(`Invalid action "${action.type}" in state "${data.state}"`);
390
+ }
391
+ case "loadingMore":
392
+ switch (action.type) {
393
+ case "success":
394
+ var _action_selectedKeys1;
395
+ selectedKeys = data.selectedKeys === "all" || action.selectedKeys === "all" ? "all" : /* @__PURE__ */ new Set([
396
+ ...data.selectedKeys,
397
+ ...(_action_selectedKeys1 = action.selectedKeys) !== null && _action_selectedKeys1 !== void 0 ? _action_selectedKeys1 : []
398
+ ]);
399
+ var _action_sortDescriptor2;
400
+ return {
401
+ ...data,
402
+ state: "idle",
403
+ items: [
404
+ ...data.items,
405
+ ...action.items
406
+ ],
407
+ selectedKeys,
408
+ sortDescriptor: (_action_sortDescriptor2 = action.sortDescriptor) !== null && _action_sortDescriptor2 !== void 0 ? _action_sortDescriptor2 : data.sortDescriptor,
409
+ abortController: null,
410
+ cursor: action.cursor
411
+ };
412
+ case "error":
413
+ if (action.abortController !== data.abortController) return data;
414
+ return {
415
+ ...data,
416
+ state: "error",
417
+ error: action.error
418
+ };
419
+ case "loading":
420
+ case "sorting":
421
+ case "filtering":
422
+ data.abortController.abort();
423
+ var _action_filterText3;
424
+ return {
425
+ ...data,
426
+ filterText: (_action_filterText3 = action.filterText) !== null && _action_filterText3 !== void 0 ? _action_filterText3 : data.filterText,
427
+ state: action.type,
428
+ // Reset items to an empty list if loading, but not when sorting.
429
+ items: action.type === "loading" ? [] : data.items,
430
+ abortController: action.abortController
431
+ };
432
+ case "loadingMore":
433
+ action.abortController.abort();
434
+ return data;
435
+ case "update":
436
+ return {
437
+ ...data,
438
+ ...action.updater(data)
439
+ };
440
+ default:
441
+ throw new Error(`Invalid action "${action.type}" in state "${data.state}"`);
442
+ }
443
+ default:
444
+ throw new Error(`Invalid state "${data.state}"`);
445
+ }
446
+ }
447
+ function $f86e6c1ec7da6ebb$export$bc3384a35de93d66(options) {
448
+ const { load, sort, initialSelectedKeys, initialSortDescriptor, getKey = (item) => item.id || item.key, initialFilterText = "" } = options;
449
+ let [data, dispatch] = (useReducer)($f86e6c1ec7da6ebb$var$reducer, {
450
+ state: "idle",
451
+ error: null,
452
+ items: [],
453
+ selectedKeys: initialSelectedKeys === "all" ? "all" : new Set(initialSelectedKeys),
454
+ sortDescriptor: initialSortDescriptor,
455
+ filterText: initialFilterText
456
+ });
457
+ const dispatchFetch = async (action, fn) => {
458
+ let abortController = new AbortController();
459
+ try {
460
+ dispatch({
461
+ ...action,
462
+ abortController
463
+ });
464
+ var _action_filterText;
465
+ let previousFilterText = (_action_filterText = action.filterText) !== null && _action_filterText !== void 0 ? _action_filterText : data.filterText;
466
+ var _action_sortDescriptor;
467
+ let response = await fn({
468
+ items: data.items.slice(),
469
+ selectedKeys: data.selectedKeys,
470
+ sortDescriptor: (_action_sortDescriptor = action.sortDescriptor) !== null && _action_sortDescriptor !== void 0 ? _action_sortDescriptor : data.sortDescriptor,
471
+ signal: abortController.signal,
472
+ cursor: action.type === "loadingMore" ? data.cursor : null,
473
+ filterText: previousFilterText
474
+ });
475
+ var _response_filterText;
476
+ let filterText = (_response_filterText = response.filterText) !== null && _response_filterText !== void 0 ? _response_filterText : previousFilterText;
477
+ dispatch({
478
+ type: "success",
479
+ ...response,
480
+ abortController
481
+ });
482
+ if (filterText && filterText !== previousFilterText && !abortController.signal.aborted) dispatchFetch({
483
+ type: "filtering",
484
+ filterText
485
+ }, load);
486
+ } catch (e) {
487
+ dispatch({
488
+ type: "error",
489
+ error: e,
490
+ abortController
491
+ });
492
+ }
493
+ };
494
+ let didDispatchInitialFetch = (useRef)(false);
495
+ (useEffect)(() => {
496
+ if (!didDispatchInitialFetch.current) {
497
+ dispatchFetch({
498
+ type: "loading"
499
+ }, load);
500
+ didDispatchInitialFetch.current = true;
501
+ }
502
+ }, []);
503
+ return {
504
+ items: data.items,
505
+ selectedKeys: data.selectedKeys,
506
+ sortDescriptor: data.sortDescriptor,
507
+ isLoading: data.state === "loading" || data.state === "loadingMore" || data.state === "sorting" || data.state === "filtering",
508
+ loadingState: data.state,
509
+ error: data.error,
510
+ filterText: data.filterText,
511
+ getItem(key) {
512
+ return data.items.find((item) => getKey(item) === key);
513
+ },
514
+ reload() {
515
+ dispatchFetch({
516
+ type: "loading"
517
+ }, load);
518
+ },
519
+ loadMore() {
520
+ if (data.state === "loadingMore" || data.state === "filtering" || data.cursor == null) return;
521
+ dispatchFetch({
522
+ type: "loadingMore"
523
+ }, load);
524
+ },
525
+ sort(sortDescriptor) {
526
+ dispatchFetch({
527
+ type: "sorting",
528
+ sortDescriptor
529
+ }, sort || load);
530
+ },
531
+ ...($0d86e9c8f07f9a7b$export$79c0c687a5963b0a)({
532
+ ...options,
533
+ getKey,
534
+ cursor: data.cursor
535
+ }, (fn) => {
536
+ dispatch({
537
+ type: "update",
538
+ updater: fn
539
+ });
540
+ }),
541
+ setFilterText(filterText) {
542
+ dispatchFetch({
543
+ type: "filtering",
544
+ filterText
545
+ }, load);
546
+ }
547
+ };
548
+ }
549
+
550
+ // css-module:./Popover.module.css#css-module
551
+ var Popover_module_default = { "hop-Popover": "Popover-module__hop-Popover___Z-GAs", "hop-Popover__dialog": "Popover-module__hop-Popover__dialog___pY0tm", "hop-Popover__title": "Popover-module__hop-Popover__title___S6A5Z", "hop-Popover__actions": "Popover-module__hop-Popover__actions___95sTO", "hop-Popover__action": "Popover-module__hop-Popover__action___nfocQ", "hop-Popover__content": "Popover-module__hop-Popover__content___GTE4M", "hop-Popover__footer": "Popover-module__hop-Popover__footer___VHYUA" };
552
+ var GlobalPopoverCssSelector = "hop-Popover";
553
+ function Popover(props, ref) {
554
+ [props, ref] = useContextProps(props, ref, PopoverContext);
555
+ const { stylingProps, ...ownProps } = useStyledSystem(props);
556
+ const {
557
+ children,
558
+ className,
559
+ offset = 4,
560
+ boundaryOffset,
561
+ ...otherProps
562
+ } = ownProps;
563
+ const { colorScheme } = useColorSchemeContext();
564
+ const popoverClassNames = composeClassnameRenderProps(
565
+ className,
566
+ GlobalPopoverCssSelector,
567
+ cssModule(
568
+ Popover_module_default,
569
+ "hop-Popover"
570
+ )
571
+ );
572
+ return /* @__PURE__ */ jsx(
573
+ Popover$1,
574
+ {
575
+ ...otherProps,
576
+ offset,
577
+ ref,
578
+ className: popoverClassNames,
579
+ arrowBoundaryOffset: boundaryOffset,
580
+ children: (state) => /* @__PURE__ */ jsx(_HopperProvider, { colorScheme, children: /* @__PURE__ */ jsx(
581
+ Dialog,
582
+ {
583
+ className: clsx(stylingProps.className, Popover_module_default["hop-Popover__dialog"]),
584
+ style: stylingProps.style,
585
+ children: /* @__PURE__ */ jsx(
586
+ SlotProvider,
587
+ {
588
+ values: [
589
+ [HeadingContext, {
590
+ className: Popover_module_default["hop-Popover__title"],
591
+ size: "xs"
592
+ }],
593
+ [ButtonContext, {
594
+ size: "sm",
595
+ className: Popover_module_default["hop-Popover__action"]
596
+ }],
597
+ [ButtonGroupContext, {
598
+ size: "sm",
599
+ align: "end",
600
+ className: Popover_module_default["hop-Popover__actions"]
601
+ }],
602
+ [ContentContext, {
603
+ className: Popover_module_default["hop-Popover__content"]
604
+ }],
605
+ [FooterContext, {
606
+ className: Popover_module_default["hop-Popover__footer"]
607
+ }],
608
+ [LinkContext, {
609
+ size: "sm",
610
+ variant: "primary",
611
+ isQuiet: true
612
+ }]
613
+ ],
614
+ children: isFunction(children) && !isNil(children) ? children(state) : children
615
+ }
616
+ )
617
+ }
618
+ ) })
619
+ }
620
+ );
621
+ }
622
+ var _Popover = forwardRef(Popover);
623
+ _Popover.displayName = "Popover";
624
+
625
+ export { $f86e6c1ec7da6ebb$export$bc3384a35de93d66, GlobalPopoverCssSelector, GlobalTagCssSelector, _Popover, _Tag };
@@ -4,8 +4,8 @@ import { RadioListContext } from './chunk-A7TZHALP.js';
4
4
  import { RadioContext } from './chunk-FU5CCPLP.js';
5
5
  import { LabelContext } from './chunk-QCA3ZR56.js';
6
6
  import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
7
- import { ErrorMessageContext } from './chunk-FAE27DLF.js';
8
7
  import { HelperMessageContext } from './chunk-HZKFQ33E.js';
8
+ import { ErrorMessageContext } from './chunk-FAE27DLF.js';
9
9
  import { SlotProvider } from './chunk-M36KANKC.js';
10
10
  import { cssModule } from './chunk-KVDXQMWI.js';
11
11
  import { useStyledSystem, useResponsiveValue } from '@hopper-ui/styled-system';
@@ -14,7 +14,7 @@ import { useContextProps, composeRenderProps, RadioGroup as RadioGroup$1 } from
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___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" };
17
+ var RadioGroup_module_default = { "hop-RadioGroup": "RadioGroup-module__hop-RadioGroup___0LfBO", "hop-RadioGroup--bordered": "RadioGroup-module__hop-RadioGroup--bordered___v6dmv", "hop-RadioGroup--sm": "RadioGroup-module__hop-RadioGroup--sm___BGmAJ", "hop-RadioGroup--md": "RadioGroup-module__hop-RadioGroup--md___DTbSi", "hop-RadioGroup__label": "RadioGroup-module__hop-RadioGroup__label___C8kFI", "hop-RadioGroup__list": "RadioGroup-module__hop-RadioGroup__list___w-EHk", "hop-RadioGroup__radio": "RadioGroup-module__hop-RadioGroup__radio___aY5Cj", "hop-RadioGroup__error-message": "RadioGroup-module__hop-RadioGroup__error-message___2-GLQ", "hop-RadioGroup__helper-message": "RadioGroup-module__hop-RadioGroup__helper-message___MfsKX" };
18
18
  var GlobalRadioGroupCssSelector = "hop-RadioGroup";
19
19
  function RadioGroup(props, ref) {
20
20
  var _a, _b;
@@ -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___-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" };
12
+ var EmbeddedButton_module_default = { "hop-EmbeddedButton": "EmbeddedButton-module__hop-EmbeddedButton___15Hny", "hop-EmbeddedButton--md": "EmbeddedButton-module__hop-EmbeddedButton--md___wjXPk", "hop-EmbeddedButton--lg": "EmbeddedButton-module__hop-EmbeddedButton--lg___-W1aK", "hop-EmbeddedButton__icon": "EmbeddedButton-module__hop-EmbeddedButton__icon___pSB2G" };
13
13
  var GlobalEmbeddedButtonCssSelector = "hop-EmbeddedButton";
14
14
  function EmbeddedButton(props, ref) {
15
15
  var _a;
@@ -1,6 +1,6 @@
1
1
  import { useRenderProps } from './chunk-NH3IVMXB.js';
2
2
  import { ErrorMessageContext } from './chunk-FAE27DLF.js';
3
- import { _Text } from './chunk-RG4JKE4N.js';
3
+ import { _Text } from './chunk-E7Y25WJE.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___SA3fD", "hop-ErrorMessage__icon": "ErrorMessage-module__hop-ErrorMessage__icon___cB2Bk" };
13
+ var ErrorMessage_module_default = { "hop-ErrorMessage": "ErrorMessage-module__hop-ErrorMessage___GySei", "hop-ErrorMessage__icon": "ErrorMessage-module__hop-ErrorMessage__icon___pc97t" };
14
14
  var GlobalErrorMessageCssSelector = "hop-ErrorMessage";
15
15
  function ErrorMessage(props, ref) {
16
16
  const validation = useContext(FieldErrorContext);