@verma-consulting/design-library 0.1.56 → 0.1.57
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 +41 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +41 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1087,6 +1087,16 @@ var EmptyState_default = EmptyState;
|
|
|
1087
1087
|
import { Box as Box7, Button, Icon, Typography as Typography4 } from "@mui/material";
|
|
1088
1088
|
import { alpha as alpha8, useTheme as useTheme7 } from "@mui/material/styles";
|
|
1089
1089
|
import { jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1090
|
+
function glassSurface2(theme) {
|
|
1091
|
+
return {
|
|
1092
|
+
backdropFilter: "blur(12px)",
|
|
1093
|
+
WebkitBackdropFilter: "blur(12px)",
|
|
1094
|
+
backgroundColor: theme.palette.mode === "dark" ? "rgba(255,255,255,0.06)" : "rgba(255,255,255,0.88)"
|
|
1095
|
+
};
|
|
1096
|
+
}
|
|
1097
|
+
function isSemanticColor(c) {
|
|
1098
|
+
return c === "warning" || c === "success" || c === "error" || c === "secondary" || c === "info";
|
|
1099
|
+
}
|
|
1090
1100
|
function renderIconSlot(node, side) {
|
|
1091
1101
|
if (node == null) return null;
|
|
1092
1102
|
const spacing = side === "left" ? { pr: 1 } : { ml: 1 };
|
|
@@ -1129,23 +1139,46 @@ var Pill = ({
|
|
|
1129
1139
|
disabled = false
|
|
1130
1140
|
}) => {
|
|
1131
1141
|
const theme = useTheme7();
|
|
1142
|
+
const semantic = isSemanticColor(color);
|
|
1143
|
+
const buttonColor = semantic ? color : color === "inherit" ? "inherit" : color != null ? color : "primary";
|
|
1144
|
+
const neutralChrome = !semantic;
|
|
1145
|
+
const hoverShadow = theme.palette.mode === "dark" ? "0 10px 22px rgba(0,0,0,0.34)" : "0 10px 20px rgba(15,23,42,0.14)";
|
|
1146
|
+
let chromeSx;
|
|
1147
|
+
if (neutralChrome) {
|
|
1148
|
+
chromeSx = {
|
|
1149
|
+
borderColor: isSelected ? alpha8(theme.palette.primary.main, 0.34) : alpha8(theme.palette.text.primary, 0.18),
|
|
1150
|
+
color: isSelected ? "primary.main" : "text.primary",
|
|
1151
|
+
"&:hover": {
|
|
1152
|
+
...glassSurface2(theme),
|
|
1153
|
+
borderColor: alpha8(theme.palette.primary.main, 0.42),
|
|
1154
|
+
boxShadow: hoverShadow
|
|
1155
|
+
}
|
|
1156
|
+
};
|
|
1157
|
+
} else {
|
|
1158
|
+
const c = color;
|
|
1159
|
+
const main = theme.palette[c].main;
|
|
1160
|
+
chromeSx = {
|
|
1161
|
+
borderColor: isSelected ? alpha8(main, 0.34) : alpha8(main, 0.18),
|
|
1162
|
+
color: `${c}.main`,
|
|
1163
|
+
"&:hover": {
|
|
1164
|
+
...glassSurface2(theme),
|
|
1165
|
+
borderColor: alpha8(main, 0.42),
|
|
1166
|
+
boxShadow: hoverShadow
|
|
1167
|
+
}
|
|
1168
|
+
};
|
|
1169
|
+
}
|
|
1132
1170
|
return /* @__PURE__ */ jsx11(
|
|
1133
1171
|
Button,
|
|
1134
1172
|
{
|
|
1135
1173
|
variant: isSelected ? "contained" : "outlined",
|
|
1136
|
-
color:
|
|
1174
|
+
color: buttonColor,
|
|
1137
1175
|
sx: {
|
|
1138
|
-
...
|
|
1176
|
+
...glassSurface2(theme),
|
|
1139
1177
|
borderRadius: 16,
|
|
1140
1178
|
padding: "8px 16px",
|
|
1141
1179
|
minHeight: 38,
|
|
1142
1180
|
textTransform: "none",
|
|
1143
|
-
|
|
1144
|
-
color: isSelected ? "primary.main" : "text.primary",
|
|
1145
|
-
"&:hover": {
|
|
1146
|
-
borderColor: alpha8(theme.palette.primary.main, 0.42),
|
|
1147
|
-
boxShadow: theme.palette.mode === "dark" ? "0 10px 22px rgba(0,0,0,0.34)" : "0 10px 20px rgba(15,23,42,0.14)"
|
|
1148
|
-
}
|
|
1181
|
+
...chromeSx
|
|
1149
1182
|
},
|
|
1150
1183
|
onClick,
|
|
1151
1184
|
disabled,
|