@elliemae/ds-left-navigation-tree 0.0.0-stage → 3.80.0-next.38

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 (107) hide show
  1. package/dist/cjs/DSLeftNavigationTree.js +46 -0
  2. package/dist/cjs/DSLeftNavigationTree.js.map +7 -0
  3. package/dist/cjs/config/store.js +63 -0
  4. package/dist/cjs/config/store.js.map +7 -0
  5. package/dist/cjs/config/treeModel.js +178 -0
  6. package/dist/cjs/config/treeModel.js.map +7 -0
  7. package/dist/cjs/config/useAutoCalculated.js +37 -0
  8. package/dist/cjs/config/useAutoCalculated.js.map +7 -0
  9. package/dist/cjs/config/useFocusTracker.js +63 -0
  10. package/dist/cjs/config/useFocusTracker.js.map +7 -0
  11. package/dist/cjs/config/useTreeHandlers.js +157 -0
  12. package/dist/cjs/config/useTreeHandlers.js.map +7 -0
  13. package/dist/cjs/config/useTreeModel.js +110 -0
  14. package/dist/cjs/config/useTreeModel.js.map +7 -0
  15. package/dist/cjs/config/useValidateProps.js +40 -0
  16. package/dist/cjs/config/useValidateProps.js.map +7 -0
  17. package/dist/cjs/constants/index.js +79 -0
  18. package/dist/cjs/constants/index.js.map +7 -0
  19. package/dist/cjs/index.js +46 -0
  20. package/dist/cjs/index.js.map +7 -0
  21. package/dist/cjs/package.json +7 -0
  22. package/dist/cjs/parts/Footer.js +83 -0
  23. package/dist/cjs/parts/Footer.js.map +7 -0
  24. package/dist/cjs/parts/Header.js +114 -0
  25. package/dist/cjs/parts/Header.js.map +7 -0
  26. package/dist/cjs/parts/MainContent.js +95 -0
  27. package/dist/cjs/parts/MainContent.js.map +7 -0
  28. package/dist/cjs/parts/RailItem.js +109 -0
  29. package/dist/cjs/parts/RailItem.js.map +7 -0
  30. package/dist/cjs/parts/TreeContext.js +37 -0
  31. package/dist/cjs/parts/TreeContext.js.map +7 -0
  32. package/dist/cjs/parts/TreeItem.js +171 -0
  33. package/dist/cjs/parts/TreeItem.js.map +7 -0
  34. package/dist/cjs/parts/TreeRoot.js +76 -0
  35. package/dist/cjs/parts/TreeRoot.js.map +7 -0
  36. package/dist/cjs/parts/styled.js +221 -0
  37. package/dist/cjs/parts/styled.js.map +7 -0
  38. package/dist/cjs/react-desc-prop-types.js +125 -0
  39. package/dist/cjs/react-desc-prop-types.js.map +7 -0
  40. package/dist/cjs/typescript-testing/DSLeftNavigationTreeNamespace.js +172 -0
  41. package/dist/cjs/typescript-testing/DSLeftNavigationTreeNamespace.js.map +7 -0
  42. package/dist/cjs/typescript-testing/slot-props.js +82 -0
  43. package/dist/cjs/typescript-testing/slot-props.js.map +7 -0
  44. package/dist/esm/DSLeftNavigationTree.js +16 -0
  45. package/dist/esm/DSLeftNavigationTree.js.map +7 -0
  46. package/dist/esm/config/store.js +33 -0
  47. package/dist/esm/config/store.js.map +7 -0
  48. package/dist/esm/config/treeModel.js +148 -0
  49. package/dist/esm/config/treeModel.js.map +7 -0
  50. package/dist/esm/config/useAutoCalculated.js +7 -0
  51. package/dist/esm/config/useAutoCalculated.js.map +7 -0
  52. package/dist/esm/config/useFocusTracker.js +33 -0
  53. package/dist/esm/config/useFocusTracker.js.map +7 -0
  54. package/dist/esm/config/useTreeHandlers.js +133 -0
  55. package/dist/esm/config/useTreeHandlers.js.map +7 -0
  56. package/dist/esm/config/useTreeModel.js +90 -0
  57. package/dist/esm/config/useTreeModel.js.map +7 -0
  58. package/dist/esm/config/useValidateProps.js +10 -0
  59. package/dist/esm/config/useValidateProps.js.map +7 -0
  60. package/dist/esm/constants/index.js +49 -0
  61. package/dist/esm/constants/index.js.map +7 -0
  62. package/dist/esm/index.js +25 -0
  63. package/dist/esm/index.js.map +7 -0
  64. package/dist/esm/package.json +7 -0
  65. package/dist/esm/parts/Footer.js +53 -0
  66. package/dist/esm/parts/Footer.js.map +7 -0
  67. package/dist/esm/parts/Header.js +91 -0
  68. package/dist/esm/parts/Header.js.map +7 -0
  69. package/dist/esm/parts/MainContent.js +69 -0
  70. package/dist/esm/parts/MainContent.js.map +7 -0
  71. package/dist/esm/parts/RailItem.js +79 -0
  72. package/dist/esm/parts/RailItem.js.map +7 -0
  73. package/dist/esm/parts/TreeContext.js +7 -0
  74. package/dist/esm/parts/TreeContext.js.map +7 -0
  75. package/dist/esm/parts/TreeItem.js +149 -0
  76. package/dist/esm/parts/TreeItem.js.map +7 -0
  77. package/dist/esm/parts/TreeRoot.js +46 -0
  78. package/dist/esm/parts/TreeRoot.js.map +7 -0
  79. package/dist/esm/parts/styled.js +191 -0
  80. package/dist/esm/parts/styled.js.map +7 -0
  81. package/dist/esm/react-desc-prop-types.js +105 -0
  82. package/dist/esm/react-desc-prop-types.js.map +7 -0
  83. package/dist/esm/typescript-testing/DSLeftNavigationTreeNamespace.js +149 -0
  84. package/dist/esm/typescript-testing/DSLeftNavigationTreeNamespace.js.map +7 -0
  85. package/dist/esm/typescript-testing/slot-props.js +59 -0
  86. package/dist/esm/typescript-testing/slot-props.js.map +7 -0
  87. package/dist/types/DSLeftNavigationTree.d.ts +4 -0
  88. package/dist/types/config/store.d.ts +38 -0
  89. package/dist/types/config/treeModel.d.ts +69 -0
  90. package/dist/types/config/useAutoCalculated.d.ts +1 -0
  91. package/dist/types/config/useFocusTracker.d.ts +11 -0
  92. package/dist/types/config/useTreeHandlers.d.ts +11 -0
  93. package/dist/types/config/useTreeModel.d.ts +22 -0
  94. package/dist/types/config/useValidateProps.d.ts +3 -0
  95. package/dist/types/constants/index.d.ts +54 -0
  96. package/dist/types/index.d.ts +3 -0
  97. package/dist/types/parts/Footer.d.ts +2 -0
  98. package/dist/types/parts/Header.d.ts +2 -0
  99. package/dist/types/parts/MainContent.d.ts +2 -0
  100. package/dist/types/parts/RailItem.d.ts +8 -0
  101. package/dist/types/parts/TreeContext.d.ts +11 -0
  102. package/dist/types/parts/TreeItem.d.ts +4 -0
  103. package/dist/types/parts/TreeRoot.d.ts +9 -0
  104. package/dist/types/parts/styled.d.ts +46 -0
  105. package/dist/types/react-desc-prop-types.d.ts +99 -0
  106. package/package.json +72 -4
  107. package/README.md +0 -3
@@ -0,0 +1,149 @@
1
+ import * as React from "react";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { DSLeftNavigationTree, LEFT_NAVIGATION_TREE_ITEM_TYPES } from "../index.js";
4
+ const Icon = (_props) => /* @__PURE__ */ jsx("svg", { "aria-hidden": "true" });
5
+ const Badge = ({ item }) => /* @__PURE__ */ jsx("span", { children: item.dsId });
6
+ const items = [
7
+ {
8
+ dsId: "pipeline",
9
+ type: LEFT_NAVIGATION_TREE_ITEM_TYPES.LEAF,
10
+ CollapsedComponent: Icon,
11
+ itemOpts: { label: "Pipeline" }
12
+ },
13
+ {
14
+ dsId: "loan",
15
+ type: LEFT_NAVIGATION_TREE_ITEM_TYPES.PARENT,
16
+ CollapsedComponent: Icon,
17
+ itemOpts: {
18
+ label: "Loan",
19
+ startOpened: true,
20
+ RightComponent: Badge,
21
+ items: [{ dsId: "borrower", type: LEFT_NAVIGATION_TREE_ITEM_TYPES.LEAF, itemOpts: { label: "Borrower" } }]
22
+ }
23
+ },
24
+ { dsId: "separator", type: LEFT_NAVIGATION_TREE_ITEM_TYPES.SEPARATOR },
25
+ {
26
+ dsId: "tools",
27
+ type: LEFT_NAVIGATION_TREE_ITEM_TYPES.SECTION,
28
+ itemOpts: {
29
+ label: "Tools",
30
+ items: [
31
+ { dsId: "calculator", type: LEFT_NAVIGATION_TREE_ITEM_TYPES.LEAF, itemOpts: { label: "Calculator" } },
32
+ {
33
+ dsId: "contact-us",
34
+ type: LEFT_NAVIGATION_TREE_ITEM_TYPES.LEAF,
35
+ itemOpts: { label: "Contact us", selectable: false, labelOverflow: "wrapAll" }
36
+ }
37
+ ]
38
+ }
39
+ }
40
+ ];
41
+ const controlledParent = {
42
+ dsId: "controlled",
43
+ type: LEFT_NAVIGATION_TREE_ITEM_TYPES.PARENT,
44
+ itemOpts: { label: "Controlled", isOpened: false, items: [] }
45
+ };
46
+ const header = {
47
+ dsId: "header",
48
+ type: LEFT_NAVIGATION_TREE_ITEM_TYPES.LEAF,
49
+ itemOpts: { label: "Loan summary" }
50
+ };
51
+ const testRequiredProps = {};
52
+ const testOptionalProps = {
53
+ selectedItem: "borrower",
54
+ selectedParent: "loan",
55
+ HeaderComponent: header,
56
+ dsLeftnavigationtreeRoot: {
57
+ onClick: () => {
58
+ },
59
+ "data-testid": "over-ride-test-id",
60
+ "aria-label": "over-ride-aria-label"
61
+ }
62
+ };
63
+ const testPartialDefaults = {
64
+ items: [...items, controlledParent],
65
+ expanded: true
66
+ };
67
+ const testProps = {
68
+ ...testRequiredProps,
69
+ ...testOptionalProps,
70
+ ...testPartialDefaults
71
+ };
72
+ const testPropsAsSyntax = {
73
+ ...testRequiredProps,
74
+ ...testOptionalProps,
75
+ ...testPartialDefaults
76
+ };
77
+ const testCompleteDefaults = {
78
+ items,
79
+ expanded: false,
80
+ expandedWidth: "240px",
81
+ labelOverflow: "wrapAll",
82
+ footerLabel: "v1.0",
83
+ disableDefaultSelection: false,
84
+ openedItem: null,
85
+ onItemClick: (item, e) => {
86
+ },
87
+ onItemOpenedChange: (item, nextIsOpened, e) => {
88
+ },
89
+ onSelectedChange: (id) => {
90
+ },
91
+ onFocusChange: (id) => {
92
+ },
93
+ onFooterExpand: (e) => {
94
+ },
95
+ onFooterClose: (e) => {
96
+ }
97
+ };
98
+ const testInternalProps = {
99
+ ...testRequiredProps,
100
+ ...testOptionalProps,
101
+ ...testCompleteDefaults
102
+ };
103
+ const testInternalPropsAsSyntax = {
104
+ ...testRequiredProps,
105
+ ...testOptionalProps,
106
+ ...testCompleteDefaults
107
+ };
108
+ const itemSlot = ({ item, isCurrent }) => ({
109
+ "data-testid": isCurrent ? `current-${item.dsId}` : item.dsId
110
+ });
111
+ const testExplicitDefinition = {
112
+ items,
113
+ selectedItem: null,
114
+ labelOverflow: "wrap",
115
+ onItemOpenedChange: (item, nextIsOpened) => {
116
+ },
117
+ dsLeftnavigationtreeItem: itemSlot
118
+ };
119
+ const testInferedTypeCompatibility = {
120
+ items,
121
+ expanded: true,
122
+ footerLabel: /* @__PURE__ */ jsx("span", { children: "v1.0" })
123
+ };
124
+ const testDefinitionAsConst = {
125
+ items,
126
+ labelOverflow: "wrapAll",
127
+ openedItem: "header"
128
+ };
129
+ const ExampleUsageComponent = () => /* @__PURE__ */ jsxs(Fragment, { children: [
130
+ /* @__PURE__ */ jsx(DSLeftNavigationTree, { ...testExplicitDefinition }),
131
+ /* @__PURE__ */ jsx(
132
+ DSLeftNavigationTree,
133
+ {
134
+ items,
135
+ expanded: true,
136
+ selectedItem: "borrower",
137
+ HeaderComponent: header,
138
+ openedItem: null,
139
+ onItemClick: (item, e) => {
140
+ },
141
+ onSelectedChange: (id) => {
142
+ },
143
+ "aria-label": "Loan"
144
+ }
145
+ ),
146
+ /* @__PURE__ */ jsx(DSLeftNavigationTree, { ...testInferedTypeCompatibility }),
147
+ /* @__PURE__ */ jsx(DSLeftNavigationTree, { ...testDefinitionAsConst })
148
+ ] });
149
+ //# sourceMappingURL=DSLeftNavigationTreeNamespace.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/DSLeftNavigationTreeNamespace.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport { DSLeftNavigationTree, LEFT_NAVIGATION_TREE_ITEM_TYPES, type DSLeftNavigationTreeT } from '../index.js';\n\n// test we expose the namespace and the namespace follows our deliverable conventions\ntype ComponentPropsForApp = DSLeftNavigationTreeT.Props;\ntype ComponentPropsInternals = DSLeftNavigationTreeT.InternalProps;\ntype ComponentPropsDefaultProps = DSLeftNavigationTreeT.DefaultProps;\ntype ComponentPropsOptionalProps = DSLeftNavigationTreeT.OptionalProps;\ntype ComponentPropsRequiredProps = DSLeftNavigationTreeT.RequiredProps;\n\nconst Icon = (_props: DSLeftNavigationTreeT.ItemComponentProps) => <svg aria-hidden=\"true\" />;\nconst Badge = ({ item }: DSLeftNavigationTreeT.ItemComponentProps) => <span>{item.dsId}</span>;\n\nconst items: DSLeftNavigationTreeT.Item[] = [\n {\n dsId: 'pipeline',\n type: LEFT_NAVIGATION_TREE_ITEM_TYPES.LEAF,\n CollapsedComponent: Icon,\n itemOpts: { label: 'Pipeline' },\n },\n {\n dsId: 'loan',\n type: LEFT_NAVIGATION_TREE_ITEM_TYPES.PARENT,\n CollapsedComponent: Icon,\n itemOpts: {\n label: 'Loan',\n startOpened: true,\n RightComponent: Badge,\n items: [{ dsId: 'borrower', type: LEFT_NAVIGATION_TREE_ITEM_TYPES.LEAF, itemOpts: { label: 'Borrower' } }],\n },\n },\n { dsId: 'separator', type: LEFT_NAVIGATION_TREE_ITEM_TYPES.SEPARATOR },\n {\n dsId: 'tools',\n type: LEFT_NAVIGATION_TREE_ITEM_TYPES.SECTION,\n itemOpts: {\n label: 'Tools',\n items: [\n { dsId: 'calculator', type: LEFT_NAVIGATION_TREE_ITEM_TYPES.LEAF, itemOpts: { label: 'Calculator' } },\n {\n dsId: 'contact-us',\n type: LEFT_NAVIGATION_TREE_ITEM_TYPES.LEAF,\n itemOpts: { label: 'Contact us', selectable: false, labelOverflow: 'wrapAll' },\n },\n ],\n },\n },\n];\n\nconst controlledParent = {\n dsId: 'controlled',\n type: LEFT_NAVIGATION_TREE_ITEM_TYPES.PARENT,\n itemOpts: { label: 'Controlled', isOpened: false, items: [] },\n} as const;\n\nconst header = {\n dsId: 'header',\n type: LEFT_NAVIGATION_TREE_ITEM_TYPES.LEAF,\n itemOpts: { label: 'Loan summary' },\n} as DSLeftNavigationTreeT.Item;\n\nconst testRequiredProps: ComponentPropsRequiredProps = {};\n\nconst testOptionalProps: ComponentPropsOptionalProps = {\n selectedItem: 'borrower',\n selectedParent: 'loan',\n HeaderComponent: header,\n dsLeftnavigationtreeRoot: {\n onClick: () => {},\n 'data-testid': 'over-ride-test-id',\n 'aria-label': 'over-ride-aria-label',\n },\n};\n\n// difference Props and InternalProps is that InternalProps has all the default props filled in\n// Props allows for partial defaults\nconst testPartialDefaults: Partial<ComponentPropsDefaultProps> = {\n items: [...items, controlledParent],\n expanded: true,\n};\n\nconst testProps: ComponentPropsForApp = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n};\n\nconst testPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n\n// InternalProps requires all defaults to be filled in\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = {\n items,\n expanded: false,\n expandedWidth: '240px',\n labelOverflow: 'wrapAll',\n footerLabel: 'v1.0',\n disableDefaultSelection: false,\n openedItem: null,\n onItemClick: (item, e) => {},\n onItemOpenedChange: (item, nextIsOpened, e) => {},\n onSelectedChange: (id) => {},\n onFocusChange: (id) => {},\n onFooterExpand: (e) => {},\n onFooterClose: (e) => {},\n};\n\nconst testInternalProps: ComponentPropsInternals = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n};\n\nconst testInternalPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n} as ComponentPropsInternals;\n\n// per-node slot functions receive { item, level, isOpen, isCurrent }; consumers type them through SlotFunctionArguments\nconst itemSlot: DSLeftNavigationTreeT.SlotFunctionArguments['dsLeftnavigationtreeItem'] = ({ item, isCurrent }) => ({\n 'data-testid': isCurrent ? `current-${item.dsId}` : item.dsId,\n});\n\n// using the explicit type definition, if there is an error, it will be marked on the key that is wrong\nconst testExplicitDefinition: ComponentPropsForApp = {\n items,\n selectedItem: null,\n labelOverflow: 'wrap',\n onItemOpenedChange: (item, nextIsOpened) => {},\n dsLeftnavigationtreeItem: itemSlot,\n};\n\n// using the \"as\" syntax, if there is an error, it will be marking the whole object as wrong because it is not compatible with the type\nconst testInferedTypeCompatibility = {\n items,\n expanded: true,\n footerLabel: <span>v1.0</span>,\n} as ComponentPropsForApp;\n\nconst testDefinitionAsConst = {\n items,\n labelOverflow: 'wrapAll',\n openedItem: 'header',\n} as const;\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with spread operator */}\n <DSLeftNavigationTree {...testExplicitDefinition} />\n {/* works with inline values */}\n <DSLeftNavigationTree\n items={items}\n expanded\n selectedItem=\"borrower\"\n HeaderComponent={header}\n openedItem={null}\n onItemClick={(item, e) => {}}\n onSelectedChange={(id) => {}}\n aria-label=\"Loan\"\n />\n <DSLeftNavigationTree {...testInferedTypeCompatibility} />\n <DSLeftNavigationTree {...testDefinitionAsConst} />\n </>\n);\n"],
5
+ "mappings": "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",
6
+ "names": []
7
+ }
@@ -0,0 +1,59 @@
1
+ import * as React from "react";
2
+ const SlotPropsAsObject = {
3
+ dsLeftnavigationtreeRoot: { "aria-label": "just a typescript test" },
4
+ dsLeftnavigationtreeTree: { "aria-label": "just a typescript test" },
5
+ dsLeftnavigationtreeItem: { "aria-label": "just a typescript test" },
6
+ dsLeftnavigationtreeItemRow: { "aria-label": "just a typescript test" },
7
+ dsLeftnavigationtreeItemLabel: { "aria-label": "just a typescript test" },
8
+ dsLeftnavigationtreeLeftContainer: { "aria-label": "just a typescript test" },
9
+ dsLeftnavigationtreeCollapsedContainer: { "aria-label": "just a typescript test" },
10
+ dsLeftnavigationtreeRightContainer: { "aria-label": "just a typescript test" },
11
+ dsLeftnavigationtreeArrowContainer: { "aria-label": "just a typescript test" },
12
+ dsLeftnavigationtreeGroup: { "aria-label": "just a typescript test" },
13
+ dsLeftnavigationtreeSectionContainer: { "aria-label": "just a typescript test" },
14
+ dsLeftnavigationtreeSectionLabel: { "aria-label": "just a typescript test" },
15
+ dsLeftnavigationtreeItemSeparator: { "aria-label": "just a typescript test" },
16
+ dsLeftnavigationtreeHeaderDisclosure: { "aria-label": "just a typescript test" },
17
+ dsLeftnavigationtreeFooterMenu: { "aria-label": "just a typescript test" },
18
+ dsLeftnavigationtreeFooterLabel: { "aria-label": "just a typescript test" },
19
+ dsLeftnavigationtreeFooterSeparator: { "aria-label": "just a typescript test" },
20
+ dsLeftnavigationtreeFooterMenuCollapse: { "aria-label": "just a typescript test" }
21
+ };
22
+ const SlotPropsAsFunctions = {
23
+ dsLeftnavigationtreeRoot: () => ({ "aria-label": "just a typescript test" }),
24
+ dsLeftnavigationtreeTree: () => ({ "aria-label": "just a typescript test" }),
25
+ dsLeftnavigationtreeItem: ({ item, level, isOpen, isCurrent }) => ({
26
+ "aria-label": `${item.dsId} ${level} ${isOpen} ${isCurrent}`
27
+ }),
28
+ dsLeftnavigationtreeItemRow: ({ item, level, isOpen, isCurrent }) => ({
29
+ "aria-label": `${item.dsId} ${level} ${isOpen} ${isCurrent}`
30
+ }),
31
+ dsLeftnavigationtreeItemLabel: ({ item, level, isOpen, isCurrent }) => ({
32
+ "aria-label": `${item.dsId} ${level} ${isOpen} ${isCurrent}`
33
+ }),
34
+ dsLeftnavigationtreeLeftContainer: ({ item, level, isOpen, isCurrent }) => ({
35
+ "aria-label": `${item.dsId} ${level} ${isOpen} ${isCurrent}`
36
+ }),
37
+ dsLeftnavigationtreeCollapsedContainer: ({ item, level, isOpen, isCurrent }) => ({
38
+ "aria-label": `${item.dsId} ${level} ${isOpen} ${isCurrent}`
39
+ }),
40
+ dsLeftnavigationtreeRightContainer: ({ item, level, isOpen, isCurrent }) => ({
41
+ "aria-label": `${item.dsId} ${level} ${isOpen} ${isCurrent}`
42
+ }),
43
+ dsLeftnavigationtreeArrowContainer: ({ item, level, isOpen, isCurrent }) => ({
44
+ "aria-label": `${item.dsId} ${level} ${isOpen} ${isCurrent}`
45
+ }),
46
+ dsLeftnavigationtreeGroup: ({ item, level, isOpen, isCurrent }) => ({
47
+ "aria-label": `${item.dsId} ${level} ${isOpen} ${isCurrent}`
48
+ }),
49
+ dsLeftnavigationtreeSectionContainer: () => ({ "aria-label": "just a typescript test" }),
50
+ dsLeftnavigationtreeSectionLabel: () => ({ "aria-label": "just a typescript test" }),
51
+ dsLeftnavigationtreeItemSeparator: () => ({ "aria-label": "just a typescript test" }),
52
+ dsLeftnavigationtreeHeaderDisclosure: () => ({ "aria-label": "just a typescript test" }),
53
+ dsLeftnavigationtreeFooterMenu: () => ({ "aria-label": "just a typescript test" }),
54
+ dsLeftnavigationtreeFooterLabel: () => ({ "aria-label": "just a typescript test" }),
55
+ dsLeftnavigationtreeFooterSeparator: () => ({ "aria-label": "just a typescript test" }),
56
+ dsLeftnavigationtreeFooterMenuCollapse: () => ({ "aria-label": "just a typescript test" })
57
+ };
58
+ const EnsureAllSlotsExistInSlotFunctionArguments = SlotPropsAsFunctions;
59
+ //# sourceMappingURL=slot-props.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/slot-props.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\n\nimport type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type { DSLeftNavigationTreeName, LEFT_NAVIGATION_TREE_SLOTS } from '../constants/index.js';\nimport type { DSLeftNavigationTreeT } from '../react-desc-prop-types.js';\n\nconst SlotPropsAsObject: Partial<DSLeftNavigationTreeT.Props> = {\n dsLeftnavigationtreeRoot: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationtreeTree: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationtreeItem: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationtreeItemRow: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationtreeItemLabel: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationtreeLeftContainer: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationtreeCollapsedContainer: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationtreeRightContainer: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationtreeArrowContainer: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationtreeGroup: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationtreeSectionContainer: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationtreeSectionLabel: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationtreeItemSeparator: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationtreeHeaderDisclosure: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationtreeFooterMenu: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationtreeFooterLabel: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationtreeFooterSeparator: { 'aria-label': 'just a typescript test' },\n dsLeftnavigationtreeFooterMenuCollapse: { 'aria-label': 'just a typescript test' },\n};\n\nconst SlotPropsAsFunctions: DSLeftNavigationTreeT.SlotFunctionArguments = {\n dsLeftnavigationtreeRoot: () => ({ 'aria-label': 'just a typescript test' }),\n dsLeftnavigationtreeTree: () => ({ 'aria-label': 'just a typescript test' }),\n dsLeftnavigationtreeItem: ({ item, level, isOpen, isCurrent }) => ({\n 'aria-label': `${item.dsId} ${level} ${isOpen} ${isCurrent}`,\n }),\n dsLeftnavigationtreeItemRow: ({ item, level, isOpen, isCurrent }) => ({\n 'aria-label': `${item.dsId} ${level} ${isOpen} ${isCurrent}`,\n }),\n dsLeftnavigationtreeItemLabel: ({ item, level, isOpen, isCurrent }) => ({\n 'aria-label': `${item.dsId} ${level} ${isOpen} ${isCurrent}`,\n }),\n dsLeftnavigationtreeLeftContainer: ({ item, level, isOpen, isCurrent }) => ({\n 'aria-label': `${item.dsId} ${level} ${isOpen} ${isCurrent}`,\n }),\n dsLeftnavigationtreeCollapsedContainer: ({ item, level, isOpen, isCurrent }) => ({\n 'aria-label': `${item.dsId} ${level} ${isOpen} ${isCurrent}`,\n }),\n dsLeftnavigationtreeRightContainer: ({ item, level, isOpen, isCurrent }) => ({\n 'aria-label': `${item.dsId} ${level} ${isOpen} ${isCurrent}`,\n }),\n dsLeftnavigationtreeArrowContainer: ({ item, level, isOpen, isCurrent }) => ({\n 'aria-label': `${item.dsId} ${level} ${isOpen} ${isCurrent}`,\n }),\n dsLeftnavigationtreeGroup: ({ item, level, isOpen, isCurrent }) => ({\n 'aria-label': `${item.dsId} ${level} ${isOpen} ${isCurrent}`,\n }),\n dsLeftnavigationtreeSectionContainer: () => ({ 'aria-label': 'just a typescript test' }),\n dsLeftnavigationtreeSectionLabel: () => ({ 'aria-label': 'just a typescript test' }),\n dsLeftnavigationtreeItemSeparator: () => ({ 'aria-label': 'just a typescript test' }),\n dsLeftnavigationtreeHeaderDisclosure: () => ({ 'aria-label': 'just a typescript test' }),\n dsLeftnavigationtreeFooterMenu: () => ({ 'aria-label': 'just a typescript test' }),\n dsLeftnavigationtreeFooterLabel: () => ({ 'aria-label': 'just a typescript test' }),\n dsLeftnavigationtreeFooterSeparator: () => ({ 'aria-label': 'just a typescript test' }),\n dsLeftnavigationtreeFooterMenuCollapse: () => ({ 'aria-label': 'just a typescript test' }),\n};\n\n// Exhaustiveness check \u2014 fails compilation if a slot is missing from SlotFunctionArguments\nconst EnsureAllSlotsExistInSlotFunctionArguments: Required<\n TypescriptHelpersT.PropsForSlots<typeof DSLeftNavigationTreeName, typeof LEFT_NAVIGATION_TREE_SLOTS>\n> = SlotPropsAsFunctions;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACMvB,MAAM,oBAA0D;AAAA,EAC9D,0BAA0B,EAAE,cAAc,yBAAyB;AAAA,EACnE,0BAA0B,EAAE,cAAc,yBAAyB;AAAA,EACnE,0BAA0B,EAAE,cAAc,yBAAyB;AAAA,EACnE,6BAA6B,EAAE,cAAc,yBAAyB;AAAA,EACtE,+BAA+B,EAAE,cAAc,yBAAyB;AAAA,EACxE,mCAAmC,EAAE,cAAc,yBAAyB;AAAA,EAC5E,wCAAwC,EAAE,cAAc,yBAAyB;AAAA,EACjF,oCAAoC,EAAE,cAAc,yBAAyB;AAAA,EAC7E,oCAAoC,EAAE,cAAc,yBAAyB;AAAA,EAC7E,2BAA2B,EAAE,cAAc,yBAAyB;AAAA,EACpE,sCAAsC,EAAE,cAAc,yBAAyB;AAAA,EAC/E,kCAAkC,EAAE,cAAc,yBAAyB;AAAA,EAC3E,mCAAmC,EAAE,cAAc,yBAAyB;AAAA,EAC5E,sCAAsC,EAAE,cAAc,yBAAyB;AAAA,EAC/E,gCAAgC,EAAE,cAAc,yBAAyB;AAAA,EACzE,iCAAiC,EAAE,cAAc,yBAAyB;AAAA,EAC1E,qCAAqC,EAAE,cAAc,yBAAyB;AAAA,EAC9E,wCAAwC,EAAE,cAAc,yBAAyB;AACnF;AAEA,MAAM,uBAAoE;AAAA,EACxE,0BAA0B,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAC1E,0BAA0B,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAC1E,0BAA0B,CAAC,EAAE,MAAM,OAAO,QAAQ,UAAU,OAAO;AAAA,IACjE,cAAc,GAAG,KAAK,IAAI,IAAI,KAAK,IAAI,MAAM,IAAI,SAAS;AAAA,EAC5D;AAAA,EACA,6BAA6B,CAAC,EAAE,MAAM,OAAO,QAAQ,UAAU,OAAO;AAAA,IACpE,cAAc,GAAG,KAAK,IAAI,IAAI,KAAK,IAAI,MAAM,IAAI,SAAS;AAAA,EAC5D;AAAA,EACA,+BAA+B,CAAC,EAAE,MAAM,OAAO,QAAQ,UAAU,OAAO;AAAA,IACtE,cAAc,GAAG,KAAK,IAAI,IAAI,KAAK,IAAI,MAAM,IAAI,SAAS;AAAA,EAC5D;AAAA,EACA,mCAAmC,CAAC,EAAE,MAAM,OAAO,QAAQ,UAAU,OAAO;AAAA,IAC1E,cAAc,GAAG,KAAK,IAAI,IAAI,KAAK,IAAI,MAAM,IAAI,SAAS;AAAA,EAC5D;AAAA,EACA,wCAAwC,CAAC,EAAE,MAAM,OAAO,QAAQ,UAAU,OAAO;AAAA,IAC/E,cAAc,GAAG,KAAK,IAAI,IAAI,KAAK,IAAI,MAAM,IAAI,SAAS;AAAA,EAC5D;AAAA,EACA,oCAAoC,CAAC,EAAE,MAAM,OAAO,QAAQ,UAAU,OAAO;AAAA,IAC3E,cAAc,GAAG,KAAK,IAAI,IAAI,KAAK,IAAI,MAAM,IAAI,SAAS;AAAA,EAC5D;AAAA,EACA,oCAAoC,CAAC,EAAE,MAAM,OAAO,QAAQ,UAAU,OAAO;AAAA,IAC3E,cAAc,GAAG,KAAK,IAAI,IAAI,KAAK,IAAI,MAAM,IAAI,SAAS;AAAA,EAC5D;AAAA,EACA,2BAA2B,CAAC,EAAE,MAAM,OAAO,QAAQ,UAAU,OAAO;AAAA,IAClE,cAAc,GAAG,KAAK,IAAI,IAAI,KAAK,IAAI,MAAM,IAAI,SAAS;AAAA,EAC5D;AAAA,EACA,sCAAsC,OAAO,EAAE,cAAc,yBAAyB;AAAA,EACtF,kCAAkC,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAClF,mCAAmC,OAAO,EAAE,cAAc,yBAAyB;AAAA,EACnF,sCAAsC,OAAO,EAAE,cAAc,yBAAyB;AAAA,EACtF,gCAAgC,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAChF,iCAAiC,OAAO,EAAE,cAAc,yBAAyB;AAAA,EACjF,qCAAqC,OAAO,EAAE,cAAc,yBAAyB;AAAA,EACrF,wCAAwC,OAAO,EAAE,cAAc,yBAAyB;AAC1F;AAGA,MAAM,6CAEF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,4 @@
1
+ import { type DSLeftNavigationTreeT } from './react-desc-prop-types.js';
2
+ declare const DSLeftNavigationTree: import("react").FunctionComponent<DSLeftNavigationTreeT.Props>;
3
+ declare const DSLeftNavigationTreeWithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<DSLeftNavigationTreeT.Props>;
4
+ export { DSLeftNavigationTree, DSLeftNavigationTreeWithSchema };
@@ -0,0 +1,38 @@
1
+ import { type ZustandT } from '@elliemae/ds-zustand-helpers';
2
+ import { type DSLeftNavigationTreeT } from '../react-desc-prop-types.js';
3
+ export declare const PropsProvider: ({ createStore, children, }: {
4
+ createStore: () => ZustandT.ZustandStore<ZustandT.PropsStore<DSLeftNavigationTreeT.InternalProps & Record<string, never>>>;
5
+ children: import("react").ReactNode;
6
+ }) => import("react").FunctionComponentElement<import("react").ProviderProps<ZustandT.ZustandStore<ZustandT.PropsStore<DSLeftNavigationTreeT.InternalProps & Record<string, never>>> | undefined>>, usePropsStore: {
7
+ (): ZustandT.PropsStore<DSLeftNavigationTreeT.InternalProps & Record<string, never>>;
8
+ <U>(selector: (state: ZustandT.PropsStore<DSLeftNavigationTreeT.InternalProps & Record<string, never>>) => U, equalityFn?: ((a: U, b: U) => boolean) | undefined): U;
9
+ }, InternalProvider: ({ createStore, children, }: {
10
+ createStore: () => ZustandT.ZustandStore<ZustandT.InternalStore<DSLeftNavigationTreeT.InternalAtoms, DSLeftNavigationTreeT.Selectors, DSLeftNavigationTreeT.Reducers>>;
11
+ children: import("react").ReactNode;
12
+ }) => import("react").FunctionComponentElement<import("react").ProviderProps<ZustandT.ZustandStore<ZustandT.InternalStore<DSLeftNavigationTreeT.InternalAtoms, DSLeftNavigationTreeT.Selectors, DSLeftNavigationTreeT.Reducers>> | undefined>>, useInternalStore: {
13
+ (): ZustandT.InternalStore<DSLeftNavigationTreeT.InternalAtoms, DSLeftNavigationTreeT.Selectors, DSLeftNavigationTreeT.Reducers>;
14
+ <U>(selector: (state: ZustandT.InternalStore<DSLeftNavigationTreeT.InternalAtoms, DSLeftNavigationTreeT.Selectors, DSLeftNavigationTreeT.Reducers>) => U, equalityFn?: ((a: U, b: U) => boolean) | undefined): U;
15
+ };
16
+ export declare const config: {
17
+ defaultProps: DSLeftNavigationTreeT.InternalProps;
18
+ internalAtomDefaultValues: DSLeftNavigationTreeT.InternalAtoms;
19
+ useAutoCalculated: () => Record<string, never>;
20
+ selectors: ZustandT.SelectorObject<DSLeftNavigationTreeT.InternalStore, DSLeftNavigationTreeT.Selectors>;
21
+ reducers: ZustandT.ReducerObject<DSLeftNavigationTreeT.InternalStore, DSLeftNavigationTreeT.Reducers>;
22
+ PropsProvider: ({ createStore, children, }: {
23
+ createStore: () => ZustandT.ZustandStore<ZustandT.PropsStore<DSLeftNavigationTreeT.InternalProps & Record<string, never>>>;
24
+ children: import("react").ReactNode;
25
+ }) => import("react").FunctionComponentElement<import("react").ProviderProps<ZustandT.ZustandStore<ZustandT.PropsStore<DSLeftNavigationTreeT.InternalProps & Record<string, never>>> | undefined>>;
26
+ usePropsStore: {
27
+ (): ZustandT.PropsStore<DSLeftNavigationTreeT.InternalProps & Record<string, never>>;
28
+ <U>(selector: (state: ZustandT.PropsStore<DSLeftNavigationTreeT.InternalProps & Record<string, never>>) => U, equalityFn?: ((a: U, b: U) => boolean) | undefined): U;
29
+ };
30
+ InternalProvider: ({ createStore, children, }: {
31
+ createStore: () => ZustandT.ZustandStore<ZustandT.InternalStore<DSLeftNavigationTreeT.InternalAtoms, DSLeftNavigationTreeT.Selectors, DSLeftNavigationTreeT.Reducers>>;
32
+ children: import("react").ReactNode;
33
+ }) => import("react").FunctionComponentElement<import("react").ProviderProps<ZustandT.ZustandStore<ZustandT.InternalStore<DSLeftNavigationTreeT.InternalAtoms, DSLeftNavigationTreeT.Selectors, DSLeftNavigationTreeT.Reducers>> | undefined>>;
34
+ useInternalStore: {
35
+ (): ZustandT.InternalStore<DSLeftNavigationTreeT.InternalAtoms, DSLeftNavigationTreeT.Selectors, DSLeftNavigationTreeT.Reducers>;
36
+ <U>(selector: (state: ZustandT.InternalStore<DSLeftNavigationTreeT.InternalAtoms, DSLeftNavigationTreeT.Selectors, DSLeftNavigationTreeT.Reducers>) => U, equalityFn?: ((a: U, b: U) => boolean) | undefined): U;
37
+ };
38
+ };
@@ -0,0 +1,69 @@
1
+ import type { DSLeftNavigationTreeT } from '../react-desc-prop-types.js';
2
+ type Item = DSLeftNavigationTreeT.Item;
3
+ export type TreeNodeInfo = {
4
+ id: string;
5
+ item: Item;
6
+ parentId: string | null;
7
+ level: number;
8
+ childIds: string[];
9
+ };
10
+ export type TreeIndex = Map<string, TreeNodeInfo>;
11
+ export type FocusTarget = {
12
+ kind: 'item';
13
+ id: string;
14
+ } | {
15
+ kind: 'footer';
16
+ } | null;
17
+ /**
18
+ * Root nodes in document order. Children of a root SECTION are root nodes too:
19
+ * a section is a labelled group, not a tree level.
20
+ */
21
+ export declare const getRootNodes: (items: readonly Item[]) => Item[];
22
+ export declare const buildTreeIndex: (items: readonly Item[]) => TreeIndex;
23
+ export declare const hasChildren: (info: TreeNodeInfo | undefined) => boolean;
24
+ export declare const isControlledParent: (item: Item) => boolean;
25
+ export declare const getAncestorIds: (index: TreeIndex, id: string | null | undefined) => string[];
26
+ export declare const isDescendantOf: (index: TreeIndex, ancestorId: string, id: string | null | undefined) => boolean;
27
+ export declare const resolveIsOpen: (info: TreeNodeInfo, toggles: Record<string, boolean>, seed: ReadonlySet<string>) => boolean;
28
+ export declare const getVisibleIds: (index: TreeIndex, items: readonly Item[], isOpen: (id: string) => boolean) => string[];
29
+ export declare const getRailIds: (items: readonly Item[]) => string[];
30
+ /** Every node in depth-first document order, regardless of visibility. */
31
+ export declare const getDocumentOrder: (index: TreeIndex, items: readonly Item[]) => string[];
32
+ /**
33
+ * Default selection when a parent opens (spec "first list item selected by default; if it is a parent folder, it is
34
+ * expanded by default"): walks the children in order, skips non-selectable leaves, and descends into the first parent
35
+ * that holds a selectable page, listing the parents that must open on the way.
36
+ */
37
+ export declare const getDefaultSelection: (index: TreeIndex, parentId: string) => {
38
+ leafId: string | null;
39
+ parentIdsToOpen: string[];
40
+ };
41
+ export declare const getTabStopChainId: (index: TreeIndex, visibleIds: string[], currentId: string | null | undefined) => string | null;
42
+ /**
43
+ * Where focus goes when the focused node stops being visible while focus is inside the tree:
44
+ * nearest visible ancestor, then the previous visible node in document order, then the first
45
+ * visible node, then the footer button. A node no longer in the data resolves through the tab-stop chain.
46
+ */
47
+ export declare const resolveFallbackTarget: ({ index, documentOrder, visibleIds, lostId, currentId, }: {
48
+ index: TreeIndex;
49
+ documentOrder: string[];
50
+ visibleIds: string[];
51
+ lostId: string;
52
+ currentId: string | null | undefined;
53
+ }) => FocusTarget;
54
+ export declare const getTypeaheadMatchId: ({ index, visibleIds, fromId, character, }: {
55
+ index: TreeIndex;
56
+ visibleIds: string[];
57
+ fromId: string;
58
+ character: string;
59
+ }) => string | null;
60
+ export declare const ROW_PADDING = 12;
61
+ /** Parents without an icon show their arrow before the label; parents with an icon show it after the label. */
62
+ export declare const hasLeadingArrow: (info: TreeNodeInfo | undefined) => boolean;
63
+ /**
64
+ * Left padding per row, following the Left Nav 1.0.4 spec: children of a parent with an icon (a section such as
65
+ * Forms or Log) start their label 16px after the parent's row padding; children of an arrow-led parent start
66
+ * 16px after the parent's label. The index lists parents before their children.
67
+ */
68
+ export declare const getRowPaddings: (index: TreeIndex) => ReadonlyMap<string, number>;
69
+ export {};
@@ -0,0 +1 @@
1
+ export declare const useAutoCalculated: () => Record<string, never>;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Write side of the focus tracker: named semantic handlers only.
3
+ * Components read the focus region and item from the store with their own selector,
4
+ * and apply focus from a ref callback when they are the derived focus target.
5
+ */
6
+ export declare const useFocusTracker: () => {
7
+ trackFocusItem: (id: string) => void;
8
+ trackFocusHeader: () => void;
9
+ trackFocusFooter: () => void;
10
+ trackFocusRegionReset: () => void;
11
+ };
@@ -0,0 +1,11 @@
1
+ import type React from 'react';
2
+ import type { DSLeftNavigationTreeT } from '../react-desc-prop-types.js';
3
+ import type { TreeModel } from './useTreeModel.js';
4
+ type InteractionEvent = DSLeftNavigationTreeT.InteractionEvent;
5
+ export declare const useTreeHandlers: (model: TreeModel) => {
6
+ activate: (id: string, e: InteractionEvent) => void;
7
+ onTreeKeyDown: (e: React.KeyboardEvent<HTMLElement>) => void;
8
+ onTreeFocus: (e: React.FocusEvent<HTMLElement>) => void;
9
+ onTreeBlur: (e: React.FocusEvent<HTMLElement>) => void;
10
+ };
11
+ export {};
@@ -0,0 +1,22 @@
1
+ import type { DSLeftNavigationTreeT } from '../react-desc-prop-types.js';
2
+ import { type FocusTarget, type TreeIndex } from './treeModel.js';
3
+ export type TreeModel = {
4
+ items: readonly DSLeftNavigationTreeT.Item[];
5
+ index: TreeIndex;
6
+ isRail: boolean;
7
+ headerItem: DSLeftNavigationTreeT.Item | undefined;
8
+ isHeaderOpen: boolean;
9
+ openIds: ReadonlySet<string>;
10
+ visibleIds: string[];
11
+ currentId: string | null;
12
+ currentLeafId: string | null;
13
+ selectedParentIds: ReadonlySet<string>;
14
+ chainTabStopId: string | null;
15
+ resolveFocusTarget: (focusRegion: string, focusedItemId: string | null) => FocusTarget;
16
+ rowPaddings: ReadonlyMap<string, number>;
17
+ };
18
+ export declare const useTreeModel: () => TreeModel;
19
+ export type ItemFocusState = 'focus-target' | 'tab-stop' | 'none';
20
+ /** Primitive per-item result: the item re-renders only when its own focus state changes. */
21
+ export declare const useItemFocusState: (model: TreeModel, id: string) => ItemFocusState;
22
+ export declare const useIsFooterFocusTarget: (model: TreeModel) => boolean;
@@ -0,0 +1,3 @@
1
+ import type { ValidationMap } from '@elliemae/ds-props-helpers';
2
+ import { type DSLeftNavigationTreeT } from '../react-desc-prop-types.js';
3
+ export declare const useValidateProps: (props: DSLeftNavigationTreeT.InternalProps, propTypes: ValidationMap<unknown>) => void;
@@ -0,0 +1,54 @@
1
+ export declare const DSLeftNavigationTreeName = "DSLeftnavigationtree";
2
+ export declare const LEFT_NAVIGATION_TREE_ITEM_TYPES: {
3
+ readonly LEAF: "ds-left-nav-tree-item-leaf";
4
+ readonly PARENT: "ds-left-nav-tree-item-parent";
5
+ readonly SECTION: "ds-left-nav-tree-item-section";
6
+ readonly SEPARATOR: "ds-left-nav-tree-item-separator";
7
+ };
8
+ export declare const LEFT_NAVIGATION_TREE_DEFAULT_LABEL = "Primary";
9
+ export declare const LEFT_NAVIGATION_TREE_REGION_FOCUSES: {
10
+ readonly RESET: "";
11
+ readonly TREE: "tree";
12
+ readonly HEADER: "header";
13
+ readonly FOOTER: "footer";
14
+ };
15
+ export declare const LEFT_NAVIGATION_TREE_SLOTS: {
16
+ readonly ROOT: "root";
17
+ readonly TREE: "tree";
18
+ readonly ITEM: "item";
19
+ readonly ITEM_ROW: "item-row";
20
+ readonly ITEM_LABEL: "item-label";
21
+ readonly LEFT_CONTAINER: "left-container";
22
+ readonly COLLAPSED_CONTAINER: "collapsed-container";
23
+ readonly RIGHT_CONTAINER: "right-container";
24
+ readonly ARROW_CONTAINER: "arrow-container";
25
+ readonly GROUP: "group";
26
+ readonly SECTION_CONTAINER: "section-container";
27
+ readonly SECTION_LABEL: "section-label";
28
+ readonly ITEM_SEPARATOR: "item-separator";
29
+ readonly HEADER_DISCLOSURE: "header-disclosure";
30
+ readonly FOOTER_MENU: "footer-menu";
31
+ readonly FOOTER_LABEL: "footer-label";
32
+ readonly FOOTER_SEPARATOR: "footer-separator";
33
+ readonly FOOTER_MENU_COLLAPSE: "footer-menu-collapse";
34
+ };
35
+ export declare const LEFT_NAVIGATION_TREE_DATA_TESTID: {
36
+ readonly ROOT: "ds-leftnavigationtree-root";
37
+ readonly TREE: "ds-leftnavigationtree-tree";
38
+ readonly ITEM: "ds-leftnavigationtree-item";
39
+ readonly ITEM_ROW: "ds-leftnavigationtree-item-row";
40
+ readonly ITEM_LABEL: "ds-leftnavigationtree-item-label";
41
+ readonly LEFT_CONTAINER: "ds-leftnavigationtree-left-container";
42
+ readonly COLLAPSED_CONTAINER: "ds-leftnavigationtree-collapsed-container";
43
+ readonly RIGHT_CONTAINER: "ds-leftnavigationtree-right-container";
44
+ readonly ARROW_CONTAINER: "ds-leftnavigationtree-arrow-container";
45
+ readonly GROUP: "ds-leftnavigationtree-group";
46
+ readonly SECTION_CONTAINER: "ds-leftnavigationtree-section-container";
47
+ readonly SECTION_LABEL: "ds-leftnavigationtree-section-label";
48
+ readonly ITEM_SEPARATOR: "ds-leftnavigationtree-item-separator";
49
+ readonly HEADER_DISCLOSURE: "ds-leftnavigationtree-header-disclosure";
50
+ readonly FOOTER_MENU: "ds-leftnavigationtree-footer-menu";
51
+ readonly FOOTER_LABEL: "ds-leftnavigationtree-footer-label";
52
+ readonly FOOTER_SEPARATOR: "ds-leftnavigationtree-footer-separator";
53
+ readonly FOOTER_MENU_COLLAPSE: "ds-leftnavigationtree-footer-menu-collapse";
54
+ };
@@ -0,0 +1,3 @@
1
+ export { DSLeftNavigationTree, DSLeftNavigationTreeWithSchema } from './DSLeftNavigationTree.js';
2
+ export { type DSLeftNavigationTreeT, DSLeftNavigationTreeItemSchema, DSLeftNavigationTreeItemOptsSchema, } from './react-desc-prop-types.js';
3
+ export { DSLeftNavigationTreeName, LEFT_NAVIGATION_TREE_ITEM_TYPES, LEFT_NAVIGATION_TREE_REGION_FOCUSES, LEFT_NAVIGATION_TREE_SLOTS, LEFT_NAVIGATION_TREE_DATA_TESTID, } from './constants/index.js';
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const Footer: () => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const HeaderDisclosure: () => React.JSX.Element | null;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const MainContent: React.MemoExoticComponent<() => React.JSX.Element>;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ /**
3
+ * Collapsed-rail node: an icon-only end treeitem. The label stays in the DOM with display: none
4
+ * because it is the aria-labelledby target (hidden targets still name the element, and are not read twice).
5
+ */
6
+ export declare const RailItem: React.MemoExoticComponent<({ id }: {
7
+ id: string;
8
+ }) => React.JSX.Element | null>;
@@ -0,0 +1,11 @@
1
+ import type { DSLeftNavigationTreeT } from '../react-desc-prop-types.js';
2
+ import type { TreeModel } from '../config/useTreeModel.js';
3
+ import type { useTreeHandlers } from '../config/useTreeHandlers.js';
4
+ export type TreeContextValue = {
5
+ model: TreeModel;
6
+ handlers: ReturnType<typeof useTreeHandlers>;
7
+ getOwnerProps: () => object;
8
+ labelOverflow: DSLeftNavigationTreeT.LabelOverflowT;
9
+ getElementId: (kind: string, dsId: string) => string;
10
+ };
11
+ export declare const TreeContext: import("react").Context<TreeContextValue>;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ export declare const TreeItem: React.MemoExoticComponent<({ id }: {
3
+ id: string;
4
+ }) => React.JSX.Element | null>;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ type NameProps = {
3
+ 'aria-label'?: string;
4
+ 'aria-labelledby'?: string;
5
+ };
6
+ export declare const TreeRoot: ({ nameProps }: {
7
+ nameProps: NameProps;
8
+ }) => React.JSX.Element | null;
9
+ export {};
@@ -0,0 +1,46 @@
1
+ import type { DSLeftNavigationTreeT } from '../react-desc-prop-types.js';
2
+ export declare const StyledRoot: import("styled-components").StyledComponent<"nav", import("@elliemae/ds-system").Theme, {
3
+ expanded: boolean;
4
+ expandedWidth: string;
5
+ } & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"nav">, never>;
6
+ export declare const StyledTree: import("styled-components").StyledComponent<"ul", import("@elliemae/ds-system").Theme, {
7
+ isHeaderContent: boolean;
8
+ } & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"ul">, never>;
9
+ export declare const StyledGroup: import("styled-components").StyledComponent<"ul", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"ul">, never>;
10
+ export declare const StyledSectionContainer: import("styled-components").StyledComponent<"ul", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"ul">, never>;
11
+ export declare const StyledSectionLabel: import("styled-components").StyledComponent<"span", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"span">, never>;
12
+ export declare const StyledItemSeparator: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
13
+ /**
14
+ * The focus ring is drawn on the row of the focused treeitem only: the `li` holds the whole
15
+ * expanded subtree, so an outline on it would surround every descendant row.
16
+ */
17
+ export declare const StyledItem: import("styled-components").StyledComponent<"li", import("@elliemae/ds-system").Theme, {
18
+ isOpenSection: boolean;
19
+ } & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"li">, never>;
20
+ export declare const StyledItemRow: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, {
21
+ rowPadding: number;
22
+ isTall: boolean;
23
+ isSticky: boolean;
24
+ isCurrent: boolean;
25
+ isSelectedParent: boolean;
26
+ } & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
27
+ export declare const StyledItemLabel: import("styled-components").StyledComponent<"span", import("@elliemae/ds-system").Theme, {
28
+ isTall: boolean;
29
+ labelOverflow: DSLeftNavigationTreeT.LabelOverflowT;
30
+ } & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"span">, never>;
31
+ export declare const StyledLeftContainer: import("styled-components").StyledComponent<"span", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"span">, never>;
32
+ export declare const StyledCollapsedContainer: import("styled-components").StyledComponent<"span", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"span">, never>;
33
+ export declare const StyledRightContainer: import("styled-components").StyledComponent<"span", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"span">, never>;
34
+ export declare const StyledArrowContainer: import("styled-components").StyledComponent<"span", import("@elliemae/ds-system").Theme, {
35
+ isLeading: boolean;
36
+ } & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"span">, never>;
37
+ export declare const StyledHeaderDisclosure: import("styled-components").StyledComponent<"button", import("@elliemae/ds-system").Theme, {
38
+ isRail: boolean;
39
+ isOpen: boolean;
40
+ } & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"button">, never>;
41
+ export declare const StyledFooterMenu: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, {
42
+ expanded: boolean;
43
+ } & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
44
+ export declare const StyledFooterLabel: import("styled-components").StyledComponent<"span", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"span">, never>;
45
+ export declare const StyledFooterSeparator: import("styled-components").StyledComponent<"span", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"span">, never>;
46
+ export declare const StyledFooterButton: import("styled-components").StyledComponent<"button", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"button">, never>;