@verma-consulting/design-library 0.1.55 → 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 CHANGED
@@ -1124,6 +1124,16 @@ var EmptyState_default = EmptyState;
1124
1124
  var import_material10 = require("@mui/material");
1125
1125
  var import_styles9 = require("@mui/material/styles");
1126
1126
  var import_jsx_runtime11 = require("react/jsx-runtime");
1127
+ function glassSurface2(theme) {
1128
+ return {
1129
+ backdropFilter: "blur(12px)",
1130
+ WebkitBackdropFilter: "blur(12px)",
1131
+ backgroundColor: theme.palette.mode === "dark" ? "rgba(255,255,255,0.06)" : "rgba(255,255,255,0.88)"
1132
+ };
1133
+ }
1134
+ function isSemanticColor(c) {
1135
+ return c === "warning" || c === "success" || c === "error" || c === "secondary" || c === "info";
1136
+ }
1127
1137
  function renderIconSlot(node, side) {
1128
1138
  if (node == null) return null;
1129
1139
  const spacing = side === "left" ? { pr: 1 } : { ml: 1 };
@@ -1166,23 +1176,46 @@ var Pill = ({
1166
1176
  disabled = false
1167
1177
  }) => {
1168
1178
  const theme = (0, import_styles9.useTheme)();
1179
+ const semantic = isSemanticColor(color);
1180
+ const buttonColor = semantic ? color : color === "inherit" ? "inherit" : color != null ? color : "primary";
1181
+ const neutralChrome = !semantic;
1182
+ const hoverShadow = theme.palette.mode === "dark" ? "0 10px 22px rgba(0,0,0,0.34)" : "0 10px 20px rgba(15,23,42,0.14)";
1183
+ let chromeSx;
1184
+ if (neutralChrome) {
1185
+ chromeSx = {
1186
+ borderColor: isSelected ? (0, import_styles9.alpha)(theme.palette.primary.main, 0.34) : (0, import_styles9.alpha)(theme.palette.text.primary, 0.18),
1187
+ color: isSelected ? "primary.main" : "text.primary",
1188
+ "&:hover": {
1189
+ ...glassSurface2(theme),
1190
+ borderColor: (0, import_styles9.alpha)(theme.palette.primary.main, 0.42),
1191
+ boxShadow: hoverShadow
1192
+ }
1193
+ };
1194
+ } else {
1195
+ const c = color;
1196
+ const main = theme.palette[c].main;
1197
+ chromeSx = {
1198
+ borderColor: isSelected ? (0, import_styles9.alpha)(main, 0.34) : (0, import_styles9.alpha)(main, 0.18),
1199
+ color: `${c}.main`,
1200
+ "&:hover": {
1201
+ ...glassSurface2(theme),
1202
+ borderColor: (0, import_styles9.alpha)(main, 0.42),
1203
+ boxShadow: hoverShadow
1204
+ }
1205
+ };
1206
+ }
1169
1207
  return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1170
1208
  import_material10.Button,
1171
1209
  {
1172
1210
  variant: isSelected ? "contained" : "outlined",
1173
- color: color != null ? color : "primary",
1211
+ color: buttonColor,
1174
1212
  sx: {
1175
- ...glassSurface(theme),
1213
+ ...glassSurface2(theme),
1176
1214
  borderRadius: 16,
1177
1215
  padding: "8px 16px",
1178
1216
  minHeight: 38,
1179
1217
  textTransform: "none",
1180
- borderColor: isSelected ? (0, import_styles9.alpha)(theme.palette.primary.main, 0.34) : (0, import_styles9.alpha)(theme.palette.text.primary, 0.18),
1181
- color: isSelected ? "primary.main" : "text.primary",
1182
- "&:hover": {
1183
- borderColor: (0, import_styles9.alpha)(theme.palette.primary.main, 0.42),
1184
- boxShadow: theme.palette.mode === "dark" ? "0 10px 22px rgba(0,0,0,0.34)" : "0 10px 20px rgba(15,23,42,0.14)"
1185
- }
1218
+ ...chromeSx
1186
1219
  },
1187
1220
  onClick,
1188
1221
  disabled,