@trycompai/design-system 1.0.3 → 1.0.7
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/README.md +101 -2
- package/package.json +1 -1
- package/src/components/atoms/badge.tsx +1 -1
- package/src/components/atoms/button.tsx +10 -9
- package/src/components/atoms/input.tsx +1 -1
- package/src/components/atoms/textarea.tsx +1 -1
- package/src/components/molecules/ai-chat.tsx +5 -5
- package/src/components/molecules/card.tsx +3 -3
- package/src/components/molecules/settings.tsx +1 -1
- package/src/components/molecules/table.tsx +5 -5
- package/src/components/molecules/tabs.tsx +1 -1
- package/src/components/organisms/alert-dialog.tsx +1 -1
- package/src/components/organisms/app-shell.tsx +5 -5
- package/src/components/organisms/dialog.tsx +1 -1
- package/src/components/organisms/page-layout.tsx +1 -1
- package/src/styles/globals.css +45 -16
package/README.md
CHANGED
|
@@ -82,6 +82,7 @@ export function MyComponent() {
|
|
|
82
82
|
| Export | Description |
|
|
83
83
|
| ------------------------------------------ | ---------------------------------- |
|
|
84
84
|
| `@trycompai/design-system` | All components |
|
|
85
|
+
| `@trycompai/design-system/icons` | Carbon icons re-exported |
|
|
85
86
|
| `@trycompai/design-system/cn` | `cn()` utility for merging classes |
|
|
86
87
|
| `@trycompai/design-system/globals.css` | Global CSS with theme variables |
|
|
87
88
|
| `@trycompai/design-system/tailwind.config` | Tailwind configuration |
|
|
@@ -98,12 +99,110 @@ The design system includes:
|
|
|
98
99
|
- **Navigation**: `Tabs`, `Breadcrumb`, `Pagination`, `NavigationMenu`, `DropdownMenu`
|
|
99
100
|
- **Utility**: `Separator`, `Skeleton`, `Spinner`, `ScrollArea`, `Collapsible`
|
|
100
101
|
|
|
102
|
+
## Theme Switching
|
|
103
|
+
|
|
104
|
+
The design system uses CSS class-based theming. Dark mode is enabled by adding the `.dark` class to the `<html>` element.
|
|
105
|
+
|
|
106
|
+
### Theme Components
|
|
107
|
+
|
|
108
|
+
Two components are available for theme switching:
|
|
109
|
+
|
|
110
|
+
```tsx
|
|
111
|
+
import { ThemeSwitcher, ThemeToggle } from '@trycompai/design-system';
|
|
112
|
+
|
|
113
|
+
// 3-option switcher: light, dark, system
|
|
114
|
+
<ThemeSwitcher
|
|
115
|
+
value={theme}
|
|
116
|
+
onChange={(theme) => handleThemeChange(theme)}
|
|
117
|
+
showSystem={true} // optional, defaults to true
|
|
118
|
+
size="default" // 'sm' | 'default'
|
|
119
|
+
/>
|
|
120
|
+
|
|
121
|
+
// Simple light/dark toggle
|
|
122
|
+
<ThemeToggle
|
|
123
|
+
isDark={isDark}
|
|
124
|
+
onChange={(isDark) => handleToggle(isDark)}
|
|
125
|
+
size="default" // 'sm' | 'default'
|
|
126
|
+
/>
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Manual Implementation
|
|
130
|
+
|
|
131
|
+
To switch themes, toggle the `.dark` class on the document:
|
|
132
|
+
|
|
133
|
+
```tsx
|
|
134
|
+
'use client';
|
|
135
|
+
|
|
136
|
+
import { useState, useEffect } from 'react';
|
|
137
|
+
import { ThemeToggle } from '@trycompai/design-system';
|
|
138
|
+
|
|
139
|
+
function MyThemeToggle() {
|
|
140
|
+
const [isDark, setIsDark] = useState(false);
|
|
141
|
+
|
|
142
|
+
// Sync with current theme on mount
|
|
143
|
+
useEffect(() => {
|
|
144
|
+
setIsDark(document.documentElement.classList.contains('dark'));
|
|
145
|
+
}, []);
|
|
146
|
+
|
|
147
|
+
const handleThemeChange = (dark: boolean) => {
|
|
148
|
+
setIsDark(dark);
|
|
149
|
+
if (dark) {
|
|
150
|
+
document.documentElement.classList.add('dark');
|
|
151
|
+
} else {
|
|
152
|
+
document.documentElement.classList.remove('dark');
|
|
153
|
+
}
|
|
154
|
+
// Optional: persist to localStorage
|
|
155
|
+
localStorage.setItem('theme', dark ? 'dark' : 'light');
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
return <ThemeToggle isDark={isDark} onChange={handleThemeChange} />;
|
|
159
|
+
}
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### With next-themes (Optional)
|
|
163
|
+
|
|
164
|
+
For more features like system preference detection and SSR support, you can use `next-themes`:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
npm install next-themes
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
```tsx
|
|
171
|
+
// app/layout.tsx
|
|
172
|
+
import { ThemeProvider } from 'next-themes';
|
|
173
|
+
|
|
174
|
+
export default function RootLayout({ children }) {
|
|
175
|
+
return (
|
|
176
|
+
<html lang="en" suppressHydrationWarning>
|
|
177
|
+
<body>
|
|
178
|
+
<ThemeProvider attribute="class" defaultTheme="system" enableSystem>
|
|
179
|
+
{children}
|
|
180
|
+
</ThemeProvider>
|
|
181
|
+
</body>
|
|
182
|
+
</html>
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
```tsx
|
|
188
|
+
// components/theme-toggle.tsx
|
|
189
|
+
'use client';
|
|
190
|
+
|
|
191
|
+
import { useTheme } from 'next-themes';
|
|
192
|
+
import { ThemeSwitcher } from '@trycompai/design-system';
|
|
193
|
+
|
|
194
|
+
export function MyThemeSwitcher() {
|
|
195
|
+
const { theme, setTheme } = useTheme();
|
|
196
|
+
return <ThemeSwitcher value={theme} onChange={setTheme} />;
|
|
197
|
+
}
|
|
198
|
+
```
|
|
199
|
+
|
|
101
200
|
## Design Principles
|
|
102
201
|
|
|
103
202
|
- **No className prop**: Components use variants and props, not className overrides
|
|
104
203
|
- **Semantic tokens**: Uses CSS variables for consistent theming
|
|
105
|
-
- **Dark mode**: Full dark mode support via `
|
|
106
|
-
- **Accessible**: Built on
|
|
204
|
+
- **Dark mode**: Full dark mode support via `.dark` class
|
|
205
|
+
- **Accessible**: Built on Base UI primitives
|
|
107
206
|
|
|
108
207
|
## License
|
|
109
208
|
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@ import { useRender } from '@base-ui/react/use-render';
|
|
|
3
3
|
import { cva, type VariantProps } from 'class-variance-authority';
|
|
4
4
|
|
|
5
5
|
const badgeVariants = cva(
|
|
6
|
-
'gap-1 rounded-sm px-1.5 py-1 text-[10px] font-semibold uppercase tracking-wider leading-none transition-colors has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 [&>svg]:size-2.5! inline-flex items-center justify-center w-fit whitespace-nowrap shrink-0 [&>svg]:pointer-events-none focus-visible:ring-ring/50 focus-visible:ring-[3px] overflow-hidden antialiased select-none',
|
|
6
|
+
'gap-1 rounded-sm px-1.5 py-1 text-[10px] font-semibold uppercase tracking-wider leading-none [text-box-trim:both] [text-box-edge:cap_alphabetic] transition-colors has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 [&>svg]:size-2.5! inline-flex items-center justify-center w-fit whitespace-nowrap shrink-0 [&>svg]:pointer-events-none focus-visible:ring-ring/50 focus-visible:ring-[3px] overflow-hidden antialiased select-none',
|
|
7
7
|
{
|
|
8
8
|
variants: {
|
|
9
9
|
variant: {
|
|
@@ -5,19 +5,20 @@ import * as React from 'react';
|
|
|
5
5
|
import { Spinner } from './spinner';
|
|
6
6
|
|
|
7
7
|
const buttonVariants = cva(
|
|
8
|
-
"focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-
|
|
8
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-md border border-transparent text-sm font-medium leading-none [text-box-trim:both] [text-box-edge:cap_alphabetic] focus-visible:ring-[3px] aria-invalid:ring-[3px] [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all duration-200 ease-out active:scale-[0.97] active:duration-75 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none cursor-pointer",
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
12
|
-
default:
|
|
12
|
+
default:
|
|
13
|
+
'bg-primary text-primary-foreground hover:bg-primary/90',
|
|
13
14
|
outline:
|
|
14
|
-
'border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:
|
|
15
|
+
'border-border! bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground',
|
|
15
16
|
secondary:
|
|
16
17
|
'bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground',
|
|
17
18
|
ghost:
|
|
18
19
|
'hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground',
|
|
19
20
|
destructive:
|
|
20
|
-
'bg-destructive/10 hover:bg-destructive/
|
|
21
|
+
'bg-destructive/10 text-destructive hover:bg-destructive/15 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 focus-visible:border-destructive/40 dark:bg-destructive/20 dark:hover:bg-destructive/30',
|
|
21
22
|
link: 'text-primary underline-offset-4 hover:underline',
|
|
22
23
|
},
|
|
23
24
|
width: {
|
|
@@ -26,15 +27,15 @@ const buttonVariants = cva(
|
|
|
26
27
|
},
|
|
27
28
|
size: {
|
|
28
29
|
default:
|
|
29
|
-
'h-8 gap-1.5 px-2.5
|
|
30
|
-
xs: "h-6 gap-1
|
|
31
|
-
sm: "h-7 gap-1
|
|
30
|
+
'h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',
|
|
31
|
+
xs: "h-6 gap-1 px-2 text-xs has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
32
|
+
sm: "h-7 gap-1 px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
32
33
|
lg: 'h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3',
|
|
33
34
|
icon: 'size-8',
|
|
34
35
|
'icon-xs':
|
|
35
|
-
"size-6
|
|
36
|
+
"size-6 [&_svg:not([class*='size-'])]:size-3",
|
|
36
37
|
'icon-sm':
|
|
37
|
-
'size-7
|
|
38
|
+
'size-7',
|
|
38
39
|
'icon-lg': 'size-9',
|
|
39
40
|
// Round icon buttons - for avatar triggers and circular icons
|
|
40
41
|
'icon-round': 'size-8 rounded-full',
|
|
@@ -6,7 +6,7 @@ function Input({ type, ...props }: Omit<React.ComponentProps<'input'>, 'classNam
|
|
|
6
6
|
<InputPrimitive
|
|
7
7
|
type={type}
|
|
8
8
|
data-slot="input"
|
|
9
|
-
className="dark:bg-input/30 border-input focus-visible:border-
|
|
9
|
+
className="dark:bg-input/30 border-input 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 h-8 rounded-sm border bg-transparent px-2.5 py-1 text-base transition-colors file:h-6 file:text-sm file:font-medium focus-visible:ring-[3px] aria-invalid:ring-[3px] md:text-sm file:text-foreground placeholder:text-muted-foreground w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50"
|
|
10
10
|
{...props}
|
|
11
11
|
/>
|
|
12
12
|
);
|
|
@@ -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-
|
|
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"
|
|
14
14
|
{...props}
|
|
15
15
|
/>
|
|
16
16
|
);
|
|
@@ -26,7 +26,7 @@ const aiChatTriggerVariants = cva(
|
|
|
26
26
|
);
|
|
27
27
|
|
|
28
28
|
const aiChatPanelVariants = cva(
|
|
29
|
-
'fixed bottom-24 right-6 z-50 flex flex-col bg-background border border-border
|
|
29
|
+
'fixed bottom-24 right-6 z-50 flex flex-col bg-background border border-border rounded-2xl overflow-hidden transition-all duration-200 origin-bottom-right',
|
|
30
30
|
{
|
|
31
31
|
variants: {
|
|
32
32
|
size: {
|
|
@@ -127,7 +127,7 @@ function AIChatDefaultContent({ onClose }: { onClose: () => void }) {
|
|
|
127
127
|
return (
|
|
128
128
|
<>
|
|
129
129
|
{/* Header */}
|
|
130
|
-
<div className="flex items-center justify-between px-4 py-3 border-b border-border
|
|
130
|
+
<div className="flex items-center justify-between px-4 py-3 border-b border-border">
|
|
131
131
|
<div className="flex items-center gap-2">
|
|
132
132
|
<span className="flex size-8 items-center justify-center rounded-full bg-primary/10 text-primary">
|
|
133
133
|
<MagicWand className="size-4" />
|
|
@@ -162,7 +162,7 @@ function AIChatDefaultContent({ onClose }: { onClose: () => void }) {
|
|
|
162
162
|
</div>
|
|
163
163
|
|
|
164
164
|
{/* Input Area */}
|
|
165
|
-
<div className="p-3 border-t border-border
|
|
165
|
+
<div className="p-3 border-t border-border">
|
|
166
166
|
<div className="flex items-center gap-2 rounded-xl bg-muted/50 dark:bg-muted px-3 py-2">
|
|
167
167
|
<input
|
|
168
168
|
type="text"
|
|
@@ -189,7 +189,7 @@ function AIChatHeader({ children, ...props }: Omit<React.ComponentProps<'div'>,
|
|
|
189
189
|
return (
|
|
190
190
|
<div
|
|
191
191
|
data-slot="ai-chat-header"
|
|
192
|
-
className="flex items-center justify-between px-4 py-3 border-b border-border
|
|
192
|
+
className="flex items-center justify-between px-4 py-3 border-b border-border"
|
|
193
193
|
{...props}
|
|
194
194
|
>
|
|
195
195
|
{children}
|
|
@@ -207,7 +207,7 @@ function AIChatBody({ children, ...props }: Omit<React.ComponentProps<'div'>, 'c
|
|
|
207
207
|
|
|
208
208
|
function AIChatFooter({ children, ...props }: Omit<React.ComponentProps<'div'>, 'className'>) {
|
|
209
209
|
return (
|
|
210
|
-
<div data-slot="ai-chat-footer" className="p-3 border-t border-border
|
|
210
|
+
<div data-slot="ai-chat-footer" className="p-3 border-t border-border" {...props}>
|
|
211
211
|
{children}
|
|
212
212
|
</div>
|
|
213
213
|
);
|
|
@@ -2,7 +2,7 @@ import { cva, type VariantProps } from 'class-variance-authority';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
4
|
const cardVariants = cva(
|
|
5
|
-
'bg-card text-card-foreground border border-border
|
|
5
|
+
'bg-card text-card-foreground border border-border overflow-hidden rounded-md py-4 text-sm has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-md *:[img:last-child]:rounded-b-md group/card flex flex-col',
|
|
6
6
|
{
|
|
7
7
|
variants: {
|
|
8
8
|
width: {
|
|
@@ -116,7 +116,7 @@ function CardHeader({ ...props }: Omit<React.ComponentProps<'div'>, 'className'>
|
|
|
116
116
|
return (
|
|
117
117
|
<div
|
|
118
118
|
data-slot="card-header"
|
|
119
|
-
className="gap-1 rounded-t-
|
|
119
|
+
className="gap-1 rounded-t-md px-4 group-data-[size=sm]/card:px-3 [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3 group/card-header @container/card-header grid auto-rows-min items-start has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto]"
|
|
120
120
|
{...props}
|
|
121
121
|
/>
|
|
122
122
|
);
|
|
@@ -156,7 +156,7 @@ function CardFooter({ ...props }: Omit<React.ComponentProps<'div'>, 'className'>
|
|
|
156
156
|
return (
|
|
157
157
|
<div
|
|
158
158
|
data-slot="card-footer"
|
|
159
|
-
className="bg-muted
|
|
159
|
+
className="bg-muted rounded-b-md border-t p-4 group-data-[size=sm]/card:p-3 flex items-center"
|
|
160
160
|
{...props}
|
|
161
161
|
/>
|
|
162
162
|
);
|
|
@@ -155,7 +155,7 @@ function SettingsCard({ title, description, hint, action, children, ...props }:
|
|
|
155
155
|
</div>
|
|
156
156
|
<div className="px-6 pb-6">{children}</div>
|
|
157
157
|
{hasFooter && (
|
|
158
|
-
<div className="border-t bg-muted
|
|
158
|
+
<div className="border-t bg-muted px-6 py-4">
|
|
159
159
|
<div className="flex items-center justify-between gap-4">
|
|
160
160
|
<div className="text-muted-foreground text-sm">{hint}</div>
|
|
161
161
|
<div className="flex shrink-0 items-center gap-2">{action}</div>
|
|
@@ -22,7 +22,7 @@ function Table({
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
function TableHeader({ ...props }: Omit<React.ComponentProps<'thead'>, 'className'>) {
|
|
25
|
-
return <thead data-slot="table-header" className="[&_tr]:border-b" {...props} />;
|
|
25
|
+
return <thead data-slot="table-header" className="bg-muted [&_tr]:border-b" {...props} />;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
function TableBody({ ...props }: Omit<React.ComponentProps<'tbody'>, 'className'>) {
|
|
@@ -33,7 +33,7 @@ function TableFooter({ ...props }: Omit<React.ComponentProps<'tfoot'>, 'classNam
|
|
|
33
33
|
return (
|
|
34
34
|
<tfoot
|
|
35
35
|
data-slot="table-footer"
|
|
36
|
-
className="bg-muted
|
|
36
|
+
className="bg-muted border-t font-medium [&>tr]:last:border-b-0"
|
|
37
37
|
{...props}
|
|
38
38
|
/>
|
|
39
39
|
);
|
|
@@ -43,7 +43,7 @@ function TableRow({ ...props }: Omit<React.ComponentProps<'tr'>, 'className'>) {
|
|
|
43
43
|
return (
|
|
44
44
|
<tr
|
|
45
45
|
data-slot="table-row"
|
|
46
|
-
className="hover:bg-muted
|
|
46
|
+
className="hover:bg-muted data-[state=selected]:bg-accent border-b transition-colors"
|
|
47
47
|
{...props}
|
|
48
48
|
/>
|
|
49
49
|
);
|
|
@@ -53,7 +53,7 @@ function TableHead({ ...props }: Omit<React.ComponentProps<'th'>, 'className'>)
|
|
|
53
53
|
return (
|
|
54
54
|
<th
|
|
55
55
|
data-slot="table-head"
|
|
56
|
-
className="text-foreground h-10 px-
|
|
56
|
+
className="text-muted-foreground h-10 px-3 text-left align-middle text-xs font-medium uppercase tracking-wide whitespace-nowrap [&:has([role=checkbox])]:pr-0 [[data-variant=bordered]_&]:border-r [[data-variant=bordered]_&]:last:border-r-0"
|
|
57
57
|
{...props}
|
|
58
58
|
/>
|
|
59
59
|
);
|
|
@@ -63,7 +63,7 @@ function TableCell({ ...props }: Omit<React.ComponentProps<'td'>, 'className'>)
|
|
|
63
63
|
return (
|
|
64
64
|
<td
|
|
65
65
|
data-slot="table-cell"
|
|
66
|
-
className="
|
|
66
|
+
className="px-3 py-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [[data-variant=bordered]_&]:border-r [[data-variant=bordered]_&]:last:border-r-0"
|
|
67
67
|
{...props}
|
|
68
68
|
/>
|
|
69
69
|
);
|
|
@@ -51,7 +51,7 @@ function TabsTrigger({ ...props }: Omit<TabsPrimitive.Tab.Props, 'className'>) {
|
|
|
51
51
|
return (
|
|
52
52
|
<TabsPrimitive.Tab
|
|
53
53
|
data-slot="tabs-trigger"
|
|
54
|
-
className="gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none group-data-[variant=underline]/tabs-list:data-active:shadow-none [&_svg:not([class*='size-'])]:size-4 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent group-data-[variant=underline]/tabs-list:bg-transparent group-data-[variant=underline]/tabs-list:data-active:bg-transparent group-data-[variant=underline]/tabs-list:px-
|
|
54
|
+
className="gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none group-data-[variant=underline]/tabs-list:data-active:shadow-none [&_svg:not([class*='size-'])]:size-4 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent group-data-[variant=underline]/tabs-list:bg-transparent group-data-[variant=underline]/tabs-list:data-active:bg-transparent group-data-[variant=underline]/tabs-list:px-4 group-data-[variant=underline]/tabs-list:py-3 group-data-[variant=underline]/tabs-list:mb-0 group-data-[variant=underline]/tabs-list:rounded-none group-data-[variant=underline]/tabs-list:border-none group-data-[variant=underline]/tabs-list:hover:bg-muted group-data-[variant=underline]/tabs-list:flex-none group-data-[variant=underline]/tabs-list:justify-start group-data-[variant=underline]/tabs-list:text-left dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=underline]/tabs-list:data-active:border-transparent dark:group-data-[variant=underline]/tabs-list:data-active:bg-transparent data-active:bg-background dark:data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 data-active:text-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:after:bg-foreground group-data-[variant=underline]/tabs-list:after:bg-primary group-data-[variant=line]/tabs-list:data-active:after:opacity-100 group-data-[variant=underline]/tabs-list:after:h-[3px] group-data-[variant=underline]/tabs-list:after:bottom-0 group-data-[variant=underline]/tabs-list:after:rounded-none group-data-[variant=underline]/tabs-list:h-auto group-data-[variant=underline]/tabs-list:data-active:after:opacity-100"
|
|
55
55
|
{...props}
|
|
56
56
|
/>
|
|
57
57
|
);
|
|
@@ -57,7 +57,7 @@ function AlertDialogFooter({ ...props }: Omit<React.ComponentProps<'div'>, 'clas
|
|
|
57
57
|
return (
|
|
58
58
|
<div
|
|
59
59
|
data-slot="alert-dialog-footer"
|
|
60
|
-
className="bg-muted
|
|
60
|
+
className="bg-muted -mx-4 -mb-4 rounded-b-xl border-t p-4 flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end"
|
|
61
61
|
{...props}
|
|
62
62
|
/>
|
|
63
63
|
);
|
|
@@ -69,8 +69,8 @@ const appShellSidebarVariants = cva(
|
|
|
69
69
|
{
|
|
70
70
|
variants: {
|
|
71
71
|
variant: {
|
|
72
|
-
default: 'bg-background border-r border-border
|
|
73
|
-
muted: 'bg-muted border-r border-border
|
|
72
|
+
default: 'bg-background border-r border-border',
|
|
73
|
+
muted: 'bg-muted border-r border-border',
|
|
74
74
|
primary: 'bg-primary border-r border-primary-foreground/10',
|
|
75
75
|
},
|
|
76
76
|
},
|
|
@@ -351,7 +351,7 @@ function AppShellBody({ children, ...props }: AppShellBodyProps) {
|
|
|
351
351
|
>
|
|
352
352
|
{/* Rail section - only show if there are rail items */}
|
|
353
353
|
{railContent && (
|
|
354
|
-
<div className="flex flex-col items-center w-16 shrink-0 py-3 gap-1 bg-muted border-r border-border
|
|
354
|
+
<div className="flex flex-col items-center w-16 shrink-0 py-3 gap-1 bg-muted border-r border-border">
|
|
355
355
|
{railContent}
|
|
356
356
|
</div>
|
|
357
357
|
)}
|
|
@@ -668,7 +668,7 @@ function AppShellSidebarHeader({ icon, title, description, action, children, ...
|
|
|
668
668
|
className={[
|
|
669
669
|
'flex items-center px-2 mb-2 border-b',
|
|
670
670
|
isSimpleHeader ? 'py-3' : 'gap-3 py-2',
|
|
671
|
-
'border-border
|
|
671
|
+
'border-border',
|
|
672
672
|
'[[data-variant=primary]_&]:border-primary-foreground/20',
|
|
673
673
|
].join(' ')}
|
|
674
674
|
{...props}
|
|
@@ -788,7 +788,7 @@ function AppShellNavFooter({ children, ...props }: AppShellNavFooterProps) {
|
|
|
788
788
|
data-slot="app-shell-nav-footer"
|
|
789
789
|
className={[
|
|
790
790
|
'mt-auto border-t pt-2 space-y-1',
|
|
791
|
-
'border-border
|
|
791
|
+
'border-border',
|
|
792
792
|
'[[data-variant=primary]_&]:border-primary-foreground/20',
|
|
793
793
|
].join(' ')}
|
|
794
794
|
{...props}
|
|
@@ -77,7 +77,7 @@ function DialogFooter({
|
|
|
77
77
|
return (
|
|
78
78
|
<div
|
|
79
79
|
data-slot="dialog-footer"
|
|
80
|
-
className="bg-muted
|
|
80
|
+
className="bg-muted -mx-4 -mb-4 rounded-b-xl border-t p-4 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end"
|
|
81
81
|
{...props}
|
|
82
82
|
>
|
|
83
83
|
{children}
|
|
@@ -4,7 +4,7 @@ import * as React from 'react';
|
|
|
4
4
|
import { cn } from '../../../lib/utils';
|
|
5
5
|
import { Stack } from '../atoms/stack';
|
|
6
6
|
|
|
7
|
-
const pageLayoutVariants = cva('min-h-
|
|
7
|
+
const pageLayoutVariants = cva('min-h-full bg-background text-foreground', {
|
|
8
8
|
variants: {
|
|
9
9
|
variant: {
|
|
10
10
|
default: 'flex flex-col',
|
package/src/styles/globals.css
CHANGED
|
@@ -89,19 +89,19 @@
|
|
|
89
89
|
--card-foreground: oklch(0.145 0 0);
|
|
90
90
|
--popover: oklch(1 0 0);
|
|
91
91
|
--popover-foreground: oklch(0.145 0 0);
|
|
92
|
-
--primary: oklch(0.
|
|
92
|
+
--primary: oklch(0.3797 0.077172 167.6784);
|
|
93
93
|
--primary-foreground: oklch(0.979 0.021 166.113);
|
|
94
94
|
--secondary: oklch(0.92 0.001 286.375);
|
|
95
95
|
--secondary-foreground: oklch(0.21 0.006 285.885);
|
|
96
|
-
--muted: oklch(0.
|
|
97
|
-
--muted-foreground: oklch(0.
|
|
98
|
-
--accent: oklch(0.
|
|
96
|
+
--muted: oklch(0.965 0 0);
|
|
97
|
+
--muted-foreground: oklch(0.45 0 0);
|
|
98
|
+
--accent: oklch(0.93 0 0);
|
|
99
99
|
--accent-foreground: oklch(0.205 0 0);
|
|
100
100
|
--destructive: oklch(0.58 0.22 27);
|
|
101
101
|
--success: oklch(0.6 0.16 145);
|
|
102
102
|
--warning: oklch(0.75 0.15 85);
|
|
103
103
|
--info: oklch(0.6 0.15 250);
|
|
104
|
-
--border: oklch(0.
|
|
104
|
+
--border: oklch(0.94 0 0);
|
|
105
105
|
--input: oklch(0.922 0 0);
|
|
106
106
|
--ring: oklch(0.708 0 0);
|
|
107
107
|
--chart-1: oklch(0.845 0.143 164.978);
|
|
@@ -114,9 +114,9 @@
|
|
|
114
114
|
--sidebar-foreground: oklch(0.145 0 0);
|
|
115
115
|
--sidebar-primary: oklch(0.596 0.145 163.225);
|
|
116
116
|
--sidebar-primary-foreground: oklch(0.979 0.021 166.113);
|
|
117
|
-
--sidebar-accent: oklch(0.
|
|
117
|
+
--sidebar-accent: oklch(0.93 0 0);
|
|
118
118
|
--sidebar-accent-foreground: oklch(0.205 0 0);
|
|
119
|
-
--sidebar-border: oklch(0.
|
|
119
|
+
--sidebar-border: oklch(0.95 0 0);
|
|
120
120
|
--sidebar-ring: oklch(0.708 0 0);
|
|
121
121
|
}
|
|
122
122
|
.dark {
|
|
@@ -130,15 +130,15 @@
|
|
|
130
130
|
--primary-foreground: oklch(0.262 0.051 172.552);
|
|
131
131
|
--secondary: oklch(0.274 0.006 286.033);
|
|
132
132
|
--secondary-foreground: oklch(0.985 0 0);
|
|
133
|
-
--muted: oklch(0.
|
|
134
|
-
--muted-foreground: oklch(0.
|
|
135
|
-
--accent: oklch(0.
|
|
133
|
+
--muted: oklch(0.18 0 0);
|
|
134
|
+
--muted-foreground: oklch(0.65 0 0);
|
|
135
|
+
--accent: oklch(0.22 0 0);
|
|
136
136
|
--accent-foreground: oklch(0.985 0 0);
|
|
137
137
|
--destructive: oklch(0.704 0.191 22.216);
|
|
138
138
|
--success: oklch(0.7 0.16 145);
|
|
139
139
|
--warning: oklch(0.8 0.15 85);
|
|
140
140
|
--info: oklch(0.7 0.15 250);
|
|
141
|
-
--border: oklch(
|
|
141
|
+
--border: oklch(0.2 0 0);
|
|
142
142
|
--input: oklch(1 0 0 / 15%);
|
|
143
143
|
--ring: oklch(0.556 0 0);
|
|
144
144
|
--chart-1: oklch(0.845 0.143 164.978);
|
|
@@ -150,9 +150,9 @@
|
|
|
150
150
|
--sidebar-foreground: oklch(0.985 0 0);
|
|
151
151
|
--sidebar-primary: oklch(0.696 0.17 162.48);
|
|
152
152
|
--sidebar-primary-foreground: oklch(0.262 0.051 172.552);
|
|
153
|
-
--sidebar-accent: oklch(0.
|
|
153
|
+
--sidebar-accent: oklch(0.22 0 0);
|
|
154
154
|
--sidebar-accent-foreground: oklch(0.985 0 0);
|
|
155
|
-
--sidebar-border: oklch(
|
|
155
|
+
--sidebar-border: oklch(0.2 0 0);
|
|
156
156
|
--sidebar-ring: oklch(0.556 0 0);
|
|
157
157
|
}
|
|
158
158
|
}
|
|
@@ -186,10 +186,10 @@
|
|
|
186
186
|
--color-chart-3: var(--chart-3);
|
|
187
187
|
--color-chart-4: var(--chart-4);
|
|
188
188
|
--color-chart-5: var(--chart-5);
|
|
189
|
-
--radius-sm: calc(var(--radius) -
|
|
190
|
-
--radius-md: calc(var(--radius) -
|
|
189
|
+
--radius-sm: calc(var(--radius) - 2px);
|
|
190
|
+
--radius-md: calc(var(--radius) - 1px);
|
|
191
191
|
--radius-lg: var(--radius);
|
|
192
|
-
--radius-xl: calc(var(--radius) +
|
|
192
|
+
--radius-xl: calc(var(--radius) + 2px);
|
|
193
193
|
--color-sidebar: var(--sidebar);
|
|
194
194
|
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
195
195
|
--color-sidebar-primary: var(--sidebar-primary);
|
|
@@ -211,6 +211,32 @@
|
|
|
211
211
|
@apply bg-background text-foreground;
|
|
212
212
|
font-family: var(--font-sans);
|
|
213
213
|
}
|
|
214
|
+
|
|
215
|
+
/* Custom scrollbar */
|
|
216
|
+
* {
|
|
217
|
+
scrollbar-width: thin;
|
|
218
|
+
scrollbar-color: var(--color-border) transparent;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
*::-webkit-scrollbar {
|
|
222
|
+
width: 8px;
|
|
223
|
+
height: 8px;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
*::-webkit-scrollbar-track {
|
|
227
|
+
background: transparent;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
*::-webkit-scrollbar-thumb {
|
|
231
|
+
background-color: var(--color-border);
|
|
232
|
+
border-radius: 4px;
|
|
233
|
+
border: 2px solid transparent;
|
|
234
|
+
background-clip: content-box;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
*::-webkit-scrollbar-thumb:hover {
|
|
238
|
+
background-color: var(--color-muted-foreground);
|
|
239
|
+
}
|
|
214
240
|
}
|
|
215
241
|
|
|
216
242
|
/* Lausanne-only weight mapping.
|
|
@@ -223,6 +249,9 @@
|
|
|
223
249
|
font-weight: 400;
|
|
224
250
|
}
|
|
225
251
|
.font-semibold {
|
|
252
|
+
font-weight: 400;
|
|
253
|
+
}
|
|
254
|
+
.font-bold {
|
|
226
255
|
font-weight: 700;
|
|
227
256
|
}
|
|
228
257
|
}
|