@tapcart/mobile-components 0.8.71 → 0.8.73

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 (30) hide show
  1. package/dist/components/hooks/use-nosto-recommendation.d.ts +4 -1
  2. package/dist/components/hooks/use-nosto-recommendation.d.ts.map +1 -1
  3. package/dist/components/hooks/use-nosto-recommendation.js +40 -26
  4. package/dist/components/hooks/use-products.d.ts +3 -3
  5. package/dist/components/hooks/use-products.d.ts.map +1 -1
  6. package/dist/components/hooks/use-products.js +16 -4
  7. package/dist/components/ui/accordion.js +1 -1
  8. package/dist/components/ui/button.d.ts.map +1 -1
  9. package/dist/components/ui/button.js +16 -3
  10. package/dist/components/ui/checkbox.js +1 -1
  11. package/dist/components/ui/chip.js +1 -1
  12. package/dist/components/ui/favorite.js +1 -1
  13. package/dist/components/ui/html.d.ts +2 -1
  14. package/dist/components/ui/html.d.ts.map +1 -1
  15. package/dist/components/ui/html.js +3 -2
  16. package/dist/components/ui/loading-dots.d.ts +1 -1
  17. package/dist/components/ui/loading-dots.d.ts.map +1 -1
  18. package/dist/components/ui/product-card.js +1 -1
  19. package/dist/components/ui/quantity-picker.d.ts.map +1 -1
  20. package/dist/components/ui/quantity-picker.js +11 -66
  21. package/dist/components/ui/quantity-pickerNEW.d.ts.map +1 -1
  22. package/dist/components/ui/quantity-pickerNEW.js +1 -3
  23. package/dist/components/ui/radio-group.js +1 -1
  24. package/dist/components/ui/tabs.d.ts.map +1 -1
  25. package/dist/components/ui/tabs.js +1 -1
  26. package/dist/components/ui/tap.d.ts.map +1 -1
  27. package/dist/components/ui/tap.js +1 -1
  28. package/dist/components/ui/toggle.js +1 -1
  29. package/dist/styles.css +9 -24
  30. package/package.json +1 -1
@@ -7,7 +7,10 @@ export declare enum NostoRecommendationsType {
7
7
  BEST_SELLERS = "BEST_SELLERS",
8
8
  VIEWED_CATEGORY = "VIEWED_CATEGORY"
9
9
  }
10
- export declare function useNostoRecommendations(integrations: Integrations, baseURL: string, slotId?: string, country?: string, recommendationsType?: NostoRecommendationsType | "", productIds?: string[], skip?: boolean, mockFallback?: boolean, mockFallbackAppId?: string): {
10
+ export declare function useNostoRecommendations(integrations: Integrations, baseURL: string, slotId?: string, country?: string, recommendationsType?: NostoRecommendationsType | "", productIds?: string[], skip?: boolean, mockFallback?: boolean, mockFallbackAppId?: string, session?: {
11
+ sessionId: string;
12
+ lastSessionEventTimestamp: number;
13
+ }): {
11
14
  recommendations: import("app-studio-types").Product[];
12
15
  isLoading: boolean;
13
16
  error: any;
@@ -1 +1 @@
1
- {"version":3,"file":"use-nosto-recommendation.d.ts","sourceRoot":"","sources":["../../../components/hooks/use-nosto-recommendation.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAe/C,oBAAY,wBAAwB;IAClC,eAAe,oBAAoB;IACnC,eAAe,oBAAoB;IACnC,qBAAqB,0BAA0B;IAC/C,WAAW,gBAAgB;IAC3B,YAAY,iBAAiB;IAC7B,eAAe,oBAAoB;CACpC;AAyRD,wBAAgB,uBAAuB,CACrC,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,MAAM,EACf,MAAM,SAAK,EACX,OAAO,SAAO,EACd,mBAAmB,CAAC,EAAE,wBAAwB,GAAG,EAAE,EACnD,UAAU,CAAC,EAAE,MAAM,EAAE,EACrB,IAAI,CAAC,EAAE,OAAO,EACd,YAAY,CAAC,EAAE,OAAO,EACtB,iBAAiB,CAAC,EAAE,MAAM;;;;;EA6C3B"}
1
+ {"version":3,"file":"use-nosto-recommendation.d.ts","sourceRoot":"","sources":["../../../components/hooks/use-nosto-recommendation.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAe/C,oBAAY,wBAAwB;IAClC,eAAe,oBAAoB;IACnC,eAAe,oBAAoB;IACnC,qBAAqB,0BAA0B;IAC/C,WAAW,gBAAgB;IAC3B,YAAY,iBAAiB;IAC7B,eAAe,oBAAoB;CACpC;AAwTD,wBAAgB,uBAAuB,CACrC,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,MAAM,EACf,MAAM,SAAK,EACX,OAAO,SAAO,EACd,mBAAmB,CAAC,EAAE,wBAAwB,GAAG,EAAE,EACnD,UAAU,CAAC,EAAE,MAAM,EAAE,EACrB,IAAI,CAAC,EAAE,OAAO,EACd,YAAY,CAAC,EAAE,OAAO,EACtB,iBAAiB,CAAC,EAAE,MAAM,EAC1B,OAAO,CAAC,EAAE;IACR,SAAS,EAAE,MAAM,CAAA;IACjB,yBAAyB,EAAE,MAAM,CAAA;CAClC;;;;;EAwDF"}
@@ -20,6 +20,8 @@ export var NostoRecommendationsType;
20
20
  NostoRecommendationsType["BEST_SELLERS"] = "BEST_SELLERS";
21
21
  NostoRecommendationsType["VIEWED_CATEGORY"] = "VIEWED_CATEGORY";
22
22
  })(NostoRecommendationsType || (NostoRecommendationsType = {}));
23
+ // Nosto sessions expire after 30 minutes. We use 29.5 minutes to be safe
24
+ const NOSTO_SESSION_EXPIRATION_TIME = 29.5 * 60 * 1000;
23
25
  const fetchNosto = (nostoKey, graphqlBody, mode) => __awaiter(void 0, void 0, void 0, function* () {
24
26
  const url = "https://api.nosto.com/v1/graphql";
25
27
  const headers = new Headers({
@@ -38,28 +40,34 @@ const fetchNosto = (nostoKey, graphqlBody, mode) => __awaiter(void 0, void 0, vo
38
40
  const getProductIdsFromPageResponse = (pageResponse) => {
39
41
  return ((pageResponse === null || pageResponse === void 0 ? void 0 : pageResponse.flatMap((page) => page.primary).filter((item) => item && item.productId).map((item) => item.productId)) || []);
40
42
  };
41
- const fetchFrontPageRecommendations = (nostoKey, slotId) => __awaiter(void 0, void 0, void 0, function* () {
43
+ const resolveSessionId = (nostoKey, optionalSessionId) => __awaiter(void 0, void 0, void 0, function* () {
44
+ if (optionalSessionId) {
45
+ return optionalSessionId;
46
+ }
47
+ else {
48
+ const sessionData = yield fetchNosto(nostoKey, newSessionQuery);
49
+ return sessionData.data.newSession;
50
+ }
51
+ });
52
+ const fetchFrontPageRecommendations = (nostoKey, slotId, optionalSessionId) => __awaiter(void 0, void 0, void 0, function* () {
42
53
  var _a, _b, _c;
43
54
  // Fetch sessionId
44
- const sessionData = yield fetchNosto(nostoKey, newSessionQuery);
45
- const sessionId = sessionData.data.newSession;
55
+ const sessionId = yield resolveSessionId(nostoKey, optionalSessionId);
46
56
  // Main recommendation query
47
57
  const body = getFrontPageRecommendationsQuery(sessionId, slotId);
48
58
  const response = yield fetchNosto(nostoKey, body, "cors");
49
59
  return getProductIdsFromPageResponse((_c = (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.updateSession) === null || _b === void 0 ? void 0 : _b.pages) === null || _c === void 0 ? void 0 : _c.forFrontPage);
50
60
  });
51
- const fetchProductPageRecommendations = (nostoKey, productId, slotId) => __awaiter(void 0, void 0, void 0, function* () {
61
+ const fetchProductPageRecommendations = (nostoKey, productId, slotId, optionalSessionId) => __awaiter(void 0, void 0, void 0, function* () {
52
62
  var _d, _e, _f;
53
- const sessionData = yield fetchNosto(nostoKey, newSessionQuery);
54
- const sessionId = sessionData.data.newSession;
63
+ const sessionId = yield resolveSessionId(nostoKey, optionalSessionId);
55
64
  const body = getProductPageRecommendationsQuery(sessionId, productId, slotId);
56
65
  const response = yield fetchNosto(nostoKey, body, "cors");
57
66
  return getProductIdsFromPageResponse((_f = (_e = (_d = response.data) === null || _d === void 0 ? void 0 : _d.updateSession) === null || _e === void 0 ? void 0 : _e.pages) === null || _f === void 0 ? void 0 : _f.forProductPage);
58
67
  });
59
- const fetchCategoryPageRecommendations = (nostoKey, sourceCollectionTitle) => __awaiter(void 0, void 0, void 0, function* () {
68
+ const fetchCategoryPageRecommendations = (nostoKey, sourceCollectionTitle, optionalSessionId) => __awaiter(void 0, void 0, void 0, function* () {
60
69
  var _g, _h, _j;
61
- const sessionData = yield fetchNosto(nostoKey, newSessionQuery);
62
- const sessionId = sessionData.data.newSession;
70
+ const sessionId = yield resolveSessionId(nostoKey, optionalSessionId);
63
71
  const body = categoryPageRecommendationsQuery(sessionId, sourceCollectionTitle);
64
72
  const response = yield fetchNosto(nostoKey, body, "cors");
65
73
  return getProductIdsFromPageResponse((_j = (_h = (_g = response.data) === null || _g === void 0 ? void 0 : _g.updateSession) === null || _h === void 0 ? void 0 : _h.pages) === null || _j === void 0 ? void 0 : _j.forCategoryPage);
@@ -78,21 +86,21 @@ const fetchRelatedProductsRecommendations = (nostoKey, recommendationsType, prod
78
86
  const recommendedProductIds = ((_s = (_r = (_q = (_p = response === null || response === void 0 ? void 0 : response.data) === null || _p === void 0 ? void 0 : _p.recos) === null || _q === void 0 ? void 0 : _q.related) === null || _r === void 0 ? void 0 : _r.primary) === null || _s === void 0 ? void 0 : _s.map((item) => item.productId)) || [];
79
87
  return recommendedProductIds;
80
88
  });
81
- const fetchPDPFallbackRecommendations = (nostoKey, productId, recommendationsType = NostoRecommendationsType.BOUGHT_TOGETHER) => __awaiter(void 0, void 0, void 0, function* () {
89
+ const fetchPDPFallbackRecommendations = (nostoKey, productId, recommendationsType = NostoRecommendationsType.BOUGHT_TOGETHER, sessionId) => __awaiter(void 0, void 0, void 0, function* () {
82
90
  switch (recommendationsType) {
83
91
  case NostoRecommendationsType.VIEWED_CATEGORY:
84
- return fetchCategoryPageRecommendations(nostoKey, productId);
92
+ return fetchCategoryPageRecommendations(nostoKey, productId, sessionId);
85
93
  case NostoRecommendationsType.BEST_SELLERS:
86
94
  return fetchBestSellersRecommendations(nostoKey);
87
95
  default:
88
96
  return fetchRelatedProductsRecommendations(nostoKey, recommendationsType, [productId]);
89
97
  }
90
98
  });
91
- const fetchHomeRecommendations = (nostoKey, slotId) => __awaiter(void 0, void 0, void 0, function* () {
99
+ const fetchHomeRecommendations = (nostoKey, slotId, sessionId) => __awaiter(void 0, void 0, void 0, function* () {
92
100
  let productIdRecommendations = [];
93
101
  if (slotId) {
94
102
  try {
95
- productIdRecommendations = yield fetchFrontPageRecommendations(nostoKey, slotId);
103
+ productIdRecommendations = yield fetchFrontPageRecommendations(nostoKey, slotId, sessionId);
96
104
  if (productIdRecommendations.length === 0) {
97
105
  productIdRecommendations = yield fetchBestSellersRecommendations(nostoKey);
98
106
  }
@@ -106,37 +114,37 @@ const fetchHomeRecommendations = (nostoKey, slotId) => __awaiter(void 0, void 0,
106
114
  }
107
115
  return productIdRecommendations;
108
116
  });
109
- const fetchPDPRecommendations = (nostoKey, productId, slotId, recommendationsType = NostoRecommendationsType.BOUGHT_TOGETHER) => __awaiter(void 0, void 0, void 0, function* () {
117
+ const fetchPDPRecommendations = (nostoKey, productId, slotId, recommendationsType = NostoRecommendationsType.BOUGHT_TOGETHER, sessionId) => __awaiter(void 0, void 0, void 0, function* () {
110
118
  let productIdRecommendations = [];
111
119
  if (slotId) {
112
120
  try {
113
- productIdRecommendations = yield fetchProductPageRecommendations(nostoKey, productId, slotId);
121
+ productIdRecommendations = yield fetchProductPageRecommendations(nostoKey, productId, slotId, sessionId);
114
122
  if (productIdRecommendations.length === 0) {
115
- productIdRecommendations = yield fetchPDPFallbackRecommendations(nostoKey, productId, recommendationsType);
123
+ productIdRecommendations = yield fetchPDPFallbackRecommendations(nostoKey, productId, recommendationsType, sessionId);
116
124
  }
117
125
  }
118
126
  catch (error) {
119
- productIdRecommendations = yield fetchPDPFallbackRecommendations(nostoKey, productId, recommendationsType);
127
+ productIdRecommendations = yield fetchPDPFallbackRecommendations(nostoKey, productId, recommendationsType, sessionId);
120
128
  }
121
129
  }
122
130
  else {
123
- productIdRecommendations = yield fetchPDPFallbackRecommendations(nostoKey, productId, recommendationsType);
131
+ productIdRecommendations = yield fetchPDPFallbackRecommendations(nostoKey, productId, recommendationsType, sessionId);
124
132
  }
125
133
  return productIdRecommendations;
126
134
  });
127
- const getProductIdRecommendations = (nostoKey, slotId = "", recommendationsType, productIds, skip) => __awaiter(void 0, void 0, void 0, function* () {
135
+ const getProductIdRecommendations = (nostoKey, slotId = "", recommendationsType, productIds, skip, sessionId) => __awaiter(void 0, void 0, void 0, function* () {
128
136
  if (skip) {
129
137
  return [];
130
138
  }
131
139
  const isPDP = productIds && productIds.length > 0;
132
140
  if (isPDP) {
133
- return fetchPDPRecommendations(nostoKey, productIds[0], slotId, recommendationsType);
141
+ return fetchPDPRecommendations(nostoKey, productIds[0], slotId, recommendationsType, sessionId);
134
142
  }
135
143
  else {
136
- return fetchHomeRecommendations(nostoKey, slotId);
144
+ return fetchHomeRecommendations(nostoKey, slotId, sessionId);
137
145
  }
138
146
  });
139
- function useNostoRecommendationsProductIds(nostoKey, slotId = "", recommendationsType, productIds, skip) {
147
+ function useNostoRecommendationsProductIds(nostoKey, slotId = "", recommendationsType, productIds, skip, sessionId) {
140
148
  const [recommendedProductIds, setRecommendedProductIds] = useState([]);
141
149
  const [isLoading, setIsLoading] = useState(true);
142
150
  const [error, setError] = useState(null);
@@ -148,7 +156,7 @@ function useNostoRecommendationsProductIds(nostoKey, slotId = "", recommendation
148
156
  setRecommendedProductIds([]);
149
157
  }
150
158
  else {
151
- const productIdRecommendations = yield getProductIdRecommendations(nostoKey, slotId, recommendationsType, productIds, skip);
159
+ const productIdRecommendations = yield getProductIdRecommendations(nostoKey, slotId, recommendationsType, productIds, skip, sessionId);
152
160
  setRecommendedProductIds(productIdRecommendations);
153
161
  }
154
162
  }
@@ -162,20 +170,26 @@ function useNostoRecommendationsProductIds(nostoKey, slotId = "", recommendation
162
170
  });
163
171
  }
164
172
  fetchNostoData();
165
- }, [nostoKey, slotId, recommendationsType, productIds, skip]);
173
+ }, [nostoKey, slotId, recommendationsType, productIds, skip, sessionId]);
166
174
  return {
167
175
  recommendedProductIds,
168
176
  isLoading,
169
177
  error,
170
178
  };
171
179
  }
172
- export function useNostoRecommendations(integrations, baseURL, slotId = "", country = "US", recommendationsType, productIds, skip, mockFallback, mockFallbackAppId) {
180
+ export function useNostoRecommendations(integrations, baseURL, slotId = "", country = "US", recommendationsType, productIds, skip, mockFallback, mockFallbackAppId, session) {
173
181
  var _a;
174
182
  if (recommendationsType === "") {
175
183
  recommendationsType = NostoRecommendationsType.BOUGHT_TOGETHER;
176
184
  }
177
185
  const nostoKey = (_a = integrations.find((integration) => integration.name === "nosto")) === null || _a === void 0 ? void 0 : _a.key;
178
- const { recommendedProductIds, isLoading, error } = useNostoRecommendationsProductIds(nostoKey, slotId, recommendationsType, productIds, skip);
186
+ let sessionId = null;
187
+ if ((session === null || session === void 0 ? void 0 : session.sessionId) &&
188
+ (session === null || session === void 0 ? void 0 : session.lastSessionEventTimestamp) >
189
+ Date.now() - NOSTO_SESSION_EXPIRATION_TIME) {
190
+ sessionId = session.sessionId;
191
+ }
192
+ const { recommendedProductIds, isLoading, error } = useNostoRecommendationsProductIds(nostoKey, slotId, recommendationsType, productIds, skip, sessionId);
179
193
  const shouldMock = useMemo(() => recommendedProductIds.length === 0 && !isLoading && mockFallback, [recommendedProductIds, isLoading, mockFallback]);
180
194
  const appId = shouldMock ? mockFallbackAppId : undefined;
181
195
  const { products, error: productsError, isLoading: productsLoading, } = useProducts({
@@ -5,9 +5,9 @@ type MetafieldInput = {
5
5
  key: string;
6
6
  };
7
7
  type UseProductsProps = {
8
- productIds: string[];
9
- variantIds?: string[] | undefined;
10
- productHandles: string[];
8
+ productIds?: string[];
9
+ variantIds?: string[];
10
+ productHandles?: string[];
11
11
  baseURL: URL;
12
12
  collection?: string;
13
13
  queryVariables?: Record<string, any>;
@@ -1 +1 @@
1
- {"version":3,"file":"use-products.d.ts","sourceRoot":"","sources":["../../../components/hooks/use-products.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAK1C,KAAK,GAAG,GAAG,MAAM,CAAA;AACjB,KAAK,cAAc,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAA;AACxD,KAAK,gBAAgB,GAAG;IACtB,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,UAAU,CA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CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;IACzB,OAAO,EAAE,GAAG,CAAA;IACZ,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACpC,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;IAC1E,UAAU,CAAC,EAAE,cAAc,EAAE,CAAA;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAChC,CAAA;AACD,KAAK,iBAAiB,GAAG;IACvB,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,KAAK,EAAE,GAAG,CAAA;IACV,SAAS,EAAE,OAAO,CAAA;IAClB,YAAY,EAAE,OAAO,CAAA;IACrB,YAAY,EAAE,CAAC,OAAO,EAAE,OAAO,KAC3B;QACE,EAAE,EAAE,MAAM,CAAA;QACV,MAAM,EAAE,MAAM,CAAA;KACf,GACD,SAAS,CAAA;CACd,CAAA;AAqDD,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,GAAG,iBAAiB,CAwJ7E"}
@@ -15,11 +15,22 @@ import ProductsLocalStorage from "../libs/cache/ProductsLocalStorage";
15
15
  const isUseProductsProps = (props) => {
16
16
  return Boolean(props);
17
17
  };
18
- const formatProductData = ({ data, onlyAvailableProducts = false, }) => {
18
+ const formatProductData = ({ data, onlyAvailableProducts = false, mock = false, }) => {
19
19
  const isProductsObject = (value) => {
20
20
  return value && "products" in value;
21
21
  };
22
22
  const products = isProductsObject(data) ? data.products : data || [];
23
+ if (mock) {
24
+ // Alternate availableForSale true/false for each product in the array
25
+ // Alternate availableForSale true/false for each product and its variants
26
+ const mixedProducts = products.map((product, idx) => {
27
+ const isAvailable = idx % 2 === 0;
28
+ return Object.assign(Object.assign({}, product), { availableForSale: isAvailable, variants: Array.isArray(product.variants)
29
+ ? product.variants.map((variant, vIdx) => (Object.assign(Object.assign({}, variant), { availableForSale: isAvailable })))
30
+ : product.variants });
31
+ });
32
+ return mixedProducts;
33
+ }
23
34
  return onlyAvailableProducts
24
35
  ? products === null || products === void 0 ? void 0 : products.filter((p) => {
25
36
  if (!onlyAvailableProducts)
@@ -41,7 +52,7 @@ export function useProducts(props) {
41
52
  }));
42
53
  const [isProductResponseReady, setIsProductResponseReady] = React.useState((productResponse === null || productResponse === void 0 ? void 0 : productResponse.length) > 0);
43
54
  if (isUseProductsProps(props)) {
44
- let { baseURL, productIds, variantIds, productHandles, metafields, collection, queryVariables, } = props;
55
+ let { baseURL, productIds = [], variantIds = [], productHandles = [], metafields, collection, queryVariables, } = props;
45
56
  if (shouldMockProducts) {
46
57
  // In mock mode, always use direct product fetching without collections
47
58
  queryVariables = Object.assign({}, queryVariables);
@@ -51,7 +62,7 @@ export function useProducts(props) {
51
62
  if ((productIds === null || productIds === void 0 ? void 0 : productIds.length) > 0) {
52
63
  queryParams.set("ids", getProductGidsFromIds(productIds).join(","));
53
64
  }
54
- if (variantIds && (variantIds === null || variantIds === void 0 ? void 0 : variantIds.length) > 0) {
65
+ if ((variantIds === null || variantIds === void 0 ? void 0 : variantIds.length) > 0) {
55
66
  queryParams.set("ids", getVariantGidsFromIds(variantIds).join(","));
56
67
  }
57
68
  if ((productHandles === null || productHandles === void 0 ? void 0 : productHandles.length) > 0) {
@@ -129,7 +140,8 @@ export function useProducts(props) {
129
140
  return {
130
141
  products: formatProductData({
131
142
  data: productResponse,
132
- onlyAvailableProducts: (props === null || props === void 0 ? void 0 : props.mock) && (props === null || props === void 0 ? void 0 : props.onlyAvailableProducts),
143
+ onlyAvailableProducts: props === null || props === void 0 ? void 0 : props.onlyAvailableProducts,
144
+ mock: props === null || props === void 0 ? void 0 : props.mock,
133
145
  }),
134
146
  error,
135
147
  isLoading: !isProductResponseReady,
@@ -23,7 +23,7 @@ const AccordionItem = React.forwardRef((_a, ref) => {
23
23
  AccordionItem.displayName = "AccordionItem";
24
24
  const AccordionTrigger = React.forwardRef((_a, ref) => {
25
25
  var { className, children, showDefaultIcon = true } = _a, props = __rest(_a, ["className", "children", "showDefaultIcon"]);
26
- return (_jsx(AccordionPrimitive.Header, Object.assign({ className: "flex" }, { children: _jsxs(AccordionPrimitive.Trigger, Object.assign({ ref: ref, className: cn("px-4 flex flex-1 items-center justify-between py-4 font-medium transition-all active:opacity-70", { "[&[data-state=open]_svg]:rotate-180": showDefaultIcon }, className) }, props, { children: [children, showDefaultIcon && (_jsx(Icon, { name: "chevron-down", size: "sm", className: "text-coreColors-secondaryIcon shrink-0 transition-transform duration-200" }))] })) })));
26
+ return (_jsx(AccordionPrimitive.Header, Object.assign({ className: "flex" }, { children: _jsxs(AccordionPrimitive.Trigger, Object.assign({ ref: ref, className: cn("px-4 flex flex-1 items-center justify-between py-4 font-medium transition-all", { "[&[data-state=open]_svg]:rotate-180": showDefaultIcon }, className) }, props, { children: [children, showDefaultIcon && (_jsx(Icon, { name: "chevron-down", size: "sm", className: "text-coreColors-secondaryIcon shrink-0 transition-transform duration-200" }))] })) })));
27
27
  });
28
28
  AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
29
29
  const AccordionContent = React.forwardRef((_a, ref) => {
@@ -1 +1 @@
1
- {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../components/ui/button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAGL,KAAK,EAEL,SAAS,EAET,oBAAoB,EACrB,MAAM,iBAAiB,CAAA;AAMxB,QAAA,MAAM,cAAc;;;mF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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkBJ,CAAA;AAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc,EAAE,CAAA"}
@@ -16,7 +16,8 @@ import { Slot } from "@radix-ui/react-slot";
16
16
  import { cva } from "class-variance-authority";
17
17
  import { cn, getColor, getTextStyle, getBackgroundAndPaddingStyle, } from "../../lib/utils";
18
18
  import { Icon } from "./icon";
19
- import { Text } from "./text";
19
+ import { Text, textVariants } from "./text";
20
+ import { Html } from "./html";
20
21
  // @ts-ignore -- webbridge-react is not typed (yet)
21
22
  import { useActions } from "@tapcart/app-studio-sdk";
22
23
  const buttonVariants = cva("w-full flex rounded items-center justify-center transition-colors disabled:bg-stateColors-disabled disabled:border-stateColors-disabled disabled:pointer-events-none ring-offset-background overflow-elipse whitespace-nowrap truncate disabled:opacity-70 cursor-pointer", {
@@ -108,11 +109,23 @@ const Button = (_a) => {
108
109
  }
109
110
  }
110
111
  : undefined;
112
+ // Check if children is an Html component
113
+ const isHtmlComponent = React.isValidElement(props.children) && props.children.type === Html;
114
+ const HtmlButton = () => {
115
+ var _a, _b;
116
+ return (_jsxs(_Fragment, { children: [icon || iconUrl ? (_jsx(Icon, { name: iconUrl ? undefined : icon, url: iconUrl, size: iconSize ? iconSize : "sm", className: cn(iconVariants({ variant }), {
117
+ "mr-2": iconPosition === "left",
118
+ "ml-2": iconPosition === "right",
119
+ }, iconClassName), style: { color: iconColor } })) : null, !loading && React.isValidElement(props.children) ? (React.cloneElement(props.children, {
120
+ className: cn(textVariants({ type: "body-primary" }), labelVariants({ variant }), labelClassName, (_a = props.children.props) === null || _a === void 0 ? void 0 : _a.className),
121
+ style: Object.assign(Object.assign({}, labelStyle), (_b = props.children.props) === null || _b === void 0 ? void 0 : _b.style),
122
+ })) : (_jsx(_Fragment, {}))] }));
123
+ };
111
124
  return (_jsx(Comp, Object.assign({ className: cn(buttonVariants({ variant, size }), className, {
112
125
  "pointer-events-none": loading,
113
126
  "flex-row-reverse": (icon || iconUrl) && iconPosition === "right",
114
- }), onClick: handleClick }, Object.assign({ type }, props), { children: loading ? (_jsx(LoadingButton, {})) : typeof props.children === "object" &&
115
- React.isValidElement(props.children) ? ( // if children are passed as a valid React element
127
+ }), onClick: handleClick }, Object.assign({ type }, props), { children: loading ? (_jsx(LoadingButton, {})) : isHtmlComponent ? ( // if children is Html component, use HtmlButton with icon logic
128
+ _jsx(HtmlButton, {})) : React.isValidElement(props.children) ? ( // if children are passed as a valid React element
116
129
  props.children // render it
117
130
  ) : // otherwise use props
118
131
  size === "icon" ? (_jsx(IconButton, {})) : (_jsx(BasicButton, {})) })));
@@ -23,7 +23,7 @@ const checkboxVariants = cva("flex flex-col group group-disabled", {
23
23
  variants: {
24
24
  deactivated: {
25
25
  true: "[&_p]:text-stateColors-disabled",
26
- false: "active:opacity-70",
26
+ false: "",
27
27
  },
28
28
  },
29
29
  defaultVariants: {
@@ -16,7 +16,7 @@ import { cn } from "../../lib/utils";
16
16
  import React, { useState, useEffect } from "react";
17
17
  import { Icon } from "./icon";
18
18
  import { LoadingDots } from "./loading-dots";
19
- const chipVariants = cva("inline-flex items-center justify-center rounded border border-coreColors-dividingLines text-[12px] transition-colors h-8 active:opacity-70 cursor-pointer", {
19
+ const chipVariants = cva("inline-flex items-center justify-center rounded border border-coreColors-dividingLines text-[12px] transition-colors h-8 cursor-pointer", {
20
20
  variants: {
21
21
  variant: {
22
22
  primary: "bg-coreColors-pageColor text-textColors-primaryColor",
@@ -54,7 +54,7 @@ const Favorite = (_a) => {
54
54
  console.error(error);
55
55
  }
56
56
  };
57
- return (_jsx("button", Object.assign({ onClick: onClick, className: cn("cursor-pointer active:opacity-70", favoriteVariants({
57
+ return (_jsx("button", Object.assign({ onClick: onClick, className: cn("cursor-pointer", favoriteVariants({
58
58
  size,
59
59
  showBackgroundShadow,
60
60
  layoutType,
@@ -3,7 +3,8 @@ interface HtmlProps {
3
3
  className?: any;
4
4
  style?: React.CSSProperties;
5
5
  html: string;
6
+ disableDefaultClasses?: boolean;
6
7
  }
7
- declare function Html({ className, style, html }: HtmlProps): import("react/jsx-runtime").JSX.Element;
8
+ declare function Html({ className, style, html, disableDefaultClasses, }: HtmlProps): import("react/jsx-runtime").JSX.Element;
8
9
  export { Html };
9
10
  //# sourceMappingURL=html.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../../components/ui/html.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,UAAU,SAAS;IACjB,SAAS,CAAC,EAAE,GAAG,CAAA;IACf,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IAC3B,IAAI,EAAE,MAAM,CAAA;CACb;AAED,iBAAS,IAAI,CAAC,EAAE,SAAc,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,SAAS,2CAyBvD;AAED,OAAO,EAAE,IAAI,EAAE,CAAA"}
1
+ {"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../../components/ui/html.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,UAAU,SAAS;IACjB,SAAS,CAAC,EAAE,GAAG,CAAA;IACf,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAChC;AAED,iBAAS,IAAI,CAAC,EACZ,SAAc,EACd,KAAK,EACL,IAAI,EACJ,qBAA6B,GAC9B,EAAE,SAAS,2CAyBX;AAED,OAAO,EAAE,IAAI,EAAE,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import DOMPurify from "dompurify";
3
3
  import { cn } from "../../lib/utils";
4
- function Html({ className = "", style, html }) {
4
+ function Html({ className = "", style, html, disableDefaultClasses = false, }) {
5
5
  // Configure DOMPurify to allow iframes and their common attributes
6
6
  const cleanHtml = DOMPurify.sanitize(html, {
7
7
  ADD_TAGS: ["iframe"],
@@ -15,6 +15,7 @@ function Html({ className = "", style, html }) {
15
15
  "height",
16
16
  ],
17
17
  });
18
- return (_jsx("div", { className: cn(className, "grid [&>ul]:list-disc [&>ol]:list-decimal [&>ul]:pl-5 [&>ul>li]:py-1 space-y-1 [&>b]:py-2 [&>p]:py-2"), style: style, dangerouslySetInnerHTML: { __html: cleanHtml } }));
18
+ const defaultClasses = "grid [&>ul]:list-disc [&>ol]:list-decimal [&>ul]:pl-5 [&>ul>li]:py-1 space-y-1 [&>b]:py-2 [&>p]:py-2";
19
+ return (_jsx("div", { className: cn(disableDefaultClasses ? "" : defaultClasses, className), style: style, dangerouslySetInnerHTML: { __html: cleanHtml } }));
19
20
  }
20
21
  export { Html };
@@ -1,5 +1,5 @@
1
1
  export interface LoadingDotsProps {
2
- iconColor: string;
2
+ iconColor?: string;
3
3
  size?: number;
4
4
  spacing?: 0 | 1 | 2 | 4;
5
5
  opacity?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"loading-dots.d.ts","sourceRoot":"","sources":["../../../components/ui/loading-dots.tsx"],"names":[],"mappings":"AAGA,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IACvB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB;AAED,eAAO,MAAM,WAAW,iEAOrB,gBAAgB,mDA6ClB,CAAA"}
1
+ {"version":3,"file":"loading-dots.d.ts","sourceRoot":"","sources":["../../../components/ui/loading-dots.tsx"],"names":[],"mappings":"AAGA,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IACvB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB;AAED,eAAO,MAAM,WAAW,iEAOrB,gBAAgB,mDA6ClB,CAAA"}
@@ -188,7 +188,7 @@ const ProductCard = ({ config, tapcartData, product, isLoading, favorited, onFav
188
188
  };
189
189
  const sizes = getImageSizes(config);
190
190
  const imageSwipeEnabled = ((_e = config.productImage) === null || _e === void 0 ? void 0 : _e.allowSwipeability) && product.images.length > 1;
191
- return (_jsx("div", Object.assign({ className: cn("w-1/2", className) }, { children: _jsxs("div", Object.assign({ className: "w-full active:opacity-70 cursor-pointer", onClick: () => {
191
+ return (_jsx("div", Object.assign({ className: cn("w-1/2", className) }, { children: _jsxs("div", Object.assign({ className: "w-full cursor-pointer", onClick: () => {
192
192
  _openProduct();
193
193
  }, onKeyDown: (e) => {
194
194
  if (e.key === "Enter" || e.key === " ") {
@@ -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;AAO9B,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,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,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;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AA4FD,QAAA,MAAM,cAAc,4FA8HnB,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;AAS9B,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,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,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;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAmCD,QAAA,MAAM,cAAc,4FAuGnB,CAAA;AAID,OAAO,EAAE,cAAc,EAAE,CAAA"}
@@ -10,47 +10,13 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  }
11
11
  return t;
12
12
  };
13
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
13
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
14
14
  import * as React from "react";
15
- import { cn } from "../../lib/utils";
15
+ import { cn, } from "../../lib/utils";
16
16
  import { Icon } from "./icon";
17
- import { LoadingDots } from "./loading-dots";
18
- // @ts-ignore -- webbridge-react is not typed (yet)
19
- import { useActions } from "@tapcart/app-studio-sdk";
20
- const IconButton = ({ iconUrl, iconColor, handler, className, style, disabled, disableHaptic = false, }) => {
21
- const [isButtonPressed, setIsButtonPressed] = React.useState(false);
22
- const { action } = useActions();
23
- const handleClick = (e) => {
24
- try {
25
- handler(e);
26
- if (!disableHaptic) {
27
- action("trigger/haptic");
28
- }
29
- }
30
- catch (error) {
31
- console.error(error);
32
- }
33
- };
34
- // Handle press state manually for the invisible button
35
- const handleMouseDown = React.useCallback(() => {
36
- if (!disabled)
37
- setIsButtonPressed(true);
38
- }, [disabled]);
39
- const handleMouseUp = React.useCallback(() => {
40
- setIsButtonPressed(false);
41
- }, []);
42
- // Calculate the visual styles for the button
17
+ const IconButton = ({ iconUrl, iconColor, handler, className, style, disabled }) => {
43
18
  const visualButtonStyle = Object.assign({}, style);
44
- return (_jsxs("div", Object.assign({ className: "relative h-7 w-7", style: { touchAction: "manipulation" } }, { children: [_jsx("div", Object.assign({ className: cn("absolute inset-0 flex items-center justify-center bg-stateColors-skeleton border border-coreColors-dividingLines", className, disabled ? "opacity-50" : ""), style: visualButtonStyle, "aria-hidden": "true" }, { children: _jsx(Icon, { url: iconUrl, size: "sm", strokeColor: iconColor, strokeWidth: 4, style: {
45
- opacity: isButtonPressed ? 0.7 : 1,
46
- } }) })), _jsx("button", { onClick: handleClick, onMouseDown: handleMouseDown, onMouseUp: handleMouseUp, onMouseLeave: handleMouseUp, onTouchStart: handleMouseDown, onTouchEnd: handleMouseUp, onTouchCancel: handleMouseUp, className: "absolute cursor-pointer", style: {
47
- top: "-8px",
48
- right: "-8px",
49
- bottom: "-8px",
50
- left: "-8px",
51
- opacity: 0,
52
- zIndex: 10,
53
- }, disabled: disabled, "aria-label": "Quantity button" })] })));
19
+ return (_jsx("button", Object.assign({ className: "relative h-7 w-7 cursor-pointer", onClick: handler, "aria-label": "Quantity button" }, { children: _jsx("div", Object.assign({ className: cn("absolute inset-0 flex items-center justify-center", className, disabled ? "opacity-50" : ""), style: visualButtonStyle, "aria-hidden": "true" }, { children: _jsx(Icon, { url: iconUrl, size: "xs", strokeColor: iconColor, strokeWidth: 4 }) })) })));
54
20
  };
55
21
  const QuantityPicker = React.forwardRef((_a, ref) => {
56
22
  var { className, decreaseIconUrl, increaseIconUrl, deleteIconUrl, isDeleteOnly = false, iconColor, onDecreaseClick, onIncreaseClick, isDecreaseDisabled, isIncreaseDisabled, value, setValue, inputStyle, buttonStyle, buttonCornerRadius = 4, max = 99, loading = false } = _a, props = __rest(_a, ["className", "decreaseIconUrl", "increaseIconUrl", "deleteIconUrl", "isDeleteOnly", "iconColor", "onDecreaseClick", "onIncreaseClick", "isDecreaseDisabled", "isIncreaseDisabled", "value", "setValue", "inputStyle", "buttonStyle", "buttonCornerRadius", "max", "loading"]);
@@ -61,40 +27,19 @@ const QuantityPicker = React.forwardRef((_a, ref) => {
61
27
  setLocalValue(value.toString());
62
28
  }
63
29
  }, [value, isFocused]);
64
- const leftButtonStyle = Object.assign(Object.assign({}, buttonStyle), { borderTopLeftRadius: buttonCornerRadius
30
+ const numberInputStyle = Object.assign({ display: "flex", width: "28px", height: "28px", border: "1px solid #E3E3E3", borderRadius: "8px", textAlign: "center", alignItems: "center", justifyContent: "center", fontSize: "14px" }, inputStyle);
31
+ const leftButtonStyle = Object.assign({ borderTopLeftRadius: buttonCornerRadius
65
32
  ? `${buttonCornerRadius}px`
66
33
  : undefined, borderBottomLeftRadius: buttonCornerRadius
67
34
  ? `${buttonCornerRadius}px`
68
- : undefined });
69
- const rightButtonStyle = Object.assign(Object.assign({}, buttonStyle), { borderTopRightRadius: buttonCornerRadius
35
+ : undefined }, buttonStyle);
36
+ const rightButtonStyle = Object.assign({ borderTopRightRadius: buttonCornerRadius
70
37
  ? `${buttonCornerRadius}px`
71
38
  : undefined, borderBottomRightRadius: buttonCornerRadius
72
39
  ? `${buttonCornerRadius}px`
73
- : undefined });
74
- const singleButtonStyle = Object.assign(Object.assign({}, buttonStyle), { borderRadius: buttonCornerRadius ? `${buttonCornerRadius}px` : undefined });
75
- return (_jsxs("div", Object.assign({ className: cn("flex relative", 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 || loading }), _jsx("input", { type: "number", pattern: "[0-9]*", disabled: loading, max: max, value: localValue, onBlur: (e) => {
76
- setIsFocused(false);
77
- const parsedValue = parseInt(e.target.value) || 0;
78
- const clampedValue = Math.min(parsedValue, max);
79
- setValue(clampedValue);
80
- setLocalValue(clampedValue.toString());
81
- }, onFocus: () => {
82
- setIsFocused(true);
83
- }, onChange: (e) => {
84
- const inputValue = e.target.value;
85
- if (inputValue === "") {
86
- setLocalValue("");
87
- }
88
- else {
89
- const parsedValue = parseInt(inputValue);
90
- if (!isNaN(parsedValue)) {
91
- const clampedValue = Math.min(parsedValue, max);
92
- setLocalValue(clampedValue.toString());
93
- }
94
- }
95
- }, 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: Object.assign(Object.assign({}, inputStyle), { borderRadius: (inputStyle === null || inputStyle === void 0 ? void 0 : inputStyle.borderRadius)
96
- ? `${inputStyle.borderRadius}px`
97
- : 0 }), inputMode: "numeric" }), _jsx(IconButton, { handler: onIncreaseClick, iconUrl: increaseIconUrl, iconColor: iconColor, style: rightButtonStyle, disabled: isIncreaseDisabled || loading })] })), _jsx(LoadingDots, { show: loading, size: 1, iconColor: iconColor })] })));
40
+ : undefined }, buttonStyle);
41
+ const singleButtonStyle = Object.assign({ borderRadius: buttonCornerRadius ? `${buttonCornerRadius}px` : undefined }, buttonStyle);
42
+ return (_jsx("div", Object.assign({ className: cn("flex relative", 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 || loading }), _jsx("div", Object.assign({ style: numberInputStyle }, { children: _jsx("span", { children: localValue }) })), _jsx(IconButton, { handler: onIncreaseClick, iconUrl: increaseIconUrl, iconColor: iconColor, style: rightButtonStyle, disabled: isIncreaseDisabled || loading })] })) })));
98
43
  });
99
44
  QuantityPicker.displayName = "QuantityPicker";
100
45
  export { QuantityPicker };
@@ -1 +1 @@
1
- {"version":3,"file":"quantity-pickerNEW.d.ts","sourceRoot":"","sources":["../../../components/ui/quantity-pickerNEW.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,MAAM,WAAW,sBACf,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,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/B,gBAAgB,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IACrC,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;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,GA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iBAAiB,+FA0KtB,CAAA;AAID,OAAO,EAAE,iBAAiB,EAAE,CAAA"}
@@ -27,9 +27,7 @@ const IconButton = ({ iconUrl, iconColor, handler, className, style, disabled })
27
27
  }, []);
28
28
  // Calculate the visual styles for the button
29
29
  const visualButtonStyle = Object.assign({}, style);
30
- return (_jsxs("div", Object.assign({ className: "relative h-7 w-7", style: { touchAction: "manipulation" } }, { children: [_jsx("div", Object.assign({ className: cn("absolute inset-0 flex items-center justify-center bg-stateColors-skeleton border border-coreColors-dividingLines", className, disabled ? "opacity-50" : ""), style: visualButtonStyle, "aria-hidden": "true" }, { children: _jsx(Icon, { url: iconUrl, size: "sm", strokeColor: iconColor, strokeWidth: 4, style: {
31
- opacity: isButtonPressed ? 0.7 : 1,
32
- } }) })), _jsx("button", { onClick: handler, onMouseDown: handleMouseDown, onMouseUp: handleMouseUp, onMouseLeave: handleMouseUp, onTouchStart: handleMouseDown, onTouchEnd: handleMouseUp, onTouchCancel: handleMouseUp, className: "absolute cursor-pointer", style: {
30
+ return (_jsxs("div", Object.assign({ className: "relative h-7 w-7", style: { touchAction: "manipulation" } }, { children: [_jsx("div", Object.assign({ className: cn("absolute inset-0 flex items-center justify-center bg-stateColors-skeleton border border-coreColors-dividingLines", className, disabled ? "opacity-50" : ""), style: visualButtonStyle, "aria-hidden": "true" }, { children: _jsx(Icon, { url: iconUrl, size: "sm", strokeColor: iconColor, strokeWidth: 4 }) })), _jsx("button", { onClick: handler, onMouseDown: handleMouseDown, onMouseUp: handleMouseUp, onMouseLeave: handleMouseUp, onTouchStart: handleMouseDown, onTouchEnd: handleMouseUp, onTouchCancel: handleMouseUp, className: "absolute cursor-pointer", style: {
33
31
  top: "-8px",
34
32
  right: "-8px",
35
33
  bottom: "-8px",
@@ -37,7 +37,7 @@ const radiogroupItemVariants = cva("grid grid-cols-[auto,auto,1fr] gap-2 items-c
37
37
  const RadioGroupItemLabels = ({ label, numberAmount, subtext, }) => (_jsxs("div", Object.assign({ className: "col-span-2" }, { children: [_jsxs("div", Object.assign({ className: "flex flex-row items-center" }, { children: [_jsx(Text, Object.assign({ type: "body-primary", className: "group-disabled:text-stateColors-disabled mr-2" }, { children: label })), numberAmount ? (_jsx(Text, Object.assign({ type: "body-primary", className: "text-textColors-secondaryColor group-disabled:text-stateColors-disabled" }, { children: `(${numberAmount})` }))) : null] })), subtext ? (_jsx(Text, Object.assign({ type: "body-secondary", className: "group-disabled:text-stateColors-disabled mt-1" }, { children: subtext }))) : null] })));
38
38
  const RadioGroupItem = (_a) => {
39
39
  var { value, label = "", subtext, numberAmount = 0, onSelect = () => { }, onClick = () => { }, selected = false, className, variant = "default" } = _a, props = __rest(_a, ["value", "label", "subtext", "numberAmount", "onSelect", "onClick", "selected", "className", "variant"]);
40
- return (_jsx("div", Object.assign({ className: cn(radiogroupItemVariants({ variant }), className) }, { children: variant === "deactivated" ? (_jsxs(_Fragment, { children: [_jsx(Icon, { name: "circle-off", size: "md", className: "text-stateColors-disabled" }), _jsx(RadioGroupItemLabels, { label: label, numberAmount: numberAmount, subtext: subtext })] })) : (_jsx(RadioGroupPrimitive.Item, Object.assign({ value: value, onSelect: onSelect, checked: selected, onClick: onClick, className: cn("flex items-center justify-center active:opacity-70 cursor-pointer", className) }, props, { children: selected || variant === "selected" ? (_jsxs("div", Object.assign({ className: "grid grid-cols-[auto,auto,1fr] gap-2 items-center group" }, { children: [_jsx(Icon, { name: "circle-dot-filled", size: "md", className: "text-coreColors-brandColorPrimary z-10" }), _jsx(RadioGroupItemLabels, { label: label, numberAmount: numberAmount, subtext: subtext })] }))) : (_jsxs("div", Object.assign({ className: "grid grid-cols-[auto,auto,1fr] gap-2 items-center group" }, { children: [_jsxs("div", Object.assign({ className: "grid" }, { children: [_jsx(RadioGroupPrimitive.Indicator, Object.assign({ className: "flex items-center justify-center col-start-1 row-start-1" }, { children: _jsx(Icon, { name: "circle-dot-filled", size: "md", className: "text-coreColors-brandColorPrimary z-10" }) })), _jsx("div", Object.assign({ className: "flex items-center justify-center col-start-1 row-start-1" }, { children: _jsx(Icon, { name: "circle", size: "md", className: "col-start-1 row-start-1 text-coreColors-secondaryIcon items-center z-1" }) }))] })), _jsx(RadioGroupItemLabels, { label: label, numberAmount: numberAmount, subtext: subtext })] }))) }))) })));
40
+ return (_jsx("div", Object.assign({ className: cn(radiogroupItemVariants({ variant }), className) }, { children: variant === "deactivated" ? (_jsxs(_Fragment, { children: [_jsx(Icon, { name: "circle-off", size: "md", className: "text-stateColors-disabled" }), _jsx(RadioGroupItemLabels, { label: label, numberAmount: numberAmount, subtext: subtext })] })) : (_jsx(RadioGroupPrimitive.Item, Object.assign({ value: value, onSelect: onSelect, checked: selected, onClick: onClick, className: cn("flex items-center justify-center cursor-pointer", className) }, props, { children: selected || variant === "selected" ? (_jsxs("div", Object.assign({ className: "grid grid-cols-[auto,auto,1fr] gap-2 items-center group" }, { children: [_jsx(Icon, { name: "circle-dot-filled", size: "md", className: "text-coreColors-brandColorPrimary z-10" }), _jsx(RadioGroupItemLabels, { label: label, numberAmount: numberAmount, subtext: subtext })] }))) : (_jsxs("div", Object.assign({ className: "grid grid-cols-[auto,auto,1fr] gap-2 items-center group" }, { children: [_jsxs("div", Object.assign({ className: "grid" }, { children: [_jsx(RadioGroupPrimitive.Indicator, Object.assign({ className: "flex items-center justify-center col-start-1 row-start-1" }, { children: _jsx(Icon, { name: "circle-dot-filled", size: "md", className: "text-coreColors-brandColorPrimary z-10" }) })), _jsx("div", Object.assign({ className: "flex items-center justify-center col-start-1 row-start-1" }, { children: _jsx(Icon, { name: "circle", size: "md", className: "col-start-1 row-start-1 text-coreColors-secondaryIcon items-center z-1" }) }))] })), _jsx(RadioGroupItemLabels, { label: label, numberAmount: numberAmount, subtext: subtext })] }))) }))) })));
41
41
  };
42
42
  RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
43
43
  export { RadioGroup, RadioGroupItem, radiogroupItemVariants };
@@ -1 +1 @@
1
- {"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../components/ui/tabs.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,MAAM,WAAW,SAAU,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACrE,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM,CAAA;QACb,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;QACzB,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;QACjC,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;KAChC,EAAE,CAAA;IACH,iBAAiB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IACvC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,WAAW,EAAE,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;IACvC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AAiDD,QAAA,MAAM,IAAI,kFAgIT,CAAA;AAGD,OAAO,EAAE,IAAI,EAAE,CAAA"}
1
+ {"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../components/ui/tabs.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,MAAM,WAAW,SAAU,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACrE,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM,CAAA;QACb,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;QACzB,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;QACjC,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;KAChC,EAAE,CAAA;IACH,iBAAiB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IACvC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,WAAW,EAAE,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;IACvC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AA8CD,QAAA,MAAM,IAAI,kFAgIT,CAAA;AAGD,OAAO,EAAE,IAAI,EAAE,CAAA"}
@@ -15,7 +15,7 @@ import * as React from "react";
15
15
  import { cva } from "class-variance-authority";
16
16
  import { cn } from "../../lib/utils";
17
17
  import { Text } from "./text";
18
- const tabVariants = cva("flex items-center justify-center px-4 py-2 active:opacity-70", {
18
+ const tabVariants = cva("flex items-center justify-center px-4 py-2", {
19
19
  variants: {
20
20
  isActive: {
21
21
  true: "[&>p]:text-textColors-primaryColor",
@@ -1 +1 @@
1
- {"version":3,"file":"tap.d.ts","sourceRoot":"","sources":["../../../components/ui/tap.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAMZ,SAAS,EACV,MAAM,OAAO,CAAA;AAyFd,QAAA,MAAM,MAAM;6BAyBU,GAAG,KAAK,IAAI,aACb,GAAG;;;CA2BvB,CAAA;AAED,UAAU,QAAQ;IAChB,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,QAAA,MAAM,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,QAAQ,CAuC3B,CAAA;AAED,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,CAAA"}
1
+ {"version":3,"file":"tap.d.ts","sourceRoot":"","sources":["../../../components/ui/tap.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAMZ,SAAS,EACV,MAAM,OAAO,CAAA;AAyFd,QAAA,MAAM,MAAM;6BAyBU,GAAG,KAAK,IAAI,aACb,GAAG;;;CA2BvB,CAAA;AAED,UAAU,QAAQ;IAChB,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,QAAA,MAAM,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,QAAQ,CAsC3B,CAAA;AAED,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,CAAA"}
@@ -131,7 +131,7 @@ const Tap = ({ children }) => {
131
131
  return;
132
132
  }
133
133
  })(event);
134
- }, style: Object.assign(Object.assign({}, element.props.style), { cursor: "pointer", opacity: isPressed ? 0.7 : 1 }) }));
134
+ }, style: Object.assign(Object.assign({}, element.props.style), { cursor: "pointer" }) }));
135
135
  };
136
136
  const cloneChildren = (children) => {
137
137
  return React.Children.map(children, (child) => {
@@ -15,7 +15,7 @@ import * as React from "react";
15
15
  import * as TogglePrimitive from "@radix-ui/react-toggle";
16
16
  import { cva } from "class-variance-authority";
17
17
  import { cn } from "../../lib/utils";
18
- const toggleVariants = cva("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground active:opacity-70", {
18
+ const toggleVariants = cva("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground", {
19
19
  variants: {
20
20
  variant: {
21
21
  default: "bg-transparent",
package/dist/styles.css CHANGED
@@ -790,9 +790,6 @@ video {
790
790
  .z-30 {
791
791
  z-index: 30;
792
792
  }
793
- .z-40 {
794
- z-index: 40;
795
- }
796
793
  .z-50 {
797
794
  z-index: 50;
798
795
  }
@@ -1060,6 +1057,9 @@ video {
1060
1057
  .h-\[30vh\] {
1061
1058
  height: 30vh;
1062
1059
  }
1060
+ .h-\[350px\] {
1061
+ height: 350px;
1062
+ }
1063
1063
  .h-\[38px\] {
1064
1064
  height: 38px;
1065
1065
  }
@@ -1216,6 +1216,9 @@ video {
1216
1216
  .min-w-16 {
1217
1217
  min-width: 4rem;
1218
1218
  }
1219
+ .min-w-\[200px\] {
1220
+ min-width: 200px;
1221
+ }
1219
1222
  .min-w-\[8rem\] {
1220
1223
  min-width: 8rem;
1221
1224
  }
@@ -1450,6 +1453,9 @@ video {
1450
1453
  .items-center {
1451
1454
  align-items: center;
1452
1455
  }
1456
+ .items-baseline {
1457
+ align-items: baseline;
1458
+ }
1453
1459
  .items-stretch {
1454
1460
  align-items: stretch;
1455
1461
  }
@@ -1609,9 +1615,6 @@ video {
1609
1615
  .rounded-sm {
1610
1616
  border-radius: calc(var(--radius) - 4px);
1611
1617
  }
1612
- .rounded-xl {
1613
- border-radius: 0.75rem;
1614
- }
1615
1618
  .rounded-b-lg {
1616
1619
  border-bottom-right-radius: var(--radius);
1617
1620
  border-bottom-left-radius: var(--radius);
@@ -2370,11 +2373,6 @@ video {
2370
2373
  .filter {
2371
2374
  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
2372
2375
  }
2373
- .backdrop-blur-md {
2374
- --tw-backdrop-blur: blur(12px);
2375
- -webkit-backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
2376
- backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
2377
- }
2378
2376
  .transition {
2379
2377
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;
2380
2378
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
@@ -2637,15 +2635,6 @@ body::-webkit-scrollbar {
2637
2635
  border-color: var(--coreColors-brandColorPrimary);
2638
2636
  }
2639
2637
 
2640
- .hover\:bg-gray-100:hover {
2641
- --tw-bg-opacity: 1;
2642
- background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1));
2643
- }
2644
-
2645
- .hover\:opacity-90:hover {
2646
- opacity: 0.9;
2647
- }
2648
-
2649
2638
  .focus\:border-coreColors-brandColorPrimary:focus {
2650
2639
  border-color: var(--coreColors-brandColorPrimary);
2651
2640
  }
@@ -2723,10 +2712,6 @@ body::-webkit-scrollbar {
2723
2712
  color: var(--coreColors-brandColorPrimary);
2724
2713
  }
2725
2714
 
2726
- .active\:opacity-70:active {
2727
- opacity: 0.7;
2728
- }
2729
-
2730
2715
  .active\:outline-coreColors-brandColorPrimary:active {
2731
2716
  outline-color: var(--coreColors-brandColorPrimary);
2732
2717
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tapcart/mobile-components",
3
- "version": "0.8.71",
3
+ "version": "0.8.73",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "style": "dist/styles.css",