@tapcart/mobile-components 0.6.20 → 0.6.22

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.
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare function useClickOutside(ref: React.RefObject<HTMLElement>, callback: () => void): void;
3
+ //# sourceMappingURL=use-click-outside.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-click-outside.d.ts","sourceRoot":"","sources":["../../../components/hooks/use-click-outside.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,wBAAgB,eAAe,CAAC,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAE,IAAI,CAa5F"}
@@ -0,0 +1,16 @@
1
+ "use client";
2
+ import React from 'react';
3
+ export function useClickOutside(ref, callback) {
4
+ React.useEffect(() => {
5
+ const handleClickOutside = (event) => {
6
+ if (ref.current && !ref.current.contains(event.target)) {
7
+ callback();
8
+ }
9
+ };
10
+ document.addEventListener('mousedown', handleClickOutside);
11
+ return () => {
12
+ document.removeEventListener('mousedown', handleClickOutside);
13
+ };
14
+ }, [ref, callback]);
15
+ }
16
+ ;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ declare const useClickOutside: (ref: React.RefObject<HTMLElement>, callback: () => void) => void;
3
+ export default useClickOutside;
4
+ //# sourceMappingURL=use-outside-click.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-outside-click.d.ts","sourceRoot":"","sources":["../../../components/hooks/use-outside-click.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,QAAA,MAAM,eAAe,QAAS,MAAM,SAAS,CAAC,WAAW,CAAC,YAAY,MAAM,IAAI,SAa/E,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -0,0 +1,16 @@
1
+ "use client";
2
+ import React from 'react';
3
+ const useClickOutside = (ref, callback) => {
4
+ React.useEffect(() => {
5
+ const handleClickOutside = (event) => {
6
+ if (ref.current && !ref.current.contains(event.target)) {
7
+ callback();
8
+ }
9
+ };
10
+ document.addEventListener('mousedown', handleClickOutside);
11
+ return () => {
12
+ document.removeEventListener('mousedown', handleClickOutside);
13
+ };
14
+ }, [ref, callback]);
15
+ };
16
+ export default useClickOutside;
@@ -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-4 last:gap-y-0",
20
- 2: "grid-cols-2 gap-x-[7px] gap-y-4 last:gap-y-0",
21
- 3: "grid-cols-3 gap-x-[7px] gap-y-4 last:gap-y-0",
22
- 4: "grid-cols-4 gap-x-[7px] gap-y-4 last:gap-y-0",
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: {
@@ -14,6 +14,6 @@ function Price({ price, priceHigh, priceRanges = false, isSale = false, compareA
14
14
  return null;
15
15
  return (_jsxs(Text, Object.assign({ className: "line-through text-textColors-strikethroughPriceText flex-shrink-0 flex items-center", style: { fontSize: `${fontSize}px` } }, { children: [_jsx(Money, { price: compareAtPrice, currency: currency, locale: locale, styles: strikeThroughStyles }), priceRanges && compareAtPriceHigh && _jsx(Spacer, {}), priceRanges && compareAtPriceHigh && (_jsx(Money, { price: compareAtPriceHigh, currency: currency, locale: locale, styles: strikeThroughStyles }))] })));
16
16
  };
17
- return (_jsxs("div", Object.assign({ className: cn("flex flex-wrap gap-2", { "justify-start": textAlignment === "left" }, { "justify-end": textAlignment === "right" }, { "justify-center": textAlignment === "center" }) }, { children: [_jsx(ProductPrice, {}), _jsx(StrikeThroughPrice, {})] })));
17
+ return (_jsxs("div", Object.assign({ className: cn("flex flex-wrap gap-x-2", { "justify-start": textAlignment === "left" }, { "justify-end": textAlignment === "right" }, { "justify-center": textAlignment === "center" }) }, { children: [_jsx(ProductPrice, {}), _jsx(StrikeThroughPrice, {})] })));
18
18
  }
19
19
  export { Price };
package/dist/styles.css CHANGED
@@ -1414,9 +1414,6 @@ video {
1414
1414
  .whitespace-nowrap {
1415
1415
  white-space: nowrap;
1416
1416
  }
1417
- .break-words {
1418
- overflow-wrap: break-word;
1419
- }
1420
1417
  .rounded {
1421
1418
  border-radius: 0.25rem;
1422
1419
  }
@@ -2285,10 +2282,6 @@ body::-webkit-scrollbar {
2285
2282
  color: var(--textColors-secondaryColor, #727272ff);
2286
2283
  }
2287
2284
 
2288
- .last\:gap-y-0:last-child {
2289
- row-gap: 0px;
2290
- }
2291
-
2292
2285
  .last\:border-b-0:last-child {
2293
2286
  border-bottom-width: 0px;
2294
2287
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tapcart/mobile-components",
3
- "version": "0.6.20",
3
+ "version": "0.6.22",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "style": "dist/styles.css",
@@ -11,16 +11,6 @@
11
11
  "license": "SEE LICENSE IN LICENSE.md",
12
12
  "author": "Tapcart Inc.",
13
13
  "homepage": "https://tapcart.com",
14
- "scripts": {
15
- "lint": "eslint \"**/*.ts*\"",
16
- "ui:add": "pnpm dlx shadcn-ui@latest add",
17
- "build:styles": "postcss styles/globals.css -o dist/styles.css",
18
- "build:ts": "tsc -p tsconfig.json && tsc-alias",
19
- "build": "pnpm run build:ts && pnpm run build:styles",
20
- "dev:ts": "tsc -w -p tsconfig.json",
21
- "dev:styles": "npx tailwindcss -i styles/globals.css -o dist/styles.css --watch",
22
- "dev": "concurrently \"pnpm run dev:ts\" \"pnpm run dev:styles\""
23
- },
24
14
  "peerDependencies": {
25
15
  "react": "^17.0.2 || ^18.0.0",
26
16
  "react-dom": "^17.0.2 || ^18.0.0"
@@ -29,17 +19,17 @@
29
19
  "@types/lodash": "4.17.5",
30
20
  "@types/react": "^18.2.0",
31
21
  "@types/react-dom": "^18.2.0",
32
- "app-studio-types": "workspace:*",
33
22
  "autoprefixer": "^10.4.14",
34
23
  "chokidar-cli": "^3.0.0",
35
24
  "concurrently": "^8.2.2",
36
25
  "eslint": "^7.32.0",
37
- "eslint-config-custom": "workspace:*",
38
26
  "postcss": "^8.4.24",
39
27
  "tailwindcss": "^3.3.2",
40
28
  "tsc-alias": "^1.8.10",
41
- "tsconfig": "workspace:*",
42
- "typescript": "^4.5.2"
29
+ "typescript": "^4.5.2",
30
+ "app-studio-types": "0.0.3",
31
+ "eslint-config-custom": "0.0.0",
32
+ "tsconfig": "0.0.0"
43
33
  },
44
34
  "dependencies": {
45
35
  "@radix-ui/react-accordion": "^1.1.2",
@@ -73,5 +63,15 @@
73
63
  "tailwind-merge": "^1.13.2",
74
64
  "tailwindcss-animate": "^1.0.6",
75
65
  "vaul": "^0.9.1"
66
+ },
67
+ "scripts": {
68
+ "lint": "eslint \"**/*.ts*\"",
69
+ "ui:add": "pnpm dlx shadcn-ui@latest add",
70
+ "build:styles": "postcss styles/globals.css -o dist/styles.css",
71
+ "build:ts": "tsc -p tsconfig.json && tsc-alias",
72
+ "build": "pnpm run build:ts && pnpm run build:styles",
73
+ "dev:ts": "tsc -w -p tsconfig.json",
74
+ "dev:styles": "npx tailwindcss -i styles/globals.css -o dist/styles.css --watch",
75
+ "dev": "concurrently \"pnpm run dev:ts\" \"pnpm run dev:styles\""
76
76
  }
77
- }
77
+ }