@hopper-ui/components 1.0.11 → 1.0.13
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/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/Chip/src/Chip.css +33 -33
- package/dist/Chip/src/Chip.js +2 -2
- package/dist/Chip/src/index.css +33 -33
- package/dist/Chip/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/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 +179 -256
- package/dist/ListBox/src/ListBox.js +10 -10
- package/dist/ListBox/src/ListBoxItem.css +164 -241
- package/dist/ListBox/src/ListBoxItem.js +9 -9
- package/dist/ListBox/src/ListBoxItemSkeleton.css +7 -7
- package/dist/ListBox/src/ListBoxItemSkeleton.js +1 -1
- package/dist/ListBox/src/index.css +179 -256
- package/dist/ListBox/src/index.js +10 -10
- package/dist/Spinner/src/Spinner.css +83 -83
- package/dist/Spinner/src/Spinner.js +5 -3
- package/dist/Spinner/src/index.css +83 -83
- package/dist/Spinner/src/index.js +5 -3
- package/dist/buttons/src/Button.css +156 -236
- package/dist/buttons/src/Button.js +3 -5
- package/dist/buttons/src/ButtonGroup.css +11 -11
- package/dist/buttons/src/ButtonGroup.js +1 -1
- package/dist/buttons/src/ClearButton.css +12 -12
- package/dist/buttons/src/ClearButton.js +2 -2
- package/dist/buttons/src/EmbeddedButton.css +12 -12
- package/dist/buttons/src/EmbeddedButton.js +1 -1
- package/dist/buttons/src/index.css +179 -259
- package/dist/buttons/src/index.js +6 -8
- package/dist/checkbox/src/Checkbox.css +31 -37
- 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 +70 -140
- package/dist/checkbox/src/CheckboxGroup.js +2 -2
- package/dist/checkbox/src/index.css +70 -140
- package/dist/checkbox/src/index.js +5 -5
- package/dist/{chunk-L2HJORV2.js → chunk-2MUGMKNO.js} +3 -4
- package/dist/{chunk-TP6OU6SQ.js → chunk-44KY7MFF.js} +5 -5
- package/dist/{chunk-YLUVOHHC.js → chunk-5WWMVQI4.js} +1 -1
- package/dist/{chunk-JTX4ZTQ6.js → chunk-723W7LGB.js} +3 -3
- package/dist/{chunk-OFNA3Y6A.js → chunk-AMXRADUV.js} +9 -5
- package/dist/{chunk-ZINTZZLE.js → chunk-AYPCLDGU.js} +1 -1
- package/dist/{chunk-UAKDD5TO.js → chunk-B42AJF74.js} +7 -7
- package/dist/{chunk-7PFCZHVB.js → chunk-CCIVRIKG.js} +5 -4
- package/dist/{chunk-3XZXPN6Y.js → chunk-CS2RAWQB.js} +3 -3
- package/dist/{chunk-4SPQFKVC.js → chunk-CXIH6I5X.js} +2 -2
- package/dist/{chunk-OWWIZWZA.js → chunk-DZHRELLA.js} +1 -1
- package/dist/{chunk-5SHNL47W.js → chunk-ERE2XRQA.js} +1 -1
- package/dist/{chunk-TYMV4JQ2.js → chunk-ESRYOELK.js} +2 -2
- package/dist/{chunk-P62FAV3S.js → chunk-GH5LAOQU.js} +1 -1
- package/dist/{chunk-QQBJ4REK.js → chunk-I2YZLGRE.js} +4 -7
- package/dist/{chunk-LRJ5ZWXY.js → chunk-IEE2HHGR.js} +1 -1
- package/dist/{chunk-5VWMGH3R.js → chunk-JLUFMLGV.js} +1 -1
- package/dist/{chunk-HTM3ZSBX.js → chunk-JN2FF2IX.js} +1 -1
- package/dist/{chunk-7GVDINGU.js → chunk-KARK64JC.js} +1 -1
- package/dist/{chunk-EZX4K3AY.js → chunk-LDORNYHF.js} +2 -2
- package/dist/{chunk-B5563GK3.js → chunk-M4IVTAHY.js} +4 -4
- package/dist/chunk-MTDFS4CZ.js +12 -0
- package/dist/{chunk-N65OIMRV.js → chunk-MVWQVBTK.js} +3 -4
- package/dist/{chunk-B3EA6PO5.js → chunk-NHM3MQI3.js} +3 -4
- package/dist/{chunk-PPO5T6D3.js → chunk-PAYZGXTT.js} +1 -1
- package/dist/{chunk-NFOY572L.js → chunk-QTV45NTY.js} +2 -2
- package/dist/{chunk-GDCTBE7C.js → chunk-RGGVZKNN.js} +2 -2
- package/dist/{chunk-K7RORXVD.js → chunk-RXZQB35O.js} +2 -2
- package/dist/{chunk-BKYHKRAJ.js → chunk-SNWJJ3FF.js} +1 -1
- package/dist/{chunk-I3OSQDQM.js → chunk-SSMGKQ27.js} +2 -2
- package/dist/{chunk-W5DFK35A.js → chunk-SW7LHIQ2.js} +7 -7
- package/dist/{chunk-RYSCBMR6.js → chunk-THQZBL4T.js} +1 -1
- package/dist/{chunk-GAPQ6VJL.js → chunk-TNVYVDLF.js} +3 -3
- package/dist/{chunk-WC72FIUS.js → chunk-UGHMX7QX.js} +3 -3
- package/dist/{chunk-AB24MF66.js → chunk-UPR32DV5.js} +2 -2
- package/dist/{chunk-BRIG7AIE.js → chunk-W34MMJ2L.js} +2 -2
- package/dist/{chunk-WQPDNKWM.js → chunk-WCLGYVXV.js} +1 -1
- package/dist/chunk-ZQ3AWYRR.js +7 -0
- package/dist/{chunk-KUX5YOEF.js → chunk-ZXDN2IRM.js} +1 -1
- package/dist/index.css +469 -573
- package/dist/index.d.ts +1 -0
- package/dist/index.js +49 -48
- package/dist/inputs/src/InputGroup.css +14 -12
- package/dist/inputs/src/InputGroup.d.ts +1 -0
- package/dist/inputs/src/InputGroup.js +1 -1
- package/dist/inputs/src/NumberField.css +517 -0
- package/dist/inputs/src/NumberField.d.ts +37 -0
- package/dist/inputs/src/NumberField.js +177 -0
- package/dist/inputs/src/NumberFieldContext.d.ts +8 -0
- package/dist/inputs/src/NumberFieldContext.js +2 -0
- package/dist/inputs/src/PasswordField.css +234 -306
- package/dist/inputs/src/PasswordField.js +8 -8
- package/dist/inputs/src/SearchField.css +240 -311
- package/dist/inputs/src/SearchField.js +9 -9
- package/dist/inputs/src/TextField.css +235 -307
- package/dist/inputs/src/TextField.js +10 -10
- package/dist/inputs/src/index.css +253 -344
- package/dist/inputs/src/index.js +13 -13
- package/dist/overlays/Popover/src/Popover.css +469 -573
- package/dist/overlays/Popover/src/Popover.js +49 -48
- package/dist/overlays/Popover/src/index.css +469 -573
- package/dist/overlays/Popover/src/index.js +49 -48
- package/dist/radio/src/Radio.css +31 -38
- 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 +70 -141
- package/dist/radio/src/RadioGroup.js +2 -2
- package/dist/radio/src/index.css +70 -141
- package/dist/radio/src/index.js +5 -5
- 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 +1 -1
- package/dist/switch/src/index.css +31 -31
- package/dist/switch/src/index.js +3 -3
- package/dist/tag/src/Tag.css +469 -573
- package/dist/tag/src/Tag.js +49 -48
- package/dist/tag/src/TagGroup.css +32 -96
- package/dist/tag/src/TagGroup.js +2 -2
- package/dist/tag/src/index.css +469 -573
- package/dist/tag/src/index.js +49 -48
- 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 +13 -77
- package/dist/typography/Label/src/Label.d.ts +1 -6
- package/dist/typography/Label/src/Label.js +1 -1
- package/dist/typography/Label/src/index.css +13 -77
- 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 +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 +1 -0
- package/dist/utils/src/useScale.d.ts +11 -0
- package/dist/utils/src/useScale.js +2 -0
- package/package.json +2 -2
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { NumberFieldContext } from '../../chunk-ZQ3AWYRR.js';
|
|
2
|
+
import { useScale } from '../../chunk-MTDFS4CZ.js';
|
|
3
|
+
import '../../chunk-LJXTJRSB.js';
|
|
4
|
+
import '../../chunk-I2YZLGRE.js';
|
|
5
|
+
import '../../chunk-ERE2XRQA.js';
|
|
6
|
+
import '../../chunk-TXZ6BMFR.js';
|
|
7
|
+
import { _InputGroup } from '../../chunk-CCIVRIKG.js';
|
|
8
|
+
import '../../chunk-6BFSSZCY.js';
|
|
9
|
+
import { LabelContext } from '../../chunk-QCA3ZR56.js';
|
|
10
|
+
import { composeClassnameRenderProps } from '../../chunk-65JPI4FL.js';
|
|
11
|
+
import { HelperMessageContext } from '../../chunk-HZKFQ33E.js';
|
|
12
|
+
import { ErrorMessageContext } from '../../chunk-FAE27DLF.js';
|
|
13
|
+
import '../../chunk-5WWMVQI4.js';
|
|
14
|
+
import '../../chunk-WPNVVGFW.js';
|
|
15
|
+
import { isTextOnlyChildren } from '../../chunk-ZWU6DRRZ.js';
|
|
16
|
+
import { _Text } from '../../chunk-PAYZGXTT.js';
|
|
17
|
+
import { TextContext } from '../../chunk-X6SER3TZ.js';
|
|
18
|
+
import { ClearContainerSlots } from '../../chunk-HXI3MEEK.js';
|
|
19
|
+
import { SlotProvider } from '../../chunk-M36KANKC.js';
|
|
20
|
+
import { cssModule } from '../../chunk-KVDXQMWI.js';
|
|
21
|
+
import '../../chunk-JSBRDJBE.js';
|
|
22
|
+
import { IconContext, AngleUpIcon, AngleDownIcon } from '@hopper-ui/icons';
|
|
23
|
+
import { useStyledSystem, useResponsiveValue } from '@hopper-ui/styled-system';
|
|
24
|
+
import { mergeRefs } from '@react-aria/utils';
|
|
25
|
+
import { useControlledState } from '@react-stately/utils';
|
|
26
|
+
import { forwardRef, useCallback } from 'react';
|
|
27
|
+
import { useObjectRef } from 'react-aria';
|
|
28
|
+
import { useContextProps, composeRenderProps, Input, NumberField as NumberField$1, Button } from 'react-aria-components';
|
|
29
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
30
|
+
|
|
31
|
+
// css-module:./NumberField.module.css#css-module
|
|
32
|
+
var NumberField_module_default = { "hop-NumberField": "NumberField-module__hop-NumberField___AAaVN", "hop-NumberField--fluid": "NumberField-module__hop-NumberField--fluid___rVrvC", "hop-NumberField--mobile": "NumberField-module__hop-NumberField--mobile___T-kUj", "hop-NumberField__Label": "NumberField-module__hop-NumberField__Label___5I8jv", "hop-NumberField__prefix": "NumberField-module__hop-NumberField__prefix___Q0Gr1", "hop-NumberField__InputGroup": "NumberField-module__hop-NumberField__InputGroup___3zR9a", "hop-NumberField__ErrorMessage": "NumberField-module__hop-NumberField__ErrorMessage___EM5fn", "hop-NumberField__HelperMessage": "NumberField-module__hop-NumberField__HelperMessage___vnwQj", "hop-NumberField__stepper-button": "NumberField-module__hop-NumberField__stepper-button___OL7-O", "hop-NumberField__stepper-button--increment": "NumberField-module__hop-NumberField__stepper-button--increment___W5YHN", "hop-NumberField__stepper-button--decrement": "NumberField-module__hop-NumberField__stepper-button--decrement___i-Kmo", "hop-NumberField__stepper-button--mobile": "NumberField-module__hop-NumberField__stepper-button--mobile___V4omC", "hop-NumberField__stepper-button__icon": "NumberField-module__hop-NumberField__stepper-button__icon___ZCqO6", "hop-NumberField__input": "NumberField-module__hop-NumberField__input___GSHPf" };
|
|
33
|
+
var GlobalNumberFieldCssSelector = "hop-NumberField";
|
|
34
|
+
var StepperButton = ({ direction }) => {
|
|
35
|
+
const scale = useScale();
|
|
36
|
+
const isMobile = scale === "large";
|
|
37
|
+
const StepperIcon = direction === "increment" ? AngleUpIcon : AngleDownIcon;
|
|
38
|
+
const stepperClasses = cssModule(
|
|
39
|
+
NumberField_module_default,
|
|
40
|
+
"hop-NumberField__stepper-button",
|
|
41
|
+
direction,
|
|
42
|
+
isMobile && "mobile"
|
|
43
|
+
);
|
|
44
|
+
return /* @__PURE__ */ jsx(
|
|
45
|
+
Button,
|
|
46
|
+
{
|
|
47
|
+
className: stepperClasses,
|
|
48
|
+
slot: direction,
|
|
49
|
+
children: /* @__PURE__ */ jsx(
|
|
50
|
+
StepperIcon,
|
|
51
|
+
{
|
|
52
|
+
className: NumberField_module_default["hop-NumberField__stepper-button__icon"],
|
|
53
|
+
size: {
|
|
54
|
+
base: "md",
|
|
55
|
+
xs: "sm"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
};
|
|
62
|
+
function NumberField(props, ref) {
|
|
63
|
+
var _a;
|
|
64
|
+
const {
|
|
65
|
+
inputRef: userProvidedInputRef = null,
|
|
66
|
+
...propsWithoutRef
|
|
67
|
+
} = props;
|
|
68
|
+
[props, ref] = useContextProps(propsWithoutRef, ref, NumberFieldContext);
|
|
69
|
+
const { stylingProps, ...ownProps } = useStyledSystem(props);
|
|
70
|
+
const {
|
|
71
|
+
className,
|
|
72
|
+
style: styleProp,
|
|
73
|
+
size,
|
|
74
|
+
prefix,
|
|
75
|
+
placeholder,
|
|
76
|
+
onChange: onChangeProp,
|
|
77
|
+
children,
|
|
78
|
+
defaultValue,
|
|
79
|
+
value: valueProp,
|
|
80
|
+
isFluid: isFluidProp,
|
|
81
|
+
isDisabled,
|
|
82
|
+
isInvalid,
|
|
83
|
+
...otherProps
|
|
84
|
+
} = ownProps;
|
|
85
|
+
const inputRef = useObjectRef(mergeRefs(userProvidedInputRef, props.inputRef !== void 0 ? props.inputRef : null));
|
|
86
|
+
const isFluid = (_a = useResponsiveValue(isFluidProp)) != null ? _a : false;
|
|
87
|
+
const scale = useScale();
|
|
88
|
+
const isMobile = scale === "large";
|
|
89
|
+
const classNames = composeClassnameRenderProps(
|
|
90
|
+
className,
|
|
91
|
+
GlobalNumberFieldCssSelector,
|
|
92
|
+
cssModule(
|
|
93
|
+
NumberField_module_default,
|
|
94
|
+
"hop-NumberField",
|
|
95
|
+
isFluid && "fluid",
|
|
96
|
+
isMobile && "mobile"
|
|
97
|
+
),
|
|
98
|
+
stylingProps.className
|
|
99
|
+
);
|
|
100
|
+
const style = composeRenderProps(styleProp, (prev) => {
|
|
101
|
+
return {
|
|
102
|
+
...stylingProps.style,
|
|
103
|
+
...prev
|
|
104
|
+
};
|
|
105
|
+
});
|
|
106
|
+
const handleTextChanged = useCallback((value2) => {
|
|
107
|
+
onChangeProp == null ? void 0 : onChangeProp(value2);
|
|
108
|
+
}, [onChangeProp]);
|
|
109
|
+
const [value, onChange] = useControlledState(valueProp, defaultValue || 0, handleTextChanged);
|
|
110
|
+
const prefixMarkup = prefix ? /* @__PURE__ */ jsx(
|
|
111
|
+
SlotProvider,
|
|
112
|
+
{
|
|
113
|
+
values: [
|
|
114
|
+
[TextContext, { size, className: NumberField_module_default["hop-NumberField__prefix"] }],
|
|
115
|
+
[IconContext, { size, className: NumberField_module_default["hop-NumberField__prefix"] }]
|
|
116
|
+
],
|
|
117
|
+
children: isTextOnlyChildren(prefix) ? /* @__PURE__ */ jsx(_Text, { children: prefix }) : prefix
|
|
118
|
+
}
|
|
119
|
+
) : null;
|
|
120
|
+
const inputMarkup = /* @__PURE__ */ jsx(ClearContainerSlots, { children: /* @__PURE__ */ jsxs(
|
|
121
|
+
_InputGroup,
|
|
122
|
+
{
|
|
123
|
+
isFluid,
|
|
124
|
+
size,
|
|
125
|
+
className: NumberField_module_default["hop-NumberField__InputGroup"],
|
|
126
|
+
isDisabled,
|
|
127
|
+
isInvalid,
|
|
128
|
+
inputClassName: NumberField_module_default["hop-NumberField__input"],
|
|
129
|
+
children: [
|
|
130
|
+
prefixMarkup,
|
|
131
|
+
/* @__PURE__ */ jsx(
|
|
132
|
+
Input,
|
|
133
|
+
{
|
|
134
|
+
ref: inputRef,
|
|
135
|
+
placeholder
|
|
136
|
+
}
|
|
137
|
+
),
|
|
138
|
+
/* @__PURE__ */ jsx(StepperButton, { direction: "increment" }),
|
|
139
|
+
/* @__PURE__ */ jsx(StepperButton, { direction: "decrement" })
|
|
140
|
+
]
|
|
141
|
+
}
|
|
142
|
+
) });
|
|
143
|
+
const childrenMarkup = composeRenderProps(children, (prev) => {
|
|
144
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
145
|
+
/* @__PURE__ */ jsx(
|
|
146
|
+
SlotProvider,
|
|
147
|
+
{
|
|
148
|
+
values: [
|
|
149
|
+
[LabelContext, { className: NumberField_module_default["hop-NumberField__Label"] }],
|
|
150
|
+
[HelperMessageContext, { className: NumberField_module_default["hop-NumberField__HelperMessage"] }],
|
|
151
|
+
[ErrorMessageContext, { className: NumberField_module_default["hop-NumberField__ErrorMessage"] }]
|
|
152
|
+
],
|
|
153
|
+
children: prev
|
|
154
|
+
}
|
|
155
|
+
),
|
|
156
|
+
inputMarkup
|
|
157
|
+
] });
|
|
158
|
+
});
|
|
159
|
+
return /* @__PURE__ */ jsx(
|
|
160
|
+
NumberField$1,
|
|
161
|
+
{
|
|
162
|
+
ref,
|
|
163
|
+
value,
|
|
164
|
+
style,
|
|
165
|
+
className: classNames,
|
|
166
|
+
onChange,
|
|
167
|
+
isDisabled,
|
|
168
|
+
isInvalid,
|
|
169
|
+
...otherProps,
|
|
170
|
+
children: childrenMarkup
|
|
171
|
+
}
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
var _NumberField = forwardRef(NumberField);
|
|
175
|
+
_NumberField.displayName = "NumberField";
|
|
176
|
+
|
|
177
|
+
export { GlobalNumberFieldCssSelector, _NumberField as NumberField };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ContextValue } from 'react-aria-components';
|
|
3
|
+
import { NumberFieldProps } from './NumberField.js';
|
|
4
|
+
import '@hopper-ui/styled-system';
|
|
5
|
+
|
|
6
|
+
declare const NumberFieldContext: react.Context<ContextValue<NumberFieldProps, HTMLDivElement>>;
|
|
7
|
+
|
|
8
|
+
export { NumberFieldContext };
|