@starasia/theme 2.0.0 → 2.0.1
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/default.json.d.ts +73 -413
- package/dist/index.es.js +237 -580
- package/dist/index.umd.js +23 -23
- package/package.json +6 -6
package/dist/index.umd.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
`;for(const
|
|
3
|
-
`}}return
|
|
4
|
-
`}}return
|
|
5
|
-
`}else{const
|
|
6
|
-
`}}for(const
|
|
7
|
-
`}else{const
|
|
8
|
-
`}}for(const
|
|
9
|
-
`}}return
|
|
10
|
-
`}}return
|
|
11
|
-
`:
|
|
12
|
-
`}return
|
|
13
|
-
`}),
|
|
1
|
+
(function(a,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],p):(a=typeof globalThis<"u"?globalThis:a||self,p(a["@starasia/theme"]={},a.jsxRuntime,a.React))})(this,function(a,p,m){"use strict";function C(r,o=""){let t="";for(const e in r)if(Object.hasOwnProperty.call(r,e)){const n=r[e];t+=`/* ${e} */
|
|
2
|
+
`;for(const s in n)if(Object.hasOwnProperty.call(n,s)){const i=n[s];t+=`--${o}-${e}-${s}: ${i};
|
|
3
|
+
`}}return t}function y(r,o){let t="";for(const e in r){const n=r[e];for(const s in n){const i=n[s],c=s?`${o}-${e}-${s}`:`${o}-${e}`;t+=`--${c}: ${i};
|
|
4
|
+
`}}return t}function E(r,o){let t="";function e(n,s,i="",c="",l=""){if(l){const u=`${i}${l}-${c}-${n}`;t+=`--${u}: ${s};
|
|
5
|
+
`}else{const u=`${i}${n}-${c}`;t+=`--${u}: ${s};
|
|
6
|
+
`}}for(const n in r){const s=r[n];for(const i in s){const c=s[i];if(typeof c=="object")for(const l in c){const u=c[l],$=`${o}-`;e(i,u,$,n,l)}else{const l=`${o}-`;e(i,c,l,n)}}}return t}function P(r,o=""){let t="";function e(n,s,i=""){if(typeof s=="object")for(const c in s){const l=s[c],u=`--${i}-${n}-${c}`;t+=`${u}: ${l};
|
|
7
|
+
`}else{const c=`--${i}-${n}`;t+=`${c}: ${s};
|
|
8
|
+
`}}for(const n in r){const s=r[n];if(typeof s=="object")e(n,s,`${o}`);else{const i=`--${o}-${n}`;t+=`${i}: ${s};
|
|
9
|
+
`}}return t}function F(r,o=""){let t="";for(const e in r){const n=r[e];for(const s in n){const i=`--${o}-${e}-${s}`,c=n[s];t+=`${i}: ${c};
|
|
10
|
+
`}}return t}function N(r,o){let t="";for(const e in r)if(Object.hasOwnProperty.call(r,e)){const n=r[e];e==="default"?t+=`--${o}: ${n};
|
|
11
|
+
`:t+=`--${o}-${e}: ${n};
|
|
12
|
+
`}return t}const M=r=>{const o=document.getElementById(r);if(o)return o;const t=document.createElement("style");return t.id=r,document.head.appendChild(t),t};function j(r,o){let t="";return Object.keys(r).forEach(e=>{const n=r[e];if(n&&typeof n=="object"){t+=j(n,`${o}-${e}`);return}t+=`${o}-${e}: ${n};
|
|
13
|
+
`}),t}function B(r,o){let t="";return r&&(t+=j(r,o)),t}function D(r){var $,b,x,v,w,O;if(!r)return;const o=($=r.colors)!=null&&$.raw?y(r.colors.raw,"starasia-ui-raw-color"):"",t=(b=r.colors)!=null&&b.computed?y(r.colors.computed,"starasia-ui-color"):"",e=(x=r.colors)!=null&&x.main?E(r.colors.main,"starasia-ui"):"",n=(v=r.colors)!=null&&v.brand?C(r.colors.brand,"starasia-ui-brand"):"",s=(w=r.colors)!=null&&w.utility?C(r.colors.utility,"starasia-ui-utility"):"",i=(O=r.colors)!=null&&O.text?N(r.colors.text,"starasia-ui-color-text"):"",c=r.metrics?P(r.metrics,"starasia-ui"):"",l=r.font?F(r.font,"starasia-ui"):"",u=r.components?B(r.components,"--starasia-ui"):"";return`
|
|
14
14
|
:root {
|
|
15
|
-
${a}
|
|
16
15
|
${o}
|
|
17
|
-
${s}
|
|
18
16
|
${t}
|
|
19
|
-
${i}
|
|
20
|
-
${c}
|
|
21
17
|
${e}
|
|
22
18
|
${n}
|
|
23
|
-
${
|
|
19
|
+
${s}
|
|
20
|
+
${i}
|
|
21
|
+
${c}
|
|
22
|
+
${l}
|
|
23
|
+
${u}
|
|
24
24
|
}
|
|
25
|
-
`}const
|
|
26
|
-
`);return
|
|
27
|
-
${
|
|
28
|
-
}`:""}function
|
|
29
|
-
`);w&&(i!=null&&i.current)&&(i.current.textContent=w)}},[t]);const c=e=>{e&&s(e)};return d.jsx(x.Provider,{value:{theme:o,setTheme:c},children:a})}const y={colors:{raw:{white:{900:"255, 255, 255"},black:{900:"0, 0, 0"},blue:{50:"227, 242, 253",100:"187, 222, 251",200:"144, 202, 249",300:"100, 181, 246",400:"66, 165, 245",500:"33, 150, 243",600:"30, 136, 229",700:"25, 118, 210",800:"21, 101, 192",900:"13, 71, 161"},pink:{50:"251, 219, 241",100:"248, 183, 228",200:"245, 147, 215",300:"241, 111, 202",400:"238, 75, 189",500:"235, 39, 176",600:"215, 19, 157",700:"179, 16, 131",800:"143, 13, 104",900:"107, 9, 78"},purple:{50:"233, 222, 245",100:"212, 189, 235",200:"190, 156, 226",300:"169, 123, 216",400:"147, 90, 207",500:"126, 57, 197",600:"105, 47, 164",700:"84, 38, 131",800:"63, 28, 98",900:"42, 19, 65"},gray:{50:"255, 254, 255",100:"239, 243, 248",200:"201, 206, 204",300:"174, 182, 178",400:"147, 158, 153",500:"120, 134, 127",600:"96, 107, 102",700:"72, 80, 76",800:"48, 53, 51",900:"24, 26, 25"},red:{50:"255, 240, 243",100:"255, 204, 213",200:"255, 179, 193",300:"255, 143, 163",400:"255, 117, 143",500:"255, 77, 109",600:"201, 24, 74",700:"164, 19, 60",800:"128, 15, 47",900:"89, 13, 34"},orange:{50:"250, 246, 224",100:"255, 245, 193",200:"255, 225, 139",300:"255, 203, 105",400:"234, 183, 84",500:"210, 160, 58",600:"179, 130, 10",700:"152, 104, 0",800:"126, 80, 0",900:"97, 52, 0"},aloha:{50:"219, 247, 242",100:"184, 240, 230",200:"149, 232, 218",300:"114, 225, 206",400:"79, 218, 194",500:"44, 210, 182",600:"36, 175, 152",700:"29, 140, 121",800:"22, 105, 91",900:"14, 70, 60"},green:{50:"220, 246, 234",100:"186, 238, 214",200:"151, 230, 193",300:"117, 222, 173",400:"82, 214, 152",500:"48, 206, 132",600:"40, 172, 110",700:"32, 137, 88",800:"24, 103, 66",900:"16, 68, 44"},brand:{default:"74, 106, 148",active:"57, 82, 116",secondary:"144, 176, 218",tertiary:"227, 237, 248"}},computed:{white:{900:"rgba(var(--starasia-ui-raw-color-white-900), 1)","":"rgba(var(--starasia-ui-raw-color-gray-50), 1)"},black:{900:"rgba(var(--starasia-ui-raw-color-black-900), 1)"},blue:{50:"rgba(var(--starasia-ui-raw-color-blue-50), 1)",100:"rgba(var(--starasia-ui-raw-color-blue-100), 1)",200:"rgba(var(--starasia-ui-raw-color-blue-200), 1)",300:"rgba(var(--starasia-ui-raw-color-blue-300), 1)",400:"rgba(var(--starasia-ui-raw-color-blue-400), 1)",500:"rgba(var(--starasia-ui-raw-color-blue-500), 1)",600:"rgba(var(--starasia-ui-raw-color-blue-600), 1)",700:"rgba(var(--starasia-ui-raw-color-blue-700), 1)",800:"rgba(var(--starasia-ui-raw-color-blue-800), 1)",900:"rgba(var(--starasia-ui-raw-color-blue-900), 1)"},pink:{50:"rgba(var(--starasia-ui-raw-color-pink-50), 1)",100:"rgba(var(--starasia-ui-raw-color-pink-100), 1)",200:"rgba(var(--starasia-ui-raw-color-pink-200), 1)",300:"rgba(var(--starasia-ui-raw-color-pink-300), 1)",400:"rgba(var(--starasia-ui-raw-color-pink-400), 1)",500:"rgba(var(--starasia-ui-raw-color-pink-500), 1)",600:"rgba(var(--starasia-ui-raw-color-pink-600), 1)",700:"rgba(var(--starasia-ui-raw-color-pink-700), 1)",800:"rgba(var(--starasia-ui-raw-color-pink-800), 1)",900:"rgba(var(--starasia-ui-raw-color-pink-900), 1)"},purple:{50:"rgba(var(--starasia-ui-raw-color-purple-50), 1)",100:"rgba(var(--starasia-ui-raw-color-purple-100), 1)",200:"rgba(var(--starasia-ui-raw-color-purple-200), 1)",300:"rgba(var(--starasia-ui-raw-color-purple-300), 1)",400:"rgba(var(--starasia-ui-raw-color-purple-400), 1)",500:"rgba(var(--starasia-ui-raw-color-purple-500), 1)",600:"rgba(var(--starasia-ui-raw-color-purple-600), 1)",700:"rgba(var(--starasia-ui-raw-color-purple-700), 1)",800:"rgba(var(--starasia-ui-raw-color-purple-800), 1)",900:"rgba(var(--starasia-ui-raw-color-purple-900), 1)"},gray:{50:"rgba(var(--starasia-ui-raw-color-gray-50), 1)",100:"rgba(var(--starasia-ui-raw-color-gray-100), 1)",200:"rgba(var(--starasia-ui-raw-color-gray-200), 1)",300:"rgba(var(--starasia-ui-raw-color-gray-300), 1)",400:"rgba(var(--starasia-ui-raw-color-gray-400), 1)",500:"rgba(var(--starasia-ui-raw-color-gray-500), 1)",600:"rgba(var(--starasia-ui-raw-color-gray-600), 1)",700:"rgba(var(--starasia-ui-raw-color-gray-700), 1)",800:"rgba(var(--starasia-ui-raw-color-gray-800), 1)",900:"rgba(var(--starasia-ui-raw-color-gray-900), 1)"},red:{50:"rgba(var(--starasia-ui-raw-color-red-50), 1)",100:"rgba(var(--starasia-ui-raw-color-red-100), 1)",200:"rgba(var(--starasia-ui-raw-color-red-200), 1)",300:"rgba(var(--starasia-ui-raw-color-red-300), 1)",400:"rgba(var(--starasia-ui-raw-color-red-400), 1)",500:"rgba(var(--starasia-ui-raw-color-red-500), 1)",600:"rgba(var(--starasia-ui-raw-color-red-600), 1)",700:"rgba(var(--starasia-ui-raw-color-red-700), 1)",800:"rgba(var(--starasia-ui-raw-color-red-800), 1)",900:"rgba(var(--starasia-ui-raw-color-red-900), 1)"},orange:{50:"rgba(var(--starasia-ui-raw-color-orange-50), 1)",100:"rgba(var(--starasia-ui-raw-color-orange-100), 1)",200:"rgba(var(--starasia-ui-raw-color-orange-200), 1)",300:"rgba(var(--starasia-ui-raw-color-orange-300), 1)",400:"rgba(var(--starasia-ui-raw-color-orange-400), 1)",500:"rgba(var(--starasia-ui-raw-color-orange-500), 1)",600:"rgba(var(--starasia-ui-raw-color-orange-600), 1)",700:"rgba(var(--starasia-ui-raw-color-orange-700), 1)",800:"rgba(var(--starasia-ui-raw-color-orange-800), 1)",900:"rgba(var(--starasia-ui-raw-color-orange-900), 1)"},aloha:{50:"rgba(var(--starasia-ui-raw-color-aloha-50), 1)",100:"rgba(var(--starasia-ui-raw-color-aloha-100), 1)",200:"rgba(var(--starasia-ui-raw-color-aloha-200), 1)",300:"rgba(var(--starasia-ui-raw-color-aloha-300), 1)",400:"rgba(var(--starasia-ui-raw-color-aloha-400), 1)",500:"rgba(var(--starasia-ui-raw-color-aloha-500), 1)",600:"rgba(var(--starasia-ui-raw-color-aloha-600), 1)",700:"rgba(var(--starasia-ui-raw-color-aloha-700), 1)",800:"rgba(var(--starasia-ui-raw-color-aloha-800), 1)",900:"rgba(var(--starasia-ui-raw-color-aloha-900), 1)"},green:{50:"rgba(var(--starasia-ui-raw-color-green-50), 1)",100:"rgba(var(--starasia-ui-raw-color-green-100), 1)",200:"rgba(var(--starasia-ui-raw-color-green-200), 1)",300:"rgba(var(--starasia-ui-raw-color-green-300), 1)",400:"rgba(var(--starasia-ui-raw-color-green-400), 1)",500:"rgba(var(--starasia-ui-raw-color-green-500), 1)",600:"rgba(var(--starasia-ui-raw-color-green-600), 1)",700:"rgba(var(--starasia-ui-raw-color-green-700), 1)",800:"rgba(var(--starasia-ui-raw-color-green-800), 1)",900:"rgba(var(--starasia-ui-raw-color-green-900), 1)"}},main:{primary:{"background-color":"rgb(var(--starasia-ui-raw-color-brand-default))","text-color":"rgb(255, 255, 255)","border-color":"rgb(var(--starasia-ui-raw-color-brand-default))",hover:{"background-color":"rgba(var(--starasia-ui-raw-color-brand-default), 0.9)","border-color":"rgba(var(--starasia-ui-raw-color-brand-default), 0.9)","text-color":"rgb(255, 255, 255)"},active:{"background-color":"rgb(var(--starasia-ui-raw-color-brand-active))","border-color":"rgb(var(--starasia-ui-raw-color-brand-active))","text-color":"rgb(255, 255, 255)",shadow:"0px 0px 0px 3px rgba(var(--starasia-ui-raw-color-brand-secondary), 0.28)"},disable:{"background-color":"rgba(var(--starasia-ui-raw-color-gray-200), 0.68)","border-color":"rgba(var(--starasia-ui-raw-color-gray-200), 0.68)","text-color":"rgba(var(--starasia-ui-raw-color-gray-500), 0.62)"}},secondary:{"background-color":"rgb(var(--starasia-ui-raw-color-gray-50))","text-color":"rgb(72, 80, 76)","border-color":"rgba(120, 134, 127, 0.2)",hover:{"background-color":"rgba(var(--starasia-ui-raw-color-gray-100), 0.9)","border-color":"rgba(120, 134, 127, 0.2)","text-color":"rgb(72, 80, 76)",shadow:"0px 0px 0px -1px #f0f0f0"},active:{"background-color":"rgba(var(--starasia-ui-raw-color-gray-200), 0.1)","border-color":"rgba(120, 134, 127, 0.2)","text-color":"rgb(72, 80, 76)",shadow:"0px 0px 0px 3px rgba(var(--starasia-ui-raw-color-gray-200), 0.28), 0px 0px 0px -1px #f0f0f0"},disable:{"background-color":"rgba(var(--starasia-ui-raw-color-gray-200), 0.68)","border-color":"rgba(var(--starasia-ui-raw-color-gray-200), 0.68)","text-color":"rgba(var(--starasia-ui-raw-color-gray-500), 0.62)"}},tertiary:{"background-color":"rgba(var(--starasia-ui-raw-color-brand-secondary), 0.21)","text-color":"rgb(var(--starasia-ui-raw-color-brand-default))","border-color":"rgba(var(--starasia-ui-raw-color-brand-secondary), 0.21)",hover:{"background-color":"rgba(var(--starasia-ui-raw-color-brand-secondary), 0.3)","border-color":"rgba(var(--starasia-ui-raw-color-brand-secondary), 0.3)","text-color":"rgb(var(--starasia-ui-raw-color-brand-default))",shadow:"0px 0px 0px -1px #f0f0f0"},active:{"background-color":"rgba(var(--starasia-ui-raw-color-brand-secondary), 0.46)","border-color":"rgba(var(--starasia-ui-raw-color-brand-secondary), 0.46)","text-color":"rgb(var(--starasia-ui-raw-color-brand-default))",shadow:"0px 0px 0px 3px rgba(var(--starasia-ui-raw-color-brand-secondary), 0.28)"},disable:{"background-color":"rgba(var(--starasia-ui-raw-color-brand-secondary), 0.5)","border-color":"rgba(var(--starasia-ui-raw-color-brand-secondary), 0.5)","text-color":"rgba(var(--starasia-ui-raw-color-brand-default), 0.5)"}},quaternary:{"background-color":"rgba(255, 255, 255, 0)","text-color":"rgb(var(--starasia-ui-raw-color-brand-default))","border-color":"rgb(var(--starasia-ui-raw-color-brand-default))",hover:{"background-color":"rgba(255, 255, 255, 0)","border-color":"rgba(var(--starasia-ui-raw-color-brand-default), 0.9)","text-color":"rgba(var(--starasia-ui-raw-color-brand-default), 0.9)"},active:{"background-color":"rgb(255, 255, 255)","border-color":"rgb(var(--starasia-ui-raw-color-brand-default))","text-color":"rgb(var(--starasia-ui-raw-color-brand-default))",shadow:"0px 0px 0px 3px rgba(var(--starasia-ui-raw-color-brand-secondary), 0.28)"},disable:{"background-color":"rgba(255, 255, 255, 0)","border-color":"rgba(var(--starasia-ui-raw-color-gray-500), 0.62)","text-color":"rgba(var(--starasia-ui-raw-color-gray-500), 0.62)"}},link:{"background-color":"rgba(255, 255, 255, 0)","text-color":"rgb(var(--starasia-ui-raw-color-brand-default))","border-color":"rgba(255, 255, 255, 0)",hover:{"background-color":"rgba(255, 255, 255, 0)","border-color":"rgba(255, 255, 255, 0)","text-color":"rgba(var(--starasia-ui-raw-color-brand-active), 0.9)"},active:{"background-color":"rgba(255, 255, 255, 0)","border-color":"rgba(255, 255, 255, 0)","text-color":"rgb(var(--starasia-ui-raw-color-brand-default))"},disable:{"background-color":"rgba(255, 255, 255, 0)","border-color":"rgba(255, 255, 255, 0)","text-color":"rgba(var(--starasia-ui-raw-color-gray-500), 0.62)"}},success:{"background-color":"rgb(var(--starasia-ui-raw-color-green-500))","text-color":"rgb(255, 255, 255)","border-color":"rgb(var(--starasia-ui-raw-color-green-500))",hover:{"background-color":"rgba(var(--starasia-ui-raw-color-green-500), 0.9)","border-color":"rgba(var(--starasia-ui-raw-color-green-500), 0.9)","text-color":"rgb(255, 255, 255)"},active:{"background-color":"rgba(var(--starasia-ui-raw-color-green-600), 0.75)","border-color":"rgba(var(--starasia-ui-raw-color-green-600), 0.75)","text-color":"rgb(255, 255, 255)",shadow:"0px 0px 0px 3px rgba(var(--starasia-ui-raw-color-green-800), 0.28)"},disable:{"background-color":"rgb(var(--starasia-ui-raw-color-gray-400))","border-color":"rgb(var(--starasia-ui-raw-color-gray-400))","text-color":"rgba(120, 134, 127, 0.62)"}},danger:{"background-color":"rgb(var(--starasia-ui-raw-color-red-600))","text-color":"rgb(255, 255, 255)","border-color":"rgb(var(--starasia-ui-raw-color-red-600))",hover:{"background-color":"rgba(var(--starasia-ui-raw-color-red-600), 0.9)","border-color":"rgba(var(--starasia-ui-raw-color-red-600), 0.9)","text-color":"rgb(255, 255, 255)"},active:{"background-color":"rgba(var(--starasia-ui-raw-color-red-800), 0.68)","border-color":"rgba(var(--starasia-ui-raw-color-red-800), 0.68)","text-color":"rgb(255, 255, 255)",shadow:"0px 0px 0px 3px rgba(var(--starasia-ui-raw-color-red-800), 0.28)"},disable:{"background-color":"rgb(var(--starasia-ui-raw-color-red-300))","border-color":"rgb(var(--starasia-ui-raw-color-red-300))","text-color":"rgba(201, 24, 74, 0.3)"}},warning:{"background-color":"rgb(var(--starasia-ui-raw-color-orange-600))","text-color":"rgb(255, 255, 255)","border-color":"rgb(var(--starasia-ui-raw-color-orange-600))",hover:{"background-color":"rgba(var(--starasia-ui-raw-color-orange-600), 0.9)","border-color":"rgba(var(--starasia-ui-raw-color-orange-600), 0.9)","text-color":"rgb(255, 255, 255)"},active:{"background-color":"rgba(var(--starasia-ui-raw-color-orange-800), 0.75)","border-color":"rgba(var(--starasia-ui-raw-color-orange-800), 0.75)","text-color":"rgb(255, 255, 255)",shadow:"0px 0px 0px 2px rgba(var(--starasia-ui-raw-color-orange-800), 0.28)"},disable:{"background-color":"rgb(var(--starasia-ui-raw-color-orange-300))","border-color":"rgb(var(--starasia-ui-raw-color-orange-300))","text-color":"rgb(var(--starasia-ui-raw-color-orange-600))"}}},brand:{primary:{default:"rgba(74, 106, 148, 1)",secondary:"rgba(144, 176, 218, 1)",tertiary:"rgba(227, 237, 248, 1)"},secondary:{default:"var(--starasia-ui-color-pink-700)",secondary:"var(--starasia-ui-color-pink-300)",tertiary:"var(--starasia-ui-color-pink-50)"}},text:{default:"var(--starasia-ui-color-gray-900)",secondary:"var(--starasia-ui-color-gray-700)",tertiary:"var(--starasia-ui-color-gray-500)",disable:"var(--starasia-ui-color-gray-200)",white:"var(--starasia-ui-color-white-900)"},utility:{success:{default:"var(--starasia-ui-color-green-600)",secondary:"var(--starasia-ui-color-green-200)",tertiary:"var(--starasia-ui-color-green-50)"},danger:{default:"var(--starasia-ui-color-red-600)",secondary:"var(--starasia-ui-color-red-200)",tertiary:"var(--starasia-ui-color-red-50)"},warning:{default:"var(--starasia-ui-color-orange-600)",secondary:"var(--starasia-ui-color-orange-200)",tertiary:"var(--starasia-ui-color-orange-50)"},information:{default:"var(--starasia-ui-color-blue-600)",secondary:"var(--starasia-ui-color-blue-200)",tertiary:"var(--starasia-ui-color-blue-50)"},dark:{default:"var(--starasia-ui-color-gray-600)",secondary:"var(--starasia-ui-color-gray-200)",tertiary:"var(--starasia-ui-color-gray-50)"},fill:{default:"rgba(120, 134, 127, 0.2)",secondary:"rgba(120, 134, 127, 0.16)",tertiary:"rgba(120, 134, 127, 0.1)"}}},metrics:{radii:{none:"0",xs:"0.25rem",sm:"0.375rem",md:"0.5rem",lg:"0.75rem",xl:"0.875rem","2xl":"1rem",full:"12rem"},spacing:{0:"0rem",1:"0.063rem",2:"0.125rem",4:"0.25rem",6:"0.375rem",8:"0.5rem",10:"0.625rem",12:"0.75rem",14:"0.875rem",16:"1rem",18:"1.125rem",20:"1.25rem",24:"1.5rem",28:"1.75rem",32:"2rem",36:"2.25rem",40:"2.5rem",48:"3rem",64:"4rem",80:"5rem",96:"6rem",128:"8rem",160:"10rem",192:"12rem",224:"14rem",256:"16rem",xs:"0.25rem",sm:"0.5rem",md:"0.75rem",lg:"1rem",xl:"1.5rem","2xl":"2rem","3xl":"4rem"},border:{default:"1px solid var(--starasia-ui-color-border)"},shadows:{sm:"0 1px 2px 0 rgb(0 0 0 / 0.05)",md:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",lg:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)","2xl":"0 25px 50px -12px rgb(0 0 0 / 0.25)",inner:"inset 0 2px 4px 0 rgb(0 0 0 / 0.05)",card:"0px 4px 35px 0px rgba(112, 144, 176, 0.25)"}},font:{fontSizes:{xs:"0.625rem",sm:"0.75rem",md:"0.875rem",lg:"1rem",xl:"1.125rem","2xl":"1.25rem","3xl":"1.5rem","4xl":"2rem","5xl":"2.25rem","6xl":"3rem"},fontWeights:{hairline:100,thin:100,light:200,normal:300,medium:400,semibold:500,bold:600,extrabold:700,black:800},lineHeights:{3:"0.75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"1.875rem",9:"2.25rem",10:"2.5rem",none:1,tight:1.25,snug:1.375,normal:1.5,relaxed:1.625,loose:2}}},k=(r,a)=>{const o={};return Object.keys(r).forEach(s=>{if(r!=null&&r[s]&&typeof(r==null?void 0:r[s])=="object"){o[s]={...r==null?void 0:r[s],...a==null?void 0:a[s],...k(r==null?void 0:r[s],a==null?void 0:a[s])};return}o[s]=(a==null?void 0:a[s])||(r==null?void 0:r[s])}),o};function v(){const r=u.useContext(x),a=u.useMemo(()=>({...y,...r.theme,...k(y,r.theme)}),[r.theme,y]);return{...r,theme:a}}function B(){const{theme:r}=v();return r.colors}function H(){var a;const{theme:r}=v();return(a=r.metrics)==null?void 0:a.spacing}function J(){var a;const{theme:r}=v();return(a=r.metrics)==null?void 0:a.radii}function L(){var a;const{theme:r}=v();return(a=r==null?void 0:r.metrics)==null?void 0:a.shadows}function _(r){return r}l.ThemeContext=x,l.ThemeProvider=q,l.createTheme=_,l.useColor=B,l.useRadius=J,l.useShadow=L,l.useSpacing=H,l.useTheme=v,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})});
|
|
25
|
+
`}const d=m.createContext({theme:void 0,setTheme:()=>{}}),H="starasia-theme-style";function R(r){const o=r.split(",").map(t=>Number(t.trim()));return o.length!==3||o.some(t=>!Number.isFinite(t)||t<0||t>255)?null:"#"+o.map(t=>Math.round(t).toString(16).padStart(2,"0")).join("")}function J(r){if(!r)return"";const o=new Set(["50","100","200","300","400","500","600","700","800","900"]),t=Object.entries(r).filter(([e])=>o.has(e)).map(([e,n])=>{const s=R(n);return s?` --sa-color-brand-${e}: ${s};`:""}).filter(Boolean).join(`
|
|
26
|
+
`);return t?`:root {
|
|
27
|
+
${t}
|
|
28
|
+
}`:""}function L({value:r,children:o}){const[t,e]=m.useState(r),n=m.useMemo(()=>t?JSON.stringify(t):"",[t]),s=m.useRef(M(H));m.useEffect(()=>{var c,l;if(n){const u=JSON.parse(n),$=D(u)??"",b=J((l=(c=u==null?void 0:u.colors)==null?void 0:c.raw)==null?void 0:l.blue),x=[$,b].filter(Boolean).join(`
|
|
29
|
+
`);x&&(s!=null&&s.current)&&(s.current.textContent=x)}},[n]);const i=c=>{c&&e(c)};return p.jsx(d.Provider,{value:{theme:t,setTheme:i},children:o})}const S={colors:{raw:{white:{900:"255, 255, 255"},black:{900:"0, 0, 0"},blue:{50:"230, 237, 246",100:"204, 217, 237",200:"153, 179, 219",300:"102, 140, 201",400:"51, 102, 183",500:"26, 79, 160",600:"4, 37, 79",700:"3, 31, 67",800:"2, 25, 55",900:"2, 19, 43"},pink:{50:"251, 219, 241",100:"248, 183, 228",200:"245, 147, 215",300:"241, 111, 202",400:"238, 75, 189",500:"235, 39, 176",600:"215, 19, 157",700:"179, 16, 131",800:"143, 13, 104",900:"107, 9, 78"},purple:{50:"249, 229, 252",100:"240, 196, 248",200:"230, 162, 244",300:"220, 128, 240",400:"210, 95, 236",500:"200, 61, 232",600:"180, 41, 212",700:"150, 34, 177",800:"120, 27, 142",900:"90, 21, 106"},red:{50:"251, 222, 222",100:"247, 188, 188",200:"243, 153, 153",300:"239, 119, 119",400:"235, 84, 84",500:"231, 50, 50",600:"212, 30, 30",700:"176, 25, 25",800:"141, 20, 20",900:"105, 15, 15"},orange:{50:"253, 235, 217",100:"251, 215, 179",200:"249, 195, 141",300:"247, 175, 103",400:"245, 155, 65",500:"243, 135, 27",600:"224, 116, 8",700:"187, 96, 7",800:"150, 77, 6",900:"112, 58, 4"},yellow:{50:"255, 250, 219",100:"255, 246, 184",200:"255, 241, 149",300:"255, 237, 114",400:"255, 232, 79",500:"255, 228, 44",600:"236, 209, 25",700:"197, 174, 21",800:"157, 139, 17",900:"118, 104, 12"},green:{50:"236, 255, 246",100:"151, 230, 193",200:"117, 222, 173",300:"82, 214, 152",400:"48, 206, 132",500:"40, 172, 110",600:"32, 137, 88",700:"24, 103, 66",800:"16, 68, 44",900:"16, 68, 44"},brand:{default:"4, 37, 79",active:"2, 19, 43",secondary:"153, 179, 219",tertiary:"230, 237, 246"}}},metrics:{radii:{none:"0",xs:"0.25rem",sm:"0.375rem",md:"0.5rem",lg:"0.75rem",xl:"0.875rem","2xl":"1rem",full:"12rem"},spacing:{0:"0rem",1:"0.063rem",2:"0.125rem",4:"0.25rem",6:"0.375rem",8:"0.5rem",10:"0.625rem",12:"0.75rem",14:"0.875rem",16:"1rem",18:"1.125rem",20:"1.25rem",24:"1.5rem",28:"1.75rem",32:"2rem",36:"2.25rem",40:"2.5rem",48:"3rem",64:"4rem",80:"5rem",96:"6rem",128:"8rem",160:"10rem",192:"12rem",224:"14rem",256:"16rem",xs:"0.25rem",sm:"0.5rem",md:"0.75rem",lg:"1rem",xl:"1.5rem","2xl":"2rem","3xl":"4rem"},border:{default:"1px solid var(--sa-border-subtle, #0b120e24)"},shadows:{sm:"0 1px 2px 0 #0000000d",md:"0 4px 6px -1px #0000001a, 0 2px 4px -2px #0000001a",lg:"0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a",xl:"0 20px 25px -5px #0000001a, 0 8px 10px -6px #0000001a","2xl":"0 25px 50px -12px #00000040",inner:"inset 0 2px 4px 0 #0000000d",card:"0px 4px 35px 0px #7090b040"}},font:{fontSizes:{xs:"0.625rem",sm:"0.75rem",md:"0.875rem",lg:"1rem",xl:"1.125rem","2xl":"1.25rem","3xl":"1.5rem","4xl":"2rem","5xl":"2.25rem","6xl":"3rem"},fontWeights:{hairline:100,thin:100,light:200,normal:300,medium:400,semibold:500,bold:600,extrabold:700,black:800},lineHeights:{3:"0.75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"1.875rem",9:"2.25rem",10:"2.5rem",none:1,tight:1.25,snug:1.375,normal:1.5,relaxed:1.625,loose:2}}},g=(r,o)=>{const t={};return Object.keys(r).forEach(e=>{if(r!=null&&r[e]&&typeof(r==null?void 0:r[e])=="object"){t[e]={...r==null?void 0:r[e],...o==null?void 0:o[e],...g(r==null?void 0:r[e],o==null?void 0:o[e])};return}t[e]=(o==null?void 0:o[e])||(r==null?void 0:r[e])}),t};function f(){const r=m.useContext(d),o=m.useMemo(()=>({...S,...r.theme,...g(S,r.theme)}),[r.theme,S]);return{...r,theme:o}}function _(){const{theme:r}=f();return r.colors}function q(){var o;const{theme:r}=f();return(o=r.metrics)==null?void 0:o.spacing}function A(){var o;const{theme:r}=f();return(o=r.metrics)==null?void 0:o.radii}function U(){var o;const{theme:r}=f();return(o=r==null?void 0:r.metrics)==null?void 0:o.shadows}function V(r){return r}a.ThemeContext=d,a.ThemeProvider=L,a.createTheme=V,a.useColor=_,a.useRadius=A,a.useShadow=U,a.useSpacing=q,a.useTheme=f,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@starasia/theme",
|
|
3
3
|
"author": "Prawito Hudoro",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.1",
|
|
5
5
|
"description": "Theme component for starasia UI",
|
|
6
6
|
"main": "dist/index.umd.js",
|
|
7
7
|
"module": "dist/index.es.js",
|
|
@@ -9,10 +9,6 @@
|
|
|
9
9
|
"files": [
|
|
10
10
|
"dist"
|
|
11
11
|
],
|
|
12
|
-
"scripts": {
|
|
13
|
-
"dev": "vite --config vite.config.ts --port 3000",
|
|
14
|
-
"build": "vite build --config vite.config.ts"
|
|
15
|
-
},
|
|
16
12
|
"keywords": [],
|
|
17
13
|
"license": "ISC",
|
|
18
14
|
"type": "module",
|
|
@@ -42,5 +38,9 @@
|
|
|
42
38
|
},
|
|
43
39
|
"dependencies": {
|
|
44
40
|
"@starasia/css": "^1.0.2"
|
|
41
|
+
},
|
|
42
|
+
"scripts": {
|
|
43
|
+
"dev": "vite --config vite.config.ts --port 3000",
|
|
44
|
+
"build": "vite build --config vite.config.ts"
|
|
45
45
|
}
|
|
46
|
-
}
|
|
46
|
+
}
|