@tapcart/mobile-components 0.2.4 → 0.2.8

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 (116) hide show
  1. package/dist/components/hooks/use-infinite-scroll.d.ts +25 -0
  2. package/dist/components/hooks/use-infinite-scroll.d.ts.map +1 -0
  3. package/dist/components/hooks/use-infinite-scroll.js +48 -0
  4. package/dist/components/ui/accordion.d.ts +8 -0
  5. package/dist/components/ui/accordion.d.ts.map +1 -0
  6. package/dist/components/ui/accordion.js +34 -0
  7. package/dist/components/ui/alert-dialog.d.ts +21 -0
  8. package/dist/components/ui/alert-dialog.d.ts.map +1 -0
  9. package/dist/components/ui/alert-dialog.js +62 -0
  10. package/dist/components/ui/aspect-ratio.d.ts +5 -0
  11. package/dist/components/ui/aspect-ratio.d.ts.map +1 -0
  12. package/dist/components/ui/aspect-ratio.js +4 -0
  13. package/dist/components/ui/badge.d.ts +13 -0
  14. package/dist/components/ui/badge.d.ts.map +1 -0
  15. package/dist/components/ui/badge.js +34 -0
  16. package/dist/components/ui/button.d.ts +14 -0
  17. package/dist/components/ui/button.d.ts.map +1 -0
  18. package/dist/components/ui/button.js +56 -0
  19. package/dist/components/ui/carousel.d.ts +19 -0
  20. package/dist/components/ui/carousel.d.ts.map +1 -0
  21. package/dist/components/ui/carousel.js +112 -0
  22. package/dist/components/ui/checkbox.d.ts +18 -0
  23. package/dist/components/ui/checkbox.d.ts.map +1 -0
  24. package/dist/components/ui/checkbox.js +38 -0
  25. package/dist/components/ui/chip.d.ts +28 -0
  26. package/dist/components/ui/chip.d.ts.map +1 -0
  27. package/dist/components/ui/chip.js +66 -0
  28. package/dist/components/ui/container.d.ts +10 -0
  29. package/dist/components/ui/container.d.ts.map +1 -0
  30. package/dist/components/ui/container.js +26 -0
  31. package/dist/components/ui/drawer.d.ts +37 -0
  32. package/dist/components/ui/drawer.d.ts.map +1 -0
  33. package/dist/components/ui/drawer.js +63 -0
  34. package/dist/components/ui/favorite.d.ts +13 -0
  35. package/dist/components/ui/favorite.d.ts.map +1 -0
  36. package/dist/components/ui/favorite.js +35 -0
  37. package/dist/components/ui/grid.d.ts +14 -0
  38. package/dist/components/ui/grid.d.ts.map +1 -0
  39. package/dist/components/ui/grid.js +33 -0
  40. package/dist/components/ui/icon.d.ts +13 -0
  41. package/dist/components/ui/icon.d.ts.map +1 -0
  42. package/dist/components/ui/icon.js +50 -0
  43. package/dist/components/ui/input.d.ts +17 -0
  44. package/dist/components/ui/input.d.ts.map +1 -0
  45. package/dist/components/ui/input.js +35 -0
  46. package/dist/components/ui/label.d.ts +6 -0
  47. package/dist/components/ui/label.d.ts.map +1 -0
  48. package/dist/components/ui/label.js +24 -0
  49. package/dist/components/ui/money.d.ts +12 -0
  50. package/dist/components/ui/money.d.ts.map +1 -0
  51. package/dist/components/ui/money.js +30 -0
  52. package/dist/components/ui/price.d.ts +13 -0
  53. package/dist/components/ui/price.d.ts.map +1 -0
  54. package/dist/components/ui/price.js +9 -0
  55. package/dist/components/ui/product-card.d.ts +68 -0
  56. package/dist/components/ui/product-card.d.ts.map +1 -0
  57. package/dist/components/ui/product-card.js +132 -0
  58. package/dist/components/ui/product-grid.d.ts +14 -0
  59. package/dist/components/ui/product-grid.d.ts.map +1 -0
  60. package/dist/components/ui/product-grid.js +22 -0
  61. package/dist/components/ui/radio-group.d.ts +21 -0
  62. package/dist/components/ui/radio-group.d.ts.map +1 -0
  63. package/dist/components/ui/radio-group.js +47 -0
  64. package/dist/components/ui/scroll-area.d.ts +9 -0
  65. package/dist/components/ui/scroll-area.d.ts.map +1 -0
  66. package/dist/components/ui/scroll-area.js +29 -0
  67. package/dist/components/ui/selectors.d.ts +30 -0
  68. package/dist/components/ui/selectors.d.ts.map +1 -0
  69. package/dist/components/ui/selectors.js +45 -0
  70. package/dist/components/ui/separator.d.ts +5 -0
  71. package/dist/components/ui/separator.d.ts.map +1 -0
  72. package/dist/components/ui/separator.js +22 -0
  73. package/dist/components/ui/skeleton.d.ts +13 -0
  74. package/dist/components/ui/skeleton.d.ts.map +1 -0
  75. package/dist/components/ui/skeleton.js +33 -0
  76. package/dist/components/ui/switch.d.ts +5 -0
  77. package/dist/components/ui/switch.d.ts.map +1 -0
  78. package/dist/components/ui/switch.js +22 -0
  79. package/dist/components/ui/tabs.d.ts +13 -0
  80. package/dist/components/ui/tabs.d.ts.map +1 -0
  81. package/dist/components/ui/tabs.js +96 -0
  82. package/dist/components/ui/text.d.ts +10 -0
  83. package/dist/components/ui/text.d.ts.map +1 -0
  84. package/dist/components/ui/text.js +33 -0
  85. package/dist/components/ui/toast.d.ts +20 -0
  86. package/dist/components/ui/toast.d.ts.map +1 -0
  87. package/dist/components/ui/toast.js +98 -0
  88. package/dist/components/ui/toaster.d.ts +6 -0
  89. package/dist/components/ui/toaster.d.ts.map +1 -0
  90. package/dist/components/ui/toaster.js +22 -0
  91. package/dist/components/ui/toggle-group.d.ts +13 -0
  92. package/dist/components/ui/toggle-group.d.ts.map +1 -0
  93. package/dist/components/ui/toggle-group.js +36 -0
  94. package/dist/components/ui/toggle.d.ts +13 -0
  95. package/dist/components/ui/toggle.d.ts.map +1 -0
  96. package/dist/components/ui/toggle.js +40 -0
  97. package/dist/components/ui/use-toast.d.ts +45 -0
  98. package/dist/components/ui/use-toast.d.ts.map +1 -0
  99. package/dist/components/ui/use-toast.js +112 -0
  100. package/dist/components/ui/video.d.ts +8 -0
  101. package/dist/components/ui/video.d.ts.map +1 -0
  102. package/dist/components/ui/video.js +22 -0
  103. package/dist/components/ui/wishlist.d.ts +12 -0
  104. package/dist/components/ui/wishlist.d.ts.map +1 -0
  105. package/dist/components/ui/wishlist.js +23 -0
  106. package/dist/index.d.ts +36 -0
  107. package/dist/index.d.ts.map +1 -0
  108. package/dist/index.js +36 -0
  109. package/dist/lib/utils.d.ts +6 -0
  110. package/dist/lib/utils.d.ts.map +1 -0
  111. package/dist/lib/utils.js +25 -0
  112. package/dist/styles.css +425 -142
  113. package/package.json +19 -9
  114. package/dist/index.d.mts +0 -221
  115. package/dist/index.mjs +0 -999
  116. package/dist/index.mjs.map +0 -1
package/dist/index.mjs DELETED
@@ -1,999 +0,0 @@
1
- // components/ui/button.tsx
2
- import * as React from "react";
3
- import { Slot } from "@radix-ui/react-slot";
4
- import { cva } from "class-variance-authority";
5
-
6
- // lib/utils.ts
7
- import { clsx } from "clsx";
8
- import { twMerge } from "tailwind-merge";
9
- function cn(...inputs) {
10
- return twMerge(clsx(inputs));
11
- }
12
- var iconColorLevels = [
13
- "coreColors-primaryIcon",
14
- "coreColors-secondaryIcon",
15
- "coreColors-headerIcon",
16
- "coreColors-brandColorPrimary",
17
- "stateColors-subscriptions",
18
- "stateColors-favorites",
19
- "stateColors-reviews",
20
- "stateColors-success",
21
- "stateColors-error",
22
- "stateColors-warning",
23
- "stateColors-disabled",
24
- "buttonColors-primaryText",
25
- "buttonColors-secondaryText"
26
- ];
27
- var iconColorVariantClasses = {};
28
- for (let iconColorLevel of iconColorLevels) {
29
- iconColorVariantClasses[iconColorLevel] = `text-${iconColorLevel}`;
30
- }
31
-
32
- // components/ui/button.tsx
33
- import { jsx } from "react/jsx-runtime";
34
- var buttonVariants = cva(
35
- "w-full 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",
36
- {
37
- variants: {
38
- size: {
39
- default: "h-10 py-3 px-4",
40
- sm: "h-9 px-3 rounded-md",
41
- lg: "h-11 px-8 rounded-md",
42
- icon: "h-10 w-10",
43
- content: "h-10 py-3 px-4 w-auto"
44
- },
45
- variant: {
46
- default: "bg-buttonColors-primaryFill text-buttonColors-primaryText active:opacity-70",
47
- destructive: "bg-stateColors-error text-coreColors-pageColor active:opacity-70 disabled:bg-stateColors-disabled",
48
- outline: "border border-input hover:bg-accent hover:text-accent-foreground",
49
- secondary: "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",
50
- ghost: "hover:bg-accent hover:text-accent-foreground",
51
- link: "underline-offset-4 hover:underline text-primary",
52
- quickadd: "bg-buttonColors-primaryFill text-buttonColors-primaryText active:opacity-70 w-full rounded-none rounded-b-lg h-8 text-xs",
53
- applePay: "bg-white text-black border border-black",
54
- shopPay: "bg-[#612EFF]"
55
- }
56
- },
57
- defaultVariants: {
58
- variant: "default",
59
- size: "default"
60
- }
61
- }
62
- );
63
- var Button = React.forwardRef(
64
- ({ className, variant, size, asChild = false, loading, ...props }, ref) => {
65
- const Comp = asChild ? Slot : "button";
66
- return /* @__PURE__ */ jsx(
67
- Comp,
68
- {
69
- className: cn(buttonVariants({ variant, size, className }), {
70
- "pointer-events-none": loading
71
- }),
72
- ref,
73
- ...props,
74
- children: !loading && props.children
75
- }
76
- );
77
- }
78
- );
79
- Button.displayName = "Button";
80
-
81
- // components/ui/input.tsx
82
- import * as React2 from "react";
83
- import { Slot as Slot2 } from "@radix-ui/react-slot";
84
- import { cva as cva2 } from "class-variance-authority";
85
- import { jsx as jsx2, jsxs } from "react/jsx-runtime";
86
- var inputVariants = cva2(
87
- "flex h-14 w-full rounded border border-coreColors-dividingLines bg-coreColors-inputBackground px-4 pt-5 pb-2 placeholder-shown:p-4 text-textColors-primaryColor text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-textColors-secondaryColor focus-visible:outline-none focus-visible:ring-0 disabled:cursor-not-allowed disabled:opacity-50 focus:border-coreColors-brandColorPrimary peer data-[icon=true]:pr-10",
88
- {
89
- variants: {
90
- error: {
91
- true: "border-stateColors-error text-stateColors-error placeholder:text-stateColors-error focus:border-stateColors-error [&+label]:text-stateColors-error",
92
- false: ""
93
- }
94
- },
95
- defaultVariants: {
96
- error: false
97
- }
98
- }
99
- );
100
- var Input = React2.forwardRef(
101
- ({ className, error = false, id, type, label, icon, asChild, ...props }, ref) => {
102
- const Comp = asChild ? Slot2 : "div";
103
- return /* @__PURE__ */ jsxs(Comp, { className: "relative", children: [
104
- /* @__PURE__ */ jsx2(
105
- "input",
106
- {
107
- id,
108
- type,
109
- className: cn(inputVariants({ error }), className),
110
- "data-icon": !!icon,
111
- ref,
112
- ...props
113
- }
114
- ),
115
- label ? /* @__PURE__ */ jsx2(
116
- "label",
117
- {
118
- htmlFor: id,
119
- className: "absolute text-[10px] text-textColors-secondaryColor top-2 z-10 h-4 origin-[0] start-4 opacity-100 peer-placeholder-shown:opacity-0",
120
- children: label
121
- }
122
- ) : null
123
- ] });
124
- }
125
- );
126
- Input.displayName = "Input";
127
-
128
- // components/ui/aspect-ratio.tsx
129
- import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio";
130
- var AspectRatio = AspectRatioPrimitive.Root;
131
-
132
- // components/ui/accordion.tsx
133
- import * as React3 from "react";
134
- import * as AccordionPrimitive from "@radix-ui/react-accordion";
135
- import { ChevronDown } from "lucide-react";
136
- import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
137
- var Accordion = AccordionPrimitive.Root;
138
- var AccordionItem = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3(
139
- AccordionPrimitive.Item,
140
- {
141
- ref,
142
- className: cn("border-b", className),
143
- ...props
144
- }
145
- ));
146
- AccordionItem.displayName = "AccordionItem";
147
- var AccordionTrigger = React3.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx3(AccordionPrimitive.Header, { className: "flex", children: /* @__PURE__ */ jsxs2(
148
- AccordionPrimitive.Trigger,
149
- {
150
- ref,
151
- className: cn(
152
- "flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",
153
- className
154
- ),
155
- ...props,
156
- children: [
157
- children,
158
- /* @__PURE__ */ jsx3(ChevronDown, { className: "h-4 w-4 shrink-0 transition-transform duration-200" })
159
- ]
160
- }
161
- ) }));
162
- AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
163
- var AccordionContent = React3.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx3(
164
- AccordionPrimitive.Content,
165
- {
166
- ref,
167
- className: "overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
168
- ...props,
169
- children: /* @__PURE__ */ jsx3("div", { className: cn("pb-4 pt-0", className), children })
170
- }
171
- ));
172
- AccordionContent.displayName = AccordionPrimitive.Content.displayName;
173
-
174
- // components/ui/carousel.tsx
175
- import * as React4 from "react";
176
- import useEmblaCarousel from "embla-carousel-react";
177
- import { ArrowLeft, ArrowRight } from "lucide-react";
178
- import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
179
- var CarouselContext = React4.createContext(null);
180
- function useCarousel() {
181
- const context = React4.useContext(CarouselContext);
182
- if (!context) {
183
- throw new Error("useCarousel must be used within a <Carousel />");
184
- }
185
- return context;
186
- }
187
- var Carousel = React4.forwardRef(
188
- ({
189
- orientation = "horizontal",
190
- opts,
191
- setApi,
192
- plugins,
193
- className,
194
- children,
195
- ...props
196
- }, ref) => {
197
- const [carouselRef, api] = useEmblaCarousel(
198
- {
199
- ...opts,
200
- axis: orientation === "horizontal" ? "x" : "y"
201
- },
202
- plugins
203
- );
204
- const [canScrollPrev, setCanScrollPrev] = React4.useState(false);
205
- const [canScrollNext, setCanScrollNext] = React4.useState(false);
206
- const onSelect = React4.useCallback((api2) => {
207
- if (!api2) {
208
- return;
209
- }
210
- setCanScrollPrev(api2.canScrollPrev());
211
- setCanScrollNext(api2.canScrollNext());
212
- }, []);
213
- const scrollPrev = React4.useCallback(() => {
214
- api?.scrollPrev();
215
- }, [api]);
216
- const scrollNext = React4.useCallback(() => {
217
- api?.scrollNext();
218
- }, [api]);
219
- const handleKeyDown = React4.useCallback(
220
- (event) => {
221
- if (event.key === "ArrowLeft") {
222
- event.preventDefault();
223
- scrollPrev();
224
- } else if (event.key === "ArrowRight") {
225
- event.preventDefault();
226
- scrollNext();
227
- }
228
- },
229
- [scrollPrev, scrollNext]
230
- );
231
- React4.useEffect(() => {
232
- if (!api || !setApi) {
233
- return;
234
- }
235
- setApi(api);
236
- }, [api, setApi]);
237
- React4.useEffect(() => {
238
- if (!api) {
239
- return;
240
- }
241
- onSelect(api);
242
- api.on("reInit", onSelect);
243
- api.on("select", onSelect);
244
- return () => {
245
- api?.off("select", onSelect);
246
- };
247
- }, [api, onSelect]);
248
- return /* @__PURE__ */ jsx4(
249
- CarouselContext.Provider,
250
- {
251
- value: {
252
- carouselRef,
253
- api,
254
- opts,
255
- orientation: orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
256
- scrollPrev,
257
- scrollNext,
258
- canScrollPrev,
259
- canScrollNext
260
- },
261
- children: /* @__PURE__ */ jsx4(
262
- "div",
263
- {
264
- ref,
265
- onKeyDownCapture: handleKeyDown,
266
- className: cn("relative", className),
267
- role: "region",
268
- "aria-roledescription": "carousel",
269
- ...props,
270
- children
271
- }
272
- )
273
- }
274
- );
275
- }
276
- );
277
- Carousel.displayName = "Carousel";
278
- var CarouselContent = React4.forwardRef(({ className, ...props }, ref) => {
279
- const { carouselRef, orientation } = useCarousel();
280
- return /* @__PURE__ */ jsx4("div", { ref: carouselRef, className: "overflow-hidden", children: /* @__PURE__ */ jsx4(
281
- "div",
282
- {
283
- ref,
284
- className: cn(
285
- "flex",
286
- orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col",
287
- className
288
- ),
289
- ...props
290
- }
291
- ) });
292
- });
293
- CarouselContent.displayName = "CarouselContent";
294
- var CarouselItem = React4.forwardRef(({ className, ...props }, ref) => {
295
- const { orientation } = useCarousel();
296
- return /* @__PURE__ */ jsx4(
297
- "div",
298
- {
299
- ref,
300
- role: "group",
301
- "aria-roledescription": "slide",
302
- className: cn(
303
- "min-w-0 shrink-0 grow-0 basis-full",
304
- orientation === "horizontal" ? "pl-4" : "pt-4",
305
- className
306
- ),
307
- ...props
308
- }
309
- );
310
- });
311
- CarouselItem.displayName = "CarouselItem";
312
- var CarouselPrevious = React4.forwardRef(({ className, variant = "outline", size = "icon", ...props }, ref) => {
313
- const { orientation, scrollPrev, canScrollPrev } = useCarousel();
314
- return /* @__PURE__ */ jsxs3(
315
- Button,
316
- {
317
- ref,
318
- variant,
319
- size,
320
- className: cn(
321
- "absolute h-8 w-8 rounded-full",
322
- orientation === "horizontal" ? "-left-12 top-1/2 -translate-y-1/2" : "-top-12 left-1/2 -translate-x-1/2 rotate-90",
323
- className
324
- ),
325
- disabled: !canScrollPrev,
326
- onClick: scrollPrev,
327
- ...props,
328
- children: [
329
- /* @__PURE__ */ jsx4(ArrowLeft, { className: "h-4 w-4" }),
330
- /* @__PURE__ */ jsx4("span", { className: "sr-only", children: "Previous slide" })
331
- ]
332
- }
333
- );
334
- });
335
- CarouselPrevious.displayName = "CarouselPrevious";
336
- var CarouselNext = React4.forwardRef(({ className, variant = "outline", size = "icon", ...props }, ref) => {
337
- const { orientation, scrollNext, canScrollNext } = useCarousel();
338
- return /* @__PURE__ */ jsxs3(
339
- Button,
340
- {
341
- ref,
342
- variant,
343
- size,
344
- className: cn(
345
- "absolute h-8 w-8 rounded-full",
346
- orientation === "horizontal" ? "-right-12 top-1/2 -translate-y-1/2" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
347
- className
348
- ),
349
- disabled: !canScrollNext,
350
- onClick: scrollNext,
351
- ...props,
352
- children: [
353
- /* @__PURE__ */ jsx4(ArrowRight, { className: "h-4 w-4" }),
354
- /* @__PURE__ */ jsx4("span", { className: "sr-only", children: "Next slide" })
355
- ]
356
- }
357
- );
358
- });
359
- CarouselNext.displayName = "CarouselNext";
360
-
361
- // components/ui/container.tsx
362
- import { cva as cva3 } from "class-variance-authority";
363
- import { jsx as jsx5 } from "react/jsx-runtime";
364
- var containerVariants = cva3("container", {
365
- variants: {
366
- variant: {
367
- spaced: "my-3"
368
- }
369
- }
370
- });
371
- function Container({ className, variant, ...props }) {
372
- return /* @__PURE__ */ jsx5("div", { className: cn(containerVariants({ variant }), className), ...props });
373
- }
374
-
375
- // components/ui/grid.tsx
376
- import { cva as cva4 } from "class-variance-authority";
377
- import { jsx as jsx6 } from "react/jsx-runtime";
378
- var gridVariants = cva4("grid", {
379
- variants: {
380
- columns: {
381
- 1: "grid-cols-1 gap-y-[7px]",
382
- 2: "grid-cols-2 gap-x-[7px] gap-y-[7px]",
383
- 3: "grid-cols-3 gap-x-[7px] gap-y-[7px]",
384
- 4: "grid-cols-4 gap-x-[7px] gap-y-[7px]"
385
- }
386
- },
387
- defaultVariants: {
388
- columns: 2
389
- }
390
- });
391
- function Grid({ className, columns, ...props }) {
392
- return /* @__PURE__ */ jsx6(Container, { children: /* @__PURE__ */ jsx6("div", { className: cn(gridVariants({ columns }), className), ...props }) });
393
- }
394
-
395
- // components/ui/label.tsx
396
- import * as React5 from "react";
397
- import * as LabelPrimitive from "@radix-ui/react-label";
398
- import { cva as cva5 } from "class-variance-authority";
399
- import { jsx as jsx7 } from "react/jsx-runtime";
400
- var labelVariants = cva5(
401
- "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
402
- );
403
- var Label = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx7(
404
- LabelPrimitive.Root,
405
- {
406
- ref,
407
- className: cn(labelVariants(), className),
408
- ...props
409
- }
410
- ));
411
- Label.displayName = LabelPrimitive.Root.displayName;
412
-
413
- // components/ui/separator.tsx
414
- import * as React6 from "react";
415
- import * as SeparatorPrimitive from "@radix-ui/react-separator";
416
- import { jsx as jsx8 } from "react/jsx-runtime";
417
- var Separator = React6.forwardRef(
418
- ({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsx8(
419
- SeparatorPrimitive.Root,
420
- {
421
- ref,
422
- decorative,
423
- orientation,
424
- className: cn(
425
- "shrink-0 bg-border",
426
- orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
427
- className
428
- ),
429
- ...props
430
- }
431
- )
432
- );
433
- Separator.displayName = SeparatorPrimitive.Root.displayName;
434
-
435
- // components/ui/badge.tsx
436
- import { cva as cva6 } from "class-variance-authority";
437
- import { jsx as jsx9 } from "react/jsx-runtime";
438
- var badgeVariants = cva6(
439
- "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",
440
- {
441
- variants: {
442
- variant: {
443
- default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
444
- secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
445
- destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
446
- outline: "text-foreground"
447
- }
448
- },
449
- defaultVariants: {
450
- variant: "default"
451
- }
452
- }
453
- );
454
- function Badge({ className, variant, ...props }) {
455
- return /* @__PURE__ */ jsx9("div", { className: cn(badgeVariants({ variant }), className), ...props });
456
- }
457
-
458
- // components/ui/video.tsx
459
- import { cva as cva7 } from "class-variance-authority";
460
- import { jsx as jsx10 } from "react/jsx-runtime";
461
- var videoVariants = cva7("w-full", {
462
- variants: {}
463
- });
464
- function Video({ className, ...props }) {
465
- return /* @__PURE__ */ jsx10(
466
- "video",
467
- {
468
- className: cn(videoVariants({}), className),
469
- ...props,
470
- autoPlay: true,
471
- playsInline: true,
472
- muted: true,
473
- loop: true
474
- }
475
- );
476
- }
477
-
478
- // components/ui/money.tsx
479
- import { cva as cva8 } from "class-variance-authority";
480
- import { jsx as jsx11 } from "react/jsx-runtime";
481
- var moneyVariants = cva8("", {
482
- variants: {},
483
- defaultVariants: {
484
- currency: "USD",
485
- locale: "en-US"
486
- }
487
- });
488
- function Money({ price, locale, currency, ...props }) {
489
- const formatter = new Intl.NumberFormat(locale, {
490
- style: "currency",
491
- currency
492
- });
493
- let formattedPrice = formatter.format(Number(price));
494
- return /* @__PURE__ */ jsx11("span", { ...props, children: formattedPrice });
495
- }
496
-
497
- // components/ui/skeleton.tsx
498
- import { jsx as jsx12 } from "react/jsx-runtime";
499
- function Skeleton({
500
- className,
501
- ...props
502
- }) {
503
- return /* @__PURE__ */ jsx12(
504
- "div",
505
- {
506
- className: cn("animate-pulse rounded-md bg-muted", className),
507
- ...props
508
- }
509
- );
510
- }
511
-
512
- // components/ui/text.tsx
513
- import { cva as cva9 } from "class-variance-authority";
514
- import { jsx as jsx13 } from "react/jsx-runtime";
515
- var textVariants = cva9("", {
516
- variants: {
517
- type: {
518
- h1: "text-2xl font-normal text-[#121212]",
519
- h2: "text-xl font-medium text-[#121212]",
520
- body: "text-base font-normal text-[#121212]",
521
- paragraph: "text-sm font-normal text-[#727272]",
522
- label: "text-xs font-normal text-[#727272]"
523
- }
524
- },
525
- defaultVariants: {
526
- type: "body"
527
- }
528
- });
529
- function Text({ className, type, ...props }) {
530
- return /* @__PURE__ */ jsx13("p", { className: cn(textVariants({ type }), className), ...props });
531
- }
532
-
533
- // components/ui/toggle.tsx
534
- import * as React7 from "react";
535
- import * as TogglePrimitive from "@radix-ui/react-toggle";
536
- import { cva as cva10 } from "class-variance-authority";
537
- import { jsx as jsx14 } from "react/jsx-runtime";
538
- var toggleVariants = cva10(
539
- "inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground 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",
540
- {
541
- variants: {
542
- variant: {
543
- default: "bg-transparent",
544
- outline: "border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"
545
- },
546
- size: {
547
- default: "h-10 px-3",
548
- sm: "h-9 px-2.5",
549
- lg: "h-11 px-5"
550
- }
551
- },
552
- defaultVariants: {
553
- variant: "default",
554
- size: "default"
555
- }
556
- }
557
- );
558
- var Toggle = React7.forwardRef(({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsx14(
559
- TogglePrimitive.Root,
560
- {
561
- ref,
562
- className: cn(toggleVariants({ variant, size, className })),
563
- ...props
564
- }
565
- ));
566
- Toggle.displayName = TogglePrimitive.Root.displayName;
567
-
568
- // components/ui/toggle-group.tsx
569
- import * as React8 from "react";
570
- import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
571
- import { jsx as jsx15 } from "react/jsx-runtime";
572
- var ToggleGroupContext = React8.createContext({
573
- size: "default",
574
- variant: "default"
575
- });
576
- var ToggleGroup = React8.forwardRef(({ className, variant, size, children, ...props }, ref) => /* @__PURE__ */ jsx15(
577
- ToggleGroupPrimitive.Root,
578
- {
579
- ref,
580
- className: cn("flex items-center justify-center gap-1", className),
581
- ...props,
582
- children: /* @__PURE__ */ jsx15(ToggleGroupContext.Provider, { value: { variant, size }, children })
583
- }
584
- ));
585
- ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;
586
- var ToggleGroupItem = React8.forwardRef(({ className, children, variant, size, ...props }, ref) => {
587
- const context = React8.useContext(ToggleGroupContext);
588
- return /* @__PURE__ */ jsx15(
589
- ToggleGroupPrimitive.Item,
590
- {
591
- ref,
592
- className: cn(
593
- toggleVariants({
594
- variant: context.variant || variant,
595
- size: context.size || size
596
- }),
597
- className
598
- ),
599
- ...props,
600
- children
601
- }
602
- );
603
- });
604
- ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
605
-
606
- // components/ui/switch.tsx
607
- import * as React9 from "react";
608
- import * as SwitchPrimitives from "@radix-ui/react-switch";
609
- import { jsx as jsx16 } from "react/jsx-runtime";
610
- var Switch = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx16(
611
- SwitchPrimitives.Root,
612
- {
613
- className: cn(
614
- "peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
615
- className
616
- ),
617
- ...props,
618
- ref,
619
- children: /* @__PURE__ */ jsx16(
620
- SwitchPrimitives.Thumb,
621
- {
622
- className: cn(
623
- "pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"
624
- )
625
- }
626
- )
627
- }
628
- ));
629
- Switch.displayName = SwitchPrimitives.Root.displayName;
630
-
631
- // components/ui/scroll-area.tsx
632
- import * as React10 from "react";
633
- import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
634
- import { jsx as jsx17, jsxs as jsxs4 } from "react/jsx-runtime";
635
- var ScrollArea = React10.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs4(
636
- ScrollAreaPrimitive.Root,
637
- {
638
- ref,
639
- className: cn("relative overflow-hidden", className),
640
- ...props,
641
- children: [
642
- /* @__PURE__ */ jsx17(ScrollAreaPrimitive.Viewport, { className: "h-full w-full rounded-[inherit]", children: /* @__PURE__ */ jsx17("div", { className: "flex w-max px-[16px]", children }) }),
643
- /* @__PURE__ */ jsx17(ScrollBar, {}),
644
- /* @__PURE__ */ jsx17(ScrollAreaPrimitive.Corner, {})
645
- ]
646
- }
647
- ));
648
- ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
649
- var ScrollBar = React10.forwardRef(({ className, orientation = "horizontal", ...props }, ref) => /* @__PURE__ */ jsx17(
650
- ScrollAreaPrimitive.ScrollAreaScrollbar,
651
- {
652
- ref,
653
- orientation,
654
- className: cn(
655
- "flex touch-none select-none transition-colors",
656
- orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
657
- orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px] ",
658
- className
659
- ),
660
- ...props,
661
- children: /* @__PURE__ */ jsx17(ScrollAreaPrimitive.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
662
- }
663
- ));
664
- ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
665
-
666
- // components/ui/toast.tsx
667
- import * as React11 from "react";
668
- import * as ToastPrimitives from "@radix-ui/react-toast";
669
- import { cva as cva11 } from "class-variance-authority";
670
- import { X } from "lucide-react";
671
- import { jsx as jsx18 } from "react/jsx-runtime";
672
- var ToastProvider = ToastPrimitives.Provider;
673
- var ToastViewport = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx18(
674
- ToastPrimitives.Viewport,
675
- {
676
- ref,
677
- className: cn(
678
- "fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",
679
- className
680
- ),
681
- ...props
682
- }
683
- ));
684
- ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
685
- var toastVariants = cva11(
686
- "group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",
687
- {
688
- variants: {
689
- variant: {
690
- default: "border bg-background text-foreground",
691
- destructive: "destructive group border-destructive bg-destructive text-destructive-foreground"
692
- }
693
- },
694
- defaultVariants: {
695
- variant: "default"
696
- }
697
- }
698
- );
699
- var Toast = React11.forwardRef(({ className, variant, ...props }, ref) => {
700
- return /* @__PURE__ */ jsx18(
701
- ToastPrimitives.Root,
702
- {
703
- ref,
704
- className: cn(toastVariants({ variant }), className),
705
- ...props
706
- }
707
- );
708
- });
709
- Toast.displayName = ToastPrimitives.Root.displayName;
710
- var ToastAction = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx18(
711
- ToastPrimitives.Action,
712
- {
713
- ref,
714
- className: cn(
715
- "inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",
716
- className
717
- ),
718
- ...props
719
- }
720
- ));
721
- ToastAction.displayName = ToastPrimitives.Action.displayName;
722
- var ToastClose = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx18(
723
- ToastPrimitives.Close,
724
- {
725
- ref,
726
- className: cn(
727
- "absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",
728
- className
729
- ),
730
- "toast-close": "",
731
- ...props,
732
- children: /* @__PURE__ */ jsx18(X, { className: "h-4 w-4" })
733
- }
734
- ));
735
- ToastClose.displayName = ToastPrimitives.Close.displayName;
736
- var ToastTitle = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx18(
737
- ToastPrimitives.Title,
738
- {
739
- ref,
740
- className: cn("text-sm font-semibold", className),
741
- ...props
742
- }
743
- ));
744
- ToastTitle.displayName = ToastPrimitives.Title.displayName;
745
- var ToastDescription = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx18(
746
- ToastPrimitives.Description,
747
- {
748
- ref,
749
- className: cn("text-sm opacity-90", className),
750
- ...props
751
- }
752
- ));
753
- ToastDescription.displayName = ToastPrimitives.Description.displayName;
754
-
755
- // components/ui/use-toast.ts
756
- import * as React12 from "react";
757
- var TOAST_LIMIT = 1;
758
- var TOAST_REMOVE_DELAY = 1e6;
759
- var count = 0;
760
- function genId() {
761
- count = (count + 1) % Number.MAX_SAFE_INTEGER;
762
- return count.toString();
763
- }
764
- var toastTimeouts = /* @__PURE__ */ new Map();
765
- var addToRemoveQueue = (toastId) => {
766
- if (toastTimeouts.has(toastId)) {
767
- return;
768
- }
769
- const timeout = setTimeout(() => {
770
- toastTimeouts.delete(toastId);
771
- dispatch({
772
- type: "REMOVE_TOAST",
773
- toastId
774
- });
775
- }, TOAST_REMOVE_DELAY);
776
- toastTimeouts.set(toastId, timeout);
777
- };
778
- var reducer = (state, action) => {
779
- switch (action.type) {
780
- case "ADD_TOAST":
781
- return {
782
- ...state,
783
- toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT)
784
- };
785
- case "UPDATE_TOAST":
786
- return {
787
- ...state,
788
- toasts: state.toasts.map(
789
- (t) => t.id === action.toast.id ? { ...t, ...action.toast } : t
790
- )
791
- };
792
- case "DISMISS_TOAST": {
793
- const { toastId } = action;
794
- if (toastId) {
795
- addToRemoveQueue(toastId);
796
- } else {
797
- state.toasts.forEach((toast2) => {
798
- addToRemoveQueue(toast2.id);
799
- });
800
- }
801
- return {
802
- ...state,
803
- toasts: state.toasts.map(
804
- (t) => t.id === toastId || toastId === void 0 ? {
805
- ...t,
806
- open: false
807
- } : t
808
- )
809
- };
810
- }
811
- case "REMOVE_TOAST":
812
- if (action.toastId === void 0) {
813
- return {
814
- ...state,
815
- toasts: []
816
- };
817
- }
818
- return {
819
- ...state,
820
- toasts: state.toasts.filter((t) => t.id !== action.toastId)
821
- };
822
- }
823
- };
824
- var listeners = [];
825
- var memoryState = { toasts: [] };
826
- function dispatch(action) {
827
- memoryState = reducer(memoryState, action);
828
- listeners.forEach((listener) => {
829
- listener(memoryState);
830
- });
831
- }
832
- function toast({ ...props }) {
833
- const id = genId();
834
- const update = (props2) => dispatch({
835
- type: "UPDATE_TOAST",
836
- toast: { ...props2, id }
837
- });
838
- const dismiss = () => dispatch({ type: "DISMISS_TOAST", toastId: id });
839
- dispatch({
840
- type: "ADD_TOAST",
841
- toast: {
842
- ...props,
843
- id,
844
- open: true,
845
- onOpenChange: (open) => {
846
- if (!open) dismiss();
847
- }
848
- }
849
- });
850
- return {
851
- id,
852
- dismiss,
853
- update
854
- };
855
- }
856
- function useToast() {
857
- const [state, setState] = React12.useState(memoryState);
858
- React12.useEffect(() => {
859
- listeners.push(setState);
860
- return () => {
861
- const index = listeners.indexOf(setState);
862
- if (index > -1) {
863
- listeners.splice(index, 1);
864
- }
865
- };
866
- }, [state]);
867
- return {
868
- ...state,
869
- toast,
870
- dismiss: (toastId) => dispatch({ type: "DISMISS_TOAST", toastId })
871
- };
872
- }
873
-
874
- // components/ui/toaster.tsx
875
- import { jsx as jsx19, jsxs as jsxs5 } from "react/jsx-runtime";
876
- function Toaster() {
877
- const { toasts } = useToast();
878
- return /* @__PURE__ */ jsxs5(ToastProvider, { children: [
879
- toasts.map(function({ id, title, description, action, ...props }) {
880
- return /* @__PURE__ */ jsxs5(Toast, { ...props, children: [
881
- /* @__PURE__ */ jsxs5("div", { className: "grid gap-1", children: [
882
- title && /* @__PURE__ */ jsx19(ToastTitle, { children: title }),
883
- description && /* @__PURE__ */ jsx19(ToastDescription, { children: description })
884
- ] }),
885
- action,
886
- /* @__PURE__ */ jsx19(ToastClose, {})
887
- ] }, id);
888
- }),
889
- /* @__PURE__ */ jsx19(ToastViewport, {})
890
- ] });
891
- }
892
-
893
- // components/ui/chip.tsx
894
- import { cva as cva12 } from "class-variance-authority";
895
- import React13, { useState as useState3 } from "react";
896
- import { jsx as jsx20, jsxs as jsxs6 } from "react/jsx-runtime";
897
- var chipVariants = cva12(
898
- "inline-flex items-center justify-center rounded border border-coreColors-dividingLines text-[12px] transition-colors",
899
- {
900
- variants: {
901
- variant: {
902
- primary: "bg-coreColors-pageColor text-textColors-primaryColor",
903
- secondary: "bg-coreColors-pageColor text-textColors-secondaryColor"
904
- },
905
- direction: {
906
- horizontal: "flex-row",
907
- vertical: "flex-col"
908
- }
909
- },
910
- defaultVariants: {
911
- variant: "primary",
912
- direction: "horizontal"
913
- }
914
- }
915
- );
916
- var Chip = React13.forwardRef(
917
- ({ className, variant, direction, children, icon: Icon, iconPosition = "left", onClose, ...props }, ref) => {
918
- const [visible, setVisible] = useState3(true);
919
- if (!visible) return null;
920
- const handleIconClick = () => {
921
- setVisible(false);
922
- onClose?.();
923
- };
924
- return /* @__PURE__ */ jsxs6(
925
- "div",
926
- {
927
- ref,
928
- className: cn(chipVariants({ variant, direction }), "p-2 space-x-2", className),
929
- ...props,
930
- children: [
931
- Icon && iconPosition === "left" && /* @__PURE__ */ jsx20(Icon, { className: "mr-2 h-4 w-4 cursor-pointer", onClick: handleIconClick }),
932
- children,
933
- Icon && iconPosition === "right" && /* @__PURE__ */ jsx20(Icon, { className: "ml-2 h-4 w-4 cursor-pointer", onClick: handleIconClick })
934
- ]
935
- }
936
- );
937
- }
938
- );
939
- Chip.displayName = "Chip";
940
- var MultipleChips = ({ children }) => {
941
- return /* @__PURE__ */ jsxs6("div", { className: "relative mt-2 mb-4", children: [
942
- /* @__PURE__ */ jsx20("div", { className: "flex overflow-x-auto no-scrollbar", children: children.map((chip, index) => /* @__PURE__ */ jsx20("div", { className: cn("shrink-0", {
943
- "mr-2": index < children.length - 1
944
- }), children: chip }, index)) }),
945
- /* @__PURE__ */ jsx20("div", { className: "fade-right" })
946
- ] });
947
- };
948
- export {
949
- Accordion,
950
- AccordionContent,
951
- AccordionItem,
952
- AccordionTrigger,
953
- AspectRatio,
954
- Badge,
955
- Button,
956
- Carousel,
957
- CarouselContent,
958
- CarouselItem,
959
- CarouselNext,
960
- CarouselPrevious,
961
- Chip,
962
- Container,
963
- Grid,
964
- Input,
965
- Label,
966
- Money,
967
- MultipleChips,
968
- ScrollArea,
969
- ScrollBar,
970
- Separator,
971
- Skeleton,
972
- Switch,
973
- Text,
974
- Toast,
975
- ToastAction,
976
- ToastClose,
977
- ToastDescription,
978
- ToastProvider,
979
- ToastTitle,
980
- ToastViewport,
981
- Toaster,
982
- Toggle,
983
- ToggleGroup,
984
- ToggleGroupItem,
985
- Video,
986
- badgeVariants,
987
- buttonVariants,
988
- cn,
989
- containerVariants,
990
- gridVariants,
991
- moneyVariants,
992
- reducer,
993
- textVariants,
994
- toast,
995
- toggleVariants,
996
- useToast,
997
- videoVariants
998
- };
999
- //# sourceMappingURL=index.mjs.map