@harpercollins/harpercollins-design-system 1.8.55 → 1.8.57

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.
@@ -7,6 +7,7 @@ export interface IconProps {
7
7
  size?: IconSizes;
8
8
  colour?: IconColours;
9
9
  spin?: boolean;
10
+ className?: string;
10
11
  }
11
- declare function Icon({ name, size, colour, spin }: IconProps): React.ReactElement;
12
+ declare function Icon({ name, size, colour, spin, className, }: IconProps): React.ReactElement;
12
13
  export default Icon;
@@ -1,5 +1,6 @@
1
1
  import { ColumnDef } from "@tanstack/react-table";
2
2
  interface TableProps {
3
+ id: string;
3
4
  data: unknown[];
4
5
  columns: ColumnDef<unknown, unknown>[];
5
6
  pageCount?: number;
@@ -10,5 +11,5 @@ interface TableProps {
10
11
  pageable?: boolean;
11
12
  pageSize?: number;
12
13
  }
13
- declare function Table({ data: tableData, columns, pageCount, totalCount, next, previous, page, pageable, pageSize, }: TableProps): import("react/jsx-runtime").JSX.Element;
14
+ declare function Table({ id, data: tableData, columns, pageCount, totalCount, next, previous, page, pageable, pageSize, }: TableProps): import("react/jsx-runtime").JSX.Element;
14
15
  export default Table;
@@ -1 +1,3 @@
1
1
  export { useToggle } from "./useToggle";
2
+ export { useLocalStorage } from "./useLocalStorage";
3
+ export { useFetch } from "./useFetch";
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Custom hook to fetch data from an API.
3
+ */
4
+ export declare const useFetch: <T = unknown>(url: string, options?: RequestInit) => {
5
+ data: T | null;
6
+ loading: boolean;
7
+ error: Error | null;
8
+ };
9
+ export default useFetch;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * A hook to store a value in local storage.
3
+ * @param key The key to store the value under in local storage.
4
+ * @param initialValue The initial value to store in local storage.
5
+ * @returns An array with the current value and a function to set the value.
6
+ * @example
7
+ * const [value, setValue] = useLocalStorage("myValue", "initialValue");
8
+ */
9
+ export declare function useLocalStorage<V>(key: string, initialValue: V): [V, (newValue: V) => void];
@@ -1,3 +1,8 @@
1
+ /**
2
+ * A hook to toggle a boolean value.
3
+ * @param initialState The initial state of the toggle.
4
+ * @returns An object with the current value and functions to toggle, set to true, and set to false.
5
+ */
1
6
  export declare function useToggle(initialState: boolean | (() => boolean)): {
2
7
  value: boolean;
3
8
  toggle: () => void;