@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,8 +1,8 @@
|
|
|
1
1
|
import { PasswordFieldContext } from './chunk-QW45G6K4.js';
|
|
2
|
-
import { _InputGroup } from './chunk-
|
|
3
|
-
import { _EmbeddedButton } from './chunk-
|
|
2
|
+
import { _InputGroup } from './chunk-Q63YLWI6.js';
|
|
3
|
+
import { _EmbeddedButton } from './chunk-5IB23E3O.js';
|
|
4
4
|
import { LabelContext } from './chunk-QCA3ZR56.js';
|
|
5
|
-
import { useLocalizedString } from './chunk-
|
|
5
|
+
import { useLocalizedString } from './chunk-F4H76S4H.js';
|
|
6
6
|
import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
|
|
7
7
|
import { HelperMessageContext } from './chunk-HZKFQ33E.js';
|
|
8
8
|
import { ErrorMessageContext } from './chunk-FAE27DLF.js';
|
|
@@ -18,7 +18,7 @@ import { useContextProps, composeRenderProps, Input, TextField } from 'react-ari
|
|
|
18
18
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
19
19
|
|
|
20
20
|
// css-module:./PasswordField.module.css#css-module
|
|
21
|
-
var PasswordField_module_default = { "hop-PasswordField": "PasswordField-module__hop-
|
|
21
|
+
var PasswordField_module_default = { "hop-PasswordField": "PasswordField-module__hop-PasswordField___BZw2q", "hop-PasswordField--fluid": "PasswordField-module__hop-PasswordField--fluid___Vy6O6", "hop-PasswordField__Label": "PasswordField-module__hop-PasswordField__Label___3feE7", "hop-PasswordField__InputGroup": "PasswordField-module__hop-PasswordField__InputGroup___6fO8H", "hop-PasswordField__ErrorMessage": "PasswordField-module__hop-PasswordField__ErrorMessage___ACyog", "hop-PasswordField__HelperMessage": "PasswordField-module__hop-PasswordField__HelperMessage___xp9kN" };
|
|
22
22
|
var GlobalPasswordFieldCssSelector = "hop-PasswordField";
|
|
23
23
|
function PasswordField(props, ref) {
|
|
24
24
|
var _a;
|
|
@@ -39,6 +39,7 @@ function PasswordField(props, ref) {
|
|
|
39
39
|
isFluid: isFluidProp,
|
|
40
40
|
isDisabled,
|
|
41
41
|
isInvalid,
|
|
42
|
+
isRequired,
|
|
42
43
|
...otherProps
|
|
43
44
|
} = ownProps;
|
|
44
45
|
const inputRef = useObjectRef(mergeRefs(userProvidedInputRef, props.inputRef !== void 0 ? props.inputRef : null));
|
|
@@ -90,7 +91,7 @@ function PasswordField(props, ref) {
|
|
|
90
91
|
SlotProvider,
|
|
91
92
|
{
|
|
92
93
|
values: [
|
|
93
|
-
[LabelContext, { className: PasswordField_module_default["hop-PasswordField__Label"] }],
|
|
94
|
+
[LabelContext, { className: PasswordField_module_default["hop-PasswordField__Label"], isRequired }],
|
|
94
95
|
[HelperMessageContext, { className: PasswordField_module_default["hop-PasswordField__HelperMessage"] }],
|
|
95
96
|
[ErrorMessageContext, { className: PasswordField_module_default["hop-PasswordField__ErrorMessage"] }]
|
|
96
97
|
],
|
|
@@ -108,6 +109,7 @@ function PasswordField(props, ref) {
|
|
|
108
109
|
className: classNames,
|
|
109
110
|
isDisabled,
|
|
110
111
|
isInvalid,
|
|
112
|
+
isRequired,
|
|
111
113
|
...otherProps,
|
|
112
114
|
children: childrenMarkup
|
|
113
115
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { useSlot } from './chunk-H5YTU3U7.js';
|
|
2
2
|
import { ButtonContext } from './chunk-WMTWFKKP.js';
|
|
3
|
-
import { _Spinner } from './chunk-
|
|
4
|
-
import { useLocalizedString } from './chunk-
|
|
5
|
-
import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
|
|
6
|
-
import { useRenderProps } from './chunk-NH3IVMXB.js';
|
|
3
|
+
import { _Spinner } from './chunk-CKKLDA5J.js';
|
|
4
|
+
import { useLocalizedString } from './chunk-F4H76S4H.js';
|
|
7
5
|
import { isTextOnlyChildren } from './chunk-ZWU6DRRZ.js';
|
|
6
|
+
import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
|
|
8
7
|
import { IconListContext } from './chunk-DHVVYSLB.js';
|
|
9
|
-
import {
|
|
8
|
+
import { useRenderProps } from './chunk-NH3IVMXB.js';
|
|
9
|
+
import { _Text } from './chunk-XT2MZWEV.js';
|
|
10
10
|
import { TextContext } from './chunk-X6SER3TZ.js';
|
|
11
11
|
import { SlotProvider } from './chunk-M36KANKC.js';
|
|
12
12
|
import { cssModule } from './chunk-KVDXQMWI.js';
|
|
@@ -19,7 +19,7 @@ import { useContextProps, ButtonContext as ButtonContext$1, composeRenderProps,
|
|
|
19
19
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
20
20
|
|
|
21
21
|
// css-module:./Button.module.css#css-module
|
|
22
|
-
var Button_module_default = { "hop-Button": "Button-module__hop-
|
|
22
|
+
var Button_module_default = { "hop-Button": "Button-module__hop-Button___ot9lw", "hop-Button--icon-only": "Button-module__hop-Button--icon-only___i5ahP", "hop-Button--fluid": "Button-module__hop-Button--fluid___7p5MN", "hop-Button--sm": "Button-module__hop-Button--sm___8f5C7", "hop-Button--primary": "Button-module__hop-Button--primary___eGhk1", "hop-Button--md": "Button-module__hop-Button--md___Nq4Ho", "hop-Button--secondary": "Button-module__hop-Button--secondary___EK4MQ", "hop-Button--upsell": "Button-module__hop-Button--upsell___tKts9", "hop-Button--danger": "Button-module__hop-Button--danger___kCc82", "hop-Button--ghost-danger": "Button-module__hop-Button--ghost-danger___p0AWu", "hop-Button--ghost-secondary": "Button-module__hop-Button--ghost-secondary___Mh--L", "hop-Button--ghost-primary": "Button-module__hop-Button--ghost-primary___bHqEG", "hop-Button__Spinner": "Button-module__hop-Button__Spinner___pYUr5", "hop-Button__icon": "Button-module__hop-Button__icon___8a7Yy", "hop-Button__icon-list": "Button-module__hop-Button__icon-list___7KNrU", "hop-Button__text": "Button-module__hop-Button__text___a4lmJ", "hop-Button__end-icon": "Button-module__hop-Button__end-icon___oJS-s", "hop-Button__end-icon-list": "Button-module__hop-Button__end-icon-list___iyDSw" };
|
|
23
23
|
var GlobalButtonCssSelector = "hop-Button";
|
|
24
24
|
var additionalButtonHTMLAttributes = /* @__PURE__ */ new Set(["form", "formAction", "formEncType", "formMethod", "formNoValidate", "formTarget", "name", "value"]);
|
|
25
25
|
function useSimulatedRACButton(props, ref) {
|
|
@@ -7,7 +7,7 @@ import { useContextProps } from 'react-aria-components';
|
|
|
7
7
|
import { jsx } from 'react/jsx-runtime';
|
|
8
8
|
|
|
9
9
|
// css-module:./ListBoxItemSkeleton.module.css#css-module
|
|
10
|
-
var ListBoxItemSkeleton_module_default = { "hop-ListBoxItemSkeleton": "ListBoxItemSkeleton-module__hop-
|
|
10
|
+
var ListBoxItemSkeleton_module_default = { "hop-ListBoxItemSkeleton": "ListBoxItemSkeleton-module__hop-ListBoxItemSkeleton___wrIL3", "placeholder-shimmer": "ListBoxItemSkeleton-module__placeholder-shimmer___kPWk2", "hop-ListBoxItemSkeleton--xs": "ListBoxItemSkeleton-module__hop-ListBoxItemSkeleton--xs___cHo6m", "hop-ListBoxItemSkeleton--sm": "ListBoxItemSkeleton-module__hop-ListBoxItemSkeleton--sm___Kyk8k", "hop-ListBoxItemSkeleton--md": "ListBoxItemSkeleton-module__hop-ListBoxItemSkeleton--md___a5cds", "hop-ListBoxItemSkeleton--lg": "ListBoxItemSkeleton-module__hop-ListBoxItemSkeleton--lg___dn0c2" };
|
|
11
11
|
var GlobalListBoxItemSkeletonCssSelector = "hop-ListBoxItemSkeleton";
|
|
12
12
|
function ListBoxItemSkeleton(props, ref) {
|
|
13
13
|
var _a;
|
|
@@ -13,7 +13,7 @@ import { useContextProps, FieldErrorContext, TagGroup as TagGroup$1 } from 'reac
|
|
|
13
13
|
import { jsx } from 'react/jsx-runtime';
|
|
14
14
|
|
|
15
15
|
// css-module:./TagGroup.module.css#css-module
|
|
16
|
-
var TagGroup_module_default = { "hop-TagGroup": "TagGroup-module__hop-
|
|
16
|
+
var TagGroup_module_default = { "hop-TagGroup": "TagGroup-module__hop-TagGroup___nGYNE", "hop-TagGroup__label": "TagGroup-module__hop-TagGroup__label___sR56G", "hop-TagGroup__list": "TagGroup-module__hop-TagGroup__list___8M4Dw", "hop-TagGroup__error-message": "TagGroup-module__hop-TagGroup__error-message___Wzu9G", "hop-TagGroup__helper-message": "TagGroup-module__hop-TagGroup__helper-message___VOUZz" };
|
|
17
17
|
var GlobalTagGroupCssSelector = "hop-TagGroup";
|
|
18
18
|
function TagGroup(props, ref) {
|
|
19
19
|
var _a;
|
|
@@ -25,6 +25,7 @@ function TagGroup(props, ref) {
|
|
|
25
25
|
isInvalid = false,
|
|
26
26
|
style: styleProp,
|
|
27
27
|
size: sizeProp,
|
|
28
|
+
variant,
|
|
28
29
|
...otherProps
|
|
29
30
|
} = ownProps;
|
|
30
31
|
const size = (_a = useResponsiveValue(sizeProp)) != null ? _a : "md";
|
|
@@ -55,7 +56,8 @@ function TagGroup(props, ref) {
|
|
|
55
56
|
[TagContext, {
|
|
56
57
|
className: TagGroup_module_default["hop-TagGroup__tag"],
|
|
57
58
|
isInvalid,
|
|
58
|
-
size
|
|
59
|
+
size,
|
|
60
|
+
variant
|
|
59
61
|
}],
|
|
60
62
|
[ErrorMessageContext, {
|
|
61
63
|
className: TagGroup_module_default["hop-TagGroup__error-message"],
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { useScale } from './chunk-MTDFS4CZ.js';
|
|
2
|
+
import { NumberFieldContext } from './chunk-ZQ3AWYRR.js';
|
|
3
|
+
import { _InputGroup } from './chunk-Q63YLWI6.js';
|
|
4
|
+
import { LabelContext } from './chunk-QCA3ZR56.js';
|
|
5
|
+
import { isTextOnlyChildren } from './chunk-ZWU6DRRZ.js';
|
|
6
|
+
import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
|
|
7
|
+
import { HelperMessageContext } from './chunk-HZKFQ33E.js';
|
|
8
|
+
import { ErrorMessageContext } from './chunk-FAE27DLF.js';
|
|
9
|
+
import { _Text } from './chunk-XT2MZWEV.js';
|
|
10
|
+
import { TextContext } from './chunk-X6SER3TZ.js';
|
|
11
|
+
import { ClearContainerSlots } from './chunk-HXI3MEEK.js';
|
|
12
|
+
import { SlotProvider } from './chunk-M36KANKC.js';
|
|
13
|
+
import { cssModule } from './chunk-KVDXQMWI.js';
|
|
14
|
+
import { IconContext, AngleUpIcon, AngleDownIcon } from '@hopper-ui/icons';
|
|
15
|
+
import { useStyledSystem, useResponsiveValue } from '@hopper-ui/styled-system';
|
|
16
|
+
import { mergeRefs } from '@react-aria/utils';
|
|
17
|
+
import { useControlledState } from '@react-stately/utils';
|
|
18
|
+
import { forwardRef, useCallback } from 'react';
|
|
19
|
+
import { useObjectRef } from 'react-aria';
|
|
20
|
+
import { useContextProps, composeRenderProps, Input, NumberField as NumberField$1, Button } from 'react-aria-components';
|
|
21
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
22
|
+
|
|
23
|
+
// css-module:./NumberField.module.css#css-module
|
|
24
|
+
var NumberField_module_default = { "hop-NumberField": "NumberField-module__hop-NumberField___IQHRz", "hop-NumberField--fluid": "NumberField-module__hop-NumberField--fluid___cBL6Z", "hop-NumberField--mobile": "NumberField-module__hop-NumberField--mobile___83Tka", "hop-NumberField__Label": "NumberField-module__hop-NumberField__Label___QqEtX", "hop-NumberField__prefix": "NumberField-module__hop-NumberField__prefix___zfJ4v", "hop-NumberField__InputGroup": "NumberField-module__hop-NumberField__InputGroup___rpkuJ", "hop-NumberField__ErrorMessage": "NumberField-module__hop-NumberField__ErrorMessage___isGtg", "hop-NumberField__HelperMessage": "NumberField-module__hop-NumberField__HelperMessage___7p6WZ", "hop-NumberField__stepper-button": "NumberField-module__hop-NumberField__stepper-button___ofNwv", "hop-NumberField__stepper-button--increment": "NumberField-module__hop-NumberField__stepper-button--increment___BXGLT", "hop-NumberField__stepper-button--decrement": "NumberField-module__hop-NumberField__stepper-button--decrement___vWXrK", "hop-NumberField__stepper-button--mobile": "NumberField-module__hop-NumberField__stepper-button--mobile___lZj4N", "hop-NumberField__stepper-button__icon": "NumberField-module__hop-NumberField__stepper-button__icon___-KSsu", "hop-NumberField__input": "NumberField-module__hop-NumberField__input___lQVE0" };
|
|
25
|
+
var GlobalNumberFieldCssSelector = "hop-NumberField";
|
|
26
|
+
var StepperButton = ({ direction }) => {
|
|
27
|
+
const scale = useScale();
|
|
28
|
+
const isMobile = scale === "large";
|
|
29
|
+
const StepperIcon = direction === "increment" ? AngleUpIcon : AngleDownIcon;
|
|
30
|
+
const stepperClasses = cssModule(
|
|
31
|
+
NumberField_module_default,
|
|
32
|
+
"hop-NumberField__stepper-button",
|
|
33
|
+
direction,
|
|
34
|
+
isMobile && "mobile"
|
|
35
|
+
);
|
|
36
|
+
return /* @__PURE__ */ jsx(
|
|
37
|
+
Button,
|
|
38
|
+
{
|
|
39
|
+
className: stepperClasses,
|
|
40
|
+
slot: direction,
|
|
41
|
+
children: /* @__PURE__ */ jsx(
|
|
42
|
+
StepperIcon,
|
|
43
|
+
{
|
|
44
|
+
className: NumberField_module_default["hop-NumberField__stepper-button__icon"],
|
|
45
|
+
size: {
|
|
46
|
+
base: "md",
|
|
47
|
+
xs: "sm"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
};
|
|
54
|
+
function NumberField(props, ref) {
|
|
55
|
+
var _a;
|
|
56
|
+
const {
|
|
57
|
+
inputRef: userProvidedInputRef = null,
|
|
58
|
+
...propsWithoutRef
|
|
59
|
+
} = props;
|
|
60
|
+
[props, ref] = useContextProps(propsWithoutRef, ref, NumberFieldContext);
|
|
61
|
+
const { stylingProps, ...ownProps } = useStyledSystem(props);
|
|
62
|
+
const {
|
|
63
|
+
className,
|
|
64
|
+
style: styleProp,
|
|
65
|
+
size,
|
|
66
|
+
prefix,
|
|
67
|
+
placeholder,
|
|
68
|
+
onChange: onChangeProp,
|
|
69
|
+
children,
|
|
70
|
+
defaultValue,
|
|
71
|
+
value: valueProp,
|
|
72
|
+
isFluid: isFluidProp,
|
|
73
|
+
isDisabled,
|
|
74
|
+
isInvalid,
|
|
75
|
+
isRequired,
|
|
76
|
+
...otherProps
|
|
77
|
+
} = ownProps;
|
|
78
|
+
const inputRef = useObjectRef(mergeRefs(userProvidedInputRef, props.inputRef !== void 0 ? props.inputRef : null));
|
|
79
|
+
const isFluid = (_a = useResponsiveValue(isFluidProp)) != null ? _a : false;
|
|
80
|
+
const scale = useScale();
|
|
81
|
+
const isMobile = scale === "large";
|
|
82
|
+
const classNames = composeClassnameRenderProps(
|
|
83
|
+
className,
|
|
84
|
+
GlobalNumberFieldCssSelector,
|
|
85
|
+
cssModule(
|
|
86
|
+
NumberField_module_default,
|
|
87
|
+
"hop-NumberField",
|
|
88
|
+
isFluid && "fluid",
|
|
89
|
+
isMobile && "mobile"
|
|
90
|
+
),
|
|
91
|
+
stylingProps.className
|
|
92
|
+
);
|
|
93
|
+
const style = composeRenderProps(styleProp, (prev) => {
|
|
94
|
+
return {
|
|
95
|
+
...stylingProps.style,
|
|
96
|
+
...prev
|
|
97
|
+
};
|
|
98
|
+
});
|
|
99
|
+
const handleTextChanged = useCallback((value2) => {
|
|
100
|
+
onChangeProp == null ? void 0 : onChangeProp(value2);
|
|
101
|
+
}, [onChangeProp]);
|
|
102
|
+
const [value, onChange] = useControlledState(valueProp, defaultValue || 0, handleTextChanged);
|
|
103
|
+
const prefixMarkup = prefix ? /* @__PURE__ */ jsx(
|
|
104
|
+
SlotProvider,
|
|
105
|
+
{
|
|
106
|
+
values: [
|
|
107
|
+
[TextContext, { size, className: NumberField_module_default["hop-NumberField__prefix"] }],
|
|
108
|
+
[IconContext, { size, className: NumberField_module_default["hop-NumberField__prefix"] }]
|
|
109
|
+
],
|
|
110
|
+
children: isTextOnlyChildren(prefix) ? /* @__PURE__ */ jsx(_Text, { children: prefix }) : prefix
|
|
111
|
+
}
|
|
112
|
+
) : null;
|
|
113
|
+
const inputMarkup = /* @__PURE__ */ jsx(ClearContainerSlots, { children: /* @__PURE__ */ jsxs(
|
|
114
|
+
_InputGroup,
|
|
115
|
+
{
|
|
116
|
+
isFluid,
|
|
117
|
+
size,
|
|
118
|
+
className: NumberField_module_default["hop-NumberField__InputGroup"],
|
|
119
|
+
isDisabled,
|
|
120
|
+
isInvalid,
|
|
121
|
+
inputClassName: NumberField_module_default["hop-NumberField__input"],
|
|
122
|
+
inputType: "number",
|
|
123
|
+
children: [
|
|
124
|
+
prefixMarkup,
|
|
125
|
+
/* @__PURE__ */ jsx(
|
|
126
|
+
Input,
|
|
127
|
+
{
|
|
128
|
+
ref: inputRef,
|
|
129
|
+
placeholder
|
|
130
|
+
}
|
|
131
|
+
),
|
|
132
|
+
/* @__PURE__ */ jsx(StepperButton, { direction: "increment" }),
|
|
133
|
+
/* @__PURE__ */ jsx(StepperButton, { direction: "decrement" })
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
) });
|
|
137
|
+
const childrenMarkup = composeRenderProps(children, (prev) => {
|
|
138
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
139
|
+
/* @__PURE__ */ jsx(
|
|
140
|
+
SlotProvider,
|
|
141
|
+
{
|
|
142
|
+
values: [
|
|
143
|
+
[LabelContext, { className: NumberField_module_default["hop-NumberField__Label"], isRequired }],
|
|
144
|
+
[HelperMessageContext, { className: NumberField_module_default["hop-NumberField__HelperMessage"] }],
|
|
145
|
+
[ErrorMessageContext, { className: NumberField_module_default["hop-NumberField__ErrorMessage"] }]
|
|
146
|
+
],
|
|
147
|
+
children: prev
|
|
148
|
+
}
|
|
149
|
+
),
|
|
150
|
+
inputMarkup
|
|
151
|
+
] });
|
|
152
|
+
});
|
|
153
|
+
return /* @__PURE__ */ jsx(
|
|
154
|
+
NumberField$1,
|
|
155
|
+
{
|
|
156
|
+
ref,
|
|
157
|
+
value,
|
|
158
|
+
style,
|
|
159
|
+
className: classNames,
|
|
160
|
+
onChange,
|
|
161
|
+
isDisabled,
|
|
162
|
+
isInvalid,
|
|
163
|
+
isRequired,
|
|
164
|
+
...otherProps,
|
|
165
|
+
children: childrenMarkup
|
|
166
|
+
}
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
var _NumberField = forwardRef(NumberField);
|
|
170
|
+
_NumberField.displayName = "NumberField";
|
|
171
|
+
|
|
172
|
+
export { GlobalNumberFieldCssSelector, _NumberField };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SwitchContext } from './chunk-YHBJAXUY.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, 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___Mf5VL", "hop-Switch--sm": "Switch-module__hop-Switch--sm___-gT1c", "hop-Switch--md": "Switch-module__hop-Switch--md___bPSgp", "hop-Switch__indicator": "Switch-module__hop-Switch__indicator___Ak4ez", "hop-Switch__text": "Switch-module__hop-Switch__text___yWPwC", "hop-Switch__icon-list": "Switch-module__hop-Switch__icon-list___Lx1ak", "hop-Switch__icon": "Switch-module__hop-Switch__icon___vAPk1" };
|
|
18
18
|
var GlobalSwitchCssSelector = "hop-Switch";
|
|
19
19
|
function Switch(props, ref) {
|
|
20
20
|
var _a;
|
|
@@ -2,13 +2,13 @@ import { isFunction } from './chunk-TIPN4VYD.js';
|
|
|
2
2
|
import { useLoadOnScroll } from './chunk-JTNMFPM4.js';
|
|
3
3
|
import { SectionContext } from './chunk-5H5AZJPQ.js';
|
|
4
4
|
import { ListBoxContext } from './chunk-UIEP5BA5.js';
|
|
5
|
-
import { _ListBoxItem } from './chunk-
|
|
6
|
-
import { useLocalizedString } from './chunk-
|
|
5
|
+
import { _ListBoxItem } from './chunk-W474WFOP.js';
|
|
6
|
+
import { useLocalizedString } from './chunk-F4H76S4H.js';
|
|
7
7
|
import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
|
|
8
8
|
import { ListBoxItemContext } from './chunk-Y2POLIXK.js';
|
|
9
9
|
import { HeaderContext } from './chunk-7JOGKC3W.js';
|
|
10
10
|
import { DividerContext } from './chunk-FYIHMKHI.js';
|
|
11
|
-
import { _Text } from './chunk-
|
|
11
|
+
import { _Text } from './chunk-XT2MZWEV.js';
|
|
12
12
|
import { SlotProvider } from './chunk-M36KANKC.js';
|
|
13
13
|
import { cssModule } from './chunk-KVDXQMWI.js';
|
|
14
14
|
import { useStyledSystem, useResponsiveValue } from '@hopper-ui/styled-system';
|
|
@@ -18,7 +18,7 @@ import { useContextProps, composeRenderProps, ListBox as ListBox$1, Collection }
|
|
|
18
18
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
19
19
|
|
|
20
20
|
// css-module:./ListBox.module.css#css-module
|
|
21
|
-
var ListBox_module_default = { "hop-ListBox": "ListBox-module__hop-
|
|
21
|
+
var ListBox_module_default = { "hop-ListBox": "ListBox-module__hop-ListBox___84c8C", "hop-ListBox--fluid": "ListBox-module__hop-ListBox--fluid___mHn4u", "hop-ListBox__section": "ListBox-module__hop-ListBox__section___iv9s3", "hop-ListBox__item": "ListBox-module__hop-ListBox__item___rQ48O", "hop-ListBox__section-header": "ListBox-module__hop-ListBox__section-header___WUF4y", "hop-ListBox__divider": "ListBox-module__hop-ListBox__divider___PU1hF" };
|
|
22
22
|
var GlobalListBoxCssSelector = "hop-ListBox";
|
|
23
23
|
var GlobalListBoxEmptyItemCssSelector = "hop-ListBox__empty-item";
|
|
24
24
|
var ListBoxToTextSizeAdapter = {
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { _Radio } from './chunk-SSMGKQ27.js';
|
|
2
|
-
import { _RadioGroup } from './chunk-NHM3MQI3.js';
|
|
3
1
|
import { _RadioList } from './chunk-NKHMUPAP.js';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { _Radio } from './chunk-J44DIB5J.js';
|
|
3
|
+
import { _RadioGroup } from './chunk-EJUIYBAC.js';
|
|
4
|
+
import { _Checkbox } from './chunk-FOKTHCFK.js';
|
|
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 { ListBoxItemContext } from './chunk-Y2POLIXK.js';
|
|
8
|
-
import { _ListBoxItemSkeleton } from './chunk-
|
|
9
|
-
import { BadgeContext } from './chunk-CQDLZ42T.js';
|
|
10
|
-
import { isTextOnlyChildren } from './chunk-ZWU6DRRZ.js';
|
|
9
|
+
import { _ListBoxItemSkeleton } from './chunk-UT4CSUUM.js';
|
|
11
10
|
import { IconListContext } from './chunk-DHVVYSLB.js';
|
|
12
|
-
import {
|
|
11
|
+
import { BadgeContext } from './chunk-CQDLZ42T.js';
|
|
12
|
+
import { _Text } from './chunk-XT2MZWEV.js';
|
|
13
13
|
import { TextContext } from './chunk-X6SER3TZ.js';
|
|
14
|
+
import { AvatarContext } from './chunk-AES7QBQE.js';
|
|
14
15
|
import { SlotProvider } from './chunk-M36KANKC.js';
|
|
15
16
|
import { cssModule } from './chunk-KVDXQMWI.js';
|
|
16
17
|
import { CheckmarkIcon, IconContext } from '@hopper-ui/icons';
|
|
@@ -20,7 +21,7 @@ import { useContextProps, composeRenderProps, ListBoxItem as ListBoxItem$1, List
|
|
|
20
21
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
21
22
|
|
|
22
23
|
// css-module:./ListBoxItem.module.css#css-module
|
|
23
|
-
var ListBoxItem_module_default = { "hop-ListBoxItem": "ListBoxItem-module__hop-
|
|
24
|
+
var ListBoxItem_module_default = { "hop-ListBoxItem": "ListBoxItem-module__hop-ListBoxItem___u6Es7", "hop-ListBoxItem--xs": "ListBoxItem-module__hop-ListBoxItem--xs___yXyVw", "hop-ListBoxItem--sm": "ListBoxItem-module__hop-ListBoxItem--sm___937pQ", "hop-ListBoxItem--md": "ListBoxItem-module__hop-ListBoxItem--md___ymimv", "hop-ListBoxItem--lg": "ListBoxItem-module__hop-ListBoxItem--lg___1mW38", "hop-ListBoxItem__inner": "ListBoxItem-module__hop-ListBoxItem__inner___I35FE", "hop-ListBoxItem__checkmark": "ListBoxItem-module__hop-ListBoxItem__checkmark___LAbSz", "hop-ListBoxItem__description": "ListBoxItem-module__hop-ListBoxItem__description___EPW2R", "hop-ListBoxItem__radio-group": "ListBoxItem-module__hop-ListBoxItem__radio-group___g-HnK", "hop-ListBoxItem__checkbox": "ListBoxItem-module__hop-ListBoxItem__checkbox___ppGNP", "hop-ListBoxItem__avatar": "ListBoxItem-module__hop-ListBoxItem__avatar___QwkiM", "hop-ListBoxItem__icon-list": "ListBoxItem-module__hop-ListBoxItem__icon-list___Yhy58", "hop-ListBoxItem__icon": "ListBoxItem-module__hop-ListBoxItem__icon___mFm52", "hop-ListBoxItem__label": "ListBoxItem-module__hop-ListBoxItem__label___y1bWL", "hop-ListBoxItem__end-icon-list": "ListBoxItem-module__hop-ListBoxItem__end-icon-list___LBHo2", "hop-ListBoxItem__end-icon": "ListBoxItem-module__hop-ListBoxItem__end-icon___Luvle", "hop-ListBoxItem__badge": "ListBoxItem-module__hop-ListBoxItem__badge___bdsUo" };
|
|
24
25
|
var GlobalListBoxItemCssSelector = "hop-ListBoxItem";
|
|
25
26
|
var ListBoxItemToIconSizeAdapter = {
|
|
26
27
|
xs: "sm",
|
|
@@ -34,6 +35,12 @@ var ListBoxItemToTextSizeAdapter = {
|
|
|
34
35
|
md: "sm",
|
|
35
36
|
lg: "md"
|
|
36
37
|
};
|
|
38
|
+
var ListBoxItemToAvatarSizeAdapter = {
|
|
39
|
+
xs: "xs",
|
|
40
|
+
sm: "xs",
|
|
41
|
+
md: "md",
|
|
42
|
+
lg: "md"
|
|
43
|
+
};
|
|
37
44
|
function ListBoxItemInner(props) {
|
|
38
45
|
const stringFormatter = useLocalizedString();
|
|
39
46
|
const listStateContext = useContext(ListStateContext);
|
|
@@ -153,6 +160,11 @@ function ListBoxItemInner(props) {
|
|
|
153
160
|
[BadgeContext, {
|
|
154
161
|
className: ListBoxItem_module_default["hop-ListBoxItem__badge"],
|
|
155
162
|
isDisabled
|
|
163
|
+
}],
|
|
164
|
+
[AvatarContext, {
|
|
165
|
+
className: ListBoxItem_module_default["hop-ListBoxItem__avatar"],
|
|
166
|
+
isDisabled,
|
|
167
|
+
size: ListBoxItemToAvatarSizeAdapter[size]
|
|
156
168
|
}]
|
|
157
169
|
],
|
|
158
170
|
children
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _OverlineText } from './chunk-
|
|
1
|
+
import { _OverlineText } from './chunk-CEUQHDEQ.js';
|
|
2
2
|
import { BadgeContext } from './chunk-CQDLZ42T.js';
|
|
3
3
|
import { ClearContainerSlots } from './chunk-HXI3MEEK.js';
|
|
4
4
|
import { cssModule } from './chunk-KVDXQMWI.js';
|
|
@@ -9,7 +9,7 @@ import { useContextProps } from 'react-aria-components';
|
|
|
9
9
|
import { jsx } from 'react/jsx-runtime';
|
|
10
10
|
|
|
11
11
|
// css-module:./Badge.module.css#css-module
|
|
12
|
-
var Badge_module_default = { "hop-Badge": "Badge-module__hop-
|
|
12
|
+
var Badge_module_default = { "hop-Badge": "Badge-module__hop-Badge___lrDM9", "hop-Badge--primary": "Badge-module__hop-Badge--primary___B9IJu", "hop-Badge--secondary": "Badge-module__hop-Badge--secondary___rsYF4" };
|
|
13
13
|
var GlobalBadgeCssSelector = "hop-Badge";
|
|
14
14
|
function Badge(props, ref) {
|
|
15
15
|
[props, ref] = useContextProps(props, ref, BadgeContext);
|
|
@@ -47,6 +47,7 @@ function Badge(props, ref) {
|
|
|
47
47
|
slot: slot != null ? slot : void 0,
|
|
48
48
|
"data-disabled": isDisabled || void 0,
|
|
49
49
|
"aria-disabled": isDisabled || void 0,
|
|
50
|
+
"data-variant": variant,
|
|
50
51
|
children
|
|
51
52
|
}
|
|
52
53
|
) });
|
|
@@ -9,7 +9,7 @@ import { useContextProps, Text as Text$1 } from 'react-aria-components';
|
|
|
9
9
|
import { jsx } from 'react/jsx-runtime';
|
|
10
10
|
|
|
11
11
|
// css-module:./Text.module.css#css-module
|
|
12
|
-
var Text_module_default = { "hop-Text": "Text-module__hop-
|
|
12
|
+
var Text_module_default = { "hop-Text": "Text-module__hop-Text___7s-NC", "hop-Text--xs": "Text-module__hop-Text--xs___uRZNm", "hop-Text--sm": "Text-module__hop-Text--sm___LfDaA", "hop-Text--md": "Text-module__hop-Text--md___aGVbv", "hop-Text--lg": "Text-module__hop-Text--lg___TgsRg", "hop-Text--xl": "Text-module__hop-Text--xl___gAcxP", "hop-Text--2xl": "Text-module__hop-Text--2xl___n-9B9", "hop-Text--inherit": "Text-module__hop-Text--inherit___SEa0P" };
|
|
13
13
|
var GlobalTextCssSelector = "hop-Text";
|
|
14
14
|
function Text(props, ref) {
|
|
15
15
|
[props, ref] = useContextProps(props, ref, TextContext);
|
|
@@ -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 { DeletedUserRichIcon } from '@hopper-ui/icons';
|
|
4
4
|
import { useStyledSystem, useResponsiveValue } from '@hopper-ui/styled-system';
|
|
5
5
|
import clsx from 'clsx';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
|
|
3
|
+
// src/utils/src/useTruncatedText.ts
|
|
4
|
+
var useTruncatedText = () => {
|
|
5
|
+
const truncateText = useCallback((inputText, limit) => {
|
|
6
|
+
const segmenter = new Intl.Segmenter("en", { granularity: "grapheme" });
|
|
7
|
+
const segments = segmenter.segment(inputText);
|
|
8
|
+
let truncatedText = "";
|
|
9
|
+
let count = 0;
|
|
10
|
+
for (const segment of segments) {
|
|
11
|
+
if (limit && count + segment.segment.length > limit) {
|
|
12
|
+
break;
|
|
13
|
+
}
|
|
14
|
+
truncatedText += segment.segment;
|
|
15
|
+
count += segment.segment.length;
|
|
16
|
+
}
|
|
17
|
+
return truncatedText;
|
|
18
|
+
}, []);
|
|
19
|
+
return truncateText;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { useTruncatedText };
|
package/dist/i18n/src/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { useLocalizedString } from '../../chunk-
|
|
1
|
+
export { useLocalizedString } from '../../chunk-F4H76S4H.js';
|
|
2
2
|
import '../../chunk-JSBRDJBE.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { useLocalizedString } from '../../chunk-
|
|
1
|
+
export { useLocalizedString } from '../../chunk-F4H76S4H.js';
|
|
2
2
|
import '../../chunk-JSBRDJBE.js';
|