react-better-html 1.1.242 → 1.1.243
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.js +39 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +64 -34
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1967,7 +1967,9 @@ var Loader_default = Loader2;
|
|
|
1967
1967
|
// src/components/Button.tsx
|
|
1968
1968
|
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1969
1969
|
var ButtonElement = styled6.button.withConfig({
|
|
1970
|
-
shouldForwardProp: (prop) => !["theme", "colorTheme", "style", "hoverStyle", "isSmall", "withText", "isLoading"].includes(
|
|
1970
|
+
shouldForwardProp: (prop) => !["theme", "colorTheme", "style", "hoverStyle", "isSmall", "withText", "isLoading", "withNoBorder"].includes(
|
|
1971
|
+
prop
|
|
1972
|
+
)
|
|
1971
1973
|
})`
|
|
1972
1974
|
display: block;
|
|
1973
1975
|
position: relative;
|
|
@@ -3516,7 +3518,7 @@ import {
|
|
|
3516
3518
|
useTheme as useTheme19,
|
|
3517
3519
|
useBetterCoreContext as useBetterCoreContext7
|
|
3518
3520
|
} from "react-better-core";
|
|
3519
|
-
import styled10 from "styled-components";
|
|
3521
|
+
import styled10, { css as css2 } from "styled-components";
|
|
3520
3522
|
|
|
3521
3523
|
// src/components/Label.tsx
|
|
3522
3524
|
import { memo as memo15 } from "react";
|
|
@@ -4246,7 +4248,17 @@ var colorPickerSpacing = 4;
|
|
|
4246
4248
|
var colorPickerColorWidth = 12 + 27 + colorPickerSpacing;
|
|
4247
4249
|
var colorPickerValueWidth = 12 + 74 + colorPickerSpacing;
|
|
4248
4250
|
var InputElement = styled10.input.withConfig({
|
|
4249
|
-
shouldForwardProp: (prop) => ![
|
|
4251
|
+
shouldForwardProp: (prop) => ![
|
|
4252
|
+
"theme",
|
|
4253
|
+
"colorTheme",
|
|
4254
|
+
"withLeftIcon",
|
|
4255
|
+
"withRightIcon",
|
|
4256
|
+
"withPrefix",
|
|
4257
|
+
"withSuffix",
|
|
4258
|
+
"style",
|
|
4259
|
+
"hoverStyle",
|
|
4260
|
+
"withNoBorder"
|
|
4261
|
+
].includes(prop)
|
|
4250
4262
|
})`
|
|
4251
4263
|
position: relative;
|
|
4252
4264
|
width: 100%;
|
|
@@ -4272,7 +4284,11 @@ var InputElement = styled10.input.withConfig({
|
|
|
4272
4284
|
}
|
|
4273
4285
|
|
|
4274
4286
|
&:focus {
|
|
4275
|
-
|
|
4287
|
+
${(props) => props.withNoBorder ? css2`
|
|
4288
|
+
filter: ${props.colorTheme === "dark" ? "brightness(1.2)" : "brightness(0.9)"};
|
|
4289
|
+
` : css2`
|
|
4290
|
+
border-color: ${props.theme.colors.primary};
|
|
4291
|
+
`}
|
|
4276
4292
|
}
|
|
4277
4293
|
|
|
4278
4294
|
&:disabled {
|
|
@@ -4368,7 +4384,7 @@ var InputElement = styled10.input.withConfig({
|
|
|
4368
4384
|
}
|
|
4369
4385
|
`;
|
|
4370
4386
|
var TextareaElement = styled10.textarea.withConfig({
|
|
4371
|
-
shouldForwardProp: (prop) => !["theme", "withLeftIcon", "withRightIcon", "style", "hoverStyle"].includes(prop)
|
|
4387
|
+
shouldForwardProp: (prop) => !["theme", "colorTheme", "withLeftIcon", "withRightIcon", "style", "hoverStyle", "withNoBorder"].includes(prop)
|
|
4372
4388
|
})`
|
|
4373
4389
|
width: 100%;
|
|
4374
4390
|
min-height: 3lh;
|
|
@@ -4391,9 +4407,11 @@ var TextareaElement = styled10.textarea.withConfig({
|
|
|
4391
4407
|
color: ${(props) => props.theme.colors.textSecondary}80;
|
|
4392
4408
|
}
|
|
4393
4409
|
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4410
|
+
${(props) => props.withNoBorder ? css2`
|
|
4411
|
+
filter: ${props.colorTheme === "dark" ? "brightness(1.2)" : "brightness(0.9)"};
|
|
4412
|
+
` : css2`
|
|
4413
|
+
border-color: ${props.theme.colors.primary};
|
|
4414
|
+
`}
|
|
4397
4415
|
|
|
4398
4416
|
${(props) => props.style}
|
|
4399
4417
|
|
|
@@ -4517,6 +4535,7 @@ var InputFieldComponent = forwardRef11(function InputField(inputFieldProps, ref)
|
|
|
4517
4535
|
InputElement,
|
|
4518
4536
|
{
|
|
4519
4537
|
theme: theme2,
|
|
4538
|
+
colorTheme,
|
|
4520
4539
|
withLeftIcon: leftIcon !== void 0,
|
|
4521
4540
|
withRightIcon: rightIcon !== void 0,
|
|
4522
4541
|
withPrefix: prefix !== void 0,
|
|
@@ -4527,6 +4546,7 @@ var InputFieldComponent = forwardRef11(function InputField(inputFieldProps, ref)
|
|
|
4527
4546
|
onChange: onChangeElement,
|
|
4528
4547
|
style,
|
|
4529
4548
|
hoverStyle,
|
|
4549
|
+
withNoBorder: theme2.styles.borderWidth === 0,
|
|
4530
4550
|
...restProps,
|
|
4531
4551
|
...dataProps,
|
|
4532
4552
|
...ariaProps,
|
|
@@ -4611,6 +4631,7 @@ InputFieldComponent.multiline = forwardRef11(function Multiline(inputFieldProps,
|
|
|
4611
4631
|
);
|
|
4612
4632
|
const theme2 = useTheme19();
|
|
4613
4633
|
const internalId = useId2();
|
|
4634
|
+
const { colorTheme } = useBetterCoreContext7();
|
|
4614
4635
|
const { style, hoverStyle, restProps } = useComponentPropsGrouper(props);
|
|
4615
4636
|
const dataProps = useComponentPropsWithPrefix(restProps, "data");
|
|
4616
4637
|
const ariaProps = useComponentPropsWithPrefix(restProps, "aria");
|
|
@@ -4653,6 +4674,7 @@ InputFieldComponent.multiline = forwardRef11(function Multiline(inputFieldProps,
|
|
|
4653
4674
|
TextareaElement,
|
|
4654
4675
|
{
|
|
4655
4676
|
theme: theme2,
|
|
4677
|
+
colorTheme,
|
|
4656
4678
|
withLeftIcon: leftIcon !== void 0,
|
|
4657
4679
|
withRightIcon: rightIcon !== void 0,
|
|
4658
4680
|
required,
|
|
@@ -4661,6 +4683,7 @@ InputFieldComponent.multiline = forwardRef11(function Multiline(inputFieldProps,
|
|
|
4661
4683
|
id: readyId,
|
|
4662
4684
|
style,
|
|
4663
4685
|
hoverStyle,
|
|
4686
|
+
withNoBorder: theme2.styles.borderWidth === 0,
|
|
4664
4687
|
...restProps,
|
|
4665
4688
|
...dataProps,
|
|
4666
4689
|
...ariaProps,
|
|
@@ -5412,14 +5435,14 @@ var InputField_default = InputField2;
|
|
|
5412
5435
|
|
|
5413
5436
|
// src/components/ToggleInput.tsx
|
|
5414
5437
|
import { forwardRef as forwardRef12, useCallback as useCallback11, useId as useId3, useState as useState8 } from "react";
|
|
5415
|
-
import { useBooleanState as useBooleanState6, useTheme as useTheme20 } from "react-better-core";
|
|
5416
|
-
import styled11 from "styled-components";
|
|
5438
|
+
import { useBetterCoreContext as useBetterCoreContext8, useBooleanState as useBooleanState6, useTheme as useTheme20 } from "react-better-core";
|
|
5439
|
+
import styled11, { css as css3 } from "styled-components";
|
|
5417
5440
|
import { jsx as jsx18, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
5418
5441
|
var componentSize = 26;
|
|
5419
5442
|
var switchComponentBallGap = 3;
|
|
5420
5443
|
var switchComponentMouseDownDifference = 4;
|
|
5421
5444
|
var InputElement2 = styled11.input.withConfig({
|
|
5422
|
-
shouldForwardProp: (prop) => !["theme", "style", "hoverStyle", "size"].includes(prop)
|
|
5445
|
+
shouldForwardProp: (prop) => !["theme", "colorTheme", "style", "hoverStyle", "size", "withNoBorder"].includes(prop)
|
|
5423
5446
|
})`
|
|
5424
5447
|
position: relative;
|
|
5425
5448
|
appearance: none;
|
|
@@ -5449,7 +5472,11 @@ var InputElement2 = styled11.input.withConfig({
|
|
|
5449
5472
|
${(props) => props.style}
|
|
5450
5473
|
|
|
5451
5474
|
&:hover {
|
|
5452
|
-
|
|
5475
|
+
${(props) => props.withNoBorder ? css3`
|
|
5476
|
+
filter: ${props.colorTheme === "dark" ? "brightness(1.2)" : "brightness(0.9)"};
|
|
5477
|
+
` : css3`
|
|
5478
|
+
border-color: ${props.theme.colors.primary};
|
|
5479
|
+
`}
|
|
5453
5480
|
|
|
5454
5481
|
${(props) => props.hoverStyle}
|
|
5455
5482
|
}
|
|
@@ -5534,6 +5561,7 @@ var ToggleInputComponent = forwardRef12(function ToggleInput({
|
|
|
5534
5561
|
}, ref) {
|
|
5535
5562
|
const theme2 = useTheme20();
|
|
5536
5563
|
const internalId = useId3();
|
|
5564
|
+
const { colorTheme } = useBetterCoreContext8();
|
|
5537
5565
|
const { style, hoverStyle, excludeStyle, restProps } = useComponentPropsGrouper(props, true);
|
|
5538
5566
|
const dataProps = useComponentPropsWithPrefix(restProps, "data");
|
|
5539
5567
|
const ariaProps = useComponentPropsWithPrefix(restProps, "aria");
|
|
@@ -5574,7 +5602,9 @@ var ToggleInputComponent = forwardRef12(function ToggleInput({
|
|
|
5574
5602
|
InputElement2,
|
|
5575
5603
|
{
|
|
5576
5604
|
theme: theme2,
|
|
5605
|
+
colorTheme,
|
|
5577
5606
|
size,
|
|
5607
|
+
withNoBorder: theme2.styles.borderWidth === 0,
|
|
5578
5608
|
type: props.type ?? "checkbox",
|
|
5579
5609
|
checked,
|
|
5580
5610
|
onChange: onChangeElement,
|
|
@@ -6008,8 +6038,8 @@ import {
|
|
|
6008
6038
|
useEffect as useEffect12,
|
|
6009
6039
|
Fragment as Fragment6
|
|
6010
6040
|
} from "react";
|
|
6011
|
-
import { darkenColor as darkenColor3, useBetterCoreContext as
|
|
6012
|
-
import styled12, { css as
|
|
6041
|
+
import { darkenColor as darkenColor3, useBetterCoreContext as useBetterCoreContext9, useTheme as useTheme25 } from "react-better-core";
|
|
6042
|
+
import styled12, { css as css4 } from "styled-components";
|
|
6013
6043
|
|
|
6014
6044
|
// src/components/Pagination.tsx
|
|
6015
6045
|
import { memo as memo22, useCallback as useCallback13, useEffect as useEffect11, useMemo as useMemo8, useState as useState10 } from "react";
|
|
@@ -6209,13 +6239,13 @@ var TableStyledComponent = styled12.table.withConfig({
|
|
|
6209
6239
|
}
|
|
6210
6240
|
}
|
|
6211
6241
|
|
|
6212
|
-
${(props) => props.isStriped ?
|
|
6242
|
+
${(props) => props.isStriped ? css4`
|
|
6213
6243
|
&:nth-child(even) {
|
|
6214
6244
|
background-color: ${props.theme.colors.backgroundSecondary};
|
|
6215
6245
|
}
|
|
6216
6246
|
` : ""}
|
|
6217
6247
|
|
|
6218
|
-
${(props) => props.withHover ?
|
|
6248
|
+
${(props) => props.withHover ? css4`
|
|
6219
6249
|
transition: ${props.theme.styles.transition};
|
|
6220
6250
|
|
|
6221
6251
|
&:not(.isHeader):not(.isFooter):not(.withoutHover):hover {
|
|
@@ -6298,7 +6328,7 @@ var TableComponent = forwardRef15(function Table({
|
|
|
6298
6328
|
}, ref) {
|
|
6299
6329
|
const theme2 = useTheme25();
|
|
6300
6330
|
const mediaQuery = useMediaQuery();
|
|
6301
|
-
const { colorTheme } =
|
|
6331
|
+
const { colorTheme } = useBetterCoreContext9();
|
|
6302
6332
|
const filterModalRef = useRef6(null);
|
|
6303
6333
|
const readyColumns = useMemo9(() => columns.filter((column) => !column.hidden), [columns]);
|
|
6304
6334
|
const columnsRef = useRef6(readyColumns);
|
|
@@ -6906,56 +6936,56 @@ var Table_default = Table2;
|
|
|
6906
6936
|
// src/components/Tooltip.tsx
|
|
6907
6937
|
import { memo as memo24, useCallback as useCallback15, useRef as useRef7, useState as useState12, useEffect as useEffect13, forwardRef as forwardRef16, useImperativeHandle as useImperativeHandle3, useMemo as useMemo10 } from "react";
|
|
6908
6938
|
import { useTheme as useTheme26 } from "react-better-core";
|
|
6909
|
-
import styled13, { css as
|
|
6939
|
+
import styled13, { css as css5 } from "styled-components";
|
|
6910
6940
|
import { jsx as jsx24, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
6911
6941
|
var tooltipContainerStyle = (props) => ({
|
|
6912
|
-
top:
|
|
6942
|
+
top: css5`
|
|
6913
6943
|
bottom: calc(100% + ${props.gap}px + ${props.arrowSize}px);
|
|
6914
6944
|
${props.align === "center" ? "left: 50%;" : props.align === "left" ? "left: 0;" : "right: 0;"}
|
|
6915
6945
|
`,
|
|
6916
|
-
bottom:
|
|
6946
|
+
bottom: css5`
|
|
6917
6947
|
top: calc(100% + ${props.gap}px + ${props.arrowSize}px);
|
|
6918
6948
|
${props.align === "center" ? "left: 50%;" : props.align === "left" ? "left: 0;" : "right: 0;"};
|
|
6919
6949
|
`,
|
|
6920
|
-
left:
|
|
6950
|
+
left: css5`
|
|
6921
6951
|
${props.align === "center" ? "top: 50%;" : props.align === "top" ? "top: 0;" : "bottom: 0;"};
|
|
6922
6952
|
right: calc(100% + ${props.gap}px + ${props.arrowSize}px);
|
|
6923
6953
|
`,
|
|
6924
|
-
right:
|
|
6954
|
+
right: css5`
|
|
6925
6955
|
${props.align === "center" ? "top: 50%;" : props.align === "top" ? "top: 0;" : "bottom: 0;"};
|
|
6926
6956
|
left: calc(100% + ${props.gap}px + ${props.arrowSize}px);
|
|
6927
6957
|
`
|
|
6928
6958
|
});
|
|
6929
6959
|
var tooltipPositionStyle = (props) => ({
|
|
6930
6960
|
top: {
|
|
6931
|
-
opened:
|
|
6961
|
+
opened: css5`
|
|
6932
6962
|
transform: translateX(${props.align === "center" ? "-50%" : "0"});
|
|
6933
6963
|
`,
|
|
6934
|
-
closed:
|
|
6964
|
+
closed: css5`
|
|
6935
6965
|
transform: translateX(${props.align === "center" ? "-50%" : "0"}) translateY(${props.theme.styles.gap}px);
|
|
6936
6966
|
`
|
|
6937
6967
|
},
|
|
6938
6968
|
bottom: {
|
|
6939
|
-
opened:
|
|
6969
|
+
opened: css5`
|
|
6940
6970
|
transform: translateX(${props.align === "center" ? "-50%" : "0"});
|
|
6941
6971
|
`,
|
|
6942
|
-
closed:
|
|
6972
|
+
closed: css5`
|
|
6943
6973
|
transform: translateX(${props.align === "center" ? "-50%" : "0"}) translateY(-${props.theme.styles.gap}px);
|
|
6944
6974
|
`
|
|
6945
6975
|
},
|
|
6946
6976
|
left: {
|
|
6947
|
-
opened:
|
|
6977
|
+
opened: css5`
|
|
6948
6978
|
transform: translateY(${props.align === "center" ? "-50%" : "0"});
|
|
6949
6979
|
`,
|
|
6950
|
-
closed:
|
|
6980
|
+
closed: css5`
|
|
6951
6981
|
transform: translateX(${props.theme.styles.gap}px) translateY(${props.align === "center" ? "-50%" : "0"});
|
|
6952
6982
|
`
|
|
6953
6983
|
},
|
|
6954
6984
|
right: {
|
|
6955
|
-
opened:
|
|
6985
|
+
opened: css5`
|
|
6956
6986
|
transform: translateY(${props.align === "center" ? "-50%" : "0"});
|
|
6957
6987
|
`,
|
|
6958
|
-
closed:
|
|
6988
|
+
closed: css5`
|
|
6959
6989
|
transform: translateX(-${props.theme.styles.gap}px) translateY(${props.align === "center" ? "-50%" : "0"});
|
|
6960
6990
|
`
|
|
6961
6991
|
}
|
|
@@ -7303,7 +7333,7 @@ var Tooltip_default = Tooltip2;
|
|
|
7303
7333
|
|
|
7304
7334
|
// src/components/Tabs.tsx
|
|
7305
7335
|
import { forwardRef as forwardRef17, memo as memo25, useCallback as useCallback16, useEffect as useEffect14, useImperativeHandle as useImperativeHandle4, useMemo as useMemo11, useRef as useRef8, useState as useState13 } from "react";
|
|
7306
|
-
import { useBetterCoreContext as
|
|
7336
|
+
import { useBetterCoreContext as useBetterCoreContext10, useTheme as useTheme27 } from "react-better-core";
|
|
7307
7337
|
import { jsx as jsx25, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
7308
7338
|
var tabBottomLineWidth = 2;
|
|
7309
7339
|
var tabDotSize = 6;
|
|
@@ -7313,7 +7343,7 @@ var TabsComponent = forwardRef17(function Tabs({ tabs, name, accentColor, style
|
|
|
7313
7343
|
const theme2 = useTheme27();
|
|
7314
7344
|
const urlQuery = reactRouterDomPlugin2 ? useUrlQuery() : void 0;
|
|
7315
7345
|
const { componentsState } = useBetterHtmlContextInternal();
|
|
7316
|
-
const { colorTheme } =
|
|
7346
|
+
const { colorTheme } = useBetterCoreContext10();
|
|
7317
7347
|
const firstRenderPassedRef = useRef8(false);
|
|
7318
7348
|
const tabsRef = useRef8({});
|
|
7319
7349
|
const [selectedTab, setSelectedTab] = useState13(() => {
|
|
@@ -7647,7 +7677,7 @@ import { createContext as createContext2, memo as memo27, useCallback as useCall
|
|
|
7647
7677
|
import {
|
|
7648
7678
|
calculateColorContrast,
|
|
7649
7679
|
lightenColor as lightenColor3,
|
|
7650
|
-
useBetterCoreContext as
|
|
7680
|
+
useBetterCoreContext as useBetterCoreContext11,
|
|
7651
7681
|
useBooleanState as useBooleanState8,
|
|
7652
7682
|
useTheme as useTheme29
|
|
7653
7683
|
} from "react-better-core";
|
|
@@ -7680,7 +7710,7 @@ var MenuItemComponent = memo27(function MenuItemComponent2({
|
|
|
7680
7710
|
const mediaQuery = useMediaQuery();
|
|
7681
7711
|
const location = reactRouterDomPluginConfig.useLocation();
|
|
7682
7712
|
const { components, sideMenuIsCollapsed, setSideMenuIsCollapsed } = useBetterHtmlContextInternal();
|
|
7683
|
-
const { colorTheme } =
|
|
7713
|
+
const { colorTheme } = useBetterCoreContext11();
|
|
7684
7714
|
const { activeItem, setActiveItem } = useSideMenuContext();
|
|
7685
7715
|
const [isOpened, setIsOpened] = useBooleanState8();
|
|
7686
7716
|
const isCollapsed = sideMenuIsCollapsed && !mediaQuery.size1000;
|