@fairmint/ui 0.3.41 → 0.3.43
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/README.md +0 -3
- package/dist/components/primitives/muiCompat.cjs +34 -1
- package/dist/components/primitives/muiCompat.cjs.map +1 -1
- package/dist/components/primitives/muiCompat.d.ts +1 -1
- package/dist/components/primitives/muiCompat.d.ts.map +1 -1
- package/dist/components/primitives/muiCompat.js +34 -1
- package/dist/components/primitives/muiCompat.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,9 +5,6 @@ Fairmint's shared design system and UI component library.
|
|
|
5
5
|
## Documentation
|
|
6
6
|
|
|
7
7
|
- [@fairmint/ui shared components](https://github.com/Fairmint/dev-docs/blob/main/docs/development/ui.md)
|
|
8
|
-
- [GitHub wiki](https://github.com/Fairmint/ui/wiki)
|
|
9
|
-
|
|
10
|
-
The canonical developer map is now in Fairmint/dev-docs. The GitHub wiki remains until that replacement is on main, then it will be disabled.
|
|
11
8
|
|
|
12
9
|
## Design quality
|
|
13
10
|
|
|
@@ -24,6 +24,7 @@ const Modal = require("../../node_modules/@mantine/core/esm/components/Modal/Mod
|
|
|
24
24
|
const Stack$1 = require("../../node_modules/@mantine/core/esm/components/Stack/Stack.cjs");
|
|
25
25
|
const Menu = require("../../node_modules/@mantine/core/esm/components/Menu/Menu.cjs");
|
|
26
26
|
const TextInput = require("../../node_modules/@mantine/core/esm/components/TextInput/TextInput.cjs");
|
|
27
|
+
const colors = require("../../theme/colors.cjs");
|
|
27
28
|
dayjs_min.extend(customParseFormat);
|
|
28
29
|
const compatBreakpointKeys = ["xs", "sm", "md", "lg", "xl"];
|
|
29
30
|
const compatFallbackBreakpoints = {
|
|
@@ -96,6 +97,34 @@ const mapCompatSize = (size) => {
|
|
|
96
97
|
}
|
|
97
98
|
return void 0;
|
|
98
99
|
};
|
|
100
|
+
const mantineChipVariants = /* @__PURE__ */ new Set([
|
|
101
|
+
"default",
|
|
102
|
+
"dot",
|
|
103
|
+
"filled",
|
|
104
|
+
"gradient",
|
|
105
|
+
"light",
|
|
106
|
+
"outline",
|
|
107
|
+
"transparent",
|
|
108
|
+
"white"
|
|
109
|
+
]);
|
|
110
|
+
const mapChipVariant = (variant) => {
|
|
111
|
+
if (variant === "outlined") return "outline";
|
|
112
|
+
if (typeof variant === "string" && mantineChipVariants.has(variant)) return variant;
|
|
113
|
+
return void 0;
|
|
114
|
+
};
|
|
115
|
+
const chipBadgeColorMap = {
|
|
116
|
+
default: colors.colors.neutral,
|
|
117
|
+
error: colors.colors.error,
|
|
118
|
+
info: colors.colors.info,
|
|
119
|
+
primary: colors.colors.primary,
|
|
120
|
+
secondary: colors.colors.neutral,
|
|
121
|
+
success: colors.colors.success,
|
|
122
|
+
warning: colors.colors.warning
|
|
123
|
+
};
|
|
124
|
+
const mapChipBadgeColor = (color) => {
|
|
125
|
+
if (typeof color !== "string" || !color) return colors.colors.neutral;
|
|
126
|
+
return chipBadgeColorMap[color] || color;
|
|
127
|
+
};
|
|
99
128
|
const mapCompatIconButtonSize = (size) => size === "small" ? "sm" : size === "medium" ? "md" : size === "large" ? "lg" : size;
|
|
100
129
|
const optionalBoolean = (value) => typeof value === "boolean" ? value : void 0;
|
|
101
130
|
const optionalString = (value) => typeof value === "string" ? value : void 0;
|
|
@@ -893,7 +922,9 @@ const Chip = ({
|
|
|
893
922
|
icon,
|
|
894
923
|
onClick,
|
|
895
924
|
onDelete,
|
|
925
|
+
size,
|
|
896
926
|
sx: sx2,
|
|
927
|
+
variant,
|
|
897
928
|
...props
|
|
898
929
|
}) => {
|
|
899
930
|
const chipClassName = [
|
|
@@ -948,9 +979,11 @@ const Chip = ({
|
|
|
948
979
|
Badge.Badge,
|
|
949
980
|
{
|
|
950
981
|
className: chipClassName,
|
|
951
|
-
color:
|
|
982
|
+
color: mapChipBadgeColor(color),
|
|
952
983
|
leftSection: icon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "fairmint-chip-icon", children: icon }) : void 0,
|
|
984
|
+
size: mapCompatSize(size),
|
|
953
985
|
style: { textTransform: "none", ...sxToStyle(sx2) },
|
|
986
|
+
variant: mapChipVariant(variant),
|
|
954
987
|
...props,
|
|
955
988
|
children: content
|
|
956
989
|
}
|