react-better-html 1.1.100 → 1.1.101

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 CHANGED
@@ -720,9 +720,12 @@ declare const Foldable: typeof FoldableComponent & {
720
720
  type AppConfig = {
721
721
  contentMaxWidth: number;
722
722
  };
723
- type ComponentConfig<Subcomponents extends string> = {
723
+ type ComponentStyleConfig<Subcomponents extends string> = {
724
724
  [key in Subcomponents]?: ComponentStyle & ComponentHoverStyle;
725
725
  };
726
+ type ComponentTagReplacementConfig<Subcomponents extends string> = {
727
+ [key in Subcomponents]?: React.ElementType;
728
+ };
726
729
  type BetterHtmlConfig = {
727
730
  app: AppConfig;
728
731
  theme: ThemeConfig;
@@ -732,9 +735,8 @@ type BetterHtmlConfig = {
732
735
  loaders: Partial<LoaderConfig>;
733
736
  components: {
734
737
  button?: {
735
- style?: ComponentConfig<"default" | "secondary" | "destructive" | "icon" | "upload">;
736
- buttonComponent?: React.ReactNode;
737
- linkComponent?: React.ReactNode;
738
+ style?: ComponentStyleConfig<"default" | "secondary" | "destructive" | "icon" | "upload">;
739
+ tagReplacement?: ComponentTagReplacementConfig<"buttonComponent" | "linkComponent">;
738
740
  };
739
741
  };
740
742
  };
package/dist/index.d.ts CHANGED
@@ -720,9 +720,12 @@ declare const Foldable: typeof FoldableComponent & {
720
720
  type AppConfig = {
721
721
  contentMaxWidth: number;
722
722
  };
723
- type ComponentConfig<Subcomponents extends string> = {
723
+ type ComponentStyleConfig<Subcomponents extends string> = {
724
724
  [key in Subcomponents]?: ComponentStyle & ComponentHoverStyle;
725
725
  };
726
+ type ComponentTagReplacementConfig<Subcomponents extends string> = {
727
+ [key in Subcomponents]?: React.ElementType;
728
+ };
726
729
  type BetterHtmlConfig = {
727
730
  app: AppConfig;
728
731
  theme: ThemeConfig;
@@ -732,9 +735,8 @@ type BetterHtmlConfig = {
732
735
  loaders: Partial<LoaderConfig>;
733
736
  components: {
734
737
  button?: {
735
- style?: ComponentConfig<"default" | "secondary" | "destructive" | "icon" | "upload">;
736
- buttonComponent?: React.ReactNode;
737
- linkComponent?: React.ReactNode;
738
+ style?: ComponentStyleConfig<"default" | "secondary" | "destructive" | "icon" | "upload">;
739
+ tagReplacement?: ComponentTagReplacementConfig<"buttonComponent" | "linkComponent">;
738
740
  };
739
741
  };
740
742
  };
package/dist/index.js CHANGED
@@ -2680,8 +2680,8 @@ var ButtonComponent = function Button({
2680
2680
  height: imageHeight
2681
2681
  }
2682
2682
  ) : void 0;
2683
- const linkComponentTag = betterHtmlContext2.components.button?.linkComponent ?? "a";
2684
- const buttonComponentTag = betterHtmlContext2.components.button?.buttonComponent ?? "button";
2683
+ const linkComponentTag = betterHtmlContext2.components.button?.tagReplacement?.linkComponent ?? "a";
2684
+ const buttonComponentTag = betterHtmlContext2.components.button?.tagReplacement?.buttonComponent ?? "button";
2685
2685
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
2686
2686
  ButtonElement,
2687
2687
  {