react-better-html 1.1.289 → 1.1.291

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.mjs CHANGED
@@ -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,
@@ -2155,6 +2159,7 @@ var ButtonComponent = function Button({
2155
2159
  value,
2156
2160
  download,
2157
2161
  target,
2162
+ gap,
2158
2163
  icon,
2159
2164
  iconPosition = "left",
2160
2165
  iconColor,
@@ -2246,7 +2251,7 @@ var ButtonComponent = function Button({
2246
2251
  height: href ? "100%" : void 0,
2247
2252
  alignItems: "center",
2248
2253
  justifyContent: "center",
2249
- gap: 10,
2254
+ gap: gap ?? (theme2.styles.gap + theme2.styles.space) / 2,
2250
2255
  pointerEvents: "none",
2251
2256
  opacity: isLoadingElement ? 0 : 1,
2252
2257
  transition: theme2.styles.transition,
@@ -2331,13 +2336,16 @@ ButtonComponent.text = function Text3(buttonProps) {
2331
2336
  return /* @__PURE__ */ jsx8(
2332
2337
  ButtonComponent,
2333
2338
  {
2339
+ fontWeight: 700,
2334
2340
  color: readyColor,
2335
2341
  colorHover: lightenColor(readyColor, 0.3),
2336
2342
  backgroundColor: "transparent",
2337
2343
  backgroundColorHover: "transparent",
2338
2344
  borderRadius: 0,
2339
2345
  loaderSize: 12,
2340
- isSmall: true,
2346
+ gap: theme2.styles.gap,
2347
+ paddingInline: theme2.styles.gap,
2348
+ paddingBlock: theme2.styles.gap / 2,
2341
2349
  ...fromSubcomponentProps,
2342
2350
  ...props
2343
2351
  }
@@ -3855,6 +3863,8 @@ var DropdownComponent = forwardRef10(function Dropdown(dropdownProps, ref) {
3855
3863
  withMultiselect,
3856
3864
  id,
3857
3865
  textAlign,
3866
+ backgroundColor,
3867
+ borderRadius,
3858
3868
  ...props
3859
3869
  } = useComponentsPropsMerger(
3860
3870
  betterHtmlContextInternal.components.dropdown?.style?.default,
@@ -4080,6 +4090,8 @@ var DropdownComponent = forwardRef10(function Dropdown(dropdownProps, ref) {
4080
4090
  infoTextColor,
4081
4091
  required: withMultiselect ? (Array.isArray(value) ? value.length > 0 : value !== void 0) ? false : required : required,
4082
4092
  textAlign,
4093
+ backgroundColor,
4094
+ borderRadius,
4083
4095
  name,
4084
4096
  disabled,
4085
4097
  readOnly: !withSearch,
@@ -5792,13 +5804,24 @@ var componentSize = 26;
5792
5804
  var switchComponentBallGap = 3;
5793
5805
  var switchComponentMouseDownDifference = 4;
5794
5806
  var InputElement2 = styled11.input.withConfig({
5795
- shouldForwardProp: (prop) => !["theme", "colorTheme", "style", "hoverStyle", "size", "withNoBorder"].includes(prop)
5807
+ shouldForwardProp: (prop) => ![
5808
+ "theme",
5809
+ "colorTheme",
5810
+ "style",
5811
+ "hoverStyle",
5812
+ "size",
5813
+ "withNoBorder",
5814
+ "inactiveColor",
5815
+ "activeColor",
5816
+ "inactiveBackgroundColor",
5817
+ "activeBackgroundColor"
5818
+ ].includes(prop)
5796
5819
  })`
5797
5820
  position: relative;
5798
5821
  appearance: none;
5799
5822
  width: ${(props) => props.size ?? componentSize}px;
5800
5823
  height: ${(props) => props.size ?? componentSize}px;
5801
- background-color: ${(props) => props.theme.colors.backgroundContent};
5824
+ background-color: ${(props) => props.inactiveBackgroundColor ?? props.theme.colors.backgroundContent};
5802
5825
  border: ${(props) => props.theme.styles.borderWidth}px solid ${(props) => props.theme.colors.border};
5803
5826
  border-radius: ${(props) => props.theme.styles.borderRadius / 2}px;
5804
5827
  cursor: pointer;
@@ -5810,8 +5833,8 @@ var InputElement2 = styled11.input.withConfig({
5810
5833
  }
5811
5834
 
5812
5835
  &:checked {
5813
- background-color: ${(props) => props.theme.colors.primary};
5814
- border-color: ${(props) => props.theme.colors.primary};
5836
+ background-color: ${(props) => props.activeBackgroundColor ?? props.theme.colors.primary};
5837
+ border-color: ${(props) => props.activeBackgroundColor ?? props.theme.colors.primary};
5815
5838
  }
5816
5839
 
5817
5840
  &:disabled {
@@ -5832,7 +5855,18 @@ var InputElement2 = styled11.input.withConfig({
5832
5855
  }
5833
5856
  `;
5834
5857
  var SwitchElement = styled11.div.withConfig({
5835
- shouldForwardProp: (prop) => !["theme", "checked", "disabled", "isMouseDown", "style", "hoverStyle"].includes(prop)
5858
+ shouldForwardProp: (prop) => ![
5859
+ "theme",
5860
+ "checked",
5861
+ "disabled",
5862
+ "isMouseDown",
5863
+ "style",
5864
+ "hoverStyle",
5865
+ "activeColor",
5866
+ "inactiveColor",
5867
+ "inactiveBackgroundColor",
5868
+ "activeBackgroundColor"
5869
+ ].includes(prop)
5836
5870
  })`
5837
5871
  --width: ${(props) => componentSize * 2 - props.theme.styles.gap / 2}px;
5838
5872
  --ball-size: ${componentSize - switchComponentBallGap * 2}px;
@@ -5840,7 +5874,7 @@ var SwitchElement = styled11.div.withConfig({
5840
5874
  position: relative;
5841
5875
  width: var(--width);
5842
5876
  height: ${componentSize}px;
5843
- background-color: ${(props) => props.checked ? props.theme.colors.primary : props.theme.colors.border};
5877
+ background-color: ${(props) => props.checked ? props.activeBackgroundColor ?? props.theme.colors.primary : props.inactiveBackgroundColor ?? props.theme.colors.border};
5844
5878
  border-radius: 999px;
5845
5879
  cursor: ${(props) => props.disabled ? "not-allowed" : "pointer"};
5846
5880
  opacity: ${(props) => props.disabled ? 0.5 : 1};
@@ -5851,7 +5885,7 @@ var SwitchElement = styled11.div.withConfig({
5851
5885
  position: absolute;
5852
5886
  width: ${(props) => componentSize - switchComponentBallGap * 2 + (props.isMouseDown ? switchComponentMouseDownDifference : 0)}px;
5853
5887
  height: ${componentSize - switchComponentBallGap * 2}px;
5854
- background-color: ${(props) => props.theme.colors.base};
5888
+ background-color: ${(props) => props.checked ? props.activeColor ?? props.theme.colors.base : props.inactiveColor ?? props.theme.colors.base};
5855
5889
  border-radius: 999px;
5856
5890
  top: ${switchComponentBallGap}px;
5857
5891
  left: ${switchComponentBallGap}px;
@@ -5867,7 +5901,7 @@ var SwitchElement = styled11.div.withConfig({
5867
5901
  position: absolute;
5868
5902
  width: ${(props) => componentSize - switchComponentBallGap * 2 + (props.isMouseDown ? switchComponentMouseDownDifference : 0)}px;
5869
5903
  height: ${componentSize - switchComponentBallGap * 2}px;
5870
- background-color: ${(props) => props.checked ? props.theme.colors.primary : "transparent"};
5904
+ background-color: ${(props) => props.checked ? props.activeBackgroundColor ?? props.theme.colors.primary : "transparent"};
5871
5905
  border-radius: 999px;
5872
5906
  top: ${switchComponentBallGap}px;
5873
5907
  left: ${switchComponentBallGap}px;
@@ -5901,6 +5935,10 @@ var ToggleInputComponent = forwardRef12(function ToggleInput({
5901
5935
  errorText,
5902
5936
  infoText,
5903
5937
  infoTextColor,
5938
+ inactiveColor,
5939
+ activeColor,
5940
+ inactiveBackgroundColor,
5941
+ activeBackgroundColor,
5904
5942
  size = componentSize,
5905
5943
  value,
5906
5944
  onChange,
@@ -5956,6 +5994,10 @@ var ToggleInputComponent = forwardRef12(function ToggleInput({
5956
5994
  colorTheme,
5957
5995
  size,
5958
5996
  withNoBorder: theme2.styles.borderWidth === 0,
5997
+ inactiveColor,
5998
+ activeColor,
5999
+ inactiveBackgroundColor,
6000
+ activeBackgroundColor,
5959
6001
  type: props.type ?? "checkbox",
5960
6002
  checked,
5961
6003
  onChange: onChangeElement,
@@ -5974,7 +6016,7 @@ var ToggleInputComponent = forwardRef12(function ToggleInput({
5974
6016
  position: "absolute",
5975
6017
  top: "50%",
5976
6018
  left: "50%",
5977
- color: theme2.colors.base,
6019
+ color: activeColor ?? theme2.colors.base,
5978
6020
  size: size / 1.8,
5979
6021
  transform: `translate(-50%, -50%)${checked ? "" : " scale(0.4)"}`,
5980
6022
  opacity: checked ? 1 : 0,
@@ -5989,7 +6031,7 @@ var ToggleInputComponent = forwardRef12(function ToggleInput({
5989
6031
  height: size / 2,
5990
6032
  top: "50%",
5991
6033
  left: "50%",
5992
- backgroundColor: theme2.colors.base,
6034
+ backgroundColor: activeColor ?? theme2.colors.base,
5993
6035
  borderRadius: 999,
5994
6036
  transform: `translate(-50%, -50%)${checked ? "" : " scale(0.4)"}`,
5995
6037
  opacity: checked ? 1 : 0,