@tapcart/mobile-components 0.1.1 → 0.1.3

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 (114) hide show
  1. package/dist/components/ThemeProvider.d.ts +3 -0
  2. package/dist/components/ThemeProvider.d.ts.map +1 -0
  3. package/dist/components/ThemeProvider.js +18 -0
  4. package/dist/components/ThemeToggle.d.ts +2 -0
  5. package/dist/components/ThemeToggle.d.ts.map +1 -0
  6. package/dist/components/ThemeToggle.js +8 -0
  7. package/dist/components/ui/accordion.d.ts +8 -0
  8. package/dist/components/ui/accordion.d.ts.map +1 -0
  9. package/dist/components/ui/accordion.js +34 -0
  10. package/dist/components/ui/alert-dialog.d.ts +21 -0
  11. package/dist/components/ui/alert-dialog.d.ts.map +1 -0
  12. package/dist/components/ui/alert-dialog.js +62 -0
  13. package/dist/components/ui/aspect-ratio.d.ts +5 -0
  14. package/dist/components/ui/aspect-ratio.d.ts.map +1 -0
  15. package/dist/components/ui/aspect-ratio.js +4 -0
  16. package/dist/components/ui/badge.d.ts +10 -0
  17. package/dist/components/ui/badge.d.ts.map +1 -0
  18. package/dist/components/ui/badge.js +32 -0
  19. package/dist/components/ui/button.d.ts +13 -0
  20. package/dist/components/ui/button.d.ts.map +1 -0
  21. package/dist/components/ui/button.js +52 -0
  22. package/dist/components/ui/carousel.d.ts +19 -0
  23. package/dist/components/ui/carousel.d.ts.map +1 -0
  24. package/dist/components/ui/carousel.js +112 -0
  25. package/dist/components/ui/container.d.ts +10 -0
  26. package/dist/components/ui/container.d.ts.map +1 -0
  27. package/dist/components/ui/container.js +26 -0
  28. package/dist/components/ui/grid.d.ts +14 -0
  29. package/dist/components/ui/grid.d.ts.map +1 -0
  30. package/dist/components/ui/grid.js +33 -0
  31. package/dist/components/ui/icon.d.ts +11 -0
  32. package/dist/components/ui/icon.d.ts.map +1 -0
  33. package/dist/components/ui/icon.js +30 -0
  34. package/dist/components/ui/input.d.ts +6 -0
  35. package/dist/components/ui/input.d.ts.map +1 -0
  36. package/dist/components/ui/input.js +20 -0
  37. package/dist/components/ui/label.d.ts +6 -0
  38. package/dist/components/ui/label.d.ts.map +1 -0
  39. package/dist/components/ui/label.js +24 -0
  40. package/dist/components/ui/money.d.ts +12 -0
  41. package/dist/components/ui/money.d.ts.map +1 -0
  42. package/dist/components/ui/money.js +30 -0
  43. package/dist/components/ui/scroll-area.d.ts +9 -0
  44. package/dist/components/ui/scroll-area.d.ts.map +1 -0
  45. package/dist/components/ui/scroll-area.js +29 -0
  46. package/dist/components/ui/separator.d.ts +5 -0
  47. package/dist/components/ui/separator.d.ts.map +1 -0
  48. package/dist/components/ui/separator.js +22 -0
  49. package/dist/components/ui/skeleton.d.ts +4 -0
  50. package/dist/components/ui/skeleton.d.ts.map +1 -0
  51. package/dist/components/ui/skeleton.js +18 -0
  52. package/dist/components/ui/switch.d.ts +5 -0
  53. package/dist/components/ui/switch.d.ts.map +1 -0
  54. package/dist/components/ui/switch.js +22 -0
  55. package/dist/components/ui/text.d.ts +10 -0
  56. package/dist/components/ui/text.d.ts.map +1 -0
  57. package/dist/components/ui/text.js +33 -0
  58. package/dist/components/ui/toast.d.ts +16 -0
  59. package/dist/components/ui/toast.d.ts.map +1 -0
  60. package/dist/components/ui/toast.js +61 -0
  61. package/dist/components/ui/toaster.d.ts +2 -0
  62. package/dist/components/ui/toaster.d.ts.map +1 -0
  63. package/dist/components/ui/toaster.js +22 -0
  64. package/dist/components/ui/toggle-group.d.ts +13 -0
  65. package/dist/components/ui/toggle-group.d.ts.map +1 -0
  66. package/dist/components/ui/toggle-group.js +36 -0
  67. package/dist/components/ui/toggle.d.ts +13 -0
  68. package/dist/components/ui/toggle.d.ts.map +1 -0
  69. package/dist/components/ui/toggle.js +40 -0
  70. package/dist/components/ui/use-toast.d.ts +45 -0
  71. package/dist/components/ui/use-toast.d.ts.map +1 -0
  72. package/dist/components/ui/use-toast.js +112 -0
  73. package/dist/components/ui/video.d.ts +8 -0
  74. package/dist/components/ui/video.d.ts.map +1 -0
  75. package/dist/components/ui/video.js +22 -0
  76. package/dist/index.d.ts +26 -0
  77. package/dist/index.d.ts.map +1 -0
  78. package/dist/index.js +26 -0
  79. package/dist/lib/utils.d.ts +3 -0
  80. package/dist/lib/utils.d.ts.map +1 -0
  81. package/dist/lib/utils.js +5 -0
  82. package/package.json +2 -1
  83. package/components/ThemeProvider.tsx +0 -9
  84. package/components/ThemeToggle.tsx +0 -22
  85. package/components/ui/accordion.tsx +0 -58
  86. package/components/ui/alert-dialog.tsx +0 -141
  87. package/components/ui/aspect-ratio.tsx +0 -7
  88. package/components/ui/badge.tsx +0 -36
  89. package/components/ui/button.tsx +0 -69
  90. package/components/ui/carousel.tsx +0 -262
  91. package/components/ui/container.tsx +0 -24
  92. package/components/ui/grid.tsx +0 -38
  93. package/components/ui/icon.tsx +0 -25
  94. package/components/ui/input.tsx +0 -25
  95. package/components/ui/label.tsx +0 -26
  96. package/components/ui/money.tsx +0 -32
  97. package/components/ui/scroll-area.tsx +0 -54
  98. package/components/ui/separator.tsx +0 -31
  99. package/components/ui/skeleton.tsx +0 -15
  100. package/components/ui/switch.tsx +0 -29
  101. package/components/ui/text.tsx +0 -28
  102. package/components/ui/toast.tsx +0 -129
  103. package/components/ui/toaster.tsx +0 -35
  104. package/components/ui/toggle-group.tsx +0 -61
  105. package/components/ui/toggle.tsx +0 -45
  106. package/components/ui/use-toast.ts +0 -191
  107. package/components/ui/video.tsx +0 -27
  108. package/components.json +0 -14
  109. package/index.tsx +0 -28
  110. package/lib/utils.ts +0 -6
  111. package/postcss.config.js +0 -6
  112. package/styles/globals.css +0 -146
  113. package/tailwind.config.js +0 -141
  114. package/tsconfig.json +0 -13
@@ -0,0 +1,112 @@
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
+ // Inspired by react-hot-toast library
14
+ import * as React from "react";
15
+ const TOAST_LIMIT = 1;
16
+ const TOAST_REMOVE_DELAY = 1000000;
17
+ const actionTypes = {
18
+ ADD_TOAST: "ADD_TOAST",
19
+ UPDATE_TOAST: "UPDATE_TOAST",
20
+ DISMISS_TOAST: "DISMISS_TOAST",
21
+ REMOVE_TOAST: "REMOVE_TOAST",
22
+ };
23
+ let count = 0;
24
+ function genId() {
25
+ count = (count + 1) % Number.MAX_SAFE_INTEGER;
26
+ return count.toString();
27
+ }
28
+ const toastTimeouts = new Map();
29
+ const addToRemoveQueue = (toastId) => {
30
+ if (toastTimeouts.has(toastId)) {
31
+ return;
32
+ }
33
+ const timeout = setTimeout(() => {
34
+ toastTimeouts.delete(toastId);
35
+ dispatch({
36
+ type: "REMOVE_TOAST",
37
+ toastId: toastId,
38
+ });
39
+ }, TOAST_REMOVE_DELAY);
40
+ toastTimeouts.set(toastId, timeout);
41
+ };
42
+ export const reducer = (state, action) => {
43
+ switch (action.type) {
44
+ case "ADD_TOAST":
45
+ return Object.assign(Object.assign({}, state), { toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT) });
46
+ case "UPDATE_TOAST":
47
+ return Object.assign(Object.assign({}, state), { toasts: state.toasts.map((t) => t.id === action.toast.id ? Object.assign(Object.assign({}, t), action.toast) : t) });
48
+ case "DISMISS_TOAST": {
49
+ const { toastId } = action;
50
+ // ! Side effects ! - This could be extracted into a dismissToast() action,
51
+ // but I'll keep it here for simplicity
52
+ if (toastId) {
53
+ addToRemoveQueue(toastId);
54
+ }
55
+ else {
56
+ state.toasts.forEach((toast) => {
57
+ addToRemoveQueue(toast.id);
58
+ });
59
+ }
60
+ return Object.assign(Object.assign({}, state), { toasts: state.toasts.map((t) => t.id === toastId || toastId === undefined
61
+ ? Object.assign(Object.assign({}, t), { open: false }) : t) });
62
+ }
63
+ case "REMOVE_TOAST":
64
+ if (action.toastId === undefined) {
65
+ return Object.assign(Object.assign({}, state), { toasts: [] });
66
+ }
67
+ return Object.assign(Object.assign({}, state), { toasts: state.toasts.filter((t) => t.id !== action.toastId) });
68
+ }
69
+ };
70
+ const listeners = [];
71
+ let memoryState = { toasts: [] };
72
+ function dispatch(action) {
73
+ memoryState = reducer(memoryState, action);
74
+ listeners.forEach((listener) => {
75
+ listener(memoryState);
76
+ });
77
+ }
78
+ function toast(_a) {
79
+ var props = __rest(_a, []);
80
+ const id = genId();
81
+ const update = (props) => dispatch({
82
+ type: "UPDATE_TOAST",
83
+ toast: Object.assign(Object.assign({}, props), { id }),
84
+ });
85
+ const dismiss = () => dispatch({ type: "DISMISS_TOAST", toastId: id });
86
+ dispatch({
87
+ type: "ADD_TOAST",
88
+ toast: Object.assign(Object.assign({}, props), { id, open: true, onOpenChange: (open) => {
89
+ if (!open)
90
+ dismiss();
91
+ } }),
92
+ });
93
+ return {
94
+ id: id,
95
+ dismiss,
96
+ update,
97
+ };
98
+ }
99
+ function useToast() {
100
+ const [state, setState] = React.useState(memoryState);
101
+ React.useEffect(() => {
102
+ listeners.push(setState);
103
+ return () => {
104
+ const index = listeners.indexOf(setState);
105
+ if (index > -1) {
106
+ listeners.splice(index, 1);
107
+ }
108
+ };
109
+ }, [state]);
110
+ return Object.assign(Object.assign({}, state), { toast, dismiss: (toastId) => dispatch({ type: "DISMISS_TOAST", toastId }) });
111
+ }
112
+ export { useToast, toast };
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ declare const videoVariants: (props?: ({} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
4
+ export interface VideoProps extends React.HTMLAttributes<HTMLVideoElement>, VariantProps<typeof videoVariants> {
5
+ }
6
+ declare function Video({ className, ...props }: VideoProps): import("react/jsx-runtime").JSX.Element;
7
+ export { Video, videoVariants };
8
+ //# sourceMappingURL=video.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"video.d.ts","sourceRoot":"","sources":["../../../components/ui/video.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,aAAa,gGAEjB,CAAA;AAEF,MAAM,WAAW,UACf,SAAQ,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC,EAC5C,YAAY,CAAC,OAAO,aAAa,CAAC;CAAG;AAEzC,iBAAS,KAAK,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,2CAWjD;AAED,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAA"}
@@ -0,0 +1,22 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { cva } from "class-variance-authority";
14
+ import { cn } from "@/lib/utils";
15
+ const videoVariants = cva("w-full", {
16
+ variants: {},
17
+ });
18
+ function Video(_a) {
19
+ var { className } = _a, props = __rest(_a, ["className"]);
20
+ return (_jsx("video", Object.assign({ className: cn(videoVariants({}), className) }, props, { autoPlay: true, playsInline: true, muted: true, loop: true })));
21
+ }
22
+ export { Video, videoVariants };
@@ -0,0 +1,26 @@
1
+ export * from "@/components/ui/button";
2
+ export * from "@/components/ui/input";
3
+ export * from "@/components/ui/aspect-ratio";
4
+ export * from "@/components/ui/accordion";
5
+ export * from "@/components/ui/icon";
6
+ export * from "@/components/ui/carousel";
7
+ export * from "@/components/ui/container";
8
+ export * from "@/components/ui/grid";
9
+ export * from "@/components/ui/label";
10
+ export * from "@/components/ui/separator";
11
+ export * from "@/components/ui/badge";
12
+ export * from "@/components/ui/video";
13
+ export * from "@/components/ui/money";
14
+ export * from "@/components/ui/skeleton";
15
+ export * from "@/components/ui/text";
16
+ export * from "@/components/ui/toggle";
17
+ export * from "@/components/ui/toggle-group";
18
+ export * from "@/components/ui/switch";
19
+ export * from "@/components/ui/scroll-area";
20
+ export * from "@/components/ui/toast";
21
+ export * from "@/components/ui/toaster";
22
+ export * from "@/components/ui/use-toast";
23
+ export * from "@/components/ThemeToggle";
24
+ export { ThemeProvider } from "@/components/ThemeProvider";
25
+ export { cn } from "@/lib/utils";
26
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.tsx"],"names":[],"mappings":"AAGA,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,2BAA2B,CAAA;AACzC,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,2BAA2B,CAAA;AACzC,cAAc,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA;AACrC,cAAc,0BAA0B,CAAA;AACxC,cAAc,sBAAsB,CAAA;AACpC,cAAc,wBAAwB,CAAA;AACtC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,wBAAwB,CAAA;AACtC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,uBAAuB,CAAA;AACrC,cAAc,yBAAyB,CAAA;AACvC,cAAc,2BAA2B,CAAA;AACzC,cAAc,0BAA0B,CAAA;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,26 @@
1
+ // component exports
2
+ export * from "@/components/ui/button";
3
+ export * from "@/components/ui/input";
4
+ export * from "@/components/ui/aspect-ratio";
5
+ export * from "@/components/ui/accordion";
6
+ export * from "@/components/ui/icon";
7
+ export * from "@/components/ui/carousel";
8
+ export * from "@/components/ui/container";
9
+ export * from "@/components/ui/grid";
10
+ export * from "@/components/ui/label";
11
+ export * from "@/components/ui/separator";
12
+ export * from "@/components/ui/badge";
13
+ export * from "@/components/ui/video";
14
+ export * from "@/components/ui/money";
15
+ export * from "@/components/ui/skeleton";
16
+ export * from "@/components/ui/text";
17
+ export * from "@/components/ui/toggle";
18
+ export * from "@/components/ui/toggle-group";
19
+ export * from "@/components/ui/switch";
20
+ export * from "@/components/ui/scroll-area";
21
+ export * from "@/components/ui/toast";
22
+ export * from "@/components/ui/toaster";
23
+ export * from "@/components/ui/use-toast";
24
+ export * from "@/components/ThemeToggle";
25
+ export { ThemeProvider } from "@/components/ThemeProvider";
26
+ export { cn } from "@/lib/utils";
@@ -0,0 +1,3 @@
1
+ import { ClassValue } from "clsx";
2
+ export declare function cn(...inputs: ClassValue[]): string;
3
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,MAAM,MAAM,CAAA;AAGvC,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC"}
@@ -0,0 +1,5 @@
1
+ import { clsx } from "clsx";
2
+ import { twMerge } from "tailwind-merge";
3
+ export function cn(...inputs) {
4
+ return twMerge(clsx(inputs));
5
+ }
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@tapcart/mobile-components",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "main": "dist/index.js",
5
+ "module": "dist/index.esm.js",
5
6
  "types": "dist/index.d.ts",
6
7
  "license": "SEE LICENSE IN LICENSE.md",
7
8
  "author": "Tapcart Inc.",
@@ -1,9 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import { ThemeProvider as NextThemesProvider } from "next-themes"
5
- import { ThemeProviderProps } from "next-themes/dist/types"
6
-
7
- export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
8
- return <NextThemesProvider {...props}>{children}</NextThemesProvider>
9
- }
@@ -1,22 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import { useTheme } from "next-themes"
5
-
6
- import { Button } from "@/components/ui/button"
7
-
8
- export function ThemeToggle() {
9
- const { setTheme, theme } = useTheme()
10
-
11
- return (
12
- <Button
13
- variant="ghost"
14
- size="sm"
15
- onClick={() => setTheme(theme === "light" ? "dark" : "light")}
16
- >
17
- <div className="rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" />
18
- <div className="absolute rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" />
19
- <span className="sr-only">Toggle theme</span>
20
- </Button>
21
- )
22
- }
@@ -1,58 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import * as AccordionPrimitive from "@radix-ui/react-accordion"
5
- import { ChevronDown } from "lucide-react"
6
-
7
- import { cn } from "@/lib/utils"
8
-
9
- const Accordion = AccordionPrimitive.Root
10
-
11
- const AccordionItem = React.forwardRef<
12
- React.ElementRef<typeof AccordionPrimitive.Item>,
13
- React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>
14
- >(({ className, ...props }, ref) => (
15
- <AccordionPrimitive.Item
16
- ref={ref}
17
- className={cn("border-b", className)}
18
- {...props}
19
- />
20
- ))
21
- AccordionItem.displayName = "AccordionItem"
22
-
23
- const AccordionTrigger = React.forwardRef<
24
- React.ElementRef<typeof AccordionPrimitive.Trigger>,
25
- React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>
26
- >(({ className, children, ...props }, ref) => (
27
- <AccordionPrimitive.Header className="flex">
28
- <AccordionPrimitive.Trigger
29
- ref={ref}
30
- className={cn(
31
- "flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",
32
- className
33
- )}
34
- {...props}
35
- >
36
- {children}
37
- <ChevronDown className="h-4 w-4 shrink-0 transition-transform duration-200" />
38
- </AccordionPrimitive.Trigger>
39
- </AccordionPrimitive.Header>
40
- ))
41
- AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName
42
-
43
- const AccordionContent = React.forwardRef<
44
- React.ElementRef<typeof AccordionPrimitive.Content>,
45
- React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>
46
- >(({ className, children, ...props }, ref) => (
47
- <AccordionPrimitive.Content
48
- ref={ref}
49
- className="overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
50
- {...props}
51
- >
52
- <div className={cn("pb-4 pt-0", className)}>{children}</div>
53
- </AccordionPrimitive.Content>
54
- ))
55
-
56
- AccordionContent.displayName = AccordionPrimitive.Content.displayName
57
-
58
- export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
@@ -1,141 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog"
5
-
6
- import { cn } from "@/lib/utils"
7
- import { buttonVariants } from "@/components/ui/button"
8
-
9
- const AlertDialog = AlertDialogPrimitive.Root
10
-
11
- const AlertDialogTrigger = AlertDialogPrimitive.Trigger
12
-
13
- const AlertDialogPortal = AlertDialogPrimitive.Portal
14
-
15
- const AlertDialogOverlay = React.forwardRef<
16
- React.ElementRef<typeof AlertDialogPrimitive.Overlay>,
17
- React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>
18
- >(({ className, ...props }, ref) => (
19
- <AlertDialogPrimitive.Overlay
20
- className={cn(
21
- "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
22
- className
23
- )}
24
- {...props}
25
- ref={ref}
26
- />
27
- ))
28
- AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName
29
-
30
- const AlertDialogContent = React.forwardRef<
31
- React.ElementRef<typeof AlertDialogPrimitive.Content>,
32
- React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>
33
- >(({ className, ...props }, ref) => (
34
- <AlertDialogPortal>
35
- <AlertDialogOverlay />
36
- <AlertDialogPrimitive.Content
37
- ref={ref}
38
- className={cn(
39
- "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
40
- className
41
- )}
42
- {...props}
43
- />
44
- </AlertDialogPortal>
45
- ))
46
- AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName
47
-
48
- const AlertDialogHeader = ({
49
- className,
50
- ...props
51
- }: React.HTMLAttributes<HTMLDivElement>) => (
52
- <div
53
- className={cn(
54
- "flex flex-col space-y-2 text-center sm:text-left",
55
- className
56
- )}
57
- {...props}
58
- />
59
- )
60
- AlertDialogHeader.displayName = "AlertDialogHeader"
61
-
62
- const AlertDialogFooter = ({
63
- className,
64
- ...props
65
- }: React.HTMLAttributes<HTMLDivElement>) => (
66
- <div
67
- className={cn(
68
- "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
69
- className
70
- )}
71
- {...props}
72
- />
73
- )
74
- AlertDialogFooter.displayName = "AlertDialogFooter"
75
-
76
- const AlertDialogTitle = React.forwardRef<
77
- React.ElementRef<typeof AlertDialogPrimitive.Title>,
78
- React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>
79
- >(({ className, ...props }, ref) => (
80
- <AlertDialogPrimitive.Title
81
- ref={ref}
82
- className={cn("text-lg font-semibold", className)}
83
- {...props}
84
- />
85
- ))
86
- AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName
87
-
88
- const AlertDialogDescription = React.forwardRef<
89
- React.ElementRef<typeof AlertDialogPrimitive.Description>,
90
- React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>
91
- >(({ className, ...props }, ref) => (
92
- <AlertDialogPrimitive.Description
93
- ref={ref}
94
- className={cn("text-sm text-muted-foreground", className)}
95
- {...props}
96
- />
97
- ))
98
- AlertDialogDescription.displayName =
99
- AlertDialogPrimitive.Description.displayName
100
-
101
- const AlertDialogAction = React.forwardRef<
102
- React.ElementRef<typeof AlertDialogPrimitive.Action>,
103
- React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>
104
- >(({ className, ...props }, ref) => (
105
- <AlertDialogPrimitive.Action
106
- ref={ref}
107
- className={cn(buttonVariants(), className)}
108
- {...props}
109
- />
110
- ))
111
- AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName
112
-
113
- const AlertDialogCancel = React.forwardRef<
114
- React.ElementRef<typeof AlertDialogPrimitive.Cancel>,
115
- React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>
116
- >(({ className, ...props }, ref) => (
117
- <AlertDialogPrimitive.Cancel
118
- ref={ref}
119
- className={cn(
120
- buttonVariants({ variant: "outline" }),
121
- "mt-2 sm:mt-0",
122
- className
123
- )}
124
- {...props}
125
- />
126
- ))
127
- AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName
128
-
129
- export {
130
- AlertDialog,
131
- AlertDialogPortal,
132
- AlertDialogOverlay,
133
- AlertDialogTrigger,
134
- AlertDialogContent,
135
- AlertDialogHeader,
136
- AlertDialogFooter,
137
- AlertDialogTitle,
138
- AlertDialogDescription,
139
- AlertDialogAction,
140
- AlertDialogCancel,
141
- }
@@ -1,7 +0,0 @@
1
- "use client"
2
-
3
- import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio"
4
-
5
- const AspectRatio = AspectRatioPrimitive.Root
6
-
7
- export { AspectRatio }
@@ -1,36 +0,0 @@
1
- import * as React from "react"
2
- import { cva, type VariantProps } from "class-variance-authority"
3
-
4
- import { cn } from "@/lib/utils"
5
-
6
- const badgeVariants = cva(
7
- "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
8
- {
9
- variants: {
10
- variant: {
11
- default:
12
- "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
13
- secondary:
14
- "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
15
- destructive:
16
- "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
17
- outline: "text-foreground",
18
- },
19
- },
20
- defaultVariants: {
21
- variant: "default",
22
- },
23
- }
24
- )
25
-
26
- export interface BadgeProps
27
- extends React.HTMLAttributes<HTMLDivElement>,
28
- VariantProps<typeof badgeVariants> {}
29
-
30
- function Badge({ className, variant, ...props }: BadgeProps) {
31
- return (
32
- <div className={cn(badgeVariants({ variant }), className)} {...props} />
33
- )
34
- }
35
-
36
- export { Badge, badgeVariants }
@@ -1,69 +0,0 @@
1
- import * as React from "react"
2
- import { Slot } from "@radix-ui/react-slot"
3
- import { cva, type VariantProps } from "class-variance-authority"
4
- import { IconLoader2 } from "@tabler/icons-react"
5
-
6
- import { cn } from "@/lib/utils"
7
-
8
- const buttonVariants = cva(
9
- "flex rounded items-center justify-center text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:bg-stateColors-disabled disabled:pointer-events-none ring-offset-background overflow-elipse whitespace-nowrap truncate",
10
- {
11
- variants: {
12
- size: {
13
- default: "h-10 py-3 px-4",
14
- sm: "h-9 px-3 rounded-md",
15
- lg: "h-11 px-8 rounded-md",
16
- icon: "h-10 w-10",
17
- content: "h-10 py-3 px-4 w-auto",
18
- },
19
- variant: {
20
- default:
21
- "bg-buttonColors-primaryFill text-buttonColors-primaryText active:opacity-70",
22
- destructive:
23
- "bg-stateColors-error text-coreColors-pageColor active:opacity-70 disabled:bg-stateColors-disabled",
24
- outline:
25
- "border border-input hover:bg-accent hover:text-accent-foreground",
26
- secondary:
27
- "border bg-buttonColors-secondaryFill text-buttonColors-secondaryText border-buttonColors-secondaryOutline active:opacity-70 disabled:bg-buttonColors-secondaryFill disabled:text-stateColors-disabled disabled:border-stateColors-disabled",
28
- ghost: "hover:bg-accent hover:text-accent-foreground",
29
- link: "underline-offset-4 hover:underline text-primary",
30
- quickadd:
31
- "bg-buttonColors-primaryFill text-buttonColors-primaryText active:opacity-70 w-full rounded-none rounded-b-lg h-8 text-xs",
32
- applePay: "bg-white text-black border border-black",
33
- shopPay: "bg-[#612EFF]",
34
- },
35
- },
36
- defaultVariants: {
37
- variant: "default",
38
- size: "default",
39
- },
40
- }
41
- )
42
-
43
- export interface ButtonProps
44
- extends React.ButtonHTMLAttributes<HTMLButtonElement>,
45
- VariantProps<typeof buttonVariants> {
46
- asChild?: boolean
47
- loading?: boolean
48
- }
49
-
50
- const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
51
- ({ className, variant, size, asChild = false, loading, ...props }, ref) => {
52
- const Comp = asChild ? Slot : "button"
53
- return (
54
- <Comp
55
- className={cn(buttonVariants({ variant, size, className }), {
56
- "pointer-events-none": loading,
57
- })}
58
- ref={ref}
59
- {...props}
60
- >
61
- {!loading && props.children}
62
- {loading && <IconLoader2 className="h-4 w-4 animate-spin" />}
63
- </Comp>
64
- )
65
- }
66
- )
67
- Button.displayName = "Button"
68
-
69
- export { Button, buttonVariants }