@hopper-ui/components 1.2.1 → 1.3.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 +6 -0
- 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/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 +862 -605
- package/dist/Form/src/Form.js +66 -64
- package/dist/Form/src/index.css +862 -605
- package/dist/Form/src/index.js +66 -64
- 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 +2 -2
- package/dist/Link/src/index.css +31 -31
- package/dist/Link/src/index.js +2 -2
- package/dist/ListBox/src/ListBox.css +226 -198
- package/dist/ListBox/src/ListBox.js +11 -12
- package/dist/ListBox/src/ListBoxItem.css +208 -182
- package/dist/ListBox/src/ListBoxItem.js +10 -10
- package/dist/ListBox/src/ListBoxItemSkeleton.css +7 -7
- package/dist/ListBox/src/ListBoxItemSkeleton.js +1 -1
- package/dist/ListBox/src/index.css +226 -198
- package/dist/ListBox/src/index.js +11 -12
- package/dist/Select/src/Select.css +4368 -0
- package/dist/Select/src/Select.d.ts +93 -0
- package/dist/Select/src/Select.js +116 -0
- package/dist/Select/src/SelectContext.d.ts +16 -0
- package/dist/Select/src/SelectContext.js +2 -0
- package/dist/Select/src/SelectValue.css +443 -0
- package/dist/Select/src/SelectValue.d.ts +31 -0
- package/dist/Select/src/SelectValue.js +19 -0
- package/dist/Select/src/index.css +4368 -0
- package/dist/Select/src/index.d.ts +13 -0
- package/dist/Select/src/index.js +116 -0
- 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 +5 -5
- package/dist/buttons/src/ButtonGroup.css +11 -11
- package/dist/buttons/src/ButtonGroup.js +1 -1
- package/dist/buttons/src/ClearButton.css +70 -70
- package/dist/buttons/src/ClearButton.js +3 -3
- package/dist/buttons/src/EmbeddedButton.css +70 -70
- package/dist/buttons/src/EmbeddedButton.js +1 -1
- package/dist/buttons/src/index.css +175 -175
- package/dist/buttons/src/index.js +10 -10
- package/dist/checkbox/src/Checkbox.css +31 -31
- package/dist/checkbox/src/Checkbox.js +2 -2
- package/dist/checkbox/src/CheckboxField.css +15 -15
- package/dist/checkbox/src/CheckboxField.js +1 -1
- package/dist/checkbox/src/CheckboxGroup.css +60 -60
- package/dist/checkbox/src/CheckboxGroup.js +3 -3
- package/dist/checkbox/src/index.css +60 -60
- package/dist/checkbox/src/index.js +6 -6
- package/dist/{chunk-AGRQ7UGN.js → chunk-3573Q6QG.js} +2 -2
- package/dist/{chunk-C7XRB2J6.js → chunk-3ZRCYKIV.js} +2 -2
- package/dist/{chunk-J7BXE7WN.js → chunk-4RMADICI.js} +4 -4
- package/dist/{chunk-4H7PKEMJ.js → chunk-6C5RI4RT.js} +9 -11
- package/dist/{chunk-TM4R5NO7.js → chunk-6H5DRQZH.js} +2 -2
- package/dist/{chunk-4APVXEPA.js → chunk-7L5MCX2A.js} +2 -2
- package/dist/{chunk-SPFANCCV.js → chunk-AZJME7JV.js} +3 -3
- package/dist/{chunk-F47GZGT7.js → chunk-BODCT27J.js} +1 -1
- package/dist/{chunk-CXWMHWSS.js → chunk-BQITTESM.js} +1 -1
- package/dist/{chunk-BN32T6QQ.js → chunk-BRU54ERL.js} +2 -2
- package/dist/{chunk-WYBQCRQB.js → chunk-BTHPJL3A.js} +2 -2
- package/dist/{chunk-MX5BW5VE.js → chunk-C72PRNOP.js} +1 -1
- package/dist/{chunk-55AWCUQF.js → chunk-CAHZCRTK.js} +1 -1
- package/dist/{chunk-RLDQEH6F.js → chunk-CU36N5JQ.js} +4 -4
- package/dist/{chunk-VQC5F6I7.js → chunk-CWX45XWS.js} +3 -3
- package/dist/{chunk-K7DU4YR4.js → chunk-D5PBETXF.js} +1 -1
- package/dist/{chunk-DZKJZSTQ.js → chunk-D7DIUGRI.js} +1 -1
- package/dist/{chunk-YWIDJ55Q.js → chunk-DFVORYEU.js} +2 -2
- package/dist/{chunk-IUFABTFZ.js → chunk-DLZGJBL7.js} +1 -1
- package/dist/{chunk-6WKRP4MN.js → chunk-DXEWBV4C.js} +2 -2
- package/dist/chunk-EHXOXTDN.js +29 -0
- package/dist/{chunk-J6YYPRGY.js → chunk-FOXOPL2E.js} +5 -5
- package/dist/{chunk-XI3BX2TP.js → chunk-GRJ3VKHY.js} +5 -5
- package/dist/{chunk-XUCH26RT.js → chunk-HIDHDS2L.js} +2 -2
- package/dist/{chunk-CSE22YXO.js → chunk-JIRLWUDP.js} +3 -3
- package/dist/{chunk-THUFFPGX.js → chunk-JQMXGSAE.js} +1 -1
- package/dist/{chunk-QGC3OX7W.js → chunk-LFN43ROH.js} +2 -2
- package/dist/{chunk-ZEXXNE5U.js → chunk-LYPR2YMY.js} +5 -5
- package/dist/{chunk-RYZNMKWB.js → chunk-O2ZMTKCT.js} +1 -1
- package/dist/{chunk-T7QJEHL7.js → chunk-OLS7K6PO.js} +2 -2
- package/dist/{chunk-LXCCS4SA.js → chunk-QQI3KNHZ.js} +6 -7
- package/dist/{chunk-PUNJWQAN.js → chunk-SCXYAGZI.js} +271 -46
- package/dist/{chunk-462UBJV3.js → chunk-SKEMSZ63.js} +2 -2
- package/dist/{chunk-F4KQUFXI.js → chunk-SSDFINDD.js} +2 -2
- package/dist/chunk-T24MBA34.js +7 -0
- package/dist/{chunk-YXD3IR3T.js → chunk-T37HTUEU.js} +1 -1
- package/dist/{chunk-WQSVNGFJ.js → chunk-T3CLGQI6.js} +1 -1
- package/dist/{chunk-2DPE3H3G.js → chunk-T742LIIS.js} +1 -1
- package/dist/{chunk-F4H76S4H.js → chunk-TFVDF4YH.js} +4 -2
- package/dist/{chunk-MFFXNI66.js → chunk-TOWSC7FO.js} +4 -4
- package/dist/{chunk-ZPPQJKHC.js → chunk-TTY5HDLL.js} +2 -2
- package/dist/chunk-YB7IYQW4.js +118 -0
- package/dist/{chunk-TFELIWJO.js → chunk-ZHOQYYHY.js} +1 -1
- package/dist/i18n/src/index.js +1 -1
- package/dist/i18n/src/useLocalizedString.js +1 -1
- package/dist/index.css +862 -605
- package/dist/index.d.ts +6 -2
- package/dist/index.js +66 -64
- package/dist/inputs/src/InputGroup.css +14 -16
- package/dist/inputs/src/InputGroup.js +1 -1
- package/dist/inputs/src/NumberField.css +64 -65
- package/dist/inputs/src/NumberField.js +8 -8
- package/dist/inputs/src/PasswordField.css +218 -219
- package/dist/inputs/src/PasswordField.js +10 -10
- package/dist/inputs/src/SearchField.css +224 -225
- package/dist/inputs/src/SearchField.js +12 -12
- package/dist/inputs/src/TextArea.css +58 -59
- package/dist/inputs/src/TextArea.js +9 -9
- package/dist/inputs/src/TextField.css +219 -220
- package/dist/inputs/src/TextField.js +11 -11
- package/dist/inputs/src/index.css +271 -268
- package/dist/inputs/src/index.js +18 -18
- package/dist/overlays/Popover/src/Popover.css +862 -605
- package/dist/overlays/Popover/src/Popover.d.ts +26 -3
- package/dist/overlays/Popover/src/Popover.js +66 -64
- package/dist/overlays/Popover/src/PopoverContext.d.ts +3 -0
- package/dist/overlays/Popover/src/index.css +862 -605
- package/dist/overlays/Popover/src/index.d.ts +4 -1
- package/dist/overlays/Popover/src/index.js +66 -64
- package/dist/radio/src/Radio.css +31 -31
- package/dist/radio/src/Radio.js +2 -2
- package/dist/radio/src/RadioField.css +15 -15
- package/dist/radio/src/RadioField.js +2 -2
- package/dist/radio/src/RadioGroup.css +60 -60
- package/dist/radio/src/RadioGroup.js +2 -2
- package/dist/radio/src/index.css +60 -60
- package/dist/radio/src/index.js +6 -6
- package/dist/switch/src/Switch.css +25 -25
- package/dist/switch/src/Switch.js +2 -2
- package/dist/switch/src/SwitchField.css +15 -15
- package/dist/switch/src/SwitchField.js +2 -2
- package/dist/switch/src/index.css +31 -31
- package/dist/switch/src/index.js +4 -4
- package/dist/tag/src/Tag.css +301 -301
- package/dist/tag/src/Tag.js +6 -6
- package/dist/tag/src/TagGroup.css +22 -22
- package/dist/tag/src/TagGroup.js +2 -2
- package/dist/tag/src/index.css +314 -314
- package/dist/tag/src/index.js +9 -9
- 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 +3 -3
- package/dist/typography/Label/src/Label.js +2 -2
- package/dist/typography/Label/src/index.css +3 -3
- package/dist/typography/Label/src/index.js +2 -2
- package/dist/typography/OverlineText/src/OverlineText.css +6 -6
- package/dist/typography/OverlineText/src/OverlineText.js +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 +1 -0
- package/dist/utils/src/index.js +3 -2
- package/dist/utils/src/useIsOverflow.d.ts +5 -0
- package/dist/utils/src/useIsOverflow.js +2 -0
- package/package.json +6 -6
- package/dist/ListBox/src/useLoadOnScroll.d.ts +0 -16
- package/dist/ListBox/src/useLoadOnScroll.js +0 -2
- package/dist/chunk-JTNMFPM4.js +0 -41
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { useIsOverflow } from './chunk-EHXOXTDN.js';
|
|
2
|
+
import { useLocalizedString } from './chunk-TFVDF4YH.js';
|
|
3
|
+
import { composeClassnameRenderProps } from './chunk-65JPI4FL.js';
|
|
4
|
+
import { useRenderProps } from './chunk-NH3IVMXB.js';
|
|
5
|
+
import { _Text } from './chunk-D5PBETXF.js';
|
|
6
|
+
import { TextContext } from './chunk-X6SER3TZ.js';
|
|
7
|
+
import { ClearContainerSlots } from './chunk-HXI3MEEK.js';
|
|
8
|
+
import { AvatarContext } from './chunk-AES7QBQE.js';
|
|
9
|
+
import { SlotProvider } from './chunk-M36KANKC.js';
|
|
10
|
+
import { cssModule } from './chunk-KVDXQMWI.js';
|
|
11
|
+
import { IconContext } from '@hopper-ui/icons';
|
|
12
|
+
import { useStyledSystem, useResponsiveValue } from '@hopper-ui/styled-system';
|
|
13
|
+
import { filterDOMProps } from '@react-aria/utils';
|
|
14
|
+
import { forwardRef, useRef, useContext } from 'react';
|
|
15
|
+
import { useContextProps, SelectValueContext, SelectStateContext, useSlottedContext, SelectContext, composeRenderProps, DEFAULT_SLOT } from 'react-aria-components';
|
|
16
|
+
import { jsx } from 'react/jsx-runtime';
|
|
17
|
+
|
|
18
|
+
// css-module:./SelectValue.module.css#css-module
|
|
19
|
+
var SelectValue_module_default = { "hop-SelectValue": "SelectValue-module__hop-SelectValue___vmhD5", "hop-SelectValue__avatar": "SelectValue-module__hop-SelectValue__avatar___LzO40", "hop-SelectValue__icon": "SelectValue-module__hop-SelectValue__icon___2SitP", "hop-SelectValue__text": "SelectValue-module__hop-SelectValue__text___yJC6I", "hop-SelectValue__end-icon": "SelectValue-module__hop-SelectValue__end-icon___3K-em" };
|
|
20
|
+
var GlobalSelectValueCssSelector = "hop-SelectValue";
|
|
21
|
+
var SelectValueToAvatarSizeAdapter = {
|
|
22
|
+
sm: "xs",
|
|
23
|
+
md: "md"
|
|
24
|
+
};
|
|
25
|
+
function SelectValue(props, ref) {
|
|
26
|
+
var _a, _b, _c, _d;
|
|
27
|
+
[props, ref] = useContextProps(props, ref, SelectValueContext);
|
|
28
|
+
const { stylingProps, ...ownProps } = useStyledSystem(props);
|
|
29
|
+
const {
|
|
30
|
+
className,
|
|
31
|
+
size: sizeProp,
|
|
32
|
+
style: styleProp,
|
|
33
|
+
...otherProps
|
|
34
|
+
} = ownProps;
|
|
35
|
+
const size = (_a = useResponsiveValue(sizeProp)) != null ? _a : "sm";
|
|
36
|
+
const textRef = useRef(null);
|
|
37
|
+
const refForOverflowCheck = textRef.current ? textRef : ref;
|
|
38
|
+
const isOverflow = useIsOverflow(refForOverflowCheck);
|
|
39
|
+
const state = useContext(SelectStateContext);
|
|
40
|
+
const { placeholder } = useSlottedContext(SelectContext);
|
|
41
|
+
const selectedItem = (state == null ? void 0 : state.selectedKey) != null ? state.collection.getItem(state.selectedKey) : null;
|
|
42
|
+
const stringFormatter = useLocalizedString();
|
|
43
|
+
const textValue = (_b = state == null ? void 0 : state.selectedItem) == null ? void 0 : _b.textValue;
|
|
44
|
+
const classNames = composeClassnameRenderProps(
|
|
45
|
+
className,
|
|
46
|
+
GlobalSelectValueCssSelector,
|
|
47
|
+
cssModule(
|
|
48
|
+
SelectValue_module_default,
|
|
49
|
+
"hop-SelectValue"
|
|
50
|
+
),
|
|
51
|
+
stylingProps.className
|
|
52
|
+
);
|
|
53
|
+
const style = composeRenderProps(styleProp, (prev) => {
|
|
54
|
+
return {
|
|
55
|
+
...stylingProps.style,
|
|
56
|
+
...prev
|
|
57
|
+
};
|
|
58
|
+
});
|
|
59
|
+
const renderProps = useRenderProps({
|
|
60
|
+
...otherProps,
|
|
61
|
+
className: classNames,
|
|
62
|
+
defaultChildren: textValue || placeholder || stringFormatter.format("Select.placeholder"),
|
|
63
|
+
style,
|
|
64
|
+
values: {
|
|
65
|
+
selectedItem: (_d = (_c = state == null ? void 0 : state.selectedItem) == null ? void 0 : _c.value) != null ? _d : null,
|
|
66
|
+
selectedText: textValue != null ? textValue : null,
|
|
67
|
+
isPlaceholder: !selectedItem
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
const DOMProps = filterDOMProps(ownProps);
|
|
71
|
+
return /* @__PURE__ */ jsx(ClearContainerSlots, { children: /* @__PURE__ */ jsx(
|
|
72
|
+
_Text,
|
|
73
|
+
{
|
|
74
|
+
ref,
|
|
75
|
+
...DOMProps,
|
|
76
|
+
...renderProps,
|
|
77
|
+
size,
|
|
78
|
+
title: isOverflow ? textValue : void 0,
|
|
79
|
+
"data-placeholder": !selectedItem || void 0,
|
|
80
|
+
children: /* @__PURE__ */ jsx(
|
|
81
|
+
SlotProvider,
|
|
82
|
+
{
|
|
83
|
+
values: [
|
|
84
|
+
[AvatarContext, {
|
|
85
|
+
className: SelectValue_module_default["hop-SelectValue__avatar"],
|
|
86
|
+
size: SelectValueToAvatarSizeAdapter[size]
|
|
87
|
+
}],
|
|
88
|
+
[TextContext, {
|
|
89
|
+
slots: {
|
|
90
|
+
"label": {
|
|
91
|
+
className: SelectValue_module_default["hop-SelectValue__text"],
|
|
92
|
+
ref: textRef
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}],
|
|
96
|
+
[IconContext, {
|
|
97
|
+
slots: {
|
|
98
|
+
[DEFAULT_SLOT]: {
|
|
99
|
+
className: SelectValue_module_default["hop-SelectValue__icon"],
|
|
100
|
+
size
|
|
101
|
+
},
|
|
102
|
+
"end-icon": {
|
|
103
|
+
className: SelectValue_module_default["hop-SelectValue__end-icon"],
|
|
104
|
+
size
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}]
|
|
108
|
+
],
|
|
109
|
+
children: renderProps.children
|
|
110
|
+
}
|
|
111
|
+
)
|
|
112
|
+
}
|
|
113
|
+
) });
|
|
114
|
+
}
|
|
115
|
+
var _SelectValue = forwardRef(SelectValue);
|
|
116
|
+
_SelectValue.displayName = "SelectValue";
|
|
117
|
+
|
|
118
|
+
export { GlobalSelectValueCssSelector, _SelectValue };
|
|
@@ -9,7 +9,7 @@ import { useContextProps, useSlottedContext, InputContext, TextAreaContext, Fiel
|
|
|
9
9
|
import { jsx } from 'react/jsx-runtime';
|
|
10
10
|
|
|
11
11
|
// css-module:./InputGroup.module.css#css-module
|
|
12
|
-
var InputGroup_module_default = { "hop-InputGroup": "InputGroup-module__hop-
|
|
12
|
+
var InputGroup_module_default = { "hop-InputGroup": "InputGroup-module__hop-InputGroup___nX1AB", "hop-InputGroup--fluid": "InputGroup-module__hop-InputGroup--fluid___cl9VB", "hop-InputGroup--sm": "InputGroup-module__hop-InputGroup--sm___W9UwB", "hop-InputGroup__input": "InputGroup-module__hop-InputGroup__input___VIhOd", "hop-InputGroup__textarea": "InputGroup-module__hop-InputGroup__textarea___9H21Z" };
|
|
13
13
|
var GlobalInputGroupCssSelector = "hop-InputGroup";
|
|
14
14
|
function InputGroup(props, ref) {
|
|
15
15
|
var _a, _b;
|
package/dist/i18n/src/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { useLocalizedString } from '../../chunk-
|
|
1
|
+
export { useLocalizedString } from '../../chunk-TFVDF4YH.js';
|
|
2
2
|
import '../../chunk-JSBRDJBE.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { useLocalizedString } from '../../chunk-
|
|
1
|
+
export { useLocalizedString } from '../../chunk-TFVDF4YH.js';
|
|
2
2
|
import '../../chunk-JSBRDJBE.js';
|