@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.
- 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 +4 -4
- package/dist/IconList/src/IconList.js +2 -1
- package/dist/IconList/src/IconListContext.js +1 -0
- package/dist/IconList/src/index.css +4 -4
- package/dist/IconList/src/index.js +2 -1
- package/dist/Label/src/Label.css +11 -11
- package/dist/Label/src/Label.js +2 -1
- package/dist/Label/src/LabelContext.js +1 -0
- package/dist/Label/src/index.css +11 -11
- package/dist/Label/src/index.js +2 -1
- 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 +80 -80
- package/dist/Spinner/src/Spinner.d.ts +1 -0
- package/dist/Spinner/src/Spinner.js +3 -2
- package/dist/Spinner/src/SpinnerContext.js +1 -0
- package/dist/Spinner/src/index.css +80 -80
- package/dist/Spinner/src/index.js +3 -2
- package/dist/Text/src/Text.css +11 -11
- package/dist/Text/src/Text.d.ts +2 -3
- package/dist/Text/src/Text.js +4 -1
- package/dist/Text/src/TextContext.js +1 -0
- package/dist/Text/src/index.css +11 -11
- package/dist/Text/src/index.d.ts +1 -1
- package/dist/Text/src/index.js +4 -1
- package/dist/buttons/src/Button.css +557 -358
- package/dist/buttons/src/Button.d.ts +15 -10
- package/dist/buttons/src/Button.js +12 -8
- 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 +557 -358
- package/dist/buttons/src/index.d.ts +2 -1
- package/dist/buttons/src/index.js +12 -8
- 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-3FT5XSWV.js +124 -0
- package/dist/chunk-3KIUEBO3.js +69 -0
- package/dist/chunk-3LRBUQC2.js +43 -0
- package/dist/chunk-4VVNSXIB.js +7 -0
- package/dist/chunk-5MBJWRZD.js +7 -0
- package/dist/chunk-6EMOC7TA.js +83 -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-BIVAOAN2.js +101 -0
- package/dist/chunk-BPM4ETTB.js +35 -0
- package/dist/chunk-CE3ABLD2.js +92 -0
- package/dist/chunk-CJFCOPMQ.js +57 -0
- package/dist/chunk-DGLAGYBD.js +7 -0
- package/dist/chunk-EADFYPVX.js +93 -0
- package/dist/chunk-ESVVLTEN.js +7 -0
- package/dist/chunk-FD4HMY5A.js +91 -0
- package/dist/chunk-FU5CCPLP.js +7 -0
- package/dist/{chunk-JGYEQS4H.js → chunk-G7RKLBFT.js} +7 -7
- package/dist/chunk-H234F7HP.js +83 -0
- package/dist/chunk-H5YTU3U7.js +20 -0
- package/dist/chunk-H7VJS4MX.js +7 -0
- package/dist/chunk-HUJ3PTM7.js +58 -0
- package/dist/chunk-HXI3MEEK.js +27 -0
- package/dist/chunk-KKFX7YII.js +83 -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-SC4G54ML.js +186 -0
- package/dist/{chunk-CMJUZLSA.js → chunk-TRS7R4W3.js} +7 -7
- package/dist/chunk-VJQ7M2BK.js +7 -0
- package/dist/chunk-VYNBJRJW.js +101 -0
- package/dist/chunk-WDUQUPTE.js +7 -0
- package/dist/chunk-WTKIUAHI.js +7 -0
- package/dist/{chunk-A2IN7HC4.js → chunk-YFTLWL74.js} +8 -9
- package/dist/chunk-YHBJAXUY.js +7 -0
- package/dist/chunk-YSQDPG26.js +27 -0
- package/dist/chunk-ZGNK4GWA.js +7 -0
- package/dist/chunk-ZUMAL5WB.js +104 -0
- 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 +1 -0
- package/dist/utils/src/cssModule.js +1 -0
- package/dist/utils/src/index.d.ts +7 -2
- package/dist/utils/src/index.js +5 -1
- package/dist/utils/src/isTextOnlyChildren.js +1 -0
- package/dist/utils/src/sizeAdapter.d.ts +1 -1
- 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-TNWWLZEQ.js +0 -47
- package/dist/chunk-Z34Z6LYX.js +0 -141
- 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
|
@@ -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-G7RKLBFT.js';
|
|
7
|
+
import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
|
|
8
|
+
import { _Text } from './chunk-HUJ3PTM7.js';
|
|
9
|
+
import { TextContext } from './chunk-OE5BLFZI.js';
|
|
10
|
+
import { cssModule } from './chunk-KVDXQMWI.js';
|
|
11
|
+
import { SlotProvider } from './chunk-M36KANKC.js';
|
|
12
|
+
import { IconListContext } from './chunk-DHVVYSLB.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___pJ-SR", "hop-Button--icon-only": "Button-module__hop-Button--icon-only___vCgE0", "hop-Button--fluid": "Button-module__hop-Button--fluid___Ap2-3", "hop-Button--sm": "Button-module__hop-Button--sm___wbnfe", "hop-Button--primary": "Button-module__hop-Button--primary___OEdwW", "hop-Button--md": "Button-module__hop-Button--md___QAIfm", "hop-Button--secondary": "Button-module__hop-Button--secondary___ZCS63", "hop-Button--upsell": "Button-module__hop-Button--upsell___E3SYs", "hop-Button--danger": "Button-module__hop-Button--danger___ZOfPR", "hop-Button--ghost-danger": "Button-module__hop-Button--ghost-danger___rYkpH", "hop-Button--ghost-secondary": "Button-module__hop-Button--ghost-secondary___zCDkm", "hop-Button--ghost-primary": "Button-module__hop-Button--ghost-primary___tnrgb", "hop-Button__Spinner": "Button-module__hop-Button__Spinner___O6HR8", "hop-Button__icon": "Button-module__hop-Button__icon___rLXPv", "hop-Button__icon-list": "Button-module__hop-Button__icon-list___RGTNp", "hop-Button__text": "Button-module__hop-Button__text___nIDoe", "hop-Button__end-icon": "Button-module__hop-Button__end-icon___-DwWE", "hop-Button__end-icon-list": "Button-module__hop-Button__end-icon-list___QHF2h" };
|
|
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 };
|
|
@@ -1,25 +1,25 @@
|
|
|
1
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
|
-
//
|
|
10
|
-
var
|
|
9
|
+
// css-module:./Label.module.css#css-module
|
|
10
|
+
var Label_module_default = { "hop-Label": "Label-module__hop-Label___qOIKf", "hop-Label--xs": "Label-module__hop-Label--xs___YPM1S", "hop-Label--sm": "Label-module__hop-Label--sm___uUjjd", "hop-Label--md": "Label-module__hop-Label--md___q3H4q", "hop-Label--lg": "Label-module__hop-Label--lg___xJQna", "hop-Label--xl": "Label-module__hop-Label--xl___eXF1C", "hop-Label--2xl": "Label-module__hop-Label--2xl___E1Iq6", "hop-Label--inherit": "Label-module__hop-Label--inherit___zl7QA" };
|
|
11
11
|
var GlobalLabelCssSelector = "hop-Label";
|
|
12
|
-
var DefaultLabelSlot = "label";
|
|
13
12
|
function Label(props, ref) {
|
|
14
|
-
|
|
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 ?
|
|
17
|
+
const size = (_a = useResponsiveValue(sizeProp)) != null ? _a : "md";
|
|
18
18
|
const classNames = clsx(
|
|
19
19
|
className,
|
|
20
20
|
GlobalLabelCssSelector,
|
|
21
21
|
cssModule(
|
|
22
|
-
|
|
22
|
+
Label_module_default,
|
|
23
23
|
"hop-Label",
|
|
24
24
|
size
|
|
25
25
|
),
|
|
@@ -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 { cssModule } from './chunk-KVDXQMWI.js';
|
|
9
|
+
import { LabelContext } from './chunk-HVKOIMMW.js';
|
|
10
|
+
import { SlotProvider } from './chunk-M36KANKC.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___nUraE", "hop-CheckboxGroup--bordered": "CheckboxGroup-module__hop-CheckboxGroup--bordered___icoNN", "hop-CheckboxGroup--sm": "CheckboxGroup-module__hop-CheckboxGroup--sm___4RB5I", "hop-CheckboxGroup--md": "CheckboxGroup-module__hop-CheckboxGroup--md___txX1B", "hop-CheckboxGroup__label": "CheckboxGroup-module__hop-CheckboxGroup__label___fAya3", "hop-CheckboxGroup__list": "CheckboxGroup-module__hop-CheckboxGroup__list___EPjvT", "hop-CheckboxGroup__checkbox": "CheckboxGroup-module__hop-CheckboxGroup__checkbox___d2Pv-", "hop-CheckboxGroup__error-message": "CheckboxGroup-module__hop-CheckboxGroup__error-message___t04hF", "hop-CheckboxGroup__helper-message": "CheckboxGroup-module__hop-CheckboxGroup__helper-message___w-9RG" };
|
|
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,24 +1,23 @@
|
|
|
1
1
|
import { SlotProvider } from './chunk-M36KANKC.js';
|
|
2
2
|
import { IconListContext } from './chunk-DHVVYSLB.js';
|
|
3
|
-
import { useContextProps } from 'react-aria-components';
|
|
4
|
-
import { forwardRef } from 'react';
|
|
5
|
-
import clsx from 'clsx';
|
|
6
|
-
import { useStyledSystem } from '@hopper-ui/styled-system';
|
|
7
3
|
import { IconContext } from '@hopper-ui/icons';
|
|
4
|
+
import { useStyledSystem } from '@hopper-ui/styled-system';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
import { forwardRef } from 'react';
|
|
7
|
+
import { useContextProps } from 'react-aria-components';
|
|
8
8
|
import { jsx } from 'react/jsx-runtime';
|
|
9
9
|
|
|
10
|
-
//
|
|
11
|
-
var
|
|
10
|
+
// css-module:./IconList.module.css#css-module
|
|
11
|
+
var IconList_module_default = { "hop-IconList": "IconList-module__hop-IconList___xoL0K" };
|
|
12
12
|
var GlobalIconListCssSelector = "hop-IconList";
|
|
13
|
-
var DefaultIconListSlot = "icon";
|
|
14
13
|
function IconList(props, ref) {
|
|
15
|
-
[props, ref] = useContextProps(
|
|
14
|
+
[props, ref] = useContextProps(props, ref, IconListContext);
|
|
16
15
|
const { stylingProps, ...ownProps } = useStyledSystem(props);
|
|
17
16
|
const { children, style, className, slot, size, ...otherProps } = ownProps;
|
|
18
17
|
const classNames = clsx(
|
|
19
18
|
className,
|
|
20
19
|
GlobalIconListCssSelector,
|
|
21
|
-
|
|
20
|
+
IconList_module_default["hop-IconList"],
|
|
22
21
|
stylingProps.className
|
|
23
22
|
);
|
|
24
23
|
const mergedStyles = {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
8
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
19
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
20
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
21
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
22
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
23
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
24
|
+
mod
|
|
25
|
+
));
|
|
26
|
+
|
|
27
|
+
export { __commonJS, __toESM };
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { ChipContext } from './chunk-WTKIUAHI.js';
|
|
2
|
+
import { isTextOnlyChildren } from './chunk-ZWU6DRRZ.js';
|
|
3
|
+
import { _Text } from './chunk-HUJ3PTM7.js';
|
|
4
|
+
import { TextContext } from './chunk-OE5BLFZI.js';
|
|
5
|
+
import { cssModule } from './chunk-KVDXQMWI.js';
|
|
6
|
+
import { SlotProvider } from './chunk-M36KANKC.js';
|
|
7
|
+
import { IconListContext } from './chunk-DHVVYSLB.js';
|
|
8
|
+
import { IconContext } from '@hopper-ui/icons';
|
|
9
|
+
import { useStyledSystem, useResponsiveValue } from '@hopper-ui/styled-system';
|
|
10
|
+
import clsx from 'clsx';
|
|
11
|
+
import { forwardRef } from 'react';
|
|
12
|
+
import { useContextProps, DEFAULT_SLOT } from 'react-aria-components';
|
|
13
|
+
import { jsx } from 'react/jsx-runtime';
|
|
14
|
+
|
|
15
|
+
// css-module:./Chip.module.css#css-module
|
|
16
|
+
var Chip_module_default = { "hop-Chip": "Chip-module__hop-Chip___ow5yy", "hop-Chip--xs": "Chip-module__hop-Chip--xs___y91c1", "hop-Chip--sm": "Chip-module__hop-Chip--sm___jdtD0", "hop-Chip--md": "Chip-module__hop-Chip--md___vOUpq", "hop-Chip--lg": "Chip-module__hop-Chip--lg___ksHhv", "hop-Chip--neutral": "Chip-module__hop-Chip--neutral___-l3Wj", "hop-Chip--progress": "Chip-module__hop-Chip--progress___mHQ8v", "hop-Chip--positive": "Chip-module__hop-Chip--positive___cd2-6", "hop-Chip--caution": "Chip-module__hop-Chip--caution___reN8y", "hop-Chip--negative": "Chip-module__hop-Chip--negative___VDivs", "hop-Chip--option1": "Chip-module__hop-Chip--option1___OUGGx", "hop-Chip--option2": "Chip-module__hop-Chip--option2___X--Uy", "hop-Chip--option3": "Chip-module__hop-Chip--option3___mEuhz", "hop-Chip--option4": "Chip-module__hop-Chip--option4___kSZqI", "hop-Chip--option5": "Chip-module__hop-Chip--option5___O9YoG", "hop-Chip--option6": "Chip-module__hop-Chip--option6___pAhUG", "hop-Chip--inactive": "Chip-module__hop-Chip--inactive___KcvEd", "hop-Chip--disabled": "Chip-module__hop-Chip--disabled___VXInB", "hop-Chip__icon": "Chip-module__hop-Chip__icon___4AD0Y", "hop-Chip__icon-list": "Chip-module__hop-Chip__icon-list___hyYls", "hop-Chip__text": "Chip-module__hop-Chip__text___ABDy4", "hop-Chip__end-icon": "Chip-module__hop-Chip__end-icon___98iKE", "hop-Chip__end-icon-list": "Chip-module__hop-Chip__end-icon-list___aiiqm" };
|
|
17
|
+
var GlobalChipCssSelector = "hop-Chip";
|
|
18
|
+
var ChipToTextSizeAdapter = {
|
|
19
|
+
xs: "xs",
|
|
20
|
+
sm: "xs",
|
|
21
|
+
md: "xs",
|
|
22
|
+
lg: "sm"
|
|
23
|
+
};
|
|
24
|
+
function Chip(props, ref) {
|
|
25
|
+
var _a;
|
|
26
|
+
[props, ref] = useContextProps(props, ref, ChipContext);
|
|
27
|
+
const { stylingProps, ...ownProps } = useStyledSystem(props);
|
|
28
|
+
const {
|
|
29
|
+
className,
|
|
30
|
+
children,
|
|
31
|
+
size: sizeProp,
|
|
32
|
+
style,
|
|
33
|
+
slot,
|
|
34
|
+
variant = "neutral",
|
|
35
|
+
...otherProps
|
|
36
|
+
} = ownProps;
|
|
37
|
+
const size = (_a = useResponsiveValue(sizeProp)) != null ? _a : "md";
|
|
38
|
+
const classNames = clsx(
|
|
39
|
+
className,
|
|
40
|
+
GlobalChipCssSelector,
|
|
41
|
+
cssModule(
|
|
42
|
+
Chip_module_default,
|
|
43
|
+
"hop-Chip",
|
|
44
|
+
size,
|
|
45
|
+
variant
|
|
46
|
+
),
|
|
47
|
+
stylingProps.className
|
|
48
|
+
);
|
|
49
|
+
const mergedStyles = {
|
|
50
|
+
...stylingProps.style,
|
|
51
|
+
...style
|
|
52
|
+
};
|
|
53
|
+
const content = children && isTextOnlyChildren(children) ? /* @__PURE__ */ jsx(_Text, { children }) : children;
|
|
54
|
+
return /* @__PURE__ */ jsx(
|
|
55
|
+
SlotProvider,
|
|
56
|
+
{
|
|
57
|
+
values: [
|
|
58
|
+
[TextContext, {
|
|
59
|
+
className: Chip_module_default["hop-Chip__text"],
|
|
60
|
+
size: ChipToTextSizeAdapter[size]
|
|
61
|
+
}],
|
|
62
|
+
[IconListContext, {
|
|
63
|
+
slots: {
|
|
64
|
+
[DEFAULT_SLOT]: {
|
|
65
|
+
size: "sm",
|
|
66
|
+
className: Chip_module_default["hop-Chip__icon-list"]
|
|
67
|
+
},
|
|
68
|
+
"end-icon": {
|
|
69
|
+
size: "sm",
|
|
70
|
+
className: Chip_module_default["hop-Chip__end-icon-list"]
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}],
|
|
74
|
+
[IconContext, {
|
|
75
|
+
slots: {
|
|
76
|
+
[DEFAULT_SLOT]: {
|
|
77
|
+
size: "sm",
|
|
78
|
+
className: Chip_module_default["hop-Chip__icon"]
|
|
79
|
+
},
|
|
80
|
+
"end-icon": {
|
|
81
|
+
size: "sm",
|
|
82
|
+
className: Chip_module_default["hop-Chip__end-icon"]
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}]
|
|
86
|
+
],
|
|
87
|
+
children: /* @__PURE__ */ jsx(
|
|
88
|
+
"span",
|
|
89
|
+
{
|
|
90
|
+
...otherProps,
|
|
91
|
+
ref,
|
|
92
|
+
className: classNames,
|
|
93
|
+
style: mergedStyles,
|
|
94
|
+
slot: slot != null ? slot : void 0,
|
|
95
|
+
children: content
|
|
96
|
+
}
|
|
97
|
+
)
|
|
98
|
+
}
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
var _Chip = forwardRef(Chip);
|
|
102
|
+
_Chip.displayName = "Chip";
|
|
103
|
+
|
|
104
|
+
export { GlobalChipCssSelector, _Chip };
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/* css-module:/home/runner/work/wl-hopper/wl-hopper/packages/components/src/Text/src/Text.module.css/#css-module-data */
|
|
2
|
+
.Text-module__hop-Text___eHjGr {
|
|
3
|
+
--hop-Text-xs-font-size: var(--hop-body-xs-font-size);
|
|
4
|
+
--hop-Text-xs-font-family: var(--hop-body-xs-font-family);
|
|
5
|
+
--hop-Text-xs-font-weight: var(--hop-body-xs-font-weight);
|
|
6
|
+
--hop-Text-xs-line-height: var(--hop-body-xs-line-height);
|
|
7
|
+
--hop-Text-sm-font-size: var(--hop-body-sm-font-size);
|
|
8
|
+
--hop-Text-sm-font-family: var(--hop-body-sm-font-family);
|
|
9
|
+
--hop-Text-sm-font-weight: var(--hop-body-sm-font-weight);
|
|
10
|
+
--hop-Text-sm-line-height: var(--hop-body-sm-line-height);
|
|
11
|
+
--hop-Text-md-font-size: var(--hop-body-md-font-size);
|
|
12
|
+
--hop-Text-md-font-family: var(--hop-body-md-font-family);
|
|
13
|
+
--hop-Text-md-font-weight: var(--hop-body-md-font-weight);
|
|
14
|
+
--hop-Text-md-line-height: var(--hop-body-md-line-height);
|
|
15
|
+
--hop-Text-lg-font-size: var(--hop-body-lg-font-size);
|
|
16
|
+
--hop-Text-lg-font-family: var(--hop-body-lg-font-family);
|
|
17
|
+
--hop-Text-lg-font-weight: var(--hop-body-lg-font-weight);
|
|
18
|
+
--hop-Text-lg-line-height: var(--hop-body-lg-line-height);
|
|
19
|
+
--hop-Text-xl-font-size: var(--hop-body-xl-font-size);
|
|
20
|
+
--hop-Text-xl-font-family: var(--hop-body-xl-font-family);
|
|
21
|
+
--hop-Text-xl-font-weight: var(--hop-body-xl-font-weight);
|
|
22
|
+
--hop-Text-xl-line-height: var(--hop-body-xl-line-height);
|
|
23
|
+
--hop-Text-2xl-font-size: var(--hop-body-2xl-font-size);
|
|
24
|
+
--hop-Text-2xl-font-family: var(--hop-body-2xl-font-family);
|
|
25
|
+
--hop-Text-2xl-font-weight: var(--hop-body-2xl-font-weight);
|
|
26
|
+
--hop-Text-2xl-line-height: var(--hop-body-2xl-line-height);
|
|
27
|
+
--hop-Text-inherit-size-font-size: inherit;
|
|
28
|
+
--hop-Text-inherit-size-font-family: inherit;
|
|
29
|
+
--hop-Text-inherit-size-font-weight: inherit;
|
|
30
|
+
--hop-Text-inherit-size-line-height: inherit;
|
|
31
|
+
}
|
|
32
|
+
:where(.Text-module__hop-Text___eHjGr) {
|
|
33
|
+
font-family: var(--font-family);
|
|
34
|
+
font-size: var(--font-size);
|
|
35
|
+
font-weight: var(--font-weight);
|
|
36
|
+
line-height: var(--line-height);
|
|
37
|
+
}
|
|
38
|
+
:where(.Text-module__hop-Text--xs___6lQf3) {
|
|
39
|
+
--font-size: var(--hop-Text-xs-font-size);
|
|
40
|
+
--font-family: var(--hop-Text-xs-font-family);
|
|
41
|
+
--font-weight: var(--hop-Text-xs-font-weight);
|
|
42
|
+
--line-height: var(--hop-Text-xs-line-height);
|
|
43
|
+
}
|
|
44
|
+
:where(.Text-module__hop-Text--sm___79uWV) {
|
|
45
|
+
--font-size: var(--hop-Text-sm-font-size);
|
|
46
|
+
--font-family: var(--hop-Text-sm-font-family);
|
|
47
|
+
--font-weight: var(--hop-Text-sm-font-weight);
|
|
48
|
+
--line-height: var(--hop-Text-sm-line-height);
|
|
49
|
+
}
|
|
50
|
+
:where(.Text-module__hop-Text--md___kaNdx) {
|
|
51
|
+
--font-size: var(--hop-Text-md-font-size);
|
|
52
|
+
--font-family: var(--hop-Text-md-font-family);
|
|
53
|
+
--font-weight: var(--hop-Text-md-font-weight);
|
|
54
|
+
--line-height: var(--hop-Text-md-line-height);
|
|
55
|
+
}
|
|
56
|
+
:where(.Text-module__hop-Text--lg___DD3l0) {
|
|
57
|
+
--font-size: var(--hop-Text-lg-font-size);
|
|
58
|
+
--font-family: var(--hop-Text-lg-font-family);
|
|
59
|
+
--font-weight: var(--hop-Text-lg-font-weight);
|
|
60
|
+
--line-height: var(--hop-Text-lg-line-height);
|
|
61
|
+
}
|
|
62
|
+
:where(.Text-module__hop-Text--xl___CU19-) {
|
|
63
|
+
--font-size: var(--hop-Text-xl-font-size);
|
|
64
|
+
--font-family: var(--hop-Text-xl-font-family);
|
|
65
|
+
--font-weight: var(--hop-Text-xl-font-weight);
|
|
66
|
+
--line-height: var(--hop-Text-xl-line-height);
|
|
67
|
+
}
|
|
68
|
+
:where(.Text-module__hop-Text--2xl___Zif3-) {
|
|
69
|
+
--font-size: var(--hop-Text-2xl-font-size);
|
|
70
|
+
--font-family: var(--hop-Text-2xl-font-family);
|
|
71
|
+
--font-weight: var(--hop-Text-2xl-font-weight);
|
|
72
|
+
--line-height: var(--hop-Text-2xl-line-height);
|
|
73
|
+
}
|
|
74
|
+
:where(.Text-module__hop-Text--inherit___NWdla) {
|
|
75
|
+
--font-size: var(--hop-Text-inherit-size-font-size);
|
|
76
|
+
--font-family: var(--hop-Text-inherit-size-font-family);
|
|
77
|
+
--font-weight: var(--hop-Text-inherit-size-font-weight);
|
|
78
|
+
--line-height: var(--hop-Text-inherit-size-line-height);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* css-module:/home/runner/work/wl-hopper/wl-hopper/packages/components/src/errorMessage/src/ErrorMessage.module.css/#css-module-data */
|
|
82
|
+
.ErrorMessage-module__hop-ErrorMessage___rzxzc {
|
|
83
|
+
--hop-ErrorMessage-color: var(--hop-danger-text-weak);
|
|
84
|
+
--hop-ErrorMessage-font-family: var(--hop-body-xs-font-family);
|
|
85
|
+
--hop-ErrorMessage-font-size: var(--hop-body-xs-font-size);
|
|
86
|
+
--hop-ErrorMessage-font-weight: var(--hop-body-xs-font-weight);
|
|
87
|
+
--hop-ErrorMessage-line-height: var(--hop-body-xs-line-height);
|
|
88
|
+
--hop-ErrorMessage-column-gap: var(--hop-space-inline-xs);
|
|
89
|
+
display: flex;
|
|
90
|
+
column-gap: var(--hop-ErrorMessage-column-gap);
|
|
91
|
+
align-items: center;
|
|
92
|
+
box-sizing: border-box;
|
|
93
|
+
font-family: var(--hop-ErrorMessage-font-family);
|
|
94
|
+
font-size: var(--hop-ErrorMessage-font-size);
|
|
95
|
+
font-weight: var(--hop-ErrorMessage-font-weight);
|
|
96
|
+
line-height: var(--hop-ErrorMessage-line-height);
|
|
97
|
+
color: var(--hop-ErrorMessage-color);
|
|
98
|
+
}
|
|
99
|
+
.ErrorMessage-module__hop-ErrorMessage__icon___XMlVC {
|
|
100
|
+
flex: 0 0 auto;
|
|
101
|
+
align-self: flex-start;
|
|
102
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { StyledComponentProps } from '@hopper-ui/styled-system';
|
|
3
|
+
import { FieldErrorProps } from 'react-aria-components';
|
|
4
|
+
import { TextProps } from '../../Text/src/Text.js';
|
|
5
|
+
|
|
6
|
+
declare const GlobalErrorMessageCssSelector = "hop-ErrorMessage";
|
|
7
|
+
interface ErrorMessageProps extends StyledComponentProps<FieldErrorProps>, Omit<TextProps, "style" | "className" | "children" | "color" | "content"> {
|
|
8
|
+
/**
|
|
9
|
+
* Whether or not to hide the error message icon.
|
|
10
|
+
*/
|
|
11
|
+
hideIcon?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* An ErrorMessage displays validation errors for a form field.
|
|
15
|
+
*
|
|
16
|
+
* [View Documentation](TODO)
|
|
17
|
+
*/
|
|
18
|
+
declare const _ErrorMessage: react.ForwardRefExoticComponent<ErrorMessageProps & react.RefAttributes<HTMLSpanElement>>;
|
|
19
|
+
|
|
20
|
+
export { _ErrorMessage as ErrorMessage, type ErrorMessageProps, GlobalErrorMessageCssSelector };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { _ErrorMessage as ErrorMessage, GlobalErrorMessageCssSelector } from '../../chunk-3KIUEBO3.js';
|
|
2
|
+
import '../../chunk-ACVMW6YD.js';
|
|
3
|
+
import '../../chunk-NH3IVMXB.js';
|
|
4
|
+
import '../../chunk-HUJ3PTM7.js';
|
|
5
|
+
import '../../chunk-HXI3MEEK.js';
|
|
6
|
+
import '../../chunk-OE5BLFZI.js';
|
|
7
|
+
import '../../chunk-KVDXQMWI.js';
|
|
8
|
+
import '../../chunk-M36KANKC.js';
|
|
9
|
+
import '../../chunk-YSQDPG26.js';
|