@jobber/components 6.103.3 → 6.103.4

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.
@@ -1,8 +1,9 @@
1
- import type { ReactNode } from "react";
1
+ import type { ReactElement, ReactNode } from "react";
2
+ import React from "react";
2
3
  /**
3
4
  * Returns the first React Child that receives `true` from isCorrectComponent
4
5
  * @param children React Children
5
- * @param isCorrectComponent a function that accepts a JSX Element and returns a boolean.
6
+ * @param isCorrectComponent a function that accepts a ReactElement and returns a boolean.
6
7
  * @returns The first child component that returns true on isCorrectComponent
7
8
  */
8
- export declare function useChildComponent(children: ReactNode | undefined, isCorrectComponent: (toCheck: JSX.Element) => boolean): JSX.Element | undefined;
9
+ export declare function useChildComponent(children: ReactNode | undefined, isCorrectComponent: (toCheck: ReactElement) => boolean): ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
@@ -1,8 +1,9 @@
1
+ import React from "react";
1
2
  import type { ComboboxProps } from "./Combobox.types";
2
3
  import { ComboboxAction } from "./components/ComboboxAction";
3
4
  import { ComboboxOption as ComboboxOptionComponent } from "./components/ComboboxOption/ComboboxOption";
4
5
  import { ComboboxActivator } from "./components/ComboboxActivator";
5
- export declare function Combobox(props: ComboboxProps): JSX.Element;
6
+ export declare function Combobox(props: ComboboxProps): React.JSX.Element;
6
7
  export declare namespace Combobox {
7
8
  var Activator: typeof ComboboxActivator;
8
9
  var Action: typeof ComboboxAction;
@@ -15,4 +15,4 @@ export interface ComboboxProviderProps {
15
15
  readonly onSelectAll?: (selection: ComboboxOption[]) => void;
16
16
  }
17
17
  export declare const ComboboxContext: React.Context<Omit<ComboboxProviderProps, "children">>;
18
- export declare function ComboboxContextProvider({ children, ...props }: ComboboxProviderProps): JSX.Element;
18
+ export declare function ComboboxContextProvider({ children, ...props }: ComboboxProviderProps): React.JSX.Element;
@@ -1,2 +1,3 @@
1
+ import React from "react";
1
2
  import type { ComboboxContentProps } from "../../Combobox.types";
2
- export declare function ComboboxContent(props: ComboboxContentProps): JSX.Element;
3
+ export declare function ComboboxContent(props: ComboboxContentProps): React.JSX.Element;
@@ -1,2 +1,3 @@
1
+ import React from "react";
1
2
  import type { ComboboxHeaderProps } from "../../../Combobox.types";
2
- export declare function ComboboxContentHeader(props: ComboboxHeaderProps): JSX.Element;
3
+ export declare function ComboboxContentHeader(props: ComboboxHeaderProps): React.JSX.Element;
@@ -1,2 +1,3 @@
1
+ import React from "react";
1
2
  import type { ComboboxListProps } from "../../../Combobox.types";
2
- export declare function ComboboxContentList(props: ComboboxListProps): JSX.Element;
3
+ export declare function ComboboxContentList(props: ComboboxListProps): React.JSX.Element;
@@ -1,2 +1,3 @@
1
+ import React from "react";
1
2
  import type { ComboboxSearchProps } from "../../../Combobox.types";
2
- export declare function ComboboxContentSearch(props: ComboboxSearchProps): JSX.Element;
3
+ export declare function ComboboxContentSearch(props: ComboboxSearchProps): React.JSX.Element;
@@ -1,4 +1,4 @@
1
- import type { ReactElement, ReactNode } from "react";
1
+ import { type ReactElement, type ReactNode } from "react";
2
2
  import type { IconNames } from "@jobber/design";
3
3
  import type { XOR } from "ts-xor";
4
4
  import { type Breakpoints } from "./DataList.const";
@@ -144,7 +144,7 @@ export interface DataListSelectedAllType<T extends DataListObject = DataListObje
144
144
  readonly unselected: T["id"][];
145
145
  }
146
146
  export type DataListSelectedType<T extends string | number = DataListObject["id"]> = T[] | DataListSelectedAllType;
147
- export type LayoutRenderer<T extends DataListObject> = (item: DataListItemType<T[]>) => JSX.Element;
147
+ export type LayoutRenderer<T extends DataListObject> = (item: DataListItemType<T[]>) => ReactElement;
148
148
  export interface DataListLayoutProps<T extends DataListObject> {
149
149
  readonly children: LayoutRenderer<T>;
150
150
  /**
@@ -1,7 +1,8 @@
1
+ import type { ReactElement } from "react";
1
2
  import React from "react";
2
3
  import type { DataListObject } from "@jobber/components/DataList/DataList.types";
3
4
  interface ListItemInternalProps<T extends DataListObject> {
4
- readonly children: JSX.Element;
5
+ readonly children: ReactElement;
5
6
  readonly item: T;
6
7
  }
7
8
  export declare function DataListItemInternal<T extends DataListObject>({ children, item, }: ListItemInternalProps<T>): React.JSX.Element;
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  export declare enum SortDirection {
2
3
  ascending = 0,
3
4
  descending = 1,
@@ -6,5 +7,5 @@ export declare enum SortDirection {
6
7
  interface SortIconProps {
7
8
  readonly direction: SortDirection;
8
9
  }
9
- export declare function SortIcon({ direction }: SortIconProps): JSX.Element;
10
+ export declare function SortIcon({ direction }: SortIconProps): React.JSX.Element;
10
11
  export {};
@@ -15,4 +15,4 @@ export interface DataTableSortableHeaderProps {
15
15
  */
16
16
  readonly onSort?: () => void;
17
17
  }
18
- export declare function DataTableSortableHeader(props: DataTableSortableHeaderProps & React.HTMLAttributes<HTMLTableCellElement>): JSX.Element;
18
+ export declare function DataTableSortableHeader(props: DataTableSortableHeaderProps & React.HTMLAttributes<HTMLTableCellElement>): React.JSX.Element;
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import type { StatusIndicatorType } from "../StatusIndicator/StatusIndicator.type";
2
3
  export interface StatusLabelType {
3
4
  readonly statusLabel: string;
@@ -21,5 +22,5 @@ interface StatusLabelProps {
21
22
  */
22
23
  readonly status: StatusIndicatorType;
23
24
  }
24
- export declare function StatusLabel({ label, alignment, status, }: StatusLabelProps): JSX.Element;
25
+ export declare function StatusLabel({ label, alignment, status, }: StatusLabelProps): React.JSX.Element;
25
26
  export {};
@@ -5,7 +5,7 @@ var React = require('react');
5
5
  /**
6
6
  * Returns the first React Child that receives `true` from isCorrectComponent
7
7
  * @param children React Children
8
- * @param isCorrectComponent a function that accepts a JSX Element and returns a boolean.
8
+ * @param isCorrectComponent a function that accepts a ReactElement and returns a boolean.
9
9
  * @returns The first child component that returns true on isCorrectComponent
10
10
  */
11
11
  function useChildComponent(children, isCorrectComponent) {
@@ -3,7 +3,7 @@ import React__default, { useMemo, isValidElement } from 'react';
3
3
  /**
4
4
  * Returns the first React Child that receives `true` from isCorrectComponent
5
5
  * @param children React Children
6
- * @param isCorrectComponent a function that accepts a JSX Element and returns a boolean.
6
+ * @param isCorrectComponent a function that accepts a ReactElement and returns a boolean.
7
7
  * @returns The first child component that returns true on isCorrectComponent
8
8
  */
9
9
  function useChildComponent(children, isCorrectComponent) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components",
3
- "version": "6.103.3",
3
+ "version": "6.103.4",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -538,5 +538,5 @@
538
538
  "> 1%",
539
539
  "IE 10"
540
540
  ],
541
- "gitHead": "06b9bc94eb94f53486ddc9c41a978731163a85b5"
541
+ "gitHead": "89fec0b77276ec2b2fc80f4fc4ec2f6d207c1ac6"
542
542
  }