@portnet/ui 0.1.30 → 0.1.31
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 }; }
|
|
@@ -117,7 +117,8 @@ const PuiChip = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
117
117
|
sx,
|
|
118
118
|
color,
|
|
119
119
|
fullWidth,
|
|
120
|
-
children
|
|
120
|
+
children,
|
|
121
|
+
icon
|
|
121
122
|
} = _ref,
|
|
122
123
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
123
124
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiTooltip.default, {
|
|
@@ -132,7 +133,10 @@ const PuiChip = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
132
133
|
width: fullWidth ? "100%" : "fit-content"
|
|
133
134
|
}),
|
|
134
135
|
className,
|
|
135
|
-
label: children
|
|
136
|
+
label: children,
|
|
137
|
+
icon: icon ? /*#__PURE__*/(0, _jsxRuntime.jsx)(Avatar, {
|
|
138
|
+
children: iconMapping[icon]
|
|
139
|
+
}) : null
|
|
136
140
|
}, rest))
|
|
137
141
|
});
|
|
138
142
|
});
|
|
@@ -141,7 +145,8 @@ PuiChip.propTypes = {
|
|
|
141
145
|
className: _propTypes.default.string,
|
|
142
146
|
sx: _propTypes.default.object,
|
|
143
147
|
fullWidth: _propTypes.default.bool,
|
|
144
|
-
color: _propTypes.default.oneOf(["primary", "secondary", "info", "success", "warning", "error"])
|
|
148
|
+
color: _propTypes.default.oneOf(["primary", "secondary", "info", "success", "warning", "error"]),
|
|
149
|
+
icon: _propTypes.default.oneOf(["success", "error", "info"]) // Prop icon pour spécifier l'icône
|
|
145
150
|
};
|
|
146
151
|
PuiChip.defaultProps = {
|
|
147
152
|
color: "primary"
|