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.d.mts
CHANGED
|
@@ -70,6 +70,7 @@ type ButtonComponent = {
|
|
|
70
70
|
<Value>(props: ButtonProps<Value>): React.ReactElement;
|
|
71
71
|
secondary: <Value>(props: ButtonProps<Value>) => React.ReactElement;
|
|
72
72
|
destructive: <Value>(props: ButtonProps<Value>) => React.ReactElement;
|
|
73
|
+
text: <Value>(props: ButtonProps<Value>) => React.ReactElement;
|
|
73
74
|
icon: <Value>(props: OmitProps<ButtonProps<Value>, "icon" | "width" | "height" | "isSmall"> & {
|
|
74
75
|
icon: IconName | AnyOtherString;
|
|
75
76
|
/** @default 16 */
|
|
@@ -89,6 +90,7 @@ declare const ButtonComponent: ButtonComponent;
|
|
|
89
90
|
declare const Button: typeof ButtonComponent & {
|
|
90
91
|
secondary: typeof ButtonComponent.secondary;
|
|
91
92
|
destructive: typeof ButtonComponent.destructive;
|
|
93
|
+
text: typeof ButtonComponent.text;
|
|
92
94
|
icon: typeof ButtonComponent.icon;
|
|
93
95
|
upload: typeof ButtonComponent.upload;
|
|
94
96
|
};
|
|
@@ -221,6 +223,8 @@ type PageHeaderProps = {
|
|
|
221
223
|
rightElement?: React.ReactNode;
|
|
222
224
|
/** @default false */
|
|
223
225
|
lightMode?: boolean;
|
|
226
|
+
width?: React.CSSProperties["width"];
|
|
227
|
+
flex?: React.CSSProperties["flex"];
|
|
224
228
|
} & Pick<ComponentMarginProps, "marginBottom">;
|
|
225
229
|
type PageHeaderComponentType = {
|
|
226
230
|
(props: ComponentPropWithRef<HTMLDivElement, PageHeaderProps>): React.ReactElement;
|
|
@@ -581,7 +585,7 @@ type BetterHtmlConfig = {
|
|
|
581
585
|
language: Language | undefined;
|
|
582
586
|
components: {
|
|
583
587
|
button?: {
|
|
584
|
-
style?: ComponentStyleConfig<ButtonProps, "default" | "secondary" | "destructive" | "icon" | "upload">;
|
|
588
|
+
style?: ComponentStyleConfig<ButtonProps, "default" | "secondary" | "destructive" | "text" | "icon" | "upload">;
|
|
585
589
|
tagReplacement?: ComponentTagReplacementConfig<"buttonComponent" | "linkComponent">;
|
|
586
590
|
};
|
|
587
591
|
inputField?: {
|
|
@@ -712,7 +716,7 @@ declare const sideMenuControls: {
|
|
|
712
716
|
close: () => void;
|
|
713
717
|
toggleOpened: () => void;
|
|
714
718
|
};
|
|
715
|
-
declare const filterHover: () => Record<"z05" | "z1" | "z2" | "z3", React.CSSProperties["filter"]>;
|
|
719
|
+
declare const filterHover: () => Record<"z05" | "z1" | "z2" | "z3" | "b05" | "b1" | "b2" | "b3", React.CSSProperties["filter"]>;
|
|
716
720
|
|
|
717
721
|
declare function generateLocalStorage<LocalStorage extends object>(): {
|
|
718
722
|
setItem: <StorageName extends keyof LocalStorage>(name: StorageName, value: LocalStorage[StorageName]) => void;
|
package/dist/index.d.ts
CHANGED
|
@@ -70,6 +70,7 @@ type ButtonComponent = {
|
|
|
70
70
|
<Value>(props: ButtonProps<Value>): React.ReactElement;
|
|
71
71
|
secondary: <Value>(props: ButtonProps<Value>) => React.ReactElement;
|
|
72
72
|
destructive: <Value>(props: ButtonProps<Value>) => React.ReactElement;
|
|
73
|
+
text: <Value>(props: ButtonProps<Value>) => React.ReactElement;
|
|
73
74
|
icon: <Value>(props: OmitProps<ButtonProps<Value>, "icon" | "width" | "height" | "isSmall"> & {
|
|
74
75
|
icon: IconName | AnyOtherString;
|
|
75
76
|
/** @default 16 */
|
|
@@ -89,6 +90,7 @@ declare const ButtonComponent: ButtonComponent;
|
|
|
89
90
|
declare const Button: typeof ButtonComponent & {
|
|
90
91
|
secondary: typeof ButtonComponent.secondary;
|
|
91
92
|
destructive: typeof ButtonComponent.destructive;
|
|
93
|
+
text: typeof ButtonComponent.text;
|
|
92
94
|
icon: typeof ButtonComponent.icon;
|
|
93
95
|
upload: typeof ButtonComponent.upload;
|
|
94
96
|
};
|
|
@@ -221,6 +223,8 @@ type PageHeaderProps = {
|
|
|
221
223
|
rightElement?: React.ReactNode;
|
|
222
224
|
/** @default false */
|
|
223
225
|
lightMode?: boolean;
|
|
226
|
+
width?: React.CSSProperties["width"];
|
|
227
|
+
flex?: React.CSSProperties["flex"];
|
|
224
228
|
} & Pick<ComponentMarginProps, "marginBottom">;
|
|
225
229
|
type PageHeaderComponentType = {
|
|
226
230
|
(props: ComponentPropWithRef<HTMLDivElement, PageHeaderProps>): React.ReactElement;
|
|
@@ -581,7 +585,7 @@ type BetterHtmlConfig = {
|
|
|
581
585
|
language: Language | undefined;
|
|
582
586
|
components: {
|
|
583
587
|
button?: {
|
|
584
|
-
style?: ComponentStyleConfig<ButtonProps, "default" | "secondary" | "destructive" | "icon" | "upload">;
|
|
588
|
+
style?: ComponentStyleConfig<ButtonProps, "default" | "secondary" | "destructive" | "text" | "icon" | "upload">;
|
|
585
589
|
tagReplacement?: ComponentTagReplacementConfig<"buttonComponent" | "linkComponent">;
|
|
586
590
|
};
|
|
587
591
|
inputField?: {
|
|
@@ -712,7 +716,7 @@ declare const sideMenuControls: {
|
|
|
712
716
|
close: () => void;
|
|
713
717
|
toggleOpened: () => void;
|
|
714
718
|
};
|
|
715
|
-
declare const filterHover: () => Record<"z05" | "z1" | "z2" | "z3", React.CSSProperties["filter"]>;
|
|
719
|
+
declare const filterHover: () => Record<"z05" | "z1" | "z2" | "z3" | "b05" | "b1" | "b2" | "b3", React.CSSProperties["filter"]>;
|
|
716
720
|
|
|
717
721
|
declare function generateLocalStorage<LocalStorage extends object>(): {
|
|
718
722
|
setItem: <StorageName extends keyof LocalStorage>(name: StorageName, value: LocalStorage[StorageName]) => void;
|
package/dist/index.js
CHANGED
|
@@ -1693,6 +1693,8 @@ var PageHeaderComponent = (0, import_react7.forwardRef)(function PageHeader({
|
|
|
1693
1693
|
textAlign,
|
|
1694
1694
|
rightElement,
|
|
1695
1695
|
lightMode,
|
|
1696
|
+
width,
|
|
1697
|
+
flex,
|
|
1696
1698
|
marginBottom
|
|
1697
1699
|
}, ref) {
|
|
1698
1700
|
const theme2 = (0, import_react_better_core6.useTheme)();
|
|
@@ -1703,6 +1705,8 @@ var PageHeaderComponent = (0, import_react7.forwardRef)(function PageHeader({
|
|
|
1703
1705
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
1704
1706
|
Div_default.row,
|
|
1705
1707
|
{
|
|
1708
|
+
width,
|
|
1709
|
+
flex,
|
|
1706
1710
|
alignItems: "center",
|
|
1707
1711
|
gap: imageGap ?? theme2.styles.space,
|
|
1708
1712
|
marginBottom: marginBottom ?? theme2.styles.space * 2,
|
|
@@ -2080,7 +2084,11 @@ var filterHover = () => {
|
|
|
2080
2084
|
z05: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(1.2)" : "brightness(0.95)",
|
|
2081
2085
|
z1: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(1.3)" : "brightness(0.9)",
|
|
2082
2086
|
z2: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(1.6)" : "brightness(0.8)",
|
|
2083
|
-
z3: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(1.9)" : "brightness(0.7)"
|
|
2087
|
+
z3: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(1.9)" : "brightness(0.7)",
|
|
2088
|
+
b05: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(0.8)" : "brightness(1.05)",
|
|
2089
|
+
b1: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(0.7)" : "brightness(1.1)",
|
|
2090
|
+
b2: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(0.4)" : "brightness(1.2)",
|
|
2091
|
+
b3: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(0.1)" : "brightness(1.3)"
|
|
2084
2092
|
};
|
|
2085
2093
|
};
|
|
2086
2094
|
|
|
@@ -2219,6 +2227,7 @@ var ButtonComponent = function Button({
|
|
|
2219
2227
|
value,
|
|
2220
2228
|
download,
|
|
2221
2229
|
target,
|
|
2230
|
+
gap,
|
|
2222
2231
|
icon,
|
|
2223
2232
|
iconPosition = "left",
|
|
2224
2233
|
iconColor,
|
|
@@ -2310,7 +2319,7 @@ var ButtonComponent = function Button({
|
|
|
2310
2319
|
height: href ? "100%" : void 0,
|
|
2311
2320
|
alignItems: "center",
|
|
2312
2321
|
justifyContent: "center",
|
|
2313
|
-
gap:
|
|
2322
|
+
gap: gap ?? (theme2.styles.gap + theme2.styles.space) / 2,
|
|
2314
2323
|
pointerEvents: "none",
|
|
2315
2324
|
opacity: isLoadingElement ? 0 : 1,
|
|
2316
2325
|
transition: theme2.styles.transition,
|
|
@@ -2384,6 +2393,32 @@ ButtonComponent.destructive = function Destructive(buttonProps) {
|
|
|
2384
2393
|
}
|
|
2385
2394
|
);
|
|
2386
2395
|
};
|
|
2396
|
+
ButtonComponent.text = function Text3(buttonProps) {
|
|
2397
|
+
const betterHtmlContextInternal = useBetterHtmlContextInternal();
|
|
2398
|
+
const { color, ...props } = useComponentsPropsMerger(
|
|
2399
|
+
betterHtmlContextInternal.components.button?.style?.text,
|
|
2400
|
+
buttonProps
|
|
2401
|
+
);
|
|
2402
|
+
const theme2 = (0, import_react_better_core9.useTheme)();
|
|
2403
|
+
const readyColor = color ?? theme2.colors.textPrimary;
|
|
2404
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2405
|
+
ButtonComponent,
|
|
2406
|
+
{
|
|
2407
|
+
fontWeight: 700,
|
|
2408
|
+
color: readyColor,
|
|
2409
|
+
colorHover: (0, import_react_better_core9.lightenColor)(readyColor, 0.3),
|
|
2410
|
+
backgroundColor: "transparent",
|
|
2411
|
+
backgroundColorHover: "transparent",
|
|
2412
|
+
borderRadius: 0,
|
|
2413
|
+
loaderSize: 12,
|
|
2414
|
+
gap: theme2.styles.gap,
|
|
2415
|
+
paddingInline: theme2.styles.gap,
|
|
2416
|
+
paddingBlock: theme2.styles.gap / 2,
|
|
2417
|
+
...fromSubcomponentProps,
|
|
2418
|
+
...props
|
|
2419
|
+
}
|
|
2420
|
+
);
|
|
2421
|
+
};
|
|
2387
2422
|
ButtonComponent.icon = function Icon3({ size = 16, buttonSize, backgroundButtonColor, ...buttonProps }) {
|
|
2388
2423
|
const betterHtmlContextInternal = useBetterHtmlContextInternal();
|
|
2389
2424
|
const { ...props } = useComponentsPropsMerger(
|
|
@@ -2443,6 +2478,7 @@ ButtonComponent.upload = function Upload({ accept, multiple, onUpload, ...button
|
|
|
2443
2478
|
var Button2 = (0, import_react10.memo)(ButtonComponent);
|
|
2444
2479
|
Button2.secondary = ButtonComponent.secondary;
|
|
2445
2480
|
Button2.destructive = ButtonComponent.destructive;
|
|
2481
|
+
Button2.text = ButtonComponent.text;
|
|
2446
2482
|
Button2.icon = ButtonComponent.icon;
|
|
2447
2483
|
Button2.upload = ButtonComponent.upload;
|
|
2448
2484
|
var Button_default = Button2;
|