@saena-io/create 0.1.0 → 0.2.0

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 (100) hide show
  1. package/dist/index.js +9 -9
  2. package/package.json +1 -1
  3. package/template/base/package.json +44 -2
  4. package/template/base/scripts/ui-update.ts +83 -0
  5. package/template/base/src/components/ui/accordion.tsx +75 -0
  6. package/template/base/src/components/ui/alert-dialog.tsx +162 -0
  7. package/template/base/src/components/ui/alert.tsx +73 -0
  8. package/template/base/src/components/ui/app-sidebar.tsx +183 -0
  9. package/template/base/src/components/ui/aspect-ratio.tsx +22 -0
  10. package/template/base/src/components/ui/asset-input.tsx +211 -0
  11. package/template/base/src/components/ui/avatar.tsx +91 -0
  12. package/template/base/src/components/ui/badge.tsx +50 -0
  13. package/template/base/src/components/ui/breadcrumb.tsx +104 -0
  14. package/template/base/src/components/ui/button-group.tsx +78 -0
  15. package/template/base/src/components/ui/button.tsx +56 -0
  16. package/template/base/src/components/ui/calendar.tsx +205 -0
  17. package/template/base/src/components/ui/card.tsx +85 -0
  18. package/template/base/src/components/ui/carousel.tsx +232 -0
  19. package/template/base/src/components/ui/chart.tsx +337 -0
  20. package/template/base/src/components/ui/checkbox.tsx +29 -0
  21. package/template/base/src/components/ui/collapsible.tsx +15 -0
  22. package/template/base/src/components/ui/combobox.tsx +276 -0
  23. package/template/base/src/components/ui/command.tsx +190 -0
  24. package/template/base/src/components/ui/context-menu.tsx +243 -0
  25. package/template/base/src/components/ui/dialog.tsx +134 -0
  26. package/template/base/src/components/ui/direction.tsx +4 -0
  27. package/template/base/src/components/ui/drawer.tsx +120 -0
  28. package/template/base/src/components/ui/dropdown-menu.tsx +254 -0
  29. package/template/base/src/components/ui/empty.tsx +94 -0
  30. package/template/base/src/components/ui/field.tsx +222 -0
  31. package/template/base/src/components/ui/focal-point-picker.tsx +175 -0
  32. package/template/base/src/components/ui/hover-card.tsx +46 -0
  33. package/template/base/src/components/ui/input-group.tsx +149 -0
  34. package/template/base/src/components/ui/input-otp.tsx +85 -0
  35. package/template/base/src/components/ui/input.tsx +20 -0
  36. package/template/base/src/components/ui/item.tsx +188 -0
  37. package/template/base/src/components/ui/kbd.tsx +26 -0
  38. package/template/base/src/components/ui/label.tsx +20 -0
  39. package/template/base/src/components/ui/menubar.tsx +268 -0
  40. package/template/base/src/components/ui/native-select.tsx +58 -0
  41. package/template/base/src/components/ui/nav-main.tsx +70 -0
  42. package/template/base/src/components/ui/nav-projects.tsx +97 -0
  43. package/template/base/src/components/ui/nav-secondary.tsx +37 -0
  44. package/template/base/src/components/ui/nav-user.tsx +108 -0
  45. package/template/base/src/components/ui/navigation-menu.tsx +164 -0
  46. package/template/base/src/components/ui/pagination.tsx +123 -0
  47. package/template/base/src/components/ui/popover.tsx +80 -0
  48. package/template/base/src/components/ui/progress.tsx +66 -0
  49. package/template/base/src/components/ui/radio-group.tsx +36 -0
  50. package/template/base/src/components/ui/resizable.tsx +42 -0
  51. package/template/base/src/components/ui/rich-text/ai-chat-editor.tsx +20 -0
  52. package/template/base/src/components/ui/rich-text/ai-command.tsx +90 -0
  53. package/template/base/src/components/ui/rich-text/ai-copilot.tsx +67 -0
  54. package/template/base/src/components/ui/rich-text/ai-menu.tsx +456 -0
  55. package/template/base/src/components/ui/rich-text/ai-node.tsx +42 -0
  56. package/template/base/src/components/ui/rich-text/ai-toolbar-button.tsx +29 -0
  57. package/template/base/src/components/ui/rich-text/block-draggable.tsx +187 -0
  58. package/template/base/src/components/ui/rich-text/block-selection.tsx +17 -0
  59. package/template/base/src/components/ui/rich-text/code-block-node.tsx +204 -0
  60. package/template/base/src/components/ui/rich-text/codec.ts +63 -0
  61. package/template/base/src/components/ui/rich-text/extension.ts +53 -0
  62. package/template/base/src/components/ui/rich-text/ghost-text.tsx +23 -0
  63. package/template/base/src/components/ui/rich-text/import-export-toolbar.tsx +103 -0
  64. package/template/base/src/components/ui/rich-text/link.tsx +18 -0
  65. package/template/base/src/components/ui/rich-text/list-node.tsx +65 -0
  66. package/template/base/src/components/ui/rich-text/nodes.tsx +44 -0
  67. package/template/base/src/components/ui/rich-text/plugins.ts +233 -0
  68. package/template/base/src/components/ui/rich-text/rich-text-editor.tsx +82 -0
  69. package/template/base/src/components/ui/rich-text/static.tsx +117 -0
  70. package/template/base/src/components/ui/rich-text/table-node.tsx +934 -0
  71. package/template/base/src/components/ui/rich-text/table-toolbar.tsx +232 -0
  72. package/template/base/src/components/ui/rich-text/toggle-node.tsx +36 -0
  73. package/template/base/src/components/ui/rich-text/toolbar-slots.ts +41 -0
  74. package/template/base/src/components/ui/rich-text/toolbar.tsx +668 -0
  75. package/template/base/src/components/ui/rich-text/use-ai-chat.ts +35 -0
  76. package/template/base/src/components/ui/rich-text/variable-type.ts +4 -0
  77. package/template/base/src/components/ui/rich-text/variable.tsx +97 -0
  78. package/template/base/src/components/ui/scroll-area.tsx +49 -0
  79. package/template/base/src/components/ui/select.tsx +202 -0
  80. package/template/base/src/components/ui/separator.tsx +19 -0
  81. package/template/base/src/components/ui/sheet.tsx +126 -0
  82. package/template/base/src/components/ui/sidebar.tsx +695 -0
  83. package/template/base/src/components/ui/skeleton.tsx +13 -0
  84. package/template/base/src/components/ui/slider.tsx +52 -0
  85. package/template/base/src/components/ui/sonner.tsx +50 -0
  86. package/template/base/src/components/ui/spinner.tsx +18 -0
  87. package/template/base/src/components/ui/switch.tsx +30 -0
  88. package/template/base/src/components/ui/table.tsx +89 -0
  89. package/template/base/src/components/ui/tabs.tsx +73 -0
  90. package/template/base/src/components/ui/textarea.tsx +18 -0
  91. package/template/base/src/components/ui/toggle-group.tsx +85 -0
  92. package/template/base/src/components/ui/toggle.tsx +45 -0
  93. package/template/base/src/components/ui/toolbar.tsx +451 -0
  94. package/template/base/src/components/ui/tooltip.tsx +52 -0
  95. package/template/base/src/hooks/use-mobile.ts +19 -0
  96. package/template/base/src/lib/utils.ts +6 -0
  97. package/template/base/src/routes/__root.tsx +1 -1
  98. package/template/base/src/server/auth.ts +2 -2
  99. package/template/base/src/styles/globals.css +230 -0
  100. package/template/base/vite.config.ts +15 -1
@@ -0,0 +1,230 @@
1
+ @import "tailwindcss";
2
+ @import "tw-animate-css";
3
+ @import "shadcn/tailwind.css";
4
+ @import "@fontsource-variable/noto-sans";
5
+
6
+ @custom-variant dark (&:is(.dark *));
7
+ /* Generate the classes used by the framework packages — node_modules is skipped by Tailwind by
8
+ default, so the admin + plugins need this. Your own src/ is auto-detected by the Vite plugin. */
9
+ @source "../../node_modules/@saena-io/*/src/**/*.{ts,tsx}";
10
+
11
+ @theme inline {
12
+ --font-heading: var(--font-sans);
13
+ --color-sidebar-ring: var(--sidebar-ring);
14
+ --color-sidebar-border: var(--sidebar-border);
15
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
16
+ --color-sidebar-accent: var(--sidebar-accent);
17
+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
18
+ --color-sidebar-primary: var(--sidebar-primary);
19
+ --color-sidebar-foreground: var(--sidebar-foreground);
20
+ --color-sidebar: var(--sidebar);
21
+ --color-chart-5: var(--chart-5);
22
+ --color-chart-4: var(--chart-4);
23
+ --color-chart-3: var(--chart-3);
24
+ --color-chart-2: var(--chart-2);
25
+ --color-chart-1: var(--chart-1);
26
+ --color-ring: var(--ring);
27
+ --color-input: var(--input);
28
+ --color-border: var(--border);
29
+ --color-destructive: var(--destructive);
30
+ --color-accent-foreground: var(--accent-foreground);
31
+ --color-accent: var(--accent);
32
+ --color-muted-foreground: var(--muted-foreground);
33
+ --color-muted: var(--muted);
34
+ --color-secondary-foreground: var(--secondary-foreground);
35
+ --color-secondary: var(--secondary);
36
+ --color-primary-foreground: var(--primary-foreground);
37
+ --color-primary: var(--primary);
38
+ --color-popover-foreground: var(--popover-foreground);
39
+ --color-popover: var(--popover);
40
+ --color-card-foreground: var(--card-foreground);
41
+ --color-card: var(--card);
42
+ --color-foreground: var(--foreground);
43
+ --color-background: var(--background);
44
+ --radius-sm: calc(var(--radius) * 0.6);
45
+ --radius-md: calc(var(--radius) * 0.8);
46
+ --radius-lg: var(--radius);
47
+ --radius-xl: calc(var(--radius) * 1.4);
48
+ --radius-2xl: calc(var(--radius) * 1.8);
49
+ --radius-3xl: calc(var(--radius) * 2.2);
50
+ --radius-4xl: calc(var(--radius) * 2.6);
51
+ --font-sans: "Noto Sans Variable", sans-serif;
52
+ }
53
+
54
+ :root {
55
+ --background: oklch(1 0 0);
56
+ --foreground: oklch(0.148 0.004 228.8);
57
+ --card: oklch(1 0 0);
58
+ --card-foreground: oklch(0.148 0.004 228.8);
59
+ --popover: oklch(1 0 0);
60
+ --popover-foreground: oklch(0.148 0.004 228.8);
61
+ --primary: oklch(0.511 0.096 186.391);
62
+ --primary-foreground: oklch(0.984 0.014 180.72);
63
+ --secondary: oklch(0.967 0.001 286.375);
64
+ --secondary-foreground: oklch(0.21 0.006 285.885);
65
+ --muted: oklch(0.963 0.002 197.1);
66
+ --muted-foreground: oklch(0.56 0.021 213.5);
67
+ --accent: oklch(0.963 0.002 197.1);
68
+ --accent-foreground: oklch(0.218 0.008 223.9);
69
+ --destructive: oklch(0.577 0.245 27.325);
70
+ --border: oklch(0.925 0.005 214.3);
71
+ --input: oklch(0.925 0.005 214.3);
72
+ --ring: oklch(0.723 0.014 214.4);
73
+ --chart-1: oklch(0.855 0.138 181.071);
74
+ --chart-2: oklch(0.704 0.14 182.503);
75
+ --chart-3: oklch(0.6 0.118 184.704);
76
+ --chart-4: oklch(0.511 0.096 186.391);
77
+ --chart-5: oklch(0.437 0.078 188.216);
78
+ --radius: 0.625rem;
79
+ --sidebar: oklch(0.987 0.002 197.1);
80
+ --sidebar-foreground: oklch(0.148 0.004 228.8);
81
+ --sidebar-primary: oklch(0.6 0.118 184.704);
82
+ --sidebar-primary-foreground: oklch(0.984 0.014 180.72);
83
+ --sidebar-accent: oklch(0.963 0.002 197.1);
84
+ --sidebar-accent-foreground: oklch(0.218 0.008 223.9);
85
+ --sidebar-border: oklch(0.925 0.005 214.3);
86
+ --sidebar-ring: oklch(0.723 0.014 214.4);
87
+ }
88
+
89
+ .dark {
90
+ --background: oklch(0.148 0.004 228.8);
91
+ --foreground: oklch(0.987 0.002 197.1);
92
+ --card: oklch(0.218 0.008 223.9);
93
+ --card-foreground: oklch(0.987 0.002 197.1);
94
+ --popover: oklch(0.218 0.008 223.9);
95
+ --popover-foreground: oklch(0.987 0.002 197.1);
96
+ --primary: oklch(0.437 0.078 188.216);
97
+ --primary-foreground: oklch(0.984 0.014 180.72);
98
+ --secondary: oklch(0.274 0.006 286.033);
99
+ --secondary-foreground: oklch(0.985 0 0);
100
+ --muted: oklch(0.275 0.011 216.9);
101
+ --muted-foreground: oklch(0.723 0.014 214.4);
102
+ --accent: oklch(0.275 0.011 216.9);
103
+ --accent-foreground: oklch(0.987 0.002 197.1);
104
+ --destructive: oklch(0.704 0.191 22.216);
105
+ --border: oklch(1 0 0 / 10%);
106
+ --input: oklch(1 0 0 / 15%);
107
+ --ring: oklch(0.56 0.021 213.5);
108
+ --chart-1: oklch(0.855 0.138 181.071);
109
+ --chart-2: oklch(0.704 0.14 182.503);
110
+ --chart-3: oklch(0.6 0.118 184.704);
111
+ --chart-4: oklch(0.511 0.096 186.391);
112
+ --chart-5: oklch(0.437 0.078 188.216);
113
+ --sidebar: oklch(0.218 0.008 223.9);
114
+ --sidebar-foreground: oklch(0.987 0.002 197.1);
115
+ --sidebar-primary: oklch(0.704 0.14 182.503);
116
+ --sidebar-primary-foreground: oklch(0.277 0.046 192.524);
117
+ --sidebar-accent: oklch(0.275 0.011 216.9);
118
+ --sidebar-accent-foreground: oklch(0.987 0.002 197.1);
119
+ --sidebar-border: oklch(1 0 0 / 10%);
120
+ --sidebar-ring: oklch(0.56 0.021 213.5);
121
+ }
122
+
123
+ @layer base {
124
+ * {
125
+ @apply border-border outline-ring/50;
126
+ }
127
+ body {
128
+ @apply bg-background text-foreground;
129
+ }
130
+ button:not(:disabled),
131
+ [role="button"]:not(:disabled) {
132
+ cursor: pointer;
133
+ }
134
+ }
135
+
136
+ /* Code-block syntax highlighting. The rich-text editor's CodeBlockPlugin (lowlight/highlight.js) decorates
137
+ tokens with `hljs-*` scope classes; these rules color them. Scoped to `.saena-hljs` (the <code> inside a
138
+ code block) so they never leak, and driven by per-theme variables for light/dark parity. */
139
+ :root {
140
+ --hl-comment: oklch(0.55 0.02 250);
141
+ --hl-keyword: oklch(0.55 0.2 18);
142
+ --hl-string: oklch(0.5 0.13 150);
143
+ --hl-number: oklch(0.55 0.15 250);
144
+ --hl-function: oklch(0.55 0.2 300);
145
+ --hl-type: oklch(0.58 0.15 60);
146
+ --hl-tag: oklch(0.5 0.15 150);
147
+ --hl-attr: oklch(0.55 0.15 250);
148
+ --hl-variable: oklch(0.55 0.15 35);
149
+ --hl-meta: oklch(0.55 0.02 250);
150
+ }
151
+
152
+ .dark {
153
+ --hl-comment: oklch(0.62 0.02 250);
154
+ --hl-keyword: oklch(0.75 0.16 18);
155
+ --hl-string: oklch(0.82 0.1 200);
156
+ --hl-number: oklch(0.78 0.13 250);
157
+ --hl-function: oklch(0.78 0.13 300);
158
+ --hl-type: oklch(0.78 0.13 60);
159
+ --hl-tag: oklch(0.82 0.16 150);
160
+ --hl-attr: oklch(0.78 0.13 250);
161
+ --hl-variable: oklch(0.78 0.13 35);
162
+ --hl-meta: oklch(0.62 0.02 250);
163
+ }
164
+
165
+ .saena-hljs {
166
+ .hljs-comment,
167
+ .hljs-quote {
168
+ color: var(--hl-comment);
169
+ font-style: italic;
170
+ }
171
+ .hljs-keyword,
172
+ .hljs-selector-tag,
173
+ .hljs-literal,
174
+ .hljs-doctag {
175
+ color: var(--hl-keyword);
176
+ }
177
+ .hljs-string,
178
+ .hljs-regexp,
179
+ .hljs-addition,
180
+ .hljs-meta-string {
181
+ color: var(--hl-string);
182
+ }
183
+ .hljs-number,
184
+ .hljs-bullet,
185
+ .hljs-symbol,
186
+ .hljs-link {
187
+ color: var(--hl-number);
188
+ }
189
+ .hljs-title,
190
+ .hljs-title.function_,
191
+ .hljs-section,
192
+ .hljs-name,
193
+ .hljs-selector-id {
194
+ color: var(--hl-function);
195
+ }
196
+ .hljs-built_in,
197
+ .hljs-type,
198
+ .hljs-title.class_,
199
+ .hljs-class .hljs-title,
200
+ .hljs-selector-class {
201
+ color: var(--hl-type);
202
+ }
203
+ .hljs-tag,
204
+ .hljs-template-tag {
205
+ color: var(--hl-tag);
206
+ }
207
+ .hljs-attr,
208
+ .hljs-attribute,
209
+ .hljs-property,
210
+ .hljs-params,
211
+ .hljs-selector-attr,
212
+ .hljs-selector-pseudo {
213
+ color: var(--hl-attr);
214
+ }
215
+ .hljs-variable,
216
+ .hljs-template-variable,
217
+ .hljs-subst {
218
+ color: var(--hl-variable);
219
+ }
220
+ .hljs-meta,
221
+ .hljs-deletion {
222
+ color: var(--hl-meta);
223
+ }
224
+ .hljs-emphasis {
225
+ font-style: italic;
226
+ }
227
+ .hljs-strong {
228
+ font-weight: 600;
229
+ }
230
+ }
@@ -1,8 +1,22 @@
1
+ import { fileURLToPath } from 'node:url';
1
2
  import tailwindcss from '@tailwindcss/vite';
2
3
  import { tanstackStart } from '@tanstack/react-start/plugin/vite';
3
4
  import viteReact from '@vitejs/plugin-react';
4
5
  import { defineConfig, loadEnv } from 'vite';
5
6
 
7
+ // You own the shadcn components in src/components/ui (and `cn` in src/lib). These aliases make the
8
+ // published admin + plugins render YOUR components + styles instead of @saena-io/ui's — so the whole
9
+ // app shares one design system you can edit. Single-segment only, so multi-segment paths you DON'T own
10
+ // (e.g. components/rich-text/*) fall through to the package. Edit a component freely; re-fetch the
11
+ // latest from @saena-io/ui when you want to update it.
12
+ const src = fileURLToPath(new URL('./src', import.meta.url)).replace(/\\/g, '/');
13
+ const ownUiAliases = [
14
+ { find: /^@saena-io\/ui\/components\/rich-text\/(.+)$/, replacement: `${src}/components/ui/rich-text/$1` },
15
+ { find: /^@saena-io\/ui\/components\/(?!rich-text)([^/]+)$/, replacement: `${src}/components/ui/$1` },
16
+ { find: '@saena-io/ui/lib/utils', replacement: `${src}/lib/utils` },
17
+ { find: /^@saena-io\/ui\/hooks\/(.+)$/, replacement: `${src}/hooks/$1` },
18
+ ];
19
+
6
20
  export default defineConfig(({ mode }) => {
7
21
  // Load this project's .env into process.env so the SSR server (the auth handler + db) sees
8
22
  // DATABASE_URL / BETTER_AUTH_SECRET. Server-only — only VITE_-prefixed vars reach the client
@@ -16,7 +30,7 @@ export default defineConfig(({ mode }) => {
16
30
  // Production server (`bun run start` → `vite preview`) binds the platform's PORT (e.g. Railway) on
17
31
  // 0.0.0.0 so the deploy is reachable.
18
32
  preview: { port, host: true },
19
- resolve: { tsconfigPaths: true },
33
+ resolve: { tsconfigPaths: true, alias: ownUiAliases },
20
34
  // The @saena-io/* packages ship TypeScript source (consumed via Vite). Bundle them for SSR so Vite
21
35
  // transpiles them instead of treating them as pre-built external CommonJS.
22
36
  ssr: { noExternal: [/@saena-io\//] },