@shoplflow/base 0.35.0 → 0.35.1
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 +17 -2
- package/dist/index.d.cts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +17 -2
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1758,6 +1758,18 @@ var getWidthAndHeightFromSizeVar = (sizeVar) => {
|
|
|
1758
1758
|
`;
|
|
1759
1759
|
}
|
|
1760
1760
|
};
|
|
1761
|
+
var getIconSizeFromSizeVar = (sizeVar) => {
|
|
1762
|
+
switch (sizeVar) {
|
|
1763
|
+
case "M":
|
|
1764
|
+
return "24px";
|
|
1765
|
+
case "S":
|
|
1766
|
+
return "20px";
|
|
1767
|
+
case "XS":
|
|
1768
|
+
return "12px";
|
|
1769
|
+
default:
|
|
1770
|
+
return "20px";
|
|
1771
|
+
}
|
|
1772
|
+
};
|
|
1761
1773
|
var getStyleByStyleVar2 = (styleVar, color, isHovered) => {
|
|
1762
1774
|
switch (styleVar) {
|
|
1763
1775
|
case "PRIMARY":
|
|
@@ -1817,14 +1829,15 @@ var StyledIconButton = styled6__default.default.button`
|
|
|
1817
1829
|
${({ sizeVar }) => getWidthAndHeightFromSizeVar(sizeVar)};
|
|
1818
1830
|
${({ disabled }) => getDisabledStyle(disabled)};
|
|
1819
1831
|
& > svg {
|
|
1820
|
-
width:
|
|
1821
|
-
height:
|
|
1832
|
+
width: ${({ iconSizeVar }) => getIconSizeFromSizeVar(iconSizeVar)};
|
|
1833
|
+
height: ${({ iconSizeVar }) => getIconSizeFromSizeVar(iconSizeVar)};
|
|
1822
1834
|
}
|
|
1823
1835
|
`;
|
|
1824
1836
|
var IconButton = React3.forwardRef(
|
|
1825
1837
|
(_a, ref) => {
|
|
1826
1838
|
var _b = _a, {
|
|
1827
1839
|
styleVar,
|
|
1840
|
+
iconSizeVar,
|
|
1828
1841
|
sizeVar,
|
|
1829
1842
|
disabled,
|
|
1830
1843
|
children,
|
|
@@ -1835,6 +1848,7 @@ var IconButton = React3.forwardRef(
|
|
|
1835
1848
|
type = "button"
|
|
1836
1849
|
} = _b, rest = __objRest(_b, [
|
|
1837
1850
|
"styleVar",
|
|
1851
|
+
"iconSizeVar",
|
|
1838
1852
|
"sizeVar",
|
|
1839
1853
|
"disabled",
|
|
1840
1854
|
"children",
|
|
@@ -1857,6 +1871,7 @@ var IconButton = React3.forwardRef(
|
|
|
1857
1871
|
StyledIconButton,
|
|
1858
1872
|
__spreadProps(__spreadValues({
|
|
1859
1873
|
styleVar,
|
|
1874
|
+
iconSizeVar,
|
|
1860
1875
|
sizeVar,
|
|
1861
1876
|
disabled,
|
|
1862
1877
|
color,
|
package/dist/index.d.cts
CHANGED
|
@@ -201,6 +201,12 @@ interface SizeVariantProps<Size> {
|
|
|
201
201
|
*/
|
|
202
202
|
sizeVar?: Size;
|
|
203
203
|
}
|
|
204
|
+
interface IconSizeVariantProps<Size> {
|
|
205
|
+
/**
|
|
206
|
+
* 아이콘의 크기를 설정합니다.
|
|
207
|
+
*/
|
|
208
|
+
iconSizeVar?: Size;
|
|
209
|
+
}
|
|
204
210
|
interface StyleVariantProps<Style> {
|
|
205
211
|
/**
|
|
206
212
|
* 컴포넌트의 스타일을 설정합니다.
|
|
@@ -637,7 +643,7 @@ declare const IconButtonStyleVariants: {
|
|
|
637
643
|
readonly GHOST: "GHOST";
|
|
638
644
|
};
|
|
639
645
|
declare type IconButtonStyleVariantType = $Values<typeof IconButtonStyleVariants>;
|
|
640
|
-
declare type IconButtonOptionProps<T extends ElementType = 'button'> = Omit<ComponentPropsWithoutRef<T>, 'color' | 'disabled'> & DisableProps & SizeVariantProps<IconButtonSizeVariantType> & StyleVariantProps<IconButtonStyleVariantType> & ChildrenProps & ColorTokenProps & LoadingProps;
|
|
646
|
+
declare type IconButtonOptionProps<T extends ElementType = 'button'> = Omit<ComponentPropsWithoutRef<T>, 'color' | 'disabled'> & DisableProps & SizeVariantProps<IconButtonSizeVariantType> & IconSizeVariantProps<'XS' | 'S' | 'M'> & StyleVariantProps<IconButtonStyleVariantType> & ChildrenProps & ColorTokenProps & LoadingProps;
|
|
641
647
|
declare type IconButtonProps<T extends ElementType = 'button'> = PolymorphicComponentProps<T, IconButtonOptionProps>;
|
|
642
648
|
declare type IconButtonComponent = <T extends ElementType = 'button'>(props: IconButtonProps<T> & {
|
|
643
649
|
ref?: ComponentPropsWithRef<T>['ref'];
|
package/dist/index.d.ts
CHANGED
|
@@ -201,6 +201,12 @@ interface SizeVariantProps<Size> {
|
|
|
201
201
|
*/
|
|
202
202
|
sizeVar?: Size;
|
|
203
203
|
}
|
|
204
|
+
interface IconSizeVariantProps<Size> {
|
|
205
|
+
/**
|
|
206
|
+
* 아이콘의 크기를 설정합니다.
|
|
207
|
+
*/
|
|
208
|
+
iconSizeVar?: Size;
|
|
209
|
+
}
|
|
204
210
|
interface StyleVariantProps<Style> {
|
|
205
211
|
/**
|
|
206
212
|
* 컴포넌트의 스타일을 설정합니다.
|
|
@@ -637,7 +643,7 @@ declare const IconButtonStyleVariants: {
|
|
|
637
643
|
readonly GHOST: "GHOST";
|
|
638
644
|
};
|
|
639
645
|
declare type IconButtonStyleVariantType = $Values<typeof IconButtonStyleVariants>;
|
|
640
|
-
declare type IconButtonOptionProps<T extends ElementType = 'button'> = Omit<ComponentPropsWithoutRef<T>, 'color' | 'disabled'> & DisableProps & SizeVariantProps<IconButtonSizeVariantType> & StyleVariantProps<IconButtonStyleVariantType> & ChildrenProps & ColorTokenProps & LoadingProps;
|
|
646
|
+
declare type IconButtonOptionProps<T extends ElementType = 'button'> = Omit<ComponentPropsWithoutRef<T>, 'color' | 'disabled'> & DisableProps & SizeVariantProps<IconButtonSizeVariantType> & IconSizeVariantProps<'XS' | 'S' | 'M'> & StyleVariantProps<IconButtonStyleVariantType> & ChildrenProps & ColorTokenProps & LoadingProps;
|
|
641
647
|
declare type IconButtonProps<T extends ElementType = 'button'> = PolymorphicComponentProps<T, IconButtonOptionProps>;
|
|
642
648
|
declare type IconButtonComponent = <T extends ElementType = 'button'>(props: IconButtonProps<T> & {
|
|
643
649
|
ref?: ComponentPropsWithRef<T>['ref'];
|
package/dist/index.js
CHANGED
|
@@ -1731,6 +1731,18 @@ var getWidthAndHeightFromSizeVar = (sizeVar) => {
|
|
|
1731
1731
|
`;
|
|
1732
1732
|
}
|
|
1733
1733
|
};
|
|
1734
|
+
var getIconSizeFromSizeVar = (sizeVar) => {
|
|
1735
|
+
switch (sizeVar) {
|
|
1736
|
+
case "M":
|
|
1737
|
+
return "24px";
|
|
1738
|
+
case "S":
|
|
1739
|
+
return "20px";
|
|
1740
|
+
case "XS":
|
|
1741
|
+
return "12px";
|
|
1742
|
+
default:
|
|
1743
|
+
return "20px";
|
|
1744
|
+
}
|
|
1745
|
+
};
|
|
1734
1746
|
var getStyleByStyleVar2 = (styleVar, color, isHovered) => {
|
|
1735
1747
|
switch (styleVar) {
|
|
1736
1748
|
case "PRIMARY":
|
|
@@ -1790,14 +1802,15 @@ var StyledIconButton = styled6.button`
|
|
|
1790
1802
|
${({ sizeVar }) => getWidthAndHeightFromSizeVar(sizeVar)};
|
|
1791
1803
|
${({ disabled }) => getDisabledStyle(disabled)};
|
|
1792
1804
|
& > svg {
|
|
1793
|
-
width:
|
|
1794
|
-
height:
|
|
1805
|
+
width: ${({ iconSizeVar }) => getIconSizeFromSizeVar(iconSizeVar)};
|
|
1806
|
+
height: ${({ iconSizeVar }) => getIconSizeFromSizeVar(iconSizeVar)};
|
|
1795
1807
|
}
|
|
1796
1808
|
`;
|
|
1797
1809
|
var IconButton = forwardRef(
|
|
1798
1810
|
(_a, ref) => {
|
|
1799
1811
|
var _b = _a, {
|
|
1800
1812
|
styleVar,
|
|
1813
|
+
iconSizeVar,
|
|
1801
1814
|
sizeVar,
|
|
1802
1815
|
disabled,
|
|
1803
1816
|
children,
|
|
@@ -1808,6 +1821,7 @@ var IconButton = forwardRef(
|
|
|
1808
1821
|
type = "button"
|
|
1809
1822
|
} = _b, rest = __objRest(_b, [
|
|
1810
1823
|
"styleVar",
|
|
1824
|
+
"iconSizeVar",
|
|
1811
1825
|
"sizeVar",
|
|
1812
1826
|
"disabled",
|
|
1813
1827
|
"children",
|
|
@@ -1830,6 +1844,7 @@ var IconButton = forwardRef(
|
|
|
1830
1844
|
StyledIconButton,
|
|
1831
1845
|
__spreadProps(__spreadValues({
|
|
1832
1846
|
styleVar,
|
|
1847
|
+
iconSizeVar,
|
|
1833
1848
|
sizeVar,
|
|
1834
1849
|
disabled,
|
|
1835
1850
|
color,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shoplflow/base",
|
|
3
|
-
"version": "0.35.
|
|
3
|
+
"version": "0.35.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"react-dom": "^18.2.0",
|
|
92
92
|
"simplebar-react": "^3.2.6",
|
|
93
93
|
"@shoplflow/hada-assets": "^0.1.3",
|
|
94
|
-
"@shoplflow/shopl-assets": "^0.12.
|
|
94
|
+
"@shoplflow/shopl-assets": "^0.12.3",
|
|
95
95
|
"@shoplflow/utils": "^0.6.5"
|
|
96
96
|
},
|
|
97
97
|
"scripts": {
|