solid-sxo 0.0.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/README.md +14 -0
- package/dist/components/Button.d.ts +4 -0
- package/dist/components/Input.d.ts +4 -0
- package/dist/components/Tag.d.ts +4 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +71 -0
- package/package.json +57 -0
package/README.md
ADDED
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("solid-js/web"),o=require("@sxo/ui"),l=require("solid-js");var c=t.template("<button>");function i(r){const[e,n]=l.splitProps(r,["variant","size","rounded","class"]),a=()=>`${o.getButtonClasses({variant:e.variant,size:e.size,rounded:e.rounded})} ${e.class||""}`.trim();return(()=>{var s=c();return t.spread(s,t.mergeProps(n,{get class(){return a()}}),!1,!0),t.insert(s,()=>r.children),s})()}var d=t.template("<input>");function m(r){const[e,n]=l.splitProps(r,["variant","size","class"]),a=()=>`${o.getInputClasses({variant:e.variant,size:e.size})} ${e.class||""}`.trim();return(()=>{var s=d();return t.spread(s,t.mergeProps(n,{get class(){return a()}}),!1,!1),s})()}var v=t.template("<span>");function p(r){const[e,n]=l.splitProps(r,["variant","color","rounded","class"]),a=()=>`${o.getTagClasses({variant:e.variant,color:e.color,rounded:e.rounded}).base} ${e.class||""}`.trim();return(()=>{var s=v();return t.spread(s,t.mergeProps(n,{get class(){return a()}}),!1,!0),t.insert(s,()=>r.children),s})()}const u=l.createContext(o.defaultTheme);function g(r){return t.createComponent(u.Provider,{get value(){return r.theme||o.defaultTheme},get children(){return r.children}})}function h(){return l.useContext(u)}exports.Button=i;exports.Input=m;exports.Tag=p;exports.ThemeProvider=g;exports.useTheme=h;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ThemeContext } from '../../../packages/ui/src';
|
|
2
|
+
import { JSX } from 'solid-js';
|
|
3
|
+
export declare function ThemeProvider(props: {
|
|
4
|
+
theme?: ThemeContext;
|
|
5
|
+
children: JSX.Element;
|
|
6
|
+
}): JSX.Element;
|
|
7
|
+
export declare function useTheme(): ThemeContext;
|
|
8
|
+
export * from './components/Button';
|
|
9
|
+
export * from './components/Input';
|
|
10
|
+
export * from './components/Tag';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { template as a, spread as o, mergeProps as l, insert as u, createComponent as m } from "solid-js/web";
|
|
2
|
+
import { getButtonClasses as v, getInputClasses as $, getTagClasses as f, defaultTheme as i } from "@sxo/ui";
|
|
3
|
+
import { splitProps as c, createContext as C, useContext as h } from "solid-js";
|
|
4
|
+
var g = /* @__PURE__ */ a("<button>");
|
|
5
|
+
function P(t) {
|
|
6
|
+
const [e, r] = c(t, ["variant", "size", "rounded", "class"]), n = () => `${v({
|
|
7
|
+
variant: e.variant,
|
|
8
|
+
size: e.size,
|
|
9
|
+
rounded: e.rounded
|
|
10
|
+
})} ${e.class || ""}`.trim();
|
|
11
|
+
return (() => {
|
|
12
|
+
var s = g();
|
|
13
|
+
return o(s, l(r, {
|
|
14
|
+
get class() {
|
|
15
|
+
return n();
|
|
16
|
+
}
|
|
17
|
+
}), !1, !0), u(s, () => t.children), s;
|
|
18
|
+
})();
|
|
19
|
+
}
|
|
20
|
+
var p = /* @__PURE__ */ a("<input>");
|
|
21
|
+
function b(t) {
|
|
22
|
+
const [e, r] = c(t, ["variant", "size", "class"]), n = () => `${$({
|
|
23
|
+
variant: e.variant,
|
|
24
|
+
size: e.size
|
|
25
|
+
})} ${e.class || ""}`.trim();
|
|
26
|
+
return (() => {
|
|
27
|
+
var s = p();
|
|
28
|
+
return o(s, l(r, {
|
|
29
|
+
get class() {
|
|
30
|
+
return n();
|
|
31
|
+
}
|
|
32
|
+
}), !1, !1), s;
|
|
33
|
+
})();
|
|
34
|
+
}
|
|
35
|
+
var x = /* @__PURE__ */ a("<span>");
|
|
36
|
+
function B(t) {
|
|
37
|
+
const [e, r] = c(t, ["variant", "color", "rounded", "class"]), n = () => `${f({
|
|
38
|
+
variant: e.variant,
|
|
39
|
+
color: e.color,
|
|
40
|
+
rounded: e.rounded
|
|
41
|
+
}).base} ${e.class || ""}`.trim();
|
|
42
|
+
return (() => {
|
|
43
|
+
var s = x();
|
|
44
|
+
return o(s, l(r, {
|
|
45
|
+
get class() {
|
|
46
|
+
return n();
|
|
47
|
+
}
|
|
48
|
+
}), !1, !0), u(s, () => t.children), s;
|
|
49
|
+
})();
|
|
50
|
+
}
|
|
51
|
+
const d = C(i);
|
|
52
|
+
function I(t) {
|
|
53
|
+
return m(d.Provider, {
|
|
54
|
+
get value() {
|
|
55
|
+
return t.theme || i;
|
|
56
|
+
},
|
|
57
|
+
get children() {
|
|
58
|
+
return t.children;
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
function S() {
|
|
63
|
+
return h(d);
|
|
64
|
+
}
|
|
65
|
+
export {
|
|
66
|
+
P as Button,
|
|
67
|
+
b as Input,
|
|
68
|
+
B as Tag,
|
|
69
|
+
I as ThemeProvider,
|
|
70
|
+
S as useTheme
|
|
71
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "solid-sxo",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": "SolidJS adaptor for SXO Design System.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"sxo",
|
|
7
|
+
"design-system",
|
|
8
|
+
"ui",
|
|
9
|
+
"components",
|
|
10
|
+
"solid"
|
|
11
|
+
],
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"author": "sxo team",
|
|
14
|
+
"main": "./dist/index.cjs",
|
|
15
|
+
"module": "./dist/index.js",
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"import": "./dist/index.js",
|
|
21
|
+
"require": "./dist/index.cjs"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist"
|
|
26
|
+
],
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@sxo/ui": "0.0.0"
|
|
29
|
+
},
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"solid-js": "^1.7.0"
|
|
32
|
+
},
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "git+https://github.com/doki-land/sxo-engine.git",
|
|
36
|
+
"directory": "adaptors/solid-sxo"
|
|
37
|
+
},
|
|
38
|
+
"bugs": {
|
|
39
|
+
"url": "https://github.com/doki-land/sxo-engine/issues"
|
|
40
|
+
},
|
|
41
|
+
"homepage": "https://github.com/doki-land/sxo-engine/tree/main/adaptors/solid-sxo#readme",
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"solid-js": "^1.9.10",
|
|
47
|
+
"typescript": "^5.0.0",
|
|
48
|
+
"vite": "^5.0.0",
|
|
49
|
+
"vite-plugin-dts": "^4.0.0",
|
|
50
|
+
"vite-plugin-solid": "^2.11.10"
|
|
51
|
+
},
|
|
52
|
+
"type": "module",
|
|
53
|
+
"scripts": {
|
|
54
|
+
"build": "vite build",
|
|
55
|
+
"dev": "vite build --watch"
|
|
56
|
+
}
|
|
57
|
+
}
|