@skeletonlabs/skeleton-react 4.0.0-next.23 → 4.0.0-next.25
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/components/accordion/anatomy/item-content.d.ts +2 -2
- package/dist/components/accordion/anatomy/item-indicator.d.ts +2 -2
- package/dist/components/accordion/anatomy/item-trigger.d.ts +2 -2
- package/dist/components/accordion/anatomy/root-provider.d.ts +2 -2
- package/dist/components/accordion/anatomy/root.d.ts +2 -2
- package/dist/components/app-bar/anatomy/headline.d.ts +2 -2
- package/dist/components/app-bar/anatomy/lead.d.ts +2 -2
- package/dist/components/app-bar/anatomy/root.d.ts +2 -2
- package/dist/components/app-bar/anatomy/toolbar.d.ts +2 -2
- package/dist/components/app-bar/anatomy/trail.d.ts +2 -2
- package/dist/components/avatar/anatomy/root-provider.d.ts +2 -2
- package/dist/components/avatar/anatomy/root.d.ts +2 -2
- package/dist/components/combobox/anatomy/item-group.d.ts +2 -2
- package/dist/components/combobox/anatomy/item.d.ts +2 -2
- package/dist/components/combobox/anatomy/root-provider.d.ts +2 -2
- package/dist/components/combobox/anatomy/root.d.ts +2 -2
- package/dist/components/date-picker/anatomy/content.d.ts +2 -2
- package/dist/components/date-picker/anatomy/content.d.ts.map +1 -1
- package/dist/components/date-picker/anatomy/control.d.ts +2 -2
- package/dist/components/date-picker/anatomy/control.d.ts.map +1 -1
- package/dist/components/date-picker/anatomy/input.d.ts +2 -2
- package/dist/components/date-picker/anatomy/label.d.ts +2 -2
- package/dist/components/date-picker/anatomy/month-select.d.ts +2 -2
- package/dist/components/date-picker/anatomy/next-trigger.d.ts +2 -2
- package/dist/components/date-picker/anatomy/positioner.d.ts +2 -2
- package/dist/components/date-picker/anatomy/prev-trigger.d.ts +2 -2
- package/dist/components/date-picker/anatomy/range-text.d.ts +2 -2
- package/dist/components/date-picker/anatomy/root-provider.d.ts +2 -2
- package/dist/components/date-picker/anatomy/root.d.ts +2 -2
- package/dist/components/date-picker/anatomy/table-body.d.ts +2 -2
- package/dist/components/date-picker/anatomy/table-cell-trigger.d.ts +2 -2
- package/dist/components/date-picker/anatomy/table-cell.d.ts +2 -2
- package/dist/components/date-picker/anatomy/table-head.d.ts +2 -2
- package/dist/components/date-picker/anatomy/table-header.d.ts +2 -2
- package/dist/components/date-picker/anatomy/table-row.d.ts +2 -2
- package/dist/components/date-picker/anatomy/table.d.ts +2 -2
- package/dist/components/date-picker/anatomy/trigger.d.ts +2 -2
- package/dist/components/date-picker/anatomy/view-control.d.ts +2 -2
- package/dist/components/date-picker/anatomy/view-trigger.d.ts +2 -2
- package/dist/components/date-picker/anatomy/view.d.ts +2 -2
- package/dist/components/date-picker/anatomy/year-select.d.ts +2 -2
- package/dist/components/dialog/anatomy/root-provider.d.ts +2 -2
- package/dist/components/dialog/anatomy/root-provider.d.ts.map +1 -1
- package/dist/components/dialog/anatomy/root.d.ts +2 -2
- package/dist/components/file-upload/anatomy/item.d.ts +2 -2
- package/dist/components/file-upload/anatomy/root-provider.d.ts +2 -2
- package/dist/components/file-upload/anatomy/root.d.ts +2 -2
- package/dist/components/listbox/anatomy/content.d.ts +10 -0
- package/dist/components/listbox/anatomy/content.d.ts.map +1 -0
- package/dist/components/listbox/anatomy/content.js +20 -0
- package/dist/components/listbox/anatomy/content.js.map +1 -0
- package/dist/components/listbox/anatomy/input.d.ts +10 -0
- package/dist/components/listbox/anatomy/input.d.ts.map +1 -0
- package/dist/components/listbox/anatomy/input.js +17 -0
- package/dist/components/listbox/anatomy/input.js.map +1 -0
- package/dist/components/listbox/anatomy/item-group-label.d.ts +11 -0
- package/dist/components/listbox/anatomy/item-group-label.d.ts.map +1 -0
- package/dist/components/listbox/anatomy/item-group-label.js +27 -0
- package/dist/components/listbox/anatomy/item-group-label.js.map +1 -0
- package/dist/components/listbox/anatomy/item-group.d.ts +11 -0
- package/dist/components/listbox/anatomy/item-group.d.ts.map +1 -0
- package/dist/components/listbox/anatomy/item-group.js +29 -0
- package/dist/components/listbox/anatomy/item-group.js.map +1 -0
- package/dist/components/listbox/anatomy/item-indicator.d.ts +10 -0
- package/dist/components/listbox/anatomy/item-indicator.d.ts.map +1 -0
- package/dist/components/listbox/anatomy/item-indicator.js +23 -0
- package/dist/components/listbox/anatomy/item-indicator.js.map +1 -0
- package/dist/components/listbox/anatomy/item-text.d.ts +10 -0
- package/dist/components/listbox/anatomy/item-text.d.ts.map +1 -0
- package/dist/components/listbox/anatomy/item-text.js +22 -0
- package/dist/components/listbox/anatomy/item-text.js.map +1 -0
- package/dist/components/listbox/anatomy/item.d.ts +11 -0
- package/dist/components/listbox/anatomy/item.d.ts.map +1 -0
- package/dist/components/listbox/anatomy/item.js +26 -0
- package/dist/components/listbox/anatomy/item.js.map +1 -0
- package/dist/components/listbox/anatomy/label.d.ts +10 -0
- package/dist/components/listbox/anatomy/label.d.ts.map +1 -0
- package/dist/components/listbox/anatomy/label.js +20 -0
- package/dist/components/listbox/anatomy/label.js.map +1 -0
- package/dist/components/listbox/anatomy/root-context.d.ts +11 -0
- package/dist/components/listbox/anatomy/root-context.d.ts.map +1 -0
- package/dist/components/listbox/anatomy/root-context.js +13 -0
- package/dist/components/listbox/anatomy/root-context.js.map +1 -0
- package/dist/components/listbox/anatomy/root-provider.d.ts +13 -0
- package/dist/components/listbox/anatomy/root-provider.d.ts.map +1 -0
- package/dist/components/listbox/anatomy/root-provider.js +21 -0
- package/dist/components/listbox/anatomy/root-provider.js.map +1 -0
- package/dist/components/listbox/anatomy/root.d.ts +11 -0
- package/dist/components/listbox/anatomy/root.d.ts.map +1 -0
- package/dist/components/listbox/anatomy/root.js +25 -0
- package/dist/components/listbox/anatomy/root.js.map +1 -0
- package/dist/components/listbox/modules/anatomy.d.ts +28 -0
- package/dist/components/listbox/modules/anatomy.d.ts.map +1 -0
- package/dist/components/listbox/modules/anatomy.js +29 -0
- package/dist/components/listbox/modules/anatomy.js.map +1 -0
- package/dist/components/listbox/modules/item-context.js +8 -0
- package/dist/components/listbox/modules/item-context.js.map +1 -0
- package/dist/components/listbox/modules/item-group-context.js +8 -0
- package/dist/components/listbox/modules/item-group-context.js.map +1 -0
- package/dist/components/listbox/modules/provider.d.ts +8 -0
- package/dist/components/listbox/modules/provider.d.ts.map +1 -0
- package/dist/components/listbox/modules/provider.js +16 -0
- package/dist/components/listbox/modules/provider.js.map +1 -0
- package/dist/components/listbox/modules/root-context.js +8 -0
- package/dist/components/listbox/modules/root-context.js.map +1 -0
- package/dist/components/navigation/anatomy/content.d.ts +2 -2
- package/dist/components/navigation/anatomy/content.d.ts.map +1 -1
- package/dist/components/navigation/anatomy/footer.d.ts +2 -2
- package/dist/components/navigation/anatomy/footer.d.ts.map +1 -1
- package/dist/components/navigation/anatomy/group.d.ts +2 -2
- package/dist/components/navigation/anatomy/group.d.ts.map +1 -1
- package/dist/components/navigation/anatomy/header.d.ts +2 -2
- package/dist/components/navigation/anatomy/header.d.ts.map +1 -1
- package/dist/components/navigation/anatomy/label.d.ts +2 -2
- package/dist/components/navigation/anatomy/label.d.ts.map +1 -1
- package/dist/components/navigation/anatomy/menu.d.ts +2 -2
- package/dist/components/navigation/anatomy/menu.d.ts.map +1 -1
- package/dist/components/navigation/anatomy/root.d.ts +2 -2
- package/dist/components/pagination/anatomy/ellipsis.d.ts +2 -2
- package/dist/components/pagination/anatomy/root-provider.d.ts +2 -2
- package/dist/components/pagination/anatomy/root.d.ts +2 -2
- package/dist/components/popover/anatomy/arrow-tip.d.ts +2 -2
- package/dist/components/popover/anatomy/arrow.d.ts +2 -2
- package/dist/components/popover/anatomy/root-provider.d.ts +2 -2
- package/dist/components/popover/anatomy/root.d.ts +2 -2
- package/dist/components/portal/anatomy/root.d.ts +2 -2
- package/dist/components/portal/anatomy/root.d.ts.map +1 -1
- package/dist/components/progress/anatomy/root-provider.d.ts +2 -2
- package/dist/components/progress/anatomy/root.d.ts +2 -2
- package/dist/components/rating-group/anatomy/control.d.ts +2 -2
- package/dist/components/rating-group/anatomy/hidden-input.d.ts +2 -2
- package/dist/components/rating-group/anatomy/item.d.ts +2 -2
- package/dist/components/rating-group/anatomy/label.d.ts +2 -2
- package/dist/components/rating-group/anatomy/root-provider.d.ts +2 -2
- package/dist/components/segmented-control/anatomy/control.d.ts +2 -2
- package/dist/components/segmented-control/anatomy/indicator.d.ts +2 -2
- package/dist/components/segmented-control/anatomy/item-hidden-input.d.ts +2 -2
- package/dist/components/segmented-control/anatomy/item-text.d.ts +2 -2
- package/dist/components/segmented-control/anatomy/item.d.ts +2 -2
- package/dist/components/segmented-control/anatomy/label.d.ts +2 -2
- package/dist/components/segmented-control/anatomy/root-provider.d.ts +2 -2
- package/dist/components/segmented-control/anatomy/root.d.ts +2 -2
- package/dist/components/slider/anatomy/control.d.ts +2 -2
- package/dist/components/slider/anatomy/hidden-input.d.ts +2 -2
- package/dist/components/slider/anatomy/label.d.ts +2 -2
- package/dist/components/slider/anatomy/marker-group.d.ts +2 -2
- package/dist/components/slider/anatomy/marker.d.ts +2 -2
- package/dist/components/slider/anatomy/range.d.ts +2 -2
- package/dist/components/slider/anatomy/root-provider.d.ts +2 -2
- package/dist/components/slider/anatomy/root.d.ts +2 -2
- package/dist/components/slider/anatomy/thumb.d.ts +2 -2
- package/dist/components/slider/anatomy/track.d.ts +2 -2
- package/dist/components/switch/anatomy/hidden-input.d.ts +2 -2
- package/dist/components/switch/anatomy/label.d.ts +2 -2
- package/dist/components/switch/anatomy/root-provider.d.ts +2 -2
- package/dist/components/switch/anatomy/root.d.ts +2 -2
- package/dist/components/tabs/anatomy/root-provider.d.ts +2 -2
- package/dist/components/tabs/anatomy/root.d.ts +2 -2
- package/dist/components/tags-input/anatomy/clear-trigger.d.ts +2 -2
- package/dist/components/tags-input/anatomy/control.d.ts +2 -2
- package/dist/components/tags-input/anatomy/hidden-input.d.ts +2 -2
- package/dist/components/tags-input/anatomy/item.d.ts +2 -2
- package/dist/components/tags-input/anatomy/root-provider.d.ts +2 -2
- package/dist/components/tags-input/anatomy/root.d.ts +2 -2
- package/dist/components/toast/anatomy/action-trigger.d.ts +2 -2
- package/dist/components/toast/anatomy/group.d.ts +2 -2
- package/dist/components/toast/anatomy/root.d.ts +2 -2
- package/dist/components/tooltip/anatomy/positioner.d.ts +2 -2
- package/dist/components/tooltip/anatomy/root-provider.d.ts +2 -2
- package/dist/components/tooltip/anatomy/root.d.ts +2 -2
- package/dist/components/tree-view/anatomy/branch-content.d.ts +10 -0
- package/dist/components/tree-view/anatomy/branch-content.d.ts.map +1 -0
- package/dist/components/tree-view/anatomy/branch-content.js +22 -0
- package/dist/components/tree-view/anatomy/branch-content.js.map +1 -0
- package/dist/components/tree-view/anatomy/branch-control.d.ts +10 -0
- package/dist/components/tree-view/anatomy/branch-control.d.ts.map +1 -0
- package/dist/components/tree-view/anatomy/branch-control.js +22 -0
- package/dist/components/tree-view/anatomy/branch-control.js.map +1 -0
- package/dist/components/tree-view/anatomy/branch-indent-guide.d.ts +10 -0
- package/dist/components/tree-view/anatomy/branch-indent-guide.d.ts.map +1 -0
- package/dist/components/tree-view/anatomy/branch-indent-guide.js +22 -0
- package/dist/components/tree-view/anatomy/branch-indent-guide.js.map +1 -0
- package/dist/components/tree-view/anatomy/branch-indicator.d.ts +10 -0
- package/dist/components/tree-view/anatomy/branch-indicator.d.ts.map +1 -0
- package/dist/components/tree-view/anatomy/branch-indicator.js +23 -0
- package/dist/components/tree-view/anatomy/branch-indicator.js.map +1 -0
- package/dist/components/tree-view/anatomy/branch-text.d.ts +10 -0
- package/dist/components/tree-view/anatomy/branch-text.d.ts.map +1 -0
- package/dist/components/tree-view/anatomy/branch-text.js +22 -0
- package/dist/components/tree-view/anatomy/branch-text.js.map +1 -0
- package/dist/components/tree-view/anatomy/branch.d.ts +10 -0
- package/dist/components/tree-view/anatomy/branch.d.ts.map +1 -0
- package/dist/components/tree-view/anatomy/branch.js +22 -0
- package/dist/components/tree-view/anatomy/branch.js.map +1 -0
- package/dist/components/tree-view/anatomy/item.d.ts +10 -0
- package/dist/components/tree-view/anatomy/item.d.ts.map +1 -0
- package/dist/components/tree-view/anatomy/item.js +22 -0
- package/dist/components/tree-view/anatomy/item.js.map +1 -0
- package/dist/components/tree-view/anatomy/label.d.ts +17 -0
- package/dist/components/tree-view/anatomy/label.d.ts.map +1 -0
- package/dist/components/tree-view/anatomy/label.js +21 -0
- package/dist/components/tree-view/anatomy/label.js.map +1 -0
- package/dist/components/tree-view/anatomy/node-provider.d.ts +12 -0
- package/dist/components/tree-view/anatomy/node-provider.d.ts.map +1 -0
- package/dist/components/tree-view/anatomy/node-provider.js +15 -0
- package/dist/components/tree-view/anatomy/node-provider.js.map +1 -0
- package/dist/components/tree-view/anatomy/root-context.d.ts +11 -0
- package/dist/components/tree-view/anatomy/root-context.d.ts.map +1 -0
- package/dist/components/tree-view/anatomy/root-context.js +13 -0
- package/dist/components/tree-view/anatomy/root-context.js.map +1 -0
- package/dist/components/tree-view/anatomy/root-provider.d.ts +13 -0
- package/dist/components/tree-view/anatomy/root-provider.d.ts.map +1 -0
- package/dist/components/tree-view/anatomy/root-provider.js +21 -0
- package/dist/components/tree-view/anatomy/root-provider.js.map +1 -0
- package/dist/components/tree-view/anatomy/root.d.ts +11 -0
- package/dist/components/tree-view/anatomy/root.d.ts.map +1 -0
- package/dist/components/tree-view/anatomy/root.js +25 -0
- package/dist/components/tree-view/anatomy/root.js.map +1 -0
- package/dist/components/tree-view/anatomy/tree.d.ts +10 -0
- package/dist/components/tree-view/anatomy/tree.d.ts.map +1 -0
- package/dist/components/tree-view/anatomy/tree.js +20 -0
- package/dist/components/tree-view/anatomy/tree.js.map +1 -0
- package/dist/components/tree-view/modules/anatomy.d.ts +32 -0
- package/dist/components/tree-view/modules/anatomy.d.ts.map +1 -0
- package/dist/components/tree-view/modules/anatomy.js +33 -0
- package/dist/components/tree-view/modules/anatomy.js.map +1 -0
- package/dist/components/tree-view/modules/create-tree-view-collection.d.ts +8 -0
- package/dist/components/tree-view/modules/create-tree-view-collection.d.ts.map +1 -0
- package/dist/components/tree-view/modules/create-tree-view-collection.js +10 -0
- package/dist/components/tree-view/modules/create-tree-view-collection.js.map +1 -0
- package/dist/components/tree-view/modules/node-context.js +8 -0
- package/dist/components/tree-view/modules/node-context.js.map +1 -0
- package/dist/components/tree-view/modules/provider.d.ts +8 -0
- package/dist/components/tree-view/modules/provider.d.ts.map +1 -0
- package/dist/components/tree-view/modules/provider.js +16 -0
- package/dist/components/tree-view/modules/provider.js.map +1 -0
- package/dist/components/tree-view/modules/root-context.js +8 -0
- package/dist/components/tree-view/modules/root-context.js.map +1 -0
- package/dist/index.d.ts +28 -1
- package/dist/index.js +6 -1
- package/package.json +4 -2
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HTMLAttributes } from "../../../internal/html-attributes.js";
|
|
2
|
+
import { PropsWithElement } from "../../../internal/props-with-element.js";
|
|
3
|
+
import * as react102 from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/tree-view/anatomy/branch-text.d.ts
|
|
6
|
+
interface TreeViewBranchTextProps extends PropsWithElement<'span'>, HTMLAttributes<'span'> {}
|
|
7
|
+
declare function BranchText(props: TreeViewBranchTextProps): react102.JSX.Element;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { BranchText, TreeViewBranchTextProps };
|
|
10
|
+
//# sourceMappingURL=branch-text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branch-text.d.ts","names":[],"sources":["../../../../src/components/tree-view/anatomy/branch-text.tsx"],"sourcesContent":[],"mappings":";;;;;UAQiB,uBAAA,SAAgC,0BAA0B;iBAEnD,UAAA,QAAkB,0BAAuB,QAAA,CAAA,GAAA,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { NodeContext } from "../modules/node-context.js";
|
|
2
|
+
import { RootContext } from "../modules/root-context.js";
|
|
3
|
+
import { use } from "react";
|
|
4
|
+
import { mergeProps } from "@zag-js/react";
|
|
5
|
+
import { classesTreeView } from "@skeletonlabs/skeleton-common";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
|
|
8
|
+
//#region src/components/tree-view/anatomy/branch-text.tsx
|
|
9
|
+
function BranchText(props) {
|
|
10
|
+
const treeView = use(RootContext);
|
|
11
|
+
const nodeProps = use(NodeContext);
|
|
12
|
+
const { element, children,...rest } = props;
|
|
13
|
+
const attributes = mergeProps(treeView.getBranchTextProps(nodeProps), { className: classesTreeView.branchText }, rest);
|
|
14
|
+
return element ? element(attributes) : /* @__PURE__ */ jsx("span", {
|
|
15
|
+
...attributes,
|
|
16
|
+
children
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { BranchText as default };
|
|
22
|
+
//# sourceMappingURL=branch-text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branch-text.js","names":[],"sources":["../../../../src/components/tree-view/anatomy/branch-text.tsx"],"sourcesContent":["import { NodeContext } from '../modules/node-context';\nimport { RootContext } from '../modules/root-context';\nimport type { HTMLAttributes } from '@/internal/html-attributes';\nimport type { PropsWithElement } from '@/internal/props-with-element';\nimport { classesTreeView } from '@skeletonlabs/skeleton-common';\nimport { mergeProps } from '@zag-js/react';\nimport { use } from 'react';\n\nexport interface TreeViewBranchTextProps extends PropsWithElement<'span'>, HTMLAttributes<'span'> {}\n\nexport default function BranchText(props: TreeViewBranchTextProps) {\n\tconst treeView = use(RootContext);\n\tconst nodeProps = use(NodeContext);\n\n\tconst { element, children, ...rest } = props;\n\n\tconst attributes = mergeProps(\n\t\ttreeView.getBranchTextProps(nodeProps),\n\t\t{\n\t\t\tclassName: classesTreeView.branchText,\n\t\t},\n\t\trest,\n\t);\n\n\treturn element ? element(attributes) : <span {...attributes}>{children}</span>;\n}\n"],"mappings":";;;;;;;;AAUA,SAAwB,WAAW,OAAgC;CAClE,MAAM,WAAW,IAAI,YAAY;CACjC,MAAM,YAAY,IAAI,YAAY;CAElC,MAAM,EAAE,SAAS,SAAU,GAAG,SAAS;CAEvC,MAAM,aAAa,WAClB,SAAS,mBAAmB,UAAU,EACtC,EACC,WAAW,gBAAgB,YAC3B,EACD,KACA;AAED,QAAO,UAAU,QAAQ,WAAW,GAAG,oBAAC;EAAK,GAAI;EAAa;GAAgB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HTMLAttributes } from "../../../internal/html-attributes.js";
|
|
2
|
+
import { PropsWithElement } from "../../../internal/props-with-element.js";
|
|
3
|
+
import * as react100 from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/tree-view/anatomy/branch.d.ts
|
|
6
|
+
interface TreeViewBranchProps extends PropsWithElement<'div'>, HTMLAttributes<'div'> {}
|
|
7
|
+
declare function Branch(props: TreeViewBranchProps): react100.JSX.Element;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { Branch, TreeViewBranchProps };
|
|
10
|
+
//# sourceMappingURL=branch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branch.d.ts","names":[],"sources":["../../../../src/components/tree-view/anatomy/branch.tsx"],"sourcesContent":[],"mappings":";;;;;UAQiB,mBAAA,SAA4B,yBAAyB;iBAE9C,MAAA,QAAc,sBAAmB,QAAA,CAAA,GAAA,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { NodeContext } from "../modules/node-context.js";
|
|
2
|
+
import { RootContext } from "../modules/root-context.js";
|
|
3
|
+
import { use } from "react";
|
|
4
|
+
import { mergeProps } from "@zag-js/react";
|
|
5
|
+
import { classesTreeView } from "@skeletonlabs/skeleton-common";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
|
|
8
|
+
//#region src/components/tree-view/anatomy/branch.tsx
|
|
9
|
+
function Branch(props) {
|
|
10
|
+
const treeView = use(RootContext);
|
|
11
|
+
const nodeProps = use(NodeContext);
|
|
12
|
+
const { element, children,...rest } = props;
|
|
13
|
+
const attributes = mergeProps(treeView.getBranchProps(nodeProps), { className: classesTreeView.branch }, rest);
|
|
14
|
+
return element ? element(attributes) : /* @__PURE__ */ jsx("div", {
|
|
15
|
+
...attributes,
|
|
16
|
+
children
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { Branch as default };
|
|
22
|
+
//# sourceMappingURL=branch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branch.js","names":[],"sources":["../../../../src/components/tree-view/anatomy/branch.tsx"],"sourcesContent":["import { NodeContext } from '../modules/node-context';\nimport { RootContext } from '../modules/root-context';\nimport type { HTMLAttributes } from '@/internal/html-attributes';\nimport type { PropsWithElement } from '@/internal/props-with-element';\nimport { classesTreeView } from '@skeletonlabs/skeleton-common';\nimport { mergeProps } from '@zag-js/react';\nimport { use } from 'react';\n\nexport interface TreeViewBranchProps extends PropsWithElement<'div'>, HTMLAttributes<'div'> {}\n\nexport default function Branch(props: TreeViewBranchProps) {\n\tconst treeView = use(RootContext);\n\tconst nodeProps = use(NodeContext);\n\n\tconst { element, children, ...rest } = props;\n\n\tconst attributes = mergeProps(\n\t\ttreeView.getBranchProps(nodeProps),\n\t\t{\n\t\t\tclassName: classesTreeView.branch,\n\t\t},\n\t\trest,\n\t);\n\n\treturn element ? element(attributes) : <div {...attributes}>{children}</div>;\n}\n"],"mappings":";;;;;;;;AAUA,SAAwB,OAAO,OAA4B;CAC1D,MAAM,WAAW,IAAI,YAAY;CACjC,MAAM,YAAY,IAAI,YAAY;CAElC,MAAM,EAAE,SAAS,SAAU,GAAG,SAAS;CAEvC,MAAM,aAAa,WAClB,SAAS,eAAe,UAAU,EAClC,EACC,WAAW,gBAAgB,QAC3B,EACD,KACA;AAED,QAAO,UAAU,QAAQ,WAAW,GAAG,oBAAC;EAAI,GAAI;EAAa;GAAe"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HTMLAttributes } from "../../../internal/html-attributes.js";
|
|
2
|
+
import { PropsWithElement } from "../../../internal/props-with-element.js";
|
|
3
|
+
import * as react99 from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/tree-view/anatomy/item.d.ts
|
|
6
|
+
interface TreeViewItemProps extends PropsWithElement<'div'>, HTMLAttributes<'div'> {}
|
|
7
|
+
declare function Item(props: TreeViewItemProps): react99.JSX.Element;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { Item, TreeViewItemProps };
|
|
10
|
+
//# sourceMappingURL=item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item.d.ts","names":[],"sources":["../../../../src/components/tree-view/anatomy/item.tsx"],"sourcesContent":[],"mappings":";;;;;UAQiB,iBAAA,SAA0B,yBAAyB;iBAE5C,IAAA,QAAY,oBAAiB,OAAA,CAAA,GAAA,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { NodeContext } from "../modules/node-context.js";
|
|
2
|
+
import { RootContext } from "../modules/root-context.js";
|
|
3
|
+
import { use } from "react";
|
|
4
|
+
import { mergeProps } from "@zag-js/react";
|
|
5
|
+
import { classesTreeView } from "@skeletonlabs/skeleton-common";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
|
|
8
|
+
//#region src/components/tree-view/anatomy/item.tsx
|
|
9
|
+
function Item(props) {
|
|
10
|
+
const treeView = use(RootContext);
|
|
11
|
+
const nodeProps = use(NodeContext);
|
|
12
|
+
const { element, children,...rest } = props;
|
|
13
|
+
const attributes = mergeProps(treeView.getItemProps(nodeProps), { className: classesTreeView.item }, rest);
|
|
14
|
+
return element ? element(attributes) : /* @__PURE__ */ jsx("div", {
|
|
15
|
+
...attributes,
|
|
16
|
+
children
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { Item as default };
|
|
22
|
+
//# sourceMappingURL=item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item.js","names":[],"sources":["../../../../src/components/tree-view/anatomy/item.tsx"],"sourcesContent":["import { NodeContext } from '../modules/node-context';\nimport { RootContext } from '../modules/root-context';\nimport type { HTMLAttributes } from '@/internal/html-attributes';\nimport type { PropsWithElement } from '@/internal/props-with-element';\nimport { classesTreeView } from '@skeletonlabs/skeleton-common';\nimport { mergeProps } from '@zag-js/react';\nimport { use } from 'react';\n\nexport interface TreeViewItemProps extends PropsWithElement<'div'>, HTMLAttributes<'div'> {}\n\nexport default function Item(props: TreeViewItemProps) {\n\tconst treeView = use(RootContext);\n\tconst nodeProps = use(NodeContext);\n\n\tconst { element, children, ...rest } = props;\n\n\tconst attributes = mergeProps(\n\t\ttreeView.getItemProps(nodeProps),\n\t\t{\n\t\t\tclassName: classesTreeView.item,\n\t\t},\n\t\trest,\n\t);\n\n\treturn element ? element(attributes) : <div {...attributes}>{children}</div>;\n}\n"],"mappings":";;;;;;;;AAUA,SAAwB,KAAK,OAA0B;CACtD,MAAM,WAAW,IAAI,YAAY;CACjC,MAAM,YAAY,IAAI,YAAY;CAElC,MAAM,EAAE,SAAS,SAAU,GAAG,SAAS;CAEvC,MAAM,aAAa,WAClB,SAAS,aAAa,UAAU,EAChC,EACC,WAAW,gBAAgB,MAC3B,EACD,KACA;AAED,QAAO,UAAU,QAAQ,WAAW,GAAG,oBAAC;EAAI,GAAI;EAAa;GAAe"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { HTMLAttributes } from "../../../internal/html-attributes.js";
|
|
2
|
+
import { PropsWithElement } from "../../../internal/props-with-element.js";
|
|
3
|
+
import { JSX } from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/tree-view/anatomy/label.d.ts
|
|
6
|
+
interface TreeViewLabelProps extends PropsWithElement<'h3'>, HTMLAttributes<'h3'> {
|
|
7
|
+
/**
|
|
8
|
+
* The level of the heading.
|
|
9
|
+
*
|
|
10
|
+
* @defaultValue 3
|
|
11
|
+
*/
|
|
12
|
+
level?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
13
|
+
}
|
|
14
|
+
declare function Label(props: TreeViewLabelProps): JSX.Element;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { Label, TreeViewLabelProps };
|
|
17
|
+
//# sourceMappingURL=label.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label.d.ts","names":[],"sources":["../../../../src/components/tree-view/anatomy/label.tsx"],"sourcesContent":[],"mappings":";;;;;UAOiB,kBAAA,SAA2B,wBAAwB;;AAApE;;;;EAAkF,KAAA,CAAA,EAAA,CAAA,GAAA,CAAA,GAAA,CAAA,GAAA,CAAA,GAAA,CAAA,GAAA,CAAA;AAOjF;AAE4B,iBAAL,KAAA,CAAK,KAAA,EAAQ,kBAAR,CAAA,EAA0B,GAAA,CAAA,OAA1B"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { RootContext } from "../modules/root-context.js";
|
|
2
|
+
import { use } from "react";
|
|
3
|
+
import { mergeProps } from "@zag-js/react";
|
|
4
|
+
import { classesTreeView } from "@skeletonlabs/skeleton-common";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/components/tree-view/anatomy/label.tsx
|
|
8
|
+
function Label(props) {
|
|
9
|
+
const treeView = use(RootContext);
|
|
10
|
+
const { element, children, level = 3,...rest } = props;
|
|
11
|
+
const attributes = mergeProps(treeView.getLabelProps(), { className: classesTreeView.label }, rest);
|
|
12
|
+
const Tag = `h${level}`;
|
|
13
|
+
return element ? element(attributes) : /* @__PURE__ */ jsx(Tag, {
|
|
14
|
+
...attributes,
|
|
15
|
+
children
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
export { Label as default };
|
|
21
|
+
//# sourceMappingURL=label.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label.js","names":["Tag: keyof JSX.IntrinsicElements"],"sources":["../../../../src/components/tree-view/anatomy/label.tsx"],"sourcesContent":["import { RootContext } from '../modules/root-context';\nimport type { HTMLAttributes } from '@/internal/html-attributes';\nimport type { PropsWithElement } from '@/internal/props-with-element';\nimport { classesTreeView } from '@skeletonlabs/skeleton-common';\nimport { mergeProps } from '@zag-js/react';\nimport { use, type JSX } from 'react';\n\nexport interface TreeViewLabelProps extends PropsWithElement<'h3'>, HTMLAttributes<'h3'> {\n\t/**\n\t * The level of the heading.\n\t *\n\t * @defaultValue 3\n\t */\n\tlevel?: 1 | 2 | 3 | 4 | 5 | 6;\n}\n\nexport default function Label(props: TreeViewLabelProps) {\n\tconst treeView = use(RootContext);\n\n\tconst { element, children, level = 3, ...rest } = props;\n\n\tconst attributes = mergeProps(\n\t\ttreeView.getLabelProps(),\n\t\t{\n\t\t\tclassName: classesTreeView.label,\n\t\t},\n\t\trest,\n\t);\n\n\tconst Tag: keyof JSX.IntrinsicElements = `h${level}`;\n\n\treturn element ? element(attributes) : <Tag {...attributes}>{children}</Tag>;\n}\n"],"mappings":";;;;;;;AAgBA,SAAwB,MAAM,OAA2B;CACxD,MAAM,WAAW,IAAI,YAAY;CAEjC,MAAM,EAAE,SAAS,UAAU,QAAQ,EAAG,GAAG,SAAS;CAElD,MAAM,aAAa,WAClB,SAAS,eAAe,EACxB,EACC,WAAW,gBAAgB,OAC3B,EACD,KACA;CAED,MAAMA,MAAmC,IAAI;AAE7C,QAAO,UAAU,QAAQ,WAAW,GAAG,oBAAC;EAAI,GAAI;EAAa;GAAe"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PropsWithChildren } from "react";
|
|
2
|
+
import * as react_jsx_runtime44 from "react/jsx-runtime";
|
|
3
|
+
import { NodeProps } from "@zag-js/tree-view";
|
|
4
|
+
|
|
5
|
+
//#region src/components/tree-view/anatomy/node-provider.d.ts
|
|
6
|
+
interface TreeViewNodeProviderProps extends PropsWithChildren {
|
|
7
|
+
value: NodeProps;
|
|
8
|
+
}
|
|
9
|
+
declare function NodeProvider(props: TreeViewNodeProviderProps): react_jsx_runtime44.JSX.Element;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { NodeProvider, TreeViewNodeProviderProps };
|
|
12
|
+
//# sourceMappingURL=node-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-provider.d.ts","names":[],"sources":["../../../../src/components/tree-view/anatomy/node-provider.tsx"],"sourcesContent":[],"mappings":";;;;;UAIiB,yBAAA,SAAkC;SAC3C;;AADS,iBAIO,YAAA,CAJmB,KAAA,EAIC,yBAJD,CAAA,EAI0B,mBAAA,CAAA,GAAA,CAAA,OAJ1B"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { NodeContext } from "../modules/node-context.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/components/tree-view/anatomy/node-provider.tsx
|
|
5
|
+
function NodeProvider(props) {
|
|
6
|
+
const { children, value: nodeProps } = props;
|
|
7
|
+
return /* @__PURE__ */ jsx(NodeContext.Provider, {
|
|
8
|
+
value: nodeProps,
|
|
9
|
+
children
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
export { NodeProvider as default };
|
|
15
|
+
//# sourceMappingURL=node-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-provider.js","names":[],"sources":["../../../../src/components/tree-view/anatomy/node-provider.tsx"],"sourcesContent":["import { NodeContext } from '../modules/node-context';\nimport type { NodeProps } from '@zag-js/tree-view';\nimport type { PropsWithChildren } from 'react';\n\nexport interface TreeViewNodeProviderProps extends PropsWithChildren {\n\tvalue: NodeProps;\n}\n\nexport default function NodeProvider(props: TreeViewNodeProviderProps) {\n\tconst { children, value: nodeProps } = props;\n\n\treturn <NodeContext.Provider value={nodeProps}>{children}</NodeContext.Provider>;\n}\n"],"mappings":";;;;AAQA,SAAwB,aAAa,OAAkC;CACtE,MAAM,EAAE,UAAU,OAAO,cAAc;AAEvC,QAAO,oBAAC,YAAY;EAAS,OAAO;EAAY;GAAgC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useTreeView } from "../modules/provider.js";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/tree-view/anatomy/root-context.d.ts
|
|
5
|
+
interface TreeViewRootContextProps {
|
|
6
|
+
children: (treeView: ReturnType<typeof useTreeView>) => ReactNode;
|
|
7
|
+
}
|
|
8
|
+
declare function RootContext(props: TreeViewRootContextProps): ReactNode;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { RootContext, TreeViewRootContextProps };
|
|
11
|
+
//# sourceMappingURL=root-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root-context.d.ts","names":[],"sources":["../../../../src/components/tree-view/anatomy/root-context.tsx"],"sourcesContent":[],"mappings":";;;;UAKiB,wBAAA;uBACK,kBAAkB,iBAAiB;AADzD;AAAyC,iBAIjB,WAAA,CAJiB,KAAA,EAIE,wBAJF,CAAA,EAI0B,SAJ1B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { RootContext } from "../modules/root-context.js";
|
|
2
|
+
import { use } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/tree-view/anatomy/root-context.tsx
|
|
5
|
+
function RootContext$1(props) {
|
|
6
|
+
const treeView = use(RootContext);
|
|
7
|
+
const { children } = props;
|
|
8
|
+
return children(treeView);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
export { RootContext$1 as default };
|
|
13
|
+
//# sourceMappingURL=root-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root-context.js","names":["RootContext","RootContext_"],"sources":["../../../../src/components/tree-view/anatomy/root-context.tsx"],"sourcesContent":["import type { useTreeView } from '../modules/provider';\nimport { RootContext as RootContext_ } from '../modules/root-context';\nimport { use } from 'react';\nimport type { ReactNode } from 'react';\n\nexport interface TreeViewRootContextProps {\n\tchildren: (treeView: ReturnType<typeof useTreeView>) => ReactNode;\n}\n\nexport default function RootContext(props: TreeViewRootContextProps) {\n\tconst treeView = use(RootContext_);\n\n\tconst { children } = props;\n\n\treturn children(treeView);\n}\n"],"mappings":";;;;AASA,SAAwBA,cAAY,OAAiC;CACpE,MAAM,WAAW,IAAIC,YAAa;CAElC,MAAM,EAAE,aAAa;AAErB,QAAO,SAAS,SAAS"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HTMLAttributes } from "../../../internal/html-attributes.js";
|
|
2
|
+
import { PropsWithElement } from "../../../internal/props-with-element.js";
|
|
3
|
+
import { useTreeView } from "../modules/provider.js";
|
|
4
|
+
import * as react_jsx_runtime43 from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/components/tree-view/anatomy/root-provider.d.ts
|
|
7
|
+
interface TreeViewRootProviderProps extends PropsWithElement<'div'>, HTMLAttributes<'div', 'id' | 'dir' | 'defaultValue'> {
|
|
8
|
+
value: ReturnType<typeof useTreeView>;
|
|
9
|
+
}
|
|
10
|
+
declare function RootProvider(props: TreeViewRootProviderProps): react_jsx_runtime43.JSX.Element;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { RootProvider, TreeViewRootProviderProps };
|
|
13
|
+
//# sourceMappingURL=root-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root-provider.d.ts","names":[],"sources":["../../../../src/components/tree-view/anatomy/root-provider.tsx"],"sourcesContent":[],"mappings":";;;;;;UAOiB,yBAAA,SAAkC,yBAAyB;SACpE,kBAAkB;;AADT,iBAIO,YAAA,CAJmB,KAAA,EAIC,yBAJD,CAAA,EAI0B,mBAAA,CAAA,GAAA,CAAA,OAJ1B"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { RootContext } from "../modules/root-context.js";
|
|
2
|
+
import { mergeProps } from "@zag-js/react";
|
|
3
|
+
import { classesTreeView } from "@skeletonlabs/skeleton-common";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/components/tree-view/anatomy/root-provider.tsx
|
|
7
|
+
function RootProvider(props) {
|
|
8
|
+
const { element, children, value: treeView,...rest } = props;
|
|
9
|
+
const attributes = mergeProps(treeView.getRootProps(), { className: classesTreeView.root }, rest);
|
|
10
|
+
return /* @__PURE__ */ jsx(RootContext.Provider, {
|
|
11
|
+
value: treeView,
|
|
12
|
+
children: element ? element(attributes) : /* @__PURE__ */ jsx("div", {
|
|
13
|
+
...attributes,
|
|
14
|
+
children
|
|
15
|
+
})
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
export { RootProvider as default };
|
|
21
|
+
//# sourceMappingURL=root-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root-provider.js","names":[],"sources":["../../../../src/components/tree-view/anatomy/root-provider.tsx"],"sourcesContent":["import type { useTreeView } from '../modules/provider';\nimport { RootContext } from '../modules/root-context';\nimport type { HTMLAttributes } from '@/internal/html-attributes';\nimport type { PropsWithElement } from '@/internal/props-with-element';\nimport { classesTreeView } from '@skeletonlabs/skeleton-common';\nimport { mergeProps } from '@zag-js/react';\n\nexport interface TreeViewRootProviderProps extends PropsWithElement<'div'>, HTMLAttributes<'div', 'id' | 'dir' | 'defaultValue'> {\n\tvalue: ReturnType<typeof useTreeView>;\n}\n\nexport default function RootProvider(props: TreeViewRootProviderProps) {\n\tconst { element, children, value: treeView, ...rest } = props;\n\n\tconst attributes = mergeProps(\n\t\ttreeView.getRootProps(),\n\t\t{\n\t\t\tclassName: classesTreeView.root,\n\t\t},\n\t\trest,\n\t);\n\n\treturn (\n\t\t<RootContext.Provider value={treeView}>{element ? element(attributes) : <div {...attributes}>{children}</div>}</RootContext.Provider>\n\t);\n}\n"],"mappings":";;;;;;AAWA,SAAwB,aAAa,OAAkC;CACtE,MAAM,EAAE,SAAS,UAAU,OAAO,SAAU,GAAG,SAAS;CAExD,MAAM,aAAa,WAClB,SAAS,cAAc,EACvB,EACC,WAAW,gBAAgB,MAC3B,EACD,KACA;AAED,QACC,oBAAC,YAAY;EAAS,OAAO;YAAW,UAAU,QAAQ,WAAW,GAAG,oBAAC;GAAI,GAAI;GAAa;IAAe;GAAwB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HTMLAttributes } from "../../../internal/html-attributes.js";
|
|
2
|
+
import { PropsWithElement } from "../../../internal/props-with-element.js";
|
|
3
|
+
import * as react_jsx_runtime42 from "react/jsx-runtime";
|
|
4
|
+
import { Props } from "@zag-js/tree-view";
|
|
5
|
+
|
|
6
|
+
//#region src/components/tree-view/anatomy/root.d.ts
|
|
7
|
+
interface TreeViewRootProps extends Omit<Props, 'id'>, PropsWithElement<'div'>, HTMLAttributes<'div', 'id' | 'dir' | 'defaultValue'> {}
|
|
8
|
+
declare function Root(props: TreeViewRootProps): react_jsx_runtime42.JSX.Element;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { Root, TreeViewRootProps };
|
|
11
|
+
//# sourceMappingURL=root.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root.d.ts","names":[],"sources":["../../../../src/components/tree-view/anatomy/root.tsx"],"sourcesContent":[],"mappings":";;;;;;UASiB,iBAAA,SACR,KAAK,cACZ,yBACA;iBAEsB,IAAA,QAAY,oBAAiB,mBAAA,CAAA,GAAA,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { RootContext } from "../modules/root-context.js";
|
|
2
|
+
import { useTreeView } from "../modules/provider.js";
|
|
3
|
+
import { mergeProps } from "@zag-js/react";
|
|
4
|
+
import { classesTreeView } from "@skeletonlabs/skeleton-common";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { splitProps } from "@zag-js/tree-view";
|
|
7
|
+
|
|
8
|
+
//#region src/components/tree-view/anatomy/root.tsx
|
|
9
|
+
function Root(props) {
|
|
10
|
+
const [treeViewProps, componentProps] = splitProps(props);
|
|
11
|
+
const { element, children,...rest } = componentProps;
|
|
12
|
+
const treeView = useTreeView(treeViewProps);
|
|
13
|
+
const attributes = mergeProps(treeView.getRootProps(), { className: classesTreeView.root }, rest);
|
|
14
|
+
return /* @__PURE__ */ jsx(RootContext.Provider, {
|
|
15
|
+
value: treeView,
|
|
16
|
+
children: element ? element(attributes) : /* @__PURE__ */ jsx("div", {
|
|
17
|
+
...attributes,
|
|
18
|
+
children
|
|
19
|
+
})
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
export { Root as default };
|
|
25
|
+
//# sourceMappingURL=root.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root.js","names":[],"sources":["../../../../src/components/tree-view/anatomy/root.tsx"],"sourcesContent":["import { useTreeView } from '../modules/provider';\nimport { RootContext } from '../modules/root-context';\nimport type { HTMLAttributes } from '@/internal/html-attributes';\nimport type { PropsWithElement } from '@/internal/props-with-element';\nimport { classesTreeView } from '@skeletonlabs/skeleton-common';\nimport { mergeProps } from '@zag-js/react';\nimport { splitProps } from '@zag-js/tree-view';\nimport type { Props } from '@zag-js/tree-view';\n\nexport interface TreeViewRootProps\n\textends Omit<Props, 'id'>,\n\t\tPropsWithElement<'div'>,\n\t\tHTMLAttributes<'div', 'id' | 'dir' | 'defaultValue'> {}\n\nexport default function Root(props: TreeViewRootProps) {\n\tconst [treeViewProps, componentProps] = splitProps(props);\n\tconst { element, children, ...rest } = componentProps;\n\n\tconst treeView = useTreeView(treeViewProps);\n\n\tconst attributes = mergeProps(\n\t\ttreeView.getRootProps(),\n\t\t{\n\t\t\tclassName: classesTreeView.root,\n\t\t},\n\t\trest,\n\t);\n\n\treturn (\n\t\t<RootContext.Provider value={treeView}>{element ? element(attributes) : <div {...attributes}>{children}</div>}</RootContext.Provider>\n\t);\n}\n"],"mappings":";;;;;;;;AAcA,SAAwB,KAAK,OAA0B;CACtD,MAAM,CAAC,eAAe,kBAAkB,WAAW,MAAM;CACzD,MAAM,EAAE,SAAS,SAAU,GAAG,SAAS;CAEvC,MAAM,WAAW,YAAY,cAAc;CAE3C,MAAM,aAAa,WAClB,SAAS,cAAc,EACvB,EACC,WAAW,gBAAgB,MAC3B,EACD,KACA;AAED,QACC,oBAAC,YAAY;EAAS,OAAO;YAAW,UAAU,QAAQ,WAAW,GAAG,oBAAC;GAAI,GAAI;GAAa;IAAe;GAAwB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HTMLAttributes } from "../../../internal/html-attributes.js";
|
|
2
|
+
import { PropsWithElement } from "../../../internal/props-with-element.js";
|
|
3
|
+
import * as react98 from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/tree-view/anatomy/tree.d.ts
|
|
6
|
+
interface TreeViewTreeProps extends PropsWithElement<'div'>, HTMLAttributes<'div'> {}
|
|
7
|
+
declare function Tree(props: TreeViewTreeProps): react98.JSX.Element;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { Tree, TreeViewTreeProps };
|
|
10
|
+
//# sourceMappingURL=tree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree.d.ts","names":[],"sources":["../../../../src/components/tree-view/anatomy/tree.tsx"],"sourcesContent":[],"mappings":";;;;;UAOiB,iBAAA,SAA0B,yBAAyB;iBAE5C,IAAA,QAAY,oBAAiB,OAAA,CAAA,GAAA,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { RootContext } from "../modules/root-context.js";
|
|
2
|
+
import { use } from "react";
|
|
3
|
+
import { mergeProps } from "@zag-js/react";
|
|
4
|
+
import { classesTreeView } from "@skeletonlabs/skeleton-common";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/components/tree-view/anatomy/tree.tsx
|
|
8
|
+
function Tree(props) {
|
|
9
|
+
const treeView = use(RootContext);
|
|
10
|
+
const { element, children,...rest } = props;
|
|
11
|
+
const attributes = mergeProps(treeView.getTreeProps(), { className: classesTreeView.tree }, rest);
|
|
12
|
+
return element ? element(attributes) : /* @__PURE__ */ jsx("div", {
|
|
13
|
+
...attributes,
|
|
14
|
+
children
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { Tree as default };
|
|
20
|
+
//# sourceMappingURL=tree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree.js","names":[],"sources":["../../../../src/components/tree-view/anatomy/tree.tsx"],"sourcesContent":["import { RootContext } from '../modules/root-context';\nimport type { HTMLAttributes } from '@/internal/html-attributes';\nimport type { PropsWithElement } from '@/internal/props-with-element';\nimport { classesTreeView } from '@skeletonlabs/skeleton-common';\nimport { mergeProps } from '@zag-js/react';\nimport { use } from 'react';\n\nexport interface TreeViewTreeProps extends PropsWithElement<'div'>, HTMLAttributes<'div'> {}\n\nexport default function Tree(props: TreeViewTreeProps) {\n\tconst treeView = use(RootContext);\n\n\tconst { element, children, ...rest } = props;\n\n\tconst attributes = mergeProps(\n\t\ttreeView.getTreeProps(),\n\t\t{\n\t\t\tclassName: classesTreeView.tree,\n\t\t},\n\t\trest,\n\t);\n\n\treturn element ? element(attributes) : <div {...attributes}>{children}</div>;\n}\n"],"mappings":";;;;;;;AASA,SAAwB,KAAK,OAA0B;CACtD,MAAM,WAAW,IAAI,YAAY;CAEjC,MAAM,EAAE,SAAS,SAAU,GAAG,SAAS;CAEvC,MAAM,aAAa,WAClB,SAAS,cAAc,EACvB,EACC,WAAW,gBAAgB,MAC3B,EACD,KACA;AAED,QAAO,UAAU,QAAQ,WAAW,GAAG,oBAAC;EAAI,GAAI;EAAa;GAAe"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Branch } from "../anatomy/branch.js";
|
|
2
|
+
import { BranchContent } from "../anatomy/branch-content.js";
|
|
3
|
+
import { BranchControl } from "../anatomy/branch-control.js";
|
|
4
|
+
import { BranchIndentGuide } from "../anatomy/branch-indent-guide.js";
|
|
5
|
+
import { BranchIndicator } from "../anatomy/branch-indicator.js";
|
|
6
|
+
import { BranchText } from "../anatomy/branch-text.js";
|
|
7
|
+
import { Item } from "../anatomy/item.js";
|
|
8
|
+
import { Label } from "../anatomy/label.js";
|
|
9
|
+
import { NodeProvider } from "../anatomy/node-provider.js";
|
|
10
|
+
import { Root } from "../anatomy/root.js";
|
|
11
|
+
import { RootContext } from "../anatomy/root-context.js";
|
|
12
|
+
import { RootProvider } from "../anatomy/root-provider.js";
|
|
13
|
+
import { Tree } from "../anatomy/tree.js";
|
|
14
|
+
|
|
15
|
+
//#region src/components/tree-view/modules/anatomy.d.ts
|
|
16
|
+
declare const TreeView: typeof Root & {
|
|
17
|
+
Provider: typeof RootProvider;
|
|
18
|
+
Context: typeof RootContext;
|
|
19
|
+
Tree: typeof Tree;
|
|
20
|
+
Label: typeof Label;
|
|
21
|
+
NodeProvider: typeof NodeProvider;
|
|
22
|
+
Branch: typeof Branch;
|
|
23
|
+
BranchControl: typeof BranchControl;
|
|
24
|
+
BranchText: typeof BranchText;
|
|
25
|
+
BranchIndicator: typeof BranchIndicator;
|
|
26
|
+
BranchContent: typeof BranchContent;
|
|
27
|
+
BranchIndentGuide: typeof BranchIndentGuide;
|
|
28
|
+
Item: typeof Item;
|
|
29
|
+
};
|
|
30
|
+
//#endregion
|
|
31
|
+
export { TreeView };
|
|
32
|
+
//# sourceMappingURL=anatomy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anatomy.d.ts","names":[],"sources":["../../../../src/components/tree-view/modules/anatomy.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;cAca,iBAAQ;;EAAR,OAAA,EAAA,kBAaX;EAAA,IAAA,EAAA,WAAA;OAbmB,EAAA,YAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import Branch from "../anatomy/branch.js";
|
|
2
|
+
import BranchContent from "../anatomy/branch-content.js";
|
|
3
|
+
import BranchControl from "../anatomy/branch-control.js";
|
|
4
|
+
import BranchIndentGuide from "../anatomy/branch-indent-guide.js";
|
|
5
|
+
import BranchIndicator from "../anatomy/branch-indicator.js";
|
|
6
|
+
import BranchText from "../anatomy/branch-text.js";
|
|
7
|
+
import Item from "../anatomy/item.js";
|
|
8
|
+
import Label from "../anatomy/label.js";
|
|
9
|
+
import NodeProvider from "../anatomy/node-provider.js";
|
|
10
|
+
import Root from "../anatomy/root.js";
|
|
11
|
+
import RootContext from "../anatomy/root-context.js";
|
|
12
|
+
import RootProvider from "../anatomy/root-provider.js";
|
|
13
|
+
import Tree from "../anatomy/tree.js";
|
|
14
|
+
|
|
15
|
+
//#region src/components/tree-view/modules/anatomy.ts
|
|
16
|
+
const TreeView = Object.assign(Root, {
|
|
17
|
+
Provider: RootProvider,
|
|
18
|
+
Context: RootContext,
|
|
19
|
+
Tree,
|
|
20
|
+
Label,
|
|
21
|
+
NodeProvider,
|
|
22
|
+
Branch,
|
|
23
|
+
BranchControl,
|
|
24
|
+
BranchText,
|
|
25
|
+
BranchIndicator,
|
|
26
|
+
BranchContent,
|
|
27
|
+
BranchIndentGuide,
|
|
28
|
+
Item
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
export { TreeView };
|
|
33
|
+
//# sourceMappingURL=anatomy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anatomy.js","names":[],"sources":["../../../../src/components/tree-view/modules/anatomy.ts"],"sourcesContent":["import Branch from '../anatomy/branch';\nimport BranchContent from '../anatomy/branch-content';\nimport BranchControl from '../anatomy/branch-control';\nimport BranchIndentGuide from '../anatomy/branch-indent-guide';\nimport BranchIndicator from '../anatomy/branch-indicator';\nimport BranchText from '../anatomy/branch-text';\nimport Item from '../anatomy/item';\nimport Label from '../anatomy/label';\nimport NodeProvider from '../anatomy/node-provider';\nimport Root from '../anatomy/root';\nimport RootContext from '../anatomy/root-context';\nimport RootProvider from '../anatomy/root-provider';\nimport Tree from '../anatomy/tree';\n\nexport const TreeView = Object.assign(Root, {\n\tProvider: RootProvider,\n\tContext: RootContext,\n\tTree: Tree,\n\tLabel: Label,\n\tNodeProvider: NodeProvider,\n\tBranch: Branch,\n\tBranchControl: BranchControl,\n\tBranchText: BranchText,\n\tBranchIndicator: BranchIndicator,\n\tBranchContent: BranchContent,\n\tBranchIndentGuide: BranchIndentGuide,\n\tItem: Item,\n});\n"],"mappings":";;;;;;;;;;;;;;;AAcA,MAAa,WAAW,OAAO,OAAO,MAAM;CAC3C,UAAU;CACV,SAAS;CACH;CACC;CACO;CACN;CACO;CACH;CACK;CACF;CACI;CACb;CACN,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { collection } from "@zag-js/tree-view";
|
|
2
|
+
import * as _zag_js_collection0 from "@zag-js/collection";
|
|
3
|
+
|
|
4
|
+
//#region src/components/tree-view/modules/create-tree-view-collection.d.ts
|
|
5
|
+
declare function createTreeViewCollection<T>(...args: Parameters<typeof collection<T>>): _zag_js_collection0.TreeCollection<T>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { createTreeViewCollection };
|
|
8
|
+
//# sourceMappingURL=create-tree-view-collection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-tree-view-collection.d.ts","names":[],"sources":["../../../../src/components/tree-view/modules/create-tree-view-collection.ts"],"sourcesContent":[],"mappings":";;;;iBAEgB,qCAAqC,kBAAkB,WAAW,MAAG,mBAAA,CAAA,eAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { collection } from "@zag-js/tree-view";
|
|
2
|
+
|
|
3
|
+
//#region src/components/tree-view/modules/create-tree-view-collection.ts
|
|
4
|
+
function createTreeViewCollection(...args) {
|
|
5
|
+
return collection(...args);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
//#endregion
|
|
9
|
+
export { createTreeViewCollection };
|
|
10
|
+
//# sourceMappingURL=create-tree-view-collection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-tree-view-collection.js","names":[],"sources":["../../../../src/components/tree-view/modules/create-tree-view-collection.ts"],"sourcesContent":["import { collection } from '@zag-js/tree-view';\n\nexport function createTreeViewCollection<T>(...args: Parameters<typeof collection<T>>) {\n\treturn collection(...args);\n}\n"],"mappings":";;;AAEA,SAAgB,yBAA4B,GAAG,MAAwC;AACtF,QAAO,WAAW,GAAG,KAAK"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-context.js","names":[],"sources":["../../../../src/components/tree-view/modules/node-context.ts"],"sourcesContent":["import { createContext } from '@/internal/create-context';\nimport type { NodeProps } from '@zag-js/tree-view';\n\nexport const NodeContext = createContext<NodeProps>();\n"],"mappings":";;;AAGA,MAAa,cAAc,eAA0B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PropTypes } from "@zag-js/react";
|
|
2
|
+
import { Api, Props } from "@zag-js/tree-view";
|
|
3
|
+
|
|
4
|
+
//#region src/components/tree-view/modules/provider.d.ts
|
|
5
|
+
declare function useTreeView(props?: Omit<Props, 'id'>): Api<PropTypes>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { useTreeView };
|
|
8
|
+
//# sourceMappingURL=provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.d.ts","names":[],"sources":["../../../../src/components/tree-view/modules/provider.ts"],"sourcesContent":[],"mappings":";;;;iBAKgB,WAAA,SAAmB,KAAK,eAAoB,IAAI"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useId } from "react";
|
|
2
|
+
import { normalizeProps, useMachine } from "@zag-js/react";
|
|
3
|
+
import { connect, machine } from "@zag-js/tree-view";
|
|
4
|
+
|
|
5
|
+
//#region src/components/tree-view/modules/provider.ts
|
|
6
|
+
function useTreeView(props = {}) {
|
|
7
|
+
const service = useMachine(machine, {
|
|
8
|
+
id: useId(),
|
|
9
|
+
...props
|
|
10
|
+
});
|
|
11
|
+
return connect(service, normalizeProps);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { useTreeView };
|
|
16
|
+
//# sourceMappingURL=provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.js","names":[],"sources":["../../../../src/components/tree-view/modules/provider.ts"],"sourcesContent":["import { normalizeProps, useMachine, type PropTypes } from '@zag-js/react';\nimport { connect, machine } from '@zag-js/tree-view';\nimport type { Api, Props } from '@zag-js/tree-view';\nimport { useId } from 'react';\n\nexport function useTreeView(props: Omit<Props, 'id'> = {}): Api<PropTypes> {\n\tconst service = useMachine(machine, {\n\t\tid: useId(),\n\t\t...props,\n\t});\n\treturn connect(service, normalizeProps);\n}\n"],"mappings":";;;;;AAKA,SAAgB,YAAY,QAA2B,EAAE,EAAkB;CAC1E,MAAM,UAAU,WAAW,SAAS;EACnC,IAAI,OAAO;EACX,GAAG;EACH,CAAC;AACF,QAAO,QAAQ,SAAS,eAAe"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root-context.js","names":[],"sources":["../../../../src/components/tree-view/modules/root-context.ts"],"sourcesContent":["import type { useTreeView } from './provider';\nimport { createContext } from '@/internal/create-context';\n\nexport const RootContext = createContext<ReturnType<typeof useTreeView>>();\n"],"mappings":";;;AAGA,MAAa,cAAc,eAA+C"}
|