@razorpay/blade 12.1.1 → 12.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lib/native/components/ActionList/ActionList.js +1 -1
- package/build/lib/native/components/ActionList/ActionList.js.map +1 -1
- package/build/lib/native/components/ActionList/ActionListBox.native.js +1 -1
- package/build/lib/native/components/ActionList/ActionListBox.native.js.map +1 -1
- package/build/lib/native/components/ActionList/ActionListItem.js +1 -1
- package/build/lib/native/components/ActionList/ActionListItem.js.map +1 -1
- package/build/lib/native/components/ActionList/styles/getBaseListBoxWrapperStyles.js +2 -2
- package/build/lib/native/components/ActionList/styles/getBaseListBoxWrapperStyles.js.map +1 -1
- package/build/lib/native/components/BaseMenu/BaseMenuItem/BaseMenuItem.js +5 -7
- package/build/lib/native/components/BaseMenu/BaseMenuItem/BaseMenuItem.js.map +1 -1
- package/build/lib/native/components/BaseMenu/BaseMenuItem/getBaseMenuItemStyles.js +2 -1
- package/build/lib/native/components/BaseMenu/BaseMenuItem/getBaseMenuItemStyles.js.map +1 -1
- package/build/lib/native/components/BaseMenu/BaseMenuItem/tokens.js +8 -0
- package/build/lib/native/components/BaseMenu/BaseMenuItem/tokens.js.map +1 -0
- package/build/lib/web/development/components/ActionList/ActionList.js +6 -7
- package/build/lib/web/development/components/ActionList/ActionList.js.map +1 -1
- package/build/lib/web/development/components/ActionList/ActionListBox.web.js +114 -3
- package/build/lib/web/development/components/ActionList/ActionListBox.web.js.map +1 -1
- package/build/lib/web/development/components/ActionList/ActionListItem.js +57 -60
- package/build/lib/web/development/components/ActionList/ActionListItem.js.map +1 -1
- package/build/lib/web/development/components/ActionList/styles/getBaseListBoxWrapperStyles.js +8 -4
- package/build/lib/web/development/components/ActionList/styles/getBaseListBoxWrapperStyles.js.map +1 -1
- package/build/lib/web/development/components/BaseMenu/BaseMenuItem/BaseMenuItem.js +6 -7
- package/build/lib/web/development/components/BaseMenu/BaseMenuItem/BaseMenuItem.js.map +1 -1
- package/build/lib/web/development/components/BaseMenu/BaseMenuItem/StyledMenuItemContainer.web.js +3 -2
- package/build/lib/web/development/components/BaseMenu/BaseMenuItem/StyledMenuItemContainer.web.js.map +1 -1
- package/build/lib/web/development/components/BaseMenu/BaseMenuItem/getBaseMenuItemStyles.js +3 -2
- package/build/lib/web/development/components/BaseMenu/BaseMenuItem/getBaseMenuItemStyles.js.map +1 -1
- package/build/lib/web/development/components/BaseMenu/BaseMenuItem/tokens.js +26 -0
- package/build/lib/web/development/components/BaseMenu/BaseMenuItem/tokens.js.map +1 -0
- package/build/lib/web/development/components/DatePicker/Calendar.web.js +4 -2
- package/build/lib/web/development/components/DatePicker/Calendar.web.js.map +1 -1
- package/build/lib/web/development/components/DatePicker/CalendarHeader.web.js +45 -31
- package/build/lib/web/development/components/DatePicker/CalendarHeader.web.js.map +1 -1
- package/build/lib/web/development/components/DatePicker/DateInput.web.js +6 -5
- package/build/lib/web/development/components/DatePicker/DateInput.web.js.map +1 -1
- package/build/lib/web/development/components/DatePicker/DatePicker.web.js +32 -2
- package/build/lib/web/development/components/DatePicker/DatePicker.web.js.map +1 -1
- package/build/lib/web/production/components/ActionList/ActionList.js +6 -7
- package/build/lib/web/production/components/ActionList/ActionList.js.map +1 -1
- package/build/lib/web/production/components/ActionList/ActionListBox.web.js +114 -3
- package/build/lib/web/production/components/ActionList/ActionListBox.web.js.map +1 -1
- package/build/lib/web/production/components/ActionList/ActionListItem.js +57 -60
- package/build/lib/web/production/components/ActionList/ActionListItem.js.map +1 -1
- package/build/lib/web/production/components/ActionList/styles/getBaseListBoxWrapperStyles.js +8 -4
- package/build/lib/web/production/components/ActionList/styles/getBaseListBoxWrapperStyles.js.map +1 -1
- package/build/lib/web/production/components/BaseMenu/BaseMenuItem/BaseMenuItem.js +6 -7
- package/build/lib/web/production/components/BaseMenu/BaseMenuItem/BaseMenuItem.js.map +1 -1
- package/build/lib/web/production/components/BaseMenu/BaseMenuItem/StyledMenuItemContainer.web.js +3 -2
- package/build/lib/web/production/components/BaseMenu/BaseMenuItem/StyledMenuItemContainer.web.js.map +1 -1
- package/build/lib/web/production/components/BaseMenu/BaseMenuItem/getBaseMenuItemStyles.js +3 -2
- package/build/lib/web/production/components/BaseMenu/BaseMenuItem/getBaseMenuItemStyles.js.map +1 -1
- package/build/lib/web/production/components/BaseMenu/BaseMenuItem/tokens.js +26 -0
- package/build/lib/web/production/components/BaseMenu/BaseMenuItem/tokens.js.map +1 -0
- package/build/lib/web/production/components/DatePicker/Calendar.web.js +4 -2
- package/build/lib/web/production/components/DatePicker/Calendar.web.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/CalendarHeader.web.js +45 -31
- package/build/lib/web/production/components/DatePicker/CalendarHeader.web.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/DateInput.web.js +6 -5
- package/build/lib/web/production/components/DatePicker/DateInput.web.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/DatePicker.web.js +32 -2
- package/build/lib/web/production/components/DatePicker/DatePicker.web.js.map +1 -1
- package/build/types/components/index.d.ts +15 -2
- package/build/types/components/index.native.d.ts +12 -1
- package/package.json +4 -2
|
@@ -16,7 +16,7 @@ import { dropdownComponentIds } from '../Dropdown/dropdownComponentIds.js';
|
|
|
16
16
|
import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
|
|
17
17
|
import { jsx } from 'react/jsx-runtime';
|
|
18
18
|
|
|
19
|
-
var _excluded=["children","testID"];var _ActionList=function _ActionList(_ref){var children=_ref.children,testID=_ref.testID,rest=_objectWithoutProperties(_ref,_excluded);var _useDropdown=useDropdown(),setOptions=_useDropdown.setOptions,actionListItemRef=_useDropdown.actionListItemRef,selectionType=_useDropdown.selectionType,dropdownBaseId=_useDropdown.dropdownBaseId,dropdownTriggerer=_useDropdown.dropdownTriggerer,hasFooterAction=_useDropdown.hasFooterAction,filteredValues=_useDropdown.filteredValues;var _useBottomSheetContex=useBottomSheetContext(),isInBottomSheet=_useBottomSheetContex.isInBottomSheet;var _React$useMemo=React__default.useMemo(function(){return getActionListProperties(children);},[children]),sectionData=_React$useMemo.sectionData,childrenWithId=_React$useMemo.childrenWithId,actionListOptions=_React$useMemo.actionListOptions;
|
|
19
|
+
var _excluded=["children","testID","isVirtualized"];var _ActionList=function _ActionList(_ref){var children=_ref.children,testID=_ref.testID,isVirtualized=_ref.isVirtualized,rest=_objectWithoutProperties(_ref,_excluded);var _useDropdown=useDropdown(),setOptions=_useDropdown.setOptions,actionListItemRef=_useDropdown.actionListItemRef,selectionType=_useDropdown.selectionType,dropdownBaseId=_useDropdown.dropdownBaseId,dropdownTriggerer=_useDropdown.dropdownTriggerer,hasFooterAction=_useDropdown.hasFooterAction,filteredValues=_useDropdown.filteredValues;var ActionListBox$1=isVirtualized?ActionListBox:ActionListBox;var _useBottomSheetContex=useBottomSheetContext(),isInBottomSheet=_useBottomSheetContex.isInBottomSheet;var _React$useMemo=React__default.useMemo(function(){return getActionListProperties(children);},[children]),sectionData=_React$useMemo.sectionData,childrenWithId=_React$useMemo.childrenWithId,actionListOptions=_React$useMemo.actionListOptions;React__default.useEffect(function(){setOptions(actionListOptions);},[actionListOptions]);if(filteredValues.length<=0&&dropdownTriggerer===dropdownComponentIds.triggers.AutoComplete){return jsx(ActionListNoResults,{});}var actionListContainerRole=getActionListContainerRole(hasFooterAction,dropdownTriggerer);var actionListItemWrapperRole=getActionListItemWrapperRole(hasFooterAction,dropdownTriggerer);var isMultiSelectable=selectionType==='multiple';return isInBottomSheet?jsx(ActionListBox$1,Object.assign({isInBottomSheet:isInBottomSheet,actionListItemWrapperRole:actionListItemWrapperRole,childrenWithId:childrenWithId,sectionData:sectionData,isMultiSelectable:isMultiSelectable,ref:actionListItemRef},makeAnalyticsAttribute(rest))):jsx(BaseBox,Object.assign({id:`${dropdownBaseId}-actionlist`},makeAccessible({role:actionListContainerRole,multiSelectable:actionListContainerRole==='listbox'?isMultiSelectable:undefined,labelledBy:`${dropdownBaseId}-label`}),metaAttribute({name:MetaConstants.ActionList,testID:testID}),makeAnalyticsAttribute(rest),{children:jsx(ActionListBox$1,{isInBottomSheet:isInBottomSheet,actionListItemWrapperRole:actionListItemWrapperRole,childrenWithId:childrenWithId,sectionData:sectionData,isMultiSelectable:isMultiSelectable,ref:actionListItemRef})}));};var ActionList=assignWithoutSideEffects(React__default.memo(_ActionList),{displayName:componentIds.ActionList,componentId:componentIds.ActionList});
|
|
20
20
|
|
|
21
21
|
export { ActionList };
|
|
22
22
|
//# sourceMappingURL=ActionList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionList.js","sources":["../../../../../src/components/ActionList/ActionList.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React from 'react';\nimport { getActionListContainerRole, getActionListItemWrapperRole } from './getA11yRoles';\nimport { getActionListProperties } from './actionListUtils';\nimport { ActionListBox } from './ActionListBox';\nimport { componentIds } from './componentIds';\nimport { ActionListNoResults } from './ActionListNoResults';\nimport { useDropdown } from '~components/Dropdown/useDropdown';\nimport { useBottomSheetContext } from '~components/BottomSheet/BottomSheetContext';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport type { DataAnalyticsAttribute, TestID } from '~utils/types';\nimport BaseBox from '~components/Box/BaseBox';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { dropdownComponentIds } from '~components/Dropdown/dropdownComponentIds';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype ActionListProps = {\n children: React.ReactNode[];\n} & TestID &\n DataAnalyticsAttribute;\n\nconst _ActionList = ({
|
|
1
|
+
{"version":3,"file":"ActionList.js","sources":["../../../../../src/components/ActionList/ActionList.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React from 'react';\nimport { getActionListContainerRole, getActionListItemWrapperRole } from './getA11yRoles';\nimport { getActionListProperties } from './actionListUtils';\nimport { ActionListBox as ActionListNormalBox, ActionListVirtualizedBox } from './ActionListBox';\nimport { componentIds } from './componentIds';\nimport { ActionListNoResults } from './ActionListNoResults';\nimport { useDropdown } from '~components/Dropdown/useDropdown';\nimport { useBottomSheetContext } from '~components/BottomSheet/BottomSheetContext';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport type { DataAnalyticsAttribute, TestID } from '~utils/types';\nimport BaseBox from '~components/Box/BaseBox';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { dropdownComponentIds } from '~components/Dropdown/dropdownComponentIds';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype ActionListProps = {\n children: React.ReactNode[];\n isVirtualized?: boolean;\n} & TestID &\n DataAnalyticsAttribute;\n\nconst _ActionList = ({\n children,\n testID,\n isVirtualized,\n ...rest\n}: ActionListProps): React.ReactElement => {\n const {\n setOptions,\n actionListItemRef,\n selectionType,\n dropdownBaseId,\n dropdownTriggerer,\n hasFooterAction,\n filteredValues,\n } = useDropdown();\n\n const ActionListBox = isVirtualized ? ActionListVirtualizedBox : ActionListNormalBox;\n\n const { isInBottomSheet } = useBottomSheetContext();\n\n const { sectionData, childrenWithId, actionListOptions } = React.useMemo(\n () => getActionListProperties(children),\n [children],\n );\n\n React.useEffect(() => {\n setOptions(actionListOptions);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [actionListOptions]);\n\n if (\n filteredValues.length <= 0 &&\n dropdownTriggerer === dropdownComponentIds.triggers.AutoComplete\n ) {\n return <ActionListNoResults />;\n }\n\n const actionListContainerRole = getActionListContainerRole(hasFooterAction, dropdownTriggerer);\n const actionListItemWrapperRole = getActionListItemWrapperRole(\n hasFooterAction,\n dropdownTriggerer,\n );\n const isMultiSelectable = selectionType === 'multiple';\n\n // If we are inside BottomSheet, we don't render The StyledActionList wrapper\n // This is to ensure:\n // 1. We don't render the box wrapper styles which includes shadows, padding, border etc\n // 2. to ensure GorhomBottomSheetSectionList works as expected, if we add extra wrappers GorhomBottomSheet won't render the content inside\n // NOTE: That this also means inside BottomSheet, ActionList won't render any ActionListHeader or Footer.\n return isInBottomSheet ? (\n <ActionListBox\n isInBottomSheet={isInBottomSheet}\n actionListItemWrapperRole={actionListItemWrapperRole}\n childrenWithId={childrenWithId}\n sectionData={sectionData}\n isMultiSelectable={isMultiSelectable}\n ref={actionListItemRef as any}\n {...makeAnalyticsAttribute(rest)}\n />\n ) : (\n <BaseBox\n id={`${dropdownBaseId}-actionlist`}\n {...makeAccessible({\n role: actionListContainerRole,\n multiSelectable: actionListContainerRole === 'listbox' ? isMultiSelectable : undefined,\n labelledBy: `${dropdownBaseId}-label`,\n })}\n {...metaAttribute({ name: MetaConstants.ActionList, testID })}\n {...makeAnalyticsAttribute(rest)}\n >\n <ActionListBox\n isInBottomSheet={isInBottomSheet}\n actionListItemWrapperRole={actionListItemWrapperRole}\n childrenWithId={childrenWithId}\n sectionData={sectionData}\n isMultiSelectable={isMultiSelectable}\n ref={actionListItemRef as any}\n />\n </BaseBox>\n );\n};\n\n/**\n * ### ActionList\n *\n * List of multiple actionable items. Can be used as menu items inside `Dropdown`,\n * `BottomSheet` and as selectable items when combined with `SelectInput`\n *\n * #### Usage\n *\n * ```jsx\n * <Dropdown>\n * <SelectInput label=\"Select Action\" />\n * <DropdownOverlay>\n * <DropdownHeader title=\"Header Title\" />\n * <ActionList>\n * <ActionListItem\n * title=\"Home\"\n * value=\"home\"\n * leading={<ActionListItemIcon icon={HomeIcon} />}\n * />\n * <ActionListItem\n * title=\"Pricing\"\n * value=\"pricing\"\n * leading={<ActionListItemAsset src=\"https://flagcdn.com/w20/in.png\" alt=\"India Flag\" />}\n * />\n * </ActionList>\n * <DropdownFooter><Button>Apply</Button></DropdownFooter>\n * </DropdownOverlay>\n * </Dropdown>\n * ```\n *\n */\nconst ActionList = assignWithoutSideEffects(React.memo(_ActionList), {\n displayName: componentIds.ActionList,\n componentId: componentIds.ActionList,\n});\n\nexport type { ActionListProps };\nexport { ActionList };\n"],"names":["_ActionList","_ref","children","testID","isVirtualized","rest","_objectWithoutProperties","_excluded","_useDropdown","useDropdown","setOptions","actionListItemRef","selectionType","dropdownBaseId","dropdownTriggerer","hasFooterAction","filteredValues","ActionListBox","ActionListVirtualizedBox","ActionListNormalBox","_useBottomSheetContex","useBottomSheetContext","isInBottomSheet","_React$useMemo","React","useMemo","getActionListProperties","sectionData","childrenWithId","actionListOptions","useEffect","length","dropdownComponentIds","triggers","AutoComplete","_jsx","ActionListNoResults","actionListContainerRole","getActionListContainerRole","actionListItemWrapperRole","getActionListItemWrapperRole","isMultiSelectable","Object","assign","ref","makeAnalyticsAttribute","BaseBox","id","makeAccessible","role","multiSelectable","undefined","labelledBy","metaAttribute","name","MetaConstants","ActionList","assignWithoutSideEffects","memo","displayName","componentIds","componentId"],"mappings":";;;;;;;;;;;;;;;;;;oDAuBA,IAAMA,WAAW,CAAG,SAAdA,WAAWA,CAAAC,IAAA,CAK0B,CAJzC,IAAAC,QAAQ,CAAAD,IAAA,CAARC,QAAQ,CACRC,MAAM,CAAAF,IAAA,CAANE,MAAM,CACNC,aAAa,CAAAH,IAAA,CAAbG,aAAa,CACVC,IAAI,CAAAC,wBAAA,CAAAL,IAAA,CAAAM,SAAA,EAEP,IAAAC,YAAA,CAQIC,WAAW,EAAE,CAPfC,UAAU,CAAAF,YAAA,CAAVE,UAAU,CACVC,iBAAiB,CAAAH,YAAA,CAAjBG,iBAAiB,CACjBC,aAAa,CAAAJ,YAAA,CAAbI,aAAa,CACbC,cAAc,CAAAL,YAAA,CAAdK,cAAc,CACdC,iBAAiB,CAAAN,YAAA,CAAjBM,iBAAiB,CACjBC,eAAe,CAAAP,YAAA,CAAfO,eAAe,CACfC,cAAc,CAAAR,YAAA,CAAdQ,cAAc,CAGhB,IAAMC,eAAa,CAAGb,aAAa,CAAGc,aAAwB,CAAGC,aAAmB,CAEpF,IAAAC,qBAAA,CAA4B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AC/BmC,cAAc,CAAC,CACjBC,IAAI,CAAEZ,uBAAuB,CAC7Ba,eAAe,CAAEb,uBAAuB,GAAK,SAAS,CAAGI,iBAAiB,CAAGU,SAAS,CACtFC,UAAU,CAAG,CAAA,EAAEvC,cAAe,CAChC,MAAA,CAAA,CAAC,CAAC,CACEwC,aAAa,CAAC,CAAEC,IAAI,CAAEC,aAAa,CAACC,UAAU,CAAErD,MAAM,CAANA,MAAO,CAAC,CAAC,CACzD0C,sBAAsB,CAACxC,IAAI,CAAC,CAAAH,CAAAA,QAAA,CAEhCiC,GAAA,CAAClB,eAAa,CAAA,CACZK,eAAe,CAAEA,eAAgB,CACjCiB,yBAAyB,CAAEA,yBAA0B,CACrDX,cAAc,CAAEA,cAAe,CAC/BD,WAAW,CAAEA,WAAY,CACzBc,iBAAiB,CAAEA,iBAAkB,CACrCG,GAAG,CAAEjC,iBAAyB,CAC/B,CAAC,EACK,CACV,CACH,CAAC,CAiCK,IAAA6C,UAAU,CAAGC,wBAAwB,CAACjC,cAAK,CAACkC,IAAI,CAAC1D,WAAW,CAAC,CAAE,CACnE2D,WAAW,CAAEC,YAAY,CAACJ,UAAU,CACpCK,WAAW,CAAED,YAAY,CAACJ,UAC5B,CAAC;;;;"}
|
|
@@ -11,5 +11,5 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
11
11
|
|
|
12
12
|
var _ActionListBox=React__default.forwardRef(function(_ref,ref){var sectionData=_ref.sectionData,actionListItemWrapperRole=_ref.actionListItemWrapperRole,isMultiSelectable=_ref.isMultiSelectable,isInBottomSheet=_ref.isInBottomSheet;var _useBottomSheetContex=useBottomSheetContext(),footerHeight=_useBottomSheetContex.footerHeight,setContentHeight=_useBottomSheetContex.setContentHeight;var renderActionListItem=React__default.useCallback(function(_ref2){var item=_ref2.item;return jsx(ActionListItem,Object.assign({},item));},[]);var renderActionListSectionHeader=React__default.useCallback(function(_ref3){var title=_ref3.section.title;if(!title)return null;return jsx(ActionListSection,{title:title,_hideDivider:true,children:undefined});},[]);var renderActionListSectionDivider=React__default.useCallback(function(_ref4){var _ref4$section=_ref4.section,title=_ref4$section.title,hideDivider=_ref4$section.hideDivider;if(!title)return null;if(hideDivider)return null;return jsx(Divider,{});},[]);return jsx(StyledListBoxWrapper,Object.assign({as:isInBottomSheet?BottomSheetSectionList:SectionList,isInBottomSheet:Boolean(isInBottomSheet),marginBottom:footerHeight,sections:sectionData,windowSize:5,keyExtractor:function keyExtractor(item){return item.value;},stickySectionHeadersEnabled:false,renderSectionHeader:renderActionListSectionHeader,renderSectionFooter:renderActionListSectionDivider,renderItem:renderActionListItem,ref:ref,onContentSizeChange:function onContentSizeChange(_width,height){setContentHeight(height);}},makeAccessible({role:actionListItemWrapperRole,multiSelectable:actionListItemWrapperRole==='listbox'?isMultiSelectable:undefined})));});var ActionListBox=assignWithoutSideEffects(_ActionListBox,{displayName:'ActionListBox'});
|
|
13
13
|
|
|
14
|
-
export { ActionListBox };
|
|
14
|
+
export { ActionListBox, ActionListBox as ActionListVirtualizedBox };
|
|
15
15
|
//# sourceMappingURL=ActionListBox.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionListBox.native.js","sources":["../../../../../src/components/ActionList/ActionListBox.native.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable react/display-name */\nimport React from 'react';\nimport { BottomSheetSectionList as GorhomBottomSheetSectionList } from '@gorhom/bottom-sheet';\nimport { SectionList } from 'react-native';\nimport { StyledListBoxWrapper } from './styles/StyledListBoxWrapper';\nimport { ActionListItem, ActionListSection } from './ActionListItem';\nimport type { SectionData } from './actionListUtils';\nimport { useBottomSheetContext } from '~components/BottomSheet/BottomSheetContext';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { Divider } from '~components/Divider';\n\ntype ActionListBoxProps = {\n childrenWithId?: React.ReactNode[] | null;\n sectionData: SectionData;\n actionListItemWrapperRole: 'listbox' | 'menu' | undefined;\n isMultiSelectable: boolean;\n isInBottomSheet: boolean;\n};\n\nconst _ActionListBox = React.forwardRef<SectionList, ActionListBoxProps>(\n ({ sectionData, actionListItemWrapperRole, isMultiSelectable, isInBottomSheet }, ref) => {\n const { footerHeight, setContentHeight } = useBottomSheetContext();\n\n const renderActionListItem = React.useCallback(({ item }: any) => {\n return <ActionListItem {...item} />;\n }, []);\n\n const renderActionListSectionHeader = React.useCallback(({ section: { title } }: any) => {\n if (!title) return null;\n return <ActionListSection title={title} _hideDivider={true} children={undefined} />;\n }, []);\n\n const renderActionListSectionDivider = React.useCallback(\n ({ section: { title, hideDivider } }: any) => {\n if (!title) return null;\n if (hideDivider) return null;\n return <Divider />;\n },\n [],\n );\n\n return (\n <StyledListBoxWrapper\n // Render either the Gorhom or RN Section list depending on where we are\n // We can't simply use RNSectionList because GorhomSectionList handles extra bottomsheet specific logic internally\n as={isInBottomSheet ? GorhomBottomSheetSectionList : SectionList}\n isInBottomSheet={Boolean(isInBottomSheet)}\n // Setting footerHeight as bottom margin for ActionListBox\n // otherwise the footer hides few list items under it, this will offset it\n marginBottom={footerHeight}\n sections={sectionData}\n windowSize={5}\n keyExtractor={(item: any) => {\n return item.value;\n }}\n stickySectionHeadersEnabled={false}\n renderSectionHeader={renderActionListSectionHeader}\n renderSectionFooter={renderActionListSectionDivider}\n renderItem={renderActionListItem}\n ref={ref as any}\n onContentSizeChange={(_width, height) => {\n setContentHeight(height);\n }}\n {...makeAccessible({\n role: actionListItemWrapperRole,\n multiSelectable: actionListItemWrapperRole === 'listbox' ? isMultiSelectable : undefined,\n })}\n />\n );\n },\n);\n\nconst ActionListBox = assignWithoutSideEffects(_ActionListBox, { displayName: 'ActionListBox' });\n\nexport { ActionListBox };\n"],"names":["_ActionListBox","React","forwardRef","_ref","ref","sectionData","actionListItemWrapperRole","isMultiSelectable","isInBottomSheet","_useBottomSheetContex","useBottomSheetContext","footerHeight","setContentHeight","renderActionListItem","useCallback","_ref2","item","_jsx","ActionListItem","Object","assign","renderActionListSectionHeader","_ref3","title","section","ActionListSection","_hideDivider","children","undefined","renderActionListSectionDivider","_ref4","_ref4$section","hideDivider","Divider","StyledListBoxWrapper","as","GorhomBottomSheetSectionList","SectionList","Boolean","marginBottom","sections","windowSize","keyExtractor","value","stickySectionHeadersEnabled","renderSectionHeader","renderSectionFooter","renderItem","onContentSizeChange","_width","height","makeAccessible","role","multiSelectable","ActionListBox","assignWithoutSideEffects","displayName"],"mappings":";;;;;;;;;;;AAqBA,IAAMA,cAAc,CAAGC,cAAK,CAACC,UAAU,CACrC,SAAAC,IAAA,CAAiFC,GAAG,CAAK,
|
|
1
|
+
{"version":3,"file":"ActionListBox.native.js","sources":["../../../../../src/components/ActionList/ActionListBox.native.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable react/display-name */\nimport React from 'react';\nimport { BottomSheetSectionList as GorhomBottomSheetSectionList } from '@gorhom/bottom-sheet';\nimport { SectionList } from 'react-native';\nimport { StyledListBoxWrapper } from './styles/StyledListBoxWrapper';\nimport { ActionListItem, ActionListSection } from './ActionListItem';\nimport type { SectionData } from './actionListUtils';\nimport { useBottomSheetContext } from '~components/BottomSheet/BottomSheetContext';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { Divider } from '~components/Divider';\n\ntype ActionListBoxProps = {\n childrenWithId?: React.ReactNode[] | null;\n sectionData: SectionData;\n actionListItemWrapperRole: 'listbox' | 'menu' | undefined;\n isMultiSelectable: boolean;\n isInBottomSheet: boolean;\n};\n\nconst _ActionListBox = React.forwardRef<SectionList, ActionListBoxProps>(\n ({ sectionData, actionListItemWrapperRole, isMultiSelectable, isInBottomSheet }, ref) => {\n const { footerHeight, setContentHeight } = useBottomSheetContext();\n\n const renderActionListItem = React.useCallback(({ item }: any) => {\n return <ActionListItem {...item} />;\n }, []);\n\n const renderActionListSectionHeader = React.useCallback(({ section: { title } }: any) => {\n if (!title) return null;\n return <ActionListSection title={title} _hideDivider={true} children={undefined} />;\n }, []);\n\n const renderActionListSectionDivider = React.useCallback(\n ({ section: { title, hideDivider } }: any) => {\n if (!title) return null;\n if (hideDivider) return null;\n return <Divider />;\n },\n [],\n );\n\n return (\n <StyledListBoxWrapper\n // Render either the Gorhom or RN Section list depending on where we are\n // We can't simply use RNSectionList because GorhomSectionList handles extra bottomsheet specific logic internally\n as={isInBottomSheet ? GorhomBottomSheetSectionList : SectionList}\n isInBottomSheet={Boolean(isInBottomSheet)}\n // Setting footerHeight as bottom margin for ActionListBox\n // otherwise the footer hides few list items under it, this will offset it\n marginBottom={footerHeight}\n sections={sectionData}\n windowSize={5}\n keyExtractor={(item: any) => {\n return item.value;\n }}\n stickySectionHeadersEnabled={false}\n renderSectionHeader={renderActionListSectionHeader}\n renderSectionFooter={renderActionListSectionDivider}\n renderItem={renderActionListItem}\n ref={ref as any}\n onContentSizeChange={(_width, height) => {\n setContentHeight(height);\n }}\n {...makeAccessible({\n role: actionListItemWrapperRole,\n multiSelectable: actionListItemWrapperRole === 'listbox' ? isMultiSelectable : undefined,\n })}\n />\n );\n },\n);\n\nconst ActionListBox = assignWithoutSideEffects(_ActionListBox, { displayName: 'ActionListBox' });\n\nexport { ActionListBox, ActionListBox as ActionListVirtualizedBox };\n"],"names":["_ActionListBox","React","forwardRef","_ref","ref","sectionData","actionListItemWrapperRole","isMultiSelectable","isInBottomSheet","_useBottomSheetContex","useBottomSheetContext","footerHeight","setContentHeight","renderActionListItem","useCallback","_ref2","item","_jsx","ActionListItem","Object","assign","renderActionListSectionHeader","_ref3","title","section","ActionListSection","_hideDivider","children","undefined","renderActionListSectionDivider","_ref4","_ref4$section","hideDivider","Divider","StyledListBoxWrapper","as","GorhomBottomSheetSectionList","SectionList","Boolean","marginBottom","sections","windowSize","keyExtractor","value","stickySectionHeadersEnabled","renderSectionHeader","renderSectionFooter","renderItem","onContentSizeChange","_width","height","makeAccessible","role","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9B,GAAI,CAACT,KAAK,CAAE,OAAW,IAAA,CACvB,GAAIS,WAAW,CAAE,OAAW,IAAA,CAC5B,OAAOf,GAAA,CAACgB,OAAO,CAAA,EAAE,CAAC,CACpB,CAAC,CACD,EACF,CAAC,CAED,OACEhB,GAAA,CAACiB,oBAAoB,CAAAf,MAAA,CAAAC,MAAA,CAGnBe,CAAAA,EAAE,CAAE3B,eAAe,CAAG4B,sBAA4B,CAAGC,WAAY,CACjE7B,eAAe,CAAE8B,OAAO,CAAC9B,eAAe,CAAE,CAG1C+B,YAAY,CAAE5B,YAAa,CAC3B6B,QAAQ,CAAEnC,WAAY,CACtBoC,UAAU,CAAE,CAAE,CACdC,YAAY,CAAE,SAAAA,YAAAA,CAAC1B,IAAS,CAAK,CAC3B,OAAOA,IAAI,CAAC2B,KAAK,CACnB,CAAE,CACFC,2BAA2B,CAAE,KAAM,CACnCC,mBAAmB,CAAExB,6BAA8B,CACnDyB,mBAAmB,CAAEjB,8BAA+B,CACpDkB,UAAU,CAAElC,oBAAqB,CACjCT,GAAG,CAAEA,GAAW,CAChB4C,mBAAmB,CAAE,SAAAA,mBAACC,CAAAA,MAAM,CAAEC,MAAM,CAAK,CACvCtC,gBAAgB,CAACsC,MAAM,CAAC,CAC1B,CAAE,CACEC,CAAAA,cAAc,CAAC,CACjBC,IAAI,CAAE9C,yBAAyB,CAC/B+C,eAAe,CAAE/C,yBAAyB,GAAK,SAAS,CAAGC,iBAAiB,CAAGqB,SACjF,CAAC,CAAC,CACH,CAAC,CAEN,CACF,CAAC,CAEK,IAAA0B,aAAa,CAAGC,wBAAwB,CAACvD,cAAc,CAAE,CAAEwD,WAAW,CAAE,eAAgB,CAAC;;;;"}
|
|
@@ -42,7 +42,7 @@ import '../VisuallyHidden/VisuallyHidden.native.js';
|
|
|
42
42
|
import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
|
|
43
43
|
import { Avatar } from '../Avatar/Avatar.native.js';
|
|
44
44
|
|
|
45
|
-
var _excluded=["title","children","testID","_hideDivider","_sectionChildValues"];var StyledActionListSectionTitle=styled(BaseBox)(function(props){return {padding:makeSize(props.theme.spacing[3])};});var _ActionListSection=function _ActionListSection(_ref){var title=_ref.title,children=_ref.children,testID=_ref.testID,_hideDivider=_ref._hideDivider,_sectionChildValues=_ref._sectionChildValues,rest=_objectWithoutProperties(_ref,_excluded);var _useDropdown=useDropdown(),hasAutoCompleteInBottomSheetHeader=_useDropdown.hasAutoCompleteInBottomSheetHeader,dropdownTriggerer=_useDropdown.dropdownTriggerer,filteredValues=_useDropdown.filteredValues;var hasAutoComplete=hasAutoCompleteInBottomSheetHeader||dropdownTriggerer===dropdownComponentIds.triggers.AutoComplete;var isSectionVisible=React__default.useMemo(function(){if(hasAutoComplete){var visibleActionListItemInSection=_sectionChildValues==null?void 0:_sectionChildValues.find(function(actionItemValue){return filteredValues.includes(actionItemValue);});return Boolean(visibleActionListItemInSection);}return true;},[_sectionChildValues,hasAutoComplete,filteredValues]);var showDividerInRN=!(_hideDivider&&isReactNative());var showDividerInAutoComplete=hasAutoComplete?isSectionVisible&&filteredValues.length>1:true;return jsxs(BaseBox,Object.assign({},makeAccessible({role:getActionListSectionRole(),label:title}),metaAttribute({name:MetaConstants.ActionListSection,testID:testID}),makeAnalyticsAttribute(rest),{children:[isSectionVisible?jsx(StyledActionListSectionTitle,Object.assign({},makeAccessible({hidden:true}),{children:jsx(Text,{color:"surface.text.gray.muted",size:"small",weight:"semibold",children:title})})):null,jsx(BaseBox,Object.assign({},makeAccessible({role:isReactNative()?undefined:'listbox'}),{children:children})),showDividerInAutoComplete&&showDividerInRN?jsx(Divider,{marginX:"spacing.3",marginY:"spacing.1"}):null]}));};var ActionListSection=assignWithoutSideEffects(_ActionListSection,{componentId:componentIds.ActionListSection});var _ActionListItemIcon=function _ActionListItemIcon(_ref2){var icon=_ref2.icon;var Icon=icon;var _useBaseMenuItem=useBaseMenuItem(),color=_useBaseMenuItem.color,isDisabled=_useBaseMenuItem.isDisabled;var iconState=isDisabled?'disabled':'muted';return jsx(Icon,{color:color==='negative'?'feedback.icon.negative.intense':`interactive.icon.gray.${iconState}`,size:"medium"});};var ActionListItemIcon=assignWithoutSideEffects(_ActionListItemIcon,{componentId:componentIds.ActionListItemIcon});var _ActionListItemBadgeGroup=function _ActionListItemBadgeGroup(_ref3){var children=_ref3.children;return jsx(Box,{display:"flex",alignItems:"center",flexDirection:"row",children:children});};var ActionListItemBadgeGroup=assignWithoutSideEffects(_ActionListItemBadgeGroup,{componentId:componentIds.ActionListItemBadgeGroup});var _ActionListItemAvatar=function _ActionListItemAvatar(avatarProps){return jsx(Avatar,Object.assign({size:"xsmall"},avatarProps));};var ActionListItemAvatar=assignWithoutSideEffects(_ActionListItemAvatar,{componentId:componentIds.ActionListItemAvatar});var _ActionListItemBadge=function _ActionListItemBadge(props){return jsx(Badge,Object.assign({size:"medium",marginLeft:"spacing.3"},props));};var ActionListItemBadge=assignWithoutSideEffects(_ActionListItemBadge,{componentId:componentIds.ActionListItemBadge});var _ActionListItemText=function _ActionListItemText(_ref4){var children=_ref4.children;var _useBaseMenuItem2=useBaseMenuItem(),isDisabled=_useBaseMenuItem2.isDisabled;return jsx(Text,{variant:"caption",color:getNormalTextColor(isDisabled,{isMuted:true}),children:children});};var ActionListItemText=assignWithoutSideEffects(_ActionListItemText,{componentId:componentIds.ActionListItemText});var makeActionListItemClickable=function makeActionListItemClickable(clickHandler){if(isReactNative()){return {onPress:clickHandler};}return {onClick:clickHandler};};var _ActionListItem=function _ActionListItem(props){var _useDropdown2=useDropdown(),activeIndex=_useDropdown2.activeIndex,dropdownBaseId=_useDropdown2.dropdownBaseId,onOptionClick=_useDropdown2.onOptionClick,selectedIndices=_useDropdown2.selectedIndices,setShouldIgnoreBlurAnimation=_useDropdown2.setShouldIgnoreBlurAnimation,selectionType=_useDropdown2.selectionType,dropdownTriggerer=_useDropdown2.dropdownTriggerer,isKeydownPressed=_useDropdown2.isKeydownPressed,filteredValues=_useDropdown2.filteredValues,hasAutoCompleteInBottomSheetHeader=_useDropdown2.hasAutoCompleteInBottomSheetHeader;var hasAutoComplete=hasAutoCompleteInBottomSheetHeader||dropdownTriggerer===dropdownComponentIds.triggers.AutoComplete;var renderOnWebAs=props.href?'a':'button';var getIsSelected=function getIsSelected(){if(dropdownTriggerer===dropdownComponentIds.triggers.SelectInput||hasAutoComplete){if(typeof props._index==='number'){return selectedIndices.includes(props._index);}return undefined;}return props.isSelected;};var isSelected=getIsSelected();React__default.useEffect(function(){validateActionListItemProps({leading:props.leading,trailing:props.trailing,titleSuffix:props.titleSuffix});},[props.leading,props.trailing,props.titleSuffix]);React__default.useEffect(function(){if(__DEV__){if(dropdownTriggerer===dropdownComponentIds.triggers.SelectInput&&props.intent==='negative'){throwBladeError({message:'negative intent ActionListItem cannot be used inside Dropdown with SelectInput trigger',moduleName:'ActionListItem'});}}},[props.intent,dropdownTriggerer]);
|
|
45
|
+
var _excluded=["title","children","testID","_hideDivider","_sectionChildValues"];var StyledActionListSectionTitle=styled(BaseBox)(function(props){return {padding:makeSize(props.theme.spacing[3])};});var _ActionListSection=function _ActionListSection(_ref){var title=_ref.title,children=_ref.children,testID=_ref.testID,_hideDivider=_ref._hideDivider,_sectionChildValues=_ref._sectionChildValues,rest=_objectWithoutProperties(_ref,_excluded);var _useDropdown=useDropdown(),hasAutoCompleteInBottomSheetHeader=_useDropdown.hasAutoCompleteInBottomSheetHeader,dropdownTriggerer=_useDropdown.dropdownTriggerer,filteredValues=_useDropdown.filteredValues;var hasAutoComplete=hasAutoCompleteInBottomSheetHeader||dropdownTriggerer===dropdownComponentIds.triggers.AutoComplete;var isSectionVisible=React__default.useMemo(function(){if(hasAutoComplete){var visibleActionListItemInSection=_sectionChildValues==null?void 0:_sectionChildValues.find(function(actionItemValue){return filteredValues.includes(actionItemValue);});return Boolean(visibleActionListItemInSection);}return true;},[_sectionChildValues,hasAutoComplete,filteredValues]);var showDividerInRN=!(_hideDivider&&isReactNative());var showDividerInAutoComplete=hasAutoComplete?isSectionVisible&&filteredValues.length>1:true;return jsxs(BaseBox,Object.assign({},makeAccessible({role:getActionListSectionRole(),label:title}),metaAttribute({name:MetaConstants.ActionListSection,testID:testID}),makeAnalyticsAttribute(rest),{children:[isSectionVisible?jsx(StyledActionListSectionTitle,Object.assign({},makeAccessible({hidden:true}),{children:jsx(Text,{color:"surface.text.gray.muted",size:"small",weight:"semibold",children:title})})):null,jsx(BaseBox,Object.assign({},makeAccessible({role:isReactNative()?undefined:'listbox'}),{children:children})),showDividerInAutoComplete&&showDividerInRN?jsx(Divider,{marginX:"spacing.3",marginY:"spacing.1"}):null]}));};var ActionListSection=assignWithoutSideEffects(_ActionListSection,{componentId:componentIds.ActionListSection});var _ActionListItemIcon=function _ActionListItemIcon(_ref2){var icon=_ref2.icon;var Icon=icon;var _useBaseMenuItem=useBaseMenuItem(),color=_useBaseMenuItem.color,isDisabled=_useBaseMenuItem.isDisabled;var iconState=isDisabled?'disabled':'muted';return jsx(Icon,{color:color==='negative'?'feedback.icon.negative.intense':`interactive.icon.gray.${iconState}`,size:"medium"});};var ActionListItemIcon=assignWithoutSideEffects(_ActionListItemIcon,{componentId:componentIds.ActionListItemIcon});var _ActionListItemBadgeGroup=function _ActionListItemBadgeGroup(_ref3){var children=_ref3.children;return jsx(Box,{display:"flex",alignItems:"center",flexDirection:"row",children:children});};var ActionListItemBadgeGroup=assignWithoutSideEffects(_ActionListItemBadgeGroup,{componentId:componentIds.ActionListItemBadgeGroup});var _ActionListItemAvatar=function _ActionListItemAvatar(avatarProps){return jsx(Avatar,Object.assign({size:"xsmall"},avatarProps));};var ActionListItemAvatar=assignWithoutSideEffects(_ActionListItemAvatar,{componentId:componentIds.ActionListItemAvatar});var _ActionListItemBadge=function _ActionListItemBadge(props){return jsx(Badge,Object.assign({size:"medium",marginLeft:"spacing.3"},props));};var ActionListItemBadge=assignWithoutSideEffects(_ActionListItemBadge,{componentId:componentIds.ActionListItemBadge});var _ActionListItemText=function _ActionListItemText(_ref4){var children=_ref4.children;var _useBaseMenuItem2=useBaseMenuItem(),isDisabled=_useBaseMenuItem2.isDisabled;return jsx(Text,{variant:"caption",color:getNormalTextColor(isDisabled,{isMuted:true}),children:children});};var ActionListItemText=assignWithoutSideEffects(_ActionListItemText,{componentId:componentIds.ActionListItemText});var makeActionListItemClickable=function makeActionListItemClickable(clickHandler){if(isReactNative()){return {onPress:clickHandler};}return {onClick:clickHandler};};var _ActionListItem=function _ActionListItem(props){var _useDropdown2=useDropdown(),activeIndex=_useDropdown2.activeIndex,dropdownBaseId=_useDropdown2.dropdownBaseId,onOptionClick=_useDropdown2.onOptionClick,selectedIndices=_useDropdown2.selectedIndices,setShouldIgnoreBlurAnimation=_useDropdown2.setShouldIgnoreBlurAnimation,selectionType=_useDropdown2.selectionType,dropdownTriggerer=_useDropdown2.dropdownTriggerer,isKeydownPressed=_useDropdown2.isKeydownPressed,filteredValues=_useDropdown2.filteredValues,hasAutoCompleteInBottomSheetHeader=_useDropdown2.hasAutoCompleteInBottomSheetHeader;var hasAutoComplete=hasAutoCompleteInBottomSheetHeader||dropdownTriggerer===dropdownComponentIds.triggers.AutoComplete;var renderOnWebAs=props.href?'a':'button';var getIsSelected=function getIsSelected(){if(dropdownTriggerer===dropdownComponentIds.triggers.SelectInput||hasAutoComplete){if(typeof props._index==='number'){return selectedIndices.includes(props._index);}return undefined;}return props.isSelected;};var isSelected=getIsSelected();React__default.useEffect(function(){validateActionListItemProps({leading:props.leading,trailing:props.trailing,titleSuffix:props.titleSuffix});},[props.leading,props.trailing,props.titleSuffix]);React__default.useEffect(function(){if(__DEV__){if(dropdownTriggerer===dropdownComponentIds.triggers.SelectInput&&props.intent==='negative'){throwBladeError({message:'negative intent ActionListItem cannot be used inside Dropdown with SelectInput trigger',moduleName:'ActionListItem'});}}},[props.intent,dropdownTriggerer]);var isVisible=hasAutoComplete&&filteredValues?filteredValues.includes(props.value):true;return jsx(BaseMenuItem,Object.assign({isVisible:isVisible,as:!isReactNative()?renderOnWebAs:undefined,id:`${dropdownBaseId}-${props._index}`,tabIndex:-1,title:props.title,description:props.description,leading:selectionType==='multiple'?jsx(BaseBox,Object.assign({pointerEvents:"none"},makeAccessible({hidden:true}),{children:jsx(Checkbox,{isChecked:isSelected,tabIndex:-1,isDisabled:props.isDisabled,children:null})})):props.leading,trailing:props.trailing,titleSuffix:props.titleSuffix,href:props.href,target:props.target,className:activeIndex===props._index?'active-focus':'',isSelected:isSelected,isDisabled:props.isDisabled,role:getActionListItemRole(dropdownTriggerer,props.href)},makeActionListItemClickable(function(e){if(typeof props._index==='number'){onOptionClick(e,props._index);props.onClick==null?void 0:props.onClick({name:props.value,value:isSelected,event:castWebType(e)});}}),makeAnalyticsAttribute(Object.assign({},props)),metaAttribute({name:MetaConstants.ActionListItem,testID:props.testID}),{onMouseDown:function onMouseDown(){setShouldIgnoreBlurAnimation(true);},onMouseUp:function onMouseUp(){setShouldIgnoreBlurAnimation(false);},"data-value":props.value,"data-index":props._index,selectionType:selectionType,color:props.intent,isKeydownPressed:isKeydownPressed}));};var ActionListItem=assignWithoutSideEffects(React__default.memo(_ActionListItem),{componentId:componentIds.ActionListItem,displayName:componentIds.ActionListItem});
|
|
46
46
|
|
|
47
47
|
export { ActionListItem, ActionListItemAvatar, ActionListItemBadge, ActionListItemBadgeGroup, ActionListItemIcon, ActionListItemText, ActionListSection };
|
|
48
48
|
//# sourceMappingURL=ActionListItem.js.map
|
|
@@ -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","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","Object","assign","makeAccessible","role","getActionListSectionRole","label","metaAttribute","name","MetaConstants","ActionListSection","makeAnalyticsAttribute","_jsx","hidden","Text","color","size","weight","undefined","Divider","marginX","marginY","assignWithoutSideEffects","componentId","componentIds","_ActionListItemIcon","_ref2","icon","Icon","_useBaseMenuItem","useBaseMenuItem","isDisabled","iconState","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","__DEV__","intent","throwBladeError","message","moduleName","BaseMenuItem","isVisible","value","as","id","tabIndex","description","pointerEvents","Checkbox","isChecked","target","className","getActionListItemRole","e","event","castWebType","ActionListItem","onMouseDown","onMouseUp","memo","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAA,SAAA,CAAA,CAAA,OAAA,CAAA,UAAA,CAAA,QAAA,CAAA,cAAA,CAAA,qBAAA,CAAA,CA2FA,IAAMA,4BAA4B,CAAGC,MAAM,CAACC,OAAO,CAAC,CAAC,SAACC,KAAK,CAAM,CAAA,OAAA,CAE/DC,OAAO,CAAEC,QAAQ,CAACF,KAAK,CAACG,KAAK,CAACC,OAAO,CAAC,CAAC,CAAC,CAC1C,CAAC,EAAC,CAAC,CAqBH,IAAMC,kBAAkB,CAAG,SAArBA,kBAAkBA,CAAAC,IAAA,CAO0B,CANhD,IAAAC,KAAK,CAAAD,IAAA,CAALC,KAAK,CACLC,QAAQ,CAAAF,IAAA,CAARE,QAAQ,CACRC,MAAM,CAAAH,IAAA,CAANG,MAAM,CACNC,YAAY,CAAAJ,IAAA,CAAZI,YAAY,CACZC,mBAAmB,CAAAL,IAAA,CAAnBK,mBAA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AA2B,CAAC,SAAC0C,CAAsC,CAAW,CAChF,GAAI,OAAOtI,KAAK,CAAC6G,MAAM,GAAK,QAAQ,CAAE,CACpCT,aAAa,CAACkC,CAAC,CAAEtI,KAAK,CAAC6G,MAAM,CAAC,CAC9B7G,KAAK,CAAC+F,OAAO,cAAb/F,KAAK,CAAC+F,OAAO,CAAG,CAAEnD,IAAI,CAAE5C,KAAK,CAAC2H,KAAK,CAAEA,KAAK,CAAEb,UAAU,CAAEyB,KAAK,CAAEC,WAAW,CAACF,CAAC,CAAE,CAAC,CAAC,CAClF,CACF,CAAC,CAAC,CACEvF,sBAAsB,CAAAV,MAAA,CAAAC,MAAA,CAAA,EAAA,CAAMtC,KAAK,CAAE,CAAC,CACpC2C,aAAa,CAAC,CAAEC,IAAI,CAAEC,aAAa,CAAC4F,cAAc,CAAEhI,MAAM,CAAET,KAAK,CAACS,MAAO,CAAC,CAAC,EAC/EiI,WAAW,CAAE,SAAAA,WAAA,EAAM,CAGjBpC,4BAA4B,CAAC,IAAI,CAAC,CACpC,CAAE,CACFqC,SAAS,CAAE,SAAAA,WAAM,CAEfrC,4BAA4B,CAAC,KAAK,CAAC,CACrC,CAAE,CACF,YAAYtG,CAAAA,KAAK,CAAC2H,KAAM,CACxB,YAAY3H,CAAAA,KAAK,CAAC6G,MAAO,CACzBN,aAAa,CAAEA,aAAc,CAC7BpD,KAAK,CAAEnD,KAAK,CAACqH,MAAO,CACpBb,gBAAgB,CAAEA,gBAAiB,CACpC,CAAA,CAAC,CAEN,CAAC,CAEK,IAAAiC,cAAc,CAAG/E,wBAAwB,CAACjC,cAAK,CAACmH,IAAI,CAAC5C,eAAe,CAAC,CAAE,CAC3ErC,WAAW,CAAEC,YAAY,CAAC6E,cAAc,CACxCI,WAAW,CAAEjF,YAAY,CAAC6E,cAC5B,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","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","Object","assign","makeAccessible","role","getActionListSectionRole","label","metaAttribute","name","MetaConstants","ActionListSection","makeAnalyticsAttribute","_jsx","hidden","Text","color","size","weight","undefined","Divider","marginX","marginY","assignWithoutSideEffects","componentId","componentIds","_ActionListItemIcon","_ref2","icon","Icon","_useBaseMenuItem","useBaseMenuItem","isDisabled","iconState","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","__DEV__","intent","throwBladeError","message","moduleName","isVisible","value","BaseMenuItem","as","id","tabIndex","description","pointerEvents","Checkbox","isChecked","target","className","getActionListItemRole","e","event","castWebType","ActionListItem","onMouseDown","onMouseUp","memo","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAA,SAAA,CAAA,CAAA,OAAA,CAAA,UAAA,CAAA,QAAA,CAAA,cAAA,CAAA,qBAAA,CAAA,CA2FA,IAAMA,4BAA4B,CAAGC,MAAM,CAACC,OAAO,CAAC,CAAC,SAACC,KAAK,SAAM,CAE/DC,OAAO,CAAEC,QAAQ,CAACF,KAAK,CAACG,KAAK,CAACC,OAAO,CAAC,CAAC,CAAC,CAC1C,CAAC,CAAA,CAAC,CAAC,CAqBH,IAAMC,kBAAkB,CAAG,SAArBA,kBAAkBA,CAAAC,IAAA,CAO0B,KANhDC,KAAK,CAA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C,eAAe,CAAC,CAAE,CAC3ErC,WAAW,CAAEC,YAAY,CAAC6E,cAAc,CACxCI,WAAW,CAAEjF,YAAY,CAAC6E,cAC5B,CAAC;;;;"}
|
|
@@ -3,7 +3,7 @@ import '../../../tokens/global/typography.js';
|
|
|
3
3
|
import '../../../tokens/global/motion.js';
|
|
4
4
|
import { size } from '../../../tokens/global/size.js';
|
|
5
5
|
|
|
6
|
-
var getBaseListBoxWrapperStyles=function getBaseListBoxWrapperStyles(props){return {maxHeight:props.isInBottomSheet?undefined:makeSize(
|
|
6
|
+
var actionListMaxHeight=size[300];var getActionListPadding=function getActionListPadding(theme){return theme.spacing[3];};var getBaseListBoxWrapperStyles=function getBaseListBoxWrapperStyles(props){return {maxHeight:props.isInBottomSheet?undefined:makeSize(actionListMaxHeight),padding:props.isInBottomSheet?undefined:makeSize(getActionListPadding(props.theme))};};
|
|
7
7
|
|
|
8
|
-
export { getBaseListBoxWrapperStyles };
|
|
8
|
+
export { actionListMaxHeight, getActionListPadding, getBaseListBoxWrapperStyles };
|
|
9
9
|
//# 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(
|
|
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":";;;;;AAKM,IAAAA,mBAAmB,CAAGC,IAAI,CAAC,GAAG,EAE9B,IAAAC,oBAAoB,CAAG,SAAvBA,oBAAoBA,CAAIC,KAAY,CAAa,CACrD,OAAOA,KAAK,CAACC,OAAO,CAAC,CAAC,CAAC,CACzB,EAEM,IAAAC,2BAA2B,CAAG,SAA9BA,2BAA2BA,CAAIC,KAGpC,CAAgB,CACf,OAAO,CACLC,SAAS,CAAED,KAAK,CAACE,eAAe,CAAGC,SAAS,CAAGC,QAAQ,CAACV,mBAAmB,CAAC,CAC5EW,OAAO,CAAEL,KAAK,CAACE,eAAe,CAAGC,SAAS,CAAGC,QAAQ,CAACR,oBAAoB,CAACI,KAAK,CAACH,KAAK,CAAC,CACzF,CAAC,CACH;;;;"}
|
|
@@ -2,24 +2,22 @@ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProper
|
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
import { BaseMenuItemContext } from '../BaseMenuContext.js';
|
|
4
4
|
import { StyledMenuItemContainer } from './StyledMenuItemContainer.native.js';
|
|
5
|
+
import { itemFirstRowHeight } from './tokens.js';
|
|
5
6
|
import { Box } from '../../Box/Box.js';
|
|
6
7
|
import '../../Typography/Heading/Heading.js';
|
|
7
8
|
import { getTextProps, Text } from '../../Typography/Text/Text.js';
|
|
8
9
|
import '../../Typography/Code/Code.js';
|
|
9
10
|
import '../../Typography/Display/Display.js';
|
|
10
|
-
import '../../../
|
|
11
|
-
import '
|
|
12
|
-
import {
|
|
11
|
+
import { makeAccessible } from '../../../utils/makeAccessible/makeAccessible.native.js';
|
|
12
|
+
import { BaseText } from '../../Typography/BaseText/BaseText.native.js';
|
|
13
|
+
import { useTruncationTitle } from '../../../utils/useTruncationTitle/useTruncationTitle.native.js';
|
|
13
14
|
import 'react-native';
|
|
14
15
|
import '@babel/runtime/helpers/slicedToArray';
|
|
15
16
|
import { makeSize } from '../../../utils/makeSize/makeSize.js';
|
|
16
17
|
import '../../BladeProvider/useTheme.js';
|
|
17
|
-
import { makeAccessible } from '../../../utils/makeAccessible/makeAccessible.native.js';
|
|
18
|
-
import { BaseText } from '../../Typography/BaseText/BaseText.native.js';
|
|
19
|
-
import { useTruncationTitle } from '../../../utils/useTruncationTitle/useTruncationTitle.native.js';
|
|
20
18
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
21
19
|
|
|
22
|
-
var _excluded=["title","description","as","leading","trailing","titleSuffix","isDisabled","selectionType","isSelected","isVisible","color","role","children"];var menuItemTitleColor={negative:{default:'feedback.text.negative.intense',disabled:'interactive.text.gray.disabled'},normal:{default:'interactive.text.gray.normal',disabled:'interactive.text.gray.disabled'}};var menuItemDescriptionColor={default:'interactive.text.gray.muted',disabled:'interactive.text.gray.disabled'};var
|
|
20
|
+
var _excluded=["title","description","as","leading","trailing","titleSuffix","isDisabled","selectionType","isSelected","isVisible","color","role","children"];var menuItemTitleColor={negative:{default:'feedback.text.negative.intense',disabled:'interactive.text.gray.disabled'},normal:{default:'interactive.text.gray.normal',disabled:'interactive.text.gray.disabled'}};var menuItemDescriptionColor={default:'interactive.text.gray.muted',disabled:'interactive.text.gray.disabled'};var _BaseMenuItem=function _BaseMenuItem(_ref,ref){var title=_ref.title,description=_ref.description,as=_ref.as,leading=_ref.leading,trailing=_ref.trailing,titleSuffix=_ref.titleSuffix,isDisabled=_ref.isDisabled,_ref$selectionType=_ref.selectionType,selectionType=_ref$selectionType===void 0?'single':_ref$selectionType,isSelected=_ref.isSelected,_ref$isVisible=_ref.isVisible,isVisible=_ref$isVisible===void 0?true:_ref$isVisible,color=_ref.color,_ref$role=_ref.role,role=_ref$role===void 0?'menuitem':_ref$role,children=_ref.children,props=_objectWithoutProperties(_ref,_excluded);var _useTruncationTitle=useTruncationTitle({content:title}),containerRef=_useTruncationTitle.containerRef,textRef=_useTruncationTitle.textRef;return jsx(BaseMenuItemContext.Provider,{value:{color:color,isDisabled:isDisabled},children:jsx(StyledMenuItemContainer,Object.assign({ref:ref,as:as,type:"button",disabled:isDisabled},makeAccessible({role:role,current:role==='menuitem'||role==='menuitemcheckbox'?isSelected:undefined,disabled:isDisabled,selected:isSelected}),{color:color,isVisible:isVisible,isSelected:isSelected,isDisabled:isDisabled,selectionType:selectionType},props,{children:children?children:jsxs(Box,{display:"flex",alignItems:"flex-start",width:"100%",justifyContent:"flex-start",children:[jsx(Box,{display:"flex",justifyContent:"center",alignItems:"center",height:makeSize(itemFirstRowHeight),children:leading}),jsxs(Box,{paddingLeft:leading?'spacing.3':'spacing.0',paddingRight:"spacing.3",display:"flex",flexDirection:"column",children:[jsxs(Box,{display:"flex",alignItems:"center",flexDirection:"row",height:makeSize(itemFirstRowHeight),ref:containerRef,children:[jsx(BaseText,Object.assign({as:"p",ref:textRef,truncateAfterLines:1,wordBreak:"break-all"},getTextProps({size:'medium',color:menuItemTitleColor[color==='negative'?'negative':'normal'][isDisabled?'disabled':'default'],weight:'regular'}),{children:title})),titleSuffix]}),jsx(Box,{children:description?jsx(Text,{color:menuItemDescriptionColor[isDisabled?'disabled':'default'],size:"small",children:description}):null})]}),jsx(Box,{marginLeft:"auto",children:trailing})]})}))});};var BaseMenuItem=React__default.forwardRef(_BaseMenuItem);
|
|
23
21
|
|
|
24
22
|
export { BaseMenuItem };
|
|
25
23
|
//# sourceMappingURL=BaseMenuItem.js.map
|
|
@@ -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 {
|
|
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","default","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","Object","assign","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,IAAA,SAAA,CAAA,CAAA,OAAA,CAAA,aAAA,CAAA,IAAA,CAAA,SAAA,CAAA,UAAA,CAAA,aAAA,CAAA,YAAA,CAAA,eAAA,CAAA,YAAA,CAAA,WAAA,CAAA,OAAA,CAAA,MAAA,CAAA,UAAA,CAAA,CAaA,IAAMA,kBAAkB,CAAG,CACzBC,QAAQ,CAAE,CACRC,OAAO,CAAE,gCAAgC,CACzCC,QAAQ,CAAE,gCACZ,CAAC,CACDC,MAAM,CAAE,CAAEF,OAAO,CAAE,8BAA8B,CAAEC,QAAQ,CAAE,gCAAiC,CAChG,CAAU,CAEV,IAAME,wBAAwB,CAAG,CAC/BH,OAAO,CAAE,6BAA6B,CACtCC,QAAQ,CAAE,gCACZ,CAAU,CAIV,IAAMG,aAAiF,CAAG,SAApFA,aAAiFA,CAAAC,IAAA,CAiBrFC,GAAG,CACoB,CAAA,IAhBrBC,KAAK,CAAAF,IAAA,CAALE,KAAK,CACLC,WAAW,CAAAH,IAAA,CAAXG,WAAW,CACXC,EAAE,CAAAJ,IAAA,CAAFI,EAAE,CACFC,OAAO,CAAAL,IAAA,CAAPK,OAAO,CACPC,QAAQ,CAAAN,IAAA,CAARM,QAAQ,CACRC,WAAW,CAAAP,IAAA,CAAXO,WAAW,CACXC,UAAU,CAAAR,IAAA,CAAVQ,UAAU,CAAAC,kBAAA,CAAAT,IAAA,CACVU,aAAa,CAAbA,aAAa,CAAAD,kBAAA,GAAG,KAAA,CAAA,CAAA,QAAQ,CAAAA,kBAAA,CACxBE,UAAU,CAAAX,IAAA,CAAVW,UAAU,CAAAC,cAAA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AAtB,CAAAA,QAAA,CACDd,WAAW,CACVuB,GAAA,CAAC8B,IAAI,CAAA,CACH1C,KAAK,CAAEhB,wBAAwB,CAACU,UAAU,CAAG,UAAU,CAAG,SAAS,CAAE,CACrE8C,IAAI,CAAC,OAAO,CAAArC,QAAA,CAEXd,WAAW,CACR,CAAC,CACL,IAAI,CACL,CAAC,CACH,CAAA,CAAC,CACNuB,GAAA,CAACa,GAAG,CAACkB,CAAAA,UAAU,CAAC,MAAM,CAAAxC,QAAA,CAAEX,QAAQ,CAAM,CAAC,CAAA,CACpC,CACN,CACsB,CAAA,CAAC,CACE,CAAC,CAEnC,CAAC,CAEK,IAAAoD,YAAY,CAAGC,cAAK,CAACC,UAAU,CAAC7D,aAAa;;;;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getItemMargin } from './tokens.js';
|
|
1
2
|
import 'react-native';
|
|
2
3
|
import '@babel/runtime/helpers/slicedToArray';
|
|
3
4
|
import 'react';
|
|
@@ -6,7 +7,7 @@ import { makeBorderSize } from '../../../utils/makeBorderSize/makeBorderSize.js'
|
|
|
6
7
|
import { makeSize } from '../../../utils/makeSize/makeSize.js';
|
|
7
8
|
import '../../BladeProvider/useTheme.js';
|
|
8
9
|
|
|
9
|
-
var getBaseMenuItemStyles=function getBaseMenuItemStyles(props){return {borderWidth:makeBorderSize(props.theme.border.width.none),display:'flex',flexDirection:'column',textAlign:isReactNative()?undefined:'left',backgroundColor:'transparent',borderRadius:makeSize(props.theme.border.radius.medium),marginTop:makeSize(props.theme
|
|
10
|
+
var getBaseMenuItemStyles=function getBaseMenuItemStyles(props){return {borderWidth:makeBorderSize(props.theme.border.width.none),display:'flex',flexDirection:'column',textAlign:isReactNative()?undefined:'left',backgroundColor:'transparent',borderRadius:makeSize(props.theme.border.radius.medium),marginTop:makeSize(getItemMargin(props.theme)),marginBottom:makeSize(getItemMargin(props.theme)),textDecoration:'none',cursor:'pointer',width:'100%'};};
|
|
10
11
|
|
|
11
12
|
export { getBaseMenuItemStyles };
|
|
12
13
|
//# sourceMappingURL=getBaseMenuItemStyles.js.map
|
|
@@ -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
|
|
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":";;;;;;;;;AAMM,IAAAA,qBAAqB,CAAG,SAAxBA,qBAAqBA,CAAIC,KAAuB,CAAgB,CACpE,OAAO,CACLC,WAAW,CAAEC,cAAc,CAACF,KAAK,CAACG,KAAK,CAACC,MAAM,CAACC,KAAK,CAACC,IAAI,CAAC,CAC1DC,OAAO,CAAE,MAAM,CACfC,aAAa,CAAE,QAAQ,CACvBC,SAAS,CAAEC,aAAa,EAAE,CAAGC,SAAS,CAAG,MAAM,CAC/CC,eAAe,CAAE,aAAa,CAC9BC,YAAY,CAAEC,QAAQ,CAACd,KAAK,CAACG,KAAK,CAACC,MAAM,CAACW,MAAM,CAACC,MAAM,CAAC,CACxDC,SAAS,CAAEH,QAAQ,CAACI,aAAa,CAAClB,KAAK,CAACG,KAAK,CAAC,CAAC,CAC/CgB,YAAY,CAAEL,QAAQ,CAACI,aAAa,CAAClB,KAAK,CAACG,KAAK,CAAC,CAAC,CAClDiB,cAAc,CAAE,MAAM,CACtBC,MAAM,CAAE,SAAS,CACjBhB,KAAK,CAAE,MACT,CAAC,CACH;;;;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import '../../../tokens/global/typography.js';
|
|
2
|
+
import '../../../tokens/global/motion.js';
|
|
3
|
+
import { size } from '../../../tokens/global/size.js';
|
|
4
|
+
|
|
5
|
+
var itemFirstRowHeight=size[20];var getItemMargin=function getItemMargin(theme){return theme.spacing[1];};
|
|
6
|
+
|
|
7
|
+
export { getItemMargin, itemFirstRowHeight };
|
|
8
|
+
//# 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","getItemMargin","theme","spacing"],"mappings":";;;;AAGM,IAAAA,kBAAkB,CAAGC,IAAI,CAAC,EAAE,EAc5B,IAAAC,aAAa,CAAG,SAAhBA,aAAaA,CAAIC,KAAY,CAAa,CAC9C,OAAOA,KAAK,CAACC,OAAO,CAAC,CAAC,CAAC,CACzB;;;;"}
|
|
@@ -3,7 +3,7 @@ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProper
|
|
|
3
3
|
import React__default from 'react';
|
|
4
4
|
import { getActionListContainerRole, getActionListItemWrapperRole } from './getA11yRoles.js';
|
|
5
5
|
import { getActionListProperties } from './actionListUtils.js';
|
|
6
|
-
import { ActionListBox } from './ActionListBox.web.js';
|
|
6
|
+
import { ActionListVirtualizedBox, ActionListBox } from './ActionListBox.web.js';
|
|
7
7
|
import { componentIds } from './componentIds.js';
|
|
8
8
|
import { ActionListNoResults } from './ActionListNoResults.js';
|
|
9
9
|
import { useDropdown } from '../Dropdown/useDropdown.js';
|
|
@@ -22,12 +22,13 @@ import { metaAttribute } from '../../utils/metaAttribute/metaAttribute.web.js';
|
|
|
22
22
|
import { MetaConstants } from '../../utils/metaAttribute/metaConstants.js';
|
|
23
23
|
import { assignWithoutSideEffects } from '../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
|
|
24
24
|
|
|
25
|
-
var _excluded = ["children", "testID"];
|
|
25
|
+
var _excluded = ["children", "testID", "isVirtualized"];
|
|
26
26
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
27
27
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
28
28
|
var _ActionList = function _ActionList(_ref) {
|
|
29
29
|
var children = _ref.children,
|
|
30
30
|
testID = _ref.testID,
|
|
31
|
+
isVirtualized = _ref.isVirtualized,
|
|
31
32
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
32
33
|
var _useDropdown = useDropdown(),
|
|
33
34
|
setOptions = _useDropdown.setOptions,
|
|
@@ -37,6 +38,7 @@ var _ActionList = function _ActionList(_ref) {
|
|
|
37
38
|
dropdownTriggerer = _useDropdown.dropdownTriggerer,
|
|
38
39
|
hasFooterAction = _useDropdown.hasFooterAction,
|
|
39
40
|
filteredValues = _useDropdown.filteredValues;
|
|
41
|
+
var ActionListBox$1 = isVirtualized ? ActionListVirtualizedBox : ActionListBox;
|
|
40
42
|
var _useBottomSheetContex = useBottomSheetContext(),
|
|
41
43
|
isInBottomSheet = _useBottomSheetContex.isInBottomSheet;
|
|
42
44
|
var _React$useMemo = React__default.useMemo(function () {
|
|
@@ -45,9 +47,6 @@ var _ActionList = function _ActionList(_ref) {
|
|
|
45
47
|
sectionData = _React$useMemo.sectionData,
|
|
46
48
|
childrenWithId = _React$useMemo.childrenWithId,
|
|
47
49
|
actionListOptions = _React$useMemo.actionListOptions;
|
|
48
|
-
console.log({
|
|
49
|
-
actionListOptions: actionListOptions
|
|
50
|
-
});
|
|
51
50
|
React__default.useEffect(function () {
|
|
52
51
|
setOptions(actionListOptions);
|
|
53
52
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -64,7 +63,7 @@ var _ActionList = function _ActionList(_ref) {
|
|
|
64
63
|
// 1. We don't render the box wrapper styles which includes shadows, padding, border etc
|
|
65
64
|
// 2. to ensure GorhomBottomSheetSectionList works as expected, if we add extra wrappers GorhomBottomSheet won't render the content inside
|
|
66
65
|
// NOTE: That this also means inside BottomSheet, ActionList won't render any ActionListHeader or Footer.
|
|
67
|
-
return isInBottomSheet ? /*#__PURE__*/jsx(ActionListBox, _objectSpread({
|
|
66
|
+
return isInBottomSheet ? /*#__PURE__*/jsx(ActionListBox$1, _objectSpread({
|
|
68
67
|
isInBottomSheet: isInBottomSheet,
|
|
69
68
|
actionListItemWrapperRole: actionListItemWrapperRole,
|
|
70
69
|
childrenWithId: childrenWithId,
|
|
@@ -81,7 +80,7 @@ var _ActionList = function _ActionList(_ref) {
|
|
|
81
80
|
name: MetaConstants.ActionList,
|
|
82
81
|
testID: testID
|
|
83
82
|
})), makeAnalyticsAttribute(rest)), {}, {
|
|
84
|
-
children: /*#__PURE__*/jsx(ActionListBox, {
|
|
83
|
+
children: /*#__PURE__*/jsx(ActionListBox$1, {
|
|
85
84
|
isInBottomSheet: isInBottomSheet,
|
|
86
85
|
actionListItemWrapperRole: actionListItemWrapperRole,
|
|
87
86
|
childrenWithId: childrenWithId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionList.js","sources":["../../../../../../src/components/ActionList/ActionList.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React from 'react';\nimport { getActionListContainerRole, getActionListItemWrapperRole } from './getA11yRoles';\nimport { getActionListProperties } from './actionListUtils';\nimport { ActionListBox } from './ActionListBox';\nimport { componentIds } from './componentIds';\nimport { ActionListNoResults } from './ActionListNoResults';\nimport { useDropdown } from '~components/Dropdown/useDropdown';\nimport { useBottomSheetContext } from '~components/BottomSheet/BottomSheetContext';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport type { DataAnalyticsAttribute, TestID } from '~utils/types';\nimport BaseBox from '~components/Box/BaseBox';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { dropdownComponentIds } from '~components/Dropdown/dropdownComponentIds';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype ActionListProps = {\n children: React.ReactNode[];\n} & TestID &\n DataAnalyticsAttribute;\n\nconst _ActionList = ({
|
|
1
|
+
{"version":3,"file":"ActionList.js","sources":["../../../../../../src/components/ActionList/ActionList.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React from 'react';\nimport { getActionListContainerRole, getActionListItemWrapperRole } from './getA11yRoles';\nimport { getActionListProperties } from './actionListUtils';\nimport { ActionListBox as ActionListNormalBox, ActionListVirtualizedBox } from './ActionListBox';\nimport { componentIds } from './componentIds';\nimport { ActionListNoResults } from './ActionListNoResults';\nimport { useDropdown } from '~components/Dropdown/useDropdown';\nimport { useBottomSheetContext } from '~components/BottomSheet/BottomSheetContext';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport type { DataAnalyticsAttribute, TestID } from '~utils/types';\nimport BaseBox from '~components/Box/BaseBox';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { dropdownComponentIds } from '~components/Dropdown/dropdownComponentIds';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype ActionListProps = {\n children: React.ReactNode[];\n isVirtualized?: boolean;\n} & TestID &\n DataAnalyticsAttribute;\n\nconst _ActionList = ({\n children,\n testID,\n isVirtualized,\n ...rest\n}: ActionListProps): React.ReactElement => {\n const {\n setOptions,\n actionListItemRef,\n selectionType,\n dropdownBaseId,\n dropdownTriggerer,\n hasFooterAction,\n filteredValues,\n } = useDropdown();\n\n const ActionListBox = isVirtualized ? ActionListVirtualizedBox : ActionListNormalBox;\n\n const { isInBottomSheet } = useBottomSheetContext();\n\n const { sectionData, childrenWithId, actionListOptions } = React.useMemo(\n () => getActionListProperties(children),\n [children],\n );\n\n React.useEffect(() => {\n setOptions(actionListOptions);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [actionListOptions]);\n\n if (\n filteredValues.length <= 0 &&\n dropdownTriggerer === dropdownComponentIds.triggers.AutoComplete\n ) {\n return <ActionListNoResults />;\n }\n\n const actionListContainerRole = getActionListContainerRole(hasFooterAction, dropdownTriggerer);\n const actionListItemWrapperRole = getActionListItemWrapperRole(\n hasFooterAction,\n dropdownTriggerer,\n );\n const isMultiSelectable = selectionType === 'multiple';\n\n // If we are inside BottomSheet, we don't render The StyledActionList wrapper\n // This is to ensure:\n // 1. We don't render the box wrapper styles which includes shadows, padding, border etc\n // 2. to ensure GorhomBottomSheetSectionList works as expected, if we add extra wrappers GorhomBottomSheet won't render the content inside\n // NOTE: That this also means inside BottomSheet, ActionList won't render any ActionListHeader or Footer.\n return isInBottomSheet ? (\n <ActionListBox\n isInBottomSheet={isInBottomSheet}\n actionListItemWrapperRole={actionListItemWrapperRole}\n childrenWithId={childrenWithId}\n sectionData={sectionData}\n isMultiSelectable={isMultiSelectable}\n ref={actionListItemRef as any}\n {...makeAnalyticsAttribute(rest)}\n />\n ) : (\n <BaseBox\n id={`${dropdownBaseId}-actionlist`}\n {...makeAccessible({\n role: actionListContainerRole,\n multiSelectable: actionListContainerRole === 'listbox' ? isMultiSelectable : undefined,\n labelledBy: `${dropdownBaseId}-label`,\n })}\n {...metaAttribute({ name: MetaConstants.ActionList, testID })}\n {...makeAnalyticsAttribute(rest)}\n >\n <ActionListBox\n isInBottomSheet={isInBottomSheet}\n actionListItemWrapperRole={actionListItemWrapperRole}\n childrenWithId={childrenWithId}\n sectionData={sectionData}\n isMultiSelectable={isMultiSelectable}\n ref={actionListItemRef as any}\n />\n </BaseBox>\n );\n};\n\n/**\n * ### ActionList\n *\n * List of multiple actionable items. Can be used as menu items inside `Dropdown`,\n * `BottomSheet` and as selectable items when combined with `SelectInput`\n *\n * #### Usage\n *\n * ```jsx\n * <Dropdown>\n * <SelectInput label=\"Select Action\" />\n * <DropdownOverlay>\n * <DropdownHeader title=\"Header Title\" />\n * <ActionList>\n * <ActionListItem\n * title=\"Home\"\n * value=\"home\"\n * leading={<ActionListItemIcon icon={HomeIcon} />}\n * />\n * <ActionListItem\n * title=\"Pricing\"\n * value=\"pricing\"\n * leading={<ActionListItemAsset src=\"https://flagcdn.com/w20/in.png\" alt=\"India Flag\" />}\n * />\n * </ActionList>\n * <DropdownFooter><Button>Apply</Button></DropdownFooter>\n * </DropdownOverlay>\n * </Dropdown>\n * ```\n *\n */\nconst ActionList = assignWithoutSideEffects(React.memo(_ActionList), {\n displayName: componentIds.ActionList,\n componentId: componentIds.ActionList,\n});\n\nexport type { ActionListProps };\nexport { ActionList };\n"],"names":["_ActionList","_ref","children","testID","isVirtualized","rest","_objectWithoutProperties","_excluded","_useDropdown","useDropdown","setOptions","actionListItemRef","selectionType","dropdownBaseId","dropdownTriggerer","hasFooterAction","filteredValues","ActionListBox","ActionListVirtualizedBox","ActionListNormalBox","_useBottomSheetContex","useBottomSheetContext","isInBottomSheet","_React$useMemo","React","useMemo","getActionListProperties","sectionData","childrenWithId","actionListOptions","useEffect","length","dropdownComponentIds","triggers","AutoComplete","_jsx","ActionListNoResults","actionListContainerRole","getActionListContainerRole","actionListItemWrapperRole","getActionListItemWrapperRole","isMultiSelectable","_objectSpread","ref","makeAnalyticsAttribute","BaseBox","id","concat","makeAccessible","role","multiSelectable","undefined","labelledBy","metaAttribute","name","MetaConstants","ActionList","assignWithoutSideEffects","memo","displayName","componentIds","componentId"],"mappings":";;;;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