@tapcart/mobile-components 0.2.11 → 0.3.0

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.
Files changed (101) hide show
  1. package/dist/components/hooks/use-infinite-scroll.d.ts +2 -0
  2. package/dist/components/hooks/use-infinite-scroll.d.ts.map +1 -1
  3. package/dist/components/hooks/use-infinite-scroll.js +11 -6
  4. package/dist/components/hooks/use-scroll-direction.d.ts +8 -0
  5. package/dist/components/hooks/use-scroll-direction.d.ts.map +1 -0
  6. package/dist/components/hooks/use-scroll-direction.js +42 -0
  7. package/dist/components/ui/accordion.js +3 -3
  8. package/dist/components/ui/alert-dialog.js +8 -8
  9. package/dist/components/ui/badge.d.ts +4 -3
  10. package/dist/components/ui/badge.d.ts.map +1 -1
  11. package/dist/components/ui/badge.js +25 -7
  12. package/dist/components/ui/button.d.ts +3 -1
  13. package/dist/components/ui/button.d.ts.map +1 -1
  14. package/dist/components/ui/button.js +50 -15
  15. package/dist/components/ui/carousel.d.ts +5 -5
  16. package/dist/components/ui/carousel.d.ts.map +1 -1
  17. package/dist/components/ui/carousel.js +5 -5
  18. package/dist/components/ui/checkbox.d.ts.map +1 -1
  19. package/dist/components/ui/checkbox.js +6 -6
  20. package/dist/components/ui/chip.d.ts +2 -2
  21. package/dist/components/ui/chip.d.ts.map +1 -1
  22. package/dist/components/ui/chip.js +4 -4
  23. package/dist/components/ui/container.js +1 -1
  24. package/dist/components/ui/drawer.d.ts +3 -3
  25. package/dist/components/ui/drawer.d.ts.map +1 -1
  26. package/dist/components/ui/drawer.js +15 -13
  27. package/dist/components/ui/dropdown.d.ts +22 -0
  28. package/dist/components/ui/dropdown.d.ts.map +1 -0
  29. package/dist/components/ui/dropdown.js +60 -0
  30. package/dist/components/ui/favorite.d.ts +4 -2
  31. package/dist/components/ui/favorite.d.ts.map +1 -1
  32. package/dist/components/ui/favorite.js +11 -5
  33. package/dist/components/ui/grid.js +5 -5
  34. package/dist/components/ui/icon.d.ts +2 -2
  35. package/dist/components/ui/icon.d.ts.map +1 -1
  36. package/dist/components/ui/icon.js +36 -7
  37. package/dist/components/ui/image.d.ts +157 -0
  38. package/dist/components/ui/image.d.ts.map +1 -0
  39. package/dist/components/ui/image.js +318 -0
  40. package/dist/components/ui/input.js +1 -1
  41. package/dist/components/ui/label.js +1 -1
  42. package/dist/components/ui/line-item-text-icons.d.ts +14 -0
  43. package/dist/components/ui/line-item-text-icons.d.ts.map +1 -0
  44. package/dist/components/ui/line-item-text-icons.js +22 -0
  45. package/dist/components/ui/money.js +1 -1
  46. package/dist/components/ui/price.d.ts +2 -1
  47. package/dist/components/ui/price.d.ts.map +1 -1
  48. package/dist/components/ui/price.js +6 -6
  49. package/dist/components/ui/product-card.d.ts +79 -27
  50. package/dist/components/ui/product-card.d.ts.map +1 -1
  51. package/dist/components/ui/product-card.js +194 -34
  52. package/dist/components/ui/product-grid.d.ts +1 -1
  53. package/dist/components/ui/product-grid.d.ts.map +1 -1
  54. package/dist/components/ui/product-grid.js +5 -5
  55. package/dist/components/ui/quantity-picker.d.ts +14 -0
  56. package/dist/components/ui/quantity-picker.d.ts.map +1 -0
  57. package/dist/components/ui/quantity-picker.js +23 -0
  58. package/dist/components/ui/radio-group.js +4 -4
  59. package/dist/components/ui/scroll-area.d.ts +1 -1
  60. package/dist/components/ui/scroll-area.d.ts.map +1 -1
  61. package/dist/components/ui/scroll-area.js +2 -2
  62. package/dist/components/ui/selectors.d.ts +3 -3
  63. package/dist/components/ui/selectors.d.ts.map +1 -1
  64. package/dist/components/ui/selectors.js +22 -6
  65. package/dist/components/ui/separator.js +1 -1
  66. package/dist/components/ui/skeleton.js +2 -2
  67. package/dist/components/ui/slider.d.ts +14 -0
  68. package/dist/components/ui/slider.d.ts.map +1 -0
  69. package/dist/components/ui/slider.js +50 -0
  70. package/dist/components/ui/subscription.d.ts +15 -0
  71. package/dist/components/ui/subscription.d.ts.map +1 -0
  72. package/dist/components/ui/subscription.js +24 -0
  73. package/dist/components/ui/switch.d.ts.map +1 -1
  74. package/dist/components/ui/switch.js +2 -2
  75. package/dist/components/ui/tabs.js +4 -4
  76. package/dist/components/ui/text.js +6 -6
  77. package/dist/components/ui/toast.d.ts +3 -3
  78. package/dist/components/ui/toast.d.ts.map +1 -1
  79. package/dist/components/ui/toast.js +7 -7
  80. package/dist/components/ui/toaster.js +2 -2
  81. package/dist/components/ui/toggle-group.d.ts +2 -2
  82. package/dist/components/ui/toggle-group.js +2 -2
  83. package/dist/components/ui/toggle.d.ts +2 -2
  84. package/dist/components/ui/toggle.js +2 -2
  85. package/dist/components/ui/use-toast.d.ts +6 -6
  86. package/dist/components/ui/use-toast.d.ts.map +1 -1
  87. package/dist/components/ui/video.js +1 -1
  88. package/dist/components/ui/wishlist.d.ts +2 -1
  89. package/dist/components/ui/wishlist.d.ts.map +1 -1
  90. package/dist/components/ui/wishlist.js +3 -3
  91. package/dist/index.d.ts +7 -0
  92. package/dist/index.d.ts.map +1 -1
  93. package/dist/index.js +7 -0
  94. package/dist/styles.css +210 -72
  95. package/package.json +9 -3
  96. package/dist/components/ThemeProvider.d.ts +0 -3
  97. package/dist/components/ThemeProvider.d.ts.map +0 -1
  98. package/dist/components/ThemeProvider.js +0 -18
  99. package/dist/components/ThemeToggle.d.ts +0 -2
  100. package/dist/components/ThemeToggle.d.ts.map +0 -1
  101. package/dist/components/ThemeToggle.js +0 -8
@@ -3,7 +3,7 @@ import { Drawer as DrawerPrimitive } from "vaul";
3
3
  declare const DrawerTrigger: React.ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
4
4
  declare const DrawerPortal: React.FC<import("@radix-ui/react-dialog").DialogPortalProps>;
5
5
  declare const DrawerClose: React.ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
6
- declare type DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root>;
6
+ type DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root>;
7
7
  declare const Drawer: {
8
8
  ({ shouldScaleBackground, ...props }: DrawerProps): import("react/jsx-runtime").JSX.Element;
9
9
  displayName: string;
@@ -23,13 +23,13 @@ declare const DrawerFooter: {
23
23
  displayName: string;
24
24
  };
25
25
  declare const DrawerDescription: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-dialog").DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
26
- declare type DrawerHeaderProps = {
26
+ type DrawerHeaderProps = {
27
27
  iconLeftName?: string;
28
28
  iconRightName?: string;
29
29
  title: string;
30
30
  onCloseClick?: (event: React.MouseEvent) => void;
31
31
  };
32
- declare const DrawerHeader: ({ title, iconLeftName, iconRightName, onCloseClick }: DrawerHeaderProps) => import("react/jsx-runtime").JSX.Element;
32
+ declare const DrawerHeader: ({ title, iconLeftName, iconRightName, onCloseClick, }: DrawerHeaderProps) => import("react/jsx-runtime").JSX.Element;
33
33
  declare const DrawerContent: ({ children }: {
34
34
  children: React.ReactNode;
35
35
  }) => 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,EAAE,MAAM,MAAM,CAAA;AAIhD,QAAA,MAAM,aAAa,+HAA0B,CAAA;AAE7C,QAAA,MAAM,YAAY,8DAAyB,CAAA;AAE3C,QAAA,MAAM,WAAW,6HAAwB,CAAA;AAEzC,aAAK,WAAW,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,CAAA;AAEpE,QAAA,MAAM,MAAM;0CAGT,WAAW;;CAOb,CAAA;AAGD,QAAA,MAAM,aAAa;;wCAajB,CAAA;AAGF,QAAA,MAAM,iBAAiB;;;;;;wCAsBrB,CAAA;AA6BF,QAAA,MAAM,YAAY;8BAGf,MAAM,cAAc,CAAC,cAAc,CAAC;;CAKtC,CAAA;AAGD,QAAA,MAAM,iBAAiB,+LASrB,CAAA;AAGF,aAAK,iBAAiB,GAAG;IACvB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAA;CACjD,CAAA;AAED,QAAA,MAAM,YAAY,yDAA0D,iBAAiB,4CAU5F,CAAA;AAED,QAAA,MAAM,aAAa;cAA8B,MAAM,SAAS;6CAE/D,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"}
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,EAAE,MAAM,MAAM,CAAA;AAIhD,QAAA,MAAM,aAAa,+HAA0B,CAAA;AAE7C,QAAA,MAAM,YAAY,8DAAyB,CAAA;AAE3C,QAAA,MAAM,WAAW,6HAAwB,CAAA;AAEzC,KAAK,WAAW,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,CAAA;AAEpE,QAAA,MAAM,MAAM;0CAAyC,WAAW;;CAE/D,CAAA;AAGD,QAAA,MAAM,aAAa;;wCAcjB,CAAA;AAGF,QAAA,MAAM,iBAAiB;;;;;;wCA0CtB,CAAA;AA0BD,QAAA,MAAM,YAAY;8BAGf,MAAM,cAAc,CAAC,cAAc,CAAC;;CAQtC,CAAA;AAGD,QAAA,MAAM,iBAAiB,+LASrB,CAAA;AAGF,KAAK,iBAAiB,GAAG;IACvB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAA;CACjD,CAAA;AAED,QAAA,MAAM,YAAY,0DAKf,iBAAiB,4CAoBnB,CAAA;AAED,QAAA,MAAM,aAAa;cAA8B,MAAM,SAAS;6CAE/D,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"}
@@ -13,51 +13,53 @@ var __rest = (this && this.__rest) || function (s, e) {
13
13
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
14
  import * as React from "react";
15
15
  import { Drawer as DrawerPrimitive } from "vaul";
16
- import { cn } from "@/lib/utils";
17
- import { Icon } from "@/components/ui/icon";
16
+ import { cn } from "../../lib/utils";
17
+ import { Icon } from "./icon";
18
18
  const DrawerTrigger = DrawerPrimitive.Trigger;
19
19
  const DrawerPortal = DrawerPrimitive.Portal;
20
20
  const DrawerClose = DrawerPrimitive.Close;
21
21
  const Drawer = (_a) => {
22
22
  var { shouldScaleBackground } = _a, props = __rest(_a, ["shouldScaleBackground"]);
23
- return (_jsx(DrawerPrimitive.Root, Object.assign({ shouldScaleBackground: true }, props), void 0));
23
+ return _jsx(DrawerPrimitive.Root, Object.assign({ shouldScaleBackground: true }, props));
24
24
  };
25
25
  Drawer.displayName = "Drawer";
26
26
  const DrawerOverlay = React.forwardRef((_a, ref) => {
27
27
  var { className, backdropHexColor = "#000000" } = _a, props = __rest(_a, ["className", "backdropHexColor"]);
28
- return (_jsx(DrawerPrimitive.Overlay, Object.assign({ style: { backgroundColor: `${backdropHexColor}CC` }, ref: ref, className: cn(`fixed inset-0 z-50`, className) }, props), void 0));
28
+ return (_jsx(DrawerPrimitive.Overlay, Object.assign({ style: { backgroundColor: `${backdropHexColor}CC` }, ref: ref, className: cn(`fixed inset-0 z-50`, className) }, props)));
29
29
  });
30
30
  DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;
31
31
  const DrawerContentBase = React.forwardRef((_a, ref) => {
32
32
  var { className, children, hideBackdrop = false, backdropHexColor, isSheet = false } = _a, props = __rest(_a, ["className", "children", "hideBackdrop", "backdropHexColor", "isSheet"]);
33
- const styles = isSheet ? { height: "calc(100vh - 56px)" } : { maxHeight: "calc(100vh - 56px)" };
34
- return (_jsxs(DrawerPortal, { children: [hideBackdrop ? null : _jsx(DrawerOverlay, { backdropHexColor: backdropHexColor }, void 0), _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, { children: [_jsx("div", { className: "mx-auto mb-2 mt-2 h-[4px] w-[40px] rounded-full bg-coreColors-dividingLines" }, void 0), children] }), void 0)] }, void 0));
33
+ const styles = isSheet
34
+ ? { height: "calc(100vh - 56px)" }
35
+ : { maxHeight: "calc(100vh - 56px)" };
36
+ 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, { children: [_jsx("div", { className: "mx-auto mb-2 mt-2 h-[4px] w-[40px] rounded-full bg-coreColors-dividingLines" }), children] }))] }));
35
37
  });
36
38
  DrawerContentBase.displayName = "DrawerContentBase";
37
39
  const DrawerHeaderBase = (_a) => {
38
40
  var { className } = _a, props = __rest(_a, ["className"]);
39
- return (_jsx("div", Object.assign({ className: cn(className) }, props), void 0));
41
+ return (_jsx("div", Object.assign({ className: cn(className) }, props)));
40
42
  };
41
43
  DrawerHeaderBase.displayName = "DrawerHeaderBase";
42
44
  const DrawerTitle = React.forwardRef((_a, ref) => {
43
45
  var { className } = _a, props = __rest(_a, ["className"]);
44
- return (_jsx(DrawerPrimitive.Title, Object.assign({ ref: ref, className: cn("text-textColors-primaryColor text-center text-[18px] font-medium leading-[24px] truncate my-0 mx-4", className) }, props), void 0));
46
+ return (_jsx(DrawerPrimitive.Title, Object.assign({ ref: ref, className: cn("text-textColors-primaryColor text-center text-[18px] font-medium leading-[24px] truncate my-0 mx-4", className) }, props)));
45
47
  });
46
48
  DrawerTitle.displayName = DrawerPrimitive.Title.displayName;
47
49
  const DrawerFooter = (_a) => {
48
50
  var { className } = _a, props = __rest(_a, ["className"]);
49
- return (_jsx("div", Object.assign({ className: cn("mt-auto flex flex-row gap-2 pb-8 pt-4 pl-4 pr-4 border-t border-coreColors-dividingLines", className) }, props), void 0));
51
+ return (_jsx("div", Object.assign({ className: cn("mt-auto flex flex-row gap-2 pb-8 pt-4 pl-4 pr-4 border-t border-coreColors-dividingLines", className) }, props)));
50
52
  };
51
53
  DrawerFooter.displayName = "DrawerFooter";
52
54
  const DrawerDescription = React.forwardRef((_a, ref) => {
53
55
  var { className } = _a, props = __rest(_a, ["className"]);
54
- return (_jsx(DrawerPrimitive.Description, Object.assign({ ref: ref, className: cn("text-sm text-muted-foreground", className) }, props), void 0));
56
+ return (_jsx(DrawerPrimitive.Description, Object.assign({ ref: ref, className: cn("text-sm text-muted-foreground", className) }, props)));
55
57
  });
56
58
  DrawerDescription.displayName = DrawerPrimitive.Description.displayName;
57
- const DrawerHeader = ({ title, iconLeftName, iconRightName, onCloseClick }) => {
58
- return (_jsxs(DrawerHeaderBase, Object.assign({ className: "p-4 text-center flex justify-between" }, { children: [iconLeftName ? (_jsx(DrawerClose, Object.assign({ className: "h-6 w-6 p-0", onClick: onCloseClick }, { children: _jsx(Icon, { name: iconLeftName, className: "h-6 w-6 p-0", size: "md" }, void 0) }), void 0)) : _jsx("span", {}, void 0), _jsx(DrawerTitle, { children: title }, void 0), iconRightName ? (_jsx(DrawerClose, Object.assign({ className: "h-6 w-6 p-0", onClick: onCloseClick }, { children: _jsx(Icon, { name: iconRightName, className: "h-6 w-6 p-0", size: "md" }, void 0) }), void 0)) : _jsx("span", {}, void 0)] }), void 0));
59
+ const DrawerHeader = ({ title, iconLeftName, iconRightName, onCloseClick, }) => {
60
+ return (_jsxs(DrawerHeaderBase, Object.assign({ className: "p-4 text-center flex justify-between" }, { children: [iconLeftName ? (_jsx(DrawerClose, Object.assign({ className: "h-6 w-6 p-0", onClick: onCloseClick }, { children: _jsx(Icon, { name: iconLeftName, color: "coreColors-secondaryIcon", className: "h-6 w-6 p-0", size: "md" }) }))) : (_jsx("div", { className: "w-6" })), _jsx(DrawerTitle, { children: title }), iconRightName ? (_jsx(DrawerClose, Object.assign({ className: "h-6 w-6 p-0", onClick: onCloseClick }, { children: _jsx(Icon, { name: iconRightName, color: "coreColors-secondaryIcon", className: "h-6 w-6 p-0", size: "md" }) }))) : (_jsx("div", { className: "w-6" }))] })));
59
61
  };
60
62
  const DrawerContent = ({ children }) => {
61
- return (_jsx("div", Object.assign({ className: "h-full overflow-scroll" }, { children: children }), void 0));
63
+ return _jsx("div", Object.assign({ className: "h-full overflow-scroll" }, { children: children }));
62
64
  };
63
65
  export { Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContentBase, DrawerContent, DrawerFooter, DrawerDescription, DrawerHeader, };
@@ -0,0 +1,22 @@
1
+ import * as React from "react";
2
+ import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
3
+ import { WishlistProps } from "./wishlist";
4
+ declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
5
+ interface DropdownMenuTriggerProps {
6
+ label: string;
7
+ className?: string;
8
+ asChild?: boolean;
9
+ selectedItem?: WishlistProps | null;
10
+ isError?: boolean;
11
+ width?: number;
12
+ }
13
+ declare const DropdownMenuTrigger: React.FC<DropdownMenuTriggerProps>;
14
+ declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
15
+ declare const DropdownMenuContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
16
+ width?: number | undefined;
17
+ } & React.RefAttributes<HTMLDivElement>>;
18
+ declare const DropdownMenuItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
19
+ inset?: boolean | undefined;
20
+ } & React.RefAttributes<HTMLDivElement>>;
21
+ export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuGroup, type DropdownMenuTriggerProps, };
22
+ //# sourceMappingURL=dropdown.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dropdown.d.ts","sourceRoot":"","sources":["../../../components/ui/dropdown.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,qBAAqB,MAAM,+BAA+B,CAAA;AAMtE,OAAO,EAAmB,aAAa,EAAE,MAAM,YAAY,CAAA;AAE3D,QAAA,MAAM,YAAY,mDAA6B,CAAA;AAE/C,UAAU,wBAAwB;IAChC,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,YAAY,CAAC,EAAE,aAAa,GAAG,IAAI,CAAA;IACnC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,QAAA,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAgF3D,CAAA;AAED,QAAA,MAAM,iBAAiB,qHAA8B,CAAA;AAErD,QAAA,MAAM,mBAAmB;;wCAuBvB,CAAA;AAGF,QAAA,MAAM,gBAAgB;;wCAepB,CAAA;AAGF,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,KAAK,wBAAwB,GAC9B,CAAA"}
@@ -0,0 +1,60 @@
1
+ "use client";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
+ import * as React from "react";
15
+ import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
16
+ import clsx from "clsx";
17
+ import { cn } from "../../lib/utils";
18
+ import { Text } from "./text";
19
+ import { Icon } from "./icon";
20
+ import { PlaceholderIcon } from "./wishlist";
21
+ const DropdownMenu = DropdownMenuPrimitive.Root;
22
+ const DropdownMenuTrigger = (_a) => {
23
+ var { label, className, asChild, selectedItem, isError, width } = _a, props = __rest(_a, ["label", "className", "asChild", "selectedItem", "isError", "width"]);
24
+ const triggerClass = clsx("[&[data-state=open]_.chevron-icon]:rotate-180 active:text-coreColors-brandColorPrimary active:outline-coreColors-brandColorPrimary outline outline-1 outline-coreColors-dividingLines", {
25
+ "outline-stateColors-error": isError,
26
+ "[&[data-state=open]]:outline-coreColors-brandColorPrimary": !isError,
27
+ "[&[data-state=open]_.label]:text-coreColors-brandColorPrimary": selectedItem,
28
+ "[&[data-state=open]_.label]:text-textColors-secondaryColor": !selectedItem,
29
+ });
30
+ const labelClass = clsx("label overflow-hidden text-ellipsis whitespace-nowrap", {
31
+ "text-stateColors-error": isError,
32
+ "text-textColors-secondaryColor": !isError,
33
+ });
34
+ const nameClass = clsx("name", {
35
+ "text-stateColors-error": isError,
36
+ "": !isError,
37
+ });
38
+ const iconClass = clsx("", {
39
+ "stateColors-error": isError,
40
+ "coreColors-secondaryIcon": !isError,
41
+ });
42
+ return (_jsx(DropdownMenuPrimitive.Trigger, Object.assign({ asChild: asChild, className: cn(triggerClass, className) }, props, { style: { width: width } }, { children: _jsxs("button", Object.assign({ className: "h-14 flex justify-between items-center w-full rounded-[4px] p-4 bg-coreColors-inputBackground" }, { children: [selectedItem ? (_jsxs("div", Object.assign({ className: "flex flex-row items-center overflow-hidden" }, { children: [selectedItem.imgUrl ? (_jsx("img", { alt: "wishlist-image", className: "flex-shrink-0 h-10 w-10 border border-coreColors-dividingLines rounded-sm", src: selectedItem.imgUrl })) : (_jsx(PlaceholderIcon, {})), _jsxs("div", Object.assign({ className: "ml-2 text-start overflow-hidden" }, { children: [_jsx(Text, Object.assign({ type: "label", className: labelClass }, { children: label })), _jsx(Text, Object.assign({ type: "body-primary", className: nameClass }, { children: selectedItem.name }))] }))] }))) : (_jsx(Text, Object.assign({ type: "body-primary", className: labelClass }, { children: label }))), _jsx(Icon, { name: "chevron-down", size: "sm", color: iconClass, className: "chevron-icon shrink-0 ml-2" })] })) })));
43
+ };
44
+ const DropdownMenuGroup = DropdownMenuPrimitive.Group;
45
+ const DropdownMenuContent = React.forwardRef((_a, ref) => {
46
+ var { className, sideOffset = 4, width } = _a, props = __rest(_a, ["className", "sideOffset", "width"]);
47
+ return (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, Object.assign({ ref: ref, sideOffset: sideOffset, className: cn("z-50 max-h-[240px] overflow-y-auto min-w-[8rem] rounded-[4px] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className), style: {
48
+ outlineStyle: "solid",
49
+ outlineWidth: 1,
50
+ outlineColor: "var(--coreColors-brandColorPrimary)",
51
+ width: width,
52
+ } }, props)) }));
53
+ });
54
+ DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
55
+ const DropdownMenuItem = React.forwardRef((_a, ref) => {
56
+ var { className, inset } = _a, props = __rest(_a, ["className", "inset"]);
57
+ return (_jsx(DropdownMenuPrimitive.Item, Object.assign({ ref: ref, className: cn("relative flex cursor-default select-none items-center outline-none transition-colors focus:bg-stateColors-skeleton data-[disabled]:pointer-events-none data-[disabled]:opacity-50", inset && "pl-8", className) }, props)));
58
+ });
59
+ DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
60
+ export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuGroup, };
@@ -2,11 +2,13 @@ import * as React from "react";
2
2
  import { type VariantProps } from "class-variance-authority";
3
3
  declare const favoriteVariants: (props?: ({
4
4
  size?: "small" | "large" | null | undefined;
5
- defaultVariants?: "size" | null | undefined;
5
+ showBackground?: boolean | null | undefined;
6
6
  } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
7
7
  export interface FavoriteProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof favoriteVariants> {
8
8
  selected?: boolean;
9
- onClick: () => void;
9
+ onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
10
+ icon?: string;
11
+ showBackground?: boolean;
10
12
  }
11
13
  declare const Favorite: React.ForwardRefExoticComponent<FavoriteProps & React.RefAttributes<HTMLButtonElement>>;
12
14
  export { Favorite, favoriteVariants };
@@ -1 +1 @@
1
- {"version":3,"file":"favorite.d.ts","sourceRoot":"","sources":["../../../components/ui/favorite.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAKjE,QAAA,MAAM,gBAAgB;;;mFAarB,CAAA;AAED,MAAM,WAAW,aACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EACnD,YAAY,CAAC,OAAO,gBAAgB,CAAC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB;AAED,QAAA,MAAM,QAAQ,yFAsBb,CAAA;AAGD,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAA"}
1
+ {"version":3,"file":"favorite.d.ts","sourceRoot":"","sources":["../../../components/ui/favorite.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAKjE,QAAA,MAAM,gBAAgB;;;mFAkBrB,CAAA;AAED,MAAM,WAAW,aACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EACnD,YAAY,CAAC,OAAO,gBAAgB,CAAC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAC/D,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB;AAED,QAAA,MAAM,QAAQ,yFAuBb,CAAA;AAGD,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAA"}
@@ -14,22 +14,28 @@ import * as React from "react";
14
14
  import { cva } from "class-variance-authority";
15
15
  import { cn } from "../../lib/utils";
16
16
  import { Icon } from "./icon";
17
- const favoriteVariants = cva("flex p-2 bg-coreColors-inputBackground rounded-[4px] shadow-buttonColors-primaryShadow active:[&_svg]:text-stateColors-favorites", {
17
+ const favoriteVariants = cva("flex p-2 gap-2 rounded-[4px] shadow-buttonColors-primaryShadow active:[&_svg]:text-stateColors-favorites", {
18
18
  variants: {
19
19
  size: {
20
20
  small: "p-2",
21
21
  large: "p-3",
22
22
  },
23
- defaultVariants: {
24
- size: "small",
23
+ showBackground: {
24
+ true: "bg-coreColors-inputBackground",
25
+ false: "",
25
26
  },
26
27
  },
28
+ defaultVariants: {
29
+ size: "small",
30
+ showBackground: true,
31
+ },
27
32
  });
28
33
  const Favorite = React.forwardRef((_a, ref) => {
29
- var { className, size = "small", selected = false, onClick } = _a, props = __rest(_a, ["className", "size", "selected", "onClick"]);
34
+ var { className, size = "small", selected = false, onClick, icon = "heart-filled", showBackground = true } = _a, props = __rest(_a, ["className", "size", "selected", "onClick", "icon", "showBackground"]);
30
35
  return (_jsx("button", Object.assign({ onClick: onClick, ref: ref, className: cn(favoriteVariants({
31
36
  size,
32
- }), className) }, props, { children: _jsx(Icon, { name: "heart-filled", color: selected ? "stateColors-favorites" : "stateColors-disabled", size: size === "small" ? "xs" : "sm" }, void 0) }), void 0));
37
+ showBackground
38
+ }), className) }, props, { children: _jsx(Icon, { name: icon, color: selected ? "stateColors-favorites" : "stateColors-disabled", size: size === "small" ? "xs" : "sm" }) })));
33
39
  });
34
40
  Favorite.displayName = "Favorite";
35
41
  export { Favorite, favoriteVariants };
@@ -16,10 +16,10 @@ import { cn } from "../../lib/utils";
16
16
  const gridVariants = cva("grid", {
17
17
  variants: {
18
18
  columns: {
19
- 1: "grid-cols-1 gap-y-[7px]",
20
- 2: "grid-cols-2 gap-x-[7px] gap-y-[7px]",
21
- 3: "grid-cols-3 gap-x-[7px] gap-y-[7px]",
22
- 4: "grid-cols-4 gap-x-[7px] gap-y-[7px]",
19
+ 1: "grid-cols-1 gap-y-4",
20
+ 2: "grid-cols-2 gap-x-[7px] gap-y-4",
21
+ 3: "grid-cols-3 gap-x-[7px] gap-y-4",
22
+ 4: "grid-cols-4 gap-x-[7px] gap-y-4",
23
23
  },
24
24
  },
25
25
  defaultVariants: {
@@ -28,6 +28,6 @@ const gridVariants = cva("grid", {
28
28
  });
29
29
  function Grid(_a) {
30
30
  var { className, columns } = _a, props = __rest(_a, ["className", "columns"]);
31
- return (_jsx(Container, { children: _jsx("div", Object.assign({ className: cn(gridVariants({ columns }), className) }, props), void 0) }, void 0));
31
+ return (_jsx(Container, { children: _jsx("div", Object.assign({ className: cn(gridVariants({ columns }), className) }, props)) }));
32
32
  }
33
33
  export { Grid, gridVariants };
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { type VariantProps } from "class-variance-authority";
3
- import { IconUpload, IconPencilMinus } from "@tabler/icons-react";
3
+ import { IconPencilMinus } from "@tabler/icons-react";
4
4
  declare const iconVariants: (props?: ({
5
5
  size?: "xs" | "sm" | "md" | "lg" | null | undefined;
6
6
  color?: string | null | undefined;
@@ -9,5 +9,5 @@ export interface IconProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "c
9
9
  name?: string;
10
10
  }
11
11
  declare function Icon({ className, name, size, color, ...props }: IconProps): import("react/jsx-runtime").JSX.Element;
12
- export { Icon, iconVariants, IconUpload, IconPencilMinus };
12
+ export { Icon, iconVariants, IconPencilMinus };
13
13
  //# sourceMappingURL=icon.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../components/ui/icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAIjE,QAAA,MAAM,YAAY;;;mFAgBjB,CAAA;AAeD,MAAM,WAAW,SACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC,EACzD,YAAY,CAAC,OAAO,YAAY,CAAC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,iBAAS,IAAI,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,IAAW,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,2CAuBzE;AAED,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,CAAA"}
1
+ {"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../components/ui/icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAEL,eAAe,EA6BhB,MAAM,qBAAqB,CAAA;AAI5B,QAAA,MAAM,YAAY;;;mFAgBjB,CAAA;AAiDD,MAAM,WAAW,SACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC,EACzD,YAAY,CAAC,OAAO,YAAY,CAAC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,iBAAS,IAAI,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,IAAW,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,2CAczE;AAED,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,eAAe,EAAE,CAAA"}
@@ -11,9 +11,8 @@ var __rest = (this && this.__rest) || function (s, e) {
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import { cva } from "class-variance-authority";
14
- import { IconUpload, IconPencilMinus } from "@tabler/icons-react";
14
+ import { IconUpload, IconPencilMinus, IconPlus, IconMinus, IconAdjustmentsAlt, IconArrowsSort, IconAlertCircle, IconCircleX, IconInfoCircle, IconCheck, IconSquareOff, IconMapPin, IconRepeat, IconSquare, IconSquareCheck, IconChevronUp, IconChevronRight, IconEyeOff, IconSquareX, IconCircle, IconChevronDown, IconHeartFilled, IconCurrencyDollar, IconX, IconCircleOff, IconCircleDotFilled, IconMoodSad, IconSquareXFilled, IconTrash, IconLoader2, } from "@tabler/icons-react";
15
15
  import { cn, iconColorVariantClasses } from "../../lib/utils";
16
- import * as allIcons from "@tabler/icons-react";
17
16
  const iconVariants = cva("inline-flex items-center justify-center text-sm font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none ring-offset-background", {
18
17
  variants: {
19
18
  size: {
@@ -40,11 +39,41 @@ const sizeMapping = {
40
39
  md: 24,
41
40
  lg: 56,
42
41
  };
42
+ const icons = {
43
+ minus: IconMinus,
44
+ plus: IconPlus,
45
+ "adjustments-alt": IconAdjustmentsAlt,
46
+ "arrows-sort": IconArrowsSort,
47
+ "alert-circle": IconAlertCircle,
48
+ "circle-x": IconCircleX,
49
+ "info-circle": IconInfoCircle,
50
+ check: IconCheck,
51
+ "square-off": IconSquareOff,
52
+ "map-pin": IconMapPin,
53
+ repeat: IconRepeat,
54
+ square: IconSquare,
55
+ "square-check": IconSquareCheck,
56
+ "chevron-up": IconChevronUp,
57
+ "chevron-right": IconChevronRight,
58
+ "eye-off": IconEyeOff,
59
+ "square-x": IconSquareX,
60
+ circle: IconCircle,
61
+ "chevron-down": IconChevronDown,
62
+ "heart-filled": IconHeartFilled,
63
+ "menu-icon-heart": IconHeartFilled,
64
+ upload: IconUpload,
65
+ "currency-dollar": IconCurrencyDollar,
66
+ x: IconX,
67
+ "circle-off": IconCircleOff,
68
+ "circle-dot-filled": IconCircleDotFilled,
69
+ "mood-sad": IconMoodSad,
70
+ "square-x-filled": IconSquareXFilled,
71
+ trash: IconTrash,
72
+ loader: IconLoader2,
73
+ };
43
74
  function Icon(_a) {
44
75
  var { className, name, size = "md", color } = _a, props = __rest(_a, ["className", "name", "size", "color"]);
45
- const iconName = "Icon" +
46
- (name === null || name === void 0 ? void 0 : name.split("-").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(""));
47
- const IconComponent = allIcons[iconName];
48
- return (_jsxs("div", Object.assign({ className: cn(iconVariants({ color, size, className })) }, props, { children: [IconComponent ? (_jsx(IconComponent, { size: sizeMapping[size], strokeWidth: strokeWidthMapping[size] }, void 0)) : null, props.children] }), void 0));
76
+ const IconComponent = icons[name];
77
+ return (_jsxs("div", Object.assign({ className: cn(iconVariants({ color, size, className })) }, props, { children: [IconComponent ? (_jsx(IconComponent, { size: sizeMapping[size], strokeWidth: strokeWidthMapping[size] })) : null, props.children] })));
49
78
  }
50
- export { Icon, iconVariants, IconUpload, IconPencilMinus };
79
+ export { Icon, iconVariants, IconPencilMinus };
@@ -0,0 +1,157 @@
1
+ import * as React from "react";
2
+ import type { PartialDeep } from "type-fest";
3
+ import type { Image as ImageType } from "app-studio-types";
4
+ type SrcSetOptions = {
5
+ intervals: number;
6
+ startingWidth: number;
7
+ incrementSize: number;
8
+ placeholderWidth: number;
9
+ };
10
+ export type LoaderParams = {
11
+ src?: ImageType["url"];
12
+ width?: number;
13
+ height?: number;
14
+ crop?: Crop;
15
+ isContained?: boolean;
16
+ };
17
+ export type Loader = (params: LoaderParams) => string;
18
+ type Crop = "center" | "top" | "bottom" | "left" | "right";
19
+ export type TapcartImageProps = React.ComponentPropsWithRef<"img"> & TapcartImageBaseProps;
20
+ type TapcartImageBaseProps = {
21
+ /** The aspect ratio of the image, in the format of `width/height`.
22
+ *
23
+ * @example
24
+ * ```
25
+ * <Image data={productImage} aspectRatio="4/5" />
26
+ * ```
27
+ */
28
+ aspectRatio?: string;
29
+ /** The crop position of the image.
30
+ *
31
+ * @remarks
32
+ * In the event that AspectRatio is set, without specifying a crop,
33
+ * the Shopify CDN won't return the expected image.
34
+ *
35
+ * @defaultValue `center`
36
+ */
37
+ crop?: Crop;
38
+ data?: PartialDeep<ImageType, {
39
+ recurseIntoArrays: true;
40
+ }>;
41
+ /** A function that returns a URL string for an image.
42
+ *
43
+ * @remarks
44
+ * By default, this uses Shopify’s CDN {@link https://cdn.shopify.com/} but you can provide
45
+ * your own function to use a another provider, as long as they support URL based image transformations.
46
+ */
47
+ loader?: Loader;
48
+ /** An optional prop you can use to change the default srcSet generation behaviour */
49
+ srcSetOptions?: SrcSetOptions;
50
+ /** An optional prop to set the fill behavior of the image. Defaults to "cover"
51
+ *
52
+ * @remarks
53
+ * "fit" maps to `object-fit: contain`
54
+ * "fill" maps to `object-fit: cover`
55
+ */
56
+ objectFit?: "fit" | "fill" | "cover" | "contain" | "none" | "scale-down";
57
+ };
58
+ /**
59
+ * Tapcart’s Image component is a wrapper around the HTML image element.
60
+ * It supports the same props as the HTML `img` element, but automatically
61
+ * generates the srcSet and sizes attributes for you. For most use cases,
62
+ * you’ll want to set the `aspectRatio` prop to ensure the image is sized
63
+ * correctly.
64
+ *
65
+ * @remarks
66
+ * - `decoding` is set to `async` by default.
67
+ * - `loading` is set to `lazy` by default.
68
+ * - `alt` will automatically be set to the `altText` from the Storefront API if passed in the `data` prop
69
+ * - `src` will automatically be set to the `url` from the Storefront API if passed in the `data` prop
70
+ *
71
+ * @example
72
+ * A responsive image with a 4:5 aspect ratio:
73
+ * ```
74
+ * <Image
75
+ * data={product.featuredImage}
76
+ * aspectRatio="4:5"
77
+ * sizes="(min-width: 45em) 40vw, 100vw"
78
+ * />
79
+ * ```
80
+ * @example
81
+ * A fixed size image:
82
+ * ```
83
+ * <Image
84
+ * data={product.featuredImage}
85
+ * width={100}
86
+ * height={100}
87
+ * />
88
+ * ```
89
+ *
90
+ * {@link https://shopify.dev/docs/api/hydrogen-react/components/image}
91
+ */
92
+ export declare const Image: React.ForwardRefExoticComponent<Omit<TapcartImageProps, "ref"> & React.RefAttributes<HTMLImageElement>>;
93
+ /**
94
+ * The shopifyLoader function is a simple utility function that takes a src, width,
95
+ * height, and crop and returns a string that can be used as the src for an image.
96
+ * It can be used with the Tapcart Image component or with the next/image component.
97
+ * (or any others that accept equivalent configuration)
98
+ * @param src - The source URL of the image, e.g. `https://cdn.shopify.com/static/sample-images/garnished.jpeg`
99
+ * @param width - The width of the image, e.g. `100`
100
+ * @param height - The height of the image, e.g. `100`
101
+ * @param crop - The crop of the image, e.g. `center`
102
+ * @returns A Shopify image URL with the correct query parameters, e.g. `https://cdn.shopify.com/static/sample-images/garnished.jpeg?width=100&height=100&crop=center`
103
+ *
104
+ * @example
105
+ * ```
106
+ * shopifyLoader({
107
+ * src: 'https://cdn.shopify.com/static/sample-images/garnished.jpeg',
108
+ * width: 100,
109
+ * height: 100,
110
+ * crop: 'center',
111
+ * })
112
+ * ```
113
+ */
114
+ export declare function shopifyLoader({ src, width, height, crop, isContained, }: LoaderParams): string;
115
+ /**
116
+ * This function generates a srcSet for Shopify images.
117
+ * @param src - The source URL of the image, e.g. https://cdn.shopify.com/static/sample-images/garnished.jpeg
118
+ * @param sizesArray - An array of objects containing the `width`, `height`, and `crop` of the image, e.g. [\{width: 200, height: 200, crop: 'center'\}, \{width: 400, height: 400, crop: 'center'\}]
119
+ * @param loader - A function that takes a Shopify image URL and returns a Shopify image URL with the correct query parameters
120
+ * @returns A srcSet for Shopify images, e.g. 'https://cdn.shopify.com/static/sample-images/garnished.jpeg?width=200&height=200&crop=center 200w, https://cdn.shopify.com/static/sample-images/garnished.jpeg?width=400&height=400&crop=center 400w'
121
+ */
122
+ export declare function generateSrcSet(src?: string, sizesArray?: Array<{
123
+ width?: number;
124
+ height?: number;
125
+ crop?: Crop;
126
+ }>, loader?: Loader, isContained?: boolean): string;
127
+ /**
128
+ * This function generates an array of sizes for Shopify images, for both fixed and responsive images.
129
+ * @param width - The CSS width of the image
130
+ * @param intervals - The number of intervals to generate
131
+ * @param startingWidth - The starting width of the image
132
+ * @param incrementSize - The size of each interval
133
+ * @returns An array of widths
134
+ */
135
+ export declare function generateImageWidths(width: string | number | undefined, intervals: number, startingWidth: number, incrementSize: number): number[];
136
+ /**
137
+ * Simple utility function to convert an aspect ratio CSS string to a decimal, currently only supports values like `1:1`, not `0.5`, or `auto`
138
+ * @param aspectRatio - The aspect ratio of the image, e.g. `1:1`
139
+ * @returns The aspect ratio as a number, e.g. `1`
140
+ *
141
+ * {@link https://developer.mozilla.org/en-US/docs/Web/CSS/aspect-ratio}
142
+ */
143
+ export declare function parseAspectRatio(aspectRatio?: string): number | undefined;
144
+ /**
145
+ * Generate sizes for Imagery loader
146
+ * @param imageWidths
147
+ * @param aspectRatio
148
+ * @param crop
149
+ * @returns
150
+ */
151
+ export declare function generateSizes(imageWidths?: number[], aspectRatio?: string, crop?: Crop): {
152
+ width: number;
153
+ height: number | undefined;
154
+ crop: Crop;
155
+ }[] | undefined;
156
+ export {};
157
+ //# sourceMappingURL=image.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../components/ui/image.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,KAAK,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAM1D,KAAK,aAAa,GAAG;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,aAAa,EAAE,MAAM,CAAA;IACrB,aAAa,EAAE,MAAM,CAAA;IACrB,gBAAgB,EAAE,MAAM,CAAA;CACzB,CAAA;AAUD,MAAM,MAAM,YAAY,GAAG;IACzB,GAAG,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,CAAA;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,MAAM,GAAG,CAAC,MAAM,EAAE,YAAY,KAAK,MAAM,CAAA;AAKrD,KAAK,IAAI,GAAG,QAAQ,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAA;AAE1D,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,qBAAqB,CAAC,KAAK,CAAC,GAChE,qBAAqB,CAAA;AAEvB,KAAK,qBAAqB,GAAG;IAC3B;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,IAAI,CAAC,EAAE,WAAW,CAAC,SAAS,EAAE;QAAE,iBAAiB,EAAE,IAAI,CAAA;KAAE,CAAC,CAAA;IAC1D;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,qFAAqF;IACrF,aAAa,CAAC,EAAE,aAAa,CAAA;IAE7B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,YAAY,CAAA;CACzE,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,KAAK,yGA8KjB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,aAAa,CAAC,EAC5B,GAAG,EACH,KAAK,EACL,MAAM,EACN,IAAI,EACJ,WAAW,GACZ,EAAE,YAAY,UAiBd;AAiED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,GAAG,CAAC,EAAE,MAAM,EACZ,UAAU,CAAC,EAAE,KAAK,CAAC;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC,EACpE,MAAM,GAAE,MAAsB,EAC9B,WAAW,UAAQ,GAClB,MAAM,CAiBR;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,6BAA0B,EAC/B,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,MAAM,GACpB,MAAM,EAAE,CAUV;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAIzE;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,WAAW,CAAC,EAAE,MAAM,EAAE,EACtB,WAAW,CAAC,EAAE,MAAM,EACpB,IAAI,GAAE,IAAe,GAEnB;IACE,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,IAAI,EAAE,IAAI,CAAA;CACX,EAAE,GACH,SAAS,CAUZ"}