@vvedantb/ui 0.2.0 → 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 (59) hide show
  1. package/README.md +26 -1
  2. package/app/README.md +100 -0
  3. package/app/src/confirm/ConfirmSkipHint.tsx +1 -1
  4. package/app/src/settings/SettingsEmptyState.tsx +2 -2
  5. package/app/src/settings/SettingsField.tsx +1 -1
  6. package/app/src/settings/SettingsSection.tsx +1 -1
  7. package/app/src/settings/SettingsToggleRow.tsx +1 -1
  8. package/package.json +13 -9
  9. package/shell/src/PillTabs.tsx +1 -1
  10. package/src/ai-elements/artifact.tsx +1 -1
  11. package/src/ai-elements/attachments.tsx +3 -3
  12. package/src/ai-elements/chain-of-thought.tsx +5 -5
  13. package/src/ai-elements/code-block.tsx +2 -2
  14. package/src/ai-elements/conversation.tsx +2 -2
  15. package/src/ai-elements/inline-citation.tsx +6 -6
  16. package/src/ai-elements/message.tsx +2 -2
  17. package/src/ai-elements/prompt-input.tsx +3 -3
  18. package/src/ai-elements/queue.tsx +2 -2
  19. package/src/ai-elements/reasoning.tsx +1 -1
  20. package/src/ai-elements/shimmer.tsx +5 -5
  21. package/src/ai-elements/sources.tsx +2 -2
  22. package/src/ai-elements/speech-input.tsx +1 -1
  23. package/src/ai-elements/suggestion.tsx +1 -1
  24. package/src/ui/_menu-classes.alt.ts +2 -2
  25. package/src/ui/_menu-classes.ts +2 -2
  26. package/src/ui/accordion.alt.tsx +2 -2
  27. package/src/ui/badge.tsx +1 -1
  28. package/src/ui/breadcrumb.tsx +2 -2
  29. package/src/ui/button.tsx +3 -3
  30. package/src/ui/checkbox.tsx +1 -1
  31. package/src/ui/clear-input.alt.tsx +1 -1
  32. package/src/ui/clear-input.tsx +1 -1
  33. package/src/ui/command.tsx +5 -5
  34. package/src/ui/dialog.tsx +1 -1
  35. package/src/ui/input-group.alt.tsx +1 -1
  36. package/src/ui/input-group.tsx +2 -2
  37. package/src/ui/kbd.tsx +1 -1
  38. package/src/ui/labeled-switch-row.tsx +2 -2
  39. package/src/ui/progress.tsx +1 -1
  40. package/src/ui/radix-select.tsx +3 -3
  41. package/src/ui/search-input.tsx +1 -1
  42. package/src/ui/select.tsx +4 -4
  43. package/src/ui/sonner.tsx +5 -5
  44. package/src/ui/spinner.tsx +1 -1
  45. package/src/ui/switch.tsx +2 -2
  46. package/src/ui/table.tsx +2 -2
  47. package/src/ui/time-picker.tsx +3 -3
  48. package/tokens/README.md +98 -0
  49. package/tokens/examples/compat-shadcn-rgb/Fixture.tsx +45 -0
  50. package/tokens/examples/compat-shadcn-rgb/README.md +11 -0
  51. package/tokens/examples/compat-shadcn-rgb/index.html +12 -0
  52. package/tokens/examples/compat-shadcn-rgb/main.tsx +5 -0
  53. package/tokens/examples/compat-shadcn-rgb/package.json +14 -0
  54. package/tokens/examples/compat-shadcn-rgb/styles.css +67 -0
  55. package/tokens/examples/compat-shadcn-rgb/tsconfig.json +14 -0
  56. package/tokens/examples/compat-shadcn-rgb/vite.config.ts +11 -0
  57. package/tokens/src/css/compat-shadcn-rgb.css +75 -0
  58. package/tokens/src/tailwind-preset.mjs +6 -0
  59. package/tokens/src/tokens.css +15 -0
@@ -0,0 +1,75 @@
1
+ /*
2
+ * @vvedantb/ui/tokens/css/compat-shadcn-rgb.css
3
+ *
4
+ * For apps that already define shadcn-style variables as space-separated RGB
5
+ * channels (for example `--background: 244 245 246`) and read them with
6
+ * `rgb(var(--x) / alpha)`.
7
+ *
8
+ * Import this file INSTEAD OF tokens.css. Never import both: they define the
9
+ * same `--color-*` names in different forms.
10
+ *
11
+ * @import "tailwindcss";
12
+ * @import "@vvedantb/ui/tokens/css/compat-shadcn-rgb.css";
13
+ *
14
+ * It defines only the names that @vvedantb/ui components use and that a
15
+ * shadcn theme lacks. Every value is a reference to an app variable; no
16
+ * colour is copied. It never defines --background, --foreground, --muted,
17
+ * --accent, --primary, --card, --popover, --border or --radius. The app owns
18
+ * those and may change them at runtime.
19
+ *
20
+ * The app must define: --background, --foreground, --card, --card-foreground,
21
+ * --popover, --popover-foreground, --primary, --primary-foreground,
22
+ * --secondary, --secondary-foreground, --muted, --muted-foreground,
23
+ * --accent, --accent-foreground, --destructive, --destructive-foreground,
24
+ * --border, --input, --ring and --radius (all colours as "R G B").
25
+ *
26
+ * Alpha values follow common shadcn-RGB classes (ring/35, ring/50,
27
+ * destructive/20, placeholder /90, scrollbar /35).
28
+ */
29
+
30
+ @theme inline {
31
+ --color-default: rgb(var(--secondary));
32
+ --color-default-foreground: rgb(var(--secondary-foreground));
33
+ --color-surface: rgb(var(--card));
34
+ --color-surface-foreground: rgb(var(--card-foreground));
35
+ --color-surface-card: rgb(var(--card));
36
+ --color-surface-secondary: rgb(var(--muted));
37
+ --color-surface-secondary-foreground: rgb(var(--foreground));
38
+ --color-surface-tertiary: rgb(var(--secondary));
39
+ --color-surface-tertiary-foreground: rgb(var(--secondary-foreground));
40
+ --color-overlay: rgb(var(--popover));
41
+ --color-overlay-foreground: rgb(var(--popover-foreground));
42
+ --color-field-background: rgb(var(--card));
43
+ --color-field-foreground: rgb(var(--foreground));
44
+ --color-field-border: rgb(var(--input));
45
+ --color-field-placeholder: rgb(var(--muted-foreground) / 0.9);
46
+ --color-focus: rgb(var(--ring));
47
+ --color-focus-ring: rgb(var(--ring) / 0.35);
48
+ --color-focus-border: rgb(var(--ring) / 0.5);
49
+ --color-danger: rgb(var(--destructive));
50
+ --color-danger-foreground: rgb(var(--destructive-foreground));
51
+ --color-danger-ring: rgb(var(--destructive) / 0.2);
52
+ --color-danger-border: rgb(var(--destructive) / 0.55);
53
+ --color-separator: rgb(var(--border));
54
+ --color-segment: rgb(var(--card));
55
+ --color-segment-foreground: rgb(var(--foreground));
56
+ --color-backdrop: rgb(0 0 0 / 0.5);
57
+ --color-scrollbar: rgb(var(--muted-foreground) / 0.35);
58
+ --radius-field: min(calc(var(--radius) + 0.25rem), 1.25rem);
59
+ }
60
+
61
+ :root {
62
+ --scrollbar: rgb(var(--muted-foreground) / 0.35);
63
+ --field-radius: min(calc(var(--radius) + 0.25rem), 1.25rem);
64
+ }
65
+
66
+ /*
67
+ * Fallback fill for toasts, dialogs and hover cards (`glass-panel-strong`).
68
+ * Equivalent to `bg-card/95 backdrop-blur-md`. An app may override it by
69
+ * declaring its own `@utility glass-panel-strong` after this import.
70
+ */
71
+ @utility glass-panel-strong {
72
+ background-color: rgb(var(--card) / 0.95);
73
+ -webkit-backdrop-filter: blur(12px);
74
+ backdrop-filter: blur(12px);
75
+ }
@@ -88,6 +88,12 @@ export function tokensPreset({ color = cssVar } = {}) {
88
88
  DEFAULT: v("default"),
89
89
  foreground: v("default-foreground"),
90
90
  },
91
+ muted: { DEFAULT: v("muted"), foreground: v("muted") },
92
+ accent: {
93
+ DEFAULT: v("accent"),
94
+ foreground: v("accent-foreground"),
95
+ },
96
+ ring: v("focus"),
91
97
  input: v("border"),
92
98
  popover: {
93
99
  DEFAULT: v("overlay"),
@@ -59,6 +59,21 @@
59
59
  --color-warning: var(--warning);
60
60
  --color-warning-foreground: var(--warning-foreground);
61
61
 
62
+ /* shadcn-style aliases onto the same tokens. */
63
+ --color-primary: var(--accent);
64
+ --color-primary-foreground: var(--accent-foreground);
65
+ --color-muted-foreground: var(--muted);
66
+ --color-secondary: var(--default);
67
+ --color-secondary-foreground: var(--default-foreground);
68
+ --color-destructive: var(--danger);
69
+ --color-destructive-foreground: var(--danger-foreground);
70
+ --color-card: var(--surface-card);
71
+ --color-card-foreground: var(--surface-foreground);
72
+ --color-popover: var(--overlay);
73
+ --color-popover-foreground: var(--overlay-foreground);
74
+ --color-input: var(--border);
75
+ --color-ring: var(--focus);
76
+
62
77
  --radius-lg: var(--radius);
63
78
  --radius-field: var(--field-radius);
64
79
  --radius-md: calc(var(--radius) - 2px);