react-better-html 1.1.155 → 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 +7 -4
- package/dist/index.d.ts +7 -4
- package/dist/index.js +39 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +36 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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
|
|
@@ -2778,6 +2796,7 @@ function usePageScroll() {
|
|
|
2778
2796
|
function useMediaQuery() {
|
|
2779
2797
|
const { width } = usePageResize();
|
|
2780
2798
|
return {
|
|
2799
|
+
screenWidth: width,
|
|
2781
2800
|
size320: width <= 320,
|
|
2782
2801
|
size400: width <= 400,
|
|
2783
2802
|
size500: width <= 500,
|
|
@@ -3618,7 +3637,7 @@ var PageHeaderComponent = forwardRef8(function PageHeader({
|
|
|
3618
3637
|
{
|
|
3619
3638
|
alignItems: "center",
|
|
3620
3639
|
gap: theme2.styles.space,
|
|
3621
|
-
marginBottom: marginBottom
|
|
3640
|
+
marginBottom: marginBottom ?? theme2.styles.space * 2,
|
|
3622
3641
|
ref,
|
|
3623
3642
|
children: [
|
|
3624
3643
|
imageUrl && /* @__PURE__ */ jsx13(Image_default.profileImage, { src: imageUrl, size: imageSize ?? (mediaQuery.size600 ? 46 : 60) }),
|
|
@@ -5374,6 +5393,16 @@ var formatPhoneNumber = (phoneNumber) => {
|
|
|
5374
5393
|
var getFormErrorObject = (formValues) => {
|
|
5375
5394
|
return {};
|
|
5376
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
|
+
};
|
|
5377
5406
|
|
|
5378
5407
|
// src/components/Label.tsx
|
|
5379
5408
|
import { memo as memo15 } from "react";
|
|
@@ -7161,12 +7190,12 @@ var FormComponent = forwardRef13(function Form({
|
|
|
7161
7190
|
form,
|
|
7162
7191
|
submitButtonText,
|
|
7163
7192
|
submitButtonLoaderName,
|
|
7193
|
+
submitButtonIsLoading,
|
|
7164
7194
|
submitButtonId,
|
|
7165
7195
|
submitButtonIsDisabled,
|
|
7166
7196
|
cancelButtonText,
|
|
7167
7197
|
actionButtonsLocation = "right",
|
|
7168
7198
|
gap,
|
|
7169
|
-
isSubmitting,
|
|
7170
7199
|
isDestructive,
|
|
7171
7200
|
withDividers,
|
|
7172
7201
|
renderActionButtons,
|
|
@@ -7203,7 +7232,7 @@ var FormComponent = forwardRef13(function Form({
|
|
|
7203
7232
|
SubmitButtonTag,
|
|
7204
7233
|
{
|
|
7205
7234
|
text: submitButtonText,
|
|
7206
|
-
isLoading:
|
|
7235
|
+
isLoading: submitButtonIsLoading || form?.isSubmitting,
|
|
7207
7236
|
loaderName: submitButtonLoaderName,
|
|
7208
7237
|
disabled: submitButtonIsDisabledFinal,
|
|
7209
7238
|
id: submitButtonId,
|
|
@@ -8991,6 +9020,9 @@ export {
|
|
|
8991
9020
|
darkenColor,
|
|
8992
9021
|
defaultAlertsPluginOptions,
|
|
8993
9022
|
desaturateColor,
|
|
9023
|
+
eventPreventDefault,
|
|
9024
|
+
eventPreventStop,
|
|
9025
|
+
eventStopPropagation,
|
|
8994
9026
|
formatPhoneNumber,
|
|
8995
9027
|
generateRandomString,
|
|
8996
9028
|
getBrowser,
|