@wippy-fe/theme 0.0.46 → 0.0.47

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wippy-fe/theme",
3
- "version": "0.0.46",
3
+ "version": "0.0.47",
4
4
  "description": "Theme variables, shared Tailwind config, and PrimeVue styling for Wippy web components.",
5
5
  "type": "module",
6
6
  "main": "theme-config.css",
@@ -9,6 +9,7 @@
9
9
  "./theme-config.css": "./theme-config.css",
10
10
  "./tailwind.config": "./tailwind.config.ts",
11
11
  "./primevue-plugin": "./primevue-plugin.ts",
12
+ "./tokens.json": "./tokens.json",
12
13
  "./primevue/*": "./primevue/*"
13
14
  },
14
15
  "files": [
@@ -1,16 +1,18 @@
1
1
  .p-inputtext {
2
- @apply appearance-none rounded-md
3
- border border-surface-300 dark:border-surface-700
2
+ @apply appearance-none
3
+ border border-surface-300 dark:border-surface-700
4
4
  enabled:hover:border-surface-400 dark:enabled:hover:border-surface-600
5
5
  enabled:focus:border-primary dark:enabled:focus:border-primary
6
6
  bg-surface-0 dark:bg-surface-800
7
7
  text-surface-700 dark:text-surface-0
8
8
  disabled:bg-surface-200 disabled:text-surface-500 dark:disabled:bg-surface-700 dark:disabled:text-surface-400 disabled:opacity-100
9
9
  placeholder:text-surface-500 dark:placeholder:text-surface-400
10
- px-3 py-2
11
- transition-colors duration-200
12
- shadow-[0_1px_2px_0_rgba(18,18,23,0.05)]
13
- outline-none
10
+ transition-colors
11
+ outline-none;
12
+ border-radius: var(--p-form-field-border-radius);
13
+ padding: var(--p-form-field-padding-y) var(--p-form-field-padding-x);
14
+ transition-duration: var(--p-form-field-transition-duration);
15
+ box-shadow: var(--p-form-field-shadow);
14
16
  }
15
17
 
16
18
  .p-inputtext.p-invalid {
@@ -22,7 +24,8 @@
22
24
  }
23
25
 
24
26
  .p-inputtext-sm {
25
- @apply text-sm px-[0.625rem] py-[0.375rem]
27
+ @apply text-sm;
28
+ padding: var(--p-form-field-sm-padding-y) var(--p-form-field-sm-padding-x);
26
29
  }
27
30
 
28
31
  .p-inputtext-xs {
@@ -30,9 +33,10 @@
30
33
  }
31
34
 
32
35
  .p-inputtext-lg {
33
- @apply text-lg px-[0.875rem] py-[0.625rem]
36
+ @apply text-lg;
37
+ padding: var(--p-form-field-lg-padding-y) var(--p-form-field-lg-padding-x);
34
38
  }
35
39
 
36
40
  .p-inputtext-fluid {
37
41
  @apply w-full
38
- }
42
+ }
@@ -1,24 +1,37 @@
1
1
  .p-toggleswitch {
2
- @apply inline-block w-10 h-6
2
+ @apply inline-block;
3
+ width: var(--p-toggleswitch-width);
4
+ height: var(--p-toggleswitch-height);
3
5
  }
4
6
 
5
7
  .p-toggleswitch-input {
6
- @apply cursor-pointer disabled:cursor-default appearance-none absolute top-0 start-0 w-full h-full m-0 p-0 opacity-0 z-10 rounded-[30px]
8
+ @apply cursor-pointer disabled:cursor-default appearance-none absolute top-0 start-0 w-full h-full m-0 p-0 opacity-0 z-10;
9
+ border-radius: var(--p-toggleswitch-border-radius);
7
10
  }
8
11
 
9
12
  .p-toggleswitch-slider {
10
- @apply inline-block w-full h-full rounded-[30px] shadow-[0_1px_2px_0_rgba(18,18,23,0.05)]
13
+ @apply inline-block w-full h-full
11
14
  bg-surface-300 dark:bg-surface-700
12
- border border-transparent
13
- transition-colors duration-200
15
+ border-transparent
16
+ transition-colors;
17
+ border-style: solid;
18
+ border-width: var(--p-toggleswitch-border-width);
19
+ border-radius: var(--p-toggleswitch-border-radius);
20
+ box-shadow: var(--p-form-field-shadow);
21
+ transition-duration: var(--p-toggleswitch-transition-duration);
14
22
  }
15
23
 
16
24
  .p-toggleswitch-handle {
17
25
  @apply absolute top-1/2 flex justify-center items-center
18
26
  bg-surface-0 dark:bg-surface-400
19
27
  text-surface-500 dark:text-surface-900
20
- w-4 h-4 start-1 -mt-2 rounded-full
21
- transition-[background,color,left] duration-200
28
+ transition-[background,color,left];
29
+ width: var(--p-toggleswitch-handle-size);
30
+ height: var(--p-toggleswitch-handle-size);
31
+ inset-inline-start: var(--p-toggleswitch-gap);
32
+ margin-top: calc(var(--p-toggleswitch-handle-size) / -2);
33
+ border-radius: var(--p-toggleswitch-handle-border-radius);
34
+ transition-duration: var(--p-toggleswitch-slide-duration);
22
35
  }
23
36
 
24
37
  .p-toggleswitch.p-toggleswitch-checked .p-toggleswitch-slider {
@@ -26,7 +39,8 @@
26
39
  }
27
40
 
28
41
  .p-toggleswitch.p-toggleswitch-checked .p-toggleswitch-handle {
29
- @apply bg-surface-0 dark:bg-surface-900 text-primary start-5
42
+ @apply bg-surface-0 dark:bg-surface-900 text-primary;
43
+ inset-inline-start: calc(var(--p-toggleswitch-width) - var(--p-toggleswitch-handle-size) - var(--p-toggleswitch-gap));
30
44
  }
31
45
 
32
46
  .p-toggleswitch:not(.p-disabled):has(.p-toggleswitch-input:hover) .p-toggleswitch-slider {
@@ -46,7 +60,10 @@
46
60
  }
47
61
 
48
62
  .p-toggleswitch:not(.p-disabled):has(.p-toggleswitch-input:focus-visible) .p-toggleswitch-slider {
49
- @apply outline outline-1 outline-offset-2 outline-primary
63
+ outline-width: var(--p-focus-ring-width);
64
+ outline-style: var(--p-focus-ring-style);
65
+ outline-color: var(--p-focus-ring-color);
66
+ outline-offset: var(--p-focus-ring-offset);
50
67
  }
51
68
 
52
69
  .p-toggleswitch.p-invalid > .p-toggleswitch-slider {
package/theme-config.css CHANGED
@@ -1,3 +1,29 @@
1
+ /* Runtime appearance tokens. Defaults preserve the existing Wippy theme. */
2
+ :root {
3
+ --p-form-field-padding-x: 0.75rem;
4
+ --p-form-field-padding-y: 0.5rem;
5
+ --p-form-field-sm-padding-x: 0.625rem;
6
+ --p-form-field-sm-padding-y: 0.375rem;
7
+ --p-form-field-lg-padding-x: 0.875rem;
8
+ --p-form-field-lg-padding-y: 0.625rem;
9
+ --p-form-field-border-radius: 0.375rem;
10
+ --p-form-field-transition-duration: 0.2s;
11
+ --p-form-field-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), 0 1px 2px 0 rgba(18, 18, 23, 0.05);
12
+ --p-focus-ring-width: 1px;
13
+ --p-focus-ring-style: solid;
14
+ --p-focus-ring-color: color-mix(in srgb, var(--p-primary-color) 100%, transparent);
15
+ --p-focus-ring-offset: 2px;
16
+ --p-toggleswitch-width: 2.5rem;
17
+ --p-toggleswitch-height: 1.5rem;
18
+ --p-toggleswitch-border-radius: 30px;
19
+ --p-toggleswitch-gap: 0.25rem;
20
+ --p-toggleswitch-border-width: 1px;
21
+ --p-toggleswitch-transition-duration: 0.2s;
22
+ --p-toggleswitch-slide-duration: 0.2s;
23
+ --p-toggleswitch-handle-size: 1rem;
24
+ --p-toggleswitch-handle-border-radius: 9999px;
25
+ }
26
+
1
27
  /* Primary and Surface Palettes */
2
28
  :root {
3
29
  /* color-scheme drives native UI (form controls, scrollbars) and any light-dark().
package/tokens.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "generatedFrom": "theme-config.css",
3
- "version": "1.0.46",
4
- "grammar": "every color family = --p-<fam> + --p-<fam>-{50..950} + --p-<fam>-{color,contrast-color,hover-color,active-color}; --p-surface-<shade>; text/content/highlight semantic aliases; --p-font-<role>-<prop>",
3
+ "version": "1.0.47",
4
+ "grammar": "every color family = --p-<fam> + --p-<fam>-{50..950} + --p-<fam>-{color,contrast-color,hover-color,active-color}; --p-surface-<shade>; text/content/highlight semantic aliases; --p-font-<role>-<prop>; explicitly enumerated runtime appearance tokens",
5
5
  "families": [
6
6
  "primary",
7
7
  "secondary",
@@ -347,6 +347,38 @@
347
347
  "dark": "var(--p-danger-300)",
348
348
  "flips": true
349
349
  },
350
+ {
351
+ "name": "--p-focus-ring-color",
352
+ "layer": "semantic",
353
+ "group": "focus-ring",
354
+ "light": "color-mix(in srgb, var(--p-primary-color) 100%, transparent)",
355
+ "dark": "color-mix(in srgb, var(--p-primary-color) 100%, transparent)",
356
+ "flips": false
357
+ },
358
+ {
359
+ "name": "--p-focus-ring-offset",
360
+ "layer": "semantic",
361
+ "group": "focus-ring",
362
+ "light": "2px",
363
+ "dark": "2px",
364
+ "flips": false
365
+ },
366
+ {
367
+ "name": "--p-focus-ring-style",
368
+ "layer": "semantic",
369
+ "group": "focus-ring",
370
+ "light": "solid",
371
+ "dark": "solid",
372
+ "flips": false
373
+ },
374
+ {
375
+ "name": "--p-focus-ring-width",
376
+ "layer": "semantic",
377
+ "group": "focus-ring",
378
+ "light": "1px",
379
+ "dark": "1px",
380
+ "flips": false
381
+ },
350
382
  {
351
383
  "name": "--p-font-body-letter-spacing",
352
384
  "layer": "font",
@@ -455,6 +487,78 @@
455
487
  "dark": "ui-monospace",
456
488
  "flips": false
457
489
  },
490
+ {
491
+ "name": "--p-form-field-border-radius",
492
+ "layer": "semantic",
493
+ "group": "form-field",
494
+ "light": "0.375rem",
495
+ "dark": "0.375rem",
496
+ "flips": false
497
+ },
498
+ {
499
+ "name": "--p-form-field-lg-padding-x",
500
+ "layer": "semantic",
501
+ "group": "form-field",
502
+ "light": "0.875rem",
503
+ "dark": "0.875rem",
504
+ "flips": false
505
+ },
506
+ {
507
+ "name": "--p-form-field-lg-padding-y",
508
+ "layer": "semantic",
509
+ "group": "form-field",
510
+ "light": "0.625rem",
511
+ "dark": "0.625rem",
512
+ "flips": false
513
+ },
514
+ {
515
+ "name": "--p-form-field-padding-x",
516
+ "layer": "semantic",
517
+ "group": "form-field",
518
+ "light": "0.75rem",
519
+ "dark": "0.75rem",
520
+ "flips": false
521
+ },
522
+ {
523
+ "name": "--p-form-field-padding-y",
524
+ "layer": "semantic",
525
+ "group": "form-field",
526
+ "light": "0.5rem",
527
+ "dark": "0.5rem",
528
+ "flips": false
529
+ },
530
+ {
531
+ "name": "--p-form-field-shadow",
532
+ "layer": "semantic",
533
+ "group": "form-field",
534
+ "light": "var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), 0 1px 2px 0 rgba(18, 18, 23, 0.05)",
535
+ "dark": "var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), 0 1px 2px 0 rgba(18, 18, 23, 0.05)",
536
+ "flips": false
537
+ },
538
+ {
539
+ "name": "--p-form-field-sm-padding-x",
540
+ "layer": "semantic",
541
+ "group": "form-field",
542
+ "light": "0.625rem",
543
+ "dark": "0.625rem",
544
+ "flips": false
545
+ },
546
+ {
547
+ "name": "--p-form-field-sm-padding-y",
548
+ "layer": "semantic",
549
+ "group": "form-field",
550
+ "light": "0.375rem",
551
+ "dark": "0.375rem",
552
+ "flips": false
553
+ },
554
+ {
555
+ "name": "--p-form-field-transition-duration",
556
+ "layer": "semantic",
557
+ "group": "form-field",
558
+ "light": "0.2s",
559
+ "dark": "0.2s",
560
+ "flips": false
561
+ },
458
562
  {
459
563
  "name": "--p-help",
460
564
  "layer": "base",
@@ -1337,6 +1441,78 @@
1337
1441
  "dark": "var(--p-surface-400)",
1338
1442
  "flips": true
1339
1443
  },
1444
+ {
1445
+ "name": "--p-toggleswitch-border-radius",
1446
+ "layer": "component",
1447
+ "group": "toggleswitch",
1448
+ "light": "30px",
1449
+ "dark": "30px",
1450
+ "flips": false
1451
+ },
1452
+ {
1453
+ "name": "--p-toggleswitch-border-width",
1454
+ "layer": "component",
1455
+ "group": "toggleswitch",
1456
+ "light": "1px",
1457
+ "dark": "1px",
1458
+ "flips": false
1459
+ },
1460
+ {
1461
+ "name": "--p-toggleswitch-gap",
1462
+ "layer": "component",
1463
+ "group": "toggleswitch",
1464
+ "light": "0.25rem",
1465
+ "dark": "0.25rem",
1466
+ "flips": false
1467
+ },
1468
+ {
1469
+ "name": "--p-toggleswitch-handle-border-radius",
1470
+ "layer": "component",
1471
+ "group": "toggleswitch",
1472
+ "light": "9999px",
1473
+ "dark": "9999px",
1474
+ "flips": false
1475
+ },
1476
+ {
1477
+ "name": "--p-toggleswitch-handle-size",
1478
+ "layer": "component",
1479
+ "group": "toggleswitch",
1480
+ "light": "1rem",
1481
+ "dark": "1rem",
1482
+ "flips": false
1483
+ },
1484
+ {
1485
+ "name": "--p-toggleswitch-height",
1486
+ "layer": "component",
1487
+ "group": "toggleswitch",
1488
+ "light": "1.5rem",
1489
+ "dark": "1.5rem",
1490
+ "flips": false
1491
+ },
1492
+ {
1493
+ "name": "--p-toggleswitch-slide-duration",
1494
+ "layer": "component",
1495
+ "group": "toggleswitch",
1496
+ "light": "0.2s",
1497
+ "dark": "0.2s",
1498
+ "flips": false
1499
+ },
1500
+ {
1501
+ "name": "--p-toggleswitch-transition-duration",
1502
+ "layer": "component",
1503
+ "group": "toggleswitch",
1504
+ "light": "0.2s",
1505
+ "dark": "0.2s",
1506
+ "flips": false
1507
+ },
1508
+ {
1509
+ "name": "--p-toggleswitch-width",
1510
+ "layer": "component",
1511
+ "group": "toggleswitch",
1512
+ "light": "2.5rem",
1513
+ "dark": "2.5rem",
1514
+ "flips": false
1515
+ },
1340
1516
  {
1341
1517
  "name": "--p-warn",
1342
1518
  "layer": "base",