@shoplflow/base 0.24.21 → 0.24.24

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.d.cts CHANGED
@@ -516,6 +516,7 @@ declare const ButtonStyleVariants: {
516
516
  declare type ButtonStyleVariantType = $Values<typeof ButtonStyleVariants>;
517
517
  declare type ButtonOptionProps<T extends ElementType = 'button'> = Omit<ComponentPropsWithoutRef<T>, 'color' | 'disabled'> & SizeVariantProps<ButtonSizeVariantType> & StyleVariantProps<ButtonStyleVariantType> & ColorTokenProps & DisableProps & {
518
518
  typography?: TypographyTokens;
519
+ lineClamp?: number;
519
520
  };
520
521
  declare type ButtonProps<T extends ElementType = 'button'> = PolymorphicComponentProps<T, ButtonOptionProps> & LeftAndRightNodeProps;
521
522
  declare type ButtonComponent = <T extends ElementType = 'button'>(props: ButtonProps<T> & {
@@ -761,6 +762,7 @@ interface DropdownButtonProps extends HTMLAttributes<HTMLButtonElement>, Disable
761
762
  */
762
763
  placeholder?: string;
763
764
  value?: ReactNode;
765
+ isError?: boolean;
764
766
  /**
765
767
  * width를 설정합니다.
766
768
  */
@@ -1205,11 +1207,11 @@ interface TextAreaOptionProps extends DisableProps, ErrorProps {
1205
1207
  /**
1206
1208
  * text area의 높이를 조절해요.
1207
1209
  */
1208
- height?: number;
1210
+ height?: string;
1209
1211
  /**
1210
1212
  * text area의 최소 높이를 조절해요.
1211
1213
  */
1212
- minHeight?: number;
1214
+ minHeight?: string;
1213
1215
  }
1214
1216
  declare type TextAreaProps = ComponentPropsWithoutRef<'textarea'> & TextAreaOptionProps;
1215
1217
 
package/dist/index.d.ts CHANGED
@@ -516,6 +516,7 @@ declare const ButtonStyleVariants: {
516
516
  declare type ButtonStyleVariantType = $Values<typeof ButtonStyleVariants>;
517
517
  declare type ButtonOptionProps<T extends ElementType = 'button'> = Omit<ComponentPropsWithoutRef<T>, 'color' | 'disabled'> & SizeVariantProps<ButtonSizeVariantType> & StyleVariantProps<ButtonStyleVariantType> & ColorTokenProps & DisableProps & {
518
518
  typography?: TypographyTokens;
519
+ lineClamp?: number;
519
520
  };
520
521
  declare type ButtonProps<T extends ElementType = 'button'> = PolymorphicComponentProps<T, ButtonOptionProps> & LeftAndRightNodeProps;
521
522
  declare type ButtonComponent = <T extends ElementType = 'button'>(props: ButtonProps<T> & {
@@ -761,6 +762,7 @@ interface DropdownButtonProps extends HTMLAttributes<HTMLButtonElement>, Disable
761
762
  */
762
763
  placeholder?: string;
763
764
  value?: ReactNode;
765
+ isError?: boolean;
764
766
  /**
765
767
  * width를 설정합니다.
766
768
  */
@@ -1205,11 +1207,11 @@ interface TextAreaOptionProps extends DisableProps, ErrorProps {
1205
1207
  /**
1206
1208
  * text area의 높이를 조절해요.
1207
1209
  */
1208
- height?: number;
1210
+ height?: string;
1209
1211
  /**
1210
1212
  * text area의 최소 높이를 조절해요.
1211
1213
  */
1212
- minHeight?: number;
1214
+ minHeight?: string;
1213
1215
  }
1214
1216
  declare type TextAreaProps = ComponentPropsWithoutRef<'textarea'> & TextAreaOptionProps;
1215
1217
 
package/dist/index.js CHANGED
@@ -521,6 +521,7 @@ var setEllipsis = (maxLines) => {
521
521
  -webkit-line-clamp: ${maxLines};
522
522
  -webkit-box-orient: vertical;
523
523
  overflow: hidden;
524
+ word-break: break-all;
524
525
  text-overflow: ellipsis;
525
526
  `;
526
527
  };
@@ -1373,7 +1374,8 @@ var Button = forwardRef(
1373
1374
  as,
1374
1375
  children,
1375
1376
  leftSource,
1376
- rightSource
1377
+ rightSource,
1378
+ lineClamp
1377
1379
  } = _b, rest = __objRest(_b, [
1378
1380
  "styleVar",
1379
1381
  "sizeVar",
@@ -1382,7 +1384,8 @@ var Button = forwardRef(
1382
1384
  "as",
1383
1385
  "children",
1384
1386
  "leftSource",
1385
- "rightSource"
1387
+ "rightSource",
1388
+ "lineClamp"
1386
1389
  ]);
1387
1390
  return /* @__PURE__ */ jsxs(
1388
1391
  StyledButton,
@@ -1401,8 +1404,7 @@ var Button = forwardRef(
1401
1404
  /* @__PURE__ */ jsx(
1402
1405
  Text_default,
1403
1406
  {
1404
- wordBreak: "keep-all",
1405
- whiteSpace: "nowrap",
1407
+ lineClamp,
1406
1408
  color: styleVar === "PRIMARY" ? "neutral0" : "neutral700",
1407
1409
  typography: sizeVar === "M" ? "body1_400" : "body2_400",
1408
1410
  children
@@ -1835,11 +1837,24 @@ var getBorderColorByStatus = ({ isFocused, isError, isHovered, disabled }) => {
1835
1837
  var InputWrapper = styled5.label`
1836
1838
  display: flex;
1837
1839
  align-items: center;
1838
- width: ${({ width }) => width != null ? width : "100%"};
1839
- height: fit-content;
1840
+ width: ${({ width }) => {
1841
+ var _a;
1842
+ return (_a = `calc(${width} - 2px)`) != null ? _a : "calc(100% - 2px)";
1843
+ }};
1844
+ min-width: ${({ minWidth }) => {
1845
+ var _a;
1846
+ return (_a = `calc(${minWidth} - 2px)`) != null ? _a : "fit-content";
1847
+ }};
1848
+ height: ${({ height }) => {
1849
+ var _a;
1850
+ return (_a = `calc(${height} - 2px)`) != null ? _a : "fit-content";
1851
+ }};
1840
1852
  flex-direction: ${({ direction }) => direction || "row"};
1841
1853
  justify-content: space-between;
1842
- min-height: ${({ height }) => height != null ? height : "40px"};
1854
+ min-height: ${({ minHeight }) => {
1855
+ var _a;
1856
+ return (_a = `calc(${minHeight} - 2px)`) != null ? _a : "fit-content";
1857
+ }};
1843
1858
  margin: 1px;
1844
1859
  gap: 8px;
1845
1860
  box-shadow: 0 0 0 1px ${(props) => getBorderColorByStatus(props)};
@@ -1894,7 +1909,7 @@ var Icon = forwardRef((_a, ref) => {
1894
1909
  var Icon_default = Icon;
1895
1910
  var DropdownButton = forwardRef(
1896
1911
  (_a, ref) => {
1897
- var _b = _a, { width, onClick, sizeVar = "M", placeholder, value, disabled, leftSource } = _b, rest = __objRest(_b, ["width", "onClick", "sizeVar", "placeholder", "value", "disabled", "leftSource"]);
1912
+ var _b = _a, { width = "100%", onClick, sizeVar = "M", isError, placeholder, value, disabled, leftSource } = _b, rest = __objRest(_b, ["width", "onClick", "sizeVar", "isError", "placeholder", "value", "disabled", "leftSource"]);
1898
1913
  const { isOpen, setIsOpen } = useDropdown();
1899
1914
  const [isHovered, setIsHovered] = useState(false);
1900
1915
  const handleOnClick = (e) => {
@@ -1918,6 +1933,7 @@ var DropdownButton = forwardRef(
1918
1933
  isHovered,
1919
1934
  disabled,
1920
1935
  width,
1936
+ isError,
1921
1937
  height: getDropdownHeightBySizeVar(sizeVar),
1922
1938
  children: /* @__PURE__ */ jsxs(StyledDropdownButton, __spreadProps(__spreadValues({ ref, onClick: handleOnClick, disabled }, rest), { sizeVar, children: [
1923
1939
  leftSource && leftSource,
@@ -2641,7 +2657,7 @@ var Input = forwardRef(
2641
2657
  min,
2642
2658
  max,
2643
2659
  className,
2644
- width
2660
+ width = "100%"
2645
2661
  } = _b, rest = __objRest(_b, [
2646
2662
  "onFocus",
2647
2663
  "onBlur",
@@ -2767,6 +2783,7 @@ var Input = forwardRef(
2767
2783
  onMouseEnter: handleOnMouseEnter,
2768
2784
  onMouseLeave: handleOnMouseLeave,
2769
2785
  width: getWidth(),
2786
+ height: type === "number" ? "32px" : "40px",
2770
2787
  "data-shoplflow": "input",
2771
2788
  children: [
2772
2789
  /* @__PURE__ */ jsx(
@@ -2911,7 +2928,7 @@ var StyledTextarea = styled5.textarea`
2911
2928
  background-color: transparent;
2912
2929
  resize: none;
2913
2930
  width: 100%;
2914
- height: ${({ minHeight }) => minHeight ? `${minHeight}px` : "300px"};
2931
+ height: 100%;
2915
2932
  flex: 1;
2916
2933
  word-break: break-all;
2917
2934
  ${({ disabled }) => getDisabledStyle(disabled)};
@@ -2932,8 +2949,9 @@ var TextArea = forwardRef(
2932
2949
  defaultValue,
2933
2950
  onBlur,
2934
2951
  onFocus,
2935
- minHeight = 100,
2952
+ minHeight = "100px",
2936
2953
  width,
2954
+ height,
2937
2955
  className
2938
2956
  } = _b, rest = __objRest(_b, [
2939
2957
  "name",
@@ -2948,6 +2966,7 @@ var TextArea = forwardRef(
2948
2966
  "onFocus",
2949
2967
  "minHeight",
2950
2968
  "width",
2969
+ "height",
2951
2970
  "className"
2952
2971
  ]);
2953
2972
  const [text, setText] = useState("");
@@ -3007,6 +3026,8 @@ var TextArea = forwardRef(
3007
3026
  direction: "column",
3008
3027
  onMouseEnter: handleOnMouseEnter,
3009
3028
  onMouseLeave: handleOnMouseLeave,
3029
+ height,
3030
+ minHeight,
3010
3031
  width,
3011
3032
  "data-shoplflow": "text-area",
3012
3033
  children: [
@@ -3023,8 +3044,7 @@ var TextArea = forwardRef(
3023
3044
  value,
3024
3045
  ref,
3025
3046
  maxLength,
3026
- disabled,
3027
- minHeight
3047
+ disabled
3028
3048
  }, rest)
3029
3049
  ),
3030
3050
  /* @__PURE__ */ jsx(BottomElementWrapper, { children: maxLength && /* @__PURE__ */ jsx(TextCounter_default, { currentLength: String(text).length, maxLength }) })