@allxsmith/bestax-bulma 5.1.3 → 5.2.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/dist/index.cjs.js
CHANGED
|
@@ -1157,6 +1157,18 @@ Pagination.Ellipsis = PaginationEllipsis;
|
|
|
1157
1157
|
Pagination.Previous = PaginationPrevious;
|
|
1158
1158
|
Pagination.Next = PaginationNext;
|
|
1159
1159
|
|
|
1160
|
+
function stripRedundantLibraryPrefix(name, library) {
|
|
1161
|
+
if (!name) {
|
|
1162
|
+
return name;
|
|
1163
|
+
}
|
|
1164
|
+
if (library === 'fa' && name.startsWith('fa-')) {
|
|
1165
|
+
return name.substring(3);
|
|
1166
|
+
}
|
|
1167
|
+
if (library === 'mdi' && name.startsWith('mdi-')) {
|
|
1168
|
+
return name.substring(4);
|
|
1169
|
+
}
|
|
1170
|
+
return name;
|
|
1171
|
+
}
|
|
1160
1172
|
function getIconClasses(library, name, variant, features) {
|
|
1161
1173
|
let baseClass;
|
|
1162
1174
|
let iconClass;
|
|
@@ -1230,6 +1242,7 @@ const Icon = ({ className, textColor, bgColor, name, library, variant, features,
|
|
|
1230
1242
|
}
|
|
1231
1243
|
const defaultLibrary = useIconLibrary();
|
|
1232
1244
|
const finalLibrary = library || defaultLibrary || 'fa';
|
|
1245
|
+
finalName = stripRedundantLibraryPrefix(finalName, finalLibrary);
|
|
1233
1246
|
const { bulmaHelperClasses, rest } = useBulmaClasses({
|
|
1234
1247
|
color: textColor,
|
|
1235
1248
|
backgroundColor: bgColor,
|
|
@@ -2239,7 +2252,7 @@ const DialogContainer = () => {
|
|
|
2239
2252
|
};
|
|
2240
2253
|
|
|
2241
2254
|
const validButtonColors = [...validColors, 'text', 'ghost'];
|
|
2242
|
-
const Button = ({ color, size, isLight, isRounded, isLoading, isStatic, isFullWidth, isOutlined, isInverted, isFocused, isActive, isHovered, isDisabled, className, children, textColor, bgColor, as = 'button', href, onClick, target, rel, ...props }) => {
|
|
2255
|
+
const Button = ({ color, size, isLight, isRounded, isLoading, isStatic, isFullWidth, isOutlined, isInverted, isFocused, isActive, isHovered, isDisabled, className, children, textColor, bgColor, as: Component = 'button', href, onClick, target, rel, ...props }) => {
|
|
2243
2256
|
const { bulmaHelperClasses, rest } = useBulmaClasses({
|
|
2244
2257
|
color: textColor,
|
|
2245
2258
|
backgroundColor: bgColor,
|
|
@@ -2262,9 +2275,9 @@ const Button = ({ color, size, isLight, isRounded, isLoading, isStatic, isFullWi
|
|
|
2262
2275
|
'is-fullwidth': isFullWidth,
|
|
2263
2276
|
});
|
|
2264
2277
|
const buttonClasses = classNames(bulmaClasses, bulmaHelperClasses, className);
|
|
2265
|
-
if (
|
|
2278
|
+
if (Component !== 'button') {
|
|
2266
2279
|
const { type: _type, disabled: _disabled, form: _form, formAction: _formAction, formEncType: _formEncType, formMethod: _formMethod, formNoValidate: _formNoValidate, formTarget: _formTarget, name: _name, value: _value, autoFocus: _autoFocus, ...anchorRest } = rest;
|
|
2267
|
-
return (jsxRuntime.jsx(
|
|
2280
|
+
return (jsxRuntime.jsx(Component, { className: buttonClasses, href: href, target: target, rel: rel, "aria-disabled": isDisabled, tabIndex: isDisabled ? -1 : undefined, onClick: isDisabled
|
|
2268
2281
|
? (e) => e.preventDefault()
|
|
2269
2282
|
: onClick, ...anchorRest, children: children }));
|
|
2270
2283
|
}
|
|
@@ -2677,7 +2690,7 @@ const Image = ({ as, className, textColor, bgColor, size, isRounded, isRetina, s
|
|
|
2677
2690
|
return (jsxRuntime.jsx(Tag, { className: imageClasses, ...rest, children: content }));
|
|
2678
2691
|
};
|
|
2679
2692
|
|
|
2680
|
-
const Link = ({ className, textColor, bgColor, isActive, children, ...props }) => {
|
|
2693
|
+
const Link = ({ className, textColor, bgColor, isActive, as: Component = 'a', children, ...props }) => {
|
|
2681
2694
|
const { bulmaHelperClasses, rest } = useBulmaClasses({
|
|
2682
2695
|
color: textColor,
|
|
2683
2696
|
backgroundColor: bgColor,
|
|
@@ -2687,7 +2700,7 @@ const Link = ({ className, textColor, bgColor, isActive, children, ...props }) =
|
|
|
2687
2700
|
'is-active': isActive,
|
|
2688
2701
|
});
|
|
2689
2702
|
const linkClasses = classNames(bulmaClasses, bulmaHelperClasses, className);
|
|
2690
|
-
return (jsxRuntime.jsx(
|
|
2703
|
+
return (jsxRuntime.jsx(Component, { className: linkClasses || undefined, ...rest, children: children }));
|
|
2691
2704
|
};
|
|
2692
2705
|
|
|
2693
2706
|
const ListItem = ({ className, textColor, bgColor, children, ...props }) => {
|