@tapcart/mobile-components 0.2.3 → 0.2.7

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