@razorpay/blade 11.39.0 → 11.40.1

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 (55) hide show
  1. package/build/lib/native/components/ActionList/ActionList.js +1 -1
  2. package/build/lib/native/components/ActionList/ActionList.js.map +1 -1
  3. package/build/lib/native/components/ActionList/ActionListBox.native.js +1 -1
  4. package/build/lib/native/components/ActionList/ActionListBox.native.js.map +1 -1
  5. package/build/lib/native/components/ActionList/ActionListItem.js +2 -1
  6. package/build/lib/native/components/ActionList/ActionListItem.js.map +1 -1
  7. package/build/lib/native/components/ActionList/styles/getBaseListBoxWrapperStyles.js +2 -2
  8. package/build/lib/native/components/ActionList/styles/getBaseListBoxWrapperStyles.js.map +1 -1
  9. package/build/lib/native/components/BaseMenu/BaseMenuItem/BaseMenuItem.js +2 -2
  10. package/build/lib/native/components/BaseMenu/BaseMenuItem/BaseMenuItem.js.map +1 -1
  11. package/build/lib/native/components/BaseMenu/BaseMenuItem/getBaseMenuItemStyles.js +2 -1
  12. package/build/lib/native/components/BaseMenu/BaseMenuItem/getBaseMenuItemStyles.js.map +1 -1
  13. package/build/lib/native/components/BaseMenu/BaseMenuItem/tokens.js +8 -0
  14. package/build/lib/native/components/BaseMenu/BaseMenuItem/tokens.js.map +1 -0
  15. package/build/lib/native/utils/useCallbackRef.js +3 -2
  16. package/build/lib/native/utils/useCallbackRef.js.map +1 -1
  17. package/build/lib/web/development/components/ActionList/ActionList.js +6 -4
  18. package/build/lib/web/development/components/ActionList/ActionList.js.map +1 -1
  19. package/build/lib/web/development/components/ActionList/ActionListBox.web.js +114 -3
  20. package/build/lib/web/development/components/ActionList/ActionListBox.web.js.map +1 -1
  21. package/build/lib/web/development/components/ActionList/ActionListItem.js +57 -60
  22. package/build/lib/web/development/components/ActionList/ActionListItem.js.map +1 -1
  23. package/build/lib/web/development/components/ActionList/styles/getBaseListBoxWrapperStyles.js +8 -4
  24. package/build/lib/web/development/components/ActionList/styles/getBaseListBoxWrapperStyles.js.map +1 -1
  25. package/build/lib/web/development/components/BaseMenu/BaseMenuItem/BaseMenuItem.js +6 -7
  26. package/build/lib/web/development/components/BaseMenu/BaseMenuItem/BaseMenuItem.js.map +1 -1
  27. package/build/lib/web/development/components/BaseMenu/BaseMenuItem/StyledMenuItemContainer.web.js +3 -2
  28. package/build/lib/web/development/components/BaseMenu/BaseMenuItem/StyledMenuItemContainer.web.js.map +1 -1
  29. package/build/lib/web/development/components/BaseMenu/BaseMenuItem/getBaseMenuItemStyles.js +3 -2
  30. package/build/lib/web/development/components/BaseMenu/BaseMenuItem/getBaseMenuItemStyles.js.map +1 -1
  31. package/build/lib/web/development/components/BaseMenu/BaseMenuItem/tokens.js +26 -0
  32. package/build/lib/web/development/components/BaseMenu/BaseMenuItem/tokens.js.map +1 -0
  33. package/build/lib/web/development/utils/useCallbackRef.js +11 -5
  34. package/build/lib/web/development/utils/useCallbackRef.js.map +1 -1
  35. package/build/lib/web/production/components/ActionList/ActionList.js +6 -4
  36. package/build/lib/web/production/components/ActionList/ActionList.js.map +1 -1
  37. package/build/lib/web/production/components/ActionList/ActionListBox.web.js +114 -3
  38. package/build/lib/web/production/components/ActionList/ActionListBox.web.js.map +1 -1
  39. package/build/lib/web/production/components/ActionList/ActionListItem.js +57 -60
  40. package/build/lib/web/production/components/ActionList/ActionListItem.js.map +1 -1
  41. package/build/lib/web/production/components/ActionList/styles/getBaseListBoxWrapperStyles.js +8 -4
  42. package/build/lib/web/production/components/ActionList/styles/getBaseListBoxWrapperStyles.js.map +1 -1
  43. package/build/lib/web/production/components/BaseMenu/BaseMenuItem/BaseMenuItem.js +6 -7
  44. package/build/lib/web/production/components/BaseMenu/BaseMenuItem/BaseMenuItem.js.map +1 -1
  45. package/build/lib/web/production/components/BaseMenu/BaseMenuItem/StyledMenuItemContainer.web.js +3 -2
  46. package/build/lib/web/production/components/BaseMenu/BaseMenuItem/StyledMenuItemContainer.web.js.map +1 -1
  47. package/build/lib/web/production/components/BaseMenu/BaseMenuItem/getBaseMenuItemStyles.js +3 -2
  48. package/build/lib/web/production/components/BaseMenu/BaseMenuItem/getBaseMenuItemStyles.js.map +1 -1
  49. package/build/lib/web/production/components/BaseMenu/BaseMenuItem/tokens.js +26 -0
  50. package/build/lib/web/production/components/BaseMenu/BaseMenuItem/tokens.js.map +1 -0
  51. package/build/lib/web/production/utils/useCallbackRef.js +11 -5
  52. package/build/lib/web/production/utils/useCallbackRef.js.map +1 -1
  53. package/build/types/components/index.d.ts +4 -3
  54. package/build/types/components/index.native.d.ts +4 -3
  55. package/package.json +4 -2
@@ -246,67 +246,64 @@ var _ActionListItem = function _ActionListItem(props) {
246
246
  }
247
247
  }
248
248
  }, [props.intent, dropdownTriggerer]);
249
- return (
250
- /*#__PURE__*/
251
- // We use this context to change the color of subcomponents like ActionListItemIcon, ActionListItemText, etc
252
- jsx(BaseMenuItem, _objectSpread(_objectSpread(_objectSpread(_objectSpread({
253
- isVisible: hasAutoComplete && filteredValues ? filteredValues.includes(props.value) : true,
254
- as: !isReactNative() ? renderOnWebAs : undefined,
255
- id: "".concat(dropdownBaseId, "-").concat(props._index),
256
- tabIndex: -1,
257
- title: props.title,
258
- description: props.description,
259
- leading: selectionType === 'multiple' ? /*#__PURE__*/jsx(BaseBox, _objectSpread(_objectSpread({
260
- pointerEvents: "none"
261
- // Adding aria-hidden because the listbox item in multiselect in itself explains the behaviour so announcing checkbox is unneccesary and just a nice UI tweak for us
262
- }, makeAccessible({
263
- hidden: true
264
- })), {}, {
265
- children: /*#__PURE__*/jsx(Checkbox, {
266
- isChecked: isSelected,
267
- tabIndex: -1,
268
- isDisabled: props.isDisabled,
269
- children: null
270
- })
271
- })) : props.leading,
272
- trailing: props.trailing,
273
- titleSuffix: props.titleSuffix,
274
- href: props.href,
275
- target: props.target,
276
- className: activeIndex === props._index ? 'active-focus' : '',
277
- isSelected: isSelected,
278
- isDisabled: props.isDisabled,
279
- role: getActionListItemRole(dropdownTriggerer, props.href)
280
- }, makeActionListItemClickable(function (e) {
281
- if (typeof props._index === 'number') {
282
- var _props$onClick;
283
- onOptionClick(e, props._index);
284
- (_props$onClick = props.onClick) === null || _props$onClick === void 0 ? void 0 : _props$onClick.call(props, {
285
- name: props.value,
286
- value: isSelected,
287
- event: castWebType(e)
288
- });
289
- }
290
- })), makeAnalyticsAttribute(_objectSpread({}, props))), metaAttribute({
291
- name: MetaConstants.ActionListItem,
292
- testID: props.testID
249
+ var isVisible = hasAutoComplete && filteredValues ? filteredValues.includes(props.value) : true;
250
+ return /*#__PURE__*/jsx(BaseMenuItem, _objectSpread(_objectSpread(_objectSpread(_objectSpread({
251
+ isVisible: isVisible,
252
+ as: !isReactNative() ? renderOnWebAs : undefined,
253
+ id: "".concat(dropdownBaseId, "-").concat(props._index),
254
+ tabIndex: -1,
255
+ title: props.title,
256
+ description: props.description,
257
+ leading: selectionType === 'multiple' ? /*#__PURE__*/jsx(BaseBox, _objectSpread(_objectSpread({
258
+ pointerEvents: "none"
259
+ // Adding aria-hidden because the listbox item in multiselect in itself explains the behaviour so announcing checkbox is unneccesary and just a nice UI tweak for us
260
+ }, makeAccessible({
261
+ hidden: true
293
262
  })), {}, {
294
- onMouseDown: function onMouseDown() {
295
- // We want to keep focus on Dropdown's trigger while option is being clicked
296
- // So We set this flag that ignores the blur animation to avoid the flicker between focus out + focus in
297
- setShouldIgnoreBlurAnimation(true);
298
- },
299
- onMouseUp: function onMouseUp() {
300
- // (Contd from above comment...) We set this flag back to false since blur of SelectInput is done calling by this time
301
- setShouldIgnoreBlurAnimation(false);
302
- },
303
- "data-value": props.value,
304
- "data-index": props._index,
305
- selectionType: selectionType,
306
- color: props.intent,
307
- isKeydownPressed: isKeydownPressed
308
- }))
309
- );
263
+ children: /*#__PURE__*/jsx(Checkbox, {
264
+ isChecked: isSelected,
265
+ tabIndex: -1,
266
+ isDisabled: props.isDisabled,
267
+ children: null
268
+ })
269
+ })) : props.leading,
270
+ trailing: props.trailing,
271
+ titleSuffix: props.titleSuffix,
272
+ href: props.href,
273
+ target: props.target,
274
+ className: activeIndex === props._index ? 'active-focus' : '',
275
+ isSelected: isSelected,
276
+ isDisabled: props.isDisabled,
277
+ role: getActionListItemRole(dropdownTriggerer, props.href)
278
+ }, makeActionListItemClickable(function (e) {
279
+ if (typeof props._index === 'number') {
280
+ var _props$onClick;
281
+ onOptionClick(e, props._index);
282
+ (_props$onClick = props.onClick) === null || _props$onClick === void 0 ? void 0 : _props$onClick.call(props, {
283
+ name: props.value,
284
+ value: isSelected,
285
+ event: castWebType(e)
286
+ });
287
+ }
288
+ })), makeAnalyticsAttribute(_objectSpread({}, props))), metaAttribute({
289
+ name: MetaConstants.ActionListItem,
290
+ testID: props.testID
291
+ })), {}, {
292
+ onMouseDown: function onMouseDown() {
293
+ // We want to keep focus on Dropdown's trigger while option is being clicked
294
+ // So We set this flag that ignores the blur animation to avoid the flicker between focus out + focus in
295
+ setShouldIgnoreBlurAnimation(true);
296
+ },
297
+ onMouseUp: function onMouseUp() {
298
+ // (Contd from above comment...) We set this flag back to false since blur of SelectInput is done calling by this time
299
+ setShouldIgnoreBlurAnimation(false);
300
+ },
301
+ "data-value": props.value,
302
+ "data-index": props._index,
303
+ selectionType: selectionType,
304
+ color: props.intent,
305
+ isKeydownPressed: isKeydownPressed
306
+ }));
310
307
  };
311
308
  var ActionListItem = /*#__PURE__*/assignWithoutSideEffects( /*#__PURE__*/React__default.memo(_ActionListItem), {
312
309
  componentId: componentIds.ActionListItem,
@@ -1 +1 @@
1
- {"version":3,"file":"ActionListItem.js","sources":["../../../../../../src/components/ActionList/ActionListItem.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/ban-ts-comment */\nimport React from 'react';\nimport styled from 'styled-components';\nimport type { TouchableOpacity } from 'react-native';\nimport { componentIds } from './componentIds';\nimport { validateActionListItemProps, getNormalTextColor } from './actionListUtils';\nimport { getActionListItemRole, getActionListSectionRole } from './getA11yRoles';\nimport { Divider } from '~components/Divider';\nimport BaseBox from '~components/Box/BaseBox';\nimport type { IconComponent } from '~components/Icons';\nimport { useDropdown } from '~components/Dropdown/useDropdown';\nimport type { FeedbackColors } from '~tokens/theme/theme';\nimport { Text } from '~components/Typography';\nimport type { Platform } from '~utils';\nimport { castWebType, isReactNative } from '~utils';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport type { DataAnalyticsAttribute, StringChildrenType, TestID } from '~utils/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { makeSize } from '~utils/makeSize';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { throwBladeError } from '~utils/logger';\nimport type { BadgeProps } from '~components/Badge';\nimport { Badge } from '~components/Badge';\nimport { Box } from '~components/Box';\nimport { dropdownComponentIds } from '~components/Dropdown/dropdownComponentIds';\nimport { BaseMenuItem, useBaseMenuItem } from '~components/BaseMenu';\nimport { Checkbox } from '~components/Checkbox';\nimport type { AvatarProps } from '~components/Avatar/types';\nimport { Avatar } from '~components/Avatar';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype ActionListItemProps = {\n title: string;\n description?: string;\n onClick?: (clickProps: {\n name: string;\n value?: boolean;\n event: Platform.Select<{\n web: React.MouseEvent;\n native: React.TouchEvent<TouchableOpacity>;\n }>;\n }) => void;\n /**\n * value that you get from `onChange` event on SelectInput or in form submissions.\n */\n value: string;\n /**\n * Link to open when item is clicked.\n */\n href?: string;\n /**\n * HTML target of the link\n */\n target?: string;\n /**\n * Item that goes on left-side of item.\n *\n * Valid elements - `<ActionListItemIcon />`, `<ActionListItemAsset />`\n *\n * Will be overriden in multiselect\n */\n leading?: React.ReactNode;\n /**\n * Item that goes on right-side of item.\n *\n * Valid elements - `<ActionListItemText />`, `<ActionListItemIcon />`\n */\n trailing?: React.ReactNode;\n /**\n * Item that goes immediately next to the title.\n *\n * Valid elements - `<ActionListItemBadge />`, `<ActionListItemBadgeGroup />`\n *\n */\n titleSuffix?: React.ReactElement;\n isDisabled?: boolean;\n intent?: Extract<FeedbackColors, 'negative'>;\n /**\n * Can be used in combination of `onClick` to highlight item as selected in Button Triggers.\n *\n * When trigger is SelectInput, Use `value` prop on SelectInput instead to make dropdown controlled.\n */\n isSelected?: boolean;\n /**\n * Internally passed from ActionList. No need to pass it explicitly\n *\n * @private\n */\n _index?: number;\n} & TestID &\n DataAnalyticsAttribute;\n\nconst StyledActionListSectionTitle = styled(BaseBox)((props) => ({\n // @TODO: replace this styled-component with new layout box when we have padding shorthand\n padding: makeSize(props.theme.spacing[3]),\n}));\n\ntype ActionListSectionProps = {\n title: string;\n children: React.ReactNode[] | React.ReactNode;\n /**\n * Internally used to hide the divider on final item in React Native.\n *\n * Should not be used by consumers (also won't work on web)\n *\n * @private\n */\n _hideDivider?: boolean;\n /**\n * Internally used to hide / show section in AutoComplete\n *\n * @private\n */\n _sectionChildValues?: string[];\n} & TestID &\n DataAnalyticsAttribute;\nconst _ActionListSection = ({\n title,\n children,\n testID,\n _hideDivider,\n _sectionChildValues,\n ...rest\n}: ActionListSectionProps): React.ReactElement => {\n const { hasAutoCompleteInBottomSheetHeader, dropdownTriggerer, filteredValues } = useDropdown();\n const hasAutoComplete =\n hasAutoCompleteInBottomSheetHeader ||\n dropdownTriggerer === dropdownComponentIds.triggers.AutoComplete;\n\n const isSectionVisible = React.useMemo(() => {\n if (hasAutoComplete) {\n const visibleActionListItemInSection = _sectionChildValues?.find((actionItemValue) =>\n filteredValues.includes(actionItemValue),\n );\n\n return Boolean(visibleActionListItemInSection);\n }\n\n return true;\n }, [_sectionChildValues, hasAutoComplete, filteredValues]);\n\n const showDividerInRN = !(_hideDivider && isReactNative());\n const showDividerInAutoComplete = hasAutoComplete\n ? isSectionVisible && filteredValues.length > 1\n : true;\n\n return (\n <BaseBox\n {...makeAccessible({\n role: getActionListSectionRole(),\n label: title,\n })}\n {...metaAttribute({ name: MetaConstants.ActionListSection, testID })}\n {...makeAnalyticsAttribute(rest as Record<string, unknown>)}\n >\n {/* We're announcing title as group label so we can hide this */}\n {isSectionVisible ? (\n <StyledActionListSectionTitle {...makeAccessible({ hidden: true })}>\n <Text color=\"surface.text.gray.muted\" size=\"small\" weight=\"semibold\">\n {title}\n </Text>\n </StyledActionListSectionTitle>\n ) : null}\n <BaseBox\n {...makeAccessible({\n // On web, we just wrap it in another listbox to announce item count properly for particular group.\n // On React Native, we ignore it since `menu` + `group` role will take care of accessibility\n role: isReactNative() ? undefined : 'listbox',\n })}\n >\n {children}\n </BaseBox>\n {showDividerInAutoComplete && showDividerInRN ? (\n <Divider marginX=\"spacing.3\" marginY=\"spacing.1\" />\n ) : null}\n </BaseBox>\n );\n};\n\nconst ActionListSection = assignWithoutSideEffects(_ActionListSection, {\n componentId: componentIds.ActionListSection,\n});\n\nconst _ActionListItemIcon = ({ icon }: { icon: IconComponent }): React.ReactElement => {\n const Icon = icon;\n const { color, isDisabled } = useBaseMenuItem();\n const iconState = isDisabled ? 'disabled' : 'muted';\n return (\n <Icon\n color={\n color === 'negative'\n ? 'feedback.icon.negative.intense'\n : `interactive.icon.gray.${iconState}`\n }\n size=\"medium\"\n />\n );\n};\n\nconst ActionListItemIcon = assignWithoutSideEffects(_ActionListItemIcon, {\n componentId: componentIds.ActionListItemIcon,\n});\n\nconst _ActionListItemBadgeGroup = ({\n children,\n}: {\n children: React.ReactElement[] | React.ReactElement;\n}): React.ReactElement => {\n return (\n <Box display=\"flex\" alignItems=\"center\" flexDirection=\"row\">\n {children}\n </Box>\n );\n};\n\nconst ActionListItemBadgeGroup = assignWithoutSideEffects(_ActionListItemBadgeGroup, {\n componentId: componentIds.ActionListItemBadgeGroup,\n});\n\nconst _ActionListItemAvatar = (avatarProps: Omit<AvatarProps, 'size' | ''>): React.ReactElement => {\n return <Avatar size=\"xsmall\" {...avatarProps} />;\n};\n\nconst ActionListItemAvatar = assignWithoutSideEffects(_ActionListItemAvatar, {\n componentId: componentIds.ActionListItemAvatar,\n});\n\nconst _ActionListItemBadge = (props: BadgeProps): React.ReactElement => {\n return <Badge size=\"medium\" marginLeft=\"spacing.3\" {...props} />;\n};\n\nconst ActionListItemBadge = assignWithoutSideEffects(_ActionListItemBadge, {\n componentId: componentIds.ActionListItemBadge,\n});\n\nconst _ActionListItemText = ({\n children,\n}: {\n children: StringChildrenType;\n}): React.ReactElement => {\n const { isDisabled } = useBaseMenuItem();\n\n return (\n <Text variant=\"caption\" color={getNormalTextColor(isDisabled, { isMuted: true })}>\n {children}\n </Text>\n );\n};\n\nconst ActionListItemText = assignWithoutSideEffects(_ActionListItemText, {\n componentId: componentIds.ActionListItemText,\n});\n\ntype ClickHandlerType = (e: React.MouseEvent<HTMLButtonElement>) => void;\n\nconst makeActionListItemClickable = (\n clickHandler: ClickHandlerType,\n): { onPress?: (e: React.TouchEvent<TouchableOpacity>) => void; onClick?: ClickHandlerType } => {\n if (isReactNative()) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment, @typescript-eslint/prefer-ts-expect-error\n // @ts-ignore: ignoring ReactNative press type for the peace of mind\n return { onPress: clickHandler };\n }\n\n return {\n onClick: clickHandler,\n };\n};\n\n/**\n * ### ActionListItem\n *\n * Creates option inside `ActionList`.\n *\n * #### Usage\n *\n * ```jsx\n * <ActionList>\n * <ActionListItem\n * title=\"Home\"\n * value=\"home\"\n * leading={<ActionListItemIcon icon={HomeIcon} />}\n * trailing={<ActionListItemText>⌘ + S</ActionListItemText>}\n * />\n * </ActionList>\n * ```\n */\nconst _ActionListItem = (props: ActionListItemProps): React.ReactElement => {\n const {\n activeIndex,\n dropdownBaseId,\n onOptionClick,\n selectedIndices,\n setShouldIgnoreBlurAnimation,\n selectionType,\n dropdownTriggerer,\n isKeydownPressed,\n filteredValues,\n hasAutoCompleteInBottomSheetHeader,\n } = useDropdown();\n\n const hasAutoComplete =\n hasAutoCompleteInBottomSheetHeader ||\n dropdownTriggerer === dropdownComponentIds.triggers.AutoComplete;\n\n const renderOnWebAs = props.href ? 'a' : 'button';\n\n /**\n * In SelectInput, returns the isSelected according to selected indexes in the state\n *\n * In Other Triggers (Menu Usecase), returns `props.isSelected` since passing the\n * isSelected prop explicitly is the only way to select item in menu\n */\n const getIsSelected = (): boolean | undefined => {\n if (dropdownTriggerer === dropdownComponentIds.triggers.SelectInput || hasAutoComplete) {\n if (typeof props._index === 'number') {\n return selectedIndices.includes(props._index);\n }\n\n return undefined;\n }\n\n return props.isSelected;\n };\n\n const isSelected = getIsSelected();\n\n React.useEffect(() => {\n validateActionListItemProps({\n leading: props.leading,\n trailing: props.trailing,\n titleSuffix: props.titleSuffix,\n });\n }, [props.leading, props.trailing, props.titleSuffix]);\n\n React.useEffect(() => {\n if (__DEV__) {\n if (\n dropdownTriggerer === dropdownComponentIds.triggers.SelectInput &&\n props.intent === 'negative'\n ) {\n throwBladeError({\n message:\n 'negative intent ActionListItem cannot be used inside Dropdown with SelectInput trigger',\n moduleName: 'ActionListItem',\n });\n }\n }\n }, [props.intent, dropdownTriggerer]);\n\n return (\n // We use this context to change the color of subcomponents like ActionListItemIcon, ActionListItemText, etc\n <BaseMenuItem\n isVisible={hasAutoComplete && filteredValues ? filteredValues.includes(props.value) : true}\n as={!isReactNative() ? renderOnWebAs : undefined}\n id={`${dropdownBaseId}-${props._index}`}\n tabIndex={-1}\n title={props.title}\n description={props.description}\n leading={\n selectionType === 'multiple' ? (\n <BaseBox\n pointerEvents=\"none\"\n // Adding aria-hidden because the listbox item in multiselect in itself explains the behaviour so announcing checkbox is unneccesary and just a nice UI tweak for us\n {...makeAccessible({\n hidden: true,\n })}\n >\n <Checkbox isChecked={isSelected} tabIndex={-1} isDisabled={props.isDisabled}>\n {/* \n Checkbox requires children. Didn't want to make it optional because its helpful for consumers\n But for this case in particular, we just want to use Text separately so that we can control spacing and color and keep it consistent with non-multiselect dropdowns\n */}\n {null}\n </Checkbox>\n </BaseBox>\n ) : (\n props.leading\n )\n }\n trailing={props.trailing}\n titleSuffix={props.titleSuffix}\n href={props.href}\n target={props.target}\n className={activeIndex === props._index ? 'active-focus' : ''}\n isSelected={isSelected}\n isDisabled={props.isDisabled}\n role={getActionListItemRole(dropdownTriggerer, props.href)}\n {...makeActionListItemClickable((e: React.MouseEvent<HTMLButtonElement>): void => {\n if (typeof props._index === 'number') {\n onOptionClick(e, props._index);\n props.onClick?.({ name: props.value, value: isSelected, event: castWebType(e) });\n }\n })}\n {...makeAnalyticsAttribute({ ...props })}\n {...metaAttribute({ name: MetaConstants.ActionListItem, testID: props.testID })}\n onMouseDown={() => {\n // We want to keep focus on Dropdown's trigger while option is being clicked\n // So We set this flag that ignores the blur animation to avoid the flicker between focus out + focus in\n setShouldIgnoreBlurAnimation(true);\n }}\n onMouseUp={() => {\n // (Contd from above comment...) We set this flag back to false since blur of SelectInput is done calling by this time\n setShouldIgnoreBlurAnimation(false);\n }}\n data-value={props.value}\n data-index={props._index}\n selectionType={selectionType}\n color={props.intent}\n isKeydownPressed={isKeydownPressed}\n />\n );\n};\n\nconst ActionListItem = assignWithoutSideEffects(React.memo(_ActionListItem), {\n componentId: componentIds.ActionListItem,\n displayName: componentIds.ActionListItem,\n});\n\nexport type { ActionListItemProps, ActionListSectionProps };\nexport {\n ActionListItem,\n ActionListItemIcon,\n ActionListItemText,\n ActionListItemAvatar,\n ActionListItemBadge,\n ActionListItemBadgeGroup,\n ActionListSection,\n};\n"],"names":["StyledActionListSectionTitle","styled","BaseBox","withConfig","displayName","componentId","props","padding","makeSize","theme","spacing","_ActionListSection","_ref","title","children","testID","_hideDivider","_sectionChildValues","rest","_objectWithoutProperties","_excluded","_useDropdown","useDropdown","hasAutoCompleteInBottomSheetHeader","dropdownTriggerer","filteredValues","hasAutoComplete","dropdownComponentIds","triggers","AutoComplete","isSectionVisible","React","useMemo","visibleActionListItemInSection","find","actionItemValue","includes","Boolean","showDividerInRN","isReactNative","showDividerInAutoComplete","length","_jsxs","_objectSpread","makeAccessible","role","getActionListSectionRole","label","metaAttribute","name","MetaConstants","ActionListSection","makeAnalyticsAttribute","_jsx","hidden","Text","color","size","weight","undefined","Divider","marginX","marginY","assignWithoutSideEffects","componentIds","_ActionListItemIcon","_ref2","icon","Icon","_useBaseMenuItem","useBaseMenuItem","isDisabled","iconState","concat","ActionListItemIcon","_ActionListItemBadgeGroup","_ref3","Box","display","alignItems","flexDirection","ActionListItemBadgeGroup","_ActionListItemAvatar","avatarProps","Avatar","ActionListItemAvatar","_ActionListItemBadge","Badge","marginLeft","ActionListItemBadge","_ActionListItemText","_ref4","_useBaseMenuItem2","variant","getNormalTextColor","isMuted","ActionListItemText","makeActionListItemClickable","clickHandler","onPress","onClick","_ActionListItem","_useDropdown2","activeIndex","dropdownBaseId","onOptionClick","selectedIndices","setShouldIgnoreBlurAnimation","selectionType","isKeydownPressed","renderOnWebAs","href","getIsSelected","SelectInput","_index","isSelected","useEffect","validateActionListItemProps","leading","trailing","titleSuffix","intent","throwBladeError","message","moduleName","BaseMenuItem","isVisible","value","as","id","tabIndex","description","pointerEvents","Checkbox","isChecked","target","className","getActionListItemRole","e","_props$onClick","call","event","castWebType","ActionListItem","onMouseDown","onMouseUp","memo"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4FA,IAAMA,4BAA4B,gBAAGC,MAAM,CAACC,OAAO,CAAC,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,8CAAA;EAAAC,WAAA,EAAA,UAAA;AAAA,CAAA,CAAA,CAAC,UAACC,KAAK,EAAA;EAAA,OAAM;AAC/D;IACAC,OAAO,EAAEC,QAAQ,CAACF,KAAK,CAACG,KAAK,CAACC,OAAO,CAAC,CAAC,CAAC,CAAA;GACzC,CAAA;AAAA,CAAC,CAAC,CAAA;AAqBH,IAAMC,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAAC,IAAA,EAO0B;AAAA,EAAA,IANhDC,KAAK,GAAAD,IAAA,CAALC,KAAK;IACLC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IACRC,MAAM,GAAAH,IAAA,CAANG,MAAM;IACNC,YAAY,GAAAJ,IAA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KAAK,EAAElD,KAAK,CAACmH,MAAO;AACpBZ,MAAAA,gBAAgB,EAAEA,gBAAAA;KACnB,CAAA,CAAA;AAAC,IAAA;AAEN,CAAC,CAAA;AAEKkC,IAAAA,cAAc,gBAAGhF,wBAAwB,eAAChC,cAAK,CAACmH,IAAI,CAAC7C,eAAe,CAAC,EAAE;EAC3EhG,WAAW,EAAE2D,YAAY,CAAC+E,cAAc;EACxC3I,WAAW,EAAE4D,YAAY,CAAC+E,cAAAA;AAC5B,CAAC;;;;"}
1
+ {"version":3,"file":"ActionListItem.js","sources":["../../../../../../src/components/ActionList/ActionListItem.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/ban-ts-comment */\nimport React from 'react';\nimport styled from 'styled-components';\nimport type { TouchableOpacity } from 'react-native';\nimport { componentIds } from './componentIds';\nimport { validateActionListItemProps, getNormalTextColor } from './actionListUtils';\nimport { getActionListItemRole, getActionListSectionRole } from './getA11yRoles';\nimport { Divider } from '~components/Divider';\nimport BaseBox from '~components/Box/BaseBox';\nimport type { IconComponent } from '~components/Icons';\nimport { useDropdown } from '~components/Dropdown/useDropdown';\nimport type { FeedbackColors } from '~tokens/theme/theme';\nimport { Text } from '~components/Typography';\nimport type { Platform } from '~utils';\nimport { castWebType, isReactNative } from '~utils';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport type { DataAnalyticsAttribute, StringChildrenType, TestID } from '~utils/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { makeSize } from '~utils/makeSize';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { throwBladeError } from '~utils/logger';\nimport type { BadgeProps } from '~components/Badge';\nimport { Badge } from '~components/Badge';\nimport { Box } from '~components/Box';\nimport { dropdownComponentIds } from '~components/Dropdown/dropdownComponentIds';\nimport { BaseMenuItem, useBaseMenuItem } from '~components/BaseMenu';\nimport { Checkbox } from '~components/Checkbox';\nimport type { AvatarProps } from '~components/Avatar/types';\nimport { Avatar } from '~components/Avatar';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype ActionListItemProps = {\n title: string;\n description?: string;\n onClick?: (clickProps: {\n name: string;\n value?: boolean;\n event: Platform.Select<{\n web: React.MouseEvent;\n native: React.TouchEvent<TouchableOpacity>;\n }>;\n }) => void;\n /**\n * value that you get from `onChange` event on SelectInput or in form submissions.\n */\n value: string;\n /**\n * Link to open when item is clicked.\n */\n href?: string;\n /**\n * HTML target of the link\n */\n target?: string;\n /**\n * Item that goes on left-side of item.\n *\n * Valid elements - `<ActionListItemIcon />`, `<ActionListItemAsset />`\n *\n * Will be overriden in multiselect\n */\n leading?: React.ReactNode;\n /**\n * Item that goes on right-side of item.\n *\n * Valid elements - `<ActionListItemText />`, `<ActionListItemIcon />`\n */\n trailing?: React.ReactNode;\n /**\n * Item that goes immediately next to the title.\n *\n * Valid elements - `<ActionListItemBadge />`, `<ActionListItemBadgeGroup />`\n *\n */\n titleSuffix?: React.ReactElement;\n isDisabled?: boolean;\n intent?: Extract<FeedbackColors, 'negative'>;\n /**\n * Can be used in combination of `onClick` to highlight item as selected in Button Triggers.\n *\n * When trigger is SelectInput, Use `value` prop on SelectInput instead to make dropdown controlled.\n */\n isSelected?: boolean;\n /**\n * Internally passed from ActionList. No need to pass it explicitly\n *\n * @private\n */\n _index?: number;\n} & TestID &\n DataAnalyticsAttribute;\n\nconst StyledActionListSectionTitle = styled(BaseBox)((props) => ({\n // @TODO: replace this styled-component with new layout box when we have padding shorthand\n padding: makeSize(props.theme.spacing[3]),\n}));\n\ntype ActionListSectionProps = {\n title: string;\n children: React.ReactNode[] | React.ReactNode;\n /**\n * Internally used to hide the divider on final item in React Native.\n *\n * Should not be used by consumers (also won't work on web)\n *\n * @private\n */\n _hideDivider?: boolean;\n /**\n * Internally used to hide / show section in AutoComplete\n *\n * @private\n */\n _sectionChildValues?: string[];\n} & TestID &\n DataAnalyticsAttribute;\nconst _ActionListSection = ({\n title,\n children,\n testID,\n _hideDivider,\n _sectionChildValues,\n ...rest\n}: ActionListSectionProps): React.ReactElement => {\n const { hasAutoCompleteInBottomSheetHeader, dropdownTriggerer, filteredValues } = useDropdown();\n const hasAutoComplete =\n hasAutoCompleteInBottomSheetHeader ||\n dropdownTriggerer === dropdownComponentIds.triggers.AutoComplete;\n\n const isSectionVisible = React.useMemo(() => {\n if (hasAutoComplete) {\n const visibleActionListItemInSection = _sectionChildValues?.find((actionItemValue) =>\n filteredValues.includes(actionItemValue),\n );\n\n return Boolean(visibleActionListItemInSection);\n }\n\n return true;\n }, [_sectionChildValues, hasAutoComplete, filteredValues]);\n\n const showDividerInRN = !(_hideDivider && isReactNative());\n const showDividerInAutoComplete = hasAutoComplete\n ? isSectionVisible && filteredValues.length > 1\n : true;\n\n return (\n <BaseBox\n {...makeAccessible({\n role: getActionListSectionRole(),\n label: title,\n })}\n {...metaAttribute({ name: MetaConstants.ActionListSection, testID })}\n {...makeAnalyticsAttribute(rest as Record<string, unknown>)}\n >\n {/* We're announcing title as group label so we can hide this */}\n {isSectionVisible ? (\n <StyledActionListSectionTitle {...makeAccessible({ hidden: true })}>\n <Text color=\"surface.text.gray.muted\" size=\"small\" weight=\"semibold\">\n {title}\n </Text>\n </StyledActionListSectionTitle>\n ) : null}\n <BaseBox\n {...makeAccessible({\n // On web, we just wrap it in another listbox to announce item count properly for particular group.\n // On React Native, we ignore it since `menu` + `group` role will take care of accessibility\n role: isReactNative() ? undefined : 'listbox',\n })}\n >\n {children}\n </BaseBox>\n {showDividerInAutoComplete && showDividerInRN ? (\n <Divider marginX=\"spacing.3\" marginY=\"spacing.1\" />\n ) : null}\n </BaseBox>\n );\n};\n\nconst ActionListSection = assignWithoutSideEffects(_ActionListSection, {\n componentId: componentIds.ActionListSection,\n});\n\nconst _ActionListItemIcon = ({ icon }: { icon: IconComponent }): React.ReactElement => {\n const Icon = icon;\n const { color, isDisabled } = useBaseMenuItem();\n const iconState = isDisabled ? 'disabled' : 'muted';\n return (\n <Icon\n color={\n color === 'negative'\n ? 'feedback.icon.negative.intense'\n : `interactive.icon.gray.${iconState}`\n }\n size=\"medium\"\n />\n );\n};\n\nconst ActionListItemIcon = assignWithoutSideEffects(_ActionListItemIcon, {\n componentId: componentIds.ActionListItemIcon,\n});\n\nconst _ActionListItemBadgeGroup = ({\n children,\n}: {\n children: React.ReactElement[] | React.ReactElement;\n}): React.ReactElement => {\n return (\n <Box display=\"flex\" alignItems=\"center\" flexDirection=\"row\">\n {children}\n </Box>\n );\n};\n\nconst ActionListItemBadgeGroup = assignWithoutSideEffects(_ActionListItemBadgeGroup, {\n componentId: componentIds.ActionListItemBadgeGroup,\n});\n\nconst _ActionListItemAvatar = (avatarProps: Omit<AvatarProps, 'size' | ''>): React.ReactElement => {\n return <Avatar size=\"xsmall\" {...avatarProps} />;\n};\n\nconst ActionListItemAvatar = assignWithoutSideEffects(_ActionListItemAvatar, {\n componentId: componentIds.ActionListItemAvatar,\n});\n\nconst _ActionListItemBadge = (props: BadgeProps): React.ReactElement => {\n return <Badge size=\"medium\" marginLeft=\"spacing.3\" {...props} />;\n};\n\nconst ActionListItemBadge = assignWithoutSideEffects(_ActionListItemBadge, {\n componentId: componentIds.ActionListItemBadge,\n});\n\nconst _ActionListItemText = ({\n children,\n}: {\n children: StringChildrenType;\n}): React.ReactElement => {\n const { isDisabled } = useBaseMenuItem();\n\n return (\n <Text variant=\"caption\" color={getNormalTextColor(isDisabled, { isMuted: true })}>\n {children}\n </Text>\n );\n};\n\nconst ActionListItemText = assignWithoutSideEffects(_ActionListItemText, {\n componentId: componentIds.ActionListItemText,\n});\n\ntype ClickHandlerType = (e: React.MouseEvent<HTMLButtonElement>) => void;\n\nconst makeActionListItemClickable = (\n clickHandler: ClickHandlerType,\n): { onPress?: (e: React.TouchEvent<TouchableOpacity>) => void; onClick?: ClickHandlerType } => {\n if (isReactNative()) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment, @typescript-eslint/prefer-ts-expect-error\n // @ts-ignore: ignoring ReactNative press type for the peace of mind\n return { onPress: clickHandler };\n }\n\n return {\n onClick: clickHandler,\n };\n};\n\n/**\n * ### ActionListItem\n *\n * Creates option inside `ActionList`.\n *\n * #### Usage\n *\n * ```jsx\n * <ActionList>\n * <ActionListItem\n * title=\"Home\"\n * value=\"home\"\n * leading={<ActionListItemIcon icon={HomeIcon} />}\n * trailing={<ActionListItemText>⌘ + S</ActionListItemText>}\n * />\n * </ActionList>\n * ```\n */\nconst _ActionListItem = (props: ActionListItemProps): React.ReactElement => {\n const {\n activeIndex,\n dropdownBaseId,\n onOptionClick,\n selectedIndices,\n setShouldIgnoreBlurAnimation,\n selectionType,\n dropdownTriggerer,\n isKeydownPressed,\n filteredValues,\n hasAutoCompleteInBottomSheetHeader,\n } = useDropdown();\n\n const hasAutoComplete =\n hasAutoCompleteInBottomSheetHeader ||\n dropdownTriggerer === dropdownComponentIds.triggers.AutoComplete;\n\n const renderOnWebAs = props.href ? 'a' : 'button';\n\n /**\n * In SelectInput, returns the isSelected according to selected indexes in the state\n *\n * In Other Triggers (Menu Usecase), returns `props.isSelected` since passing the\n * isSelected prop explicitly is the only way to select item in menu\n */\n const getIsSelected = (): boolean | undefined => {\n if (dropdownTriggerer === dropdownComponentIds.triggers.SelectInput || hasAutoComplete) {\n if (typeof props._index === 'number') {\n return selectedIndices.includes(props._index);\n }\n\n return undefined;\n }\n\n return props.isSelected;\n };\n\n const isSelected = getIsSelected();\n\n React.useEffect(() => {\n validateActionListItemProps({\n leading: props.leading,\n trailing: props.trailing,\n titleSuffix: props.titleSuffix,\n });\n }, [props.leading, props.trailing, props.titleSuffix]);\n\n React.useEffect(() => {\n if (__DEV__) {\n if (\n dropdownTriggerer === dropdownComponentIds.triggers.SelectInput &&\n props.intent === 'negative'\n ) {\n throwBladeError({\n message:\n 'negative intent ActionListItem cannot be used inside Dropdown with SelectInput trigger',\n moduleName: 'ActionListItem',\n });\n }\n }\n }, [props.intent, dropdownTriggerer]);\n\n const isVisible = hasAutoComplete && filteredValues ? filteredValues.includes(props.value) : true;\n\n return (\n <BaseMenuItem\n isVisible={isVisible}\n as={!isReactNative() ? renderOnWebAs : undefined}\n id={`${dropdownBaseId}-${props._index}`}\n tabIndex={-1}\n title={props.title}\n description={props.description}\n leading={\n selectionType === 'multiple' ? (\n <BaseBox\n pointerEvents=\"none\"\n // Adding aria-hidden because the listbox item in multiselect in itself explains the behaviour so announcing checkbox is unneccesary and just a nice UI tweak for us\n {...makeAccessible({\n hidden: true,\n })}\n >\n <Checkbox isChecked={isSelected} tabIndex={-1} isDisabled={props.isDisabled}>\n {/* \n Checkbox requires children. Didn't want to make it optional because its helpful for consumers\n But for this case in particular, we just want to use Text separately so that we can control spacing and color and keep it consistent with non-multiselect dropdowns\n */}\n {null}\n </Checkbox>\n </BaseBox>\n ) : (\n props.leading\n )\n }\n trailing={props.trailing}\n titleSuffix={props.titleSuffix}\n href={props.href}\n target={props.target}\n className={activeIndex === props._index ? 'active-focus' : ''}\n isSelected={isSelected}\n isDisabled={props.isDisabled}\n role={getActionListItemRole(dropdownTriggerer, props.href)}\n {...makeActionListItemClickable((e: React.MouseEvent<HTMLButtonElement>): void => {\n if (typeof props._index === 'number') {\n onOptionClick(e, props._index);\n props.onClick?.({ name: props.value, value: isSelected, event: castWebType(e) });\n }\n })}\n {...makeAnalyticsAttribute({ ...props })}\n {...metaAttribute({ name: MetaConstants.ActionListItem, testID: props.testID })}\n onMouseDown={() => {\n // We want to keep focus on Dropdown's trigger while option is being clicked\n // So We set this flag that ignores the blur animation to avoid the flicker between focus out + focus in\n setShouldIgnoreBlurAnimation(true);\n }}\n onMouseUp={() => {\n // (Contd from above comment...) We set this flag back to false since blur of SelectInput is done calling by this time\n setShouldIgnoreBlurAnimation(false);\n }}\n data-value={props.value}\n data-index={props._index}\n selectionType={selectionType}\n color={props.intent}\n isKeydownPressed={isKeydownPressed}\n />\n );\n};\n\nconst ActionListItem = assignWithoutSideEffects(React.memo(_ActionListItem), {\n componentId: componentIds.ActionListItem,\n displayName: componentIds.ActionListItem,\n});\n\nexport type { ActionListItemProps, ActionListSectionProps };\nexport {\n ActionListItem,\n ActionListItemIcon,\n ActionListItemText,\n ActionListItemAvatar,\n ActionListItemBadge,\n ActionListItemBadgeGroup,\n ActionListSection,\n};\n"],"names":["StyledActionListSectionTitle","styled","BaseBox","withConfig","displayName","componentId","props","padding","makeSize","theme","spacing","_ActionListSection","_ref","title","children","testID","_hideDivider","_sectionChildValues","rest","_objectWithoutProperties","_excluded","_useDropdown","useDropdown","hasAutoCompleteInBottomSheetHeader","dropdownTriggerer","filteredValues","hasAutoComplete","dropdownComponentIds","triggers","AutoComplete","isSectionVisible","React","useMemo","visibleActionListItemInSection","find","actionItemValue","includes","Boolean","showDividerInRN","isReactNative","showDividerInAutoComplete","length","_jsxs","_objectSpread","makeAccessible","role","getActionListSectionRole","label","metaAttribute","name","MetaConstants","ActionListSection","makeAnalyticsAttribute","_jsx","hidden","Text","color","size","weight","undefined","Divider","marginX","marginY","assignWithoutSideEffects","componentIds","_ActionListItemIcon","_ref2","icon","Icon","_useBaseMenuItem","useBaseMenuItem","isDisabled","iconState","concat","ActionListItemIcon","_ActionListItemBadgeGroup","_ref3","Box","display","alignItems","flexDirection","ActionListItemBadgeGroup","_ActionListItemAvatar","avatarProps","Avatar","ActionListItemAvatar","_ActionListItemBadge","Badge","marginLeft","ActionListItemBadge","_ActionListItemText","_ref4","_useBaseMenuItem2","variant","getNormalTextColor","isMuted","ActionListItemText","makeActionListItemClickable","clickHandler","onPress","onClick","_ActionListItem","_useDropdown2","activeIndex","dropdownBaseId","onOptionClick","selectedIndices","setShouldIgnoreBlurAnimation","selectionType","isKeydownPressed","renderOnWebAs","href","getIsSelected","SelectInput","_index","isSelected","useEffect","validateActionListItemProps","leading","trailing","titleSuffix","intent","throwBladeError","message","moduleName","isVisible","value","BaseMenuItem","as","id","tabIndex","description","pointerEvents","Checkbox","isChecked","target","className","getActionListItemRole","e","_props$onClick","call","event","castWebType","ActionListItem","onMouseDown","onMouseUp","memo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K,EAAEC,WAAW,CAACJ,CAAC,CAAA;AAAE,OAAC,CAAC,CAAA;AAClF,KAAA;GACD,CAAC,CACEtF,EAAAA,sBAAsB,CAAAT,aAAA,CAAMrC,EAAAA,EAAAA,KAAK,CAAE,CAAC,CACpC0C,EAAAA,aAAa,CAAC;IAAEC,IAAI,EAAEC,aAAa,CAAC6F,cAAc;IAAEhI,MAAM,EAAET,KAAK,CAACS,MAAAA;AAAO,GAAC,CAAC,CAAA,EAAA,EAAA,EAAA;IAC/EiI,WAAW,EAAE,SAAAA,WAAAA,GAAM;AACjB;AACA;MACArC,4BAA4B,CAAC,IAAI,CAAC,CAAA;KAClC;IACFsC,SAAS,EAAE,SAAAA,SAAAA,GAAM;AACf;MACAtC,4BAA4B,CAAC,KAAK,CAAC,CAAA;KACnC;IACF,YAAYrG,EAAAA,KAAK,CAACwH,KAAM;IACxB,YAAYxH,EAAAA,KAAK,CAAC4G,MAAO;AACzBN,IAAAA,aAAa,EAAEA,aAAc;IAC7BpD,KAAK,EAAElD,KAAK,CAACmH,MAAO;AACpBZ,IAAAA,gBAAgB,EAAEA,gBAAAA;AAAiB,GAAA,CACpC,CAAC,CAAA;AAEN,CAAC,CAAA;AAEKkC,IAAAA,cAAc,gBAAGhF,wBAAwB,eAAChC,cAAK,CAACmH,IAAI,CAAC7C,eAAe,CAAC,EAAE;EAC3EhG,WAAW,EAAE2D,YAAY,CAAC+E,cAAc;EACxC3I,WAAW,EAAE4D,YAAY,CAAC+E,cAAAA;AAC5B,CAAC;;;;"}
@@ -1,14 +1,18 @@
1
1
  import '../../../utils/makeSize/index.js';
2
2
  import '../../../tokens/global/index.js';
3
- import { makeSize } from '../../../utils/makeSize/makeSize.js';
4
3
  import { size } from '../../../tokens/global/size.js';
4
+ import { makeSize } from '../../../utils/makeSize/makeSize.js';
5
5
 
6
+ var actionListMaxHeight = size[300];
7
+ var getActionListPadding = function getActionListPadding(theme) {
8
+ return theme.spacing[3];
9
+ };
6
10
  var getBaseListBoxWrapperStyles = function getBaseListBoxWrapperStyles(props) {
7
11
  return {
8
- maxHeight: props.isInBottomSheet ? undefined : makeSize(size[300]),
9
- padding: props.isInBottomSheet ? undefined : makeSize(props.theme.spacing[3])
12
+ maxHeight: props.isInBottomSheet ? undefined : makeSize(actionListMaxHeight),
13
+ padding: props.isInBottomSheet ? undefined : makeSize(getActionListPadding(props.theme))
10
14
  };
11
15
  };
12
16
 
13
- export { getBaseListBoxWrapperStyles };
17
+ export { actionListMaxHeight, getActionListPadding, getBaseListBoxWrapperStyles };
14
18
  //# sourceMappingURL=getBaseListBoxWrapperStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getBaseListBoxWrapperStyles.js","sources":["../../../../../../../src/components/ActionList/styles/getBaseListBoxWrapperStyles.ts"],"sourcesContent":["import type { CSSObject } from 'styled-components';\nimport type { Theme } from '~components/BladeProvider';\nimport { makeSize } from '~utils/makeSize';\nimport { size } from '~tokens/global';\n\nconst getBaseListBoxWrapperStyles = (props: {\n theme: Theme;\n isInBottomSheet: boolean;\n}): CSSObject => {\n return {\n maxHeight: props.isInBottomSheet ? undefined : makeSize(size[300]),\n padding: props.isInBottomSheet ? undefined : makeSize(props.theme.spacing[3]),\n };\n};\n\nexport { getBaseListBoxWrapperStyles };\n"],"names":["getBaseListBoxWrapperStyles","props","maxHeight","isInBottomSheet","undefined","makeSize","size","padding","theme","spacing"],"mappings":";;;;;AAKA,IAAMA,2BAA2B,GAAG,SAA9BA,2BAA2BA,CAAIC,KAGpC,EAAgB;EACf,OAAO;AACLC,IAAAA,SAAS,EAAED,KAAK,CAACE,eAAe,GAAGC,SAAS,GAAGC,QAAQ,CAACC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClEC,IAAAA,OAAO,EAAEN,KAAK,CAACE,eAAe,GAAGC,SAAS,GAAGC,QAAQ,CAACJ,KAAK,CAACO,KAAK,CAACC,OAAO,CAAC,CAAC,CAAC,CAAA;GAC7E,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"getBaseListBoxWrapperStyles.js","sources":["../../../../../../../src/components/ActionList/styles/getBaseListBoxWrapperStyles.ts"],"sourcesContent":["import type { CSSObject } from 'styled-components';\nimport type { Theme } from '~components/BladeProvider';\nimport { makeSize } from '~utils/makeSize';\nimport { size } from '~tokens/global';\n\nconst actionListMaxHeight = size[300];\n\nconst getActionListPadding = (theme: Theme): number => {\n return theme.spacing[3];\n};\n\nconst getBaseListBoxWrapperStyles = (props: {\n theme: Theme;\n isInBottomSheet: boolean;\n}): CSSObject => {\n return {\n maxHeight: props.isInBottomSheet ? undefined : makeSize(actionListMaxHeight),\n padding: props.isInBottomSheet ? undefined : makeSize(getActionListPadding(props.theme)),\n };\n};\n\nexport { getBaseListBoxWrapperStyles, actionListMaxHeight, getActionListPadding };\n"],"names":["actionListMaxHeight","size","getActionListPadding","theme","spacing","getBaseListBoxWrapperStyles","props","maxHeight","isInBottomSheet","undefined","makeSize","padding"],"mappings":";;;;;AAKA,IAAMA,mBAAmB,GAAGC,IAAI,CAAC,GAAG,EAAC;AAErC,IAAMC,oBAAoB,GAAG,SAAvBA,oBAAoBA,CAAIC,KAAY,EAAa;AACrD,EAAA,OAAOA,KAAK,CAACC,OAAO,CAAC,CAAC,CAAC,CAAA;AACzB,EAAC;AAED,IAAMC,2BAA2B,GAAG,SAA9BA,2BAA2BA,CAAIC,KAGpC,EAAgB;EACf,OAAO;IACLC,SAAS,EAAED,KAAK,CAACE,eAAe,GAAGC,SAAS,GAAGC,QAAQ,CAACV,mBAAmB,CAAC;AAC5EW,IAAAA,OAAO,EAAEL,KAAK,CAACE,eAAe,GAAGC,SAAS,GAAGC,QAAQ,CAACR,oBAAoB,CAACI,KAAK,CAACH,KAAK,CAAC,CAAA;GACxF,CAAA;AACH;;;;"}
@@ -3,19 +3,18 @@ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProper
3
3
  import React__default from 'react';
4
4
  import { BaseMenuItemContext } from '../BaseMenuContext.js';
5
5
  import { StyledMenuItemContainer } from './StyledMenuItemContainer.web.js';
6
+ import { itemFirstRowHeight } from './tokens.js';
6
7
  import '../../Box/index.js';
7
8
  import '../../Typography/index.js';
8
- import '../../../tokens/global/index.js';
9
- import '../../../utils/index.js';
10
9
  import '../../../utils/makeAccessible/index.js';
11
10
  import '../../Typography/BaseText/index.js';
12
11
  import '../../../utils/useTruncationTitle/index.js';
12
+ import '../../../utils/index.js';
13
13
  import { jsx, jsxs } from 'react/jsx-runtime';
14
- import { makeSize } from '../../../utils/makeSize/makeSize.js';
15
- import { size } from '../../../tokens/global/size.js';
16
14
  import { useTruncationTitle } from '../../../utils/useTruncationTitle/useTruncationTitle.web.js';
17
15
  import { makeAccessible } from '../../../utils/makeAccessible/makeAccessible.web.js';
18
16
  import { Box } from '../../Box/Box.js';
17
+ import { makeSize } from '../../../utils/makeSize/makeSize.js';
19
18
  import { BaseText } from '../../Typography/BaseText/BaseText.web.js';
20
19
  import { getTextProps, Text } from '../../Typography/Text/Text.js';
21
20
 
@@ -38,7 +37,7 @@ var menuItemDescriptionColor = {
38
37
  };
39
38
 
40
39
  // This is the height of item excluding the description to make sure description comes at the bottom and other first row items are center aligned
41
- var itemFirstRowHeight = makeSize(size[20]);
40
+
42
41
  var _BaseMenuItem = function _BaseMenuItem(_ref, ref) {
43
42
  var title = _ref.title,
44
43
  description = _ref.description,
@@ -93,7 +92,7 @@ var _BaseMenuItem = function _BaseMenuItem(_ref, ref) {
93
92
  display: "flex",
94
93
  justifyContent: "center",
95
94
  alignItems: "center",
96
- height: itemFirstRowHeight,
95
+ height: makeSize(itemFirstRowHeight),
97
96
  children: leading
98
97
  }), /*#__PURE__*/jsxs(Box, {
99
98
  paddingLeft: leading ? 'spacing.3' : 'spacing.0',
@@ -104,7 +103,7 @@ var _BaseMenuItem = function _BaseMenuItem(_ref, ref) {
104
103
  display: "flex",
105
104
  alignItems: "center",
106
105
  flexDirection: "row",
107
- height: itemFirstRowHeight,
106
+ height: makeSize(itemFirstRowHeight),
108
107
  ref: containerRef,
109
108
  children: [/*#__PURE__*/jsx(BaseText, _objectSpread(_objectSpread({
110
109
  as: "p",
@@ -1 +1 @@
1
- {"version":3,"file":"BaseMenuItem.js","sources":["../../../../../../../src/components/BaseMenu/BaseMenuItem/BaseMenuItem.tsx"],"sourcesContent":["import React from 'react';\nimport type { BaseMenuItemProps } from '../types';\nimport { BaseMenuItemContext } from '../BaseMenuContext';\nimport { StyledMenuItemContainer } from './StyledMenuItemContainer';\nimport { Box } from '~components/Box';\nimport { getTextProps, Text } from '~components/Typography';\nimport { size } from '~tokens/global';\nimport { makeSize } from '~utils';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport type { BladeElementRef } from '~utils/types';\nimport { BaseText } from '~components/Typography/BaseText';\nimport { useTruncationTitle } from '~utils/useTruncationTitle';\n\nconst menuItemTitleColor = {\n negative: {\n default: 'feedback.text.negative.intense',\n disabled: 'interactive.text.gray.disabled',\n },\n normal: { default: 'interactive.text.gray.normal', disabled: 'interactive.text.gray.disabled' },\n} as const;\n\nconst menuItemDescriptionColor = {\n default: 'interactive.text.gray.muted',\n disabled: 'interactive.text.gray.disabled',\n} as const;\n\n// This is the height of item excluding the description to make sure description comes at the bottom and other first row items are center aligned\nconst itemFirstRowHeight = makeSize(size[20]);\n\nconst _BaseMenuItem: React.ForwardRefRenderFunction<BladeElementRef, BaseMenuItemProps> = (\n {\n title,\n description,\n as,\n leading,\n trailing,\n titleSuffix,\n isDisabled,\n selectionType = 'single',\n isSelected,\n isVisible = true,\n color,\n role = 'menuitem',\n children,\n ...props\n },\n ref,\n): React.ReactElement => {\n const { containerRef, textRef } = useTruncationTitle({ content: title });\n return (\n <BaseMenuItemContext.Provider value={{ color, isDisabled }}>\n <StyledMenuItemContainer\n ref={ref as never}\n as={as}\n type=\"button\"\n disabled={isDisabled}\n {...makeAccessible({\n role,\n current: role === 'menuitem' || role === 'menuitemcheckbox' ? isSelected : undefined,\n disabled: isDisabled,\n selected: isSelected,\n })}\n color={color}\n isVisible={isVisible}\n isSelected={isSelected}\n isDisabled={isDisabled}\n selectionType={selectionType}\n {...props}\n >\n {children ? (\n children\n ) : (\n <Box display=\"flex\" alignItems=\"flex-start\" width=\"100%\" justifyContent=\"flex-start\">\n <Box\n display=\"flex\"\n justifyContent=\"center\"\n alignItems=\"center\"\n height={itemFirstRowHeight}\n >\n {leading}\n </Box>\n <Box\n paddingLeft={leading ? 'spacing.3' : 'spacing.0'}\n paddingRight=\"spacing.3\"\n display=\"flex\"\n flexDirection=\"column\"\n >\n <Box\n display=\"flex\"\n alignItems=\"center\"\n flexDirection=\"row\"\n height={itemFirstRowHeight}\n ref={containerRef as never}\n >\n <BaseText\n as=\"p\"\n ref={textRef as never}\n truncateAfterLines={1}\n wordBreak=\"break-all\"\n {...getTextProps({\n size: 'medium',\n color:\n menuItemTitleColor[color === 'negative' ? 'negative' : 'normal'][\n isDisabled ? 'disabled' : 'default'\n ],\n weight: 'regular',\n })}\n >\n {title}\n </BaseText>\n {titleSuffix}\n </Box>\n <Box>\n {description ? (\n <Text\n color={menuItemDescriptionColor[isDisabled ? 'disabled' : 'default']}\n size=\"small\"\n >\n {description}\n </Text>\n ) : null}\n </Box>\n </Box>\n <Box marginLeft=\"auto\">{trailing}</Box>\n </Box>\n )}\n </StyledMenuItemContainer>\n </BaseMenuItemContext.Provider>\n );\n};\n\nconst BaseMenuItem = React.forwardRef(_BaseMenuItem);\n\nexport { BaseMenuItem };\n"],"names":["menuItemTitleColor","negative","disabled","normal","menuItemDescriptionColor","itemFirstRowHeight","makeSize","size","_BaseMenuItem","_ref","ref","title","description","as","leading","trailing","titleSuffix","isDisabled","_ref$selectionType","selectionType","isSelected","_ref$isVisible","isVisible","color","_ref$role","role","children","props","_objectWithoutProperties","_excluded","_useTruncationTitle","useTruncationTitle","content","containerRef","textRef","_jsx","BaseMenuItemContext","Provider","value","StyledMenuItemContainer","_objectSpread","type","makeAccessible","current","undefined","selected","_jsxs","Box","display","alignItems","width","justifyContent","height","paddingLeft","paddingRight","flexDir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EACHvB,kBAAkB,CAACuB,KAAK,KAAK,UAAU,GAAG,UAAU,GAAG,QAAQ,CAAC,CAC9DN,UAAU,GAAG,UAAU,GAAG,SAAS,CACpC;AACH2C,cAAAA,MAAM,EAAE,SAAA;AACV,aAAC,CAAC,CAAA,EAAA,EAAA,EAAA;AAAAlC,cAAAA,QAAA,EAEDf,KAAAA;aACO,CAAA,CAAC,EACVK,WAAW,CAAA;AAAA,WACT,CAAC,eACNmB,GAAA,CAACY,GAAG,EAAA;AAAArB,YAAAA,QAAA,EACDd,WAAW,gBACVuB,GAAA,CAAC0B,IAAI,EAAA;cACHtC,KAAK,EAAEnB,wBAAwB,CAACa,UAAU,GAAG,UAAU,GAAG,SAAS,CAAE;AACrEV,cAAAA,IAAI,EAAC,OAAO;AAAAmB,cAAAA,QAAA,EAEXd,WAAAA;AAAW,aACR,CAAC,GACL,IAAA;AAAI,WACL,CAAC,CAAA;AAAA,SACH,CAAC,eACNuB,GAAA,CAACY,GAAG,EAAA;AAACe,UAAAA,UAAU,EAAC,MAAM;AAAApC,UAAAA,QAAA,EAAEX,QAAAA;AAAQ,SAAM,CAAC,CAAA;OACpC,CAAA;KAEgB,CAAA,CAAA;AAAC,GACE,CAAC,CAAA;AAEnC,CAAC,CAAA;AAED,IAAMgD,YAAY,gBAAGC,cAAK,CAACC,UAAU,CAACzD,aAAa;;;;"}
1
+ {"version":3,"file":"BaseMenuItem.js","sources":["../../../../../../../src/components/BaseMenu/BaseMenuItem/BaseMenuItem.tsx"],"sourcesContent":["import React from 'react';\nimport type { BaseMenuItemProps } from '../types';\nimport { BaseMenuItemContext } from '../BaseMenuContext';\nimport { StyledMenuItemContainer } from './StyledMenuItemContainer';\nimport { itemFirstRowHeight } from './tokens';\nimport { Box } from '~components/Box';\nimport { getTextProps, Text } from '~components/Typography';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport type { BladeElementRef } from '~utils/types';\nimport { BaseText } from '~components/Typography/BaseText';\nimport { useTruncationTitle } from '~utils/useTruncationTitle';\nimport { makeSize } from '~utils';\n\nconst menuItemTitleColor = {\n negative: {\n default: 'feedback.text.negative.intense',\n disabled: 'interactive.text.gray.disabled',\n },\n normal: { default: 'interactive.text.gray.normal', disabled: 'interactive.text.gray.disabled' },\n} as const;\n\nconst menuItemDescriptionColor = {\n default: 'interactive.text.gray.muted',\n disabled: 'interactive.text.gray.disabled',\n} as const;\n\n// This is the height of item excluding the description to make sure description comes at the bottom and other first row items are center aligned\n\nconst _BaseMenuItem: React.ForwardRefRenderFunction<BladeElementRef, BaseMenuItemProps> = (\n {\n title,\n description,\n as,\n leading,\n trailing,\n titleSuffix,\n isDisabled,\n selectionType = 'single',\n isSelected,\n isVisible = true,\n color,\n role = 'menuitem',\n children,\n ...props\n },\n ref,\n): React.ReactElement => {\n const { containerRef, textRef } = useTruncationTitle({ content: title });\n return (\n <BaseMenuItemContext.Provider value={{ color, isDisabled }}>\n <StyledMenuItemContainer\n ref={ref as never}\n as={as}\n type=\"button\"\n disabled={isDisabled}\n {...makeAccessible({\n role,\n current: role === 'menuitem' || role === 'menuitemcheckbox' ? isSelected : undefined,\n disabled: isDisabled,\n selected: isSelected,\n })}\n color={color}\n isVisible={isVisible}\n isSelected={isSelected}\n isDisabled={isDisabled}\n selectionType={selectionType}\n {...props}\n >\n {children ? (\n children\n ) : (\n <Box display=\"flex\" alignItems=\"flex-start\" width=\"100%\" justifyContent=\"flex-start\">\n <Box\n display=\"flex\"\n justifyContent=\"center\"\n alignItems=\"center\"\n height={makeSize(itemFirstRowHeight)}\n >\n {leading}\n </Box>\n <Box\n paddingLeft={leading ? 'spacing.3' : 'spacing.0'}\n paddingRight=\"spacing.3\"\n display=\"flex\"\n flexDirection=\"column\"\n >\n <Box\n display=\"flex\"\n alignItems=\"center\"\n flexDirection=\"row\"\n height={makeSize(itemFirstRowHeight)}\n ref={containerRef as never}\n >\n <BaseText\n as=\"p\"\n ref={textRef as never}\n truncateAfterLines={1}\n wordBreak=\"break-all\"\n {...getTextProps({\n size: 'medium',\n color:\n menuItemTitleColor[color === 'negative' ? 'negative' : 'normal'][\n isDisabled ? 'disabled' : 'default'\n ],\n weight: 'regular',\n })}\n >\n {title}\n </BaseText>\n {titleSuffix}\n </Box>\n <Box>\n {description ? (\n <Text\n color={menuItemDescriptionColor[isDisabled ? 'disabled' : 'default']}\n size=\"small\"\n >\n {description}\n </Text>\n ) : null}\n </Box>\n </Box>\n <Box marginLeft=\"auto\">{trailing}</Box>\n </Box>\n )}\n </StyledMenuItemContainer>\n </BaseMenuItemContext.Provider>\n );\n};\n\nconst BaseMenuItem = React.forwardRef(_BaseMenuItem);\n\nexport { BaseMenuItem };\n"],"names":["menuItemTitleColor","negative","disabled","normal","menuItemDescriptionColor","_BaseMenuItem","_ref","ref","title","description","as","leading","trailing","titleSuffix","isDisabled","_ref$selectionType","selectionType","isSelected","_ref$isVisible","isVisible","color","_ref$role","role","children","props","_objectWithoutProperties","_excluded","_useTruncationTitle","useTruncationTitle","content","containerRef","textRef","_jsx","BaseMenuItemContext","Provider","value","StyledMenuItemContainer","_objectSpread","type","makeAccessible","current","undefined","selected","_jsxs","Box","display","alignItems","width","justifyContent","height","makeSize","itemFirstRowHeight","paddingLeft","paddingRight","flexDirection","BaseText","truncateAfterLines","wordBreak","getTextProps","size","weight","Text","marginLeft","BaseMenuItem","React","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAaA,IAAMA,kBAAkB,GAAG;AACzBC,EAAAA,QAAQ,EAAE;AACR,IAAA,SAAA,EAAS,gCAAgC;AACzCC,IAAAA,QAAQ,EAAE,gCAAA;GACX;AACDC,EAAAA,MAAM,EAAE;AAAE,IAAA,SAAA,EAAS,8BAA8B;AAAED,IAAAA,QAAQ,EAAE,gCAAA;AAAiC,GAAA;AAChG,CAAU,CAAA;AAEV,IAAME,wBAAwB,GAAG;AAC/B,EAAA,SAAA,EAAS,6BAA6B;AACtCF,EAAAA,QAAQ,EAAE,gCAAA;AACZ,CAAU,CAAA;;AAEV;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;AAAW,aACR,CAAC,GACL,IAAA;AAAI,WACL,CAAC,CAAA;AAAA,SACH,CAAC,eACNuB,GAAA,CAACY,GAAG,EAAA;AAACkB,UAAAA,UAAU,EAAC,MAAM;AAAAvC,UAAAA,QAAA,EAAEX,QAAAA;AAAQ,SAAM,CAAC,CAAA;OACpC,CAAA;KAEgB,CAAA,CAAA;AAAC,GACE,CAAC,CAAA;AAEnC,CAAC,CAAA;AAED,IAAMmD,YAAY,gBAAGC,cAAK,CAACC,UAAU,CAAC5D,aAAa;;;;"}
@@ -1,6 +1,7 @@
1
1
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
2
  import styled from 'styled-components';
3
3
  import { getBaseMenuItemStyles } from './getBaseMenuItemStyles.js';
4
+ import { getItemPadding } from './tokens.js';
4
5
  import '../../../utils/index.js';
5
6
  import '../../../utils/getFocusRingStyles/index.js';
6
7
  import '../../Box/BaseBox/index.js';
@@ -18,12 +19,12 @@ var StyledMenuItemContainer = /*#__PURE__*/styled(BaseBox).withConfig({
18
19
  return _objectSpread(_objectSpread({}, getBaseMenuItemStyles({
19
20
  theme: props.theme
20
21
  })), {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
21
- padding: makeSize(props.theme.spacing[2]),
22
+ padding: makeSize(getItemPadding(props.theme).itemPaddingMobile),
22
23
  display: props.isVisible ? 'flex' : 'none'
23
24
  }, "@media ".concat(getMediaQuery({
24
25
  min: props.theme.breakpoints.m
25
26
  })), {
26
- padding: makeSize(props.theme.spacing[3])
27
+ padding: makeSize(getItemPadding(props.theme).itemPaddingDesktop)
27
28
  }), '&:hover:not([aria-disabled=true]), &[aria-expanded="true"]', {
28
29
  backgroundColor: props.color === 'negative' ? props.theme.colors.interactive.background.negative.faded : props.theme.colors.interactive.background.gray["default"]
29
30
  }), '&:focus-visible', getFocusRingStyles({
@@ -1 +1 @@
1
- {"version":3,"file":"StyledMenuItemContainer.web.js","sources":["../../../../../../../src/components/BaseMenu/BaseMenuItem/StyledMenuItemContainer.web.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport type { StyledBaseMenuItemContainerProps } from '../types';\nimport { getBaseMenuItemStyles } from './getBaseMenuItemStyles';\nimport { getMediaQuery, makeSize } from '~utils';\nimport { getFocusRingStyles } from '~utils/getFocusRingStyles';\nimport BaseBox from '~components/Box/BaseBox';\n\nconst StyledMenuItemContainer = styled(BaseBox)<StyledBaseMenuItemContainerProps>((props) => {\n return {\n ...getBaseMenuItemStyles({ theme: props.theme }),\n padding: makeSize(props.theme.spacing[2]),\n display: props.isVisible ? 'flex' : 'none',\n [`@media ${getMediaQuery({ min: props.theme.breakpoints.m })}`]: {\n padding: makeSize(props.theme.spacing[3]),\n },\n '&:hover:not([aria-disabled=true]), &[aria-expanded=\"true\"]': {\n backgroundColor:\n props.color === 'negative'\n ? props.theme.colors.interactive.background.negative.faded\n : props.theme.colors.interactive.background.gray.default,\n },\n '&:focus-visible': getFocusRingStyles({ theme: props.theme }),\n '&.active-focus': props.isKeydownPressed\n ? getFocusRingStyles({ theme: props.theme })\n : undefined,\n '&[aria-selected=true]': {\n backgroundColor:\n props.selectionType === 'single'\n ? props.theme.colors.interactive.background.primary.faded\n : undefined,\n },\n '&[aria-selected=true]:hover': {\n backgroundColor: props.theme.colors.interactive.background.primary.fadedHighlighted,\n },\n };\n});\n\nexport { StyledMenuItemContainer };\n"],"names":["StyledMenuItemContainer","styled","BaseBox","withConfig","displayName","componentId","props","_objectSpread","getBaseMenuItemStyles","theme","_defineProperty","padding","makeSize","spacing","display","isVisible","concat","getMediaQuery","min","breakpoints","m","backgroundColor","color","colors","interactive","background","negative","faded","gray","getFocusRingStyles","isKeydownPressed","undefined","selectionType","primary","fadedHighlighted"],"mappings":";;;;;;;;;;;;;AAOA,IAAMA,uBAAuB,gBAAGC,MAAM,CAACC,OAAO,CAAC,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,qDAAA;EAAAC,WAAA,EAAA,UAAA;AAAA,CAAmC,CA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,CAAC0B,aAAa,KAAK,QAAQ,GAC5B1B,KAAK,CAACG,KAAK,CAACc,MAAM,CAACC,WAAW,CAACC,UAAU,CAACQ,OAAO,CAACN,KAAK,GACvDI,SAAAA;GACP,CAAA,EACD,6BAA6B,EAAE;AAC7BV,IAAAA,eAAe,EAAEf,KAAK,CAACG,KAAK,CAACc,MAAM,CAACC,WAAW,CAACC,UAAU,CAACQ,OAAO,CAACC,gBAAAA;GACpE,CAAA,CAAA,CAAA;AAEL,CAAC;;;;"}
1
+ {"version":3,"file":"StyledMenuItemContainer.web.js","sources":["../../../../../../../src/components/BaseMenu/BaseMenuItem/StyledMenuItemContainer.web.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport type { StyledBaseMenuItemContainerProps } from '../types';\nimport { getBaseMenuItemStyles } from './getBaseMenuItemStyles';\nimport { getItemPadding } from './tokens';\nimport { getMediaQuery, makeSize } from '~utils';\nimport { getFocusRingStyles } from '~utils/getFocusRingStyles';\nimport BaseBox from '~components/Box/BaseBox';\n\nconst StyledMenuItemContainer = styled(BaseBox)<StyledBaseMenuItemContainerProps>((props) => {\n return {\n ...getBaseMenuItemStyles({ theme: props.theme }),\n padding: makeSize(getItemPadding(props.theme).itemPaddingMobile),\n display: props.isVisible ? 'flex' : 'none',\n [`@media ${getMediaQuery({ min: props.theme.breakpoints.m })}`]: {\n padding: makeSize(getItemPadding(props.theme).itemPaddingDesktop),\n },\n '&:hover:not([aria-disabled=true]), &[aria-expanded=\"true\"]': {\n backgroundColor:\n props.color === 'negative'\n ? props.theme.colors.interactive.background.negative.faded\n : props.theme.colors.interactive.background.gray.default,\n },\n '&:focus-visible': getFocusRingStyles({ theme: props.theme }),\n '&.active-focus': props.isKeydownPressed\n ? getFocusRingStyles({ theme: props.theme })\n : undefined,\n '&[aria-selected=true]': {\n backgroundColor:\n props.selectionType === 'single'\n ? props.theme.colors.interactive.background.primary.faded\n : undefined,\n },\n '&[aria-selected=true]:hover': {\n backgroundColor: props.theme.colors.interactive.background.primary.fadedHighlighted,\n },\n };\n});\n\nexport { StyledMenuItemContainer };\n"],"names":["StyledMenuItemContainer","styled","BaseBox","withConfig","displayName","componentId","props","_objectSpread","getBaseMenuItemStyles","theme","_defineProperty","padding","makeSize","getItemPadding","itemPaddingMobile","display","isVisible","concat","getMediaQuery","min","breakpoints","m","itemPaddingDesktop","backgroundColor","color","colors","interactive","background","negative","faded","gray","getFocusRingStyles","isKeydownPressed","undefined","selectionType","primary","fadedHighlighted"],"mappings":";;;;;;;;;;;;;;AAQA,IAAMA,uBAAuB,gBAAGC,MAAM,CAACC,OAAO,CAAC,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,qDAAA;EAAAC,WAAA,EAAA,UAAA;AAAA,CAAmC,CAAA,CAAA,UAACC,KAAK,EAAK;AAC3F,EAAA,OAAAC,aAAA,CAAAA,aAAA,CAAA,EAAA,EACKC,qBAAqB,CAAC;IAAEC,KAAK,EAAEH,KAAK,CAACG,KAAAA;AAAM,GAAC,CAAC,CAAA,EAAA,EAAA,EAAAC,eAAA,CAAAA,eAAA,CAAAA,eAAA,CAAAA,eAAA,CAAAA,eAAA,CAAAA,eAAA,CAAA;IAChDC,OAAO,EAAEC,QAAQ,CAACC,cAAc,CAACP,KAAK,CAACG,KAAK,CAAC,CAACK,iBAAiB,CAAC;AAChEC,IAAAA,OAAO,EAAET,KAAK,CAACU,SAAS,GAAG,MAAM,GAAG,MAAA;GAAMC,EAAAA,SAAAA,CAAAA,MAAA,CAC/BC,aAAa,CAAC;AAAEC,IAAAA,GAAG,EAAEb,KAAK,CAACG,KAAK,CAACW,WAAW,CAACC,CAAAA;AAAE,GAAC,CAAC,CAAK,EAAA;IAC/DV,OAAO,EAAEC,QAAQ,CAACC,cAAc,CAACP,KAAK,CAACG,KAAK,CAAC,CAACa,kBAAkB,CAAA;GACjE,CAAA,EACD,4DAA4D,EAAE;AAC5DC,IAAAA,eAAe,EACbjB,KAAK,CAACkB,KAAK,KAAK,UAAU,GACtBlB,KAAK,CAACG,KAAK,CAACgB,MAAM,CAACC,WAAW,CAACC,UAAU,CAACC,QAAQ,CAACC,KAAK,GACxDvB,KAAK,CAACG,KAAK,CAACgB,MAAM,CAACC,WAAW,CAACC,UAAU,CAACG,IAAI,CAAA,SAAA,CAAA;AACtD,GAAC,CACD,EAAA,iBAAiB,EAAEC,kBAAkB,CAAC;IAAEtB,KAAK,EAAEH,KAAK,CAACG,KAAAA;GAAO,CAAC,GAC7D,gBAAgB,EAAEH,KAAK,CAAC0B,gBAAgB,GACpCD,kBAAkB,CAAC;IAAEtB,KAAK,EAAEH,KAAK,CAACG,KAAAA;AAAM,GAAC,CAAC,GAC1CwB,SAAS,CAAA,EACb,uBAAuB,EAAE;IACvBV,eAAe,EACbjB,KAAK,CAAC4B,aAAa,KAAK,QAAQ,GAC5B5B,KAAK,CAACG,KAAK,CAACgB,MAAM,CAACC,WAAW,CAACC,UAAU,CAACQ,OAAO,CAACN,KAAK,GACvDI,SAAAA;GACP,CAAA,EACD,6BAA6B,EAAE;AAC7BV,IAAAA,eAAe,EAAEjB,KAAK,CAACG,KAAK,CAACgB,MAAM,CAACC,WAAW,CAACC,UAAU,CAACQ,OAAO,CAACC,gBAAAA;GACpE,CAAA,CAAA,CAAA;AAEL,CAAC;;;;"}
@@ -1,3 +1,4 @@
1
+ import { getItemMargin } from './tokens.js';
1
2
  import '../../../utils/index.js';
2
3
  import '../../../utils/makeSize/index.js';
3
4
  import { makeBorderSize } from '../../../utils/makeBorderSize/makeBorderSize.js';
@@ -12,8 +13,8 @@ var getBaseMenuItemStyles = function getBaseMenuItemStyles(props) {
12
13
  textAlign: isReactNative() ? undefined : 'left',
13
14
  backgroundColor: 'transparent',
14
15
  borderRadius: makeSize(props.theme.border.radius.medium),
15
- marginTop: makeSize(props.theme.spacing[1]),
16
- marginBottom: makeSize(props.theme.spacing[1]),
16
+ marginTop: makeSize(getItemMargin(props.theme)),
17
+ marginBottom: makeSize(getItemMargin(props.theme)),
17
18
  textDecoration: 'none',
18
19
  cursor: 'pointer',
19
20
  width: '100%'
@@ -1 +1 @@
1
- {"version":3,"file":"getBaseMenuItemStyles.js","sources":["../../../../../../../src/components/BaseMenu/BaseMenuItem/getBaseMenuItemStyles.ts"],"sourcesContent":["import type { CSSObject } from 'styled-components';\nimport type { Theme } from '~components/BladeProvider';\nimport { isReactNative, makeBorderSize } from '~utils';\nimport { makeSize } from '~utils/makeSize';\n\nconst getBaseMenuItemStyles = (props: { theme: Theme }): CSSObject => {\n return {\n borderWidth: makeBorderSize(props.theme.border.width.none),\n display: 'flex',\n flexDirection: 'column',\n textAlign: isReactNative() ? undefined : 'left',\n backgroundColor: 'transparent',\n borderRadius: makeSize(props.theme.border.radius.medium),\n marginTop: makeSize(props.theme.spacing[1]),\n marginBottom: makeSize(props.theme.spacing[1]),\n textDecoration: 'none',\n cursor: 'pointer',\n width: '100%',\n };\n};\n\nexport { getBaseMenuItemStyles };\n"],"names":["getBaseMenuItemStyles","props","borderWidth","makeBorderSize","theme","border","width","none","display","flexDirection","textAlign","isReactNative","undefined","backgroundColor","borderRadius","makeSize","radius","medium","marginTop","spacing","marginBottom","textDecoration","cursor"],"mappings":";;;;;;AAKA,IAAMA,qBAAqB,GAAG,SAAxBA,qBAAqBA,CAAIC,KAAuB,EAAgB;EACpE,OAAO;AACLC,IAAAA,WAAW,EAAEC,cAAc,CAACF,KAAK,CAACG,KAAK,CAACC,MAAM,CAACC,KAAK,CAACC,IAAI,CAAC;AAC1DC,IAAAA,OAAO,EAAE,MAAM;AACfC,IAAAA,aAAa,EAAE,QAAQ;AACvBC,IAAAA,SAAS,EAAEC,aAAa,EAAE,GAAGC,SAAS,GAAG,MAAM;AAC/CC,IAAAA,eAAe,EAAE,aAAa;AAC9BC,IAAAA,YAAY,EAAEC,QAAQ,CAACd,KAAK,CAACG,KAAK,CAACC,MAAM,CAACW,MAAM,CAACC,MAAM,CAAC;IACxDC,SAAS,EAAEH,QAAQ,CAACd,KAAK,CAACG,KAAK,CAACe,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3CC,YAAY,EAAEL,QAAQ,CAACd,KAAK,CAACG,KAAK,CAACe,OAAO,CAAC,CAAC,CAAC,CAAC;AAC9CE,IAAAA,cAAc,EAAE,MAAM;AACtBC,IAAAA,MAAM,EAAE,SAAS;AACjBhB,IAAAA,KAAK,EAAE,MAAA;GACR,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"getBaseMenuItemStyles.js","sources":["../../../../../../../src/components/BaseMenu/BaseMenuItem/getBaseMenuItemStyles.ts"],"sourcesContent":["import type { CSSObject } from 'styled-components';\nimport { getItemMargin } from './tokens';\nimport type { Theme } from '~components/BladeProvider';\nimport { isReactNative, makeBorderSize } from '~utils';\nimport { makeSize } from '~utils/makeSize';\n\nconst getBaseMenuItemStyles = (props: { theme: Theme }): CSSObject => {\n return {\n borderWidth: makeBorderSize(props.theme.border.width.none),\n display: 'flex',\n flexDirection: 'column',\n textAlign: isReactNative() ? undefined : 'left',\n backgroundColor: 'transparent',\n borderRadius: makeSize(props.theme.border.radius.medium),\n marginTop: makeSize(getItemMargin(props.theme)),\n marginBottom: makeSize(getItemMargin(props.theme)),\n textDecoration: 'none',\n cursor: 'pointer',\n width: '100%',\n };\n};\n\nexport { getBaseMenuItemStyles };\n"],"names":["getBaseMenuItemStyles","props","borderWidth","makeBorderSize","theme","border","width","none","display","flexDirection","textAlign","isReactNative","undefined","backgroundColor","borderRadius","makeSize","radius","medium","marginTop","getItemMargin","marginBottom","textDecoration","cursor"],"mappings":";;;;;;;AAMA,IAAMA,qBAAqB,GAAG,SAAxBA,qBAAqBA,CAAIC,KAAuB,EAAgB;EACpE,OAAO;AACLC,IAAAA,WAAW,EAAEC,cAAc,CAACF,KAAK,CAACG,KAAK,CAACC,MAAM,CAACC,KAAK,CAACC,IAAI,CAAC;AAC1DC,IAAAA,OAAO,EAAE,MAAM;AACfC,IAAAA,aAAa,EAAE,QAAQ;AACvBC,IAAAA,SAAS,EAAEC,aAAa,EAAE,GAAGC,SAAS,GAAG,MAAM;AAC/CC,IAAAA,eAAe,EAAE,aAAa;AAC9BC,IAAAA,YAAY,EAAEC,QAAQ,CAACd,KAAK,CAACG,KAAK,CAACC,MAAM,CAACW,MAAM,CAACC,MAAM,CAAC;IACxDC,SAAS,EAAEH,QAAQ,CAACI,aAAa,CAAClB,KAAK,CAACG,KAAK,CAAC,CAAC;IAC/CgB,YAAY,EAAEL,QAAQ,CAACI,aAAa,CAAClB,KAAK,CAACG,KAAK,CAAC,CAAC;AAClDiB,IAAAA,cAAc,EAAE,MAAM;AACtBC,IAAAA,MAAM,EAAE,SAAS;AACjBhB,IAAAA,KAAK,EAAE,MAAA;GACR,CAAA;AACH;;;;"}
@@ -0,0 +1,26 @@
1
+ import '../../../tokens/global/index.js';
2
+ import { size } from '../../../tokens/global/size.js';
3
+
4
+ var itemFirstRowHeight = size[20];
5
+ var getItemPadding = function getItemPadding(theme) {
6
+ return {
7
+ itemPaddingMobile: theme.spacing[2],
8
+ itemPaddingDesktop: theme.spacing[3]
9
+ };
10
+ };
11
+ var getItemMargin = function getItemMargin(theme) {
12
+ return theme.spacing[1];
13
+ };
14
+ var getItemHeight = function getItemHeight(theme) {
15
+ return {
16
+ itemHeightMobile:
17
+ // eslint-disable-next-line @typescript-eslint/restrict-plus-operands
18
+ itemFirstRowHeight + getItemPadding(theme).itemPaddingMobile * 2 + getItemMargin(theme) * 2,
19
+ itemHeightDesktop:
20
+ // eslint-disable-next-line @typescript-eslint/restrict-plus-operands
21
+ itemFirstRowHeight + getItemPadding(theme).itemPaddingDesktop * 2 + getItemMargin(theme) * 2
22
+ };
23
+ };
24
+
25
+ export { getItemHeight, getItemMargin, getItemPadding, itemFirstRowHeight };
26
+ //# sourceMappingURL=tokens.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.js","sources":["../../../../../../../src/components/BaseMenu/BaseMenuItem/tokens.ts"],"sourcesContent":["import type { Theme } from '~components/BladeProvider';\nimport { size } from '~tokens/global';\n\nconst itemFirstRowHeight = size[20];\n\nconst getItemPadding = (\n theme: Theme,\n): {\n itemPaddingMobile: 4;\n itemPaddingDesktop: 8;\n} => {\n return {\n itemPaddingMobile: theme.spacing[2],\n itemPaddingDesktop: theme.spacing[3],\n };\n};\n\nconst getItemMargin = (theme: Theme): number => {\n return theme.spacing[1];\n};\n\nconst getItemHeight = (\n theme: Theme,\n): {\n itemHeightMobile: number;\n itemHeightDesktop: number;\n} => {\n return {\n itemHeightMobile:\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n itemFirstRowHeight + getItemPadding(theme).itemPaddingMobile * 2 + getItemMargin(theme) * 2,\n itemHeightDesktop:\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n itemFirstRowHeight + getItemPadding(theme).itemPaddingDesktop * 2 + getItemMargin(theme) * 2,\n };\n};\n\nexport { itemFirstRowHeight, getItemPadding, getItemMargin, getItemHeight };\n"],"names":["itemFirstRowHeight","size","getItemPadding","theme","itemPaddingMobile","spacing","itemPaddingDesktop","getItemMargin","getItemHeight","itemHeightMobile","itemHeightDesktop"],"mappings":";;;AAGA,IAAMA,kBAAkB,GAAGC,IAAI,CAAC,EAAE,EAAC;AAEnC,IAAMC,cAAc,GAAG,SAAjBA,cAAcA,CAClBC,KAAY,EAIT;EACH,OAAO;AACLC,IAAAA,iBAAiB,EAAED,KAAK,CAACE,OAAO,CAAC,CAAC,CAAC;AACnCC,IAAAA,kBAAkB,EAAEH,KAAK,CAACE,OAAO,CAAC,CAAC,CAAA;GACpC,CAAA;AACH,EAAC;AAED,IAAME,aAAa,GAAG,SAAhBA,aAAaA,CAAIJ,KAAY,EAAa;AAC9C,EAAA,OAAOA,KAAK,CAACE,OAAO,CAAC,CAAC,CAAC,CAAA;AACzB,EAAC;AAED,IAAMG,aAAa,GAAG,SAAhBA,aAAaA,CACjBL,KAAY,EAIT;EACH,OAAO;IACLM,gBAAgB;AACd;AACAT,IAAAA,kBAAkB,GAAGE,cAAc,CAACC,KAAK,CAAC,CAACC,iBAAiB,GAAG,CAAC,GAAGG,aAAa,CAACJ,KAAK,CAAC,GAAG,CAAC;IAC7FO,iBAAiB;AACf;AACAV,IAAAA,kBAAkB,GAAGE,cAAc,CAACC,KAAK,CAAC,CAACG,kBAAkB,GAAG,CAAC,GAAGC,aAAa,CAACJ,KAAK,CAAC,GAAG,CAAA;GAC9F,CAAA;AACH;;;;"}
@@ -1,7 +1,15 @@
1
- import { useRef, useInsertionEffect, useCallback } from 'react';
1
+ import React__default, { useRef, useCallback } from 'react';
2
+ import { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect.js';
2
3
 
4
+ /* eslint-disable @typescript-eslint/no-explicit-any */
3
5
  /* eslint-disable @typescript-eslint/explicit-function-return-type */
4
6
 
7
+ // Prevent webpack from importing this:
8
+ // https://github.com/webpack/webpack/issues/14814#issuecomment-1536757985
9
+ // https://github.com/radix-ui/primitives/issues/2796
10
+ var useReactInsertionEffect = React__default[' useInsertionEffect '.trim().toString()];
11
+ var useInsertionEffectFallback = useReactInsertionEffect || useIsomorphicLayoutEffect;
12
+
5
13
  /**
6
14
  * This hook is user-land implementation of the experimental `useEffectEvent` hook.
7
15
  * React docs: https://react.dev/learn/separating-events-from-effects#declaring-an-effect-event
@@ -10,10 +18,8 @@ import { useRef, useInsertionEffect, useCallback } from 'react';
10
18
  */
11
19
  function useCallbackRef(callback) {
12
20
  var deps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
13
- var callbackRef = useRef(function () {
14
- throw new Error('Cannot call an event handler while rendering.');
15
- });
16
- useInsertionEffect(function () {
21
+ var callbackRef = useRef(callback);
22
+ useInsertionEffectFallback(function () {
17
23
  callbackRef.current = callback;
18
24
  });
19
25
 
@@ -1 +1 @@
1
- {"version":3,"file":"useCallbackRef.js","sources":["../../../../../src/utils/useCallbackRef.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/explicit-function-return-type */\nimport { useCallback, useInsertionEffect, useRef } from 'react';\n\n/**\n * This hook is user-land implementation of the experimental `useEffectEvent` hook.\n * React docs: https://react.dev/learn/separating-events-from-effects#declaring-an-effect-event\n *\n * This hook is useful when you want to use a callback function inside a useEffect while keeping it \"fresh\" but you don't want to add it to the dependency array.\n */\nfunction useCallbackRef<Args extends unknown[], Return>(\n callback: ((...args: Args) => Return) | undefined,\n deps: React.DependencyList = [],\n) {\n const callbackRef = useRef<typeof callback>(() => {\n throw new Error('Cannot call an event handler while rendering.');\n });\n\n useInsertionEffect(() => {\n callbackRef.current = callback;\n });\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return useCallback((...args: Args) => callbackRef.current?.(...args), deps);\n}\n\nexport { useCallbackRef };\n"],"names":["useCallbackRef","callback","deps","arguments","length","undefined","callbackRef","useRef","Error","useInsertionEffect","current","useCallback","_callbackRef$current","_len","args","Array","_key","call","apply","concat"],"mappings":";;AAAA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,cAAcA,CACrBC,QAAiD,EAEjD;AAAA,EAAA,IADAC,IAA0B,GAAAC,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,EAAE,CAAA;AAE/B,EAAA,IAAMG,WAAW,GAAGC,MAAM,CAAkB,YAAM;AAChD,IAAA,MAAM,IAAIC,KAAK,CAAC,+CAA+C,CAAC,CAAA;AAClE,GAAC,CAAC,CAAA;AAEFC,EAAAA,kBAAkB,CAAC,YAAM;IACvBH,WAAW,CAACI,OAAO,GAAGT,QAAQ,CAAA;AAChC,GAAC,CAAC,CAAA;;AAEF;AACA,EAAA,OAAOU,WAAW,CAAC,YAAA;AAAA,IAAA,IAAAC,oBAAA,CAAA;AAAA,IAAA,KAAA,IAAAC,IAAA,GAAAV,SAAA,CAAAC,MAAA,EAAIU,IAAI,GAAAC,IAAAA,KAAA,CAAAF,IAAA,GAAAG,IAAA,GAAA,CAAA,EAAAA,IAAA,GAAAH,IAAA,EAAAG,IAAA,EAAA,EAAA;AAAJF,MAAAA,IAAI,CAAAE,IAAA,CAAAb,GAAAA,SAAA,CAAAa,IAAA,CAAA,CAAA;AAAA,KAAA;IAAA,OAAAJ,CAAAA,oBAAA,GAAWN,WAAW,CAACI,OAAO,MAAAE,IAAAA,IAAAA,oBAAA,uBAAnBA,oBAAA,CAAAK,IAAA,CAAAC,KAAA,CAAAN,oBAAA,EAAA,CAAAN,WAAW,CAAAa,CAAAA,MAAA,CAAcL,IAAI,CAAC,CAAA,CAAA;AAAA,GAAA,EAAEZ,IAAI,CAAC,CAAA;AAC7E;;;;"}
1
+ {"version":3,"file":"useCallbackRef.js","sources":["../../../../../src/utils/useCallbackRef.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/explicit-function-return-type */\nimport React, { useCallback, useRef } from 'react';\nimport { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect';\n\n// Prevent webpack from importing this:\n// https://github.com/webpack/webpack/issues/14814#issuecomment-1536757985\n// https://github.com/radix-ui/primitives/issues/2796\nconst useReactInsertionEffect = (React as any)[' useInsertionEffect '.trim().toString()];\nconst useInsertionEffectFallback = useReactInsertionEffect || useIsomorphicLayoutEffect;\n\n/**\n * This hook is user-land implementation of the experimental `useEffectEvent` hook.\n * React docs: https://react.dev/learn/separating-events-from-effects#declaring-an-effect-event\n *\n * This hook is useful when you want to use a callback function inside a useEffect while keeping it \"fresh\" but you don't want to add it to the dependency array.\n */\nfunction useCallbackRef<Args extends unknown[], Return>(\n callback: ((...args: Args) => Return) | undefined,\n deps: React.DependencyList = [],\n) {\n const callbackRef = useRef<typeof callback>(callback);\n\n useInsertionEffectFallback(() => {\n callbackRef.current = callback;\n });\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return useCallback((...args: Args) => callbackRef.current?.(...args), deps);\n}\n\nexport { useCallbackRef };\n"],"names":["useReactInsertionEffect","React","trim","toString","useInsertionEffectFallback","useIsomorphicLayoutEffect","useCallbackRef","callback","deps","arguments","length","undefined","callbackRef","useRef","current","useCallback","_callbackRef$current","_len","args","Array","_key","call","apply","concat"],"mappings":";;;AAAA;AACA;;AAIA;AACA;AACA;AACA,IAAMA,uBAAuB,GAAIC,cAAK,CAAS,sBAAsB,CAACC,IAAI,EAAE,CAACC,QAAQ,EAAE,CAAC,CAAA;AACxF,IAAMC,0BAA0B,GAAGJ,uBAAuB,IAAIK,yBAAyB,CAAA;;AAEvF;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,cAAcA,CACrBC,QAAiD,EAEjD;AAAA,EAAA,IADAC,IAA0B,GAAAC,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,EAAE,CAAA;AAE/B,EAAA,IAAMG,WAAW,GAAGC,MAAM,CAAkBN,QAAQ,CAAC,CAAA;AAErDH,EAAAA,0BAA0B,CAAC,YAAM;IAC/BQ,WAAW,CAACE,OAAO,GAAGP,QAAQ,CAAA;AAChC,GAAC,CAAC,CAAA;;AAEF;AACA,EAAA,OAAOQ,WAAW,CAAC,YAAA;AAAA,IAAA,IAAAC,oBAAA,CAAA;AAAA,IAAA,KAAA,IAAAC,IAAA,GAAAR,SAAA,CAAAC,MAAA,EAAIQ,IAAI,GAAAC,IAAAA,KAAA,CAAAF,IAAA,GAAAG,IAAA,GAAA,CAAA,EAAAA,IAAA,GAAAH,IAAA,EAAAG,IAAA,EAAA,EAAA;AAAJF,MAAAA,IAAI,CAAAE,IAAA,CAAAX,GAAAA,SAAA,CAAAW,IAAA,CAAA,CAAA;AAAA,KAAA;IAAA,OAAAJ,CAAAA,oBAAA,GAAWJ,WAAW,CAACE,OAAO,MAAAE,IAAAA,IAAAA,oBAAA,uBAAnBA,oBAAA,CAAAK,IAAA,CAAAC,KAAA,CAAAN,oBAAA,EAAA,CAAAJ,WAAW,CAAAW,CAAAA,MAAA,CAAcL,IAAI,CAAC,CAAA,CAAA;AAAA,GAAA,EAAEV,IAAI,CAAC,CAAA;AAC7E;;;;"}
@@ -688,9 +688,9 @@ type ContainerElementType = Platform.Select<{
688
688
  * eg: `data-analytics-action="click"`
689
689
  * eg: `data-analytics-section="header"`
690
690
  */
691
- interface DataAnalyticsAttribute {
691
+ type DataAnalyticsAttribute = {
692
692
  [key: DataAnalyticsKey]: string;
693
- }
693
+ };
694
694
 
695
695
  /**
696
696
  * Returns the value or the responsive object with that value
@@ -2880,6 +2880,7 @@ declare const AccordionItem: ({ title, description, icon, children, isDisabled,
2880
2880
 
2881
2881
  type ActionListProps = {
2882
2882
  children: React__default.ReactNode[];
2883
+ isVirtualized?: boolean;
2883
2884
  } & TestID & DataAnalyticsAttribute;
2884
2885
  /**
2885
2886
  * ### ActionList
@@ -2912,7 +2913,7 @@ type ActionListProps = {
2912
2913
  * ```
2913
2914
  *
2914
2915
  */
2915
- declare const ActionList: React__default.MemoExoticComponent<({ children, testID, ...rest }: ActionListProps) => React__default.ReactElement>;
2916
+ declare const ActionList: React__default.MemoExoticComponent<({ children, testID, isVirtualized, ...rest }: ActionListProps) => React__default.ReactElement>;
2916
2917
 
2917
2918
  type BadgeProps = {
2918
2919
  /**