@hopper-ui/components 1.0.4 → 1.0.6
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 +13 -0
- package/README.md +3 -0
- package/dist/Avatar/src/AnonymousAvatar.css +69 -0
- package/dist/Avatar/src/AnonymousAvatar.d.ts +29 -0
- package/dist/Avatar/src/AnonymousAvatar.js +7 -0
- package/dist/Avatar/src/Avatar.css +265 -0
- package/dist/Avatar/src/Avatar.d.ts +60 -0
- package/dist/Avatar/src/Avatar.js +11 -0
- package/dist/Avatar/src/AvatarContext.d.ts +12 -0
- package/dist/Avatar/src/AvatarContext.js +2 -0
- package/dist/Avatar/src/DeletedAvatar.css +69 -0
- package/dist/Avatar/src/DeletedAvatar.d.ts +29 -0
- package/dist/Avatar/src/DeletedAvatar.js +7 -0
- package/dist/Avatar/src/RichIconAvatarImage.css +69 -0
- package/dist/Avatar/src/RichIconAvatarImage.d.ts +32 -0
- package/dist/Avatar/src/RichIconAvatarImage.js +5 -0
- package/dist/Avatar/src/RichIconAvatarImageContext.d.ts +14 -0
- package/dist/Avatar/src/RichIconAvatarImageContext.js +2 -0
- package/dist/Avatar/src/index.css +265 -0
- package/dist/Avatar/src/index.d.ts +14 -0
- package/dist/Avatar/src/index.js +13 -0
- package/dist/Avatar/src/useImageFallback.d.ts +34 -0
- package/dist/Avatar/src/useImageFallback.js +2 -0
- package/dist/{badge → Badge}/src/Badge.css +11 -11
- package/dist/{badge → Badge}/src/Badge.d.ts +1 -1
- package/dist/{badge → Badge}/src/Badge.js +4 -3
- package/dist/Badge/src/BadgeContext.js +2 -0
- package/dist/{badge → Badge}/src/index.css +11 -11
- package/dist/{badge → Badge}/src/index.js +4 -3
- package/dist/{chip → Chip}/src/Chip.css +34 -34
- package/dist/{chip → Chip}/src/Chip.js +6 -6
- package/dist/Chip/src/ChipContext.js +2 -0
- package/dist/{chip → Chip}/src/index.css +34 -34
- package/dist/{chip → Chip}/src/index.js +6 -6
- package/dist/Divider/src/Divider.css +32 -0
- package/dist/Divider/src/Divider.d.ts +15 -0
- package/dist/Divider/src/Divider.js +4 -0
- package/dist/Divider/src/DividerContext.d.ts +8 -0
- package/dist/Divider/src/DividerContext.js +2 -0
- package/dist/Divider/src/index.css +32 -0
- package/dist/Divider/src/index.d.ts +5 -0
- package/dist/Divider/src/index.js +4 -0
- package/dist/{errorMessage → ErrorMessage}/src/ErrorMessage.css +12 -12
- package/dist/{errorMessage → ErrorMessage}/src/ErrorMessage.js +5 -5
- package/dist/ErrorMessage/src/ErrorMessageContext.js +2 -0
- package/dist/{errorMessage → ErrorMessage}/src/index.css +12 -12
- package/dist/{errorMessage → ErrorMessage}/src/index.js +5 -5
- package/dist/Header/src/Header.d.ts +17 -0
- package/dist/Header/src/Header.js +3 -0
- package/dist/Header/src/HeaderContext.d.ts +10 -0
- package/dist/Header/src/HeaderContext.js +2 -0
- package/dist/Header/src/index.d.ts +7 -0
- package/dist/Header/src/index.js +3 -0
- package/dist/{helperMessage → HelperMessage}/src/HelperMessage.css +12 -12
- package/dist/{helperMessage → HelperMessage}/src/HelperMessage.js +5 -5
- package/dist/HelperMessage/src/HelperMessageContext.js +2 -0
- package/dist/{helperMessage → HelperMessage}/src/index.css +12 -12
- package/dist/{helperMessage → HelperMessage}/src/index.js +5 -5
- package/dist/HopperProvider/src/HopperProvider.d.ts +1 -1
- 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/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 +7 -7
- package/dist/Link/src/index.css +31 -31
- package/dist/Link/src/index.js +7 -7
- package/dist/ListBox/src/ListBox.css +1434 -0
- package/dist/ListBox/src/ListBox.d.ts +48 -0
- package/dist/ListBox/src/ListBox.js +34 -0
- package/dist/ListBox/src/ListBoxContext.d.ts +10 -0
- package/dist/ListBox/src/ListBoxContext.js +2 -0
- package/dist/ListBox/src/ListBoxItem.css +1297 -0
- package/dist/ListBox/src/ListBoxItem.d.ts +39 -0
- package/dist/ListBox/src/ListBoxItem.js +27 -0
- package/dist/ListBox/src/ListBoxItemContext.d.ts +9 -0
- package/dist/ListBox/src/ListBoxItemContext.js +2 -0
- package/dist/ListBox/src/ListBoxItemSkeleton.css +56 -0
- package/dist/ListBox/src/ListBoxItemSkeleton.d.ts +23 -0
- package/dist/ListBox/src/ListBoxItemSkeleton.js +4 -0
- package/dist/ListBox/src/ListBoxItemSkeletonContext.d.ts +10 -0
- package/dist/ListBox/src/ListBoxItemSkeletonContext.js +2 -0
- package/dist/ListBox/src/index.css +1434 -0
- package/dist/ListBox/src/index.d.ts +8 -0
- package/dist/ListBox/src/index.js +34 -0
- package/dist/ListBox/src/useLoadOnScroll.d.ts +16 -0
- package/dist/ListBox/src/useLoadOnScroll.js +2 -0
- package/dist/Section/src/Section.d.ts +19 -0
- package/dist/Section/src/Section.js +3 -0
- package/dist/Section/src/SectionContext.d.ts +9 -0
- package/dist/Section/src/SectionContext.js +2 -0
- package/dist/Section/src/index.d.ts +6 -0
- package/dist/Section/src/index.js +3 -0
- package/dist/Spinner/src/Spinner.css +19 -19
- package/dist/Spinner/src/Spinner.js +3 -3
- 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.d.ts +2 -2
- package/dist/buttons/src/Button.js +12 -12
- package/dist/buttons/src/ButtonGroup.css +11 -11
- package/dist/buttons/src/ButtonGroup.js +3 -3
- package/dist/buttons/src/ClearButton.css +12 -12
- package/dist/buttons/src/ClearButton.js +4 -4
- package/dist/buttons/src/EmbeddedButton.css +12 -12
- package/dist/buttons/src/EmbeddedButton.js +2 -2
- package/dist/buttons/src/index.css +126 -126
- package/dist/buttons/src/index.js +16 -16
- package/dist/checkbox/src/Checkbox.css +81 -96
- package/dist/checkbox/src/Checkbox.d.ts +3 -1
- package/dist/checkbox/src/Checkbox.js +6 -6
- package/dist/checkbox/src/CheckboxContext.d.ts +2 -0
- package/dist/checkbox/src/CheckboxField.css +15 -15
- package/dist/checkbox/src/CheckboxField.js +2 -2
- package/dist/checkbox/src/CheckboxGroup.css +118 -133
- package/dist/checkbox/src/CheckboxGroup.js +4 -4
- package/dist/checkbox/src/index.css +118 -133
- package/dist/checkbox/src/index.js +10 -10
- package/dist/{chunk-BGESEKEN.js → chunk-2XUHTPCX.js} +13 -7
- package/dist/{chunk-FGDSWA7S.js → chunk-37NW34QM.js} +5 -5
- package/dist/{chunk-F7HR3VI4.js → chunk-3A6TTZAA.js} +2 -2
- package/dist/{chunk-LSVXKVG4.js → chunk-3LH2JHUO.js} +4 -4
- package/dist/{chunk-ZAJJD5FY.js → chunk-4JAV3FIH.js} +6 -6
- package/dist/chunk-4TXFHYHL.js +52 -0
- package/dist/{chunk-OMBQ3J4O.js → chunk-53FHDOG7.js} +13 -7
- package/dist/chunk-5H5AZJPQ.js +7 -0
- package/dist/{chunk-WTKIUAHI.js → chunk-632B5YBQ.js} +1 -1
- package/dist/{chunk-XSASR6CK.js → chunk-6QMIRVLY.js} +2 -2
- package/dist/chunk-7JOGKC3W.js +7 -0
- package/dist/chunk-AES7QBQE.js +7 -0
- package/dist/chunk-BC5A7RHI.js +1260 -0
- package/dist/{chunk-HDYG2F3D.js → chunk-BKC74M6Y.js} +3 -3
- package/dist/{chunk-ZSFJVMJN.js → chunk-CQDLZ42T.js} +1 -1
- package/dist/chunk-E4ALW4MZ.js +250 -0
- package/dist/chunk-E4WFKXW4.js +161 -0
- package/dist/{chunk-PEPKE5SW.js → chunk-F2URSFJA.js} +5 -5
- package/dist/{chunk-ACVMW6YD.js → chunk-FAE27DLF.js} +1 -1
- package/dist/chunk-FYIHMKHI.js +7 -0
- package/dist/{chunk-Y7XWWUMU.js → chunk-G242LPQE.js} +2 -2
- package/dist/chunk-GFHBDUJD.js +17 -0
- package/dist/{chunk-2CKDJG6R.js → chunk-HR25MLRP.js} +1 -1
- package/dist/{chunk-ESVVLTEN.js → chunk-HZKFQ33E.js} +1 -1
- package/dist/chunk-I4VPBQI7.js +7 -0
- package/dist/chunk-ITQK6JTD.js +81 -0
- package/dist/chunk-J33IFG4U.js +46 -0
- package/dist/chunk-J53HGLCT.js +49 -0
- package/dist/{chunk-PDYU6DNF.js → chunk-JRDN364E.js} +5 -5
- package/dist/chunk-JTNMFPM4.js +41 -0
- package/dist/chunk-JUMJ6A3K.js +46 -0
- package/dist/chunk-JWW56J7M.js +7 -0
- package/dist/{chunk-BCHUEONM.js → chunk-K4ZGI7DJ.js} +1 -1
- package/dist/chunk-L5A2UTQV.js +43 -0
- package/dist/{chunk-6MSYEF4W.js → chunk-MED2BIDV.js} +2 -2
- package/dist/{chunk-QJBQRYJS.js → chunk-MVRI6GLQ.js} +3 -3
- package/dist/{chunk-Z3ID4UEE.js → chunk-N77LTZ4U.js} +3 -15
- package/dist/{chunk-ANVMQBBG.js → chunk-NMKBUGSO.js} +12 -1
- package/dist/chunk-NS3XVOQ7.js +53 -0
- package/dist/chunk-O5PTD6IN.js +41 -0
- package/dist/{chunk-5GRWAXTT.js → chunk-OHB5QR5P.js} +2 -2
- package/dist/chunk-OKZYR4RF.js +7 -0
- package/dist/{chunk-GBABMUAI.js → chunk-P5CWOV3L.js} +3 -3
- package/dist/{chunk-RCFB4SN4.js → chunk-QBCCF2C2.js} +6 -6
- package/dist/chunk-RA7PM75O.js +142 -0
- package/dist/{chunk-TSXPLL55.js → chunk-RCX5B3S3.js} +4 -4
- package/dist/{chunk-WGDP4ECF.js → chunk-RG4JKE4N.js} +3 -3
- package/dist/{chunk-LRXYIR2A.js → chunk-SOSHKMNI.js} +6 -5
- package/dist/chunk-UIEP5BA5.js +7 -0
- package/dist/{chunk-DZTMUFVC.js → chunk-V5GOY6TV.js} +2 -2
- package/dist/{chunk-Y3L6TPP3.js → chunk-XGKPMLYD.js} +8 -8
- package/dist/{chunk-N745TDH5.js → chunk-XRC7XE6B.js} +2 -2
- package/dist/chunk-Y2POLIXK.js +7 -0
- package/dist/{chunk-H6CDFWVR.js → chunk-ZOTVZM6F.js} +6 -2
- package/dist/i18n/src/index.js +1 -1
- package/dist/i18n/src/useLocalizedString.js +1 -1
- package/dist/inputs/src/InputGroup.css +12 -12
- package/dist/inputs/src/InputGroup.js +2 -2
- package/dist/inputs/src/PasswordField.css +1340 -570
- package/dist/inputs/src/PasswordField.js +80 -164
- package/dist/inputs/src/SearchField.css +1325 -576
- package/dist/inputs/src/SearchField.d.ts +2 -2
- package/dist/inputs/src/SearchField.js +80 -164
- package/dist/inputs/src/TextField.css +1337 -571
- package/dist/inputs/src/TextField.js +79 -56
- package/dist/inputs/src/index.css +1237 -471
- package/dist/inputs/src/index.d.ts +4 -0
- package/dist/inputs/src/index.js +79 -56
- package/dist/layout/src/Grid.d.ts +2 -22
- package/dist/layout/src/Grid.js +1 -1
- package/dist/layout/src/grid-helpers.d.ts +24 -0
- package/dist/layout/src/grid-helpers.js +2 -0
- package/dist/overlays/Popover/src/Popover.css +1480 -639
- package/dist/overlays/Popover/src/Popover.d.ts +5 -6
- package/dist/overlays/Popover/src/Popover.js +80 -54
- package/dist/overlays/Popover/src/PopoverContext.d.ts +1 -2
- package/dist/overlays/Popover/src/PopoverTrigger.d.ts +8 -0
- package/dist/overlays/Popover/src/PopoverTrigger.js +2 -0
- package/dist/overlays/Popover/src/index.css +1480 -639
- package/dist/overlays/Popover/src/index.d.ts +3 -2
- package/dist/overlays/Popover/src/index.js +80 -54
- package/dist/radio/src/Radio.css +69 -81
- package/dist/radio/src/Radio.d.ts +3 -1
- package/dist/radio/src/Radio.js +6 -6
- package/dist/radio/src/RadioContext.d.ts +2 -0
- package/dist/radio/src/RadioField.css +15 -15
- package/dist/radio/src/RadioField.js +4 -4
- package/dist/radio/src/RadioGroup.css +106 -118
- package/dist/radio/src/RadioGroup.js +5 -5
- package/dist/radio/src/index.css +106 -118
- package/dist/radio/src/index.js +11 -11
- package/dist/switch/src/Switch.css +27 -28
- package/dist/switch/src/Switch.js +6 -6
- package/dist/switch/src/SwitchField.css +15 -15
- package/dist/switch/src/SwitchField.js +2 -2
- package/dist/switch/src/index.css +33 -34
- package/dist/switch/src/index.js +7 -7
- package/dist/tag/src/Tag.css +1550 -633
- package/dist/tag/src/Tag.js +80 -52
- package/dist/tag/src/TagGroup.css +30 -30
- package/dist/tag/src/TagGroup.js +5 -5
- package/dist/tag/src/index.css +1550 -633
- package/dist/tag/src/index.js +80 -52
- package/dist/typography/Heading/src/Heading.css +1439 -522
- package/dist/typography/Heading/src/Heading.js +80 -52
- package/dist/typography/Heading/src/index.css +1439 -522
- package/dist/typography/Heading/src/index.js +80 -52
- package/dist/typography/Label/src/Label.css +9 -9
- package/dist/typography/Label/src/Label.js +1 -1
- package/dist/typography/Label/src/index.css +9 -9
- package/dist/typography/Label/src/index.js +1 -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 +3 -3
- package/dist/typography/Text/src/index.css +9 -9
- package/dist/typography/Text/src/index.js +3 -3
- package/dist/utils/src/index.d.ts +1 -1
- package/dist/utils/src/index.js +3 -3
- package/dist/utils/src/types.d.ts +16 -1
- package/package.json +5 -4
- package/dist/badge/src/BadgeContext.js +0 -2
- package/dist/chip/src/ChipContext.js +0 -2
- package/dist/chunk-CPWTHZGJ.js +0 -156
- package/dist/chunk-LJXTJRSB.js +0 -1
- package/dist/chunk-SWMFTL46.js +0 -373
- package/dist/chunk-TR7YX3IZ.js +0 -96
- package/dist/errorMessage/src/ErrorMessageContext.js +0 -2
- package/dist/helperMessage/src/HelperMessageContext.js +0 -2
- /package/dist/{badge → Badge}/src/BadgeContext.d.ts +0 -0
- /package/dist/{badge → Badge}/src/index.d.ts +0 -0
- /package/dist/{chip → Chip}/src/Chip.d.ts +0 -0
- /package/dist/{chip → Chip}/src/ChipContext.d.ts +0 -0
- /package/dist/{chip → Chip}/src/index.d.ts +0 -0
- /package/dist/{errorMessage → ErrorMessage}/src/ErrorMessage.d.ts +0 -0
- /package/dist/{errorMessage → ErrorMessage}/src/ErrorMessageContext.d.ts +0 -0
- /package/dist/{errorMessage → ErrorMessage}/src/index.d.ts +0 -0
- /package/dist/{helperMessage → HelperMessage}/src/HelperMessage.d.ts +0 -0
- /package/dist/{helperMessage → HelperMessage}/src/HelperMessageContext.d.ts +0 -0
- /package/dist/{helperMessage → HelperMessage}/src/index.d.ts +0 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { AvatarContext } from './chunk-AES7QBQE.js';
|
|
2
|
+
import { _RichIconAvatarImage } from './chunk-ITQK6JTD.js';
|
|
3
|
+
import { DeletedUserRichIcon } from '@hopper-ui/icons';
|
|
4
|
+
import { useStyledSystem, useResponsiveValue } from '@hopper-ui/styled-system';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
import { forwardRef } from 'react';
|
|
7
|
+
import { useContextProps } from 'react-aria-components';
|
|
8
|
+
import { jsx } from 'react/jsx-runtime';
|
|
9
|
+
|
|
10
|
+
var GlobalDeletedAvatarCssSelector = "hop-DeletedAvatar";
|
|
11
|
+
function DeletedAvatar(props, ref) {
|
|
12
|
+
var _a;
|
|
13
|
+
[props, ref] = useContextProps(props, ref, AvatarContext);
|
|
14
|
+
const { stylingProps, ...ownProps } = useStyledSystem(props);
|
|
15
|
+
const {
|
|
16
|
+
className,
|
|
17
|
+
size: sizeValue,
|
|
18
|
+
style,
|
|
19
|
+
...otherProps
|
|
20
|
+
} = ownProps;
|
|
21
|
+
const size = (_a = useResponsiveValue(sizeValue)) != null ? _a : "md";
|
|
22
|
+
const classNames = clsx(
|
|
23
|
+
className,
|
|
24
|
+
GlobalDeletedAvatarCssSelector,
|
|
25
|
+
stylingProps.className
|
|
26
|
+
);
|
|
27
|
+
const mergedStyles = {
|
|
28
|
+
...stylingProps.style,
|
|
29
|
+
...style
|
|
30
|
+
};
|
|
31
|
+
return /* @__PURE__ */ jsx(
|
|
32
|
+
_RichIconAvatarImage,
|
|
33
|
+
{
|
|
34
|
+
...otherProps,
|
|
35
|
+
className: classNames,
|
|
36
|
+
ref,
|
|
37
|
+
size,
|
|
38
|
+
style: mergedStyles,
|
|
39
|
+
children: /* @__PURE__ */ jsx(DeletedUserRichIcon, {})
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
var _DeletedAvatar = forwardRef(DeletedAvatar);
|
|
44
|
+
_DeletedAvatar.displayName = "DeletedAvatar";
|
|
45
|
+
|
|
46
|
+
export { GlobalDeletedAvatarCssSelector, _DeletedAvatar };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { DividerContext } from './chunk-FYIHMKHI.js';
|
|
2
|
+
import { cssModule } from './chunk-KVDXQMWI.js';
|
|
3
|
+
import { useStyledSystem } from '@hopper-ui/styled-system';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import { forwardRef } from 'react';
|
|
6
|
+
import { useContextProps, Separator } from 'react-aria-components';
|
|
7
|
+
import { jsx } from 'react/jsx-runtime';
|
|
8
|
+
|
|
9
|
+
// css-module:./Divider.module.css#css-module
|
|
10
|
+
var Divider_module_default = { "hop-Divider": "Divider-module__hop-Divider___lUCFu", "hop-Divider--vertical": "Divider-module__hop-Divider--vertical___uIryJ" };
|
|
11
|
+
var GlobalDividerCssSelector = "hop-Divider";
|
|
12
|
+
function Divider(props, ref) {
|
|
13
|
+
[props, ref] = useContextProps(props, ref, DividerContext);
|
|
14
|
+
const { stylingProps, ...ownProps } = useStyledSystem(props);
|
|
15
|
+
const {
|
|
16
|
+
className,
|
|
17
|
+
style,
|
|
18
|
+
orientation,
|
|
19
|
+
...otherProps
|
|
20
|
+
} = ownProps;
|
|
21
|
+
const classNames = clsx(
|
|
22
|
+
GlobalDividerCssSelector,
|
|
23
|
+
cssModule(
|
|
24
|
+
Divider_module_default,
|
|
25
|
+
"hop-Divider",
|
|
26
|
+
orientation
|
|
27
|
+
),
|
|
28
|
+
stylingProps.className,
|
|
29
|
+
className
|
|
30
|
+
);
|
|
31
|
+
const mergedStyles = {
|
|
32
|
+
...stylingProps.style,
|
|
33
|
+
...style
|
|
34
|
+
};
|
|
35
|
+
return /* @__PURE__ */ jsx(
|
|
36
|
+
Separator,
|
|
37
|
+
{
|
|
38
|
+
...otherProps,
|
|
39
|
+
ref,
|
|
40
|
+
className: classNames,
|
|
41
|
+
style: mergedStyles,
|
|
42
|
+
orientation
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
var _Divider = forwardRef(Divider);
|
|
47
|
+
_Divider.displayName = "Divider";
|
|
48
|
+
|
|
49
|
+
export { GlobalDividerCssSelector, _Divider };
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
+
import { RadioFieldContext } from './chunk-DGLAGYBD.js';
|
|
1
2
|
import { RadioGroupContext } from './chunk-5MBJWRZD.js';
|
|
2
3
|
import { RadioListContext } from './chunk-A7TZHALP.js';
|
|
3
4
|
import { RadioContext } from './chunk-FU5CCPLP.js';
|
|
4
|
-
import { RadioFieldContext } from './chunk-DGLAGYBD.js';
|
|
5
|
-
import { ErrorMessageContext } from './chunk-ACVMW6YD.js';
|
|
6
|
-
import { HelperMessageContext } from './chunk-ESVVLTEN.js';
|
|
7
5
|
import { LabelContext } from './chunk-QCA3ZR56.js';
|
|
8
6
|
import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
|
|
9
|
-
import {
|
|
7
|
+
import { ErrorMessageContext } from './chunk-FAE27DLF.js';
|
|
8
|
+
import { HelperMessageContext } from './chunk-HZKFQ33E.js';
|
|
10
9
|
import { SlotProvider } from './chunk-M36KANKC.js';
|
|
10
|
+
import { cssModule } from './chunk-KVDXQMWI.js';
|
|
11
11
|
import { useStyledSystem, useResponsiveValue } from '@hopper-ui/styled-system';
|
|
12
12
|
import { forwardRef } from 'react';
|
|
13
13
|
import { useContextProps, composeRenderProps, RadioGroup as RadioGroup$1 } from 'react-aria-components';
|
|
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___S6s5y", "hop-RadioGroup--bordered": "RadioGroup-module__hop-RadioGroup--bordered___CFrBV", "hop-RadioGroup--sm": "RadioGroup-module__hop-RadioGroup--sm___2p7Wk", "hop-RadioGroup--md": "RadioGroup-module__hop-RadioGroup--md___eqGjG", "hop-RadioGroup__label": "RadioGroup-module__hop-RadioGroup__label___7-iXB", "hop-RadioGroup__list": "RadioGroup-module__hop-RadioGroup__list___C5N0N", "hop-RadioGroup__radio": "RadioGroup-module__hop-RadioGroup__radio___k3eYk", "hop-RadioGroup__error-message": "RadioGroup-module__hop-RadioGroup__error-message___vOUPq", "hop-RadioGroup__helper-message": "RadioGroup-module__hop-RadioGroup__helper-message___uQgIj" };
|
|
18
18
|
var GlobalRadioGroupCssSelector = "hop-RadioGroup";
|
|
19
19
|
function RadioGroup(props, ref) {
|
|
20
20
|
var _a, _b;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { useIsomorphicLayoutEffect } from '@hopper-ui/styled-system';
|
|
2
|
+
import { useState, useRef, useCallback } from 'react';
|
|
3
|
+
|
|
4
|
+
// src/ListBox/src/useLoadOnScroll.ts
|
|
5
|
+
function useLoadOnScroll(props, ref) {
|
|
6
|
+
const { isLoading, onLoadMore, scrollOffset = 5 } = props;
|
|
7
|
+
const [hasLoaded, setHasLoaded] = useState(false);
|
|
8
|
+
const isLoadingRef = useRef(isLoading);
|
|
9
|
+
const prevProps = useRef(props);
|
|
10
|
+
const onScroll = useCallback(() => {
|
|
11
|
+
if (ref.current && !isLoadingRef.current && onLoadMore) {
|
|
12
|
+
const shouldLoadMore = ref.current.scrollHeight - ref.current.scrollTop - ref.current.clientHeight < scrollOffset;
|
|
13
|
+
if (shouldLoadMore) {
|
|
14
|
+
isLoadingRef.current = true;
|
|
15
|
+
onLoadMore();
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}, [onLoadMore, ref, scrollOffset]);
|
|
19
|
+
const lastContentSize = useRef(0);
|
|
20
|
+
useIsomorphicLayoutEffect(() => {
|
|
21
|
+
var _a;
|
|
22
|
+
const wasLoading = isLoadingRef.current;
|
|
23
|
+
if (props !== prevProps.current) {
|
|
24
|
+
isLoadingRef.current = isLoading;
|
|
25
|
+
prevProps.current = props;
|
|
26
|
+
}
|
|
27
|
+
const shouldLoadMore = !hasLoaded && (ref == null ? void 0 : ref.current) && !isLoadingRef.current && onLoadMore && ref.current.clientHeight === ref.current.scrollHeight && (wasLoading || ref.current.scrollHeight !== lastContentSize.current);
|
|
28
|
+
if (shouldLoadMore) {
|
|
29
|
+
isLoadingRef.current = true;
|
|
30
|
+
onLoadMore == null ? void 0 : onLoadMore();
|
|
31
|
+
setHasLoaded(true);
|
|
32
|
+
}
|
|
33
|
+
lastContentSize.current = ((_a = ref.current) == null ? void 0 : _a.scrollHeight) || 0;
|
|
34
|
+
return () => {
|
|
35
|
+
setHasLoaded(false);
|
|
36
|
+
};
|
|
37
|
+
}, [isLoading, onLoadMore, props, ref]);
|
|
38
|
+
return onScroll;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export { useLoadOnScroll };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { AvatarContext } from './chunk-AES7QBQE.js';
|
|
2
|
+
import { _RichIconAvatarImage } from './chunk-ITQK6JTD.js';
|
|
3
|
+
import { AnonymousRichIcon } from '@hopper-ui/icons';
|
|
4
|
+
import { useStyledSystem, useResponsiveValue } from '@hopper-ui/styled-system';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
import { forwardRef } from 'react';
|
|
7
|
+
import { useContextProps } from 'react-aria-components';
|
|
8
|
+
import { jsx } from 'react/jsx-runtime';
|
|
9
|
+
|
|
10
|
+
var GlobalAnonymousAvatarCssSelector = "hop-AnonymousAvatar";
|
|
11
|
+
function AnonymousAvatar(props, ref) {
|
|
12
|
+
var _a;
|
|
13
|
+
[props, ref] = useContextProps(props, ref, AvatarContext);
|
|
14
|
+
const { stylingProps, ...ownProps } = useStyledSystem(props);
|
|
15
|
+
const {
|
|
16
|
+
className,
|
|
17
|
+
size: sizeValue,
|
|
18
|
+
style,
|
|
19
|
+
...otherProps
|
|
20
|
+
} = ownProps;
|
|
21
|
+
const size = (_a = useResponsiveValue(sizeValue)) != null ? _a : "md";
|
|
22
|
+
const classNames = clsx(
|
|
23
|
+
className,
|
|
24
|
+
GlobalAnonymousAvatarCssSelector,
|
|
25
|
+
stylingProps.className
|
|
26
|
+
);
|
|
27
|
+
const mergedStyles = {
|
|
28
|
+
...stylingProps.style,
|
|
29
|
+
...style
|
|
30
|
+
};
|
|
31
|
+
return /* @__PURE__ */ jsx(
|
|
32
|
+
_RichIconAvatarImage,
|
|
33
|
+
{
|
|
34
|
+
...otherProps,
|
|
35
|
+
className: classNames,
|
|
36
|
+
ref,
|
|
37
|
+
size,
|
|
38
|
+
style: mergedStyles,
|
|
39
|
+
children: /* @__PURE__ */ jsx(AnonymousRichIcon, {})
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
var _AnonymousAvatar = forwardRef(AnonymousAvatar);
|
|
44
|
+
_AnonymousAvatar.displayName = "AnonymousAvatar";
|
|
45
|
+
|
|
46
|
+
export { GlobalAnonymousAvatarCssSelector, _AnonymousAvatar };
|
|
@@ -7,7 +7,7 @@ import { useContextProps, Text } from 'react-aria-components';
|
|
|
7
7
|
import { jsx } from 'react/jsx-runtime';
|
|
8
8
|
|
|
9
9
|
// css-module:./OverlineText.module.css#css-module
|
|
10
|
-
var OverlineText_module_default = { "hop-OverlineText": "OverlineText-module__hop-
|
|
10
|
+
var OverlineText_module_default = { "hop-OverlineText": "OverlineText-module__hop-OverlineText___a5x6R", "hop-OverlineText__text": "OverlineText-module__hop-OverlineText__text___TV62d" };
|
|
11
11
|
var GlobalOverlineTextCssSelector = "hop-OverlineText";
|
|
12
12
|
function OverlineText(props, ref) {
|
|
13
13
|
[props, ref] = useContextProps(props, ref, OverlineTextContext);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { HeaderContext } from './chunk-7JOGKC3W.js';
|
|
2
|
+
import { useStyledSystem } from '@hopper-ui/styled-system';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import { forwardRef } from 'react';
|
|
5
|
+
import { useContextProps, Header as Header$1 } from 'react-aria-components';
|
|
6
|
+
import { jsx } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
var GlobalHeaderCssSelector = "hop-Header";
|
|
9
|
+
function Header(props, ref) {
|
|
10
|
+
[props, ref] = useContextProps(props, ref, HeaderContext);
|
|
11
|
+
const { stylingProps, ...ownProps } = useStyledSystem(props);
|
|
12
|
+
const {
|
|
13
|
+
className,
|
|
14
|
+
children,
|
|
15
|
+
style,
|
|
16
|
+
slot,
|
|
17
|
+
...otherProps
|
|
18
|
+
} = ownProps;
|
|
19
|
+
const classNames = clsx(
|
|
20
|
+
GlobalHeaderCssSelector,
|
|
21
|
+
stylingProps.className,
|
|
22
|
+
className
|
|
23
|
+
);
|
|
24
|
+
const mergedStyles = {
|
|
25
|
+
...stylingProps.style,
|
|
26
|
+
...style
|
|
27
|
+
};
|
|
28
|
+
return /* @__PURE__ */ jsx(
|
|
29
|
+
Header$1,
|
|
30
|
+
{
|
|
31
|
+
...otherProps,
|
|
32
|
+
ref,
|
|
33
|
+
className: classNames,
|
|
34
|
+
style: mergedStyles,
|
|
35
|
+
slot: slot || void 0,
|
|
36
|
+
children
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
var _Header = forwardRef(Header);
|
|
41
|
+
_Header.displayName = "Header";
|
|
42
|
+
|
|
43
|
+
export { GlobalHeaderCssSelector, _Header };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EmbeddedButtonContext } from './chunk-O7IJYNVQ.js';
|
|
2
2
|
import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
|
|
3
|
-
import { cssModule } from './chunk-KVDXQMWI.js';
|
|
4
3
|
import { SlotProvider } from './chunk-M36KANKC.js';
|
|
4
|
+
import { cssModule } from './chunk-KVDXQMWI.js';
|
|
5
5
|
import { IconContext } from '@hopper-ui/icons';
|
|
6
6
|
import { useStyledSystem, useResponsiveValue } from '@hopper-ui/styled-system';
|
|
7
7
|
import { forwardRef } from 'react';
|
|
@@ -9,7 +9,7 @@ import { useContextProps, composeRenderProps, Button } from 'react-aria-componen
|
|
|
9
9
|
import { jsx } from 'react/jsx-runtime';
|
|
10
10
|
|
|
11
11
|
// css-module:./EmbeddedButton.module.css#css-module
|
|
12
|
-
var EmbeddedButton_module_default = { "hop-EmbeddedButton": "EmbeddedButton-module__hop-
|
|
12
|
+
var EmbeddedButton_module_default = { "hop-EmbeddedButton": "EmbeddedButton-module__hop-EmbeddedButton___-vxw3", "hop-EmbeddedButton--md": "EmbeddedButton-module__hop-EmbeddedButton--md___-R-Cb", "hop-EmbeddedButton--lg": "EmbeddedButton-module__hop-EmbeddedButton--lg___RoLAu", "hop-EmbeddedButton__icon": "EmbeddedButton-module__hop-EmbeddedButton__icon___JHGDE" };
|
|
13
13
|
var GlobalEmbeddedButtonCssSelector = "hop-EmbeddedButton";
|
|
14
14
|
function EmbeddedButton(props, ref) {
|
|
15
15
|
var _a;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ErrorMessageContext } from './chunk-ACVMW6YD.js';
|
|
2
1
|
import { useRenderProps } from './chunk-NH3IVMXB.js';
|
|
3
|
-
import {
|
|
2
|
+
import { ErrorMessageContext } from './chunk-FAE27DLF.js';
|
|
3
|
+
import { _Text } from './chunk-RG4JKE4N.js';
|
|
4
4
|
import { cssModule } from './chunk-KVDXQMWI.js';
|
|
5
5
|
import { WarningIcon } from '@hopper-ui/icons';
|
|
6
6
|
import { useStyledSystem } from '@hopper-ui/styled-system';
|
|
@@ -10,7 +10,7 @@ import { FieldErrorContext, useContextProps } from 'react-aria-components';
|
|
|
10
10
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
11
11
|
|
|
12
12
|
// css-module:./ErrorMessage.module.css#css-module
|
|
13
|
-
var ErrorMessage_module_default = { "hop-ErrorMessage": "ErrorMessage-module__hop-
|
|
13
|
+
var ErrorMessage_module_default = { "hop-ErrorMessage": "ErrorMessage-module__hop-ErrorMessage___SA3fD", "hop-ErrorMessage__icon": "ErrorMessage-module__hop-ErrorMessage__icon___cB2Bk" };
|
|
14
14
|
var GlobalErrorMessageCssSelector = "hop-ErrorMessage";
|
|
15
15
|
function ErrorMessage(props, ref) {
|
|
16
16
|
const validation = useContext(FieldErrorContext);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Div
|
|
1
|
+
import { Div } from '@hopper-ui/styled-system';
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
|
|
@@ -37,19 +37,7 @@ function Grid(props, ref) {
|
|
|
37
37
|
}
|
|
38
38
|
);
|
|
39
39
|
}
|
|
40
|
-
function repeat(count, repetition) {
|
|
41
|
-
return `repeat(${count}, ${Array.isArray(repetition) ? interpolateGridTemplateArray(repetition) : getSizingValue(repetition)})`;
|
|
42
|
-
}
|
|
43
|
-
function minmax(min, max) {
|
|
44
|
-
return `minmax(${getSizingValue(min)}, ${getSizingValue(max)})`;
|
|
45
|
-
}
|
|
46
|
-
function fitContent(dimension) {
|
|
47
|
-
return `fit-content(${getSizingValue(dimension)})`;
|
|
48
|
-
}
|
|
49
|
-
function interpolateGridTemplateArray(values) {
|
|
50
|
-
return values.map((x) => getSizingValue(x)).join(" ");
|
|
51
|
-
}
|
|
52
40
|
var _Grid = forwardRef(Grid);
|
|
53
|
-
_Grid.displayName = "
|
|
41
|
+
_Grid.displayName = "Grid";
|
|
54
42
|
|
|
55
|
-
export { _Grid
|
|
43
|
+
export { _Grid };
|
|
@@ -26,7 +26,18 @@ var HopperProvider = (props, ref) => {
|
|
|
26
26
|
if (navigate) {
|
|
27
27
|
content = /* @__PURE__ */ jsx(RouterProvider, { navigate, useHref, children });
|
|
28
28
|
}
|
|
29
|
-
return /* @__PURE__ */ jsx(
|
|
29
|
+
return /* @__PURE__ */ jsx(
|
|
30
|
+
StyledSystemProvider,
|
|
31
|
+
{
|
|
32
|
+
ref,
|
|
33
|
+
withBodyStyle,
|
|
34
|
+
colorScheme,
|
|
35
|
+
withCssVariables,
|
|
36
|
+
className: classNames,
|
|
37
|
+
...rest,
|
|
38
|
+
children: /* @__PURE__ */ jsx(I18nProvider, { locale, children: content })
|
|
39
|
+
}
|
|
40
|
+
);
|
|
30
41
|
};
|
|
31
42
|
var _HopperProvider = forwardRef(HopperProvider);
|
|
32
43
|
_HopperProvider.displayName = "HopperProvider";
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { useIsomorphicLayoutEffect } from '@hopper-ui/styled-system';
|
|
2
|
+
import { useState, useRef, useCallback } from 'react';
|
|
3
|
+
|
|
4
|
+
// src/Avatar/src/useImageFallback.ts
|
|
5
|
+
function useImageFallback(props) {
|
|
6
|
+
const { src, fallbackSrc, onError, onLoad } = props;
|
|
7
|
+
const [status, setStatus] = useState(src ? "loading" : "pending");
|
|
8
|
+
const [imageUrl, setImageUrl] = useState(src != null ? src : "");
|
|
9
|
+
const imageRef = useRef();
|
|
10
|
+
const load = useCallback(() => {
|
|
11
|
+
if (!src) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
flush();
|
|
15
|
+
const image = new Image();
|
|
16
|
+
image.src = src;
|
|
17
|
+
setImageUrl(src);
|
|
18
|
+
image.onload = (event) => {
|
|
19
|
+
flush();
|
|
20
|
+
setStatus("loaded");
|
|
21
|
+
onLoad == null ? void 0 : onLoad(event);
|
|
22
|
+
};
|
|
23
|
+
image.onerror = (event) => {
|
|
24
|
+
if (src !== fallbackSrc && image.src === src && fallbackSrc) {
|
|
25
|
+
setImageUrl(fallbackSrc);
|
|
26
|
+
image.src = fallbackSrc;
|
|
27
|
+
} else {
|
|
28
|
+
setStatus("failed");
|
|
29
|
+
flush();
|
|
30
|
+
}
|
|
31
|
+
onError == null ? void 0 : onError(event);
|
|
32
|
+
};
|
|
33
|
+
imageRef.current = image;
|
|
34
|
+
}, [src, onLoad, fallbackSrc, onError]);
|
|
35
|
+
const flush = () => {
|
|
36
|
+
if (imageRef.current) {
|
|
37
|
+
imageRef.current.onload = null;
|
|
38
|
+
imageRef.current.onerror = null;
|
|
39
|
+
imageRef.current = null;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
useIsomorphicLayoutEffect(() => {
|
|
43
|
+
if (status === "loading") {
|
|
44
|
+
load();
|
|
45
|
+
}
|
|
46
|
+
return () => {
|
|
47
|
+
flush();
|
|
48
|
+
};
|
|
49
|
+
}, [status, load]);
|
|
50
|
+
return { imageUrl, status };
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export { useImageFallback };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { SectionContext } from './chunk-5H5AZJPQ.js';
|
|
2
|
+
import { useStyledSystem } from '@hopper-ui/styled-system';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import { forwardRef } from 'react';
|
|
5
|
+
import { useContextProps, Section as Section$1 } from 'react-aria-components';
|
|
6
|
+
import { jsx } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
var GlobalSectionCssSelector = "hop-Section";
|
|
9
|
+
function Section(props, ref) {
|
|
10
|
+
[props, ref] = useContextProps(props, ref, SectionContext);
|
|
11
|
+
const { stylingProps, ...ownProps } = useStyledSystem(props);
|
|
12
|
+
const {
|
|
13
|
+
className,
|
|
14
|
+
children,
|
|
15
|
+
style,
|
|
16
|
+
...otherProps
|
|
17
|
+
} = ownProps;
|
|
18
|
+
const classNames = clsx(
|
|
19
|
+
GlobalSectionCssSelector,
|
|
20
|
+
stylingProps.className,
|
|
21
|
+
className
|
|
22
|
+
);
|
|
23
|
+
const mergedStyles = {
|
|
24
|
+
...stylingProps.style,
|
|
25
|
+
...style
|
|
26
|
+
};
|
|
27
|
+
return /* @__PURE__ */ jsx(
|
|
28
|
+
Section$1,
|
|
29
|
+
{
|
|
30
|
+
...otherProps,
|
|
31
|
+
ref,
|
|
32
|
+
className: classNames,
|
|
33
|
+
style: mergedStyles,
|
|
34
|
+
children
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
var _Section = forwardRef(Section);
|
|
39
|
+
_Section.displayName = "Section";
|
|
40
|
+
|
|
41
|
+
export { GlobalSectionCssSelector, _Section };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ClearButtonContext } from './chunk-DXVKHP4V.js';
|
|
2
|
-
import { _EmbeddedButton } from './chunk-
|
|
3
|
-
import { useLocalizedString } from './chunk-
|
|
2
|
+
import { _EmbeddedButton } from './chunk-MED2BIDV.js';
|
|
3
|
+
import { useLocalizedString } from './chunk-ZOTVZM6F.js';
|
|
4
4
|
import { DismissIcon } from '@hopper-ui/icons';
|
|
5
5
|
import { forwardRef } from 'react';
|
|
6
6
|
import { useContextProps } from 'react-aria-components';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { HelperMessageContext } from './chunk-
|
|
2
|
-
import { _Text } from './chunk-
|
|
1
|
+
import { HelperMessageContext } from './chunk-HZKFQ33E.js';
|
|
2
|
+
import { _Text } from './chunk-RG4JKE4N.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___msUnY", "hop-HelperMessage__icon": "HelperMessage-module__hop-HelperMessage__icon___-GUWj" };
|
|
13
13
|
var GlobalHelperMessageCssSelector = "hop-HelperMessage";
|
|
14
14
|
function HelperMessage(props, ref) {
|
|
15
15
|
const validation = useContext(FieldErrorContext);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { LinkContext } from './chunk-4VVNSXIB.js';
|
|
2
|
+
import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
|
|
1
3
|
import { isTextOnlyChildren } from './chunk-ZWU6DRRZ.js';
|
|
2
|
-
import {
|
|
4
|
+
import { IconListContext } from './chunk-DHVVYSLB.js';
|
|
5
|
+
import { _Text } from './chunk-RG4JKE4N.js';
|
|
3
6
|
import { TextContext } from './chunk-X6SER3TZ.js';
|
|
4
|
-
import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
|
|
5
|
-
import { cssModule } from './chunk-KVDXQMWI.js';
|
|
6
7
|
import { SlotProvider } from './chunk-M36KANKC.js';
|
|
7
|
-
import {
|
|
8
|
-
import { LinkContext } from './chunk-4VVNSXIB.js';
|
|
8
|
+
import { cssModule } from './chunk-KVDXQMWI.js';
|
|
9
9
|
import { IconContext } from '@hopper-ui/icons';
|
|
10
10
|
import { useStyledSystem, useResponsiveValue } from '@hopper-ui/styled-system';
|
|
11
11
|
import { forwardRef } from 'react';
|
|
@@ -13,7 +13,7 @@ import { useContextProps, composeRenderProps, DEFAULT_SLOT, Link as Link$1 } fro
|
|
|
13
13
|
import { jsx } from 'react/jsx-runtime';
|
|
14
14
|
|
|
15
15
|
// css-module:./Link.module.css#css-module
|
|
16
|
-
var Link_module_default = { "hop-Link": "Link-module__hop-
|
|
16
|
+
var Link_module_default = { "hop-Link": "Link-module__hop-Link___m4HlM", "hop-Link--quiet": "Link-module__hop-Link--quiet___PEKek", "hop-Link--primary": "Link-module__hop-Link--primary___-EqWZ", "hop-Link--secondary": "Link-module__hop-Link--secondary___UNknc", "hop-Link__icon": "Link-module__hop-Link__icon___KiZR6", "hop-Link__icon-list": "Link-module__hop-Link__icon-list___eu2Y4", "hop-Link__text": "Link-module__hop-Link__text___I34XD", "hop-Link__start-icon": "Link-module__hop-Link__start-icon___Klqm6", "hop-Link__start-icon-list": "Link-module__hop-Link__start-icon-list___23TDM" };
|
|
17
17
|
var GlobalLinkCssSelector = "hop-Link";
|
|
18
18
|
var LinkToIconSizeAdapter = {
|
|
19
19
|
inherit: void 0,
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { isFunction } from './chunk-TIPN4VYD.js';
|
|
2
|
+
import { useLoadOnScroll } from './chunk-JTNMFPM4.js';
|
|
3
|
+
import { SectionContext } from './chunk-5H5AZJPQ.js';
|
|
4
|
+
import { ListBoxContext } from './chunk-UIEP5BA5.js';
|
|
5
|
+
import { _ListBoxItem } from './chunk-E4ALW4MZ.js';
|
|
6
|
+
import { useLocalizedString } from './chunk-ZOTVZM6F.js';
|
|
7
|
+
import { ListBoxItemContext } from './chunk-Y2POLIXK.js';
|
|
8
|
+
import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
|
|
9
|
+
import { HeaderContext } from './chunk-7JOGKC3W.js';
|
|
10
|
+
import { DividerContext } from './chunk-FYIHMKHI.js';
|
|
11
|
+
import { _Text } from './chunk-RG4JKE4N.js';
|
|
12
|
+
import { SlotProvider } from './chunk-M36KANKC.js';
|
|
13
|
+
import { cssModule } from './chunk-KVDXQMWI.js';
|
|
14
|
+
import { useStyledSystem, useResponsiveValue } from '@hopper-ui/styled-system';
|
|
15
|
+
import clsx from 'clsx';
|
|
16
|
+
import { forwardRef } from 'react';
|
|
17
|
+
import { useContextProps, composeRenderProps, ListBox as ListBox$1, Collection } from 'react-aria-components';
|
|
18
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
19
|
+
|
|
20
|
+
// css-module:./ListBox.module.css#css-module
|
|
21
|
+
var ListBox_module_default = { "hop-ListBox": "ListBox-module__hop-ListBox___SARwA", "hop-ListBox--fluid": "ListBox-module__hop-ListBox--fluid___Imbbr", "hop-ListBox__section": "ListBox-module__hop-ListBox__section___EdImM", "hop-ListBox__item": "ListBox-module__hop-ListBox__item___-dZ1Z", "hop-ListBox__section-header": "ListBox-module__hop-ListBox__section-header___F18mO", "hop-ListBox__divider": "ListBox-module__hop-ListBox__divider___5vc2s" };
|
|
22
|
+
var GlobalListBoxCssSelector = "hop-ListBox";
|
|
23
|
+
var GlobalListBoxEmptyItemCssSelector = "hop-ListBox__empty-item";
|
|
24
|
+
var ListBoxToTextSizeAdapter = {
|
|
25
|
+
xs: "sm",
|
|
26
|
+
sm: "sm",
|
|
27
|
+
md: "sm",
|
|
28
|
+
lg: "md"
|
|
29
|
+
};
|
|
30
|
+
function ListBox(props, ref) {
|
|
31
|
+
var _a, _b;
|
|
32
|
+
[props, ref] = useContextProps(props, ref, ListBoxContext);
|
|
33
|
+
const { stylingProps, ...ownProps } = useStyledSystem(props);
|
|
34
|
+
const {
|
|
35
|
+
className,
|
|
36
|
+
children,
|
|
37
|
+
disallowEmptySelection: disallowEmptySelectionProp,
|
|
38
|
+
isFluid: isFluidProp,
|
|
39
|
+
isInvalid,
|
|
40
|
+
isLoading,
|
|
41
|
+
onLoadMore,
|
|
42
|
+
renderEmptyState,
|
|
43
|
+
size: sizeProp,
|
|
44
|
+
style: styleProp,
|
|
45
|
+
selectionIndicator = "check",
|
|
46
|
+
selectionMode,
|
|
47
|
+
...otherProps
|
|
48
|
+
} = ownProps;
|
|
49
|
+
const size = (_a = useResponsiveValue(sizeProp)) != null ? _a : "sm";
|
|
50
|
+
const isFluid = (_b = useResponsiveValue(isFluidProp)) != null ? _b : false;
|
|
51
|
+
const disallowEmptySelection = disallowEmptySelectionProp != null ? disallowEmptySelectionProp : selectionIndicator === "input" && selectionMode === "single";
|
|
52
|
+
const stringFormatter = useLocalizedString();
|
|
53
|
+
const classNames = composeClassnameRenderProps(
|
|
54
|
+
className,
|
|
55
|
+
GlobalListBoxCssSelector,
|
|
56
|
+
cssModule(
|
|
57
|
+
ListBox_module_default,
|
|
58
|
+
"hop-ListBox",
|
|
59
|
+
size,
|
|
60
|
+
isFluid && "fluid"
|
|
61
|
+
),
|
|
62
|
+
stylingProps.className
|
|
63
|
+
);
|
|
64
|
+
const emptyItemClassNames = clsx(
|
|
65
|
+
GlobalListBoxEmptyItemCssSelector,
|
|
66
|
+
cssModule(
|
|
67
|
+
ListBox_module_default,
|
|
68
|
+
"hop-ListBox__empty-item",
|
|
69
|
+
size
|
|
70
|
+
)
|
|
71
|
+
);
|
|
72
|
+
const style = composeRenderProps(styleProp, (prev) => {
|
|
73
|
+
return {
|
|
74
|
+
...stylingProps.style,
|
|
75
|
+
...prev
|
|
76
|
+
};
|
|
77
|
+
});
|
|
78
|
+
const onScroll = useLoadOnScroll({ isLoading, onLoadMore }, ref);
|
|
79
|
+
const renderChildren = () => {
|
|
80
|
+
if (props.items) {
|
|
81
|
+
return /* @__PURE__ */ jsx(Collection, { items: props.items, children: (item) => isFunction(children) ? children(item) : children });
|
|
82
|
+
}
|
|
83
|
+
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
84
|
+
};
|
|
85
|
+
const handleRenderEmptyState = (renderProps) => {
|
|
86
|
+
let result = null;
|
|
87
|
+
if (renderEmptyState && isFunction(renderEmptyState)) {
|
|
88
|
+
result = renderEmptyState(renderProps);
|
|
89
|
+
if (result) {
|
|
90
|
+
return /* @__PURE__ */ jsx(_Text, { className: emptyItemClassNames, size: ListBoxToTextSizeAdapter[size], children: result });
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return result;
|
|
94
|
+
};
|
|
95
|
+
return /* @__PURE__ */ jsx(
|
|
96
|
+
SlotProvider,
|
|
97
|
+
{
|
|
98
|
+
values: [
|
|
99
|
+
[HeaderContext, {
|
|
100
|
+
className: ListBox_module_default["hop-ListBox__section-header"]
|
|
101
|
+
}],
|
|
102
|
+
[SectionContext, {
|
|
103
|
+
className: ListBox_module_default["hop-ListBox__section"]
|
|
104
|
+
}],
|
|
105
|
+
[DividerContext, {
|
|
106
|
+
className: ListBox_module_default["hop-ListBox__divider"]
|
|
107
|
+
}],
|
|
108
|
+
[ListBoxItemContext, {
|
|
109
|
+
className: ListBox_module_default["hop-ListBox__item"],
|
|
110
|
+
size,
|
|
111
|
+
selectionIndicator,
|
|
112
|
+
isInvalid
|
|
113
|
+
}]
|
|
114
|
+
],
|
|
115
|
+
children: /* @__PURE__ */ jsxs(
|
|
116
|
+
ListBox$1,
|
|
117
|
+
{
|
|
118
|
+
...otherProps,
|
|
119
|
+
ref,
|
|
120
|
+
className: classNames,
|
|
121
|
+
disallowEmptySelection,
|
|
122
|
+
renderEmptyState: handleRenderEmptyState,
|
|
123
|
+
selectionMode,
|
|
124
|
+
style,
|
|
125
|
+
onScroll,
|
|
126
|
+
"data-loading": isLoading,
|
|
127
|
+
shouldSelectOnPressUp: true,
|
|
128
|
+
children: [
|
|
129
|
+
renderChildren(),
|
|
130
|
+
isLoading && Array.from({ length: 5 }).map((_, index) => {
|
|
131
|
+
return /* @__PURE__ */ jsx(_ListBoxItem, { id: `loadingListItem_${index.toString()}`, isLoading, size, textValue: stringFormatter.format("ListBoxItem.loadingTextValue") }, `loadingListItem_${index.toString()}`);
|
|
132
|
+
})
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
)
|
|
136
|
+
}
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
var _ListBox = forwardRef(ListBox);
|
|
140
|
+
_ListBox.displayName = "ListBox";
|
|
141
|
+
|
|
142
|
+
export { GlobalListBoxCssSelector, GlobalListBoxEmptyItemCssSelector, _ListBox };
|