@sniptide/ui 0.1.1 → 0.2.1

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 (38) hide show
  1. package/README.md +26 -7
  2. package/package.json +14 -32
  3. package/src/components/alert-dialog.tsx +3 -3
  4. package/src/components/avatar.tsx +1 -1
  5. package/src/components/badge.tsx +1 -1
  6. package/src/components/button.tsx +72 -13
  7. package/src/components/checkbox.tsx +24 -0
  8. package/src/components/combobox.tsx +127 -0
  9. package/src/components/dialog.tsx +3 -3
  10. package/src/components/dropdown-menu.tsx +35 -8
  11. package/src/components/form-error.tsx +33 -0
  12. package/src/components/input.tsx +1 -1
  13. package/src/components/kbd.tsx +1 -1
  14. package/src/components/logo.tsx +173 -31
  15. package/src/components/popover.tsx +40 -0
  16. package/src/components/progress.tsx +1 -1
  17. package/src/components/reveal.tsx +51 -0
  18. package/src/components/segmented-control.tsx +2 -2
  19. package/src/components/select.tsx +3 -3
  20. package/src/components/sheet.tsx +60 -4
  21. package/src/components/skeleton.tsx +15 -0
  22. package/src/components/spinner.tsx +33 -0
  23. package/src/components/step-slider.tsx +83 -0
  24. package/src/components/stripes.tsx +22 -12
  25. package/src/components/success-check.tsx +27 -0
  26. package/src/components/switch.tsx +2 -2
  27. package/src/components/table.tsx +124 -7
  28. package/src/components/tabs.tsx +1 -1
  29. package/src/components/textarea.tsx +1 -1
  30. package/src/components/toast.tsx +140 -0
  31. package/src/components/tooltip.tsx +1 -1
  32. package/src/fonts/OFL.txt +93 -0
  33. package/src/fonts/PaperMono-Regular.ttf +0 -0
  34. package/src/fonts/PaperMono[wght].ttf +0 -0
  35. package/src/lib/confetti.ts +112 -0
  36. package/src/lib/logo-paths.ts +17 -0
  37. package/src/styles/globals.css +121 -20
  38. package/src/styles/shadcn.css +677 -0
@@ -1,11 +1,12 @@
1
1
  @import "tailwindcss";
2
2
  @import "tw-animate-css";
3
- @import "shadcn/tailwind.css";
3
+ @import "./shadcn.css";
4
4
 
5
5
  @custom-variant dark (&:is(.dark *));
6
6
  @source "../**/*.{ts,tsx}";
7
7
 
8
- /* Sniptide palette, taken from the Paper designs. Corners are square everywhere (--radius: 0). */
8
+ /* Sniptide palette, taken from the Paper designs. --radius is the one knob for corner rounding:
9
+ rounded-lg uses it as is, rounded-md and rounded-sm are 0.8x and 0.6x of it. */
9
10
  :root {
10
11
  --background: #ffffff;
11
12
  --foreground: #1b1919;
@@ -30,7 +31,7 @@
30
31
  --chart-3: #6b6b6b;
31
32
  --chart-4: #8a8a8a;
32
33
  --chart-5: #e8e8e8;
33
- --radius: 0rem;
34
+ --radius: 0.375rem;
34
35
  --sidebar: #fafafa;
35
36
  --sidebar-foreground: #1b1919;
36
37
  --sidebar-primary: #2a26ec;
@@ -39,40 +40,94 @@
39
40
  --sidebar-accent-foreground: #1b1919;
40
41
  --sidebar-border: #e8e8e8;
41
42
  --sidebar-ring: #2a26ec;
43
+ /* Floating layers: a hairline border plus a soft shadow. Menus and popovers sit close to the
44
+ page, dialogs and standalone cards float higher. */
45
+ --float-shadow: 0 1px 2px rgb(27 25 25 / 0.06), 0 8px 24px -6px rgb(27 25 25 / 0.14);
46
+ --dialog-shadow: 0 2px 4px rgb(27 25 25 / 0.06), 0 24px 48px -12px rgb(27 25 25 / 0.22);
47
+ --logo-primary: #2a26ec;
48
+ --logo-ink: #1b1919;
49
+ --logo-hatch: #000000;
50
+ --link: #2a26ec;
51
+ /* Pink is the second brand colour. It marks what stands out without being an action: search
52
+ matches, stars, the peak of a chart. --pink is the surface with --pink-foreground on it;
53
+ --highlight is pink for icons and chart marks, deep enough in light mode to clear 3:1. */
54
+ --pink: #f6a9d3;
55
+ --pink-foreground: #2b0a1f;
56
+ --highlight: #e353ac;
57
+ /* Code colours. Keywords are the brand blue; the rest stay muted enough that blue still leads.
58
+ All clear 4.5:1 on the code backgrounds (white, --sidebar). */
59
+ --syntax-foreground: #1b1919;
60
+ --syntax-keyword: #2a26ec;
61
+ --syntax-string: #047857;
62
+ --syntax-constant: #b45309;
63
+ --syntax-function: #6d28d9;
64
+ --syntax-type: #0e7490;
65
+ --syntax-property: #be123c;
66
+ --syntax-comment: #6b6b6b;
67
+ --syntax-punctuation: #4a4747;
68
+ --syntax-link: #2a26ec;
69
+ --syntax-invalid: oklch(0.577 0.245 27.325);
42
70
  }
43
71
 
44
72
  .dark {
45
- --background: #1b1919;
73
+ --background: #121111;
46
74
  --foreground: #f4f4f4;
47
- --card: #232121;
75
+ --card: #1a1919;
48
76
  --card-foreground: #f4f4f4;
49
- --popover: #232121;
77
+ --popover: #1a1919;
50
78
  --popover-foreground: #f4f4f4;
51
- --primary: #4b48f0;
79
+ --primary: #2a26ec;
52
80
  --primary-foreground: #ffffff;
53
- --secondary: #2c2a2a;
81
+ --secondary: #242222;
54
82
  --secondary-foreground: #f4f4f4;
55
- --muted: #2c2a2a;
83
+ --muted: #242222;
56
84
  --muted-foreground: #a3a3a3;
57
- --accent: #2c2a2a;
85
+ --accent: #242222;
58
86
  --accent-foreground: #f4f4f4;
59
87
  --destructive: oklch(0.704 0.191 22.216);
60
- --border: #3a3737;
61
- --input: #3a3737;
62
- --ring: #4b48f0;
63
- --chart-1: #4b48f0;
88
+ --border: #2f2c2c;
89
+ --input: #2f2c2c;
90
+ --ring: #8f8cff;
91
+ --chart-1: #2a26ec;
64
92
  --chart-2: #f4f4f4;
65
93
  --chart-3: #a3a3a3;
66
94
  --chart-4: #6b6b6b;
67
- --chart-5: #3a3737;
68
- --sidebar: #151313;
95
+ --chart-5: #2f2c2c;
96
+ --sidebar: #0c0b0b;
69
97
  --sidebar-foreground: #f4f4f4;
70
- --sidebar-primary: #4b48f0;
98
+ --sidebar-primary: #2a26ec;
71
99
  --sidebar-primary-foreground: #ffffff;
72
- --sidebar-accent: #2c2a2a;
100
+ --sidebar-accent: #242222;
73
101
  --sidebar-accent-foreground: #f4f4f4;
74
- --sidebar-border: #3a3737;
75
- --sidebar-ring: #4b48f0;
102
+ --sidebar-border: #2f2c2c;
103
+ --sidebar-ring: #8f8cff;
104
+ /* Darker and denser in dark mode, where a light shadow would not read. */
105
+ --float-shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px -6px rgb(0 0 0 / 0.6);
106
+ --dialog-shadow: 0 2px 4px rgb(0 0 0 / 0.4), 0 24px 48px -12px rgb(0 0 0 / 0.7);
107
+ /* The inverse logo from the Paper brand page: its own deep blue, light grey blocks and dim
108
+ hatching. */
109
+ --logo-primary: #1b17c6;
110
+ --logo-ink: #dfdfdf;
111
+ --logo-hatch: #535151;
112
+ /* One blue, two weights. Tide Blue fills buttons and chart bars in both themes (white on it is
113
+ 8.1:1) but is too dark to read as text on these surfaces (2.3:1), so links, focus rings,
114
+ code keywords and blue collection icons use its light tint, the same one the landing uses
115
+ (6.6:1). */
116
+ --link: #8f8cff;
117
+ --highlight: #f6a9d3;
118
+ /* Keywords share the link blue; the rest are the light palette lifted to read on the dark
119
+ surfaces. */
120
+ --syntax-foreground: #f4f4f4;
121
+ --syntax-keyword: #8f8cff;
122
+ --syntax-string: #5fd3a8;
123
+ --syntax-constant: #f5b971;
124
+ --syntax-function: #c4b5fd;
125
+ --syntax-type: #67d4e8;
126
+ --syntax-property: #fb9fb1;
127
+ --syntax-comment: #8a8a8a;
128
+ --syntax-punctuation: #b0b0b0;
129
+ --syntax-link: #8f8cff;
130
+ --syntax-invalid: oklch(0.704 0.191 22.216);
76
131
  }
77
132
 
78
133
  @theme inline {
@@ -114,6 +169,13 @@
114
169
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
115
170
  --color-sidebar-border: var(--sidebar-border);
116
171
  --color-sidebar-ring: var(--sidebar-ring);
172
+ --color-logo-primary: var(--logo-primary);
173
+ --color-logo-ink: var(--logo-ink);
174
+ --color-logo-hatch: var(--logo-hatch);
175
+ --color-link: var(--link);
176
+ --color-pink: var(--pink);
177
+ --color-pink-foreground: var(--pink-foreground);
178
+ --color-highlight: var(--highlight);
117
179
  --font-sans: var(--font-sans);
118
180
  --font-heading: var(--font-heading);
119
181
  --font-mono: var(--font-mono);
@@ -131,3 +193,42 @@
131
193
  cursor: pointer;
132
194
  }
133
195
  }
196
+
197
+ /* A thin scrollbar that stays out of the way: invisible until the area is hovered, then a faint
198
+ thumb with no track. */
199
+ @utility scrollbar-subtle {
200
+ scrollbar-width: thin;
201
+ scrollbar-color: transparent transparent;
202
+ transition: scrollbar-color 150ms;
203
+
204
+ &:hover {
205
+ scrollbar-color: color-mix(in oklab, var(--foreground) 18%, transparent) transparent;
206
+ }
207
+
208
+ /* For browsers without scrollbar-color. */
209
+ &::-webkit-scrollbar {
210
+ width: 6px;
211
+ }
212
+ &::-webkit-scrollbar-thumb {
213
+ background: transparent;
214
+ }
215
+ &:hover::-webkit-scrollbar-thumb {
216
+ background: color-mix(in oklab, var(--foreground) 18%, transparent);
217
+ }
218
+ }
219
+
220
+ /* A small springy pop, used when a value label changes (the step slider). */
221
+ @theme {
222
+ --animate-pop: pop 320ms cubic-bezier(0.34, 1.56, 0.64, 1);
223
+
224
+ @keyframes pop {
225
+ from {
226
+ opacity: 0.4;
227
+ transform: translateY(3px) scale(0.92);
228
+ }
229
+ to {
230
+ opacity: 1;
231
+ transform: none;
232
+ }
233
+ }
234
+ }