@wavv/ui 2.7.3 → 2.8.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/build/components/ComboBox.d.ts +1 -1
- package/build/components/ComboBox.js +7 -3
- package/build/components/FilterableSelect.d.ts +1 -1
- package/build/components/FilterableSelect.js +7 -3
- package/build/components/Inputs/DatePicker.d.ts +1 -1
- package/build/components/Inputs/DatePicker.js +8 -3
- package/build/components/Inputs/DateRangePicker.d.ts +1 -1
- package/build/components/Inputs/DateRangePicker.js +8 -3
- package/build/components/Inputs/InlineInput.d.ts +1 -1
- package/build/components/Inputs/InlineInput.js +8 -3
- package/build/components/Inputs/NumberInput.d.ts +1 -1
- package/build/components/Inputs/NumberInput.js +10 -5
- package/build/components/Inputs/PhoneInput.d.ts +1 -1
- package/build/components/Inputs/PhoneInput.js +8 -3
- package/build/components/Inputs/SearchInput.d.ts +1 -1
- package/build/components/Inputs/SearchInput.js +12 -5
- package/build/components/Inputs/TextArea.d.ts +1 -1
- package/build/components/Inputs/TextArea.js +8 -3
- package/build/components/Inputs/TextInput.d.ts +1 -1
- package/build/components/Inputs/TextInput.js +8 -3
- package/build/components/Inputs/TimeInput.d.ts +1 -1
- package/build/components/Inputs/TimeInput.js +8 -3
- package/build/components/Inputs/helpers/InputContainerStyles.d.ts +1 -1
- package/build/components/Inputs/helpers/InputContainerStyles.js +3 -3
- package/build/components/Select.d.ts +1 -1
- package/build/components/Select.js +7 -3
- package/build/components/typeDefs/inputTypes.d.ts +2 -0
- package/build/components/types.d.ts +2 -0
- package/package.json +1 -1
|
@@ -14,7 +14,7 @@ type Props = {
|
|
|
14
14
|
formatCreateOption?: (inputText: string) => ReactNode;
|
|
15
15
|
ref?: React.Ref<HTMLInputElement>;
|
|
16
16
|
} & ComboBoxInputProps & OpenStateProps & ComboBoxProps;
|
|
17
|
-
declare const _default: (({ backgroundColor, menuBackground, children, fontSize, disabled, invalid, required, readOnly, loading, loadingResults, label, options, placeholder, placeholderColor, description, errorMessage, textOnly, value, defaultValue, width, height, maxHeight, iconLeft, leftElement, rightElement, allowRepeatSelection, allowsEmptyCollection, emptyFallback, position, fixedPosition, open, onOpenChange, before, after, separators, onChange, onCreate, formatCreateOption, afterShow, afterHide, onTextChange, ref, ...props }: Props) => import("react/jsx-runtime").JSX.Element) & {
|
|
17
|
+
declare const _default: (({ backgroundColor, menuBackground, children, fontSize, disabled, invalid, required, readOnly, loading, loadingResults, label, options, placeholder, placeholderColor, description, errorMessage, textOnly, value, defaultValue, width, height, maxHeight, small, iconLeft, leftElement, rightElement, allowRepeatSelection, allowsEmptyCollection, emptyFallback, position, fixedPosition, open, onOpenChange, before, after, separators, onChange, onCreate, formatCreateOption, afterShow, afterHide, onTextChange, ref, ...props }: Props) => import("react/jsx-runtime").JSX.Element) & {
|
|
18
18
|
Item: ({ id, value, header, body, leftElement, rightElement, inline, disabled, selectionMode, ...props }: import("..").SelectItem & Omit<import("react-aria-components").ListBoxItemProps<object>, "id" | "value" | "isDisabled"> & {
|
|
19
19
|
selectionMode?: import("react-aria-components").SelectionMode;
|
|
20
20
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -19,7 +19,7 @@ import ListRootStyles, { preventProps } from "./ListHelpers/ListRootStyles.js";
|
|
|
19
19
|
import ListSection from "./ListHelpers/ListSection.js";
|
|
20
20
|
import MotionPopover from "./MotionPopover.js";
|
|
21
21
|
import Spinner from "./Spinner.js";
|
|
22
|
-
const ComboBox_ComboBox = ({ backgroundColor, menuBackground, children, fontSize, disabled, invalid, required, readOnly, loading, loadingResults, label, options, placeholder = 'Select', placeholderColor, description, errorMessage, textOnly, value, defaultValue, width, height, maxHeight, iconLeft, leftElement, rightElement, allowRepeatSelection, allowsEmptyCollection, emptyFallback, position, fixedPosition, open, onOpenChange, before, after, separators, onChange, onCreate, formatCreateOption, afterShow, afterHide, onTextChange, ref, ...props })=>{
|
|
22
|
+
const ComboBox_ComboBox = ({ backgroundColor, menuBackground, children, fontSize, disabled, invalid, required, readOnly, loading, loadingResults, label, options, placeholder = 'Select', placeholderColor, description, errorMessage, textOnly, value, defaultValue, width, height, maxHeight, small, iconLeft, leftElement, rightElement, allowRepeatSelection, allowsEmptyCollection, emptyFallback, position, fixedPosition, open, onOpenChange, before, after, separators, onChange, onCreate, formatCreateOption, afterShow, afterHide, onTextChange, ref, ...props })=>{
|
|
23
23
|
const [isOpen, handleOpenChange] = useControlledOpenState({
|
|
24
24
|
open,
|
|
25
25
|
onOpenChange,
|
|
@@ -62,6 +62,7 @@ const ComboBox_ComboBox = ({ backgroundColor, menuBackground, children, fontSize
|
|
|
62
62
|
};
|
|
63
63
|
const hasValue = !!(currentValue || defaultValue || inputText);
|
|
64
64
|
const hidePlaceholder = !!(!hasValue && label);
|
|
65
|
+
const iconSize = small ? 'small' : void 0;
|
|
65
66
|
const showCreateOption = inputText.length > 0 && onCreate && !flatOptions.some((option)=>option.value === inputText || option.id === inputText);
|
|
66
67
|
const handleCreateOption = ()=>{
|
|
67
68
|
if (!onCreate) return;
|
|
@@ -111,10 +112,12 @@ const ComboBox_ComboBox = ({ backgroundColor, menuBackground, children, fontSize
|
|
|
111
112
|
isInvalid: invalid,
|
|
112
113
|
iconLeft: !!iconLeft,
|
|
113
114
|
height: height,
|
|
115
|
+
small: small,
|
|
114
116
|
...marginProps,
|
|
115
117
|
children: [
|
|
116
118
|
iconLeft && getIcon(iconLeft, {
|
|
117
|
-
marginRight: 8
|
|
119
|
+
marginRight: 8,
|
|
120
|
+
size: iconSize
|
|
118
121
|
}),
|
|
119
122
|
leftElement,
|
|
120
123
|
/*#__PURE__*/ jsxs(Label, {
|
|
@@ -142,7 +145,8 @@ const ComboBox_ComboBox = ({ backgroundColor, menuBackground, children, fontSize
|
|
|
142
145
|
disabled: disabled,
|
|
143
146
|
readOnly: readOnly,
|
|
144
147
|
children: /*#__PURE__*/ jsx(Icon, {
|
|
145
|
-
name: isOpen ? 'caret-up' : 'caret-down'
|
|
148
|
+
name: isOpen ? 'caret-up' : 'caret-down',
|
|
149
|
+
size: iconSize
|
|
146
150
|
})
|
|
147
151
|
}),
|
|
148
152
|
/*#__PURE__*/ jsx(InputMessage, {
|
|
@@ -22,5 +22,5 @@ type Props = {
|
|
|
22
22
|
emptyFallback?: ReactNode;
|
|
23
23
|
ref?: React.Ref<HTMLButtonElement>;
|
|
24
24
|
} & BaseProps & OpenStateProps & SelectProps;
|
|
25
|
-
declare const FilterableSelect: ({ backgroundColor, menuBackground, fontSize, fontWeight, color, disabled, invalid, required, readOnly, loading, label, options, placeholder, placeholderColor, description, errorMessage, textOnly, value, defaultValue, width, height, maxHeight, hideCaret, position, fixedPosition, borderRadius, iconLeft, leftElement, rightElement, before, after, open, onOpenChange, onChange, afterShow, afterHide, searchPlaceholder, itemHeight, sectionHeaderHeight, itemGap, emptyFallback, ref, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
declare const FilterableSelect: ({ backgroundColor, menuBackground, fontSize, fontWeight, color, disabled, invalid, required, readOnly, loading, label, options, placeholder, placeholderColor, description, errorMessage, textOnly, value, defaultValue, width, height, maxHeight, small, hideCaret, position, fixedPosition, borderRadius, iconLeft, leftElement, rightElement, before, after, open, onOpenChange, onChange, afterShow, afterHide, searchPlaceholder, itemHeight, sectionHeaderHeight, itemGap, emptyFallback, ref, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
26
26
|
export default FilterableSelect;
|
|
@@ -25,7 +25,7 @@ const getItemTextValue = (item)=>[
|
|
|
25
25
|
item.body,
|
|
26
26
|
item.searchText
|
|
27
27
|
].filter(Boolean).join(' ');
|
|
28
|
-
const FilterableSelect = ({ backgroundColor, menuBackground, fontSize, fontWeight, color, disabled, invalid, required, readOnly, loading, label, options, placeholder = 'Select', placeholderColor, description, errorMessage, textOnly, value, defaultValue, width, height, maxHeight = DEFAULT_MAX_HEIGHT, hideCaret, position, fixedPosition, borderRadius, iconLeft, leftElement, rightElement, before, after, open, onOpenChange, onChange, afterShow, afterHide, searchPlaceholder = 'Search', itemHeight = DEFAULT_ITEM_HEIGHT, sectionHeaderHeight = DEFAULT_SECTION_HEIGHT, itemGap = DEFAULT_ITEM_GAP, emptyFallback, ref, ...props })=>{
|
|
28
|
+
const FilterableSelect = ({ backgroundColor, menuBackground, fontSize, fontWeight, color, disabled, invalid, required, readOnly, loading, label, options, placeholder = 'Select', placeholderColor, description, errorMessage, textOnly, value, defaultValue, width, height, maxHeight = DEFAULT_MAX_HEIGHT, small, hideCaret, position, fixedPosition, borderRadius, iconLeft, leftElement, rightElement, before, after, open, onOpenChange, onChange, afterShow, afterHide, searchPlaceholder = 'Search', itemHeight = DEFAULT_ITEM_HEIGHT, sectionHeaderHeight = DEFAULT_SECTION_HEIGHT, itemGap = DEFAULT_ITEM_GAP, emptyFallback, ref, ...props })=>{
|
|
29
29
|
const [isOpen, handleOpenChange] = useControlledOpenState({
|
|
30
30
|
open,
|
|
31
31
|
onOpenChange,
|
|
@@ -62,9 +62,11 @@ const FilterableSelect = ({ backgroundColor, menuBackground, fontSize, fontWeigh
|
|
|
62
62
|
};
|
|
63
63
|
const hasValue = !!(currentValue || defaultValue);
|
|
64
64
|
const hidePlaceholder = !hasValue && label;
|
|
65
|
+
const iconSize = small ? 'small' : void 0;
|
|
65
66
|
const caret = hideCaret ? null : /*#__PURE__*/ jsx(Icon, {
|
|
66
67
|
name: isOpen ? 'caret-up' : 'caret-down',
|
|
67
|
-
color: color
|
|
68
|
+
color: color,
|
|
69
|
+
size: iconSize
|
|
68
70
|
});
|
|
69
71
|
const layoutOptions = useMemo(()=>({
|
|
70
72
|
rowHeight: itemHeight,
|
|
@@ -126,6 +128,7 @@ const FilterableSelect = ({ backgroundColor, menuBackground, fontSize, fontWeigh
|
|
|
126
128
|
isInvalid: invalid,
|
|
127
129
|
borderRadius: borderRadius,
|
|
128
130
|
height: height,
|
|
131
|
+
small: small,
|
|
129
132
|
pointer: true,
|
|
130
133
|
ref: ref,
|
|
131
134
|
iconLeft: !!iconLeft,
|
|
@@ -133,7 +136,8 @@ const FilterableSelect = ({ backgroundColor, menuBackground, fontSize, fontWeigh
|
|
|
133
136
|
...marginProps,
|
|
134
137
|
children: [
|
|
135
138
|
iconLeft && getIcon(iconLeft, {
|
|
136
|
-
marginRight: 8
|
|
139
|
+
marginRight: 8,
|
|
140
|
+
size: iconSize
|
|
137
141
|
}),
|
|
138
142
|
leftElement,
|
|
139
143
|
/*#__PURE__*/ jsx(Label, {
|
|
@@ -10,5 +10,5 @@ type Props = {
|
|
|
10
10
|
className?: PickerProps['className'];
|
|
11
11
|
style?: PickerProps['style'];
|
|
12
12
|
} & DateInputProps & PickerProps;
|
|
13
|
-
declare const DatePicker: ({ value, label, iconLeft, iconRight, loading, fontSize, placeholderColor, disabled, readOnly, invalid, required, description, errorMessage, preventPast, preventFuture, hidePicker, onChange, afterShow, afterHide, ref, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare const DatePicker: ({ value, label, iconLeft, iconRight, loading, fontSize, placeholderColor, disabled, readOnly, invalid, required, description, errorMessage, preventPast, preventFuture, hidePicker, small, onChange, afterShow, afterHide, ref, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
export default DatePicker;
|
|
@@ -15,8 +15,9 @@ import InputMessage from "./helpers/InputMessage.js";
|
|
|
15
15
|
import InputStyles, { preventProps } from "./helpers/InputStyles.js";
|
|
16
16
|
import Label from "./helpers/Label.js";
|
|
17
17
|
import PickerToggle from "./helpers/PickerToggle.js";
|
|
18
|
-
const DatePicker_DatePicker = ({ value, label, iconLeft, iconRight, loading, fontSize, placeholderColor, disabled, readOnly, invalid, required, description, errorMessage, preventPast, preventFuture, hidePicker, onChange, afterShow, afterHide, ref, ...props })=>{
|
|
18
|
+
const DatePicker_DatePicker = ({ value, label, iconLeft, iconRight, loading, fontSize, placeholderColor, disabled, readOnly, invalid, required, description, errorMessage, preventPast, preventFuture, hidePicker, small, onChange, afterShow, afterHide, ref, ...props })=>{
|
|
19
19
|
const [selectedDate, setSelectedDate] = useState(value ? getObjFromDate(value) : void 0);
|
|
20
|
+
const iconSize = small ? 'small' : void 0;
|
|
20
21
|
const containerRef = useRef(null);
|
|
21
22
|
const { min, max } = useMinMax({
|
|
22
23
|
past: preventPast,
|
|
@@ -55,10 +56,12 @@ const DatePicker_DatePicker = ({ value, label, iconLeft, iconRight, loading, fon
|
|
|
55
56
|
onChange: handleDateChange,
|
|
56
57
|
onOpenChange: handleOpenChange,
|
|
57
58
|
ref: containerRef,
|
|
59
|
+
small: small,
|
|
58
60
|
...props,
|
|
59
61
|
children: [
|
|
60
62
|
iconLeft && getIcon(iconLeft, {
|
|
61
|
-
marginRight: 8
|
|
63
|
+
marginRight: 8,
|
|
64
|
+
size: iconSize
|
|
62
65
|
}),
|
|
63
66
|
/*#__PURE__*/ jsx(Label, {
|
|
64
67
|
label: label,
|
|
@@ -84,7 +87,9 @@ const DatePicker_DatePicker = ({ value, label, iconLeft, iconRight, loading, fon
|
|
|
84
87
|
name: "calendar"
|
|
85
88
|
})
|
|
86
89
|
}),
|
|
87
|
-
iconRight && getIcon(iconRight
|
|
90
|
+
iconRight && getIcon(iconRight, {
|
|
91
|
+
size: iconSize
|
|
92
|
+
}),
|
|
88
93
|
loading && /*#__PURE__*/ jsx(Spinner, {}),
|
|
89
94
|
/*#__PURE__*/ jsx(InputMessage, {
|
|
90
95
|
description: description,
|
|
@@ -11,5 +11,5 @@ type Props = {
|
|
|
11
11
|
className?: PickerProps['className'];
|
|
12
12
|
style?: PickerProps['style'];
|
|
13
13
|
} & DateInputProps & PickerProps;
|
|
14
|
-
declare const DateRangePicker: ({ startValue, endValue, label, iconLeft, iconRight, loading, fontSize, placeholderColor, disabled, readOnly, invalid, required, description, errorMessage, preventPast, preventFuture, hidePicker, onChange, afterShow, afterHide, ref, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare const DateRangePicker: ({ startValue, endValue, label, iconLeft, iconRight, loading, fontSize, placeholderColor, disabled, readOnly, invalid, required, description, errorMessage, preventPast, preventFuture, hidePicker, small, onChange, afterShow, afterHide, ref, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
export default DateRangePicker;
|
|
@@ -15,9 +15,10 @@ import InputMessage from "./helpers/InputMessage.js";
|
|
|
15
15
|
import InputStyles, { preventProps } from "./helpers/InputStyles.js";
|
|
16
16
|
import Label from "./helpers/Label.js";
|
|
17
17
|
import PickerToggle from "./helpers/PickerToggle.js";
|
|
18
|
-
const DateRangePicker_DateRangePicker = ({ startValue, endValue, label, iconLeft, iconRight, loading, fontSize, placeholderColor, disabled, readOnly, invalid, required, description, errorMessage, preventPast, preventFuture, hidePicker, onChange, afterShow, afterHide, ref, ...props })=>{
|
|
18
|
+
const DateRangePicker_DateRangePicker = ({ startValue, endValue, label, iconLeft, iconRight, loading, fontSize, placeholderColor, disabled, readOnly, invalid, required, description, errorMessage, preventPast, preventFuture, hidePicker, small, onChange, afterShow, afterHide, ref, ...props })=>{
|
|
19
19
|
const [selectedStart, setSelectedStart] = useState(startValue ? getObjFromDate(startValue) : void 0);
|
|
20
20
|
const [selectedEnd, setSelectedEnd] = useState(endValue ? getObjFromDate(endValue) : void 0);
|
|
21
|
+
const iconSize = small ? 'small' : void 0;
|
|
21
22
|
const containerRef = useRef(null);
|
|
22
23
|
const { min, max } = useMinMax({
|
|
23
24
|
past: preventPast,
|
|
@@ -72,10 +73,12 @@ const DateRangePicker_DateRangePicker = ({ startValue, endValue, label, iconLeft
|
|
|
72
73
|
onChange: handleDateChange,
|
|
73
74
|
onOpenChange: handleOpenChange,
|
|
74
75
|
ref: containerRef,
|
|
76
|
+
small: small,
|
|
75
77
|
...props,
|
|
76
78
|
children: [
|
|
77
79
|
iconLeft && getIcon(iconLeft, {
|
|
78
|
-
marginRight: 8
|
|
80
|
+
marginRight: 8,
|
|
81
|
+
size: iconSize
|
|
79
82
|
}),
|
|
80
83
|
/*#__PURE__*/ jsx(Label, {
|
|
81
84
|
label: label,
|
|
@@ -122,7 +125,9 @@ const DateRangePicker_DateRangePicker = ({ startValue, endValue, label, iconLeft
|
|
|
122
125
|
name: "calendar"
|
|
123
126
|
})
|
|
124
127
|
}),
|
|
125
|
-
iconRight && getIcon(iconRight
|
|
128
|
+
iconRight && getIcon(iconRight, {
|
|
129
|
+
size: iconSize
|
|
130
|
+
}),
|
|
126
131
|
loading && /*#__PURE__*/ jsx(Spinner, {}),
|
|
127
132
|
/*#__PURE__*/ jsx(InputMessage, {
|
|
128
133
|
description: description,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type TextFieldProps } from 'react-aria-components';
|
|
2
2
|
import type { InputProps, TextInputProps } from '../typeDefs/inputTypes';
|
|
3
3
|
type Props = TextInputProps & Omit<InputProps, 'textOnly'> & Omit<TextFieldProps, 'isDisabled' | 'isReadOnly' | 'isInvalid' | 'isRequired'>;
|
|
4
|
-
declare const InlineInput: ({ value, label, placeholder, iconLeft, iconRight, loading, fontSize, placeholderColor, disabled, readOnly, invalid, required, description, errorMessage, accepts, onChange, onInput, ref, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare const InlineInput: ({ value, label, placeholder, iconLeft, iconRight, loading, fontSize, placeholderColor, disabled, readOnly, invalid, required, description, errorMessage, accepts, small, onChange, onInput, ref, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export default InlineInput;
|
|
@@ -10,13 +10,14 @@ import InputContainerStyles from "./helpers/InputContainerStyles.js";
|
|
|
10
10
|
import InputMessage from "./helpers/InputMessage.js";
|
|
11
11
|
import isAcceptable from "./helpers/isAcceptable.js";
|
|
12
12
|
import useDynamicWidth from "./helpers/useDynamicWidth.js";
|
|
13
|
-
const InlineInput = ({ value, label, placeholder, iconLeft, iconRight, loading, fontSize, placeholderColor, disabled, readOnly, invalid, required, description, errorMessage, accepts, onChange, onInput, ref, ...props })=>{
|
|
13
|
+
const InlineInput = ({ value, label, placeholder, iconLeft, iconRight, loading, fontSize, placeholderColor, disabled, readOnly, invalid, required, description, errorMessage, accepts, small, onChange, onInput, ref, ...props })=>{
|
|
14
14
|
const [inputValue, setInputValue] = useState('');
|
|
15
15
|
const [inputWidth, HiddenWidthEl] = useDynamicWidth({
|
|
16
16
|
value: inputValue,
|
|
17
17
|
placeholder,
|
|
18
18
|
fontSize
|
|
19
19
|
});
|
|
20
|
+
const iconSize = small ? 'small' : void 0;
|
|
20
21
|
useEffect(()=>{
|
|
21
22
|
if (null != value && inputValue !== value) setInputValue(value);
|
|
22
23
|
}, [
|
|
@@ -42,10 +43,12 @@ const InlineInput = ({ value, label, placeholder, iconLeft, iconRight, loading,
|
|
|
42
43
|
onInput: onInput ? handleInput : void 0,
|
|
43
44
|
onPaste: (event)=>handlePaste(event, handleChange, accepts),
|
|
44
45
|
textOnly: true,
|
|
46
|
+
small: small,
|
|
45
47
|
...props,
|
|
46
48
|
children: [
|
|
47
49
|
iconLeft && getIcon(iconLeft, {
|
|
48
|
-
marginRight: 8
|
|
50
|
+
marginRight: 8,
|
|
51
|
+
size: iconSize
|
|
49
52
|
}),
|
|
50
53
|
/*#__PURE__*/ jsx(Input, {
|
|
51
54
|
ref: ref,
|
|
@@ -57,7 +60,9 @@ const InlineInput = ({ value, label, placeholder, iconLeft, iconRight, loading,
|
|
|
57
60
|
width: inputWidth
|
|
58
61
|
}),
|
|
59
62
|
/*#__PURE__*/ jsx(HiddenWidthEl, {}),
|
|
60
|
-
iconRight && getIcon(iconRight
|
|
63
|
+
iconRight && getIcon(iconRight, {
|
|
64
|
+
size: iconSize
|
|
65
|
+
}),
|
|
61
66
|
loading && /*#__PURE__*/ jsx(Spinner, {}),
|
|
62
67
|
/*#__PURE__*/ jsx(InputMessage, {
|
|
63
68
|
description: description,
|
|
@@ -6,5 +6,5 @@ type Props = {
|
|
|
6
6
|
/** Display a comma separator for large numbers (default true) */
|
|
7
7
|
separator?: boolean;
|
|
8
8
|
} & InputProps & NumberFieldProps;
|
|
9
|
-
declare const NumberInput: ({ value, label, placeholder, iconLeft, iconRight, loading, fontSize, placeholderColor, disabled, readOnly, invalid, required, description, errorMessage, hideControls, separator, onChange, ref, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare const NumberInput: ({ value, label, placeholder, iconLeft, iconRight, loading, fontSize, placeholderColor, disabled, readOnly, invalid, required, description, errorMessage, hideControls, separator, small, onChange, ref, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export default NumberInput;
|
|
@@ -10,8 +10,9 @@ import Input from "./helpers/Input.js";
|
|
|
10
10
|
import InputContainerStyles from "./helpers/InputContainerStyles.js";
|
|
11
11
|
import InputMessage from "./helpers/InputMessage.js";
|
|
12
12
|
import Label from "./helpers/Label.js";
|
|
13
|
-
const NumberInput = ({ value, label, placeholder, iconLeft, iconRight, loading, fontSize, placeholderColor, disabled, readOnly, invalid, required, description, errorMessage, hideControls, separator = true, onChange, ref, ...props })=>{
|
|
13
|
+
const NumberInput = ({ value, label, placeholder, iconLeft, iconRight, loading, fontSize, placeholderColor, disabled, readOnly, invalid, required, description, errorMessage, hideControls, separator = true, small, onChange, ref, ...props })=>{
|
|
14
14
|
const [inputValue, setInputValue] = useState(NaN);
|
|
15
|
+
const iconSize = small ? 'small' : void 0;
|
|
15
16
|
useEffect(()=>{
|
|
16
17
|
if (null != value && inputValue !== value) setInputValue(value);
|
|
17
18
|
}, [
|
|
@@ -34,10 +35,12 @@ const NumberInput = ({ value, label, placeholder, iconLeft, iconRight, loading,
|
|
|
34
35
|
formatOptions: {
|
|
35
36
|
useGrouping: separator
|
|
36
37
|
},
|
|
38
|
+
small: small,
|
|
37
39
|
...props,
|
|
38
40
|
children: [
|
|
39
41
|
iconLeft && getIcon(iconLeft, {
|
|
40
|
-
marginRight: 8
|
|
42
|
+
marginRight: 8,
|
|
43
|
+
size: iconSize
|
|
41
44
|
}),
|
|
42
45
|
/*#__PURE__*/ jsx(Label, {
|
|
43
46
|
label: label,
|
|
@@ -53,7 +56,9 @@ const NumberInput = ({ value, label, placeholder, iconLeft, iconRight, loading,
|
|
|
53
56
|
isDisabled: disabled
|
|
54
57
|
})
|
|
55
58
|
}),
|
|
56
|
-
iconRight && getIcon(iconRight
|
|
59
|
+
iconRight && getIcon(iconRight, {
|
|
60
|
+
size: iconSize
|
|
61
|
+
}),
|
|
57
62
|
loading && /*#__PURE__*/ jsx(Spinner, {}),
|
|
58
63
|
!hideControls && /*#__PURE__*/ jsxs(ArrowContainer, {
|
|
59
64
|
children: [
|
|
@@ -61,7 +66,7 @@ const NumberInput = ({ value, label, placeholder, iconLeft, iconRight, loading,
|
|
|
61
66
|
slot: "increment",
|
|
62
67
|
isDisabled: disabled || readOnly,
|
|
63
68
|
children: /*#__PURE__*/ jsx(Icon, {
|
|
64
|
-
size: label ? 23.5 : 19.5,
|
|
69
|
+
size: small ? 'small' : label ? 23.5 : 19.5,
|
|
65
70
|
name: "caret-up"
|
|
66
71
|
})
|
|
67
72
|
}),
|
|
@@ -70,7 +75,7 @@ const NumberInput = ({ value, label, placeholder, iconLeft, iconRight, loading,
|
|
|
70
75
|
slot: "decrement",
|
|
71
76
|
isDisabled: disabled || readOnly,
|
|
72
77
|
children: /*#__PURE__*/ jsx(Icon, {
|
|
73
|
-
size: label ? 23.5 : 19.5,
|
|
78
|
+
size: small ? 'small' : label ? 23.5 : 19.5,
|
|
74
79
|
name: "caret-down"
|
|
75
80
|
})
|
|
76
81
|
})
|
|
@@ -3,5 +3,5 @@ import type { TextFieldProps } from '../typeDefs/reactAriaTypes';
|
|
|
3
3
|
type Props = {
|
|
4
4
|
onChange?: (formatted: string, raw: string) => void;
|
|
5
5
|
} & InputProps & Omit<TextFieldProps, 'onChange'>;
|
|
6
|
-
declare const PhoneInput: ({ value, label, placeholder, iconLeft, iconRight, leftElement, rightElement, loading, fontSize, placeholderColor, disabled, readOnly, invalid, required, description, errorMessage, onChange, ref, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare const PhoneInput: ({ value, label, placeholder, iconLeft, iconRight, leftElement, rightElement, loading, fontSize, placeholderColor, disabled, readOnly, invalid, required, description, errorMessage, small, onChange, ref, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export default PhoneInput;
|
|
@@ -10,9 +10,10 @@ import Input from "./helpers/Input.js";
|
|
|
10
10
|
import InputContainerStyles from "./helpers/InputContainerStyles.js";
|
|
11
11
|
import InputMessage from "./helpers/InputMessage.js";
|
|
12
12
|
import Label from "./helpers/Label.js";
|
|
13
|
-
const PhoneInput = ({ value, label, placeholder, iconLeft, iconRight, leftElement, rightElement, loading, fontSize, placeholderColor, disabled, readOnly, invalid, required, description, errorMessage, onChange, ref, ...props })=>{
|
|
13
|
+
const PhoneInput = ({ value, label, placeholder, iconLeft, iconRight, leftElement, rightElement, loading, fontSize, placeholderColor, disabled, readOnly, invalid, required, description, errorMessage, small, onChange, ref, ...props })=>{
|
|
14
14
|
const [inputValue, setInputValue] = useState('');
|
|
15
15
|
const internalRef = useRef(null);
|
|
16
|
+
const iconSize = small ? 'small' : void 0;
|
|
16
17
|
useImperativeHandle(ref, ()=>internalRef.current);
|
|
17
18
|
useEffect(()=>{
|
|
18
19
|
if (null != value && inputValue !== value) {
|
|
@@ -62,10 +63,12 @@ const PhoneInput = ({ value, label, placeholder, iconLeft, iconRight, leftElemen
|
|
|
62
63
|
onChange: handleChange,
|
|
63
64
|
onPaste: handlePaste,
|
|
64
65
|
type: "tel",
|
|
66
|
+
small: small,
|
|
65
67
|
...props,
|
|
66
68
|
children: [
|
|
67
69
|
iconLeft && getIcon(iconLeft, {
|
|
68
|
-
marginRight: 8
|
|
70
|
+
marginRight: 8,
|
|
71
|
+
size: iconSize
|
|
69
72
|
}),
|
|
70
73
|
leftElement,
|
|
71
74
|
/*#__PURE__*/ jsx(Label, {
|
|
@@ -83,7 +86,9 @@ const PhoneInput = ({ value, label, placeholder, iconLeft, iconRight, leftElemen
|
|
|
83
86
|
})
|
|
84
87
|
}),
|
|
85
88
|
rightElement,
|
|
86
|
-
iconRight && getIcon(iconRight
|
|
89
|
+
iconRight && getIcon(iconRight, {
|
|
90
|
+
size: iconSize
|
|
91
|
+
}),
|
|
87
92
|
loading && /*#__PURE__*/ jsx(Spinner, {}),
|
|
88
93
|
/*#__PURE__*/ jsx(InputMessage, {
|
|
89
94
|
description: description,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { InputProps, TextInputProps } from '../typeDefs/inputTypes';
|
|
2
2
|
import type { SearchFieldProps } from '../typeDefs/reactAriaTypes';
|
|
3
3
|
type Props = TextInputProps & InputProps & SearchFieldProps;
|
|
4
|
-
declare const SearchInput: ({ value, label, placeholder, iconLeft, iconRight, leftElement, rightElement, loading, fontSize, placeholderColor, disabled, readOnly, invalid, required, description, errorMessage, accepts, onChange, onInput, ref, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare const SearchInput: ({ value, label, placeholder, iconLeft, iconRight, leftElement, rightElement, loading, fontSize, placeholderColor, disabled, readOnly, invalid, required, description, errorMessage, accepts, small, onChange, onInput, ref, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export default SearchInput;
|
|
@@ -13,9 +13,10 @@ import InputContainerStyles from "./helpers/InputContainerStyles.js";
|
|
|
13
13
|
import InputMessage from "./helpers/InputMessage.js";
|
|
14
14
|
import isAcceptable from "./helpers/isAcceptable.js";
|
|
15
15
|
import Label from "./helpers/Label.js";
|
|
16
|
-
const SearchInput = ({ value, label, placeholder, iconLeft, iconRight, leftElement, rightElement, loading, fontSize, placeholderColor, disabled, readOnly, invalid, required, description, errorMessage, accepts, onChange, onInput, ref, ...props })=>{
|
|
16
|
+
const SearchInput = ({ value, label, placeholder, iconLeft, iconRight, leftElement, rightElement, loading, fontSize, placeholderColor, disabled, readOnly, invalid, required, description, errorMessage, accepts, small, onChange, onInput, ref, ...props })=>{
|
|
17
17
|
const { color } = useTheme();
|
|
18
18
|
const [inputValue, setInputValue] = useState('');
|
|
19
|
+
const iconSize = small ? 'small' : void 0;
|
|
19
20
|
useEffect(()=>{
|
|
20
21
|
if (null != value && inputValue !== value) setInputValue(value);
|
|
21
22
|
}, [
|
|
@@ -40,15 +41,18 @@ const SearchInput = ({ value, label, placeholder, iconLeft, iconRight, leftEleme
|
|
|
40
41
|
onChange: handleChange,
|
|
41
42
|
onInput: onInput ? handleInput : void 0,
|
|
42
43
|
onPaste: (event)=>handlePaste(event, handleChange, accepts),
|
|
44
|
+
small: small,
|
|
43
45
|
...props,
|
|
44
46
|
children: [
|
|
45
47
|
iconLeft && getIcon(iconLeft, {
|
|
46
|
-
marginRight: 8
|
|
48
|
+
marginRight: 8,
|
|
49
|
+
size: iconSize
|
|
47
50
|
}),
|
|
48
51
|
leftElement,
|
|
49
52
|
/*#__PURE__*/ jsx(Icon, {
|
|
50
53
|
name: "search",
|
|
51
|
-
marginRight: 8
|
|
54
|
+
marginRight: 8,
|
|
55
|
+
size: iconSize
|
|
52
56
|
}),
|
|
53
57
|
/*#__PURE__*/ jsx(Label, {
|
|
54
58
|
label: label,
|
|
@@ -65,12 +69,15 @@ const SearchInput = ({ value, label, placeholder, iconLeft, iconRight, leftEleme
|
|
|
65
69
|
})
|
|
66
70
|
}),
|
|
67
71
|
rightElement,
|
|
68
|
-
iconRight && getIcon(iconRight
|
|
72
|
+
iconRight && getIcon(iconRight, {
|
|
73
|
+
size: iconSize
|
|
74
|
+
}),
|
|
69
75
|
loading && /*#__PURE__*/ jsx(Spinner, {}),
|
|
70
76
|
!!inputValue && !loading && /*#__PURE__*/ jsx(AriaButton, {
|
|
71
77
|
children: /*#__PURE__*/ jsx(Icon, {
|
|
72
78
|
name: "close-circle",
|
|
73
|
-
color: color.brand
|
|
79
|
+
color: color.brand,
|
|
80
|
+
size: iconSize
|
|
74
81
|
})
|
|
75
82
|
}),
|
|
76
83
|
/*#__PURE__*/ jsx(InputMessage, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { InputProps, TextAreaProps } from '../typeDefs/inputTypes';
|
|
2
2
|
import type { TextFieldProps } from '../typeDefs/reactAriaTypes';
|
|
3
3
|
type Props = TextAreaProps & InputProps & TextFieldProps;
|
|
4
|
-
declare const TextArea: ({ value, label, placeholder, iconLeft, iconRight, loading, fontSize, placeholderColor, disabled, readOnly, invalid, required, description, errorMessage, accepts, asTrigger, height, maxHeight, onChange, onInput, ref, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare const TextArea: ({ value, label, placeholder, iconLeft, iconRight, loading, fontSize, placeholderColor, disabled, readOnly, invalid, required, description, errorMessage, accepts, asTrigger, small, height, maxHeight, onChange, onInput, ref, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export default TextArea;
|
|
@@ -10,9 +10,10 @@ import InputMessage from "./helpers/InputMessage.js";
|
|
|
10
10
|
import isAcceptable from "./helpers/isAcceptable.js";
|
|
11
11
|
import Label from "./helpers/Label.js";
|
|
12
12
|
import TextArea from "./helpers/TextArea.js";
|
|
13
|
-
const TextArea_TextArea = ({ value, label, placeholder, iconLeft, iconRight, loading, fontSize, placeholderColor, disabled, readOnly, invalid, required, description, errorMessage, accepts, asTrigger, height, maxHeight, onChange, onInput, ref, ...props })=>{
|
|
13
|
+
const TextArea_TextArea = ({ value, label, placeholder, iconLeft, iconRight, loading, fontSize, placeholderColor, disabled, readOnly, invalid, required, description, errorMessage, accepts, asTrigger, small, height, maxHeight, onChange, onInput, ref, ...props })=>{
|
|
14
14
|
const [inputValue, setInputValue] = useState('');
|
|
15
15
|
const textAreaRef = useRef(null);
|
|
16
|
+
const iconSize = small ? 'small' : void 0;
|
|
16
17
|
useEffect(()=>{
|
|
17
18
|
if (null != value && inputValue !== value) setInputValue(value);
|
|
18
19
|
}, [
|
|
@@ -66,10 +67,12 @@ const TextArea_TextArea = ({ value, label, placeholder, iconLeft, iconRight, loa
|
|
|
66
67
|
asTrigger: asTrigger,
|
|
67
68
|
height: height,
|
|
68
69
|
maxHeight: maxHeight,
|
|
70
|
+
small: small,
|
|
69
71
|
...props,
|
|
70
72
|
children: [
|
|
71
73
|
iconLeft && getIcon(iconLeft, {
|
|
72
|
-
marginRight: 8
|
|
74
|
+
marginRight: 8,
|
|
75
|
+
size: iconSize
|
|
73
76
|
}),
|
|
74
77
|
/*#__PURE__*/ jsx(Label, {
|
|
75
78
|
label: label,
|
|
@@ -86,7 +89,9 @@ const TextArea_TextArea = ({ value, label, placeholder, iconLeft, iconRight, loa
|
|
|
86
89
|
tabIndex: asTrigger ? -1 : void 0
|
|
87
90
|
})
|
|
88
91
|
}),
|
|
89
|
-
iconRight && getIcon(iconRight
|
|
92
|
+
iconRight && getIcon(iconRight, {
|
|
93
|
+
size: iconSize
|
|
94
|
+
}),
|
|
90
95
|
loading && /*#__PURE__*/ jsx(Spinner, {}),
|
|
91
96
|
/*#__PURE__*/ jsx(InputMessage, {
|
|
92
97
|
description: description,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { InputProps, TextInputProps } from '../typeDefs/inputTypes';
|
|
2
2
|
import type { TextFieldProps } from '../typeDefs/reactAriaTypes';
|
|
3
3
|
type Props = TextFieldProps & TextInputProps & InputProps;
|
|
4
|
-
declare const TextInput: ({ value, label, placeholder, iconLeft, iconRight, leftElement, rightElement, loading, fontSize, placeholderColor, disabled, readOnly, invalid, required, description, errorMessage, accepts, asTrigger, onChange, onInput, ref, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare const TextInput: ({ value, label, placeholder, iconLeft, iconRight, leftElement, rightElement, loading, fontSize, placeholderColor, disabled, readOnly, invalid, required, description, errorMessage, accepts, asTrigger, small, onChange, onInput, ref, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export default TextInput;
|
|
@@ -10,8 +10,9 @@ import InputContainerStyles from "./helpers/InputContainerStyles.js";
|
|
|
10
10
|
import InputMessage from "./helpers/InputMessage.js";
|
|
11
11
|
import isAcceptable from "./helpers/isAcceptable.js";
|
|
12
12
|
import Label from "./helpers/Label.js";
|
|
13
|
-
const TextInput = ({ value, label, placeholder, iconLeft, iconRight, leftElement, rightElement, loading, fontSize, placeholderColor, disabled, readOnly, invalid, required, description, errorMessage, accepts, asTrigger, onChange, onInput, ref, ...props })=>{
|
|
13
|
+
const TextInput = ({ value, label, placeholder, iconLeft, iconRight, leftElement, rightElement, loading, fontSize, placeholderColor, disabled, readOnly, invalid, required, description, errorMessage, accepts, asTrigger, small, onChange, onInput, ref, ...props })=>{
|
|
14
14
|
const [inputValue, setInputValue] = useState('');
|
|
15
|
+
const iconSize = small ? 'small' : void 0;
|
|
15
16
|
useEffect(()=>{
|
|
16
17
|
if (null != value && inputValue !== value) setInputValue(value);
|
|
17
18
|
}, [
|
|
@@ -37,10 +38,12 @@ const TextInput = ({ value, label, placeholder, iconLeft, iconRight, leftElement
|
|
|
37
38
|
onInput: onInput ? handleInput : void 0,
|
|
38
39
|
onPaste: (event)=>handlePaste(event, handleChange, accepts),
|
|
39
40
|
asTrigger: asTrigger,
|
|
41
|
+
small: small,
|
|
40
42
|
...props,
|
|
41
43
|
children: [
|
|
42
44
|
iconLeft && getIcon(iconLeft, {
|
|
43
|
-
marginRight: 8
|
|
45
|
+
marginRight: 8,
|
|
46
|
+
size: iconSize
|
|
44
47
|
}),
|
|
45
48
|
leftElement,
|
|
46
49
|
/*#__PURE__*/ jsx(Label, {
|
|
@@ -59,7 +62,9 @@ const TextInput = ({ value, label, placeholder, iconLeft, iconRight, leftElement
|
|
|
59
62
|
})
|
|
60
63
|
}),
|
|
61
64
|
rightElement,
|
|
62
|
-
iconRight && getIcon(iconRight
|
|
65
|
+
iconRight && getIcon(iconRight, {
|
|
66
|
+
size: iconSize
|
|
67
|
+
}),
|
|
63
68
|
loading && /*#__PURE__*/ jsx(Spinner, {}),
|
|
64
69
|
/*#__PURE__*/ jsx(InputMessage, {
|
|
65
70
|
description: description,
|
|
@@ -4,5 +4,5 @@ type Props = {
|
|
|
4
4
|
value?: string;
|
|
5
5
|
onChange: (time: string) => void;
|
|
6
6
|
} & InputProps & TimeFieldProps;
|
|
7
|
-
declare const TimeInput: ({ value, label, iconLeft, iconRight, loading, fontSize, placeholderColor, disabled, readOnly, invalid, required, description, errorMessage, onChange, ref, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare const TimeInput: ({ value, label, iconLeft, iconRight, loading, fontSize, placeholderColor, disabled, readOnly, invalid, required, description, errorMessage, small, onChange, ref, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export default TimeInput;
|
|
@@ -10,8 +10,9 @@ import InputContainerStyles from "./helpers/InputContainerStyles.js";
|
|
|
10
10
|
import InputMessage from "./helpers/InputMessage.js";
|
|
11
11
|
import InputStyles, { preventProps } from "./helpers/InputStyles.js";
|
|
12
12
|
import Label from "./helpers/Label.js";
|
|
13
|
-
const TimeInput = ({ value, label, iconLeft, iconRight, loading, fontSize, placeholderColor, disabled, readOnly, invalid, required, description, errorMessage, onChange, ref, ...props })=>{
|
|
13
|
+
const TimeInput = ({ value, label, iconLeft, iconRight, loading, fontSize, placeholderColor, disabled, readOnly, invalid, required, description, errorMessage, small, onChange, ref, ...props })=>{
|
|
14
14
|
const [selectedTime, setSelectedTime] = useState(value ? parseTime(value) : null);
|
|
15
|
+
const iconSize = small ? 'small' : void 0;
|
|
15
16
|
useEffect(()=>{
|
|
16
17
|
if (value) {
|
|
17
18
|
const selectedString = `${selectedTime?.hour}:${selectedTime?.minute}`;
|
|
@@ -36,10 +37,12 @@ const TimeInput = ({ value, label, iconLeft, iconRight, loading, fontSize, place
|
|
|
36
37
|
isInvalid: invalid,
|
|
37
38
|
isRequired: required,
|
|
38
39
|
onChange: handleTimeChange,
|
|
40
|
+
small: small,
|
|
39
41
|
...props,
|
|
40
42
|
children: [
|
|
41
43
|
iconLeft && getIcon(iconLeft, {
|
|
42
|
-
marginRight: 8
|
|
44
|
+
marginRight: 8,
|
|
45
|
+
size: iconSize
|
|
43
46
|
}),
|
|
44
47
|
/*#__PURE__*/ jsx(Label, {
|
|
45
48
|
label: label,
|
|
@@ -58,7 +61,9 @@ const TimeInput = ({ value, label, iconLeft, iconRight, loading, fontSize, place
|
|
|
58
61
|
})
|
|
59
62
|
})
|
|
60
63
|
}),
|
|
61
|
-
iconRight && getIcon(iconRight
|
|
64
|
+
iconRight && getIcon(iconRight, {
|
|
65
|
+
size: iconSize
|
|
66
|
+
}),
|
|
62
67
|
loading && /*#__PURE__*/ jsx(Spinner, {}),
|
|
63
68
|
/*#__PURE__*/ jsx(InputMessage, {
|
|
64
69
|
description: description,
|
|
@@ -10,5 +10,5 @@ type StateProps = {
|
|
|
10
10
|
};
|
|
11
11
|
export type ContainerProps = InputContainerStyleProps & StateProps & ThemeProp;
|
|
12
12
|
type Props = ContainerProps & Required<ThemeProp>;
|
|
13
|
-
declare const styles: (({ theme: { input, accent }, backgroundColor, borderRadius, borderColor, textOnly, isDisabled, isInvalid, isReadOnly, hasLabel, pointer, }: Props) => CSSObject)[];
|
|
13
|
+
declare const styles: (({ theme: { input, accent }, backgroundColor, borderRadius, borderColor, textOnly, isDisabled, isInvalid, isReadOnly, hasLabel, pointer, small, }: Props) => CSSObject)[];
|
|
14
14
|
export default styles;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { marginProps, paddingProps, widthHeightProps } from "../../helpers/styledProps.js";
|
|
2
|
-
const baseStyles = ({ theme: { input, accent }, backgroundColor, borderRadius, borderColor, textOnly, isDisabled, isInvalid, isReadOnly, hasLabel, pointer })=>({
|
|
2
|
+
const baseStyles = ({ theme: { input, accent }, backgroundColor, borderRadius, borderColor, textOnly, isDisabled, isInvalid, isReadOnly, hasLabel, pointer, small })=>({
|
|
3
3
|
display: 'flex',
|
|
4
4
|
justifyContent: 'space-between',
|
|
5
5
|
alignItems: 'center',
|
|
6
6
|
position: 'relative',
|
|
7
7
|
width: '100%',
|
|
8
|
-
minHeight: hasLabel ? 48 : 40,
|
|
9
|
-
height: hasLabel ? 48 : 40,
|
|
8
|
+
minHeight: small ? 32 : hasLabel ? 48 : 40,
|
|
9
|
+
height: small ? 32 : hasLabel ? 48 : 40,
|
|
10
10
|
padding: '5px 16px',
|
|
11
11
|
boxSizing: 'border-box',
|
|
12
12
|
color: isDisabled ? input.labelColor.disabled : input.labelColor.default,
|
|
@@ -4,7 +4,7 @@ import type { OpenStateProps, SelectInputProps } from './typeDefs/selectionTypes
|
|
|
4
4
|
type Props = {
|
|
5
5
|
ref?: React.Ref<HTMLButtonElement>;
|
|
6
6
|
} & SelectInputProps & OpenStateProps & SelectProps;
|
|
7
|
-
declare const _default: (({ backgroundColor, menuBackground, children, fontSize, fontWeight, color, disabled, invalid, required, readOnly, loading, label, options, placeholder, placeholderColor, description, errorMessage, textOnly, value, defaultValue, width, height, maxHeight, allowRepeatSelection, hideCaret, position, fixedPosition, borderRadius, iconLeft, leftElement, rightElement, before, after, open, onOpenChange, onChange, afterShow, afterHide, selectionMode, separators, ref, ...props }: Props) => import("react/jsx-runtime").JSX.Element) & {
|
|
7
|
+
declare const _default: (({ backgroundColor, menuBackground, children, fontSize, fontWeight, color, disabled, invalid, required, readOnly, loading, label, options, placeholder, placeholderColor, description, errorMessage, textOnly, value, defaultValue, width, height, maxHeight, small, allowRepeatSelection, hideCaret, position, fixedPosition, borderRadius, iconLeft, leftElement, rightElement, before, after, open, onOpenChange, onChange, afterShow, afterHide, selectionMode, separators, ref, ...props }: Props) => import("react/jsx-runtime").JSX.Element) & {
|
|
8
8
|
Item: ({ id, value, header, body, leftElement, rightElement, inline, disabled, selectionMode, ...props }: import("..").SelectItem & Omit<import("react-aria-components").ListBoxItemProps<object>, "id" | "value" | "isDisabled"> & {
|
|
9
9
|
selectionMode?: SelectionMode;
|
|
10
10
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -15,7 +15,7 @@ import ListRootStyles, { preventProps } from "./ListHelpers/ListRootStyles.js";
|
|
|
15
15
|
import ListSection from "./ListHelpers/ListSection.js";
|
|
16
16
|
import MotionPopover from "./MotionPopover.js";
|
|
17
17
|
import Spinner from "./Spinner.js";
|
|
18
|
-
const Select_Select = ({ backgroundColor, menuBackground, children, fontSize, fontWeight, color, disabled, invalid, required, readOnly, loading, label, options, placeholder = 'Select', placeholderColor, description, errorMessage, textOnly, value, defaultValue, width, height, maxHeight, allowRepeatSelection, hideCaret, position, fixedPosition, borderRadius, iconLeft, leftElement, rightElement, before, after, open, onOpenChange, onChange, afterShow, afterHide, selectionMode, separators, ref, ...props })=>{
|
|
18
|
+
const Select_Select = ({ backgroundColor, menuBackground, children, fontSize, fontWeight, color, disabled, invalid, required, readOnly, loading, label, options, placeholder = 'Select', placeholderColor, description, errorMessage, textOnly, value, defaultValue, width, height, maxHeight, small, allowRepeatSelection, hideCaret, position, fixedPosition, borderRadius, iconLeft, leftElement, rightElement, before, after, open, onOpenChange, onChange, afterShow, afterHide, selectionMode, separators, ref, ...props })=>{
|
|
19
19
|
const [isOpen, handleOpenChange] = useControlledOpenState({
|
|
20
20
|
open,
|
|
21
21
|
onOpenChange,
|
|
@@ -74,9 +74,11 @@ const Select_Select = ({ backgroundColor, menuBackground, children, fontSize, fo
|
|
|
74
74
|
};
|
|
75
75
|
const hasValue = isMultiple ? (Array.isArray(currentValue) ? currentValue.length > 0 : false) || (Array.isArray(defaultValue) ? defaultValue.length > 0 : false) : !!(currentValue || defaultValue);
|
|
76
76
|
const hidePlaceholder = !hasValue && label;
|
|
77
|
+
const iconSize = small ? 'small' : void 0;
|
|
77
78
|
const caret = hideCaret ? null : /*#__PURE__*/ jsx(Icon, {
|
|
78
79
|
name: isOpen ? 'caret-up' : 'caret-down',
|
|
79
|
-
color: color
|
|
80
|
+
color: color,
|
|
81
|
+
size: iconSize
|
|
80
82
|
});
|
|
81
83
|
return /*#__PURE__*/ jsxs(SelectRoot, {
|
|
82
84
|
placeholder: placeholder,
|
|
@@ -102,6 +104,7 @@ const Select_Select = ({ backgroundColor, menuBackground, children, fontSize, fo
|
|
|
102
104
|
isInvalid: invalid,
|
|
103
105
|
borderRadius: borderRadius,
|
|
104
106
|
height: height,
|
|
107
|
+
small: small,
|
|
105
108
|
pointer: true,
|
|
106
109
|
ref: ref,
|
|
107
110
|
iconLeft: !!iconLeft,
|
|
@@ -109,7 +112,8 @@ const Select_Select = ({ backgroundColor, menuBackground, children, fontSize, fo
|
|
|
109
112
|
...marginProps,
|
|
110
113
|
children: [
|
|
111
114
|
iconLeft && getIcon(iconLeft, {
|
|
112
|
-
marginRight: 8
|
|
115
|
+
marginRight: 8,
|
|
116
|
+
size: iconSize
|
|
113
117
|
}),
|
|
114
118
|
leftElement,
|
|
115
119
|
/*#__PURE__*/ jsx(Label, {
|
|
@@ -11,6 +11,8 @@ export type InputContainerStyleProps = {
|
|
|
11
11
|
borderColor?: string;
|
|
12
12
|
/** Removes the background and padding from the input */
|
|
13
13
|
textOnly?: boolean;
|
|
14
|
+
/** Renders the input at 32px tall */
|
|
15
|
+
small?: boolean;
|
|
14
16
|
} & Width & Height & MinHeight & MarginPadding;
|
|
15
17
|
export type InputElementStyleProps = {
|
|
16
18
|
/** Sets the input fontSize */
|
|
@@ -125,6 +125,8 @@ export type InputContainerStyleProps = {
|
|
|
125
125
|
borderColor?: string;
|
|
126
126
|
/** Removes the background and padding from the input */
|
|
127
127
|
textOnly?: boolean;
|
|
128
|
+
/** Renders the input at 32px tall */
|
|
129
|
+
small?: boolean;
|
|
128
130
|
} & Width & Height & MinHeight & MarginPadding;
|
|
129
131
|
export type InputElementStyleProps = {
|
|
130
132
|
/** Sets the input fontSize */
|