@elliemae/ds-accordion 3.70.0-next.7 → 3.70.0-next.71

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 (41) hide show
  1. package/dist/cjs/constants/index.js +3 -0
  2. package/dist/cjs/constants/index.js.map +2 -2
  3. package/dist/cjs/package.json +1 -4
  4. package/dist/cjs/parts/accordionItem/DSAccordionItem.js +94 -216
  5. package/dist/cjs/parts/accordionItem/DSAccordionItem.js.map +2 -2
  6. package/dist/cjs/parts/accordionItem/ItemCustomActions.js +84 -0
  7. package/dist/cjs/parts/accordionItem/ItemCustomActions.js.map +7 -0
  8. package/dist/cjs/parts/accordionItem/ItemTitle.js +172 -0
  9. package/dist/cjs/parts/accordionItem/ItemTitle.js.map +7 -0
  10. package/dist/cjs/parts/accordionItem/styles.js +69 -14
  11. package/dist/cjs/parts/accordionItem/styles.js.map +2 -2
  12. package/dist/cjs/parts/accordionItem/useAccordionItem.js +4 -2
  13. package/dist/cjs/parts/accordionItem/useAccordionItem.js.map +2 -2
  14. package/dist/esm/constants/index.js +3 -0
  15. package/dist/esm/constants/index.js.map +2 -2
  16. package/dist/esm/package.json +1 -4
  17. package/dist/esm/parts/accordionItem/DSAccordionItem.js +96 -222
  18. package/dist/esm/parts/accordionItem/DSAccordionItem.js.map +2 -2
  19. package/dist/esm/parts/accordionItem/ItemCustomActions.js +54 -0
  20. package/dist/esm/parts/accordionItem/ItemCustomActions.js.map +7 -0
  21. package/dist/esm/parts/accordionItem/ItemTitle.js +142 -0
  22. package/dist/esm/parts/accordionItem/ItemTitle.js.map +7 -0
  23. package/dist/esm/parts/accordionItem/styles.js +69 -14
  24. package/dist/esm/parts/accordionItem/styles.js.map +2 -2
  25. package/dist/esm/parts/accordionItem/useAccordionItem.js +4 -2
  26. package/dist/esm/parts/accordionItem/useAccordionItem.js.map +2 -2
  27. package/dist/types/constants/index.d.ts +4 -0
  28. package/dist/types/parts/accordionItem/ItemCustomActions.d.ts +14 -0
  29. package/dist/types/parts/accordionItem/ItemTitle.d.ts +23 -0
  30. package/dist/types/parts/accordionItem/styles.d.ts +6 -4
  31. package/dist/types/parts/accordionItem/useAccordionItem.d.ts +1 -0
  32. package/package.json +14 -14
  33. package/dist/types/tests/DSAccordion.a11y.test.d.ts +0 -1
  34. package/dist/types/tests/DSAccordion.callback.test.d.ts +0 -1
  35. package/dist/types/tests/DSAccordion.data-testid.test.d.ts +0 -1
  36. package/dist/types/tests/DSAccordion.events.test.d.ts +0 -1
  37. package/dist/types/tests/DSAccordion.exports.test.d.ts +0 -1
  38. package/dist/types/tests/DSAccordion.get-owner-props.test.d.ts +0 -1
  39. package/dist/types/tests/DSAccordion.keyboard.test.d.ts +0 -1
  40. package/dist/types/tests/DSAccordion.test.d.ts +0 -1
  41. package/dist/types/typescript-testing/typescript-accordion-valid.d.ts +0 -1
@@ -46,6 +46,9 @@ const ACCORDION_SLOTS = {
46
46
  const DSAccordionSlots = ACCORDION_SLOTS;
47
47
  const ACCORDION_ITEM_SLOTS = {
48
48
  ITEM_CONTAINER: "item-container",
49
+ // additive slot: wraps the summary + content as a native <details> disclosure.
50
+ // New in the native-engine migration — not a breaking change (did not exist before).
51
+ ITEM_DETAILS: "item-details",
49
52
  ITEM_HEADER_CONTAINER: "item-header-container",
50
53
  ITEM_HEADER: "item-header",
51
54
  ITEM_HEADER_ADDON: "item-header-addon",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/constants/index.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSAccordionName = 'DSAccordion';\n\n// we are naming this with the ${component_name}_slots convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const ACCORDION_SLOTS = {\n CONTAINER: 'root',\n} as const;\nexport const DSAccordionSlots = ACCORDION_SLOTS;\n\nexport const ACCORDION_ITEM_SLOTS = {\n ITEM_CONTAINER: 'item-container',\n ITEM_HEADER_CONTAINER: 'item-header-container',\n ITEM_HEADER: 'item-header',\n ITEM_HEADER_ADDON: 'item-header-addon',\n ITEM_HEADER_TITLE_CONTAINER: 'item-header-titles-container',\n ITEM_HEADER_PRIMARY_TITLE: 'item-header-primary-title',\n ITEM_HEADER_SECONDARY_TITLE: 'item-header-secondary-title',\n ITEM_HEADER_CUSTOM_ACTIONS_CONTAINER: 'item-header-custom-actions-container',\n ITEM_HEADER_TOOLTIP: 'item-header-tooltip',\n ITEM_CONTENT_CONTAINER: 'item-content-container',\n} as const;\nexport const DSAccordionItemSlots = ACCORDION_ITEM_SLOTS;\n\n// we are naming this with the ${component_name}_data_testid convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const ACCORDION_DATA_TESTID = {\n ...slotObjectToDataTestIds(DSAccordionName, ACCORDION_SLOTS),\n ...slotObjectToDataTestIds(DSAccordionName, ACCORDION_ITEM_SLOTS),\n ITEM_CONTENT_CONTAINER: 'ds-accordion_item-content',\n ITEM_HEADER: 'ds-accordion_item-header',\n ITEM_CONTAINER: 'ds-accordion_item',\n CONTAINER: 'ds-accordion_group',\n};\nexport const DSAccordionDataTestid = ACCORDION_DATA_TESTID;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAwC;AAEjC,MAAM,kBAAkB;AAGxB,MAAM,kBAAkB;AAAA,EAC7B,WAAW;AACb;AACO,MAAM,mBAAmB;AAEzB,MAAM,uBAAuB;AAAA,EAClC,gBAAgB;AAAA,EAChB,uBAAuB;AAAA,EACvB,aAAa;AAAA,EACb,mBAAmB;AAAA,EACnB,6BAA6B;AAAA,EAC7B,2BAA2B;AAAA,EAC3B,6BAA6B;AAAA,EAC7B,sCAAsC;AAAA,EACtC,qBAAqB;AAAA,EACrB,wBAAwB;AAC1B;AACO,MAAM,uBAAuB;AAG7B,MAAM,wBAAwB;AAAA,EACnC,OAAG,0CAAwB,iBAAiB,eAAe;AAAA,EAC3D,OAAG,0CAAwB,iBAAiB,oBAAoB;AAAA,EAChE,wBAAwB;AAAA,EACxB,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,WAAW;AACb;AACO,MAAM,wBAAwB;",
4
+ "sourcesContent": ["import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSAccordionName = 'DSAccordion';\n\n// we are naming this with the ${component_name}_slots convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const ACCORDION_SLOTS = {\n CONTAINER: 'root',\n} as const;\nexport const DSAccordionSlots = ACCORDION_SLOTS;\n\nexport const ACCORDION_ITEM_SLOTS = {\n ITEM_CONTAINER: 'item-container',\n // additive slot: wraps the summary + content as a native <details> disclosure.\n // New in the native-engine migration \u2014 not a breaking change (did not exist before).\n ITEM_DETAILS: 'item-details',\n ITEM_HEADER_CONTAINER: 'item-header-container',\n ITEM_HEADER: 'item-header',\n ITEM_HEADER_ADDON: 'item-header-addon',\n ITEM_HEADER_TITLE_CONTAINER: 'item-header-titles-container',\n ITEM_HEADER_PRIMARY_TITLE: 'item-header-primary-title',\n ITEM_HEADER_SECONDARY_TITLE: 'item-header-secondary-title',\n ITEM_HEADER_CUSTOM_ACTIONS_CONTAINER: 'item-header-custom-actions-container',\n ITEM_HEADER_TOOLTIP: 'item-header-tooltip',\n ITEM_CONTENT_CONTAINER: 'item-content-container',\n} as const;\nexport const DSAccordionItemSlots = ACCORDION_ITEM_SLOTS;\n\n// we are naming this with the ${component_name}_data_testid convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const ACCORDION_DATA_TESTID = {\n ...slotObjectToDataTestIds(DSAccordionName, ACCORDION_SLOTS),\n ...slotObjectToDataTestIds(DSAccordionName, ACCORDION_ITEM_SLOTS),\n ITEM_CONTENT_CONTAINER: 'ds-accordion_item-content',\n ITEM_HEADER: 'ds-accordion_item-header',\n ITEM_CONTAINER: 'ds-accordion_item',\n CONTAINER: 'ds-accordion_group',\n};\nexport const DSAccordionDataTestid = ACCORDION_DATA_TESTID;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAwC;AAEjC,MAAM,kBAAkB;AAGxB,MAAM,kBAAkB;AAAA,EAC7B,WAAW;AACb;AACO,MAAM,mBAAmB;AAEzB,MAAM,uBAAuB;AAAA,EAClC,gBAAgB;AAAA;AAAA;AAAA,EAGhB,cAAc;AAAA,EACd,uBAAuB;AAAA,EACvB,aAAa;AAAA,EACb,mBAAmB;AAAA,EACnB,6BAA6B;AAAA,EAC7B,2BAA2B;AAAA,EAC3B,6BAA6B;AAAA,EAC7B,sCAAsC;AAAA,EACtC,qBAAqB;AAAA,EACrB,wBAAwB;AAC1B;AACO,MAAM,uBAAuB;AAG7B,MAAM,wBAAwB;AAAA,EACnC,OAAG,0CAAwB,iBAAiB,eAAe;AAAA,EAC3D,OAAG,0CAAwB,iBAAiB,oBAAoB;AAAA,EAChE,wBAAwB;AAAA,EACxB,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,WAAW;AACb;AACO,MAAM,wBAAwB;",
6
6
  "names": []
7
7
  }
@@ -3,8 +3,5 @@
3
3
  "sideEffects": [
4
4
  "*.css",
5
5
  "*.scss"
6
- ],
7
- "publishConfig": {
8
- "access": "public"
9
- }
6
+ ]
10
7
  }
@@ -35,8 +35,6 @@ __export(DSAccordionItem_exports, {
35
35
  module.exports = __toCommonJS(DSAccordionItem_exports);
36
36
  var React = __toESM(require("react"));
37
37
  var import_jsx_runtime = require("react/jsx-runtime");
38
- var import_ds_button_v2 = require("@elliemae/ds-button-v2");
39
- var import_ds_grid = require("@elliemae/ds-grid");
40
38
  var import_ds_floating_context = require("@elliemae/ds-floating-context");
41
39
  var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
42
40
  var import_ds_system = require("@elliemae/ds-system");
@@ -45,6 +43,8 @@ var import_DSAccordionCTX = require("../../DSAccordionCTX.js");
45
43
  var import_constants = require("../../constants/index.js");
46
44
  var import_defaultProps = require("../../defaultProps.js");
47
45
  var import_react_desc_prop_types = require("../../react-desc-prop-types.js");
46
+ var import_ItemCustomActions = require("./ItemCustomActions.js");
47
+ var import_ItemTitle = require("./ItemTitle.js");
48
48
  var import_styles = require("./styles.js");
49
49
  var import_useAccordionItem = require("./useAccordionItem.js");
50
50
  var import_useIsShowingEllipsis = require("./useIsShowingEllipsis.js");
@@ -74,7 +74,7 @@ const DSAccordionItem = (props) => {
74
74
  wrapLabel,
75
75
  ...rest
76
76
  } = propsWithDefaults;
77
- const { handleOnClick, handleOnKeyDown, selected } = (0, import_useAccordionItem.useAccordionItem)({ value, disabled, applyAriaDisabled });
77
+ const { handleOnKeyDown, toggle, selected } = (0, import_useAccordionItem.useAccordionItem)({ value, disabled, applyAriaDisabled });
78
78
  const xstyledAttrs = (0, import_ds_props_helpers.useGetXstyledProps)(rest);
79
79
  const xstyledContentAttrs = (0, import_ds_props_helpers.useGetXstyledProps)(xStyledPropsContent);
80
80
  const {
@@ -84,49 +84,6 @@ const DSAccordionItem = (props) => {
84
84
  } = (0, import_react.useContext)(import_DSAccordionCTX.DSAccordionContext);
85
85
  const [showPopover, setShowPopover] = (0, import_react.useState)(false);
86
86
  const [referenceElement, setReferenceElement] = (0, import_react.useState)(null);
87
- const CustomActionsContent = (0, import_react.useMemo)(() => {
88
- if (!isDSMobile && customActions?.length > 0)
89
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
90
- import_styles.StyledItemCustomActions,
91
- {
92
- isDSMobile,
93
- getOwnerProps,
94
- getOwnerPropsArguments,
95
- children: customActions?.map(({ onClick, id, ...otherProps }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
96
- import_ds_button_v2.DSButtonV2,
97
- {
98
- onClick: (e) => {
99
- e.stopPropagation();
100
- if (onClick) onClick(e);
101
- },
102
- ...otherProps,
103
- buttonType: import_ds_button_v2.BUTTON_TYPES.OUTLINE
104
- },
105
- id
106
- ))
107
- }
108
- );
109
- if (!isDSMobile && (renderCustomActions || CustomActions))
110
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
111
- import_styles.StyledItemCustomActions,
112
- {
113
- isDSMobile,
114
- getOwnerProps,
115
- getOwnerPropsArguments,
116
- children: CustomActions !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CustomActions, { allRefs: allChildrenReferences, actualActiveValue }) : renderCustomActions?.({ allRefs: allChildrenReferences, actualActiveValue })
117
- }
118
- );
119
- return null;
120
- }, [
121
- CustomActions,
122
- actualActiveValue,
123
- allChildrenReferences,
124
- customActions,
125
- getOwnerProps,
126
- getOwnerPropsArguments,
127
- isDSMobile,
128
- renderCustomActions
129
- ]);
130
87
  const { isShowingEllipsis: isPrimaryShowingEllipsis, setElement: setPrimaryElement } = (0, import_useIsShowingEllipsis.useIsShowingEllipsis)();
131
88
  const { isShowingEllipsis: isSecondaryShowingEllipsis, setElement: setSecondaryElement } = (0, import_useIsShowingEllipsis.useIsShowingEllipsis)();
132
89
  const isTooltipOpen = !selected && showPopover;
@@ -138,17 +95,33 @@ const DSAccordionItem = (props) => {
138
95
  isOpen: isFloatingOpen
139
96
  } = (0, import_ds_floating_context.useFloatingContext)({
140
97
  externallyControlledIsOpen: isTooltipOpen,
98
+ externalReferenceElement: referenceElement,
141
99
  withoutAnimation: true,
142
100
  customOffset: [0, 14]
143
101
  });
144
- (0, import_react.useEffect)(() => {
145
- floatingRefs.setReference(referenceElement);
146
- }, [referenceElement, floatingRefs]);
147
- const onKeyDownWithIndex = (0, import_react.useCallback)(
102
+ const handleSummaryClick = (0, import_react.useCallback)(
148
103
  (e) => {
104
+ e.preventDefault();
105
+ toggle(e);
106
+ },
107
+ [toggle]
108
+ );
109
+ const handleSummaryKeyDown = (0, import_react.useCallback)(
110
+ (e) => {
111
+ if (e.key === "Enter" || e.key === " ") {
112
+ e.preventDefault();
113
+ toggle(e);
114
+ return;
115
+ }
149
116
  handleOnKeyDown(e, dsIndex);
150
117
  },
151
- [dsIndex, handleOnKeyDown]
118
+ [toggle, handleOnKeyDown, dsIndex]
119
+ );
120
+ const handleSummaryMouseDown = (0, import_react.useCallback)(
121
+ (e) => {
122
+ if (disabled) e.preventDefault();
123
+ },
124
+ [disabled]
152
125
  );
153
126
  const handleOnFocus = (0, import_react.useCallback)(
154
127
  () => setShowPopover(isPrimaryShowingEllipsis || isSecondaryShowingEllipsis),
@@ -156,196 +129,89 @@ const DSAccordionItem = (props) => {
156
129
  );
157
130
  const handleOnBlur = (0, import_react.useCallback)(() => setShowPopover(false), []);
158
131
  const { className, ...globalAttrs } = (0, import_ds_props_helpers.useGetGlobalAttributes)(rest, {
159
- onClick: handleOnClick,
132
+ onClick: handleSummaryClick,
160
133
  onFocus: handleOnFocus,
161
134
  onBlur: handleOnBlur
162
135
  });
163
136
  const handlers = {
164
- onClick: handleOnClick,
137
+ onClick: handleSummaryClick,
138
+ onKeyDown: handleSummaryKeyDown,
139
+ onMouseDown: handleSummaryMouseDown,
165
140
  onFocus: handleOnFocus,
166
141
  onBlur: handleOnBlur
167
142
  };
168
- const titleDesktop = (0, import_react.useMemo)(
169
- () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
170
- import_ds_grid.Grid,
171
- {
172
- onMouseEnter: handleOnFocus,
173
- onMouseLeave: handleOnBlur,
174
- cols: ["auto", "1fr"],
175
- padding: "6px 0px",
176
- marginRight: "20px",
177
- width: "100%",
178
- children: [
179
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
180
- import_styles.StyledItemAddon,
181
- {
182
- disabled,
183
- applyAriaDisabled,
184
- getOwnerProps,
185
- getOwnerPropsArguments,
186
- children: selected ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IconOpened, {}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IconClosed, {})
187
- }
188
- ),
189
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ds_grid.Grid, { rows: secondaryTitle ? ["auto", "auto"] : ["auto"], rowGap: secondaryTitle ? "3px" : "0px", children: [
190
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
191
- import_styles.StyledItemTitles,
192
- {
193
- withSecondaryTitle: secondaryTitle,
194
- selected,
195
- getOwnerProps,
196
- getOwnerPropsArguments,
197
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
198
- import_styles.StyledPrimaryTitle,
199
- {
200
- innerRef: setPrimaryElement,
201
- ...title ? { id: `accordion_${title || ""}id-${value}` } : void 0,
202
- disabled,
203
- applyAriaDisabled,
204
- selected,
205
- withSecondaryTitle: Boolean(secondaryTitle),
206
- getOwnerProps,
207
- getOwnerPropsArguments,
208
- wrapLabel,
209
- children: title
210
- }
211
- )
212
- }
213
- ),
214
- secondaryTitle && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
215
- import_styles.StyledSecondaryTitle,
216
- {
217
- innerRef: setSecondaryElement,
218
- disabled,
219
- applyAriaDisabled,
220
- selected,
221
- getOwnerProps,
222
- getOwnerPropsArguments,
223
- wrapLabel,
224
- children: secondaryTitle
225
- }
226
- )
227
- ] })
228
- ]
229
- }
230
- ),
231
- [
232
- handleOnFocus,
233
- handleOnBlur,
234
- secondaryTitle,
235
- disabled,
236
- applyAriaDisabled,
237
- getOwnerProps,
238
- getOwnerPropsArguments,
239
- selected,
240
- IconOpened,
241
- IconClosed,
242
- setPrimaryElement,
243
- title,
244
- value,
245
- wrapLabel,
246
- setSecondaryElement
247
- ]
248
- );
249
- const titleMobile = (0, import_react.useMemo)(
250
- () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_grid.Grid, { width: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ds_grid.Grid, { cols: ["auto", "20px"], children: [
251
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
252
- import_styles.StyledItemTitles,
253
- {
254
- onMouseEnter: handleOnFocus,
255
- onMouseLeave: handleOnBlur,
256
- isDSMobile: true,
257
- withSecondaryTitle: secondaryTitle,
258
- selected,
259
- getOwnerProps,
260
- getOwnerPropsArguments,
261
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
262
- import_styles.StyledPrimaryTitle,
263
- {
264
- innerRef: setPrimaryElement,
265
- ...title ? { id: `accordion_${title || ""}id` } : void 0,
266
- disabled,
267
- applyAriaDisabled,
268
- isDSMobile: true,
269
- selected,
270
- withSecondaryTitle: Boolean(secondaryTitle),
271
- getOwnerProps,
272
- getOwnerPropsArguments,
273
- wrapLabel,
274
- children: title
275
- }
276
- )
277
- }
278
- ),
279
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
280
- import_styles.StyledItemAddon,
281
- {
282
- disabled,
283
- applyAriaDisabled,
284
- isDSMobile: true,
285
- getOwnerProps,
286
- getOwnerPropsArguments,
287
- children: selected ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IconOpened, { isDSMobile: true }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IconClosed, { isDSMobile: true })
288
- }
289
- )
290
- ] }) }),
291
- [
292
- handleOnFocus,
293
- handleOnBlur,
294
- secondaryTitle,
295
- selected,
296
- getOwnerProps,
297
- getOwnerPropsArguments,
298
- setPrimaryElement,
299
- title,
300
- disabled,
301
- applyAriaDisabled,
302
- wrapLabel,
303
- IconOpened,
304
- IconClosed
305
- ]
306
- );
143
+ const headerId = `ds-accordion-header-${value}`;
144
+ const contentId = `ds-accordion-content-${value}`;
145
+ const withCustomActions = (customActions?.length > 0 || renderCustomActions !== void 0 || CustomActions !== void 0) && !isDSMobile;
307
146
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
308
147
  import_styles.StyledItemContainer,
309
148
  {
310
149
  "data-testid": import_constants.DSAccordionDataTestid.ITEM_CONTAINER,
311
150
  className,
312
151
  ...xstyledAttrs,
152
+ disabled,
153
+ applyAriaDisabled,
313
154
  getOwnerProps,
314
155
  getOwnerPropsArguments,
315
156
  children: [
316
157
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
317
- import_styles.StyledItemHeaderContainer,
158
+ import_styles.StyledItemDetails,
318
159
  {
319
- disabled,
320
- applyAriaDisabled,
321
- innerRef: (HTMLNode) => setReferenceElement(HTMLNode ?? null),
160
+ open: selected,
161
+ "data-testid": import_constants.DSAccordionDataTestid.ITEM_DETAILS,
322
162
  getOwnerProps,
323
163
  getOwnerPropsArguments,
324
164
  children: [
325
165
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
326
166
  import_styles.StyledItemHeader,
327
167
  {
328
- withCustomActions: (customActions?.length > 0 || renderCustomActions !== void 0) && !isDSMobile,
168
+ withCustomActions,
329
169
  withSecondaryTitle: secondaryTitle,
330
- tabIndex: !disabled ? 0 : void 0,
170
+ tabIndex: disabled ? -1 : 0,
331
171
  disabled,
332
172
  "data-disabled": disabled,
333
173
  innerRef: (0, import_ds_system.mergeRefs)(allChildrenReferences[dsIndex], innerRef),
334
- onKeyDown: onKeyDownWithIndex,
335
174
  isDSMobile,
336
175
  "data-testid": import_constants.DSAccordionDataTestid.ITEM_HEADER,
337
- id: `ds-accordion-header-${value}`,
176
+ id: headerId,
338
177
  "aria-expanded": selected,
339
178
  "aria-disabled": disabled || applyAriaDisabled,
340
179
  applyAriaDisabled,
341
- "aria-controls": `ds-accordion-content-${value}`,
180
+ "aria-controls": contentId,
342
181
  ...handlers,
343
182
  ...globalAttrs,
344
- type: "button",
345
183
  getOwnerProps,
346
184
  getOwnerPropsArguments,
347
185
  children: [
348
- isDSMobile ? titleMobile : titleDesktop,
186
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
187
+ import_styles.StyledItemHeaderContainer,
188
+ {
189
+ innerRef: (HTMLNode) => setReferenceElement(HTMLNode ?? null),
190
+ getOwnerProps,
191
+ getOwnerPropsArguments,
192
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
193
+ import_ItemTitle.ItemTitle,
194
+ {
195
+ title,
196
+ secondaryTitle,
197
+ value,
198
+ selected,
199
+ disabled,
200
+ applyAriaDisabled,
201
+ wrapLabel,
202
+ isDSMobile,
203
+ IconOpened,
204
+ IconClosed,
205
+ onMouseEnter: handleOnFocus,
206
+ onMouseLeave: handleOnBlur,
207
+ setPrimaryElement,
208
+ setSecondaryElement,
209
+ getOwnerProps,
210
+ getOwnerPropsArguments
211
+ }
212
+ )
213
+ }
214
+ ),
349
215
  wrapLabel ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
350
216
  import_ds_floating_context.FloatingWrapper,
351
217
  {
@@ -368,25 +234,37 @@ const DSAccordionItem = (props) => {
368
234
  ]
369
235
  }
370
236
  ),
371
- CustomActionsContent
237
+ (selected || keepContentMounted) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
238
+ import_styles.StyledItemContent,
239
+ {
240
+ "data-testid": import_constants.DSAccordionDataTestid.ITEM_CONTENT_CONTAINER,
241
+ "aria-labelledby": headerId,
242
+ role: "region",
243
+ isDSMobile,
244
+ id: contentId,
245
+ ...xstyledContentAttrs,
246
+ selected,
247
+ keepContentMounted,
248
+ applyAriaDisabled,
249
+ getOwnerProps,
250
+ getOwnerPropsArguments,
251
+ children
252
+ }
253
+ )
372
254
  ]
373
255
  }
374
256
  ),
375
- (selected || keepContentMounted) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
376
- import_styles.StyledItemContent,
257
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
258
+ import_ItemCustomActions.ItemCustomActions,
377
259
  {
378
- "data-testid": import_constants.DSAccordionDataTestid.ITEM_CONTENT_CONTAINER,
379
- "aria-labelledby": `ds-accordion-header-${value}`,
380
- role: "region",
260
+ customActions,
261
+ renderCustomActions,
262
+ CustomActionsComponent: CustomActions,
381
263
  isDSMobile,
382
- id: `ds-accordion-content-${value}`,
383
- ...xstyledContentAttrs,
384
- selected,
385
- keepContentMounted,
386
- applyAriaDisabled,
264
+ allRefs: allChildrenReferences,
265
+ actualActiveValue,
387
266
  getOwnerProps,
388
- getOwnerPropsArguments,
389
- children
267
+ getOwnerPropsArguments
390
268
  }
391
269
  )
392
270
  ]
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/parts/accordionItem/DSAccordionItem.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable max-statements */\n/* eslint-disable max-lines */\nimport { BUTTON_TYPES, DSButtonV2 } from '@elliemae/ds-button-v2';\nimport { Grid } from '@elliemae/ds-grid';\nimport { useFloatingContext, FloatingWrapper, PopoverArrow } from '@elliemae/ds-floating-context';\nimport {\n describe,\n useGetGlobalAttributes,\n useGetXstyledProps,\n useMemoMergePropsWithDefault,\n type ValidationMap,\n} from '@elliemae/ds-props-helpers';\nimport { mergeRefs } from '@elliemae/ds-system';\nimport React, { useCallback, useContext, useEffect, useMemo, useState } from 'react';\nimport { DSAccordionContext } from '../../DSAccordionCTX.js';\nimport { DSAccordionDataTestid } from '../../constants/index.js';\nimport { accordionItemDefaultProps } from '../../defaultProps.js';\nimport type { DSAccordionT } from '../../react-desc-prop-types.js';\nimport { accordionItemPropTypes } from '../../react-desc-prop-types.js';\nimport {\n StyledItemAddon,\n StyledItemContainer,\n StyledItemContent,\n StyledItemCustomActions,\n StyledItemHeader,\n StyledItemHeaderContainer,\n StyledItemTitles,\n StyledPrimaryTitle,\n StyledSecondaryTitle,\n StyledTooltipContent,\n} from './styles.js';\nimport { useAccordionItem } from './useAccordionItem.js';\nimport { useIsShowingEllipsis } from './useIsShowingEllipsis.js';\n\nconst DSAccordionItem = (props: DSAccordionT.ItemProps): JSX.Element => {\n const propsWithDefaults = useMemoMergePropsWithDefault(\n props,\n accordionItemDefaultProps,\n ) as DSAccordionT.InternalItemProps;\n\n const getOwnerProps = useCallback(() => props, [props]);\n const getOwnerPropsArguments = useCallback(() => ({}), []);\n\n const {\n children,\n title,\n secondaryTitle,\n customActions,\n iconOpened: IconOpened,\n iconClosed: IconClosed,\n value,\n disabled,\n dsIndex,\n renderCustomActions,\n CustomActions,\n xStyledPropsContent,\n keepContentMounted,\n innerRef,\n applyAriaDisabled,\n wrapLabel,\n ...rest\n } = propsWithDefaults;\n\n const { handleOnClick, handleOnKeyDown, selected } = useAccordionItem({ value, disabled, applyAriaDisabled });\n\n const xstyledAttrs = useGetXstyledProps(rest);\n const xstyledContentAttrs = useGetXstyledProps(xStyledPropsContent);\n\n const {\n allChildrenReferences,\n actualActiveValue,\n props: { isDSMobile },\n } = useContext(DSAccordionContext);\n\n const [showPopover, setShowPopover] = useState(false);\n const [referenceElement, setReferenceElement] = useState<HTMLElement | null>(null);\n\n const CustomActionsContent = useMemo(() => {\n if (!isDSMobile && customActions?.length > 0)\n return (\n <StyledItemCustomActions\n isDSMobile={isDSMobile}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {customActions?.map(({ onClick, id, ...otherProps }) => (\n <DSButtonV2\n key={id}\n onClick={(e: React.MouseEvent<HTMLElement, MouseEvent> | React.KeyboardEvent<HTMLElement>): void => {\n e.stopPropagation();\n if (onClick) onClick(e as React.MouseEvent<HTMLElement, MouseEvent>);\n }}\n {...otherProps}\n buttonType={BUTTON_TYPES.OUTLINE}\n />\n ))}\n </StyledItemCustomActions>\n );\n\n if (!isDSMobile && (renderCustomActions || CustomActions))\n return (\n <StyledItemCustomActions\n isDSMobile={isDSMobile}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {CustomActions !== undefined ? (\n <CustomActions allRefs={allChildrenReferences} actualActiveValue={actualActiveValue} />\n ) : (\n renderCustomActions?.({ allRefs: allChildrenReferences, actualActiveValue })\n )}\n </StyledItemCustomActions>\n );\n return null;\n }, [\n CustomActions,\n actualActiveValue,\n allChildrenReferences,\n customActions,\n getOwnerProps,\n getOwnerPropsArguments,\n isDSMobile,\n renderCustomActions,\n ]);\n\n const { isShowingEllipsis: isPrimaryShowingEllipsis, setElement: setPrimaryElement } = useIsShowingEllipsis();\n\n const { isShowingEllipsis: isSecondaryShowingEllipsis, setElement: setSecondaryElement } = useIsShowingEllipsis();\n\n const isTooltipOpen = !selected && showPopover;\n const {\n refs: floatingRefs,\n floatingStyles,\n arrowStyles,\n context: floatingContext,\n isOpen: isFloatingOpen,\n } = useFloatingContext({\n externallyControlledIsOpen: isTooltipOpen,\n withoutAnimation: true,\n customOffset: [0, 14],\n });\n useEffect(() => {\n floatingRefs.setReference(referenceElement);\n }, [referenceElement, floatingRefs]);\n\n const onKeyDownWithIndex = useCallback(\n (e: React.KeyboardEvent) => {\n handleOnKeyDown(e, dsIndex);\n },\n [dsIndex, handleOnKeyDown],\n );\n const handleOnFocus = useCallback(\n () => setShowPopover(isPrimaryShowingEllipsis || isSecondaryShowingEllipsis),\n [isPrimaryShowingEllipsis, isSecondaryShowingEllipsis],\n );\n\n const handleOnBlur = useCallback(() => setShowPopover(false), []);\n\n const { className, ...globalAttrs } = useGetGlobalAttributes(rest, {\n onClick: handleOnClick,\n onFocus: handleOnFocus,\n onBlur: handleOnBlur,\n });\n\n const handlers = {\n onClick: handleOnClick,\n onFocus: handleOnFocus,\n onBlur: handleOnBlur,\n };\n\n const titleDesktop = useMemo(\n () => (\n <Grid\n onMouseEnter={handleOnFocus}\n onMouseLeave={handleOnBlur}\n cols={['auto', '1fr']}\n padding=\"6px 0px\"\n marginRight=\"20px\"\n width=\"100%\"\n >\n <StyledItemAddon\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {selected ? <IconOpened /> : <IconClosed />}\n </StyledItemAddon>\n <Grid rows={secondaryTitle ? ['auto', 'auto'] : ['auto']} rowGap={secondaryTitle ? '3px' : '0px'}>\n <StyledItemTitles\n withSecondaryTitle={secondaryTitle}\n selected={selected}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledPrimaryTitle\n innerRef={setPrimaryElement}\n {...(title ? { id: `accordion_${title || ''}id-${value}` } : undefined)}\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled}\n selected={selected}\n withSecondaryTitle={Boolean(secondaryTitle)}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n wrapLabel={wrapLabel}\n >\n {title}\n </StyledPrimaryTitle>\n </StyledItemTitles>\n {secondaryTitle && (\n <StyledSecondaryTitle\n innerRef={setSecondaryElement}\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled}\n selected={selected}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n wrapLabel={wrapLabel}\n >\n {secondaryTitle}\n </StyledSecondaryTitle>\n )}\n </Grid>\n </Grid>\n ),\n [\n handleOnFocus,\n handleOnBlur,\n secondaryTitle,\n disabled,\n applyAriaDisabled,\n getOwnerProps,\n getOwnerPropsArguments,\n selected,\n IconOpened,\n IconClosed,\n setPrimaryElement,\n title,\n value,\n wrapLabel,\n setSecondaryElement,\n ],\n );\n\n const titleMobile = useMemo(\n () => (\n <Grid width=\"100%\">\n <Grid cols={['auto', '20px']}>\n <StyledItemTitles\n onMouseEnter={handleOnFocus}\n onMouseLeave={handleOnBlur}\n isDSMobile\n withSecondaryTitle={secondaryTitle}\n selected={selected}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledPrimaryTitle\n innerRef={setPrimaryElement}\n {...(title ? { id: `accordion_${title || ''}id` } : undefined)}\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled}\n isDSMobile\n selected={selected}\n withSecondaryTitle={Boolean(secondaryTitle)}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n wrapLabel={wrapLabel}\n >\n {title}\n </StyledPrimaryTitle>\n </StyledItemTitles>\n <StyledItemAddon\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled}\n isDSMobile\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {selected ? <IconOpened isDSMobile /> : <IconClosed isDSMobile />}\n </StyledItemAddon>\n </Grid>\n </Grid>\n ),\n [\n handleOnFocus,\n handleOnBlur,\n secondaryTitle,\n selected,\n getOwnerProps,\n getOwnerPropsArguments,\n setPrimaryElement,\n title,\n disabled,\n applyAriaDisabled,\n wrapLabel,\n IconOpened,\n IconClosed,\n ],\n );\n return (\n <StyledItemContainer\n data-testid={DSAccordionDataTestid.ITEM_CONTAINER}\n className={className}\n {...xstyledAttrs}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledItemHeaderContainer\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled}\n innerRef={(HTMLNode) => setReferenceElement(HTMLNode ?? null)}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledItemHeader\n withCustomActions={(customActions?.length > 0 || renderCustomActions !== undefined) && !isDSMobile}\n withSecondaryTitle={secondaryTitle}\n tabIndex={!disabled ? 0 : undefined}\n disabled={disabled}\n data-disabled={disabled}\n innerRef={mergeRefs(allChildrenReferences[dsIndex], innerRef)}\n onKeyDown={onKeyDownWithIndex}\n isDSMobile={isDSMobile}\n data-testid={DSAccordionDataTestid.ITEM_HEADER}\n id={`ds-accordion-header-${value}`}\n aria-expanded={selected}\n aria-disabled={disabled || applyAriaDisabled}\n applyAriaDisabled={applyAriaDisabled}\n aria-controls={`ds-accordion-content-${value}`}\n {...handlers}\n {...globalAttrs}\n type=\"button\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {isDSMobile ? titleMobile : titleDesktop}\n {wrapLabel ? null : (\n <FloatingWrapper\n innerRef={floatingRefs.setFloating}\n isOpen={isFloatingOpen}\n floatingStyles={floatingStyles}\n context={floatingContext}\n >\n <StyledTooltipContent getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n <p>{title}</p>\n <p> {secondaryTitle}</p>\n </StyledTooltipContent>\n <PopoverArrow {...arrowStyles} />\n </FloatingWrapper>\n )}\n </StyledItemHeader>\n {CustomActionsContent}\n </StyledItemHeaderContainer>\n {(selected || keepContentMounted) && (\n <StyledItemContent\n data-testid={DSAccordionDataTestid.ITEM_CONTENT_CONTAINER}\n aria-labelledby={`ds-accordion-header-${value}`}\n role=\"region\"\n isDSMobile={isDSMobile}\n id={`ds-accordion-content-${value}`}\n {...xstyledContentAttrs}\n selected={selected}\n keepContentMounted={keepContentMounted}\n applyAriaDisabled={applyAriaDisabled}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {children}\n </StyledItemContent>\n )}\n </StyledItemContainer>\n );\n};\n\nDSAccordionItem.displayName = 'DSAccordionItem';\nconst DSAccordionItemWithSchema = describe(DSAccordionItem);\nDSAccordionItemWithSchema.propTypes = accordionItemPropTypes as ValidationMap<unknown>;\n\nexport { DSAccordionItem, DSAccordionItemWithSchema };\nexport default DSAccordionItem;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADsFX;AApFZ,0BAAyC;AACzC,qBAAqB;AACrB,iCAAkE;AAClE,8BAMO;AACP,uBAA0B;AAC1B,mBAA6E;AAC7E,4BAAmC;AACnC,uBAAsC;AACtC,0BAA0C;AAE1C,mCAAuC;AACvC,oBAWO;AACP,8BAAiC;AACjC,kCAAqC;AAErC,MAAM,kBAAkB,CAAC,UAA+C;AACtE,QAAM,wBAAoB;AAAA,IACxB;AAAA,IACA;AAAA,EACF;AAEA,QAAM,oBAAgB,0BAAY,MAAM,OAAO,CAAC,KAAK,CAAC;AACtD,QAAM,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AO,GAAG,QAAQ;AAAA,kBAC5D,WAAW;AAAA,kBACX;AAAA,kBACA,eAAa,uCAAsB;AAAA,kBACnC,IAAI,uBAAuB,KAAK;AAAA,kBAChC,iBAAe;AAAA,kBACf,iBAAe,YAAY;AAAA,kBAC3B;AAAA,kBACA,iBAAe,wBAAwB,KAAK;AAAA,kBAC3C,GAAG;AAAA,kBACH,GAAG;AAAA,kBACJ,MAAK;AAAA,kBACL;AAAA,kBACA;AAAA,kBAEC;AAAA,iCAAa,cAAc;AAAA,oBAC3B,YAAY,OACX;AAAA,sBAAC;AAAA;AAAA,wBACC,UAAU,aAAa;AAAA,wBACvB,QAAQ;AAAA,wBACR;AAAA,wBACA,SAAS;AAAA,wBAET;AAAA,uEAAC,sCAAqB,eAA8B,wBAClD;AAAA,wEAAC,OAAG,iBAAM;AAAA,4BACV,6CAAC,OAAE;AAAA;AAAA,8BAAE;AAAA,+BAAe;AAAA,6BACtB;AAAA,0BACA,4CAAC,2CAAc,GAAG,aAAa;AAAA;AAAA;AAAA,oBACjC;AAAA;AAAA;AAAA,cAEJ;AAAA,cACC;AAAA;AAAA;AAAA,QACH;AAAA,SACE,YAAY,uBACZ;AAAA,UAAC;AAAA;AAAA,YACC,eAAa,uCAAsB;AAAA,YACnC,mBAAiB,uBAAuB,KAAK;AAAA,YAC7C,MAAK;AAAA,YACL;AAAA,YACA,IAAI,wBAAwB,KAAK;AAAA,YAChC,GAAG;AAAA,YACJ;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YAEC;AAAA;AAAA,QACH;AAAA;AAAA;AAAA,EAEJ;AAEJ;AAEA,gBAAgB,cAAc;AAC9B,MAAM,gCAA4B,kCAAS,eAAe;AAC1D,0BAA0B,YAAY;AAGtC,IAAO,0BAAQ;",
4
+ "sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable max-statements */\nimport { useFloatingContext, FloatingWrapper, PopoverArrow } from '@elliemae/ds-floating-context';\nimport {\n describe,\n useGetGlobalAttributes,\n useGetXstyledProps,\n useMemoMergePropsWithDefault,\n type ValidationMap,\n} from '@elliemae/ds-props-helpers';\nimport { mergeRefs } from '@elliemae/ds-system';\nimport React, { useCallback, useContext, useState } from 'react';\nimport { DSAccordionContext } from '../../DSAccordionCTX.js';\nimport { DSAccordionDataTestid } from '../../constants/index.js';\nimport { accordionItemDefaultProps } from '../../defaultProps.js';\nimport type { DSAccordionT } from '../../react-desc-prop-types.js';\nimport { accordionItemPropTypes } from '../../react-desc-prop-types.js';\nimport { ItemCustomActions } from './ItemCustomActions.js';\nimport { ItemTitle } from './ItemTitle.js';\nimport {\n StyledItemContainer,\n StyledItemContent,\n StyledItemDetails,\n StyledItemHeader,\n StyledItemHeaderContainer,\n StyledTooltipContent,\n} from './styles.js';\nimport { useAccordionItem } from './useAccordionItem.js';\nimport { useIsShowingEllipsis } from './useIsShowingEllipsis.js';\n\nconst DSAccordionItem = (props: DSAccordionT.ItemProps): JSX.Element => {\n const propsWithDefaults = useMemoMergePropsWithDefault(\n props,\n accordionItemDefaultProps,\n ) as DSAccordionT.InternalItemProps;\n\n const getOwnerProps = useCallback(() => props, [props]);\n const getOwnerPropsArguments = useCallback(() => ({}), []);\n\n const {\n children,\n title,\n secondaryTitle,\n customActions,\n iconOpened: IconOpened,\n iconClosed: IconClosed,\n value,\n disabled,\n dsIndex,\n renderCustomActions,\n CustomActions,\n xStyledPropsContent,\n keepContentMounted,\n innerRef,\n applyAriaDisabled,\n wrapLabel,\n ...rest\n } = propsWithDefaults;\n\n const { handleOnKeyDown, toggle, selected } = useAccordionItem({ value, disabled, applyAriaDisabled });\n\n const xstyledAttrs = useGetXstyledProps(rest);\n const xstyledContentAttrs = useGetXstyledProps(xStyledPropsContent);\n\n const {\n allChildrenReferences,\n actualActiveValue,\n props: { isDSMobile },\n } = useContext(DSAccordionContext);\n\n const [showPopover, setShowPopover] = useState(false);\n const [referenceElement, setReferenceElement] = useState<HTMLElement | null>(null);\n\n const { isShowingEllipsis: isPrimaryShowingEllipsis, setElement: setPrimaryElement } = useIsShowingEllipsis();\n const { isShowingEllipsis: isSecondaryShowingEllipsis, setElement: setSecondaryElement } = useIsShowingEllipsis();\n\n const isTooltipOpen = !selected && showPopover;\n const {\n refs: floatingRefs,\n floatingStyles,\n arrowStyles,\n context: floatingContext,\n isOpen: isFloatingOpen,\n } = useFloatingContext({\n externallyControlledIsOpen: isTooltipOpen,\n externalReferenceElement: referenceElement,\n withoutAnimation: true,\n customOffset: [0, 14],\n });\n\n const handleSummaryClick = useCallback(\n (e: React.MouseEvent) => {\n // Prevent the native <details> toggle \u2014 React state (activeValue) is the\n // single source of truth and drives the `open` attribute below.\n e.preventDefault();\n toggle(e);\n },\n [toggle],\n );\n\n const handleSummaryKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n // A <summary> toggles natively on Enter/Space; intercept so the toggle is\n // routed through React state exactly like a click (keeps controlled mode,\n // allowMultipleOpen exclusivity, and onChange firing once).\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n toggle(e);\n return;\n }\n handleOnKeyDown(e, dsIndex);\n },\n [toggle, handleOnKeyDown, dsIndex],\n );\n\n const handleSummaryMouseDown = useCallback(\n (e: React.MouseEvent) => {\n // A native <summary> takes focus on mousedown even with tabIndex -1.\n // Cancel that for disabled items so they cannot be focused by click either,\n // matching the pre-migration <button disabled> behavior. applyAriaDisabled\n // stays focusable by design, so it is intentionally not guarded here.\n if (disabled) e.preventDefault();\n },\n [disabled],\n );\n\n const handleOnFocus = useCallback(\n () => setShowPopover(isPrimaryShowingEllipsis || isSecondaryShowingEllipsis),\n [isPrimaryShowingEllipsis, isSecondaryShowingEllipsis],\n );\n\n const handleOnBlur = useCallback(() => setShowPopover(false), []);\n\n const { className, ...globalAttrs } = useGetGlobalAttributes(rest, {\n onClick: handleSummaryClick,\n onFocus: handleOnFocus,\n onBlur: handleOnBlur,\n });\n\n const handlers = {\n onClick: handleSummaryClick,\n onKeyDown: handleSummaryKeyDown,\n onMouseDown: handleSummaryMouseDown,\n onFocus: handleOnFocus,\n onBlur: handleOnBlur,\n };\n\n const headerId = `ds-accordion-header-${value}`;\n const contentId = `ds-accordion-content-${value}`;\n const withCustomActions =\n (customActions?.length > 0 || renderCustomActions !== undefined || CustomActions !== undefined) && !isDSMobile;\n\n return (\n <StyledItemContainer\n data-testid={DSAccordionDataTestid.ITEM_CONTAINER}\n className={className}\n {...xstyledAttrs}\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledItemDetails\n // Native disclosure state mirrors the React-controlled `selected` flag.\n // Visibility is still governed by React (content is conditionally\n // rendered below), so this is for native semantics/consistency only.\n open={selected}\n data-testid={DSAccordionDataTestid.ITEM_DETAILS}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledItemHeader\n withCustomActions={withCustomActions}\n withSecondaryTitle={secondaryTitle}\n // A native <summary> is always focusable, so `disabled` (unlike the old\n // <button disabled>) must be removed from the tab order explicitly.\n // applyAriaDisabled stays focusable (tabIndex 0) by design.\n tabIndex={disabled ? -1 : 0}\n disabled={disabled}\n data-disabled={disabled}\n // The trigger is a <summary>; the public innerRef type stays\n // HTMLButtonElement for backward compatibility, so cast at the boundary.\n innerRef={mergeRefs(allChildrenReferences[dsIndex], innerRef) as React.Ref<HTMLElement>}\n isDSMobile={isDSMobile}\n data-testid={DSAccordionDataTestid.ITEM_HEADER}\n id={headerId}\n aria-expanded={selected}\n aria-disabled={disabled || applyAriaDisabled}\n applyAriaDisabled={applyAriaDisabled}\n aria-controls={contentId}\n {...handlers}\n {...globalAttrs}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledItemHeaderContainer\n innerRef={(HTMLNode) => setReferenceElement(HTMLNode ?? null)}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <ItemTitle\n title={title}\n secondaryTitle={secondaryTitle}\n value={value}\n selected={selected}\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled}\n wrapLabel={wrapLabel}\n isDSMobile={isDSMobile}\n IconOpened={IconOpened}\n IconClosed={IconClosed}\n onMouseEnter={handleOnFocus}\n onMouseLeave={handleOnBlur}\n setPrimaryElement={setPrimaryElement}\n setSecondaryElement={setSecondaryElement}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />\n </StyledItemHeaderContainer>\n {wrapLabel ? null : (\n <FloatingWrapper\n innerRef={floatingRefs.setFloating}\n isOpen={isFloatingOpen}\n floatingStyles={floatingStyles}\n context={floatingContext}\n >\n <StyledTooltipContent getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n <p>{title}</p>\n <p> {secondaryTitle}</p>\n </StyledTooltipContent>\n <PopoverArrow {...arrowStyles} />\n </FloatingWrapper>\n )}\n </StyledItemHeader>\n {(selected || keepContentMounted) && (\n <StyledItemContent\n data-testid={DSAccordionDataTestid.ITEM_CONTENT_CONTAINER}\n aria-labelledby={headerId}\n role=\"region\"\n isDSMobile={isDSMobile}\n id={contentId}\n {...xstyledContentAttrs}\n selected={selected}\n keepContentMounted={keepContentMounted}\n applyAriaDisabled={applyAriaDisabled}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {children}\n </StyledItemContent>\n )}\n </StyledItemDetails>\n <ItemCustomActions\n customActions={customActions}\n renderCustomActions={renderCustomActions}\n CustomActionsComponent={CustomActions}\n isDSMobile={isDSMobile}\n allRefs={allChildrenReferences}\n actualActiveValue={actualActiveValue}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />\n </StyledItemContainer>\n );\n};\n\nDSAccordionItem.displayName = 'DSAccordionItem';\nconst DSAccordionItemWithSchema = describe(DSAccordionItem);\nDSAccordionItemWithSchema.propTypes = accordionItemPropTypes as ValidationMap<unknown>;\n\nexport { DSAccordionItem, DSAccordionItemWithSchema };\nexport default DSAccordionItem;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADwMX;AAtMZ,iCAAkE;AAClE,8BAMO;AACP,uBAA0B;AAC1B,mBAAyD;AACzD,4BAAmC;AACnC,uBAAsC;AACtC,0BAA0C;AAE1C,mCAAuC;AACvC,+BAAkC;AAClC,uBAA0B;AAC1B,oBAOO;AACP,8BAAiC;AACjC,kCAAqC;AAErC,MAAM,kBAAkB,CAAC,UAA+C;AACtE,QAAM,wBAAoB;AAAA,IACxB;AAAA,IACA;AAAA,EACF;AAEA,QAAM,oBAAgB,0BAAY,MAAM,OAAO,CAAC,KAAK,CAAC;AACtD,QAAM,6BAAyB,0BAAY,OAAO,CAAC,IAAI,CAAC,CAAC;AAEzD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AAEJ,QAAM,EAAE,iBAAiB,QAAQ,SAAS,QAAI,0CAAiB,EAAE,OAAO,UAAU,kBAAkB,CAAC;AAErG,QAAM,mBAAe,4CAAmB,IAAI;AAC5C,QAAM,0BAAsB,4CAAmB,mBAAmB;AAElE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,OAAO,EAAE,WAAW;AAAA,EACtB,QAAI,yBAAW,wCAAkB;AAEjC,QAAM,CAAC,aAAa,cAAc,QAAI,uBAAS,KAAK;AACpD,QAAM,CAAC,kBAAkB,mBAAmB,QAAI,uBAA6B,IAAI;AAEjF,QAAM,EAAE,mBAAmB,0BAA0B,YAAY,kBA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a;AAAA,wBACvB,QAAQ;AAAA,wBACR;AAAA,wBACA,SAAS;AAAA,wBAET;AAAA,uEAAC,sCAAqB,eAA8B,wBAClD;AAAA,wEAAC,OAAG,iBAAM;AAAA,4BACV,6CAAC,OAAE;AAAA;AAAA,8BAAE;AAAA,+BAAe;AAAA,6BACtB;AAAA,0BACA,4CAAC,2CAAc,GAAG,aAAa;AAAA;AAAA;AAAA,oBACjC;AAAA;AAAA;AAAA,cAEJ;AAAA,eACE,YAAY,uBACZ;AAAA,gBAAC;AAAA;AAAA,kBACC,eAAa,uCAAsB;AAAA,kBACnC,mBAAiB;AAAA,kBACjB,MAAK;AAAA,kBACL;AAAA,kBACA,IAAI;AAAA,kBACH,GAAG;AAAA,kBACJ;AAAA,kBACA;AAAA,kBACA;AAAA,kBACA;AAAA,kBACA;AAAA,kBAEC;AAAA;AAAA,cACH;AAAA;AAAA;AAAA,QAEJ;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA;AAAA,YACA,wBAAwB;AAAA,YACxB;AAAA,YACA,SAAS;AAAA,YACT;AAAA,YACA;AAAA,YACA;AAAA;AAAA,QACF;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,gBAAgB,cAAc;AAC9B,MAAM,gCAA4B,kCAAS,eAAe;AAC1D,0BAA0B,YAAY;AAGtC,IAAO,0BAAQ;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,84 @@
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 ItemCustomActions_exports = {};
30
+ __export(ItemCustomActions_exports, {
31
+ ItemCustomActions: () => ItemCustomActions
32
+ });
33
+ module.exports = __toCommonJS(ItemCustomActions_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_styles = require("./styles.js");
38
+ const ItemCustomActions = ({
39
+ customActions,
40
+ renderCustomActions,
41
+ CustomActionsComponent,
42
+ isDSMobile,
43
+ allRefs,
44
+ actualActiveValue,
45
+ getOwnerProps,
46
+ getOwnerPropsArguments
47
+ }) => {
48
+ if (isDSMobile) return null;
49
+ if (customActions?.length > 0) {
50
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
51
+ import_styles.StyledItemCustomActions,
52
+ {
53
+ isDSMobile,
54
+ getOwnerProps,
55
+ getOwnerPropsArguments,
56
+ children: customActions.map(({ onClick, id, ...otherProps }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
57
+ import_ds_button_v2.DSButtonV2,
58
+ {
59
+ onClick: (e) => {
60
+ e.stopPropagation();
61
+ if (onClick) onClick(e);
62
+ },
63
+ ...otherProps,
64
+ buttonType: import_ds_button_v2.BUTTON_TYPES.OUTLINE
65
+ },
66
+ id
67
+ ))
68
+ }
69
+ );
70
+ }
71
+ if (renderCustomActions || CustomActionsComponent) {
72
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
73
+ import_styles.StyledItemCustomActions,
74
+ {
75
+ isDSMobile,
76
+ getOwnerProps,
77
+ getOwnerPropsArguments,
78
+ children: CustomActionsComponent !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CustomActionsComponent, { allRefs, actualActiveValue }) : renderCustomActions?.({ allRefs, actualActiveValue })
79
+ }
80
+ );
81
+ }
82
+ return null;
83
+ };
84
+ //# sourceMappingURL=ItemCustomActions.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/parts/accordionItem/ItemCustomActions.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { BUTTON_TYPES, DSButtonV2 } from '@elliemae/ds-button-v2';\nimport React from 'react';\n\nimport type { DSAccordionT } from '../../react-desc-prop-types.js';\nimport type { DSAccordionInternalsT } from '../../sharedTypes.js';\nimport { StyledItemCustomActions } from './styles.js';\n\ninterface ItemCustomActionsProps {\n customActions: DSAccordionInternalsT.CustomActions[];\n renderCustomActions?: DSAccordionT.ItemOptionalProps['renderCustomActions'];\n CustomActionsComponent?: DSAccordionT.ItemOptionalProps['CustomActions'];\n isDSMobile: boolean;\n allRefs: DSAccordionInternalsT.AllChildrenReferences;\n actualActiveValue: DSAccordionInternalsT.InternalActiveValue;\n getOwnerProps: () => DSAccordionT.ItemProps;\n getOwnerPropsArguments: () => object;\n}\n\nexport const ItemCustomActions = ({\n customActions,\n renderCustomActions,\n CustomActionsComponent,\n isDSMobile,\n allRefs,\n actualActiveValue,\n getOwnerProps,\n getOwnerPropsArguments,\n}: ItemCustomActionsProps): JSX.Element | null => {\n if (isDSMobile) return null;\n\n if (customActions?.length > 0) {\n return (\n <StyledItemCustomActions\n isDSMobile={isDSMobile}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {customActions.map(({ onClick, id, ...otherProps }) => (\n <DSButtonV2\n key={id}\n onClick={(e: React.MouseEvent<HTMLElement, MouseEvent> | React.KeyboardEvent<HTMLElement>): void => {\n e.stopPropagation();\n if (onClick) onClick(e as React.MouseEvent<HTMLElement, MouseEvent>);\n }}\n {...otherProps}\n buttonType={BUTTON_TYPES.OUTLINE}\n />\n ))}\n </StyledItemCustomActions>\n );\n }\n\n if (renderCustomActions || CustomActionsComponent) {\n return (\n <StyledItemCustomActions\n isDSMobile={isDSMobile}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {CustomActionsComponent !== undefined ? (\n <CustomActionsComponent allRefs={allRefs} actualActiveValue={actualActiveValue} />\n ) : (\n renderCustomActions?.({ allRefs, actualActiveValue })\n )}\n </StyledItemCustomActions>\n );\n }\n\n return null;\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADsCb;AAtCV,0BAAyC;AAKzC,oBAAwC;AAajC,MAAM,oBAAoB,CAAC;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAkD;AAChD,MAAI,WAAY,QAAO;AAEvB,MAAI,eAAe,SAAS,GAAG;AAC7B,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QAEC,wBAAc,IAAI,CAAC,EAAE,SAAS,IAAI,GAAG,WAAW,MAC/C;AAAA,UAAC;AAAA;AAAA,YAEC,SAAS,CAAC,MAA0F;AAClG,gBAAE,gBAAgB;AAClB,kBAAI,QAAS,SAAQ,CAA8C;AAAA,YACrE;AAAA,YACC,GAAG;AAAA,YACJ,YAAY,iCAAa;AAAA;AAAA,UANpB;AAAA,QAOP,CACD;AAAA;AAAA,IACH;AAAA,EAEJ;AAEA,MAAI,uBAAuB,wBAAwB;AACjD,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QAEC,qCAA2B,SAC1B,4CAAC,0BAAuB,SAAkB,mBAAsC,IAEhF,sBAAsB,EAAE,SAAS,kBAAkB,CAAC;AAAA;AAAA,IAExD;AAAA,EAEJ;AAEA,SAAO;AACT;",
6
+ "names": []
7
+ }