react-better-html 1.1.83 → 1.1.85

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
@@ -15,6 +15,7 @@ type ComponentHoverStyle = {
15
15
  [CSSProperty in keyof ComponentStyle as `${CSSProperty & string}Hover`]: ComponentStyle[CSSProperty];
16
16
  };
17
17
  type ComponentMarginProps = Pick<ComponentStyle, "margin" | "marginTop" | "marginBottom" | "marginLeft" | "marginRight" | "marginBlock" | "marginInline">;
18
+ type ComponentPaddingProps = Pick<ComponentStyle, "padding" | "paddingTop" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingBlock" | "paddingInline">;
18
19
  type ComponentPropWithRef<ComponentRef, ComponentProps> = ComponentProps & {
19
20
  ref?: React.Ref<ComponentRef>;
20
21
  };
@@ -46,9 +47,11 @@ type DivProps<Value> = {
46
47
  type DivComponentType = {
47
48
  <Value>(props: ComponentPropWithRef<HTMLDivElement, DivProps<Value>>): React.ReactElement;
48
49
  row: <Value>(props: ComponentPropWithRef<HTMLDivElement, OmitProps<DivProps<Value>, "display" | "flexDirection"> & {
50
+ reverse?: boolean;
49
51
  invertFlexDirection?: boolean;
50
52
  }>) => React.ReactElement;
51
53
  column: <Value>(props: ComponentPropWithRef<HTMLDivElement, OmitProps<DivProps<Value>, "display" | "flexDirection"> & {
54
+ reverse?: boolean;
52
55
  invertFlexDirection?: boolean;
53
56
  }>) => React.ReactElement;
54
57
  grid: <Value>(props: ComponentPropWithRef<HTMLDivElement, OmitProps<DivProps<Value>, "display">>) => React.ReactElement;
@@ -302,8 +305,8 @@ type PageHolderProps = {
302
305
  /** @default false */
303
306
  noMaxContentWidth?: boolean;
304
307
  children?: React.ReactNode;
305
- };
306
- declare function PageHolder({ noMaxContentWidth, children }: PageHolderProps): react_jsx_runtime.JSX.Element;
308
+ } & ComponentPaddingProps;
309
+ declare function PageHolder({ noMaxContentWidth, children, ...props }: PageHolderProps): react_jsx_runtime.JSX.Element;
307
310
  declare const _default$5: React$1.MemoExoticComponent<typeof PageHolder>;
308
311
 
309
312
  type PageHeaderProps = {
@@ -643,7 +646,7 @@ type TabsProps = {
643
646
  } & ComponentMarginProps;
644
647
  type TabsRef = {
645
648
  selectedTab: string;
646
- setSelectedTab: (tab: string) => void;
649
+ selectTab: (tab: string) => void;
647
650
  };
648
651
  type TabsComponent = {
649
652
  (props: ComponentPropWithRef<TabsRef, TabsProps>): React.ReactElement;
@@ -751,4 +754,4 @@ declare const isMobileDevice: boolean;
751
754
 
752
755
  declare const reactRouterDomPlugin: BetterHtmlPlugin;
753
756
 
754
- export { type AppConfig, type AssetName, type AssetsConfig, type BetterHtmlConfig, type BetterHtmlPlugin, _default as BetterHtmlProvider, type BetterHtmlProviderValue, type BrowserName, Button, type ButtonProps, Chip, type ChipProps, type Color, type ColorName, type ColorTheme, ColorThemeSwitch, type ColorThemeSwitchProps, type Colors, type DeepPartialRecord, Div, type DivProps, _default$6 as Divider, Dropdown, type DropdownOption, type DropdownProps, type ExcludeOptions, Foldable, type FoldableProps, type FoldableRef, _default$2 as Form, type FormProps, FormRow, type FormRowProps, type HorizontalDividerProps, _default$8 as Icon, type IconName, type IconProps, type IconsConfig, _default$7 as Image, type ImageProps, InputField, type InputFieldProps, _default$1 as Label, type LabelProps, Loader, type LoaderConfig, type LoaderName, type LoaderProps, Modal, type ModalProps, type ModalRef, type OmitProps, _default$4 as PageHeader, type PageHeaderProps, _default$5 as PageHolder, type PageHolderProps, type PartialRecord, type PickAllRequired, type PickValue, type PluginName, type Styles, type TabGroup, Table, type TableColumn, type TableProps, Tabs, type TabsProps, Text, type TextAs, type TextProps, type TextareaFieldProps, type Theme, type ThemeConfig, _default$3 as ToggleInput, type ToggleInputProps, type ToggleInputRef, type VerticalDividerProps, formatPhoneNumber, generateRandomString, getBrowser, getFormErrorObject, isMobileDevice, loaderControls, reactRouterDomPlugin, useBetterHtmlContext, useBooleanState, useDebounceState, useForm, useLoader, useLoaderControls, useMediaQuery, usePageResize, usePageScroll, useTheme, useUrlQuery };
757
+ export { type AppConfig, type AssetName, type AssetsConfig, type BetterHtmlConfig, type BetterHtmlPlugin, _default as BetterHtmlProvider, type BetterHtmlProviderValue, type BrowserName, Button, type ButtonProps, Chip, type ChipProps, type Color, type ColorName, type ColorTheme, ColorThemeSwitch, type ColorThemeSwitchProps, type Colors, type DeepPartialRecord, Div, type DivProps, _default$6 as Divider, Dropdown, type DropdownOption, type DropdownProps, type ExcludeOptions, Foldable, type FoldableProps, type FoldableRef, _default$2 as Form, type FormProps, FormRow, type FormRowProps, type HorizontalDividerProps, _default$8 as Icon, type IconName, type IconProps, type IconsConfig, _default$7 as Image, type ImageProps, InputField, type InputFieldProps, _default$1 as Label, type LabelProps, Loader, type LoaderConfig, type LoaderName, type LoaderProps, Modal, type ModalProps, type ModalRef, type OmitProps, _default$4 as PageHeader, type PageHeaderProps, _default$5 as PageHolder, type PageHolderProps, type PartialRecord, type PickAllRequired, type PickValue, type PluginName, type Styles, type TabGroup, Table, type TableColumn, type TableProps, Tabs, type TabsProps, type TabsRef, Text, type TextAs, type TextProps, type TextareaFieldProps, type Theme, type ThemeConfig, _default$3 as ToggleInput, type ToggleInputProps, type ToggleInputRef, type VerticalDividerProps, formatPhoneNumber, generateRandomString, getBrowser, getFormErrorObject, isMobileDevice, loaderControls, reactRouterDomPlugin, useBetterHtmlContext, useBooleanState, useDebounceState, useForm, useLoader, useLoaderControls, useMediaQuery, usePageResize, usePageScroll, useTheme, useUrlQuery };
package/dist/index.d.ts CHANGED
@@ -15,6 +15,7 @@ type ComponentHoverStyle = {
15
15
  [CSSProperty in keyof ComponentStyle as `${CSSProperty & string}Hover`]: ComponentStyle[CSSProperty];
16
16
  };
17
17
  type ComponentMarginProps = Pick<ComponentStyle, "margin" | "marginTop" | "marginBottom" | "marginLeft" | "marginRight" | "marginBlock" | "marginInline">;
18
+ type ComponentPaddingProps = Pick<ComponentStyle, "padding" | "paddingTop" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingBlock" | "paddingInline">;
18
19
  type ComponentPropWithRef<ComponentRef, ComponentProps> = ComponentProps & {
19
20
  ref?: React.Ref<ComponentRef>;
20
21
  };
@@ -46,9 +47,11 @@ type DivProps<Value> = {
46
47
  type DivComponentType = {
47
48
  <Value>(props: ComponentPropWithRef<HTMLDivElement, DivProps<Value>>): React.ReactElement;
48
49
  row: <Value>(props: ComponentPropWithRef<HTMLDivElement, OmitProps<DivProps<Value>, "display" | "flexDirection"> & {
50
+ reverse?: boolean;
49
51
  invertFlexDirection?: boolean;
50
52
  }>) => React.ReactElement;
51
53
  column: <Value>(props: ComponentPropWithRef<HTMLDivElement, OmitProps<DivProps<Value>, "display" | "flexDirection"> & {
54
+ reverse?: boolean;
52
55
  invertFlexDirection?: boolean;
53
56
  }>) => React.ReactElement;
54
57
  grid: <Value>(props: ComponentPropWithRef<HTMLDivElement, OmitProps<DivProps<Value>, "display">>) => React.ReactElement;
@@ -302,8 +305,8 @@ type PageHolderProps = {
302
305
  /** @default false */
303
306
  noMaxContentWidth?: boolean;
304
307
  children?: React.ReactNode;
305
- };
306
- declare function PageHolder({ noMaxContentWidth, children }: PageHolderProps): react_jsx_runtime.JSX.Element;
308
+ } & ComponentPaddingProps;
309
+ declare function PageHolder({ noMaxContentWidth, children, ...props }: PageHolderProps): react_jsx_runtime.JSX.Element;
307
310
  declare const _default$5: React$1.MemoExoticComponent<typeof PageHolder>;
308
311
 
309
312
  type PageHeaderProps = {
@@ -643,7 +646,7 @@ type TabsProps = {
643
646
  } & ComponentMarginProps;
644
647
  type TabsRef = {
645
648
  selectedTab: string;
646
- setSelectedTab: (tab: string) => void;
649
+ selectTab: (tab: string) => void;
647
650
  };
648
651
  type TabsComponent = {
649
652
  (props: ComponentPropWithRef<TabsRef, TabsProps>): React.ReactElement;
@@ -751,4 +754,4 @@ declare const isMobileDevice: boolean;
751
754
 
752
755
  declare const reactRouterDomPlugin: BetterHtmlPlugin;
753
756
 
754
- export { type AppConfig, type AssetName, type AssetsConfig, type BetterHtmlConfig, type BetterHtmlPlugin, _default as BetterHtmlProvider, type BetterHtmlProviderValue, type BrowserName, Button, type ButtonProps, Chip, type ChipProps, type Color, type ColorName, type ColorTheme, ColorThemeSwitch, type ColorThemeSwitchProps, type Colors, type DeepPartialRecord, Div, type DivProps, _default$6 as Divider, Dropdown, type DropdownOption, type DropdownProps, type ExcludeOptions, Foldable, type FoldableProps, type FoldableRef, _default$2 as Form, type FormProps, FormRow, type FormRowProps, type HorizontalDividerProps, _default$8 as Icon, type IconName, type IconProps, type IconsConfig, _default$7 as Image, type ImageProps, InputField, type InputFieldProps, _default$1 as Label, type LabelProps, Loader, type LoaderConfig, type LoaderName, type LoaderProps, Modal, type ModalProps, type ModalRef, type OmitProps, _default$4 as PageHeader, type PageHeaderProps, _default$5 as PageHolder, type PageHolderProps, type PartialRecord, type PickAllRequired, type PickValue, type PluginName, type Styles, type TabGroup, Table, type TableColumn, type TableProps, Tabs, type TabsProps, Text, type TextAs, type TextProps, type TextareaFieldProps, type Theme, type ThemeConfig, _default$3 as ToggleInput, type ToggleInputProps, type ToggleInputRef, type VerticalDividerProps, formatPhoneNumber, generateRandomString, getBrowser, getFormErrorObject, isMobileDevice, loaderControls, reactRouterDomPlugin, useBetterHtmlContext, useBooleanState, useDebounceState, useForm, useLoader, useLoaderControls, useMediaQuery, usePageResize, usePageScroll, useTheme, useUrlQuery };
757
+ export { type AppConfig, type AssetName, type AssetsConfig, type BetterHtmlConfig, type BetterHtmlPlugin, _default as BetterHtmlProvider, type BetterHtmlProviderValue, type BrowserName, Button, type ButtonProps, Chip, type ChipProps, type Color, type ColorName, type ColorTheme, ColorThemeSwitch, type ColorThemeSwitchProps, type Colors, type DeepPartialRecord, Div, type DivProps, _default$6 as Divider, Dropdown, type DropdownOption, type DropdownProps, type ExcludeOptions, Foldable, type FoldableProps, type FoldableRef, _default$2 as Form, type FormProps, FormRow, type FormRowProps, type HorizontalDividerProps, _default$8 as Icon, type IconName, type IconProps, type IconsConfig, _default$7 as Image, type ImageProps, InputField, type InputFieldProps, _default$1 as Label, type LabelProps, Loader, type LoaderConfig, type LoaderName, type LoaderProps, Modal, type ModalProps, type ModalRef, type OmitProps, _default$4 as PageHeader, type PageHeaderProps, _default$5 as PageHolder, type PageHolderProps, type PartialRecord, type PickAllRequired, type PickValue, type PluginName, type Styles, type TabGroup, Table, type TableColumn, type TableProps, Tabs, type TabsProps, type TabsRef, Text, type TextAs, type TextProps, type TextareaFieldProps, type Theme, type ThemeConfig, _default$3 as ToggleInput, type ToggleInputProps, type ToggleInputRef, type VerticalDividerProps, formatPhoneNumber, generateRandomString, getBrowser, getFormErrorObject, isMobileDevice, loaderControls, reactRouterDomPlugin, useBetterHtmlContext, useBooleanState, useDebounceState, useForm, useLoader, useLoaderControls, useMediaQuery, usePageResize, usePageScroll, useTheme, useUrlQuery };
package/dist/index.js CHANGED
@@ -2269,11 +2269,29 @@ var DivComponent = (0, import_react3.forwardRef)(function Div({ value, as, isTab
2269
2269
  }
2270
2270
  );
2271
2271
  });
2272
- DivComponent.row = (0, import_react3.forwardRef)(function Row({ invertFlexDirection, ...props }, ref) {
2273
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(DivComponent, { display: "flex", flexDirection: invertFlexDirection ? "column" : "row", ref, ...props });
2272
+ DivComponent.row = (0, import_react3.forwardRef)(function Row({ reverse, invertFlexDirection, ...props }, ref) {
2273
+ const reverseSuffix = reverse ? "-reverse" : "";
2274
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
2275
+ DivComponent,
2276
+ {
2277
+ display: "flex",
2278
+ flexDirection: (invertFlexDirection ? "column" : "row") + reverseSuffix,
2279
+ ref,
2280
+ ...props
2281
+ }
2282
+ );
2274
2283
  });
2275
- DivComponent.column = (0, import_react3.forwardRef)(function Column({ invertFlexDirection, ...props }, ref) {
2276
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(DivComponent, { display: "flex", flexDirection: invertFlexDirection ? "row" : "column", ref, ...props });
2284
+ DivComponent.column = (0, import_react3.forwardRef)(function Column({ reverse, invertFlexDirection, ...props }, ref) {
2285
+ const reverseSuffix = reverse ? "-reverse" : "";
2286
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
2287
+ DivComponent,
2288
+ {
2289
+ display: "flex",
2290
+ flexDirection: (invertFlexDirection ? "column" : "row") + reverseSuffix,
2291
+ ref,
2292
+ ...props
2293
+ }
2294
+ );
2277
2295
  });
2278
2296
  DivComponent.grid = (0, import_react3.forwardRef)(function Grid(props, ref) {
2279
2297
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(DivComponent, { display: "grid", ref, ...props });
@@ -3066,7 +3084,7 @@ var Modal_default = Modal2;
3066
3084
  // src/components/PageHolder.tsx
3067
3085
  var import_react12 = require("react");
3068
3086
  var import_jsx_runtime10 = require("react/jsx-runtime");
3069
- function PageHolder({ noMaxContentWidth, children }) {
3087
+ function PageHolder({ noMaxContentWidth, children, ...props }) {
3070
3088
  const theme2 = useTheme();
3071
3089
  const { app } = useBetterHtmlContextInternal();
3072
3090
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
@@ -3077,6 +3095,7 @@ function PageHolder({ noMaxContentWidth, children }) {
3077
3095
  maxWidth: !noMaxContentWidth ? app.contentMaxWidth : void 0,
3078
3096
  margin: "0px auto",
3079
3097
  padding: theme2.styles.space,
3098
+ ...props,
3080
3099
  children
3081
3100
  }
3082
3101
  );
@@ -5245,6 +5264,7 @@ var InputElement = import_styled_components9.default.input.withConfig({
5245
5264
  &[type="time"] {
5246
5265
  // min-height: 46px;
5247
5266
  -webkit-appearance: none;
5267
+ -moz-appearance: textfield;
5248
5268
 
5249
5269
  &::-webkit-calendar-picker-indicator {
5250
5270
  display: none;
@@ -6678,12 +6698,19 @@ var TabsComponent = (0, import_react24.forwardRef)(function Tabs({ tabs, name, a
6678
6698
  block: "nearest"
6679
6699
  });
6680
6700
  }, [selectedTab]);
6701
+ (0, import_react24.useEffect)(() => {
6702
+ return () => {
6703
+ componentsState.tabs.setTabGroups(
6704
+ (oldValue) => oldValue.filter((item) => item.name !== (name ?? defaultTabName))
6705
+ );
6706
+ };
6707
+ }, []);
6681
6708
  (0, import_react24.useImperativeHandle)(
6682
6709
  ref,
6683
6710
  () => {
6684
6711
  return {
6685
6712
  selectedTab,
6686
- setSelectedTab: onClickTab
6713
+ selectTab: onClickTab
6687
6714
  };
6688
6715
  },
6689
6716
  [selectedTab, onClickTab]
@@ -6754,7 +6781,7 @@ var TabsComponent = (0, import_react24.forwardRef)(function Tabs({ tabs, name, a
6754
6781
  }
6755
6782
  )
6756
6783
  ] }),
6757
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Div_default, { width: "100%", children })
6784
+ children && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Div_default, { width: "100%", children })
6758
6785
  ] });
6759
6786
  });
6760
6787
  TabsComponent.content = function Content({ tab, tabWithDot, tabsGroupName, isInitialTab, children }) {