@shoplflow/base 0.17.0 → 0.18.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/dist/index.cjs +319 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +57 -1
- package/dist/index.d.ts +57 -1
- package/dist/index.js +320 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1030,6 +1030,43 @@ declare const DropdownButtonIcon: _emotion_styled.StyledComponent<{
|
|
|
1030
1030
|
theme?: _emotion_react.Theme | undefined;
|
|
1031
1031
|
} & DropdownButtonProps, {}, {}>;
|
|
1032
1032
|
|
|
1033
|
+
interface MenuProps extends MenuOptionProps, HTMLAttributes<HTMLLIElement> {
|
|
1034
|
+
}
|
|
1035
|
+
interface MenuOptionProps extends ChildrenProps, DisableProps, RightElementProps, LeftElementProps, SelectedProps, DefaultSelectedProps {
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
declare const Menu: ({ leftSource, rightSource, children, isSelected, defaultSelected, onClick, disabled, ...rest }: MenuProps) => react_jsx_runtime.JSX.Element;
|
|
1039
|
+
|
|
1040
|
+
declare const StyledMenu: _emotion_styled.StyledComponent<{
|
|
1041
|
+
theme?: _emotion_react.Theme | undefined;
|
|
1042
|
+
as?: React$1.ElementType<any> | undefined;
|
|
1043
|
+
} & MenuOptionProps, React$1.DetailedHTMLProps<React$1.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, {}>;
|
|
1044
|
+
|
|
1045
|
+
interface ListProps extends ListOptionProps {
|
|
1046
|
+
}
|
|
1047
|
+
interface ListOptionProps extends ChildrenProps, DisableProps, SelectedProps, LeftNodeProps, RightNodeProps {
|
|
1048
|
+
}
|
|
1049
|
+
interface ListContent2ColumnsProps extends ChildrenProps {
|
|
1050
|
+
}
|
|
1051
|
+
interface ListText2RowsProps {
|
|
1052
|
+
title: ReactNode;
|
|
1053
|
+
subTitle?: ReactNode;
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
declare const List: {
|
|
1057
|
+
({ children, leftSource, rightSource, ...rest }: ListProps): react_jsx_runtime.JSX.Element;
|
|
1058
|
+
Text2Rows: ({ title, subTitle }: ListText2RowsProps) => react_jsx_runtime.JSX.Element;
|
|
1059
|
+
};
|
|
1060
|
+
|
|
1061
|
+
declare const StyledList: _emotion_styled.StyledComponent<{
|
|
1062
|
+
theme?: _emotion_react.Theme | undefined;
|
|
1063
|
+
as?: React$1.ElementType<any> | undefined;
|
|
1064
|
+
} & ListOptionProps, React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
1065
|
+
declare const StyledText2Rows: _emotion_styled.StyledComponent<{
|
|
1066
|
+
theme?: _emotion_react.Theme | undefined;
|
|
1067
|
+
as?: React$1.ElementType<any> | undefined;
|
|
1068
|
+
}, React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
1069
|
+
|
|
1033
1070
|
declare const IconSizeVariants: {
|
|
1034
1071
|
readonly XS: "XS";
|
|
1035
1072
|
readonly S: "S";
|
|
@@ -1132,4 +1169,23 @@ interface MinusBoxOptionProps {
|
|
|
1132
1169
|
|
|
1133
1170
|
declare const MinusButton: React__default.ForwardRefExoticComponent<MinusBoxProps & React__default.RefAttributes<HTMLButtonElement>>;
|
|
1134
1171
|
|
|
1135
|
-
|
|
1172
|
+
declare const CheckboxStyleVariants: {
|
|
1173
|
+
readonly PRIMARY: "PRIMARY";
|
|
1174
|
+
readonly LINE: "LINE";
|
|
1175
|
+
};
|
|
1176
|
+
declare type CheckboxStyleVariantType = $Values<typeof CheckboxStyleVariants>;
|
|
1177
|
+
interface CheckboxProps extends CheckboxOptionProps {
|
|
1178
|
+
}
|
|
1179
|
+
interface CheckboxOptionProps extends StyleVariantProps<CheckboxStyleVariantType>, SelectedProps, DefaultSelectedProps, DisableProps, HTMLAttributes<HTMLButtonElement> {
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
declare const Checkbox: ({ defaultSelected, isSelected, disabled, onClick, onMouseEnter, onMouseLeave, styleVar, ...rest }: CheckboxProps) => react_jsx_runtime.JSX.Element;
|
|
1183
|
+
|
|
1184
|
+
interface RadioProps extends RadioOptionProps {
|
|
1185
|
+
}
|
|
1186
|
+
interface RadioOptionProps extends SelectedProps, DefaultSelectedProps, DisableProps, HTMLAttributes<HTMLButtonElement> {
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
declare const Radio: ({ isSelected, defaultSelected, disabled, onClick, onMouseEnter, onMouseLeave, ...rest }: RadioProps) => react_jsx_runtime.JSX.Element;
|
|
1190
|
+
|
|
1191
|
+
export { BackDropOptionProps, BackDropProps, BorderRadiusTokens, BoxShadowTokens, Button, ButtonComponent, ButtonOptionProps, ButtonProps, ButtonSizeVar, ButtonStyleVar, 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, Dropdown, DropdownButtonIcon, DropdownButtonProps, DropdownContentProps, DropdownOptionProps, DropdownOptionVar, DropdownProps, DropdownSizeVariantType, FontWeightTokens, Icon, IconButton, IconButtonComponent, IconButtonOptionProps, IconButtonProps, IconButtonSizeVar, IconButtonStyleVar, IconOptionProps, IconProps, IconSizeVariants, IconSizeVariantsType, Input, InputButton, InputButtonOptionProps, InputButtonProps, InputOptionProps, InputProps, List, ListContent2ColumnsProps, ListOptionProps, ListProps, ListText2RowsProps, MODAL_FOOTER_KEY, MODAL_HEADER_KEY, Menu, MenuOptionProps, MenuProps, MinusBoxOptionProps, MinusBoxProps, MinusButton, Modal, ModalBodyOptionProps, ModalBodyProps, ModalContainerOptionProps, ModalContainerProps, ModalFooterOptionProps, ModalFooterProps, ModalFooterType, ModalHeaderOptionProps, ModalHeaderProps, ModalHeaderType, ModalPortal as ModalProvider, ModalSize, ModalSizeType, MotionStack, MotionStackComponentType, Popper, PopperOptionProps, PopperPortal, PopperPortalProps, PopperProps, PopperTrigger, PopperTriggerProps, Radio, RadioOptionProps, RadioProps, ScrollArea, ScrollAreaOptionProps, ScrollAreaProps, ShoplflowProvider, ShoplflowProviderProps, SpacingTokens, Stack, StackComponentType, StackGenericProps, StackOptionProps, StackProps, StyledDropdown, StyledDropdownButton, StyledDropdownContent, StyledIcon, StyledInputButton, StyledInputButtonContent, StyledList, StyledMenu, StyledPopper, StyledStack, StyledText2Rows, Switch, SwitchOptionProps, SwitchProps, Text, TextArea, TextAreaOptionProps, TextAreaProps, TextOptionProps, TextProps, TypographyTokens, borderRadiusTokens, boxShadowTokens, buttonSizeVar, buttonStyleVar, colorTokens, fontWeightTokens, getDomain, getDropdownFontSizeBySizeVar, getDropdownHeightBySizeVar, getDropdownIconSizeBySizeVar, getDropdownStyleBySizeVar, iconButtonSizeVar, iconButtonStyleVar, spacingTokens, typographyTokens, useDomain, useHandleModal, useModalValue };
|
package/dist/index.d.ts
CHANGED
|
@@ -1030,6 +1030,43 @@ declare const DropdownButtonIcon: _emotion_styled.StyledComponent<{
|
|
|
1030
1030
|
theme?: _emotion_react.Theme | undefined;
|
|
1031
1031
|
} & DropdownButtonProps, {}, {}>;
|
|
1032
1032
|
|
|
1033
|
+
interface MenuProps extends MenuOptionProps, HTMLAttributes<HTMLLIElement> {
|
|
1034
|
+
}
|
|
1035
|
+
interface MenuOptionProps extends ChildrenProps, DisableProps, RightElementProps, LeftElementProps, SelectedProps, DefaultSelectedProps {
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
declare const Menu: ({ leftSource, rightSource, children, isSelected, defaultSelected, onClick, disabled, ...rest }: MenuProps) => react_jsx_runtime.JSX.Element;
|
|
1039
|
+
|
|
1040
|
+
declare const StyledMenu: _emotion_styled.StyledComponent<{
|
|
1041
|
+
theme?: _emotion_react.Theme | undefined;
|
|
1042
|
+
as?: React$1.ElementType<any> | undefined;
|
|
1043
|
+
} & MenuOptionProps, React$1.DetailedHTMLProps<React$1.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, {}>;
|
|
1044
|
+
|
|
1045
|
+
interface ListProps extends ListOptionProps {
|
|
1046
|
+
}
|
|
1047
|
+
interface ListOptionProps extends ChildrenProps, DisableProps, SelectedProps, LeftNodeProps, RightNodeProps {
|
|
1048
|
+
}
|
|
1049
|
+
interface ListContent2ColumnsProps extends ChildrenProps {
|
|
1050
|
+
}
|
|
1051
|
+
interface ListText2RowsProps {
|
|
1052
|
+
title: ReactNode;
|
|
1053
|
+
subTitle?: ReactNode;
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
declare const List: {
|
|
1057
|
+
({ children, leftSource, rightSource, ...rest }: ListProps): react_jsx_runtime.JSX.Element;
|
|
1058
|
+
Text2Rows: ({ title, subTitle }: ListText2RowsProps) => react_jsx_runtime.JSX.Element;
|
|
1059
|
+
};
|
|
1060
|
+
|
|
1061
|
+
declare const StyledList: _emotion_styled.StyledComponent<{
|
|
1062
|
+
theme?: _emotion_react.Theme | undefined;
|
|
1063
|
+
as?: React$1.ElementType<any> | undefined;
|
|
1064
|
+
} & ListOptionProps, React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
1065
|
+
declare const StyledText2Rows: _emotion_styled.StyledComponent<{
|
|
1066
|
+
theme?: _emotion_react.Theme | undefined;
|
|
1067
|
+
as?: React$1.ElementType<any> | undefined;
|
|
1068
|
+
}, React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
1069
|
+
|
|
1033
1070
|
declare const IconSizeVariants: {
|
|
1034
1071
|
readonly XS: "XS";
|
|
1035
1072
|
readonly S: "S";
|
|
@@ -1132,4 +1169,23 @@ interface MinusBoxOptionProps {
|
|
|
1132
1169
|
|
|
1133
1170
|
declare const MinusButton: React__default.ForwardRefExoticComponent<MinusBoxProps & React__default.RefAttributes<HTMLButtonElement>>;
|
|
1134
1171
|
|
|
1135
|
-
|
|
1172
|
+
declare const CheckboxStyleVariants: {
|
|
1173
|
+
readonly PRIMARY: "PRIMARY";
|
|
1174
|
+
readonly LINE: "LINE";
|
|
1175
|
+
};
|
|
1176
|
+
declare type CheckboxStyleVariantType = $Values<typeof CheckboxStyleVariants>;
|
|
1177
|
+
interface CheckboxProps extends CheckboxOptionProps {
|
|
1178
|
+
}
|
|
1179
|
+
interface CheckboxOptionProps extends StyleVariantProps<CheckboxStyleVariantType>, SelectedProps, DefaultSelectedProps, DisableProps, HTMLAttributes<HTMLButtonElement> {
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
declare const Checkbox: ({ defaultSelected, isSelected, disabled, onClick, onMouseEnter, onMouseLeave, styleVar, ...rest }: CheckboxProps) => react_jsx_runtime.JSX.Element;
|
|
1183
|
+
|
|
1184
|
+
interface RadioProps extends RadioOptionProps {
|
|
1185
|
+
}
|
|
1186
|
+
interface RadioOptionProps extends SelectedProps, DefaultSelectedProps, DisableProps, HTMLAttributes<HTMLButtonElement> {
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
declare const Radio: ({ isSelected, defaultSelected, disabled, onClick, onMouseEnter, onMouseLeave, ...rest }: RadioProps) => react_jsx_runtime.JSX.Element;
|
|
1190
|
+
|
|
1191
|
+
export { BackDropOptionProps, BackDropProps, BorderRadiusTokens, BoxShadowTokens, Button, ButtonComponent, ButtonOptionProps, ButtonProps, ButtonSizeVar, ButtonStyleVar, 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, Dropdown, DropdownButtonIcon, DropdownButtonProps, DropdownContentProps, DropdownOptionProps, DropdownOptionVar, DropdownProps, DropdownSizeVariantType, FontWeightTokens, Icon, IconButton, IconButtonComponent, IconButtonOptionProps, IconButtonProps, IconButtonSizeVar, IconButtonStyleVar, IconOptionProps, IconProps, IconSizeVariants, IconSizeVariantsType, Input, InputButton, InputButtonOptionProps, InputButtonProps, InputOptionProps, InputProps, List, ListContent2ColumnsProps, ListOptionProps, ListProps, ListText2RowsProps, MODAL_FOOTER_KEY, MODAL_HEADER_KEY, Menu, MenuOptionProps, MenuProps, MinusBoxOptionProps, MinusBoxProps, MinusButton, Modal, ModalBodyOptionProps, ModalBodyProps, ModalContainerOptionProps, ModalContainerProps, ModalFooterOptionProps, ModalFooterProps, ModalFooterType, ModalHeaderOptionProps, ModalHeaderProps, ModalHeaderType, ModalPortal as ModalProvider, ModalSize, ModalSizeType, MotionStack, MotionStackComponentType, Popper, PopperOptionProps, PopperPortal, PopperPortalProps, PopperProps, PopperTrigger, PopperTriggerProps, Radio, RadioOptionProps, RadioProps, ScrollArea, ScrollAreaOptionProps, ScrollAreaProps, ShoplflowProvider, ShoplflowProviderProps, SpacingTokens, Stack, StackComponentType, StackGenericProps, StackOptionProps, StackProps, StyledDropdown, StyledDropdownButton, StyledDropdownContent, StyledIcon, StyledInputButton, StyledInputButtonContent, StyledList, StyledMenu, StyledPopper, StyledStack, StyledText2Rows, Switch, SwitchOptionProps, SwitchProps, Text, TextArea, TextAreaOptionProps, TextAreaProps, TextOptionProps, TextProps, TypographyTokens, borderRadiusTokens, boxShadowTokens, buttonSizeVar, buttonStyleVar, colorTokens, fontWeightTokens, getDomain, getDropdownFontSizeBySizeVar, getDropdownHeightBySizeVar, getDropdownIconSizeBySizeVar, getDropdownStyleBySizeVar, iconButtonSizeVar, iconButtonStyleVar, spacingTokens, typographyTokens, useDomain, useHandleModal, useModalValue };
|
package/dist/index.js
CHANGED
|
@@ -833,10 +833,10 @@ var useOnToggle = (selected, defaultSelected) => {
|
|
|
833
833
|
}
|
|
834
834
|
}, [isControlled, selected]);
|
|
835
835
|
useEffect(() => {
|
|
836
|
-
if (defaultSelected) {
|
|
836
|
+
if (defaultSelected !== void 0) {
|
|
837
837
|
setIsToggle(defaultSelected);
|
|
838
838
|
}
|
|
839
|
-
}, [defaultSelected
|
|
839
|
+
}, [defaultSelected]);
|
|
840
840
|
return [isToggle, handleToggle];
|
|
841
841
|
};
|
|
842
842
|
var Switch = (_a) => {
|
|
@@ -1809,6 +1809,101 @@ var Dropdown = ({
|
|
|
1809
1809
|
Dropdown.Button = DropdownButton;
|
|
1810
1810
|
Dropdown.Content = DropdownContent;
|
|
1811
1811
|
var Dropdown_default = Dropdown;
|
|
1812
|
+
var StyledMenu = styled5.li`
|
|
1813
|
+
display: flex;
|
|
1814
|
+
flex-direction: row;
|
|
1815
|
+
padding: 6px;
|
|
1816
|
+
width: 100%;
|
|
1817
|
+
align-items: center;
|
|
1818
|
+
gap: 4px;
|
|
1819
|
+
cursor: pointer;
|
|
1820
|
+
border-radius: 4px;
|
|
1821
|
+
background: ${colorTokens.neutral0};
|
|
1822
|
+
&:hover {
|
|
1823
|
+
background: ${colorTokens.neutral100};
|
|
1824
|
+
}
|
|
1825
|
+
${({ disabled }) => disabled && getDisabledStyle(disabled)}
|
|
1826
|
+
${({ isSelected, leftSource }) => isSelected && !leftSource && css`
|
|
1827
|
+
background: ${colorTokens.neutral200};
|
|
1828
|
+
&:hover {
|
|
1829
|
+
background: ${colorTokens.neutral200};
|
|
1830
|
+
}
|
|
1831
|
+
`}
|
|
1832
|
+
`;
|
|
1833
|
+
var Menu = (_a) => {
|
|
1834
|
+
var _b = _a, {
|
|
1835
|
+
leftSource,
|
|
1836
|
+
rightSource,
|
|
1837
|
+
children,
|
|
1838
|
+
isSelected,
|
|
1839
|
+
defaultSelected = false,
|
|
1840
|
+
onClick,
|
|
1841
|
+
disabled = false
|
|
1842
|
+
} = _b, rest = __objRest(_b, [
|
|
1843
|
+
"leftSource",
|
|
1844
|
+
"rightSource",
|
|
1845
|
+
"children",
|
|
1846
|
+
"isSelected",
|
|
1847
|
+
"defaultSelected",
|
|
1848
|
+
"onClick",
|
|
1849
|
+
"disabled"
|
|
1850
|
+
]);
|
|
1851
|
+
const [selected, handleToggle] = useOnToggle(isSelected, defaultSelected);
|
|
1852
|
+
const LeftSourceClone = leftSource ? React3__default.cloneElement(leftSource, __spreadProps(__spreadValues({}, rest), {
|
|
1853
|
+
isSelected
|
|
1854
|
+
})) : leftSource;
|
|
1855
|
+
const handleOnClick = (e) => {
|
|
1856
|
+
!disabled && handleToggle();
|
|
1857
|
+
!disabled && onClick && onClick(e);
|
|
1858
|
+
};
|
|
1859
|
+
return /* @__PURE__ */ jsxs(StyledMenu, __spreadProps(__spreadValues({ isSelected: selected, leftSource, onClick: handleOnClick }, rest), { "data-shoplflow": "Menu", children: [
|
|
1860
|
+
leftSource && LeftSourceClone,
|
|
1861
|
+
/* @__PURE__ */ jsx(Stack_default.Horizontal, { width: "100%", align: "center", className: "body1_400", children }),
|
|
1862
|
+
rightSource && rightSource
|
|
1863
|
+
] }));
|
|
1864
|
+
};
|
|
1865
|
+
var Menu_default = Menu;
|
|
1866
|
+
var StyledList = styled5.div`
|
|
1867
|
+
display: flex;
|
|
1868
|
+
flex-direction: row;
|
|
1869
|
+
width: 100%;
|
|
1870
|
+
align-items: center;
|
|
1871
|
+
padding: 6px 8px;
|
|
1872
|
+
gap: 4px;
|
|
1873
|
+
border-radius: 8px;
|
|
1874
|
+
background: ${colorTokens.neutral0};
|
|
1875
|
+
cursor: pointer;
|
|
1876
|
+
${({ disabled }) => disabled && getDisabledStyle(disabled)}
|
|
1877
|
+
&:hover {
|
|
1878
|
+
background: ${colorTokens.neutral100};
|
|
1879
|
+
}
|
|
1880
|
+
`;
|
|
1881
|
+
var StyledText2Rows = styled5.div`
|
|
1882
|
+
display: flex;
|
|
1883
|
+
flex-direction: column;
|
|
1884
|
+
justify-content: center;
|
|
1885
|
+
gap: 2px;
|
|
1886
|
+
`;
|
|
1887
|
+
var List = (_a) => {
|
|
1888
|
+
var _b = _a, { children, leftSource, rightSource } = _b, rest = __objRest(_b, ["children", "leftSource", "rightSource"]);
|
|
1889
|
+
const LeftSourceClone = leftSource ? React3__default.cloneElement(leftSource, __spreadValues({}, rest)) : leftSource;
|
|
1890
|
+
if (!children && rightSource) {
|
|
1891
|
+
throw new Error("RightSource\uB294 children\uC774 \uD544\uC218\uB85C \uD3EC\uD568\uB418\uC5B4\uC57C\uD569\uB2C8\uB2E4.");
|
|
1892
|
+
}
|
|
1893
|
+
return /* @__PURE__ */ jsxs(StyledList, __spreadProps(__spreadValues({ "data-shoplflow": "List" }, rest), { children: [
|
|
1894
|
+
LeftSourceClone && LeftSourceClone,
|
|
1895
|
+
/* @__PURE__ */ jsx(Stack_default.Horizontal, { height: "36px", width: "100%", spacing: "spacing08", align: "center", children }),
|
|
1896
|
+
rightSource && rightSource
|
|
1897
|
+
] }));
|
|
1898
|
+
};
|
|
1899
|
+
var Text2Rows = ({ title, subTitle }) => {
|
|
1900
|
+
return /* @__PURE__ */ jsxs(StyledText2Rows, { children: [
|
|
1901
|
+
/* @__PURE__ */ jsx(Text_default, { typography: "body1_500", color: "neutral700", children: title }),
|
|
1902
|
+
subTitle && /* @__PURE__ */ jsx(Text_default, { typography: "body2_400", color: "neutral400", children: subTitle })
|
|
1903
|
+
] });
|
|
1904
|
+
};
|
|
1905
|
+
List.Text2Rows = Text2Rows;
|
|
1906
|
+
var List_default = List;
|
|
1812
1907
|
var StyledInput = styled5.input`
|
|
1813
1908
|
padding: 4px 0 4px 12px;
|
|
1814
1909
|
background-color: transparent;
|
|
@@ -2272,7 +2367,229 @@ var MinusButton = forwardRef((_a, ref) => {
|
|
|
2272
2367
|
] }) })) });
|
|
2273
2368
|
});
|
|
2274
2369
|
var MinusButton_default = MinusButton;
|
|
2370
|
+
var getStylesByStyleVariant = (styleVariant, isSelected, isHovered) => {
|
|
2371
|
+
switch (styleVariant) {
|
|
2372
|
+
case "PRIMARY":
|
|
2373
|
+
if (isSelected) {
|
|
2374
|
+
return css`
|
|
2375
|
+
background: ${colorTokens.primary300};
|
|
2376
|
+
border: 1.5px solid ${colorTokens.primary300};
|
|
2377
|
+
& > svg > path {
|
|
2378
|
+
fill: ${colorTokens.neutral0};
|
|
2379
|
+
}
|
|
2380
|
+
${isHovered && css`
|
|
2381
|
+
background: ${colorTokens.primary400};
|
|
2382
|
+
`}
|
|
2383
|
+
`;
|
|
2384
|
+
}
|
|
2385
|
+
return css`
|
|
2386
|
+
background: ${colorTokens.neutral200};
|
|
2387
|
+
border: 1.5px solid ${colorTokens.neutral200};
|
|
2388
|
+
border-radius: 4px;
|
|
2389
|
+
${isHovered && css`
|
|
2390
|
+
background: ${colorTokens.neutral300};
|
|
2391
|
+
`}
|
|
2392
|
+
|
|
2393
|
+
& > svg > path {
|
|
2394
|
+
fill: ${colorTokens.neutral0};
|
|
2395
|
+
}
|
|
2396
|
+
`;
|
|
2397
|
+
case "LINE":
|
|
2398
|
+
if (isSelected) {
|
|
2399
|
+
return css`
|
|
2400
|
+
border: 1.5px solid ${colorTokens.primary300};
|
|
2401
|
+
background: transparent;
|
|
2402
|
+
border-radius: 4px;
|
|
2403
|
+
& > svg > path {
|
|
2404
|
+
fill: ${colorTokens.primary300};
|
|
2405
|
+
}
|
|
2406
|
+
${isHovered && css`
|
|
2407
|
+
border: 1.5px solid ${colorTokens.primary400};
|
|
2408
|
+
& > svg > path {
|
|
2409
|
+
fill: ${colorTokens.primary400};
|
|
2410
|
+
}
|
|
2411
|
+
`}
|
|
2412
|
+
`;
|
|
2413
|
+
}
|
|
2414
|
+
return css`
|
|
2415
|
+
background: transparent;
|
|
2416
|
+
border: 1.5px solid ${colorTokens.neutral200};
|
|
2417
|
+
border-radius: 4px;
|
|
2418
|
+
& > svg > path {
|
|
2419
|
+
fill: ${colorTokens.neutral200};
|
|
2420
|
+
}
|
|
2421
|
+
${isHovered && css`
|
|
2422
|
+
border: 1.5px solid ${colorTokens.neutral300};
|
|
2423
|
+
& > svg > path {
|
|
2424
|
+
fill: ${colorTokens.neutral300};
|
|
2425
|
+
}
|
|
2426
|
+
`}
|
|
2427
|
+
`;
|
|
2428
|
+
default:
|
|
2429
|
+
return "";
|
|
2430
|
+
}
|
|
2431
|
+
};
|
|
2432
|
+
var StyledCheckbox = styled5.button`
|
|
2433
|
+
display: flex;
|
|
2434
|
+
align-items: center;
|
|
2435
|
+
justify-content: center;
|
|
2436
|
+
min-width: 16px;
|
|
2437
|
+
min-height: 16px;
|
|
2438
|
+
width: 16px;
|
|
2439
|
+
height: 16px;
|
|
2440
|
+
background: ${colorTokens.neutral200};
|
|
2441
|
+
border-radius: 4px;
|
|
2442
|
+
box-sizing: border-box;
|
|
2443
|
+
cursor: pointer;
|
|
2444
|
+
${({ styleVar, isSelected, isHovered }) => getStylesByStyleVariant(styleVar, isSelected, isHovered)};
|
|
2445
|
+
${({ disabled }) => getDisabledStyle(disabled)}
|
|
2446
|
+
`;
|
|
2447
|
+
var Container3 = styled5.button`
|
|
2448
|
+
display: flex;
|
|
2449
|
+
align-items: center;
|
|
2450
|
+
justify-content: center;
|
|
2451
|
+
padding: 4px;
|
|
2452
|
+
width: fit-content;
|
|
2453
|
+
height: fit-content;
|
|
2454
|
+
`;
|
|
2455
|
+
var Checkbox = (_a) => {
|
|
2456
|
+
var _b = _a, {
|
|
2457
|
+
defaultSelected,
|
|
2458
|
+
isSelected,
|
|
2459
|
+
disabled,
|
|
2460
|
+
onClick,
|
|
2461
|
+
onMouseEnter,
|
|
2462
|
+
onMouseLeave,
|
|
2463
|
+
styleVar = "PRIMARY"
|
|
2464
|
+
} = _b, rest = __objRest(_b, [
|
|
2465
|
+
"defaultSelected",
|
|
2466
|
+
"isSelected",
|
|
2467
|
+
"disabled",
|
|
2468
|
+
"onClick",
|
|
2469
|
+
"onMouseEnter",
|
|
2470
|
+
"onMouseLeave",
|
|
2471
|
+
"styleVar"
|
|
2472
|
+
]);
|
|
2473
|
+
const [selected, toggleSelected] = useOnToggle(isSelected, defaultSelected);
|
|
2474
|
+
const [isHovered, toggleHovered] = useState(false);
|
|
2475
|
+
const handleMouseLeave = (e) => {
|
|
2476
|
+
toggleHovered(false);
|
|
2477
|
+
onMouseLeave && onMouseLeave(e);
|
|
2478
|
+
};
|
|
2479
|
+
const handleMouseEnter = (e) => {
|
|
2480
|
+
toggleHovered(true);
|
|
2481
|
+
onMouseEnter && onMouseEnter(e);
|
|
2482
|
+
};
|
|
2483
|
+
const handleClick = (e) => {
|
|
2484
|
+
if (disabled) {
|
|
2485
|
+
return;
|
|
2486
|
+
}
|
|
2487
|
+
onClick && onClick(e);
|
|
2488
|
+
toggleSelected();
|
|
2489
|
+
};
|
|
2490
|
+
return /* @__PURE__ */ jsx(
|
|
2491
|
+
Container3,
|
|
2492
|
+
__spreadProps(__spreadValues({
|
|
2493
|
+
onClick: handleClick,
|
|
2494
|
+
onMouseLeave: handleMouseLeave,
|
|
2495
|
+
onMouseEnter: handleMouseEnter,
|
|
2496
|
+
disabled
|
|
2497
|
+
}, rest), {
|
|
2498
|
+
"data-shoplflow": "Checkbox",
|
|
2499
|
+
children: /* @__PURE__ */ jsx(StyledCheckbox, { styleVar, isHovered, isSelected: selected, disabled, children: /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "8", viewBox: "0 0 12 8", fill: "none", children: /* @__PURE__ */ jsx(
|
|
2500
|
+
"path",
|
|
2501
|
+
{
|
|
2502
|
+
fillRule: "evenodd",
|
|
2503
|
+
clipRule: "evenodd",
|
|
2504
|
+
d: "M9.78822 0.297596C10.1761 -0.0955083 10.8093 -0.0997053 11.2024 0.288222C11.5653 0.646308 11.5968 1.21334 11.2943 1.60765L11.2118 1.7024L5.31714 7.7024C4.95248 8.07193 4.37282 8.09687 3.97909 7.77976L3.88476 7.69335L0.779404 4.42669C0.396475 4.02871 0.408672 3.39567 0.806647 3.01274C1.17401 2.65926 1.74167 2.64247 2.12801 2.95499L2.2206 3.03998L4.614 5.567L9.78822 0.297596Z",
|
|
2505
|
+
fill: "white"
|
|
2506
|
+
}
|
|
2507
|
+
) }) })
|
|
2508
|
+
})
|
|
2509
|
+
);
|
|
2510
|
+
};
|
|
2511
|
+
var Checkbox_default = Checkbox;
|
|
2512
|
+
|
|
2513
|
+
// src/components/ControlButtons/Checkbox/Checkbox.types.ts
|
|
2514
|
+
var CheckboxStyleVariants = {
|
|
2515
|
+
PRIMARY: "PRIMARY",
|
|
2516
|
+
LINE: "LINE"
|
|
2517
|
+
};
|
|
2518
|
+
var getSelectedStyle = (isHovered) => {
|
|
2519
|
+
return css`
|
|
2520
|
+
& > svg > circle {
|
|
2521
|
+
stroke: ${colorTokens.primary300};
|
|
2522
|
+
}
|
|
2523
|
+
${isHovered && css`
|
|
2524
|
+
& > svg > circle {
|
|
2525
|
+
stroke: ${colorTokens.primary400};
|
|
2526
|
+
}
|
|
2527
|
+
`}
|
|
2528
|
+
`;
|
|
2529
|
+
};
|
|
2530
|
+
var StyledRadio = styled5.div`
|
|
2531
|
+
display: flex;
|
|
2532
|
+
align-items: center;
|
|
2533
|
+
justify-content: center;
|
|
2534
|
+
min-width: 16px;
|
|
2535
|
+
min-height: 16px;
|
|
2536
|
+
width: 16px;
|
|
2537
|
+
height: 16px;
|
|
2538
|
+
${({ isHovered }) => css`
|
|
2539
|
+
& > svg > circle {
|
|
2540
|
+
stroke: ${colorTokens.neutral200};
|
|
2541
|
+
}
|
|
2542
|
+
${isHovered && css`
|
|
2543
|
+
& > svg > circle {
|
|
2544
|
+
stroke: ${colorTokens.neutral300};
|
|
2545
|
+
}
|
|
2546
|
+
`}
|
|
2547
|
+
`}
|
|
2548
|
+
cursor: pointer;
|
|
2549
|
+
${({ isSelected, isHovered }) => isSelected && getSelectedStyle(isHovered)}
|
|
2550
|
+
${({ disabled }) => getDisabledStyle(disabled)}
|
|
2551
|
+
`;
|
|
2552
|
+
var Container4 = styled5.button`
|
|
2553
|
+
display: flex;
|
|
2554
|
+
align-items: center;
|
|
2555
|
+
justify-content: center;
|
|
2556
|
+
padding: 4px;
|
|
2557
|
+
width: fit-content;
|
|
2558
|
+
height: fit-content;
|
|
2559
|
+
`;
|
|
2560
|
+
var Radio = (_a) => {
|
|
2561
|
+
var _b = _a, { isSelected, defaultSelected, disabled, onClick, onMouseEnter, onMouseLeave } = _b, rest = __objRest(_b, ["isSelected", "defaultSelected", "disabled", "onClick", "onMouseEnter", "onMouseLeave"]);
|
|
2562
|
+
const [selected, toggleSelected] = useOnToggle(isSelected, defaultSelected);
|
|
2563
|
+
const [isHovered, toggleHovered] = useState(false);
|
|
2564
|
+
const handleMouseLeave = (e) => {
|
|
2565
|
+
toggleHovered(false);
|
|
2566
|
+
onMouseLeave && onMouseLeave(e);
|
|
2567
|
+
};
|
|
2568
|
+
const handleMouseEnter = (e) => {
|
|
2569
|
+
toggleHovered(true);
|
|
2570
|
+
onMouseEnter && onMouseEnter(e);
|
|
2571
|
+
};
|
|
2572
|
+
const handleClick = (e) => {
|
|
2573
|
+
if (disabled) {
|
|
2574
|
+
return;
|
|
2575
|
+
}
|
|
2576
|
+
onClick && onClick(e);
|
|
2577
|
+
toggleSelected();
|
|
2578
|
+
};
|
|
2579
|
+
return /* @__PURE__ */ jsx(
|
|
2580
|
+
Container4,
|
|
2581
|
+
__spreadProps(__spreadValues({
|
|
2582
|
+
onClick: handleClick,
|
|
2583
|
+
onMouseEnter: handleMouseEnter,
|
|
2584
|
+
onMouseLeave: handleMouseLeave
|
|
2585
|
+
}, rest), {
|
|
2586
|
+
"data-shoplflow": "Radio",
|
|
2587
|
+
children: /* @__PURE__ */ jsx(StyledRadio, { isSelected: selected, isHovered, disabled, children: /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ jsx("circle", { cx: "8", cy: "8", r: "5.5", fill: "white", stroke: "#3299FE", strokeWidth: "5" }) }) })
|
|
2588
|
+
})
|
|
2589
|
+
);
|
|
2590
|
+
};
|
|
2591
|
+
var Radio_default = Radio;
|
|
2275
2592
|
|
|
2276
|
-
export { Button_default as Button, Callout_default as Callout, CalloutTypes, ChipButton_default as ChipButton, ChipButtonSizeVariants, ChipButtonStyleVariants, ChipToggle_default as ChipToggle, ChipToggleSizeVariants, ChipToggleStyleVariants, Dropdown_default as Dropdown, DropdownButtonIcon, Icon_default as Icon, IconButton_default as IconButton, IconSizeVariants, Input_default as Input, InputButton_default as InputButton, MODAL_FOOTER_KEY, MODAL_HEADER_KEY, MinusButton_default as MinusButton, Modal, ModalPortal_default as ModalProvider, ModalSize, MotionStack, Popper_default as Popper, PopperPortal2 as PopperPortal, PopperTrigger, ScrollArea_default as ScrollArea, ShoplflowProvider_default as ShoplflowProvider, Stack_default as Stack, StyledDropdown, StyledDropdownButton, StyledDropdownContent, StyledIcon, StyledInputButton, StyledInputButtonContent, StyledPopper, StyledStack, Switch_default as Switch, Text_default as Text, TextArea_default as TextArea, borderRadiusTokens, boxShadowTokens, buttonSizeVar, buttonStyleVar, colorTokens, fontWeightTokens, getDomain, getDropdownFontSizeBySizeVar, getDropdownHeightBySizeVar, getDropdownIconSizeBySizeVar, getDropdownStyleBySizeVar, iconButtonSizeVar, iconButtonStyleVar, spacingTokens, typographyTokens, useDomain, useHandleModal, useModalValue };
|
|
2593
|
+
export { Button_default as Button, Callout_default as Callout, CalloutTypes, Checkbox_default as Checkbox, CheckboxStyleVariants, ChipButton_default as ChipButton, ChipButtonSizeVariants, ChipButtonStyleVariants, ChipToggle_default as ChipToggle, ChipToggleSizeVariants, ChipToggleStyleVariants, Dropdown_default as Dropdown, DropdownButtonIcon, Icon_default as Icon, IconButton_default as IconButton, IconSizeVariants, Input_default as Input, InputButton_default as InputButton, List_default as List, MODAL_FOOTER_KEY, MODAL_HEADER_KEY, Menu_default as Menu, MinusButton_default as MinusButton, Modal, ModalPortal_default as ModalProvider, ModalSize, MotionStack, Popper_default as Popper, PopperPortal2 as PopperPortal, PopperTrigger, Radio_default as Radio, ScrollArea_default as ScrollArea, ShoplflowProvider_default as ShoplflowProvider, Stack_default as Stack, StyledDropdown, StyledDropdownButton, StyledDropdownContent, StyledIcon, StyledInputButton, StyledInputButtonContent, StyledList, StyledMenu, StyledPopper, StyledStack, StyledText2Rows, Switch_default as Switch, Text_default as Text, TextArea_default as TextArea, borderRadiusTokens, boxShadowTokens, buttonSizeVar, buttonStyleVar, colorTokens, fontWeightTokens, getDomain, getDropdownFontSizeBySizeVar, getDropdownHeightBySizeVar, getDropdownIconSizeBySizeVar, getDropdownStyleBySizeVar, iconButtonSizeVar, iconButtonStyleVar, spacingTokens, typographyTokens, useDomain, useHandleModal, useModalValue };
|
|
2277
2594
|
//# sourceMappingURL=out.js.map
|
|
2278
2595
|
//# sourceMappingURL=index.js.map
|