react-better-html 1.1.221 → 1.1.223

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
@@ -976,7 +976,7 @@ type FoldableProps = {
976
976
  renderHeader?: (isOpen: boolean, toggleOpen: () => void) => React.ReactNode;
977
977
  onOpenChange?: (isOpen: boolean) => void;
978
978
  children?: React.ReactNode;
979
- } & DivProps;
979
+ } & OmitProps<DivProps, "ref">;
980
980
  type FoldableRef = {
981
981
  isOpen: boolean;
982
982
  open: () => void;
@@ -998,6 +998,7 @@ type SideMenuItem = {
998
998
  href?: string;
999
999
  disabled?: boolean;
1000
1000
  hidden?: boolean;
1001
+ withDot?: boolean;
1001
1002
  children?: SideMenuItem[];
1002
1003
  /** @default true */
1003
1004
  onClickCloseSideMenu?: boolean;
@@ -1094,4 +1095,4 @@ type LocalStoragePluginOptions = {
1094
1095
  declare const defaultLocalStoragePluginOptions: Required<LocalStoragePluginOptions>;
1095
1096
  declare const localStoragePlugin: BetterHtmlPluginConstructor<LocalStoragePluginOptions>;
1096
1097
 
1097
- export { type Alert, type AlertDisplay, type AlertDuration, type AlertType, type AlertsPluginOptions, type AppConfig, type BetterHtmlConfig, type BetterHtmlPlugin, _default$5 as BetterHtmlProvider, type BetterHtmlProviderConfig, type BrowserName, Button, type ButtonProps, Chip, type ChipProps, ColorThemeSwitch, type ColorThemeSwitchProps, type ComponentHoverStyle, type ComponentMarginProps, type ComponentPaddingProps, Div, type DivProps, _default$1 as Divider, Dropdown, type DropdownOption, type DropdownProps, Foldable, type FoldableProps, type FoldableRef, Form, type FormProps, FormRow, type FormRowProps, type HorizontalDividerProps, _default$3 as Icon, type IconProps, _default$2 as Image, type ImageProps, InputField, type InputFieldProps, _default as Label, type LabelProps, Loader, type LoaderProps, type LocalStoragePluginOptions, Modal, type ModalProps, type ModalRef, PageHeader, type PageHeaderProps, PageHolder, type PageHolderProps, Pagination, type PluginName, type ReactRouterDomPluginOptions, SideMenu, type SideMenuItem, type TabGroup, Table, type TableColumn, type TableFilterData, type TableListFilterListItem, type TableProps, type TableRef, Tabs, type TabsProps, type TabsRef, Text, type TextAs, type TextProps, type TextareaFieldProps, _default$4 as ToggleInput, type ToggleInputProps, type ToggleInputRef, Tooltip, type TooltipProps, type TooltipRef, type VerticalDividerProps, alertControls, alertsPlugin, defaultAlertsPluginOptions, defaultLocalStoragePluginOptions, defaultReactRouterDomPluginOptions, filterHover, generateLocalStorage, getBrowser, getFormErrorObject, isMobileDevice, localStoragePlugin, reactRouterDomPlugin, sideMenuControls, useAlertControls, useBetterHtmlContext, useForm, useMediaQuery, usePageResize, usePageScroll, useUrlQuery };
1098
+ export { type Alert, type AlertDisplay, type AlertDuration, type AlertType, type AlertsPluginOptions, type AppConfig, type BetterHtmlConfig, type BetterHtmlPlugin, _default$5 as BetterHtmlProvider, type BetterHtmlProviderConfig, type BrowserName, Button, type ButtonProps, Chip, type ChipProps, ColorThemeSwitch, type ColorThemeSwitchProps, type ComponentHoverStyle, type ComponentMarginProps, type ComponentPaddingProps, Div, type DivProps, _default$1 as Divider, Dropdown, type DropdownOption, type DropdownProps, Foldable, type FoldableProps, type FoldableRef, Form, type FormProps, FormRow, type FormRowProps, type HorizontalDividerProps, _default$3 as Icon, type IconProps, _default$2 as Image, type ImageProps, InputField, type InputFieldProps, _default as Label, type LabelProps, Loader, type LoaderProps, type LocalStoragePluginOptions, Modal, type ModalProps, type ModalRef, PageHeader, type PageHeaderProps, PageHolder, type PageHolderProps, Pagination, type PluginName, type ReactRouterDomPluginOptions, SideMenu, type SideMenuItem, type SideMenuProps, type TabGroup, Table, type TableColumn, type TableFilterData, type TableListFilterListItem, type TableProps, type TableRef, Tabs, type TabsProps, type TabsRef, Text, type TextAs, type TextProps, type TextareaFieldProps, _default$4 as ToggleInput, type ToggleInputProps, type ToggleInputRef, Tooltip, type TooltipProps, type TooltipRef, type VerticalDividerProps, alertControls, alertsPlugin, defaultAlertsPluginOptions, defaultLocalStoragePluginOptions, defaultReactRouterDomPluginOptions, filterHover, generateLocalStorage, getBrowser, getFormErrorObject, isMobileDevice, localStoragePlugin, reactRouterDomPlugin, sideMenuControls, useAlertControls, useBetterHtmlContext, useForm, useMediaQuery, usePageResize, usePageScroll, useUrlQuery };
package/dist/index.d.ts CHANGED
@@ -976,7 +976,7 @@ type FoldableProps = {
976
976
  renderHeader?: (isOpen: boolean, toggleOpen: () => void) => React.ReactNode;
977
977
  onOpenChange?: (isOpen: boolean) => void;
978
978
  children?: React.ReactNode;
979
- } & DivProps;
979
+ } & OmitProps<DivProps, "ref">;
980
980
  type FoldableRef = {
981
981
  isOpen: boolean;
982
982
  open: () => void;
@@ -998,6 +998,7 @@ type SideMenuItem = {
998
998
  href?: string;
999
999
  disabled?: boolean;
1000
1000
  hidden?: boolean;
1001
+ withDot?: boolean;
1001
1002
  children?: SideMenuItem[];
1002
1003
  /** @default true */
1003
1004
  onClickCloseSideMenu?: boolean;
@@ -1094,4 +1095,4 @@ type LocalStoragePluginOptions = {
1094
1095
  declare const defaultLocalStoragePluginOptions: Required<LocalStoragePluginOptions>;
1095
1096
  declare const localStoragePlugin: BetterHtmlPluginConstructor<LocalStoragePluginOptions>;
1096
1097
 
1097
- export { type Alert, type AlertDisplay, type AlertDuration, type AlertType, type AlertsPluginOptions, type AppConfig, type BetterHtmlConfig, type BetterHtmlPlugin, _default$5 as BetterHtmlProvider, type BetterHtmlProviderConfig, type BrowserName, Button, type ButtonProps, Chip, type ChipProps, ColorThemeSwitch, type ColorThemeSwitchProps, type ComponentHoverStyle, type ComponentMarginProps, type ComponentPaddingProps, Div, type DivProps, _default$1 as Divider, Dropdown, type DropdownOption, type DropdownProps, Foldable, type FoldableProps, type FoldableRef, Form, type FormProps, FormRow, type FormRowProps, type HorizontalDividerProps, _default$3 as Icon, type IconProps, _default$2 as Image, type ImageProps, InputField, type InputFieldProps, _default as Label, type LabelProps, Loader, type LoaderProps, type LocalStoragePluginOptions, Modal, type ModalProps, type ModalRef, PageHeader, type PageHeaderProps, PageHolder, type PageHolderProps, Pagination, type PluginName, type ReactRouterDomPluginOptions, SideMenu, type SideMenuItem, type TabGroup, Table, type TableColumn, type TableFilterData, type TableListFilterListItem, type TableProps, type TableRef, Tabs, type TabsProps, type TabsRef, Text, type TextAs, type TextProps, type TextareaFieldProps, _default$4 as ToggleInput, type ToggleInputProps, type ToggleInputRef, Tooltip, type TooltipProps, type TooltipRef, type VerticalDividerProps, alertControls, alertsPlugin, defaultAlertsPluginOptions, defaultLocalStoragePluginOptions, defaultReactRouterDomPluginOptions, filterHover, generateLocalStorage, getBrowser, getFormErrorObject, isMobileDevice, localStoragePlugin, reactRouterDomPlugin, sideMenuControls, useAlertControls, useBetterHtmlContext, useForm, useMediaQuery, usePageResize, usePageScroll, useUrlQuery };
1098
+ export { type Alert, type AlertDisplay, type AlertDuration, type AlertType, type AlertsPluginOptions, type AppConfig, type BetterHtmlConfig, type BetterHtmlPlugin, _default$5 as BetterHtmlProvider, type BetterHtmlProviderConfig, type BrowserName, Button, type ButtonProps, Chip, type ChipProps, ColorThemeSwitch, type ColorThemeSwitchProps, type ComponentHoverStyle, type ComponentMarginProps, type ComponentPaddingProps, Div, type DivProps, _default$1 as Divider, Dropdown, type DropdownOption, type DropdownProps, Foldable, type FoldableProps, type FoldableRef, Form, type FormProps, FormRow, type FormRowProps, type HorizontalDividerProps, _default$3 as Icon, type IconProps, _default$2 as Image, type ImageProps, InputField, type InputFieldProps, _default as Label, type LabelProps, Loader, type LoaderProps, type LocalStoragePluginOptions, Modal, type ModalProps, type ModalRef, PageHeader, type PageHeaderProps, PageHolder, type PageHolderProps, Pagination, type PluginName, type ReactRouterDomPluginOptions, SideMenu, type SideMenuItem, type SideMenuProps, type TabGroup, Table, type TableColumn, type TableFilterData, type TableListFilterListItem, type TableProps, type TableRef, Tabs, type TabsProps, type TabsRef, Text, type TextAs, type TextProps, type TextareaFieldProps, _default$4 as ToggleInput, type ToggleInputProps, type ToggleInputRef, Tooltip, type TooltipProps, type TooltipRef, type VerticalDividerProps, alertControls, alertsPlugin, defaultAlertsPluginOptions, defaultLocalStoragePluginOptions, defaultReactRouterDomPluginOptions, filterHover, generateLocalStorage, getBrowser, getFormErrorObject, isMobileDevice, localStoragePlugin, reactRouterDomPlugin, sideMenuControls, useAlertControls, useBetterHtmlContext, useForm, useMediaQuery, usePageResize, usePageScroll, useUrlQuery };
package/dist/index.js CHANGED
@@ -7235,6 +7235,7 @@ var Foldable_default = Foldable2;
7235
7235
  var import_react31 = require("react");
7236
7236
  var import_react_better_core29 = require("react-better-core");
7237
7237
  var import_jsx_runtime28 = require("react/jsx-runtime");
7238
+ var tabDotSize2 = 6;
7238
7239
  var sideMenuContext = (0, import_react31.createContext)(void 0);
7239
7240
  var SideMenuContextProvider = sideMenuContext.Provider;
7240
7241
  var useSideMenuContext = () => {
@@ -7272,6 +7273,10 @@ var MenuItemComponent = (0, import_react31.memo)(function MenuItemComponent2({ i
7272
7273
  item.onClick?.(item);
7273
7274
  }
7274
7275
  }, [onClick, item, isCollapsed]);
7276
+ const childrenHaveDot = (0, import_react31.useMemo)(
7277
+ () => item.children?.some((child) => child.withDot) ?? false,
7278
+ [item.children]
7279
+ );
7275
7280
  const isActive = activeItem && item.href && activeItem.href === item.href;
7276
7281
  const readyBackgroundColor = backgroundColor ?? theme2.colors.backgroundContent;
7277
7282
  const iconSize = 16;
@@ -7331,6 +7336,20 @@ var MenuItemComponent = (0, import_react31.memo)(function MenuItemComponent2({ i
7331
7336
  transform: isOpened ? "rotate(180deg)" : void 0,
7332
7337
  transition: theme2.styles.transition
7333
7338
  }
7339
+ ),
7340
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
7341
+ Div_default,
7342
+ {
7343
+ position: "absolute",
7344
+ top: (theme2.styles.space - tabDotSize2) / 2,
7345
+ right: (theme2.styles.space - tabDotSize2) / 2,
7346
+ width: tabDotSize2,
7347
+ height: tabDotSize2,
7348
+ backgroundColor: theme2.colors.primary,
7349
+ borderRadius: 999,
7350
+ opacity: item.withDot || childrenHaveDot && !isOpened ? 1 : 0,
7351
+ transition: theme2.styles.transition
7352
+ }
7334
7353
  )
7335
7354
  ]
7336
7355
  }