@melony/ui-kit 0.1.14 → 0.1.18
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-BDCFD2QU.js → chunk-YQQJGXVQ.js} +3 -3
- package/dist/chunk-YQQJGXVQ.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 +3 -3
- package/dist/server.js +1 -1
- package/dist/{types-BerU1QhQ.d.ts → types-84_EO6uZ.d.ts} +71 -1
- package/package.json +1 -1
- package/dist/chunk-BDCFD2QU.js.map +0 -1
|
@@ -22,7 +22,7 @@ var ui = {
|
|
|
22
22
|
col: (props = {}, children = []) => ui.node("col", props, children),
|
|
23
23
|
box: (props = {}, children = []) => ui.node("box", props, children),
|
|
24
24
|
input: (name, label, props = {}) => ui.node("input", { name, label, ...props }),
|
|
25
|
-
textarea: (name,
|
|
25
|
+
textarea: (name, props = {}) => ui.node("textarea", { name, ...props }),
|
|
26
26
|
select: (name, options, label, props = {}) => ui.node("select", { name, options, label, ...props }),
|
|
27
27
|
checkbox: (name, label, props = {}) => ui.node("checkbox", { name, label, ...props }),
|
|
28
28
|
form: (props = {}, children = []) => ui.node("form", props, children),
|
|
@@ -35,5 +35,5 @@ var ui = {
|
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
export { ui };
|
|
38
|
-
//# sourceMappingURL=chunk-
|
|
39
|
-
//# sourceMappingURL=chunk-
|
|
38
|
+
//# sourceMappingURL=chunk-YQQJGXVQ.js.map
|
|
39
|
+
//# sourceMappingURL=chunk-YQQJGXVQ.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,MAC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O,CAAC,KAAA,GAA6B,EAAC,EAAG,QAAA,GAAqB,EAAC,KAC7D,EAAA,CAAG,IAAA,CAAK,OAAA,EAAS,KAAA,EAAO,QAAQ;AACpC","file":"chunk-YQQJGXVQ.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, props: Partial<UIContract[\"textarea\"]> = {}) =>\n ui.node(\"textarea\", { name, ...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-84_EO6uZ.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-84_EO6uZ.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-84_EO6uZ.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-84_EO6uZ.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-84_EO6uZ.js';
|
|
3
3
|
import 'melony';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -21,7 +21,7 @@ declare const ui: {
|
|
|
21
21
|
col: (props?: UIContract["col"], children?: UINode[]) => UINode<"col">;
|
|
22
22
|
box: (props?: UIContract["box"], children?: UINode[]) => UINode<"box">;
|
|
23
23
|
input: (name: string, label?: string, props?: Partial<UIContract["input"]>) => UINode<"input">;
|
|
24
|
-
textarea: (name: string,
|
|
24
|
+
textarea: (name: string, props?: Partial<UIContract["textarea"]>) => UINode<"textarea">;
|
|
25
25
|
select: (name: string, options: UIContract["select"]["options"], label?: string, props?: Partial<UIContract["select"]>) => UINode<"select">;
|
|
26
26
|
checkbox: (name: string, label?: string, props?: Partial<UIContract["checkbox"]>) => UINode<"checkbox">;
|
|
27
27
|
form: (props?: UIContract["form"], children?: UINode[]) => UINode<"form">;
|
package/dist/server.js
CHANGED
|
@@ -124,7 +124,6 @@ interface UIContract {
|
|
|
124
124
|
};
|
|
125
125
|
textarea: {
|
|
126
126
|
name: string;
|
|
127
|
-
label?: string;
|
|
128
127
|
placeholder?: string;
|
|
129
128
|
defaultValue?: string;
|
|
130
129
|
rows?: number;
|
|
@@ -132,6 +131,10 @@ interface UIContract {
|
|
|
132
131
|
disabled?: boolean;
|
|
133
132
|
required?: boolean;
|
|
134
133
|
width?: UIWidth;
|
|
134
|
+
background?: UIColor;
|
|
135
|
+
border?: boolean;
|
|
136
|
+
shadow?: UIShadow;
|
|
137
|
+
radius?: UIRadius;
|
|
135
138
|
};
|
|
136
139
|
select: {
|
|
137
140
|
name: string;
|
|
@@ -221,6 +224,73 @@ interface UIContract {
|
|
|
221
224
|
offsetY?: UISpacing;
|
|
222
225
|
showOnHover?: boolean;
|
|
223
226
|
};
|
|
227
|
+
streamingText: {
|
|
228
|
+
id: string;
|
|
229
|
+
size?: UISpacing;
|
|
230
|
+
weight?: "normal" | "medium" | "semibold" | "bold";
|
|
231
|
+
color?: UIColor;
|
|
232
|
+
align?: UIAlign;
|
|
233
|
+
className?: string;
|
|
234
|
+
markdown?: boolean;
|
|
235
|
+
};
|
|
236
|
+
badge: {
|
|
237
|
+
label: string;
|
|
238
|
+
variant?: "primary" | "secondary" | "danger" | "success" | "warning" | "outline";
|
|
239
|
+
size?: UISize;
|
|
240
|
+
};
|
|
241
|
+
card: {
|
|
242
|
+
title?: string;
|
|
243
|
+
subtitle?: string;
|
|
244
|
+
background?: UIColor;
|
|
245
|
+
padding?: UISpacing;
|
|
246
|
+
radius?: UIRadius;
|
|
247
|
+
shadow?: UIShadow;
|
|
248
|
+
};
|
|
249
|
+
chart: {
|
|
250
|
+
data: Array<{
|
|
251
|
+
label: string;
|
|
252
|
+
value: number;
|
|
253
|
+
color?: string;
|
|
254
|
+
}>;
|
|
255
|
+
chartType?: "bar" | "line";
|
|
256
|
+
title?: string;
|
|
257
|
+
height?: number;
|
|
258
|
+
showValues?: boolean;
|
|
259
|
+
showGrid?: boolean;
|
|
260
|
+
showTooltips?: boolean;
|
|
261
|
+
};
|
|
262
|
+
dropdown: {
|
|
263
|
+
items?: Array<{
|
|
264
|
+
label: string;
|
|
265
|
+
icon?: string;
|
|
266
|
+
onClickAction?: Event;
|
|
267
|
+
}>;
|
|
268
|
+
};
|
|
269
|
+
list: {
|
|
270
|
+
padding?: UISpacing;
|
|
271
|
+
gap?: UISpacing;
|
|
272
|
+
width?: UIWidth;
|
|
273
|
+
};
|
|
274
|
+
listItem: {
|
|
275
|
+
onClickAction?: Event;
|
|
276
|
+
gap?: UISpacing;
|
|
277
|
+
padding?: UISpacing;
|
|
278
|
+
background?: UIColor;
|
|
279
|
+
radius?: UIRadius;
|
|
280
|
+
align?: UIAlign;
|
|
281
|
+
truncate?: boolean;
|
|
282
|
+
};
|
|
283
|
+
thread: {
|
|
284
|
+
placeholder?: string;
|
|
285
|
+
messages?: Array<{
|
|
286
|
+
role: string;
|
|
287
|
+
content: any[];
|
|
288
|
+
runId?: string;
|
|
289
|
+
threadId?: string;
|
|
290
|
+
}>;
|
|
291
|
+
autoFocus?: boolean;
|
|
292
|
+
children?: any;
|
|
293
|
+
};
|
|
224
294
|
}
|
|
225
295
|
type UINode<T extends keyof UIContract = keyof UIContract> = {
|
|
226
296
|
type: T;
|
package/package.json
CHANGED
|
@@ -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,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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AAO,GAAG,OAAO,CAAA;AAAA,EAEtD,QAAA,EAAU,CAAC,IAAA,EAAc,KAAA,EAAgB,QAAyC,EAAC,KACjF,EAAA,CAAG,IAAA,CAAK,YAAY,EAAE,IAAA,EAAM,KAAA,EAAO,GAAG,OAAO,CAAA;AAAA,EAE/C,IAAA,EAAM,CAAC,KAAA,GAA4B,EAAC,EAAG,QAAA,GAAqB,EAAC,KAC3D,EAAA,CAAG,IAAA,CAAK,MAAA,EAAQ,KAAA,EAAO,QAAQ,CAAA;AAAA,EAEjC,IAAA,EAAM,CAAC,IAAA,EAAc,KAAA,GAAqC,EAAC,KACzD,EAAA,CAAG,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"]}
|