@trycompai/design-system 1.0.1 → 1.0.3

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.
Files changed (65) hide show
  1. package/package.json +11 -3
  2. package/src/components/atoms/badge.tsx +8 -7
  3. package/src/components/atoms/button.tsx +6 -1
  4. package/src/components/atoms/checkbox.tsx +3 -3
  5. package/src/components/atoms/heading.tsx +6 -6
  6. package/src/components/atoms/index.ts +2 -0
  7. package/src/components/atoms/logo.tsx +52 -0
  8. package/src/components/atoms/spinner.tsx +3 -3
  9. package/src/components/atoms/stack.tsx +97 -0
  10. package/src/components/atoms/switch.tsx +1 -1
  11. package/src/components/atoms/text.tsx +5 -1
  12. package/src/components/atoms/toggle.tsx +1 -1
  13. package/src/components/molecules/accordion.tsx +3 -3
  14. package/src/components/molecules/ai-chat.tsx +217 -0
  15. package/src/components/molecules/alert.tsx +5 -5
  16. package/src/components/molecules/breadcrumb.tsx +8 -7
  17. package/src/components/molecules/card.tsx +24 -5
  18. package/src/components/molecules/command-search.tsx +147 -0
  19. package/src/components/molecules/index.ts +4 -1
  20. package/src/components/molecules/input-otp.tsx +2 -2
  21. package/src/components/molecules/page-header.tsx +33 -4
  22. package/src/components/molecules/pagination.tsx +4 -4
  23. package/src/components/molecules/popover.tsx +4 -2
  24. package/src/components/molecules/radio-group.tsx +2 -2
  25. package/src/components/molecules/section.tsx +1 -1
  26. package/src/components/molecules/select.tsx +5 -5
  27. package/src/components/molecules/settings.tsx +169 -0
  28. package/src/components/molecules/table.tsx +5 -1
  29. package/src/components/molecules/tabs.tsx +5 -4
  30. package/src/components/molecules/theme-switcher.tsx +176 -0
  31. package/src/components/organisms/app-shell.tsx +822 -0
  32. package/src/components/organisms/calendar.tsx +4 -4
  33. package/src/components/organisms/carousel.tsx +3 -3
  34. package/src/components/organisms/combobox.tsx +5 -5
  35. package/src/components/organisms/command.tsx +3 -3
  36. package/src/components/organisms/context-menu.tsx +4 -4
  37. package/src/components/organisms/dialog.tsx +2 -2
  38. package/src/components/organisms/dropdown-menu.tsx +8 -6
  39. package/src/components/organisms/index.ts +1 -0
  40. package/src/components/organisms/menubar.tsx +3 -3
  41. package/src/components/organisms/navigation-menu.tsx +2 -2
  42. package/src/components/organisms/page-layout.tsx +50 -20
  43. package/src/components/organisms/sheet.tsx +2 -2
  44. package/src/components/organisms/sidebar.tsx +22 -6
  45. package/src/components/organisms/sonner.tsx +11 -11
  46. package/src/fonts/TWKLausanne/TWKLausanne-300-Italic.woff +0 -0
  47. package/src/fonts/TWKLausanne/TWKLausanne-300-Italic.woff2 +0 -0
  48. package/src/fonts/TWKLausanne/TWKLausanne-300.woff +0 -0
  49. package/src/fonts/TWKLausanne/TWKLausanne-300.woff2 +0 -0
  50. package/src/fonts/TWKLausanne/TWKLausanne-350-Italic.woff +0 -0
  51. package/src/fonts/TWKLausanne/TWKLausanne-350-Italic.woff2 +0 -0
  52. package/src/fonts/TWKLausanne/TWKLausanne-350.woff +0 -0
  53. package/src/fonts/TWKLausanne/TWKLausanne-350.woff2 +0 -0
  54. package/src/fonts/TWKLausanne/TWKLausanne-400-Italic.woff +0 -0
  55. package/src/fonts/TWKLausanne/TWKLausanne-400-Italic.woff2 +0 -0
  56. package/src/fonts/TWKLausanne/TWKLausanne-400.woff +0 -0
  57. package/src/fonts/TWKLausanne/TWKLausanne-400.woff2 +0 -0
  58. package/src/fonts/TWKLausanne/TWKLausanne-700-Italic.woff +0 -0
  59. package/src/fonts/TWKLausanne/TWKLausanne-700-Italic.woff2 +0 -0
  60. package/src/fonts/TWKLausanne/TWKLausanne-700.woff +0 -0
  61. package/src/fonts/TWKLausanne/TWKLausanne-700.woff2 +0 -0
  62. package/src/icons.ts +2 -0
  63. package/src/index.ts +2 -2
  64. package/src/styles/globals.css +155 -23
  65. package/src/components/molecules/stack.tsx +0 -72
@@ -1,6 +1,80 @@
1
1
  @import 'tailwindcss';
2
2
  @import 'tw-animate-css';
3
3
 
4
+ /* Ramp font: Lausanne */
5
+ @font-face {
6
+ font-family: 'Lausanne';
7
+ src:
8
+ url('../fonts/TWKLausanne/TWKLausanne-300.woff2') format('woff2'),
9
+ url('../fonts/TWKLausanne/TWKLausanne-300.woff') format('woff');
10
+ font-weight: 300;
11
+ font-style: normal;
12
+ font-display: swap;
13
+ }
14
+ @font-face {
15
+ font-family: 'Lausanne';
16
+ src:
17
+ url('../fonts/TWKLausanne/TWKLausanne-300-Italic.woff2') format('woff2'),
18
+ url('../fonts/TWKLausanne/TWKLausanne-300-Italic.woff') format('woff');
19
+ font-weight: 300;
20
+ font-style: italic;
21
+ font-display: swap;
22
+ }
23
+ @font-face {
24
+ font-family: 'Lausanne';
25
+ src:
26
+ url('../fonts/TWKLausanne/TWKLausanne-350.woff2') format('woff2'),
27
+ url('../fonts/TWKLausanne/TWKLausanne-350.woff') format('woff');
28
+ font-weight: 350;
29
+ font-style: normal;
30
+ font-display: swap;
31
+ }
32
+ @font-face {
33
+ font-family: 'Lausanne';
34
+ src:
35
+ url('../fonts/TWKLausanne/TWKLausanne-350-Italic.woff2') format('woff2'),
36
+ url('../fonts/TWKLausanne/TWKLausanne-350-Italic.woff') format('woff');
37
+ font-weight: 350;
38
+ font-style: italic;
39
+ font-display: swap;
40
+ }
41
+ @font-face {
42
+ font-family: 'Lausanne';
43
+ src:
44
+ url('../fonts/TWKLausanne/TWKLausanne-400.woff2') format('woff2'),
45
+ url('../fonts/TWKLausanne/TWKLausanne-400.woff') format('woff');
46
+ font-weight: 400;
47
+ font-style: normal;
48
+ font-display: swap;
49
+ }
50
+ @font-face {
51
+ font-family: 'Lausanne';
52
+ src:
53
+ url('../fonts/TWKLausanne/TWKLausanne-400-Italic.woff2') format('woff2'),
54
+ url('../fonts/TWKLausanne/TWKLausanne-400-Italic.woff') format('woff');
55
+ font-weight: 400;
56
+ font-style: italic;
57
+ font-display: swap;
58
+ }
59
+ @font-face {
60
+ font-family: 'Lausanne';
61
+ src:
62
+ url('../fonts/TWKLausanne/TWKLausanne-700.woff2') format('woff2'),
63
+ url('../fonts/TWKLausanne/TWKLausanne-700.woff') format('woff');
64
+ font-weight: 700;
65
+ font-style: normal;
66
+ font-display: swap;
67
+ }
68
+ @font-face {
69
+ font-family: 'Lausanne';
70
+ src:
71
+ url('../fonts/TWKLausanne/TWKLausanne-700-Italic.woff2') format('woff2'),
72
+ url('../fonts/TWKLausanne/TWKLausanne-700-Italic.woff') format('woff');
73
+ font-weight: 700;
74
+ font-style: italic;
75
+ font-display: swap;
76
+ }
77
+
4
78
  /* Include design system components in Tailwind's content scan */
5
79
  @source "../components/**/*.tsx";
6
80
 
@@ -8,19 +82,20 @@
8
82
 
9
83
  @layer base {
10
84
  :root {
85
+ --font-sans: 'Lausanne', ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
11
86
  --background: oklch(1 0 0);
12
87
  --foreground: oklch(0.145 0 0);
13
88
  --card: oklch(1 0 0);
14
89
  --card-foreground: oklch(0.145 0 0);
15
90
  --popover: oklch(1 0 0);
16
91
  --popover-foreground: oklch(0.145 0 0);
17
- --primary: oklch(0.6 0.13 163);
18
- --primary-foreground: oklch(0.98 0.02 166);
19
- --secondary: oklch(0.967 0.001 286.375);
92
+ --primary: oklch(0.596 0.145 163.225);
93
+ --primary-foreground: oklch(0.979 0.021 166.113);
94
+ --secondary: oklch(0.92 0.001 286.375);
20
95
  --secondary-foreground: oklch(0.21 0.006 285.885);
21
- --muted: oklch(0.97 0 0);
96
+ --muted: oklch(0.91 0 0);
22
97
  --muted-foreground: oklch(0.556 0 0);
23
- --accent: oklch(0.97 0 0);
98
+ --accent: oklch(0.91 0 0);
24
99
  --accent-foreground: oklch(0.205 0 0);
25
100
  --destructive: oklch(0.58 0.22 27);
26
101
  --success: oklch(0.6 0.16 145);
@@ -29,17 +104,17 @@
29
104
  --border: oklch(0.922 0 0);
30
105
  --input: oklch(0.922 0 0);
31
106
  --ring: oklch(0.708 0 0);
32
- --chart-1: oklch(0.85 0.13 165);
33
- --chart-2: oklch(0.77 0.15 163);
34
- --chart-3: oklch(0.7 0.15 162);
35
- --chart-4: oklch(0.6 0.13 163);
36
- --chart-5: oklch(0.51 0.1 166);
37
- --radius: 0.45rem;
107
+ --chart-1: oklch(0.845 0.143 164.978);
108
+ --chart-2: oklch(0.765 0.177 163.223);
109
+ --chart-3: oklch(0.696 0.17 162.48);
110
+ --chart-4: oklch(0.596 0.145 163.225);
111
+ --chart-5: oklch(0.508 0.118 165.612);
112
+ --radius: 0.3rem;
38
113
  --sidebar: oklch(0.985 0 0);
39
114
  --sidebar-foreground: oklch(0.145 0 0);
40
- --sidebar-primary: oklch(0.6 0.13 163);
41
- --sidebar-primary-foreground: oklch(0.98 0.02 166);
42
- --sidebar-accent: oklch(0.97 0 0);
115
+ --sidebar-primary: oklch(0.596 0.145 163.225);
116
+ --sidebar-primary-foreground: oklch(0.979 0.021 166.113);
117
+ --sidebar-accent: oklch(0.91 0 0);
43
118
  --sidebar-accent-foreground: oklch(0.205 0 0);
44
119
  --sidebar-border: oklch(0.922 0 0);
45
120
  --sidebar-ring: oklch(0.708 0 0);
@@ -51,8 +126,8 @@
51
126
  --card-foreground: oklch(0.985 0 0);
52
127
  --popover: oklch(0.205 0 0);
53
128
  --popover-foreground: oklch(0.985 0 0);
54
- --primary: oklch(0.7 0.15 162);
55
- --primary-foreground: oklch(0.26 0.05 173);
129
+ --primary: oklch(0.696 0.17 162.48);
130
+ --primary-foreground: oklch(0.262 0.051 172.552);
56
131
  --secondary: oklch(0.274 0.006 286.033);
57
132
  --secondary-foreground: oklch(0.985 0 0);
58
133
  --muted: oklch(0.269 0 0);
@@ -66,15 +141,15 @@
66
141
  --border: oklch(1 0 0 / 10%);
67
142
  --input: oklch(1 0 0 / 15%);
68
143
  --ring: oklch(0.556 0 0);
69
- --chart-1: oklch(0.85 0.13 165);
70
- --chart-2: oklch(0.77 0.15 163);
71
- --chart-3: oklch(0.7 0.15 162);
72
- --chart-4: oklch(0.6 0.13 163);
73
- --chart-5: oklch(0.51 0.1 166);
144
+ --chart-1: oklch(0.845 0.143 164.978);
145
+ --chart-2: oklch(0.765 0.177 163.223);
146
+ --chart-3: oklch(0.696 0.17 162.48);
147
+ --chart-4: oklch(0.596 0.145 163.225);
148
+ --chart-5: oklch(0.508 0.118 165.612);
74
149
  --sidebar: oklch(0.205 0 0);
75
150
  --sidebar-foreground: oklch(0.985 0 0);
76
- --sidebar-primary: oklch(0.77 0.15 163);
77
- --sidebar-primary-foreground: oklch(0.26 0.05 173);
151
+ --sidebar-primary: oklch(0.696 0.17 162.48);
152
+ --sidebar-primary-foreground: oklch(0.262 0.051 172.552);
78
153
  --sidebar-accent: oklch(0.269 0 0);
79
154
  --sidebar-accent-foreground: oklch(0.985 0 0);
80
155
  --sidebar-border: oklch(1 0 0 / 10%);
@@ -83,6 +158,7 @@
83
158
  }
84
159
 
85
160
  @theme inline {
161
+ --font-sans: 'Lausanne', ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
86
162
  --color-background: var(--background);
87
163
  --color-foreground: var(--foreground);
88
164
  --color-card: var(--card);
@@ -128,7 +204,63 @@
128
204
  * {
129
205
  @apply border-border outline-ring/50;
130
206
  }
207
+ html {
208
+ font-family: var(--font-sans);
209
+ }
131
210
  body {
132
211
  @apply bg-background text-foreground;
212
+ font-family: var(--font-sans);
213
+ }
214
+ }
215
+
216
+ /* Lausanne-only weight mapping.
217
+ We DO NOT have 500/600 files, so make Tailwind's common semantic weights resolve to real faces. */
218
+ @layer utilities {
219
+ .font-normal {
220
+ font-weight: 350;
221
+ }
222
+ .font-medium {
223
+ font-weight: 400;
224
+ }
225
+ .font-semibold {
226
+ font-weight: 700;
227
+ }
228
+ }
229
+
230
+ /* View Transitions API for smooth page transitions */
231
+ @view-transition {
232
+ navigation: auto;
233
+ }
234
+
235
+ ::view-transition-old(page-content) {
236
+ animation: fade-out 250ms ease-out forwards;
237
+ }
238
+
239
+ ::view-transition-new(page-content) {
240
+ animation: fade-in 250ms ease-out forwards;
241
+ }
242
+
243
+ @keyframes fade-out {
244
+ from { opacity: 1; }
245
+ to { opacity: 0; }
246
+ }
247
+
248
+ @keyframes fade-in {
249
+ from { opacity: 0; }
250
+ to { opacity: 1; }
251
+ }
252
+
253
+ /* Page content animation fallback for non-View Transitions browsers */
254
+ [data-slot="page-layout"] {
255
+ view-transition-name: page-content;
256
+ animation: page-enter 250ms ease-out;
257
+ }
258
+
259
+ @keyframes page-enter {
260
+ from {
261
+ opacity: 0;
262
+ }
263
+ to {
264
+ opacity: 1;
133
265
  }
134
266
  }
@@ -1,72 +0,0 @@
1
- import { cva, type VariantProps } from 'class-variance-authority';
2
- import * as React from 'react';
3
-
4
- const stackVariants = cva('flex', {
5
- variants: {
6
- direction: {
7
- row: 'flex-row',
8
- column: 'flex-col',
9
- 'row-reverse': 'flex-row-reverse',
10
- 'column-reverse': 'flex-col-reverse',
11
- },
12
- align: {
13
- start: 'items-start',
14
- center: 'items-center',
15
- end: 'items-end',
16
- stretch: 'items-stretch',
17
- baseline: 'items-baseline',
18
- },
19
- textAlign: {
20
- left: 'text-left',
21
- center: 'text-center',
22
- right: 'text-right',
23
- },
24
- justify: {
25
- start: 'justify-start',
26
- center: 'justify-center',
27
- end: 'justify-end',
28
- between: 'justify-between',
29
- around: 'justify-around',
30
- evenly: 'justify-evenly',
31
- },
32
- gap: {
33
- '0': 'gap-0',
34
- '0.5': 'gap-0.5',
35
- '1': 'gap-1',
36
- '1.5': 'gap-1.5',
37
- '2': 'gap-2',
38
- '2.5': 'gap-2.5',
39
- '3': 'gap-3',
40
- '4': 'gap-4',
41
- '5': 'gap-5',
42
- '6': 'gap-6',
43
- '8': 'gap-8',
44
- '10': 'gap-10',
45
- '12': 'gap-12',
46
- },
47
- wrap: {
48
- true: 'flex-wrap',
49
- false: 'flex-nowrap',
50
- },
51
- },
52
- defaultVariants: {
53
- direction: 'column',
54
- gap: '0',
55
- wrap: false,
56
- },
57
- });
58
-
59
- interface StackProps
60
- extends Omit<React.ComponentProps<'div'>, 'className'>, VariantProps<typeof stackVariants> {}
61
-
62
- function Stack({ direction, align, justify, gap, wrap, textAlign, ...props }: StackProps) {
63
- return (
64
- <div
65
- data-slot="stack"
66
- className={stackVariants({ direction, align, justify, gap, wrap, textAlign })}
67
- {...props}
68
- />
69
- );
70
- }
71
-
72
- export { Stack, stackVariants };