@matteoaliano/forest-ui 0.2.7 → 0.2.8

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
@@ -10,6 +10,8 @@
10
10
  * Supported targets:
11
11
  * .claude/<name>.md — Claude Code
12
12
  * .cursor/rules/<name>.mdc — Cursor
13
+ * .gemini/<name>.md — Gemini CLI
14
+ * .antigravity/rules.md — Antigravity
13
15
  *
14
16
  * Guideline categories:
15
17
  * - FOREST_AI_GUIDELINES.md — Design system components, tokens, patterns
@@ -32,12 +34,14 @@ const staticEntries = [
32
34
  {
33
35
  source: resolve(guidelinesDir, "FOREST_AI_GUIDELINES.md"),
34
36
  claudeName: "forest-ui.md",
37
+ geminiName: "forest-ui.md",
35
38
  cursorName: "forest-ui.mdc",
36
39
  cursorDescription: "Forest UI Design System guidelines — components, tokens, and patterns",
37
40
  },
38
41
  {
39
42
  source: resolve(guidelinesDir, "FOREST_DEV_GUIDELINES.md"),
40
43
  claudeName: "forest-dev.md",
44
+ geminiName: "forest-dev.md",
41
45
  cursorName: "forest-dev.mdc",
42
46
  cursorDescription: "Forest UI development best practices",
43
47
  },
@@ -58,6 +62,7 @@ function discoverThemeEntries() {
58
62
  return {
59
63
  source: resolve(themesDir, f),
60
64
  claudeName: `forest-theme-${themeName}.md`,
65
+ geminiName: `forest-theme-${themeName}.md`,
61
66
  cursorName: `forest-theme-${themeName}.mdc`,
62
67
  cursorDescription: `Forest UI theme guidelines — ${themeName}`,
63
68
  };
@@ -112,6 +117,45 @@ for (const entry of entries) {
112
117
  console.log(` ⚠️ Claude Code — .claude/${entry.claudeName} skipped (${err.message})`);
113
118
  }
114
119
 
120
+ // Gemini target
121
+ const geminiDir = resolve(projectRoot, ".gemini");
122
+ const geminiPath = resolve(geminiDir, entry.geminiName);
123
+ total++;
124
+ try {
125
+ mkdirSync(geminiDir, { recursive: true });
126
+ writeFileSync(geminiPath, content, "utf-8");
127
+ console.log(` ✅ Gemini → .gemini/${entry.geminiName}`);
128
+
129
+ // Update .gemini/GEMINI.md to import all synced files
130
+ const geminiMainPath = resolve(geminiDir, "GEMINI.md");
131
+ const geminiMainContent = entries
132
+ .map(e => `@${e.geminiName}`)
133
+ .join("\n");
134
+ writeFileSync(geminiMainPath, `# Forest UI Guidelines\n\n${geminiMainContent}\n`, "utf-8");
135
+
136
+ synced++;
137
+ } catch (err) {
138
+ console.log(` ⚠️ Gemini — .gemini/${entry.geminiName} skipped (${err.message})`);
139
+ }
140
+
141
+ // Antigravity target
142
+ const antiDir = resolve(projectRoot, ".antigravity");
143
+ const antiPath = resolve(antiDir, "rules.md");
144
+ total++;
145
+ try {
146
+ mkdirSync(antiDir, { recursive: true });
147
+ // Concatenate all content into rules.md or use imports if supported.
148
+ // Using imports to keep it clean, pointing to the .gemini folder.
149
+ const antiContent = entries
150
+ .map(e => `@../.gemini/${e.geminiName}`)
151
+ .join("\n");
152
+ writeFileSync(antiPath, `# Forest UI — Antigravity Rules\n\n${antiContent}\n`, "utf-8");
153
+ console.log(` ✅ Antigravity → .antigravity/rules.md`);
154
+ synced++;
155
+ } catch (err) {
156
+ console.log(` ⚠️ Antigravity — .antigravity/rules.md skipped (${err.message})`);
157
+ }
158
+
115
159
  // Cursor target
116
160
  const cursorDir = resolve(projectRoot, ".cursor", "rules");
117
161
  const cursorPath = resolve(cursorDir, entry.cursorName);
@@ -595,7 +595,7 @@ var typography = buildTypography({
595
595
  function buildComponents(tokens) {
596
596
  const {
597
597
  colors: colors3,
598
- radius: radius2,
598
+ radius: radius3,
599
599
  focusRings: focusRings3,
600
600
  shadows: tokenShadows,
601
601
  text: text3,
@@ -612,7 +612,7 @@ function buildComponents(tokens) {
612
612
  },
613
613
  styleOverrides: {
614
614
  root: {
615
- borderRadius: radius2.md,
615
+ borderRadius: radius3.md,
616
616
  fontWeight: 600,
617
617
  boxShadow: tokenShadows.xs,
618
618
  height: 32,
@@ -661,7 +661,7 @@ function buildComponents(tokens) {
661
661
  },
662
662
  styleOverrides: {
663
663
  root: {
664
- borderRadius: radius2.md
664
+ borderRadius: radius3.md
665
665
  },
666
666
  grouped: {
667
667
  "&:not(:last-of-type)": {
@@ -693,8 +693,7 @@ function buildComponents(tokens) {
693
693
  // ─── TextField / Input ──────────────────────────────────────────
694
694
  MuiTextField: {
695
695
  defaultProps: {
696
- variant: "outlined",
697
- size: "small"
696
+ variant: "outlined"
698
697
  }
699
698
  },
700
699
  MuiInputBase: {
@@ -712,7 +711,7 @@ function buildComponents(tokens) {
712
711
  MuiOutlinedInput: {
713
712
  styleOverrides: {
714
713
  root: {
715
- borderRadius: radius2.md,
714
+ borderRadius: radius3.md,
716
715
  boxShadow: tokenShadows.xs,
717
716
  "&:hover .MuiOutlinedInput-notchedOutline": {
718
717
  borderColor: border3.brand
@@ -734,12 +733,7 @@ function buildComponents(tokens) {
734
733
  borderColor: border3.primary
735
734
  },
736
735
  input: {
737
- padding: "10px 14px",
738
- fontSize: 16,
739
- lineHeight: "24px"
740
- },
741
- inputSizeSmall: {
742
- padding: "8px 12px",
736
+ padding: "6px 12px",
743
737
  fontSize: 14,
744
738
  lineHeight: "20px"
745
739
  }
@@ -772,12 +766,7 @@ function buildComponents(tokens) {
772
766
  }
773
767
  },
774
768
  outlined: {
775
- // Align label with custom OutlinedInput padding (10px 14px)
776
- transform: "translate(14px, 10px) scale(1)",
777
- "&.MuiInputLabel-sizeSmall": {
778
- // Align label with custom inputSizeSmall padding (8px 12px)
779
- transform: "translate(12px, 8px) scale(1)"
780
- },
769
+ transform: "translate(12px, 6px) scale(1)",
781
770
  "&.MuiInputLabel-shrink": {
782
771
  transform: "translate(14px, -9px) scale(0.75)"
783
772
  }
@@ -800,20 +789,22 @@ function buildComponents(tokens) {
800
789
  // ─── Select ─────────────────────────────────────────────────────
801
790
  MuiSelect: {
802
791
  defaultProps: {
803
- size: "small",
804
792
  MenuProps: {
805
- autoFocus: false
793
+ autoFocus: false,
794
+ slotProps: {
795
+ backdrop: {
796
+ sx: { backgroundColor: "transparent" }
797
+ }
798
+ }
806
799
  }
807
800
  },
808
801
  styleOverrides: {
809
802
  select: {
810
- display: "flex",
811
- alignItems: "center",
812
803
  "&.MuiSelect-select": {
813
- minHeight: "20px",
814
- "&[aria-placeholder], &:empty + .MuiSelect-nativeInput[value='']~&": {
815
- color: text3.placeholder
816
- }
804
+ minHeight: "auto",
805
+ padding: "6px 12px",
806
+ fontSize: 14,
807
+ lineHeight: "20px"
817
808
  }
818
809
  },
819
810
  icon: {
@@ -824,7 +815,7 @@ function buildComponents(tokens) {
824
815
  MuiMenuItem: {
825
816
  styleOverrides: {
826
817
  root: {
827
- borderRadius: radius2.md,
818
+ borderRadius: radius3.md,
828
819
  padding: "6px 8px",
829
820
  gap: 4,
830
821
  "&:hover": {
@@ -837,15 +828,24 @@ function buildComponents(tokens) {
837
828
  MuiAutocomplete: {
838
829
  styleOverrides: {
839
830
  paper: {
840
- borderRadius: radius2.md,
831
+ borderRadius: radius3.md,
841
832
  boxShadow: tokenShadows.lg,
842
833
  border: `1px solid ${border3.secondary}`,
843
834
  marginTop: 4
844
835
  },
836
+ inputRoot: {
837
+ // Override Autocomplete's default padding so the input height stays 32px
838
+ padding: "0 12px",
839
+ "&.MuiOutlinedInput-root .MuiAutocomplete-input": {
840
+ padding: "6px 0",
841
+ fontSize: 14,
842
+ lineHeight: "20px"
843
+ }
844
+ },
845
845
  option: {
846
- fontSize: 16,
847
- lineHeight: "24px",
848
- padding: "10px 14px",
846
+ fontSize: 14,
847
+ lineHeight: "20px",
848
+ padding: "6px 12px",
849
849
  "&.Mui-focused": {
850
850
  backgroundColor: bg3.primaryHover
851
851
  },
@@ -866,7 +866,7 @@ function buildComponents(tokens) {
866
866
  styleOverrides: {
867
867
  root: {
868
868
  color: border3.primary,
869
- borderRadius: radius2.xs,
869
+ borderRadius: radius3.xs,
870
870
  padding: 0,
871
871
  width: 20,
872
872
  height: 20,
@@ -883,7 +883,7 @@ function buildComponents(tokens) {
883
883
  "&.Mui-focusVisible": {
884
884
  outline: "none",
885
885
  boxShadow: focusRings3.brand,
886
- borderRadius: radius2.xs
886
+ borderRadius: radius3.xs
887
887
  },
888
888
  "&.Mui-disabled": {
889
889
  color: border3.primary
@@ -913,7 +913,7 @@ function buildComponents(tokens) {
913
913
  "&.Mui-focusVisible": {
914
914
  outline: "none",
915
915
  boxShadow: focusRings3.brand,
916
- borderRadius: radius2.full
916
+ borderRadius: radius3.full
917
917
  },
918
918
  "&.Mui-disabled": {
919
919
  color: border3.primary
@@ -961,7 +961,7 @@ function buildComponents(tokens) {
961
961
  boxShadow: "0px 1px 2px 0px #1018280d"
962
962
  },
963
963
  track: {
964
- borderRadius: radius2.full,
964
+ borderRadius: radius3.full,
965
965
  backgroundColor: border3.secondary,
966
966
  opacity: 1
967
967
  }
@@ -986,8 +986,7 @@ function buildComponents(tokens) {
986
986
  "&.Mui-selected": {
987
987
  backgroundColor: bg3.brandPrimary,
988
988
  color: buttonColors3.secondaryColor.fg,
989
- borderColor: border3.brand,
990
- boxShadow: `inset 0 0 0 1px ${border3.brandSolid}`,
989
+ borderColor: border3.brandSolid,
991
990
  "&:hover": {
992
991
  backgroundColor: bg3.brandSecondary
993
992
  }
@@ -1001,7 +1000,7 @@ function buildComponents(tokens) {
1001
1000
  MuiToggleButtonGroup: {
1002
1001
  styleOverrides: {
1003
1002
  root: {
1004
- borderRadius: radius2.md,
1003
+ borderRadius: radius3.md,
1005
1004
  overflow: "hidden"
1006
1005
  },
1007
1006
  grouped: {
@@ -1009,16 +1008,13 @@ function buildComponents(tokens) {
1009
1008
  "&:not(:first-of-type)": {
1010
1009
  marginLeft: -1
1011
1010
  },
1012
- "&.Mui-selected + &.Mui-selected": {
1013
- boxShadow: `inset -1px 0 0 0 ${border3.brandSolid}, inset 0 1px 0 0 ${border3.brandSolid}, inset 0 -1px 0 0 ${border3.brandSolid}`
1014
- },
1015
1011
  "&:first-of-type": {
1016
- borderTopLeftRadius: radius2.md,
1017
- borderBottomLeftRadius: radius2.md
1012
+ borderTopLeftRadius: radius3.md,
1013
+ borderBottomLeftRadius: radius3.md
1018
1014
  },
1019
1015
  "&:last-of-type": {
1020
- borderTopRightRadius: radius2.md,
1021
- borderBottomRightRadius: radius2.md
1016
+ borderTopRightRadius: radius3.md,
1017
+ borderBottomRightRadius: radius3.md
1022
1018
  }
1023
1019
  }
1024
1020
  }
@@ -1030,7 +1026,7 @@ function buildComponents(tokens) {
1030
1026
  },
1031
1027
  styleOverrides: {
1032
1028
  root: {
1033
- borderRadius: radius2.xl,
1029
+ borderRadius: radius3.xl,
1034
1030
  border: `1px solid ${border3.secondary}`,
1035
1031
  backgroundColor: bg3.primary,
1036
1032
  boxShadow: tokenShadows.xs,
@@ -1079,7 +1075,7 @@ function buildComponents(tokens) {
1079
1075
  backgroundImage: "none"
1080
1076
  },
1081
1077
  rounded: {
1082
- borderRadius: radius2.lg
1078
+ borderRadius: radius3.lg
1083
1079
  },
1084
1080
  elevation1: {
1085
1081
  boxShadow: tokenShadows.xs,
@@ -1120,7 +1116,7 @@ function buildComponents(tokens) {
1120
1116
  styleOverrides: {
1121
1117
  root: {
1122
1118
  border: `1px solid ${border3.secondary}`,
1123
- borderRadius: radius2.lg,
1119
+ borderRadius: radius3.lg,
1124
1120
  "&:not(:last-child)": {
1125
1121
  marginBottom: 8
1126
1122
  },
@@ -1130,7 +1126,7 @@ function buildComponents(tokens) {
1130
1126
  "&.Mui-expanded": {
1131
1127
  margin: 0,
1132
1128
  marginBottom: 8,
1133
- borderRadius: radius2.lg
1129
+ borderRadius: radius3.lg
1134
1130
  }
1135
1131
  }
1136
1132
  }
@@ -1193,7 +1189,7 @@ function buildComponents(tokens) {
1193
1189
  MuiChip: {
1194
1190
  styleOverrides: {
1195
1191
  root: {
1196
- borderRadius: radius2.md
1192
+ borderRadius: radius3.md
1197
1193
  },
1198
1194
  label: {
1199
1195
  fontWeight: 500
@@ -1332,7 +1328,7 @@ function buildComponents(tokens) {
1332
1328
  MuiTableContainer: {
1333
1329
  styleOverrides: {
1334
1330
  root: {
1335
- borderRadius: radius2.xl,
1331
+ borderRadius: radius3.xl,
1336
1332
  border: `1px solid ${border3.secondary}`,
1337
1333
  boxShadow: "none"
1338
1334
  }
@@ -1347,7 +1343,7 @@ function buildComponents(tokens) {
1347
1343
  lineHeight: "18px",
1348
1344
  minWidth: 20,
1349
1345
  height: 20,
1350
- borderRadius: radius2.full
1346
+ borderRadius: radius3.full
1351
1347
  },
1352
1348
  colorPrimary: {
1353
1349
  backgroundColor: bg3.brandSolid
@@ -1364,7 +1360,7 @@ function buildComponents(tokens) {
1364
1360
  dot: {
1365
1361
  minWidth: 8,
1366
1362
  height: 8,
1367
- borderRadius: radius2.full
1363
+ borderRadius: radius3.full
1368
1364
  }
1369
1365
  }
1370
1366
  },
@@ -1387,7 +1383,7 @@ function buildComponents(tokens) {
1387
1383
  MuiListItemButton: {
1388
1384
  styleOverrides: {
1389
1385
  root: {
1390
- borderRadius: radius2.sm,
1386
+ borderRadius: radius3.sm,
1391
1387
  padding: "8px 12px",
1392
1388
  "&:hover": {
1393
1389
  backgroundColor: bg3.primaryHover
@@ -1435,7 +1431,7 @@ function buildComponents(tokens) {
1435
1431
  lineHeight: "18px",
1436
1432
  fontWeight: 600,
1437
1433
  padding: "8px 12px",
1438
- borderRadius: radius2.md,
1434
+ borderRadius: radius3.md,
1439
1435
  boxShadow: tokenShadows.lg
1440
1436
  },
1441
1437
  arrow: {
@@ -1450,7 +1446,7 @@ function buildComponents(tokens) {
1450
1446
  },
1451
1447
  styleOverrides: {
1452
1448
  root: {
1453
- borderRadius: radius2.xl,
1449
+ borderRadius: radius3.xl,
1454
1450
  fontSize: 14,
1455
1451
  lineHeight: "20px",
1456
1452
  padding: "12px 16px",
@@ -1516,7 +1512,7 @@ function buildComponents(tokens) {
1516
1512
  MuiDialog: {
1517
1513
  styleOverrides: {
1518
1514
  paper: {
1519
- borderRadius: radius2.xl,
1515
+ borderRadius: radius3.xl,
1520
1516
  boxShadow: tokenShadows.xl,
1521
1517
  padding: 0
1522
1518
  }
@@ -1555,17 +1551,17 @@ function buildComponents(tokens) {
1555
1551
  MuiLinearProgress: {
1556
1552
  styleOverrides: {
1557
1553
  root: {
1558
- borderRadius: radius2.full,
1554
+ borderRadius: radius3.full,
1559
1555
  height: 8,
1560
1556
  backgroundColor: border3.secondary
1561
1557
  },
1562
1558
  barColorPrimary: {
1563
1559
  backgroundColor: fg3.brandPrimary,
1564
- borderRadius: radius2.full
1560
+ borderRadius: radius3.full
1565
1561
  },
1566
1562
  barColorSecondary: {
1567
1563
  backgroundColor: bg3.secondarySolid,
1568
- borderRadius: radius2.full
1564
+ borderRadius: radius3.full
1569
1565
  }
1570
1566
  }
1571
1567
  },
@@ -1589,10 +1585,10 @@ function buildComponents(tokens) {
1589
1585
  backgroundColor: bg3.tertiary
1590
1586
  },
1591
1587
  rounded: {
1592
- borderRadius: radius2.md
1588
+ borderRadius: radius3.md
1593
1589
  },
1594
1590
  circular: {
1595
- borderRadius: radius2.full
1591
+ borderRadius: radius3.full
1596
1592
  }
1597
1593
  }
1598
1594
  },
@@ -1602,7 +1598,7 @@ function buildComponents(tokens) {
1602
1598
  root: {
1603
1599
  backgroundColor: bg3.primarySolid,
1604
1600
  color: text3.white,
1605
- borderRadius: radius2.xl,
1601
+ borderRadius: radius3.xl,
1606
1602
  boxShadow: tokenShadows.lg,
1607
1603
  fontSize: 14,
1608
1604
  lineHeight: "20px",
@@ -1637,7 +1633,7 @@ function buildComponents(tokens) {
1637
1633
  styleOverrides: {
1638
1634
  root: {
1639
1635
  border: `1px solid ${border3.secondary}`,
1640
- borderRadius: radius2.xl,
1636
+ borderRadius: radius3.xl,
1641
1637
  fontFamily: "inherit",
1642
1638
  "& .MuiDataGrid-withBorderColor": {
1643
1639
  borderColor: border3.secondary
@@ -1877,6 +1873,18 @@ var colors2 = {
1877
1873
  /** Blue (info) — forest defaults (standard UX) */
1878
1874
  blue: colors.blue
1879
1875
  };
1876
+ var radius2 = {
1877
+ ...radius,
1878
+ xxs: 1,
1879
+ xs: 2,
1880
+ sm: 3,
1881
+ md: 4,
1882
+ lg: 5,
1883
+ xl: 6,
1884
+ "2xl": 8,
1885
+ "3xl": 10,
1886
+ "4xl": 12
1887
+ };
1880
1888
  var text2 = {
1881
1889
  primary: colors2.gray[900],
1882
1890
  secondary: colors2.gray[700],
@@ -2111,7 +2119,7 @@ var alkemyPlusPreset = {
2111
2119
  tokens: {
2112
2120
  colors: colors2,
2113
2121
  spacing,
2114
- radius,
2122
+ radius: radius2,
2115
2123
  shadows,
2116
2124
  focusRings: focusRings2,
2117
2125
  fontFamily: '"Aeonik", sans-serif',
@@ -2166,5 +2174,5 @@ var forestThemeOptions = {
2166
2174
  var forestTheme = createTheme(forestThemeOptions);
2167
2175
 
2168
2176
  export { alkemyPlusPreset, alpha, avatarColors, bg, border, breadcrumbColors, buildTheme, buildThemeOptions, buttonColors, chartColors, colors, components, container, display, fg, focusRings, fontFamily, fontSize, fontWeight, forestPreset, forestTheme, forestThemeOptions, getAvailablePresets, getPreset, iconColors, lineHeight, navColors, palette, radius, registerPreset, shadows, shadows2, sliderColors, spacing, text, toggleColors, typography, widths };
2169
- //# sourceMappingURL=chunk-3FSKMCSC.mjs.map
2170
- //# sourceMappingURL=chunk-3FSKMCSC.mjs.map
2177
+ //# sourceMappingURL=chunk-3FZJFTY7.mjs.map
2178
+ //# sourceMappingURL=chunk-3FZJFTY7.mjs.map