@wavy/react-ui 0.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.
@@ -0,0 +1,418 @@
1
+ {
2
+ "description": "TYPE: CUSTOM\nMaterial Theme Builder export 2025-10-07 12:13:18",
3
+ "seed": "#3A043A",
4
+ "coreColors": {
5
+ "primary": "#3A043A"
6
+ },
7
+ "extendedColors": [],
8
+ "schemes": {
9
+ "light": {
10
+ "primary": "#7F4D7A",
11
+ "surfaceTint": "#7F4D7A",
12
+ "onPrimary": "#FFFFFF",
13
+ "primaryContainer": "#FFD7F6",
14
+ "onPrimaryContainer": "#653661",
15
+ "secondary": "#6D5869",
16
+ "onSecondary": "#FFFFFF",
17
+ "secondaryContainer": "#F7DAEF",
18
+ "onSecondaryContainer": "#554151",
19
+ "tertiary": "#825245",
20
+ "onTertiary": "#FFFFFF",
21
+ "tertiaryContainer": "#FFDBD1",
22
+ "onTertiaryContainer": "#663C2F",
23
+ "error": "#BA1A1A",
24
+ "onError": "#FFFFFF",
25
+ "errorContainer": "#FFDAD6",
26
+ "onErrorContainer": "#93000A",
27
+ "background": "#FFF7F9",
28
+ "onBackground": "#201A1E",
29
+ "surface": "#FFF7F9",
30
+ "onSurface": "#201A1E",
31
+ "surfaceVariant": "#EEDEE7",
32
+ "onSurfaceVariant": "#4E444B",
33
+ "outline": "#80747C",
34
+ "outlineVariant": "#D1C2CB",
35
+ "shadow": "#000000",
36
+ "scrim": "#000000",
37
+ "inverseSurface": "#352E33",
38
+ "inverseOnSurface": "#FAEDF4",
39
+ "inversePrimary": "#F1B3E7",
40
+ "primaryFixed": "#FFD7F6",
41
+ "onPrimaryFixed": "#330833",
42
+ "primaryFixedDim": "#F1B3E7",
43
+ "onPrimaryFixedVariant": "#653661",
44
+ "secondaryFixed": "#F7DAEF",
45
+ "onSecondaryFixed": "#261624",
46
+ "secondaryFixedDim": "#DABFD3",
47
+ "onSecondaryFixedVariant": "#554151",
48
+ "tertiaryFixed": "#FFDBD1",
49
+ "onTertiaryFixed": "#321208",
50
+ "tertiaryFixedDim": "#F5B8A8",
51
+ "onTertiaryFixedVariant": "#663C2F",
52
+ "surfaceDim": "#E3D7DD",
53
+ "surfaceBright": "#FFF7F9",
54
+ "surfaceContainerLowest": "#FFFFFF",
55
+ "surfaceContainerLow": "#FDF0F7",
56
+ "surfaceContainer": "#F7EBF1",
57
+ "surfaceContainerHigh": "#F1E5EB",
58
+ "surfaceContainerHighest": "#EBDFE6"
59
+ },
60
+ "light-medium-contrast": {
61
+ "primary": "#52254F",
62
+ "surfaceTint": "#7F4D7A",
63
+ "onPrimary": "#FFFFFF",
64
+ "primaryContainer": "#905B89",
65
+ "onPrimaryContainer": "#FFFFFF",
66
+ "secondary": "#433040",
67
+ "onSecondary": "#FFFFFF",
68
+ "secondaryContainer": "#7D6678",
69
+ "onSecondaryContainer": "#FFFFFF",
70
+ "tertiary": "#532B20",
71
+ "onTertiary": "#FFFFFF",
72
+ "tertiaryContainer": "#926153",
73
+ "onTertiaryContainer": "#FFFFFF",
74
+ "error": "#740006",
75
+ "onError": "#FFFFFF",
76
+ "errorContainer": "#CF2C27",
77
+ "onErrorContainer": "#FFFFFF",
78
+ "background": "#FFF7F9",
79
+ "onBackground": "#201A1E",
80
+ "surface": "#FFF7F9",
81
+ "onSurface": "#150F14",
82
+ "surfaceVariant": "#EEDEE7",
83
+ "onSurfaceVariant": "#3D333A",
84
+ "outline": "#5A4F57",
85
+ "outlineVariant": "#756A72",
86
+ "shadow": "#000000",
87
+ "scrim": "#000000",
88
+ "inverseSurface": "#352E33",
89
+ "inverseOnSurface": "#FAEDF4",
90
+ "inversePrimary": "#F1B3E7",
91
+ "primaryFixed": "#905B89",
92
+ "onPrimaryFixed": "#FFFFFF",
93
+ "primaryFixedDim": "#754470",
94
+ "onPrimaryFixedVariant": "#FFFFFF",
95
+ "secondaryFixed": "#7D6678",
96
+ "onSecondaryFixed": "#FFFFFF",
97
+ "secondaryFixedDim": "#634E5F",
98
+ "onSecondaryFixedVariant": "#FFFFFF",
99
+ "tertiaryFixed": "#926153",
100
+ "onTertiaryFixed": "#FFFFFF",
101
+ "tertiaryFixedDim": "#77493C",
102
+ "onTertiaryFixedVariant": "#FFFFFF",
103
+ "surfaceDim": "#CFC3CA",
104
+ "surfaceBright": "#FFF7F9",
105
+ "surfaceContainerLowest": "#FFFFFF",
106
+ "surfaceContainerLow": "#FDF0F7",
107
+ "surfaceContainer": "#F1E5EB",
108
+ "surfaceContainerHigh": "#E6DAE0",
109
+ "surfaceContainerHighest": "#DACED5"
110
+ },
111
+ "light-high-contrast": {
112
+ "primary": "#471B45",
113
+ "surfaceTint": "#7F4D7A",
114
+ "onPrimary": "#FFFFFF",
115
+ "primaryContainer": "#683864",
116
+ "onPrimaryContainer": "#FFFFFF",
117
+ "secondary": "#382635",
118
+ "onSecondary": "#FFFFFF",
119
+ "secondaryContainer": "#574353",
120
+ "onSecondaryContainer": "#FFFFFF",
121
+ "tertiary": "#472217",
122
+ "onTertiary": "#FFFFFF",
123
+ "tertiaryContainer": "#693E32",
124
+ "onTertiaryContainer": "#FFFFFF",
125
+ "error": "#600004",
126
+ "onError": "#FFFFFF",
127
+ "errorContainer": "#98000A",
128
+ "onErrorContainer": "#FFFFFF",
129
+ "background": "#FFF7F9",
130
+ "onBackground": "#201A1E",
131
+ "surface": "#FFF7F9",
132
+ "onSurface": "#000000",
133
+ "surfaceVariant": "#EEDEE7",
134
+ "onSurfaceVariant": "#000000",
135
+ "outline": "#322930",
136
+ "outlineVariant": "#50464D",
137
+ "shadow": "#000000",
138
+ "scrim": "#000000",
139
+ "inverseSurface": "#352E33",
140
+ "inverseOnSurface": "#FFFFFF",
141
+ "inversePrimary": "#F1B3E7",
142
+ "primaryFixed": "#683864",
143
+ "onPrimaryFixed": "#FFFFFF",
144
+ "primaryFixedDim": "#4E214C",
145
+ "onPrimaryFixedVariant": "#FFFFFF",
146
+ "secondaryFixed": "#574353",
147
+ "onSecondaryFixed": "#FFFFFF",
148
+ "secondaryFixedDim": "#3F2D3C",
149
+ "onSecondaryFixedVariant": "#FFFFFF",
150
+ "tertiaryFixed": "#693E32",
151
+ "onTertiaryFixed": "#FFFFFF",
152
+ "tertiaryFixedDim": "#4F281D",
153
+ "onTertiaryFixedVariant": "#FFFFFF",
154
+ "surfaceDim": "#C1B6BC",
155
+ "surfaceBright": "#FFF7F9",
156
+ "surfaceContainerLowest": "#FFFFFF",
157
+ "surfaceContainerLow": "#FAEDF4",
158
+ "surfaceContainer": "#EBDFE6",
159
+ "surfaceContainerHigh": "#DDD1D7",
160
+ "surfaceContainerHighest": "#CFC3CA"
161
+ },
162
+ "dark": {
163
+ "primary": "#F1B3E7",
164
+ "surfaceTint": "#F1B3E7",
165
+ "onPrimary": "#4C1F49",
166
+ "primaryContainer": "#653661",
167
+ "onPrimaryContainer": "#FFD7F6",
168
+ "secondary": "#DABFD3",
169
+ "onSecondary": "#3D2B3A",
170
+ "secondaryContainer": "#554151",
171
+ "onSecondaryContainer": "#F7DAEF",
172
+ "tertiary": "#F5B8A8",
173
+ "onTertiary": "#4C261B",
174
+ "tertiaryContainer": "#663C2F",
175
+ "onTertiaryContainer": "#FFDBD1",
176
+ "error": "#FFB4AB",
177
+ "onError": "#690005",
178
+ "errorContainer": "#93000A",
179
+ "onErrorContainer": "#FFDAD6",
180
+ "background": "#171216",
181
+ "onBackground": "#EBDFE6",
182
+ "surface": "#171216",
183
+ "onSurface": "#EBDFE6",
184
+ "surfaceVariant": "#4E444B",
185
+ "onSurfaceVariant": "#D1C2CB",
186
+ "outline": "#9A8D95",
187
+ "outlineVariant": "#4E444B",
188
+ "shadow": "#000000",
189
+ "scrim": "#000000",
190
+ "inverseSurface": "#EBDFE6",
191
+ "inverseOnSurface": "#352E33",
192
+ "inversePrimary": "#7F4D7A",
193
+ "primaryFixed": "#FFD7F6",
194
+ "onPrimaryFixed": "#330833",
195
+ "primaryFixedDim": "#F1B3E7",
196
+ "onPrimaryFixedVariant": "#653661",
197
+ "secondaryFixed": "#F7DAEF",
198
+ "onSecondaryFixed": "#261624",
199
+ "secondaryFixedDim": "#DABFD3",
200
+ "onSecondaryFixedVariant": "#554151",
201
+ "tertiaryFixed": "#FFDBD1",
202
+ "onTertiaryFixed": "#321208",
203
+ "tertiaryFixedDim": "#F5B8A8",
204
+ "onTertiaryFixedVariant": "#663C2F",
205
+ "surfaceDim": "#171216",
206
+ "surfaceBright": "#3E373C",
207
+ "surfaceContainerLowest": "#120D11",
208
+ "surfaceContainerLow": "#201A1E",
209
+ "surfaceContainer": "#241E22",
210
+ "surfaceContainerHigh": "#2F282D",
211
+ "surfaceContainerHighest": "#3A3338"
212
+ },
213
+ "dark-medium-contrast": {
214
+ "primary": "#FFCDF5",
215
+ "surfaceTint": "#F1B3E7",
216
+ "onPrimary": "#3F143E",
217
+ "primaryContainer": "#B77EAF",
218
+ "onPrimaryContainer": "#000000",
219
+ "secondary": "#F1D4E9",
220
+ "onSecondary": "#31202F",
221
+ "secondaryContainer": "#A28A9C",
222
+ "onSecondaryContainer": "#000000",
223
+ "tertiary": "#FFD2C7",
224
+ "onTertiary": "#3F1B11",
225
+ "tertiaryContainer": "#BA8475",
226
+ "onTertiaryContainer": "#000000",
227
+ "error": "#FFD2CC",
228
+ "onError": "#540003",
229
+ "errorContainer": "#FF5449",
230
+ "onErrorContainer": "#000000",
231
+ "background": "#171216",
232
+ "onBackground": "#EBDFE6",
233
+ "surface": "#171216",
234
+ "onSurface": "#FFFFFF",
235
+ "surfaceVariant": "#4E444B",
236
+ "onSurfaceVariant": "#E7D8E1",
237
+ "outline": "#BCAEB7",
238
+ "outlineVariant": "#998D95",
239
+ "shadow": "#000000",
240
+ "scrim": "#000000",
241
+ "inverseSurface": "#EBDFE6",
242
+ "inverseOnSurface": "#2F282D",
243
+ "inversePrimary": "#663762",
244
+ "primaryFixed": "#FFD7F6",
245
+ "onPrimaryFixed": "#260027",
246
+ "primaryFixedDim": "#F1B3E7",
247
+ "onPrimaryFixedVariant": "#52254F",
248
+ "secondaryFixed": "#F7DAEF",
249
+ "onSecondaryFixed": "#1B0C1A",
250
+ "secondaryFixedDim": "#DABFD3",
251
+ "onSecondaryFixedVariant": "#433040",
252
+ "tertiaryFixed": "#FFDBD1",
253
+ "onTertiaryFixed": "#250802",
254
+ "tertiaryFixedDim": "#F5B8A8",
255
+ "onTertiaryFixedVariant": "#532B20",
256
+ "surfaceDim": "#171216",
257
+ "surfaceBright": "#4A4247",
258
+ "surfaceContainerLowest": "#0B060A",
259
+ "surfaceContainerLow": "#221C20",
260
+ "surfaceContainer": "#2C262B",
261
+ "surfaceContainerHigh": "#373135",
262
+ "surfaceContainerHighest": "#433C41"
263
+ },
264
+ "dark-high-contrast": {
265
+ "primary": "#FFEAF8",
266
+ "surfaceTint": "#F1B3E7",
267
+ "onPrimary": "#000000",
268
+ "primaryContainer": "#ECAFE3",
269
+ "onPrimaryContainer": "#1C001D",
270
+ "secondary": "#FFEAF8",
271
+ "onSecondary": "#000000",
272
+ "secondaryContainer": "#D6BBCF",
273
+ "onSecondaryContainer": "#150613",
274
+ "tertiary": "#FFECE7",
275
+ "onTertiary": "#000000",
276
+ "tertiaryContainer": "#F1B4A4",
277
+ "onTertiaryContainer": "#1D0300",
278
+ "error": "#FFECE9",
279
+ "onError": "#000000",
280
+ "errorContainer": "#FFAEA4",
281
+ "onErrorContainer": "#220001",
282
+ "background": "#171216",
283
+ "onBackground": "#EBDFE6",
284
+ "surface": "#171216",
285
+ "onSurface": "#FFFFFF",
286
+ "surfaceVariant": "#4E444B",
287
+ "onSurfaceVariant": "#FFFFFF",
288
+ "outline": "#FBECF5",
289
+ "outlineVariant": "#CDBFC7",
290
+ "shadow": "#000000",
291
+ "scrim": "#000000",
292
+ "inverseSurface": "#EBDFE6",
293
+ "inverseOnSurface": "#000000",
294
+ "inversePrimary": "#663762",
295
+ "primaryFixed": "#FFD7F6",
296
+ "onPrimaryFixed": "#000000",
297
+ "primaryFixedDim": "#F1B3E7",
298
+ "onPrimaryFixedVariant": "#260027",
299
+ "secondaryFixed": "#F7DAEF",
300
+ "onSecondaryFixed": "#000000",
301
+ "secondaryFixedDim": "#DABFD3",
302
+ "onSecondaryFixedVariant": "#1B0C1A",
303
+ "tertiaryFixed": "#FFDBD1",
304
+ "onTertiaryFixed": "#000000",
305
+ "tertiaryFixedDim": "#F5B8A8",
306
+ "onTertiaryFixedVariant": "#250802",
307
+ "surfaceDim": "#171216",
308
+ "surfaceBright": "#564E53",
309
+ "surfaceContainerLowest": "#000000",
310
+ "surfaceContainerLow": "#241E22",
311
+ "surfaceContainer": "#352E33",
312
+ "surfaceContainerHigh": "#41393E",
313
+ "surfaceContainerHighest": "#4C454A"
314
+ }
315
+ },
316
+ "palettes": {
317
+ "primary": {
318
+ "0": "#000000",
319
+ "5": "#260026",
320
+ "10": "#370237",
321
+ "15": "#430E42",
322
+ "20": "#501A4E",
323
+ "25": "#5D265A",
324
+ "30": "#6A3166",
325
+ "35": "#773D73",
326
+ "40": "#85497F",
327
+ "50": "#A0619A",
328
+ "60": "#BD7BB5",
329
+ "70": "#DA94D0",
330
+ "80": "#F7AFED",
331
+ "90": "#FFD7F6",
332
+ "95": "#FFEBF8",
333
+ "98": "#FFF7F9",
334
+ "99": "#FFFBFF",
335
+ "100": "#FFFFFF"
336
+ },
337
+ "secondary": {
338
+ "0": "#000000",
339
+ "5": "#1A0C18",
340
+ "10": "#251723",
341
+ "15": "#30212E",
342
+ "20": "#3B2B38",
343
+ "25": "#473644",
344
+ "30": "#53414F",
345
+ "35": "#5F4D5B",
346
+ "40": "#6C5967",
347
+ "50": "#857180",
348
+ "60": "#A08A9A",
349
+ "70": "#BBA5B5",
350
+ "80": "#D8C0D1",
351
+ "90": "#F5DBED",
352
+ "95": "#FFEBF8",
353
+ "98": "#FFF7F9",
354
+ "99": "#FFFBFF",
355
+ "100": "#FFFFFF"
356
+ },
357
+ "tertiary": {
358
+ "0": "#000000",
359
+ "5": "#230903",
360
+ "10": "#30130B",
361
+ "15": "#3D1D14",
362
+ "20": "#49271E",
363
+ "25": "#563228",
364
+ "30": "#633D33",
365
+ "35": "#70493D",
366
+ "40": "#7E5449",
367
+ "50": "#996C60",
368
+ "60": "#B58578",
369
+ "70": "#D29F91",
370
+ "80": "#F0BAAC",
371
+ "90": "#FFDBD1",
372
+ "95": "#FFEDE8",
373
+ "98": "#FFF8F6",
374
+ "99": "#FFFBFF",
375
+ "100": "#FFFFFF"
376
+ },
377
+ "neutral": {
378
+ "0": "#000000",
379
+ "5": "#131012",
380
+ "10": "#1E1B1D",
381
+ "15": "#292527",
382
+ "20": "#332F32",
383
+ "25": "#3F3A3D",
384
+ "30": "#4A4548",
385
+ "35": "#565154",
386
+ "40": "#625D60",
387
+ "50": "#7B7578",
388
+ "60": "#968F92",
389
+ "70": "#B1A9AC",
390
+ "80": "#CCC4C7",
391
+ "90": "#E9E0E3",
392
+ "95": "#F7EEF2",
393
+ "98": "#FFF7F9",
394
+ "99": "#FFFBFF",
395
+ "100": "#FFFFFF"
396
+ },
397
+ "neutral-variant": {
398
+ "0": "#000000",
399
+ "5": "#150F14",
400
+ "10": "#20191F",
401
+ "15": "#2B2429",
402
+ "20": "#362E34",
403
+ "25": "#41393F",
404
+ "30": "#4D444A",
405
+ "35": "#595056",
406
+ "40": "#655C62",
407
+ "50": "#7F747B",
408
+ "60": "#998E95",
409
+ "70": "#B4A8AF",
410
+ "80": "#D0C3CA",
411
+ "90": "#EDDFE6",
412
+ "95": "#FBEDF5",
413
+ "98": "#FFF7F9",
414
+ "99": "#FFFBFF",
415
+ "100": "#FFFFFF"
416
+ }
417
+ }
418
+ }
package/modules.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ type WavyThemeProviderOptions = { colorPalette: "green" | "purple" };
2
+ declare module "*.css";
3
+ declare module "*.png";
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "@wavy/react-ui",
3
+ "version": "0.0.1",
4
+ "description": "",
5
+ "license": "MIT",
6
+ "author": "Wavy",
7
+ "type": "module",
8
+ "main": "dist/main.js",
9
+ "types": "dist/main.d.ts",
10
+ "styles": "dist/main.css",
11
+ "bin": {
12
+ "apply-theme": "scripts/public/bundleCss.js"
13
+ },
14
+ "keywords": [
15
+ "wavy-ui",
16
+ "wavy",
17
+ "ui"
18
+ ],
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "https://github.com/justVibes/wavy-ui.git"
22
+ },
23
+ "scripts": {
24
+ "css": "npm run bundle-css",
25
+ "deps": "npm i @wavy/types@latest @wavy/fn@latest",
26
+ "tp-css-bundler": "tsup scripts/templates/bundleCss.ts --outDir scripts/public --format esm --no-dts --external utils.js",
27
+ "tp-theme-builder": "tsup scripts/templates/buildTheme.ts --outDir scripts/public --format esm --no-dts --external utils.js",
28
+ "tp-builders": "npm run tp-css-bundler && npm run tp-theme-builder",
29
+ "bundle-css": "node scripts/public/bundleCss.js --green",
30
+ "build": "tsup && node scripts/build/cloneAssets.ts && npm run bundle-css && npm link",
31
+ "publisher": "npm run build && npm version patch && npm publish"
32
+ },
33
+ "devDependencies": {
34
+ "@emotion/styled": "^11.14.1",
35
+ "@types/node": "^24.7.0",
36
+ "@types/react": "^19.2.2",
37
+ "@wavy/types": "^0.0.51",
38
+ "react": "^19.2.0",
39
+ "react-dom": "^19.2.0",
40
+ "tsup": "^8.5.0",
41
+ "typescript": "^5.9.3"
42
+ },
43
+ "dependencies": {
44
+ "@chakra-ui/react": "^3.27.0",
45
+ "@emotion/react": "^11.14.0",
46
+ "@wavy/fn": "^0.0.19",
47
+ "next-themes": "^0.4.6",
48
+ "react-datepicker": "^8.8.0",
49
+ "react-icons": "^5.5.0",
50
+ "uuid": "^13.0.0"
51
+ }
52
+ }
@@ -0,0 +1,45 @@
1
+ #!/usr/bin/env node
2
+ import {upperFirst}from'@wavy/fn';import $ from'path';import {fileURLToPath}from'url';var I=fileURLToPath(import.meta.url),A=$.dirname(I),p=A.split($.sep).filter((r,t,e)=>t<e.length-2).join($.sep);var y="__",j=1e3;function w(r,t=1){let e=r.startsWith("#")?r.slice(1):r;e.length===3&&(e=e.split("").map(n=>n+n).join(""));let o=parseInt(e.substring(0,2),16),a=parseInt(e.substring(2,4),16),s=parseInt(e.substring(4,6),16);return `rgba(${o}, ${a}, ${s}, ${t})`}function k(r){return [...Array.from(Array(9)).flatMap((t,e)=>{let o=e+1;return [`${o}00`,`${o}50`].map(a=>`${r}${y}${a}`)}),r]}function _(r,t){let o=`--${(a=>a.split("").map(s=>s===s.toUpperCase()&&s!==s.toLowerCase()?`-${s.toLowerCase()}`:s).join(""))(r)}`;return t?.wrap?`var(${o})`:o}function F(r,t,e){let o=Object.entries(t);return e?.excludeSeed||o.push(["seed",r]),o}function L(...r){let t=F(...r).map(([o])=>k(o).map(a=>{let{1:s}=a.split(y),n="";return s&&(n=`[${parseInt(s)/j}]`),`"${o}${n}": "${_(a,{wrap:true})}"`})).flat(),e="CssColors";return {filename:e+".ts",content:`
3
+ const ${e} = Object.freeze({
4
+ ${t.join(`,
5
+ `)}
6
+ })
7
+
8
+ export default ${e}
9
+ `}}function R(r,t,e){let o=(s,n)=>{let g=t.light[s]||n,b=t.dark[s]||n;return k(s).map(i=>{let f=_(i),m=parseFloat(i.replace(/[^0\.0-9]/g,"")),d=m?m/j:1,h=w(g,d),l=w(b,d);return `${f}: light-dark(${h}, ${l})`})};return `
10
+ @import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");
11
+
12
+ :root {
13
+ color-scheme: light dark;
14
+
15
+ ${F(r,t.light).map(([s,n])=>o(s,n)).flat().join(";")}
16
+ }
17
+
18
+ *,
19
+ *::before,
20
+ *::after {
21
+ padding: 0;
22
+ margin: 0;
23
+ box-sizing: border-box;
24
+ font-family: inherit;
25
+ }
26
+
27
+ body {
28
+ font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
29
+ height: 100vh;
30
+ width: 100vw;
31
+ overflow: hidden;
32
+ background-color: var(--surface);
33
+ color: var(--on-surface);
34
+ scrollbar-color: var(--on-surface__750) transparent;
35
+ }
36
+
37
+ #root {
38
+ --size: 100%;
39
+ height: var(--size);
40
+ width: var(--size);
41
+ overflow: hidden;
42
+ }
43
+
44
+ ${e?.()||""}
45
+ `.replace(/\s+/g," ").trim()}async function N(r){let t=await import('fs/promises'),e=await import('path'),{styles:o}=JSON.parse((await t.readFile(e.join(p,"package.json"))).toString("utf-8"));try{let a=e.join(p,"./external/themes"),s=e.join(p,"./src/css"),n=await t.readdir(a),g=n.map(c=>"--"+c.match(/.*?(?=\.)/)?.[0]),b=process.argv.splice(2),i=r?.flag||b.find(c=>g.includes(c));if(!i)return console.log(`Please select a theme using one of these flags: [${g.join(", ")}]`);let f=n.find(c=>c.includes(i.replace(/[^a-zA-Z]/g,"")));if(!f)return console.log(`Failed to map ${i} to a filename in [${n.join(", ")}].`);let m=await t.readFile(e.join(a,f)),{schemes:d,seed:h}=JSON.parse(m.toString("utf-8")),{dark:l,light:u}=d;u.themelessSurface="#FFF",u.themelessOnSurface="#000",l.themelessSurface="#000",l.themelessOnSurface="#FFF";let{filename:x,content:z}=L(h,u);r?.loadCssRefInLocalPackage&&await t.writeFile(e.join(s,"resources",x),z),await t.writeFile(e.join(p,o),R(h,{light:u,dark:l},r?.injectStyles));let C={green:"\u{1F7E9}",purple:"\u{1F7EA}"},v=i.toLowerCase().replace(/[^a-z]/g,"");console.log(`${C[v]||""} ${upperFirst(v)} theme loaded! \u2728`.trim());}catch(a){console.error(a);}}export{N as buildWavyTheme};
@@ -0,0 +1,47 @@
1
+ #!/usr/bin/env node
2
+ import $ from'fs/promises';import b from'path';import {fileURLToPath}from'url';import {upperFirst}from'@wavy/fn';var O=fileURLToPath(import.meta.url),D=b.dirname(O),l=D.split(b.sep).filter((t,r,e)=>r<e.length-2).join(b.sep);var S="__",F=1e3;function j(t,r=1){let e=t.startsWith("#")?t.slice(1):t;e.length===3&&(e=e.split("").map(i=>i+i).join(""));let s=parseInt(e.substring(0,2),16),n=parseInt(e.substring(2,4),16),o=parseInt(e.substring(4,6),16);return `rgba(${s}, ${n}, ${o}, ${r})`}function k(t){return [...Array.from(Array(9)).flatMap((r,e)=>{let s=e+1;return [`${s}00`,`${s}50`].map(n=>`${t}${S}${n}`)}),t]}function _(t,r){let s=`--${(n=>n.split("").map(o=>o===o.toUpperCase()&&o!==o.toLowerCase()?`-${o.toLowerCase()}`:o).join(""))(t)}`;return r?.wrap?`var(${s})`:s}function C(t,r,e){let s=Object.entries(r);return e?.excludeSeed||s.push(["seed",t]),s}function W(...t){let r=C(...t).map(([s])=>k(s).map(n=>{let{1:o}=n.split(S),i="";return o&&(i=`[${parseInt(o)/F}]`),`"${s}${i}": "${_(n,{wrap:true})}"`})).flat(),e="CssColors";return {filename:e+".ts",content:`
3
+ const ${e} = Object.freeze({
4
+ ${r.join(`,
5
+ `)}
6
+ })
7
+
8
+ export default ${e}
9
+ `}}function H(t,r,e){let s=(o,i)=>{let f=r.light[o]||i,v=r.dark[o]||i;return k(o).map(a=>{let p=_(a),d=parseFloat(a.replace(/[^0\.0-9]/g,"")),m=d?d/F:1,u=j(f,m),c=j(v,m);return `${p}: light-dark(${u}, ${c})`})};return `
10
+ @import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");
11
+
12
+ :root {
13
+ color-scheme: light dark;
14
+
15
+ ${C(t,r.light).map(([o,i])=>s(o,i)).flat().join(";")}
16
+ }
17
+
18
+ *,
19
+ *::before,
20
+ *::after {
21
+ padding: 0;
22
+ margin: 0;
23
+ box-sizing: border-box;
24
+ font-family: inherit;
25
+ }
26
+
27
+ body {
28
+ font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
29
+ height: 100vh;
30
+ width: 100vw;
31
+ overflow: hidden;
32
+ background-color: var(--surface);
33
+ color: var(--on-surface);
34
+ scrollbar-color: var(--on-surface__750) transparent;
35
+ }
36
+
37
+ #root {
38
+ --size: 100%;
39
+ height: var(--size);
40
+ width: var(--size);
41
+ overflow: hidden;
42
+ }
43
+
44
+ ${e?.()||""}
45
+ `.replace(/\s+/g," ").trim()}async function x(t){let r=await import('fs/promises'),e=await import('path'),{styles:s}=JSON.parse((await r.readFile(e.join(l,"package.json"))).toString("utf-8"));try{let n=e.join(l,"./external/themes"),o=e.join(l,"./src/css"),i=await r.readdir(n),f=i.map(g=>"--"+g.match(/.*?(?=\.)/)?.[0]),v=process.argv.splice(2),a=t?.flag||v.find(g=>f.includes(g));if(!a)return console.log(`Please select a theme using one of these flags: [${f.join(", ")}]`);let p=i.find(g=>g.includes(a.replace(/[^a-zA-Z]/g,"")));if(!p)return console.log(`Failed to map ${a} to a filename in [${i.join(", ")}].`);let d=await r.readFile(e.join(n,p)),{schemes:m,seed:u}=JSON.parse(d.toString("utf-8")),{dark:c,light:h}=m;h.themelessSurface="#FFF",h.themelessOnSurface="#000",c.themelessSurface="#000",c.themelessOnSurface="#FFF";let{filename:I,content:R}=W(u,h);t?.loadCssRefInLocalPackage&&await r.writeFile(e.join(o,"resources",I),R),await r.writeFile(e.join(l,s),H(u,{light:h,dark:c},t?.injectStyles));let T={green:"\u{1F7E9}",purple:"\u{1F7EA}"},y=a.toLowerCase().replace(/[^a-z]/g,"");console.log(`${T[y]||""} ${upperFirst(y)} theme loaded! \u2728`.trim());}catch(n){console.error(n);}}var A=(t,r)=>t.map(e=>b.join(r,e)),z=(t,r)=>{let e=t.filter(s=>!b.extname(s));return r?A(e,r):e},P=(t,r)=>{let e=t.filter(s=>s.includes(".css"));return r?A(e,r):e};async function J(t){console.log("\u{1F916} Preparing CSS file scan...");let e=await $.readdir(t),s=z(e,t),n=P(e,t);try{for(let o of s)e=await $.readdir(o),s.push(...z(e,o)),n.push(...P(e,o));}catch(o){throw console.log("Failed to resolve the items found: ",{folders:s,cssFiles:n,items:e}),o}console.log("\u26A1 CSS file scan complete!"),n.length===0?console.log("0 CSS files found...",`
46
+ Aborting bundler...`):(console.log("\u{1F916} Resolving file contents..."),n=await Promise.all(n.map(async o=>(await $.readFile(o)).toString("utf-8").trim())),console.log("\u26A1 File contents resolved!",`
47
+ \u{1F916} Preparing bundler...`),await x({injectStyles:()=>n.join(" ")}),console.log("\u2728 Successfully bundled css files! \u2728"));}J(b.join(l,"src"));
package/types.d.ts ADDED
@@ -0,0 +1 @@
1
+ import "@wavy/types";