@rangka/client 0.1.0 → 0.1.2
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/App.d.ts.map +1 -1
- package/dist/App.js +7 -1
- package/dist/App.js.map +1 -1
- package/dist/components/ui/input-group.d.ts +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +20 -0
- package/dist/main.js.map +1 -1
- package/dist/shell/assets/AttachmentWidget-BTTGroHP.js +1 -0
- package/dist/shell/assets/AttachmentsWidget-DZgvmO9P.js +1 -0
- package/dist/shell/assets/BadgeWidget-DN6GsAAG.js +1 -0
- package/dist/shell/assets/CardWidget-qX-UvqJh.js +1 -0
- package/dist/shell/assets/CheckboxWidget-CYPZ85ih.js +1 -0
- package/dist/shell/assets/CodeWidget-DnVtHG1d.js +1 -0
- package/dist/shell/assets/ColumnWidget-CYmFCVOf.js +1 -0
- package/dist/shell/assets/ComputedWidget-BQApkfir.js +1 -0
- package/dist/shell/assets/DatePickerWidget-pEusSy9D.js +1 -0
- package/dist/shell/assets/DatetimeWidget-M0fEGDTD.js +1 -0
- package/dist/shell/assets/DividerWidget-hXVGhIKC.js +1 -0
- package/dist/shell/assets/DrawerWidget-DynL7EIy.js +1 -0
- package/dist/shell/assets/DynamicLinkWidget-ChMJ5DAf.js +1 -0
- package/dist/shell/assets/IconWidget-Cgo9txq1.js +1 -0
- package/dist/shell/assets/ImageWidget-YUv1_OQK.js +1 -0
- package/dist/shell/assets/JsonWidget-RHUHhXHJ.js +1 -0
- package/dist/shell/assets/LinkWidget-CIu7qmb2.js +1 -0
- package/dist/shell/assets/ManyToManyWidget-DCQnygvZ.js +1 -0
- package/dist/shell/assets/ModalWidget-FggzYaS2.js +1 -0
- package/dist/shell/assets/MoneyWidget-CKjOSucD.js +1 -0
- package/dist/shell/assets/RepeatWidget-Dfp4zW4d.js +1 -0
- package/dist/shell/assets/ScrollAreaWidget-CdFdf4rv.js +1 -0
- package/dist/shell/assets/SequenceWidget-DIXHZslz.js +1 -0
- package/dist/shell/assets/SpacerWidget-BgM4dC6x.js +1 -0
- package/dist/shell/assets/SplitWidget-_mcQkjQk.js +1 -0
- package/dist/shell/assets/StackWidget-BI_VIreo.js +1 -0
- package/dist/shell/assets/TableWidget-DuIvd6qR.js +1 -0
- package/dist/shell/assets/TextareaWidget-CATua7Ls.js +1 -0
- package/dist/shell/assets/TreeWidget-BoHlhfza.js +1 -0
- package/dist/shell/assets/calendar-DqckiKt1.js +1 -0
- package/dist/shell/assets/index-63v1sBS3.css +1 -0
- package/dist/shell/assets/index-D1wStSrO.js +8635 -0
- package/dist/shell/assets/popover-DywIKFaQ.js +1 -0
- package/dist/shell/assets/textarea-BVCZevA6.js +1 -0
- package/dist/shell/assets/useSurfaceContext-kzu9770H.js +1 -0
- package/dist/shell/assets/vendor-query-dRdWN_eK.js +1 -0
- package/dist/shell/assets/vendor-radix-D-Trh8JA.js +69 -0
- package/dist/shell/assets/vendor-router-B1WM9yRc.js +17 -0
- package/dist/shell/index.html +5 -2
- package/dist/theme.css +82 -0
- package/dist/widgets/components/lazy-manifest.d.ts +11 -0
- package/dist/widgets/components/lazy-manifest.d.ts.map +1 -0
- package/dist/widgets/components/lazy-manifest.js +32 -0
- package/dist/widgets/components/lazy-manifest.js.map +1 -0
- package/dist/widgets/components/register.d.ts.map +1 -1
- package/dist/widgets/components/register.js +0 -58
- package/dist/widgets/components/register.js.map +1 -1
- package/dist/widgets/loader.d.ts +3 -0
- package/dist/widgets/loader.d.ts.map +1 -0
- package/dist/widgets/loader.js +99 -0
- package/dist/widgets/loader.js.map +1 -0
- package/dist/widgets/renderer/LazyWidget.d.ts +8 -0
- package/dist/widgets/renderer/LazyWidget.d.ts.map +1 -0
- package/dist/widgets/renderer/LazyWidget.js +31 -0
- package/dist/widgets/renderer/LazyWidget.js.map +1 -0
- package/dist/widgets/renderer/WidgetErrorBoundary.d.ts +17 -0
- package/dist/widgets/renderer/WidgetErrorBoundary.d.ts.map +1 -0
- package/dist/widgets/renderer/WidgetErrorBoundary.js +18 -0
- package/dist/widgets/renderer/WidgetErrorBoundary.js.map +1 -0
- package/dist/widgets/renderer/WidgetRenderer.d.ts.map +1 -1
- package/dist/widgets/renderer/WidgetRenderer.js +8 -6
- package/dist/widgets/renderer/WidgetRenderer.js.map +1 -1
- package/package.json +7 -4
- package/.claude/skills/add-widget/SKILL.md +0 -101
- package/.turbo/turbo-build.log +0 -29
- package/CHANGELOG.md +0 -18
- package/CLAUDE.md +0 -236
- package/components.json +0 -25
- package/dist/components/ui/chart.d.ts +0 -45
- package/dist/components/ui/chart.d.ts.map +0 -1
- package/dist/components/ui/chart.js +0 -119
- package/dist/components/ui/chart.js.map +0 -1
- package/dist/shell/assets/index--35CAvcP.js +0 -8715
- package/dist/shell/assets/index-COLmoPYo.css +0 -1
- package/index.html +0 -12
- package/src/App.tsx +0 -44
- package/src/__tests__/setup.ts +0 -1
- package/src/api/auth.ts +0 -41
- package/src/api/boot.ts +0 -10
- package/src/api/client.ts +0 -26
- package/src/api/paths.ts +0 -3
- package/src/api/token.ts +0 -13
- package/src/auth/LoginForm.tsx +0 -67
- package/src/auth/SessionExpired.tsx +0 -24
- package/src/auth/SetupForm.tsx +0 -76
- package/src/boot/BootGate.tsx +0 -35
- package/src/boot/BootProvider.tsx +0 -28
- package/src/boot/types.ts +0 -9
- package/src/boot/useBoot.ts +0 -111
- package/src/components/Icon.tsx +0 -17
- package/src/components/ui/accordion.tsx +0 -82
- package/src/components/ui/alert-dialog.tsx +0 -180
- package/src/components/ui/alert.tsx +0 -76
- package/src/components/ui/aspect-ratio.tsx +0 -9
- package/src/components/ui/avatar.tsx +0 -94
- package/src/components/ui/badge.tsx +0 -45
- package/src/components/ui/breadcrumb.tsx +0 -104
- package/src/components/ui/button-group.tsx +0 -78
- package/src/components/ui/button.tsx +0 -65
- package/src/components/ui/calendar.tsx +0 -187
- package/src/components/ui/card.tsx +0 -85
- package/src/components/ui/carousel.tsx +0 -229
- package/src/components/ui/chart.tsx +0 -339
- package/src/components/ui/checkbox.tsx +0 -27
- package/src/components/ui/collapsible.tsx +0 -21
- package/src/components/ui/combobox.tsx +0 -275
- package/src/components/ui/command.tsx +0 -178
- package/src/components/ui/context-menu.tsx +0 -242
- package/src/components/ui/dialog.tsx +0 -146
- package/src/components/ui/direction.tsx +0 -20
- package/src/components/ui/drawer.tsx +0 -118
- package/src/components/ui/dropdown-menu.tsx +0 -247
- package/src/components/ui/empty.tsx +0 -94
- package/src/components/ui/field.tsx +0 -224
- package/src/components/ui/hover-card.tsx +0 -36
- package/src/components/ui/input-group.tsx +0 -142
- package/src/components/ui/input-otp.tsx +0 -86
- package/src/components/ui/input.tsx +0 -19
- package/src/components/ui/item.tsx +0 -182
- package/src/components/ui/kbd.tsx +0 -26
- package/src/components/ui/label.tsx +0 -19
- package/src/components/ui/menubar.tsx +0 -260
- package/src/components/ui/native-select.tsx +0 -55
- package/src/components/ui/navigation-menu.tsx +0 -160
- package/src/components/ui/pagination.tsx +0 -112
- package/src/components/ui/popover.tsx +0 -74
- package/src/components/ui/progress.tsx +0 -31
- package/src/components/ui/radio-group.tsx +0 -42
- package/src/components/ui/resizable.tsx +0 -42
- package/src/components/ui/scroll-area.tsx +0 -53
- package/src/components/ui/select.tsx +0 -185
- package/src/components/ui/separator.tsx +0 -26
- package/src/components/ui/sheet.tsx +0 -128
- package/src/components/ui/sidebar.tsx +0 -669
- package/src/components/ui/skeleton.tsx +0 -13
- package/src/components/ui/slider.tsx +0 -54
- package/src/components/ui/sonner.tsx +0 -43
- package/src/components/ui/spinner.tsx +0 -16
- package/src/components/ui/switch.tsx +0 -33
- package/src/components/ui/table.tsx +0 -87
- package/src/components/ui/tabs.tsx +0 -80
- package/src/components/ui/textarea.tsx +0 -18
- package/src/components/ui/toggle-group.tsx +0 -86
- package/src/components/ui/toggle.tsx +0 -44
- package/src/components/ui/tooltip.tsx +0 -53
- package/src/context/MetaContext.tsx +0 -22
- package/src/context/ModuleContext.tsx +0 -62
- package/src/context/PermissionsContext.tsx +0 -39
- package/src/context/ShellProviders.tsx +0 -33
- package/src/context/UserContext.tsx +0 -16
- package/src/data/QueryProvider.tsx +0 -7
- package/src/data/queryClient.ts +0 -18
- package/src/data/useModelMeta.ts +0 -17
- package/src/data/useMutation.ts +0 -60
- package/src/data/useRecord.ts +0 -29
- package/src/data/useSource.ts +0 -112
- package/src/hooks/use-mobile.ts +0 -19
- package/src/index.css +0 -260
- package/src/index.ts +0 -16
- package/src/lib/utils.ts +0 -6
- package/src/main.tsx +0 -17
- package/src/router/NotFound.tsx +0 -8
- package/src/router/RouterProvider.tsx +0 -7
- package/src/router/buildRouteTree.tsx +0 -63
- package/src/router/createShellRouter.ts +0 -9
- package/src/router/hooks.ts +0 -43
- package/src/shell/CommandPalette.tsx +0 -76
- package/src/shell/ConfirmDialog.tsx +0 -34
- package/src/shell/ConfirmProvider.tsx +0 -56
- package/src/shell/DrawerContext.tsx +0 -44
- package/src/shell/HeaderActions.tsx +0 -31
- package/src/shell/ModuleSelectorPage.tsx +0 -149
- package/src/shell/PageOutlet.tsx +0 -21
- package/src/shell/ShellContext.tsx +0 -45
- package/src/shell/ShellDevTools.tsx +0 -153
- package/src/shell/ShellLayout.tsx +0 -231
- package/src/shell/Toast.tsx +0 -58
- package/src/shell/ToastProvider.tsx +0 -60
- package/src/shell/app-sidebar/AppSidebar.tsx +0 -44
- package/src/shell/app-sidebar/ModuleSwitcher.tsx +0 -87
- package/src/shell/app-sidebar/NavMain.tsx +0 -64
- package/src/shell/app-sidebar/NavUser.tsx +0 -97
- package/src/shell/app-sidebar/SearchMenu.tsx +0 -22
- package/src/shell/app-sidebar/index.ts +0 -8
- package/src/shell/app-sidebar/types.ts +0 -38
- package/src/shell/types.ts +0 -6
- package/src/shell/useBreadcrumbs.ts +0 -42
- package/src/studio/bridge.ts +0 -125
- package/src/studio/index.ts +0 -3
- package/src/studio/overlay.ts +0 -47
- package/src/studio/types.ts +0 -32
- package/src/studio/walker.ts +0 -48
- package/src/vite-env.d.ts +0 -1
- package/src/widgets/__tests__/action-edge-cases.test.ts +0 -281
- package/src/widgets/__tests__/action.test.ts +0 -236
- package/src/widgets/__tests__/attachment-widget.test.tsx +0 -85
- package/src/widgets/__tests__/attachments-widget.test.tsx +0 -109
- package/src/widgets/__tests__/binding.test.ts +0 -76
- package/src/widgets/__tests__/button-widget.test.tsx +0 -145
- package/src/widgets/__tests__/checkbox-widget.test.tsx +0 -158
- package/src/widgets/__tests__/code-widget.test.tsx +0 -64
- package/src/widgets/__tests__/computed-widget.test.tsx +0 -62
- package/src/widgets/__tests__/condition-edge-cases.test.ts +0 -120
- package/src/widgets/__tests__/condition.test.ts +0 -221
- package/src/widgets/__tests__/context.test.ts +0 -99
- package/src/widgets/__tests__/data-widget.test.tsx +0 -204
- package/src/widgets/__tests__/datepicker-widget.test.tsx +0 -66
- package/src/widgets/__tests__/datetime-widget.test.tsx +0 -67
- package/src/widgets/__tests__/drawer-widget.test.tsx +0 -149
- package/src/widgets/__tests__/dynamic-link-widget.test.tsx +0 -52
- package/src/widgets/__tests__/edge-cases.test.ts +0 -232
- package/src/widgets/__tests__/evaluator.test.ts +0 -107
- package/src/widgets/__tests__/functions.test.ts +0 -147
- package/src/widgets/__tests__/grid-widget.test.tsx +0 -137
- package/src/widgets/__tests__/hooks.test.tsx +0 -249
- package/src/widgets/__tests__/icon-widget.test.tsx +0 -129
- package/src/widgets/__tests__/input-widget.test.tsx +0 -264
- package/src/widgets/__tests__/integration.test.ts +0 -116
- package/src/widgets/__tests__/json-widget.test.tsx +0 -70
- package/src/widgets/__tests__/link-widget.test.tsx +0 -92
- package/src/widgets/__tests__/many-to-many-widget.test.tsx +0 -93
- package/src/widgets/__tests__/modal-widget.test.tsx +0 -148
- package/src/widgets/__tests__/money-widget.test.tsx +0 -97
- package/src/widgets/__tests__/parser.test.ts +0 -171
- package/src/widgets/__tests__/reactive-variables.test.ts +0 -383
- package/src/widgets/__tests__/renderer.test.tsx +0 -300
- package/src/widgets/__tests__/repeat-widget.test.tsx +0 -229
- package/src/widgets/__tests__/select-widget.test.tsx +0 -231
- package/src/widgets/__tests__/sequence-widget.test.tsx +0 -58
- package/src/widgets/__tests__/shell-integration.test.tsx +0 -1343
- package/src/widgets/__tests__/split-widget.test.tsx +0 -133
- package/src/widgets/__tests__/state-edge-cases.test.ts +0 -118
- package/src/widgets/__tests__/state.test.ts +0 -106
- package/src/widgets/__tests__/table-data-binding.test.tsx +0 -482
- package/src/widgets/__tests__/table-filter-popover.test.tsx +0 -486
- package/src/widgets/__tests__/table-search.test.tsx +0 -305
- package/src/widgets/__tests__/table-widget.test.tsx +0 -509
- package/src/widgets/__tests__/textarea-widget.test.tsx +0 -105
- package/src/widgets/__tests__/tracker-validator-edge-cases.test.ts +0 -242
- package/src/widgets/__tests__/tracker.test.ts +0 -133
- package/src/widgets/__tests__/tree-widget.test.tsx +0 -97
- package/src/widgets/__tests__/use-model-source.test.ts +0 -67
- package/src/widgets/__tests__/validator.test.ts +0 -208
- package/src/widgets/action/dispatcher.ts +0 -334
- package/src/widgets/action/index.ts +0 -2
- package/src/widgets/binding/index.ts +0 -2
- package/src/widgets/binding/resolver.ts +0 -61
- package/src/widgets/components/AttachmentWidget.tsx +0 -111
- package/src/widgets/components/AttachmentsWidget.tsx +0 -121
- package/src/widgets/components/BadgeWidget.tsx +0 -35
- package/src/widgets/components/ButtonWidget.tsx +0 -43
- package/src/widgets/components/CardWidget.tsx +0 -68
- package/src/widgets/components/CheckboxWidget.tsx +0 -39
- package/src/widgets/components/CodeWidget.tsx +0 -44
- package/src/widgets/components/ColumnWidget.tsx +0 -22
- package/src/widgets/components/ComputedWidget.tsx +0 -49
- package/src/widgets/components/DataWidget.tsx +0 -189
- package/src/widgets/components/DatePickerWidget.tsx +0 -73
- package/src/widgets/components/DatetimeWidget.tsx +0 -160
- package/src/widgets/components/DividerWidget.tsx +0 -37
- package/src/widgets/components/DrawerWidget.tsx +0 -52
- package/src/widgets/components/DynamicLinkWidget.tsx +0 -130
- package/src/widgets/components/GridWidget.tsx +0 -134
- package/src/widgets/components/GroupWidget.tsx +0 -111
- package/src/widgets/components/IconWidget.tsx +0 -29
- package/src/widgets/components/ImageWidget.tsx +0 -28
- package/src/widgets/components/InputWidget.tsx +0 -70
- package/src/widgets/components/JsonWidget.tsx +0 -78
- package/src/widgets/components/LinkWidget.tsx +0 -99
- package/src/widgets/components/ManyToManyWidget.tsx +0 -125
- package/src/widgets/components/ModalWidget.tsx +0 -52
- package/src/widgets/components/MoneyWidget.tsx +0 -80
- package/src/widgets/components/RepeatWidget.tsx +0 -66
- package/src/widgets/components/ScrollAreaWidget.tsx +0 -40
- package/src/widgets/components/SectionWidget.tsx +0 -78
- package/src/widgets/components/SelectWidget.tsx +0 -63
- package/src/widgets/components/SequenceWidget.tsx +0 -32
- package/src/widgets/components/SpacerWidget.tsx +0 -29
- package/src/widgets/components/SplitWidget.tsx +0 -60
- package/src/widgets/components/StackWidget.tsx +0 -44
- package/src/widgets/components/TableWidget.tsx +0 -366
- package/src/widgets/components/TextWidget.tsx +0 -44
- package/src/widgets/components/TextareaWidget.tsx +0 -49
- package/src/widgets/components/TreeWidget.tsx +0 -109
- package/src/widgets/components/index.ts +0 -30
- package/src/widgets/components/register.ts +0 -93
- package/src/widgets/components/table/CellRenderers.tsx +0 -83
- package/src/widgets/components/table/TablePagination.tsx +0 -45
- package/src/widgets/components/table/TableToolbar.tsx +0 -285
- package/src/widgets/components/table/filter-operators.ts +0 -134
- package/src/widgets/components/table/index.ts +0 -11
- package/src/widgets/condition/evaluator.ts +0 -57
- package/src/widgets/condition/index.ts +0 -1
- package/src/widgets/context/builder.ts +0 -99
- package/src/widgets/context/index.ts +0 -8
- package/src/widgets/context/types.ts +0 -37
- package/src/widgets/data/index.ts +0 -5
- package/src/widgets/data/useModelQuery.ts +0 -116
- package/src/widgets/data/useModelRecord.ts +0 -37
- package/src/widgets/expression/evaluator.ts +0 -100
- package/src/widgets/expression/functions.ts +0 -131
- package/src/widgets/expression/index.ts +0 -13
- package/src/widgets/expression/parser.ts +0 -229
- package/src/widgets/expression/types.ts +0 -45
- package/src/widgets/form/FormContext.ts +0 -29
- package/src/widgets/form/FormProvider.tsx +0 -84
- package/src/widgets/form/FormWidget.tsx +0 -42
- package/src/widgets/form/index.ts +0 -4
- package/src/widgets/form/useFormState.ts +0 -127
- package/src/widgets/form/useFormSubmit.ts +0 -90
- package/src/widgets/form/useFormValidation.ts +0 -62
- package/src/widgets/hooks/index.ts +0 -8
- package/src/widgets/hooks/useAction.ts +0 -83
- package/src/widgets/hooks/useBind.ts +0 -34
- package/src/widgets/hooks/useCondition.ts +0 -21
- package/src/widgets/hooks/useDataQuery.ts +0 -48
- package/src/widgets/hooks/useExpression.ts +0 -14
- package/src/widgets/hooks/usePageState.ts +0 -21
- package/src/widgets/hooks/useSurfaceContext.ts +0 -11
- package/src/widgets/hooks/useWidgetContext.ts +0 -14
- package/src/widgets/index.ts +0 -80
- package/src/widgets/lib/layout-props.ts +0 -135
- package/src/widgets/reactivity/index.ts +0 -11
- package/src/widgets/reactivity/tracker.ts +0 -139
- package/src/widgets/reactivity/variables.ts +0 -213
- package/src/widgets/registry.ts +0 -41
- package/src/widgets/renderer/SlotRenderer.tsx +0 -47
- package/src/widgets/renderer/WidgetRenderer.tsx +0 -191
- package/src/widgets/renderer/index.ts +0 -4
- package/src/widgets/shell/WidgetSlotRenderer.tsx +0 -73
- package/src/widgets/shell/index.ts +0 -4
- package/src/widgets/shell/useActionHandlers.ts +0 -170
- package/src/widgets/state/index.ts +0 -2
- package/src/widgets/state/store.ts +0 -96
- package/src/widgets/types.ts +0 -28
- package/src/widgets/validation/index.ts +0 -2
- package/src/widgets/validation/validator.ts +0 -140
- package/tsconfig.json +0 -27
- package/tsconfig.tsbuildinfo +0 -1
- package/vite.config.ts +0 -21
- package/vitest.config.ts +0 -16
|
@@ -1,275 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { Combobox as ComboboxPrimitive } from '@base-ui/react';
|
|
5
|
-
|
|
6
|
-
import { cn } from '@/lib/utils';
|
|
7
|
-
import { Button } from '@/components/ui/button';
|
|
8
|
-
import {
|
|
9
|
-
InputGroup,
|
|
10
|
-
InputGroupAddon,
|
|
11
|
-
InputGroupButton,
|
|
12
|
-
InputGroupInput,
|
|
13
|
-
} from '@/components/ui/input-group';
|
|
14
|
-
import { ChevronDownIcon, XIcon, CheckIcon } from 'lucide-react';
|
|
15
|
-
|
|
16
|
-
const Combobox = ComboboxPrimitive.Root;
|
|
17
|
-
|
|
18
|
-
function ComboboxValue({ ...props }: ComboboxPrimitive.Value.Props) {
|
|
19
|
-
return <ComboboxPrimitive.Value data-slot="combobox-value" {...props} />;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function ComboboxTrigger({ className, children, ...props }: ComboboxPrimitive.Trigger.Props) {
|
|
23
|
-
return (
|
|
24
|
-
<ComboboxPrimitive.Trigger
|
|
25
|
-
data-slot="combobox-trigger"
|
|
26
|
-
className={cn("[&_svg:not([class*='size-'])]:size-4", className)}
|
|
27
|
-
{...props}
|
|
28
|
-
>
|
|
29
|
-
{children}
|
|
30
|
-
<ChevronDownIcon className="pointer-events-none size-4 text-muted-foreground" />
|
|
31
|
-
</ComboboxPrimitive.Trigger>
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function ComboboxClear({ className, ...props }: ComboboxPrimitive.Clear.Props) {
|
|
36
|
-
return (
|
|
37
|
-
<ComboboxPrimitive.Clear
|
|
38
|
-
data-slot="combobox-clear"
|
|
39
|
-
render={<InputGroupButton variant="ghost" size="icon-xs" />}
|
|
40
|
-
className={cn(className)}
|
|
41
|
-
{...props}
|
|
42
|
-
>
|
|
43
|
-
<XIcon className="pointer-events-none" />
|
|
44
|
-
</ComboboxPrimitive.Clear>
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function ComboboxInput({
|
|
49
|
-
className,
|
|
50
|
-
children,
|
|
51
|
-
disabled = false,
|
|
52
|
-
showTrigger = true,
|
|
53
|
-
showClear = false,
|
|
54
|
-
...props
|
|
55
|
-
}: ComboboxPrimitive.Input.Props & {
|
|
56
|
-
showTrigger?: boolean;
|
|
57
|
-
showClear?: boolean;
|
|
58
|
-
}) {
|
|
59
|
-
return (
|
|
60
|
-
<InputGroup className={cn('w-auto', className)}>
|
|
61
|
-
<ComboboxPrimitive.Input render={<InputGroupInput disabled={disabled} />} {...props} />
|
|
62
|
-
<InputGroupAddon align="inline-end">
|
|
63
|
-
{showTrigger && (
|
|
64
|
-
<InputGroupButton
|
|
65
|
-
size="icon-xs"
|
|
66
|
-
variant="ghost"
|
|
67
|
-
asChild
|
|
68
|
-
data-slot="input-group-button"
|
|
69
|
-
className="group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent"
|
|
70
|
-
disabled={disabled}
|
|
71
|
-
>
|
|
72
|
-
<ComboboxTrigger />
|
|
73
|
-
</InputGroupButton>
|
|
74
|
-
)}
|
|
75
|
-
{showClear && <ComboboxClear disabled={disabled} />}
|
|
76
|
-
</InputGroupAddon>
|
|
77
|
-
{children}
|
|
78
|
-
</InputGroup>
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function ComboboxContent({
|
|
83
|
-
className,
|
|
84
|
-
side = 'bottom',
|
|
85
|
-
sideOffset = 6,
|
|
86
|
-
align = 'start',
|
|
87
|
-
alignOffset = 0,
|
|
88
|
-
anchor,
|
|
89
|
-
...props
|
|
90
|
-
}: ComboboxPrimitive.Popup.Props &
|
|
91
|
-
Pick<
|
|
92
|
-
ComboboxPrimitive.Positioner.Props,
|
|
93
|
-
'side' | 'align' | 'sideOffset' | 'alignOffset' | 'anchor'
|
|
94
|
-
>) {
|
|
95
|
-
return (
|
|
96
|
-
<ComboboxPrimitive.Portal>
|
|
97
|
-
<ComboboxPrimitive.Positioner
|
|
98
|
-
side={side}
|
|
99
|
-
sideOffset={sideOffset}
|
|
100
|
-
align={align}
|
|
101
|
-
alignOffset={alignOffset}
|
|
102
|
-
anchor={anchor}
|
|
103
|
-
className="isolate z-50"
|
|
104
|
-
>
|
|
105
|
-
<ComboboxPrimitive.Popup
|
|
106
|
-
data-slot="combobox-content"
|
|
107
|
-
data-chips={!!anchor}
|
|
108
|
-
className={cn(
|
|
109
|
-
'group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-none bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',
|
|
110
|
-
className,
|
|
111
|
-
)}
|
|
112
|
-
{...props}
|
|
113
|
-
/>
|
|
114
|
-
</ComboboxPrimitive.Positioner>
|
|
115
|
-
</ComboboxPrimitive.Portal>
|
|
116
|
-
);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
function ComboboxList({ className, ...props }: ComboboxPrimitive.List.Props) {
|
|
120
|
-
return (
|
|
121
|
-
<ComboboxPrimitive.List
|
|
122
|
-
data-slot="combobox-list"
|
|
123
|
-
className={cn(
|
|
124
|
-
'no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain data-empty:p-0',
|
|
125
|
-
className,
|
|
126
|
-
)}
|
|
127
|
-
{...props}
|
|
128
|
-
/>
|
|
129
|
-
);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
function ComboboxItem({ className, children, ...props }: ComboboxPrimitive.Item.Props) {
|
|
133
|
-
return (
|
|
134
|
-
<ComboboxPrimitive.Item
|
|
135
|
-
data-slot="combobox-item"
|
|
136
|
-
className={cn(
|
|
137
|
-
"relative flex w-full cursor-default items-center gap-2 rounded-none py-2 pr-8 pl-2 text-xs outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
138
|
-
className,
|
|
139
|
-
)}
|
|
140
|
-
{...props}
|
|
141
|
-
>
|
|
142
|
-
{children}
|
|
143
|
-
<ComboboxPrimitive.ItemIndicator
|
|
144
|
-
render={
|
|
145
|
-
<span className="pointer-events-none absolute right-2 flex size-4 items-center justify-center" />
|
|
146
|
-
}
|
|
147
|
-
>
|
|
148
|
-
<CheckIcon className="pointer-events-none" />
|
|
149
|
-
</ComboboxPrimitive.ItemIndicator>
|
|
150
|
-
</ComboboxPrimitive.Item>
|
|
151
|
-
);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
function ComboboxGroup({ className, ...props }: ComboboxPrimitive.Group.Props) {
|
|
155
|
-
return (
|
|
156
|
-
<ComboboxPrimitive.Group data-slot="combobox-group" className={cn(className)} {...props} />
|
|
157
|
-
);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
function ComboboxLabel({ className, ...props }: ComboboxPrimitive.GroupLabel.Props) {
|
|
161
|
-
return (
|
|
162
|
-
<ComboboxPrimitive.GroupLabel
|
|
163
|
-
data-slot="combobox-label"
|
|
164
|
-
className={cn('px-2 py-2 text-xs text-muted-foreground', className)}
|
|
165
|
-
{...props}
|
|
166
|
-
/>
|
|
167
|
-
);
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
function ComboboxCollection({ ...props }: ComboboxPrimitive.Collection.Props) {
|
|
171
|
-
return <ComboboxPrimitive.Collection data-slot="combobox-collection" {...props} />;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
function ComboboxEmpty({ className, ...props }: ComboboxPrimitive.Empty.Props) {
|
|
175
|
-
return (
|
|
176
|
-
<ComboboxPrimitive.Empty
|
|
177
|
-
data-slot="combobox-empty"
|
|
178
|
-
className={cn(
|
|
179
|
-
'hidden w-full justify-center py-2 text-center text-xs text-muted-foreground group-data-empty/combobox-content:flex',
|
|
180
|
-
className,
|
|
181
|
-
)}
|
|
182
|
-
{...props}
|
|
183
|
-
/>
|
|
184
|
-
);
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
function ComboboxSeparator({ className, ...props }: ComboboxPrimitive.Separator.Props) {
|
|
188
|
-
return (
|
|
189
|
-
<ComboboxPrimitive.Separator
|
|
190
|
-
data-slot="combobox-separator"
|
|
191
|
-
className={cn('-mx-1 h-px bg-border', className)}
|
|
192
|
-
{...props}
|
|
193
|
-
/>
|
|
194
|
-
);
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
function ComboboxChips({
|
|
198
|
-
className,
|
|
199
|
-
...props
|
|
200
|
-
}: React.ComponentPropsWithRef<typeof ComboboxPrimitive.Chips> & ComboboxPrimitive.Chips.Props) {
|
|
201
|
-
return (
|
|
202
|
-
<ComboboxPrimitive.Chips
|
|
203
|
-
data-slot="combobox-chips"
|
|
204
|
-
className={cn(
|
|
205
|
-
'flex min-h-8 flex-wrap items-center gap-1 rounded-none border border-input bg-transparent bg-clip-padding px-2.5 py-1 text-xs transition-colors focus-within:border-ring focus-within:ring-1 focus-within:ring-ring/50 has-aria-invalid:border-destructive has-aria-invalid:ring-1 has-aria-invalid:ring-destructive/20 has-data-[slot=combobox-chip]:px-1 dark:bg-input/30 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40',
|
|
206
|
-
className,
|
|
207
|
-
)}
|
|
208
|
-
{...props}
|
|
209
|
-
/>
|
|
210
|
-
);
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
function ComboboxChip({
|
|
214
|
-
className,
|
|
215
|
-
children,
|
|
216
|
-
showRemove = true,
|
|
217
|
-
...props
|
|
218
|
-
}: ComboboxPrimitive.Chip.Props & {
|
|
219
|
-
showRemove?: boolean;
|
|
220
|
-
}) {
|
|
221
|
-
return (
|
|
222
|
-
<ComboboxPrimitive.Chip
|
|
223
|
-
data-slot="combobox-chip"
|
|
224
|
-
className={cn(
|
|
225
|
-
'flex h-[calc(--spacing(5.25))] w-fit items-center justify-center gap-1 rounded-none bg-muted px-1.5 text-xs font-medium whitespace-nowrap text-foreground has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pr-0',
|
|
226
|
-
className,
|
|
227
|
-
)}
|
|
228
|
-
{...props}
|
|
229
|
-
>
|
|
230
|
-
{children}
|
|
231
|
-
{showRemove && (
|
|
232
|
-
<ComboboxPrimitive.ChipRemove
|
|
233
|
-
render={<Button variant="ghost" size="icon-xs" />}
|
|
234
|
-
className="-ml-1 opacity-50 hover:opacity-100"
|
|
235
|
-
data-slot="combobox-chip-remove"
|
|
236
|
-
>
|
|
237
|
-
<XIcon className="pointer-events-none" />
|
|
238
|
-
</ComboboxPrimitive.ChipRemove>
|
|
239
|
-
)}
|
|
240
|
-
</ComboboxPrimitive.Chip>
|
|
241
|
-
);
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
function ComboboxChipsInput({ className, ...props }: ComboboxPrimitive.Input.Props) {
|
|
245
|
-
return (
|
|
246
|
-
<ComboboxPrimitive.Input
|
|
247
|
-
data-slot="combobox-chip-input"
|
|
248
|
-
className={cn('min-w-16 flex-1 outline-none', className)}
|
|
249
|
-
{...props}
|
|
250
|
-
/>
|
|
251
|
-
);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
function useComboboxAnchor() {
|
|
255
|
-
return React.useRef<HTMLDivElement | null>(null);
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
export {
|
|
259
|
-
Combobox,
|
|
260
|
-
ComboboxInput,
|
|
261
|
-
ComboboxContent,
|
|
262
|
-
ComboboxList,
|
|
263
|
-
ComboboxItem,
|
|
264
|
-
ComboboxGroup,
|
|
265
|
-
ComboboxLabel,
|
|
266
|
-
ComboboxCollection,
|
|
267
|
-
ComboboxEmpty,
|
|
268
|
-
ComboboxSeparator,
|
|
269
|
-
ComboboxChips,
|
|
270
|
-
ComboboxChip,
|
|
271
|
-
ComboboxChipsInput,
|
|
272
|
-
ComboboxTrigger,
|
|
273
|
-
ComboboxValue,
|
|
274
|
-
useComboboxAnchor,
|
|
275
|
-
};
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Command as CommandPrimitive } from 'cmdk';
|
|
3
|
-
|
|
4
|
-
import { cn } from '@/lib/utils';
|
|
5
|
-
import {
|
|
6
|
-
Dialog,
|
|
7
|
-
DialogContent,
|
|
8
|
-
DialogDescription,
|
|
9
|
-
DialogHeader,
|
|
10
|
-
DialogTitle,
|
|
11
|
-
} from '@/components/ui/dialog';
|
|
12
|
-
import { InputGroup, InputGroupAddon } from '@/components/ui/input-group';
|
|
13
|
-
import { SearchIcon, CheckIcon } from 'lucide-react';
|
|
14
|
-
|
|
15
|
-
function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>) {
|
|
16
|
-
return (
|
|
17
|
-
<CommandPrimitive
|
|
18
|
-
data-slot="command"
|
|
19
|
-
className={cn(
|
|
20
|
-
'flex size-full flex-col overflow-hidden rounded-none bg-popover text-popover-foreground',
|
|
21
|
-
className,
|
|
22
|
-
)}
|
|
23
|
-
{...props}
|
|
24
|
-
/>
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function CommandDialog({
|
|
29
|
-
title = 'Command Palette',
|
|
30
|
-
description = 'Search for a command to run...',
|
|
31
|
-
children,
|
|
32
|
-
className,
|
|
33
|
-
showCloseButton = false,
|
|
34
|
-
...props
|
|
35
|
-
}: React.ComponentProps<typeof Dialog> & {
|
|
36
|
-
title?: string;
|
|
37
|
-
description?: string;
|
|
38
|
-
className?: string;
|
|
39
|
-
showCloseButton?: boolean;
|
|
40
|
-
}) {
|
|
41
|
-
return (
|
|
42
|
-
<Dialog {...props}>
|
|
43
|
-
<DialogHeader className="sr-only">
|
|
44
|
-
<DialogTitle>{title}</DialogTitle>
|
|
45
|
-
<DialogDescription>{description}</DialogDescription>
|
|
46
|
-
</DialogHeader>
|
|
47
|
-
<DialogContent
|
|
48
|
-
className={cn('top-1/3 translate-y-0 overflow-hidden rounded-none p-0', className)}
|
|
49
|
-
showCloseButton={showCloseButton}
|
|
50
|
-
>
|
|
51
|
-
{children}
|
|
52
|
-
</DialogContent>
|
|
53
|
-
</Dialog>
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
function CommandInput({
|
|
58
|
-
className,
|
|
59
|
-
...props
|
|
60
|
-
}: React.ComponentProps<typeof CommandPrimitive.Input>) {
|
|
61
|
-
return (
|
|
62
|
-
<div data-slot="command-input-wrapper" className="border-b pb-0">
|
|
63
|
-
<InputGroup className="h-8 border-none border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!">
|
|
64
|
-
<CommandPrimitive.Input
|
|
65
|
-
data-slot="command-input"
|
|
66
|
-
className={cn(
|
|
67
|
-
'w-full text-xs outline-hidden disabled:cursor-not-allowed disabled:opacity-50',
|
|
68
|
-
className,
|
|
69
|
-
)}
|
|
70
|
-
{...props}
|
|
71
|
-
/>
|
|
72
|
-
<InputGroupAddon>
|
|
73
|
-
<SearchIcon className="size-4 shrink-0 opacity-50" />
|
|
74
|
-
</InputGroupAddon>
|
|
75
|
-
</InputGroup>
|
|
76
|
-
</div>
|
|
77
|
-
);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function CommandList({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.List>) {
|
|
81
|
-
return (
|
|
82
|
-
<CommandPrimitive.List
|
|
83
|
-
data-slot="command-list"
|
|
84
|
-
className={cn(
|
|
85
|
-
'no-scrollbar max-h-72 scroll-py-0 overflow-x-hidden overflow-y-auto outline-none',
|
|
86
|
-
className,
|
|
87
|
-
)}
|
|
88
|
-
{...props}
|
|
89
|
-
/>
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
function CommandEmpty({
|
|
94
|
-
className,
|
|
95
|
-
...props
|
|
96
|
-
}: React.ComponentProps<typeof CommandPrimitive.Empty>) {
|
|
97
|
-
return (
|
|
98
|
-
<CommandPrimitive.Empty
|
|
99
|
-
data-slot="command-empty"
|
|
100
|
-
className={cn('py-6 text-center text-xs', className)}
|
|
101
|
-
{...props}
|
|
102
|
-
/>
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
function CommandGroup({
|
|
107
|
-
className,
|
|
108
|
-
...props
|
|
109
|
-
}: React.ComponentProps<typeof CommandPrimitive.Group>) {
|
|
110
|
-
return (
|
|
111
|
-
<CommandPrimitive.Group
|
|
112
|
-
data-slot="command-group"
|
|
113
|
-
className={cn(
|
|
114
|
-
'overflow-hidden text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:text-muted-foreground',
|
|
115
|
-
className,
|
|
116
|
-
)}
|
|
117
|
-
{...props}
|
|
118
|
-
/>
|
|
119
|
-
);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
function CommandSeparator({
|
|
123
|
-
className,
|
|
124
|
-
...props
|
|
125
|
-
}: React.ComponentProps<typeof CommandPrimitive.Separator>) {
|
|
126
|
-
return (
|
|
127
|
-
<CommandPrimitive.Separator
|
|
128
|
-
data-slot="command-separator"
|
|
129
|
-
className={cn('-mx-1 h-px bg-border', className)}
|
|
130
|
-
{...props}
|
|
131
|
-
/>
|
|
132
|
-
);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
function CommandItem({
|
|
136
|
-
className,
|
|
137
|
-
children,
|
|
138
|
-
...props
|
|
139
|
-
}: React.ComponentProps<typeof CommandPrimitive.Item>) {
|
|
140
|
-
return (
|
|
141
|
-
<CommandPrimitive.Item
|
|
142
|
-
data-slot="command-item"
|
|
143
|
-
className={cn(
|
|
144
|
-
"group/command-item relative flex cursor-default items-center gap-2 rounded-none px-2 py-2 text-xs outline-hidden select-none in-data-[slot=dialog-content]:rounded-none! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground",
|
|
145
|
-
className,
|
|
146
|
-
)}
|
|
147
|
-
{...props}
|
|
148
|
-
>
|
|
149
|
-
{children}
|
|
150
|
-
<CheckIcon className="ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100" />
|
|
151
|
-
</CommandPrimitive.Item>
|
|
152
|
-
);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
function CommandShortcut({ className, ...props }: React.ComponentProps<'span'>) {
|
|
156
|
-
return (
|
|
157
|
-
<span
|
|
158
|
-
data-slot="command-shortcut"
|
|
159
|
-
className={cn(
|
|
160
|
-
'ml-auto text-xs tracking-widest text-muted-foreground group-data-selected/command-item:text-foreground',
|
|
161
|
-
className,
|
|
162
|
-
)}
|
|
163
|
-
{...props}
|
|
164
|
-
/>
|
|
165
|
-
);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
export {
|
|
169
|
-
Command,
|
|
170
|
-
CommandDialog,
|
|
171
|
-
CommandInput,
|
|
172
|
-
CommandList,
|
|
173
|
-
CommandEmpty,
|
|
174
|
-
CommandGroup,
|
|
175
|
-
CommandItem,
|
|
176
|
-
CommandShortcut,
|
|
177
|
-
CommandSeparator,
|
|
178
|
-
};
|
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ContextMenu as ContextMenuPrimitive } from 'radix-ui';
|
|
3
|
-
|
|
4
|
-
import { cn } from '@/lib/utils';
|
|
5
|
-
import { ChevronRightIcon, CheckIcon } from 'lucide-react';
|
|
6
|
-
|
|
7
|
-
function ContextMenu({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Root>) {
|
|
8
|
-
return <ContextMenuPrimitive.Root data-slot="context-menu" {...props} />;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
function ContextMenuTrigger({
|
|
12
|
-
className,
|
|
13
|
-
...props
|
|
14
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.Trigger>) {
|
|
15
|
-
return (
|
|
16
|
-
<ContextMenuPrimitive.Trigger
|
|
17
|
-
data-slot="context-menu-trigger"
|
|
18
|
-
className={cn('select-none', className)}
|
|
19
|
-
{...props}
|
|
20
|
-
/>
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function ContextMenuGroup({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Group>) {
|
|
25
|
-
return <ContextMenuPrimitive.Group data-slot="context-menu-group" {...props} />;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function ContextMenuPortal({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Portal>) {
|
|
29
|
-
return <ContextMenuPrimitive.Portal data-slot="context-menu-portal" {...props} />;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function ContextMenuSub({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Sub>) {
|
|
33
|
-
return <ContextMenuPrimitive.Sub data-slot="context-menu-sub" {...props} />;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function ContextMenuRadioGroup({
|
|
37
|
-
...props
|
|
38
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>) {
|
|
39
|
-
return <ContextMenuPrimitive.RadioGroup data-slot="context-menu-radio-group" {...props} />;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function ContextMenuContent({
|
|
43
|
-
className,
|
|
44
|
-
...props
|
|
45
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.Content> & {
|
|
46
|
-
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
47
|
-
}) {
|
|
48
|
-
return (
|
|
49
|
-
<ContextMenuPrimitive.Portal>
|
|
50
|
-
<ContextMenuPrimitive.Content
|
|
51
|
-
data-slot="context-menu-content"
|
|
52
|
-
className={cn(
|
|
53
|
-
'z-50 max-h-(--radix-context-menu-content-available-height) min-w-36 origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-none bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',
|
|
54
|
-
className,
|
|
55
|
-
)}
|
|
56
|
-
{...props}
|
|
57
|
-
/>
|
|
58
|
-
</ContextMenuPrimitive.Portal>
|
|
59
|
-
);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function ContextMenuItem({
|
|
63
|
-
className,
|
|
64
|
-
inset,
|
|
65
|
-
variant = 'default',
|
|
66
|
-
...props
|
|
67
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.Item> & {
|
|
68
|
-
inset?: boolean;
|
|
69
|
-
variant?: 'default' | 'destructive';
|
|
70
|
-
}) {
|
|
71
|
-
return (
|
|
72
|
-
<ContextMenuPrimitive.Item
|
|
73
|
-
data-slot="context-menu-item"
|
|
74
|
-
data-inset={inset}
|
|
75
|
-
data-variant={variant}
|
|
76
|
-
className={cn(
|
|
77
|
-
"group/context-menu-item relative flex cursor-default items-center gap-2 rounded-none px-2 py-2 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive",
|
|
78
|
-
className,
|
|
79
|
-
)}
|
|
80
|
-
{...props}
|
|
81
|
-
/>
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
function ContextMenuSubTrigger({
|
|
86
|
-
className,
|
|
87
|
-
inset,
|
|
88
|
-
children,
|
|
89
|
-
...props
|
|
90
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.SubTrigger> & {
|
|
91
|
-
inset?: boolean;
|
|
92
|
-
}) {
|
|
93
|
-
return (
|
|
94
|
-
<ContextMenuPrimitive.SubTrigger
|
|
95
|
-
data-slot="context-menu-sub-trigger"
|
|
96
|
-
data-inset={inset}
|
|
97
|
-
className={cn(
|
|
98
|
-
"flex cursor-default items-center gap-2 rounded-none px-2 py-2 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
99
|
-
className,
|
|
100
|
-
)}
|
|
101
|
-
{...props}
|
|
102
|
-
>
|
|
103
|
-
{children}
|
|
104
|
-
<ChevronRightIcon className="ml-auto" />
|
|
105
|
-
</ContextMenuPrimitive.SubTrigger>
|
|
106
|
-
);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
function ContextMenuSubContent({
|
|
110
|
-
className,
|
|
111
|
-
...props
|
|
112
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.SubContent>) {
|
|
113
|
-
return (
|
|
114
|
-
<ContextMenuPrimitive.SubContent
|
|
115
|
-
data-slot="context-menu-sub-content"
|
|
116
|
-
className={cn(
|
|
117
|
-
'z-50 min-w-32 origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-none border bg-popover text-popover-foreground shadow-lg duration-100 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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',
|
|
118
|
-
className,
|
|
119
|
-
)}
|
|
120
|
-
{...props}
|
|
121
|
-
/>
|
|
122
|
-
);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
function ContextMenuCheckboxItem({
|
|
126
|
-
className,
|
|
127
|
-
children,
|
|
128
|
-
checked,
|
|
129
|
-
inset,
|
|
130
|
-
...props
|
|
131
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem> & {
|
|
132
|
-
inset?: boolean;
|
|
133
|
-
}) {
|
|
134
|
-
return (
|
|
135
|
-
<ContextMenuPrimitive.CheckboxItem
|
|
136
|
-
data-slot="context-menu-checkbox-item"
|
|
137
|
-
data-inset={inset}
|
|
138
|
-
className={cn(
|
|
139
|
-
"relative flex cursor-default items-center gap-2 rounded-none py-2 pr-8 pl-2 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
140
|
-
className,
|
|
141
|
-
)}
|
|
142
|
-
checked={checked}
|
|
143
|
-
{...props}
|
|
144
|
-
>
|
|
145
|
-
<span className="pointer-events-none absolute right-2">
|
|
146
|
-
<ContextMenuPrimitive.ItemIndicator>
|
|
147
|
-
<CheckIcon />
|
|
148
|
-
</ContextMenuPrimitive.ItemIndicator>
|
|
149
|
-
</span>
|
|
150
|
-
{children}
|
|
151
|
-
</ContextMenuPrimitive.CheckboxItem>
|
|
152
|
-
);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
function ContextMenuRadioItem({
|
|
156
|
-
className,
|
|
157
|
-
children,
|
|
158
|
-
inset,
|
|
159
|
-
...props
|
|
160
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.RadioItem> & {
|
|
161
|
-
inset?: boolean;
|
|
162
|
-
}) {
|
|
163
|
-
return (
|
|
164
|
-
<ContextMenuPrimitive.RadioItem
|
|
165
|
-
data-slot="context-menu-radio-item"
|
|
166
|
-
data-inset={inset}
|
|
167
|
-
className={cn(
|
|
168
|
-
"relative flex cursor-default items-center gap-2 rounded-none py-2 pr-8 pl-2 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
169
|
-
className,
|
|
170
|
-
)}
|
|
171
|
-
{...props}
|
|
172
|
-
>
|
|
173
|
-
<span className="pointer-events-none absolute right-2">
|
|
174
|
-
<ContextMenuPrimitive.ItemIndicator>
|
|
175
|
-
<CheckIcon />
|
|
176
|
-
</ContextMenuPrimitive.ItemIndicator>
|
|
177
|
-
</span>
|
|
178
|
-
{children}
|
|
179
|
-
</ContextMenuPrimitive.RadioItem>
|
|
180
|
-
);
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
function ContextMenuLabel({
|
|
184
|
-
className,
|
|
185
|
-
inset,
|
|
186
|
-
...props
|
|
187
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.Label> & {
|
|
188
|
-
inset?: boolean;
|
|
189
|
-
}) {
|
|
190
|
-
return (
|
|
191
|
-
<ContextMenuPrimitive.Label
|
|
192
|
-
data-slot="context-menu-label"
|
|
193
|
-
data-inset={inset}
|
|
194
|
-
className={cn('px-2 py-2 text-xs text-muted-foreground data-inset:pl-7', className)}
|
|
195
|
-
{...props}
|
|
196
|
-
/>
|
|
197
|
-
);
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
function ContextMenuSeparator({
|
|
201
|
-
className,
|
|
202
|
-
...props
|
|
203
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.Separator>) {
|
|
204
|
-
return (
|
|
205
|
-
<ContextMenuPrimitive.Separator
|
|
206
|
-
data-slot="context-menu-separator"
|
|
207
|
-
className={cn('-mx-1 h-px bg-border', className)}
|
|
208
|
-
{...props}
|
|
209
|
-
/>
|
|
210
|
-
);
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
function ContextMenuShortcut({ className, ...props }: React.ComponentProps<'span'>) {
|
|
214
|
-
return (
|
|
215
|
-
<span
|
|
216
|
-
data-slot="context-menu-shortcut"
|
|
217
|
-
className={cn(
|
|
218
|
-
'ml-auto text-xs tracking-widest text-muted-foreground group-focus/context-menu-item:text-accent-foreground',
|
|
219
|
-
className,
|
|
220
|
-
)}
|
|
221
|
-
{...props}
|
|
222
|
-
/>
|
|
223
|
-
);
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
export {
|
|
227
|
-
ContextMenu,
|
|
228
|
-
ContextMenuTrigger,
|
|
229
|
-
ContextMenuContent,
|
|
230
|
-
ContextMenuItem,
|
|
231
|
-
ContextMenuCheckboxItem,
|
|
232
|
-
ContextMenuRadioItem,
|
|
233
|
-
ContextMenuLabel,
|
|
234
|
-
ContextMenuSeparator,
|
|
235
|
-
ContextMenuShortcut,
|
|
236
|
-
ContextMenuGroup,
|
|
237
|
-
ContextMenuPortal,
|
|
238
|
-
ContextMenuSub,
|
|
239
|
-
ContextMenuSubContent,
|
|
240
|
-
ContextMenuSubTrigger,
|
|
241
|
-
ContextMenuRadioGroup,
|
|
242
|
-
};
|