@charstudios/pallet 0.1.0 → 0.3.0
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/README.md +454 -479
- package/dist/chunk-BCQMI6SW.js +346 -0
- package/dist/chunk-BCQMI6SW.js.map +1 -0
- package/dist/{index-DcC8QTrl.d.ts → index-C8-t5s-1.d.ts} +14 -7
- package/dist/index.d.ts +14 -7
- package/dist/index.js +204 -89
- package/dist/index.js.map +1 -1
- package/dist/presets/index.d.ts +1 -1
- package/dist/presets/index.js +1 -1
- package/dist/server.d.ts +2 -2
- package/dist/server.js +1 -1
- package/dist/styles/index.css +16 -15
- package/dist/styles/variant-flat.css +215 -32
- package/dist/styles/variant-frosted.css +216 -0
- package/dist/styles/variant-toon.css +339 -0
- package/package.json +79 -78
- package/dist/chunk-4GSIZANE.js +0 -231
- package/dist/chunk-4GSIZANE.js.map +0 -1
- package/dist/styles/variant-launch.css +0 -75
package/dist/index.js
CHANGED
|
@@ -135,11 +135,11 @@ function resolveColors(theme, scheme) {
|
|
|
135
135
|
function themeToCss(theme, options = {}) {
|
|
136
136
|
const selector = options.selector ?? ":root";
|
|
137
137
|
const darkSelector = options.darkSelector ?? ".dark";
|
|
138
|
-
const
|
|
138
|
+
const light4 = resolveTheme(theme, "light");
|
|
139
139
|
const darkColors = resolveColors(theme, "dark");
|
|
140
140
|
const variantComment = options.includeVariantComment ? `/* pallet variant: ${theme.variant} (set data-pallet-variant="${theme.variant}") */
|
|
141
141
|
` : "";
|
|
142
|
-
return variantComment + `${selector}{${cssVarsToString(
|
|
142
|
+
return variantComment + `${selector}{${cssVarsToString(light4)}}${darkSelector}{${cssVarsToString(darkColors)}}`;
|
|
143
143
|
}
|
|
144
144
|
function serializeTheme(theme) {
|
|
145
145
|
return JSON.stringify(theme);
|
|
@@ -305,124 +305,239 @@ var flat = {
|
|
|
305
305
|
}
|
|
306
306
|
};
|
|
307
307
|
|
|
308
|
-
// src/presets/
|
|
308
|
+
// src/presets/frosted.ts
|
|
309
309
|
var light2 = {
|
|
310
|
-
background: "oklch(0.
|
|
311
|
-
foreground: "oklch(0.
|
|
312
|
-
card: "oklch(1 0
|
|
313
|
-
cardForeground: "oklch(0.
|
|
314
|
-
popover: "oklch(1 0
|
|
315
|
-
popoverForeground: "oklch(0.
|
|
316
|
-
primary: "oklch(0.
|
|
317
|
-
primaryForeground: "oklch(0.99 0.
|
|
318
|
-
secondary: "oklch(0.
|
|
319
|
-
secondaryForeground: "oklch(0.3 0.
|
|
320
|
-
muted: "oklch(0.
|
|
321
|
-
mutedForeground: "oklch(0.
|
|
322
|
-
accent: "oklch(0.
|
|
323
|
-
accentForeground: "oklch(0.
|
|
324
|
-
destructive: "oklch(0.
|
|
310
|
+
background: "oklch(0.94 0.02 240)",
|
|
311
|
+
foreground: "oklch(0.24 0.03 255)",
|
|
312
|
+
card: "oklch(1 0.01 240 / 55%)",
|
|
313
|
+
cardForeground: "oklch(0.24 0.03 255)",
|
|
314
|
+
popover: "oklch(1 0.01 240 / 62%)",
|
|
315
|
+
popoverForeground: "oklch(0.24 0.03 255)",
|
|
316
|
+
primary: "oklch(0.62 0.12 240)",
|
|
317
|
+
primaryForeground: "oklch(0.99 0.005 240)",
|
|
318
|
+
secondary: "oklch(0.92 0.02 240 / 70%)",
|
|
319
|
+
secondaryForeground: "oklch(0.3 0.04 255)",
|
|
320
|
+
muted: "oklch(0.93 0.015 240 / 65%)",
|
|
321
|
+
mutedForeground: "oklch(0.5 0.03 250)",
|
|
322
|
+
accent: "oklch(0.9 0.04 230 / 70%)",
|
|
323
|
+
accentForeground: "oklch(0.35 0.08 245)",
|
|
324
|
+
destructive: "oklch(0.6 0.2 25)",
|
|
325
325
|
destructiveForeground: "oklch(0.99 0 0)",
|
|
326
|
-
border: "oklch(0.
|
|
327
|
-
input: "oklch(0.
|
|
328
|
-
ring: "oklch(0.
|
|
329
|
-
chart1: "oklch(0.
|
|
330
|
-
chart2: "oklch(0.
|
|
331
|
-
chart3: "oklch(0.
|
|
332
|
-
chart4: "oklch(0.72 0.
|
|
333
|
-
chart5: "oklch(0.
|
|
334
|
-
sidebar: "oklch(0.
|
|
335
|
-
sidebarForeground: "oklch(0.
|
|
336
|
-
sidebarPrimary: "oklch(0.
|
|
337
|
-
sidebarPrimaryForeground: "oklch(0.99 0.
|
|
338
|
-
sidebarAccent: "oklch(0.
|
|
339
|
-
sidebarAccentForeground: "oklch(0.
|
|
340
|
-
sidebarBorder: "oklch(0.
|
|
341
|
-
sidebarRing: "oklch(0.
|
|
326
|
+
border: "oklch(0.85 0.02 240 / 55%)",
|
|
327
|
+
input: "oklch(0.97 0.01 240 / 50%)",
|
|
328
|
+
ring: "oklch(0.62 0.14 235)",
|
|
329
|
+
chart1: "oklch(0.62 0.12 240)",
|
|
330
|
+
chart2: "oklch(0.68 0.1 200)",
|
|
331
|
+
chart3: "oklch(0.58 0.14 280)",
|
|
332
|
+
chart4: "oklch(0.72 0.08 180)",
|
|
333
|
+
chart5: "oklch(0.66 0.11 320)",
|
|
334
|
+
sidebar: "oklch(0.96 0.015 240 / 55%)",
|
|
335
|
+
sidebarForeground: "oklch(0.24 0.03 255)",
|
|
336
|
+
sidebarPrimary: "oklch(0.62 0.12 240)",
|
|
337
|
+
sidebarPrimaryForeground: "oklch(0.99 0.005 240)",
|
|
338
|
+
sidebarAccent: "oklch(0.9 0.04 230 / 70%)",
|
|
339
|
+
sidebarAccentForeground: "oklch(0.35 0.08 245)",
|
|
340
|
+
sidebarBorder: "oklch(0.85 0.02 240 / 50%)",
|
|
341
|
+
sidebarRing: "oklch(0.62 0.14 235)"
|
|
342
342
|
};
|
|
343
343
|
var dark2 = {
|
|
344
|
-
background: "oklch(0.
|
|
345
|
-
foreground: "oklch(0.
|
|
346
|
-
card: "oklch(0.
|
|
347
|
-
cardForeground: "oklch(0.
|
|
348
|
-
popover: "oklch(0.
|
|
349
|
-
popoverForeground: "oklch(0.
|
|
350
|
-
primary: "oklch(0.72 0.12
|
|
351
|
-
primaryForeground: "oklch(0.
|
|
352
|
-
secondary: "oklch(0.
|
|
353
|
-
secondaryForeground: "oklch(0.
|
|
354
|
-
muted: "oklch(0.
|
|
355
|
-
mutedForeground: "oklch(0.72 0.
|
|
356
|
-
accent: "oklch(0.
|
|
357
|
-
accentForeground: "oklch(0.
|
|
358
|
-
destructive: "oklch(0.
|
|
344
|
+
background: "oklch(0.18 0.03 260)",
|
|
345
|
+
foreground: "oklch(0.96 0.01 240)",
|
|
346
|
+
card: "oklch(0.28 0.04 260 / 45%)",
|
|
347
|
+
cardForeground: "oklch(0.96 0.01 240)",
|
|
348
|
+
popover: "oklch(0.3 0.04 260 / 52%)",
|
|
349
|
+
popoverForeground: "oklch(0.96 0.01 240)",
|
|
350
|
+
primary: "oklch(0.72 0.12 230)",
|
|
351
|
+
primaryForeground: "oklch(0.18 0.03 260)",
|
|
352
|
+
secondary: "oklch(0.32 0.03 260 / 55%)",
|
|
353
|
+
secondaryForeground: "oklch(0.96 0.01 240)",
|
|
354
|
+
muted: "oklch(0.3 0.03 260 / 50%)",
|
|
355
|
+
mutedForeground: "oklch(0.72 0.03 250)",
|
|
356
|
+
accent: "oklch(0.36 0.05 250 / 55%)",
|
|
357
|
+
accentForeground: "oklch(0.92 0.03 230)",
|
|
358
|
+
destructive: "oklch(0.68 0.18 22)",
|
|
359
359
|
destructiveForeground: "oklch(0.99 0 0)",
|
|
360
|
-
border: "oklch(1 0 0 /
|
|
361
|
-
input: "oklch(1 0 0 /
|
|
362
|
-
ring: "oklch(0.
|
|
363
|
-
chart1: "oklch(0.72 0.12
|
|
364
|
-
chart2: "oklch(0.
|
|
365
|
-
chart3: "oklch(0.
|
|
366
|
-
chart4: "oklch(0.74 0.
|
|
367
|
-
chart5: "oklch(0.
|
|
368
|
-
sidebar: "oklch(0.
|
|
369
|
-
sidebarForeground: "oklch(0.
|
|
370
|
-
sidebarPrimary: "oklch(0.72 0.12
|
|
371
|
-
sidebarPrimaryForeground: "oklch(0.
|
|
372
|
-
sidebarAccent: "oklch(0.
|
|
373
|
-
sidebarAccentForeground: "oklch(0.
|
|
374
|
-
sidebarBorder: "oklch(1 0 0 /
|
|
375
|
-
sidebarRing: "oklch(0.
|
|
360
|
+
border: "oklch(1 0 0 / 14%)",
|
|
361
|
+
input: "oklch(1 0 0 / 10%)",
|
|
362
|
+
ring: "oklch(0.7 0.12 230)",
|
|
363
|
+
chart1: "oklch(0.72 0.12 230)",
|
|
364
|
+
chart2: "oklch(0.7 0.1 200)",
|
|
365
|
+
chart3: "oklch(0.66 0.14 280)",
|
|
366
|
+
chart4: "oklch(0.74 0.08 180)",
|
|
367
|
+
chart5: "oklch(0.68 0.11 320)",
|
|
368
|
+
sidebar: "oklch(0.22 0.035 260 / 50%)",
|
|
369
|
+
sidebarForeground: "oklch(0.96 0.01 240)",
|
|
370
|
+
sidebarPrimary: "oklch(0.72 0.12 230)",
|
|
371
|
+
sidebarPrimaryForeground: "oklch(0.18 0.03 260)",
|
|
372
|
+
sidebarAccent: "oklch(0.36 0.05 250 / 55%)",
|
|
373
|
+
sidebarAccentForeground: "oklch(0.92 0.03 230)",
|
|
374
|
+
sidebarBorder: "oklch(1 0 0 / 12%)",
|
|
375
|
+
sidebarRing: "oklch(0.7 0.12 230)"
|
|
376
376
|
};
|
|
377
|
-
var
|
|
378
|
-
name: "
|
|
379
|
-
variant: "
|
|
377
|
+
var frosted = {
|
|
378
|
+
name: "frosted",
|
|
379
|
+
variant: "frosted",
|
|
380
380
|
colors: { light: light2, dark: dark2 },
|
|
381
381
|
typography: {
|
|
382
382
|
sans: '"Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',
|
|
383
|
-
heading: '"
|
|
383
|
+
heading: '"Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',
|
|
384
384
|
mono: 'ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace',
|
|
385
|
-
googleFonts: ["Inter"
|
|
385
|
+
googleFonts: ["Inter"]
|
|
386
386
|
},
|
|
387
387
|
radius: {
|
|
388
|
-
base: "
|
|
389
|
-
// A slightly gentler ramp so large elements do not over-round.
|
|
388
|
+
base: "0.75rem",
|
|
390
389
|
scale: {
|
|
391
|
-
sm: 0.
|
|
392
|
-
md: 0.
|
|
390
|
+
sm: 0.55,
|
|
391
|
+
md: 0.8,
|
|
393
392
|
lg: 1,
|
|
394
393
|
xl: 1.2,
|
|
395
|
-
"2xl": 1.
|
|
396
|
-
"3xl": 1.
|
|
397
|
-
"4xl":
|
|
394
|
+
"2xl": 1.4,
|
|
395
|
+
"3xl": 1.6,
|
|
396
|
+
"4xl": 1.8
|
|
398
397
|
}
|
|
399
398
|
},
|
|
400
399
|
elevation: {
|
|
401
400
|
shadows: {
|
|
402
|
-
xs: "
|
|
403
|
-
sm: "
|
|
404
|
-
md: "0
|
|
405
|
-
lg: "0
|
|
406
|
-
xl: "0
|
|
401
|
+
xs: "none",
|
|
402
|
+
sm: "none",
|
|
403
|
+
md: "0 4px 16px -8px oklch(0.45 0.08 240 / 0.12)",
|
|
404
|
+
lg: "0 10px 28px -12px oklch(0.45 0.08 240 / 0.16)",
|
|
405
|
+
xl: "0 18px 40px -16px oklch(0.45 0.08 240 / 0.2)"
|
|
407
406
|
},
|
|
408
|
-
borderStrength: 0.
|
|
409
|
-
level: "
|
|
407
|
+
borderStrength: 0.35,
|
|
408
|
+
level: "sm"
|
|
410
409
|
},
|
|
411
410
|
density: {
|
|
412
|
-
spacing: "0.
|
|
413
|
-
scale: 1.
|
|
411
|
+
spacing: "0.25rem",
|
|
412
|
+
scale: 1.05
|
|
414
413
|
},
|
|
415
414
|
motion: {
|
|
416
|
-
duration:
|
|
415
|
+
duration: 260,
|
|
417
416
|
easing: "cubic-bezier(0.22, 1, 0.36, 1)",
|
|
418
417
|
intensity: 1
|
|
419
418
|
}
|
|
420
419
|
};
|
|
421
420
|
|
|
421
|
+
// src/presets/toon.ts
|
|
422
|
+
var light3 = {
|
|
423
|
+
background: "oklch(0.965 0.005 260)",
|
|
424
|
+
foreground: "oklch(0.22 0.02 260)",
|
|
425
|
+
card: "oklch(1 0 0)",
|
|
426
|
+
cardForeground: "oklch(0.22 0.02 260)",
|
|
427
|
+
popover: "oklch(1 0 0)",
|
|
428
|
+
popoverForeground: "oklch(0.22 0.02 260)",
|
|
429
|
+
primary: "oklch(0.55 0.19 255)",
|
|
430
|
+
primaryForeground: "oklch(0.99 0.005 255)",
|
|
431
|
+
secondary: "oklch(0.96 0.01 260)",
|
|
432
|
+
secondaryForeground: "oklch(0.28 0.03 260)",
|
|
433
|
+
muted: "oklch(0.95 0.008 260)",
|
|
434
|
+
mutedForeground: "oklch(0.52 0.02 260)",
|
|
435
|
+
accent: "oklch(0.94 0.03 255)",
|
|
436
|
+
accentForeground: "oklch(0.4 0.12 255)",
|
|
437
|
+
destructive: "oklch(0.58 0.22 25)",
|
|
438
|
+
destructiveForeground: "oklch(0.99 0 0)",
|
|
439
|
+
border: "oklch(0.82 0.015 260)",
|
|
440
|
+
input: "oklch(1 0 0)",
|
|
441
|
+
ring: "oklch(0.55 0.19 255)",
|
|
442
|
+
chart1: "oklch(0.55 0.19 255)",
|
|
443
|
+
chart2: "oklch(0.62 0.18 300)",
|
|
444
|
+
chart3: "oklch(0.7 0.16 55)",
|
|
445
|
+
chart4: "oklch(0.65 0.17 145)",
|
|
446
|
+
chart5: "oklch(0.6 0.2 25)",
|
|
447
|
+
sidebar: "oklch(1 0 0)",
|
|
448
|
+
sidebarForeground: "oklch(0.22 0.02 260)",
|
|
449
|
+
sidebarPrimary: "oklch(0.55 0.19 255)",
|
|
450
|
+
sidebarPrimaryForeground: "oklch(0.99 0.005 255)",
|
|
451
|
+
sidebarAccent: "oklch(0.94 0.03 255)",
|
|
452
|
+
sidebarAccentForeground: "oklch(0.4 0.12 255)",
|
|
453
|
+
sidebarBorder: "oklch(0.82 0.015 260)",
|
|
454
|
+
sidebarRing: "oklch(0.55 0.19 255)"
|
|
455
|
+
};
|
|
456
|
+
var dark3 = {
|
|
457
|
+
background: "oklch(0.18 0.02 260)",
|
|
458
|
+
foreground: "oklch(0.96 0.01 260)",
|
|
459
|
+
card: "oklch(0.24 0.025 260)",
|
|
460
|
+
cardForeground: "oklch(0.96 0.01 260)",
|
|
461
|
+
popover: "oklch(0.24 0.025 260)",
|
|
462
|
+
popoverForeground: "oklch(0.96 0.01 260)",
|
|
463
|
+
primary: "oklch(0.68 0.16 255)",
|
|
464
|
+
primaryForeground: "oklch(0.18 0.03 260)",
|
|
465
|
+
secondary: "oklch(0.3 0.02 260)",
|
|
466
|
+
secondaryForeground: "oklch(0.96 0.01 260)",
|
|
467
|
+
muted: "oklch(0.3 0.02 260)",
|
|
468
|
+
mutedForeground: "oklch(0.7 0.02 260)",
|
|
469
|
+
accent: "oklch(0.32 0.05 255)",
|
|
470
|
+
accentForeground: "oklch(0.85 0.06 255)",
|
|
471
|
+
destructive: "oklch(0.68 0.18 22)",
|
|
472
|
+
destructiveForeground: "oklch(0.99 0 0)",
|
|
473
|
+
border: "oklch(1 0 0 / 16%)",
|
|
474
|
+
input: "oklch(0.24 0.025 260)",
|
|
475
|
+
ring: "oklch(0.68 0.16 255)",
|
|
476
|
+
chart1: "oklch(0.68 0.16 255)",
|
|
477
|
+
chart2: "oklch(0.7 0.15 300)",
|
|
478
|
+
chart3: "oklch(0.75 0.14 55)",
|
|
479
|
+
chart4: "oklch(0.7 0.14 145)",
|
|
480
|
+
chart5: "oklch(0.68 0.18 25)",
|
|
481
|
+
sidebar: "oklch(0.22 0.025 260)",
|
|
482
|
+
sidebarForeground: "oklch(0.96 0.01 260)",
|
|
483
|
+
sidebarPrimary: "oklch(0.68 0.16 255)",
|
|
484
|
+
sidebarPrimaryForeground: "oklch(0.18 0.03 260)",
|
|
485
|
+
sidebarAccent: "oklch(0.32 0.05 255)",
|
|
486
|
+
sidebarAccentForeground: "oklch(0.85 0.06 255)",
|
|
487
|
+
sidebarBorder: "oklch(1 0 0 / 14%)",
|
|
488
|
+
sidebarRing: "oklch(0.68 0.16 255)"
|
|
489
|
+
};
|
|
490
|
+
var toon = {
|
|
491
|
+
name: "toon",
|
|
492
|
+
variant: "toon",
|
|
493
|
+
colors: { light: light3, dark: dark3 },
|
|
494
|
+
typography: {
|
|
495
|
+
sans: '"Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',
|
|
496
|
+
heading: '"Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',
|
|
497
|
+
mono: 'ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace',
|
|
498
|
+
googleFonts: ["Inter"]
|
|
499
|
+
},
|
|
500
|
+
radius: {
|
|
501
|
+
base: "0.75rem",
|
|
502
|
+
scale: {
|
|
503
|
+
sm: 0.55,
|
|
504
|
+
md: 0.75,
|
|
505
|
+
lg: 1,
|
|
506
|
+
xl: 1.15,
|
|
507
|
+
"2xl": 1.35,
|
|
508
|
+
"3xl": 1.55,
|
|
509
|
+
"4xl": 1.75
|
|
510
|
+
}
|
|
511
|
+
},
|
|
512
|
+
elevation: {
|
|
513
|
+
// Hard lips live in the variant CSS — keep token shadows empty so utilities
|
|
514
|
+
// like `shadow-sm` do not reintroduce soft elevation.
|
|
515
|
+
shadows: {
|
|
516
|
+
xs: "none",
|
|
517
|
+
sm: "none",
|
|
518
|
+
md: "none",
|
|
519
|
+
lg: "none",
|
|
520
|
+
xl: "none"
|
|
521
|
+
},
|
|
522
|
+
borderStrength: 1,
|
|
523
|
+
level: "none"
|
|
524
|
+
},
|
|
525
|
+
density: {
|
|
526
|
+
spacing: "0.25rem",
|
|
527
|
+
scale: 1
|
|
528
|
+
},
|
|
529
|
+
motion: {
|
|
530
|
+
duration: 160,
|
|
531
|
+
easing: "cubic-bezier(0.2, 0.8, 0.2, 1)",
|
|
532
|
+
intensity: 1
|
|
533
|
+
}
|
|
534
|
+
};
|
|
535
|
+
|
|
422
536
|
// src/presets/index.ts
|
|
423
537
|
var presets = {
|
|
424
538
|
flat,
|
|
425
|
-
|
|
539
|
+
toon,
|
|
540
|
+
frosted
|
|
426
541
|
};
|
|
427
542
|
function getPreset(name) {
|
|
428
543
|
return presets[name];
|
|
@@ -646,6 +761,6 @@ function useColorScheme() {
|
|
|
646
761
|
};
|
|
647
762
|
}
|
|
648
763
|
|
|
649
|
-
export { DEFAULT_RADIUS_SCALE, PalletContext, ThemeProvider, applyCssVars, buildGoogleFontsUrl, clearCssVars, colorTokensToVars, cssVarsToString, deepMerge, defaultPreset, deserializeTheme, flat,
|
|
764
|
+
export { DEFAULT_RADIUS_SCALE, PalletContext, ThemeProvider, applyCssVars, buildGoogleFontsUrl, clearCssVars, colorTokensToVars, cssVarsToString, deepMerge, defaultPreset, deserializeTheme, flat, frosted, getPreset, loadGoogleFonts, mergeAll, presets, resolveColors, resolveTheme, serializeTheme, structuralVars, themeToCss, themeToInlineStyle, toon, useColorScheme, usePalletContext, usePreset, useTheme, useThemeControls };
|
|
650
765
|
//# sourceMappingURL=index.js.map
|
|
651
766
|
//# sourceMappingURL=index.js.map
|