@shoplflow/base 0.23.0 → 0.23.2
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 +93 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +33 -1
- package/dist/index.d.ts +33 -1
- package/dist/index.js +94 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -588,7 +588,11 @@ exports.AvatarSizeVariants = {
|
|
|
588
588
|
exports.StyledStack = styled6__default.default.div`
|
|
589
589
|
display: flex;
|
|
590
590
|
width: ${({ width }) => width};
|
|
591
|
+
max-width: ${({ maxWidth }) => maxWidth};
|
|
592
|
+
min-width: ${({ minWidth }) => minWidth};
|
|
591
593
|
height: ${({ height }) => height};
|
|
594
|
+
max-height: ${({ maxHeight }) => maxHeight};
|
|
595
|
+
min-height: ${({ minHeight }) => minHeight};
|
|
592
596
|
flex-direction: ${({ direction }) => direction};
|
|
593
597
|
align-items: ${({ align }) => align};
|
|
594
598
|
justify-content: ${({ justify }) => justify};
|
|
@@ -2737,6 +2741,95 @@ var TextArea = React3.forwardRef(
|
|
|
2737
2741
|
}
|
|
2738
2742
|
);
|
|
2739
2743
|
exports.TextArea = TextArea;
|
|
2744
|
+
var StyledSelectInputButton = styled6__default.default.div`
|
|
2745
|
+
display: flex;
|
|
2746
|
+
flex-direction: row;
|
|
2747
|
+
align-items: center;
|
|
2748
|
+
justify-content: space-between;
|
|
2749
|
+
width: 100%;
|
|
2750
|
+
background: ${exports.colorTokens.neutral0};
|
|
2751
|
+
gap: 4px;
|
|
2752
|
+
padding: 4px 4px 4px 12px;
|
|
2753
|
+
cursor: pointer;
|
|
2754
|
+
${({ disabled }) => disabled && react$1.css`
|
|
2755
|
+
background-color: ${exports.colorTokens.neutral100};
|
|
2756
|
+
cursor: not-allowed;
|
|
2757
|
+
`}
|
|
2758
|
+
`;
|
|
2759
|
+
var SelectInputButton = (_a) => {
|
|
2760
|
+
var _b = _a, {
|
|
2761
|
+
disabled,
|
|
2762
|
+
isSelected,
|
|
2763
|
+
onMouseEnter,
|
|
2764
|
+
onMouseLeave,
|
|
2765
|
+
onClick,
|
|
2766
|
+
onClear,
|
|
2767
|
+
value,
|
|
2768
|
+
placeholder,
|
|
2769
|
+
label,
|
|
2770
|
+
width,
|
|
2771
|
+
rightSource
|
|
2772
|
+
} = _b, rest = __objRest(_b, [
|
|
2773
|
+
"disabled",
|
|
2774
|
+
"isSelected",
|
|
2775
|
+
"onMouseEnter",
|
|
2776
|
+
"onMouseLeave",
|
|
2777
|
+
"onClick",
|
|
2778
|
+
"onClear",
|
|
2779
|
+
"value",
|
|
2780
|
+
"placeholder",
|
|
2781
|
+
"label",
|
|
2782
|
+
"width",
|
|
2783
|
+
"rightSource"
|
|
2784
|
+
]);
|
|
2785
|
+
const [isHovered, setIsHovered] = React3.useState(false);
|
|
2786
|
+
const handleOnClick = (e) => {
|
|
2787
|
+
e.preventDefault();
|
|
2788
|
+
if (!disabled) {
|
|
2789
|
+
onClick && onClick(e);
|
|
2790
|
+
}
|
|
2791
|
+
};
|
|
2792
|
+
const handleOnClear = (e) => {
|
|
2793
|
+
e.stopPropagation();
|
|
2794
|
+
if (!disabled) {
|
|
2795
|
+
onClear && onClear(e);
|
|
2796
|
+
}
|
|
2797
|
+
};
|
|
2798
|
+
const handleOnMouseEnter = (e) => {
|
|
2799
|
+
setIsHovered(true);
|
|
2800
|
+
onMouseEnter && onMouseEnter(e);
|
|
2801
|
+
};
|
|
2802
|
+
const handleOnMouseLeave = (e) => {
|
|
2803
|
+
setIsHovered(false);
|
|
2804
|
+
onMouseLeave && onMouseLeave(e);
|
|
2805
|
+
};
|
|
2806
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2807
|
+
InputWrapper,
|
|
2808
|
+
__spreadProps(__spreadValues({
|
|
2809
|
+
onMouseEnter: handleOnMouseEnter,
|
|
2810
|
+
onMouseLeave: handleOnMouseLeave,
|
|
2811
|
+
onClick: handleOnClick,
|
|
2812
|
+
isHovered,
|
|
2813
|
+
isFocused: isSelected,
|
|
2814
|
+
disabled,
|
|
2815
|
+
width
|
|
2816
|
+
}, rest), {
|
|
2817
|
+
"data-shoplflow": "SelectInputButton",
|
|
2818
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(StyledSelectInputButton, { children: [
|
|
2819
|
+
value && value.length > 0 && label ? /* @__PURE__ */ jsxRuntime.jsx(exports.Text, { typography: "body1_400", children: value[0][label] }) : /* @__PURE__ */ jsxRuntime.jsx(exports.Text, { typography: "body1_400", color: "neutral350", children: placeholder }),
|
|
2820
|
+
/* @__PURE__ */ jsxRuntime.jsxs(exports.Stack.Horizontal, { align: "center", children: [
|
|
2821
|
+
value && value.length > 1 && /* @__PURE__ */ jsxRuntime.jsxs(exports.Text, { typography: "body1_400", color: "neutral700", children: [
|
|
2822
|
+
"+",
|
|
2823
|
+
value.length - 1
|
|
2824
|
+
] }),
|
|
2825
|
+
value && value.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(exports.IconButton, { sizeVar: "S", onClick: handleOnClear, styleVar: "GHOST", disabled, children: /* @__PURE__ */ jsxRuntime.jsx(exports.Icon, { iconSource: assetFunction("DeleteIcon"), color: "neutral350" }) }),
|
|
2826
|
+
rightSource
|
|
2827
|
+
] })
|
|
2828
|
+
] })
|
|
2829
|
+
})
|
|
2830
|
+
);
|
|
2831
|
+
};
|
|
2832
|
+
exports.SelectInputButton = SelectInputButton;
|
|
2740
2833
|
var Container2 = styled6__default.default.div`
|
|
2741
2834
|
width: 32px;
|
|
2742
2835
|
height: 32px;
|