@trycompai/design-system 1.0.11 → 1.0.13
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trycompai/design-system",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.13",
|
|
4
4
|
"description": "Design system for Comp AI - shadcn-style components with Tailwind CSS",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -65,6 +65,12 @@
|
|
|
65
65
|
"shadcn",
|
|
66
66
|
"ui"
|
|
67
67
|
],
|
|
68
|
+
"scripts": {
|
|
69
|
+
"clean": "rm -rf .turbo node_modules",
|
|
70
|
+
"format": "prettier --write .",
|
|
71
|
+
"lint": "prettier --check .",
|
|
72
|
+
"typecheck": "tsc --noEmit"
|
|
73
|
+
},
|
|
68
74
|
"dependencies": {
|
|
69
75
|
"@base-ui/react": "^1.0.0",
|
|
70
76
|
"@carbon/icons-react": "^11.72.0",
|
|
@@ -91,6 +97,7 @@
|
|
|
91
97
|
"tailwindcss": "^4.0.0"
|
|
92
98
|
},
|
|
93
99
|
"devDependencies": {
|
|
100
|
+
"@repo/typescript-config": "workspace:*",
|
|
94
101
|
"@tailwindcss/postcss": "^4.1.10",
|
|
95
102
|
"@types/node": "^22.18.0",
|
|
96
103
|
"@types/react": "^19.2.7",
|
|
@@ -99,13 +106,6 @@
|
|
|
99
106
|
"react": "^19.1.1",
|
|
100
107
|
"react-dom": "^19.1.0",
|
|
101
108
|
"tailwindcss": "^4.1.8",
|
|
102
|
-
"typescript": "^5.9.3"
|
|
103
|
-
"@repo/typescript-config": "0.0.0"
|
|
104
|
-
},
|
|
105
|
-
"scripts": {
|
|
106
|
-
"clean": "rm -rf .turbo node_modules",
|
|
107
|
-
"format": "prettier --write .",
|
|
108
|
-
"lint": "prettier --check .",
|
|
109
|
-
"typecheck": "tsc --noEmit"
|
|
109
|
+
"typescript": "^5.9.3"
|
|
110
110
|
}
|
|
111
|
-
}
|
|
111
|
+
}
|
|
@@ -10,7 +10,7 @@ function Textarea({
|
|
|
10
10
|
<textarea
|
|
11
11
|
data-slot="textarea"
|
|
12
12
|
data-size={size}
|
|
13
|
-
className="border-input dark:bg-input/30 focus-visible:border-primary focus-visible:ring-primary/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 rounded-sm border bg-transparent px-2.5 py-2 text-base transition-colors focus-visible:ring-[3px] aria-invalid:ring-[3px] md:text-sm placeholder:text-muted-foreground flex field-sizing-content min-h-16 outline-none disabled:cursor-not-allowed disabled:opacity-50 data-[size=sm]:w-xs data-[size=default]:w-md data-[size=lg]:w-xl data-[size=full]:w-full"
|
|
13
|
+
className="border-input dark:bg-input/30 focus-visible:border-primary focus-visible:ring-primary/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 rounded-sm border bg-transparent px-2.5 py-2 text-base transition-colors focus-visible:ring-[3px] aria-invalid:ring-[3px] md:text-sm placeholder:text-muted-foreground flex field-sizing-content min-h-16 max-w-full outline-none disabled:cursor-not-allowed disabled:opacity-50 data-[size=sm]:w-xs data-[size=default]:w-md data-[size=lg]:w-xl data-[size=full]:w-full"
|
|
14
14
|
{...props}
|
|
15
15
|
/>
|
|
16
16
|
);
|
|
@@ -20,6 +20,7 @@ interface PageHeaderProps extends Omit<React.ComponentProps<'div'>, 'className'>
|
|
|
20
20
|
function PageHeader({ title, actions, breadcrumbs, backHref, backLabel = 'Back', tabs, children, ...props }: PageHeaderProps) {
|
|
21
21
|
const childArray = React.Children.toArray(children);
|
|
22
22
|
const extractedActionChildren: React.ReactNode[] = [];
|
|
23
|
+
const extractedDescriptionChildren: React.ReactNode[] = [];
|
|
23
24
|
|
|
24
25
|
childArray.forEach((child) => {
|
|
25
26
|
if (
|
|
@@ -30,6 +31,14 @@ function PageHeader({ title, actions, breadcrumbs, backHref, backLabel = 'Back',
|
|
|
30
31
|
) {
|
|
31
32
|
extractedActionChildren.push((child.props as { children?: React.ReactNode }).children);
|
|
32
33
|
}
|
|
34
|
+
if (
|
|
35
|
+
React.isValidElement(child) &&
|
|
36
|
+
(child.type === PageHeaderDescription ||
|
|
37
|
+
(typeof child.type === 'function' &&
|
|
38
|
+
(child.type as unknown as { __pageHeaderSlot?: string }).__pageHeaderSlot === 'description'))
|
|
39
|
+
) {
|
|
40
|
+
extractedDescriptionChildren.push(child);
|
|
41
|
+
}
|
|
33
42
|
});
|
|
34
43
|
|
|
35
44
|
const resolvedActions =
|
|
@@ -69,6 +78,9 @@ function PageHeader({ title, actions, breadcrumbs, backHref, backLabel = 'Back',
|
|
|
69
78
|
)}
|
|
70
79
|
</div>
|
|
71
80
|
|
|
81
|
+
{/* Description section */}
|
|
82
|
+
{extractedDescriptionChildren.length > 0 && extractedDescriptionChildren}
|
|
83
|
+
|
|
72
84
|
{/* Tabs section */}
|
|
73
85
|
{tabs && (
|
|
74
86
|
<div className="mt-2 -mb-px">
|
|
@@ -85,7 +97,14 @@ function PageHeaderActions({ ...props }: Omit<React.ComponentProps<'div'>, 'clas
|
|
|
85
97
|
);
|
|
86
98
|
}
|
|
87
99
|
|
|
100
|
+
function PageHeaderDescription({ ...props }: Omit<React.ComponentProps<'p'>, 'className'>) {
|
|
101
|
+
return (
|
|
102
|
+
<p data-slot="page-header-description" className="text-sm text-muted-foreground" {...props} />
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
|
|
88
106
|
// Mark compound slots so PageHeader can detect them even if module instances differ.
|
|
89
107
|
(PageHeaderActions as unknown as { __pageHeaderSlot?: string }).__pageHeaderSlot = 'actions';
|
|
108
|
+
(PageHeaderDescription as unknown as { __pageHeaderSlot?: string }).__pageHeaderSlot = 'description';
|
|
90
109
|
|
|
91
|
-
export { PageHeader, PageHeaderActions };
|
|
110
|
+
export { PageHeader, PageHeaderActions, PageHeaderDescription };
|
|
@@ -34,7 +34,7 @@ const containerVariants = cva('mx-auto w-full', {
|
|
|
34
34
|
},
|
|
35
35
|
},
|
|
36
36
|
defaultVariants: {
|
|
37
|
-
maxWidth: '
|
|
37
|
+
maxWidth: '2xl',
|
|
38
38
|
},
|
|
39
39
|
});
|
|
40
40
|
|
|
@@ -60,7 +60,7 @@ function PageLayout({
|
|
|
60
60
|
...props
|
|
61
61
|
}: PageLayoutProps) {
|
|
62
62
|
// For center variant, default to smaller max-width (sm) for auth-style pages
|
|
63
|
-
const resolvedMaxWidth = maxWidth ?? (variant === 'center' ? 'sm' : '
|
|
63
|
+
const resolvedMaxWidth = maxWidth ?? (variant === 'center' ? 'sm' : 'xl');
|
|
64
64
|
|
|
65
65
|
const content = (
|
|
66
66
|
<Stack gap={gap}>
|