@muraldevkit/ui-toolkit 4.77.0-dev-yOaq.1 → 4.77.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/button/MrlButton/MrlButton.js +16 -8
- package/dist/cjs/components/button/MrlButton/MrlButton.js.map +1 -1
- package/dist/cjs/components/file-upload/MrlFileUpload/MrlFileUpload.js +5 -2
- package/dist/cjs/components/file-upload/MrlFileUpload/MrlFileUpload.js.map +1 -1
- package/dist/cjs/components/filter/MrlFilterItem/MrlFilterItem.js +2 -1
- package/dist/cjs/components/filter/MrlFilterItem/MrlFilterItem.js.map +1 -1
- package/dist/cjs/components/form/checkbox/MrlCheckboxStandalone/MrlCheckboxStandalone.js.map +1 -1
- package/dist/cjs/components/form/label/MrlLabel/MrlLabel.js.map +1 -1
- package/dist/cjs/components/form/legacy-select/MrlLegacySelect/MrlLegacySelect.js.map +1 -1
- package/dist/cjs/components/form/text-input/MrlTextInput/MrlTextInput.js.map +1 -1
- package/dist/cjs/components/grid/MrlCol/MrlCol.js +49 -42
- package/dist/cjs/components/grid/MrlCol/MrlCol.js.map +1 -1
- package/dist/cjs/components/grid/MrlGrid/MrlGrid.js +6 -4
- package/dist/cjs/components/grid/MrlGrid/MrlGrid.js.map +1 -1
- package/dist/cjs/components/grid/MrlRow/MrlRow.js +8 -10
- package/dist/cjs/components/grid/MrlRow/MrlRow.js.map +1 -1
- package/dist/cjs/components/grid/constants.js +8 -27
- package/dist/cjs/components/grid/constants.js.map +1 -1
- package/dist/cjs/components/link/MrlLink/MrlLink.js.map +1 -1
- package/dist/cjs/components/menu/MrlMenu/MrlMenu.js.map +1 -1
- package/dist/cjs/components/menu/MrlMenuGroup/MrlMenuGroup.js +4 -1
- package/dist/cjs/components/menu/MrlMenuGroup/MrlMenuGroup.js.map +1 -1
- package/dist/cjs/components/menu/MrlMenuItem/MrlMenuItem.js +2 -1
- package/dist/cjs/components/menu/MrlMenuItem/MrlMenuItem.js.map +1 -1
- package/dist/cjs/components/menu/MrlMenuItemLink/MrlMenuItemLink.js +8 -4
- package/dist/cjs/components/menu/MrlMenuItemLink/MrlMenuItemLink.js.map +1 -1
- package/dist/cjs/components/modal/MrlModalContent/MrlModalContent.js +1 -1
- package/dist/cjs/components/modal/MrlModalContent/MrlModalContent.js.map +1 -1
- package/dist/cjs/components/modal/MrlModalFooter/MrlModalFooter.js +2 -1
- package/dist/cjs/components/modal/MrlModalFooter/MrlModalFooter.js.map +1 -1
- package/dist/cjs/components/modal/MrlModalHeader/MrlModalHeader.js +1 -1
- package/dist/cjs/components/modal/MrlModalHeader/MrlModalHeader.js.map +1 -1
- package/dist/cjs/components/panel/MrlPanel/MrlPanel.js.map +1 -1
- package/dist/cjs/components/panel/MrlPanelFooter/MrlPanelFooter.js +2 -1
- package/dist/cjs/components/panel/MrlPanelFooter/MrlPanelFooter.js.map +1 -1
- package/dist/cjs/components/panel/MrlPanelStickyHeader/MrlPanelStickyHeader.js +2 -1
- package/dist/cjs/components/panel/MrlPanelStickyHeader/MrlPanelStickyHeader.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/components/button/MrlButton/MrlButton.d.ts +6 -0
- package/dist/components/filter/MrlFilterItem/MrlFilterItem.d.ts +6 -3
- package/dist/components/form/checkbox/MrlCheckboxStandalone/MrlCheckboxStandalone.d.ts +10 -2
- package/dist/components/form/label/MrlLabel/MrlLabel.d.ts +5 -1
- package/dist/components/form/legacy-select/MrlLegacySelect/MrlLegacySelect.d.ts +2 -0
- package/dist/components/form/text-input/MrlTextInput/MrlTextInput.d.ts +5 -1
- package/dist/components/grid/MrlCol/MrlCol.d.ts +6 -4
- package/dist/components/grid/MrlCol/index.d.ts +1 -1
- package/dist/components/grid/MrlGrid/MrlGrid.d.ts +4 -5
- package/dist/components/grid/MrlGrid/index.d.ts +1 -1
- package/dist/components/grid/MrlRow/MrlRow.d.ts +7 -7
- package/dist/components/grid/MrlRow/index.d.ts +1 -1
- package/dist/components/grid/constants.d.ts +6 -20
- package/dist/components/link/MrlLink/MrlLink.d.ts +2 -0
- package/dist/components/menu/MrlMenu/MrlMenu.d.ts +10 -3
- package/dist/components/menu/MrlMenuGroup/MrlMenuGroup.d.ts +15 -1
- package/dist/components/menu/MrlMenuItem/MrlMenuItem.d.ts +14 -6
- package/dist/components/menu/MrlMenuItemLink/MrlMenuItemLink.d.ts +16 -7
- package/dist/components/modal/MrlModalContent/MrlModalContent.d.ts +5 -2
- package/dist/components/modal/MrlModalFooter/MrlModalFooter.d.ts +4 -2
- package/dist/components/modal/MrlModalHeader/MrlModalHeader.d.ts +4 -3
- package/dist/components/panel/MrlPanel/MrlPanel.d.ts +2 -1
- package/dist/components/panel/MrlPanelFooter/MrlPanelFooter.d.ts +6 -3
- package/dist/components/panel/MrlPanelStickyHeader/MrlPanelStickyHeader.d.ts +4 -2
- package/dist/esm/components/button/MrlButton/MrlButton.js +16 -8
- package/dist/esm/components/button/MrlButton/MrlButton.js.map +1 -1
- package/dist/esm/components/file-upload/MrlFileUpload/MrlFileUpload.js +5 -2
- package/dist/esm/components/file-upload/MrlFileUpload/MrlFileUpload.js.map +1 -1
- package/dist/esm/components/filter/MrlFilterItem/MrlFilterItem.js +2 -1
- package/dist/esm/components/filter/MrlFilterItem/MrlFilterItem.js.map +1 -1
- package/dist/esm/components/form/checkbox/MrlCheckboxStandalone/MrlCheckboxStandalone.js.map +1 -1
- package/dist/esm/components/form/label/MrlLabel/MrlLabel.js.map +1 -1
- package/dist/esm/components/form/legacy-select/MrlLegacySelect/MrlLegacySelect.js.map +1 -1
- package/dist/esm/components/form/text-input/MrlTextInput/MrlTextInput.js.map +1 -1
- package/dist/esm/components/grid/MrlCol/MrlCol.js +50 -43
- package/dist/esm/components/grid/MrlCol/MrlCol.js.map +1 -1
- package/dist/esm/components/grid/MrlGrid/MrlGrid.js +6 -4
- package/dist/esm/components/grid/MrlGrid/MrlGrid.js.map +1 -1
- package/dist/esm/components/grid/MrlRow/MrlRow.js +8 -10
- package/dist/esm/components/grid/MrlRow/MrlRow.js.map +1 -1
- package/dist/esm/components/grid/constants.js +8 -26
- package/dist/esm/components/grid/constants.js.map +1 -1
- package/dist/esm/components/link/MrlLink/MrlLink.js.map +1 -1
- package/dist/esm/components/menu/MrlMenu/MrlMenu.js.map +1 -1
- package/dist/esm/components/menu/MrlMenuGroup/MrlMenuGroup.js +4 -1
- package/dist/esm/components/menu/MrlMenuGroup/MrlMenuGroup.js.map +1 -1
- package/dist/esm/components/menu/MrlMenuItem/MrlMenuItem.js +2 -1
- package/dist/esm/components/menu/MrlMenuItem/MrlMenuItem.js.map +1 -1
- package/dist/esm/components/menu/MrlMenuItemLink/MrlMenuItemLink.js +8 -4
- package/dist/esm/components/menu/MrlMenuItemLink/MrlMenuItemLink.js.map +1 -1
- package/dist/esm/components/modal/MrlModalContent/MrlModalContent.js +1 -1
- package/dist/esm/components/modal/MrlModalContent/MrlModalContent.js.map +1 -1
- package/dist/esm/components/modal/MrlModalFooter/MrlModalFooter.js +2 -1
- package/dist/esm/components/modal/MrlModalFooter/MrlModalFooter.js.map +1 -1
- package/dist/esm/components/modal/MrlModalHeader/MrlModalHeader.js +1 -1
- package/dist/esm/components/modal/MrlModalHeader/MrlModalHeader.js.map +1 -1
- package/dist/esm/components/panel/MrlPanel/MrlPanel.js.map +1 -1
- package/dist/esm/components/panel/MrlPanelFooter/MrlPanelFooter.js +2 -1
- package/dist/esm/components/panel/MrlPanelFooter/MrlPanelFooter.js.map +1 -1
- package/dist/esm/components/panel/MrlPanelStickyHeader/MrlPanelStickyHeader.js +2 -1
- package/dist/esm/components/panel/MrlPanelStickyHeader/MrlPanelStickyHeader.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/styles/MrlSidebar/module.scss +2 -2
- package/dist/styles/grid/global.scss +2 -98
- package/dist/styles/grid/variables.scss +18 -2
- package/dist/styles.css +6 -1
- package/dist/types/components/button/MrlButton/MrlButton.d.ts +6 -0
- package/dist/types/components/filter/MrlFilterItem/MrlFilterItem.d.ts +6 -3
- package/dist/types/components/form/checkbox/MrlCheckboxStandalone/MrlCheckboxStandalone.d.ts +10 -2
- package/dist/types/components/form/label/MrlLabel/MrlLabel.d.ts +5 -1
- package/dist/types/components/form/legacy-select/MrlLegacySelect/MrlLegacySelect.d.ts +2 -0
- package/dist/types/components/form/text-input/MrlTextInput/MrlTextInput.d.ts +5 -1
- package/dist/types/components/grid/MrlCol/MrlCol.d.ts +6 -4
- package/dist/types/components/grid/MrlCol/index.d.ts +1 -1
- package/dist/types/components/grid/MrlGrid/MrlGrid.d.ts +4 -5
- package/dist/types/components/grid/MrlGrid/index.d.ts +1 -1
- package/dist/types/components/grid/MrlRow/MrlRow.d.ts +7 -7
- package/dist/types/components/grid/MrlRow/index.d.ts +1 -1
- package/dist/types/components/grid/constants.d.ts +6 -20
- package/dist/types/components/link/MrlLink/MrlLink.d.ts +2 -0
- package/dist/types/components/menu/MrlMenu/MrlMenu.d.ts +10 -3
- package/dist/types/components/menu/MrlMenuGroup/MrlMenuGroup.d.ts +15 -1
- package/dist/types/components/menu/MrlMenuItem/MrlMenuItem.d.ts +14 -6
- package/dist/types/components/menu/MrlMenuItemLink/MrlMenuItemLink.d.ts +16 -7
- package/dist/types/components/modal/MrlModalContent/MrlModalContent.d.ts +5 -2
- package/dist/types/components/modal/MrlModalFooter/MrlModalFooter.d.ts +4 -2
- package/dist/types/components/modal/MrlModalHeader/MrlModalHeader.d.ts +4 -3
- package/dist/types/components/panel/MrlPanel/MrlPanel.d.ts +2 -1
- package/dist/types/components/panel/MrlPanelFooter/MrlPanelFooter.d.ts +6 -3
- package/dist/types/components/panel/MrlPanelStickyHeader/MrlPanelStickyHeader.d.ts +4 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MrlPanel.js","sources":["../../../../../src/components/panel/MrlPanel/MrlPanel.tsx"],"sourcesContent":["import * as React from 'react';\nimport classnames from 'classnames';\nimport styles from './MrlPanel.module.scss';\nimport { MrlIconButton } from '../../button';\nimport { MrlSvg } from '../../svg';\nimport { close } from '@muraldevkit/ds-icons';\nimport { MrlFocusTrap } from '../../focus-trap';\nimport { MrlText, MrlTextHeading } from '../../text';\nimport { MrlDivider } from '../../divider';\nimport { MrlPanelContext } from '../MrlPanelContext';\nimport { useHasFocusableDescendant } from '../../../hooks/useHasFocusableDescendant';\nimport { useScrollbarInfo } from '../../../hooks/useScrollbarInfo';\nimport { getUniqueId } from '../../../utils';\nimport { useMrlTrackInteraction } from '../../../hooks/useMrlAnalytics';\n\n/**\n * Props for the MrlPanel component.\n */\ninterface MrlPanelProps extends React.ComponentPropsWithRef<'div'> {\n\t/**\n\t * A string value used for data-qa attribute.\n\t */\n\t['data-qa']?: string;\n\n\t/**\n\t * Callback function that is called when the panel is closed.\n\t */\n\tonClose?: () => void;\n\n\t/**\n\t * The custom header element to be rendered in the panel.\n\t * When a custom header is used developers need to provide th aria-label and aria-describedby.\n\t */\n\theader?: React.ReactNode;\n\n\t/**\n\t * The custom top actions to be rendered in the panel header.\n\t * By default top actions are rendered on the right side of the title and include a MrlDivider at the end.\n\t * The close button should not be included as part of the top actions.\n\t */\n\ttopActions?: React.ReactNode;\n\n\t/**\n\t * The title of the panel.\n\t */\n\ttitle?: string;\n\n\t/**\n\t * The description of the panel.\n\t */\n\tdescription?: string;\n\n\t/**\n\t * Specifies whether to disable autofocus on the panel.\n\t */\n\tdisableAutofocus?: boolean;\n\n\t/**\n\t * Specifies whether the panel has a sticky header to adjust styles.\n\t */\n\thasStickyHeader?: boolean;\n\n\t/**\n\t * hasDataScrollAnchor is required to enable infinite scroll\n\t */\n\thasDataScrollAnchor?: boolean;\n\n\t/**\n\t * Enables interaction tracking for this panel. Provide a stable, non-PII id\n\t * (e.g. 'comments-panel'). When omitted, the panel emits no analytics.\n\t *\n\t * `open` is emitted when the panel mounts, since consumers control the panel's\n\t * presence by rendering it.\n\t */\n\teventId?: string;\n}\n\n/**\n * MrlPanel component.\n *\n * @param props The MrlPanel component properties.\n * @returns The MrlPanel component.\n */\nexport const MrlPanel = React.forwardRef<HTMLDivElement, MrlPanelProps>(\n\tfunction MrlPanel(props, ref): JSX.Element {\n\t\tconst {\n\t\t\tclassName,\n\t\t\ttitle,\n\t\t\tid,\n\t\t\tchildren,\n\t\t\thasStickyHeader,\n\t\t\theader,\n\t\t\tdescription,\n\t\t\tdisableAutofocus,\n\t\t\ttopActions,\n\t\t\thasDataScrollAnchor,\n\t\t\tonClose,\n\t\t\teventId,\n\t\t\t['data-qa']: qa = 'panel',\n\t\t\t...rest\n\t\t} = props;\n\n\t\tconst panelRef = React.useRef<HTMLDivElement>(null);\n\n\t\tconst trackInteraction = useMrlTrackInteraction('MrlPanel', eventId);\n\n\t\tReact.useEffect(() => {\n\t\t\ttrackInteraction({ action: 'open' });\n\t\t\t// the panel is open for as long as the consumer renders it\n\t\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t}, []);\n\n\t\t/**\n\t\t * Handles closing the panel from both the close button and the escape key.\n\t\t */\n\t\tconst handleClose = React.useCallback(() => {\n\t\t\ttrackInteraction({ action: 'close' });\n\n\t\t\tonClose?.();\n\t\t}, [onClose, trackInteraction]);\n\n\t\t// Unique ID for aria-describedby\n\t\tconst descriptionIdRef = React.useRef<string>(\n\t\t\tdescription ? getUniqueId('mrl-panel-description') : ''\n\t\t);\n\n\t\tconst {\n\t\t\tscrollableContainerRef,\n\t\t\thasVerticalScrollbar,\n\t\t\thasHorizontalScrollbar,\n\t\t\thorizontalScrollbarHeight,\n\t\t\tverticalScrollbarWidth\n\t\t} = useScrollbarInfo<HTMLDivElement>();\n\n\t\tconst hasFocusableDescendant = useHasFocusableDescendant(scrollableContainerRef);\n\n\t\tReact.useImperativeHandle<HTMLDivElement | null, HTMLDivElement | null>(ref, () => {\n\t\t\treturn panelRef.current;\n\t\t});\n\n\t\tconst handleKeyDown = React.useCallback(\n\t\t\t(e: React.KeyboardEvent<HTMLDivElement>) => {\n\t\t\t\tif (e.key === 'Escape' && typeof onClose === 'function') {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\thandleClose();\n\t\t\t\t}\n\t\t\t},\n\t\t\t[onClose, handleClose]\n\t\t);\n\n\t\tconst panelClasses = classnames(styles['MrlPanel'], 'MrlPanel', className);\n\n\t\treturn (\n\t\t\t<MrlPanelContext.Provider\n\t\t\t\tvalue={{\n\t\t\t\t\thasHorizontalScrollbar,\n\t\t\t\t\thasVerticalScrollbar,\n\t\t\t\t\thorizontalScrollbarHeight,\n\t\t\t\t\tverticalScrollbarWidth\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */}\n\t\t\t\t<div\n\t\t\t\t\t{...rest}\n\t\t\t\t\tclassName={panelClasses}\n\t\t\t\t\taria-describedby={descriptionIdRef.current || props['aria-describedby']}\n\t\t\t\t\taria-label={title || props['aria-label']}\n\t\t\t\t\taria-modal=\"false\"\n\t\t\t\t\tdata-qa={qa}\n\t\t\t\t\tid={id}\n\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\trole=\"dialog\"\n\t\t\t\t\tref={panelRef}\n\t\t\t\t>\n\t\t\t\t\t<MrlFocusTrap containerRef={panelRef} disableAutofocus={disableAutofocus}>\n\t\t\t\t\t\t<header className={classnames(styles['MrlPanel--header'], 'MrlPanel--header')}>\n\t\t\t\t\t\t\t{!header && (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tclassName={classnames(\n\t\t\t\t\t\t\t\t\t\tstyles['MrlPanel--header-content'],\n\t\t\t\t\t\t\t\t\t\t'MrlPanel--header-content',\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t[styles['MrlPanel--header-content-description']]: !!description\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<MrlTextHeading\n\t\t\t\t\t\t\t\t\t\tclassName={styles['MrlPanel--title']}\n\t\t\t\t\t\t\t\t\t\tattrs={{\n\t\t\t\t\t\t\t\t\t\t\t'data-qa': `${qa}-header-title`,\n\t\t\t\t\t\t\t\t\t\t\tid\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\thierarchy=\"primary\"\n\t\t\t\t\t\t\t\t\t\tkind=\"title\"\n\t\t\t\t\t\t\t\t\t\tlevel=\"2\"\n\t\t\t\t\t\t\t\t\t\tsize=\"medium\"\n\t\t\t\t\t\t\t\t\t\ttext={title}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t{topActions && (\n\t\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\t\tclassName={classnames(\n\t\t\t\t\t\t\t\t\t\t\t\t\tstyles['MrlPanel--top-actions'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t'MrlPanel--top-actions'\n\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t{topActions}\n\t\t\t\t\t\t\t\t\t\t\t\t<MrlDivider\n\t\t\t\t\t\t\t\t\t\t\t\t\torientation=\"vertical\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tspacing=\"small\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tlength=\"var(--mrl-spacing-06)\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassName={classnames(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tstyles['MrlPanel--top-actions-divider'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'MrlPanel--top-actions-divider'\n\t\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{header}\n\t\t\t\t\t\t\t<MrlIconButton\n\t\t\t\t\t\t\t\tdata-qa={`${qa}-close-button`}\n\t\t\t\t\t\t\t\twrapperClassName={classnames(styles['MrlPanel--close'], 'MrlPanel--close')}\n\t\t\t\t\t\t\t\ticon={<MrlSvg svg={close} />}\n\t\t\t\t\t\t\t\tonClick={handleClose}\n\t\t\t\t\t\t\t\ttext=\"Close\"\n\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\tstate=\"default\"\n\t\t\t\t\t\t\t\tposition=\"bottom\"\n\t\t\t\t\t\t\t\ttipAnchor=\"center\"\n\t\t\t\t\t\t\t\tkind=\"ghost\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</header>\n\n\t\t\t\t\t\t{/*\n\t\t\t\t\t\t * Scrollable container — includes description, sticky header and main\n\t\t\t\t\t\t * content. Per ACT rule 0ssw9k a scrollable element passes WCAG 2.1.1\n\t\t\t\t\t\t * Keyboard if it is itself focusable OR has a focusable descendant. We\n\t\t\t\t\t\t * therefore expose `tabindex=\"0\"` only when the wrapper has no focusable\n\t\t\t\t\t\t * descendants, which avoids the \"meaningless tab stop\" finding for\n\t\t\t\t\t\t * panels filled with interactive controls while still making text-only\n\t\t\t\t\t\t * panels keyboard-scrollable. The labeled `role=\"region\"` is preserved\n\t\t\t\t\t\t * whenever the panel overflows so screen-reader users get a landmark.\n\t\t\t\t\t\t * https://www.w3.org/WAI/standards-guidelines/act/rules/0ssw9k/\n\t\t\t\t\t\t */}\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tref={scrollableContainerRef}\n\t\t\t\t\t\t\tdata-scroll-anchor={hasDataScrollAnchor}\n\t\t\t\t\t\t\tdata-qa={`${qa}-scrollable`}\n\t\t\t\t\t\t\tclassName={classnames(styles['MrlPanel--scrollable'], 'MrlPanel--scrollable', {\n\t\t\t\t\t\t\t\t[styles['MrlPanel--scrollable-has-sticky-header']]: hasStickyHeader\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t{...(verticalScrollbarWidth > 0 && {\n\t\t\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t\t\tpaddingRight: `calc(var(--mrl-spacing-06) - ${verticalScrollbarWidth}px)`\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t{...(hasVerticalScrollbar && {\n\t\t\t\t\t\t\t\t'aria-label': title\n\t\t\t\t\t\t\t\t\t? `${title} panel scrollable content`\n\t\t\t\t\t\t\t\t\t: 'Panel scrollable content',\n\t\t\t\t\t\t\t\trole: 'region',\n\t\t\t\t\t\t\t\t...(!hasFocusableDescendant && {\n\t\t\t\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex\n\t\t\t\t\t\t\t\t\ttabIndex: 0\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{description && (\n\t\t\t\t\t\t\t\t<MrlText\n\t\t\t\t\t\t\t\t\tattrs={{\n\t\t\t\t\t\t\t\t\t\tclassName: classnames(styles['MrlPanel--description'], 'MrlPanel--description'),\n\t\t\t\t\t\t\t\t\t\tid: descriptionIdRef.current\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\tsize=\"xsmall\"\n\t\t\t\t\t\t\t\t\ttext={description}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</MrlFocusTrap>\n\t\t\t\t</div>\n\t\t\t</MrlPanelContext.Provider>\n\t\t);\n\t}\n);\n"],"names":["MrlPanel","React","forwardRef","props","ref","className","title","id","children","hasStickyHeader","header","description","disableAutofocus","topActions","hasDataScrollAnchor","onClose","eventId","_props$dataQa","qa","rest","_objectWithoutProperties","_excluded","panelRef","useRef","trackInteraction","useMrlTrackInteraction","useEffect","action","handleClose","useCallback","descriptionIdRef","getUniqueId","_useScrollbarInfo","useScrollbarInfo","scrollableContainerRef","hasVerticalScrollbar","hasHorizontalScrollbar","horizontalScrollbarHeight","verticalScrollbarWidth","hasFocusableDescendant","useHasFocusableDescendant","useImperativeHandle","current","handleKeyDown","e","key","preventDefault","stopPropagation","panelClasses","classnames","styles","createElement","MrlPanelContext","Provider","value","_extends","onKeyDown","role","MrlFocusTrap","containerRef","MrlTextHeading","attrs","concat","hierarchy","kind","level","size","text","Fragment","MrlDivider","orientation","spacing","length","MrlIconButton","wrapperClassName","icon","MrlSvg","svg","close","onClick","state","position","tipAnchor","style","paddingRight","_objectSpread","tabIndex","MrlText"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA;AACA;AACA;;AA4DA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMA,QAAQ,gBAAGC,gBAAK,CAACC,UAAU,CACvC,SAASF,QAAQA,CAACG,KAAK,EAAEC,GAAG,EAAe;AAC1C,EAAA,IACCC,SAAS,GAcNF,KAAK,CAdRE,SAAS;IACTC,KAAK,GAaFH,KAAK,CAbRG,KAAK;IACLC,EAAE,GAYCJ,KAAK,CAZRI,EAAE;IACFC,QAAQ,GAWLL,KAAK,CAXRK,QAAQ;IACRC,eAAe,GAUZN,KAAK,CAVRM,eAAe;IACfC,MAAM,GASHP,KAAK,CATRO,MAAM;IACNC,WAAW,GAQRR,KAAK,CARRQ,WAAW;IACXC,gBAAgB,GAObT,KAAK,CAPRS,gBAAgB;IAChBC,UAAU,GAMPV,KAAK,CANRU,UAAU;IACVC,mBAAmB,GAKhBX,KAAK,CALRW,mBAAmB;IACnBC,OAAO,GAIJZ,KAAK,CAJRY,OAAO;IACPC,OAAO,GAGJb,KAAK,CAHRa,OAAO;IAAAC,aAAA,GAGJd,KAAK,C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AA,CAAA;AACxB,IAAA,YAAY,EAAE/E,KAAK,GAAA,EAAA,CAAAwD,MAAA,CACbxD,KAAK,iCACR,0BAA0B;AAC7BmD,IAAAA,IAAI,EAAE;GAAQ,EACV,CAAClB,sBAAsB,IAAI;AAC9B;AACA+C,IAAAA,QAAQ,EAAE;GACV,CACD,GAEA3E,WAAW,iBACXV,gBAAA,CAAAkD,aAAA,CAACoC,eAAO,EAAA;AACP1B,IAAAA,KAAK,EAAE;MACNxD,SAAS,EAAE4C,2BAAU,CAACC,uBAAM,CAAC,uBAAuB,CAAC,EAAE,uBAAuB,CAAC;MAC/E3C,EAAE,EAAEuB,gBAAgB,CAACY;KACpB;AACFwB,IAAAA,IAAI,EAAC,QAAQ;AACbC,IAAAA,IAAI,EAAExD;AAAY,GAClB,CACD,EACAH,QACG,CACQ,CACV,CACoB,CAAC;AAE7B,CACD;;;;"}
|
|
1
|
+
{"version":3,"file":"MrlPanel.js","sources":["../../../../../src/components/panel/MrlPanel/MrlPanel.tsx"],"sourcesContent":["import * as React from 'react';\nimport classnames from 'classnames';\nimport styles from './MrlPanel.module.scss';\nimport { MrlIconButton } from '../../button';\nimport { MrlSvg } from '../../svg';\nimport { close } from '@muraldevkit/ds-icons';\nimport { MrlFocusTrap } from '../../focus-trap';\nimport { MrlText, MrlTextHeading } from '../../text';\nimport { MrlDivider } from '../../divider';\nimport { MrlPanelContext } from '../MrlPanelContext';\nimport { useHasFocusableDescendant } from '../../../hooks/useHasFocusableDescendant';\nimport { useScrollbarInfo } from '../../../hooks/useScrollbarInfo';\nimport { getUniqueId } from '../../../utils';\nimport { useMrlTrackInteraction } from '../../../hooks/useMrlAnalytics';\n\n/**\n * Props for the MrlPanel component.\n */\ninterface MrlPanelProps extends React.ComponentPropsWithRef<'div'> {\n\t/**\n\t * A string value used for data-qa attribute.\n\t */\n\t['data-qa']?: string;\n\n\t/**\n\t * Callback function that is called when the panel is closed.\n\t */\n\tonClose?: () => void;\n\n\t/**\n\t * The custom header element to be rendered in the panel.\n\t * When a custom header is used developers need to provide th aria-label and aria-describedby.\n\t */\n\theader?: React.ReactNode;\n\n\t/**\n\t * The custom top actions to be rendered in the panel header.\n\t * By default top actions are rendered on the right side of the title and include a MrlDivider at the end.\n\t * The close button should not be included as part of the top actions.\n\t */\n\ttopActions?: React.ReactNode;\n\n\t/**\n\t * The title of the panel.\n\t */\n\ttitle?: string;\n\n\t/**\n\t * The description of the panel.\n\t */\n\tdescription?: string;\n\n\t/**\n\t * Specifies whether to disable autofocus on the panel.\n\t */\n\tdisableAutofocus?: boolean;\n\n\t/**\n\t * Specifies whether the panel has a sticky header to adjust styles. Set it when the first child\n\t * is an `MrlPanelStickyHeader`, so the scroll area leaves room for it.\n\t */\n\thasStickyHeader?: boolean;\n\n\t/**\n\t * hasDataScrollAnchor is required to enable infinite scroll\n\t */\n\thasDataScrollAnchor?: boolean;\n\n\t/**\n\t * Enables interaction tracking for this panel. Provide a stable, non-PII id\n\t * (e.g. 'comments-panel'). When omitted, the panel emits no analytics.\n\t *\n\t * `open` is emitted when the panel mounts, since consumers control the panel's\n\t * presence by rendering it.\n\t */\n\teventId?: string;\n}\n\n/**\n * MrlPanel component.\n *\n * @param props The MrlPanel component properties.\n * @returns The MrlPanel component.\n */\nexport const MrlPanel = React.forwardRef<HTMLDivElement, MrlPanelProps>(\n\tfunction MrlPanel(props, ref): JSX.Element {\n\t\tconst {\n\t\t\tclassName,\n\t\t\ttitle,\n\t\t\tid,\n\t\t\tchildren,\n\t\t\thasStickyHeader,\n\t\t\theader,\n\t\t\tdescription,\n\t\t\tdisableAutofocus,\n\t\t\ttopActions,\n\t\t\thasDataScrollAnchor,\n\t\t\tonClose,\n\t\t\teventId,\n\t\t\t['data-qa']: qa = 'panel',\n\t\t\t...rest\n\t\t} = props;\n\n\t\tconst panelRef = React.useRef<HTMLDivElement>(null);\n\n\t\tconst trackInteraction = useMrlTrackInteraction('MrlPanel', eventId);\n\n\t\tReact.useEffect(() => {\n\t\t\ttrackInteraction({ action: 'open' });\n\t\t\t// the panel is open for as long as the consumer renders it\n\t\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t}, []);\n\n\t\t/**\n\t\t * Handles closing the panel from both the close button and the escape key.\n\t\t */\n\t\tconst handleClose = React.useCallback(() => {\n\t\t\ttrackInteraction({ action: 'close' });\n\n\t\t\tonClose?.();\n\t\t}, [onClose, trackInteraction]);\n\n\t\t// Unique ID for aria-describedby\n\t\tconst descriptionIdRef = React.useRef<string>(\n\t\t\tdescription ? getUniqueId('mrl-panel-description') : ''\n\t\t);\n\n\t\tconst {\n\t\t\tscrollableContainerRef,\n\t\t\thasVerticalScrollbar,\n\t\t\thasHorizontalScrollbar,\n\t\t\thorizontalScrollbarHeight,\n\t\t\tverticalScrollbarWidth\n\t\t} = useScrollbarInfo<HTMLDivElement>();\n\n\t\tconst hasFocusableDescendant = useHasFocusableDescendant(scrollableContainerRef);\n\n\t\tReact.useImperativeHandle<HTMLDivElement | null, HTMLDivElement | null>(ref, () => {\n\t\t\treturn panelRef.current;\n\t\t});\n\n\t\tconst handleKeyDown = React.useCallback(\n\t\t\t(e: React.KeyboardEvent<HTMLDivElement>) => {\n\t\t\t\tif (e.key === 'Escape' && typeof onClose === 'function') {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\thandleClose();\n\t\t\t\t}\n\t\t\t},\n\t\t\t[onClose, handleClose]\n\t\t);\n\n\t\tconst panelClasses = classnames(styles['MrlPanel'], 'MrlPanel', className);\n\n\t\treturn (\n\t\t\t<MrlPanelContext.Provider\n\t\t\t\tvalue={{\n\t\t\t\t\thasHorizontalScrollbar,\n\t\t\t\t\thasVerticalScrollbar,\n\t\t\t\t\thorizontalScrollbarHeight,\n\t\t\t\t\tverticalScrollbarWidth\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */}\n\t\t\t\t<div\n\t\t\t\t\t{...rest}\n\t\t\t\t\tclassName={panelClasses}\n\t\t\t\t\taria-describedby={descriptionIdRef.current || props['aria-describedby']}\n\t\t\t\t\taria-label={title || props['aria-label']}\n\t\t\t\t\taria-modal=\"false\"\n\t\t\t\t\tdata-qa={qa}\n\t\t\t\t\tid={id}\n\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\trole=\"dialog\"\n\t\t\t\t\tref={panelRef}\n\t\t\t\t>\n\t\t\t\t\t<MrlFocusTrap containerRef={panelRef} disableAutofocus={disableAutofocus}>\n\t\t\t\t\t\t<header className={classnames(styles['MrlPanel--header'], 'MrlPanel--header')}>\n\t\t\t\t\t\t\t{!header && (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tclassName={classnames(\n\t\t\t\t\t\t\t\t\t\tstyles['MrlPanel--header-content'],\n\t\t\t\t\t\t\t\t\t\t'MrlPanel--header-content',\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t[styles['MrlPanel--header-content-description']]: !!description\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<MrlTextHeading\n\t\t\t\t\t\t\t\t\t\tclassName={styles['MrlPanel--title']}\n\t\t\t\t\t\t\t\t\t\tattrs={{\n\t\t\t\t\t\t\t\t\t\t\t'data-qa': `${qa}-header-title`,\n\t\t\t\t\t\t\t\t\t\t\tid\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\thierarchy=\"primary\"\n\t\t\t\t\t\t\t\t\t\tkind=\"title\"\n\t\t\t\t\t\t\t\t\t\tlevel=\"2\"\n\t\t\t\t\t\t\t\t\t\tsize=\"medium\"\n\t\t\t\t\t\t\t\t\t\ttext={title}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t{topActions && (\n\t\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\t\tclassName={classnames(\n\t\t\t\t\t\t\t\t\t\t\t\t\tstyles['MrlPanel--top-actions'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t'MrlPanel--top-actions'\n\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t{topActions}\n\t\t\t\t\t\t\t\t\t\t\t\t<MrlDivider\n\t\t\t\t\t\t\t\t\t\t\t\t\torientation=\"vertical\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tspacing=\"small\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tlength=\"var(--mrl-spacing-06)\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassName={classnames(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tstyles['MrlPanel--top-actions-divider'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'MrlPanel--top-actions-divider'\n\t\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{header}\n\t\t\t\t\t\t\t<MrlIconButton\n\t\t\t\t\t\t\t\tdata-qa={`${qa}-close-button`}\n\t\t\t\t\t\t\t\twrapperClassName={classnames(styles['MrlPanel--close'], 'MrlPanel--close')}\n\t\t\t\t\t\t\t\ticon={<MrlSvg svg={close} />}\n\t\t\t\t\t\t\t\tonClick={handleClose}\n\t\t\t\t\t\t\t\ttext=\"Close\"\n\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\tstate=\"default\"\n\t\t\t\t\t\t\t\tposition=\"bottom\"\n\t\t\t\t\t\t\t\ttipAnchor=\"center\"\n\t\t\t\t\t\t\t\tkind=\"ghost\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</header>\n\n\t\t\t\t\t\t{/*\n\t\t\t\t\t\t * Scrollable container — includes description, sticky header and main\n\t\t\t\t\t\t * content. Per ACT rule 0ssw9k a scrollable element passes WCAG 2.1.1\n\t\t\t\t\t\t * Keyboard if it is itself focusable OR has a focusable descendant. We\n\t\t\t\t\t\t * therefore expose `tabindex=\"0\"` only when the wrapper has no focusable\n\t\t\t\t\t\t * descendants, which avoids the \"meaningless tab stop\" finding for\n\t\t\t\t\t\t * panels filled with interactive controls while still making text-only\n\t\t\t\t\t\t * panels keyboard-scrollable. The labeled `role=\"region\"` is preserved\n\t\t\t\t\t\t * whenever the panel overflows so screen-reader users get a landmark.\n\t\t\t\t\t\t * https://www.w3.org/WAI/standards-guidelines/act/rules/0ssw9k/\n\t\t\t\t\t\t */}\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tref={scrollableContainerRef}\n\t\t\t\t\t\t\tdata-scroll-anchor={hasDataScrollAnchor}\n\t\t\t\t\t\t\tdata-qa={`${qa}-scrollable`}\n\t\t\t\t\t\t\tclassName={classnames(styles['MrlPanel--scrollable'], 'MrlPanel--scrollable', {\n\t\t\t\t\t\t\t\t[styles['MrlPanel--scrollable-has-sticky-header']]: hasStickyHeader\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t{...(verticalScrollbarWidth > 0 && {\n\t\t\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t\t\tpaddingRight: `calc(var(--mrl-spacing-06) - ${verticalScrollbarWidth}px)`\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t{...(hasVerticalScrollbar && {\n\t\t\t\t\t\t\t\t'aria-label': title\n\t\t\t\t\t\t\t\t\t? `${title} panel scrollable content`\n\t\t\t\t\t\t\t\t\t: 'Panel scrollable content',\n\t\t\t\t\t\t\t\trole: 'region',\n\t\t\t\t\t\t\t\t...(!hasFocusableDescendant && {\n\t\t\t\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex\n\t\t\t\t\t\t\t\t\ttabIndex: 0\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{description && (\n\t\t\t\t\t\t\t\t<MrlText\n\t\t\t\t\t\t\t\t\tattrs={{\n\t\t\t\t\t\t\t\t\t\tclassName: classnames(styles['MrlPanel--description'], 'MrlPanel--description'),\n\t\t\t\t\t\t\t\t\t\tid: descriptionIdRef.current\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\tsize=\"xsmall\"\n\t\t\t\t\t\t\t\t\ttext={description}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</MrlFocusTrap>\n\t\t\t\t</div>\n\t\t\t</MrlPanelContext.Provider>\n\t\t);\n\t}\n);\n"],"names":["MrlPanel","React","forwardRef","props","ref","className","title","id","children","hasStickyHeader","header","description","disableAutofocus","topActions","hasDataScrollAnchor","onClose","eventId","_props$dataQa","qa","rest","_objectWithoutProperties","_excluded","panelRef","useRef","trackInteraction","useMrlTrackInteraction","useEffect","action","handleClose","useCallback","descriptionIdRef","getUniqueId","_useScrollbarInfo","useScrollbarInfo","scrollableContainerRef","hasVerticalScrollbar","hasHorizontalScrollbar","horizontalScrollbarHeight","verticalScrollbarWidth","hasFocusableDescendant","useHasFocusableDescendant","useImperativeHandle","current","handleKeyDown","e","key","preventDefault","stopPropagation","panelClasses","classnames","styles","createElement","MrlPanelContext","Provider","value","_extends","onKeyDown","role","MrlFocusTrap","containerRef","MrlTextHeading","attrs","concat","hierarchy","kind","level","size","text","Fragment","MrlDivider","orientation","spacing","length","MrlIconButton","wrapperClassName","icon","MrlSvg","svg","close","onClick","state","position","tipAnchor","style","paddingRight","_objectSpread","tabIndex","MrlText"],"mappings":";;;;;;;;;;;;;;;;;;;;;;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;"}
|
|
@@ -37,7 +37,8 @@ var _excluded = ["children", "hasDivider", "className"];
|
|
|
37
37
|
*/
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
|
-
* MrlPanelFooter component.
|
|
40
|
+
* MrlPanelFooter component. Pins a short note, such as an attribution, to the bottom of an
|
|
41
|
+
* `MrlPanel`; render it as the panel's last child.
|
|
41
42
|
*
|
|
42
43
|
* @param props The MrlPanelFooter component properties.
|
|
43
44
|
* @returns The MrlPanelFooter component.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MrlPanelFooter.js","sources":["../../../../../src/components/panel/MrlPanelFooter/MrlPanelFooter.tsx"],"sourcesContent":["import * as React from 'react';\nimport classnames from 'classnames';\nimport styles from './MrlPanelFooter.module.scss';\nimport { MrlText } from '../../text';\nimport { MrlDivider } from '../../divider';\n\n/**\n * Props for the MrlPanelFooter component.\n */\ninterface MrlPanelFooterProps extends React.ComponentPropsWithRef<'footer'> {\n\t/**\n\t *
|
|
1
|
+
{"version":3,"file":"MrlPanelFooter.js","sources":["../../../../../src/components/panel/MrlPanelFooter/MrlPanelFooter.tsx"],"sourcesContent":["import * as React from 'react';\nimport classnames from 'classnames';\nimport styles from './MrlPanelFooter.module.scss';\nimport { MrlText } from '../../text';\nimport { MrlDivider } from '../../divider';\n\n/**\n * Props for the MrlPanelFooter component.\n */\ninterface MrlPanelFooterProps extends React.ComponentPropsWithRef<'footer'> {\n\t/**\n\t * Footer content, pinned to the bottom of the panel; render the footer as the last child of\n\t * `MrlPanel`. A string is rendered as extra-small text; pass elements for richer content such\n\t * as links.\n\t */\n\tchildren?: React.ReactNode;\n\n\t/**\n\t * Renders a divider above the footer content.\n\t */\n\thasDivider?: boolean;\n}\n\n/**\n * MrlPanelFooter component. Pins a short note, such as an attribution, to the bottom of an\n * `MrlPanel`; render it as the panel's last child.\n *\n * @param props The MrlPanelFooter component properties.\n * @returns The MrlPanelFooter component.\n */\nexport const MrlPanelFooter = React.forwardRef<HTMLElement, MrlPanelFooterProps>(\n\tfunction MrlPanelFooter({ children, hasDivider, className, ...rest }, ref): JSX.Element {\n\t\treturn (\n\t\t\t<footer\n\t\t\t\t{...rest}\n\t\t\t\tref={ref}\n\t\t\t\tclassName={classnames(styles['MrlPanelFooter'], 'MrlPanelFooter', className)}\n\t\t\t>\n\t\t\t\t{hasDivider && (\n\t\t\t\t\t<MrlDivider\n\t\t\t\t\t\tspacing=\"small\"\n\t\t\t\t\t\tclassName={classnames(styles['MrlPanelFooter--divider'], 'MrlPanelFooter--divider')}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t{typeof children === 'string' && <MrlText size=\"xsmall\" text={children} />}\n\t\t\t\t{typeof children === 'object' && children}\n\t\t\t</footer>\n\t\t);\n\t}\n);\n"],"names":["MrlPanelFooter","React","forwardRef","_ref","ref","children","hasDivider","className","rest","_objectWithoutProperties","_excluded","createElement","_extends","classnames","styles","MrlDivider","spacing","MrlText","size","text"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA;AACA;AACA;;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMA,cAAc,gBAAGC,gBAAK,CAACC,UAAU,CAC7C,SAASF,cAAcA,CAAAG,IAAA,EAA+CC,GAAG,EAAe;AAAA,EAAA,IAA9DC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IAAEC,UAAU,GAAAH,IAAA,CAAVG,UAAU;IAAEC,SAAS,GAAAJ,IAAA,CAATI,SAAS;AAAKC,IAAAA,IAAI,GAAAC,iDAAA,CAAAN,IAAA,EAAAO,SAAA,CAAA;AACjE,EAAA,oBACCT,gBAAA,CAAAU,aAAA,CAAA,QAAA,EAAAC,iCAAA,KACKJ,IAAI,EAAA;AACRJ,IAAAA,GAAG,EAAEA,GAAI;IACTG,SAAS,EAAEM,2BAAU,CAACC,6BAAM,CAAC,gBAAgB,CAAC,EAAE,gBAAgB,EAAEP,SAAS;AAAE,GAAA,CAAA,EAE5ED,UAAU,iBACVL,gBAAA,CAAAU,aAAA,CAACI,qBAAU,EAAA;AACVC,IAAAA,OAAO,EAAC,OAAO;IACfT,SAAS,EAAEM,2BAAU,CAACC,6BAAM,CAAC,yBAAyB,CAAC,EAAE,yBAAyB;GAClF,CACD,EACA,OAAOT,QAAQ,KAAK,QAAQ,iBAAIJ,gBAAA,CAAAU,aAAA,CAACM,eAAO,EAAA;AAACC,IAAAA,IAAI,EAAC,QAAQ;AAACC,IAAAA,IAAI,EAAEd;GAAW,CAAC,EACzE,OAAOA,QAAQ,KAAK,QAAQ,IAAIA,QAC1B,CAAC;AAEX,CACD;;;;"}
|
|
@@ -35,7 +35,8 @@ var _excluded = ["children", "className"];
|
|
|
35
35
|
*/
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
|
-
* MrlPanelStickyHeader component.
|
|
38
|
+
* MrlPanelStickyHeader component. Keeps controls pinned to the top of an `MrlPanel` while its
|
|
39
|
+
* content scrolls. Render it as the panel's first child and set `hasStickyHeader` on the panel.
|
|
39
40
|
*
|
|
40
41
|
* @param props The MrlPanelStickyHeader component properties.
|
|
41
42
|
* @returns The MrlPanel component.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MrlPanelStickyHeader.js","sources":["../../../../../src/components/panel/MrlPanelStickyHeader/MrlPanelStickyHeader.tsx"],"sourcesContent":["import * as React from 'react';\nimport classnames from 'classnames';\nimport styles from './MrlPanelStickyHeader.module.scss';\n\n/**\n * Props for the MrlPanelStickyHeader component.\n */\ninterface MrlPanelStickyHeaderProps extends React.ComponentPropsWithRef<'div'> {\n\t/**\n\t *
|
|
1
|
+
{"version":3,"file":"MrlPanelStickyHeader.js","sources":["../../../../../src/components/panel/MrlPanelStickyHeader/MrlPanelStickyHeader.tsx"],"sourcesContent":["import * as React from 'react';\nimport classnames from 'classnames';\nimport styles from './MrlPanelStickyHeader.module.scss';\n\n/**\n * Props for the MrlPanelStickyHeader component.\n */\ninterface MrlPanelStickyHeaderProps extends React.ComponentPropsWithRef<'div'> {\n\t/**\n\t * Controls to keep pinned to the top of the panel while its content scrolls, such as a search\n\t * input and tabs.\n\t */\n\tchildren?: React.ReactNode;\n}\n\n/**\n * MrlPanelStickyHeader component. Keeps controls pinned to the top of an `MrlPanel` while its\n * content scrolls. Render it as the panel's first child and set `hasStickyHeader` on the panel.\n *\n * @param props The MrlPanelStickyHeader component properties.\n * @returns The MrlPanel component.\n */\nexport const MrlPanelStickyHeader = ({\n\tchildren,\n\tclassName,\n\t...rest\n}: MrlPanelStickyHeaderProps): JSX.Element => {\n\treturn (\n\t\t<div\n\t\t\t{...rest}\n\t\t\tclassName={classnames(styles['MrlPanelStickyHeader'], 'MrlPanelStickyHeader', className)}\n\t\t>\n\t\t\t{children}\n\t\t</div>\n\t);\n};\n"],"names":["MrlPanelStickyHeader","_ref","children","className","rest","_objectWithoutProperties","_excluded","React","createElement","_extends","classnames","styles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMA,oBAAoB,GAAGC,IAAA,IAIU;AAAA,EAAA,IAH7CC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IACRC,SAAS,GAAAF,IAAA,CAATE,SAAS;AACNC,IAAAA,IAAI,GAAAC,iDAAA,CAAAJ,IAAA,EAAAK,SAAA,CAAA;AAEP,EAAA,oBACCC,gBAAA,CAAAC,aAAA,CAAA,KAAA,EAAAC,iCAAA,KACKL,IAAI,EAAA;IACRD,SAAS,EAAEO,2BAAU,CAACC,mCAAM,CAAC,sBAAsB,CAAC,EAAE,sBAAsB,EAAER,SAAS;AAAE,GAAA,CAAA,EAExFD,QACG,CAAC;AAER;;;;"}
|
package/dist/cjs/version.js
CHANGED
package/dist/cjs/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sources":["../../src/version.ts"],"sourcesContent":["export const TOOLKIT_VERSION = \"4.77.
|
|
1
|
+
{"version":3,"file":"version.js","sources":["../../src/version.ts"],"sourcesContent":["export const TOOLKIT_VERSION = \"4.77.1\";"],"names":["TOOLKIT_VERSION"],"mappings":";;AAAO,IAAMA,eAAe,GAAG;;;;"}
|
|
@@ -106,5 +106,11 @@ export interface MrlButtonProps extends Omit<MrlComponentProps, 'style'>, React.
|
|
|
106
106
|
* informs the component that this is a toggle button and to add that functionality
|
|
107
107
|
*/
|
|
108
108
|
toggleStyle?: ToggleStyle;
|
|
109
|
+
/**
|
|
110
|
+
* Controlled state that overrides the internal state management.
|
|
111
|
+
* When provided, this takes precedence over the `state` prop and allows
|
|
112
|
+
* the parent component to fully control the button's state.
|
|
113
|
+
*/
|
|
114
|
+
controlledState?: MrlButtonState;
|
|
109
115
|
}
|
|
110
116
|
export declare const MrlButton: React.ForwardRefExoticComponent<Omit<MrlButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -2,7 +2,8 @@ import * as React from 'react';
|
|
|
2
2
|
import { DataQa } from '../../../utils/dataQa';
|
|
3
3
|
export type MrlFilterItemProps = {
|
|
4
4
|
/**
|
|
5
|
-
* The filter item's value
|
|
5
|
+
* The filter item's value, reported to `MrlFilter` when the item is selected by click or by
|
|
6
|
+
* arrow-key focus. The item is checked while it equals the filter's selected value.
|
|
6
7
|
*/
|
|
7
8
|
value: string;
|
|
8
9
|
/**
|
|
@@ -10,7 +11,8 @@ export type MrlFilterItemProps = {
|
|
|
10
11
|
*/
|
|
11
12
|
children?: React.ReactNode;
|
|
12
13
|
/**
|
|
13
|
-
* The count of items for this filter option
|
|
14
|
+
* The count of items for this filter option, shown as a badge and announced as ", N items"
|
|
15
|
+
* after the label.
|
|
14
16
|
*/
|
|
15
17
|
count?: number;
|
|
16
18
|
/**
|
|
@@ -22,7 +24,8 @@ export type MrlFilterItemProps = {
|
|
|
22
24
|
eventId?: string;
|
|
23
25
|
} & React.ComponentPropsWithoutRef<'span'> & DataQa;
|
|
24
26
|
/**
|
|
25
|
-
* MrlFilterItem component.
|
|
27
|
+
* MrlFilterItem component. One option of an `MrlFilter`, rendered as a `radio` of the filter's
|
|
28
|
+
* radio group; must be rendered inside `MrlFilter`.
|
|
26
29
|
*
|
|
27
30
|
* @param props - The component props.
|
|
28
31
|
* @returns The MrlFilterItem component.
|
|
@@ -2,11 +2,19 @@ import { AttrsObject } from '../../../../utils';
|
|
|
2
2
|
import { CheckboxSelected, CheckboxStates } from '../../constants';
|
|
3
3
|
import './MrlCheckboxStandalone.global.scss';
|
|
4
4
|
interface MrlCheckboxStandaloneProps {
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* Applies additional HTML attributes to the checkbox element. The component renders no label,
|
|
7
|
+
* so label it here: an `id` referenced by a `<label htmlFor>`, or `aria-labelledby` pointing
|
|
8
|
+
* to visible text (a console warning is logged when both are missing). Pass the `onChange`
|
|
9
|
+
* handler here as well.
|
|
10
|
+
*/
|
|
6
11
|
attrs?: AttrsObject;
|
|
7
12
|
/** The current state of the checkbox input based on user interactions or permissions */
|
|
8
13
|
state?: CheckboxStates;
|
|
9
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* Sets what selection state the checkbox is in. The component is controlled: update it from
|
|
16
|
+
* the `onChange` handler passed in `attrs`.
|
|
17
|
+
*/
|
|
10
18
|
selected?: CheckboxSelected;
|
|
11
19
|
/**
|
|
12
20
|
* Enables interaction tracking for this checkbox. Provide a stable, non-PII id
|
|
@@ -2,7 +2,11 @@ import * as React from 'react';
|
|
|
2
2
|
import { AttrsObject } from '../../../../utils';
|
|
3
3
|
import { LabelKind, LabelStates, StaticIconConfig } from '../../constants';
|
|
4
4
|
interface MrlLabelProps extends React.HTMLAttributes<HTMLLabelElement> {
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* Applies additional HTML attributes to the label element
|
|
7
|
+
*
|
|
8
|
+
* @deprecated - use the regular HTML attributes instead.
|
|
9
|
+
*/
|
|
6
10
|
attrs?: AttrsObject;
|
|
7
11
|
/** Informs the user of the form element's purpose */
|
|
8
12
|
text: string;
|
|
@@ -32,6 +32,8 @@ export interface MrlLegacySelectProptypes extends React.HTMLAttributes<HTMLDivEl
|
|
|
32
32
|
* When using in a framework wrapper (e.g., React), treat it as an object and don't stringify.
|
|
33
33
|
* Otherwise, the value object needs to be stringified to not receive `"[Object object]"`.
|
|
34
34
|
* Example: `attrs='{ "tabindex": "1" }'`
|
|
35
|
+
*
|
|
36
|
+
* @deprecated - use the regular HTML attributes instead.
|
|
35
37
|
*/
|
|
36
38
|
attrs?: AttrsObject;
|
|
37
39
|
/**
|
|
@@ -6,7 +6,11 @@ import { RightActionConfig, InputStates } from '../../constants';
|
|
|
6
6
|
* @todo - we need to add static icon support for right
|
|
7
7
|
*/
|
|
8
8
|
interface MrlTextInputProps extends Omit<MrlComponentProps, 'style'>, React.ComponentProps<'input'> {
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Applies additional HTML attributes to the text input element
|
|
11
|
+
*
|
|
12
|
+
* @deprecated - use the regular HTML attributes instead. `data-maxlength` is still read from `attrs` only.
|
|
13
|
+
*/
|
|
10
14
|
attrs?: AttrsObject;
|
|
11
15
|
/** Additional function to be run when the input's value is cleared */
|
|
12
16
|
hookClear?: () => void;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { LayoutComponent } from '../../layout/constants';
|
|
2
|
+
import { GridColumns } from '../constants';
|
|
3
|
+
type MrlCol = LayoutComponent & GridColumns;
|
|
3
4
|
/**
|
|
4
|
-
* MrlCol React component.
|
|
5
|
+
* MrlCol React component.
|
|
5
6
|
* @param props - component props
|
|
6
7
|
* @returns a MrlCol React component.
|
|
7
8
|
*/
|
|
8
|
-
export declare function MrlCol(
|
|
9
|
+
export declare function MrlCol(props: MrlCol): JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { MrlCol } from './MrlCol';
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LayoutComponent } from '../../layout/constants';
|
|
2
2
|
import '../grid.variables.scss';
|
|
3
3
|
import '../grid.global.scss';
|
|
4
|
-
export type MrlGridProps = GridBaseProps;
|
|
5
4
|
/**
|
|
6
|
-
*
|
|
5
|
+
* MrlCol React component.
|
|
7
6
|
* @param props - component props
|
|
8
|
-
* @returns a
|
|
7
|
+
* @returns a MrlCol React component.
|
|
9
8
|
*/
|
|
10
|
-
export declare function MrlGrid({ children, className, ...rest }:
|
|
9
|
+
export declare function MrlGrid({ children, className, ...rest }: LayoutComponent): JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { MrlGrid } from './MrlGrid';
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { LayoutComponent } from '../../layout/constants';
|
|
2
|
+
import { AlignOptions, GutterSizes, JustifyOptions } from '../constants';
|
|
3
|
+
interface MrlRow extends LayoutComponent {
|
|
3
4
|
/**
|
|
4
5
|
* Flex alignment of the children within the component.
|
|
5
6
|
*/
|
|
6
7
|
align?: AlignOptions;
|
|
7
8
|
/**
|
|
8
|
-
* Gutter size for columns within the row
|
|
9
|
-
*
|
|
10
|
-
* @default 1
|
|
9
|
+
* Gutter size for columns within the row
|
|
11
10
|
*/
|
|
12
11
|
gutter?: GutterSizes;
|
|
13
12
|
/**
|
|
@@ -16,8 +15,9 @@ export interface MrlRowProps extends GridBaseProps {
|
|
|
16
15
|
justify?: JustifyOptions;
|
|
17
16
|
}
|
|
18
17
|
/**
|
|
19
|
-
* MrlRow React component.
|
|
18
|
+
* MrlRow React component.
|
|
20
19
|
* @param props - component props
|
|
21
20
|
* @returns a MrlRow React component.
|
|
22
21
|
*/
|
|
23
|
-
export declare function MrlRow({ align, children, className,
|
|
22
|
+
export declare function MrlRow({ align, children, className, justify, ...rest }: MrlRow): JSX.Element;
|
|
23
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { MrlRow } from './MrlRow';
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
import { DataQa } from '../../utils/dataQa';
|
|
2
1
|
/**
|
|
3
2
|
* Alignment & justification options for grid containers
|
|
4
3
|
*/
|
|
5
4
|
export type AlignOptions = 'start' | 'center' | 'end';
|
|
6
5
|
export type JustifyOptions = 'start' | 'center' | 'end' | 'between' | 'around';
|
|
6
|
+
/**
|
|
7
|
+
* Available grid sizes
|
|
8
|
+
*/
|
|
9
|
+
export declare const GridSizes: string[];
|
|
7
10
|
/**
|
|
8
11
|
* Number of columns that will be span on the grid.
|
|
9
12
|
*/
|
|
10
13
|
export type NumCols = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
11
14
|
/**
|
|
12
|
-
* The
|
|
15
|
+
* The type of classes that can be configured based on the bootstrap API.
|
|
13
16
|
* Current supported:
|
|
14
17
|
* - columns "col-<size>-<number>"
|
|
15
|
-
* - offsets "offset-<size>-<number>"
|
|
18
|
+
* - offsets "offset-<size>-<number>""
|
|
16
19
|
*/
|
|
17
20
|
type GridClass = 'col' | 'offset';
|
|
18
21
|
/**
|
|
@@ -40,25 +43,8 @@ export interface GridColumns {
|
|
|
40
43
|
xl?: ColumnConfig;
|
|
41
44
|
xxl?: ColumnConfig;
|
|
42
45
|
}
|
|
43
|
-
/**
|
|
44
|
-
* Breakpoint keys in ascending order. Drives both class generation and the
|
|
45
|
-
* filtering that keeps grid props from reaching the DOM.
|
|
46
|
-
*/
|
|
47
|
-
export declare const GRID_SIZE_KEYS: readonly ["col", "xs", "sm", "md", "lg", "xl", "xxl"];
|
|
48
46
|
/**
|
|
49
47
|
* Available gutter sizes for customizing the grid
|
|
50
48
|
*/
|
|
51
49
|
export type GutterSizes = 0 | 1 | 2;
|
|
52
|
-
/**
|
|
53
|
-
* Gutter size to modifier class. `1` is the default gutter declared on `:root`,
|
|
54
|
-
* so it needs no class.
|
|
55
|
-
*/
|
|
56
|
-
export declare const GUTTER_CLASS: Record<GutterSizes, string | undefined>;
|
|
57
|
-
/**
|
|
58
|
-
* Shared props for the grid components. `role` is intentionally omitted: these
|
|
59
|
-
* are generic layout wrappers, and a `role="grid"` would promise interactive
|
|
60
|
-
* grid keyboard semantics that they do not implement. Page landmarks belong to
|
|
61
|
-
* the layout components (MrlMain, MrlPage).
|
|
62
|
-
*/
|
|
63
|
-
export type GridBaseProps = Omit<React.ComponentPropsWithoutRef<'div'>, 'role'> & DataQa;
|
|
64
50
|
export {};
|
|
@@ -35,6 +35,8 @@ export interface MrlLinkProptypes extends React.ComponentProps<'a'> {
|
|
|
35
35
|
/**
|
|
36
36
|
* Applies additional HTML attributes to the nested anchor (`a`) element.
|
|
37
37
|
* Example: `attrs='{ "aria-label": "Special message for screen reader users" }'`
|
|
38
|
+
*
|
|
39
|
+
* @deprecated - use the regular HTML attributes instead.
|
|
38
40
|
*/
|
|
39
41
|
attrs?: AttrsObject;
|
|
40
42
|
/**
|
|
@@ -75,12 +75,18 @@ export interface MrlMenuProps {
|
|
|
75
75
|
*/
|
|
76
76
|
position?: MenuPosition;
|
|
77
77
|
/**
|
|
78
|
-
*
|
|
78
|
+
* Opens or closes the menu from outside. Not just an initial value: whenever
|
|
79
|
+
* `isOpen` or `actionType` changes, the menu syncs its internal state to it.
|
|
80
|
+
* The menu can still close itself (item select, click outside, Escape, Tab),
|
|
81
|
+
* so pair this with `onClose` to reset your state. Prefer `triggerRef` when
|
|
82
|
+
* there is a trigger element. Ignored for submenus and `position="static"`.
|
|
79
83
|
* @default { actionType: null, isOpen: false }
|
|
80
84
|
*/
|
|
81
85
|
actionState?: ActionState;
|
|
82
86
|
/**
|
|
83
|
-
* Reference to the DOM element that triggers this menu.
|
|
87
|
+
* Reference to the DOM element that triggers this menu. This alone wires up
|
|
88
|
+
* click and keyboard open/close and the trigger's ARIA attributes; no
|
|
89
|
+
* `actionState` or `onClick` toggle is needed.
|
|
84
90
|
*/
|
|
85
91
|
triggerRef?: React.RefObject<HTMLButtonElement>;
|
|
86
92
|
/**
|
|
@@ -101,7 +107,8 @@ export interface MrlMenuProps {
|
|
|
101
107
|
*/
|
|
102
108
|
alignment?: MenuAlignment;
|
|
103
109
|
/**
|
|
104
|
-
*
|
|
110
|
+
* Called when the menu closes itself: item select, click outside, Escape, Tab,
|
|
111
|
+
* or scroll with `closeOnScroll`. Not called when a trigger click toggles it closed.
|
|
105
112
|
* @param type - type of close event
|
|
106
113
|
*/
|
|
107
114
|
onClose?: (type?: string) => void;
|
|
@@ -1,11 +1,25 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export interface MrlMenuGroupPropTypes {
|
|
3
|
+
/**
|
|
4
|
+
* The `MrlMenuItem`s (or `MrlMenuItemLink`s) that belong to the group. They stay part of the
|
|
5
|
+
* parent menu's keyboard navigation and close the menu exactly as ungrouped items do.
|
|
6
|
+
*/
|
|
3
7
|
children: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Renders a divider after the group's items. Set it to `false` on the last group so the menu
|
|
10
|
+
* does not end with a divider.
|
|
11
|
+
*
|
|
12
|
+
* @default true
|
|
13
|
+
*/
|
|
4
14
|
divider?: boolean;
|
|
15
|
+
/** Visible heading rendered above the group's items. Omit it to separate items with the divider only */
|
|
5
16
|
groupLabel?: string;
|
|
6
17
|
}
|
|
7
18
|
/**
|
|
8
|
-
* MrlMenuGroup
|
|
19
|
+
* MrlMenuGroup component
|
|
20
|
+
*
|
|
21
|
+
* Groups related menu items within an MrlMenu, with an optional label and a trailing divider.
|
|
22
|
+
* Must be a direct child of `MrlMenu`.
|
|
9
23
|
* @param props - component properties
|
|
10
24
|
* @returns JSX.Element
|
|
11
25
|
*/
|
|
@@ -7,18 +7,23 @@ export interface MrlMenuItemProps {
|
|
|
7
7
|
/** Indicates whether the menu item has a popup menu using aria-haspopup attribute */
|
|
8
8
|
ariaHasPopup?: AriaHasPopup;
|
|
9
9
|
/**
|
|
10
|
-
|
|
10
|
+
* Label of the item. Nesting an `MrlMenu` or `MrlPopover` here turns the item into a
|
|
11
|
+
* submenu trigger: it gets `aria-haspopup="menu"` and a trailing chevron, opens the submenu
|
|
12
|
+
* on hover, `ArrowRight`, `Enter` or `Space`, and does not close its own menu when activated.
|
|
11
13
|
*/
|
|
12
14
|
children: React.ReactNode | string;
|
|
13
15
|
/** Classname for the menu item */
|
|
14
16
|
className?: string;
|
|
15
|
-
/**
|
|
17
|
+
/** Disables the item: it stays focusable (`aria-disabled`) but ignores clicks and key presses */
|
|
16
18
|
disabled?: boolean;
|
|
17
19
|
/** Icon for menu item */
|
|
18
20
|
icon?: DSIconType;
|
|
19
21
|
/** Unique ID for the menu item */
|
|
20
22
|
id?: string;
|
|
21
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* Called on click, `Enter` or `Space`. The menu then closes, unless the item wraps a submenu
|
|
25
|
+
* or is a `menuitemcheckbox`/`menuitemradio` toggled with `Space`.
|
|
26
|
+
*/
|
|
22
27
|
onClick?: (e?: React.MouseEvent<HTMLButtonElement>) => void;
|
|
23
28
|
/** Callback to be called when the menu item is hovered */
|
|
24
29
|
onMouseOver?: (e?: React.MouseEvent) => void;
|
|
@@ -30,14 +35,16 @@ export interface MrlMenuItemProps {
|
|
|
30
35
|
* Role for the menu item
|
|
31
36
|
*
|
|
32
37
|
* When using `menuitemcheckbox` or `menuitemradio`, the menu item will be treated as a selectable item,
|
|
33
|
-
* aria-checked will be set to 'true' or 'false' based on the selected state.
|
|
38
|
+
* aria-checked will be set to 'true' or 'false' based on the selected state. `Space` toggles
|
|
39
|
+
* such an item and keeps the menu open; `Enter` or a click toggles it and closes the menu.
|
|
40
|
+
* The consumer owns `selected`.
|
|
34
41
|
*
|
|
35
42
|
* @default 'menuitem' - for regular menu items
|
|
36
43
|
* @example 'menuitemcheckbox' - for checkbox menu items
|
|
37
44
|
* @example 'menuitemradio' - for radio menu items
|
|
38
45
|
*/
|
|
39
46
|
role?: MenuItemRole;
|
|
40
|
-
/**
|
|
47
|
+
/** Marks the item as selected: shows a trailing check and, for checkbox/radio roles, sets `aria-checked` */
|
|
41
48
|
selected?: boolean;
|
|
42
49
|
/**
|
|
43
50
|
* Enables interaction tracking for this menu item. Provide a stable, non-PII id
|
|
@@ -48,7 +55,8 @@ export interface MrlMenuItemProps {
|
|
|
48
55
|
/**
|
|
49
56
|
* MrlMenuItem component
|
|
50
57
|
*
|
|
51
|
-
* Renders a menu
|
|
58
|
+
* Renders one actionable row of a menu: an `li` wrapping a `button` with the given `role`.
|
|
59
|
+
* Must be a child of `MrlMenu` or `MrlMenuGroup`.
|
|
52
60
|
* @param {MrlMenuItemProps} props - The props for the MrlMenuItem component
|
|
53
61
|
* @returns {Element} - rendered MrlMenuItem component
|
|
54
62
|
*/
|
|
@@ -9,13 +9,18 @@ export interface MrlMenuItemLinkProps {
|
|
|
9
9
|
children: React.ReactNode | string;
|
|
10
10
|
/** Class names for the menu item */
|
|
11
11
|
className?: string;
|
|
12
|
-
/**
|
|
12
|
+
/** Disables the link: it stays focusable (`aria-disabled`) but does not navigate */
|
|
13
13
|
disabled?: boolean;
|
|
14
14
|
/** Href for the menu item */
|
|
15
15
|
href: string;
|
|
16
16
|
/** Icon for menu item */
|
|
17
17
|
icon?: DSIconType;
|
|
18
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* Anchor target. `_blank` marks the link as external: `rel` becomes `noopener noreferrer`
|
|
20
|
+
* and a trailing external-link icon is shown.
|
|
21
|
+
*
|
|
22
|
+
* @default '_self'
|
|
23
|
+
*/
|
|
19
24
|
target?: string;
|
|
20
25
|
/** Unique ID for the menu item */
|
|
21
26
|
id?: string;
|
|
@@ -25,7 +30,7 @@ export interface MrlMenuItemLinkProps {
|
|
|
25
30
|
dataQa?: string;
|
|
26
31
|
/** If the menu item is selected */
|
|
27
32
|
selected?: boolean;
|
|
28
|
-
/** Rel
|
|
33
|
+
/** Rel attribute of the anchor; replaced by `noopener noreferrer` when `target` is `_blank` */
|
|
29
34
|
rel?: string;
|
|
30
35
|
/**
|
|
31
36
|
* Enables interaction tracking for this menu item. Provide a stable, non-PII id
|
|
@@ -34,10 +39,14 @@ export interface MrlMenuItemLinkProps {
|
|
|
34
39
|
eventId?: string;
|
|
35
40
|
}
|
|
36
41
|
/**
|
|
37
|
-
*
|
|
42
|
+
* MrlMenuItemLink component
|
|
38
43
|
*
|
|
39
|
-
* Renders a menu item to
|
|
40
|
-
*
|
|
41
|
-
*
|
|
44
|
+
* Renders a menu item that navigates to a URL (an anchor with `role="menuitem"`), to be used
|
|
45
|
+
* within the MrlMenu component. Links opened with `target="_blank"` get
|
|
46
|
+
* `rel="noopener noreferrer"` and a trailing external-link icon.
|
|
47
|
+
* Unlike `MrlMenuItem`, it does not close the menu on activation; close it from `onClick`
|
|
48
|
+
* when the navigation keeps the page alive (same-page `#hash` links, `target="_blank"`).
|
|
49
|
+
* @param {MrlMenuItemLinkProps} props - The props for the MrlMenuItemLink component
|
|
50
|
+
* @returns {Element} - rendered MrlMenuItemLink component
|
|
42
51
|
*/
|
|
43
52
|
export declare function MrlMenuItemLink({ ariaDescribedBy, children, className, dataQa, disabled, href, icon, id, onClick, selected, target, eventId, ...rest }: MrlMenuItemLinkProps): JSX.Element;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
interface MrlModalContentProps {
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Body of the modal, rendered between `MrlModalHeader` and `MrlModalFooter`. When it
|
|
5
|
+
* overflows, this is the modal's only scrolling area: it is exposed as a `region` labelled
|
|
6
|
+
* from the header text, and is focusable (`tabindex="0"`) only when it contains no focusable
|
|
7
|
+
* elements, so keyboard users can still scroll it.
|
|
5
8
|
*/
|
|
6
9
|
children: React.ReactElement | React.ReactElement[];
|
|
7
10
|
/**
|
|
@@ -10,7 +13,7 @@ interface MrlModalContentProps {
|
|
|
10
13
|
className?: string;
|
|
11
14
|
}
|
|
12
15
|
/**
|
|
13
|
-
* Modal Content component for the MrlModal
|
|
16
|
+
* Modal Content component for the MrlModal. Must be rendered inside `MrlModal`.
|
|
14
17
|
* @param {object} props - The props object
|
|
15
18
|
* @param {React.ReactElement} props.children - The children to be rendered within the component
|
|
16
19
|
* @returns {React.ReactElement}} The rendered MrlModalContent component
|
|
@@ -3,7 +3,8 @@ import { MrlComponentProps } from '../../../utils';
|
|
|
3
3
|
import './MrlModalFooter.global.scss';
|
|
4
4
|
interface MrlModalFooterProps extends MrlComponentProps {
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Actions of the modal, laid out in a row and stacked at full width on the `xs` breakpoint.
|
|
7
|
+
* Order them from least to most prominent, ending with the primary action.
|
|
7
8
|
*/
|
|
8
9
|
children?: React.ReactElement | React.ReactElement[];
|
|
9
10
|
/**
|
|
@@ -12,7 +13,8 @@ interface MrlModalFooterProps extends MrlComponentProps {
|
|
|
12
13
|
className?: string;
|
|
13
14
|
}
|
|
14
15
|
/**
|
|
15
|
-
* Modal Footer component for the MrlModal
|
|
16
|
+
* Modal Footer component for the MrlModal. Must be rendered inside `MrlModal`, after
|
|
17
|
+
* `MrlModalContent`.
|
|
16
18
|
* @param {AttrsObject} attrs - Additional HTML attributes for the `mrl-modal` element
|
|
17
19
|
* @returns {React.ReactElement} The rendered MrlModalFooter component
|
|
18
20
|
*/
|