@codefast/ui 0.0.65 → 0.0.67
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.
- package/dist/{chunk-ZMF2SRE5.js → chunk-26W5NJTU.js} +1 -1
- package/dist/chunk-26W5NJTU.js.map +1 -0
- package/dist/chunk-3COHZ24E.cjs +2 -0
- package/dist/chunk-3COHZ24E.cjs.map +1 -0
- package/dist/{chunk-QEWITXOV.cjs → chunk-4MTN7WZ2.cjs} +1 -1
- package/dist/chunk-4MTN7WZ2.cjs.map +1 -0
- package/dist/chunk-5QETIFO4.js +2 -0
- package/dist/chunk-5QETIFO4.js.map +1 -0
- package/dist/{chunk-WECV77JD.cjs → chunk-5RJANBDJ.cjs} +1 -1
- package/dist/chunk-5RJANBDJ.cjs.map +1 -0
- package/dist/chunk-6UQKMUZG.cjs +2 -0
- package/dist/chunk-6UQKMUZG.cjs.map +1 -0
- package/dist/chunk-AVEDWLNQ.js +2 -0
- package/dist/chunk-AVEDWLNQ.js.map +1 -0
- package/dist/{chunk-YLE5XFEO.cjs → chunk-EW7DAPDC.cjs} +1 -1
- package/dist/chunk-EW7DAPDC.cjs.map +1 -0
- package/dist/{chunk-RSNKUKY7.js → chunk-HDHZESSG.js} +1 -1
- package/dist/chunk-HDHZESSG.js.map +1 -0
- package/dist/{chunk-GCHNSK5O.cjs → chunk-JMM2MTPI.cjs} +1 -1
- package/dist/chunk-JMM2MTPI.cjs.map +1 -0
- package/dist/{chunk-WRO3QIWH.js → chunk-JNOLIDCD.js} +1 -1
- package/dist/chunk-JNOLIDCD.js.map +1 -0
- package/dist/{chunk-F5TIIJJJ.cjs → chunk-LOJBMYTH.cjs} +1 -1
- package/dist/chunk-LOJBMYTH.cjs.map +1 -0
- package/dist/{chunk-A5ILA637.js → chunk-RBP4PBCK.js} +1 -1
- package/dist/chunk-RBP4PBCK.js.map +1 -0
- package/dist/{chunk-L7IASKCH.js → chunk-RVGKUNXC.js} +1 -1
- package/dist/{chunk-L7IASKCH.js.map → chunk-RVGKUNXC.js.map} +1 -1
- package/dist/{chunk-72NPDP3X.cjs → chunk-T3G5USVY.cjs} +1 -1
- package/dist/chunk-T3G5USVY.cjs.map +1 -0
- package/dist/chunk-VDVLCSO4.js +2 -0
- package/dist/chunk-VDVLCSO4.js.map +1 -0
- package/dist/{chunk-2OBTJ7SD.cjs → chunk-WKKCZQNO.cjs} +2 -2
- package/dist/chunk-WKKCZQNO.cjs.map +1 -0
- package/dist/{chunk-FNQFZJUG.js → chunk-WQFHFTYS.js} +1 -1
- package/dist/chunk-WQFHFTYS.js.map +1 -0
- package/dist/react/accordion.cjs.map +1 -1
- package/dist/react/accordion.js.map +1 -1
- package/dist/react/alert-dialog.cjs +1 -1
- package/dist/react/alert-dialog.cjs.map +1 -1
- package/dist/react/alert-dialog.js +1 -1
- package/dist/react/alert-dialog.js.map +1 -1
- package/dist/react/alert.cjs.map +1 -1
- package/dist/react/alert.js.map +1 -1
- package/dist/react/avatar.cjs.map +1 -1
- package/dist/react/avatar.js.map +1 -1
- package/dist/react/blockquote.cjs.map +1 -1
- package/dist/react/blockquote.js.map +1 -1
- package/dist/react/box.cjs.map +1 -1
- package/dist/react/box.js.map +1 -1
- package/dist/react/breadcrumb.cjs.map +1 -1
- package/dist/react/breadcrumb.js.map +1 -1
- package/dist/react/button.cjs +1 -1
- package/dist/react/button.js +1 -1
- package/dist/react/calendar.cjs +1 -1
- package/dist/react/calendar.js +1 -1
- package/dist/react/card.cjs.map +1 -1
- package/dist/react/card.js.map +1 -1
- package/dist/react/carousel.cjs +1 -1
- package/dist/react/carousel.cjs.map +1 -1
- package/dist/react/carousel.js +1 -1
- package/dist/react/carousel.js.map +1 -1
- package/dist/react/checkbox-cards.cjs +1 -1
- package/dist/react/checkbox-cards.cjs.map +1 -1
- package/dist/react/checkbox-cards.js +1 -1
- package/dist/react/checkbox-cards.js.map +1 -1
- package/dist/react/checkbox-group.cjs +1 -1
- package/dist/react/checkbox-group.cjs.map +1 -1
- package/dist/react/checkbox-group.js +1 -1
- package/dist/react/checkbox-group.js.map +1 -1
- package/dist/react/checkbox-group.primitive.cjs +1 -1
- package/dist/react/checkbox-group.primitive.js +1 -1
- package/dist/react/checkbox.cjs +1 -1
- package/dist/react/checkbox.cjs.map +1 -1
- package/dist/react/checkbox.js +1 -1
- package/dist/react/checkbox.js.map +1 -1
- package/dist/react/code.cjs.map +1 -1
- package/dist/react/code.js.map +1 -1
- package/dist/react/collapsible.cjs.map +1 -1
- package/dist/react/collapsible.js.map +1 -1
- package/dist/react/command.cjs +1 -1
- package/dist/react/command.cjs.map +1 -1
- package/dist/react/command.js +1 -1
- package/dist/react/command.js.map +1 -1
- package/dist/react/container.cjs.map +1 -1
- package/dist/react/container.js.map +1 -1
- package/dist/react/context-menu.cjs.map +1 -1
- package/dist/react/context-menu.js.map +1 -1
- package/dist/react/data-table.cjs +1 -1
- package/dist/react/data-table.js +1 -1
- package/dist/react/dialog.cjs +1 -1
- package/dist/react/dialog.js +1 -1
- package/dist/react/drawer.cjs.map +1 -1
- package/dist/react/drawer.js.map +1 -1
- package/dist/react/dropdown-menu.cjs +1 -1
- package/dist/react/dropdown-menu.js +1 -1
- package/dist/react/em.cjs.map +1 -1
- package/dist/react/em.js.map +1 -1
- package/dist/react/form.cjs +1 -1
- package/dist/react/form.cjs.map +1 -1
- package/dist/react/form.js +1 -1
- package/dist/react/form.js.map +1 -1
- package/dist/react/heading.cjs.map +1 -1
- package/dist/react/heading.js.map +1 -1
- package/dist/react/hover-card.cjs.map +1 -1
- package/dist/react/hover-card.js.map +1 -1
- package/dist/react/input-otp.cjs +1 -1
- package/dist/react/input-otp.cjs.map +1 -1
- package/dist/react/input-otp.js +1 -1
- package/dist/react/input-otp.js.map +1 -1
- package/dist/react/input.cjs +1 -1
- package/dist/react/input.cjs.map +1 -1
- package/dist/react/input.d.cts +113 -34
- package/dist/react/input.d.ts +113 -34
- package/dist/react/input.js +1 -1
- package/dist/react/input.js.map +1 -1
- package/dist/react/kbd.cjs.map +1 -1
- package/dist/react/kbd.js.map +1 -1
- package/dist/react/label.cjs +1 -1
- package/dist/react/label.js +1 -1
- package/dist/react/menubar.cjs.map +1 -1
- package/dist/react/menubar.js.map +1 -1
- package/dist/react/navigation-menu.cjs.map +1 -1
- package/dist/react/navigation-menu.js.map +1 -1
- package/dist/react/pagination.cjs +1 -1
- package/dist/react/pagination.cjs.map +1 -1
- package/dist/react/pagination.js +1 -1
- package/dist/react/pagination.js.map +1 -1
- package/dist/react/popover.cjs.map +1 -1
- package/dist/react/popover.js.map +1 -1
- package/dist/react/pre.cjs.map +1 -1
- package/dist/react/pre.js.map +1 -1
- package/dist/react/progress.cjs.map +1 -1
- package/dist/react/progress.js.map +1 -1
- package/dist/react/quote.cjs.map +1 -1
- package/dist/react/quote.js.map +1 -1
- package/dist/react/radio-cards.cjs +1 -1
- package/dist/react/radio-cards.cjs.map +1 -1
- package/dist/react/radio-cards.js +1 -1
- package/dist/react/radio-cards.js.map +1 -1
- package/dist/react/radio-group.cjs.map +1 -1
- package/dist/react/radio-group.js.map +1 -1
- package/dist/react/radio.cjs.map +1 -1
- package/dist/react/radio.js.map +1 -1
- package/dist/react/scroll-area.cjs.map +1 -1
- package/dist/react/scroll-area.js.map +1 -1
- package/dist/react/section.cjs.map +1 -1
- package/dist/react/section.js.map +1 -1
- package/dist/react/select.cjs +1 -1
- package/dist/react/select.js +1 -1
- package/dist/react/separator.cjs.map +1 -1
- package/dist/react/separator.js.map +1 -1
- package/dist/react/sheet.cjs.map +1 -1
- package/dist/react/sheet.js.map +1 -1
- package/dist/react/slider.cjs.map +1 -1
- package/dist/react/slider.js.map +1 -1
- package/dist/react/spinner.cjs +1 -1
- package/dist/react/spinner.js +1 -1
- package/dist/react/strong.cjs.map +1 -1
- package/dist/react/strong.js.map +1 -1
- package/dist/react/switch.cjs +1 -1
- package/dist/react/switch.cjs.map +1 -1
- package/dist/react/switch.js +1 -1
- package/dist/react/switch.js.map +1 -1
- package/dist/react/table.cjs.map +1 -1
- package/dist/react/table.js.map +1 -1
- package/dist/react/tabs.cjs.map +1 -1
- package/dist/react/tabs.js.map +1 -1
- package/dist/react/text-input.cjs +2 -0
- package/dist/react/text-input.cjs.map +1 -0
- package/dist/react/text-input.d.cts +11 -0
- package/dist/react/text-input.d.ts +11 -0
- package/dist/react/text-input.js +2 -0
- package/dist/react/text-input.js.map +1 -0
- package/dist/react/text.cjs.map +1 -1
- package/dist/react/text.js.map +1 -1
- package/dist/react/textarea.cjs +1 -1
- package/dist/react/textarea.cjs.map +1 -1
- package/dist/react/textarea.js +1 -1
- package/dist/react/textarea.js.map +1 -1
- package/dist/react/toggle-group.cjs +1 -1
- package/dist/react/toggle-group.cjs.map +1 -1
- package/dist/react/toggle-group.js +1 -1
- package/dist/react/toggle-group.js.map +1 -1
- package/dist/react/toggle.cjs +1 -1
- package/dist/react/toggle.js +1 -1
- package/dist/react/tooltip.cjs.map +1 -1
- package/dist/react/tooltip.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/package.json +76 -102
- package/dist/chunk-2OBTJ7SD.cjs.map +0 -1
- package/dist/chunk-3OEPCFBF.cjs +0 -2
- package/dist/chunk-3OEPCFBF.cjs.map +0 -1
- package/dist/chunk-6AFJCDFU.js +0 -2
- package/dist/chunk-6AFJCDFU.js.map +0 -1
- package/dist/chunk-72NPDP3X.cjs.map +0 -1
- package/dist/chunk-7CHCTEST.js +0 -2
- package/dist/chunk-7CHCTEST.js.map +0 -1
- package/dist/chunk-A5ILA637.js.map +0 -1
- package/dist/chunk-DH3YP4ZC.cjs +0 -2
- package/dist/chunk-DH3YP4ZC.cjs.map +0 -1
- package/dist/chunk-DTSAQICV.js +0 -2
- package/dist/chunk-DTSAQICV.js.map +0 -1
- package/dist/chunk-F5TIIJJJ.cjs.map +0 -1
- package/dist/chunk-FNQFZJUG.js.map +0 -1
- package/dist/chunk-GCHNSK5O.cjs.map +0 -1
- package/dist/chunk-NH6X3FON.js +0 -2
- package/dist/chunk-NH6X3FON.js.map +0 -1
- package/dist/chunk-P563ILDJ.cjs +0 -2
- package/dist/chunk-P563ILDJ.cjs.map +0 -1
- package/dist/chunk-QEWITXOV.cjs.map +0 -1
- package/dist/chunk-RSNKUKY7.js.map +0 -1
- package/dist/chunk-VVA2EE5V.js +0 -2
- package/dist/chunk-VVA2EE5V.js.map +0 -1
- package/dist/chunk-VZ6P3BCB.cjs +0 -2
- package/dist/chunk-VZ6P3BCB.cjs.map +0 -1
- package/dist/chunk-WECV77JD.cjs.map +0 -1
- package/dist/chunk-WRO3QIWH.js.map +0 -1
- package/dist/chunk-YLE5XFEO.cjs.map +0 -1
- package/dist/chunk-ZMF2SRE5.js.map +0 -1
- package/dist/hooks/use-media-query.cjs +0 -2
- package/dist/hooks/use-media-query.cjs.map +0 -1
- package/dist/hooks/use-media-query.d.cts +0 -3
- package/dist/hooks/use-media-query.d.ts +0 -3
- package/dist/hooks/use-media-query.js +0 -2
- package/dist/hooks/use-media-query.js.map +0 -1
- package/dist/hooks/use-mutation-observer.cjs +0 -2
- package/dist/hooks/use-mutation-observer.cjs.map +0 -1
- package/dist/hooks/use-mutation-observer.d.cts +0 -5
- package/dist/hooks/use-mutation-observer.d.ts +0 -5
- package/dist/hooks/use-mutation-observer.js +0 -2
- package/dist/hooks/use-mutation-observer.js.map +0 -1
- package/dist/lib/colors.cjs +0 -2
- package/dist/lib/colors.cjs.map +0 -1
- package/dist/lib/colors.d.cts +0 -1759
- package/dist/lib/colors.d.ts +0 -1759
- package/dist/lib/colors.js +0 -2
- package/dist/lib/colors.js.map +0 -1
- package/dist/plugin/animate.plugin.cjs +0 -2
- package/dist/plugin/animate.plugin.cjs.map +0 -1
- package/dist/plugin/animate.plugin.js +0 -2
- package/dist/plugin/animate.plugin.js.map +0 -1
- package/dist/plugin/base.plugin.cjs +0 -2
- package/dist/plugin/base.plugin.cjs.map +0 -1
- package/dist/plugin/base.plugin.js +0 -2
- package/dist/plugin/base.plugin.js.map +0 -1
- package/dist/plugin/perspective.plugin.cjs +0 -2
- package/dist/plugin/perspective.plugin.cjs.map +0 -1
- package/dist/plugin/perspective.plugin.js +0 -2
- package/dist/plugin/perspective.plugin.js.map +0 -1
- package/dist/tailwind.config.cjs +0 -2
- package/dist/tailwind.config.cjs.map +0 -1
- package/dist/tailwind.config.js +0 -2
- package/dist/tailwind.config.js.map +0 -1
- package/plugin/animate.plugin.ts +0 -319
- package/plugin/base.plugin.ts +0 -21
- package/plugin/perspective.plugin.ts +0 -11
- package/src/hooks/use-media-query.ts +0 -22
- package/src/hooks/use-mutation-observer.ts +0 -26
- package/src/lib/colors.ts +0 -1757
- package/src/lib/utils.ts +0 -6
- package/src/react/accordion.tsx +0 -86
- package/src/react/alert-dialog.tsx +0 -177
- package/src/react/alert.tsx +0 -71
- package/src/react/aspect-ratio.tsx +0 -17
- package/src/react/avatar.tsx +0 -58
- package/src/react/badge.tsx +0 -39
- package/src/react/blockquote.tsx +0 -26
- package/src/react/box.tsx +0 -34
- package/src/react/breadcrumb.tsx +0 -148
- package/src/react/button.tsx +0 -95
- package/src/react/calendar.tsx +0 -79
- package/src/react/card.tsx +0 -103
- package/src/react/carousel.tsx +0 -299
- package/src/react/checkbox-cards.tsx +0 -59
- package/src/react/checkbox-group.primitive.tsx +0 -200
- package/src/react/checkbox-group.tsx +0 -53
- package/src/react/checkbox.tsx +0 -36
- package/src/react/code.tsx +0 -26
- package/src/react/collapsible.tsx +0 -54
- package/src/react/command.tsx +0 -199
- package/src/react/container.tsx +0 -27
- package/src/react/context-menu.tsx +0 -302
- package/src/react/data-table.tsx +0 -249
- package/src/react/dialog.tsx +0 -156
- package/src/react/drawer.tsx +0 -132
- package/src/react/dropdown-menu.tsx +0 -286
- package/src/react/em.tsx +0 -26
- package/src/react/form.tsx +0 -218
- package/src/react/heading.tsx +0 -27
- package/src/react/hover-card.tsx +0 -73
- package/src/react/input-otp.tsx +0 -114
- package/src/react/input.tsx +0 -42
- package/src/react/kbd.tsx +0 -36
- package/src/react/label.tsx +0 -31
- package/src/react/menubar.tsx +0 -316
- package/src/react/navigation-menu.tsx +0 -192
- package/src/react/pagination.tsx +0 -150
- package/src/react/popover.tsx +0 -82
- package/src/react/pre.tsx +0 -26
- package/src/react/progress.tsx +0 -35
- package/src/react/quote.tsx +0 -26
- package/src/react/radio-cards.tsx +0 -46
- package/src/react/radio-group.tsx +0 -48
- package/src/react/radio.tsx +0 -38
- package/src/react/resizable.tsx +0 -62
- package/src/react/scroll-area.tsx +0 -106
- package/src/react/section.tsx +0 -26
- package/src/react/select.tsx +0 -217
- package/src/react/separator.tsx +0 -32
- package/src/react/sheet.tsx +0 -170
- package/src/react/skeleton.tsx +0 -18
- package/src/react/slider.tsx +0 -41
- package/src/react/sonner.tsx +0 -40
- package/src/react/spinner.tsx +0 -68
- package/src/react/strong.tsx +0 -26
- package/src/react/switch.tsx +0 -33
- package/src/react/table.tsx +0 -142
- package/src/react/tabs.tsx +0 -87
- package/src/react/text.tsx +0 -34
- package/src/react/textarea.tsx +0 -30
- package/src/react/toggle-group.tsx +0 -81
- package/src/react/toggle.tsx +0 -49
- package/src/react/tooltip.tsx +0 -81
- package/src/styles/styles.css +0 -3
- package/tailwind.config.ts +0 -126
package/src/lib/utils.ts
DELETED
package/src/react/accordion.tsx
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
5
|
-
import { ChevronDownIcon } from '@radix-ui/react-icons';
|
|
6
|
-
import { cn } from '../lib/utils';
|
|
7
|
-
|
|
8
|
-
/* -----------------------------------------------------------------------------
|
|
9
|
-
* Component: Accordion
|
|
10
|
-
* -------------------------------------------------------------------------- */
|
|
11
|
-
|
|
12
|
-
type AccordionProps = React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Root>;
|
|
13
|
-
const Accordion = AccordionPrimitive.Root;
|
|
14
|
-
|
|
15
|
-
/* -----------------------------------------------------------------------------
|
|
16
|
-
* Component: AccordionItem
|
|
17
|
-
* -------------------------------------------------------------------------- */
|
|
18
|
-
|
|
19
|
-
type AccordionItemElement = React.ElementRef<typeof AccordionPrimitive.Item>;
|
|
20
|
-
type AccordionItemProps = React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>;
|
|
21
|
-
|
|
22
|
-
const AccordionItem = React.forwardRef<AccordionItemElement, AccordionItemProps>(({ className, ...props }, ref) => (
|
|
23
|
-
<AccordionPrimitive.Item ref={ref} className={cn('border-b', className)} {...props} />
|
|
24
|
-
));
|
|
25
|
-
|
|
26
|
-
AccordionItem.displayName = AccordionPrimitive.Item.displayName;
|
|
27
|
-
|
|
28
|
-
/* -----------------------------------------------------------------------------
|
|
29
|
-
* Component: AccordionTrigger
|
|
30
|
-
* -------------------------------------------------------------------------- */
|
|
31
|
-
|
|
32
|
-
type AccordionTriggerElement = React.ElementRef<typeof AccordionPrimitive.Trigger>;
|
|
33
|
-
type AccordionTriggerProps = React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>;
|
|
34
|
-
|
|
35
|
-
const AccordionTrigger = React.forwardRef<AccordionTriggerElement, AccordionTriggerProps>(
|
|
36
|
-
({ children, className, ...props }, ref) => (
|
|
37
|
-
<AccordionPrimitive.Header className="flex">
|
|
38
|
-
<AccordionPrimitive.Trigger
|
|
39
|
-
ref={ref}
|
|
40
|
-
className={cn('group flex flex-1 items-center justify-between py-4 text-sm font-medium', className)}
|
|
41
|
-
{...props}
|
|
42
|
-
>
|
|
43
|
-
{children}
|
|
44
|
-
<ChevronDownIcon className="text-muted-foreground size-4 shrink-0 transition group-data-[state=open]:rotate-180" />
|
|
45
|
-
</AccordionPrimitive.Trigger>
|
|
46
|
-
</AccordionPrimitive.Header>
|
|
47
|
-
),
|
|
48
|
-
);
|
|
49
|
-
|
|
50
|
-
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
|
|
51
|
-
|
|
52
|
-
/* -----------------------------------------------------------------------------
|
|
53
|
-
* Component: AccordionContent
|
|
54
|
-
* -------------------------------------------------------------------------- */
|
|
55
|
-
|
|
56
|
-
type AccordionContentElement = React.ElementRef<typeof AccordionPrimitive.Content>;
|
|
57
|
-
type AccordionContentProps = React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>;
|
|
58
|
-
|
|
59
|
-
const AccordionContent = React.forwardRef<AccordionContentElement, AccordionContentProps>(
|
|
60
|
-
({ children, className, ...props }, ref) => (
|
|
61
|
-
<AccordionPrimitive.Content
|
|
62
|
-
ref={ref}
|
|
63
|
-
className="data-[state=open]:animate-collapsible-open data-[state=closed]:animate-collapsible-closed overflow-hidden text-sm"
|
|
64
|
-
{...props}
|
|
65
|
-
>
|
|
66
|
-
<div className={cn('pb-4 pt-0', className)}>{children}</div>
|
|
67
|
-
</AccordionPrimitive.Content>
|
|
68
|
-
),
|
|
69
|
-
);
|
|
70
|
-
|
|
71
|
-
AccordionContent.displayName = AccordionPrimitive.Content.displayName;
|
|
72
|
-
|
|
73
|
-
/* -----------------------------------------------------------------------------
|
|
74
|
-
* Exports
|
|
75
|
-
* -------------------------------------------------------------------------- */
|
|
76
|
-
|
|
77
|
-
export {
|
|
78
|
-
Accordion,
|
|
79
|
-
AccordionItem,
|
|
80
|
-
AccordionTrigger,
|
|
81
|
-
AccordionContent,
|
|
82
|
-
type AccordionProps,
|
|
83
|
-
type AccordionItemProps,
|
|
84
|
-
type AccordionTriggerProps,
|
|
85
|
-
type AccordionContentProps,
|
|
86
|
-
};
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
|
5
|
-
import { cn } from '../lib/utils';
|
|
6
|
-
import { buttonVariants } from './button';
|
|
7
|
-
|
|
8
|
-
/* -----------------------------------------------------------------------------
|
|
9
|
-
* Component: AlertDialog
|
|
10
|
-
* -------------------------------------------------------------------------- */
|
|
11
|
-
|
|
12
|
-
type AlertDialogProps = React.ComponentProps<typeof AlertDialogPrimitive.Root>;
|
|
13
|
-
const AlertDialog = AlertDialogPrimitive.Root;
|
|
14
|
-
|
|
15
|
-
/* -----------------------------------------------------------------------------
|
|
16
|
-
* Component: AlertDialogTrigger
|
|
17
|
-
* -------------------------------------------------------------------------- */
|
|
18
|
-
|
|
19
|
-
type AlertDialogTriggerProps = React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Trigger>;
|
|
20
|
-
const AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
21
|
-
|
|
22
|
-
/* -----------------------------------------------------------------------------
|
|
23
|
-
* Component: AlertDialogContent
|
|
24
|
-
* -------------------------------------------------------------------------- */
|
|
25
|
-
|
|
26
|
-
type AlertDialogContentElement = React.ElementRef<typeof AlertDialogPrimitive.Content>;
|
|
27
|
-
type AlertDialogContentProps = React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>;
|
|
28
|
-
|
|
29
|
-
const AlertDialogContent = React.forwardRef<AlertDialogContentElement, AlertDialogContentProps>(
|
|
30
|
-
({ className, ...props }, ref) => (
|
|
31
|
-
<AlertDialogPrimitive.Portal>
|
|
32
|
-
<AlertDialogPrimitive.Overlay className="data-[state=open]:animate-duration-200 data-[state=closed]:animate-duration-200 data-[state=open]:animate-fade-in data-[state=closed]:animate-fade-out fixed inset-0 z-50 grid place-items-center overflow-auto bg-black/80 p-4 sm:pb-12 sm:pt-8">
|
|
33
|
-
<AlertDialogPrimitive.Content
|
|
34
|
-
ref={ref}
|
|
35
|
-
className={cn(
|
|
36
|
-
'bg-background data-[state=open]:animate-in data-[state=open]:zoom-in-95 data-[state=closed]:zoom-out-95 data-[state=open]:animate-duration-200 data-[state=closed]:animate-duration-200 data-[state=open]:fade-in data-[state=closed]:animate-out data-[state=closed]:fade-out relative z-50 flex w-full max-w-lg flex-col rounded-lg border shadow-lg',
|
|
37
|
-
className,
|
|
38
|
-
)}
|
|
39
|
-
{...props}
|
|
40
|
-
/>
|
|
41
|
-
</AlertDialogPrimitive.Overlay>
|
|
42
|
-
</AlertDialogPrimitive.Portal>
|
|
43
|
-
),
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
|
|
47
|
-
|
|
48
|
-
/* -----------------------------------------------------------------------------
|
|
49
|
-
* Component: AlertDialogHeader
|
|
50
|
-
* -------------------------------------------------------------------------- */
|
|
51
|
-
|
|
52
|
-
type AlertDialogHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
53
|
-
|
|
54
|
-
function AlertDialogHeader({ className, ...props }: AlertDialogHeaderProps): React.JSX.Element {
|
|
55
|
-
return (
|
|
56
|
-
<div
|
|
57
|
-
className={cn('flex shrink-0 flex-col gap-1.5 px-6 pb-4 pt-6 text-center sm:text-left', className)}
|
|
58
|
-
{...props}
|
|
59
|
-
/>
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/* -----------------------------------------------------------------------------
|
|
64
|
-
* Component: DialogBody
|
|
65
|
-
* -------------------------------------------------------------------------- */
|
|
66
|
-
|
|
67
|
-
type AlertDialogBodyProps = React.HTMLAttributes<HTMLDivElement>;
|
|
68
|
-
|
|
69
|
-
function AlertDialogBody({ className, ...props }: AlertDialogBodyProps): React.JSX.Element {
|
|
70
|
-
return <main className={cn('overflow-auto px-6 py-2', className)} {...props} />;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/* -----------------------------------------------------------------------------
|
|
74
|
-
* Component: AlertDialogFooter
|
|
75
|
-
* -------------------------------------------------------------------------- */
|
|
76
|
-
|
|
77
|
-
type AlertDialogFooterProps = React.HTMLAttributes<HTMLDivElement>;
|
|
78
|
-
|
|
79
|
-
function AlertDialogFooter({ className, ...props }: AlertDialogFooterProps): React.JSX.Element {
|
|
80
|
-
return (
|
|
81
|
-
<div
|
|
82
|
-
className={cn('flex shrink-0 flex-col-reverse gap-2 px-6 pb-6 pt-4 sm:flex-row sm:justify-end', className)}
|
|
83
|
-
{...props}
|
|
84
|
-
/>
|
|
85
|
-
);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/* -----------------------------------------------------------------------------
|
|
89
|
-
* Component: AlertDialogTitle
|
|
90
|
-
* -------------------------------------------------------------------------- */
|
|
91
|
-
|
|
92
|
-
type AlertDialogTitleElement = React.ElementRef<typeof AlertDialogPrimitive.Title>;
|
|
93
|
-
type AlertDialogTitleProps = React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>;
|
|
94
|
-
|
|
95
|
-
const AlertDialogTitle = React.forwardRef<AlertDialogTitleElement, AlertDialogTitleProps>(
|
|
96
|
-
({ className, ...props }, ref) => (
|
|
97
|
-
<AlertDialogPrimitive.Title
|
|
98
|
-
ref={ref}
|
|
99
|
-
className={cn('text-lg font-semibold leading-none tracking-tight', className)}
|
|
100
|
-
{...props}
|
|
101
|
-
/>
|
|
102
|
-
),
|
|
103
|
-
);
|
|
104
|
-
|
|
105
|
-
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
|
|
106
|
-
|
|
107
|
-
/* -----------------------------------------------------------------------------
|
|
108
|
-
* Component: AlertDialogDescription
|
|
109
|
-
* -------------------------------------------------------------------------- */
|
|
110
|
-
|
|
111
|
-
type AlertDialogDescriptionElement = React.ElementRef<typeof AlertDialogPrimitive.Description>;
|
|
112
|
-
type AlertDialogDescriptionProps = React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>;
|
|
113
|
-
|
|
114
|
-
const AlertDialogDescription = React.forwardRef<AlertDialogDescriptionElement, AlertDialogDescriptionProps>(
|
|
115
|
-
({ className, ...props }, ref) => (
|
|
116
|
-
<AlertDialogPrimitive.Description ref={ref} className={cn('text-muted-foreground text-sm', className)} {...props} />
|
|
117
|
-
),
|
|
118
|
-
);
|
|
119
|
-
|
|
120
|
-
AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;
|
|
121
|
-
|
|
122
|
-
/* -----------------------------------------------------------------------------
|
|
123
|
-
* Component: AlertDialogAction
|
|
124
|
-
* -------------------------------------------------------------------------- */
|
|
125
|
-
|
|
126
|
-
type AlertDialogActionElement = React.ElementRef<typeof AlertDialogPrimitive.Action>;
|
|
127
|
-
type AlertDialogActionProps = React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>;
|
|
128
|
-
|
|
129
|
-
const AlertDialogAction = React.forwardRef<AlertDialogActionElement, AlertDialogActionProps>(
|
|
130
|
-
({ className, ...props }, ref) => (
|
|
131
|
-
<AlertDialogPrimitive.Action ref={ref} className={buttonVariants({ className })} {...props} />
|
|
132
|
-
),
|
|
133
|
-
);
|
|
134
|
-
|
|
135
|
-
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
136
|
-
|
|
137
|
-
/* -----------------------------------------------------------------------------
|
|
138
|
-
* Component: AlertDialogCancel
|
|
139
|
-
* -------------------------------------------------------------------------- */
|
|
140
|
-
|
|
141
|
-
type AlertDialogCancelElement = React.ElementRef<typeof AlertDialogPrimitive.Cancel>;
|
|
142
|
-
type AlertDialogCancelProps = React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>;
|
|
143
|
-
|
|
144
|
-
const AlertDialogCancel = React.forwardRef<AlertDialogCancelElement, AlertDialogCancelProps>(
|
|
145
|
-
({ className, ...props }, ref) => (
|
|
146
|
-
<AlertDialogPrimitive.Cancel ref={ref} className={buttonVariants({ variant: 'outline', className })} {...props} />
|
|
147
|
-
),
|
|
148
|
-
);
|
|
149
|
-
|
|
150
|
-
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
|
|
151
|
-
|
|
152
|
-
/* -----------------------------------------------------------------------------
|
|
153
|
-
* Exports
|
|
154
|
-
* -------------------------------------------------------------------------- */
|
|
155
|
-
|
|
156
|
-
export {
|
|
157
|
-
AlertDialog,
|
|
158
|
-
AlertDialogTrigger,
|
|
159
|
-
AlertDialogContent,
|
|
160
|
-
AlertDialogHeader,
|
|
161
|
-
AlertDialogBody,
|
|
162
|
-
AlertDialogFooter,
|
|
163
|
-
AlertDialogTitle,
|
|
164
|
-
AlertDialogDescription,
|
|
165
|
-
AlertDialogAction,
|
|
166
|
-
AlertDialogCancel,
|
|
167
|
-
type AlertDialogProps,
|
|
168
|
-
type AlertDialogTriggerProps,
|
|
169
|
-
type AlertDialogContentProps,
|
|
170
|
-
type AlertDialogHeaderProps,
|
|
171
|
-
type AlertDialogBodyProps,
|
|
172
|
-
type AlertDialogFooterProps,
|
|
173
|
-
type AlertDialogTitleProps,
|
|
174
|
-
type AlertDialogDescriptionProps,
|
|
175
|
-
type AlertDialogActionProps,
|
|
176
|
-
type AlertDialogCancelProps,
|
|
177
|
-
};
|
package/src/react/alert.tsx
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { tv, type VariantProps } from 'tailwind-variants';
|
|
3
|
-
import { cn } from '../lib/utils';
|
|
4
|
-
|
|
5
|
-
/* -----------------------------------------------------------------------------
|
|
6
|
-
* Variant: Alert
|
|
7
|
-
* -------------------------------------------------------------------------- */
|
|
8
|
-
|
|
9
|
-
const alertVariants = tv({
|
|
10
|
-
base: '[&>svg+div]:-translate-y-0.75 relative w-full rounded-lg border p-4 text-sm [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg~*]:pl-7',
|
|
11
|
-
variants: {
|
|
12
|
-
variant: {
|
|
13
|
-
default: 'bg-background text-foreground [&>svg]:text-foreground',
|
|
14
|
-
destructive: 'border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive',
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
defaultVariants: {
|
|
18
|
-
variant: 'default',
|
|
19
|
-
},
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
type AlertVariantsProps = VariantProps<typeof alertVariants>;
|
|
23
|
-
|
|
24
|
-
/* -----------------------------------------------------------------------------
|
|
25
|
-
* Component: Alert
|
|
26
|
-
* -------------------------------------------------------------------------- */
|
|
27
|
-
|
|
28
|
-
type AlertElement = HTMLDivElement;
|
|
29
|
-
type AlertProps = React.HTMLAttributes<HTMLDivElement> & AlertVariantsProps;
|
|
30
|
-
|
|
31
|
-
const Alert = React.forwardRef<AlertElement, AlertProps>(({ className, variant, ...props }, ref) => (
|
|
32
|
-
<div ref={ref} className={alertVariants({ variant, className })} role="alert" {...props} />
|
|
33
|
-
));
|
|
34
|
-
|
|
35
|
-
Alert.displayName = 'Alert';
|
|
36
|
-
|
|
37
|
-
/* -----------------------------------------------------------------------------
|
|
38
|
-
* Component: AlertTitle
|
|
39
|
-
* -------------------------------------------------------------------------- */
|
|
40
|
-
|
|
41
|
-
type AlertTitleElement = HTMLHeadingElement;
|
|
42
|
-
type AlertTitleProps = React.HTMLAttributes<HTMLHeadingElement>;
|
|
43
|
-
|
|
44
|
-
const AlertTitle = React.forwardRef<AlertTitleElement, AlertTitleProps>(({ children, className, ...props }, ref) => (
|
|
45
|
-
<h5 ref={ref} className={cn('mb-1 font-medium leading-none tracking-tight', className)} {...props}>
|
|
46
|
-
{children}
|
|
47
|
-
</h5>
|
|
48
|
-
));
|
|
49
|
-
|
|
50
|
-
AlertTitle.displayName = 'AlertTitle';
|
|
51
|
-
|
|
52
|
-
/* -----------------------------------------------------------------------------
|
|
53
|
-
* Component: AlertDescription
|
|
54
|
-
* -------------------------------------------------------------------------- */
|
|
55
|
-
|
|
56
|
-
type AlertDescriptionElement = HTMLDivElement;
|
|
57
|
-
type AlertDescriptionProps = React.HTMLAttributes<HTMLDivElement>;
|
|
58
|
-
|
|
59
|
-
const AlertDescription = React.forwardRef<AlertDescriptionElement, AlertDescriptionProps>(
|
|
60
|
-
({ className, ...props }, ref) => (
|
|
61
|
-
<div ref={ref} className={cn('text-sm [&_p]:leading-relaxed', className)} {...props} />
|
|
62
|
-
),
|
|
63
|
-
);
|
|
64
|
-
|
|
65
|
-
AlertDescription.displayName = 'AlertDescription';
|
|
66
|
-
|
|
67
|
-
/* -----------------------------------------------------------------------------
|
|
68
|
-
* Exports
|
|
69
|
-
* -------------------------------------------------------------------------- */
|
|
70
|
-
|
|
71
|
-
export { Alert, AlertTitle, AlertDescription, type AlertProps, type AlertTitleProps, type AlertDescriptionProps };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as AspectRatioPrimitive from '@radix-ui/react-aspect-ratio';
|
|
4
|
-
import type * as React from 'react';
|
|
5
|
-
|
|
6
|
-
/* -----------------------------------------------------------------------------
|
|
7
|
-
* Component: AspectRatio
|
|
8
|
-
* -------------------------------------------------------------------------- */
|
|
9
|
-
|
|
10
|
-
type AspectRatioProps = React.ComponentPropsWithoutRef<typeof AspectRatioPrimitive.Root>;
|
|
11
|
-
const AspectRatio = AspectRatioPrimitive.Root;
|
|
12
|
-
|
|
13
|
-
/* -----------------------------------------------------------------------------
|
|
14
|
-
* Exports
|
|
15
|
-
* -------------------------------------------------------------------------- */
|
|
16
|
-
|
|
17
|
-
export { AspectRatio, type AspectRatioProps };
|
package/src/react/avatar.tsx
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
5
|
-
import { cn } from '../lib/utils';
|
|
6
|
-
|
|
7
|
-
/* -----------------------------------------------------------------------------
|
|
8
|
-
* Component: Avatar
|
|
9
|
-
* -------------------------------------------------------------------------- */
|
|
10
|
-
|
|
11
|
-
type AvatarElement = React.ElementRef<typeof AvatarPrimitive.Root>;
|
|
12
|
-
type AvatarProps = React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>;
|
|
13
|
-
|
|
14
|
-
const Avatar = React.forwardRef<AvatarElement, AvatarProps>(({ className, ...props }, ref) => (
|
|
15
|
-
<AvatarPrimitive.Root
|
|
16
|
-
ref={ref}
|
|
17
|
-
className={cn('relative flex size-10 shrink-0 overflow-hidden rounded-full', className)}
|
|
18
|
-
{...props}
|
|
19
|
-
/>
|
|
20
|
-
));
|
|
21
|
-
|
|
22
|
-
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
23
|
-
|
|
24
|
-
/* -----------------------------------------------------------------------------
|
|
25
|
-
* Component: AvatarImage
|
|
26
|
-
* -------------------------------------------------------------------------- */
|
|
27
|
-
|
|
28
|
-
type AvatarImageElement = React.ElementRef<typeof AvatarPrimitive.Image>;
|
|
29
|
-
type AvatarImageProps = React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>;
|
|
30
|
-
|
|
31
|
-
const AvatarImage = React.forwardRef<AvatarImageElement, AvatarImageProps>(({ className, ...props }, ref) => (
|
|
32
|
-
<AvatarPrimitive.Image ref={ref} className={cn('aspect-square size-full', className)} {...props} />
|
|
33
|
-
));
|
|
34
|
-
|
|
35
|
-
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
36
|
-
|
|
37
|
-
/* -----------------------------------------------------------------------------
|
|
38
|
-
* Component: AvatarFallback
|
|
39
|
-
* -------------------------------------------------------------------------- */
|
|
40
|
-
|
|
41
|
-
type AvatarFallbackElement = React.ElementRef<typeof AvatarPrimitive.Fallback>;
|
|
42
|
-
type AvatarFallbackProps = React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>;
|
|
43
|
-
|
|
44
|
-
const AvatarFallback = React.forwardRef<AvatarFallbackElement, AvatarFallbackProps>(({ className, ...props }, ref) => (
|
|
45
|
-
<AvatarPrimitive.Fallback
|
|
46
|
-
ref={ref}
|
|
47
|
-
className={cn('bg-muted flex size-full items-center justify-center rounded-full', className)}
|
|
48
|
-
{...props}
|
|
49
|
-
/>
|
|
50
|
-
));
|
|
51
|
-
|
|
52
|
-
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
53
|
-
|
|
54
|
-
/* -----------------------------------------------------------------------------
|
|
55
|
-
* Exports
|
|
56
|
-
* -------------------------------------------------------------------------- */
|
|
57
|
-
|
|
58
|
-
export { Avatar, AvatarImage, AvatarFallback, type AvatarProps, type AvatarImageProps, type AvatarFallbackProps };
|
package/src/react/badge.tsx
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { tv, type VariantProps } from 'tailwind-variants';
|
|
3
|
-
|
|
4
|
-
/* -----------------------------------------------------------------------------
|
|
5
|
-
* Variant: Badge
|
|
6
|
-
* -------------------------------------------------------------------------- */
|
|
7
|
-
|
|
8
|
-
const badgeVariants = tv({
|
|
9
|
-
base: 'inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition',
|
|
10
|
-
variants: {
|
|
11
|
-
variant: {
|
|
12
|
-
default: 'bg-primary text-primary-foreground border-transparent shadow',
|
|
13
|
-
secondary: 'bg-secondary text-secondary-foreground border-transparent',
|
|
14
|
-
destructive: 'bg-destructive text-destructive-foreground border-transparent shadow',
|
|
15
|
-
outline: 'text-foreground',
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
defaultVariants: {
|
|
19
|
-
variant: 'default',
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
type BadgeVariantsProps = VariantProps<typeof badgeVariants>;
|
|
24
|
-
|
|
25
|
-
/* -----------------------------------------------------------------------------
|
|
26
|
-
* Component: Badge
|
|
27
|
-
* -------------------------------------------------------------------------- */
|
|
28
|
-
|
|
29
|
-
type BadgeProps = React.HTMLAttributes<HTMLDivElement> & BadgeVariantsProps;
|
|
30
|
-
|
|
31
|
-
function Badge({ className, variant, ...props }: BadgeProps): React.JSX.Element {
|
|
32
|
-
return <div className={badgeVariants({ variant, className })} {...props} />;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/* -----------------------------------------------------------------------------
|
|
36
|
-
* Exports
|
|
37
|
-
* -------------------------------------------------------------------------- */
|
|
38
|
-
|
|
39
|
-
export { Badge, type BadgeProps };
|
package/src/react/blockquote.tsx
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Slot } from '@radix-ui/react-slot';
|
|
3
|
-
|
|
4
|
-
/* -----------------------------------------------------------------------------
|
|
5
|
-
* Component: Blockquote
|
|
6
|
-
* -------------------------------------------------------------------------- */
|
|
7
|
-
|
|
8
|
-
type BlockquoteElement = HTMLQuoteElement;
|
|
9
|
-
|
|
10
|
-
interface BlockquoteProps extends React.BlockquoteHTMLAttributes<HTMLQuoteElement> {
|
|
11
|
-
asChild?: boolean;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const Blockquote = React.forwardRef<BlockquoteElement, BlockquoteProps>(({ asChild, ...props }, ref) => {
|
|
15
|
-
const Component = asChild ? Slot : 'blockquote';
|
|
16
|
-
|
|
17
|
-
return <Component ref={ref} {...props} />;
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
Blockquote.displayName = 'Blockquote';
|
|
21
|
-
|
|
22
|
-
/* -----------------------------------------------------------------------------
|
|
23
|
-
* Exports
|
|
24
|
-
* -------------------------------------------------------------------------- */
|
|
25
|
-
|
|
26
|
-
export { Blockquote, type BlockquoteProps };
|
package/src/react/box.tsx
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Slot } from '@radix-ui/react-slot';
|
|
3
|
-
|
|
4
|
-
/* -----------------------------------------------------------------------------
|
|
5
|
-
* Component: Box
|
|
6
|
-
* -------------------------------------------------------------------------- */
|
|
7
|
-
|
|
8
|
-
type BoxElement = HTMLDivElement;
|
|
9
|
-
|
|
10
|
-
interface BoxDivProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
11
|
-
as?: 'div';
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
interface BoxSpanProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
15
|
-
as: 'span';
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
type BoxProps = (BoxDivProps | BoxSpanProps) & {
|
|
19
|
-
asChild?: boolean;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const Box = React.forwardRef<BoxElement, BoxProps>(({ as: Tag = 'div', asChild, ...props }, ref) => {
|
|
23
|
-
const Component = asChild ? Slot : Tag;
|
|
24
|
-
|
|
25
|
-
return <Component ref={ref} {...props} />;
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
Box.displayName = 'Box';
|
|
29
|
-
|
|
30
|
-
/* -----------------------------------------------------------------------------
|
|
31
|
-
* Exports
|
|
32
|
-
* -------------------------------------------------------------------------- */
|
|
33
|
-
|
|
34
|
-
export { Box, type BoxProps };
|
package/src/react/breadcrumb.tsx
DELETED
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Slot } from '@radix-ui/react-slot';
|
|
3
|
-
import { ChevronRightIcon, DotsHorizontalIcon } from '@radix-ui/react-icons';
|
|
4
|
-
import { cn } from '../lib/utils';
|
|
5
|
-
|
|
6
|
-
/* -----------------------------------------------------------------------------
|
|
7
|
-
* Component: Breadcrumb
|
|
8
|
-
* -------------------------------------------------------------------------- */
|
|
9
|
-
|
|
10
|
-
type BreadcrumbElement = HTMLElement;
|
|
11
|
-
|
|
12
|
-
interface BreadcrumbProps extends React.HTMLAttributes<HTMLElement> {
|
|
13
|
-
separator?: React.ReactNode;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const Breadcrumb = React.forwardRef<BreadcrumbElement, BreadcrumbProps>(({ ...props }, ref) => (
|
|
17
|
-
<nav ref={ref} aria-label="breadcrumb" {...props} />
|
|
18
|
-
));
|
|
19
|
-
|
|
20
|
-
Breadcrumb.displayName = 'Breadcrumb';
|
|
21
|
-
|
|
22
|
-
/* -----------------------------------------------------------------------------
|
|
23
|
-
* Component: BreadcrumbList
|
|
24
|
-
* -------------------------------------------------------------------------- */
|
|
25
|
-
|
|
26
|
-
type BreadcrumbListElement = HTMLOListElement;
|
|
27
|
-
type BreadcrumbListProps = React.OlHTMLAttributes<HTMLOListElement>;
|
|
28
|
-
|
|
29
|
-
const BreadcrumbList = React.forwardRef<BreadcrumbListElement, BreadcrumbListProps>(({ className, ...props }, ref) => (
|
|
30
|
-
<ol
|
|
31
|
-
ref={ref}
|
|
32
|
-
className={cn(
|
|
33
|
-
'text-muted-foreground flex flex-wrap items-center gap-1.5 break-words text-sm sm:gap-2.5',
|
|
34
|
-
className,
|
|
35
|
-
)}
|
|
36
|
-
{...props}
|
|
37
|
-
/>
|
|
38
|
-
));
|
|
39
|
-
|
|
40
|
-
BreadcrumbList.displayName = 'BreadcrumbList';
|
|
41
|
-
|
|
42
|
-
/* -----------------------------------------------------------------------------
|
|
43
|
-
* Component: BreadcrumbItem
|
|
44
|
-
* -------------------------------------------------------------------------- */
|
|
45
|
-
|
|
46
|
-
type BreadcrumbItemElement = HTMLLIElement;
|
|
47
|
-
type BreadcrumbItemProps = React.LiHTMLAttributes<HTMLLIElement>;
|
|
48
|
-
|
|
49
|
-
const BreadcrumbItem = React.forwardRef<BreadcrumbItemElement, BreadcrumbItemProps>(({ className, ...props }, ref) => (
|
|
50
|
-
<li ref={ref} className={cn('inline-flex items-center gap-1.5', className)} {...props} />
|
|
51
|
-
));
|
|
52
|
-
|
|
53
|
-
BreadcrumbItem.displayName = 'BreadcrumbItem';
|
|
54
|
-
|
|
55
|
-
/* -----------------------------------------------------------------------------
|
|
56
|
-
* Component: BreadcrumbLink
|
|
57
|
-
* -------------------------------------------------------------------------- */
|
|
58
|
-
|
|
59
|
-
type BreadcrumbLinkElement = HTMLAnchorElement;
|
|
60
|
-
|
|
61
|
-
interface BreadcrumbLinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
62
|
-
asChild?: boolean;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const BreadcrumbLink = React.forwardRef<BreadcrumbLinkElement, BreadcrumbLinkProps>(
|
|
66
|
-
({ asChild, className, ...props }, ref) => {
|
|
67
|
-
const Component = asChild ? Slot : 'a';
|
|
68
|
-
|
|
69
|
-
return <Component ref={ref} className={cn('hover:text-foreground transition', className)} {...props} />;
|
|
70
|
-
},
|
|
71
|
-
);
|
|
72
|
-
|
|
73
|
-
BreadcrumbLink.displayName = 'BreadcrumbLink';
|
|
74
|
-
|
|
75
|
-
/* -----------------------------------------------------------------------------
|
|
76
|
-
* Component: BreadcrumbPage
|
|
77
|
-
* -------------------------------------------------------------------------- */
|
|
78
|
-
|
|
79
|
-
type BreadcrumbPageElement = HTMLSpanElement;
|
|
80
|
-
type BreadcrumbPageProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
81
|
-
|
|
82
|
-
const BreadcrumbPage = React.forwardRef<BreadcrumbPageElement, BreadcrumbPageProps>(({ className, ...props }, ref) => (
|
|
83
|
-
<span
|
|
84
|
-
ref={ref}
|
|
85
|
-
aria-current="page"
|
|
86
|
-
aria-disabled="true"
|
|
87
|
-
className={cn('text-foreground font-normal', className)}
|
|
88
|
-
role="link"
|
|
89
|
-
{...props}
|
|
90
|
-
/>
|
|
91
|
-
));
|
|
92
|
-
|
|
93
|
-
BreadcrumbPage.displayName = 'BreadcrumbPage';
|
|
94
|
-
|
|
95
|
-
/* -----------------------------------------------------------------------------
|
|
96
|
-
* Component: BreadcrumbSeparator
|
|
97
|
-
* -------------------------------------------------------------------------- */
|
|
98
|
-
|
|
99
|
-
type BreadcrumbSeparatorProps = React.LiHTMLAttributes<HTMLLIElement>;
|
|
100
|
-
|
|
101
|
-
function BreadcrumbSeparator({ children, className, ...props }: BreadcrumbSeparatorProps): React.JSX.Element {
|
|
102
|
-
return (
|
|
103
|
-
<li aria-hidden="true" className={cn('[&>svg]:size-3.5', className)} role="presentation" {...props}>
|
|
104
|
-
{children ?? <ChevronRightIcon />}
|
|
105
|
-
</li>
|
|
106
|
-
);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/* -----------------------------------------------------------------------------
|
|
110
|
-
* Component: BreadcrumbEllipsis
|
|
111
|
-
* -------------------------------------------------------------------------- */
|
|
112
|
-
|
|
113
|
-
type BreadcrumbEllipsisProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
114
|
-
|
|
115
|
-
function BreadcrumbEllipsis({ className, ...props }: BreadcrumbEllipsisProps): React.JSX.Element {
|
|
116
|
-
return (
|
|
117
|
-
<span
|
|
118
|
-
aria-hidden="true"
|
|
119
|
-
className={cn('flex size-4 items-center justify-center', className)}
|
|
120
|
-
role="presentation"
|
|
121
|
-
{...props}
|
|
122
|
-
>
|
|
123
|
-
<DotsHorizontalIcon className="size-4" />
|
|
124
|
-
<span className="sr-only">More</span>
|
|
125
|
-
</span>
|
|
126
|
-
);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
/* -----------------------------------------------------------------------------
|
|
130
|
-
* Exports
|
|
131
|
-
* -------------------------------------------------------------------------- */
|
|
132
|
-
|
|
133
|
-
export {
|
|
134
|
-
Breadcrumb,
|
|
135
|
-
BreadcrumbList,
|
|
136
|
-
BreadcrumbItem,
|
|
137
|
-
BreadcrumbLink,
|
|
138
|
-
BreadcrumbPage,
|
|
139
|
-
BreadcrumbSeparator,
|
|
140
|
-
BreadcrumbEllipsis,
|
|
141
|
-
type BreadcrumbProps,
|
|
142
|
-
type BreadcrumbListProps,
|
|
143
|
-
type BreadcrumbItemProps,
|
|
144
|
-
type BreadcrumbLinkProps,
|
|
145
|
-
type BreadcrumbPageProps,
|
|
146
|
-
type BreadcrumbSeparatorProps,
|
|
147
|
-
type BreadcrumbEllipsisProps,
|
|
148
|
-
};
|