@razorwind/core 0.0.6 → 0.0.7
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/config-DQHHeicR.d.mts +85 -0
- package/dist/config-DQHHeicR.d.mts.map +1 -0
- package/dist/config-Dj6RrLde.d.cts +85 -0
- package/dist/config-Dj6RrLde.d.cts.map +1 -0
- package/dist/config.cjs +1 -1
- package/dist/config.d.cts +13 -2
- package/dist/config.d.cts.map +1 -1
- package/dist/config.d.mts +13 -2
- package/dist/config.d.mts.map +1 -1
- package/dist/config.mjs +1 -1
- package/dist/generator-BWQOEMGt.mjs +2 -0
- package/dist/generator-BWQOEMGt.mjs.map +1 -0
- package/dist/generator-DQ1WS7hN.mjs +2 -0
- package/dist/generator-DQ1WS7hN.mjs.map +1 -0
- package/dist/generator-DjAElWpu.cjs +1 -0
- package/dist/generator-nWEM7jKK.cjs +1 -0
- package/dist/generator.cjs +1 -7
- package/dist/generator.d.cts +6 -6
- package/dist/generator.d.mts +6 -6
- package/dist/generator.mjs +1 -8
- package/dist/index--y-fo2Lr.d.mts +3 -0
- package/dist/index-COAOe8bR.d.cts +3 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +8 -4
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +8 -4
- package/dist/index.mjs +1 -1
- package/dist/lib/tokens/index.cjs +1 -0
- package/dist/lib/tokens/index.d.cts +150 -0
- package/dist/lib/tokens/index.d.cts.map +1 -0
- package/dist/lib/tokens/index.d.mts +150 -0
- package/dist/lib/tokens/index.d.mts.map +1 -0
- package/dist/lib/tokens/index.mjs +1 -0
- package/dist/plugin.cjs +1 -0
- package/dist/plugin.d.cts +43 -0
- package/dist/plugin.d.cts.map +1 -0
- package/dist/plugin.d.mts +43 -0
- package/dist/plugin.d.mts.map +1 -0
- package/dist/plugin.mjs +2 -0
- package/dist/plugin.mjs.map +1 -0
- package/dist/resolve-config-CBowa3KM.mjs +2 -0
- package/dist/resolve-config-CBowa3KM.mjs.map +1 -0
- package/dist/resolve-config-D7XXy_Qk.cjs +1 -0
- package/dist/rolldown-runtime-CMqjfN_6.cjs +1 -0
- package/dist/schema/index.cjs +1 -0
- package/dist/schema/index.d.cts +3 -0
- package/dist/schema/index.d.mts +3 -0
- package/dist/schema/index.mjs +1 -0
- package/dist/schema-1EWJvc56.d.cts +115 -0
- package/dist/schema-1EWJvc56.d.cts.map +1 -0
- package/dist/schema-BNfl9Tsw.d.mts +115 -0
- package/dist/schema-BNfl9Tsw.d.mts.map +1 -0
- package/dist/schema-Bxzw_P4l.mjs +2 -0
- package/dist/schema-Bxzw_P4l.mjs.map +1 -0
- package/dist/schema-CLeH9GGy.cjs +1 -0
- package/dist/tokens-B8Dv91EB.mjs +2 -0
- package/dist/tokens-B8Dv91EB.mjs.map +1 -0
- package/dist/tokens-CoQWg4mX.cjs +1 -0
- package/dist/utils/index.cjs +1 -0
- package/dist/utils/index.d.cts +37 -0
- package/dist/utils/index.d.cts.map +1 -0
- package/dist/utils/index.d.mts +37 -0
- package/dist/utils/index.d.mts.map +1 -0
- package/dist/utils/index.mjs +2 -0
- package/dist/utils/index.mjs.map +1 -0
- package/package.json +83 -28
- package/dist/config-CJi9Fu8b.d.cts +0 -40
- package/dist/config-CJi9Fu8b.d.cts.map +0 -1
- package/dist/config-CJi9Fu8b.d.mts +0 -40
- package/dist/config-CJi9Fu8b.d.mts.map +0 -1
- package/dist/generator.mjs.map +0 -1
- package/dist/index-8xt23rlo.d.mts +0 -15
- package/dist/index-8xt23rlo.d.mts.map +0 -1
- package/dist/index-DCXWFAYS.d.cts +0 -15
- package/dist/index-DCXWFAYS.d.cts.map +0 -1
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import z, { z as z$1 } from "zod";
|
|
2
|
+
import { Tokens } from "@power-plant/dtcg-schema";
|
|
3
|
+
//#region src/schema/components.d.ts
|
|
4
|
+
declare const componentFileSchema: z$1.ZodObject<{
|
|
5
|
+
path: z$1.ZodString;
|
|
6
|
+
type: z$1.ZodEnum<{
|
|
7
|
+
block: "block";
|
|
8
|
+
component: "component";
|
|
9
|
+
ui: "ui";
|
|
10
|
+
page: "page";
|
|
11
|
+
file: "file";
|
|
12
|
+
lib: "lib";
|
|
13
|
+
hook: "hook";
|
|
14
|
+
theme: "theme";
|
|
15
|
+
style: "style";
|
|
16
|
+
base: "base";
|
|
17
|
+
font: "font";
|
|
18
|
+
item: "item";
|
|
19
|
+
}>;
|
|
20
|
+
content: z$1.ZodOptional<z$1.ZodString>;
|
|
21
|
+
target: z$1.ZodOptional<z$1.ZodString>;
|
|
22
|
+
}, z$1.core.$strip>;
|
|
23
|
+
type ComponentFile = z$1.infer<typeof componentFileSchema>;
|
|
24
|
+
declare const componentSchema: z$1.ZodObject<{
|
|
25
|
+
name: z$1.ZodString;
|
|
26
|
+
title: z$1.ZodString;
|
|
27
|
+
type: z$1.ZodOptional<z$1.ZodEnum<{
|
|
28
|
+
block: "block";
|
|
29
|
+
component: "component";
|
|
30
|
+
ui: "ui";
|
|
31
|
+
page: "page";
|
|
32
|
+
}>>;
|
|
33
|
+
category: z$1.ZodOptional<z$1.ZodString>;
|
|
34
|
+
description: z$1.ZodOptional<z$1.ZodString>;
|
|
35
|
+
tags: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
36
|
+
related: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
37
|
+
since: z$1.ZodOptional<z$1.ZodString>;
|
|
38
|
+
version: z$1.ZodOptional<z$1.ZodString>;
|
|
39
|
+
repository: z$1.ZodOptional<z$1.ZodString>;
|
|
40
|
+
homepage: z$1.ZodOptional<z$1.ZodString>;
|
|
41
|
+
dependencies: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
|
|
42
|
+
devDependencies: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
|
|
43
|
+
registryDependencies: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
|
|
44
|
+
files: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
|
|
45
|
+
path: z$1.ZodString;
|
|
46
|
+
type: z$1.ZodEnum<{
|
|
47
|
+
block: "block";
|
|
48
|
+
component: "component";
|
|
49
|
+
ui: "ui";
|
|
50
|
+
page: "page";
|
|
51
|
+
file: "file";
|
|
52
|
+
lib: "lib";
|
|
53
|
+
hook: "hook";
|
|
54
|
+
theme: "theme";
|
|
55
|
+
style: "style";
|
|
56
|
+
base: "base";
|
|
57
|
+
font: "font";
|
|
58
|
+
item: "item";
|
|
59
|
+
}>;
|
|
60
|
+
content: z$1.ZodOptional<z$1.ZodString>;
|
|
61
|
+
target: z$1.ZodOptional<z$1.ZodString>;
|
|
62
|
+
}, z$1.core.$strip>>>;
|
|
63
|
+
}, z$1.core.$strip>;
|
|
64
|
+
type Component = z$1.infer<typeof componentSchema>;
|
|
65
|
+
declare const componentsSchema: z$1.ZodRecord<z$1.ZodString, z$1.ZodObject<{
|
|
66
|
+
name: z$1.ZodString;
|
|
67
|
+
title: z$1.ZodString;
|
|
68
|
+
type: z$1.ZodOptional<z$1.ZodEnum<{
|
|
69
|
+
block: "block";
|
|
70
|
+
component: "component";
|
|
71
|
+
ui: "ui";
|
|
72
|
+
page: "page";
|
|
73
|
+
}>>;
|
|
74
|
+
category: z$1.ZodOptional<z$1.ZodString>;
|
|
75
|
+
description: z$1.ZodOptional<z$1.ZodString>;
|
|
76
|
+
tags: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
77
|
+
related: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
78
|
+
since: z$1.ZodOptional<z$1.ZodString>;
|
|
79
|
+
version: z$1.ZodOptional<z$1.ZodString>;
|
|
80
|
+
repository: z$1.ZodOptional<z$1.ZodString>;
|
|
81
|
+
homepage: z$1.ZodOptional<z$1.ZodString>;
|
|
82
|
+
dependencies: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
|
|
83
|
+
devDependencies: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
|
|
84
|
+
registryDependencies: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
|
|
85
|
+
files: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
|
|
86
|
+
path: z$1.ZodString;
|
|
87
|
+
type: z$1.ZodEnum<{
|
|
88
|
+
block: "block";
|
|
89
|
+
component: "component";
|
|
90
|
+
ui: "ui";
|
|
91
|
+
page: "page";
|
|
92
|
+
file: "file";
|
|
93
|
+
lib: "lib";
|
|
94
|
+
hook: "hook";
|
|
95
|
+
theme: "theme";
|
|
96
|
+
style: "style";
|
|
97
|
+
base: "base";
|
|
98
|
+
font: "font";
|
|
99
|
+
item: "item";
|
|
100
|
+
}>;
|
|
101
|
+
content: z$1.ZodOptional<z$1.ZodString>;
|
|
102
|
+
target: z$1.ZodOptional<z$1.ZodString>;
|
|
103
|
+
}, z$1.core.$strip>>>;
|
|
104
|
+
}, z$1.core.$strip>>;
|
|
105
|
+
type Components = z$1.infer<typeof componentsSchema>;
|
|
106
|
+
//#endregion
|
|
107
|
+
//#region src/schema/schema.d.ts
|
|
108
|
+
interface Schema {
|
|
109
|
+
components: Components;
|
|
110
|
+
tokens: Tokens | Record<string, Tokens>;
|
|
111
|
+
}
|
|
112
|
+
declare const schema: z.ZodType<Schema>;
|
|
113
|
+
//#endregion
|
|
114
|
+
export { Components as a, componentsSchema as c, ComponentFile as i, schema as n, componentFileSchema as o, Component as r, componentSchema as s, Schema as t };
|
|
115
|
+
//# sourceMappingURL=schema-BNfl9Tsw.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-BNfl9Tsw.d.mts","names":[],"sources":["../src/schema/components.ts","../src/schema/schema.ts"],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import e,{z as t}from"zod";import{tokenSchema as n,tokensSchema as r,tokensSchema as i}from"@power-plant/dtcg-schema";const a=t.object({path:t.string(),type:t.enum([`lib`,`block`,`component`,`ui`,`hook`,`theme`,`page`,`file`,`style`,`base`,`font`,`item`]),content:t.string().optional(),target:t.string().optional().describe(`The target path of the file. This is the path to the file in the project. Supports registry target placeholders @components/, @ui/, @lib/, and @hooks/, which resolve to the corresponding aliases configured in components.json. These placeholders are independent of the project's import prefix.`)}),o=t.object({name:t.string(),title:t.string(),type:t.enum([`block`,`component`,`ui`,`page`]).optional(),category:t.string().optional(),description:t.string().optional(),tags:t.array(t.string()).optional(),related:t.array(t.string()).optional(),since:t.string().optional(),version:t.string().optional(),repository:t.string().optional(),homepage:t.string().optional(),dependencies:t.record(t.string(),t.string()).optional(),devDependencies:t.record(t.string(),t.string()).optional(),registryDependencies:t.record(t.string(),t.string()).optional(),files:t.array(a).optional()}),s=t.record(t.string(),o),c=e.union([r,e.record(e.string(),r)]),l=e.object({tokens:c,components:s});export{o as a,a as i,i as n,s as o,l as r,n as t};
|
|
2
|
+
//# sourceMappingURL=schema-Bxzw_P4l.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-Bxzw_P4l.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./rolldown-runtime-CMqjfN_6.cjs");let t=require("zod");t=e.t(t,1);let n=require("@power-plant/dtcg-schema");const r=t.z.object({path:t.z.string(),type:t.z.enum([`lib`,`block`,`component`,`ui`,`hook`,`theme`,`page`,`file`,`style`,`base`,`font`,`item`]),content:t.z.string().optional(),target:t.z.string().optional().describe(`The target path of the file. This is the path to the file in the project. Supports registry target placeholders @components/, @ui/, @lib/, and @hooks/, which resolve to the corresponding aliases configured in components.json. These placeholders are independent of the project's import prefix.`)}),i=t.z.object({name:t.z.string(),title:t.z.string(),type:t.z.enum([`block`,`component`,`ui`,`page`]).optional(),category:t.z.string().optional(),description:t.z.string().optional(),tags:t.z.array(t.z.string()).optional(),related:t.z.array(t.z.string()).optional(),since:t.z.string().optional(),version:t.z.string().optional(),repository:t.z.string().optional(),homepage:t.z.string().optional(),dependencies:t.z.record(t.z.string(),t.z.string()).optional(),devDependencies:t.z.record(t.z.string(),t.z.string()).optional(),registryDependencies:t.z.record(t.z.string(),t.z.string()).optional(),files:t.z.array(r).optional()}),a=t.z.record(t.z.string(),i),o=t.default.union([n.tokensSchema,t.default.record(t.default.string(),n.tokensSchema)]),s=t.default.object({tokens:o,components:a});Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return s}});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{joinPaths as e}from"@stryke/path/join";import{isFunction as t}from"@stryke/type-checks/is-function";import{isSetString as n}from"@stryke/type-checks/is-set-string";import r from"style-dictionary";import{existsSync as i}from"@stryke/fs/exists";import{importModule as a}from"@stryke/fs/resolve";import o from"fast-glob";import{basename as s,isAbsolute as c,resolve as l}from"node:path";import u from"json5";import{parse as d}from"smol-toml";import{parse as ee}from"yaml";import{isDirectory as f}from"@stryke/fs/is-file";const p=[`razorwind-json`,`razorwind-yaml`,`razorwind-toml`,`razorwind-css`],m=[`json`,`json5`,`jsonc`,`yaml`,`yml`,`toml`,`css`,`js`,`mjs`,`cjs`,`ts`,`mts`,`cts`],h=m.join(`,`),g=[`tokens.json`,`tokens.json5`,`tokens.jsonc`,`tokens.yaml`,`tokens.yml`,`tokens.toml`,`tokens.css`,`design-tokens.json`,`design-tokens.yaml`,`design-tokens.yml`,`tokens`,`design-tokens`,`src/tokens`,`src/design-tokens`,`packages/tokens`,`style-dictionary.config.js`,`style-dictionary.config.mjs`,`style-dictionary.config.ts`,`sd.config.js`,`sd.config.mjs`,`sd.config.ts`],_=`**/*.{${h}}`,v=/^(light|dark|dim|high-contrast|hc|default|base|theme)([._-].+)?$/i,y={color:`color`,colours:`color`,colors:`color`,colour:`color`,palette:`color`,bg:`color`,background:`color`,foreground:`color`,fg:`color`,border:`color`,fill:`color`,stroke:`color`,spacing:`dimension`,space:`dimension`,size:`dimension`,sizes:`dimension`,sizing:`dimension`,gap:`dimension`,radius:`dimension`,radii:`dimension`,rounded:`dimension`,width:`dimension`,height:`dimension`,dimension:`dimension`,dimensions:`dimension`,duration:`duration`,durations:`duration`,time:`duration`,delay:`duration`,animation:`duration`,motion:`duration`,transition:`duration`,font:`fontFamily`,fonts:`fontFamily`,fontfamily:`fontFamily`,"font-family":`fontFamily`,typeface:`fontFamily`,fontweight:`fontWeight`,"font-weight":`fontWeight`,weight:`fontWeight`,opacity:`number`,opacities:`number`,zindex:`number`,"z-index":`number`,lineheight:`number`,"line-height":`number`,letterspacing:`dimension`,"letter-spacing":`dimension`,shadow:`shadow`,shadows:`shadow`,elevation:`shadow`,gradient:`gradient`,gradients:`gradient`,typography:`typography`,text:`typography`,cubicbezier:`cubicBezier`,easing:`cubicBezier`,ease:`cubicBezier`},te=/^#(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,b=/^rgba?\(\s*([+\d.]+%?)[\x09-\x0D\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*(?: |(?: \s*)?,)\s*([+\d.]+%?)[\x09-\x0D\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*(?: |(?: \s*)?,)\s*([+\d.]+%?)(?:\s*[,/]\s*([+\d.]+%?))?\s*\)$/i,x=/^hsla?\(\s*([+\d.]+)[\x09-\x0D\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*(?: |(?: \s*)?,)\s*([+\d.]+)%[\x09-\x0D\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*(?: |(?: \s*)?,)\s*([+\d.]+)%(?:\s*[,/]\s*([+\d.]+%?))?\s*\)$/i,ne=/^oklch\(\s*([+\d.]+%?|none)\s+([+\d.]+|none)\s+([+\d.]+|none)(?:\s*\/\s*([+\d.]+%?))?\s*\)$/i,re=/^([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*(px|rem|em|%|vh|vw|vmin|vmax|ch|ex|cm|mm|in|pt|pc)$/i,ie=/^([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*(ms|s)$/i,ae=/^cubic-bezier\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*\)$/i,S=/^var\(\s*(--[\w-]+)\s*(?:,\s*(?:\S.*|[\t\v\f \xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF]))?\)\s*$/i,C=/^\{[^{}]+\}$/,oe={thin:100,hairline:100,extralight:200,"extra-light":200,ultralight:200,light:300,normal:400,regular:400,book:400,medium:500,semibold:600,"semi-bold":600,demibold:600,bold:700,extrabold:800,"extra-bold":800,ultrabold:800,black:900,heavy:900},w=new Set([`px`,`rem`]);function T(e){return Math.min(1,Math.max(0,e))}function E(e,t=100){let n=e.trim();if(n.endsWith(`%`))return T(Number.parseFloat(n)/t);let r=Number.parseFloat(n);return T(r>1?r/255:r)}function se(e){let t=e.slice(1);return t.length===3||t.length===4?`#${[...t].map(e=>e+e).join(``)}`:(e.length===7||e.length,e)}function ce(e){let t=se(e.toLowerCase()).slice(1),n=Number.parseInt(t.slice(0,2),16)/255,r=Number.parseInt(t.slice(2,4),16)/255,i=Number.parseInt(t.slice(4,6),16)/255,a=t.length===8?Number.parseInt(t.slice(6,8),16)/255:void 0;return{colorSpace:`srgb`,components:[n,r,i],...a===void 0||a===1?{}:{alpha:a},hex:`#${t.slice(0,6)}`}}function le(e){return`{${e.replace(/^--/,``).split(`-`).filter(Boolean).join(`.`)}}`}function D(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function O(e){return`$value`in e||`value`in e||`$ref`in e||`ref`in e}function k(e){for(let t=e.length-1;t>=0;t--){let n=e[t]?.toLowerCase();if(!n)continue;let r=y[n];if(r)return r}}function A(e,t=[]){let n=k(t);if(typeof e==`string`){let r=e.trim();if(C.test(r))return{value:r,type:n};let i=r.match(S);if(i?.[1])return{value:le(i[1]),type:n};if(te.test(r))return{value:ce(r),type:`color`};let a=r.match(b);if(a){let e=[E(a[1]),E(a[2]),E(a[3])],t=a[4]?a[4].endsWith(`%`)?T(Number.parseFloat(a[4])/100):T(Number.parseFloat(a[4])):void 0;return{value:{colorSpace:`srgb`,components:e,...t===void 0||Number.isNaN(t)?{}:{alpha:t}},type:`color`}}let o=r.match(x);if(o)return{value:{colorSpace:`hsl`,components:[Number.parseFloat(o[1]),Number.parseFloat(o[2]),Number.parseFloat(o[3])],...o[4]?{alpha:o[4].endsWith(`%`)?T(Number.parseFloat(o[4])/100):T(Number.parseFloat(o[4]))}:{}},type:`color`};let s=r.match(ne);if(s){let e=e=>e===`none`?`none`:e.endsWith(`%`)?Number.parseFloat(e)/100:Number.parseFloat(e);return{value:{colorSpace:`oklch`,components:[e(s[1]),e(s[2]),e(s[3])],...s[4]?{alpha:s[4].endsWith(`%`)?T(Number.parseFloat(s[4])/100):T(Number.parseFloat(s[4]))}:{}},type:`color`}}let c=r.match(re);if(c){let e=c[2].toLowerCase(),t=Number.parseFloat(c[1]);return w.has(e)?{value:{value:t,unit:e},type:`dimension`}:{value:r,type:n===`dimension`?void 0:n}}let l=r.match(ie);if(l)return{value:{value:Number.parseFloat(l[1]),unit:l[2].toLowerCase()},type:`duration`};let u=r.match(ae);if(u)return{value:[Number.parseFloat(u[1]),Number.parseFloat(u[2]),Number.parseFloat(u[3]),Number.parseFloat(u[4])],type:`cubicBezier`};let d=oe[r.toLowerCase()];return d===void 0?n===`fontFamily`||/family|font|typeface/i.test(t.at(-1)??``)?r.includes(`,`)?{value:r.split(`,`).map(e=>e.trim().replace(/^["']|["']$/g,``)),type:`fontFamily`}:{value:r.replace(/^["']|["']$/g,``),type:`fontFamily`}:n===`color`&&!r.startsWith(`{`)?{value:r,type:void 0}:{value:r,type:n}:{value:d,type:`fontWeight`}}if(typeof e==`number`)return n===`fontWeight`?{value:e,type:`fontWeight`}:n===`duration`?{value:{value:e,unit:`ms`},type:`duration`}:n===`dimension`?{value:{value:e,unit:`px`},type:`dimension`}:{value:e,type:n??`number`};if(Array.isArray(e))return e.length===4&&e.every(e=>typeof e==`number`)&&(n===`cubicBezier`||t.some(e=>/ease|bezier/i.test(e)))?{value:e,type:`cubicBezier`}:e.every(e=>typeof e==`string`)?{value:e,type:n??`fontFamily`}:{value:e,type:n};if(D(e)){if(`colorSpace`in e&&`components`in e)return{value:e,type:`color`};if(`value`in e&&`unit`in e){let t=String(e.unit).toLowerCase();return t===`ms`||t===`s`?{value:e,type:`duration`}:w.has(t)?{value:e,type:`dimension`}:{value:e,type:n}}}return{value:e,type:n}}function ue(e,t){let n={...e};if(`value`in n&&!(`$value`in n)&&(n.$value=n.value,delete n.value),`type`in n&&!(`$type`in n)&&(n.$type=n.type,delete n.type),`comment`in n&&!(`$description`in n)&&(n.$description=n.comment,delete n.comment),`description`in n&&!(`$description`in n)&&(n.$description=n.description,delete n.description),`ref`in n&&!(`$ref`in n)&&(n.$ref=n.ref,delete n.ref),`$value`in n){let e=A(n.$value,t);n.$value=e.value,!(`$type`in n)&&e.type&&(n.$type=e.type)}return n}function j(e,t=[]){if(Array.isArray(e))return e.map((e,n)=>j(e,[...t,String(n)]));if(!D(e))return e;if(O(e))return ue(e,t);let n={};for(let[r,i]of Object.entries(e)){if(r.startsWith(`$`)){n[r]=i;continue}n[r]=j(i,[...t,r])}if(!(`$type`in n)){let e=k(t);e&&t.length>0&&(n.$type=e)}return n}function M(e){let t={};for(let[n,r]of Object.entries(e)){let e=n.replace(/^--/,``).split(/[-./]/).filter(Boolean);if(e.length===0)continue;let i=t;for(let t=0;t<e.length-1;t++){let n=e[t],r=i[n];D(r)?O(r)&&(i[n]={DEFAULT:r}):i[n]={},i=i[n]}let a=e.at(-1),o=A(r,e),s={$value:o.value,...o.type?{$type:o.type}:{}},c=i[a];D(c)&&!O(c)?c.DEFAULT=s:i[a]=s}return j(t)}const de=/(--[A-Z_][\w-]*)\s*:\s*([^;}{]+?)(?=\s*(?:;|\}|$))/gi;function N(e){let t={},n=e.replace(/\/\*[\s\S]*?\*\//g,``);for(let e of n.matchAll(de)){let n=e[1],r=e[2]?.trim();!n||!r||(t[n]=r)}return M(t)}const P=`razorwind-infer`;function F(e){if(e==null)return{};if(typeof e!=`object`||Array.isArray(e))throw TypeError(`Token file must parse to a plain object.`);return j(e)}function fe(e){try{return F(u.parse(e))}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Failed to parse JSON token file: ${t}`)}}function I(e){try{return F(ee(e))}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Failed to parse YAML token file: ${t}`)}}function L(e){try{return F(d(e))}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Failed to parse TOML token file: ${t}`)}}const R=[{name:`razorwind-json`,pattern:/\.json[c5]?$/i,parser:({contents:e})=>fe(e)},{name:`razorwind-yaml`,pattern:/\.ya?ml$/i,parser:({contents:e})=>I(e)},{name:`razorwind-toml`,pattern:/\.toml$/i,parser:({contents:e})=>L(e)},{name:`razorwind-css`,pattern:/\.css$/i,parser:({contents:e})=>j(N(e))}];function z(){return Object.fromEntries(R.map(({name:e,pattern:t,parser:n})=>[e,{pattern:t,parser:n}]))}function B(e){return j(e)}function V(){return{[P]:B}}function H(e=[],n=r){for(let e of R)n.registerParser(e);n.registerPreprocessor({name:P,preprocessor:B});let i=0,a=0;for(let r of e){for(let e of r.parsers??[])n.registerParser({name:e.name??`${r.name}-parser-${i}`,pattern:e.pattern,parser:({contents:t})=>e.parser(t)}),i++;for(let e of r.preprocessors??[])n.registerPreprocessor(t(e)?{name:`${r.name}-preprocessor-${a}`,preprocessor:e}:{name:e.name??`${r.name}-preprocessor-${a}`,preprocessor:e.preprocessor}),a++}}function U(e,t){return c(t)?t:l(e,t)}function W(e){return/\.([^.]+)$/.exec(e)?.[1]?.toLowerCase()??``}function G(e){return m.includes(W(e))}function K(e){let t=e.split(/[/\\]/).pop()?.toLowerCase()??``;return t.startsWith(`style-dictionary.config.`)||t.startsWith(`sd.config.`)}function q(t){return e(t,_)}function J(e){let{cwd:t,tokensPath:n,fallbackPaths:r=[]}=e;if(n){let e=U(t,n);if(!i(e))throw Error(`tokensPath "${n}" does not exist (resolved: ${e}).`);return f(e)?{resolvedPath:e,source:[q(e)],origin:`tokensPath`}:K(e)?{resolvedPath:e,source:[],origin:`tokensPath`}:{resolvedPath:e,source:[e],origin:`tokensPath`}}for(let e of g){let n=U(t,e);if(i(n)){if(f(n))return{resolvedPath:n,source:[q(n)],origin:`default`};if(K(n))return{resolvedPath:n,source:[],origin:`default`};if(G(n))return{resolvedPath:n,source:[n],origin:`default`}}}for(let e of r){if(!e)continue;let n=U(t,e);if(!(!i(n)||f(n))&&(G(n)||W(n)===`css`))return{resolvedPath:n,source:[n],origin:`fallback`}}return{source:[],origin:`none`}}function Y(e){return(e.split(/[/\\]/).pop()??``).replace(/\.[^.]+$/,``).match(v)?.[1]?.toLowerCase()}function pe(e){H(e.plugins,r)}function X(e){return!e||typeof e!=`object`||Object.keys(e).length===0}async function me(e){let t=await a(e);return t&&typeof t==`object`&&`default`in t&&t.default?t.default:t}async function Z(e,t){pe(e);let n=new r({...t,parsers:[...p,...t.parsers??[]],preprocessors:[P,...t.preprocessors??[]],hooks:{...t.hooks,parsers:{...z(),...t.hooks?.parsers},preprocessors:{...V(),...t.hooks?.preprocessors}},usesDtcg:t.usesDtcg??!0,platforms:t.platforms??{}});return await n.hasInitialized,n}async function Q(e,t){return t.length===0?{}:(await Z(e,{source:t})).tokens}async function he(e){return(await o(e,{absolute:!0,onlyFiles:!0,unique:!0})).sort()}async function ge(e,t){let n=await he(t);if(n.length===0)return{};let r=new Map,i=[];for(let e of n){let t=Y(e);if(t){let n=r.get(t)??[];n.push(e),r.set(t,n)}else i.push(e)}if(r.size<2)return Q(e,t);let a={};if(i.length>0){let t=await Q(e,i);X(t)||(a.base=t)}for(let[t,n]of r)a[t]=await Q(e,n);return a}async function $(e,t){let{splitThemes:n=!0,...r}=t,a=J(r);return a.resolvedPath&&i(a.resolvedPath)&&/(?:^|[/\\])(?:style-dictionary|sd)\.config\./i.test(s(a.resolvedPath))?(await Z(e,await me(a.resolvedPath))).tokens:a.source.length===0?{}:n?ge(e,a.source):Q(e,a.source)}async function _e(e,t){let r=await $(e,t);if(X(r)){let e=n(t.tokensPath)?`tokensPath="${t.tokensPath}"`:`default token paths / CSS fallbacks`;throw Error(`No design tokens found via ${e}. Provide tokensPath or add a tokens file.`)}return r}export{_,P as a,y as b,B as c,k as d,A as f,v as g,g as h,Y as i,H as l,j as m,_e as n,z as o,M as p,J as r,V as s,$ as t,N as u,m as v,p as y};
|
|
2
|
+
//# sourceMappingURL=tokens-B8Dv91EB.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens-B8Dv91EB.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./rolldown-runtime-CMqjfN_6.cjs");let t=require("@stryke/path/join"),n=require("@stryke/type-checks/is-function"),r=require("@stryke/type-checks/is-set-string"),i=require("style-dictionary");i=e.t(i,1);let a=require("@stryke/fs/exists"),o=require("@stryke/fs/resolve"),s=require("fast-glob");s=e.t(s,1);let c=require("node:path"),l=require("json5");l=e.t(l,1);let u=require("smol-toml"),d=require("yaml"),f=require("@stryke/fs/is-file");const p=[`razorwind-json`,`razorwind-yaml`,`razorwind-toml`,`razorwind-css`],m=[`json`,`json5`,`jsonc`,`yaml`,`yml`,`toml`,`css`,`js`,`mjs`,`cjs`,`ts`,`mts`,`cts`],ee=m.join(`,`),h=[`tokens.json`,`tokens.json5`,`tokens.jsonc`,`tokens.yaml`,`tokens.yml`,`tokens.toml`,`tokens.css`,`design-tokens.json`,`design-tokens.yaml`,`design-tokens.yml`,`tokens`,`design-tokens`,`src/tokens`,`src/design-tokens`,`packages/tokens`,`style-dictionary.config.js`,`style-dictionary.config.mjs`,`style-dictionary.config.ts`,`sd.config.js`,`sd.config.mjs`,`sd.config.ts`],g=`**/*.{${ee}}`,_=/^(light|dark|dim|high-contrast|hc|default|base|theme)([._-].+)?$/i,v={color:`color`,colours:`color`,colors:`color`,colour:`color`,palette:`color`,bg:`color`,background:`color`,foreground:`color`,fg:`color`,border:`color`,fill:`color`,stroke:`color`,spacing:`dimension`,space:`dimension`,size:`dimension`,sizes:`dimension`,sizing:`dimension`,gap:`dimension`,radius:`dimension`,radii:`dimension`,rounded:`dimension`,width:`dimension`,height:`dimension`,dimension:`dimension`,dimensions:`dimension`,duration:`duration`,durations:`duration`,time:`duration`,delay:`duration`,animation:`duration`,motion:`duration`,transition:`duration`,font:`fontFamily`,fonts:`fontFamily`,fontfamily:`fontFamily`,"font-family":`fontFamily`,typeface:`fontFamily`,fontweight:`fontWeight`,"font-weight":`fontWeight`,weight:`fontWeight`,opacity:`number`,opacities:`number`,zindex:`number`,"z-index":`number`,lineheight:`number`,"line-height":`number`,letterspacing:`dimension`,"letter-spacing":`dimension`,shadow:`shadow`,shadows:`shadow`,elevation:`shadow`,gradient:`gradient`,gradients:`gradient`,typography:`typography`,text:`typography`,cubicbezier:`cubicBezier`,easing:`cubicBezier`,ease:`cubicBezier`},te=/^#(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,y=/^rgba?\(\s*([+\d.]+%?)[\x09-\x0D\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*(?: |(?: \s*)?,)\s*([+\d.]+%?)[\x09-\x0D\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*(?: |(?: \s*)?,)\s*([+\d.]+%?)(?:\s*[,/]\s*([+\d.]+%?))?\s*\)$/i,ne=/^hsla?\(\s*([+\d.]+)[\x09-\x0D\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*(?: |(?: \s*)?,)\s*([+\d.]+)%[\x09-\x0D\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*(?: |(?: \s*)?,)\s*([+\d.]+)%(?:\s*[,/]\s*([+\d.]+%?))?\s*\)$/i,re=/^oklch\(\s*([+\d.]+%?|none)\s+([+\d.]+|none)\s+([+\d.]+|none)(?:\s*\/\s*([+\d.]+%?))?\s*\)$/i,ie=/^([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*(px|rem|em|%|vh|vw|vmin|vmax|ch|ex|cm|mm|in|pt|pc)$/i,ae=/^([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*(ms|s)$/i,b=/^cubic-bezier\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*\)$/i,oe=/^var\(\s*(--[\w-]+)\s*(?:,\s*(?:\S.*|[\t\v\f \xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF]))?\)\s*$/i,x=/^\{[^{}]+\}$/,se={thin:100,hairline:100,extralight:200,"extra-light":200,ultralight:200,light:300,normal:400,regular:400,book:400,medium:500,semibold:600,"semi-bold":600,demibold:600,bold:700,extrabold:800,"extra-bold":800,ultrabold:800,black:900,heavy:900},S=new Set([`px`,`rem`]);function C(e){return Math.min(1,Math.max(0,e))}function w(e,t=100){let n=e.trim();if(n.endsWith(`%`))return C(Number.parseFloat(n)/t);let r=Number.parseFloat(n);return C(r>1?r/255:r)}function ce(e){let t=e.slice(1);return t.length===3||t.length===4?`#${[...t].map(e=>e+e).join(``)}`:(e.length===7||e.length,e)}function T(e){let t=ce(e.toLowerCase()).slice(1),n=Number.parseInt(t.slice(0,2),16)/255,r=Number.parseInt(t.slice(2,4),16)/255,i=Number.parseInt(t.slice(4,6),16)/255,a=t.length===8?Number.parseInt(t.slice(6,8),16)/255:void 0;return{colorSpace:`srgb`,components:[n,r,i],...a===void 0||a===1?{}:{alpha:a},hex:`#${t.slice(0,6)}`}}function E(e){return`{${e.replace(/^--/,``).split(`-`).filter(Boolean).join(`.`)}}`}function D(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function O(e){return`$value`in e||`value`in e||`$ref`in e||`ref`in e}function k(e){for(let t=e.length-1;t>=0;t--){let n=e[t]?.toLowerCase();if(!n)continue;let r=v[n];if(r)return r}}function A(e,t=[]){let n=k(t);if(typeof e==`string`){let r=e.trim();if(x.test(r))return{value:r,type:n};let i=r.match(oe);if(i?.[1])return{value:E(i[1]),type:n};if(te.test(r))return{value:T(r),type:`color`};let a=r.match(y);if(a){let e=[w(a[1]),w(a[2]),w(a[3])],t=a[4]?a[4].endsWith(`%`)?C(Number.parseFloat(a[4])/100):C(Number.parseFloat(a[4])):void 0;return{value:{colorSpace:`srgb`,components:e,...t===void 0||Number.isNaN(t)?{}:{alpha:t}},type:`color`}}let o=r.match(ne);if(o)return{value:{colorSpace:`hsl`,components:[Number.parseFloat(o[1]),Number.parseFloat(o[2]),Number.parseFloat(o[3])],...o[4]?{alpha:o[4].endsWith(`%`)?C(Number.parseFloat(o[4])/100):C(Number.parseFloat(o[4]))}:{}},type:`color`};let s=r.match(re);if(s){let e=e=>e===`none`?`none`:e.endsWith(`%`)?Number.parseFloat(e)/100:Number.parseFloat(e);return{value:{colorSpace:`oklch`,components:[e(s[1]),e(s[2]),e(s[3])],...s[4]?{alpha:s[4].endsWith(`%`)?C(Number.parseFloat(s[4])/100):C(Number.parseFloat(s[4]))}:{}},type:`color`}}let c=r.match(ie);if(c){let e=c[2].toLowerCase(),t=Number.parseFloat(c[1]);return S.has(e)?{value:{value:t,unit:e},type:`dimension`}:{value:r,type:n===`dimension`?void 0:n}}let l=r.match(ae);if(l)return{value:{value:Number.parseFloat(l[1]),unit:l[2].toLowerCase()},type:`duration`};let u=r.match(b);if(u)return{value:[Number.parseFloat(u[1]),Number.parseFloat(u[2]),Number.parseFloat(u[3]),Number.parseFloat(u[4])],type:`cubicBezier`};let d=se[r.toLowerCase()];return d===void 0?n===`fontFamily`||/family|font|typeface/i.test(t.at(-1)??``)?r.includes(`,`)?{value:r.split(`,`).map(e=>e.trim().replace(/^["']|["']$/g,``)),type:`fontFamily`}:{value:r.replace(/^["']|["']$/g,``),type:`fontFamily`}:n===`color`&&!r.startsWith(`{`)?{value:r,type:void 0}:{value:r,type:n}:{value:d,type:`fontWeight`}}if(typeof e==`number`)return n===`fontWeight`?{value:e,type:`fontWeight`}:n===`duration`?{value:{value:e,unit:`ms`},type:`duration`}:n===`dimension`?{value:{value:e,unit:`px`},type:`dimension`}:{value:e,type:n??`number`};if(Array.isArray(e))return e.length===4&&e.every(e=>typeof e==`number`)&&(n===`cubicBezier`||t.some(e=>/ease|bezier/i.test(e)))?{value:e,type:`cubicBezier`}:e.every(e=>typeof e==`string`)?{value:e,type:n??`fontFamily`}:{value:e,type:n};if(D(e)){if(`colorSpace`in e&&`components`in e)return{value:e,type:`color`};if(`value`in e&&`unit`in e){let t=String(e.unit).toLowerCase();return t===`ms`||t===`s`?{value:e,type:`duration`}:S.has(t)?{value:e,type:`dimension`}:{value:e,type:n}}}return{value:e,type:n}}function le(e,t){let n={...e};if(`value`in n&&!(`$value`in n)&&(n.$value=n.value,delete n.value),`type`in n&&!(`$type`in n)&&(n.$type=n.type,delete n.type),`comment`in n&&!(`$description`in n)&&(n.$description=n.comment,delete n.comment),`description`in n&&!(`$description`in n)&&(n.$description=n.description,delete n.description),`ref`in n&&!(`$ref`in n)&&(n.$ref=n.ref,delete n.ref),`$value`in n){let e=A(n.$value,t);n.$value=e.value,!(`$type`in n)&&e.type&&(n.$type=e.type)}return n}function j(e,t=[]){if(Array.isArray(e))return e.map((e,n)=>j(e,[...t,String(n)]));if(!D(e))return e;if(O(e))return le(e,t);let n={};for(let[r,i]of Object.entries(e)){if(r.startsWith(`$`)){n[r]=i;continue}n[r]=j(i,[...t,r])}if(!(`$type`in n)){let e=k(t);e&&t.length>0&&(n.$type=e)}return n}function M(e){let t={};for(let[n,r]of Object.entries(e)){let e=n.replace(/^--/,``).split(/[-./]/).filter(Boolean);if(e.length===0)continue;let i=t;for(let t=0;t<e.length-1;t++){let n=e[t],r=i[n];D(r)?O(r)&&(i[n]={DEFAULT:r}):i[n]={},i=i[n]}let a=e.at(-1),o=A(r,e),s={$value:o.value,...o.type?{$type:o.type}:{}},c=i[a];D(c)&&!O(c)?c.DEFAULT=s:i[a]=s}return j(t)}const ue=/(--[A-Z_][\w-]*)\s*:\s*([^;}{]+?)(?=\s*(?:;|\}|$))/gi;function N(e){let t={},n=e.replace(/\/\*[\s\S]*?\*\//g,``);for(let e of n.matchAll(ue)){let n=e[1],r=e[2]?.trim();!n||!r||(t[n]=r)}return M(t)}const P=`razorwind-infer`;function F(e){if(e==null)return{};if(typeof e!=`object`||Array.isArray(e))throw TypeError(`Token file must parse to a plain object.`);return j(e)}function de(e){try{return F(l.default.parse(e))}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Failed to parse JSON token file: ${t}`)}}function fe(e){try{return F((0,d.parse)(e))}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Failed to parse YAML token file: ${t}`)}}function I(e){try{return F((0,u.parse)(e))}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Failed to parse TOML token file: ${t}`)}}const L=[{name:`razorwind-json`,pattern:/\.json[c5]?$/i,parser:({contents:e})=>de(e)},{name:`razorwind-yaml`,pattern:/\.ya?ml$/i,parser:({contents:e})=>fe(e)},{name:`razorwind-toml`,pattern:/\.toml$/i,parser:({contents:e})=>I(e)},{name:`razorwind-css`,pattern:/\.css$/i,parser:({contents:e})=>j(N(e))}];function R(){return Object.fromEntries(L.map(({name:e,pattern:t,parser:n})=>[e,{pattern:t,parser:n}]))}function z(e){return j(e)}function B(){return{[P]:z}}function V(e=[],t=i.default){for(let e of L)t.registerParser(e);t.registerPreprocessor({name:P,preprocessor:z});let r=0,a=0;for(let i of e){for(let e of i.parsers??[])t.registerParser({name:e.name??`${i.name}-parser-${r}`,pattern:e.pattern,parser:({contents:t})=>e.parser(t)}),r++;for(let e of i.preprocessors??[])t.registerPreprocessor((0,n.isFunction)(e)?{name:`${i.name}-preprocessor-${a}`,preprocessor:e}:{name:e.name??`${i.name}-preprocessor-${a}`,preprocessor:e.preprocessor}),a++}}function H(e,t){return(0,c.isAbsolute)(t)?t:(0,c.resolve)(e,t)}function U(e){return/\.([^.]+)$/.exec(e)?.[1]?.toLowerCase()??``}function W(e){return m.includes(U(e))}function G(e){let t=e.split(/[/\\]/).pop()?.toLowerCase()??``;return t.startsWith(`style-dictionary.config.`)||t.startsWith(`sd.config.`)}function K(e){return(0,t.joinPaths)(e,g)}function q(e){let{cwd:t,tokensPath:n,fallbackPaths:r=[]}=e;if(n){let e=H(t,n);if(!(0,a.existsSync)(e))throw Error(`tokensPath "${n}" does not exist (resolved: ${e}).`);return(0,f.isDirectory)(e)?{resolvedPath:e,source:[K(e)],origin:`tokensPath`}:G(e)?{resolvedPath:e,source:[],origin:`tokensPath`}:{resolvedPath:e,source:[e],origin:`tokensPath`}}for(let e of h){let n=H(t,e);if((0,a.existsSync)(n)){if((0,f.isDirectory)(n))return{resolvedPath:n,source:[K(n)],origin:`default`};if(G(n))return{resolvedPath:n,source:[],origin:`default`};if(W(n))return{resolvedPath:n,source:[n],origin:`default`}}}for(let e of r){if(!e)continue;let n=H(t,e);if(!(!(0,a.existsSync)(n)||(0,f.isDirectory)(n))&&(W(n)||U(n)===`css`))return{resolvedPath:n,source:[n],origin:`fallback`}}return{source:[],origin:`none`}}function J(e){return(e.split(/[/\\]/).pop()??``).replace(/\.[^.]+$/,``).match(_)?.[1]?.toLowerCase()}function Y(e){V(e.plugins,i.default)}function X(e){return!e||typeof e!=`object`||Object.keys(e).length===0}async function pe(e){let t=await(0,o.importModule)(e);return t&&typeof t==`object`&&`default`in t&&t.default?t.default:t}async function Z(e,t){Y(e);let n=new i.default({...t,parsers:[...p,...t.parsers??[]],preprocessors:[P,...t.preprocessors??[]],hooks:{...t.hooks,parsers:{...R(),...t.hooks?.parsers},preprocessors:{...B(),...t.hooks?.preprocessors}},usesDtcg:t.usesDtcg??!0,platforms:t.platforms??{}});return await n.hasInitialized,n}async function Q(e,t){return t.length===0?{}:(await Z(e,{source:t})).tokens}async function me(e){return(await(0,s.default)(e,{absolute:!0,onlyFiles:!0,unique:!0})).sort()}async function he(e,t){let n=await me(t);if(n.length===0)return{};let r=new Map,i=[];for(let e of n){let t=J(e);if(t){let n=r.get(t)??[];n.push(e),r.set(t,n)}else i.push(e)}if(r.size<2)return Q(e,t);let a={};if(i.length>0){let t=await Q(e,i);X(t)||(a.base=t)}for(let[t,n]of r)a[t]=await Q(e,n);return a}async function $(e,t){let{splitThemes:n=!0,...r}=t,i=q(r);return i.resolvedPath&&(0,a.existsSync)(i.resolvedPath)&&/(?:^|[/\\])(?:style-dictionary|sd)\.config\./i.test((0,c.basename)(i.resolvedPath))?(await Z(e,await pe(i.resolvedPath))).tokens:i.source.length===0?{}:n?he(e,i.source):Q(e,i.source)}async function ge(e,t){let n=await $(e,t);if(X(n)){let e=(0,r.isSetString)(t.tokensPath)?`tokensPath="${t.tokensPath}"`:`default token paths / CSS fallbacks`;throw Error(`No design tokens found via ${e}. Provide tokensPath or add a tokens file.`)}return n}Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return p}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});function e(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function t(t){if(typeof t==`string`)return t;if(!e(t))return;if(typeof t.hex==`string`){let e=typeof t.alpha==`number`&&t.alpha<1?Math.round(t.alpha*255).toString(16).padStart(2,`0`):``;return`${t.hex}${e}`}let n=typeof t.colorSpace==`string`?t.colorSpace:void 0,r=Array.isArray(t.components)?t.components:void 0;if(!n||!r)return;let i=typeof t.alpha==`number`&&t.alpha<1?` / ${t.alpha}`:``;if(n===`srgb`&&r.length>=3){let[e,t,n]=r;if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`)return`rgb(${Math.round(e*255)} ${Math.round(t*255)} ${Math.round(n*255)}${i})`}return`${n}(${r.map(e=>String(e)).join(` `)}${i})`}function n(t){if(typeof t==`number`)return String(t);if(typeof t==`string`)return t;if(e(t)&&typeof t.value==`number`&&typeof t.unit==`string`)return`${t.value}${t.unit}`}function r(r,i){if(typeof r==`string`)return r;if(typeof r==`number`||typeof r==`boolean`)return String(r);if(i===`color`||!i&&e(r)&&`colorSpace`in r){let e=t(r);if(e)return e}if(i===`dimension`||i===`duration`||e(r)&&`value`in r&&`unit`in r){let e=n(r);if(e)return e}if(i===`cubicBezier`&&Array.isArray(r))return`cubic-bezier(${r.join(`, `)})`;if(Array.isArray(r))return r.map(String).join(`, `);if(e(r)){let e=t(r);if(e)return e;let i=n(r);if(i)return i}try{return JSON.stringify(r)}catch{return String(r)}}function i(e,t){return`--${t}-${e.split(`.`).filter(Boolean).join(`-`).replaceAll(/[^\w-]+/g,`-`)}`}function a(e,t,n,r){return{path:e,language:r,chunks:[{content:t,meta:n}]}}exports.createDocument=a,exports.formatColorValue=t,exports.formatDimensionValue=n,exports.formatTokenValue=r,exports.isPlainObject=e,exports.toCssVar=i;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { GeneratorFunctionResult } from "@power-plant/core";
|
|
2
|
+
//#region src/utils/index.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Type guard for plain (non-array, non-null) objects.
|
|
5
|
+
*/
|
|
6
|
+
declare function isPlainObject(value: unknown): value is Record<string, unknown>;
|
|
7
|
+
/**
|
|
8
|
+
* Convert a DTCG color `$value` (string, hex/alpha object, or
|
|
9
|
+
* colorSpace/components object) into a CSS-friendly color string.
|
|
10
|
+
*/
|
|
11
|
+
declare function formatColorValue(value: unknown): string | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Convert a DTCG dimension/duration `$value` (number, string, or
|
|
14
|
+
* value/unit object) into a CSS-friendly string.
|
|
15
|
+
*/
|
|
16
|
+
declare function formatDimensionValue(value: unknown): string | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Convert a DTCG `$value` into a CSS-friendly string, dispatching on `type`
|
|
19
|
+
* (or, when `type` is omitted, on the shape of `value`).
|
|
20
|
+
*/
|
|
21
|
+
declare function formatTokenValue(value: unknown, type?: string): string;
|
|
22
|
+
/**
|
|
23
|
+
* Convert a token path into a CSS custom property name.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* toCssVar("color.primary", "rw") // "--rw-color-primary"
|
|
27
|
+
*/
|
|
28
|
+
declare function toCssVar(path: string, prefix: string): string;
|
|
29
|
+
/**
|
|
30
|
+
* Build a single-chunk generator result document entry.
|
|
31
|
+
*/
|
|
32
|
+
declare function createDocument<TSchema, TOptions>(path: string, content: string, meta: {
|
|
33
|
+
name: string;
|
|
34
|
+
}, language?: string): GeneratorFunctionResult<TSchema, TOptions>[string];
|
|
35
|
+
//#endregion
|
|
36
|
+
export { createDocument, formatColorValue, formatDimensionValue, formatTokenValue, isPlainObject, toCssVar };
|
|
37
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/utils/index.ts"],"mappings":";;;;;iBAuBgB,cACd,iBACC,SAAS;;;;;iBAQI,iBAAiB;;;;;iBAuDjB,qBAAqB;;;;;iBAwBrB,iBAAiB,gBAAgB;;;;;;;iBA+DjC,SAAS,cAAc;;;;iBAavB,eAAe,SAAS,UACtC,cACA,iBACA;EAAQ;GACR,oBACC,wBAAwB,SAAS"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { GeneratorFunctionResult } from "@power-plant/core";
|
|
2
|
+
//#region src/utils/index.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Type guard for plain (non-array, non-null) objects.
|
|
5
|
+
*/
|
|
6
|
+
declare function isPlainObject(value: unknown): value is Record<string, unknown>;
|
|
7
|
+
/**
|
|
8
|
+
* Convert a DTCG color `$value` (string, hex/alpha object, or
|
|
9
|
+
* colorSpace/components object) into a CSS-friendly color string.
|
|
10
|
+
*/
|
|
11
|
+
declare function formatColorValue(value: unknown): string | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Convert a DTCG dimension/duration `$value` (number, string, or
|
|
14
|
+
* value/unit object) into a CSS-friendly string.
|
|
15
|
+
*/
|
|
16
|
+
declare function formatDimensionValue(value: unknown): string | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Convert a DTCG `$value` into a CSS-friendly string, dispatching on `type`
|
|
19
|
+
* (or, when `type` is omitted, on the shape of `value`).
|
|
20
|
+
*/
|
|
21
|
+
declare function formatTokenValue(value: unknown, type?: string): string;
|
|
22
|
+
/**
|
|
23
|
+
* Convert a token path into a CSS custom property name.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* toCssVar("color.primary", "rw") // "--rw-color-primary"
|
|
27
|
+
*/
|
|
28
|
+
declare function toCssVar(path: string, prefix: string): string;
|
|
29
|
+
/**
|
|
30
|
+
* Build a single-chunk generator result document entry.
|
|
31
|
+
*/
|
|
32
|
+
declare function createDocument<TSchema, TOptions>(path: string, content: string, meta: {
|
|
33
|
+
name: string;
|
|
34
|
+
}, language?: string): GeneratorFunctionResult<TSchema, TOptions>[string];
|
|
35
|
+
//#endregion
|
|
36
|
+
export { createDocument, formatColorValue, formatDimensionValue, formatTokenValue, isPlainObject, toCssVar };
|
|
37
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/utils/index.ts"],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function e(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function t(t){if(typeof t==`string`)return t;if(!e(t))return;if(typeof t.hex==`string`){let e=typeof t.alpha==`number`&&t.alpha<1?Math.round(t.alpha*255).toString(16).padStart(2,`0`):``;return`${t.hex}${e}`}let n=typeof t.colorSpace==`string`?t.colorSpace:void 0,r=Array.isArray(t.components)?t.components:void 0;if(!n||!r)return;let i=typeof t.alpha==`number`&&t.alpha<1?` / ${t.alpha}`:``;if(n===`srgb`&&r.length>=3){let[e,t,n]=r;if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`)return`rgb(${Math.round(e*255)} ${Math.round(t*255)} ${Math.round(n*255)}${i})`}return`${n}(${r.map(e=>String(e)).join(` `)}${i})`}function n(t){if(typeof t==`number`)return String(t);if(typeof t==`string`)return t;if(e(t)&&typeof t.value==`number`&&typeof t.unit==`string`)return`${t.value}${t.unit}`}function r(r,i){if(typeof r==`string`)return r;if(typeof r==`number`||typeof r==`boolean`)return String(r);if(i===`color`||!i&&e(r)&&`colorSpace`in r){let e=t(r);if(e)return e}if(i===`dimension`||i===`duration`||e(r)&&`value`in r&&`unit`in r){let e=n(r);if(e)return e}if(i===`cubicBezier`&&Array.isArray(r))return`cubic-bezier(${r.join(`, `)})`;if(Array.isArray(r))return r.map(String).join(`, `);if(e(r)){let e=t(r);if(e)return e;let i=n(r);if(i)return i}try{return JSON.stringify(r)}catch{return String(r)}}function i(e,t){return`--${t}-${e.split(`.`).filter(Boolean).join(`-`).replaceAll(/[^\w-]+/g,`-`)}`}function a(e,t,n,r){return{path:e,language:r,chunks:[{content:t,meta:n}]}}export{a as createDocument,t as formatColorValue,n as formatDimensionValue,r as formatTokenValue,e as isPlainObject,i as toCssVar};
|
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@razorwind/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "💨 Razorwind is a unified set of tools that make creating design systems a breeze.",
|
|
6
6
|
"keywords": ["razorwind", "storm-software"],
|
|
@@ -82,7 +82,63 @@
|
|
|
82
82
|
"default": "./dist/generator.mjs"
|
|
83
83
|
}
|
|
84
84
|
},
|
|
85
|
-
"./
|
|
85
|
+
"./lib/tokens": {
|
|
86
|
+
"require": {
|
|
87
|
+
"types": "./dist/lib/tokens/index.d.cts",
|
|
88
|
+
"default": "./dist/lib/tokens/index.cjs"
|
|
89
|
+
},
|
|
90
|
+
"import": {
|
|
91
|
+
"types": "./dist/lib/tokens/index.d.mts",
|
|
92
|
+
"default": "./dist/lib/tokens/index.mjs"
|
|
93
|
+
},
|
|
94
|
+
"default": {
|
|
95
|
+
"types": "./dist/lib/tokens/index.d.mts",
|
|
96
|
+
"default": "./dist/lib/tokens/index.mjs"
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"./package.json": "./package.json",
|
|
100
|
+
"./plugin": {
|
|
101
|
+
"require": {
|
|
102
|
+
"types": "./dist/plugin.d.cts",
|
|
103
|
+
"default": "./dist/plugin.cjs"
|
|
104
|
+
},
|
|
105
|
+
"import": {
|
|
106
|
+
"types": "./dist/plugin.d.mts",
|
|
107
|
+
"default": "./dist/plugin.mjs"
|
|
108
|
+
},
|
|
109
|
+
"default": {
|
|
110
|
+
"types": "./dist/plugin.d.mts",
|
|
111
|
+
"default": "./dist/plugin.mjs"
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"./schema": {
|
|
115
|
+
"require": {
|
|
116
|
+
"types": "./dist/schema/index.d.cts",
|
|
117
|
+
"default": "./dist/schema/index.cjs"
|
|
118
|
+
},
|
|
119
|
+
"import": {
|
|
120
|
+
"types": "./dist/schema/index.d.mts",
|
|
121
|
+
"default": "./dist/schema/index.mjs"
|
|
122
|
+
},
|
|
123
|
+
"default": {
|
|
124
|
+
"types": "./dist/schema/index.d.mts",
|
|
125
|
+
"default": "./dist/schema/index.mjs"
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
"./utils": {
|
|
129
|
+
"require": {
|
|
130
|
+
"types": "./dist/utils/index.d.cts",
|
|
131
|
+
"default": "./dist/utils/index.cjs"
|
|
132
|
+
},
|
|
133
|
+
"import": {
|
|
134
|
+
"types": "./dist/utils/index.d.mts",
|
|
135
|
+
"default": "./dist/utils/index.mjs"
|
|
136
|
+
},
|
|
137
|
+
"default": {
|
|
138
|
+
"types": "./dist/utils/index.d.mts",
|
|
139
|
+
"default": "./dist/utils/index.mjs"
|
|
140
|
+
}
|
|
141
|
+
}
|
|
86
142
|
},
|
|
87
143
|
"main": "./dist/index.cjs",
|
|
88
144
|
"module": "./dist/index.mjs",
|
|
@@ -90,34 +146,33 @@
|
|
|
90
146
|
"typings": "dist/index.d.mts",
|
|
91
147
|
"files": ["dist"],
|
|
92
148
|
"dependencies": {
|
|
93
|
-
"@power-plant/core": "
|
|
94
|
-
"@power-plant/dtcg-schema": "
|
|
95
|
-
"@power-plant/schema": "
|
|
96
|
-
"@power-plant/style-dictionary": "
|
|
97
|
-
"@power-plant/
|
|
98
|
-
"@stryke/
|
|
99
|
-
"@stryke/
|
|
100
|
-
"@stryke/
|
|
101
|
-
"@stryke/
|
|
102
|
-
"@stryke/
|
|
103
|
-
"@
|
|
104
|
-
"
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
"
|
|
108
|
-
"
|
|
109
|
-
"
|
|
110
|
-
"smol-toml": "
|
|
111
|
-
"style-dictionary": "
|
|
112
|
-
"
|
|
113
|
-
"
|
|
114
|
-
"yaml": "catalog:",
|
|
115
|
-
"zod": "catalog:"
|
|
149
|
+
"@power-plant/core": "^0.0.33",
|
|
150
|
+
"@power-plant/dtcg-schema": "^0.0.1",
|
|
151
|
+
"@power-plant/schema": "^0.0.32",
|
|
152
|
+
"@power-plant/style-dictionary": "^0.0.18",
|
|
153
|
+
"@power-plant/utils": "^0.0.19",
|
|
154
|
+
"@stryke/env": "^0.20.114",
|
|
155
|
+
"@stryke/fs": "^0.33.97",
|
|
156
|
+
"@stryke/path": "^0.29.23",
|
|
157
|
+
"@stryke/string-format": "^0.17.38",
|
|
158
|
+
"@stryke/type-checks": "^0.6.29",
|
|
159
|
+
"@stryke/types": "^0.12.24",
|
|
160
|
+
"@stryke/url": "^0.4.47",
|
|
161
|
+
"c12": "^3.3.4",
|
|
162
|
+
"defu": "^6.1.7",
|
|
163
|
+
"fast-glob": "^3.3.3",
|
|
164
|
+
"jiti": "^0.0.0",
|
|
165
|
+
"json5": "^2.2.3",
|
|
166
|
+
"smol-toml": "^1.7.0",
|
|
167
|
+
"style-dictionary": "^5.5.0",
|
|
168
|
+
"yaml": "^2.9.0",
|
|
169
|
+
"zod": "^4.4.3"
|
|
116
170
|
},
|
|
117
171
|
"devDependencies": {
|
|
118
|
-
"@powerlines/plugin-tsdown": "
|
|
119
|
-
"@types/node": "
|
|
172
|
+
"@powerlines/plugin-tsdown": "^0.1.555",
|
|
173
|
+
"@types/node": "^25.9.5",
|
|
120
174
|
"typescript": "^6.0.3"
|
|
121
175
|
},
|
|
122
|
-
"publishConfig": { "access": "public" }
|
|
176
|
+
"publishConfig": { "access": "public" },
|
|
177
|
+
"gitHead": "4ee11dd8a6fb1805d01c9e6776ead099d885f93a"
|
|
123
178
|
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
//#region src/types/config.d.ts
|
|
2
|
-
interface InputOptions {
|
|
3
|
-
/**
|
|
4
|
-
* The path to the registry.json file.
|
|
5
|
-
*
|
|
6
|
-
* @see https://shadcn.com/docs/registry
|
|
7
|
-
*/
|
|
8
|
-
registryPath?: string;
|
|
9
|
-
/**
|
|
10
|
-
* The directory or file containing the tokens.
|
|
11
|
-
*
|
|
12
|
-
* @see https://styledictionary.com/info/tokens/
|
|
13
|
-
*
|
|
14
|
-
* @defaultValue "tokens.json" (or "tokens" directory)
|
|
15
|
-
*/
|
|
16
|
-
tokensPath?: string;
|
|
17
|
-
}
|
|
18
|
-
interface Config extends InputOptions {
|
|
19
|
-
name?: string;
|
|
20
|
-
title?: string;
|
|
21
|
-
version?: string;
|
|
22
|
-
description?: string;
|
|
23
|
-
author?: string;
|
|
24
|
-
license?: string;
|
|
25
|
-
repository?: string;
|
|
26
|
-
homepage?: string;
|
|
27
|
-
tags?: string[];
|
|
28
|
-
}
|
|
29
|
-
interface UserConfigParams {
|
|
30
|
-
cwd: string;
|
|
31
|
-
mode: string;
|
|
32
|
-
}
|
|
33
|
-
type UserConfig = Config;
|
|
34
|
-
type UserConfigFnObject = (config: UserConfig) => UserConfig;
|
|
35
|
-
type UserConfigFnPromise = (params: UserConfigParams) => Promise<UserConfig | UserConfig[]>;
|
|
36
|
-
type UserConfigFn = (params: UserConfigParams) => UserConfig | UserConfig[] | Promise<UserConfig | UserConfig[]>;
|
|
37
|
-
type UserConfigExport = UserConfig | UserConfig[] | Promise<UserConfig | UserConfig[]> | UserConfigFnObject | UserConfigFnPromise | UserConfigFn;
|
|
38
|
-
//#endregion
|
|
39
|
-
export { UserConfigFn as a, UserConfigParams as c, UserConfigExport as i, InputOptions as n, UserConfigFnObject as o, UserConfig as r, UserConfigFnPromise as s, Config as t };
|
|
40
|
-
//# sourceMappingURL=config-CJi9Fu8b.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config-CJi9Fu8b.d.cts","names":[],"sources":["../src/types/config.ts"],"mappings":";UAkBiB;;;;;;EAMf;;;;;;;;EASA;;UAGe,eAAe;EAC9B;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;;KAGU,aAAa;KACb,sBAAsB,QAAQ,eAAe;KAC7C,uBACV,QAAQ,qBACL,QAAQ,aAAa;KACd,gBACV,QAAQ,qBACL,aAAa,eAAe,QAAQ,aAAa;KAC1C,mBACR,aACA,eACA,QAAQ,aAAa,gBACrB,qBACA,sBACA"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
//#region src/types/config.d.ts
|
|
2
|
-
interface InputOptions {
|
|
3
|
-
/**
|
|
4
|
-
* The path to the registry.json file.
|
|
5
|
-
*
|
|
6
|
-
* @see https://shadcn.com/docs/registry
|
|
7
|
-
*/
|
|
8
|
-
registryPath?: string;
|
|
9
|
-
/**
|
|
10
|
-
* The directory or file containing the tokens.
|
|
11
|
-
*
|
|
12
|
-
* @see https://styledictionary.com/info/tokens/
|
|
13
|
-
*
|
|
14
|
-
* @defaultValue "tokens.json" (or "tokens" directory)
|
|
15
|
-
*/
|
|
16
|
-
tokensPath?: string;
|
|
17
|
-
}
|
|
18
|
-
interface Config extends InputOptions {
|
|
19
|
-
name?: string;
|
|
20
|
-
title?: string;
|
|
21
|
-
version?: string;
|
|
22
|
-
description?: string;
|
|
23
|
-
author?: string;
|
|
24
|
-
license?: string;
|
|
25
|
-
repository?: string;
|
|
26
|
-
homepage?: string;
|
|
27
|
-
tags?: string[];
|
|
28
|
-
}
|
|
29
|
-
interface UserConfigParams {
|
|
30
|
-
cwd: string;
|
|
31
|
-
mode: string;
|
|
32
|
-
}
|
|
33
|
-
type UserConfig = Config;
|
|
34
|
-
type UserConfigFnObject = (config: UserConfig) => UserConfig;
|
|
35
|
-
type UserConfigFnPromise = (params: UserConfigParams) => Promise<UserConfig | UserConfig[]>;
|
|
36
|
-
type UserConfigFn = (params: UserConfigParams) => UserConfig | UserConfig[] | Promise<UserConfig | UserConfig[]>;
|
|
37
|
-
type UserConfigExport = UserConfig | UserConfig[] | Promise<UserConfig | UserConfig[]> | UserConfigFnObject | UserConfigFnPromise | UserConfigFn;
|
|
38
|
-
//#endregion
|
|
39
|
-
export { UserConfigFn as a, UserConfigParams as c, UserConfigExport as i, InputOptions as n, UserConfigFnObject as o, UserConfig as r, UserConfigFnPromise as s, Config as t };
|
|
40
|
-
//# sourceMappingURL=config-CJi9Fu8b.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config-CJi9Fu8b.d.mts","names":[],"sources":["../src/types/config.ts"],"mappings":""}
|
package/dist/generator.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generator.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { configSchema, rawConfigSchema } from "shadcn/schema";
|
|
2
|
-
import z, { z as z$1 } from "zod";
|
|
3
|
-
import { Tokens } from "@power-plant/dtcg-schema";
|
|
4
|
-
import { z as z$2 } from "zod/v3";
|
|
5
|
-
//#region src/registry/shadcn-types.d.ts
|
|
6
|
-
type ShadcnConfig = z$2.infer<typeof configSchema>;
|
|
7
|
-
//#endregion
|
|
8
|
-
//#region src/schema/schema.d.ts
|
|
9
|
-
interface Schema {
|
|
10
|
-
registry: ShadcnConfig;
|
|
11
|
-
tokens: Tokens | Record<string, Tokens>;
|
|
12
|
-
}
|
|
13
|
-
//#endregion
|
|
14
|
-
export { Schema as t };
|
|
15
|
-
//# sourceMappingURL=index-8xt23rlo.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-8xt23rlo.d.mts","names":[],"sources":["../src/registry/shadcn-types.ts","../src/schema/schema.ts"],"mappings":""}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import "zod";
|
|
2
|
-
import { Tokens } from "@power-plant/dtcg-schema";
|
|
3
|
-
import { configSchema } from "shadcn/schema";
|
|
4
|
-
import { z } from "zod/v3";
|
|
5
|
-
//#region src/registry/shadcn-types.d.ts
|
|
6
|
-
type ShadcnConfig = z.infer<typeof configSchema>;
|
|
7
|
-
//#endregion
|
|
8
|
-
//#region src/schema/schema.d.ts
|
|
9
|
-
interface Schema {
|
|
10
|
-
registry: ShadcnConfig;
|
|
11
|
-
tokens: Tokens | Record<string, Tokens>;
|
|
12
|
-
}
|
|
13
|
-
//#endregion
|
|
14
|
-
export { Schema as t };
|
|
15
|
-
//# sourceMappingURL=index-DCXWFAYS.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-DCXWFAYS.d.cts","names":[],"sources":["../src/registry/shadcn-types.ts","../src/schema/schema.ts"],"mappings":";;;;;KA2BY,eAAe,EAAG,aAAa;;;UCuB1B;EACf,UAAU;EACV,QAAQ,SAAS,eAAe"}
|