@shoplflow/base 0.31.19 → 0.31.21

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
@@ -1745,7 +1745,8 @@ var IconButton = React3.forwardRef(
1745
1745
  color,
1746
1746
  onMouseEnter,
1747
1747
  onMouseLeave,
1748
- isLoading = false
1748
+ isLoading = false,
1749
+ type = "button"
1749
1750
  } = _b, rest = __objRest(_b, [
1750
1751
  "styleVar",
1751
1752
  "sizeVar",
@@ -1754,7 +1755,8 @@ var IconButton = React3.forwardRef(
1754
1755
  "color",
1755
1756
  "onMouseEnter",
1756
1757
  "onMouseLeave",
1757
- "isLoading"
1758
+ "isLoading",
1759
+ "type"
1758
1760
  ]);
1759
1761
  const [isHovered, setIsHovered] = React3.useState(false);
1760
1762
  const handleOnMouseEnter = (e) => {
@@ -1775,7 +1777,8 @@ var IconButton = React3.forwardRef(
1775
1777
  ref,
1776
1778
  onMouseEnter: handleOnMouseEnter,
1777
1779
  onMouseLeave: handleOnMouseLeave,
1778
- isHovered
1780
+ isHovered,
1781
+ type
1779
1782
  }, rest), {
1780
1783
  "data-shoplflow": "IconButton",
1781
1784
  children: isLoading ? /* @__PURE__ */ jsxRuntime.jsx(LoadingSpinner_default, { color: styleVar === "SECONDARY" || styleVar === "GHOST" ? "neutral500" : "neutral0" }) : children
@@ -3112,7 +3115,8 @@ var Input = React3.forwardRef(
3112
3115
  className,
3113
3116
  width,
3114
3117
  borderRadius,
3115
- customNumberInputHeight
3118
+ customNumberInputHeight,
3119
+ onKeyDown
3116
3120
  } = _b, rest = __objRest(_b, [
3117
3121
  "onFocus",
3118
3122
  "onBlur",
@@ -3129,7 +3133,8 @@ var Input = React3.forwardRef(
3129
3133
  "className",
3130
3134
  "width",
3131
3135
  "borderRadius",
3132
- "customNumberInputHeight"
3136
+ "customNumberInputHeight",
3137
+ "onKeyDown"
3133
3138
  ]);
3134
3139
  const [text, setText] = React3.useState("");
3135
3140
  const [isFocused, setIsFocused] = React3.useState(false);
@@ -3165,7 +3170,12 @@ var Input = React3.forwardRef(
3165
3170
  };
3166
3171
  const handleOnBlur = (event) => {
3167
3172
  onBlur && onBlur(event);
3168
- setIsFocused(false);
3173
+ };
3174
+ const handleOnKeyDown = (event) => {
3175
+ if (event.code === "Tab") {
3176
+ setIsFocused(false);
3177
+ }
3178
+ onKeyDown && onKeyDown(event);
3169
3179
  };
3170
3180
  const handleOnChange = (event) => {
3171
3181
  onChange && onChange(event);
@@ -3237,6 +3247,7 @@ var Input = React3.forwardRef(
3237
3247
  onFocus: handleOnFocus,
3238
3248
  onBlur: handleOnBlur,
3239
3249
  onChange: handleOnChange,
3250
+ onKeyDown: handleOnKeyDown,
3240
3251
  maxLength,
3241
3252
  disabled,
3242
3253
  value: text,
@@ -5709,6 +5720,57 @@ var WeekDatepicker = ({
5709
5720
  ] });
5710
5721
  };
5711
5722
  exports.WeekDatepicker = WeekDatepicker;
5723
+ var Title = ({
5724
+ title,
5725
+ titleTypography = "body1_700",
5726
+ titleColor = "neutral700",
5727
+ total,
5728
+ description,
5729
+ tooltipPlacement = "right",
5730
+ isRequired,
5731
+ isShowHelpIcon,
5732
+ tooltipOffsetValue,
5733
+ tooltipMessage = "",
5734
+ rightSource
5735
+ }) => {
5736
+ const domain = exports.getDomain();
5737
+ const descriptionTypography = domain === "hada" ? "body2_400" : "body1_400";
5738
+ return /* @__PURE__ */ jsxRuntime.jsxs(exports.Stack.Vertical, { width: "100%", children: [
5739
+ /* @__PURE__ */ jsxRuntime.jsxs(
5740
+ exports.StackContainer,
5741
+ {
5742
+ direction: "row",
5743
+ align: "center",
5744
+ width: "100%",
5745
+ minHeight: "40px",
5746
+ height: "auto",
5747
+ justify: "space-between",
5748
+ children: [
5749
+ /* @__PURE__ */ jsxRuntime.jsxs(exports.Stack.Horizontal, { align: "center", spacing: "spacing04", children: [
5750
+ /* @__PURE__ */ jsxRuntime.jsxs(exports.Text, { color: titleColor, typography: titleTypography, wordBreak: "break-all", children: [
5751
+ title,
5752
+ " ",
5753
+ isRequired && /* @__PURE__ */ jsxRuntime.jsx(exports.Text, { typography: "body1_700", color: "red300", children: "*" })
5754
+ ] }),
5755
+ /* @__PURE__ */ jsxRuntime.jsx(exports.Text, { color: "primary300", typography: "body1_700", children: total }),
5756
+ isShowHelpIcon && /* @__PURE__ */ jsxRuntime.jsx(
5757
+ exports.Tooltip,
5758
+ {
5759
+ placement: tooltipPlacement,
5760
+ offset: tooltipOffsetValue,
5761
+ trigger: /* @__PURE__ */ jsxRuntime.jsx(ShoplAssets.HelpIcon, { width: 20, height: 20 }),
5762
+ popper: /* @__PURE__ */ jsxRuntime.jsx(exports.Tooltip.Content, { content: tooltipMessage })
5763
+ }
5764
+ )
5765
+ ] }),
5766
+ rightSource && rightSource
5767
+ ]
5768
+ }
5769
+ ),
5770
+ description && /* @__PURE__ */ jsxRuntime.jsx(exports.StackContainer, { minHeight: "30px", height: "auto", children: /* @__PURE__ */ jsxRuntime.jsx(exports.Text, { typography: descriptionTypography, color: "neutral500", wordBreak: "break-all", children: description }) })
5771
+ ] });
5772
+ };
5773
+ exports.Title = Title;
5712
5774
  var SpaceMarginWrapper = styled6__default.default(framerMotion.motion.div)`
5713
5775
  position: relative;
5714
5776
  display: flex;