@matteoaliano/forest-ui 0.5.2 → 0.7.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/dist/index.js CHANGED
@@ -933,7 +933,7 @@ var alpha = {
933
933
  // src/theme/palette.ts
934
934
  function buildPalette(tokens) {
935
935
  var _a;
936
- const { base: base2, error: error2, warning: warning2, success: success2, info: info2, text: text6, bg: bg6, fg: fg6, border: border6 } = tokens;
936
+ const { base: base2, error: error2, warning: warning2, success: success2, info: info3, text: text6, bg: bg6, fg: fg6, border: border6 } = tokens;
937
937
  return {
938
938
  primary: {
939
939
  main: tokens.bg.brandSolid,
@@ -978,7 +978,8 @@ function buildPalette(tokens) {
978
978
  text: {
979
979
  primary: text6.primary,
980
980
  secondary: text6.secondary,
981
- disabled: text6.disabled
981
+ disabled: text6.disabled,
982
+ placeholder: text6.placeholder
982
983
  },
983
984
  divider: border6.secondary,
984
985
  action: {
@@ -988,13 +989,23 @@ function buildPalette(tokens) {
988
989
  disabled: fg6.disabled,
989
990
  disabledBackground: bg6.disabled
990
991
  },
991
- chart: (_a = tokens.chartColors) != null ? _a : chartColors
992
+ chart: (_a = tokens.chartColors) != null ? _a : chartColors,
993
+ ...tokens.highlight && {
994
+ highlight: {
995
+ main: tokens.highlight[600],
996
+ light: tokens.highlight[300],
997
+ dark: tokens.highlight[700],
998
+ contrastText: tokens.base.white
999
+ }
1000
+ }
992
1001
  };
993
1002
  }
994
1003
 
995
1004
  // src/theme/typography.ts
996
1005
  function buildTypography(tokens) {
997
- const { fontFamily: fontFamily2, display: display2, fontSize: fontSize2, lineHeight: lineHeight2, fontWeight: fontWeight2 } = tokens;
1006
+ var _a, _b, _c, _d;
1007
+ const { fontFamily: fontFamily2, display: display2, fontSize: fontSize2, lineHeight: lineHeight2, fontWeight: fontWeight2, letterSpacing: letterSpacing2 } = tokens;
1008
+ const ls = letterSpacing2 != null ? letterSpacing2 : {};
998
1009
  return {
999
1010
  fontFamily: fontFamily2,
1000
1011
  fontWeightRegular: fontWeight2.regular,
@@ -1004,59 +1015,67 @@ function buildTypography(tokens) {
1004
1015
  h1: {
1005
1016
  fontSize: display2.xl.fontSize,
1006
1017
  lineHeight: display2.xl.lineHeight,
1007
- letterSpacing: display2.xl.letterSpacing,
1018
+ letterSpacing: (_a = ls.h1) != null ? _a : display2.xl.letterSpacing,
1008
1019
  fontWeight: fontWeight2.semibold
1009
1020
  },
1010
1021
  h2: {
1011
1022
  fontSize: display2.lg.fontSize,
1012
1023
  lineHeight: display2.lg.lineHeight,
1013
- letterSpacing: display2.lg.letterSpacing,
1024
+ letterSpacing: (_b = ls.h2) != null ? _b : display2.lg.letterSpacing,
1014
1025
  fontWeight: fontWeight2.semibold
1015
1026
  },
1016
1027
  h3: {
1017
1028
  fontSize: display2.md.fontSize,
1018
1029
  lineHeight: display2.md.lineHeight,
1019
- letterSpacing: display2.md.letterSpacing,
1030
+ letterSpacing: (_c = ls.h3) != null ? _c : display2.md.letterSpacing,
1020
1031
  fontWeight: fontWeight2.semibold
1021
1032
  },
1022
1033
  h4: {
1023
1034
  fontSize: display2.sm.fontSize,
1024
1035
  lineHeight: display2.sm.lineHeight,
1036
+ ...ls.h4 !== void 0 && { letterSpacing: ls.h4 },
1025
1037
  fontWeight: fontWeight2.semibold
1026
1038
  },
1027
1039
  h5: {
1028
1040
  fontSize: display2.xs.fontSize,
1029
1041
  lineHeight: display2.xs.lineHeight,
1042
+ ...ls.h5 !== void 0 && { letterSpacing: ls.h5 },
1030
1043
  fontWeight: fontWeight2.semibold
1031
1044
  },
1032
1045
  h6: {
1033
1046
  fontSize: fontSize2.xl,
1034
1047
  lineHeight: lineHeight2.xl,
1048
+ ...ls.h6 !== void 0 && { letterSpacing: ls.h6 },
1035
1049
  fontWeight: fontWeight2.semibold
1036
1050
  },
1037
1051
  subtitle1: {
1038
1052
  fontSize: fontSize2.lg,
1039
1053
  lineHeight: lineHeight2.lg,
1054
+ ...ls.subtitle1 !== void 0 && { letterSpacing: ls.subtitle1 },
1040
1055
  fontWeight: fontWeight2.medium
1041
1056
  },
1042
1057
  subtitle2: {
1043
1058
  fontSize: fontSize2.md,
1044
1059
  lineHeight: lineHeight2.md,
1060
+ ...ls.subtitle2 !== void 0 && { letterSpacing: ls.subtitle2 },
1045
1061
  fontWeight: fontWeight2.medium
1046
1062
  },
1047
1063
  body1: {
1048
1064
  fontSize: fontSize2.md,
1049
1065
  lineHeight: lineHeight2.md,
1066
+ ...ls.body1 !== void 0 && { letterSpacing: ls.body1 },
1050
1067
  fontWeight: fontWeight2.regular
1051
1068
  },
1052
1069
  body2: {
1053
1070
  fontSize: fontSize2.sm,
1054
1071
  lineHeight: lineHeight2.sm,
1072
+ ...ls.body2 !== void 0 && { letterSpacing: ls.body2 },
1055
1073
  fontWeight: fontWeight2.regular
1056
1074
  },
1057
1075
  caption: {
1058
1076
  fontSize: fontSize2.xs,
1059
1077
  lineHeight: lineHeight2.xs,
1078
+ ...ls.caption !== void 0 && { letterSpacing: ls.caption },
1060
1079
  fontWeight: fontWeight2.regular
1061
1080
  },
1062
1081
  overline: {
@@ -1064,13 +1083,14 @@ function buildTypography(tokens) {
1064
1083
  lineHeight: lineHeight2.xxs,
1065
1084
  fontWeight: fontWeight2.medium,
1066
1085
  textTransform: "uppercase",
1067
- letterSpacing: "0.08em"
1086
+ letterSpacing: (_d = ls.overline) != null ? _d : "0.08em"
1068
1087
  },
1069
1088
  button: {
1070
1089
  fontSize: fontSize2.sm,
1071
1090
  lineHeight: lineHeight2.sm,
1072
1091
  fontWeight: fontWeight2.semibold,
1073
- textTransform: "none"
1092
+ textTransform: "none",
1093
+ ...ls.button !== void 0 && { letterSpacing: ls.button }
1074
1094
  }
1075
1095
  };
1076
1096
  }
@@ -1139,7 +1159,8 @@ function buildComponents(tokens) {
1139
1159
  error: error2,
1140
1160
  warning: warning2,
1141
1161
  success: success2,
1142
- info: info2,
1162
+ info: info3,
1163
+ highlight: highlight2,
1143
1164
  radius: radius6,
1144
1165
  focusRings: focusRings6,
1145
1166
  shadows: tokenShadows,
@@ -1403,6 +1424,13 @@ function buildComponents(tokens) {
1403
1424
  gap: 4,
1404
1425
  "&:hover": {
1405
1426
  backgroundColor: bg6.primaryHover
1427
+ },
1428
+ "&.Mui-selected": {
1429
+ backgroundColor: info3[50],
1430
+ color: info3[700],
1431
+ "&:hover": {
1432
+ backgroundColor: info3[100]
1433
+ }
1406
1434
  }
1407
1435
  }
1408
1436
  }
@@ -1433,7 +1461,11 @@ function buildComponents(tokens) {
1433
1461
  backgroundColor: bg6.primaryHover
1434
1462
  },
1435
1463
  '&[aria-selected="true"]': {
1436
- backgroundColor: bg6.brandPrimary
1464
+ backgroundColor: info3[50],
1465
+ color: info3[700]
1466
+ },
1467
+ '&[aria-selected="true"].Mui-focused': {
1468
+ backgroundColor: info3[100]
1437
1469
  }
1438
1470
  },
1439
1471
  listbox: {
@@ -1784,7 +1816,7 @@ function buildComponents(tokens) {
1784
1816
  minHeight: 48
1785
1817
  },
1786
1818
  indicator: {
1787
- backgroundColor: fg6.brandPrimary,
1819
+ backgroundColor: info3[600],
1788
1820
  height: 2
1789
1821
  }
1790
1822
  }
@@ -1805,14 +1837,33 @@ function buildComponents(tokens) {
1805
1837
  backgroundColor: bg6.primaryHover
1806
1838
  },
1807
1839
  "&.Mui-selected": {
1808
- color: fg6.brandPrimary,
1809
- backgroundColor: bg6.brandPrimary
1840
+ color: info3[700],
1841
+ backgroundColor: info3[50]
1810
1842
  }
1811
1843
  }
1812
1844
  }
1813
1845
  },
1814
1846
  // ─── Chip ───────────────────────────────────────────────────────
1815
1847
  MuiChip: {
1848
+ variants: [
1849
+ ...highlight2 ? [
1850
+ {
1851
+ props: { color: "highlight" },
1852
+ style: {
1853
+ "&.MuiChip-filled": {
1854
+ backgroundColor: highlight2[600],
1855
+ color: base2.white,
1856
+ "& .MuiChip-deleteIcon": { color: highlight2[200] }
1857
+ },
1858
+ "&.MuiChip-outlined": {
1859
+ borderColor: highlight2[300],
1860
+ color: highlight2[700],
1861
+ "& .MuiChip-deleteIcon": { color: highlight2[400] }
1862
+ }
1863
+ }
1864
+ }
1865
+ ] : []
1866
+ ],
1816
1867
  styleOverrides: {
1817
1868
  root: {
1818
1869
  borderRadius: radius6.md
@@ -1845,9 +1896,11 @@ function buildComponents(tokens) {
1845
1896
  },
1846
1897
  colorSecondary: {
1847
1898
  "&.MuiChip-filled": {
1848
- backgroundColor: tokens.bg.secondarySubtle,
1849
- color: tokens.text.secondary,
1850
- "& .MuiChip-deleteIcon": { color: tokens.fg.secondary }
1899
+ backgroundColor: highlight2 ? highlight2[50] : tokens.bg.secondarySubtle,
1900
+ color: highlight2 ? highlight2[700] : tokens.text.secondary,
1901
+ "& .MuiChip-deleteIcon": {
1902
+ color: highlight2 ? highlight2[500] : tokens.fg.secondary
1903
+ }
1851
1904
  }
1852
1905
  },
1853
1906
  colorError: {
@@ -1873,9 +1926,9 @@ function buildComponents(tokens) {
1873
1926
  },
1874
1927
  colorInfo: {
1875
1928
  "&.MuiChip-filled": {
1876
- backgroundColor: info2[50],
1877
- color: info2[700],
1878
- "& .MuiChip-deleteIcon": { color: info2[400] }
1929
+ backgroundColor: info3[50],
1930
+ color: info3[700],
1931
+ "& .MuiChip-deleteIcon": { color: info3[400] }
1879
1932
  }
1880
1933
  }
1881
1934
  }
@@ -1946,9 +1999,9 @@ function buildComponents(tokens) {
1946
1999
  backgroundColor: bg6.primaryHover
1947
2000
  },
1948
2001
  "&.Mui-selected": {
1949
- backgroundColor: bg6.brandPrimary,
2002
+ backgroundColor: info3[50],
1950
2003
  "&:hover": {
1951
- backgroundColor: bg6.brandPrimary
2004
+ backgroundColor: info3[100]
1952
2005
  }
1953
2006
  }
1954
2007
  }
@@ -1989,7 +2042,12 @@ function buildComponents(tokens) {
1989
2042
  dot: {
1990
2043
  minWidth: 8,
1991
2044
  height: 8,
1992
- borderRadius: radius6.full
2045
+ borderRadius: radius6.full,
2046
+ ...highlight2 && {
2047
+ "&.MuiBadge-colorDefault, &.MuiBadge-colorPrimary": {
2048
+ backgroundColor: highlight2[500]
2049
+ }
2050
+ }
1993
2051
  }
1994
2052
  }
1995
2053
  },
@@ -2018,10 +2076,10 @@ function buildComponents(tokens) {
2018
2076
  backgroundColor: bg6.primaryHover
2019
2077
  },
2020
2078
  "&.Mui-selected": {
2021
- backgroundColor: bg6.brandPrimary,
2022
- color: buttonColors6.secondaryColor.fg,
2079
+ backgroundColor: info3[50],
2080
+ color: info3[700],
2023
2081
  "&:hover": {
2024
- backgroundColor: bg6.brandSecondary
2082
+ backgroundColor: info3[100]
2025
2083
  }
2026
2084
  }
2027
2085
  }
@@ -2073,6 +2131,31 @@ function buildComponents(tokens) {
2073
2131
  defaultProps: {
2074
2132
  variant: "standard"
2075
2133
  },
2134
+ variants: [
2135
+ ...highlight2 ? [
2136
+ {
2137
+ props: { variant: "featured" },
2138
+ style: {
2139
+ borderRadius: radius6.xl,
2140
+ fontSize: 14,
2141
+ lineHeight: "20px",
2142
+ padding: "12px 16px",
2143
+ alignItems: "center",
2144
+ backgroundColor: highlight2[50],
2145
+ color: highlight2[700],
2146
+ border: `1px solid ${highlight2[200]}`,
2147
+ "& .MuiAlert-icon": {
2148
+ color: highlight2[600],
2149
+ padding: 0,
2150
+ marginRight: 12
2151
+ },
2152
+ "& .MuiAlertTitle-root": {
2153
+ color: highlight2[800]
2154
+ }
2155
+ }
2156
+ }
2157
+ ] : []
2158
+ ],
2076
2159
  styleOverrides: {
2077
2160
  root: {
2078
2161
  borderRadius: radius6.xl,
@@ -2106,11 +2189,11 @@ function buildComponents(tokens) {
2106
2189
  }
2107
2190
  },
2108
2191
  standardInfo: {
2109
- backgroundColor: info2[50],
2110
- color: info2[700],
2111
- border: `1px solid ${info2[300]}`,
2192
+ backgroundColor: info3[50],
2193
+ color: info3[700],
2194
+ border: `1px solid ${info3[300]}`,
2112
2195
  "& .MuiAlert-icon": {
2113
- color: info2[600]
2196
+ color: info3[600]
2114
2197
  }
2115
2198
  },
2116
2199
  icon: {
@@ -2559,10 +2642,12 @@ function buildComponents(tokens) {
2559
2642
  MuiLink: {
2560
2643
  styleOverrides: {
2561
2644
  root: {
2562
- color: fg6.brandPrimary,
2645
+ color: info3[600],
2563
2646
  fontWeight: 500,
2647
+ textDecorationColor: info3[600],
2564
2648
  "&:hover": {
2565
- color: buttonColors6.primary.bgHover
2649
+ color: info3[700],
2650
+ textDecorationColor: info3[700]
2566
2651
  }
2567
2652
  }
2568
2653
  }
@@ -2855,23 +2940,23 @@ function buildComponents(tokens) {
2855
2940
  backgroundColor: bg6.primaryHover
2856
2941
  },
2857
2942
  "&.Mui-selected": {
2858
- backgroundColor: fg6.brandPrimary,
2943
+ backgroundColor: info3[600],
2859
2944
  color: base2.white,
2860
2945
  fontWeight: 600,
2861
2946
  "&:hover": {
2862
- backgroundColor: buttonColors6.primary.bgHover
2947
+ backgroundColor: info3[700]
2863
2948
  },
2864
2949
  "&:focus": {
2865
- backgroundColor: fg6.brandPrimary
2950
+ backgroundColor: info3[600]
2866
2951
  }
2867
2952
  },
2868
2953
  "&.MuiPickersDay-today": {
2869
- border: `1px solid ${border6.brandSolid}`,
2870
- color: fg6.brandPrimary,
2954
+ border: `1px solid ${info3[600]}`,
2955
+ color: info3[700],
2871
2956
  backgroundColor: "transparent",
2872
2957
  fontWeight: 600,
2873
2958
  "&.Mui-selected": {
2874
- backgroundColor: fg6.brandPrimary,
2959
+ backgroundColor: info3[600],
2875
2960
  color: base2.white,
2876
2961
  border: "none"
2877
2962
  }
@@ -3813,12 +3898,14 @@ var forestInternalPreset = {
3813
3898
  };
3814
3899
 
3815
3900
  // src/theme/presets/forest-alkemy-plus.ts
3901
+ var info2 = violet;
3902
+ var highlight = magenta;
3816
3903
  var colors2 = {
3817
3904
  base,
3818
3905
  error,
3819
3906
  warning,
3820
3907
  success,
3821
- info,
3908
+ info: info2,
3822
3909
  brand: {
3823
3910
  25: gray[25],
3824
3911
  50: gray[50],
@@ -3874,8 +3961,8 @@ var text5 = {
3874
3961
  successPrimary: success[600]
3875
3962
  };
3876
3963
  var bg5 = {
3877
- primary: gray[50],
3878
- primaryAlt: gray[50],
3964
+ primary: gray[25],
3965
+ primaryAlt: gray[25],
3879
3966
  primaryHover: gray[100],
3880
3967
  primarySolid: gray[950],
3881
3968
  secondary: base.white,
@@ -3883,8 +3970,8 @@ var bg5 = {
3883
3970
  secondarySubtle: gray[25],
3884
3971
  secondaryHover: gray[50],
3885
3972
  secondarySolid: gray[600],
3886
- tertiary: gray[100],
3887
- quaternary: gray[200],
3973
+ tertiary: gray[50],
3974
+ quaternary: gray[100],
3888
3975
  active: gray[200],
3889
3976
  disabled: gray[100],
3890
3977
  disabledSubtle: gray[50],
@@ -4056,20 +4143,38 @@ var chartColors5 = {
4056
4143
  crosshairFg: gray[500],
4057
4144
  legendFg: text5.tertiary,
4058
4145
  series: [
4059
- { fg: misc.purple[500], fgHover: misc.purple[600], bg: misc.purple[100], bgHover: misc.purple[200] },
4060
- { fg: misc.orangeDark[400], fgHover: misc.orangeDark[500], bg: misc.orangeDark[100], bgHover: misc.orangeDark[200] },
4146
+ // Brand accents lead violet + magenta anchor the palette
4147
+ { fg: violet[500], fgHover: violet[600], bg: violet[100], bgHover: violet[200] },
4148
+ { fg: magenta[500], fgHover: magenta[600], bg: magenta[100], bgHover: magenta[200] },
4149
+ // Complementary rotation — cool → warm → earth
4061
4150
  { fg: misc.teal[300], fgHover: misc.teal[400], bg: misc.teal[50], bgHover: misc.teal[100] },
4062
4151
  { fg: warning[400], fgHover: warning[500], bg: warning[100], bgHover: warning[200] },
4063
- { fg: misc.rose[400], fgHover: misc.rose[500], bg: misc.rose[100], bgHover: misc.rose[200] },
4064
4152
  { fg: misc.blueLight[400], fgHover: misc.blueLight[500], bg: misc.blueLight[100], bgHover: misc.blueLight[200] },
4065
- { fg: misc.orange[300], fgHover: misc.orange[400], bg: misc.orange[100], bgHover: misc.orange[200] },
4066
- { fg: misc.cyan[600], fgHover: misc.cyan[700], bg: misc.cyan[100], bgHover: misc.cyan[200] },
4153
+ { fg: misc.rose[400], fgHover: misc.rose[500], bg: misc.rose[100], bgHover: misc.rose[200] },
4067
4154
  { fg: misc.green[500], fgHover: misc.green[600], bg: misc.green[100], bgHover: misc.green[200] },
4068
- { fg: misc.pink[400], fgHover: misc.pink[500], bg: misc.pink[100], bgHover: misc.pink[200] },
4069
- { fg: misc.fuchsia[400], fgHover: misc.fuchsia[500], bg: misc.fuchsia[100], bgHover: misc.fuchsia[200] },
4070
- { fg: misc.teal[600], fgHover: misc.teal[700], bg: misc.teal[100], bgHover: misc.teal[200] }
4155
+ { fg: misc.orangeDark[400], fgHover: misc.orangeDark[500], bg: misc.orangeDark[100], bgHover: misc.orangeDark[200] },
4156
+ { fg: misc.cyan[600], fgHover: misc.cyan[700], bg: misc.cyan[100], bgHover: misc.cyan[200] },
4157
+ { fg: misc.orange[300], fgHover: misc.orange[400], bg: misc.orange[100], bgHover: misc.orange[200] },
4158
+ { fg: misc.teal[600], fgHover: misc.teal[700], bg: misc.teal[100], bgHover: misc.teal[200] },
4159
+ // Pink/fuchsia kept as tail fallbacks only — too close to magenta to sit near position 1
4160
+ { fg: misc.pink[400], fgHover: misc.pink[500], bg: misc.pink[100], bgHover: misc.pink[200] }
4071
4161
  ]
4072
4162
  };
4163
+ var letterSpacing = {
4164
+ h1: "-0.02em",
4165
+ h2: "-0.02em",
4166
+ h3: "-0.02em",
4167
+ h4: "-0.02em",
4168
+ h5: "-0.02em",
4169
+ h6: "-0.02em",
4170
+ subtitle1: "0.02em",
4171
+ subtitle2: "0.02em",
4172
+ body1: "0.02em",
4173
+ body2: "0.02em",
4174
+ caption: "0.02em",
4175
+ overline: "0.02em",
4176
+ button: "0.02em"
4177
+ };
4073
4178
  var focusRings5 = {
4074
4179
  brand: "0px 0px 0px 4px #4040403d",
4075
4180
  brandShadowXs: "0px 1px 2px 0px #1018280d, 0px 0px 0px 4px #4040403d",
@@ -4090,7 +4195,7 @@ var forestAlkemyPlusPreset = {
4090
4195
  error,
4091
4196
  warning,
4092
4197
  success,
4093
- info,
4198
+ info: info2,
4094
4199
  spacing,
4095
4200
  radius: radius5,
4096
4201
  shadows,
@@ -4115,7 +4220,9 @@ var forestAlkemyPlusPreset = {
4115
4220
  sliderColors: sliderColors5,
4116
4221
  toggleColors: toggleColors5,
4117
4222
  chartColors: chartColors5,
4118
- alpha
4223
+ alpha,
4224
+ letterSpacing,
4225
+ highlight
4119
4226
  }
4120
4227
  }
4121
4228
  }
@@ -4390,8 +4497,13 @@ function Search({
4390
4497
  slotProps: {
4391
4498
  ...slotProps,
4392
4499
  input: {
4393
- sx: { pl: "12px", gap: 0 },
4394
- startAdornment: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_InputAdornment.default, { position: "start", sx: { mr: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Search_default, { sx: { fontSize: 20 } }) }),
4500
+ sx: {
4501
+ pl: "8px",
4502
+ pr: "4px",
4503
+ gap: 0,
4504
+ "& .MuiOutlinedInput-input": { pl: "8px" }
4505
+ },
4506
+ startAdornment: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_InputAdornment.default, { position: "start", sx: { mr: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Search_default, { sx: { fontSize: 20, color: "text.placeholder" } }) }),
4395
4507
  endAdornment: currentValue ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_InputAdornment.default, { position: "end", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
4396
4508
  import_IconButton.default,
4397
4509
  {