@shoplflow/base 0.13.7 → 0.13.8
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 +88 -84
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +24 -24
- package/dist/index.d.ts +24 -24
- package/dist/index.js +88 -84
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -484,7 +484,7 @@ declare const buttonStyleVar: {
|
|
|
484
484
|
readonly GHOST: "GHOST";
|
|
485
485
|
};
|
|
486
486
|
declare type ButtonStyleVar = $Values<typeof buttonStyleVar>;
|
|
487
|
-
declare type ButtonOptionProps<T extends ElementType = 'button'> = Omit<ComponentPropsWithoutRef<T>, 'color' | 'disabled'> & SizeVariantProps<ButtonSizeVar> & StyleVariantProps<ButtonStyleVar> & DisableProps & {
|
|
487
|
+
declare type ButtonOptionProps<T extends ElementType = 'button'> = Omit<ComponentPropsWithoutRef<T>, 'color' | 'disabled'> & SizeVariantProps<ButtonSizeVar> & StyleVariantProps<ButtonStyleVar> & ColorTokenProps & DisableProps & {
|
|
488
488
|
typography?: TypographyTokens;
|
|
489
489
|
};
|
|
490
490
|
declare type ButtonProps<T extends ElementType = 'button'> = PolymorphicComponentProps<T, ButtonOptionProps> & LeftAndRightNodeProps;
|
|
@@ -494,39 +494,19 @@ declare type ButtonComponent = <T extends ElementType = 'button'>(props: ButtonP
|
|
|
494
494
|
|
|
495
495
|
declare const Button: ButtonComponent;
|
|
496
496
|
|
|
497
|
-
declare const IconSizeVariants: {
|
|
498
|
-
readonly XS: "XS";
|
|
499
|
-
readonly S: "S";
|
|
500
|
-
readonly M: "M";
|
|
501
|
-
readonly L: "L";
|
|
502
|
-
readonly XL: "XL";
|
|
503
|
-
};
|
|
504
|
-
declare type IconSizeVariantsType = $Values<typeof IconSizeVariants>;
|
|
505
|
-
interface IconProps extends IconOptionProps {
|
|
506
|
-
}
|
|
507
|
-
interface IconOptionProps extends SizeVariantProps<IconSizeVariantsType>, IconSourceProps, ColorTokenProps {
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
declare const Icon: React__default.ForwardRefExoticComponent<IconProps & React__default.RefAttributes<SVGSVGElement>>;
|
|
511
|
-
|
|
512
|
-
declare const StyledIcon: _emotion_styled.StyledComponent<{
|
|
513
|
-
theme?: _emotion_react.Theme | undefined;
|
|
514
|
-
as?: React$1.ElementType<any> | undefined;
|
|
515
|
-
} & IconOptionProps, React$1.SVGProps<SVGSVGElement>, {}>;
|
|
516
|
-
|
|
517
497
|
declare const iconButtonSizeVar: {
|
|
518
498
|
readonly S: "S";
|
|
519
499
|
readonly M: "M";
|
|
520
500
|
};
|
|
521
501
|
declare type IconButtonSizeVar = $Values<typeof iconButtonSizeVar>;
|
|
522
502
|
declare const iconButtonStyleVar: {
|
|
503
|
+
readonly PRIMARY: "PRIMARY";
|
|
504
|
+
readonly SECONDARY: "SECONDARY";
|
|
523
505
|
readonly SOLID: "SOLID";
|
|
524
506
|
readonly GHOST: "GHOST";
|
|
525
507
|
};
|
|
526
508
|
declare type IconButtonStyleVar = $Values<typeof iconButtonStyleVar>;
|
|
527
|
-
declare type IconButtonOptionProps<T extends ElementType = 'button'> = Omit<ComponentPropsWithoutRef<T>, 'color' | 'disabled'> & DisableProps & SizeVariantProps<IconButtonSizeVar> & StyleVariantProps<IconButtonStyleVar> &
|
|
528
|
-
iconSize?: IconSizeVariantsType;
|
|
529
|
-
};
|
|
509
|
+
declare type IconButtonOptionProps<T extends ElementType = 'button'> = Omit<ComponentPropsWithoutRef<T>, 'color' | 'disabled'> & DisableProps & SizeVariantProps<IconButtonSizeVar> & StyleVariantProps<IconButtonStyleVar> & ChildrenProps & ColorTokenProps;
|
|
530
510
|
declare type IconButtonProps<T extends ElementType = 'button'> = PolymorphicComponentProps<T, IconButtonOptionProps>;
|
|
531
511
|
declare type IconButtonComponent = <T extends ElementType = 'button'>(props: IconButtonProps<T> & {
|
|
532
512
|
ref?: ComponentPropsWithRef<T>['ref'];
|
|
@@ -961,6 +941,26 @@ declare const DropdownButtonIcon: _emotion_styled.StyledComponent<{
|
|
|
961
941
|
theme?: _emotion_react.Theme | undefined;
|
|
962
942
|
} & DropdownButtonProps, {}, {}>;
|
|
963
943
|
|
|
944
|
+
declare const IconSizeVariants: {
|
|
945
|
+
readonly XS: "XS";
|
|
946
|
+
readonly S: "S";
|
|
947
|
+
readonly M: "M";
|
|
948
|
+
readonly L: "L";
|
|
949
|
+
readonly XL: "XL";
|
|
950
|
+
};
|
|
951
|
+
declare type IconSizeVariantsType = $Values<typeof IconSizeVariants>;
|
|
952
|
+
interface IconProps extends IconOptionProps {
|
|
953
|
+
}
|
|
954
|
+
interface IconOptionProps extends SizeVariantProps<IconSizeVariantsType>, IconSourceProps, ColorTokenProps {
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
declare const Icon: React__default.ForwardRefExoticComponent<IconProps & React__default.RefAttributes<SVGSVGElement>>;
|
|
958
|
+
|
|
959
|
+
declare const StyledIcon: _emotion_styled.StyledComponent<{
|
|
960
|
+
theme?: _emotion_react.Theme | undefined;
|
|
961
|
+
as?: React$1.ElementType<any> | undefined;
|
|
962
|
+
} & IconOptionProps, React$1.SVGProps<SVGSVGElement>, {}>;
|
|
963
|
+
|
|
964
964
|
interface InputProps extends InputOptionProps, Omit<InputHTMLAttributes<HTMLInputElement>, 'width'>, DisableProps, RightElementProps {
|
|
965
965
|
}
|
|
966
966
|
interface InputOptionProps extends ErrorProps {
|
package/dist/index.d.ts
CHANGED
|
@@ -484,7 +484,7 @@ declare const buttonStyleVar: {
|
|
|
484
484
|
readonly GHOST: "GHOST";
|
|
485
485
|
};
|
|
486
486
|
declare type ButtonStyleVar = $Values<typeof buttonStyleVar>;
|
|
487
|
-
declare type ButtonOptionProps<T extends ElementType = 'button'> = Omit<ComponentPropsWithoutRef<T>, 'color' | 'disabled'> & SizeVariantProps<ButtonSizeVar> & StyleVariantProps<ButtonStyleVar> & DisableProps & {
|
|
487
|
+
declare type ButtonOptionProps<T extends ElementType = 'button'> = Omit<ComponentPropsWithoutRef<T>, 'color' | 'disabled'> & SizeVariantProps<ButtonSizeVar> & StyleVariantProps<ButtonStyleVar> & ColorTokenProps & DisableProps & {
|
|
488
488
|
typography?: TypographyTokens;
|
|
489
489
|
};
|
|
490
490
|
declare type ButtonProps<T extends ElementType = 'button'> = PolymorphicComponentProps<T, ButtonOptionProps> & LeftAndRightNodeProps;
|
|
@@ -494,39 +494,19 @@ declare type ButtonComponent = <T extends ElementType = 'button'>(props: ButtonP
|
|
|
494
494
|
|
|
495
495
|
declare const Button: ButtonComponent;
|
|
496
496
|
|
|
497
|
-
declare const IconSizeVariants: {
|
|
498
|
-
readonly XS: "XS";
|
|
499
|
-
readonly S: "S";
|
|
500
|
-
readonly M: "M";
|
|
501
|
-
readonly L: "L";
|
|
502
|
-
readonly XL: "XL";
|
|
503
|
-
};
|
|
504
|
-
declare type IconSizeVariantsType = $Values<typeof IconSizeVariants>;
|
|
505
|
-
interface IconProps extends IconOptionProps {
|
|
506
|
-
}
|
|
507
|
-
interface IconOptionProps extends SizeVariantProps<IconSizeVariantsType>, IconSourceProps, ColorTokenProps {
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
declare const Icon: React__default.ForwardRefExoticComponent<IconProps & React__default.RefAttributes<SVGSVGElement>>;
|
|
511
|
-
|
|
512
|
-
declare const StyledIcon: _emotion_styled.StyledComponent<{
|
|
513
|
-
theme?: _emotion_react.Theme | undefined;
|
|
514
|
-
as?: React$1.ElementType<any> | undefined;
|
|
515
|
-
} & IconOptionProps, React$1.SVGProps<SVGSVGElement>, {}>;
|
|
516
|
-
|
|
517
497
|
declare const iconButtonSizeVar: {
|
|
518
498
|
readonly S: "S";
|
|
519
499
|
readonly M: "M";
|
|
520
500
|
};
|
|
521
501
|
declare type IconButtonSizeVar = $Values<typeof iconButtonSizeVar>;
|
|
522
502
|
declare const iconButtonStyleVar: {
|
|
503
|
+
readonly PRIMARY: "PRIMARY";
|
|
504
|
+
readonly SECONDARY: "SECONDARY";
|
|
523
505
|
readonly SOLID: "SOLID";
|
|
524
506
|
readonly GHOST: "GHOST";
|
|
525
507
|
};
|
|
526
508
|
declare type IconButtonStyleVar = $Values<typeof iconButtonStyleVar>;
|
|
527
|
-
declare type IconButtonOptionProps<T extends ElementType = 'button'> = Omit<ComponentPropsWithoutRef<T>, 'color' | 'disabled'> & DisableProps & SizeVariantProps<IconButtonSizeVar> & StyleVariantProps<IconButtonStyleVar> &
|
|
528
|
-
iconSize?: IconSizeVariantsType;
|
|
529
|
-
};
|
|
509
|
+
declare type IconButtonOptionProps<T extends ElementType = 'button'> = Omit<ComponentPropsWithoutRef<T>, 'color' | 'disabled'> & DisableProps & SizeVariantProps<IconButtonSizeVar> & StyleVariantProps<IconButtonStyleVar> & ChildrenProps & ColorTokenProps;
|
|
530
510
|
declare type IconButtonProps<T extends ElementType = 'button'> = PolymorphicComponentProps<T, IconButtonOptionProps>;
|
|
531
511
|
declare type IconButtonComponent = <T extends ElementType = 'button'>(props: IconButtonProps<T> & {
|
|
532
512
|
ref?: ComponentPropsWithRef<T>['ref'];
|
|
@@ -961,6 +941,26 @@ declare const DropdownButtonIcon: _emotion_styled.StyledComponent<{
|
|
|
961
941
|
theme?: _emotion_react.Theme | undefined;
|
|
962
942
|
} & DropdownButtonProps, {}, {}>;
|
|
963
943
|
|
|
944
|
+
declare const IconSizeVariants: {
|
|
945
|
+
readonly XS: "XS";
|
|
946
|
+
readonly S: "S";
|
|
947
|
+
readonly M: "M";
|
|
948
|
+
readonly L: "L";
|
|
949
|
+
readonly XL: "XL";
|
|
950
|
+
};
|
|
951
|
+
declare type IconSizeVariantsType = $Values<typeof IconSizeVariants>;
|
|
952
|
+
interface IconProps extends IconOptionProps {
|
|
953
|
+
}
|
|
954
|
+
interface IconOptionProps extends SizeVariantProps<IconSizeVariantsType>, IconSourceProps, ColorTokenProps {
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
declare const Icon: React__default.ForwardRefExoticComponent<IconProps & React__default.RefAttributes<SVGSVGElement>>;
|
|
958
|
+
|
|
959
|
+
declare const StyledIcon: _emotion_styled.StyledComponent<{
|
|
960
|
+
theme?: _emotion_react.Theme | undefined;
|
|
961
|
+
as?: React$1.ElementType<any> | undefined;
|
|
962
|
+
} & IconOptionProps, React$1.SVGProps<SVGSVGElement>, {}>;
|
|
963
|
+
|
|
964
964
|
interface InputProps extends InputOptionProps, Omit<InputHTMLAttributes<HTMLInputElement>, 'width'>, DisableProps, RightElementProps {
|
|
965
965
|
}
|
|
966
966
|
interface InputOptionProps extends ErrorProps {
|
package/dist/index.js
CHANGED
|
@@ -1084,7 +1084,7 @@ var ChipButton = (_a) => {
|
|
|
1084
1084
|
);
|
|
1085
1085
|
};
|
|
1086
1086
|
var ChipButton_default = ChipButton;
|
|
1087
|
-
var getStyleByStyleVar = (styleVar, disabled) => {
|
|
1087
|
+
var getStyleByStyleVar = (styleVar, color, disabled) => {
|
|
1088
1088
|
switch (styleVar) {
|
|
1089
1089
|
case "PRIMARY":
|
|
1090
1090
|
return css`
|
|
@@ -1103,11 +1103,14 @@ var getStyleByStyleVar = (styleVar, disabled) => {
|
|
|
1103
1103
|
}
|
|
1104
1104
|
`;
|
|
1105
1105
|
case "SOLID":
|
|
1106
|
+
if (!color) {
|
|
1107
|
+
throw new Error("Button\uC758 SOLID \uC18D\uC131\uC740 color\uB97C \uD544\uC218\uB85C \uBC1B\uC2B5\uB2C8\uB2E4.");
|
|
1108
|
+
}
|
|
1106
1109
|
return css`
|
|
1107
|
-
border: 1px solid ${colorTokens
|
|
1108
|
-
background-color: ${colorTokens
|
|
1110
|
+
border: 1px solid ${colorTokens[getNextColor(color)]};
|
|
1111
|
+
background-color: ${colorTokens[color]};
|
|
1109
1112
|
:hover {
|
|
1110
|
-
background-color: ${
|
|
1113
|
+
background-color: ${colorTokens[getNextColor(color)]};
|
|
1111
1114
|
}
|
|
1112
1115
|
`;
|
|
1113
1116
|
case "GHOST":
|
|
@@ -1154,7 +1157,7 @@ var StyledButton = styled5.button`
|
|
|
1154
1157
|
padding: 0 12px;
|
|
1155
1158
|
border-radius: 6px;
|
|
1156
1159
|
cursor: pointer;
|
|
1157
|
-
${({ styleVar, disabled }) => getStyleByStyleVar(styleVar, disabled)};
|
|
1160
|
+
${({ styleVar, color, disabled }) => getStyleByStyleVar(styleVar, color, disabled)};
|
|
1158
1161
|
${({ sizeVar }) => getStyleBySizeVar2(sizeVar)};
|
|
1159
1162
|
${({ disabled }) => getDisabledStyle(disabled)};
|
|
1160
1163
|
`;
|
|
@@ -1247,27 +1250,47 @@ var getWidthAndHeightFromSizeVar = (sizeVar) => {
|
|
|
1247
1250
|
`;
|
|
1248
1251
|
}
|
|
1249
1252
|
};
|
|
1250
|
-
var getStyleByStyleVar2 = (styleVar) => {
|
|
1253
|
+
var getStyleByStyleVar2 = (styleVar, color) => {
|
|
1251
1254
|
switch (styleVar) {
|
|
1255
|
+
case "PRIMARY":
|
|
1256
|
+
return css`
|
|
1257
|
+
background: ${colorTokens.primary300};
|
|
1258
|
+
border: 1px solid ${colorTokens.primary400};
|
|
1259
|
+
&:hover {
|
|
1260
|
+
background: ${colorTokens.primary400};
|
|
1261
|
+
}
|
|
1262
|
+
`;
|
|
1263
|
+
case "SECONDARY":
|
|
1264
|
+
return css`
|
|
1265
|
+
background: ${colorTokens.neutral0};
|
|
1266
|
+
border: 1px solid ${colorTokens.neutral350};
|
|
1267
|
+
&:hover {
|
|
1268
|
+
background: ${colorTokens.neutral100};
|
|
1269
|
+
}
|
|
1270
|
+
`;
|
|
1252
1271
|
case "SOLID":
|
|
1272
|
+
if (!color) {
|
|
1273
|
+
throw new Error("IconButton\uC758 SOLID \uC18D\uC131\uC740 color\uB97C \uD544\uC218\uB85C \uBC1B\uC2B5\uB2C8\uB2E4.");
|
|
1274
|
+
}
|
|
1253
1275
|
return css`
|
|
1254
|
-
border: 1px solid ${colorTokens
|
|
1276
|
+
border: 1px solid ${colorTokens[getNextColor(color)]};
|
|
1277
|
+
background: ${colorTokens[color]};
|
|
1255
1278
|
&:hover {
|
|
1256
|
-
background
|
|
1279
|
+
background: ${colorTokens[getNextColor(color)]};
|
|
1257
1280
|
}
|
|
1258
1281
|
`;
|
|
1259
1282
|
case "GHOST":
|
|
1260
1283
|
return css`
|
|
1261
1284
|
border: 1px solid transparent;
|
|
1262
1285
|
&:hover {
|
|
1263
|
-
background
|
|
1286
|
+
background: ${colorTokens.neutral400_5};
|
|
1264
1287
|
}
|
|
1265
1288
|
`;
|
|
1266
1289
|
default:
|
|
1267
1290
|
return css`
|
|
1268
1291
|
border: 1px solid ${colorTokens.neutral200};
|
|
1269
1292
|
&:hover {
|
|
1270
|
-
background
|
|
1293
|
+
background: ${colorTokens.neutral100};
|
|
1271
1294
|
}
|
|
1272
1295
|
`;
|
|
1273
1296
|
}
|
|
@@ -1278,9 +1301,9 @@ var StyledIconButton = styled5.button`
|
|
|
1278
1301
|
border-radius: ${borderRadiusTokens.borderRadius06};
|
|
1279
1302
|
justify-content: center;
|
|
1280
1303
|
align-items: center;
|
|
1281
|
-
background
|
|
1304
|
+
background: ${colorTokens.neutral0};
|
|
1282
1305
|
cursor: pointer;
|
|
1283
|
-
${({ styleVar }) => getStyleByStyleVar2(styleVar)};
|
|
1306
|
+
${({ styleVar, color }) => getStyleByStyleVar2(styleVar, color)};
|
|
1284
1307
|
${({ sizeVar }) => getWidthAndHeightFromSizeVar(sizeVar)};
|
|
1285
1308
|
${({ disabled }) => getDisabledStyle(disabled)};
|
|
1286
1309
|
& > svg {
|
|
@@ -1288,62 +1311,20 @@ var StyledIconButton = styled5.button`
|
|
|
1288
1311
|
height: 20px;
|
|
1289
1312
|
}
|
|
1290
1313
|
`;
|
|
1291
|
-
|
|
1292
|
-
// src/components/Icon/Icon.types.ts
|
|
1293
|
-
var IconSizeVariants = {
|
|
1294
|
-
XS: "XS",
|
|
1295
|
-
S: "S",
|
|
1296
|
-
M: "M",
|
|
1297
|
-
L: "L",
|
|
1298
|
-
XL: "XL"
|
|
1299
|
-
};
|
|
1300
|
-
|
|
1301
|
-
// src/components/Icon/Icon.styled.ts
|
|
1302
|
-
var getIconSize = (size) => {
|
|
1303
|
-
switch (size) {
|
|
1304
|
-
case IconSizeVariants.XS:
|
|
1305
|
-
return "12px";
|
|
1306
|
-
case IconSizeVariants.S:
|
|
1307
|
-
return "20px";
|
|
1308
|
-
case IconSizeVariants.M:
|
|
1309
|
-
return "24px";
|
|
1310
|
-
case IconSizeVariants.L:
|
|
1311
|
-
return "30px";
|
|
1312
|
-
case IconSizeVariants.XL:
|
|
1313
|
-
return "36px";
|
|
1314
|
-
default:
|
|
1315
|
-
return "24px";
|
|
1316
|
-
}
|
|
1317
|
-
};
|
|
1318
|
-
var StyledIcon = styled5.svg`
|
|
1319
|
-
width: ${({ sizeVar }) => sizeVar && getIconSize(sizeVar)};
|
|
1320
|
-
min-width: ${({ sizeVar }) => sizeVar && getIconSize(sizeVar)};
|
|
1321
|
-
height: ${({ sizeVar }) => sizeVar && getIconSize(sizeVar)};
|
|
1322
|
-
min-height: ${({ sizeVar }) => sizeVar && getIconSize(sizeVar)};
|
|
1323
|
-
|
|
1324
|
-
& > path {
|
|
1325
|
-
fill: ${({ color }) => color && colorTokens[color]};
|
|
1326
|
-
}
|
|
1327
|
-
`;
|
|
1328
|
-
var Icon = forwardRef((_a, ref) => {
|
|
1329
|
-
var _b = _a, { iconSource } = _b, rest = __objRest(_b, ["iconSource"]);
|
|
1330
|
-
return /* @__PURE__ */ jsx(StyledIcon, __spreadProps(__spreadValues({ as: iconSource, ref }, rest), { "data-shoplflow": "Icon" }));
|
|
1331
|
-
});
|
|
1332
|
-
var Icon_default = Icon;
|
|
1333
1314
|
var IconButton = forwardRef(
|
|
1334
1315
|
(_a, ref) => {
|
|
1335
|
-
var _b = _a, { styleVar, sizeVar, disabled,
|
|
1316
|
+
var _b = _a, { styleVar, sizeVar, disabled, children, color } = _b, rest = __objRest(_b, ["styleVar", "sizeVar", "disabled", "children", "color"]);
|
|
1336
1317
|
return /* @__PURE__ */ jsx(
|
|
1337
1318
|
StyledIconButton,
|
|
1338
1319
|
__spreadProps(__spreadValues({
|
|
1339
1320
|
styleVar,
|
|
1340
1321
|
sizeVar,
|
|
1341
1322
|
disabled,
|
|
1342
|
-
|
|
1323
|
+
color,
|
|
1343
1324
|
ref
|
|
1344
1325
|
}, rest), {
|
|
1345
1326
|
"data-shoplflow": "IconButton",
|
|
1346
|
-
children
|
|
1327
|
+
children
|
|
1347
1328
|
})
|
|
1348
1329
|
);
|
|
1349
1330
|
}
|
|
@@ -1356,6 +1337,8 @@ var iconButtonSizeVar = {
|
|
|
1356
1337
|
M: "M"
|
|
1357
1338
|
};
|
|
1358
1339
|
var iconButtonStyleVar = {
|
|
1340
|
+
PRIMARY: "PRIMARY",
|
|
1341
|
+
SECONDARY: "SECONDARY",
|
|
1359
1342
|
SOLID: "SOLID",
|
|
1360
1343
|
GHOST: "GHOST"
|
|
1361
1344
|
};
|
|
@@ -1644,6 +1627,48 @@ var InputWrapper = styled5.label`
|
|
|
1644
1627
|
overflow: hidden;
|
|
1645
1628
|
${({ disabled }) => getDisabledStyle(disabled)};
|
|
1646
1629
|
`;
|
|
1630
|
+
|
|
1631
|
+
// src/components/Icon/Icon.types.ts
|
|
1632
|
+
var IconSizeVariants = {
|
|
1633
|
+
XS: "XS",
|
|
1634
|
+
S: "S",
|
|
1635
|
+
M: "M",
|
|
1636
|
+
L: "L",
|
|
1637
|
+
XL: "XL"
|
|
1638
|
+
};
|
|
1639
|
+
|
|
1640
|
+
// src/components/Icon/Icon.styled.ts
|
|
1641
|
+
var getIconSize = (size) => {
|
|
1642
|
+
switch (size) {
|
|
1643
|
+
case IconSizeVariants.XS:
|
|
1644
|
+
return "12px";
|
|
1645
|
+
case IconSizeVariants.S:
|
|
1646
|
+
return "20px";
|
|
1647
|
+
case IconSizeVariants.M:
|
|
1648
|
+
return "24px";
|
|
1649
|
+
case IconSizeVariants.L:
|
|
1650
|
+
return "30px";
|
|
1651
|
+
case IconSizeVariants.XL:
|
|
1652
|
+
return "36px";
|
|
1653
|
+
default:
|
|
1654
|
+
return "24px";
|
|
1655
|
+
}
|
|
1656
|
+
};
|
|
1657
|
+
var StyledIcon = styled5.svg`
|
|
1658
|
+
width: ${({ sizeVar }) => sizeVar && getIconSize(sizeVar)};
|
|
1659
|
+
min-width: ${({ sizeVar }) => sizeVar && getIconSize(sizeVar)};
|
|
1660
|
+
height: ${({ sizeVar }) => sizeVar && getIconSize(sizeVar)};
|
|
1661
|
+
min-height: ${({ sizeVar }) => sizeVar && getIconSize(sizeVar)};
|
|
1662
|
+
|
|
1663
|
+
& > path {
|
|
1664
|
+
fill: ${({ color }) => color && colorTokens[color]};
|
|
1665
|
+
}
|
|
1666
|
+
`;
|
|
1667
|
+
var Icon = forwardRef((_a, ref) => {
|
|
1668
|
+
var _b = _a, { iconSource } = _b, rest = __objRest(_b, ["iconSource"]);
|
|
1669
|
+
return /* @__PURE__ */ jsx(StyledIcon, __spreadProps(__spreadValues({ as: iconSource, ref }, rest), { "data-shoplflow": "Icon" }));
|
|
1670
|
+
});
|
|
1671
|
+
var Icon_default = Icon;
|
|
1647
1672
|
var DropdownButton = forwardRef(
|
|
1648
1673
|
(_a, ref) => {
|
|
1649
1674
|
var _b = _a, { width, onClick, sizeVar = "M", placeholder, value, disabled, leftSource } = _b, rest = __objRest(_b, ["width", "onClick", "sizeVar", "placeholder", "value", "disabled", "leftSource"]);
|
|
@@ -1942,26 +1967,14 @@ var Input = forwardRef(
|
|
|
1942
1967
|
),
|
|
1943
1968
|
/* @__PURE__ */ jsxs(RightElementWrapper, { children: [
|
|
1944
1969
|
maxLength && isFocused && /* @__PURE__ */ jsx(TextCounter_default, { currentLength: String(text).length, maxLength }),
|
|
1945
|
-
isFocused && Boolean(String(text).length > 0) && /* @__PURE__ */ jsx(
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
sizeVar: "S",
|
|
1949
|
-
onClick: handleOnClear,
|
|
1950
|
-
styleVar: "GHOST",
|
|
1951
|
-
iconSource: assetFunction("DeleteIcon"),
|
|
1952
|
-
color: "neutral600"
|
|
1953
|
-
}
|
|
1954
|
-
),
|
|
1955
|
-
initialType === "password" && /* @__PURE__ */ jsx(
|
|
1956
|
-
IconButton_default,
|
|
1970
|
+
isFocused && Boolean(String(text).length > 0) && /* @__PURE__ */ jsx(IconButton_default, { sizeVar: "S", onClick: handleOnClear, styleVar: "GHOST", children: /* @__PURE__ */ jsx(Icon_default, { iconSource: assetFunction("DeleteIcon"), color: "neutral600" }) }),
|
|
1971
|
+
initialType === "password" && /* @__PURE__ */ jsx(IconButton_default, { sizeVar: "S", onClick: handleTogglePasswordType, styleVar: "GHOST", children: /* @__PURE__ */ jsx(
|
|
1972
|
+
Icon_default,
|
|
1957
1973
|
{
|
|
1958
|
-
sizeVar: "S",
|
|
1959
|
-
onClick: handleTogglePasswordType,
|
|
1960
|
-
styleVar: "GHOST",
|
|
1961
1974
|
color: "neutral600",
|
|
1962
1975
|
iconSource: assetFunction(type === "password" ? "ViewOffIcon" : "ViewOnIcon")
|
|
1963
1976
|
}
|
|
1964
|
-
)
|
|
1977
|
+
) })
|
|
1965
1978
|
] })
|
|
1966
1979
|
]
|
|
1967
1980
|
}
|
|
@@ -1975,6 +1988,7 @@ var StyledInputButton = styled5.button`
|
|
|
1975
1988
|
align-items: center;
|
|
1976
1989
|
justify-content: space-between;
|
|
1977
1990
|
width: 100%;
|
|
1991
|
+
background: ${colorTokens.neutral0};
|
|
1978
1992
|
gap: 4px;
|
|
1979
1993
|
padding: 4px 4px 4px 12px;
|
|
1980
1994
|
cursor: pointer;
|
|
@@ -2060,17 +2074,7 @@ var InputButton = forwardRef(
|
|
|
2060
2074
|
children: /* @__PURE__ */ jsxs(StyledInputButton, __spreadProps(__spreadValues({}, rest), { onClick: handleOnClick, disabled, ref, children: [
|
|
2061
2075
|
text && text.length > 0 ? /* @__PURE__ */ jsx(Text_default, { typography: "body1_400", color: "neutral700", textOverflow: "ellipsis", lineClamp: 1, children: text }) : /* @__PURE__ */ jsx(Text_default, { typography: "body1_400", color: "neutral350", textOverflow: "ellipsis", lineClamp: 1, children: placeholder }),
|
|
2062
2076
|
/* @__PURE__ */ jsxs(Stack_default.Horizontal, { align: "center", children: [
|
|
2063
|
-
value && /* @__PURE__ */ jsx(
|
|
2064
|
-
IconButton_default,
|
|
2065
|
-
{
|
|
2066
|
-
sizeVar: "S",
|
|
2067
|
-
onClick: handleOnClear,
|
|
2068
|
-
styleVar: "GHOST",
|
|
2069
|
-
iconSource: assetFunction("DeleteIcon"),
|
|
2070
|
-
color: "neutral600",
|
|
2071
|
-
disabled
|
|
2072
|
-
}
|
|
2073
|
-
),
|
|
2077
|
+
value && /* @__PURE__ */ jsx(IconButton_default, { sizeVar: "S", onClick: handleOnClear, styleVar: "GHOST", disabled, children: /* @__PURE__ */ jsx(Icon_default, { iconSource: assetFunction("DeleteIcon"), color: "neutral600" }) }),
|
|
2074
2078
|
rightSource
|
|
2075
2079
|
] })
|
|
2076
2080
|
] }))
|