@matteoaliano/forest-ui 0.8.6 → 0.8.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.
@@ -865,12 +865,34 @@ function buildComponents(tokens) {
865
865
  avatarColors: avatarColors6,
866
866
  breadcrumbColors: breadcrumbColors6
867
867
  } = tokens;
868
+ const containedFill = {
869
+ backgroundColor: buttonColors6.primary.bg,
870
+ color: buttonColors6.primary.fg,
871
+ "&:hover": {
872
+ backgroundColor: buttonColors6.primary.bgHover
873
+ }
874
+ };
875
+ const outlinedFill = {
876
+ borderColor: buttonColors6.secondaryColor.border,
877
+ color: buttonColors6.secondaryColor.fg,
878
+ "&:hover": {
879
+ // Darken the whole outlined button on hover via brightness (< 1) — single
880
+ // mechanism, no separate border-color change. 0.97 is a barely-there darken.
881
+ filter: "brightness(0.97)"
882
+ }
883
+ };
884
+ const textFill = {
885
+ color: buttonColors6.tertiaryColor.fg,
886
+ "&:hover": {
887
+ backgroundColor: buttonColors6.tertiaryColor.bgHover
888
+ }
889
+ };
868
890
  return {
869
891
  // ─── CssBaseline (global) ───────────────────────────────────────
870
892
  MuiCssBaseline: {
871
893
  styleOverrides: {
872
894
  body: {
873
- fontFeatureSettings: '"ss01", "ss02", "cv11"'
895
+ fontFeatureSettings: "normal"
874
896
  }
875
897
  }
876
898
  },
@@ -880,50 +902,106 @@ function buildComponents(tokens) {
880
902
  disableElevation: true
881
903
  },
882
904
  styleOverrides: {
883
- root: {
884
- borderRadius: radius6.md,
885
- fontWeight: 600,
886
- boxShadow: tokenShadows.xs,
887
- height: 32,
888
- padding: "6px 12px",
889
- fontSize: 14,
890
- lineHeight: "20px",
891
- "&:focus-visible": {
892
- boxShadow: focusRings6.brandShadowXs
893
- }
894
- },
895
- containedPrimary: {
896
- backgroundColor: buttonColors6.primary.bg,
897
- "&:hover": {
898
- backgroundColor: buttonColors6.primary.bgHover
899
- }
900
- },
901
- outlinedPrimary: {
902
- borderColor: buttonColors6.secondaryColor.border,
903
- color: buttonColors6.secondaryColor.fg,
904
- "&:hover": {
905
- backgroundColor: buttonColors6.secondaryColor.bgHover,
906
- borderColor: buttonColors6.secondaryColor.borderHover
907
- }
908
- },
909
- containedSecondary: {
910
- backgroundColor: buttonColors6.secondary.bg,
911
- color: buttonColors6.secondary.fg,
912
- border: `1px solid ${buttonColors6.secondary.border}`,
913
- "&:hover": {
914
- backgroundColor: buttonColors6.secondary.bgHover,
915
- borderColor: buttonColors6.secondary.borderHover
916
- }
905
+ // The interactive behaviour (faux-3D bevel that flips on hover, a
906
+ // light sweep via ::before, brightness lift on filled, active press)
907
+ // mirrors the forest-web Button. Colors are untouched — the bevel and
908
+ // sweep use translucent `currentColor` so they adapt per variant.
909
+ // Applied to `contained` + `outlined`; `text` keeps its flat styling.
910
+ root: ({ ownerState }) => {
911
+ const interactive = ownerState.variant !== "text";
912
+ const isContained = ownerState.variant === "contained";
913
+ const isOutlined = ownerState.variant === "outlined";
914
+ const sweepColor = isOutlined ? "color-mix(in srgb, currentColor 45%, #fff)" : "currentColor";
915
+ const colorScales = { error: error2, warning: warning2, success: success2, info: info3 };
916
+ const faceScale = ownerState.color ? colorScales[ownerState.color] : void 0;
917
+ return {
918
+ borderRadius: radius6.md,
919
+ fontWeight: 600,
920
+ boxShadow: tokenShadows.xs,
921
+ height: 32,
922
+ padding: "6px 12px",
923
+ fontSize: 14,
924
+ lineHeight: "20px",
925
+ "&:focus-visible": {
926
+ boxShadow: focusRings6.brandShadowXs
927
+ },
928
+ ...interactive && {
929
+ position: "relative",
930
+ overflow: "hidden",
931
+ transition: "filter 300ms ease, border-width 300ms ease, border-radius 300ms ease, opacity 300ms ease, background-color 300ms ease",
932
+ borderStyle: "solid",
933
+ borderTopWidth: 1,
934
+ borderRightWidth: 1,
935
+ borderLeftWidth: 1,
936
+ borderBottomWidth: 4,
937
+ // Round the thick-bevel side more than the rest so the inner
938
+ // surface isn't squared off. Follows the bevel: bottom at rest,
939
+ // top on hover.
940
+ borderBottomLeftRadius: radius6.lg,
941
+ borderBottomRightRadius: radius6.lg,
942
+ // Contained buttons have no border of their own — give them a
943
+ // translucent bevel. Outlined keeps its own border color.
944
+ ...isContained && {
945
+ // Greyscale bevel — visible on both the charcoal face and a
946
+ // light page (white washed out on hover). Semantic colors keep
947
+ // their in-hue bevel.
948
+ borderColor: faceScale ? faceScale[700] : gray[600]
949
+ },
950
+ "&::before": {
951
+ content: '""',
952
+ position: "absolute",
953
+ left: 0,
954
+ top: "-150%",
955
+ width: "100%",
956
+ height: 5,
957
+ borderRadius: 4,
958
+ backgroundColor: sweepColor,
959
+ boxShadow: `0 0 24px 4px ${sweepColor}`,
960
+ opacity: isOutlined ? 0.2 : 0.3,
961
+ filter: isOutlined ? "blur(3px)" : "blur(2px)",
962
+ pointerEvents: "none",
963
+ transition: "top 500ms ease-in-out"
964
+ },
965
+ "&:hover": {
966
+ borderTopWidth: 4,
967
+ borderBottomWidth: 1,
968
+ borderTopLeftRadius: radius6.lg,
969
+ borderTopRightRadius: radius6.lg,
970
+ borderBottomLeftRadius: radius6.md,
971
+ borderBottomRightRadius: radius6.md,
972
+ // One step lighter than the default bevel (60% → 70%) so it
973
+ // stays visible against the brightened face on hover.
974
+ ...isContained && {
975
+ filter: "brightness(1.5)",
976
+ // Charcoal (non-semantic) keeps its default gray[600] border —
977
+ // the brightness lift lightens it on hover. Semantic colors
978
+ // darken to [900] so their bevel survives the brightness.
979
+ ...faceScale && { borderColor: faceScale[900] }
980
+ }
981
+ },
982
+ "&:hover::before": {
983
+ top: "150%"
984
+ },
985
+ "&:active": {
986
+ opacity: 0.75
987
+ },
988
+ "@media (prefers-reduced-motion: reduce)": {
989
+ transition: "none",
990
+ "&::before": { display: "none" }
991
+ }
992
+ }
993
+ };
917
994
  },
995
+ // Primary and Secondary are intentionally identical (greyscale system).
996
+ containedPrimary: containedFill,
997
+ containedSecondary: containedFill,
998
+ outlinedPrimary: outlinedFill,
999
+ outlinedSecondary: outlinedFill,
918
1000
  text: {
919
1001
  boxShadow: "none"
920
1002
  },
921
- textPrimary: {
922
- color: buttonColors6.tertiaryColor.fg,
923
- "&:hover": {
924
- backgroundColor: buttonColors6.tertiaryColor.bgHover
925
- }
926
- }
1003
+ textPrimary: textFill,
1004
+ textSecondary: textFill
927
1005
  }
928
1006
  },
929
1007
  // ─── Button Group ───────────────────────────────────────────────
@@ -1128,6 +1206,12 @@ function buildComponents(tokens) {
1128
1206
  "&.Mui-selected": {
1129
1207
  backgroundColor: info3[50],
1130
1208
  color: info3[700],
1209
+ // ListItemText primary hardcodes its own color (text.secondary),
1210
+ // which beats the inherited MenuItem color — re-point it here so
1211
+ // selected labels actually take the info color (e.g. MultiSelect).
1212
+ "& .MuiListItemText-primary": {
1213
+ color: info3[700]
1214
+ },
1131
1215
  "&:hover": {
1132
1216
  backgroundColor: info3[100]
1133
1217
  }
@@ -3997,4 +4081,4 @@ export {
3997
4081
  forestTheme,
3998
4082
  forestThemeOptions
3999
4083
  };
4000
- //# sourceMappingURL=chunk-MIJBSV5Z.mjs.map
4084
+ //# sourceMappingURL=chunk-I3T6PQLZ.mjs.map