@ultrst-armada/floks 1.0.0 → 1.1.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.
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +8 -1
- package/packages/canvas-ui/dist/{chunk-UEIMM6PV.js → chunk-OOTTFWXA.js} +1 -1
- package/packages/canvas-ui/dist/{chunk-2GLR35UM.js → chunk-U2SC3RMJ.js} +1 -1
- package/packages/canvas-ui/dist/{chunk-QWQ4PCXQ.js → chunk-XVAHT5WE.js} +1 -1
- package/packages/canvas-ui/dist/graph-2d/index.js +2 -2
- package/packages/canvas-ui/dist/index.d.ts +1 -1
- package/packages/canvas-ui/dist/index.js +3 -3
- package/packages/canvas-ui/dist/predictive/index.d.ts +4 -3
- package/packages/canvas-ui/dist/predictive/index.js +2 -2
- package/packages/canvas-ui/package.json +1 -1
- package/packages/contracts/dist/index.d.ts +394 -0
- package/packages/contracts/dist/index.js +324 -0
- package/packages/contracts/package.json +30 -0
- package/packages/ui/dist/{chunk-OHISLM3Z.js → chunk-KYFSUQVT.js} +69 -3
- package/packages/ui/dist/components/base/index.js +3 -3
- package/packages/ui/dist/components/composite/index.js +5 -5
- package/packages/ui/dist/components/settings/index.js +2 -2
- package/packages/ui/dist/hierarchy/index.d.ts +66 -1
- package/packages/ui/dist/hierarchy/index.js +39 -1
- package/packages/ui/dist/index.d.ts +1 -1
- package/packages/ui/dist/index.js +79 -41
- package/packages/ui/dist/{chunk-QWXEW7WH.js → chunk-ATQPZLJX.js} +3 -3
- package/packages/ui/dist/{chunk-DABYTYOU.js → chunk-VEWPTZGO.js} +3 -3
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
// src/schemas.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
var VisualSlotSchema = z.object({
|
|
4
|
+
id: z.string(),
|
|
5
|
+
acceptedElementTypes: z.array(z.string()),
|
|
6
|
+
required: z.boolean().default(false),
|
|
7
|
+
constraints: z.record(z.unknown()).optional()
|
|
8
|
+
});
|
|
9
|
+
var VisualParameterSchema = z.object({
|
|
10
|
+
id: z.string(),
|
|
11
|
+
type: z.enum(["color", "dimension", "number", "string", "boolean", "gradient", "shadow"]),
|
|
12
|
+
default: z.union([z.string(), z.number(), z.boolean()]),
|
|
13
|
+
constraints: z.record(z.unknown()).optional()
|
|
14
|
+
});
|
|
15
|
+
var VisualStateSchema = z.object({
|
|
16
|
+
id: z.string(),
|
|
17
|
+
parameters: z.array(VisualParameterSchema),
|
|
18
|
+
transitions: z.record(z.string()).optional()
|
|
19
|
+
});
|
|
20
|
+
var ThemeTargetSchema = z.object({
|
|
21
|
+
library: z.literal("@ultrst-armada/floks"),
|
|
22
|
+
componentId: z.string(),
|
|
23
|
+
componentVersion: z.string(),
|
|
24
|
+
contractVersion: z.string().default("1.0.0")
|
|
25
|
+
});
|
|
26
|
+
var ComponentThemeContractSchema = z.object({
|
|
27
|
+
componentId: z.string(),
|
|
28
|
+
componentVersion: z.string(),
|
|
29
|
+
displayName: z.string().optional(),
|
|
30
|
+
slots: z.array(VisualSlotSchema),
|
|
31
|
+
states: z.array(VisualStateSchema),
|
|
32
|
+
parameters: z.array(VisualParameterSchema),
|
|
33
|
+
assets: z.array(z.string())
|
|
34
|
+
});
|
|
35
|
+
var ThemePackSlotBindingSchema = z.object({
|
|
36
|
+
slotId: z.string(),
|
|
37
|
+
elementType: z.string(),
|
|
38
|
+
assetRef: z.string().optional(),
|
|
39
|
+
styles: z.record(z.string()).optional()
|
|
40
|
+
});
|
|
41
|
+
var ThemePackStateMappingSchema = z.object({
|
|
42
|
+
stateId: z.string(),
|
|
43
|
+
parameterOverrides: z.record(z.union([z.string(), z.number(), z.boolean()]))
|
|
44
|
+
});
|
|
45
|
+
var ThemePackSchema = z.object({
|
|
46
|
+
themeId: z.string(),
|
|
47
|
+
name: z.string(),
|
|
48
|
+
version: z.string(),
|
|
49
|
+
target: ThemeTargetSchema,
|
|
50
|
+
slots: z.array(ThemePackSlotBindingSchema),
|
|
51
|
+
states: z.array(ThemePackStateMappingSchema),
|
|
52
|
+
parameters: z.record(z.union([z.string(), z.number(), z.boolean()])),
|
|
53
|
+
assetTypes: z.array(z.string()),
|
|
54
|
+
metadata: z.record(z.unknown()).optional()
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
// src/registry.ts
|
|
58
|
+
var FLOKS_COMPONENT_REGISTRY = {
|
|
59
|
+
// 1. Button Parent
|
|
60
|
+
"floks.button": ComponentThemeContractSchema.parse({
|
|
61
|
+
componentId: "floks.button",
|
|
62
|
+
componentVersion: "1.0.0",
|
|
63
|
+
displayName: "Button Component",
|
|
64
|
+
slots: [
|
|
65
|
+
{ id: "container", acceptedElementTypes: ["shape", "frame", "mesh"], required: true },
|
|
66
|
+
{ id: "icon", acceptedElementTypes: ["icon", "svg", "glyph"], required: false },
|
|
67
|
+
{ id: "label", acceptedElementTypes: ["text", "typography"], required: true },
|
|
68
|
+
{ id: "indicator", acceptedElementTypes: ["badge", "dot", "counter"], required: false }
|
|
69
|
+
],
|
|
70
|
+
states: [
|
|
71
|
+
{ id: "idle", parameters: [] },
|
|
72
|
+
{ id: "hover", parameters: [] },
|
|
73
|
+
{ id: "active", parameters: [] },
|
|
74
|
+
{ id: "disabled", parameters: [] },
|
|
75
|
+
{ id: "focus", parameters: [] }
|
|
76
|
+
],
|
|
77
|
+
parameters: [
|
|
78
|
+
{ id: "background", type: "color", default: "var(--skipo-surface-2)" },
|
|
79
|
+
{ id: "textColor", type: "color", default: "var(--skipo-text-primary)" },
|
|
80
|
+
{ id: "borderColor", type: "color", default: "var(--skipo-border)" },
|
|
81
|
+
{ id: "borderWidth", type: "dimension", default: "1px" },
|
|
82
|
+
{ id: "borderRadius", type: "dimension", default: "6px" },
|
|
83
|
+
{ id: "padding", type: "dimension", default: "8px 16px" },
|
|
84
|
+
{ id: "fontSize", type: "dimension", default: "13px" }
|
|
85
|
+
],
|
|
86
|
+
assets: ["svg", "bitmap"]
|
|
87
|
+
}),
|
|
88
|
+
// 2. Panel Parent
|
|
89
|
+
"floks.panel": ComponentThemeContractSchema.parse({
|
|
90
|
+
componentId: "floks.panel",
|
|
91
|
+
componentVersion: "1.0.0",
|
|
92
|
+
displayName: "Panel Component",
|
|
93
|
+
slots: [
|
|
94
|
+
{ id: "header", acceptedElementTypes: ["frame", "strip"], required: false },
|
|
95
|
+
{ id: "content", acceptedElementTypes: ["container", "layout"], required: true },
|
|
96
|
+
{ id: "footer", acceptedElementTypes: ["strip", "action-bar"], required: false },
|
|
97
|
+
{ id: "border-frame", acceptedElementTypes: ["frame", "shape"], required: false }
|
|
98
|
+
],
|
|
99
|
+
states: [
|
|
100
|
+
{ id: "default", parameters: [] },
|
|
101
|
+
{ id: "expanded", parameters: [] },
|
|
102
|
+
{ id: "collapsed", parameters: [] },
|
|
103
|
+
{ id: "minimized", parameters: [] }
|
|
104
|
+
],
|
|
105
|
+
parameters: [
|
|
106
|
+
{ id: "background", type: "color", default: "var(--skipo-surface-1)" },
|
|
107
|
+
{ id: "borderColor", type: "color", default: "var(--skipo-border)" },
|
|
108
|
+
{ id: "borderRadius", type: "dimension", default: "8px" },
|
|
109
|
+
{ id: "elevation", type: "shadow", default: "0 4px 12px rgba(0,0,0,0.4)" },
|
|
110
|
+
{ id: "padding", type: "dimension", default: "12px" }
|
|
111
|
+
],
|
|
112
|
+
assets: ["svg", "bitmap", "shader"]
|
|
113
|
+
}),
|
|
114
|
+
// 3. Slider Input
|
|
115
|
+
"floks.input.slider": ComponentThemeContractSchema.parse({
|
|
116
|
+
componentId: "floks.input.slider",
|
|
117
|
+
componentVersion: "1.0.0",
|
|
118
|
+
displayName: "Slider Input Component",
|
|
119
|
+
slots: [
|
|
120
|
+
{ id: "track", acceptedElementTypes: ["bar", "curve"], required: true },
|
|
121
|
+
{ id: "fill", acceptedElementTypes: ["bar", "gradient"], required: true },
|
|
122
|
+
{ id: "thumb", acceptedElementTypes: ["handle", "circle", "icon"], required: true },
|
|
123
|
+
{ id: "value-label", acceptedElementTypes: ["text", "bubble"], required: false }
|
|
124
|
+
],
|
|
125
|
+
states: [
|
|
126
|
+
{ id: "idle", parameters: [] },
|
|
127
|
+
{ id: "hover", parameters: [] },
|
|
128
|
+
{ id: "dragging", parameters: [] },
|
|
129
|
+
{ id: "disabled", parameters: [] }
|
|
130
|
+
],
|
|
131
|
+
parameters: [
|
|
132
|
+
{ id: "trackColor", type: "color", default: "var(--skipo-surface-3)" },
|
|
133
|
+
{ id: "fillColor", type: "color", default: "var(--skipo-accent)" },
|
|
134
|
+
{ id: "thumbColor", type: "color", default: "var(--skipo-surface-1)" },
|
|
135
|
+
{ id: "thumbSize", type: "dimension", default: "14px" },
|
|
136
|
+
{ id: "height", type: "dimension", default: "6px" }
|
|
137
|
+
],
|
|
138
|
+
assets: ["svg", "bitmap"]
|
|
139
|
+
}),
|
|
140
|
+
// 4. Badge
|
|
141
|
+
"floks.badge": ComponentThemeContractSchema.parse({
|
|
142
|
+
componentId: "floks.badge",
|
|
143
|
+
componentVersion: "1.0.0",
|
|
144
|
+
displayName: "Badge Component",
|
|
145
|
+
slots: [
|
|
146
|
+
{ id: "pill", acceptedElementTypes: ["shape", "pill"], required: true },
|
|
147
|
+
{ id: "indicator-dot", acceptedElementTypes: ["dot", "icon"], required: false },
|
|
148
|
+
{ id: "text", acceptedElementTypes: ["typography"], required: true }
|
|
149
|
+
],
|
|
150
|
+
states: [
|
|
151
|
+
{ id: "default", parameters: [] },
|
|
152
|
+
{ id: "pulse", parameters: [] }
|
|
153
|
+
],
|
|
154
|
+
parameters: [
|
|
155
|
+
{ id: "background", type: "color", default: "var(--skipo-surface-2)" },
|
|
156
|
+
{ id: "textColor", type: "color", default: "var(--skipo-text-secondary)" },
|
|
157
|
+
{ id: "dotColor", type: "color", default: "var(--skipo-accent)" }
|
|
158
|
+
],
|
|
159
|
+
assets: ["svg"]
|
|
160
|
+
}),
|
|
161
|
+
// 5. 2D Graph Socket
|
|
162
|
+
"floks.socket2d": ComponentThemeContractSchema.parse({
|
|
163
|
+
componentId: "floks.socket2d",
|
|
164
|
+
componentVersion: "1.0.0",
|
|
165
|
+
displayName: "2D Graph Socket",
|
|
166
|
+
slots: [
|
|
167
|
+
{ id: "ring", acceptedElementTypes: ["circle", "ring"], required: true },
|
|
168
|
+
{ id: "indicator-dot", acceptedElementTypes: ["circle", "dot"], required: false },
|
|
169
|
+
{ id: "glow", acceptedElementTypes: ["radial-glow"], required: false }
|
|
170
|
+
],
|
|
171
|
+
states: [
|
|
172
|
+
{ id: "idle", parameters: [] },
|
|
173
|
+
{ id: "hover", parameters: [] },
|
|
174
|
+
{ id: "connected", parameters: [] },
|
|
175
|
+
{ id: "compatible-hover", parameters: [] }
|
|
176
|
+
],
|
|
177
|
+
parameters: [
|
|
178
|
+
{ id: "color", type: "color", default: "#ffaa00" },
|
|
179
|
+
{ id: "radius", type: "dimension", default: "6px" },
|
|
180
|
+
{ id: "glowRadius", type: "dimension", default: "12px" }
|
|
181
|
+
],
|
|
182
|
+
assets: ["svg"]
|
|
183
|
+
}),
|
|
184
|
+
// 6. 2D Graph Wire
|
|
185
|
+
"floks.wire2d": ComponentThemeContractSchema.parse({
|
|
186
|
+
componentId: "floks.wire2d",
|
|
187
|
+
componentVersion: "1.0.0",
|
|
188
|
+
displayName: "2D Graph Wire",
|
|
189
|
+
slots: [
|
|
190
|
+
{ id: "trace", acceptedElementTypes: ["path", "spline"], required: true },
|
|
191
|
+
{ id: "pulse-particle", acceptedElementTypes: ["particle", "pulse"], required: false },
|
|
192
|
+
{ id: "endpoint", acceptedElementTypes: ["handle", "arrow"], required: false }
|
|
193
|
+
],
|
|
194
|
+
states: [
|
|
195
|
+
{ id: "idle", parameters: [] },
|
|
196
|
+
{ id: "active", parameters: [] },
|
|
197
|
+
{ id: "selected", parameters: [] },
|
|
198
|
+
{ id: "error", parameters: [] }
|
|
199
|
+
],
|
|
200
|
+
parameters: [
|
|
201
|
+
{ id: "strokeColor", type: "color", default: "#00ffff" },
|
|
202
|
+
{ id: "strokeWidth", type: "dimension", default: "2px" },
|
|
203
|
+
{ id: "opacity", type: "number", default: 1 }
|
|
204
|
+
],
|
|
205
|
+
assets: ["svg", "particle"]
|
|
206
|
+
}),
|
|
207
|
+
// 7. 2D Node Base
|
|
208
|
+
"floks.node2d": ComponentThemeContractSchema.parse({
|
|
209
|
+
componentId: "floks.node2d",
|
|
210
|
+
componentVersion: "1.0.0",
|
|
211
|
+
displayName: "2D Graph Node Card",
|
|
212
|
+
slots: [
|
|
213
|
+
{ id: "header", acceptedElementTypes: ["strip", "banner"], required: true },
|
|
214
|
+
{ id: "body", acceptedElementTypes: ["container", "surface"], required: true },
|
|
215
|
+
{ id: "footer", acceptedElementTypes: ["strip"], required: false },
|
|
216
|
+
{ id: "socket-strip", acceptedElementTypes: ["column", "row"], required: true }
|
|
217
|
+
],
|
|
218
|
+
states: [
|
|
219
|
+
{ id: "idle", parameters: [] },
|
|
220
|
+
{ id: "selected", parameters: [] },
|
|
221
|
+
{ id: "running", parameters: [] },
|
|
222
|
+
{ id: "bypassed", parameters: [] },
|
|
223
|
+
{ id: "minimized", parameters: [] }
|
|
224
|
+
],
|
|
225
|
+
parameters: [
|
|
226
|
+
{ id: "headerColor", type: "color", default: "var(--skipo-surface-2)" },
|
|
227
|
+
{ id: "bodyColor", type: "color", default: "var(--skipo-surface-1)" },
|
|
228
|
+
{ id: "borderColor", type: "color", default: "var(--skipo-border)" },
|
|
229
|
+
{ id: "cornerRadius", type: "dimension", default: "8px" }
|
|
230
|
+
],
|
|
231
|
+
assets: ["svg", "bitmap"]
|
|
232
|
+
})
|
|
233
|
+
};
|
|
234
|
+
function getComponentContract(componentId) {
|
|
235
|
+
return FLOKS_COMPONENT_REGISTRY[componentId];
|
|
236
|
+
}
|
|
237
|
+
function listComponentContracts() {
|
|
238
|
+
return Object.values(FLOKS_COMPONENT_REGISTRY);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// src/validator.ts
|
|
242
|
+
function validateThemePackAgainstContract(themePack, contract) {
|
|
243
|
+
const errors = [];
|
|
244
|
+
const warnings = [];
|
|
245
|
+
const targetCompId = themePack.target.componentId;
|
|
246
|
+
const targetContract = contract ?? FLOKS_COMPONENT_REGISTRY[targetCompId];
|
|
247
|
+
if (!targetContract) {
|
|
248
|
+
return {
|
|
249
|
+
valid: false,
|
|
250
|
+
errors: [`Target component '${targetCompId}' is not registered in Floks ComponentThemeContract registry.`],
|
|
251
|
+
warnings: [],
|
|
252
|
+
targetComponentId: targetCompId
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
if (themePack.target.library !== "@ultrst-armada/floks") {
|
|
256
|
+
errors.push(`Invalid target library '${themePack.target.library}'. Must be '@ultrst-armada/floks'.`);
|
|
257
|
+
}
|
|
258
|
+
const allowedSlotIds = new Set(targetContract.slots.map((s) => s.id));
|
|
259
|
+
for (const s of themePack.slots) {
|
|
260
|
+
if (!allowedSlotIds.has(s.slotId)) {
|
|
261
|
+
errors.push(`Slot '${s.slotId}' is not defined in contract for '${targetCompId}'.`);
|
|
262
|
+
} else {
|
|
263
|
+
const slotDef = targetContract.slots.find((slot) => slot.id === s.slotId);
|
|
264
|
+
if (slotDef && !slotDef.acceptedElementTypes.includes(s.elementType)) {
|
|
265
|
+
errors.push(
|
|
266
|
+
`Slot '${s.slotId}' rejects element type '${s.elementType}'. Accepted types: [${slotDef.acceptedElementTypes.join(", ")}]`
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
const presentSlotIds = new Set(themePack.slots.map((s) => s.slotId));
|
|
272
|
+
for (const requiredSlot of targetContract.slots.filter((s) => s.required)) {
|
|
273
|
+
if (!presentSlotIds.has(requiredSlot.id)) {
|
|
274
|
+
warnings.push(`Required slot '${requiredSlot.id}' is not explicitly bound in theme.`);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
const allowedStateIds = new Set(targetContract.states.map((st) => st.id));
|
|
278
|
+
for (const st of themePack.states) {
|
|
279
|
+
if (!allowedStateIds.has(st.stateId)) {
|
|
280
|
+
errors.push(`State '${st.stateId}' is not recognized by contract for '${targetCompId}'.`);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
const allowedParamIds = new Set(targetContract.parameters.map((p) => p.id));
|
|
284
|
+
for (const paramKey of Object.keys(themePack.parameters)) {
|
|
285
|
+
if (!allowedParamIds.has(paramKey)) {
|
|
286
|
+
warnings.push(`Unknown visual parameter '${paramKey}' ignored by '${targetCompId}'.`);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
const allowedAssets = new Set(targetContract.assets);
|
|
290
|
+
for (const asset of themePack.assetTypes) {
|
|
291
|
+
if (!allowedAssets.has(asset)) {
|
|
292
|
+
errors.push(`Asset type '${asset}' is not accepted by '${targetCompId}'. Allowed: [${targetContract.assets.join(", ")}]`);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
return {
|
|
296
|
+
valid: errors.length === 0,
|
|
297
|
+
errors,
|
|
298
|
+
warnings,
|
|
299
|
+
targetComponentId: targetCompId
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
function loadThemePack(raw) {
|
|
303
|
+
const parsed = ThemePackSchema.parse(raw);
|
|
304
|
+
const result = validateThemePackAgainstContract(parsed);
|
|
305
|
+
if (!result.valid) {
|
|
306
|
+
throw new Error(`Invalid Floks ThemePack: ${result.errors.join("; ")}`);
|
|
307
|
+
}
|
|
308
|
+
return parsed;
|
|
309
|
+
}
|
|
310
|
+
export {
|
|
311
|
+
ComponentThemeContractSchema,
|
|
312
|
+
FLOKS_COMPONENT_REGISTRY,
|
|
313
|
+
ThemePackSchema,
|
|
314
|
+
ThemePackSlotBindingSchema,
|
|
315
|
+
ThemePackStateMappingSchema,
|
|
316
|
+
ThemeTargetSchema,
|
|
317
|
+
VisualParameterSchema,
|
|
318
|
+
VisualSlotSchema,
|
|
319
|
+
VisualStateSchema,
|
|
320
|
+
getComponentContract,
|
|
321
|
+
listComponentContracts,
|
|
322
|
+
loadThemePack,
|
|
323
|
+
validateThemePackAgainstContract
|
|
324
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@floks/contracts",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Floks Canonical Component Theme Contracts, Visual Slots, States, Parameters, and Compatibility Validation for Theta Engine",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"private": false,
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public",
|
|
9
|
+
"registry": "https://registry.npmjs.org/"
|
|
10
|
+
},
|
|
11
|
+
"skipoManifest": "./floks.manifest.json",
|
|
12
|
+
"main": "./dist/index.js",
|
|
13
|
+
"module": "./dist/index.js",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"import": "./dist/index.js",
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"default": "./dist/index.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "tsup src/index.ts --format esm --dts --clean --external zod",
|
|
24
|
+
"typecheck": "tsc --noEmit",
|
|
25
|
+
"clean": "rm -rf dist"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"zod": "^3.24.1"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -70,11 +70,20 @@ var UIElementBase = class extends GraphEntityParent {
|
|
|
70
70
|
};
|
|
71
71
|
|
|
72
72
|
// src/hierarchy/UIParent.tsx
|
|
73
|
+
import React from "react";
|
|
73
74
|
var UIModel = class extends UIElementBase {
|
|
74
75
|
constructor(id, name, variant = "primary", size = "md") {
|
|
75
76
|
super(id, name, "panel", variant, size);
|
|
76
77
|
}
|
|
77
78
|
};
|
|
79
|
+
var UIParent = ({
|
|
80
|
+
as: Component = "div",
|
|
81
|
+
children,
|
|
82
|
+
className = "",
|
|
83
|
+
...props
|
|
84
|
+
}) => {
|
|
85
|
+
return React.createElement(Component, { className, ...props }, children);
|
|
86
|
+
};
|
|
78
87
|
|
|
79
88
|
// src/hierarchy/ButtonParent.tsx
|
|
80
89
|
import { useMemo } from "react";
|
|
@@ -215,6 +224,16 @@ var ButtonParent = ({
|
|
|
215
224
|
}
|
|
216
225
|
);
|
|
217
226
|
};
|
|
227
|
+
var ButtonModel = class extends UIElementBase {
|
|
228
|
+
constructor(id, name, variant = "primary", size = "md") {
|
|
229
|
+
super(id, name, "button", variant, size);
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
var ActionButton = (props) => /* @__PURE__ */ jsx(ButtonParent, { variant: "accent", ...props });
|
|
233
|
+
var IconButton = (props) => /* @__PURE__ */ jsx(ButtonParent, { variant: "secondary", ...props });
|
|
234
|
+
var ToggleButton = (props) => /* @__PURE__ */ jsx(ButtonParent, { variant: "dock", ...props });
|
|
235
|
+
var DangerButton = (props) => /* @__PURE__ */ jsx(ButtonParent, { variant: "danger", ...props });
|
|
236
|
+
var GhostButton = (props) => /* @__PURE__ */ jsx(ButtonParent, { variant: "ghost", ...props });
|
|
218
237
|
|
|
219
238
|
// src/hierarchy/PanelParent.tsx
|
|
220
239
|
import { useMemo as useMemo2 } from "react";
|
|
@@ -337,6 +356,15 @@ var PanelParent = ({
|
|
|
337
356
|
}
|
|
338
357
|
);
|
|
339
358
|
};
|
|
359
|
+
var PanelModel = class extends UIElementBase {
|
|
360
|
+
constructor(id, name, variant = "primary", size = "md") {
|
|
361
|
+
super(id, name, "panel", variant, size);
|
|
362
|
+
}
|
|
363
|
+
};
|
|
364
|
+
var ModalPanel = (props) => /* @__PURE__ */ jsx2(PanelParent, { zIndex: 100, ...props });
|
|
365
|
+
var InspectorPanel = (props) => /* @__PURE__ */ jsx2(PanelParent, { ...props });
|
|
366
|
+
var CardPanel = (props) => /* @__PURE__ */ jsx2(PanelParent, { ...props });
|
|
367
|
+
var ToolbarPanel = (props) => /* @__PURE__ */ jsx2(PanelParent, { ...props });
|
|
340
368
|
|
|
341
369
|
// src/hierarchy/InputParent.tsx
|
|
342
370
|
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
@@ -474,6 +502,11 @@ var ToggleInput = ({
|
|
|
474
502
|
}
|
|
475
503
|
);
|
|
476
504
|
};
|
|
505
|
+
var InputModel = class extends UIElementBase {
|
|
506
|
+
constructor(id, name, variant = "primary", size = "md") {
|
|
507
|
+
super(id, name, "input", variant, size);
|
|
508
|
+
}
|
|
509
|
+
};
|
|
477
510
|
|
|
478
511
|
// src/hierarchy/TileParent.tsx
|
|
479
512
|
import { useState, useRef, useEffect } from "react";
|
|
@@ -564,9 +597,18 @@ var TileParent = ({
|
|
|
564
597
|
}
|
|
565
598
|
);
|
|
566
599
|
};
|
|
600
|
+
var TileModel = class extends UIElementBase {
|
|
601
|
+
constructor(id, name, variant = "primary", size = "md") {
|
|
602
|
+
super(id, name, "tile", variant, size);
|
|
603
|
+
}
|
|
604
|
+
};
|
|
605
|
+
var SpawnOptionTile = (props) => /* @__PURE__ */ jsx4(TileParent, { ...props });
|
|
606
|
+
var CategoryCardTile = (props) => /* @__PURE__ */ jsx4(TileParent, { ...props });
|
|
607
|
+
var ClipCardTile = (props) => /* @__PURE__ */ jsx4(TileParent, { ...props });
|
|
608
|
+
var ChannelStripTile = (props) => /* @__PURE__ */ jsx4(TileParent, { ...props });
|
|
567
609
|
|
|
568
610
|
// src/hierarchy/BadgeParent.tsx
|
|
569
|
-
import
|
|
611
|
+
import React5 from "react";
|
|
570
612
|
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
571
613
|
var Badge = ({
|
|
572
614
|
id,
|
|
@@ -576,7 +618,7 @@ var Badge = ({
|
|
|
576
618
|
className = ""
|
|
577
619
|
}) => {
|
|
578
620
|
const palette = usePalette();
|
|
579
|
-
const colorStyle =
|
|
621
|
+
const colorStyle = React5.useMemo(() => {
|
|
580
622
|
switch (variant) {
|
|
581
623
|
case "accent":
|
|
582
624
|
return {
|
|
@@ -685,19 +727,43 @@ var StatusDot = ({
|
|
|
685
727
|
}
|
|
686
728
|
);
|
|
687
729
|
};
|
|
730
|
+
var BadgeModel = class extends UIElementBase {
|
|
731
|
+
constructor(id, name, variant = "primary", size = "md") {
|
|
732
|
+
super(id, name, "badge", variant, size);
|
|
733
|
+
}
|
|
734
|
+
};
|
|
688
735
|
|
|
689
736
|
export {
|
|
690
737
|
registerPaletteResolver,
|
|
691
738
|
UIElementBase,
|
|
692
739
|
UIModel,
|
|
740
|
+
UIParent,
|
|
693
741
|
ButtonParent,
|
|
742
|
+
ButtonModel,
|
|
743
|
+
ActionButton,
|
|
744
|
+
IconButton,
|
|
745
|
+
ToggleButton,
|
|
746
|
+
DangerButton,
|
|
747
|
+
GhostButton,
|
|
694
748
|
PanelParent,
|
|
749
|
+
PanelModel,
|
|
750
|
+
ModalPanel,
|
|
751
|
+
InspectorPanel,
|
|
752
|
+
CardPanel,
|
|
753
|
+
ToolbarPanel,
|
|
695
754
|
SliderInput,
|
|
696
755
|
TextInput,
|
|
697
756
|
SelectInput,
|
|
698
757
|
ToggleInput,
|
|
758
|
+
InputModel,
|
|
699
759
|
TileParent,
|
|
760
|
+
TileModel,
|
|
761
|
+
SpawnOptionTile,
|
|
762
|
+
CategoryCardTile,
|
|
763
|
+
ClipCardTile,
|
|
764
|
+
ChannelStripTile,
|
|
700
765
|
Badge,
|
|
701
766
|
TelemetryPill,
|
|
702
|
-
StatusDot
|
|
767
|
+
StatusDot,
|
|
768
|
+
BadgeModel
|
|
703
769
|
};
|
|
@@ -5,6 +5,9 @@ import {
|
|
|
5
5
|
CredentialField,
|
|
6
6
|
KNOWN_CREDENTIAL_URLS
|
|
7
7
|
} from "../../chunk-KIFQA7L6.js";
|
|
8
|
+
import {
|
|
9
|
+
BaseTooltip
|
|
10
|
+
} from "../../chunk-GKP6KHTI.js";
|
|
8
11
|
import {
|
|
9
12
|
BaseBadge,
|
|
10
13
|
BaseCard
|
|
@@ -12,9 +15,6 @@ import {
|
|
|
12
15
|
import {
|
|
13
16
|
BaseInput
|
|
14
17
|
} from "../../chunk-W42SJGOJ.js";
|
|
15
|
-
import {
|
|
16
|
-
BaseTooltip
|
|
17
|
-
} from "../../chunk-GKP6KHTI.js";
|
|
18
18
|
import "../../chunk-62ITRDJX.js";
|
|
19
19
|
import {
|
|
20
20
|
BaseButton
|
|
@@ -7,16 +7,16 @@ import {
|
|
|
7
7
|
SearchableList,
|
|
8
8
|
StatusIndicator,
|
|
9
9
|
useSearchKeyboardNavigation
|
|
10
|
-
} from "../../chunk-
|
|
10
|
+
} from "../../chunk-VEWPTZGO.js";
|
|
11
|
+
import {
|
|
12
|
+
IconOnlyButton
|
|
13
|
+
} from "../../chunk-OR5ZNJI4.js";
|
|
11
14
|
import {
|
|
12
15
|
CopyableLogViewer
|
|
13
16
|
} from "../../chunk-RLQ2ALJG.js";
|
|
17
|
+
import "../../chunk-GKP6KHTI.js";
|
|
14
18
|
import "../../chunk-UOR4P6PO.js";
|
|
15
19
|
import "../../chunk-W42SJGOJ.js";
|
|
16
|
-
import {
|
|
17
|
-
IconOnlyButton
|
|
18
|
-
} from "../../chunk-OR5ZNJI4.js";
|
|
19
|
-
import "../../chunk-GKP6KHTI.js";
|
|
20
20
|
import "../../chunk-62ITRDJX.js";
|
|
21
21
|
import "../../chunk-A2CDQISJ.js";
|
|
22
22
|
export {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SettingsTab,
|
|
3
3
|
ThemeSettingsSection
|
|
4
|
-
} from "../../chunk-
|
|
5
|
-
import "../../chunk-RLQ2ALJG.js";
|
|
4
|
+
} from "../../chunk-ATQPZLJX.js";
|
|
6
5
|
import "../../chunk-DZJ3NSCX.js";
|
|
6
|
+
import "../../chunk-RLQ2ALJG.js";
|
|
7
7
|
import "../../chunk-UOR4P6PO.js";
|
|
8
8
|
import "../../chunk-A2CDQISJ.js";
|
|
9
9
|
export {
|
|
@@ -2,6 +2,27 @@ import React__default from 'react';
|
|
|
2
2
|
import { GraphEntityParent } from '@ultrst-armada/kloks/state-graph';
|
|
3
3
|
|
|
4
4
|
type GraphEntityMetadata = Record<string, any>;
|
|
5
|
+
interface UIInteractionState {
|
|
6
|
+
isHovered?: boolean;
|
|
7
|
+
isActive?: boolean;
|
|
8
|
+
isFocused?: boolean;
|
|
9
|
+
isDisabled?: boolean;
|
|
10
|
+
isSelected?: boolean;
|
|
11
|
+
}
|
|
12
|
+
interface UIStyleTokens {
|
|
13
|
+
bgPrimary?: string;
|
|
14
|
+
bgSecondary?: string;
|
|
15
|
+
bgSurface?: string;
|
|
16
|
+
bgElevated?: string;
|
|
17
|
+
textPrimary?: string;
|
|
18
|
+
textSecondary?: string;
|
|
19
|
+
textMuted?: string;
|
|
20
|
+
accentPrimary?: string;
|
|
21
|
+
accentSecondary?: string;
|
|
22
|
+
borderSubtle?: string;
|
|
23
|
+
borderMedium?: string;
|
|
24
|
+
[key: string]: any;
|
|
25
|
+
}
|
|
5
26
|
type ColorPalette = Record<string, any>;
|
|
6
27
|
declare function registerPaletteResolver(fn: () => ColorPalette): void;
|
|
7
28
|
type UIRole = 'panel' | 'button' | 'input' | 'tile' | 'badge';
|
|
@@ -49,6 +70,10 @@ type UIProps = UIBaseProps;
|
|
|
49
70
|
declare abstract class UIModel extends UIElementBase {
|
|
50
71
|
constructor(id: string, name: string, variant?: UIVariant, size?: UISize);
|
|
51
72
|
}
|
|
73
|
+
interface UIParentProps extends UIBaseProps {
|
|
74
|
+
as?: React__default.ElementType;
|
|
75
|
+
}
|
|
76
|
+
declare const UIParent: React__default.FC<UIParentProps>;
|
|
52
77
|
|
|
53
78
|
interface ButtonParentProps extends React__default.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
54
79
|
variant?: UIVariant;
|
|
@@ -63,6 +88,18 @@ interface ButtonParentProps extends React__default.ButtonHTMLAttributes<HTMLButt
|
|
|
63
88
|
}
|
|
64
89
|
declare const ButtonParent: React__default.FC<ButtonParentProps>;
|
|
65
90
|
|
|
91
|
+
declare class ButtonModel extends UIElementBase {
|
|
92
|
+
constructor(id: string, name: string, variant?: UIVariant, size?: UISize);
|
|
93
|
+
}
|
|
94
|
+
type ButtonVariant = UIVariant;
|
|
95
|
+
type ButtonSize = UISize;
|
|
96
|
+
type ButtonProps = ButtonParentProps;
|
|
97
|
+
declare const ActionButton: React__default.FC<ButtonParentProps>;
|
|
98
|
+
declare const IconButton: React__default.FC<ButtonParentProps>;
|
|
99
|
+
declare const ToggleButton: React__default.FC<ButtonParentProps>;
|
|
100
|
+
declare const DangerButton: React__default.FC<ButtonParentProps>;
|
|
101
|
+
declare const GhostButton: React__default.FC<ButtonParentProps>;
|
|
102
|
+
|
|
66
103
|
interface PanelParentProps {
|
|
67
104
|
id?: string;
|
|
68
105
|
title: string;
|
|
@@ -86,6 +123,16 @@ interface PanelParentProps {
|
|
|
86
123
|
}
|
|
87
124
|
declare const PanelParent: React__default.FC<PanelParentProps>;
|
|
88
125
|
|
|
126
|
+
declare class PanelModel extends UIElementBase {
|
|
127
|
+
constructor(id: string, name: string, variant?: UIVariant, size?: UISize);
|
|
128
|
+
}
|
|
129
|
+
type PanelVariant = 'modal' | 'inspector' | 'card' | 'toolbar' | 'default';
|
|
130
|
+
type PanelProps = PanelParentProps;
|
|
131
|
+
declare const ModalPanel: React__default.FC<PanelParentProps>;
|
|
132
|
+
declare const InspectorPanel: React__default.FC<PanelParentProps>;
|
|
133
|
+
declare const CardPanel: React__default.FC<PanelParentProps>;
|
|
134
|
+
declare const ToolbarPanel: React__default.FC<PanelParentProps>;
|
|
135
|
+
|
|
89
136
|
interface SliderInputProps {
|
|
90
137
|
id?: string;
|
|
91
138
|
value: number;
|
|
@@ -120,6 +167,10 @@ interface ToggleInputProps {
|
|
|
120
167
|
}
|
|
121
168
|
declare const ToggleInput: React__default.FC<ToggleInputProps>;
|
|
122
169
|
|
|
170
|
+
declare class InputModel extends UIElementBase {
|
|
171
|
+
constructor(id: string, name: string, variant?: UIVariant, size?: UISize);
|
|
172
|
+
}
|
|
173
|
+
|
|
123
174
|
interface TileParentProps {
|
|
124
175
|
id: string;
|
|
125
176
|
icon?: React__default.ReactNode;
|
|
@@ -141,6 +192,15 @@ interface TileParentProps {
|
|
|
141
192
|
}
|
|
142
193
|
declare const TileParent: React__default.FC<TileParentProps>;
|
|
143
194
|
|
|
195
|
+
declare class TileModel extends UIElementBase {
|
|
196
|
+
constructor(id: string, name: string, variant?: UIVariant, size?: UISize);
|
|
197
|
+
}
|
|
198
|
+
type TileVariant = 'default' | 'clip' | 'category' | 'strip';
|
|
199
|
+
declare const SpawnOptionTile: React__default.FC<TileParentProps>;
|
|
200
|
+
declare const CategoryCardTile: React__default.FC<TileParentProps>;
|
|
201
|
+
declare const ClipCardTile: React__default.FC<TileParentProps>;
|
|
202
|
+
declare const ChannelStripTile: React__default.FC<TileParentProps>;
|
|
203
|
+
|
|
144
204
|
interface BadgeProps {
|
|
145
205
|
id?: string;
|
|
146
206
|
label: string;
|
|
@@ -165,4 +225,9 @@ interface StatusDotProps {
|
|
|
165
225
|
}
|
|
166
226
|
declare const StatusDot: React__default.FC<StatusDotProps>;
|
|
167
227
|
|
|
168
|
-
|
|
228
|
+
declare class BadgeModel extends UIElementBase {
|
|
229
|
+
constructor(id: string, name: string, variant?: UIVariant, size?: UISize);
|
|
230
|
+
}
|
|
231
|
+
type BadgeTone = 'primary' | 'accent' | 'success' | 'warning' | 'danger' | 'info';
|
|
232
|
+
|
|
233
|
+
export { ActionButton, Badge, BadgeModel, type BadgeProps, type BadgeTone, ButtonModel, ButtonParent, type ButtonParentProps, type ButtonProps, type ButtonSize, type ButtonVariant, CardPanel, CategoryCardTile, ChannelStripTile, ClipCardTile, type ColorPalette, DangerButton, GhostButton, type GraphEntityMetadata, IconButton, InputModel, InspectorPanel, ModalPanel, PanelModel, PanelParent, type PanelParentProps, type PanelProps, type PanelVariant, SelectInput, type SelectInputProps, SliderInput, type SliderInputProps, SpawnOptionTile, StatusDot, type StatusDotProps, TelemetryPill, type TelemetryPillProps, TextInput, type TextInputProps, TileModel, TileParent, type TileParentProps, type TileVariant, ToggleButton, ToggleInput, type ToggleInputProps, ToolbarPanel, type TooltipDirection, type UIBaseProps, UIElementBase, type UIInteractionState, UIModel, UIParent, type UIParentProps, type UIProps, type UIRole, type UISize, type UIStyleTokens, type UIVariant, registerPaletteResolver };
|