@almadar/ui 2.20.6 → 2.20.8
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/dist/runtime/index.cjs +9 -6
- package/dist/runtime/index.js +9 -6
- package/index.css +156 -0
- package/package.json +5 -4
package/dist/runtime/index.cjs
CHANGED
|
@@ -32172,7 +32172,7 @@ function normalizeChild(child) {
|
|
|
32172
32172
|
props: { ...rest, ...normalizedChildren !== void 0 ? { children: normalizedChildren } : {} }
|
|
32173
32173
|
};
|
|
32174
32174
|
}
|
|
32175
|
-
function SlotBridge() {
|
|
32175
|
+
function SlotBridge({ mockData }) {
|
|
32176
32176
|
const slots = useSlots();
|
|
32177
32177
|
const { render, clear } = context.useUISlots();
|
|
32178
32178
|
React112.useEffect(() => {
|
|
@@ -32182,7 +32182,10 @@ function SlotBridge() {
|
|
|
32182
32182
|
continue;
|
|
32183
32183
|
}
|
|
32184
32184
|
const entry = slotState.patterns[slotState.patterns.length - 1];
|
|
32185
|
-
|
|
32185
|
+
let patternRecord = entry.pattern;
|
|
32186
|
+
if (mockData && Object.keys(mockData).length > 0) {
|
|
32187
|
+
patternRecord = enrichFromResponse(patternRecord, mockData);
|
|
32188
|
+
}
|
|
32186
32189
|
const { type: patternType, children, ...inlineProps } = patternRecord;
|
|
32187
32190
|
const normalizedChildren = Array.isArray(children) ? children.map((c) => normalizeChild(c)) : children;
|
|
32188
32191
|
render({
|
|
@@ -32196,7 +32199,7 @@ function SlotBridge() {
|
|
|
32196
32199
|
sourceTrait: slotState.source?.trait
|
|
32197
32200
|
});
|
|
32198
32201
|
}
|
|
32199
|
-
}, [slots, render, clear]);
|
|
32202
|
+
}, [slots, render, clear, mockData]);
|
|
32200
32203
|
return null;
|
|
32201
32204
|
}
|
|
32202
32205
|
function TraitInitializer({ traits: traits2, orbitalNames }) {
|
|
@@ -32245,7 +32248,7 @@ function TraitInitializer({ traits: traits2, orbitalNames }) {
|
|
|
32245
32248
|
}, [bridge.connected, orbitalNames, bridge.sendEvent, slotsActions]);
|
|
32246
32249
|
return null;
|
|
32247
32250
|
}
|
|
32248
|
-
function SchemaRunner({ schema, serverUrl }) {
|
|
32251
|
+
function SchemaRunner({ schema, serverUrl, mockData }) {
|
|
32249
32252
|
const { traits: traits2, allEntities, ir } = useResolvedSchema(schema);
|
|
32250
32253
|
const allPageTraits = React112.useMemo(() => {
|
|
32251
32254
|
if (!ir?.pages || ir.pages.size <= 1) return traits2;
|
|
@@ -32272,7 +32275,7 @@ function SchemaRunner({ schema, serverUrl }) {
|
|
|
32272
32275
|
}, [schema]);
|
|
32273
32276
|
const inner = /* @__PURE__ */ jsxRuntime.jsx(VerificationProvider, { enabled: true, children: /* @__PURE__ */ jsxRuntime.jsx(SlotsProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(EntitySchemaProvider, { entities: Array.from(allEntities.values()), children: [
|
|
32274
32277
|
/* @__PURE__ */ jsxRuntime.jsx(TraitInitializer, { traits: allPageTraits, orbitalNames: serverUrl ? orbitalNames : void 0 }),
|
|
32275
|
-
/* @__PURE__ */ jsxRuntime.jsx(SlotBridge, {}),
|
|
32278
|
+
/* @__PURE__ */ jsxRuntime.jsx(SlotBridge, { mockData: !serverUrl ? mockData : void 0 }),
|
|
32276
32279
|
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "min-h-full p-4", children: /* @__PURE__ */ jsxRuntime.jsx(UISlotRenderer, { includeHud: true, hudMode: "inline", includeFloating: true }) })
|
|
32277
32280
|
] }) }) });
|
|
32278
32281
|
if (serverUrl) {
|
|
@@ -32308,7 +32311,7 @@ function OrbPreview({
|
|
|
32308
32311
|
{
|
|
32309
32312
|
className: `overflow-auto border border-[var(--color-border)] rounded-[var(--radius-md)] ${className ?? ""}`,
|
|
32310
32313
|
style: { height },
|
|
32311
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(OrbitalProvider, { initialData: mockData, skipTheme: true, verification: true, children: /* @__PURE__ */ jsxRuntime.jsx(context.UISlotProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(SchemaRunner, { schema: parsedSchema, serverUrl }) }) })
|
|
32314
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(OrbitalProvider, { initialData: mockData, skipTheme: true, verification: true, children: /* @__PURE__ */ jsxRuntime.jsx(context.UISlotProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(SchemaRunner, { schema: parsedSchema, serverUrl, mockData }) }) })
|
|
32312
32315
|
}
|
|
32313
32316
|
);
|
|
32314
32317
|
}
|
package/dist/runtime/index.js
CHANGED
|
@@ -32142,7 +32142,7 @@ function normalizeChild(child) {
|
|
|
32142
32142
|
props: { ...rest, ...normalizedChildren !== void 0 ? { children: normalizedChildren } : {} }
|
|
32143
32143
|
};
|
|
32144
32144
|
}
|
|
32145
|
-
function SlotBridge() {
|
|
32145
|
+
function SlotBridge({ mockData }) {
|
|
32146
32146
|
const slots = useSlots();
|
|
32147
32147
|
const { render, clear } = useUISlots();
|
|
32148
32148
|
useEffect(() => {
|
|
@@ -32152,7 +32152,10 @@ function SlotBridge() {
|
|
|
32152
32152
|
continue;
|
|
32153
32153
|
}
|
|
32154
32154
|
const entry = slotState.patterns[slotState.patterns.length - 1];
|
|
32155
|
-
|
|
32155
|
+
let patternRecord = entry.pattern;
|
|
32156
|
+
if (mockData && Object.keys(mockData).length > 0) {
|
|
32157
|
+
patternRecord = enrichFromResponse(patternRecord, mockData);
|
|
32158
|
+
}
|
|
32156
32159
|
const { type: patternType, children, ...inlineProps } = patternRecord;
|
|
32157
32160
|
const normalizedChildren = Array.isArray(children) ? children.map((c) => normalizeChild(c)) : children;
|
|
32158
32161
|
render({
|
|
@@ -32166,7 +32169,7 @@ function SlotBridge() {
|
|
|
32166
32169
|
sourceTrait: slotState.source?.trait
|
|
32167
32170
|
});
|
|
32168
32171
|
}
|
|
32169
|
-
}, [slots, render, clear]);
|
|
32172
|
+
}, [slots, render, clear, mockData]);
|
|
32170
32173
|
return null;
|
|
32171
32174
|
}
|
|
32172
32175
|
function TraitInitializer({ traits: traits2, orbitalNames }) {
|
|
@@ -32215,7 +32218,7 @@ function TraitInitializer({ traits: traits2, orbitalNames }) {
|
|
|
32215
32218
|
}, [bridge.connected, orbitalNames, bridge.sendEvent, slotsActions]);
|
|
32216
32219
|
return null;
|
|
32217
32220
|
}
|
|
32218
|
-
function SchemaRunner({ schema, serverUrl }) {
|
|
32221
|
+
function SchemaRunner({ schema, serverUrl, mockData }) {
|
|
32219
32222
|
const { traits: traits2, allEntities, ir } = useResolvedSchema(schema);
|
|
32220
32223
|
const allPageTraits = useMemo(() => {
|
|
32221
32224
|
if (!ir?.pages || ir.pages.size <= 1) return traits2;
|
|
@@ -32242,7 +32245,7 @@ function SchemaRunner({ schema, serverUrl }) {
|
|
|
32242
32245
|
}, [schema]);
|
|
32243
32246
|
const inner = /* @__PURE__ */ jsx(VerificationProvider, { enabled: true, children: /* @__PURE__ */ jsx(SlotsProvider, { children: /* @__PURE__ */ jsxs(EntitySchemaProvider, { entities: Array.from(allEntities.values()), children: [
|
|
32244
32247
|
/* @__PURE__ */ jsx(TraitInitializer, { traits: allPageTraits, orbitalNames: serverUrl ? orbitalNames : void 0 }),
|
|
32245
|
-
/* @__PURE__ */ jsx(SlotBridge, {}),
|
|
32248
|
+
/* @__PURE__ */ jsx(SlotBridge, { mockData: !serverUrl ? mockData : void 0 }),
|
|
32246
32249
|
/* @__PURE__ */ jsx(Box, { className: "min-h-full p-4", children: /* @__PURE__ */ jsx(UISlotRenderer, { includeHud: true, hudMode: "inline", includeFloating: true }) })
|
|
32247
32250
|
] }) }) });
|
|
32248
32251
|
if (serverUrl) {
|
|
@@ -32278,7 +32281,7 @@ function OrbPreview({
|
|
|
32278
32281
|
{
|
|
32279
32282
|
className: `overflow-auto border border-[var(--color-border)] rounded-[var(--radius-md)] ${className ?? ""}`,
|
|
32280
32283
|
style: { height },
|
|
32281
|
-
children: /* @__PURE__ */ jsx(OrbitalProvider, { initialData: mockData, skipTheme: true, verification: true, children: /* @__PURE__ */ jsx(UISlotProvider, { children: /* @__PURE__ */ jsx(SchemaRunner, { schema: parsedSchema, serverUrl }) }) })
|
|
32284
|
+
children: /* @__PURE__ */ jsx(OrbitalProvider, { initialData: mockData, skipTheme: true, verification: true, children: /* @__PURE__ */ jsx(UISlotProvider, { children: /* @__PURE__ */ jsx(SchemaRunner, { schema: parsedSchema, serverUrl, mockData }) }) })
|
|
32282
32285
|
}
|
|
32283
32286
|
);
|
|
32284
32287
|
}
|
package/index.css
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Design System Styles
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/* Load Plus Jakarta Sans from Google Fonts (Track A: preferred UI font) */
|
|
6
|
+
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');
|
|
7
|
+
|
|
8
|
+
@tailwind base;
|
|
9
|
+
@tailwind components;
|
|
10
|
+
@tailwind utilities;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Default fallback theme (minimalist-light — UI/UX improved per Track A eval)
|
|
14
|
+
* Applied when no data-theme attribute is set.
|
|
15
|
+
*/
|
|
16
|
+
:root:not([data-theme]) {
|
|
17
|
+
--shadow-main: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
|
|
18
|
+
--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
|
|
19
|
+
--shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
|
|
20
|
+
--shadow-inner: inset 0 1px 2px rgba(0, 0, 0, 0.05);
|
|
21
|
+
--shadow-none: none;
|
|
22
|
+
/* Track A: more pronounced hover lift for interactive cards */
|
|
23
|
+
--shadow-hover: 0 8px 30px -8px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.08);
|
|
24
|
+
--shadow-active: 0 1px 2px rgba(0, 0, 0, 0.05);
|
|
25
|
+
|
|
26
|
+
--radius-none: 0px;
|
|
27
|
+
--radius-sm: 6px;
|
|
28
|
+
/* Track A: bump radii from 8/12 → 10/14 for a more modern feel */
|
|
29
|
+
--radius-md: 10px;
|
|
30
|
+
--radius-lg: 14px;
|
|
31
|
+
--radius-xl: 18px;
|
|
32
|
+
--radius-full: 9999px;
|
|
33
|
+
|
|
34
|
+
--border-width: 1px;
|
|
35
|
+
--border-width-thin: 1px;
|
|
36
|
+
--border-width-thick: 2px;
|
|
37
|
+
|
|
38
|
+
--color-primary: #18181b;
|
|
39
|
+
--color-primary-hover: #27272a;
|
|
40
|
+
--color-primary-foreground: #fafafa;
|
|
41
|
+
--color-secondary: #fafafa;
|
|
42
|
+
--color-secondary-hover: #f4f4f5;
|
|
43
|
+
--color-secondary-foreground: #18181b;
|
|
44
|
+
--color-accent: #18181b;
|
|
45
|
+
--color-accent-foreground: #fafafa;
|
|
46
|
+
--color-muted: #f1f5f9;
|
|
47
|
+
/* Track A: slightly darker muted-foreground for legibility */
|
|
48
|
+
--color-muted-foreground: #64748b;
|
|
49
|
+
/* Track A: background ≠ card → natural surface elevation */
|
|
50
|
+
--color-background: #f8fafc;
|
|
51
|
+
--color-foreground: #0f172a;
|
|
52
|
+
--color-card: #ffffff;
|
|
53
|
+
--color-card-foreground: #0f172a;
|
|
54
|
+
--color-surface: #f1f5f9;
|
|
55
|
+
/* Track A: soften border — semi-transparent instead of solid gray */
|
|
56
|
+
--color-border: rgba(0, 0, 0, 0.08);
|
|
57
|
+
--color-input: #e2e8f0;
|
|
58
|
+
--color-ring: #18181b;
|
|
59
|
+
|
|
60
|
+
--color-error: #dc2626;
|
|
61
|
+
--color-error-foreground: #ffffff;
|
|
62
|
+
--color-success: #16a34a;
|
|
63
|
+
--color-success-foreground: #ffffff;
|
|
64
|
+
--color-warning: #ca8a04;
|
|
65
|
+
--color-warning-foreground: #000000;
|
|
66
|
+
--color-info: #2563eb;
|
|
67
|
+
--color-info-foreground: #ffffff;
|
|
68
|
+
|
|
69
|
+
/* Track A: Plus Jakarta Sans as first preference, Inter as fallback */
|
|
70
|
+
--font-family:
|
|
71
|
+
"Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
72
|
+
--font-weight-normal: 400;
|
|
73
|
+
--font-weight-medium: 500;
|
|
74
|
+
--font-weight-bold: 600;
|
|
75
|
+
--letter-spacing: -0.015em;
|
|
76
|
+
--line-height: 1.6;
|
|
77
|
+
|
|
78
|
+
--icon-stroke-width: 1.5;
|
|
79
|
+
--icon-color: currentColor;
|
|
80
|
+
|
|
81
|
+
--transition-fast: 150ms;
|
|
82
|
+
--transition-normal: 250ms;
|
|
83
|
+
--transition-slow: 400ms;
|
|
84
|
+
--transition-timing: cubic-bezier(0.4, 0, 0.2, 1);
|
|
85
|
+
|
|
86
|
+
--hover-scale: 1.01;
|
|
87
|
+
--hover-translate-y: -2px;
|
|
88
|
+
--hover-translate-x: 0;
|
|
89
|
+
--active-scale: 0.99;
|
|
90
|
+
--active-translate-y: 0;
|
|
91
|
+
|
|
92
|
+
--focus-ring-width: 2px;
|
|
93
|
+
--focus-ring-offset: 2px;
|
|
94
|
+
--focus-ring-color: #18181b;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
html {
|
|
98
|
+
font-family: var(--font-family);
|
|
99
|
+
line-height: var(--line-height);
|
|
100
|
+
letter-spacing: var(--letter-spacing);
|
|
101
|
+
font-weight: var(--font-weight-normal);
|
|
102
|
+
color-scheme: light dark;
|
|
103
|
+
font-synthesis: none;
|
|
104
|
+
text-rendering: optimizeLegibility;
|
|
105
|
+
-webkit-font-smoothing: antialiased;
|
|
106
|
+
-moz-osx-font-smoothing: grayscale;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
body {
|
|
110
|
+
margin: 0;
|
|
111
|
+
min-height: 100vh;
|
|
112
|
+
background-color: var(--color-background);
|
|
113
|
+
color: var(--color-foreground);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
#root {
|
|
117
|
+
min-height: 100vh;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
::-webkit-scrollbar {
|
|
121
|
+
width: 8px;
|
|
122
|
+
height: 8px;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
::-webkit-scrollbar-track {
|
|
126
|
+
background: var(--color-muted);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
::-webkit-scrollbar-thumb {
|
|
130
|
+
background: var(--color-muted-foreground);
|
|
131
|
+
border-radius: var(--radius-sm);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
::-webkit-scrollbar-thumb:hover {
|
|
135
|
+
background: var(--color-foreground);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
@layer utilities {
|
|
139
|
+
.shadow-theme { box-shadow: var(--shadow-main); }
|
|
140
|
+
.shadow-theme-sm { box-shadow: var(--shadow-sm); }
|
|
141
|
+
.shadow-theme-lg { box-shadow: var(--shadow-lg); }
|
|
142
|
+
.rounded-theme { border-radius: var(--radius-md); }
|
|
143
|
+
.rounded-theme-sm { border-radius: var(--radius-sm); }
|
|
144
|
+
.rounded-theme-lg { border-radius: var(--radius-lg); }
|
|
145
|
+
.border-theme { border-width: var(--border-width); border-color: var(--color-border); }
|
|
146
|
+
.bg-theme-primary { background-color: var(--color-primary); }
|
|
147
|
+
.bg-theme-secondary { background-color: var(--color-secondary); }
|
|
148
|
+
.bg-theme-background { background-color: var(--color-background); }
|
|
149
|
+
.bg-theme-card { background-color: var(--color-card); }
|
|
150
|
+
.text-theme-foreground { color: var(--color-foreground); }
|
|
151
|
+
.text-theme-muted { color: var(--color-muted-foreground); }
|
|
152
|
+
.text-theme-primary { color: var(--color-primary); }
|
|
153
|
+
.font-theme-normal { font-weight: var(--font-weight-normal); }
|
|
154
|
+
.font-theme-medium { font-weight: var(--font-weight-medium); }
|
|
155
|
+
.font-theme-bold { font-weight: var(--font-weight-bold); }
|
|
156
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@almadar/ui",
|
|
3
|
-
"version": "2.20.
|
|
3
|
+
"version": "2.20.8",
|
|
4
4
|
"description": "React UI components, hooks, and providers for Almadar",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/components/index.js",
|
|
@@ -103,6 +103,7 @@
|
|
|
103
103
|
},
|
|
104
104
|
"files": [
|
|
105
105
|
"dist",
|
|
106
|
+
"index.css",
|
|
106
107
|
"themes",
|
|
107
108
|
"locales",
|
|
108
109
|
"tailwind-preset.cjs"
|
|
@@ -112,9 +113,9 @@
|
|
|
112
113
|
"access": "public"
|
|
113
114
|
},
|
|
114
115
|
"dependencies": {
|
|
115
|
-
"@almadar/core": ">=2.
|
|
116
|
-
"@almadar/evaluator": ">=2.
|
|
117
|
-
"@almadar/patterns": ">=2.
|
|
116
|
+
"@almadar/core": ">=2.6.3",
|
|
117
|
+
"@almadar/evaluator": ">=2.5.4",
|
|
118
|
+
"@almadar/patterns": ">=2.8.7",
|
|
118
119
|
"@almadar/runtime": ">=2.0.0",
|
|
119
120
|
"clsx": "^2.1.0",
|
|
120
121
|
"elkjs": "0.11.1",
|