@object-ui/components 0.3.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +47 -0
- package/README.md +13 -0
- package/dist/index.css +1 -1
- package/dist/index.js +34610 -24854
- package/dist/index.umd.cjs +53 -32
- package/dist/src/SchemaRenderer.d.ts +3 -0
- package/dist/src/{ui → custom}/button-group.d.ts +1 -1
- package/dist/src/custom/field.d.ts +19 -0
- package/dist/src/custom/index.d.ts +12 -0
- package/dist/src/custom/input-group.d.ts +14 -0
- package/dist/src/{ui → custom}/item.d.ts +1 -1
- package/dist/src/custom/native-select.d.ts +12 -0
- package/dist/src/custom/sort-builder.d.ts +22 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/renderers/data-display/table.d.ts +1 -1
- package/dist/src/renderers/layout/page.d.ts +1 -1
- package/dist/src/renderers/placeholders.d.ts +1 -1
- package/dist/src/ui/accordion.d.ts +4 -4
- package/dist/src/ui/alert-dialog.d.ts +17 -11
- package/dist/src/ui/alert.d.ts +4 -5
- package/dist/src/ui/aspect-ratio.d.ts +1 -1
- package/dist/src/ui/avatar.d.ts +3 -3
- package/dist/src/ui/badge.d.ts +3 -3
- package/dist/src/ui/breadcrumb.d.ts +16 -8
- package/dist/src/ui/calendar.d.ts +7 -7
- package/dist/src/ui/card.d.ts +7 -8
- package/dist/src/ui/carousel.d.ts +5 -6
- package/dist/src/ui/chart.d.ts +62 -0
- package/dist/src/ui/checkbox.d.ts +1 -1
- package/dist/src/ui/collapsible.d.ts +3 -3
- package/dist/src/ui/command.d.ts +78 -16
- package/dist/src/ui/context-menu.d.ts +14 -12
- package/dist/src/ui/dialog.d.ts +17 -13
- package/dist/src/ui/drawer.d.ts +19 -10
- package/dist/src/ui/dropdown-menu.d.ts +20 -18
- package/dist/src/ui/form.d.ts +6 -7
- package/dist/src/ui/hover-card.d.ts +3 -3
- package/dist/src/ui/index.d.ts +2 -8
- package/dist/src/ui/input-otp.d.ts +30 -7
- package/dist/src/ui/label.d.ts +2 -1
- package/dist/src/ui/menubar.d.ts +19 -17
- package/dist/src/ui/navigation-menu.d.ts +9 -11
- package/dist/src/ui/pagination.d.ts +25 -10
- package/dist/src/ui/popover.d.ts +4 -5
- package/dist/src/ui/progress.d.ts +1 -1
- package/dist/src/ui/radio-group.d.ts +2 -2
- package/dist/src/ui/resizable.d.ts +5 -8
- package/dist/src/ui/scroll-area.d.ts +2 -2
- package/dist/src/ui/select.d.ts +11 -13
- package/dist/src/ui/sheet.d.ts +23 -11
- package/dist/src/ui/sidebar.d.ts +27 -29
- package/dist/src/ui/skeleton.d.ts +1 -1
- package/dist/src/ui/slider.d.ts +1 -1
- package/dist/src/ui/sonner.d.ts +2 -1
- package/dist/src/ui/switch.d.ts +2 -2
- package/dist/src/ui/tabs.d.ts +1 -1
- package/dist/src/ui/textarea.d.ts +1 -1
- package/dist/src/ui/toast.d.ts +22 -0
- package/dist/src/ui/toggle-group.d.ts +8 -3
- package/dist/src/ui/toggle.d.ts +4 -1
- package/dist/src/ui/tooltip.d.ts +4 -4
- package/dist/src/ui/typography.d.ts +21 -0
- package/package.json +17 -7
- package/shadcn-components.json +52 -47
- package/src/SchemaRenderer.tsx +28 -0
- package/src/__tests__/PageRendererRegions.test.tsx +59 -0
- package/src/__tests__/Registry.test.ts +21 -0
- package/src/__tests__/basic-renderers.test.tsx +1 -1
- package/src/__tests__/complex-disclosure-renderers.test.tsx +3 -2
- package/src/__tests__/feedback-overlay-renderers.test.tsx +1 -1
- package/src/__tests__/form-renderers.test.tsx +1 -1
- package/src/__tests__/layout-data-renderers.test.tsx +1 -1
- package/src/{ui → custom}/button-group.tsx +1 -1
- package/src/{ui → custom}/combobox.tsx +3 -3
- package/src/{ui → custom}/date-picker.tsx +3 -3
- package/src/custom/field.tsx +81 -0
- package/src/{ui → custom}/filter-builder.tsx +3 -3
- package/src/custom/index.ts +12 -0
- package/src/custom/input-group.tsx +53 -0
- package/src/{ui → custom}/item.tsx +1 -1
- package/src/custom/native-select.tsx +33 -0
- package/src/custom/sort-builder.tsx +129 -0
- package/src/index.css +20 -1
- package/src/index.ts +1 -0
- package/src/renderers/basic/button-group.tsx +1 -0
- package/src/renderers/basic/div.tsx +12 -1
- package/src/renderers/basic/html.tsx +1 -0
- package/src/renderers/basic/icon.tsx +1 -0
- package/src/renderers/basic/image.tsx +1 -0
- package/src/renderers/basic/navigation-menu.tsx +1 -0
- package/src/renderers/basic/pagination.tsx +31 -4
- package/src/renderers/basic/separator.tsx +1 -0
- package/src/renderers/basic/span.tsx +12 -1
- package/src/renderers/basic/text.tsx +4 -2
- package/src/renderers/complex/carousel.tsx +1 -0
- package/src/renderers/complex/data-table.tsx +134 -95
- package/src/renderers/complex/filter-builder.tsx +2 -1
- package/src/renderers/complex/resizable.tsx +2 -1
- package/src/renderers/complex/scroll-area.tsx +25 -7
- package/src/renderers/complex/table.tsx +1 -0
- package/src/renderers/data-display/alert.tsx +1 -0
- package/src/renderers/data-display/avatar.tsx +1 -0
- package/src/renderers/data-display/badge.tsx +1 -0
- package/src/renderers/data-display/breadcrumb.tsx +1 -0
- package/src/renderers/data-display/kbd.tsx +1 -0
- package/src/renderers/data-display/list.tsx +21 -49
- package/src/renderers/data-display/statistic.tsx +21 -5
- package/src/renderers/data-display/table.tsx +21 -11
- package/src/renderers/data-display/tree-view.tsx +7 -1
- package/src/renderers/disclosure/accordion.tsx +1 -0
- package/src/renderers/disclosure/collapsible.tsx +1 -0
- package/src/renderers/disclosure/toggle-group.tsx +2 -0
- package/src/renderers/feedback/empty.tsx +1 -0
- package/src/renderers/feedback/loading.tsx +2 -1
- package/src/renderers/feedback/progress.tsx +1 -0
- package/src/renderers/feedback/skeleton.tsx +1 -0
- package/src/renderers/feedback/sonner.tsx +1 -0
- package/src/renderers/feedback/spinner.tsx +1 -0
- package/src/renderers/feedback/toast.tsx +1 -0
- package/src/renderers/feedback/toaster.tsx +1 -0
- package/src/renderers/form/button.tsx +35 -1
- package/src/renderers/form/calendar.tsx +1 -0
- package/src/renderers/form/checkbox.tsx +38 -16
- package/src/renderers/form/combobox.tsx +2 -1
- package/src/renderers/form/command.tsx +1 -0
- package/src/renderers/form/date-picker.tsx +1 -0
- package/src/renderers/form/file-upload.tsx +1 -0
- package/src/renderers/form/form.tsx +92 -15
- package/src/renderers/form/input-otp.tsx +1 -0
- package/src/renderers/form/input.tsx +3 -0
- package/src/renderers/form/label.tsx +1 -0
- package/src/renderers/form/radio-group.tsx +1 -0
- package/src/renderers/form/select.tsx +35 -15
- package/src/renderers/form/slider.tsx +1 -0
- package/src/renderers/form/switch.tsx +1 -0
- package/src/renderers/form/textarea.tsx +50 -27
- package/src/renderers/form/toggle.tsx +3 -45
- package/src/renderers/layout/aspect-ratio.tsx +2 -1
- package/src/renderers/layout/card.tsx +10 -2
- package/src/renderers/layout/container.tsx +1 -0
- package/src/renderers/layout/flex.tsx +1 -0
- package/src/renderers/layout/grid.tsx +23 -8
- package/src/renderers/layout/page.tsx +35 -23
- package/src/renderers/layout/semantic.tsx +1 -0
- package/src/renderers/layout/stack.tsx +2 -1
- package/src/renderers/layout/tabs.tsx +43 -17
- package/src/renderers/navigation/header-bar.tsx +1 -0
- package/src/renderers/navigation/sidebar.tsx +5 -0
- package/src/renderers/overlay/alert-dialog.tsx +1 -0
- package/src/renderers/overlay/context-menu.tsx +1 -0
- package/src/renderers/overlay/dialog.tsx +1 -0
- package/src/renderers/overlay/drawer.tsx +1 -0
- package/src/renderers/overlay/dropdown-menu.tsx +1 -0
- package/src/renderers/overlay/hover-card.tsx +1 -0
- package/src/renderers/overlay/menubar.tsx +1 -0
- package/src/renderers/overlay/popover.tsx +1 -0
- package/src/renderers/overlay/sheet.tsx +1 -0
- package/src/renderers/overlay/tooltip.tsx +1 -0
- package/src/renderers/placeholders.tsx +2 -2
- package/src/stories/CRMApp.stories.tsx +706 -0
- package/src/stories/Guide.mdx +55 -0
- package/src/stories/Introduction.mdx +34 -0
- package/src/stories/MockedData.stories.tsx +71 -0
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +1 -0
- 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 +1 -0
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +1 -0
- 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 +1 -0
- package/src/stories/assets/youtube.svg +1 -0
- package/src/stories/button.css +30 -0
- package/src/stories/header.css +32 -0
- package/src/stories/page.css +68 -0
- package/src/stories-json/accordion.stories.tsx +43 -0
- package/src/stories-json/aggrid.stories.tsx +103 -0
- package/src/stories-json/alert.stories.tsx +39 -0
- package/src/stories-json/aspect-ratio.stories.tsx +34 -0
- package/src/stories-json/avatar.stories.tsx +38 -0
- package/src/stories-json/badge.stories.tsx +53 -0
- package/src/stories-json/breadcrumb.stories.tsx +30 -0
- package/src/stories-json/button-group.stories.tsx +43 -0
- package/src/stories-json/button.stories.tsx +73 -0
- package/src/stories-json/calendar.stories.tsx +85 -0
- package/src/stories-json/card.stories.tsx +48 -0
- package/src/stories-json/carousel.stories.tsx +33 -0
- package/src/stories-json/charts.stories.tsx +195 -0
- package/src/stories-json/chatbot.stories.tsx +248 -0
- package/src/stories-json/code-editor.stories.tsx +92 -0
- package/src/stories-json/collapsible.stories.tsx +40 -0
- package/src/stories-json/controls.stories.tsx +36 -0
- package/src/stories-json/dashboard.stories.tsx +318 -0
- package/src/stories-json/data-table.stories.tsx +60 -0
- package/src/stories-json/data_display_extras.stories.tsx +102 -0
- package/src/stories-json/date-picker.stories.tsx +28 -0
- package/src/stories-json/detail-view.stories.tsx +258 -0
- package/src/stories-json/dialog.stories.tsx +43 -0
- package/src/stories-json/feedback_extras.stories.tsx +40 -0
- package/src/stories-json/feedback_others.stories.tsx +46 -0
- package/src/stories-json/form_advanced.stories.tsx +117 -0
- package/src/stories-json/form_extras.stories.tsx +123 -0
- package/src/stories-json/grid.stories.tsx +56 -0
- package/src/stories-json/icon.stories.tsx +36 -0
- package/src/stories-json/input.stories.tsx +52 -0
- package/src/stories-json/kanban.stories.tsx +295 -0
- package/src/stories-json/layout_extended.stories.tsx +76 -0
- package/src/stories-json/layout_flex.stories.tsx +107 -0
- package/src/stories-json/list-view.stories.tsx +97 -0
- package/src/stories-json/markdown.stories.tsx +129 -0
- package/src/stories-json/menus.stories.tsx +63 -0
- package/src/stories-json/metric-card.stories.tsx +143 -0
- package/src/stories-json/navigation-menu.stories.tsx +37 -0
- package/src/stories-json/object-aggrid.stories.tsx +252 -0
- package/src/stories-json/object-form.stories.tsx +130 -0
- package/src/stories-json/object-gantt.stories.tsx +114 -0
- package/src/stories-json/object-grid.stories.tsx +157 -0
- package/src/stories-json/object-map.stories.tsx +116 -0
- package/src/stories-json/object-view.stories.tsx +118 -0
- package/src/stories-json/overlay_extras.stories.tsx +113 -0
- package/src/stories-json/overlay_others.stories.tsx +76 -0
- package/src/stories-json/page.stories.tsx +55 -0
- package/src/stories-json/reports.stories.tsx +163 -0
- package/src/stories-json/resizable.stories.tsx +44 -0
- package/src/stories-json/select.stories.tsx +34 -0
- package/src/stories-json/separator.stories.tsx +41 -0
- package/src/stories-json/sidebar.stories.tsx +147 -0
- package/src/stories-json/statistic.stories.tsx +44 -0
- package/src/stories-json/tabs.stories.tsx +51 -0
- package/src/stories-json/timeline.stories.tsx +188 -0
- package/src/stories-json/typography.stories.tsx +45 -0
- package/src/ui/accordion.tsx +47 -53
- package/src/ui/alert-dialog.tsx +103 -117
- package/src/ui/alert.tsx +35 -36
- package/src/ui/aspect-ratio.tsx +1 -5
- package/src/ui/avatar.tsx +41 -42
- package/src/ui/badge.tsx +6 -15
- package/src/ui/breadcrumb.tsx +81 -75
- package/src/ui/button.tsx +10 -11
- package/src/ui/calendar.tsx +178 -51
- package/src/ui/card.tsx +51 -110
- package/src/ui/carousel.tsx +136 -113
- package/src/ui/chart.tsx +367 -0
- package/src/ui/checkbox.tsx +20 -22
- package/src/ui/collapsible.tsx +5 -25
- package/src/ui/command.tsx +106 -135
- package/src/ui/context-menu.tsx +69 -116
- package/src/ui/dialog.tsx +94 -113
- package/src/ui/drawer.tsx +82 -99
- package/src/ui/dropdown-menu.tsx +134 -188
- package/src/ui/form.tsx +51 -40
- package/src/ui/hover-card.tsx +18 -33
- package/src/ui/index.ts +2 -8
- package/src/ui/input-otp.tsx +42 -52
- package/src/ui/input.tsx +13 -15
- package/src/ui/label.tsx +17 -15
- package/src/ui/menubar.tsx +188 -206
- package/src/ui/navigation-menu.tsx +96 -136
- package/src/ui/pagination.tsx +86 -96
- package/src/ui/popover.tsx +24 -41
- package/src/ui/progress.tsx +21 -22
- package/src/ui/radio-group.tsx +19 -20
- package/src/ui/resizable.tsx +32 -42
- package/src/ui/scroll-area.tsx +38 -48
- package/src/ui/select.tsx +129 -157
- package/src/ui/separator.tsx +2 -2
- package/src/ui/sheet.tsx +110 -107
- package/src/ui/sidebar.tsx +442 -408
- package/src/ui/skeleton.tsx +6 -11
- package/src/ui/slider.tsx +19 -54
- package/src/ui/sonner.tsx +19 -1
- package/src/ui/switch.tsx +19 -21
- package/src/ui/tabs.tsx +6 -37
- package/src/ui/textarea.tsx +8 -4
- package/src/ui/toast.tsx +137 -0
- package/src/ui/toggle-group.tsx +28 -37
- package/src/ui/toggle.tsx +19 -19
- package/src/ui/tooltip.tsx +21 -52
- package/src/ui/typography.tsx +85 -0
- package/tsconfig.json +1 -1
- package/vite.config.ts +9 -1
- package/vitest.config.ts +5 -0
- package/ISSUES_FOUND.md +0 -128
- /package/dist/src/{ui → custom}/combobox.d.ts +0 -0
- /package/dist/src/{ui → custom}/date-picker.d.ts +0 -0
- /package/dist/src/{ui → custom}/empty.d.ts +0 -0
- /package/dist/src/{ui → custom}/filter-builder.d.ts +0 -0
- /package/dist/src/{ui → custom}/kbd.d.ts +0 -0
- /package/dist/src/{ui → custom}/spinner.d.ts +0 -0
- /package/src/{ui → custom}/empty.tsx +0 -0
- /package/src/{ui → custom}/kbd.tsx +0 -0
- /package/src/{ui → custom}/spinner.tsx +0 -0
package/src/ui/radio-group.tsx
CHANGED
|
@@ -10,44 +10,43 @@
|
|
|
10
10
|
|
|
11
11
|
import * as React from "react"
|
|
12
12
|
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group"
|
|
13
|
-
import {
|
|
13
|
+
import { Circle } from "lucide-react"
|
|
14
14
|
|
|
15
15
|
import { cn } from "../lib/utils"
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
17
|
+
const RadioGroup = React.forwardRef<
|
|
18
|
+
React.ElementRef<typeof RadioGroupPrimitive.Root>,
|
|
19
|
+
React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>
|
|
20
|
+
>(({ className, ...props }, ref) => {
|
|
21
21
|
return (
|
|
22
22
|
<RadioGroupPrimitive.Root
|
|
23
|
-
|
|
24
|
-
className={cn("grid gap-3", className)}
|
|
23
|
+
className={cn("grid gap-2", className)}
|
|
25
24
|
{...props}
|
|
25
|
+
ref={ref}
|
|
26
26
|
/>
|
|
27
27
|
)
|
|
28
|
-
}
|
|
28
|
+
})
|
|
29
|
+
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
31
|
+
const RadioGroupItem = React.forwardRef<
|
|
32
|
+
React.ElementRef<typeof RadioGroupPrimitive.Item>,
|
|
33
|
+
React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>
|
|
34
|
+
>(({ className, ...props }, ref) => {
|
|
34
35
|
return (
|
|
35
36
|
<RadioGroupPrimitive.Item
|
|
36
|
-
|
|
37
|
+
ref={ref}
|
|
37
38
|
className={cn(
|
|
38
|
-
"
|
|
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",
|
|
39
40
|
className
|
|
40
41
|
)}
|
|
41
42
|
{...props}
|
|
42
43
|
>
|
|
43
|
-
<RadioGroupPrimitive.Indicator
|
|
44
|
-
|
|
45
|
-
className="relative flex items-center justify-center"
|
|
46
|
-
>
|
|
47
|
-
<CircleIcon className="fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2" />
|
|
44
|
+
<RadioGroupPrimitive.Indicator className="flex items-center justify-center">
|
|
45
|
+
<Circle className="h-2.5 w-2.5 fill-current text-current" />
|
|
48
46
|
</RadioGroupPrimitive.Indicator>
|
|
49
47
|
</RadioGroupPrimitive.Item>
|
|
50
48
|
)
|
|
51
|
-
}
|
|
49
|
+
})
|
|
50
|
+
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName
|
|
52
51
|
|
|
53
52
|
export { RadioGroup, RadioGroupItem }
|
package/src/ui/resizable.tsx
CHANGED
|
@@ -6,58 +6,48 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import {
|
|
9
|
+
"use client"
|
|
10
|
+
|
|
11
|
+
import { GripVertical } from "lucide-react"
|
|
12
|
+
import * as ResizablePrimitive from "react-resizable-panels"
|
|
12
13
|
|
|
13
14
|
import { cn } from "../lib/utils"
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
const ResizablePanelGroup = ({
|
|
16
17
|
className,
|
|
17
|
-
direction,
|
|
18
18
|
...props
|
|
19
|
-
}: React.ComponentProps<typeof
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
data-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
{...props}
|
|
29
|
-
/>
|
|
30
|
-
)
|
|
31
|
-
}
|
|
19
|
+
}: React.ComponentProps<typeof ResizablePrimitive.Group>) => (
|
|
20
|
+
<ResizablePrimitive.Group
|
|
21
|
+
className={cn(
|
|
22
|
+
"flex h-full w-full data-[panel-group-direction=vertical]:flex-col",
|
|
23
|
+
className
|
|
24
|
+
)}
|
|
25
|
+
{...props}
|
|
26
|
+
/>
|
|
27
|
+
)
|
|
32
28
|
|
|
33
|
-
|
|
34
|
-
return <Panel data-slot="resizable-panel" {...props} />
|
|
35
|
-
}
|
|
29
|
+
const ResizablePanel = ResizablePrimitive.Panel
|
|
36
30
|
|
|
37
|
-
|
|
31
|
+
const ResizableHandle = ({
|
|
38
32
|
withHandle,
|
|
39
33
|
className,
|
|
40
34
|
...props
|
|
41
|
-
}: React.ComponentProps<typeof
|
|
35
|
+
}: React.ComponentProps<typeof ResizablePrimitive.Separator> & {
|
|
42
36
|
withHandle?: boolean
|
|
43
|
-
})
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
data-
|
|
47
|
-
className
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
)}
|
|
59
|
-
</PanelResizeHandle>
|
|
60
|
-
)
|
|
61
|
-
}
|
|
37
|
+
}) => (
|
|
38
|
+
<ResizablePrimitive.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
|
+
</ResizablePrimitive.Separator>
|
|
51
|
+
)
|
|
62
52
|
|
|
63
53
|
export { ResizablePanelGroup, ResizablePanel, ResizableHandle }
|
package/src/ui/scroll-area.tsx
CHANGED
|
@@ -13,54 +13,44 @@ import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area"
|
|
|
13
13
|
|
|
14
14
|
import { cn } from "../lib/utils"
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
<ScrollBar />
|
|
34
|
-
<ScrollAreaPrimitive.Corner />
|
|
35
|
-
</ScrollAreaPrimitive.Root>
|
|
36
|
-
)
|
|
37
|
-
}
|
|
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
|
|
38
33
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
className="relative flex-1 rounded-full bg-border"
|
|
61
|
-
/>
|
|
62
|
-
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
|
63
|
-
)
|
|
64
|
-
}
|
|
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
|
|
65
55
|
|
|
66
56
|
export { ScrollArea, ScrollBar }
|
package/src/ui/select.tsx
CHANGED
|
@@ -6,191 +6,163 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
"use client"
|
|
10
|
+
|
|
9
11
|
import * as React from "react"
|
|
10
12
|
import * as SelectPrimitive from "@radix-ui/react-select"
|
|
11
|
-
import {
|
|
13
|
+
import { Check, ChevronDown, ChevronUp } from "lucide-react"
|
|
12
14
|
|
|
13
15
|
import { cn } from "../lib/utils"
|
|
14
16
|
|
|
15
|
-
|
|
16
|
-
...props
|
|
17
|
-
}: React.ComponentProps<typeof SelectPrimitive.Root>) {
|
|
18
|
-
return <SelectPrimitive.Root data-slot="select" {...props} />
|
|
19
|
-
}
|
|
17
|
+
const Select = SelectPrimitive.Root
|
|
20
18
|
|
|
21
|
-
|
|
22
|
-
...props
|
|
23
|
-
}: React.ComponentProps<typeof SelectPrimitive.Group>) {
|
|
24
|
-
return <SelectPrimitive.Group data-slot="select-group" {...props} />
|
|
25
|
-
}
|
|
19
|
+
const SelectGroup = SelectPrimitive.Group
|
|
26
20
|
|
|
27
|
-
|
|
28
|
-
...props
|
|
29
|
-
}: React.ComponentProps<typeof SelectPrimitive.Value>) {
|
|
30
|
-
return <SelectPrimitive.Value data-slot="select-value" {...props} />
|
|
31
|
-
}
|
|
21
|
+
const SelectValue = SelectPrimitive.Value
|
|
32
22
|
|
|
33
23
|
const SelectTrigger = React.forwardRef<
|
|
34
24
|
React.ElementRef<typeof SelectPrimitive.Trigger>,
|
|
35
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
|
41
84
|
ref={ref}
|
|
42
|
-
data-slot="select-trigger"
|
|
43
|
-
data-size={size}
|
|
44
85
|
className={cn(
|
|
45
|
-
"
|
|
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",
|
|
46
89
|
className
|
|
47
90
|
)}
|
|
91
|
+
position={position}
|
|
48
92
|
{...props}
|
|
49
93
|
>
|
|
50
|
-
|
|
51
|
-
<SelectPrimitive.
|
|
52
|
-
<ChevronDownIcon className="size-4 opacity-50" />
|
|
53
|
-
</SelectPrimitive.Icon>
|
|
54
|
-
</SelectPrimitive.Trigger>
|
|
55
|
-
)
|
|
56
|
-
})
|
|
57
|
-
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName
|
|
58
|
-
|
|
59
|
-
function SelectContent({
|
|
60
|
-
className,
|
|
61
|
-
children,
|
|
62
|
-
position = "item-aligned",
|
|
63
|
-
align = "center",
|
|
64
|
-
...props
|
|
65
|
-
}: React.ComponentProps<typeof SelectPrimitive.Content>) {
|
|
66
|
-
return (
|
|
67
|
-
<SelectPrimitive.Portal>
|
|
68
|
-
<SelectPrimitive.Content
|
|
69
|
-
data-slot="select-content"
|
|
94
|
+
<SelectScrollUpButton />
|
|
95
|
+
<SelectPrimitive.Viewport
|
|
70
96
|
className={cn(
|
|
71
|
-
"
|
|
97
|
+
"p-1",
|
|
72
98
|
position === "popper" &&
|
|
73
|
-
"
|
|
74
|
-
className
|
|
99
|
+
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
75
100
|
)}
|
|
76
|
-
position={position}
|
|
77
|
-
align={align}
|
|
78
|
-
{...props}
|
|
79
101
|
>
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
>
|
|
88
|
-
{children}
|
|
89
|
-
</SelectPrimitive.Viewport>
|
|
90
|
-
<SelectScrollDownButton />
|
|
91
|
-
</SelectPrimitive.Content>
|
|
92
|
-
</SelectPrimitive.Portal>
|
|
93
|
-
)
|
|
94
|
-
}
|
|
102
|
+
{children}
|
|
103
|
+
</SelectPrimitive.Viewport>
|
|
104
|
+
<SelectScrollDownButton />
|
|
105
|
+
</SelectPrimitive.Content>
|
|
106
|
+
</SelectPrimitive.Portal>
|
|
107
|
+
))
|
|
108
|
+
SelectContent.displayName = SelectPrimitive.Content.displayName
|
|
95
109
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
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
|
|
108
121
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
className
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
>
|
|
127
|
-
<SelectPrimitive.ItemIndicator>
|
|
128
|
-
<CheckIcon className="size-4" />
|
|
129
|
-
</SelectPrimitive.ItemIndicator>
|
|
130
|
-
</span>
|
|
131
|
-
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
132
|
-
</SelectPrimitive.Item>
|
|
133
|
-
)
|
|
134
|
-
}
|
|
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>
|
|
135
139
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
return (
|
|
141
|
-
<SelectPrimitive.Separator
|
|
142
|
-
data-slot="select-separator"
|
|
143
|
-
className={cn("bg-border pointer-events-none -mx-1 my-1 h-px", className)}
|
|
144
|
-
{...props}
|
|
145
|
-
/>
|
|
146
|
-
)
|
|
147
|
-
}
|
|
140
|
+
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
141
|
+
</SelectPrimitive.Item>
|
|
142
|
+
))
|
|
143
|
+
SelectItem.displayName = SelectPrimitive.Item.displayName
|
|
148
144
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
{...props}
|
|
161
|
-
>
|
|
162
|
-
<ChevronUpIcon className="size-4" />
|
|
163
|
-
</SelectPrimitive.ScrollUpButton>
|
|
164
|
-
)
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
function SelectScrollDownButton({
|
|
168
|
-
className,
|
|
169
|
-
...props
|
|
170
|
-
}: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
|
|
171
|
-
return (
|
|
172
|
-
<SelectPrimitive.ScrollDownButton
|
|
173
|
-
data-slot="select-scroll-down-button"
|
|
174
|
-
className={cn(
|
|
175
|
-
"flex cursor-default items-center justify-center py-1",
|
|
176
|
-
className
|
|
177
|
-
)}
|
|
178
|
-
{...props}
|
|
179
|
-
>
|
|
180
|
-
<ChevronDownIcon className="size-4" />
|
|
181
|
-
</SelectPrimitive.ScrollDownButton>
|
|
182
|
-
)
|
|
183
|
-
}
|
|
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
|
|
184
156
|
|
|
185
157
|
export {
|
|
186
158
|
Select,
|
|
187
|
-
SelectContent,
|
|
188
159
|
SelectGroup,
|
|
189
|
-
|
|
160
|
+
SelectValue,
|
|
161
|
+
SelectTrigger,
|
|
162
|
+
SelectContent,
|
|
190
163
|
SelectLabel,
|
|
191
|
-
|
|
192
|
-
SelectScrollUpButton,
|
|
164
|
+
SelectItem,
|
|
193
165
|
SelectSeparator,
|
|
194
|
-
|
|
195
|
-
|
|
166
|
+
SelectScrollUpButton,
|
|
167
|
+
SelectScrollDownButton,
|
|
196
168
|
}
|
package/src/ui/separator.tsx
CHANGED
|
@@ -23,11 +23,11 @@ const Separator = React.forwardRef<
|
|
|
23
23
|
) => (
|
|
24
24
|
<SeparatorPrimitive.Root
|
|
25
25
|
ref={ref}
|
|
26
|
-
data-slot="separator"
|
|
27
26
|
decorative={decorative}
|
|
28
27
|
orientation={orientation}
|
|
29
28
|
className={cn(
|
|
30
|
-
"
|
|
29
|
+
"shrink-0 bg-border",
|
|
30
|
+
orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
|
|
31
31
|
className
|
|
32
32
|
)}
|
|
33
33
|
{...props}
|