@object-ui/components 0.3.0 → 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/CHANGELOG.md +10 -0
- package/README.md +32 -1
- package/README_SHADCN_SYNC.md +281 -0
- package/TESTING.md +335 -0
- package/dist/index.css +1 -1
- package/dist/index.js +45067 -34357
- package/dist/index.umd.cjs +54 -42
- package/dist/src/SchemaRenderer.d.ts +3 -0
- package/dist/src/{ui → custom}/button-group.d.ts +1 -1
- package/dist/src/custom/combobox.d.ts +22 -0
- package/dist/src/custom/date-picker.d.ts +15 -0
- package/dist/src/custom/field.d.ts +19 -0
- package/dist/src/{ui → custom}/filter-builder.d.ts +7 -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 +8 -1
- package/dist/src/{ui → custom}/kbd.d.ts +7 -0
- package/dist/src/custom/native-select.d.ts +12 -0
- package/dist/src/custom/sort-builder.d.ts +22 -0
- package/dist/src/custom/spinner.d.ts +10 -0
- package/dist/src/hooks/use-mobile.d.ts +7 -0
- package/dist/src/index.d.ts +5 -1
- package/dist/src/renderers/basic/button-group.d.ts +8 -0
- package/dist/src/renderers/basic/div.d.ts +7 -0
- package/dist/src/renderers/basic/html.d.ts +7 -0
- package/dist/src/renderers/basic/icon.d.ts +7 -0
- package/dist/src/renderers/basic/image.d.ts +7 -0
- package/dist/src/renderers/basic/navigation-menu.d.ts +8 -0
- package/dist/src/renderers/basic/pagination.d.ts +8 -0
- package/dist/src/renderers/basic/separator.d.ts +7 -0
- package/dist/src/renderers/basic/span.d.ts +7 -0
- package/dist/src/renderers/basic/text.d.ts +7 -0
- package/dist/src/renderers/complex/carousel.d.ts +7 -0
- package/dist/src/renderers/complex/data-table.d.ts +7 -0
- package/dist/src/renderers/complex/filter-builder.d.ts +7 -0
- package/dist/src/renderers/complex/resizable.d.ts +7 -0
- package/dist/src/renderers/complex/scroll-area.d.ts +7 -0
- package/dist/src/renderers/complex/table.d.ts +7 -0
- package/dist/src/renderers/data-display/alert.d.ts +7 -0
- package/dist/src/renderers/data-display/avatar.d.ts +7 -0
- package/dist/src/renderers/data-display/badge.d.ts +7 -0
- package/dist/src/renderers/data-display/breadcrumb.d.ts +8 -0
- package/dist/src/renderers/data-display/kbd.d.ts +8 -0
- package/dist/src/renderers/data-display/list.d.ts +7 -0
- package/dist/src/renderers/data-display/statistic.d.ts +7 -0
- package/dist/src/renderers/data-display/table.d.ts +8 -0
- package/dist/src/renderers/data-display/tree-view.d.ts +7 -0
- package/dist/src/renderers/disclosure/accordion.d.ts +7 -0
- package/dist/src/renderers/disclosure/collapsible.d.ts +7 -0
- package/dist/src/renderers/disclosure/toggle-group.d.ts +8 -0
- package/dist/src/renderers/feedback/empty.d.ts +8 -0
- package/dist/src/renderers/feedback/loading.d.ts +7 -0
- package/dist/src/renderers/feedback/progress.d.ts +7 -0
- package/dist/src/renderers/feedback/skeleton.d.ts +7 -0
- package/dist/src/renderers/feedback/sonner.d.ts +8 -0
- package/dist/src/renderers/feedback/spinner.d.ts +8 -0
- package/dist/src/renderers/feedback/toast.d.ts +8 -0
- package/dist/src/renderers/feedback/toaster.d.ts +7 -0
- package/dist/src/renderers/form/button.d.ts +7 -0
- package/dist/src/renderers/form/calendar.d.ts +7 -0
- package/dist/src/renderers/form/checkbox.d.ts +7 -0
- package/dist/src/renderers/form/combobox.d.ts +8 -0
- package/dist/src/renderers/form/command.d.ts +8 -0
- package/dist/src/renderers/form/date-picker.d.ts +7 -0
- package/dist/src/renderers/form/file-upload.d.ts +7 -0
- package/dist/src/renderers/form/form.d.ts +7 -0
- package/dist/src/renderers/form/input-otp.d.ts +7 -0
- package/dist/src/renderers/form/input.d.ts +7 -0
- package/dist/src/renderers/form/label.d.ts +7 -0
- package/dist/src/renderers/form/radio-group.d.ts +7 -0
- package/dist/src/renderers/form/select.d.ts +7 -0
- package/dist/src/renderers/form/slider.d.ts +7 -0
- package/dist/src/renderers/form/switch.d.ts +7 -0
- package/dist/src/renderers/form/textarea.d.ts +7 -0
- package/dist/src/renderers/form/toggle.d.ts +7 -0
- package/dist/src/renderers/layout/aspect-ratio.d.ts +8 -0
- package/dist/src/renderers/layout/card.d.ts +7 -0
- package/dist/src/renderers/layout/container.d.ts +7 -0
- package/dist/src/renderers/layout/flex.d.ts +7 -0
- package/dist/src/renderers/layout/grid.d.ts +7 -0
- package/dist/src/renderers/layout/page.d.ts +1 -1
- package/dist/src/renderers/layout/semantic.d.ts +7 -0
- package/dist/src/renderers/layout/stack.d.ts +7 -0
- package/dist/src/renderers/layout/tabs.d.ts +7 -0
- package/dist/src/renderers/navigation/header-bar.d.ts +7 -0
- package/dist/src/renderers/navigation/sidebar.d.ts +7 -0
- package/dist/src/renderers/overlay/alert-dialog.d.ts +7 -0
- package/dist/src/renderers/overlay/context-menu.d.ts +7 -0
- package/dist/src/renderers/overlay/dialog.d.ts +7 -0
- package/dist/src/renderers/overlay/drawer.d.ts +7 -0
- package/dist/src/renderers/overlay/dropdown-menu.d.ts +7 -0
- package/dist/src/renderers/overlay/hover-card.d.ts +7 -0
- package/dist/src/renderers/overlay/menubar.d.ts +8 -0
- package/dist/src/renderers/overlay/popover.d.ts +7 -0
- package/dist/src/renderers/overlay/sheet.d.ts +7 -0
- package/dist/src/renderers/overlay/tooltip.d.ts +7 -0
- package/dist/src/renderers/placeholders.d.ts +9 -0
- package/dist/src/ui/accordion.d.ts +11 -4
- package/dist/src/ui/alert-dialog.d.ts +24 -11
- package/dist/src/ui/alert.d.ts +11 -5
- package/dist/src/ui/aspect-ratio.d.ts +8 -1
- package/dist/src/ui/avatar.d.ts +10 -3
- package/dist/src/ui/badge.d.ts +10 -3
- package/dist/src/ui/breadcrumb.d.ts +23 -8
- package/dist/src/ui/button.d.ts +10 -5
- package/dist/src/ui/calendar.d.ts +8 -1
- package/dist/src/ui/card.d.ts +14 -8
- package/dist/src/ui/carousel.d.ts +12 -6
- package/dist/src/ui/chart.d.ts +62 -0
- package/dist/src/ui/checkbox.d.ts +8 -1
- package/dist/src/ui/collapsible.d.ts +10 -3
- package/dist/src/ui/command.d.ts +85 -16
- package/dist/src/ui/context-menu.d.ts +21 -12
- package/dist/src/ui/dialog.d.ts +24 -13
- package/dist/src/ui/drawer.d.ts +26 -10
- package/dist/src/ui/dropdown-menu.d.ts +27 -18
- package/dist/src/ui/form.d.ts +13 -7
- package/dist/src/ui/hover-card.d.ts +10 -3
- package/dist/src/ui/index.d.ts +10 -11
- package/dist/src/ui/input-otp.d.ts +37 -7
- package/dist/src/ui/input.d.ts +7 -0
- package/dist/src/ui/label.d.ts +9 -1
- package/dist/src/ui/menubar.d.ts +26 -17
- package/dist/src/ui/navigation-menu.d.ts +16 -11
- package/dist/src/ui/pagination.d.ts +32 -10
- package/dist/src/ui/popover.d.ts +11 -5
- package/dist/src/ui/progress.d.ts +8 -1
- package/dist/src/ui/radio-group.d.ts +9 -2
- package/dist/src/ui/resizable.d.ts +12 -8
- package/dist/src/ui/scroll-area.d.ts +9 -2
- package/dist/src/ui/select.d.ts +18 -13
- package/dist/src/ui/separator.d.ts +7 -0
- package/dist/src/ui/sheet.d.ts +30 -11
- package/dist/src/ui/sidebar.d.ts +41 -38
- package/dist/src/ui/skeleton.d.ts +8 -1
- package/dist/src/ui/slider.d.ts +8 -1
- package/dist/src/ui/sonner.d.ts +2 -1
- package/dist/src/ui/switch.d.ts +9 -2
- package/dist/src/ui/table.d.ts +15 -8
- package/dist/src/ui/tabs.d.ts +8 -1
- package/dist/src/ui/textarea.d.ts +8 -1
- package/dist/src/ui/toast.d.ts +22 -0
- package/dist/src/ui/toggle-group.d.ts +15 -5
- package/dist/src/ui/toggle.d.ts +11 -1
- package/dist/src/ui/tooltip.d.ts +11 -4
- package/dist/src/ui/typography.d.ts +21 -0
- package/metadata/ObjectGrid.component.yml +72 -0
- package/package.json +35 -13
- package/postcss.config.js +9 -1
- package/shadcn-components.json +315 -0
- package/src/SchemaRenderer.tsx +28 -0
- package/src/__tests__/PageRendererRegions.test.tsx +59 -0
- package/src/__tests__/README.md +124 -0
- package/src/__tests__/Registry.test.ts +21 -0
- package/src/__tests__/basic-renderers.test.tsx +255 -0
- package/src/__tests__/complex-disclosure-renderers.test.tsx +302 -0
- package/src/__tests__/feedback-overlay-renderers.test.tsx +349 -0
- package/src/__tests__/form-renderers.test.tsx +364 -0
- package/src/__tests__/layout-data-renderers.test.tsx +340 -0
- package/src/__tests__/test-utils.tsx +190 -0
- package/src/{ui → custom}/button-group.tsx +9 -1
- package/src/custom/combobox.tsx +104 -0
- package/src/custom/date-picker.tsx +61 -0
- package/src/{ui → custom}/empty.tsx +8 -0
- package/src/custom/field.tsx +81 -0
- package/src/{ui → custom}/filter-builder.tsx +11 -3
- package/src/custom/index.ts +12 -0
- package/src/custom/input-group.tsx +53 -0
- package/src/{ui → custom}/item.tsx +9 -1
- package/src/{ui → custom}/kbd.tsx +8 -0
- package/src/custom/native-select.tsx +33 -0
- package/src/custom/sort-builder.tsx +129 -0
- package/src/custom/spinner.tsx +26 -0
- package/src/hooks/use-mobile.tsx +8 -0
- package/src/index.css +105 -54
- package/src/index.test.ts +8 -0
- package/src/index.ts +22 -1
- package/src/lib/utils.tsx +8 -0
- package/src/new-components.test.ts +8 -9
- package/src/renderers/basic/button-group.tsx +79 -0
- package/src/renderers/basic/div.tsx +21 -2
- package/src/renderers/basic/html.tsx +9 -0
- package/src/renderers/basic/icon.tsx +67 -3
- package/src/renderers/basic/image.tsx +13 -1
- package/src/renderers/basic/index.ts +11 -0
- package/src/renderers/basic/navigation-menu.tsx +81 -0
- package/src/renderers/basic/pagination.tsx +109 -0
- package/src/renderers/basic/separator.tsx +10 -1
- package/src/renderers/basic/span.tsx +21 -2
- package/src/renderers/basic/text.tsx +12 -2
- package/src/renderers/complex/__tests__/data-table.test.ts +8 -0
- package/src/renderers/complex/carousel.tsx +12 -3
- package/src/renderers/complex/data-table.tsx +150 -96
- package/src/renderers/complex/filter-builder.tsx +10 -1
- package/src/renderers/complex/index.ts +9 -3
- package/src/renderers/complex/resizable.tsx +10 -1
- package/src/renderers/complex/scroll-area.tsx +33 -7
- package/src/renderers/complex/table.tsx +11 -2
- package/src/renderers/data-display/alert.tsx +9 -0
- package/src/renderers/data-display/avatar.tsx +9 -0
- package/src/renderers/data-display/badge.tsx +9 -0
- package/src/renderers/data-display/breadcrumb.tsx +60 -0
- package/src/renderers/data-display/index.ts +12 -0
- package/src/renderers/data-display/kbd.tsx +50 -0
- package/src/renderers/data-display/list.tsx +29 -49
- package/src/renderers/data-display/statistic.tsx +45 -48
- package/src/renderers/data-display/table.tsx +78 -0
- package/src/renderers/data-display/tree-view.tsx +32 -37
- package/src/renderers/disclosure/accordion.tsx +9 -0
- package/src/renderers/disclosure/collapsible.tsx +9 -0
- package/src/renderers/disclosure/index.ts +9 -0
- package/src/renderers/disclosure/toggle-group.tsx +79 -0
- package/src/renderers/feedback/empty.tsx +49 -0
- package/src/renderers/feedback/index.ts +12 -0
- package/src/renderers/feedback/loading.tsx +10 -1
- package/src/renderers/feedback/progress.tsx +9 -0
- package/src/renderers/feedback/skeleton.tsx +9 -0
- package/src/renderers/feedback/sonner.tsx +56 -0
- package/src/renderers/feedback/spinner.tsx +55 -0
- package/src/renderers/feedback/toast.tsx +59 -0
- package/src/renderers/feedback/toaster.tsx +14 -17
- package/src/renderers/form/button.tsx +43 -1
- package/src/renderers/form/calendar.tsx +9 -0
- package/src/renderers/form/checkbox.tsx +46 -16
- package/src/renderers/form/combobox.tsx +48 -0
- package/src/renderers/form/command.tsx +58 -0
- package/src/renderers/form/date-picker.tsx +11 -2
- package/src/renderers/form/file-upload.tsx +11 -2
- package/src/renderers/form/form.tsx +104 -18
- package/src/renderers/form/index.ts +10 -0
- package/src/renderers/form/input-otp.tsx +35 -15
- package/src/renderers/form/input.tsx +92 -50
- package/src/renderers/form/label.tsx +9 -0
- package/src/renderers/form/radio-group.tsx +9 -0
- package/src/renderers/form/select.tsx +43 -15
- package/src/renderers/form/slider.tsx +17 -1
- package/src/renderers/form/switch.tsx +9 -0
- package/src/renderers/form/textarea.tsx +58 -27
- package/src/renderers/form/toggle.tsx +11 -45
- package/src/renderers/index.ts +8 -0
- package/src/renderers/layout/aspect-ratio.tsx +51 -0
- package/src/renderers/layout/card.tsx +18 -2
- package/src/renderers/layout/container.tsx +21 -12
- package/src/renderers/layout/flex.tsx +17 -8
- package/src/renderers/layout/grid.tsx +31 -8
- package/src/renderers/layout/index.ts +9 -0
- package/src/renderers/layout/page.tsx +44 -24
- package/src/renderers/layout/semantic.tsx +9 -0
- package/src/renderers/layout/stack.tsx +18 -9
- package/src/renderers/layout/tabs.tsx +51 -17
- package/src/renderers/navigation/header-bar.tsx +10 -1
- package/src/renderers/navigation/index.ts +8 -0
- package/src/renderers/navigation/sidebar.tsx +13 -0
- package/src/renderers/overlay/alert-dialog.tsx +9 -0
- package/src/renderers/overlay/context-menu.tsx +10 -1
- package/src/renderers/overlay/dialog.tsx +9 -0
- package/src/renderers/overlay/drawer.tsx +9 -0
- package/src/renderers/overlay/dropdown-menu.tsx +9 -0
- package/src/renderers/overlay/hover-card.tsx +9 -0
- package/src/renderers/overlay/index.ts +9 -0
- package/src/renderers/overlay/menubar.tsx +76 -0
- package/src/renderers/overlay/popover.tsx +9 -0
- package/src/renderers/overlay/sheet.tsx +9 -0
- package/src/renderers/overlay/tooltip.tsx +9 -0
- package/src/renderers/placeholders.tsx +107 -0
- 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 +55 -53
- package/src/ui/alert-dialog.tsx +111 -117
- package/src/ui/alert.tsx +46 -57
- package/src/ui/aspect-ratio.tsx +9 -5
- package/src/ui/avatar.tsx +49 -42
- package/src/ui/badge.tsx +18 -20
- package/src/ui/breadcrumb.tsx +89 -75
- package/src/ui/button.tsx +38 -37
- package/src/ui/calendar.tsx +37 -53
- package/src/ui/card.tsx +59 -110
- package/src/ui/carousel.tsx +144 -113
- package/src/ui/chart.tsx +367 -0
- package/src/ui/checkbox.tsx +28 -22
- package/src/ui/collapsible.tsx +13 -25
- package/src/ui/command.tsx +114 -135
- package/src/ui/context-menu.tsx +77 -116
- package/src/ui/dialog.tsx +102 -113
- package/src/ui/drawer.tsx +90 -99
- package/src/ui/dropdown-menu.tsx +142 -188
- package/src/ui/form.tsx +59 -40
- package/src/ui/hover-card.tsx +26 -33
- package/src/ui/index.ts +11 -11
- package/src/ui/input-otp.tsx +53 -55
- package/src/ui/input.tsx +21 -15
- package/src/ui/label.tsx +25 -15
- package/src/ui/menubar.tsx +196 -206
- package/src/ui/navigation-menu.tsx +104 -136
- package/src/ui/pagination.tsx +94 -96
- package/src/ui/popover.tsx +29 -38
- package/src/ui/progress.tsx +29 -34
- package/src/ui/radio-group.tsx +27 -20
- package/src/ui/resizable.tsx +40 -42
- package/src/ui/scroll-area.tsx +46 -48
- package/src/ui/select.tsx +140 -160
- package/src/ui/separator.tsx +10 -2
- package/src/ui/sheet.tsx +118 -107
- package/src/ui/sidebar.tsx +471 -418
- package/src/ui/skeleton.tsx +14 -11
- package/src/ui/slider.tsx +27 -54
- package/src/ui/sonner.tsx +29 -19
- package/src/ui/switch.tsx +27 -21
- package/src/ui/table.tsx +102 -97
- package/src/ui/tabs.tsx +14 -37
- package/src/ui/textarea.tsx +16 -4
- package/src/ui/toast.tsx +137 -0
- package/src/ui/toggle-group.tsx +37 -55
- package/src/ui/toggle.tsx +30 -27
- package/src/ui/tooltip.tsx +29 -52
- package/src/ui/typography.tsx +85 -0
- package/tsconfig.json +2 -1
- package/vite.config.ts +20 -2
- package/vitest.config.ts +5 -0
- package/dist/src/index.test.d.ts +0 -1
- package/dist/src/new-components.test.d.ts +0 -1
- package/dist/src/renderers/complex/__tests__/data-table.test.d.ts +0 -0
- package/dist/src/renderers/complex/calendar-view.d.ts +0 -1
- package/dist/src/renderers/complex/chatbot.d.ts +0 -1
- package/dist/src/renderers/complex/chatbot.test.d.ts +0 -1
- package/dist/src/renderers/complex/timeline.d.ts +0 -1
- package/dist/src/ui/calendar-view.d.ts +0 -21
- package/dist/src/ui/chatbot.d.ts +0 -36
- package/dist/src/ui/field.d.ts +0 -24
- package/dist/src/ui/input-group.d.ts +0 -16
- package/dist/src/ui/spinner.d.ts +0 -3
- package/dist/src/ui/timeline.d.ts +0 -25
- package/metadata/ObjectTable.component.yml +0 -41
- package/src/renderers/complex/calendar-view.tsx +0 -219
- package/src/renderers/complex/chatbot.test.ts +0 -44
- package/src/renderers/complex/chatbot.tsx +0 -185
- package/src/renderers/complex/timeline.tsx +0 -466
- package/src/ui/calendar-view.tsx +0 -503
- package/src/ui/chatbot.tsx +0 -240
- package/src/ui/field.tsx +0 -246
- package/src/ui/input-group.tsx +0 -170
- package/src/ui/spinner.tsx +0 -38
- package/src/ui/timeline.tsx +0 -266
- package/tailwind.config.js +0 -75
- /package/dist/src/{ui → custom}/empty.d.ts +0 -0
package/src/ui/alert-dialog.tsx
CHANGED
|
@@ -1,144 +1,138 @@
|
|
|
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
|
+
|
|
1
11
|
import * as React from "react"
|
|
2
12
|
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog"
|
|
3
13
|
|
|
4
14
|
import { cn } from "../lib/utils"
|
|
5
15
|
import { buttonVariants } from "./button"
|
|
6
16
|
|
|
7
|
-
|
|
8
|
-
...props
|
|
9
|
-
}: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {
|
|
10
|
-
return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />
|
|
11
|
-
}
|
|
17
|
+
const AlertDialog = AlertDialogPrimitive.Root
|
|
12
18
|
|
|
13
|
-
|
|
14
|
-
...props
|
|
15
|
-
}: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>) {
|
|
16
|
-
return (
|
|
17
|
-
<AlertDialogPrimitive.Trigger data-slot="alert-dialog-trigger" {...props} />
|
|
18
|
-
)
|
|
19
|
-
}
|
|
19
|
+
const AlertDialogTrigger = AlertDialogPrimitive.Trigger
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
...props
|
|
23
|
-
}: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {
|
|
24
|
-
return (
|
|
25
|
-
<AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" {...props} />
|
|
26
|
-
)
|
|
27
|
-
}
|
|
21
|
+
const AlertDialogPortal = AlertDialogPrimitive.Portal
|
|
28
22
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
data-
|
|
23
|
+
const AlertDialogOverlay = React.forwardRef<
|
|
24
|
+
React.ElementRef<typeof AlertDialogPrimitive.Overlay>,
|
|
25
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>
|
|
26
|
+
>(({ className, ...props }, ref) => (
|
|
27
|
+
<AlertDialogPrimitive.Overlay
|
|
28
|
+
className={cn(
|
|
29
|
+
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
30
|
+
className
|
|
31
|
+
)}
|
|
32
|
+
{...props}
|
|
33
|
+
ref={ref}
|
|
34
|
+
/>
|
|
35
|
+
))
|
|
36
|
+
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName
|
|
37
|
+
|
|
38
|
+
const AlertDialogContent = React.forwardRef<
|
|
39
|
+
React.ElementRef<typeof AlertDialogPrimitive.Content>,
|
|
40
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>
|
|
41
|
+
>(({ className, ...props }, ref) => (
|
|
42
|
+
<AlertDialogPortal>
|
|
43
|
+
<AlertDialogOverlay />
|
|
44
|
+
<AlertDialogPrimitive.Content
|
|
45
|
+
ref={ref}
|
|
36
46
|
className={cn(
|
|
37
|
-
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0
|
|
47
|
+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
38
48
|
className
|
|
39
49
|
)}
|
|
40
50
|
{...props}
|
|
41
51
|
/>
|
|
42
|
-
|
|
43
|
-
|
|
52
|
+
</AlertDialogPortal>
|
|
53
|
+
))
|
|
54
|
+
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName
|
|
44
55
|
|
|
45
|
-
|
|
56
|
+
const AlertDialogHeader = ({
|
|
46
57
|
className,
|
|
47
58
|
...props
|
|
48
|
-
}: React.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
{...props}
|
|
59
|
-
/>
|
|
60
|
-
</AlertDialogPortal>
|
|
61
|
-
)
|
|
62
|
-
}
|
|
59
|
+
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
60
|
+
<div
|
|
61
|
+
className={cn(
|
|
62
|
+
"flex flex-col space-y-2 text-center sm:text-left",
|
|
63
|
+
className
|
|
64
|
+
)}
|
|
65
|
+
{...props}
|
|
66
|
+
/>
|
|
67
|
+
)
|
|
68
|
+
AlertDialogHeader.displayName = "AlertDialogHeader"
|
|
63
69
|
|
|
64
|
-
|
|
70
|
+
const AlertDialogFooter = ({
|
|
65
71
|
className,
|
|
66
72
|
...props
|
|
67
|
-
}: React.
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
className
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
74
|
+
<div
|
|
75
|
+
className={cn(
|
|
76
|
+
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
77
|
+
className
|
|
78
|
+
)}
|
|
79
|
+
{...props}
|
|
80
|
+
/>
|
|
81
|
+
)
|
|
82
|
+
AlertDialogFooter.displayName = "AlertDialogFooter"
|
|
76
83
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
{...props}
|
|
89
|
-
/>
|
|
90
|
-
)
|
|
91
|
-
}
|
|
84
|
+
const AlertDialogTitle = React.forwardRef<
|
|
85
|
+
React.ElementRef<typeof AlertDialogPrimitive.Title>,
|
|
86
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>
|
|
87
|
+
>(({ className, ...props }, ref) => (
|
|
88
|
+
<AlertDialogPrimitive.Title
|
|
89
|
+
ref={ref}
|
|
90
|
+
className={cn("text-lg font-semibold", className)}
|
|
91
|
+
{...props}
|
|
92
|
+
/>
|
|
93
|
+
))
|
|
94
|
+
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName
|
|
92
95
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
function AlertDialogDescription({
|
|
107
|
-
className,
|
|
108
|
-
...props
|
|
109
|
-
}: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {
|
|
110
|
-
return (
|
|
111
|
-
<AlertDialogPrimitive.Description
|
|
112
|
-
data-slot="alert-dialog-description"
|
|
113
|
-
className={cn("text-muted-foreground text-sm", className)}
|
|
114
|
-
{...props}
|
|
115
|
-
/>
|
|
116
|
-
)
|
|
117
|
-
}
|
|
96
|
+
const AlertDialogDescription = React.forwardRef<
|
|
97
|
+
React.ElementRef<typeof AlertDialogPrimitive.Description>,
|
|
98
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>
|
|
99
|
+
>(({ className, ...props }, ref) => (
|
|
100
|
+
<AlertDialogPrimitive.Description
|
|
101
|
+
ref={ref}
|
|
102
|
+
className={cn("text-sm text-muted-foreground", className)}
|
|
103
|
+
{...props}
|
|
104
|
+
/>
|
|
105
|
+
))
|
|
106
|
+
AlertDialogDescription.displayName =
|
|
107
|
+
AlertDialogPrimitive.Description.displayName
|
|
118
108
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
109
|
+
const AlertDialogAction = React.forwardRef<
|
|
110
|
+
React.ElementRef<typeof AlertDialogPrimitive.Action>,
|
|
111
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>
|
|
112
|
+
>(({ className, ...props }, ref) => (
|
|
113
|
+
<AlertDialogPrimitive.Action
|
|
114
|
+
ref={ref}
|
|
115
|
+
className={cn(buttonVariants(), className)}
|
|
116
|
+
{...props}
|
|
117
|
+
/>
|
|
118
|
+
))
|
|
119
|
+
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName
|
|
130
120
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
{
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
121
|
+
const AlertDialogCancel = React.forwardRef<
|
|
122
|
+
React.ElementRef<typeof AlertDialogPrimitive.Cancel>,
|
|
123
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>
|
|
124
|
+
>(({ className, ...props }, ref) => (
|
|
125
|
+
<AlertDialogPrimitive.Cancel
|
|
126
|
+
ref={ref}
|
|
127
|
+
className={cn(
|
|
128
|
+
buttonVariants({ variant: "outline" }),
|
|
129
|
+
"mt-2 sm:mt-0",
|
|
130
|
+
className
|
|
131
|
+
)}
|
|
132
|
+
{...props}
|
|
133
|
+
/>
|
|
134
|
+
))
|
|
135
|
+
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName
|
|
142
136
|
|
|
143
137
|
export {
|
|
144
138
|
AlertDialog,
|
package/src/ui/alert.tsx
CHANGED
|
@@ -1,27 +1,24 @@
|
|
|
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
|
+
|
|
1
9
|
import * as React from "react"
|
|
2
10
|
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
11
|
|
|
4
12
|
import { cn } from "../lib/utils"
|
|
5
13
|
|
|
6
14
|
const alertVariants = cva(
|
|
7
|
-
"relative w-full rounded-
|
|
15
|
+
"relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
|
|
8
16
|
{
|
|
9
17
|
variants: {
|
|
10
18
|
variant: {
|
|
11
|
-
default:
|
|
12
|
-
|
|
13
|
-
"
|
|
14
|
-
"[&>svg]:text-cyan-400 [&>svg]:drop-shadow-[0_0_8px_rgba(6,182,212,0.6)]",
|
|
15
|
-
"hover:shadow-[0_0_30px_-5px_rgba(6,182,212,0.4)] hover:bg-slate-900/90",
|
|
16
|
-
"after:absolute after:inset-0 after:bg-linear-to-r after:from-cyan-500/10 after:to-transparent after:opacity-0 after:transition-opacity hover:after:opacity-100 after:pointer-events-none"
|
|
17
|
-
],
|
|
18
|
-
destructive: [
|
|
19
|
-
"bg-red-950/80 border-l-red-600 border-y border-r border-y-red-900/30 border-r-red-900/30 text-red-100",
|
|
20
|
-
"shadow-[0_0_20px_-5px_rgba(239,68,68,0.2)]",
|
|
21
|
-
"[&>svg]:text-red-500 [&>svg]:drop-shadow-[0_0_8px_rgba(239,68,68,0.6)]",
|
|
22
|
-
"hover:shadow-[0_0_30px_-5px_rgba(239,68,68,0.4)] hover:bg-red-950/90",
|
|
23
|
-
"after:absolute after:inset-0 after:bg-linear-to-r after:from-red-500/10 after:to-transparent after:opacity-0 after:transition-opacity hover:after:opacity-100 after:pointer-events-none"
|
|
24
|
-
],
|
|
19
|
+
default: "bg-background text-foreground",
|
|
20
|
+
destructive:
|
|
21
|
+
"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",
|
|
25
22
|
},
|
|
26
23
|
},
|
|
27
24
|
defaultVariants: {
|
|
@@ -30,49 +27,41 @@ const alertVariants = cva(
|
|
|
30
27
|
}
|
|
31
28
|
)
|
|
32
29
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
)
|
|
46
|
-
}
|
|
30
|
+
const Alert = React.forwardRef<
|
|
31
|
+
HTMLDivElement,
|
|
32
|
+
React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>
|
|
33
|
+
>(({ className, variant, ...props }, ref) => (
|
|
34
|
+
<div
|
|
35
|
+
ref={ref}
|
|
36
|
+
role="alert"
|
|
37
|
+
className={cn(alertVariants({ variant }), className)}
|
|
38
|
+
{...props}
|
|
39
|
+
/>
|
|
40
|
+
))
|
|
41
|
+
Alert.displayName = "Alert"
|
|
47
42
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
)
|
|
60
|
-
}
|
|
43
|
+
const AlertTitle = React.forwardRef<
|
|
44
|
+
HTMLParagraphElement,
|
|
45
|
+
React.HTMLAttributes<HTMLHeadingElement>
|
|
46
|
+
>(({ className, ...props }, ref) => (
|
|
47
|
+
<h5
|
|
48
|
+
ref={ref}
|
|
49
|
+
className={cn("mb-1 font-medium leading-none tracking-tight", className)}
|
|
50
|
+
{...props}
|
|
51
|
+
/>
|
|
52
|
+
))
|
|
53
|
+
AlertTitle.displayName = "AlertTitle"
|
|
61
54
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
{...props}
|
|
74
|
-
/>
|
|
75
|
-
)
|
|
76
|
-
}
|
|
55
|
+
const AlertDescription = React.forwardRef<
|
|
56
|
+
HTMLParagraphElement,
|
|
57
|
+
React.HTMLAttributes<HTMLParagraphElement>
|
|
58
|
+
>(({ className, ...props }, ref) => (
|
|
59
|
+
<div
|
|
60
|
+
ref={ref}
|
|
61
|
+
className={cn("text-sm [&_p]:leading-relaxed", className)}
|
|
62
|
+
{...props}
|
|
63
|
+
/>
|
|
64
|
+
))
|
|
65
|
+
AlertDescription.displayName = "AlertDescription"
|
|
77
66
|
|
|
78
67
|
export { Alert, AlertTitle, AlertDescription }
|
package/src/ui/aspect-ratio.tsx
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
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
|
+
|
|
1
9
|
"use client"
|
|
2
10
|
|
|
3
11
|
import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio"
|
|
4
12
|
|
|
5
|
-
|
|
6
|
-
...props
|
|
7
|
-
}: React.ComponentProps<typeof AspectRatioPrimitive.Root>) {
|
|
8
|
-
return <AspectRatioPrimitive.Root data-slot="aspect-ratio" {...props} />
|
|
9
|
-
}
|
|
13
|
+
const AspectRatio = AspectRatioPrimitive.Root
|
|
10
14
|
|
|
11
15
|
export { AspectRatio }
|
package/src/ui/avatar.tsx
CHANGED
|
@@ -1,51 +1,58 @@
|
|
|
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
|
+
|
|
1
11
|
import * as React from "react"
|
|
2
12
|
import * as AvatarPrimitive from "@radix-ui/react-avatar"
|
|
3
13
|
|
|
4
14
|
import { cn } from "../lib/utils"
|
|
5
15
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
16
|
+
const Avatar = React.forwardRef<
|
|
17
|
+
React.ElementRef<typeof AvatarPrimitive.Root>,
|
|
18
|
+
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>
|
|
19
|
+
>(({ className, ...props }, ref) => (
|
|
20
|
+
<AvatarPrimitive.Root
|
|
21
|
+
ref={ref}
|
|
22
|
+
className={cn(
|
|
23
|
+
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
|
|
24
|
+
className
|
|
25
|
+
)}
|
|
26
|
+
{...props}
|
|
27
|
+
/>
|
|
28
|
+
))
|
|
29
|
+
Avatar.displayName = AvatarPrimitive.Root.displayName
|
|
21
30
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
31
|
+
const AvatarImage = React.forwardRef<
|
|
32
|
+
React.ElementRef<typeof AvatarPrimitive.Image>,
|
|
33
|
+
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>
|
|
34
|
+
>(({ className, ...props }, ref) => (
|
|
35
|
+
<AvatarPrimitive.Image
|
|
36
|
+
ref={ref}
|
|
37
|
+
className={cn("aspect-square h-full w-full", className)}
|
|
38
|
+
{...props}
|
|
39
|
+
/>
|
|
40
|
+
))
|
|
41
|
+
AvatarImage.displayName = AvatarPrimitive.Image.displayName
|
|
34
42
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
43
|
+
const AvatarFallback = React.forwardRef<
|
|
44
|
+
React.ElementRef<typeof AvatarPrimitive.Fallback>,
|
|
45
|
+
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>
|
|
46
|
+
>(({ className, ...props }, ref) => (
|
|
47
|
+
<AvatarPrimitive.Fallback
|
|
48
|
+
ref={ref}
|
|
49
|
+
className={cn(
|
|
50
|
+
"flex h-full w-full items-center justify-center rounded-full bg-muted",
|
|
51
|
+
className
|
|
52
|
+
)}
|
|
53
|
+
{...props}
|
|
54
|
+
/>
|
|
55
|
+
))
|
|
56
|
+
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName
|
|
50
57
|
|
|
51
58
|
export { Avatar, AvatarImage, AvatarFallback }
|
package/src/ui/badge.tsx
CHANGED
|
@@ -1,22 +1,28 @@
|
|
|
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
|
+
|
|
1
9
|
import * as React from "react"
|
|
2
|
-
import { Slot } from "@radix-ui/react-slot"
|
|
3
10
|
import { cva, type VariantProps } from "class-variance-authority"
|
|
4
11
|
|
|
5
12
|
import { cn } from "../lib/utils"
|
|
6
13
|
|
|
7
14
|
const badgeVariants = cva(
|
|
8
|
-
"inline-flex items-center
|
|
15
|
+
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
9
16
|
{
|
|
10
17
|
variants: {
|
|
11
18
|
variant: {
|
|
12
19
|
default:
|
|
13
|
-
"border-
|
|
20
|
+
"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
|
|
14
21
|
secondary:
|
|
15
|
-
"border-
|
|
22
|
+
"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
16
23
|
destructive:
|
|
17
|
-
"border-
|
|
18
|
-
outline:
|
|
19
|
-
"text-cyan-400 border-cyan-800 bg-transparent shadow-[inset_0_0_5px_rgba(6,182,212,0.1)] [a&]:hover:bg-cyan-950/30 [a&]:hover:border-cyan-500 [a&]:hover:text-cyan-200 [a&]:hover:shadow-[0_0_10px_-5px_cyan]",
|
|
24
|
+
"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
|
|
25
|
+
outline: "text-foreground",
|
|
20
26
|
},
|
|
21
27
|
},
|
|
22
28
|
defaultVariants: {
|
|
@@ -25,21 +31,13 @@ const badgeVariants = cva(
|
|
|
25
31
|
}
|
|
26
32
|
)
|
|
27
33
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
asChild = false,
|
|
32
|
-
...props
|
|
33
|
-
}: React.ComponentProps<"span"> &
|
|
34
|
-
VariantProps<typeof badgeVariants> & { asChild?: boolean }) {
|
|
35
|
-
const Comp = asChild ? Slot : "span"
|
|
34
|
+
export interface BadgeProps
|
|
35
|
+
extends React.HTMLAttributes<HTMLDivElement>,
|
|
36
|
+
VariantProps<typeof badgeVariants> {}
|
|
36
37
|
|
|
38
|
+
function Badge({ className, variant, ...props }: BadgeProps) {
|
|
37
39
|
return (
|
|
38
|
-
<
|
|
39
|
-
data-slot="badge"
|
|
40
|
-
className={cn(badgeVariants({ variant }), className)}
|
|
41
|
-
{...props}
|
|
42
|
-
/>
|
|
40
|
+
<div className={cn(badgeVariants({ variant }), className)} {...props} />
|
|
43
41
|
)
|
|
44
42
|
}
|
|
45
43
|
|