@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.
- package/CHANGELOG.md +117 -0
- package/dist/HopperProvider/src/HopperProvider.d.ts +33 -1
- package/dist/HopperProvider/src/HopperProvider.js +2 -1
- package/dist/HopperProvider/src/index.d.ts +1 -0
- package/dist/HopperProvider/src/index.js +2 -1
- package/dist/IconList/src/IconList.css +6 -6
- package/dist/IconList/src/IconList.js +2 -1
- package/dist/IconList/src/IconListContext.js +1 -0
- package/dist/IconList/src/index.css +6 -6
- package/dist/IconList/src/index.js +2 -1
- package/dist/Label/src/Label.css +70 -70
- package/dist/Label/src/Label.js +3 -2
- package/dist/Label/src/LabelContext.js +1 -0
- package/dist/Label/src/index.css +70 -70
- package/dist/Label/src/index.js +3 -2
- package/dist/Link/src/Link.css +165 -0
- package/dist/Link/src/Link.d.ts +33 -0
- package/dist/Link/src/Link.js +11 -0
- package/dist/Link/src/LinkContext.d.ts +8 -0
- package/dist/Link/src/LinkContext.js +2 -0
- package/dist/Link/src/index.css +165 -0
- package/dist/Link/src/index.d.ts +5 -0
- package/dist/Link/src/index.js +11 -0
- package/dist/Spinner/src/Spinner.css +124 -124
- package/dist/Spinner/src/Spinner.d.ts +1 -0
- package/dist/Spinner/src/Spinner.js +5 -4
- package/dist/Spinner/src/SpinnerContext.js +1 -0
- package/dist/Spinner/src/index.css +124 -124
- package/dist/Spinner/src/index.js +5 -4
- package/dist/Text/src/Text.css +67 -67
- package/dist/Text/src/Text.d.ts +2 -3
- package/dist/Text/src/Text.js +5 -2
- package/dist/Text/src/TextContext.js +1 -0
- package/dist/Text/src/index.css +67 -67
- package/dist/Text/src/index.d.ts +1 -1
- package/dist/Text/src/index.js +5 -2
- package/dist/buttons/src/Button.css +634 -435
- package/dist/buttons/src/Button.d.ts +15 -10
- package/dist/buttons/src/Button.js +13 -9
- package/dist/buttons/src/ButtonContext.d.ts +6 -2
- package/dist/buttons/src/ButtonContext.js +1 -0
- package/dist/buttons/src/ButtonGroup.css +38 -0
- package/dist/buttons/src/ButtonGroup.d.ts +40 -0
- package/dist/buttons/src/ButtonGroup.js +83 -0
- package/dist/buttons/src/ButtonGroupContext.d.ts +9 -0
- package/dist/buttons/src/ButtonGroupContext.js +2 -0
- package/dist/buttons/src/index.css +634 -435
- package/dist/buttons/src/index.d.ts +2 -1
- package/dist/buttons/src/index.js +13 -9
- package/dist/checkbox/src/Checkbox.css +292 -0
- package/dist/checkbox/src/Checkbox.d.ts +20 -0
- package/dist/checkbox/src/Checkbox.js +11 -0
- package/dist/checkbox/src/CheckboxContext.d.ts +8 -0
- package/dist/checkbox/src/CheckboxContext.js +2 -0
- package/dist/checkbox/src/CheckboxField.css +119 -0
- package/dist/checkbox/src/CheckboxField.d.ts +26 -0
- package/dist/checkbox/src/CheckboxField.js +7 -0
- package/dist/checkbox/src/CheckboxFieldContext.d.ts +10 -0
- package/dist/checkbox/src/CheckboxFieldContext.js +2 -0
- package/dist/checkbox/src/CheckboxGroup.css +568 -0
- package/dist/checkbox/src/CheckboxGroup.d.ts +30 -0
- package/dist/checkbox/src/CheckboxGroup.js +12 -0
- package/dist/checkbox/src/CheckboxGroupContext.d.ts +8 -0
- package/dist/checkbox/src/CheckboxGroupContext.js +2 -0
- package/dist/checkbox/src/CheckboxList.d.ts +17 -0
- package/dist/checkbox/src/CheckboxList.js +3 -0
- package/dist/checkbox/src/CheckboxListContext.d.ts +10 -0
- package/dist/checkbox/src/CheckboxListContext.js +2 -0
- package/dist/checkbox/src/index.css +568 -0
- package/dist/checkbox/src/index.d.ts +13 -0
- package/dist/checkbox/src/index.js +20 -0
- package/dist/chip/src/Chip.css +261 -0
- package/dist/chip/src/Chip.d.ts +27 -0
- package/dist/chip/src/Chip.js +10 -0
- package/dist/chip/src/ChipContext.d.ts +10 -0
- package/dist/chip/src/ChipContext.js +2 -0
- package/dist/chip/src/index.css +261 -0
- package/dist/chip/src/index.d.ts +7 -0
- package/dist/chip/src/index.js +10 -0
- package/dist/chunk-2EAZPH3M.js +7 -0
- package/dist/chunk-3LRBUQC2.js +43 -0
- package/dist/chunk-4AARNXWE.js +101 -0
- package/dist/chunk-4VVNSXIB.js +7 -0
- package/dist/chunk-5KJ5IKUE.js +69 -0
- package/dist/chunk-5MBJWRZD.js +7 -0
- package/dist/{chunk-SEU4CGZD.js → chunk-65JPI4FL.js} +1 -1
- package/dist/chunk-7ELZ57E5.js +93 -0
- package/dist/chunk-A7TZHALP.js +7 -0
- package/dist/chunk-ACVMW6YD.js +7 -0
- package/dist/{chunk-YLDA2M2E.js → chunk-ANVMQBBG.js} +2 -1
- package/dist/chunk-B7WS4DBA.js +83 -0
- package/dist/chunk-BPM4ETTB.js +35 -0
- package/dist/{chunk-QIOYM2XJ.js → chunk-DFUQTSEV.js} +13 -13
- package/dist/chunk-DGLAGYBD.js +7 -0
- package/dist/chunk-ESVVLTEN.js +7 -0
- package/dist/chunk-FU5CCPLP.js +7 -0
- package/dist/chunk-GXKSX5N5.js +104 -0
- package/dist/chunk-H5YTU3U7.js +20 -0
- package/dist/chunk-H7VJS4MX.js +7 -0
- package/dist/chunk-HVRSS5RT.js +186 -0
- package/dist/chunk-HXI3MEEK.js +27 -0
- package/dist/chunk-I7AMDVGG.js +124 -0
- package/dist/{chunk-XCKF6EU7.js → chunk-IYITZANI.js} +9 -9
- package/dist/chunk-JHY3TXL4.js +101 -0
- package/dist/{chunk-6BEVZRUL.js → chunk-KVDXQMWI.js} +1 -1
- package/dist/chunk-M6UHXS6K.js +58 -0
- package/dist/chunk-MD6IFXLG.js +57 -0
- package/dist/chunk-ME3RBGOT.js +91 -0
- package/dist/chunk-N7YDPVZL.js +7 -0
- package/dist/chunk-NH3IVMXB.js +43 -0
- package/dist/chunk-NKHMUPAP.js +43 -0
- package/dist/chunk-OHPGEHL3.js +83 -0
- package/dist/chunk-VIHBOZVN.js +92 -0
- package/dist/chunk-VJQ7M2BK.js +7 -0
- package/dist/chunk-WDUQUPTE.js +7 -0
- package/dist/chunk-WTKIUAHI.js +7 -0
- package/dist/chunk-YHBJAXUY.js +7 -0
- package/dist/chunk-YSQDPG26.js +27 -0
- package/dist/chunk-YWUIJ6ZQ.js +83 -0
- package/dist/chunk-ZGNK4GWA.js +7 -0
- package/dist/{chunk-XQ3GUEBN.js → chunk-ZQEB3Y3X.js} +8 -9
- package/dist/{chunk-7QUHQYCR.js → chunk-ZWU6DRRZ.js} +1 -1
- package/dist/errorMessage/src/ErrorMessage.css +102 -0
- package/dist/errorMessage/src/ErrorMessage.d.ts +20 -0
- package/dist/errorMessage/src/ErrorMessage.js +9 -0
- package/dist/errorMessage/src/ErrorMessageContext.d.ts +9 -0
- package/dist/errorMessage/src/ErrorMessageContext.js +2 -0
- package/dist/errorMessage/src/index.css +102 -0
- package/dist/errorMessage/src/index.d.ts +6 -0
- package/dist/errorMessage/src/index.js +9 -0
- package/dist/helperMessage/src/HelperMessage.css +94 -0
- package/dist/helperMessage/src/HelperMessage.d.ts +20 -0
- package/dist/helperMessage/src/HelperMessage.js +8 -0
- package/dist/helperMessage/src/HelperMessageContext.d.ts +9 -0
- package/dist/helperMessage/src/HelperMessageContext.js +2 -0
- package/dist/helperMessage/src/index.css +94 -0
- package/dist/helperMessage/src/index.d.ts +6 -0
- package/dist/helperMessage/src/index.js +8 -0
- package/dist/{intl → i18n}/src/index.d.ts +1 -0
- package/dist/i18n/src/index.js +2 -0
- package/dist/i18n/src/useLocalizedString.d.ts +9 -0
- package/dist/i18n/src/useLocalizedString.js +2 -0
- package/dist/layout/src/Flex.js +1 -0
- package/dist/layout/src/Grid.js +1 -1
- package/dist/layout/src/Inline.js +1 -0
- package/dist/layout/src/Stack.js +1 -0
- package/dist/radio/src/Radio.css +293 -0
- package/dist/radio/src/Radio.d.ts +20 -0
- package/dist/radio/src/Radio.js +11 -0
- package/dist/radio/src/RadioContext.d.ts +8 -0
- package/dist/radio/src/RadioContext.js +2 -0
- package/dist/radio/src/RadioField.css +119 -0
- package/dist/radio/src/RadioField.d.ts +26 -0
- package/dist/radio/src/RadioField.js +7 -0
- package/dist/radio/src/RadioFieldContext.d.ts +10 -0
- package/dist/radio/src/RadioFieldContext.js +2 -0
- package/dist/radio/src/RadioGroup.css +570 -0
- package/dist/radio/src/RadioGroup.d.ts +30 -0
- package/dist/radio/src/RadioGroup.js +12 -0
- package/dist/radio/src/RadioGroupContext.d.ts +8 -0
- package/dist/radio/src/RadioGroupContext.js +2 -0
- package/dist/radio/src/RadioList.d.ts +17 -0
- package/dist/radio/src/RadioList.js +3 -0
- package/dist/radio/src/RadioListContext.d.ts +10 -0
- package/dist/radio/src/RadioListContext.js +2 -0
- package/dist/radio/src/index.css +570 -0
- package/dist/radio/src/index.d.ts +13 -0
- package/dist/radio/src/index.js +20 -0
- package/dist/switch/src/Switch.css +236 -0
- package/dist/switch/src/Switch.d.ts +20 -0
- package/dist/switch/src/Switch.js +11 -0
- package/dist/switch/src/SwitchContext.d.ts +8 -0
- package/dist/switch/src/SwitchContext.js +2 -0
- package/dist/switch/src/SwitchField.css +119 -0
- package/dist/switch/src/SwitchField.d.ts +26 -0
- package/dist/switch/src/SwitchField.js +7 -0
- package/dist/switch/src/SwitchFieldContext.d.ts +10 -0
- package/dist/switch/src/SwitchFieldContext.js +2 -0
- package/dist/switch/src/index.css +276 -0
- package/dist/switch/src/index.d.ts +9 -0
- package/dist/switch/src/index.js +13 -0
- package/dist/utils/src/ClearSlots.d.ts +28 -0
- package/dist/utils/src/ClearSlots.js +2 -0
- package/dist/utils/src/SlotProvider.js +1 -0
- package/dist/utils/src/composeClassnameRenderProps.js +2 -0
- package/dist/utils/src/cssModule.js +2 -0
- package/dist/utils/src/index.d.ts +11 -6
- package/dist/utils/src/index.js +8 -4
- package/dist/utils/src/isTextOnlyChildren.js +2 -0
- package/dist/utils/src/{size-adapter.d.ts → sizeAdapter.d.ts} +1 -1
- package/dist/utils/src/sizeAdapter.js +1 -0
- package/dist/utils/src/types.d.ts +17 -5
- package/dist/utils/src/useRenderProps.d.ts +843 -0
- package/dist/utils/src/useRenderProps.js +2 -0
- package/dist/utils/src/useSlot.d.ts +8 -0
- package/dist/utils/src/useSlot.js +2 -0
- package/package.json +32 -27
- package/dist/chunk-GXUPEV64.js +0 -24
- package/dist/chunk-WROQHGG5.js +0 -141
- package/dist/chunk-WRWNRVTG.js +0 -47
- package/dist/intl/src/index.js +0 -1
- package/dist/intl/src/useLocalizedString.d.ts +0 -26
- package/dist/intl/src/useLocalizedString.js +0 -1
- package/dist/utils/src/compose-classname-render-props.js +0 -1
- package/dist/utils/src/css-module.js +0 -1
- package/dist/utils/src/is-text-only-children.js +0 -1
- package/dist/utils/src/size-adapter.js +0 -1
- /package/dist/{chunk-D57ZIX5W.js → chunk-LQICWONC.js} +0 -0
- /package/dist/utils/src/{compose-classname-render-props.d.ts → composeClassnameRenderProps.d.ts} +0 -0
- /package/dist/utils/src/{css-module.d.ts → cssModule.d.ts} +0 -0
- /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 {
|
|
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" | "
|
|
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
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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<
|
|
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-
|
|
2
|
-
import '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
4
|
-
import '../../chunk-
|
|
5
|
-
import '../../chunk-
|
|
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-
|
|
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-
|
|
13
|
-
import '../../chunk-
|
|
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
|
-
|
|
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 };
|
|
@@ -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 };
|