Skip to content

Commit 4253db8

Browse files
committed
chore: possible approach to reusable UI:
1 parent d02d714 commit 4253db8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1243
-319
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ my-app
77
**/dist
88
.vinxi
99
**/lib-dist
10+
**/lib-react
1011
**/api-server-dist
1112
.vscode
1213

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import js from '@eslint/js'
2+
import globals from 'globals'
3+
import reactHooks from 'eslint-plugin-react-hooks'
4+
import reactRefresh from 'eslint-plugin-react-refresh'
5+
import tseslint from 'typescript-eslint'
6+
7+
export default tseslint.config(
8+
{ ignores: ['dist'] },
9+
{
10+
extends: [js.configs.recommended, ...tseslint.configs.recommended],
11+
files: ['**/*.{ts,tsx}'],
12+
languageOptions: {
13+
ecmaVersion: 2020,
14+
globals: globals.browser,
15+
},
16+
plugins: {
17+
'react-hooks': reactHooks,
18+
'react-refresh': reactRefresh,
19+
},
20+
rules: {
21+
...reactHooks.configs.recommended.rules,
22+
'react-refresh/only-export-components': [
23+
'warn',
24+
{ allowConstantExport: true },
25+
],
26+
},
27+
},
28+
)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite + React + TS</title>
8+
</head>
9+
<body class="dark">
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.tsx"></script>
12+
</body>
13+
</html>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "customized-ui",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"scripts": {
7+
"dev:ui": "VITE_API_BASE_URL=http://localhost:8080 vite",
8+
"build:ui": "tsc -b && vite build",
9+
"lint": "eslint .",
10+
"preview": "vite preview"
11+
},
12+
"dependencies": {
13+
"@tailwindcss/vite": "^4.1.6",
14+
"@tanstack/cta-ui": "workspace:*",
15+
"react": "^19.1.0",
16+
"react-dom": "^19.1.0",
17+
"tailwindcss": "^4.1.6",
18+
"tailwindcss-animate": "^1.0.7"
19+
},
20+
"devDependencies": {
21+
"@eslint/js": "^9.25.0",
22+
"@types/react": "^19.1.2",
23+
"@types/react-dom": "^19.1.2",
24+
"@vitejs/plugin-react": "^4.4.1",
25+
"eslint": "^9.25.0",
26+
"eslint-plugin-react-hooks": "^5.2.0",
27+
"eslint-plugin-react-refresh": "^0.4.19",
28+
"globals": "^16.0.0",
29+
"typescript": "~5.8.3",
30+
"typescript-eslint": "^8.30.1",
31+
"vite": "^6.3.5"
32+
}
33+
}
Lines changed: 1 addition & 0 deletions
Loading

examples/custom-cli/create-qwik-app/customized-ui/src/App.css

Whitespace-only changes.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import ExternalApp from '@tanstack/cta-ui/src/external'
2+
3+
function App() {
4+
return <ExternalApp />
5+
}
6+
7+
export default App
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 265 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,265 @@
1+
@import 'tailwindcss';
2+
3+
@source "../node_modules/@tanstack/cta-ui";
4+
5+
@layer theme, base, components, utilities;
6+
7+
@plugin "tailwindcss-animate";
8+
9+
@source inline("bg-green-500");
10+
11+
@custom-variant dark (&:where(.dark, .dark *));
12+
13+
body {
14+
@apply m-0;
15+
font-family:
16+
'Inter',
17+
ui-sans-serif,
18+
system-ui,
19+
sans-serif,
20+
'Apple Color Emoji',
21+
'Segoe UI Emoji',
22+
Segoe UI Symbol,
23+
'Noto Color Emoji';
24+
-webkit-font-smoothing: antialiased;
25+
-moz-osx-font-smoothing: grayscale;
26+
}
27+
28+
code,
29+
.cm-theme,
30+
.cm-merge-theme {
31+
font-size: 16px;
32+
font-family:
33+
'JetBrains Mono',
34+
Menlo,
35+
Monaco,
36+
Consolas,
37+
monospace,
38+
Courier New;
39+
white-space: pre;
40+
-webkit-overflow-scrolling: touch;
41+
}
42+
43+
:root {
44+
--background: oklch(1 0 0);
45+
--foreground: oklch(0.141 0.005 285.823);
46+
--card: oklch(1 0 0);
47+
--card-foreground: oklch(0.141 0.005 285.823);
48+
--popover: oklch(1 0 0);
49+
--popover-foreground: oklch(0.141 0.005 285.823);
50+
--primary: oklch(0.21 0.006 285.885);
51+
--primary-foreground: oklch(0.985 0 0);
52+
--secondary: oklch(0.967 0.001 286.375);
53+
--secondary-foreground: oklch(0.21 0.006 285.885);
54+
--muted: oklch(0.967 0.001 286.375);
55+
--muted-foreground: oklch(0.552 0.016 285.938);
56+
--accent: oklch(0.967 0.001 286.375);
57+
--accent-foreground: oklch(0.21 0.006 285.885);
58+
--destructive: oklch(0.577 0.245 27.325);
59+
--destructive-foreground: oklch(0.577 0.245 27.325);
60+
--border: oklch(0.92 0.004 286.32);
61+
--input: oklch(0.92 0.004 286.32);
62+
--ring: oklch(0.871 0.006 286.286);
63+
--chart-1: oklch(0.646 0.222 41.116);
64+
--chart-2: oklch(0.6 0.118 184.704);
65+
--chart-3: oklch(0.398 0.07 227.392);
66+
--chart-4: oklch(0.828 0.189 84.429);
67+
--chart-5: oklch(0.769 0.188 70.08);
68+
--radius: 0.625rem;
69+
--sidebar: oklch(0.985 0 0);
70+
--sidebar-foreground: oklch(0.141 0.005 285.823);
71+
--sidebar-primary: oklch(0.21 0.006 285.885);
72+
--sidebar-primary-foreground: oklch(0.985 0 0);
73+
--sidebar-accent: oklch(0.967 0.001 286.375);
74+
--sidebar-accent-foreground: oklch(0.21 0.006 285.885);
75+
--sidebar-border: oklch(0.92 0.004 286.32);
76+
--sidebar-ring: oklch(0.871 0.006 286.286);
77+
}
78+
79+
.dark {
80+
--background: rgb(3, 7, 18);
81+
--foreground: oklch(0.985 0 0);
82+
--card: oklch(0.141 0.005 285.823);
83+
--card-foreground: oklch(0.985 0 0);
84+
--popover: oklch(0.141 0.005 285.823);
85+
--popover-foreground: oklch(0.985 0 0);
86+
--primary: oklch(0.985 0 0);
87+
--primary-foreground: oklch(0.21 0.006 285.885);
88+
--secondary: oklch(0.274 0.006 286.033);
89+
--secondary-foreground: oklch(0.985 0 0);
90+
--muted: oklch(0.274 0.006 286.033);
91+
--muted-foreground: oklch(0.705 0.015 286.067);
92+
--accent: oklch(0.274 0.006 286.033);
93+
--accent-foreground: oklch(0.985 0 0);
94+
--destructive: oklch(0.396 0.141 25.723);
95+
--destructive-foreground: oklch(0.637 0.237 25.331);
96+
--border: oklch(0.274 0.006 286.033);
97+
--input: oklch(0.274 0.006 286.033);
98+
--ring: oklch(0.442 0.017 285.786);
99+
--chart-1: oklch(0.488 0.243 264.376);
100+
--chart-2: oklch(0.696 0.17 162.48);
101+
--chart-3: oklch(0.769 0.188 70.08);
102+
--chart-4: oklch(0.627 0.265 303.9);
103+
--chart-5: oklch(0.645 0.246 16.439);
104+
--sidebar: oklch(0.21 0.006 285.885);
105+
--sidebar-foreground: oklch(0.985 0 0);
106+
--sidebar-primary: oklch(0.488 0.243 264.376);
107+
--sidebar-primary-foreground: oklch(0.985 0 0);
108+
--sidebar-accent: oklch(0.274 0.006 286.033);
109+
--sidebar-accent-foreground: oklch(0.985 0 0);
110+
--sidebar-border: oklch(0.274 0.006 286.033);
111+
--sidebar-ring: oklch(0.442 0.017 285.786);
112+
}
113+
114+
@theme inline {
115+
--color-background: var(--background);
116+
--color-foreground: var(--foreground);
117+
--color-card: var(--card);
118+
--color-card-foreground: var(--card-foreground);
119+
--color-popover: var(--popover);
120+
--color-popover-foreground: var(--popover-foreground);
121+
--color-primary: var(--primary);
122+
--color-primary-foreground: var(--primary-foreground);
123+
--color-secondary: var(--secondary);
124+
--color-secondary-foreground: var(--secondary-foreground);
125+
--color-muted: var(--muted);
126+
--color-muted-foreground: var(--muted-foreground);
127+
--color-accent: var(--accent);
128+
--color-accent-foreground: var(--accent-foreground);
129+
--color-destructive: var(--destructive);
130+
--color-destructive-foreground: var(--destructive-foreground);
131+
--color-border: var(--border);
132+
--color-input: var(--input);
133+
--color-ring: var(--ring);
134+
--color-chart-1: var(--chart-1);
135+
--color-chart-2: var(--chart-2);
136+
--color-chart-3: var(--chart-3);
137+
--color-chart-4: var(--chart-4);
138+
--color-chart-5: var(--chart-5);
139+
--radius-sm: calc(var(--radius) - 4px);
140+
--radius-md: calc(var(--radius) - 2px);
141+
--radius-lg: var(--radius);
142+
--radius-xl: calc(var(--radius) + 4px);
143+
--color-sidebar: var(--sidebar);
144+
--color-sidebar-foreground: var(--sidebar-foreground);
145+
--color-sidebar-primary: var(--sidebar-primary);
146+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
147+
--color-sidebar-accent: var(--sidebar-accent);
148+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
149+
--color-sidebar-border: var(--sidebar-border);
150+
--color-sidebar-ring: var(--sidebar-ring);
151+
--container-8xl: 96rem;
152+
--container-9xl: 120rem;
153+
--container-10xl: 144rem;
154+
}
155+
156+
@layer base {
157+
:root {
158+
--sidebar-background: 0 0% 98%;
159+
--sidebar-foreground: 240 5.3% 26.1%;
160+
--sidebar-primary: 240 5.9% 10%;
161+
--sidebar-primary-foreground: 0 0% 98%;
162+
--sidebar-accent: 240 4.8% 95.9%;
163+
--sidebar-accent-foreground: 240 5.9% 10%;
164+
--sidebar-border: 220 13% 91%;
165+
--sidebar-ring: 217.2 91.2% 59.8%;
166+
}
167+
168+
.dark {
169+
--sidebar-background: 240 5.9% 10%;
170+
--sidebar-foreground: 240 4.8% 95.9%;
171+
--sidebar-primary: 224.3 76.3% 48%;
172+
--sidebar-primary-foreground: 0 0% 100%;
173+
--sidebar-accent: 240 3.7% 15.9%;
174+
--sidebar-accent-foreground: 240 4.8% 95.9%;
175+
--sidebar-border: 240 3.7% 15.9%;
176+
--sidebar-ring: 217.2 91.2% 59.8%;
177+
}
178+
}
179+
180+
@layer base {
181+
html,
182+
body {
183+
@apply text-gray-900 bg-gray-50 dark:bg-black dark:text-gray-200;
184+
background: rgb(3, 7, 18);
185+
}
186+
187+
.using-mouse * {
188+
outline: none !important;
189+
}
190+
191+
* {
192+
scrollbar-color: theme(colors.gray.400) theme(colors.gray.100);
193+
}
194+
195+
*::-webkit-scrollbar,
196+
* scrollbar {
197+
width: 1rem;
198+
height: 1rem;
199+
}
200+
201+
*::-webkit-scrollbar-track,
202+
* scrollbar-track {
203+
background: theme(colors.gray.100);
204+
}
205+
206+
*::-webkit-scrollbar-thumb,
207+
* scrollbar-thumb {
208+
background: theme(colors.gray.300);
209+
border-radius: 0.5rem;
210+
border: 3px solid theme(colors.gray.100);
211+
}
212+
213+
html.dark {
214+
&,
215+
* {
216+
color-scheme: dark;
217+
}
218+
219+
&,
220+
* {
221+
scrollbar-color: theme(colors.gray.700) theme(colors.gray.800);
222+
}
223+
224+
&::-webkit-scrollbar,
225+
*::-webkit-scrollbar,
226+
* scrollbar {
227+
width: 1rem;
228+
height: 1rem;
229+
}
230+
231+
& *::-webkit-scrollbar-track,
232+
*::-webkit-scrollbar-track,
233+
* scrollbar-track {
234+
background: theme(colors.gray.800);
235+
}
236+
237+
&::-webkit-scrollbar-thumb,
238+
*::-webkit-scrollbar-thumb,
239+
* scrollbar-thumb {
240+
background: theme(colors.gray.600);
241+
border-radius: 0.5rem;
242+
border: 3px solid theme(colors.gray.800);
243+
}
244+
}
245+
246+
[disabled] {
247+
@apply opacity-50 pointer-events-none;
248+
}
249+
}
250+
251+
.cm-changedLine {
252+
background-color: oklch(0.27 0.005 285.823) !important;
253+
}
254+
255+
.file-filters {
256+
background-color: oklch(0.2 0.005 285.823);
257+
}
258+
259+
.font-black {
260+
font-weight: 900;
261+
}
262+
263+
.font-medium {
264+
font-weight: 800;
265+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { StrictMode } from 'react'
2+
import { createRoot } from 'react-dom/client'
3+
import './index.css'
4+
import App from './App.tsx'
5+
6+
createRoot(document.getElementById('root')!).render(
7+
<StrictMode>
8+
<App />
9+
</StrictMode>,
10+
)

0 commit comments

Comments
 (0)