@hopper-ui/components 0.1.0 → 1.0.0

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 (211) hide show
  1. package/CHANGELOG.md +117 -0
  2. package/dist/HopperProvider/src/HopperProvider.d.ts +33 -1
  3. package/dist/HopperProvider/src/HopperProvider.js +2 -1
  4. package/dist/HopperProvider/src/index.d.ts +1 -0
  5. package/dist/HopperProvider/src/index.js +2 -1
  6. package/dist/IconList/src/IconList.css +6 -6
  7. package/dist/IconList/src/IconList.js +2 -1
  8. package/dist/IconList/src/IconListContext.js +1 -0
  9. package/dist/IconList/src/index.css +6 -6
  10. package/dist/IconList/src/index.js +2 -1
  11. package/dist/Label/src/Label.css +70 -70
  12. package/dist/Label/src/Label.js +3 -2
  13. package/dist/Label/src/LabelContext.js +1 -0
  14. package/dist/Label/src/index.css +70 -70
  15. package/dist/Label/src/index.js +3 -2
  16. package/dist/Link/src/Link.css +165 -0
  17. package/dist/Link/src/Link.d.ts +33 -0
  18. package/dist/Link/src/Link.js +11 -0
  19. package/dist/Link/src/LinkContext.d.ts +8 -0
  20. package/dist/Link/src/LinkContext.js +2 -0
  21. package/dist/Link/src/index.css +165 -0
  22. package/dist/Link/src/index.d.ts +5 -0
  23. package/dist/Link/src/index.js +11 -0
  24. package/dist/Spinner/src/Spinner.css +124 -124
  25. package/dist/Spinner/src/Spinner.d.ts +1 -0
  26. package/dist/Spinner/src/Spinner.js +5 -4
  27. package/dist/Spinner/src/SpinnerContext.js +1 -0
  28. package/dist/Spinner/src/index.css +124 -124
  29. package/dist/Spinner/src/index.js +5 -4
  30. package/dist/Text/src/Text.css +67 -67
  31. package/dist/Text/src/Text.d.ts +2 -3
  32. package/dist/Text/src/Text.js +5 -2
  33. package/dist/Text/src/TextContext.js +1 -0
  34. package/dist/Text/src/index.css +67 -67
  35. package/dist/Text/src/index.d.ts +1 -1
  36. package/dist/Text/src/index.js +5 -2
  37. package/dist/buttons/src/Button.css +634 -435
  38. package/dist/buttons/src/Button.d.ts +15 -10
  39. package/dist/buttons/src/Button.js +13 -9
  40. package/dist/buttons/src/ButtonContext.d.ts +6 -2
  41. package/dist/buttons/src/ButtonContext.js +1 -0
  42. package/dist/buttons/src/ButtonGroup.css +38 -0
  43. package/dist/buttons/src/ButtonGroup.d.ts +40 -0
  44. package/dist/buttons/src/ButtonGroup.js +83 -0
  45. package/dist/buttons/src/ButtonGroupContext.d.ts +9 -0
  46. package/dist/buttons/src/ButtonGroupContext.js +2 -0
  47. package/dist/buttons/src/index.css +634 -435
  48. package/dist/buttons/src/index.d.ts +2 -1
  49. package/dist/buttons/src/index.js +13 -9
  50. package/dist/checkbox/src/Checkbox.css +292 -0
  51. package/dist/checkbox/src/Checkbox.d.ts +20 -0
  52. package/dist/checkbox/src/Checkbox.js +11 -0
  53. package/dist/checkbox/src/CheckboxContext.d.ts +8 -0
  54. package/dist/checkbox/src/CheckboxContext.js +2 -0
  55. package/dist/checkbox/src/CheckboxField.css +119 -0
  56. package/dist/checkbox/src/CheckboxField.d.ts +26 -0
  57. package/dist/checkbox/src/CheckboxField.js +7 -0
  58. package/dist/checkbox/src/CheckboxFieldContext.d.ts +10 -0
  59. package/dist/checkbox/src/CheckboxFieldContext.js +2 -0
  60. package/dist/checkbox/src/CheckboxGroup.css +568 -0
  61. package/dist/checkbox/src/CheckboxGroup.d.ts +30 -0
  62. package/dist/checkbox/src/CheckboxGroup.js +12 -0
  63. package/dist/checkbox/src/CheckboxGroupContext.d.ts +8 -0
  64. package/dist/checkbox/src/CheckboxGroupContext.js +2 -0
  65. package/dist/checkbox/src/CheckboxList.d.ts +17 -0
  66. package/dist/checkbox/src/CheckboxList.js +3 -0
  67. package/dist/checkbox/src/CheckboxListContext.d.ts +10 -0
  68. package/dist/checkbox/src/CheckboxListContext.js +2 -0
  69. package/dist/checkbox/src/index.css +568 -0
  70. package/dist/checkbox/src/index.d.ts +13 -0
  71. package/dist/checkbox/src/index.js +20 -0
  72. package/dist/chip/src/Chip.css +261 -0
  73. package/dist/chip/src/Chip.d.ts +27 -0
  74. package/dist/chip/src/Chip.js +10 -0
  75. package/dist/chip/src/ChipContext.d.ts +10 -0
  76. package/dist/chip/src/ChipContext.js +2 -0
  77. package/dist/chip/src/index.css +261 -0
  78. package/dist/chip/src/index.d.ts +7 -0
  79. package/dist/chip/src/index.js +10 -0
  80. package/dist/chunk-2EAZPH3M.js +7 -0
  81. package/dist/chunk-3LRBUQC2.js +43 -0
  82. package/dist/chunk-4AARNXWE.js +101 -0
  83. package/dist/chunk-4VVNSXIB.js +7 -0
  84. package/dist/chunk-5KJ5IKUE.js +69 -0
  85. package/dist/chunk-5MBJWRZD.js +7 -0
  86. package/dist/{chunk-SEU4CGZD.js → chunk-65JPI4FL.js} +1 -1
  87. package/dist/chunk-7ELZ57E5.js +93 -0
  88. package/dist/chunk-A7TZHALP.js +7 -0
  89. package/dist/chunk-ACVMW6YD.js +7 -0
  90. package/dist/{chunk-YLDA2M2E.js → chunk-ANVMQBBG.js} +2 -1
  91. package/dist/chunk-B7WS4DBA.js +83 -0
  92. package/dist/chunk-BPM4ETTB.js +35 -0
  93. package/dist/{chunk-QIOYM2XJ.js → chunk-DFUQTSEV.js} +13 -13
  94. package/dist/chunk-DGLAGYBD.js +7 -0
  95. package/dist/chunk-ESVVLTEN.js +7 -0
  96. package/dist/chunk-FU5CCPLP.js +7 -0
  97. package/dist/chunk-GXKSX5N5.js +104 -0
  98. package/dist/chunk-H5YTU3U7.js +20 -0
  99. package/dist/chunk-H7VJS4MX.js +7 -0
  100. package/dist/chunk-HVRSS5RT.js +186 -0
  101. package/dist/chunk-HXI3MEEK.js +27 -0
  102. package/dist/chunk-I7AMDVGG.js +124 -0
  103. package/dist/{chunk-XCKF6EU7.js → chunk-IYITZANI.js} +9 -9
  104. package/dist/chunk-JHY3TXL4.js +101 -0
  105. package/dist/{chunk-6BEVZRUL.js → chunk-KVDXQMWI.js} +1 -1
  106. package/dist/chunk-M6UHXS6K.js +58 -0
  107. package/dist/chunk-MD6IFXLG.js +57 -0
  108. package/dist/chunk-ME3RBGOT.js +91 -0
  109. package/dist/chunk-N7YDPVZL.js +7 -0
  110. package/dist/chunk-NH3IVMXB.js +43 -0
  111. package/dist/chunk-NKHMUPAP.js +43 -0
  112. package/dist/chunk-OHPGEHL3.js +83 -0
  113. package/dist/chunk-VIHBOZVN.js +92 -0
  114. package/dist/chunk-VJQ7M2BK.js +7 -0
  115. package/dist/chunk-WDUQUPTE.js +7 -0
  116. package/dist/chunk-WTKIUAHI.js +7 -0
  117. package/dist/chunk-YHBJAXUY.js +7 -0
  118. package/dist/chunk-YSQDPG26.js +27 -0
  119. package/dist/chunk-YWUIJ6ZQ.js +83 -0
  120. package/dist/chunk-ZGNK4GWA.js +7 -0
  121. package/dist/{chunk-XQ3GUEBN.js → chunk-ZQEB3Y3X.js} +8 -9
  122. package/dist/{chunk-7QUHQYCR.js → chunk-ZWU6DRRZ.js} +1 -1
  123. package/dist/errorMessage/src/ErrorMessage.css +102 -0
  124. package/dist/errorMessage/src/ErrorMessage.d.ts +20 -0
  125. package/dist/errorMessage/src/ErrorMessage.js +9 -0
  126. package/dist/errorMessage/src/ErrorMessageContext.d.ts +9 -0
  127. package/dist/errorMessage/src/ErrorMessageContext.js +2 -0
  128. package/dist/errorMessage/src/index.css +102 -0
  129. package/dist/errorMessage/src/index.d.ts +6 -0
  130. package/dist/errorMessage/src/index.js +9 -0
  131. package/dist/helperMessage/src/HelperMessage.css +94 -0
  132. package/dist/helperMessage/src/HelperMessage.d.ts +20 -0
  133. package/dist/helperMessage/src/HelperMessage.js +8 -0
  134. package/dist/helperMessage/src/HelperMessageContext.d.ts +9 -0
  135. package/dist/helperMessage/src/HelperMessageContext.js +2 -0
  136. package/dist/helperMessage/src/index.css +94 -0
  137. package/dist/helperMessage/src/index.d.ts +6 -0
  138. package/dist/helperMessage/src/index.js +8 -0
  139. package/dist/{intl → i18n}/src/index.d.ts +1 -0
  140. package/dist/i18n/src/index.js +2 -0
  141. package/dist/i18n/src/useLocalizedString.d.ts +9 -0
  142. package/dist/i18n/src/useLocalizedString.js +2 -0
  143. package/dist/layout/src/Flex.js +1 -0
  144. package/dist/layout/src/Grid.js +1 -1
  145. package/dist/layout/src/Inline.js +1 -0
  146. package/dist/layout/src/Stack.js +1 -0
  147. package/dist/radio/src/Radio.css +293 -0
  148. package/dist/radio/src/Radio.d.ts +20 -0
  149. package/dist/radio/src/Radio.js +11 -0
  150. package/dist/radio/src/RadioContext.d.ts +8 -0
  151. package/dist/radio/src/RadioContext.js +2 -0
  152. package/dist/radio/src/RadioField.css +119 -0
  153. package/dist/radio/src/RadioField.d.ts +26 -0
  154. package/dist/radio/src/RadioField.js +7 -0
  155. package/dist/radio/src/RadioFieldContext.d.ts +10 -0
  156. package/dist/radio/src/RadioFieldContext.js +2 -0
  157. package/dist/radio/src/RadioGroup.css +570 -0
  158. package/dist/radio/src/RadioGroup.d.ts +30 -0
  159. package/dist/radio/src/RadioGroup.js +12 -0
  160. package/dist/radio/src/RadioGroupContext.d.ts +8 -0
  161. package/dist/radio/src/RadioGroupContext.js +2 -0
  162. package/dist/radio/src/RadioList.d.ts +17 -0
  163. package/dist/radio/src/RadioList.js +3 -0
  164. package/dist/radio/src/RadioListContext.d.ts +10 -0
  165. package/dist/radio/src/RadioListContext.js +2 -0
  166. package/dist/radio/src/index.css +570 -0
  167. package/dist/radio/src/index.d.ts +13 -0
  168. package/dist/radio/src/index.js +20 -0
  169. package/dist/switch/src/Switch.css +236 -0
  170. package/dist/switch/src/Switch.d.ts +20 -0
  171. package/dist/switch/src/Switch.js +11 -0
  172. package/dist/switch/src/SwitchContext.d.ts +8 -0
  173. package/dist/switch/src/SwitchContext.js +2 -0
  174. package/dist/switch/src/SwitchField.css +119 -0
  175. package/dist/switch/src/SwitchField.d.ts +26 -0
  176. package/dist/switch/src/SwitchField.js +7 -0
  177. package/dist/switch/src/SwitchFieldContext.d.ts +10 -0
  178. package/dist/switch/src/SwitchFieldContext.js +2 -0
  179. package/dist/switch/src/index.css +276 -0
  180. package/dist/switch/src/index.d.ts +9 -0
  181. package/dist/switch/src/index.js +13 -0
  182. package/dist/utils/src/ClearSlots.d.ts +28 -0
  183. package/dist/utils/src/ClearSlots.js +2 -0
  184. package/dist/utils/src/SlotProvider.js +1 -0
  185. package/dist/utils/src/composeClassnameRenderProps.js +2 -0
  186. package/dist/utils/src/cssModule.js +2 -0
  187. package/dist/utils/src/index.d.ts +11 -6
  188. package/dist/utils/src/index.js +8 -4
  189. package/dist/utils/src/isTextOnlyChildren.js +2 -0
  190. package/dist/utils/src/{size-adapter.d.ts → sizeAdapter.d.ts} +1 -1
  191. package/dist/utils/src/sizeAdapter.js +1 -0
  192. package/dist/utils/src/types.d.ts +17 -5
  193. package/dist/utils/src/useRenderProps.d.ts +843 -0
  194. package/dist/utils/src/useRenderProps.js +2 -0
  195. package/dist/utils/src/useSlot.d.ts +8 -0
  196. package/dist/utils/src/useSlot.js +2 -0
  197. package/package.json +32 -27
  198. package/dist/chunk-GXUPEV64.js +0 -24
  199. package/dist/chunk-WROQHGG5.js +0 -141
  200. package/dist/chunk-WRWNRVTG.js +0 -47
  201. package/dist/intl/src/index.js +0 -1
  202. package/dist/intl/src/useLocalizedString.d.ts +0 -26
  203. package/dist/intl/src/useLocalizedString.js +0 -1
  204. package/dist/utils/src/compose-classname-render-props.js +0 -1
  205. package/dist/utils/src/css-module.js +0 -1
  206. package/dist/utils/src/is-text-only-children.js +0 -1
  207. package/dist/utils/src/size-adapter.js +0 -1
  208. /package/dist/{chunk-D57ZIX5W.js → chunk-LQICWONC.js} +0 -0
  209. /package/dist/utils/src/{compose-classname-render-props.d.ts → composeClassnameRenderProps.d.ts} +0 -0
  210. /package/dist/utils/src/{css-module.d.ts → cssModule.d.ts} +0 -0
  211. /package/dist/utils/src/{is-text-only-children.d.ts → isTextOnlyChildren.d.ts} +0 -0
@@ -0,0 +1,186 @@
1
+ import { useSlot } from './chunk-H5YTU3U7.js';
2
+ import { useLocalizedString } from './chunk-BPM4ETTB.js';
3
+ import { useRenderProps } from './chunk-NH3IVMXB.js';
4
+ import { ButtonContext } from './chunk-WMTWFKKP.js';
5
+ import { isTextOnlyChildren } from './chunk-ZWU6DRRZ.js';
6
+ import { _Spinner } from './chunk-DFUQTSEV.js';
7
+ import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
8
+ import { _Text } from './chunk-M6UHXS6K.js';
9
+ import { TextContext } from './chunk-OE5BLFZI.js';
10
+ import { SlotProvider } from './chunk-M36KANKC.js';
11
+ import { IconListContext } from './chunk-DHVVYSLB.js';
12
+ import { cssModule } from './chunk-KVDXQMWI.js';
13
+ import { IconContext } from '@hopper-ui/icons';
14
+ import { useStyledSystem, useResponsiveValue } from '@hopper-ui/styled-system';
15
+ import { chain, filterDOMProps, useRouter, shouldClientNavigate } from '@react-aria/utils';
16
+ import { forwardRef } from 'react';
17
+ import { useFocusRing, useHover, useButton, mergeProps } from 'react-aria';
18
+ import { useContextProps, ButtonContext as ButtonContext$1, composeRenderProps, DEFAULT_SLOT } from 'react-aria-components';
19
+ import { jsx, jsxs } from 'react/jsx-runtime';
20
+
21
+ // css-module:./Button.module.css#css-module
22
+ var Button_module_default = { "hop-Button": "Button-module__hop-Button___cJ-uA", "hop-Button--icon-only": "Button-module__hop-Button--icon-only___ZlRhs", "hop-Button--fluid": "Button-module__hop-Button--fluid___8QjEJ", "hop-Button--sm": "Button-module__hop-Button--sm___bUHes", "hop-Button--primary": "Button-module__hop-Button--primary___2PGPX", "hop-Button--md": "Button-module__hop-Button--md___-ftkr", "hop-Button--secondary": "Button-module__hop-Button--secondary___eHbc0", "hop-Button--upsell": "Button-module__hop-Button--upsell___P5EbP", "hop-Button--danger": "Button-module__hop-Button--danger___-gnFY", "hop-Button--ghost-danger": "Button-module__hop-Button--ghost-danger___aL9kX", "hop-Button--ghost-secondary": "Button-module__hop-Button--ghost-secondary___zpfVo", "hop-Button--ghost-primary": "Button-module__hop-Button--ghost-primary___fFsQn", "hop-Button__Spinner": "Button-module__hop-Button__Spinner___oFd2F", "hop-Button__icon": "Button-module__hop-Button__icon___V-Xu7", "hop-Button__icon-list": "Button-module__hop-Button__icon-list___QbCfg", "hop-Button__text": "Button-module__hop-Button__text___d4ZlX", "hop-Button__end-icon": "Button-module__hop-Button__end-icon___bIHjn", "hop-Button__end-icon-list": "Button-module__hop-Button__end-icon-list___hpAvJ" };
23
+ var GlobalButtonCssSelector = "hop-Button";
24
+ var additionalButtonHTMLAttributes = /* @__PURE__ */ new Set(["form", "formAction", "formEncType", "formMethod", "formNoValidate", "formTarget", "name", "value"]);
25
+ function useSimulatedRACButton(props, ref) {
26
+ const { focusProps, isFocused, isFocusVisible } = useFocusRing(props);
27
+ const { hoverProps, isHovered } = useHover(props);
28
+ const ctx = props;
29
+ const elementType = props.href ? "a" : "button";
30
+ const { buttonProps, isPressed } = useButton({
31
+ ...props,
32
+ elementType,
33
+ isDisabled: props.isDisabled || props.isLoading
34
+ }, ref);
35
+ const state = {
36
+ isFocused,
37
+ isFocusVisible,
38
+ isHovered,
39
+ isPressed,
40
+ isDisabled: props.isDisabled || false
41
+ };
42
+ const mergedProps = {
43
+ ...mergeProps(buttonProps, focusProps, hoverProps),
44
+ "data-disabled": props.isDisabled || void 0,
45
+ "data-pressed": ctx.isPressed || isPressed || void 0,
46
+ "data-hovered": isHovered || void 0,
47
+ "data-focused": isFocused || void 0,
48
+ "data-focus-visible": isFocusVisible || void 0
49
+ };
50
+ return [mergedProps, state];
51
+ }
52
+ function useCreateRouterLinkClickEventHandler(props) {
53
+ const router = useRouter();
54
+ return (e) => {
55
+ if (!router.isNative && e.currentTarget instanceof HTMLAnchorElement && e.currentTarget.href && // If props are applied to a router Link component, it may have already prevented default.
56
+ !e.isDefaultPrevented() && shouldClientNavigate(e.currentTarget, e) && props.href) {
57
+ e.preventDefault();
58
+ router.open(e.currentTarget, e, props.href, props.routerOptions);
59
+ }
60
+ };
61
+ }
62
+ function Button(props, ref) {
63
+ var _a, _b;
64
+ [props, ref] = useContextProps(props, ref, ButtonContext);
65
+ [props, ref] = useContextProps(props, ref, ButtonContext$1);
66
+ const { stylingProps, ...ownProps } = useStyledSystem(props);
67
+ const [{ onClick, ...buttonProps }, state] = useSimulatedRACButton(ownProps, ref);
68
+ const stringFormatter = useLocalizedString();
69
+ const {
70
+ className,
71
+ children: childrenProp,
72
+ size: sizeProp,
73
+ fluid: fluidProp,
74
+ variant = "primary",
75
+ isLoading,
76
+ style: styleProp,
77
+ ...otherProps
78
+ } = ownProps;
79
+ const [textRef, hasText] = useSlot();
80
+ const size = (_a = useResponsiveValue(sizeProp)) != null ? _a : "md";
81
+ const fluid = (_b = useResponsiveValue(fluidProp)) != null ? _b : false;
82
+ const classNames = composeClassnameRenderProps(
83
+ className,
84
+ GlobalButtonCssSelector,
85
+ cssModule(
86
+ Button_module_default,
87
+ "hop-Button",
88
+ variant,
89
+ size,
90
+ fluid && "fluid",
91
+ isLoading && "loading",
92
+ !hasText && "icon-only"
93
+ ),
94
+ stylingProps.className
95
+ );
96
+ const style = composeRenderProps(styleProp, (prev) => {
97
+ return {
98
+ ...stylingProps.style,
99
+ ...prev
100
+ };
101
+ });
102
+ const children = composeRenderProps(childrenProp, (prev) => {
103
+ if (isTextOnlyChildren(prev)) {
104
+ return /* @__PURE__ */ jsx(_Text, { children: prev });
105
+ }
106
+ return prev;
107
+ });
108
+ const renderProps = useRenderProps({
109
+ className: classNames,
110
+ style,
111
+ children,
112
+ values: state
113
+ });
114
+ const hasAriaLabel = !!buttonProps["aria-label"] || !!buttonProps["aria-labelledby"];
115
+ if (!hasText && !hasAriaLabel) {
116
+ console.warn("[hopper-ui] If you do not provide a text children, you must specify an aria-label for accessibility");
117
+ }
118
+ const handleClick = chain(
119
+ onClick,
120
+ useCreateRouterLinkClickEventHandler(props)
121
+ );
122
+ const As = props.href ? "a" : "button";
123
+ return /* @__PURE__ */ jsx(
124
+ SlotProvider,
125
+ {
126
+ values: [
127
+ [IconListContext, {
128
+ slots: {
129
+ [DEFAULT_SLOT]: {
130
+ size,
131
+ className: Button_module_default["hop-Button__icon-list"]
132
+ },
133
+ "end-icon": {
134
+ size,
135
+ className: Button_module_default["hop-Button__end-icon-list"]
136
+ }
137
+ }
138
+ }],
139
+ [IconContext, {
140
+ slots: {
141
+ [DEFAULT_SLOT]: {
142
+ size,
143
+ className: Button_module_default["hop-Button__icon"]
144
+ },
145
+ "end-icon": {
146
+ size,
147
+ className: Button_module_default["hop-Button__end-icon"]
148
+ }
149
+ }
150
+ }],
151
+ [TextContext, {
152
+ className: Button_module_default["hop-Button__text"],
153
+ size,
154
+ ref: textRef
155
+ }]
156
+ ],
157
+ children: /* @__PURE__ */ jsxs(
158
+ As,
159
+ {
160
+ ...filterDOMProps(otherProps, { propNames: additionalButtonHTMLAttributes }),
161
+ ...buttonProps,
162
+ ...renderProps,
163
+ onClick: handleClick,
164
+ ref,
165
+ slot: props.slot || void 0,
166
+ "data-loading": isLoading,
167
+ children: [
168
+ renderProps.children,
169
+ isLoading && /* @__PURE__ */ jsx(
170
+ _Spinner,
171
+ {
172
+ "aria-label": stringFormatter.format("Button.spinnerAriaLabel"),
173
+ size,
174
+ className: Button_module_default["hop-Button__Spinner"]
175
+ }
176
+ )
177
+ ]
178
+ }
179
+ )
180
+ }
181
+ );
182
+ }
183
+ var _Button = forwardRef(Button);
184
+ _Button.displayName = "Button";
185
+
186
+ export { GlobalButtonCssSelector, _Button };
@@ -0,0 +1,27 @@
1
+ import { TextContext } from 'react-aria-components';
2
+ import { jsx } from 'react/jsx-runtime';
3
+
4
+ // src/utils/src/ClearSlots.tsx
5
+ function ClearProviders({
6
+ values,
7
+ children
8
+ }) {
9
+ for (const Context of values) {
10
+ children = /* @__PURE__ */ jsx(Context.Provider, { value: null, children });
11
+ }
12
+ return children;
13
+ }
14
+ function ClearContainerSlots({ children }) {
15
+ return /* @__PURE__ */ jsx(
16
+ ClearProviders,
17
+ {
18
+ values: [
19
+ TextContext,
20
+ TextContext
21
+ ],
22
+ children
23
+ }
24
+ );
25
+ }
26
+
27
+ export { ClearContainerSlots, ClearProviders };
@@ -0,0 +1,124 @@
1
+ import { isTextOnlyChildren } from './chunk-ZWU6DRRZ.js';
2
+ import { LinkContext } from './chunk-4VVNSXIB.js';
3
+ import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
4
+ import { _Text } from './chunk-M6UHXS6K.js';
5
+ import { TextContext } from './chunk-OE5BLFZI.js';
6
+ import { SlotProvider } from './chunk-M36KANKC.js';
7
+ import { IconListContext } from './chunk-DHVVYSLB.js';
8
+ import { cssModule } from './chunk-KVDXQMWI.js';
9
+ import { IconContext } from '@hopper-ui/icons';
10
+ import { useStyledSystem, useResponsiveValue } from '@hopper-ui/styled-system';
11
+ import { forwardRef } from 'react';
12
+ import { useContextProps, composeRenderProps, DEFAULT_SLOT, Link as Link$1 } from 'react-aria-components';
13
+ import { jsx } from 'react/jsx-runtime';
14
+
15
+ // css-module:./Link.module.css#css-module
16
+ var Link_module_default = { "hop-Link": "Link-module__hop-Link___pvGQC", "hop-Link--quiet": "Link-module__hop-Link--quiet___RRkch", "hop-Link--primary": "Link-module__hop-Link--primary___XGqPo", "hop-Link--secondary": "Link-module__hop-Link--secondary___VfX7X", "hop-Link__icon": "Link-module__hop-Link__icon___ckEZL", "hop-Link__icon-list": "Link-module__hop-Link__icon-list___8jaym", "hop-Link__text": "Link-module__hop-Link__text___uXUoO", "hop-Link__start-icon": "Link-module__hop-Link__start-icon___ZImUS", "hop-Link__start-icon-list": "Link-module__hop-Link__start-icon-list___yfs8D" };
17
+ var GlobalLinkCssSelector = "hop-Link";
18
+ var LinkToIconSizeAdapter = {
19
+ inherit: void 0,
20
+ xs: "sm",
21
+ sm: "sm",
22
+ md: "md",
23
+ lg: "md",
24
+ xl: "lg",
25
+ "2xl": "lg"
26
+ };
27
+ function Link(props, ref) {
28
+ var _a;
29
+ [props, ref] = useContextProps(props, ref, LinkContext);
30
+ const { stylingProps, ...ownProps } = useStyledSystem(props);
31
+ const {
32
+ className,
33
+ children: childrenProp,
34
+ size: sizeProp,
35
+ style: styleProp,
36
+ isQuiet,
37
+ isExternal,
38
+ variant = "primary",
39
+ rel,
40
+ target,
41
+ ...otherProps
42
+ } = ownProps;
43
+ const size = (_a = useResponsiveValue(sizeProp)) != null ? _a : "inherit";
44
+ const classNames = composeClassnameRenderProps(
45
+ className,
46
+ GlobalLinkCssSelector,
47
+ cssModule(
48
+ Link_module_default,
49
+ "hop-Link",
50
+ isQuiet && "quiet",
51
+ variant,
52
+ size
53
+ ),
54
+ stylingProps.className
55
+ );
56
+ const style = composeRenderProps(styleProp, (prev) => {
57
+ return {
58
+ ...stylingProps.style,
59
+ ...prev
60
+ };
61
+ });
62
+ const children = composeRenderProps(childrenProp, (prev) => {
63
+ if (prev && isTextOnlyChildren(prev)) {
64
+ return /* @__PURE__ */ jsx(_Text, { children: prev });
65
+ }
66
+ return prev;
67
+ });
68
+ const iconSize = LinkToIconSizeAdapter[size];
69
+ return /* @__PURE__ */ jsx(
70
+ SlotProvider,
71
+ {
72
+ values: [
73
+ [IconListContext, {
74
+ slots: {
75
+ [DEFAULT_SLOT]: {
76
+ color: "inherit",
77
+ size: iconSize,
78
+ className: Link_module_default["hop-Link__icon-list"]
79
+ },
80
+ "start-icon": {
81
+ color: "inherit",
82
+ size: iconSize,
83
+ className: Link_module_default["hop-Link__start-icon-list"]
84
+ }
85
+ }
86
+ }],
87
+ [IconContext, {
88
+ slots: {
89
+ [DEFAULT_SLOT]: {
90
+ color: "inherit",
91
+ size: iconSize,
92
+ className: Link_module_default["hop-Link__icon"]
93
+ },
94
+ "start-icon": {
95
+ color: "inherit",
96
+ size: iconSize,
97
+ className: Link_module_default["hop-Link__start-icon"]
98
+ }
99
+ }
100
+ }],
101
+ [TextContext, {
102
+ size,
103
+ className: Link_module_default["hop-Link__text"]
104
+ }]
105
+ ],
106
+ children: /* @__PURE__ */ jsx(
107
+ Link$1,
108
+ {
109
+ ...otherProps,
110
+ rel: rel != null ? rel : isExternal ? "noopener noreferrer" : void 0,
111
+ target: target != null ? target : isExternal ? "_blank" : void 0,
112
+ ref,
113
+ className: classNames,
114
+ style,
115
+ children
116
+ }
117
+ )
118
+ }
119
+ );
120
+ }
121
+ var _Link = forwardRef(Link);
122
+ _Link.displayName = "Link";
123
+
124
+ export { GlobalLinkCssSelector, _Link };
@@ -1,26 +1,26 @@
1
- import { cssModule } from './chunk-6BEVZRUL.js';
1
+ import { cssModule } from './chunk-KVDXQMWI.js';
2
2
  import { LabelContext } from './chunk-HVKOIMMW.js';
3
3
  import { useStyledSystem, useResponsiveValue } from '@hopper-ui/styled-system';
4
+ import clsx from 'clsx';
4
5
  import { forwardRef } from 'react';
5
6
  import { useContextProps, Label as Label$1 } from 'react-aria-components';
6
- import clsx from 'clsx';
7
7
  import { jsx } from 'react/jsx-runtime';
8
8
 
9
- // src/Label/src/Label.module.css
10
- var Label_default = {};
9
+ // css-module:./Label.module.css#css-module
10
+ var Label_module_default = { "hop-Label": "Label-module__hop-Label___sZV4v", "hop-Label--xs": "Label-module__hop-Label--xs___7Flvr", "hop-Label--sm": "Label-module__hop-Label--sm___q7-gY", "hop-Label--md": "Label-module__hop-Label--md___ZxMc1", "hop-Label--lg": "Label-module__hop-Label--lg___qnzoz", "hop-Label--xl": "Label-module__hop-Label--xl___3pCXT", "hop-Label--2xl": "Label-module__hop-Label--2xl___CuLU9", "hop-Label--inherit": "Label-module__hop-Label--inherit___pCJ8C" };
11
11
  var GlobalLabelCssSelector = "hop-Label";
12
- var DefaultLabelSlot = "label";
13
12
  function Label(props, ref) {
14
- [props, ref] = useContextProps({ ...props, slot: props.slot || DefaultLabelSlot }, ref, LabelContext);
13
+ var _a;
14
+ [props, ref] = useContextProps(props, ref, LabelContext);
15
15
  const { stylingProps, ...ownProps } = useStyledSystem(props);
16
16
  const { className, size: sizeProp, children, style, ...otherProps } = ownProps;
17
- const size = useResponsiveValue(sizeProp != null ? sizeProp : "md");
17
+ const size = (_a = useResponsiveValue(sizeProp)) != null ? _a : "md";
18
18
  const classNames = clsx(
19
19
  className,
20
20
  GlobalLabelCssSelector,
21
21
  cssModule(
22
- Label_default,
23
- "hop-label",
22
+ Label_module_default,
23
+ "hop-Label",
24
24
  size
25
25
  ),
26
26
  stylingProps.className
@@ -0,0 +1,101 @@
1
+ import { ErrorMessageContext } from './chunk-ACVMW6YD.js';
2
+ import { HelperMessageContext } from './chunk-ESVVLTEN.js';
3
+ import { CheckboxFieldContext } from './chunk-ZGNK4GWA.js';
4
+ import { CheckboxGroupContext } from './chunk-N7YDPVZL.js';
5
+ import { CheckboxListContext } from './chunk-WDUQUPTE.js';
6
+ import { CheckboxContext } from './chunk-2EAZPH3M.js';
7
+ import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
8
+ import { SlotProvider } from './chunk-M36KANKC.js';
9
+ import { cssModule } from './chunk-KVDXQMWI.js';
10
+ import { LabelContext } from './chunk-HVKOIMMW.js';
11
+ import { useStyledSystem, useResponsiveValue } from '@hopper-ui/styled-system';
12
+ import { forwardRef } from 'react';
13
+ import { useContextProps, composeRenderProps, CheckboxGroup as CheckboxGroup$1 } from 'react-aria-components';
14
+ import { jsx } from 'react/jsx-runtime';
15
+
16
+ // css-module:./CheckboxGroup.module.css#css-module
17
+ var CheckboxGroup_module_default = { "hop-CheckboxGroup": "CheckboxGroup-module__hop-CheckboxGroup___G2wza", "hop-CheckboxGroup--bordered": "CheckboxGroup-module__hop-CheckboxGroup--bordered___fe2Pt", "hop-CheckboxGroup--sm": "CheckboxGroup-module__hop-CheckboxGroup--sm___q-5jl", "hop-CheckboxGroup--md": "CheckboxGroup-module__hop-CheckboxGroup--md___x3Gpi", "hop-CheckboxGroup__label": "CheckboxGroup-module__hop-CheckboxGroup__label___BcXsD", "hop-CheckboxGroup__list": "CheckboxGroup-module__hop-CheckboxGroup__list___bGx-3", "hop-CheckboxGroup__checkbox": "CheckboxGroup-module__hop-CheckboxGroup__checkbox___kNMWV", "hop-CheckboxGroup__error-message": "CheckboxGroup-module__hop-CheckboxGroup__error-message___hif0E", "hop-CheckboxGroup__helper-message": "CheckboxGroup-module__hop-CheckboxGroup__helper-message___Slue-" };
18
+ var GlobalCheckboxGroupCssSelector = "hop-CheckboxGroup";
19
+ function CheckboxGroup(props, ref) {
20
+ var _a, _b;
21
+ [props, ref] = useContextProps(props, ref, CheckboxGroupContext);
22
+ const { stylingProps, ...ownProps } = useStyledSystem(props);
23
+ const {
24
+ className,
25
+ children,
26
+ isDisabled,
27
+ isInvalid,
28
+ orientation: orientationProp = "vertical",
29
+ size: sizeProp = "md",
30
+ style: styleProp,
31
+ variant = "borderless",
32
+ ...otherProps
33
+ } = ownProps;
34
+ const orientation = (_a = useResponsiveValue(orientationProp)) != null ? _a : "vertical";
35
+ const size = (_b = useResponsiveValue(sizeProp)) != null ? _b : "md";
36
+ const classNames = composeClassnameRenderProps(
37
+ className,
38
+ GlobalCheckboxGroupCssSelector,
39
+ cssModule(
40
+ CheckboxGroup_module_default,
41
+ "hop-CheckboxGroup",
42
+ size,
43
+ variant
44
+ ),
45
+ stylingProps.className
46
+ );
47
+ const style = composeRenderProps(styleProp, (prev) => {
48
+ return {
49
+ ...stylingProps.style,
50
+ ...prev
51
+ };
52
+ });
53
+ return /* @__PURE__ */ jsx(
54
+ SlotProvider,
55
+ {
56
+ values: [
57
+ [LabelContext, {
58
+ className: CheckboxGroup_module_default["hop-CheckboxGroup__label"],
59
+ size
60
+ }],
61
+ [CheckboxContext, {
62
+ className: CheckboxGroup_module_default["hop-CheckboxGroup__checkbox"],
63
+ size
64
+ }],
65
+ [CheckboxFieldContext, {
66
+ className: CheckboxGroup_module_default["hop-CheckboxGroup__checkbox"],
67
+ size,
68
+ isDisabled
69
+ }],
70
+ [CheckboxListContext, {
71
+ className: CheckboxGroup_module_default["hop-CheckboxGroup__list"]
72
+ }],
73
+ [ErrorMessageContext, {
74
+ className: CheckboxGroup_module_default["hop-CheckboxGroup__error-message"],
75
+ hideIcon: true
76
+ }],
77
+ [HelperMessageContext, {
78
+ className: CheckboxGroup_module_default["hop-CheckboxGroup__helper-message"],
79
+ hideIcon: true
80
+ }]
81
+ ],
82
+ children: /* @__PURE__ */ jsx(
83
+ CheckboxGroup$1,
84
+ {
85
+ ref,
86
+ className: classNames,
87
+ style,
88
+ isInvalid,
89
+ isDisabled,
90
+ "data-orientation": orientation,
91
+ ...otherProps,
92
+ children
93
+ }
94
+ )
95
+ }
96
+ );
97
+ }
98
+ var _CheckboxGroup = forwardRef(CheckboxGroup);
99
+ _CheckboxGroup.displayName = "CheckboxGroup";
100
+
101
+ export { GlobalCheckboxGroupCssSelector, _CheckboxGroup };
@@ -1,6 +1,6 @@
1
1
  import clsx from 'clsx';
2
2
 
3
- // src/utils/src/css-module.ts
3
+ // src/utils/src/cssModule.ts
4
4
  function cssModule(cssModules, componentName, ...modifiers) {
5
5
  const classes = clsx(modifiers).split(" ").filter((x) => x && x !== "");
6
6
  return classes.reduce((acc, className) => {
@@ -0,0 +1,58 @@
1
+ import { ClearContainerSlots } from './chunk-HXI3MEEK.js';
2
+ import { TextContext } from './chunk-OE5BLFZI.js';
3
+ import { SlotProvider } from './chunk-M36KANKC.js';
4
+ import { cssModule } from './chunk-KVDXQMWI.js';
5
+ import { useStyledSystem, useResponsiveValue } from '@hopper-ui/styled-system';
6
+ import clsx from 'clsx';
7
+ import { forwardRef } from 'react';
8
+ import { useContextProps, Text as Text$1 } from 'react-aria-components';
9
+ import { jsx } from 'react/jsx-runtime';
10
+
11
+ // css-module:./Text.module.css#css-module
12
+ var Text_module_default = { "hop-Text": "Text-module__hop-Text___-u1e-", "hop-Text--xs": "Text-module__hop-Text--xs___P2Mlk", "hop-Text--sm": "Text-module__hop-Text--sm___DIgJn", "hop-Text--md": "Text-module__hop-Text--md___EBUtj", "hop-Text--lg": "Text-module__hop-Text--lg___Au1wj", "hop-Text--xl": "Text-module__hop-Text--xl___UoQSa", "hop-Text--2xl": "Text-module__hop-Text--2xl___Nxjf-", "hop-Text--inherit": "Text-module__hop-Text--inherit___WPX1D" };
13
+ var GlobalTextCssSelector = "hop-Text";
14
+ function Text(props, ref) {
15
+ [props, ref] = useContextProps(props, ref, TextContext);
16
+ const { stylingProps, ...ownProps } = useStyledSystem(props);
17
+ const { className, size: sizeProp, children, style, elementType = "span", ...otherProps } = ownProps;
18
+ const size = useResponsiveValue(sizeProp != null ? sizeProp : "md");
19
+ const classNames = clsx(
20
+ GlobalTextCssSelector,
21
+ cssModule(
22
+ Text_module_default,
23
+ "hop-Text",
24
+ size
25
+ ),
26
+ stylingProps.className,
27
+ className
28
+ );
29
+ const mergedStyles = {
30
+ ...stylingProps.style,
31
+ ...style
32
+ };
33
+ return /* @__PURE__ */ jsx(
34
+ Text$1,
35
+ {
36
+ ...otherProps,
37
+ ref,
38
+ elementType,
39
+ className: classNames,
40
+ style: mergedStyles,
41
+ children: /* @__PURE__ */ jsx(ClearContainerSlots, { children: /* @__PURE__ */ jsx(
42
+ SlotProvider,
43
+ {
44
+ values: [
45
+ [TextContext, {
46
+ size: "inherit"
47
+ }]
48
+ ],
49
+ children
50
+ }
51
+ ) })
52
+ }
53
+ );
54
+ }
55
+ var _Text = forwardRef(Text);
56
+ _Text.displayName = "Text";
57
+
58
+ export { GlobalTextCssSelector, _Text };
@@ -0,0 +1,57 @@
1
+ import { HelperMessageContext } from './chunk-ESVVLTEN.js';
2
+ import { _Text } from './chunk-M6UHXS6K.js';
3
+ import { cssModule } from './chunk-KVDXQMWI.js';
4
+ import { InfoIcon } from '@hopper-ui/icons';
5
+ import { useStyledSystem } from '@hopper-ui/styled-system';
6
+ import clsx from 'clsx';
7
+ import { forwardRef, useContext } from 'react';
8
+ import { useContextProps, FieldErrorContext } from 'react-aria-components';
9
+ import { jsxs, jsx } from 'react/jsx-runtime';
10
+
11
+ // css-module:./HelperMessage.module.css#css-module
12
+ var HelperMessage_module_default = { "hop-HelperMessage": "HelperMessage-module__hop-HelperMessage___1YNO0", "hop-HelperMessage__icon": "HelperMessage-module__hop-HelperMessage__icon___c7iS1" };
13
+ var GlobalHelperMessageCssSelector = "hop-HelperMessage";
14
+ function HelperMessage(props, ref) {
15
+ const validation = useContext(FieldErrorContext);
16
+ if (validation == null ? void 0 : validation.isInvalid) {
17
+ return null;
18
+ }
19
+ return /* @__PURE__ */ jsx(HelperMessageInner, { ...props, ref });
20
+ }
21
+ var _HelperMessage = forwardRef(HelperMessage);
22
+ _HelperMessage.displayName = "HelperMessage";
23
+ var HelperMessageInner = forwardRef((props, ref) => {
24
+ [props, ref] = useContextProps(props, ref, HelperMessageContext);
25
+ const { stylingProps, ...ownProps } = useStyledSystem(props);
26
+ const { className, children, hideIcon = false, style, slot = "description", ...otherProps } = ownProps;
27
+ const classNames = clsx(
28
+ GlobalHelperMessageCssSelector,
29
+ cssModule(
30
+ HelperMessage_module_default,
31
+ "hop-HelperMessage"
32
+ ),
33
+ stylingProps.className,
34
+ className
35
+ );
36
+ const mergedStyles = {
37
+ ...stylingProps.style,
38
+ ...style
39
+ };
40
+ return /* @__PURE__ */ jsxs(
41
+ _Text,
42
+ {
43
+ ...otherProps,
44
+ ref,
45
+ className: classNames,
46
+ style: mergedStyles,
47
+ size: "xs",
48
+ slot,
49
+ children: [
50
+ !hideIcon && /* @__PURE__ */ jsx(InfoIcon, { size: "sm", className: HelperMessage_module_default["hop-HelperMessage__icon"] }),
51
+ children
52
+ ]
53
+ }
54
+ );
55
+ });
56
+
57
+ export { GlobalHelperMessageCssSelector, _HelperMessage };