@object-ui/components 3.3.0 → 3.3.1
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/CHANGELOG.md +20 -0
- package/README.md +21 -1
- package/dist/index.css +6339 -2
- package/dist/index.js +17600 -17481
- package/dist/index.umd.cjs +36 -36
- package/dist/packages/components/src/custom/empty.d.ts +12 -1
- package/dist/packages/components/src/renderers/action/action-bar.d.ts +12 -1
- package/dist/packages/components/src/ui/chart.d.ts +10 -29
- package/package.json +65 -44
- package/.turbo/turbo-build.log +0 -84
- package/README_SHADCN_SYNC.md +0 -281
- package/TESTING.md +0 -335
- package/docs/FilterBuilder.md +0 -268
- package/metadata/Chart.component.yml +0 -30
- package/metadata/FilterBuilder.component.yml +0 -39
- package/metadata/GridLayout.component.yml +0 -27
- package/metadata/Menu.component.yml +0 -31
- package/metadata/ObjectForm.component.yml +0 -34
- package/metadata/ObjectGrid.component.yml +0 -72
- package/metadata/Page.component.yml +0 -24
- package/postcss.config.js +0 -14
- package/shadcn-components.json +0 -440
- package/src/SchemaRenderer.tsx +0 -28
- package/src/__tests__/PageRendererRegions.test.tsx +0 -668
- package/src/__tests__/README.md +0 -124
- package/src/__tests__/__snapshots__/snapshot-critical.test.tsx.snap +0 -811
- package/src/__tests__/__snapshots__/snapshot.test.tsx.snap +0 -327
- package/src/__tests__/accessibility.test.tsx +0 -137
- package/src/__tests__/action-bar.test.tsx +0 -206
- package/src/__tests__/api-consistency.test.tsx +0 -596
- package/src/__tests__/basic-renderers.test.tsx +0 -255
- package/src/__tests__/color-contrast.test.tsx +0 -212
- package/src/__tests__/complex-disclosure-renderers.test.tsx +0 -302
- package/src/__tests__/compliance.test.tsx +0 -72
- package/src/__tests__/config-field-renderer.test.tsx +0 -307
- package/src/__tests__/config-panel-renderer.test.tsx +0 -580
- package/src/__tests__/config-primitives.test.tsx +0 -106
- package/src/__tests__/edge-cases.test.tsx +0 -285
- package/src/__tests__/feedback-overlay-renderers.test.tsx +0 -349
- package/src/__tests__/filter-builder.test.tsx +0 -409
- package/src/__tests__/form-renderers.test.tsx +0 -364
- package/src/__tests__/layout-data-renderers.test.tsx +0 -340
- package/src/__tests__/mobile-accessibility.test.tsx +0 -120
- package/src/__tests__/navigation-overlay.test.tsx +0 -370
- package/src/__tests__/snapshot-critical.test.tsx +0 -317
- package/src/__tests__/snapshot.test.tsx +0 -205
- package/src/__tests__/test-utils.tsx +0 -190
- package/src/__tests__/use-config-draft.test.tsx +0 -295
- package/src/__tests__/view-compliance.test.tsx +0 -153
- package/src/__tests__/wcag-audit.test.tsx +0 -493
- package/src/custom/action-param-dialog.tsx +0 -264
- package/src/custom/button-group.tsx +0 -91
- package/src/custom/combobox.tsx +0 -104
- package/src/custom/config-field-renderer.tsx +0 -276
- package/src/custom/config-panel-renderer.tsx +0 -306
- package/src/custom/config-row.tsx +0 -50
- package/src/custom/date-picker.tsx +0 -61
- package/src/custom/empty.tsx +0 -112
- package/src/custom/field.tsx +0 -81
- package/src/custom/filter-builder.tsx +0 -418
- package/src/custom/index.ts +0 -21
- package/src/custom/input-group.tsx +0 -53
- package/src/custom/item.tsx +0 -201
- package/src/custom/kbd.tsx +0 -36
- package/src/custom/mobile-dialog-content.tsx +0 -67
- package/src/custom/native-select.tsx +0 -33
- package/src/custom/navigation-overlay.tsx +0 -334
- package/src/custom/section-header.tsx +0 -68
- package/src/custom/sort-builder.tsx +0 -129
- package/src/custom/spinner.tsx +0 -26
- package/src/custom/view-skeleton.tsx +0 -243
- package/src/custom/view-states.tsx +0 -153
- package/src/debug/DebugPanel.tsx +0 -313
- package/src/debug/__tests__/DebugPanel.test.tsx +0 -134
- package/src/debug/index.ts +0 -10
- package/src/hooks/use-config-draft.ts +0 -127
- package/src/hooks/use-mobile.tsx +0 -27
- package/src/index.css +0 -245
- package/src/index.ts +0 -47
- package/src/lib/use-sync-external-store-shim.ts +0 -10
- package/src/lib/use-sync-external-store-with-selector-shim.ts +0 -90
- package/src/lib/utils.tsx +0 -35
- package/src/new-components.test.ts +0 -73
- package/src/renderers/action/action-bar.tsx +0 -221
- package/src/renderers/action/action-button.tsx +0 -158
- package/src/renderers/action/action-group.tsx +0 -270
- package/src/renderers/action/action-icon.tsx +0 -150
- package/src/renderers/action/action-menu.tsx +0 -203
- package/src/renderers/action/index.ts +0 -19
- package/src/renderers/action/resolve-icon.ts +0 -35
- package/src/renderers/basic/button-group.tsx +0 -79
- package/src/renderers/basic/div.tsx +0 -60
- package/src/renderers/basic/html.tsx +0 -43
- package/src/renderers/basic/icon.tsx +0 -89
- package/src/renderers/basic/image.tsx +0 -49
- package/src/renderers/basic/index.ts +0 -18
- package/src/renderers/basic/navigation-menu.tsx +0 -81
- package/src/renderers/basic/pagination.tsx +0 -109
- package/src/renderers/basic/separator.tsx +0 -57
- package/src/renderers/basic/span.tsx +0 -63
- package/src/renderers/basic/text.tsx +0 -52
- package/src/renderers/complex/README-KANBAN.md +0 -208
- package/src/renderers/complex/TIMELINE.md +0 -353
- package/src/renderers/complex/__tests__/data-table-airtable-ux.test.tsx +0 -239
- package/src/renderers/complex/__tests__/data-table-batch-editing.test.tsx +0 -275
- package/src/renderers/complex/__tests__/data-table-cell-renderer.test.tsx +0 -120
- package/src/renderers/complex/__tests__/data-table-editing.test.tsx +0 -221
- package/src/renderers/complex/__tests__/data-table.test.ts +0 -76
- package/src/renderers/complex/carousel.tsx +0 -69
- package/src/renderers/complex/data-table.tsx +0 -1243
- package/src/renderers/complex/filter-builder.tsx +0 -77
- package/src/renderers/complex/index.ts +0 -16
- package/src/renderers/complex/resizable.tsx +0 -66
- package/src/renderers/complex/scroll-area.tsx +0 -58
- package/src/renderers/complex/table.tsx +0 -95
- package/src/renderers/data-display/alert.tsx +0 -46
- package/src/renderers/data-display/avatar.tsx +0 -38
- package/src/renderers/data-display/badge.tsx +0 -55
- package/src/renderers/data-display/breadcrumb.tsx +0 -61
- package/src/renderers/data-display/index.ts +0 -18
- package/src/renderers/data-display/kbd.tsx +0 -50
- package/src/renderers/data-display/list.tsx +0 -75
- package/src/renderers/data-display/statistic.tsx +0 -95
- package/src/renderers/data-display/table.tsx +0 -78
- package/src/renderers/data-display/tree-view.tsx +0 -176
- package/src/renderers/disclosure/accordion.tsx +0 -69
- package/src/renderers/disclosure/collapsible.tsx +0 -53
- package/src/renderers/disclosure/index.ts +0 -11
- package/src/renderers/disclosure/toggle-group.tsx +0 -79
- package/src/renderers/feedback/empty.tsx +0 -49
- package/src/renderers/feedback/index.ts +0 -16
- package/src/renderers/feedback/loading.tsx +0 -78
- package/src/renderers/feedback/progress.tsx +0 -29
- package/src/renderers/feedback/skeleton.tsx +0 -31
- package/src/renderers/feedback/sonner.tsx +0 -56
- package/src/renderers/feedback/spinner.tsx +0 -55
- package/src/renderers/feedback/toast.tsx +0 -59
- package/src/renderers/feedback/toaster.tsx +0 -23
- package/src/renderers/form/button.tsx +0 -103
- package/src/renderers/form/calendar.tsx +0 -34
- package/src/renderers/form/checkbox.tsx +0 -71
- package/src/renderers/form/combobox.tsx +0 -48
- package/src/renderers/form/command.tsx +0 -58
- package/src/renderers/form/date-picker.tsx +0 -84
- package/src/renderers/form/file-upload.tsx +0 -184
- package/src/renderers/form/form.tsx +0 -540
- package/src/renderers/form/index.ts +0 -26
- package/src/renderers/form/input-otp.tsx +0 -51
- package/src/renderers/form/input.tsx +0 -121
- package/src/renderers/form/label.tsx +0 -45
- package/src/renderers/form/radio-group.tsx +0 -63
- package/src/renderers/form/select.tsx +0 -94
- package/src/renderers/form/slider.tsx +0 -61
- package/src/renderers/form/switch.tsx +0 -48
- package/src/renderers/form/textarea.tsx +0 -76
- package/src/renderers/form/toggle.tsx +0 -42
- package/src/renderers/index.ts +0 -18
- package/src/renderers/layout/aspect-ratio.tsx +0 -51
- package/src/renderers/layout/card.tsx +0 -85
- package/src/renderers/layout/container.tsx +0 -122
- package/src/renderers/layout/flex.tsx +0 -132
- package/src/renderers/layout/grid.tsx +0 -178
- package/src/renderers/layout/index.ts +0 -19
- package/src/renderers/layout/page.tsx +0 -466
- package/src/renderers/layout/semantic.tsx +0 -48
- package/src/renderers/layout/stack.tsx +0 -132
- package/src/renderers/layout/tabs.tsx +0 -97
- package/src/renderers/navigation/header-bar.tsx +0 -118
- package/src/renderers/navigation/index.ts +0 -10
- package/src/renderers/navigation/sidebar.tsx +0 -208
- package/src/renderers/overlay/alert-dialog.tsx +0 -72
- package/src/renderers/overlay/context-menu.tsx +0 -100
- package/src/renderers/overlay/dialog.tsx +0 -77
- package/src/renderers/overlay/drawer.tsx +0 -77
- package/src/renderers/overlay/dropdown-menu.tsx +0 -99
- package/src/renderers/overlay/hover-card.tsx +0 -55
- package/src/renderers/overlay/index.ts +0 -18
- package/src/renderers/overlay/menubar.tsx +0 -76
- package/src/renderers/overlay/popover.tsx +0 -56
- package/src/renderers/overlay/sheet.tsx +0 -77
- package/src/renderers/overlay/tooltip.tsx +0 -67
- package/src/renderers/placeholders.tsx +0 -107
- package/src/stories/CRMApp.stories.tsx +0 -706
- package/src/stories/ConfigPanel.stories.tsx +0 -232
- package/src/stories/Guide.mdx +0 -55
- package/src/stories/MockedData.stories.tsx +0 -121
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +0 -1
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/avif-test-image.avif +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/discord.svg +0 -1
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +0 -1
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +0 -1
- package/src/stories/assets/youtube.svg +0 -1
- package/src/stories/button.css +0 -30
- package/src/stories/header.css +0 -32
- package/src/stories/page.css +0 -68
- package/src/stories-json/Accessibility.mdx +0 -297
- package/src/stories-json/EdgeCases.stories.tsx +0 -160
- package/src/stories-json/GettingStarted.mdx +0 -89
- package/src/stories-json/Introduction.mdx +0 -127
- package/src/stories-json/accordion.stories.tsx +0 -43
- package/src/stories-json/aggrid.stories.tsx +0 -103
- package/src/stories-json/alert.stories.tsx +0 -39
- package/src/stories-json/aspect-ratio.stories.tsx +0 -34
- package/src/stories-json/avatar.stories.tsx +0 -38
- package/src/stories-json/badge.stories.tsx +0 -53
- package/src/stories-json/breadcrumb.stories.tsx +0 -30
- package/src/stories-json/button-group.stories.tsx +0 -43
- package/src/stories-json/button.stories.tsx +0 -73
- package/src/stories-json/calendar.stories.tsx +0 -85
- package/src/stories-json/card.stories.tsx +0 -48
- package/src/stories-json/carousel.stories.tsx +0 -33
- package/src/stories-json/charts.stories.tsx +0 -195
- package/src/stories-json/chatbot.stories.tsx +0 -349
- package/src/stories-json/code-editor.stories.tsx +0 -92
- package/src/stories-json/collapsible.stories.tsx +0 -40
- package/src/stories-json/controls.stories.tsx +0 -36
- package/src/stories-json/crm-live-data.stories.tsx +0 -154
- package/src/stories-json/dashboard.stories.tsx +0 -318
- package/src/stories-json/data-table.stories.tsx +0 -136
- package/src/stories-json/data_display_extras.stories.tsx +0 -102
- package/src/stories-json/date-picker.stories.tsx +0 -28
- package/src/stories-json/detail-view.stories.tsx +0 -258
- package/src/stories-json/dialog.stories.tsx +0 -43
- package/src/stories-json/feedback_extras.stories.tsx +0 -40
- package/src/stories-json/feedback_others.stories.tsx +0 -46
- package/src/stories-json/form-variants.stories.tsx +0 -210
- package/src/stories-json/form_advanced.stories.tsx +0 -117
- package/src/stories-json/form_extras.stories.tsx +0 -123
- package/src/stories-json/grid.stories.tsx +0 -56
- package/src/stories-json/icon.stories.tsx +0 -36
- package/src/stories-json/input.stories.tsx +0 -52
- package/src/stories-json/kanban.stories.tsx +0 -295
- package/src/stories-json/layout_extended.stories.tsx +0 -76
- package/src/stories-json/layout_flex.stories.tsx +0 -107
- package/src/stories-json/list-view.stories.tsx +0 -97
- package/src/stories-json/markdown.stories.tsx +0 -129
- package/src/stories-json/menus.stories.tsx +0 -63
- package/src/stories-json/metric-card.stories.tsx +0 -143
- package/src/stories-json/navigation-menu.stories.tsx +0 -37
- package/src/stories-json/object-aggrid-advanced.stories.tsx +0 -389
- package/src/stories-json/object-aggrid.stories.tsx +0 -252
- package/src/stories-json/object-form.stories.tsx +0 -130
- package/src/stories-json/object-gantt.stories.tsx +0 -114
- package/src/stories-json/object-grid.stories.tsx +0 -315
- package/src/stories-json/object-map.stories.tsx +0 -116
- package/src/stories-json/object-view.stories.tsx +0 -118
- package/src/stories-json/overlay_extras.stories.tsx +0 -113
- package/src/stories-json/overlay_others.stories.tsx +0 -76
- package/src/stories-json/page.stories.tsx +0 -55
- package/src/stories-json/reports.stories.tsx +0 -163
- package/src/stories-json/resizable.stories.tsx +0 -44
- package/src/stories-json/select.stories.tsx +0 -34
- package/src/stories-json/separator.stories.tsx +0 -41
- package/src/stories-json/sidebar.stories.tsx +0 -147
- package/src/stories-json/statistic.stories.tsx +0 -44
- package/src/stories-json/tabs.stories.tsx +0 -51
- package/src/stories-json/timeline.stories.tsx +0 -188
- package/src/stories-json/typography.stories.tsx +0 -45
- package/src/types/config-panel.ts +0 -101
- package/src/ui/accordion.tsx +0 -66
- package/src/ui/alert-dialog.tsx +0 -149
- package/src/ui/alert.tsx +0 -67
- package/src/ui/aspect-ratio.tsx +0 -15
- package/src/ui/avatar.tsx +0 -58
- package/src/ui/badge.tsx +0 -44
- package/src/ui/breadcrumb.tsx +0 -123
- package/src/ui/button.tsx +0 -64
- package/src/ui/calendar.tsx +0 -221
- package/src/ui/card.tsx +0 -87
- package/src/ui/carousel.tsx +0 -270
- package/src/ui/chart.tsx +0 -377
- package/src/ui/checkbox.tsx +0 -38
- package/src/ui/collapsible.tsx +0 -19
- package/src/ui/command.tsx +0 -161
- package/src/ui/context-menu.tsx +0 -208
- package/src/ui/dialog.tsx +0 -130
- package/src/ui/drawer.tsx +0 -126
- package/src/ui/dropdown-menu.tsx +0 -208
- package/src/ui/form.tsx +0 -186
- package/src/ui/hover-card.tsx +0 -37
- package/src/ui/index.ts +0 -56
- package/src/ui/input-otp.tsx +0 -79
- package/src/ui/input.tsx +0 -30
- package/src/ui/label.tsx +0 -34
- package/src/ui/menubar.tsx +0 -264
- package/src/ui/navigation-menu.tsx +0 -136
- package/src/ui/pagination.tsx +0 -125
- package/src/ui/popover.tsx +0 -39
- package/src/ui/progress.tsx +0 -36
- package/src/ui/radio-group.tsx +0 -52
- package/src/ui/resizable.tsx +0 -53
- package/src/ui/scroll-area.tsx +0 -56
- package/src/ui/select.tsx +0 -168
- package/src/ui/separator.tsx +0 -39
- package/src/ui/sheet.tsx +0 -150
- package/src/ui/sidebar.tsx +0 -781
- package/src/ui/skeleton.tsx +0 -23
- package/src/ui/slider.tsx +0 -39
- package/src/ui/sonner.tsx +0 -53
- package/src/ui/switch.tsx +0 -37
- package/src/ui/table.tsx +0 -125
- package/src/ui/tabs.tsx +0 -63
- package/src/ui/textarea.tsx +0 -30
- package/src/ui/toast.tsx +0 -137
- package/src/ui/toggle-group.tsx +0 -69
- package/src/ui/toggle.tsx +0 -53
- package/src/ui/tooltip.tsx +0 -38
- package/src/ui/typography.tsx +0 -85
- package/tsconfig.json +0 -19
- package/vite.config.ts +0 -71
- package/vitest.config.ts +0 -5
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ObjectUI
|
|
3
|
-
* Copyright (c) 2024-present ObjectStack Inc.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the MIT license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import * as React from "react"
|
|
10
|
-
import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu"
|
|
11
|
-
import { cva } from "class-variance-authority"
|
|
12
|
-
import { ChevronDown } from "lucide-react"
|
|
13
|
-
|
|
14
|
-
import { cn } from "../lib/utils"
|
|
15
|
-
|
|
16
|
-
const NavigationMenu = React.forwardRef<
|
|
17
|
-
React.ElementRef<typeof NavigationMenuPrimitive.Root>,
|
|
18
|
-
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root>
|
|
19
|
-
>(({ className, children, ...props }, ref) => (
|
|
20
|
-
<NavigationMenuPrimitive.Root
|
|
21
|
-
ref={ref}
|
|
22
|
-
className={cn(
|
|
23
|
-
"relative z-10 flex max-w-max flex-1 items-center justify-center",
|
|
24
|
-
className
|
|
25
|
-
)}
|
|
26
|
-
{...props}
|
|
27
|
-
>
|
|
28
|
-
{children}
|
|
29
|
-
<NavigationMenuViewport />
|
|
30
|
-
</NavigationMenuPrimitive.Root>
|
|
31
|
-
))
|
|
32
|
-
NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName
|
|
33
|
-
|
|
34
|
-
const NavigationMenuList = React.forwardRef<
|
|
35
|
-
React.ElementRef<typeof NavigationMenuPrimitive.List>,
|
|
36
|
-
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List>
|
|
37
|
-
>(({ className, ...props }, ref) => (
|
|
38
|
-
<NavigationMenuPrimitive.List
|
|
39
|
-
ref={ref}
|
|
40
|
-
className={cn(
|
|
41
|
-
"group flex flex-1 list-none items-center justify-center space-x-1",
|
|
42
|
-
className
|
|
43
|
-
)}
|
|
44
|
-
{...props}
|
|
45
|
-
/>
|
|
46
|
-
))
|
|
47
|
-
NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName
|
|
48
|
-
|
|
49
|
-
const NavigationMenuItem = NavigationMenuPrimitive.Item
|
|
50
|
-
|
|
51
|
-
const navigationMenuTriggerStyle = cva(
|
|
52
|
-
"group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=open]:text-accent-foreground data-[state=open]:bg-accent/50 data-[state=open]:hover:bg-accent data-[state=open]:focus:bg-accent"
|
|
53
|
-
)
|
|
54
|
-
|
|
55
|
-
const NavigationMenuTrigger = React.forwardRef<
|
|
56
|
-
React.ElementRef<typeof NavigationMenuPrimitive.Trigger>,
|
|
57
|
-
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger>
|
|
58
|
-
>(({ className, children, ...props }, ref) => (
|
|
59
|
-
<NavigationMenuPrimitive.Trigger
|
|
60
|
-
ref={ref}
|
|
61
|
-
className={cn(navigationMenuTriggerStyle(), "group", className)}
|
|
62
|
-
{...props}
|
|
63
|
-
>
|
|
64
|
-
{children}{" "}
|
|
65
|
-
<ChevronDown
|
|
66
|
-
className="relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180"
|
|
67
|
-
aria-hidden="true"
|
|
68
|
-
/>
|
|
69
|
-
</NavigationMenuPrimitive.Trigger>
|
|
70
|
-
))
|
|
71
|
-
NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName
|
|
72
|
-
|
|
73
|
-
const NavigationMenuContent = React.forwardRef<
|
|
74
|
-
React.ElementRef<typeof NavigationMenuPrimitive.Content>,
|
|
75
|
-
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Content>
|
|
76
|
-
>(({ className, ...props }, ref) => (
|
|
77
|
-
<NavigationMenuPrimitive.Content
|
|
78
|
-
ref={ref}
|
|
79
|
-
className={cn(
|
|
80
|
-
"left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out 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 md:absolute md:w-auto ",
|
|
81
|
-
className
|
|
82
|
-
)}
|
|
83
|
-
{...props}
|
|
84
|
-
/>
|
|
85
|
-
))
|
|
86
|
-
NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName
|
|
87
|
-
|
|
88
|
-
const NavigationMenuLink = NavigationMenuPrimitive.Link
|
|
89
|
-
|
|
90
|
-
const NavigationMenuViewport = React.forwardRef<
|
|
91
|
-
React.ElementRef<typeof NavigationMenuPrimitive.Viewport>,
|
|
92
|
-
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport>
|
|
93
|
-
>(({ className, ...props }, ref) => (
|
|
94
|
-
<div className={cn("absolute left-0 top-full flex justify-center")}>
|
|
95
|
-
<NavigationMenuPrimitive.Viewport
|
|
96
|
-
className={cn(
|
|
97
|
-
"origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",
|
|
98
|
-
className
|
|
99
|
-
)}
|
|
100
|
-
ref={ref}
|
|
101
|
-
{...props}
|
|
102
|
-
/>
|
|
103
|
-
</div>
|
|
104
|
-
))
|
|
105
|
-
NavigationMenuViewport.displayName =
|
|
106
|
-
NavigationMenuPrimitive.Viewport.displayName
|
|
107
|
-
|
|
108
|
-
const NavigationMenuIndicator = React.forwardRef<
|
|
109
|
-
React.ElementRef<typeof NavigationMenuPrimitive.Indicator>,
|
|
110
|
-
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Indicator>
|
|
111
|
-
>(({ className, ...props }, ref) => (
|
|
112
|
-
<NavigationMenuPrimitive.Indicator
|
|
113
|
-
ref={ref}
|
|
114
|
-
className={cn(
|
|
115
|
-
"top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",
|
|
116
|
-
className
|
|
117
|
-
)}
|
|
118
|
-
{...props}
|
|
119
|
-
>
|
|
120
|
-
<div className="relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md" />
|
|
121
|
-
</NavigationMenuPrimitive.Indicator>
|
|
122
|
-
))
|
|
123
|
-
NavigationMenuIndicator.displayName =
|
|
124
|
-
NavigationMenuPrimitive.Indicator.displayName
|
|
125
|
-
|
|
126
|
-
export {
|
|
127
|
-
navigationMenuTriggerStyle,
|
|
128
|
-
NavigationMenu,
|
|
129
|
-
NavigationMenuList,
|
|
130
|
-
NavigationMenuItem,
|
|
131
|
-
NavigationMenuContent,
|
|
132
|
-
NavigationMenuTrigger,
|
|
133
|
-
NavigationMenuLink,
|
|
134
|
-
NavigationMenuIndicator,
|
|
135
|
-
NavigationMenuViewport,
|
|
136
|
-
}
|
package/src/ui/pagination.tsx
DELETED
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ObjectUI
|
|
3
|
-
* Copyright (c) 2024-present ObjectStack Inc.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the MIT license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import * as React from "react"
|
|
10
|
-
import { ChevronLeft, ChevronRight, MoreHorizontal } from "lucide-react"
|
|
11
|
-
|
|
12
|
-
import { cn } from "../lib/utils"
|
|
13
|
-
import { ButtonProps, buttonVariants } from "./button"
|
|
14
|
-
|
|
15
|
-
const Pagination = ({ className, ...props }: React.ComponentProps<"nav">) => (
|
|
16
|
-
<nav
|
|
17
|
-
role="navigation"
|
|
18
|
-
aria-label="pagination"
|
|
19
|
-
className={cn("mx-auto flex w-full justify-center", className)}
|
|
20
|
-
{...props}
|
|
21
|
-
/>
|
|
22
|
-
)
|
|
23
|
-
Pagination.displayName = "Pagination"
|
|
24
|
-
|
|
25
|
-
const PaginationContent = React.forwardRef<
|
|
26
|
-
HTMLUListElement,
|
|
27
|
-
React.ComponentProps<"ul">
|
|
28
|
-
>(({ className, ...props }, ref) => (
|
|
29
|
-
<ul
|
|
30
|
-
ref={ref}
|
|
31
|
-
className={cn("flex flex-row items-center gap-1", className)}
|
|
32
|
-
{...props}
|
|
33
|
-
/>
|
|
34
|
-
))
|
|
35
|
-
PaginationContent.displayName = "PaginationContent"
|
|
36
|
-
|
|
37
|
-
const PaginationItem = React.forwardRef<
|
|
38
|
-
HTMLLIElement,
|
|
39
|
-
React.ComponentProps<"li">
|
|
40
|
-
>(({ className, ...props }, ref) => (
|
|
41
|
-
<li ref={ref} className={cn("", className)} {...props} />
|
|
42
|
-
))
|
|
43
|
-
PaginationItem.displayName = "PaginationItem"
|
|
44
|
-
|
|
45
|
-
type PaginationLinkProps = {
|
|
46
|
-
isActive?: boolean
|
|
47
|
-
} & Pick<ButtonProps, "size"> &
|
|
48
|
-
React.ComponentProps<"a">
|
|
49
|
-
|
|
50
|
-
const PaginationLink = ({
|
|
51
|
-
className,
|
|
52
|
-
isActive,
|
|
53
|
-
size = "icon",
|
|
54
|
-
...props
|
|
55
|
-
}: PaginationLinkProps) => (
|
|
56
|
-
<a
|
|
57
|
-
aria-current={isActive ? "page" : undefined}
|
|
58
|
-
className={cn(
|
|
59
|
-
buttonVariants({
|
|
60
|
-
variant: isActive ? "outline" : "ghost",
|
|
61
|
-
size,
|
|
62
|
-
}),
|
|
63
|
-
className
|
|
64
|
-
)}
|
|
65
|
-
{...props}
|
|
66
|
-
/>
|
|
67
|
-
)
|
|
68
|
-
PaginationLink.displayName = "PaginationLink"
|
|
69
|
-
|
|
70
|
-
const PaginationPrevious = ({
|
|
71
|
-
className,
|
|
72
|
-
...props
|
|
73
|
-
}: React.ComponentProps<typeof PaginationLink>) => (
|
|
74
|
-
<PaginationLink
|
|
75
|
-
aria-label="Go to previous page"
|
|
76
|
-
size="default"
|
|
77
|
-
className={cn("gap-1 pl-2.5", className)}
|
|
78
|
-
{...props}
|
|
79
|
-
>
|
|
80
|
-
<ChevronLeft className="h-4 w-4" />
|
|
81
|
-
<span>Previous</span>
|
|
82
|
-
</PaginationLink>
|
|
83
|
-
)
|
|
84
|
-
PaginationPrevious.displayName = "PaginationPrevious"
|
|
85
|
-
|
|
86
|
-
const PaginationNext = ({
|
|
87
|
-
className,
|
|
88
|
-
...props
|
|
89
|
-
}: React.ComponentProps<typeof PaginationLink>) => (
|
|
90
|
-
<PaginationLink
|
|
91
|
-
aria-label="Go to next page"
|
|
92
|
-
size="default"
|
|
93
|
-
className={cn("gap-1 pr-2.5", className)}
|
|
94
|
-
{...props}
|
|
95
|
-
>
|
|
96
|
-
<span>Next</span>
|
|
97
|
-
<ChevronRight className="h-4 w-4" />
|
|
98
|
-
</PaginationLink>
|
|
99
|
-
)
|
|
100
|
-
PaginationNext.displayName = "PaginationNext"
|
|
101
|
-
|
|
102
|
-
const PaginationEllipsis = ({
|
|
103
|
-
className,
|
|
104
|
-
...props
|
|
105
|
-
}: React.ComponentProps<"span">) => (
|
|
106
|
-
<span
|
|
107
|
-
aria-hidden
|
|
108
|
-
className={cn("flex h-9 w-9 items-center justify-center", className)}
|
|
109
|
-
{...props}
|
|
110
|
-
>
|
|
111
|
-
<MoreHorizontal className="h-4 w-4" />
|
|
112
|
-
<span className="sr-only">More pages</span>
|
|
113
|
-
</span>
|
|
114
|
-
)
|
|
115
|
-
PaginationEllipsis.displayName = "PaginationEllipsis"
|
|
116
|
-
|
|
117
|
-
export {
|
|
118
|
-
Pagination,
|
|
119
|
-
PaginationContent,
|
|
120
|
-
PaginationEllipsis,
|
|
121
|
-
PaginationItem,
|
|
122
|
-
PaginationLink,
|
|
123
|
-
PaginationNext,
|
|
124
|
-
PaginationPrevious,
|
|
125
|
-
}
|
package/src/ui/popover.tsx
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ObjectUI
|
|
3
|
-
* Copyright (c) 2024-present ObjectStack Inc.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the MIT license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
"use client"
|
|
10
|
-
|
|
11
|
-
import * as React from "react"
|
|
12
|
-
import * as PopoverPrimitive from "@radix-ui/react-popover"
|
|
13
|
-
|
|
14
|
-
import { cn } from "../lib/utils"
|
|
15
|
-
|
|
16
|
-
const Popover = PopoverPrimitive.Root
|
|
17
|
-
|
|
18
|
-
const PopoverTrigger = PopoverPrimitive.Trigger
|
|
19
|
-
|
|
20
|
-
const PopoverContent = React.forwardRef<
|
|
21
|
-
React.ElementRef<typeof PopoverPrimitive.Content>,
|
|
22
|
-
React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>
|
|
23
|
-
>(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
|
|
24
|
-
<PopoverPrimitive.Portal>
|
|
25
|
-
<PopoverPrimitive.Content
|
|
26
|
-
ref={ref}
|
|
27
|
-
align={align}
|
|
28
|
-
sideOffset={sideOffset}
|
|
29
|
-
className={cn(
|
|
30
|
-
"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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-[--radix-popover-content-transform-origin]",
|
|
31
|
-
className
|
|
32
|
-
)}
|
|
33
|
-
{...props}
|
|
34
|
-
/>
|
|
35
|
-
</PopoverPrimitive.Portal>
|
|
36
|
-
))
|
|
37
|
-
PopoverContent.displayName = PopoverPrimitive.Content.displayName
|
|
38
|
-
|
|
39
|
-
export { Popover, PopoverTrigger, PopoverContent }
|
package/src/ui/progress.tsx
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ObjectUI
|
|
3
|
-
* Copyright (c) 2024-present ObjectStack Inc.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the MIT license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
"use client"
|
|
10
|
-
|
|
11
|
-
import * as React from "react"
|
|
12
|
-
import * as ProgressPrimitive from "@radix-ui/react-progress"
|
|
13
|
-
|
|
14
|
-
import { cn } from "../lib/utils"
|
|
15
|
-
|
|
16
|
-
const Progress = React.forwardRef<
|
|
17
|
-
React.ElementRef<typeof ProgressPrimitive.Root>,
|
|
18
|
-
React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>
|
|
19
|
-
>(({ className, value, ...props }, ref) => (
|
|
20
|
-
<ProgressPrimitive.Root
|
|
21
|
-
ref={ref}
|
|
22
|
-
className={cn(
|
|
23
|
-
"relative h-4 w-full overflow-hidden rounded-full bg-secondary",
|
|
24
|
-
className
|
|
25
|
-
)}
|
|
26
|
-
{...props}
|
|
27
|
-
>
|
|
28
|
-
<ProgressPrimitive.Indicator
|
|
29
|
-
className="h-full w-full flex-1 bg-primary transition-all"
|
|
30
|
-
style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
|
|
31
|
-
/>
|
|
32
|
-
</ProgressPrimitive.Root>
|
|
33
|
-
))
|
|
34
|
-
Progress.displayName = ProgressPrimitive.Root.displayName
|
|
35
|
-
|
|
36
|
-
export { Progress }
|
package/src/ui/radio-group.tsx
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ObjectUI
|
|
3
|
-
* Copyright (c) 2024-present ObjectStack Inc.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the MIT license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
"use client"
|
|
10
|
-
|
|
11
|
-
import * as React from "react"
|
|
12
|
-
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group"
|
|
13
|
-
import { Circle } from "lucide-react"
|
|
14
|
-
|
|
15
|
-
import { cn } from "../lib/utils"
|
|
16
|
-
|
|
17
|
-
const RadioGroup = React.forwardRef<
|
|
18
|
-
React.ElementRef<typeof RadioGroupPrimitive.Root>,
|
|
19
|
-
React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>
|
|
20
|
-
>(({ className, ...props }, ref) => {
|
|
21
|
-
return (
|
|
22
|
-
<RadioGroupPrimitive.Root
|
|
23
|
-
className={cn("grid gap-2", className)}
|
|
24
|
-
{...props}
|
|
25
|
-
ref={ref}
|
|
26
|
-
/>
|
|
27
|
-
)
|
|
28
|
-
})
|
|
29
|
-
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName
|
|
30
|
-
|
|
31
|
-
const RadioGroupItem = React.forwardRef<
|
|
32
|
-
React.ElementRef<typeof RadioGroupPrimitive.Item>,
|
|
33
|
-
React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>
|
|
34
|
-
>(({ className, ...props }, ref) => {
|
|
35
|
-
return (
|
|
36
|
-
<RadioGroupPrimitive.Item
|
|
37
|
-
ref={ref}
|
|
38
|
-
className={cn(
|
|
39
|
-
"aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
40
|
-
className
|
|
41
|
-
)}
|
|
42
|
-
{...props}
|
|
43
|
-
>
|
|
44
|
-
<RadioGroupPrimitive.Indicator className="flex items-center justify-center">
|
|
45
|
-
<Circle className="h-2.5 w-2.5 fill-current text-current" />
|
|
46
|
-
</RadioGroupPrimitive.Indicator>
|
|
47
|
-
</RadioGroupPrimitive.Item>
|
|
48
|
-
)
|
|
49
|
-
})
|
|
50
|
-
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName
|
|
51
|
-
|
|
52
|
-
export { RadioGroup, RadioGroupItem }
|
package/src/ui/resizable.tsx
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ObjectUI
|
|
3
|
-
* Copyright (c) 2024-present ObjectStack Inc.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the MIT license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
"use client"
|
|
10
|
-
|
|
11
|
-
import { GripVertical } from "lucide-react"
|
|
12
|
-
import { Group, Panel, Separator } from "react-resizable-panels"
|
|
13
|
-
|
|
14
|
-
import { cn } from "../lib/utils"
|
|
15
|
-
|
|
16
|
-
const ResizablePanelGroup = ({
|
|
17
|
-
className,
|
|
18
|
-
...props
|
|
19
|
-
}: React.ComponentProps<typeof Group>) => (
|
|
20
|
-
<Group
|
|
21
|
-
className={cn(
|
|
22
|
-
"flex h-full w-full data-[panel-group-direction=vertical]:flex-col",
|
|
23
|
-
className
|
|
24
|
-
)}
|
|
25
|
-
{...props}
|
|
26
|
-
/>
|
|
27
|
-
)
|
|
28
|
-
|
|
29
|
-
const ResizablePanel = Panel
|
|
30
|
-
|
|
31
|
-
const ResizableHandle = ({
|
|
32
|
-
withHandle,
|
|
33
|
-
className,
|
|
34
|
-
...props
|
|
35
|
-
}: React.ComponentProps<typeof Separator> & {
|
|
36
|
-
withHandle?: boolean
|
|
37
|
-
}) => (
|
|
38
|
-
<Separator
|
|
39
|
-
className={cn(
|
|
40
|
-
"relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",
|
|
41
|
-
className
|
|
42
|
-
)}
|
|
43
|
-
{...props}
|
|
44
|
-
>
|
|
45
|
-
{withHandle && (
|
|
46
|
-
<div className="z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border">
|
|
47
|
-
<GripVertical className="h-2.5 w-2.5" />
|
|
48
|
-
</div>
|
|
49
|
-
)}
|
|
50
|
-
</Separator>
|
|
51
|
-
)
|
|
52
|
-
|
|
53
|
-
export { ResizablePanelGroup, ResizablePanel, ResizableHandle }
|
package/src/ui/scroll-area.tsx
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ObjectUI
|
|
3
|
-
* Copyright (c) 2024-present ObjectStack Inc.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the MIT license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
"use client"
|
|
10
|
-
|
|
11
|
-
import * as React from "react"
|
|
12
|
-
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area"
|
|
13
|
-
|
|
14
|
-
import { cn } from "../lib/utils"
|
|
15
|
-
|
|
16
|
-
const ScrollArea = React.forwardRef<
|
|
17
|
-
React.ElementRef<typeof ScrollAreaPrimitive.Root>,
|
|
18
|
-
React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>
|
|
19
|
-
>(({ className, children, ...props }, ref) => (
|
|
20
|
-
<ScrollAreaPrimitive.Root
|
|
21
|
-
ref={ref}
|
|
22
|
-
className={cn("relative overflow-hidden", className)}
|
|
23
|
-
{...props}
|
|
24
|
-
>
|
|
25
|
-
<ScrollAreaPrimitive.Viewport className="h-full w-full rounded-[inherit]">
|
|
26
|
-
{children}
|
|
27
|
-
</ScrollAreaPrimitive.Viewport>
|
|
28
|
-
<ScrollBar />
|
|
29
|
-
<ScrollAreaPrimitive.Corner />
|
|
30
|
-
</ScrollAreaPrimitive.Root>
|
|
31
|
-
))
|
|
32
|
-
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName
|
|
33
|
-
|
|
34
|
-
const ScrollBar = React.forwardRef<
|
|
35
|
-
React.ElementRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,
|
|
36
|
-
React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>
|
|
37
|
-
>(({ className, orientation = "vertical", ...props }, ref) => (
|
|
38
|
-
<ScrollAreaPrimitive.ScrollAreaScrollbar
|
|
39
|
-
ref={ref}
|
|
40
|
-
orientation={orientation}
|
|
41
|
-
className={cn(
|
|
42
|
-
"flex touch-none select-none transition-colors",
|
|
43
|
-
orientation === "vertical" &&
|
|
44
|
-
"h-full w-2.5 border-l border-l-transparent p-[1px]",
|
|
45
|
-
orientation === "horizontal" &&
|
|
46
|
-
"h-2.5 flex-col border-t border-t-transparent p-[1px]",
|
|
47
|
-
className
|
|
48
|
-
)}
|
|
49
|
-
{...props}
|
|
50
|
-
>
|
|
51
|
-
<ScrollAreaPrimitive.ScrollAreaThumb className="relative flex-1 rounded-full bg-border" />
|
|
52
|
-
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
|
53
|
-
))
|
|
54
|
-
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName
|
|
55
|
-
|
|
56
|
-
export { ScrollArea, ScrollBar }
|
package/src/ui/select.tsx
DELETED
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ObjectUI
|
|
3
|
-
* Copyright (c) 2024-present ObjectStack Inc.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the MIT license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
"use client"
|
|
10
|
-
|
|
11
|
-
import * as React from "react"
|
|
12
|
-
import * as SelectPrimitive from "@radix-ui/react-select"
|
|
13
|
-
import { Check, ChevronDown, ChevronUp } from "lucide-react"
|
|
14
|
-
|
|
15
|
-
import { cn } from "../lib/utils"
|
|
16
|
-
|
|
17
|
-
const Select = SelectPrimitive.Root
|
|
18
|
-
|
|
19
|
-
const SelectGroup = SelectPrimitive.Group
|
|
20
|
-
|
|
21
|
-
const SelectValue = SelectPrimitive.Value
|
|
22
|
-
|
|
23
|
-
const SelectTrigger = React.forwardRef<
|
|
24
|
-
React.ElementRef<typeof SelectPrimitive.Trigger>,
|
|
25
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>
|
|
26
|
-
>(({ className, children, ...props }, ref) => (
|
|
27
|
-
<SelectPrimitive.Trigger
|
|
28
|
-
ref={ref}
|
|
29
|
-
className={cn(
|
|
30
|
-
"flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
31
|
-
className
|
|
32
|
-
)}
|
|
33
|
-
{...props}
|
|
34
|
-
>
|
|
35
|
-
{children}
|
|
36
|
-
<SelectPrimitive.Icon asChild>
|
|
37
|
-
<ChevronDown className="h-4 w-4 opacity-50" />
|
|
38
|
-
</SelectPrimitive.Icon>
|
|
39
|
-
</SelectPrimitive.Trigger>
|
|
40
|
-
))
|
|
41
|
-
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName
|
|
42
|
-
|
|
43
|
-
const SelectScrollUpButton = React.forwardRef<
|
|
44
|
-
React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,
|
|
45
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>
|
|
46
|
-
>(({ className, ...props }, ref) => (
|
|
47
|
-
<SelectPrimitive.ScrollUpButton
|
|
48
|
-
ref={ref}
|
|
49
|
-
className={cn(
|
|
50
|
-
"flex cursor-default items-center justify-center py-1",
|
|
51
|
-
className
|
|
52
|
-
)}
|
|
53
|
-
{...props}
|
|
54
|
-
>
|
|
55
|
-
<ChevronUp className="h-4 w-4" />
|
|
56
|
-
</SelectPrimitive.ScrollUpButton>
|
|
57
|
-
))
|
|
58
|
-
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName
|
|
59
|
-
|
|
60
|
-
const SelectScrollDownButton = React.forwardRef<
|
|
61
|
-
React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,
|
|
62
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>
|
|
63
|
-
>(({ className, ...props }, ref) => (
|
|
64
|
-
<SelectPrimitive.ScrollDownButton
|
|
65
|
-
ref={ref}
|
|
66
|
-
className={cn(
|
|
67
|
-
"flex cursor-default items-center justify-center py-1",
|
|
68
|
-
className
|
|
69
|
-
)}
|
|
70
|
-
{...props}
|
|
71
|
-
>
|
|
72
|
-
<ChevronDown className="h-4 w-4" />
|
|
73
|
-
</SelectPrimitive.ScrollDownButton>
|
|
74
|
-
))
|
|
75
|
-
SelectScrollDownButton.displayName =
|
|
76
|
-
SelectPrimitive.ScrollDownButton.displayName
|
|
77
|
-
|
|
78
|
-
const SelectContent = React.forwardRef<
|
|
79
|
-
React.ElementRef<typeof SelectPrimitive.Content>,
|
|
80
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
|
|
81
|
-
>(({ className, children, position = "popper", ...props }, ref) => (
|
|
82
|
-
<SelectPrimitive.Portal>
|
|
83
|
-
<SelectPrimitive.Content
|
|
84
|
-
ref={ref}
|
|
85
|
-
className={cn(
|
|
86
|
-
"relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover 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-[--radix-select-content-transform-origin]",
|
|
87
|
-
position === "popper" &&
|
|
88
|
-
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
89
|
-
className
|
|
90
|
-
)}
|
|
91
|
-
position={position}
|
|
92
|
-
{...props}
|
|
93
|
-
>
|
|
94
|
-
<SelectScrollUpButton />
|
|
95
|
-
<SelectPrimitive.Viewport
|
|
96
|
-
className={cn(
|
|
97
|
-
"p-1",
|
|
98
|
-
position === "popper" &&
|
|
99
|
-
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
100
|
-
)}
|
|
101
|
-
>
|
|
102
|
-
{children}
|
|
103
|
-
</SelectPrimitive.Viewport>
|
|
104
|
-
<SelectScrollDownButton />
|
|
105
|
-
</SelectPrimitive.Content>
|
|
106
|
-
</SelectPrimitive.Portal>
|
|
107
|
-
))
|
|
108
|
-
SelectContent.displayName = SelectPrimitive.Content.displayName
|
|
109
|
-
|
|
110
|
-
const SelectLabel = React.forwardRef<
|
|
111
|
-
React.ElementRef<typeof SelectPrimitive.Label>,
|
|
112
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>
|
|
113
|
-
>(({ className, ...props }, ref) => (
|
|
114
|
-
<SelectPrimitive.Label
|
|
115
|
-
ref={ref}
|
|
116
|
-
className={cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className)}
|
|
117
|
-
{...props}
|
|
118
|
-
/>
|
|
119
|
-
))
|
|
120
|
-
SelectLabel.displayName = SelectPrimitive.Label.displayName
|
|
121
|
-
|
|
122
|
-
const SelectItem = React.forwardRef<
|
|
123
|
-
React.ElementRef<typeof SelectPrimitive.Item>,
|
|
124
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>
|
|
125
|
-
>(({ className, children, ...props }, ref) => (
|
|
126
|
-
<SelectPrimitive.Item
|
|
127
|
-
ref={ref}
|
|
128
|
-
className={cn(
|
|
129
|
-
"relative flex w-full 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",
|
|
130
|
-
className
|
|
131
|
-
)}
|
|
132
|
-
{...props}
|
|
133
|
-
>
|
|
134
|
-
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
135
|
-
<SelectPrimitive.ItemIndicator>
|
|
136
|
-
<Check className="h-4 w-4" />
|
|
137
|
-
</SelectPrimitive.ItemIndicator>
|
|
138
|
-
</span>
|
|
139
|
-
|
|
140
|
-
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
141
|
-
</SelectPrimitive.Item>
|
|
142
|
-
))
|
|
143
|
-
SelectItem.displayName = SelectPrimitive.Item.displayName
|
|
144
|
-
|
|
145
|
-
const SelectSeparator = React.forwardRef<
|
|
146
|
-
React.ElementRef<typeof SelectPrimitive.Separator>,
|
|
147
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>
|
|
148
|
-
>(({ className, ...props }, ref) => (
|
|
149
|
-
<SelectPrimitive.Separator
|
|
150
|
-
ref={ref}
|
|
151
|
-
className={cn("-mx-1 my-1 h-px bg-muted", className)}
|
|
152
|
-
{...props}
|
|
153
|
-
/>
|
|
154
|
-
))
|
|
155
|
-
SelectSeparator.displayName = SelectPrimitive.Separator.displayName
|
|
156
|
-
|
|
157
|
-
export {
|
|
158
|
-
Select,
|
|
159
|
-
SelectGroup,
|
|
160
|
-
SelectValue,
|
|
161
|
-
SelectTrigger,
|
|
162
|
-
SelectContent,
|
|
163
|
-
SelectLabel,
|
|
164
|
-
SelectItem,
|
|
165
|
-
SelectSeparator,
|
|
166
|
-
SelectScrollUpButton,
|
|
167
|
-
SelectScrollDownButton,
|
|
168
|
-
}
|