@melony/ui-kit 0.1.1 → 0.1.2
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-FAENZMHH.js → chunk-H3YMHUQF.js} +6 -3
- package/dist/chunk-H3YMHUQF.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 -2
- package/dist/server.js +1 -1
- package/dist/{types-6bwIi949.d.ts → types-DtZUMRhi.d.ts} +6 -1
- package/package.json +3 -3
- package/dist/chunk-FAENZMHH.js.map +0 -1
|
@@ -21,6 +21,7 @@ var ui = {
|
|
|
21
21
|
heading: (value, level = 1, props = {}) => ui.node("heading", { value, level, ...props }),
|
|
22
22
|
row: (props = {}, children = []) => ui.node("row", props, children),
|
|
23
23
|
col: (props = {}, children = []) => ui.node("col", props, children),
|
|
24
|
+
box: (props = {}, children = []) => ui.node("box", props, children),
|
|
24
25
|
badge: (label, variant = "primary", props = {}) => ui.node("badge", { label, variant, ...props }),
|
|
25
26
|
input: (name, label, props = {}) => ui.node("input", { name, label, ...props }),
|
|
26
27
|
textarea: (name, label, props = {}) => ui.node("textarea", { name, label, ...props }),
|
|
@@ -32,9 +33,11 @@ var ui = {
|
|
|
32
33
|
spacer: (props = {}) => ui.node("spacer", props),
|
|
33
34
|
divider: (props = {}) => ui.node("divider", props),
|
|
34
35
|
list: (props = {}, children = []) => ui.node("list", props, children),
|
|
35
|
-
listItem: (props = {}, children = []) => ui.node("listItem", props, children)
|
|
36
|
+
listItem: (props = {}, children = []) => ui.node("listItem", props, children),
|
|
37
|
+
// organisms
|
|
38
|
+
thread: (props = {}, children = []) => ui.node("thread", props, children)
|
|
36
39
|
};
|
|
37
40
|
|
|
38
41
|
export { ui };
|
|
39
|
-
//# sourceMappingURL=chunk-
|
|
40
|
-
//# sourceMappingURL=chunk-
|
|
42
|
+
//# sourceMappingURL=chunk-H3YMHUQF.js.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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,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;AACrC","file":"chunk-H3YMHUQF.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"]}
|
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-DtZUMRhi.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-DtZUMRhi.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-DtZUMRhi.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-DtZUMRhi.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-DtZUMRhi.js';
|
|
3
3
|
import 'melony';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -20,6 +20,7 @@ declare const ui: {
|
|
|
20
20
|
heading: (value: string, level?: UIContract["heading"]["level"], props?: Partial<UIContract["heading"]>) => UINode<"heading">;
|
|
21
21
|
row: (props?: UIContract["row"], children?: UINode[]) => UINode<"row">;
|
|
22
22
|
col: (props?: UIContract["col"], children?: UINode[]) => UINode<"col">;
|
|
23
|
+
box: (props?: UIContract["box"], children?: UINode[]) => UINode<"box">;
|
|
23
24
|
badge: (label: string, variant?: UIContract["badge"]["variant"], props?: Partial<UIContract["badge"]>) => UINode<"badge">;
|
|
24
25
|
input: (name: string, label?: string, props?: Partial<UIContract["input"]>) => UINode<"input">;
|
|
25
26
|
textarea: (name: string, label?: string, props?: Partial<UIContract["textarea"]>) => UINode<"textarea">;
|
|
@@ -32,6 +33,7 @@ declare const ui: {
|
|
|
32
33
|
divider: (props?: UIContract["divider"]) => UINode<"divider">;
|
|
33
34
|
list: (props?: UIContract["list"], children?: UINode[]) => UINode<"list">;
|
|
34
35
|
listItem: (props?: UIContract["listItem"], children?: UINode[]) => UINode<"listItem">;
|
|
36
|
+
thread: (props?: UIContract["thread"], children?: UINode[]) => UINode<"thread">;
|
|
35
37
|
};
|
|
36
38
|
|
|
37
39
|
export { UIContract, UIEvent, UINode, ui };
|
package/dist/server.js
CHANGED
|
@@ -7,7 +7,7 @@ type UIWrap = "nowrap" | "wrap" | "wrap-reverse";
|
|
|
7
7
|
type UIOrientation = "horizontal" | "vertical";
|
|
8
8
|
type UIColor = "primary" | "secondary" | "success" | "danger" | "warning" | "info" | "background" | "foreground" | "muted" | "mutedForeground" | "border" | "transparent";
|
|
9
9
|
type UISpacing = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
|
|
10
|
-
type UIWidth = "auto" | "full" | "min" | "max" | "1/2" | "1/3" | "2/3" | "1/4" | "3/4";
|
|
10
|
+
type UIWidth = "auto" | "full" | "min" | "max" | "1/2" | "1/3" | "2/3" | "1/4" | "3/4" | number;
|
|
11
11
|
type UIShadow = "none" | "sm" | "md" | "lg" | "xl";
|
|
12
12
|
type UIRadius = "none" | "sm" | "md" | "lg" | "full";
|
|
13
13
|
/**
|
|
@@ -32,6 +32,7 @@ interface UIContract {
|
|
|
32
32
|
gap?: UISpacing;
|
|
33
33
|
padding?: UISpacing;
|
|
34
34
|
width?: UIWidth;
|
|
35
|
+
height?: "auto" | "full";
|
|
35
36
|
group?: boolean;
|
|
36
37
|
};
|
|
37
38
|
col: {
|
|
@@ -47,7 +48,11 @@ interface UIContract {
|
|
|
47
48
|
};
|
|
48
49
|
box: {
|
|
49
50
|
padding?: UISpacing;
|
|
51
|
+
paddingVertical?: UISpacing;
|
|
52
|
+
paddingHorizontal?: UISpacing;
|
|
50
53
|
margin?: UISpacing;
|
|
54
|
+
marginVertical?: UISpacing;
|
|
55
|
+
marginHorizontal?: UISpacing;
|
|
51
56
|
background?: UIColor;
|
|
52
57
|
border?: boolean;
|
|
53
58
|
borderColor?: UIColor;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@melony/ui-kit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"react": "^18.0.0 || ^19.0.0",
|
|
30
30
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
31
|
-
"melony": "0.2.
|
|
31
|
+
"melony": "0.2.6"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"react": "^19.0.0",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"typescript": "^5.5.4",
|
|
40
40
|
"rimraf": "^5.0.10",
|
|
41
41
|
"@types/node": "^20.14.10",
|
|
42
|
-
"melony": "0.2.
|
|
42
|
+
"melony": "0.2.6"
|
|
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,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,IAAA,EAAM,CAAC,KAAA,GAA4B,EAAC,EAAG,QAAA,GAAqB,EAAC,KAC3D,EAAA,CAAG,IAAA,CAAK,MAAA,EAAQ,KAAA,EAAO,QAAQ,CAAA;AAAA,EAEjC,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,G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AAO,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,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;AACvC","file":"chunk-FAENZMHH.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 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"]}
|