@hopper-ui/components 0.1.1 → 1.0.1

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 (199) 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 +4 -4
  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 +4 -4
  10. package/dist/IconList/src/index.js +2 -1
  11. package/dist/Label/src/Label.css +11 -11
  12. package/dist/Label/src/Label.js +2 -1
  13. package/dist/Label/src/LabelContext.js +1 -0
  14. package/dist/Label/src/index.css +11 -11
  15. package/dist/Label/src/index.js +2 -1
  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 +80 -80
  25. package/dist/Spinner/src/Spinner.d.ts +1 -0
  26. package/dist/Spinner/src/Spinner.js +3 -2
  27. package/dist/Spinner/src/SpinnerContext.js +1 -0
  28. package/dist/Spinner/src/index.css +80 -80
  29. package/dist/Spinner/src/index.js +3 -2
  30. package/dist/Text/src/Text.css +11 -11
  31. package/dist/Text/src/Text.d.ts +2 -3
  32. package/dist/Text/src/Text.js +4 -1
  33. package/dist/Text/src/TextContext.js +1 -0
  34. package/dist/Text/src/index.css +11 -11
  35. package/dist/Text/src/index.d.ts +1 -1
  36. package/dist/Text/src/index.js +4 -1
  37. package/dist/buttons/src/Button.css +557 -358
  38. package/dist/buttons/src/Button.d.ts +15 -10
  39. package/dist/buttons/src/Button.js +12 -8
  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 +557 -358
  48. package/dist/buttons/src/index.d.ts +2 -1
  49. package/dist/buttons/src/index.js +12 -8
  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-3FT5XSWV.js +124 -0
  82. package/dist/chunk-3KIUEBO3.js +69 -0
  83. package/dist/chunk-3LRBUQC2.js +43 -0
  84. package/dist/chunk-4VVNSXIB.js +7 -0
  85. package/dist/chunk-5MBJWRZD.js +7 -0
  86. package/dist/chunk-6EMOC7TA.js +83 -0
  87. package/dist/chunk-A7TZHALP.js +7 -0
  88. package/dist/chunk-ACVMW6YD.js +7 -0
  89. package/dist/{chunk-YLDA2M2E.js → chunk-ANVMQBBG.js} +2 -1
  90. package/dist/chunk-BIVAOAN2.js +101 -0
  91. package/dist/chunk-BPM4ETTB.js +35 -0
  92. package/dist/chunk-CE3ABLD2.js +92 -0
  93. package/dist/chunk-CJFCOPMQ.js +57 -0
  94. package/dist/chunk-DGLAGYBD.js +7 -0
  95. package/dist/chunk-EADFYPVX.js +93 -0
  96. package/dist/chunk-ESVVLTEN.js +7 -0
  97. package/dist/chunk-FD4HMY5A.js +91 -0
  98. package/dist/chunk-FU5CCPLP.js +7 -0
  99. package/dist/{chunk-JGYEQS4H.js → chunk-G7RKLBFT.js} +7 -7
  100. package/dist/chunk-H234F7HP.js +83 -0
  101. package/dist/chunk-H5YTU3U7.js +20 -0
  102. package/dist/chunk-H7VJS4MX.js +7 -0
  103. package/dist/chunk-HUJ3PTM7.js +58 -0
  104. package/dist/chunk-HXI3MEEK.js +27 -0
  105. package/dist/chunk-KKFX7YII.js +83 -0
  106. package/dist/chunk-N7YDPVZL.js +7 -0
  107. package/dist/chunk-NH3IVMXB.js +43 -0
  108. package/dist/chunk-NKHMUPAP.js +43 -0
  109. package/dist/chunk-SC4G54ML.js +186 -0
  110. package/dist/{chunk-CMJUZLSA.js → chunk-TRS7R4W3.js} +7 -7
  111. package/dist/chunk-VJQ7M2BK.js +7 -0
  112. package/dist/chunk-VYNBJRJW.js +101 -0
  113. package/dist/chunk-WDUQUPTE.js +7 -0
  114. package/dist/chunk-WTKIUAHI.js +7 -0
  115. package/dist/{chunk-A2IN7HC4.js → chunk-YFTLWL74.js} +8 -9
  116. package/dist/chunk-YHBJAXUY.js +7 -0
  117. package/dist/chunk-YSQDPG26.js +27 -0
  118. package/dist/chunk-ZGNK4GWA.js +7 -0
  119. package/dist/chunk-ZUMAL5WB.js +104 -0
  120. package/dist/errorMessage/src/ErrorMessage.css +102 -0
  121. package/dist/errorMessage/src/ErrorMessage.d.ts +20 -0
  122. package/dist/errorMessage/src/ErrorMessage.js +9 -0
  123. package/dist/errorMessage/src/ErrorMessageContext.d.ts +9 -0
  124. package/dist/errorMessage/src/ErrorMessageContext.js +2 -0
  125. package/dist/errorMessage/src/index.css +102 -0
  126. package/dist/errorMessage/src/index.d.ts +6 -0
  127. package/dist/errorMessage/src/index.js +9 -0
  128. package/dist/helperMessage/src/HelperMessage.css +94 -0
  129. package/dist/helperMessage/src/HelperMessage.d.ts +20 -0
  130. package/dist/helperMessage/src/HelperMessage.js +8 -0
  131. package/dist/helperMessage/src/HelperMessageContext.d.ts +9 -0
  132. package/dist/helperMessage/src/HelperMessageContext.js +2 -0
  133. package/dist/helperMessage/src/index.css +94 -0
  134. package/dist/helperMessage/src/index.d.ts +6 -0
  135. package/dist/helperMessage/src/index.js +8 -0
  136. package/dist/{intl → i18n}/src/index.d.ts +1 -0
  137. package/dist/i18n/src/index.js +2 -0
  138. package/dist/i18n/src/useLocalizedString.d.ts +9 -0
  139. package/dist/i18n/src/useLocalizedString.js +2 -0
  140. package/dist/layout/src/Flex.js +1 -0
  141. package/dist/layout/src/Grid.js +1 -1
  142. package/dist/layout/src/Inline.js +1 -0
  143. package/dist/layout/src/Stack.js +1 -0
  144. package/dist/radio/src/Radio.css +293 -0
  145. package/dist/radio/src/Radio.d.ts +20 -0
  146. package/dist/radio/src/Radio.js +11 -0
  147. package/dist/radio/src/RadioContext.d.ts +8 -0
  148. package/dist/radio/src/RadioContext.js +2 -0
  149. package/dist/radio/src/RadioField.css +119 -0
  150. package/dist/radio/src/RadioField.d.ts +26 -0
  151. package/dist/radio/src/RadioField.js +7 -0
  152. package/dist/radio/src/RadioFieldContext.d.ts +10 -0
  153. package/dist/radio/src/RadioFieldContext.js +2 -0
  154. package/dist/radio/src/RadioGroup.css +570 -0
  155. package/dist/radio/src/RadioGroup.d.ts +30 -0
  156. package/dist/radio/src/RadioGroup.js +12 -0
  157. package/dist/radio/src/RadioGroupContext.d.ts +8 -0
  158. package/dist/radio/src/RadioGroupContext.js +2 -0
  159. package/dist/radio/src/RadioList.d.ts +17 -0
  160. package/dist/radio/src/RadioList.js +3 -0
  161. package/dist/radio/src/RadioListContext.d.ts +10 -0
  162. package/dist/radio/src/RadioListContext.js +2 -0
  163. package/dist/radio/src/index.css +570 -0
  164. package/dist/radio/src/index.d.ts +13 -0
  165. package/dist/radio/src/index.js +20 -0
  166. package/dist/switch/src/Switch.css +236 -0
  167. package/dist/switch/src/Switch.d.ts +20 -0
  168. package/dist/switch/src/Switch.js +11 -0
  169. package/dist/switch/src/SwitchContext.d.ts +8 -0
  170. package/dist/switch/src/SwitchContext.js +2 -0
  171. package/dist/switch/src/SwitchField.css +119 -0
  172. package/dist/switch/src/SwitchField.d.ts +26 -0
  173. package/dist/switch/src/SwitchField.js +7 -0
  174. package/dist/switch/src/SwitchFieldContext.d.ts +10 -0
  175. package/dist/switch/src/SwitchFieldContext.js +2 -0
  176. package/dist/switch/src/index.css +276 -0
  177. package/dist/switch/src/index.d.ts +9 -0
  178. package/dist/switch/src/index.js +13 -0
  179. package/dist/utils/src/ClearSlots.d.ts +28 -0
  180. package/dist/utils/src/ClearSlots.js +2 -0
  181. package/dist/utils/src/SlotProvider.js +1 -0
  182. package/dist/utils/src/composeClassnameRenderProps.js +1 -0
  183. package/dist/utils/src/cssModule.js +1 -0
  184. package/dist/utils/src/index.d.ts +7 -2
  185. package/dist/utils/src/index.js +5 -1
  186. package/dist/utils/src/isTextOnlyChildren.js +1 -0
  187. package/dist/utils/src/sizeAdapter.d.ts +1 -1
  188. package/dist/utils/src/types.d.ts +17 -5
  189. package/dist/utils/src/useRenderProps.d.ts +843 -0
  190. package/dist/utils/src/useRenderProps.js +2 -0
  191. package/dist/utils/src/useSlot.d.ts +8 -0
  192. package/dist/utils/src/useSlot.js +2 -0
  193. package/package.json +32 -27
  194. package/dist/chunk-GXUPEV64.js +0 -24
  195. package/dist/chunk-TNWWLZEQ.js +0 -47
  196. package/dist/chunk-Z34Z6LYX.js +0 -141
  197. package/dist/intl/src/index.js +0 -1
  198. package/dist/intl/src/useLocalizedString.d.ts +0 -26
  199. package/dist/intl/src/useLocalizedString.js +0 -1
@@ -0,0 +1,93 @@
1
+ import { CheckboxContext } from './chunk-2EAZPH3M.js';
2
+ import { isTextOnlyChildren } from './chunk-ZWU6DRRZ.js';
3
+ import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
4
+ import { _Text } from './chunk-HUJ3PTM7.js';
5
+ import { ClearContainerSlots } from './chunk-HXI3MEEK.js';
6
+ import { TextContext } from './chunk-OE5BLFZI.js';
7
+ import { cssModule } from './chunk-KVDXQMWI.js';
8
+ import { SlotProvider } from './chunk-M36KANKC.js';
9
+ import { IconListContext } from './chunk-DHVVYSLB.js';
10
+ import { MinusIcon, CheckmarkIcon, IconContext } from '@hopper-ui/icons';
11
+ import { useStyledSystem, useResponsiveValue } from '@hopper-ui/styled-system';
12
+ import { forwardRef } from 'react';
13
+ import { useContextProps, composeRenderProps, Checkbox as Checkbox$1 } from 'react-aria-components';
14
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
15
+
16
+ // css-module:./Checkbox.module.css#css-module
17
+ var Checkbox_module_default = { "hop-Checkbox": "Checkbox-module__hop-Checkbox___BhbaC", "hop-Checkbox--sm": "Checkbox-module__hop-Checkbox--sm___49uhn", "hop-Checkbox--md": "Checkbox-module__hop-Checkbox--md___prKLF", "hop-Checkbox__icon": "Checkbox-module__hop-Checkbox__icon___HDKtm", "hop-Checkbox__icon-list": "Checkbox-module__hop-Checkbox__icon-list___2RKb6", "hop-Checkbox__box": "Checkbox-module__hop-Checkbox__box___3yEvn", "hop-Checkbox__check": "Checkbox-module__hop-Checkbox__check___9qQbS", "hop-Checkbox__text": "Checkbox-module__hop-Checkbox__text___R5Lg8" };
18
+ var GlobalCheckboxCssSelector = "hop-Checkbox";
19
+ function Checkbox(props, ref) {
20
+ var _a;
21
+ [props, ref] = useContextProps(props, ref, CheckboxContext);
22
+ const { stylingProps, ...ownProps } = useStyledSystem(props);
23
+ const {
24
+ className,
25
+ children: childrenProp,
26
+ size: sizeProp = "md",
27
+ style: styleProp,
28
+ ...otherProps
29
+ } = ownProps;
30
+ const size = (_a = useResponsiveValue(sizeProp)) != null ? _a : "md";
31
+ const classNames = composeClassnameRenderProps(
32
+ className,
33
+ GlobalCheckboxCssSelector,
34
+ cssModule(
35
+ Checkbox_module_default,
36
+ "hop-Checkbox",
37
+ size
38
+ ),
39
+ stylingProps.className
40
+ );
41
+ const style = composeRenderProps(styleProp, (prev) => {
42
+ return {
43
+ ...stylingProps.style,
44
+ ...prev
45
+ };
46
+ });
47
+ const children = composeRenderProps(childrenProp, (prev) => {
48
+ if (prev && isTextOnlyChildren(prev)) {
49
+ return /* @__PURE__ */ jsx(_Text, { children: prev });
50
+ }
51
+ return prev;
52
+ });
53
+ return /* @__PURE__ */ jsx(
54
+ Checkbox$1,
55
+ {
56
+ ref,
57
+ className: classNames,
58
+ style,
59
+ ...otherProps,
60
+ children: (checkboxProps) => {
61
+ const checkboxIconClassName = Checkbox_module_default["hop-Checkbox__check"];
62
+ const icon = checkboxProps.isIndeterminate ? /* @__PURE__ */ jsx(MinusIcon, { size: "sm", className: checkboxIconClassName }) : /* @__PURE__ */ jsx(CheckmarkIcon, { size: "sm", className: checkboxIconClassName });
63
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
64
+ /* @__PURE__ */ jsx("div", { className: Checkbox_module_default["hop-Checkbox__box"], children: icon }),
65
+ /* @__PURE__ */ jsx(ClearContainerSlots, { children: /* @__PURE__ */ jsx(
66
+ SlotProvider,
67
+ {
68
+ values: [
69
+ [TextContext, {
70
+ className: Checkbox_module_default["hop-Checkbox__text"],
71
+ size
72
+ }],
73
+ [IconListContext, {
74
+ className: Checkbox_module_default["hop-Checkbox__icon-list"],
75
+ size
76
+ }],
77
+ [IconContext, {
78
+ className: Checkbox_module_default["hop-Checkbox__icon"],
79
+ size
80
+ }]
81
+ ],
82
+ children: children(checkboxProps)
83
+ }
84
+ ) })
85
+ ] });
86
+ }
87
+ }
88
+ );
89
+ }
90
+ var _Checkbox = forwardRef(Checkbox);
91
+ _Checkbox.displayName = "Checkbox";
92
+
93
+ export { GlobalCheckboxCssSelector, _Checkbox };
@@ -0,0 +1,7 @@
1
+ import { createContext } from 'react';
2
+
3
+ // src/helperMessage/src/HelperMessageContext.ts
4
+ var HelperMessageContext = createContext({});
5
+ HelperMessageContext.displayName = "HelperMessageContext";
6
+
7
+ export { HelperMessageContext };
@@ -0,0 +1,91 @@
1
+ import { SwitchContext } from './chunk-YHBJAXUY.js';
2
+ import { isTextOnlyChildren } from './chunk-ZWU6DRRZ.js';
3
+ import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
4
+ import { _Text } from './chunk-HUJ3PTM7.js';
5
+ import { ClearContainerSlots } from './chunk-HXI3MEEK.js';
6
+ import { TextContext } from './chunk-OE5BLFZI.js';
7
+ import { cssModule } from './chunk-KVDXQMWI.js';
8
+ import { SlotProvider } from './chunk-M36KANKC.js';
9
+ import { IconListContext } from './chunk-DHVVYSLB.js';
10
+ import { IconContext } from '@hopper-ui/icons';
11
+ import { useStyledSystem, useResponsiveValue } from '@hopper-ui/styled-system';
12
+ import { forwardRef } from 'react';
13
+ import { useContextProps, composeRenderProps, Switch as Switch$1 } from 'react-aria-components';
14
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
15
+
16
+ // css-module:./Switch.module.css#css-module
17
+ var Switch_module_default = { "hop-Switch": "Switch-module__hop-Switch___6Sj-R", "hop-Switch--sm": "Switch-module__hop-Switch--sm___KZDNj", "hop-Switch--md": "Switch-module__hop-Switch--md___vSzXv", "hop-Switch__indicator": "Switch-module__hop-Switch__indicator___HHYut", "hop-Switch__text": "Switch-module__hop-Switch__text___83KFO", "hop-Switch__icon-list": "Switch-module__hop-Switch__icon-list___fkOxm", "hop-Switch__icon": "Switch-module__hop-Switch__icon___AvDWN" };
18
+ var GlobalSwitchCssSelector = "hop-Switch";
19
+ function Switch(props, ref) {
20
+ var _a;
21
+ [props, ref] = useContextProps(props, ref, SwitchContext);
22
+ const { stylingProps, ...ownProps } = useStyledSystem(props);
23
+ const {
24
+ className,
25
+ children: childrenProp,
26
+ size: sizeProp = "md",
27
+ style: styleProp,
28
+ ...otherProps
29
+ } = ownProps;
30
+ const size = (_a = useResponsiveValue(sizeProp)) != null ? _a : "md";
31
+ const classNames = composeClassnameRenderProps(
32
+ className,
33
+ GlobalSwitchCssSelector,
34
+ cssModule(
35
+ Switch_module_default,
36
+ "hop-Switch",
37
+ size
38
+ ),
39
+ stylingProps.className
40
+ );
41
+ const style = composeRenderProps(styleProp, (prev) => {
42
+ return {
43
+ ...stylingProps.style,
44
+ ...prev
45
+ };
46
+ });
47
+ const children = composeRenderProps(childrenProp, (prev) => {
48
+ if (prev && isTextOnlyChildren(prev)) {
49
+ return /* @__PURE__ */ jsx(_Text, { children: prev });
50
+ }
51
+ return prev;
52
+ });
53
+ return /* @__PURE__ */ jsx(
54
+ Switch$1,
55
+ {
56
+ ref,
57
+ className: classNames,
58
+ style,
59
+ ...otherProps,
60
+ children: (switchProps) => {
61
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
62
+ /* @__PURE__ */ jsx("div", { className: Switch_module_default["hop-Switch__indicator"] }),
63
+ /* @__PURE__ */ jsx(ClearContainerSlots, { children: /* @__PURE__ */ jsx(
64
+ SlotProvider,
65
+ {
66
+ values: [
67
+ [TextContext, {
68
+ className: Switch_module_default["hop-Switch__text"],
69
+ size
70
+ }],
71
+ [IconListContext, {
72
+ className: Switch_module_default["hop-Switch__icon-list"],
73
+ size
74
+ }],
75
+ [IconContext, {
76
+ className: Switch_module_default["hop-Switch__icon"],
77
+ size
78
+ }]
79
+ ],
80
+ children: children(switchProps)
81
+ }
82
+ ) })
83
+ ] });
84
+ }
85
+ }
86
+ );
87
+ }
88
+ var _Switch = forwardRef(Switch);
89
+ _Switch.displayName = "Switch";
90
+
91
+ export { GlobalSwitchCssSelector, _Switch };
@@ -0,0 +1,7 @@
1
+ import { createContext } from 'react';
2
+
3
+ // src/radio/src/RadioContext.ts
4
+ var RadioContext = createContext({});
5
+ RadioContext.displayName = "RadioContext";
6
+
7
+ export { RadioContext };
@@ -1,14 +1,14 @@
1
1
  import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
2
2
  import { SpinnerContext } from './chunk-4ZYV2XLW.js';
3
- import { _Label } from './chunk-CMJUZLSA.js';
3
+ import { _Label } from './chunk-TRS7R4W3.js';
4
4
  import { cssModule } from './chunk-KVDXQMWI.js';
5
5
  import { useStyledSystem, useResponsiveValue } from '@hopper-ui/styled-system';
6
6
  import { forwardRef } from 'react';
7
7
  import { useContextProps, ProgressBar } from 'react-aria-components';
8
8
  import { jsx, jsxs } from 'react/jsx-runtime';
9
9
 
10
- // src/Spinner/src/Spinner.module.css
11
- var Spinner_default = {};
10
+ // css-module:./Spinner.module.css#css-module
11
+ var Spinner_module_default = { "hop-Spinner": "Spinner-module__hop-Spinner___aEM81", "spin": "Spinner-module__spin___7FYor", "hop-Spinner--sm": "Spinner-module__hop-Spinner--sm___OD2lW", "hop-Spinner--md": "Spinner-module__hop-Spinner--md___sXKHE", "hop-Spinner--lg": "Spinner-module__hop-Spinner--lg___L-WLb", "hop-Spinner__track": "Spinner-module__hop-Spinner__track___DpgY-", "hop-Spinner__fill": "Spinner-module__hop-Spinner__fill___2StSk", "hop-Spinner__label": "Spinner-module__hop-Spinner__label___uof8N" };
12
12
  var GlobalSpinnerCssSelector = "hop-Spinner";
13
13
  var SpinnerToLabelSizeAdapter = {
14
14
  sm: "xs",
@@ -31,7 +31,7 @@ var Spinner = (props, ref) => {
31
31
  className,
32
32
  GlobalSpinnerCssSelector,
33
33
  cssModule(
34
- Spinner_default,
34
+ Spinner_module_default,
35
35
  "hop-Spinner",
36
36
  size
37
37
  ),
@@ -45,7 +45,7 @@ var Spinner = (props, ref) => {
45
45
  _Label,
46
46
  {
47
47
  className: cssModule(
48
- Spinner_default,
48
+ Spinner_module_default,
49
49
  "hop-Spinner__label"
50
50
  ),
51
51
  size: SpinnerToLabelSizeAdapter[size],
@@ -65,7 +65,7 @@ var Spinner = (props, ref) => {
65
65
  "div",
66
66
  {
67
67
  className: cssModule(
68
- Spinner_default,
68
+ Spinner_module_default,
69
69
  "hop-Spinner__track"
70
70
  )
71
71
  }
@@ -74,7 +74,7 @@ var Spinner = (props, ref) => {
74
74
  "div",
75
75
  {
76
76
  className: cssModule(
77
- Spinner_default,
77
+ Spinner_module_default,
78
78
  "hop-Spinner__fill"
79
79
  )
80
80
  }
@@ -0,0 +1,83 @@
1
+ import { CheckboxFieldContext } from './chunk-ZGNK4GWA.js';
2
+ import { CheckboxContext } from './chunk-2EAZPH3M.js';
3
+ import { TextContext } from './chunk-OE5BLFZI.js';
4
+ import { cssModule } from './chunk-KVDXQMWI.js';
5
+ import { SlotProvider } from './chunk-M36KANKC.js';
6
+ import { useStyledSystem, useResponsiveValue } from '@hopper-ui/styled-system';
7
+ import clsx from 'clsx';
8
+ import { forwardRef } from 'react';
9
+ import { useId } from 'react-aria';
10
+ import { useContextProps } from 'react-aria-components';
11
+ import { jsx } from 'react/jsx-runtime';
12
+
13
+ // css-module:./CheckboxField.module.css#css-module
14
+ var CheckboxField_module_default = { "hop-CheckboxField": "CheckboxField-module__hop-CheckboxField___9sca9", "hop-CheckboxField--sm": "CheckboxField-module__hop-CheckboxField--sm___0N2IZ", "hop-CheckboxField--md": "CheckboxField-module__hop-CheckboxField--md___qjuuC", "hop-CheckboxField__description": "CheckboxField-module__hop-CheckboxField__description___gwO6h", "hop-CheckboxField__checkbox": "CheckboxField-module__hop-CheckboxField__checkbox___IbRlC" };
15
+ var GlobalCheckboxFieldCssSelector = "hop-CheckboxField";
16
+ var CheckboxToDescriptionSizeAdapter = {
17
+ sm: "xs",
18
+ md: "sm"
19
+ };
20
+ function CheckboxField(props, ref) {
21
+ var _a;
22
+ [props, ref] = useContextProps(props, ref, CheckboxFieldContext);
23
+ const { stylingProps, ...ownProps } = useStyledSystem(props);
24
+ const {
25
+ className,
26
+ children,
27
+ isDisabled,
28
+ size: sizeProp = "md",
29
+ style,
30
+ slot,
31
+ ...otherProps
32
+ } = ownProps;
33
+ const size = (_a = useResponsiveValue(sizeProp)) != null ? _a : "md";
34
+ const classNames = clsx(
35
+ className,
36
+ GlobalCheckboxFieldCssSelector,
37
+ cssModule(
38
+ CheckboxField_module_default,
39
+ "hop-CheckboxField",
40
+ size
41
+ ),
42
+ stylingProps.className
43
+ );
44
+ const mergedStyles = {
45
+ ...stylingProps.style,
46
+ ...style
47
+ };
48
+ const descriptionId = useId();
49
+ return /* @__PURE__ */ jsx(
50
+ SlotProvider,
51
+ {
52
+ values: [
53
+ [TextContext, {
54
+ id: descriptionId,
55
+ className: CheckboxField_module_default["hop-CheckboxField__description"],
56
+ size: CheckboxToDescriptionSizeAdapter[size]
57
+ }],
58
+ [CheckboxContext, {
59
+ className: CheckboxField_module_default["hop-CheckboxField__checkbox"],
60
+ size,
61
+ isDisabled,
62
+ "aria-describedby": descriptionId
63
+ }]
64
+ ],
65
+ children: /* @__PURE__ */ jsx(
66
+ "div",
67
+ {
68
+ ...otherProps,
69
+ ref,
70
+ className: classNames,
71
+ style: mergedStyles,
72
+ slot: slot != null ? slot : void 0,
73
+ "data-disabled": isDisabled,
74
+ children
75
+ }
76
+ )
77
+ }
78
+ );
79
+ }
80
+ var _CheckboxField = forwardRef(CheckboxField);
81
+ _CheckboxField.displayName = "CheckboxField";
82
+
83
+ export { GlobalCheckboxFieldCssSelector, _CheckboxField };
@@ -0,0 +1,20 @@
1
+ import { useIsomorphicLayoutEffect } from '@hopper-ui/styled-system';
2
+ import { useState, useRef, useCallback } from 'react';
3
+
4
+ // src/utils/src/useSlot.ts
5
+ function useSlot() {
6
+ const [hasSlot, setHasSlot] = useState(true);
7
+ const hasRun = useRef(false);
8
+ const ref = useCallback((el) => {
9
+ hasRun.current = true;
10
+ setHasSlot(!!el);
11
+ }, []);
12
+ useIsomorphicLayoutEffect(() => {
13
+ if (!hasRun.current) {
14
+ setHasSlot(false);
15
+ }
16
+ }, []);
17
+ return [ref, hasSlot];
18
+ }
19
+
20
+ export { useSlot };
@@ -0,0 +1,7 @@
1
+ import { createContext } from 'react';
2
+
3
+ // src/switch/src/SwitchFieldContext.ts
4
+ var SwitchFieldContext = createContext({});
5
+ SwitchFieldContext.displayName = "SwitchFieldContext";
6
+
7
+ export { SwitchFieldContext };
@@ -0,0 +1,58 @@
1
+ import { ClearContainerSlots } from './chunk-HXI3MEEK.js';
2
+ import { TextContext } from './chunk-OE5BLFZI.js';
3
+ import { cssModule } from './chunk-KVDXQMWI.js';
4
+ import { SlotProvider } from './chunk-M36KANKC.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___eHjGr", "hop-Text--xs": "Text-module__hop-Text--xs___6lQf3", "hop-Text--sm": "Text-module__hop-Text--sm___79uWV", "hop-Text--md": "Text-module__hop-Text--md___kaNdx", "hop-Text--lg": "Text-module__hop-Text--lg___DD3l0", "hop-Text--xl": "Text-module__hop-Text--xl___CU19-", "hop-Text--2xl": "Text-module__hop-Text--2xl___Zif3-", "hop-Text--inherit": "Text-module__hop-Text--inherit___NWdla" };
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,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,83 @@
1
+ import { RadioFieldContext } from './chunk-DGLAGYBD.js';
2
+ import { RadioContext } from './chunk-FU5CCPLP.js';
3
+ import { TextContext } from './chunk-OE5BLFZI.js';
4
+ import { cssModule } from './chunk-KVDXQMWI.js';
5
+ import { SlotProvider } from './chunk-M36KANKC.js';
6
+ import { useStyledSystem, useResponsiveValue } from '@hopper-ui/styled-system';
7
+ import clsx from 'clsx';
8
+ import { forwardRef } from 'react';
9
+ import { useId } from 'react-aria';
10
+ import { useContextProps } from 'react-aria-components';
11
+ import { jsx } from 'react/jsx-runtime';
12
+
13
+ // css-module:./RadioField.module.css#css-module
14
+ var RadioField_module_default = { "hop-RadioField": "RadioField-module__hop-RadioField___j1CT8", "hop-RadioField--sm": "RadioField-module__hop-RadioField--sm___Ln2rb", "hop-RadioField--md": "RadioField-module__hop-RadioField--md___gjZg1", "hop-RadioField__description": "RadioField-module__hop-RadioField__description___5M3wB", "hop-RadioField__radio": "RadioField-module__hop-RadioField__radio___jjwMS" };
15
+ var GlobalRadioFieldCssSelector = "hop-RadioField";
16
+ var RadioToDescriptionSizeAdapter = {
17
+ sm: "xs",
18
+ md: "sm"
19
+ };
20
+ function RadioField(props, ref) {
21
+ var _a;
22
+ [props, ref] = useContextProps(props, ref, RadioFieldContext);
23
+ const { stylingProps, ...ownProps } = useStyledSystem(props);
24
+ const {
25
+ className,
26
+ children,
27
+ isDisabled,
28
+ size: sizeProp = "md",
29
+ style,
30
+ slot,
31
+ ...otherProps
32
+ } = ownProps;
33
+ const size = (_a = useResponsiveValue(sizeProp)) != null ? _a : "md";
34
+ const classNames = clsx(
35
+ className,
36
+ GlobalRadioFieldCssSelector,
37
+ cssModule(
38
+ RadioField_module_default,
39
+ "hop-RadioField",
40
+ size
41
+ ),
42
+ stylingProps.className
43
+ );
44
+ const mergedStyles = {
45
+ ...stylingProps.style,
46
+ ...style
47
+ };
48
+ const descriptionId = useId();
49
+ return /* @__PURE__ */ jsx(
50
+ SlotProvider,
51
+ {
52
+ values: [
53
+ [TextContext, {
54
+ id: descriptionId,
55
+ className: RadioField_module_default["hop-RadioField__description"],
56
+ size: RadioToDescriptionSizeAdapter[size]
57
+ }],
58
+ [RadioContext, {
59
+ className: RadioField_module_default["hop-RadioField__radio"],
60
+ size,
61
+ isDisabled,
62
+ "aria-describedby": descriptionId
63
+ }]
64
+ ],
65
+ children: /* @__PURE__ */ jsx(
66
+ "div",
67
+ {
68
+ ...otherProps,
69
+ ref,
70
+ className: classNames,
71
+ style: mergedStyles,
72
+ slot: slot != null ? slot : void 0,
73
+ "data-disabled": isDisabled,
74
+ children
75
+ }
76
+ )
77
+ }
78
+ );
79
+ }
80
+ var _RadioField = forwardRef(RadioField);
81
+ _RadioField.displayName = "RadioField";
82
+
83
+ export { GlobalRadioFieldCssSelector, _RadioField };
@@ -0,0 +1,7 @@
1
+ import { createContext } from 'react';
2
+
3
+ // src/checkbox/src/CheckboxGroupContext.ts
4
+ var CheckboxGroupContext = createContext({});
5
+ CheckboxGroupContext.displayName = "CheckboxGroupContext";
6
+
7
+ export { CheckboxGroupContext };
@@ -0,0 +1,43 @@
1
+ import { useMemo } from 'react';
2
+
3
+ // src/utils/src/useRenderProps.ts
4
+ function useRenderProps(props) {
5
+ const {
6
+ className,
7
+ style,
8
+ children,
9
+ defaultClassName = void 0,
10
+ defaultChildren = void 0,
11
+ defaultStyle,
12
+ values
13
+ } = props;
14
+ return useMemo(() => {
15
+ let computedClassName;
16
+ let computedStyle;
17
+ let computedChildren;
18
+ if (typeof className === "function") {
19
+ computedClassName = className({ ...values, defaultClassName });
20
+ } else {
21
+ computedClassName = className;
22
+ }
23
+ if (typeof style === "function") {
24
+ computedStyle = style({ ...values, defaultStyle: defaultStyle || {} });
25
+ } else {
26
+ computedStyle = style;
27
+ }
28
+ if (typeof children === "function") {
29
+ computedChildren = children({ ...values, defaultChildren });
30
+ } else if (children == null) {
31
+ computedChildren = defaultChildren;
32
+ } else {
33
+ computedChildren = children;
34
+ }
35
+ return {
36
+ className: computedClassName != null ? computedClassName : defaultClassName,
37
+ style: computedStyle || defaultStyle ? { ...defaultStyle, ...computedStyle } : void 0,
38
+ children: computedChildren != null ? computedChildren : defaultChildren
39
+ };
40
+ }, [className, style, children, defaultClassName, defaultChildren, defaultStyle, values]);
41
+ }
42
+
43
+ export { useRenderProps };
@@ -0,0 +1,43 @@
1
+ import { RadioListContext } from './chunk-A7TZHALP.js';
2
+ import { useStyledSystem } from '@hopper-ui/styled-system';
3
+ import clsx from 'clsx';
4
+ import { forwardRef } from 'react';
5
+ import { useContextProps } from 'react-aria-components';
6
+ import { jsx } from 'react/jsx-runtime';
7
+
8
+ var GlobalRadioListCssSelector = "hop-RadioList";
9
+ function RadioList(props, ref) {
10
+ [props, ref] = useContextProps(props, ref, RadioListContext);
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
+ className,
21
+ GlobalRadioListCssSelector,
22
+ stylingProps.className
23
+ );
24
+ const mergedStyles = {
25
+ ...stylingProps.style,
26
+ ...style
27
+ };
28
+ return /* @__PURE__ */ jsx(
29
+ "div",
30
+ {
31
+ ...otherProps,
32
+ ref,
33
+ className: classNames,
34
+ style: mergedStyles,
35
+ slot: slot != null ? slot : void 0,
36
+ children
37
+ }
38
+ );
39
+ }
40
+ var _RadioList = forwardRef(RadioList);
41
+ _RadioList.displayName = "RadioList";
42
+
43
+ export { GlobalRadioListCssSelector, _RadioList };