@tapcart/mobile-components 0.7.10 → 0.7.11
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.
|
@@ -5,12 +5,16 @@ type DrawerTriggerProps = React.ComponentPropsWithoutRef<"button"> & {
|
|
|
5
5
|
};
|
|
6
6
|
type DrawerPortalProps = {
|
|
7
7
|
children: React.ReactNode;
|
|
8
|
+
containerRef?: HTMLElement;
|
|
8
9
|
};
|
|
9
10
|
type DrawerCloseProps = React.ComponentPropsWithoutRef<"button"> & {
|
|
10
11
|
asChild?: boolean;
|
|
11
12
|
};
|
|
12
13
|
declare const DrawerTrigger: React.FC<DrawerTriggerProps>;
|
|
13
|
-
declare const DrawerPortal:
|
|
14
|
+
declare const DrawerPortal: {
|
|
15
|
+
({ children, containerRef }: DrawerPortalProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
displayName: string;
|
|
17
|
+
};
|
|
14
18
|
declare const DrawerClose: React.FC<DrawerCloseProps>;
|
|
15
19
|
type DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root> & {
|
|
16
20
|
containerRef?: HTMLElement;
|
|
@@ -26,6 +30,7 @@ declare const DrawerContentBase: React.ForwardRefExoticComponent<Omit<React.Deta
|
|
|
26
30
|
hideBackdrop?: boolean | undefined;
|
|
27
31
|
backdropHexColor?: string | undefined;
|
|
28
32
|
isSheet?: boolean | undefined;
|
|
33
|
+
containerRef?: HTMLElement | undefined;
|
|
29
34
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
30
35
|
declare const DrawerFooter: {
|
|
31
36
|
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../../components/ui/drawer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,IAAI,eAAe,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CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAA;CACjD,CAAA;AAED,QAAA,MAAM,YAAY,0DAKf,iBAAiB,4CA8BnB,CAAA;AAED,QAAA,MAAM,aAAa,sCAIhB,MAAM,cAAc,CAAC,cAAc,CAAC,4CAMtC,CAAA;AAED,OAAO,EACL,MAAM,EACN,YAAY,EACZ,aAAa,EACb,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,YAAY,GACb,CAAA"}
|
|
@@ -15,9 +15,16 @@ import * as React from "react";
|
|
|
15
15
|
import { Drawer as DrawerPrimitive } from "vaul";
|
|
16
16
|
import { cn } from "../../lib/utils";
|
|
17
17
|
import { Icon } from "./icon";
|
|
18
|
+
import ReactDOM from "react-dom";
|
|
18
19
|
const DrawerTrigger = DrawerPrimitive.Trigger;
|
|
19
20
|
DrawerTrigger.displayName = "DrawerTrigger";
|
|
20
|
-
const DrawerPortal =
|
|
21
|
+
const DrawerPortal = ({ children, containerRef }) => {
|
|
22
|
+
console.log("CONTAINER REF", containerRef);
|
|
23
|
+
if (containerRef) {
|
|
24
|
+
return ReactDOM.createPortal(children, containerRef);
|
|
25
|
+
}
|
|
26
|
+
return _jsx(DrawerPrimitive.Portal, { children: children });
|
|
27
|
+
};
|
|
21
28
|
DrawerPortal.displayName = "DrawerPortal";
|
|
22
29
|
const DrawerClose = DrawerPrimitive.Close;
|
|
23
30
|
DrawerClose.displayName = "DrawerClose";
|
|
@@ -33,11 +40,11 @@ const DrawerOverlay = React.forwardRef((_a, ref) => {
|
|
|
33
40
|
});
|
|
34
41
|
DrawerOverlay.displayName = "DrawerOverlay";
|
|
35
42
|
const DrawerContentBase = React.forwardRef((_a, ref) => {
|
|
36
|
-
var { className, children, hideBackdrop = false, backdropHexColor, isSheet = false, onAnimationEnd } = _a, props = __rest(_a, ["className", "children", "hideBackdrop", "backdropHexColor", "isSheet", "onAnimationEnd"]);
|
|
43
|
+
var { className, children, hideBackdrop = false, backdropHexColor, isSheet = false, onAnimationEnd, containerRef } = _a, props = __rest(_a, ["className", "children", "hideBackdrop", "backdropHexColor", "isSheet", "onAnimationEnd", "containerRef"]);
|
|
37
44
|
const styles = isSheet
|
|
38
45
|
? { height: "calc(100vh - 112px)" }
|
|
39
46
|
: { maxHeight: "calc(100vh - 112px)" };
|
|
40
|
-
return (_jsxs(DrawerPortal, { children: [hideBackdrop ? null : (_jsx(DrawerOverlay, { backdropHexColor: backdropHexColor })), _jsxs(DrawerPrimitive.Content, Object.assign({ ref: ref, style: styles, className: cn("fixed inset-x-0 bottom-0 z-50 flex h-auto flex-col rounded-t-2xl bg-coreColors-modalBackground", className) }, props, { "data-testid": "drawer-content" }, { children: [_jsx("div", { className: "mx-auto mb-2 mt-2 h-[4px] w-[40px] rounded-full bg-coreColors-dividingLines" }), children] }))] }));
|
|
47
|
+
return (_jsxs(DrawerPortal, Object.assign({ containerRef: containerRef }, { children: [hideBackdrop ? null : (_jsx(DrawerOverlay, { backdropHexColor: backdropHexColor })), _jsxs(DrawerPrimitive.Content, Object.assign({ ref: ref, style: styles, className: cn("fixed inset-x-0 bottom-0 z-50 flex h-auto flex-col rounded-t-2xl bg-coreColors-modalBackground", className) }, props, { "data-testid": "drawer-content" }, { children: [_jsx("div", { className: "mx-auto mb-2 mt-2 h-[4px] w-[40px] rounded-full bg-coreColors-dividingLines" }), children] }))] })));
|
|
41
48
|
});
|
|
42
49
|
DrawerContentBase.displayName = "DrawerContentBase";
|
|
43
50
|
const DrawerHeaderBase = (_a) => {
|
|
@@ -65,6 +72,6 @@ const DrawerHeader = ({ title, iconLeftName, iconRightName, onCloseClick, }) =>
|
|
|
65
72
|
};
|
|
66
73
|
const DrawerContent = (_a) => {
|
|
67
74
|
var { children, className } = _a, props = __rest(_a, ["children", "className"]);
|
|
68
|
-
return _jsx("div", Object.assign({ className: cn("h-full overflow-scroll", className) }, props, { children: children }));
|
|
75
|
+
return (_jsx("div", Object.assign({ className: cn("h-full overflow-scroll", className) }, props, { children: children })));
|
|
69
76
|
};
|
|
70
77
|
export { Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContentBase, DrawerContent, DrawerFooter, DrawerDescription, DrawerHeader, };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { cn, cva, getColor, getBackgroundAndPaddingStyle, getBorderSidesStyle, getTextStyle, getVerticalAlignmentStyle, getBackgroundAndSpacingStyle, getIdFromGid, productGidFromId, variantGidFromId, getPaddingStyle, getMarginStyle, getVerticalAlignment, mapFlexToAlignment, formatRelativeTime, stringRatioToInt, getOverlayStyle, throttleFunction, getDestinationHandler, getProductGidsFromIds, createCollectionImageMap, } from "./lib/utils";
|
|
1
|
+
export { cn, cva, getColor, getBackgroundAndPaddingStyle, getBorderSidesStyle, getTextStyle, getVerticalAlignmentStyle, getBackgroundAndSpacingStyle, getIdFromGid, productGidFromId, variantGidFromId, getPaddingStyle, getMarginStyle, getVerticalAlignment, mapFlexToAlignment, formatRelativeTime, stringRatioToInt, getOverlayStyle, throttleFunction, getDestinationHandler, getProductGidsFromIds, createCollectionImageMap, isFavoriteIntegrationEnabled } from "./lib/utils";
|
|
2
2
|
export * from "./components/hooks/use-collection";
|
|
3
3
|
export * from "./components/hooks/use-infinite-scroll";
|
|
4
4
|
export * from "./components/hooks/use-recommendations";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,EAAE,EACF,GAAG,EACH,QAAQ,EACR,4BAA4B,EAC5B,mBAAmB,EACnB,YAAY,EACZ,yBAAyB,EACzB,4BAA4B,EAC5B,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EA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rC,cAAc,uBAAuB,CAAA;AACrC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,2BAA2B,CAAA;AACzC,cAAc,2BAA2B,CAAA;AACzC,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA;AACtC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,wBAAwB,CAAA;AACtC,cAAc,sBAAsB,CAAA;AACpC,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA;AACxC,cAAc,uBAAuB,CAAA;AACrC,cAAc,yBAAyB,CAAA;AACvC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,wBAAwB,CAAA;AACtC,cAAc,2BAA2B,CAAA;AACzC,cAAc,uBAAuB,CAAA;AACrC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,0BAA0B,CAAA;AACxC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,kDAAkD,CAAA;AAChE,cAAc,gCAAgC,CAAA;AAC9C,cAAc,oCAAoC,CAAA;AAClD,cAAc,mCAAmC,CAAA;AACjD,cAAc,aAAa,CAAA;AAC3B,cAAc,6CAA6C,CAAA;AAC3D,cAAc,kDAAkD,CAAA;AAChE,cAAc,qBAAqB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// component exports
|
|
2
|
-
export { cn, cva, getColor, getBackgroundAndPaddingStyle, getBorderSidesStyle, getTextStyle, getVerticalAlignmentStyle, getBackgroundAndSpacingStyle, getIdFromGid, productGidFromId, variantGidFromId, getPaddingStyle, getMarginStyle, getVerticalAlignment, mapFlexToAlignment, formatRelativeTime, stringRatioToInt, getOverlayStyle, throttleFunction, getDestinationHandler, getProductGidsFromIds, createCollectionImageMap, } from "./lib/utils";
|
|
2
|
+
export { cn, cva, getColor, getBackgroundAndPaddingStyle, getBorderSidesStyle, getTextStyle, getVerticalAlignmentStyle, getBackgroundAndSpacingStyle, getIdFromGid, productGidFromId, variantGidFromId, getPaddingStyle, getMarginStyle, getVerticalAlignment, mapFlexToAlignment, formatRelativeTime, stringRatioToInt, getOverlayStyle, throttleFunction, getDestinationHandler, getProductGidsFromIds, createCollectionImageMap, isFavoriteIntegrationEnabled } from "./lib/utils";
|
|
3
3
|
export * from "./components/hooks/use-collection";
|
|
4
4
|
export * from "./components/hooks/use-infinite-scroll";
|
|
5
5
|
export * from "./components/hooks/use-recommendations";
|