@bccampus/ui-components 0.2.0 → 0.4.0

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.
Files changed (56) hide show
  1. package/dist/banner.js +14 -14
  2. package/dist/button.d.ts +1 -1
  3. package/dist/button.js +17 -17
  4. package/dist/caption.js +7 -8
  5. package/dist/card.js +34 -34
  6. package/dist/composite.d.ts +151 -0
  7. package/dist/composite.js +472 -0
  8. package/dist/generate-tiles-DuagGD1d.js +244 -0
  9. package/dist/horizontal-list.js +32 -32
  10. package/dist/icon-generator.js +43 -270
  11. package/dist/igenerate-tiles.d.ts +43 -0
  12. package/dist/igenerate-tiles.js +7 -0
  13. package/dist/index-U7DVCmS_.js +76 -0
  14. package/dist/input.js +4 -4
  15. package/dist/masked-image-generator.js +18 -18
  16. package/dist/navigation-menu.d.ts +27 -0
  17. package/dist/navigation-menu.js +1139 -0
  18. package/dist/overlay.js +2 -2
  19. package/dist/page-header.d.ts +5 -1
  20. package/dist/page-header.js +10 -9
  21. package/dist/page-section.js +14 -14
  22. package/dist/page.js +4 -4
  23. package/dist/search-input.js +11 -11
  24. package/dist/tag.js +8 -9
  25. package/dist/ui-components.d.ts +30 -2
  26. package/dist/ui-components.js +47 -37
  27. package/package.json +17 -1
  28. package/src/components/ui/banner.tsx +2 -2
  29. package/src/components/ui/button.tsx +8 -7
  30. package/src/components/ui/card.tsx +5 -5
  31. package/src/components/ui/composite/CompositeData.ts +215 -0
  32. package/src/components/ui/composite/CompositeDataItem.ts +144 -0
  33. package/src/components/ui/composite/composite-component-item.tsx +50 -0
  34. package/src/components/ui/composite/composite-component.tsx +100 -0
  35. package/src/components/ui/composite/composite-data-context.tsx +31 -0
  36. package/src/components/ui/composite/index.ts +4 -0
  37. package/src/components/ui/composite/types.ts +81 -0
  38. package/src/components/ui/horizontal-list.tsx +2 -2
  39. package/src/components/ui/index.ts +1 -0
  40. package/src/components/ui/navigation-menu.tsx +165 -0
  41. package/src/components/ui/page-header.tsx +13 -5
  42. package/src/components/ui/page-section.tsx +8 -8
  43. package/src/components/ui/page.tsx +3 -1
  44. package/src/components/ui/popover.tsx +46 -0
  45. package/src/hooks/use-effect-after-mount.ts +27 -0
  46. package/src/hooks/use-id.ts +5 -0
  47. package/src/hooks/use-keyboard-event.ts +144 -0
  48. package/src/lib/object.ts +48 -0
  49. package/src/lib/set-operations.ts +52 -0
  50. package/src/styles/theme.css +7 -7
  51. package/src/styles/typography.css +334 -341
  52. package/tsconfig.node.json +25 -25
  53. package/vite.config.ts +7 -3
  54. package/vite.ladle.config.ts +17 -0
  55. package/dist/index-DlfV3JTY.js +0 -70
  56. package/dist/jsx-runtime-BzflLqGi.js +0 -282
package/dist/banner.js CHANGED
@@ -1,19 +1,19 @@
1
- import { j as t } from "./jsx-runtime-BzflLqGi.js";
2
- import { c as m } from "./index-CQhYMnjT.js";
3
- import { c as l } from "./utils-CRiPKpXj.js";
4
- import { useState as d } from "react";
5
- import { Button as f } from "./button.js";
6
- import { c as x } from "./createLucideIcon-CzehbSja.js";
1
+ import { jsxs as m, jsx as t } from "react/jsx-runtime";
2
+ import { c as l } from "./index-CQhYMnjT.js";
3
+ import { c as d } from "./utils-CRiPKpXj.js";
4
+ import { useState as f } from "react";
5
+ import { Button as p } from "./button.js";
6
+ import { c as u } from "./createLucideIcon-CzehbSja.js";
7
7
  /**
8
8
  * @license lucide-react v0.544.0 - ISC
9
9
  *
10
10
  * This source code is licensed under the ISC license.
11
11
  * See the LICENSE file in the root directory of this source tree.
12
12
  */
13
- const p = [
13
+ const x = [
14
14
  ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
15
15
  ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
16
- ], u = x("x", p), v = m("flex flex-row items-center justify-between px-section text-sm", {
16
+ ], b = u("x", x), v = l("flex flex-row items-center justify-between px-(--spacing-section) text-sm", {
17
17
  variants: {
18
18
  variant: {
19
19
  default: "bg-complement-3 text-white",
@@ -30,13 +30,13 @@ const p = [
30
30
  size: "default"
31
31
  }
32
32
  });
33
- function w({ className: e, size: s, variant: i, dismissible: a, children: n, ...r }) {
34
- const [o, c] = d(!1);
35
- return o ? null : /* @__PURE__ */ t.jsxs("div", { className: l(v({ variant: i, size: s }), e), ...r, children: [
36
- /* @__PURE__ */ t.jsx("div", { className: "flex-auto text-center", children: n }),
37
- a && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(f, { variant: "ghost", size: "icon", className: "size-6 text-white", onClick: () => c(!0), children: /* @__PURE__ */ t.jsx(u, {}) }) })
33
+ function N({ className: e, size: a, variant: s, dismissible: i, children: n, ...r }) {
34
+ const [o, c] = f(!1);
35
+ return o ? null : /* @__PURE__ */ m("div", { "data-slot": "banner", className: d(v({ variant: s, size: a }), e), ...r, children: [
36
+ /* @__PURE__ */ t("div", { className: "flex-auto text-center", children: n }),
37
+ i && /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(p, { variant: "ghost", size: "icon", className: "size-6 text-white", onClick: () => c(!0), children: /* @__PURE__ */ t(b, {}) }) })
38
38
  ] });
39
39
  }
40
40
  export {
41
- w as Banner
41
+ N as Banner
42
42
  };
package/dist/button.d.ts CHANGED
@@ -9,7 +9,7 @@ export declare type ButtonProps = React.ComponentProps<"button"> & VariantProps<
9
9
  };
10
10
 
11
11
  export declare const buttonVariants: (props?: ({
12
- variant?: "default" | "secondary" | "outline" | "ghost" | "destructive" | null | undefined;
12
+ variant?: "default" | "secondary" | "outline" | "ghost" | "item" | "destructive" | null | undefined;
13
13
  block?: boolean | null | undefined;
14
14
  size?: "text" | "default" | "sm" | "lg" | "icon" | null | undefined;
15
15
  } & ClassProp) | undefined) => string;
package/dist/button.js CHANGED
@@ -1,9 +1,9 @@
1
- import { j as s } from "./jsx-runtime-BzflLqGi.js";
2
- import { S as d } from "./index-DlfV3JTY.js";
3
- import { c } from "./index-CQhYMnjT.js";
4
- import { c as u } from "./utils-CRiPKpXj.js";
5
- const v = c(
6
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-sm text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring focus-visible:ring-2 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { S as s } from "./index-U7DVCmS_.js";
3
+ import { c as d } from "./index-CQhYMnjT.js";
4
+ import { c } from "./utils-CRiPKpXj.js";
5
+ const u = d(
6
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-sm text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 px-6 has-[>svg]:px-4 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring focus-visible:ring-2 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
7
7
  {
8
8
  variants: {
9
9
  variant: {
@@ -11,6 +11,7 @@ const v = c(
11
11
  secondary: "bg-secondary text-secondary-foreground hover:bg-background hover:text-primary dark:bg-complement-1-500 dark:text-foreground dark:hover:bg-complement-1-600",
12
12
  outline: "border border-primary bg-transparent hover:border-secondary hover:bg-secondary/10 dark:border-input dark:hover:bg-input/50",
13
13
  ghost: "text-primary hover:text-secondary dark:text-foreground dark:hover:bg-complement-1-800",
14
+ item: "justify-between px-2 has-[>svg]:px-2 text-primary hover:bg-complement-1-50 dark:text-foreground dark:hover:bg-complement-1-800",
14
15
  destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60"
15
16
  },
16
17
  block: {
@@ -18,25 +19,24 @@ const v = c(
18
19
  true: "w-full"
19
20
  },
20
21
  size: {
21
- default: "h-9 px-6 py-2 has-[>svg]:px-3",
22
- sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
23
- lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
22
+ default: "h-9",
23
+ sm: "h-8 gap-1.5",
24
+ lg: "h-10 text-base",
24
25
  icon: "size-9",
25
- text: "py-2"
26
+ text: "h-9 text-base"
26
27
  }
27
28
  },
28
29
  defaultVariants: {
29
- variant: "default",
30
30
  size: "default",
31
- block: !1
31
+ block: !1,
32
+ variant: "default"
32
33
  }
33
34
  }
34
35
  );
35
- function m({ className: e, variant: r, size: t, block: o, asChild: i = !1, ...a }) {
36
- const n = i ? d : "button";
37
- return /* @__PURE__ */ s.jsx(n, { "data-slot": "button", className: u(v({ variant: r, size: t, block: o }), e), ...a });
36
+ function p({ className: e, variant: r, size: t, block: o, asChild: a = !1, ...i }) {
37
+ return /* @__PURE__ */ n(a ? s : "button", { "data-slot": "button", className: c(u({ size: t, block: o, variant: r }), e), ...i });
38
38
  }
39
39
  export {
40
- m as Button,
41
- v as buttonVariants
40
+ p as Button,
41
+ u as buttonVariants
42
42
  };
package/dist/caption.js CHANGED
@@ -1,8 +1,8 @@
1
- import { j as s } from "./jsx-runtime-BzflLqGi.js";
2
- import { S as i } from "./index-DlfV3JTY.js";
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { S as i } from "./index-U7DVCmS_.js";
3
3
  import { c as e } from "./index-CQhYMnjT.js";
4
4
  import { c as m } from "./utils-CRiPKpXj.js";
5
- const l = e("tracking-tight text-balance", {
5
+ const s = e("tracking-tight text-balance", {
6
6
  variants: {
7
7
  variant: {
8
8
  default: "scroll-mr-5 text-lg/5 font-bold text-secondary dark:text-foreground",
@@ -13,16 +13,15 @@ const l = e("tracking-tight text-balance", {
13
13
  variant: "default"
14
14
  }
15
15
  });
16
- function d({
16
+ function x({
17
17
  className: t,
18
18
  variant: a,
19
19
  asChild: r = !1,
20
20
  ...o
21
21
  }) {
22
- const n = r ? i : "div";
23
- return /* @__PURE__ */ s.jsx(n, { className: m(l({ variant: a, className: t })), ...o });
22
+ return /* @__PURE__ */ n(r ? i : "div", { className: m(s({ variant: a, className: t })), ...o });
24
23
  }
25
24
  export {
26
- d as Caption,
27
- l as captionVariants
25
+ x as Caption,
26
+ s as captionVariants
28
27
  };
package/dist/card.js CHANGED
@@ -1,11 +1,11 @@
1
- import { j as e } from "./jsx-runtime-BzflLqGi.js";
1
+ import { jsx as e } from "react/jsx-runtime";
2
2
  import { c as t } from "./utils-CRiPKpXj.js";
3
3
  import { Caption as d } from "./caption.js";
4
- import { c as s } from "./index-CQhYMnjT.js";
5
- const u = s("group @container/card w-full max-w-full bg-card text-card-foreground grid gap-card", {
4
+ import { c as u } from "./index-CQhYMnjT.js";
5
+ const m = u("group @container/card w-full max-w-full bg-card text-card-foreground grid gap-(--gap-card)", {
6
6
  variants: {
7
7
  bordered: {
8
- true: "p-card border border-complement-1-100 dark:border-brand-1-900 ",
8
+ true: "p-(--spacing-card) border border-complement-1-100 dark:border-brand-1-900 ",
9
9
  false: ""
10
10
  },
11
11
  rounded: {
@@ -18,28 +18,28 @@ const u = s("group @container/card w-full max-w-full bg-card text-card-foregroun
18
18
  rounded: !1
19
19
  }
20
20
  });
21
- function j({ className: r, asLink: a, bordered: n, rounded: o, ...l }) {
22
- const i = a ? "a" : "div", c = a ? "transition-all hover:bg-complement-1-50 dark:hover:bg-gray-900" : "";
21
+ function C({ className: r, asLink: a, bordered: n, rounded: o, ...c }) {
22
+ const i = a ? "a" : "div", l = a ? "transition-all hover:bg-complement-1-50 dark:hover:bg-gray-900" : "";
23
23
  return (
24
24
  //@ts-expect-error: props type will be correct
25
- /* @__PURE__ */ e.jsx(i, { "data-slot": "card", className: t(u({ bordered: n, rounded: o }), c, r), ...l })
25
+ /* @__PURE__ */ e(i, { "data-slot": "card", className: t(m({ bordered: n, rounded: o }), l, r), ...c })
26
26
  );
27
27
  }
28
- function v({ name: r, className: a, ...n }) {
29
- return /* @__PURE__ */ e.jsx(
28
+ function b({ name: r, className: a, ...n }) {
29
+ return /* @__PURE__ */ e(
30
30
  "div",
31
31
  {
32
32
  style: { gridArea: r },
33
- className: t("relative flex flex-col gap-(--card-area-gap)", a),
33
+ className: t("@container/card-area relative flex flex-col gap-(--gap-card-area)", a),
34
34
  ...n
35
35
  }
36
36
  );
37
37
  }
38
- function C({ className: r, ...a }) {
39
- return /* @__PURE__ */ e.jsx("div", { className: t("flex flex-col gap-(--card-item-group-gap)", r), ...a });
38
+ function h({ className: r, ...a }) {
39
+ return /* @__PURE__ */ e("div", { className: t("flex flex-col gap-(--gap-card-item-group)", r), ...a });
40
40
  }
41
- function b({ size: r = "md", className: a, ...n }) {
42
- return /* @__PURE__ */ e.jsx(
41
+ function x({ size: r = "md", className: a, ...n }) {
42
+ return /* @__PURE__ */ e(
43
43
  "div",
44
44
  {
45
45
  className: t(
@@ -54,8 +54,8 @@ function b({ size: r = "md", className: a, ...n }) {
54
54
  }
55
55
  );
56
56
  }
57
- function h({ size: r = "md", className: a, ...n }) {
58
- return /* @__PURE__ */ e.jsx(
57
+ function N({ size: r = "md", className: a, ...n }) {
58
+ return /* @__PURE__ */ e(
59
59
  "div",
60
60
  {
61
61
  className: t(
@@ -71,38 +71,38 @@ function h({ size: r = "md", className: a, ...n }) {
71
71
  }
72
72
  );
73
73
  }
74
- function N(r) {
75
- return /* @__PURE__ */ e.jsx(d, { ...r });
76
- }
77
74
  function w(r) {
78
- return /* @__PURE__ */ e.jsx(d, { variant: "light", ...r });
75
+ return /* @__PURE__ */ e(d, { ...r });
76
+ }
77
+ function j(r) {
78
+ return /* @__PURE__ */ e(d, { variant: "light", ...r });
79
79
  }
80
80
  function y(r) {
81
- return /* @__PURE__ */ e.jsx(d, { variant: "light", ...r });
81
+ return /* @__PURE__ */ e(d, { variant: "light", ...r });
82
82
  }
83
83
  function k(r) {
84
- return /* @__PURE__ */ e.jsx("div", { ...r });
84
+ return /* @__PURE__ */ e("div", { ...r });
85
85
  }
86
86
  function A({ className: r, ...a }) {
87
- return /* @__PURE__ */ e.jsx("div", { className: t("flex flex-wrap items-center gap-(--card-item-group-gap)", r), ...a });
87
+ return /* @__PURE__ */ e("div", { className: t("flex flex-wrap items-center gap-(--gap-card-item-group)", r), ...a });
88
88
  }
89
- function m({ className: r, ...a }) {
90
- return /* @__PURE__ */ e.jsx("div", { className: t("relative w-full h-full", r), ...a });
89
+ function s({ className: r, ...a }) {
90
+ return /* @__PURE__ */ e("div", { className: t("relative w-full h-full", r), ...a });
91
91
  }
92
92
  function I({ className: r, ...a }) {
93
- return /* @__PURE__ */ e.jsx(m, { children: /* @__PURE__ */ e.jsx("img", { className: t("w-full h-full rounded-lg aspect-9/5 object-cover object-top", r), ...a }) });
93
+ return /* @__PURE__ */ e(s, { children: /* @__PURE__ */ e("img", { className: t("w-full h-full rounded-lg aspect-9/5 object-cover object-top", r), ...a }) });
94
94
  }
95
95
  export {
96
- j as Card,
97
- v as CardArea,
98
- N as CardCaption,
96
+ C as Card,
97
+ b as CardArea,
98
+ w as CardCaption,
99
99
  k as CardContent,
100
100
  I as CardImage,
101
- C as CardItemGroup,
102
- m as CardMedia,
101
+ h as CardItemGroup,
102
+ s as CardMedia,
103
103
  y as CardMeta,
104
- w as CardSubcaption,
105
- h as CardSubtitle,
106
- b as CardTitle,
104
+ j as CardSubcaption,
105
+ N as CardSubtitle,
106
+ x as CardTitle,
107
107
  A as CardToolbar
108
108
  };
@@ -0,0 +1,151 @@
1
+ import { JSX } from 'react/jsx-runtime';
2
+ import { KeyboardEventHandler } from 'react';
3
+ import { MouseEventHandler } from 'react';
4
+ import { PreinitializedMapStore } from 'nanostores';
5
+ import { PreinitializedWritableAtom } from 'nanostores';
6
+ import { ReactNode } from 'react';
7
+
8
+ export declare function CompositeComponent<T extends object>({ renderItem, className, itemClassName, ref, id, ...props }: CompositeProps<T>): JSX.Element;
9
+
10
+ export declare function CompositeComponentContext<T extends object>({ data, children, ...compositeOptions }: CompositeComponentContextProps<T>): JSX.Element;
11
+
12
+ declare interface CompositeComponentContextProps<T extends object> extends CompositeOptions {
13
+ data: T[];
14
+ children: React.ReactNode;
15
+ }
16
+
17
+ export declare function CompositeComponentItem<T extends object>({ id, className, item, mouseEventHandler, keyboardEventHandler, render, }: CompositeItemProps<T>): JSX.Element;
18
+
19
+ declare class CompositeData<T extends object> implements Iterable<CompositeDataItem<T>> {
20
+ #private;
21
+ lookup: Map<CompositeItemKey, CompositeDataItem<T>>;
22
+ firstFocusableItem: CompositeDataItem<T> | null;
23
+ focusedItem: PreinitializedWritableAtom<CompositeDataItem<T> | null>;
24
+ disabledKeys: PreinitializedWritableAtom<Set<CompositeItemKey>>;
25
+ selectedKeys: PreinitializedWritableAtom<Set<CompositeItemKey>>;
26
+ root: CompositeDataItem<T>;
27
+ constructor(items: T[], options?: CompositeOptions);
28
+ [Symbol.iterator](): Iterator<CompositeDataItem<T>>;
29
+ toJSON(): T[];
30
+ init(items: T[]): void;
31
+ isFocusable(itemAtom: CompositeDataItem<T>): boolean;
32
+ getFirstFocusableItem(): CompositeDataItem<T> | undefined;
33
+ item(key: CompositeItemKey): CompositeDataItem<T> | undefined;
34
+ descendants(itemKey: CompositeItemKey): CompositeDataItem<T>[] | undefined;
35
+ ancestors(itemKey: CompositeItemKey): CompositeDataItem<T>[] | undefined;
36
+ focus(itemKey: CompositeItemKey): void;
37
+ focus(item: CompositeDataItem<T>): void;
38
+ toggleSelect(itemKey: CompositeItemKey, recursive?: boolean): void;
39
+ toggleSelect(item: CompositeDataItem<T>, recursive?: boolean): void;
40
+ select(itemKey: CompositeItemKey, recursive?: boolean): void;
41
+ select(item: CompositeDataItem<T>, recursive?: boolean): void;
42
+ deselect(itemKey: CompositeItemKey, recursive?: boolean): void;
43
+ deselect(item: CompositeDataItem<T>, recursive?: boolean): void;
44
+ disable(itemKey: CompositeItemKey, recursive?: boolean): void;
45
+ disable(item: CompositeDataItem<T>, recursive?: boolean): void;
46
+ enable(itemKey: CompositeItemKey, recursive?: boolean): void;
47
+ enable(item: CompositeDataItem<T>, recursive?: boolean): void;
48
+ updateItem(key: CompositeItemKey, data: Partial<T> | ((item: T) => Partial<T>)): void;
49
+ }
50
+
51
+ declare class CompositeDataItem<T extends object> implements Iterable<CompositeDataItem<T>> {
52
+ #private;
53
+ parent: CompositeDataItem<T> | null;
54
+ children?: CompositeDataItem<T>[];
55
+ level: number;
56
+ data: PreinitializedMapStore<T>;
57
+ state: PreinitializedMapStore<CompositeDataItemState>;
58
+ pointers: {
59
+ left?: CompositeItemKey;
60
+ right?: CompositeItemKey;
61
+ up?: CompositeItemKey;
62
+ down?: CompositeItemKey;
63
+ };
64
+ childrenProp: string;
65
+ constructor(item: T, options: CompositeDataItemOptions<T>, parent: CompositeDataItem<T> | null);
66
+ get key(): CompositeItemKey;
67
+ [Symbol.iterator](): Iterator<CompositeDataItem<T>>;
68
+ toJSON(): T;
69
+ descendants(): CompositeDataItem<T>[];
70
+ ancestors(): CompositeDataItem<T>[];
71
+ toggleSelect(recursive?: boolean): void;
72
+ select(recursive?: boolean): CompositeItemKey[];
73
+ deselect(recursive?: boolean): CompositeItemKey[];
74
+ disable(recursive?: boolean): CompositeItemKey[];
75
+ enable(recursive?: boolean): CompositeItemKey[];
76
+ }
77
+
78
+ export declare type CompositeDataItemOptions<T> = CompositeDataPropGetters<T> & {
79
+ initialState?: CompositeDataItemState;
80
+ itemChildrenProp: string;
81
+ };
82
+
83
+ export declare interface CompositeDataItemState {
84
+ focused: boolean;
85
+ selected: boolean;
86
+ disabled: boolean;
87
+ }
88
+
89
+ export declare type CompositeDataOptions<T> = Required<CompositeOptions> & CompositeDataPropGetters<T>;
90
+
91
+ declare interface CompositeDataPropGetters<T> {
92
+ getItemKey: (item: T) => CompositeItemKey;
93
+ getItemChildren: (item: T) => T[] | undefined;
94
+ }
95
+
96
+ export declare interface CompositeFocusProvider {
97
+ setPointers: () => void;
98
+ goFirst: () => void;
99
+ goLast: () => void;
100
+ goUp: () => void;
101
+ goDown: () => void;
102
+ goLeft: () => void;
103
+ goRight: () => void;
104
+ }
105
+
106
+ export declare interface CompositeHandle {
107
+ focusUp: () => void;
108
+ focusDown: () => void;
109
+ select: () => void;
110
+ }
111
+
112
+ export declare interface CompositeItemEventHandlers {
113
+ mouseEventHandler?: MouseEventHandler<HTMLElement>;
114
+ keyboardEventHandler?: KeyboardEventHandler<HTMLElement>;
115
+ }
116
+
117
+ export declare type CompositeItemKey = string | number;
118
+
119
+ export declare interface CompositeItemProps<T extends object> {
120
+ id: string;
121
+ className?: string;
122
+ item: CompositeDataItem<T>;
123
+ mouseEventHandler?: (itemAtom: CompositeDataItem<T>) => void;
124
+ keyboardEventHandler?: (itemAtom: CompositeDataItem<T>) => void;
125
+ remove?: () => void;
126
+ render: CompositeItemRenderFn<T>;
127
+ }
128
+
129
+ export declare type CompositeItemRenderFn<T extends object> = (item: {
130
+ data: T;
131
+ level: number;
132
+ key: CompositeItemKey;
133
+ }, state: CompositeDataItemState, eventHandlers: CompositeItemEventHandlers) => ReactNode;
134
+
135
+ export declare interface CompositeOptions {
136
+ disabledKeys?: CompositeItemKey[];
137
+ selectedKeys?: CompositeItemKey[];
138
+ itemKeyProp?: string;
139
+ itemChildrenProp?: string;
140
+ }
141
+
142
+ export declare interface CompositeProps<T extends object> extends React.ComponentPropsWithoutRef<"div"> {
143
+ renderItem: CompositeItemRenderFn<T>;
144
+ className?: string;
145
+ itemClassName?: string;
146
+ ref?: React.Ref<CompositeHandle>;
147
+ }
148
+
149
+ export declare function useCompositeContext<T extends object>(): CompositeData<T>;
150
+
151
+ export { }