@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.
- package/dist/cjs/DSAppPicker.js +10 -141
- package/dist/cjs/DSAppPicker.js.map +3 -3
- package/dist/cjs/{utils.js → DSAppPickerCTX.js} +8 -25
- package/dist/cjs/DSAppPickerCTX.js.map +7 -0
- package/dist/cjs/config/useAppPicker.js +25 -8
- package/dist/cjs/config/useAppPicker.js.map +3 -3
- package/dist/cjs/config/useFocusTracker.js +104 -0
- package/dist/cjs/config/useFocusTracker.js.map +7 -0
- package/dist/cjs/config/useValidateProps.js +45 -0
- package/dist/cjs/config/useValidateProps.js.map +7 -0
- package/dist/cjs/constants/index.js +11 -1
- package/dist/cjs/constants/index.js.map +2 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/package.json +1 -4
- package/dist/cjs/parts/AppPanel.js +152 -0
- package/dist/cjs/parts/AppPanel.js.map +7 -0
- package/dist/cjs/parts/AppPickerFloatingContext/AppPickerContent.js +94 -0
- package/dist/cjs/parts/AppPickerFloatingContext/AppPickerContent.js.map +7 -0
- package/dist/cjs/parts/AppPickerFloatingContext/useAppPickerFloatingContext.js +171 -0
- package/dist/cjs/parts/AppPickerFloatingContext/useAppPickerFloatingContext.js.map +7 -0
- package/dist/cjs/parts/AppPickerItem.js +104 -0
- package/dist/cjs/parts/AppPickerItem.js.map +7 -0
- package/dist/cjs/parts/AppSection.js +94 -0
- package/dist/cjs/parts/AppSection.js.map +7 -0
- package/dist/cjs/parts/Trigger.js +81 -0
- package/dist/cjs/parts/Trigger.js.map +7 -0
- package/dist/cjs/parts/shared-styles.js +44 -0
- package/dist/cjs/parts/shared-styles.js.map +7 -0
- package/dist/cjs/react-desc-prop-types.js +23 -7
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/typescript-testing/slot-props.js +48 -0
- package/dist/cjs/typescript-testing/slot-props.js.map +7 -0
- package/dist/cjs/typescript-testing/typescript-app-picker-valid.js +13 -1
- package/dist/cjs/typescript-testing/typescript-app-picker-valid.js.map +2 -2
- package/dist/cjs/util/getChipId.js +36 -0
- package/dist/cjs/util/getChipId.js.map +7 -0
- package/dist/cjs/util/getChipRegionId.js +37 -0
- package/dist/cjs/util/getChipRegionId.js.map +7 -0
- package/dist/esm/DSAppPicker.js +10 -141
- package/dist/esm/DSAppPicker.js.map +3 -3
- package/dist/esm/DSAppPickerCTX.js +8 -0
- package/dist/esm/DSAppPickerCTX.js.map +7 -0
- package/dist/esm/config/useAppPicker.js +29 -13
- package/dist/esm/config/useAppPicker.js.map +3 -3
- package/dist/esm/config/useFocusTracker.js +74 -0
- package/dist/esm/config/useFocusTracker.js.map +7 -0
- package/dist/esm/config/useValidateProps.js +15 -0
- package/dist/esm/config/useValidateProps.js.map +7 -0
- package/dist/esm/constants/index.js +11 -1
- package/dist/esm/constants/index.js.map +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/package.json +1 -4
- package/dist/esm/parts/AppPanel.js +127 -0
- package/dist/esm/parts/AppPanel.js.map +7 -0
- package/dist/esm/parts/AppPickerFloatingContext/AppPickerContent.js +64 -0
- package/dist/esm/parts/AppPickerFloatingContext/AppPickerContent.js.map +7 -0
- package/dist/esm/parts/AppPickerFloatingContext/useAppPickerFloatingContext.js +141 -0
- package/dist/esm/parts/AppPickerFloatingContext/useAppPickerFloatingContext.js.map +7 -0
- package/dist/esm/parts/AppPickerItem.js +74 -0
- package/dist/esm/parts/AppPickerItem.js.map +7 -0
- package/dist/esm/parts/AppSection.js +64 -0
- package/dist/esm/parts/AppSection.js.map +7 -0
- package/dist/esm/parts/Trigger.js +51 -0
- package/dist/esm/parts/Trigger.js.map +7 -0
- package/dist/esm/parts/shared-styles.js +14 -0
- package/dist/esm/parts/shared-styles.js.map +7 -0
- package/dist/esm/react-desc-prop-types.js +29 -8
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/esm/typescript-testing/slot-props.js +25 -0
- package/dist/esm/typescript-testing/slot-props.js.map +7 -0
- package/dist/esm/typescript-testing/typescript-app-picker-valid.js +13 -1
- package/dist/esm/typescript-testing/typescript-app-picker-valid.js.map +2 -2
- package/dist/esm/util/getChipId.js +6 -0
- package/dist/esm/util/getChipId.js.map +7 -0
- package/dist/esm/util/getChipRegionId.js +7 -0
- package/dist/esm/util/getChipRegionId.js.map +7 -0
- package/dist/types/DSAppPicker.d.ts +1 -2
- package/dist/types/DSAppPickerCTX.d.ts +6 -0
- package/dist/types/config/useAppPicker.d.ts +111 -92
- package/dist/types/config/useFocusTracker.d.ts +19 -0
- package/dist/types/config/useValidateProps.d.ts +3 -0
- package/dist/types/constants/index.d.ts +17 -7
- package/dist/types/parts/AppPanel.d.ts +2 -0
- package/dist/types/parts/AppPickerFloatingContext/AppPickerContent.d.ts +3 -0
- package/dist/types/parts/AppPickerFloatingContext/useAppPickerFloatingContext.d.ts +170 -0
- package/dist/types/parts/AppPickerItem.d.ts +11 -0
- package/dist/types/parts/AppSection.d.ts +6 -0
- package/dist/types/parts/Trigger.d.ts +13 -0
- package/dist/types/parts/shared-styles.d.ts +2 -0
- package/dist/types/react-desc-prop-types.d.ts +80 -9
- package/dist/types/util/getChipId.d.ts +2 -0
- package/dist/types/util/getChipRegionId.d.ts +1 -0
- package/package.json +19 -17
- package/dist/cjs/AppPickerImpl.js +0 -204
- package/dist/cjs/AppPickerImpl.js.map +0 -7
- package/dist/cjs/hooks/useKeepTrackButtons.js +0 -69
- package/dist/cjs/hooks/useKeepTrackButtons.js.map +0 -7
- package/dist/cjs/styles.js +0 -76
- package/dist/cjs/styles.js.map +0 -7
- package/dist/cjs/utils.js.map +0 -7
- package/dist/esm/AppPickerImpl.js +0 -174
- package/dist/esm/AppPickerImpl.js.map +0 -7
- package/dist/esm/hooks/useKeepTrackButtons.js +0 -39
- package/dist/esm/hooks/useKeepTrackButtons.js.map +0 -7
- package/dist/esm/styles.js +0 -46
- package/dist/esm/styles.js.map +0 -7
- package/dist/esm/utils.js +0 -25
- package/dist/esm/utils.js.map +0 -7
- package/dist/types/AppPickerImpl.d.ts +0 -11
- package/dist/types/hooks/useKeepTrackButtons.d.ts +0 -13
- package/dist/types/styles.d.ts +0 -7
- package/dist/types/tests/app-picker.a11y.test.d.ts +0 -1
- package/dist/types/tests/app-picker.data-testid.test.d.ts +0 -1
- package/dist/types/tests/app-picker.events.test.d.ts +0 -1
- package/dist/types/tests/app-picker.exports.test.d.ts +0 -1
- package/dist/types/tests/app-picker.get-owner-props.test.d.ts +0 -1
- package/dist/types/tests/app-picker.keyboard.test.d.ts +0 -1
- package/dist/types/typescript-testing/typescript-app-picker-valid.d.ts +0 -1
- package/dist/types/utils.d.ts +0 -14
|
@@ -0,0 +1,152 @@
|
|
|
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 AppPanel_exports = {};
|
|
30
|
+
__export(AppPanel_exports, {
|
|
31
|
+
AppPanel: () => AppPanel
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(AppPanel_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_ds_grid = require("@elliemae/ds-grid");
|
|
37
|
+
var import_ds_hooks_focus_trap = require("@elliemae/ds-hooks-focus-trap");
|
|
38
|
+
var import_ds_system = require("@elliemae/ds-system");
|
|
39
|
+
var import_react = __toESM(require("react"));
|
|
40
|
+
var import_constants = require("../constants/index.js");
|
|
41
|
+
var import_DSAppPickerCTX = require("../DSAppPickerCTX.js");
|
|
42
|
+
var import_AppSection = require("./AppSection.js");
|
|
43
|
+
var import_shared_styles = require("./shared-styles.js");
|
|
44
|
+
const StyledWrapper = (0, import_ds_system.styled)(import_ds_grid.Grid, { name: import_constants.DSAppPickerName, slot: import_constants.DSAppPickerSlots.ROOT })`
|
|
45
|
+
background-color: ${({ theme }) => theme.colors.neutral["000"]};
|
|
46
|
+
min-width: 308px;
|
|
47
|
+
min-height: 110px;
|
|
48
|
+
max-height: 449px;
|
|
49
|
+
width: 308px;
|
|
50
|
+
overflow-y: auto;
|
|
51
|
+
overflow-x: hidden;
|
|
52
|
+
/* Baseline 2024: reserve scrollbar gutter so the layout doesn't shift between overflow/no-overflow.
|
|
53
|
+
Replaces a JS isOverflow detection effect that toggled right padding. */
|
|
54
|
+
scrollbar-gutter: stable;
|
|
55
|
+
margin: 0;
|
|
56
|
+
padding: 0 0 8px 16px;
|
|
57
|
+
&:focus {
|
|
58
|
+
outline: none;
|
|
59
|
+
}
|
|
60
|
+
`;
|
|
61
|
+
const StyledSeparator = (0, import_ds_system.styled)("hr", { name: import_constants.DSAppPickerName, slot: import_constants.DSAppPickerSlots.SEPARATOR })`
|
|
62
|
+
border-top: 1px solid ${({ theme }) => theme.colors.neutral[300]};
|
|
63
|
+
border-bottom: none;
|
|
64
|
+
width: 100%;
|
|
65
|
+
margin: 8px 0 0 0;
|
|
66
|
+
`;
|
|
67
|
+
const wrapperGridLayout = {
|
|
68
|
+
cols: ["repeat(3, 92px)"],
|
|
69
|
+
// Row tracks are intentionally auto-sized:
|
|
70
|
+
// - title row picks up its own typography height
|
|
71
|
+
// - chip rows expand when `wrapText` causes a chip to wrap onto a second line (Reflow story)
|
|
72
|
+
// - separator row picks up its own 1px height + margin
|
|
73
|
+
rows: ["auto"]
|
|
74
|
+
};
|
|
75
|
+
const useExecOnceAfterFirstRender = (callback) => {
|
|
76
|
+
const hasExecutedRef = import_react.default.useRef(false);
|
|
77
|
+
const executeInitialFocusRef = import_react.default.useRef(callback);
|
|
78
|
+
executeInitialFocusRef.current = callback;
|
|
79
|
+
(0, import_react.useEffect)(() => {
|
|
80
|
+
if (!hasExecutedRef.current) {
|
|
81
|
+
executeInitialFocusRef.current();
|
|
82
|
+
hasExecutedRef.current = true;
|
|
83
|
+
}
|
|
84
|
+
}, []);
|
|
85
|
+
};
|
|
86
|
+
const useMountedOpenAutofocusNuance = ({
|
|
87
|
+
pendingRef,
|
|
88
|
+
triggerIsInternal,
|
|
89
|
+
trackFocusPanel,
|
|
90
|
+
trackFocusFirstItem
|
|
91
|
+
}) => {
|
|
92
|
+
useExecOnceAfterFirstRender(() => {
|
|
93
|
+
if (!pendingRef.current) return;
|
|
94
|
+
pendingRef.current = false;
|
|
95
|
+
if (triggerIsInternal) trackFocusPanel();
|
|
96
|
+
else trackFocusFirstItem();
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
const AppPanelBase = () => {
|
|
100
|
+
const {
|
|
101
|
+
propsWithDefault: { customApps, renderTrigger, onKeyDown },
|
|
102
|
+
ownerPropsConfig,
|
|
103
|
+
globalAttributes,
|
|
104
|
+
xstyledProps,
|
|
105
|
+
mountedOpenAutofocusPendingRef,
|
|
106
|
+
focusTrackers: { focusRegion, firstFocusableRef, lastFocusableRef, trackFocusPanel, trackFocusFirstItem }
|
|
107
|
+
} = (0, import_react.useContext)(import_DSAppPickerCTX.DSAppPickerContext);
|
|
108
|
+
const triggerIsInternal = !renderTrigger;
|
|
109
|
+
const { wrap, onClick, onKeyDown: onKeyDownGlobal, ...safeGlobalAttributes } = globalAttributes;
|
|
110
|
+
useMountedOpenAutofocusNuance({
|
|
111
|
+
pendingRef: mountedOpenAutofocusPendingRef,
|
|
112
|
+
triggerIsInternal,
|
|
113
|
+
trackFocusPanel,
|
|
114
|
+
trackFocusFirstItem
|
|
115
|
+
});
|
|
116
|
+
const isWrapperFocused = focusRegion === import_constants.APP_PICKER_REGION_FOCUSES.PANEL;
|
|
117
|
+
const handleWrapperRef = (0, import_react.useCallback)(
|
|
118
|
+
(node) => {
|
|
119
|
+
if (node && isWrapperFocused) node.focus();
|
|
120
|
+
},
|
|
121
|
+
[isWrapperFocused]
|
|
122
|
+
);
|
|
123
|
+
const handleOnKeyDown = (0, import_ds_hooks_focus_trap.useFocusTrap)({
|
|
124
|
+
firstElementRef: firstFocusableRef,
|
|
125
|
+
lastElementRef: lastFocusableRef,
|
|
126
|
+
onKeyDown
|
|
127
|
+
});
|
|
128
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
129
|
+
StyledWrapper,
|
|
130
|
+
{
|
|
131
|
+
innerRef: handleWrapperRef,
|
|
132
|
+
"data-testid": import_constants.DSAppPickerDataTestIds.ROOT,
|
|
133
|
+
cols: wrapperGridLayout.cols,
|
|
134
|
+
rows: wrapperGridLayout.rows,
|
|
135
|
+
tabIndex: -1,
|
|
136
|
+
...ownerPropsConfig,
|
|
137
|
+
...safeGlobalAttributes,
|
|
138
|
+
...xstyledProps,
|
|
139
|
+
onKeyDown: handleOnKeyDown,
|
|
140
|
+
children: [
|
|
141
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_AppSection.AppSection, {}),
|
|
142
|
+
customApps.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
143
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_shared_styles.StyledListItemFullRow, { "data-testid": import_constants.DSAppPickerDataTestIds.ROW, ...ownerPropsConfig, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledSeparator, { "data-testid": import_constants.DSAppPickerDataTestIds.SEPARATOR, ...ownerPropsConfig }) }),
|
|
144
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_AppSection.AppSection, { isCustomApps: true })
|
|
145
|
+
] })
|
|
146
|
+
]
|
|
147
|
+
}
|
|
148
|
+
);
|
|
149
|
+
};
|
|
150
|
+
const AppPanel = (0, import_react.memo)(AppPanelBase);
|
|
151
|
+
AppPanel.displayName = "DSAppPicker.AppPanel";
|
|
152
|
+
//# sourceMappingURL=AppPanel.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/parts/AppPanel.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { Grid } from '@elliemae/ds-grid';\nimport { useFocusTrap } from '@elliemae/ds-hooks-focus-trap';\nimport { styled } from '@elliemae/ds-system';\nimport React, { memo, useCallback, useContext, useEffect } from 'react';\nimport {\n APP_PICKER_REGION_FOCUSES,\n DSAppPickerDataTestIds,\n DSAppPickerName,\n DSAppPickerSlots,\n} from '../constants/index.js';\nimport { DSAppPickerContext } from '../DSAppPickerCTX.js';\nimport { AppSection } from './AppSection.js';\nimport { StyledListItemFullRow } from './shared-styles.js';\n\nconst StyledWrapper = styled(Grid, { name: DSAppPickerName, slot: DSAppPickerSlots.ROOT })`\n background-color: ${({ theme }) => theme.colors.neutral['000']};\n min-width: 308px;\n min-height: 110px;\n max-height: 449px;\n width: 308px;\n overflow-y: auto;\n overflow-x: hidden;\n /* Baseline 2024: reserve scrollbar gutter so the layout doesn't shift between overflow/no-overflow.\n Replaces a JS isOverflow detection effect that toggled right padding. */\n scrollbar-gutter: stable;\n margin: 0;\n padding: 0 0 8px 16px;\n &:focus {\n outline: none;\n }\n`;\n\nconst StyledSeparator = styled('hr', { name: DSAppPickerName, slot: DSAppPickerSlots.SEPARATOR })`\n border-top: 1px solid ${({ theme }) => theme.colors.neutral[300]};\n border-bottom: none;\n width: 100%;\n margin: 8px 0 0 0;\n`;\n\nconst wrapperGridLayout = {\n cols: ['repeat(3, 92px)'],\n // Row tracks are intentionally auto-sized:\n // - title row picks up its own typography height\n // - chip rows expand when `wrapText` causes a chip to wrap onto a second line (Reflow story)\n // - separator row picks up its own 1px height + margin\n rows: ['auto'],\n};\n\nconst useExecOnceAfterFirstRender = (callback: () => void) => {\n const hasExecutedRef = React.useRef(false);\n const executeInitialFocusRef = React.useRef(callback);\n executeInitialFocusRef.current = callback;\n useEffect(() => {\n if (!hasExecutedRef.current) {\n executeInitialFocusRef.current();\n hasExecutedRef.current = true;\n }\n }, []);\n};\n\ntype MountedOpenAutofocusNuanceConfig = {\n pendingRef: React.MutableRefObject<boolean>;\n triggerIsInternal: boolean;\n trackFocusPanel: () => void;\n trackFocusFirstItem: () => void;\n};\n\n/**\n * NUANCE \u2014 the single case that initial-focus-on-open (useAppPickerFloatingContext's onOpen) cannot\n * cover: DSAppPicker rendered ALREADY open (declarative `isOpen` at mount, no user interaction).\n * That open is not a transition, so `onOpen` never fires for it. This mount-time hook seeds the same\n * initial focus a user-driven open would (panel wrapper for the internal trigger, first item for an\n * external renderTrigger). `pendingRef` is true only when the component started open and is flipped\n * false on first consume, so a later controlled reopen \u2014 a real transition handled by `onOpen` \u2014\n * does not double-seed. Every user-driven open (click/keyboard) is a transition handled by `onOpen`,\n * NOT here.\n *\n * REMOVABILITY: if the team decides declarative-open should not autofocus, delete this hook and its\n * call, and flip the \"rendered already-open \u2026 focuses the panel wrapper\" assertion in\n * DSAppPicker.keyboard.test.js. Nothing else depends on it.\n */\nconst useMountedOpenAutofocusNuance = ({\n pendingRef,\n triggerIsInternal,\n trackFocusPanel,\n trackFocusFirstItem,\n}: MountedOpenAutofocusNuanceConfig) => {\n useExecOnceAfterFirstRender(() => {\n if (!pendingRef.current) return;\n pendingRef.current = false;\n if (triggerIsInternal) trackFocusPanel();\n else trackFocusFirstItem();\n });\n};\n\nconst AppPanelBase = () => {\n const {\n propsWithDefault: { customApps, renderTrigger, onKeyDown },\n ownerPropsConfig,\n globalAttributes,\n xstyledProps,\n mountedOpenAutofocusPendingRef,\n focusTrackers: { focusRegion, firstFocusableRef, lastFocusableRef, trackFocusPanel, trackFocusFirstItem },\n } = useContext(DSAppPickerContext);\n const triggerIsInternal = !renderTrigger;\n\n // Global attributes are spread onto the panel root because there is no shared wrapper that\n // contains both the floating panel and the trigger. `wrap`, `onClick`, and `onKeyDown` are\n // filtered out because they collide with the public component API (which uses these for\n // different semantics).\n const { wrap, onClick, onKeyDown: onKeyDownGlobal, ...safeGlobalAttributes } = globalAttributes;\n\n // ---------------------------------------------------------------------------\n // Initial focus on panel open.\n // ---------------------------------------------------------------------------\n // User-driven opens (click/keyboard) are open transitions, seeded by\n // useAppPickerFloatingContext's onOpen. The one case that isn't a transition \u2014 being rendered\n // already-open (declarative `isOpen` at mount) \u2014 is covered here, scoped to exactly that.\n useMountedOpenAutofocusNuance({\n pendingRef: mountedOpenAutofocusPendingRef,\n triggerIsInternal,\n trackFocusPanel,\n trackFocusFirstItem,\n });\n\n // ---------------------------------------------------------------------------\n // Panel wrapper \u2014 tracker-driven focus for the mouse-open announcement path.\n // handleWrapperRef gets a new reference when isWrapperFocused changes \u2192 React\n // re-invokes the callback with the DOM node \u2192 node.focus() fires.\n // ---------------------------------------------------------------------------\n const isWrapperFocused = focusRegion === APP_PICKER_REGION_FOCUSES.PANEL;\n\n const handleWrapperRef = useCallback(\n (node: HTMLElement | null) => {\n if (node && isWrapperFocused) node.focus();\n },\n [isWrapperFocused],\n );\n\n // Default Escape-close/refocus is handled declaratively by useFloatingContext\n // (see useAppPickerFloatingContext's closeOnEscape/onEscape wiring) whenever there is no consumer\n // onKeyDown \u2014 a consumer-provided onKeyDown takes over keydown handling entirely.\n const handleOnKeyDown = useFocusTrap({\n firstElementRef: firstFocusableRef,\n lastElementRef: lastFocusableRef,\n onKeyDown,\n });\n\n // The panel root carries NO aria-label: it is a roleless element (generic role does not support\n // an accessible name, so any label here is dropped by assistive tech). The component's accessible\n // name lives on the dialog \u2014 see AppPickerContent's role=\"dialog\" + aria-labelledby.\n return (\n <StyledWrapper\n innerRef={handleWrapperRef}\n data-testid={DSAppPickerDataTestIds.ROOT}\n cols={wrapperGridLayout.cols}\n rows={wrapperGridLayout.rows}\n // when opening the dialog via mouse, the focus is programmatically assigned here via handleWrapperRef, -1 allows .focus() to work\n tabIndex={-1}\n {...ownerPropsConfig}\n {...safeGlobalAttributes}\n {...xstyledProps}\n onKeyDown={handleOnKeyDown}\n >\n <AppSection />\n {customApps.length > 0 && (\n <>\n <StyledListItemFullRow data-testid={DSAppPickerDataTestIds.ROW} {...ownerPropsConfig}>\n <StyledSeparator data-testid={DSAppPickerDataTestIds.SEPARATOR} {...ownerPropsConfig} />\n </StyledListItemFullRow>\n <AppSection isCustomApps />\n </>\n )}\n </StyledWrapper>\n );\n};\n\nexport const AppPanel = memo(AppPanelBase);\nAppPanel.displayName = 'DSAppPicker.AppPanel';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["React"]
|
|
7
|
+
}
|
|
@@ -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 AppPickerContent_exports = {};
|
|
30
|
+
__export(AppPickerContent_exports, {
|
|
31
|
+
AppPickerContent: () => AppPickerContent
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(AppPickerContent_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_ds_floating_context = require("@elliemae/ds-floating-context");
|
|
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
|
+
var import_AppPanel = require("../AppPanel.js");
|
|
42
|
+
var import_Trigger = require("../Trigger.js");
|
|
43
|
+
var import_useAppPickerFloatingContext = require("./useAppPickerFloatingContext.js");
|
|
44
|
+
const StyledAppPickerFloating = (0, import_ds_system.styled)(import_ds_floating_context.FloatingWrapper, {
|
|
45
|
+
name: import_constants.DSAppPickerName,
|
|
46
|
+
slot: import_constants.DSAppPickerSlots.FLOATING_WRAPPER
|
|
47
|
+
})``;
|
|
48
|
+
const AppPickerContent = () => {
|
|
49
|
+
const {
|
|
50
|
+
ownerPropsConfig,
|
|
51
|
+
propsWithDefault,
|
|
52
|
+
focusTrackers,
|
|
53
|
+
wasOpenedByKeyboardRef,
|
|
54
|
+
resolvedIsOpen,
|
|
55
|
+
setInternalIsOpen,
|
|
56
|
+
instanceUid
|
|
57
|
+
} = (0, import_react.useContext)(import_DSAppPickerCTX.DSAppPickerContext);
|
|
58
|
+
const { floatingStyles, arrowStyles, floatingContext, floatingInnerRef, handleTriggerRef, handleTriggerClick } = (0, import_useAppPickerFloatingContext.useAppPickerFloatingContext)({
|
|
59
|
+
propsWithDefault,
|
|
60
|
+
focusTrackers,
|
|
61
|
+
wasOpenedByKeyboardRef,
|
|
62
|
+
resolvedIsOpen,
|
|
63
|
+
setInternalIsOpen
|
|
64
|
+
});
|
|
65
|
+
const dialogLabelId = `${instanceUid}-dialog-trigger-btn`;
|
|
66
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
67
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
68
|
+
import_Trigger.Trigger,
|
|
69
|
+
{
|
|
70
|
+
handleTriggerRef,
|
|
71
|
+
handleTriggerClick,
|
|
72
|
+
dialogLabelId
|
|
73
|
+
}
|
|
74
|
+
),
|
|
75
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
76
|
+
StyledAppPickerFloating,
|
|
77
|
+
{
|
|
78
|
+
innerRef: floatingInnerRef,
|
|
79
|
+
isOpen: resolvedIsOpen,
|
|
80
|
+
floatingStyles,
|
|
81
|
+
context: floatingContext,
|
|
82
|
+
getOwnerProps: ownerPropsConfig.getOwnerProps,
|
|
83
|
+
getOwnerPropsArguments: ownerPropsConfig.getOwnerPropsArguments,
|
|
84
|
+
role: "dialog",
|
|
85
|
+
"aria-labelledby": dialogLabelId,
|
|
86
|
+
children: [
|
|
87
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_AppPanel.AppPanel, {}),
|
|
88
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_floating_context.PopoverArrow, { ...arrowStyles })
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
)
|
|
92
|
+
] });
|
|
93
|
+
};
|
|
94
|
+
//# sourceMappingURL=AppPickerContent.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/parts/AppPickerFloatingContext/AppPickerContent.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { FloatingWrapper, PopoverArrow } from '@elliemae/ds-floating-context';\nimport { styled } from '@elliemae/ds-system';\nimport React, { useContext } from 'react';\nimport { DSAppPickerName, DSAppPickerSlots } from '../../constants/index.js';\nimport { DSAppPickerContext } from '../../DSAppPickerCTX.js';\nimport type { DSAppPickerT } from '../../react-desc-prop-types.js';\nimport { AppPanel } from '../AppPanel.js';\nimport { Trigger } from '../Trigger.js';\nimport { useAppPickerFloatingContext } from './useAppPickerFloatingContext.js';\n\nconst StyledAppPickerFloating = styled(FloatingWrapper, {\n name: DSAppPickerName,\n slot: DSAppPickerSlots.FLOATING_WRAPPER,\n})``;\n\nexport const AppPickerContent: React.ComponentType<DSAppPickerT.Props> = () => {\n const {\n ownerPropsConfig,\n propsWithDefault,\n focusTrackers,\n wasOpenedByKeyboardRef,\n resolvedIsOpen,\n setInternalIsOpen,\n instanceUid,\n } = useContext(DSAppPickerContext);\n const { floatingStyles, arrowStyles, floatingContext, floatingInnerRef, handleTriggerRef, handleTriggerClick } =\n useAppPickerFloatingContext({\n propsWithDefault,\n focusTrackers,\n wasOpenedByKeyboardRef,\n resolvedIsOpen,\n setInternalIsOpen,\n });\n\n const dialogLabelId = `${instanceUid}-dialog-trigger-btn`;\n\n return (\n <>\n <Trigger\n handleTriggerRef={handleTriggerRef}\n handleTriggerClick={handleTriggerClick}\n dialogLabelId={dialogLabelId}\n />\n <StyledAppPickerFloating\n innerRef={floatingInnerRef}\n isOpen={resolvedIsOpen}\n floatingStyles={floatingStyles}\n context={floatingContext}\n getOwnerProps={ownerPropsConfig.getOwnerProps}\n getOwnerPropsArguments={ownerPropsConfig.getOwnerPropsArguments}\n role=\"dialog\"\n aria-labelledby={dialogLabelId}\n >\n <AppPanel />\n <PopoverArrow {...arrowStyles} />\n </StyledAppPickerFloating>\n </>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADqCnB;AArCJ,iCAA8C;AAC9C,uBAAuB;AACvB,mBAAkC;AAClC,uBAAkD;AAClD,4BAAmC;AAEnC,sBAAyB;AACzB,qBAAwB;AACxB,yCAA4C;AAE5C,MAAM,8BAA0B,yBAAO,4CAAiB;AAAA,EACtD,MAAM;AAAA,EACN,MAAM,kCAAiB;AACzB,CAAC;AAEM,MAAM,mBAA4D,MAAM;AAC7E,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,yBAAW,wCAAkB;AACjC,QAAM,EAAE,gBAAgB,aAAa,iBAAiB,kBAAkB,kBAAkB,mBAAmB,QAC3G,gEAA4B;AAAA,IAC1B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAEH,QAAM,gBAAgB,GAAG,WAAW;AAEpC,SACE,4EACE;AAAA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,UAAU;AAAA,QACV,QAAQ;AAAA,QACR;AAAA,QACA,SAAS;AAAA,QACT,eAAe,iBAAiB;AAAA,QAChC,wBAAwB,iBAAiB;AAAA,QACzC,MAAK;AAAA,QACL,mBAAiB;AAAA,QAEjB;AAAA,sDAAC,4BAAS;AAAA,UACV,4CAAC,2CAAc,GAAG,aAAa;AAAA;AAAA;AAAA,IACjC;AAAA,KACF;AAEJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
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 useAppPickerFloatingContext_exports = {};
|
|
30
|
+
__export(useAppPickerFloatingContext_exports, {
|
|
31
|
+
useAppPickerFloatingContext: () => useAppPickerFloatingContext
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(useAppPickerFloatingContext_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_ds_floating_context = require("@elliemae/ds-floating-context");
|
|
36
|
+
var import_react = require("react");
|
|
37
|
+
const useAppPickerFloatingContext = (appPickerConfig) => {
|
|
38
|
+
const { propsWithDefault, focusTrackers, wasOpenedByKeyboardRef, resolvedIsOpen, setInternalIsOpen } = appPickerConfig;
|
|
39
|
+
const { onOpen, onClose, actionRef, onClick, onClickOutside, onKeyDown, triggerRef, renderTrigger, isOpen } = propsWithDefault;
|
|
40
|
+
const triggerIsInternal = !renderTrigger;
|
|
41
|
+
const isControlled = typeof isOpen === "boolean";
|
|
42
|
+
const { trackFocusSelectedItem, trackFocusItemAtIndex, trackFocusPanel, trackFocusFirstItem } = focusTrackers;
|
|
43
|
+
const defaultTriggerRef = (0, import_react.useRef)(null);
|
|
44
|
+
const handleClickOutside = (0, import_react.useCallback)(
|
|
45
|
+
(e) => {
|
|
46
|
+
if (!isControlled) onClose?.({ reason: "click-outside", event: e });
|
|
47
|
+
setInternalIsOpen(false);
|
|
48
|
+
onClickOutside?.(e);
|
|
49
|
+
},
|
|
50
|
+
[isControlled, onClose, setInternalIsOpen, onClickOutside]
|
|
51
|
+
);
|
|
52
|
+
const handleScopedEscape = (0, import_react.useCallback)(
|
|
53
|
+
(event) => {
|
|
54
|
+
if (!isControlled) onClose?.({ reason: "escape", event });
|
|
55
|
+
setInternalIsOpen(false);
|
|
56
|
+
},
|
|
57
|
+
[isControlled, onClose, setInternalIsOpen]
|
|
58
|
+
);
|
|
59
|
+
const handleFloatingClose = (0, import_react.useCallback)(
|
|
60
|
+
(info) => {
|
|
61
|
+
if (info.reason === "controlled-flip" && isControlled) onClose?.({ reason: "controlled" });
|
|
62
|
+
},
|
|
63
|
+
[isControlled, onClose]
|
|
64
|
+
);
|
|
65
|
+
const handleFloatingOpen = (0, import_react.useCallback)(
|
|
66
|
+
(info) => {
|
|
67
|
+
if (wasOpenedByKeyboardRef.current && triggerIsInternal) trackFocusSelectedItem();
|
|
68
|
+
else if (triggerIsInternal) trackFocusPanel();
|
|
69
|
+
else trackFocusFirstItem();
|
|
70
|
+
if (info.reason === "controlled-flip" && isControlled) onOpen?.({ reason: "controlled" });
|
|
71
|
+
},
|
|
72
|
+
[
|
|
73
|
+
wasOpenedByKeyboardRef,
|
|
74
|
+
triggerIsInternal,
|
|
75
|
+
trackFocusSelectedItem,
|
|
76
|
+
trackFocusPanel,
|
|
77
|
+
trackFocusFirstItem,
|
|
78
|
+
isControlled,
|
|
79
|
+
onOpen
|
|
80
|
+
]
|
|
81
|
+
);
|
|
82
|
+
const floatingContextConfig = (0, import_react.useMemo)(
|
|
83
|
+
() => ({
|
|
84
|
+
placement: "bottom",
|
|
85
|
+
// Arrow tip is ~6.1px above the panel top (arrowPlacementBase16 ≈ 17.5px, tip at 11.4px from box top).
|
|
86
|
+
// 4px spec gap → 4 + 6.1 ≈ 10px offset.
|
|
87
|
+
customOffset: [0, 10],
|
|
88
|
+
externallyControlledIsOpen: resolvedIsOpen,
|
|
89
|
+
withoutAnimation: true,
|
|
90
|
+
onClickOutside: handleClickOutside,
|
|
91
|
+
// closeOnEscape = !onKeyDown: with a consumer onKeyDown, useFloatingContext neither routes
|
|
92
|
+
// the Escape to onEscape (see handleScopedEscape) nor returns focus to the trigger — the
|
|
93
|
+
// consumer's onKeyDown owns the key entirely.
|
|
94
|
+
closeOnEscape: !onKeyDown,
|
|
95
|
+
onClose: handleFloatingClose,
|
|
96
|
+
onEscape: handleScopedEscape,
|
|
97
|
+
onOpen: handleFloatingOpen,
|
|
98
|
+
returnFocusToReference: true,
|
|
99
|
+
externalReferenceElement: triggerRef?.current || defaultTriggerRef.current
|
|
100
|
+
}),
|
|
101
|
+
[
|
|
102
|
+
handleClickOutside,
|
|
103
|
+
handleScopedEscape,
|
|
104
|
+
handleFloatingClose,
|
|
105
|
+
handleFloatingOpen,
|
|
106
|
+
onKeyDown,
|
|
107
|
+
resolvedIsOpen,
|
|
108
|
+
triggerRef
|
|
109
|
+
]
|
|
110
|
+
);
|
|
111
|
+
const {
|
|
112
|
+
refs: floatingRefs,
|
|
113
|
+
floatingStyles,
|
|
114
|
+
arrowStyles,
|
|
115
|
+
context: floatingContext
|
|
116
|
+
} = (0, import_ds_floating_context.useFloatingContext)(floatingContextConfig);
|
|
117
|
+
const handleTriggerRef = (0, import_react.useCallback)(
|
|
118
|
+
(node) => {
|
|
119
|
+
defaultTriggerRef.current = node;
|
|
120
|
+
floatingRefs.setReference(node);
|
|
121
|
+
if (triggerRef) {
|
|
122
|
+
triggerRef.current = node;
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
[floatingRefs, triggerRef]
|
|
126
|
+
);
|
|
127
|
+
const handleActionRef = (0, import_react.useCallback)(
|
|
128
|
+
(node) => {
|
|
129
|
+
if (node && actionRef?.current) {
|
|
130
|
+
actionRef.current.focusToIndex = (index) => {
|
|
131
|
+
trackFocusItemAtIndex(index);
|
|
132
|
+
};
|
|
133
|
+
actionRef.current.focusWrapper = () => {
|
|
134
|
+
trackFocusPanel();
|
|
135
|
+
};
|
|
136
|
+
actionRef.current.focusSelectedOrFirstAvailable = () => {
|
|
137
|
+
trackFocusSelectedItem();
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
[actionRef, trackFocusItemAtIndex, trackFocusPanel, trackFocusSelectedItem]
|
|
142
|
+
);
|
|
143
|
+
const floatingInnerRef = (0, import_react.useCallback)(
|
|
144
|
+
(node) => {
|
|
145
|
+
floatingRefs.setFloating(node);
|
|
146
|
+
handleActionRef(node);
|
|
147
|
+
},
|
|
148
|
+
[floatingRefs.setFloating, handleActionRef]
|
|
149
|
+
);
|
|
150
|
+
const handleTriggerClick = (0, import_react.useCallback)(
|
|
151
|
+
(e) => {
|
|
152
|
+
wasOpenedByKeyboardRef.current = e.detail === 0;
|
|
153
|
+
onClick?.(e);
|
|
154
|
+
if (!isControlled) {
|
|
155
|
+
if (resolvedIsOpen) onClose?.({ reason: "trigger-toggle", event: e });
|
|
156
|
+
else onOpen?.({ reason: "trigger", event: e });
|
|
157
|
+
}
|
|
158
|
+
setInternalIsOpen((prev) => !prev);
|
|
159
|
+
},
|
|
160
|
+
[onClick, wasOpenedByKeyboardRef, setInternalIsOpen, isControlled, resolvedIsOpen, onClose, onOpen]
|
|
161
|
+
);
|
|
162
|
+
return {
|
|
163
|
+
floatingStyles,
|
|
164
|
+
arrowStyles,
|
|
165
|
+
floatingContext,
|
|
166
|
+
handleTriggerRef,
|
|
167
|
+
handleTriggerClick,
|
|
168
|
+
floatingInnerRef
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
//# sourceMappingURL=useAppPickerFloatingContext.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/parts/AppPickerFloatingContext/useAppPickerFloatingContext.ts", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { useFloatingContext, type DSHookFloatingContextT } from '@elliemae/ds-floating-context';\nimport type React from 'react';\nimport { useCallback, useMemo, useRef } from 'react';\nimport type { useAppPicker } from '../../config/useAppPicker.js';\nimport type { DSAppPickerT } from '../../react-desc-prop-types.js';\n\n/**\n * useAppPickerFloatingContext \u2014 the single point that wires DSAppPicker to\n * `@elliemae/ds-floating-context`'s `useFloatingContext`.\n *\n * WHAT IT DOES (as a black box):\n * AppPicker can be used in two very different ways:\n * - Controlled: the consumer supplies `isOpen` and drives the open/close transition.\n * \u2514\u2192 AppPicker can't be event-based as the flip might originate from any cause and we don't own the business logic\n * \u2514\u2192 we need to ensure WCAG embedded behaviours (focus, Escape, click-outside) are wired to the consumer's `isOpen` flip.\n * - Uncontrolled: the consumer does not supply `isOpen` and AppPicker owns the full flows, we only notify the consumer of the transition and its cause.\n *\n * The AppPicker and this file in particular serves as the one place that coordinates the two different ways to use the component and wires with the useFloatingContext hook.\n * This files owns:\n * - Focus management relative to open/close transitions (initial focus on open, return focus to trigger on close)\n * - Escape key handling (scoped to the panel and trigger)\n * - Click-outside handling (panel and trigger)\n * - Imperative focus API via actionRef\n * - Controlled/Uncontrolled forks and differences in event notification (eager vs controlled-flip)\n * - OnOpen and OnClose notification to the consumer with the correct reason and event (if any)\n *\n * IMPORTANT:\n * Parts of the flow/logic required in this file is offloaded to useFloatingContext internal assumptions and logics.\n * Changes to useFloatingContext may break the flows in this file, or alter them in ways that are not obvious, the two are closely coupled.\n *\n * DATA / EVENT FLOW\n *\n * Two concerns run in parallel and must not be conflated: (A) what makes the panel show/hide and take\n * focus, and (B) how the consumer is told it opened/closed. They have different origins.\n *\n * (A) PANEL VISIBILITY + FOCUS \u2014 useFloatingContext internal co-ownership of the flow.\n *\n * a user action \u2502 \u2502 isOpen prop flip\n * (trigger click / scoped Escape / click outside) \u2502 \u2502 (not a traceable user action, but the consumer's own flip)\n * uncontrolled - flips the internal flag \u2502 \u2502 controlled - AppPicker's own flip is inert, consumer drives it\n * \u2502\n * \u25BC\n * resolvedIsOpen changes\n * \u2502\n * \u25BC\n * useFloatingContext (externallyControlledIsOpen) detects the transition\n * \u2502\n * \u25BC\n * on open \u2502 \u2502 on close\n * handleFloatingOpen \u2502 \u2502 focus is only restored after a SCOPED ESCAPE:\n * AppPicker business logic seeds initial focus \u2502 \u2502 useFloatingContext returns focus to the trigger\n * \u2502 \u2502 (returnFocusToReference). Click-outside / toggle\n * \u2502 \u2502 / controlled closes do NOT move focus, and\n * \u2502 \u2502 handleFloatingClose only NOTIFIES (see (B)).\n * \u2502\n * \u25BC\n * \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n * \u2502 visibility + focus are delivered to final user as expected \u2502\n * \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n *\n * (B) CONSUMER NOTIFICATION\n * Each flow below is the UNCONTROLLED path, where AppPicker owns the transition and can name the true cause.\n * The controlled equivalent for every trigger is stated once at the end.\n * \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n * \u2502 OPENING TRIGGERS FLOWS \u2502\n * \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n * TRIGGER CLICK (uncontrolled)\n * trigger click\n * user clicks the internal trigger, panel closed\n * \u2502\n * \u25BC\n * handleTriggerClick\n * ( flips the flag and wires the visual and focus Flow (A) above )\n * \u2502\n * \u25BC\n * \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n * \u2502 onOpen { reason: 'trigger', event } \u2502 fired EAGERLY, when the event is triggered\n * \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n * ------------------------------------------------------------------------------------------------------------------------\n * \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n * \u2502 CLOSING TRIGGERS FLOWS \u2502\n * \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n * KEYBOARD ESCAPE (uncontrolled)\n * Escape within the panel DOM tree or the trigger\n * scoped Escape (routed only while closeOnEscape, i.e. no consumer onKeyDown)\n * \u2502\n * \u25BC\n * onEscape \u2192 handleScopedEscape\n * ( flips the flag and wires the visual and focus Flow (A) above )\n * \u2502\n * \u25BC\n * \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n * \u2502 onClose { reason: 'escape', event } \u2502 fired EAGERLY, when the event is triggered\n * \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n *\n * CLICK OUTSIDE (uncontrolled)\n * Click outside the panel DOM tree and the trigger\n * useFloatingContext detects a pointer press outside the panel + trigger\n * \u2502\n * \u25BC\n * handleClickOutside\n * ( flips the flag and wires the visual and focus Flow (A) above )\n * \u2502\n * \u25BC\n * \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n * \u2502 onClose { reason: 'click-outside', event } \u2502 fired EAGERLY, when the event is triggered\n * \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n *\n * CLICK ON TRIGGER (uncontrolled, while internal state is open)\n * trigger click while open\n * user clicks the internal trigger, panel open\n * \u2502\n * \u25BC\n * handleTriggerClick\n * ( flips the flag and wires the visual and focus Flow (A) above )\n * \u2502\n * \u25BC\n * \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n * \u2502 onClose { reason: 'trigger-toggle', event } \u2502 fired EAGERLY, when the event is triggered\n * \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n * ------------------------------------------------------------------------------------------------------------------------\n * \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n * \u2502 CONTROLLED OPEN & CLOSE FLOWS \u2502\n * \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n * AppPicker's own flip is inert;\n * We can't fire EAGERLY and we can't track an originating event, there may be NONE\n * The consumer's `isOpen` flip is reacted to by useFloatingContext, which fires onOpen / onClose with reason 'controlled-flip'\n * We wire the visual and focus Flow (A) above, and then notify the consumer with reason 'controlled' (no event)\n * \u2502\n * \u25BC\n * \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n * \u2502 onOpen { reason: 'controlled' } \u2502 no event\n * \u2502 onClose { reason: 'controlled' } \u2502 a prop flip is not a traceable user action\n * \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n * ------------------------------------------------------------------------------------------------------------------------\n *\n * Eager (uncontrolled) and controlled-flip paths are mutually exclusive on `isControlled`.\n * the consumer is notified exactly once per transition \u2014 never twice.\n * On Escape specifically\n * a controlled consumer supplies onKeyDown, so closeOnEscape is false in useFloatingContext\n * \u2514\u2192 AppPicker's onEscape never runs \u2014\n * \u2514\u2192 the close arrives purely by listening to the flag transition\n * ------------------------------------------------------------------------------------------------------------------------\n * A nuance for an edge case:\n *\n * Declarative mount-open (rendered already-open).\n * useFloatingContext fires no onOpen for it (it did not transition to open, it started open),\n * \u2514\u2192 neither the focus-seed (A) nor the notification (B) runs\n * AppPanel compensates this locally via useMountedOpenAutofocusNuance, it needs to be seen if this is even desired or should be removed\n * ------------------------------------------------------------------------------------------------------------------------\n */\n\ntype ConfiguredAppPickerCtx = ReturnType<typeof useAppPicker>;\n\ntype AppPickerFloatingContextConfig = {\n propsWithDefault: DSAppPickerT.InternalProps;\n focusTrackers: ConfiguredAppPickerCtx['focusTrackers'];\n wasOpenedByKeyboardRef: ConfiguredAppPickerCtx['wasOpenedByKeyboardRef'];\n // Open state is owned by useAppPicker (lifted so useFocusTracker can seed focus in the same fiber).\n // This hook reads the resolved value for positioning and flips it through the setter to close/toggle.\n resolvedIsOpen: ConfiguredAppPickerCtx['resolvedIsOpen'];\n setInternalIsOpen: ConfiguredAppPickerCtx['setInternalIsOpen'];\n};\n\nexport const useAppPickerFloatingContext = (appPickerConfig: AppPickerFloatingContextConfig) => {\n const { propsWithDefault, focusTrackers, wasOpenedByKeyboardRef, resolvedIsOpen, setInternalIsOpen } =\n appPickerConfig;\n const { onOpen, onClose, actionRef, onClick, onClickOutside, onKeyDown, triggerRef, renderTrigger, isOpen } =\n propsWithDefault;\n const triggerIsInternal = !renderTrigger;\n // Controlled when the consumer supplies `isOpen`. This decides who owns a transition: uncontrolled,\n // AppPicker's own handlers own it and report the specific event-carrying reason eagerly; controlled,\n // AppPicker's own flips are inert and the consumer drives open/close via the prop (reason 'controlled').\n const isControlled = typeof isOpen === 'boolean';\n\n const { trackFocusSelectedItem, trackFocusItemAtIndex, trackFocusPanel, trackFocusFirstItem } = focusTrackers;\n\n const defaultTriggerRef = useRef<HTMLButtonElement>(null);\n\n // Uncontrolled close \u2014 see file header (B) \"CLICK OUTSIDE\". Also forwards the raw event to onClickOutside.\n const handleClickOutside = useCallback(\n (e: MouseEvent | TouchEvent) => {\n if (!isControlled) onClose?.({ reason: 'click-outside', event: e });\n setInternalIsOpen(false);\n onClickOutside?.(e as MouseEvent);\n },\n [isControlled, onClose, setInternalIsOpen, onClickOutside],\n );\n\n // onEscape target \u2014 see file header (B) \"KEYBOARD ESCAPE\". Scoped Escape only; gated by closeOnEscape\n // (`!onKeyDown`, see the config below).\n const handleScopedEscape = useCallback(\n (event: KeyboardEvent) => {\n if (!isControlled) onClose?.({ reason: 'escape', event });\n setInternalIsOpen(false);\n },\n [isControlled, onClose, setInternalIsOpen],\n );\n\n // Controlled close notify \u2014 see file header \"CONTROLLED OPEN & CLOSE FLOWS\". The guard also filters\n // out a non-scoped Escape, which reaches here as reason 'interaction' (not 'controlled-flip').\n const handleFloatingClose = useCallback(\n (info: DSHookFloatingContextT.OpenChange) => {\n if (info.reason === 'controlled-flip' && isControlled) onClose?.({ reason: 'controlled' });\n },\n [isControlled, onClose],\n );\n\n // Open transition \u2014 see file header (A) (focus) + \"CONTROLLED OPEN & CLOSE FLOWS\" (notify). Seeds\n // initial focus (targets per the CONSUMER CONFIGURATION table) and, when controlled, notifies the\n // consumer. Mount-open is not a transition, so this never fires for it (AppPanel's\n // useMountedOpenAutofocusNuance handles that one case).\n const handleFloatingOpen = useCallback(\n (info: DSHookFloatingContextT.OpenChange) => {\n if (wasOpenedByKeyboardRef.current && triggerIsInternal) trackFocusSelectedItem();\n else if (triggerIsInternal) trackFocusPanel();\n else trackFocusFirstItem();\n if (info.reason === 'controlled-flip' && isControlled) onOpen?.({ reason: 'controlled' });\n },\n [\n wasOpenedByKeyboardRef,\n triggerIsInternal,\n trackFocusSelectedItem,\n trackFocusPanel,\n trackFocusFirstItem,\n isControlled,\n onOpen,\n ],\n );\n\n const floatingContextConfig = useMemo(\n () =>\n ({\n placement: 'bottom',\n // Arrow tip is ~6.1px above the panel top (arrowPlacementBase16 \u2248 17.5px, tip at 11.4px from box top).\n // 4px spec gap \u2192 4 + 6.1 \u2248 10px offset.\n customOffset: [0, 10],\n externallyControlledIsOpen: resolvedIsOpen,\n withoutAnimation: true,\n onClickOutside: handleClickOutside,\n // closeOnEscape = !onKeyDown: with a consumer onKeyDown, useFloatingContext neither routes\n // the Escape to onEscape (see handleScopedEscape) nor returns focus to the trigger \u2014 the\n // consumer's onKeyDown owns the key entirely.\n closeOnEscape: !onKeyDown,\n onClose: handleFloatingClose,\n onEscape: handleScopedEscape,\n onOpen: handleFloatingOpen,\n returnFocusToReference: true,\n externalReferenceElement: triggerRef?.current || defaultTriggerRef.current,\n }) as DSHookFloatingContextT.Props,\n [\n handleClickOutside,\n handleScopedEscape,\n handleFloatingClose,\n handleFloatingOpen,\n onKeyDown,\n resolvedIsOpen,\n triggerRef,\n ],\n );\n\n const {\n refs: floatingRefs,\n floatingStyles,\n arrowStyles,\n context: floatingContext,\n } = useFloatingContext(floatingContextConfig);\n\n const handleTriggerRef = useCallback<React.RefCallback<HTMLButtonElement>>(\n (node) => {\n (defaultTriggerRef as React.MutableRefObject<HTMLButtonElement | null>).current = node;\n floatingRefs.setReference(node);\n if (triggerRef) {\n (triggerRef as React.MutableRefObject<HTMLButtonElement | null>).current = node;\n }\n },\n [floatingRefs, triggerRef],\n );\n\n // Populates the consumer's actionRef with imperative focus methods. Fires on mount with the panel\n // node. Every method routes through the focus tracker \u2014 no DOM queries.\n const handleActionRef = useCallback<React.RefCallback<HTMLDivElement>>(\n (node) => {\n if (node && actionRef?.current) {\n actionRef.current.focusToIndex = (index: number) => {\n trackFocusItemAtIndex(index);\n };\n actionRef.current.focusWrapper = () => {\n trackFocusPanel();\n };\n actionRef.current.focusSelectedOrFirstAvailable = () => {\n trackFocusSelectedItem();\n };\n }\n },\n [actionRef, trackFocusItemAtIndex, trackFocusPanel, trackFocusSelectedItem],\n );\n\n const floatingInnerRef = useCallback<React.RefCallback<HTMLDivElement>>(\n (node) => {\n (floatingRefs.setFloating as React.RefCallback<HTMLDivElement>)(node);\n handleActionRef(node);\n },\n [floatingRefs.setFloating, handleActionRef],\n );\n\n const handleTriggerClick = useCallback(\n (e: React.MouseEvent | React.KeyboardEvent) => {\n // detail === 0 \u21D2 keyboard activation (Enter/Space), not a pointer. handleFloatingOpen reads\n // this on the next open transition to pick keyboard-vs-pointer initial focus.\n wasOpenedByKeyboardRef.current = (e as React.MouseEvent).detail === 0;\n onClick?.(e);\n // Uncontrolled eager notify \u2014 see file header (B) \"TRIGGER CLICK\" / \"CLICK ON TRIGGER\".\n // `resolvedIsOpen` is the pre-flip value: open \u21D2 this click closes (trigger-toggle), else opens.\n if (!isControlled) {\n if (resolvedIsOpen) onClose?.({ reason: 'trigger-toggle', event: e });\n else onOpen?.({ reason: 'trigger', event: e });\n }\n setInternalIsOpen((prev) => !prev);\n },\n [onClick, wasOpenedByKeyboardRef, setInternalIsOpen, isControlled, resolvedIsOpen, onClose, onOpen],\n );\n\n return {\n floatingStyles,\n arrowStyles,\n floatingContext,\n handleTriggerRef,\n handleTriggerClick,\n floatingInnerRef,\n };\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,iCAAgE;AAEhE,mBAA6C;AAkKtC,MAAM,8BAA8B,CAAC,oBAAoD;AAC9F,QAAM,EAAE,kBAAkB,eAAe,wBAAwB,gBAAgB,kBAAkB,IACjG;AACF,QAAM,EAAE,QAAQ,SAAS,WAAW,SAAS,gBAAgB,WAAW,YAAY,eAAe,OAAO,IACxG;AACF,QAAM,oBAAoB,CAAC;AAI3B,QAAM,eAAe,OAAO,WAAW;AAEvC,QAAM,EAAE,wBAAwB,uBAAuB,iBAAiB,oBAAoB,IAAI;AAEhG,QAAM,wBAAoB,qBAA0B,IAAI;AAGxD,QAAM,yBAAqB;AAAA,IACzB,CAAC,MAA+B;AAC9B,UAAI,CAAC,aAAc,WAAU,EAAE,QAAQ,iBAAiB,OAAO,EAAE,CAAC;AAClE,wBAAkB,KAAK;AACvB,uBAAiB,CAAe;AAAA,IAClC;AAAA,IACA,CAAC,cAAc,SAAS,mBAAmB,cAAc;AAAA,EAC3D;AAIA,QAAM,yBAAqB;AAAA,IACzB,CAAC,UAAyB;AACxB,UAAI,CAAC,aAAc,WAAU,EAAE,QAAQ,UAAU,MAAM,CAAC;AACxD,wBAAkB,KAAK;AAAA,IACzB;AAAA,IACA,CAAC,cAAc,SAAS,iBAAiB;AAAA,EAC3C;AAIA,QAAM,0BAAsB;AAAA,IAC1B,CAAC,SAA4C;AAC3C,UAAI,KAAK,WAAW,qBAAqB,aAAc,WAAU,EAAE,QAAQ,aAAa,CAAC;AAAA,IAC3F;AAAA,IACA,CAAC,cAAc,OAAO;AAAA,EACxB;AAMA,QAAM,yBAAqB;AAAA,IACzB,CAAC,SAA4C;AAC3C,UAAI,uBAAuB,WAAW,kBAAmB,wBAAuB;AAAA,eACvE,kBAAmB,iBAAgB;AAAA,UACvC,qBAAoB;AACzB,UAAI,KAAK,WAAW,qBAAqB,aAAc,UAAS,EAAE,QAAQ,aAAa,CAAC;AAAA,IAC1F;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,QAAM,4BAAwB;AAAA,IAC5B,OACG;AAAA,MACC,WAAW;AAAA;AAAA;AAAA,MAGX,cAAc,CAAC,GAAG,EAAE;AAAA,MACpB,4BAA4B;AAAA,MAC5B,kBAAkB;AAAA,MAClB,gBAAgB;AAAA;AAAA;AAAA;AAAA,MAIhB,eAAe,CAAC;AAAA,MAChB,SAAS;AAAA,MACT,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,wBAAwB;AAAA,MACxB,0BAA0B,YAAY,WAAW,kBAAkB;AAAA,IACrE;AAAA,IACF;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,QAAM;AAAA,IACJ,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA,SAAS;AAAA,EACX,QAAI,+CAAmB,qBAAqB;AAE5C,QAAM,uBAAmB;AAAA,IACvB,CAAC,SAAS;AACR,MAAC,kBAAuE,UAAU;AAClF,mBAAa,aAAa,IAAI;AAC9B,UAAI,YAAY;AACd,QAAC,WAAgE,UAAU;AAAA,MAC7E;AAAA,IACF;AAAA,IACA,CAAC,cAAc,UAAU;AAAA,EAC3B;AAIA,QAAM,sBAAkB;AAAA,IACtB,CAAC,SAAS;AACR,UAAI,QAAQ,WAAW,SAAS;AAC9B,kBAAU,QAAQ,eAAe,CAAC,UAAkB;AAClD,gCAAsB,KAAK;AAAA,QAC7B;AACA,kBAAU,QAAQ,eAAe,MAAM;AACrC,0BAAgB;AAAA,QAClB;AACA,kBAAU,QAAQ,gCAAgC,MAAM;AACtD,iCAAuB;AAAA,QACzB;AAAA,MACF;AAAA,IACF;AAAA,IACA,CAAC,WAAW,uBAAuB,iBAAiB,sBAAsB;AAAA,EAC5E;AAEA,QAAM,uBAAmB;AAAA,IACvB,CAAC,SAAS;AACR,MAAC,aAAa,YAAkD,IAAI;AACpE,sBAAgB,IAAI;AAAA,IACtB;AAAA,IACA,CAAC,aAAa,aAAa,eAAe;AAAA,EAC5C;AAEA,QAAM,yBAAqB;AAAA,IACzB,CAAC,MAA8C;AAG7C,6BAAuB,UAAW,EAAuB,WAAW;AACpE,gBAAU,CAAC;AAGX,UAAI,CAAC,cAAc;AACjB,YAAI,eAAgB,WAAU,EAAE,QAAQ,kBAAkB,OAAO,EAAE,CAAC;AAAA,YAC/D,UAAS,EAAE,QAAQ,WAAW,OAAO,EAAE,CAAC;AAAA,MAC/C;AACA,wBAAkB,CAAC,SAAS,CAAC,IAAI;AAAA,IACnC;AAAA,IACA,CAAC,SAAS,wBAAwB,mBAAmB,cAAc,gBAAgB,SAAS,MAAM;AAAA,EACpG;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -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
|
+
}
|