@luanthnh/cntt-ui 0.1.7 → 0.1.9
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/package.json +5 -1
- package/.storybook/globals.d.ts +0 -1
- package/.storybook/main.ts +0 -29
- package/.storybook/preview.ts +0 -32
- package/assets/fonts/Montserrat-Black.eot +0 -0
- package/assets/fonts/Montserrat-Black.ttf +0 -0
- package/assets/fonts/Montserrat-Black.woff +0 -0
- package/assets/fonts/Montserrat-Black.woff2 +0 -0
- package/assets/fonts/Montserrat-BlackItalic.eot +0 -0
- package/assets/fonts/Montserrat-BlackItalic.ttf +0 -0
- package/assets/fonts/Montserrat-BlackItalic.woff +0 -0
- package/assets/fonts/Montserrat-BlackItalic.woff2 +0 -0
- package/assets/fonts/Montserrat-Bold.eot +0 -0
- package/assets/fonts/Montserrat-Bold.ttf +0 -0
- package/assets/fonts/Montserrat-Bold.woff +0 -0
- package/assets/fonts/Montserrat-Bold.woff2 +0 -0
- package/assets/fonts/Montserrat-BoldItalic.eot +0 -0
- package/assets/fonts/Montserrat-BoldItalic.ttf +0 -0
- package/assets/fonts/Montserrat-BoldItalic.woff +0 -0
- package/assets/fonts/Montserrat-BoldItalic.woff2 +0 -0
- package/assets/fonts/Montserrat-ExtraBold.eot +0 -0
- package/assets/fonts/Montserrat-ExtraBold.ttf +0 -0
- package/assets/fonts/Montserrat-ExtraBold.woff +0 -0
- package/assets/fonts/Montserrat-ExtraBold.woff2 +0 -0
- package/assets/fonts/Montserrat-ExtraBoldItalic.eot +0 -0
- package/assets/fonts/Montserrat-ExtraBoldItalic.ttf +0 -0
- package/assets/fonts/Montserrat-ExtraBoldItalic.woff +0 -0
- package/assets/fonts/Montserrat-ExtraBoldItalic.woff2 +0 -0
- package/assets/fonts/Montserrat-ExtraLight.eot +0 -0
- package/assets/fonts/Montserrat-ExtraLight.ttf +0 -0
- package/assets/fonts/Montserrat-ExtraLight.woff +0 -0
- package/assets/fonts/Montserrat-ExtraLight.woff2 +0 -0
- package/assets/fonts/Montserrat-ExtraLightItalic.eot +0 -0
- package/assets/fonts/Montserrat-ExtraLightItalic.ttf +0 -0
- package/assets/fonts/Montserrat-ExtraLightItalic.woff +0 -0
- package/assets/fonts/Montserrat-ExtraLightItalic.woff2 +0 -0
- package/assets/fonts/Montserrat-Italic.eot +0 -0
- package/assets/fonts/Montserrat-Italic.ttf +0 -0
- package/assets/fonts/Montserrat-Italic.woff +0 -0
- package/assets/fonts/Montserrat-Italic.woff2 +0 -0
- package/assets/fonts/Montserrat-Light.eot +0 -0
- package/assets/fonts/Montserrat-Light.ttf +0 -0
- package/assets/fonts/Montserrat-Light.woff +0 -0
- package/assets/fonts/Montserrat-Light.woff2 +0 -0
- package/assets/fonts/Montserrat-LightItalic.eot +0 -0
- package/assets/fonts/Montserrat-LightItalic.ttf +0 -0
- package/assets/fonts/Montserrat-LightItalic.woff +0 -0
- package/assets/fonts/Montserrat-LightItalic.woff2 +0 -0
- package/assets/fonts/Montserrat-Medium.eot +0 -0
- package/assets/fonts/Montserrat-Medium.ttf +0 -0
- package/assets/fonts/Montserrat-Medium.woff +0 -0
- package/assets/fonts/Montserrat-Medium.woff2 +0 -0
- package/assets/fonts/Montserrat-MediumItalic.eot +0 -0
- package/assets/fonts/Montserrat-MediumItalic.ttf +0 -0
- package/assets/fonts/Montserrat-MediumItalic.woff +0 -0
- package/assets/fonts/Montserrat-MediumItalic.woff2 +0 -0
- package/assets/fonts/Montserrat-Regular.eot +0 -0
- package/assets/fonts/Montserrat-Regular.ttf +0 -0
- package/assets/fonts/Montserrat-Regular.woff +0 -0
- package/assets/fonts/Montserrat-Regular.woff2 +0 -0
- package/assets/fonts/Montserrat-SemiBold.eot +0 -0
- package/assets/fonts/Montserrat-SemiBold.ttf +0 -0
- package/assets/fonts/Montserrat-SemiBold.woff +0 -0
- package/assets/fonts/Montserrat-SemiBold.woff2 +0 -0
- package/assets/fonts/Montserrat-SemiBoldItalic.eot +0 -0
- package/assets/fonts/Montserrat-SemiBoldItalic.ttf +0 -0
- package/assets/fonts/Montserrat-SemiBoldItalic.woff +0 -0
- package/assets/fonts/Montserrat-SemiBoldItalic.woff2 +0 -0
- package/assets/fonts/Montserrat-Thin.eot +0 -0
- package/assets/fonts/Montserrat-Thin.ttf +0 -0
- package/assets/fonts/Montserrat-Thin.woff +0 -0
- package/assets/fonts/Montserrat-Thin.woff2 +0 -0
- package/assets/fonts/Montserrat-ThinItalic.eot +0 -0
- package/assets/fonts/Montserrat-ThinItalic.ttf +0 -0
- package/assets/fonts/Montserrat-ThinItalic.woff +0 -0
- package/assets/fonts/Montserrat-ThinItalic.woff2 +0 -0
- package/assets/fonts/Montserrat-Variable.eot +0 -0
- package/assets/fonts/Montserrat-Variable.ttf +0 -0
- package/assets/fonts/Montserrat-Variable.woff +0 -0
- package/assets/fonts/Montserrat-Variable.woff2 +0 -0
- package/assets/fonts/Montserrat-VariableItalic.eot +0 -0
- package/assets/fonts/Montserrat-VariableItalic.ttf +0 -0
- package/assets/fonts/Montserrat-VariableItalic.woff +0 -0
- package/assets/fonts/Montserrat-VariableItalic.woff2 +0 -0
- package/assets/icons/arrow-left.svg +0 -1
- package/assets/icons/file.svg +0 -1
- package/assets/icons/globe.svg +0 -1
- package/assets/icons/logo-line.svg +0 -1
- package/assets/icons/next.svg +0 -1
- package/assets/icons/panel-left-expand.svg +0 -1
- package/assets/icons/placeholder.svg +0 -57
- package/assets/icons/vercel.svg +0 -1
- package/assets/icons/window.svg +0 -1
- package/assets/lotties/error-404.json +0 -19642
- package/assets/lotties/error.json +0 -2414
- package/assets/lotties/loader.json +0 -305
- package/components/Welcome.mdx +0 -74
- package/components/lenis/index.tsx +0 -48
- package/components/motion/auto-height.tsx +0 -56
- package/components/motion/cursor.tsx +0 -108
- package/components/motion/highlight.tsx +0 -605
- package/components/motion/number-ticker.tsx +0 -55
- package/components/motion/slot.tsx +0 -106
- package/components/motion/waves.tsx +0 -417
- package/components/primitives/tabs.tsx +0 -174
- package/components/ui/Accordion/index.stories.tsx +0 -39
- package/components/ui/Accordion/index.tsx +0 -170
- package/components/ui/Alert/index.stories.tsx +0 -39
- package/components/ui/Alert/index.tsx +0 -60
- package/components/ui/AlertDialog/index.stories.tsx +0 -47
- package/components/ui/AlertDialog/index.tsx +0 -172
- package/components/ui/AspectRatio/index.stories.tsx +0 -40
- package/components/ui/AspectRatio/index.tsx +0 -9
- package/components/ui/Avatar/index.stories.tsx +0 -39
- package/components/ui/Avatar/index.tsx +0 -44
- package/components/ui/Badge/index.stories.tsx +0 -64
- package/components/ui/Badge/index.tsx +0 -46
- package/components/ui/Breadcrumb/index.stories.tsx +0 -64
- package/components/ui/Breadcrumb/index.tsx +0 -102
- package/components/ui/Button/index.stories.tsx +0 -232
- package/components/ui/Button/index.tsx +0 -114
- package/components/ui/Calendar/index.stories.tsx +0 -20
- package/components/ui/Calendar/index.tsx +0 -149
- package/components/ui/Card/index.stories.tsx +0 -39
- package/components/ui/Card/index.tsx +0 -65
- package/components/ui/Carousel/index.stories.tsx +0 -37
- package/components/ui/Carousel/index.tsx +0 -242
- package/components/ui/Chart/index.stories.tsx +0 -53
- package/components/ui/Chart/index.tsx +0 -322
- package/components/ui/Checkbox/index.stories.tsx +0 -56
- package/components/ui/Checkbox/index.tsx +0 -167
- package/components/ui/CircleProcess/index.stories.tsx +0 -29
- package/components/ui/CircleProcess/index.tsx +0 -50
- package/components/ui/Collapsible/index.stories.tsx +0 -33
- package/components/ui/Collapsible/index.tsx +0 -124
- package/components/ui/Command/index.stories.tsx +0 -65
- package/components/ui/Command/index.tsx +0 -161
- package/components/ui/Container/index.stories.tsx +0 -22
- package/components/ui/Container/index.tsx +0 -30
- package/components/ui/ContextMenu/index.stories.tsx +0 -51
- package/components/ui/ContextMenu/index.tsx +0 -224
- package/components/ui/Dialog/index.stories.tsx +0 -44
- package/components/ui/Dialog/index.tsx +0 -156
- package/components/ui/Drawer/index.stories.tsx +0 -54
- package/components/ui/Drawer/index.tsx +0 -124
- package/components/ui/DropdownMenu/index.stories.tsx +0 -83
- package/components/ui/DropdownMenu/index.tsx +0 -231
- package/components/ui/Dropzone/index.stories.tsx +0 -18
- package/components/ui/Dropzone/index.tsx +0 -47
- package/components/ui/Form/date-field.tsx +0 -77
- package/components/ui/Form/index.stories.tsx +0 -67
- package/components/ui/Form/index.tsx +0 -188
- package/components/ui/Form/select-field.tsx +0 -55
- package/components/ui/Form/text-area-field.tsx +0 -37
- package/components/ui/Form/text-field.tsx +0 -72
- package/components/ui/HStack/index.stories.tsx +0 -48
- package/components/ui/HStack/index.tsx +0 -73
- package/components/ui/HoverCard/index.stories.tsx +0 -38
- package/components/ui/HoverCard/index.tsx +0 -38
- package/components/ui/Icons/index.stories.tsx +0 -27
- package/components/ui/Icons/index.tsx +0 -33
- package/components/ui/ImageWithFallback/index.stories.tsx +0 -32
- package/components/ui/ImageWithFallback/index.tsx +0 -34
- package/components/ui/Input/index.stories.tsx +0 -47
- package/components/ui/Input/index.tsx +0 -21
- package/components/ui/InputOtp/index.stories.tsx +0 -35
- package/components/ui/InputOtp/index.tsx +0 -70
- package/components/ui/Label/index.stories.tsx +0 -18
- package/components/ui/Label/index.tsx +0 -21
- package/components/ui/Marquee/index.stories.tsx +0 -71
- package/components/ui/Marquee/index.tsx +0 -65
- package/components/ui/Menubar/index.stories.tsx +0 -116
- package/components/ui/Menubar/index.tsx +0 -252
- package/components/ui/NavigationMenu/index.stories.tsx +0 -112
- package/components/ui/NavigationMenu/index.tsx +0 -185
- package/components/ui/NoData/index.stories.tsx +0 -24
- package/components/ui/NoData/index.tsx +0 -19
- package/components/ui/Pagination/index.stories.tsx +0 -53
- package/components/ui/Pagination/index.tsx +0 -114
- package/components/ui/Popover/index.stories.tsx +0 -31
- package/components/ui/Popover/index.tsx +0 -42
- package/components/ui/Progress/index.stories.tsx +0 -35
- package/components/ui/Progress/index.tsx +0 -28
- package/components/ui/RadioGroup/index.stories.tsx +0 -28
- package/components/ui/RadioGroup/index.tsx +0 -45
- package/components/ui/Resizable/index.stories.tsx +0 -44
- package/components/ui/Resizable/index.tsx +0 -54
- package/components/ui/ScrollArea/index.stories.tsx +0 -31
- package/components/ui/ScrollArea/index.tsx +0 -56
- package/components/ui/Select/index.stories.tsx +0 -64
- package/components/ui/Select/index.tsx +0 -170
- package/components/ui/Separator/index.stories.tsx +0 -31
- package/components/ui/Separator/index.tsx +0 -28
- package/components/ui/Sheet/index.stories.tsx +0 -45
- package/components/ui/Sheet/index.tsx +0 -130
- package/components/ui/Sidebar/index.stories.tsx +0 -82
- package/components/ui/Sidebar/index.tsx +0 -676
- package/components/ui/Skeleton/index.stories.tsx +0 -36
- package/components/ui/Skeleton/index.tsx +0 -13
- package/components/ui/Slider/index.stories.tsx +0 -48
- package/components/ui/Slider/index.tsx +0 -82
- package/components/ui/Slot/index.stories.tsx +0 -29
- package/components/ui/Slot/index.tsx +0 -106
- package/components/ui/Sonner/index.stories.tsx +0 -36
- package/components/ui/Sonner/index.tsx +0 -31
- package/components/ui/Switch/index.stories.tsx +0 -33
- package/components/ui/Switch/index.tsx +0 -28
- package/components/ui/Table/index.stories.tsx +0 -74
- package/components/ui/Table/index.tsx +0 -95
- package/components/ui/Tabs/index.stories.tsx +0 -38
- package/components/ui/Tabs/index.tsx +0 -78
- package/components/ui/Text/index.stories.tsx +0 -53
- package/components/ui/Text/index.tsx +0 -138
- package/components/ui/Textarea/index.stories.tsx +0 -25
- package/components/ui/Textarea/index.tsx +0 -18
- package/components/ui/Toggle/index.stories.tsx +0 -52
- package/components/ui/Toggle/index.tsx +0 -46
- package/components/ui/ToggleGroup/index.stories.tsx +0 -52
- package/components/ui/ToggleGroup/index.tsx +0 -69
- package/components/ui/Tooltip/index.stories.tsx +0 -29
- package/components/ui/Tooltip/index.tsx +0 -35
- package/components/ui/VStack/index.stories.tsx +0 -45
- package/components/ui/VStack/index.tsx +0 -69
- package/components/ui/colors.stories.tsx +0 -148
- package/eslint.config.js +0 -10
- package/hooks/index.ts +0 -3
- package/hooks/use-auto-height.tsx +0 -99
- package/hooks/use-controlled-state.tsx +0 -32
- package/hooks/use-mobile.ts +0 -19
- package/index.ts +0 -58
- package/lib/get-strict-context.ts +0 -15
- package/lib/utils.ts +0 -10
- package/scripts/generate-exports.ts +0 -32
- package/tsconfig.json +0 -12
- package/tsconfig.tsbuildinfo +0 -1
- package/tsup.config.ts +0 -11
- package/types/svg.d.ts +0 -10
- package/vercel.json +0 -5
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { Collapsible as CollapsiblePrimitive } from '@base-ui-components/react/collapsible';
|
|
5
|
-
import { AnimatePresence, motion, type HTMLMotionProps } from 'motion/react';
|
|
6
|
-
|
|
7
|
-
import { getStrictContext } from '@/lib/get-strict-context';
|
|
8
|
-
import { useControlledState } from '@/hooks/use-controlled-state';
|
|
9
|
-
|
|
10
|
-
type CollapsibleContextType = {
|
|
11
|
-
isOpen: boolean;
|
|
12
|
-
setIsOpen: CollapsibleProps['onOpenChange'];
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
const [CollapsibleProvider, useCollapsible] =
|
|
16
|
-
getStrictContext<CollapsibleContextType>('CollapsibleContext');
|
|
17
|
-
|
|
18
|
-
type CollapsibleProps = React.ComponentProps<typeof CollapsiblePrimitive.Root>;
|
|
19
|
-
|
|
20
|
-
function Collapsible(props: CollapsibleProps) {
|
|
21
|
-
const [isOpen, setIsOpen] = useControlledState({
|
|
22
|
-
value: props?.open,
|
|
23
|
-
defaultValue: props?.defaultOpen,
|
|
24
|
-
onChange: props?.onOpenChange,
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<CollapsibleProvider value={{ isOpen, setIsOpen }}>
|
|
29
|
-
<CollapsiblePrimitive.Root data-slot="collapsible" {...props} onOpenChange={setIsOpen} />
|
|
30
|
-
</CollapsibleProvider>
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
type CollapsibleTriggerProps = React.ComponentProps<typeof CollapsiblePrimitive.Trigger>;
|
|
35
|
-
|
|
36
|
-
function CollapsibleTrigger(props: CollapsibleTriggerProps) {
|
|
37
|
-
return <CollapsiblePrimitive.Trigger data-slot="collapsible-trigger" {...props} />;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
type CollapsiblePanelProps = Omit<
|
|
41
|
-
React.ComponentProps<typeof CollapsiblePrimitive.Panel>,
|
|
42
|
-
'keepMounted' | 'render'
|
|
43
|
-
> &
|
|
44
|
-
HTMLMotionProps<'div'> & {
|
|
45
|
-
keepRendered?: boolean;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
function CollapsiblePanel({
|
|
49
|
-
transition = { type: 'spring', stiffness: 150, damping: 22 },
|
|
50
|
-
hiddenUntilFound,
|
|
51
|
-
keepRendered = false,
|
|
52
|
-
...props
|
|
53
|
-
}: CollapsiblePanelProps) {
|
|
54
|
-
const { isOpen } = useCollapsible();
|
|
55
|
-
|
|
56
|
-
return (
|
|
57
|
-
<AnimatePresence>
|
|
58
|
-
{keepRendered ? (
|
|
59
|
-
<CollapsiblePrimitive.Panel
|
|
60
|
-
hidden={false}
|
|
61
|
-
hiddenUntilFound={hiddenUntilFound}
|
|
62
|
-
keepMounted
|
|
63
|
-
render={
|
|
64
|
-
<motion.div
|
|
65
|
-
key="collapsible-panel"
|
|
66
|
-
data-slot="collapsible-panel"
|
|
67
|
-
initial={{ height: 0, opacity: 0, '--mask-stop': '0%' }}
|
|
68
|
-
animate={
|
|
69
|
-
isOpen
|
|
70
|
-
? { height: 'auto', opacity: 1, '--mask-stop': '100%' }
|
|
71
|
-
: { height: 0, opacity: 0, '--mask-stop': '0%' }
|
|
72
|
-
}
|
|
73
|
-
transition={transition}
|
|
74
|
-
style={{
|
|
75
|
-
maskImage: 'linear-gradient(black var(--mask-stop), transparent var(--mask-stop))',
|
|
76
|
-
WebkitMaskImage:
|
|
77
|
-
'linear-gradient(black var(--mask-stop), transparent var(--mask-stop))',
|
|
78
|
-
overflow: 'hidden',
|
|
79
|
-
}}
|
|
80
|
-
{...props}
|
|
81
|
-
/>
|
|
82
|
-
}
|
|
83
|
-
/>
|
|
84
|
-
) : (
|
|
85
|
-
isOpen && (
|
|
86
|
-
<CollapsiblePrimitive.Panel
|
|
87
|
-
hidden={false}
|
|
88
|
-
hiddenUntilFound={hiddenUntilFound}
|
|
89
|
-
keepMounted
|
|
90
|
-
render={
|
|
91
|
-
<motion.div
|
|
92
|
-
key="collapsible-panel"
|
|
93
|
-
data-slot="collapsible-panel"
|
|
94
|
-
initial={{ height: 0, opacity: 0, '--mask-stop': '0%' }}
|
|
95
|
-
animate={{ height: 'auto', opacity: 1, '--mask-stop': '100%' }}
|
|
96
|
-
exit={{ height: 0, opacity: 0, '--mask-stop': '0%' }}
|
|
97
|
-
transition={transition}
|
|
98
|
-
style={{
|
|
99
|
-
maskImage:
|
|
100
|
-
'linear-gradient(black var(--mask-stop), transparent var(--mask-stop))',
|
|
101
|
-
WebkitMaskImage:
|
|
102
|
-
'linear-gradient(black var(--mask-stop), transparent var(--mask-stop))',
|
|
103
|
-
overflow: 'hidden',
|
|
104
|
-
}}
|
|
105
|
-
{...props}
|
|
106
|
-
/>
|
|
107
|
-
}
|
|
108
|
-
/>
|
|
109
|
-
)
|
|
110
|
-
)}
|
|
111
|
-
</AnimatePresence>
|
|
112
|
-
);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export {
|
|
116
|
-
Collapsible,
|
|
117
|
-
CollapsibleTrigger,
|
|
118
|
-
CollapsiblePanel,
|
|
119
|
-
useCollapsible,
|
|
120
|
-
type CollapsibleProps,
|
|
121
|
-
type CollapsibleTriggerProps,
|
|
122
|
-
type CollapsiblePanelProps,
|
|
123
|
-
type CollapsibleContextType,
|
|
124
|
-
};
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Calculator, Calendar, CreditCard, Settings, Smile, User } from 'lucide-react';
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
Command,
|
|
6
|
-
CommandEmpty,
|
|
7
|
-
CommandGroup,
|
|
8
|
-
CommandInput,
|
|
9
|
-
CommandItem,
|
|
10
|
-
CommandList,
|
|
11
|
-
CommandSeparator,
|
|
12
|
-
CommandShortcut,
|
|
13
|
-
} from './index';
|
|
14
|
-
|
|
15
|
-
const meta: Meta<typeof Command> = {
|
|
16
|
-
title: 'UI/Command',
|
|
17
|
-
component: Command,
|
|
18
|
-
tags: ['autodocs'],
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export default meta;
|
|
22
|
-
type Story = StoryObj<typeof Command>;
|
|
23
|
-
|
|
24
|
-
export const Default: Story = {
|
|
25
|
-
render: (args) => (
|
|
26
|
-
<Command {...args} className="rounded-lg border shadow-md">
|
|
27
|
-
<CommandInput placeholder="Type a command or search..." />
|
|
28
|
-
<CommandList>
|
|
29
|
-
<CommandEmpty>No results found.</CommandEmpty>
|
|
30
|
-
<CommandGroup heading="Suggestions">
|
|
31
|
-
<CommandItem>
|
|
32
|
-
<Calendar className="mr-2 h-4 w-4" />
|
|
33
|
-
<span>Calendar</span>
|
|
34
|
-
</CommandItem>
|
|
35
|
-
<CommandItem>
|
|
36
|
-
<Smile className="mr-2 h-4 w-4" />
|
|
37
|
-
<span>Search Emoji</span>
|
|
38
|
-
</CommandItem>
|
|
39
|
-
<CommandItem>
|
|
40
|
-
<Calculator className="mr-2 h-4 w-4" />
|
|
41
|
-
<span>Calculator</span>
|
|
42
|
-
</CommandItem>
|
|
43
|
-
</CommandGroup>
|
|
44
|
-
<CommandSeparator />
|
|
45
|
-
<CommandGroup heading="Settings">
|
|
46
|
-
<CommandItem>
|
|
47
|
-
<User className="mr-2 h-4 w-4" />
|
|
48
|
-
<span>Profile</span>
|
|
49
|
-
<CommandShortcut>⌘P</CommandShortcut>
|
|
50
|
-
</CommandItem>
|
|
51
|
-
<CommandItem>
|
|
52
|
-
<CreditCard className="mr-2 h-4 w-4" />
|
|
53
|
-
<span>Billing</span>
|
|
54
|
-
<CommandShortcut>⌘B</CommandShortcut>
|
|
55
|
-
</CommandItem>
|
|
56
|
-
<CommandItem>
|
|
57
|
-
<Settings className="mr-2 h-4 w-4" />
|
|
58
|
-
<span>Settings</span>
|
|
59
|
-
<CommandShortcut>⌘S</CommandShortcut>
|
|
60
|
-
</CommandItem>
|
|
61
|
-
</CommandGroup>
|
|
62
|
-
</CommandList>
|
|
63
|
-
</Command>
|
|
64
|
-
),
|
|
65
|
-
};
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { Command as CommandPrimitive } from 'cmdk';
|
|
5
|
-
import { SearchIcon } from 'lucide-react';
|
|
6
|
-
|
|
7
|
-
import { cn } from '@/lib/utils';
|
|
8
|
-
import {
|
|
9
|
-
Dialog,
|
|
10
|
-
DialogContent,
|
|
11
|
-
DialogDescription,
|
|
12
|
-
DialogHeader,
|
|
13
|
-
DialogTitle,
|
|
14
|
-
} from '@/components/ui/Dialog';
|
|
15
|
-
|
|
16
|
-
function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>) {
|
|
17
|
-
return (
|
|
18
|
-
<CommandPrimitive
|
|
19
|
-
data-slot="command"
|
|
20
|
-
className={cn(
|
|
21
|
-
'bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md',
|
|
22
|
-
className,
|
|
23
|
-
)}
|
|
24
|
-
{...props}
|
|
25
|
-
/>
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function CommandDialog({
|
|
30
|
-
title = 'Command Palette',
|
|
31
|
-
description = 'Search for a command to run...',
|
|
32
|
-
children,
|
|
33
|
-
className,
|
|
34
|
-
showCloseButton = true,
|
|
35
|
-
...props
|
|
36
|
-
}: React.ComponentProps<typeof Dialog> & {
|
|
37
|
-
title?: string;
|
|
38
|
-
description?: string;
|
|
39
|
-
className?: string;
|
|
40
|
-
showCloseButton?: boolean;
|
|
41
|
-
}) {
|
|
42
|
-
return (
|
|
43
|
-
<Dialog {...props}>
|
|
44
|
-
<DialogHeader className="sr-only">
|
|
45
|
-
<DialogTitle>{title}</DialogTitle>
|
|
46
|
-
<DialogDescription>{description}</DialogDescription>
|
|
47
|
-
</DialogHeader>
|
|
48
|
-
<DialogContent
|
|
49
|
-
className={cn('overflow-hidden p-0', className)}
|
|
50
|
-
showCloseButton={showCloseButton}
|
|
51
|
-
>
|
|
52
|
-
<Command className="**:[[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group]]:px-2 **:[[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 **:[[cmdk-input-wrapper]_svg]:h-5 **:[[cmdk-input-wrapper]_svg]:w-5 **:[[cmdk-input]]:h-12 **:[[cmdk-item]_svg]:h-5 **:[[cmdk-item]_svg]:w-5 **:[[cmdk-item]]:px-2 **:[[cmdk-item]]:py-3">
|
|
53
|
-
{children}
|
|
54
|
-
</Command>
|
|
55
|
-
</DialogContent>
|
|
56
|
-
</Dialog>
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function CommandInput({
|
|
61
|
-
className,
|
|
62
|
-
...props
|
|
63
|
-
}: React.ComponentProps<typeof CommandPrimitive.Input>) {
|
|
64
|
-
return (
|
|
65
|
-
<div data-slot="command-input-wrapper" className="flex h-9 items-center gap-2 border-b px-3">
|
|
66
|
-
<SearchIcon className="size-4 shrink-0 opacity-50" />
|
|
67
|
-
<CommandPrimitive.Input
|
|
68
|
-
data-slot="command-input"
|
|
69
|
-
className={cn(
|
|
70
|
-
'placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50',
|
|
71
|
-
className,
|
|
72
|
-
)}
|
|
73
|
-
{...props}
|
|
74
|
-
/>
|
|
75
|
-
</div>
|
|
76
|
-
);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
function CommandList({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.List>) {
|
|
80
|
-
return (
|
|
81
|
-
<CommandPrimitive.List
|
|
82
|
-
data-slot="command-list"
|
|
83
|
-
className={cn('max-h-75 scroll-py-1 overflow-x-hidden overflow-y-auto', className)}
|
|
84
|
-
{...props}
|
|
85
|
-
/>
|
|
86
|
-
);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
function CommandEmpty({ ...props }: React.ComponentProps<typeof CommandPrimitive.Empty>) {
|
|
90
|
-
return (
|
|
91
|
-
<CommandPrimitive.Empty
|
|
92
|
-
data-slot="command-empty"
|
|
93
|
-
className="py-6 text-center text-sm"
|
|
94
|
-
{...props}
|
|
95
|
-
/>
|
|
96
|
-
);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
function CommandGroup({
|
|
100
|
-
className,
|
|
101
|
-
...props
|
|
102
|
-
}: React.ComponentProps<typeof CommandPrimitive.Group>) {
|
|
103
|
-
return (
|
|
104
|
-
<CommandPrimitive.Group
|
|
105
|
-
data-slot="command-group"
|
|
106
|
-
className={cn(
|
|
107
|
-
'text-foreground **:[[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium',
|
|
108
|
-
className,
|
|
109
|
-
)}
|
|
110
|
-
{...props}
|
|
111
|
-
/>
|
|
112
|
-
);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
function CommandSeparator({
|
|
116
|
-
className,
|
|
117
|
-
...props
|
|
118
|
-
}: React.ComponentProps<typeof CommandPrimitive.Separator>) {
|
|
119
|
-
return (
|
|
120
|
-
<CommandPrimitive.Separator
|
|
121
|
-
data-slot="command-separator"
|
|
122
|
-
className={cn('bg-border -mx-1 h-px', className)}
|
|
123
|
-
{...props}
|
|
124
|
-
/>
|
|
125
|
-
);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
function CommandItem({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Item>) {
|
|
129
|
-
return (
|
|
130
|
-
<CommandPrimitive.Item
|
|
131
|
-
data-slot="command-item"
|
|
132
|
-
className={cn(
|
|
133
|
-
"data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_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=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
134
|
-
className,
|
|
135
|
-
)}
|
|
136
|
-
{...props}
|
|
137
|
-
/>
|
|
138
|
-
);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
function CommandShortcut({ className, ...props }: React.ComponentProps<'span'>) {
|
|
142
|
-
return (
|
|
143
|
-
<span
|
|
144
|
-
data-slot="command-shortcut"
|
|
145
|
-
className={cn('text-muted-foreground ml-auto text-xs tracking-widest', className)}
|
|
146
|
-
{...props}
|
|
147
|
-
/>
|
|
148
|
-
);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
export {
|
|
152
|
-
Command,
|
|
153
|
-
CommandDialog,
|
|
154
|
-
CommandInput,
|
|
155
|
-
CommandList,
|
|
156
|
-
CommandEmpty,
|
|
157
|
-
CommandGroup,
|
|
158
|
-
CommandItem,
|
|
159
|
-
CommandShortcut,
|
|
160
|
-
CommandSeparator,
|
|
161
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
|
|
3
|
-
import { Container } from './index';
|
|
4
|
-
|
|
5
|
-
const meta: Meta<typeof Container> = {
|
|
6
|
-
title: 'UI/Layout/Container',
|
|
7
|
-
component: Container,
|
|
8
|
-
tags: ['autodocs'],
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export default meta;
|
|
12
|
-
type Story = StoryObj<typeof Container>;
|
|
13
|
-
|
|
14
|
-
export const Default: Story = {
|
|
15
|
-
args: {
|
|
16
|
-
children: (
|
|
17
|
-
<div className="bg-primary/20 border-primary rounded-lg border-2 border-dashed p-10 text-center">
|
|
18
|
-
This content is contained within a max-width container.
|
|
19
|
-
</div>
|
|
20
|
-
),
|
|
21
|
-
},
|
|
22
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { Slot } from '@radix-ui/react-slot';
|
|
5
|
-
|
|
6
|
-
import { cn } from '@/lib/utils';
|
|
7
|
-
|
|
8
|
-
export interface ContainerProps extends React.HTMLAttributes<HTMLElement> {
|
|
9
|
-
asChild?: boolean;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const Container = React.forwardRef<HTMLDivElement, ContainerProps>(
|
|
13
|
-
({ asChild = false, className, children, ...props }, ref) => {
|
|
14
|
-
const Comp = asChild ? Slot : 'div';
|
|
15
|
-
|
|
16
|
-
return (
|
|
17
|
-
<Comp
|
|
18
|
-
ref={ref}
|
|
19
|
-
className={cn('container mx-auto w-full px-4 sm:px-6 lg:px-8', className)}
|
|
20
|
-
{...props}
|
|
21
|
-
>
|
|
22
|
-
{children}
|
|
23
|
-
</Comp>
|
|
24
|
-
);
|
|
25
|
-
},
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
Container.displayName = 'Container';
|
|
29
|
-
|
|
30
|
-
export { Container };
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
ContextMenu,
|
|
5
|
-
ContextMenuContent,
|
|
6
|
-
ContextMenuItem,
|
|
7
|
-
ContextMenuLabel,
|
|
8
|
-
ContextMenuSeparator,
|
|
9
|
-
ContextMenuShortcut,
|
|
10
|
-
ContextMenuTrigger,
|
|
11
|
-
} from './index';
|
|
12
|
-
|
|
13
|
-
const meta: Meta<typeof ContextMenu> = {
|
|
14
|
-
title: 'UI/ContextMenu',
|
|
15
|
-
component: ContextMenu,
|
|
16
|
-
tags: ['autodocs'],
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export default meta;
|
|
20
|
-
type Story = StoryObj<typeof ContextMenu>;
|
|
21
|
-
|
|
22
|
-
export const Default: Story = {
|
|
23
|
-
render: (args) => (
|
|
24
|
-
<ContextMenu {...args}>
|
|
25
|
-
<ContextMenuTrigger className="border-primary flex h-37.5 w-75 items-center justify-center rounded-md border border-dashed text-sm">
|
|
26
|
-
Right click here
|
|
27
|
-
</ContextMenuTrigger>
|
|
28
|
-
<ContextMenuContent className="w-64">
|
|
29
|
-
<ContextMenuLabel>Actions</ContextMenuLabel>
|
|
30
|
-
<ContextMenuItem>
|
|
31
|
-
Back
|
|
32
|
-
<ContextMenuShortcut>⌘[</ContextMenuShortcut>
|
|
33
|
-
</ContextMenuItem>
|
|
34
|
-
<ContextMenuItem disabled>
|
|
35
|
-
Forward
|
|
36
|
-
<ContextMenuShortcut>⌘]</ContextMenuShortcut>
|
|
37
|
-
</ContextMenuItem>
|
|
38
|
-
<ContextMenuItem>
|
|
39
|
-
Reload
|
|
40
|
-
<ContextMenuShortcut>⌘R</ContextMenuShortcut>
|
|
41
|
-
</ContextMenuItem>
|
|
42
|
-
<ContextMenuSeparator />
|
|
43
|
-
<ContextMenuItem>
|
|
44
|
-
Save As...
|
|
45
|
-
<ContextMenuShortcut>⇧⌘S</ContextMenuShortcut>
|
|
46
|
-
</ContextMenuItem>
|
|
47
|
-
<ContextMenuItem>Help</ContextMenuItem>
|
|
48
|
-
</ContextMenuContent>
|
|
49
|
-
</ContextMenu>
|
|
50
|
-
),
|
|
51
|
-
};
|
|
@@ -1,224 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
|
|
5
|
-
import { CheckIcon, ChevronRightIcon, CircleIcon } from 'lucide-react';
|
|
6
|
-
|
|
7
|
-
import { cn } from '@/lib/utils';
|
|
8
|
-
|
|
9
|
-
function ContextMenu({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Root>) {
|
|
10
|
-
return <ContextMenuPrimitive.Root data-slot="context-menu" {...props} />;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
function ContextMenuTrigger({
|
|
14
|
-
...props
|
|
15
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.Trigger>) {
|
|
16
|
-
return <ContextMenuPrimitive.Trigger data-slot="context-menu-trigger" {...props} />;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function ContextMenuGroup({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Group>) {
|
|
20
|
-
return <ContextMenuPrimitive.Group data-slot="context-menu-group" {...props} />;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function ContextMenuPortal({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Portal>) {
|
|
24
|
-
return <ContextMenuPrimitive.Portal data-slot="context-menu-portal" {...props} />;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function ContextMenuSub({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Sub>) {
|
|
28
|
-
return <ContextMenuPrimitive.Sub data-slot="context-menu-sub" {...props} />;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function ContextMenuRadioGroup({
|
|
32
|
-
...props
|
|
33
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>) {
|
|
34
|
-
return <ContextMenuPrimitive.RadioGroup data-slot="context-menu-radio-group" {...props} />;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function ContextMenuSubTrigger({
|
|
38
|
-
className,
|
|
39
|
-
inset,
|
|
40
|
-
children,
|
|
41
|
-
...props
|
|
42
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.SubTrigger> & {
|
|
43
|
-
inset?: boolean;
|
|
44
|
-
}) {
|
|
45
|
-
return (
|
|
46
|
-
<ContextMenuPrimitive.SubTrigger
|
|
47
|
-
data-slot="context-menu-sub-trigger"
|
|
48
|
-
data-inset={inset}
|
|
49
|
-
className={cn(
|
|
50
|
-
"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",
|
|
51
|
-
className,
|
|
52
|
-
)}
|
|
53
|
-
{...props}
|
|
54
|
-
>
|
|
55
|
-
{children}
|
|
56
|
-
<ChevronRightIcon className="ml-auto" />
|
|
57
|
-
</ContextMenuPrimitive.SubTrigger>
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function ContextMenuSubContent({
|
|
62
|
-
className,
|
|
63
|
-
...props
|
|
64
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.SubContent>) {
|
|
65
|
-
return (
|
|
66
|
-
<ContextMenuPrimitive.SubContent
|
|
67
|
-
data-slot="context-menu-sub-content"
|
|
68
|
-
className={cn(
|
|
69
|
-
'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',
|
|
70
|
-
className,
|
|
71
|
-
)}
|
|
72
|
-
{...props}
|
|
73
|
-
/>
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function ContextMenuContent({
|
|
78
|
-
className,
|
|
79
|
-
...props
|
|
80
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.Content>) {
|
|
81
|
-
return (
|
|
82
|
-
<ContextMenuPrimitive.Portal>
|
|
83
|
-
<ContextMenuPrimitive.Content
|
|
84
|
-
data-slot="context-menu-content"
|
|
85
|
-
className={cn(
|
|
86
|
-
'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',
|
|
87
|
-
className,
|
|
88
|
-
)}
|
|
89
|
-
{...props}
|
|
90
|
-
/>
|
|
91
|
-
</ContextMenuPrimitive.Portal>
|
|
92
|
-
);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
function ContextMenuItem({
|
|
96
|
-
className,
|
|
97
|
-
inset,
|
|
98
|
-
variant = 'default',
|
|
99
|
-
...props
|
|
100
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.Item> & {
|
|
101
|
-
inset?: boolean;
|
|
102
|
-
variant?: 'default' | 'destructive';
|
|
103
|
-
}) {
|
|
104
|
-
return (
|
|
105
|
-
<ContextMenuPrimitive.Item
|
|
106
|
-
data-slot="context-menu-item"
|
|
107
|
-
data-inset={inset}
|
|
108
|
-
data-variant={variant}
|
|
109
|
-
className={cn(
|
|
110
|
-
"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",
|
|
111
|
-
className,
|
|
112
|
-
)}
|
|
113
|
-
{...props}
|
|
114
|
-
/>
|
|
115
|
-
);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
function ContextMenuCheckboxItem({
|
|
119
|
-
className,
|
|
120
|
-
children,
|
|
121
|
-
checked,
|
|
122
|
-
...props
|
|
123
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem>) {
|
|
124
|
-
return (
|
|
125
|
-
<ContextMenuPrimitive.CheckboxItem
|
|
126
|
-
data-slot="context-menu-checkbox-item"
|
|
127
|
-
className={cn(
|
|
128
|
-
"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",
|
|
129
|
-
className,
|
|
130
|
-
)}
|
|
131
|
-
checked={checked}
|
|
132
|
-
{...props}
|
|
133
|
-
>
|
|
134
|
-
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
135
|
-
<ContextMenuPrimitive.ItemIndicator>
|
|
136
|
-
<CheckIcon className="size-4" />
|
|
137
|
-
</ContextMenuPrimitive.ItemIndicator>
|
|
138
|
-
</span>
|
|
139
|
-
{children}
|
|
140
|
-
</ContextMenuPrimitive.CheckboxItem>
|
|
141
|
-
);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
function ContextMenuRadioItem({
|
|
145
|
-
className,
|
|
146
|
-
children,
|
|
147
|
-
...props
|
|
148
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.RadioItem>) {
|
|
149
|
-
return (
|
|
150
|
-
<ContextMenuPrimitive.RadioItem
|
|
151
|
-
data-slot="context-menu-radio-item"
|
|
152
|
-
className={cn(
|
|
153
|
-
"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",
|
|
154
|
-
className,
|
|
155
|
-
)}
|
|
156
|
-
{...props}
|
|
157
|
-
>
|
|
158
|
-
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
159
|
-
<ContextMenuPrimitive.ItemIndicator>
|
|
160
|
-
<CircleIcon className="size-2 fill-current" />
|
|
161
|
-
</ContextMenuPrimitive.ItemIndicator>
|
|
162
|
-
</span>
|
|
163
|
-
{children}
|
|
164
|
-
</ContextMenuPrimitive.RadioItem>
|
|
165
|
-
);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
function ContextMenuLabel({
|
|
169
|
-
className,
|
|
170
|
-
inset,
|
|
171
|
-
...props
|
|
172
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.Label> & {
|
|
173
|
-
inset?: boolean;
|
|
174
|
-
}) {
|
|
175
|
-
return (
|
|
176
|
-
<ContextMenuPrimitive.Label
|
|
177
|
-
data-slot="context-menu-label"
|
|
178
|
-
data-inset={inset}
|
|
179
|
-
className={cn('text-foreground px-2 py-1.5 text-sm font-medium data-[inset]:pl-8', className)}
|
|
180
|
-
{...props}
|
|
181
|
-
/>
|
|
182
|
-
);
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
function ContextMenuSeparator({
|
|
186
|
-
className,
|
|
187
|
-
...props
|
|
188
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.Separator>) {
|
|
189
|
-
return (
|
|
190
|
-
<ContextMenuPrimitive.Separator
|
|
191
|
-
data-slot="context-menu-separator"
|
|
192
|
-
className={cn('bg-border -mx-1 my-1 h-px', className)}
|
|
193
|
-
{...props}
|
|
194
|
-
/>
|
|
195
|
-
);
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
function ContextMenuShortcut({ className, ...props }: React.ComponentProps<'span'>) {
|
|
199
|
-
return (
|
|
200
|
-
<span
|
|
201
|
-
data-slot="context-menu-shortcut"
|
|
202
|
-
className={cn('text-muted-foreground ml-auto text-xs tracking-widest', className)}
|
|
203
|
-
{...props}
|
|
204
|
-
/>
|
|
205
|
-
);
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
export {
|
|
209
|
-
ContextMenu,
|
|
210
|
-
ContextMenuTrigger,
|
|
211
|
-
ContextMenuContent,
|
|
212
|
-
ContextMenuItem,
|
|
213
|
-
ContextMenuCheckboxItem,
|
|
214
|
-
ContextMenuRadioItem,
|
|
215
|
-
ContextMenuLabel,
|
|
216
|
-
ContextMenuSeparator,
|
|
217
|
-
ContextMenuShortcut,
|
|
218
|
-
ContextMenuGroup,
|
|
219
|
-
ContextMenuPortal,
|
|
220
|
-
ContextMenuSub,
|
|
221
|
-
ContextMenuSubContent,
|
|
222
|
-
ContextMenuSubTrigger,
|
|
223
|
-
ContextMenuRadioGroup,
|
|
224
|
-
};
|