@shoplflow/base 0.45.12 → 0.45.14

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 CHANGED
@@ -426,7 +426,9 @@ var spacing02 = "var(--spacing02)";
426
426
  var spacing04 = "var(--spacing04)";
427
427
  var spacing06 = "var(--spacing06)";
428
428
  var spacing08 = "var(--spacing08)";
429
+ var spacing10 = "var(--spacing10)";
429
430
  var spacing12 = "var(--spacing12)";
431
+ var spacing14 = "var(--spacing14)";
430
432
  var spacing16 = "var(--spacing16)";
431
433
  var spacing20 = "var(--spacing20)";
432
434
  var spacing24 = "var(--spacing24)";
@@ -438,7 +440,9 @@ exports.spacingTokens = {
438
440
  spacing04,
439
441
  spacing06,
440
442
  spacing08,
443
+ spacing10,
441
444
  spacing12,
445
+ spacing14,
442
446
  spacing16,
443
447
  spacing20,
444
448
  spacing24,
@@ -3261,7 +3265,9 @@ var Dropdown = ({
3261
3265
  trigger,
3262
3266
  popper,
3263
3267
  option = "CLICK",
3264
- width = "100%"
3268
+ width = "100%",
3269
+ offset: offset4 = 4,
3270
+ placement
3265
3271
  }) => {
3266
3272
  const [triggerRef, setTriggerRef] = React3.useState(null);
3267
3273
  const [size2, setSize] = React3.useState({ width: 0, height: 0 });
@@ -3283,8 +3289,9 @@ var Dropdown = ({
3283
3289
  return /* @__PURE__ */ jsxRuntime.jsx(StyledDropdown, { "data-shoplflow": "Dropdown", width, children: /* @__PURE__ */ jsxRuntime.jsx(DropdownContext.Provider, { value: __spreadProps(__spreadValues({}, size2), { isOpen, setIsOpen, option }), children: /* @__PURE__ */ jsxRuntime.jsxs(
3284
3290
  exports.Popper,
3285
3291
  {
3286
- offset: 4,
3287
- autoPlacement: {
3292
+ offset: offset4,
3293
+ placement,
3294
+ autoPlacement: placement ? void 0 : {
3288
3295
  allowedPlacements: ["bottom-start", "top-start"]
3289
3296
  },
3290
3297
  children: [
@@ -3630,7 +3637,7 @@ exports.TreeItem[exports.TREE_SYMBOL_KEY] = true;
3630
3637
  Tree.Item = exports.TreeItem;
3631
3638
  exports.Tree = Tree;
3632
3639
  var StyledInput = styled6__default.default.input`
3633
- padding: ${({ sizeVar }) => sizeVar === "S" ? "0 0 0 8px" : "4px 0 4px 12px"};
3640
+ padding: ${({ sizeVar }) => sizeVar === "S" ? "0 8px" : "4px 12px"};
3634
3641
  background-color: transparent;
3635
3642
  display: flex;
3636
3643
  min-width: ${({ minWidth }) => minWidth || "64px"};
@@ -3654,6 +3661,7 @@ var StyledInput = styled6__default.default.input`
3654
3661
  padding: 4px 8px;
3655
3662
  text-align: center;
3656
3663
  -moz-appearance: textfield;
3664
+ appearance: textfield;
3657
3665
  }
3658
3666
 
3659
3667
  *,
@@ -3663,10 +3671,27 @@ var StyledInput = styled6__default.default.input`
3663
3671
  }
3664
3672
  `;
3665
3673
  var RightElementWrapper2 = styled6__default.default.div`
3674
+ padding: ${({ sizeVar, type, initialType }) => {
3675
+ if (initialType === "password" || type === "password") {
3676
+ return "0";
3677
+ }
3678
+ return sizeVar === "S" ? "0 8px 0 0" : "0 12px 0 0";
3679
+ }};
3666
3680
  display: flex;
3667
3681
  flex-direction: row;
3668
3682
  align-items: center;
3669
- padding: 0 8px 0 0;
3683
+ height: 100%;
3684
+ `;
3685
+ var ClearIconButton = styled6__default.default(StyledIconButton)`
3686
+ position: absolute;
3687
+ right: 2px;
3688
+ top: 50%;
3689
+ transform: translateY(-50%);
3690
+ background-color: ${exports.colorTokens.neutral0} !important;
3691
+
3692
+ &:hover {
3693
+ background-color: ${exports.colorTokens.neutral100} !important;
3694
+ }
3670
3695
  `;
3671
3696
  var Wrapper = styled6__default.default.div`
3672
3697
  display: flex;
@@ -3675,9 +3700,9 @@ var Wrapper = styled6__default.default.div`
3675
3700
  align-items: center;
3676
3701
  gap: 2px;
3677
3702
  `;
3678
- var TextCounter = ({ currentLength, maxLength }) => {
3703
+ var TextCounter = ({ currentLength, maxLength, isError }) => {
3679
3704
  return /* @__PURE__ */ jsxRuntime.jsxs(Wrapper, { children: [
3680
- /* @__PURE__ */ jsxRuntime.jsx(exports.Text, { typography: "caption_400", color: "neutral400", children: currentLength }),
3705
+ /* @__PURE__ */ jsxRuntime.jsx(exports.Text, { typography: "caption_400", color: isError ? "red300" : "neutral400", children: currentLength }),
3681
3706
  /* @__PURE__ */ jsxRuntime.jsx(exports.Text, { typography: "caption_400", color: "neutral350", children: "/" }),
3682
3707
  /* @__PURE__ */ jsxRuntime.jsx(exports.Text, { typography: "caption_400", color: "neutral350", children: maxLength })
3683
3708
  ] });
@@ -3759,7 +3784,6 @@ var InputWrapper = styled6__default.default.label`
3759
3784
  borderRadius
3760
3785
  })};
3761
3786
  justify-content: space-between;
3762
- gap: ${({ gap, sizeVar }) => gap || (sizeVar === "S" ? "4px" : "8px")};
3763
3787
  border: 1px solid ${(props) => getBorderColorByStatus2(props)};
3764
3788
  background-color: ${exports.colorTokens.neutral0};
3765
3789
  overflow: hidden;
@@ -3803,7 +3827,8 @@ var Input = React3.forwardRef(
3803
3827
  rightSource,
3804
3828
  minWidth,
3805
3829
  gap,
3806
- initIsFocused
3830
+ initIsFocused,
3831
+ rightSourceStyle
3807
3832
  } = _b, rest = __objRest(_b, [
3808
3833
  "onFocus",
3809
3834
  "onBlur",
@@ -3826,7 +3851,8 @@ var Input = React3.forwardRef(
3826
3851
  "rightSource",
3827
3852
  "minWidth",
3828
3853
  "gap",
3829
- "initIsFocused"
3854
+ "initIsFocused",
3855
+ "rightSourceStyle"
3830
3856
  ]);
3831
3857
  const [text, setText] = React3.useState("");
3832
3858
  const [isFocused, setIsFocused] = React3.useState(Boolean(initIsFocused));
@@ -3943,36 +3969,38 @@ var Input = React3.forwardRef(
3943
3969
  gap,
3944
3970
  sizeVar,
3945
3971
  children: [
3946
- /* @__PURE__ */ jsxRuntime.jsx(
3947
- StyledInput,
3948
- __spreadValues({
3949
- onFocus: handleOnFocus,
3950
- onBlur: handleOnBlur,
3951
- onChange: handleOnChange,
3952
- onKeyDown: handleOnKeyDown,
3953
- maxLength,
3954
- disabled,
3955
- value: text,
3956
- type,
3957
- id: uniqueId,
3958
- ref: refs,
3959
- minWidth,
3960
- sizeVar,
3961
- className: "body1_400" + (className ? ` ${className}` : "")
3962
- }, rest)
3963
- ),
3964
- !(type === "number") && /* @__PURE__ */ jsxRuntime.jsxs(RightElementWrapper2, { children: [
3965
- maxLength && isFocused && /* @__PURE__ */ jsxRuntime.jsx(TextCounter_default, { currentLength: String(text).length, maxLength }),
3966
- onClear && isFocused && Boolean(String(text).length > 0) && /* @__PURE__ */ jsxRuntime.jsx(exports.IconButton, { sizeVar: "S", onClick: handleOnClear, styleVar: "GHOST", children: /* @__PURE__ */ jsxRuntime.jsx(exports.Icon, { iconSource: assetFunction("DeleteIcon"), color: "neutral350" }) }),
3967
- initialType === "password" && /* @__PURE__ */ jsxRuntime.jsx(exports.IconButton, { sizeVar: "S", onClick: handleTogglePasswordType, styleVar: "GHOST", children: /* @__PURE__ */ jsxRuntime.jsx(
3972
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { position: "relative", width: "100%" }, children: [
3973
+ /* @__PURE__ */ jsxRuntime.jsx(
3974
+ StyledInput,
3975
+ __spreadValues({
3976
+ onFocus: handleOnFocus,
3977
+ onBlur: handleOnBlur,
3978
+ onChange: handleOnChange,
3979
+ onKeyDown: handleOnKeyDown,
3980
+ maxLength,
3981
+ disabled,
3982
+ value: text,
3983
+ type,
3984
+ id: uniqueId,
3985
+ ref: refs,
3986
+ minWidth,
3987
+ sizeVar,
3988
+ className: "body1_400" + (className ? ` ${className}` : "")
3989
+ }, rest)
3990
+ ),
3991
+ onClear && isHovered && Boolean(String(text).length > 0) && /* @__PURE__ */ jsxRuntime.jsx(ClearIconButton, { sizeVar, onClick: handleOnClear, styleVar: "GHOST", isHovered: false, children: /* @__PURE__ */ jsxRuntime.jsx(exports.Icon, { iconSource: assetFunction("DeleteIcon"), color: "neutral350" }) })
3992
+ ] }),
3993
+ !(type === "number") && (Boolean(maxLength && isFocused) || Boolean(initialType === "password") || Boolean(rightSource)) && /* @__PURE__ */ jsxRuntime.jsxs(RightElementWrapper2, { type, sizeVar, initialType, style: rightSourceStyle, children: [
3994
+ maxLength && isFocused && /* @__PURE__ */ jsxRuntime.jsx(TextCounter_default, { currentLength: String(text).length, maxLength, isError }),
3995
+ initialType === "password" && /* @__PURE__ */ jsxRuntime.jsx(exports.IconButton, { sizeVar, onClick: handleTogglePasswordType, styleVar: "GHOST", children: /* @__PURE__ */ jsxRuntime.jsx(
3968
3996
  exports.Icon,
3969
3997
  {
3970
3998
  color: "neutral600",
3971
3999
  iconSource: assetFunction(type === "password" ? "ViewOffIcon" : "ViewOnIcon")
3972
4000
  }
3973
- ) })
3974
- ] }),
3975
- rightSource && rightSource
4001
+ ) }),
4002
+ rightSource && rightSource
4003
+ ] })
3976
4004
  ]
3977
4005
  }
3978
4006
  );
@@ -6654,13 +6682,20 @@ var NumberCombobox = (_a) => {
6654
6682
  sizeVar,
6655
6683
  width,
6656
6684
  ref: inputRef,
6657
- type: "number",
6685
+ type: "text",
6686
+ inputMode: "numeric",
6658
6687
  style: { textAlign: "left", paddingRight: "0px" },
6659
6688
  className: _className,
6660
6689
  gap: "4px",
6661
6690
  initIsFocused: isOpen,
6662
6691
  value,
6663
- onChange,
6692
+ onChange: (e) => {
6693
+ const numericValue = e.target.value.replace(/[^\d]/g, "");
6694
+ if (e.target.value !== numericValue) {
6695
+ e.target.value = numericValue;
6696
+ }
6697
+ onChange == null ? void 0 : onChange(e);
6698
+ },
6664
6699
  onFocus: () => {
6665
6700
  setIsOpen(true);
6666
6701
  },
@@ -6707,7 +6742,8 @@ var NumberCombobox = (_a) => {
6707
6742
  }
6708
6743
  onBlur == null ? void 0 : onBlur(event);
6709
6744
  },
6710
- rightSource: /* @__PURE__ */ jsxRuntime.jsx(exports.StackContainer.Horizontal, { padding: "0px 4px 0px 0px", children: /* @__PURE__ */ jsxRuntime.jsx(
6745
+ rightSourceStyle: { padding: "4px" },
6746
+ rightSource: /* @__PURE__ */ jsxRuntime.jsx(exports.StackContainer.Horizontal, { children: /* @__PURE__ */ jsxRuntime.jsx(
6711
6747
  exports.IconButton,
6712
6748
  {
6713
6749
  sizeVar: "XS",
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React$1 from 'react';
3
- import React__default, { ElementType, ComponentPropsWithoutRef, ReactNode, ReactElement, ImgHTMLAttributes, ForwardRefExoticComponent, PropsWithoutRef, RefAttributes, CSSProperties, HTMLAttributes, ComponentPropsWithRef, ButtonHTMLAttributes, InputHTMLAttributes, MouseEvent, Ref, ChangeEvent } from 'react';
3
+ import React__default, { ElementType, ComponentPropsWithoutRef, ReactNode, ReactElement, CSSProperties, ImgHTMLAttributes, ForwardRefExoticComponent, PropsWithoutRef, RefAttributes, HTMLAttributes, ComponentPropsWithRef, ButtonHTMLAttributes, InputHTMLAttributes, MouseEvent, Ref, ChangeEvent } from 'react';
4
4
  import { $Values } from '@shoplflow/utils';
5
5
  import { IconSource } from '@shoplflow/shopl-assets';
6
6
  import { IconSource as IconSource$1 } from '@shoplflow/hada-assets';
@@ -97,7 +97,9 @@ declare const spacingTokens: {
97
97
  spacing04: string;
98
98
  spacing06: string;
99
99
  spacing08: string;
100
+ spacing10: string;
100
101
  spacing12: string;
102
+ spacing14: string;
101
103
  spacing16: string;
102
104
  spacing20: string;
103
105
  spacing24: string;
@@ -269,6 +271,7 @@ interface RightElementProps {
269
271
  * 텍스트를 기준으로 오른쪽에 위치할 ReactElement를 설정합니다.
270
272
  */
271
273
  rightSource?: ReactElement;
274
+ rightSourceStyle?: CSSProperties;
272
275
  }
273
276
  interface LeftAndRightElementProps extends RightElementProps, LeftElementProps {
274
277
  }
@@ -954,6 +957,8 @@ interface DropdownOptionProps {
954
957
  option?: DropdownOptionVariantType;
955
958
  width?: CSSProperties['width'];
956
959
  disabled?: boolean;
960
+ placement?: Placement;
961
+ offset?: OffsetOptions;
957
962
  }
958
963
  interface DropdownContentProps extends HTMLAttributes<HTMLDivElement>, ChildrenProps {
959
964
  /**
@@ -986,7 +991,7 @@ interface DropdownTriggerButtonProps extends Omit<ButtonHTMLAttributes<HTMLButto
986
991
  }
987
992
 
988
993
  declare const Dropdown: {
989
- ({ isOpen: initialIsOpen, trigger, popper, option, width, }: DropdownProps): react_jsx_runtime.JSX.Element;
994
+ ({ isOpen: initialIsOpen, trigger, popper, option, width, offset, placement, }: DropdownProps): react_jsx_runtime.JSX.Element;
990
995
  Button: React__default.ForwardRefExoticComponent<DropdownTriggerButtonProps & React__default.RefAttributes<HTMLButtonElement>>;
991
996
  Content: ({ children, width: initialWidth, type, onClick, ...rest }: DropdownContentProps) => react_jsx_runtime.JSX.Element;
992
997
  };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React$1 from 'react';
3
- import React__default, { ElementType, ComponentPropsWithoutRef, ReactNode, ReactElement, ImgHTMLAttributes, ForwardRefExoticComponent, PropsWithoutRef, RefAttributes, CSSProperties, HTMLAttributes, ComponentPropsWithRef, ButtonHTMLAttributes, InputHTMLAttributes, MouseEvent, Ref, ChangeEvent } from 'react';
3
+ import React__default, { ElementType, ComponentPropsWithoutRef, ReactNode, ReactElement, CSSProperties, ImgHTMLAttributes, ForwardRefExoticComponent, PropsWithoutRef, RefAttributes, HTMLAttributes, ComponentPropsWithRef, ButtonHTMLAttributes, InputHTMLAttributes, MouseEvent, Ref, ChangeEvent } from 'react';
4
4
  import { $Values } from '@shoplflow/utils';
5
5
  import { IconSource } from '@shoplflow/shopl-assets';
6
6
  import { IconSource as IconSource$1 } from '@shoplflow/hada-assets';
@@ -97,7 +97,9 @@ declare const spacingTokens: {
97
97
  spacing04: string;
98
98
  spacing06: string;
99
99
  spacing08: string;
100
+ spacing10: string;
100
101
  spacing12: string;
102
+ spacing14: string;
101
103
  spacing16: string;
102
104
  spacing20: string;
103
105
  spacing24: string;
@@ -269,6 +271,7 @@ interface RightElementProps {
269
271
  * 텍스트를 기준으로 오른쪽에 위치할 ReactElement를 설정합니다.
270
272
  */
271
273
  rightSource?: ReactElement;
274
+ rightSourceStyle?: CSSProperties;
272
275
  }
273
276
  interface LeftAndRightElementProps extends RightElementProps, LeftElementProps {
274
277
  }
@@ -954,6 +957,8 @@ interface DropdownOptionProps {
954
957
  option?: DropdownOptionVariantType;
955
958
  width?: CSSProperties['width'];
956
959
  disabled?: boolean;
960
+ placement?: Placement;
961
+ offset?: OffsetOptions;
957
962
  }
958
963
  interface DropdownContentProps extends HTMLAttributes<HTMLDivElement>, ChildrenProps {
959
964
  /**
@@ -986,7 +991,7 @@ interface DropdownTriggerButtonProps extends Omit<ButtonHTMLAttributes<HTMLButto
986
991
  }
987
992
 
988
993
  declare const Dropdown: {
989
- ({ isOpen: initialIsOpen, trigger, popper, option, width, }: DropdownProps): react_jsx_runtime.JSX.Element;
994
+ ({ isOpen: initialIsOpen, trigger, popper, option, width, offset, placement, }: DropdownProps): react_jsx_runtime.JSX.Element;
990
995
  Button: React__default.ForwardRefExoticComponent<DropdownTriggerButtonProps & React__default.RefAttributes<HTMLButtonElement>>;
991
996
  Content: ({ children, width: initialWidth, type, onClick, ...rest }: DropdownContentProps) => react_jsx_runtime.JSX.Element;
992
997
  };
package/dist/index.js CHANGED
@@ -399,7 +399,9 @@ var spacing02 = "var(--spacing02)";
399
399
  var spacing04 = "var(--spacing04)";
400
400
  var spacing06 = "var(--spacing06)";
401
401
  var spacing08 = "var(--spacing08)";
402
+ var spacing10 = "var(--spacing10)";
402
403
  var spacing12 = "var(--spacing12)";
404
+ var spacing14 = "var(--spacing14)";
403
405
  var spacing16 = "var(--spacing16)";
404
406
  var spacing20 = "var(--spacing20)";
405
407
  var spacing24 = "var(--spacing24)";
@@ -411,7 +413,9 @@ var spacingTokens = {
411
413
  spacing04,
412
414
  spacing06,
413
415
  spacing08,
416
+ spacing10,
414
417
  spacing12,
418
+ spacing14,
415
419
  spacing16,
416
420
  spacing20,
417
421
  spacing24,
@@ -3234,7 +3238,9 @@ var Dropdown = ({
3234
3238
  trigger,
3235
3239
  popper,
3236
3240
  option = "CLICK",
3237
- width = "100%"
3241
+ width = "100%",
3242
+ offset: offset4 = 4,
3243
+ placement
3238
3244
  }) => {
3239
3245
  const [triggerRef, setTriggerRef] = useState(null);
3240
3246
  const [size2, setSize] = useState({ width: 0, height: 0 });
@@ -3256,8 +3262,9 @@ var Dropdown = ({
3256
3262
  return /* @__PURE__ */ jsx(StyledDropdown, { "data-shoplflow": "Dropdown", width, children: /* @__PURE__ */ jsx(DropdownContext.Provider, { value: __spreadProps(__spreadValues({}, size2), { isOpen, setIsOpen, option }), children: /* @__PURE__ */ jsxs(
3257
3263
  Popper_default,
3258
3264
  {
3259
- offset: 4,
3260
- autoPlacement: {
3265
+ offset: offset4,
3266
+ placement,
3267
+ autoPlacement: placement ? void 0 : {
3261
3268
  allowedPlacements: ["bottom-start", "top-start"]
3262
3269
  },
3263
3270
  children: [
@@ -3603,7 +3610,7 @@ TreeItem[TREE_SYMBOL_KEY] = true;
3603
3610
  Tree.Item = TreeItem;
3604
3611
  var Tree_default = Tree;
3605
3612
  var StyledInput = styled6.input`
3606
- padding: ${({ sizeVar }) => sizeVar === "S" ? "0 0 0 8px" : "4px 0 4px 12px"};
3613
+ padding: ${({ sizeVar }) => sizeVar === "S" ? "0 8px" : "4px 12px"};
3607
3614
  background-color: transparent;
3608
3615
  display: flex;
3609
3616
  min-width: ${({ minWidth }) => minWidth || "64px"};
@@ -3627,6 +3634,7 @@ var StyledInput = styled6.input`
3627
3634
  padding: 4px 8px;
3628
3635
  text-align: center;
3629
3636
  -moz-appearance: textfield;
3637
+ appearance: textfield;
3630
3638
  }
3631
3639
 
3632
3640
  *,
@@ -3636,10 +3644,27 @@ var StyledInput = styled6.input`
3636
3644
  }
3637
3645
  `;
3638
3646
  var RightElementWrapper2 = styled6.div`
3647
+ padding: ${({ sizeVar, type, initialType }) => {
3648
+ if (initialType === "password" || type === "password") {
3649
+ return "0";
3650
+ }
3651
+ return sizeVar === "S" ? "0 8px 0 0" : "0 12px 0 0";
3652
+ }};
3639
3653
  display: flex;
3640
3654
  flex-direction: row;
3641
3655
  align-items: center;
3642
- padding: 0 8px 0 0;
3656
+ height: 100%;
3657
+ `;
3658
+ var ClearIconButton = styled6(StyledIconButton)`
3659
+ position: absolute;
3660
+ right: 2px;
3661
+ top: 50%;
3662
+ transform: translateY(-50%);
3663
+ background-color: ${colorTokens.neutral0} !important;
3664
+
3665
+ &:hover {
3666
+ background-color: ${colorTokens.neutral100} !important;
3667
+ }
3643
3668
  `;
3644
3669
  var Wrapper = styled6.div`
3645
3670
  display: flex;
@@ -3648,9 +3673,9 @@ var Wrapper = styled6.div`
3648
3673
  align-items: center;
3649
3674
  gap: 2px;
3650
3675
  `;
3651
- var TextCounter = ({ currentLength, maxLength }) => {
3676
+ var TextCounter = ({ currentLength, maxLength, isError }) => {
3652
3677
  return /* @__PURE__ */ jsxs(Wrapper, { children: [
3653
- /* @__PURE__ */ jsx(Text_default, { typography: "caption_400", color: "neutral400", children: currentLength }),
3678
+ /* @__PURE__ */ jsx(Text_default, { typography: "caption_400", color: isError ? "red300" : "neutral400", children: currentLength }),
3654
3679
  /* @__PURE__ */ jsx(Text_default, { typography: "caption_400", color: "neutral350", children: "/" }),
3655
3680
  /* @__PURE__ */ jsx(Text_default, { typography: "caption_400", color: "neutral350", children: maxLength })
3656
3681
  ] });
@@ -3732,7 +3757,6 @@ var InputWrapper = styled6.label`
3732
3757
  borderRadius
3733
3758
  })};
3734
3759
  justify-content: space-between;
3735
- gap: ${({ gap, sizeVar }) => gap || (sizeVar === "S" ? "4px" : "8px")};
3736
3760
  border: 1px solid ${(props) => getBorderColorByStatus2(props)};
3737
3761
  background-color: ${colorTokens.neutral0};
3738
3762
  overflow: hidden;
@@ -3776,7 +3800,8 @@ var Input = forwardRef(
3776
3800
  rightSource,
3777
3801
  minWidth,
3778
3802
  gap,
3779
- initIsFocused
3803
+ initIsFocused,
3804
+ rightSourceStyle
3780
3805
  } = _b, rest = __objRest(_b, [
3781
3806
  "onFocus",
3782
3807
  "onBlur",
@@ -3799,7 +3824,8 @@ var Input = forwardRef(
3799
3824
  "rightSource",
3800
3825
  "minWidth",
3801
3826
  "gap",
3802
- "initIsFocused"
3827
+ "initIsFocused",
3828
+ "rightSourceStyle"
3803
3829
  ]);
3804
3830
  const [text, setText] = useState("");
3805
3831
  const [isFocused, setIsFocused] = useState(Boolean(initIsFocused));
@@ -3916,36 +3942,38 @@ var Input = forwardRef(
3916
3942
  gap,
3917
3943
  sizeVar,
3918
3944
  children: [
3919
- /* @__PURE__ */ jsx(
3920
- StyledInput,
3921
- __spreadValues({
3922
- onFocus: handleOnFocus,
3923
- onBlur: handleOnBlur,
3924
- onChange: handleOnChange,
3925
- onKeyDown: handleOnKeyDown,
3926
- maxLength,
3927
- disabled,
3928
- value: text,
3929
- type,
3930
- id: uniqueId,
3931
- ref: refs,
3932
- minWidth,
3933
- sizeVar,
3934
- className: "body1_400" + (className ? ` ${className}` : "")
3935
- }, rest)
3936
- ),
3937
- !(type === "number") && /* @__PURE__ */ jsxs(RightElementWrapper2, { children: [
3938
- maxLength && isFocused && /* @__PURE__ */ jsx(TextCounter_default, { currentLength: String(text).length, maxLength }),
3939
- onClear && 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: "neutral350" }) }),
3940
- initialType === "password" && /* @__PURE__ */ jsx(IconButton_default, { sizeVar: "S", onClick: handleTogglePasswordType, styleVar: "GHOST", children: /* @__PURE__ */ jsx(
3945
+ /* @__PURE__ */ jsxs("div", { style: { position: "relative", width: "100%" }, children: [
3946
+ /* @__PURE__ */ jsx(
3947
+ StyledInput,
3948
+ __spreadValues({
3949
+ onFocus: handleOnFocus,
3950
+ onBlur: handleOnBlur,
3951
+ onChange: handleOnChange,
3952
+ onKeyDown: handleOnKeyDown,
3953
+ maxLength,
3954
+ disabled,
3955
+ value: text,
3956
+ type,
3957
+ id: uniqueId,
3958
+ ref: refs,
3959
+ minWidth,
3960
+ sizeVar,
3961
+ className: "body1_400" + (className ? ` ${className}` : "")
3962
+ }, rest)
3963
+ ),
3964
+ onClear && isHovered && Boolean(String(text).length > 0) && /* @__PURE__ */ jsx(ClearIconButton, { sizeVar, onClick: handleOnClear, styleVar: "GHOST", isHovered: false, children: /* @__PURE__ */ jsx(Icon_default, { iconSource: assetFunction("DeleteIcon"), color: "neutral350" }) })
3965
+ ] }),
3966
+ !(type === "number") && (Boolean(maxLength && isFocused) || Boolean(initialType === "password") || Boolean(rightSource)) && /* @__PURE__ */ jsxs(RightElementWrapper2, { type, sizeVar, initialType, style: rightSourceStyle, children: [
3967
+ maxLength && isFocused && /* @__PURE__ */ jsx(TextCounter_default, { currentLength: String(text).length, maxLength, isError }),
3968
+ initialType === "password" && /* @__PURE__ */ jsx(IconButton_default, { sizeVar, onClick: handleTogglePasswordType, styleVar: "GHOST", children: /* @__PURE__ */ jsx(
3941
3969
  Icon_default,
3942
3970
  {
3943
3971
  color: "neutral600",
3944
3972
  iconSource: assetFunction(type === "password" ? "ViewOffIcon" : "ViewOnIcon")
3945
3973
  }
3946
- ) })
3947
- ] }),
3948
- rightSource && rightSource
3974
+ ) }),
3975
+ rightSource && rightSource
3976
+ ] })
3949
3977
  ]
3950
3978
  }
3951
3979
  );
@@ -6627,13 +6655,20 @@ var NumberCombobox = (_a) => {
6627
6655
  sizeVar,
6628
6656
  width,
6629
6657
  ref: inputRef,
6630
- type: "number",
6658
+ type: "text",
6659
+ inputMode: "numeric",
6631
6660
  style: { textAlign: "left", paddingRight: "0px" },
6632
6661
  className: _className,
6633
6662
  gap: "4px",
6634
6663
  initIsFocused: isOpen,
6635
6664
  value,
6636
- onChange,
6665
+ onChange: (e) => {
6666
+ const numericValue = e.target.value.replace(/[^\d]/g, "");
6667
+ if (e.target.value !== numericValue) {
6668
+ e.target.value = numericValue;
6669
+ }
6670
+ onChange == null ? void 0 : onChange(e);
6671
+ },
6637
6672
  onFocus: () => {
6638
6673
  setIsOpen(true);
6639
6674
  },
@@ -6680,7 +6715,8 @@ var NumberCombobox = (_a) => {
6680
6715
  }
6681
6716
  onBlur == null ? void 0 : onBlur(event);
6682
6717
  },
6683
- rightSource: /* @__PURE__ */ jsx(StackContainer_default.Horizontal, { padding: "0px 4px 0px 0px", children: /* @__PURE__ */ jsx(
6718
+ rightSourceStyle: { padding: "4px" },
6719
+ rightSource: /* @__PURE__ */ jsx(StackContainer_default.Horizontal, { children: /* @__PURE__ */ jsx(
6684
6720
  IconButton_default,
6685
6721
  {
6686
6722
  sizeVar: "XS",
@@ -16,7 +16,9 @@
16
16
  --spacing04: 4px;
17
17
  --spacing06: 6px;
18
18
  --spacing08: 8px;
19
+ --spacing10: 10px;
19
20
  --spacing12: 12px;
21
+ --spacing14: 14px;
20
22
  --spacing16: 16px;
21
23
  --spacing20: 20px;
22
24
  --spacing24: 24px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shoplflow/base",
3
- "version": "0.45.12",
3
+ "version": "0.45.14",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -99,8 +99,8 @@
99
99
  "react-dom": "^18.2.0",
100
100
  "simplebar-react": "^3.2.6",
101
101
  "@shoplflow/hada-assets": "^0.1.10",
102
- "@shoplflow/shopl-assets": "^0.12.33",
103
- "@shoplflow/utils": "^0.7.2"
102
+ "@shoplflow/utils": "^0.7.2",
103
+ "@shoplflow/shopl-assets": "^0.12.33"
104
104
  },
105
105
  "homepage": "https://github.com/shopl/shoplflow#readme",
106
106
  "scripts": {