@shoplflow/base 0.35.0 → 0.36.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 +20 -5
- package/dist/index.d.cts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +20 -5
- package/package.json +3 -3
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,
|
|
@@ -6744,7 +6759,7 @@ var SliderThumbs = ({
|
|
|
6744
6759
|
selectedColor,
|
|
6745
6760
|
onMouseDown
|
|
6746
6761
|
}) => {
|
|
6747
|
-
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: positions.map((position, index) => /* @__PURE__ */ jsxRuntime.jsx(ThumbButton, { style: { left: `${position}%` }, onMouseDown: onMouseDown(index), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6762
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: positions.map((position, index) => /* @__PURE__ */ jsxRuntime.jsx(ThumbButton, { style: { left: `${position}%` }, onMouseDown: onMouseDown(index), type: "button", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6748
6763
|
exports.Tooltip,
|
|
6749
6764
|
{
|
|
6750
6765
|
trigger: /* @__PURE__ */ jsxRuntime.jsx(ThumbCircle, { isDisabled, selectedColor }),
|
|
@@ -6767,11 +6782,11 @@ var useSlider = ({ bounds, step, defaultRange, handleRange, isDisabled = false }
|
|
|
6767
6782
|
} else if (index === 1) {
|
|
6768
6783
|
newRange[1] = Math.max(newValue, newRange[0]);
|
|
6769
6784
|
}
|
|
6785
|
+
handleRange == null ? void 0 : handleRange({ min: newRange[0], max: newRange[1] });
|
|
6770
6786
|
return newRange;
|
|
6771
6787
|
});
|
|
6772
|
-
handleRange == null ? void 0 : handleRange({ min: range[0], max: range[1] });
|
|
6773
6788
|
},
|
|
6774
|
-
[
|
|
6789
|
+
[handleRange]
|
|
6775
6790
|
);
|
|
6776
6791
|
const handleMouseDown = React3.useCallback(
|
|
6777
6792
|
(index) => (e) => {
|
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,
|
|
@@ -6717,7 +6732,7 @@ var SliderThumbs = ({
|
|
|
6717
6732
|
selectedColor,
|
|
6718
6733
|
onMouseDown
|
|
6719
6734
|
}) => {
|
|
6720
|
-
return /* @__PURE__ */ jsx(Fragment, { children: positions.map((position, index) => /* @__PURE__ */ jsx(ThumbButton, { style: { left: `${position}%` }, onMouseDown: onMouseDown(index), children: /* @__PURE__ */ jsx(
|
|
6735
|
+
return /* @__PURE__ */ jsx(Fragment, { children: positions.map((position, index) => /* @__PURE__ */ jsx(ThumbButton, { style: { left: `${position}%` }, onMouseDown: onMouseDown(index), type: "button", children: /* @__PURE__ */ jsx(
|
|
6721
6736
|
Tooltip_default,
|
|
6722
6737
|
{
|
|
6723
6738
|
trigger: /* @__PURE__ */ jsx(ThumbCircle, { isDisabled, selectedColor }),
|
|
@@ -6740,11 +6755,11 @@ var useSlider = ({ bounds, step, defaultRange, handleRange, isDisabled = false }
|
|
|
6740
6755
|
} else if (index === 1) {
|
|
6741
6756
|
newRange[1] = Math.max(newValue, newRange[0]);
|
|
6742
6757
|
}
|
|
6758
|
+
handleRange == null ? void 0 : handleRange({ min: newRange[0], max: newRange[1] });
|
|
6743
6759
|
return newRange;
|
|
6744
6760
|
});
|
|
6745
|
-
handleRange == null ? void 0 : handleRange({ min: range[0], max: range[1] });
|
|
6746
6761
|
},
|
|
6747
|
-
[
|
|
6762
|
+
[handleRange]
|
|
6748
6763
|
);
|
|
6749
6764
|
const handleMouseDown = useCallback(
|
|
6750
6765
|
(index) => (e) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shoplflow/base",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.36.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -91,8 +91,8 @@
|
|
|
91
91
|
"react-dom": "^18.2.0",
|
|
92
92
|
"simplebar-react": "^3.2.6",
|
|
93
93
|
"@shoplflow/hada-assets": "^0.1.3",
|
|
94
|
-
"@shoplflow/
|
|
95
|
-
"@shoplflow/
|
|
94
|
+
"@shoplflow/utils": "^0.6.5",
|
|
95
|
+
"@shoplflow/shopl-assets": "^0.12.3"
|
|
96
96
|
},
|
|
97
97
|
"scripts": {
|
|
98
98
|
"type-check": "tsc --noEmit",
|