@shoplflow/base 0.32.12 → 0.32.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/dist/index.cjs +222 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +38 -2
- package/dist/index.d.ts +38 -2
- package/dist/index.js +226 -18
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.d.cts
CHANGED
|
@@ -1001,14 +1001,26 @@ declare const StyledIcon: _emotion_styled.StyledComponent<{
|
|
|
1001
1001
|
as?: React$1.ElementType<any> | undefined;
|
|
1002
1002
|
} & IconOptionProps, React$1.SVGProps<SVGSVGElement>, {}>;
|
|
1003
1003
|
|
|
1004
|
+
declare const InputSizeVariants: {
|
|
1005
|
+
readonly S: "S";
|
|
1006
|
+
readonly M: "M";
|
|
1007
|
+
};
|
|
1008
|
+
declare type InputSizeVariantType = $Values<typeof InputSizeVariants>;
|
|
1004
1009
|
interface InputProps extends InputOptionProps, Omit<InputHTMLAttributes<HTMLInputElement>, 'width'>, DisableProps, RightElementProps {
|
|
1005
1010
|
}
|
|
1006
|
-
interface InputOptionProps extends ErrorProps {
|
|
1011
|
+
interface InputOptionProps extends ErrorProps, SizeVariantProps<InputSizeVariantType> {
|
|
1007
1012
|
width?: string;
|
|
1008
1013
|
maxLength?: number;
|
|
1014
|
+
/**
|
|
1015
|
+
* 최소 넓이를 지정
|
|
1016
|
+
* @description 64px;
|
|
1017
|
+
*/
|
|
1018
|
+
minWidth?: string;
|
|
1009
1019
|
borderRadius?: BorderRadiusTokens;
|
|
1010
1020
|
customNumberInputHeight?: string;
|
|
1011
1021
|
onClear?: () => void;
|
|
1022
|
+
gap?: CSSStyleDeclaration['gap'];
|
|
1023
|
+
initIsFocused?: boolean;
|
|
1012
1024
|
}
|
|
1013
1025
|
|
|
1014
1026
|
declare const Input: React__default.ForwardRefExoticComponent<InputProps & React__default.RefAttributes<HTMLInputElement>>;
|
|
@@ -1423,4 +1435,28 @@ declare type YearSelectProps = {
|
|
|
1423
1435
|
}) => void;
|
|
1424
1436
|
};
|
|
1425
1437
|
|
|
1426
|
-
|
|
1438
|
+
declare const NumberComboboxSizeVariants: {
|
|
1439
|
+
readonly S: "S";
|
|
1440
|
+
readonly M: "M";
|
|
1441
|
+
};
|
|
1442
|
+
declare type NumberComboboxSizeVariantType = $Values<typeof NumberComboboxSizeVariants>;
|
|
1443
|
+
declare type NumberComboboxInputType = 'hours' | 'minutes';
|
|
1444
|
+
declare type NumberComboboxErrorType = 'range' | 'unit';
|
|
1445
|
+
declare type NumberComboboxOptionProps = ColorTokenProps & SizeVariantProps<NumberComboboxSizeVariantType>;
|
|
1446
|
+
declare type NumberComboboxProps = NumberComboboxOptionProps & Omit<InputHTMLAttributes<HTMLInputElement>, 'width'> & {
|
|
1447
|
+
disabled?: boolean;
|
|
1448
|
+
onSelect?: (value: string | number | readonly string[]) => void;
|
|
1449
|
+
width?: string;
|
|
1450
|
+
items: Array<{
|
|
1451
|
+
label: string;
|
|
1452
|
+
value: string;
|
|
1453
|
+
}>;
|
|
1454
|
+
/**
|
|
1455
|
+
* 에러 여부
|
|
1456
|
+
*/
|
|
1457
|
+
isError?: boolean;
|
|
1458
|
+
};
|
|
1459
|
+
|
|
1460
|
+
declare const NumberCombobox: ({ disabled, onSelect, onChange, value, width, onBlur, items, isError, sizeVar, placeholder, maxLength, className, ...rest }: NumberComboboxProps) => react_jsx_runtime.JSX.Element;
|
|
1461
|
+
|
|
1462
|
+
export { AnnualDatepicker, AnnualDatepickerProps, Avatar, AvatarOptionProps, AvatarProps, AvatarSizeVariantType, AvatarSizeVariants, BackDropOptionProps, BackDropProps, BorderRadiusTokens, BoxShadowTokens, Button, ButtonComponent, ButtonOptionProps, ButtonProps, ButtonSizeVariantType, ButtonSizeVariants, ButtonStyleVariantType, ButtonStyleVariants, CHECKBOX_SYMBOL_KEY, Callout, CalloutOptionProps, CalloutProps, CalloutType, CalloutTypes, Checkbox, CheckboxOptionProps, CheckboxProps, CheckboxStyleVariantType, CheckboxStyleVariants, ChipButton, ChipButtonOptionProps, ChipButtonProps, ChipButtonSizeVariantType, ChipButtonSizeVariants, ChipButtonStyleVariantType, ChipButtonStyleVariants, ChipToggle, ChipToggleOptionProps, ChipToggleProps, ChipToggleSizeVariantType, ChipToggleSizeVariants, ChipToggleStyleVariantType, ChipToggleStyleVariants, ColorTokens, DangerouslySetInnerHTML, DayCalendarType, DayDatepicker, DayDatepickerHeaderCustomProps, DayDatepickerOptionProps, DayDatepickerProps, DayDatepickerSizeVariantType, DayDatepickerSizeVariants, Dropdown, DropdownButtonProps, DropdownContentProps, DropdownOptionProps, DropdownOptionVariantType, DropdownProps, DropdownSizeVariantType, FontWeightTokens, Icon, IconButton, IconButtonComponent, IconButtonOptionProps, IconButtonProps, IconButtonSizeVariantType, IconButtonSizeVariants, IconButtonStyleVariantType, IconButtonStyleVariants, IconOptionProps, IconProps, IconSizeVariants, IconSizeVariantsType, Input, InputButton, InputButtonOptionProps, InputButtonProps, InputOptionProps, InputProps, InputSizeVariantType, InputSizeVariants, List, ListContent2ColumnsProps, ListOptionProps, ListProps, ListText2RowsProps, MODAL_FOOTER_KEY, MODAL_HEADER_KEY, Menu, MenuOptionProps, MenuProps, MenuSizeVariantType, MenuSizeVariants, MinusBoxOptionProps, MinusBoxProps, MinusButton, Modal, ModalBodyOptionProps, ModalBodyProps, ModalContainerOptionProps, ModalContainerProps, ModalContext, ModalFooterOptionProps, ModalFooterProps, ModalFooterType, ModalHandlerContext, ModalHeaderOptionProps, ModalHeaderProps, ModalHeaderType, ModalPortal as ModalProvider, ModalSize, ModalSizeType, ModalStateType, MonthClickDateInfo, MonthDatepicker, MonthDatepickerProps, MonthDatepickerStyleType, MotionStack, MotionStackComponentType, MotionStackContainer, MotionStackContainerComponentType, NumberCombobox, NumberComboboxErrorType, NumberComboboxInputType, NumberComboboxOptionProps, NumberComboboxProps, NumberComboboxSizeVariantType, NumberComboboxSizeVariants, Pagination, PaginationOptionProps, PaginationProps, PaginationSizeSelectorProps, Popper, PopperOptionProps, PopperPortal, PopperPortalProps, PopperProps, PopperTrigger, PopperTriggerProps, RADIO_SYMBOL_KEY, Radio, RadioOptionProps, RadioProps, RemoveModalProps, ScrollArea, ScrollAreaOptionProps, ScrollAreaProps, ScrollbarRefType, SelectInputButton, SelectInputButtonOptionProps, SelectInputButtonProps, ShoplflowProvider, ShoplflowProviderProps, SpacingTokens, Stack, StackComponentType, StackContainer, StackContainerComponentType, StackContainerGenericProps, StackContainerOptionProps, StackContainerProps, StackGenericProps, StackOptionProps, StackProps, StyledIcon, StyledStack, StyledStackContainer, Switch, SwitchOptionProps, SwitchProps, TREE_SYMBOL_KEY, TabOptionProps, TabProps, TabSizeVariantType, TabSizeVariants, TabStyleVariantType, TabStyleVariants, TabStyledProps, TabTextStyledProps, Tabs, TabsContext, TabsContextType, TabsOptionProps, TabsProps, Tag, TagOptionProps, TagProps, TagSizeVariantType, TagSizeVariants, TagStyleVariantType, TagStyleVariants, Text, Text2Rows, TextArea, TextAreaOptionProps, TextAreaProps, TextOptionProps, TextProps, ToggleButton, ToggleButtonInnerRadioOptionProps, ToggleButtonInnerRadioProps, ToggleButtonOptionProps, ToggleButtonProps, ToggleButtonSizeVariantType, ToggleButtonSizeVariants, Tooltip, TooltipContentProps, TooltipOptionProps, TooltipProps, Tree, TreeItem, TreeItemOptionProps, TreeItemProps, TreeOptionProps, TreeProps, TypographyTokens, WeekClickDateInfo, WeekDatepicker, WeekDatepickerProps, WeekDatepickerStyleType, YearSelectProps, borderRadiusTokens, boxShadowTokens, colorTokens, fontWeightTokens, getDomain, spacingTokens, typographyTokens, useDomain, useHandleModal, useModalValue, useTabs };
|
package/dist/index.d.ts
CHANGED
|
@@ -1001,14 +1001,26 @@ declare const StyledIcon: _emotion_styled.StyledComponent<{
|
|
|
1001
1001
|
as?: React$1.ElementType<any> | undefined;
|
|
1002
1002
|
} & IconOptionProps, React$1.SVGProps<SVGSVGElement>, {}>;
|
|
1003
1003
|
|
|
1004
|
+
declare const InputSizeVariants: {
|
|
1005
|
+
readonly S: "S";
|
|
1006
|
+
readonly M: "M";
|
|
1007
|
+
};
|
|
1008
|
+
declare type InputSizeVariantType = $Values<typeof InputSizeVariants>;
|
|
1004
1009
|
interface InputProps extends InputOptionProps, Omit<InputHTMLAttributes<HTMLInputElement>, 'width'>, DisableProps, RightElementProps {
|
|
1005
1010
|
}
|
|
1006
|
-
interface InputOptionProps extends ErrorProps {
|
|
1011
|
+
interface InputOptionProps extends ErrorProps, SizeVariantProps<InputSizeVariantType> {
|
|
1007
1012
|
width?: string;
|
|
1008
1013
|
maxLength?: number;
|
|
1014
|
+
/**
|
|
1015
|
+
* 최소 넓이를 지정
|
|
1016
|
+
* @description 64px;
|
|
1017
|
+
*/
|
|
1018
|
+
minWidth?: string;
|
|
1009
1019
|
borderRadius?: BorderRadiusTokens;
|
|
1010
1020
|
customNumberInputHeight?: string;
|
|
1011
1021
|
onClear?: () => void;
|
|
1022
|
+
gap?: CSSStyleDeclaration['gap'];
|
|
1023
|
+
initIsFocused?: boolean;
|
|
1012
1024
|
}
|
|
1013
1025
|
|
|
1014
1026
|
declare const Input: React__default.ForwardRefExoticComponent<InputProps & React__default.RefAttributes<HTMLInputElement>>;
|
|
@@ -1423,4 +1435,28 @@ declare type YearSelectProps = {
|
|
|
1423
1435
|
}) => void;
|
|
1424
1436
|
};
|
|
1425
1437
|
|
|
1426
|
-
|
|
1438
|
+
declare const NumberComboboxSizeVariants: {
|
|
1439
|
+
readonly S: "S";
|
|
1440
|
+
readonly M: "M";
|
|
1441
|
+
};
|
|
1442
|
+
declare type NumberComboboxSizeVariantType = $Values<typeof NumberComboboxSizeVariants>;
|
|
1443
|
+
declare type NumberComboboxInputType = 'hours' | 'minutes';
|
|
1444
|
+
declare type NumberComboboxErrorType = 'range' | 'unit';
|
|
1445
|
+
declare type NumberComboboxOptionProps = ColorTokenProps & SizeVariantProps<NumberComboboxSizeVariantType>;
|
|
1446
|
+
declare type NumberComboboxProps = NumberComboboxOptionProps & Omit<InputHTMLAttributes<HTMLInputElement>, 'width'> & {
|
|
1447
|
+
disabled?: boolean;
|
|
1448
|
+
onSelect?: (value: string | number | readonly string[]) => void;
|
|
1449
|
+
width?: string;
|
|
1450
|
+
items: Array<{
|
|
1451
|
+
label: string;
|
|
1452
|
+
value: string;
|
|
1453
|
+
}>;
|
|
1454
|
+
/**
|
|
1455
|
+
* 에러 여부
|
|
1456
|
+
*/
|
|
1457
|
+
isError?: boolean;
|
|
1458
|
+
};
|
|
1459
|
+
|
|
1460
|
+
declare const NumberCombobox: ({ disabled, onSelect, onChange, value, width, onBlur, items, isError, sizeVar, placeholder, maxLength, className, ...rest }: NumberComboboxProps) => react_jsx_runtime.JSX.Element;
|
|
1461
|
+
|
|
1462
|
+
export { AnnualDatepicker, AnnualDatepickerProps, Avatar, AvatarOptionProps, AvatarProps, AvatarSizeVariantType, AvatarSizeVariants, BackDropOptionProps, BackDropProps, BorderRadiusTokens, BoxShadowTokens, Button, ButtonComponent, ButtonOptionProps, ButtonProps, ButtonSizeVariantType, ButtonSizeVariants, ButtonStyleVariantType, ButtonStyleVariants, CHECKBOX_SYMBOL_KEY, Callout, CalloutOptionProps, CalloutProps, CalloutType, CalloutTypes, Checkbox, CheckboxOptionProps, CheckboxProps, CheckboxStyleVariantType, CheckboxStyleVariants, ChipButton, ChipButtonOptionProps, ChipButtonProps, ChipButtonSizeVariantType, ChipButtonSizeVariants, ChipButtonStyleVariantType, ChipButtonStyleVariants, ChipToggle, ChipToggleOptionProps, ChipToggleProps, ChipToggleSizeVariantType, ChipToggleSizeVariants, ChipToggleStyleVariantType, ChipToggleStyleVariants, ColorTokens, DangerouslySetInnerHTML, DayCalendarType, DayDatepicker, DayDatepickerHeaderCustomProps, DayDatepickerOptionProps, DayDatepickerProps, DayDatepickerSizeVariantType, DayDatepickerSizeVariants, Dropdown, DropdownButtonProps, DropdownContentProps, DropdownOptionProps, DropdownOptionVariantType, DropdownProps, DropdownSizeVariantType, FontWeightTokens, Icon, IconButton, IconButtonComponent, IconButtonOptionProps, IconButtonProps, IconButtonSizeVariantType, IconButtonSizeVariants, IconButtonStyleVariantType, IconButtonStyleVariants, IconOptionProps, IconProps, IconSizeVariants, IconSizeVariantsType, Input, InputButton, InputButtonOptionProps, InputButtonProps, InputOptionProps, InputProps, InputSizeVariantType, InputSizeVariants, List, ListContent2ColumnsProps, ListOptionProps, ListProps, ListText2RowsProps, MODAL_FOOTER_KEY, MODAL_HEADER_KEY, Menu, MenuOptionProps, MenuProps, MenuSizeVariantType, MenuSizeVariants, MinusBoxOptionProps, MinusBoxProps, MinusButton, Modal, ModalBodyOptionProps, ModalBodyProps, ModalContainerOptionProps, ModalContainerProps, ModalContext, ModalFooterOptionProps, ModalFooterProps, ModalFooterType, ModalHandlerContext, ModalHeaderOptionProps, ModalHeaderProps, ModalHeaderType, ModalPortal as ModalProvider, ModalSize, ModalSizeType, ModalStateType, MonthClickDateInfo, MonthDatepicker, MonthDatepickerProps, MonthDatepickerStyleType, MotionStack, MotionStackComponentType, MotionStackContainer, MotionStackContainerComponentType, NumberCombobox, NumberComboboxErrorType, NumberComboboxInputType, NumberComboboxOptionProps, NumberComboboxProps, NumberComboboxSizeVariantType, NumberComboboxSizeVariants, Pagination, PaginationOptionProps, PaginationProps, PaginationSizeSelectorProps, Popper, PopperOptionProps, PopperPortal, PopperPortalProps, PopperProps, PopperTrigger, PopperTriggerProps, RADIO_SYMBOL_KEY, Radio, RadioOptionProps, RadioProps, RemoveModalProps, ScrollArea, ScrollAreaOptionProps, ScrollAreaProps, ScrollbarRefType, SelectInputButton, SelectInputButtonOptionProps, SelectInputButtonProps, ShoplflowProvider, ShoplflowProviderProps, SpacingTokens, Stack, StackComponentType, StackContainer, StackContainerComponentType, StackContainerGenericProps, StackContainerOptionProps, StackContainerProps, StackGenericProps, StackOptionProps, StackProps, StyledIcon, StyledStack, StyledStackContainer, Switch, SwitchOptionProps, SwitchProps, TREE_SYMBOL_KEY, TabOptionProps, TabProps, TabSizeVariantType, TabSizeVariants, TabStyleVariantType, TabStyleVariants, TabStyledProps, TabTextStyledProps, Tabs, TabsContext, TabsContextType, TabsOptionProps, TabsProps, Tag, TagOptionProps, TagProps, TagSizeVariantType, TagSizeVariants, TagStyleVariantType, TagStyleVariants, Text, Text2Rows, TextArea, TextAreaOptionProps, TextAreaProps, TextOptionProps, TextProps, ToggleButton, ToggleButtonInnerRadioOptionProps, ToggleButtonInnerRadioProps, ToggleButtonOptionProps, ToggleButtonProps, ToggleButtonSizeVariantType, ToggleButtonSizeVariants, Tooltip, TooltipContentProps, TooltipOptionProps, TooltipProps, Tree, TreeItem, TreeItemOptionProps, TreeItemProps, TreeOptionProps, TreeProps, TypographyTokens, WeekClickDateInfo, WeekDatepicker, WeekDatepickerProps, WeekDatepickerStyleType, YearSelectProps, borderRadiusTokens, boxShadowTokens, colorTokens, fontWeightTokens, getDomain, spacingTokens, typographyTokens, useDomain, useHandleModal, useModalValue, useTabs };
|
package/dist/index.js
CHANGED
|
@@ -5,15 +5,15 @@ import { motion, AnimatePresence, LayoutGroup, LazyMotion, domAnimation } from '
|
|
|
5
5
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
6
6
|
import { createPortal } from 'react-dom';
|
|
7
7
|
import { css } from '@emotion/react';
|
|
8
|
-
import { useMergeRefs, noop, OutSideClick, useSelect,
|
|
8
|
+
import { useMergeRefs, noop, OutSideClick, useSelect, useOutsideClick, useParentElementClick, isNullOrUndefined } from '@shoplflow/utils';
|
|
9
9
|
import Scrollbars from 'react-custom-scrollbars-2';
|
|
10
10
|
import { FloatingPortal, autoUpdate, offset, autoPlacement } from '@floating-ui/react';
|
|
11
11
|
export { arrow, flip, hide, inline, offset, shift, size } from '@floating-ui/react';
|
|
12
12
|
import { useFloating } from '@floating-ui/react-dom';
|
|
13
13
|
import * as ShoplAssets from '@shoplflow/shopl-assets';
|
|
14
|
-
import { DownArrowSolidXsmallIcon, DownArrowIcon, FirstPageIcon, LeftArrowIcon, RightArrowIcon, EndPageIcon } from '@shoplflow/shopl-assets';
|
|
14
|
+
import { DownArrowSolidXsmallIcon, DownArrowIcon, FirstPageIcon, LeftArrowIcon, RightArrowIcon, EndPageIcon, UpArrowSolidXsmallIcon } from '@shoplflow/shopl-assets';
|
|
15
15
|
import * as HadaAssets from '@shoplflow/hada-assets';
|
|
16
|
-
import { flip, shift } from '@floating-ui/core';
|
|
16
|
+
import { flip, shift, offset as offset$1 } from '@floating-ui/core';
|
|
17
17
|
import DatePicker2 from 'react-datepicker';
|
|
18
18
|
import 'react-datepicker/dist/react-datepicker.css';
|
|
19
19
|
import SimpleBarReact from 'simplebar-react';
|
|
@@ -1632,6 +1632,10 @@ var getWidthAndHeightFromSizeVar = (sizeVar) => {
|
|
|
1632
1632
|
min-width: 40px;
|
|
1633
1633
|
height: 40px;
|
|
1634
1634
|
min-height: 40px;
|
|
1635
|
+
& > svg {
|
|
1636
|
+
width: 24px;
|
|
1637
|
+
height: 24px;
|
|
1638
|
+
}
|
|
1635
1639
|
`;
|
|
1636
1640
|
case "S":
|
|
1637
1641
|
return css`
|
|
@@ -1639,6 +1643,10 @@ var getWidthAndHeightFromSizeVar = (sizeVar) => {
|
|
|
1639
1643
|
min-width: 32px;
|
|
1640
1644
|
height: 32px;
|
|
1641
1645
|
min-height: 32px;
|
|
1646
|
+
& > svg {
|
|
1647
|
+
width: 20px;
|
|
1648
|
+
height: 20px;
|
|
1649
|
+
}
|
|
1642
1650
|
`;
|
|
1643
1651
|
case "XS":
|
|
1644
1652
|
return css`
|
|
@@ -1646,6 +1654,10 @@ var getWidthAndHeightFromSizeVar = (sizeVar) => {
|
|
|
1646
1654
|
min-width: 24px;
|
|
1647
1655
|
height: 24px;
|
|
1648
1656
|
min-height: 24px;
|
|
1657
|
+
& > svg {
|
|
1658
|
+
width: 12px;
|
|
1659
|
+
height: 12px;
|
|
1660
|
+
}
|
|
1649
1661
|
`;
|
|
1650
1662
|
default:
|
|
1651
1663
|
return css`
|
|
@@ -1653,6 +1665,10 @@ var getWidthAndHeightFromSizeVar = (sizeVar) => {
|
|
|
1653
1665
|
min-width: 40px;
|
|
1654
1666
|
height: 40px;
|
|
1655
1667
|
min-height: 40px;
|
|
1668
|
+
& > svg {
|
|
1669
|
+
width: 20px;
|
|
1670
|
+
height: 20px;
|
|
1671
|
+
}
|
|
1656
1672
|
`;
|
|
1657
1673
|
}
|
|
1658
1674
|
};
|
|
@@ -1714,10 +1730,6 @@ var StyledIconButton = styled6.button`
|
|
|
1714
1730
|
${({ styleVar, color, isHovered }) => getStyleByStyleVar2(styleVar, color, isHovered)};
|
|
1715
1731
|
${({ sizeVar }) => getWidthAndHeightFromSizeVar(sizeVar)};
|
|
1716
1732
|
${({ disabled }) => getDisabledStyle(disabled)};
|
|
1717
|
-
& > svg {
|
|
1718
|
-
width: 20px;
|
|
1719
|
-
height: 20px;
|
|
1720
|
-
}
|
|
1721
1733
|
`;
|
|
1722
1734
|
var IconButton = forwardRef(
|
|
1723
1735
|
(_a, ref) => {
|
|
@@ -2108,7 +2120,7 @@ var InputWrapper = styled6.label`
|
|
|
2108
2120
|
borderRadius
|
|
2109
2121
|
})};
|
|
2110
2122
|
justify-content: space-between;
|
|
2111
|
-
gap: 8px;
|
|
2123
|
+
gap: ${({ gap }) => gap || "8px"};
|
|
2112
2124
|
border: 1px solid ${(props) => getBorderColorByStatus(props)};
|
|
2113
2125
|
background-color: ${colorTokens.neutral0};
|
|
2114
2126
|
overflow: hidden;
|
|
@@ -3008,7 +3020,7 @@ var StyledInput = styled6.input`
|
|
|
3008
3020
|
padding: 4px 0 4px 12px;
|
|
3009
3021
|
background-color: transparent;
|
|
3010
3022
|
display: flex;
|
|
3011
|
-
min-width: 64px;
|
|
3023
|
+
min-width: ${({ minWidth }) => minWidth || "64px"};
|
|
3012
3024
|
width: 100%;
|
|
3013
3025
|
border: none;
|
|
3014
3026
|
box-sizing: border-box;
|
|
@@ -3101,7 +3113,12 @@ var Input = forwardRef(
|
|
|
3101
3113
|
width,
|
|
3102
3114
|
borderRadius,
|
|
3103
3115
|
customNumberInputHeight,
|
|
3104
|
-
onKeyDown
|
|
3116
|
+
onKeyDown,
|
|
3117
|
+
sizeVar = "M",
|
|
3118
|
+
rightSource,
|
|
3119
|
+
minWidth,
|
|
3120
|
+
gap,
|
|
3121
|
+
initIsFocused
|
|
3105
3122
|
} = _b, rest = __objRest(_b, [
|
|
3106
3123
|
"onFocus",
|
|
3107
3124
|
"onBlur",
|
|
@@ -3119,10 +3136,15 @@ var Input = forwardRef(
|
|
|
3119
3136
|
"width",
|
|
3120
3137
|
"borderRadius",
|
|
3121
3138
|
"customNumberInputHeight",
|
|
3122
|
-
"onKeyDown"
|
|
3139
|
+
"onKeyDown",
|
|
3140
|
+
"sizeVar",
|
|
3141
|
+
"rightSource",
|
|
3142
|
+
"minWidth",
|
|
3143
|
+
"gap",
|
|
3144
|
+
"initIsFocused"
|
|
3123
3145
|
]);
|
|
3124
3146
|
const [text, setText] = useState("");
|
|
3125
|
-
const [isFocused, setIsFocused] = useState(
|
|
3147
|
+
const [isFocused, setIsFocused] = useState(Boolean(initIsFocused));
|
|
3126
3148
|
const [type, setType] = useState(initialType);
|
|
3127
3149
|
const [isHovered, setIsHovered] = useState(false);
|
|
3128
3150
|
const uniqueId = useId();
|
|
@@ -3209,6 +3231,13 @@ var Input = forwardRef(
|
|
|
3209
3231
|
useEffect(() => {
|
|
3210
3232
|
setType(initialType);
|
|
3211
3233
|
}, [initialType]);
|
|
3234
|
+
const height = sizeVar === "M" ? "40px" : "32px";
|
|
3235
|
+
useEffect(() => {
|
|
3236
|
+
if (typeof initIsFocused === "undefined") {
|
|
3237
|
+
return;
|
|
3238
|
+
}
|
|
3239
|
+
setIsFocused(initIsFocused);
|
|
3240
|
+
}, [initIsFocused]);
|
|
3212
3241
|
return /* @__PURE__ */ jsxs(
|
|
3213
3242
|
InputWrapper,
|
|
3214
3243
|
{
|
|
@@ -3221,11 +3250,12 @@ var Input = forwardRef(
|
|
|
3221
3250
|
onMouseLeave: handleOnMouseLeave,
|
|
3222
3251
|
type,
|
|
3223
3252
|
width,
|
|
3224
|
-
height
|
|
3225
|
-
maxHeight:
|
|
3253
|
+
height,
|
|
3254
|
+
maxHeight: height,
|
|
3226
3255
|
"data-shoplflow": "input",
|
|
3227
3256
|
borderRadius,
|
|
3228
3257
|
customNumberInputHeight,
|
|
3258
|
+
gap,
|
|
3229
3259
|
children: [
|
|
3230
3260
|
/* @__PURE__ */ jsx(
|
|
3231
3261
|
StyledInput,
|
|
@@ -3240,6 +3270,7 @@ var Input = forwardRef(
|
|
|
3240
3270
|
type,
|
|
3241
3271
|
id: uniqueId,
|
|
3242
3272
|
ref: refs,
|
|
3273
|
+
minWidth,
|
|
3243
3274
|
className: "body1_400" + (className ? ` ${className}` : "")
|
|
3244
3275
|
}, rest)
|
|
3245
3276
|
),
|
|
@@ -3253,13 +3284,20 @@ var Input = forwardRef(
|
|
|
3253
3284
|
iconSource: assetFunction(type === "password" ? "ViewOffIcon" : "ViewOnIcon")
|
|
3254
3285
|
}
|
|
3255
3286
|
) })
|
|
3256
|
-
] })
|
|
3287
|
+
] }),
|
|
3288
|
+
rightSource && rightSource
|
|
3257
3289
|
]
|
|
3258
3290
|
}
|
|
3259
3291
|
);
|
|
3260
3292
|
}
|
|
3261
3293
|
);
|
|
3262
3294
|
var Input_default = Input;
|
|
3295
|
+
|
|
3296
|
+
// src/components/Inputs/Input/Input.types.ts
|
|
3297
|
+
var InputSizeVariants = {
|
|
3298
|
+
S: "S",
|
|
3299
|
+
M: "M"
|
|
3300
|
+
};
|
|
3263
3301
|
var StyledInputButton = styled6.div`
|
|
3264
3302
|
display: flex;
|
|
3265
3303
|
flex-direction: row;
|
|
@@ -3629,7 +3667,7 @@ var Tooltip = (_a) => {
|
|
|
3629
3667
|
trigger,
|
|
3630
3668
|
popper,
|
|
3631
3669
|
placement = "bottom-start",
|
|
3632
|
-
offset:
|
|
3670
|
+
offset: offset4 = 4,
|
|
3633
3671
|
triggerRef,
|
|
3634
3672
|
portalRef
|
|
3635
3673
|
} = _b, popperProps = __objRest(_b, [
|
|
@@ -3655,7 +3693,7 @@ var Tooltip = (_a) => {
|
|
|
3655
3693
|
}
|
|
3656
3694
|
onOpenChange == null ? void 0 : onOpenChange(false);
|
|
3657
3695
|
}, [open, onOpenChange]);
|
|
3658
|
-
return /* @__PURE__ */ jsxs(Popper_default, __spreadProps(__spreadValues({ offset:
|
|
3696
|
+
return /* @__PURE__ */ jsxs(Popper_default, __spreadProps(__spreadValues({ offset: offset4, placement, middlewares: [flip(), shift({ padding: 5 })] }, popperProps), { children: [
|
|
3659
3697
|
/* @__PURE__ */ jsx(
|
|
3660
3698
|
Popper_default.Trigger,
|
|
3661
3699
|
{
|
|
@@ -5751,6 +5789,176 @@ var WeekDatepicker = ({
|
|
|
5751
5789
|
] });
|
|
5752
5790
|
};
|
|
5753
5791
|
var WeekDatepicker_default = WeekDatepicker;
|
|
5792
|
+
var StyledNumberCombobox = styled6.div``;
|
|
5793
|
+
var IconWrapper2 = styled6(motion.div)`
|
|
5794
|
+
display: flex;
|
|
5795
|
+
width: fit-content;
|
|
5796
|
+
height: fit-content;
|
|
5797
|
+
`;
|
|
5798
|
+
var NumberCombobox = (_a) => {
|
|
5799
|
+
var _b = _a, {
|
|
5800
|
+
disabled,
|
|
5801
|
+
onSelect,
|
|
5802
|
+
onChange,
|
|
5803
|
+
value,
|
|
5804
|
+
width = "90px",
|
|
5805
|
+
onBlur,
|
|
5806
|
+
items,
|
|
5807
|
+
isError,
|
|
5808
|
+
sizeVar = "M",
|
|
5809
|
+
placeholder = "Enter",
|
|
5810
|
+
maxLength,
|
|
5811
|
+
className
|
|
5812
|
+
} = _b, rest = __objRest(_b, [
|
|
5813
|
+
"disabled",
|
|
5814
|
+
"onSelect",
|
|
5815
|
+
"onChange",
|
|
5816
|
+
"value",
|
|
5817
|
+
"width",
|
|
5818
|
+
"onBlur",
|
|
5819
|
+
"items",
|
|
5820
|
+
"isError",
|
|
5821
|
+
"sizeVar",
|
|
5822
|
+
"placeholder",
|
|
5823
|
+
"maxLength",
|
|
5824
|
+
"className"
|
|
5825
|
+
]);
|
|
5826
|
+
const selector = useRef(`shoplflow-${crypto.randomUUID()}-number-combobox`).current;
|
|
5827
|
+
const inputRef = useRef(null);
|
|
5828
|
+
const [isOpen, setIsOpen] = useOutsideClick({
|
|
5829
|
+
selector: `.${selector}`,
|
|
5830
|
+
useOutsideScroll: true
|
|
5831
|
+
});
|
|
5832
|
+
let _className = `${selector}`;
|
|
5833
|
+
if (className) {
|
|
5834
|
+
_className += ` ${className}`;
|
|
5835
|
+
}
|
|
5836
|
+
return /* @__PURE__ */ jsx(StyledNumberCombobox, { "data-shoplflow": "NumberCombobox", color: "shopl300", className: _className, children: /* @__PURE__ */ jsxs(Popper_default, { middlewares: [offset$1(4)], children: [
|
|
5837
|
+
/* @__PURE__ */ jsx(Popper_default.Trigger, { isOpen, className: _className, children: /* @__PURE__ */ jsx(
|
|
5838
|
+
Input_default,
|
|
5839
|
+
__spreadValues({
|
|
5840
|
+
sizeVar,
|
|
5841
|
+
width,
|
|
5842
|
+
ref: inputRef,
|
|
5843
|
+
type: "number",
|
|
5844
|
+
style: { textAlign: "left", paddingRight: "0px" },
|
|
5845
|
+
className: _className,
|
|
5846
|
+
gap: "4px",
|
|
5847
|
+
initIsFocused: isOpen,
|
|
5848
|
+
value,
|
|
5849
|
+
onChange,
|
|
5850
|
+
onFocus: () => {
|
|
5851
|
+
setIsOpen(true);
|
|
5852
|
+
},
|
|
5853
|
+
autoCapitalize: "off",
|
|
5854
|
+
customNumberInputHeight: sizeVar === "S" ? "32px" : "40px",
|
|
5855
|
+
isError,
|
|
5856
|
+
minWidth: `calc(100% -32px)`,
|
|
5857
|
+
autoComplete: "off",
|
|
5858
|
+
autoCorrect: "off",
|
|
5859
|
+
placeholder,
|
|
5860
|
+
disabled,
|
|
5861
|
+
onKeyDown: (event) => {
|
|
5862
|
+
var _a2;
|
|
5863
|
+
if (event.key === "ArrowUp" || event.key === "ArrowDown") {
|
|
5864
|
+
event.preventDefault();
|
|
5865
|
+
return;
|
|
5866
|
+
}
|
|
5867
|
+
setIsOpen(true);
|
|
5868
|
+
if (event.key === "Enter") {
|
|
5869
|
+
const currentValue = event.currentTarget.value;
|
|
5870
|
+
onSelect == null ? void 0 : onSelect(currentValue);
|
|
5871
|
+
setIsOpen(false);
|
|
5872
|
+
(_a2 = inputRef.current) == null ? void 0 : _a2.blur();
|
|
5873
|
+
return;
|
|
5874
|
+
}
|
|
5875
|
+
},
|
|
5876
|
+
maxLength,
|
|
5877
|
+
onBlur: (event) => {
|
|
5878
|
+
const target = event.target;
|
|
5879
|
+
const isNested = Boolean(target.closest(`.${_className}`));
|
|
5880
|
+
if (isNested) {
|
|
5881
|
+
return;
|
|
5882
|
+
}
|
|
5883
|
+
onBlur == null ? void 0 : onBlur(event);
|
|
5884
|
+
},
|
|
5885
|
+
rightSource: /* @__PURE__ */ jsx(StackContainer_default.Horizontal, { padding: "0px 4px 0px 0px", children: /* @__PURE__ */ jsx(
|
|
5886
|
+
IconButton_default,
|
|
5887
|
+
{
|
|
5888
|
+
sizeVar: "XS",
|
|
5889
|
+
styleVar: "GHOST",
|
|
5890
|
+
className: _className,
|
|
5891
|
+
onClick: () => {
|
|
5892
|
+
if (disabled) {
|
|
5893
|
+
return;
|
|
5894
|
+
}
|
|
5895
|
+
setIsOpen((prev) => !prev);
|
|
5896
|
+
},
|
|
5897
|
+
style: { cursor: disabled ? "not-allowed" : "cursor" },
|
|
5898
|
+
children: /* @__PURE__ */ jsx(
|
|
5899
|
+
IconWrapper2,
|
|
5900
|
+
{
|
|
5901
|
+
animate: {
|
|
5902
|
+
rotate: isOpen ? 180 : 0,
|
|
5903
|
+
transition: {
|
|
5904
|
+
duration: 0.2
|
|
5905
|
+
}
|
|
5906
|
+
},
|
|
5907
|
+
children: /* @__PURE__ */ jsx(
|
|
5908
|
+
Icon_default,
|
|
5909
|
+
{
|
|
5910
|
+
iconSource: UpArrowSolidXsmallIcon,
|
|
5911
|
+
sizeVar: "XS",
|
|
5912
|
+
color: "neutral400",
|
|
5913
|
+
style: { cursor: disabled ? "not-allowed" : "cursor" }
|
|
5914
|
+
}
|
|
5915
|
+
)
|
|
5916
|
+
}
|
|
5917
|
+
)
|
|
5918
|
+
}
|
|
5919
|
+
) })
|
|
5920
|
+
}, rest)
|
|
5921
|
+
) }),
|
|
5922
|
+
/* @__PURE__ */ jsx(Popper_default.Portal, { children: /* @__PURE__ */ jsx(
|
|
5923
|
+
SimpleBarReact,
|
|
5924
|
+
{
|
|
5925
|
+
className: _className,
|
|
5926
|
+
style: {
|
|
5927
|
+
height: "128px",
|
|
5928
|
+
maxHeight: "128px",
|
|
5929
|
+
width,
|
|
5930
|
+
padding: "4px",
|
|
5931
|
+
filter: "drop-shadow(0px 8px 16px rgba(0, 0, 0, 0.12))",
|
|
5932
|
+
boxShadow: "0px 8px 16px rgba(0, 0, 0, 0.12)",
|
|
5933
|
+
borderRadius: "8px",
|
|
5934
|
+
backgroundColor: colorTokens.neutral0
|
|
5935
|
+
},
|
|
5936
|
+
children: items.map((item) => /* @__PURE__ */ jsx(
|
|
5937
|
+
Menu_default,
|
|
5938
|
+
{
|
|
5939
|
+
isSelected: value === item.value,
|
|
5940
|
+
onClick: () => {
|
|
5941
|
+
if (disabled) {
|
|
5942
|
+
return;
|
|
5943
|
+
}
|
|
5944
|
+
onSelect == null ? void 0 : onSelect(item.value);
|
|
5945
|
+
setIsOpen(false);
|
|
5946
|
+
},
|
|
5947
|
+
children: /* @__PURE__ */ jsx(Text_default, { typography: "body1_400", children: item.label })
|
|
5948
|
+
},
|
|
5949
|
+
item.value
|
|
5950
|
+
))
|
|
5951
|
+
}
|
|
5952
|
+
) })
|
|
5953
|
+
] }) });
|
|
5954
|
+
};
|
|
5955
|
+
var NumberCombobox_default = NumberCombobox;
|
|
5956
|
+
|
|
5957
|
+
// src/components/Comboboxs/NumberCombobox/NumberCombobox.types.ts
|
|
5958
|
+
var NumberComboboxSizeVariants = {
|
|
5959
|
+
S: "S",
|
|
5960
|
+
M: "M"
|
|
5961
|
+
};
|
|
5754
5962
|
var SpaceMarginWrapper = styled6(motion.div)`
|
|
5755
5963
|
position: relative;
|
|
5756
5964
|
display: flex;
|
|
@@ -5805,6 +6013,6 @@ classnames/index.js:
|
|
|
5805
6013
|
*)
|
|
5806
6014
|
*/
|
|
5807
6015
|
|
|
5808
|
-
export { AnnualDatepicker_default as AnnualDatepicker, Avatar_default as Avatar, AvatarSizeVariants, Button_default as Button, ButtonSizeVariants, ButtonStyleVariants, CHECKBOX_SYMBOL_KEY, Callout_default as Callout, CalloutTypes, Checkbox_default as Checkbox, CheckboxStyleVariants, ChipButton_default as ChipButton, ChipButtonSizeVariants, ChipButtonStyleVariants, ChipToggle_default as ChipToggle, ChipToggleSizeVariants, ChipToggleStyleVariants, DayDatepicker_default as DayDatepicker, DayDatepickerSizeVariants, Dropdown_default as Dropdown, Icon_default as Icon, IconButton_default as IconButton, IconButtonSizeVariants, IconButtonStyleVariants, IconSizeVariants, Input_default as Input, InputButton_default as InputButton, List_default as List, MODAL_FOOTER_KEY, MODAL_HEADER_KEY, Menu_default as Menu, MenuSizeVariants, MinusButton_default as MinusButton, Modal, ModalContext, ModalHandlerContext, ModalPortal_default as ModalProvider, ModalSize, MonthDatepicker_default as MonthDatepicker, MotionStack, MotionStackContainer, Pagination_default as Pagination, Popper_default as Popper, PopperPortal, PopperTrigger, RADIO_SYMBOL_KEY, Radio_default as Radio, ScrollArea_default as ScrollArea, SelectInputButton_default as SelectInputButton, ShoplflowProvider_default as ShoplflowProvider, Stack_default as Stack, StackContainer_default as StackContainer, StyledIcon, StyledStack, StyledStackContainer, Switch_default as Switch, TREE_SYMBOL_KEY, TabSizeVariants, TabStyleVariants, Tabs_default as Tabs, TabsContext, Tag_default as Tag, TagSizeVariants, TagStyleVariants, Text_default as Text, Text2Rows, TextArea_default as TextArea, ToggleButton_default as ToggleButton, ToggleButtonSizeVariants, Tooltip_default as Tooltip, Tree_default as Tree, TreeItem, WeekDatepicker_default as WeekDatepicker, borderRadiusTokens, boxShadowTokens, colorTokens, fontWeightTokens, getDomain, spacingTokens, typographyTokens, useDomain, useHandleModal, useModalValue, useTabs };
|
|
6016
|
+
export { AnnualDatepicker_default as AnnualDatepicker, Avatar_default as Avatar, AvatarSizeVariants, Button_default as Button, ButtonSizeVariants, ButtonStyleVariants, CHECKBOX_SYMBOL_KEY, Callout_default as Callout, CalloutTypes, Checkbox_default as Checkbox, CheckboxStyleVariants, ChipButton_default as ChipButton, ChipButtonSizeVariants, ChipButtonStyleVariants, ChipToggle_default as ChipToggle, ChipToggleSizeVariants, ChipToggleStyleVariants, DayDatepicker_default as DayDatepicker, DayDatepickerSizeVariants, Dropdown_default as Dropdown, Icon_default as Icon, IconButton_default as IconButton, IconButtonSizeVariants, IconButtonStyleVariants, IconSizeVariants, Input_default as Input, InputButton_default as InputButton, InputSizeVariants, List_default as List, MODAL_FOOTER_KEY, MODAL_HEADER_KEY, Menu_default as Menu, MenuSizeVariants, MinusButton_default as MinusButton, Modal, ModalContext, ModalHandlerContext, ModalPortal_default as ModalProvider, ModalSize, MonthDatepicker_default as MonthDatepicker, MotionStack, MotionStackContainer, NumberCombobox_default as NumberCombobox, NumberComboboxSizeVariants, Pagination_default as Pagination, Popper_default as Popper, PopperPortal, PopperTrigger, RADIO_SYMBOL_KEY, Radio_default as Radio, ScrollArea_default as ScrollArea, SelectInputButton_default as SelectInputButton, ShoplflowProvider_default as ShoplflowProvider, Stack_default as Stack, StackContainer_default as StackContainer, StyledIcon, StyledStack, StyledStackContainer, Switch_default as Switch, TREE_SYMBOL_KEY, TabSizeVariants, TabStyleVariants, Tabs_default as Tabs, TabsContext, Tag_default as Tag, TagSizeVariants, TagStyleVariants, Text_default as Text, Text2Rows, TextArea_default as TextArea, ToggleButton_default as ToggleButton, ToggleButtonSizeVariants, Tooltip_default as Tooltip, Tree_default as Tree, TreeItem, WeekDatepicker_default as WeekDatepicker, borderRadiusTokens, boxShadowTokens, colorTokens, fontWeightTokens, getDomain, spacingTokens, typographyTokens, useDomain, useHandleModal, useModalValue, useTabs };
|
|
5809
6017
|
//# sourceMappingURL=out.js.map
|
|
5810
6018
|
//# sourceMappingURL=index.js.map
|