@foundrykit/primitives 2.0.8 → 2.0.10
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-D4X2ZO5T.js → chunk-2SBGU5XA.js} +2 -2
- package/dist/chunk-3NQR7JZR.js +128 -0
- package/dist/{chunk-3MEIDBWZ.js → chunk-3QUMCM5K.js} +2 -2
- package/dist/chunk-B5YCE3UP.js +57 -0
- package/dist/chunk-F2TEA6ER.js +138 -0
- package/dist/{chunk-5OSYIETI.js → chunk-FRIOQFPE.js} +1 -1
- package/dist/{chunk-EDKSYP4L.js → chunk-G2YBCHWR.js} +1 -1
- package/dist/{chunk-DKBMAFIR.js → chunk-GKCBSG2W.js} +2 -0
- package/dist/chunk-HS46TIMU.js +75 -0
- package/dist/{chunk-R3IEOV2B.js → chunk-P5KEJOBH.js} +1 -1
- package/dist/{chunk-FIRYLO5W.js → chunk-SDYKJVXX.js} +2 -2
- package/dist/chunk-SIQHWNPH.js +45 -0
- package/dist/{chunk-2PXD7LAX.js → chunk-U7JIOR7A.js} +3 -3
- package/dist/{chunk-VA4MKQN7.js → chunk-W4XY3SNY.js} +1 -1
- package/dist/chunk-XCPGTXEJ.js +23 -0
- package/dist/components/alert-dialog/index.cjs +1 -1
- package/dist/components/alert-dialog/index.js +1 -1
- package/dist/components/card/index.cjs +63 -61
- package/dist/components/card/index.d.cts +8 -7
- package/dist/components/card/index.d.ts +8 -7
- package/dist/components/card/index.js +1 -1
- package/dist/components/context-menu/index.cjs +2 -2
- package/dist/components/context-menu/index.js +1 -1
- package/dist/components/dialog/index.cjs +182 -0
- package/dist/components/dialog/index.d.cts +38 -0
- package/dist/components/dialog/index.d.ts +38 -0
- package/dist/components/dialog/index.js +25 -0
- package/dist/components/dropdown/index.cjs +2 -2
- package/dist/components/dropdown/index.js +1 -1
- package/dist/components/hover-card/index.cjs +1 -1
- package/dist/components/hover-card/index.js +1 -1
- package/dist/components/input/index.cjs +16 -28
- package/dist/components/input/index.d.cts +6 -5
- package/dist/components/input/index.d.ts +6 -5
- package/dist/components/input/index.js +1 -1
- package/dist/components/input-group/index.cjs +270 -0
- package/dist/components/input-group/index.d.cts +44 -0
- package/dist/components/input-group/index.d.ts +44 -0
- package/dist/components/input-group/index.js +153 -0
- package/dist/components/menubar/index.cjs +2 -2
- package/dist/components/menubar/index.js +1 -1
- package/dist/components/navigation-menu/index.cjs +3 -3
- package/dist/components/navigation-menu/index.js +1 -1
- package/dist/components/popover/index.cjs +1 -1
- package/dist/components/popover/index.js +1 -1
- package/dist/components/select/index.cjs +1 -1
- package/dist/components/select/index.js +1 -1
- package/dist/components/sheet/index.cjs +170 -0
- package/dist/components/sheet/index.d.cts +31 -0
- package/dist/components/sheet/index.d.ts +31 -0
- package/dist/components/sheet/index.js +21 -0
- package/dist/components/slider/index.cjs +2 -0
- package/dist/components/slider/index.d.cts +3 -2
- package/dist/components/slider/index.d.ts +3 -2
- package/dist/components/slider/index.js +1 -1
- package/dist/components/toggle/index.cjs +81 -0
- package/dist/components/toggle/index.d.cts +26 -0
- package/dist/components/toggle/index.d.ts +26 -0
- package/dist/components/toggle/index.js +9 -0
- package/dist/components/tooltip/index.cjs +95 -0
- package/dist/components/tooltip/index.d.cts +25 -0
- package/dist/components/tooltip/index.d.ts +25 -0
- package/dist/components/tooltip/index.js +13 -0
- package/dist/index.cjs +107 -95
- package/dist/index.d.cts +11 -105
- package/dist/index.d.ts +11 -105
- package/dist/index.js +108 -414
- package/package.json +200 -8
- package/.turbo/turbo-build.log +0 -235
- package/.turbo/turbo-type-check.log +0 -4
- package/CHANGELOG.md +0 -224
- package/dist/chunk-DFGLEAZI.js +0 -63
- package/dist/chunk-RDQF3IQE.js +0 -25
- package/postcss.config.mjs +0 -6
- package/registry.json +0 -64
- package/src/components/accordion/config.ts +0 -28
- package/src/components/accordion/index.tsx +0 -80
- package/src/components/alert/config.ts +0 -40
- package/src/components/alert/index.tsx +0 -80
- package/src/components/alert-dialog/config.ts +0 -28
- package/src/components/alert-dialog/index.tsx +0 -188
- package/src/components/aspect-ratio/config.ts +0 -27
- package/src/components/aspect-ratio/index.tsx +0 -24
- package/src/components/avatar/config.ts +0 -46
- package/src/components/avatar/index.tsx +0 -67
- package/src/components/badge/config.ts +0 -56
- package/src/components/badge/index.tsx +0 -56
- package/src/components/breadcrumb/config.ts +0 -121
- package/src/components/breadcrumb/index.tsx +0 -127
- package/src/components/button/config.ts +0 -97
- package/src/components/button/index.tsx +0 -86
- package/src/components/button-group/config.ts +0 -39
- package/src/components/button-group/index.tsx +0 -99
- package/src/components/card/config.ts +0 -89
- package/src/components/card/index.tsx +0 -98
- package/src/components/checkbox/config.ts +0 -46
- package/src/components/checkbox/index.tsx +0 -41
- package/src/components/collapsible/config.ts +0 -27
- package/src/components/collapsible/index.tsx +0 -47
- package/src/components/context-menu/config.ts +0 -28
- package/src/components/context-menu/index.tsx +0 -271
- package/src/components/dialog/config.ts +0 -582
- package/src/components/dialog/index.tsx +0 -162
- package/src/components/direction/config.ts +0 -28
- package/src/components/direction/index.tsx +0 -27
- package/src/components/drawer/config.ts +0 -28
- package/src/components/drawer/index.tsx +0 -153
- package/src/components/dropdown/config.ts +0 -262
- package/src/components/dropdown/index.tsx +0 -280
- package/src/components/empty/config.ts +0 -38
- package/src/components/empty/index.tsx +0 -127
- package/src/components/field/config.ts +0 -40
- package/src/components/field/index.tsx +0 -252
- package/src/components/hover-card/config.ts +0 -27
- package/src/components/hover-card/index.tsx +0 -56
- package/src/components/input/config.ts +0 -64
- package/src/components/input/index.tsx +0 -33
- package/src/components/input-group/config.ts +0 -209
- package/src/components/input-group/index.tsx +0 -177
- package/src/components/item/config.ts +0 -52
- package/src/components/item/index.tsx +0 -215
- package/src/components/kbd/config.ts +0 -38
- package/src/components/kbd/index.tsx +0 -40
- package/src/components/label/config.ts +0 -72
- package/src/components/label/index.tsx +0 -32
- package/src/components/menubar/config.ts +0 -28
- package/src/components/menubar/index.tsx +0 -295
- package/src/components/native-select/config.ts +0 -40
- package/src/components/native-select/index.tsx +0 -40
- package/src/components/navigation-menu/config.ts +0 -32
- package/src/components/navigation-menu/index.tsx +0 -188
- package/src/components/popover/config.ts +0 -222
- package/src/components/popover/index.tsx +0 -60
- package/src/components/progress/config.ts +0 -42
- package/src/components/progress/index.tsx +0 -39
- package/src/components/radio-group/config.ts +0 -303
- package/src/components/radio-group/index.tsx +0 -58
- package/src/components/resizable/config.ts +0 -28
- package/src/components/resizable/index.tsx +0 -67
- package/src/components/scroll-area/config.ts +0 -17
- package/src/components/scroll-area/index.tsx +0 -70
- package/src/components/select/config.ts +0 -277
- package/src/components/select/index.tsx +0 -202
- package/src/components/separator/config.ts +0 -63
- package/src/components/separator/index.tsx +0 -38
- package/src/components/sheet/config.ts +0 -16
- package/src/components/sheet/index.tsx +0 -153
- package/src/components/skeleton/config.ts +0 -77
- package/src/components/skeleton/index.tsx +0 -22
- package/src/components/slider/config.ts +0 -46
- package/src/components/slider/index.tsx +0 -73
- package/src/components/sonner/config.ts +0 -27
- package/src/components/sonner/index.tsx +0 -37
- package/src/components/spinner/config.ts +0 -40
- package/src/components/spinner/index.tsx +0 -30
- package/src/components/switch/config.ts +0 -171
- package/src/components/switch/index.tsx +0 -40
- package/src/components/table/config.ts +0 -38
- package/src/components/table/index.tsx +0 -135
- package/src/components/tabs/config.ts +0 -335
- package/src/components/tabs/index.tsx +0 -82
- package/src/components/textarea/config.ts +0 -117
- package/src/components/textarea/index.tsx +0 -26
- package/src/components/toggle/config.ts +0 -67
- package/src/components/toggle/index.tsx +0 -59
- package/src/components/toggle-group/config.ts +0 -46
- package/src/components/toggle-group/index.tsx +0 -106
- package/src/components/tooltip/config.ts +0 -16
- package/src/components/tooltip/index.tsx +0 -75
- package/src/components/typography/config.ts +0 -38
- package/src/components/typography/index.tsx +0 -172
- package/src/index.ts +0 -291
- package/tsconfig.json +0 -9
- package/tsconfig.lint.json +0 -8
- package/tsup.config.ts +0 -55
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { cn } from '@foundrykit/utils';
|
|
4
|
-
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
5
|
-
import { CheckIcon } from 'lucide-react';
|
|
6
|
-
import type * as React from 'react';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Checkbox built on Radix `Checkbox.Root`, rendering a check icon in its
|
|
10
|
-
* indicator when checked. Supports controlled/uncontrolled state, indeterminate,
|
|
11
|
-
* disabled and `aria-invalid` styling via the underlying Radix props.
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* ```tsx
|
|
15
|
-
* <Checkbox checked={value} onCheckedChange={setValue} />
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
function Checkbox({
|
|
19
|
-
className,
|
|
20
|
-
...props
|
|
21
|
-
}: React.ComponentProps<typeof CheckboxPrimitive.Root>) {
|
|
22
|
-
return (
|
|
23
|
-
<CheckboxPrimitive.Root
|
|
24
|
-
data-slot='checkbox'
|
|
25
|
-
className={cn(
|
|
26
|
-
'border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive peer size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50',
|
|
27
|
-
className
|
|
28
|
-
)}
|
|
29
|
-
{...props}
|
|
30
|
-
>
|
|
31
|
-
<CheckboxPrimitive.Indicator
|
|
32
|
-
data-slot='checkbox-indicator'
|
|
33
|
-
className='flex items-center justify-center text-current transition-none'
|
|
34
|
-
>
|
|
35
|
-
<CheckIcon className='size-3.5' />
|
|
36
|
-
</CheckboxPrimitive.Indicator>
|
|
37
|
-
</CheckboxPrimitive.Root>
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export { Checkbox };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { ComponentConfig } from '@foundrykit/types';
|
|
2
|
-
|
|
3
|
-
export const CollapsibleConfig: ComponentConfig = {
|
|
4
|
-
name: 'Collapsible',
|
|
5
|
-
description: 'An interactive component which expands and collapses content.',
|
|
6
|
-
category: 'primitives',
|
|
7
|
-
tags: ['collapsible', 'disclosure', 'interactive'],
|
|
8
|
-
preview: {
|
|
9
|
-
type: 'static',
|
|
10
|
-
html: '<div class="flex h-12 w-full items-center rounded-md border border-gray-300 bg-gray-100 px-3"><span class="text-sm text-gray-600">Collapsible</span></div>',
|
|
11
|
-
},
|
|
12
|
-
variants: [
|
|
13
|
-
{
|
|
14
|
-
name: 'Default',
|
|
15
|
-
description: 'Default collapsible',
|
|
16
|
-
code: '<Collapsible>...</Collapsible>',
|
|
17
|
-
preview: {
|
|
18
|
-
type: 'component',
|
|
19
|
-
component: 'Collapsible',
|
|
20
|
-
props: {},
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
],
|
|
24
|
-
dependencies: ['utils'],
|
|
25
|
-
packageDependencies: ['@radix-ui/react-collapsible'],
|
|
26
|
-
files: ['components/primitives/collapsible/index.tsx'],
|
|
27
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
4
|
-
import type * as React from 'react';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Interactive component that expands and collapses a panel, built on Radix
|
|
8
|
-
* `Collapsible.Root`. Compose with {@link CollapsibleTrigger} and
|
|
9
|
-
* {@link CollapsibleContent}.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```tsx
|
|
13
|
-
* <Collapsible>
|
|
14
|
-
* <CollapsibleTrigger>Toggle</CollapsibleTrigger>
|
|
15
|
-
* <CollapsibleContent>Hidden content</CollapsibleContent>
|
|
16
|
-
* </Collapsible>
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
|
-
function Collapsible({
|
|
20
|
-
...props
|
|
21
|
-
}: React.ComponentProps<typeof CollapsiblePrimitive.Root>) {
|
|
22
|
-
return <CollapsiblePrimitive.Root data-slot='collapsible' {...props} />;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function CollapsibleTrigger({
|
|
26
|
-
...props
|
|
27
|
-
}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {
|
|
28
|
-
return (
|
|
29
|
-
<CollapsiblePrimitive.CollapsibleTrigger
|
|
30
|
-
data-slot='collapsible-trigger'
|
|
31
|
-
{...props}
|
|
32
|
-
/>
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function CollapsibleContent({
|
|
37
|
-
...props
|
|
38
|
-
}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {
|
|
39
|
-
return (
|
|
40
|
-
<CollapsiblePrimitive.CollapsibleContent
|
|
41
|
-
data-slot='collapsible-content'
|
|
42
|
-
{...props}
|
|
43
|
-
/>
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export { Collapsible, CollapsibleContent, CollapsibleTrigger };
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { ComponentConfig } from '@foundrykit/types';
|
|
2
|
-
|
|
3
|
-
export const ContextMenuConfig: ComponentConfig = {
|
|
4
|
-
name: 'Context Menu',
|
|
5
|
-
description:
|
|
6
|
-
'Displays a menu to the user, such as a set of actions or functions, triggered by a right click.',
|
|
7
|
-
category: 'primitives',
|
|
8
|
-
tags: ['context-menu', 'menu', 'overlay', 'interactive'],
|
|
9
|
-
preview: {
|
|
10
|
-
type: 'static',
|
|
11
|
-
html: '<div class="flex h-12 w-full items-center rounded-md border border-gray-300 bg-gray-100 px-3"><span class="text-sm text-gray-600">Context Menu</span></div>',
|
|
12
|
-
},
|
|
13
|
-
variants: [
|
|
14
|
-
{
|
|
15
|
-
name: 'Default',
|
|
16
|
-
description: 'Default context menu',
|
|
17
|
-
code: '<ContextMenu>...</ContextMenu>',
|
|
18
|
-
preview: {
|
|
19
|
-
type: 'component',
|
|
20
|
-
component: 'ContextMenu',
|
|
21
|
-
props: {},
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
],
|
|
25
|
-
dependencies: ['utils'],
|
|
26
|
-
packageDependencies: ['@radix-ui/react-context-menu', 'lucide-react'],
|
|
27
|
-
files: ['components/primitives/context-menu/index.tsx'],
|
|
28
|
-
};
|
|
@@ -1,271 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { cn } from '@foundrykit/utils';
|
|
4
|
-
import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
|
|
5
|
-
import { CheckIcon, ChevronRightIcon, CircleIcon } from 'lucide-react';
|
|
6
|
-
import type * as React from 'react';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Context menu root built on Radix `ContextMenu.Root`, displaying a menu on
|
|
10
|
-
* right-click. Compose with {@link ContextMenuTrigger},
|
|
11
|
-
* {@link ContextMenuContent} and items such as {@link ContextMenuItem},
|
|
12
|
-
* {@link ContextMenuCheckboxItem}, {@link ContextMenuRadioItem},
|
|
13
|
-
* {@link ContextMenuLabel}, {@link ContextMenuSeparator},
|
|
14
|
-
* {@link ContextMenuShortcut} and submenus ({@link ContextMenuSub},
|
|
15
|
-
* {@link ContextMenuSubTrigger}, {@link ContextMenuSubContent}).
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* ```tsx
|
|
19
|
-
* <ContextMenu>
|
|
20
|
-
* <ContextMenuTrigger>Right click</ContextMenuTrigger>
|
|
21
|
-
* <ContextMenuContent>
|
|
22
|
-
* <ContextMenuItem>Back</ContextMenuItem>
|
|
23
|
-
* <ContextMenuItem>Reload</ContextMenuItem>
|
|
24
|
-
* </ContextMenuContent>
|
|
25
|
-
* </ContextMenu>
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
function ContextMenu({
|
|
29
|
-
...props
|
|
30
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.Root>) {
|
|
31
|
-
return <ContextMenuPrimitive.Root data-slot='context-menu' {...props} />;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function ContextMenuTrigger({
|
|
35
|
-
...props
|
|
36
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.Trigger>) {
|
|
37
|
-
return (
|
|
38
|
-
<ContextMenuPrimitive.Trigger data-slot='context-menu-trigger' {...props} />
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function ContextMenuGroup({
|
|
43
|
-
...props
|
|
44
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.Group>) {
|
|
45
|
-
return (
|
|
46
|
-
<ContextMenuPrimitive.Group data-slot='context-menu-group' {...props} />
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function ContextMenuPortal({
|
|
51
|
-
...props
|
|
52
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.Portal>) {
|
|
53
|
-
return (
|
|
54
|
-
<ContextMenuPrimitive.Portal data-slot='context-menu-portal' {...props} />
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function ContextMenuSub({
|
|
59
|
-
...props
|
|
60
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.Sub>) {
|
|
61
|
-
return <ContextMenuPrimitive.Sub data-slot='context-menu-sub' {...props} />;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function ContextMenuRadioGroup({
|
|
65
|
-
...props
|
|
66
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>) {
|
|
67
|
-
return (
|
|
68
|
-
<ContextMenuPrimitive.RadioGroup
|
|
69
|
-
data-slot='context-menu-radio-group'
|
|
70
|
-
{...props}
|
|
71
|
-
/>
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
function ContextMenuSubTrigger({
|
|
76
|
-
className,
|
|
77
|
-
inset,
|
|
78
|
-
children,
|
|
79
|
-
...props
|
|
80
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.SubTrigger> & {
|
|
81
|
-
inset?: boolean;
|
|
82
|
-
}) {
|
|
83
|
-
return (
|
|
84
|
-
<ContextMenuPrimitive.SubTrigger
|
|
85
|
-
data-slot='context-menu-sub-trigger'
|
|
86
|
-
data-inset={inset}
|
|
87
|
-
className={cn(
|
|
88
|
-
"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
89
|
-
className
|
|
90
|
-
)}
|
|
91
|
-
{...props}
|
|
92
|
-
>
|
|
93
|
-
{children}
|
|
94
|
-
<ChevronRightIcon className='ml-auto size-4' />
|
|
95
|
-
</ContextMenuPrimitive.SubTrigger>
|
|
96
|
-
);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
function ContextMenuSubContent({
|
|
100
|
-
className,
|
|
101
|
-
...props
|
|
102
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.SubContent>) {
|
|
103
|
-
return (
|
|
104
|
-
<ContextMenuPrimitive.SubContent
|
|
105
|
-
data-slot='context-menu-sub-content'
|
|
106
|
-
className={cn(
|
|
107
|
-
'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg',
|
|
108
|
-
className
|
|
109
|
-
)}
|
|
110
|
-
{...props}
|
|
111
|
-
/>
|
|
112
|
-
);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
function ContextMenuContent({
|
|
116
|
-
className,
|
|
117
|
-
...props
|
|
118
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.Content>) {
|
|
119
|
-
return (
|
|
120
|
-
<ContextMenuPrimitive.Portal>
|
|
121
|
-
<ContextMenuPrimitive.Content
|
|
122
|
-
data-slot='context-menu-content'
|
|
123
|
-
className={cn(
|
|
124
|
-
'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md',
|
|
125
|
-
className
|
|
126
|
-
)}
|
|
127
|
-
{...props}
|
|
128
|
-
/>
|
|
129
|
-
</ContextMenuPrimitive.Portal>
|
|
130
|
-
);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
function ContextMenuItem({
|
|
134
|
-
className,
|
|
135
|
-
inset,
|
|
136
|
-
variant = 'default',
|
|
137
|
-
...props
|
|
138
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.Item> & {
|
|
139
|
-
inset?: boolean;
|
|
140
|
-
variant?: 'default' | 'destructive';
|
|
141
|
-
}) {
|
|
142
|
-
return (
|
|
143
|
-
<ContextMenuPrimitive.Item
|
|
144
|
-
data-slot='context-menu-item'
|
|
145
|
-
data-inset={inset}
|
|
146
|
-
data-variant={variant}
|
|
147
|
-
className={cn(
|
|
148
|
-
"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
149
|
-
className
|
|
150
|
-
)}
|
|
151
|
-
{...props}
|
|
152
|
-
/>
|
|
153
|
-
);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
function ContextMenuCheckboxItem({
|
|
157
|
-
className,
|
|
158
|
-
children,
|
|
159
|
-
checked,
|
|
160
|
-
...props
|
|
161
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem>) {
|
|
162
|
-
return (
|
|
163
|
-
<ContextMenuPrimitive.CheckboxItem
|
|
164
|
-
data-slot='context-menu-checkbox-item'
|
|
165
|
-
className={cn(
|
|
166
|
-
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
167
|
-
className
|
|
168
|
-
)}
|
|
169
|
-
checked={checked}
|
|
170
|
-
{...props}
|
|
171
|
-
>
|
|
172
|
-
<span className='pointer-events-none absolute left-2 flex size-3.5 items-center justify-center'>
|
|
173
|
-
<ContextMenuPrimitive.ItemIndicator>
|
|
174
|
-
<CheckIcon className='size-4' />
|
|
175
|
-
</ContextMenuPrimitive.ItemIndicator>
|
|
176
|
-
</span>
|
|
177
|
-
{children}
|
|
178
|
-
</ContextMenuPrimitive.CheckboxItem>
|
|
179
|
-
);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
function ContextMenuRadioItem({
|
|
183
|
-
className,
|
|
184
|
-
children,
|
|
185
|
-
...props
|
|
186
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.RadioItem>) {
|
|
187
|
-
return (
|
|
188
|
-
<ContextMenuPrimitive.RadioItem
|
|
189
|
-
data-slot='context-menu-radio-item'
|
|
190
|
-
className={cn(
|
|
191
|
-
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
192
|
-
className
|
|
193
|
-
)}
|
|
194
|
-
{...props}
|
|
195
|
-
>
|
|
196
|
-
<span className='pointer-events-none absolute left-2 flex size-3.5 items-center justify-center'>
|
|
197
|
-
<ContextMenuPrimitive.ItemIndicator>
|
|
198
|
-
<CircleIcon className='size-2 fill-current' />
|
|
199
|
-
</ContextMenuPrimitive.ItemIndicator>
|
|
200
|
-
</span>
|
|
201
|
-
{children}
|
|
202
|
-
</ContextMenuPrimitive.RadioItem>
|
|
203
|
-
);
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
function ContextMenuLabel({
|
|
207
|
-
className,
|
|
208
|
-
inset,
|
|
209
|
-
...props
|
|
210
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.Label> & {
|
|
211
|
-
inset?: boolean;
|
|
212
|
-
}) {
|
|
213
|
-
return (
|
|
214
|
-
<ContextMenuPrimitive.Label
|
|
215
|
-
data-slot='context-menu-label'
|
|
216
|
-
data-inset={inset}
|
|
217
|
-
className={cn(
|
|
218
|
-
'text-foreground px-2 py-1.5 text-sm font-medium data-[inset]:pl-8',
|
|
219
|
-
className
|
|
220
|
-
)}
|
|
221
|
-
{...props}
|
|
222
|
-
/>
|
|
223
|
-
);
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
function ContextMenuSeparator({
|
|
227
|
-
className,
|
|
228
|
-
...props
|
|
229
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.Separator>) {
|
|
230
|
-
return (
|
|
231
|
-
<ContextMenuPrimitive.Separator
|
|
232
|
-
data-slot='context-menu-separator'
|
|
233
|
-
className={cn('bg-border -mx-1 my-1 h-px', className)}
|
|
234
|
-
{...props}
|
|
235
|
-
/>
|
|
236
|
-
);
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
function ContextMenuShortcut({
|
|
240
|
-
className,
|
|
241
|
-
...props
|
|
242
|
-
}: React.ComponentProps<'span'>) {
|
|
243
|
-
return (
|
|
244
|
-
<span
|
|
245
|
-
data-slot='context-menu-shortcut'
|
|
246
|
-
className={cn(
|
|
247
|
-
'text-muted-foreground ml-auto text-xs tracking-widest',
|
|
248
|
-
className
|
|
249
|
-
)}
|
|
250
|
-
{...props}
|
|
251
|
-
/>
|
|
252
|
-
);
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
export {
|
|
256
|
-
ContextMenu,
|
|
257
|
-
ContextMenuCheckboxItem,
|
|
258
|
-
ContextMenuContent,
|
|
259
|
-
ContextMenuGroup,
|
|
260
|
-
ContextMenuItem,
|
|
261
|
-
ContextMenuLabel,
|
|
262
|
-
ContextMenuPortal,
|
|
263
|
-
ContextMenuRadioGroup,
|
|
264
|
-
ContextMenuRadioItem,
|
|
265
|
-
ContextMenuSeparator,
|
|
266
|
-
ContextMenuShortcut,
|
|
267
|
-
ContextMenuSub,
|
|
268
|
-
ContextMenuSubContent,
|
|
269
|
-
ContextMenuSubTrigger,
|
|
270
|
-
ContextMenuTrigger,
|
|
271
|
-
};
|