@elliemae/ds-left-navigation 3.80.0-next.6 → 3.80.0-next.61

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 (106) hide show
  1. package/dist/cjs/TruncatedTooltipText.js +25 -4
  2. package/dist/cjs/TruncatedTooltipText.js.map +2 -2
  3. package/dist/cjs/constants/index.js +4 -0
  4. package/dist/cjs/constants/index.js.map +2 -2
  5. package/dist/cjs/exported-related/Icon/index.js +24 -3
  6. package/dist/cjs/exported-related/Icon/index.js.map +3 -3
  7. package/dist/cjs/exported-related/OpenWindowItem/index.js +23 -2
  8. package/dist/cjs/exported-related/OpenWindowItem/index.js.map +3 -3
  9. package/dist/cjs/exported-related/conversion-utils/conversionConstants.js +64 -0
  10. package/dist/cjs/exported-related/conversion-utils/conversionConstants.js.map +7 -0
  11. package/dist/cjs/exported-related/conversion-utils/conversionHelpers.js +192 -0
  12. package/dist/cjs/exported-related/conversion-utils/conversionHelpers.js.map +7 -0
  13. package/dist/cjs/exported-related/conversion-utils/convertItemOpts.js +187 -0
  14. package/dist/cjs/exported-related/conversion-utils/convertItemOpts.js.map +7 -0
  15. package/dist/cjs/exported-related/conversion-utils/getHumanReadableWarnings.js +37 -0
  16. package/dist/cjs/exported-related/conversion-utils/getHumanReadableWarnings.js.map +7 -0
  17. package/dist/cjs/exported-related/conversion-utils/index.js +95 -0
  18. package/dist/cjs/exported-related/conversion-utils/index.js.map +7 -0
  19. package/dist/cjs/exported-related/conversion-utils/lostCodes.js +55 -0
  20. package/dist/cjs/exported-related/conversion-utils/lostCodes.js.map +7 -0
  21. package/dist/cjs/exported-related/conversion-utils/report.js +48 -0
  22. package/dist/cjs/exported-related/conversion-utils/report.js.map +7 -0
  23. package/dist/cjs/exported-related/conversion-utils/types.js +28 -0
  24. package/dist/cjs/exported-related/conversion-utils/types.js.map +7 -0
  25. package/dist/cjs/exported-related/conversion-utils/validateIds.js +58 -0
  26. package/dist/cjs/exported-related/conversion-utils/validateIds.js.map +7 -0
  27. package/dist/cjs/index.js +2 -0
  28. package/dist/cjs/index.js.map +2 -2
  29. package/dist/cjs/outOfTheBox/ItemHeader/index.js +1 -1
  30. package/dist/cjs/outOfTheBox/ItemHeader/index.js.map +2 -2
  31. package/dist/cjs/outOfTheBox/ItemLink/index.js +1 -1
  32. package/dist/cjs/outOfTheBox/ItemLink/index.js.map +2 -2
  33. package/dist/cjs/outOfTheBox/ItemSubmenu/index.js +1 -1
  34. package/dist/cjs/outOfTheBox/ItemSubmenu/index.js.map +2 -2
  35. package/dist/cjs/outOfTheBox/ItemTextLabel/index.js +1 -1
  36. package/dist/cjs/outOfTheBox/ItemTextLabel/index.js.map +2 -2
  37. package/dist/cjs/outOfTheBox/ItemUncontrolledDrilldown/index.js +1 -1
  38. package/dist/cjs/outOfTheBox/ItemUncontrolledDrilldown/index.js.map +2 -2
  39. package/dist/cjs/outOfTheBox/ItemWithDate/index.js +1 -1
  40. package/dist/cjs/outOfTheBox/ItemWithDate/index.js.map +2 -2
  41. package/dist/cjs/parts/LeftNavFooterItem/index.js +2 -3
  42. package/dist/cjs/parts/LeftNavFooterItem/index.js.map +2 -2
  43. package/dist/cjs/react-desc-prop-types.js +58 -1
  44. package/dist/cjs/react-desc-prop-types.js.map +2 -2
  45. package/dist/cjs/typescript-testing/slot-props.js +8 -0
  46. package/dist/cjs/typescript-testing/slot-props.js.map +2 -2
  47. package/dist/esm/TruncatedTooltipText.js +26 -5
  48. package/dist/esm/TruncatedTooltipText.js.map +2 -2
  49. package/dist/esm/constants/index.js +4 -0
  50. package/dist/esm/constants/index.js.map +2 -2
  51. package/dist/esm/exported-related/Icon/index.js +24 -3
  52. package/dist/esm/exported-related/Icon/index.js.map +3 -3
  53. package/dist/esm/exported-related/OpenWindowItem/index.js +23 -2
  54. package/dist/esm/exported-related/OpenWindowItem/index.js.map +3 -3
  55. package/dist/esm/exported-related/conversion-utils/conversionConstants.js +34 -0
  56. package/dist/esm/exported-related/conversion-utils/conversionConstants.js.map +7 -0
  57. package/dist/esm/exported-related/conversion-utils/conversionHelpers.js +172 -0
  58. package/dist/esm/exported-related/conversion-utils/conversionHelpers.js.map +7 -0
  59. package/dist/esm/exported-related/conversion-utils/convertItemOpts.js +157 -0
  60. package/dist/esm/exported-related/conversion-utils/convertItemOpts.js.map +7 -0
  61. package/dist/esm/exported-related/conversion-utils/getHumanReadableWarnings.js +7 -0
  62. package/dist/esm/exported-related/conversion-utils/getHumanReadableWarnings.js.map +7 -0
  63. package/dist/esm/exported-related/conversion-utils/index.js +65 -0
  64. package/dist/esm/exported-related/conversion-utils/index.js.map +7 -0
  65. package/dist/esm/exported-related/conversion-utils/lostCodes.js +25 -0
  66. package/dist/esm/exported-related/conversion-utils/lostCodes.js.map +7 -0
  67. package/dist/esm/exported-related/conversion-utils/report.js +18 -0
  68. package/dist/esm/exported-related/conversion-utils/report.js.map +7 -0
  69. package/dist/esm/exported-related/conversion-utils/types.js +2 -0
  70. package/dist/esm/exported-related/conversion-utils/types.js.map +7 -0
  71. package/dist/esm/exported-related/conversion-utils/validateIds.js +28 -0
  72. package/dist/esm/exported-related/conversion-utils/validateIds.js.map +7 -0
  73. package/dist/esm/index.js +2 -0
  74. package/dist/esm/index.js.map +2 -2
  75. package/dist/esm/outOfTheBox/ItemHeader/index.js +1 -1
  76. package/dist/esm/outOfTheBox/ItemHeader/index.js.map +2 -2
  77. package/dist/esm/outOfTheBox/ItemLink/index.js +1 -1
  78. package/dist/esm/outOfTheBox/ItemLink/index.js.map +2 -2
  79. package/dist/esm/outOfTheBox/ItemSubmenu/index.js +1 -1
  80. package/dist/esm/outOfTheBox/ItemSubmenu/index.js.map +2 -2
  81. package/dist/esm/outOfTheBox/ItemTextLabel/index.js +1 -1
  82. package/dist/esm/outOfTheBox/ItemTextLabel/index.js.map +2 -2
  83. package/dist/esm/outOfTheBox/ItemUncontrolledDrilldown/index.js +1 -1
  84. package/dist/esm/outOfTheBox/ItemUncontrolledDrilldown/index.js.map +2 -2
  85. package/dist/esm/outOfTheBox/ItemWithDate/index.js +1 -1
  86. package/dist/esm/outOfTheBox/ItemWithDate/index.js.map +2 -2
  87. package/dist/esm/parts/LeftNavFooterItem/index.js +2 -3
  88. package/dist/esm/parts/LeftNavFooterItem/index.js.map +2 -2
  89. package/dist/esm/react-desc-prop-types.js +58 -1
  90. package/dist/esm/react-desc-prop-types.js.map +2 -2
  91. package/dist/esm/typescript-testing/slot-props.js +8 -0
  92. package/dist/esm/typescript-testing/slot-props.js.map +2 -2
  93. package/dist/types/constants/index.d.ts +12 -0
  94. package/dist/types/exported-related/Icon/index.d.ts +4 -0
  95. package/dist/types/exported-related/conversion-utils/conversionConstants.d.ts +20 -0
  96. package/dist/types/exported-related/conversion-utils/conversionHelpers.d.ts +25 -0
  97. package/dist/types/exported-related/conversion-utils/convertItemOpts.d.ts +22 -0
  98. package/dist/types/exported-related/conversion-utils/getHumanReadableWarnings.d.ts +7 -0
  99. package/dist/types/exported-related/conversion-utils/index.d.ts +12 -0
  100. package/dist/types/exported-related/conversion-utils/lostCodes.d.ts +23 -0
  101. package/dist/types/exported-related/conversion-utils/report.d.ts +3 -0
  102. package/dist/types/exported-related/conversion-utils/types.d.ts +37 -0
  103. package/dist/types/exported-related/conversion-utils/validateIds.d.ts +9 -0
  104. package/dist/types/index.d.ts +2 -0
  105. package/dist/types/react-desc-prop-types.d.ts +4 -0
  106. package/package.json +16 -13
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/conversion-utils/conversionHelpers.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import {\n LEFT_NAVIGATION_TREE_ITEM_TYPES as TREE_TYPES,\n type DSLeftNavigationTreeT,\n} from '@elliemae/ds-left-navigation-tree';\nimport { ITEM_TYPES } from '../../constants/index.js';\nimport type { DSLeftNavigationT } from '../../react-desc-prop-types.js';\nimport {\n DRILLDOWN_TYPES,\n DROPPED_TYPE_CODES,\n HEADER_TYPES,\n LEAF_TYPES,\n NO_RAIL_TYPES,\n OUT_OF_THE_BOX_TYPES,\n getOwn,\n} from './conversionConstants.js';\nimport { convertItemOpts } from './convertItemOpts.js';\nimport { markLost } from './report.js';\nimport type { DSLeftNavBridgeT } from './types.js';\n\ntype OldItemT = DSLeftNavigationT.GenericItemItemProps;\ntype NewItemT = DSLeftNavigationTreeT.Item;\ntype ReportT = DSLeftNavBridgeT.ReportMutableT;\n\ntype ConvertListArgsT = {\n list: readonly OldItemT[];\n isRoot: boolean;\n /** The dsIds (or the items themselves, when they have none) of the submenus and drilldowns being expanded, to stop a branch that contains itself. */\n ancestors?: readonly (string | OldItemT)[];\n report: ReportT;\n childrenByParentId: DSLeftNavBridgeT.ChildrenByParentIdT;\n};\n\nconst convertCollapsed = (item: OldItemT, report: ReportT): Partial<NewItemT> => {\n if (!item.CollapsedComponent || NO_RAIL_TYPES.includes(item.type ?? '')) return {};\n markLost(report, {\n code: 'collapsed-component-ctx',\n dsId: item.dsId ?? '',\n message: 'CollapsedComponent is kept, it only receives { item }',\n });\n return { CollapsedComponent: item.CollapsedComponent as unknown as NewItemT['CollapsedComponent'] };\n};\n\nconst joinSectionLabel = (label: unknown, rightSection: unknown) =>\n typeof label === 'string' && typeof rightSection === 'string' ? `${label}, ${rightSection}` : label;\n\ntype RecurseT = (children: readonly OldItemT[]) => NewItemT[];\n\nconst convertSubmenu = (item: OldItemT, args: ConvertOneArgsT): NewItemT => {\n const { report, childrenByParentId, recurse } = args;\n const dsId = item.dsId ?? '';\n const children = getOwn(childrenByParentId, dsId);\n if (!children)\n markLost(report, { code: 'submenu-without-children', dsId, message: 'No entry in childrenByParentId' });\n return {\n dsId,\n type: TREE_TYPES.PARENT,\n ...convertCollapsed(item, report),\n itemOpts: { ...convertItemOpts({ item, report, kind: 'submenu' }), items: recurse(children ?? []) },\n };\n};\n\n/**\n * Both legacy drilldowns already open their children in place, so they map one to one to a tree parent. The open state\n * follows the legacy type: the controlled one reads only `isOpened` (closed when omitted), the uncontrolled one only\n * `startOpened`. The tree treats a parent as controlled when `isOpened` is defined, so each option is carried only where\n * LeftNavigation used it.\n */\nconst convertDrilldown = (item: OldItemT, args: ConvertOneArgsT): NewItemT => {\n const { report, recurse } = args;\n const dsId = item.dsId ?? '';\n const { startOpened, isOpened, items = [] } = item.itemOpts ?? {};\n const opts = convertItemOpts({ item, report, kind: 'drilldown' });\n const isControlled = item.type === ITEM_TYPES.LEFT_NAV_ITEM_CONTROLLED_DRILLDOWN;\n return {\n dsId,\n type: TREE_TYPES.PARENT,\n ...convertCollapsed(item, report),\n itemOpts: {\n ...opts,\n ...(isControlled && { isOpened: !!isOpened }),\n ...(!isControlled && startOpened !== undefined && { startOpened }),\n items: recurse(items),\n },\n };\n};\n\ntype ConvertOneArgsT = Omit<ConvertListArgsT, 'list' | 'isRoot'> & { recurse: RecurseT };\n\n/**\n * Converts one item that is neither a section nor a separator. Returns null when the tree cannot carry it over.\n */\nconst convertOne = (item: OldItemT, args: ConvertOneArgsT): NewItemT | null => {\n const { report } = args;\n const dsId = item.dsId ?? '';\n const { type } = item;\n\n if (typeof type !== 'string') {\n markLost(report, {\n code: 'custom-component-dropped',\n dsId,\n message: 'Items with a custom Component are not supported',\n });\n return null;\n }\n if (LEAF_TYPES.includes(type)) {\n return {\n dsId,\n type: TREE_TYPES.LEAF,\n ...convertCollapsed(item, report),\n itemOpts: convertItemOpts({ item, report, kind: 'leaf' }),\n };\n }\n if (type === ITEM_TYPES.LEFT_NAV_ITEM_SUBMENU) return convertSubmenu(item, args);\n if (DRILLDOWN_TYPES.includes(type)) return convertDrilldown(item, args);\n const [code, message] = getOwn(DROPPED_TYPE_CODES as Record<string, readonly [string, string]>, type) ?? [\n 'unknown-type-dropped',\n `Type \"${type}\" is not out of the box`,\n ];\n markLost(report, { code: code as DSLeftNavBridgeT.LostCodeT, dsId, message });\n return null;\n};\n\nconst convertSection = (item: OldItemT, report: ReportT, items: NewItemT[]): NewItemT => {\n const { label, labelRightSection } = item.itemOpts ?? {};\n const joinable = typeof label === 'string' && typeof labelRightSection === 'string';\n const opts = convertItemOpts({ item, report, kind: 'section', joinable });\n return {\n dsId: item.dsId ?? '',\n type: TREE_TYPES.SECTION,\n itemOpts: {\n ...opts,\n label: joinSectionLabel(label, labelRightSection) as NonNullable<NewItemT['itemOpts']>['label'],\n items,\n },\n };\n};\n\n/**\n * LeftNavigation lists are flat: a section is a label and the items that follow it belong to it until the next section or separator.\n * The tree holds the children of a section inside it, so the conversion groups them.\n */\nexport const convertList = (args: ConvertListArgsT): NewItemT[] => {\n const { list, isRoot, report, ancestors = [] } = args;\n const converted: NewItemT[] = [];\n let sectionItems: NewItemT[] | null = null;\n\n list.forEach((item) => {\n const { type, dsId = '' } = item;\n const isSection = type === ITEM_TYPES.LEFT_NAV_ITEM_SECTION;\n if (isSection || type === ITEM_TYPES.LEFT_NAV_ITEM_SEPARATOR) {\n if (!isRoot) {\n markLost(report, {\n code: 'section-in-nested-list-dropped',\n dsId,\n message: 'Sections and separators are only supported at the root level',\n });\n return;\n }\n sectionItems = isSection ? [] : null;\n converted.push(sectionItems ? convertSection(item, report, sectionItems) : { dsId, type: TREE_TYPES.SEPARATOR });\n return;\n }\n /** An item that is its own ancestor (by dsId, or by identity when it has none) would expand forever: its repeated branch stays empty and `duplicate-id` or `missing-id` reports it. */\n const ancestorKey = dsId || item;\n const isOwnAncestor = ancestors.includes(ancestorKey);\n const convertedItem = convertOne(item, {\n report,\n childrenByParentId: args.childrenByParentId,\n recurse: (children) =>\n isOwnAncestor\n ? []\n : convertList({ ...args, list: children, isRoot: false, ancestors: [...ancestors, ancestorKey] }),\n });\n if (!convertedItem) return;\n if (sectionItems) sectionItems.push(convertedItem);\n else converted.push(convertedItem);\n });\n return converted;\n};\n\n/**\n * Returns null when the header cannot be carried over: a skeleton (the same policy as the items of the list), or a custom\n * `Component` (no type, or a type that is not out of the box).\n */\nexport const convertHeader = (header: OldItemT, report: ReportT): NewItemT | null => {\n if (header.type === ITEM_TYPES.LEFT_NAV_ITEM_SKELETON) {\n const [code, message] = DROPPED_TYPE_CODES[ITEM_TYPES.LEFT_NAV_ITEM_SKELETON];\n markLost(report, { code, dsId: header.dsId ?? '', message });\n return null;\n }\n if (typeof header.type !== 'string' || !OUT_OF_THE_BOX_TYPES.includes(header.type)) {\n markLost(report, {\n code: 'custom-component-dropped',\n dsId: header.dsId ?? '',\n message: 'A HeaderComponent with a custom Component is not supported',\n });\n return null;\n }\n if (!HEADER_TYPES.includes(header.type)) {\n markLost(report, {\n code: 'unknown-type-dropped',\n dsId: header.dsId ?? '',\n message: `A HeaderComponent of type \"${header.type}\" is not supported, use a header or a leaf type`,\n });\n return null;\n }\n return {\n dsId: header.dsId ?? '',\n type: TREE_TYPES.LEAF,\n ...convertCollapsed(header, report),\n /** A header of a leaf type is drawn by LeftNavigation as that leaf (a with-date header shows its date), so it converts as one. */\n itemOpts: convertItemOpts({\n item: header,\n report,\n kind: header.type === ITEM_TYPES.LEFT_NAV_ITEM_HEADER ? 'header' : 'leaf',\n }),\n };\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB;AAAA,EACE,mCAAmC;AAAA,OAE9B;AACP,SAAS,kBAAkB;AAE3B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,uBAAuB;AAChC,SAAS,gBAAgB;AAgBzB,MAAM,mBAAmB,CAAC,MAAgB,WAAuC;AAC/E,MAAI,CAAC,KAAK,sBAAsB,cAAc,SAAS,KAAK,QAAQ,EAAE,EAAG,QAAO,CAAC;AACjF,WAAS,QAAQ;AAAA,IACf,MAAM;AAAA,IACN,MAAM,KAAK,QAAQ;AAAA,IACnB,SAAS;AAAA,EACX,CAAC;AACD,SAAO,EAAE,oBAAoB,KAAK,mBAAgE;AACpG;AAEA,MAAM,mBAAmB,CAAC,OAAgB,iBACxC,OAAO,UAAU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,SAAS,OAAO,IAAI,GAAG;AACvC,aAAS,QAAQ;AAAA,MACf,MAAM;AAAA,MACN,MAAM,OAAO,QAAQ;AAAA,MACrB,SAAS,8BAA8B,OAAO,IAAI;AAAA,IACpD,CAAC;AACD,WAAO;AAAA,EACT;AACA,SAAO;AAAA,IACL,MAAM,OAAO,QAAQ;AAAA,IACrB,MAAM,WAAW;AAAA,IACjB,GAAG,iBAAiB,QAAQ,MAAM;AAAA;AAAA,IAElC,UAAU,gBAAgB;AAAA,MACxB,MAAM;AAAA,MACN;AAAA,MACA,MAAM,OAAO,SAAS,WAAW,uBAAuB,WAAW;AAAA,IACrE,CAAC;AAAA,EACH;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,157 @@
1
+ import * as React from "react";
2
+ import React2 from "react";
3
+ import { ITEM_TYPES } from "../../constants/index.js";
4
+ import { markLost } from "./report.js";
5
+ const CONSUMER_SELECTABLE_TYPES = [ITEM_TYPES.LEFT_NAV_ITEM_TEXT_LABEL, ITEM_TYPES.LEFT_NAV_ITEM_WITH_DATE];
6
+ const convertSelectable = (item) => {
7
+ const { selectable } = item.itemOpts ?? {};
8
+ return selectable !== void 0 && CONSUMER_SELECTABLE_TYPES.includes(item.type ?? "") ? { selectable } : {};
9
+ };
10
+ const KNOWN_OPTS = /* @__PURE__ */ new Set([
11
+ "label",
12
+ "labelBold",
13
+ "labelColor",
14
+ "labelOverflow",
15
+ "labelRightSection",
16
+ "selectable",
17
+ "focuseable",
18
+ "startOpened",
19
+ "isOpened",
20
+ "openable",
21
+ "closable",
22
+ "indent",
23
+ "LeftComponent",
24
+ "RightComponent",
25
+ "BottomComponent",
26
+ "ariaLabel",
27
+ "ariaRole",
28
+ "ariaLive",
29
+ "ariaExpanded",
30
+ "ariaDescribedBy",
31
+ "items",
32
+ "labelDataTestId",
33
+ "skeletonVariant"
34
+ ]);
35
+ const DROPPED_OPTS = ["focuseable", "openable", "closable", "indent", "skeletonVariant", "labelDataTestId"];
36
+ const ARIA_OPTS = ["ariaLabel", "ariaRole", "ariaLive", "ariaExpanded", "ariaDescribedBy"];
37
+ const toRightComponent = (node) => (
38
+ // LeftNavigation shows labelRightSection as plain content, the tree renders it through RightComponent
39
+ function RightSection() {
40
+ return React2.createElement(React2.Fragment, null, node);
41
+ }
42
+ );
43
+ const EMPTY_CTX = {
44
+ leftNavProps: {},
45
+ selectedItem: null,
46
+ selectedParent: null
47
+ };
48
+ const carryRightComponent = (Old, rightSection) => function CarriedRightComponent({ item }) {
49
+ return React2.createElement(
50
+ React2.Fragment,
51
+ null,
52
+ rightSection,
53
+ Old ? React2.createElement(Old, { item, ctx: EMPTY_CTX }) : null
54
+ );
55
+ };
56
+ const reportStyleLosses = (opts, dsId, report) => {
57
+ if (opts.labelOverflow === "truncate") {
58
+ markLost(report, {
59
+ code: "label-truncate-to-wrap",
60
+ dsId,
61
+ message: 'labelOverflow "truncate" is not supported, labels wrap'
62
+ });
63
+ }
64
+ if (opts.labelBold !== void 0 || opts.labelColor !== void 0) {
65
+ markLost(report, { code: "label-style-dropped", dsId, message: "labelBold and labelColor are not supported" });
66
+ }
67
+ if (ARIA_OPTS.some((key) => opts[key] !== void 0)) {
68
+ markLost(report, {
69
+ code: "aria-overrides-dropped",
70
+ dsId,
71
+ message: "aria overrides are not supported, the tree computes them"
72
+ });
73
+ }
74
+ };
75
+ const reportDroppedComponents = ({
76
+ item,
77
+ report,
78
+ carriesRight
79
+ }) => {
80
+ const opts = item.itemOpts ?? {};
81
+ const dropped = [
82
+ opts.RightComponent && !carriesRight ? "RightComponent" : void 0,
83
+ opts.LeftComponent ? "LeftComponent" : void 0,
84
+ opts.BottomComponent ? "BottomComponent" : void 0
85
+ ].filter(Boolean);
86
+ if (dropped.length === 0) return;
87
+ markLost(report, {
88
+ code: "component-with-ctx-dropped",
89
+ dsId: item.dsId ?? "",
90
+ message: `Not supported: ${dropped.join(", ")}`
91
+ });
92
+ };
93
+ const droppedRightSection = (opts, joinable) => opts.labelRightSection !== void 0 && !joinable ? ["labelRightSection"] : [];
94
+ const convertCarriedRightComponent = (args, carriesRight) => {
95
+ const { item, report, joinable = false } = args;
96
+ const opts = item.itemOpts ?? {};
97
+ markLost(report, {
98
+ code: "right-component-ctx",
99
+ dsId: item.dsId ?? "",
100
+ message: "RightComponent is kept, it only receives { item } and an empty ctx"
101
+ });
102
+ return {
103
+ RightComponent: carryRightComponent(opts.RightComponent, carriesRight ? opts.labelRightSection : void 0),
104
+ droppedOpts: carriesRight ? [] : droppedRightSection(opts, joinable)
105
+ };
106
+ };
107
+ const convertRightSection = (args) => {
108
+ const { item, report } = args;
109
+ const { labelRightSection } = item.itemOpts ?? {};
110
+ if (typeof labelRightSection !== "string") {
111
+ markLost(report, {
112
+ code: "right-component-ctx",
113
+ dsId: item.dsId ?? "",
114
+ message: "labelRightSection is not text, it is drawn as is: remove any control inside it"
115
+ });
116
+ }
117
+ return { RightComponent: toRightComponent(labelRightSection), droppedOpts: [] };
118
+ };
119
+ const convertRightSide = (args) => {
120
+ const { item, report, kind, joinable = false } = args;
121
+ const opts = item.itemOpts ?? {};
122
+ const carriesRight = kind === "leaf" || kind === "drilldown";
123
+ const carriesRightComponent = carriesRight || kind === "header";
124
+ reportDroppedComponents({ item, report, carriesRight: carriesRightComponent });
125
+ if (carriesRightComponent && opts.RightComponent) return convertCarriedRightComponent(args, carriesRight);
126
+ if (carriesRight && opts.labelRightSection !== void 0) return convertRightSection(args);
127
+ return { droppedOpts: droppedRightSection(opts, joinable) };
128
+ };
129
+ const convertItemOpts = (args) => {
130
+ const { item, report } = args;
131
+ const dsId = item.dsId ?? "";
132
+ const opts = item.itemOpts ?? {};
133
+ const converted = { ...convertSelectable(item) };
134
+ if (opts.label !== void 0) converted.label = opts.label;
135
+ if (opts.labelOverflow !== void 0 && opts.labelOverflow !== "truncate") {
136
+ converted.labelOverflow = opts.labelOverflow;
137
+ }
138
+ reportStyleLosses(opts, dsId, report);
139
+ const { RightComponent, droppedOpts: droppedRight } = convertRightSide(args);
140
+ if (RightComponent) converted.RightComponent = RightComponent;
141
+ const droppedSelectable = args.kind === "drilldown" && opts.selectable !== void 0 ? ["selectable"] : [];
142
+ const customKeys = Object.keys(opts).filter((key) => !KNOWN_OPTS.has(key) && opts[key] !== void 0);
143
+ const droppedOpts = [
144
+ ...droppedSelectable,
145
+ ...DROPPED_OPTS.filter((key) => opts[key] !== void 0),
146
+ ...customKeys,
147
+ ...droppedRight
148
+ ];
149
+ if (droppedOpts.length > 0) {
150
+ markLost(report, { code: "item-options-dropped", dsId, message: `Not supported: ${droppedOpts.join(", ")}` });
151
+ }
152
+ return converted;
153
+ };
154
+ export {
155
+ convertItemOpts
156
+ };
157
+ //# sourceMappingURL=convertItemOpts.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/conversion-utils/convertItemOpts.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport type { DSLeftNavigationTreeT } from '@elliemae/ds-left-navigation-tree';\nimport { ITEM_TYPES } from '../../constants/index.js';\nimport type { DSLeftNavigationT } from '../../react-desc-prop-types.js';\nimport { markLost } from './report.js';\nimport type { DSLeftNavBridgeT } from './types.js';\n\ntype OldItemT = DSLeftNavigationT.GenericItemItemProps;\ntype NewItemOptsT = DSLeftNavigationTreeT.ItemOpts;\ntype ReportT = DSLeftNavBridgeT.ReportMutableT;\ntype OldOptsT = OldItemT['itemOpts'];\ntype OldRightComponentPropsT = DSLeftNavigationT.ComponentProps;\n\n/**\n * LeftNavigation lets the consumer decide `selectable` only on these types. The others set it themselves (a link is always\n * selectable, a submenu, a header or a section follow their own state), so there is nothing to carry or to report.\n */\nconst CONSUMER_SELECTABLE_TYPES: string[] = [ITEM_TYPES.LEFT_NAV_ITEM_TEXT_LABEL, ITEM_TYPES.LEFT_NAV_ITEM_WITH_DATE];\n\nconst convertSelectable = (item: OldItemT): Pick<NewItemOptsT, 'selectable'> => {\n const { selectable } = item.itemOpts ?? {};\n return selectable !== undefined && CONSUMER_SELECTABLE_TYPES.includes(item.type ?? '') ? { selectable } : {};\n};\n\n/**\n * Every key LeftNavigation knows in `itemOpts`. `ItemOptsT` also accepts any other key, which the tree has no place for.\n */\nconst KNOWN_OPTS = new Set([\n 'label',\n 'labelBold',\n 'labelColor',\n 'labelOverflow',\n 'labelRightSection',\n 'selectable',\n 'focuseable',\n 'startOpened',\n 'isOpened',\n 'openable',\n 'closable',\n 'indent',\n 'LeftComponent',\n 'RightComponent',\n 'BottomComponent',\n 'ariaLabel',\n 'ariaRole',\n 'ariaLive',\n 'ariaExpanded',\n 'ariaDescribedBy',\n 'items',\n 'labelDataTestId',\n 'skeletonVariant',\n]);\n\nconst DROPPED_OPTS = ['focuseable', 'openable', 'closable', 'indent', 'skeletonVariant', 'labelDataTestId'] as const;\n\nconst ARIA_OPTS = ['ariaLabel', 'ariaRole', 'ariaLive', 'ariaExpanded', 'ariaDescribedBy'] as const;\n\nconst toRightComponent = (node: unknown): NewItemOptsT['RightComponent'] =>\n // LeftNavigation shows labelRightSection as plain content, the tree renders it through RightComponent\n function RightSection() {\n return React.createElement(React.Fragment, null, node as React.ReactNode);\n };\n\n/**\n * The tree gives its components `{ item }`, LeftNavigation gave `{ item, ctx }`. Components that read `ctx` get an empty one.\n */\nconst EMPTY_CTX = {\n leftNavProps: {},\n selectedItem: null,\n selectedParent: null,\n} as unknown as OldRightComponentPropsT['ctx'];\n\n/**\n * LeftNavigation draws `labelRightSection` and then `RightComponent` on the right side of an item, the tree has one `RightComponent`.\n */\nconst carryRightComponent = (Old: OldOptsT['RightComponent'], rightSection: unknown): NewItemOptsT['RightComponent'] =>\n function CarriedRightComponent({ item }) {\n return React.createElement(\n React.Fragment,\n null,\n rightSection as React.ReactNode,\n Old\n ? React.createElement(Old, { item: item as unknown as OldRightComponentPropsT['item'], ctx: EMPTY_CTX })\n : null,\n );\n };\n\nconst reportStyleLosses = (opts: OldOptsT, dsId: string, report: ReportT) => {\n if (opts.labelOverflow === 'truncate') {\n markLost(report, {\n code: 'label-truncate-to-wrap',\n dsId,\n message: 'labelOverflow \"truncate\" is not supported, labels wrap',\n });\n }\n if (opts.labelBold !== undefined || opts.labelColor !== undefined) {\n markLost(report, { code: 'label-style-dropped', dsId, message: 'labelBold and labelColor are not supported' });\n }\n if (ARIA_OPTS.some((key) => opts[key] !== undefined)) {\n markLost(report, {\n code: 'aria-overrides-dropped',\n dsId,\n message: 'aria overrides are not supported, the tree computes them',\n });\n }\n};\n\ntype ConvertItemOptsArgsT = {\n item: OldItemT;\n report: ReportT;\n /**\n * Leaves and drilldowns carry `RightComponent` and `labelRightSection`, the header only its `RightComponent`.\n * Submenus and the header keep their right side only as the chevron, and the tree draws its own arrow, so it is dropped.\n */\n kind: 'leaf' | 'drilldown' | 'submenu' | 'header' | 'section';\n /** The caller merges labelRightSection into the label (sections), so it is not lost. */\n joinable?: boolean;\n};\n\ntype RightSideResultT = { RightComponent?: NewItemOptsT['RightComponent']; droppedOpts: string[] };\n\nconst reportDroppedComponents = ({\n item,\n report,\n carriesRight,\n}: {\n item: OldItemT;\n report: ReportT;\n carriesRight: boolean;\n}) => {\n const opts = item.itemOpts ?? {};\n const dropped = [\n opts.RightComponent && !carriesRight ? 'RightComponent' : undefined,\n opts.LeftComponent ? 'LeftComponent' : undefined,\n opts.BottomComponent ? 'BottomComponent' : undefined,\n ].filter(Boolean);\n if (dropped.length === 0) return;\n markLost(report, {\n code: 'component-with-ctx-dropped',\n dsId: item.dsId ?? '',\n message: `Not supported: ${dropped.join(', ')}`,\n });\n};\n\nconst droppedRightSection = (opts: OldOptsT, joinable: boolean) =>\n opts.labelRightSection !== undefined && !joinable ? ['labelRightSection'] : [];\n\n/**\n * The header also draws its `RightComponent` (the tree renders it, LeftNavigation did), but never drew `labelRightSection`.\n */\nconst convertCarriedRightComponent = (args: ConvertItemOptsArgsT, carriesRight: boolean): RightSideResultT => {\n const { item, report, joinable = false } = args;\n const opts = item.itemOpts ?? {};\n markLost(report, {\n code: 'right-component-ctx',\n dsId: item.dsId ?? '',\n message: 'RightComponent is kept, it only receives { item } and an empty ctx',\n });\n return {\n RightComponent: carryRightComponent(opts.RightComponent, carriesRight ? opts.labelRightSection : undefined),\n droppedOpts: carriesRight ? [] : droppedRightSection(opts, joinable),\n };\n};\n\n/**\n * A `labelRightSection` that is not text is drawn as is, so a control inside it would be a second focusable element in the\n * treeitem: the conversion keeps it and reports it, as it does with a carried `RightComponent`.\n */\nconst convertRightSection = (args: ConvertItemOptsArgsT): RightSideResultT => {\n const { item, report } = args;\n const { labelRightSection } = item.itemOpts ?? {};\n if (typeof labelRightSection !== 'string') {\n markLost(report, {\n code: 'right-component-ctx',\n dsId: item.dsId ?? '',\n message: 'labelRightSection is not text, it is drawn as is: remove any control inside it',\n });\n }\n return { RightComponent: toRightComponent(labelRightSection), droppedOpts: [] };\n};\n\n/**\n * The right side of an item: leaves and drilldowns keep `RightComponent` and `labelRightSection`, the header only its\n * `RightComponent`, the other kinds lose them.\n */\nconst convertRightSide = (args: ConvertItemOptsArgsT): RightSideResultT => {\n const { item, report, kind, joinable = false } = args;\n const opts = item.itemOpts ?? {};\n const carriesRight = kind === 'leaf' || kind === 'drilldown';\n const carriesRightComponent = carriesRight || kind === 'header';\n reportDroppedComponents({ item, report, carriesRight: carriesRightComponent });\n if (carriesRightComponent && opts.RightComponent) return convertCarriedRightComponent(args, carriesRight);\n if (carriesRight && opts.labelRightSection !== undefined) return convertRightSection(args);\n return { droppedOpts: droppedRightSection(opts, joinable) };\n};\n\n/**\n * Builds the tree item options shared by every converted type and records what could not be carried over.\n */\nexport const convertItemOpts = (args: ConvertItemOptsArgsT): NewItemOptsT => {\n const { item, report } = args;\n const dsId = item.dsId ?? '';\n const opts = item.itemOpts ?? {};\n const converted: NewItemOptsT = { ...convertSelectable(item) };\n if (opts.label !== undefined) converted.label = opts.label;\n if (opts.labelOverflow !== undefined && opts.labelOverflow !== 'truncate') {\n converted.labelOverflow = opts.labelOverflow;\n }\n reportStyleLosses(opts, dsId, report);\n\n const { RightComponent, droppedOpts: droppedRight } = convertRightSide(args);\n if (RightComponent) converted.RightComponent = RightComponent;\n /** LeftNavigation drilldowns keep the consumer's `selectable`, the tree has it on leaves only. */\n const droppedSelectable = args.kind === 'drilldown' && opts.selectable !== undefined ? ['selectable'] : [];\n const customKeys = Object.keys(opts).filter((key) => !KNOWN_OPTS.has(key) && opts[key] !== undefined);\n const droppedOpts = [\n ...droppedSelectable,\n ...DROPPED_OPTS.filter((key) => opts[key] !== undefined),\n ...customKeys,\n ...droppedRight,\n ];\n if (droppedOpts.length > 0) {\n markLost(report, { code: 'item-options-dropped', dsId, message: `Not supported: ${droppedOpts.join(', ')}` });\n }\n return converted;\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAElB,SAAS,kBAAkB;AAE3B,SAAS,gBAAgB;AAazB,MAAM,4BAAsC,CAAC,WAAW,0BAA0B,WAAW,uBAAuB;AAEpH,MAAM,oBAAoB,CAAC,SAAqD;AAC9E,QAAM,EAAE,WAAW,IAAI,KAAK,YAAY,CAAC;AACzC,SAAO,eAAe,UAAa,0BAA0B,SAAS,KAAK,QAAQ,EAAE,IAAI,EAAE,WAAW,IAAI,CAAC;AAC7G;AAKA,MAAM,aAAa,oBAAI,IAAI;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,MAAM,eAAe,CAAC,cAAc,YAAY,YAAY,UAAU,mBAAmB,iBAAiB;AAE1G,MAAM,YAAY,CAAC,aAAa,YAAY,YAAY,gBAAgB,iBAAiB;AAEzF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6B,MAAM,YAAY;AACxG,MAAI,gBAAgB,KAAK,sBAAsB,OAAW,QAAO,oBAAoB,IAAI;AACzF,SAAO,EAAE,aAAa,oBAAoB,MAAM,QAAQ,EAAE;AAC5D;AAKO,MAAM,kBAAkB,CAAC,SAA6C;AAC3E,QAAM,EAAE,MAAM,OAAO,IAAI;AACzB,QAAM,OAAO,KAAK,QAAQ;AAC1B,QAAM,OAAO,KAAK,YAAY,CAAC;AAC/B,QAAM,YAA0B,EAAE,GAAG,kBAAkB,IAAI,EAAE;AAC7D,MAAI,KAAK,UAAU,OAAW,WAAU,QAAQ,KAAK;AACrD,MAAI,KAAK,kBAAkB,UAAa,KAAK,kBAAkB,YAAY;AACzE,cAAU,gBAAgB,KAAK;AAAA,EACjC;AACA,oBAAkB,MAAM,MAAM,MAAM;AAEpC,QAAM,EAAE,gBAAgB,aAAa,aAAa,IAAI,iBAAiB,IAAI;AAC3E,MAAI,eAAgB,WAAU,iBAAiB;AAE/C,QAAM,oBAAoB,KAAK,SAAS,eAAe,KAAK,eAAe,SAAY,CAAC,YAAY,IAAI,CAAC;AACzG,QAAM,aAAa,OAAO,KAAK,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,WAAW,IAAI,GAAG,KAAK,KAAK,GAAG,MAAM,MAAS;AACpG,QAAM,cAAc;AAAA,IAClB,GAAG;AAAA,IACH,GAAG,aAAa,OAAO,CAAC,QAAQ,KAAK,GAAG,MAAM,MAAS;AAAA,IACvD,GAAG;AAAA,IACH,GAAG;AAAA,EACL;AACA,MAAI,YAAY,SAAS,GAAG;AAC1B,aAAS,QAAQ,EAAE,MAAM,wBAAwB,MAAM,SAAS,kBAAkB,YAAY,KAAK,IAAI,CAAC,GAAG,CAAC;AAAA,EAC9G;AACA,SAAO;AACT;",
6
+ "names": ["React"]
7
+ }
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ import { WARNING_PER_LOST_CODE } from "./lostCodes.js";
3
+ const getHumanReadableWarnings = (report) => Object.keys(WARNING_PER_LOST_CODE).filter((code) => report.detectedLostsOnConversion[code]).map((code) => WARNING_PER_LOST_CODE[code]);
4
+ export {
5
+ getHumanReadableWarnings
6
+ };
7
+ //# sourceMappingURL=getHumanReadableWarnings.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/conversion-utils/getHumanReadableWarnings.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { WARNING_PER_LOST_CODE } from './lostCodes.js';\nimport type { DSLeftNavBridgeT } from './types.js';\n\n/**\n * given the report, it will return a human readable list of warnings\n * @param report - The report to get the warnings from.\n * @returns A list of human readable warnings.\n */\nexport const getHumanReadableWarnings = (report: DSLeftNavBridgeT.ReportMutableT): string[] =>\n (Object.keys(WARNING_PER_LOST_CODE) as DSLeftNavBridgeT.LostCodeT[])\n .filter((code) => report.detectedLostsOnConversion[code])\n .map((code) => WARNING_PER_LOST_CODE[code]);\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,6BAA6B;AAQ/B,MAAM,2BAA2B,CAAC,WACtC,OAAO,KAAK,qBAAqB,EAC/B,OAAO,CAAC,SAAS,OAAO,0BAA0B,IAAI,CAAC,EACvD,IAAI,CAAC,SAAS,sBAAsB,IAAI,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,65 @@
1
+ import * as React from "react";
2
+ import { getOwn } from "./conversionConstants.js";
3
+ import { convertHeader, convertList } from "./conversionHelpers.js";
4
+ import { reportIdProblems } from "./validateIds.js";
5
+ import { getHumanReadableWarnings } from "./getHumanReadableWarnings.js";
6
+ import { createEmptyReport, markLost } from "./report.js";
7
+ const reportIgnoredHeaderContent = (dsId, childrenByParentId, report) => {
8
+ if (!dsId || !getOwn(childrenByParentId, dsId)) return;
9
+ markLost(report, {
10
+ code: "header-content-dropped",
11
+ dsId,
12
+ message: "The header is the first leaf, so its list in childrenByParentId was ignored"
13
+ });
14
+ };
15
+ const convertHeaderPart = (args) => {
16
+ const { HeaderComponent, headerAsFirstLeaf, convertedItems, report, childrenByParentId } = args;
17
+ const result = {};
18
+ const header = HeaderComponent ? convertHeader(HeaderComponent, report) : null;
19
+ if (!HeaderComponent || !header) return result;
20
+ if (headerAsFirstLeaf) {
21
+ convertedItems.unshift(header);
22
+ reportIgnoredHeaderContent(HeaderComponent.dsId, childrenByParentId, report);
23
+ return result;
24
+ }
25
+ const headerContent = HeaderComponent.dsId ? getOwn(childrenByParentId, HeaderComponent.dsId) : void 0;
26
+ if (!headerContent) {
27
+ markLost(report, {
28
+ code: "header-without-content",
29
+ dsId: HeaderComponent.dsId ?? "",
30
+ message: "No entry in childrenByParentId for the header, it is a disclosure with nothing to open"
31
+ });
32
+ }
33
+ return {
34
+ convertedHeader: header,
35
+ convertedHeaderItems: headerContent ? convertList({ list: headerContent, isRoot: true, report, childrenByParentId }) : []
36
+ };
37
+ };
38
+ const checkAndConvertItems = (items, options = {}) => {
39
+ const { childrenByParentId = {}, HeaderComponent, BodyHeaderComponent, headerAsFirstLeaf = false } = options;
40
+ const report = createEmptyReport();
41
+ const convertedItems = convertList({ list: items, isRoot: true, report, childrenByParentId });
42
+ const { convertedHeader, convertedHeaderItems } = convertHeaderPart({
43
+ HeaderComponent,
44
+ headerAsFirstLeaf,
45
+ convertedItems,
46
+ report,
47
+ childrenByParentId
48
+ });
49
+ reportIdProblems(convertedItems, report, convertedHeader ? [convertedHeader.dsId] : []);
50
+ if (convertedHeaderItems)
51
+ reportIdProblems(convertedHeaderItems, report, convertedHeader?.dsId ? [convertedHeader.dsId] : []);
52
+ if (BodyHeaderComponent) {
53
+ markLost(report, {
54
+ code: "body-header-dropped",
55
+ dsId: BodyHeaderComponent.dsId ?? "",
56
+ message: "BodyHeaderComponent is not supported, the submenu is the parent of its children"
57
+ });
58
+ }
59
+ report.humanReadableWarnings = getHumanReadableWarnings(report);
60
+ return { convertedItems, convertedHeader, convertedHeaderItems, report };
61
+ };
62
+ export {
63
+ checkAndConvertItems
64
+ };
65
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/conversion-utils/index.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { getOwn } from './conversionConstants.js';\nimport { convertHeader, convertList } from './conversionHelpers.js';\nimport { reportIdProblems } from './validateIds.js';\nimport { getHumanReadableWarnings } from './getHumanReadableWarnings.js';\nimport { createEmptyReport, markLost } from './report.js';\nimport type { DSLeftNavBridgeT } from './types.js';\nimport type { DSLeftNavigationT } from '../../react-desc-prop-types.js';\n\ntype ConvertHeaderPartArgsT = {\n HeaderComponent?: DSLeftNavBridgeT.OptionsT['HeaderComponent'];\n headerAsFirstLeaf: boolean;\n convertedItems: DSLeftNavBridgeT.ResultT['convertedItems'];\n report: DSLeftNavBridgeT.ReportMutableT;\n childrenByParentId: DSLeftNavBridgeT.ChildrenByParentIdT;\n};\n\nconst reportIgnoredHeaderContent = (\n dsId: string | undefined,\n childrenByParentId: DSLeftNavBridgeT.ChildrenByParentIdT,\n report: DSLeftNavBridgeT.ReportMutableT,\n) => {\n if (!dsId || !getOwn(childrenByParentId, dsId)) return;\n markLost(report, {\n code: 'header-content-dropped',\n dsId,\n message: 'The header is the first leaf, so its list in childrenByParentId was ignored',\n });\n};\n\nconst convertHeaderPart = (args: ConvertHeaderPartArgsT) => {\n const { HeaderComponent, headerAsFirstLeaf, convertedItems, report, childrenByParentId } = args;\n const result: Pick<DSLeftNavBridgeT.ResultT, 'convertedHeader' | 'convertedHeaderItems'> = {};\n const header = HeaderComponent ? convertHeader(HeaderComponent, report) : null;\n if (!HeaderComponent || !header) return result;\n if (headerAsFirstLeaf) {\n convertedItems.unshift(header);\n reportIgnoredHeaderContent(HeaderComponent.dsId, childrenByParentId, report);\n return result;\n }\n const headerContent = HeaderComponent.dsId ? getOwn(childrenByParentId, HeaderComponent.dsId) : undefined;\n if (!headerContent) {\n markLost(report, {\n code: 'header-without-content',\n dsId: HeaderComponent.dsId ?? '',\n message: 'No entry in childrenByParentId for the header, it is a disclosure with nothing to open',\n });\n }\n return {\n convertedHeader: header,\n convertedHeaderItems: headerContent\n ? convertList({ list: headerContent, isRoot: true, report, childrenByParentId })\n : [],\n };\n};\n\n/**\n * Converts LeftNavigation items to DSLeftNavigationTree items and reports what the tree cannot carry over.\n * It is a migration aid, not a drop-in replacement: read `report.humanReadableWarnings` and `report.lostEntries`.\n * @param items - The LeftNavigation items (the flat list shown by the body).\n * @param options - Children of the submenus (`childrenByParentId`), and the `HeaderComponent` and `BodyHeaderComponent` props.\n * @returns The converted items and the report. `HeaderComponent` becomes `convertedHeader`, a disclosure, and\n * `convertedHeaderItems` is its content (the list under the header `dsId` in `childrenByParentId`) to pass as `items`\n * while it is open. A header that is only a link goes to the front of `convertedItems` with `headerAsFirstLeaf`.\n */\nexport const checkAndConvertItems = (\n items: readonly DSLeftNavigationT.GenericItemItemProps[],\n options: DSLeftNavBridgeT.OptionsT = {},\n): DSLeftNavBridgeT.ResultT => {\n const { childrenByParentId = {}, HeaderComponent, BodyHeaderComponent, headerAsFirstLeaf = false } = options;\n const report = createEmptyReport();\n const convertedItems = convertList({ list: items, isRoot: true, report, childrenByParentId });\n const { convertedHeader, convertedHeaderItems } = convertHeaderPart({\n HeaderComponent,\n headerAsFirstLeaf,\n convertedItems,\n report,\n childrenByParentId,\n });\n /** The header and each list the consumer passes as `items` are one hierarchy for the tree, so each is validated with the header. */\n reportIdProblems(convertedItems, report, convertedHeader ? [convertedHeader.dsId] : []);\n if (convertedHeaderItems)\n reportIdProblems(convertedHeaderItems, report, convertedHeader?.dsId ? [convertedHeader.dsId] : []);\n if (BodyHeaderComponent) {\n markLost(report, {\n code: 'body-header-dropped',\n dsId: BodyHeaderComponent.dsId ?? '',\n message: 'BodyHeaderComponent is not supported, the submenu is the parent of its children',\n });\n }\n report.humanReadableWarnings =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S,kBAAkB;AACjC,QAAM,iBAAiB,YAAY,EAAE,MAAM,OAAO,QAAQ,MAAM,QAAQ,mBAAmB,CAAC;AAC5F,QAAM,EAAE,iBAAiB,qBAAqB,IAAI,kBAAkB;AAAA,IAClE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,mBAAiB,gBAAgB,QAAQ,kBAAkB,CAAC,gBAAgB,IAAI,IAAI,CAAC,CAAC;AACtF,MAAI;AACF,qBAAiB,sBAAsB,QAAQ,iBAAiB,OAAO,CAAC,gBAAgB,IAAI,IAAI,CAAC,CAAC;AACpG,MAAI,qBAAqB;AACvB,aAAS,QAAQ;AAAA,MACf,MAAM;AAAA,MACN,MAAM,oBAAoB,QAAQ;AAAA,MAClC,SAAS;AAAA,IACX,CAAC;AAAA,EACH;AACA,SAAO,wBAAwB,yBAAyB,MAAM;AAC9D,SAAO,EAAE,gBAAgB,iBAAiB,sBAAsB,OAAO;AACzE;",
6
+ "names": []
7
+ }
@@ -0,0 +1,25 @@
1
+ import * as React from "react";
2
+ const WARNING_PER_LOST_CODE = {
3
+ "submenu-without-children": `- Encountered submenu items without an entry in "childrenByParentId" - the tree needs the children in the data, the conversion created an empty parent`,
4
+ "custom-component-dropped": `- Encountered items with a custom "Component" - a treeitem cannot hold arbitrary interactive content (WCAG 4.1.2), the conversion dropped them`,
5
+ "skeleton-dropped": `- Encountered skeleton items - loading states are not part of the tree, the conversion dropped them`,
6
+ "header-item-dropped": `- Encountered an item of type header inside "items" - the tree has one header disclosure, passed as "HeaderComponent", the conversion dropped it from the list`,
7
+ "header-content-dropped": `- Encountered "headerAsFirstLeaf" together with a list for the header in "childrenByParentId" - a header that is the first item of the list has nothing to open, the conversion ignored that list. Drop "headerAsFirstLeaf" to keep the header as a disclosure with its content`,
8
+ "header-without-content": `- Encountered a "HeaderComponent" without an entry in "childrenByParentId" - the tree header is a disclosure with nothing to open. If the header is only a link, pass "headerAsFirstLeaf" to make it the first item of the list`,
9
+ "right-component-ctx": `- Encountered "RightComponent" on a leaf, drilldown or header, or a "labelRightSection" that is not text - the conversion kept it, but the tree only gives it "{ item }" and an empty "ctx", so it must not read "ctx". The "item" it receives is the converted tree item (another type, with only the options the tree keeps), so it must not read legacy fields either. The conversion does not inspect what it draws: remove buttons, menus or any other control inside it before rendering the converted data, a treeitem cannot hold them`,
10
+ "body-header-dropped": `- Encountered "BodyHeaderComponent" - the tree shows the opened submenu as the parent of its children, the conversion ignored it`,
11
+ "component-with-ctx-dropped": `- Encountered "LeftComponent" or "BottomComponent", or a "RightComponent" on a submenu or section - the tree has no place for them (parents draw their own arrow), the conversion dropped them`,
12
+ "collapsed-component-ctx": `- Encountered "CollapsedComponent" - the conversion kept it as is, but the tree only gives it "{ item }" with the converted tree item (another type, with only the options the tree keeps), so it must not read "ctx" or legacy fields of the item`,
13
+ "label-style-dropped": `- Encountered "labelBold" or "labelColor" - state conveyed only by weight or color fails WCAG 1.3.1 and 1.4.1, the conversion dropped them`,
14
+ "label-truncate-to-wrap": `- Encountered "labelOverflow: truncate" - truncated labels need a hover tooltip (1.4.13) and hide text from users who zoom (1.4.10), the conversion uses "wrap"`,
15
+ "aria-overrides-dropped": `- Encountered "ariaLabel", "ariaRole", "ariaLive", "ariaExpanded" or "ariaDescribedBy" - the tree computes its own names and states, the conversion dropped them`,
16
+ "item-options-dropped": `- Encountered item options the tree does not have (selectable on a drilldown, focuseable, openable, closable, indent, skeletonVariant, labelDataTestId, any other key of itemOpts, or a non-text labelRightSection where it cannot be shown) - the conversion dropped them, see lostEntries for the list per item`,
17
+ "section-in-nested-list-dropped": `- Encountered a section or separator inside a submenu or drilldown - the tree supports them only at the root level, the conversion dropped them`,
18
+ "missing-id": `- Encountered items without a "dsId" - the tree finds every item by its "dsId", so each one needs its own; set it before using the converted items`,
19
+ "duplicate-id": `- Encountered the same "dsId" on more than one item of the converted hierarchy - the tree finds items by "dsId" across all levels, so a repeated one overwrites the other's label and parent; give each item a unique "dsId" (LeftNavigation only needed it unique inside the list that is shown)`,
20
+ "unknown-type-dropped": `- Encountered items with a type that is not out of the box, or a "HeaderComponent" that is not a header, link, text-label or with-date - the conversion dropped them`
21
+ };
22
+ export {
23
+ WARNING_PER_LOST_CODE
24
+ };
25
+ //# sourceMappingURL=lostCodes.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/conversion-utils/lostCodes.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/**\n * Single source of truth for the codes of what the conversion cannot carry over: the type, the empty report and the warnings derive from it.\n */\nexport const WARNING_PER_LOST_CODE = {\n 'submenu-without-children': `- Encountered submenu items without an entry in \"childrenByParentId\" - the tree needs the children in the data, the conversion created an empty parent`,\n 'custom-component-dropped': `- Encountered items with a custom \"Component\" - a treeitem cannot hold arbitrary interactive content (WCAG 4.1.2), the conversion dropped them`,\n 'skeleton-dropped': `- Encountered skeleton items - loading states are not part of the tree, the conversion dropped them`,\n 'header-item-dropped': `- Encountered an item of type header inside \"items\" - the tree has one header disclosure, passed as \"HeaderComponent\", the conversion dropped it from the list`,\n 'header-content-dropped': `- Encountered \"headerAsFirstLeaf\" together with a list for the header in \"childrenByParentId\" - a header that is the first item of the list has nothing to open, the conversion ignored that list. Drop \"headerAsFirstLeaf\" to keep the header as a disclosure with its content`,\n 'header-without-content': `- Encountered a \"HeaderComponent\" without an entry in \"childrenByParentId\" - the tree header is a disclosure with nothing to open. If the header is only a link, pass \"headerAsFirstLeaf\" to make it the first item of the list`,\n 'right-component-ctx': `- Encountered \"RightComponent\" on a leaf, drilldown or header, or a \"labelRightSection\" that is not text - the conversion kept it, but the tree only gives it \"{ item }\" and an empty \"ctx\", so it must not read \"ctx\". The \"item\" it receives is the converted tree item (another type, with only the options the tree keeps), so it must not read legacy fields either. The conversion does not inspect what it draws: remove buttons, menus or any other control inside it before rendering the converted data, a treeitem cannot hold them`,\n 'body-header-dropped': `- Encountered \"BodyHeaderComponent\" - the tree shows the opened submenu as the parent of its children, the conversion ignored it`,\n 'component-with-ctx-dropped': `- Encountered \"LeftComponent\" or \"BottomComponent\", or a \"RightComponent\" on a submenu or section - the tree has no place for them (parents draw their own arrow), the conversion dropped them`,\n 'collapsed-component-ctx': `- Encountered \"CollapsedComponent\" - the conversion kept it as is, but the tree only gives it \"{ item }\" with the converted tree item (another type, with only the options the tree keeps), so it must not read \"ctx\" or legacy fields of the item`,\n 'label-style-dropped': `- Encountered \"labelBold\" or \"labelColor\" - state conveyed only by weight or color fails WCAG 1.3.1 and 1.4.1, the conversion dropped them`,\n 'label-truncate-to-wrap': `- Encountered \"labelOverflow: truncate\" - truncated labels need a hover tooltip (1.4.13) and hide text from users who zoom (1.4.10), the conversion uses \"wrap\"`,\n 'aria-overrides-dropped': `- Encountered \"ariaLabel\", \"ariaRole\", \"ariaLive\", \"ariaExpanded\" or \"ariaDescribedBy\" - the tree computes its own names and states, the conversion dropped them`,\n 'item-options-dropped': `- Encountered item options the tree does not have (selectable on a drilldown, focuseable, openable, closable, indent, skeletonVariant, labelDataTestId, any other key of itemOpts, or a non-text labelRightSection where it cannot be shown) - the conversion dropped them, see lostEntries for the list per item`,\n 'section-in-nested-list-dropped': `- Encountered a section or separator inside a submenu or drilldown - the tree supports them only at the root level, the conversion dropped them`,\n 'missing-id': `- Encountered items without a \"dsId\" - the tree finds every item by its \"dsId\", so each one needs its own; set it before using the converted items`,\n 'duplicate-id': `- Encountered the same \"dsId\" on more than one item of the converted hierarchy - the tree finds items by \"dsId\" across all levels, so a repeated one overwrites the other's label and parent; give each item a unique \"dsId\" (LeftNavigation only needed it unique inside the list that is shown)`,\n 'unknown-type-dropped': `- Encountered items with a type that is not out of the box, or a \"HeaderComponent\" that is not a header, link, text-label or with-date - the conversion dropped them`,\n} as const;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACGhB,MAAM,wBAAwB;AAAA,EACnC,4BAA4B;AAAA,EAC5B,4BAA4B;AAAA,EAC5B,oBAAoB;AAAA,EACpB,uBAAuB;AAAA,EACvB,0BAA0B;AAAA,EAC1B,0BAA0B;AAAA,EAC1B,uBAAuB;AAAA,EACvB,uBAAuB;AAAA,EACvB,8BAA8B;AAAA,EAC9B,2BAA2B;AAAA,EAC3B,uBAAuB;AAAA,EACvB,0BAA0B;AAAA,EAC1B,0BAA0B;AAAA,EAC1B,wBAAwB;AAAA,EACxB,kCAAkC;AAAA,EAClC,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,wBAAwB;AAC1B;",
6
+ "names": []
7
+ }
@@ -0,0 +1,18 @@
1
+ import * as React from "react";
2
+ import { WARNING_PER_LOST_CODE } from "./lostCodes.js";
3
+ const createEmptyReport = () => ({
4
+ detectedLostsOnConversion: Object.fromEntries(
5
+ Object.keys(WARNING_PER_LOST_CODE).map((code) => [code, false])
6
+ ),
7
+ lostEntries: [],
8
+ humanReadableWarnings: []
9
+ });
10
+ const markLost = (report, entry) => {
11
+ report.detectedLostsOnConversion[entry.code] = true;
12
+ report.lostEntries.push(entry);
13
+ };
14
+ export {
15
+ createEmptyReport,
16
+ markLost
17
+ };
18
+ //# sourceMappingURL=report.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/conversion-utils/report.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { WARNING_PER_LOST_CODE } from './lostCodes.js';\nimport type { DSLeftNavBridgeT } from './types.js';\n\nexport const createEmptyReport = (): DSLeftNavBridgeT.ReportMutableT => ({\n detectedLostsOnConversion: Object.fromEntries(\n Object.keys(WARNING_PER_LOST_CODE).map((code) => [code, false]),\n ) as DSLeftNavBridgeT.ReportMutableT['detectedLostsOnConversion'],\n lostEntries: [],\n humanReadableWarnings: [],\n});\n\nexport const markLost = (report: DSLeftNavBridgeT.ReportMutableT, entry: DSLeftNavBridgeT.LostEntryT) => {\n // eslint-disable-next-line no-param-reassign\n report.detectedLostsOnConversion[entry.code] = true;\n report.lostEntries.push(entry);\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,6BAA6B;AAG/B,MAAM,oBAAoB,OAAwC;AAAA,EACvE,2BAA2B,OAAO;AAAA,IAChC,OAAO,KAAK,qBAAqB,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC;AAAA,EAChE;AAAA,EACA,aAAa,CAAC;AAAA,EACd,uBAAuB,CAAC;AAC1B;AAEO,MAAM,WAAW,CAAC,QAAyC,UAAuC;AAEvG,SAAO,0BAA0B,MAAM,IAAI,IAAI;AAC/C,SAAO,YAAY,KAAK,KAAK;AAC/B;",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ import * as React from "react";
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;",
6
+ "names": []
7
+ }
@@ -0,0 +1,28 @@
1
+ import * as React from "react";
2
+ import { markLost } from "./report.js";
3
+ const collectIds = (items, ids = []) => {
4
+ items.forEach((item) => {
5
+ ids.push(item.dsId);
6
+ collectIds(item.itemOpts?.items ?? [], ids);
7
+ });
8
+ return ids;
9
+ };
10
+ const reportIdProblems = (items, report, extraIds = []) => {
11
+ const seen = /* @__PURE__ */ new Set();
12
+ const reported = /* @__PURE__ */ new Set();
13
+ [...extraIds, ...collectIds(items)].forEach((dsId) => {
14
+ if (!dsId) {
15
+ markLost(report, { code: "missing-id", dsId: "", message: "An item has no dsId" });
16
+ return;
17
+ }
18
+ if (seen.has(dsId) && !reported.has(dsId)) {
19
+ reported.add(dsId);
20
+ markLost(report, { code: "duplicate-id", dsId, message: "The dsId is used by more than one item" });
21
+ }
22
+ seen.add(dsId);
23
+ });
24
+ };
25
+ export {
26
+ reportIdProblems
27
+ };
28
+ //# sourceMappingURL=validateIds.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/conversion-utils/validateIds.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { DSLeftNavigationTreeT } from '@elliemae/ds-left-navigation-tree';\nimport { markLost } from './report.js';\nimport type { DSLeftNavBridgeT } from './types.js';\n\ntype NewItemT = DSLeftNavigationTreeT.Item;\n\nconst collectIds = (items: readonly NewItemT[], ids: string[] = []): string[] => {\n items.forEach((item) => {\n ids.push(item.dsId);\n collectIds(item.itemOpts?.items ?? [], ids);\n });\n return ids;\n};\n\n/**\n * The tree finds items by `dsId` across every level of the list it receives, LeftNavigation only needed them unique inside each list it showed.\n * Reports the items without one and the ids that repeat, once per repeated id.\n */\nexport const reportIdProblems = (\n items: readonly NewItemT[],\n report: DSLeftNavBridgeT.ReportMutableT,\n extraIds: readonly string[] = [],\n) => {\n const seen = new Set<string>();\n const reported = new Set<string>();\n [...extraIds, ...collectIds(items)].forEach((dsId) => {\n if (!dsId) {\n markLost(report, { code: 'missing-id', dsId: '', message: 'An item has no dsId' });\n return;\n }\n if (seen.has(dsId) && !reported.has(dsId)) {\n reported.add(dsId);\n markLost(report, { code: 'duplicate-id', dsId, message: 'The dsId is used by more than one item' });\n }\n seen.add(dsId);\n });\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,gBAAgB;AAKzB,MAAM,aAAa,CAAC,OAA4B,MAAgB,CAAC,MAAgB;AAC/E,QAAM,QAAQ,CAAC,SAAS;AACtB,QAAI,KAAK,KAAK,IAAI;AAClB,eAAW,KAAK,UAAU,SAAS,CAAC,GAAG,GAAG;AAAA,EAC5C,CAAC;AACD,SAAO;AACT;AAMO,MAAM,mBAAmB,CAC9B,OACA,QACA,WAA8B,CAAC,MAC5B;AACH,QAAM,OAAO,oBAAI,IAAY;AAC7B,QAAM,WAAW,oBAAI,IAAY;AACjC,GAAC,GAAG,UAAU,GAAG,WAAW,KAAK,CAAC,EAAE,QAAQ,CAAC,SAAS;AACpD,QAAI,CAAC,MAAM;AACT,eAAS,QAAQ,EAAE,MAAM,cAAc,MAAM,IAAI,SAAS,sBAAsB,CAAC;AACjF;AAAA,IACF;AACA,QAAI,KAAK,IAAI,IAAI,KAAK,CAAC,SAAS,IAAI,IAAI,GAAG;AACzC,eAAS,IAAI,IAAI;AACjB,eAAS,QAAQ,EAAE,MAAM,gBAAgB,MAAM,SAAS,yCAAyC,CAAC;AAAA,IACpG;AACA,SAAK,IAAI,IAAI;AAAA,EACf,CAAC;AACH;",
6
+ "names": []
7
+ }
package/dist/esm/index.js CHANGED
@@ -14,6 +14,7 @@ import {
14
14
  LEFT_NAVIGATION_SLOTS,
15
15
  MAP_ITEMS_TO_SKELETON
16
16
  } from "./constants/index.js";
17
+ import { checkAndConvertItems } from "./exported-related/conversion-utils/index.js";
17
18
  import { ChevronItem, Icon, ItemRenderer, Notifications, OpenWindow } from "./exported-related/index.js";
18
19
  import { LeftNavigation as LeftNavigation2, LeftNavigationWithSchema } from "./LeftNavigation.js";
19
20
  import {
@@ -45,6 +46,7 @@ export {
45
46
  MAP_ITEMS_TO_SKELETON,
46
47
  Notifications,
47
48
  OpenWindow,
49
+ checkAndConvertItems,
48
50
  index_default as default
49
51
  };
50
52
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { LeftNavigation } from './LeftNavigation.js';\n\nexport default LeftNavigation;\nexport {\n CHEVRON_BACK_DS_ID,\n DSLeftNavigationName,\n DSLeftNavigationSlots,\n FOOTER_DS_ID,\n FOOTER_MENU_CLOSE_DS_ID,\n ITEM_TYPES,\n LABEL_OVERFLOW,\n LEFT_NAVIGATION_DATA_TESTID,\n LEFT_NAVIGATION_REGION_FOCUSES,\n LEFT_NAVIGATION_SLOTS,\n MAP_ITEMS_TO_SKELETON,\n} from './constants/index.js';\nexport { ChevronItem, Icon, ItemRenderer, Notifications, OpenWindow } from './exported-related/index.js';\nexport { LeftNavigation, LeftNavigationWithSchema } from './LeftNavigation.js';\nexport {\n DSLeftNavigationItemPropTypesSchema,\n DSLeftNavigationPropTypesSchema,\n LeftNavItemOptionsSchema,\n LeftNavItemPropsSchema,\n type DSLeftNavigationT,\n} from './react-desc-prop-types.js';\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,sBAAsB;AAE/B,IAAO,gBAAQ;AACf;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,aAAa,MAAM,cAAc,eAAe,kBAAkB;AAC3E,SAAS,kBAAAA,iBAAgB,gCAAgC;AACzD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { LeftNavigation } from './LeftNavigation.js';\n\nexport default LeftNavigation;\nexport {\n CHEVRON_BACK_DS_ID,\n DSLeftNavigationName,\n DSLeftNavigationSlots,\n FOOTER_DS_ID,\n FOOTER_MENU_CLOSE_DS_ID,\n ITEM_TYPES,\n LABEL_OVERFLOW,\n LEFT_NAVIGATION_DATA_TESTID,\n LEFT_NAVIGATION_REGION_FOCUSES,\n LEFT_NAVIGATION_SLOTS,\n MAP_ITEMS_TO_SKELETON,\n} from './constants/index.js';\nexport { checkAndConvertItems } from './exported-related/conversion-utils/index.js';\nexport type { DSLeftNavBridgeT } from './exported-related/conversion-utils/types.js';\nexport { ChevronItem, Icon, ItemRenderer, Notifications, OpenWindow } from './exported-related/index.js';\nexport { LeftNavigation, LeftNavigationWithSchema } from './LeftNavigation.js';\nexport {\n DSLeftNavigationItemPropTypesSchema,\n DSLeftNavigationPropTypesSchema,\n LeftNavItemOptionsSchema,\n LeftNavItemPropsSchema,\n type DSLeftNavigationT,\n} from './react-desc-prop-types.js';\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,sBAAsB;AAE/B,IAAO,gBAAQ;AACf;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,4BAA4B;AAErC,SAAS,aAAa,MAAM,cAAc,eAAe,kBAAkB;AAC3E,SAAS,kBAAAA,iBAAgB,gCAAgC;AACzD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;",
6
6
  "names": ["LeftNavigation"]
7
7
  }
@@ -1,8 +1,8 @@
1
1
  import * as React from "react";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { ChevronSmallLeft } from "@elliemae/ds-icons";
4
- import { TruncatedTooltipText } from "../../TruncatedTooltipText.js";
5
4
  import React2, { useCallback } from "react";
5
+ import { TruncatedTooltipText } from "../../TruncatedTooltipText.js";
6
6
  import { CHEVRON_BACK_DS_ID, LEFT_NAVIGATION_DATA_TESTID } from "../../constants/index.js";
7
7
  import { ItemRenderer } from "../../exported-related/index.js";
8
8
  import {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/outOfTheBox/ItemHeader/index.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport { ChevronSmallLeft } from '@elliemae/ds-icons';\nimport type { Theme } from '@elliemae/ds-system';\nimport { TruncatedTooltipText } from '../../TruncatedTooltipText.js';\nimport React, { useCallback } from 'react';\nimport { CHEVRON_BACK_DS_ID, LEFT_NAVIGATION_DATA_TESTID } from '../../constants/index.js';\nimport { ItemRenderer } from '../../exported-related/index.js';\nimport type { DSLeftNavigationT } from '../../react-desc-prop-types.js';\nimport {\n StyledBottomContainer,\n StyledChevronLeft,\n StyledItemLabel,\n StyledLeftContainer,\n StyledRightContainer,\n} from '../styled.js';\n\nconst notOpenedShadowStyle = (isSelected: boolean) => (theme: Theme) =>\n `\n box-shadow: inset 4px 0 0 0 ${isSelected ? theme.colors.brand[400] : 'transparent'};\n\n :hover {\n box-shadow: inset 4px 0 0 0 ${isSelected ? theme.colors.brand[400] : theme.colors.brand[300]};\n }\n\n :active {\n box-shadow: inset 4px 0 0 0 ${theme.colors.brand[400]};\n }\n`;\n\nexport const ItemHeader = (props: DSLeftNavigationT.ComponentProps): JSX.Element => {\n const {\n item,\n item: {\n dsId,\n itemOpts: { label, RightComponent, BottomComponent, labelDataTestId, labelOverflow: itemLabelOverflow },\n CollapsedComponent = () => null,\n },\n ctx,\n ctx: {\n leftNavProps,\n leftNavProps: { openedItem, labelOverflow: leftNavLabelOverflow, onItemClick },\n expandedForAnimation,\n setFocusedItem,\n selectedItem,\n selectedParent,\n },\n } = props;\n\n const getOwnerProps = React.useCallback(() => leftNavProps, [leftNavProps]);\n const getOwnerPropsArguments = React.useCallback(() => ({}), []);\n const labelOverflow = itemLabelOverflow || leftNavLabelOverflow;\n\n const opened = openedItem === dsId;\n\n const ariaLabel = item.itemOpts.ariaLabel ?? (typeof label === 'string' ? `${label}, category` : 'category');\n\n const isSelected = selectedItem === dsId || selectedParent === dsId;\n\n const shadowStyle = useCallback(\n (opened_: boolean) => (theme: Theme) =>\n !opened_ ? notOpenedShadowStyle(isSelected)(theme) : `box-shadow: inset 4px 0 0 0 #52A6EC`,\n [isSelected],\n );\n\n return (\n <ItemRenderer\n item={{\n ...item,\n itemOpts: {\n ariaLabel,\n ariaExpanded: opened,\n ...item.itemOpts,\n openable: expandedForAnimation && !opened,\n closable: expandedForAnimation && opened,\n selectable: !opened,\n },\n }}\n hasBorderBottom\n borderBottomMr={opened ? '12px' : '0px'}\n shadowStyle={shadowStyle}\n >\n <StyledLeftContainer\n cols={opened ? ['auto', 'auto'] : ['38px']}\n gutter=\"1px\"\n pl={opened ? 'xxs' : 0}\n justifyItems=\"center\"\n data-testid={LEFT_NAVIGATION_DATA_TESTID.LEFT_CONTAINER} // https://jira.elliemae.io/browse/PUI-15589\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {opened && (\n <StyledChevronLeft\n buttonType=\"raw\"\n onClick={(e: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>) => {\n if (onItemClick) onItemClick(item, e as React.MouseEvent<HTMLElement>);\n }}\n onFocus={(e: React.FocusEvent) => {\n e.stopPropagation();\n setFocusedItem(CHEVRON_BACK_DS_ID);\n }}\n aria-label={`Close ${ariaLabel}`}\n data-testid={LEFT_NAVIGATION_DATA_TESTID.ITEM_CHEVRON_BACK} // https://jira.elliemae.io/browse/PUI-15589\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <ChevronSmallLeft size=\"m\" color={['brand-primary', '800']} />\n </StyledChevronLeft>\n )}\n {CollapsedComponent && <CollapsedComponent item={item} ctx={ctx} />}\n </StyledLeftContainer>\n <StyledItemLabel\n ml={opened ? 'xxs' : '1px'}\n mt=\"xxxs\"\n mb=\"15px\"\n labelOverflow={labelOverflow}\n data-testid={labelDataTestId || LEFT_NAVIGATION_DATA_TESTID.ITEM_LABEL}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {labelOverflow === 'truncate' ? <TruncatedTooltipText value={label} placement=\"bottom-start\" /> : label}\n </StyledItemLabel>\n <StyledRightContainer\n pl=\"xs\"\n pr={opened ? 'xxs2' : 'xxs'}\n onFocus={(e: React.FocusEvent) => {\n setFocusedItem(null);\n e.stopPropagation();\n }}\n onKeyDown={(e: React.KeyboardEvent) => e.stopPropagation()}\n data-testid={LEFT_NAVIGATION_DATA_TESTID.RIGHT_CONTAINER} // https://jira.elliemae.io/browse/PUI-15589\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {RightComponent && <RightComponent ctx={ctx} item={item} />}\n </StyledRightContainer>\n {BottomComponent && (\n <StyledBottomContainer\n pb=\"xxxs\"\n pl=\"xxs\"\n pr=\"xxs\"\n onFocus={(e: React.FocusEvent) => {\n setFocusedItem(null);\n e.stopPropagation();\n }}\n onKeyDown={(e: React.KeyboardEvent) => e.stopPropagation()}\n data-testid={LEFT_NAVIGATION_DATA_TESTID.BOTTOM_CONTAINER} // https://jira.elliemae.io/browse/PUI-15589\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <BottomComponent ctx={ctx} item={item} />\n </StyledBottomContainer>\n )}\n </ItemRenderer>\n );\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACoFjB,SAwBM,KAxBN;AAhFN,SAAS,wBAAwB;AAEjC,SAAS,4BAA4B;AACrC,OAAOA,UAAS,mBAAmB;AACnC,SAAS,oBAAoB,mCAAmC;AAChE,SAAS,oBAAoB;AAE7B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,MAAM,uBAAuB,CAAC,eAAwB,CAAC,UACrD;AAAA,gCAC8B,aAAa,MAAM,OAAO,MAAM,GAAG,IAAI,aAAa;AAAA;AAAA;AAAA,kCAGlD,aAAa,MAAM,OAAO,MAAM,GAAG,IAAI,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA;AAAA;AAAA;AAAA,kCAI9D,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA;AAAA;AAIlD,MAAM,aAAa,CAAC,UAAyD;AAClF,QAAM;AAAA,IACJ;AAAA,IACA,MAAM;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CAAC,MAA2B,EAAE,gBAAgB;AAAA,YACzD,eAAa,4BAA4B;AAAA,YACzC;AAAA,YACA;AAAA,YAEA,8BAAC,mBAAgB,KAAU,MAAY;AAAA;AAAA,QACzC;AAAA;AAAA;AAAA,EAEJ;AAEJ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport { ChevronSmallLeft } from '@elliemae/ds-icons';\nimport type { Theme } from '@elliemae/ds-system';\nimport React, { useCallback } from 'react';\nimport { TruncatedTooltipText } from '../../TruncatedTooltipText.js';\nimport { CHEVRON_BACK_DS_ID, LEFT_NAVIGATION_DATA_TESTID } from '../../constants/index.js';\nimport { ItemRenderer } from '../../exported-related/index.js';\nimport type { DSLeftNavigationT } from '../../react-desc-prop-types.js';\nimport {\n StyledBottomContainer,\n StyledChevronLeft,\n StyledItemLabel,\n StyledLeftContainer,\n StyledRightContainer,\n} from '../styled.js';\n\nconst notOpenedShadowStyle = (isSelected: boolean) => (theme: Theme) =>\n `\n box-shadow: inset 4px 0 0 0 ${isSelected ? theme.colors.brand[400] : 'transparent'};\n\n :hover {\n box-shadow: inset 4px 0 0 0 ${isSelected ? theme.colors.brand[400] : theme.colors.brand[300]};\n }\n\n :active {\n box-shadow: inset 4px 0 0 0 ${theme.colors.brand[400]};\n }\n`;\n\nexport const ItemHeader = (props: DSLeftNavigationT.ComponentProps): JSX.Element => {\n const {\n item,\n item: {\n dsId,\n itemOpts: { label, RightComponent, BottomComponent, labelDataTestId, labelOverflow: itemLabelOverflow },\n CollapsedComponent = () => null,\n },\n ctx,\n ctx: {\n leftNavProps,\n leftNavProps: { openedItem, labelOverflow: leftNavLabelOverflow, onItemClick },\n expandedForAnimation,\n setFocusedItem,\n selectedItem,\n selectedParent,\n },\n } = props;\n\n const getOwnerProps = React.useCallback(() => leftNavProps, [leftNavProps]);\n const getOwnerPropsArguments = React.useCallback(() => ({}), []);\n const labelOverflow = itemLabelOverflow || leftNavLabelOverflow;\n\n const opened = openedItem === dsId;\n\n const ariaLabel = item.itemOpts.ariaLabel ?? (typeof label === 'string' ? `${label}, category` : 'category');\n\n const isSelected = selectedItem === dsId || selectedParent === dsId;\n\n const shadowStyle = useCallback(\n (opened_: boolean) => (theme: Theme) =>\n !opened_ ? notOpenedShadowStyle(isSelected)(theme) : `box-shadow: inset 4px 0 0 0 #52A6EC`,\n [isSelected],\n );\n\n return (\n <ItemRenderer\n item={{\n ...item,\n itemOpts: {\n ariaLabel,\n ariaExpanded: opened,\n ...item.itemOpts,\n openable: expandedForAnimation && !opened,\n closable: expandedForAnimation && opened,\n selectable: !opened,\n },\n }}\n hasBorderBottom\n borderBottomMr={opened ? '12px' : '0px'}\n shadowStyle={shadowStyle}\n >\n <StyledLeftContainer\n cols={opened ? ['auto', 'auto'] : ['38px']}\n gutter=\"1px\"\n pl={opened ? 'xxs' : 0}\n justifyItems=\"center\"\n data-testid={LEFT_NAVIGATION_DATA_TESTID.LEFT_CONTAINER} // https://jira.elliemae.io/browse/PUI-15589\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {opened && (\n <StyledChevronLeft\n buttonType=\"raw\"\n onClick={(e: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>) => {\n if (onItemClick) onItemClick(item, e as React.MouseEvent<HTMLElement>);\n }}\n onFocus={(e: React.FocusEvent) => {\n e.stopPropagation();\n setFocusedItem(CHEVRON_BACK_DS_ID);\n }}\n aria-label={`Close ${ariaLabel}`}\n data-testid={LEFT_NAVIGATION_DATA_TESTID.ITEM_CHEVRON_BACK} // https://jira.elliemae.io/browse/PUI-15589\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <ChevronSmallLeft size=\"m\" color={['brand-primary', '800']} />\n </StyledChevronLeft>\n )}\n {CollapsedComponent && <CollapsedComponent item={item} ctx={ctx} />}\n </StyledLeftContainer>\n <StyledItemLabel\n ml={opened ? 'xxs' : '1px'}\n mt=\"xxxs\"\n mb=\"15px\"\n labelOverflow={labelOverflow}\n data-testid={labelDataTestId || LEFT_NAVIGATION_DATA_TESTID.ITEM_LABEL}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {labelOverflow === 'truncate' ? <TruncatedTooltipText value={label} placement=\"bottom-start\" /> : label}\n </StyledItemLabel>\n <StyledRightContainer\n pl=\"xs\"\n pr={opened ? 'xxs2' : 'xxs'}\n onFocus={(e: React.FocusEvent) => {\n setFocusedItem(null);\n e.stopPropagation();\n }}\n onKeyDown={(e: React.KeyboardEvent) => e.stopPropagation()}\n data-testid={LEFT_NAVIGATION_DATA_TESTID.RIGHT_CONTAINER} // https://jira.elliemae.io/browse/PUI-15589\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {RightComponent && <RightComponent ctx={ctx} item={item} />}\n </StyledRightContainer>\n {BottomComponent && (\n <StyledBottomContainer\n pb=\"xxxs\"\n pl=\"xxs\"\n pr=\"xxs\"\n onFocus={(e: React.FocusEvent) => {\n setFocusedItem(null);\n e.stopPropagation();\n }}\n onKeyDown={(e: React.KeyboardEvent) => e.stopPropagation()}\n data-testid={LEFT_NAVIGATION_DATA_TESTID.BOTTOM_CONTAINER} // https://jira.elliemae.io/browse/PUI-15589\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <BottomComponent ctx={ctx} item={item} />\n </StyledBottomContainer>\n )}\n </ItemRenderer>\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACoFjB,SAwBM,KAxBN;AAhFN,SAAS,wBAAwB;AAEjC,OAAOA,UAAS,mBAAmB;AACnC,SAAS,4BAA4B;AACrC,SAAS,oBAAoB,mCAAmC;AAChE,SAAS,oBAAoB;AAE7B;AAAA,EACE;AAAA,EACA;A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IAAI;AACnB,gBAAE,gBAAgB;AAAA,YACpB;AAAA,YACA,WAAW,CAAC,MAA2B,EAAE,gBAAgB;AAAA,YACzD,eAAa,4BAA4B;AAAA,YACzC;AAAA,YACA;AAAA,YAEC,4BAAkB,oBAAC,kBAAe,KAAU,MAAY;AAAA;AAAA,QAC3D;AAAA,QACC,mBACC;AAAA,UAAC;AAAA;AAAA,YACC,IAAG;AAAA,YACH,IAAG;AAAA,YACH,IAAG;AAAA,YACH,SAAS,CAAC,MAAwB;AAChC,6BAAe,IAAI;AACnB,gBAAE,gBAAgB;AAAA,YACpB;AAAA,YACA,WAAW,CAAC,MAA2B,EAAE,gBAAgB;AAAA,YACzD,eAAa,4BAA4B;AAAA,YACzC;AAAA,YACA;AAAA,YAEA,8BAAC,mBAAgB,KAAU,MAAY;AAAA;AAAA,QACzC;AAAA;AAAA;AAAA,EAEJ;AAEJ;",
6
6
  "names": ["React"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
- import { TruncatedTooltipText } from "../../TruncatedTooltipText.js";
4
3
  import React2, { useCallback } from "react";
4
+ import { TruncatedTooltipText } from "../../TruncatedTooltipText.js";
5
5
  import { LEFT_NAVIGATION_DATA_TESTID } from "../../constants/index.js";
6
6
  import { ItemRenderer } from "../../exported-related/index.js";
7
7
  import { StyledItemLabel, StyledLeftContainer, StyledRightContainer } from "../styled.js";
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/outOfTheBox/ItemLink/index.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable indent */\nimport type { Theme } from '@elliemae/ds-system';\nimport { TruncatedTooltipText } from '../../TruncatedTooltipText.js';\nimport React, { useCallback } from 'react';\nimport { LEFT_NAVIGATION_DATA_TESTID } from '../../constants/index.js';\nimport { ItemRenderer } from '../../exported-related/index.js';\nimport type { DSLeftNavigationT } from '../../react-desc-prop-types.js';\nimport { StyledItemLabel, StyledLeftContainer, StyledRightContainer } from '../styled.js';\n\nconst notOpenedShadowStyle = (isSelected: boolean) => (theme: Theme) =>\n `\n box-shadow: inset 4px 0 0 0 ${isSelected ? theme.colors.brand[400] : 'transparent'};\n\n :hover {\n box-shadow: inset 4px 0 0 0 ${isSelected ? theme.colors.brand[400] : theme.colors.brand[300]};\n }\n\n :active {\n box-shadow: inset 4px 0 0 0 ${theme.colors.brand[400]};\n }\n`;\n\nexport const ItemLink = (props: DSLeftNavigationT.ComponentProps): JSX.Element => {\n const {\n item,\n item: {\n dsId,\n itemOpts: { label, RightComponent, labelDataTestId, labelOverflow: itemLabelOverflow },\n CollapsedComponent = () => null,\n },\n ctx,\n ctx: {\n leftNavProps,\n leftNavProps: { labelOverflow: leftNavLabelOverflow },\n selectedItem,\n selectedParent,\n },\n } = props;\n\n const getOwnerProps = React.useCallback(() => leftNavProps, [leftNavProps]);\n const getOwnerPropsArguments = React.useCallback(() => ({}), []);\n const labelOverflow = itemLabelOverflow || leftNavLabelOverflow;\n\n const isSelected = selectedItem === dsId || selectedParent === dsId;\n\n const shadowStyle = useCallback(\n (opened_: boolean) => (theme: Theme) =>\n !opened_ ? notOpenedShadowStyle(isSelected)(theme) : `box-shadow: inset 4px 0 0 0 #52A6EC`,\n [isSelected],\n );\n\n return (\n <ItemRenderer\n item={{\n ...item,\n itemOpts: {\n ariaLabel: typeof label === 'string' ? label : '',\n ...item.itemOpts,\n selectable: true,\n },\n }}\n shadowStyle={shadowStyle}\n >\n <StyledLeftContainer\n cols={['38px']}\n gutter=\"1px\"\n justifyItems=\"center\"\n data-testid={LEFT_NAVIGATION_DATA_TESTID.LEFT_CONTAINER} // https://jira.elliemae.io/browse/PUI-15589\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {CollapsedComponent && <CollapsedComponent item={item} ctx={ctx} />}\n </StyledLeftContainer>\n <StyledItemLabel\n ml=\"1px\"\n mt=\"xxxs\"\n mb=\"15px\"\n labelOverflow={labelOverflow}\n data-testid={labelDataTestId || LEFT_NAVIGATION_DATA_TESTID.ITEM_LABEL}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {labelOverflow === 'truncate' ? <TruncatedTooltipText value={label} placement=\"bottom-start\" /> : label}\n </StyledItemLabel>\n <StyledRightContainer\n mt=\"xxxs\"\n pr=\"xxs2\"\n data-testid={LEFT_NAVIGATION_DATA_TESTID.RIGHT_CONTAINER} // https://jira.elliemae.io/browse/PUI-15589\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {RightComponent && <RightComponent ctx={ctx} item={item} />}\n </StyledRightContainer>\n </ItemRenderer>\n );\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACoDnB,SAmB2B,KAnB3B;AAlDJ,SAAS,4BAA4B;AACrC,OAAOA,UAAS,mBAAmB;AACnC,SAAS,mCAAmC;AAC5C,SAAS,oBAAoB;AAE7B,SAAS,iBAAiB,qBAAqB,4BAA4B;AAE3E,MAAM,uBAAuB,CAAC,eAAwB,CAAC,UACrD;AAAA,gCAC8B,aAAa,MAAM,OAAO,MAAM,GAAG,IAAI,aAAa;AAAA;AAAA;AAAA,kCAGlD,aAAa,MAAM,OAAO,MAAM,GAAG,IAAI,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA;AAAA;AAAA;AAAA,kCAI9D,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA;AAAA;AAIlD,MAAM,WAAW,CAAC,UAAyD;AAChF,QAAM;AAAA,IACJ;AAAA,IACA,MAAM;AAAA,MACJ;AAAA,MACA,UAAU,EAAE,OAAO,gBAAgB,iBAAiB,eAAe,kBAAkB;AAAA,MACrF,qBAAqB,MAAM;AAAA,IAC7B;AAAA,IACA;AAAA,IACA,KAAK;AAAA,MACH;AAAA,MACA,cAAc,EAAE,eAAe,qBAAqB;AAA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ACF;AAEJ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable indent */\nimport type { Theme } from '@elliemae/ds-system';\nimport React, { useCallback } from 'react';\nimport { TruncatedTooltipText } from '../../TruncatedTooltipText.js';\nimport { LEFT_NAVIGATION_DATA_TESTID } from '../../constants/index.js';\nimport { ItemRenderer } from '../../exported-related/index.js';\nimport type { DSLeftNavigationT } from '../../react-desc-prop-types.js';\nimport { StyledItemLabel, StyledLeftContainer, StyledRightContainer } from '../styled.js';\n\nconst notOpenedShadowStyle = (isSelected: boolean) => (theme: Theme) =>\n `\n box-shadow: inset 4px 0 0 0 ${isSelected ? theme.colors.brand[400] : 'transparent'};\n\n :hover {\n box-shadow: inset 4px 0 0 0 ${isSelected ? theme.colors.brand[400] : theme.colors.brand[300]};\n }\n\n :active {\n box-shadow: inset 4px 0 0 0 ${theme.colors.brand[400]};\n }\n`;\n\nexport const ItemLink = (props: DSLeftNavigationT.ComponentProps): JSX.Element => {\n const {\n item,\n item: {\n dsId,\n itemOpts: { label, RightComponent, labelDataTestId, labelOverflow: itemLabelOverflow },\n CollapsedComponent = () => null,\n },\n ctx,\n ctx: {\n leftNavProps,\n leftNavProps: { labelOverflow: leftNavLabelOverflow },\n selectedItem,\n selectedParent,\n },\n } = props;\n\n const getOwnerProps = React.useCallback(() => leftNavProps, [leftNavProps]);\n const getOwnerPropsArguments = React.useCallback(() => ({}), []);\n const labelOverflow = itemLabelOverflow || leftNavLabelOverflow;\n\n const isSelected = selectedItem === dsId || selectedParent === dsId;\n\n const shadowStyle = useCallback(\n (opened_: boolean) => (theme: Theme) =>\n !opened_ ? notOpenedShadowStyle(isSelected)(theme) : `box-shadow: inset 4px 0 0 0 #52A6EC`,\n [isSelected],\n );\n\n return (\n <ItemRenderer\n item={{\n ...item,\n itemOpts: {\n ariaLabel: typeof label === 'string' ? label : '',\n ...item.itemOpts,\n selectable: true,\n },\n }}\n shadowStyle={shadowStyle}\n >\n <StyledLeftContainer\n cols={['38px']}\n gutter=\"1px\"\n justifyItems=\"center\"\n data-testid={LEFT_NAVIGATION_DATA_TESTID.LEFT_CONTAINER} // https://jira.elliemae.io/browse/PUI-15589\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {CollapsedComponent && <CollapsedComponent item={item} ctx={ctx} />}\n </StyledLeftContainer>\n <StyledItemLabel\n ml=\"1px\"\n mt=\"xxxs\"\n mb=\"15px\"\n labelOverflow={labelOverflow}\n data-testid={labelDataTestId || LEFT_NAVIGATION_DATA_TESTID.ITEM_LABEL}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {labelOverflow === 'truncate' ? <TruncatedTooltipText value={label} placement=\"bottom-start\" /> : label}\n </StyledItemLabel>\n <StyledRightContainer\n mt=\"xxxs\"\n pr=\"xxs2\"\n data-testid={LEFT_NAVIGATION_DATA_TESTID.RIGHT_CONTAINER} // https://jira.elliemae.io/browse/PUI-15589\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {RightComponent && <RightComponent ctx={ctx} item={item} />}\n </StyledRightContainer>\n </ItemRenderer>\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACoDnB,SAmB2B,KAnB3B;AAlDJ,OAAOA,UAAS,mBAAmB;AACnC,SAAS,4BAA4B;AACrC,SAAS,mCAAmC;AAC5C,SAAS,oBAAoB;AAE7B,SAAS,iBAAiB,qBAAqB,4BAA4B;AAE3E,MAAM,uBAAuB,CAAC,eAAwB,CAAC,UACrD;AAAA,gCAC8B,aAAa,MAAM,OAAO,MAAM,GAAG,IAAI,aAAa;AAAA;AAAA;AAAA,kCAGlD,aAAa,MAAM,OAAO,MAAM,GAAG,IAAI,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA;AAAA;AAAA;AAAA,kCAI9D,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA;AAAA;AAIlD,MAAM,WAAW,CAAC,UAAyD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