react-better-html 1.1.156 → 1.1.157

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
@@ -960,6 +960,9 @@ declare const generateRandomString: (stringLength: number, options?: {
960
960
  declare const getBrowser: () => BrowserName | undefined;
961
961
  declare const formatPhoneNumber: (phoneNumber: string) => string;
962
962
  declare const getFormErrorObject: <FormFields extends ReturnType<typeof useForm>["values"]>(formValues: FormFields) => PartialRecord<keyof FormFields, string>;
963
+ declare const eventPreventDefault: (event: React.MouseEvent) => void;
964
+ declare const eventStopPropagation: (event: React.MouseEvent) => void;
965
+ declare const eventPreventStop: (event: React.MouseEvent) => void;
963
966
 
964
967
  declare const lightenColor: (hexColor: string, amount: number) => string;
965
968
  declare const darkenColor: (hexColor: string, amount: number) => string;
@@ -1001,4 +1004,4 @@ type AlertsPluginOptions = {
1001
1004
  declare const defaultAlertsPluginOptions: Required<AlertsPluginOptions>;
1002
1005
  declare const alertsPlugin: BetterHtmlPluginConstructor<AlertsPluginOptions>;
1003
1006
 
1004
- export { type Alert, type AlertType, type AlertsPluginOptions, type AppConfig, type AssetName, type AssetsConfig, type BetterHtmlConfig, type BetterHtmlPlugin, _default as BetterHtmlProvider, type BetterHtmlProviderValue, type BrowserName, Button, type ButtonProps, Chip, type ChipProps, type Color, type ColorName, type ColorTheme, ColorThemeSwitch, type ColorThemeSwitchProps, type Colors, type ComponentHoverStyle, type ComponentMarginProps, type ComponentPaddingProps, type DeepPartialRecord, Div, type DivProps, _default$3 as Divider, Dropdown, type DropdownOption, type DropdownProps, type ExcludeOptions, Foldable, type FoldableProps, type FoldableRef, Form, type FormProps, FormRow, type FormRowProps, type HorizontalDividerProps, _default$5 as Icon, type IconName, type IconProps, type IconsConfig, _default$4 as Image, type ImageProps, InputField, type InputFieldProps, _default$1 as Label, type LabelProps, Loader, type LoaderConfig, type LoaderName, type LoaderProps, Modal, type ModalProps, type ModalRef, type OmitProps, PageHeader, type PageHeaderProps, PageHolder, type PageHolderProps, type PartialRecord, type PickAllRequired, type PickValue, type PluginName, type Styles, type TabGroup, Table, type TableColumn, type TableProps, type TableRef, Tabs, type TabsProps, type TabsRef, Text, type TextAs, type TextProps, type TextareaFieldProps, type Theme, type ThemeConfig, _default$2 as ToggleInput, type ToggleInputProps, type ToggleInputRef, Tooltip, type TooltipProps, type TooltipRef, type VerticalDividerProps, alertControls, alertsPlugin, colorThemeControls, countries, darkenColor, defaultAlertsPluginOptions, desaturateColor, formatPhoneNumber, generateRandomString, getBrowser, getFormErrorObject, isMobileDevice, lightenColor, loaderControls, reactRouterDomPlugin, saturateColor, useAlertControls, useBetterHtmlContext, useBooleanState, useDebounceState, useForm, useLoader, useLoaderControls, useMediaQuery, usePageResize, usePageScroll, useTheme, useUrlQuery };
1007
+ export { type Alert, type AlertType, type AlertsPluginOptions, type AppConfig, type AssetName, type AssetsConfig, type BetterHtmlConfig, type BetterHtmlPlugin, _default as BetterHtmlProvider, type BetterHtmlProviderValue, type BrowserName, Button, type ButtonProps, Chip, type ChipProps, type Color, type ColorName, type ColorTheme, ColorThemeSwitch, type ColorThemeSwitchProps, type Colors, type ComponentHoverStyle, type ComponentMarginProps, type ComponentPaddingProps, type DeepPartialRecord, Div, type DivProps, _default$3 as Divider, Dropdown, type DropdownOption, type DropdownProps, type ExcludeOptions, Foldable, type FoldableProps, type FoldableRef, Form, type FormProps, FormRow, type FormRowProps, type HorizontalDividerProps, _default$5 as Icon, type IconName, type IconProps, type IconsConfig, _default$4 as Image, type ImageProps, InputField, type InputFieldProps, _default$1 as Label, type LabelProps, Loader, type LoaderConfig, type LoaderName, type LoaderProps, Modal, type ModalProps, type ModalRef, type OmitProps, PageHeader, type PageHeaderProps, PageHolder, type PageHolderProps, type PartialRecord, type PickAllRequired, type PickValue, type PluginName, type Styles, type TabGroup, Table, type TableColumn, type TableProps, type TableRef, Tabs, type TabsProps, type TabsRef, Text, type TextAs, type TextProps, type TextareaFieldProps, type Theme, type ThemeConfig, _default$2 as ToggleInput, type ToggleInputProps, type ToggleInputRef, Tooltip, type TooltipProps, type TooltipRef, type VerticalDividerProps, alertControls, alertsPlugin, colorThemeControls, countries, darkenColor, defaultAlertsPluginOptions, desaturateColor, eventPreventDefault, eventPreventStop, eventStopPropagation, formatPhoneNumber, generateRandomString, getBrowser, getFormErrorObject, isMobileDevice, lightenColor, loaderControls, reactRouterDomPlugin, saturateColor, useAlertControls, useBetterHtmlContext, useBooleanState, useDebounceState, useForm, useLoader, useLoaderControls, useMediaQuery, usePageResize, usePageScroll, useTheme, useUrlQuery };
package/dist/index.d.ts CHANGED
@@ -960,6 +960,9 @@ declare const generateRandomString: (stringLength: number, options?: {
960
960
  declare const getBrowser: () => BrowserName | undefined;
961
961
  declare const formatPhoneNumber: (phoneNumber: string) => string;
962
962
  declare const getFormErrorObject: <FormFields extends ReturnType<typeof useForm>["values"]>(formValues: FormFields) => PartialRecord<keyof FormFields, string>;
963
+ declare const eventPreventDefault: (event: React.MouseEvent) => void;
964
+ declare const eventStopPropagation: (event: React.MouseEvent) => void;
965
+ declare const eventPreventStop: (event: React.MouseEvent) => void;
963
966
 
964
967
  declare const lightenColor: (hexColor: string, amount: number) => string;
965
968
  declare const darkenColor: (hexColor: string, amount: number) => string;
@@ -1001,4 +1004,4 @@ type AlertsPluginOptions = {
1001
1004
  declare const defaultAlertsPluginOptions: Required<AlertsPluginOptions>;
1002
1005
  declare const alertsPlugin: BetterHtmlPluginConstructor<AlertsPluginOptions>;
1003
1006
 
1004
- export { type Alert, type AlertType, type AlertsPluginOptions, type AppConfig, type AssetName, type AssetsConfig, type BetterHtmlConfig, type BetterHtmlPlugin, _default as BetterHtmlProvider, type BetterHtmlProviderValue, type BrowserName, Button, type ButtonProps, Chip, type ChipProps, type Color, type ColorName, type ColorTheme, ColorThemeSwitch, type ColorThemeSwitchProps, type Colors, type ComponentHoverStyle, type ComponentMarginProps, type ComponentPaddingProps, type DeepPartialRecord, Div, type DivProps, _default$3 as Divider, Dropdown, type DropdownOption, type DropdownProps, type ExcludeOptions, Foldable, type FoldableProps, type FoldableRef, Form, type FormProps, FormRow, type FormRowProps, type HorizontalDividerProps, _default$5 as Icon, type IconName, type IconProps, type IconsConfig, _default$4 as Image, type ImageProps, InputField, type InputFieldProps, _default$1 as Label, type LabelProps, Loader, type LoaderConfig, type LoaderName, type LoaderProps, Modal, type ModalProps, type ModalRef, type OmitProps, PageHeader, type PageHeaderProps, PageHolder, type PageHolderProps, type PartialRecord, type PickAllRequired, type PickValue, type PluginName, type Styles, type TabGroup, Table, type TableColumn, type TableProps, type TableRef, Tabs, type TabsProps, type TabsRef, Text, type TextAs, type TextProps, type TextareaFieldProps, type Theme, type ThemeConfig, _default$2 as ToggleInput, type ToggleInputProps, type ToggleInputRef, Tooltip, type TooltipProps, type TooltipRef, type VerticalDividerProps, alertControls, alertsPlugin, colorThemeControls, countries, darkenColor, defaultAlertsPluginOptions, desaturateColor, formatPhoneNumber, generateRandomString, getBrowser, getFormErrorObject, isMobileDevice, lightenColor, loaderControls, reactRouterDomPlugin, saturateColor, useAlertControls, useBetterHtmlContext, useBooleanState, useDebounceState, useForm, useLoader, useLoaderControls, useMediaQuery, usePageResize, usePageScroll, useTheme, useUrlQuery };
1007
+ export { type Alert, type AlertType, type AlertsPluginOptions, type AppConfig, type AssetName, type AssetsConfig, type BetterHtmlConfig, type BetterHtmlPlugin, _default as BetterHtmlProvider, type BetterHtmlProviderValue, type BrowserName, Button, type ButtonProps, Chip, type ChipProps, type Color, type ColorName, type ColorTheme, ColorThemeSwitch, type ColorThemeSwitchProps, type Colors, type ComponentHoverStyle, type ComponentMarginProps, type ComponentPaddingProps, type DeepPartialRecord, Div, type DivProps, _default$3 as Divider, Dropdown, type DropdownOption, type DropdownProps, type ExcludeOptions, Foldable, type FoldableProps, type FoldableRef, Form, type FormProps, FormRow, type FormRowProps, type HorizontalDividerProps, _default$5 as Icon, type IconName, type IconProps, type IconsConfig, _default$4 as Image, type ImageProps, InputField, type InputFieldProps, _default$1 as Label, type LabelProps, Loader, type LoaderConfig, type LoaderName, type LoaderProps, Modal, type ModalProps, type ModalRef, type OmitProps, PageHeader, type PageHeaderProps, PageHolder, type PageHolderProps, type PartialRecord, type PickAllRequired, type PickValue, type PluginName, type Styles, type TabGroup, Table, type TableColumn, type TableProps, type TableRef, Tabs, type TabsProps, type TabsRef, Text, type TextAs, type TextProps, type TextareaFieldProps, type Theme, type ThemeConfig, _default$2 as ToggleInput, type ToggleInputProps, type ToggleInputRef, Tooltip, type TooltipProps, type TooltipRef, type VerticalDividerProps, alertControls, alertsPlugin, colorThemeControls, countries, darkenColor, defaultAlertsPluginOptions, desaturateColor, eventPreventDefault, eventPreventStop, eventStopPropagation, formatPhoneNumber, generateRandomString, getBrowser, getFormErrorObject, isMobileDevice, lightenColor, loaderControls, reactRouterDomPlugin, saturateColor, useAlertControls, useBetterHtmlContext, useBooleanState, useDebounceState, useForm, useLoader, useLoaderControls, useMediaQuery, usePageResize, usePageScroll, useTheme, useUrlQuery };
package/dist/index.js CHANGED
@@ -60,6 +60,9 @@ __export(index_exports, {
60
60
  darkenColor: () => darkenColor,
61
61
  defaultAlertsPluginOptions: () => defaultAlertsPluginOptions,
62
62
  desaturateColor: () => desaturateColor,
63
+ eventPreventDefault: () => eventPreventDefault,
64
+ eventPreventStop: () => eventPreventStop,
65
+ eventStopPropagation: () => eventStopPropagation,
63
66
  formatPhoneNumber: () => formatPhoneNumber,
64
67
  generateRandomString: () => generateRandomString,
65
68
  getBrowser: () => getBrowser,
@@ -1651,10 +1654,24 @@ var import_styled_components = __toESM(require("styled-components"));
1651
1654
  var import_jsx_runtime = require("react/jsx-runtime");
1652
1655
  var import_react2 = require("react");
1653
1656
  var IconElement = import_styled_components.default.svg.withConfig({
1654
- shouldForwardProp: (prop) => !["normalStyle", "hoverStyle"].includes(prop)
1657
+ shouldForwardProp: (prop) => !["theme", "normalStyle", "hoverStyle", "hoverColor"].includes(prop)
1655
1658
  })`
1656
1659
  ${(props) => props.normalStyle}
1657
1660
 
1661
+ path {
1662
+ ${(props) => props.hoverColor ? `transition: ${props.theme.styles.transition};` : ""}
1663
+ }
1664
+
1665
+ &:hover {
1666
+ path.react-better-html-icon-path-with-fill {
1667
+ fill: ${(props) => props.hoverColor};
1668
+ }
1669
+
1670
+ path.react-better-html-icon-path-with-stroke {
1671
+ stroke: ${(props) => props.hoverColor};
1672
+ }
1673
+ }
1674
+
1658
1675
  &:hover {
1659
1676
  ${(props) => props.hoverStyle}
1660
1677
  }
@@ -1667,6 +1684,7 @@ var Icon = (0, import_react.forwardRef)(function Icon2({ name, size = 16, ...pro
1667
1684
  const ariaProps = useComponentPropsWithPrefix(props, "aria");
1668
1685
  const restProps = useComponentPropsWithoutStyle(props);
1669
1686
  const svgColor = props.color ?? theme2.colors.textPrimary;
1687
+ const svgHoverColorColor = props.colorHover;
1670
1688
  (0, import_react.useEffect)(() => {
1671
1689
  if (!icons2[name.toString()])
1672
1690
  console.warn(
@@ -1681,6 +1699,8 @@ var Icon = (0, import_react.forwardRef)(function Icon2({ name, size = 16, ...pro
1681
1699
  viewBox: `0 0 ${icons2[name.toString()]?.width ?? 0} ${icons2[name.toString()]?.height ?? 0}`,
1682
1700
  fill: "none",
1683
1701
  xmlns: "http://www.w3.org/2000/svg",
1702
+ theme: theme2,
1703
+ hoverColor: svgHoverColorColor,
1684
1704
  ...styledComponentStyles,
1685
1705
  ...dataProps,
1686
1706
  ...ariaProps,
@@ -1690,6 +1710,7 @@ var Icon = (0, import_react.forwardRef)(function Icon2({ name, size = 16, ...pro
1690
1710
  "path",
1691
1711
  {
1692
1712
  ...path,
1713
+ className: path.type === "fill" ? "react-better-html-icon-path-with-fill" : "react-better-html-icon-path-with-stroke",
1693
1714
  fill: path.type === "fill" ? svgColor : void 0,
1694
1715
  stroke: path.type === "stroke" ? svgColor : void 0,
1695
1716
  key: path.d
@@ -5461,6 +5482,16 @@ var formatPhoneNumber = (phoneNumber) => {
5461
5482
  var getFormErrorObject = (formValues) => {
5462
5483
  return {};
5463
5484
  };
5485
+ var eventPreventDefault = (event) => {
5486
+ event.preventDefault();
5487
+ };
5488
+ var eventStopPropagation = (event) => {
5489
+ event.stopPropagation();
5490
+ };
5491
+ var eventPreventStop = (event) => {
5492
+ event.preventDefault();
5493
+ event.stopPropagation();
5494
+ };
5464
5495
 
5465
5496
  // src/components/Label.tsx
5466
5497
  var import_react17 = require("react");
@@ -9069,6 +9100,9 @@ var Foldable_default = Foldable2;
9069
9100
  darkenColor,
9070
9101
  defaultAlertsPluginOptions,
9071
9102
  desaturateColor,
9103
+ eventPreventDefault,
9104
+ eventPreventStop,
9105
+ eventStopPropagation,
9072
9106
  formatPhoneNumber,
9073
9107
  generateRandomString,
9074
9108
  getBrowser,