@razorwind/tamagui 0.0.43 → 0.0.44
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/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -54,7 +54,7 @@ Re-run Razorwind generate when tokens change so \`${e.outputPath}\` stays aligne
|
|
|
54
54
|
light: ${W(n,8)},
|
|
55
55
|
dark: ${W(a,8)}
|
|
56
56
|
}`)}if(r.length!==0)return`{\n${r.join(`,
|
|
57
|
-
`)}\n }`}function wt(e){let t=new Set;for(let n of e)for(let e of Object.values(n)){for(let n of e.matchAll(/theme\.([A-Z_$][\w$]*)/gi))n[1]&&t.add(n[1]);for(let n of e.matchAll(/theme\[(['"])(.+?)\1\]/g))t.add(n[2])}return[...t]}function Tt(e,t){let n=new Set;for(let r of[e,t])for(let e of Object.values(r))for(let t of Object.keys(e))n.add(t);return[...n]}function Et(e,t){let n=Math.max(e?.length??0,t?.length??0);if(n===0)return[];let r=[];for(let e=1;e<=Math.min(n,12);e++)r.push(`color${e}`);return r}function Dt(e){let t=new Set;for(let n of Object.keys(e.lightSemantic))t.add(n);for(let n of Object.keys(e.darkSemantic))t.add(n);for(let n of wt([e.lightSemantic,e.darkSemantic]))t.add(n);for(let n of Tt(e.lightScales,e.darkScales))t.add(n);for(let n of Et(e.lightPalette,e.darkPalette))t.add(n);return[...t].toSorted((e,t)=>e.localeCompare(t,void 0,{numeric:!0}))}function Ot(e){return` ${/^[A-Z_$][\w$]*$/i.test(e)?e:o(e)}: string;`}function kt(e,t){if(e.length!==0)return[`/**`,` * Theme values available on \`useTheme()\` and \`$\` style props for the ${t.specName||`design system`}.`,` *`," * Derived from design tokens mapped by `createV5Theme` and `getTheme`.",` *`,` * @see https://tamagui.dev/docs/guides/theme-builder#gettheme`,` */`,`export interface AppTheme {`,...e.map(Ot),`}`,``]}function At(e,t,n={}){let r=e.fonts??{},i=n.useDefaultConfig
|
|
57
|
+
`)}\n }`}function wt(e){let t=new Set;for(let n of e)for(let e of Object.values(n)){for(let n of e.matchAll(/theme\.([A-Z_$][\w$]*)/gi))n[1]&&t.add(n[1]);for(let n of e.matchAll(/theme\[(['"])(.+?)\1\]/g))t.add(n[2])}return[...t]}function Tt(e,t){let n=new Set;for(let r of[e,t])for(let e of Object.values(r))for(let t of Object.keys(e))n.add(t);return[...n]}function Et(e,t){let n=Math.max(e?.length??0,t?.length??0);if(n===0)return[];let r=[];for(let e=1;e<=Math.min(n,12);e++)r.push(`color${e}`);return r}function Dt(e){let t=new Set;for(let n of Object.keys(e.lightSemantic))t.add(n);for(let n of Object.keys(e.darkSemantic))t.add(n);for(let n of wt([e.lightSemantic,e.darkSemantic]))t.add(n);for(let n of Tt(e.lightScales,e.darkScales))t.add(n);for(let n of Et(e.lightPalette,e.darkPalette))t.add(n);return[...t].toSorted((e,t)=>e.localeCompare(t,void 0,{numeric:!0}))}function Ot(e){return` ${/^[A-Z_$][\w$]*$/i.test(e)?e:o(e)}: string;`}function kt(e,t){if(e.length!==0)return[`/**`,` * Theme values available on \`useTheme()\` and \`$\` style props for the ${t.specName||`design system`}.`,` *`," * Derived from design tokens mapped by `createV5Theme` and `getTheme`.",` *`,` * @see https://tamagui.dev/docs/guides/theme-builder#gettheme`,` */`,`export interface AppTheme {`,...e.map(Ot),`}`,``]}function At(e,t,n={}){let r=e.fonts??{},i=n.useDefaultConfig===!0,a=n.animations??`css`,s=n.includeTypeAugmentation!==!1,c=t.filter(e=>e.category===`color`),l=U(c,`light`),u=U(c,`dark`),d=J(l),f=J(u.length>0?u:l),{lightPalette:p,darkPalette:m,lightBaseName:h,darkBaseName:ee}=xt(t),g=Ct(d,f),_=St(l,h),v=St(u.length>0?u:l,u.length>0?ee:h),te=kt(Dt({lightSemantic:_,darkSemantic:v,lightScales:d,darkScales:f,lightPalette:p,darkPalette:m}),{specName:e.name}),y=nt(U(t,`light`)),b=rt(l,u),x=[];Object.keys(b).length>0&&x.push(` color: ${W(b,4)}`);for(let e of Ze){let t=y[e];t&&Object.keys(t).length>0&&x.push(` ${e}: ${W(t,4)}`)}let S=[];p&&S.push(` lightPalette: ${o(p)}`),m&&S.push(` darkPalette: ${o(m)}`),g&&S.push(` childrenThemes: ${g}`),(Object.keys(_).length>0||Object.keys(v).length>0)&&S.push(` getTheme: ({ theme, scheme }: { theme: any; scheme: "light" | "dark" }) => {
|
|
58
58
|
return scheme === "dark"
|
|
59
59
|
? ${it(v,8)}
|
|
60
60
|
: ${it(_,8)};
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.mts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -54,7 +54,7 @@ Re-run Razorwind generate when tokens change so \`${e.outputPath}\` stays aligne
|
|
|
54
54
|
light: ${q(n,8)},
|
|
55
55
|
dark: ${q(a,8)}
|
|
56
56
|
}`)}if(r.length!==0)return`{\n${r.join(`,
|
|
57
|
-
`)}\n }`}function Nt(e){let t=new Set;for(let n of e)for(let e of Object.values(n)){for(let n of e.matchAll(/theme\.([A-Z_$][\w$]*)/gi))n[1]&&t.add(n[1]);for(let n of e.matchAll(/theme\[(['"])(.+?)\1\]/g))t.add(n[2])}return[...t]}function Pt(e,t){let n=new Set;for(let r of[e,t])for(let e of Object.values(r))for(let t of Object.keys(e))n.add(t);return[...n]}function Ft(e,t){let n=Math.max(e?.length??0,t?.length??0);if(n===0)return[];let r=[];for(let e=1;e<=Math.min(n,12);e++)r.push(`color${e}`);return r}function It(e){let t=new Set;for(let n of Object.keys(e.lightSemantic))t.add(n);for(let n of Object.keys(e.darkSemantic))t.add(n);for(let n of Nt([e.lightSemantic,e.darkSemantic]))t.add(n);for(let n of Pt(e.lightScales,e.darkScales))t.add(n);for(let n of Ft(e.lightPalette,e.darkPalette))t.add(n);return[...t].toSorted((e,t)=>e.localeCompare(t,void 0,{numeric:!0}))}function Lt(e){return` ${/^[A-Z_$][\w$]*$/i.test(e)?e:h(e)}: string;`}function Rt(e,t){if(e.length!==0)return[`/**`,` * Theme values available on \`useTheme()\` and \`$\` style props for the ${t.specName||`design system`}.`,` *`," * Derived from design tokens mapped by `createV5Theme` and `getTheme`.",` *`,` * @see https://tamagui.dev/docs/guides/theme-builder#gettheme`,` */`,`export interface AppTheme {`,...e.map(Lt),`}`,``]}function zt(e,t,n={}){let r=e.fonts??{},i=n.useDefaultConfig
|
|
57
|
+
`)}\n }`}function Nt(e){let t=new Set;for(let n of e)for(let e of Object.values(n)){for(let n of e.matchAll(/theme\.([A-Z_$][\w$]*)/gi))n[1]&&t.add(n[1]);for(let n of e.matchAll(/theme\[(['"])(.+?)\1\]/g))t.add(n[2])}return[...t]}function Pt(e,t){let n=new Set;for(let r of[e,t])for(let e of Object.values(r))for(let t of Object.keys(e))n.add(t);return[...n]}function Ft(e,t){let n=Math.max(e?.length??0,t?.length??0);if(n===0)return[];let r=[];for(let e=1;e<=Math.min(n,12);e++)r.push(`color${e}`);return r}function It(e){let t=new Set;for(let n of Object.keys(e.lightSemantic))t.add(n);for(let n of Object.keys(e.darkSemantic))t.add(n);for(let n of Nt([e.lightSemantic,e.darkSemantic]))t.add(n);for(let n of Pt(e.lightScales,e.darkScales))t.add(n);for(let n of Ft(e.lightPalette,e.darkPalette))t.add(n);return[...t].toSorted((e,t)=>e.localeCompare(t,void 0,{numeric:!0}))}function Lt(e){return` ${/^[A-Z_$][\w$]*$/i.test(e)?e:h(e)}: string;`}function Rt(e,t){if(e.length!==0)return[`/**`,` * Theme values available on \`useTheme()\` and \`$\` style props for the ${t.specName||`design system`}.`,` *`," * Derived from design tokens mapped by `createV5Theme` and `getTheme`.",` *`,` * @see https://tamagui.dev/docs/guides/theme-builder#gettheme`,` */`,`export interface AppTheme {`,...e.map(Lt),`}`,``]}function zt(e,t,n={}){let r=e.fonts??{},i=n.useDefaultConfig===!0,a=n.animations??`css`,o=n.includeTypeAugmentation!==!1,s=t.filter(e=>e.category===`color`),c=K(s,`light`),l=K(s,`dark`),u=Z(c),d=Z(l.length>0?l:c),{lightPalette:f,darkPalette:p,lightBaseName:m,darkBaseName:g}=At(t),_=Mt(u,d),v=jt(c,m),y=jt(l.length>0?l:c,l.length>0?g:m),b=Rt(It({lightSemantic:v,darkSemantic:y,lightScales:u,darkScales:d,lightPalette:f,darkPalette:p}),{specName:e.name}),x=ct(K(t,`light`)),S=lt(c,l),C=[];Object.keys(S).length>0&&C.push(` color: ${q(S,4)}`);for(let e of rt){let t=x[e];t&&Object.keys(t).length>0&&C.push(` ${e}: ${q(t,4)}`)}let w=[];f&&w.push(` lightPalette: ${h(f)}`),p&&w.push(` darkPalette: ${h(p)}`),_&&w.push(` childrenThemes: ${_}`),(Object.keys(v).length>0||Object.keys(y).length>0)&&w.push(` getTheme: ({ theme, scheme }: { theme: any; scheme: "light" | "dark" }) => {
|
|
58
58
|
return scheme === "dark"
|
|
59
59
|
? ${ut(y,8)}
|
|
60
60
|
: ${ut(v,8)};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@razorwind/tamagui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.44",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Razorwind plugin that creates Tamagui theme tokens from Razorwind design tokens.",
|
|
6
6
|
"repository": {
|
|
@@ -85,10 +85,10 @@
|
|
|
85
85
|
"dependencies": {
|
|
86
86
|
"@power-plant/core": "^0.0.90",
|
|
87
87
|
"@power-plant/dtcg-schema": "^0.0.1",
|
|
88
|
-
"@razorwind/core": "^0.0.
|
|
89
|
-
"@stryke/type-checks": "^0.6.
|
|
90
|
-
"@stryke/helpers": "^0.10.
|
|
91
|
-
"@stryke/string-format": "^0.17.
|
|
88
|
+
"@razorwind/core": "^0.0.55",
|
|
89
|
+
"@stryke/type-checks": "^0.6.42",
|
|
90
|
+
"@stryke/helpers": "^0.10.49",
|
|
91
|
+
"@stryke/string-format": "^0.17.51"
|
|
92
92
|
},
|
|
93
93
|
"peerDependencies": {
|
|
94
94
|
"@tamagui/config": ">=1.120.0",
|
|
@@ -106,5 +106,5 @@
|
|
|
106
106
|
"typescript": "^6.0.3"
|
|
107
107
|
},
|
|
108
108
|
"publishConfig": { "access": "public" },
|
|
109
|
-
"gitHead": "
|
|
109
|
+
"gitHead": "a0e63cfffa72f4e3438a28e633cc72c29aa065fd"
|
|
110
110
|
}
|