reykit 1.0.28 → 1.0.29

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.
@@ -4,13 +4,16 @@ import { ReactNode, ComponentProps, MouseEvent } from 'react';
4
4
  *
5
5
  * Parameters
6
6
  * ----------
7
- * @param data Children dictionary.
7
+ * @param childrens Children array.
8
+ * @param handleCycle Handle cycle.
8
9
  *
9
10
  * Returns
10
11
  * -------
11
12
  * @returns React element.
12
13
  */
13
- export default function CycleButton({ data, onClick, ...props }: {
14
+ export declare function CycleButton({ childrens, handleCycle, onClick, ...props }: {
15
+ childrens: ReactNode[];
16
+ handleCycle: (index: number) => void;
14
17
  data: {
15
18
  children: ReactNode;
16
19
  handleClick: (event: MouseEvent<HTMLButtonElement>) => void;
@@ -0,0 +1,19 @@
1
+ import { ReactNode, ComponentProps } from 'react';
2
+ /**
3
+ * Toggle component of with icon.
4
+ *
5
+ * Parameters
6
+ * ----------
7
+ * @param childrens Children array.
8
+ * @param handleCycle Handle cycle.
9
+ *
10
+ * Returns
11
+ * -------
12
+ * @returns React element.
13
+ */
14
+ export declare function IconToggle({ openIcon, closeIcon, handleOpen, defaultOpen, onClick, ...props }: {
15
+ openIcon: ReactNode;
16
+ closeIcon: ReactNode;
17
+ handleOpen: (open: boolean) => void;
18
+ defaultOpen?: boolean;
19
+ } & ComponentProps<'button'>): import("react/jsx-runtime").JSX.Element;
package/dist/hook.d.ts CHANGED
@@ -1,3 +1,16 @@
1
+ /**
2
+ * Hook of toggle.
3
+ *
4
+ * Parameters
5
+ * ----------
6
+ * @param array Array.
7
+ * @param loop Whether to loop count.
8
+ *
9
+ * Returns
10
+ * -------
11
+ * @returns Returns a stateful open value, and a function to automatic count it.
12
+ */
13
+ export declare function useOpen(defaultOpen?: boolean): [boolean, () => void];
1
14
  /**
2
15
  * Hook of count number.
3
16
  *
package/dist/index.d.ts CHANGED
@@ -1,13 +1,17 @@
1
+ import { CycleButton } from './component/Button';
1
2
  import { default as Form } from './component/Form';
2
- import { default as CycleButton } from './component/CycleButton';
3
- import { useCount } from './hook';
3
+ import { IconToggle } from './component/Toggle';
4
+ import { useOpen, useCount, useIndex } from './hook';
4
5
  import { renderReact } from './react';
5
6
  import { default as Storager } from './storage';
6
7
  import { cn } from './tailwindcss';
7
8
  declare const _default: {
8
- Form: typeof Form;
9
9
  CycleButton: typeof CycleButton;
10
+ Form: typeof Form;
11
+ IconToggle: typeof IconToggle;
12
+ useOpen: typeof useOpen;
10
13
  useCount: typeof useCount;
14
+ useIndex: typeof useIndex;
11
15
  renderReact: typeof renderReact;
12
16
  Storager: typeof Storager;
13
17
  cn: typeof cn;