@ai4b-team/fsaos-gateway-sdk 1.0.1
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/CHANGELOG.md +56 -0
- package/README.md +157 -0
- package/dist/iife/gateway.js +12 -0
- package/dist/iife/gateway.js.map +7 -0
- package/dist/iife/ui.js +3 -0
- package/dist/iife/ui.js.map +7 -0
- package/dist/index.cjs +3220 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1806 -0
- package/dist/index.d.ts +1806 -0
- package/dist/index.js +3079 -0
- package/dist/index.js.map +1 -0
- package/dist/ui.cjs +201 -0
- package/dist/ui.cjs.map +1 -0
- package/dist/ui.d.cts +243 -0
- package/dist/ui.d.ts +243 -0
- package/dist/ui.js +180 -0
- package/dist/ui.js.map +1 -0
- package/package.json +92 -0
package/dist/ui.d.ts
ADDED
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @fsaos/ui — UI Primitives
|
|
5
|
+
*
|
|
6
|
+
* Lightweight layout and display components for edge-served FSAOS components.
|
|
7
|
+
* These render real HTML/CSS using CSS custom properties from the scope's theme.
|
|
8
|
+
*
|
|
9
|
+
* Built as a separate IIFE bundle → window.__FSAOS_UI__
|
|
10
|
+
* Components: Page, Stack, Grid, Sidebar, Card, Badge, Spinner, Button,
|
|
11
|
+
* Empty, DataView, Table, Form, Detail, Router, Link, Tabs,
|
|
12
|
+
* Breadcrumbs, Image, Video, FilePreview
|
|
13
|
+
*/
|
|
14
|
+
declare function Page(props: {
|
|
15
|
+
className?: string;
|
|
16
|
+
children?: any;
|
|
17
|
+
}): react.DetailedReactHTMLElement<{
|
|
18
|
+
style: {
|
|
19
|
+
minHeight: string;
|
|
20
|
+
display: "flex";
|
|
21
|
+
flexDirection: "column";
|
|
22
|
+
};
|
|
23
|
+
className: string;
|
|
24
|
+
}, HTMLElement>;
|
|
25
|
+
declare function Stack(props: {
|
|
26
|
+
direction?: 'vertical' | 'horizontal';
|
|
27
|
+
gap?: string;
|
|
28
|
+
padding?: string;
|
|
29
|
+
align?: string;
|
|
30
|
+
justify?: string;
|
|
31
|
+
flex?: string;
|
|
32
|
+
className?: string;
|
|
33
|
+
children?: any;
|
|
34
|
+
}): react.DetailedReactHTMLElement<{
|
|
35
|
+
style: {
|
|
36
|
+
display: "flex";
|
|
37
|
+
flexDirection: "column" | "row";
|
|
38
|
+
gap: string;
|
|
39
|
+
padding: string;
|
|
40
|
+
alignItems: string;
|
|
41
|
+
justifyContent: string;
|
|
42
|
+
flex: string;
|
|
43
|
+
};
|
|
44
|
+
className: string;
|
|
45
|
+
}, HTMLElement>;
|
|
46
|
+
declare function Grid(props: {
|
|
47
|
+
columns?: number;
|
|
48
|
+
gap?: string;
|
|
49
|
+
padding?: string;
|
|
50
|
+
className?: string;
|
|
51
|
+
children?: any;
|
|
52
|
+
}): react.DetailedReactHTMLElement<{
|
|
53
|
+
style: {
|
|
54
|
+
display: "grid";
|
|
55
|
+
gridTemplateColumns: string;
|
|
56
|
+
gap: string;
|
|
57
|
+
padding: string;
|
|
58
|
+
};
|
|
59
|
+
className: string;
|
|
60
|
+
}, HTMLElement>;
|
|
61
|
+
declare function Sidebar(props: {
|
|
62
|
+
className?: string;
|
|
63
|
+
children?: any;
|
|
64
|
+
}): react.DetailedReactHTMLElement<{
|
|
65
|
+
style: {
|
|
66
|
+
display: "flex";
|
|
67
|
+
flexDirection: "row";
|
|
68
|
+
minHeight: string;
|
|
69
|
+
};
|
|
70
|
+
className: string;
|
|
71
|
+
}, HTMLElement>;
|
|
72
|
+
declare function Card(props: {
|
|
73
|
+
padding?: string;
|
|
74
|
+
className?: string;
|
|
75
|
+
onClick?: () => void;
|
|
76
|
+
children?: any;
|
|
77
|
+
}): react.DetailedReactHTMLElement<{
|
|
78
|
+
style: {
|
|
79
|
+
border: string;
|
|
80
|
+
borderRadius: string;
|
|
81
|
+
padding: string;
|
|
82
|
+
background: string;
|
|
83
|
+
};
|
|
84
|
+
className: string;
|
|
85
|
+
onClick: (() => void) | undefined;
|
|
86
|
+
}, HTMLElement>;
|
|
87
|
+
declare function Badge(props: {
|
|
88
|
+
color?: string;
|
|
89
|
+
textColor?: string;
|
|
90
|
+
label?: string;
|
|
91
|
+
className?: string;
|
|
92
|
+
children?: any;
|
|
93
|
+
}): react.DetailedReactHTMLElement<{
|
|
94
|
+
style: {
|
|
95
|
+
display: "inline-flex";
|
|
96
|
+
alignItems: "center";
|
|
97
|
+
padding: string;
|
|
98
|
+
fontSize: string;
|
|
99
|
+
fontWeight: "500";
|
|
100
|
+
borderRadius: string;
|
|
101
|
+
background: string;
|
|
102
|
+
color: string;
|
|
103
|
+
};
|
|
104
|
+
className: string;
|
|
105
|
+
}, HTMLElement>;
|
|
106
|
+
declare function Spinner(props: {
|
|
107
|
+
size?: string;
|
|
108
|
+
}): react.DetailedReactHTMLElement<{
|
|
109
|
+
style: {
|
|
110
|
+
width: string;
|
|
111
|
+
height: string;
|
|
112
|
+
border: string;
|
|
113
|
+
borderTopColor: "var(--color-primary, #3b82f6)";
|
|
114
|
+
borderRadius: string;
|
|
115
|
+
animation: "fsaos-spin 0.6s linear infinite";
|
|
116
|
+
};
|
|
117
|
+
}, HTMLElement>;
|
|
118
|
+
declare function Button(props: {
|
|
119
|
+
variant?: 'default' | 'outline' | 'ghost';
|
|
120
|
+
disabled?: boolean;
|
|
121
|
+
label?: string;
|
|
122
|
+
className?: string;
|
|
123
|
+
onClick?: () => void;
|
|
124
|
+
children?: any;
|
|
125
|
+
}): react.DetailedReactHTMLElement<{
|
|
126
|
+
style: {
|
|
127
|
+
display: "inline-flex";
|
|
128
|
+
alignItems: "center";
|
|
129
|
+
justifyContent: "center";
|
|
130
|
+
padding: string;
|
|
131
|
+
fontSize: string;
|
|
132
|
+
fontWeight: "500";
|
|
133
|
+
borderRadius: string;
|
|
134
|
+
border: string;
|
|
135
|
+
background: string;
|
|
136
|
+
color: "var(--color-text, #1a1a1a)" | "#fff";
|
|
137
|
+
cursor: "not-allowed" | "pointer";
|
|
138
|
+
opacity: "0.5" | "1";
|
|
139
|
+
gap: string;
|
|
140
|
+
};
|
|
141
|
+
className: string;
|
|
142
|
+
onClick: (() => void) | undefined;
|
|
143
|
+
disabled: boolean | undefined;
|
|
144
|
+
}, HTMLElement>;
|
|
145
|
+
declare function Empty(props: {
|
|
146
|
+
icon?: string;
|
|
147
|
+
title?: string;
|
|
148
|
+
message?: string;
|
|
149
|
+
description?: string;
|
|
150
|
+
className?: string;
|
|
151
|
+
children?: any;
|
|
152
|
+
}): react.DetailedReactHTMLElement<{
|
|
153
|
+
style: {
|
|
154
|
+
display: "flex";
|
|
155
|
+
flexDirection: "column";
|
|
156
|
+
alignItems: "center";
|
|
157
|
+
justifyContent: "center";
|
|
158
|
+
padding: string;
|
|
159
|
+
color: "var(--color-text-secondary, #6b7280)";
|
|
160
|
+
textAlign: "center";
|
|
161
|
+
};
|
|
162
|
+
}, HTMLElement>;
|
|
163
|
+
declare function DataView(props: {
|
|
164
|
+
className?: string;
|
|
165
|
+
children?: any;
|
|
166
|
+
}): react.DetailedReactHTMLElement<{
|
|
167
|
+
className: string;
|
|
168
|
+
}, HTMLElement>;
|
|
169
|
+
declare function Table(props: {
|
|
170
|
+
className?: string;
|
|
171
|
+
children?: any;
|
|
172
|
+
}): react.DetailedReactHTMLElement<{
|
|
173
|
+
className: string;
|
|
174
|
+
}, HTMLElement>;
|
|
175
|
+
declare function Form(props: {
|
|
176
|
+
className?: string;
|
|
177
|
+
onSubmit?: (e: any) => void;
|
|
178
|
+
children?: any;
|
|
179
|
+
}): react.DetailedReactHTMLElement<{
|
|
180
|
+
className: string;
|
|
181
|
+
onSubmit: ((e: any) => void) | undefined;
|
|
182
|
+
}, HTMLElement>;
|
|
183
|
+
declare function Detail(props: {
|
|
184
|
+
className?: string;
|
|
185
|
+
children?: any;
|
|
186
|
+
}): react.DetailedReactHTMLElement<{
|
|
187
|
+
className: string;
|
|
188
|
+
}, HTMLElement>;
|
|
189
|
+
declare function Router(props: {
|
|
190
|
+
children?: any;
|
|
191
|
+
}): react.DetailedReactHTMLElement<react.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
192
|
+
declare function Link(props: {
|
|
193
|
+
href?: string;
|
|
194
|
+
to?: string;
|
|
195
|
+
className?: string;
|
|
196
|
+
onClick?: (e: any) => void;
|
|
197
|
+
children?: any;
|
|
198
|
+
}): react.DetailedReactHTMLElement<{
|
|
199
|
+
href: string | undefined;
|
|
200
|
+
className: string;
|
|
201
|
+
onClick: ((e: any) => void) | undefined;
|
|
202
|
+
}, HTMLElement>;
|
|
203
|
+
declare function Tabs(props: {
|
|
204
|
+
className?: string;
|
|
205
|
+
children?: any;
|
|
206
|
+
}): react.DetailedReactHTMLElement<{
|
|
207
|
+
className: string;
|
|
208
|
+
}, HTMLElement>;
|
|
209
|
+
declare function Breadcrumbs(props: {
|
|
210
|
+
className?: string;
|
|
211
|
+
children?: any;
|
|
212
|
+
}): react.DetailedReactHTMLElement<{
|
|
213
|
+
className: string;
|
|
214
|
+
}, HTMLElement>;
|
|
215
|
+
declare function Image(props: {
|
|
216
|
+
src?: string;
|
|
217
|
+
path?: string;
|
|
218
|
+
alt?: string;
|
|
219
|
+
className?: string;
|
|
220
|
+
style?: any;
|
|
221
|
+
}): react.DetailedReactHTMLElement<{
|
|
222
|
+
src: string;
|
|
223
|
+
alt: string;
|
|
224
|
+
className: string;
|
|
225
|
+
style: any;
|
|
226
|
+
}, HTMLElement>;
|
|
227
|
+
declare function Video(props: {
|
|
228
|
+
src?: string;
|
|
229
|
+
path?: string;
|
|
230
|
+
className?: string;
|
|
231
|
+
}): react.DetailedReactHTMLElement<{
|
|
232
|
+
src: string;
|
|
233
|
+
controls: boolean;
|
|
234
|
+
className: string;
|
|
235
|
+
}, HTMLElement>;
|
|
236
|
+
declare function FilePreview(props: {
|
|
237
|
+
className?: string;
|
|
238
|
+
children?: any;
|
|
239
|
+
}): react.DetailedReactHTMLElement<{
|
|
240
|
+
className: string;
|
|
241
|
+
}, HTMLElement>;
|
|
242
|
+
|
|
243
|
+
export { Badge, Breadcrumbs, Button, Card, DataView, Detail, Empty, FilePreview, Form, Grid, Image, Link, Page, Router, Sidebar, Spinner, Stack, Table, Tabs, Video };
|
package/dist/ui.js
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { createElement } from 'react';
|
|
2
|
+
|
|
3
|
+
// src/ui.ts
|
|
4
|
+
function getEdgeBaseUrl() {
|
|
5
|
+
const config = typeof window !== "undefined" && window.__FSAOS_CONFIG__ || {};
|
|
6
|
+
return config.edgeBaseUrl || "";
|
|
7
|
+
}
|
|
8
|
+
function Page(props) {
|
|
9
|
+
return createElement("div", {
|
|
10
|
+
style: { minHeight: "100vh", display: "flex", flexDirection: "column" },
|
|
11
|
+
className: props.className || ""
|
|
12
|
+
}, props.children);
|
|
13
|
+
}
|
|
14
|
+
function Stack(props) {
|
|
15
|
+
const dir = props.direction || "vertical";
|
|
16
|
+
return createElement("div", {
|
|
17
|
+
style: {
|
|
18
|
+
display: "flex",
|
|
19
|
+
flexDirection: dir === "horizontal" ? "row" : "column",
|
|
20
|
+
gap: props.gap || "0.5rem",
|
|
21
|
+
padding: props.padding || "0",
|
|
22
|
+
alignItems: props.align || "stretch",
|
|
23
|
+
justifyContent: props.justify || "flex-start",
|
|
24
|
+
flex: props.flex || "initial"
|
|
25
|
+
},
|
|
26
|
+
className: props.className || ""
|
|
27
|
+
}, props.children);
|
|
28
|
+
}
|
|
29
|
+
function Grid(props) {
|
|
30
|
+
return createElement("div", {
|
|
31
|
+
style: {
|
|
32
|
+
display: "grid",
|
|
33
|
+
gridTemplateColumns: "repeat(" + (props.columns || 3) + ", 1fr)",
|
|
34
|
+
gap: props.gap || "1rem",
|
|
35
|
+
padding: props.padding || "0"
|
|
36
|
+
},
|
|
37
|
+
className: props.className || ""
|
|
38
|
+
}, props.children);
|
|
39
|
+
}
|
|
40
|
+
function Sidebar(props) {
|
|
41
|
+
return createElement("div", {
|
|
42
|
+
style: { display: "flex", flexDirection: "row", minHeight: "100vh" },
|
|
43
|
+
className: props.className || ""
|
|
44
|
+
}, props.children);
|
|
45
|
+
}
|
|
46
|
+
function Card(props) {
|
|
47
|
+
return createElement("div", {
|
|
48
|
+
style: {
|
|
49
|
+
border: "1px solid var(--color-border, #e5e7eb)",
|
|
50
|
+
borderRadius: "var(--border-radius, 0.5rem)",
|
|
51
|
+
padding: props.padding || "1rem",
|
|
52
|
+
background: "var(--color-surface, #fff)"
|
|
53
|
+
},
|
|
54
|
+
className: props.className || "",
|
|
55
|
+
onClick: props.onClick
|
|
56
|
+
}, props.children);
|
|
57
|
+
}
|
|
58
|
+
function Badge(props) {
|
|
59
|
+
return createElement("span", {
|
|
60
|
+
style: {
|
|
61
|
+
display: "inline-flex",
|
|
62
|
+
alignItems: "center",
|
|
63
|
+
padding: "0.125rem 0.5rem",
|
|
64
|
+
fontSize: "0.75rem",
|
|
65
|
+
fontWeight: "500",
|
|
66
|
+
borderRadius: "9999px",
|
|
67
|
+
background: props.color || "#e5e7eb",
|
|
68
|
+
color: props.textColor || "#374151"
|
|
69
|
+
},
|
|
70
|
+
className: props.className || ""
|
|
71
|
+
}, props.children || props.label);
|
|
72
|
+
}
|
|
73
|
+
function Spinner(props) {
|
|
74
|
+
const size = props.size || "1.5rem";
|
|
75
|
+
return createElement("div", {
|
|
76
|
+
style: {
|
|
77
|
+
width: size,
|
|
78
|
+
height: size,
|
|
79
|
+
border: "2px solid #e5e7eb",
|
|
80
|
+
borderTopColor: "var(--color-primary, #3b82f6)",
|
|
81
|
+
borderRadius: "50%",
|
|
82
|
+
animation: "fsaos-spin 0.6s linear infinite"
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
function Button(props) {
|
|
87
|
+
return createElement("button", {
|
|
88
|
+
style: {
|
|
89
|
+
display: "inline-flex",
|
|
90
|
+
alignItems: "center",
|
|
91
|
+
justifyContent: "center",
|
|
92
|
+
padding: "0.5rem 1rem",
|
|
93
|
+
fontSize: "0.875rem",
|
|
94
|
+
fontWeight: "500",
|
|
95
|
+
borderRadius: "var(--border-radius, 0.375rem)",
|
|
96
|
+
border: props.variant === "outline" ? "1px solid var(--color-border, #d1d5db)" : "none",
|
|
97
|
+
background: props.variant === "outline" || props.variant === "ghost" ? "transparent" : "var(--color-primary, #3b82f6)",
|
|
98
|
+
color: props.variant === "outline" || props.variant === "ghost" ? "var(--color-text, #1a1a1a)" : "#fff",
|
|
99
|
+
cursor: props.disabled ? "not-allowed" : "pointer",
|
|
100
|
+
opacity: props.disabled ? "0.5" : "1",
|
|
101
|
+
gap: "0.5rem"
|
|
102
|
+
},
|
|
103
|
+
className: props.className || "",
|
|
104
|
+
onClick: props.onClick,
|
|
105
|
+
disabled: props.disabled
|
|
106
|
+
}, props.children || props.label);
|
|
107
|
+
}
|
|
108
|
+
function Empty(props) {
|
|
109
|
+
return createElement(
|
|
110
|
+
"div",
|
|
111
|
+
{
|
|
112
|
+
style: {
|
|
113
|
+
display: "flex",
|
|
114
|
+
flexDirection: "column",
|
|
115
|
+
alignItems: "center",
|
|
116
|
+
justifyContent: "center",
|
|
117
|
+
padding: "3rem",
|
|
118
|
+
color: "var(--color-text-secondary, #6b7280)",
|
|
119
|
+
textAlign: "center"
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
props.icon ? createElement("div", { style: { fontSize: "2rem", marginBottom: "0.5rem" } }, props.icon) : null,
|
|
123
|
+
createElement(
|
|
124
|
+
"div",
|
|
125
|
+
{ style: { fontWeight: 500, marginBottom: "0.25rem" } },
|
|
126
|
+
props.title || props.message || props.children || "No items"
|
|
127
|
+
),
|
|
128
|
+
props.description ? createElement("div", { style: { fontSize: "0.875rem", opacity: 0.7 } }, props.description) : null
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
function DataView(props) {
|
|
132
|
+
return createElement("div", { className: props.className || "" }, props.children);
|
|
133
|
+
}
|
|
134
|
+
function Table(props) {
|
|
135
|
+
return createElement("table", { className: props.className || "" }, props.children);
|
|
136
|
+
}
|
|
137
|
+
function Form(props) {
|
|
138
|
+
return createElement("form", { className: props.className || "", onSubmit: props.onSubmit }, props.children);
|
|
139
|
+
}
|
|
140
|
+
function Detail(props) {
|
|
141
|
+
return createElement("div", { className: props.className || "" }, props.children);
|
|
142
|
+
}
|
|
143
|
+
function Router(props) {
|
|
144
|
+
return createElement("div", null, props.children);
|
|
145
|
+
}
|
|
146
|
+
function Link(props) {
|
|
147
|
+
return createElement("a", {
|
|
148
|
+
href: props.href || props.to,
|
|
149
|
+
className: props.className || "",
|
|
150
|
+
onClick: props.onClick
|
|
151
|
+
}, props.children);
|
|
152
|
+
}
|
|
153
|
+
function Tabs(props) {
|
|
154
|
+
return createElement("div", { className: props.className || "" }, props.children);
|
|
155
|
+
}
|
|
156
|
+
function Breadcrumbs(props) {
|
|
157
|
+
return createElement("nav", { className: props.className || "" }, props.children);
|
|
158
|
+
}
|
|
159
|
+
function Image(props) {
|
|
160
|
+
return createElement("img", {
|
|
161
|
+
src: props.src || (props.path ? getEdgeBaseUrl() + props.path : ""),
|
|
162
|
+
alt: props.alt || "",
|
|
163
|
+
className: props.className || "",
|
|
164
|
+
style: props.style
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
function Video(props) {
|
|
168
|
+
return createElement("video", {
|
|
169
|
+
src: props.src || (props.path ? getEdgeBaseUrl() + props.path : ""),
|
|
170
|
+
controls: true,
|
|
171
|
+
className: props.className || ""
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
function FilePreview(props) {
|
|
175
|
+
return createElement("div", { className: props.className || "" }, props.children || "File preview");
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export { Badge, Breadcrumbs, Button, Card, DataView, Detail, Empty, FilePreview, Form, Grid, Image, Link, Page, Router, Sidebar, Spinner, Stack, Table, Tabs, Video };
|
|
179
|
+
//# sourceMappingURL=ui.js.map
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AAAA,IAC1B,GAAA,EAAK,MAAM,GAAA,KAAQ,KAAA,CAAM,OAAO,cAAA,EAAe,GAAI,MAAM,IAAA,GAAO,EAAA,CAAA;AAAA,IAChE,GAAA,EAAK,MAAM,GAAA,IAAO,EAAA;AAAA,IAClB,SAAA,EAAW,MAAM,SAAA,IAAa,EAAA;AAAA,IAC9B,OAAO,KAAA,CAAM;AAAA,GACd,CAAA;AACH;AAEO,SAAS,MAAM,KAAA,EAInB;AACD,EAAA,OAAO,cAAc,OAAA,EAAS;AAAA,IAC5B,GAAA,EAAK,MAAM,GAAA,KAAQ,KAAA,CAAM,OAAO,cAAA,EAAe,GAAI,MAAM,IAAA,GAAO,EAAA,CAAA;AAAA,IAChE,QAAA,EAAU,IAAA;AAAA,IACV,SAAA,EAAW,MAAM,SAAA,IAAa;AAAA,GAC/B,CAAA;AACH;AAEO,SAAS,YAAY,KAAA,EAA+C;AACzE,EAAA,OAAO,aAAA,CAAc,KAAA,EAAO,EAAE,SAAA,EAAW,KAAA,CAAM,aAAa,EAAA,EAAG,EAAG,KAAA,CAAM,QAAA,IAAY,cAAc,CAAA;AACpG","file":"ui.js","sourcesContent":["/**\n * @fsaos/ui — UI Primitives\n *\n * Lightweight layout and display components for edge-served FSAOS components.\n * These render real HTML/CSS using CSS custom properties from the scope's theme.\n *\n * Built as a separate IIFE bundle → window.__FSAOS_UI__\n * Components: Page, Stack, Grid, Sidebar, Card, Badge, Spinner, Button,\n * Empty, DataView, Table, Form, Detail, Router, Link, Tabs,\n * Breadcrumbs, Image, Video, FilePreview\n */\n\nimport { createElement } from 'react';\n\n// ── Helpers ────────────────────────────────────────────────────────────────\n\nfunction getEdgeBaseUrl(): string {\n const config = (typeof window !== 'undefined' && (window as any).__FSAOS_CONFIG__) || {};\n return config.edgeBaseUrl || '';\n}\n\n// ── Layout Components ──────────────────────────────────────────────────────\n\nexport function Page(props: { className?: string; children?: any }) {\n return createElement('div', {\n style: { minHeight: '100vh', display: 'flex', flexDirection: 'column' },\n className: props.className || '',\n }, props.children);\n}\n\nexport function Stack(props: {\n direction?: 'vertical' | 'horizontal';\n gap?: string;\n padding?: string;\n align?: string;\n justify?: string;\n flex?: string;\n className?: string;\n children?: any;\n}) {\n const dir = props.direction || 'vertical';\n return createElement('div', {\n style: {\n display: 'flex',\n flexDirection: dir === 'horizontal' ? 'row' : 'column',\n gap: props.gap || '0.5rem',\n padding: props.padding || '0',\n alignItems: props.align || 'stretch',\n justifyContent: props.justify || 'flex-start',\n flex: props.flex || 'initial',\n },\n className: props.className || '',\n }, props.children);\n}\n\nexport function Grid(props: {\n columns?: number;\n gap?: string;\n padding?: string;\n className?: string;\n children?: any;\n}) {\n return createElement('div', {\n style: {\n display: 'grid',\n gridTemplateColumns: 'repeat(' + (props.columns || 3) + ', 1fr)',\n gap: props.gap || '1rem',\n padding: props.padding || '0',\n },\n className: props.className || '',\n }, props.children);\n}\n\nexport function Sidebar(props: { className?: string; children?: any }) {\n return createElement('div', {\n style: { display: 'flex', flexDirection: 'row', minHeight: '100vh' },\n className: props.className || '',\n }, props.children);\n}\n\n// ── Display Components ─────────────────────────────────────────────────────\n\nexport function Card(props: {\n padding?: string;\n className?: string;\n onClick?: () => void;\n children?: any;\n}) {\n return createElement('div', {\n style: {\n border: '1px solid var(--color-border, #e5e7eb)',\n borderRadius: 'var(--border-radius, 0.5rem)',\n padding: props.padding || '1rem',\n background: 'var(--color-surface, #fff)',\n },\n className: props.className || '',\n onClick: props.onClick,\n }, props.children);\n}\n\nexport function Badge(props: {\n color?: string;\n textColor?: string;\n label?: string;\n className?: string;\n children?: any;\n}) {\n return createElement('span', {\n style: {\n display: 'inline-flex',\n alignItems: 'center',\n padding: '0.125rem 0.5rem',\n fontSize: '0.75rem',\n fontWeight: '500',\n borderRadius: '9999px',\n background: props.color || '#e5e7eb',\n color: props.textColor || '#374151',\n },\n className: props.className || '',\n }, props.children || props.label);\n}\n\nexport function Spinner(props: { size?: string }) {\n const size = props.size || '1.5rem';\n return createElement('div', {\n style: {\n width: size,\n height: size,\n border: '2px solid #e5e7eb',\n borderTopColor: 'var(--color-primary, #3b82f6)',\n borderRadius: '50%',\n animation: 'fsaos-spin 0.6s linear infinite',\n },\n });\n}\n\nexport function Button(props: {\n variant?: 'default' | 'outline' | 'ghost';\n disabled?: boolean;\n label?: string;\n className?: string;\n onClick?: () => void;\n children?: any;\n}) {\n return createElement('button', {\n style: {\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n padding: '0.5rem 1rem',\n fontSize: '0.875rem',\n fontWeight: '500',\n borderRadius: 'var(--border-radius, 0.375rem)',\n border: props.variant === 'outline' ? '1px solid var(--color-border, #d1d5db)' : 'none',\n background: props.variant === 'outline' || props.variant === 'ghost'\n ? 'transparent'\n : 'var(--color-primary, #3b82f6)',\n color: props.variant === 'outline' || props.variant === 'ghost'\n ? 'var(--color-text, #1a1a1a)'\n : '#fff',\n cursor: props.disabled ? 'not-allowed' : 'pointer',\n opacity: props.disabled ? '0.5' : '1',\n gap: '0.5rem',\n },\n className: props.className || '',\n onClick: props.onClick,\n disabled: props.disabled,\n }, props.children || props.label);\n}\n\nexport function Empty(props: {\n icon?: string;\n title?: string;\n message?: string;\n description?: string;\n className?: string;\n children?: any;\n}) {\n return createElement('div', {\n style: {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n padding: '3rem',\n color: 'var(--color-text-secondary, #6b7280)',\n textAlign: 'center',\n },\n },\n props.icon\n ? createElement('div', { style: { fontSize: '2rem', marginBottom: '0.5rem' } }, props.icon)\n : null,\n createElement('div', { style: { fontWeight: 500, marginBottom: '0.25rem' } },\n props.title || props.message || props.children || 'No items',\n ),\n props.description\n ? createElement('div', { style: { fontSize: '0.875rem', opacity: 0.7 } }, props.description)\n : null,\n );\n}\n\n// ── Passthrough Components ─────────────────────────────────────────────────\n// These render basic HTML elements. Components can style them via className.\n\nexport function DataView(props: { className?: string; children?: any }) {\n return createElement('div', { className: props.className || '' }, props.children);\n}\n\nexport function Table(props: { className?: string; children?: any }) {\n return createElement('table', { className: props.className || '' }, props.children);\n}\n\nexport function Form(props: { className?: string; onSubmit?: (e: any) => void; children?: any }) {\n return createElement('form', { className: props.className || '', onSubmit: props.onSubmit }, props.children);\n}\n\nexport function Detail(props: { className?: string; children?: any }) {\n return createElement('div', { className: props.className || '' }, props.children);\n}\n\nexport function Router(props: { children?: any }) {\n return createElement('div', null, props.children);\n}\n\nexport function Link(props: {\n href?: string;\n to?: string;\n className?: string;\n onClick?: (e: any) => void;\n children?: any;\n}) {\n return createElement('a', {\n href: props.href || props.to,\n className: props.className || '',\n onClick: props.onClick,\n }, props.children);\n}\n\nexport function Tabs(props: { className?: string; children?: any }) {\n return createElement('div', { className: props.className || '' }, props.children);\n}\n\nexport function Breadcrumbs(props: { className?: string; children?: any }) {\n return createElement('nav', { className: props.className || '' }, props.children);\n}\n\n// ── Media Components ───────────────────────────────────────────────────────\n\nexport function Image(props: {\n src?: string;\n path?: string;\n alt?: string;\n className?: string;\n style?: any;\n}) {\n return createElement('img', {\n src: props.src || (props.path ? getEdgeBaseUrl() + props.path : ''),\n alt: props.alt || '',\n className: props.className || '',\n style: props.style,\n });\n}\n\nexport function Video(props: {\n src?: string;\n path?: string;\n className?: string;\n}) {\n return createElement('video', {\n src: props.src || (props.path ? getEdgeBaseUrl() + props.path : ''),\n controls: true,\n className: props.className || '',\n });\n}\n\nexport function FilePreview(props: { className?: string; children?: any }) {\n return createElement('div', { className: props.className || '' }, props.children || 'File preview');\n}\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ai4b-team/fsaos-gateway-sdk",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "FSAOS Gateway SDK — VFS hooks, session, realtime, and cache layer.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"require": "./dist/index.cjs"
|
|
14
|
+
},
|
|
15
|
+
"./ui": {
|
|
16
|
+
"types": "./dist/ui.d.ts",
|
|
17
|
+
"import": "./dist/ui.js",
|
|
18
|
+
"require": "./dist/ui.cjs"
|
|
19
|
+
},
|
|
20
|
+
"./iife/gateway": "./dist/iife/gateway.js",
|
|
21
|
+
"./iife/ui": "./dist/iife/ui.js",
|
|
22
|
+
"./package.json": "./package.json"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist",
|
|
26
|
+
"README.md",
|
|
27
|
+
"LICENSE",
|
|
28
|
+
"CHANGELOG.md"
|
|
29
|
+
],
|
|
30
|
+
"sideEffects": false,
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"access": "public"
|
|
33
|
+
},
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "git+https://github.com/AI4B-Team/fsaos-gateway-sdk.git"
|
|
37
|
+
},
|
|
38
|
+
"bugs": {
|
|
39
|
+
"url": "https://github.com/AI4B-Team/fsaos-gateway-sdk/issues"
|
|
40
|
+
},
|
|
41
|
+
"homepage": "https://github.com/AI4B-Team/fsaos-gateway-sdk#readme",
|
|
42
|
+
"license": "UNLICENSED",
|
|
43
|
+
"keywords": [
|
|
44
|
+
"fsaos",
|
|
45
|
+
"vfs",
|
|
46
|
+
"supabase",
|
|
47
|
+
"react-query",
|
|
48
|
+
"sdk"
|
|
49
|
+
],
|
|
50
|
+
"scripts": {
|
|
51
|
+
"build": "tsup && node build.mjs",
|
|
52
|
+
"build:dev": "node build.mjs --dev",
|
|
53
|
+
"typecheck": "tsc --noEmit",
|
|
54
|
+
"prepublishOnly": "pnpm run build",
|
|
55
|
+
"release:dry": "semantic-release --dry-run --no-ci"
|
|
56
|
+
},
|
|
57
|
+
"dependencies": {},
|
|
58
|
+
"peerDependencies": {
|
|
59
|
+
"@supabase/supabase-js": "^2.103.2",
|
|
60
|
+
"@tanstack/react-query": "^5.99.0",
|
|
61
|
+
"react": ">=18.0.0"
|
|
62
|
+
},
|
|
63
|
+
"peerDependenciesMeta": {
|
|
64
|
+
"react": {
|
|
65
|
+
"optional": true
|
|
66
|
+
},
|
|
67
|
+
"@supabase/supabase-js": {
|
|
68
|
+
"optional": true
|
|
69
|
+
},
|
|
70
|
+
"@tanstack/react-query": {
|
|
71
|
+
"optional": false
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"devDependencies": {
|
|
75
|
+
"@semantic-release/commit-analyzer": "^13.0.0",
|
|
76
|
+
"@semantic-release/github": "^11.0.0",
|
|
77
|
+
"@semantic-release/npm": "^12.0.1",
|
|
78
|
+
"@semantic-release/release-notes-generator": "^14.0.0",
|
|
79
|
+
"@types/react": "^19.2.14",
|
|
80
|
+
"@types/react-dom": "^19.2.3",
|
|
81
|
+
"conventional-changelog-conventionalcommits": "^8.0.0",
|
|
82
|
+
"esbuild": "^0.24.0",
|
|
83
|
+
"semantic-release": "^24.2.0",
|
|
84
|
+
"tsup": "^8.3.0",
|
|
85
|
+
"typescript": "^5.9.3"
|
|
86
|
+
},
|
|
87
|
+
"pnpm": {
|
|
88
|
+
"onlyBuiltDependencies": [
|
|
89
|
+
"esbuild"
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
}
|