@matteoaliano/forest-ui 1.1.1 → 1.2.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.
package/bin/sync.mjs CHANGED
@@ -11,7 +11,7 @@
11
11
  * skill source to the dogfood `.claude/skills/` copy and the plugin bundle.
12
12
  */
13
13
 
14
- import { mkdirSync, readdirSync, cpSync } from "node:fs";
14
+ import { mkdirSync, readdirSync, cpSync, readFileSync, writeFileSync } from "node:fs";
15
15
  import { resolve, dirname } from "node:path";
16
16
  import { fileURLToPath } from "node:url";
17
17
 
@@ -58,4 +58,18 @@ for (const target of targets) {
58
58
  }
59
59
  }
60
60
 
61
+ // Stamp the plugin version from package.json — the plugin's version is what
62
+ // Claude Code compares to surface "Update available", so it must move with
63
+ // every release that changes the bundled skill/hooks.
64
+ const pkgVersion = JSON.parse(
65
+ readFileSync(resolve(__dirname, "..", "package.json"), "utf-8")
66
+ ).version;
67
+ const pluginJsonPath = resolve(repoRoot, "plugins", "forest-ui", ".claude-plugin", "plugin.json");
68
+ const pluginJson = JSON.parse(readFileSync(pluginJsonPath, "utf-8"));
69
+ if (pluginJson.version !== pkgVersion) {
70
+ pluginJson.version = pkgVersion;
71
+ writeFileSync(pluginJsonPath, JSON.stringify(pluginJson, null, 2) + "\n");
72
+ console.log(` ✅ plugins/forest-ui/.claude-plugin/plugin.json → version ${pkgVersion}`);
73
+ }
74
+
61
75
  console.log(`\n Synced ${skillFolders.length} skill(s) to ${targets.length} target(s) (${synced} copies).\n`);
@@ -447,6 +447,20 @@ function buildComponents(tokens2) {
447
447
  borderTopRightRadius: radius4.md,
448
448
  opacity: 0.75
449
449
  },
450
+ // Unified disabled treatment across the button family (Button,
451
+ // IconButton, Fab, ButtonGroup, ToggleButton): transparent face,
452
+ // disabled border, disabled text — matching the outlined
453
+ // IconButton reference. Contained's fill is dropped and the bevel
454
+ // geometry re-asserted (MUI's outlined disabled `border: 1px`
455
+ // shorthand would otherwise flatten it).
456
+ "&.Mui-disabled": {
457
+ backgroundColor: "transparent",
458
+ borderColor: border4.disabled,
459
+ borderTopWidth: 1,
460
+ borderRightWidth: 1,
461
+ borderLeftWidth: 1,
462
+ borderBottomWidth: 4
463
+ },
450
464
  "@media (prefers-reduced-motion: reduce)": {
451
465
  transition: "none",
452
466
  "&::before": { display: "none" }
@@ -488,6 +502,13 @@ function buildComponents(tokens2) {
488
502
  "&.MuiButtonGroup-contained .MuiButtonGroup-grouped:not(.Mui-disabled)": {
489
503
  borderColor: fg4.tertiary
490
504
  },
505
+ // Disabled grouped children: MUI's per-position grouped-contained
506
+ // border wins over the child Button's own .Mui-disabled rule on the
507
+ // first/middle buttons — pin the unified disabled border here so the
508
+ // whole group matches the standalone disabled Button.
509
+ "&.MuiButtonGroup-contained .MuiButtonGroup-grouped.Mui-disabled": {
510
+ borderColor: border4.disabled
511
+ },
491
512
  // outlined group → the outlined-Button look (outlinedFill), including
492
513
  // its lightened hover sweep (the forced-contained children would
493
514
  // otherwise sweep at full currentColor strength).
@@ -552,6 +573,13 @@ function buildComponents(tokens2) {
552
573
  },
553
574
  "&.ForestIconButton": {
554
575
  ...bevel3D,
576
+ // Square 32×32 with border-box so the faux-3D bevel (1px top + 4px
577
+ // bottom, 1px left/right) is absorbed rather than added on top —
578
+ // otherwise it rendered a 37×34 control instead of matching the
579
+ // standalone Button's 32px height.
580
+ height: 32,
581
+ width: 32,
582
+ boxSizing: "border-box",
555
583
  boxShadow: tokenShadows.xs,
556
584
  "&:focus-visible": {
557
585
  boxShadow: focusRings4.brandShadowXs
@@ -589,15 +617,13 @@ function buildComponents(tokens2) {
589
617
  filter: "brightness(0.97)"
590
618
  }
591
619
  },
592
- // Disabled parity with the Button variants: MUI IconButton's own
593
- // .Mui-disabled (transparent bg + action.disabled icon) ties with the
594
- // variant faces at (0,2,0) and loses on insertion order pin the
595
- // disabled treatment one class higher.
596
- "&.ForestIconButton-contained.Mui-disabled": {
597
- backgroundColor: (theme.vars || theme).palette.action.disabledBackground,
598
- color: (theme.vars || theme).palette.action.disabled
599
- },
600
- "&.ForestIconButton-outlined.Mui-disabled": {
620
+ // Unified disabled treatment for both variants: transparent face,
621
+ // disabled border, disabled icon bevel geometry retained. This is
622
+ // the reference the rest of the button family matches. The two-class
623
+ // selector out-specifies the single-class variant faces so contained's
624
+ // fill is dropped.
625
+ "&.ForestIconButton.Mui-disabled": {
626
+ backgroundColor: "transparent",
601
627
  color: (theme.vars || theme).palette.action.disabled,
602
628
  borderColor: border4.disabled
603
629
  }
@@ -664,6 +690,13 @@ function buildComponents(tokens2) {
664
690
  "&:focus-visible": {
665
691
  boxShadow: focusRings4.brandShadowSm
666
692
  },
693
+ // Same unified disabled treatment as Button/IconButton: drop the
694
+ // contained fill for a transparent, disabled-bordered face.
695
+ "&.Mui-disabled": {
696
+ backgroundColor: "transparent",
697
+ borderColor: border4.disabled,
698
+ color: (theme.vars || theme).palette.action.disabled
699
+ },
667
700
  "@media (prefers-reduced-motion: reduce)": {
668
701
  transition: "none",
669
702
  "&::before": { display: "none" }
@@ -953,7 +986,19 @@ function buildComponents(tokens2) {
953
986
  root: {
954
987
  width: 44,
955
988
  height: 24,
956
- padding: 0
989
+ padding: 0,
990
+ // MUI's `size="small"` variant only half-applies here: the theme pins
991
+ // the track at the wide 44px medium geometry, but MUI still shrinks the
992
+ // thumb (16px), bumps switchBase padding (4px), and cuts the checked
993
+ // travel to 16px — leaving the thumb parked mid-track. Forest ships a
994
+ // single calibrated 24px switch, so neutralize `small` back to it.
995
+ "&.MuiSwitch-sizeSmall": {
996
+ "& .MuiSwitch-switchBase": {
997
+ padding: 2,
998
+ "&.Mui-checked": { transform: "translateX(20px)" }
999
+ },
1000
+ "& .MuiSwitch-thumb": { width: 20, height: 20 }
1001
+ }
957
1002
  },
958
1003
  switchBase: {
959
1004
  padding: 2,
@@ -1047,16 +1092,16 @@ function buildComponents(tokens2) {
1047
1092
  borderTopRightRadius: radius4.md
1048
1093
  }
1049
1094
  },
1050
- // Disabled parity with the disabled contained Button: greyed face +
1051
- // disabled fg, bevel geometry retained. MUI's own .Mui-disabled rule
1052
- // only swaps color and border-shorthands the bevel away — and ties
1053
- // with .Mui-selected at (0,2,0) — so this block sits AFTER selected
1054
- // to win both.
1095
+ // Disabled parity with the rest of the button family: transparent
1096
+ // face, disabled border + fg, bevel geometry retained. MUI's own
1097
+ // .Mui-disabled rule only swaps color and border-shorthands the bevel
1098
+ // away — and ties with .Mui-selected at (0,2,0) — so this block sits
1099
+ // AFTER selected to win both.
1055
1100
  "&.Mui-disabled": {
1056
- backgroundColor: (theme.vars || theme).palette.action.disabledBackground,
1101
+ backgroundColor: "transparent",
1057
1102
  color: (theme.vars || theme).palette.action.disabled,
1058
1103
  borderStyle: "solid",
1059
- borderColor: fg4.tertiary,
1104
+ borderColor: border4.disabled,
1060
1105
  borderTopWidth: 1,
1061
1106
  borderRightWidth: 1,
1062
1107
  borderLeftWidth: 1,
@@ -3976,4 +4021,4 @@ export {
3976
4021
  forestTheme,
3977
4022
  forestThemeOptions
3978
4023
  };
3979
- //# sourceMappingURL=chunk-BCOHH5MJ.mjs.map
4024
+ //# sourceMappingURL=chunk-4PNVZETQ.mjs.map