@elliemae/ds-left-navigation 3.80.0-next.58 → 3.80.0-next.60

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 (51) hide show
  1. package/dist/cjs/exported-related/conversion-utils/conversionConstants.js +64 -0
  2. package/dist/cjs/exported-related/conversion-utils/conversionConstants.js.map +7 -0
  3. package/dist/cjs/exported-related/conversion-utils/conversionHelpers.js +192 -0
  4. package/dist/cjs/exported-related/conversion-utils/conversionHelpers.js.map +7 -0
  5. package/dist/cjs/exported-related/conversion-utils/convertItemOpts.js +187 -0
  6. package/dist/cjs/exported-related/conversion-utils/convertItemOpts.js.map +7 -0
  7. package/dist/cjs/exported-related/conversion-utils/getHumanReadableWarnings.js +37 -0
  8. package/dist/cjs/exported-related/conversion-utils/getHumanReadableWarnings.js.map +7 -0
  9. package/dist/cjs/exported-related/conversion-utils/index.js +95 -0
  10. package/dist/cjs/exported-related/conversion-utils/index.js.map +7 -0
  11. package/dist/cjs/exported-related/conversion-utils/lostCodes.js +55 -0
  12. package/dist/cjs/exported-related/conversion-utils/lostCodes.js.map +7 -0
  13. package/dist/cjs/exported-related/conversion-utils/report.js +48 -0
  14. package/dist/cjs/exported-related/conversion-utils/report.js.map +7 -0
  15. package/dist/cjs/exported-related/conversion-utils/types.js +28 -0
  16. package/dist/cjs/exported-related/conversion-utils/types.js.map +7 -0
  17. package/dist/cjs/exported-related/conversion-utils/validateIds.js +58 -0
  18. package/dist/cjs/exported-related/conversion-utils/validateIds.js.map +7 -0
  19. package/dist/cjs/index.js +2 -0
  20. package/dist/cjs/index.js.map +2 -2
  21. package/dist/esm/exported-related/conversion-utils/conversionConstants.js +34 -0
  22. package/dist/esm/exported-related/conversion-utils/conversionConstants.js.map +7 -0
  23. package/dist/esm/exported-related/conversion-utils/conversionHelpers.js +172 -0
  24. package/dist/esm/exported-related/conversion-utils/conversionHelpers.js.map +7 -0
  25. package/dist/esm/exported-related/conversion-utils/convertItemOpts.js +157 -0
  26. package/dist/esm/exported-related/conversion-utils/convertItemOpts.js.map +7 -0
  27. package/dist/esm/exported-related/conversion-utils/getHumanReadableWarnings.js +7 -0
  28. package/dist/esm/exported-related/conversion-utils/getHumanReadableWarnings.js.map +7 -0
  29. package/dist/esm/exported-related/conversion-utils/index.js +65 -0
  30. package/dist/esm/exported-related/conversion-utils/index.js.map +7 -0
  31. package/dist/esm/exported-related/conversion-utils/lostCodes.js +25 -0
  32. package/dist/esm/exported-related/conversion-utils/lostCodes.js.map +7 -0
  33. package/dist/esm/exported-related/conversion-utils/report.js +18 -0
  34. package/dist/esm/exported-related/conversion-utils/report.js.map +7 -0
  35. package/dist/esm/exported-related/conversion-utils/types.js +2 -0
  36. package/dist/esm/exported-related/conversion-utils/types.js.map +7 -0
  37. package/dist/esm/exported-related/conversion-utils/validateIds.js +28 -0
  38. package/dist/esm/exported-related/conversion-utils/validateIds.js.map +7 -0
  39. package/dist/esm/index.js +2 -0
  40. package/dist/esm/index.js.map +2 -2
  41. package/dist/types/exported-related/conversion-utils/conversionConstants.d.ts +20 -0
  42. package/dist/types/exported-related/conversion-utils/conversionHelpers.d.ts +25 -0
  43. package/dist/types/exported-related/conversion-utils/convertItemOpts.d.ts +22 -0
  44. package/dist/types/exported-related/conversion-utils/getHumanReadableWarnings.d.ts +7 -0
  45. package/dist/types/exported-related/conversion-utils/index.d.ts +12 -0
  46. package/dist/types/exported-related/conversion-utils/lostCodes.d.ts +23 -0
  47. package/dist/types/exported-related/conversion-utils/report.d.ts +3 -0
  48. package/dist/types/exported-related/conversion-utils/types.d.ts +37 -0
  49. package/dist/types/exported-related/conversion-utils/validateIds.d.ts +9 -0
  50. package/dist/types/index.d.ts +2 -0
  51. package/package.json +13 -12
@@ -0,0 +1,23 @@
1
+ /**
2
+ * 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.
3
+ */
4
+ export declare const WARNING_PER_LOST_CODE: {
5
+ readonly '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";
6
+ readonly 'custom-component-dropped': "- Encountered items with a custom \"Component\" - a treeitem cannot hold arbitrary interactive content (WCAG 4.1.2), the conversion dropped them";
7
+ readonly 'skeleton-dropped': "- Encountered skeleton items - loading states are not part of the tree, the conversion dropped them";
8
+ readonly '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";
9
+ readonly '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";
10
+ readonly '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";
11
+ readonly '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";
12
+ readonly 'body-header-dropped': "- Encountered \"BodyHeaderComponent\" - the tree shows the opened submenu as the parent of its children, the conversion ignored it";
13
+ readonly '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";
14
+ readonly '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";
15
+ readonly '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";
16
+ readonly '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\"";
17
+ readonly 'aria-overrides-dropped': "- Encountered \"ariaLabel\", \"ariaRole\", \"ariaLive\", \"ariaExpanded\" or \"ariaDescribedBy\" - the tree computes its own names and states, the conversion dropped them";
18
+ readonly '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";
19
+ readonly '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";
20
+ readonly '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";
21
+ readonly '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)";
22
+ readonly '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";
23
+ };
@@ -0,0 +1,3 @@
1
+ import type { DSLeftNavBridgeT } from './types.js';
2
+ export declare const createEmptyReport: () => DSLeftNavBridgeT.ReportMutableT;
3
+ export declare const markLost: (report: DSLeftNavBridgeT.ReportMutableT, entry: DSLeftNavBridgeT.LostEntryT) => void;
@@ -0,0 +1,37 @@
1
+ import type { DSLeftNavigationTreeT } from '@elliemae/ds-left-navigation-tree';
2
+ import type { WARNING_PER_LOST_CODE } from './lostCodes.js';
3
+ import type { DSLeftNavigationT } from '../../react-desc-prop-types.js';
4
+ export declare namespace DSLeftNavBridgeT {
5
+ /**
6
+ * Each code is something LeftNavigation could do that the tree cannot carry over.
7
+ */
8
+ type LostCodeT = keyof typeof WARNING_PER_LOST_CODE;
9
+ type LostEntryT = {
10
+ code: LostCodeT;
11
+ dsId: string;
12
+ message: string;
13
+ };
14
+ type ReportMutableT = {
15
+ detectedLostsOnConversion: Record<LostCodeT, boolean>;
16
+ lostEntries: LostEntryT[];
17
+ humanReadableWarnings: string[];
18
+ };
19
+ /**
20
+ * LeftNavigation keeps the hierarchy outside of the data: a submenu has no children in its item, the consumer swaps `items` when the submenu is opened.
21
+ * This map gives the bridge the lists the consumer swaps in, keyed by the submenu dsId.
22
+ */
23
+ type ChildrenByParentIdT = Record<string, readonly DSLeftNavigationT.GenericItemItemProps[]>;
24
+ type OptionsT = {
25
+ childrenByParentId?: ChildrenByParentIdT;
26
+ HeaderComponent?: DSLeftNavigationT.GenericItemItemProps;
27
+ BodyHeaderComponent?: DSLeftNavigationT.GenericItemItemProps;
28
+ /** The header is only a link, with nothing to open: it becomes the first item of the list instead of a disclosure. */
29
+ headerAsFirstLeaf?: boolean;
30
+ };
31
+ type ResultT = {
32
+ convertedItems: DSLeftNavigationTreeT.Item[];
33
+ convertedHeader?: DSLeftNavigationTreeT.Item;
34
+ convertedHeaderItems?: DSLeftNavigationTreeT.Item[];
35
+ report: ReportMutableT;
36
+ };
37
+ }
@@ -0,0 +1,9 @@
1
+ import type { DSLeftNavigationTreeT } from '@elliemae/ds-left-navigation-tree';
2
+ import type { DSLeftNavBridgeT } from './types.js';
3
+ type NewItemT = DSLeftNavigationTreeT.Item;
4
+ /**
5
+ * The tree finds items by `dsId` across every level of the list it receives, LeftNavigation only needed them unique inside each list it showed.
6
+ * Reports the items without one and the ids that repeat, once per repeated id.
7
+ */
8
+ export declare const reportIdProblems: (items: readonly NewItemT[], report: DSLeftNavBridgeT.ReportMutableT, extraIds?: readonly string[]) => void;
9
+ export {};
@@ -1,6 +1,8 @@
1
1
  import { LeftNavigation } from './LeftNavigation.js';
2
2
  export default LeftNavigation;
3
3
  export { CHEVRON_BACK_DS_ID, DSLeftNavigationName, DSLeftNavigationSlots, FOOTER_DS_ID, FOOTER_MENU_CLOSE_DS_ID, ITEM_TYPES, LABEL_OVERFLOW, LEFT_NAVIGATION_DATA_TESTID, LEFT_NAVIGATION_REGION_FOCUSES, LEFT_NAVIGATION_SLOTS, MAP_ITEMS_TO_SKELETON, } from './constants/index.js';
4
+ export { checkAndConvertItems } from './exported-related/conversion-utils/index.js';
5
+ export type { DSLeftNavBridgeT } from './exported-related/conversion-utils/types.js';
4
6
  export { ChevronItem, Icon, ItemRenderer, Notifications, OpenWindow } from './exported-related/index.js';
5
7
  export { LeftNavigation, LeftNavigationWithSchema } from './LeftNavigation.js';
6
8
  export { DSLeftNavigationItemPropTypesSchema, DSLeftNavigationPropTypesSchema, LeftNavItemOptionsSchema, LeftNavItemPropsSchema, type DSLeftNavigationT, } from './react-desc-prop-types.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-left-navigation",
3
- "version": "3.80.0-next.58",
3
+ "version": "3.80.0-next.60",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Left Navigation",
6
6
  "files": [
@@ -36,19 +36,20 @@
36
36
  "typeSafety": false
37
37
  },
38
38
  "dependencies": {
39
- "@elliemae/ds-button-v2": "3.80.0-next.58",
40
- "@elliemae/ds-circular-progress-indicator": "3.80.0-next.58",
41
- "@elliemae/ds-floating-context": "3.80.0-next.58",
42
- "@elliemae/ds-grid": "3.80.0-next.58",
43
- "@elliemae/ds-icons": "3.80.0-next.58",
44
- "@elliemae/ds-props-helpers": "3.80.0-next.58",
45
- "@elliemae/ds-skeleton": "3.80.0-next.58",
46
- "@elliemae/ds-system": "3.80.0-next.58"
39
+ "@elliemae/ds-button-v2": "3.80.0-next.60",
40
+ "@elliemae/ds-circular-progress-indicator": "3.80.0-next.60",
41
+ "@elliemae/ds-floating-context": "3.80.0-next.60",
42
+ "@elliemae/ds-grid": "3.80.0-next.60",
43
+ "@elliemae/ds-icons": "3.80.0-next.60",
44
+ "@elliemae/ds-left-navigation-tree": "3.80.0-next.60",
45
+ "@elliemae/ds-props-helpers": "3.80.0-next.60",
46
+ "@elliemae/ds-skeleton": "3.80.0-next.60",
47
+ "@elliemae/ds-system": "3.80.0-next.60"
47
48
  },
48
49
  "devDependencies": {
49
- "@elliemae/ds-monorepo-devops": "3.80.0-next.58",
50
- "@elliemae/ds-test-utils": "3.80.0-next.58",
51
- "@elliemae/ds-typescript-helpers": "3.80.0-next.58",
50
+ "@elliemae/ds-monorepo-devops": "3.80.0-next.60",
51
+ "@elliemae/ds-test-utils": "3.80.0-next.60",
52
+ "@elliemae/ds-typescript-helpers": "3.80.0-next.60",
52
53
  "@playwright/experimental-ct-react": "1.61.1",
53
54
  "jest": "^30.0.0",
54
55
  "styled-components": "~5.3.11"