@xanui/core 1.1.2 → 1.1.3
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/ServerStyleTags.d.ts +3 -0
- package/ServerStyleTags.js +2 -0
- package/ServerStyleTags.js.map +7 -0
- package/Tag/cssPropList.d.ts +2 -0
- package/Tag/cssPropList.js +2 -0
- package/Tag/cssPropList.js.map +7 -0
- package/Tag/index.d.ts +4 -0
- package/Tag/index.js +2 -0
- package/Tag/index.js.map +7 -0
- package/{src/Tag/types.ts → Tag/types.d.ts} +9 -13
- package/Tag/types.js +1 -0
- package/Tag/types.js.map +7 -0
- package/Tag/useTagProps.d.ts +3 -0
- package/Tag/useTagProps.js +2 -0
- package/Tag/useTagProps.js.map +7 -0
- package/Transition/index.d.ts +31 -0
- package/Transition/index.js +2 -0
- package/Transition/index.js.map +7 -0
- package/Transition/variants.d.ts +131 -0
- package/Transition/variants.js +2 -0
- package/Transition/variants.js.map +7 -0
- package/breakpoint/index.d.ts +6 -0
- package/breakpoint/index.js +2 -0
- package/breakpoint/index.js.map +7 -0
- package/breakpoint/useBreakpoint.d.ts +10 -0
- package/breakpoint/useBreakpoint.js +2 -0
- package/breakpoint/useBreakpoint.js.map +7 -0
- package/breakpoint/useBreakpointProps.d.ts +6 -0
- package/breakpoint/useBreakpointProps.js +2 -0
- package/breakpoint/useBreakpointProps.js.map +7 -0
- package/cjs/ServerStyleTags.js +2 -0
- package/cjs/ServerStyleTags.js.map +7 -0
- package/cjs/Tag/cssPropList.js +2 -0
- package/cjs/Tag/cssPropList.js.map +7 -0
- package/cjs/Tag/index.js +2 -0
- package/cjs/Tag/index.js.map +7 -0
- package/cjs/Tag/types.js +2 -0
- package/cjs/Tag/types.js.map +7 -0
- package/cjs/Tag/useTagProps.js +2 -0
- package/cjs/Tag/useTagProps.js.map +7 -0
- package/cjs/Transition/index.js +2 -0
- package/cjs/Transition/index.js.map +7 -0
- package/cjs/Transition/variants.js +2 -0
- package/cjs/Transition/variants.js.map +7 -0
- package/cjs/breakpoint/index.js +2 -0
- package/cjs/breakpoint/index.js.map +7 -0
- package/cjs/breakpoint/useBreakpoint.js +2 -0
- package/cjs/breakpoint/useBreakpoint.js.map +7 -0
- package/cjs/breakpoint/useBreakpointProps.js +2 -0
- package/cjs/breakpoint/useBreakpointProps.js.map +7 -0
- package/cjs/css/aliases.js +2 -0
- package/cjs/css/aliases.js.map +7 -0
- package/cjs/css/getProps.js +2 -0
- package/cjs/css/getProps.js.map +7 -0
- package/cjs/css/getValue.js +2 -0
- package/cjs/css/getValue.js.map +7 -0
- package/cjs/css/index.js +2 -0
- package/cjs/css/index.js.map +7 -0
- package/cjs/css/types.js +2 -0
- package/cjs/css/types.js.map +7 -0
- package/cjs/index.js +2 -0
- package/cjs/index.js.map +7 -0
- package/cjs/isWindow.js +2 -0
- package/cjs/isWindow.js.map +7 -0
- package/cjs/theme/ThemeCssVars.js +2 -0
- package/cjs/theme/ThemeCssVars.js.map +7 -0
- package/cjs/theme/ThemeDefaultOptions.js +2 -0
- package/cjs/theme/ThemeDefaultOptions.js.map +7 -0
- package/cjs/theme/ThemeProvider.js +2 -0
- package/cjs/theme/ThemeProvider.js.map +7 -0
- package/cjs/theme/core.js +2 -0
- package/cjs/theme/core.js.map +7 -0
- package/cjs/theme/createColor.js +2 -0
- package/cjs/theme/createColor.js.map +7 -0
- package/cjs/theme/createTheme.js +2 -0
- package/cjs/theme/createTheme.js.map +7 -0
- package/cjs/theme/createThemeSwitcher.js +2 -0
- package/cjs/theme/createThemeSwitcher.js.map +7 -0
- package/cjs/theme/index.js +2 -0
- package/cjs/theme/index.js.map +7 -0
- package/cjs/theme/types.js +2 -0
- package/cjs/theme/types.js.map +7 -0
- package/cjs/useAnimation.js +2 -0
- package/cjs/useAnimation.js.map +7 -0
- package/cjs/useColorTemplate.js +2 -0
- package/cjs/useColorTemplate.js.map +7 -0
- package/cjs/useInterface.js +2 -0
- package/cjs/useInterface.js.map +7 -0
- package/css/aliases.d.ts +4 -0
- package/css/aliases.js +2 -0
- package/css/aliases.js.map +7 -0
- package/css/getProps.d.ts +3 -0
- package/css/getProps.js +2 -0
- package/css/getProps.js.map +7 -0
- package/css/getValue.d.ts +3 -0
- package/css/getValue.js +2 -0
- package/css/getValue.js.map +7 -0
- package/css/index.d.ts +15 -0
- package/css/index.js +2 -0
- package/css/index.js.map +7 -0
- package/{src/css/types.ts → css/types.d.ts} +16 -22
- package/css/types.js +1 -0
- package/css/types.js.map +7 -0
- package/index.d.ts +21 -0
- package/index.js +2 -0
- package/index.js.map +7 -0
- package/isWindow.d.ts +2 -0
- package/isWindow.js +2 -0
- package/isWindow.js.map +7 -0
- package/package.json +43 -49
- package/theme/ThemeCssVars.d.ts +3 -0
- package/theme/ThemeCssVars.js +2 -0
- package/theme/ThemeCssVars.js.map +7 -0
- package/theme/ThemeDefaultOptions.d.ts +68 -0
- package/theme/ThemeDefaultOptions.js +2 -0
- package/theme/ThemeDefaultOptions.js.map +7 -0
- package/theme/ThemeProvider.d.ts +11 -0
- package/theme/ThemeProvider.js +2 -0
- package/theme/ThemeProvider.js.map +7 -0
- package/theme/core.d.ts +7 -0
- package/theme/core.js +2 -0
- package/theme/core.js.map +7 -0
- package/theme/createColor.d.ts +41 -0
- package/theme/createColor.js +2 -0
- package/theme/createColor.js.map +7 -0
- package/theme/createTheme.d.ts +2 -0
- package/theme/createTheme.js +2 -0
- package/theme/createTheme.js.map +7 -0
- package/theme/createThemeSwitcher.d.ts +6 -0
- package/theme/createThemeSwitcher.js +2 -0
- package/theme/createThemeSwitcher.js.map +7 -0
- package/theme/index.d.ts +5 -0
- package/theme/index.js +2 -0
- package/theme/index.js.map +7 -0
- package/{src/theme/types.ts → theme/types.d.ts} +46 -103
- package/theme/types.js +1 -0
- package/theme/types.js.map +7 -0
- package/useAnimation.d.ts +18 -0
- package/useAnimation.js +2 -0
- package/useAnimation.js.map +7 -0
- package/useColorTemplate.d.ts +4 -0
- package/useColorTemplate.js +2 -0
- package/useColorTemplate.js.map +7 -0
- package/useInterface.d.ts +2 -0
- package/useInterface.js +2 -0
- package/useInterface.js.map +7 -0
- package/main.tsx +0 -97
- package/src/ServerStyleTags.tsx +0 -12
- package/src/Tag/cssPropList.ts +0 -191
- package/src/Tag/index.tsx +0 -11
- package/src/Tag/useTagProps.ts +0 -28
- package/src/Transition/index.tsx +0 -148
- package/src/Transition/variants.ts +0 -178
- package/src/breakpoint/index.tsx +0 -52
- package/src/breakpoint/useBreakpoint.ts +0 -31
- package/src/breakpoint/useBreakpointProps.ts +0 -57
- package/src/css/aliases.ts +0 -35
- package/src/css/getProps.ts +0 -38
- package/src/css/getValue.ts +0 -117
- package/src/css/index.ts +0 -78
- package/src/index.ts +0 -34
- package/src/isWindow.ts +0 -3
- package/src/theme/ThemeCssVars.ts +0 -107
- package/src/theme/ThemeDefaultOptions.ts +0 -146
- package/src/theme/ThemeProvider.tsx +0 -140
- package/src/theme/core.ts +0 -21
- package/src/theme/createColor.ts +0 -53
- package/src/theme/createTheme.ts +0 -33
- package/src/theme/createThemeSwitcher.ts +0 -18
- package/src/theme/index.tsx +0 -17
- package/src/useAnimation.ts +0 -40
- package/src/useColorTemplate.ts +0 -11
- package/src/useInterface.ts +0 -13
- package/tsconfig.json +0 -28
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/theme/core.ts"],
|
|
4
|
+
"sourcesContent": ["import React from \"react\"\nimport { ObjectType, ThemeOptions } from \"./types\"\n\nexport const ThemeFactory = new Map<string, ThemeOptions>()\nexport const ThemeContex = React.createContext(\"light\")\nexport const getTheme = (theme: string) => ThemeFactory.get(theme)\nexport const useTheme = (): ThemeOptions => ThemeFactory.get(React.useContext(ThemeContex)) as any\n\nexport const mergeObject = (a: ObjectType, b: ObjectType) => {\n a = { ...a }\n b = { ...b }\n for (const key in b) {\n const v = (b as any)[key]\n if (typeof v === 'object' && !Array.isArray(v) && !React.isValidElement(v)) {\n a[key] = mergeObject(a[key], b[key])\n } else {\n a[key] = v\n }\n }\n return a\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAOA,MAAW,QAGX,MAAMC,EAAe,IAAI,IACnBC,EAAcF,EAAM,cAAc,OAAO,EACzCG,EAAYC,GAAkBH,EAAa,IAAIG,CAAK,EACpDC,EAAW,IAAoBJ,EAAa,IAAID,EAAM,WAAWE,CAAW,CAAC,EAE7EI,EAAc,CAACC,EAAeC,IAAkB,CAC1DD,EAAI,CAAE,GAAGA,CAAE,EACXC,EAAI,CAAE,GAAGA,CAAE,EACX,UAAWC,KAAOD,EAAG,CAClB,MAAME,EAAKF,EAAUC,CAAG,EACpB,OAAOC,GAAM,UAAY,CAAC,MAAM,QAAQA,CAAC,GAAK,CAACV,EAAM,eAAeU,CAAC,EACtEH,EAAEE,CAAG,EAAIH,EAAYC,EAAEE,CAAG,EAAGD,EAAEC,CAAG,CAAC,EAEnCF,EAAEE,CAAG,EAAIC,CAEf,CACA,OAAOH,CACV",
|
|
6
|
+
"names": ["React", "ThemeFactory", "ThemeContex", "getTheme", "theme", "useTheme", "mergeObject", "a", "b", "key", "v"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ThemeOptions, ThemeColor } from "./types";
|
|
2
|
+
declare const createColor: (theme: ThemeOptions, name: keyof ThemeColor) => {
|
|
3
|
+
alpha: string;
|
|
4
|
+
template: {
|
|
5
|
+
outline: {
|
|
6
|
+
bgcolor: string;
|
|
7
|
+
color: any;
|
|
8
|
+
border: number;
|
|
9
|
+
borderColor: any;
|
|
10
|
+
hover: {
|
|
11
|
+
color: any;
|
|
12
|
+
borderColor: any;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
fill: {
|
|
16
|
+
bgcolor: any;
|
|
17
|
+
color: any;
|
|
18
|
+
hover: {
|
|
19
|
+
bgcolor: any;
|
|
20
|
+
color: any;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
text: {
|
|
24
|
+
bgcolor: string;
|
|
25
|
+
color: any;
|
|
26
|
+
hover: {
|
|
27
|
+
bgcolor: any;
|
|
28
|
+
color: any;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
alpha: {
|
|
32
|
+
bgcolor: any;
|
|
33
|
+
color: any;
|
|
34
|
+
hover: {
|
|
35
|
+
bgcolor: any;
|
|
36
|
+
color: any;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export default createColor;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{alpha as l}from"../css";const b=(a,c)=>{let n=a.colors[c],{primary:o,secondary:t}=n,e=n.text||a.colors.text.primary,p=l(o,.1);const r=(i,s)=>c==="background"?i:s;return{alpha:p,template:{outline:{bgcolor:"transparent",color:r(e,o),border:1,borderColor:r("divider",l(o,.4)),hover:{color:r(e,o),borderColor:r("divider",l(o,.8))}},fill:{bgcolor:r(t,o),color:e,hover:{bgcolor:r(l(t,.6),t),color:e}},text:{bgcolor:"transparent",color:r(e,o),hover:{bgcolor:r(l(t,.6),l(o,.1)),color:r(e,o)}},alpha:{bgcolor:r(l(t,.5),l(o,.1)),color:r(e,o),hover:{bgcolor:r(l(t,.8),l(o,.15)),color:r(e,o)}}}}};var y=b;export{y as default};
|
|
2
|
+
//# sourceMappingURL=createColor.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/theme/createColor.ts"],
|
|
4
|
+
"sourcesContent": ["import { ThemeOptions, ThemeColor } from \"./types\"\nimport { alpha } from \"../css\"\n\nconst createColor = (theme: ThemeOptions, name: keyof ThemeColor) => {\n let color = theme.colors[name]\n let { primary, secondary } = color as any\n let text = (color as any).text || theme.colors.text.primary\n let _alpha = alpha(primary, .1)\n\n const isBag = (a: any, b: any) => name === \"background\" ? a : b\n\n return {\n alpha: _alpha,\n template: {\n outline: {\n bgcolor: \"transparent\",\n color: isBag(text, primary),\n border: 1,\n borderColor: isBag(\"divider\", alpha(primary, .4)),\n hover: {\n color: isBag(text, primary),\n borderColor: isBag(\"divider\", alpha(primary, .8)),\n }\n },\n fill: {\n bgcolor: isBag(secondary, primary),\n color: text,\n hover: {\n bgcolor: isBag(alpha(secondary, .6), secondary),\n color: text,\n }\n },\n text: {\n bgcolor: \"transparent\",\n color: isBag(text, primary),\n hover: {\n bgcolor: isBag(alpha(secondary, .6), alpha(primary, .1)),\n color: isBag(text, primary),\n }\n },\n alpha: {\n bgcolor: isBag(alpha(secondary, .5), alpha(primary, .1)),\n color: isBag(text, primary),\n hover: {\n bgcolor: isBag(alpha(secondary, .8), alpha(primary, .15)),\n color: isBag(text, primary),\n }\n }\n }\n }\n}\n\nexport default createColor"],
|
|
5
|
+
"mappings": "AACA,OAAS,SAAAA,MAAa,SAEtB,MAAMC,EAAc,CAACC,EAAqBC,IAA2B,CAClE,IAAIC,EAAQF,EAAM,OAAOC,CAAI,EACzB,CAAE,QAAAE,EAAS,UAAAC,CAAU,EAAIF,EACzBG,EAAQH,EAAc,MAAQF,EAAM,OAAO,KAAK,QAChDM,EAASR,EAAMK,EAAS,EAAE,EAE9B,MAAMI,EAAQ,CAACC,EAAQC,IAAWR,IAAS,aAAeO,EAAIC,EAE9D,MAAO,CACJ,MAAOH,EACP,SAAU,CACP,QAAS,CACN,QAAS,cACT,MAAOC,EAAMF,EAAMF,CAAO,EAC1B,OAAQ,EACR,YAAaI,EAAM,UAAWT,EAAMK,EAAS,EAAE,CAAC,EAChD,MAAO,CACJ,MAAOI,EAAMF,EAAMF,CAAO,EAC1B,YAAaI,EAAM,UAAWT,EAAMK,EAAS,EAAE,CAAC,CACnD,CACH,EACA,KAAM,CACH,QAASI,EAAMH,EAAWD,CAAO,EACjC,MAAOE,EACP,MAAO,CACJ,QAASE,EAAMT,EAAMM,EAAW,EAAE,EAAGA,CAAS,EAC9C,MAAOC,CACV,CACH,EACA,KAAM,CACH,QAAS,cACT,MAAOE,EAAMF,EAAMF,CAAO,EAC1B,MAAO,CACJ,QAASI,EAAMT,EAAMM,EAAW,EAAE,EAAGN,EAAMK,EAAS,EAAE,CAAC,EACvD,MAAOI,EAAMF,EAAMF,CAAO,CAC7B,CACH,EACA,MAAO,CACJ,QAASI,EAAMT,EAAMM,EAAW,EAAE,EAAGN,EAAMK,EAAS,EAAE,CAAC,EACvD,MAAOI,EAAMF,EAAMF,CAAO,EAC1B,MAAO,CACJ,QAASI,EAAMT,EAAMM,EAAW,EAAE,EAAGN,EAAMK,EAAS,GAAG,CAAC,EACxD,MAAOI,EAAMF,EAAMF,CAAO,CAC7B,CACH,CACH,CACH,CACH,EAEA,IAAOO,EAAQX",
|
|
6
|
+
"names": ["alpha", "createColor", "theme", "name", "color", "primary", "secondary", "text", "_alpha", "isBag", "a", "b", "createColor_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import s,{darkColorPallete as m}from"./ThemeDefaultOptions";import{mergeObject as n,ThemeFactory as t}from"./core";import r from"./createColor";import{breakpoints as c}from"../css";const u=(o,a,i)=>{if(t.has(o))throw new Error(`theme "${o}" already exists!`);{let e=n(s,{...i?m:{},...a,name:o,breakpoints:c});e=n(e,{colors:{background:r(e,"background"),brand:r(e,"brand"),accent:r(e,"accent"),info:r(e,"info"),success:r(e,"success"),warning:r(e,"warning"),danger:r(e,"danger")}}),t.set(o,e)}return t.get(o)};export{u as createTheme};
|
|
2
|
+
//# sourceMappingURL=createTheme.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/theme/createTheme.ts"],
|
|
4
|
+
"sourcesContent": ["import { ThemeOptions, ThemeOptionInput } from \"./types\"\nimport defaultThemeOption, { darkColorPallete } from './ThemeDefaultOptions'\nimport { mergeObject, ThemeFactory } from \"./core\"\nimport createColor from \"./createColor\"\nimport { breakpoints } from \"../css\"\n\nexport const createTheme = (name: string, options: ThemeOptionInput, darkMode?: boolean): ThemeOptions => {\n if (!ThemeFactory.has(name)) {\n let theme: any = mergeObject(defaultThemeOption, {\n ...(darkMode ? darkColorPallete : {}),\n ...options,\n name,\n breakpoints: breakpoints\n })\n\n theme = mergeObject(theme, {\n colors: {\n background: createColor(theme, \"background\"),\n brand: createColor(theme, \"brand\"),\n accent: createColor(theme, \"accent\"),\n info: createColor(theme, \"info\"),\n success: createColor(theme, \"success\"),\n warning: createColor(theme, \"warning\"),\n danger: createColor(theme, \"danger\")\n }\n })\n ThemeFactory.set(name, theme)\n } else {\n throw new Error(`theme \"${name}\" already exists!`);\n }\n\n return ThemeFactory.get(name) as ThemeOptions\n}\n"],
|
|
5
|
+
"mappings": "AACA,OAAOA,GAAsB,oBAAAC,MAAwB,wBACrD,OAAS,eAAAC,EAAa,gBAAAC,MAAoB,SAC1C,OAAOC,MAAiB,gBACxB,OAAS,eAAAC,MAAmB,SAErB,MAAMC,EAAc,CAACC,EAAcC,EAA2BC,IAAqC,CACvG,GAAKN,EAAa,IAAII,CAAI,EAqBvB,MAAM,IAAI,MAAM,UAAUA,CAAI,mBAAmB,EArBvB,CAC1B,IAAIG,EAAaR,EAAYF,EAAoB,CAC9C,GAAIS,EAAWR,EAAmB,CAAC,EACnC,GAAGO,EACH,KAAAD,EACA,YAAaF,CAChB,CAAC,EAEDK,EAAQR,EAAYQ,EAAO,CACxB,OAAQ,CACL,WAAYN,EAAYM,EAAO,YAAY,EAC3C,MAAON,EAAYM,EAAO,OAAO,EACjC,OAAQN,EAAYM,EAAO,QAAQ,EACnC,KAAMN,EAAYM,EAAO,MAAM,EAC/B,QAASN,EAAYM,EAAO,SAAS,EACrC,QAASN,EAAYM,EAAO,SAAS,EACrC,OAAQN,EAAYM,EAAO,QAAQ,CACtC,CACH,CAAC,EACDP,EAAa,IAAII,EAAMG,CAAK,CAC/B,CAIA,OAAOP,EAAa,IAAII,CAAI,CAC/B",
|
|
6
|
+
"names": ["defaultThemeOption", "darkColorPallete", "mergeObject", "ThemeFactory", "createColor", "breakpoints", "createTheme", "name", "options", "darkMode", "theme"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createBucket as s}from"react-state-bucket";import{getTheme as a}from"./core";const c=(t,r)=>{const m=s({name:t},{store:r});return()=>{const e=m();return{name:e.get("name"),theme:a(e.get("name")),change:n=>e.set("name",n)}}};var u=c;export{u as default};
|
|
2
|
+
//# sourceMappingURL=createThemeSwitcher.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/theme/createThemeSwitcher.ts"],
|
|
4
|
+
"sourcesContent": ["import { createBucket } from \"react-state-bucket\"\nimport { getTheme } from \"./core\"\n\nconst createThemeSwitcher = (defaultTheme: string, store?: \"session\" | \"local\") => {\n const useThemeState = createBucket({ name: defaultTheme }, { store })\n const useThemeSwitcher = () => {\n const state = useThemeState()\n return {\n name: state.get(\"name\"),\n theme: getTheme(state.get(\"name\")),\n change: (theme: string) => state.set(\"name\", theme)\n }\n }\n return useThemeSwitcher\n}\n\n\nexport default createThemeSwitcher"],
|
|
5
|
+
"mappings": "AAAA,OAAS,gBAAAA,MAAoB,qBAC7B,OAAS,YAAAC,MAAgB,SAEzB,MAAMC,EAAsB,CAACC,EAAsBC,IAAgC,CAChF,MAAMC,EAAgBL,EAAa,CAAE,KAAMG,CAAa,EAAG,CAAE,MAAAC,CAAM,CAAC,EASpE,MARyB,IAAM,CAC5B,MAAME,EAAQD,EAAc,EAC5B,MAAO,CACJ,KAAMC,EAAM,IAAI,MAAM,EACtB,MAAOL,EAASK,EAAM,IAAI,MAAM,CAAC,EACjC,OAASC,GAAkBD,EAAM,IAAI,OAAQC,CAAK,CACrD,CACH,CAEH,EAGA,IAAOC,EAAQN",
|
|
6
|
+
"names": ["createBucket", "getTheme", "createThemeSwitcher", "defaultTheme", "store", "useThemeState", "state", "theme", "createThemeSwitcher_default"]
|
|
7
|
+
}
|
package/theme/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import ThemeProvider from './ThemeProvider';
|
|
2
|
+
import createThemeSwitcher from './createThemeSwitcher';
|
|
3
|
+
import { getTheme, useTheme } from './core';
|
|
4
|
+
export type { ThemeProviderProps } from './ThemeProvider';
|
|
5
|
+
export { ThemeProvider, createThemeSwitcher, getTheme, useTheme };
|
package/theme/index.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{lightColorPallete as r,darkColorPallete as o}from"./ThemeDefaultOptions";import{createTheme as e}from"./createTheme";import m from"./ThemeProvider";import t from"./createThemeSwitcher";import{getTheme as i,useTheme as h}from"./core";e("light",{colors:r}),e("dark",{colors:o});export{m as ThemeProvider,t as createThemeSwitcher,i as getTheme,h as useTheme};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/theme/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { lightColorPallete, darkColorPallete } from './ThemeDefaultOptions'\nimport { createTheme } from \"./createTheme\"\nimport ThemeProvider from './ThemeProvider'\nimport createThemeSwitcher from './createThemeSwitcher'\nimport { getTheme, useTheme } from './core'\nexport type { ThemeProviderProps } from './ThemeProvider'\n\nexport {\n ThemeProvider,\n createThemeSwitcher,\n getTheme,\n useTheme\n}\n\ncreateTheme(\"light\", { colors: lightColorPallete })\ncreateTheme(\"dark\", { colors: darkColorPallete })\n\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,qBAAAA,EAAmB,oBAAAC,MAAwB,wBACpD,OAAS,eAAAC,MAAmB,gBAC5B,OAAOC,MAAmB,kBAC1B,OAAOC,MAAyB,wBAChC,OAAS,YAAAC,EAAU,YAAAC,MAAgB,SAUnCJ,EAAY,QAAS,CAAE,OAAQF,CAAkB,CAAC,EAClDE,EAAY,OAAQ,CAAE,OAAQD,CAAiB,CAAC",
|
|
6
|
+
"names": ["lightColorPallete", "darkColorPallete", "createTheme", "ThemeProvider", "createThemeSwitcher", "getTheme", "useTheme"]
|
|
7
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BreakpointKeys, GlobalCSS } from "../css/types";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
export type ObjectType = {
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
};
|
|
5
5
|
export type ThemeColorItem = {
|
|
6
6
|
primary: string;
|
|
7
7
|
secondary: string;
|
|
@@ -14,57 +14,54 @@ export type ThemeColorItem = {
|
|
|
14
14
|
border: number;
|
|
15
15
|
borderColor: string;
|
|
16
16
|
hover: {
|
|
17
|
-
bgcolor: string
|
|
18
|
-
color: string
|
|
19
|
-
}
|
|
20
|
-
}
|
|
17
|
+
bgcolor: string;
|
|
18
|
+
color: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
21
|
fill: {
|
|
22
22
|
bgcolor: string;
|
|
23
|
-
color: string
|
|
23
|
+
color: string;
|
|
24
24
|
hover: {
|
|
25
25
|
bgcolor: string;
|
|
26
26
|
color: string;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
29
|
text: {
|
|
30
30
|
bgcolor: string;
|
|
31
31
|
color: string;
|
|
32
32
|
hover: {
|
|
33
33
|
bgcolor: string;
|
|
34
34
|
color: string;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
37
|
alpha: {
|
|
38
|
-
bgcolor: string
|
|
38
|
+
bgcolor: string;
|
|
39
39
|
color: string;
|
|
40
40
|
hover: {
|
|
41
41
|
bgcolor: string;
|
|
42
42
|
color: string;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
};
|
|
48
47
|
export type ThemeTypographyItem = {
|
|
49
48
|
fontSize: number;
|
|
50
49
|
lineHeight: number;
|
|
51
50
|
fontWeight: number;
|
|
52
|
-
}
|
|
53
|
-
|
|
51
|
+
};
|
|
54
52
|
export type ThemeColor = {
|
|
55
53
|
background: Omit<ThemeColorItem, "text">;
|
|
56
54
|
text: Omit<ThemeColorItem, "text" | "alpha" | "template">;
|
|
57
55
|
divider: string;
|
|
58
56
|
brand: ThemeColorItem;
|
|
59
57
|
accent: ThemeColorItem;
|
|
60
|
-
success: ThemeColorItem
|
|
61
|
-
info: ThemeColorItem
|
|
62
|
-
warning: ThemeColorItem
|
|
63
|
-
danger: ThemeColorItem
|
|
58
|
+
success: ThemeColorItem;
|
|
59
|
+
info: ThemeColorItem;
|
|
60
|
+
warning: ThemeColorItem;
|
|
61
|
+
danger: ThemeColorItem;
|
|
64
62
|
};
|
|
65
|
-
|
|
66
63
|
export type ThemeTypographyType = {
|
|
67
|
-
fontFamily: string
|
|
64
|
+
fontFamily: string;
|
|
68
65
|
h1: ThemeTypographyItem;
|
|
69
66
|
h2: ThemeTypographyItem;
|
|
70
67
|
h3: ThemeTypographyItem;
|
|
@@ -74,35 +71,36 @@ export type ThemeTypographyType = {
|
|
|
74
71
|
text: ThemeTypographyItem;
|
|
75
72
|
button: ThemeTypographyItem;
|
|
76
73
|
small: ThemeTypographyItem;
|
|
77
|
-
}
|
|
78
|
-
|
|
74
|
+
};
|
|
79
75
|
export interface ThemeOptions {
|
|
80
76
|
name: string;
|
|
81
77
|
rtl: boolean;
|
|
82
|
-
globalStyle: GlobalCSS
|
|
83
|
-
breakpoints: {
|
|
78
|
+
globalStyle: GlobalCSS;
|
|
79
|
+
breakpoints: {
|
|
80
|
+
[key in BreakpointKeys]: number;
|
|
81
|
+
};
|
|
84
82
|
shadow: string[];
|
|
85
|
-
interfaces: {
|
|
83
|
+
interfaces: {
|
|
84
|
+
[name: string]: <P extends object>(defaultProps: P, theme: ThemeOptions) => P;
|
|
85
|
+
};
|
|
86
86
|
colors: ThemeColor;
|
|
87
87
|
typography: ThemeTypographyType;
|
|
88
88
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
export type ThemeColorItemInput = Partial<Omit<ThemeColorItem, "alpha">>
|
|
92
|
-
export type ThemeTypographyItemInput = Partial<ThemeTypographyItem>
|
|
89
|
+
export type ThemeColorItemInput = Partial<Omit<ThemeColorItem, "alpha">>;
|
|
90
|
+
export type ThemeTypographyItemInput = Partial<ThemeTypographyItem>;
|
|
93
91
|
export type ThemeColorInput = {
|
|
94
|
-
background?: Omit<ThemeColorItemInput, "text"
|
|
95
|
-
text?: Omit<ThemeColorItemInput, "text"
|
|
92
|
+
background?: Omit<ThemeColorItemInput, "text">;
|
|
93
|
+
text?: Omit<ThemeColorItemInput, "text">;
|
|
96
94
|
divider?: string;
|
|
97
95
|
brand?: ThemeColorItemInput;
|
|
98
96
|
accent?: ThemeColorItemInput;
|
|
99
|
-
success?: ThemeColorItemInput
|
|
100
|
-
info?: ThemeColorItemInput
|
|
101
|
-
warning?: ThemeColorItemInput
|
|
102
|
-
danger?: ThemeColorItemInput
|
|
97
|
+
success?: ThemeColorItemInput;
|
|
98
|
+
info?: ThemeColorItemInput;
|
|
99
|
+
warning?: ThemeColorItemInput;
|
|
100
|
+
danger?: ThemeColorItemInput;
|
|
103
101
|
};
|
|
104
102
|
export type ThemeTypographyInputType = {
|
|
105
|
-
fontFamily?: string
|
|
103
|
+
fontFamily?: string;
|
|
106
104
|
h1?: ThemeTypographyItemInput;
|
|
107
105
|
h2?: ThemeTypographyItemInput;
|
|
108
106
|
h3?: ThemeTypographyItemInput;
|
|
@@ -115,67 +113,12 @@ export type ThemeTypographyInputType = {
|
|
|
115
113
|
};
|
|
116
114
|
export interface ThemeOptionInput {
|
|
117
115
|
rtl?: boolean;
|
|
118
|
-
globalStyle?: GlobalCSS
|
|
119
|
-
interfaces?: {
|
|
116
|
+
globalStyle?: GlobalCSS;
|
|
117
|
+
interfaces?: {
|
|
118
|
+
[name: string]: <P extends object>(defaultProps: P, theme: ThemeOptions) => P;
|
|
119
|
+
};
|
|
120
120
|
colors?: ThemeColorInput;
|
|
121
121
|
typography?: ThemeTypographyInputType;
|
|
122
122
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
export type TypographyRefTypes =
|
|
127
|
-
| "h1"
|
|
128
|
-
| "h2"
|
|
129
|
-
| "h3"
|
|
130
|
-
| "h4"
|
|
131
|
-
| "h5"
|
|
132
|
-
| "h6"
|
|
133
|
-
| "text"
|
|
134
|
-
| "button"
|
|
135
|
-
| "small"
|
|
136
|
-
|
|
137
|
-
export type ColorsRefTypes =
|
|
138
|
-
| "text"
|
|
139
|
-
| "text.primary"
|
|
140
|
-
| "text.secondary"
|
|
141
|
-
|
|
142
|
-
| "background"
|
|
143
|
-
| "background.primary"
|
|
144
|
-
| "background.secondary"
|
|
145
|
-
| "background.alpha"
|
|
146
|
-
|
|
147
|
-
| "brand"
|
|
148
|
-
| "brand.primary"
|
|
149
|
-
| "brand.secondary"
|
|
150
|
-
| "brand.alpha"
|
|
151
|
-
| "brand.text"
|
|
152
|
-
|
|
153
|
-
| "accent"
|
|
154
|
-
| "accent.primary"
|
|
155
|
-
| "accent.secondary"
|
|
156
|
-
| "accent.alpha"
|
|
157
|
-
| "accent.text"
|
|
158
|
-
|
|
159
|
-
| "info"
|
|
160
|
-
| "info.primary"
|
|
161
|
-
| "info.secondary"
|
|
162
|
-
| "info.alpha"
|
|
163
|
-
| "info.text"
|
|
164
|
-
|
|
165
|
-
| "success"
|
|
166
|
-
| "success.primary"
|
|
167
|
-
| "success.secondary"
|
|
168
|
-
| "success.alpha"
|
|
169
|
-
| "success.text"
|
|
170
|
-
|
|
171
|
-
| "warning"
|
|
172
|
-
| "warning.primary"
|
|
173
|
-
| "warning.secondary"
|
|
174
|
-
| "warning.alpha"
|
|
175
|
-
| "warning.text"
|
|
176
|
-
|
|
177
|
-
| "danger"
|
|
178
|
-
| "danger.primary"
|
|
179
|
-
| "danger.secondary"
|
|
180
|
-
| "danger.alpha"
|
|
181
|
-
| "danger.text"
|
|
123
|
+
export type TypographyRefTypes = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "text" | "button" | "small";
|
|
124
|
+
export type ColorsRefTypes = "text" | "text.primary" | "text.secondary" | "background" | "background.primary" | "background.secondary" | "background.alpha" | "brand" | "brand.primary" | "brand.secondary" | "brand.alpha" | "brand.text" | "accent" | "accent.primary" | "accent.secondary" | "accent.alpha" | "accent.text" | "info" | "info.primary" | "info.secondary" | "info.alpha" | "info.text" | "success" | "success.primary" | "success.secondary" | "success.alpha" | "success.text" | "warning" | "warning.primary" | "warning.secondary" | "warning.alpha" | "warning.text" | "danger" | "danger.primary" | "danger.secondary" | "danger.alpha" | "danger.text";
|
package/theme/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { CSSProps } from './css/types';
|
|
2
|
+
export declare const animationEases: {
|
|
3
|
+
easeInOut: string;
|
|
4
|
+
easeOut: string;
|
|
5
|
+
easeIn: string;
|
|
6
|
+
sharp: string;
|
|
7
|
+
linear: string;
|
|
8
|
+
easeBounceOut: string;
|
|
9
|
+
};
|
|
10
|
+
export interface UseAnimationProps {
|
|
11
|
+
delay?: number;
|
|
12
|
+
duration?: number;
|
|
13
|
+
from: CSSProps;
|
|
14
|
+
to: CSSProps;
|
|
15
|
+
ease?: keyof typeof animationEases;
|
|
16
|
+
}
|
|
17
|
+
declare const useAnimation: ({ from, to, delay, ease, duration }: UseAnimationProps) => string;
|
|
18
|
+
export default useAnimation;
|
package/useAnimation.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{css as u}from"./css";import{useId as b}from"react";const a={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)",linear:"cubic-bezier(0, 0, 1, 1)",easeBounceOut:"cubic-bezier(0.68, -0.55, 0.265, 1.55)"},p=({from:i,to:n,delay:o,ease:t,duration:s})=>{let r=o||0,m=s||600,c=t||"easeBounceOut";const e="anim"+b().replace(/:/g,"");return u({animationName:e,animationDelay:r+"ms",animationDuration:m+"ms",animationTimingFunction:a[c]||a.easeBounceOut,[`@keyframes ${e}`]:{from:i,to:n}}).classname};var S=p;export{a as animationEases,S as default};
|
|
2
|
+
//# sourceMappingURL=useAnimation.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/useAnimation.ts"],
|
|
4
|
+
"sourcesContent": ["import { css } from './css'\nimport { useId } from 'react'\nimport { CSSProps } from './css/types'\n\nexport const animationEases = {\n easeInOut: \"cubic-bezier(0.4, 0, 0.2, 1)\",\n easeOut: \"cubic-bezier(0.0, 0, 0.2, 1)\",\n easeIn: \"cubic-bezier(0.4, 0, 1, 1)\",\n sharp: \"cubic-bezier(0.4, 0, 0.6, 1)\",\n linear: \"cubic-bezier(0, 0, 1, 1)\",\n easeBounceOut: \"cubic-bezier(0.68, -0.55, 0.265, 1.55)\"\n}\n\nexport interface UseAnimationProps {\n delay?: number;\n duration?: number;\n from: CSSProps;\n to: CSSProps;\n ease?: keyof typeof animationEases;\n}\n\nconst useAnimation = ({ from, to, delay, ease, duration }: UseAnimationProps) => {\n let _delay = delay || 0;\n let _duration = duration || 600;\n let _ease = ease || \"easeBounceOut\"\n const id = \"anim\" + useId().replace(/:/g, \"\")\n const anim = css({\n animationName: id,\n animationDelay: _delay + \"ms\",\n animationDuration: _duration + \"ms\",\n animationTimingFunction: animationEases[_ease] || animationEases.easeBounceOut,\n [`@keyframes ${id}`]: {\n from: from as any,\n to: to as any\n }\n })\n return anim.classname\n}\n\nexport default useAnimation"],
|
|
5
|
+
"mappings": "AAAA,OAAS,OAAAA,MAAW,QACpB,OAAS,SAAAC,MAAa,QAGf,MAAMC,EAAiB,CAC1B,UAAW,+BACX,QAAS,+BACT,OAAQ,6BACR,MAAO,+BACP,OAAQ,2BACR,cAAe,wCACnB,EAUMC,EAAe,CAAC,CAAE,KAAAC,EAAM,GAAAC,EAAI,MAAAC,EAAO,KAAAC,EAAM,SAAAC,CAAS,IAAyB,CAC7E,IAAIC,EAASH,GAAS,EAClBI,EAAYF,GAAY,IACxBG,EAAQJ,GAAQ,gBACpB,MAAMK,EAAK,OAASX,EAAM,EAAE,QAAQ,KAAM,EAAE,EAW5C,OAVaD,EAAI,CACb,cAAeY,EACf,eAAgBH,EAAS,KACzB,kBAAmBC,EAAY,KAC/B,wBAAyBR,EAAeS,CAAK,GAAKT,EAAe,cACjE,CAAC,cAAcU,CAAE,EAAE,EAAG,CAClB,KAAMR,EACN,GAAIC,CACR,CACJ,CAAC,EACW,SAChB,EAEA,IAAOQ,EAAQV",
|
|
6
|
+
"names": ["css", "useId", "animationEases", "useAnimation", "from", "to", "delay", "ease", "duration", "_delay", "_duration", "_ease", "id", "useAnimation_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type ColorTemplateColors = "default" | "brand" | "accent" | "info" | "success" | "warning" | "danger";
|
|
2
|
+
export type ColorTemplateType = "fill" | "outline" | "text" | "alpha";
|
|
3
|
+
declare const useColorTemplate: (color: ColorTemplateColors, type: ColorTemplateType) => any;
|
|
4
|
+
export default useColorTemplate;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/useColorTemplate.ts"],
|
|
4
|
+
"sourcesContent": ["import { useTheme } from \"./theme\"\nexport type ColorTemplateColors = \"default\" | \"brand\" | \"accent\" | \"info\" | \"success\" | \"warning\" | \"danger\"\nexport type ColorTemplateType = \"fill\" | \"outline\" | \"text\" | \"alpha\"\n\nconst useColorTemplate = (color: ColorTemplateColors, type: ColorTemplateType) => {\n const theme: any = useTheme()\n let _color = color === 'default' ? \"background\" : color as any\n return theme.colors[_color]?.template[type]\n}\n\nexport default useColorTemplate"],
|
|
5
|
+
"mappings": "AAAA,OAAS,YAAAA,MAAgB,UAIzB,MAAMC,EAAmB,CAACC,EAA4BC,IAA4B,CAC9E,MAAMC,EAAaJ,EAAS,EAC5B,IAAIK,EAASH,IAAU,UAAY,aAAeA,EAClD,OAAOE,EAAM,OAAOC,CAAM,GAAG,SAASF,CAAI,CAC9C,EAEA,IAAOG,EAAQL",
|
|
6
|
+
"names": ["useTheme", "useColorTemplate", "color", "type", "theme", "_color", "useColorTemplate_default"]
|
|
7
|
+
}
|
package/useInterface.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/useInterface.ts"],
|
|
4
|
+
"sourcesContent": ["import { useTheme } from \"./theme\"\n\nconst useInterface = <P extends object>(name: string, userPorps: P, defaultProps: P) => {\n const theme = useTheme()\n const _interface = theme.interfaces[name]\n\n if (_interface) {\n defaultProps = _interface<P>({ ...defaultProps, ...userPorps }, theme)\n }\n return [{ ...defaultProps, ...userPorps }, theme]\n}\n\nexport default useInterface"],
|
|
5
|
+
"mappings": "AAAA,OAAS,YAAAA,MAAgB,UAEzB,MAAMC,EAAe,CAAmBC,EAAcC,EAAcC,IAAoB,CACpF,MAAMC,EAAQL,EAAS,EACjBM,EAAaD,EAAM,WAAWH,CAAI,EAExC,OAAII,IACAF,EAAeE,EAAc,CAAE,GAAGF,EAAc,GAAGD,CAAU,EAAGE,CAAK,GAElE,CAAC,CAAE,GAAGD,EAAc,GAAGD,CAAU,EAAGE,CAAK,CACpD,EAEA,IAAOE,EAAQN",
|
|
6
|
+
"names": ["useTheme", "useInterface", "name", "userPorps", "defaultProps", "theme", "_interface", "useInterface_default"]
|
|
7
|
+
}
|
package/main.tsx
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { createRoot } from 'react-dom/client';
|
|
3
|
-
import { createThemeSwitcher, ThemeProvider, useTheme } from './src/theme'
|
|
4
|
-
import { Tag, Transition } from './src';
|
|
5
|
-
|
|
6
|
-
const useThemeSwitcher = createThemeSwitcher("light")
|
|
7
|
-
|
|
8
|
-
const ThemeBox = () => {
|
|
9
|
-
const themeSwitcher = useThemeSwitcher()
|
|
10
|
-
return (
|
|
11
|
-
<button
|
|
12
|
-
onClick={() => {
|
|
13
|
-
themeSwitcher.change(themeSwitcher.name === 'light' ? "dark" : "light")
|
|
14
|
-
}}
|
|
15
|
-
>
|
|
16
|
-
change
|
|
17
|
-
</button>
|
|
18
|
-
)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const Trans = () => {
|
|
22
|
-
const theme = useTheme()
|
|
23
|
-
const [v, setV] = React.useState<any>('zoom')
|
|
24
|
-
const [open, setOpen] = React.useState(true)
|
|
25
|
-
return (
|
|
26
|
-
<Tag>
|
|
27
|
-
<button onClick={() => setOpen(!open)}>Click</button>
|
|
28
|
-
<button onClick={() => setV(v === 'zoom' ? { from: {}, to: { transform: "scale(.5)" } } : "zoom")}>change</button>
|
|
29
|
-
<Transition open={open} variant="fade" >
|
|
30
|
-
<Tag
|
|
31
|
-
component="div"
|
|
32
|
-
width={300}
|
|
33
|
-
bgcolor="green"
|
|
34
|
-
radius={2}
|
|
35
|
-
p={2}
|
|
36
|
-
>
|
|
37
|
-
<Transition open={open} variant={v} >
|
|
38
|
-
<Tag
|
|
39
|
-
component="div"
|
|
40
|
-
width={100}
|
|
41
|
-
bgcolor="red"
|
|
42
|
-
radius={2}
|
|
43
|
-
px={2}
|
|
44
|
-
>
|
|
45
|
-
Lorem ipsum dolor sit amet consectetur adipisicing elit.
|
|
46
|
-
</Tag>
|
|
47
|
-
</Transition>
|
|
48
|
-
</Tag>
|
|
49
|
-
</Transition>
|
|
50
|
-
</Tag>
|
|
51
|
-
)
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const App = () => {
|
|
56
|
-
return (
|
|
57
|
-
<ThemeProvider theme="light">
|
|
58
|
-
<Tag
|
|
59
|
-
flexBox
|
|
60
|
-
flexRow
|
|
61
|
-
flexWrap="wrap"
|
|
62
|
-
gap={1}
|
|
63
|
-
p={2}
|
|
64
|
-
>
|
|
65
|
-
<Trans />
|
|
66
|
-
{
|
|
67
|
-
Array.from({ length: 1 }).map((_, i) => (
|
|
68
|
-
<Tag
|
|
69
|
-
key={i}
|
|
70
|
-
hover={{
|
|
71
|
-
background: 'green'
|
|
72
|
-
}}
|
|
73
|
-
id="asdasd"
|
|
74
|
-
width={100}
|
|
75
|
-
height={100}
|
|
76
|
-
background='red'
|
|
77
|
-
radius={2}
|
|
78
|
-
baseClass='hello'
|
|
79
|
-
className='world'
|
|
80
|
-
classNames={['world2']}
|
|
81
|
-
onClick={() => {
|
|
82
|
-
alert('asd')
|
|
83
|
-
}}
|
|
84
|
-
>Tagas</Tag>
|
|
85
|
-
))
|
|
86
|
-
}
|
|
87
|
-
</Tag>
|
|
88
|
-
</ThemeProvider>
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
const rootEle = document.getElementById('root')
|
|
92
|
-
|
|
93
|
-
if (rootEle) {
|
|
94
|
-
|
|
95
|
-
const root = createRoot(rootEle);
|
|
96
|
-
root.render(<App />);
|
|
97
|
-
}
|
package/src/ServerStyleTags.tsx
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
|
-
import { CSSFactory } from 'oncss'
|
|
3
|
-
|
|
4
|
-
const ServerStyleTags = () => {
|
|
5
|
-
return Array.from(CSSFactory.values()).map((c, idx) => <style
|
|
6
|
-
key={c.classname + idx}
|
|
7
|
-
data-oncss={c.classname}
|
|
8
|
-
dangerouslySetInnerHTML={{ __html: c.css }}
|
|
9
|
-
/>)
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export default ServerStyleTags
|