react-better-html 1.1.98 → 1.1.100
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.d.mts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +12 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2487,7 +2487,6 @@ var Image_default = { Image: MemoizedImage }.Image;
|
|
|
2487
2487
|
|
|
2488
2488
|
// src/components/Button.tsx
|
|
2489
2489
|
import { memo as memo7, useCallback as useCallback4 } from "react";
|
|
2490
|
-
import { Link } from "react-router-dom";
|
|
2491
2490
|
import styled6, { css } from "styled-components";
|
|
2492
2491
|
import { jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
2493
2492
|
var ButtonElement = styled6.button.withConfig({
|
|
@@ -2570,7 +2569,7 @@ var ButtonComponent = function Button({
|
|
|
2570
2569
|
const isLoadingElement = isLoading ?? isLoadingHook;
|
|
2571
2570
|
const styledComponentStyles = useStyledComponentStyles(
|
|
2572
2571
|
{
|
|
2573
|
-
...betterHtmlContext2.components.button?.default,
|
|
2572
|
+
...betterHtmlContext2.components.button?.style?.default,
|
|
2574
2573
|
...props
|
|
2575
2574
|
},
|
|
2576
2575
|
theme2
|
|
@@ -2602,10 +2601,12 @@ var ButtonComponent = function Button({
|
|
|
2602
2601
|
height: imageHeight
|
|
2603
2602
|
}
|
|
2604
2603
|
) : void 0;
|
|
2604
|
+
const linkComponentTag = betterHtmlContext2.components.button?.linkComponent ?? "a";
|
|
2605
|
+
const buttonComponentTag = betterHtmlContext2.components.button?.buttonComponent ?? "button";
|
|
2605
2606
|
return /* @__PURE__ */ jsxs3(
|
|
2606
2607
|
ButtonElement,
|
|
2607
2608
|
{
|
|
2608
|
-
as: href ?
|
|
2609
|
+
as: href ? linkComponentTag : buttonComponentTag,
|
|
2609
2610
|
theme: theme2,
|
|
2610
2611
|
colorTheme: betterHtmlContext2.colorTheme,
|
|
2611
2612
|
isSmall,
|
|
@@ -2613,6 +2614,7 @@ var ButtonComponent = function Button({
|
|
|
2613
2614
|
isLoading: isLoadingElement,
|
|
2614
2615
|
disabled,
|
|
2615
2616
|
to: href,
|
|
2617
|
+
href,
|
|
2616
2618
|
download,
|
|
2617
2619
|
target,
|
|
2618
2620
|
type: isSubmit && !isLoadingElement ? "submit" : "button",
|
|
@@ -2673,7 +2675,7 @@ ButtonComponent.secondary = function Secondary({ className, ...props }) {
|
|
|
2673
2675
|
return /* @__PURE__ */ jsx7(
|
|
2674
2676
|
ButtonComponent,
|
|
2675
2677
|
{
|
|
2676
|
-
...betterHtmlContext2.components.button?.secondary,
|
|
2678
|
+
...betterHtmlContext2.components.button?.style?.secondary,
|
|
2677
2679
|
className: `secondary${className ? ` ${className}` : ""}`,
|
|
2678
2680
|
color: theme2.colors.textPrimary,
|
|
2679
2681
|
...props
|
|
@@ -2686,7 +2688,7 @@ ButtonComponent.destructive = function Destructive(props) {
|
|
|
2686
2688
|
return /* @__PURE__ */ jsx7(
|
|
2687
2689
|
ButtonComponent,
|
|
2688
2690
|
{
|
|
2689
|
-
...betterHtmlContext2.components.button?.destructive,
|
|
2691
|
+
...betterHtmlContext2.components.button?.style?.destructive,
|
|
2690
2692
|
backgroundColor: theme2.colors.error,
|
|
2691
2693
|
color: theme2.colors.base,
|
|
2692
2694
|
...props
|
|
@@ -2701,7 +2703,7 @@ ButtonComponent.icon = function Icon3({ size = 16, backgroundButtonColor, ...pro
|
|
|
2701
2703
|
return /* @__PURE__ */ jsx7(
|
|
2702
2704
|
ButtonComponent,
|
|
2703
2705
|
{
|
|
2704
|
-
...betterHtmlContext2.components.button?.icon,
|
|
2706
|
+
...betterHtmlContext2.components.button?.style?.icon,
|
|
2705
2707
|
width: buttonSize,
|
|
2706
2708
|
height: buttonSize,
|
|
2707
2709
|
color: theme2.colors.textPrimary,
|
|
@@ -2733,7 +2735,7 @@ ButtonComponent.upload = function Upload({ accept, multiple, onUpload, ...props
|
|
|
2733
2735
|
return /* @__PURE__ */ jsx7(
|
|
2734
2736
|
ButtonComponent,
|
|
2735
2737
|
{
|
|
2736
|
-
...betterHtmlContext2.components.button?.upload,
|
|
2738
|
+
...betterHtmlContext2.components.button?.style?.upload,
|
|
2737
2739
|
text: "Upload",
|
|
2738
2740
|
icon: "uploadCloud",
|
|
2739
2741
|
onClick: onClickElement,
|