react-better-html 1.1.240 → 1.1.242
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 +15 -2
- package/dist/index.d.ts +15 -2
- package/dist/index.js +61 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +61 -14
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1997,7 +1997,11 @@ var ButtonElement = styled6.button.withConfig({
|
|
|
1997
1997
|
}
|
|
1998
1998
|
|
|
1999
1999
|
&.secondary:hover {
|
|
2000
|
-
|
|
2000
|
+
${props.withNoBorder ? css`
|
|
2001
|
+
filter: ${props.colorTheme === "dark" ? "brightness(1.2)" : "brightness(0.9)"};
|
|
2002
|
+
` : css`
|
|
2003
|
+
border-color: ${props.theme.colors.primary};
|
|
2004
|
+
`}
|
|
2001
2005
|
}
|
|
2002
2006
|
` : ""}
|
|
2003
2007
|
|
|
@@ -2095,6 +2099,7 @@ var ButtonComponent = function Button(buttonProps) {
|
|
|
2095
2099
|
isSmall,
|
|
2096
2100
|
withText: text !== void 0,
|
|
2097
2101
|
isLoading: isLoadingElement,
|
|
2102
|
+
withNoBorder: theme2.styles.borderWidth === 0,
|
|
2098
2103
|
disabled,
|
|
2099
2104
|
to: href,
|
|
2100
2105
|
href,
|
|
@@ -3519,16 +3524,26 @@ import { useTheme as useTheme16 } from "react-better-core";
|
|
|
3519
3524
|
import { jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3520
3525
|
function Label(labelProps) {
|
|
3521
3526
|
const betterHtmlContextInternal = useBetterHtmlContextInternal();
|
|
3522
|
-
const {
|
|
3527
|
+
const {
|
|
3528
|
+
text,
|
|
3529
|
+
required,
|
|
3530
|
+
requiredSize = 16,
|
|
3531
|
+
isError,
|
|
3532
|
+
fontFamily,
|
|
3533
|
+
fontSize = 14,
|
|
3534
|
+
letterSpacing,
|
|
3535
|
+
textTransform,
|
|
3536
|
+
color,
|
|
3537
|
+
htmlFor
|
|
3538
|
+
} = useComponentsPropsMerger(betterHtmlContextInternal.components.label?.style?.default, labelProps);
|
|
3523
3539
|
const theme2 = useTheme16();
|
|
3524
3540
|
return /* @__PURE__ */ jsxs11(
|
|
3525
3541
|
Text_default,
|
|
3526
3542
|
{
|
|
3527
3543
|
as: "label",
|
|
3528
3544
|
width: "fit-content",
|
|
3529
|
-
height: 16,
|
|
3530
3545
|
fontFamily,
|
|
3531
|
-
fontSize
|
|
3546
|
+
fontSize,
|
|
3532
3547
|
color: isError ? theme2.colors.error : color ?? theme2.colors.textSecondary,
|
|
3533
3548
|
letterSpacing,
|
|
3534
3549
|
textTransform,
|
|
@@ -3536,10 +3551,21 @@ function Label(labelProps) {
|
|
|
3536
3551
|
"aria-required": required,
|
|
3537
3552
|
children: [
|
|
3538
3553
|
text,
|
|
3539
|
-
required && /* @__PURE__ */ jsxs11(
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3554
|
+
required && /* @__PURE__ */ jsxs11(
|
|
3555
|
+
Text_default,
|
|
3556
|
+
{
|
|
3557
|
+
as: "span",
|
|
3558
|
+
display: "inline-block",
|
|
3559
|
+
height: fontSize,
|
|
3560
|
+
fontSize: requiredSize,
|
|
3561
|
+
letterSpacing: "normal",
|
|
3562
|
+
color: theme2.colors.error,
|
|
3563
|
+
children: [
|
|
3564
|
+
" ",
|
|
3565
|
+
"*"
|
|
3566
|
+
]
|
|
3567
|
+
}
|
|
3568
|
+
)
|
|
3543
3569
|
]
|
|
3544
3570
|
}
|
|
3545
3571
|
);
|
|
@@ -3562,9 +3588,11 @@ var DropdownComponent = forwardRef10(function Dropdown(dropdownProps, ref) {
|
|
|
3562
3588
|
const {
|
|
3563
3589
|
label,
|
|
3564
3590
|
labelFontFamily,
|
|
3591
|
+
labelFontSize,
|
|
3565
3592
|
labelLetterSpacing,
|
|
3566
3593
|
labelTextTransform,
|
|
3567
3594
|
labelColor,
|
|
3595
|
+
labelGap,
|
|
3568
3596
|
errorText,
|
|
3569
3597
|
infoText,
|
|
3570
3598
|
required,
|
|
@@ -3804,9 +3832,11 @@ var DropdownComponent = forwardRef10(function Dropdown(dropdownProps, ref) {
|
|
|
3804
3832
|
{
|
|
3805
3833
|
label,
|
|
3806
3834
|
labelFontFamily,
|
|
3835
|
+
labelFontSize,
|
|
3807
3836
|
labelLetterSpacing,
|
|
3808
3837
|
labelTextTransform,
|
|
3809
3838
|
labelColor,
|
|
3839
|
+
labelGap,
|
|
3810
3840
|
errorText,
|
|
3811
3841
|
infoText,
|
|
3812
3842
|
required: withMultiselect ? (Array.isArray(value) ? value.length > 0 : value !== void 0) ? false : required : required,
|
|
@@ -4378,9 +4408,11 @@ var InputFieldComponent = forwardRef11(function InputField(inputFieldProps, ref)
|
|
|
4378
4408
|
const {
|
|
4379
4409
|
label,
|
|
4380
4410
|
labelFontFamily,
|
|
4411
|
+
labelFontSize,
|
|
4381
4412
|
labelLetterSpacing,
|
|
4382
4413
|
labelTextTransform,
|
|
4383
4414
|
labelColor,
|
|
4415
|
+
labelGap,
|
|
4384
4416
|
errorText,
|
|
4385
4417
|
infoText,
|
|
4386
4418
|
leftIcon,
|
|
@@ -4436,12 +4468,13 @@ var InputFieldComponent = forwardRef11(function InputField(inputFieldProps, ref)
|
|
|
4436
4468
|
onChangeValue?.(debouncedValue);
|
|
4437
4469
|
}, [withDebounce, onChangeValue, debouncedValue]);
|
|
4438
4470
|
const readyId = id ?? internalId;
|
|
4439
|
-
return /* @__PURE__ */ jsxs14(Div_default.column, { width: "100%", gap: theme2.styles.gap / 2, ...excludeStyle, children: [
|
|
4471
|
+
return /* @__PURE__ */ jsxs14(Div_default.column, { width: "100%", gap: labelGap ?? theme2.styles.gap / 2, ...excludeStyle, children: [
|
|
4440
4472
|
label && /* @__PURE__ */ jsx17(
|
|
4441
4473
|
Label_default,
|
|
4442
4474
|
{
|
|
4443
4475
|
text: label,
|
|
4444
4476
|
fontFamily: labelFontFamily,
|
|
4477
|
+
fontSize: labelFontSize,
|
|
4445
4478
|
letterSpacing: labelLetterSpacing,
|
|
4446
4479
|
textTransform: labelTextTransform,
|
|
4447
4480
|
color: labelColor,
|
|
@@ -4556,9 +4589,11 @@ InputFieldComponent.multiline = forwardRef11(function Multiline(inputFieldProps,
|
|
|
4556
4589
|
const {
|
|
4557
4590
|
label,
|
|
4558
4591
|
labelFontFamily,
|
|
4592
|
+
labelFontSize,
|
|
4559
4593
|
labelLetterSpacing,
|
|
4560
4594
|
labelTextTransform,
|
|
4561
4595
|
labelColor,
|
|
4596
|
+
labelGap,
|
|
4562
4597
|
placeholder,
|
|
4563
4598
|
errorText,
|
|
4564
4599
|
infoText,
|
|
@@ -4587,12 +4622,13 @@ InputFieldComponent.multiline = forwardRef11(function Multiline(inputFieldProps,
|
|
|
4587
4622
|
[onChange, onChangeValue]
|
|
4588
4623
|
);
|
|
4589
4624
|
const readyId = id ?? internalId;
|
|
4590
|
-
return /* @__PURE__ */ jsxs14(Div_default.column, { gap: theme2.styles.gap / 2, children: [
|
|
4625
|
+
return /* @__PURE__ */ jsxs14(Div_default.column, { gap: labelGap ?? theme2.styles.gap / 2, children: [
|
|
4591
4626
|
label && /* @__PURE__ */ jsx17(
|
|
4592
4627
|
Label_default,
|
|
4593
4628
|
{
|
|
4594
4629
|
text: label,
|
|
4595
4630
|
fontFamily: labelFontFamily,
|
|
4631
|
+
fontSize: labelFontSize,
|
|
4596
4632
|
letterSpacing: labelLetterSpacing,
|
|
4597
4633
|
textTransform: labelTextTransform,
|
|
4598
4634
|
color: labelColor,
|
|
@@ -4760,6 +4796,7 @@ InputFieldComponent.phoneNumber = forwardRef11(function PhoneNumber(inputFieldPr
|
|
|
4760
4796
|
const {
|
|
4761
4797
|
label,
|
|
4762
4798
|
labelFontFamily,
|
|
4799
|
+
labelFontSize,
|
|
4763
4800
|
labelLetterSpacing,
|
|
4764
4801
|
labelTextTransform,
|
|
4765
4802
|
labelColor,
|
|
@@ -4832,6 +4869,7 @@ InputFieldComponent.phoneNumber = forwardRef11(function PhoneNumber(inputFieldPr
|
|
|
4832
4869
|
{
|
|
4833
4870
|
text: readyLabel,
|
|
4834
4871
|
fontFamily: betterHtmlContextInternal.components.inputField?.style?.phoneNumber?.labelFontFamily ?? labelFontFamily,
|
|
4872
|
+
fontSize: betterHtmlContextInternal.components.inputField?.style?.phoneNumber?.labelFontSize ?? labelFontSize,
|
|
4835
4873
|
letterSpacing: betterHtmlContextInternal.components.inputField?.style?.phoneNumber?.labelLetterSpacing ?? labelLetterSpacing,
|
|
4836
4874
|
textTransform: betterHtmlContextInternal.components.inputField?.style?.phoneNumber?.labelTextTransform ?? labelTextTransform,
|
|
4837
4875
|
color: betterHtmlContextInternal.components.inputField?.style?.phoneNumber?.labelColor ?? labelColor,
|
|
@@ -5381,12 +5419,12 @@ var componentSize = 26;
|
|
|
5381
5419
|
var switchComponentBallGap = 3;
|
|
5382
5420
|
var switchComponentMouseDownDifference = 4;
|
|
5383
5421
|
var InputElement2 = styled11.input.withConfig({
|
|
5384
|
-
shouldForwardProp: (prop) => !["theme", "style", "hoverStyle"].includes(prop)
|
|
5422
|
+
shouldForwardProp: (prop) => !["theme", "style", "hoverStyle", "size"].includes(prop)
|
|
5385
5423
|
})`
|
|
5386
5424
|
position: relative;
|
|
5387
5425
|
appearance: none;
|
|
5388
|
-
width: ${componentSize}px;
|
|
5389
|
-
height: ${componentSize}px;
|
|
5426
|
+
width: ${(props) => props.size ?? componentSize}px;
|
|
5427
|
+
height: ${(props) => props.size ?? componentSize}px;
|
|
5390
5428
|
background-color: ${(props) => props.theme.colors.backgroundContent};
|
|
5391
5429
|
border: ${(props) => props.theme.styles.borderWidth}px solid ${(props) => props.theme.colors.border};
|
|
5392
5430
|
border-radius: ${(props) => props.theme.styles.borderRadius / 2}px;
|
|
@@ -5472,16 +5510,20 @@ var SwitchElement = styled11.div.withConfig({
|
|
|
5472
5510
|
var ToggleInputComponent = forwardRef12(function ToggleInput({
|
|
5473
5511
|
label,
|
|
5474
5512
|
labelFontFamily,
|
|
5513
|
+
labelFontSize,
|
|
5475
5514
|
labelLetterSpacing,
|
|
5476
5515
|
labelTextTransform,
|
|
5477
5516
|
labelColor,
|
|
5517
|
+
labelGap,
|
|
5478
5518
|
text,
|
|
5479
5519
|
textFontFamily,
|
|
5520
|
+
textFontSize,
|
|
5480
5521
|
textLetterSpacing,
|
|
5481
5522
|
textTextTransform,
|
|
5482
5523
|
textAdvanced,
|
|
5483
5524
|
errorText,
|
|
5484
5525
|
infoText,
|
|
5526
|
+
size,
|
|
5485
5527
|
value,
|
|
5486
5528
|
onChange,
|
|
5487
5529
|
checked: controlledChecked,
|
|
@@ -5511,12 +5553,13 @@ var ToggleInputComponent = forwardRef12(function ToggleInput({
|
|
|
5511
5553
|
onChange?.(newIsChecked, value);
|
|
5512
5554
|
}, [checked, controlledChecked, onChange, value]);
|
|
5513
5555
|
const readyId = id ?? internalId;
|
|
5514
|
-
return /* @__PURE__ */ jsxs15(Div_default.column, { gap: theme2.styles.gap, ...excludeStyle, children: [
|
|
5556
|
+
return /* @__PURE__ */ jsxs15(Div_default.column, { gap: labelGap ?? theme2.styles.gap, ...excludeStyle, children: [
|
|
5515
5557
|
label && /* @__PURE__ */ jsx18(
|
|
5516
5558
|
Label_default,
|
|
5517
5559
|
{
|
|
5518
5560
|
text: label,
|
|
5519
5561
|
fontFamily: labelFontFamily,
|
|
5562
|
+
fontSize: labelFontSize,
|
|
5520
5563
|
letterSpacing: labelLetterSpacing,
|
|
5521
5564
|
textTransform: labelTextTransform,
|
|
5522
5565
|
color: labelColor,
|
|
@@ -5531,6 +5574,7 @@ var ToggleInputComponent = forwardRef12(function ToggleInput({
|
|
|
5531
5574
|
InputElement2,
|
|
5532
5575
|
{
|
|
5533
5576
|
theme: theme2,
|
|
5577
|
+
size,
|
|
5534
5578
|
type: props.type ?? "checkbox",
|
|
5535
5579
|
checked,
|
|
5536
5580
|
onChange: onChangeElement,
|
|
@@ -5576,6 +5620,7 @@ var ToggleInputComponent = forwardRef12(function ToggleInput({
|
|
|
5576
5620
|
Text_default,
|
|
5577
5621
|
{
|
|
5578
5622
|
fontFamily: textFontFamily,
|
|
5623
|
+
fontSize: textFontSize,
|
|
5579
5624
|
letterSpacing: textLetterSpacing,
|
|
5580
5625
|
textTransform: textTextTransform,
|
|
5581
5626
|
color,
|
|
@@ -5632,6 +5677,7 @@ var ToggleInput_default = {
|
|
|
5632
5677
|
const {
|
|
5633
5678
|
label,
|
|
5634
5679
|
labelFontFamily,
|
|
5680
|
+
labelFontSize,
|
|
5635
5681
|
labelLetterSpacing,
|
|
5636
5682
|
labelTextTransform,
|
|
5637
5683
|
labelColor,
|
|
@@ -5669,6 +5715,7 @@ var ToggleInput_default = {
|
|
|
5669
5715
|
{
|
|
5670
5716
|
text: label,
|
|
5671
5717
|
fontFamily: labelFontFamily,
|
|
5718
|
+
fontSize: labelFontSize,
|
|
5672
5719
|
letterSpacing: labelLetterSpacing,
|
|
5673
5720
|
textTransform: labelTextTransform,
|
|
5674
5721
|
color: labelColor,
|