react-better-html 1.1.219 → 1.1.221

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 CHANGED
@@ -348,6 +348,8 @@ type DivComponentType = {
348
348
  grid: <Value>(props: ComponentPropWithRef<HTMLDivElement, OmitProps<DivProps<Value>, "display">>) => React.ReactElement;
349
349
  box: <Value>(props: ComponentPropWithRef<HTMLDivElement, DivProps<Value> & OmitProps<PageHeaderProps, "marginBottom"> & {
350
350
  headerBackgroundColor?: string;
351
+ /** @default theme.colors.primary */
352
+ activeColor?: string;
351
353
  isActive?: boolean;
352
354
  }>) => React.ReactElement;
353
355
  };
@@ -368,7 +370,7 @@ type LoaderProps = {
368
370
  width?: number;
369
371
  /** @default false */
370
372
  disabled?: boolean;
371
- } & OmitProps<DivProps, "width" | "height" | "color" | "background" | "borderRadius" | "mask" | "WebkitMask" | "padding" | "animation" | "animationName" | "transform" | "clipPath">;
373
+ } & OmitProps<DivProps, "children" | "width" | "height" | "color" | "background" | "borderRadius" | "mask" | "WebkitMask" | "padding" | "animation" | "animationName" | "transform" | "clipPath">;
372
374
  type LoaderComponentType = {
373
375
  (props: LoaderProps): React.ReactElement;
374
376
  box: (props: OmitProps<LoaderProps, "size"> & {
@@ -982,8 +984,8 @@ type FoldableRef = {
982
984
  toggle: () => void;
983
985
  };
984
986
  type FoldableComponentType = {
985
- (props: ComponentPropWithRef<HTMLDivElement, FoldableProps>): React.ReactElement;
986
- box: (props: ComponentPropWithRef<HTMLDivElement, FoldableProps>) => React.ReactElement;
987
+ (props: ComponentPropWithRef<FoldableRef, FoldableProps>): React.ReactElement;
988
+ box: (props: ComponentPropWithRef<FoldableRef, FoldableProps>) => React.ReactElement;
987
989
  };
988
990
  declare const FoldableComponent: FoldableComponentType;
989
991
  declare const Foldable: typeof FoldableComponent & {
package/dist/index.d.ts CHANGED
@@ -348,6 +348,8 @@ type DivComponentType = {
348
348
  grid: <Value>(props: ComponentPropWithRef<HTMLDivElement, OmitProps<DivProps<Value>, "display">>) => React.ReactElement;
349
349
  box: <Value>(props: ComponentPropWithRef<HTMLDivElement, DivProps<Value> & OmitProps<PageHeaderProps, "marginBottom"> & {
350
350
  headerBackgroundColor?: string;
351
+ /** @default theme.colors.primary */
352
+ activeColor?: string;
351
353
  isActive?: boolean;
352
354
  }>) => React.ReactElement;
353
355
  };
@@ -368,7 +370,7 @@ type LoaderProps = {
368
370
  width?: number;
369
371
  /** @default false */
370
372
  disabled?: boolean;
371
- } & OmitProps<DivProps, "width" | "height" | "color" | "background" | "borderRadius" | "mask" | "WebkitMask" | "padding" | "animation" | "animationName" | "transform" | "clipPath">;
373
+ } & OmitProps<DivProps, "children" | "width" | "height" | "color" | "background" | "borderRadius" | "mask" | "WebkitMask" | "padding" | "animation" | "animationName" | "transform" | "clipPath">;
372
374
  type LoaderComponentType = {
373
375
  (props: LoaderProps): React.ReactElement;
374
376
  box: (props: OmitProps<LoaderProps, "size"> & {
@@ -982,8 +984,8 @@ type FoldableRef = {
982
984
  toggle: () => void;
983
985
  };
984
986
  type FoldableComponentType = {
985
- (props: ComponentPropWithRef<HTMLDivElement, FoldableProps>): React.ReactElement;
986
- box: (props: ComponentPropWithRef<HTMLDivElement, FoldableProps>) => React.ReactElement;
987
+ (props: ComponentPropWithRef<FoldableRef, FoldableProps>): React.ReactElement;
988
+ box: (props: ComponentPropWithRef<FoldableRef, FoldableProps>) => React.ReactElement;
987
989
  };
988
990
  declare const FoldableComponent: FoldableComponentType;
989
991
  declare const Foldable: typeof FoldableComponent & {
package/dist/index.js CHANGED
@@ -1777,20 +1777,22 @@ DivComponent.box = (0, import_react8.forwardRef)(function Box({
1777
1777
  rightElement,
1778
1778
  lightMode,
1779
1779
  headerBackgroundColor,
1780
+ activeColor,
1780
1781
  isActive,
1781
1782
  children,
1782
1783
  ...props
1783
1784
  }, ref) {
1784
1785
  const theme2 = (0, import_react_better_core7.useTheme)();
1785
1786
  const withClick = props.onClick || props.onClickWithValue;
1787
+ const readyActiveColor = activeColor ?? theme2.colors.primary;
1786
1788
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1787
1789
  DivComponent,
1788
1790
  {
1789
1791
  color: isActive ? theme2.colors.base : void 0,
1790
- backgroundColor: isActive ? theme2.colors.primary : theme2.colors.backgroundContent,
1791
- border: `1px solid ${isActive ? theme2.colors.primary : theme2.colors.border}`,
1792
+ backgroundColor: isActive ? readyActiveColor : theme2.colors.backgroundContent,
1793
+ border: `1px solid ${isActive ? readyActiveColor : theme2.colors.border}`,
1792
1794
  borderRadius: theme2.styles.borderRadius,
1793
- borderColorHover: withClick && !isActive ? theme2.colors.primary : void 0,
1795
+ borderColorHover: withClick && !isActive ? readyActiveColor : void 0,
1794
1796
  filterHover: withClick && isActive ? "brightness(0.9)" : void 0,
1795
1797
  cursor: withClick ? "pointer" : void 0,
1796
1798
  paddingBlock: title ? theme2.styles.space : theme2.styles.gap,
@@ -7142,18 +7144,14 @@ var FoldableComponent = (0, import_react30.forwardRef)(function Foldable({
7142
7144
  observer.disconnect();
7143
7145
  };
7144
7146
  }, [isOpen]);
7145
- (0, import_react30.useImperativeHandle)(
7146
- ref,
7147
- () => {
7148
- return {
7149
- open,
7150
- close,
7151
- toggle: toggleOpen,
7152
- isOpen
7153
- };
7154
- },
7155
- [open, close, toggleOpen, isOpen]
7156
- );
7147
+ (0, import_react30.useImperativeHandle)(ref, () => {
7148
+ return {
7149
+ open,
7150
+ close,
7151
+ toggle: toggleOpen,
7152
+ isOpen
7153
+ };
7154
+ }, [open, close, toggleOpen, isOpen]);
7157
7155
  return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Div_default.column, { width: "100%", ...props, children: [
7158
7156
  renderHeader ? renderHeader(isOpen, toggleOpen) : /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
7159
7157
  Div_default.row,