@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/tooltip.tsx
CHANGED
|
@@ -13,57 +13,26 @@ import * as TooltipPrimitive from "@radix-ui/react-tooltip"
|
|
|
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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function TooltipTrigger({
|
|
40
|
-
...props
|
|
41
|
-
}: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {
|
|
42
|
-
return <TooltipPrimitive.Trigger data-slot="tooltip-trigger" {...props} />
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function TooltipContent({
|
|
46
|
-
className,
|
|
47
|
-
sideOffset = 0,
|
|
48
|
-
children,
|
|
49
|
-
...props
|
|
50
|
-
}: React.ComponentProps<typeof TooltipPrimitive.Content>) {
|
|
51
|
-
return (
|
|
52
|
-
<TooltipPrimitive.Portal>
|
|
53
|
-
<TooltipPrimitive.Content
|
|
54
|
-
data-slot="tooltip-content"
|
|
55
|
-
sideOffset={sideOffset}
|
|
56
|
-
className={cn(
|
|
57
|
-
"bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",
|
|
58
|
-
className
|
|
59
|
-
)}
|
|
60
|
-
{...props}
|
|
61
|
-
>
|
|
62
|
-
{children}
|
|
63
|
-
<TooltipPrimitive.Arrow className="bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" />
|
|
64
|
-
</TooltipPrimitive.Content>
|
|
65
|
-
</TooltipPrimitive.Portal>
|
|
66
|
-
)
|
|
67
|
-
}
|
|
16
|
+
const TooltipProvider = TooltipPrimitive.Provider
|
|
17
|
+
|
|
18
|
+
const Tooltip = TooltipPrimitive.Root
|
|
19
|
+
|
|
20
|
+
const TooltipTrigger = TooltipPrimitive.Trigger
|
|
21
|
+
|
|
22
|
+
const TooltipContent = React.forwardRef<
|
|
23
|
+
React.ElementRef<typeof TooltipPrimitive.Content>,
|
|
24
|
+
React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>
|
|
25
|
+
>(({ className, sideOffset = 4, ...props }, ref) => (
|
|
26
|
+
<TooltipPrimitive.Content
|
|
27
|
+
ref={ref}
|
|
28
|
+
sideOffset={sideOffset}
|
|
29
|
+
className={cn(
|
|
30
|
+
"z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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-tooltip-content-transform-origin]",
|
|
31
|
+
className
|
|
32
|
+
)}
|
|
33
|
+
{...props}
|
|
34
|
+
/>
|
|
35
|
+
))
|
|
36
|
+
TooltipContent.displayName = TooltipPrimitive.Content.displayName
|
|
68
37
|
|
|
69
38
|
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }
|
|
@@ -0,0 +1,85 @@
|
|
|
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 { cn } from "../lib/utils"
|
|
11
|
+
|
|
12
|
+
const TypographyH1 = React.forwardRef<HTMLHeadingElement, React.HTMLAttributes<HTMLHeadingElement>>(({ className, ...props }, ref) => (
|
|
13
|
+
<h1 ref={ref} className={cn("scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl", className)} {...props} />
|
|
14
|
+
))
|
|
15
|
+
TypographyH1.displayName = "TypographyH1"
|
|
16
|
+
|
|
17
|
+
const TypographyH2 = React.forwardRef<HTMLHeadingElement, React.HTMLAttributes<HTMLHeadingElement>>(({ className, ...props }, ref) => (
|
|
18
|
+
<h2 ref={ref} className={cn("scroll-m-20 border-b pb-2 text-3xl font-semibold tracking-tight first:mt-0", className)} {...props} />
|
|
19
|
+
))
|
|
20
|
+
TypographyH2.displayName = "TypographyH2"
|
|
21
|
+
|
|
22
|
+
const TypographyH3 = React.forwardRef<HTMLHeadingElement, React.HTMLAttributes<HTMLHeadingElement>>(({ className, ...props }, ref) => (
|
|
23
|
+
<h3 ref={ref} className={cn("scroll-m-20 text-2xl font-semibold tracking-tight", className)} {...props} />
|
|
24
|
+
))
|
|
25
|
+
TypographyH3.displayName = "TypographyH3"
|
|
26
|
+
|
|
27
|
+
const TypographyH4 = React.forwardRef<HTMLHeadingElement, React.HTMLAttributes<HTMLHeadingElement>>(({ className, ...props }, ref) => (
|
|
28
|
+
<h4 ref={ref} className={cn("scroll-m-20 text-xl font-semibold tracking-tight", className)} {...props} />
|
|
29
|
+
))
|
|
30
|
+
TypographyH4.displayName = "TypographyH4"
|
|
31
|
+
|
|
32
|
+
const TypographyP = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(({ className, ...props }, ref) => (
|
|
33
|
+
<p ref={ref} className={cn("leading-7 [&:not(:first-child)]:mt-6", className)} {...props} />
|
|
34
|
+
))
|
|
35
|
+
TypographyP.displayName = "TypographyP"
|
|
36
|
+
|
|
37
|
+
const TypographyBlockquote = React.forwardRef<HTMLQuoteElement, React.HTMLAttributes<HTMLQuoteElement>>(({ className, ...props }, ref) => (
|
|
38
|
+
<blockquote ref={ref} className={cn("mt-6 border-l-2 pl-6 italic", className)} {...props} />
|
|
39
|
+
))
|
|
40
|
+
TypographyBlockquote.displayName = "TypographyBlockquote"
|
|
41
|
+
|
|
42
|
+
const TypographyList = React.forwardRef<HTMLUListElement, React.HTMLAttributes<HTMLUListElement>>(({ className, ...props }, ref) => (
|
|
43
|
+
<ul ref={ref} className={cn("my-6 ml-6 list-disc [&>li]:mt-2", className)} {...props} />
|
|
44
|
+
))
|
|
45
|
+
TypographyList.displayName = "TypographyList"
|
|
46
|
+
|
|
47
|
+
const TypographyInlineCode = React.forwardRef<HTMLElement, React.HTMLAttributes<HTMLElement>>(({ className, ...props }, ref) => (
|
|
48
|
+
<code ref={ref} className={cn("relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-sm font-semibold", className)} {...props} />
|
|
49
|
+
))
|
|
50
|
+
TypographyInlineCode.displayName = "TypographyInlineCode"
|
|
51
|
+
|
|
52
|
+
const TypographyLead = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(({ className, ...props }, ref) => (
|
|
53
|
+
<p ref={ref} className={cn("text-xl text-muted-foreground", className)} {...props} />
|
|
54
|
+
))
|
|
55
|
+
TypographyLead.displayName = "TypographyLead"
|
|
56
|
+
|
|
57
|
+
const TypographyLarge = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({ className, ...props }, ref) => (
|
|
58
|
+
<div ref={ref} className={cn("text-lg font-semibold", className)} {...props} />
|
|
59
|
+
))
|
|
60
|
+
TypographyLarge.displayName = "TypographyLarge"
|
|
61
|
+
|
|
62
|
+
const TypographySmall = React.forwardRef<HTMLElement, React.HTMLAttributes<HTMLElement>>(({ className, ...props }, ref) => (
|
|
63
|
+
<small ref={ref} className={cn("text-sm font-medium leading-none", className)} {...props} />
|
|
64
|
+
))
|
|
65
|
+
TypographySmall.displayName = "TypographySmall"
|
|
66
|
+
|
|
67
|
+
const TypographyMuted = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(({ className, ...props }, ref) => (
|
|
68
|
+
<p ref={ref} className={cn("text-sm text-muted-foreground", className)} {...props} />
|
|
69
|
+
))
|
|
70
|
+
TypographyMuted.displayName = "TypographyMuted"
|
|
71
|
+
|
|
72
|
+
export {
|
|
73
|
+
TypographyH1,
|
|
74
|
+
TypographyH2,
|
|
75
|
+
TypographyH3,
|
|
76
|
+
TypographyH4,
|
|
77
|
+
TypographyP,
|
|
78
|
+
TypographyBlockquote,
|
|
79
|
+
TypographyList,
|
|
80
|
+
TypographyInlineCode,
|
|
81
|
+
TypographyLead,
|
|
82
|
+
TypographyLarge,
|
|
83
|
+
TypographySmall,
|
|
84
|
+
TypographyMuted,
|
|
85
|
+
}
|
package/tsconfig.json
CHANGED
package/vite.config.ts
CHANGED
|
@@ -22,6 +22,13 @@ export default defineConfig({
|
|
|
22
22
|
resolve: {
|
|
23
23
|
alias: {
|
|
24
24
|
'@': resolve(__dirname, './src'),
|
|
25
|
+
'@object-ui/core': resolve(__dirname, '../core/src'),
|
|
26
|
+
'@object-ui/types': resolve(__dirname, '../types/src'),
|
|
27
|
+
'@object-ui/react': resolve(__dirname, '../react/src'),
|
|
28
|
+
'@object-ui/components': resolve(__dirname, './src'), // Self-reference for vitest.setup.tsx
|
|
29
|
+
'@object-ui/fields': resolve(__dirname, '../fields/src'),
|
|
30
|
+
'@object-ui/plugin-dashboard': resolve(__dirname, '../plugin-dashboard/src'),
|
|
31
|
+
'@object-ui/plugin-grid': resolve(__dirname, '../plugin-grid/src'),
|
|
25
32
|
},
|
|
26
33
|
},
|
|
27
34
|
build: {
|
|
@@ -45,7 +52,8 @@ export default defineConfig({
|
|
|
45
52
|
test: {
|
|
46
53
|
globals: true,
|
|
47
54
|
environment: 'happy-dom',
|
|
48
|
-
setupFiles: [],
|
|
55
|
+
setupFiles: ['../../vitest.setup.tsx'],
|
|
56
|
+
passWithNoTests: true,
|
|
49
57
|
// Ensure dependencies are resolved properly for tests
|
|
50
58
|
deps: {
|
|
51
59
|
inline: ['@object-ui/core', '@object-ui/react'],
|
package/vitest.config.ts
ADDED
package/ISSUES_FOUND.md
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
# Display Issues Automatically Detected by Tests
|
|
2
|
-
|
|
3
|
-
This document lists the real display and rendering issues automatically discovered by the comprehensive test suite.
|
|
4
|
-
|
|
5
|
-
## Summary
|
|
6
|
-
|
|
7
|
-
The automated test suite (150 tests total) successfully identified **10 real issues** across different component renderers:
|
|
8
|
-
|
|
9
|
-
- ✅ **140 tests passing** - Components working correctly
|
|
10
|
-
- ⚠️ **10 tests failing** - Automatically detected issues requiring fixes
|
|
11
|
-
|
|
12
|
-
## Issues Detected
|
|
13
|
-
|
|
14
|
-
### 1. Container Renderer - Missing Children Support
|
|
15
|
-
**Location:** `layout-data-renderers.test.tsx`
|
|
16
|
-
**Issue:** Container component does not properly render child components passed via `body` prop
|
|
17
|
-
**Expected:** Should render nested children
|
|
18
|
-
**Actual:** Children not rendering, possibly schema mismatch
|
|
19
|
-
|
|
20
|
-
### 2. Grid Renderer - Children Not Rendering
|
|
21
|
-
**Location:** `layout-data-renderers.test.tsx`
|
|
22
|
-
**Issue:** Grid layout component not displaying child items
|
|
23
|
-
**Expected:** Should render grid with child items
|
|
24
|
-
**Actual:** Empty content
|
|
25
|
-
|
|
26
|
-
### 3. Tree View Renderer - Data Prop Mismatch
|
|
27
|
-
**Location:** `layout-data-renderers.test.tsx`
|
|
28
|
-
**Issue:** Tree view component not rendering tree data structure
|
|
29
|
-
**Expected:** Should display hierarchical tree data
|
|
30
|
-
**Actual:** No content rendered, possible prop name mismatch (`data` vs `items`)
|
|
31
|
-
|
|
32
|
-
### 4. Badge Renderer - Text Prop Issue
|
|
33
|
-
**Location:** `layout-data-renderers.test.tsx`
|
|
34
|
-
**Issue:** Badge component not rendering text content
|
|
35
|
-
**Expected:** Should display badge text via `text` prop
|
|
36
|
-
**Actual:** Empty badge, possible prop name should be `children` or `content`
|
|
37
|
-
|
|
38
|
-
### 5. Avatar Renderer - Image Not Rendering
|
|
39
|
-
**Location:** `layout-data-renderers.test.tsx`
|
|
40
|
-
**Issue:** Avatar component image not displaying
|
|
41
|
-
**Expected:** Should render image from `src` prop
|
|
42
|
-
**Actual:** No image element found in DOM
|
|
43
|
-
|
|
44
|
-
### 6. Loading Renderer - Message Prop Not Working
|
|
45
|
-
**Location:** `feedback-overlay-renderers.test.tsx`
|
|
46
|
-
**Issue:** Loading component not displaying message text
|
|
47
|
-
**Expected:** Should show loading message
|
|
48
|
-
**Actual:** Message text not rendered
|
|
49
|
-
|
|
50
|
-
### 7. Tooltip Renderer - Trigger Content Not Rendering
|
|
51
|
-
**Location:** `feedback-overlay-renderers.test.tsx`
|
|
52
|
-
**Issue:** Tooltip trigger content (button) not visible
|
|
53
|
-
**Expected:** Should render trigger element that shows tooltip on hover
|
|
54
|
-
**Actual:** Trigger content missing
|
|
55
|
-
|
|
56
|
-
### 8. Scroll Area Renderer - Content Not Displaying
|
|
57
|
-
**Location:** `complex-disclosure-renderers.test.tsx`
|
|
58
|
-
**Issue:** Scroll area component not showing scrollable content
|
|
59
|
-
**Expected:** Should render content within scrollable container
|
|
60
|
-
**Actual:** Only CSS rules visible, content not rendered
|
|
61
|
-
|
|
62
|
-
## Component Schema Mismatches Found
|
|
63
|
-
|
|
64
|
-
| Component | Test Prop | Expected Behavior | Likely Fix |
|
|
65
|
-
|-----------|-----------|-------------------|------------|
|
|
66
|
-
| Container | `body` | Render children | Check SchemaRenderer integration |
|
|
67
|
-
| Grid | `body` | Render grid items | Check children rendering |
|
|
68
|
-
| Tree View | `data` | Display tree structure | Verify prop name or data format |
|
|
69
|
-
| Badge | `text` | Show badge text | Change to `children` or verify prop |
|
|
70
|
-
| Avatar | `src` | Render image | Check Radix UI Avatar implementation |
|
|
71
|
-
| Loading | `message` | Display message | Verify prop name |
|
|
72
|
-
| Tooltip | `body` | Render trigger | Check trigger rendering |
|
|
73
|
-
| Scroll Area | `body` | Show content | Verify content prop handling |
|
|
74
|
-
|
|
75
|
-
## Automated Checks That Found Issues
|
|
76
|
-
|
|
77
|
-
The test utilities successfully detected:
|
|
78
|
-
|
|
79
|
-
1. **Empty Content Detection**
|
|
80
|
-
```typescript
|
|
81
|
-
const domCheck = checkDOMStructure(container);
|
|
82
|
-
expect(domCheck.hasContent).toBe(true); // FAILED - found empty components
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
2. **Missing DOM Elements**
|
|
86
|
-
```typescript
|
|
87
|
-
expect(container.textContent).toContain('Expected Text'); // FAILED - content not rendered
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
3. **Missing Image Elements**
|
|
91
|
-
```typescript
|
|
92
|
-
const img = container.querySelector('img');
|
|
93
|
-
expect(img).toBeTruthy(); // FAILED - image not found
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
## Next Steps
|
|
97
|
-
|
|
98
|
-
To fix these issues:
|
|
99
|
-
|
|
100
|
-
1. **Verify Component Schemas** - Check TypeScript type definitions in `@object-ui/types`
|
|
101
|
-
2. **Update Renderers** - Ensure renderers properly handle documented props
|
|
102
|
-
3. **Fix Prop Mappings** - Align prop names between schema and component implementation
|
|
103
|
-
4. **Test SchemaRenderer Integration** - Verify children rendering works correctly
|
|
104
|
-
5. **Update Documentation** - Ensure component examples use correct props
|
|
105
|
-
|
|
106
|
-
## Value of Automated Testing
|
|
107
|
-
|
|
108
|
-
These tests have proven their value by:
|
|
109
|
-
- ✅ Automatically discovering 10 real issues without manual testing
|
|
110
|
-
- ✅ Identifying schema/implementation mismatches
|
|
111
|
-
- ✅ Providing specific locations and expected behaviors
|
|
112
|
-
- ✅ Enabling quick regression testing as fixes are applied
|
|
113
|
-
- ✅ Serving as living documentation of component APIs
|
|
114
|
-
|
|
115
|
-
## Running Tests to Verify Fixes
|
|
116
|
-
|
|
117
|
-
After fixing issues, verify with:
|
|
118
|
-
```bash
|
|
119
|
-
# Run all tests
|
|
120
|
-
pnpm vitest run packages/components/src/__tests__/
|
|
121
|
-
|
|
122
|
-
# Run specific failing tests
|
|
123
|
-
pnpm vitest run packages/components/src/__tests__/layout-data-renderers.test.tsx
|
|
124
|
-
pnpm vitest run packages/components/src/__tests__/feedback-overlay-renderers.test.tsx
|
|
125
|
-
pnpm vitest run packages/components/src/__tests__/complex-disclosure-renderers.test.tsx
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
When all 150 tests pass, all display issues will be resolved!
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|