@matteoaliano/forest-ui 0.8.7 → 0.8.9
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/{chunk-YFN5RIF5.mjs → chunk-2XQSGP7X.mjs} +134 -41
- package/dist/chunk-2XQSGP7X.mjs.map +1 -0
- package/dist/index.js +133 -40
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/theme.js +133 -40
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +1 -1
- package/package.json +1 -1
- package/skills/forest-alkemy-plus/SKILL.md +1 -1
- package/dist/chunk-YFN5RIF5.mjs.map +0 -1
package/dist/index.mjs
CHANGED
package/dist/theme.js
CHANGED
|
@@ -936,6 +936,28 @@ function buildComponents(tokens) {
|
|
|
936
936
|
avatarColors: avatarColors6,
|
|
937
937
|
breadcrumbColors: breadcrumbColors6
|
|
938
938
|
} = tokens;
|
|
939
|
+
const containedFill = {
|
|
940
|
+
backgroundColor: buttonColors6.primary.bg,
|
|
941
|
+
color: buttonColors6.primary.fg,
|
|
942
|
+
"&:hover": {
|
|
943
|
+
backgroundColor: buttonColors6.primary.bgHover
|
|
944
|
+
}
|
|
945
|
+
};
|
|
946
|
+
const outlinedFill = {
|
|
947
|
+
borderColor: buttonColors6.secondaryColor.border,
|
|
948
|
+
color: buttonColors6.secondaryColor.fg,
|
|
949
|
+
"&:hover": {
|
|
950
|
+
// Darken the whole outlined button on hover via brightness (< 1) — single
|
|
951
|
+
// mechanism, no separate border-color change. 0.97 is a barely-there darken.
|
|
952
|
+
filter: "brightness(0.97)"
|
|
953
|
+
}
|
|
954
|
+
};
|
|
955
|
+
const textFill = {
|
|
956
|
+
color: buttonColors6.tertiaryColor.fg,
|
|
957
|
+
"&:hover": {
|
|
958
|
+
backgroundColor: buttonColors6.tertiaryColor.bgHover
|
|
959
|
+
}
|
|
960
|
+
};
|
|
939
961
|
return {
|
|
940
962
|
// ─── CssBaseline (global) ───────────────────────────────────────
|
|
941
963
|
MuiCssBaseline: {
|
|
@@ -951,50 +973,115 @@ function buildComponents(tokens) {
|
|
|
951
973
|
disableElevation: true
|
|
952
974
|
},
|
|
953
975
|
styleOverrides: {
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
"
|
|
963
|
-
|
|
964
|
-
}
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
976
|
+
// The interactive behaviour (faux-3D bevel that flips on hover, a
|
|
977
|
+
// light sweep via ::before, brightness lift on filled, active press)
|
|
978
|
+
// mirrors the forest-web Button. Colors are untouched — the bevel and
|
|
979
|
+
// sweep use translucent `currentColor` so they adapt per variant.
|
|
980
|
+
// Applied to `contained` + `outlined`; `text` keeps its flat styling.
|
|
981
|
+
root: ({ ownerState }) => {
|
|
982
|
+
const interactive = ownerState.variant !== "text";
|
|
983
|
+
const isContained = ownerState.variant === "contained";
|
|
984
|
+
const isOutlined = ownerState.variant === "outlined";
|
|
985
|
+
const sweepColor = isOutlined ? "color-mix(in srgb, currentColor 45%, #fff)" : "currentColor";
|
|
986
|
+
const colorScales = { error: error2, warning: warning2, success: success2, info: info3 };
|
|
987
|
+
const faceScale = ownerState.color ? colorScales[ownerState.color] : void 0;
|
|
988
|
+
return {
|
|
989
|
+
borderRadius: radius6.md,
|
|
990
|
+
fontWeight: 600,
|
|
991
|
+
boxShadow: tokenShadows.xs,
|
|
992
|
+
height: 32,
|
|
993
|
+
padding: "6px 12px",
|
|
994
|
+
fontSize: 14,
|
|
995
|
+
lineHeight: "20px",
|
|
996
|
+
"&:focus-visible": {
|
|
997
|
+
boxShadow: focusRings6.brandShadowXs
|
|
998
|
+
},
|
|
999
|
+
...interactive && {
|
|
1000
|
+
position: "relative",
|
|
1001
|
+
overflow: "hidden",
|
|
1002
|
+
transition: "filter 300ms ease, border-width 300ms ease, border-radius 300ms ease, opacity 300ms ease, background-color 300ms ease",
|
|
1003
|
+
borderStyle: "solid",
|
|
1004
|
+
borderTopWidth: 1,
|
|
1005
|
+
borderRightWidth: 1,
|
|
1006
|
+
borderLeftWidth: 1,
|
|
1007
|
+
borderBottomWidth: 4,
|
|
1008
|
+
// Round the thick-bevel side more than the rest so the inner
|
|
1009
|
+
// surface isn't squared off. Follows the bevel: bottom at rest,
|
|
1010
|
+
// top on hover.
|
|
1011
|
+
borderBottomLeftRadius: radius6.lg,
|
|
1012
|
+
borderBottomRightRadius: radius6.lg,
|
|
1013
|
+
// Contained buttons have no border of their own — give them a
|
|
1014
|
+
// translucent bevel. Outlined keeps its own border color.
|
|
1015
|
+
...isContained && {
|
|
1016
|
+
// Greyscale bevel — visible on both the charcoal face and a
|
|
1017
|
+
// light page (white washed out on hover). Semantic colors keep
|
|
1018
|
+
// their in-hue bevel.
|
|
1019
|
+
borderColor: faceScale ? faceScale[700] : gray[600]
|
|
1020
|
+
},
|
|
1021
|
+
"&::before": {
|
|
1022
|
+
content: '""',
|
|
1023
|
+
position: "absolute",
|
|
1024
|
+
left: 0,
|
|
1025
|
+
top: "-150%",
|
|
1026
|
+
width: "100%",
|
|
1027
|
+
height: 5,
|
|
1028
|
+
borderRadius: 4,
|
|
1029
|
+
backgroundColor: sweepColor,
|
|
1030
|
+
boxShadow: `0 0 24px 4px ${sweepColor}`,
|
|
1031
|
+
opacity: isOutlined ? 0.2 : 0.3,
|
|
1032
|
+
filter: isOutlined ? "blur(3px)" : "blur(2px)",
|
|
1033
|
+
pointerEvents: "none",
|
|
1034
|
+
transition: "top 500ms ease-in-out"
|
|
1035
|
+
},
|
|
1036
|
+
"&:hover": {
|
|
1037
|
+
borderTopWidth: 4,
|
|
1038
|
+
borderBottomWidth: 1,
|
|
1039
|
+
borderTopLeftRadius: radius6.lg,
|
|
1040
|
+
borderTopRightRadius: radius6.lg,
|
|
1041
|
+
borderBottomLeftRadius: radius6.md,
|
|
1042
|
+
borderBottomRightRadius: radius6.md,
|
|
1043
|
+
// One step lighter than the default bevel (60% → 70%) so it
|
|
1044
|
+
// stays visible against the brightened face on hover.
|
|
1045
|
+
...isContained && {
|
|
1046
|
+
filter: "brightness(1.5)",
|
|
1047
|
+
// Charcoal (non-semantic) keeps its default gray[600] border —
|
|
1048
|
+
// the brightness lift lightens it on hover. Semantic colors
|
|
1049
|
+
// darken to [900] so their bevel survives the brightness.
|
|
1050
|
+
...faceScale && { borderColor: faceScale[900] }
|
|
1051
|
+
}
|
|
1052
|
+
},
|
|
1053
|
+
"&:hover::before": {
|
|
1054
|
+
top: "150%"
|
|
1055
|
+
},
|
|
1056
|
+
// Press: collapse the raised top bevel back to a thin edge so the
|
|
1057
|
+
// surface visibly sinks — the button reads as pushed deeper into
|
|
1058
|
+
// the page. Animated by the shared border-width transition above.
|
|
1059
|
+
"&:active": {
|
|
1060
|
+
// Snap the press faster than the 300ms hover flip so it feels
|
|
1061
|
+
// like a tactile click rather than a slow settle.
|
|
1062
|
+
transition: "border-width 120ms ease, border-radius 120ms ease, opacity 120ms ease",
|
|
1063
|
+
borderTopWidth: 1,
|
|
1064
|
+
borderTopLeftRadius: radius6.md,
|
|
1065
|
+
borderTopRightRadius: radius6.md,
|
|
1066
|
+
opacity: 0.75
|
|
1067
|
+
},
|
|
1068
|
+
"@media (prefers-reduced-motion: reduce)": {
|
|
1069
|
+
transition: "none",
|
|
1070
|
+
"&::before": { display: "none" }
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
};
|
|
988
1074
|
},
|
|
1075
|
+
// Primary and Secondary are intentionally identical (greyscale system).
|
|
1076
|
+
containedPrimary: containedFill,
|
|
1077
|
+
containedSecondary: containedFill,
|
|
1078
|
+
outlinedPrimary: outlinedFill,
|
|
1079
|
+
outlinedSecondary: outlinedFill,
|
|
989
1080
|
text: {
|
|
990
1081
|
boxShadow: "none"
|
|
991
1082
|
},
|
|
992
|
-
textPrimary:
|
|
993
|
-
|
|
994
|
-
"&:hover": {
|
|
995
|
-
backgroundColor: buttonColors6.tertiaryColor.bgHover
|
|
996
|
-
}
|
|
997
|
-
}
|
|
1083
|
+
textPrimary: textFill,
|
|
1084
|
+
textSecondary: textFill
|
|
998
1085
|
}
|
|
999
1086
|
},
|
|
1000
1087
|
// ─── Button Group ───────────────────────────────────────────────
|
|
@@ -1199,6 +1286,12 @@ function buildComponents(tokens) {
|
|
|
1199
1286
|
"&.Mui-selected": {
|
|
1200
1287
|
backgroundColor: info3[50],
|
|
1201
1288
|
color: info3[700],
|
|
1289
|
+
// ListItemText primary hardcodes its own color (text.secondary),
|
|
1290
|
+
// which beats the inherited MenuItem color — re-point it here so
|
|
1291
|
+
// selected labels actually take the info color (e.g. MultiSelect).
|
|
1292
|
+
"& .MuiListItemText-primary": {
|
|
1293
|
+
color: info3[700]
|
|
1294
|
+
},
|
|
1202
1295
|
"&:hover": {
|
|
1203
1296
|
backgroundColor: info3[100]
|
|
1204
1297
|
}
|