@shoplflow/base 0.45.12 → 0.45.13

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
@@ -3630,7 +3630,7 @@ exports.TreeItem[exports.TREE_SYMBOL_KEY] = true;
3630
3630
  Tree.Item = exports.TreeItem;
3631
3631
  exports.Tree = Tree;
3632
3632
  var StyledInput = styled6__default.default.input`
3633
- padding: ${({ sizeVar }) => sizeVar === "S" ? "0 0 0 8px" : "4px 0 4px 12px"};
3633
+ padding: ${({ sizeVar }) => sizeVar === "S" ? "0 8px" : "4px 12px"};
3634
3634
  background-color: transparent;
3635
3635
  display: flex;
3636
3636
  min-width: ${({ minWidth }) => minWidth || "64px"};
@@ -3654,6 +3654,7 @@ var StyledInput = styled6__default.default.input`
3654
3654
  padding: 4px 8px;
3655
3655
  text-align: center;
3656
3656
  -moz-appearance: textfield;
3657
+ appearance: textfield;
3657
3658
  }
3658
3659
 
3659
3660
  *,
@@ -3663,10 +3664,27 @@ var StyledInput = styled6__default.default.input`
3663
3664
  }
3664
3665
  `;
3665
3666
  var RightElementWrapper2 = styled6__default.default.div`
3667
+ padding: ${({ sizeVar, type, initialType }) => {
3668
+ if (initialType === "password" || type === "password") {
3669
+ return "0";
3670
+ }
3671
+ return sizeVar === "S" ? "0 8px 0 0" : "0 12px 0 0";
3672
+ }};
3666
3673
  display: flex;
3667
3674
  flex-direction: row;
3668
3675
  align-items: center;
3669
- padding: 0 8px 0 0;
3676
+ height: 100%;
3677
+ `;
3678
+ var ClearIconButton = styled6__default.default(StyledIconButton)`
3679
+ position: absolute;
3680
+ right: 2px;
3681
+ top: 50%;
3682
+ transform: translateY(-50%);
3683
+ background-color: ${exports.colorTokens.neutral0} !important;
3684
+
3685
+ &:hover {
3686
+ background-color: ${exports.colorTokens.neutral100} !important;
3687
+ }
3670
3688
  `;
3671
3689
  var Wrapper = styled6__default.default.div`
3672
3690
  display: flex;
@@ -3675,9 +3693,9 @@ var Wrapper = styled6__default.default.div`
3675
3693
  align-items: center;
3676
3694
  gap: 2px;
3677
3695
  `;
3678
- var TextCounter = ({ currentLength, maxLength }) => {
3696
+ var TextCounter = ({ currentLength, maxLength, isError }) => {
3679
3697
  return /* @__PURE__ */ jsxRuntime.jsxs(Wrapper, { children: [
3680
- /* @__PURE__ */ jsxRuntime.jsx(exports.Text, { typography: "caption_400", color: "neutral400", children: currentLength }),
3698
+ /* @__PURE__ */ jsxRuntime.jsx(exports.Text, { typography: "caption_400", color: isError ? "red300" : "neutral400", children: currentLength }),
3681
3699
  /* @__PURE__ */ jsxRuntime.jsx(exports.Text, { typography: "caption_400", color: "neutral350", children: "/" }),
3682
3700
  /* @__PURE__ */ jsxRuntime.jsx(exports.Text, { typography: "caption_400", color: "neutral350", children: maxLength })
3683
3701
  ] });
@@ -3759,7 +3777,6 @@ var InputWrapper = styled6__default.default.label`
3759
3777
  borderRadius
3760
3778
  })};
3761
3779
  justify-content: space-between;
3762
- gap: ${({ gap, sizeVar }) => gap || (sizeVar === "S" ? "4px" : "8px")};
3763
3780
  border: 1px solid ${(props) => getBorderColorByStatus2(props)};
3764
3781
  background-color: ${exports.colorTokens.neutral0};
3765
3782
  overflow: hidden;
@@ -3943,36 +3960,38 @@ var Input = React3.forwardRef(
3943
3960
  gap,
3944
3961
  sizeVar,
3945
3962
  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(
3963
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { position: "relative", width: "100%" }, children: [
3964
+ /* @__PURE__ */ jsxRuntime.jsx(
3965
+ StyledInput,
3966
+ __spreadValues({
3967
+ onFocus: handleOnFocus,
3968
+ onBlur: handleOnBlur,
3969
+ onChange: handleOnChange,
3970
+ onKeyDown: handleOnKeyDown,
3971
+ maxLength,
3972
+ disabled,
3973
+ value: text,
3974
+ type,
3975
+ id: uniqueId,
3976
+ ref: refs,
3977
+ minWidth,
3978
+ sizeVar,
3979
+ className: "body1_400" + (className ? ` ${className}` : "")
3980
+ }, rest)
3981
+ ),
3982
+ 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" }) })
3983
+ ] }),
3984
+ !(type === "number") && (Boolean(maxLength && isFocused) || Boolean(initialType === "password") || Boolean(rightSource)) && /* @__PURE__ */ jsxRuntime.jsxs(RightElementWrapper2, { type, sizeVar, initialType, children: [
3985
+ maxLength && isFocused && /* @__PURE__ */ jsxRuntime.jsx(TextCounter_default, { currentLength: String(text).length, maxLength, isError }),
3986
+ initialType === "password" && /* @__PURE__ */ jsxRuntime.jsx(exports.IconButton, { sizeVar, onClick: handleTogglePasswordType, styleVar: "GHOST", children: /* @__PURE__ */ jsxRuntime.jsx(
3968
3987
  exports.Icon,
3969
3988
  {
3970
3989
  color: "neutral600",
3971
3990
  iconSource: assetFunction(type === "password" ? "ViewOffIcon" : "ViewOnIcon")
3972
3991
  }
3973
- ) })
3974
- ] }),
3975
- rightSource && rightSource
3992
+ ) }),
3993
+ rightSource && rightSource
3994
+ ] })
3976
3995
  ]
3977
3996
  }
3978
3997
  );
package/dist/index.js CHANGED
@@ -3603,7 +3603,7 @@ TreeItem[TREE_SYMBOL_KEY] = true;
3603
3603
  Tree.Item = TreeItem;
3604
3604
  var Tree_default = Tree;
3605
3605
  var StyledInput = styled6.input`
3606
- padding: ${({ sizeVar }) => sizeVar === "S" ? "0 0 0 8px" : "4px 0 4px 12px"};
3606
+ padding: ${({ sizeVar }) => sizeVar === "S" ? "0 8px" : "4px 12px"};
3607
3607
  background-color: transparent;
3608
3608
  display: flex;
3609
3609
  min-width: ${({ minWidth }) => minWidth || "64px"};
@@ -3627,6 +3627,7 @@ var StyledInput = styled6.input`
3627
3627
  padding: 4px 8px;
3628
3628
  text-align: center;
3629
3629
  -moz-appearance: textfield;
3630
+ appearance: textfield;
3630
3631
  }
3631
3632
 
3632
3633
  *,
@@ -3636,10 +3637,27 @@ var StyledInput = styled6.input`
3636
3637
  }
3637
3638
  `;
3638
3639
  var RightElementWrapper2 = styled6.div`
3640
+ padding: ${({ sizeVar, type, initialType }) => {
3641
+ if (initialType === "password" || type === "password") {
3642
+ return "0";
3643
+ }
3644
+ return sizeVar === "S" ? "0 8px 0 0" : "0 12px 0 0";
3645
+ }};
3639
3646
  display: flex;
3640
3647
  flex-direction: row;
3641
3648
  align-items: center;
3642
- padding: 0 8px 0 0;
3649
+ height: 100%;
3650
+ `;
3651
+ var ClearIconButton = styled6(StyledIconButton)`
3652
+ position: absolute;
3653
+ right: 2px;
3654
+ top: 50%;
3655
+ transform: translateY(-50%);
3656
+ background-color: ${colorTokens.neutral0} !important;
3657
+
3658
+ &:hover {
3659
+ background-color: ${colorTokens.neutral100} !important;
3660
+ }
3643
3661
  `;
3644
3662
  var Wrapper = styled6.div`
3645
3663
  display: flex;
@@ -3648,9 +3666,9 @@ var Wrapper = styled6.div`
3648
3666
  align-items: center;
3649
3667
  gap: 2px;
3650
3668
  `;
3651
- var TextCounter = ({ currentLength, maxLength }) => {
3669
+ var TextCounter = ({ currentLength, maxLength, isError }) => {
3652
3670
  return /* @__PURE__ */ jsxs(Wrapper, { children: [
3653
- /* @__PURE__ */ jsx(Text_default, { typography: "caption_400", color: "neutral400", children: currentLength }),
3671
+ /* @__PURE__ */ jsx(Text_default, { typography: "caption_400", color: isError ? "red300" : "neutral400", children: currentLength }),
3654
3672
  /* @__PURE__ */ jsx(Text_default, { typography: "caption_400", color: "neutral350", children: "/" }),
3655
3673
  /* @__PURE__ */ jsx(Text_default, { typography: "caption_400", color: "neutral350", children: maxLength })
3656
3674
  ] });
@@ -3732,7 +3750,6 @@ var InputWrapper = styled6.label`
3732
3750
  borderRadius
3733
3751
  })};
3734
3752
  justify-content: space-between;
3735
- gap: ${({ gap, sizeVar }) => gap || (sizeVar === "S" ? "4px" : "8px")};
3736
3753
  border: 1px solid ${(props) => getBorderColorByStatus2(props)};
3737
3754
  background-color: ${colorTokens.neutral0};
3738
3755
  overflow: hidden;
@@ -3916,36 +3933,38 @@ var Input = forwardRef(
3916
3933
  gap,
3917
3934
  sizeVar,
3918
3935
  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(
3936
+ /* @__PURE__ */ jsxs("div", { style: { position: "relative", width: "100%" }, children: [
3937
+ /* @__PURE__ */ jsx(
3938
+ StyledInput,
3939
+ __spreadValues({
3940
+ onFocus: handleOnFocus,
3941
+ onBlur: handleOnBlur,
3942
+ onChange: handleOnChange,
3943
+ onKeyDown: handleOnKeyDown,
3944
+ maxLength,
3945
+ disabled,
3946
+ value: text,
3947
+ type,
3948
+ id: uniqueId,
3949
+ ref: refs,
3950
+ minWidth,
3951
+ sizeVar,
3952
+ className: "body1_400" + (className ? ` ${className}` : "")
3953
+ }, rest)
3954
+ ),
3955
+ 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" }) })
3956
+ ] }),
3957
+ !(type === "number") && (Boolean(maxLength && isFocused) || Boolean(initialType === "password") || Boolean(rightSource)) && /* @__PURE__ */ jsxs(RightElementWrapper2, { type, sizeVar, initialType, children: [
3958
+ maxLength && isFocused && /* @__PURE__ */ jsx(TextCounter_default, { currentLength: String(text).length, maxLength, isError }),
3959
+ initialType === "password" && /* @__PURE__ */ jsx(IconButton_default, { sizeVar, onClick: handleTogglePasswordType, styleVar: "GHOST", children: /* @__PURE__ */ jsx(
3941
3960
  Icon_default,
3942
3961
  {
3943
3962
  color: "neutral600",
3944
3963
  iconSource: assetFunction(type === "password" ? "ViewOffIcon" : "ViewOnIcon")
3945
3964
  }
3946
- ) })
3947
- ] }),
3948
- rightSource && rightSource
3965
+ ) }),
3966
+ rightSource && rightSource
3967
+ ] })
3949
3968
  ]
3950
3969
  }
3951
3970
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shoplflow/base",
3
- "version": "0.45.12",
3
+ "version": "0.45.13",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {