@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,90 @@
1
+ import * as React from "react";
2
+ import { useMemo, useState } from "react";
3
+ import { LEFT_NAVIGATION_TREE_ITEM_TYPES, LEFT_NAVIGATION_TREE_REGION_FOCUSES } from "../constants/index.js";
4
+ import { useInternalStore, usePropsStore } from "./store.js";
5
+ import {
6
+ buildTreeIndex,
7
+ getAncestorIds,
8
+ getDocumentOrder,
9
+ getRowPaddings,
10
+ getRailIds,
11
+ getTabStopChainId,
12
+ getVisibleIds,
13
+ resolveFallbackTarget,
14
+ resolveIsOpen
15
+ } from "./treeModel.js";
16
+ const useTreeModel = () => {
17
+ const items = usePropsStore((state) => state.items);
18
+ const expanded = usePropsStore((state) => state.expanded);
19
+ const selectedItem = usePropsStore((state) => state.selectedItem);
20
+ const selectedParent = usePropsStore((state) => state.selectedParent);
21
+ const headerItem = usePropsStore((state) => state.HeaderComponent);
22
+ const openedItem = usePropsStore((state) => state.openedItem);
23
+ const toggles = useInternalStore((state) => state.toggles);
24
+ const internalSelectedItem = useInternalStore((state) => state.internalSelectedItem);
25
+ const [seed] = useState(
26
+ () => new Set(getAncestorIds(buildTreeIndex(items), selectedItem ?? internalSelectedItem))
27
+ );
28
+ return useMemo(() => {
29
+ const index = buildTreeIndex(items);
30
+ const isRail = !expanded;
31
+ const isHeaderOpen = !!headerItem && openedItem === headerItem.dsId;
32
+ const openIds = /* @__PURE__ */ new Set();
33
+ index.forEach((info) => {
34
+ if (resolveIsOpen(info, toggles, seed)) openIds.add(info.id);
35
+ });
36
+ let visibleIds = [];
37
+ if (isRail) visibleIds = getRailIds(items);
38
+ else visibleIds = getVisibleIds(index, items, (id) => openIds.has(id));
39
+ const visible = new Set(visibleIds);
40
+ const currentId = selectedItem !== void 0 ? selectedItem : internalSelectedItem;
41
+ const currentLeafId = currentId && index.get(currentId)?.item.type === LEFT_NAVIGATION_TREE_ITEM_TYPES.LEAF ? currentId : null;
42
+ const selectedParentIds = new Set(
43
+ selectedParent !== void 0 ? [selectedParent] : getAncestorIds(index, currentLeafId)
44
+ );
45
+ const documentOrder = getDocumentOrder(index, items);
46
+ const cache = { key: null, target: null };
47
+ const resolveFocusTarget = (focusRegion, focusedItemId) => {
48
+ if (focusRegion !== LEFT_NAVIGATION_TREE_REGION_FOCUSES.TREE || !focusedItemId) return null;
49
+ if (visible.has(focusedItemId)) return { kind: "item", id: focusedItemId };
50
+ if (cache.key !== focusedItemId) {
51
+ cache.key = focusedItemId;
52
+ cache.target = resolveFallbackTarget({
53
+ index,
54
+ documentOrder,
55
+ visibleIds,
56
+ lostId: focusedItemId,
57
+ currentId: currentLeafId
58
+ });
59
+ }
60
+ return cache.target;
61
+ };
62
+ return {
63
+ items,
64
+ index,
65
+ rowPaddings: getRowPaddings(index),
66
+ isRail,
67
+ headerItem,
68
+ isHeaderOpen,
69
+ openIds,
70
+ visibleIds,
71
+ currentId,
72
+ currentLeafId,
73
+ selectedParentIds,
74
+ chainTabStopId: getTabStopChainId(index, visibleIds, currentLeafId),
75
+ resolveFocusTarget
76
+ };
77
+ }, [items, expanded, headerItem, openedItem, toggles, seed, selectedItem, internalSelectedItem, selectedParent]);
78
+ };
79
+ const useItemFocusState = (model, id) => useInternalStore((state) => {
80
+ const target = model.resolveFocusTarget(state.focusRegion, state.focusedItemId);
81
+ if (target?.kind === "item") return target.id === id ? "focus-target" : "none";
82
+ return model.chainTabStopId === id ? "tab-stop" : "none";
83
+ });
84
+ const useIsFooterFocusTarget = (model) => useInternalStore((state) => model.resolveFocusTarget(state.focusRegion, state.focusedItemId)?.kind === "footer");
85
+ export {
86
+ useIsFooterFocusTarget,
87
+ useItemFocusState,
88
+ useTreeModel
89
+ };
90
+ //# sourceMappingURL=useTreeModel.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useTreeModel.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\nimport { useMemo, useState } from 'react';\nimport { LEFT_NAVIGATION_TREE_ITEM_TYPES, LEFT_NAVIGATION_TREE_REGION_FOCUSES } from '../constants/index.js';\nimport type { DSLeftNavigationTreeT } from '../react-desc-prop-types.js';\nimport { useInternalStore, usePropsStore } from './store.js';\nimport {\n type FocusTarget,\n type TreeIndex,\n buildTreeIndex,\n getAncestorIds,\n getDocumentOrder,\n getRowPaddings,\n getRailIds,\n getTabStopChainId,\n getVisibleIds,\n resolveFallbackTarget,\n resolveIsOpen,\n} from './treeModel.js';\n\nexport type TreeModel = {\n items: readonly DSLeftNavigationTreeT.Item[];\n index: TreeIndex;\n isRail: boolean;\n headerItem: DSLeftNavigationTreeT.Item | undefined;\n isHeaderOpen: boolean;\n openIds: ReadonlySet<string>;\n visibleIds: string[];\n currentId: string | null;\n currentLeafId: string | null;\n selectedParentIds: ReadonlySet<string>;\n chainTabStopId: string | null;\n resolveFocusTarget: (focusRegion: string, focusedItemId: string | null) => FocusTarget;\n rowPaddings: ReadonlyMap<string, number>;\n};\n\nexport const useTreeModel = (): TreeModel => {\n const items = usePropsStore((state) => state.items);\n const expanded = usePropsStore((state) => state.expanded);\n const selectedItem = usePropsStore((state) => state.selectedItem);\n const selectedParent = usePropsStore((state) => state.selectedParent);\n const headerItem = usePropsStore((state) => state.HeaderComponent);\n const openedItem = usePropsStore((state) => state.openedItem);\n\n const toggles = useInternalStore((state) => state.toggles);\n const internalSelectedItem = useInternalStore((state) => state.internalSelectedItem);\n\n /**\n * Captured once from the first render's props: ancestors of the initial current page start open.\n * Later selection changes never reopen branches (the tab stop falls back to the nearest visible ancestor).\n */\n const [seed] = useState<ReadonlySet<string>>(\n () => new Set(getAncestorIds(buildTreeIndex(items), selectedItem ?? internalSelectedItem)),\n );\n\n return useMemo(() => {\n const index = buildTreeIndex(items);\n const isRail = !expanded;\n const isHeaderOpen = !!headerItem && openedItem === headerItem.dsId;\n\n const openIds = new Set<string>();\n index.forEach((info) => {\n if (resolveIsOpen(info, toggles, seed)) openIds.add(info.id);\n });\n\n let visibleIds: string[] = [];\n if (isRail) visibleIds = getRailIds(items);\n else visibleIds = getVisibleIds(index, items, (id) => openIds.has(id));\n const visible = new Set(visibleIds);\n\n const currentId = selectedItem !== undefined ? selectedItem : internalSelectedItem;\n const currentLeafId =\n currentId && index.get(currentId)?.item.type === LEFT_NAVIGATION_TREE_ITEM_TYPES.LEAF ? currentId : null;\n const selectedParentIds: ReadonlySet<string> = new Set(\n selectedParent !== undefined ? [selectedParent] : getAncestorIds(index, currentLeafId),\n );\n\n const documentOrder = getDocumentOrder(index, items);\n const cache: { key: string | null; target: FocusTarget } = { key: null, target: null };\n /**\n * Derived from the store by each item's own selector, so a focus move re-renders only the items whose\n * flags change. Cached because every rendered item calls it with the same arguments on each store update.\n */\n const resolveFocusTarget = (focusRegion: string, focusedItemId: string | null): FocusTarget => {\n if (focusRegion !== LEFT_NAVIGATION_TREE_REGION_FOCUSES.TREE || !focusedItemId) return null;\n if (visible.has(focusedItemId)) return { kind: 'item', id: focusedItemId };\n if (cache.key !== focusedItemId) {\n cache.key = focusedItemId;\n cache.target = resolveFallbackTarget({\n index,\n documentOrder,\n visibleIds,\n lostId: focusedItemId,\n currentId: currentLeafId,\n });\n }\n return cache.target;\n };\n\n return {\n items,\n index,\n rowPaddings: getRowPaddings(index),\n isRail,\n headerItem,\n isHeaderOpen,\n openIds,\n visibleIds,\n currentId,\n currentLeafId,\n selectedParentIds,\n chainTabStopId: getTabStopChainId(index, visibleIds, currentLeafId),\n resolveFocusTarget,\n };\n }, [items, expanded, headerItem, openedItem, toggles, seed, selectedItem, internalSelectedItem, selectedParent]);\n};\n\nexport type ItemFocusState = 'focus-target' | 'tab-stop' | 'none';\n\n/** Primitive per-item result: the item re-renders only when its own focus state changes. */\nexport const useItemFocusState = (model: TreeModel, id: string): ItemFocusState =>\n useInternalStore((state) => {\n const target = model.resolveFocusTarget(state.focusRegion, state.focusedItemId);\n if (target?.kind === 'item') return target.id === id ? 'focus-target' : 'none';\n return model.chainTabStopId === id ? 'tab-stop' : 'none';\n });\n\nexport const useIsFooterFocusTarget = (model: TreeModel): boolean =>\n useInternalStore((state) => model.resolveFocusTarget(state.focusRegion, state.focusedItemId)?.kind === 'footer');\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,SAAS,gBAAgB;AAClC,SAAS,iCAAiC,2CAA2C;AAErF,SAAS,kBAAkB,qBAAqB;AAChD;AAAA,EAGE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAkBA,MAAM,eAAe,MAAiB;AAC3C,QAAM,QAAQ,cAAc,CAAC,UAAU,MAAM,KAAK;AAClD,QAAM,WAAW,cAAc,CAAC,UAAU,MAAM,QAAQ;AACxD,QAAM,eAAe,cAAc,CAAC,UAAU,MAAM,YAAY;AAChE,QAAM,iBAAiB,cAAc,CAAC,UAAU,MAAM,cAAc;AACpE,QAAM,aAAa,cAAc,CAAC,UAAU,MAAM,eAAe;AACjE,QAAM,aAAa,cAAc,CAAC,UAAU,MAAM,UAAU;AAE5D,QAAM,UAAU,iBAAiB,CAAC,UAAU,MAAM,OAAO;AACzD,QAAM,uBAAuB,iBAAiB,CAAC,UAAU,MAAM,oBAAoB;AAMnF,QAAM,CAAC,IAAI,IAAI;AAAA,IACb,MAAM,IAAI,IAAI,eAAe,eAAe,KAAK,GAAG,gBAAgB,oBAAoB,CAAC;AAAA,EAC3F;AAEA,SAAO,QAAQ,MAAM;AACnB,UAAM,QAAQ,eAAe,KAAK;AAClC,UAAM,SAAS,CAAC;AAChB,UAAM,eAAe,CAAC,CAAC,cAAc,eAAe,WAAW;AAE/D,UAAM,UAAU,oBAAI,IAAY;AAChC,UAAM,QAAQ,CAAC,SAAS;AACtB,UAAI,cAAc,MAAM,SAAS,IAAI,EAAG,SAAQ,IAAI,KAAK,EAAE;AAAA,IAC7D,C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AU;AAC1B,QAAM,SAAS,MAAM,mBAAmB,MAAM,aAAa,MAAM,aAAa;AAC9E,MAAI,QAAQ,SAAS,OAAQ,QAAO,OAAO,OAAO,KAAK,iBAAiB;AACxE,SAAO,MAAM,mBAAmB,KAAK,aAAa;AACpD,CAAC;AAEI,MAAM,yBAAyB,CAAC,UACrC,iBAAiB,CAAC,UAAU,MAAM,mBAAmB,MAAM,aAAa,MAAM,aAAa,GAAG,SAAS,QAAQ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ import { useValidateTypescriptPropTypes } from "@elliemae/ds-props-helpers";
3
+ import { DSLeftNavigationTreeName } from "../constants/index.js";
4
+ const useValidateProps = (props, propTypes) => {
5
+ useValidateTypescriptPropTypes(props, propTypes, DSLeftNavigationTreeName);
6
+ };
7
+ export {
8
+ useValidateProps
9
+ };
10
+ //# sourceMappingURL=useValidateProps.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useValidateProps.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport type { ValidationMap } from '@elliemae/ds-props-helpers';\nimport { type DSLeftNavigationTreeT } from '../react-desc-prop-types.js';\nimport { DSLeftNavigationTreeName } from '../constants/index.js';\n\nexport const useValidateProps = (\n props: DSLeftNavigationTreeT.InternalProps,\n propTypes: ValidationMap<unknown>,\n): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSLeftNavigationTreeName);\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,sCAAsC;AAG/C,SAAS,gCAAgC;AAElC,MAAM,mBAAmB,CAC9B,OACA,cACS;AAET,iCAA+B,OAAO,WAAW,wBAAwB;AAC3E;",
6
+ "names": []
7
+ }
@@ -0,0 +1,49 @@
1
+ import * as React from "react";
2
+ import { slotObjectToDataTestIds } from "@elliemae/ds-system";
3
+ const DSLeftNavigationTreeName = "DSLeftnavigationtree";
4
+ const LEFT_NAVIGATION_TREE_ITEM_TYPES = {
5
+ LEAF: "ds-left-nav-tree-item-leaf",
6
+ PARENT: "ds-left-nav-tree-item-parent",
7
+ SECTION: "ds-left-nav-tree-item-section",
8
+ SEPARATOR: "ds-left-nav-tree-item-separator"
9
+ };
10
+ const LEFT_NAVIGATION_TREE_DEFAULT_LABEL = "Primary";
11
+ const LEFT_NAVIGATION_TREE_REGION_FOCUSES = {
12
+ RESET: "",
13
+ TREE: "tree",
14
+ HEADER: "header",
15
+ FOOTER: "footer"
16
+ };
17
+ const LEFT_NAVIGATION_TREE_SLOTS = {
18
+ ROOT: "root",
19
+ TREE: "tree",
20
+ ITEM: "item",
21
+ ITEM_ROW: "item-row",
22
+ ITEM_LABEL: "item-label",
23
+ LEFT_CONTAINER: "left-container",
24
+ COLLAPSED_CONTAINER: "collapsed-container",
25
+ RIGHT_CONTAINER: "right-container",
26
+ ARROW_CONTAINER: "arrow-container",
27
+ GROUP: "group",
28
+ SECTION_CONTAINER: "section-container",
29
+ SECTION_LABEL: "section-label",
30
+ ITEM_SEPARATOR: "item-separator",
31
+ HEADER_DISCLOSURE: "header-disclosure",
32
+ FOOTER_MENU: "footer-menu",
33
+ FOOTER_LABEL: "footer-label",
34
+ FOOTER_SEPARATOR: "footer-separator",
35
+ FOOTER_MENU_COLLAPSE: "footer-menu-collapse"
36
+ };
37
+ const LEFT_NAVIGATION_TREE_DATA_TESTID = slotObjectToDataTestIds(
38
+ DSLeftNavigationTreeName,
39
+ LEFT_NAVIGATION_TREE_SLOTS
40
+ );
41
+ export {
42
+ DSLeftNavigationTreeName,
43
+ LEFT_NAVIGATION_TREE_DATA_TESTID,
44
+ LEFT_NAVIGATION_TREE_DEFAULT_LABEL,
45
+ LEFT_NAVIGATION_TREE_ITEM_TYPES,
46
+ LEFT_NAVIGATION_TREE_REGION_FOCUSES,
47
+ LEFT_NAVIGATION_TREE_SLOTS
48
+ };
49
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/constants/index.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSLeftNavigationTreeName = 'DSLeftnavigationtree';\n\nexport const LEFT_NAVIGATION_TREE_ITEM_TYPES = {\n LEAF: 'ds-left-nav-tree-item-leaf',\n PARENT: 'ds-left-nav-tree-item-parent',\n SECTION: 'ds-left-nav-tree-item-section',\n SEPARATOR: 'ds-left-nav-tree-item-separator',\n} as const;\n\nexport const LEFT_NAVIGATION_TREE_DEFAULT_LABEL = 'Primary';\n\n// we are naming this with the ${component_name}_region_focuses convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const LEFT_NAVIGATION_TREE_REGION_FOCUSES = {\n RESET: '',\n TREE: 'tree',\n HEADER: 'header',\n FOOTER: 'footer',\n} as const;\n\n// we are naming this with the ${component_name}_slots convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const LEFT_NAVIGATION_TREE_SLOTS = {\n ROOT: 'root',\n TREE: 'tree',\n ITEM: 'item',\n ITEM_ROW: 'item-row',\n ITEM_LABEL: 'item-label',\n LEFT_CONTAINER: 'left-container',\n COLLAPSED_CONTAINER: 'collapsed-container',\n RIGHT_CONTAINER: 'right-container',\n ARROW_CONTAINER: 'arrow-container',\n GROUP: 'group',\n SECTION_CONTAINER: 'section-container',\n SECTION_LABEL: 'section-label',\n ITEM_SEPARATOR: 'item-separator',\n HEADER_DISCLOSURE: 'header-disclosure',\n FOOTER_MENU: 'footer-menu',\n FOOTER_LABEL: 'footer-label',\n FOOTER_SEPARATOR: 'footer-separator',\n FOOTER_MENU_COLLAPSE: 'footer-menu-collapse',\n} as const;\n\n// we are naming this with the ${component_name}_data_testid convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const LEFT_NAVIGATION_TREE_DATA_TESTID = slotObjectToDataTestIds(\n DSLeftNavigationTreeName,\n LEFT_NAVIGATION_TREE_SLOTS,\n);\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;AAEjC,MAAM,2BAA2B;AAEjC,MAAM,kCAAkC;AAAA,EAC7C,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,WAAW;AACb;AAEO,MAAM,qCAAqC;AAG3C,MAAM,sCAAsC;AAAA,EACjD,OAAO;AAAA,EACP,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,QAAQ;AACV;AAGO,MAAM,6BAA6B;AAAA,EACxC,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,gBAAgB;AAAA,EAChB,qBAAqB;AAAA,EACrB,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,OAAO;AAAA,EACP,mBAAmB;AAAA,EACnB,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,mBAAmB;AAAA,EACnB,aAAa;AAAA,EACb,cAAc;AAAA,EACd,kBAAkB;AAAA,EAClB,sBAAsB;AACxB;AAGO,MAAM,mCAAmC;AAAA,EAC9C;AAAA,EACA;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,25 @@
1
+ import * as React from "react";
2
+ import { DSLeftNavigationTree, DSLeftNavigationTreeWithSchema } from "./DSLeftNavigationTree.js";
3
+ import {
4
+ DSLeftNavigationTreeItemSchema,
5
+ DSLeftNavigationTreeItemOptsSchema
6
+ } from "./react-desc-prop-types.js";
7
+ import {
8
+ DSLeftNavigationTreeName,
9
+ LEFT_NAVIGATION_TREE_ITEM_TYPES,
10
+ LEFT_NAVIGATION_TREE_REGION_FOCUSES,
11
+ LEFT_NAVIGATION_TREE_SLOTS,
12
+ LEFT_NAVIGATION_TREE_DATA_TESTID
13
+ } from "./constants/index.js";
14
+ export {
15
+ DSLeftNavigationTree,
16
+ DSLeftNavigationTreeItemOptsSchema,
17
+ DSLeftNavigationTreeItemSchema,
18
+ DSLeftNavigationTreeName,
19
+ DSLeftNavigationTreeWithSchema,
20
+ LEFT_NAVIGATION_TREE_DATA_TESTID,
21
+ LEFT_NAVIGATION_TREE_ITEM_TYPES,
22
+ LEFT_NAVIGATION_TREE_REGION_FOCUSES,
23
+ LEFT_NAVIGATION_TREE_SLOTS
24
+ };
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "// this is a workaround to typescript error TS2742\n// https://github.com/microsoft/TypeScript/issues/47663\nimport type {} from '@xstyled/system';\nexport { DSLeftNavigationTree, DSLeftNavigationTreeWithSchema } from './DSLeftNavigationTree.js';\nexport {\n type DSLeftNavigationTreeT,\n DSLeftNavigationTreeItemSchema,\n DSLeftNavigationTreeItemOptsSchema,\n} from './react-desc-prop-types.js';\nexport {\n DSLeftNavigationTreeName,\n LEFT_NAVIGATION_TREE_ITEM_TYPES,\n LEFT_NAVIGATION_TREE_REGION_FOCUSES,\n LEFT_NAVIGATION_TREE_SLOTS,\n LEFT_NAVIGATION_TREE_DATA_TESTID,\n} from './constants/index.js';\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,sBAAsB,sCAAsC;AACrE;AAAA,EAEE;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;",
6
+ "names": []
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "type": "module",
3
+ "sideEffects": [
4
+ "*.css",
5
+ "*.scss"
6
+ ]
7
+ }
@@ -0,0 +1,53 @@
1
+ import * as React from "react";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { useCallback, useContext } from "react";
4
+ import { MenuCollapse, MenuExpand } from "@elliemae/ds-icons";
5
+ import { TreeContext } from "./TreeContext.js";
6
+ import { usePropsStore } from "../config/store.js";
7
+ import { useFocusTracker } from "../config/useFocusTracker.js";
8
+ import { useIsFooterFocusTarget } from "../config/useTreeModel.js";
9
+ import { StyledFooterButton, StyledFooterLabel, StyledFooterMenu, StyledFooterSeparator } from "./styled.js";
10
+ const ICON_COLOR = ["brand-primary", "600"];
11
+ const Footer = () => {
12
+ const { model, getOwnerProps } = useContext(TreeContext);
13
+ const footerLabel = usePropsStore((state) => state.footerLabel);
14
+ const onFooterExpand = usePropsStore((state) => state.onFooterExpand);
15
+ const onFooterClose = usePropsStore((state) => state.onFooterClose);
16
+ const { trackFocusFooter } = useFocusTracker();
17
+ const expanded = !model.isRail;
18
+ const showLabel = expanded && !!footerLabel;
19
+ const isFocusTarget = useIsFooterFocusTarget(model);
20
+ const focusRef = useCallback(
21
+ (node) => {
22
+ if (node && isFocusTarget) node.focus();
23
+ },
24
+ [isFocusTarget]
25
+ );
26
+ const handleClick = useCallback(
27
+ (e) => {
28
+ if (expanded) onFooterClose(e);
29
+ else onFooterExpand(e);
30
+ },
31
+ [expanded, onFooterClose, onFooterExpand]
32
+ );
33
+ return /* @__PURE__ */ jsxs(StyledFooterMenu, { expanded, getOwnerProps, children: [
34
+ showLabel ? /* @__PURE__ */ jsx(StyledFooterLabel, { getOwnerProps, children: footerLabel }) : null,
35
+ showLabel ? /* @__PURE__ */ jsx(StyledFooterSeparator, { "aria-hidden": "true", getOwnerProps }) : null,
36
+ /* @__PURE__ */ jsx(
37
+ StyledFooterButton,
38
+ {
39
+ type: "button",
40
+ "aria-label": expanded ? "Collapse left navigation" : "Expand left navigation",
41
+ onClick: handleClick,
42
+ onFocus: trackFocusFooter,
43
+ innerRef: focusRef,
44
+ getOwnerProps,
45
+ children: expanded ? /* @__PURE__ */ jsx(MenuCollapse, { size: "m", color: ICON_COLOR }) : /* @__PURE__ */ jsx(MenuExpand, { size: "m", color: ICON_COLOR })
46
+ }
47
+ )
48
+ ] });
49
+ };
50
+ export {
51
+ Footer
52
+ };
53
+ //# sourceMappingURL=Footer.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/Footer.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback, useContext } from 'react';\nimport { MenuCollapse, MenuExpand } from '@elliemae/ds-icons';\nimport { TreeContext } from './TreeContext.js';\nimport { usePropsStore } from '../config/store.js';\nimport { useFocusTracker } from '../config/useFocusTracker.js';\nimport { useIsFooterFocusTarget } from '../config/useTreeModel.js';\nimport { StyledFooterButton, StyledFooterLabel, StyledFooterMenu, StyledFooterSeparator } from './styled.js';\n\nconst ICON_COLOR = ['brand-primary', '600'] as ['brand-primary', '600'];\n\nexport const Footer = () => {\n const { model, getOwnerProps } = useContext(TreeContext);\n const footerLabel = usePropsStore((state) => state.footerLabel);\n const onFooterExpand = usePropsStore((state) => state.onFooterExpand);\n const onFooterClose = usePropsStore((state) => state.onFooterClose);\n const { trackFocusFooter } = useFocusTracker();\n const expanded = !model.isRail;\n const showLabel = expanded && !!footerLabel;\n const isFocusTarget = useIsFooterFocusTarget(model);\n\n const focusRef = useCallback(\n (node: HTMLElement | null) => {\n if (node && isFocusTarget) node.focus();\n },\n [isFocusTarget],\n );\n const handleClick = useCallback(\n (e: React.MouseEvent<HTMLElement>) => {\n if (expanded) onFooterClose(e);\n else onFooterExpand(e);\n },\n [expanded, onFooterClose, onFooterExpand],\n );\n\n return (\n <StyledFooterMenu expanded={expanded} getOwnerProps={getOwnerProps}>\n {showLabel ? <StyledFooterLabel getOwnerProps={getOwnerProps}>{footerLabel}</StyledFooterLabel> : null}\n {showLabel ? <StyledFooterSeparator aria-hidden=\"true\" getOwnerProps={getOwnerProps} /> : null}\n <StyledFooterButton\n type=\"button\"\n aria-label={expanded ? 'Collapse left navigation' : 'Expand left navigation'}\n onClick={handleClick}\n onFocus={trackFocusFooter}\n innerRef={focusRef}\n getOwnerProps={getOwnerProps}\n >\n {expanded ? <MenuCollapse size=\"m\" color={ICON_COLOR} /> : <MenuExpand size=\"m\" color={ICON_COLOR} />}\n </StyledFooterButton>\n </StyledFooterMenu>\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACmCnB,SACe,KADf;AAnCJ,SAAgB,aAAa,kBAAkB;AAC/C,SAAS,cAAc,kBAAkB;AACzC,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAChC,SAAS,8BAA8B;AACvC,SAAS,oBAAoB,mBAAmB,kBAAkB,6BAA6B;AAE/F,MAAM,aAAa,CAAC,iBAAiB,KAAK;AAEnC,MAAM,SAAS,MAAM;AAC1B,QAAM,EAAE,OAAO,cAAc,IAAI,WAAW,WAAW;AACvD,QAAM,cAAc,cAAc,CAAC,UAAU,MAAM,WAAW;AAC9D,QAAM,iBAAiB,cAAc,CAAC,UAAU,MAAM,cAAc;AACpE,QAAM,gBAAgB,cAAc,CAAC,UAAU,MAAM,aAAa;AAClE,QAAM,EAAE,iBAAiB,IAAI,gBAAgB;AAC7C,QAAM,WAAW,CAAC,MAAM;AACxB,QAAM,YAAY,YAAY,CAAC,CAAC;AAChC,QAAM,gBAAgB,uBAAuB,KAAK;AAElD,QAAM,WAAW;AAAA,IACf,CAAC,SAA6B;AAC5B,UAAI,QAAQ,cAAe,MAAK,MAAM;AAAA,IACxC;AAAA,IACA,CAAC,aAAa;AAAA,EAChB;AACA,QAAM,cAAc;AAAA,IAClB,CAAC,MAAqC;AACpC,UAAI,SAAU,eAAc,CAAC;AAAA,UACxB,gBAAe,CAAC;AAAA,IACvB;AAAA,IACA,CAAC,UAAU,eAAe,cAAc;AAAA,EAC1C;AAEA,SACE,qBAAC,oBAAiB,UAAoB,eACnC;AAAA,gBAAY,oBAAC,qBAAkB,eAA+B,uBAAY,IAAuB;AAAA,IACjG,YAAY,oBAAC,yBAAsB,eAAY,QAAO,eAA8B,IAAK;AAAA,IAC1F;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,cAAY,WAAW,6BAA6B;AAAA,QACpD,SAAS;AAAA,QACT,SAAS;AAAA,QACT,UAAU;AAAA,QACV;AAAA,QAEC,qBAAW,oBAAC,gBAAa,MAAK,KAAI,OAAO,YAAY,IAAK,oBAAC,cAAW,MAAK,KAAI,OAAO,YAAY;AAAA;AAAA,IACrG;AAAA,KACF;AAEJ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,91 @@
1
+ import * as React from "react";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { useCallback, useContext } from "react";
4
+ import { ChevronSmallDown, ChevronSmallRight } from "@elliemae/ds-icons";
5
+ import { TreeContext } from "./TreeContext.js";
6
+ import { usePropsStore } from "../config/store.js";
7
+ import { useFocusTracker } from "../config/useFocusTracker.js";
8
+ import {
9
+ StyledArrowContainer,
10
+ StyledCollapsedContainer,
11
+ StyledHeaderDisclosure,
12
+ StyledItemLabel,
13
+ StyledLeftContainer,
14
+ StyledRightContainer
15
+ } from "./styled.js";
16
+ const HIDDEN_LABEL_STYLE = { display: "none" };
17
+ const CHEVRON_COLOR = ["brand-primary", "800"];
18
+ const HeaderDisclosure = () => {
19
+ const { model, getOwnerProps, labelOverflow, getElementId } = useContext(TreeContext);
20
+ const onItemClick = usePropsStore((state) => state.onItemClick);
21
+ const { trackFocusHeader } = useFocusTracker();
22
+ const { headerItem, isHeaderOpen, isRail } = model;
23
+ const handleClick = useCallback(
24
+ (e) => {
25
+ if (headerItem) onItemClick(headerItem, e);
26
+ },
27
+ [headerItem, onItemClick]
28
+ );
29
+ const getOwnerPropsArguments = useCallback(
30
+ () => ({ item: headerItem, level: 1, isOpen: isHeaderOpen && !isRail, isCurrent: false }),
31
+ [headerItem, isHeaderOpen, isRail]
32
+ );
33
+ if (!headerItem) return null;
34
+ const { label, RightComponent } = headerItem.itemOpts ?? {};
35
+ const { CollapsedComponent } = headerItem;
36
+ const labelId = getElementId("label", headerItem.dsId);
37
+ const descriptionId = getElementId("description", headerItem.dsId);
38
+ return /* @__PURE__ */ jsxs(
39
+ StyledHeaderDisclosure,
40
+ {
41
+ type: "button",
42
+ isRail,
43
+ isOpen: isHeaderOpen && !isRail,
44
+ "aria-labelledby": labelId,
45
+ "aria-describedby": RightComponent && !isRail ? descriptionId : void 0,
46
+ "aria-expanded": isRail ? void 0 : isHeaderOpen,
47
+ "aria-controls": isRail || model.visibleIds.length === 0 ? void 0 : getElementId("tree", "root"),
48
+ onClick: handleClick,
49
+ onFocus: trackFocusHeader,
50
+ getOwnerProps,
51
+ children: [
52
+ isRail ? /* @__PURE__ */ jsx(StyledCollapsedContainer, { getOwnerProps, getOwnerPropsArguments, children: CollapsedComponent ? /* @__PURE__ */ jsx(CollapsedComponent, { item: headerItem }) : null }) : /* @__PURE__ */ jsx(StyledLeftContainer, { getOwnerProps, getOwnerPropsArguments, children: CollapsedComponent ? /* @__PURE__ */ jsx(CollapsedComponent, { item: headerItem }) : null }),
53
+ /* @__PURE__ */ jsx(
54
+ StyledItemLabel,
55
+ {
56
+ id: labelId,
57
+ isTall: true,
58
+ labelOverflow: headerItem.itemOpts?.labelOverflow ?? labelOverflow,
59
+ style: isRail ? HIDDEN_LABEL_STYLE : void 0,
60
+ getOwnerProps,
61
+ getOwnerPropsArguments,
62
+ children: label
63
+ }
64
+ ),
65
+ RightComponent && !isRail ? /* @__PURE__ */ jsx(
66
+ StyledRightContainer,
67
+ {
68
+ id: descriptionId,
69
+ getOwnerProps,
70
+ getOwnerPropsArguments,
71
+ children: /* @__PURE__ */ jsx(RightComponent, { item: headerItem })
72
+ }
73
+ ) : null,
74
+ isRail ? null : /* @__PURE__ */ jsx(
75
+ StyledArrowContainer,
76
+ {
77
+ "aria-hidden": "true",
78
+ isLeading: false,
79
+ getOwnerProps,
80
+ getOwnerPropsArguments,
81
+ children: isHeaderOpen ? /* @__PURE__ */ jsx(ChevronSmallDown, { size: "m", color: CHEVRON_COLOR }) : /* @__PURE__ */ jsx(ChevronSmallRight, { size: "m", color: CHEVRON_COLOR })
82
+ }
83
+ )
84
+ ]
85
+ }
86
+ );
87
+ };
88
+ export {
89
+ HeaderDisclosure
90
+ };
91
+ //# sourceMappingURL=Header.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/Header.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\nimport React, { useCallback, useContext } from 'react';\nimport { ChevronSmallDown, ChevronSmallRight } from '@elliemae/ds-icons';\nimport { TreeContext } from './TreeContext.js';\nimport { usePropsStore } from '../config/store.js';\nimport { useFocusTracker } from '../config/useFocusTracker.js';\nimport {\n StyledArrowContainer,\n StyledCollapsedContainer,\n StyledHeaderDisclosure,\n StyledItemLabel,\n StyledLeftContainer,\n StyledRightContainer,\n} from './styled.js';\n\nconst HIDDEN_LABEL_STYLE = { display: 'none' };\nconst CHEVRON_COLOR = ['brand-primary', '800'] as ['brand-primary', '800'];\n\nexport const HeaderDisclosure = () => {\n const { model, getOwnerProps, labelOverflow, getElementId } = useContext(TreeContext);\n const onItemClick = usePropsStore((state) => state.onItemClick);\n const { trackFocusHeader } = useFocusTracker();\n const { headerItem, isHeaderOpen, isRail } = model;\n\n const handleClick = useCallback(\n (e: React.MouseEvent<HTMLElement>) => {\n if (headerItem) onItemClick(headerItem, e);\n },\n [headerItem, onItemClick],\n );\n const getOwnerPropsArguments = useCallback(\n () => ({ item: headerItem, level: 1, isOpen: isHeaderOpen && !isRail, isCurrent: false }),\n [headerItem, isHeaderOpen, isRail],\n );\n\n if (!headerItem) return null;\n const { label, RightComponent } = headerItem.itemOpts ?? {};\n const { CollapsedComponent } = headerItem;\n const labelId = getElementId('label', headerItem.dsId);\n const descriptionId = getElementId('description', headerItem.dsId);\n\n return (\n <StyledHeaderDisclosure\n type=\"button\"\n isRail={isRail}\n isOpen={isHeaderOpen && !isRail}\n aria-labelledby={labelId}\n aria-describedby={RightComponent && !isRail ? descriptionId : undefined}\n aria-expanded={isRail ? undefined : isHeaderOpen}\n aria-controls={isRail || model.visibleIds.length === 0 ? undefined : getElementId('tree', 'root')}\n onClick={handleClick}\n onFocus={trackFocusHeader}\n getOwnerProps={getOwnerProps}\n >\n {isRail ? (\n <StyledCollapsedContainer getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n {CollapsedComponent ? <CollapsedComponent item={headerItem} /> : null}\n </StyledCollapsedContainer>\n ) : (\n <StyledLeftContainer getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n {CollapsedComponent ? <CollapsedComponent item={headerItem} /> : null}\n </StyledLeftContainer>\n )}\n <StyledItemLabel\n id={labelId}\n isTall\n labelOverflow={headerItem.itemOpts?.labelOverflow ?? labelOverflow}\n style={isRail ? HIDDEN_LABEL_STYLE : undefined}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {label}\n </StyledItemLabel>\n {RightComponent && !isRail ? (\n <StyledRightContainer\n id={descriptionId}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <RightComponent item={headerItem} />\n </StyledRightContainer>\n ) : null}\n {isRail ? null : (\n <StyledArrowContainer\n aria-hidden=\"true\"\n isLeading={false}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {isHeaderOpen ? (\n <ChevronSmallDown size=\"m\" color={CHEVRON_COLOR} />\n ) : (\n <ChevronSmallRight size=\"m\" color={CHEVRON_COLOR} />\n )}\n </StyledArrowContainer>\n )}\n </StyledHeaderDisclosure>\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;AC0CnB,SAc4B,KAd5B;AAzCJ,SAAgB,aAAa,kBAAkB;AAC/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,MAAM;AAAA,MAChG,SAAS;AAAA,MACT,SAAS;AAAA,MACT;AAAA,MAEC;AAAA,iBACC,oBAAC,4BAAyB,eAA8B,wBACrD,+BAAqB,oBAAC,sBAAmB,MAAM,YAAY,IAAK,MACnE,IAEA,oBAAC,uBAAoB,eAA8B,wBAChD,+BAAqB,oBAAC,sBAAmB,MAAM,YAAY,IAAK,MACnE;AAAA,QAEF;AAAA,UAAC;AAAA;AAAA,YACC,IAAI;AAAA,YACJ,QAAM;AAAA,YACN,eAAe,WAAW,UAAU,iBAAiB;AAAA,YACrD,OAAO,SAAS,qBAAqB;AAAA,YACrC;AAAA,YACA;AAAA,YAEC;AAAA;AAAA,QACH;AAAA,QACC,kBAAkB,CAAC,SAClB;AAAA,UAAC;AAAA;AAAA,YACC,IAAI;AAAA,YACJ;AAAA,YACA;AAAA,YAEA,8BAAC,kBAAe,MAAM,YAAY;AAAA;AAAA,QACpC,IACE;AAAA,QACH,SAAS,OACR;AAAA,UAAC;AAAA;AAAA,YACC,eAAY;AAAA,YACZ,WAAW;AAAA,YACX;AAAA,YACA;AAAA,YAEC,yBACC,oBAAC,oBAAiB,MAAK,KAAI,OAAO,eAAe,IAEjD,oBAAC,qBAAkB,MAAK,KAAI,OAAO,eAAe;AAAA;AAAA,QAEtD;AAAA;AAAA;AAAA,EAEJ;AAEJ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,69 @@
1
+ import * as React from "react";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import React2, { useCallback, useId, useMemo } from "react";
4
+ import { useGetGlobalAttributes, useGetXstyledProps, useValidateTypescriptPropTypes } from "@elliemae/ds-props-helpers";
5
+ import { usePropsStore } from "../config/store.js";
6
+ import { useTreeModel } from "../config/useTreeModel.js";
7
+ import { useTreeHandlers } from "../config/useTreeHandlers.js";
8
+ import {
9
+ DSLeftNavigationTreeName,
10
+ LEFT_NAVIGATION_TREE_DATA_TESTID,
11
+ LEFT_NAVIGATION_TREE_DEFAULT_LABEL
12
+ } from "../constants/index.js";
13
+ import { DSLeftNavigationTreePropTypes } from "../react-desc-prop-types.js";
14
+ import { TreeContext } from "./TreeContext.js";
15
+ import { TreeRoot } from "./TreeRoot.js";
16
+ import { HeaderDisclosure } from "./Header.js";
17
+ import { Footer } from "./Footer.js";
18
+ import { StyledRoot } from "./styled.js";
19
+ const MainContent = React2.memo(() => {
20
+ const propsWithDefault = usePropsStore((state) => state);
21
+ useValidateTypescriptPropTypes(propsWithDefault, DSLeftNavigationTreePropTypes, DSLeftNavigationTreeName);
22
+ const getOwnerProps = usePropsStore((state) => state.get);
23
+ const expanded = usePropsStore((state) => state.expanded);
24
+ const expandedWidth = usePropsStore((state) => state.expandedWidth);
25
+ const labelOverflow = usePropsStore((state) => state.labelOverflow);
26
+ const xstyledProps = useGetXstyledProps(propsWithDefault);
27
+ const {
28
+ "aria-label": ariaLabel,
29
+ "aria-labelledby": ariaLabelledBy,
30
+ ...globalAttributes
31
+ } = useGetGlobalAttributes(propsWithDefault);
32
+ const nameProps = useMemo(
33
+ () => ariaLabelledBy ? { "aria-labelledby": ariaLabelledBy } : { "aria-label": ariaLabel ?? LEFT_NAVIGATION_TREE_DEFAULT_LABEL },
34
+ [ariaLabel, ariaLabelledBy]
35
+ );
36
+ const model = useTreeModel();
37
+ const handlers = useTreeHandlers(model);
38
+ const instanceId = useId();
39
+ const getElementId = useCallback(
40
+ (kind, dsId) => `${instanceId}-${kind}-${encodeURIComponent(dsId)}`,
41
+ [instanceId]
42
+ );
43
+ const contextValue = useMemo(
44
+ () => ({ model, handlers, getOwnerProps, labelOverflow, getElementId }),
45
+ [model, handlers, getOwnerProps, labelOverflow, getElementId]
46
+ );
47
+ return /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs(
48
+ StyledRoot,
49
+ {
50
+ expanded,
51
+ expandedWidth,
52
+ "data-testid": LEFT_NAVIGATION_TREE_DATA_TESTID.ROOT,
53
+ getOwnerProps,
54
+ ...globalAttributes,
55
+ ...xstyledProps,
56
+ ...nameProps,
57
+ children: [
58
+ /* @__PURE__ */ jsx(HeaderDisclosure, {}),
59
+ /* @__PURE__ */ jsx(TreeRoot, { nameProps }),
60
+ /* @__PURE__ */ jsx(Footer, {})
61
+ ]
62
+ }
63
+ ) });
64
+ });
65
+ MainContent.displayName = `${DSLeftNavigationTreeName}.MainContent`;
66
+ export {
67
+ MainContent
68
+ };
69
+ //# sourceMappingURL=MainContent.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/MainContent.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback, useId, useMemo } from 'react';\nimport { useGetGlobalAttributes, useGetXstyledProps, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { usePropsStore } from '../config/store.js';\nimport { useTreeModel } from '../config/useTreeModel.js';\nimport { useTreeHandlers } from '../config/useTreeHandlers.js';\nimport {\n DSLeftNavigationTreeName,\n LEFT_NAVIGATION_TREE_DATA_TESTID,\n LEFT_NAVIGATION_TREE_DEFAULT_LABEL,\n} from '../constants/index.js';\nimport { DSLeftNavigationTreePropTypes, type DSLeftNavigationTreeT } from '../react-desc-prop-types.js';\nimport { TreeContext, type TreeContextValue } from './TreeContext.js';\nimport { TreeRoot } from './TreeRoot.js';\nimport { HeaderDisclosure } from './Header.js';\nimport { Footer } from './Footer.js';\nimport { StyledRoot } from './styled.js';\n\nexport const MainContent = React.memo(() => {\n const propsWithDefault = usePropsStore((state) => state) as DSLeftNavigationTreeT.InternalProps;\n useValidateTypescriptPropTypes(propsWithDefault, DSLeftNavigationTreePropTypes, DSLeftNavigationTreeName);\n const getOwnerProps = usePropsStore((state) => state.get);\n const expanded = usePropsStore((state) => state.expanded);\n const expandedWidth = usePropsStore((state) => state.expandedWidth);\n const labelOverflow = usePropsStore((state) => state.labelOverflow);\n\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n const {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n ...globalAttributes\n } = useGetGlobalAttributes<DSLeftNavigationTreeT.InternalProps, HTMLElement>(propsWithDefault);\n const nameProps = useMemo(\n () =>\n ariaLabelledBy\n ? { 'aria-labelledby': ariaLabelledBy }\n : { 'aria-label': ariaLabel ?? LEFT_NAVIGATION_TREE_DEFAULT_LABEL },\n [ariaLabel, ariaLabelledBy],\n );\n\n const model = useTreeModel();\n const handlers = useTreeHandlers(model);\n\n const instanceId = useId();\n const getElementId = useCallback(\n (kind: string, dsId: string) => `${instanceId}-${kind}-${encodeURIComponent(dsId)}`,\n [instanceId],\n );\n\n const contextValue: TreeContextValue = useMemo(\n () => ({ model, handlers, getOwnerProps, labelOverflow, getElementId }),\n [model, handlers, getOwnerProps, labelOverflow, getElementId],\n );\n\n return (\n <TreeContext.Provider value={contextValue}>\n <StyledRoot\n expanded={expanded}\n expandedWidth={expandedWidth}\n data-testid={LEFT_NAVIGATION_TREE_DATA_TESTID.ROOT}\n getOwnerProps={getOwnerProps}\n {...globalAttributes}\n {...xstyledProps}\n {...nameProps}\n >\n <HeaderDisclosure />\n <TreeRoot nameProps={nameProps} />\n <Footer />\n </StyledRoot>\n </TreeContext.Provider>\n );\n});\n\nMainContent.displayName = `${DSLeftNavigationTreeName}.MainContent`;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACuDjB,SASE,KATF;AAvDN,OAAOA,UAAS,aAAa,OAAO,eAAe;AACnD,SAAS,wBAAwB,oBAAoB,sCAAsC;AAC3F,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;AAChC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,qCAAiE;AAC1E,SAAS,mBAA0C;AACnD,SAAS,gBAAgB;AACzB,SAAS,wBAAwB;AACjC,SAAS,cAAc;AACvB,SAAS,kBAAkB;AAEpB,MAAM,cAAcA,OAAM,KAAK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AC;AAED,YAAY,cAAc,GAAG,wBAAwB;",
6
+ "names": ["React"]
7
+ }
@@ -0,0 +1,79 @@
1
+ import * as React from "react";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import React2, { useCallback, useContext } from "react";
4
+ import { ROW_PADDING } from "../config/treeModel.js";
5
+ import { useItemFocusState } from "../config/useTreeModel.js";
6
+ import { TreeContext } from "./TreeContext.js";
7
+ import { StyledCollapsedContainer, StyledItem, StyledItemLabel, StyledItemRow } from "./styled.js";
8
+ const HIDDEN_LABEL_STYLE = { display: "none" };
9
+ const RailItem = React2.memo(({ id }) => {
10
+ const { model, handlers, getOwnerProps, labelOverflow, getElementId } = useContext(TreeContext);
11
+ const info = model.index.get(id);
12
+ const isCurrent = model.currentLeafId === id;
13
+ const isSelectedParent = model.selectedParentIds.has(id);
14
+ const focusState = useItemFocusState(model, id);
15
+ const item = info?.item;
16
+ const focusRef = useCallback(
17
+ (node) => {
18
+ if (node && focusState === "focus-target") node.focus();
19
+ },
20
+ [focusState]
21
+ );
22
+ const handleClick = useCallback((e) => handlers.activate(id, e), [handlers, id]);
23
+ const getOwnerPropsArguments = useCallback(() => ({ item, level: 1, isOpen: false, isCurrent }), [item, isCurrent]);
24
+ if (!info || !item?.CollapsedComponent) return null;
25
+ const { CollapsedComponent } = item;
26
+ const labelId = getElementId("label", id);
27
+ return /* @__PURE__ */ jsx(
28
+ StyledItem,
29
+ {
30
+ isOpenSection: false,
31
+ role: "treeitem",
32
+ "aria-level": 1,
33
+ "aria-current": isCurrent ? "page" : void 0,
34
+ "aria-labelledby": labelId,
35
+ tabIndex: focusState === "none" ? -1 : 0,
36
+ "data-dsid": id,
37
+ "data-type": item.type,
38
+ "data-selected": isCurrent,
39
+ "data-selectedparent": isSelectedParent,
40
+ innerRef: focusRef,
41
+ getOwnerProps,
42
+ getOwnerPropsArguments,
43
+ children: /* @__PURE__ */ jsxs(
44
+ StyledItemRow,
45
+ {
46
+ "data-row": true,
47
+ rowPadding: ROW_PADDING,
48
+ isTall: true,
49
+ isSticky: false,
50
+ isCurrent,
51
+ isSelectedParent,
52
+ onClick: handleClick,
53
+ getOwnerProps,
54
+ getOwnerPropsArguments,
55
+ children: [
56
+ /* @__PURE__ */ jsx(StyledCollapsedContainer, { getOwnerProps, getOwnerPropsArguments, children: /* @__PURE__ */ jsx(CollapsedComponent, { item }) }),
57
+ /* @__PURE__ */ jsx(
58
+ StyledItemLabel,
59
+ {
60
+ id: labelId,
61
+ isTall: true,
62
+ labelOverflow,
63
+ style: HIDDEN_LABEL_STYLE,
64
+ getOwnerProps,
65
+ getOwnerPropsArguments,
66
+ children: item.itemOpts?.label
67
+ }
68
+ )
69
+ ]
70
+ }
71
+ )
72
+ }
73
+ );
74
+ });
75
+ RailItem.displayName = "DSLeftNavigationTree.RailItem";
76
+ export {
77
+ RailItem
78
+ };
79
+ //# sourceMappingURL=RailItem.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/RailItem.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback, useContext } from 'react';\nimport { ROW_PADDING } from '../config/treeModel.js';\nimport { useItemFocusState } from '../config/useTreeModel.js';\nimport { TreeContext } from './TreeContext.js';\nimport { StyledCollapsedContainer, StyledItem, StyledItemLabel, StyledItemRow } from './styled.js';\n\nconst HIDDEN_LABEL_STYLE = { display: 'none' };\n\n/**\n * Collapsed-rail node: an icon-only end treeitem. The label stays in the DOM with display: none\n * because it is the aria-labelledby target (hidden targets still name the element, and are not read twice).\n */\nexport const RailItem = React.memo(({ id }: { id: string }) => {\n const { model, handlers, getOwnerProps, labelOverflow, getElementId } = useContext(TreeContext);\n const info = model.index.get(id);\n const isCurrent = model.currentLeafId === id;\n const isSelectedParent = model.selectedParentIds.has(id);\n const focusState = useItemFocusState(model, id);\n const item = info?.item;\n\n const focusRef = useCallback(\n (node: HTMLElement | null) => {\n if (node && focusState === 'focus-target') node.focus();\n },\n [focusState],\n );\n const handleClick = useCallback((e: React.MouseEvent<HTMLElement>) => handlers.activate(id, e), [handlers, id]);\n const getOwnerPropsArguments = useCallback(() => ({ item, level: 1, isOpen: false, isCurrent }), [item, isCurrent]);\n\n if (!info || !item?.CollapsedComponent) return null;\n const { CollapsedComponent } = item;\n const labelId = getElementId('label', id);\n\n return (\n <StyledItem\n isOpenSection={false}\n role=\"treeitem\"\n aria-level={1}\n aria-current={isCurrent ? 'page' : undefined}\n aria-labelledby={labelId}\n tabIndex={focusState === 'none' ? -1 : 0}\n data-dsid={id}\n data-type={item.type}\n data-selected={isCurrent}\n data-selectedparent={isSelectedParent}\n innerRef={focusRef}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledItemRow\n data-row\n rowPadding={ROW_PADDING}\n isTall\n isSticky={false}\n isCurrent={isCurrent}\n isSelectedParent={isSelectedParent}\n onClick={handleClick}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledCollapsedContainer getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n <CollapsedComponent item={item} />\n </StyledCollapsedContainer>\n <StyledItemLabel\n id={labelId}\n isTall\n labelOverflow={labelOverflow}\n style={HIDDEN_LABEL_STYLE}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {item.itemOpts?.label}\n </StyledItemLabel>\n </StyledItemRow>\n </StyledItem>\n );\n});\n\nRailItem.displayName = 'DSLeftNavigationTree.RailItem';\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACiDjB,SAYI,KAZJ;AAjDN,OAAOA,UAAS,aAAa,kBAAkB;AAC/C,SAAS,mBAAmB;AAC5B,SAAS,yBAAyB;AAClC,SAAS,mBAAmB;AAC5B,SAAS,0BAA0B,YAAY,iBAAiB,qBAAqB;AAErF,MAAM,qBAAqB,EAAE,SAAS,OAAO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A,gCAAC,4BAAyB,eAA8B,wBACtD,8BAAC,sBAAmB,MAAY,GAClC;AAAA,YACA;AAAA,cAAC;AAAA;AAAA,gBACC,IAAI;AAAA,gBACJ,QAAM;AAAA,gBACN;AAAA,gBACA,OAAO;AAAA,gBACP;AAAA,gBACA;AAAA,gBAEC,eAAK,UAAU;AAAA;AAAA,YAClB;AAAA;AAAA;AAAA,MACF;AAAA;AAAA,EACF;AAEJ,CAAC;AAED,SAAS,cAAc;",
6
+ "names": ["React"]
7
+ }
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ import { createContext } from "react";
3
+ const TreeContext = createContext({});
4
+ export {
5
+ TreeContext
6
+ };
7
+ //# sourceMappingURL=TreeContext.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/TreeContext.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { createContext } from 'react';\nimport type { DSLeftNavigationTreeT } from '../react-desc-prop-types.js';\nimport type { TreeModel } from '../config/useTreeModel.js';\nimport type { useTreeHandlers } from '../config/useTreeHandlers.js';\n\nexport type TreeContextValue = {\n model: TreeModel;\n handlers: ReturnType<typeof useTreeHandlers>;\n getOwnerProps: () => object;\n labelOverflow: DSLeftNavigationTreeT.LabelOverflowT;\n getElementId: (kind: string, dsId: string) => string;\n};\n\nexport const TreeContext = createContext<TreeContextValue>({} as TreeContextValue);\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,qBAAqB;AAavB,MAAM,cAAc,cAAgC,CAAC,CAAqB;",
6
+ "names": []
7
+ }