@muraldevkit/ui-toolkit 4.76.1 → 4.77.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/dist/cjs/components/button/MrlButton/MrlButton.js +16 -8
- package/dist/cjs/components/button/MrlButton/MrlButton.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/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/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/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/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/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/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":"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,KAAK,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,wBAAA,CAAAN,IAAA,EAAAO,SAAA,CAAA;AACjE,EAAA,oBACCT,KAAA,CAAAU,aAAA,CAAA,QAAA,EAAAC,QAAA,KACKJ,IAAI,EAAA;AACRJ,IAAAA,GAAG,EAAEA,GAAI;IACTG,SAAS,EAAEM,UAAU,CAACC,MAAM,CAAC,gBAAgB,CAAC,EAAE,gBAAgB,EAAEP,SAAS;AAAE,GAAA,CAAA,EAE5ED,UAAU,iBACVL,KAAA,CAAAU,aAAA,CAACI,UAAU,EAAA;AACVC,IAAAA,OAAO,EAAC,OAAO;IACfT,SAAS,EAAEM,UAAU,CAACC,MAAM,CAAC,yBAAyB,CAAC,EAAE,yBAAyB;GAClF,CACD,EACA,OAAOT,QAAQ,KAAK,QAAQ,iBAAIJ,KAAA,CAAAU,aAAA,CAACM,OAAO,EAAA;AAACC,IAAAA,IAAI,EAAC,QAAQ;AAACC,IAAAA,IAAI,EAAEd;GAAW,CAAC,EACzE,OAAOA,QAAQ,KAAK,QAAQ,IAAIA,QAC1B,CAAC;AAEX,CACD;;;;"}
|
|
@@ -10,7 +10,8 @@ var _excluded = ["children", "className"];
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* MrlPanelStickyHeader component.
|
|
13
|
+
* MrlPanelStickyHeader component. Keeps controls pinned to the top of an `MrlPanel` while its
|
|
14
|
+
* content scrolls. Render it as the panel's first child and set `hasStickyHeader` on the panel.
|
|
14
15
|
*
|
|
15
16
|
* @param props The MrlPanelStickyHeader component properties.
|
|
16
17
|
* @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,wBAAA,CAAAJ,IAAA,EAAAK,SAAA,CAAA;AAEP,EAAA,oBACCC,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAAC,QAAA,KACKL,IAAI,EAAA;IACRD,SAAS,EAAEO,UAAU,CAACC,MAAM,CAAC,sBAAsB,CAAC,EAAE,sBAAsB,EAAER,SAAS;AAAE,GAAA,CAAA,EAExFD,QACG,CAAC;AAER;;;;"}
|
package/dist/esm/version.js
CHANGED
package/dist/esm/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sources":["../../src/version.ts"],"sourcesContent":["export const TOOLKIT_VERSION = \"4.
|
|
1
|
+
{"version":3,"file":"version.js","sources":["../../src/version.ts"],"sourcesContent":["export const TOOLKIT_VERSION = \"4.77.0\";"],"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.
|
package/dist/types/components/form/checkbox/MrlCheckboxStandalone/MrlCheckboxStandalone.d.ts
CHANGED
|
@@ -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
|
|
@@ -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
|
*/
|
|
@@ -2,7 +2,8 @@ import * as React from 'react';
|
|
|
2
2
|
import { MrlComponentProps } from '../../../utils';
|
|
3
3
|
export interface MrlModalHeaderProps extends MrlComponentProps {
|
|
4
4
|
/**
|
|
5
|
-
* Content
|
|
5
|
+
* Content rendered after the heading, inside the header row. The close button is not part of
|
|
6
|
+
* the header; `MrlModal` renders it.
|
|
6
7
|
*/
|
|
7
8
|
children?: React.ReactNode;
|
|
8
9
|
/**
|
|
@@ -10,12 +11,12 @@ export interface MrlModalHeaderProps extends MrlComponentProps {
|
|
|
10
11
|
*/
|
|
11
12
|
className?: string;
|
|
12
13
|
/**
|
|
13
|
-
* Text the
|
|
14
|
+
* Text of the modal header `h2` element. It also labels the modal's scrollable content region.
|
|
14
15
|
*/
|
|
15
16
|
text: string;
|
|
16
17
|
}
|
|
17
18
|
/**
|
|
18
|
-
* Modal Header component for the MrlModal.
|
|
19
|
+
* Modal Header component for the MrlModal. Must be rendered inside `MrlModal`.
|
|
19
20
|
* @param {MrlModalHeaderProps} props - The props for the MrlModalFooter component
|
|
20
21
|
* @param {AttrsObject} props.attrs - Additional HTML attributes for the `mrl-modal` element
|
|
21
22
|
* @returns {React.ReactElement} The rendered MrlModalFooter component
|
|
@@ -35,7 +35,8 @@ interface MrlPanelProps extends React.ComponentPropsWithRef<'div'> {
|
|
|
35
35
|
*/
|
|
36
36
|
disableAutofocus?: boolean;
|
|
37
37
|
/**
|
|
38
|
-
* Specifies whether the panel has a sticky header to adjust styles.
|
|
38
|
+
* Specifies whether the panel has a sticky header to adjust styles. Set it when the first child
|
|
39
|
+
* is an `MrlPanelStickyHeader`, so the scroll area leaves room for it.
|
|
39
40
|
*/
|
|
40
41
|
hasStickyHeader?: boolean;
|
|
41
42
|
/**
|
|
@@ -4,16 +4,19 @@ import * as React from 'react';
|
|
|
4
4
|
*/
|
|
5
5
|
interface MrlPanelFooterProps extends React.ComponentPropsWithRef<'footer'> {
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Footer content, pinned to the bottom of the panel; render the footer as the last child of
|
|
8
|
+
* `MrlPanel`. A string is rendered as extra-small text; pass elements for richer content such
|
|
9
|
+
* as links.
|
|
8
10
|
*/
|
|
9
11
|
children?: React.ReactNode;
|
|
10
12
|
/**
|
|
11
|
-
*
|
|
13
|
+
* Renders a divider above the footer content.
|
|
12
14
|
*/
|
|
13
15
|
hasDivider?: boolean;
|
|
14
16
|
}
|
|
15
17
|
/**
|
|
16
|
-
* MrlPanelFooter component.
|
|
18
|
+
* MrlPanelFooter component. Pins a short note, such as an attribution, to the bottom of an
|
|
19
|
+
* `MrlPanel`; render it as the panel's last child.
|
|
17
20
|
*
|
|
18
21
|
* @param props The MrlPanelFooter component properties.
|
|
19
22
|
* @returns The MrlPanelFooter component.
|
|
@@ -4,12 +4,14 @@ import * as React from 'react';
|
|
|
4
4
|
*/
|
|
5
5
|
interface MrlPanelStickyHeaderProps extends React.ComponentPropsWithRef<'div'> {
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Controls to keep pinned to the top of the panel while its content scrolls, such as a search
|
|
8
|
+
* input and tabs.
|
|
8
9
|
*/
|
|
9
10
|
children?: React.ReactNode;
|
|
10
11
|
}
|
|
11
12
|
/**
|
|
12
|
-
* MrlPanelStickyHeader component.
|
|
13
|
+
* MrlPanelStickyHeader component. Keeps controls pinned to the top of an `MrlPanel` while its
|
|
14
|
+
* content scrolls. Render it as the panel's first child and set `hasStickyHeader` on the panel.
|
|
13
15
|
*
|
|
14
16
|
* @param props The MrlPanelStickyHeader component properties.
|
|
15
17
|
* @returns The MrlPanel component.
|