@elliemae/ds-app-picker 3.61.11 → 3.70.0-alpha.10

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 (130) hide show
  1. package/dist/cjs/DSAppPicker.js +10 -141
  2. package/dist/cjs/DSAppPicker.js.map +3 -3
  3. package/dist/cjs/{utils.js → DSAppPickerCTX.js} +8 -25
  4. package/dist/cjs/DSAppPickerCTX.js.map +7 -0
  5. package/dist/cjs/config/useAppPicker.js +25 -8
  6. package/dist/cjs/config/useAppPicker.js.map +3 -3
  7. package/dist/cjs/config/useFocusTracker.js +104 -0
  8. package/dist/cjs/config/useFocusTracker.js.map +7 -0
  9. package/dist/cjs/config/useValidateProps.js +63 -0
  10. package/dist/cjs/config/useValidateProps.js.map +7 -0
  11. package/dist/cjs/constants/index.js +11 -1
  12. package/dist/cjs/constants/index.js.map +2 -2
  13. package/dist/cjs/index.js +8 -1
  14. package/dist/cjs/index.js.map +3 -3
  15. package/dist/cjs/parts/AppPanel.js +143 -0
  16. package/dist/cjs/parts/AppPanel.js.map +7 -0
  17. package/dist/cjs/parts/AppPickerFloatingContext/AppPickerContent.js +104 -0
  18. package/dist/cjs/parts/AppPickerFloatingContext/AppPickerContent.js.map +7 -0
  19. package/dist/cjs/parts/AppPickerFloatingContext/useAppPickerFloatingContext.js +195 -0
  20. package/dist/cjs/parts/AppPickerFloatingContext/useAppPickerFloatingContext.js.map +7 -0
  21. package/dist/cjs/parts/AppPickerItem.js +104 -0
  22. package/dist/cjs/parts/AppPickerItem.js.map +7 -0
  23. package/dist/cjs/parts/AppSection.js +95 -0
  24. package/dist/cjs/parts/AppSection.js.map +7 -0
  25. package/dist/cjs/parts/Trigger.js +83 -0
  26. package/dist/cjs/parts/Trigger.js.map +7 -0
  27. package/dist/cjs/parts/shared-styles.js +44 -0
  28. package/dist/cjs/parts/shared-styles.js.map +7 -0
  29. package/dist/cjs/react-desc-prop-types.js +28 -8
  30. package/dist/cjs/react-desc-prop-types.js.map +2 -2
  31. package/dist/cjs/typescript-testing/slot-props.js +48 -0
  32. package/dist/cjs/typescript-testing/slot-props.js.map +7 -0
  33. package/dist/cjs/typescript-testing/typescript-app-picker-valid.js +15 -2
  34. package/dist/cjs/typescript-testing/typescript-app-picker-valid.js.map +2 -2
  35. package/dist/cjs/util/getChipId.js +36 -0
  36. package/dist/cjs/util/getChipId.js.map +7 -0
  37. package/dist/cjs/util/getChipRegionId.js +37 -0
  38. package/dist/cjs/util/getChipRegionId.js.map +7 -0
  39. package/dist/cjs/util/getDSAppPickerContractProps.js +38 -0
  40. package/dist/cjs/util/getDSAppPickerContractProps.js.map +7 -0
  41. package/dist/cjs/util/instanceIds.js +42 -0
  42. package/dist/cjs/util/instanceIds.js.map +7 -0
  43. package/dist/esm/DSAppPicker.js +10 -141
  44. package/dist/esm/DSAppPicker.js.map +3 -3
  45. package/dist/esm/DSAppPickerCTX.js +8 -0
  46. package/dist/esm/DSAppPickerCTX.js.map +7 -0
  47. package/dist/esm/config/useAppPicker.js +29 -13
  48. package/dist/esm/config/useAppPicker.js.map +3 -3
  49. package/dist/esm/config/useFocusTracker.js +74 -0
  50. package/dist/esm/config/useFocusTracker.js.map +7 -0
  51. package/dist/esm/config/useValidateProps.js +33 -0
  52. package/dist/esm/config/useValidateProps.js.map +7 -0
  53. package/dist/esm/constants/index.js +11 -1
  54. package/dist/esm/constants/index.js.map +2 -2
  55. package/dist/esm/index.js +13 -1
  56. package/dist/esm/index.js.map +3 -3
  57. package/dist/esm/parts/AppPanel.js +118 -0
  58. package/dist/esm/parts/AppPanel.js.map +7 -0
  59. package/dist/esm/parts/AppPickerFloatingContext/AppPickerContent.js +74 -0
  60. package/dist/esm/parts/AppPickerFloatingContext/AppPickerContent.js.map +7 -0
  61. package/dist/esm/parts/AppPickerFloatingContext/useAppPickerFloatingContext.js +165 -0
  62. package/dist/esm/parts/AppPickerFloatingContext/useAppPickerFloatingContext.js.map +7 -0
  63. package/dist/esm/parts/AppPickerItem.js +74 -0
  64. package/dist/esm/parts/AppPickerItem.js.map +7 -0
  65. package/dist/esm/parts/AppSection.js +65 -0
  66. package/dist/esm/parts/AppSection.js.map +7 -0
  67. package/dist/esm/parts/Trigger.js +53 -0
  68. package/dist/esm/parts/Trigger.js.map +7 -0
  69. package/dist/esm/parts/shared-styles.js +14 -0
  70. package/dist/esm/parts/shared-styles.js.map +7 -0
  71. package/dist/esm/react-desc-prop-types.js +34 -9
  72. package/dist/esm/react-desc-prop-types.js.map +2 -2
  73. package/dist/esm/typescript-testing/slot-props.js +25 -0
  74. package/dist/esm/typescript-testing/slot-props.js.map +7 -0
  75. package/dist/esm/typescript-testing/typescript-app-picker-valid.js +15 -2
  76. package/dist/esm/typescript-testing/typescript-app-picker-valid.js.map +2 -2
  77. package/dist/esm/util/getChipId.js +6 -0
  78. package/dist/esm/util/getChipId.js.map +7 -0
  79. package/dist/esm/util/getChipRegionId.js +7 -0
  80. package/dist/esm/util/getChipRegionId.js.map +7 -0
  81. package/dist/esm/util/getDSAppPickerContractProps.js +8 -0
  82. package/dist/esm/util/getDSAppPickerContractProps.js.map +7 -0
  83. package/dist/esm/util/instanceIds.js +12 -0
  84. package/dist/esm/util/instanceIds.js.map +7 -0
  85. package/dist/types/DSAppPicker.d.ts +1 -2
  86. package/dist/types/DSAppPickerCTX.d.ts +6 -0
  87. package/dist/types/config/useAppPicker.d.ts +111 -92
  88. package/dist/types/config/useFocusTracker.d.ts +19 -0
  89. package/dist/types/config/useValidateProps.d.ts +3 -0
  90. package/dist/types/constants/index.d.ts +17 -7
  91. package/dist/types/index.d.ts +2 -0
  92. package/dist/types/parts/AppPanel.d.ts +2 -0
  93. package/dist/types/parts/AppPickerFloatingContext/AppPickerContent.d.ts +3 -0
  94. package/dist/types/parts/AppPickerFloatingContext/useAppPickerFloatingContext.d.ts +171 -0
  95. package/dist/types/parts/AppPickerItem.d.ts +11 -0
  96. package/dist/types/parts/AppSection.d.ts +6 -0
  97. package/dist/types/parts/Trigger.d.ts +14 -0
  98. package/dist/types/parts/shared-styles.d.ts +2 -0
  99. package/dist/types/react-desc-prop-types.d.ts +112 -9
  100. package/dist/types/util/getChipId.d.ts +2 -0
  101. package/dist/types/util/getChipRegionId.d.ts +1 -0
  102. package/dist/types/util/getDSAppPickerContractProps.d.ts +37 -0
  103. package/dist/types/util/instanceIds.d.ts +11 -0
  104. package/package.json +21 -18
  105. package/dist/cjs/AppPickerImpl.js +0 -204
  106. package/dist/cjs/AppPickerImpl.js.map +0 -7
  107. package/dist/cjs/hooks/useKeepTrackButtons.js +0 -69
  108. package/dist/cjs/hooks/useKeepTrackButtons.js.map +0 -7
  109. package/dist/cjs/styles.js +0 -76
  110. package/dist/cjs/styles.js.map +0 -7
  111. package/dist/cjs/utils.js.map +0 -7
  112. package/dist/esm/AppPickerImpl.js +0 -174
  113. package/dist/esm/AppPickerImpl.js.map +0 -7
  114. package/dist/esm/hooks/useKeepTrackButtons.js +0 -39
  115. package/dist/esm/hooks/useKeepTrackButtons.js.map +0 -7
  116. package/dist/esm/styles.js +0 -46
  117. package/dist/esm/styles.js.map +0 -7
  118. package/dist/esm/utils.js +0 -25
  119. package/dist/esm/utils.js.map +0 -7
  120. package/dist/types/AppPickerImpl.d.ts +0 -11
  121. package/dist/types/hooks/useKeepTrackButtons.d.ts +0 -13
  122. package/dist/types/styles.d.ts +0 -7
  123. package/dist/types/tests/app-picker.a11y.test.d.ts +0 -1
  124. package/dist/types/tests/app-picker.data-testid.test.d.ts +0 -1
  125. package/dist/types/tests/app-picker.events.test.d.ts +0 -1
  126. package/dist/types/tests/app-picker.exports.test.d.ts +0 -1
  127. package/dist/types/tests/app-picker.get-owner-props.test.d.ts +0 -1
  128. package/dist/types/tests/app-picker.keyboard.test.d.ts +0 -1
  129. package/dist/types/typescript-testing/typescript-app-picker-valid.d.ts +0 -1
  130. package/dist/types/utils.d.ts +0 -14
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var AppPickerItem_exports = {};
30
+ __export(AppPickerItem_exports, {
31
+ AppPickerItem: () => AppPickerItem
32
+ });
33
+ module.exports = __toCommonJS(AppPickerItem_exports);
34
+ var React = __toESM(require("react"));
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ var import_ds_chip = require("@elliemae/ds-chip");
37
+ var import_ds_system = require("@elliemae/ds-system");
38
+ var import_react = __toESM(require("react"));
39
+ var import_constants = require("../constants/index.js");
40
+ var import_DSAppPickerCTX = require("../DSAppPickerCTX.js");
41
+ var import_getChipRegionId = require("../util/getChipRegionId.js");
42
+ const StyledListItem = (0, import_ds_system.styled)("div", { name: import_constants.DSAppPickerName, slot: import_constants.DSAppPickerSlots.ITEM })`
43
+ display: flex;
44
+ `;
45
+ const StyledChip = (0, import_ds_system.styled)(import_ds_chip.DSChip, { name: import_constants.DSAppPickerName, slot: import_constants.DSAppPickerSlots.CHIP })``;
46
+ const AppIcon = ({ icon: Icon }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { className: "app-picker__icon", size: "m" });
47
+ const AppPickerItem = import_react.default.memo(
48
+ ({ app, positionAnnouncement, chipId, isFirstFocusable, isLastFocusable }) => {
49
+ const { label, disabled, applyAriaDisabled, selected, icon, id, wrapText } = app;
50
+ const {
51
+ focusTrackers: { focusRegion, firstFocusableRef, lastFocusableRef, trackFocusChip, trackFocusRegionReset },
52
+ ownerPropsConfig: { getOwnerProps }
53
+ } = (0, import_react.useContext)(import_DSAppPickerCTX.DSAppPickerContext);
54
+ const isFocused = focusRegion === (0, import_getChipRegionId.getChipRegionId)(chipId);
55
+ const getOwnerPropsArguments = import_react.default.useCallback(() => app, [app]);
56
+ const renderIcon = import_react.default.useCallback(() => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AppIcon, { icon }), [icon]);
57
+ const handleClick = import_react.default.useCallback(
58
+ (e) => {
59
+ if (app.onClick) app.onClick(e, app);
60
+ },
61
+ [app]
62
+ );
63
+ const handleFocus = import_react.default.useCallback(() => trackFocusChip(chipId), [chipId, trackFocusChip]);
64
+ const handleChipRef = import_react.default.useCallback(
65
+ (node) => {
66
+ if (isFirstFocusable) firstFocusableRef.current = node;
67
+ if (isLastFocusable) lastFocusableRef.current = node;
68
+ if (node && isFocused) node.focus();
69
+ },
70
+ [isFirstFocusable, isLastFocusable, isFocused, firstFocusableRef, lastFocusableRef]
71
+ );
72
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
73
+ StyledListItem,
74
+ {
75
+ "data-testid": import_constants.DSAppPickerDataTestIds.ITEM,
76
+ getOwnerProps,
77
+ getOwnerPropsArguments,
78
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
79
+ StyledChip,
80
+ {
81
+ onClick: handleClick,
82
+ "data-testid": import_constants.DSAppPickerDataTestIds.CHIP,
83
+ disabled,
84
+ applyAriaDisabled,
85
+ selected,
86
+ "aria-current": selected ? "true" : void 0,
87
+ "aria-label": `${label} ${positionAnnouncement}`,
88
+ id,
89
+ icon: renderIcon,
90
+ label,
91
+ getOwnerProps,
92
+ getOwnerPropsArguments,
93
+ wrapText,
94
+ innerRef: handleChipRef,
95
+ onBlur: trackFocusRegionReset,
96
+ onFocus: handleFocus
97
+ }
98
+ )
99
+ }
100
+ );
101
+ }
102
+ );
103
+ AppPickerItem.displayName = "DSAppPicker.AppPickerItem";
104
+ //# sourceMappingURL=AppPickerItem.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/parts/AppPickerItem.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { DSChip } from '@elliemae/ds-chip';\nimport { styled } from '@elliemae/ds-system';\nimport React, { useContext } from 'react';\nimport { DSAppPickerDataTestIds, DSAppPickerName, DSAppPickerSlots } from '../constants/index.js';\nimport { DSAppPickerContext } from '../DSAppPickerCTX.js';\nimport type { DSAppPickerT } from '../react-desc-prop-types.js';\nimport { getChipRegionId } from '../util/getChipRegionId.js';\n\n// Grid items stretch to their row height, but the chip inside would not follow: DSChip's root is a\n// block-level box with `height: auto` under `wrapText`, so a single-line chip stayed short next to a\n// chip whose label wrapped onto two lines (uneven tiles \u2014 PUI ticket \"Chips don't keep a consistent\n// height\"). Making this a flex container hands the stretched row height down to the chip root; the\n// chip's own button already carries `min-height: 100%`, so it fills from there.\nconst StyledListItem = styled('div', { name: DSAppPickerName, slot: DSAppPickerSlots.ITEM })`\n display: flex;\n`;\nconst StyledChip = styled(DSChip, { name: DSAppPickerName, slot: DSAppPickerSlots.CHIP })``;\n\ninterface AppIconProps {\n icon: DSAppPickerT.AppItem['icon'];\n}\n\nconst AppIcon: React.FC<AppIconProps> = ({ icon: Icon }) => <Icon className=\"app-picker__icon\" size=\"m\" />;\n\ninterface AppPickerItemProps {\n app: DSAppPickerT.AppItem;\n // Chip identity assigned by the parent (AppSection, via getChipId) and read here \u2014 never\n // generated locally, so the focus tracker can address this chip without it reporting back up.\n chipId: string;\n isFirstFocusable: boolean;\n isLastFocusable: boolean;\n positionAnnouncement: string;\n}\n\nexport const AppPickerItem: React.FC<AppPickerItemProps> = React.memo(\n ({ app, positionAnnouncement, chipId, isFirstFocusable, isLastFocusable }) => {\n const { label, disabled, applyAriaDisabled, selected, icon, id, wrapText } = app;\n const {\n focusTrackers: { focusRegion, firstFocusableRef, lastFocusableRef, trackFocusChip, trackFocusRegionReset },\n ownerPropsConfig: { getOwnerProps },\n } = useContext(DSAppPickerContext);\n\n const isFocused = focusRegion === getChipRegionId(chipId);\n\n const getOwnerPropsArguments = React.useCallback(() => app, [app]);\n const renderIcon = React.useCallback(() => <AppIcon icon={icon} />, [icon]);\n const handleClick = React.useCallback(\n (e: React.MouseEvent) => {\n if (app.onClick) app.onClick(e, app);\n },\n [app],\n );\n const handleFocus = React.useCallback(() => trackFocusChip(chipId), [chipId, trackFocusChip]);\n\n // Single ref callback: registers focus-trap edges and drives tracker-seeded focus.\n // New reference when isFocused or edge membership changes \u2014 React re-invokes with the DOM node.\n const handleChipRef = React.useCallback(\n (node: HTMLElement | null) => {\n if (isFirstFocusable) firstFocusableRef.current = node;\n if (isLastFocusable) lastFocusableRef.current = node;\n if (node && isFocused) node.focus();\n },\n [isFirstFocusable, isLastFocusable, isFocused, firstFocusableRef, lastFocusableRef],\n );\n\n return (\n <StyledListItem\n data-testid={DSAppPickerDataTestIds.ITEM}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledChip\n onClick={handleClick}\n data-testid={DSAppPickerDataTestIds.CHIP}\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled}\n selected={selected}\n // Only the consumer knows what \"selected\" means in context (current item, toggled, or option in a listbox).\n // AppPicker is both a consumer and consumed, it owes the programmatic state.\n // `true` rather than `page`:\n // `page` claims a set of pages,\n // AppPicker cannot know whether a tile is an anchor, a route push, or an in-place context switch.\n // A consumer who does know can upgrade the token through the CHIP slot (`dsApppickerChip`), which overrides anything set here.\n // Omitted when unselected \u2014 `false` is the default and is not exposed either way.\n aria-current={selected ? 'true' : undefined}\n // discussed with Juan (A11y SME), the position announcement is best kept to give \"aria-current\" the meaing of \"current within a set\"\n // it's not strictly required, but given both apps and customApps are part of the same \"set\" and there is no other semantic tie between the individual chips\n // announcing X of Y gives a reasonable context to the user that they are navigating a set of items, and not just a single item even with the button role.\n // with this X of Y announcement we can also keep the two `role=\"group\"` sections for apps and customApps separate,\n // improving the announcement experience as they don't get bombarded with the section title every focus on a button, but only when they first enter the section.\n aria-label={`${label} ${positionAnnouncement}`}\n id={id}\n icon={renderIcon}\n label={label}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n wrapText={wrapText}\n innerRef={handleChipRef}\n onBlur={trackFocusRegionReset}\n onFocus={handleFocus}\n />\n </StyledListItem>\n );\n },\n);\n\nAppPickerItem.displayName = 'DSAppPicker.AppPickerItem';\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADsBqC;AAtB5D,qBAAuB;AACvB,uBAAuB;AACvB,mBAAkC;AAClC,uBAA0E;AAC1E,4BAAmC;AAEnC,6BAAgC;AAOhC,MAAM,qBAAiB,yBAAO,OAAO,EAAE,MAAM,kCAAiB,MAAM,kCAAiB,KAAK,CAAC;AAAA;AAAA;AAG3F,MAAM,iBAAa,yBAAO,uBAAQ,EAAE,MAAM,kCAAiB,MAAM,kCAAiB,KAAK,CAAC;AAMxF,MAAM,UAAkC,CAAC,EAAE,MAAM,KAAK,MAAM,4CAAC,QAAK,WAAU,oBAAmB,MAAK,KAAI;AAYjG,MAAM,gBAA8C,aAAAA,QAAM;AAAA,EAC/D,CAAC,EAAE,KAAK,sBAAsB,QAAQ,kBAAkB,gBAAgB,MAAM;AAC5E,UAAM,EAAE,OAAO,UAAU,mBAAmB,UAAU,MAAM,IAAI,SAAS,IAAI;AAC7E,UAAM;AAAA,MACJ,eAAe,EAAE,aAAa,mBAAmB,kBAAkB,gBAAgB,sBAAsB;AAAA,MACzG,kBAAkB,EAAE,cAAc;AAAA,IACpC,QAAI,yBAAW,wCAAkB;AAEjC,UAAM,YAAY,oBAAgB,wCAAgB,MAAM;AAExD,UAAM,yBAAyB,aAAAA,QAAM,YAAY,MAAM,KAAK,CAAC,GAAG,CAAC;AACjE,UAAM,aAAa,aAAAA,QAAM,YAAY,MAAM,4CAAC,WAAQ,MAAY,GAAI,CAAC,IAAI,CAAC;AAC1E,UAAM,cAAc,aAAAA,QAAM;AAAA,MACxB,CAAC,MAAwB;AACvB,YAAI,IAAI,QAAS,KAAI,QAAQ,GAAG,GAAG;AAAA,MACrC;AAAA,MACA,CAAC,GAAG;AAAA,IACN;AACA,UAAM,cAAc,aAAAA,QAAM,YAAY,MAAM,eAAe,MAAM,GAAG,CAAC,QAAQ,cAAc,CAAC;AAI5F,UAAM,gBAAgB,aAAAA,QAAM;AAAA,MAC1B,CAAC,SAA6B;AAC5B,YAAI,iBAAkB,mBAAkB,UAAU;AAClD,YAAI,gBAAiB,kBAAiB,UAAU;AAChD,YAAI,QAAQ,UAAW,MAAK,MAAM;AAAA,MACpC;AAAA,MACA,CAAC,kBAAkB,iBAAiB,WAAW,mBAAmB,gBAAgB;AAAA,IACpF;AAEA,WACE;AAAA,MAAC;AAAA;AAAA,QACC,eAAa,wCAAuB;AAAA,QACpC;AAAA,QACA;AAAA,QAEA;AAAA,UAAC;AAAA;AAAA,YACC,SAAS;AAAA,YACT,eAAa,wCAAuB;AAAA,YACpC;AAAA,YACA;AAAA,YACA;AAAA,YAQA,gBAAc,WAAW,SAAS;AAAA,YAMlC,cAAY,GAAG,KAAK,IAAI,oBAAoB;AAAA,YAC5C;AAAA,YACA,MAAM;AAAA,YACN;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA,UAAU;AAAA,YACV,QAAQ;AAAA,YACR,SAAS;AAAA;AAAA,QACX;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,cAAc,cAAc;",
6
+ "names": ["React"]
7
+ }
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var AppSection_exports = {};
30
+ __export(AppSection_exports, {
31
+ AppSection: () => AppSection
32
+ });
33
+ module.exports = __toCommonJS(AppSection_exports);
34
+ var React = __toESM(require("react"));
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ var import_ds_system = require("@elliemae/ds-system");
37
+ var import_ds_typography = require("@elliemae/ds-typography");
38
+ var import_react = require("react");
39
+ var import_constants = require("../constants/index.js");
40
+ var import_DSAppPickerCTX = require("../DSAppPickerCTX.js");
41
+ var import_getChipId = require("../util/getChipId.js");
42
+ var import_instanceIds = require("../util/instanceIds.js");
43
+ var import_AppPickerItem = require("./AppPickerItem.js");
44
+ var import_shared_styles = require("./shared-styles.js");
45
+ const StyledTitle = (0, import_ds_system.styled)(import_ds_typography.DSTypography, { name: import_constants.DSAppPickerName, slot: import_constants.DSAppPickerSlots.TITLE })`
46
+ color: ${({ theme }) => theme.colors.neutral[700]};
47
+ font-size: ${({ theme }) => theme.fontSizes.value[400]};
48
+ font-weight: ${({ theme }) => theme.fontWeights.semibold};
49
+ margin: 12px 0 8px 0;
50
+ line-height: 1.385;
51
+ text-transform: uppercase;
52
+ text-align: center;
53
+ `;
54
+ const AppSection = ({ isCustomApps = false }) => {
55
+ const {
56
+ propsWithDefault: { apps, customApps, sectionTitle, customSectionTitle },
57
+ instanceUid,
58
+ focusTrackers: { firstFocusableIdx, lastFocusableIdx },
59
+ ownerPropsConfig
60
+ } = (0, import_react.useContext)(import_DSAppPickerCTX.DSAppPickerContext);
61
+ const items = isCustomApps ? customApps : apps;
62
+ const titleId = isCustomApps ? (0, import_instanceIds.getIdForAppPickerCustomSectionTitle)(instanceUid) : (0, import_instanceIds.getIdForAppPickerSectionTitle)(instanceUid);
63
+ const title = isCustomApps ? customSectionTitle : sectionTitle;
64
+ const totalCount = (apps?.length ?? 0) + (customApps?.length ?? 0);
65
+ const initialPositionOffset = isCustomApps ? apps.length : 0;
66
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
67
+ import_shared_styles.StyledSection,
68
+ {
69
+ "data-testid": import_constants.DSAppPickerDataTestIds.GROUP,
70
+ role: "group",
71
+ "aria-labelledby": titleId,
72
+ ...ownerPropsConfig,
73
+ children: [
74
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_shared_styles.StyledListItemFullRow, { "data-testid": import_constants.DSAppPickerDataTestIds.ROW, ...ownerPropsConfig, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledTitle, { "data-testid": import_constants.DSAppPickerDataTestIds.TITLE, id: titleId, variant: "h3-strong", ...ownerPropsConfig, children: title }) }),
75
+ items.map((app, index) => {
76
+ const flatIndex = initialPositionOffset + index;
77
+ const positionAnnouncement = `${flatIndex + 1} of ${totalCount}`;
78
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
79
+ import_AppPickerItem.AppPickerItem,
80
+ {
81
+ positionAnnouncement,
82
+ app,
83
+ chipId: (0, import_getChipId.getChipId)(app, flatIndex),
84
+ isFirstFocusable: flatIndex === firstFocusableIdx,
85
+ isLastFocusable: flatIndex === lastFocusableIdx
86
+ },
87
+ app.id ?? `${app.label}-${isCustomApps ? "custom" : "main"}-${index}`
88
+ );
89
+ })
90
+ ]
91
+ }
92
+ );
93
+ };
94
+ AppSection.displayName = "DSAppPicker.AppSection";
95
+ //# sourceMappingURL=AppSection.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/parts/AppSection.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { styled } from '@elliemae/ds-system';\nimport { DSTypography } from '@elliemae/ds-typography';\nimport React, { useContext } from 'react';\nimport { DSAppPickerDataTestIds, DSAppPickerName, DSAppPickerSlots } from '../constants/index.js';\nimport { DSAppPickerContext } from '../DSAppPickerCTX.js';\nimport { getChipId } from '../util/getChipId.js';\nimport { getIdForAppPickerCustomSectionTitle, getIdForAppPickerSectionTitle } from '../util/instanceIds.js';\nimport { AppPickerItem } from './AppPickerItem.js';\nimport { StyledListItemFullRow, StyledSection } from './shared-styles.js';\n\nconst StyledTitle = styled(DSTypography, { name: DSAppPickerName, slot: DSAppPickerSlots.TITLE })`\n color: ${({ theme }) => theme.colors.neutral[700]};\n font-size: ${({ theme }) => theme.fontSizes.value[400]};\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n margin: 12px 0 8px 0;\n line-height: 1.385;\n text-transform: uppercase;\n text-align: center;\n`;\n\ninterface AppSectionProps {\n isCustomApps?: boolean;\n}\n\nexport const AppSection: React.FC<AppSectionProps> = ({ isCustomApps = false }) => {\n const {\n propsWithDefault: { apps, customApps, sectionTitle, customSectionTitle },\n instanceUid,\n focusTrackers: { firstFocusableIdx, lastFocusableIdx },\n ownerPropsConfig,\n } = useContext(DSAppPickerContext);\n\n const items = isCustomApps ? customApps : apps;\n // Suffixes owned by util/instanceIds \u2014 see that module for why they are never composed inline.\n const titleId = isCustomApps\n ? getIdForAppPickerCustomSectionTitle(instanceUid)\n : getIdForAppPickerSectionTitle(instanceUid);\n const title = isCustomApps ? customSectionTitle : sectionTitle;\n\n const totalCount = (apps?.length ?? 0) + (customApps?.length ?? 0);\n const initialPositionOffset = isCustomApps ? apps.length : 0;\n return (\n <StyledSection\n data-testid={DSAppPickerDataTestIds.GROUP}\n role=\"group\"\n aria-labelledby={titleId}\n {...ownerPropsConfig}\n >\n <StyledListItemFullRow data-testid={DSAppPickerDataTestIds.ROW} {...ownerPropsConfig}>\n <StyledTitle data-testid={DSAppPickerDataTestIds.TITLE} id={titleId} variant=\"h3-strong\" {...ownerPropsConfig}>\n {title}\n </StyledTitle>\n </StyledListItemFullRow>\n {items.map((app, index) => {\n const flatIndex = initialPositionOffset + index;\n const positionAnnouncement = `${flatIndex + 1} of ${totalCount}`;\n return (\n <AppPickerItem\n key={app.id ?? `${app.label}-${isCustomApps ? 'custom' : 'main'}-${index}`}\n positionAnnouncement={positionAnnouncement}\n app={app}\n chipId={getChipId(app, flatIndex)}\n isFirstFocusable={flatIndex === firstFocusableIdx}\n isLastFocusable={flatIndex === lastFocusableIdx}\n />\n );\n })}\n </StyledSection>\n );\n};\n\nAppSection.displayName = 'DSAppPicker.AppSection';\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD0CnB;AA1CJ,uBAAuB;AACvB,2BAA6B;AAC7B,mBAAkC;AAClC,uBAA0E;AAC1E,4BAAmC;AACnC,uBAA0B;AAC1B,yBAAmF;AACnF,2BAA8B;AAC9B,2BAAqD;AAErD,MAAM,kBAAc,yBAAO,mCAAc,EAAE,MAAM,kCAAiB,MAAM,kCAAiB,MAAM,CAAC;AAAA,WACrF,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA,eACpC,CAAC,EAAE,MAAM,MAAM,MAAM,UAAU,MAAM,GAAG,CAAC;AAAA,iBACvC,CAAC,EAAE,MAAM,MAAM,MAAM,YAAY,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAWnD,MAAM,aAAwC,CAAC,EAAE,eAAe,MAAM,MAAM;AACjF,QAAM;AAAA,IACJ,kBAAkB,EAAE,MAAM,YAAY,cAAc,mBAAmB;AAAA,IACvE;AAAA,IACA,eAAe,EAAE,mBAAmB,iBAAiB;AAAA,IACrD;AAAA,EACF,QAAI,yBAAW,wCAAkB;AAEjC,QAAM,QAAQ,eAAe,aAAa;AAE1C,QAAM,UAAU,mBACZ,wDAAoC,WAAW,QAC/C,kDAA8B,WAAW;AAC7C,QAAM,QAAQ,eAAe,qBAAqB;AAElD,QAAM,cAAc,MAAM,UAAU,MAAM,YAAY,UAAU;AAChE,QAAM,wBAAwB,eAAe,KAAK,SAAS;AAC3D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAa,wCAAuB;AAAA,MACpC,MAAK;AAAA,MACL,mBAAiB;AAAA,MAChB,GAAG;AAAA,MAEJ;AAAA,oDAAC,8CAAsB,eAAa,wCAAuB,KAAM,GAAG,kBAClE,sDAAC,eAAY,eAAa,wCAAuB,OAAO,IAAI,SAAS,SAAQ,aAAa,GAAG,kBAC1F,iBACH,GACF;AAAA,QACC,MAAM,IAAI,CAAC,KAAK,UAAU;AACzB,gBAAM,YAAY,wBAAwB;AAC1C,gBAAM,uBAAuB,GAAG,YAAY,CAAC,OAAO,UAAU;AAC9D,iBACE;AAAA,YAAC;AAAA;AAAA,cAEC;AAAA,cACA;AAAA,cACA,YAAQ,4BAAU,KAAK,SAAS;AAAA,cAChC,kBAAkB,cAAc;AAAA,cAChC,iBAAiB,cAAc;AAAA;AAAA,YAL1B,IAAI,MAAM,GAAG,IAAI,KAAK,IAAI,eAAe,WAAW,MAAM,IAAI,KAAK;AAAA,UAM1E;AAAA,QAEJ,CAAC;AAAA;AAAA;AAAA,EACH;AAEJ;AAEA,WAAW,cAAc;",
6
+ "names": []
7
+ }
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var Trigger_exports = {};
30
+ __export(Trigger_exports, {
31
+ Trigger: () => Trigger
32
+ });
33
+ module.exports = __toCommonJS(Trigger_exports);
34
+ var React = __toESM(require("react"));
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ var import_ds_button_v2 = require("@elliemae/ds-button-v2");
37
+ var import_ds_system = require("@elliemae/ds-system");
38
+ var import_react = require("react");
39
+ var import_constants = require("../constants/index.js");
40
+ var import_DSAppPickerCTX = require("../DSAppPickerCTX.js");
41
+ const StyledButton = (0, import_ds_system.styled)(import_ds_button_v2.DSButtonV3, { name: import_constants.DSAppPickerName, slot: import_constants.DSAppPickerSlots.BUTTON })`
42
+ height: fit-content;
43
+ `;
44
+ const Trigger = (PropsFromFloatingContext) => {
45
+ const { handleTriggerRef, handleTriggerClick, handleTriggerKeyDown, dialogLabelId } = PropsFromFloatingContext;
46
+ const {
47
+ propsWithDefault: { icon: Icon, renderTrigger, TriggerComponent },
48
+ ownerPropsConfig
49
+ } = (0, import_react.useContext)(import_DSAppPickerCTX.DSAppPickerContext);
50
+ if (TriggerComponent) {
51
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
52
+ TriggerComponent,
53
+ {
54
+ innerRef: handleTriggerRef,
55
+ id: dialogLabelId,
56
+ onClick: handleTriggerClick,
57
+ onKeyDown: handleTriggerKeyDown,
58
+ "aria-haspopup": "dialog"
59
+ }
60
+ );
61
+ }
62
+ if (renderTrigger) {
63
+ return renderTrigger({ ref: handleTriggerRef });
64
+ }
65
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
66
+ StyledButton,
67
+ {
68
+ "data-testid": import_constants.DSAppPickerDataTestIds.BUTTON,
69
+ id: dialogLabelId,
70
+ buttonType: "icon",
71
+ "aria-haspopup": "dialog",
72
+ "aria-label": "Application picker",
73
+ innerRef: handleTriggerRef,
74
+ onClick: handleTriggerClick,
75
+ onKeyDown: handleTriggerKeyDown,
76
+ getOwnerProps: ownerPropsConfig.getOwnerProps,
77
+ getOwnerPropsArguments: ownerPropsConfig.getOwnerPropsArguments,
78
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, {})
79
+ }
80
+ );
81
+ };
82
+ Trigger.displayName = "DSAppPicker.Trigger";
83
+ //# sourceMappingURL=Trigger.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/parts/Trigger.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { DSButtonV3 } from '@elliemae/ds-button-v2';\nimport { styled } from '@elliemae/ds-system';\nimport React, { useContext } from 'react';\nimport { DSAppPickerDataTestIds, DSAppPickerName, DSAppPickerSlots } from '../constants/index.js';\nimport { DSAppPickerContext } from '../DSAppPickerCTX.js';\nimport type { useAppPickerFloatingContext } from './AppPickerFloatingContext/useAppPickerFloatingContext.js';\n\n// DSButtonV3 sizes itself with `min-height` (height stays `auto`) so multi-line labels can grow.\n// As a side effect, when the trigger is a direct grid/flex child of a consumer layout with the\n// default `align-items: stretch`, it stretches to fill the container height (PUI-18354 regression:\n// the legacy DSButtonV2 trigger used a fixed `height` and did not stretch). `height: fit-content`\n// pins the trigger to its intrinsic size \u2014 mirroring the button's own `width: fit-content` \u2014 so it\n// stays ~28px regardless of layout context.\nconst StyledButton = styled(DSButtonV3, { name: DSAppPickerName, slot: DSAppPickerSlots.BUTTON })`\n height: fit-content;\n`;\n\ntype UseAppPickerFloatingContextT = ReturnType<typeof useAppPickerFloatingContext>;\ntype FloatingContextDictatedProps = {\n handleTriggerRef: UseAppPickerFloatingContextT['handleTriggerRef'];\n handleTriggerClick: UseAppPickerFloatingContextT['handleTriggerClick'];\n handleTriggerKeyDown: UseAppPickerFloatingContextT['handleTriggerKeyDown'];\n dialogLabelId: string;\n};\n\nexport const Trigger = (PropsFromFloatingContext: FloatingContextDictatedProps) => {\n const { handleTriggerRef, handleTriggerClick, handleTriggerKeyDown, dialogLabelId } = PropsFromFloatingContext;\n const {\n propsWithDefault: { icon: Icon, renderTrigger, TriggerComponent },\n ownerPropsConfig,\n } = useContext(DSAppPickerContext);\n\n // Precedence: TriggerComponent > renderTrigger > the built-in button. TriggerComponent wins when\n // both custom APIs are supplied \u2014 it is the one that receives `dialogLabelId`, so preferring\n // renderTrigger here would drop the dialog's accessible name.\n if (TriggerComponent) {\n return (\n <TriggerComponent\n innerRef={handleTriggerRef}\n id={dialogLabelId}\n onClick={handleTriggerClick}\n onKeyDown={handleTriggerKeyDown}\n aria-haspopup=\"dialog\"\n />\n );\n }\n\n if (renderTrigger) {\n // DEPRECATED (v4.x) \u2014 see DEV-002. Plain function call (not a React element) preserves the\n // legacy DSPopover render-prop contract: consumers receive `ref` as a regular prop, no\n // forwardRef required. The contract has no channel for `dialogLabelId`, so on this path naming\n // the dialog is the consumer's: put an id on the trigger element and inject the matching\n // aria-labelledby through the FLOATING_WRAPPER slot (or pass `id` to DSAppPicker, which makes\n // the generated id predictable). Covered by DSAppPicker.renderTrigger-ioc-aria-labelledby.test.js.\n return renderTrigger({ ref: handleTriggerRef });\n }\n return (\n <StyledButton\n data-testid={DSAppPickerDataTestIds.BUTTON}\n id={dialogLabelId}\n buttonType=\"icon\"\n aria-haspopup=\"dialog\"\n aria-label=\"Application picker\"\n innerRef={handleTriggerRef}\n onClick={handleTriggerClick}\n onKeyDown={handleTriggerKeyDown}\n getOwnerProps={ownerPropsConfig.getOwnerProps}\n getOwnerPropsArguments={ownerPropsConfig.getOwnerPropsArguments}\n >\n <Icon />\n </StyledButton>\n );\n};\n\nTrigger.displayName = 'DSAppPicker.Trigger';\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADqCjB;AArCN,0BAA2B;AAC3B,uBAAuB;AACvB,mBAAkC;AAClC,uBAA0E;AAC1E,4BAAmC;AASnC,MAAM,mBAAe,yBAAO,gCAAY,EAAE,MAAM,kCAAiB,MAAM,kCAAiB,OAAO,CAAC;AAAA;AAAA;AAYzF,MAAM,UAAU,CAAC,6BAA2D;AACjF,QAAM,EAAE,kBAAkB,oBAAoB,sBAAsB,cAAc,IAAI;AACtF,QAAM;AAAA,IACJ,kBAAkB,EAAE,MAAM,MAAM,eAAe,iBAAiB;AAAA,IAChE;AAAA,EACF,QAAI,yBAAW,wCAAkB;AAKjC,MAAI,kBAAkB;AACpB,WACE;AAAA,MAAC;AAAA;AAAA,QACC,UAAU;AAAA,QACV,IAAI;AAAA,QACJ,SAAS;AAAA,QACT,WAAW;AAAA,QACX,iBAAc;AAAA;AAAA,IAChB;AAAA,EAEJ;AAEA,MAAI,eAAe;AAOjB,WAAO,cAAc,EAAE,KAAK,iBAAiB,CAAC;AAAA,EAChD;AACA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAa,wCAAuB;AAAA,MACpC,IAAI;AAAA,MACJ,YAAW;AAAA,MACX,iBAAc;AAAA,MACd,cAAW;AAAA,MACX,UAAU;AAAA,MACV,SAAS;AAAA,MACT,WAAW;AAAA,MACX,eAAe,iBAAiB;AAAA,MAChC,wBAAwB,iBAAiB;AAAA,MAEzC,sDAAC,QAAK;AAAA;AAAA,EACR;AAEJ;AAEA,QAAQ,cAAc;",
6
+ "names": []
7
+ }
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var shared_styles_exports = {};
30
+ __export(shared_styles_exports, {
31
+ StyledListItemFullRow: () => StyledListItemFullRow,
32
+ StyledSection: () => StyledSection
33
+ });
34
+ module.exports = __toCommonJS(shared_styles_exports);
35
+ var React = __toESM(require("react"));
36
+ var import_ds_system = require("@elliemae/ds-system");
37
+ var import_constants = require("../constants/index.js");
38
+ const StyledListItemFullRow = (0, import_ds_system.styled)("div", { name: import_constants.DSAppPickerName, slot: import_constants.DSAppPickerSlots.ROW })`
39
+ grid-column: 1/4;
40
+ `;
41
+ const StyledSection = (0, import_ds_system.styled)("div", { name: import_constants.DSAppPickerName, slot: import_constants.DSAppPickerSlots.GROUP })`
42
+ display: contents;
43
+ `;
44
+ //# sourceMappingURL=shared-styles.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/parts/shared-styles.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["/* eslint-disable @typescript-eslint/no-unsafe-assignment */\nimport { styled } from '@elliemae/ds-system';\nimport { DSAppPickerName, DSAppPickerSlots } from '../constants/index.js';\n\nexport const StyledListItemFullRow = styled('div', { name: DSAppPickerName, slot: DSAppPickerSlots.ROW })`\n grid-column: 1/4;\n`;\n\n// The ARIA group that associates a section title with the chips belonging to it (role=\"group\" +\n// aria-labelledby \u2192 the title's id). It must NOT become a grid item: the panel root owns the\n// 3-column track and the title row / chips are its children. `display: contents` keeps this\n// element out of the layout while leaving it in the accessibility tree, so the grid is unchanged.\nexport const StyledSection = styled('div', { name: DSAppPickerName, slot: DSAppPickerSlots.GROUP })`\n display: contents;\n`;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,uBAAuB;AACvB,uBAAkD;AAE3C,MAAM,4BAAwB,yBAAO,OAAO,EAAE,MAAM,kCAAiB,MAAM,kCAAiB,IAAI,CAAC;AAAA;AAAA;AAQjG,MAAM,oBAAgB,yBAAO,OAAO,EAAE,MAAM,kCAAiB,MAAM,kCAAiB,MAAM,CAAC;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -29,6 +29,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
29
29
  var react_desc_prop_types_exports = {};
30
30
  __export(react_desc_prop_types_exports, {
31
31
  DSAppPickerPropTypes: () => DSAppPickerPropTypes,
32
+ DSAppPickerPropTypesSchema: () => DSAppPickerPropTypesSchema,
32
33
  defaultProps: () => defaultProps
33
34
  });
34
35
  module.exports = __toCommonJS(react_desc_prop_types_exports);
@@ -38,30 +39,48 @@ var import_ds_icons = require("@elliemae/ds-icons");
38
39
  var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
39
40
  var import_constants = require("./constants/index.js");
40
41
  const defaultProps = {
41
- // export const defaultProps: DSAppPickerT.DefaultProps = {
42
42
  apps: [],
43
43
  customApps: [],
44
44
  sectionTitle: "APPLICATIONS",
45
45
  customSectionTitle: "CUSTOM APPLICATIONS",
46
- icon: () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_icons.MenuPicker, { color: ["brand-primary", "700"], size: "m" })
46
+ icon: () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_icons.MenuPicker, { color: ["brand-primary", "700"], size: "m" }),
47
+ openAndFocusOnArrowKeys: false
47
48
  };
48
49
  const DSAppPickerPropTypes = {
49
50
  ...(0, import_ds_props_helpers.getPropsPerSlotPropTypes)(import_constants.DSAppPickerName, import_constants.DSAppPickerSlots),
51
+ ...import_ds_props_helpers.globalAttributesPropTypes,
52
+ ...import_ds_props_helpers.xstyledPropTypes,
50
53
  apps: import_ds_props_helpers.PropTypes.array.description(
51
- "Main items. Format: [{ label:string, icon:component, onClick:func, disabled:bool, selected:bool }]"
52
- ).isRequired,
54
+ 'Main items. Format: [{ label:string, icon:component, onClick:func, disabled:bool, selected:bool }]. Conditionally required: at least one of "apps" or "customApps" must contain items \u2014 a picker with nothing to pick has no purpose, so providing both empty throws.'
55
+ ).defaultValue([]),
53
56
  customApps: import_ds_props_helpers.PropTypes.array.description(
54
- "Custom items. Format: [{ label:string, icon:component, onClick:func, disabled:bool, selected:bool }]"
55
- ),
57
+ 'Custom items. Format: [{ label:string, icon:component, onClick:func, disabled:bool, selected:bool }]. Conditionally required: at least one of "apps" or "customApps" must contain items \u2014 a picker with nothing to pick has no purpose, so providing both empty throws.'
58
+ ).defaultValue([]),
56
59
  sectionTitle: import_ds_props_helpers.PropTypes.string.description("main section title").defaultValue("APPLICATIONS"),
57
60
  customSectionTitle: import_ds_props_helpers.PropTypes.string.description("custom section title").defaultValue("CUSTOM APPLICATIONS"),
58
61
  icon: import_ds_props_helpers.PropTypes.func.description("trigger button s icon").defaultValue(import_ds_icons.MenuPicker),
59
- renderTrigger: import_ds_props_helpers.PropTypes.func.description("Custom trigger component."),
62
+ openAndFocusOnArrowKeys: import_ds_props_helpers.PropTypes.bool.description(
63
+ "Opt in to arrow-key opening on the trigger. ArrowDown opens and focuses the selected application, falling back to the first available one; ArrowUp opens and focuses the selected application, falling back to the last available one. The picker owns the whole flow \u2014 no key handler, no isOpen wiring and no actionRef needed. Independent of actionRef, which remains the imperative handle for moving focus from your own logic."
64
+ ).defaultValue(false),
65
+ renderTrigger: import_ds_props_helpers.PropTypes.func.description(
66
+ "Custom trigger, called as a plain function with { ref }. Superseded by TriggerComponent: this render-prop cannot receive the id that the panel's aria-labelledby points at, so the dialog is left without an accessible name. TriggerComponent takes precedence when both are supplied."
67
+ ).deprecated({
68
+ version: "4.x",
69
+ message: 'Use "TriggerComponent" instead \u2014 it receives the id required for the dialog accessible name.'
70
+ }),
71
+ TriggerComponent: import_ds_props_helpers.PropTypes.func.description(
72
+ "Custom trigger rendered as a React element. Receives { innerRef, id, onClick, aria-haspopup }; the id must be applied to the focusable trigger element for the panel to have an accessible name. Takes precedence over the deprecated renderTrigger when both are supplied."
73
+ ),
60
74
  actionRef: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.func, import_ds_props_helpers.PropTypes.shape({ current: import_ds_props_helpers.PropTypes.any })]).description(
61
75
  "Ref containing a focusToIndex method. This method allows you to focus any App inside the AppPicker."
62
76
  ),
63
77
  isOpen: import_ds_props_helpers.PropTypes.bool.description("Wether the AppPicker should be open or not."),
64
- onClose: import_ds_props_helpers.PropTypes.func.description("Callback function when the AppPicker closes"),
78
+ onOpen: import_ds_props_helpers.PropTypes.func.description(
79
+ 'Callback when the AppPicker opens; receives { reason: "trigger" | "controlled", event? }.'
80
+ ),
81
+ onClose: import_ds_props_helpers.PropTypes.func.description(
82
+ 'Callback when the AppPicker closes; receives { reason: "escape" | "click-outside" | "trigger-toggle" | "controlled", event? }.'
83
+ ),
65
84
  onKeyDown: import_ds_props_helpers.PropTypes.func.description("OnKeyDown handler callback."),
66
85
  onClick: import_ds_props_helpers.PropTypes.func.description("Custom onClick for Trigger component."),
67
86
  onClickOutside: import_ds_props_helpers.PropTypes.func.description("Callback event when the user clicks outside the App Picker."),
@@ -69,4 +88,5 @@ const DSAppPickerPropTypes = {
69
88
  "Ref to the trigger button."
70
89
  )
71
90
  };
91
+ const DSAppPickerPropTypesSchema = DSAppPickerPropTypes;
72
92
  //# sourceMappingURL=react-desc-prop-types.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/react-desc-prop-types.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import React from 'react';\nimport { MenuPicker } from '@elliemae/ds-icons';\nimport type { SvgIconT } from '@elliemae/ds-icons';\nimport type { GlobalAttributesT, XstyledProps, ValidationMap } from '@elliemae/ds-props-helpers';\nimport { PropTypes, getPropsPerSlotPropTypes } from '@elliemae/ds-props-helpers';\nimport type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport { DSAppPickerName, DSAppPickerSlots } from './constants/index.js';\n\nexport declare namespace DSAppPickerT {\n export interface AppItem {\n label: string;\n icon: React.ComponentType<{ className: string; size: string }>;\n onClick?: (e: React.MouseEvent, item: AppItem) => void | null;\n disabled?: boolean;\n applyAriaDisabled?: boolean;\n id?: string;\n selected?: boolean;\n wrapText?: boolean;\n }\n\n export type ActionRef = React.MutableRefObject<{\n focusToIndex?: (index: number) => void;\n focusSelectedOrFirstAvailable?: () => void;\n focusWrapper: () => void;\n }>;\n\n export interface DefaultProps {\n apps: AppItem[];\n customApps: AppItem[];\n sectionTitle: string;\n customSectionTitle: string;\n icon: React.ComponentType<SvgIconT.Props>;\n }\n\n interface RenderTriggerProp {\n ref: React.MutableRefObject<HTMLButtonElement>;\n [key: string]: unknown;\n }\n export interface OptionalProps\n extends TypescriptHelpersT.PropsForGlobalOnSlots<typeof DSAppPickerName, typeof DSAppPickerSlots> {\n onClose?: () => void;\n onClick?: (e: React.MouseEvent | React.KeyboardEvent) => void;\n onClickOutside?: (e: React.MouseEvent) => void;\n onKeyDown?: (e: React.KeyboardEvent) => void;\n actionRef?: ActionRef;\n renderTrigger?: React.ComponentType<RenderTriggerProp>;\n isOpen?: boolean;\n triggerRef?: React.RefObject<HTMLButtonElement>;\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>,\n XstyledProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>,\n XstyledProps {}\n}\n\nexport const defaultProps: Omit<DSAppPickerT.DefaultProps, `dsAppPicker${Capitalize<string>}`> = {\n // export const defaultProps: DSAppPickerT.DefaultProps = {\n apps: [],\n customApps: [],\n sectionTitle: 'APPLICATIONS',\n customSectionTitle: 'CUSTOM APPLICATIONS',\n icon: () => <MenuPicker color={['brand-primary', '700']} size=\"m\" />,\n};\n\n// =============================================================================\n// PropTypes\n// =============================================================================\n\nexport const DSAppPickerPropTypes = {\n ...getPropsPerSlotPropTypes(DSAppPickerName, DSAppPickerSlots),\n apps: PropTypes.array.description(\n 'Main items. Format: [{ label:string, icon:component, onClick:func, disabled:bool, selected:bool }]',\n ).isRequired,\n customApps: PropTypes.array.description(\n 'Custom items. Format: [{ label:string, icon:component, onClick:func, disabled:bool, selected:bool }]',\n ),\n sectionTitle: PropTypes.string.description('main section title').defaultValue('APPLICATIONS'),\n customSectionTitle: PropTypes.string.description('custom section title').defaultValue('CUSTOM APPLICATIONS'),\n icon: PropTypes.func.description('trigger button s icon').defaultValue(MenuPicker),\n renderTrigger: PropTypes.func.description('Custom trigger component.'),\n actionRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.any })]).description(\n 'Ref containing a focusToIndex method. This method allows you to focus any App inside the AppPicker.',\n ),\n isOpen: PropTypes.bool.description('Wether the AppPicker should be open or not.'),\n onClose: PropTypes.func.description('Callback function when the AppPicker closes'),\n onKeyDown: PropTypes.func.description('OnKeyDown handler callback.'),\n onClick: PropTypes.func.description('Custom onClick for Trigger component.'),\n onClickOutside: PropTypes.func.description('Callback event when the user clicks outside the App Picker.'),\n triggerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.any })]).description(\n 'Ref to the trigger button.',\n ),\n} as ValidationMap<unknown>;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADqET;AApEd,sBAA2B;AAG3B,8BAAoD;AAEpD,uBAAkD;AAyD3C,MAAM,eAAoF;AAAA;AAAA,EAE/F,MAAM,CAAC;AAAA,EACP,YAAY,CAAC;AAAA,EACb,cAAc;AAAA,EACd,oBAAoB;AAAA,EACpB,MAAM,MAAM,4CAAC,8BAAW,OAAO,CAAC,iBAAiB,KAAK,GAAG,MAAK,KAAI;AACpE;AAMO,MAAM,uBAAuB;AAAA,EAClC,OAAG,kDAAyB,kCAAiB,iCAAgB;AAAA,EAC7D,MAAM,kCAAU,MAAM;AAAA,IACpB;AAAA,EACF,EAAE;AAAA,EACF,YAAY,kCAAU,MAAM;AAAA,IAC1B;AAAA,EACF;AAAA,EACA,cAAc,kCAAU,OAAO,YAAY,oBAAoB,EAAE,aAAa,cAAc;AAAA,EAC5F,oBAAoB,kCAAU,OAAO,YAAY,sBAAsB,EAAE,aAAa,qBAAqB;AAAA,EAC3G,MAAM,kCAAU,KAAK,YAAY,uBAAuB,EAAE,aAAa,0BAAU;AAAA,EACjF,eAAe,kCAAU,KAAK,YAAY,2BAA2B;AAAA,EACrE,WAAW,kCAAU,UAAU,CAAC,kCAAU,MAAM,kCAAU,MAAM,EAAE,SAAS,kCAAU,IAAI,CAAC,CAAC,CAAC,EAAE;AAAA,IAC5F;AAAA,EACF;AAAA,EACA,QAAQ,kCAAU,KAAK,YAAY,6CAA6C;AAAA,EAChF,SAAS,kCAAU,KAAK,YAAY,6CAA6C;AAAA,EACjF,WAAW,kCAAU,KAAK,YAAY,6BAA6B;AAAA,EACnE,SAAS,kCAAU,KAAK,YAAY,uCAAuC;AAAA,EAC3E,gBAAgB,kCAAU,KAAK,YAAY,6DAA6D;AAAA,EACxG,YAAY,kCAAU,UAAU,CAAC,kCAAU,MAAM,kCAAU,MAAM,EAAE,SAAS,kCAAU,IAAI,CAAC,CAAC,CAAC,EAAE;AAAA,IAC7F;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["import React from 'react';\nimport { MenuPicker } from '@elliemae/ds-icons';\nimport type { SvgIconT } from '@elliemae/ds-icons';\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema, ValidationMap } from '@elliemae/ds-props-helpers';\nimport {\n PropTypes,\n getPropsPerSlotPropTypes,\n globalAttributesPropTypes,\n xstyledPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport { DSAppPickerName, DSAppPickerSlots } from './constants/index.js';\n\nexport declare namespace DSAppPickerT {\n export interface AppItem {\n label: string;\n icon: React.ComponentType<{ className: string; size: string }>;\n onClick?: (e: React.MouseEvent, item: AppItem) => void | null;\n disabled?: boolean;\n applyAriaDisabled?: boolean;\n id?: string;\n selected?: boolean;\n wrapText?: boolean;\n }\n\n export type ActionRef = React.MutableRefObject<{\n focusToIndex?: (index: number) => void;\n focusSelectedOrFirstAvailable?: () => void;\n focusWrapper: () => void;\n }>;\n\n /**\n * Why the panel opened. `trigger` carries the activating event and fires synchronously in the\n * trigger's click handler (AppPicker owns the open). `controlled` fires when the consumer flips\n * the `isOpen` prop themselves \u2014 no event, delivered when that flip takes effect.\n */\n export type OpenChange =\n { reason: 'trigger'; event: React.MouseEvent | React.KeyboardEvent } | { reason: 'controlled' };\n\n /**\n * Why the panel closed. The event-carrying reasons fire synchronously from the handler that owns\n * the close (AppPicker in uncontrolled mode): `escape` (a scoped Escape), `click-outside`, and\n * `trigger-toggle` (the trigger clicked while open). `controlled` fires when the consumer flips the\n * `isOpen` prop themselves \u2014 no event, delivered when that flip takes effect.\n */\n export type CloseChange =\n | { reason: 'escape'; event: KeyboardEvent }\n | { reason: 'click-outside'; event: MouseEvent | TouchEvent }\n | { reason: 'trigger-toggle'; event: React.MouseEvent | React.KeyboardEvent }\n | { reason: 'controlled' };\n\n export interface RequiredProps {}\n\n export type SlotFunctionArguments = {\n dsApppickerRoot: () => object;\n dsApppickerGroup: () => object;\n dsApppickerItem: () => object;\n dsApppickerTitle: () => object;\n dsApppickerSeparator: () => object;\n dsApppickerRow: () => object;\n dsApppickerChip: () => object;\n dsApppickerButton: () => object;\n dsApppickerFloatingWrapper: () => object;\n };\n\n export interface DefaultProps {\n apps: AppItem[];\n customApps: AppItem[];\n sectionTitle: string;\n customSectionTitle: string;\n icon: React.ComponentType<SvgIconT.Props>;\n /**\n * Opt in to arrow-key opening on the trigger: ArrowDown opens and focuses the selected application\n * (the first available one when nothing is selected), ArrowUp opens and focuses the selected\n * application (the last available one when nothing is selected).\n *\n * The picker owns this flow end to end \u2014 a consumer does not wire a key handler, drive `isOpen`, or\n * reach through `actionRef` to place the focus. Defaults to `false`, so it is purely additive: a\n * picker that does not opt in behaves exactly as before, with the arrow keys doing nothing on the\n * trigger.\n *\n * Independent of `actionRef`, which stays the imperative handle for a consumer to move focus from\n * their own business logic at any time.\n */\n openAndFocusOnArrowKeys: boolean;\n }\n\n interface RenderTriggerProp {\n ref: React.RefCallback<HTMLButtonElement>;\n [key: string]: unknown;\n }\n\n /**\n * Props handed to a `TriggerComponent`. This is the only trigger API that participates in the\n * dialog's accessible-name wiring: `id` is the element the panel's `aria-labelledby` points at,\n * so a TriggerComponent that drops it leaves the dialog unnamed.\n *\n * `innerRef`, not `ref`, deliberately: under React 18 a `ref` passed through JSX is consumed by\n * the fiber and never reaches a plain function component's props unless it is wrapped in\n * `forwardRef`. `innerRef` is the established Dimsum convention (see `ds-system`'s styled\n * components) and keeps `forwardRef` optional for the consumer \u2014 which is the same ergonomic\n * concern that produced DEV-002, solved here without the plain-function call.\n */\n export interface TriggerComponentProps {\n innerRef: React.RefCallback<HTMLButtonElement>;\n id: string;\n onClick: (e: React.MouseEvent | React.KeyboardEvent) => void;\n /**\n * Attach to the trigger element alongside `onClick`. It is what implements\n * `openAndFocusOnArrowKeys`, and it is a keydown handler in its own right \u2014 never route a keydown\n * through `onClick` to get the same effect: `onClick` infers keyboard activation from the click's\n * `detail`, which is a property of clicks, not of key presses.\n *\n * Harmless to attach when `openAndFocusOnArrowKeys` is false \u2014 it ignores every key in that case.\n *\n * The keys it acts on are ArrowDown and ArrowUp. A trigger that drives its own `isOpen` \u2014 which makes\n * the picker's internal flip inert \u2014 has to open on those same two keys itself.\n */\n onKeyDown: (e: React.KeyboardEvent) => void;\n 'aria-haspopup': 'dialog';\n }\n\n /**\n * How the pending open was triggered, which is the only input to where initial focus lands:\n * `pointer` \u2192 the panel \u00B7 `keyboard-first` \u2192 the selection, else the first available item \u00B7\n * `keyboard-last` \u2192 the selection, else the last available item.\n */\n export type OpenIntent = 'pointer' | 'keyboard-first' | 'keyboard-last';\n\n export interface OptionalProps extends TypescriptHelpersT.PropsForGlobalOnSlots<\n typeof DSAppPickerName,\n typeof DSAppPickerSlots\n > {\n onOpen?: (info: OpenChange) => void;\n onClose?: (info: CloseChange) => void;\n onClick?: (e: React.MouseEvent | React.KeyboardEvent) => void;\n onClickOutside?: (e: MouseEvent | React.MouseEvent) => void;\n onKeyDown?: (e: React.KeyboardEvent) => void;\n actionRef?: ActionRef;\n /**\n * @deprecated v4.x \u2014 use `TriggerComponent`. `renderTrigger` receives only `ref` and cannot be\n * given the id the dialog's `aria-labelledby` points at, so the panel is left without an\n * accessible name. See DEV-002 in KNOWN_INTENTIONAL_DEVIATIONS.md.\n */\n renderTrigger?: (props: RenderTriggerProp) => React.ReactElement | null;\n /**\n * Custom trigger, rendered as a real React element so it owns its own fiber. Takes precedence\n * over `renderTrigger` when both are supplied.\n */\n TriggerComponent?: React.ComponentType<TriggerComponentProps>;\n isOpen?: boolean;\n triggerRef?: React.RefObject<HTMLButtonElement>;\n }\n\n export interface Props\n extends\n Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends\n DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSAppPickerT.DefaultProps = {\n apps: [],\n customApps: [],\n sectionTitle: 'APPLICATIONS',\n customSectionTitle: 'CUSTOM APPLICATIONS',\n icon: () => <MenuPicker color={['brand-primary', '700']} size=\"m\" />,\n openAndFocusOnArrowKeys: false,\n};\n\n// =============================================================================\n// PropTypes\n// =============================================================================\n\nexport const DSAppPickerPropTypes: DSPropTypesSchema<DSAppPickerT.Props> = {\n ...getPropsPerSlotPropTypes(DSAppPickerName, DSAppPickerSlots),\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n apps: PropTypes.array\n .description(\n 'Main items. Format: [{ label:string, icon:component, onClick:func, disabled:bool, selected:bool }]. ' +\n 'Conditionally required: at least one of \"apps\" or \"customApps\" must contain items \u2014 a picker with ' +\n 'nothing to pick has no purpose, so providing both empty throws.',\n )\n .defaultValue([]),\n customApps: PropTypes.array\n .description(\n 'Custom items. Format: [{ label:string, icon:component, onClick:func, disabled:bool, selected:bool }]. ' +\n 'Conditionally required: at least one of \"apps\" or \"customApps\" must contain items \u2014 a picker with ' +\n 'nothing to pick has no purpose, so providing both empty throws.',\n )\n .defaultValue([]),\n sectionTitle: PropTypes.string.description('main section title').defaultValue('APPLICATIONS'),\n customSectionTitle: PropTypes.string.description('custom section title').defaultValue('CUSTOM APPLICATIONS'),\n icon: PropTypes.func.description('trigger button s icon').defaultValue(MenuPicker),\n openAndFocusOnArrowKeys: PropTypes.bool\n .description(\n 'Opt in to arrow-key opening on the trigger. ArrowDown opens and focuses the selected application, ' +\n 'falling back to the first available one; ArrowUp opens and focuses the selected application, falling ' +\n 'back to the last available one. The picker owns the whole flow \u2014 no key handler, no isOpen wiring and ' +\n 'no actionRef needed. Independent of actionRef, which remains the imperative handle for moving focus ' +\n 'from your own logic.',\n )\n .defaultValue(false),\n renderTrigger: PropTypes.func\n .description(\n 'Custom trigger, called as a plain function with { ref }. Superseded by TriggerComponent: this ' +\n \"render-prop cannot receive the id that the panel's aria-labelledby points at, so the dialog \" +\n 'is left without an accessible name. TriggerComponent takes precedence when both are supplied.',\n )\n .deprecated({\n version: '4.x',\n message: 'Use \"TriggerComponent\" instead \u2014 it receives the id required for the dialog accessible name.',\n }),\n TriggerComponent: PropTypes.func.description(\n 'Custom trigger rendered as a React element. Receives { innerRef, id, onClick, aria-haspopup }; ' +\n 'the id must be applied to the focusable trigger element for the panel to have an accessible name. ' +\n 'Takes precedence over the deprecated renderTrigger when both are supplied.',\n ),\n actionRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.any })]).description(\n 'Ref containing a focusToIndex method. This method allows you to focus any App inside the AppPicker.',\n ),\n isOpen: PropTypes.bool.description('Wether the AppPicker should be open or not.'),\n onOpen: PropTypes.func.description(\n 'Callback when the AppPicker opens; receives { reason: \"trigger\" | \"controlled\", event? }.',\n ),\n onClose: PropTypes.func.description(\n 'Callback when the AppPicker closes; receives { reason: \"escape\" | \"click-outside\" | \"trigger-toggle\" | \"controlled\", event? }.',\n ),\n onKeyDown: PropTypes.func.description('OnKeyDown handler callback.'),\n onClick: PropTypes.func.description('Custom onClick for Trigger component.'),\n onClickOutside: PropTypes.func.description('Callback event when the user clicks outside the App Picker.'),\n triggerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.any })]).description(\n 'Ref to the trigger button.',\n ),\n};\n\nexport const DSAppPickerPropTypesSchema = DSAppPickerPropTypes as unknown as ValidationMap<DSAppPickerT.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADgLT;AA/Kd,sBAA2B;AAG3B,8BAKO;AAEP,uBAAkD;AAgK3C,MAAM,eAA0C;AAAA,EACrD,MAAM,CAAC;AAAA,EACP,YAAY,CAAC;AAAA,EACb,cAAc;AAAA,EACd,oBAAoB;AAAA,EACpB,MAAM,MAAM,4CAAC,8BAAW,OAAO,CAAC,iBAAiB,KAAK,GAAG,MAAK,KAAI;AAAA,EAClE,yBAAyB;AAC3B;AAMO,MAAM,uBAA8D;AAAA,EACzE,OAAG,kDAAyB,kCAAiB,iCAAgB;AAAA,EAC7D,GAAG;AAAA,EACH,GAAG;AAAA,EACH,MAAM,kCAAU,MACb;AAAA,IACC;AAAA,EAGF,EACC,aAAa,CAAC,CAAC;AAAA,EAClB,YAAY,kCAAU,MACnB;AAAA,IACC;AAAA,EAGF,EACC,aAAa,CAAC,CAAC;AAAA,EAClB,cAAc,kCAAU,OAAO,YAAY,oBAAoB,EAAE,aAAa,cAAc;AAAA,EAC5F,oBAAoB,kCAAU,OAAO,YAAY,sBAAsB,EAAE,aAAa,qBAAqB;AAAA,EAC3G,MAAM,kCAAU,KAAK,YAAY,uBAAuB,EAAE,aAAa,0BAAU;AAAA,EACjF,yBAAyB,kCAAU,KAChC;AAAA,IACC;AAAA,EAKF,EACC,aAAa,KAAK;AAAA,EACrB,eAAe,kCAAU,KACtB;AAAA,IACC;AAAA,EAGF,EACC,WAAW;AAAA,IACV,SAAS;AAAA,IACT,SAAS;AAAA,EACX,CAAC;AAAA,EACH,kBAAkB,kCAAU,KAAK;AAAA,IAC/B;AAAA,EAGF;AAAA,EACA,WAAW,kCAAU,UAAU,CAAC,kCAAU,MAAM,kCAAU,MAAM,EAAE,SAAS,kCAAU,IAAI,CAAC,CAAC,CAAC,EAAE;AAAA,IAC5F;AAAA,EACF;AAAA,EACA,QAAQ,kCAAU,KAAK,YAAY,6CAA6C;AAAA,EAChF,QAAQ,kCAAU,KAAK;AAAA,IACrB;AAAA,EACF;AAAA,EACA,SAAS,kCAAU,KAAK;AAAA,IACtB;AAAA,EACF;AAAA,EACA,WAAW,kCAAU,KAAK,YAAY,6BAA6B;AAAA,EACnE,SAAS,kCAAU,KAAK,YAAY,uCAAuC;AAAA,EAC3E,gBAAgB,kCAAU,KAAK,YAAY,6DAA6D;AAAA,EACxG,YAAY,kCAAU,UAAU,CAAC,kCAAU,MAAM,kCAAU,MAAM,EAAE,SAAS,kCAAU,IAAI,CAAC,CAAC,CAAC,EAAE;AAAA,IAC7F;AAAA,EACF;AACF;AAEO,MAAM,6BAA6B;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (let key of __getOwnPropNames(from))
11
+ if (!__hasOwnProp.call(to, key) && key !== except)
12
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ }
14
+ return to;
15
+ };
16
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
+ // If the importer is in node compatibility mode or this is not an ESM
18
+ // file that has been converted to a CommonJS file using a Babel-
19
+ // compatible transform (i.e. "__esModule" has not been set), then set
20
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
24
+ var React = __toESM(require("react"));
25
+ const SlotPropsAsObject = {
26
+ dsApppickerRoot: { "aria-label": "just a typescript test" },
27
+ dsApppickerGroup: { "aria-label": "just a typescript test" },
28
+ dsApppickerItem: { "aria-label": "just a typescript test" },
29
+ dsApppickerTitle: { "aria-label": "just a typescript test" },
30
+ dsApppickerSeparator: { "aria-label": "just a typescript test" },
31
+ dsApppickerRow: { "aria-label": "just a typescript test" },
32
+ dsApppickerChip: { "aria-label": "just a typescript test" },
33
+ dsApppickerButton: { "aria-label": "just a typescript test" },
34
+ dsApppickerFloatingWrapper: { "aria-label": "just a typescript test" }
35
+ };
36
+ const SlotPropsAsFunctions = {
37
+ dsApppickerRoot: () => ({ "aria-label": "just a typescript test" }),
38
+ dsApppickerGroup: () => ({ "aria-label": "just a typescript test" }),
39
+ dsApppickerItem: () => ({ "aria-label": "just a typescript test" }),
40
+ dsApppickerTitle: () => ({ "aria-label": "just a typescript test" }),
41
+ dsApppickerSeparator: () => ({ "aria-label": "just a typescript test" }),
42
+ dsApppickerRow: () => ({ "aria-label": "just a typescript test" }),
43
+ dsApppickerChip: () => ({ "aria-label": "just a typescript test" }),
44
+ dsApppickerButton: () => ({ "aria-label": "just a typescript test" }),
45
+ dsApppickerFloatingWrapper: () => ({ "aria-label": "just a typescript test" })
46
+ };
47
+ const EnsureAllSlotsExistInSlotFunctionArguments = SlotPropsAsFunctions;
48
+ //# sourceMappingURL=slot-props.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/slot-props.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\n\nimport type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type { DSAppPickerName, DSAppPickerSlots } from '../constants/index.js';\nimport type { DSAppPickerT } from '../react-desc-prop-types.js';\n\nconst SlotPropsAsObject: Partial<DSAppPickerT.Props> = {\n dsApppickerRoot: { 'aria-label': 'just a typescript test' },\n dsApppickerGroup: { 'aria-label': 'just a typescript test' },\n dsApppickerItem: { 'aria-label': 'just a typescript test' },\n dsApppickerTitle: { 'aria-label': 'just a typescript test' },\n dsApppickerSeparator: { 'aria-label': 'just a typescript test' },\n dsApppickerRow: { 'aria-label': 'just a typescript test' },\n dsApppickerChip: { 'aria-label': 'just a typescript test' },\n dsApppickerButton: { 'aria-label': 'just a typescript test' },\n dsApppickerFloatingWrapper: { 'aria-label': 'just a typescript test' },\n};\n\nconst SlotPropsAsFunctions: DSAppPickerT.SlotFunctionArguments = {\n dsApppickerRoot: () => ({ 'aria-label': 'just a typescript test' }),\n dsApppickerGroup: () => ({ 'aria-label': 'just a typescript test' }),\n dsApppickerItem: () => ({ 'aria-label': 'just a typescript test' }),\n dsApppickerTitle: () => ({ 'aria-label': 'just a typescript test' }),\n dsApppickerSeparator: () => ({ 'aria-label': 'just a typescript test' }),\n dsApppickerRow: () => ({ 'aria-label': 'just a typescript test' }),\n dsApppickerChip: () => ({ 'aria-label': 'just a typescript test' }),\n dsApppickerButton: () => ({ 'aria-label': 'just a typescript test' }),\n dsApppickerFloatingWrapper: () => ({ 'aria-label': 'just a typescript test' }),\n};\n\n// Exhaustiveness check \u2014 fails compilation if a slot defined in DSAppPickerSlots is missing from\n// the hand-written SlotFunctionArguments type in react-desc-prop-types.tsx.\nconst EnsureAllSlotsExistInSlotFunctionArguments: Required<\n TypescriptHelpersT.PropsForSlots<typeof DSAppPickerName, typeof DSAppPickerSlots>\n> = SlotPropsAsFunctions;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAuB;ACMvB,MAAM,oBAAiD;AAAA,EACrD,iBAAiB,EAAE,cAAc,yBAAyB;AAAA,EAC1D,kBAAkB,EAAE,cAAc,yBAAyB;AAAA,EAC3D,iBAAiB,EAAE,cAAc,yBAAyB;AAAA,EAC1D,kBAAkB,EAAE,cAAc,yBAAyB;AAAA,EAC3D,sBAAsB,EAAE,cAAc,yBAAyB;AAAA,EAC/D,gBAAgB,EAAE,cAAc,yBAAyB;AAAA,EACzD,iBAAiB,EAAE,cAAc,yBAAyB;AAAA,EAC1D,mBAAmB,EAAE,cAAc,yBAAyB;AAAA,EAC5D,4BAA4B,EAAE,cAAc,yBAAyB;AACvE;AAEA,MAAM,uBAA2D;AAAA,EAC/D,iBAAiB,OAAO,EAAE,cAAc,yBAAyB;AAAA,EACjE,kBAAkB,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAClE,iBAAiB,OAAO,EAAE,cAAc,yBAAyB;AAAA,EACjE,kBAAkB,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAClE,sBAAsB,OAAO,EAAE,cAAc,yBAAyB;AAAA,EACtE,gBAAgB,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAChE,iBAAiB,OAAO,EAAE,cAAc,yBAAyB;AAAA,EACjE,mBAAmB,OAAO,EAAE,cAAc,yBAAyB;AAAA,EACnE,4BAA4B,OAAO,EAAE,cAAc,yBAAyB;AAC9E;AAIA,MAAM,6CAEF;",
6
+ "names": []
7
+ }