@portnet/ui 0.1.30 → 0.1.32
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.
|
@@ -14,7 +14,7 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
14
14
|
var _apperance = require("../../config/apperance");
|
|
15
15
|
var _PuiTooltip = _interopRequireDefault(require("./PuiTooltip"));
|
|
16
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
-
const _excluded = ["id", "className", "sx", "color", "fullWidth", "children"];
|
|
17
|
+
const _excluded = ["id", "className", "sx", "color", "fullWidth", "children", "icon"];
|
|
18
18
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
19
19
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -46,6 +46,23 @@ const PrimaryChip = (0, _styles.styled)( /*#__PURE__*/React.forwardRef((props, r
|
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
48
|
});
|
|
49
|
+
const iconMapping = {
|
|
50
|
+
success: /*#__PURE__*/(0, _jsxRuntime.jsx)(CheckCircleIcon, {
|
|
51
|
+
style: {
|
|
52
|
+
color: 'white'
|
|
53
|
+
}
|
|
54
|
+
}),
|
|
55
|
+
error: /*#__PURE__*/(0, _jsxRuntime.jsx)(ErrorIcon, {
|
|
56
|
+
style: {
|
|
57
|
+
color: 'white'
|
|
58
|
+
}
|
|
59
|
+
}),
|
|
60
|
+
info: /*#__PURE__*/(0, _jsxRuntime.jsx)(HourglassEmptyIcon, {
|
|
61
|
+
style: {
|
|
62
|
+
color: 'white'
|
|
63
|
+
}
|
|
64
|
+
})
|
|
65
|
+
};
|
|
49
66
|
const SecondaryChip = (0, _styles.styled)( /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledChip, _objectSpread({
|
|
50
67
|
ref: ref
|
|
51
68
|
}, props))))(() => {
|
|
@@ -117,7 +134,8 @@ const PuiChip = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
117
134
|
sx,
|
|
118
135
|
color,
|
|
119
136
|
fullWidth,
|
|
120
|
-
children
|
|
137
|
+
children,
|
|
138
|
+
icon
|
|
121
139
|
} = _ref,
|
|
122
140
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
123
141
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiTooltip.default, {
|
|
@@ -132,7 +150,10 @@ const PuiChip = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
132
150
|
width: fullWidth ? "100%" : "fit-content"
|
|
133
151
|
}),
|
|
134
152
|
className,
|
|
135
|
-
label: children
|
|
153
|
+
label: children,
|
|
154
|
+
icon: icon ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Avatar, {
|
|
155
|
+
children: iconMapping[icon]
|
|
156
|
+
}) : null
|
|
136
157
|
}, rest))
|
|
137
158
|
});
|
|
138
159
|
});
|
|
@@ -141,7 +162,8 @@ PuiChip.propTypes = {
|
|
|
141
162
|
className: _propTypes.default.string,
|
|
142
163
|
sx: _propTypes.default.object,
|
|
143
164
|
fullWidth: _propTypes.default.bool,
|
|
144
|
-
color: _propTypes.default.oneOf(["primary", "secondary", "info", "success", "warning", "error"])
|
|
165
|
+
color: _propTypes.default.oneOf(["primary", "secondary", "info", "success", "warning", "error"]),
|
|
166
|
+
icon: _propTypes.default.oneOf(["success", "error", "info"]) // Prop icon pour spécifier l'icône
|
|
145
167
|
};
|
|
146
168
|
PuiChip.defaultProps = {
|
|
147
169
|
color: "primary"
|