@elliemae/ds-app-picker 3.70.0-next.6 → 3.70.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 (119) 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 +45 -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.map +1 -1
  14. package/dist/cjs/package.json +1 -4
  15. package/dist/cjs/parts/AppPanel.js +152 -0
  16. package/dist/cjs/parts/AppPanel.js.map +7 -0
  17. package/dist/cjs/parts/AppPickerFloatingContext/AppPickerContent.js +94 -0
  18. package/dist/cjs/parts/AppPickerFloatingContext/AppPickerContent.js.map +7 -0
  19. package/dist/cjs/parts/AppPickerFloatingContext/useAppPickerFloatingContext.js +171 -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 +94 -0
  24. package/dist/cjs/parts/AppSection.js.map +7 -0
  25. package/dist/cjs/parts/Trigger.js +81 -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 +23 -7
  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 +13 -1
  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/esm/DSAppPicker.js +10 -141
  40. package/dist/esm/DSAppPicker.js.map +3 -3
  41. package/dist/esm/DSAppPickerCTX.js +8 -0
  42. package/dist/esm/DSAppPickerCTX.js.map +7 -0
  43. package/dist/esm/config/useAppPicker.js +29 -13
  44. package/dist/esm/config/useAppPicker.js.map +3 -3
  45. package/dist/esm/config/useFocusTracker.js +74 -0
  46. package/dist/esm/config/useFocusTracker.js.map +7 -0
  47. package/dist/esm/config/useValidateProps.js +15 -0
  48. package/dist/esm/config/useValidateProps.js.map +7 -0
  49. package/dist/esm/constants/index.js +11 -1
  50. package/dist/esm/constants/index.js.map +2 -2
  51. package/dist/esm/index.js.map +1 -1
  52. package/dist/esm/package.json +1 -4
  53. package/dist/esm/parts/AppPanel.js +127 -0
  54. package/dist/esm/parts/AppPanel.js.map +7 -0
  55. package/dist/esm/parts/AppPickerFloatingContext/AppPickerContent.js +64 -0
  56. package/dist/esm/parts/AppPickerFloatingContext/AppPickerContent.js.map +7 -0
  57. package/dist/esm/parts/AppPickerFloatingContext/useAppPickerFloatingContext.js +141 -0
  58. package/dist/esm/parts/AppPickerFloatingContext/useAppPickerFloatingContext.js.map +7 -0
  59. package/dist/esm/parts/AppPickerItem.js +74 -0
  60. package/dist/esm/parts/AppPickerItem.js.map +7 -0
  61. package/dist/esm/parts/AppSection.js +64 -0
  62. package/dist/esm/parts/AppSection.js.map +7 -0
  63. package/dist/esm/parts/Trigger.js +51 -0
  64. package/dist/esm/parts/Trigger.js.map +7 -0
  65. package/dist/esm/parts/shared-styles.js +14 -0
  66. package/dist/esm/parts/shared-styles.js.map +7 -0
  67. package/dist/esm/react-desc-prop-types.js +29 -8
  68. package/dist/esm/react-desc-prop-types.js.map +2 -2
  69. package/dist/esm/typescript-testing/slot-props.js +25 -0
  70. package/dist/esm/typescript-testing/slot-props.js.map +7 -0
  71. package/dist/esm/typescript-testing/typescript-app-picker-valid.js +13 -1
  72. package/dist/esm/typescript-testing/typescript-app-picker-valid.js.map +2 -2
  73. package/dist/esm/util/getChipId.js +6 -0
  74. package/dist/esm/util/getChipId.js.map +7 -0
  75. package/dist/esm/util/getChipRegionId.js +7 -0
  76. package/dist/esm/util/getChipRegionId.js.map +7 -0
  77. package/dist/types/DSAppPicker.d.ts +1 -2
  78. package/dist/types/DSAppPickerCTX.d.ts +6 -0
  79. package/dist/types/config/useAppPicker.d.ts +111 -92
  80. package/dist/types/config/useFocusTracker.d.ts +19 -0
  81. package/dist/types/config/useValidateProps.d.ts +3 -0
  82. package/dist/types/constants/index.d.ts +17 -7
  83. package/dist/types/parts/AppPanel.d.ts +2 -0
  84. package/dist/types/parts/AppPickerFloatingContext/AppPickerContent.d.ts +3 -0
  85. package/dist/types/parts/AppPickerFloatingContext/useAppPickerFloatingContext.d.ts +170 -0
  86. package/dist/types/parts/AppPickerItem.d.ts +11 -0
  87. package/dist/types/parts/AppSection.d.ts +6 -0
  88. package/dist/types/parts/Trigger.d.ts +13 -0
  89. package/dist/types/parts/shared-styles.d.ts +2 -0
  90. package/dist/types/react-desc-prop-types.d.ts +80 -9
  91. package/dist/types/util/getChipId.d.ts +2 -0
  92. package/dist/types/util/getChipRegionId.d.ts +1 -0
  93. package/package.json +19 -17
  94. package/dist/cjs/AppPickerImpl.js +0 -204
  95. package/dist/cjs/AppPickerImpl.js.map +0 -7
  96. package/dist/cjs/hooks/useKeepTrackButtons.js +0 -69
  97. package/dist/cjs/hooks/useKeepTrackButtons.js.map +0 -7
  98. package/dist/cjs/styles.js +0 -76
  99. package/dist/cjs/styles.js.map +0 -7
  100. package/dist/cjs/utils.js.map +0 -7
  101. package/dist/esm/AppPickerImpl.js +0 -174
  102. package/dist/esm/AppPickerImpl.js.map +0 -7
  103. package/dist/esm/hooks/useKeepTrackButtons.js +0 -39
  104. package/dist/esm/hooks/useKeepTrackButtons.js.map +0 -7
  105. package/dist/esm/styles.js +0 -46
  106. package/dist/esm/styles.js.map +0 -7
  107. package/dist/esm/utils.js +0 -25
  108. package/dist/esm/utils.js.map +0 -7
  109. package/dist/types/AppPickerImpl.d.ts +0 -11
  110. package/dist/types/hooks/useKeepTrackButtons.d.ts +0 -13
  111. package/dist/types/styles.d.ts +0 -7
  112. package/dist/types/tests/app-picker.a11y.test.d.ts +0 -1
  113. package/dist/types/tests/app-picker.data-testid.test.d.ts +0 -1
  114. package/dist/types/tests/app-picker.events.test.d.ts +0 -1
  115. package/dist/types/tests/app-picker.exports.test.d.ts +0 -1
  116. package/dist/types/tests/app-picker.get-owner-props.test.d.ts +0 -1
  117. package/dist/types/tests/app-picker.keyboard.test.d.ts +0 -1
  118. package/dist/types/typescript-testing/typescript-app-picker-valid.d.ts +0 -1
  119. package/dist/types/utils.d.ts +0 -14
@@ -0,0 +1,94 @@
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_AppPickerItem = require("./AppPickerItem.js");
43
+ var import_shared_styles = require("./shared-styles.js");
44
+ const StyledTitle = (0, import_ds_system.styled)(import_ds_typography.DSTypography, { name: import_constants.DSAppPickerName, slot: import_constants.DSAppPickerSlots.TITLE })`
45
+ color: ${({ theme }) => theme.colors.neutral[700]};
46
+ font-size: ${({ theme }) => theme.fontSizes.value[400]};
47
+ font-weight: ${({ theme }) => theme.fontWeights.semibold};
48
+ margin: 12px 0 8px 0;
49
+ line-height: 1.385;
50
+ text-transform: uppercase;
51
+ text-align: center;
52
+ `;
53
+ const AppSection = ({ isCustomApps = false }) => {
54
+ const {
55
+ propsWithDefault: { apps, customApps, sectionTitle, customSectionTitle },
56
+ instanceUid,
57
+ focusTrackers: { firstFocusableIdx, lastFocusableIdx },
58
+ ownerPropsConfig
59
+ } = (0, import_react.useContext)(import_DSAppPickerCTX.DSAppPickerContext);
60
+ const items = isCustomApps ? customApps : apps;
61
+ const titleId = isCustomApps ? `${instanceUid}-custom-section-title` : `${instanceUid}-section-title`;
62
+ const title = isCustomApps ? customSectionTitle : sectionTitle;
63
+ const totalCount = (apps?.length ?? 0) + (customApps?.length ?? 0);
64
+ const initialPositionOffset = isCustomApps ? apps.length : 0;
65
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
66
+ import_shared_styles.StyledSection,
67
+ {
68
+ "data-testid": import_constants.DSAppPickerDataTestIds.GROUP,
69
+ role: "group",
70
+ "aria-labelledby": titleId,
71
+ ...ownerPropsConfig,
72
+ children: [
73
+ /* @__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 }) }),
74
+ items.map((app, index) => {
75
+ const flatIndex = initialPositionOffset + index;
76
+ const positionAnnouncement = `${flatIndex + 1} of ${totalCount}`;
77
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
78
+ import_AppPickerItem.AppPickerItem,
79
+ {
80
+ positionAnnouncement,
81
+ app,
82
+ chipId: (0, import_getChipId.getChipId)(app, flatIndex),
83
+ isFirstFocusable: flatIndex === firstFocusableIdx,
84
+ isLastFocusable: flatIndex === lastFocusableIdx
85
+ },
86
+ app.id ?? `${app.label}-${isCustomApps ? "custom" : "main"}-${index}`
87
+ );
88
+ })
89
+ ]
90
+ }
91
+ );
92
+ };
93
+ AppSection.displayName = "DSAppPicker.AppSection";
94
+ //# 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 { 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 const titleId = isCustomApps ? `${instanceUid}-custom-section-title` : `${instanceUid}-section-title`;\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;ADsCnB;AAtCJ,uBAAuB;AACvB,2BAA6B;AAC7B,mBAAkC;AAClC,uBAA0E;AAC1E,4BAAmC;AACnC,uBAA0B;AAC1B,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;AAC1C,QAAM,UAAU,eAAe,GAAG,WAAW,0BAA0B,GAAG,WAAW;AACrF,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,81 @@
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, 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
+ "aria-haspopup": "dialog"
58
+ }
59
+ );
60
+ }
61
+ if (renderTrigger) {
62
+ return renderTrigger({ ref: handleTriggerRef });
63
+ }
64
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
65
+ StyledButton,
66
+ {
67
+ "data-testid": import_constants.DSAppPickerDataTestIds.BUTTON,
68
+ id: dialogLabelId,
69
+ buttonType: "icon",
70
+ "aria-haspopup": "dialog",
71
+ "aria-label": "Application picker",
72
+ innerRef: handleTriggerRef,
73
+ onClick: handleTriggerClick,
74
+ getOwnerProps: ownerPropsConfig.getOwnerProps,
75
+ getOwnerPropsArguments: ownerPropsConfig.getOwnerPropsArguments,
76
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, {})
77
+ }
78
+ );
79
+ };
80
+ Trigger.displayName = "DSAppPicker.Trigger";
81
+ //# 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 dialogLabelId: string;\n};\n\nexport const Trigger = (PropsFromFloatingContext: FloatingContextDictatedProps) => {\n const { handleTriggerRef, handleTriggerClick, 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 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 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;ADoCjB;AApCN,0BAA2B;AAC3B,uBAAuB;AACvB,mBAAkC;AAClC,uBAA0E;AAC1E,4BAAmC;AASnC,MAAM,mBAAe,yBAAO,gCAAY,EAAE,MAAM,kCAAiB,MAAM,kCAAiB,OAAO,CAAC;AAAA;AAAA;AAWzF,MAAM,UAAU,CAAC,6BAA2D;AACjF,QAAM,EAAE,kBAAkB,oBAAoB,cAAc,IAAI;AAChE,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,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,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,7 +39,6 @@ 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",
@@ -47,21 +47,36 @@ const defaultProps = {
47
47
  };
48
48
  const DSAppPickerPropTypes = {
49
49
  ...(0, import_ds_props_helpers.getPropsPerSlotPropTypes)(import_constants.DSAppPickerName, import_constants.DSAppPickerSlots),
50
+ ...import_ds_props_helpers.globalAttributesPropTypes,
51
+ ...import_ds_props_helpers.xstyledPropTypes,
50
52
  apps: import_ds_props_helpers.PropTypes.array.description(
51
- "Main items. Format: [{ label:string, icon:component, onClick:func, disabled:bool, selected:bool }]"
52
- ).isRequired,
53
+ '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.'
54
+ ).defaultValue([]),
53
55
  customApps: import_ds_props_helpers.PropTypes.array.description(
54
- "Custom items. Format: [{ label:string, icon:component, onClick:func, disabled:bool, selected:bool }]"
55
- ),
56
+ '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.'
57
+ ).defaultValue([]),
56
58
  sectionTitle: import_ds_props_helpers.PropTypes.string.description("main section title").defaultValue("APPLICATIONS"),
57
59
  customSectionTitle: import_ds_props_helpers.PropTypes.string.description("custom section title").defaultValue("CUSTOM APPLICATIONS"),
58
60
  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."),
61
+ renderTrigger: import_ds_props_helpers.PropTypes.func.description(
62
+ "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."
63
+ ).deprecated({
64
+ version: "4.x",
65
+ message: 'Use "TriggerComponent" instead \u2014 it receives the id required for the dialog accessible name.'
66
+ }),
67
+ TriggerComponent: import_ds_props_helpers.PropTypes.func.description(
68
+ "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."
69
+ ),
60
70
  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
71
  "Ref containing a focusToIndex method. This method allows you to focus any App inside the AppPicker."
62
72
  ),
63
73
  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"),
74
+ onOpen: import_ds_props_helpers.PropTypes.func.description(
75
+ 'Callback when the AppPicker opens; receives { reason: "trigger" | "controlled", event? }.'
76
+ ),
77
+ onClose: import_ds_props_helpers.PropTypes.func.description(
78
+ 'Callback when the AppPicker closes; receives { reason: "escape" | "click-outside" | "trigger-toggle" | "controlled", event? }.'
79
+ ),
65
80
  onKeyDown: import_ds_props_helpers.PropTypes.func.description("OnKeyDown handler callback."),
66
81
  onClick: import_ds_props_helpers.PropTypes.func.description("Custom onClick for Trigger component."),
67
82
  onClickOutside: import_ds_props_helpers.PropTypes.func.description("Callback event when the user clicks outside the App Picker."),
@@ -69,4 +84,5 @@ const DSAppPickerPropTypes = {
69
84
  "Ref to the trigger button."
70
85
  )
71
86
  };
87
+ const DSAppPickerPropTypesSchema = DSAppPickerPropTypes;
72
88
  //# 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": ["/* eslint-disable @typescript-eslint/no-empty-interface */\nimport 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\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 'aria-haspopup': 'dialog';\n }\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};\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 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;ADgJT;AA9Id,sBAA2B;AAG3B,8BAKO;AAEP,uBAAkD;AA+H3C,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;AACpE;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,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
+ }
@@ -25,6 +25,7 @@ var React = __toESM(require("react"));
25
25
  var import_jsx_runtime = require("react/jsx-runtime");
26
26
  var import__ = require("../index.js");
27
27
  const testOptionalProps = {};
28
+ const testRequiredProps = {};
28
29
  const testPartialDefaults = {
29
30
  apps: [],
30
31
  customApps: [],
@@ -34,10 +35,12 @@ const testPartialDefaults = {
34
35
  };
35
36
  const testProps = {
36
37
  ...testOptionalProps,
38
+ ...testRequiredProps,
37
39
  ...testPartialDefaults
38
40
  };
39
41
  const testPropsAsSyntax = {
40
42
  ...testOptionalProps,
43
+ ...testRequiredProps,
41
44
  ...testPartialDefaults
42
45
  };
43
46
  const testCompleteDefaults = {
@@ -49,10 +52,12 @@ const testCompleteDefaults = {
49
52
  };
50
53
  const testInternalProps = {
51
54
  ...testOptionalProps,
55
+ ...testRequiredProps,
52
56
  ...testCompleteDefaults
53
57
  };
54
58
  const testInternalPropsAsSyntax = {
55
59
  ...testOptionalProps,
60
+ ...testRequiredProps,
56
61
  ...testCompleteDefaults
57
62
  };
58
63
  const testExplicitDefinition = {
@@ -69,10 +74,17 @@ const testInferedTypeCompatibility = {
69
74
  customSectionTitle: "",
70
75
  icon: () => null
71
76
  };
77
+ const CustomTrigger = ({ innerRef, id, onClick, ...rest }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { ref: innerRef, id, onClick, type: "button", ...rest, children: "Open apps" });
78
+ const testTriggerComponentProp = {
79
+ TriggerComponent: CustomTrigger
80
+ };
72
81
  const ExampleUsageComponent = () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
73
82
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSAppPicker, { ...testExplicitDefinition }),
74
83
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSAppPicker, { ...testInferedTypeCompatibility }),
75
84
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSAppPicker, { apps: [], customApps: [], sectionTitle: "", customSectionTitle: "", icon: () => null }),
76
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSAppPicker, { apps: [], customApps: [], sectionTitle: "", customSectionTitle: "", icon: () => null })
85
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSAppPicker, { apps: [], customApps: [], sectionTitle: "", customSectionTitle: "", icon: () => null }),
86
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSAppPicker, { apps: [], TriggerComponent: CustomTrigger }),
87
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSAppPicker, { ...testTriggerComponentProp, apps: [] }),
88
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSAppPicker, { apps: [], renderTrigger: ({ ref }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { ref, type: "button", "aria-label": "banana" }) })
77
89
  ] });
78
90
  //# sourceMappingURL=typescript-app-picker-valid.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/typescript-app-picker-valid.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport { DSAppPicker } from '../index.js';\nimport type { DSAppPickerT } from '../index.js';\n\n// test we expose the namespace and the namespace follows our deliverable conventions\ntype ComponentPropsForApp = DSAppPickerT.Props;\ntype ComponentPropsInternals = DSAppPickerT.InternalProps;\ntype ComponentPropsDefaultProps = DSAppPickerT.DefaultProps;\ntype ComponentPropsOptionalProps = DSAppPickerT.OptionalProps;\n\nconst testOptionalProps: ComponentPropsOptionalProps = {};\n\n// difference Props and InternalProps is that InternalProps has all the default props filled in\n// Props allows for partial defaults\nconst testPartialDefaults: Partial<ComponentPropsDefaultProps> = {\n apps: [],\n customApps: [],\n sectionTitle: '',\n customSectionTitle: '',\n icon: () => null,\n};\n\nconst testProps: ComponentPropsForApp = {\n ...testOptionalProps,\n ...testPartialDefaults,\n};\nconst testPropsAsSyntax = {\n ...testOptionalProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n// InternalProps requires all defaults to be filled in\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = {\n apps: [],\n customApps: [],\n sectionTitle: '',\n customSectionTitle: '',\n icon: () => null,\n};\n\nconst testInternalProps: ComponentPropsInternals = {\n ...testOptionalProps,\n ...testCompleteDefaults,\n};\nconst testInternalPropsAsSyntax = {\n ...testOptionalProps,\n ...testCompleteDefaults,\n} as ComponentPropsInternals;\n\n// using the explicit type definition, if there is an error, it will be marked on the key that is wrong\nconst testExplicitDefinition: ComponentPropsForApp = {\n apps: [],\n customApps: [],\n sectionTitle: '',\n customSectionTitle: '',\n icon: () => null,\n};\n\n// using the \"as\" syntax, if there is an error, it will be marking the whole object as wrong because it is not compatible with the type\nconst testInferedTypeCompatibility = {\n apps: [],\n customApps: [],\n sectionTitle: '',\n customSectionTitle: '',\n icon: () => null,\n} as ComponentPropsForApp;\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <DSAppPicker {...testExplicitDefinition} />\n <DSAppPicker {...testInferedTypeCompatibility} />\n {/* works with inline values */}\n <DSAppPicker apps={[]} customApps={[]} sectionTitle=\"\" customSectionTitle=\"\" icon={() => null} />\n {/* multiple auto inference works */}\n <DSAppPicker apps={[]} customApps={[]} sectionTitle=\"\" customSectionTitle=\"\" icon={() => null} />\n {/* works with partial defaults */}\n </>\n);\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAuB;ACmErB;AAlEF,eAA4B;AAS5B,MAAM,oBAAiD,CAAC;AAIxD,MAAM,sBAA2D;AAAA,EAC/D,MAAM,CAAC;AAAA,EACP,YAAY,CAAC;AAAA,EACb,cAAc;AAAA,EACd,oBAAoB;AAAA,EACpB,MAAM,MAAM;AACd;AAEA,MAAM,YAAkC;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AACL;AACA,MAAM,oBAAoB;AAAA,EACxB,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,uBAA6D;AAAA,EACjE,MAAM,CAAC;AAAA,EACP,YAAY,CAAC;AAAA,EACb,cAAc;AAAA,EACd,oBAAoB;AAAA,EACpB,MAAM,MAAM;AACd;AAEA,MAAM,oBAA6C;AAAA,EACjD,GAAG;AAAA,EACH,GAAG;AACL;AACA,MAAM,4BAA4B;AAAA,EAChC,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,yBAA+C;AAAA,EACnD,MAAM,CAAC;AAAA,EACP,YAAY,CAAC;AAAA,EACb,cAAc;AAAA,EACd,oBAAoB;AAAA,EACpB,MAAM,MAAM;AACd;AAGA,MAAM,+BAA+B;AAAA,EACnC,MAAM,CAAC;AAAA,EACP,YAAY,CAAC;AAAA,EACb,cAAc;AAAA,EACd,oBAAoB;AAAA,EACpB,MAAM,MAAM;AACd;AAEA,MAAM,wBAAwB,MAC5B,4EAEE;AAAA,8CAAC,wBAAa,GAAG,wBAAwB;AAAA,EACzC,4CAAC,wBAAa,GAAG,8BAA8B;AAAA,EAE/C,4CAAC,wBAAY,MAAM,CAAC,GAAG,YAAY,CAAC,GAAG,cAAa,IAAG,oBAAmB,IAAG,MAAM,MAAM,MAAM;AAAA,EAE/F,4CAAC,wBAAY,MAAM,CAAC,GAAG,YAAY,CAAC,GAAG,cAAa,IAAG,oBAAmB,IAAG,MAAM,MAAM,MAAM;AAAA,GAEjG;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport { DSAppPicker } from '../index.js';\nimport type { DSAppPickerT } from '../index.js';\n\n// test we expose the namespace and the namespace follows our deliverable conventions\ntype ComponentPropsForApp = DSAppPickerT.Props;\ntype ComponentPropsInternals = DSAppPickerT.InternalProps;\ntype ComponentPropsDefaultProps = DSAppPickerT.DefaultProps;\ntype ComponentPropsOptionalProps = DSAppPickerT.OptionalProps;\ntype ComponentPropsRequiredProps = DSAppPickerT.RequiredProps;\n\nconst testOptionalProps: ComponentPropsOptionalProps = {};\nconst testRequiredProps: ComponentPropsRequiredProps = {};\n\n// difference Props and InternalProps is that InternalProps has all the default props filled in\n// Props allows for partial defaults\nconst testPartialDefaults: Partial<ComponentPropsDefaultProps> = {\n apps: [],\n customApps: [],\n sectionTitle: '',\n customSectionTitle: '',\n icon: () => null,\n};\n\nconst testProps: ComponentPropsForApp = {\n ...testOptionalProps,\n ...testRequiredProps,\n ...testPartialDefaults,\n};\nconst testPropsAsSyntax = {\n ...testOptionalProps,\n ...testRequiredProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n// InternalProps requires all defaults to be filled in\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = {\n apps: [],\n customApps: [],\n sectionTitle: '',\n customSectionTitle: '',\n icon: () => null,\n};\n\nconst testInternalProps: ComponentPropsInternals = {\n ...testOptionalProps,\n ...testRequiredProps,\n ...testCompleteDefaults,\n};\nconst testInternalPropsAsSyntax = {\n ...testOptionalProps,\n ...testRequiredProps,\n ...testCompleteDefaults,\n} as ComponentPropsInternals;\n\n// using the explicit type definition, if there is an error, it will be marked on the key that is wrong\nconst testExplicitDefinition: ComponentPropsForApp = {\n apps: [],\n customApps: [],\n sectionTitle: '',\n customSectionTitle: '',\n icon: () => null,\n};\n\n// using the \"as\" syntax, if there is an error, it will be marking the whole object as wrong because it is not compatible with the type\nconst testInferedTypeCompatibility = {\n apps: [],\n customApps: [],\n sectionTitle: '',\n customSectionTitle: '',\n icon: () => null,\n} as ComponentPropsForApp;\n\n// TriggerComponent is typed as a real component, so its props arrive through the fiber. The exported\n// TriggerComponentProps type is what a consumer annotates their own trigger with \u2014 if that type stops\n// being reachable from the namespace, or its members change shape, this stops compiling.\nconst CustomTrigger: React.ComponentType<DSAppPickerT.TriggerComponentProps> = ({ innerRef, id, onClick, ...rest }) => (\n <button ref={innerRef} id={id} onClick={onClick} type=\"button\" {...rest}>\n Open apps\n </button>\n);\n\n// A consumer may also declare the trigger inline without naming the props type; both must compile.\nconst testTriggerComponentProp: ComponentPropsOptionalProps = {\n TriggerComponent: CustomTrigger,\n};\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <DSAppPicker {...testExplicitDefinition} />\n <DSAppPicker {...testInferedTypeCompatibility} />\n {/* works with inline values */}\n <DSAppPicker apps={[]} customApps={[]} sectionTitle=\"\" customSectionTitle=\"\" icon={() => null} />\n {/* multiple auto inference works */}\n <DSAppPicker apps={[]} customApps={[]} sectionTitle=\"\" customSectionTitle=\"\" icon={() => null} />\n {/* works with partial defaults */}\n {/* TriggerComponent \u2014 the supported custom trigger API */}\n <DSAppPicker apps={[]} TriggerComponent={CustomTrigger} />\n <DSAppPicker {...testTriggerComponentProp} apps={[]} />\n {/* renderTrigger \u2014 deprecated (v4.x) but must still type-check until removal */}\n <DSAppPicker apps={[]} renderTrigger={({ ref }) => <button ref={ref} type=\"button\" aria-label=\"banana\" />} />\n </>\n);\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAuB;AC4ErB;AA3EF,eAA4B;AAU5B,MAAM,oBAAiD,CAAC;AACxD,MAAM,oBAAiD,CAAC;AAIxD,MAAM,sBAA2D;AAAA,EAC/D,MAAM,CAAC;AAAA,EACP,YAAY,CAAC;AAAA,EACb,cAAc;AAAA,EACd,oBAAoB;AAAA,EACpB,MAAM,MAAM;AACd;AAEA,MAAM,YAAkC;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AACA,MAAM,oBAAoB;AAAA,EACxB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,uBAA6D;AAAA,EACjE,MAAM,CAAC;AAAA,EACP,YAAY,CAAC;AAAA,EACb,cAAc;AAAA,EACd,oBAAoB;AAAA,EACpB,MAAM,MAAM;AACd;AAEA,MAAM,oBAA6C;AAAA,EACjD,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AACA,MAAM,4BAA4B;AAAA,EAChC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,yBAA+C;AAAA,EACnD,MAAM,CAAC;AAAA,EACP,YAAY,CAAC;AAAA,EACb,cAAc;AAAA,EACd,oBAAoB;AAAA,EACpB,MAAM,MAAM;AACd;AAGA,MAAM,+BAA+B;AAAA,EACnC,MAAM,CAAC;AAAA,EACP,YAAY,CAAC;AAAA,EACb,cAAc;AAAA,EACd,oBAAoB;AAAA,EACpB,MAAM,MAAM;AACd;AAKA,MAAM,gBAAyE,CAAC,EAAE,UAAU,IAAI,SAAS,GAAG,KAAK,MAC/G,4CAAC,YAAO,KAAK,UAAU,IAAQ,SAAkB,MAAK,UAAU,GAAG,MAAM,uBAEzE;AAIF,MAAM,2BAAwD;AAAA,EAC5D,kBAAkB;AACpB;AAEA,MAAM,wBAAwB,MAC5B,4EAEE;AAAA,8CAAC,wBAAa,GAAG,wBAAwB;AAAA,EACzC,4CAAC,wBAAa,GAAG,8BAA8B;AAAA,EAE/C,4CAAC,wBAAY,MAAM,CAAC,GAAG,YAAY,CAAC,GAAG,cAAa,IAAG,oBAAmB,IAAG,MAAM,MAAM,MAAM;AAAA,EAE/F,4CAAC,wBAAY,MAAM,CAAC,GAAG,YAAY,CAAC,GAAG,cAAa,IAAG,oBAAmB,IAAG,MAAM,MAAM,MAAM;AAAA,EAG/F,4CAAC,wBAAY,MAAM,CAAC,GAAG,kBAAkB,eAAe;AAAA,EACxD,4CAAC,wBAAa,GAAG,0BAA0B,MAAM,CAAC,GAAG;AAAA,EAErD,4CAAC,wBAAY,MAAM,CAAC,GAAG,eAAe,CAAC,EAAE,IAAI,MAAM,4CAAC,YAAO,KAAU,MAAK,UAAS,cAAW,UAAS,GAAI;AAAA,GAC7G;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,36 @@
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 getChipId_exports = {};
30
+ __export(getChipId_exports, {
31
+ getChipId: () => getChipId
32
+ });
33
+ module.exports = __toCommonJS(getChipId_exports);
34
+ var React = __toESM(require("react"));
35
+ const getChipId = (app, flatIndex) => app.id ?? `${app.label}-${flatIndex}`;
36
+ //# sourceMappingURL=getChipId.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/util/getChipId.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import type { DSAppPickerT } from '../react-desc-prop-types.js';\n\n// Chip identity, assigned top-down from data the parent already holds: the app's own `id`, or a\n// deterministic `${label}-${flatIndex}` fallback for id-less apps (the flat index disambiguates\n// duplicate labels). Both the parent (the focus tracker's track* handlers) and the child\n// (AppPickerItem, via the `chipId` prop threaded through AppSection) derive identity through THIS\n// single function, so the parent can compute the exact region string a chip will match without the\n// chip generating an id and reporting it back up. That determinism removes the child\u2192parent\n// dependency entirely: focus can be addressed by identity alone, with no registry to keep in sync\n// and no wait for the child to mount and register.\n//\n// Kept as a standalone leaf util (depends only on a type) so both the hook and the parts can import\n// it without routing through the hook module \u2014 avoids any import cycle risk.\nexport const getChipId = (app: DSAppPickerT.AppItem, flatIndex: number): string =>\n app.id ?? `${app.label}-${flatIndex}`;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADahB,MAAM,YAAY,CAAC,KAA2B,cACnD,IAAI,MAAM,GAAG,IAAI,KAAK,IAAI,SAAS;",
6
+ "names": []
7
+ }
@@ -0,0 +1,37 @@
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 getChipRegionId_exports = {};
30
+ __export(getChipRegionId_exports, {
31
+ getChipRegionId: () => getChipRegionId
32
+ });
33
+ module.exports = __toCommonJS(getChipRegionId_exports);
34
+ var React = __toESM(require("react"));
35
+ var import_constants = require("../constants/index.js");
36
+ const getChipRegionId = (chipId) => `${import_constants.CHIP_REGION_PREFIX}${chipId}`;
37
+ //# sourceMappingURL=getChipRegionId.js.map