@hopper-ui/components 1.0.13 → 1.2.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 +17 -0
- package/README.md +1 -1
- package/dist/Avatar/src/AnonymousAvatar.css +10 -10
- package/dist/Avatar/src/AnonymousAvatar.js +2 -2
- package/dist/Avatar/src/Avatar.css +37 -37
- package/dist/Avatar/src/Avatar.js +3 -3
- package/dist/Avatar/src/AvatarContext.d.ts +1 -1
- package/dist/Avatar/src/DeletedAvatar.css +10 -10
- package/dist/Avatar/src/DeletedAvatar.js +2 -2
- package/dist/Avatar/src/RichIconAvatarImage.css +10 -10
- package/dist/Avatar/src/RichIconAvatarImage.js +1 -1
- package/dist/Avatar/src/index.css +37 -37
- package/dist/Avatar/src/index.js +5 -5
- package/dist/Badge/src/Badge.css +10 -10
- package/dist/Badge/src/Badge.js +2 -2
- package/dist/Badge/src/index.css +10 -10
- package/dist/Badge/src/index.js +2 -2
- package/dist/Divider/src/Divider.css +2 -2
- package/dist/Divider/src/Divider.js +1 -1
- package/dist/Divider/src/index.css +2 -2
- package/dist/Divider/src/index.js +1 -1
- package/dist/ErrorMessage/src/ErrorMessage.css +11 -11
- package/dist/ErrorMessage/src/ErrorMessage.js +2 -2
- package/dist/ErrorMessage/src/index.css +11 -11
- package/dist/ErrorMessage/src/index.js +2 -2
- package/dist/Form/src/Form.css +4111 -0
- package/dist/Form/src/Form.d.ts +28 -0
- package/dist/Form/src/Form.js +114 -0
- package/dist/Form/src/FormContext.d.ts +8 -0
- package/dist/Form/src/FormContext.js +2 -0
- package/dist/Form/src/index.css +4111 -0
- package/dist/Form/src/index.d.ts +5 -0
- package/dist/Form/src/index.js +114 -0
- package/dist/HelperMessage/src/HelperMessage.css +11 -11
- package/dist/HelperMessage/src/HelperMessage.js +2 -2
- package/dist/HelperMessage/src/index.css +11 -11
- package/dist/HelperMessage/src/index.js +2 -2
- package/dist/IconList/src/IconList.css +1 -1
- package/dist/IconList/src/IconList.js +1 -1
- package/dist/IconList/src/index.css +1 -1
- package/dist/IconList/src/index.js +1 -1
- package/dist/Link/src/Link.css +31 -31
- package/dist/Link/src/Link.js +3 -3
- package/dist/Link/src/index.css +31 -31
- package/dist/Link/src/index.js +3 -3
- package/dist/ListBox/src/ListBox.css +369 -169
- package/dist/ListBox/src/ListBox.js +15 -14
- package/dist/ListBox/src/ListBoxItem.css +425 -225
- package/dist/ListBox/src/ListBoxItem.js +14 -13
- package/dist/ListBox/src/ListBoxItemSkeleton.css +7 -7
- package/dist/ListBox/src/ListBoxItemSkeleton.js +1 -1
- package/dist/ListBox/src/index.css +369 -169
- package/dist/ListBox/src/index.js +15 -14
- package/dist/Spinner/src/Spinner.css +19 -19
- package/dist/Spinner/src/Spinner.js +2 -2
- package/dist/Spinner/src/index.css +19 -19
- package/dist/Spinner/src/index.js +2 -2
- package/dist/buttons/src/Button.css +94 -94
- package/dist/buttons/src/Button.js +6 -6
- package/dist/buttons/src/ButtonGroup.css +11 -11
- package/dist/buttons/src/ButtonGroup.js +1 -1
- package/dist/buttons/src/ClearButton.css +375 -28
- package/dist/buttons/src/ClearButton.js +3 -3
- package/dist/buttons/src/EmbeddedButton.css +375 -28
- package/dist/buttons/src/EmbeddedButton.d.ts +9 -0
- package/dist/buttons/src/EmbeddedButton.js +1 -1
- package/dist/buttons/src/index.css +480 -133
- 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/CheckboxField.css +15 -15
- package/dist/checkbox/src/CheckboxField.js +1 -1
- package/dist/checkbox/src/CheckboxGroup.css +62 -59
- package/dist/checkbox/src/CheckboxGroup.js +1 -1
- package/dist/checkbox/src/index.css +62 -59
- package/dist/checkbox/src/index.js +6 -6
- package/dist/{chunk-KARK64JC.js → chunk-2XO5CZBO.js} +2 -2
- package/dist/{chunk-DZHRELLA.js → chunk-354H4FNA.js} +1 -1
- package/dist/{chunk-ZXDN2IRM.js → chunk-5IB23E3O.js} +6 -2
- package/dist/{chunk-WCLGYVXV.js → chunk-BKCMCC7V.js} +1 -1
- package/dist/{chunk-5WWMVQI4.js → chunk-CEUQHDEQ.js} +1 -1
- package/dist/{chunk-AMXRADUV.js → chunk-CKKLDA5J.js} +2 -2
- package/dist/{chunk-UGHMX7QX.js → chunk-COIGQP33.js} +3 -3
- package/dist/{chunk-NHM3MQI3.js → chunk-EJUIYBAC.js} +3 -3
- package/dist/chunk-EURJK4ZT.js +7 -0
- package/dist/{chunk-YEYNRBMQ.js → chunk-F4H76S4H.js} +6 -2
- package/dist/{chunk-44KY7MFF.js → chunk-FA4IXLWZ.js} +19 -8
- package/dist/chunk-FOD7XUSJ.js +150 -0
- package/dist/{chunk-W34MMJ2L.js → chunk-FOKTHCFK.js} +3 -3
- package/dist/chunk-HCRWIU7V.js +276 -0
- package/dist/chunk-IU6XMS2X.js +21 -0
- package/dist/{chunk-JN2FF2IX.js → chunk-IUOLKHYQ.js} +1 -1
- package/dist/{chunk-2MUGMKNO.js → chunk-IXWYHDGU.js} +1 -1
- package/dist/{chunk-SSMGKQ27.js → chunk-J44DIB5J.js} +3 -3
- package/dist/{chunk-GH5LAOQU.js → chunk-JJ4EFTES.js} +1 -1
- package/dist/{chunk-RGGVZKNN.js → chunk-L5KI4ZCL.js} +2 -2
- package/dist/{chunk-AYPCLDGU.js → chunk-M3K4IYX6.js} +1 -1
- package/dist/chunk-MHQZXLKW.js +7 -0
- package/dist/{chunk-IEE2HHGR.js → chunk-MJHMFANK.js} +1 -1
- package/dist/{chunk-CXIH6I5X.js → chunk-PFABSIDM.js} +1 -1
- package/dist/{chunk-ERE2XRQA.js → chunk-PQXVL3YJ.js} +1 -1
- package/dist/{chunk-CCIVRIKG.js → chunk-Q63YLWI6.js} +16 -3
- package/dist/{chunk-JLUFMLGV.js → chunk-RQKU3XDG.js} +1 -1
- package/dist/chunk-RWAVMW7T.js +70 -0
- package/dist/{chunk-TNVYVDLF.js → chunk-S5CK32KM.js} +6 -4
- package/dist/{chunk-LDORNYHF.js → chunk-SZSQZ4C7.js} +3 -3
- package/dist/{chunk-UPR32DV5.js → chunk-T6MAOVLH.js} +2 -2
- package/dist/{chunk-B42AJF74.js → chunk-TCOZUCPD.js} +142 -159
- package/dist/{chunk-M4IVTAHY.js → chunk-TG623HPA.js} +7 -5
- package/dist/{chunk-723W7LGB.js → chunk-U56LEEEA.js} +6 -6
- package/dist/{chunk-THQZBL4T.js → chunk-UT4CSUUM.js} +1 -1
- package/dist/{chunk-MVWQVBTK.js → chunk-V5Q245NH.js} +4 -2
- package/dist/chunk-VISBUD2K.js +172 -0
- package/dist/{chunk-QTV45NTY.js → chunk-VYKPDMP3.js} +3 -3
- package/dist/{chunk-CS2RAWQB.js → chunk-W2BQZEW6.js} +4 -4
- package/dist/{chunk-SW7LHIQ2.js → chunk-W474WFOP.js} +21 -9
- package/dist/{chunk-ESRYOELK.js → chunk-X253QCYD.js} +3 -2
- package/dist/{chunk-PAYZGXTT.js → chunk-XT2MZWEV.js} +1 -1
- package/dist/{chunk-SNWJJ3FF.js → chunk-XUJNQNB3.js} +1 -1
- package/dist/chunk-Z57VHYOF.js +22 -0
- package/dist/i18n/src/index.js +1 -1
- package/dist/i18n/src/useLocalizedString.js +1 -1
- package/dist/index.css +1625 -707
- package/dist/index.d.ts +9 -3
- package/dist/index.js +56 -50
- package/dist/inputs/src/InputGroup.css +78 -39
- package/dist/inputs/src/InputGroup.d.ts +10 -1
- package/dist/inputs/src/InputGroup.js +1 -1
- package/dist/inputs/src/NumberField.css +129 -90
- package/dist/inputs/src/NumberField.d.ts +1 -0
- package/dist/inputs/src/NumberField.js +18 -172
- package/dist/inputs/src/PasswordField.css +588 -199
- package/dist/inputs/src/PasswordField.d.ts +1 -0
- package/dist/inputs/src/PasswordField.js +9 -9
- package/dist/inputs/src/SearchField.css +594 -205
- package/dist/inputs/src/SearchField.d.ts +1 -0
- package/dist/inputs/src/SearchField.js +10 -10
- package/dist/inputs/src/TextArea.css +469 -0
- package/dist/inputs/src/TextArea.d.ts +62 -0
- package/dist/inputs/src/TextArea.js +23 -0
- package/dist/inputs/src/TextAreaContext.d.ts +8 -0
- package/dist/inputs/src/TextAreaContext.js +2 -0
- package/dist/inputs/src/TextField.css +589 -200
- package/dist/inputs/src/TextField.d.ts +2 -0
- package/dist/inputs/src/TextField.js +11 -11
- package/dist/inputs/src/index.css +948 -368
- package/dist/inputs/src/index.d.ts +4 -0
- package/dist/inputs/src/index.js +20 -13
- package/dist/overlays/Popover/src/Popover.css +1625 -707
- package/dist/overlays/Popover/src/Popover.js +56 -50
- package/dist/overlays/Popover/src/index.css +1625 -707
- package/dist/overlays/Popover/src/index.js +56 -50
- package/dist/radio/src/Radio.css +31 -31
- package/dist/radio/src/Radio.js +3 -3
- package/dist/radio/src/RadioField.css +15 -15
- package/dist/radio/src/RadioField.js +1 -1
- package/dist/radio/src/RadioGroup.css +62 -59
- package/dist/radio/src/RadioGroup.js +3 -3
- package/dist/radio/src/index.css +62 -59
- package/dist/radio/src/index.js +9 -9
- package/dist/switch/src/Switch.css +25 -25
- package/dist/switch/src/Switch.js +3 -3
- package/dist/switch/src/SwitchField.css +15 -15
- package/dist/switch/src/SwitchField.js +1 -1
- package/dist/switch/src/index.css +31 -31
- package/dist/switch/src/index.js +4 -4
- package/dist/tag/src/Tag.css +1041 -2241
- package/dist/tag/src/Tag.d.ts +6 -1
- package/dist/tag/src/Tag.js +8 -96
- package/dist/tag/src/TagGroup.css +24 -21
- package/dist/tag/src/TagGroup.d.ts +7 -2
- package/dist/tag/src/TagGroup.js +1 -1
- package/dist/tag/src/index.css +1104 -2205
- package/dist/tag/src/index.js +10 -91
- package/dist/typography/Heading/src/Heading.css +9 -9
- package/dist/typography/Heading/src/Heading.js +1 -1
- package/dist/typography/Heading/src/index.css +9 -9
- package/dist/typography/Heading/src/index.js +1 -1
- package/dist/typography/Label/src/Label.css +5 -2
- package/dist/typography/Label/src/Label.d.ts +8 -0
- package/dist/typography/Label/src/Label.js +2 -1
- package/dist/typography/Label/src/index.css +5 -2
- package/dist/typography/Label/src/index.js +2 -1
- package/dist/typography/OverlineText/src/OverlineText.css +6 -6
- package/dist/typography/OverlineText/src/OverlineText.js +1 -1
- package/dist/typography/OverlineText/src/index.css +6 -6
- package/dist/typography/OverlineText/src/index.js +1 -1
- package/dist/typography/Text/src/Text.css +9 -9
- package/dist/typography/Text/src/Text.js +1 -1
- package/dist/typography/Text/src/index.css +9 -9
- package/dist/typography/Text/src/index.js +1 -1
- package/dist/utils/src/index.d.ts +2 -0
- package/dist/utils/src/index.js +4 -2
- package/dist/utils/src/useFontFaceReady.d.ts +3 -0
- package/dist/utils/src/useFontFaceReady.js +2 -0
- package/dist/utils/src/useTruncatedText.d.ts +3 -0
- package/dist/utils/src/useTruncatedText.js +2 -0
- package/package.json +3 -3
- package/dist/Chip/src/Chip.css +0 -261
- package/dist/Chip/src/Chip.d.ts +0 -27
- package/dist/Chip/src/Chip.js +0 -10
- package/dist/Chip/src/ChipContext.d.ts +0 -10
- package/dist/Chip/src/ChipContext.js +0 -2
- package/dist/Chip/src/index.css +0 -261
- package/dist/Chip/src/index.d.ts +0 -7
- package/dist/Chip/src/index.js +0 -10
- package/dist/chunk-632B5YBQ.js +0 -7
- package/dist/chunk-I2YZLGRE.js +0 -43
- package/dist/chunk-RXZQB35O.js +0 -105
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { TextFieldContext } from './chunk-O4XPUINW.js';
|
|
2
|
-
import { _InputGroup } from './chunk-
|
|
3
|
-
import { _ClearButton } from './chunk-
|
|
2
|
+
import { _InputGroup } from './chunk-Q63YLWI6.js';
|
|
3
|
+
import { _ClearButton } from './chunk-2XO5CZBO.js';
|
|
4
4
|
import { LabelContext } from './chunk-QCA3ZR56.js';
|
|
5
|
-
import { useLocalizedString } from './chunk-
|
|
5
|
+
import { useLocalizedString } from './chunk-F4H76S4H.js';
|
|
6
|
+
import { isTextOnlyChildren } from './chunk-ZWU6DRRZ.js';
|
|
6
7
|
import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
|
|
7
8
|
import { HelperMessageContext } from './chunk-HZKFQ33E.js';
|
|
8
9
|
import { ErrorMessageContext } from './chunk-FAE27DLF.js';
|
|
9
|
-
import {
|
|
10
|
-
import { _Text } from './chunk-PAYZGXTT.js';
|
|
10
|
+
import { _Text } from './chunk-XT2MZWEV.js';
|
|
11
11
|
import { TextContext } from './chunk-X6SER3TZ.js';
|
|
12
12
|
import { ClearContainerSlots } from './chunk-HXI3MEEK.js';
|
|
13
13
|
import { SlotProvider } from './chunk-M36KANKC.js';
|
|
@@ -22,7 +22,7 @@ import { useContextProps, composeRenderProps, Input, TextField as TextField$1 }
|
|
|
22
22
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
23
23
|
|
|
24
24
|
// css-module:./TextField.module.css#css-module
|
|
25
|
-
var TextField_module_default = { "hop-TextField": "TextField-module__hop-
|
|
25
|
+
var TextField_module_default = { "hop-TextField": "TextField-module__hop-TextField___p1zZl", "hop-TextField--fluid": "TextField-module__hop-TextField--fluid___upyKv", "hop-TextField__Label": "TextField-module__hop-TextField__Label___KP7AK", "hop-TextField__prefix": "TextField-module__hop-TextField__prefix___o3YUl", "hop-TextField__InputGroup": "TextField-module__hop-TextField__InputGroup___b7EQq", "hop-TextField__ErrorMessage": "TextField-module__hop-TextField__ErrorMessage___oXqwU", "hop-TextField__HelperMessage": "TextField-module__hop-TextField__HelperMessage___WN1xO" };
|
|
26
26
|
var GlobalTextFieldCssSelector = "hop-TextField";
|
|
27
27
|
function TextField(props, ref) {
|
|
28
28
|
var _a;
|
|
@@ -53,6 +53,7 @@ function TextField(props, ref) {
|
|
|
53
53
|
isFluid: isFluidProp,
|
|
54
54
|
isDisabled,
|
|
55
55
|
isInvalid,
|
|
56
|
+
isRequired,
|
|
56
57
|
...otherProps
|
|
57
58
|
} = ownProps;
|
|
58
59
|
const inputRef = useObjectRef(mergeRefs(userProvidedInputRef, props.inputRef !== void 0 ? props.inputRef : null));
|
|
@@ -119,7 +120,7 @@ function TextField(props, ref) {
|
|
|
119
120
|
SlotProvider,
|
|
120
121
|
{
|
|
121
122
|
values: [
|
|
122
|
-
[LabelContext, { className: TextField_module_default["hop-TextField__Label"] }],
|
|
123
|
+
[LabelContext, { className: TextField_module_default["hop-TextField__Label"], isRequired }],
|
|
123
124
|
[HelperMessageContext, { className: TextField_module_default["hop-TextField__HelperMessage"] }],
|
|
124
125
|
[ErrorMessageContext, { className: TextField_module_default["hop-TextField__ErrorMessage"] }]
|
|
125
126
|
],
|
|
@@ -140,6 +141,7 @@ function TextField(props, ref) {
|
|
|
140
141
|
onChange,
|
|
141
142
|
isDisabled,
|
|
142
143
|
isInvalid,
|
|
144
|
+
isRequired,
|
|
143
145
|
...otherProps,
|
|
144
146
|
children: childrenMarkup
|
|
145
147
|
}
|
|
@@ -148,7 +150,16 @@ function TextField(props, ref) {
|
|
|
148
150
|
function CharacterCount({ characterLeft }) {
|
|
149
151
|
const stringFormatter = useLocalizedString();
|
|
150
152
|
const accessibilityString = stringFormatter.format("Input.charactersLeft", { charLeft: characterLeft });
|
|
151
|
-
return /* @__PURE__ */ jsx(
|
|
153
|
+
return /* @__PURE__ */ jsx(
|
|
154
|
+
_Text,
|
|
155
|
+
{
|
|
156
|
+
"aria-label": accessibilityString,
|
|
157
|
+
role: "status",
|
|
158
|
+
color: "neutral-weakest",
|
|
159
|
+
size: "xs",
|
|
160
|
+
children: characterLeft
|
|
161
|
+
}
|
|
162
|
+
);
|
|
152
163
|
}
|
|
153
164
|
var _TextField = forwardRef(TextField);
|
|
154
165
|
_TextField.displayName = "TextField";
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { TagContext } from './chunk-EWMWQ2MC.js';
|
|
2
|
+
import { _ClearButton } from './chunk-2XO5CZBO.js';
|
|
3
|
+
import { _Spinner } from './chunk-CKKLDA5J.js';
|
|
4
|
+
import { useLocalizedString } from './chunk-F4H76S4H.js';
|
|
5
|
+
import { isTextOnlyChildren } from './chunk-ZWU6DRRZ.js';
|
|
6
|
+
import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
|
|
7
|
+
import { IconListContext } from './chunk-DHVVYSLB.js';
|
|
8
|
+
import { BadgeContext } from './chunk-CQDLZ42T.js';
|
|
9
|
+
import { _Text } from './chunk-XT2MZWEV.js';
|
|
10
|
+
import { TextContext } from './chunk-X6SER3TZ.js';
|
|
11
|
+
import { ClearContainerSlots } from './chunk-HXI3MEEK.js';
|
|
12
|
+
import { AvatarContext } from './chunk-AES7QBQE.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 { forwardRef } from 'react';
|
|
18
|
+
import { useContextProps, composeRenderProps, Tag as Tag$1 } from 'react-aria-components';
|
|
19
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
20
|
+
|
|
21
|
+
// css-module:./Tag.module.css#css-module
|
|
22
|
+
var Tag_module_default = { "hop-Tag": "Tag-module__hop-Tag___RskTT", "hop-Tag--sm": "Tag-module__hop-Tag--sm___dT9Zg", "hop-Tag__remove-btn": "Tag-module__hop-Tag__remove-btn___gqTvd", "hop-Tag__Spinner": "Tag-module__hop-Tag__Spinner___itlq9", "hop-Tag__avatar": "Tag-module__hop-Tag__avatar___k-w6U", "hop-Tag--md": "Tag-module__hop-Tag--md___EFXGm", "hop-Tag--lg": "Tag-module__hop-Tag--lg___-7S-k", "hop-Tag--neutral": "Tag-module__hop-Tag--neutral___ziL-o", "hop-Tag--subdued": "Tag-module__hop-Tag--subdued___bYJN1", "hop-Tag--progress": "Tag-module__hop-Tag--progress___Scd9q", "hop-Tag--positive": "Tag-module__hop-Tag--positive___GJ1Wb", "hop-Tag--caution": "Tag-module__hop-Tag--caution___de6ZF", "hop-Tag--negative": "Tag-module__hop-Tag--negative___Dz8WI", "hop-Tag--option1": "Tag-module__hop-Tag--option1___Va6Mb", "hop-Tag--option2": "Tag-module__hop-Tag--option2___eck-O", "hop-Tag--option3": "Tag-module__hop-Tag--option3___ZlmMR", "hop-Tag--option4": "Tag-module__hop-Tag--option4___L3EmX", "hop-Tag--option5": "Tag-module__hop-Tag--option5___B7Tp-", "hop-Tag--option6": "Tag-module__hop-Tag--option6___GvCgh", "hop-Tag__icon": "Tag-module__hop-Tag__icon___nUqBw", "hop-Tag__icon-list": "Tag-module__hop-Tag__icon-list___ybqv1", "hop-Tag__text": "Tag-module__hop-Tag__text___TYNqw", "hop-Tag__badge": "Tag-module__hop-Tag__badge___oUeLt" };
|
|
23
|
+
var GlobalTagCssSelector = "hop-Tag";
|
|
24
|
+
var TagToTextSizeAdapter = {
|
|
25
|
+
sm: "xs",
|
|
26
|
+
md: "xs",
|
|
27
|
+
lg: "sm"
|
|
28
|
+
};
|
|
29
|
+
var TagToAvatarSizeAdapter = {
|
|
30
|
+
sm: "xs",
|
|
31
|
+
md: "xs",
|
|
32
|
+
lg: "sm"
|
|
33
|
+
};
|
|
34
|
+
var TagToButtonSizeAdapter = {
|
|
35
|
+
sm: "md",
|
|
36
|
+
md: "md",
|
|
37
|
+
lg: "lg"
|
|
38
|
+
};
|
|
39
|
+
function Tag(props, ref) {
|
|
40
|
+
var _a;
|
|
41
|
+
[props, ref] = useContextProps(props, ref, TagContext);
|
|
42
|
+
const { stylingProps, ...ownProps } = useStyledSystem(props);
|
|
43
|
+
const {
|
|
44
|
+
className,
|
|
45
|
+
children: childrenProp,
|
|
46
|
+
isInvalid,
|
|
47
|
+
isLoading,
|
|
48
|
+
size: sizeProp,
|
|
49
|
+
style: styleProp,
|
|
50
|
+
textValue: textValueProp,
|
|
51
|
+
variant = "neutral",
|
|
52
|
+
...otherProps
|
|
53
|
+
} = ownProps;
|
|
54
|
+
const stringFormatter = useLocalizedString();
|
|
55
|
+
const size = (_a = useResponsiveValue(sizeProp)) != null ? _a : "md";
|
|
56
|
+
const textValue = textValueProp != null ? textValueProp : typeof childrenProp === "string" ? childrenProp : void 0;
|
|
57
|
+
const classNames = composeClassnameRenderProps(
|
|
58
|
+
className,
|
|
59
|
+
GlobalTagCssSelector,
|
|
60
|
+
cssModule(
|
|
61
|
+
Tag_module_default,
|
|
62
|
+
"hop-Tag",
|
|
63
|
+
size,
|
|
64
|
+
variant
|
|
65
|
+
),
|
|
66
|
+
stylingProps.className
|
|
67
|
+
);
|
|
68
|
+
const style = composeRenderProps(styleProp, (prev) => {
|
|
69
|
+
return {
|
|
70
|
+
...stylingProps.style,
|
|
71
|
+
...prev
|
|
72
|
+
};
|
|
73
|
+
});
|
|
74
|
+
const children = composeRenderProps(childrenProp, (prev) => {
|
|
75
|
+
if (prev && isTextOnlyChildren(prev)) {
|
|
76
|
+
return /* @__PURE__ */ jsx(_Text, { children: prev });
|
|
77
|
+
}
|
|
78
|
+
return prev;
|
|
79
|
+
});
|
|
80
|
+
return /* @__PURE__ */ jsx(
|
|
81
|
+
Tag$1,
|
|
82
|
+
{
|
|
83
|
+
...otherProps,
|
|
84
|
+
ref,
|
|
85
|
+
className: classNames,
|
|
86
|
+
style,
|
|
87
|
+
textValue,
|
|
88
|
+
"data-invalid": isInvalid || void 0,
|
|
89
|
+
"data-loading": isLoading || void 0,
|
|
90
|
+
children: (tagProps) => {
|
|
91
|
+
const { allowsRemoving, isDisabled, isSelected } = tagProps;
|
|
92
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
93
|
+
/* @__PURE__ */ jsx(ClearContainerSlots, { children: /* @__PURE__ */ jsx(
|
|
94
|
+
SlotProvider,
|
|
95
|
+
{
|
|
96
|
+
values: [
|
|
97
|
+
[TextContext, {
|
|
98
|
+
className: Tag_module_default["hop-Tag__text"],
|
|
99
|
+
size: TagToTextSizeAdapter[size]
|
|
100
|
+
}],
|
|
101
|
+
[IconListContext, {
|
|
102
|
+
className: Tag_module_default["hop-Tag__icon-list"],
|
|
103
|
+
size: "sm"
|
|
104
|
+
}],
|
|
105
|
+
[IconContext, {
|
|
106
|
+
className: Tag_module_default["hop-Tag__icon"],
|
|
107
|
+
size: "sm"
|
|
108
|
+
}],
|
|
109
|
+
[BadgeContext, {
|
|
110
|
+
className: Tag_module_default["hop-Tag__badge"],
|
|
111
|
+
isDisabled
|
|
112
|
+
}],
|
|
113
|
+
[AvatarContext, {
|
|
114
|
+
className: Tag_module_default["hop-Tag__avatar"],
|
|
115
|
+
isDisabled,
|
|
116
|
+
size: TagToAvatarSizeAdapter[size]
|
|
117
|
+
}]
|
|
118
|
+
],
|
|
119
|
+
children: children(tagProps)
|
|
120
|
+
}
|
|
121
|
+
) }),
|
|
122
|
+
allowsRemoving && !isLoading && /* @__PURE__ */ jsx(
|
|
123
|
+
_ClearButton,
|
|
124
|
+
{
|
|
125
|
+
slot: "remove",
|
|
126
|
+
isDisabled,
|
|
127
|
+
className: Tag_module_default["hop-Tag__remove-btn"],
|
|
128
|
+
"aria-label": stringFormatter.format("Tag.removeAriaLabel"),
|
|
129
|
+
size: TagToButtonSizeAdapter[size],
|
|
130
|
+
variant,
|
|
131
|
+
isSelected
|
|
132
|
+
}
|
|
133
|
+
),
|
|
134
|
+
isLoading && /* @__PURE__ */ jsx(
|
|
135
|
+
_Spinner,
|
|
136
|
+
{
|
|
137
|
+
"aria-label": stringFormatter.format("Tag.spinnerAriaLabel"),
|
|
138
|
+
size: "sm",
|
|
139
|
+
className: Tag_module_default["hop-Tag__Spinner"]
|
|
140
|
+
}
|
|
141
|
+
)
|
|
142
|
+
] });
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
var _Tag = forwardRef(Tag);
|
|
148
|
+
_Tag.displayName = "Tag";
|
|
149
|
+
|
|
150
|
+
export { GlobalTagCssSelector, _Tag };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { CheckboxContext } from './chunk-2EAZPH3M.js';
|
|
2
|
-
import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
|
|
3
2
|
import { isTextOnlyChildren } from './chunk-ZWU6DRRZ.js';
|
|
3
|
+
import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
|
|
4
4
|
import { IconListContext } from './chunk-DHVVYSLB.js';
|
|
5
|
-
import { _Text } from './chunk-
|
|
5
|
+
import { _Text } from './chunk-XT2MZWEV.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, Checkbox as Checkbox$1 } from 'rea
|
|
|
14
14
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
15
15
|
|
|
16
16
|
// css-module:./Checkbox.module.css#css-module
|
|
17
|
-
var Checkbox_module_default = { "hop-Checkbox": "Checkbox-module__hop-
|
|
17
|
+
var Checkbox_module_default = { "hop-Checkbox": "Checkbox-module__hop-Checkbox___OTh5S", "hop-Checkbox--focused": "Checkbox-module__hop-Checkbox--focused___urS3p", "hop-Checkbox--hovered": "Checkbox-module__hop-Checkbox--hovered___Wwpsr", "hop-Checkbox--pressed": "Checkbox-module__hop-Checkbox--pressed___tG3Hj", "hop-Checkbox--sm": "Checkbox-module__hop-Checkbox--sm___gKd-M", "hop-Checkbox--md": "Checkbox-module__hop-Checkbox--md___WAPyo", "hop-Checkbox__icon": "Checkbox-module__hop-Checkbox__icon___SzESn", "hop-Checkbox__icon-list": "Checkbox-module__hop-Checkbox__icon-list___lWkgH", "hop-Checkbox__box": "Checkbox-module__hop-Checkbox__box___UxA4d", "hop-Checkbox__check": "Checkbox-module__hop-Checkbox__check___iNG2Y", "hop-Checkbox__text": "Checkbox-module__hop-Checkbox__text___-kuqp" };
|
|
18
18
|
var GlobalCheckboxCssSelector = "hop-Checkbox";
|
|
19
19
|
function Checkbox(props, ref) {
|
|
20
20
|
var _a;
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
import { useFontFaceReady } from './chunk-IU6XMS2X.js';
|
|
2
|
+
import { useTruncatedText } from './chunk-Z57VHYOF.js';
|
|
3
|
+
import { TextAreaContext } from './chunk-MHQZXLKW.js';
|
|
4
|
+
import { _InputGroup } from './chunk-Q63YLWI6.js';
|
|
5
|
+
import { LabelContext } from './chunk-QCA3ZR56.js';
|
|
6
|
+
import { useLocalizedString } from './chunk-F4H76S4H.js';
|
|
7
|
+
import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
|
|
8
|
+
import { HelperMessageContext } from './chunk-HZKFQ33E.js';
|
|
9
|
+
import { ErrorMessageContext } from './chunk-FAE27DLF.js';
|
|
10
|
+
import { _Text } from './chunk-XT2MZWEV.js';
|
|
11
|
+
import { ClearContainerSlots } from './chunk-HXI3MEEK.js';
|
|
12
|
+
import { SlotProvider } from './chunk-M36KANKC.js';
|
|
13
|
+
import { cssModule } from './chunk-KVDXQMWI.js';
|
|
14
|
+
import { useStyledSystem, useResponsiveValue, useIsomorphicLayoutEffect } from '@hopper-ui/styled-system';
|
|
15
|
+
import $670gB$react, { forwardRef, useContext, useState, useCallback, useRef, useMemo } from 'react';
|
|
16
|
+
import { mergeRefs } from '@react-aria/utils';
|
|
17
|
+
import { useControlledState } from '@react-stately/utils';
|
|
18
|
+
import { useObjectRef } from 'react-aria';
|
|
19
|
+
import { useContextProps, composeRenderProps, TextArea as TextArea$1, TextField } from 'react-aria-components';
|
|
20
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
21
|
+
|
|
22
|
+
var $b5e257d569688ac6$var$defaultContext = {
|
|
23
|
+
prefix: String(Math.round(Math.random() * 1e10)),
|
|
24
|
+
current: 0
|
|
25
|
+
};
|
|
26
|
+
var $b5e257d569688ac6$var$SSRContext = /* @__PURE__ */ ($670gB$react).createContext($b5e257d569688ac6$var$defaultContext);
|
|
27
|
+
var $b5e257d569688ac6$var$IsSSRContext = /* @__PURE__ */ ($670gB$react).createContext(false);
|
|
28
|
+
var $b5e257d569688ac6$var$canUseDOM = Boolean(typeof window !== "undefined" && window.document && window.document.createElement);
|
|
29
|
+
var $b5e257d569688ac6$var$componentIds = /* @__PURE__ */ new WeakMap();
|
|
30
|
+
function $b5e257d569688ac6$var$useCounter(isDisabled = false) {
|
|
31
|
+
let ctx = (useContext)($b5e257d569688ac6$var$SSRContext);
|
|
32
|
+
let ref = (useRef)(null);
|
|
33
|
+
if (ref.current === null && !isDisabled) {
|
|
34
|
+
var _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner, _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
35
|
+
let currentOwner = (_React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ($670gB$react).__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED === void 0 ? void 0 : (_React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner = _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner) === null || _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner === void 0 ? void 0 : _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner.current;
|
|
36
|
+
if (currentOwner) {
|
|
37
|
+
let prevComponentValue = $b5e257d569688ac6$var$componentIds.get(currentOwner);
|
|
38
|
+
if (prevComponentValue == null)
|
|
39
|
+
$b5e257d569688ac6$var$componentIds.set(currentOwner, {
|
|
40
|
+
id: ctx.current,
|
|
41
|
+
state: currentOwner.memoizedState
|
|
42
|
+
});
|
|
43
|
+
else if (currentOwner.memoizedState !== prevComponentValue.state) {
|
|
44
|
+
ctx.current = prevComponentValue.id;
|
|
45
|
+
$b5e257d569688ac6$var$componentIds.delete(currentOwner);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
ref.current = ++ctx.current;
|
|
49
|
+
}
|
|
50
|
+
return ref.current;
|
|
51
|
+
}
|
|
52
|
+
function $b5e257d569688ac6$var$useLegacySSRSafeId(defaultId) {
|
|
53
|
+
let ctx = (useContext)($b5e257d569688ac6$var$SSRContext);
|
|
54
|
+
if (ctx === $b5e257d569688ac6$var$defaultContext && !$b5e257d569688ac6$var$canUseDOM) console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");
|
|
55
|
+
let counter = $b5e257d569688ac6$var$useCounter(!!defaultId);
|
|
56
|
+
let prefix = ctx === $b5e257d569688ac6$var$defaultContext && false ? "react-aria" : `react-aria${ctx.prefix}`;
|
|
57
|
+
return defaultId || `${prefix}-${counter}`;
|
|
58
|
+
}
|
|
59
|
+
function $b5e257d569688ac6$var$useModernSSRSafeId(defaultId) {
|
|
60
|
+
let id = ($670gB$react).useId();
|
|
61
|
+
let [didSSR] = (useState)($b5e257d569688ac6$export$535bd6ca7f90a273());
|
|
62
|
+
let prefix = didSSR || false ? "react-aria" : `react-aria${$b5e257d569688ac6$var$defaultContext.prefix}`;
|
|
63
|
+
return defaultId || `${prefix}-${id}`;
|
|
64
|
+
}
|
|
65
|
+
typeof ($670gB$react)["useId"] === "function" ? $b5e257d569688ac6$var$useModernSSRSafeId : $b5e257d569688ac6$var$useLegacySSRSafeId;
|
|
66
|
+
function $b5e257d569688ac6$var$getSnapshot() {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
function $b5e257d569688ac6$var$getServerSnapshot() {
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
function $b5e257d569688ac6$var$subscribe(onStoreChange) {
|
|
73
|
+
return () => {
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
function $b5e257d569688ac6$export$535bd6ca7f90a273() {
|
|
77
|
+
if (typeof ($670gB$react)["useSyncExternalStore"] === "function") return ($670gB$react)["useSyncExternalStore"]($b5e257d569688ac6$var$subscribe, $b5e257d569688ac6$var$getSnapshot, $b5e257d569688ac6$var$getServerSnapshot);
|
|
78
|
+
return (useContext)($b5e257d569688ac6$var$IsSSRContext);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// css-module:./TextArea.module.css#css-module
|
|
82
|
+
var TextArea_module_default = { "hop-TextArea": "TextArea-module__hop-TextArea___Oqrhm", "hop-TextArea--fluid": "TextArea-module__hop-TextArea--fluid___2QsEG", "hop-TextArea__Label": "TextArea-module__hop-TextArea__Label___6uZvZ", "hop-TextArea__prefix": "TextArea-module__hop-TextArea__prefix___UGSsJ", "hop-TextArea__InputGroup": "TextArea-module__hop-TextArea__InputGroup___m2oHv", "hop-TextArea__textarea": "TextArea-module__hop-TextArea__textarea___-aEby", "hop-TextArea__char-count": "TextArea-module__hop-TextArea__char-count___-TDoe", "hop-TextArea__ErrorMessage": "TextArea-module__hop-TextArea__ErrorMessage___Gj-AJ", "hop-TextArea__HelperMessage": "TextArea-module__hop-TextArea__HelperMessage___FVgxx" };
|
|
83
|
+
var GlobalTextAreaCssSelector = "hop-TextArea";
|
|
84
|
+
var DefaultMinimumTextAreaRows = 3;
|
|
85
|
+
var pxToInt = (value) => {
|
|
86
|
+
return value ? parseInt(value.replace("px", ""), 10) : 0;
|
|
87
|
+
};
|
|
88
|
+
function getBodyElement(isSSR) {
|
|
89
|
+
return !isSSR ? document.body : void 0;
|
|
90
|
+
}
|
|
91
|
+
function useCalculateRowHeight(input) {
|
|
92
|
+
const isSSR = $b5e257d569688ac6$export$535bd6ca7f90a273();
|
|
93
|
+
const fontsLoaded = useFontFaceReady();
|
|
94
|
+
return useMemo(() => {
|
|
95
|
+
var _a, _b;
|
|
96
|
+
if (!input || !fontsLoaded) {
|
|
97
|
+
return 0;
|
|
98
|
+
}
|
|
99
|
+
const { font, lineHeight } = window.getComputedStyle(input);
|
|
100
|
+
if (lineHeight !== "normal") {
|
|
101
|
+
return pxToInt(lineHeight);
|
|
102
|
+
}
|
|
103
|
+
const element = document.createElement("span");
|
|
104
|
+
element.style.visibility = "hidden";
|
|
105
|
+
element.style.position = "absolute";
|
|
106
|
+
element.style.font = font;
|
|
107
|
+
element.innerText = "LineHeightHelper";
|
|
108
|
+
(_a = getBodyElement(isSSR)) == null ? void 0 : _a.appendChild(element);
|
|
109
|
+
const height = element.getBoundingClientRect().height;
|
|
110
|
+
(_b = getBodyElement(isSSR)) == null ? void 0 : _b.removeChild(element);
|
|
111
|
+
return height;
|
|
112
|
+
}, [input, fontsLoaded, isSSR]);
|
|
113
|
+
}
|
|
114
|
+
function TextArea(props, ref) {
|
|
115
|
+
var _a, _b;
|
|
116
|
+
const {
|
|
117
|
+
inputRef: userProvidedInputRef = null,
|
|
118
|
+
...propsWithoutRef
|
|
119
|
+
} = props;
|
|
120
|
+
[props, ref] = useContextProps(propsWithoutRef, ref, TextAreaContext);
|
|
121
|
+
const { stylingProps, ...ownProps } = useStyledSystem(props);
|
|
122
|
+
const [characterCount, setCharacterCount] = useState(() => {
|
|
123
|
+
var _a2, _b2, _c, _d;
|
|
124
|
+
return (_d = (_c = (_a2 = props.value) == null ? void 0 : _a2.length) != null ? _c : (_b2 = props.defaultValue) == null ? void 0 : _b2.length) != null ? _d : 0;
|
|
125
|
+
});
|
|
126
|
+
const {
|
|
127
|
+
className,
|
|
128
|
+
style: styleProp,
|
|
129
|
+
size,
|
|
130
|
+
showCharacterCount,
|
|
131
|
+
maxLength,
|
|
132
|
+
placeholder,
|
|
133
|
+
onChange: onChangeProp,
|
|
134
|
+
children,
|
|
135
|
+
defaultValue,
|
|
136
|
+
maxRows,
|
|
137
|
+
cols,
|
|
138
|
+
rows: rowsProp,
|
|
139
|
+
value: valueProp,
|
|
140
|
+
resizeMode: resizeModeProp,
|
|
141
|
+
isFluid: isFluidProp,
|
|
142
|
+
isDisabled,
|
|
143
|
+
isInvalid,
|
|
144
|
+
restrictMaxLength = true,
|
|
145
|
+
...otherProps
|
|
146
|
+
} = ownProps;
|
|
147
|
+
const mergedTextAreaRef = useObjectRef(mergeRefs(userProvidedInputRef, props.inputRef !== void 0 ? props.inputRef : null));
|
|
148
|
+
const isFluid = (_a = useResponsiveValue(isFluidProp)) != null ? _a : false;
|
|
149
|
+
const resizeMode = (_b = useResponsiveValue(resizeModeProp)) != null ? _b : "none";
|
|
150
|
+
const overMaxLength = !!maxLength && characterCount > maxLength;
|
|
151
|
+
const classNames = composeClassnameRenderProps(
|
|
152
|
+
className,
|
|
153
|
+
GlobalTextAreaCssSelector,
|
|
154
|
+
cssModule(
|
|
155
|
+
TextArea_module_default,
|
|
156
|
+
"hop-TextArea",
|
|
157
|
+
isFluid && "fluid"
|
|
158
|
+
),
|
|
159
|
+
stylingProps.className
|
|
160
|
+
);
|
|
161
|
+
const style = composeRenderProps(styleProp, (prev) => {
|
|
162
|
+
return {
|
|
163
|
+
...stylingProps.style,
|
|
164
|
+
...prev
|
|
165
|
+
};
|
|
166
|
+
});
|
|
167
|
+
const handleTextChanged = useCallback((value2) => {
|
|
168
|
+
setCharacterCount(value2.length);
|
|
169
|
+
onChangeProp == null ? void 0 : onChangeProp(value2);
|
|
170
|
+
}, [onChangeProp]);
|
|
171
|
+
if (showCharacterCount && !maxLength) {
|
|
172
|
+
console.warn("If showCharacterCount is true, maxLength must be set to the maximum number of characters allowed in the TextArea.");
|
|
173
|
+
}
|
|
174
|
+
const rowHeight = useCalculateRowHeight(mergedTextAreaRef.current);
|
|
175
|
+
const defaultNumberOfRows = maxRows && maxRows < DefaultMinimumTextAreaRows ? maxRows : DefaultMinimumTextAreaRows;
|
|
176
|
+
const [rows, setRows] = useState(rowsProp != null ? rowsProp : defaultNumberOfRows);
|
|
177
|
+
const truncateText = useTruncatedText();
|
|
178
|
+
const [value, onChange] = useControlledState(valueProp, defaultValue || "", handleTextChanged);
|
|
179
|
+
const adjustRows = useCallback(() => {
|
|
180
|
+
const input = mergedTextAreaRef.current;
|
|
181
|
+
if (rowHeight === 0 || !input) {
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
const { paddingBottom, paddingTop } = window.getComputedStyle(input);
|
|
185
|
+
const originalRows = input.rows;
|
|
186
|
+
const originalOverflow = input.style.overflow;
|
|
187
|
+
input.rows = 1;
|
|
188
|
+
input.style.overflow = "hidden";
|
|
189
|
+
const padding = pxToInt(paddingTop) + pxToInt(paddingBottom);
|
|
190
|
+
const currentRowsWithText = Math.floor((input.scrollHeight - padding) / rowHeight);
|
|
191
|
+
input.rows = originalRows;
|
|
192
|
+
input.style.overflow = originalOverflow;
|
|
193
|
+
if (rowsProp) {
|
|
194
|
+
setRows(rowsProp);
|
|
195
|
+
} else if (maxRows && currentRowsWithText >= maxRows) {
|
|
196
|
+
setRows(maxRows);
|
|
197
|
+
} else {
|
|
198
|
+
setRows(Math.max(currentRowsWithText, DefaultMinimumTextAreaRows));
|
|
199
|
+
}
|
|
200
|
+
}, [mergedTextAreaRef, rowHeight, maxRows, rowsProp]);
|
|
201
|
+
useIsomorphicLayoutEffect(() => {
|
|
202
|
+
if (restrictMaxLength) {
|
|
203
|
+
const newValue = truncateText(value, maxLength);
|
|
204
|
+
onChange(newValue);
|
|
205
|
+
}
|
|
206
|
+
adjustRows();
|
|
207
|
+
}, [value, adjustRows]);
|
|
208
|
+
const inputMarkup = /* @__PURE__ */ jsx(ClearContainerSlots, { children: /* @__PURE__ */ jsxs(
|
|
209
|
+
_InputGroup,
|
|
210
|
+
{
|
|
211
|
+
isFluid: true,
|
|
212
|
+
size,
|
|
213
|
+
className: TextArea_module_default["hop-TextArea__InputGroup"],
|
|
214
|
+
isDisabled,
|
|
215
|
+
isInvalid,
|
|
216
|
+
inputClassName: TextArea_module_default["hop-TextArea__textarea"],
|
|
217
|
+
inputType: "textarea",
|
|
218
|
+
children: [
|
|
219
|
+
/* @__PURE__ */ jsx(TextArea$1, { ref: mergedTextAreaRef, placeholder, cols, rows }),
|
|
220
|
+
showCharacterCount && maxLength && /* @__PURE__ */ jsx(CharacterCount, { charactersLeft: maxLength - characterCount, isInvalid: overMaxLength })
|
|
221
|
+
]
|
|
222
|
+
}
|
|
223
|
+
) });
|
|
224
|
+
const childrenMarkup = composeRenderProps(children, (prev) => {
|
|
225
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
226
|
+
/* @__PURE__ */ jsx(
|
|
227
|
+
SlotProvider,
|
|
228
|
+
{
|
|
229
|
+
values: [
|
|
230
|
+
[LabelContext, { className: TextArea_module_default["hop-TextArea__Label"] }],
|
|
231
|
+
[HelperMessageContext, { className: TextArea_module_default["hop-TextArea__HelperMessage"] }],
|
|
232
|
+
[ErrorMessageContext, { className: TextArea_module_default["hop-TextArea__ErrorMessage"] }]
|
|
233
|
+
],
|
|
234
|
+
children: prev
|
|
235
|
+
}
|
|
236
|
+
),
|
|
237
|
+
inputMarkup
|
|
238
|
+
] });
|
|
239
|
+
});
|
|
240
|
+
return /* @__PURE__ */ jsx(
|
|
241
|
+
TextField,
|
|
242
|
+
{
|
|
243
|
+
ref,
|
|
244
|
+
value,
|
|
245
|
+
style,
|
|
246
|
+
className: classNames,
|
|
247
|
+
maxLength: restrictMaxLength ? maxLength : void 0,
|
|
248
|
+
onChange,
|
|
249
|
+
isDisabled,
|
|
250
|
+
isInvalid,
|
|
251
|
+
"data-resize-mode": resizeMode,
|
|
252
|
+
"data-over-max-length": overMaxLength || void 0,
|
|
253
|
+
...otherProps,
|
|
254
|
+
children: childrenMarkup
|
|
255
|
+
}
|
|
256
|
+
);
|
|
257
|
+
}
|
|
258
|
+
function CharacterCount({ charactersLeft, isInvalid }) {
|
|
259
|
+
const stringFormatter = useLocalizedString();
|
|
260
|
+
const accessibilityString = stringFormatter.format("Input.charactersLeft", { charLeft: charactersLeft });
|
|
261
|
+
return /* @__PURE__ */ jsx(
|
|
262
|
+
_Text,
|
|
263
|
+
{
|
|
264
|
+
"aria-label": accessibilityString,
|
|
265
|
+
role: "status",
|
|
266
|
+
size: "xs",
|
|
267
|
+
className: TextArea_module_default["hop-TextArea__char-count"],
|
|
268
|
+
"data-invalid": isInvalid || void 0,
|
|
269
|
+
children: charactersLeft
|
|
270
|
+
}
|
|
271
|
+
);
|
|
272
|
+
}
|
|
273
|
+
var _TextArea = forwardRef(TextArea);
|
|
274
|
+
_TextArea.displayName = "TextArea";
|
|
275
|
+
|
|
276
|
+
export { GlobalTextAreaCssSelector, _TextArea };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useIsomorphicLayoutEffect } from '@hopper-ui/styled-system';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
|
|
4
|
+
// src/utils/src/useFontFaceReady.ts
|
|
5
|
+
var useFontFaceReady = () => {
|
|
6
|
+
const [ready, setReady] = useState(false);
|
|
7
|
+
useIsomorphicLayoutEffect(() => {
|
|
8
|
+
let isCancelled = false;
|
|
9
|
+
document.fonts.ready.then(() => {
|
|
10
|
+
if (!isCancelled) {
|
|
11
|
+
setReady(true);
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
return () => {
|
|
15
|
+
isCancelled = true;
|
|
16
|
+
};
|
|
17
|
+
}, []);
|
|
18
|
+
return ready;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export { useFontFaceReady };
|
|
@@ -8,7 +8,7 @@ import { useContextProps } from 'react-aria-components';
|
|
|
8
8
|
import { jsx } from 'react/jsx-runtime';
|
|
9
9
|
|
|
10
10
|
// css-module:./IconList.module.css#css-module
|
|
11
|
-
var IconList_module_default = { "hop-IconList": "IconList-module__hop-
|
|
11
|
+
var IconList_module_default = { "hop-IconList": "IconList-module__hop-IconList___-mdbp" };
|
|
12
12
|
var GlobalIconListCssSelector = "hop-IconList";
|
|
13
13
|
function IconList(props, ref) {
|
|
14
14
|
[props, ref] = useContextProps(props, ref, IconListContext);
|
|
@@ -14,7 +14,7 @@ import { useContextProps, composeRenderProps, CheckboxGroup as CheckboxGroup$1 }
|
|
|
14
14
|
import { jsx } from 'react/jsx-runtime';
|
|
15
15
|
|
|
16
16
|
// css-module:./CheckboxGroup.module.css#css-module
|
|
17
|
-
var CheckboxGroup_module_default = { "hop-CheckboxGroup": "CheckboxGroup-module__hop-
|
|
17
|
+
var CheckboxGroup_module_default = { "hop-CheckboxGroup": "CheckboxGroup-module__hop-CheckboxGroup___ElEYk", "hop-CheckboxGroup--bordered": "CheckboxGroup-module__hop-CheckboxGroup--bordered___oEe87", "hop-CheckboxGroup--sm": "CheckboxGroup-module__hop-CheckboxGroup--sm___ETF-H", "hop-CheckboxGroup--md": "CheckboxGroup-module__hop-CheckboxGroup--md___5bM6E", "hop-CheckboxGroup__label": "CheckboxGroup-module__hop-CheckboxGroup__label___zvdEY", "hop-CheckboxGroup__list": "CheckboxGroup-module__hop-CheckboxGroup__list___-cq2A", "hop-CheckboxGroup__checkbox": "CheckboxGroup-module__hop-CheckboxGroup__checkbox___GhnAo", "hop-CheckboxGroup__error-message": "CheckboxGroup-module__hop-CheckboxGroup__error-message___wZAUv", "hop-CheckboxGroup__helper-message": "CheckboxGroup-module__hop-CheckboxGroup__helper-message___qN21A" };
|
|
18
18
|
var GlobalCheckboxGroupCssSelector = "hop-CheckboxGroup";
|
|
19
19
|
function CheckboxGroup(props, ref) {
|
|
20
20
|
var _a, _b;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { RadioContext } from './chunk-FU5CCPLP.js';
|
|
2
|
-
import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
|
|
3
2
|
import { isTextOnlyChildren } from './chunk-ZWU6DRRZ.js';
|
|
3
|
+
import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
|
|
4
4
|
import { IconListContext } from './chunk-DHVVYSLB.js';
|
|
5
|
-
import { _Text } from './chunk-
|
|
5
|
+
import { _Text } from './chunk-XT2MZWEV.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, Radio as Radio$1 } from 'react-ari
|
|
|
14
14
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
15
15
|
|
|
16
16
|
// css-module:./Radio.module.css#css-module
|
|
17
|
-
var Radio_module_default = { "hop-Radio": "Radio-module__hop-
|
|
17
|
+
var Radio_module_default = { "hop-Radio": "Radio-module__hop-Radio___2E1Ba", "hop-Radio--focused": "Radio-module__hop-Radio--focused___uZjvZ", "hop-Radio--hovered": "Radio-module__hop-Radio--hovered___I3nXi", "hop-Radio--pressed": "Radio-module__hop-Radio--pressed___g-XN4", "hop-Radio--sm": "Radio-module__hop-Radio--sm___fb-Zv", "hop-Radio--md": "Radio-module__hop-Radio--md___WvIhk", "hop-Radio__icon": "Radio-module__hop-Radio__icon___f49M7", "hop-Radio__icon-list": "Radio-module__hop-Radio__icon-list___65C4k", "hop-Radio__box": "Radio-module__hop-Radio__box___HLxF3", "hop-Radio__bullet": "Radio-module__hop-Radio__bullet___SgKK1", "hop-Radio__text": "Radio-module__hop-Radio__text___uZHkI" };
|
|
18
18
|
var GlobalRadioCssSelector = "hop-Radio";
|
|
19
19
|
function Radio(props, ref) {
|
|
20
20
|
var _a;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AvatarContext } from './chunk-AES7QBQE.js';
|
|
2
|
-
import { _RichIconAvatarImage } from './chunk-
|
|
2
|
+
import { _RichIconAvatarImage } from './chunk-M3K4IYX6.js';
|
|
3
3
|
import { AnonymousRichIcon } from '@hopper-ui/icons';
|
|
4
4
|
import { useStyledSystem, useResponsiveValue } from '@hopper-ui/styled-system';
|
|
5
5
|
import clsx from 'clsx';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HelperMessageContext } from './chunk-HZKFQ33E.js';
|
|
2
|
-
import { _Text } from './chunk-
|
|
2
|
+
import { _Text } from './chunk-XT2MZWEV.js';
|
|
3
3
|
import { cssModule } from './chunk-KVDXQMWI.js';
|
|
4
4
|
import { InfoIcon } from '@hopper-ui/icons';
|
|
5
5
|
import { useStyledSystem } from '@hopper-ui/styled-system';
|
|
@@ -9,7 +9,7 @@ import { useContextProps, FieldErrorContext } from 'react-aria-components';
|
|
|
9
9
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
10
10
|
|
|
11
11
|
// css-module:./HelperMessage.module.css#css-module
|
|
12
|
-
var HelperMessage_module_default = { "hop-HelperMessage": "HelperMessage-module__hop-
|
|
12
|
+
var HelperMessage_module_default = { "hop-HelperMessage": "HelperMessage-module__hop-HelperMessage___KQaJ4", "hop-HelperMessage__icon": "HelperMessage-module__hop-HelperMessage__icon___1a1jj" };
|
|
13
13
|
var GlobalHelperMessageCssSelector = "hop-HelperMessage";
|
|
14
14
|
function HelperMessage(props, ref) {
|
|
15
15
|
const validation = useContext(FieldErrorContext);
|
|
@@ -9,7 +9,7 @@ import { useContextProps } from 'react-aria-components';
|
|
|
9
9
|
import { jsx } from 'react/jsx-runtime';
|
|
10
10
|
|
|
11
11
|
// css-module:./RichIconAvatarImage.module.css#css-module
|
|
12
|
-
var RichIconAvatarImage_module_default = { "hop-RichIconAvatarImage": "RichIconAvatarImage-module__hop-
|
|
12
|
+
var RichIconAvatarImage_module_default = { "hop-RichIconAvatarImage": "RichIconAvatarImage-module__hop-RichIconAvatarImage___sG-Yd", "hop-RichIconAvatarImage--xs": "RichIconAvatarImage-module__hop-RichIconAvatarImage--xs___h-WpU", "hop-RichIconAvatarImage--sm": "RichIconAvatarImage-module__hop-RichIconAvatarImage--sm___QasW-", "hop-RichIconAvatarImage--md": "RichIconAvatarImage-module__hop-RichIconAvatarImage--md___QjQ3I", "hop-RichIconAvatarImage--lg": "RichIconAvatarImage-module__hop-RichIconAvatarImage--lg___PrX57", "hop-RichIconAvatarImage--xl": "RichIconAvatarImage-module__hop-RichIconAvatarImage--xl___fZOdF", "hop-RichIconAvatarImage--2xl": "RichIconAvatarImage-module__hop-RichIconAvatarImage--2xl___E-1I9", "hop-RichIconAvatarImage__icon": "RichIconAvatarImage-module__hop-RichIconAvatarImage__icon___JDA4Q" };
|
|
13
13
|
var GlobalRichIconAvatarImageCssSelector = "hop-RichIconAvatarImage";
|
|
14
14
|
var AvatarToIconSizeAdapter = {
|
|
15
15
|
xs: "md",
|
|
@@ -11,7 +11,7 @@ import { useContextProps } from 'react-aria-components';
|
|
|
11
11
|
import { jsx } from 'react/jsx-runtime';
|
|
12
12
|
|
|
13
13
|
// css-module:./SwitchField.module.css#css-module
|
|
14
|
-
var SwitchField_module_default = { "hop-SwitchField": "SwitchField-module__hop-
|
|
14
|
+
var SwitchField_module_default = { "hop-SwitchField": "SwitchField-module__hop-SwitchField___7GWRP", "hop-SwitchField--sm": "SwitchField-module__hop-SwitchField--sm___kZQJI", "hop-SwitchField--md": "SwitchField-module__hop-SwitchField--md___M0ask", "hop-SwitchField__description": "SwitchField-module__hop-SwitchField__description___7fE6W", "hop-SwitchField__switch": "SwitchField-module__hop-SwitchField__switch___5McYm" };
|
|
15
15
|
var GlobalSwitchFieldCssSelector = "hop-SwitchField";
|
|
16
16
|
var SwitchToDescriptionSizeAdapter = {
|
|
17
17
|
sm: "xs",
|