@codefast/ui 0.0.50 → 0.0.52
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-ZTEJNUH6.js → chunk-46W6RAYD.js} +1 -1
- package/dist/chunk-46W6RAYD.js.map +1 -0
- package/dist/{chunk-CERSQE5J.js → chunk-4JHGPRLG.js} +1 -1
- package/dist/chunk-4JHGPRLG.js.map +1 -0
- package/dist/{chunk-I6QCJDIF.mjs → chunk-5RENVAXH.mjs} +1 -1
- package/dist/chunk-5RENVAXH.mjs.map +1 -0
- package/dist/{chunk-47CSACCM.mjs → chunk-7ABWX5CF.mjs} +2 -2
- package/dist/chunk-7ABWX5CF.mjs.map +1 -0
- package/dist/{chunk-XHNT6PVI.mjs → chunk-BM5KYF6Y.mjs} +1 -1
- package/dist/chunk-BM5KYF6Y.mjs.map +1 -0
- package/dist/{chunk-P5AV3QU7.mjs → chunk-BNKSZEF2.mjs} +1 -1
- package/dist/chunk-BNKSZEF2.mjs.map +1 -0
- package/dist/{chunk-SDGUDONZ.js → chunk-DCDB56BO.js} +1 -1
- package/dist/chunk-DCDB56BO.js.map +1 -0
- package/dist/{chunk-6FL3EBDQ.mjs → chunk-HMD2ZU33.mjs} +1 -1
- package/dist/chunk-HMD2ZU33.mjs.map +1 -0
- package/dist/{chunk-JOBEKA4M.mjs → chunk-K63K4LTH.mjs} +2 -2
- package/dist/chunk-K63K4LTH.mjs.map +1 -0
- package/dist/{chunk-VXPAGNPJ.js → chunk-LJSD47ZL.js} +1 -1
- package/dist/chunk-LJSD47ZL.js.map +1 -0
- package/dist/{chunk-GDMHMSJ2.mjs → chunk-MFYACCZV.mjs} +1 -1
- package/dist/chunk-MFYACCZV.mjs.map +1 -0
- package/dist/{chunk-LG7ACTRE.js → chunk-PRCS3RWN.js} +1 -1
- package/dist/chunk-PRCS3RWN.js.map +1 -0
- package/dist/{chunk-OP6Q7VT5.js → chunk-RHFF4JNH.js} +1 -1
- package/dist/chunk-RHFF4JNH.js.map +1 -0
- package/dist/{chunk-SCPFGC2X.js → chunk-SCXRD727.js} +1 -1
- package/dist/chunk-SCXRD727.js.map +1 -0
- package/dist/{chunk-X3LRJQM3.js → chunk-VZVI3OHH.js} +2 -2
- package/dist/chunk-VZVI3OHH.js.map +1 -0
- package/dist/{chunk-UYRRHPPH.js → chunk-X4BEEJEW.js} +2 -2
- package/dist/chunk-X4BEEJEW.js.map +1 -0
- package/dist/{chunk-PWF46YXQ.mjs → chunk-Y2GMHG3Z.mjs} +1 -1
- package/dist/chunk-Y2GMHG3Z.mjs.map +1 -0
- package/dist/{chunk-MU2MZ434.mjs → chunk-ZIB4ZTST.mjs} +1 -1
- package/dist/chunk-ZIB4ZTST.mjs.map +1 -0
- package/dist/plugin/animate.plugin.js +1 -1
- package/dist/plugin/animate.plugin.mjs +1 -1
- package/dist/react/accordion.js.map +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.map +1 -1
- package/dist/react/alert.mjs.map +1 -1
- package/dist/react/aspect-ratio.d.mts +1 -1
- package/dist/react/aspect-ratio.d.ts +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.map +1 -1
- package/dist/react/avatar.mjs.map +1 -1
- package/dist/react/badge.js.map +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.js.map +1 -1
- package/dist/react/box.mjs.map +1 -1
- package/dist/react/breadcrumb.js.map +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.map +1 -1
- package/dist/react/card.mjs.map +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.js +1 -1
- package/dist/react/checkbox-group.primitive.mjs +1 -1
- package/dist/react/checkbox.js.map +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.map +1 -1
- package/dist/react/collapsible.mjs.map +1 -1
- package/dist/react/command.d.mts +8 -8
- package/dist/react/command.d.ts +8 -8
- 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.map +1 -1
- package/dist/react/container.mjs.map +1 -1
- package/dist/react/context-menu.js.map +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.map +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.js.map +1 -1
- package/dist/react/heading.mjs.map +1 -1
- package/dist/react/hover-card.js.map +1 -1
- package/dist/react/hover-card.mjs.map +1 -1
- package/dist/react/input-otp.js.map +1 -1
- package/dist/react/input-otp.mjs.map +1 -1
- package/dist/react/input.js.map +1 -1
- package/dist/react/input.mjs.map +1 -1
- package/dist/react/kbd.js.map +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.map +1 -1
- package/dist/react/menubar.mjs.map +1 -1
- package/dist/react/navigation-menu.js.map +1 -1
- package/dist/react/navigation-menu.mjs.map +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.map +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.map +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.map +1 -1
- package/dist/react/radio-cards.mjs.map +1 -1
- package/dist/react/radio-group.js.map +1 -1
- package/dist/react/radio-group.mjs.map +1 -1
- package/dist/react/radio.js.map +1 -1
- package/dist/react/radio.mjs.map +1 -1
- package/dist/react/resizable.js.map +1 -1
- package/dist/react/resizable.mjs.map +1 -1
- package/dist/react/scroll-area.js.map +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.map +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.map +1 -1
- package/dist/react/skeleton.mjs.map +1 -1
- package/dist/react/slider.js.map +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.map +1 -1
- package/dist/react/switch.mjs.map +1 -1
- package/dist/react/table.js.map +1 -1
- package/dist/react/table.mjs.map +1 -1
- package/dist/react/tabs.js.map +1 -1
- package/dist/react/tabs.mjs.map +1 -1
- package/dist/react/text.js.map +1 -1
- package/dist/react/text.mjs.map +1 -1
- package/dist/react/textarea.js.map +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.map +1 -1
- package/dist/react/tooltip.mjs.map +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 +6 -6
- package/plugin/animate.plugin.ts +2 -5
- package/src/react/accordion.tsx +36 -60
- package/src/react/alert-dialog.tsx +57 -125
- package/src/react/alert.tsx +16 -42
- package/src/react/aspect-ratio.tsx +2 -4
- package/src/react/avatar.tsx +15 -43
- package/src/react/badge.tsx +3 -8
- package/src/react/blockquote.tsx +5 -8
- package/src/react/box.tsx +4 -6
- package/src/react/breadcrumb.tsx +17 -50
- package/src/react/button.tsx +5 -20
- package/src/react/calendar.tsx +5 -22
- package/src/react/card.tsx +22 -56
- package/src/react/carousel.tsx +20 -76
- package/src/react/checkbox-cards.tsx +28 -55
- package/src/react/checkbox-group.primitive.tsx +24 -78
- package/src/react/checkbox-group.tsx +26 -49
- package/src/react/checkbox.tsx +15 -19
- package/src/react/code.tsx +4 -6
- package/src/react/collapsible.tsx +19 -29
- package/src/react/command.tsx +69 -134
- package/src/react/container.tsx +5 -9
- package/src/react/context-menu.tsx +146 -224
- package/src/react/data-table.tsx +16 -44
- package/src/react/dialog.tsx +45 -90
- package/src/react/drawer.tsx +44 -91
- package/src/react/dropdown-menu.tsx +126 -194
- package/src/react/em.tsx +4 -6
- package/src/react/form.tsx +49 -84
- package/src/react/heading.tsx +4 -6
- package/src/react/hover-card.tsx +22 -38
- package/src/react/input-otp.tsx +26 -37
- package/src/react/input.tsx +6 -16
- package/src/react/kbd.tsx +14 -16
- package/src/react/label.tsx +11 -12
- package/src/react/menubar.tsx +129 -208
- package/src/react/navigation-menu.tsx +105 -147
- package/src/react/pagination.tsx +18 -50
- package/src/react/popover.tsx +25 -40
- package/src/react/pre.tsx +4 -6
- package/src/react/progress.tsx +15 -22
- package/src/react/quote.tsx +4 -6
- package/src/react/radio-cards.tsx +7 -27
- package/src/react/radio-group.tsx +7 -27
- package/src/react/radio.tsx +14 -18
- package/src/react/resizable.tsx +2 -7
- package/src/react/scroll-area.tsx +30 -52
- package/src/react/section.tsx +4 -6
- package/src/react/select.tsx +108 -161
- package/src/react/separator.tsx +3 -12
- package/src/react/sheet.tsx +21 -71
- package/src/react/skeleton.tsx +1 -6
- package/src/react/slider.tsx +20 -27
- package/src/react/sonner.tsx +2 -4
- package/src/react/spinner.tsx +2 -7
- package/src/react/strong.tsx +4 -6
- package/src/react/switch.tsx +12 -14
- package/src/react/table.tsx +37 -82
- package/src/react/tabs.tsx +34 -44
- package/src/react/text.tsx +5 -8
- package/src/react/textarea.tsx +12 -14
- package/src/react/toggle-group.tsx +16 -57
- package/src/react/toggle.tsx +8 -15
- package/src/react/tooltip.tsx +24 -39
- package/tailwind.config.ts +2 -2
- package/dist/chunk-47CSACCM.mjs.map +0 -1
- package/dist/chunk-6FL3EBDQ.mjs.map +0 -1
- package/dist/chunk-CERSQE5J.js.map +0 -1
- package/dist/chunk-GDMHMSJ2.mjs.map +0 -1
- package/dist/chunk-I6QCJDIF.mjs.map +0 -1
- package/dist/chunk-JOBEKA4M.mjs.map +0 -1
- package/dist/chunk-LG7ACTRE.js.map +0 -1
- package/dist/chunk-MU2MZ434.mjs.map +0 -1
- package/dist/chunk-OP6Q7VT5.js.map +0 -1
- package/dist/chunk-P5AV3QU7.mjs.map +0 -1
- package/dist/chunk-PWF46YXQ.mjs.map +0 -1
- package/dist/chunk-SCPFGC2X.js.map +0 -1
- package/dist/chunk-SDGUDONZ.js.map +0 -1
- package/dist/chunk-UYRRHPPH.js.map +0 -1
- package/dist/chunk-VXPAGNPJ.js.map +0 -1
- package/dist/chunk-X3LRJQM3.js.map +0 -1
- package/dist/chunk-XHNT6PVI.mjs.map +0 -1
- package/dist/chunk-ZTEJNUH6.js.map +0 -1
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
|
|
5
5
|
import { createToggleGroupScope } from '@radix-ui/react-toggle-group';
|
|
6
|
-
import { createContextScope
|
|
6
|
+
import { createContextScope } from '@radix-ui/react-context';
|
|
7
7
|
import { cn } from '../lib/utils';
|
|
8
|
-
import { toggleVariants
|
|
8
|
+
import { toggleVariants } from './toggle';
|
|
9
|
+
import type { ToggleVariantsProps } from './toggle';
|
|
10
|
+
import type { Scope } from '@radix-ui/react-context';
|
|
9
11
|
|
|
10
12
|
/* -----------------------------------------------------------------------------
|
|
11
13
|
* Component: ToggleGroup
|
|
@@ -15,41 +17,21 @@ const TOGGLE_GROUP_NAME = 'ToggleGroup';
|
|
|
15
17
|
|
|
16
18
|
type ScopedProps<P> = P & { __scopeToggleGroup?: Scope };
|
|
17
19
|
|
|
18
|
-
const [createToggleGroupContext] = createContextScope(TOGGLE_GROUP_NAME, [
|
|
19
|
-
createToggleGroupScope,
|
|
20
|
-
]);
|
|
20
|
+
const [createToggleGroupContext] = createContextScope(TOGGLE_GROUP_NAME, [createToggleGroupScope]);
|
|
21
21
|
|
|
22
22
|
const useToggleGroupScope = createToggleGroupScope();
|
|
23
23
|
|
|
24
|
-
const [ToggleGroupProvider, useToggleGroupContext] =
|
|
25
|
-
createToggleGroupContext<ToggleVariantsProps>(TOGGLE_GROUP_NAME);
|
|
24
|
+
const [ToggleGroupProvider, useToggleGroupContext] = createToggleGroupContext<ToggleVariantsProps>(TOGGLE_GROUP_NAME);
|
|
26
25
|
|
|
27
26
|
type ToggleGroupElement = React.ElementRef<typeof ToggleGroupPrimitive.Root>;
|
|
28
|
-
type ToggleGroupProps = React.ComponentPropsWithoutRef<
|
|
29
|
-
typeof ToggleGroupPrimitive.Root
|
|
30
|
-
> &
|
|
31
|
-
ToggleVariantsProps;
|
|
27
|
+
type ToggleGroupProps = React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root> & ToggleVariantsProps;
|
|
32
28
|
|
|
33
29
|
const ToggleGroup = React.forwardRef<ToggleGroupElement, ToggleGroupProps>(
|
|
34
|
-
(
|
|
35
|
-
{
|
|
36
|
-
__scopeToggleGroup,
|
|
37
|
-
children,
|
|
38
|
-
className,
|
|
39
|
-
variant,
|
|
40
|
-
size,
|
|
41
|
-
...props
|
|
42
|
-
}: ScopedProps<ToggleGroupProps>,
|
|
43
|
-
ref,
|
|
44
|
-
) => {
|
|
30
|
+
({ __scopeToggleGroup, children, className, variant, size, ...props }: ScopedProps<ToggleGroupProps>, ref) => {
|
|
45
31
|
const toggleGroupScope = useToggleGroupScope(__scopeToggleGroup);
|
|
46
32
|
|
|
47
33
|
return (
|
|
48
|
-
<ToggleGroupProvider
|
|
49
|
-
scope={__scopeToggleGroup}
|
|
50
|
-
size={size}
|
|
51
|
-
variant={variant}
|
|
52
|
-
>
|
|
34
|
+
<ToggleGroupProvider scope={__scopeToggleGroup} size={size} variant={variant}>
|
|
53
35
|
<ToggleGroupPrimitive.Root
|
|
54
36
|
ref={ref}
|
|
55
37
|
className={cn('flex items-center justify-center gap-1', className)}
|
|
@@ -71,30 +53,12 @@ ToggleGroup.displayName = TOGGLE_GROUP_NAME;
|
|
|
71
53
|
|
|
72
54
|
const TOGGLE_GROUP_ITEM_NAME = 'ToggleGroupItem';
|
|
73
55
|
|
|
74
|
-
type ToggleGroupItemElement = React.ElementRef<
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
const ToggleGroupItem = React.forwardRef<
|
|
82
|
-
ToggleGroupItemElement,
|
|
83
|
-
ToggleGroupItemProps
|
|
84
|
-
>(
|
|
85
|
-
(
|
|
86
|
-
{
|
|
87
|
-
__scopeToggleGroup,
|
|
88
|
-
children,
|
|
89
|
-
className,
|
|
90
|
-
...props
|
|
91
|
-
}: ScopedProps<ToggleGroupItemProps>,
|
|
92
|
-
ref,
|
|
93
|
-
) => {
|
|
94
|
-
const context = useToggleGroupContext(
|
|
95
|
-
TOGGLE_GROUP_ITEM_NAME,
|
|
96
|
-
__scopeToggleGroup,
|
|
97
|
-
);
|
|
56
|
+
type ToggleGroupItemElement = React.ElementRef<typeof ToggleGroupPrimitive.Item>;
|
|
57
|
+
type ToggleGroupItemProps = React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item>;
|
|
58
|
+
|
|
59
|
+
const ToggleGroupItem = React.forwardRef<ToggleGroupItemElement, ToggleGroupItemProps>(
|
|
60
|
+
({ __scopeToggleGroup, children, className, ...props }: ScopedProps<ToggleGroupItemProps>, ref) => {
|
|
61
|
+
const context = useToggleGroupContext(TOGGLE_GROUP_ITEM_NAME, __scopeToggleGroup);
|
|
98
62
|
const toggleGroupScope = useToggleGroupScope(__scopeToggleGroup);
|
|
99
63
|
|
|
100
64
|
return (
|
|
@@ -116,9 +80,4 @@ ToggleGroupItem.displayName = TOGGLE_GROUP_ITEM_NAME;
|
|
|
116
80
|
* Exports
|
|
117
81
|
* -------------------------------------------------------------------------- */
|
|
118
82
|
|
|
119
|
-
export {
|
|
120
|
-
ToggleGroup,
|
|
121
|
-
ToggleGroupItem,
|
|
122
|
-
type ToggleGroupProps,
|
|
123
|
-
type ToggleGroupItemProps,
|
|
124
|
-
};
|
|
83
|
+
export { ToggleGroup, ToggleGroupItem, type ToggleGroupProps, type ToggleGroupItemProps };
|
package/src/react/toggle.tsx
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import * as TogglePrimitive from '@radix-ui/react-toggle';
|
|
5
|
-
import { type VariantProps } from 'cva';
|
|
6
5
|
import { cva } from '../lib/utils';
|
|
6
|
+
import type { VariantProps } from 'cva';
|
|
7
7
|
|
|
8
8
|
/* -----------------------------------------------------------------------------
|
|
9
9
|
* Variant: Toggle
|
|
@@ -14,8 +14,7 @@ const toggleVariants = cva({
|
|
|
14
14
|
variants: {
|
|
15
15
|
variant: {
|
|
16
16
|
default: 'bg-transparent',
|
|
17
|
-
outline:
|
|
18
|
-
'border-input hover:bg-accent hover:text-accent-foreground border bg-transparent shadow-sm',
|
|
17
|
+
outline: 'border-input hover:bg-accent hover:text-accent-foreground border bg-transparent shadow-sm',
|
|
19
18
|
},
|
|
20
19
|
size: {
|
|
21
20
|
default: 'h-10 px-3',
|
|
@@ -36,22 +35,16 @@ type ToggleVariantsProps = VariantProps<typeof toggleVariants>;
|
|
|
36
35
|
* -------------------------------------------------------------------------- */
|
|
37
36
|
|
|
38
37
|
type ToggleElement = React.ElementRef<typeof TogglePrimitive.Root>;
|
|
39
|
-
type ToggleProps = React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> &
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
<TogglePrimitive.Root
|
|
45
|
-
ref={ref}
|
|
46
|
-
className={toggleVariants({ variant, size, className })}
|
|
47
|
-
{...props}
|
|
48
|
-
/>
|
|
49
|
-
),
|
|
50
|
-
);
|
|
38
|
+
type ToggleProps = React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> & ToggleVariantsProps;
|
|
39
|
+
|
|
40
|
+
const Toggle = React.forwardRef<ToggleElement, ToggleProps>(({ className, variant, size, ...props }, ref) => (
|
|
41
|
+
<TogglePrimitive.Root ref={ref} className={toggleVariants({ variant, size, className })} {...props} />
|
|
42
|
+
));
|
|
51
43
|
|
|
52
44
|
Toggle.displayName = TogglePrimitive.Root.displayName;
|
|
53
45
|
|
|
54
46
|
/* -----------------------------------------------------------------------------
|
|
55
47
|
* Exports
|
|
56
48
|
* -------------------------------------------------------------------------- */
|
|
49
|
+
|
|
57
50
|
export { Toggle, toggleVariants, type ToggleProps, type ToggleVariantsProps };
|
package/src/react/tooltip.tsx
CHANGED
|
@@ -8,9 +8,7 @@ import { cn } from '../lib/utils';
|
|
|
8
8
|
* Component: TooltipProvider
|
|
9
9
|
* -------------------------------------------------------------------------- */
|
|
10
10
|
|
|
11
|
-
type TooltipProviderProps = React.ComponentProps<
|
|
12
|
-
typeof TooltipPrimitive.Provider
|
|
13
|
-
>;
|
|
11
|
+
type TooltipProviderProps = React.ComponentProps<typeof TooltipPrimitive.Provider>;
|
|
14
12
|
const TooltipProvider = TooltipPrimitive.Provider;
|
|
15
13
|
|
|
16
14
|
/* -----------------------------------------------------------------------------
|
|
@@ -24,9 +22,7 @@ const Tooltip = TooltipPrimitive.Root;
|
|
|
24
22
|
* Component: TooltipTrigger
|
|
25
23
|
* -------------------------------------------------------------------------- */
|
|
26
24
|
|
|
27
|
-
type TooltipTriggerProps = React.ComponentPropsWithoutRef<
|
|
28
|
-
typeof TooltipPrimitive.Trigger
|
|
29
|
-
>;
|
|
25
|
+
type TooltipTriggerProps = React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Trigger>;
|
|
30
26
|
const TooltipTrigger = TooltipPrimitive.Trigger;
|
|
31
27
|
|
|
32
28
|
/* -----------------------------------------------------------------------------
|
|
@@ -34,26 +30,23 @@ const TooltipTrigger = TooltipPrimitive.Trigger;
|
|
|
34
30
|
* -------------------------------------------------------------------------- */
|
|
35
31
|
|
|
36
32
|
type TooltipContentElement = React.ElementRef<typeof TooltipPrimitive.Content>;
|
|
37
|
-
type TooltipContentProps = React.ComponentPropsWithoutRef<
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
/>
|
|
55
|
-
</TooltipPrimitive.Portal>
|
|
56
|
-
));
|
|
33
|
+
type TooltipContentProps = React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>;
|
|
34
|
+
|
|
35
|
+
const TooltipContent = React.forwardRef<TooltipContentElement, TooltipContentProps>(
|
|
36
|
+
({ className, sideOffset = 6, ...props }, ref) => (
|
|
37
|
+
<TooltipPrimitive.Portal>
|
|
38
|
+
<TooltipPrimitive.Content
|
|
39
|
+
ref={ref}
|
|
40
|
+
sideOffset={sideOffset}
|
|
41
|
+
className={cn(
|
|
42
|
+
'bg-popover text-popover-foreground data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in data-[state=delayed-open]:zoom-in-95 data-[state=delayed-open]:data-[side=top]:slide-in-from-bottom-2 data-[state=delayed-open]:data-[side=right]:slide-in-from-left-2 data-[state=delayed-open]:data-[side=bottom]:slide-in-from-top-2 data-[state=delayed-open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 rounded-md border px-3 py-1.5 text-xs',
|
|
43
|
+
className,
|
|
44
|
+
)}
|
|
45
|
+
{...props}
|
|
46
|
+
/>
|
|
47
|
+
</TooltipPrimitive.Portal>
|
|
48
|
+
),
|
|
49
|
+
);
|
|
57
50
|
|
|
58
51
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
59
52
|
|
|
@@ -62,19 +55,11 @@ TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
|
62
55
|
* -------------------------------------------------------------------------- */
|
|
63
56
|
|
|
64
57
|
type TooltipArrowElement = React.ElementRef<typeof TooltipPrimitive.Arrow>;
|
|
65
|
-
type TooltipArrowProps = React.ComponentPropsWithoutRef<
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
({ className, ...props }, ref) => (
|
|
71
|
-
<TooltipPrimitive.Arrow
|
|
72
|
-
ref={ref}
|
|
73
|
-
className={cn('fill-primary', className)}
|
|
74
|
-
{...props}
|
|
75
|
-
/>
|
|
76
|
-
),
|
|
77
|
-
);
|
|
58
|
+
type TooltipArrowProps = React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Arrow>;
|
|
59
|
+
|
|
60
|
+
const TooltipArrow = React.forwardRef<TooltipArrowElement, TooltipArrowProps>(({ className, ...props }, ref) => (
|
|
61
|
+
<TooltipPrimitive.Arrow ref={ref} className={cn('fill-primary', className)} {...props} />
|
|
62
|
+
));
|
|
78
63
|
|
|
79
64
|
TooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;
|
|
80
65
|
|
package/tailwind.config.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Config } from 'tailwindcss';
|
|
2
1
|
import { fontFamily } from 'tailwindcss/defaultTheme';
|
|
3
2
|
import animate from './plugin/animate.plugin';
|
|
4
|
-
import perspective from './plugin/perspective.plugin';
|
|
5
3
|
import base from './plugin/base.plugin';
|
|
4
|
+
import perspective from './plugin/perspective.plugin';
|
|
5
|
+
import type { Config } from 'tailwindcss';
|
|
6
6
|
|
|
7
7
|
const tailwindcssConfig: Config = {
|
|
8
8
|
content: ['./src/**/*.{js,ts,jsx,tsx,mdx}'],
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/react/button.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Fragment } from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { type VariantProps } from 'cva';\nimport { VisuallyHidden } from '@radix-ui/react-visually-hidden';\nimport { cva } from '../lib/utils';\nimport { Spinner } from './spinner';\n\n/* -----------------------------------------------------------------------------\n * Variant: Button\n * -------------------------------------------------------------------------- */\n\nconst buttonVariants = cva({\n base: 'inline-flex select-none items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:pointer-events-none disabled:opacity-50',\n variants: {\n variant: {\n default: 'bg-primary text-primary-foreground hover:bg-primary/90 shadow',\n destructive:\n 'bg-destructive text-destructive-foreground hover:bg-destructive/90 shadow-sm',\n ghost: 'text-foreground hover:bg-accent hover:text-accent-foreground',\n link: 'text-primary underline-offset-4 hover:underline',\n outline:\n 'border-input bg-background text-foreground hover:bg-accent hover:text-accent-foreground border shadow-sm',\n secondary:\n 'bg-secondary text-secondary-foreground hover:bg-secondary/80 shadow-sm',\n },\n size: {\n default: 'h-10 px-4 gap-2',\n xs: 'h-8 px-2 gap-1',\n sm: 'h-9 px-3 gap-2',\n lg: 'h-11 px-8 gap-2',\n icon: 'size-10',\n 'icon-xs': 'size-8',\n 'icon-sm': 'size-9',\n 'icon-lg': 'size-11',\n },\n loading: {\n true: 'relative',\n },\n },\n defaultVariants: {\n size: 'default',\n variant: 'default',\n loading: false,\n },\n});\n\ntype ButtonVariantsProps = VariantProps<typeof buttonVariants>;\n\n/* -----------------------------------------------------------------------------\n * Component: Button\n * -------------------------------------------------------------------------- */\n\ntype ButtonElement = HTMLButtonElement;\n\ninterface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n ButtonVariantsProps {\n asChild?: boolean;\n}\n\nconst Button = React.forwardRef<ButtonElement, ButtonProps>(\n (\n {\n children,\n className,\n variant,\n size,\n loading = false,\n asChild = false,\n ...props\n },\n ref,\n ) => {\n const Component = asChild ? Slot : 'button';\n const ComponentLoading = asChild ? 'span' : Fragment;\n const disabled = loading || props.disabled;\n\n return (\n <Component\n ref={ref}\n type={asChild ? undefined : 'button'}\n className={buttonVariants({ variant, size, loading, className })}\n {...props}\n disabled={disabled}\n >\n {loading ? (\n <ComponentLoading>\n <span aria-hidden className=\"invisible contents\">\n {children}\n </span>\n <VisuallyHidden>{children}</VisuallyHidden>\n <span className=\"absolute inset-0 flex items-center justify-center\">\n <Spinner />\n </span>\n </ComponentLoading>\n ) : (\n children\n )}\n </Component>\n );\n },\n);\n\nButton.displayName = 'Button';\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Button, buttonVariants, type ButtonProps, type ButtonVariantsProps };\n"],"mappings":"6EAAA,UAAYA,MAAW,QACvB,OAAS,YAAAC,MAAgB,QACzB,OAAS,QAAAC,MAAY,uBAErB,OAAS,kBAAAC,MAAsB,kCAmFrB,OACE,OAAAC,EADF,QAAAC,MAAA,oBA3EV,IAAMC,EAAiBC,EAAI,CACzB,KAAM,gPACN,SAAU,CACR,QAAS,CACP,QAAS,gEACT,YACE,+EACF,MAAO,+DACP,KAAM,kDACN,QACE,2GACF,UACE,wEACJ,EACA,KAAM,CACJ,QAAS,kBACT,GAAI,iBACJ,GAAI,iBACJ,GAAI,kBACJ,KAAM,UACN,UAAW,SACX,UAAW,SACX,UAAW,SACb,EACA,QAAS,CACP,KAAM,UACR,CACF,EACA,gBAAiB,CACf,KAAM,UACN,QAAS,UACT,QAAS,EACX,CACF,CAAC,EAgBKC,EAAe,aACnB,CACE,CACE,SAAAC,EACA,UAAAC,EACA,QAAAC,EACA,KAAAC,EACA,QAAAC,EAAU,GACV,QAAAC,EAAU,GACV,GAAGC,CACL,EACAC,IACG,CACH,IAAMC,EAAYH,EAAUI,EAAO,SAC7BC,EAAmBL,EAAU,OAASM,EACtCC,EAAWR,GAAWE,EAAM,SAElC,OACEX,EAACa,EAAA,CACC,IAAKD,EACL,KAAMF,EAAU,OAAY,SAC5B,UAAWR,EAAe,CAAE,QAAAK,EAAS,KAAAC,EAAM,QAAAC,EAAS,UAAAH,CAAU,CAAC,EAC9D,GAAGK,EACJ,SAAUM,EAET,SAAAR,EACCR,EAACc,EAAA,CACC,UAAAf,EAAC,QAAK,cAAW,GAAC,UAAU,qBACzB,SAAAK,EACH,EACAL,EAACkB,EAAA,CAAgB,SAAAb,EAAS,EAC1BL,EAAC,QAAK,UAAU,oDACd,SAAAA,EAACmB,EAAA,EAAQ,EACX,GACF,EAEAd,EAEJ,CAEJ,CACF,EAEAD,EAAO,YAAc","names":["React","Fragment","Slot","VisuallyHidden","jsx","jsxs","buttonVariants","cva","Button","children","className","variant","size","loading","asChild","props","ref","Component","Slot","ComponentLoading","Fragment","disabled","VisuallyHidden","Spinner"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/react/label.tsx"],"sourcesContent":["'use client';\nimport * as React from 'react';\nimport * as LabelPrimitive from '@radix-ui/react-label';\nimport { cn } from '../lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Component: Label\n * -------------------------------------------------------------------------- */\n\ntype LabelElement = React.ElementRef<typeof LabelPrimitive.Root>;\ntype LabelProps = React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>;\n\nconst Label = React.forwardRef<LabelElement, LabelProps>(\n ({ className, ...props }, ref) => (\n <LabelPrimitive.Root\n ref={ref}\n className={cn(\n 'text-sm font-medium leading-none peer-disabled:pointer-events-none peer-disabled:opacity-70',\n className,\n )}\n {...props}\n />\n ),\n);\n\nLabel.displayName = LabelPrimitive.Root.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Label, type LabelProps };\n"],"mappings":"yCACA,UAAYA,MAAW,QACvB,UAAYC,MAAoB,wBAY5B,cAAAC,MAAA,oBAFJ,IAAMC,EAAc,aAClB,CAAC,CAAE,UAAAC,EAAW,GAAGC,CAAM,EAAGC,IACxBJ,EAAgB,OAAf,CACC,IAAKI,EACL,UAAWC,EACT,8FACAH,CACF,EACC,GAAGC,EACN,CAEJ,EAEAF,EAAM,YAA6B,OAAK","names":["React","LabelPrimitive","jsx","Label","className","props","ref","cn"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../plugin/animate.plugin.ts"],"names":["plugin","animate","addUtilities","matchUtilities","theme","value","animate_plugin_default"],"mappings":"AAAA,OAAOA,MAAY,qBAQnB,IAAMC,EAAUD,EACd,CAAC,CAAE,aAAAE,EAAc,eAAAC,EAAgB,MAAAC,CAAM,IAAM,CAE3CF,EAAa,CACX,gBAAiB,CACf,KAAM,CACJ,QAAS,+BACT,UAAW,CACT,qFACA,8FACA,qCACF,EAAE,KAAK,GAAG,CACZ,CACF,EAEA,iBAAkB,CAChB,GAAI,CACF,QAAS,gCACT,UAAW,CACT,uFACA,iGACA,sCACF,EAAE,KAAK,GAAG,CACZ,CACF,EAEA,qBAAsB,CACpB,KAAM,CACJ,QAAS,8BACX,CACF,EAEA,sBAAuB,CACrB,GAAI,CACF,QAAS,+BACX,CACF,EAEA,cAAe,CACb,cAAe,KACf,kBAAmBE,EAAM,2BAA2B,EACpD,uBAAwB,UACxB,qBAAsB,UACtB,sBAAuB,UACvB,2BAA4B,UAC5B,2BAA4B,SAC9B,EAEA,eAAgB,CACd,cAAe,MACf,kBAAmBA,EAAM,2BAA2B,EACpD,wBAAyB,UACzB,sBAAuB,UACvB,uBAAwB,UACxB,4BAA6B,UAC7B,4BAA6B,SAC/B,E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AAM,0BAA0B,CACrC,GAEA,mBAAoB,CAAC,CAAE,MAAAA,CAAM,KAAyB,CACpD,QAAS,OACT,GAAGA,EAAM,WAAW,CACtB,EACF,CACF,CACF,CACF,EAEOE,EAAQL","sourcesContent":["import plugin from 'tailwindcss/plugin';\nimport { type Config } from 'tailwindcss/types/config';\n\ntype Theme = <TDefaultValue = Config['theme']>(\n path?: string,\n defaultValue?: TDefaultValue,\n) => TDefaultValue;\n\nconst animate = plugin(\n ({ addUtilities, matchUtilities, theme }) => {\n // Keyframes\n addUtilities({\n '@keyframes in': {\n from: {\n opacity: 'var(--animate-in-opacity, 1)',\n transform: [\n 'translate3d(var(--animate-in-translate-x, 0), var(--animate-in-translate-y, 0), 0)',\n 'scale3d(var(--animate-in-scale, 1), var(--animate-in-scale, 1), var(--animate-in-scale, 1))',\n 'rotate(var(--animate-in-rotate, 0))',\n ].join(' '),\n },\n },\n\n '@keyframes out': {\n to: {\n opacity: 'var(--animate-out-opacity, 1)',\n transform: [\n 'translate3d(var(--animate-out-translate-x, 0), var(--animate-out-translate-y, 0), 0)',\n 'scale3d(var(--animate-out-scale, 1), var(--animate-out-scale, 1), var(--animate-out-scale, 1))',\n 'rotate(var(--animate-out-rotate, 0))',\n ].join(' '),\n },\n },\n\n '@keyframes fade-in': {\n from: {\n opacity: 'var(--animate-in-opacity, 0)',\n },\n },\n\n '@keyframes fade-out': {\n to: {\n opacity: 'var(--animate-out-opacity, 0)',\n },\n },\n\n '.animate-in': {\n animationName: 'in',\n animationDuration: theme('animationDuration.DEFAULT'),\n '--animate-in-opacity': 'initial',\n '--animate-in-scale': 'initial',\n '--animate-in-rotate': 'initial',\n '--animate-in-translate-x': 'initial',\n '--animate-in-translate-y': 'initial',\n },\n\n '.animate-out': {\n animationName: 'out',\n animationDuration: theme('animationDuration.DEFAULT'),\n '--animate-out-opacity': 'initial',\n '--animate-out-scale': 'initial',\n '--animate-out-rotate': 'initial',\n '--animate-out-translate-x': 'initial',\n '--animate-out-translate-y': 'initial',\n },\n\n '.animate-fade-in': {\n animationName: 'fade-in',\n animationDuration: theme('animationDuration.DEFAULT'),\n '--animate-in-opacity': 'initial',\n },\n\n '.animate-fade-out': {\n animationName: 'fade-out',\n animationDuration: theme('animationDuration.DEFAULT'),\n '--animate-out-opacity': 'initial',\n },\n });\n\n // Play state\n addUtilities({\n '.animation-running': {\n animationPlayState: 'running',\n },\n '.animation-paused': {\n animationPlayState: 'paused',\n },\n });\n\n // Delay\n matchUtilities(\n {\n 'animate-delay': (value) => ({\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- safe\n animationDelay: value,\n }),\n },\n {\n values: theme('animationDelay'),\n },\n );\n\n // Direction\n matchUtilities(\n {\n 'animate-direction': (value) => ({\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- safe\n animationDirection: value,\n }),\n },\n {\n values: theme('animationDirection'),\n },\n );\n\n // Duration\n matchUtilities(\n {\n 'animate-duration': (value) => ({\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- safe\n animationDuration: value,\n }),\n },\n {\n values: theme('animationDuration'),\n },\n );\n\n // Fill mode\n matchUtilities(\n {\n 'animate-fill-mode': (value) => ({\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- safe\n animationFillMode: value,\n }),\n },\n {\n values: theme('animationFillMode'),\n },\n );\n\n // Opacity\n matchUtilities(\n {\n 'fade-in': (value) => ({\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- safe\n '--animate-in-opacity': value,\n }),\n 'fade-out': (value) => ({\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- safe\n '--animate-out-opacity': value,\n }),\n },\n {\n values: theme('animationOpacity'),\n },\n );\n\n // Repeat\n matchUtilities(\n {\n 'animate-repeat': (value) => ({\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- safe\n animationIterationCount: value,\n }),\n },\n {\n values: theme('animationRepeat'),\n },\n );\n\n // Rotate\n matchUtilities(\n {\n 'spin-in': (value) => ({\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- safe\n '--animate-in-rotate': value,\n }),\n 'spin-out': (value) => ({\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- safe\n '--animate-out-rotate': value,\n }),\n },\n {\n values: theme('animationRotate'),\n },\n );\n\n // Scale - Zoom\n matchUtilities(\n {\n 'zoom-in': (value) => ({\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- safe\n '--animate-in-scale': value,\n }),\n 'zoom-out': (value) => ({\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- safe\n '--animate-out-scale': value,\n }),\n },\n {\n values: theme('animationScale'),\n },\n );\n\n // Timing function\n matchUtilities(\n {\n 'animate-ease': (value) => ({\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- safe\n animationTimingFunction: value,\n }),\n },\n {\n values: theme('animationTimingFunction'),\n },\n );\n\n // Translate - Slide\n matchUtilities(\n {\n 'slide-in-from-top': (value) => ({\n '--animate-in-translate-y': `-${value}`,\n }),\n\n 'slide-in-from-bottom': (value) => ({\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- safe\n '--animate-in-translate-y': value,\n }),\n\n 'slide-in-from-left': (value) => ({\n '--animate-in-translate-x': `-${value}`,\n }),\n\n 'slide-in-from-right': (value) => ({\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- safe\n '--animate-in-translate-x': value,\n }),\n\n 'slide-out-to-top': (value) => ({\n '--animate-out-translate-y': `-${value}`,\n }),\n\n 'slide-out-to-bottom': (value) => ({\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- safe\n '--animate-out-translate-y': value,\n }),\n\n 'slide-out-to-left': (value) => ({\n '--animate-out-translate-x': `-${value}`,\n }),\n\n 'slide-out-to-right': (value) => ({\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- safe\n '--animate-out-translate-x': value,\n }),\n },\n {\n values: theme('animationTranslate'),\n },\n );\n },\n {\n theme: {\n extend: {\n animationDelay: ({ theme }: { theme: Theme }) => ({\n ...theme('transitionDelay'),\n }),\n\n animationDirection: {\n normal: 'normal',\n reverse: 'reverse',\n alternate: 'alternate',\n 'alternate-reverse': 'alternate-reverse',\n },\n\n animationDuration: ({ theme }: { theme: Theme }) => ({\n ...theme('transitionDuration'),\n }),\n\n animationFillMode: {\n none: 'none',\n forwards: 'forwards',\n backwards: 'backwards',\n both: 'both',\n },\n\n animationOpacity: ({ theme }: { theme: Theme }) => ({\n DEFAULT: 0,\n ...theme('opacity'),\n }),\n\n animationRepeat: {\n 0: '0',\n 1: '1',\n infinite: 'infinite',\n },\n\n animationRotate: ({ theme }: { theme: Theme }) => ({\n DEFAULT: '30deg',\n ...theme('rotate'),\n }),\n\n animationScale: ({ theme }: { theme: Theme }) => ({\n DEFAULT: 0,\n ...theme('scale'),\n }),\n\n animationTimingFunction: ({ theme }: { theme: Theme }) => ({\n ...theme('transitionTimingFunction'),\n }),\n\n animationTranslate: ({ theme }: { theme: Theme }) => ({\n DEFAULT: '100%',\n ...theme('translate'),\n }),\n },\n },\n },\n);\n\nexport default animate;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/react/toggle.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as TogglePrimitive from '@radix-ui/react-toggle';\nimport { type VariantProps } from 'cva';\nimport { cva } from '../lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Variant: Toggle\n * -------------------------------------------------------------------------- */\n\nconst toggleVariants = cva({\n base: 'hover:bg-muted hover:text-muted-foreground data-[state=on]:bg-accent data-[state=on]:text-accent-foreground inline-flex items-center justify-center rounded-md text-sm font-medium transition focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:pointer-events-none disabled:opacity-50',\n variants: {\n variant: {\n default: 'bg-transparent',\n outline:\n 'border-input hover:bg-accent hover:text-accent-foreground border bg-transparent shadow-sm',\n },\n size: {\n default: 'h-10 px-3',\n sm: 'h-9 px-2.5',\n lg: 'h-11 px-5',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n});\n\ntype ToggleVariantsProps = VariantProps<typeof toggleVariants>;\n\n/* -----------------------------------------------------------------------------\n * Component: Toggle\n * -------------------------------------------------------------------------- */\n\ntype ToggleElement = React.ElementRef<typeof TogglePrimitive.Root>;\ntype ToggleProps = React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> &\n ToggleVariantsProps;\n\nconst Toggle = React.forwardRef<ToggleElement, ToggleProps>(\n ({ className, variant, size, ...props }, ref) => (\n <TogglePrimitive.Root\n ref={ref}\n className={toggleVariants({ variant, size, className })}\n {...props}\n />\n ),\n);\n\nToggle.displayName = TogglePrimitive.Root.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\nexport { Toggle, toggleVariants, type ToggleProps, type ToggleVariantsProps };\n"],"mappings":"yCAEA,UAAYA,MAAW,QACvB,UAAYC,MAAqB,yBAwC7B,cAAAC,MAAA,oBAhCJ,IAAMC,EAAiBC,EAAI,CACzB,KAAM,8TACN,SAAU,CACR,QAAS,CACP,QAAS,iBACT,QACE,2FACJ,EACA,KAAM,CACJ,QAAS,YACT,GAAI,aACJ,GAAI,WACN,CACF,EACA,gBAAiB,CACf,QAAS,UACT,KAAM,SACR,CACF,CAAC,EAYKC,EAAe,aACnB,CAAC,CAAE,UAAAC,EAAW,QAAAC,EAAS,KAAAC,EAAM,GAAGC,CAAM,EAAGC,IACvCR,EAAiB,OAAhB,CACC,IAAKQ,EACL,UAAWP,EAAe,CAAE,QAAAI,EAAS,KAAAC,EAAM,UAAAF,CAAU,CAAC,EACrD,GAAGG,EACN,CAEJ,EAEAJ,EAAO,YAA8B,OAAK","names":["React","TogglePrimitive","jsx","toggleVariants","cva","Toggle","className","variant","size","props","ref"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../plugin/animate.plugin.ts"],"sourcesContent":["import plugin from 'tailwindcss/plugin';\nimport { type Config } from 'tailwindcss/types/config';\n\ntype Theme = <TDefaultValue = Config['theme']>(\n path?: string,\n defaultValue?: TDefaultValue,\n) => TDefaultValue;\n\nconst animate = plugin(\n ({ addUtilities, matchUtilities, theme }) => {\n // Keyframes\n addUtilities({\n '@keyframes in': {\n from: {\n opacity: 'var(--animate-in-opacity, 1)',\n transform: [\n 'translate3d(var(--animate-in-translate-x, 0), var(--animate-in-translate-y, 0), 0)',\n 'scale3d(var(--animate-in-scale, 1), var(--animate-in-scale, 1), var(--animate-in-scale, 1))',\n 'rotate(var(--animate-in-rotate, 0))',\n ].join(' '),\n },\n },\n\n '@keyframes out': {\n to: {\n opacity: 'var(--animate-out-opacity, 1)',\n transform: [\n 'translate3d(var(--animate-out-translate-x, 0), var(--animate-out-translate-y, 0), 0)',\n 'scale3d(var(--animate-out-scale, 1), var(--animate-out-scale, 1), var(--animate-out-scale, 1))',\n 'rotate(var(--animate-out-rotate, 0))',\n ].join(' '),\n },\n },\n\n '@keyframes fade-in': {\n from: {\n opacity: 'var(--animate-in-opacity, 0)',\n },\n },\n\n '@keyframes fade-out': {\n to: {\n opacity: 'var(--animate-out-opacity, 0)',\n },\n },\n\n '.animate-in': {\n animationName: 'in',\n animationDuration: theme('animationDuration.DEFAULT'),\n '--animate-in-opacity': 'initial',\n '--animate-in-scale': 'initial',\n '--animate-in-rotate': 'initial',\n '--animate-in-translate-x': 'initial',\n '--animate-in-translate-y': 'initial',\n },\n\n '.animate-out': {\n animationName: 'out',\n animationDuration: theme('animationDuration.DEFAULT'),\n '--animate-out-opacity': 'initial',\n '--animate-out-scale': 'initial',\n '--animate-out-rotate': 'initial',\n '--animate-out-translate-x': 'initial',\n '--animate-out-translate-y': 'initial',\n },\n\n '.animate-fade-in': {\n animationName: 'fade-in',\n animationDuration: theme('animationDuration.DEFAULT'),\n '--animate-in-opacity': 'initial',\n },\n\n '.animate-fade-out': {\n animationName: 'fade-out',\n animationDuration: theme('animationDuration.DEFAULT'),\n '--animate-out-opacity': 'initial',\n },\n });\n\n // Play state\n addUtilities({\n '.animation-running': {\n animationPlayState: 'running',\n },\n '.animation-paused': {\n animationPlayState: 'paused',\n },\n });\n\n // Delay\n matchUtilities(\n {\n 'animate-delay': (value) => ({\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- safe\n animationDelay: value,\n }),\n },\n {\n values: theme('animationDelay'),\n },\n );\n\n // Direction\n matchUtilities(\n {\n 'animate-direction': (value) => ({\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- safe\n animationDirection: value,\n }),\n },\n {\n values: theme('animationDirection'),\n },\n );\n\n // Duration\n matchUtilities(\n {\n 'animate-duration': (value) => ({\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- safe\n animationDuration: value,\n }),\n },\n {\n values: theme('animationDuration'),\n },\n );\n\n // Fill mode\n matchUtilities(\n {\n 'animate-fill-mode': (value) => ({\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- safe\n animationFillMode: value,\n }),\n },\n {\n values: theme('animationFillMode'),\n },\n );\n\n // Opacity\n matchUtilities(\n {\n 'fade-in': (value) => ({\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- safe\n '--animate-in-opacity': value,\n }),\n 'fade-out': (value) => ({\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- safe\n '--animate-out-opacity': value,\n }),\n },\n {\n values: theme('animationOpacity'),\n },\n );\n\n // Repeat\n matchUtilities(\n {\n 'animate-repeat': (value) => ({\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- safe\n animationIterationCount: value,\n }),\n },\n {\n values: theme('animationRepeat'),\n },\n );\n\n // Rotate\n matchUtilities(\n {\n 'spin-in': (value) => ({\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- safe\n '--animate-in-rotate': value,\n }),\n 'spin-out': (value) => ({\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- safe\n '--animate-out-rotate': value,\n }),\n },\n {\n values: theme('animationRotate'),\n },\n );\n\n // Scale - Zoom\n matchUtilities(\n {\n 'zoom-in': (value) => ({\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- safe\n '--animate-in-scale': value,\n }),\n 'zoom-out': (value) => ({\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- safe\n '--animate-out-scale': value,\n }),\n },\n {\n values: theme('animationScale'),\n },\n );\n\n // Timing function\n matchUtilities(\n {\n 'animate-ease': (value) => ({\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- safe\n animationTimingFunction: value,\n }),\n },\n {\n values: theme('animationTimingFunction'),\n },\n );\n\n // Translate - Slide\n matchUtilities(\n {\n 'slide-in-from-top': (value) => ({\n '--animate-in-translate-y': `-${value}`,\n }),\n\n 'slide-in-from-bottom': (value) => ({\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- safe\n '--animate-in-translate-y': value,\n }),\n\n 'slide-in-from-left': (value) => ({\n '--animate-in-translate-x': `-${value}`,\n }),\n\n 'slide-in-from-right': (value) => ({\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- safe\n '--animate-in-translate-x': value,\n }),\n\n 'slide-out-to-top': (value) => ({\n '--animate-out-translate-y': `-${value}`,\n }),\n\n 'slide-out-to-bottom': (value) => ({\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- safe\n '--animate-out-translate-y': value,\n }),\n\n 'slide-out-to-left': (value) => ({\n '--animate-out-translate-x': `-${value}`,\n }),\n\n 'slide-out-to-right': (value) => ({\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- safe\n '--animate-out-translate-x': value,\n }),\n },\n {\n values: theme('animationTranslate'),\n },\n );\n },\n {\n theme: {\n extend: {\n animationDelay: ({ theme }: { theme: Theme }) => ({\n ...theme('transitionDelay'),\n }),\n\n animationDirection: {\n normal: 'normal',\n reverse: 'reverse',\n alternate: 'alternate',\n 'alternate-reverse': 'alternate-reverse',\n },\n\n animationDuration: ({ theme }: { theme: Theme }) => ({\n ...theme('transitionDuration'),\n }),\n\n animationFillMode: {\n none: 'none',\n forwards: 'forwards',\n backwards: 'backwards',\n both: 'both',\n },\n\n animationOpacity: ({ theme }: { theme: Theme }) => ({\n DEFAULT: 0,\n ...theme('opacity'),\n }),\n\n animationRepeat: {\n 0: '0',\n 1: '1',\n infinite: 'infinite',\n },\n\n animationRotate: ({ theme }: { theme: Theme }) => ({\n DEFAULT: '30deg',\n ...theme('rotate'),\n }),\n\n animationScale: ({ theme }: { theme: Theme }) => ({\n DEFAULT: 0,\n ...theme('scale'),\n }),\n\n animationTimingFunction: ({ theme }: { theme: Theme }) => ({\n ...theme('transitionTimingFunction'),\n }),\n\n animationTranslate: ({ theme }: { theme: Theme }) => ({\n DEFAULT: '100%',\n ...theme('translate'),\n }),\n },\n },\n },\n);\n\nexport default animate;\n"],"mappings":"AAAA,OAAOA,MAAY,qBAQnB,IAAMC,EAAUD,EACd,CAAC,CAAE,aAAAE,EAAc,eAAAC,EAAgB,MAAAC,CAAM,IAAM,CAE3CF,EAAa,CACX,gBAAiB,CACf,KAAM,CACJ,QAAS,+BACT,UAAW,CACT,qFACA,8FACA,qCACF,EAAE,KAAK,GAAG,CACZ,CACF,EAEA,iBAAkB,CAChB,GAAI,CACF,QAAS,gCACT,UAAW,CACT,uFACA,iGACA,sCACF,EAAE,KAAK,GAAG,CACZ,CACF,EAEA,qBAAsB,CACpB,KAAM,CACJ,QAAS,8BACX,CACF,EAEA,sBAAuB,CACrB,GAAI,CACF,QAAS,+BACX,CACF,EAEA,cAAe,CACb,cAAe,KACf,kBAAmBE,EAAM,2BAA2B,EACpD,uBAAwB,UACxB,qBAAsB,UACtB,sBAAuB,UACvB,2BAA4B,UAC5B,2BAA4B,SAC9B,EAEA,eAAgB,CACd,cAAe,MACf,kBAAmBA,EAAM,2BAA2B,EACpD,wBAAyB,UACzB,sBAAuB,UACvB,uBAAwB,UACxB,4BAA6B,UAC7B,4BAA6B,SAC/B,EAEA,mBAAoB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,CACrC,GAEA,mBAAoB,CAAC,CAAE,MAAAA,CAAM,KAAyB,CACpD,QAAS,OACT,GAAGA,EAAM,WAAW,CACtB,EACF,CACF,CACF,CACF,EAEOE,EAAQL","names":["plugin","animate","addUtilities","matchUtilities","theme","value","animate_plugin_default"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/react/checkbox-group.primitive.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox';\nimport { createCheckboxScope } from '@radix-ui/react-checkbox';\nimport { createContextScope, type Scope } from '@radix-ui/react-context';\nimport * as RovingFocusGroup from '@radix-ui/react-roving-focus';\nimport { createRovingFocusGroupScope } from '@radix-ui/react-roving-focus';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { useDirection } from '@radix-ui/react-direction';\nimport { Primitive } from '@radix-ui/react-primitive';\n\n/* -------------------------------------------------------------------------------------------------\n * Component: CheckboxGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst CHECKBOX_GROUP_NAME = 'CheckboxGroup';\n\ntype ScopedProps<P> = P & { __scopeCheckboxGroup?: Scope };\n\nconst [createCheckboxGroupContext, createCheckboxGroupScope] =\n createContextScope(CHECKBOX_GROUP_NAME, [\n createRovingFocusGroupScope,\n createCheckboxScope,\n ]);\n\nconst useRovingFocusGroupScope = createRovingFocusGroupScope();\nconst useCheckboxScope = createCheckboxScope();\n\ninterface CheckboxGroupContextValue {\n name?: string;\n required: boolean;\n disabled: boolean;\n value?: string[];\n onItemCheck: (value: string) => void;\n onItemUncheck: (value: string) => void;\n}\n\nconst [CheckboxGroupProvider, useCheckboxGroupContext] =\n createCheckboxGroupContext<CheckboxGroupContextValue>(CHECKBOX_GROUP_NAME);\n\ntype CheckboxGroupElement = React.ElementRef<typeof Primitive.div>;\n\ninterface CheckboxGroupProps\n extends React.ComponentPropsWithoutRef<typeof Primitive.div> {\n name?: CheckboxGroupContextValue['name'];\n required?: React.ComponentPropsWithoutRef<\n typeof CheckboxPrimitive.Root\n >['required'];\n disabled?: React.ComponentPropsWithoutRef<\n typeof CheckboxPrimitive.Root\n >['disabled'];\n dir?: RovingFocusGroup.RovingFocusGroupProps['dir'];\n orientation?: RovingFocusGroup.RovingFocusGroupProps['orientation'];\n loop?: RovingFocusGroup.RovingFocusGroupProps['loop'];\n defaultValue?: string[];\n value?: CheckboxGroupContextValue['value'];\n onValueChange?: (value: string[]) => void;\n}\n\nconst CheckboxGroup = React.forwardRef<\n CheckboxGroupElement,\n CheckboxGroupProps\n>(\n (\n {\n __scopeCheckboxGroup,\n name,\n defaultValue,\n value: valueProp,\n required = false,\n disabled = false,\n orientation,\n dir,\n loop = true,\n onValueChange,\n ...props\n }: ScopedProps<CheckboxGroupProps>,\n ref,\n ) => {\n const rovingFocusGroupScope =\n useRovingFocusGroupScope(__scopeCheckboxGroup);\n const direction = useDirection(dir);\n const [value = [], setValue] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue,\n onChange: onValueChange,\n });\n\n const handleItemCheck = React.useCallback(\n (itemValue: string) => {\n setValue((prevValue = []) => [...prevValue, itemValue]);\n },\n [setValue],\n );\n\n const handleItemUncheck = React.useCallback(\n (itemValue: string) => {\n setValue((prevValue = []) =>\n prevValue.filter((val) => val !== itemValue),\n );\n },\n [setValue],\n );\n\n return (\n <CheckboxGroupProvider\n scope={__scopeCheckboxGroup}\n name={name}\n required={required}\n disabled={disabled}\n value={value}\n onItemCheck={handleItemCheck}\n onItemUncheck={handleItemUncheck}\n >\n <RovingFocusGroup.Root\n asChild\n {...rovingFocusGroupScope}\n orientation={orientation}\n dir={direction}\n loop={loop}\n >\n {/* eslint-disable-next-line react/jsx-pascal-case -- radix-ui */}\n <Primitive.div\n ref={ref}\n role=\"group\"\n data-disabled={disabled ? '' : undefined}\n dir={direction}\n {...props}\n />\n </RovingFocusGroup.Root>\n </CheckboxGroupProvider>\n );\n },\n);\n\nCheckboxGroup.displayName = CHECKBOX_GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * Component: CheckboxGroupItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = `${CHECKBOX_GROUP_NAME}Item`;\n\ntype CheckboxGroupItemElement = React.ElementRef<typeof CheckboxPrimitive.Root>;\n\ninterface CheckboxGroupItemProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>,\n 'checked' | 'defaultChecked' | 'onCheckedChange' | 'name'\n > {\n value: string;\n}\n\nconst CheckboxGroupItem = React.forwardRef<\n CheckboxGroupItemElement,\n CheckboxGroupItemProps\n>(\n (\n {\n __scopeCheckboxGroup,\n disabled,\n ...props\n }: ScopedProps<CheckboxGroupItemProps>,\n ref,\n ) => {\n const context = useCheckboxGroupContext(ITEM_NAME, __scopeCheckboxGroup);\n const isDisabled = context.disabled || disabled;\n const rovingFocusGroupScope =\n useRovingFocusGroupScope(__scopeCheckboxGroup);\n const checkboxScope = useCheckboxScope(__scopeCheckboxGroup);\n const checked = context.value?.includes(props.value);\n\n return (\n <RovingFocusGroup.Item\n asChild\n {...rovingFocusGroupScope}\n focusable={!isDisabled}\n active={checked}\n >\n <CheckboxPrimitive.Root\n ref={ref}\n name={context.name}\n disabled={isDisabled}\n required={context.required}\n checked={checked}\n {...checkboxScope}\n {...props}\n onCheckedChange={(checkedState) => {\n if (checkedState) {\n context.onItemCheck(props.value);\n } else {\n context.onItemUncheck(props.value);\n }\n }}\n />\n </RovingFocusGroup.Item>\n );\n },\n);\n\nCheckboxGroupItem.displayName = ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * Component: CheckboxGroupIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = `${CHECKBOX_GROUP_NAME}Indicator`;\n\ntype CheckboxGroupIndicatorElement = React.ElementRef<\n typeof CheckboxPrimitive.Indicator\n>;\ntype CheckboxGroupIndicatorProps = React.ComponentPropsWithoutRef<\n typeof CheckboxPrimitive.Indicator\n>;\n\nconst CheckboxGroupIndicator = React.forwardRef<\n CheckboxGroupIndicatorElement,\n CheckboxGroupIndicatorProps\n>(\n (\n {\n __scopeCheckboxGroup,\n ...props\n }: ScopedProps<CheckboxGroupIndicatorProps>,\n ref,\n ) => {\n const checkboxScope = useCheckboxScope(__scopeCheckboxGroup);\n\n return (\n <CheckboxPrimitive.Indicator ref={ref} {...checkboxScope} {...props} />\n );\n },\n);\n\nCheckboxGroupIndicator.displayName = INDICATOR_NAME;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nconst Root = CheckboxGroup;\nconst Item = CheckboxGroupItem;\nconst Indicator = CheckboxGroupIndicator;\n\nexport {\n createCheckboxGroupScope,\n CheckboxGroup,\n CheckboxGroupItem,\n CheckboxGroupIndicator,\n Root,\n Item,\n Indicator,\n type CheckboxGroupProps,\n type CheckboxGroupItemProps,\n type CheckboxGroupIndicatorProps,\n};\n"],"mappings":"AAAA,UAAYA,MAAW,QACvB,UAAYC,MAAuB,2BACnC,OAAS,uBAAAC,MAA2B,2BACpC,OAAS,sBAAAC,MAAsC,0BAC/C,UAAYC,MAAsB,+BAClC,OAAS,+BAAAC,MAAmC,+BAC5C,OAAS,wBAAAC,MAA4B,yCACrC,OAAS,gBAAAC,MAAoB,4BAC7B,OAAS,aAAAC,MAAiB,4BAiHhB,cAAAC,MAAA,oBA3GV,IAAMC,EAAsB,gBAItB,CAACC,EAA4BC,CAAwB,EACzDT,EAAmBO,EAAqB,CACtCL,EACAH,CACF,CAAC,EAEGW,EAA2BR,EAA4B,EACvDS,EAAmBZ,EAAoB,EAWvC,CAACa,EAAuBC,CAAuB,EACnDL,EAAsDD,CAAmB,EAqBrEO,EAAsB,aAI1B,CACE,CACE,qBAAAC,EACA,KAAAC,EACA,aAAAC,EACA,MAAOC,EACP,SAAAC,EAAW,GACX,SAAAC,EAAW,GACX,YAAAC,EACA,IAAAC,EACA,KAAAC,EAAO,GACP,cAAAC,EACA,GAAGC,CACL,EACAC,IACG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AMY,EAAQ,KACd,SAAUC,EACV,SAAUD,EAAQ,SAClB,QAASG,EACR,GAAGD,EACH,GAAGf,EACJ,gBAAkBiB,GAAiB,CAC7BA,EACFJ,EAAQ,YAAYb,EAAM,KAAK,EAE/Ba,EAAQ,cAAcb,EAAM,KAAK,CAErC,EACF,EACF,CAEJ,CACF,EAEAY,EAAkB,YAAcD,EAMhC,IAAMO,EAAiB,GAAGpC,CAAmB,YASvCqC,EAA+B,aAInC,CACE,CACE,qBAAA7B,EACA,GAAGU,CACL,EACAC,IACG,CACH,IAAMc,EAAgB7B,EAAiBI,CAAoB,EAE3D,OACET,EAAmB,YAAlB,CAA4B,IAAKoB,EAAM,GAAGc,EAAgB,GAAGf,EAAO,CAEzE,CACF,EAEAmB,EAAuB,YAAcD,EAMrC,IAAME,EAAO/B,EACPgC,EAAOT,EACPU,EAAYH","names":["React","CheckboxPrimitive","createCheckboxScope","createContextScope","RovingFocusGroup","createRovingFocusGroupScope","useControllableState","useDirection","Primitive","jsx","CHECKBOX_GROUP_NAME","createCheckboxGroupContext","createCheckboxGroupScope","useRovingFocusGroupScope","useCheckboxScope","CheckboxGroupProvider","useCheckboxGroupContext","CheckboxGroup","__scopeCheckboxGroup","name","defaultValue","valueProp","required","disabled","orientation","dir","loop","onValueChange","props","ref","rovingFocusGroupScope","direction","value","setValue","handleItemCheck","itemValue","prevValue","handleItemUncheck","val","ITEM_NAME","CheckboxGroupItem","context","isDisabled","checkboxScope","checked","checkedState","INDICATOR_NAME","CheckboxGroupIndicator","Root","Item","Indicator"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/react/label.tsx"],"names":["React","LabelPrimitive","jsx","Label","className","props","ref","cn"],"mappings":"wCACA,UAAYA,MAAW,QACvB,UAAYC,MAAoB,wBAY5B,cAAAC,MAAA,oBAFJ,IAAMC,EAAc,aAClB,CAAC,CAAE,UAAAC,EAAW,GAAGC,CAAM,EAAGC,IACxBJ,EAAgB,OAAf,CACC,IAAKI,EACL,UAAWC,EACT,8FACAH,CACF,EACC,GAAGC,EACN,CAEJ,EAEAF,EAAM,YAA6B,OAAK","sourcesContent":["'use client';\nimport * as React from 'react';\nimport * as LabelPrimitive from '@radix-ui/react-label';\nimport { cn } from '../lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Component: Label\n * -------------------------------------------------------------------------- */\n\ntype LabelElement = React.ElementRef<typeof LabelPrimitive.Root>;\ntype LabelProps = React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>;\n\nconst Label = React.forwardRef<LabelElement, LabelProps>(\n ({ className, ...props }, ref) => (\n <LabelPrimitive.Root\n ref={ref}\n className={cn(\n 'text-sm font-medium leading-none peer-disabled:pointer-events-none peer-disabled:opacity-70',\n className,\n )}\n {...props}\n />\n ),\n);\n\nLabel.displayName = LabelPrimitive.Root.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Label, type LabelProps };\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/react/select.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport {\n CaretSortIcon,\n CheckIcon,\n ChevronDownIcon,\n ChevronUpIcon,\n} from '@radix-ui/react-icons';\nimport * as SelectPrimitive from '@radix-ui/react-select';\nimport { cn } from '../lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Component: Select\n * -------------------------------------------------------------------------- */\n\ntype SelectProps = React.ComponentProps<typeof SelectPrimitive.Root>;\nconst Select = SelectPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectGroup\n * -------------------------------------------------------------------------- */\n\ntype SelectGroupProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Group\n>;\nconst SelectGroup = SelectPrimitive.Group;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectValue\n * -------------------------------------------------------------------------- */\n\ntype SelectValueProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Value\n>;\nconst SelectValue = SelectPrimitive.Value;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectTrigger\n * -------------------------------------------------------------------------- */\n\ntype SelectTriggerElement = React.ElementRef<typeof SelectPrimitive.Trigger>;\ntype SelectTriggerProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Trigger\n>;\n\nconst SelectTrigger = React.forwardRef<\n SelectTriggerElement,\n SelectTriggerProps\n>(({ children, className, ...props }, ref) => (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n 'border-input placeholder:text-muted-foreground flex h-10 w-full items-center justify-between gap-2 whitespace-nowrap rounded-md border bg-transparent px-3 text-sm shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 [&>span]:truncate',\n className,\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <CaretSortIcon className=\"size-4 opacity-50\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n));\n\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectScrollUpButton\n * -------------------------------------------------------------------------- */\n\ntype SelectScrollUpButtonElement = React.ElementRef<\n typeof SelectPrimitive.ScrollUpButton\n>;\ntype SelectScrollUpButtonProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.ScrollUpButton\n>;\n\nconst SelectScrollUpButton = React.forwardRef<\n SelectScrollUpButtonElement,\n SelectScrollUpButtonProps\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollUpButton\n ref={ref}\n className={cn(\n 'flex cursor-pointer items-center justify-center py-1',\n className,\n )}\n {...props}\n >\n <ChevronUpIcon />\n </SelectPrimitive.ScrollUpButton>\n));\n\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectScrollDownButton\n * -------------------------------------------------------------------------- */\n\ntype SelectScrollDownButtonElement = React.ElementRef<\n typeof SelectPrimitive.ScrollDownButton\n>;\ntype SelectScrollDownButtonProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.ScrollDownButton\n>;\n\nconst SelectScrollDownButton = React.forwardRef<\n SelectScrollDownButtonElement,\n SelectScrollDownButtonProps\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollDownButton\n ref={ref}\n className={cn(\n 'flex cursor-pointer items-center justify-center py-1',\n className,\n )}\n {...props}\n >\n <ChevronDownIcon />\n </SelectPrimitive.ScrollDownButton>\n));\n\nSelectScrollDownButton.displayName =\n SelectPrimitive.ScrollDownButton.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectContent\n * -------------------------------------------------------------------------- */\n\ntype SelectContentElement = React.ElementRef<typeof SelectPrimitive.Content>;\ntype SelectContentProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Content\n>;\n\nconst SelectContent = React.forwardRef<\n SelectContentElement,\n SelectContentProps\n>(({ children, className, position = 'popper', ...props }, ref) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n className={cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=open]:fade-in data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border shadow-md',\n position === 'popper' &&\n 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',\n className,\n )}\n position={position}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n 'p-1',\n position === 'popper' &&\n 'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]',\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n));\n\nSelectContent.displayName = SelectPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectLabel\n * -------------------------------------------------------------------------- */\n\ntype SelectLabelElement = React.ElementRef<typeof SelectPrimitive.Label>;\ntype SelectLabelProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Label\n>;\n\nconst SelectLabel = React.forwardRef<SelectLabelElement, SelectLabelProps>(\n ({ className, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={cn('px-2 py-1.5 text-sm font-semibold', className)}\n {...props}\n />\n ),\n);\n\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectItem\n * -------------------------------------------------------------------------- */\n\ntype SelectItemElement = React.ElementRef<typeof SelectPrimitive.Item>;\ntype SelectItemProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Item\n>;\n\nconst SelectItem = React.forwardRef<SelectItemElement, SelectItemProps>(\n ({ children, className, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50',\n className,\n )}\n {...props}\n >\n <span className=\"absolute right-2 flex size-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n ),\n);\n\nSelectItem.displayName = SelectPrimitive.Item.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectSeparator\n * -------------------------------------------------------------------------- */\n\ntype SelectSeparatorElement = React.ElementRef<\n typeof SelectPrimitive.Separator\n>;\ntype SelectSeparatorProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Separator\n>;\n\nconst SelectSeparator = React.forwardRef<\n SelectSeparatorElement,\n SelectSeparatorProps\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn('bg-muted -mx-1 my-1 h-px', className)}\n {...props}\n />\n));\n\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Select,\n SelectGroup,\n SelectValue,\n SelectTrigger,\n SelectContent,\n SelectLabel,\n SelectItem,\n SelectSeparator,\n SelectScrollUpButton,\n SelectScrollDownButton,\n type SelectProps,\n type SelectGroupProps,\n type SelectValueProps,\n type SelectTriggerProps,\n type SelectContentProps,\n type SelectLabelProps,\n type SelectItemProps,\n type SelectSeparatorProps,\n type SelectScrollUpButtonProps,\n type SelectScrollDownButtonProps,\n};\n"],"mappings":"yCAEA,UAAYA,MAAW,QACvB,OACE,iBAAAC,EACA,aAAAC,EACA,mBAAAC,EACA,iBAAAC,MACK,wBACP,UAAYC,MAAqB,yBAyC/B,OAUI,OAAAC,EAVJ,QAAAC,MAAA,oBAjCF,IAAMC,EAAyB,OASzBC,EAA8B,QAS9BC,EAA8B,QAW9BC,EAAsB,aAG1B,CAAC,CAAE,SAAAC,EAAU,UAAAC,EAAW,GAAGC,CAAM,EAAGC,IACpCR,EAAiB,UAAhB,CACC,IAAKQ,EACL,UAAWC,EACT,oVACAH,CACF,EACC,GAAGC,EAEH,UAAAF,EACDN,EAAiB,OAAhB,CAAqB,QAAO,GAC3B,SAAAA,EAACW,EAAA,CAAc,UAAU,oBAAoB,EAC/C,GACF,CACD,EAEDN,EAAc,YAA8B,UAAQ,YAapD,I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AAC,QAAK,UAAU,6DACd,SAAAA,EAAiB,gBAAhB,CACC,SAAAA,EAACoB,EAAA,CAAU,UAAU,SAAS,EAChC,EACF,EACApB,EAAiB,WAAhB,CAA0B,SAAAM,EAAS,GACtC,CAEJ,EAEAa,EAAW,YAA8B,OAAK,YAa9C,IAAME,EAAwB,aAG5B,CAAC,CAAE,UAAAd,EAAW,GAAGC,CAAM,EAAGC,IAC1BT,EAAiB,YAAhB,CACC,IAAKS,EACL,UAAWC,EAAG,2BAA4BH,CAAS,EAClD,GAAGC,EACN,CACD,EAEDa,EAAgB,YAA8B,YAAU","names":["React","CaretSortIcon","CheckIcon","ChevronDownIcon","ChevronUpIcon","SelectPrimitive","jsx","jsxs","Select","SelectGroup","SelectValue","SelectTrigger","children","className","props","ref","cn","CaretSortIcon","SelectScrollUpButton","ChevronUpIcon","SelectScrollDownButton","ChevronDownIcon","SelectContent","position","SelectLabel","SelectItem","CheckIcon","SelectSeparator"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/react/dropdown-menu.tsx"],"names":["React","DropdownMenuPrimitive","CheckIcon","ChevronRightIcon","DotFilledIcon","jsx","jsxs","DropdownMenu","DropdownMenuTrigger","DropdownMenuGroup","DropdownMenuSub","DropdownMenuRadioGroup","DropdownMenuSubTrigger","children","className","inset","props","ref","cn","DropdownMenuSubContent","DropdownMenuContent","sideOffset","DropdownMenuItem","DropdownMenuCheckboxItem","checked","DropdownMenuRadioItem","DropdownMenuLabel","DropdownMenuSeparator","DropdownMenuShortcut"],"mappings":"wCAEA,UAAYA,MAAW,QACvB,UAAYC,MAA2B,gCACvC,OACE,aAAAC,EACA,oBAAAC,EACA,iBAAAC,MACK,wBAmEL,OAUE,OAAAC,EAVF,QAAAC,MAAA,oBAzDF,IAAMC,EAAqC,OASrCC,EAA4C,UAS5CC,EAA0C,QAS1CC,EAAwC,MASxCC,EAA+C,aAiB/CC,EAA+B,aAGnC,CAAC,CAAE,SAAAC,EAAU,U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U,EAAyB,YACD,eAAa,YAarC,IAAME,EAA8B,aAGlC,CAAC,CAAE,SAAAZ,EAAU,UAAAC,EAAW,GAAGE,CAAM,EAAGC,IACpCX,EAAuB,YAAtB,CACC,IAAKW,EACL,UAAWC,EACT,kOACAJ,CACF,EACC,GAAGE,EAEJ,UAAAX,EAAC,QAAK,UAAU,4DACd,SAAAA,EAAuB,gBAAtB,CACC,SAAAA,EAACD,EAAA,CAAc,UAAU,sBAAsB,EACjD,EACF,EACCS,GACH,CACD,EAEDY,EAAsB,YAAoC,YAAU,YAepE,IAAMC,EAA0B,aAG9B,CAAC,CAAE,UAAAZ,EAAW,MAAAC,EAAO,GAAGC,CAAM,EAAGC,IACjCZ,EAAuB,QAAtB,CACC,IAAKY,EACL,UAAWC,EACT,oCACAH,GAAS,OACTD,CACF,EACC,GAAGE,EACN,CACD,EAEDU,EAAkB,YAAoC,QAAM,YAa5D,IAAMC,EAA8B,aAGlC,CAAC,CAAE,UAAAb,EAAW,GAAGE,CAAM,EAAGC,IAC1BZ,EAAuB,YAAtB,CACC,IAAKY,EACL,UAAWC,EAAG,2BAA4BJ,CAAS,EAClD,GAAGE,EACN,CACD,EAEDW,EAAsB,YAAoC,YAAU,YAQpE,SAASC,EAAqB,CAC5B,UAAAd,EACA,GAAGE,CACL,EAAiD,CAC/C,OACEX,EAAC,QACC,UAAWa,EAAG,6CAA8CJ,CAAS,EACpE,GAAGE,EACN,CAEJ","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport {\n CheckIcon,\n ChevronRightIcon,\n DotFilledIcon,\n} from '@radix-ui/react-icons';\nimport { cn } from '../lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenu\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuProps = React.ComponentProps<\n typeof DropdownMenuPrimitive.Root\n>;\nconst DropdownMenu = DropdownMenuPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuTrigger\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuTriggerProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.Trigger\n>;\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuGroup\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuGroupProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.Group\n>;\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSub\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuSubProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.Sub\n>;\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSubTrigger\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuRadioGroupProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.RadioGroup\n>;\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSubTrigger\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuSubTriggerElement = React.ElementRef<\n typeof DropdownMenuPrimitive.SubTrigger\n>;\n\ninterface DropdownMenuSubTriggerProps\n extends React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.SubTrigger\n > {\n inset?: boolean;\n}\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n DropdownMenuSubTriggerElement,\n DropdownMenuSubTriggerProps\n>(({ children, className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n 'focus:bg-accent data-[state=open]:bg-accent flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm focus:outline-none',\n inset && 'pl-8',\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n));\n\nDropdownMenuSubTrigger.displayName =\n DropdownMenuPrimitive.SubTrigger.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSubContent\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuSubContentProps =\n DropdownMenuPrimitive.DropdownMenuSubContentProps;\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n DropdownMenuSubContentProps\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-32 rounded-md border p-1 shadow-md',\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\n\nDropdownMenuSubContent.displayName =\n DropdownMenuPrimitive.SubContent.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuContent\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuContentElement = React.ElementRef<\n typeof DropdownMenuPrimitive.Content\n>;\ntype DropdownMenuContentProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.Content\n>;\n\nconst DropdownMenuContent = React.forwardRef<\n DropdownMenuContentElement,\n DropdownMenuContentProps\n>(({ className, sideOffset = 6, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-32 rounded-md border p-1 shadow-md',\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\n\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuItem\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuItemElement = React.ElementRef<\n typeof DropdownMenuPrimitive.Item\n>;\n\ninterface DropdownMenuItemProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> {\n inset?: boolean;\n}\n\nconst DropdownMenuItem = React.forwardRef<\n DropdownMenuItemElement,\n DropdownMenuItemProps\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm transition focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50',\n inset && 'pl-8',\n className,\n )}\n {...props}\n />\n));\n\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuCheckboxItem\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuCheckboxItemElement = React.ElementRef<\n typeof DropdownMenuPrimitive.CheckboxItem\n>;\ntype DropdownMenuCheckboxItemProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.CheckboxItem\n>;\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n DropdownMenuCheckboxItemElement,\n DropdownMenuCheckboxItemProps\n>(({ children, className, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm transition focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50',\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n));\n\nDropdownMenuCheckboxItem.displayName =\n DropdownMenuPrimitive.CheckboxItem.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuRadioItem\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuRadioItemElement = React.ElementRef<\n typeof DropdownMenuPrimitive.RadioItem\n>;\ntype DropdownMenuRadioItemProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.RadioItem\n>;\n\nconst DropdownMenuRadioItem = React.forwardRef<\n DropdownMenuRadioItemElement,\n DropdownMenuRadioItemProps\n>(({ children, className, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm transition focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50',\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <DotFilledIcon className=\"size-4 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n));\n\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuLabel\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuLabelElement = React.ElementRef<\n typeof DropdownMenuPrimitive.Label\n>;\n\ninterface DropdownMenuLabelProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> {\n inset?: boolean;\n}\n\nconst DropdownMenuLabel = React.forwardRef<\n DropdownMenuLabelElement,\n DropdownMenuLabelProps\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\n 'px-2 py-1.5 text-sm font-semibold',\n inset && 'pl-8',\n className,\n )}\n {...props}\n />\n));\n\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSeparator\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuSeparatorElement = React.ElementRef<\n typeof DropdownMenuPrimitive.Separator\n>;\ntype DropdownMenuSeparatorProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.Separator\n>;\n\nconst DropdownMenuSeparator = React.forwardRef<\n DropdownMenuSeparatorElement,\n DropdownMenuSeparatorProps\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn('bg-muted -mx-1 my-1 h-px', className)}\n {...props}\n />\n));\n\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuShortcut\n * -------------------------------------------------------------------------- */\n\ntype DropdownMenuShortcutProps = React.HTMLAttributes<HTMLSpanElement>;\n\nfunction DropdownMenuShortcut({\n className,\n ...props\n}: DropdownMenuShortcutProps): React.JSX.Element {\n return (\n <span\n className={cn('ml-auto text-xs tracking-widest opacity-60', className)}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n type DropdownMenuProps,\n type DropdownMenuTriggerProps,\n type DropdownMenuContentProps,\n type DropdownMenuItemProps,\n type DropdownMenuCheckboxItemProps,\n type DropdownMenuRadioItemProps,\n type DropdownMenuLabelProps,\n type DropdownMenuSeparatorProps,\n type DropdownMenuShortcutProps,\n type DropdownMenuGroupProps,\n type DropdownMenuSubProps,\n type DropdownMenuSubContentProps,\n type DropdownMenuSubTriggerProps,\n type DropdownMenuRadioGroupProps,\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/react/spinner.tsx"],"sourcesContent":["import * as React from 'react';\nimport { VisuallyHidden } from '@radix-ui/react-visually-hidden';\nimport { cn } from '../lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Component: Spinner\n * -------------------------------------------------------------------------- */\n\nconst spinnerCount = 8;\n\ntype SpinnerElement = HTMLSpanElement;\n\ninterface SpinnerProps extends React.HTMLAttributes<HTMLSpanElement> {\n loading?: boolean;\n}\n\nconst Spinner = React.forwardRef<SpinnerElement, SpinnerProps>(\n ({ children, className, loading = true, ...props }, ref) => {\n if (!loading) {\n return children;\n }\n\n const spinner = (\n <span\n ref={ref}\n className={cn(\n 'relative flex size-4 items-center justify-center opacity-60',\n className,\n )}\n {...props}\n >\n {Array.from({ length: spinnerCount }, (_, i) => (\n <span\n key={i}\n className=\"before:fade-out-25 before:animate-out before:animate-repeat-infinite before:animate-delay-[var(--spinner-delay)] before:animate-duration-[var(--spinner-duration)] absolute h-full rotate-[var(--spinner-rotate)] before:block before:h-1/3 before:w-full before:rounded-full before:bg-current\"\n style={\n {\n width: `${(100 / spinnerCount).toString()}%`,\n '--spinner-delay': `-${((spinnerCount - i) * 100).toString()}ms`,\n '--spinner-rotate': `${((360 / spinnerCount) * i).toString()}deg`,\n '--spinner-duration': `${(spinnerCount * 100).toString()}ms`,\n } as React.CSSProperties\n }\n />\n ))}\n </span>\n );\n\n if (children === undefined) {\n return spinner;\n }\n\n return (\n <span className=\"relative\">\n <span aria-hidden className=\"invisible contents\">\n {children}\n </span>\n <VisuallyHidden>{children}</VisuallyHidden>\n <span className=\"absolute inset-0 flex items-center justify-center\">\n {spinner}\n </span>\n </span>\n );\n },\n);\n\nSpinner.displayName = 'Spinner';\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Spinner, type SpinnerProps };\n"],"mappings":"yCAAA,UAAYA,MAAW,QACvB,OAAS,kBAAAC,MAAsB,kCA+BrB,cAAAC,EAqBJ,QAAAC,MArBI,oBAxBV,IAAMC,EAAe,EAQfC,EAAgB,aACpB,CAAC,CAAE,SAAAC,EAAU,UAAAC,EAAW,QAAAC,EAAU,GAAM,GAAGC,CAAM,EAAGC,IAAQ,CAC1D,GAAI,CAACF,EACH,OAAOF,EAGT,IAAMK,EACJT,EAAC,QACC,IAAKQ,EACL,UAAWE,EACT,8DACAL,CACF,EACC,GAAGE,EAEH,eAAM,KAAK,CAAE,OAAQL,CAAa,EAAG,CAACS,EAAGC,IACxCZ,EAAC,QAEC,UAAU,kSACV,MACE,CACE,MAAO,IAAI,IAAME,GAAc,SAAS,CAAC,IACzC,kBAAmB,MAAMA,EAAeU,GAAK,KAAK,SAAS,CAAC,KAC5D,mBAAoB,IAAK,IAAMV,EAAgBU,GAAG,SAAS,CAAC,MAC5D,qBAAsB,IAAIV,EAAe,KAAK,SAAS,CAAC,IAC1D,GARGU,CAUP,CACD,EACH,EAGF,OAAIR,IAAa,OACRK,EAIPR,EAAC,QAAK,UAAU,WACd,UAAAD,EAAC,QAAK,cAAW,GAAC,UAAU,qBACzB,SAAAI,EACH,EACAJ,EAACa,EAAA,CAAgB,SAAAT,EAAS,EAC1BJ,EAAC,QAAK,UAAU,oDACb,SAAAS,EACH,GACF,CAEJ,CACF,EAEAN,EAAQ,YAAc","names":["React","VisuallyHidden","jsx","jsxs","spinnerCount","Spinner","children","className","loading","props","ref","spinner","cn","_","i","VisuallyHidden"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/react/dialog.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { Cross2Icon } from '@radix-ui/react-icons';\nimport { cn } from '../lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Component: Dialog\n * -------------------------------------------------------------------------- */\n\ntype DialogProps = React.ComponentProps<typeof DialogPrimitive.Root>;\nconst Dialog = DialogPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: DialogTrigger\n * -------------------------------------------------------------------------- */\n\ntype DialogTriggerProps = React.ComponentPropsWithoutRef<\n typeof DialogPrimitive.Trigger\n>;\nconst DialogTrigger = DialogPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: DialogClose\n * -------------------------------------------------------------------------- */\n\ntype DialogCloseProps = React.ComponentPropsWithoutRef<\n typeof DialogPrimitive.Close\n>;\nconst DialogClose = DialogPrimitive.Close;\n\n/* -----------------------------------------------------------------------------\n * Component: DialogContent\n * -------------------------------------------------------------------------- */\n\ntype DialogContentElement = React.ElementRef<typeof DialogPrimitive.Content>;\ntype DialogContentProps = React.ComponentPropsWithoutRef<\n typeof DialogPrimitive.Content\n>;\n\nconst DialogContent = React.forwardRef<\n DialogContentElement,\n DialogContentProps\n>(({ children, className, ...props }, ref) => (\n <DialogPrimitive.Portal>\n <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\" />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n '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',\n className,\n )}\n {...props}\n >\n {children}\n <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\">\n <Cross2Icon className=\"size-4\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n));\n\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DialogHeader\n * -------------------------------------------------------------------------- */\n\ntype DialogHeaderProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction DialogHeader({\n className,\n ...props\n}: DialogHeaderProps): React.JSX.Element {\n return (\n <div\n className={cn(\n 'flex flex-col space-y-1.5 text-center sm:text-left',\n className,\n )}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DialogFooter\n * -------------------------------------------------------------------------- */\n\ntype DialogFooterProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction DialogFooter({\n className,\n ...props\n}: DialogFooterProps): React.JSX.Element {\n return (\n <div\n className={cn(\n 'flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2',\n className,\n )}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DialogTitle\n * -------------------------------------------------------------------------- */\n\ntype DialogTitleElement = React.ElementRef<typeof DialogPrimitive.Title>;\ntype DialogTitleProps = React.ComponentPropsWithoutRef<\n typeof DialogPrimitive.Title\n>;\n\nconst DialogTitle = React.forwardRef<DialogTitleElement, DialogTitleProps>(\n ({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn(\n 'text-lg font-semibold leading-none tracking-tight',\n className,\n )}\n {...props}\n />\n ),\n);\n\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DialogDescription\n * -------------------------------------------------------------------------- */\n\ntype DialogDescriptionElement = React.ElementRef<\n typeof DialogPrimitive.Description\n>;\ntype DialogDescriptionProps = React.ComponentPropsWithoutRef<\n typeof DialogPrimitive.Description\n>;\n\nconst DialogDescription = React.forwardRef<\n DialogDescriptionElement,\n DialogDescriptionProps\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn('text-muted-foreground text-sm', className)}\n {...props}\n />\n));\n\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Dialog,\n DialogTrigger,\n DialogClose,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n type DialogProps,\n type DialogTriggerProps,\n type DialogCloseProps,\n type DialogContentProps,\n type DialogHeaderProps,\n type DialogFooterProps,\n type DialogTitleProps,\n type DialogDescriptionProps,\n};\n"],"mappings":"yCAEA,UAAYA,MAAW,QACvB,UAAYC,MAAqB,yBACjC,OAAS,cAAAC,MAAkB,wBA0CvB,cAAAC,EAUE,QAAAC,MAVF,oBAlCJ,IAAMC,EAAyB,OASzBC,EAAgC,UAShCC,EAA8B,QAW9BC,EAAsB,aAG1B,CAAC,CAAE,SAAAC,EAAU,UAAAC,EAAW,GAAGC,CAAM,EAAGC,IACpCR,EAAiB,SAAhB,CACC,UAAAD,EAAiB,UAAhB,CAAwB,UAAU,+IAA+I,EAClLC,EAAiB,UAAhB,CACC,IAAKQ,EACL,UAAWC,EACT,yhBACAH,CACF,EACC,GAAGC,EAEH,UAAAF,EACDL,EAAiB,QAAhB,CAAsB,UAAU,0PAC/B,UAAAD,EAACW,EAAA,CAAW,UAAU,SAAS,EAC/BX,EAAC,QAAK,UAAU,UAAU,iBAAK,GACjC,GACF,GACF,CACD,EAEDK,EAAc,YAA8B,UAAQ,YAQpD,SAASO,EAAa,CACpB,UAAAL,EACA,GAAGC,CACL,EAAyC,CACvC,OACER,EAAC,OACC,UAAWU,EACT,qDACAH,CACF,EACC,GAAGC,EACN,CAEJ,CAQA,SAASK,EAAa,CACpB,UAAAN,EACA,GAAGC,CACL,EAAyC,CACvC,OACER,EAAC,OACC,UAAWU,EACT,gEACAH,CACF,EACC,GAAGC,EACN,CAEJ,CAWA,IAAMM,EAAoB,aACxB,CAAC,CAAE,UAAAP,EAAW,GAAGC,CAAM,EAAGC,IACxBT,EAAiB,QAAhB,CACC,IAAKS,EACL,UAAWC,EACT,oDACAH,CACF,EACC,GAAGC,EACN,CAEJ,EAEAM,EAAY,YAA8B,QAAM,YAahD,IAAMC,EAA0B,aAG9B,CAAC,CAAE,UAAAR,EAAW,GAAGC,CAAM,EAAGC,IAC1BT,EAAiB,cAAhB,CACC,IAAKS,EACL,UAAWC,EAAG,gCAAiCH,CAAS,EACvD,GAAGC,EACN,CACD,EAEDO,EAAkB,YAA8B,cAAY","names":["React","DialogPrimitive","Cross2Icon","jsx","jsxs","Dialog","DialogTrigger","DialogClose","DialogContent","children","className","props","ref","cn","Cross2Icon","DialogHeader","DialogFooter","DialogTitle","DialogDescription"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/react/toggle.tsx"],"names":["React","TogglePrimitive","jsx","toggleVariants","cva","Toggle","className","variant","size","props","ref"],"mappings":"wCAEA,UAAYA,MAAW,QACvB,UAAYC,MAAqB,yBAwC7B,cAAAC,MAAA,oBAhCJ,IAAMC,EAAiBC,EAAI,CACzB,KAAM,8TACN,SAAU,CACR,QAAS,CACP,QAAS,iBACT,QACE,2FACJ,EACA,KAAM,CACJ,QAAS,YACT,GAAI,aACJ,GAAI,WACN,CACF,EACA,gBAAiB,CACf,QAAS,UACT,KAAM,SACR,CACF,CAAC,EAYKC,EAAe,aACnB,CAAC,CAAE,UAAAC,EAAW,QAAAC,EAAS,KAAAC,EAAM,GAAGC,CAAM,EAAGC,IACvCR,EAAiB,OAAhB,CACC,IAAKQ,EACL,UAAWP,EAAe,CAAE,QAAAI,EAAS,KAAAC,EAAM,UAAAF,CAAU,CAAC,EACrD,GAAGG,EACN,CAEJ,EAEAJ,EAAO,YAA8B,OAAK","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as TogglePrimitive from '@radix-ui/react-toggle';\nimport { type VariantProps } from 'cva';\nimport { cva } from '../lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Variant: Toggle\n * -------------------------------------------------------------------------- */\n\nconst toggleVariants = cva({\n base: 'hover:bg-muted hover:text-muted-foreground data-[state=on]:bg-accent data-[state=on]:text-accent-foreground inline-flex items-center justify-center rounded-md text-sm font-medium transition focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:pointer-events-none disabled:opacity-50',\n variants: {\n variant: {\n default: 'bg-transparent',\n outline:\n 'border-input hover:bg-accent hover:text-accent-foreground border bg-transparent shadow-sm',\n },\n size: {\n default: 'h-10 px-3',\n sm: 'h-9 px-2.5',\n lg: 'h-11 px-5',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n});\n\ntype ToggleVariantsProps = VariantProps<typeof toggleVariants>;\n\n/* -----------------------------------------------------------------------------\n * Component: Toggle\n * -------------------------------------------------------------------------- */\n\ntype ToggleElement = React.ElementRef<typeof TogglePrimitive.Root>;\ntype ToggleProps = React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> &\n ToggleVariantsProps;\n\nconst Toggle = React.forwardRef<ToggleElement, ToggleProps>(\n ({ className, variant, size, ...props }, ref) => (\n <TogglePrimitive.Root\n ref={ref}\n className={toggleVariants({ variant, size, className })}\n {...props}\n />\n ),\n);\n\nToggle.displayName = TogglePrimitive.Root.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\nexport { Toggle, toggleVariants, type ToggleProps, type ToggleVariantsProps };\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/react/select.tsx"],"names":["React","CaretSortIcon","CheckIcon","ChevronDownIcon","ChevronUpIcon","SelectPrimitive","jsx","jsxs","Select","SelectGroup","SelectValue","SelectTrigger","children","className","props","ref","cn","SelectScrollUpButton","SelectScrollDownButton","SelectContent","position","SelectLabel","SelectItem","SelectSeparator"],"mappings":"wCAEA,UAAYA,MAAW,QACvB,OACE,iBAAAC,EACA,aAAAC,EACA,mBAAAC,EACA,iBAAAC,MACK,wBACP,UAAYC,MAAqB,yBAyC/B,OAUI,OAAAC,EAVJ,QAAAC,MAAA,oBAjCF,IAAMC,EAAyB,OASzBC,EAA8B,QAS9BC,EAA8B,QAW9BC,EAAsB,aAG1B,CAAC,CAAE,SAAAC,EAAU,UAAAC,EAAW,GAAGC,CAAM,EAAGC,IACpCR,EAAiB,UAAhB,CACC,IAAKQ,EACL,UAAWC,EACT,oVACAH,CACF,EACC,GAAGC,EAEH,UAAAF,EACDN,EAAiB,OAAhB,CAAqB,QAAO,GAC3B,SAAAA,EAACL,EAAA,CAAc,UAAU,oBAAoB,EAC/C,GACF,CACD,EAEDU,EAAc,YAA8B,UAAQ,YAapD,IAAMM,EAA6B,aAGjC,CAAC,CAAE,UAAAJ,EAAW,GAAGC,CAAM,EAAGC,IAC1BT,EAAiB,iBAAhB,CACC,IAAKS,EACL,UAAWC,EACT,uDACAH,CACF,EACC,GAAGC,EAEJ,SAAAR,EAACF,EAAA,EAAc,EACjB,CACD,EAEDa,EAAqB,YAA8B,iBAA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AC,CAAE,UAAAV,EAAW,GAAGC,CAAM,EAAGC,IAC1BT,EAAiB,YAAhB,CACC,IAAKS,EACL,UAAWC,EAAG,2BAA4BH,CAAS,EAClD,GAAGC,EACN,CACD,EAEDS,EAAgB,YAA8B,YAAU","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport {\n CaretSortIcon,\n CheckIcon,\n ChevronDownIcon,\n ChevronUpIcon,\n} from '@radix-ui/react-icons';\nimport * as SelectPrimitive from '@radix-ui/react-select';\nimport { cn } from '../lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Component: Select\n * -------------------------------------------------------------------------- */\n\ntype SelectProps = React.ComponentProps<typeof SelectPrimitive.Root>;\nconst Select = SelectPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectGroup\n * -------------------------------------------------------------------------- */\n\ntype SelectGroupProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Group\n>;\nconst SelectGroup = SelectPrimitive.Group;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectValue\n * -------------------------------------------------------------------------- */\n\ntype SelectValueProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Value\n>;\nconst SelectValue = SelectPrimitive.Value;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectTrigger\n * -------------------------------------------------------------------------- */\n\ntype SelectTriggerElement = React.ElementRef<typeof SelectPrimitive.Trigger>;\ntype SelectTriggerProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Trigger\n>;\n\nconst SelectTrigger = React.forwardRef<\n SelectTriggerElement,\n SelectTriggerProps\n>(({ children, className, ...props }, ref) => (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n 'border-input placeholder:text-muted-foreground flex h-10 w-full items-center justify-between gap-2 whitespace-nowrap rounded-md border bg-transparent px-3 text-sm shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 [&>span]:truncate',\n className,\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <CaretSortIcon className=\"size-4 opacity-50\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n));\n\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectScrollUpButton\n * -------------------------------------------------------------------------- */\n\ntype SelectScrollUpButtonElement = React.ElementRef<\n typeof SelectPrimitive.ScrollUpButton\n>;\ntype SelectScrollUpButtonProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.ScrollUpButton\n>;\n\nconst SelectScrollUpButton = React.forwardRef<\n SelectScrollUpButtonElement,\n SelectScrollUpButtonProps\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollUpButton\n ref={ref}\n className={cn(\n 'flex cursor-pointer items-center justify-center py-1',\n className,\n )}\n {...props}\n >\n <ChevronUpIcon />\n </SelectPrimitive.ScrollUpButton>\n));\n\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectScrollDownButton\n * -------------------------------------------------------------------------- */\n\ntype SelectScrollDownButtonElement = React.ElementRef<\n typeof SelectPrimitive.ScrollDownButton\n>;\ntype SelectScrollDownButtonProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.ScrollDownButton\n>;\n\nconst SelectScrollDownButton = React.forwardRef<\n SelectScrollDownButtonElement,\n SelectScrollDownButtonProps\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollDownButton\n ref={ref}\n className={cn(\n 'flex cursor-pointer items-center justify-center py-1',\n className,\n )}\n {...props}\n >\n <ChevronDownIcon />\n </SelectPrimitive.ScrollDownButton>\n));\n\nSelectScrollDownButton.displayName =\n SelectPrimitive.ScrollDownButton.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectContent\n * -------------------------------------------------------------------------- */\n\ntype SelectContentElement = React.ElementRef<typeof SelectPrimitive.Content>;\ntype SelectContentProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Content\n>;\n\nconst SelectContent = React.forwardRef<\n SelectContentElement,\n SelectContentProps\n>(({ children, className, position = 'popper', ...props }, ref) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n className={cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=open]:fade-in data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border shadow-md',\n position === 'popper' &&\n 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',\n className,\n )}\n position={position}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n 'p-1',\n position === 'popper' &&\n 'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]',\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n));\n\nSelectContent.displayName = SelectPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectLabel\n * -------------------------------------------------------------------------- */\n\ntype SelectLabelElement = React.ElementRef<typeof SelectPrimitive.Label>;\ntype SelectLabelProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Label\n>;\n\nconst SelectLabel = React.forwardRef<SelectLabelElement, SelectLabelProps>(\n ({ className, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={cn('px-2 py-1.5 text-sm font-semibold', className)}\n {...props}\n />\n ),\n);\n\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectItem\n * -------------------------------------------------------------------------- */\n\ntype SelectItemElement = React.ElementRef<typeof SelectPrimitive.Item>;\ntype SelectItemProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Item\n>;\n\nconst SelectItem = React.forwardRef<SelectItemElement, SelectItemProps>(\n ({ children, className, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50',\n className,\n )}\n {...props}\n >\n <span className=\"absolute right-2 flex size-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n ),\n);\n\nSelectItem.displayName = SelectPrimitive.Item.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectSeparator\n * -------------------------------------------------------------------------- */\n\ntype SelectSeparatorElement = React.ElementRef<\n typeof SelectPrimitive.Separator\n>;\ntype SelectSeparatorProps = React.ComponentPropsWithoutRef<\n typeof SelectPrimitive.Separator\n>;\n\nconst SelectSeparator = React.forwardRef<\n SelectSeparatorElement,\n SelectSeparatorProps\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn('bg-muted -mx-1 my-1 h-px', className)}\n {...props}\n />\n));\n\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Select,\n SelectGroup,\n SelectValue,\n SelectTrigger,\n SelectContent,\n SelectLabel,\n SelectItem,\n SelectSeparator,\n SelectScrollUpButton,\n SelectScrollDownButton,\n type SelectProps,\n type SelectGroupProps,\n type SelectValueProps,\n type SelectTriggerProps,\n type SelectContentProps,\n type SelectLabelProps,\n type SelectItemProps,\n type SelectSeparatorProps,\n type SelectScrollUpButtonProps,\n type SelectScrollDownButtonProps,\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/react/checkbox-group.primitive.tsx"],"names":["React","CheckboxPrimitive","createCheckboxScope","createContextScope","RovingFocusGroup","createRovingFocusGroupScope","useControllableState","useDirection","Primitive","jsx","CHECKBOX_GROUP_NAME","createCheckboxGroupContext","createCheckboxGroupScope","useRovingFocusGroupScope","useCheckboxScope","CheckboxGroupProvider","useCheckboxGroupContext","CheckboxGroup","__scopeCheckboxGroup","name","defaultValue","valueProp","required","disabled","orientation","dir","loop","onValueChange","props","ref","rovingFocusGroupScope","direction","value","setValue","handleItemCheck","itemValue","prevValue","handleItemUncheck","val","ITEM_NAME","CheckboxGroupItem","context","isDisabled","checkboxScope","checked","checkedState","INDICATOR_NAME","CheckboxGroupIndicator","Root","Item","Indicator"],"mappings":"AAAA,UAAYA,MAAW,QACvB,UAAYC,MAAuB,2BACnC,OAAS,uBAAAC,MAA2B,2BACpC,OAAS,sBAAAC,MAAsC,0BAC/C,UAAYC,MAAsB,+BAClC,OAAS,+BAAAC,MAAmC,+BAC5C,OAAS,wBAAAC,MAA4B,yCACrC,OAAS,gBAAAC,MAAoB,4BAC7B,OAAS,aAAAC,MAAiB,4BAiHhB,cAAAC,MAAA,oBA3GV,IAAMC,EAAsB,gBAItB,CAACC,EAA4BC,CAAwB,EACzDT,EAAmBO,EAAqB,CACtCL,EACAH,CACF,CAAC,EAEGW,EAA2BR,EAA4B,EACvDS,EAAmBZ,EAAoB,EAWvC,CAACa,EAAuBC,CAAuB,EACnDL,EAAsDD,CAAmB,EAqBrEO,EAAsB,aAI1B,CACE,CACE,qBAAAC,EACA,KAA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EAAM,KAAK,EAEnD,OACEnB,EAAkB,OAAjB,CACC,QAAO,GACN,GAAGqB,EACJ,UAAW,CAACY,EACZ,OAAQE,EAER,SAAAnC,EAAmB,OAAlB,CACC,IAAKoB,EACL,KAAMY,EAAQ,KACd,SAAUC,EACV,SAAUD,EAAQ,SAClB,QAASG,EACR,GAAGD,EACH,GAAGf,EACJ,gBAAkBiB,GAAiB,CAC7BA,EACFJ,EAAQ,YAAYb,EAAM,KAAK,EAE/Ba,EAAQ,cAAcb,EAAM,KAAK,CAErC,EACF,EACF,CAEJ,CACF,EAEAY,EAAkB,YAAcD,EAMhC,IAAMO,EAAiB,GAAGpC,CAAmB,YASvCqC,EAA+B,aAInC,CACE,CACE,qBAAA7B,EACA,GAAGU,CACL,EACAC,IACG,CACH,IAAMc,EAAgB7B,EAAiBI,CAAoB,EAE3D,OACET,EAAmB,YAAlB,CAA4B,IAAKoB,EAAM,GAAGc,EAAgB,GAAGf,EAAO,CAEzE,CACF,EAEAmB,EAAuB,YAAcD,EAMrC,IAAME,EAAO/B,EACPgC,EAAOT,EACPU,EAAYH","sourcesContent":["import * as React from 'react';\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox';\nimport { createCheckboxScope } from '@radix-ui/react-checkbox';\nimport { createContextScope, type Scope } from '@radix-ui/react-context';\nimport * as RovingFocusGroup from '@radix-ui/react-roving-focus';\nimport { createRovingFocusGroupScope } from '@radix-ui/react-roving-focus';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { useDirection } from '@radix-ui/react-direction';\nimport { Primitive } from '@radix-ui/react-primitive';\n\n/* -------------------------------------------------------------------------------------------------\n * Component: CheckboxGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst CHECKBOX_GROUP_NAME = 'CheckboxGroup';\n\ntype ScopedProps<P> = P & { __scopeCheckboxGroup?: Scope };\n\nconst [createCheckboxGroupContext, createCheckboxGroupScope] =\n createContextScope(CHECKBOX_GROUP_NAME, [\n createRovingFocusGroupScope,\n createCheckboxScope,\n ]);\n\nconst useRovingFocusGroupScope = createRovingFocusGroupScope();\nconst useCheckboxScope = createCheckboxScope();\n\ninterface CheckboxGroupContextValue {\n name?: string;\n required: boolean;\n disabled: boolean;\n value?: string[];\n onItemCheck: (value: string) => void;\n onItemUncheck: (value: string) => void;\n}\n\nconst [CheckboxGroupProvider, useCheckboxGroupContext] =\n createCheckboxGroupContext<CheckboxGroupContextValue>(CHECKBOX_GROUP_NAME);\n\ntype CheckboxGroupElement = React.ElementRef<typeof Primitive.div>;\n\ninterface CheckboxGroupProps\n extends React.ComponentPropsWithoutRef<typeof Primitive.div> {\n name?: CheckboxGroupContextValue['name'];\n required?: React.ComponentPropsWithoutRef<\n typeof CheckboxPrimitive.Root\n >['required'];\n disabled?: React.ComponentPropsWithoutRef<\n typeof CheckboxPrimitive.Root\n >['disabled'];\n dir?: RovingFocusGroup.RovingFocusGroupProps['dir'];\n orientation?: RovingFocusGroup.RovingFocusGroupProps['orientation'];\n loop?: RovingFocusGroup.RovingFocusGroupProps['loop'];\n defaultValue?: string[];\n value?: CheckboxGroupContextValue['value'];\n onValueChange?: (value: string[]) => void;\n}\n\nconst CheckboxGroup = React.forwardRef<\n CheckboxGroupElement,\n CheckboxGroupProps\n>(\n (\n {\n __scopeCheckboxGroup,\n name,\n defaultValue,\n value: valueProp,\n required = false,\n disabled = false,\n orientation,\n dir,\n loop = true,\n onValueChange,\n ...props\n }: ScopedProps<CheckboxGroupProps>,\n ref,\n ) => {\n const rovingFocusGroupScope =\n useRovingFocusGroupScope(__scopeCheckboxGroup);\n const direction = useDirection(dir);\n const [value = [], setValue] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue,\n onChange: onValueChange,\n });\n\n const handleItemCheck = React.useCallback(\n (itemValue: string) => {\n setValue((prevValue = []) => [...prevValue, itemValue]);\n },\n [setValue],\n );\n\n const handleItemUncheck = React.useCallback(\n (itemValue: string) => {\n setValue((prevValue = []) =>\n prevValue.filter((val) => val !== itemValue),\n );\n },\n [setValue],\n );\n\n return (\n <CheckboxGroupProvider\n scope={__scopeCheckboxGroup}\n name={name}\n required={required}\n disabled={disabled}\n value={value}\n onItemCheck={handleItemCheck}\n onItemUncheck={handleItemUncheck}\n >\n <RovingFocusGroup.Root\n asChild\n {...rovingFocusGroupScope}\n orientation={orientation}\n dir={direction}\n loop={loop}\n >\n {/* eslint-disable-next-line react/jsx-pascal-case -- radix-ui */}\n <Primitive.div\n ref={ref}\n role=\"group\"\n data-disabled={disabled ? '' : undefined}\n dir={direction}\n {...props}\n />\n </RovingFocusGroup.Root>\n </CheckboxGroupProvider>\n );\n },\n);\n\nCheckboxGroup.displayName = CHECKBOX_GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * Component: CheckboxGroupItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = `${CHECKBOX_GROUP_NAME}Item`;\n\ntype CheckboxGroupItemElement = React.ElementRef<typeof CheckboxPrimitive.Root>;\n\ninterface CheckboxGroupItemProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>,\n 'checked' | 'defaultChecked' | 'onCheckedChange' | 'name'\n > {\n value: string;\n}\n\nconst CheckboxGroupItem = React.forwardRef<\n CheckboxGroupItemElement,\n CheckboxGroupItemProps\n>(\n (\n {\n __scopeCheckboxGroup,\n disabled,\n ...props\n }: ScopedProps<CheckboxGroupItemProps>,\n ref,\n ) => {\n const context = useCheckboxGroupContext(ITEM_NAME, __scopeCheckboxGroup);\n const isDisabled = context.disabled || disabled;\n const rovingFocusGroupScope =\n useRovingFocusGroupScope(__scopeCheckboxGroup);\n const checkboxScope = useCheckboxScope(__scopeCheckboxGroup);\n const checked = context.value?.includes(props.value);\n\n return (\n <RovingFocusGroup.Item\n asChild\n {...rovingFocusGroupScope}\n focusable={!isDisabled}\n active={checked}\n >\n <CheckboxPrimitive.Root\n ref={ref}\n name={context.name}\n disabled={isDisabled}\n required={context.required}\n checked={checked}\n {...checkboxScope}\n {...props}\n onCheckedChange={(checkedState) => {\n if (checkedState) {\n context.onItemCheck(props.value);\n } else {\n context.onItemUncheck(props.value);\n }\n }}\n />\n </RovingFocusGroup.Item>\n );\n },\n);\n\nCheckboxGroupItem.displayName = ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * Component: CheckboxGroupIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = `${CHECKBOX_GROUP_NAME}Indicator`;\n\ntype CheckboxGroupIndicatorElement = React.ElementRef<\n typeof CheckboxPrimitive.Indicator\n>;\ntype CheckboxGroupIndicatorProps = React.ComponentPropsWithoutRef<\n typeof CheckboxPrimitive.Indicator\n>;\n\nconst CheckboxGroupIndicator = React.forwardRef<\n CheckboxGroupIndicatorElement,\n CheckboxGroupIndicatorProps\n>(\n (\n {\n __scopeCheckboxGroup,\n ...props\n }: ScopedProps<CheckboxGroupIndicatorProps>,\n ref,\n ) => {\n const checkboxScope = useCheckboxScope(__scopeCheckboxGroup);\n\n return (\n <CheckboxPrimitive.Indicator ref={ref} {...checkboxScope} {...props} />\n );\n },\n);\n\nCheckboxGroupIndicator.displayName = INDICATOR_NAME;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nconst Root = CheckboxGroup;\nconst Item = CheckboxGroupItem;\nconst Indicator = CheckboxGroupIndicator;\n\nexport {\n createCheckboxGroupScope,\n CheckboxGroup,\n CheckboxGroupItem,\n CheckboxGroupIndicator,\n Root,\n Item,\n Indicator,\n type CheckboxGroupProps,\n type CheckboxGroupItemProps,\n type CheckboxGroupIndicatorProps,\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/react/dialog.tsx"],"names":["React","DialogPrimitive","Cross2Icon","jsx","jsxs","Dialog","DialogTrigger","DialogClose","DialogContent","children","className","props","ref","cn","DialogHeader","DialogFooter","DialogTitle","DialogDescription"],"mappings":"wCAEA,UAAYA,MAAW,QACvB,UAAYC,MAAqB,yBACjC,OAAS,cAAAC,MAAkB,wBA0CvB,cAAAC,EAUE,QAAAC,MAVF,oBAlCJ,IAAMC,EAAyB,OASzBC,EAAgC,UAShCC,EAA8B,QAW9BC,EAAsB,aAG1B,CAAC,CAAE,SAAAC,EAAU,UAAAC,EAAW,GAAGC,CAAM,EAAGC,IACpCR,EAAiB,SAAhB,CACC,UAAAD,EAAiB,UAAhB,CAAwB,UAAU,+IAA+I,EAClLC,EAAiB,UAAhB,CACC,IAAKQ,EACL,UAAWC,EACT,yhBACAH,CACF,EACC,GAAGC,EAEH,UAAAF,EACDL,EAAiB,QAAhB,CAAsB,UAAU,0PAC/B,UAAAD,EAACD,EAAA,CAAW,UAAU,SAAS,EAC/BC,EAAC,QAAK,UAAU,UAAU,iBAAK,GACjC,GACF,GACF,CACD,EAEDK,EAAc,YAA8B,UAAQ,YAQpD,SAASM,EAAa,CACpB,UAAAJ,EACA,GAAGC,CACL,EAAyC,CACvC,OACER,EAAC,OACC,UAAWU,EACT,qDACAH,CACF,EACC,GAAGC,EACN,CAEJ,CAQA,SAASI,EAAa,CACpB,UAAAL,EACA,GAAGC,CACL,EAAyC,CACvC,OACER,EAAC,OACC,UAAWU,EACT,gEACAH,CACF,EACC,GAAGC,EACN,CAEJ,CAWA,IAAMK,EAAoB,aACxB,CAAC,CAAE,UAAAN,EAAW,GAAGC,CAAM,EAAGC,IACxBT,EAAiB,QAAhB,CACC,IAAKS,EACL,UAAWC,EACT,oDACAH,CACF,EACC,GAAGC,EACN,CAEJ,EAEAK,EAAY,YAA8B,QAAM,YAahD,IAAMC,EAA0B,aAG9B,CAAC,CAAE,UAAAP,EAAW,GAAGC,CAAM,EAAGC,IAC1BT,EAAiB,cAAhB,CACC,IAAKS,EACL,UAAWC,EAAG,gCAAiCH,CAAS,EACvD,GAAGC,EACN,CACD,EAEDM,EAAkB,YAA8B,cAAY","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { Cross2Icon } from '@radix-ui/react-icons';\nimport { cn } from '../lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Component: Dialog\n * -------------------------------------------------------------------------- */\n\ntype DialogProps = React.ComponentProps<typeof DialogPrimitive.Root>;\nconst Dialog = DialogPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: DialogTrigger\n * -------------------------------------------------------------------------- */\n\ntype DialogTriggerProps = React.ComponentPropsWithoutRef<\n typeof DialogPrimitive.Trigger\n>;\nconst DialogTrigger = DialogPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: DialogClose\n * -------------------------------------------------------------------------- */\n\ntype DialogCloseProps = React.ComponentPropsWithoutRef<\n typeof DialogPrimitive.Close\n>;\nconst DialogClose = DialogPrimitive.Close;\n\n/* -----------------------------------------------------------------------------\n * Component: DialogContent\n * -------------------------------------------------------------------------- */\n\ntype DialogContentElement = React.ElementRef<typeof DialogPrimitive.Content>;\ntype DialogContentProps = React.ComponentPropsWithoutRef<\n typeof DialogPrimitive.Content\n>;\n\nconst DialogContent = React.forwardRef<\n DialogContentElement,\n DialogContentProps\n>(({ children, className, ...props }, ref) => (\n <DialogPrimitive.Portal>\n <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\" />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n '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',\n className,\n )}\n {...props}\n >\n {children}\n <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\">\n <Cross2Icon className=\"size-4\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n));\n\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DialogHeader\n * -------------------------------------------------------------------------- */\n\ntype DialogHeaderProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction DialogHeader({\n className,\n ...props\n}: DialogHeaderProps): React.JSX.Element {\n return (\n <div\n className={cn(\n 'flex flex-col space-y-1.5 text-center sm:text-left',\n className,\n )}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DialogFooter\n * -------------------------------------------------------------------------- */\n\ntype DialogFooterProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction DialogFooter({\n className,\n ...props\n}: DialogFooterProps): React.JSX.Element {\n return (\n <div\n className={cn(\n 'flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2',\n className,\n )}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DialogTitle\n * -------------------------------------------------------------------------- */\n\ntype DialogTitleElement = React.ElementRef<typeof DialogPrimitive.Title>;\ntype DialogTitleProps = React.ComponentPropsWithoutRef<\n typeof DialogPrimitive.Title\n>;\n\nconst DialogTitle = React.forwardRef<DialogTitleElement, DialogTitleProps>(\n ({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn(\n 'text-lg font-semibold leading-none tracking-tight',\n className,\n )}\n {...props}\n />\n ),\n);\n\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DialogDescription\n * -------------------------------------------------------------------------- */\n\ntype DialogDescriptionElement = React.ElementRef<\n typeof DialogPrimitive.Description\n>;\ntype DialogDescriptionProps = React.ComponentPropsWithoutRef<\n typeof DialogPrimitive.Description\n>;\n\nconst DialogDescription = React.forwardRef<\n DialogDescriptionElement,\n DialogDescriptionProps\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn('text-muted-foreground text-sm', className)}\n {...props}\n />\n));\n\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Dialog,\n DialogTrigger,\n DialogClose,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n type DialogProps,\n type DialogTriggerProps,\n type DialogCloseProps,\n type DialogContentProps,\n type DialogHeaderProps,\n type DialogFooterProps,\n type DialogTitleProps,\n type DialogDescriptionProps,\n};\n"]}
|