@elliemae/ds-left-navigation-tree 0.0.0-stage → 3.80.0-next.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/DSLeftNavigationTree.js +46 -0
- package/dist/cjs/DSLeftNavigationTree.js.map +7 -0
- package/dist/cjs/config/store.js +63 -0
- package/dist/cjs/config/store.js.map +7 -0
- package/dist/cjs/config/treeModel.js +178 -0
- package/dist/cjs/config/treeModel.js.map +7 -0
- package/dist/cjs/config/useAutoCalculated.js +37 -0
- package/dist/cjs/config/useAutoCalculated.js.map +7 -0
- package/dist/cjs/config/useFocusTracker.js +63 -0
- package/dist/cjs/config/useFocusTracker.js.map +7 -0
- package/dist/cjs/config/useTreeHandlers.js +157 -0
- package/dist/cjs/config/useTreeHandlers.js.map +7 -0
- package/dist/cjs/config/useTreeModel.js +110 -0
- package/dist/cjs/config/useTreeModel.js.map +7 -0
- package/dist/cjs/config/useValidateProps.js +40 -0
- package/dist/cjs/config/useValidateProps.js.map +7 -0
- package/dist/cjs/constants/index.js +79 -0
- package/dist/cjs/constants/index.js.map +7 -0
- package/dist/cjs/index.js +46 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/package.json +7 -0
- package/dist/cjs/parts/Footer.js +83 -0
- package/dist/cjs/parts/Footer.js.map +7 -0
- package/dist/cjs/parts/Header.js +114 -0
- package/dist/cjs/parts/Header.js.map +7 -0
- package/dist/cjs/parts/MainContent.js +95 -0
- package/dist/cjs/parts/MainContent.js.map +7 -0
- package/dist/cjs/parts/RailItem.js +109 -0
- package/dist/cjs/parts/RailItem.js.map +7 -0
- package/dist/cjs/parts/TreeContext.js +37 -0
- package/dist/cjs/parts/TreeContext.js.map +7 -0
- package/dist/cjs/parts/TreeItem.js +171 -0
- package/dist/cjs/parts/TreeItem.js.map +7 -0
- package/dist/cjs/parts/TreeRoot.js +76 -0
- package/dist/cjs/parts/TreeRoot.js.map +7 -0
- package/dist/cjs/parts/styled.js +221 -0
- package/dist/cjs/parts/styled.js.map +7 -0
- package/dist/cjs/react-desc-prop-types.js +125 -0
- package/dist/cjs/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/typescript-testing/DSLeftNavigationTreeNamespace.js +172 -0
- package/dist/cjs/typescript-testing/DSLeftNavigationTreeNamespace.js.map +7 -0
- package/dist/cjs/typescript-testing/slot-props.js +82 -0
- package/dist/cjs/typescript-testing/slot-props.js.map +7 -0
- package/dist/esm/DSLeftNavigationTree.js +16 -0
- package/dist/esm/DSLeftNavigationTree.js.map +7 -0
- package/dist/esm/config/store.js +33 -0
- package/dist/esm/config/store.js.map +7 -0
- package/dist/esm/config/treeModel.js +148 -0
- package/dist/esm/config/treeModel.js.map +7 -0
- package/dist/esm/config/useAutoCalculated.js +7 -0
- package/dist/esm/config/useAutoCalculated.js.map +7 -0
- package/dist/esm/config/useFocusTracker.js +33 -0
- package/dist/esm/config/useFocusTracker.js.map +7 -0
- package/dist/esm/config/useTreeHandlers.js +133 -0
- package/dist/esm/config/useTreeHandlers.js.map +7 -0
- package/dist/esm/config/useTreeModel.js +90 -0
- package/dist/esm/config/useTreeModel.js.map +7 -0
- package/dist/esm/config/useValidateProps.js +10 -0
- package/dist/esm/config/useValidateProps.js.map +7 -0
- package/dist/esm/constants/index.js +49 -0
- package/dist/esm/constants/index.js.map +7 -0
- package/dist/esm/index.js +25 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/package.json +7 -0
- package/dist/esm/parts/Footer.js +53 -0
- package/dist/esm/parts/Footer.js.map +7 -0
- package/dist/esm/parts/Header.js +91 -0
- package/dist/esm/parts/Header.js.map +7 -0
- package/dist/esm/parts/MainContent.js +69 -0
- package/dist/esm/parts/MainContent.js.map +7 -0
- package/dist/esm/parts/RailItem.js +79 -0
- package/dist/esm/parts/RailItem.js.map +7 -0
- package/dist/esm/parts/TreeContext.js +7 -0
- package/dist/esm/parts/TreeContext.js.map +7 -0
- package/dist/esm/parts/TreeItem.js +149 -0
- package/dist/esm/parts/TreeItem.js.map +7 -0
- package/dist/esm/parts/TreeRoot.js +46 -0
- package/dist/esm/parts/TreeRoot.js.map +7 -0
- package/dist/esm/parts/styled.js +191 -0
- package/dist/esm/parts/styled.js.map +7 -0
- package/dist/esm/react-desc-prop-types.js +105 -0
- package/dist/esm/react-desc-prop-types.js.map +7 -0
- package/dist/esm/typescript-testing/DSLeftNavigationTreeNamespace.js +149 -0
- package/dist/esm/typescript-testing/DSLeftNavigationTreeNamespace.js.map +7 -0
- package/dist/esm/typescript-testing/slot-props.js +59 -0
- package/dist/esm/typescript-testing/slot-props.js.map +7 -0
- package/dist/types/DSLeftNavigationTree.d.ts +4 -0
- package/dist/types/config/store.d.ts +38 -0
- package/dist/types/config/treeModel.d.ts +69 -0
- package/dist/types/config/useAutoCalculated.d.ts +1 -0
- package/dist/types/config/useFocusTracker.d.ts +11 -0
- package/dist/types/config/useTreeHandlers.d.ts +11 -0
- package/dist/types/config/useTreeModel.d.ts +22 -0
- package/dist/types/config/useValidateProps.d.ts +3 -0
- package/dist/types/constants/index.d.ts +54 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/parts/Footer.d.ts +2 -0
- package/dist/types/parts/Header.d.ts +2 -0
- package/dist/types/parts/MainContent.d.ts +2 -0
- package/dist/types/parts/RailItem.d.ts +8 -0
- package/dist/types/parts/TreeContext.d.ts +11 -0
- package/dist/types/parts/TreeItem.d.ts +4 -0
- package/dist/types/parts/TreeRoot.d.ts +9 -0
- package/dist/types/parts/styled.d.ts +46 -0
- package/dist/types/react-desc-prop-types.d.ts +99 -0
- package/package.json +72 -4
- package/README.md +0 -3
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name2 in all)
|
|
10
|
+
__defProp(target, name2, { get: all[name2], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var styled_exports = {};
|
|
30
|
+
__export(styled_exports, {
|
|
31
|
+
StyledArrowContainer: () => StyledArrowContainer,
|
|
32
|
+
StyledCollapsedContainer: () => StyledCollapsedContainer,
|
|
33
|
+
StyledFooterButton: () => StyledFooterButton,
|
|
34
|
+
StyledFooterLabel: () => StyledFooterLabel,
|
|
35
|
+
StyledFooterMenu: () => StyledFooterMenu,
|
|
36
|
+
StyledFooterSeparator: () => StyledFooterSeparator,
|
|
37
|
+
StyledGroup: () => StyledGroup,
|
|
38
|
+
StyledHeaderDisclosure: () => StyledHeaderDisclosure,
|
|
39
|
+
StyledItem: () => StyledItem,
|
|
40
|
+
StyledItemLabel: () => StyledItemLabel,
|
|
41
|
+
StyledItemRow: () => StyledItemRow,
|
|
42
|
+
StyledItemSeparator: () => StyledItemSeparator,
|
|
43
|
+
StyledLeftContainer: () => StyledLeftContainer,
|
|
44
|
+
StyledRightContainer: () => StyledRightContainer,
|
|
45
|
+
StyledRoot: () => StyledRoot,
|
|
46
|
+
StyledSectionContainer: () => StyledSectionContainer,
|
|
47
|
+
StyledSectionLabel: () => StyledSectionLabel,
|
|
48
|
+
StyledTree: () => StyledTree
|
|
49
|
+
});
|
|
50
|
+
module.exports = __toCommonJS(styled_exports);
|
|
51
|
+
var React = __toESM(require("react"));
|
|
52
|
+
var import_ds_system = require("@elliemae/ds-system");
|
|
53
|
+
var import_constants = require("../constants/index.js");
|
|
54
|
+
const SLOTS = import_constants.LEFT_NAVIGATION_TREE_SLOTS;
|
|
55
|
+
const name = import_constants.DSLeftNavigationTreeName;
|
|
56
|
+
const StyledRoot = (0, import_ds_system.styled)("nav", { name, slot: SLOTS.ROOT })`
|
|
57
|
+
display: flex;
|
|
58
|
+
flex-direction: column;
|
|
59
|
+
width: ${({ expanded, expandedWidth }) => expanded ? expandedWidth : "48px"};
|
|
60
|
+
transition: width ${({ expanded }) => expanded ? "ease-out" : "ease-in"} 350ms;
|
|
61
|
+
height: 100%;
|
|
62
|
+
overflow: hidden;
|
|
63
|
+
border: 1px solid ${({ theme }) => theme.colors.neutral[100]};
|
|
64
|
+
box-shadow: -1px 0 0 0 ${({ theme }) => theme.colors.neutral[100]};
|
|
65
|
+
background: ${({ theme }) => theme.colors.neutral["000"]};
|
|
66
|
+
`;
|
|
67
|
+
const StyledTree = (0, import_ds_system.styled)("ul", { name, slot: SLOTS.TREE })`
|
|
68
|
+
list-style: none;
|
|
69
|
+
margin: 0;
|
|
70
|
+
padding: 0;
|
|
71
|
+
overflow-y: auto;
|
|
72
|
+
${({ isHeaderContent, theme }) => isHeaderContent ? `& [data-row], & [data-row]:hover { box-shadow: inset 4px 0 0 0 ${theme.colors.brand[500]}; }` : ""}
|
|
73
|
+
`;
|
|
74
|
+
const StyledGroup = (0, import_ds_system.styled)("ul", { name, slot: SLOTS.GROUP })`
|
|
75
|
+
list-style: none;
|
|
76
|
+
margin: 0;
|
|
77
|
+
padding: 0;
|
|
78
|
+
`;
|
|
79
|
+
const StyledSectionContainer = (0, import_ds_system.styled)("ul", { name, slot: SLOTS.SECTION_CONTAINER })`
|
|
80
|
+
list-style: none;
|
|
81
|
+
margin: 0;
|
|
82
|
+
padding: 0;
|
|
83
|
+
`;
|
|
84
|
+
const StyledSectionLabel = (0, import_ds_system.styled)("span", { name, slot: SLOTS.SECTION_LABEL })`
|
|
85
|
+
display: block;
|
|
86
|
+
padding: 8px 12px 4px;
|
|
87
|
+
font-size: 1rem;
|
|
88
|
+
font-weight: ${({ theme }) => theme.fontWeights.semibold};
|
|
89
|
+
color: ${({ theme }) => theme.colors.neutral[700]};
|
|
90
|
+
`;
|
|
91
|
+
const StyledItemSeparator = (0, import_ds_system.styled)("div", { name, slot: SLOTS.ITEM_SEPARATOR })`
|
|
92
|
+
height: 1px;
|
|
93
|
+
margin: 4px 12px;
|
|
94
|
+
background: ${({ theme }) => theme.colors.neutral[100]};
|
|
95
|
+
`;
|
|
96
|
+
const StyledItem = (0, import_ds_system.styled)("li", { name, slot: SLOTS.ITEM })`
|
|
97
|
+
list-style: none;
|
|
98
|
+
outline: none;
|
|
99
|
+
${({ isOpenSection, theme }) => isOpenSection ? `& [data-row], & [data-row]:hover { box-shadow: inset 4px 0 0 0 ${theme.colors.brand[500]}; }` : ""}
|
|
100
|
+
&:focus-visible > [data-row] {
|
|
101
|
+
outline: 2px solid ${({ theme }) => theme.colors.brand[700]};
|
|
102
|
+
outline-offset: -2px;
|
|
103
|
+
}
|
|
104
|
+
`;
|
|
105
|
+
const StyledItemRow = (0, import_ds_system.styled)("div", { name, slot: SLOTS.ITEM_ROW })`
|
|
106
|
+
/** Labels wrap: side content aligns to the first line (spec "date is pinned on the right side of the first line"). */
|
|
107
|
+
--row-first-line: ${({ isTall }) => isTall ? "24px" : "16px"};
|
|
108
|
+
display: flex;
|
|
109
|
+
align-items: flex-start;
|
|
110
|
+
column-gap: 8px;
|
|
111
|
+
min-height: ${({ isTall }) => isTall ? "48px" : "32px"};
|
|
112
|
+
padding-block: ${({ isTall }) => isTall ? "12px" : "8px"};
|
|
113
|
+
box-sizing: border-box;
|
|
114
|
+
padding-left: ${({ rowPadding }) => `${rowPadding}px`};
|
|
115
|
+
${({ isSticky }) => isSticky ? "position: sticky; top: 0; z-index: 1;" : ""}
|
|
116
|
+
padding-right: 8px;
|
|
117
|
+
cursor: pointer;
|
|
118
|
+
background: ${({ isCurrent, theme }) => isCurrent ? theme.colors.brand[200] : theme.colors.neutral["000"]};
|
|
119
|
+
box-shadow: inset 4px 0 0 0
|
|
120
|
+
${({ isCurrent, isSelectedParent, theme }) => isCurrent || isSelectedParent ? theme.colors.brand[500] : "transparent"};
|
|
121
|
+
${({ isCurrent, theme }) => isCurrent ? `outline: 1px solid ${theme.colors.brand[500]}; outline-offset: -1px;` : ""}
|
|
122
|
+
&:hover {
|
|
123
|
+
background: ${({ theme }) => theme.colors.brand[200]};
|
|
124
|
+
box-shadow: inset 4px 0 0 0
|
|
125
|
+
${({ isCurrent, isSelectedParent, theme }) => isCurrent || isSelectedParent ? theme.colors.brand[500] : theme.colors.brand[300]};
|
|
126
|
+
}
|
|
127
|
+
`;
|
|
128
|
+
const StyledItemLabel = (0, import_ds_system.styled)("span", { name, slot: SLOTS.ITEM_LABEL })`
|
|
129
|
+
font-size: ${({ isTall }) => isTall ? "1.0769rem" : "1rem"};
|
|
130
|
+
line-height: ${({ isTall }) => isTall ? "17px" : "16px"};
|
|
131
|
+
padding-block: ${({ isTall }) => isTall ? "3.5px" : "0"};
|
|
132
|
+
color: ${({ theme }) => theme.colors.neutral[800]};
|
|
133
|
+
word-break: ${({ labelOverflow }) => labelOverflow === "wrapAll" ? "break-all" : "normal"};
|
|
134
|
+
overflow-wrap: anywhere;
|
|
135
|
+
flex: 1;
|
|
136
|
+
min-width: 0;
|
|
137
|
+
`;
|
|
138
|
+
const StyledLeftContainer = (0, import_ds_system.styled)("span", { name, slot: SLOTS.LEFT_CONTAINER })`
|
|
139
|
+
display: inline-flex;
|
|
140
|
+
align-items: center;
|
|
141
|
+
min-height: var(--row-first-line, auto);
|
|
142
|
+
`;
|
|
143
|
+
const StyledCollapsedContainer = (0, import_ds_system.styled)("span", { name, slot: SLOTS.COLLAPSED_CONTAINER })`
|
|
144
|
+
display: inline-flex;
|
|
145
|
+
align-items: center;
|
|
146
|
+
justify-content: center;
|
|
147
|
+
min-height: var(--row-first-line, auto);
|
|
148
|
+
`;
|
|
149
|
+
const StyledRightContainer = (0, import_ds_system.styled)("span", { name, slot: SLOTS.RIGHT_CONTAINER })`
|
|
150
|
+
display: inline-flex;
|
|
151
|
+
align-items: center;
|
|
152
|
+
min-height: var(--row-first-line, auto);
|
|
153
|
+
`;
|
|
154
|
+
const StyledArrowContainer = (0, import_ds_system.styled)("span", { name, slot: SLOTS.ARROW_CONTAINER })`
|
|
155
|
+
display: inline-flex;
|
|
156
|
+
align-items: center;
|
|
157
|
+
justify-content: center;
|
|
158
|
+
flex: none;
|
|
159
|
+
min-height: var(--row-first-line, auto);
|
|
160
|
+
${({ isLeading }) => isLeading ? "width: 16px; margin-inline-end: -8px;" : ""}
|
|
161
|
+
`;
|
|
162
|
+
const StyledHeaderDisclosure = (0, import_ds_system.styled)("button", { name, slot: SLOTS.HEADER_DISCLOSURE })`
|
|
163
|
+
--row-first-line: 24px;
|
|
164
|
+
display: flex;
|
|
165
|
+
align-items: center;
|
|
166
|
+
column-gap: 8px;
|
|
167
|
+
width: 100%;
|
|
168
|
+
min-height: 48px;
|
|
169
|
+
padding: 0 8px 0 12px;
|
|
170
|
+
border: none;
|
|
171
|
+
border-bottom: 1px solid ${({ theme }) => theme.colors.neutral[100]};
|
|
172
|
+
background: ${({ theme }) => theme.colors.neutral["000"]};
|
|
173
|
+
box-shadow: inset 4px 0 0 0 ${({ isOpen, theme }) => isOpen ? theme.colors.brand[500] : "transparent"};
|
|
174
|
+
text-align: left;
|
|
175
|
+
font-size: 1.0769rem;
|
|
176
|
+
color: ${({ theme }) => theme.colors.neutral[800]};
|
|
177
|
+
cursor: pointer;
|
|
178
|
+
&:hover {
|
|
179
|
+
background: ${({ theme }) => theme.colors.brand[200]};
|
|
180
|
+
box-shadow: inset 4px 0 0 0 ${({ isOpen, theme }) => isOpen ? theme.colors.brand[500] : theme.colors.brand[300]};
|
|
181
|
+
}
|
|
182
|
+
&:focus-visible {
|
|
183
|
+
outline: 2px solid ${({ theme }) => theme.colors.brand[700]};
|
|
184
|
+
outline-offset: -2px;
|
|
185
|
+
}
|
|
186
|
+
`;
|
|
187
|
+
const StyledFooterMenu = (0, import_ds_system.styled)("div", { name, slot: SLOTS.FOOTER_MENU })`
|
|
188
|
+
display: grid;
|
|
189
|
+
grid-template-columns: ${({ expanded }) => expanded ? "1fr auto auto" : "1fr"};
|
|
190
|
+
align-items: center;
|
|
191
|
+
column-gap: 8px;
|
|
192
|
+
margin-top: auto;
|
|
193
|
+
min-height: 48px;
|
|
194
|
+
padding: 0 4px 0 12px;
|
|
195
|
+
border-top: 1px solid ${({ theme }) => theme.colors.neutral[100]};
|
|
196
|
+
`;
|
|
197
|
+
const StyledFooterLabel = (0, import_ds_system.styled)("span", { name, slot: SLOTS.FOOTER_LABEL })`
|
|
198
|
+
font-size: 11px;
|
|
199
|
+
line-height: 14px;
|
|
200
|
+
color: ${({ theme }) => theme.colors.neutral[500]};
|
|
201
|
+
`;
|
|
202
|
+
const StyledFooterSeparator = (0, import_ds_system.styled)("span", { name, slot: SLOTS.FOOTER_SEPARATOR })`
|
|
203
|
+
width: 1px;
|
|
204
|
+
height: 16px;
|
|
205
|
+
background: ${({ theme }) => theme.colors.neutral[100]};
|
|
206
|
+
`;
|
|
207
|
+
const StyledFooterButton = (0, import_ds_system.styled)("button", { name, slot: SLOTS.FOOTER_MENU_COLLAPSE })`
|
|
208
|
+
display: inline-flex;
|
|
209
|
+
align-items: center;
|
|
210
|
+
justify-content: center;
|
|
211
|
+
width: 32px;
|
|
212
|
+
height: 32px;
|
|
213
|
+
padding: 0;
|
|
214
|
+
border: none;
|
|
215
|
+
background: transparent;
|
|
216
|
+
cursor: pointer;
|
|
217
|
+
&:focus-visible {
|
|
218
|
+
outline: 2px solid ${({ theme }) => theme.colors.brand[700]};
|
|
219
|
+
}
|
|
220
|
+
`;
|
|
221
|
+
//# sourceMappingURL=styled.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/parts/styled.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\nimport { styled } from '@elliemae/ds-system';\nimport { DSLeftNavigationTreeName, LEFT_NAVIGATION_TREE_SLOTS } from '../constants/index.js';\nimport type { DSLeftNavigationTreeT } from '../react-desc-prop-types.js';\n\nconst SLOTS = LEFT_NAVIGATION_TREE_SLOTS;\nconst name = DSLeftNavigationTreeName;\n\nexport const StyledRoot = styled('nav', { name, slot: SLOTS.ROOT })<{ expanded: boolean; expandedWidth: string }>`\n display: flex;\n flex-direction: column;\n width: ${({ expanded, expandedWidth }) => (expanded ? expandedWidth : '48px')};\n transition: width ${({ expanded }) => (expanded ? 'ease-out' : 'ease-in')} 350ms;\n height: 100%;\n overflow: hidden;\n border: 1px solid ${({ theme }) => theme.colors.neutral[100]};\n box-shadow: -1px 0 0 0 ${({ theme }) => theme.colors.neutral[100]};\n background: ${({ theme }) => theme.colors.neutral['000']};\n`;\n\nexport const StyledTree = styled('ul', { name, slot: SLOTS.TREE })<{ isHeaderContent: boolean }>`\n list-style: none;\n margin: 0;\n padding: 0;\n overflow-y: auto;\n ${({ isHeaderContent, theme }) =>\n isHeaderContent\n ? `& [data-row], & [data-row]:hover { box-shadow: inset 4px 0 0 0 ${theme.colors.brand[500]}; }`\n : ''}\n`;\n\nexport const StyledGroup = styled('ul', { name, slot: SLOTS.GROUP })`\n list-style: none;\n margin: 0;\n padding: 0;\n`;\n\nexport const StyledSectionContainer = styled('ul', { name, slot: SLOTS.SECTION_CONTAINER })`\n list-style: none;\n margin: 0;\n padding: 0;\n`;\n\nexport const StyledSectionLabel = styled('span', { name, slot: SLOTS.SECTION_LABEL })`\n display: block;\n padding: 8px 12px 4px;\n font-size: 1rem;\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n color: ${({ theme }) => theme.colors.neutral[700]};\n`;\n\nexport const StyledItemSeparator = styled('div', { name, slot: SLOTS.ITEM_SEPARATOR })`\n height: 1px;\n margin: 4px 12px;\n background: ${({ theme }) => theme.colors.neutral[100]};\n`;\n\n/**\n * The focus ring is drawn on the row of the focused treeitem only: the `li` holds the whole\n * expanded subtree, so an outline on it would surround every descendant row.\n */\nexport const StyledItem = styled('li', { name, slot: SLOTS.ITEM })<{ isOpenSection: boolean }>`\n list-style: none;\n outline: none;\n ${({ isOpenSection, theme }) =>\n isOpenSection ? `& [data-row], & [data-row]:hover { box-shadow: inset 4px 0 0 0 ${theme.colors.brand[500]}; }` : ''}\n &:focus-visible > [data-row] {\n outline: 2px solid ${({ theme }) => theme.colors.brand[700]};\n outline-offset: -2px;\n }\n`;\n\nexport const StyledItemRow = styled('div', { name, slot: SLOTS.ITEM_ROW })<{\n rowPadding: number;\n isTall: boolean;\n isSticky: boolean;\n isCurrent: boolean;\n isSelectedParent: boolean;\n}>`\n /** Labels wrap: side content aligns to the first line (spec \"date is pinned on the right side of the first line\"). */\n --row-first-line: ${({ isTall }) => (isTall ? '24px' : '16px')};\n display: flex;\n align-items: flex-start;\n column-gap: 8px;\n min-height: ${({ isTall }) => (isTall ? '48px' : '32px')};\n padding-block: ${({ isTall }) => (isTall ? '12px' : '8px')};\n box-sizing: border-box;\n padding-left: ${({ rowPadding }) => `${rowPadding}px`};\n ${({ isSticky }) => (isSticky ? 'position: sticky; top: 0; z-index: 1;' : '')}\n padding-right: 8px;\n cursor: pointer;\n background: ${({ isCurrent, theme }) => (isCurrent ? theme.colors.brand[200] : theme.colors.neutral['000'])};\n box-shadow: inset 4px 0 0 0\n ${({ isCurrent, isSelectedParent, theme }) =>\n isCurrent || isSelectedParent ? theme.colors.brand[500] : 'transparent'};\n ${({ isCurrent, theme }) => (isCurrent ? `outline: 1px solid ${theme.colors.brand[500]}; outline-offset: -1px;` : '')}\n &:hover {\n background: ${({ theme }) => theme.colors.brand[200]};\n box-shadow: inset 4px 0 0 0\n ${({ isCurrent, isSelectedParent, theme }) =>\n isCurrent || isSelectedParent ? theme.colors.brand[500] : theme.colors.brand[300]};\n }\n`;\n\nexport const StyledItemLabel = styled('span', { name, slot: SLOTS.ITEM_LABEL })<{\n isTall: boolean;\n labelOverflow: DSLeftNavigationTreeT.LabelOverflowT;\n}>`\n font-size: ${({ isTall }) => (isTall ? '1.0769rem' : '1rem')};\n line-height: ${({ isTall }) => (isTall ? '17px' : '16px')};\n padding-block: ${({ isTall }) => (isTall ? '3.5px' : '0')};\n color: ${({ theme }) => theme.colors.neutral[800]};\n word-break: ${({ labelOverflow }) => (labelOverflow === 'wrapAll' ? 'break-all' : 'normal')};\n overflow-wrap: anywhere;\n flex: 1;\n min-width: 0;\n`;\n\nexport const StyledLeftContainer = styled('span', { name, slot: SLOTS.LEFT_CONTAINER })`\n display: inline-flex;\n align-items: center;\n min-height: var(--row-first-line, auto);\n`;\n\nexport const StyledCollapsedContainer = styled('span', { name, slot: SLOTS.COLLAPSED_CONTAINER })`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-height: var(--row-first-line, auto);\n`;\n\nexport const StyledRightContainer = styled('span', { name, slot: SLOTS.RIGHT_CONTAINER })`\n display: inline-flex;\n align-items: center;\n min-height: var(--row-first-line, auto);\n`;\n\nexport const StyledArrowContainer = styled('span', { name, slot: SLOTS.ARROW_CONTAINER })<{ isLeading: boolean }>`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: none;\n min-height: var(--row-first-line, auto);\n ${({ isLeading }) => (isLeading ? 'width: 16px; margin-inline-end: -8px;' : '')}\n`;\n\nexport const StyledHeaderDisclosure = styled('button', { name, slot: SLOTS.HEADER_DISCLOSURE })<{\n isRail: boolean;\n isOpen: boolean;\n}>`\n --row-first-line: 24px;\n display: flex;\n align-items: center;\n column-gap: 8px;\n width: 100%;\n min-height: 48px;\n padding: 0 8px 0 12px;\n border: none;\n border-bottom: 1px solid ${({ theme }) => theme.colors.neutral[100]};\n background: ${({ theme }) => theme.colors.neutral['000']};\n box-shadow: inset 4px 0 0 0 ${({ isOpen, theme }) => (isOpen ? theme.colors.brand[500] : 'transparent')};\n text-align: left;\n font-size: 1.0769rem;\n color: ${({ theme }) => theme.colors.neutral[800]};\n cursor: pointer;\n &:hover {\n background: ${({ theme }) => theme.colors.brand[200]};\n box-shadow: inset 4px 0 0 0 ${({ isOpen, theme }) => (isOpen ? theme.colors.brand[500] : theme.colors.brand[300])};\n }\n &:focus-visible {\n outline: 2px solid ${({ theme }) => theme.colors.brand[700]};\n outline-offset: -2px;\n }\n`;\nexport const StyledFooterMenu = styled('div', { name, slot: SLOTS.FOOTER_MENU })<{ expanded: boolean }>`\n display: grid;\n grid-template-columns: ${({ expanded }) => (expanded ? '1fr auto auto' : '1fr')};\n align-items: center;\n column-gap: 8px;\n margin-top: auto;\n min-height: 48px;\n padding: 0 4px 0 12px;\n border-top: 1px solid ${({ theme }) => theme.colors.neutral[100]};\n`;\n\nexport const StyledFooterLabel = styled('span', { name, slot: SLOTS.FOOTER_LABEL })`\n font-size: 11px;\n line-height: 14px;\n color: ${({ theme }) => theme.colors.neutral[500]};\n`;\n\nexport const StyledFooterSeparator = styled('span', { name, slot: SLOTS.FOOTER_SEPARATOR })`\n width: 1px;\n height: 16px;\n background: ${({ theme }) => theme.colors.neutral[100]};\n`;\n\nexport const StyledFooterButton = styled('button', { name, slot: SLOTS.FOOTER_MENU_COLLAPSE })`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 32px;\n height: 32px;\n padding: 0;\n border: none;\n background: transparent;\n cursor: pointer;\n &:focus-visible {\n outline: 2px solid ${({ theme }) => theme.colors.brand[700]};\n }\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,uBAAuB;AACvB,uBAAqE;AAGrE,MAAM,QAAQ;AACd,MAAM,OAAO;AAEN,MAAM,iBAAa,yBAAO,OAAO,EAAE,MAAM,MAAM,MAAM,KAAK,CAAC;AAAA;AAAA;AAAA,WAGvD,CAAC,EAAE,UAAU,cAAc,MAAO,WAAW,gBAAgB,MAAO;AAAA,sBACzD,CAAC,EAAE,SAAS,MAAO,WAAW,aAAa,SAAU;AAAA;AAAA;AAAA,sBAGrD,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA,2BACnC,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA,gBACnD,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA;AAGnD,MAAM,iBAAa,yBAAO,MAAM,EAAE,MAAM,MAAM,MAAM,KAAK,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,IAK7D,CAAC,EAAE,iBAAiB,MAAM,MAC1B,kBACI,kEAAkE,MAAM,OAAO,MAAM,GAAG,CAAC,QACzF,EAAE;AAAA;AAGH,MAAM,kBAAc,yBAAO,MAAM,EAAE,MAAM,MAAM,MAAM,MAAM,CAAC;AAAA;AAAA;AAAA;AAAA;AAM5D,MAAM,6BAAyB,yBAAO,MAAM,EAAE,MAA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AAC;AAAA;AAAA;AAAA,gBAG1E,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAGjD,MAAM,yBAAqB,yBAAO,UAAU,EAAE,MAAM,MAAM,MAAM,qBAAqB,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAWpE,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var react_desc_prop_types_exports = {};
|
|
30
|
+
__export(react_desc_prop_types_exports, {
|
|
31
|
+
DSLeftNavigationTreeItemOptsPropTypes: () => DSLeftNavigationTreeItemOptsPropTypes,
|
|
32
|
+
DSLeftNavigationTreeItemOptsSchema: () => DSLeftNavigationTreeItemOptsSchema,
|
|
33
|
+
DSLeftNavigationTreeItemPropTypes: () => DSLeftNavigationTreeItemPropTypes,
|
|
34
|
+
DSLeftNavigationTreeItemSchema: () => DSLeftNavigationTreeItemSchema,
|
|
35
|
+
DSLeftNavigationTreePropTypes: () => DSLeftNavigationTreePropTypes,
|
|
36
|
+
DSLeftNavigationTreePropTypesSchema: () => DSLeftNavigationTreePropTypesSchema,
|
|
37
|
+
defaultProps: () => defaultProps
|
|
38
|
+
});
|
|
39
|
+
module.exports = __toCommonJS(react_desc_prop_types_exports);
|
|
40
|
+
var React = __toESM(require("react"));
|
|
41
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
42
|
+
var import_constants = require("./constants/index.js");
|
|
43
|
+
const noop = () => null;
|
|
44
|
+
const defaultProps = {
|
|
45
|
+
items: [],
|
|
46
|
+
expanded: false,
|
|
47
|
+
expandedWidth: "240px",
|
|
48
|
+
labelOverflow: "wrap",
|
|
49
|
+
footerLabel: "",
|
|
50
|
+
disableDefaultSelection: false,
|
|
51
|
+
openedItem: null,
|
|
52
|
+
onItemClick: noop,
|
|
53
|
+
onItemOpenedChange: noop,
|
|
54
|
+
onSelectedChange: noop,
|
|
55
|
+
onFocusChange: noop,
|
|
56
|
+
onFooterExpand: noop,
|
|
57
|
+
onFooterClose: noop
|
|
58
|
+
};
|
|
59
|
+
const DSLeftNavigationTreePropTypes = {
|
|
60
|
+
...(0, import_ds_props_helpers.getPropsPerSlotPropTypes)(import_constants.DSLeftNavigationTreeName, import_constants.LEFT_NAVIGATION_TREE_SLOTS),
|
|
61
|
+
...import_ds_props_helpers.globalAttributesPropTypes,
|
|
62
|
+
...import_ds_props_helpers.xstyledPropTypes,
|
|
63
|
+
items: import_ds_props_helpers.PropTypes.arrayOf(import_ds_props_helpers.PropTypes.object).description(
|
|
64
|
+
"The navigation tree with its full hierarchy: parents and sections hold their children in itemOpts.items. Children that are not in the data cannot be reached"
|
|
65
|
+
).defaultValue([]),
|
|
66
|
+
expanded: import_ds_props_helpers.PropTypes.bool.description("Whether the panel is expanded or collapsed to the icon-only rail").defaultValue(false),
|
|
67
|
+
expandedWidth: import_ds_props_helpers.PropTypes.string.description("Width of the panel when expanded").defaultValue("240px"),
|
|
68
|
+
labelOverflow: import_ds_props_helpers.PropTypes.oneOf(["wrap", "wrapAll"]).description("How labels wrap").defaultValue("wrap"),
|
|
69
|
+
footerLabel: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.node, import_ds_props_helpers.PropTypes.string]).description("Text shown in the footer next to the collapse button").defaultValue(""),
|
|
70
|
+
selectedItem: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.string, import_ds_props_helpers.PropTypes.oneOf([null])]).description(
|
|
71
|
+
'Id of the current page, exposed as aria-current="page" (aria-selected is never set). null means no current page; undefined lets the component track it'
|
|
72
|
+
),
|
|
73
|
+
selectedParent: import_ds_props_helpers.PropTypes.string.description(
|
|
74
|
+
"Id of the item that shows the selected-parent indicator. When undefined, every ancestor of the current page shows it"
|
|
75
|
+
),
|
|
76
|
+
disableDefaultSelection: import_ds_props_helpers.PropTypes.bool.description("Whether opening a parent should only expand it, without making its first page the current page").defaultValue(false),
|
|
77
|
+
HeaderComponent: import_ds_props_helpers.PropTypes.object.description(
|
|
78
|
+
"Item rendered as the header disclosure button above the tree. While it is open, pass its content as items (selecting its first item is up to you), and clear openedItem when the panel collapses so the rail shows your root items. Only dsId, label, CollapsedComponent, RightComponent and labelOverflow are used"
|
|
79
|
+
),
|
|
80
|
+
openedItem: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.string, import_ds_props_helpers.PropTypes.oneOf([null])]).description("Id of the header item when the header is open. Other ids are ignored").defaultValue(null),
|
|
81
|
+
onItemClick: import_ds_props_helpers.PropTypes.func.description(
|
|
82
|
+
"Called when an item or the header is activated with click, Enter or Space. In the collapsed rail, expand the panel from here when the item is a parent. After a page activation, move focus to your content if needed; after a parent activation, leave focus on the parent"
|
|
83
|
+
).signature("((item: DSLeftNavigationTreeT.Item, e: React.MouseEvent | React.KeyboardEvent) => void)").defaultValue(() => null),
|
|
84
|
+
onItemOpenedChange: import_ds_props_helpers.PropTypes.func.description("Called when a parent requests to open or close").signature(
|
|
85
|
+
"((item: DSLeftNavigationTreeT.Item, nextIsOpened: boolean, e: React.MouseEvent | React.KeyboardEvent) => void)"
|
|
86
|
+
).defaultValue(() => null),
|
|
87
|
+
onSelectedChange: import_ds_props_helpers.PropTypes.func.description("Called with the id of the item that becomes the current page").signature("((id: string) => void)").defaultValue(() => null),
|
|
88
|
+
onFocusChange: import_ds_props_helpers.PropTypes.func.description("Called with the id of the item that receives focus").signature("((id: string) => void)").defaultValue(() => null),
|
|
89
|
+
onFooterExpand: import_ds_props_helpers.PropTypes.func.description("Called when the footer button expands the panel").signature("((e: React.MouseEvent | React.KeyboardEvent) => void)").defaultValue(() => null),
|
|
90
|
+
onFooterClose: import_ds_props_helpers.PropTypes.func.description("Called when the footer button collapses the panel. Clear openedItem here if the header is open").signature("((e: React.MouseEvent | React.KeyboardEvent) => void)").defaultValue(() => null)
|
|
91
|
+
};
|
|
92
|
+
const DSLeftNavigationTreePropTypesSchema = DSLeftNavigationTreePropTypes;
|
|
93
|
+
const itemTypes = Object.values(import_constants.LEFT_NAVIGATION_TREE_ITEM_TYPES);
|
|
94
|
+
const DSLeftNavigationTreeItemPropTypes = {
|
|
95
|
+
dsId: import_ds_props_helpers.PropTypes.string.description("Unique identifier of the item").isRequired,
|
|
96
|
+
type: import_ds_props_helpers.PropTypes.oneOf(itemTypes).description("Item type: leaf, parent, section or separator").isRequired,
|
|
97
|
+
CollapsedComponent: import_ds_props_helpers.PropTypes.func.description(
|
|
98
|
+
"Icon rendered next to the label and alone in the collapsed rail; root items without it do not appear in the rail. Receives { item }"
|
|
99
|
+
).signature("React.ComponentType<{ item: DSLeftNavigationTreeT.Item }>"),
|
|
100
|
+
itemOpts: import_ds_props_helpers.PropTypes.object.description("Item options")
|
|
101
|
+
};
|
|
102
|
+
const DSLeftNavigationTreeItemOptsPropTypes = {
|
|
103
|
+
label: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.string, import_ds_props_helpers.PropTypes.node]).description(
|
|
104
|
+
"Visible label and accessible name of the item. Type-ahead only matches labels passed as strings"
|
|
105
|
+
),
|
|
106
|
+
items: import_ds_props_helpers.PropTypes.arrayOf(import_ds_props_helpers.PropTypes.object).description("Children of a parent or a section"),
|
|
107
|
+
isOpened: import_ds_props_helpers.PropTypes.bool.description(
|
|
108
|
+
"Controlled open state of a parent. When defined, the component only requests changes through onItemOpenedChange. Keep it defined (or undefined) for the whole life of the item"
|
|
109
|
+
),
|
|
110
|
+
startOpened: import_ds_props_helpers.PropTypes.bool.description("Open state of an uncontrolled parent until the user opens or closes it"),
|
|
111
|
+
selectable: import_ds_props_helpers.PropTypes.bool.description("Whether the leaf can become the current page").defaultValue(true),
|
|
112
|
+
labelOverflow: import_ds_props_helpers.PropTypes.oneOf(["wrap", "wrapAll"]).description("Overrides the component labelOverflow"),
|
|
113
|
+
RightComponent: import_ds_props_helpers.PropTypes.func.description(
|
|
114
|
+
"Non-interactive content after the label, exposed as the item description, so it must contain text (give an icon-only badge a visually hidden text). Receives { item }"
|
|
115
|
+
).signature("React.ComponentType<{ item: DSLeftNavigationTreeT.Item }>")
|
|
116
|
+
};
|
|
117
|
+
const LeftNavigationTreeItem = () => null;
|
|
118
|
+
LeftNavigationTreeItem.displayName = "LeftNavigationTreeItem";
|
|
119
|
+
const DSLeftNavigationTreeItemSchema = (0, import_ds_props_helpers.describe)(LeftNavigationTreeItem);
|
|
120
|
+
DSLeftNavigationTreeItemSchema.propTypes = DSLeftNavigationTreeItemPropTypes;
|
|
121
|
+
const LeftNavigationTreeItemOpts = () => null;
|
|
122
|
+
LeftNavigationTreeItemOpts.displayName = "LeftNavigationTreeItemOpts";
|
|
123
|
+
const DSLeftNavigationTreeItemOptsSchema = (0, import_ds_props_helpers.describe)(LeftNavigationTreeItemOpts);
|
|
124
|
+
DSLeftNavigationTreeItemOptsSchema.propTypes = DSLeftNavigationTreeItemOptsPropTypes;
|
|
125
|
+
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/react-desc-prop-types.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema, ValidationMap } from '@elliemae/ds-props-helpers';\nimport {\n PropTypes,\n describe,\n getPropsPerSlotPropTypes,\n globalAttributesPropTypes,\n xstyledPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type { ZustandT } from '@elliemae/ds-zustand-helpers';\nimport {\n DSLeftNavigationTreeName,\n LEFT_NAVIGATION_TREE_ITEM_TYPES,\n LEFT_NAVIGATION_TREE_SLOTS,\n} from './constants/index.js';\nimport type { LEFT_NAVIGATION_TREE_REGION_FOCUSES } from './constants/index.js';\nimport type { useAutoCalculated } from './config/useAutoCalculated.js';\n\nexport declare namespace DSLeftNavigationTreeT {\n export type ItemType = (typeof LEFT_NAVIGATION_TREE_ITEM_TYPES)[keyof typeof LEFT_NAVIGATION_TREE_ITEM_TYPES];\n\n export type LabelOverflowT = 'wrap' | 'wrapAll';\n\n export type InteractionEvent = React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>;\n\n export interface ItemComponentProps {\n item: Item;\n }\n\n export interface ItemOpts {\n label?: string | JSX.Element;\n items?: readonly Item[];\n isOpened?: boolean;\n startOpened?: boolean;\n selectable?: boolean;\n labelOverflow?: LabelOverflowT;\n RightComponent?: React.ComponentType<ItemComponentProps>;\n }\n\n export interface Item {\n dsId: string;\n type: ItemType;\n CollapsedComponent?: React.ComponentType<ItemComponentProps> | null;\n itemOpts?: ItemOpts;\n }\n\n export interface RequiredProps {}\n\n export interface DefaultProps {\n items: readonly Item[];\n expanded: boolean;\n expandedWidth: string;\n labelOverflow: LabelOverflowT;\n footerLabel: React.ReactNode;\n disableDefaultSelection: boolean;\n openedItem: string | null;\n onItemClick: (item: Item, e: InteractionEvent) => void;\n onItemOpenedChange: (item: Item, nextIsOpened: boolean, e: InteractionEvent) => void;\n onSelectedChange: (id: string) => void;\n onFocusChange: (id: string) => void;\n onFooterExpand: (e: InteractionEvent) => void;\n onFooterClose: (e: InteractionEvent) => void;\n }\n\n export interface OptionalProps extends TypescriptHelpersT.PropsForGlobalOnSlots<\n typeof DSLeftNavigationTreeName,\n typeof LEFT_NAVIGATION_TREE_SLOTS\n > {\n selectedItem?: string | null;\n selectedParent?: string;\n HeaderComponent?: Item;\n }\n\n export interface Props\n extends\n Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLElement>, keyof DefaultProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends\n DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLElement>, keyof DefaultProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface ItemSlotArguments {\n item: Item;\n level: number;\n isOpen: boolean;\n isCurrent: boolean;\n }\n\n export type SlotFunctionArguments = {\n dsLeftnavigationtreeRoot: () => object;\n dsLeftnavigationtreeTree: () => object;\n dsLeftnavigationtreeItem: (args: ItemSlotArguments) => object;\n dsLeftnavigationtreeItemRow: (args: ItemSlotArguments) => object;\n dsLeftnavigationtreeItemLabel: (args: ItemSlotArguments) => object;\n dsLeftnavigationtreeLeftContainer: (args: ItemSlotArguments) => object;\n dsLeftnavigationtreeCollapsedContainer: (args: ItemSlotArguments) => object;\n dsLeftnavigationtreeRightContainer: (args: ItemSlotArguments) => object;\n dsLeftnavigationtreeArrowContainer: (args: ItemSlotArguments) => object;\n dsLeftnavigationtreeGroup: (args: ItemSlotArguments) => object;\n dsLeftnavigationtreeSectionContainer: () => object;\n dsLeftnavigationtreeSectionLabel: () => object;\n dsLeftnavigationtreeItemSeparator: () => object;\n dsLeftnavigationtreeHeaderDisclosure: () => object;\n dsLeftnavigationtreeFooterMenu: () => object;\n dsLeftnavigationtreeFooterLabel: () => object;\n dsLeftnavigationtreeFooterSeparator: () => object;\n dsLeftnavigationtreeFooterMenuCollapse: () => object;\n };\n\n export type FocusRegion =\n (typeof LEFT_NAVIGATION_TREE_REGION_FOCUSES)[keyof typeof LEFT_NAVIGATION_TREE_REGION_FOCUSES];\n\n export type InternalAtoms = {\n focusRegion: FocusRegion;\n focusedItemId: string | null;\n toggles: Record<string, boolean>;\n internalSelectedItem: string | null;\n };\n\n export type UseAutoCalculatedT = ReturnType<typeof useAutoCalculated>;\n\n export type Selectors = Record<string, never>;\n export type Reducers = Record<string, never>;\n export type InternalStore = ZustandT.InternalStore<InternalAtoms, Selectors, Reducers>;\n}\n\nconst noop = () => null;\n\nexport const defaultProps: DSLeftNavigationTreeT.DefaultProps = {\n items: [],\n expanded: false,\n expandedWidth: '240px',\n labelOverflow: 'wrap',\n footerLabel: '',\n disableDefaultSelection: false,\n openedItem: null,\n onItemClick: noop,\n onItemOpenedChange: noop,\n onSelectedChange: noop,\n onFocusChange: noop,\n onFooterExpand: noop,\n onFooterClose: noop,\n};\n\nexport const DSLeftNavigationTreePropTypes: DSPropTypesSchema<DSLeftNavigationTreeT.Props> = {\n ...getPropsPerSlotPropTypes(DSLeftNavigationTreeName, LEFT_NAVIGATION_TREE_SLOTS),\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n items: PropTypes.arrayOf(PropTypes.object)\n .description(\n 'The navigation tree with its full hierarchy: parents and sections hold their children in itemOpts.items. Children that are not in the data cannot be reached',\n )\n .defaultValue([]),\n expanded: PropTypes.bool\n .description('Whether the panel is expanded or collapsed to the icon-only rail')\n .defaultValue(false),\n expandedWidth: PropTypes.string.description('Width of the panel when expanded').defaultValue('240px'),\n labelOverflow: PropTypes.oneOf(['wrap', 'wrapAll']).description('How labels wrap').defaultValue('wrap'),\n footerLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.string])\n .description('Text shown in the footer next to the collapse button')\n .defaultValue(''),\n selectedItem: PropTypes.oneOfType([PropTypes.string, PropTypes.oneOf([null])]).description(\n 'Id of the current page, exposed as aria-current=\"page\" (aria-selected is never set). null means no current page; undefined lets the component track it',\n ),\n selectedParent: PropTypes.string.description(\n 'Id of the item that shows the selected-parent indicator. When undefined, every ancestor of the current page shows it',\n ),\n disableDefaultSelection: PropTypes.bool\n .description('Whether opening a parent should only expand it, without making its first page the current page')\n .defaultValue(false),\n HeaderComponent: PropTypes.object.description(\n 'Item rendered as the header disclosure button above the tree. While it is open, pass its content as items (selecting its first item is up to you), and clear openedItem when the panel collapses so the rail shows your root items. Only dsId, label, CollapsedComponent, RightComponent and labelOverflow are used',\n ),\n openedItem: PropTypes.oneOfType([PropTypes.string, PropTypes.oneOf([null])])\n .description('Id of the header item when the header is open. Other ids are ignored')\n .defaultValue(null),\n onItemClick: PropTypes.func\n .description(\n 'Called when an item or the header is activated with click, Enter or Space. In the collapsed rail, expand the panel from here when the item is a parent. After a page activation, move focus to your content if needed; after a parent activation, leave focus on the parent',\n )\n .signature('((item: DSLeftNavigationTreeT.Item, e: React.MouseEvent | React.KeyboardEvent) => void)')\n .defaultValue(() => null),\n onItemOpenedChange: PropTypes.func\n .description('Called when a parent requests to open or close')\n .signature(\n '((item: DSLeftNavigationTreeT.Item, nextIsOpened: boolean, e: React.MouseEvent | React.KeyboardEvent) => void)',\n )\n .defaultValue(() => null),\n onSelectedChange: PropTypes.func\n .description('Called with the id of the item that becomes the current page')\n .signature('((id: string) => void)')\n .defaultValue(() => null),\n onFocusChange: PropTypes.func\n .description('Called with the id of the item that receives focus')\n .signature('((id: string) => void)')\n .defaultValue(() => null),\n onFooterExpand: PropTypes.func\n .description('Called when the footer button expands the panel')\n .signature('((e: React.MouseEvent | React.KeyboardEvent) => void)')\n .defaultValue(() => null),\n onFooterClose: PropTypes.func\n .description('Called when the footer button collapses the panel. Clear openedItem here if the header is open')\n .signature('((e: React.MouseEvent | React.KeyboardEvent) => void)')\n .defaultValue(() => null),\n};\n\nexport const DSLeftNavigationTreePropTypesSchema =\n DSLeftNavigationTreePropTypes as unknown as ValidationMap<DSLeftNavigationTreeT.Props>;\n\nconst itemTypes = Object.values(LEFT_NAVIGATION_TREE_ITEM_TYPES);\n\nexport const DSLeftNavigationTreeItemPropTypes: DSPropTypesSchema<DSLeftNavigationTreeT.Item> = {\n dsId: PropTypes.string.description('Unique identifier of the item').isRequired,\n type: PropTypes.oneOf(itemTypes).description('Item type: leaf, parent, section or separator').isRequired,\n CollapsedComponent: PropTypes.func\n .description(\n 'Icon rendered next to the label and alone in the collapsed rail; root items without it do not appear in the rail. Receives { item }',\n )\n .signature('React.ComponentType<{ item: DSLeftNavigationTreeT.Item }>'),\n itemOpts: PropTypes.object.description('Item options'),\n};\n\nexport const DSLeftNavigationTreeItemOptsPropTypes: DSPropTypesSchema<DSLeftNavigationTreeT.ItemOpts> = {\n label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]).description(\n 'Visible label and accessible name of the item. Type-ahead only matches labels passed as strings',\n ),\n items: PropTypes.arrayOf(PropTypes.object).description('Children of a parent or a section'),\n isOpened: PropTypes.bool.description(\n 'Controlled open state of a parent. When defined, the component only requests changes through onItemOpenedChange. Keep it defined (or undefined) for the whole life of the item',\n ),\n startOpened: PropTypes.bool.description('Open state of an uncontrolled parent until the user opens or closes it'),\n selectable: PropTypes.bool.description('Whether the leaf can become the current page').defaultValue(true),\n labelOverflow: PropTypes.oneOf(['wrap', 'wrapAll']).description('Overrides the component labelOverflow'),\n RightComponent: PropTypes.func\n .description(\n 'Non-interactive content after the label, exposed as the item description, so it must contain text (give an icon-only badge a visually hidden text). Receives { item }',\n )\n .signature('React.ComponentType<{ item: DSLeftNavigationTreeT.Item }>'),\n};\n\nconst LeftNavigationTreeItem = () => null;\nLeftNavigationTreeItem.displayName = 'LeftNavigationTreeItem';\nexport const DSLeftNavigationTreeItemSchema = describe(LeftNavigationTreeItem);\nDSLeftNavigationTreeItemSchema.propTypes =\n DSLeftNavigationTreeItemPropTypes as unknown as ValidationMap<DSLeftNavigationTreeT.Item>;\n\nconst LeftNavigationTreeItemOpts = () => null;\nLeftNavigationTreeItemOpts.displayName = 'LeftNavigationTreeItemOpts';\nexport const DSLeftNavigationTreeItemOptsSchema = describe(LeftNavigationTreeItemOpts);\nDSLeftNavigationTreeItemOptsSchema.propTypes =\n DSLeftNavigationTreeItemOptsPropTypes as unknown as ValidationMap<DSLeftNavigationTreeT.ItemOpts>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,8BAMO;AAGP,uBAIO;AAwHP,MAAM,OAAO,MAAM;AAEZ,MAAM,eAAmD;AAAA,EAC9D,OAAO,CAAC;AAAA,EACR,UAAU;AAAA,EACV,eAAe;AAAA,EACf,eAAe;AAAA,EACf,aAAa;AAAA,EACb,yBAAyB;AAAA,EACzB,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,oBAAoB;AAAA,EACpB,kBAAkB;AAAA,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AuB,cAAc;AAC9B,MAAM,qCAAiC,kCAAS,sBAAsB;AAC7E,+BAA+B,YAC7B;AAEF,MAAM,6BAA6B,MAAM;AACzC,2BAA2B,cAAc;AAClC,MAAM,yCAAqC,kCAAS,0BAA0B;AACrF,mCAAmC,YACjC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var React = __toESM(require("react"));
|
|
25
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
+
var import__ = require("../index.js");
|
|
27
|
+
const Icon = (_props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { "aria-hidden": "true" });
|
|
28
|
+
const Badge = ({ item }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: item.dsId });
|
|
29
|
+
const items = [
|
|
30
|
+
{
|
|
31
|
+
dsId: "pipeline",
|
|
32
|
+
type: import__.LEFT_NAVIGATION_TREE_ITEM_TYPES.LEAF,
|
|
33
|
+
CollapsedComponent: Icon,
|
|
34
|
+
itemOpts: { label: "Pipeline" }
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
dsId: "loan",
|
|
38
|
+
type: import__.LEFT_NAVIGATION_TREE_ITEM_TYPES.PARENT,
|
|
39
|
+
CollapsedComponent: Icon,
|
|
40
|
+
itemOpts: {
|
|
41
|
+
label: "Loan",
|
|
42
|
+
startOpened: true,
|
|
43
|
+
RightComponent: Badge,
|
|
44
|
+
items: [{ dsId: "borrower", type: import__.LEFT_NAVIGATION_TREE_ITEM_TYPES.LEAF, itemOpts: { label: "Borrower" } }]
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
{ dsId: "separator", type: import__.LEFT_NAVIGATION_TREE_ITEM_TYPES.SEPARATOR },
|
|
48
|
+
{
|
|
49
|
+
dsId: "tools",
|
|
50
|
+
type: import__.LEFT_NAVIGATION_TREE_ITEM_TYPES.SECTION,
|
|
51
|
+
itemOpts: {
|
|
52
|
+
label: "Tools",
|
|
53
|
+
items: [
|
|
54
|
+
{ dsId: "calculator", type: import__.LEFT_NAVIGATION_TREE_ITEM_TYPES.LEAF, itemOpts: { label: "Calculator" } },
|
|
55
|
+
{
|
|
56
|
+
dsId: "contact-us",
|
|
57
|
+
type: import__.LEFT_NAVIGATION_TREE_ITEM_TYPES.LEAF,
|
|
58
|
+
itemOpts: { label: "Contact us", selectable: false, labelOverflow: "wrapAll" }
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
];
|
|
64
|
+
const controlledParent = {
|
|
65
|
+
dsId: "controlled",
|
|
66
|
+
type: import__.LEFT_NAVIGATION_TREE_ITEM_TYPES.PARENT,
|
|
67
|
+
itemOpts: { label: "Controlled", isOpened: false, items: [] }
|
|
68
|
+
};
|
|
69
|
+
const header = {
|
|
70
|
+
dsId: "header",
|
|
71
|
+
type: import__.LEFT_NAVIGATION_TREE_ITEM_TYPES.LEAF,
|
|
72
|
+
itemOpts: { label: "Loan summary" }
|
|
73
|
+
};
|
|
74
|
+
const testRequiredProps = {};
|
|
75
|
+
const testOptionalProps = {
|
|
76
|
+
selectedItem: "borrower",
|
|
77
|
+
selectedParent: "loan",
|
|
78
|
+
HeaderComponent: header,
|
|
79
|
+
dsLeftnavigationtreeRoot: {
|
|
80
|
+
onClick: () => {
|
|
81
|
+
},
|
|
82
|
+
"data-testid": "over-ride-test-id",
|
|
83
|
+
"aria-label": "over-ride-aria-label"
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
const testPartialDefaults = {
|
|
87
|
+
items: [...items, controlledParent],
|
|
88
|
+
expanded: true
|
|
89
|
+
};
|
|
90
|
+
const testProps = {
|
|
91
|
+
...testRequiredProps,
|
|
92
|
+
...testOptionalProps,
|
|
93
|
+
...testPartialDefaults
|
|
94
|
+
};
|
|
95
|
+
const testPropsAsSyntax = {
|
|
96
|
+
...testRequiredProps,
|
|
97
|
+
...testOptionalProps,
|
|
98
|
+
...testPartialDefaults
|
|
99
|
+
};
|
|
100
|
+
const testCompleteDefaults = {
|
|
101
|
+
items,
|
|
102
|
+
expanded: false,
|
|
103
|
+
expandedWidth: "240px",
|
|
104
|
+
labelOverflow: "wrapAll",
|
|
105
|
+
footerLabel: "v1.0",
|
|
106
|
+
disableDefaultSelection: false,
|
|
107
|
+
openedItem: null,
|
|
108
|
+
onItemClick: (item, e) => {
|
|
109
|
+
},
|
|
110
|
+
onItemOpenedChange: (item, nextIsOpened, e) => {
|
|
111
|
+
},
|
|
112
|
+
onSelectedChange: (id) => {
|
|
113
|
+
},
|
|
114
|
+
onFocusChange: (id) => {
|
|
115
|
+
},
|
|
116
|
+
onFooterExpand: (e) => {
|
|
117
|
+
},
|
|
118
|
+
onFooterClose: (e) => {
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
const testInternalProps = {
|
|
122
|
+
...testRequiredProps,
|
|
123
|
+
...testOptionalProps,
|
|
124
|
+
...testCompleteDefaults
|
|
125
|
+
};
|
|
126
|
+
const testInternalPropsAsSyntax = {
|
|
127
|
+
...testRequiredProps,
|
|
128
|
+
...testOptionalProps,
|
|
129
|
+
...testCompleteDefaults
|
|
130
|
+
};
|
|
131
|
+
const itemSlot = ({ item, isCurrent }) => ({
|
|
132
|
+
"data-testid": isCurrent ? `current-${item.dsId}` : item.dsId
|
|
133
|
+
});
|
|
134
|
+
const testExplicitDefinition = {
|
|
135
|
+
items,
|
|
136
|
+
selectedItem: null,
|
|
137
|
+
labelOverflow: "wrap",
|
|
138
|
+
onItemOpenedChange: (item, nextIsOpened) => {
|
|
139
|
+
},
|
|
140
|
+
dsLeftnavigationtreeItem: itemSlot
|
|
141
|
+
};
|
|
142
|
+
const testInferedTypeCompatibility = {
|
|
143
|
+
items,
|
|
144
|
+
expanded: true,
|
|
145
|
+
footerLabel: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "v1.0" })
|
|
146
|
+
};
|
|
147
|
+
const testDefinitionAsConst = {
|
|
148
|
+
items,
|
|
149
|
+
labelOverflow: "wrapAll",
|
|
150
|
+
openedItem: "header"
|
|
151
|
+
};
|
|
152
|
+
const ExampleUsageComponent = () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
153
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSLeftNavigationTree, { ...testExplicitDefinition }),
|
|
154
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
155
|
+
import__.DSLeftNavigationTree,
|
|
156
|
+
{
|
|
157
|
+
items,
|
|
158
|
+
expanded: true,
|
|
159
|
+
selectedItem: "borrower",
|
|
160
|
+
HeaderComponent: header,
|
|
161
|
+
openedItem: null,
|
|
162
|
+
onItemClick: (item, e) => {
|
|
163
|
+
},
|
|
164
|
+
onSelectedChange: (id) => {
|
|
165
|
+
},
|
|
166
|
+
"aria-label": "Loan"
|
|
167
|
+
}
|
|
168
|
+
),
|
|
169
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSLeftNavigationTree, { ...testInferedTypeCompatibility }),
|
|
170
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSLeftNavigationTree, { ...testDefinitionAsConst })
|
|
171
|
+
] });
|
|
172
|
+
//# 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": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAuB;ACU4C;AATnE,eAAkG;AASlG,MAAM,OAAO,CAAC,WAAqD,4CAAC,SAAI,eAAY,QAAO;AAC3F,MAAM,QAAQ,CAAC,EAAE,KAAK,MAAgD,4CAAC,UAAM,eAAK,MAAK;AAEvF,MAAM,QAAsC;AAAA,EAC1C;AAAA,IACE,MAAM;AAAA,IACN,MAAM,yCAAgC;AAAA,IACtC,oBAAoB;AAAA,IACpB,UAAU,EAAE,OAAO,WAAW;AAAA,EAChC;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,MAAM,yCAAgC;AAAA,IACtC,oBAAoB;AAAA,IACpB,UAAU;AAAA,MACR,OAAO;AAAA,MACP,aAAa;AAAA,MACb,gBAAgB;AAAA,MAChB,OAAO,CAAC,EAAE,MAAM,YAAY,MAAM,yCAAgC,MAAM,UAAU,EAAE,OAAO,WAAW,EAAE,CAAC;AAAA,IAC3G;AAAA,EACF;AAAA,EACA,EAAE,MAAM,aAAa,MAAM,yCAAgC,UAAU;AAAA,EACrE;AAAA,IACE,MAAM;AAAA,IACN,MAAM,yCAAgC;AAAA,IACtC,UAAU;AAAA,MACR,OAAO;AAAA,MACP,OAAO;AAAA,QACL,EAAE,MAAM,cAAc,MAAM,yCAAgC,MAAM,UAAU,EAAE,OAAO,aAAa,EAAE;AAAA,QACpG;AAAA,UACE,MAAM;AAAA,UACN,MAAM,yCAAgC;AAAA,UACtC,UAAU,EAAE,OAAO,cAAc,YAAY,OAAO,eAAe,UAAU;AAAA,QAC/E;AAAA,MACF;AAAA,IACF;AAAA,EACF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