@olympusoss/canvas 2.20.2 → 3.2.0
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/README.md +73 -35
- package/package.json +46 -177
- package/src/cn.ts +3 -0
- package/src/index.ts +12 -603
- package/src/theme.ts +62 -0
- package/src/tokens.ts +11 -0
- package/styles/atoms/avatar.css +22 -0
- package/styles/atoms/badge.css +83 -0
- package/styles/atoms/breadcrumb.css +35 -0
- package/styles/atoms/button-group.css +23 -0
- package/styles/atoms/button.css +107 -0
- package/styles/atoms/checkbox.css +55 -0
- package/styles/atoms/combobox.css +75 -0
- package/styles/atoms/dropdown.css +54 -0
- package/styles/atoms/icon.css +8 -0
- package/styles/atoms/input-group.css +45 -0
- package/styles/atoms/input.css +56 -0
- package/styles/atoms/kbd.css +15 -0
- package/styles/atoms/pagination.css +48 -0
- package/styles/atoms/popover.css +14 -0
- package/styles/atoms/radio.css +28 -0
- package/styles/atoms/select.css +57 -0
- package/styles/atoms/separator.css +32 -0
- package/styles/atoms/skeleton.css +32 -0
- package/styles/atoms/spinner.css +26 -0
- package/styles/atoms/switch.css +45 -0
- package/styles/atoms/textarea.css +31 -0
- package/styles/atoms/tooltip.css +53 -0
- package/styles/atoms/typography.css +105 -0
- package/styles/base.css +17 -0
- package/styles/canvas.css +77 -52
- package/styles/molecules/alert.css +66 -0
- package/styles/molecules/card.css +58 -0
- package/styles/molecules/code-block.css +18 -0
- package/styles/molecules/empty-state.css +17 -0
- package/styles/molecules/field.css +27 -0
- package/styles/molecules/form.css +27 -0
- package/styles/molecules/page-header.css +52 -0
- package/styles/molecules/section-card.css +49 -0
- package/styles/molecules/stat-card.css +71 -0
- package/styles/molecules/toast.css +95 -0
- package/styles/organisms/app-shell.css +46 -0
- package/styles/organisms/calendar.css +73 -0
- package/styles/organisms/command.css +94 -0
- package/styles/organisms/data-table.css +142 -0
- package/styles/organisms/dialog.css +72 -0
- package/styles/organisms/filter-panel.css +58 -0
- package/styles/organisms/row-menu.css +69 -0
- package/styles/organisms/sheet.css +70 -0
- package/styles/organisms/sidebar.css +146 -0
- package/styles/organisms/stepper.css +63 -0
- package/styles/organisms/tabs.css +40 -0
- package/styles/organisms/topbar.css +24 -0
- package/styles/patterns/backdrops.css +35 -0
- package/styles/patterns/density.css +66 -0
- package/styles/patterns/focus.css +22 -0
- package/styles/patterns/glass.css +85 -0
- package/styles/patterns/high-contrast.css +70 -0
- package/styles/patterns/reduced-motion.css +12 -0
- package/styles/patterns/scrollbar.css +10 -0
- package/styles/reset.css +89 -0
- package/styles/tokens/colors.css +106 -0
- package/styles/tokens/motion.css +33 -0
- package/styles/tokens/radius.css +10 -0
- package/styles/tokens/shadows.css +35 -0
- package/styles/tokens/spacing.css +19 -0
- package/styles/tokens/typography.css +6 -0
- package/styles/tokens/z-index.css +12 -0
- package/styles/utilities/display.css +66 -0
- package/styles/utilities/flexbox.css +240 -0
- package/styles/utilities/gap.css +288 -0
- package/styles/utilities/grid.css +138 -0
- package/styles/utilities/position.css +78 -0
- package/styles/utilities/sizing.css +138 -0
- package/tsconfig.json +20 -21
- package/src/components/atoms/README.md +0 -11
- package/src/components/atoms/aspect-ratio.tsx +0 -32
- package/src/components/atoms/avatar.tsx +0 -98
- package/src/components/atoms/badge.tsx +0 -44
- package/src/components/atoms/brand-mark.tsx +0 -74
- package/src/components/atoms/button.tsx +0 -105
- package/src/components/atoms/checkbox.tsx +0 -63
- package/src/components/atoms/flex-box.tsx +0 -105
- package/src/components/atoms/icon.tsx +0 -34
- package/src/components/atoms/input.tsx +0 -92
- package/src/components/atoms/label.tsx +0 -41
- package/src/components/atoms/logo.tsx +0 -89
- package/src/components/atoms/progress.tsx +0 -55
- package/src/components/atoms/radio-group.tsx +0 -122
- package/src/components/atoms/scroll-area.tsx +0 -106
- package/src/components/atoms/section.tsx +0 -48
- package/src/components/atoms/separator.tsx +0 -45
- package/src/components/atoms/skeleton.tsx +0 -17
- package/src/components/atoms/slider.tsx +0 -93
- package/src/components/atoms/spinner.tsx +0 -47
- package/src/components/atoms/switch.tsx +0 -60
- package/src/components/atoms/textarea.tsx +0 -78
- package/src/components/atoms/toggle.tsx +0 -80
- package/src/components/charts/activity-heatmap.tsx +0 -186
- package/src/components/charts/axes.tsx +0 -21
- package/src/components/charts/chart-container.tsx +0 -254
- package/src/components/charts/chart-legend.tsx +0 -67
- package/src/components/charts/chart-tooltip.tsx +0 -161
- package/src/components/charts/chart-types.tsx +0 -49
- package/src/components/charts/containers.tsx +0 -11
- package/src/components/charts/data.tsx +0 -16
- package/src/components/charts/details.tsx +0 -25
- package/src/components/charts/dot-pulse.tsx +0 -61
- package/src/components/charts/gauge.tsx +0 -106
- package/src/components/charts/grids.tsx +0 -8
- package/src/components/charts/index.ts +0 -62
- package/src/components/charts/labeled-bar-list.tsx +0 -85
- package/src/components/charts/metric-breakdown.tsx +0 -316
- package/src/components/charts/references.tsx +0 -8
- package/src/components/charts/service-health-list.tsx +0 -85
- package/src/components/charts/sparkline-area.tsx +0 -80
- package/src/components/charts/sparkline.tsx +0 -52
- package/src/components/charts/stacked-bar.tsx +0 -104
- package/src/components/charts/text.tsx +0 -10
- package/src/components/charts/world-heat-map-inner.tsx +0 -317
- package/src/components/charts/world-heat-map.tsx +0 -184
- package/src/components/molecules/README.md +0 -12
- package/src/components/molecules/action-bar.tsx +0 -73
- package/src/components/molecules/activity-item.tsx +0 -74
- package/src/components/molecules/alert.tsx +0 -86
- package/src/components/molecules/animated-background.tsx +0 -92
- package/src/components/molecules/auth-shell.tsx +0 -95
- package/src/components/molecules/brand-lockup.tsx +0 -48
- package/src/components/molecules/breadcrumb.tsx +0 -157
- package/src/components/molecules/button-group.tsx +0 -104
- package/src/components/molecules/calendar.tsx +0 -217
- package/src/components/molecules/card.tsx +0 -102
- package/src/components/molecules/client-brand.tsx +0 -95
- package/src/components/molecules/code-block.tsx +0 -86
- package/src/components/molecules/countdown-button.tsx +0 -92
- package/src/components/molecules/empty-state.tsx +0 -56
- package/src/components/molecules/error-state.tsx +0 -42
- package/src/components/molecules/field-display.tsx +0 -35
- package/src/components/molecules/input-otp.tsx +0 -74
- package/src/components/molecules/launcher-card.tsx +0 -152
- package/src/components/molecules/loading-state.tsx +0 -36
- package/src/components/molecules/notification-item.tsx +0 -67
- package/src/components/molecules/notification-list.tsx +0 -45
- package/src/components/molecules/number-badge.tsx +0 -53
- package/src/components/molecules/or-separator.tsx +0 -38
- package/src/components/molecules/page-header.tsx +0 -88
- package/src/components/molecules/page-tabs.tsx +0 -94
- package/src/components/molecules/pagination.tsx +0 -150
- package/src/components/molecules/password-input.tsx +0 -83
- package/src/components/molecules/password-strength-meter.tsx +0 -104
- package/src/components/molecules/phone-input.tsx +0 -200
- package/src/components/molecules/search-bar.tsx +0 -64
- package/src/components/molecules/secret-field.tsx +0 -158
- package/src/components/molecules/section-card.tsx +0 -91
- package/src/components/molecules/social-buttons.tsx +0 -165
- package/src/components/molecules/stat-card.tsx +0 -100
- package/src/components/molecules/status-badge.tsx +0 -42
- package/src/components/molecules/stepper.tsx +0 -96
- package/src/components/molecules/table.tsx +0 -157
- package/src/components/molecules/terminal.tsx +0 -74
- package/src/components/molecules/toggle-group.tsx +0 -145
- package/src/components/molecules/tooltip.tsx +0 -155
- package/src/components/molecules/user-avatar-chip.tsx +0 -71
- package/src/components/organisms/README.md +0 -14
- package/src/components/organisms/accordion.tsx +0 -154
- package/src/components/organisms/alert-dialog.tsx +0 -277
- package/src/components/organisms/carousel.tsx +0 -244
- package/src/components/organisms/collapsible.tsx +0 -69
- package/src/components/organisms/command.tsx +0 -144
- package/src/components/organisms/context-menu.tsx +0 -339
- package/src/components/organisms/dashboard-grid.tsx +0 -369
- package/src/components/organisms/data-table.tsx +0 -330
- package/src/components/organisms/dialog.tsx +0 -312
- package/src/components/organisms/drawer.tsx +0 -123
- package/src/components/organisms/dropdown-menu.tsx +0 -440
- package/src/components/organisms/editors/code-editor.tsx +0 -144
- package/src/components/organisms/editors/index.ts +0 -4
- package/src/components/organisms/editors/markdown-editor.tsx +0 -153
- package/src/components/organisms/editors/markdown-renderer.ts +0 -27
- package/src/components/organisms/editors/prose-canvas-classes.ts +0 -45
- package/src/components/organisms/editors/rich-text-editor.tsx +0 -126
- package/src/components/organisms/editors/toolbar/md-toolbar.tsx +0 -129
- package/src/components/organisms/editors/toolbar/rte-toolbar.tsx +0 -211
- package/src/components/organisms/editors/toolbar/toolbar-shell.tsx +0 -45
- package/src/components/organisms/editors/use-codemirror-theme.ts +0 -61
- package/src/components/organisms/error-boundary.tsx +0 -61
- package/src/components/organisms/form.tsx +0 -174
- package/src/components/organisms/hover-card.tsx +0 -115
- package/src/components/organisms/menubar.tsx +0 -498
- package/src/components/organisms/navbar.tsx +0 -104
- package/src/components/organisms/navigation-menu.tsx +0 -235
- package/src/components/organisms/popover.tsx +0 -149
- package/src/components/organisms/resizable.tsx +0 -58
- package/src/components/organisms/schema-form.tsx +0 -232
- package/src/components/organisms/select.tsx +0 -309
- package/src/components/organisms/sheet.tsx +0 -265
- package/src/components/organisms/sidebar.tsx +0 -1040
- package/src/components/organisms/sonner.tsx +0 -96
- package/src/components/organisms/tabs.tsx +0 -133
- package/src/components/organisms/theme-provider.tsx +0 -101
- package/src/hooks/use-mobile.tsx +0 -19
- package/src/lib/portal-container.tsx +0 -35
- package/src/lib/utils.ts +0 -6
- package/src/native.ts +0 -23
- package/src/tokens/colors.ts +0 -91
- package/src/tokens/index.ts +0 -3
- package/src/tokens/spacing.ts +0 -55
- package/src/tokens/typography.ts +0 -27
- package/styles/dashboard-grid.css +0 -47
- package/styles/fonts/Roboto-VariableFont_wdth_wght.ttf +0 -0
- package/styles/glass.css +0 -175
- package/styles/leaflet.css +0 -13
- package/styles/tokens.css +0 -317
- package/tailwind.config.ts +0 -70
|
@@ -1,339 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
|
|
4
|
-
import { Check, ChevronRight, Circle } from "lucide-react";
|
|
5
|
-
import * as React from "react";
|
|
6
|
-
|
|
7
|
-
import { usePortalContainer } from "../../lib/portal-container";
|
|
8
|
-
import { cn } from "../../lib/utils";
|
|
9
|
-
|
|
10
|
-
export interface ContextMenuProps extends React.ComponentProps<typeof ContextMenuPrimitive.Root> {
|
|
11
|
-
/** Reading direction. */
|
|
12
|
-
dir?: "ltr" | "rtl";
|
|
13
|
-
/** Fires when the user opens or closes the menu via right-click / long-press. */
|
|
14
|
-
onOpenChange?: (open: boolean) => void;
|
|
15
|
-
/**
|
|
16
|
-
* When true, blocks focus from leaving the menu.
|
|
17
|
-
* @default true
|
|
18
|
-
*/
|
|
19
|
-
modal?: boolean;
|
|
20
|
-
/** Trigger + Content. */
|
|
21
|
-
children?: React.ReactNode;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const ContextMenu = ContextMenuPrimitive.Root as React.FC<ContextMenuProps>;
|
|
25
|
-
|
|
26
|
-
export interface ContextMenuTriggerProps
|
|
27
|
-
extends React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Trigger> {
|
|
28
|
-
/**
|
|
29
|
-
* Disable the right-click trigger.
|
|
30
|
-
* @default false
|
|
31
|
-
*/
|
|
32
|
-
disabled?: boolean;
|
|
33
|
-
asChild?: boolean;
|
|
34
|
-
/** The element that opens the context menu on right-click / long-press. */
|
|
35
|
-
children?: React.ReactNode;
|
|
36
|
-
className?: string;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const ContextMenuTrigger = ContextMenuPrimitive.Trigger as React.ForwardRefExoticComponent<
|
|
40
|
-
ContextMenuTriggerProps & React.RefAttributes<HTMLSpanElement>
|
|
41
|
-
>;
|
|
42
|
-
|
|
43
|
-
export interface ContextMenuGroupProps
|
|
44
|
-
extends React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Group> {
|
|
45
|
-
children?: React.ReactNode;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const ContextMenuGroup = ContextMenuPrimitive.Group as React.ForwardRefExoticComponent<
|
|
49
|
-
ContextMenuGroupProps & React.RefAttributes<HTMLDivElement>
|
|
50
|
-
>;
|
|
51
|
-
|
|
52
|
-
export interface ContextMenuPortalProps
|
|
53
|
-
extends React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Portal> {
|
|
54
|
-
container?: HTMLElement | null;
|
|
55
|
-
forceMount?: true;
|
|
56
|
-
children?: React.ReactNode;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
const ContextMenuPortal = ContextMenuPrimitive.Portal as React.FC<ContextMenuPortalProps>;
|
|
60
|
-
|
|
61
|
-
export interface ContextMenuSubProps extends React.ComponentProps<typeof ContextMenuPrimitive.Sub> {
|
|
62
|
-
open?: boolean;
|
|
63
|
-
defaultOpen?: boolean;
|
|
64
|
-
onOpenChange?: (open: boolean) => void;
|
|
65
|
-
children?: React.ReactNode;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
const ContextMenuSub = ContextMenuPrimitive.Sub as React.FC<ContextMenuSubProps>;
|
|
69
|
-
|
|
70
|
-
export interface ContextMenuRadioGroupProps
|
|
71
|
-
extends React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioGroup> {
|
|
72
|
-
value?: string;
|
|
73
|
-
onValueChange?: (value: string) => void;
|
|
74
|
-
children?: React.ReactNode;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
const ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup as React.ForwardRefExoticComponent<
|
|
78
|
-
ContextMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>
|
|
79
|
-
>;
|
|
80
|
-
|
|
81
|
-
export interface ContextMenuSubTriggerProps
|
|
82
|
-
extends React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger> {
|
|
83
|
-
/**
|
|
84
|
-
* Add left padding to align with sibling checkbox/radio items.
|
|
85
|
-
* @default false
|
|
86
|
-
*/
|
|
87
|
-
inset?: boolean;
|
|
88
|
-
disabled?: boolean;
|
|
89
|
-
asChild?: boolean;
|
|
90
|
-
children?: React.ReactNode;
|
|
91
|
-
className?: string;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
const ContextMenuSubTrigger = React.forwardRef<
|
|
95
|
-
React.ElementRef<typeof ContextMenuPrimitive.SubTrigger>,
|
|
96
|
-
ContextMenuSubTriggerProps
|
|
97
|
-
>(({ className, inset, children, ...props }, ref) => (
|
|
98
|
-
<ContextMenuPrimitive.SubTrigger
|
|
99
|
-
ref={ref}
|
|
100
|
-
className={cn(
|
|
101
|
-
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
|
|
102
|
-
inset && "pl-8",
|
|
103
|
-
className,
|
|
104
|
-
)}
|
|
105
|
-
{...props}
|
|
106
|
-
>
|
|
107
|
-
{children}
|
|
108
|
-
<ChevronRight className="ml-auto h-4 w-4" />
|
|
109
|
-
</ContextMenuPrimitive.SubTrigger>
|
|
110
|
-
));
|
|
111
|
-
ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;
|
|
112
|
-
|
|
113
|
-
export interface ContextMenuSubContentProps
|
|
114
|
-
extends React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent> {
|
|
115
|
-
sideOffset?: number;
|
|
116
|
-
alignOffset?: number;
|
|
117
|
-
avoidCollisions?: boolean;
|
|
118
|
-
forceMount?: true;
|
|
119
|
-
asChild?: boolean;
|
|
120
|
-
children?: React.ReactNode;
|
|
121
|
-
className?: string;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
const ContextMenuSubContent = React.forwardRef<
|
|
125
|
-
React.ElementRef<typeof ContextMenuPrimitive.SubContent>,
|
|
126
|
-
ContextMenuSubContentProps
|
|
127
|
-
>(({ className, ...props }, ref) => (
|
|
128
|
-
<ContextMenuPrimitive.SubContent
|
|
129
|
-
ref={ref}
|
|
130
|
-
data-slot="context-menu-sub-content"
|
|
131
|
-
className={cn(
|
|
132
|
-
"z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-lg 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 origin-[var(--radix-context-menu-content-transform-origin)]",
|
|
133
|
-
className,
|
|
134
|
-
)}
|
|
135
|
-
{...props}
|
|
136
|
-
/>
|
|
137
|
-
));
|
|
138
|
-
ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;
|
|
139
|
-
|
|
140
|
-
export interface ContextMenuContentProps
|
|
141
|
-
extends React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content> {
|
|
142
|
-
/** Distance from the alignment edge (px). */
|
|
143
|
-
alignOffset?: number;
|
|
144
|
-
avoidCollisions?: boolean;
|
|
145
|
-
collisionPadding?: number | { top?: number; right?: number; bottom?: number; left?: number };
|
|
146
|
-
loop?: boolean;
|
|
147
|
-
forceMount?: true;
|
|
148
|
-
asChild?: boolean;
|
|
149
|
-
onEscapeKeyDown?: (event: KeyboardEvent) => void;
|
|
150
|
-
onPointerDownOutside?: (event: CustomEvent<{ originalEvent: PointerEvent }>) => void;
|
|
151
|
-
onInteractOutside?: (event: Event) => void;
|
|
152
|
-
children?: React.ReactNode;
|
|
153
|
-
className?: string;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
const ContextMenuContent = React.forwardRef<
|
|
157
|
-
React.ElementRef<typeof ContextMenuPrimitive.Content>,
|
|
158
|
-
ContextMenuContentProps
|
|
159
|
-
>(({ className, ...props }, ref) => {
|
|
160
|
-
const container = usePortalContainer();
|
|
161
|
-
return (
|
|
162
|
-
<ContextMenuPrimitive.Portal container={container ?? undefined}>
|
|
163
|
-
<ContextMenuPrimitive.Content
|
|
164
|
-
ref={ref}
|
|
165
|
-
data-slot="context-menu-content"
|
|
166
|
-
className={cn(
|
|
167
|
-
"z-50 max-h-[var(--radix-context-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md 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 origin-[var(--radix-context-menu-content-transform-origin)]",
|
|
168
|
-
className,
|
|
169
|
-
)}
|
|
170
|
-
{...props}
|
|
171
|
-
/>
|
|
172
|
-
</ContextMenuPrimitive.Portal>
|
|
173
|
-
);
|
|
174
|
-
});
|
|
175
|
-
ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;
|
|
176
|
-
|
|
177
|
-
export interface ContextMenuItemProps
|
|
178
|
-
extends React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> {
|
|
179
|
-
/** Add left padding to align with checkbox/radio items. */
|
|
180
|
-
inset?: boolean;
|
|
181
|
-
disabled?: boolean;
|
|
182
|
-
onSelect?: (event: Event) => void;
|
|
183
|
-
asChild?: boolean;
|
|
184
|
-
children?: React.ReactNode;
|
|
185
|
-
className?: string;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
const ContextMenuItem = React.forwardRef<
|
|
189
|
-
React.ElementRef<typeof ContextMenuPrimitive.Item>,
|
|
190
|
-
ContextMenuItemProps
|
|
191
|
-
>(({ className, inset, ...props }, ref) => (
|
|
192
|
-
<ContextMenuPrimitive.Item
|
|
193
|
-
ref={ref}
|
|
194
|
-
className={cn(
|
|
195
|
-
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
196
|
-
inset && "pl-8",
|
|
197
|
-
className,
|
|
198
|
-
)}
|
|
199
|
-
{...props}
|
|
200
|
-
/>
|
|
201
|
-
));
|
|
202
|
-
ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;
|
|
203
|
-
|
|
204
|
-
export interface ContextMenuCheckboxItemProps
|
|
205
|
-
extends React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.CheckboxItem> {
|
|
206
|
-
checked?: boolean | "indeterminate";
|
|
207
|
-
onCheckedChange?: (checked: boolean) => void;
|
|
208
|
-
disabled?: boolean;
|
|
209
|
-
onSelect?: (event: Event) => void;
|
|
210
|
-
asChild?: boolean;
|
|
211
|
-
children?: React.ReactNode;
|
|
212
|
-
className?: string;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
const ContextMenuCheckboxItem = React.forwardRef<
|
|
216
|
-
React.ElementRef<typeof ContextMenuPrimitive.CheckboxItem>,
|
|
217
|
-
ContextMenuCheckboxItemProps
|
|
218
|
-
>(({ className, children, checked, ...props }, ref) => (
|
|
219
|
-
<ContextMenuPrimitive.CheckboxItem
|
|
220
|
-
ref={ref}
|
|
221
|
-
className={cn(
|
|
222
|
-
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
223
|
-
className,
|
|
224
|
-
)}
|
|
225
|
-
checked={checked}
|
|
226
|
-
{...props}
|
|
227
|
-
>
|
|
228
|
-
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
229
|
-
<ContextMenuPrimitive.ItemIndicator>
|
|
230
|
-
<Check className="h-4 w-4" />
|
|
231
|
-
</ContextMenuPrimitive.ItemIndicator>
|
|
232
|
-
</span>
|
|
233
|
-
{children}
|
|
234
|
-
</ContextMenuPrimitive.CheckboxItem>
|
|
235
|
-
));
|
|
236
|
-
ContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;
|
|
237
|
-
|
|
238
|
-
export interface ContextMenuRadioItemProps
|
|
239
|
-
extends React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioItem> {
|
|
240
|
-
value: string;
|
|
241
|
-
disabled?: boolean;
|
|
242
|
-
onSelect?: (event: Event) => void;
|
|
243
|
-
asChild?: boolean;
|
|
244
|
-
children?: React.ReactNode;
|
|
245
|
-
className?: string;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
const ContextMenuRadioItem = React.forwardRef<
|
|
249
|
-
React.ElementRef<typeof ContextMenuPrimitive.RadioItem>,
|
|
250
|
-
ContextMenuRadioItemProps
|
|
251
|
-
>(({ className, children, ...props }, ref) => (
|
|
252
|
-
<ContextMenuPrimitive.RadioItem
|
|
253
|
-
ref={ref}
|
|
254
|
-
className={cn(
|
|
255
|
-
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
256
|
-
className,
|
|
257
|
-
)}
|
|
258
|
-
{...props}
|
|
259
|
-
>
|
|
260
|
-
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
261
|
-
<ContextMenuPrimitive.ItemIndicator>
|
|
262
|
-
<Circle className="h-4 w-4 fill-current" />
|
|
263
|
-
</ContextMenuPrimitive.ItemIndicator>
|
|
264
|
-
</span>
|
|
265
|
-
{children}
|
|
266
|
-
</ContextMenuPrimitive.RadioItem>
|
|
267
|
-
));
|
|
268
|
-
ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;
|
|
269
|
-
|
|
270
|
-
export interface ContextMenuLabelProps
|
|
271
|
-
extends React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Label> {
|
|
272
|
-
inset?: boolean;
|
|
273
|
-
asChild?: boolean;
|
|
274
|
-
children?: React.ReactNode;
|
|
275
|
-
className?: string;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
const ContextMenuLabel = React.forwardRef<
|
|
279
|
-
React.ElementRef<typeof ContextMenuPrimitive.Label>,
|
|
280
|
-
ContextMenuLabelProps
|
|
281
|
-
>(({ className, inset, ...props }, ref) => (
|
|
282
|
-
<ContextMenuPrimitive.Label
|
|
283
|
-
ref={ref}
|
|
284
|
-
className={cn("px-2 py-1.5 text-sm font-semibold text-foreground", inset && "pl-8", className)}
|
|
285
|
-
{...props}
|
|
286
|
-
/>
|
|
287
|
-
));
|
|
288
|
-
ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;
|
|
289
|
-
|
|
290
|
-
export interface ContextMenuSeparatorProps
|
|
291
|
-
extends React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Separator> {
|
|
292
|
-
asChild?: boolean;
|
|
293
|
-
className?: string;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
const ContextMenuSeparator = React.forwardRef<
|
|
297
|
-
React.ElementRef<typeof ContextMenuPrimitive.Separator>,
|
|
298
|
-
ContextMenuSeparatorProps
|
|
299
|
-
>(({ className, ...props }, ref) => (
|
|
300
|
-
<ContextMenuPrimitive.Separator
|
|
301
|
-
ref={ref}
|
|
302
|
-
className={cn("-mx-1 my-1 h-px bg-border", className)}
|
|
303
|
-
{...props}
|
|
304
|
-
/>
|
|
305
|
-
));
|
|
306
|
-
ContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;
|
|
307
|
-
|
|
308
|
-
export interface ContextMenuShortcutProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
309
|
-
children?: React.ReactNode;
|
|
310
|
-
className?: string;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
const ContextMenuShortcut = ({ className, ...props }: ContextMenuShortcutProps) => {
|
|
314
|
-
return (
|
|
315
|
-
<span
|
|
316
|
-
className={cn("ml-auto text-xs tracking-widest text-muted-foreground", className)}
|
|
317
|
-
{...props}
|
|
318
|
-
/>
|
|
319
|
-
);
|
|
320
|
-
};
|
|
321
|
-
ContextMenuShortcut.displayName = "ContextMenuShortcut";
|
|
322
|
-
|
|
323
|
-
export {
|
|
324
|
-
ContextMenu,
|
|
325
|
-
ContextMenuCheckboxItem,
|
|
326
|
-
ContextMenuContent,
|
|
327
|
-
ContextMenuGroup,
|
|
328
|
-
ContextMenuItem,
|
|
329
|
-
ContextMenuLabel,
|
|
330
|
-
ContextMenuPortal,
|
|
331
|
-
ContextMenuRadioGroup,
|
|
332
|
-
ContextMenuRadioItem,
|
|
333
|
-
ContextMenuSeparator,
|
|
334
|
-
ContextMenuShortcut,
|
|
335
|
-
ContextMenuSub,
|
|
336
|
-
ContextMenuSubContent,
|
|
337
|
-
ContextMenuSubTrigger,
|
|
338
|
-
ContextMenuTrigger,
|
|
339
|
-
};
|