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.d.mts
CHANGED
|
@@ -731,7 +731,11 @@ type BetterHtmlConfig = {
|
|
|
731
731
|
assets: Partial<AssetsConfig>;
|
|
732
732
|
loaders: Partial<LoaderConfig>;
|
|
733
733
|
components: {
|
|
734
|
-
button?:
|
|
734
|
+
button?: {
|
|
735
|
+
style?: ComponentConfig<"default" | "secondary" | "destructive" | "icon" | "upload">;
|
|
736
|
+
buttonComponent?: React.ReactNode;
|
|
737
|
+
linkComponent?: React.ReactNode;
|
|
738
|
+
};
|
|
735
739
|
};
|
|
736
740
|
};
|
|
737
741
|
|
package/dist/index.d.ts
CHANGED
|
@@ -731,7 +731,11 @@ type BetterHtmlConfig = {
|
|
|
731
731
|
assets: Partial<AssetsConfig>;
|
|
732
732
|
loaders: Partial<LoaderConfig>;
|
|
733
733
|
components: {
|
|
734
|
-
button?:
|
|
734
|
+
button?: {
|
|
735
|
+
style?: ComponentConfig<"default" | "secondary" | "destructive" | "icon" | "upload">;
|
|
736
|
+
buttonComponent?: React.ReactNode;
|
|
737
|
+
linkComponent?: React.ReactNode;
|
|
738
|
+
};
|
|
735
739
|
};
|
|
736
740
|
};
|
|
737
741
|
|
package/dist/index.js
CHANGED
|
@@ -2566,7 +2566,6 @@ var Image_default = { Image: MemoizedImage }.Image;
|
|
|
2566
2566
|
|
|
2567
2567
|
// src/components/Button.tsx
|
|
2568
2568
|
var import_react9 = require("react");
|
|
2569
|
-
var import_react_router_dom2 = require("react-router-dom");
|
|
2570
2569
|
var import_styled_components7 = __toESM(require("styled-components"));
|
|
2571
2570
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
2572
2571
|
var ButtonElement = import_styled_components7.default.button.withConfig({
|
|
@@ -2649,7 +2648,7 @@ var ButtonComponent = function Button({
|
|
|
2649
2648
|
const isLoadingElement = isLoading ?? isLoadingHook;
|
|
2650
2649
|
const styledComponentStyles = useStyledComponentStyles(
|
|
2651
2650
|
{
|
|
2652
|
-
...betterHtmlContext2.components.button?.default,
|
|
2651
|
+
...betterHtmlContext2.components.button?.style?.default,
|
|
2653
2652
|
...props
|
|
2654
2653
|
},
|
|
2655
2654
|
theme2
|
|
@@ -2681,10 +2680,12 @@ var ButtonComponent = function Button({
|
|
|
2681
2680
|
height: imageHeight
|
|
2682
2681
|
}
|
|
2683
2682
|
) : void 0;
|
|
2683
|
+
const linkComponentTag = betterHtmlContext2.components.button?.linkComponent ?? "a";
|
|
2684
|
+
const buttonComponentTag = betterHtmlContext2.components.button?.buttonComponent ?? "button";
|
|
2684
2685
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
2685
2686
|
ButtonElement,
|
|
2686
2687
|
{
|
|
2687
|
-
as: href ?
|
|
2688
|
+
as: href ? linkComponentTag : buttonComponentTag,
|
|
2688
2689
|
theme: theme2,
|
|
2689
2690
|
colorTheme: betterHtmlContext2.colorTheme,
|
|
2690
2691
|
isSmall,
|
|
@@ -2692,6 +2693,7 @@ var ButtonComponent = function Button({
|
|
|
2692
2693
|
isLoading: isLoadingElement,
|
|
2693
2694
|
disabled,
|
|
2694
2695
|
to: href,
|
|
2696
|
+
href,
|
|
2695
2697
|
download,
|
|
2696
2698
|
target,
|
|
2697
2699
|
type: isSubmit && !isLoadingElement ? "submit" : "button",
|
|
@@ -2752,7 +2754,7 @@ ButtonComponent.secondary = function Secondary({ className, ...props }) {
|
|
|
2752
2754
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2753
2755
|
ButtonComponent,
|
|
2754
2756
|
{
|
|
2755
|
-
...betterHtmlContext2.components.button?.secondary,
|
|
2757
|
+
...betterHtmlContext2.components.button?.style?.secondary,
|
|
2756
2758
|
className: `secondary${className ? ` ${className}` : ""}`,
|
|
2757
2759
|
color: theme2.colors.textPrimary,
|
|
2758
2760
|
...props
|
|
@@ -2765,7 +2767,7 @@ ButtonComponent.destructive = function Destructive(props) {
|
|
|
2765
2767
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2766
2768
|
ButtonComponent,
|
|
2767
2769
|
{
|
|
2768
|
-
...betterHtmlContext2.components.button?.destructive,
|
|
2770
|
+
...betterHtmlContext2.components.button?.style?.destructive,
|
|
2769
2771
|
backgroundColor: theme2.colors.error,
|
|
2770
2772
|
color: theme2.colors.base,
|
|
2771
2773
|
...props
|
|
@@ -2780,7 +2782,7 @@ ButtonComponent.icon = function Icon3({ size = 16, backgroundButtonColor, ...pro
|
|
|
2780
2782
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2781
2783
|
ButtonComponent,
|
|
2782
2784
|
{
|
|
2783
|
-
...betterHtmlContext2.components.button?.icon,
|
|
2785
|
+
...betterHtmlContext2.components.button?.style?.icon,
|
|
2784
2786
|
width: buttonSize,
|
|
2785
2787
|
height: buttonSize,
|
|
2786
2788
|
color: theme2.colors.textPrimary,
|
|
@@ -2812,7 +2814,7 @@ ButtonComponent.upload = function Upload({ accept, multiple, onUpload, ...props
|
|
|
2812
2814
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2813
2815
|
ButtonComponent,
|
|
2814
2816
|
{
|
|
2815
|
-
...betterHtmlContext2.components.button?.upload,
|
|
2817
|
+
...betterHtmlContext2.components.button?.style?.upload,
|
|
2816
2818
|
text: "Upload",
|
|
2817
2819
|
icon: "uploadCloud",
|
|
2818
2820
|
onClick: onClickElement,
|
|
@@ -7263,12 +7265,12 @@ var loaderControls = {
|
|
|
7263
7265
|
};
|
|
7264
7266
|
|
|
7265
7267
|
// src/plugins/react-router-dom.ts
|
|
7266
|
-
var
|
|
7268
|
+
var import_react_router_dom2 = require("react-router-dom");
|
|
7267
7269
|
var reactRouterDomPlugin = {
|
|
7268
7270
|
name: "react-router-dom",
|
|
7269
7271
|
components: {
|
|
7270
|
-
Link:
|
|
7271
|
-
NavLink:
|
|
7272
|
+
Link: import_react_router_dom2.Link,
|
|
7273
|
+
NavLink: import_react_router_dom2.NavLink
|
|
7272
7274
|
},
|
|
7273
7275
|
initialize: () => {
|
|
7274
7276
|
console.log("react-router-dom plugin initialized");
|