@shoplflow/base 0.25.1 → 0.25.3
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 +40 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +19 -2
- package/dist/index.d.ts +19 -2
- package/dist/index.js +43 -11
- package/dist/index.js.map +1 -1
- package/dist/styles/global.css +11 -0
- package/dist/styles/global.css.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -396,6 +396,7 @@ exports.colorTokens = {
|
|
|
396
396
|
primary300,
|
|
397
397
|
primary400
|
|
398
398
|
};
|
|
399
|
+
var spacing02 = "var(--spacing02)";
|
|
399
400
|
var spacing04 = "var(--spacing04)";
|
|
400
401
|
var spacing06 = "var(--spacing06)";
|
|
401
402
|
var spacing08 = "var(--spacing08)";
|
|
@@ -407,6 +408,7 @@ var spacing30 = "var(--spacing30)";
|
|
|
407
408
|
var spacing32 = "var(--spacing32)";
|
|
408
409
|
var spacing40 = "var(--spacing40)";
|
|
409
410
|
exports.spacingTokens = {
|
|
411
|
+
spacing02,
|
|
410
412
|
spacing04,
|
|
411
413
|
spacing06,
|
|
412
414
|
spacing08,
|
|
@@ -443,6 +445,8 @@ var body3_400 = ".body3_400";
|
|
|
443
445
|
var body3_500 = ".body3_500";
|
|
444
446
|
var caption_700 = ".caption_700";
|
|
445
447
|
var caption_400 = ".caption_400";
|
|
448
|
+
var paragraph1 = ".paragraph1";
|
|
449
|
+
var paragraph2 = ".paragraph2";
|
|
446
450
|
exports.typographyTokens = {
|
|
447
451
|
heading1_700,
|
|
448
452
|
heading1_400,
|
|
@@ -464,7 +468,9 @@ exports.typographyTokens = {
|
|
|
464
468
|
body3_400,
|
|
465
469
|
body3_500,
|
|
466
470
|
caption_700,
|
|
467
|
-
caption_400
|
|
471
|
+
caption_400,
|
|
472
|
+
paragraph1,
|
|
473
|
+
paragraph2
|
|
468
474
|
};
|
|
469
475
|
|
|
470
476
|
// src/components/Stack/Stack.styled.ts
|
|
@@ -790,10 +796,36 @@ var ModalFooter = ({ children }) => {
|
|
|
790
796
|
};
|
|
791
797
|
ModalFooter[exports.MODAL_FOOTER_KEY] = true;
|
|
792
798
|
var ModalFooter_default = ModalFooter;
|
|
793
|
-
var ScrollArea = (_a) => {
|
|
799
|
+
var ScrollArea = React2.forwardRef((_a, ref) => {
|
|
794
800
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
|
795
|
-
|
|
796
|
-
|
|
801
|
+
const scrollRef = React2.useRef(null);
|
|
802
|
+
const mergeRef = utils.useMergeRefs(scrollRef, ref);
|
|
803
|
+
const [windowWidth, setWindowWidth] = React2.useState(window.innerWidth);
|
|
804
|
+
const [windowHeight, setWindowHeight] = React2.useState(window.innerHeight);
|
|
805
|
+
const onResize = React2.useCallback(() => {
|
|
806
|
+
setWindowWidth(window.innerWidth);
|
|
807
|
+
setWindowHeight(window.innerHeight);
|
|
808
|
+
}, []);
|
|
809
|
+
React2.useEffect(() => {
|
|
810
|
+
window.addEventListener("resize", onResize);
|
|
811
|
+
return () => {
|
|
812
|
+
window.removeEventListener("resize", onResize);
|
|
813
|
+
};
|
|
814
|
+
}, [onResize]);
|
|
815
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: Boolean(windowWidth) && Boolean(windowHeight) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
816
|
+
Scrollbars__default.default,
|
|
817
|
+
__spreadProps(__spreadValues(__spreadProps(__spreadValues({
|
|
818
|
+
ref: mergeRef
|
|
819
|
+
}, rest), {
|
|
820
|
+
autoHide: true,
|
|
821
|
+
autoHideTimeout: 1e3,
|
|
822
|
+
autoHideDuration: 200
|
|
823
|
+
}), rest), {
|
|
824
|
+
"data-shoplflow": "ScrollArea",
|
|
825
|
+
children
|
|
826
|
+
})
|
|
827
|
+
) });
|
|
828
|
+
});
|
|
797
829
|
exports.ScrollArea = ScrollArea;
|
|
798
830
|
var ModalBody = ({
|
|
799
831
|
children,
|
|
@@ -1695,7 +1727,7 @@ function mergeRefs(...refs) {
|
|
|
1695
1727
|
});
|
|
1696
1728
|
};
|
|
1697
1729
|
}
|
|
1698
|
-
function
|
|
1730
|
+
function useMergeRefs2(...refs) {
|
|
1699
1731
|
return React2.useMemo(() => mergeRefs(...refs), refs);
|
|
1700
1732
|
}
|
|
1701
1733
|
var Popper = ({
|
|
@@ -1731,7 +1763,7 @@ exports.PopperTrigger = React2.forwardRef(
|
|
|
1731
1763
|
(_a, ref) => {
|
|
1732
1764
|
var _b = _a, { children, isOpen = false } = _b, rest = __objRest(_b, ["children", "isOpen"]);
|
|
1733
1765
|
const { setReference, setIsOpen } = usePopper();
|
|
1734
|
-
const refs =
|
|
1766
|
+
const refs = useMergeRefs2(ref, setReference);
|
|
1735
1767
|
React2.useEffect(() => {
|
|
1736
1768
|
setIsOpen(isOpen);
|
|
1737
1769
|
}, [isOpen, setIsOpen]);
|
|
@@ -1742,7 +1774,7 @@ exports.PopperPortal = React2.forwardRef(
|
|
|
1742
1774
|
({ children, animation: initialAnimation }, ref) => {
|
|
1743
1775
|
const { floatingStyles, setFloating, isOpen } = usePopper();
|
|
1744
1776
|
const animation = initialAnimation != null ? initialAnimation : fadeInOut;
|
|
1745
|
-
const refs =
|
|
1777
|
+
const refs = useMergeRefs2(ref, setFloating);
|
|
1746
1778
|
if (!isOpen) {
|
|
1747
1779
|
return null;
|
|
1748
1780
|
}
|
|
@@ -2758,7 +2790,7 @@ var Input = React2.forwardRef(
|
|
|
2758
2790
|
const [isHovered, setIsHovered] = React2.useState(false);
|
|
2759
2791
|
const uniqueId = React2.useId();
|
|
2760
2792
|
const inputRef = React2__namespace.default.useRef(null);
|
|
2761
|
-
const refs =
|
|
2793
|
+
const refs = useMergeRefs2(ref, inputRef);
|
|
2762
2794
|
const convertToString = React2.useCallback((value2) => {
|
|
2763
2795
|
if (typeof value2 !== "number") {
|
|
2764
2796
|
return typeof value2 === "string" ? value2 : value2.join("");
|