@codefast/ui 0.0.40 → 0.0.42
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-EVN2IB57.js → chunk-6EAQQBWG.js} +2 -2
- package/dist/chunk-6EAQQBWG.js.map +1 -0
- package/dist/{chunk-YR36SVVG.mjs → chunk-7HJV22OF.mjs} +1 -1
- package/dist/chunk-7HJV22OF.mjs.map +1 -0
- package/dist/{chunk-5WJB3UAO.js → chunk-CERSQE5J.js} +1 -1
- package/dist/chunk-CERSQE5J.js.map +1 -0
- package/dist/{chunk-UPZHCTQV.js → chunk-ELWITZPX.js} +2 -2
- package/dist/chunk-ELWITZPX.js.map +1 -0
- package/dist/{chunk-WLMYX3C7.mjs → chunk-GDMHMSJ2.mjs} +2 -2
- package/dist/chunk-GDMHMSJ2.mjs.map +1 -0
- package/dist/{chunk-UJJZZCAC.js → chunk-HQ4AUOQM.js} +1 -1
- package/dist/{chunk-UJJZZCAC.js.map → chunk-HQ4AUOQM.js.map} +1 -1
- package/dist/{chunk-HLXU3SQI.mjs → chunk-HWEFQSTC.mjs} +1 -1
- package/dist/chunk-HWEFQSTC.mjs.map +1 -0
- package/dist/{chunk-JTAXNFUM.mjs → chunk-HX5YKP4E.mjs} +2 -2
- package/dist/chunk-HX5YKP4E.mjs.map +1 -0
- package/dist/{chunk-PLX35IKX.mjs → chunk-I6QCJDIF.mjs} +1 -1
- package/dist/chunk-I6QCJDIF.mjs.map +1 -0
- package/dist/{chunk-466PAJCA.mjs → chunk-LEUB3C3L.mjs} +1 -1
- package/dist/chunk-LEUB3C3L.mjs.map +1 -0
- package/dist/{chunk-KJ77RPJ4.mjs → chunk-M5UKNISJ.mjs} +2 -2
- package/dist/chunk-M5UKNISJ.mjs.map +1 -0
- package/dist/{chunk-EYERINEJ.js → chunk-MZJL73RI.js} +1 -1
- package/dist/chunk-MZJL73RI.js.map +1 -0
- package/dist/{chunk-JCMRDCFT.js → chunk-NH6X3FON.js} +1 -1
- package/dist/{chunk-JCMRDCFT.js.map → chunk-NH6X3FON.js.map} +1 -1
- package/dist/{chunk-UDNWQQ3I.js → chunk-NSK74YTM.js} +2 -2
- package/dist/chunk-NSK74YTM.js.map +1 -0
- package/dist/{chunk-N6QGG4WS.mjs → chunk-P5AV3QU7.mjs} +2 -2
- package/dist/chunk-P5AV3QU7.mjs.map +1 -0
- package/dist/{chunk-GRQGCS7U.mjs → chunk-PWF46YXQ.mjs} +2 -2
- package/dist/chunk-PWF46YXQ.mjs.map +1 -0
- package/dist/{chunk-ZWGC5M4G.js → chunk-SCJ3W2VO.js} +2 -2
- package/dist/chunk-SCJ3W2VO.js.map +1 -0
- package/dist/{chunk-MSHUAEXI.js → chunk-SCPFGC2X.js} +2 -2
- package/dist/chunk-SCPFGC2X.js.map +1 -0
- package/dist/{chunk-JIHHUXA5.js → chunk-VXPAGNPJ.js} +2 -2
- package/dist/chunk-VXPAGNPJ.js.map +1 -0
- package/dist/{chunk-6B2PU2GG.mjs → chunk-WL65TBKJ.mjs} +2 -2
- package/dist/chunk-WL65TBKJ.mjs.map +1 -0
- package/dist/{chunk-4TJBMO2Y.mjs → chunk-WYYOCZNI.mjs} +2 -2
- package/dist/chunk-WYYOCZNI.mjs.map +1 -0
- package/dist/{chunk-FEE6PNWV.js → chunk-XM4Y2S5E.js} +2 -2
- package/dist/chunk-XM4Y2S5E.js.map +1 -0
- package/dist/{chunk-7PJR4WFR.mjs → chunk-ZEYIBYZP.mjs} +2 -2
- package/dist/chunk-ZEYIBYZP.mjs.map +1 -0
- package/dist/{chunk-AEWLL6A2.js → chunk-ZTEJNUH6.js} +2 -2
- package/dist/chunk-ZTEJNUH6.js.map +1 -0
- package/dist/lib/utils.js +1 -1
- package/dist/lib/utils.mjs +1 -1
- package/dist/plugin/animate.plugin.js +1 -1
- package/dist/plugin/animate.plugin.mjs +1 -1
- package/dist/plugin/base.plugin.js +1 -1
- package/dist/plugin/base.plugin.mjs +1 -1
- package/dist/plugin/perspective.plugin.js +1 -1
- package/dist/plugin/perspective.plugin.mjs +1 -1
- package/dist/react/accordion.js +1 -1
- package/dist/react/accordion.js.map +1 -1
- package/dist/react/accordion.mjs +1 -1
- package/dist/react/accordion.mjs.map +1 -1
- package/dist/react/alert-dialog.js +1 -1
- package/dist/react/alert-dialog.js.map +1 -1
- package/dist/react/alert-dialog.mjs +1 -1
- package/dist/react/alert-dialog.mjs.map +1 -1
- package/dist/react/alert.js +1 -1
- package/dist/react/alert.js.map +1 -1
- package/dist/react/alert.mjs +1 -1
- package/dist/react/alert.mjs.map +1 -1
- package/dist/react/aspect-ratio.js.map +1 -1
- package/dist/react/aspect-ratio.mjs.map +1 -1
- package/dist/react/avatar.js +1 -1
- package/dist/react/avatar.js.map +1 -1
- package/dist/react/avatar.mjs +1 -1
- package/dist/react/avatar.mjs.map +1 -1
- package/dist/react/badge.js +1 -1
- package/dist/react/badge.js.map +1 -1
- package/dist/react/badge.mjs +1 -1
- package/dist/react/badge.mjs.map +1 -1
- package/dist/react/blockquote.js.map +1 -1
- package/dist/react/blockquote.mjs.map +1 -1
- package/dist/react/box.d.mts +2 -2
- package/dist/react/box.d.ts +2 -2
- package/dist/react/box.js.map +1 -1
- package/dist/react/box.mjs.map +1 -1
- package/dist/react/breadcrumb.js +1 -1
- package/dist/react/breadcrumb.js.map +1 -1
- package/dist/react/breadcrumb.mjs +1 -1
- package/dist/react/breadcrumb.mjs.map +1 -1
- package/dist/react/button.js +1 -1
- package/dist/react/button.mjs +1 -1
- package/dist/react/calendar.js +1 -1
- package/dist/react/calendar.js.map +1 -1
- package/dist/react/calendar.mjs +1 -1
- package/dist/react/calendar.mjs.map +1 -1
- package/dist/react/card.js +1 -1
- package/dist/react/card.js.map +1 -1
- package/dist/react/card.mjs +1 -1
- package/dist/react/card.mjs.map +1 -1
- package/dist/react/carousel.d.mts +1 -1
- package/dist/react/carousel.d.ts +1 -1
- package/dist/react/carousel.js +1 -1
- package/dist/react/carousel.js.map +1 -1
- package/dist/react/carousel.mjs +1 -1
- package/dist/react/carousel.mjs.map +1 -1
- package/dist/react/checkbox-cards.js +1 -1
- package/dist/react/checkbox-cards.js.map +1 -1
- package/dist/react/checkbox-cards.mjs +1 -1
- package/dist/react/checkbox-cards.mjs.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.mjs +1 -1
- package/dist/react/checkbox-group.mjs.map +1 -1
- package/dist/react/checkbox-group.primitive.d.mts +8 -8
- package/dist/react/checkbox-group.primitive.d.ts +8 -8
- package/dist/react/checkbox-group.primitive.js +1 -1
- package/dist/react/checkbox-group.primitive.mjs +1 -1
- package/dist/react/checkbox.js +1 -1
- package/dist/react/checkbox.js.map +1 -1
- package/dist/react/checkbox.mjs +1 -1
- package/dist/react/checkbox.mjs.map +1 -1
- package/dist/react/code.js.map +1 -1
- package/dist/react/code.mjs.map +1 -1
- package/dist/react/collapsible.js +1 -1
- package/dist/react/collapsible.js.map +1 -1
- package/dist/react/collapsible.mjs +1 -1
- package/dist/react/collapsible.mjs.map +1 -1
- package/dist/react/command.js +1 -1
- package/dist/react/command.js.map +1 -1
- package/dist/react/command.mjs +1 -1
- package/dist/react/command.mjs.map +1 -1
- package/dist/react/container.js +1 -1
- package/dist/react/container.js.map +1 -1
- package/dist/react/container.mjs +1 -1
- package/dist/react/container.mjs.map +1 -1
- package/dist/react/context-menu.js +1 -1
- package/dist/react/context-menu.js.map +1 -1
- package/dist/react/context-menu.mjs +1 -1
- package/dist/react/context-menu.mjs.map +1 -1
- package/dist/react/data-table.d.mts +1 -1
- package/dist/react/data-table.d.ts +1 -1
- package/dist/react/data-table.js +1 -1
- package/dist/react/data-table.js.map +1 -1
- package/dist/react/data-table.mjs +1 -1
- package/dist/react/data-table.mjs.map +1 -1
- package/dist/react/dialog.js +1 -1
- package/dist/react/dialog.mjs +1 -1
- package/dist/react/drawer.js +1 -1
- package/dist/react/drawer.js.map +1 -1
- package/dist/react/drawer.mjs +1 -1
- package/dist/react/drawer.mjs.map +1 -1
- package/dist/react/dropdown-menu.js +1 -1
- package/dist/react/dropdown-menu.mjs +1 -1
- package/dist/react/em.js.map +1 -1
- package/dist/react/em.mjs.map +1 -1
- package/dist/react/form.js +1 -1
- package/dist/react/form.js.map +1 -1
- package/dist/react/form.mjs +1 -1
- package/dist/react/form.mjs.map +1 -1
- package/dist/react/heading.d.mts +1 -1
- package/dist/react/heading.d.ts +1 -1
- package/dist/react/heading.js.map +1 -1
- package/dist/react/heading.mjs.map +1 -1
- package/dist/react/hover-card.js +1 -1
- package/dist/react/hover-card.js.map +1 -1
- package/dist/react/hover-card.mjs +1 -1
- package/dist/react/hover-card.mjs.map +1 -1
- package/dist/react/input-otp.js +1 -1
- package/dist/react/input-otp.js.map +1 -1
- package/dist/react/input-otp.mjs +1 -1
- package/dist/react/input-otp.mjs.map +1 -1
- package/dist/react/input.js +1 -1
- package/dist/react/input.js.map +1 -1
- package/dist/react/input.mjs +1 -1
- package/dist/react/input.mjs.map +1 -1
- package/dist/react/kbd.js +1 -1
- package/dist/react/kbd.js.map +1 -1
- package/dist/react/kbd.mjs +1 -1
- package/dist/react/kbd.mjs.map +1 -1
- package/dist/react/label.js +1 -1
- package/dist/react/label.mjs +1 -1
- package/dist/react/menubar.js +1 -1
- package/dist/react/menubar.js.map +1 -1
- package/dist/react/menubar.mjs +1 -1
- package/dist/react/menubar.mjs.map +1 -1
- package/dist/react/navigation-menu.js +1 -1
- package/dist/react/navigation-menu.js.map +1 -1
- package/dist/react/navigation-menu.mjs +1 -1
- package/dist/react/navigation-menu.mjs.map +1 -1
- package/dist/react/pagination.d.mts +1 -1
- package/dist/react/pagination.d.ts +1 -1
- package/dist/react/pagination.js +1 -1
- package/dist/react/pagination.js.map +1 -1
- package/dist/react/pagination.mjs +1 -1
- package/dist/react/pagination.mjs.map +1 -1
- package/dist/react/popover.js +1 -1
- package/dist/react/popover.js.map +1 -1
- package/dist/react/popover.mjs +1 -1
- package/dist/react/popover.mjs.map +1 -1
- package/dist/react/pre.js.map +1 -1
- package/dist/react/pre.mjs.map +1 -1
- package/dist/react/progress.js +1 -1
- package/dist/react/progress.js.map +1 -1
- package/dist/react/progress.mjs +1 -1
- package/dist/react/progress.mjs.map +1 -1
- package/dist/react/quote.js.map +1 -1
- package/dist/react/quote.mjs.map +1 -1
- package/dist/react/radio-cards.js +1 -1
- package/dist/react/radio-cards.js.map +1 -1
- package/dist/react/radio-cards.mjs +1 -1
- package/dist/react/radio-cards.mjs.map +1 -1
- package/dist/react/radio-group.js +1 -1
- package/dist/react/radio-group.js.map +1 -1
- package/dist/react/radio-group.mjs +1 -1
- package/dist/react/radio-group.mjs.map +1 -1
- package/dist/react/radio.js +1 -1
- package/dist/react/radio.js.map +1 -1
- package/dist/react/radio.mjs +1 -1
- package/dist/react/radio.mjs.map +1 -1
- package/dist/react/resizable.js +1 -1
- package/dist/react/resizable.js.map +1 -1
- package/dist/react/resizable.mjs +1 -1
- package/dist/react/resizable.mjs.map +1 -1
- package/dist/react/scroll-area.js +1 -1
- package/dist/react/scroll-area.js.map +1 -1
- package/dist/react/scroll-area.mjs +1 -1
- package/dist/react/scroll-area.mjs.map +1 -1
- package/dist/react/section.js.map +1 -1
- package/dist/react/section.mjs.map +1 -1
- package/dist/react/select.js +1 -1
- package/dist/react/select.mjs +1 -1
- package/dist/react/separator.js +1 -1
- package/dist/react/separator.js.map +1 -1
- package/dist/react/separator.mjs +1 -1
- package/dist/react/separator.mjs.map +1 -1
- package/dist/react/sheet.js +1 -1
- package/dist/react/sheet.js.map +1 -1
- package/dist/react/sheet.mjs +1 -1
- package/dist/react/sheet.mjs.map +1 -1
- package/dist/react/skeleton.js +1 -1
- package/dist/react/skeleton.js.map +1 -1
- package/dist/react/skeleton.mjs +1 -1
- package/dist/react/skeleton.mjs.map +1 -1
- package/dist/react/slider.js +1 -1
- package/dist/react/slider.js.map +1 -1
- package/dist/react/slider.mjs +1 -1
- package/dist/react/slider.mjs.map +1 -1
- package/dist/react/sonner.js.map +1 -1
- package/dist/react/sonner.mjs.map +1 -1
- package/dist/react/spinner.js +1 -1
- package/dist/react/spinner.mjs +1 -1
- package/dist/react/strong.js.map +1 -1
- package/dist/react/strong.mjs.map +1 -1
- package/dist/react/switch.js +1 -1
- package/dist/react/switch.js.map +1 -1
- package/dist/react/switch.mjs +1 -1
- package/dist/react/switch.mjs.map +1 -1
- package/dist/react/table.js +1 -1
- package/dist/react/table.js.map +1 -1
- package/dist/react/table.mjs +1 -1
- package/dist/react/table.mjs.map +1 -1
- package/dist/react/tabs.js +1 -1
- package/dist/react/tabs.js.map +1 -1
- package/dist/react/tabs.mjs +1 -1
- package/dist/react/tabs.mjs.map +1 -1
- package/dist/react/text.d.mts +2 -2
- package/dist/react/text.d.ts +2 -2
- package/dist/react/text.js.map +1 -1
- package/dist/react/text.mjs.map +1 -1
- package/dist/react/textarea.js +1 -1
- package/dist/react/textarea.js.map +1 -1
- package/dist/react/textarea.mjs +1 -1
- package/dist/react/textarea.mjs.map +1 -1
- package/dist/react/toggle-group.js +1 -1
- package/dist/react/toggle-group.js.map +1 -1
- package/dist/react/toggle-group.mjs +1 -1
- package/dist/react/toggle-group.mjs.map +1 -1
- package/dist/react/toggle.js +1 -1
- package/dist/react/toggle.mjs +1 -1
- package/dist/react/tooltip.js +1 -1
- package/dist/react/tooltip.js.map +1 -1
- package/dist/react/tooltip.mjs +1 -1
- package/dist/react/tooltip.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/dist/tailwind.config.js +1 -1
- package/dist/tailwind.config.js.map +1 -1
- package/dist/tailwind.config.mjs +1 -1
- package/dist/tailwind.config.mjs.map +1 -1
- package/package.json +7 -7
- package/plugin/animate.plugin.ts +114 -111
- package/plugin/base.plugin.ts +10 -7
- package/plugin/perspective.plugin.ts +1 -1
- package/src/lib/utils.ts +2 -2
- package/src/react/accordion.tsx +65 -41
- package/src/react/alert-dialog.tsx +130 -62
- package/src/react/alert.tsx +50 -24
- package/src/react/aspect-ratio.tsx +6 -4
- package/src/react/avatar.tsx +47 -19
- package/src/react/badge.tsx +15 -10
- package/src/react/blockquote.tsx +11 -8
- package/src/react/box.tsx +11 -9
- package/src/react/breadcrumb.tsx +62 -29
- package/src/react/button.tsx +47 -31
- package/src/react/calendar.tsx +54 -37
- package/src/react/card.tsx +64 -30
- package/src/react/carousel.tsx +101 -43
- package/src/react/checkbox-cards.tsx +60 -33
- package/src/react/checkbox-group.primitive.tsx +93 -38
- package/src/react/checkbox-group.tsx +57 -34
- package/src/react/checkbox.tsx +24 -20
- package/src/react/code.tsx +9 -7
- package/src/react/collapsible.tsx +33 -23
- package/src/react/command.tsx +140 -75
- package/src/react/container.tsx +12 -8
- package/src/react/context-menu.tsx +228 -150
- package/src/react/data-table.tsx +51 -21
- package/src/react/dialog.tsx +95 -50
- package/src/react/drawer.tsx +96 -49
- package/src/react/dropdown-menu.tsx +199 -131
- package/src/react/em.tsx +9 -7
- package/src/react/form.tsx +96 -61
- package/src/react/heading.tsx +10 -8
- package/src/react/hover-card.tsx +42 -26
- package/src/react/input-otp.tsx +48 -37
- package/src/react/input.tsx +25 -15
- package/src/react/kbd.tsx +21 -19
- package/src/react/label.tsx +16 -14
- package/src/react/menubar.tsx +214 -135
- package/src/react/navigation-menu.tsx +153 -111
- package/src/react/pagination.tsx +59 -26
- package/src/react/popover.tsx +44 -29
- package/src/react/pre.tsx +9 -7
- package/src/react/progress.tsx +26 -19
- package/src/react/quote.tsx +9 -7
- package/src/react/radio-cards.tsx +32 -12
- package/src/react/radio-group.tsx +32 -12
- package/src/react/radio.tsx +24 -20
- package/src/react/resizable.tsx +13 -8
- package/src/react/scroll-area.tsx +56 -34
- package/src/react/section.tsx +9 -7
- package/src/react/select.tsx +167 -114
- package/src/react/separator.tsx +16 -7
- package/src/react/sheet.tsx +84 -34
- package/src/react/skeleton.tsx +8 -3
- package/src/react/slider.tsx +31 -24
- package/src/react/sonner.tsx +12 -10
- package/src/react/spinner.tsx +14 -9
- package/src/react/strong.tsx +9 -7
- package/src/react/switch.tsx +18 -16
- package/src/react/table.tsx +97 -52
- package/src/react/tabs.tsx +48 -38
- package/src/react/text.tsx +13 -10
- package/src/react/textarea.tsx +17 -15
- package/src/react/toggle-group.tsx +66 -23
- package/src/react/toggle.tsx +26 -18
- package/src/react/tooltip.tsx +43 -28
- package/tailwind.config.ts +62 -62
- package/dist/chunk-466PAJCA.mjs.map +0 -1
- package/dist/chunk-4TJBMO2Y.mjs.map +0 -1
- package/dist/chunk-5WJB3UAO.js.map +0 -1
- package/dist/chunk-6B2PU2GG.mjs.map +0 -1
- package/dist/chunk-7PJR4WFR.mjs.map +0 -1
- package/dist/chunk-AEWLL6A2.js.map +0 -1
- package/dist/chunk-EVN2IB57.js.map +0 -1
- package/dist/chunk-EYERINEJ.js.map +0 -1
- package/dist/chunk-FEE6PNWV.js.map +0 -1
- package/dist/chunk-GRQGCS7U.mjs.map +0 -1
- package/dist/chunk-HLXU3SQI.mjs.map +0 -1
- package/dist/chunk-JIHHUXA5.js.map +0 -1
- package/dist/chunk-JTAXNFUM.mjs.map +0 -1
- package/dist/chunk-KJ77RPJ4.mjs.map +0 -1
- package/dist/chunk-MSHUAEXI.js.map +0 -1
- package/dist/chunk-N6QGG4WS.mjs.map +0 -1
- package/dist/chunk-PLX35IKX.mjs.map +0 -1
- package/dist/chunk-UDNWQQ3I.js.map +0 -1
- package/dist/chunk-UPZHCTQV.js.map +0 -1
- package/dist/chunk-WLMYX3C7.mjs.map +0 -1
- package/dist/chunk-YR36SVVG.mjs.map +0 -1
- package/dist/chunk-ZWGC5M4G.js.map +0 -1
- package/dist/plugin/animate.plugin.d.mts +0 -9
- package/dist/plugin/animate.plugin.d.ts +0 -9
- package/dist/plugin/base.plugin.d.mts +0 -8
- package/dist/plugin/base.plugin.d.ts +0 -8
- package/dist/plugin/perspective.plugin.d.mts +0 -8
- package/dist/plugin/perspective.plugin.d.ts +0 -8
- package/dist/tailwind.config.d.mts +0 -5
- package/dist/tailwind.config.d.ts +0 -5
package/src/react/dialog.tsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
2
|
|
|
3
|
-
import * as React from
|
|
4
|
-
import * as DialogPrimitive from
|
|
5
|
-
import { Cross2Icon } from
|
|
6
|
-
import { cn } from
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
5
|
+
import { Cross2Icon } from '@radix-ui/react-icons';
|
|
6
|
+
import { cn } from '../lib/utils';
|
|
7
7
|
|
|
8
8
|
/* -----------------------------------------------------------------------------
|
|
9
9
|
* Component: Dialog
|
|
@@ -16,14 +16,18 @@ const Dialog = DialogPrimitive.Root;
|
|
|
16
16
|
* Component: DialogTrigger
|
|
17
17
|
* -------------------------------------------------------------------------- */
|
|
18
18
|
|
|
19
|
-
type DialogTriggerProps = React.ComponentPropsWithoutRef<
|
|
19
|
+
type DialogTriggerProps = React.ComponentPropsWithoutRef<
|
|
20
|
+
typeof DialogPrimitive.Trigger
|
|
21
|
+
>;
|
|
20
22
|
const DialogTrigger = DialogPrimitive.Trigger;
|
|
21
23
|
|
|
22
24
|
/* -----------------------------------------------------------------------------
|
|
23
25
|
* Component: DialogClose
|
|
24
26
|
* -------------------------------------------------------------------------- */
|
|
25
27
|
|
|
26
|
-
type DialogCloseProps = React.ComponentPropsWithoutRef<
|
|
28
|
+
type DialogCloseProps = React.ComponentPropsWithoutRef<
|
|
29
|
+
typeof DialogPrimitive.Close
|
|
30
|
+
>;
|
|
27
31
|
const DialogClose = DialogPrimitive.Close;
|
|
28
32
|
|
|
29
33
|
/* -----------------------------------------------------------------------------
|
|
@@ -31,29 +35,32 @@ const DialogClose = DialogPrimitive.Close;
|
|
|
31
35
|
* -------------------------------------------------------------------------- */
|
|
32
36
|
|
|
33
37
|
type DialogContentElement = React.ElementRef<typeof DialogPrimitive.Content>;
|
|
34
|
-
type DialogContentProps = React.ComponentPropsWithoutRef<
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
38
|
+
type DialogContentProps = React.ComponentPropsWithoutRef<
|
|
39
|
+
typeof DialogPrimitive.Content
|
|
40
|
+
>;
|
|
41
|
+
|
|
42
|
+
const DialogContent = React.forwardRef<
|
|
43
|
+
DialogContentElement,
|
|
44
|
+
DialogContentProps
|
|
45
|
+
>(({ children, className, ...props }, ref) => (
|
|
46
|
+
<DialogPrimitive.Portal>
|
|
47
|
+
<DialogPrimitive.Overlay className="data-[state=open]:animate-duration-200 data-[state=open]:animate-fade-in data-[state=closed]:animate-fade-out fixed inset-0 z-50 bg-black/80" />
|
|
48
|
+
<DialogPrimitive.Content
|
|
49
|
+
ref={ref}
|
|
50
|
+
className={cn(
|
|
51
|
+
'bg-background data-[state=open]:animate-in data-[state=open]:animate-duration-200 data-[state=open]:fade-in data-[state=open]:zoom-in-95 data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg',
|
|
52
|
+
className,
|
|
53
|
+
)}
|
|
54
|
+
{...props}
|
|
55
|
+
>
|
|
56
|
+
{children}
|
|
57
|
+
<DialogPrimitive.Close className="data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute right-4 top-4 rounded-sm opacity-70 transition hover:opacity-100 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:pointer-events-none">
|
|
58
|
+
<Cross2Icon className="size-4" />
|
|
59
|
+
<span className="sr-only">Close</span>
|
|
60
|
+
</DialogPrimitive.Close>
|
|
61
|
+
</DialogPrimitive.Content>
|
|
62
|
+
</DialogPrimitive.Portal>
|
|
63
|
+
));
|
|
57
64
|
|
|
58
65
|
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
59
66
|
|
|
@@ -63,8 +70,19 @@ DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
|
63
70
|
|
|
64
71
|
type DialogHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
65
72
|
|
|
66
|
-
function DialogHeader({
|
|
67
|
-
|
|
73
|
+
function DialogHeader({
|
|
74
|
+
className,
|
|
75
|
+
...props
|
|
76
|
+
}: DialogHeaderProps): React.JSX.Element {
|
|
77
|
+
return (
|
|
78
|
+
<div
|
|
79
|
+
className={cn(
|
|
80
|
+
'flex flex-col space-y-1.5 text-center sm:text-left',
|
|
81
|
+
className,
|
|
82
|
+
)}
|
|
83
|
+
{...props}
|
|
84
|
+
/>
|
|
85
|
+
);
|
|
68
86
|
}
|
|
69
87
|
|
|
70
88
|
/* -----------------------------------------------------------------------------
|
|
@@ -73,8 +91,19 @@ function DialogHeader({ className, ...props }: DialogHeaderProps): React.JSX.Ele
|
|
|
73
91
|
|
|
74
92
|
type DialogFooterProps = React.HTMLAttributes<HTMLDivElement>;
|
|
75
93
|
|
|
76
|
-
function DialogFooter({
|
|
77
|
-
|
|
94
|
+
function DialogFooter({
|
|
95
|
+
className,
|
|
96
|
+
...props
|
|
97
|
+
}: DialogFooterProps): React.JSX.Element {
|
|
98
|
+
return (
|
|
99
|
+
<div
|
|
100
|
+
className={cn(
|
|
101
|
+
'flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2',
|
|
102
|
+
className,
|
|
103
|
+
)}
|
|
104
|
+
{...props}
|
|
105
|
+
/>
|
|
106
|
+
);
|
|
78
107
|
}
|
|
79
108
|
|
|
80
109
|
/* -----------------------------------------------------------------------------
|
|
@@ -82,15 +111,22 @@ function DialogFooter({ className, ...props }: DialogFooterProps): React.JSX.Ele
|
|
|
82
111
|
* -------------------------------------------------------------------------- */
|
|
83
112
|
|
|
84
113
|
type DialogTitleElement = React.ElementRef<typeof DialogPrimitive.Title>;
|
|
85
|
-
type DialogTitleProps = React.ComponentPropsWithoutRef<
|
|
114
|
+
type DialogTitleProps = React.ComponentPropsWithoutRef<
|
|
115
|
+
typeof DialogPrimitive.Title
|
|
116
|
+
>;
|
|
86
117
|
|
|
87
|
-
const DialogTitle = React.forwardRef<DialogTitleElement, DialogTitleProps>(
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
118
|
+
const DialogTitle = React.forwardRef<DialogTitleElement, DialogTitleProps>(
|
|
119
|
+
({ className, ...props }, ref) => (
|
|
120
|
+
<DialogPrimitive.Title
|
|
121
|
+
ref={ref}
|
|
122
|
+
className={cn(
|
|
123
|
+
'text-lg font-semibold leading-none tracking-tight',
|
|
124
|
+
className,
|
|
125
|
+
)}
|
|
126
|
+
{...props}
|
|
127
|
+
/>
|
|
128
|
+
),
|
|
129
|
+
);
|
|
94
130
|
|
|
95
131
|
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
96
132
|
|
|
@@ -98,14 +134,23 @@ DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
|
98
134
|
* Component: DialogDescription
|
|
99
135
|
* -------------------------------------------------------------------------- */
|
|
100
136
|
|
|
101
|
-
type DialogDescriptionElement = React.ElementRef<
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
137
|
+
type DialogDescriptionElement = React.ElementRef<
|
|
138
|
+
typeof DialogPrimitive.Description
|
|
139
|
+
>;
|
|
140
|
+
type DialogDescriptionProps = React.ComponentPropsWithoutRef<
|
|
141
|
+
typeof DialogPrimitive.Description
|
|
142
|
+
>;
|
|
143
|
+
|
|
144
|
+
const DialogDescription = React.forwardRef<
|
|
145
|
+
DialogDescriptionElement,
|
|
146
|
+
DialogDescriptionProps
|
|
147
|
+
>(({ className, ...props }, ref) => (
|
|
148
|
+
<DialogPrimitive.Description
|
|
149
|
+
ref={ref}
|
|
150
|
+
className={cn('text-muted-foreground text-sm', className)}
|
|
151
|
+
{...props}
|
|
152
|
+
/>
|
|
153
|
+
));
|
|
109
154
|
|
|
110
155
|
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
111
156
|
|
package/src/react/drawer.tsx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
2
|
|
|
3
|
-
import * as React from
|
|
4
|
-
import { Drawer as DrawerPrimitive } from
|
|
5
|
-
import { cn } from
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { Drawer as DrawerPrimitive } from 'vaul';
|
|
5
|
+
import { cn } from '../lib/utils';
|
|
6
6
|
|
|
7
7
|
/* -----------------------------------------------------------------------------
|
|
8
8
|
* Component: Drawer
|
|
@@ -10,22 +10,34 @@ import { cn } from "../lib/utils";
|
|
|
10
10
|
|
|
11
11
|
type DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root>;
|
|
12
12
|
|
|
13
|
-
function Drawer({
|
|
14
|
-
|
|
13
|
+
function Drawer({
|
|
14
|
+
shouldScaleBackground = true,
|
|
15
|
+
...props
|
|
16
|
+
}: DrawerProps): React.JSX.Element {
|
|
17
|
+
return (
|
|
18
|
+
<DrawerPrimitive.Root
|
|
19
|
+
shouldScaleBackground={shouldScaleBackground}
|
|
20
|
+
{...props}
|
|
21
|
+
/>
|
|
22
|
+
);
|
|
15
23
|
}
|
|
16
24
|
|
|
17
25
|
/* -----------------------------------------------------------------------------
|
|
18
26
|
* Component: DrawerTrigger
|
|
19
27
|
* -------------------------------------------------------------------------- */
|
|
20
28
|
|
|
21
|
-
type DrawerTriggerProps = React.ComponentPropsWithoutRef<
|
|
29
|
+
type DrawerTriggerProps = React.ComponentPropsWithoutRef<
|
|
30
|
+
typeof DrawerPrimitive.Trigger
|
|
31
|
+
>;
|
|
22
32
|
const DrawerTrigger = DrawerPrimitive.Trigger;
|
|
23
33
|
|
|
24
34
|
/* -----------------------------------------------------------------------------
|
|
25
35
|
* Component: DrawerClose
|
|
26
36
|
* -------------------------------------------------------------------------- */
|
|
27
37
|
|
|
28
|
-
type DrawerCloseProps = React.ComponentPropsWithoutRef<
|
|
38
|
+
type DrawerCloseProps = React.ComponentPropsWithoutRef<
|
|
39
|
+
typeof DrawerPrimitive.Close
|
|
40
|
+
>;
|
|
29
41
|
const DrawerClose = DrawerPrimitive.Close;
|
|
30
42
|
|
|
31
43
|
/* -----------------------------------------------------------------------------
|
|
@@ -33,28 +45,31 @@ const DrawerClose = DrawerPrimitive.Close;
|
|
|
33
45
|
* -------------------------------------------------------------------------- */
|
|
34
46
|
|
|
35
47
|
type DrawerContentElement = React.ElementRef<typeof DrawerPrimitive.Content>;
|
|
36
|
-
type DrawerContentProps = React.ComponentPropsWithoutRef<
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
48
|
+
type DrawerContentProps = React.ComponentPropsWithoutRef<
|
|
49
|
+
typeof DrawerPrimitive.Content
|
|
50
|
+
>;
|
|
51
|
+
|
|
52
|
+
const DrawerContent = React.forwardRef<
|
|
53
|
+
DrawerContentElement,
|
|
54
|
+
DrawerContentProps
|
|
55
|
+
>(({ children, className, ...props }, ref) => (
|
|
56
|
+
<DrawerPrimitive.Portal>
|
|
57
|
+
<DrawerPrimitive.Overlay className="fixed inset-0 z-50 bg-black/80" />
|
|
58
|
+
<DrawerPrimitive.Content
|
|
59
|
+
ref={ref}
|
|
60
|
+
className={cn(
|
|
61
|
+
'bg-background fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-xl border',
|
|
62
|
+
className,
|
|
63
|
+
)}
|
|
64
|
+
{...props}
|
|
65
|
+
>
|
|
66
|
+
<div className="bg-muted mx-auto mt-4 h-2 w-24 rounded-full" />
|
|
67
|
+
{children}
|
|
68
|
+
</DrawerPrimitive.Content>
|
|
69
|
+
</DrawerPrimitive.Portal>
|
|
70
|
+
));
|
|
56
71
|
|
|
57
|
-
DrawerContent.displayName =
|
|
72
|
+
DrawerContent.displayName = 'DrawerContent';
|
|
58
73
|
|
|
59
74
|
/* -----------------------------------------------------------------------------
|
|
60
75
|
* Component: DrawerHeader
|
|
@@ -62,8 +77,16 @@ DrawerContent.displayName = "DrawerContent";
|
|
|
62
77
|
|
|
63
78
|
type DrawerHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
64
79
|
|
|
65
|
-
function DrawerHeader({
|
|
66
|
-
|
|
80
|
+
function DrawerHeader({
|
|
81
|
+
className,
|
|
82
|
+
...props
|
|
83
|
+
}: DrawerHeaderProps): React.JSX.Element {
|
|
84
|
+
return (
|
|
85
|
+
<div
|
|
86
|
+
className={cn('grid gap-1.5 p-4 text-center sm:text-left', className)}
|
|
87
|
+
{...props}
|
|
88
|
+
/>
|
|
89
|
+
);
|
|
67
90
|
}
|
|
68
91
|
|
|
69
92
|
/* -----------------------------------------------------------------------------
|
|
@@ -72,8 +95,16 @@ function DrawerHeader({ className, ...props }: DrawerHeaderProps): React.JSX.Ele
|
|
|
72
95
|
|
|
73
96
|
type DrawerFooterProps = React.HTMLAttributes<HTMLDivElement>;
|
|
74
97
|
|
|
75
|
-
function DrawerFooter({
|
|
76
|
-
|
|
98
|
+
function DrawerFooter({
|
|
99
|
+
className,
|
|
100
|
+
...props
|
|
101
|
+
}: DrawerFooterProps): React.JSX.Element {
|
|
102
|
+
return (
|
|
103
|
+
<div
|
|
104
|
+
className={cn('mt-auto flex flex-col gap-2 p-4', className)}
|
|
105
|
+
{...props}
|
|
106
|
+
/>
|
|
107
|
+
);
|
|
77
108
|
}
|
|
78
109
|
|
|
79
110
|
/* -----------------------------------------------------------------------------
|
|
@@ -81,15 +112,22 @@ function DrawerFooter({ className, ...props }: DrawerFooterProps): React.JSX.Ele
|
|
|
81
112
|
* -------------------------------------------------------------------------- */
|
|
82
113
|
|
|
83
114
|
type DrawerTitleElement = React.ElementRef<typeof DrawerPrimitive.Title>;
|
|
84
|
-
type DrawerTitleProps = React.ComponentPropsWithoutRef<
|
|
115
|
+
type DrawerTitleProps = React.ComponentPropsWithoutRef<
|
|
116
|
+
typeof DrawerPrimitive.Title
|
|
117
|
+
>;
|
|
85
118
|
|
|
86
|
-
const DrawerTitle = React.forwardRef<DrawerTitleElement, DrawerTitleProps>(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
119
|
+
const DrawerTitle = React.forwardRef<DrawerTitleElement, DrawerTitleProps>(
|
|
120
|
+
({ className, ...props }, ref) => (
|
|
121
|
+
<DrawerPrimitive.Title
|
|
122
|
+
ref={ref}
|
|
123
|
+
className={cn(
|
|
124
|
+
'text-lg font-semibold leading-none tracking-tight',
|
|
125
|
+
className,
|
|
126
|
+
)}
|
|
127
|
+
{...props}
|
|
128
|
+
/>
|
|
129
|
+
),
|
|
130
|
+
);
|
|
93
131
|
|
|
94
132
|
DrawerTitle.displayName = DrawerPrimitive.Title.displayName;
|
|
95
133
|
|
|
@@ -97,14 +135,23 @@ DrawerTitle.displayName = DrawerPrimitive.Title.displayName;
|
|
|
97
135
|
* Component: DrawerDescription
|
|
98
136
|
* -------------------------------------------------------------------------- */
|
|
99
137
|
|
|
100
|
-
type DrawerDescriptionElement = React.ElementRef<
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
138
|
+
type DrawerDescriptionElement = React.ElementRef<
|
|
139
|
+
typeof DrawerPrimitive.Description
|
|
140
|
+
>;
|
|
141
|
+
type DrawerDescriptionProps = React.ComponentPropsWithoutRef<
|
|
142
|
+
typeof DrawerPrimitive.Description
|
|
143
|
+
>;
|
|
144
|
+
|
|
145
|
+
const DrawerDescription = React.forwardRef<
|
|
146
|
+
DrawerDescriptionElement,
|
|
147
|
+
DrawerDescriptionProps
|
|
148
|
+
>(({ className, ...props }, ref) => (
|
|
149
|
+
<DrawerPrimitive.Description
|
|
150
|
+
ref={ref}
|
|
151
|
+
className={cn('text-muted-foreground text-sm', className)}
|
|
152
|
+
{...props}
|
|
153
|
+
/>
|
|
154
|
+
));
|
|
108
155
|
|
|
109
156
|
DrawerDescription.displayName = DrawerPrimitive.Description.displayName;
|
|
110
157
|
|