react-better-html 1.1.288 → 1.1.290
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 +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +38 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +48 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
useLoader as useLoader2,
|
|
5
5
|
useLoaderControls,
|
|
6
6
|
countries as countries3,
|
|
7
|
-
lightenColor as
|
|
7
|
+
lightenColor as lightenColor5,
|
|
8
8
|
darkenColor as darkenColor4,
|
|
9
9
|
saturateColor,
|
|
10
10
|
desaturateColor,
|
|
@@ -1620,6 +1620,8 @@ var PageHeaderComponent = forwardRef5(function PageHeader({
|
|
|
1620
1620
|
textAlign,
|
|
1621
1621
|
rightElement,
|
|
1622
1622
|
lightMode,
|
|
1623
|
+
width,
|
|
1624
|
+
flex,
|
|
1623
1625
|
marginBottom
|
|
1624
1626
|
}, ref) {
|
|
1625
1627
|
const theme2 = useTheme6();
|
|
@@ -1630,6 +1632,8 @@ var PageHeaderComponent = forwardRef5(function PageHeader({
|
|
|
1630
1632
|
return /* @__PURE__ */ jsxs2(
|
|
1631
1633
|
Div_default.row,
|
|
1632
1634
|
{
|
|
1635
|
+
width,
|
|
1636
|
+
flex,
|
|
1633
1637
|
alignItems: "center",
|
|
1634
1638
|
gap: imageGap ?? theme2.styles.space,
|
|
1635
1639
|
marginBottom: marginBottom ?? theme2.styles.space * 2,
|
|
@@ -1940,6 +1944,7 @@ var localStoragePlugin = (options) => ({
|
|
|
1940
1944
|
// src/components/Button.tsx
|
|
1941
1945
|
import { memo as memo8, useCallback as useCallback4 } from "react";
|
|
1942
1946
|
import {
|
|
1947
|
+
lightenColor,
|
|
1943
1948
|
useBetterCoreContext as useBetterCoreContext3,
|
|
1944
1949
|
useLoader,
|
|
1945
1950
|
useTheme as useTheme9
|
|
@@ -2011,7 +2016,11 @@ var filterHover = () => {
|
|
|
2011
2016
|
z05: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(1.2)" : "brightness(0.95)",
|
|
2012
2017
|
z1: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(1.3)" : "brightness(0.9)",
|
|
2013
2018
|
z2: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(1.6)" : "brightness(0.8)",
|
|
2014
|
-
z3: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(1.9)" : "brightness(0.7)"
|
|
2019
|
+
z3: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(1.9)" : "brightness(0.7)",
|
|
2020
|
+
b05: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(0.8)" : "brightness(1.05)",
|
|
2021
|
+
b1: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(0.7)" : "brightness(1.1)",
|
|
2022
|
+
b2: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(0.4)" : "brightness(1.2)",
|
|
2023
|
+
b3: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(0.1)" : "brightness(1.3)"
|
|
2015
2024
|
};
|
|
2016
2025
|
};
|
|
2017
2026
|
|
|
@@ -2150,6 +2159,7 @@ var ButtonComponent = function Button({
|
|
|
2150
2159
|
value,
|
|
2151
2160
|
download,
|
|
2152
2161
|
target,
|
|
2162
|
+
gap,
|
|
2153
2163
|
icon,
|
|
2154
2164
|
iconPosition = "left",
|
|
2155
2165
|
iconColor,
|
|
@@ -2241,7 +2251,7 @@ var ButtonComponent = function Button({
|
|
|
2241
2251
|
height: href ? "100%" : void 0,
|
|
2242
2252
|
alignItems: "center",
|
|
2243
2253
|
justifyContent: "center",
|
|
2244
|
-
gap:
|
|
2254
|
+
gap: gap ?? (theme2.styles.gap + theme2.styles.space) / 2,
|
|
2245
2255
|
pointerEvents: "none",
|
|
2246
2256
|
opacity: isLoadingElement ? 0 : 1,
|
|
2247
2257
|
transition: theme2.styles.transition,
|
|
@@ -2315,6 +2325,32 @@ ButtonComponent.destructive = function Destructive(buttonProps) {
|
|
|
2315
2325
|
}
|
|
2316
2326
|
);
|
|
2317
2327
|
};
|
|
2328
|
+
ButtonComponent.text = function Text3(buttonProps) {
|
|
2329
|
+
const betterHtmlContextInternal = useBetterHtmlContextInternal();
|
|
2330
|
+
const { color, ...props } = useComponentsPropsMerger(
|
|
2331
|
+
betterHtmlContextInternal.components.button?.style?.text,
|
|
2332
|
+
buttonProps
|
|
2333
|
+
);
|
|
2334
|
+
const theme2 = useTheme9();
|
|
2335
|
+
const readyColor = color ?? theme2.colors.textPrimary;
|
|
2336
|
+
return /* @__PURE__ */ jsx8(
|
|
2337
|
+
ButtonComponent,
|
|
2338
|
+
{
|
|
2339
|
+
fontWeight: 700,
|
|
2340
|
+
color: readyColor,
|
|
2341
|
+
colorHover: lightenColor(readyColor, 0.3),
|
|
2342
|
+
backgroundColor: "transparent",
|
|
2343
|
+
backgroundColorHover: "transparent",
|
|
2344
|
+
borderRadius: 0,
|
|
2345
|
+
loaderSize: 12,
|
|
2346
|
+
gap: theme2.styles.gap,
|
|
2347
|
+
paddingInline: theme2.styles.gap,
|
|
2348
|
+
paddingBlock: theme2.styles.gap / 2,
|
|
2349
|
+
...fromSubcomponentProps,
|
|
2350
|
+
...props
|
|
2351
|
+
}
|
|
2352
|
+
);
|
|
2353
|
+
};
|
|
2318
2354
|
ButtonComponent.icon = function Icon3({ size = 16, buttonSize, backgroundButtonColor, ...buttonProps }) {
|
|
2319
2355
|
const betterHtmlContextInternal = useBetterHtmlContextInternal();
|
|
2320
2356
|
const { ...props } = useComponentsPropsMerger(
|
|
@@ -2374,6 +2410,7 @@ ButtonComponent.upload = function Upload({ accept, multiple, onUpload, ...button
|
|
|
2374
2410
|
var Button2 = memo8(ButtonComponent);
|
|
2375
2411
|
Button2.secondary = ButtonComponent.secondary;
|
|
2376
2412
|
Button2.destructive = ButtonComponent.destructive;
|
|
2413
|
+
Button2.text = ButtonComponent.text;
|
|
2377
2414
|
Button2.icon = ButtonComponent.icon;
|
|
2378
2415
|
Button2.upload = ButtonComponent.upload;
|
|
2379
2416
|
var Button_default = Button2;
|
|
@@ -3628,7 +3665,7 @@ var PageHolder_default = PageHolder2;
|
|
|
3628
3665
|
|
|
3629
3666
|
// src/components/Chip.tsx
|
|
3630
3667
|
import { forwardRef as forwardRef9, memo as memo14, useCallback as useCallback8 } from "react";
|
|
3631
|
-
import { darkenColor, lightenColor, useBetterCoreContext as useBetterCoreContext6, useTheme as useTheme15 } from "react-better-core";
|
|
3668
|
+
import { darkenColor, lightenColor as lightenColor2, useBetterCoreContext as useBetterCoreContext6, useTheme as useTheme15 } from "react-better-core";
|
|
3632
3669
|
import { jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3633
3670
|
var borderRadiusOffset = 1.3;
|
|
3634
3671
|
var ChipComponent = forwardRef9(function Chip({ fromSubcomponent, ...chipProps }, ref) {
|
|
@@ -3690,7 +3727,7 @@ ChipComponent.colored = forwardRef9(function Colored({ color, withWhiteBackgroun
|
|
|
3690
3727
|
const chip = /* @__PURE__ */ jsx15(
|
|
3691
3728
|
ChipComponent,
|
|
3692
3729
|
{
|
|
3693
|
-
color: colorTheme === "light" ? darkenColor(readyColor, 0.7) :
|
|
3730
|
+
color: colorTheme === "light" ? darkenColor(readyColor, 0.7) : lightenColor2(readyColor, 0.7),
|
|
3694
3731
|
backgroundColor: readyColor + "40",
|
|
3695
3732
|
border: `${theme2.styles.borderWidth}px solid ${readyColor}`,
|
|
3696
3733
|
ref,
|
|
@@ -3715,7 +3752,7 @@ var Chip_default = Chip2;
|
|
|
3715
3752
|
import { forwardRef as forwardRef11, memo as memo18, useCallback as useCallback11, useState as useState7, useEffect as useEffect9, useMemo as useMemo6, useRef as useRef5, useId as useId2 } from "react";
|
|
3716
3753
|
import {
|
|
3717
3754
|
darkenColor as darkenColor2,
|
|
3718
|
-
lightenColor as
|
|
3755
|
+
lightenColor as lightenColor3,
|
|
3719
3756
|
useBooleanState as useBooleanState5,
|
|
3720
3757
|
useDebounceState as useDebounceState2,
|
|
3721
3758
|
countries as countries2,
|
|
@@ -4778,7 +4815,7 @@ var InputFieldComponent = forwardRef11(function InputField(inputFieldProps, ref)
|
|
|
4778
4815
|
justifyContent: "center",
|
|
4779
4816
|
border: `${theme2.styles.borderWidth}px solid ${theme2.colors.border}`,
|
|
4780
4817
|
borderRight: "none",
|
|
4781
|
-
backgroundColor: prefixBackgroundColor ?? (colorTheme === "light" ? darkenColor2(theme2.colors.backgroundContent, 0.03) :
|
|
4818
|
+
backgroundColor: prefixBackgroundColor ?? (colorTheme === "light" ? darkenColor2(theme2.colors.backgroundContent, 0.03) : lightenColor3(theme2.colors.backgroundContent, 0.1)),
|
|
4782
4819
|
borderTopLeftRadius: theme2.styles.borderRadius,
|
|
4783
4820
|
borderBottomLeftRadius: theme2.styles.borderRadius,
|
|
4784
4821
|
paddingInline: theme2.styles.space,
|
|
@@ -4853,7 +4890,7 @@ var InputFieldComponent = forwardRef11(function InputField(inputFieldProps, ref)
|
|
|
4853
4890
|
justifyContent: "center",
|
|
4854
4891
|
border: `${theme2.styles.borderWidth}px solid ${theme2.colors.border}`,
|
|
4855
4892
|
borderLeft: "none",
|
|
4856
|
-
backgroundColor: suffixBackgroundColor ?? (colorTheme === "light" ? darkenColor2(theme2.colors.backgroundContent, 0.03) :
|
|
4893
|
+
backgroundColor: suffixBackgroundColor ?? (colorTheme === "light" ? darkenColor2(theme2.colors.backgroundContent, 0.03) : lightenColor3(theme2.colors.backgroundContent, 0.1)),
|
|
4857
4894
|
borderTopRightRadius: theme2.styles.borderRadius,
|
|
4858
4895
|
borderBottomRightRadius: theme2.styles.borderRadius,
|
|
4859
4896
|
paddingInline: theme2.styles.space,
|
|
@@ -8056,7 +8093,7 @@ var Foldable_default = Foldable2;
|
|
|
8056
8093
|
import { createContext as createContext2, memo as memo27, useCallback as useCallback19, useContext as useContext2, useEffect as useEffect16, useMemo as useMemo12, useState as useState15 } from "react";
|
|
8057
8094
|
import {
|
|
8058
8095
|
calculateColorContrast,
|
|
8059
|
-
lightenColor as
|
|
8096
|
+
lightenColor as lightenColor4,
|
|
8060
8097
|
useBetterCoreContext as useBetterCoreContext10,
|
|
8061
8098
|
useBooleanState as useBooleanState8,
|
|
8062
8099
|
useTheme as useTheme29
|
|
@@ -8131,7 +8168,7 @@ var MenuItemTypeItem = memo27(function MenuItemTypeItem2({
|
|
|
8131
8168
|
alignItems: "center",
|
|
8132
8169
|
gap: iconGap,
|
|
8133
8170
|
whiteSpace: "nowrap",
|
|
8134
|
-
backgroundColor: isActive ? activeItemColor ?? (colorTheme === "dark" ?
|
|
8171
|
+
backgroundColor: isActive ? activeItemColor ?? (colorTheme === "dark" ? lightenColor4(theme2.colors.primary, 0.7) : lightenColor4(theme2.colors.primary, 0.85)) : readyBackgroundColor,
|
|
8135
8172
|
backgroundColorHover: isActive && activeItemColor ? void 0 : hoverItemColor,
|
|
8136
8173
|
borderRadius: theme2.styles.borderRadius,
|
|
8137
8174
|
paddingBlock,
|
|
@@ -8747,7 +8784,7 @@ export {
|
|
|
8747
8784
|
getPluralWord2 as getPluralWord,
|
|
8748
8785
|
isApiError,
|
|
8749
8786
|
isMobileDevice,
|
|
8750
|
-
|
|
8787
|
+
lightenColor5 as lightenColor,
|
|
8751
8788
|
loaderControls,
|
|
8752
8789
|
localStoragePlugin,
|
|
8753
8790
|
log,
|