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.mjs CHANGED
@@ -1565,10 +1565,24 @@ import styled from "styled-components";
1565
1565
  import { jsx } from "react/jsx-runtime";
1566
1566
  import { createElement } from "react";
1567
1567
  var IconElement = styled.svg.withConfig({
1568
- shouldForwardProp: (prop) => !["normalStyle", "hoverStyle"].includes(prop)
1568
+ shouldForwardProp: (prop) => !["theme", "normalStyle", "hoverStyle", "hoverColor"].includes(prop)
1569
1569
  })`
1570
1570
  ${(props) => props.normalStyle}
1571
1571
 
1572
+ path {
1573
+ ${(props) => props.hoverColor ? `transition: ${props.theme.styles.transition};` : ""}
1574
+ }
1575
+
1576
+ &:hover {
1577
+ path.react-better-html-icon-path-with-fill {
1578
+ fill: ${(props) => props.hoverColor};
1579
+ }
1580
+
1581
+ path.react-better-html-icon-path-with-stroke {
1582
+ stroke: ${(props) => props.hoverColor};
1583
+ }
1584
+ }
1585
+
1572
1586
  &:hover {
1573
1587
  ${(props) => props.hoverStyle}
1574
1588
  }
@@ -1581,6 +1595,7 @@ var Icon = forwardRef(function Icon2({ name, size = 16, ...props }, ref) {
1581
1595
  const ariaProps = useComponentPropsWithPrefix(props, "aria");
1582
1596
  const restProps = useComponentPropsWithoutStyle(props);
1583
1597
  const svgColor = props.color ?? theme2.colors.textPrimary;
1598
+ const svgHoverColorColor = props.colorHover;
1584
1599
  useEffect(() => {
1585
1600
  if (!icons2[name.toString()])
1586
1601
  console.warn(
@@ -1595,6 +1610,8 @@ var Icon = forwardRef(function Icon2({ name, size = 16, ...props }, ref) {
1595
1610
  viewBox: `0 0 ${icons2[name.toString()]?.width ?? 0} ${icons2[name.toString()]?.height ?? 0}`,
1596
1611
  fill: "none",
1597
1612
  xmlns: "http://www.w3.org/2000/svg",
1613
+ theme: theme2,
1614
+ hoverColor: svgHoverColorColor,
1598
1615
  ...styledComponentStyles,
1599
1616
  ...dataProps,
1600
1617
  ...ariaProps,
@@ -1604,6 +1621,7 @@ var Icon = forwardRef(function Icon2({ name, size = 16, ...props }, ref) {
1604
1621
  "path",
1605
1622
  {
1606
1623
  ...path,
1624
+ className: path.type === "fill" ? "react-better-html-icon-path-with-fill" : "react-better-html-icon-path-with-stroke",
1607
1625
  fill: path.type === "fill" ? svgColor : void 0,
1608
1626
  stroke: path.type === "stroke" ? svgColor : void 0,
1609
1627
  key: path.d
@@ -5375,6 +5393,16 @@ var formatPhoneNumber = (phoneNumber) => {
5375
5393
  var getFormErrorObject = (formValues) => {
5376
5394
  return {};
5377
5395
  };
5396
+ var eventPreventDefault = (event) => {
5397
+ event.preventDefault();
5398
+ };
5399
+ var eventStopPropagation = (event) => {
5400
+ event.stopPropagation();
5401
+ };
5402
+ var eventPreventStop = (event) => {
5403
+ event.preventDefault();
5404
+ event.stopPropagation();
5405
+ };
5378
5406
 
5379
5407
  // src/components/Label.tsx
5380
5408
  import { memo as memo15 } from "react";
@@ -8992,6 +9020,9 @@ export {
8992
9020
  darkenColor,
8993
9021
  defaultAlertsPluginOptions,
8994
9022
  desaturateColor,
9023
+ eventPreventDefault,
9024
+ eventPreventStop,
9025
+ eventStopPropagation,
8995
9026
  formatPhoneNumber,
8996
9027
  generateRandomString,
8997
9028
  getBrowser,