@butternutbox/pawprint-native 0.25.0 → 0.25.1
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/.turbo/turbo-build.log +5 -5
- package/CHANGELOG.md +6 -0
- package/dist/index.cjs +12 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/Button/Button.stories.tsx +90 -16
- package/src/components/atoms/Button/Button.tsx +13 -2
package/dist/index.js
CHANGED
|
@@ -1262,6 +1262,16 @@ var Button = React66.forwardRef(
|
|
|
1262
1262
|
};
|
|
1263
1263
|
};
|
|
1264
1264
|
const variantStyles = getVariantStyles(pressed);
|
|
1265
|
+
const renderIcon = (icon) => {
|
|
1266
|
+
if (!React66.isValidElement(icon)) return icon;
|
|
1267
|
+
const iconElement = icon;
|
|
1268
|
+
if (!pressed) {
|
|
1269
|
+
return icon;
|
|
1270
|
+
}
|
|
1271
|
+
return React66.cloneElement(iconElement, {
|
|
1272
|
+
customColour: variantStyles.textColor
|
|
1273
|
+
});
|
|
1274
|
+
};
|
|
1265
1275
|
return /* @__PURE__ */ jsxs(
|
|
1266
1276
|
StyledButton,
|
|
1267
1277
|
__spreadProps(__spreadValues({
|
|
@@ -1285,7 +1295,7 @@ var Button = React66.forwardRef(
|
|
|
1285
1295
|
buttonFullWidth: fullWidth
|
|
1286
1296
|
}, rest), {
|
|
1287
1297
|
children: [
|
|
1288
|
-
startIcon && /* @__PURE__ */ jsx(IconWrapper, { children: startIcon }),
|
|
1298
|
+
startIcon && /* @__PURE__ */ jsx(IconWrapper, { children: renderIcon(startIcon) }),
|
|
1289
1299
|
/* @__PURE__ */ jsx(
|
|
1290
1300
|
Typography,
|
|
1291
1301
|
{
|
|
@@ -1301,7 +1311,7 @@ var Button = React66.forwardRef(
|
|
|
1301
1311
|
children
|
|
1302
1312
|
}
|
|
1303
1313
|
),
|
|
1304
|
-
endIcon && /* @__PURE__ */ jsx(IconWrapper, { children: endIcon }),
|
|
1314
|
+
endIcon && /* @__PURE__ */ jsx(IconWrapper, { children: renderIcon(endIcon) }),
|
|
1305
1315
|
loading && /* @__PURE__ */ jsx(StyledSpinnerWrapper, { children: /* @__PURE__ */ jsx(
|
|
1306
1316
|
Spinner,
|
|
1307
1317
|
{
|