react-better-html 1.1.288 → 1.1.289
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 +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +29 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +39 -10
- 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,
|
|
@@ -1940,6 +1940,7 @@ var localStoragePlugin = (options) => ({
|
|
|
1940
1940
|
// src/components/Button.tsx
|
|
1941
1941
|
import { memo as memo8, useCallback as useCallback4 } from "react";
|
|
1942
1942
|
import {
|
|
1943
|
+
lightenColor,
|
|
1943
1944
|
useBetterCoreContext as useBetterCoreContext3,
|
|
1944
1945
|
useLoader,
|
|
1945
1946
|
useTheme as useTheme9
|
|
@@ -2011,7 +2012,11 @@ var filterHover = () => {
|
|
|
2011
2012
|
z05: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(1.2)" : "brightness(0.95)",
|
|
2012
2013
|
z1: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(1.3)" : "brightness(0.9)",
|
|
2013
2014
|
z2: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(1.6)" : "brightness(0.8)",
|
|
2014
|
-
z3: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(1.9)" : "brightness(0.7)"
|
|
2015
|
+
z3: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(1.9)" : "brightness(0.7)",
|
|
2016
|
+
b05: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(0.8)" : "brightness(1.05)",
|
|
2017
|
+
b1: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(0.7)" : "brightness(1.1)",
|
|
2018
|
+
b2: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(0.4)" : "brightness(1.2)",
|
|
2019
|
+
b3: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(0.1)" : "brightness(1.3)"
|
|
2015
2020
|
};
|
|
2016
2021
|
};
|
|
2017
2022
|
|
|
@@ -2315,6 +2320,29 @@ ButtonComponent.destructive = function Destructive(buttonProps) {
|
|
|
2315
2320
|
}
|
|
2316
2321
|
);
|
|
2317
2322
|
};
|
|
2323
|
+
ButtonComponent.text = function Text3(buttonProps) {
|
|
2324
|
+
const betterHtmlContextInternal = useBetterHtmlContextInternal();
|
|
2325
|
+
const { color, ...props } = useComponentsPropsMerger(
|
|
2326
|
+
betterHtmlContextInternal.components.button?.style?.text,
|
|
2327
|
+
buttonProps
|
|
2328
|
+
);
|
|
2329
|
+
const theme2 = useTheme9();
|
|
2330
|
+
const readyColor = color ?? theme2.colors.textPrimary;
|
|
2331
|
+
return /* @__PURE__ */ jsx8(
|
|
2332
|
+
ButtonComponent,
|
|
2333
|
+
{
|
|
2334
|
+
color: readyColor,
|
|
2335
|
+
colorHover: lightenColor(readyColor, 0.3),
|
|
2336
|
+
backgroundColor: "transparent",
|
|
2337
|
+
backgroundColorHover: "transparent",
|
|
2338
|
+
borderRadius: 0,
|
|
2339
|
+
loaderSize: 12,
|
|
2340
|
+
isSmall: true,
|
|
2341
|
+
...fromSubcomponentProps,
|
|
2342
|
+
...props
|
|
2343
|
+
}
|
|
2344
|
+
);
|
|
2345
|
+
};
|
|
2318
2346
|
ButtonComponent.icon = function Icon3({ size = 16, buttonSize, backgroundButtonColor, ...buttonProps }) {
|
|
2319
2347
|
const betterHtmlContextInternal = useBetterHtmlContextInternal();
|
|
2320
2348
|
const { ...props } = useComponentsPropsMerger(
|
|
@@ -2374,6 +2402,7 @@ ButtonComponent.upload = function Upload({ accept, multiple, onUpload, ...button
|
|
|
2374
2402
|
var Button2 = memo8(ButtonComponent);
|
|
2375
2403
|
Button2.secondary = ButtonComponent.secondary;
|
|
2376
2404
|
Button2.destructive = ButtonComponent.destructive;
|
|
2405
|
+
Button2.text = ButtonComponent.text;
|
|
2377
2406
|
Button2.icon = ButtonComponent.icon;
|
|
2378
2407
|
Button2.upload = ButtonComponent.upload;
|
|
2379
2408
|
var Button_default = Button2;
|
|
@@ -3628,7 +3657,7 @@ var PageHolder_default = PageHolder2;
|
|
|
3628
3657
|
|
|
3629
3658
|
// src/components/Chip.tsx
|
|
3630
3659
|
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";
|
|
3660
|
+
import { darkenColor, lightenColor as lightenColor2, useBetterCoreContext as useBetterCoreContext6, useTheme as useTheme15 } from "react-better-core";
|
|
3632
3661
|
import { jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3633
3662
|
var borderRadiusOffset = 1.3;
|
|
3634
3663
|
var ChipComponent = forwardRef9(function Chip({ fromSubcomponent, ...chipProps }, ref) {
|
|
@@ -3690,7 +3719,7 @@ ChipComponent.colored = forwardRef9(function Colored({ color, withWhiteBackgroun
|
|
|
3690
3719
|
const chip = /* @__PURE__ */ jsx15(
|
|
3691
3720
|
ChipComponent,
|
|
3692
3721
|
{
|
|
3693
|
-
color: colorTheme === "light" ? darkenColor(readyColor, 0.7) :
|
|
3722
|
+
color: colorTheme === "light" ? darkenColor(readyColor, 0.7) : lightenColor2(readyColor, 0.7),
|
|
3694
3723
|
backgroundColor: readyColor + "40",
|
|
3695
3724
|
border: `${theme2.styles.borderWidth}px solid ${readyColor}`,
|
|
3696
3725
|
ref,
|
|
@@ -3715,7 +3744,7 @@ var Chip_default = Chip2;
|
|
|
3715
3744
|
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
3745
|
import {
|
|
3717
3746
|
darkenColor as darkenColor2,
|
|
3718
|
-
lightenColor as
|
|
3747
|
+
lightenColor as lightenColor3,
|
|
3719
3748
|
useBooleanState as useBooleanState5,
|
|
3720
3749
|
useDebounceState as useDebounceState2,
|
|
3721
3750
|
countries as countries2,
|
|
@@ -4778,7 +4807,7 @@ var InputFieldComponent = forwardRef11(function InputField(inputFieldProps, ref)
|
|
|
4778
4807
|
justifyContent: "center",
|
|
4779
4808
|
border: `${theme2.styles.borderWidth}px solid ${theme2.colors.border}`,
|
|
4780
4809
|
borderRight: "none",
|
|
4781
|
-
backgroundColor: prefixBackgroundColor ?? (colorTheme === "light" ? darkenColor2(theme2.colors.backgroundContent, 0.03) :
|
|
4810
|
+
backgroundColor: prefixBackgroundColor ?? (colorTheme === "light" ? darkenColor2(theme2.colors.backgroundContent, 0.03) : lightenColor3(theme2.colors.backgroundContent, 0.1)),
|
|
4782
4811
|
borderTopLeftRadius: theme2.styles.borderRadius,
|
|
4783
4812
|
borderBottomLeftRadius: theme2.styles.borderRadius,
|
|
4784
4813
|
paddingInline: theme2.styles.space,
|
|
@@ -4853,7 +4882,7 @@ var InputFieldComponent = forwardRef11(function InputField(inputFieldProps, ref)
|
|
|
4853
4882
|
justifyContent: "center",
|
|
4854
4883
|
border: `${theme2.styles.borderWidth}px solid ${theme2.colors.border}`,
|
|
4855
4884
|
borderLeft: "none",
|
|
4856
|
-
backgroundColor: suffixBackgroundColor ?? (colorTheme === "light" ? darkenColor2(theme2.colors.backgroundContent, 0.03) :
|
|
4885
|
+
backgroundColor: suffixBackgroundColor ?? (colorTheme === "light" ? darkenColor2(theme2.colors.backgroundContent, 0.03) : lightenColor3(theme2.colors.backgroundContent, 0.1)),
|
|
4857
4886
|
borderTopRightRadius: theme2.styles.borderRadius,
|
|
4858
4887
|
borderBottomRightRadius: theme2.styles.borderRadius,
|
|
4859
4888
|
paddingInline: theme2.styles.space,
|
|
@@ -8056,7 +8085,7 @@ var Foldable_default = Foldable2;
|
|
|
8056
8085
|
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
8086
|
import {
|
|
8058
8087
|
calculateColorContrast,
|
|
8059
|
-
lightenColor as
|
|
8088
|
+
lightenColor as lightenColor4,
|
|
8060
8089
|
useBetterCoreContext as useBetterCoreContext10,
|
|
8061
8090
|
useBooleanState as useBooleanState8,
|
|
8062
8091
|
useTheme as useTheme29
|
|
@@ -8131,7 +8160,7 @@ var MenuItemTypeItem = memo27(function MenuItemTypeItem2({
|
|
|
8131
8160
|
alignItems: "center",
|
|
8132
8161
|
gap: iconGap,
|
|
8133
8162
|
whiteSpace: "nowrap",
|
|
8134
|
-
backgroundColor: isActive ? activeItemColor ?? (colorTheme === "dark" ?
|
|
8163
|
+
backgroundColor: isActive ? activeItemColor ?? (colorTheme === "dark" ? lightenColor4(theme2.colors.primary, 0.7) : lightenColor4(theme2.colors.primary, 0.85)) : readyBackgroundColor,
|
|
8135
8164
|
backgroundColorHover: isActive && activeItemColor ? void 0 : hoverItemColor,
|
|
8136
8165
|
borderRadius: theme2.styles.borderRadius,
|
|
8137
8166
|
paddingBlock,
|
|
@@ -8747,7 +8776,7 @@ export {
|
|
|
8747
8776
|
getPluralWord2 as getPluralWord,
|
|
8748
8777
|
isApiError,
|
|
8749
8778
|
isMobileDevice,
|
|
8750
|
-
|
|
8779
|
+
lightenColor5 as lightenColor,
|
|
8751
8780
|
loaderControls,
|
|
8752
8781
|
localStoragePlugin,
|
|
8753
8782
|
log,
|