@hopper-ui/components 1.0.6 → 1.0.8
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 +12 -0
- package/dist/Avatar/src/AnonymousAvatar.css +10 -10
- package/dist/Avatar/src/AnonymousAvatar.js +3 -3
- package/dist/Avatar/src/Avatar.css +37 -37
- package/dist/Avatar/src/Avatar.js +5 -5
- package/dist/Avatar/src/AvatarContext.js +1 -1
- package/dist/Avatar/src/DeletedAvatar.css +10 -10
- package/dist/Avatar/src/DeletedAvatar.js +3 -3
- package/dist/Avatar/src/RichIconAvatarImage.css +10 -10
- package/dist/Avatar/src/RichIconAvatarImage.js +2 -2
- package/dist/Avatar/src/RichIconAvatarImageContext.js +1 -1
- package/dist/Avatar/src/index.css +37 -37
- package/dist/Avatar/src/index.js +7 -7
- package/dist/Avatar/src/useImageFallback.js +1 -1
- package/dist/Badge/src/Badge.css +10 -10
- package/dist/Badge/src/Badge.js +3 -3
- package/dist/Badge/src/BadgeContext.js +1 -1
- package/dist/Badge/src/index.css +10 -10
- package/dist/Badge/src/index.js +3 -3
- package/dist/Chip/src/Chip.css +33 -33
- package/dist/Chip/src/Chip.js +3 -3
- package/dist/Chip/src/ChipContext.js +1 -1
- package/dist/Chip/src/index.css +33 -33
- package/dist/Chip/src/index.js +3 -3
- package/dist/Divider/src/Divider.css +2 -2
- package/dist/Divider/src/Divider.js +2 -2
- package/dist/Divider/src/DividerContext.js +1 -1
- package/dist/Divider/src/index.css +2 -2
- package/dist/Divider/src/index.js +2 -2
- package/dist/ErrorMessage/src/ErrorMessage.css +11 -11
- package/dist/ErrorMessage/src/ErrorMessage.js +3 -3
- package/dist/ErrorMessage/src/ErrorMessageContext.js +1 -1
- package/dist/ErrorMessage/src/index.css +11 -11
- package/dist/ErrorMessage/src/index.js +3 -3
- package/dist/Header/src/Header.js +1 -1
- package/dist/Header/src/HeaderContext.js +1 -1
- package/dist/Header/src/index.js +1 -1
- package/dist/HelperMessage/src/HelperMessage.css +11 -11
- package/dist/HelperMessage/src/HelperMessage.js +3 -3
- package/dist/HelperMessage/src/HelperMessageContext.js +1 -1
- package/dist/HelperMessage/src/index.css +11 -11
- package/dist/HelperMessage/src/index.js +3 -3
- package/dist/HopperProvider/src/HopperProvider.js +1 -1
- package/dist/HopperProvider/src/index.js +1 -1
- package/dist/IconList/src/IconList.css +1 -1
- package/dist/IconList/src/IconList.js +2 -2
- package/dist/IconList/src/IconListContext.js +1 -1
- package/dist/IconList/src/index.css +1 -1
- package/dist/IconList/src/index.js +2 -2
- package/dist/Link/src/Link.css +31 -31
- package/dist/Link/src/Link.js +3 -3
- package/dist/Link/src/LinkContext.js +1 -1
- package/dist/Link/src/index.css +31 -31
- package/dist/Link/src/index.js +3 -3
- package/dist/ListBox/src/ListBox.css +175 -175
- package/dist/ListBox/src/ListBox.js +12 -12
- package/dist/ListBox/src/ListBoxContext.js +1 -1
- package/dist/ListBox/src/ListBoxItem.css +160 -160
- package/dist/ListBox/src/ListBoxItem.js +11 -11
- package/dist/ListBox/src/ListBoxItemContext.js +1 -1
- package/dist/ListBox/src/ListBoxItemSkeleton.css +7 -7
- package/dist/ListBox/src/ListBoxItemSkeleton.js +2 -2
- package/dist/ListBox/src/ListBoxItemSkeletonContext.js +1 -1
- package/dist/ListBox/src/index.css +175 -175
- package/dist/ListBox/src/index.js +12 -12
- package/dist/ListBox/src/useLoadOnScroll.js +1 -1
- package/dist/Section/src/Section.js +1 -1
- package/dist/Section/src/SectionContext.js +1 -1
- package/dist/Section/src/index.js +1 -1
- package/dist/Spinner/src/Spinner.css +19 -19
- package/dist/Spinner/src/Spinner.js +3 -3
- package/dist/Spinner/src/SpinnerContext.js +1 -1
- package/dist/Spinner/src/index.css +19 -19
- package/dist/Spinner/src/index.js +3 -3
- package/dist/buttons/src/Button.css +103 -103
- package/dist/buttons/src/Button.js +6 -6
- package/dist/buttons/src/ButtonContext.js +1 -1
- package/dist/buttons/src/ButtonGroup.css +11 -11
- package/dist/buttons/src/ButtonGroup.js +2 -2
- package/dist/buttons/src/ButtonGroupContext.js +1 -1
- package/dist/buttons/src/ClearButton.css +12 -12
- package/dist/buttons/src/ClearButton.js +4 -4
- package/dist/buttons/src/ClearButtonContext.js +1 -1
- package/dist/buttons/src/EmbeddedButton.css +12 -12
- package/dist/buttons/src/EmbeddedButton.js +2 -2
- package/dist/buttons/src/EmbeddedButtonContext.js +1 -1
- package/dist/buttons/src/index.css +126 -126
- package/dist/buttons/src/index.js +9 -9
- package/dist/checkbox/src/Checkbox.css +31 -31
- package/dist/checkbox/src/Checkbox.js +3 -3
- package/dist/checkbox/src/CheckboxContext.js +1 -1
- package/dist/checkbox/src/CheckboxField.css +15 -15
- package/dist/checkbox/src/CheckboxField.js +2 -2
- package/dist/checkbox/src/CheckboxFieldContext.js +1 -1
- package/dist/checkbox/src/CheckboxGroup.css +66 -66
- package/dist/checkbox/src/CheckboxGroup.js +4 -4
- package/dist/checkbox/src/CheckboxGroupContext.js +1 -1
- package/dist/checkbox/src/CheckboxList.js +1 -1
- package/dist/checkbox/src/CheckboxListContext.js +1 -1
- package/dist/checkbox/src/index.css +66 -66
- package/dist/checkbox/src/index.js +8 -8
- package/dist/{chunk-JUMJ6A3K.js → chunk-2O5GW4WZ.js} +1 -1
- package/dist/{chunk-BKC74M6Y.js → chunk-2PZTP7OD.js} +1 -1
- package/dist/{chunk-RG4JKE4N.js → chunk-375NGVSY.js} +1 -1
- package/dist/{chunk-SOSHKMNI.js → chunk-576NZEOZ.js} +2 -2
- package/dist/{chunk-E4WFKXW4.js → chunk-5YCINTI3.js} +4 -4
- package/dist/{chunk-J53HGLCT.js → chunk-6FJ6VT7L.js} +1 -1
- package/dist/{chunk-6QMIRVLY.js → chunk-7F63PQML.js} +1 -1
- package/dist/{chunk-E4ALW4MZ.js → chunk-B2NAEXNH.js} +9 -9
- package/dist/chunk-BHRRVORW.js +625 -0
- package/dist/{chunk-F2URSFJA.js → chunk-C5SNXNGO.js} +2 -2
- package/dist/{chunk-ITQK6JTD.js → chunk-DERV7IO4.js} +1 -1
- package/dist/{chunk-OHB5QR5P.js → chunk-FJYIXPAV.js} +2 -2
- package/dist/{chunk-RA7PM75O.js → chunk-FX7SCMAB.js} +5 -5
- package/dist/{chunk-XRC7XE6B.js → chunk-GEDAZSYP.js} +2 -2
- package/dist/{chunk-53FHDOG7.js → chunk-GVS7P3EP.js} +2 -2
- package/dist/{chunk-3LH2JHUO.js → chunk-HJGIOIZH.js} +3 -3
- package/dist/{chunk-4TXFHYHL.js → chunk-HK6NUAOU.js} +1 -1
- package/dist/{chunk-K4ZGI7DJ.js → chunk-IGDXWHDV.js} +1 -1
- package/dist/{chunk-QBCCF2C2.js → chunk-J3FFNHVC.js} +2 -2
- package/dist/{chunk-2P3A4VVY.js → chunk-JSBRDJBE.js} +1 -6
- package/dist/{chunk-MVRI6GLQ.js → chunk-JYS47NMI.js} +2 -2
- package/dist/{chunk-XGKPMLYD.js → chunk-KC5DWQN5.js} +4 -4
- package/dist/chunk-KUOVH2WS.js +57 -0
- package/dist/{chunk-P5CWOV3L.js → chunk-LAYIMWCS.js} +2 -2
- package/dist/{chunk-3A6TTZAA.js → chunk-LD4PHTV5.js} +1 -1
- package/dist/chunk-LJXTJRSB.js +1 -0
- package/dist/{chunk-HR25MLRP.js → chunk-LYGSWKBB.js} +1 -1
- package/dist/{chunk-2XUHTPCX.js → chunk-O3B5AAY5.js} +2 -2
- package/dist/{chunk-G242LPQE.js → chunk-PFQFQTAW.js} +2 -2
- package/dist/{chunk-V5GOY6TV.js → chunk-Q4P2MTYE.js} +1 -1
- package/dist/{chunk-37NW34QM.js → chunk-Q6XETWRV.js} +3 -3
- package/dist/chunk-QVK2N2AZ.js +119 -0
- package/dist/{chunk-MED2BIDV.js → chunk-RERJ4IWC.js} +1 -1
- package/dist/chunk-SVUAG4RI.js +156 -0
- package/dist/{chunk-RCX5B3S3.js → chunk-T3KA26BR.js} +1 -1
- package/dist/{chunk-4JAV3FIH.js → chunk-VILNMAVP.js} +2 -2
- package/dist/chunk-WWLAPWPS.js +118 -0
- package/dist/{chunk-JRDN364E.js → chunk-XGLY57N7.js} +2 -2
- package/dist/{chunk-ZOTVZM6F.js → chunk-YEYNRBMQ.js} +1 -1
- package/dist/{chunk-J33IFG4U.js → chunk-YORVWKUU.js} +1 -1
- package/dist/i18n/src/index.js +2 -2
- package/dist/i18n/src/useLocalizedString.js +2 -2
- package/dist/index.css +3297 -0
- package/dist/index.d.ts +113 -0
- package/dist/index.js +107 -0
- package/dist/inputs/src/InputGroup.css +12 -12
- package/dist/inputs/src/InputGroup.js +2 -2
- package/dist/inputs/src/InputGroupContext.js +1 -1
- package/dist/inputs/src/PasswordField.css +229 -2405
- package/dist/inputs/src/PasswordField.js +12 -91
- package/dist/inputs/src/PasswordFieldContext.js +1 -1
- package/dist/inputs/src/SearchField.css +235 -2390
- package/dist/inputs/src/SearchField.js +13 -90
- package/dist/inputs/src/SearchFieldContext.js +1 -1
- package/dist/inputs/src/TextField.css +230 -2402
- package/dist/inputs/src/TextField.js +14 -90
- package/dist/inputs/src/TextFieldContext.js +1 -1
- package/dist/inputs/src/index.css +219 -2302
- package/dist/inputs/src/index.js +17 -89
- package/dist/layout/src/Content.js +1 -1
- package/dist/layout/src/ContentContext.js +1 -1
- package/dist/layout/src/Flex.js +1 -1
- package/dist/layout/src/Footer.js +1 -1
- package/dist/layout/src/FooterContext.js +1 -1
- package/dist/layout/src/Grid.js +1 -1
- package/dist/layout/src/Inline.js +1 -1
- package/dist/layout/src/Stack.js +1 -1
- package/dist/layout/src/grid-helpers.js +1 -1
- package/dist/overlays/Popover/src/Popover.css +457 -457
- package/dist/overlays/Popover/src/Popover.js +54 -49
- package/dist/overlays/Popover/src/PopoverContext.js +1 -1
- package/dist/overlays/Popover/src/PopoverTrigger.js +1 -1
- package/dist/overlays/Popover/src/index.css +457 -457
- package/dist/overlays/Popover/src/index.js +54 -49
- package/dist/radio/src/Radio.css +31 -31
- package/dist/radio/src/Radio.js +3 -3
- package/dist/radio/src/RadioContext.js +1 -1
- package/dist/radio/src/RadioField.css +15 -15
- package/dist/radio/src/RadioField.js +2 -2
- package/dist/radio/src/RadioFieldContext.js +1 -1
- package/dist/radio/src/RadioGroup.css +66 -66
- package/dist/radio/src/RadioGroup.js +3 -3
- package/dist/radio/src/RadioGroupContext.js +1 -1
- package/dist/radio/src/RadioList.js +1 -1
- package/dist/radio/src/RadioListContext.js +1 -1
- package/dist/radio/src/index.css +66 -66
- package/dist/radio/src/index.js +6 -6
- package/dist/switch/src/Switch.css +25 -25
- package/dist/switch/src/Switch.js +3 -3
- package/dist/switch/src/SwitchContext.js +1 -1
- package/dist/switch/src/SwitchField.css +15 -15
- package/dist/switch/src/SwitchField.js +3 -3
- package/dist/switch/src/SwitchFieldContext.js +1 -1
- package/dist/switch/src/index.css +31 -31
- package/dist/switch/src/index.js +5 -5
- package/dist/tag/src/Tag.css +457 -457
- package/dist/tag/src/Tag.js +54 -49
- package/dist/tag/src/TagContext.js +1 -1
- package/dist/tag/src/TagGroup.css +28 -28
- package/dist/tag/src/TagGroup.js +4 -4
- package/dist/tag/src/TagGroupContext.js +1 -1
- package/dist/tag/src/TagList.js +1 -1
- package/dist/tag/src/TagListContext.js +1 -1
- package/dist/tag/src/index.css +457 -457
- package/dist/tag/src/index.js +54 -49
- package/dist/typography/Heading/src/Heading.css +9 -3222
- package/dist/typography/Heading/src/Heading.js +2 -100
- package/dist/typography/Heading/src/HeadingContext.js +1 -1
- package/dist/typography/Heading/src/index.css +9 -3222
- package/dist/typography/Heading/src/index.js +2 -100
- package/dist/typography/Label/src/Label.css +9 -9
- package/dist/typography/Label/src/Label.js +2 -2
- package/dist/typography/Label/src/LabelContext.js +1 -1
- package/dist/typography/Label/src/index.css +9 -9
- package/dist/typography/Label/src/index.js +2 -2
- package/dist/typography/OverlineText/src/OverlineText.css +6 -6
- package/dist/typography/OverlineText/src/OverlineText.js +2 -2
- package/dist/typography/OverlineText/src/OverlineTextContext.js +1 -1
- package/dist/typography/OverlineText/src/index.css +6 -6
- package/dist/typography/OverlineText/src/index.js +2 -2
- package/dist/typography/Text/src/Text.css +9 -9
- package/dist/typography/Text/src/Text.js +2 -2
- package/dist/typography/Text/src/TextContext.js +1 -1
- package/dist/typography/Text/src/index.css +9 -9
- package/dist/typography/Text/src/index.js +2 -2
- package/dist/utils/src/ClearSlots.js +1 -1
- package/dist/utils/src/SlotProvider.js +1 -1
- package/dist/utils/src/assertion.js +1 -1
- package/dist/utils/src/composeClassnameRenderProps.js +1 -1
- package/dist/utils/src/cssModule.js +1 -1
- package/dist/utils/src/index.js +1 -1
- package/dist/utils/src/isTextOnlyChildren.js +1 -1
- package/dist/utils/src/useRenderProps.js +1 -1
- package/dist/utils/src/useSlot.js +1 -1
- package/package.json +4 -2
- package/dist/chunk-BC5A7RHI.js +0 -1260
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { TextFieldContext } from './chunk-O4XPUINW.js';
|
|
2
|
+
import { _InputGroup } from './chunk-Q4P2MTYE.js';
|
|
3
|
+
import { _ClearButton } from './chunk-FJYIXPAV.js';
|
|
4
|
+
import { useLocalizedString } from './chunk-YEYNRBMQ.js';
|
|
5
|
+
import { LabelContext } from './chunk-QCA3ZR56.js';
|
|
6
|
+
import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
|
|
7
|
+
import { HelperMessageContext } from './chunk-HZKFQ33E.js';
|
|
8
|
+
import { ErrorMessageContext } from './chunk-FAE27DLF.js';
|
|
9
|
+
import { isTextOnlyChildren } from './chunk-ZWU6DRRZ.js';
|
|
10
|
+
import { _Text } from './chunk-375NGVSY.js';
|
|
11
|
+
import { TextContext } from './chunk-X6SER3TZ.js';
|
|
12
|
+
import { ClearContainerSlots } from './chunk-HXI3MEEK.js';
|
|
13
|
+
import { SlotProvider } from './chunk-M36KANKC.js';
|
|
14
|
+
import { cssModule } from './chunk-KVDXQMWI.js';
|
|
15
|
+
import { IconContext } from '@hopper-ui/icons';
|
|
16
|
+
import { useStyledSystem, useResponsiveValue } from '@hopper-ui/styled-system';
|
|
17
|
+
import { mergeRefs } from '@react-aria/utils';
|
|
18
|
+
import { useControlledState } from '@react-stately/utils';
|
|
19
|
+
import { forwardRef, useState, useCallback } from 'react';
|
|
20
|
+
import { useObjectRef } from 'react-aria';
|
|
21
|
+
import { useContextProps, composeRenderProps, Input, TextField as TextField$1 } from 'react-aria-components';
|
|
22
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
23
|
+
|
|
24
|
+
// css-module:./TextField.module.css#css-module
|
|
25
|
+
var TextField_module_default = { "hop-TextField": "TextField-module__hop-TextField___CA39c", "hop-TextField--fluid": "TextField-module__hop-TextField--fluid___KYJbS", "hop-TextField__Label": "TextField-module__hop-TextField__Label___RXpue", "hop-TextField__prefix": "TextField-module__hop-TextField__prefix___24cw0", "hop-TextField__InputGroup": "TextField-module__hop-TextField__InputGroup___MW0nv", "hop-TextField__ErrorMessage": "TextField-module__hop-TextField__ErrorMessage___K3wLR", "hop-TextField__HelperMessage": "TextField-module__hop-TextField__HelperMessage___BMw8g" };
|
|
26
|
+
var GlobalTextFieldCssSelector = "hop-TextField";
|
|
27
|
+
function TextField(props, ref) {
|
|
28
|
+
var _a;
|
|
29
|
+
const {
|
|
30
|
+
inputRef: userProvidedInputRef = null,
|
|
31
|
+
...propsWithoutRef
|
|
32
|
+
} = props;
|
|
33
|
+
[props, ref] = useContextProps(propsWithoutRef, ref, TextFieldContext);
|
|
34
|
+
const { stylingProps, ...ownProps } = useStyledSystem(props);
|
|
35
|
+
const [characterCount, setCharacterCount] = useState(() => {
|
|
36
|
+
var _a2, _b, _c, _d;
|
|
37
|
+
return (_d = (_c = (_a2 = props.value) == null ? void 0 : _a2.length) != null ? _c : (_b = props.defaultValue) == null ? void 0 : _b.length) != null ? _d : 0;
|
|
38
|
+
});
|
|
39
|
+
const {
|
|
40
|
+
className,
|
|
41
|
+
style: styleProp,
|
|
42
|
+
size,
|
|
43
|
+
prefix,
|
|
44
|
+
showCharacterCount,
|
|
45
|
+
maxLength,
|
|
46
|
+
placeholder,
|
|
47
|
+
isClearable,
|
|
48
|
+
onChange: onChangeProp,
|
|
49
|
+
children,
|
|
50
|
+
onClear,
|
|
51
|
+
defaultValue,
|
|
52
|
+
value: valueProp,
|
|
53
|
+
isFluid: isFluidProp,
|
|
54
|
+
isDisabled,
|
|
55
|
+
isInvalid,
|
|
56
|
+
...otherProps
|
|
57
|
+
} = ownProps;
|
|
58
|
+
const inputRef = useObjectRef(mergeRefs(userProvidedInputRef, props.inputRef !== void 0 ? props.inputRef : null));
|
|
59
|
+
const isFluid = (_a = useResponsiveValue(isFluidProp)) != null ? _a : false;
|
|
60
|
+
const classNames = composeClassnameRenderProps(
|
|
61
|
+
className,
|
|
62
|
+
GlobalTextFieldCssSelector,
|
|
63
|
+
cssModule(
|
|
64
|
+
TextField_module_default,
|
|
65
|
+
"hop-TextField",
|
|
66
|
+
isClearable && "clearable",
|
|
67
|
+
isFluid && "fluid"
|
|
68
|
+
),
|
|
69
|
+
stylingProps.className
|
|
70
|
+
);
|
|
71
|
+
const style = composeRenderProps(styleProp, (prev) => {
|
|
72
|
+
return {
|
|
73
|
+
...stylingProps.style,
|
|
74
|
+
...prev
|
|
75
|
+
};
|
|
76
|
+
});
|
|
77
|
+
const handleTextChanged = useCallback((value2) => {
|
|
78
|
+
setCharacterCount(value2.length);
|
|
79
|
+
onChangeProp == null ? void 0 : onChangeProp(value2);
|
|
80
|
+
}, [onChangeProp]);
|
|
81
|
+
const [value, onChange] = useControlledState(valueProp, defaultValue || "", handleTextChanged);
|
|
82
|
+
const handleClear = useCallback(() => {
|
|
83
|
+
onChange("");
|
|
84
|
+
onClear == null ? void 0 : onClear();
|
|
85
|
+
}, [onChange, onClear]);
|
|
86
|
+
const showClearButton = isClearable && characterCount !== 0;
|
|
87
|
+
if (showCharacterCount && !maxLength) {
|
|
88
|
+
console.warn("If showCharacterCount is true, maxLength must be set to the maximum number of characters allowed in the TextField.");
|
|
89
|
+
}
|
|
90
|
+
const prefixMarkup = prefix ? /* @__PURE__ */ jsx(
|
|
91
|
+
SlotProvider,
|
|
92
|
+
{
|
|
93
|
+
values: [
|
|
94
|
+
[TextContext, { size, className: TextField_module_default["hop-TextField__prefix"] }],
|
|
95
|
+
[IconContext, { size, className: TextField_module_default["hop-TextField__prefix"] }]
|
|
96
|
+
],
|
|
97
|
+
children: isTextOnlyChildren(prefix) ? /* @__PURE__ */ jsx(_Text, { children: prefix }) : prefix
|
|
98
|
+
}
|
|
99
|
+
) : null;
|
|
100
|
+
const inputMarkup = /* @__PURE__ */ jsx(ClearContainerSlots, { children: /* @__PURE__ */ jsxs(
|
|
101
|
+
_InputGroup,
|
|
102
|
+
{
|
|
103
|
+
isFluid: true,
|
|
104
|
+
size,
|
|
105
|
+
className: TextField_module_default["hop-TextField__InputGroup"],
|
|
106
|
+
isDisabled,
|
|
107
|
+
isInvalid,
|
|
108
|
+
children: [
|
|
109
|
+
prefixMarkup,
|
|
110
|
+
/* @__PURE__ */ jsx(Input, { ref: inputRef, placeholder }),
|
|
111
|
+
showCharacterCount && maxLength && /* @__PURE__ */ jsx(CharacterCount, { characterLeft: maxLength - characterCount }),
|
|
112
|
+
showClearButton && /* @__PURE__ */ jsx(_ClearButton, { isDisabled, size: "lg", onPress: handleClear })
|
|
113
|
+
]
|
|
114
|
+
}
|
|
115
|
+
) });
|
|
116
|
+
const childrenMarkup = composeRenderProps(children, (prev) => {
|
|
117
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
118
|
+
/* @__PURE__ */ jsx(
|
|
119
|
+
SlotProvider,
|
|
120
|
+
{
|
|
121
|
+
values: [
|
|
122
|
+
[LabelContext, { className: TextField_module_default["hop-TextField__Label"] }],
|
|
123
|
+
[HelperMessageContext, { className: TextField_module_default["hop-TextField__HelperMessage"] }],
|
|
124
|
+
[ErrorMessageContext, { className: TextField_module_default["hop-TextField__ErrorMessage"] }]
|
|
125
|
+
],
|
|
126
|
+
children: prev
|
|
127
|
+
}
|
|
128
|
+
),
|
|
129
|
+
inputMarkup
|
|
130
|
+
] });
|
|
131
|
+
});
|
|
132
|
+
return /* @__PURE__ */ jsx(
|
|
133
|
+
TextField$1,
|
|
134
|
+
{
|
|
135
|
+
ref,
|
|
136
|
+
value,
|
|
137
|
+
style,
|
|
138
|
+
className: classNames,
|
|
139
|
+
maxLength,
|
|
140
|
+
onChange,
|
|
141
|
+
isDisabled,
|
|
142
|
+
isInvalid,
|
|
143
|
+
...otherProps,
|
|
144
|
+
children: childrenMarkup
|
|
145
|
+
}
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
function CharacterCount({ characterLeft }) {
|
|
149
|
+
const stringFormatter = useLocalizedString();
|
|
150
|
+
const accessibilityString = stringFormatter.format("Input.charactersLeft", { charLeft: characterLeft });
|
|
151
|
+
return /* @__PURE__ */ jsx(_Text, { "aria-label": accessibilityString, color: "neutral-weakest", size: "xs", children: characterLeft });
|
|
152
|
+
}
|
|
153
|
+
var _TextField = forwardRef(TextField);
|
|
154
|
+
_TextField.displayName = "TextField";
|
|
155
|
+
|
|
156
|
+
export { GlobalTextFieldCssSelector, _TextField };
|
|
@@ -12,7 +12,7 @@ import { useContextProps } from 'react-aria-components';
|
|
|
12
12
|
import { jsx } from 'react/jsx-runtime';
|
|
13
13
|
|
|
14
14
|
// css-module:./RadioField.module.css#css-module
|
|
15
|
-
var RadioField_module_default = { "hop-RadioField": "RadioField-module__hop-
|
|
15
|
+
var RadioField_module_default = { "hop-RadioField": "RadioField-module__hop-RadioField___A3lD0", "hop-RadioField--sm": "RadioField-module__hop-RadioField--sm___qT1Ga", "hop-RadioField--md": "RadioField-module__hop-RadioField--md___1sltk", "hop-RadioField__description": "RadioField-module__hop-RadioField__description___Tm3Cz", "hop-RadioField__radio": "RadioField-module__hop-RadioField__radio___RlTsT" };
|
|
16
16
|
var GlobalRadioFieldCssSelector = "hop-RadioField";
|
|
17
17
|
var RadioToDescriptionSizeAdapter = {
|
|
18
18
|
sm: "xs",
|
|
@@ -2,7 +2,7 @@ import { SwitchContext } from './chunk-YHBJAXUY.js';
|
|
|
2
2
|
import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
|
|
3
3
|
import { isTextOnlyChildren } from './chunk-ZWU6DRRZ.js';
|
|
4
4
|
import { IconListContext } from './chunk-DHVVYSLB.js';
|
|
5
|
-
import { _Text } from './chunk-
|
|
5
|
+
import { _Text } from './chunk-375NGVSY.js';
|
|
6
6
|
import { TextContext } from './chunk-X6SER3TZ.js';
|
|
7
7
|
import { ClearContainerSlots } from './chunk-HXI3MEEK.js';
|
|
8
8
|
import { SlotProvider } from './chunk-M36KANKC.js';
|
|
@@ -14,7 +14,7 @@ import { useContextProps, composeRenderProps, Switch as Switch$1 } from 'react-a
|
|
|
14
14
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
15
15
|
|
|
16
16
|
// css-module:./Switch.module.css#css-module
|
|
17
|
-
var Switch_module_default = { "hop-Switch": "Switch-module__hop-
|
|
17
|
+
var Switch_module_default = { "hop-Switch": "Switch-module__hop-Switch___WOJ5D", "hop-Switch--sm": "Switch-module__hop-Switch--sm___7GFmc", "hop-Switch--md": "Switch-module__hop-Switch--md___K-Izy", "hop-Switch__indicator": "Switch-module__hop-Switch__indicator___fXPHM", "hop-Switch__text": "Switch-module__hop-Switch__text___a30Hu", "hop-Switch__icon-list": "Switch-module__hop-Switch__icon-list___1bF-q", "hop-Switch__icon": "Switch-module__hop-Switch__icon___4kIpS" };
|
|
18
18
|
var GlobalSwitchCssSelector = "hop-Switch";
|
|
19
19
|
function Switch(props, ref) {
|
|
20
20
|
var _a;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { SearchFieldContext } from './chunk-3NKF5TPD.js';
|
|
2
|
+
import { _InputGroup } from './chunk-Q4P2MTYE.js';
|
|
3
|
+
import { _ClearButton } from './chunk-FJYIXPAV.js';
|
|
4
|
+
import { LabelContext } from './chunk-QCA3ZR56.js';
|
|
5
|
+
import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
|
|
6
|
+
import { HelperMessageContext } from './chunk-HZKFQ33E.js';
|
|
7
|
+
import { ErrorMessageContext } from './chunk-FAE27DLF.js';
|
|
8
|
+
import { ClearContainerSlots } from './chunk-HXI3MEEK.js';
|
|
9
|
+
import { SlotProvider } from './chunk-M36KANKC.js';
|
|
10
|
+
import { cssModule } from './chunk-KVDXQMWI.js';
|
|
11
|
+
import { IconContext, SearchIcon } from '@hopper-ui/icons';
|
|
12
|
+
import { useStyledSystem, useResponsiveValue } from '@hopper-ui/styled-system';
|
|
13
|
+
import { mergeRefs } from '@react-aria/utils';
|
|
14
|
+
import { forwardRef } from 'react';
|
|
15
|
+
import { useObjectRef } from 'react-aria';
|
|
16
|
+
import { useContextProps, composeRenderProps, Input, SearchField as SearchField$1 } from 'react-aria-components';
|
|
17
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
18
|
+
|
|
19
|
+
// css-module:./SearchField.module.css#css-module
|
|
20
|
+
var SearchField_module_default = { "hop-SearchField": "SearchField-module__hop-SearchField___vxKu8", "hop-SearchField--fluid": "SearchField-module__hop-SearchField--fluid___iBwfJ", "hop-SearchField__Label": "SearchField-module__hop-SearchField__Label___3TwT1", "hop-SearchField__prefix": "SearchField-module__hop-SearchField__prefix___BgL4d", "hop-SearchField__InputGroup": "SearchField-module__hop-SearchField__InputGroup___naXDe", "hop-SearchField--clearable": "SearchField-module__hop-SearchField--clearable___hkMGX", "hop-SearchField__ErrorMessage": "SearchField-module__hop-SearchField__ErrorMessage___6RK1i", "hop-SearchField__HelperMessage": "SearchField-module__hop-SearchField__HelperMessage___2wBE6", "hop-SearchField__ClearButton": "SearchField-module__hop-SearchField__ClearButton___eSX7R" };
|
|
21
|
+
var GlobalSearchFieldCssSelector = "hop-SearchField";
|
|
22
|
+
function SearchField(props, ref) {
|
|
23
|
+
var _a;
|
|
24
|
+
const {
|
|
25
|
+
inputRef: userProvidedInputRef = null,
|
|
26
|
+
...propsWithoutRef
|
|
27
|
+
} = props;
|
|
28
|
+
[props, ref] = useContextProps(propsWithoutRef, ref, SearchFieldContext);
|
|
29
|
+
const { stylingProps, ...ownProps } = useStyledSystem(props);
|
|
30
|
+
const {
|
|
31
|
+
className,
|
|
32
|
+
style: styleProp,
|
|
33
|
+
size,
|
|
34
|
+
placeholder,
|
|
35
|
+
isClearable = true,
|
|
36
|
+
children,
|
|
37
|
+
isFluid: isFluidProp,
|
|
38
|
+
icon = /* @__PURE__ */ jsx(SearchIcon, {}),
|
|
39
|
+
isDisabled,
|
|
40
|
+
isInvalid,
|
|
41
|
+
...otherProps
|
|
42
|
+
} = ownProps;
|
|
43
|
+
const inputRef = useObjectRef(mergeRefs(userProvidedInputRef, props.inputRef !== void 0 ? props.inputRef : null));
|
|
44
|
+
const isFluid = (_a = useResponsiveValue(isFluidProp)) != null ? _a : false;
|
|
45
|
+
const classNames = composeClassnameRenderProps(
|
|
46
|
+
className,
|
|
47
|
+
GlobalSearchFieldCssSelector,
|
|
48
|
+
cssModule(
|
|
49
|
+
SearchField_module_default,
|
|
50
|
+
"hop-SearchField",
|
|
51
|
+
isFluid && "fluid"
|
|
52
|
+
),
|
|
53
|
+
stylingProps.className
|
|
54
|
+
);
|
|
55
|
+
const style = composeRenderProps(styleProp, (prev) => {
|
|
56
|
+
return {
|
|
57
|
+
...stylingProps.style,
|
|
58
|
+
...prev
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
const inputMarkup = /* @__PURE__ */ jsx(ClearContainerSlots, { children: /* @__PURE__ */ jsxs(
|
|
62
|
+
_InputGroup,
|
|
63
|
+
{
|
|
64
|
+
isDisabled,
|
|
65
|
+
isInvalid,
|
|
66
|
+
isFluid: true,
|
|
67
|
+
size,
|
|
68
|
+
className: SearchField_module_default["hop-SearchField__InputGroup"],
|
|
69
|
+
children: [
|
|
70
|
+
/* @__PURE__ */ jsx(
|
|
71
|
+
SlotProvider,
|
|
72
|
+
{
|
|
73
|
+
values: [
|
|
74
|
+
[IconContext, {
|
|
75
|
+
className: SearchField_module_default["hop-SearchField__prefix"]
|
|
76
|
+
}]
|
|
77
|
+
],
|
|
78
|
+
children: icon
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
/* @__PURE__ */ jsx(Input, { ref: inputRef, placeholder }),
|
|
82
|
+
isClearable && /* @__PURE__ */ jsx(_ClearButton, { size: "lg", isDisabled, className: SearchField_module_default["hop-SearchField__ClearButton"] })
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
) });
|
|
86
|
+
const childrenMarkup = composeRenderProps(children, (prev) => {
|
|
87
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
88
|
+
/* @__PURE__ */ jsx(
|
|
89
|
+
SlotProvider,
|
|
90
|
+
{
|
|
91
|
+
values: [
|
|
92
|
+
[LabelContext, { className: SearchField_module_default["hop-SearchField__Label"] }],
|
|
93
|
+
[HelperMessageContext, { className: SearchField_module_default["hop-SearchField__HelperMessage"] }],
|
|
94
|
+
[ErrorMessageContext, { className: SearchField_module_default["hop-SearchField__ErrorMessage"] }]
|
|
95
|
+
],
|
|
96
|
+
children: prev
|
|
97
|
+
}
|
|
98
|
+
),
|
|
99
|
+
inputMarkup
|
|
100
|
+
] });
|
|
101
|
+
});
|
|
102
|
+
return /* @__PURE__ */ jsx(
|
|
103
|
+
SearchField$1,
|
|
104
|
+
{
|
|
105
|
+
ref,
|
|
106
|
+
style,
|
|
107
|
+
className: classNames,
|
|
108
|
+
isDisabled,
|
|
109
|
+
isInvalid,
|
|
110
|
+
...otherProps,
|
|
111
|
+
children: childrenMarkup
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
var _SearchField = forwardRef(SearchField);
|
|
116
|
+
_SearchField.displayName = "SearchField";
|
|
117
|
+
|
|
118
|
+
export { GlobalSearchFieldCssSelector, _SearchField };
|
|
@@ -4,8 +4,8 @@ import { RadioListContext } from './chunk-A7TZHALP.js';
|
|
|
4
4
|
import { RadioContext } from './chunk-FU5CCPLP.js';
|
|
5
5
|
import { LabelContext } from './chunk-QCA3ZR56.js';
|
|
6
6
|
import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
|
|
7
|
-
import { ErrorMessageContext } from './chunk-FAE27DLF.js';
|
|
8
7
|
import { HelperMessageContext } from './chunk-HZKFQ33E.js';
|
|
8
|
+
import { ErrorMessageContext } from './chunk-FAE27DLF.js';
|
|
9
9
|
import { SlotProvider } from './chunk-M36KANKC.js';
|
|
10
10
|
import { cssModule } from './chunk-KVDXQMWI.js';
|
|
11
11
|
import { useStyledSystem, useResponsiveValue } from '@hopper-ui/styled-system';
|
|
@@ -14,7 +14,7 @@ import { useContextProps, composeRenderProps, RadioGroup as RadioGroup$1 } from
|
|
|
14
14
|
import { jsx } from 'react/jsx-runtime';
|
|
15
15
|
|
|
16
16
|
// css-module:./RadioGroup.module.css#css-module
|
|
17
|
-
var RadioGroup_module_default = { "hop-RadioGroup": "RadioGroup-module__hop-
|
|
17
|
+
var RadioGroup_module_default = { "hop-RadioGroup": "RadioGroup-module__hop-RadioGroup___gKLRP", "hop-RadioGroup--bordered": "RadioGroup-module__hop-RadioGroup--bordered___1-bcY", "hop-RadioGroup--sm": "RadioGroup-module__hop-RadioGroup--sm___lnLkS", "hop-RadioGroup--md": "RadioGroup-module__hop-RadioGroup--md___Jvqyo", "hop-RadioGroup__label": "RadioGroup-module__hop-RadioGroup__label___sv-Ey", "hop-RadioGroup__list": "RadioGroup-module__hop-RadioGroup__list___pw9--", "hop-RadioGroup__radio": "RadioGroup-module__hop-RadioGroup__radio___QEo5I", "hop-RadioGroup__error-message": "RadioGroup-module__hop-RadioGroup__error-message___qh3t0", "hop-RadioGroup__helper-message": "RadioGroup-module__hop-RadioGroup__helper-message___b51mt" };
|
|
18
18
|
var GlobalRadioGroupCssSelector = "hop-RadioGroup";
|
|
19
19
|
function RadioGroup(props, ref) {
|
|
20
20
|
var _a, _b;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AvatarContext } from './chunk-AES7QBQE.js';
|
|
2
|
-
import { _RichIconAvatarImage } from './chunk-
|
|
2
|
+
import { _RichIconAvatarImage } from './chunk-DERV7IO4.js';
|
|
3
3
|
import { DeletedUserRichIcon } from '@hopper-ui/icons';
|
|
4
4
|
import { useStyledSystem, useResponsiveValue } from '@hopper-ui/styled-system';
|
|
5
5
|
import clsx from 'clsx';
|
package/dist/i18n/src/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { useLocalizedString } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
1
|
+
export { useLocalizedString } from '../../chunk-YEYNRBMQ.js';
|
|
2
|
+
import '../../chunk-JSBRDJBE.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { useLocalizedString } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
1
|
+
export { useLocalizedString } from '../../chunk-YEYNRBMQ.js';
|
|
2
|
+
import '../../chunk-JSBRDJBE.js';
|