react-better-html 1.1.243 → 1.1.245

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
@@ -416,6 +416,24 @@ type LabelProps = {
416
416
  declare function Label(labelProps: LabelProps): react_jsx_runtime.JSX.Element;
417
417
  declare const _default$3: react.MemoExoticComponent<typeof Label>;
418
418
 
419
+ type ImageProps = {
420
+ name?: AssetName | AnyOtherString;
421
+ } & OmitProps<React.ComponentProps<"img">, "style"> & ComponentStyle & ComponentHoverStyle;
422
+ type ImageComponent = {
423
+ (props: ComponentPropWithRef<HTMLImageElement, ImageProps>): React.ReactElement;
424
+ profileImage: (props: ComponentPropWithRef<HTMLImageElement, OmitProps<ImageProps, "width" | "height"> & {
425
+ /** @default 40 */
426
+ size?: number;
427
+ letters?: string;
428
+ letterColor?: string;
429
+ backgroundColor?: string;
430
+ }>) => React.ReactElement;
431
+ };
432
+ declare const Image: ImageComponent;
433
+ declare const _default$2: ImageComponent & {
434
+ profileImage: typeof Image.profileImage;
435
+ };
436
+
419
437
  type ComponentStyleConfig<ComponentProps, Subcomponents extends string> = {
420
438
  [key in Subcomponents]?: Partial<ComponentProps>;
421
439
  };
@@ -452,6 +470,9 @@ type BetterHtmlConfig = {
452
470
  horizontal?: HorizontalDividerProps;
453
471
  };
454
472
  };
473
+ image?: {
474
+ style?: ComponentStyleConfig<ImageProps, "default" | "profileImage">;
475
+ };
455
476
  sideMenu?: {
456
477
  /** @default 300 */
457
478
  width?: number;
@@ -521,7 +542,7 @@ type BetterHtmlProviderProps = BetterProviderCommonProps & {
521
542
  config?: BetterHtmlProviderConfig;
522
543
  };
523
544
  declare function BetterHtmlProvider({ config, ...props }: BetterHtmlProviderProps): react_jsx_runtime.JSX.Element;
524
- declare const _default$2: react.MemoExoticComponent<typeof BetterHtmlProvider>;
545
+ declare const _default$1: react.MemoExoticComponent<typeof BetterHtmlProvider>;
525
546
 
526
547
  declare const isMobileDevice: boolean;
527
548
 
@@ -652,25 +673,7 @@ type IconProps = {
652
673
  type IconComponent = {
653
674
  (props: ComponentPropWithRef<SVGSVGElement, IconProps>): React.ReactElement;
654
675
  };
655
- declare const _default$1: IconComponent;
656
-
657
- type ImageProps = {
658
- name?: AssetName | AnyOtherString;
659
- } & OmitProps<React.ComponentProps<"img">, "style"> & ComponentStyle & ComponentHoverStyle;
660
- type ImageComponent = {
661
- (props: ComponentPropWithRef<HTMLImageElement, ImageProps>): React.ReactElement;
662
- profileImage: (props: ComponentPropWithRef<HTMLImageElement, OmitProps<ImageProps, "width" | "height"> & {
663
- /** @default 40 */
664
- size?: number;
665
- letters?: string;
666
- letterColor?: string;
667
- backgroundColor?: string;
668
- }>) => React.ReactElement;
669
- };
670
- declare const Image: ImageComponent;
671
- declare const _default: ImageComponent & {
672
- profileImage: typeof Image.profileImage;
673
- };
676
+ declare const _default: IconComponent;
674
677
 
675
678
  type ModalProps = {
676
679
  /**
@@ -1099,12 +1102,17 @@ type SideMenuProps = {
1099
1102
  type SideMenuComponentType = {
1100
1103
  (props: SideMenuProps): React.ReactElement;
1101
1104
  pageHolder: (props: SideMenuPageHolderProps) => React.ReactElement;
1102
- burgerButton: () => React.ReactElement;
1105
+ burgerButton: (props: BurgerButtonProps) => React.ReactElement;
1103
1106
  };
1104
1107
  declare const SideMenuComponent: SideMenuComponentType;
1105
1108
  type SideMenuPageHolderProps = PageHolderProps & {
1106
1109
  outsideComponent?: React.ReactNode;
1107
1110
  };
1111
+ type BurgerButtonProps = {
1112
+ /** @default "left" */
1113
+ position?: "left" | "center" | "right";
1114
+ onClick?: (isOpened: boolean) => void;
1115
+ };
1108
1116
  declare const SideMenu: typeof SideMenuComponent & {
1109
1117
  pageHolder: typeof SideMenuComponent.pageHolder;
1110
1118
  burgerButton: typeof SideMenuComponent.burgerButton;
@@ -1169,4 +1177,4 @@ type LocalStoragePluginOptions = {
1169
1177
  declare const defaultLocalStoragePluginOptions: Required<LocalStoragePluginOptions>;
1170
1178
  declare const localStoragePlugin: BetterHtmlPluginConstructor<LocalStoragePluginOptions>;
1171
1179
 
1172
- export { type Alert, type AlertDisplay, type AlertDuration, type AlertType, type AlertsPluginOptions, type AppConfig, type BetterHtmlConfig, type BetterHtmlPlugin, _default$2 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$4 as Divider, Dropdown, type DropdownOption, type DropdownProps, Foldable, type FoldableProps, type FoldableRef, Form, type FormProps, FormRow, type FormRowProps, type HorizontalDividerProps, _default$1 as Icon, type IconProps, _default as Image, type ImageProps, InputField, type InputFieldProps, _default$3 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$5 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 };
1180
+ export { type Alert, type AlertDisplay, type AlertDuration, type AlertType, type AlertsPluginOptions, type AppConfig, type BetterHtmlConfig, type BetterHtmlPlugin, _default$1 as BetterHtmlProvider, type BetterHtmlProviderConfig, type BrowserName, type BurgerButtonProps, Button, type ButtonProps, Chip, type ChipProps, ColorThemeSwitch, type ColorThemeSwitchProps, type ComponentHoverStyle, type ComponentMarginProps, type ComponentPaddingProps, Div, type DivProps, _default$4 as Divider, Dropdown, type DropdownOption, type DropdownProps, Foldable, type FoldableProps, type FoldableRef, Form, type FormProps, FormRow, type FormRowProps, type HorizontalDividerProps, _default as Icon, type IconProps, _default$2 as Image, type ImageProps, InputField, type InputFieldProps, _default$3 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$5 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
@@ -416,6 +416,24 @@ type LabelProps = {
416
416
  declare function Label(labelProps: LabelProps): react_jsx_runtime.JSX.Element;
417
417
  declare const _default$3: react.MemoExoticComponent<typeof Label>;
418
418
 
419
+ type ImageProps = {
420
+ name?: AssetName | AnyOtherString;
421
+ } & OmitProps<React.ComponentProps<"img">, "style"> & ComponentStyle & ComponentHoverStyle;
422
+ type ImageComponent = {
423
+ (props: ComponentPropWithRef<HTMLImageElement, ImageProps>): React.ReactElement;
424
+ profileImage: (props: ComponentPropWithRef<HTMLImageElement, OmitProps<ImageProps, "width" | "height"> & {
425
+ /** @default 40 */
426
+ size?: number;
427
+ letters?: string;
428
+ letterColor?: string;
429
+ backgroundColor?: string;
430
+ }>) => React.ReactElement;
431
+ };
432
+ declare const Image: ImageComponent;
433
+ declare const _default$2: ImageComponent & {
434
+ profileImage: typeof Image.profileImage;
435
+ };
436
+
419
437
  type ComponentStyleConfig<ComponentProps, Subcomponents extends string> = {
420
438
  [key in Subcomponents]?: Partial<ComponentProps>;
421
439
  };
@@ -452,6 +470,9 @@ type BetterHtmlConfig = {
452
470
  horizontal?: HorizontalDividerProps;
453
471
  };
454
472
  };
473
+ image?: {
474
+ style?: ComponentStyleConfig<ImageProps, "default" | "profileImage">;
475
+ };
455
476
  sideMenu?: {
456
477
  /** @default 300 */
457
478
  width?: number;
@@ -521,7 +542,7 @@ type BetterHtmlProviderProps = BetterProviderCommonProps & {
521
542
  config?: BetterHtmlProviderConfig;
522
543
  };
523
544
  declare function BetterHtmlProvider({ config, ...props }: BetterHtmlProviderProps): react_jsx_runtime.JSX.Element;
524
- declare const _default$2: react.MemoExoticComponent<typeof BetterHtmlProvider>;
545
+ declare const _default$1: react.MemoExoticComponent<typeof BetterHtmlProvider>;
525
546
 
526
547
  declare const isMobileDevice: boolean;
527
548
 
@@ -652,25 +673,7 @@ type IconProps = {
652
673
  type IconComponent = {
653
674
  (props: ComponentPropWithRef<SVGSVGElement, IconProps>): React.ReactElement;
654
675
  };
655
- declare const _default$1: IconComponent;
656
-
657
- type ImageProps = {
658
- name?: AssetName | AnyOtherString;
659
- } & OmitProps<React.ComponentProps<"img">, "style"> & ComponentStyle & ComponentHoverStyle;
660
- type ImageComponent = {
661
- (props: ComponentPropWithRef<HTMLImageElement, ImageProps>): React.ReactElement;
662
- profileImage: (props: ComponentPropWithRef<HTMLImageElement, OmitProps<ImageProps, "width" | "height"> & {
663
- /** @default 40 */
664
- size?: number;
665
- letters?: string;
666
- letterColor?: string;
667
- backgroundColor?: string;
668
- }>) => React.ReactElement;
669
- };
670
- declare const Image: ImageComponent;
671
- declare const _default: ImageComponent & {
672
- profileImage: typeof Image.profileImage;
673
- };
676
+ declare const _default: IconComponent;
674
677
 
675
678
  type ModalProps = {
676
679
  /**
@@ -1099,12 +1102,17 @@ type SideMenuProps = {
1099
1102
  type SideMenuComponentType = {
1100
1103
  (props: SideMenuProps): React.ReactElement;
1101
1104
  pageHolder: (props: SideMenuPageHolderProps) => React.ReactElement;
1102
- burgerButton: () => React.ReactElement;
1105
+ burgerButton: (props: BurgerButtonProps) => React.ReactElement;
1103
1106
  };
1104
1107
  declare const SideMenuComponent: SideMenuComponentType;
1105
1108
  type SideMenuPageHolderProps = PageHolderProps & {
1106
1109
  outsideComponent?: React.ReactNode;
1107
1110
  };
1111
+ type BurgerButtonProps = {
1112
+ /** @default "left" */
1113
+ position?: "left" | "center" | "right";
1114
+ onClick?: (isOpened: boolean) => void;
1115
+ };
1108
1116
  declare const SideMenu: typeof SideMenuComponent & {
1109
1117
  pageHolder: typeof SideMenuComponent.pageHolder;
1110
1118
  burgerButton: typeof SideMenuComponent.burgerButton;
@@ -1169,4 +1177,4 @@ type LocalStoragePluginOptions = {
1169
1177
  declare const defaultLocalStoragePluginOptions: Required<LocalStoragePluginOptions>;
1170
1178
  declare const localStoragePlugin: BetterHtmlPluginConstructor<LocalStoragePluginOptions>;
1171
1179
 
1172
- export { type Alert, type AlertDisplay, type AlertDuration, type AlertType, type AlertsPluginOptions, type AppConfig, type BetterHtmlConfig, type BetterHtmlPlugin, _default$2 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$4 as Divider, Dropdown, type DropdownOption, type DropdownProps, Foldable, type FoldableProps, type FoldableRef, Form, type FormProps, FormRow, type FormRowProps, type HorizontalDividerProps, _default$1 as Icon, type IconProps, _default as Image, type ImageProps, InputField, type InputFieldProps, _default$3 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$5 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 };
1180
+ export { type Alert, type AlertDisplay, type AlertDuration, type AlertType, type AlertsPluginOptions, type AppConfig, type BetterHtmlConfig, type BetterHtmlPlugin, _default$1 as BetterHtmlProvider, type BetterHtmlProviderConfig, type BrowserName, type BurgerButtonProps, Button, type ButtonProps, Chip, type ChipProps, ColorThemeSwitch, type ColorThemeSwitchProps, type ComponentHoverStyle, type ComponentMarginProps, type ComponentPaddingProps, Div, type DivProps, _default$4 as Divider, Dropdown, type DropdownOption, type DropdownProps, Foldable, type FoldableProps, type FoldableRef, Form, type FormProps, FormRow, type FormRowProps, type HorizontalDividerProps, _default as Icon, type IconProps, _default$2 as Image, type ImageProps, InputField, type InputFieldProps, _default$3 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$5 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
@@ -1379,6 +1379,8 @@ var import_jsx_runtime = require("react/jsx-runtime");
1379
1379
  var TextStyledComponent = import_styled_components.default.p.withConfig({
1380
1380
  shouldForwardProp: (prop) => !["style", "hoverStyle"].includes(prop)
1381
1381
  })`
1382
+ font-size: ${(props) => props.theme.styles.fontSize}px;
1383
+
1382
1384
  ${(props) => props.style}
1383
1385
 
1384
1386
  &:hover {
@@ -1386,6 +1388,7 @@ var TextStyledComponent = import_styled_components.default.p.withConfig({
1386
1388
  }
1387
1389
  `;
1388
1390
  var TextComponent = (0, import_react2.forwardRef)(function Text({ htmlContentTranslate, children, ...props }, ref) {
1391
+ const theme2 = (0, import_react_better_core2.useTheme)();
1389
1392
  const { style, hoverStyle, restProps } = useComponentPropsGrouper(props);
1390
1393
  const dataProps = useComponentPropsWithPrefix(restProps, "data");
1391
1394
  const ariaProps = useComponentPropsWithPrefix(restProps, "aria");
@@ -1393,6 +1396,7 @@ var TextComponent = (0, import_react2.forwardRef)(function Text({ htmlContentTra
1393
1396
  TextStyledComponent,
1394
1397
  {
1395
1398
  as: props.as,
1399
+ theme: theme2,
1396
1400
  translate: htmlContentTranslate,
1397
1401
  style,
1398
1402
  hoverStyle,
@@ -1500,7 +1504,12 @@ var ImageElement = import_styled_components2.default.img.withConfig({
1500
1504
  ${(props) => props.hoverStyle}
1501
1505
  }
1502
1506
  `;
1503
- var Image = (0, import_react4.forwardRef)(function Image2({ name, src, ...props }, ref) {
1507
+ var Image = (0, import_react4.forwardRef)(function Image2(ImageProps3, ref) {
1508
+ const betterHtmlContextInternal = useBetterHtmlContextInternal();
1509
+ const { name, src, ...props } = useComponentsPropsMerger(
1510
+ betterHtmlContextInternal.components.image?.style?.default,
1511
+ ImageProps3
1512
+ );
1504
1513
  const { assets: assets2 } = (0, import_react_better_core4.useBetterCoreContext)();
1505
1514
  const { style, hoverStyle, restProps } = useComponentPropsGrouper(props);
1506
1515
  const dataProps = useComponentPropsWithPrefix(restProps, "data");
@@ -1525,7 +1534,9 @@ var Image = (0, import_react4.forwardRef)(function Image2({ name, src, ...props
1525
1534
  }
1526
1535
  );
1527
1536
  });
1528
- Image.profileImage = (0, import_react4.forwardRef)(function ProfileImage({ size = 40, letters, letterColor, backgroundColor, ...props }, ref) {
1537
+ Image.profileImage = (0, import_react4.forwardRef)(function ProfileImage({ size = 40, letters, letterColor, backgroundColor, ...ImageProps3 }, ref) {
1538
+ const betterHtmlContextInternal = useBetterHtmlContextInternal();
1539
+ const props = useComponentsPropsMerger(betterHtmlContextInternal.components.image?.style?.default, ImageProps3);
1529
1540
  const theme2 = (0, import_react_better_core4.useTheme)();
1530
1541
  return letters ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1531
1542
  Div_default.row,
@@ -1968,6 +1979,75 @@ var import_react10 = require("react");
1968
1979
  var import_react_better_core9 = require("react-better-core");
1969
1980
  var import_styled_components6 = __toESM(require("styled-components"));
1970
1981
 
1982
+ // src/utils/variableFunctions.ts
1983
+ var checkBetterCoreContextValue = (value, functionsName) => {
1984
+ if (value === void 0) {
1985
+ throw new Error(
1986
+ `\`${functionsName}()\` must be used within a \`<BetterCoreProvider>\`. Make sure to add one at the root of your component tree.`
1987
+ );
1988
+ }
1989
+ return value !== void 0;
1990
+ };
1991
+ var checkBetterHtmlContextValue = (value, functionsName) => {
1992
+ if (value === void 0) {
1993
+ throw new Error(
1994
+ `\`${functionsName}()\` must be used within a \`<BetterHtmlProvider>\`. Make sure to add one at the root of your component tree.`
1995
+ );
1996
+ }
1997
+ return value !== void 0;
1998
+ };
1999
+ var alertControls = {
2000
+ createAlert: (alert) => {
2001
+ if (!checkBetterHtmlContextValue(externalBetterHtmlContextValue, "alertControls.createAlert"))
2002
+ return void 0;
2003
+ const readyAlert = {
2004
+ id: crypto.randomUUID(),
2005
+ ...alert
2006
+ };
2007
+ externalBetterHtmlContextValue.setAlerts((oldValue) => [...oldValue, readyAlert]);
2008
+ return readyAlert;
2009
+ },
2010
+ removeAlert: (alertId) => {
2011
+ if (!checkBetterHtmlContextValue(externalBetterHtmlContextValue, "alertControls.removeAlert")) return;
2012
+ externalBetterHtmlContextValue.setAlerts((oldValue) => oldValue.filter((alert) => alert.id !== alertId));
2013
+ }
2014
+ };
2015
+ var sideMenuControls = {
2016
+ expand: () => {
2017
+ if (!checkBetterHtmlContextValue(externalBetterHtmlContextValue, "sideMenuControls.expand")) return;
2018
+ externalBetterHtmlContextValue.setSideMenuIsCollapsed.setFalse();
2019
+ },
2020
+ collapse: () => {
2021
+ if (!checkBetterHtmlContextValue(externalBetterHtmlContextValue, "sideMenuControls.collapse")) return;
2022
+ externalBetterHtmlContextValue.setSideMenuIsCollapsed.setTrue();
2023
+ },
2024
+ toggleExpanded: () => {
2025
+ if (!checkBetterHtmlContextValue(externalBetterHtmlContextValue, "sideMenuControls.toggleExpanded")) return;
2026
+ externalBetterHtmlContextValue.setSideMenuIsCollapsed.toggle();
2027
+ },
2028
+ open: () => {
2029
+ if (!checkBetterHtmlContextValue(externalBetterHtmlContextValue, "sideMenuControls.open")) return;
2030
+ externalBetterHtmlContextValue.setSideMenuIsOpenMobile.setTrue();
2031
+ },
2032
+ close: () => {
2033
+ if (!checkBetterHtmlContextValue(externalBetterHtmlContextValue, "sideMenuControls.close")) return;
2034
+ externalBetterHtmlContextValue.setSideMenuIsOpenMobile.setFalse();
2035
+ },
2036
+ toggleOpened: () => {
2037
+ if (!checkBetterHtmlContextValue(externalBetterHtmlContextValue, "sideMenuControls.toggleOpened")) return;
2038
+ externalBetterHtmlContextValue.setSideMenuIsOpenMobile.toggle();
2039
+ }
2040
+ };
2041
+ var filterHover = () => {
2042
+ if (!checkBetterCoreContextValue(externalBetterCoreContextValue, "filterHover")) return void 0;
2043
+ return {
2044
+ z05: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(1.2)" : "brightness(0.95)",
2045
+ z1: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(1.3)" : "brightness(0.9)",
2046
+ z2: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(1.6)" : "brightness(0.8)",
2047
+ z3: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(1.9)" : "brightness(0.7)"
2048
+ };
2049
+ };
2050
+
1971
2051
  // src/components/Loader.tsx
1972
2052
  var import_react9 = require("react");
1973
2053
  var import_react_better_core8 = require("react-better-core");
@@ -2043,8 +2123,8 @@ var ButtonElement = import_styled_components6.default.button.withConfig({
2043
2123
  width: fit-content;
2044
2124
  min-width: max-content;
2045
2125
  font-family: ${(props) => props.theme.styles.fontFamily};
2046
- font-size: 16px;
2047
- line-height: 20px;
2126
+ font-size: ${(props) => props.theme.styles.fontSize}px;
2127
+ line-height: ${(props) => props.theme.styles.fontSize + 4}px;
2048
2128
  text-decoration: none;
2049
2129
  color: ${(props) => props.theme.colors.base};
2050
2130
  background-color: ${(props) => props.theme.colors.primary};
@@ -2062,12 +2142,12 @@ var ButtonElement = import_styled_components6.default.button.withConfig({
2062
2142
  cursor: pointer;
2063
2143
 
2064
2144
  &:not(.secondary):hover {
2065
- filter: ${props.colorTheme === "dark" ? "brightness(1.2)" : "brightness(0.9)"};
2145
+ filter: ${props.hoverStyle.filter ?? filterHover().z1};
2066
2146
  }
2067
2147
 
2068
2148
  &.secondary:hover {
2069
2149
  ${props.withNoBorder ? import_styled_components6.css`
2070
- filter: ${props.colorTheme === "dark" ? "brightness(1.2)" : "brightness(0.9)"};
2150
+ filter: ${props.hoverStyle.filter ?? filterHover().z1};
2071
2151
  ` : import_styled_components6.css`
2072
2152
  border-color: ${props.theme.colors.primary};
2073
2153
  `}
@@ -2135,7 +2215,7 @@ var ButtonComponent = function Button(buttonProps) {
2135
2215
  const iconComponent = icon ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2136
2216
  Div_default.row,
2137
2217
  {
2138
- height: iconSize ?? parseInt(style.fontSize?.toString() ?? "16"),
2218
+ height: iconSize ?? parseInt(style.fontSize?.toString() ?? theme2.styles.fontSize.toString()),
2139
2219
  alignItems: "center",
2140
2220
  justifyContent: "center",
2141
2221
  children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
@@ -2143,7 +2223,7 @@ var ButtonComponent = function Button(buttonProps) {
2143
2223
  {
2144
2224
  name: icon,
2145
2225
  color: iconColor ?? props.color ?? theme2.colors.base,
2146
- size: iconSize ?? parseInt(style.fontSize?.toString() ?? "16")
2226
+ size: iconSize ?? parseInt(style.fontSize?.toString() ?? theme2.styles.fontSize.toString())
2147
2227
  }
2148
2228
  )
2149
2229
  }
@@ -2153,7 +2233,7 @@ var ButtonComponent = function Button(buttonProps) {
2153
2233
  {
2154
2234
  name: image,
2155
2235
  color: iconColor ?? props.color ?? theme2.colors.base,
2156
- width: imageWidth ?? parseInt(style.fontSize?.toString() ?? "16"),
2236
+ width: imageWidth ?? parseInt(style.fontSize?.toString() ?? theme2.styles.fontSize.toString()),
2157
2237
  height: imageHeight
2158
2238
  }
2159
2239
  ) : void 0;
@@ -2938,7 +3018,7 @@ function Alert2({ alert }) {
2938
3018
  ),
2939
3019
  /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Div_default.column, { flex: 1, gap: theme2.styles.gap / 2, children: [
2940
3020
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Text_default, { fontSize: 18, fontWeight: 700, children: alertTitle }),
2941
- alert.message && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Text_default, { color: theme2.colors.textSecondary, children: alert.message })
3021
+ alert.message && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Text_default, { fontSize: theme2.styles.fontSize, color: theme2.colors.textSecondary, children: alert.message })
2942
3022
  ] }),
2943
3023
  pluginConfig.withCloseButton && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button_default.icon, { icon: "XMark", alignSelf: "flex-start", onClick: onClickCloseAlert })
2944
3024
  ] }),
@@ -3201,77 +3281,6 @@ var BetterHtmlProvider_default = (0, import_react14.memo)(BetterHtmlProvider);
3201
3281
 
3202
3282
  // src/utils/functions.ts
3203
3283
  var import_crypto_js = __toESM(require("crypto-js"));
3204
-
3205
- // src/utils/variableFunctions.ts
3206
- var checkBetterCoreContextValue = (value, functionsName) => {
3207
- if (value === void 0) {
3208
- throw new Error(
3209
- `\`${functionsName}()\` must be used within a \`<BetterCoreProvider>\`. Make sure to add one at the root of your component tree.`
3210
- );
3211
- }
3212
- return value !== void 0;
3213
- };
3214
- var checkBetterHtmlContextValue = (value, functionsName) => {
3215
- if (value === void 0) {
3216
- throw new Error(
3217
- `\`${functionsName}()\` must be used within a \`<BetterHtmlProvider>\`. Make sure to add one at the root of your component tree.`
3218
- );
3219
- }
3220
- return value !== void 0;
3221
- };
3222
- var alertControls = {
3223
- createAlert: (alert) => {
3224
- if (!checkBetterHtmlContextValue(externalBetterHtmlContextValue, "alertControls.createAlert"))
3225
- return void 0;
3226
- const readyAlert = {
3227
- id: crypto.randomUUID(),
3228
- ...alert
3229
- };
3230
- externalBetterHtmlContextValue.setAlerts((oldValue) => [...oldValue, readyAlert]);
3231
- return readyAlert;
3232
- },
3233
- removeAlert: (alertId) => {
3234
- if (!checkBetterHtmlContextValue(externalBetterHtmlContextValue, "alertControls.removeAlert")) return;
3235
- externalBetterHtmlContextValue.setAlerts((oldValue) => oldValue.filter((alert) => alert.id !== alertId));
3236
- }
3237
- };
3238
- var sideMenuControls = {
3239
- expand: () => {
3240
- if (!checkBetterHtmlContextValue(externalBetterHtmlContextValue, "sideMenuControls.expand")) return;
3241
- externalBetterHtmlContextValue.setSideMenuIsCollapsed.setFalse();
3242
- },
3243
- collapse: () => {
3244
- if (!checkBetterHtmlContextValue(externalBetterHtmlContextValue, "sideMenuControls.collapse")) return;
3245
- externalBetterHtmlContextValue.setSideMenuIsCollapsed.setTrue();
3246
- },
3247
- toggleExpanded: () => {
3248
- if (!checkBetterHtmlContextValue(externalBetterHtmlContextValue, "sideMenuControls.toggleExpanded")) return;
3249
- externalBetterHtmlContextValue.setSideMenuIsCollapsed.toggle();
3250
- },
3251
- open: () => {
3252
- if (!checkBetterHtmlContextValue(externalBetterHtmlContextValue, "sideMenuControls.open")) return;
3253
- externalBetterHtmlContextValue.setSideMenuIsOpenMobile.setTrue();
3254
- },
3255
- close: () => {
3256
- if (!checkBetterHtmlContextValue(externalBetterHtmlContextValue, "sideMenuControls.close")) return;
3257
- externalBetterHtmlContextValue.setSideMenuIsOpenMobile.setFalse();
3258
- },
3259
- toggleOpened: () => {
3260
- if (!checkBetterHtmlContextValue(externalBetterHtmlContextValue, "sideMenuControls.toggleOpened")) return;
3261
- externalBetterHtmlContextValue.setSideMenuIsOpenMobile.toggle();
3262
- }
3263
- };
3264
- var filterHover = () => {
3265
- if (!checkBetterCoreContextValue(externalBetterCoreContextValue, "filterHover")) return void 0;
3266
- return {
3267
- z05: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(1.2)" : "brightness(0.95)",
3268
- z1: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(1.3)" : "brightness(0.9)",
3269
- z2: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(1.6)" : "brightness(0.8)",
3270
- z3: externalBetterCoreContextValue.colorTheme === "dark" ? "brightness(1.9)" : "brightness(0.7)"
3271
- };
3272
- };
3273
-
3274
- // src/utils/functions.ts
3275
3284
  var getBrowser = () => {
3276
3285
  const userAgent = navigator.userAgent.toLowerCase();
3277
3286
  if (userAgent.includes("firefox")) return "firefox";
@@ -4312,8 +4321,8 @@ var InputElement = import_styled_components11.default.input.withConfig({
4312
4321
  position: relative;
4313
4322
  width: 100%;
4314
4323
  font-family: ${(props) => props.theme.styles.fontFamily};
4315
- font-size: 16px;
4316
- line-height: 20px;
4324
+ font-size: ${(props) => props.theme.styles.fontSize}px;
4325
+ line-height: ${(props) => props.theme.styles.fontSize + 4}px;
4317
4326
  color: ${(props) => props.theme.colors.textPrimary};
4318
4327
  background: ${(props) => props.theme.colors.backgroundContent};
4319
4328
  border: ${(props) => props.theme.styles.borderWidth}px solid ${(props) => props.theme.colors.border};
@@ -4334,7 +4343,7 @@ var InputElement = import_styled_components11.default.input.withConfig({
4334
4343
 
4335
4344
  &:focus {
4336
4345
  ${(props) => props.withNoBorder ? import_styled_components11.css`
4337
- filter: ${props.colorTheme === "dark" ? "brightness(1.2)" : "brightness(0.9)"};
4346
+ filter: ${props.hoverStyle.filter ?? filterHover().z1};
4338
4347
  ` : import_styled_components11.css`
4339
4348
  border-color: ${props.theme.colors.primary};
4340
4349
  `}
@@ -4439,8 +4448,8 @@ var TextareaElement = import_styled_components11.default.textarea.withConfig({
4439
4448
  min-height: 3lh;
4440
4449
  max-height: 8lh;
4441
4450
  font-family: ${(props) => props.theme.styles.fontFamily};
4442
- font-size: 16px;
4443
- line-height: 20px;
4451
+ font-size: ${(props) => props.theme.styles.fontSize}px;
4452
+ line-height: ${(props) => props.theme.styles.fontSize + 4}px;
4444
4453
  color: ${(props) => props.theme.colors.textPrimary};
4445
4454
  background: ${(props) => props.theme.colors.backgroundContent};
4446
4455
  border: ${(props) => props.theme.styles.borderWidth}px solid ${(props) => props.theme.colors.border};
@@ -4457,7 +4466,7 @@ var TextareaElement = import_styled_components11.default.textarea.withConfig({
4457
4466
  }
4458
4467
 
4459
4468
  ${(props) => props.withNoBorder ? import_styled_components11.css`
4460
- filter: ${props.colorTheme === "dark" ? "brightness(1.2)" : "brightness(0.9)"};
4469
+ filter: ${props.hoverStyle.filter ?? filterHover().z1};
4461
4470
  ` : import_styled_components11.css`
4462
4471
  border-color: ${props.theme.colors.primary};
4463
4472
  `}
@@ -5522,7 +5531,7 @@ var InputElement2 = import_styled_components12.default.input.withConfig({
5522
5531
 
5523
5532
  &:hover {
5524
5533
  ${(props) => props.withNoBorder ? import_styled_components12.css`
5525
- filter: ${props.colorTheme === "dark" ? "brightness(1.2)" : "brightness(0.9)"};
5534
+ filter: ${props.hoverStyle.filter ?? filterHover().z1};
5526
5535
  ` : import_styled_components12.css`
5527
5536
  border-color: ${props.theme.colors.primary};
5528
5537
  `}
@@ -5599,7 +5608,7 @@ var ToggleInputComponent = (0, import_react22.forwardRef)(function ToggleInput({
5599
5608
  textAdvanced,
5600
5609
  errorText,
5601
5610
  infoText,
5602
- size,
5611
+ size = componentSize,
5603
5612
  value,
5604
5613
  onChange,
5605
5614
  checked: controlledChecked,
@@ -5673,7 +5682,7 @@ var ToggleInputComponent = (0, import_react22.forwardRef)(function ToggleInput({
5673
5682
  top: "50%",
5674
5683
  left: "50%",
5675
5684
  color: theme2.colors.base,
5676
- size: 14,
5685
+ size: size / 1.8,
5677
5686
  transform: `translate(-50%, -50%)${checked ? "" : " scale(0.4)"}`,
5678
5687
  opacity: checked ? 1 : 0,
5679
5688
  pointerEvents: "none",
@@ -5683,8 +5692,8 @@ var ToggleInputComponent = (0, import_react22.forwardRef)(function ToggleInput({
5683
5692
  Div_default,
5684
5693
  {
5685
5694
  position: "absolute",
5686
- width: 10,
5687
- height: 10,
5695
+ width: size / 2,
5696
+ height: size / 2,
5688
5697
  top: "50%",
5689
5698
  left: "50%",
5690
5699
  backgroundColor: theme2.colors.base,
@@ -5708,7 +5717,7 @@ var ToggleInputComponent = (0, import_react22.forwardRef)(function ToggleInput({
5708
5717
  onClick: onClickText,
5709
5718
  children: [
5710
5719
  text,
5711
- required && !label && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Text_default, { as: "span", fontSize: 16, color: theme2.colors.error, children: [
5720
+ required && !label && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Text_default, { as: "span", fontSize: theme2.styles.fontSize, color: theme2.colors.error, children: [
5712
5721
  " ",
5713
5722
  "*"
5714
5723
  ] })
@@ -5716,7 +5725,7 @@ var ToggleInputComponent = (0, import_react22.forwardRef)(function ToggleInput({
5716
5725
  }
5717
5726
  ) : textAdvanced ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Div_default.row, { userSelect: "none", cursor: "pointer", onClick: onClickText, children: [
5718
5727
  textAdvanced,
5719
- required && !label && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Text_default, { as: "span", fontSize: 16, color: theme2.colors.error, marginLeft: 4, children: [
5728
+ required && !label && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Text_default, { as: "span", fontSize: theme2.styles.fontSize, color: theme2.colors.error, marginLeft: 4, children: [
5720
5729
  " ",
5721
5730
  "*"
5722
5731
  ] })
@@ -5977,12 +5986,12 @@ FormRowComponent.withTitle = (0, import_react24.forwardRef)(function WithTitle({
5977
5986
  /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Div_default.column, { flex: 1, gap: theme2.styles.gap / 2, children: [
5978
5987
  /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Text_default, { as: titleAs, fontSize: titleFontSize, children: [
5979
5988
  title,
5980
- required && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Text_default, { as: "span", fontSize: 16, color: theme2.colors.error, children: [
5989
+ required && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Text_default, { as: "span", fontSize: theme2.styles.fontSize, color: theme2.colors.error, children: [
5981
5990
  " ",
5982
5991
  "*"
5983
5992
  ] })
5984
5993
  ] }),
5985
- description && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text_default, { fontSize: descriptionFontSize, color: theme2.colors.textSecondary, children: description })
5994
+ description && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text_default, { fontSize: descriptionFontSize ?? theme2.styles.fontSize, color: theme2.colors.textSecondary, children: description })
5986
5995
  ] }),
5987
5996
  isLoading && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Div_default, { width: 26 - titleGap })
5988
5997
  ] }),
@@ -8185,10 +8194,14 @@ SideMenuComponent.pageHolder = function SideMenuPageHolder({ outsideComponent, .
8185
8194
  }
8186
8195
  );
8187
8196
  };
8188
- SideMenuComponent.burgerButton = function BurgerButton() {
8197
+ SideMenuComponent.burgerButton = function BurgerButton({ position = "left", onClick }) {
8189
8198
  const theme2 = (0, import_react_better_core29.useTheme)();
8190
8199
  const { sideMenuIsOpenMobile, setSideMenuIsOpenMobile } = useBetterHtmlContextInternal();
8191
8200
  const [isHovered, setIsHovered] = (0, import_react_better_core29.useBooleanState)();
8201
+ const onClickElement = (0, import_react31.useCallback)(() => {
8202
+ setSideMenuIsOpenMobile.toggle();
8203
+ onClick?.(!sideMenuIsOpenMobile);
8204
+ }, [onClick, sideMenuIsOpenMobile]);
8192
8205
  const width = 2;
8193
8206
  return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
8194
8207
  Div_default,
@@ -8200,7 +8213,7 @@ SideMenuComponent.burgerButton = function BurgerButton() {
8200
8213
  onMouseOver: setIsHovered.setTrue,
8201
8214
  onMouseLeave: setIsHovered.setFalse,
8202
8215
  onMouseOut: setIsHovered.setFalse,
8203
- onClick: setSideMenuIsOpenMobile.toggle,
8216
+ onClick: onClickElement,
8204
8217
  children: [
8205
8218
  /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
8206
8219
  Div_default,
@@ -8209,10 +8222,11 @@ SideMenuComponent.burgerButton = function BurgerButton() {
8209
8222
  width: isHovered || sideMenuIsOpenMobile ? "100%" : "50%",
8210
8223
  height: width,
8211
8224
  top: sideMenuIsOpenMobile ? `calc(50% - ${width / 2}px)` : 0,
8212
- left: 0,
8225
+ left: position === "left" ? 0 : position === "center" ? sideMenuIsOpenMobile ? 0 : "50%" : "auto",
8226
+ right: position === "right" ? 0 : void 0,
8213
8227
  backgroundColor: theme2.colors.border,
8214
8228
  borderRadius: 999,
8215
- transform: sideMenuIsOpenMobile ? "rotate(45deg)" : void 0,
8229
+ transform: sideMenuIsOpenMobile ? "rotate(45deg)" : position === "center" ? "translateX(-50%)" : void 0,
8216
8230
  transition: theme2.styles.transition
8217
8231
  }
8218
8232
  ),
@@ -8223,10 +8237,11 @@ SideMenuComponent.burgerButton = function BurgerButton() {
8223
8237
  width: isHovered ? "100%" : "100%",
8224
8238
  height: width,
8225
8239
  top: "50%",
8226
- left: 0,
8240
+ left: position === "left" ? 0 : position === "center" ? "50%" : "auto",
8241
+ right: position === "right" ? 0 : void 0,
8227
8242
  backgroundColor: theme2.colors.border,
8228
8243
  borderRadius: 999,
8229
- transform: "translateY(-50%)",
8244
+ transform: `translateY(-50%)${position === "center" ? " translateX(-50%)" : ""}`,
8230
8245
  opacity: sideMenuIsOpenMobile ? 0 : void 0,
8231
8246
  transition: theme2.styles.transition
8232
8247
  }
@@ -8238,10 +8253,11 @@ SideMenuComponent.burgerButton = function BurgerButton() {
8238
8253
  width: isHovered || sideMenuIsOpenMobile ? "100%" : "75%",
8239
8254
  height: width,
8240
8255
  bottom: sideMenuIsOpenMobile ? `calc(50% - ${width / 2}px)` : 0,
8241
- left: 0,
8256
+ left: position === "left" ? 0 : position === "center" ? sideMenuIsOpenMobile ? 0 : "50%" : "auto",
8257
+ right: position === "right" ? 0 : void 0,
8242
8258
  backgroundColor: theme2.colors.border,
8243
8259
  borderRadius: 999,
8244
- transform: sideMenuIsOpenMobile ? "rotate(-45deg)" : void 0,
8260
+ transform: sideMenuIsOpenMobile ? "rotate(-45deg)" : position === "center" ? "translateX(-50%)" : void 0,
8245
8261
  transition: theme2.styles.transition
8246
8262
  }
8247
8263
  )