@mosaic-media/sdui-react 0.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/LICENSE +661 -0
- package/README.md +54 -0
- package/dist/components/controls.d.ts +34 -0
- package/dist/components/controls.d.ts.map +1 -0
- package/dist/components/controls.js +93 -0
- package/dist/components/controls.js.map +1 -0
- package/dist/components/definitions.d.ts +3 -0
- package/dist/components/definitions.d.ts.map +1 -0
- package/dist/components/definitions.js +494 -0
- package/dist/components/definitions.js.map +1 -0
- package/dist/components/definitions.layout.d.ts +3 -0
- package/dist/components/definitions.layout.d.ts.map +1 -0
- package/dist/components/definitions.layout.js +197 -0
- package/dist/components/definitions.layout.js.map +1 -0
- package/dist/components/feedback/Unknown.d.ts +4 -0
- package/dist/components/feedback/Unknown.d.ts.map +1 -0
- package/dist/components/feedback/Unknown.js +13 -0
- package/dist/components/feedback/Unknown.js.map +1 -0
- package/dist/components/feedback.d.ts +6 -0
- package/dist/components/feedback.d.ts.map +1 -0
- package/dist/components/feedback.js +10 -0
- package/dist/components/feedback.js.map +1 -0
- package/dist/components/host.d.ts +11 -0
- package/dist/components/host.d.ts.map +1 -0
- package/dist/components/host.js +15 -0
- package/dist/components/host.js.map +1 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +60 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/layout.d.ts +9 -0
- package/dist/components/layout.d.ts.map +1 -0
- package/dist/components/layout.js +23 -0
- package/dist/components/layout.js.map +1 -0
- package/dist/components/media.d.ts +5 -0
- package/dist/components/media.d.ts.map +1 -0
- package/dist/components/media.js +15 -0
- package/dist/components/media.js.map +1 -0
- package/dist/components/primitives.d.ts +39 -0
- package/dist/components/primitives.d.ts.map +1 -0
- package/dist/components/primitives.js +75 -0
- package/dist/components/primitives.js.map +1 -0
- package/dist/components/shared.d.ts +13 -0
- package/dist/components/shared.d.ts.map +1 -0
- package/dist/components/shared.js +36 -0
- package/dist/components/shared.js.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/platform.d.ts +12 -0
- package/dist/lib/platform.d.ts.map +1 -0
- package/dist/lib/platform.js +74 -0
- package/dist/lib/platform.js.map +1 -0
- package/dist/sdui/Renderer.d.ts +16 -0
- package/dist/sdui/Renderer.d.ts.map +1 -0
- package/dist/sdui/Renderer.js +40 -0
- package/dist/sdui/Renderer.js.map +1 -0
- package/dist/sdui/ShellProvider.d.ts +24 -0
- package/dist/sdui/ShellProvider.d.ts.map +1 -0
- package/dist/sdui/ShellProvider.js +110 -0
- package/dist/sdui/ShellProvider.js.map +1 -0
- package/dist/sdui/context.d.ts +17 -0
- package/dist/sdui/context.d.ts.map +1 -0
- package/dist/sdui/context.js +18 -0
- package/dist/sdui/context.js.map +1 -0
- package/dist/sdui/registry.d.ts +13 -0
- package/dist/sdui/registry.d.ts.map +1 -0
- package/dist/sdui/registry.js +26 -0
- package/dist/sdui/registry.js.map +1 -0
- package/dist/sdui/style.d.ts +81 -0
- package/dist/sdui/style.d.ts.map +1 -0
- package/dist/sdui/style.js +149 -0
- package/dist/sdui/style.js.map +1 -0
- package/dist/sdui/template.d.ts +19 -0
- package/dist/sdui/template.d.ts.map +1 -0
- package/dist/sdui/template.js +111 -0
- package/dist/sdui/template.js.map +1 -0
- package/dist/sdui/types.d.ts +96 -0
- package/dist/sdui/types.d.ts.map +1 -0
- package/dist/sdui/types.js +4 -0
- package/dist/sdui/types.js.map +1 -0
- package/dist/styles/components.css +772 -0
- package/dist/styles/global.css +80 -0
- package/dist/styles/index.css +5 -0
- package/dist/styles/tokens.css +150 -0
- package/package.json +37 -0
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
// SPDX-FileCopyrightText: 2026 the Mosaic authors
|
|
3
|
+
const screen = {
|
|
4
|
+
name: "Screen",
|
|
5
|
+
template: {
|
|
6
|
+
type: "Box",
|
|
7
|
+
props: { style: { gap: 6 } },
|
|
8
|
+
children: [
|
|
9
|
+
{ type: "Outlet", props: { name: "header" } },
|
|
10
|
+
{
|
|
11
|
+
type: "Box",
|
|
12
|
+
props: { $if: { $bind: "title" }, style: { gap: 1 } },
|
|
13
|
+
children: [
|
|
14
|
+
{ type: "Text", props: { text: { $bind: "title" }, style: { variant: "2xl", weight: "bold" } } },
|
|
15
|
+
{ type: "Text", props: { $if: { $bind: "subtitle" }, text: { $bind: "subtitle" }, style: { color: "text-muted" } } },
|
|
16
|
+
],
|
|
17
|
+
},
|
|
18
|
+
{ type: "Box", props: { style: { gap: 6 } }, children: [{ type: "Outlet" }] },
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
const section = {
|
|
23
|
+
name: "Section",
|
|
24
|
+
params: { actionLabel: "See all" },
|
|
25
|
+
template: {
|
|
26
|
+
type: "Box",
|
|
27
|
+
props: { style: { gap: 4 } },
|
|
28
|
+
children: [
|
|
29
|
+
{
|
|
30
|
+
type: "Box",
|
|
31
|
+
props: { $if: { $bind: "title" }, style: { direction: "row", align: "center", justify: "between", gap: 4 } },
|
|
32
|
+
children: [
|
|
33
|
+
{ type: "Text", props: { text: { $bind: "title" }, style: { variant: "xl", weight: "bold" } } },
|
|
34
|
+
{
|
|
35
|
+
type: "Pressable",
|
|
36
|
+
props: { $if: { $bind: "action" }, action: { $bind: "action" }, style: { direction: "row", align: "center", gap: 1, color: "text-muted" } },
|
|
37
|
+
children: [
|
|
38
|
+
{ type: "Text", props: { text: { $bind: "actionLabel" }, style: { variant: "sm", weight: "medium" } } },
|
|
39
|
+
{ type: "Icon", props: { name: "chevron-right", size: "1em" } },
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
},
|
|
44
|
+
{ type: "Outlet" },
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
const stack = {
|
|
49
|
+
name: "Stack",
|
|
50
|
+
params: { direction: "vertical", gap: 4 },
|
|
51
|
+
template: {
|
|
52
|
+
type: "Box",
|
|
53
|
+
props: {
|
|
54
|
+
style: {
|
|
55
|
+
direction: { $match: { on: { $bind: "direction" }, cases: { horizontal: "row", vertical: "column" }, default: "column" } },
|
|
56
|
+
gap: { $bind: "gap" },
|
|
57
|
+
align: { $bind: "align" },
|
|
58
|
+
justify: { $bind: "justify" },
|
|
59
|
+
wrap: { $bind: "wrap" },
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
children: [{ type: "Outlet" }],
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
const grid = {
|
|
66
|
+
name: "Grid",
|
|
67
|
+
params: { minColumnWidth: 172 },
|
|
68
|
+
template: {
|
|
69
|
+
type: "Box",
|
|
70
|
+
props: { style: { layout: "grid", gridMin: { $bind: "minColumnWidth" }, gap: 4 } },
|
|
71
|
+
children: [{ type: "Outlet" }],
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
const carousel = {
|
|
75
|
+
name: "Carousel",
|
|
76
|
+
params: { itemWidth: 168 },
|
|
77
|
+
template: {
|
|
78
|
+
type: "Box",
|
|
79
|
+
props: { style: { layout: "grid", gridFlow: "column", gridAutoColumns: { $bind: "itemWidth" }, gap: 4, overflowX: "auto", snap: "x", py: 2 } },
|
|
80
|
+
children: [{ type: "Outlet" }],
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
const divider = {
|
|
84
|
+
name: "Divider",
|
|
85
|
+
template: {
|
|
86
|
+
type: "Fragment",
|
|
87
|
+
children: [
|
|
88
|
+
{ type: "Box", props: { $ifNot: { $bind: "label" }, style: { height: 1, bg: "border" } } },
|
|
89
|
+
{
|
|
90
|
+
type: "Box",
|
|
91
|
+
props: { $if: { $bind: "label" }, style: { direction: "row", align: "center", gap: 3 } },
|
|
92
|
+
children: [
|
|
93
|
+
{ type: "Box", props: { style: { height: 1, bg: "border", grow: true } } },
|
|
94
|
+
{ type: "Text", props: { text: { $bind: "label" }, style: { variant: "xs", color: "text-faint", transform: "uppercase" } } },
|
|
95
|
+
{ type: "Box", props: { style: { height: 1, bg: "border", grow: true } } },
|
|
96
|
+
],
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
/** Pagination — server supplies prev/next actions + enabled flags (no client
|
|
102
|
+
* arithmetic; the server knows the page targets). */
|
|
103
|
+
const pagination = {
|
|
104
|
+
name: "Pagination",
|
|
105
|
+
template: {
|
|
106
|
+
type: "Box",
|
|
107
|
+
props: { style: { direction: "row", align: "center", justify: "center", gap: 4 } },
|
|
108
|
+
children: [
|
|
109
|
+
{
|
|
110
|
+
type: "Pressable",
|
|
111
|
+
props: { action: { $bind: "prevAction" }, disabled: { $ifNot: { $bind: "hasPrev" } }, label: "Previous", style: { width: 38, height: 38, radius: "md", align: "center", justify: "center", color: "text-muted" } },
|
|
112
|
+
children: [{ type: "Icon", props: { name: "chevron-right", size: "1.1em" } }],
|
|
113
|
+
},
|
|
114
|
+
{ type: "Text", props: { text: { $bind: "label" }, style: { variant: "sm", color: "text-muted", tabular: true } } },
|
|
115
|
+
{
|
|
116
|
+
type: "Pressable",
|
|
117
|
+
props: { action: { $bind: "nextAction" }, disabled: { $ifNot: { $bind: "hasNext" } }, label: "Next", style: { width: 38, height: 38, radius: "md", align: "center", justify: "center", color: "text-muted" } },
|
|
118
|
+
children: [{ type: "Icon", props: { name: "chevron-right", size: "1.1em" } }],
|
|
119
|
+
},
|
|
120
|
+
],
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
const errorState = {
|
|
124
|
+
name: "ErrorState",
|
|
125
|
+
params: { category: "Internal" },
|
|
126
|
+
template: {
|
|
127
|
+
type: "Box",
|
|
128
|
+
props: { style: { align: "center", gap: 2, p: 6, radius: "lg", border: true, bg: "surface" } },
|
|
129
|
+
children: [
|
|
130
|
+
{
|
|
131
|
+
type: "Icon",
|
|
132
|
+
props: {
|
|
133
|
+
name: { $match: { on: { $bind: "category" }, cases: { InvalidArgument: "warning", PermissionDenied: "warning", Conflict: "warning", Unauthenticated: "info", NotFound: "info" }, default: "error" } },
|
|
134
|
+
color: { $match: { on: { $bind: "category" }, cases: { InvalidArgument: "warning", PermissionDenied: "warning", Conflict: "warning", Unauthenticated: "info", NotFound: "text-faint" }, default: "danger" } },
|
|
135
|
+
size: 28,
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
type: "Text",
|
|
140
|
+
props: {
|
|
141
|
+
text: {
|
|
142
|
+
$match: {
|
|
143
|
+
on: { $bind: "category" },
|
|
144
|
+
cases: {
|
|
145
|
+
InvalidArgument: "That didn't look right",
|
|
146
|
+
Unauthenticated: "Please sign in",
|
|
147
|
+
PermissionDenied: "Not allowed",
|
|
148
|
+
NotFound: "Nothing here",
|
|
149
|
+
Conflict: "Already exists",
|
|
150
|
+
Unavailable: "Platform unavailable",
|
|
151
|
+
Internal: "Something went wrong",
|
|
152
|
+
},
|
|
153
|
+
default: "Something went wrong",
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
style: { variant: "lg", weight: "bold" },
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
{ type: "Text", props: { $if: { $bind: "message" }, text: { $bind: "message" }, style: { color: "text-muted", align: "center" } } },
|
|
160
|
+
{ type: "Text", props: { text: { $bind: "category" }, style: { variant: "xs", color: "text-faint", mono: true } } },
|
|
161
|
+
{
|
|
162
|
+
type: "Pressable",
|
|
163
|
+
props: { $if: { $bind: "retry" }, action: { $bind: "retry" }, style: { direction: "row", align: "center", justify: "center", gap: 2, px: 4, py: 3, radius: "md", bg: "surface-raised", border: true, borderColor: "border-strong" } },
|
|
164
|
+
children: [{ type: "Text", props: { text: "Try again", style: { weight: "medium" } } }],
|
|
165
|
+
},
|
|
166
|
+
],
|
|
167
|
+
},
|
|
168
|
+
};
|
|
169
|
+
const relatedRail = {
|
|
170
|
+
name: "RelatedRail",
|
|
171
|
+
params: { title: "Related" },
|
|
172
|
+
template: {
|
|
173
|
+
type: "Box",
|
|
174
|
+
props: { style: { gap: 4 } },
|
|
175
|
+
children: [
|
|
176
|
+
{ type: "Text", props: { text: { $bind: "title" }, style: { variant: "xl", weight: "bold" } } },
|
|
177
|
+
{ type: "Carousel", props: { $if: { $bind: "$childCount" } }, children: [{ type: "Outlet" }] },
|
|
178
|
+
{
|
|
179
|
+
type: "Box",
|
|
180
|
+
props: { $ifNot: { $bind: "$childCount" }, style: { p: 4, radius: "md", border: true, borderColor: "border-strong" } },
|
|
181
|
+
children: [{ type: "Text", props: { text: "No related titles yet.", style: { variant: "sm", color: "text-faint" } } }],
|
|
182
|
+
},
|
|
183
|
+
],
|
|
184
|
+
},
|
|
185
|
+
};
|
|
186
|
+
export const LAYOUT_DEFINITIONS = [
|
|
187
|
+
screen,
|
|
188
|
+
section,
|
|
189
|
+
stack,
|
|
190
|
+
grid,
|
|
191
|
+
carousel,
|
|
192
|
+
divider,
|
|
193
|
+
pagination,
|
|
194
|
+
errorState,
|
|
195
|
+
relatedRail,
|
|
196
|
+
];
|
|
197
|
+
//# sourceMappingURL=definitions.layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions.layout.js","sourceRoot":"","sources":["../../src/components/definitions.layout.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,kDAAkD;AAgBlD,MAAM,MAAM,GAAwB;IAClC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE;QACR,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE;QAC5B,QAAQ,EAAE;YACR,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;YAC7C;gBACE,IAAI,EAAE,KAAK;gBACX,KAAK,EAAE,EAAE,GAA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file":"Unknown.d.ts","sourceRoot":"","sources":["../../../src/components/feedback/Unknown.tsx"],"names":[],"mappings":"AAUA,wBAAgB,OAAO,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,+BAQjD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
3
|
+
// SPDX-FileCopyrightText: 2026 the Mosaic authors
|
|
4
|
+
/*
|
|
5
|
+
* Rendered when the registry has no component for a node's `type`. This is the
|
|
6
|
+
* forward-compatibility guarantee: an old Shell shown a new node type degrades
|
|
7
|
+
* to a labelled placeholder instead of throwing. Visible in dev, quiet enough
|
|
8
|
+
* not to wreck a layout in production.
|
|
9
|
+
*/
|
|
10
|
+
export function Unknown({ type }) {
|
|
11
|
+
return (_jsxs("div", { className: "msc-unknown", role: "note", "aria-label": `Unknown component: ${type}`, children: [_jsx("span", { className: "msc-unknown__dot", "aria-hidden": true }), _jsx("code", { className: "msc-unknown__type", children: type }), _jsx("span", { className: "msc-unknown__hint", children: "not registered in this Shell" })] }));
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=Unknown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Unknown.js","sourceRoot":"","sources":["../../../src/components/feedback/Unknown.tsx"],"names":[],"mappings":";AAAA,yCAAyC;AACzC,kDAAkD;AAElD;;;;;GAKG;AAEH,MAAM,UAAU,OAAO,CAAC,EAAE,IAAI,EAAoB;IAChD,OAAO,CACL,eAAK,SAAS,EAAC,aAAa,EAAC,IAAI,EAAC,MAAM,gBAAa,sBAAsB,IAAI,EAAE,aAC/E,eAAM,SAAS,EAAC,kBAAkB,wBAAe,EACjD,eAAM,SAAS,EAAC,mBAAmB,YAAE,IAAI,GAAQ,EACjD,eAAM,SAAS,EAAC,mBAAmB,6CAAoC,IACnE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedback.d.ts","sourceRoot":"","sources":["../../src/components/feedback.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAI5C,yEAAyE;AACzE,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,+BAUlD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { prop } from "../sdui/registry";
|
|
3
|
+
import { cx } from "./shared";
|
|
4
|
+
/** Skeleton — shimmer placeholder. `shape` picks a preset silhouette. */
|
|
5
|
+
export function Skeleton({ node }) {
|
|
6
|
+
const shape = prop(node, "shape", "block");
|
|
7
|
+
const count = prop(node, "count", 1);
|
|
8
|
+
return (_jsx("div", { className: cx("msc-skeleton-group", shape === "poster" && "msc-skeleton-group--rail"), children: Array.from({ length: count }).map((_, i) => (_jsx("div", { className: cx("msc-skeleton", `msc-skeleton--${shape}`) }, i))) }));
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=feedback.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedback.js","sourceRoot":"","sources":["../../src/components/feedback.tsx"],"names":[],"mappings":";AAUA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAE9B,yEAAyE;AACzE,MAAM,UAAU,QAAQ,CAAC,EAAE,IAAI,EAAoB;IACjD,MAAM,KAAK,GAAG,IAAI,CAAyC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACnF,MAAM,KAAK,GAAG,IAAI,CAAS,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;IAC7C,OAAO,CACL,cAAK,SAAS,EAAE,EAAE,CAAC,oBAAoB,EAAE,KAAK,KAAK,QAAQ,IAAI,0BAA0B,CAAC,YACvF,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAC3C,cAAa,SAAS,EAAE,EAAE,CAAC,cAAc,EAAE,iBAAiB,KAAK,EAAE,CAAC,IAA1D,CAAC,CAA6D,CACzE,CAAC,GACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { OverlayHandle } from "../sdui/context";
|
|
2
|
+
import type { ToastItem } from "../sdui/ShellProvider";
|
|
3
|
+
export declare function OverlayHost({ overlays, onDismiss, }: {
|
|
4
|
+
overlays: OverlayHandle[];
|
|
5
|
+
onDismiss: () => void;
|
|
6
|
+
}): import("react").JSX.Element | null;
|
|
7
|
+
export declare function ToastHost({ toasts, onDismiss, }: {
|
|
8
|
+
toasts: ToastItem[];
|
|
9
|
+
onDismiss: (id: string) => void;
|
|
10
|
+
}): import("react").JSX.Element | null;
|
|
11
|
+
//# sourceMappingURL=host.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../src/components/host.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGvD,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,SAAS,GACV,EAAE;IACD,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB,sCAgBA;AAED,wBAAgB,SAAS,CAAC,EACxB,MAAM,EACN,SAAS,GACV,EAAE;IACD,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,SAAS,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC,sCAcA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { RenderNode } from "../sdui/Renderer";
|
|
3
|
+
import { cx, Icon } from "./shared";
|
|
4
|
+
export function OverlayHost({ overlays, onDismiss, }) {
|
|
5
|
+
if (overlays.length === 0)
|
|
6
|
+
return null;
|
|
7
|
+
const top = overlays[overlays.length - 1];
|
|
8
|
+
return (_jsxs("div", { className: cx("msc-overlay", `msc-overlay--${top.surface}`), children: [_jsx("div", { className: "msc-overlay__scrim", onClick: onDismiss }), _jsxs("div", { className: "msc-overlay__panel", role: "dialog", "aria-modal": "true", children: [_jsx("button", { className: "msc-overlay__close", "aria-label": "Close", onClick: onDismiss, children: _jsx(Icon, { name: "close" }) }), _jsx("div", { className: "msc-overlay__content", children: _jsx(RenderNode, { node: top.node }) })] })] }));
|
|
9
|
+
}
|
|
10
|
+
export function ToastHost({ toasts, onDismiss, }) {
|
|
11
|
+
if (toasts.length === 0)
|
|
12
|
+
return null;
|
|
13
|
+
return (_jsx("div", { className: "msc-toasts", role: "region", "aria-label": "Notifications", children: toasts.map((t) => (_jsxs("div", { className: cx("msc-toast", `msc-toast--${t.tone}`), children: [_jsx("span", { className: "msc-toast__message", children: t.message }), _jsx("button", { className: "msc-toast__close", "aria-label": "Dismiss", onClick: () => onDismiss(t.id), children: _jsx(Icon, { name: "close" }) })] }, t.id))) }));
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=host.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host.js","sourceRoot":"","sources":["../../src/components/host.tsx"],"names":[],"mappings":";AAUA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEpC,MAAM,UAAU,WAAW,CAAC,EAC1B,QAAQ,EACR,SAAS,GAIV;I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C,CAAC,EAAE,CAKR,CACP,CAAC,GACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAgCA,iFAAiF;AACjF,wBAAgB,iBAAiB,IAAI,IAAI,CAiCxC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
// SPDX-FileCopyrightText: 2026 the Mosaic authors
|
|
3
|
+
/*
|
|
4
|
+
* The component catalogue. Two tiers register here:
|
|
5
|
+
*
|
|
6
|
+
* 1. PRIMITIVES — the irreducible, client-provided vocabulary. This is the
|
|
7
|
+
* only native code, and it is the tech-agnostic contract each client (web,
|
|
8
|
+
* Flutter) implements. Presentational (Box/Text/Image/Icon/Spacer/Fragment/
|
|
9
|
+
* Outlet), interactive/stateful (Pressable + the form inputs, Tabs, Menu,
|
|
10
|
+
* RatingControl, SeasonSelector), and computed/animated (ProgressBar,
|
|
11
|
+
* Skeleton) leaves that a static data tree genuinely cannot express.
|
|
12
|
+
*
|
|
13
|
+
* 2. DEFINITIONS — every *composition*, expressed as primitive trees
|
|
14
|
+
* (definitions.ts + definitions.layout.ts). There are no hand-coded
|
|
15
|
+
* component "holdouts": if it composes primitives, it is data. A module
|
|
16
|
+
* contributes the same way (mock/moduleComponents.ts).
|
|
17
|
+
*/
|
|
18
|
+
import { registerAll } from "../sdui/registry";
|
|
19
|
+
import { defineComponents } from "../sdui/template";
|
|
20
|
+
import { Box, Text, Image, IconPrimitive, Pressable, Spacer, Fragment, Outlet } from "./primitives";
|
|
21
|
+
import { Tabs } from "./layout";
|
|
22
|
+
import { TextInput, Switch, SelectInput, Menu, SearchBar, Slider, RatingControl, ProgressBar } from "./controls";
|
|
23
|
+
import { SeasonSelector } from "./media";
|
|
24
|
+
import { Skeleton } from "./feedback";
|
|
25
|
+
import { PLATFORM_DEFINITIONS } from "./definitions";
|
|
26
|
+
import { LAYOUT_DEFINITIONS } from "./definitions.layout";
|
|
27
|
+
let installed = false;
|
|
28
|
+
/** Idempotently register the vocabulary + all definitions. Call once at boot. */
|
|
29
|
+
export function installComponents() {
|
|
30
|
+
if (installed)
|
|
31
|
+
return;
|
|
32
|
+
installed = true;
|
|
33
|
+
registerAll({
|
|
34
|
+
// 1. primitives — presentational
|
|
35
|
+
Box,
|
|
36
|
+
Text,
|
|
37
|
+
Image,
|
|
38
|
+
Icon: IconPrimitive,
|
|
39
|
+
Pressable,
|
|
40
|
+
Spacer,
|
|
41
|
+
Fragment,
|
|
42
|
+
Outlet,
|
|
43
|
+
// 1. primitives — interactive / stateful (own their state)
|
|
44
|
+
Tabs,
|
|
45
|
+
Menu,
|
|
46
|
+
SearchBar,
|
|
47
|
+
TextInput,
|
|
48
|
+
Switch,
|
|
49
|
+
SelectInput,
|
|
50
|
+
Slider,
|
|
51
|
+
RatingControl,
|
|
52
|
+
SeasonSelector,
|
|
53
|
+
// 1. primitives — computed / animated
|
|
54
|
+
ProgressBar,
|
|
55
|
+
Skeleton,
|
|
56
|
+
});
|
|
57
|
+
// 2. definitions — every composition, as data.
|
|
58
|
+
defineComponents([...PLATFORM_DEFINITIONS, ...LAYOUT_DEFINITIONS]);
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,kDAAkD;AAElD;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACpG,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACjH,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,IAAI,SAAS,GAAG,KAAK,CAAC;AAEtB,iFAAiF;AACjF,MAAM,UAAU,iBAAiB;IAC/B,IAAI,SAAS;QAAE,OAAO;IACtB,SAAS,GAAG,IAAI,CAAC;IAEjB,WAAW,CAAC;QACV,iCAAiC;QACjC,GAAG;QACH,IAAI;QACJ,KAAK;QACL,IAAI,EAAE,aAAa;QACnB,SAAS;QACT,MAAM;QACN,QAAQ;QACR,MAAM;QAEN,2DAA2D;QAC3D,IAAI;QACJ,IAAI;QACJ,SAAS;QACT,SAAS;QACT,MAAM;QACN,WAAW;QACX,MAAM;QACN,aAAa;QACb,cAAc;QAEd,sCAAsC;QACtC,WAAW;QACX,QAAQ;KACT,CAAC,CAAC;IAEH,+CAA+C;IAC/C,gBAAgB,CAAC,CAAC,GAAG,oBAAoB,EAAE,GAAG,kBAAkB,CAAC,CAAC,CAAC;AACrE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { UINode } from "../sdui/types";
|
|
2
|
+
/**
|
|
3
|
+
* `props.tabs` is [{id,label}]; each tab's content lives in the slot of the
|
|
4
|
+
* same id. Selection is internal.
|
|
5
|
+
*/
|
|
6
|
+
export declare function Tabs({ node }: {
|
|
7
|
+
node: UINode;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/components/layout.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAK5C;;;GAGG;AACH,wBAAgB,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,+BAuB9C"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
3
|
+
// SPDX-FileCopyrightText: 2026 the Mosaic authors
|
|
4
|
+
/*
|
|
5
|
+
* Tabs — a stateful PRIMITIVE, not a component. It owns selection state and
|
|
6
|
+
* shows the matching panel slot, coordination a static template can't express.
|
|
7
|
+
* The former layout components here (Screen/Section/Carousel/Grid/Stack/Divider)
|
|
8
|
+
* are compositions and now live as definitions (components/definitions.layout.ts).
|
|
9
|
+
*/
|
|
10
|
+
import { useState } from "react";
|
|
11
|
+
import { prop } from "../sdui/registry";
|
|
12
|
+
import { Slot } from "../sdui/Renderer";
|
|
13
|
+
import { cx } from "./shared";
|
|
14
|
+
/**
|
|
15
|
+
* `props.tabs` is [{id,label}]; each tab's content lives in the slot of the
|
|
16
|
+
* same id. Selection is internal.
|
|
17
|
+
*/
|
|
18
|
+
export function Tabs({ node }) {
|
|
19
|
+
const tabs = prop(node, "tabs", []);
|
|
20
|
+
const [active, setActive] = useState(tabs[0]?.id);
|
|
21
|
+
return (_jsxs("div", { className: "msc-tabs", children: [_jsx("div", { className: "msc-tabs__list", role: "tablist", children: tabs.map((t) => (_jsx("button", { role: "tab", "aria-selected": active === t.id, className: cx("msc-tabs__tab", active === t.id && "is-active"), onClick: () => setActive(t.id), children: t.label }, t.id))) }), _jsx("div", { className: "msc-tabs__panel", role: "tabpanel", children: active && _jsx(Slot, { node: node, name: active }) })] }));
|
|
22
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AM,GAAI,GACzC,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../src/components/media.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAU,MAAM,EAAE,MAAM,eAAe,CAAC;AAMpD,wBAAgB,cAAc,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,+BAsBxD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { prop } from "../sdui/registry";
|
|
3
|
+
import { useRuntime } from "../sdui/context";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
import { cx } from "./shared";
|
|
6
|
+
export function SeasonSelector({ node }) {
|
|
7
|
+
const { emit } = useRuntime();
|
|
8
|
+
const seasons = prop(node, "seasons", []);
|
|
9
|
+
const [active, setActive] = useState(seasons[0]?.id);
|
|
10
|
+
return (_jsx("div", { className: "msc-seasons", role: "tablist", children: seasons.map((s) => (_jsx("button", { role: "tab", "aria-selected": active === s.id, className: cx("msc-seasons__pill", active === s.id && "is-active"), onClick: () => {
|
|
11
|
+
setActive(s.id);
|
|
12
|
+
emit(s.action);
|
|
13
|
+
}, children: s.label }, s.id))) }));
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=media.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media.js","sourceRoot":"","sources":["../../src/components/media.tsx"],"names":[],"mappings":";AAUA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAE9B,MAAM,UAAU,cAAc,CAAC,EAAE,IAAI,EAAoB;IACvD,MAAM,EAAE,IAAI,EAAE,GAAG,UAAU,EAAE,CAAC;IAC9B,MAAM,OAAO,GAAG,IAAI,CAAwD,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC;IACjG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACrD,OAAO,CACL,cAAK,SAAS,EAAC,aAAa,EAAC,IAAI,EAAC,SAAS,YACxC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAClB,iBAEE,IAAI,EAAC,KAAK,mBACK,MAAM,KAAK,CAAC,CAAC,EAAE,EAC9B,SAAS,EAAE,EAAE,CAAC,mBAAmB,EAAE,MAAM,KAAK,CAAC,CAAC,EAAE,IAAI,WAAW,CAAC,EAClE,OAAO,EAAE,GAAG,EAAE;gBACZ,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;gBAChB,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;YACjB,CAAC,YAEA,CAAC,CAAC,KAAK,IATH,CAAC,CAAC,EAAE,CAUF,CACV,CAAC,GACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { UINode } from "../sdui/types";
|
|
2
|
+
/** Box — the workhorse container: flex layout + token box styling. */
|
|
3
|
+
export declare function Box({ node }: {
|
|
4
|
+
node: UINode;
|
|
5
|
+
}): import("react").JSX.Element;
|
|
6
|
+
/** Text — a run of type. `text` is the string; children allow inline nesting. */
|
|
7
|
+
export declare function Text({ node }: {
|
|
8
|
+
node: UINode;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
10
|
+
/** Image — falls back to a typed placeholder when `src` is absent. */
|
|
11
|
+
export declare function Image({ node }: {
|
|
12
|
+
node: UINode;
|
|
13
|
+
}): import("react").JSX.Element;
|
|
14
|
+
/** Icon — a glyph from the built-in set, tokenised colour + size. */
|
|
15
|
+
export declare function IconPrimitive({ node }: {
|
|
16
|
+
node: UINode;
|
|
17
|
+
}): import("react").JSX.Element;
|
|
18
|
+
/** Pressable — the interactive primitive: wraps children, emits an Action. */
|
|
19
|
+
export declare function Pressable({ node }: {
|
|
20
|
+
node: UINode;
|
|
21
|
+
}): import("react").JSX.Element;
|
|
22
|
+
/** Spacer — fixed (token) or flexible gap. */
|
|
23
|
+
export declare function Spacer({ node }: {
|
|
24
|
+
node: UINode;
|
|
25
|
+
}): import("react").JSX.Element;
|
|
26
|
+
/** Fragment — renders children with no wrapper element. */
|
|
27
|
+
export declare function Fragment({ node }: {
|
|
28
|
+
node: UINode;
|
|
29
|
+
}): import("react").JSX.Element;
|
|
30
|
+
/**
|
|
31
|
+
* Outlet — inside a component-definition template, a placeholder for the
|
|
32
|
+
* children (or a named slot) the caller passed. The template expander replaces
|
|
33
|
+
* it; if one is ever rendered outside expansion it degrades to its own
|
|
34
|
+
* children.
|
|
35
|
+
*/
|
|
36
|
+
export declare function Outlet({ node }: {
|
|
37
|
+
node: UINode;
|
|
38
|
+
}): import("react").JSX.Element;
|
|
39
|
+
//# sourceMappingURL=primitives.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../src/components/primitives.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAU,MAAM,EAAE,MAAM,eAAe,CAAC;AAOpD,sEAAsE;AACtE,wBAAgB,GAAG,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,+BAO7C;AAED,iFAAiF;AACjF,wBAAgB,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,+BAS9C;AAED,sEAAsE;AACtE,wBAAgB,KAAK,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,+BAe/C;AAED,qEAAqE;AACrE,wBAAgB,aAAa,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,+BAMvD;AAED,8EAA8E;AAC9E,wBAAgB,SAAS,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,+BAmBnD;AAED,8CAA8C;AAC9C,wBAAgB,MAAM,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,+BAUhD;AAED,2DAA2D;AAC3D,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,+BAElD;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,+BAEhD"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { prop } from "../sdui/registry";
|
|
3
|
+
import { Children } from "../sdui/Renderer";
|
|
4
|
+
import { useRuntime } from "../sdui/context";
|
|
5
|
+
import { boxToCss, textToCss } from "../sdui/style";
|
|
6
|
+
import { cx, Icon } from "./shared";
|
|
7
|
+
/** Box — the workhorse container: flex layout + token box styling. */
|
|
8
|
+
export function Box({ node }) {
|
|
9
|
+
const style = prop(node, "style", {});
|
|
10
|
+
return (_jsx("div", { style: boxToCss(style), children: _jsx(Children, { nodes: node.children }) }));
|
|
11
|
+
}
|
|
12
|
+
/** Text — a run of type. `text` is the string; children allow inline nesting. */
|
|
13
|
+
export function Text({ node }) {
|
|
14
|
+
const value = prop(node, "text", "");
|
|
15
|
+
const style = prop(node, "style", {});
|
|
16
|
+
return (_jsxs("span", { style: textToCss(style), children: [value, node.children ? _jsx(Children, { nodes: node.children }) : null] }));
|
|
17
|
+
}
|
|
18
|
+
/** Image — falls back to a typed placeholder when `src` is absent. */
|
|
19
|
+
export function Image({ node }) {
|
|
20
|
+
const src = prop(node, "src", undefined);
|
|
21
|
+
const alt = prop(node, "alt", "");
|
|
22
|
+
const fit = prop(node, "fit", "cover");
|
|
23
|
+
const placeholder = prop(node, "placeholder", undefined);
|
|
24
|
+
const style = prop(node, "style", {});
|
|
25
|
+
const css = boxToCss(style);
|
|
26
|
+
if (!src) {
|
|
27
|
+
return (_jsx("div", { className: "msc-prim-placeholder", style: { ...css, alignItems: "center", justifyContent: "center" }, children: placeholder && _jsx("span", { children: placeholder.slice(0, 14) }) }));
|
|
28
|
+
}
|
|
29
|
+
return _jsx("img", { src: src, alt: alt, loading: "lazy", style: { ...css, display: "block", objectFit: fit } });
|
|
30
|
+
}
|
|
31
|
+
/** Icon — a glyph from the built-in set, tokenised colour + size. */
|
|
32
|
+
export function IconPrimitive({ node }) {
|
|
33
|
+
const name = prop(node, "name", "info");
|
|
34
|
+
const size = prop(node, "size", "1.2em");
|
|
35
|
+
const colorToken = prop(node, "color", undefined);
|
|
36
|
+
const style = colorToken ? { color: `var(--color-${colorToken})` } : undefined;
|
|
37
|
+
return _jsx(Icon, { name: name, size: size, style: style });
|
|
38
|
+
}
|
|
39
|
+
/** Pressable — the interactive primitive: wraps children, emits an Action. */
|
|
40
|
+
export function Pressable({ node }) {
|
|
41
|
+
const { emit } = useRuntime();
|
|
42
|
+
const style = prop(node, "style", {});
|
|
43
|
+
const action = prop(node, "action", undefined);
|
|
44
|
+
const disabled = prop(node, "disabled", false);
|
|
45
|
+
const lift = prop(node, "lift", false);
|
|
46
|
+
const label = prop(node, "label", undefined);
|
|
47
|
+
return (_jsx("button", { className: cx("msc-pressable", lift && "msc-pressable--lift"), style: boxToCss(style), disabled: disabled, "aria-label": label, title: label, onClick: () => emit(action), children: _jsx(Children, { nodes: node.children }) }));
|
|
48
|
+
}
|
|
49
|
+
/** Spacer — fixed (token) or flexible gap. */
|
|
50
|
+
export function Spacer({ node }) {
|
|
51
|
+
const size = prop(node, "size", undefined);
|
|
52
|
+
const grow = prop(node, "grow", false);
|
|
53
|
+
const style = {};
|
|
54
|
+
if (grow)
|
|
55
|
+
style.flex = 1;
|
|
56
|
+
if (size !== undefined) {
|
|
57
|
+
style.width = size === 0 ? "0" : `var(--space-${size})`;
|
|
58
|
+
style.height = size === 0 ? "0" : `var(--space-${size})`;
|
|
59
|
+
}
|
|
60
|
+
return _jsx("div", { style: style, "aria-hidden": true });
|
|
61
|
+
}
|
|
62
|
+
/** Fragment — renders children with no wrapper element. */
|
|
63
|
+
export function Fragment({ node }) {
|
|
64
|
+
return _jsx(Children, { nodes: node.children });
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Outlet — inside a component-definition template, a placeholder for the
|
|
68
|
+
* children (or a named slot) the caller passed. The template expander replaces
|
|
69
|
+
* it; if one is ever rendered outside expansion it degrades to its own
|
|
70
|
+
* children.
|
|
71
|
+
*/
|
|
72
|
+
export function Outlet({ node }) {
|
|
73
|
+
return _jsx(Children, { nodes: node.children });
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=primitives.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primitives.js","sourceRoot":"","sources":["../../src/components/primitives.tsx"],"names":[],"mappings":";AAiBA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAmE,MAAM,eAAe,CAAC;AACrH,OAAO,EAAE,EAAE,EAAE,IAAI,EAAiB,MAAM,UAAU,CAAC;AAEnD,sEAAsE;AACtE,MAAM,UAAU,GAAG,CAAC,EAAE,IAAI,EAAoB;IAC5C,MAAM,KAAK,GAAG,IAAI,CAAW,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;IAChD,OAAO,CACL,cAAK,KAAK,EAAE,QAAQ,CAAC,KAAK,CA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QAAQ,IAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,GAAI,CAAC;AAC5C,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,MAAM,CAAC,EAAE,IAAI,EAAoB;IAC/C,OAAO,KAAC,QAAQ,IAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,GAAI,CAAC;AAC5C,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CSSProperties } from "react";
|
|
2
|
+
import type { UINode } from "../sdui/types";
|
|
3
|
+
export declare function cx(...parts: Array<string | false | null | undefined>): string;
|
|
4
|
+
/** Read an optional `action` prop off a node and return a click handler. */
|
|
5
|
+
export declare function useNodeAction(node: UINode): () => void;
|
|
6
|
+
export type IconName = "play" | "search" | "chevron-right" | "chevron-down" | "star" | "plus" | "check" | "close" | "dots" | "info" | "warning" | "error" | "success" | "external" | "grid" | "list";
|
|
7
|
+
export declare function Icon({ name, size, style, className, }: {
|
|
8
|
+
name: IconName;
|
|
9
|
+
size?: number | string;
|
|
10
|
+
style?: CSSProperties;
|
|
11
|
+
className?: string;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/components/shared.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAI3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C,wBAAgB,EAAE,CAAC,GAAG,KAAK,EAAE,KAAK,CAAC,MAAM,GAAG,KAAK,GAAG,IAAI,GAAG,SAAS,CAAC,GAAG,MAAM,CAE7E;AAED,4EAA4E;AAC5E,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,IAAI,CAItD;AAED,MAAM,MAAM,QAAQ,GAChB,MAAM,GACN,QAAQ,GACR,eAAe,GACf,cAAc,GACd,MAAM,GACN,MAAM,GACN,OAAO,GACP,OAAO,GACP,MAAM,GACN,MAAM,GACN,SAAS,GACT,OAAO,GACP,SAAS,GACT,UAAU,GACV,MAAM,GACN,MAAM,CAAC;AAuBX,wBAAgB,IAAI,CAAC,EACnB,IAAI,EACJ,IAAY,EACZ,KAAK,EACL,SAAS,GACV,EAAE;IACD,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,+BAoBA"}
|