@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
@@ -1,35 +1,40 @@
1
1
  import * as react from 'react';
2
2
  import { StyledComponentProps, ResponsiveProp } from '@hopper-ui/styled-system';
3
- import { ButtonProps as ButtonProps$1, PressEvent } from 'react-aria-components';
3
+ import { RouterOptions } from '@react-types/shared';
4
+ import { ButtonProps as ButtonProps$1 } from 'react-aria-components';
4
5
 
5
6
  declare const GlobalButtonCssSelector = "hop-Button";
6
7
  interface ButtonProps extends StyledComponentProps<ButtonProps$1> {
7
8
  /**
8
9
  * The visual style of the button.
10
+ * * @default "primary"
9
11
  */
10
- variant?: "primary" | "secondary" | "tertiary" | "negative" | "upsell";
12
+ variant?: "primary" | "secondary" | "danger" | "upsell" | "ghost-primary" | "ghost-secondary" | "ghost-danger";
11
13
  /**
12
14
  * A button can vary in size.
15
+ * @default "md"
13
16
  */
14
17
  size?: ResponsiveProp<"sm" | "md">;
15
18
  /**
16
19
  * Whether or not the button takes up the width of its container.
17
20
  */
18
21
  fluid?: ResponsiveProp<boolean>;
22
+ /** A button can show a loading indicator.*/
19
23
  isLoading?: boolean;
20
- /**
21
- * This prop will be called when the button is clicked.
22
- *
23
- * The onClick prop is an alias for onPress and should not be used in conjunction with it. Use one or the other.
24
- * onPress is the recommended prop to use for handling button clicks.
25
- */
26
- onClick?: ((e: PressEvent) => void);
24
+ /** A URL to link to. Setting this makes the component render an `a` tag instead of a `button` */
25
+ href?: string;
26
+ /** The target window for the link. */
27
+ target?: string;
28
+ /** The relationship between the linked resource and the current page. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel). */
29
+ rel?: string;
30
+ /** Options for the configured client side router. */
31
+ routerOptions?: RouterOptions;
27
32
  }
28
33
  /**
29
34
  * Buttons are used to initialize an action. Button labels express what action will occur when the user interacts with it.
30
35
  *
31
36
  * [View Documentation](TODO)
32
37
  */
33
- declare const _Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
38
+ declare const _Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLElement>>;
34
39
 
35
40
  export { _Button as Button, type ButtonProps, GlobalButtonCssSelector };
@@ -1,14 +1,18 @@
1
- export { _Button as Button, GlobalButtonCssSelector } from '../../chunk-WROQHGG5.js';
2
- import '../../chunk-7QUHQYCR.js';
3
- import '../../chunk-GXUPEV64.js';
4
- import '../../chunk-QIOYM2XJ.js';
5
- import '../../chunk-SEU4CGZD.js';
1
+ export { _Button as Button, GlobalButtonCssSelector } from '../../chunk-HVRSS5RT.js';
2
+ import '../../chunk-H5YTU3U7.js';
3
+ import '../../chunk-BPM4ETTB.js';
4
+ import '../../chunk-NH3IVMXB.js';
5
+ import '../../chunk-WMTWFKKP.js';
6
+ import '../../chunk-ZWU6DRRZ.js';
7
+ import '../../chunk-DFUQTSEV.js';
8
+ import '../../chunk-65JPI4FL.js';
6
9
  import '../../chunk-4ZYV2XLW.js';
7
- import '../../chunk-WRWNRVTG.js';
10
+ import '../../chunk-M6UHXS6K.js';
11
+ import '../../chunk-HXI3MEEK.js';
8
12
  import '../../chunk-OE5BLFZI.js';
9
- import '../../chunk-WMTWFKKP.js';
10
13
  import '../../chunk-M36KANKC.js';
11
14
  import '../../chunk-DHVVYSLB.js';
12
- import '../../chunk-XCKF6EU7.js';
13
- import '../../chunk-6BEVZRUL.js';
15
+ import '../../chunk-IYITZANI.js';
16
+ import '../../chunk-KVDXQMWI.js';
14
17
  import '../../chunk-HVKOIMMW.js';
18
+ import '../../chunk-YSQDPG26.js';
@@ -2,7 +2,11 @@ import { ButtonProps } from './Button.js';
2
2
  import * as react from 'react';
3
3
  import { ContextValue } from 'react-aria-components';
4
4
  import '@hopper-ui/styled-system';
5
+ import '@react-types/shared';
5
6
 
6
- declare const ButtonContext: react.Context<ContextValue<ButtonProps, HTMLButtonElement>>;
7
+ interface ButtonContextValue extends ButtonProps {
8
+ isPressed?: boolean;
9
+ }
10
+ declare const ButtonContext: react.Context<ContextValue<ButtonContextValue, HTMLElement>>;
7
11
 
8
- export { ButtonContext };
12
+ export { ButtonContext, type ButtonContextValue };
@@ -1 +1,2 @@
1
1
  export { ButtonContext } from '../../chunk-WMTWFKKP.js';
2
+ import '../../chunk-YSQDPG26.js';
@@ -0,0 +1,38 @@
1
+ /* css-module:/home/runner/work/wl-hopper/wl-hopper/packages/components/src/buttons/src/ButtonGroup.module.css/#css-module-data */
2
+ .ButtonGroup-module__hop-ButtonGroup___xf1yy {
3
+ display: inline-flex;
4
+ flex-wrap: nowrap;
5
+ gap: var(--hop-space-inline-md);
6
+ }
7
+ .ButtonGroup-module__hop-ButtonGroup--horizontal___HN8si {
8
+ justify-content: center;
9
+ }
10
+ .ButtonGroup-module__hop-ButtonGroup--vertical___7-9By {
11
+ flex-direction: column;
12
+ gap: var(--hop-space-stack-md);
13
+ align-items: center;
14
+ }
15
+ .ButtonGroup-module__hop-ButtonGroup--start___0204P.ButtonGroup-module__hop-ButtonGroup--vertical___7-9By {
16
+ align-items: flex-start;
17
+ }
18
+ .ButtonGroup-module__hop-ButtonGroup--center___KLs5N.ButtonGroup-module__hop-ButtonGroup--vertical___7-9By {
19
+ align-items: center;
20
+ }
21
+ .ButtonGroup-module__hop-ButtonGroup--end___38Kh6.ButtonGroup-module__hop-ButtonGroup--vertical___7-9By {
22
+ align-items: flex-end;
23
+ }
24
+ .ButtonGroup-module__hop-ButtonGroup--start___0204P.ButtonGroup-module__hop-ButtonGroup--horizontal___HN8si {
25
+ justify-content: flex-start;
26
+ }
27
+ .ButtonGroup-module__hop-ButtonGroup--center___KLs5N.ButtonGroup-module__hop-ButtonGroup--horizontal___HN8si {
28
+ justify-content: center;
29
+ }
30
+ .ButtonGroup-module__hop-ButtonGroup--end___38Kh6.ButtonGroup-module__hop-ButtonGroup--horizontal___HN8si {
31
+ justify-content: flex-end;
32
+ }
33
+ .ButtonGroup-module__hop-ButtonGroup--wrap___fPCxb {
34
+ flex-wrap: wrap;
35
+ }
36
+ .ButtonGroup-module__hop-ButtonGroup--fluid___mrQvi {
37
+ inline-size: 100%;
38
+ }
@@ -0,0 +1,40 @@
1
+ import * as react from 'react';
2
+ import { HTMLAttributes } from 'react';
3
+ import { StyledComponentProps, ResponsiveProp } from '@hopper-ui/styled-system';
4
+ import { Orientation } from 'react-aria';
5
+
6
+ interface ButtonGroupProps extends StyledComponentProps<HTMLAttributes<HTMLDivElement>> {
7
+ /**
8
+ * The axis the ButtonGroup should align with.
9
+ * @default 'horizontal'
10
+ */
11
+ orientation?: ResponsiveProp<Orientation>;
12
+ /** Whether the Buttons in the ButtonGroup are all disabled. */
13
+ isDisabled?: boolean;
14
+ /** Whether the Buttons in the ButtonGroup are all fluid. */
15
+ fluid?: ResponsiveProp<boolean>;
16
+ /**
17
+ * The size of the buttons in the ButtonGroup.
18
+ * @default "md"
19
+ */
20
+ size?: ResponsiveProp<"sm" | "md">;
21
+ /**
22
+ * Whether elements are forced onto one line or can wrap onto multiple rows.
23
+ * @default true
24
+ */
25
+ wrap?: ResponsiveProp<boolean>;
26
+ /**
27
+ * The alignment of the buttons within the ButtonGroup.
28
+ * @default 'start'
29
+ */
30
+ align?: ResponsiveProp<"start" | "end" | "center">;
31
+ }
32
+ declare const GlobalButtonGroupCssSelector = "hop-ButtonGroup";
33
+ /**
34
+ * ButtonGroup handles the spacing and orientation for a grouping of buttons whose actions are related to each other.
35
+ *
36
+ * [View Documentation](TODO)
37
+ */
38
+ declare const _ButtonGroup: react.ForwardRefExoticComponent<ButtonGroupProps & react.RefAttributes<HTMLDivElement>>;
39
+
40
+ export { _ButtonGroup as ButtonGroup, type ButtonGroupProps, GlobalButtonGroupCssSelector };
@@ -0,0 +1,83 @@
1
+ import { ButtonGroupContext } from '../../chunk-VJQ7M2BK.js';
2
+ import { ButtonContext } from '../../chunk-WMTWFKKP.js';
3
+ import { SlotProvider } from '../../chunk-M36KANKC.js';
4
+ import { cssModule } from '../../chunk-KVDXQMWI.js';
5
+ import '../../chunk-YSQDPG26.js';
6
+ import { useStyledSystem, useResponsiveValue } from '@hopper-ui/styled-system';
7
+ import { filterDOMProps } from '@react-aria/utils';
8
+ import clsx from 'clsx';
9
+ import { forwardRef } from 'react';
10
+ import { useContextProps } from 'react-aria-components';
11
+ import { jsx } from 'react/jsx-runtime';
12
+
13
+ // css-module:./ButtonGroup.module.css#css-module
14
+ var ButtonGroup_module_default = { "hop-ButtonGroup": "ButtonGroup-module__hop-ButtonGroup___xf1yy", "hop-ButtonGroup--horizontal": "ButtonGroup-module__hop-ButtonGroup--horizontal___HN8si", "hop-ButtonGroup--vertical": "ButtonGroup-module__hop-ButtonGroup--vertical___7-9By", "hop-ButtonGroup--start": "ButtonGroup-module__hop-ButtonGroup--start___0204P", "hop-ButtonGroup--center": "ButtonGroup-module__hop-ButtonGroup--center___KLs5N", "hop-ButtonGroup--end": "ButtonGroup-module__hop-ButtonGroup--end___38Kh6", "hop-ButtonGroup--wrap": "ButtonGroup-module__hop-ButtonGroup--wrap___fPCxb", "hop-ButtonGroup--fluid": "ButtonGroup-module__hop-ButtonGroup--fluid___mrQvi" };
15
+ var GlobalButtonGroupCssSelector = "hop-ButtonGroup";
16
+ function ButtonGroup(props, ref) {
17
+ var _a, _b, _c, _d, _e;
18
+ [props, ref] = useContextProps(props, ref, ButtonGroupContext);
19
+ const { stylingProps, ...ownProps } = useStyledSystem(props);
20
+ const {
21
+ children,
22
+ size: sizeProp,
23
+ fluid: fluidProp,
24
+ isDisabled = false,
25
+ className,
26
+ align: alignProp,
27
+ style: styleProp,
28
+ orientation: orientationProp,
29
+ wrap: wrapProp,
30
+ ...otherProps
31
+ } = ownProps;
32
+ const align = (_a = useResponsiveValue(alignProp)) != null ? _a : "start";
33
+ const size = (_b = useResponsiveValue(sizeProp)) != null ? _b : "md";
34
+ const fluid = (_c = useResponsiveValue(fluidProp)) != null ? _c : false;
35
+ const wrap = (_d = useResponsiveValue(wrapProp)) != null ? _d : true;
36
+ const orientation = (_e = useResponsiveValue(orientationProp)) != null ? _e : "horizontal";
37
+ const classNames = clsx(
38
+ className,
39
+ GlobalButtonGroupCssSelector,
40
+ cssModule(
41
+ ButtonGroup_module_default,
42
+ "hop-ButtonGroup",
43
+ size,
44
+ align,
45
+ fluid && "fluid",
46
+ wrap && "wrap",
47
+ orientation
48
+ ),
49
+ stylingProps.className
50
+ );
51
+ const style = {
52
+ ...stylingProps.style,
53
+ ...styleProp
54
+ };
55
+ return /* @__PURE__ */ jsx(
56
+ "div",
57
+ {
58
+ ...filterDOMProps(otherProps, { labelable: true }),
59
+ ref,
60
+ className: classNames,
61
+ style,
62
+ slot: props.slot || void 0,
63
+ children: /* @__PURE__ */ jsx(
64
+ SlotProvider,
65
+ {
66
+ values: [[
67
+ ButtonContext,
68
+ {
69
+ size,
70
+ isDisabled,
71
+ fluid
72
+ }
73
+ ]],
74
+ children
75
+ }
76
+ )
77
+ }
78
+ );
79
+ }
80
+ var _ButtonGroup = forwardRef(ButtonGroup);
81
+ _ButtonGroup.displayName = "ButtonGroup";
82
+
83
+ export { _ButtonGroup as ButtonGroup, GlobalButtonGroupCssSelector };
@@ -0,0 +1,9 @@
1
+ import * as react from 'react';
2
+ import { ContextValue } from 'react-aria-components';
3
+ import { ButtonGroupProps } from './ButtonGroup.js';
4
+ import '@hopper-ui/styled-system';
5
+ import 'react-aria';
6
+
7
+ declare const ButtonGroupContext: react.Context<ContextValue<ButtonGroupProps, HTMLDivElement>>;
8
+
9
+ export { ButtonGroupContext };
@@ -0,0 +1,2 @@
1
+ export { ButtonGroupContext } from '../../chunk-VJQ7M2BK.js';
2
+ import '../../chunk-YSQDPG26.js';