@melony/ui-kit 0.1.7 → 0.1.9
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/{chunk-522Y53MP.js → chunk-BDCFD2QU.js} +4 -9
- package/dist/chunk-BDCFD2QU.js.map +1 -0
- package/dist/client.d.ts +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/server.d.ts +4 -8
- package/dist/server.js +1 -1
- package/dist/{types-DyQAm50R.d.ts → types-BnMHFlyI.d.ts} +9 -59
- package/package.json +5 -5
- package/dist/chunk-522Y53MP.js.map +0 -1
|
@@ -15,14 +15,12 @@ var ui = {
|
|
|
15
15
|
type: "ui",
|
|
16
16
|
data: node
|
|
17
17
|
}),
|
|
18
|
-
card: (props = {}, children = []) => ui.node("card", props, children),
|
|
19
18
|
button: (props, children = []) => ui.node("button", props, children),
|
|
20
19
|
text: (value, props = {}) => ui.node("text", { value, ...props }),
|
|
21
20
|
heading: (value, level = 1, props = {}) => ui.node("heading", { value, level, ...props }),
|
|
22
21
|
row: (props = {}, children = []) => ui.node("row", props, children),
|
|
23
22
|
col: (props = {}, children = []) => ui.node("col", props, children),
|
|
24
23
|
box: (props = {}, children = []) => ui.node("box", props, children),
|
|
25
|
-
badge: (label, variant = "primary", props = {}) => ui.node("badge", { label, variant, ...props }),
|
|
26
24
|
input: (name, label, props = {}) => ui.node("input", { name, label, ...props }),
|
|
27
25
|
textarea: (name, label, props = {}) => ui.node("textarea", { name, label, ...props }),
|
|
28
26
|
select: (name, options, label, props = {}) => ui.node("select", { name, options, label, ...props }),
|
|
@@ -32,13 +30,10 @@ var ui = {
|
|
|
32
30
|
image: (src, alt, props = {}) => ui.node("image", { src, alt, ...props }),
|
|
33
31
|
spacer: (props = {}) => ui.node("spacer", props),
|
|
34
32
|
divider: (props = {}) => ui.node("divider", props),
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
// organisms
|
|
38
|
-
thread: (props = {}, children = []) => ui.node("thread", props, children),
|
|
39
|
-
themeToggle: (props = {}) => ui.node("themeToggle", props)
|
|
33
|
+
popover: (props = {}, children = []) => ui.node("popover", props, children),
|
|
34
|
+
float: (props = {}, children = []) => ui.node("float", props, children)
|
|
40
35
|
};
|
|
41
36
|
|
|
42
37
|
export { ui };
|
|
43
|
-
//# sourceMappingURL=chunk-
|
|
44
|
-
//# sourceMappingURL=chunk-
|
|
38
|
+
//# sourceMappingURL=chunk-BDCFD2QU.js.map
|
|
39
|
+
//# sourceMappingURL=chunk-BDCFD2QU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/server.ts"],"names":[],"mappings":";AAOO,IAAM,EAAA,GAAK;AAAA;AAAA;AAAA;AAAA,EAIhB,IAAA,EAAM,CACJ,IAAA,EACA,KAAA,GAAuB,EAAC,EACxB,QAAA,GAA0B,EAAC,MACZ;AAAA,IACf,IAAA;AAAA,IACA,KAAA;AAAA,IACA;AAAA,GACF,CAAA;AAAA;AAAA;AAAA;AAAA,EAKA,KAAA,EAAO,CAAC,IAAA,MAA2B;AAAA,IACjC,IAAA,EAAM,IAAA;AAAA,IACN,IAAA,EAAM;AAAA,GACR,CAAA;AAAA,EAEA,MAAA,EAAQ,CAAC,KAAA,EAA6B,QAAA,GAAqB,OACzD,EAAA,CAAG,IAAA,CAAK,QAAA,EAAU,KAAA,EAAO,QAAQ,CAAA;AAAA,EAEnC,IAAA,EAAM,CAAC,KAAA,EAAe,KAAA,GAAqC,EAAC,KAC1D,EAAA,CAAG,IAAA,CAAK,MAAA,EAAQ,EAAE,KAAA,EAAO,GAAG,OAAO,CAAA;AAAA,EAErC,SAAS,CAAC,KAAA,EAAe,KAAA,GAAwC,CAAA,EAAG,QAAwC,EAAC,KAC3G,EAAA,CAAG,IAAA,CAAK,WAAW,EAAE,KAAA,EAAO,KAAA,EAAO,GAAG,OAAO,CAAA;AAAA,EAE/C,GAAA,EAAK,CAAC,KAAA,GAA2B,EAAC,EA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G,IAAA,CAAK,MAAA,EAAQ,EAAE,IAAA,EAAM,GAAG,OAAO,CAAA;AAAA,EAEpC,KAAA,EAAO,CAAC,GAAA,EAAa,GAAA,EAAc,QAAsC,EAAC,KACxE,EAAA,CAAG,IAAA,CAAK,SAAS,EAAE,GAAA,EAAK,GAAA,EAAK,GAAG,OAAO,CAAA;AAAA,EAEzC,MAAA,EAAQ,CAAC,KAAA,GAA8B,OACrC,EAAA,CAAG,IAAA,CAAK,UAAU,KAAK,CAAA;AAAA,EAEzB,OAAA,EAAS,CAAC,KAAA,GAA+B,OACvC,EAAA,CAAG,IAAA,CAAK,WAAW,KAAK,CAAA;AAAA,EAE1B,OAAA,EAAS,CAAC,KAAA,GAA+B,EAAC,EAAG,QAAA,GAAqB,EAAC,KACjE,EAAA,CAAG,IAAA,CAAK,SAAA,EAAW,KAAA,EAAO,QAAQ,CAAA;AAAA,EAEpC,KAAA,EAAO,CAAC,KAAA,GAA6B,EAAC,EAAG,QAAA,GAAqB,EAAC,KAC7D,EAAA,CAAG,IAAA,CAAK,OAAA,EAAS,KAAA,EAAO,QAAQ;AACpC","file":"chunk-BDCFD2QU.js","sourcesContent":["import { UIContract, UINode, UIEvent } from \"./types\";\n\nexport * from \"./types\";\n\n/**\n * Helper to create UI events in Melony actions.\n */\nexport const ui = {\n /**\n * Creates a UI node.\n */\n node: <T extends keyof UIContract>(\n type: T,\n props: UIContract[T] = {} as any,\n children: UINode<any>[] = []\n ): UINode<T> => ({\n type,\n props,\n children,\n }),\n\n /**\n * Wraps a UI node in an event.\n */\n event: (node: UINode): UIEvent => ({\n type: \"ui\",\n data: node,\n }),\n\n button: (props: UIContract[\"button\"], children: UINode[] = []) =>\n ui.node(\"button\", props, children),\n\n text: (value: string, props: Partial<UIContract[\"text\"]> = {}) =>\n ui.node(\"text\", { value, ...props }),\n\n heading: (value: string, level: UIContract[\"heading\"][\"level\"] = 1, props: Partial<UIContract[\"heading\"]> = {}) =>\n ui.node(\"heading\", { value, level, ...props }),\n\n row: (props: UIContract[\"row\"] = {}, children: UINode[] = []) =>\n ui.node(\"row\", props, children),\n\n col: (props: UIContract[\"col\"] = {}, children: UINode[] = []) =>\n ui.node(\"col\", props, children),\n\n box: (props: UIContract[\"box\"] = {}, children: UINode[] = []) =>\n ui.node(\"box\", props, children),\n\n input: (name: string, label?: string, props: Partial<UIContract[\"input\"]> = {}) =>\n ui.node(\"input\", { name, label, ...props }),\n\n textarea: (name: string, label?: string, props: Partial<UIContract[\"textarea\"]> = {}) =>\n ui.node(\"textarea\", { name, label, ...props }),\n\n select: (name: string, options: UIContract[\"select\"][\"options\"], label?: string, props: Partial<UIContract[\"select\"]> = {}) =>\n ui.node(\"select\", { name, options, label, ...props }),\n\n checkbox: (name: string, label?: string, props: Partial<UIContract[\"checkbox\"]> = {}) =>\n ui.node(\"checkbox\", { name, label, ...props }),\n\n form: (props: UIContract[\"form\"] = {}, children: UINode[] = []) =>\n ui.node(\"form\", props, children),\n\n icon: (name: string, props: Partial<UIContract[\"icon\"]> = {}) =>\n ui.node(\"icon\", { name, ...props }),\n\n image: (src: string, alt?: string, props: Partial<UIContract[\"image\"]> = {}) =>\n ui.node(\"image\", { src, alt, ...props }),\n\n spacer: (props: UIContract[\"spacer\"] = {}) =>\n ui.node(\"spacer\", props),\n\n divider: (props: UIContract[\"divider\"] = {}) =>\n ui.node(\"divider\", props),\n\n popover: (props: UIContract[\"popover\"] = {}, children: UINode[] = []) =>\n ui.node(\"popover\", props, children),\n\n float: (props: UIContract[\"float\"] = {}, children: UINode[] = []) =>\n ui.node(\"float\", props, children),\n};\n"]}
|
package/dist/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { j as UIContract, k as UINode } from './types-
|
|
2
|
-
export { a as UIAlign, e as UIColor, l as UIEvent, b as UIJustify, d as UIOrientation, i as UIRadius, h as UIShadow, U as UISize, f as UISpacing, g as UIWidth, c as UIWrap } from './types-
|
|
1
|
+
import { j as UIContract, k as UINode } from './types-BnMHFlyI.js';
|
|
2
|
+
export { a as UIAlign, e as UIColor, l as UIEvent, b as UIJustify, d as UIOrientation, i as UIRadius, h as UIShadow, U as UISize, f as UISpacing, g as UIWidth, c as UIWrap } from './types-BnMHFlyI.js';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import React, { ReactNode } from 'react';
|
|
5
5
|
import 'melony';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { ui } from './server.js';
|
|
2
|
-
export { a as UIAlign, e as UIColor, j as UIContract, l as UIEvent, b as UIJustify, k as UINode, d as UIOrientation, i as UIRadius, h as UIShadow, U as UISize, f as UISpacing, g as UIWidth, c as UIWrap } from './types-
|
|
2
|
+
export { a as UIAlign, e as UIColor, j as UIContract, l as UIEvent, b as UIJustify, k as UINode, d as UIOrientation, i as UIRadius, h as UIShadow, U as UISize, f as UISpacing, g as UIWidth, c as UIWrap } from './types-BnMHFlyI.js';
|
|
3
3
|
export { MelonyComponents, MelonyRenderer, MelonyRendererProps, MelonyUIContextValue, MelonyUIProvider, MelonyUIProviderProps, useMelonyUI } from './client.js';
|
|
4
4
|
import 'melony';
|
|
5
5
|
import 'react/jsx-runtime';
|
package/dist/index.js
CHANGED
package/dist/server.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { j as UIContract, k as UINode, l as UIEvent } from './types-
|
|
2
|
-
export { a as UIAlign, e as UIColor, b as UIJustify, d as UIOrientation, i as UIRadius, h as UIShadow, U as UISize, f as UISpacing, g as UIWidth, c as UIWrap } from './types-
|
|
1
|
+
import { j as UIContract, k as UINode, l as UIEvent } from './types-BnMHFlyI.js';
|
|
2
|
+
export { a as UIAlign, e as UIColor, b as UIJustify, d as UIOrientation, i as UIRadius, h as UIShadow, U as UISize, f as UISpacing, g as UIWidth, c as UIWrap } from './types-BnMHFlyI.js';
|
|
3
3
|
import 'melony';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -14,14 +14,12 @@ declare const ui: {
|
|
|
14
14
|
* Wraps a UI node in an event.
|
|
15
15
|
*/
|
|
16
16
|
event: (node: UINode) => UIEvent;
|
|
17
|
-
card: (props?: UIContract["card"], children?: UINode[]) => UINode<"card">;
|
|
18
17
|
button: (props: UIContract["button"], children?: UINode[]) => UINode<"button">;
|
|
19
18
|
text: (value: string, props?: Partial<UIContract["text"]>) => UINode<"text">;
|
|
20
19
|
heading: (value: string, level?: UIContract["heading"]["level"], props?: Partial<UIContract["heading"]>) => UINode<"heading">;
|
|
21
20
|
row: (props?: UIContract["row"], children?: UINode[]) => UINode<"row">;
|
|
22
21
|
col: (props?: UIContract["col"], children?: UINode[]) => UINode<"col">;
|
|
23
22
|
box: (props?: UIContract["box"], children?: UINode[]) => UINode<"box">;
|
|
24
|
-
badge: (label: string, variant?: UIContract["badge"]["variant"], props?: Partial<UIContract["badge"]>) => UINode<"badge">;
|
|
25
23
|
input: (name: string, label?: string, props?: Partial<UIContract["input"]>) => UINode<"input">;
|
|
26
24
|
textarea: (name: string, label?: string, props?: Partial<UIContract["textarea"]>) => UINode<"textarea">;
|
|
27
25
|
select: (name: string, options: UIContract["select"]["options"], label?: string, props?: Partial<UIContract["select"]>) => UINode<"select">;
|
|
@@ -31,10 +29,8 @@ declare const ui: {
|
|
|
31
29
|
image: (src: string, alt?: string, props?: Partial<UIContract["image"]>) => UINode<"image">;
|
|
32
30
|
spacer: (props?: UIContract["spacer"]) => UINode<"spacer">;
|
|
33
31
|
divider: (props?: UIContract["divider"]) => UINode<"divider">;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
thread: (props?: UIContract["thread"], children?: UINode[]) => UINode<"thread">;
|
|
37
|
-
themeToggle: (props?: UIContract["themeToggle"]) => UINode<"themeToggle">;
|
|
32
|
+
popover: (props?: UIContract["popover"], children?: UINode[]) => UINode<"popover">;
|
|
33
|
+
float: (props?: UIContract["float"], children?: UINode[]) => UINode<"float">;
|
|
38
34
|
};
|
|
39
35
|
|
|
40
36
|
export { UIContract, UIEvent, UINode, ui };
|
package/dist/server.js
CHANGED
|
@@ -15,16 +15,6 @@ type UIRadius = "none" | "sm" | "md" | "lg" | "full" | (string & {});
|
|
|
15
15
|
* This acts as the source of truth for the SDUI protocol.
|
|
16
16
|
*/
|
|
17
17
|
interface UIContract {
|
|
18
|
-
card: {
|
|
19
|
-
title?: string;
|
|
20
|
-
subtitle?: string;
|
|
21
|
-
background?: UIColor;
|
|
22
|
-
padding?: UISpacing;
|
|
23
|
-
radius?: UIRadius;
|
|
24
|
-
shadow?: UIShadow;
|
|
25
|
-
streaming?: boolean;
|
|
26
|
-
group?: boolean;
|
|
27
|
-
};
|
|
28
18
|
row: {
|
|
29
19
|
align?: UIAlign;
|
|
30
20
|
justify?: UIJustify;
|
|
@@ -67,6 +57,7 @@ interface UIContract {
|
|
|
67
57
|
group?: boolean;
|
|
68
58
|
flex?: number;
|
|
69
59
|
overflow?: "hidden" | "visible" | "scroll" | "auto";
|
|
60
|
+
onClickAction?: Event;
|
|
70
61
|
};
|
|
71
62
|
spacer: {
|
|
72
63
|
size?: UISpacing;
|
|
@@ -91,11 +82,6 @@ interface UIContract {
|
|
|
91
82
|
color?: UIColor;
|
|
92
83
|
align?: UIAlign;
|
|
93
84
|
};
|
|
94
|
-
badge: {
|
|
95
|
-
label: string;
|
|
96
|
-
variant?: "primary" | "secondary" | "success" | "danger" | "warning" | "outline";
|
|
97
|
-
size?: UISize;
|
|
98
|
-
};
|
|
99
85
|
image: {
|
|
100
86
|
src: string;
|
|
101
87
|
alt?: string;
|
|
@@ -122,32 +108,6 @@ interface UIContract {
|
|
|
122
108
|
size?: UISize | number;
|
|
123
109
|
color?: UIColor;
|
|
124
110
|
};
|
|
125
|
-
chart: {
|
|
126
|
-
data: Array<{
|
|
127
|
-
label: string;
|
|
128
|
-
value: number;
|
|
129
|
-
color?: string;
|
|
130
|
-
}>;
|
|
131
|
-
chartType?: "bar" | "line" | "area" | "pie";
|
|
132
|
-
title?: string;
|
|
133
|
-
height?: number;
|
|
134
|
-
showValues?: boolean;
|
|
135
|
-
showGrid?: boolean;
|
|
136
|
-
showTooltips?: boolean;
|
|
137
|
-
};
|
|
138
|
-
list: {
|
|
139
|
-
padding?: UISpacing;
|
|
140
|
-
gap?: UISpacing;
|
|
141
|
-
width?: UIWidth;
|
|
142
|
-
};
|
|
143
|
-
listItem: {
|
|
144
|
-
onClickAction?: Event;
|
|
145
|
-
gap?: UISpacing;
|
|
146
|
-
padding?: UISpacing;
|
|
147
|
-
background?: UIColor;
|
|
148
|
-
radius?: UIRadius;
|
|
149
|
-
truncate?: boolean;
|
|
150
|
-
};
|
|
151
111
|
form: {
|
|
152
112
|
onSubmitAction?: Event | ((data: any) => Event);
|
|
153
113
|
gap?: UISpacing;
|
|
@@ -247,30 +207,20 @@ interface UIContract {
|
|
|
247
207
|
width?: UIWidth;
|
|
248
208
|
onClickAction?: Event;
|
|
249
209
|
};
|
|
210
|
+
popover: {
|
|
211
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
212
|
+
align?: "start" | "center" | "end";
|
|
213
|
+
sideOffset?: number;
|
|
214
|
+
alignOffset?: number;
|
|
215
|
+
modal?: boolean;
|
|
216
|
+
trigger?: UINode;
|
|
217
|
+
};
|
|
250
218
|
float: {
|
|
251
219
|
position?: "top-left" | "top-right" | "top-center" | "bottom-left" | "bottom-right" | "bottom-center" | "center" | "left-center" | "right-center";
|
|
252
220
|
offsetX?: UISpacing;
|
|
253
221
|
offsetY?: UISpacing;
|
|
254
222
|
showOnHover?: boolean;
|
|
255
223
|
};
|
|
256
|
-
dropdown: {
|
|
257
|
-
items: Array<{
|
|
258
|
-
label: string;
|
|
259
|
-
icon?: string;
|
|
260
|
-
onClickAction?: Event;
|
|
261
|
-
}>;
|
|
262
|
-
className?: string;
|
|
263
|
-
triggerClassName?: string;
|
|
264
|
-
};
|
|
265
|
-
thread: {
|
|
266
|
-
placeholder?: string;
|
|
267
|
-
messages?: any[];
|
|
268
|
-
autoFocus?: boolean;
|
|
269
|
-
children?: React.ReactNode;
|
|
270
|
-
};
|
|
271
|
-
themeToggle: {
|
|
272
|
-
theme?: "light" | "dark" | "system";
|
|
273
|
-
};
|
|
274
224
|
}
|
|
275
225
|
type UINode<T extends keyof UIContract = keyof UIContract> = {
|
|
276
226
|
type: T;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@melony/ui-kit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -26,11 +26,12 @@
|
|
|
26
26
|
"dist"
|
|
27
27
|
],
|
|
28
28
|
"peerDependencies": {
|
|
29
|
+
"melony": "^0.2.9",
|
|
29
30
|
"react": "^18.0.0 || ^19.0.0",
|
|
30
|
-
"react-dom": "^18.0.0 || ^19.0.0"
|
|
31
|
-
"melony": "0.2.9"
|
|
31
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
+
"melony": "^0.2.9",
|
|
34
35
|
"react": "^19.0.0",
|
|
35
36
|
"react-dom": "^19.0.0",
|
|
36
37
|
"@types/react": "^19.0.0",
|
|
@@ -38,8 +39,7 @@
|
|
|
38
39
|
"tsup": "^8.3.0",
|
|
39
40
|
"typescript": "^5.5.4",
|
|
40
41
|
"rimraf": "^5.0.10",
|
|
41
|
-
"@types/node": "^20.14.10"
|
|
42
|
-
"melony": "0.2.9"
|
|
42
|
+
"@types/node": "^20.14.10"
|
|
43
43
|
},
|
|
44
44
|
"publishConfig": {
|
|
45
45
|
"access": "public"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/server.ts"],"names":[],"mappings":";AAOO,IAAM,EAAA,GAAK;AAAA;AAAA;AAAA;AAAA,EAIhB,IAAA,EAAM,CACJ,IAAA,EACA,K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,OAAO,CAAA;AAAA,EAEzC,MAAA,EAAQ,CAAC,KAAA,GAA8B,OACrC,EAAA,CAAG,IAAA,CAAK,UAAU,KAAK,CAAA;AAAA,EAEzB,OAAA,EAAS,CAAC,KAAA,GAA+B,OACvC,EAAA,CAAG,IAAA,CAAK,WAAW,KAAK,CAAA;AAAA,EAE1B,IAAA,EAAM,CAAC,KAAA,GAA4B,EAAC,EAAG,QAAA,GAAqB,EAAC,KAC3D,EAAA,CAAG,IAAA,CAAK,MAAA,EAAQ,KAAA,EAAO,QAAQ,CAAA;AAAA,EAEjC,QAAA,EAAU,CAAC,KAAA,GAAgC,EAAC,EAAG,QAAA,GAAqB,EAAC,KACnE,EAAA,CAAG,IAAA,CAAK,UAAA,EAAY,KAAA,EAAO,QAAQ,CAAA;AAAA;AAAA,EAGrC,MAAA,EAAQ,CAAC,KAAA,GAA8B,EAAC,EAAG,QAAA,GAAqB,EAAC,KAC/D,EAAA,CAAG,IAAA,CAAK,QAAA,EAAU,KAAA,EAAO,QAAQ,CAAA;AAAA,EAEnC,WAAA,EAAa,CAAC,KAAA,GAAmC,OAC/C,EAAA,CAAG,IAAA,CAAK,eAAe,KAAK;AAChC","file":"chunk-522Y53MP.js","sourcesContent":["import { UIContract, UINode, UIEvent } from \"./types\";\n\nexport * from \"./types\";\n\n/**\n * Helper to create UI events in Melony actions.\n */\nexport const ui = {\n /**\n * Creates a UI node.\n */\n node: <T extends keyof UIContract>(\n type: T,\n props: UIContract[T] = {} as any,\n children: UINode<any>[] = []\n ): UINode<T> => ({\n type,\n props,\n children,\n }),\n\n /**\n * Wraps a UI node in an event.\n */\n event: (node: UINode): UIEvent => ({\n type: \"ui\",\n data: node,\n }),\n\n card: (props: UIContract[\"card\"] = {}, children: UINode[] = []) =>\n ui.node(\"card\", props, children),\n\n button: (props: UIContract[\"button\"], children: UINode[] = []) =>\n ui.node(\"button\", props, children),\n\n text: (value: string, props: Partial<UIContract[\"text\"]> = {}) =>\n ui.node(\"text\", { value, ...props }),\n\n heading: (value: string, level: UIContract[\"heading\"][\"level\"] = 1, props: Partial<UIContract[\"heading\"]> = {}) =>\n ui.node(\"heading\", { value, level, ...props }),\n\n row: (props: UIContract[\"row\"] = {}, children: UINode[] = []) =>\n ui.node(\"row\", props, children),\n\n col: (props: UIContract[\"col\"] = {}, children: UINode[] = []) =>\n ui.node(\"col\", props, children),\n\n box: (props: UIContract[\"box\"] = {}, children: UINode[] = []) =>\n ui.node(\"box\", props, children),\n\n badge: (label: string, variant: UIContract[\"badge\"][\"variant\"] = \"primary\", props: Partial<UIContract[\"badge\"]> = {}) =>\n ui.node(\"badge\", { label, variant, ...props }),\n\n input: (name: string, label?: string, props: Partial<UIContract[\"input\"]> = {}) =>\n ui.node(\"input\", { name, label, ...props }),\n\n textarea: (name: string, label?: string, props: Partial<UIContract[\"textarea\"]> = {}) =>\n ui.node(\"textarea\", { name, label, ...props }),\n\n select: (name: string, options: UIContract[\"select\"][\"options\"], label?: string, props: Partial<UIContract[\"select\"]> = {}) =>\n ui.node(\"select\", { name, options, label, ...props }),\n\n checkbox: (name: string, label?: string, props: Partial<UIContract[\"checkbox\"]> = {}) =>\n ui.node(\"checkbox\", { name, label, ...props }),\n\n form: (props: UIContract[\"form\"] = {}, children: UINode[] = []) =>\n ui.node(\"form\", props, children),\n\n icon: (name: string, props: Partial<UIContract[\"icon\"]> = {}) =>\n ui.node(\"icon\", { name, ...props }),\n\n image: (src: string, alt?: string, props: Partial<UIContract[\"image\"]> = {}) =>\n ui.node(\"image\", { src, alt, ...props }),\n\n spacer: (props: UIContract[\"spacer\"] = {}) =>\n ui.node(\"spacer\", props),\n\n divider: (props: UIContract[\"divider\"] = {}) =>\n ui.node(\"divider\", props),\n\n list: (props: UIContract[\"list\"] = {}, children: UINode[] = []) =>\n ui.node(\"list\", props, children),\n\n listItem: (props: UIContract[\"listItem\"] = {}, children: UINode[] = []) =>\n ui.node(\"listItem\", props, children),\n\n // organisms\n thread: (props: UIContract[\"thread\"] = {}, children: UINode[] = []) =>\n ui.node(\"thread\", props, children),\n\n themeToggle: (props: UIContract[\"themeToggle\"] = {}) =>\n ui.node(\"themeToggle\", props)\n};\n"]}
|