@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,26 +0,0 @@
|
|
|
1
|
-
import { cn } from '@/lib/utils';
|
|
2
|
-
|
|
3
|
-
function Kbd({ className, ...props }: React.ComponentProps<'kbd'>) {
|
|
4
|
-
return (
|
|
5
|
-
<kbd
|
|
6
|
-
data-slot="kbd"
|
|
7
|
-
className={cn(
|
|
8
|
-
"pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-none bg-muted px-1 font-sans text-xs font-medium text-muted-foreground select-none in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10 [&_svg:not([class*='size-'])]:size-3",
|
|
9
|
-
className,
|
|
10
|
-
)}
|
|
11
|
-
{...props}
|
|
12
|
-
/>
|
|
13
|
-
);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
function KbdGroup({ className, ...props }: React.ComponentProps<'div'>) {
|
|
17
|
-
return (
|
|
18
|
-
<kbd
|
|
19
|
-
data-slot="kbd-group"
|
|
20
|
-
className={cn('inline-flex items-center gap-1', className)}
|
|
21
|
-
{...props}
|
|
22
|
-
/>
|
|
23
|
-
);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export { Kbd, KbdGroup };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Label as LabelPrimitive } from 'radix-ui';
|
|
3
|
-
|
|
4
|
-
import { cn } from '@/lib/utils';
|
|
5
|
-
|
|
6
|
-
function Label({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>) {
|
|
7
|
-
return (
|
|
8
|
-
<LabelPrimitive.Root
|
|
9
|
-
data-slot="label"
|
|
10
|
-
className={cn(
|
|
11
|
-
'flex items-center gap-2 text-xs leading-none select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50',
|
|
12
|
-
className,
|
|
13
|
-
)}
|
|
14
|
-
{...props}
|
|
15
|
-
/>
|
|
16
|
-
);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export { Label };
|
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { Menubar as MenubarPrimitive } from 'radix-ui';
|
|
5
|
-
|
|
6
|
-
import { cn } from '@/lib/utils';
|
|
7
|
-
import { CheckIcon, ChevronRightIcon } from 'lucide-react';
|
|
8
|
-
|
|
9
|
-
function Menubar({ className, ...props }: React.ComponentProps<typeof MenubarPrimitive.Root>) {
|
|
10
|
-
return (
|
|
11
|
-
<MenubarPrimitive.Root
|
|
12
|
-
data-slot="menubar"
|
|
13
|
-
className={cn('flex h-8 items-center gap-0.5 rounded-none border p-1', className)}
|
|
14
|
-
{...props}
|
|
15
|
-
/>
|
|
16
|
-
);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function MenubarMenu({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Menu>) {
|
|
20
|
-
return <MenubarPrimitive.Menu data-slot="menubar-menu" {...props} />;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function MenubarGroup({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Group>) {
|
|
24
|
-
return <MenubarPrimitive.Group data-slot="menubar-group" {...props} />;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function MenubarPortal({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Portal>) {
|
|
28
|
-
return <MenubarPrimitive.Portal data-slot="menubar-portal" {...props} />;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function MenubarRadioGroup({ ...props }: React.ComponentProps<typeof MenubarPrimitive.RadioGroup>) {
|
|
32
|
-
return <MenubarPrimitive.RadioGroup data-slot="menubar-radio-group" {...props} />;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function MenubarTrigger({
|
|
36
|
-
className,
|
|
37
|
-
...props
|
|
38
|
-
}: React.ComponentProps<typeof MenubarPrimitive.Trigger>) {
|
|
39
|
-
return (
|
|
40
|
-
<MenubarPrimitive.Trigger
|
|
41
|
-
data-slot="menubar-trigger"
|
|
42
|
-
className={cn(
|
|
43
|
-
'flex items-center rounded-none px-1.5 py-[calc(--spacing(0.8))] text-xs font-medium outline-hidden select-none hover:bg-muted aria-expanded:bg-muted',
|
|
44
|
-
className,
|
|
45
|
-
)}
|
|
46
|
-
{...props}
|
|
47
|
-
/>
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function MenubarContent({
|
|
52
|
-
className,
|
|
53
|
-
align = 'start',
|
|
54
|
-
alignOffset = -4,
|
|
55
|
-
sideOffset = 8,
|
|
56
|
-
...props
|
|
57
|
-
}: React.ComponentProps<typeof MenubarPrimitive.Content>) {
|
|
58
|
-
return (
|
|
59
|
-
<MenubarPortal>
|
|
60
|
-
<MenubarPrimitive.Content
|
|
61
|
-
data-slot="menubar-content"
|
|
62
|
-
align={align}
|
|
63
|
-
alignOffset={alignOffset}
|
|
64
|
-
sideOffset={sideOffset}
|
|
65
|
-
className={cn(
|
|
66
|
-
'z-50 min-w-36 origin-(--radix-menubar-content-transform-origin) overflow-hidden 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',
|
|
67
|
-
className,
|
|
68
|
-
)}
|
|
69
|
-
{...props}
|
|
70
|
-
/>
|
|
71
|
-
</MenubarPortal>
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
function MenubarItem({
|
|
76
|
-
className,
|
|
77
|
-
inset,
|
|
78
|
-
variant = 'default',
|
|
79
|
-
...props
|
|
80
|
-
}: React.ComponentProps<typeof MenubarPrimitive.Item> & {
|
|
81
|
-
inset?: boolean;
|
|
82
|
-
variant?: 'default' | 'destructive';
|
|
83
|
-
}) {
|
|
84
|
-
return (
|
|
85
|
-
<MenubarPrimitive.Item
|
|
86
|
-
data-slot="menubar-item"
|
|
87
|
-
data-inset={inset}
|
|
88
|
-
data-variant={variant}
|
|
89
|
-
className={cn(
|
|
90
|
-
"group/menubar-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 not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-8 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 data-[variant=destructive]:*:[svg]:text-destructive!",
|
|
91
|
-
className,
|
|
92
|
-
)}
|
|
93
|
-
{...props}
|
|
94
|
-
/>
|
|
95
|
-
);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
function MenubarCheckboxItem({
|
|
99
|
-
className,
|
|
100
|
-
children,
|
|
101
|
-
checked,
|
|
102
|
-
inset,
|
|
103
|
-
...props
|
|
104
|
-
}: React.ComponentProps<typeof MenubarPrimitive.CheckboxItem> & {
|
|
105
|
-
inset?: boolean;
|
|
106
|
-
}) {
|
|
107
|
-
return (
|
|
108
|
-
<MenubarPrimitive.CheckboxItem
|
|
109
|
-
data-slot="menubar-checkbox-item"
|
|
110
|
-
data-inset={inset}
|
|
111
|
-
className={cn(
|
|
112
|
-
'relative flex cursor-default items-center gap-2 rounded-none py-2 pr-28 pl-8 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-8 data-disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0',
|
|
113
|
-
className,
|
|
114
|
-
)}
|
|
115
|
-
checked={checked}
|
|
116
|
-
{...props}
|
|
117
|
-
>
|
|
118
|
-
<span className="pointer-events-none absolute left-1.5 flex size-4 items-center justify-center [&_svg:not([class*='size-'])]:size-4">
|
|
119
|
-
<MenubarPrimitive.ItemIndicator>
|
|
120
|
-
<CheckIcon />
|
|
121
|
-
</MenubarPrimitive.ItemIndicator>
|
|
122
|
-
</span>
|
|
123
|
-
{children}
|
|
124
|
-
</MenubarPrimitive.CheckboxItem>
|
|
125
|
-
);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
function MenubarRadioItem({
|
|
129
|
-
className,
|
|
130
|
-
children,
|
|
131
|
-
inset,
|
|
132
|
-
...props
|
|
133
|
-
}: React.ComponentProps<typeof MenubarPrimitive.RadioItem> & {
|
|
134
|
-
inset?: boolean;
|
|
135
|
-
}) {
|
|
136
|
-
return (
|
|
137
|
-
<MenubarPrimitive.RadioItem
|
|
138
|
-
data-slot="menubar-radio-item"
|
|
139
|
-
data-inset={inset}
|
|
140
|
-
className={cn(
|
|
141
|
-
"relative flex cursor-default items-center gap-2 rounded-none py-2 pr-2 pl-8 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
142
|
-
className,
|
|
143
|
-
)}
|
|
144
|
-
{...props}
|
|
145
|
-
>
|
|
146
|
-
<span className="pointer-events-none absolute left-1.5 flex size-4 items-center justify-center [&_svg:not([class*='size-'])]:size-4">
|
|
147
|
-
<MenubarPrimitive.ItemIndicator>
|
|
148
|
-
<CheckIcon />
|
|
149
|
-
</MenubarPrimitive.ItemIndicator>
|
|
150
|
-
</span>
|
|
151
|
-
{children}
|
|
152
|
-
</MenubarPrimitive.RadioItem>
|
|
153
|
-
);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
function MenubarLabel({
|
|
157
|
-
className,
|
|
158
|
-
inset,
|
|
159
|
-
...props
|
|
160
|
-
}: React.ComponentProps<typeof MenubarPrimitive.Label> & {
|
|
161
|
-
inset?: boolean;
|
|
162
|
-
}) {
|
|
163
|
-
return (
|
|
164
|
-
<MenubarPrimitive.Label
|
|
165
|
-
data-slot="menubar-label"
|
|
166
|
-
data-inset={inset}
|
|
167
|
-
className={cn('px-2 py-2 text-xs data-inset:pl-8', className)}
|
|
168
|
-
{...props}
|
|
169
|
-
/>
|
|
170
|
-
);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
function MenubarSeparator({
|
|
174
|
-
className,
|
|
175
|
-
...props
|
|
176
|
-
}: React.ComponentProps<typeof MenubarPrimitive.Separator>) {
|
|
177
|
-
return (
|
|
178
|
-
<MenubarPrimitive.Separator
|
|
179
|
-
data-slot="menubar-separator"
|
|
180
|
-
className={cn('-mx-1 my-1 h-px bg-border', className)}
|
|
181
|
-
{...props}
|
|
182
|
-
/>
|
|
183
|
-
);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
function MenubarShortcut({ className, ...props }: React.ComponentProps<'span'>) {
|
|
187
|
-
return (
|
|
188
|
-
<span
|
|
189
|
-
data-slot="menubar-shortcut"
|
|
190
|
-
className={cn(
|
|
191
|
-
'ml-auto text-xs tracking-widest text-muted-foreground group-focus/menubar-item:text-accent-foreground',
|
|
192
|
-
className,
|
|
193
|
-
)}
|
|
194
|
-
{...props}
|
|
195
|
-
/>
|
|
196
|
-
);
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
function MenubarSub({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Sub>) {
|
|
200
|
-
return <MenubarPrimitive.Sub data-slot="menubar-sub" {...props} />;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
function MenubarSubTrigger({
|
|
204
|
-
className,
|
|
205
|
-
inset,
|
|
206
|
-
children,
|
|
207
|
-
...props
|
|
208
|
-
}: React.ComponentProps<typeof MenubarPrimitive.SubTrigger> & {
|
|
209
|
-
inset?: boolean;
|
|
210
|
-
}) {
|
|
211
|
-
return (
|
|
212
|
-
<MenubarPrimitive.SubTrigger
|
|
213
|
-
data-slot="menubar-sub-trigger"
|
|
214
|
-
data-inset={inset}
|
|
215
|
-
className={cn(
|
|
216
|
-
"flex cursor-default items-center gap-2 rounded-none px-2 py-2 text-xs outline-none select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-8 data-open:bg-accent data-open:text-accent-foreground [&_svg:not([class*='size-'])]:size-4",
|
|
217
|
-
className,
|
|
218
|
-
)}
|
|
219
|
-
{...props}
|
|
220
|
-
>
|
|
221
|
-
{children}
|
|
222
|
-
<ChevronRightIcon className="ml-auto size-4" />
|
|
223
|
-
</MenubarPrimitive.SubTrigger>
|
|
224
|
-
);
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
function MenubarSubContent({
|
|
228
|
-
className,
|
|
229
|
-
...props
|
|
230
|
-
}: React.ComponentProps<typeof MenubarPrimitive.SubContent>) {
|
|
231
|
-
return (
|
|
232
|
-
<MenubarPrimitive.SubContent
|
|
233
|
-
data-slot="menubar-sub-content"
|
|
234
|
-
className={cn(
|
|
235
|
-
'z-50 min-w-32 origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-none bg-popover text-popover-foreground shadow-lg 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',
|
|
236
|
-
className,
|
|
237
|
-
)}
|
|
238
|
-
{...props}
|
|
239
|
-
/>
|
|
240
|
-
);
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
export {
|
|
244
|
-
Menubar,
|
|
245
|
-
MenubarPortal,
|
|
246
|
-
MenubarMenu,
|
|
247
|
-
MenubarTrigger,
|
|
248
|
-
MenubarContent,
|
|
249
|
-
MenubarGroup,
|
|
250
|
-
MenubarSeparator,
|
|
251
|
-
MenubarLabel,
|
|
252
|
-
MenubarItem,
|
|
253
|
-
MenubarShortcut,
|
|
254
|
-
MenubarCheckboxItem,
|
|
255
|
-
MenubarRadioGroup,
|
|
256
|
-
MenubarRadioItem,
|
|
257
|
-
MenubarSub,
|
|
258
|
-
MenubarSubTrigger,
|
|
259
|
-
MenubarSubContent,
|
|
260
|
-
};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
import { cn } from '@/lib/utils';
|
|
4
|
-
import { ChevronDownIcon } from 'lucide-react';
|
|
5
|
-
|
|
6
|
-
type NativeSelectProps = Omit<React.ComponentProps<'select'>, 'size'> & {
|
|
7
|
-
size?: 'sm' | 'default';
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
function NativeSelect({ className, size = 'default', ...props }: NativeSelectProps) {
|
|
11
|
-
return (
|
|
12
|
-
<div
|
|
13
|
-
className={cn(
|
|
14
|
-
'group/native-select relative w-fit has-[select:disabled]:opacity-50',
|
|
15
|
-
className,
|
|
16
|
-
)}
|
|
17
|
-
data-slot="native-select-wrapper"
|
|
18
|
-
data-size={size}
|
|
19
|
-
>
|
|
20
|
-
<select
|
|
21
|
-
data-slot="native-select"
|
|
22
|
-
data-size={size}
|
|
23
|
-
className="h-8 w-full min-w-0 appearance-none rounded-none border border-input bg-transparent py-1 pr-8 pl-2.5 text-xs transition-colors outline-none select-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 data-[size=sm]:h-7 data-[size=sm]:rounded-none data-[size=sm]:py-0.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40"
|
|
24
|
-
{...props}
|
|
25
|
-
/>
|
|
26
|
-
<ChevronDownIcon
|
|
27
|
-
className="pointer-events-none absolute top-1/2 right-2.5 size-4 -translate-y-1/2 text-muted-foreground select-none"
|
|
28
|
-
aria-hidden="true"
|
|
29
|
-
data-slot="native-select-icon"
|
|
30
|
-
/>
|
|
31
|
-
</div>
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function NativeSelectOption({ className, ...props }: React.ComponentProps<'option'>) {
|
|
36
|
-
return (
|
|
37
|
-
<option
|
|
38
|
-
data-slot="native-select-option"
|
|
39
|
-
className={cn('bg-[Canvas] text-[CanvasText]', className)}
|
|
40
|
-
{...props}
|
|
41
|
-
/>
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function NativeSelectOptGroup({ className, ...props }: React.ComponentProps<'optgroup'>) {
|
|
46
|
-
return (
|
|
47
|
-
<optgroup
|
|
48
|
-
data-slot="native-select-optgroup"
|
|
49
|
-
className={cn('bg-[Canvas] text-[CanvasText]', className)}
|
|
50
|
-
{...props}
|
|
51
|
-
/>
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export { NativeSelect, NativeSelectOptGroup, NativeSelectOption };
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { cva } from 'class-variance-authority';
|
|
3
|
-
import { NavigationMenu as NavigationMenuPrimitive } from 'radix-ui';
|
|
4
|
-
|
|
5
|
-
import { cn } from '@/lib/utils';
|
|
6
|
-
import { ChevronDownIcon } from 'lucide-react';
|
|
7
|
-
|
|
8
|
-
function NavigationMenu({
|
|
9
|
-
className,
|
|
10
|
-
children,
|
|
11
|
-
viewport = true,
|
|
12
|
-
...props
|
|
13
|
-
}: React.ComponentProps<typeof NavigationMenuPrimitive.Root> & {
|
|
14
|
-
viewport?: boolean;
|
|
15
|
-
}) {
|
|
16
|
-
return (
|
|
17
|
-
<NavigationMenuPrimitive.Root
|
|
18
|
-
data-slot="navigation-menu"
|
|
19
|
-
data-viewport={viewport}
|
|
20
|
-
className={cn(
|
|
21
|
-
'group/navigation-menu relative flex max-w-max flex-1 items-center justify-center',
|
|
22
|
-
className,
|
|
23
|
-
)}
|
|
24
|
-
{...props}
|
|
25
|
-
>
|
|
26
|
-
{children}
|
|
27
|
-
{viewport && <NavigationMenuViewport />}
|
|
28
|
-
</NavigationMenuPrimitive.Root>
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function NavigationMenuList({
|
|
33
|
-
className,
|
|
34
|
-
...props
|
|
35
|
-
}: React.ComponentProps<typeof NavigationMenuPrimitive.List>) {
|
|
36
|
-
return (
|
|
37
|
-
<NavigationMenuPrimitive.List
|
|
38
|
-
data-slot="navigation-menu-list"
|
|
39
|
-
className={cn('group flex flex-1 list-none items-center justify-center gap-0', className)}
|
|
40
|
-
{...props}
|
|
41
|
-
/>
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function NavigationMenuItem({
|
|
46
|
-
className,
|
|
47
|
-
...props
|
|
48
|
-
}: React.ComponentProps<typeof NavigationMenuPrimitive.Item>) {
|
|
49
|
-
return (
|
|
50
|
-
<NavigationMenuPrimitive.Item
|
|
51
|
-
data-slot="navigation-menu-item"
|
|
52
|
-
className={cn('relative', className)}
|
|
53
|
-
{...props}
|
|
54
|
-
/>
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const navigationMenuTriggerStyle = cva(
|
|
59
|
-
'group/navigation-menu-trigger inline-flex h-9 w-max items-center justify-center rounded-none px-2.5 py-1.5 text-xs font-medium transition-all outline-none hover:bg-muted focus:bg-muted focus-visible:ring-1 focus-visible:ring-ring/50 focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-popup-open:bg-muted/50 data-popup-open:hover:bg-muted data-open:bg-muted/50 data-open:hover:bg-muted data-open:focus:bg-muted',
|
|
60
|
-
);
|
|
61
|
-
|
|
62
|
-
function NavigationMenuTrigger({
|
|
63
|
-
className,
|
|
64
|
-
children,
|
|
65
|
-
...props
|
|
66
|
-
}: React.ComponentProps<typeof NavigationMenuPrimitive.Trigger>) {
|
|
67
|
-
return (
|
|
68
|
-
<NavigationMenuPrimitive.Trigger
|
|
69
|
-
data-slot="navigation-menu-trigger"
|
|
70
|
-
className={cn(navigationMenuTriggerStyle(), 'group', className)}
|
|
71
|
-
{...props}
|
|
72
|
-
>
|
|
73
|
-
{children}{' '}
|
|
74
|
-
<ChevronDownIcon
|
|
75
|
-
className="relative top-px ml-1 size-3 transition duration-300 group-data-popup-open/navigation-menu-trigger:rotate-180 group-data-open/navigation-menu-trigger:rotate-180"
|
|
76
|
-
aria-hidden="true"
|
|
77
|
-
/>
|
|
78
|
-
</NavigationMenuPrimitive.Trigger>
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function NavigationMenuContent({
|
|
83
|
-
className,
|
|
84
|
-
...props
|
|
85
|
-
}: React.ComponentProps<typeof NavigationMenuPrimitive.Content>) {
|
|
86
|
-
return (
|
|
87
|
-
<NavigationMenuPrimitive.Content
|
|
88
|
-
data-slot="navigation-menu-content"
|
|
89
|
-
className={cn(
|
|
90
|
-
'top-0 left-0 w-full p-1 ease-[cubic-bezier(0.22,1,0.36,1)] group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-none group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:ring-1 group-data-[viewport=false]/navigation-menu:ring-foreground/10 group-data-[viewport=false]/navigation-menu:duration-300 data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 data-[motion^=from-]:animate-in data-[motion^=from-]:fade-in data-[motion^=to-]:animate-out data-[motion^=to-]:fade-out **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none md:absolute md:w-auto group-data-[viewport=false]/navigation-menu:data-open:animate-in group-data-[viewport=false]/navigation-menu:data-open:fade-in-0 group-data-[viewport=false]/navigation-menu:data-open:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-closed:animate-out group-data-[viewport=false]/navigation-menu:data-closed:fade-out-0 group-data-[viewport=false]/navigation-menu:data-closed:zoom-out-95',
|
|
91
|
-
className,
|
|
92
|
-
)}
|
|
93
|
-
{...props}
|
|
94
|
-
/>
|
|
95
|
-
);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
function NavigationMenuViewport({
|
|
99
|
-
className,
|
|
100
|
-
...props
|
|
101
|
-
}: React.ComponentProps<typeof NavigationMenuPrimitive.Viewport>) {
|
|
102
|
-
return (
|
|
103
|
-
<div className={cn('absolute top-full left-0 isolate z-50 flex justify-center')}>
|
|
104
|
-
<NavigationMenuPrimitive.Viewport
|
|
105
|
-
data-slot="navigation-menu-viewport"
|
|
106
|
-
className={cn(
|
|
107
|
-
'origin-top-center relative mt-1.5 h-(--radix-navigation-menu-viewport-height) w-full overflow-hidden rounded-none bg-popover text-popover-foreground shadow ring-1 ring-foreground/10 duration-100 md:w-(--radix-navigation-menu-viewport-width) data-open:animate-in data-open:zoom-in-90 data-closed:animate-out data-closed:zoom-out-90',
|
|
108
|
-
className,
|
|
109
|
-
)}
|
|
110
|
-
{...props}
|
|
111
|
-
/>
|
|
112
|
-
</div>
|
|
113
|
-
);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
function NavigationMenuLink({
|
|
117
|
-
className,
|
|
118
|
-
...props
|
|
119
|
-
}: React.ComponentProps<typeof NavigationMenuPrimitive.Link>) {
|
|
120
|
-
return (
|
|
121
|
-
<NavigationMenuPrimitive.Link
|
|
122
|
-
data-slot="navigation-menu-link"
|
|
123
|
-
className={cn(
|
|
124
|
-
"flex items-center gap-2 rounded-none p-2 text-xs transition-all outline-none hover:bg-muted focus:bg-muted focus-visible:ring-1 focus-visible:ring-ring/50 focus-visible:outline-1 in-data-[slot=navigation-menu-content]:rounded-none data-active:bg-muted/50 data-active:hover:bg-muted data-active:focus:bg-muted [&_svg:not([class*='size-'])]:size-4",
|
|
125
|
-
className,
|
|
126
|
-
)}
|
|
127
|
-
{...props}
|
|
128
|
-
/>
|
|
129
|
-
);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
function NavigationMenuIndicator({
|
|
133
|
-
className,
|
|
134
|
-
...props
|
|
135
|
-
}: React.ComponentProps<typeof NavigationMenuPrimitive.Indicator>) {
|
|
136
|
-
return (
|
|
137
|
-
<NavigationMenuPrimitive.Indicator
|
|
138
|
-
data-slot="navigation-menu-indicator"
|
|
139
|
-
className={cn(
|
|
140
|
-
'top-full z-1 flex h-1.5 items-end justify-center overflow-hidden data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:animate-in data-[state=visible]:fade-in',
|
|
141
|
-
className,
|
|
142
|
-
)}
|
|
143
|
-
{...props}
|
|
144
|
-
>
|
|
145
|
-
<div className="relative top-[60%] h-2 w-2 rotate-45 rounded-none bg-border shadow-md" />
|
|
146
|
-
</NavigationMenuPrimitive.Indicator>
|
|
147
|
-
);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
export {
|
|
151
|
-
NavigationMenu,
|
|
152
|
-
NavigationMenuList,
|
|
153
|
-
NavigationMenuItem,
|
|
154
|
-
NavigationMenuContent,
|
|
155
|
-
NavigationMenuTrigger,
|
|
156
|
-
NavigationMenuLink,
|
|
157
|
-
NavigationMenuIndicator,
|
|
158
|
-
NavigationMenuViewport,
|
|
159
|
-
navigationMenuTriggerStyle,
|
|
160
|
-
};
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
import { cn } from '@/lib/utils';
|
|
4
|
-
import { Button } from '@/components/ui/button';
|
|
5
|
-
import { ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon } from 'lucide-react';
|
|
6
|
-
|
|
7
|
-
function Pagination({ className, ...props }: React.ComponentProps<'nav'>) {
|
|
8
|
-
return (
|
|
9
|
-
<nav
|
|
10
|
-
role="navigation"
|
|
11
|
-
aria-label="pagination"
|
|
12
|
-
data-slot="pagination"
|
|
13
|
-
className={cn('mx-auto flex w-full justify-center', className)}
|
|
14
|
-
{...props}
|
|
15
|
-
/>
|
|
16
|
-
);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function PaginationContent({ className, ...props }: React.ComponentProps<'ul'>) {
|
|
20
|
-
return (
|
|
21
|
-
<ul
|
|
22
|
-
data-slot="pagination-content"
|
|
23
|
-
className={cn('flex items-center gap-0.5', className)}
|
|
24
|
-
{...props}
|
|
25
|
-
/>
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function PaginationItem({ ...props }: React.ComponentProps<'li'>) {
|
|
30
|
-
return <li data-slot="pagination-item" {...props} />;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
type PaginationLinkProps = {
|
|
34
|
-
isActive?: boolean;
|
|
35
|
-
} & Pick<React.ComponentProps<typeof Button>, 'size'> &
|
|
36
|
-
React.ComponentProps<'a'>;
|
|
37
|
-
|
|
38
|
-
function PaginationLink({ className, isActive, size = 'icon', ...props }: PaginationLinkProps) {
|
|
39
|
-
return (
|
|
40
|
-
<Button asChild variant={isActive ? 'outline' : 'ghost'} size={size} className={cn(className)}>
|
|
41
|
-
<a
|
|
42
|
-
aria-current={isActive ? 'page' : undefined}
|
|
43
|
-
data-slot="pagination-link"
|
|
44
|
-
data-active={isActive}
|
|
45
|
-
{...props}
|
|
46
|
-
/>
|
|
47
|
-
</Button>
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function PaginationPrevious({
|
|
52
|
-
className,
|
|
53
|
-
text = 'Previous',
|
|
54
|
-
...props
|
|
55
|
-
}: React.ComponentProps<typeof PaginationLink> & { text?: string }) {
|
|
56
|
-
return (
|
|
57
|
-
<PaginationLink
|
|
58
|
-
aria-label="Go to previous page"
|
|
59
|
-
size="default"
|
|
60
|
-
className={cn('pl-1.5!', className)}
|
|
61
|
-
{...props}
|
|
62
|
-
>
|
|
63
|
-
<ChevronLeftIcon data-icon="inline-start" />
|
|
64
|
-
<span className="hidden sm:block">{text}</span>
|
|
65
|
-
</PaginationLink>
|
|
66
|
-
);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function PaginationNext({
|
|
70
|
-
className,
|
|
71
|
-
text = 'Next',
|
|
72
|
-
...props
|
|
73
|
-
}: React.ComponentProps<typeof PaginationLink> & { text?: string }) {
|
|
74
|
-
return (
|
|
75
|
-
<PaginationLink
|
|
76
|
-
aria-label="Go to next page"
|
|
77
|
-
size="default"
|
|
78
|
-
className={cn('pr-1.5!', className)}
|
|
79
|
-
{...props}
|
|
80
|
-
>
|
|
81
|
-
<span className="hidden sm:block">{text}</span>
|
|
82
|
-
<ChevronRightIcon data-icon="inline-end" />
|
|
83
|
-
</PaginationLink>
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
function PaginationEllipsis({ className, ...props }: React.ComponentProps<'span'>) {
|
|
88
|
-
return (
|
|
89
|
-
<span
|
|
90
|
-
aria-hidden
|
|
91
|
-
data-slot="pagination-ellipsis"
|
|
92
|
-
className={cn(
|
|
93
|
-
"flex size-8 items-center justify-center [&_svg:not([class*='size-'])]:size-4",
|
|
94
|
-
className,
|
|
95
|
-
)}
|
|
96
|
-
{...props}
|
|
97
|
-
>
|
|
98
|
-
<MoreHorizontalIcon />
|
|
99
|
-
<span className="sr-only">More pages</span>
|
|
100
|
-
</span>
|
|
101
|
-
);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export {
|
|
105
|
-
Pagination,
|
|
106
|
-
PaginationContent,
|
|
107
|
-
PaginationEllipsis,
|
|
108
|
-
PaginationItem,
|
|
109
|
-
PaginationLink,
|
|
110
|
-
PaginationNext,
|
|
111
|
-
PaginationPrevious,
|
|
112
|
-
};
|