@elliemae/ds-accordion 3.70.0-next.3 → 3.70.0-next.31

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.
@@ -35,9 +35,7 @@ __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
- var import_ds_popperjs = require("@elliemae/ds-popperjs");
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");
43
41
  var import_react = require("react");
@@ -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");
@@ -84,51 +84,21 @@ 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)();
89
+ const isTooltipOpen = !selected && showPopover;
90
+ const {
91
+ refs: floatingRefs,
92
+ floatingStyles,
93
+ arrowStyles,
94
+ context: floatingContext,
95
+ isOpen: isFloatingOpen
96
+ } = (0, import_ds_floating_context.useFloatingContext)({
97
+ externallyControlledIsOpen: isTooltipOpen,
98
+ externalReferenceElement: referenceElement,
99
+ withoutAnimation: true,
100
+ customOffset: [0, 14]
101
+ });
132
102
  const onKeyDownWithIndex = (0, import_react.useCallback)(
133
103
  (e) => {
134
104
  handleOnKeyDown(e, dsIndex);
@@ -150,199 +120,102 @@ const DSAccordionItem = (props) => {
150
120
  onFocus: handleOnFocus,
151
121
  onBlur: handleOnBlur
152
122
  };
153
- const titleDesktop = (0, import_react.useMemo)(
154
- () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
155
- import_ds_grid.Grid,
156
- {
157
- onMouseEnter: handleOnFocus,
158
- onMouseLeave: handleOnBlur,
159
- cols: ["auto", "1fr"],
160
- padding: "6px 0px",
161
- marginRight: "20px",
162
- width: "100%",
163
- children: [
164
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
165
- import_styles.StyledItemAddon,
166
- {
167
- disabled,
168
- applyAriaDisabled,
169
- getOwnerProps,
170
- getOwnerPropsArguments,
171
- children: selected ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IconOpened, {}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IconClosed, {})
172
- }
173
- ),
174
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ds_grid.Grid, { rows: secondaryTitle ? ["auto", "auto"] : ["auto"], rowGap: secondaryTitle ? "3px" : "0px", children: [
175
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
176
- import_styles.StyledItemTitles,
177
- {
178
- withSecondaryTitle: secondaryTitle,
179
- selected,
180
- getOwnerProps,
181
- getOwnerPropsArguments,
182
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
183
- import_styles.StyledPrimaryTitle,
184
- {
185
- innerRef: setPrimaryElement,
186
- ...title ? { id: `accordion_${title || ""}id-${value}` } : void 0,
187
- disabled,
188
- applyAriaDisabled,
189
- selected,
190
- withSecondaryTitle: Boolean(secondaryTitle),
191
- getOwnerProps,
192
- getOwnerPropsArguments,
193
- wrapLabel,
194
- children: title
195
- }
196
- )
197
- }
198
- ),
199
- secondaryTitle && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
200
- import_styles.StyledSecondaryTitle,
201
- {
202
- innerRef: setSecondaryElement,
203
- disabled,
204
- applyAriaDisabled,
205
- selected,
206
- getOwnerProps,
207
- getOwnerPropsArguments,
208
- wrapLabel,
209
- children: secondaryTitle
210
- }
211
- )
212
- ] })
213
- ]
214
- }
215
- ),
216
- [
217
- handleOnFocus,
218
- handleOnBlur,
219
- secondaryTitle,
220
- disabled,
221
- applyAriaDisabled,
222
- getOwnerProps,
223
- getOwnerPropsArguments,
224
- selected,
225
- IconOpened,
226
- IconClosed,
227
- setPrimaryElement,
228
- title,
229
- value,
230
- wrapLabel,
231
- setSecondaryElement
232
- ]
233
- );
234
- const titleMobile = (0, import_react.useMemo)(
235
- () => /* @__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: [
236
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
237
- import_styles.StyledItemTitles,
238
- {
239
- onMouseEnter: handleOnFocus,
240
- onMouseLeave: handleOnBlur,
241
- isDSMobile: true,
242
- withSecondaryTitle: secondaryTitle,
243
- selected,
244
- getOwnerProps,
245
- getOwnerPropsArguments,
246
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
247
- import_styles.StyledPrimaryTitle,
248
- {
249
- innerRef: setPrimaryElement,
250
- ...title ? { id: `accordion_${title || ""}id` } : void 0,
251
- disabled,
252
- applyAriaDisabled,
253
- isDSMobile: true,
254
- selected,
255
- withSecondaryTitle: Boolean(secondaryTitle),
256
- getOwnerProps,
257
- getOwnerPropsArguments,
258
- wrapLabel,
259
- children: title
260
- }
261
- )
262
- }
263
- ),
264
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
265
- import_styles.StyledItemAddon,
266
- {
267
- disabled,
268
- applyAriaDisabled,
269
- isDSMobile: true,
270
- getOwnerProps,
271
- getOwnerPropsArguments,
272
- children: selected ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IconOpened, { isDSMobile: true }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IconClosed, { isDSMobile: true })
273
- }
274
- )
275
- ] }) }),
276
- [
277
- handleOnFocus,
278
- handleOnBlur,
279
- secondaryTitle,
280
- selected,
281
- getOwnerProps,
282
- getOwnerPropsArguments,
283
- setPrimaryElement,
284
- title,
285
- disabled,
286
- applyAriaDisabled,
287
- wrapLabel,
288
- IconOpened,
289
- IconClosed
290
- ]
291
- );
292
123
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
293
124
  import_styles.StyledItemContainer,
294
125
  {
295
126
  "data-testid": import_constants.DSAccordionDataTestid.ITEM_CONTAINER,
296
127
  className,
297
128
  ...xstyledAttrs,
129
+ disabled,
130
+ applyAriaDisabled,
298
131
  getOwnerProps,
299
132
  getOwnerPropsArguments,
300
133
  children: [
301
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
134
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
302
135
  import_styles.StyledItemHeaderContainer,
303
136
  {
304
- disabled,
305
- applyAriaDisabled,
306
137
  innerRef: (HTMLNode) => setReferenceElement(HTMLNode ?? null),
307
138
  getOwnerProps,
308
139
  getOwnerPropsArguments,
309
- children: [
310
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
311
- import_styles.StyledItemHeader,
312
- {
313
- withCustomActions: (customActions?.length > 0 || renderCustomActions !== void 0) && !isDSMobile,
314
- withSecondaryTitle: secondaryTitle,
315
- tabIndex: !disabled ? 0 : void 0,
316
- disabled,
317
- "data-disabled": disabled,
318
- innerRef: (0, import_ds_system.mergeRefs)(allChildrenReferences[dsIndex], innerRef),
319
- onKeyDown: onKeyDownWithIndex,
320
- isDSMobile,
321
- "data-testid": import_constants.DSAccordionDataTestid.ITEM_HEADER,
322
- id: `ds-accordion-header-${value}`,
323
- "aria-expanded": selected,
324
- "aria-disabled": disabled || applyAriaDisabled,
325
- applyAriaDisabled,
326
- "aria-controls": `ds-accordion-content-${value}`,
327
- ...handlers,
328
- ...globalAttrs,
329
- type: "button",
330
- getOwnerProps,
331
- getOwnerPropsArguments,
332
- children: [
333
- isDSMobile ? titleMobile : titleDesktop,
334
- wrapLabel ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_popperjs.DSPopperJS, { referenceElement, showPopover: !selected && showPopover, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styles.StyledTooltipContent, { getOwnerProps, getOwnerPropsArguments, children: [
335
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: title }),
336
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { children: [
337
- " ",
338
- secondaryTitle
339
- ] })
340
- ] }) })
341
- ]
342
- }
343
- ),
344
- CustomActionsContent
345
- ]
140
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
141
+ import_styles.StyledItemHeader,
142
+ {
143
+ withCustomActions: (customActions?.length > 0 || renderCustomActions !== void 0 || CustomActions !== void 0) && !isDSMobile,
144
+ withSecondaryTitle: secondaryTitle,
145
+ tabIndex: !disabled ? 0 : void 0,
146
+ disabled,
147
+ "data-disabled": disabled,
148
+ innerRef: (0, import_ds_system.mergeRefs)(allChildrenReferences[dsIndex], innerRef),
149
+ onKeyDown: onKeyDownWithIndex,
150
+ isDSMobile,
151
+ "data-testid": import_constants.DSAccordionDataTestid.ITEM_HEADER,
152
+ id: `ds-accordion-header-${value}`,
153
+ "aria-expanded": selected,
154
+ "aria-disabled": disabled || applyAriaDisabled,
155
+ applyAriaDisabled,
156
+ "aria-controls": `ds-accordion-content-${value}`,
157
+ ...handlers,
158
+ ...globalAttrs,
159
+ type: "button",
160
+ getOwnerProps,
161
+ getOwnerPropsArguments,
162
+ children: [
163
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
164
+ import_ItemTitle.ItemTitle,
165
+ {
166
+ title,
167
+ secondaryTitle,
168
+ value,
169
+ selected,
170
+ disabled,
171
+ applyAriaDisabled,
172
+ wrapLabel,
173
+ isDSMobile,
174
+ IconOpened,
175
+ IconClosed,
176
+ onMouseEnter: handleOnFocus,
177
+ onMouseLeave: handleOnBlur,
178
+ setPrimaryElement,
179
+ setSecondaryElement,
180
+ getOwnerProps,
181
+ getOwnerPropsArguments
182
+ }
183
+ ),
184
+ wrapLabel ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
185
+ import_ds_floating_context.FloatingWrapper,
186
+ {
187
+ innerRef: floatingRefs.setFloating,
188
+ isOpen: isFloatingOpen,
189
+ floatingStyles,
190
+ context: floatingContext,
191
+ children: [
192
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styles.StyledTooltipContent, { getOwnerProps, getOwnerPropsArguments, children: [
193
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: title }),
194
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { children: [
195
+ " ",
196
+ secondaryTitle
197
+ ] })
198
+ ] }),
199
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_floating_context.PopoverArrow, { ...arrowStyles })
200
+ ]
201
+ }
202
+ )
203
+ ]
204
+ }
205
+ )
206
+ }
207
+ ),
208
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
209
+ import_ItemCustomActions.ItemCustomActions,
210
+ {
211
+ customActions,
212
+ renderCustomActions,
213
+ CustomActionsComponent: CustomActions,
214
+ isDSMobile,
215
+ allRefs: allChildrenReferences,
216
+ actualActiveValue,
217
+ getOwnerProps,
218
+ getOwnerPropsArguments
346
219
  }
347
220
  ),
348
221
  (selected || keepContentMounted) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
@@ -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 { DSPopperJS } from '@elliemae/ds-popperjs';\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, 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 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 <DSPopperJS referenceElement={referenceElement} showPopover={!selected && showPopover}>\n <StyledTooltipContent getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n <p>{title}</p>\n <p> {secondaryTitle}</p>\n </StyledTooltipContent>\n </DSPopperJS>\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;AAA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AAA,kBACA,iBAAe;AAAA,kBACf,cAAU,4BAAU,sBAAsB,OAAO,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,4CAAC,iCAAW,kBAAoC,aAAa,CAAC,YAAY,aACxE,uDAAC,sCAAqB,eAA8B,wBAClD;AAAA,kEAAC,OAAG,iBAAM;AAAA,sBACV,6CAAC,OAAE;AAAA;AAAA,wBAAE;AAAA,yBAAe;AAAA,uBACtB,GACF;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 */\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 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 { 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 { 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 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 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 <StyledItemHeaderContainer\n innerRef={(HTMLNode) => setReferenceElement(HTMLNode ?? null)}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledItemHeader\n withCustomActions={\n (customActions?.length > 0 || renderCustomActions !== undefined || CustomActions !== undefined) &&\n !isDSMobile\n }\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 <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 {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 </StyledItemHeaderContainer>\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 {(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;ADwJb;AAvJV,iCAAkE;AAClE,8BAMO;AACP,uBAA0B;AAC1B,mBAAyD;AACzD,4BAAmC;AACnC,uBAAsC;AACtC,0BAA0C;AAE1C,mCAAuC;AACvC,+BAAkC;AAClC,uBAA0B;AAC1B,oBAMO;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,eAAe,iBAAiB,SAAS,QAAI,0CAAiB,EAAE,OAAO,UAAU,kBAAkB,CAAC;AAE5G,QAAM,mBAAe,4CAAmB,IAAI;AAC5C,QAAM,0BAAsB,4CAAmB,mBAAmB;AAElE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,OA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AAAA,YACC;AAAA,YACA;AAAA,YACA,wBAAwB;AAAA,YACxB;AAAA,YACA,SAAS;AAAA,YACT;AAAA,YACA;AAAA,YACA;AAAA;AAAA,QACF;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;",
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
+ }