@trycompai/design-system 1.0.19 → 1.0.21
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
|
@@ -18,13 +18,13 @@ function Tabs({
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
const tabsListVariants = cva(
|
|
21
|
-
'rounded-lg p-[3px] group-data-horizontal/tabs:h-8 data-[variant=line]:rounded-none data-[variant=underline]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col',
|
|
21
|
+
'rounded-lg p-[3px] group-data-horizontal/tabs:h-8 data-[variant=line]:rounded-none data-[variant=underline]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col overflow-x-auto scrollbar-none',
|
|
22
22
|
{
|
|
23
23
|
variants: {
|
|
24
24
|
variant: {
|
|
25
25
|
default: 'bg-muted',
|
|
26
26
|
line: 'gap-1 bg-transparent',
|
|
27
|
-
underline: 'p-0 pb-px bg-transparent w-full justify-start items-stretch shadow-[inset_0_-1px_0_0_var(--color-border)]',
|
|
27
|
+
underline: 'p-0 pb-px bg-transparent w-full max-w-full justify-start items-stretch shadow-[inset_0_-1px_0_0_var(--color-border)]',
|
|
28
28
|
},
|
|
29
29
|
},
|
|
30
30
|
defaultVariants: {
|
|
@@ -47,7 +47,7 @@ function AlertDialogHeader({ ...props }: Omit<React.ComponentProps<'div'>, 'clas
|
|
|
47
47
|
return (
|
|
48
48
|
<div
|
|
49
49
|
data-slot="alert-dialog-header"
|
|
50
|
-
className="grid grid-rows-[auto_1fr] place-items-
|
|
50
|
+
className="grid grid-rows-[auto_1fr] place-items-start gap-1.5 text-left has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]"
|
|
51
51
|
{...props}
|
|
52
52
|
/>
|
|
53
53
|
);
|
|
@@ -4,6 +4,7 @@ import * as React from 'react';
|
|
|
4
4
|
import { cn } from '../../../lib/utils';
|
|
5
5
|
import { Stack } from '../atoms/stack';
|
|
6
6
|
import { Skeleton } from '../atoms/skeleton';
|
|
7
|
+
import { Heading } from '../atoms/heading';
|
|
7
8
|
|
|
8
9
|
const pageLayoutVariants = cva('min-h-full bg-background text-foreground', {
|
|
9
10
|
variants: {
|
|
@@ -51,16 +52,26 @@ interface PageLayoutProps
|
|
|
51
52
|
gap?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '0' | '1' | '2' | '3' | '4' | '6' | '8';
|
|
52
53
|
/** Whether the page is loading. Shows skeleton placeholder when true. */
|
|
53
54
|
loading?: boolean;
|
|
55
|
+
/** @deprecated Use header prop instead. Page title to display during loading state. */
|
|
56
|
+
loadingTitle?: string;
|
|
57
|
+
/** Header element (e.g., PageHeader) that renders regardless of loading state. */
|
|
58
|
+
header?: React.ReactNode;
|
|
54
59
|
}
|
|
55
60
|
|
|
56
|
-
function PageLayoutSkeleton() {
|
|
61
|
+
function PageLayoutSkeleton({ title, includeHeader = true }: { title?: string; includeHeader?: boolean }) {
|
|
57
62
|
return (
|
|
58
63
|
<Stack gap="lg">
|
|
59
|
-
{/* Header skeleton */}
|
|
60
|
-
|
|
61
|
-
<
|
|
62
|
-
|
|
63
|
-
|
|
64
|
+
{/* Header skeleton - only shown if no header prop is provided */}
|
|
65
|
+
{includeHeader && (
|
|
66
|
+
<div className="space-y-2">
|
|
67
|
+
{title ? (
|
|
68
|
+
<Heading level="1">{title}</Heading>
|
|
69
|
+
) : (
|
|
70
|
+
<Skeleton style={{ width: '30%', height: 24 }} />
|
|
71
|
+
)}
|
|
72
|
+
<Skeleton style={{ width: '50%', height: 16 }} />
|
|
73
|
+
</div>
|
|
74
|
+
)}
|
|
64
75
|
{/* Content skeleton */}
|
|
65
76
|
<div className="space-y-4">
|
|
66
77
|
<Skeleton style={{ width: '100%', height: 200 }} />
|
|
@@ -81,6 +92,8 @@ function PageLayout({
|
|
|
81
92
|
maxWidth,
|
|
82
93
|
gap = 'lg',
|
|
83
94
|
loading = false,
|
|
95
|
+
loadingTitle,
|
|
96
|
+
header,
|
|
84
97
|
children,
|
|
85
98
|
...props
|
|
86
99
|
}: PageLayoutProps) {
|
|
@@ -88,9 +101,13 @@ function PageLayout({
|
|
|
88
101
|
const resolvedMaxWidth = maxWidth ?? (variant === 'center' ? 'sm' : 'xl');
|
|
89
102
|
|
|
90
103
|
const content = loading ? (
|
|
91
|
-
<
|
|
104
|
+
<Stack gap={gap}>
|
|
105
|
+
{header}
|
|
106
|
+
<PageLayoutSkeleton title={loadingTitle} includeHeader={!header} />
|
|
107
|
+
</Stack>
|
|
92
108
|
) : (
|
|
93
109
|
<Stack gap={gap}>
|
|
110
|
+
{header}
|
|
94
111
|
{children}
|
|
95
112
|
</Stack>
|
|
96
113
|
);
|
package/src/styles/globals.css
CHANGED
|
@@ -254,6 +254,15 @@
|
|
|
254
254
|
.font-bold {
|
|
255
255
|
font-weight: 700;
|
|
256
256
|
}
|
|
257
|
+
|
|
258
|
+
/* Hide scrollbar while keeping scroll functionality */
|
|
259
|
+
.scrollbar-none {
|
|
260
|
+
scrollbar-width: none;
|
|
261
|
+
-ms-overflow-style: none;
|
|
262
|
+
}
|
|
263
|
+
.scrollbar-none::-webkit-scrollbar {
|
|
264
|
+
display: none;
|
|
265
|
+
}
|
|
257
266
|
}
|
|
258
267
|
|
|
259
268
|
/* View Transitions API for smooth page transitions */
|