@tapcart/mobile-components 0.7.64 → 0.7.65

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.
@@ -47,7 +47,7 @@ export declare const useMockCart: ({ apiUrl, appId, enabled, limit, }: UseMockCa
47
47
  createdAt: string;
48
48
  displayName: string;
49
49
  inventoryPolicy: "continue" | "deny";
50
- inventoryQuantity: number;
50
+ quantityAvailable: number;
51
51
  legacyResourceId: string;
52
52
  metafield?: import("app-studio-types").Metafield | undefined;
53
53
  position: number;
@@ -60,10 +60,16 @@ export declare const useMockCart: ({ apiUrl, appId, enabled, limit, }: UseMockCa
60
60
  };
61
61
  };
62
62
  sellingPlanAllocation: {
63
- priceAdjustments: [{
64
- perDeliveryPrice: Money;
65
- price: Money;
66
- }];
63
+ priceAdjustments: {
64
+ perDeliveryPrice: {
65
+ amount: string;
66
+ currencyCode: string;
67
+ };
68
+ price: {
69
+ amount: string;
70
+ currencyCode: string;
71
+ };
72
+ };
67
73
  sellingPlan: {
68
74
  id: string;
69
75
  name: string;
@@ -154,6 +160,7 @@ export declare const useMockCart: ({ apiUrl, appId, enabled, limit, }: UseMockCa
154
160
  currencyCode: string;
155
161
  };
156
162
  }[];
163
+ checkoutUrl: string;
157
164
  };
158
165
  };
159
166
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"use-mock-cart.d.ts","sourceRoot":"","sources":["../../../components/hooks/use-mock-cart.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,6BAA6B,EAAE,MAAM,kBAAkB,CAAA;AAsLhF,KAAK,iBAAiB,GAAG;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,eAAO,MAAM,WAAW,uCAKrB,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sCAzGc,KAAK;2BAChB,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0I3B,CAAA"}
1
+ {"version":3,"file":"use-mock-cart.d.ts","sourceRoot":"","sources":["../../../components/hooks/use-mock-cart.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,6BAA6B,EAAE,MAAM,kBAAkB,CAAA;AAgLhF,KAAK,iBAAiB,GAAG;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,eAAO,MAAM,WAAW,uCAKrB,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCnB,CAAA"}
@@ -27,6 +27,7 @@ const cartMock = {
27
27
  presentmentAmountUsed: { amount: "10.00", currencyCode: "USD" },
28
28
  },
29
29
  ],
30
+ checkoutUrl: "",
30
31
  };
31
32
  const transformCart = ({ products, cartOrigin = cartMock, }) => {
32
33
  let subtotal = cartOrigin.subtotal;
@@ -59,18 +60,16 @@ const transformCart = ({ products, cartOrigin = cartMock, }) => {
59
60
  }
60
61
  const sellingPlanAllocation = i === 0
61
62
  ? {
62
- priceAdjustments: [
63
- {
64
- perDeliveryPrice: {
65
- amount: price,
66
- currencyCode: "USD",
67
- },
68
- price: {
69
- amount: price,
70
- currencyCode: "USD",
71
- },
63
+ priceAdjustments: {
64
+ perDeliveryPrice: {
65
+ amount: price.toString(),
66
+ currencyCode: "USD",
72
67
  },
73
- ],
68
+ price: {
69
+ amount: price.toString(),
70
+ currencyCode: "USD",
71
+ },
72
+ },
74
73
  sellingPlan: {
75
74
  id: "gid://shopify/SellingPlan/123",
76
75
  name: "Delivery every 30 Days",
@@ -7,6 +7,8 @@ export interface QuantityPickerProps extends React.HTMLAttributes<HTMLDivElement
7
7
  iconColor: string;
8
8
  onDecreaseClick: React.ReactEventHandler;
9
9
  onIncreaseClick: React.ReactEventHandler;
10
+ isDecreaseDisabled?: boolean;
11
+ isIncreaseDisabled?: boolean;
10
12
  value: number;
11
13
  setValue: (_: number) => void;
12
14
  className?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"quantity-picker.d.ts","sourceRoot":"","sources":["../../../components/ui/quantity-picker.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B,MAAM,WAAW,mBACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC5C,eAAe,EAAE,MAAM,CAAA;IACvB,eAAe,EAAE,MAAM,CAAA;IACvB,aAAa,EAAE,MAAM,CAAA;IACrB,YAAY,EAAE,OAAO,CAAA;IACrB,SAAS,EAAE,MAAM,CAAA;IACjB,eAAe,EAAE,KAAK,CAAC,iBAAiB,CAAA;IACxC,eAAe,EAAE,KAAK,CAAC,iBAAiB,CAAA;IACxC,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IAChC,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IACjC,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAC5B;AAiCD,QAAA,MAAM,cAAc,4FAmFnB,CAAA;AAID,OAAO,EAAE,cAAc,EAAE,CAAA"}
1
+ {"version":3,"file":"quantity-picker.d.ts","sourceRoot":"","sources":["../../../components/ui/quantity-picker.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B,MAAM,WAAW,mBACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC5C,eAAe,EAAE,MAAM,CAAA;IACvB,eAAe,EAAE,MAAM,CAAA;IACvB,aAAa,EAAE,MAAM,CAAA;IACrB,YAAY,EAAE,OAAO,CAAA;IACrB,SAAS,EAAE,MAAM,CAAA;IACjB,eAAe,EAAE,KAAK,CAAC,iBAAiB,CAAA;IACxC,eAAe,EAAE,KAAK,CAAC,iBAAiB,CAAA;IACxC,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IAChC,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IACjC,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAC5B;AAmCD,QAAA,MAAM,cAAc,4FAuFnB,CAAA;AAID,OAAO,EAAE,cAAc,EAAE,CAAA"}
@@ -15,14 +15,14 @@ import * as React from "react";
15
15
  import { cn } from "../../lib/utils";
16
16
  import { Icon } from "./icon";
17
17
  import { useTap } from "./tap";
18
- const IconButton = ({ iconUrl, iconColor, handler, className, style }) => {
18
+ const IconButton = ({ iconUrl, iconColor, handler, className, style, disabled }) => {
19
19
  const { onTap, isPressed, ref: tapRef } = useTap();
20
- return (_jsx("button", Object.assign({ onClick: onTap(handler), ref: tapRef, className: cn("flex items-center justify-center h-7 w-7 bg-stateColors-skeleton border border-coreColors-dividingLines", className), style: style }, { children: _jsx(Icon, { url: iconUrl, size: "sm", strokeColor: iconColor, strokeWidth: 4, style: {
20
+ return (_jsx("button", Object.assign({ onClick: onTap(handler), ref: tapRef, className: cn("flex items-center justify-center h-7 w-7 bg-stateColors-skeleton border border-coreColors-dividingLines", className), style: style, disabled: disabled }, { children: _jsx(Icon, { url: iconUrl, size: "sm", strokeColor: iconColor, strokeWidth: 4, style: {
21
21
  opacity: isPressed ? 0.7 : 1,
22
22
  } }) })));
23
23
  };
24
24
  const QuantityPicker = React.forwardRef((_a, ref) => {
25
- var { className, decreaseIconUrl, increaseIconUrl, deleteIconUrl, isDeleteOnly = false, iconColor, onDecreaseClick, onIncreaseClick, value, setValue, inputStyle, buttonStyle, buttonCornerRadius = 4 } = _a, props = __rest(_a, ["className", "decreaseIconUrl", "increaseIconUrl", "deleteIconUrl", "isDeleteOnly", "iconColor", "onDecreaseClick", "onIncreaseClick", "value", "setValue", "inputStyle", "buttonStyle", "buttonCornerRadius"]);
25
+ var { className, decreaseIconUrl, increaseIconUrl, deleteIconUrl, isDeleteOnly = false, iconColor, onDecreaseClick, onIncreaseClick, isDecreaseDisabled, isIncreaseDisabled, value, setValue, inputStyle, buttonStyle, buttonCornerRadius = 4 } = _a, props = __rest(_a, ["className", "decreaseIconUrl", "increaseIconUrl", "deleteIconUrl", "isDeleteOnly", "iconColor", "onDecreaseClick", "onIncreaseClick", "isDecreaseDisabled", "isIncreaseDisabled", "value", "setValue", "inputStyle", "buttonStyle", "buttonCornerRadius"]);
26
26
  const leftButtonStyle = Object.assign(Object.assign({}, buttonStyle), { borderTopLeftRadius: buttonCornerRadius
27
27
  ? `${buttonCornerRadius}px`
28
28
  : undefined, borderBottomLeftRadius: buttonCornerRadius
@@ -34,7 +34,7 @@ const QuantityPicker = React.forwardRef((_a, ref) => {
34
34
  ? `${buttonCornerRadius}px`
35
35
  : undefined });
36
36
  const singleButtonStyle = Object.assign(Object.assign({}, buttonStyle), { borderRadius: buttonCornerRadius ? `${buttonCornerRadius}px` : undefined });
37
- return (_jsx("div", Object.assign({ className: cn("flex", className), ref: ref }, props, { children: isDeleteOnly ? (_jsx(IconButton, { handler: onDecreaseClick, iconUrl: deleteIconUrl, iconColor: iconColor, style: singleButtonStyle })) : (_jsxs(_Fragment, { children: [_jsx(IconButton, { handler: onDecreaseClick, iconUrl: value === 1 ? deleteIconUrl : decreaseIconUrl, iconColor: iconColor, style: leftButtonStyle }), _jsx("input", { type: "text", pattern: "[0-9]*", value: value, onBlur: (e) => (e.target.value = value.toString()), onFocus: (e) => (e.target.value = ""), onChange: (e) => setValue(parseInt(e.target.value) || 0), className: "w-8 h-7 focus-visible:outline-none text-center bg-coreColors-inputBackground text-textColors-primaryColor border-t border-b border-coreColors-dividingLines", style: inputStyle }), _jsx(IconButton, { handler: onIncreaseClick, iconUrl: increaseIconUrl, iconColor: iconColor, style: rightButtonStyle })] })) })));
37
+ return (_jsx("div", Object.assign({ className: cn("flex", className), ref: ref }, props, { children: isDeleteOnly ? (_jsx(IconButton, { handler: onDecreaseClick, iconUrl: deleteIconUrl, iconColor: iconColor, style: singleButtonStyle })) : (_jsxs(_Fragment, { children: [_jsx(IconButton, { handler: onDecreaseClick, iconUrl: value === 1 ? deleteIconUrl : decreaseIconUrl, iconColor: iconColor, style: leftButtonStyle, disabled: isDecreaseDisabled }), _jsx("input", { type: "text", pattern: "[0-9]*", value: value, onBlur: (e) => (e.target.value = value.toString()), onFocus: (e) => (e.target.value = ""), onChange: (e) => setValue(parseInt(e.target.value) || 0), className: "w-8 h-7 focus-visible:outline-none text-center bg-coreColors-inputBackground text-textColors-primaryColor border-t border-b border-coreColors-dividingLines", style: inputStyle }), _jsx(IconButton, { handler: onIncreaseClick, iconUrl: increaseIconUrl, iconColor: iconColor, style: rightButtonStyle, disabled: isIncreaseDisabled })] })) })));
38
38
  });
39
39
  QuantityPicker.displayName = "QuantityPicker";
40
40
  export { QuantityPicker };
@@ -22,7 +22,7 @@ const Wishlist = React.forwardRef((_a, ref) => {
22
22
  var { selected = false, onClick, className, name, amount, imgUrl, aspectRatio, objectFit, isTrigger, translations, nameStyle, amountStyle } = _a, props = __rest(_a, ["selected", "onClick", "className", "name", "amount", "imgUrl", "aspectRatio", "objectFit", "isTrigger", "translations", "nameStyle", "amountStyle"]);
23
23
  return (_jsxs("button", Object.assign({ className: cn("flex flex-row items-center px-4 py-2 w-full ", selected ? "bg-stateColors-skeleton" : "", className), ref: ref, onClick: onClick }, props, { children: [imgUrl ? (_jsx("div", Object.assign({ className: "h-10 w-10 border border-coreColors-dividingLines rounded-sm overflow-hidden", style: {
24
24
  flex: "0 1 auto",
25
- } }, { children: _jsx("img", { alt: "wishlist-image", src: `${imgUrl}?width=40`, width: 40, height: 40, className: cn("rounded-sm w-full h-full", objectFit === "contain" ? "object-contain" : "object-cover") }) }))) : (_jsx(PlaceholderIcon, {})), _jsxs("div", Object.assign({ className: "flex flex-col flex-1 items-start mx-2 space-y-1 overflow-hidden" }, { children: [isTrigger && _jsx(Text, Object.assign({ type: "body-secondary" }, { children: "Wishlists" })), _jsx(Text, Object.assign({ type: "body-primary", className: "w-full overflow-hidden text-ellipsis whitespace-nowrap text-left", style: nameStyle }, { children: name })), !isTrigger && (_jsx(Text, Object.assign({ type: "body-secondary", className: "w-full overflow-hidden text-ellipsis whitespace-nowrap text-left", style: amountStyle }, { children: `${amount} ${amount !== 1
25
+ } }, { children: _jsx("img", { alt: "wishlist-image", src: `${imgUrl}?width=40`, width: 40, height: 40, className: cn("rounded-sm w-full h-full", objectFit === "contain" ? "object-contain" : "object-cover") }) }))) : (_jsx(PlaceholderIcon, {})), _jsxs("div", Object.assign({ className: "flex flex-col flex-1 items-start mx-2 overflow-hidden" }, { children: [isTrigger && _jsx(Text, Object.assign({ type: "body-secondary" }, { children: "Wishlists" })), _jsx(Text, Object.assign({ type: "body-primary", className: "w-full overflow-hidden text-ellipsis whitespace-nowrap text-left", style: nameStyle }, { children: name })), !isTrigger && (_jsx(Text, Object.assign({ type: "body-secondary", className: "w-full overflow-hidden text-ellipsis whitespace-nowrap text-left", style: amountStyle }, { children: `${amount} ${amount !== 1
26
26
  ? translations["checkout-summary-items"]
27
27
  : translations["checkout-summary-item"]}` })))] }))] })));
28
28
  });
@@ -19,6 +19,7 @@ const baseCartData = {
19
19
  totalAmount: { amount: "0", currencyCode: "" },
20
20
  totalTaxAmount: { amount: "0", currencyCode: "" },
21
21
  },
22
+ checkoutUrl: "",
22
23
  };
23
24
  describe("cart-provider.util", () => {
24
25
  describe("getData", () => {
package/dist/styles.css CHANGED
@@ -998,9 +998,6 @@ video {
998
998
  .h-\[22px\] {
999
999
  height: 22px;
1000
1000
  }
1001
- .h-\[36\] {
1002
- height: 36;
1003
- }
1004
1001
  .h-\[38px\] {
1005
1002
  height: 38px;
1006
1003
  }
@@ -1097,9 +1094,6 @@ video {
1097
1094
  .w-\[138px\] {
1098
1095
  width: 138px;
1099
1096
  }
1100
- .w-\[154px\] {
1101
- width: 154px;
1102
- }
1103
1097
  .w-\[1px\] {
1104
1098
  width: 1px;
1105
1099
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tapcart/mobile-components",
3
- "version": "0.7.64",
3
+ "version": "0.7.65",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "style": "dist/styles.css",
@@ -34,9 +34,9 @@
34
34
  "ts-jest": "^29.2.5",
35
35
  "tsc-alias": "^1.8.10",
36
36
  "typescript": "^4.5.2",
37
- "app-studio-types": "0.0.7",
38
- "tsconfig": "0.0.0",
39
- "eslint-config-custom": "0.0.0"
37
+ "app-studio-types": "0.0.8",
38
+ "eslint-config-custom": "0.0.0",
39
+ "tsconfig": "0.0.0"
40
40
  },
41
41
  "dependencies": {
42
42
  "@radix-ui/react-accordion": "^1.1.2",