@zerospin/studio 0.0.0-stage → 1.0.0-alpha.11
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.
- package/README.md +63 -2
- package/dist/components/ui/button.d.ts +10 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.js +41 -0
- package/dist/components/ui/button.js.map +1 -0
- package/dist/components/ui/combobox.d.ts +17 -0
- package/dist/components/ui/combobox.d.ts.map +1 -0
- package/dist/components/ui/combobox.js +32 -0
- package/dist/components/ui/combobox.js.map +1 -0
- package/dist/components/ui/table.d.ts +9 -0
- package/dist/components/ui/table.d.ts.map +1 -0
- package/dist/components/ui/table.js +23 -0
- package/dist/components/ui/table.js.map +1 -0
- package/dist/entry.rsc.d.ts +4 -0
- package/dist/entry.rsc.d.ts.map +1 -0
- package/dist/entry.rsc.js +77 -0
- package/dist/entry.rsc.js.map +1 -0
- package/dist/entry.ssr.d.ts +2 -0
- package/dist/entry.ssr.d.ts.map +1 -0
- package/dist/entry.ssr.js +19 -0
- package/dist/entry.ssr.js.map +1 -0
- package/dist/fixtures/agents.d.ts +65605 -0
- package/dist/fixtures/agents.d.ts.map +1 -0
- package/dist/fixtures/agents.js +195 -0
- package/dist/fixtures/agents.js.map +1 -0
- package/dist/lib/cn.d.ts +3 -0
- package/dist/lib/cn.d.ts.map +1 -0
- package/dist/lib/cn.js +6 -0
- package/dist/lib/cn.js.map +1 -0
- package/dist/main.d.ts +2 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +14 -0
- package/dist/main.js.map +1 -0
- package/dist/server/makeStudioViteConfig.d.ts +11 -0
- package/dist/server/makeStudioViteConfig.d.ts.map +1 -0
- package/dist/server/makeStudioViteConfig.js +75 -0
- package/dist/server/makeStudioViteConfig.js.map +1 -0
- package/dist/server/openStudioServer.d.ts +14 -0
- package/dist/server/openStudioServer.d.ts.map +1 -0
- package/dist/server/openStudioServer.js +42 -0
- package/dist/server/openStudioServer.js.map +1 -0
- package/dist/startStudio.d.ts +15 -0
- package/dist/startStudio.d.ts.map +1 -0
- package/dist/startStudio.js +16 -0
- package/dist/startStudio.js.map +1 -0
- package/package.json +71 -3
- package/src/components/ui/button.tsx +75 -0
- package/src/components/ui/combobox.tsx +135 -0
- package/src/components/ui/table.tsx +81 -0
- package/src/entry.rsc.tsx +106 -0
- package/src/entry.ssr.tsx +19 -0
- package/src/fixtures/agents.ts +219 -0
- package/src/lib/cn.ts +6 -0
- package/src/main.tsx +17 -0
- package/src/rsc-env.d.ts +6 -0
- package/src/server/makeStudioViteConfig.ts +90 -0
- package/src/server/openStudioServer.ts +54 -0
- package/src/startStudio.ts +26 -0
- package/src/styles.css +79 -0
- package/vite.config.ts +7 -0
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import {
|
|
2
|
+
makeAgentCommandRef,
|
|
3
|
+
makeAggregateAgentRelease,
|
|
4
|
+
makeAggregateAgentSession,
|
|
5
|
+
type IAgentSessionFactories,
|
|
6
|
+
} from '@zerospin/browser';
|
|
7
|
+
import { defineAggregateContract } from '@zerospin/core/contracts/defineAggregateContract';
|
|
8
|
+
import { findFirst } from '@zerospin/core/contracts/findFirst';
|
|
9
|
+
import { makeAggregateContractRelease } from '@zerospin/core/contracts/make/makeAggregateContractRelease';
|
|
10
|
+
import { defineModel } from '@zerospin/core/models/defineModel';
|
|
11
|
+
import { makeModelVersion } from '@zerospin/core/models/make/makeModelVersion';
|
|
12
|
+
import { makeQueryDbVersion } from '@zerospin/core/models/make/makeQueryDbVersion';
|
|
13
|
+
import { modelId } from '@zerospin/core/models/modelId';
|
|
14
|
+
import { modelRef } from '@zerospin/core/models/modelRef';
|
|
15
|
+
import { ContractError } from '@zerospin/error';
|
|
16
|
+
import { primitives } from '@zerospin/shapes';
|
|
17
|
+
import * as Effect from 'effect/Effect';
|
|
18
|
+
import * as Schema from 'effect/Schema';
|
|
19
|
+
|
|
20
|
+
const flagModel = defineModel({ name: 'flag', abbreviation: 'flg' });
|
|
21
|
+
const itemModel = defineModel({ name: 'item', abbreviation: 'itm' });
|
|
22
|
+
const flag = makeModelVersion(flagModel, {
|
|
23
|
+
version: 1,
|
|
24
|
+
attributes: { visible: primitives.boolean() },
|
|
25
|
+
indexes: [],
|
|
26
|
+
});
|
|
27
|
+
const metadataSchema = Schema.Struct({ marker: Schema.String });
|
|
28
|
+
const item = makeModelVersion(itemModel, {
|
|
29
|
+
version: 1,
|
|
30
|
+
attributes: {
|
|
31
|
+
amount: primitives.integer(),
|
|
32
|
+
labelStatus: primitives.text(),
|
|
33
|
+
trackingStatus: primitives.text(),
|
|
34
|
+
flagId: modelRef({
|
|
35
|
+
model: flagModel,
|
|
36
|
+
relation: 'flag',
|
|
37
|
+
inverse: 'items',
|
|
38
|
+
}),
|
|
39
|
+
capturedAt: primitives.date(),
|
|
40
|
+
metadata: primitives.json({ schema: metadataSchema }),
|
|
41
|
+
note: primitives.text(),
|
|
42
|
+
},
|
|
43
|
+
indexes: [],
|
|
44
|
+
});
|
|
45
|
+
const createTrackingLabel = makeAggregateContractRelease(
|
|
46
|
+
defineAggregateContract('createTrackingLabel'),
|
|
47
|
+
{
|
|
48
|
+
version: 1,
|
|
49
|
+
models: {
|
|
50
|
+
item: {
|
|
51
|
+
model: item,
|
|
52
|
+
fields: [
|
|
53
|
+
'createdAt',
|
|
54
|
+
'updatedAt',
|
|
55
|
+
'amount',
|
|
56
|
+
'labelStatus',
|
|
57
|
+
'trackingStatus',
|
|
58
|
+
'flagId',
|
|
59
|
+
'capturedAt',
|
|
60
|
+
'metadata',
|
|
61
|
+
'note',
|
|
62
|
+
],
|
|
63
|
+
},
|
|
64
|
+
flag: { model: flag, fields: ['createdAt', 'updatedAt', 'visible'] },
|
|
65
|
+
},
|
|
66
|
+
payload: { itemId: modelId({ model: itemModel }) },
|
|
67
|
+
failures: {
|
|
68
|
+
ineligible: ContractError.schema({ code: 'fixture-ineligible' }),
|
|
69
|
+
},
|
|
70
|
+
operations: { updateItem: item.operations.update },
|
|
71
|
+
program: Effect.fn(function* ({ payload, db, failures, operations }) {
|
|
72
|
+
const row = yield* findFirst({
|
|
73
|
+
db,
|
|
74
|
+
model: db.models.item,
|
|
75
|
+
where: { id: { eq: payload.itemId } },
|
|
76
|
+
});
|
|
77
|
+
if (row?.amount === 13) {
|
|
78
|
+
return yield* failures.ineligible.make({
|
|
79
|
+
message: 'Fixture row is ineligible.',
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
if (row !== undefined) {
|
|
83
|
+
yield* operations.updateItem({
|
|
84
|
+
resourceId: row.id,
|
|
85
|
+
attributes: { labelStatus: 'pending' },
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}),
|
|
89
|
+
},
|
|
90
|
+
);
|
|
91
|
+
const updateTrackingInfo = makeAggregateContractRelease(
|
|
92
|
+
defineAggregateContract('updateTrackingInfo'),
|
|
93
|
+
{
|
|
94
|
+
version: 1,
|
|
95
|
+
models: {
|
|
96
|
+
item: {
|
|
97
|
+
model: item,
|
|
98
|
+
fields: [
|
|
99
|
+
'createdAt',
|
|
100
|
+
'updatedAt',
|
|
101
|
+
'amount',
|
|
102
|
+
'labelStatus',
|
|
103
|
+
'trackingStatus',
|
|
104
|
+
'flagId',
|
|
105
|
+
'capturedAt',
|
|
106
|
+
'metadata',
|
|
107
|
+
'note',
|
|
108
|
+
],
|
|
109
|
+
},
|
|
110
|
+
flag: { model: flag, fields: ['createdAt', 'updatedAt', 'visible'] },
|
|
111
|
+
},
|
|
112
|
+
payload: { itemId: modelId({ model: itemModel }) },
|
|
113
|
+
operations: { updateItem: item.operations.update },
|
|
114
|
+
program: Effect.fn(function* ({ payload, db, operations }) {
|
|
115
|
+
const row = yield* findFirst({
|
|
116
|
+
db,
|
|
117
|
+
model: db.models.item,
|
|
118
|
+
where: { id: { eq: payload.itemId } },
|
|
119
|
+
});
|
|
120
|
+
if (row !== undefined) {
|
|
121
|
+
yield* operations.updateItem({
|
|
122
|
+
resourceId: row.id,
|
|
123
|
+
attributes: { trackingStatus: 'pending' },
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}),
|
|
127
|
+
},
|
|
128
|
+
);
|
|
129
|
+
const editItem = makeAggregateContractRelease(
|
|
130
|
+
defineAggregateContract('editItem'),
|
|
131
|
+
{
|
|
132
|
+
version: 1,
|
|
133
|
+
models: {
|
|
134
|
+
item: {
|
|
135
|
+
model: item,
|
|
136
|
+
fields: [
|
|
137
|
+
'createdAt',
|
|
138
|
+
'updatedAt',
|
|
139
|
+
'amount',
|
|
140
|
+
'labelStatus',
|
|
141
|
+
'trackingStatus',
|
|
142
|
+
'flagId',
|
|
143
|
+
'capturedAt',
|
|
144
|
+
'metadata',
|
|
145
|
+
'note',
|
|
146
|
+
],
|
|
147
|
+
},
|
|
148
|
+
flag: { model: flag, fields: ['createdAt', 'updatedAt', 'visible'] },
|
|
149
|
+
},
|
|
150
|
+
payload: {
|
|
151
|
+
itemId: modelId({ model: itemModel }),
|
|
152
|
+
capturedAt: primitives.date(),
|
|
153
|
+
metadata: primitives.json({ schema: metadataSchema }),
|
|
154
|
+
note: primitives.text(),
|
|
155
|
+
},
|
|
156
|
+
failures: {
|
|
157
|
+
ineligible: ContractError.schema({ code: 'fixture-edit-ineligible' }),
|
|
158
|
+
},
|
|
159
|
+
guard: ({ payload, failures }) =>
|
|
160
|
+
payload.note === 'forbidden'
|
|
161
|
+
? Effect.fail(
|
|
162
|
+
failures.ineligible.make({
|
|
163
|
+
message: 'Fixture note is ineligible.',
|
|
164
|
+
}),
|
|
165
|
+
)
|
|
166
|
+
: Effect.void,
|
|
167
|
+
operations: { updateItem: item.operations.update },
|
|
168
|
+
program: Effect.fn(function* ({ payload, db, operations }) {
|
|
169
|
+
const row = yield* findFirst({
|
|
170
|
+
db,
|
|
171
|
+
model: db.models.item,
|
|
172
|
+
where: { id: { eq: payload.itemId } },
|
|
173
|
+
});
|
|
174
|
+
if (row !== undefined) {
|
|
175
|
+
yield* operations.updateItem({
|
|
176
|
+
resourceId: row.id,
|
|
177
|
+
attributes: { note: payload.note },
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
}),
|
|
181
|
+
},
|
|
182
|
+
);
|
|
183
|
+
const db = makeQueryDbVersion({ models: { item, flag } });
|
|
184
|
+
export const positiveItems = makeAggregateAgentRelease({
|
|
185
|
+
agentName: 'positiveItems',
|
|
186
|
+
agentVersion: 1,
|
|
187
|
+
sessionName: 'positiveItems',
|
|
188
|
+
aggregateName: 'fixture',
|
|
189
|
+
aggregateVersion: 1,
|
|
190
|
+
db,
|
|
191
|
+
contracts: {
|
|
192
|
+
createTrackingLabel: makeAgentCommandRef<typeof createTrackingLabel>(
|
|
193
|
+
'createTrackingLabel',
|
|
194
|
+
1,
|
|
195
|
+
),
|
|
196
|
+
updateTrackingInfo: makeAgentCommandRef<typeof updateTrackingInfo>(
|
|
197
|
+
'updateTrackingInfo',
|
|
198
|
+
1,
|
|
199
|
+
),
|
|
200
|
+
editItem: makeAgentCommandRef<typeof editItem>('editItem', 1),
|
|
201
|
+
},
|
|
202
|
+
selections: {
|
|
203
|
+
item: db.query.item.findMany({
|
|
204
|
+
where: { amount: { gt: 0 }, flag: { visible: { eq: true } } },
|
|
205
|
+
}),
|
|
206
|
+
flag: db.query.flag.findMany({}),
|
|
207
|
+
},
|
|
208
|
+
});
|
|
209
|
+
export const agents = { positiveItems };
|
|
210
|
+
export const agentSessions = {
|
|
211
|
+
positiveItems: {
|
|
212
|
+
kind: 'aggregate',
|
|
213
|
+
makeSession: inputs =>
|
|
214
|
+
makeAggregateAgentSession({
|
|
215
|
+
agentRelease: agents.positiveItems,
|
|
216
|
+
...inputs,
|
|
217
|
+
}),
|
|
218
|
+
},
|
|
219
|
+
} satisfies IAgentSessionFactories;
|
package/src/lib/cn.ts
ADDED
package/src/main.tsx
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
import { createFromReadableStream } from '@vitejs/plugin-rsc/browser';
|
|
4
|
+
import { createRoot } from 'react-dom/client';
|
|
5
|
+
|
|
6
|
+
async function mountStudio() {
|
|
7
|
+
const rscUrl = new URL('/index.rsc', window.location.href);
|
|
8
|
+
rscUrl.searchParams.set('pathname', window.location.pathname);
|
|
9
|
+
const response = await fetch(rscUrl);
|
|
10
|
+
if (!response.ok || !response.body) {
|
|
11
|
+
throw new Error('Could not load Zerospin Declaration Board.');
|
|
12
|
+
}
|
|
13
|
+
const root = await createFromReadableStream<ReactNode>(response.body);
|
|
14
|
+
createRoot(document).render(root);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
void mountStudio();
|
package/src/rsc-env.d.ts
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { resolve } from 'node:path';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
|
|
4
|
+
import tailwindcss from '@tailwindcss/vite';
|
|
5
|
+
import react from '@vitejs/plugin-react';
|
|
6
|
+
import rsc from '@vitejs/plugin-rsc';
|
|
7
|
+
import type { ISystemSpec } from '@zerospin/core/system/types';
|
|
8
|
+
import {
|
|
9
|
+
defaultClientConditions,
|
|
10
|
+
defaultServerConditions,
|
|
11
|
+
searchForWorkspaceRoot,
|
|
12
|
+
type InlineConfig,
|
|
13
|
+
} from 'vite';
|
|
14
|
+
|
|
15
|
+
/** Build Studio's local server configuration without opening resources. */
|
|
16
|
+
export function makeStudioViteConfig(props: {
|
|
17
|
+
projectRoot: string;
|
|
18
|
+
port: number;
|
|
19
|
+
open: boolean;
|
|
20
|
+
publicUrl?: string;
|
|
21
|
+
systemSpec: ISystemSpec;
|
|
22
|
+
}): InlineConfig {
|
|
23
|
+
const { projectRoot, port, open, publicUrl, systemSpec } = props;
|
|
24
|
+
const root = fileURLToPath(new URL('../../', import.meta.url));
|
|
25
|
+
const systemSpecModule = 'virtual:zerospin-studio-system-spec';
|
|
26
|
+
const serializedSystemSpec = JSON.stringify(systemSpec);
|
|
27
|
+
return {
|
|
28
|
+
root,
|
|
29
|
+
configFile: false,
|
|
30
|
+
appType: 'custom',
|
|
31
|
+
resolve: {
|
|
32
|
+
conditions: ['source', ...defaultClientConditions],
|
|
33
|
+
},
|
|
34
|
+
plugins: [
|
|
35
|
+
rsc({
|
|
36
|
+
entries: {
|
|
37
|
+
rsc: resolve(root, 'src/entry.rsc.tsx'),
|
|
38
|
+
ssr: resolve(root, 'src/entry.ssr.tsx'),
|
|
39
|
+
client: resolve(root, 'src/main.tsx'),
|
|
40
|
+
},
|
|
41
|
+
}),
|
|
42
|
+
react(),
|
|
43
|
+
tailwindcss(),
|
|
44
|
+
{
|
|
45
|
+
name: 'zerospin-studio-declarations',
|
|
46
|
+
resolveId(id) {
|
|
47
|
+
if (id === systemSpecModule) {
|
|
48
|
+
return `\0${systemSpecModule}`;
|
|
49
|
+
}
|
|
50
|
+
return null;
|
|
51
|
+
},
|
|
52
|
+
load(id) {
|
|
53
|
+
if (id !== `\0${systemSpecModule}`) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (this.environment.name !== 'rsc') {
|
|
57
|
+
throw new Error(
|
|
58
|
+
'Studio metadata is only available to its Server Component.',
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
return `export default ${JSON.stringify(serializedSystemSpec)};`;
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
optimizeDeps: {
|
|
66
|
+
exclude: ['@zerospin/system-diagrams'],
|
|
67
|
+
},
|
|
68
|
+
environments: {
|
|
69
|
+
rsc: {
|
|
70
|
+
resolve: {
|
|
71
|
+
conditions: ['react-server', 'source', ...defaultServerConditions],
|
|
72
|
+
noExternal: ['@zerospin/system-diagrams'],
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
ssr: {
|
|
76
|
+
resolve: {
|
|
77
|
+
conditions: ['source', ...defaultServerConditions],
|
|
78
|
+
noExternal: ['@zerospin/system-diagrams'],
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
server: {
|
|
83
|
+
host: '127.0.0.1',
|
|
84
|
+
port,
|
|
85
|
+
open: open ? (publicUrl ?? true) : false,
|
|
86
|
+
strictPort: true,
|
|
87
|
+
fs: { allow: [searchForWorkspaceRoot(root), projectRoot] },
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { ISystemSpec } from '@zerospin/core/system/types';
|
|
2
|
+
import { createServer } from 'vite';
|
|
3
|
+
|
|
4
|
+
import { makeStudioViteConfig } from './makeStudioViteConfig.js';
|
|
5
|
+
|
|
6
|
+
/** Acquire the server and return its one memoized shutdown, including late acquisition after cancellation. */
|
|
7
|
+
export async function openStudioServer(props: {
|
|
8
|
+
projectRoot: string;
|
|
9
|
+
port: number;
|
|
10
|
+
open: boolean;
|
|
11
|
+
publicUrl?: string;
|
|
12
|
+
systemSpec: ISystemSpec;
|
|
13
|
+
signal: AbortSignal;
|
|
14
|
+
}) {
|
|
15
|
+
const { signal, projectRoot, port, open, publicUrl, systemSpec } = props;
|
|
16
|
+
signal.throwIfAborted();
|
|
17
|
+
const server = await createServer(
|
|
18
|
+
makeStudioViteConfig({
|
|
19
|
+
projectRoot,
|
|
20
|
+
port,
|
|
21
|
+
open,
|
|
22
|
+
systemSpec,
|
|
23
|
+
...(publicUrl === undefined ? {} : { publicUrl }),
|
|
24
|
+
}),
|
|
25
|
+
);
|
|
26
|
+
let startup: Promise<unknown> = Promise.resolve();
|
|
27
|
+
let disposal: Promise<void> | undefined;
|
|
28
|
+
const dispose = () =>
|
|
29
|
+
(disposal ??= (async () => {
|
|
30
|
+
signal.removeEventListener('abort', canceled);
|
|
31
|
+
await startup.catch(() => undefined);
|
|
32
|
+
await server.close();
|
|
33
|
+
})());
|
|
34
|
+
const canceled = () => {
|
|
35
|
+
void dispose().catch(() => undefined);
|
|
36
|
+
};
|
|
37
|
+
signal.addEventListener('abort', canceled, { once: true });
|
|
38
|
+
try {
|
|
39
|
+
signal.throwIfAborted();
|
|
40
|
+
startup = server.listen();
|
|
41
|
+
await startup;
|
|
42
|
+
signal.throwIfAborted();
|
|
43
|
+
return {
|
|
44
|
+
url:
|
|
45
|
+
publicUrl ??
|
|
46
|
+
server.resolvedUrls?.local[0] ??
|
|
47
|
+
`http://127.0.0.1:${port}`,
|
|
48
|
+
dispose,
|
|
49
|
+
};
|
|
50
|
+
} catch (failure) {
|
|
51
|
+
await dispose().catch(() => undefined);
|
|
52
|
+
throw failure;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ISystemSpec } from '@zerospin/core/system/types';
|
|
2
|
+
import { makeZerospinError } from '@zerospin/error';
|
|
3
|
+
import { makeFn } from '@zerospin/logger';
|
|
4
|
+
import * as Effect from 'effect/Effect';
|
|
5
|
+
|
|
6
|
+
import { openStudioServer } from './server/openStudioServer.js';
|
|
7
|
+
|
|
8
|
+
/** Start Studio within its caller-owned cancellation lifetime and return explicit disposal. */
|
|
9
|
+
export const startStudio = makeFn('startStudio')(function* (props: {
|
|
10
|
+
projectRoot: string;
|
|
11
|
+
port: number;
|
|
12
|
+
open: boolean;
|
|
13
|
+
publicUrl?: string;
|
|
14
|
+
systemSpec: ISystemSpec;
|
|
15
|
+
signal: AbortSignal;
|
|
16
|
+
}) {
|
|
17
|
+
return yield* Effect.tryPromise({
|
|
18
|
+
try: () => openStudioServer(props),
|
|
19
|
+
catch: failure =>
|
|
20
|
+
makeZerospinError({
|
|
21
|
+
code: 'studio-start-failed',
|
|
22
|
+
message: 'Could not start Zerospin Studio.',
|
|
23
|
+
cause: String(failure),
|
|
24
|
+
}),
|
|
25
|
+
});
|
|
26
|
+
});
|
package/src/styles.css
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
@import 'tailwindcss';
|
|
2
|
+
|
|
3
|
+
@source '../../system-diagrams/src';
|
|
4
|
+
|
|
5
|
+
@custom-variant dark (&:is(.dark *));
|
|
6
|
+
|
|
7
|
+
:root {
|
|
8
|
+
--background: oklch(1 0 0);
|
|
9
|
+
--foreground: oklch(0.145 0 0);
|
|
10
|
+
--primary: oklch(0.205 0 0);
|
|
11
|
+
--primary-foreground: oklch(0.985 0 0);
|
|
12
|
+
--secondary: oklch(0.97 0 0);
|
|
13
|
+
--secondary-foreground: oklch(0.205 0 0);
|
|
14
|
+
--muted: oklch(0.97 0 0);
|
|
15
|
+
--muted-foreground: oklch(0.556 0 0);
|
|
16
|
+
--accent: oklch(0.97 0 0);
|
|
17
|
+
--accent-foreground: oklch(0.205 0 0);
|
|
18
|
+
--destructive: oklch(0.577 0.245 27.325);
|
|
19
|
+
--border: oklch(0.922 0 0);
|
|
20
|
+
--input: oklch(0.922 0 0);
|
|
21
|
+
--ring: oklch(0.708 0 0);
|
|
22
|
+
--popover: oklch(1 0 0);
|
|
23
|
+
--popover-foreground: oklch(0.145 0 0);
|
|
24
|
+
--radius: 0.625rem;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.dark {
|
|
28
|
+
--background: oklch(0.145 0 0);
|
|
29
|
+
--foreground: oklch(0.985 0 0);
|
|
30
|
+
--primary: oklch(0.985 0 0);
|
|
31
|
+
--primary-foreground: oklch(0.205 0 0);
|
|
32
|
+
--secondary: oklch(0.269 0 0);
|
|
33
|
+
--secondary-foreground: oklch(0.985 0 0);
|
|
34
|
+
--muted: oklch(0.269 0 0);
|
|
35
|
+
--muted-foreground: oklch(0.708 0 0);
|
|
36
|
+
--accent: oklch(0.269 0 0);
|
|
37
|
+
--accent-foreground: oklch(0.985 0 0);
|
|
38
|
+
--destructive: oklch(0.396 0.141 25.723);
|
|
39
|
+
--border: oklch(0.269 0 0);
|
|
40
|
+
--input: oklch(0.269 0 0);
|
|
41
|
+
--ring: oklch(0.439 0 0);
|
|
42
|
+
--popover: oklch(0.205 0 0);
|
|
43
|
+
--popover-foreground: oklch(0.985 0 0);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@theme inline {
|
|
47
|
+
--font-sans: 'Geist Mono Variable', ui-monospace, monospace;
|
|
48
|
+
--font-mono: 'Geist Mono Variable', ui-monospace, monospace;
|
|
49
|
+
--color-background: var(--background);
|
|
50
|
+
--color-foreground: var(--foreground);
|
|
51
|
+
--color-primary: var(--primary);
|
|
52
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
53
|
+
--color-secondary: var(--secondary);
|
|
54
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
55
|
+
--color-muted: var(--muted);
|
|
56
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
57
|
+
--color-accent: var(--accent);
|
|
58
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
59
|
+
--color-destructive: var(--destructive);
|
|
60
|
+
--color-border: var(--border);
|
|
61
|
+
--color-input: var(--input);
|
|
62
|
+
--color-ring: var(--ring);
|
|
63
|
+
--color-popover: var(--popover);
|
|
64
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
65
|
+
--radius-sm: calc(var(--radius) - 4px);
|
|
66
|
+
--radius-md: calc(var(--radius) - 2px);
|
|
67
|
+
--radius-lg: var(--radius);
|
|
68
|
+
--radius-xl: calc(var(--radius) + 4px);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@layer base {
|
|
72
|
+
* {
|
|
73
|
+
@apply border-border outline-ring/50;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
body {
|
|
77
|
+
@apply m-0 bg-background text-foreground antialiased;
|
|
78
|
+
}
|
|
79
|
+
}
|