@mond-design-system/react 2.0.0 → 3.0.0
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.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +35 -4
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +11 -6
- package/dist/index.d.ts +11 -6
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -103,14 +103,14 @@ function Spinner({
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/Icon/Icon.module.css?mds-scoped
|
|
106
|
-
var Icon_module_default = { "icon": "mds-Icon__icon", "size-sm": "mds-Icon__size-sm", "size-md": "mds-Icon__size-md", "size-lg": "mds-Icon__size-lg" };
|
|
106
|
+
var Icon_module_default = { "icon": "mds-Icon__icon", "size-slot": "mds-Icon__size-slot", "size-sm": "mds-Icon__size-sm", "size-md": "mds-Icon__size-md", "size-lg": "mds-Icon__size-lg" };
|
|
107
107
|
var IconContext = react.createContext(null);
|
|
108
108
|
function IconProvider({ render, children }) {
|
|
109
109
|
return /* @__PURE__ */ jsxRuntime.jsx(IconContext.Provider, { value: render, children });
|
|
110
110
|
}
|
|
111
111
|
var SIZE_PX = { sm: 16, md: 20, lg: 24 };
|
|
112
112
|
var warned = /* @__PURE__ */ new Set();
|
|
113
|
-
function Icon({ name, size
|
|
113
|
+
function Icon({ name, size, label, className, ...rest }) {
|
|
114
114
|
const render = react.useContext(IconContext);
|
|
115
115
|
if (render === null && !warned.has(name)) {
|
|
116
116
|
warned.add(name);
|
|
@@ -121,10 +121,10 @@ function Icon({ name, size = "md", label, className, ...rest }) {
|
|
|
121
121
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
122
122
|
"span",
|
|
123
123
|
{
|
|
124
|
-
className: cx(Icon_module_default.icon, Icon_module_default[`size-${size}`], className),
|
|
124
|
+
className: cx(Icon_module_default.icon, Icon_module_default[`size-${size ?? "slot"}`], className),
|
|
125
125
|
...label ? { role: "img", "aria-label": label } : { "aria-hidden": true },
|
|
126
126
|
...rest,
|
|
127
|
-
children: render?.(name, { size: SIZE_PX[size] })
|
|
127
|
+
children: render?.(name, { size: size === void 0 ? void 0 : SIZE_PX[size] })
|
|
128
128
|
}
|
|
129
129
|
);
|
|
130
130
|
}
|
|
@@ -371,7 +371,7 @@ function CountButton({
|
|
|
371
371
|
className: cx(CountButton_module_default.button, active && CountButton_module_default[`tone-${tone}`], className),
|
|
372
372
|
...rest,
|
|
373
373
|
children: [
|
|
374
|
-
loading ? /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: SPINNER_PX, label: "", "aria-hidden": "true" }) :
|
|
374
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: CountButton_module_default.glyph, children: loading ? /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: SPINNER_PX, label: "", "aria-hidden": "true" }) : icon }),
|
|
375
375
|
children != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { children }) : null
|
|
376
376
|
]
|
|
377
377
|
}
|