@muraldevkit/ui-toolkit 4.84.0 → 4.85.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/avatar/MrlAvatar/MrlAvatar.js.map +1 -1
- package/dist/cjs/components/callout/MrlCallout/MrlCallout.js.map +1 -1
- package/dist/cjs/components/form/checkbox/MrlCheckbox/MrlCheckbox.js +13 -8
- package/dist/cjs/components/form/checkbox/MrlCheckbox/MrlCheckbox.js.map +1 -1
- package/dist/cjs/components/form/checkbox/MrlCheckboxStandalone/MrlCheckboxStandalone.js +16 -11
- package/dist/cjs/components/form/checkbox/MrlCheckboxStandalone/MrlCheckboxStandalone.js.map +1 -1
- package/dist/cjs/components/form/constants.js +6 -0
- package/dist/cjs/components/form/constants.js.map +1 -1
- package/dist/cjs/components/form/textarea/MrlTextarea/MrlTextarea.js.map +1 -1
- package/dist/cjs/components/grid/constants.js.map +1 -1
- package/dist/cjs/components/live-region/MrlLiveRegion/MrlLiveRegion.js.map +1 -1
- package/dist/cjs/components/popover/MrlPopover/MrlPopover.js.map +1 -1
- package/dist/cjs/components/portal/MrlPortal.js.map +1 -1
- package/dist/cjs/components/rovingTabindex/MrlRovingTabindex/MrlRovingTabindex.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/components/avatar/MrlAvatar/MrlAvatar.js.map +1 -1
- package/dist/esm/components/callout/MrlCallout/MrlCallout.js.map +1 -1
- package/dist/esm/components/form/checkbox/MrlCheckbox/MrlCheckbox.js +13 -8
- package/dist/esm/components/form/checkbox/MrlCheckbox/MrlCheckbox.js.map +1 -1
- package/dist/esm/components/form/checkbox/MrlCheckboxStandalone/MrlCheckboxStandalone.js +16 -11
- package/dist/esm/components/form/checkbox/MrlCheckboxStandalone/MrlCheckboxStandalone.js.map +1 -1
- package/dist/esm/components/form/constants.js +6 -0
- package/dist/esm/components/form/constants.js.map +1 -1
- package/dist/esm/components/form/textarea/MrlTextarea/MrlTextarea.js.map +1 -1
- package/dist/esm/components/grid/constants.js.map +1 -1
- package/dist/esm/components/live-region/MrlLiveRegion/MrlLiveRegion.js.map +1 -1
- package/dist/esm/components/popover/MrlPopover/MrlPopover.js.map +1 -1
- package/dist/esm/components/portal/MrlPortal.js.map +1 -1
- package/dist/esm/components/rovingTabindex/MrlRovingTabindex/MrlRovingTabindex.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/types/components/avatar/MrlAvatar/MrlAvatar.d.ts +2 -2
- package/dist/types/components/callout/MrlCallout/MrlCallout.d.ts +1 -2
- package/dist/types/components/form/checkbox/MrlCheckbox/MrlCheckbox.d.ts +11 -6
- package/dist/types/components/form/checkbox/MrlCheckboxStandalone/MrlCheckboxStandalone.d.ts +11 -9
- package/dist/types/components/form/constants.d.ts +6 -0
- package/dist/types/components/form/textarea/MrlTextarea/MrlTextarea.d.ts +1 -1
- package/dist/types/components/grid/constants.d.ts +2 -3
- package/dist/types/components/grid/index.d.ts +1 -1
- package/dist/types/components/live-region/MrlLiveRegion/MrlLiveRegion.d.ts +1 -2
- package/dist/types/components/live-region/MrlLiveRegion/index.d.ts +1 -1
- package/dist/types/components/popover/MrlPopover/MrlPopover.d.ts +1 -2
- package/dist/types/components/portal/MrlPortal.d.ts +1 -2
- package/dist/types/components/rovingTabindex/MrlRovingTabindex/MrlRovingTabindex.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MrlPortal.js","sources":["../../../../src/components/portal/MrlPortal.tsx"],"sourcesContent":["import * as React from 'react';\nimport { createPortal } from 'react-dom';\nimport { PORTAL_LAYERS } from '../../utils/layers';\n\
|
|
1
|
+
{"version":3,"file":"MrlPortal.js","sources":["../../../../src/components/portal/MrlPortal.tsx"],"sourcesContent":["import * as React from 'react';\nimport { createPortal } from 'react-dom';\nimport { PORTAL_LAYERS } from '../../utils/layers';\n\nexport type PortalLayer = (typeof PORTAL_LAYERS)[keyof typeof PORTAL_LAYERS];\nexport interface PortalProps extends React.HTMLAttributes<HTMLDivElement> {\n\tchildren: React.ReactNode;\n\tclassName?: string;\n\t['data-qa']?: string;\n\tid?: string;\n\t/** Stacking layer from `PORTAL_LAYERS`. Its name is used as the container id (over `id`) and its z-index is applied to the container's first child. Without it, the container is `id` or the root portal, with the root z-index. */\n\tlayer?: PortalLayer;\n}\n\nexport const MRL_PORTAL_ID = PORTAL_LAYERS.ROOT.name;\n\n/**\n * Dynamically creates a single portal and send your children to the portal.\n * Where they will live outside of the normal document flow\n *\n * @param PortalProps Portal only takes children. Contact the platform team if you need to extend this.\n * @returns MrlPortal component\n */\nexport const MrlPortal = ({\n\tchildren,\n\tclassName,\n\tid,\n\tlayer,\n\t...remainingProps\n}: PortalProps): React.ReactElement | null => {\n\tconst [portalElement, setPortalElement] = React.useState<HTMLElement | null>(null);\n\tconst element = 'div';\n\tconst portalId = layer?.name || id || MRL_PORTAL_ID;\n\tconst portalLayer = layer || PORTAL_LAYERS.ROOT;\n\n\tReact.useLayoutEffect(() => {\n\t\tlet portal = document.getElementById(portalId);\n\t\tconst dataQa = remainingProps['data-qa'] || id || PORTAL_LAYERS.ROOT.name;\n\n\t\t// create the portal on the fly and reuse the same one each time.\n\t\tif (!portal) {\n\t\t\tportal = document.createElement(element);\n\t\t\tportal.setAttribute('id', portalId);\n\t\t\tportal.setAttribute('data-qa', dataQa);\n\t\t\tportal.setAttribute('data-testid', dataQa);\n\t\t\tif (className) portal.setAttribute('class', className);\n\t\t\tdocument.body.appendChild(portal);\n\t\t}\n\n\t\tsetPortalElement(portal);\n\t}, [portalId, remainingProps, id, className]);\n\n\t/**\n\t * Sets z-index of the first child element of the portal to the layer's z-index\n\t *\n\t * TODO: update to also accept a 'layerId' that will override the default layer\n\t * with the provided layerId\n\t */\n\tif (!portalElement) return null;\n\n\tconst childrenArray = React.Children.toArray(children);\n\tif (childrenArray.length > 0 && portalElement) {\n\t\tconst firstChildElement = portalElement.firstElementChild as HTMLElement | null;\n\t\tif (firstChildElement) {\n\t\t\tfirstChildElement.style.zIndex = `${portalLayer.zIndex}`;\n\t\t}\n\t}\n\n\t// state will be null on the very first render.\n\tif (!portalElement) return null;\n\n\treturn createPortal(children, portalElement);\n};\n"],"names":["MRL_PORTAL_ID","PORTAL_LAYERS","ROOT","name","MrlPortal","_ref","children","className","id","layer","remainingProps","_objectWithoutProperties","_excluded","_React$useState","React","useState","_React$useState2","_slicedToArray","portalElement","setPortalElement","element","portalId","portalLayer","useLayoutEffect","portal","document","getElementById","dataQa","createElement","setAttribute","body","appendChild","childrenArray","Children","toArray","length","firstChildElement","firstElementChild","style","zIndex","concat","createPortal"],"mappings":";;;;;;IAcaA,aAAa,GAAGC,aAAa,CAACC,IAAI,CAACC;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMC,SAAS,GAAGC,IAAA,IAMqB;AAAA,EAAA,IAL7CC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IACRC,SAAS,GAAAF,IAAA,CAATE,SAAS;IACTC,EAAE,GAAAH,IAAA,CAAFG,EAAE;IACFC,KAAK,GAAAJ,IAAA,CAALI,KAAK;AACFC,IAAAA,cAAc,GAAAC,wBAAA,CAAAN,IAAA,EAAAO,SAAA,CAAA;AAEjB,EAAA,IAAAC,eAAA,GAA0CC,KAAK,CAACC,QAAQ,CAAqB,IAAI,CAAC;IAAAC,gBAAA,GAAAC,cAAA,CAAAJ,eAAA,EAAA,CAAA,CAAA;AAA3EK,IAAAA,aAAa,GAAAF,gBAAA,CAAA,CAAA,CAAA;AAAEG,IAAAA,gBAAgB,GAAAH,gBAAA,CAAA,CAAA,CAAA;EACtC,IAAMI,OAAO,GAAG,KAAK;AACrB,EAAA,IAAMC,QAAQ,GAAG,CAAAZ,KAAK,KAAA,IAAA,IAALA,KAAK,KAAA,MAAA,GAAA,MAAA,GAALA,KAAK,CAAEN,IAAI,KAAIK,EAAE,IAAIR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EAAA,CAAAC,MAAA,CAAMlB,WAAW,CAACiB,MAAM,CAAE;AACzD,IAAA;AACD,EAAA;;AAEA;AACA,EAAA,IAAI,CAACrB,aAAa,EAAE,OAAO,IAAI;AAE/B,EAAA,oBAAOuB,YAAY,CAACnC,QAAQ,EAAEY,aAAa,CAAC;AAC7C;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MrlRovingTabindex.js","sources":["../../../../../src/components/rovingTabindex/MrlRovingTabindex/MrlRovingTabindex.tsx"],"sourcesContent":["import * as React from 'react';\n\ntype RefType = HTMLElement | HTMLDivElement | null;\n\n/**\n * Gets tabbable elements in a given bit of the DOM, excluding disabled elements\n * @param {RefType} ref - the ref of the container\n * @param {string} selector - the selector to query (should already exclude disabled elements)\n * @returns {HTMLElement[]} - an array of tabbable HTML elements\n */\nexport const getTabbableElements = (ref: RefType, selector: string): HTMLElement[] => {\n\tconst elements = ref?.querySelectorAll(selector);\n\tif (!elements) return [];\n\treturn Array.prototype.slice.call(elements);\n};\n\nconst arraysEqual = (a: (Element | null)[], b: (Element | null)[]): boolean =>\n\ta.length === b.length && a.every((el, i) => el === b[i]);\n\nexport type FocusOnInitPosition = 'first' | 'last';\nexport interface RovingPropTypes {\n\t/** CSS selector of the element that starts as the tab stop, for example a checked custom radio. Falls back to `[data-roving-active]`, then to the first `[data-roving]` element. */\n\tactiveSelector?: string;\n\t/**\n\t * If true, disabled elements (with disabled attribute or aria-disabled=\"true\")\n\t * will be included in the roving tabindex. Defaults to true (disabled elements are included).\n\t */\n\tallowDisabled?: boolean;\n\tchildren: React.ReactNode;\n\t/**\n\t * delayMount is used to apply a delay to the mounting\n\t * of the RovingTabindex component. This can be helpful in\n\t * the event that a component's children have not been fully\n\t * rendered by the time the componentDidMount function is triggered\n\t */\n\tdelayMount?: number;\n\t/** Moves focus to the first or last element when the component mounts (after `delayMount`, if set). */\n\tfocusOnInit?: FocusOnInitPosition;\n\t/** Keeps every element out of the tab order until `isFocused` becomes true. For groups reached through a keyboard shortcut instead of Tab. */\n\tfocusWithShortcut?: boolean;\n\t/** Has no effect. Kept for backwards compatibility. */\n\tforceUpdate?: boolean;\n\t/** Set when another roving tabindex is nested inside this one, so its elements are left to the inner instance. */\n\thasChildRoving?: boolean;\n\t/** CSS selector. Keyboard navigation is ignored while focus is inside a matching element, for example a text input. */\n\tignoreElements?: string;\n\t/** With `focusWithShortcut`, whether the group holds focus. Turning it on focuses the active element; turning it off removes the group from the tab order. */\n\tisFocused?: boolean;\n\t/** Called when focus moves from the group to another element outside it. With `focusWithShortcut`, also called when `isFocused` turns off while focus is outside the group. */\n\tonBlur?: () => void;\n\t/** Pass it after moving focus into the group programmatically. On the next update the focused element becomes the tab stop and the callback receives `false`, so the consumer can drop it. */\n\tonRefocus?: (shouldRefocus: boolean) => void;\n\t/** Axis of the group, read once at mount. Every arrow key moves focus, but the keys across the axis are left to a focused element with `aria-haspopup=\"true\"` or role combobox, listbox or option. Defaults to horizontal. */\n\torientation?: RovingOrientation;\n\tqa?: string;\n}\n\ntype RovingOrientation = 'horizontal' | 'vertical';\ntype NavigationDirection = 'forward' | 'back';\n\n/**\n * Default value for allowDisabled prop.\n * When true, disabled elements are included in the roving tabindex navigation.\n */\nconst DEFAULT_ALLOW_DISABLED = true;\n\n/**\n * CSS selector to exclude disabled elements.\n * Excludes both native disabled attribute and ARIA-compliant disabled elements.\n */\nconst DISABLED_EXCLUSION = ':not([disabled]):not([aria-disabled=\"true\"])';\n\n/**\n * CSS selector suffix to exclude nested roving tabindex elements.\n * Prevents deeply nested elements from being included in parent roving tabindex.\n */\nconst NESTED_ROVING_EXCLUSION =\n\t':not(.helpers-roving-tabindex-container .helpers-roving-tabindex-container [data-roving])';\n\n/**\n * Builds the appropriate CSS selector based on configuration.\n * @param allowDisabled - Whether to include disabled elements in the roving tabindex\n * @param hasChildRoving - Whether nested roving tabindex containers should be excluded\n * @returns CSS selector string for querying roving elements\n */\nconst buildSelector = (allowDisabled: boolean, hasChildRoving: boolean): string => {\n\tconst disabledPart = allowDisabled ? '' : DISABLED_EXCLUSION;\n\tconst nestedPart = hasChildRoving ? NESTED_ROVING_EXCLUSION : '';\n\treturn `[data-roving]${disabledPart}${nestedPart}`;\n};\n\n/**\n * Component to create a Roving Tabindex in the DOM\n * @returns {HTMLDivElement}\n */\nclass MrlRovingTabindex extends React.Component<RovingPropTypes> {\n\telements: Array<Element | null>;\n\torientation: RovingOrientation;\n\tref!: HTMLDivElement | null;\n\tselector: string;\n\n\t/**\n\t * MrlRovingTabindex class constructor\n\t * @param props - the MrlRovingTabindex props\n\t * @returns new instance\n\t */\n\tconstructor(props: RovingPropTypes) {\n\t\tsuper(props);\n\n\t\tconst { allowDisabled = DEFAULT_ALLOW_DISABLED, hasChildRoving = false, orientation } = props;\n\n\t\tthis.elements = [];\n\t\tthis.orientation = orientation || 'horizontal';\n\t\tthis.selector = buildSelector(allowDisabled, hasChildRoving);\n\t}\n\n\t/**\n\t * Runs when the MrlRovingTabindex component mounts\n\t */\n\tcomponentDidMount(): void {\n\t\tconst { delayMount } = this.props;\n\t\tif (delayMount) {\n\t\t\tsetTimeout(() => this.mount(), delayMount);\n\t\t\treturn;\n\t\t}\n\n\t\tthis.mount();\n\t}\n\n\t/**\n\t * Runs when the MrlRovingTabindex component unmounts\n\t */\n\tcomponentWillUnmount(): void {\n\t\t// Remove focus event listener\n\t\tif (this.ref) {\n\t\t\tthis.ref.removeEventListener('focusout', this.handleFocusOut);\n\t\t}\n\t}\n\n\t/**\n\t * Runs when the MrlRovingTabindex component updates\n\t * @param {RovingPropTypes} prevProps - the props before the component updated\n\t */\n\tcomponentDidUpdate(prevProps: RovingPropTypes): void {\n\t\tconst {\n\t\t\tallowDisabled = DEFAULT_ALLOW_DISABLED,\n\t\t\tchildren,\n\t\t\tfocusWithShortcut,\n\t\t\thasChildRoving = false,\n\t\t\tisFocused,\n\t\t\tonBlur,\n\t\t\tonRefocus\n\t\t} = this.props;\n\n\t\t/**\n\t\t * If allowDisabled or hasChildRoving prop changes, rebuild the selector\n\t\t * and re-scan for elements to reflect the new configuration.\n\t\t */\n\t\tif (prevProps.allowDisabled !== allowDisabled || prevProps.hasChildRoving !== hasChildRoving) {\n\t\t\tthis.selector = buildSelector(allowDisabled, hasChildRoving);\n\t\t\tthis.setElements();\n\t\t\tthis.setActiveElement(this.getActiveElement());\n\t\t}\n\n\t\t/**\n\t\t * If focus is programatically moved to the MrlRovingTabindex\n\t\t * component from outside of the MrlRovingTabindex, passing\n\t\t * the prop of `onRefocus` will cause the component to go\n\t\t * through and make sure that only the active element\n\t\t * has a tabindex set to 0.\n\t\t */\n\t\tif (onRefocus) {\n\t\t\tthis.handleRefocus();\n\t\t}\n\n\t\t/**\n\t\t * When children change, re-scan for elements and update tabindex values.\n\t\t * This ensures that dynamically added/removed buttons are properly managed.\n\t\t */\n\t\tif (prevProps.children !== children && !focusWithShortcut) {\n\t\t\tthis.setElements();\n\t\t\tthis.setActiveElement(this.getActiveElement());\n\t\t}\n\n\t\tif (focusWithShortcut) {\n\t\t\t/**\n\t\t\t * If the component within MrlRovingTabindex shows on the page before it should\n\t\t\t * be reached with a keyboard the prop `focusWithiShortcut` can be used to\n\t\t\t * achieve that. The conditions below handle the various states that a\n\t\t\t * component can experience under this scenario.\n\t\t\t */\n\t\t\tif (!isFocused && !prevProps.isFocused) {\n\t\t\t\t/**\n\t\t\t\t * The component was not focus before and is not ready to be focused on\n\t\t\t\t */\n\t\t\t\tthis.unsetTabbableElements();\n\t\t\t}\n\n\t\t\tif (prevProps.isFocused && !isFocused) {\n\t\t\t\t/**\n\t\t\t\t * The component was focused but is not focused anymore\n\t\t\t\t */\n\t\t\t\tthis.unsetTabbableElements();\n\t\t\t\t// Only call onBlur if focus has truly left the container\n\t\t\t\tif (this.ref && !this.ref.contains(document.activeElement)) {\n\t\t\t\t\tonBlur?.();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!prevProps.isFocused && isFocused) {\n\t\t\t\t/**\n\t\t\t\t * The component was not focused before and is ready to be focused\n\t\t\t\t */\n\t\t\t\tthis.setElements();\n\t\t\t\tthis.setElementFocus(this.getActiveElement());\n\t\t\t}\n\n\t\t\tif (prevProps.children !== children && !isFocused && !prevProps.isFocused) {\n\t\t\t\t/**\n\t\t\t\t * Children changed but component is not focused\n\t\t\t\t * Ensure all new elements have tabindex=-1 to prevent Tab key access\n\t\t\t\t */\n\t\t\t\tthis.setElements();\n\t\t\t\tthis.unsetTabbableElements();\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tprevProps.children !== children &&\n\t\t\t\tprevProps.isFocused &&\n\t\t\t\tisFocused &&\n\t\t\t\t!this.ref?.contains(document.activeElement)\n\t\t\t) {\n\t\t\t\t/**\n\t\t\t\t * While the component was focused an action was performed that\n\t\t\t\t * changed the elements of the component and focus was moved to\n\t\t\t\t * a different element on the page\n\t\t\t\t */\n\t\t\t\tthis.setElements();\n\t\t\t\tthis.setActiveElement(this.getActiveElement());\n\n\t\t\t\tif (this.getActiveElement()) {\n\t\t\t\t\t/**\n\t\t\t\t\t * The active element is still within the roving tabindex so focus\n\t\t\t\t\t * on the element that should receive focus\n\t\t\t\t\t */\n\t\t\t\t\tthis.setElementFocus(this.getActiveElement());\n\t\t\t\t} else {\n\t\t\t\t\t/**\n\t\t\t\t\t * The active element has been moved outside of the MrlRovingTabindex\n\t\t\t\t\t * component so reset the component\n\t\t\t\t\t */\n\t\t\t\t\t// Only call onBlur if focus has truly left the container\n\t\t\t\t\tif (this.ref && !this.ref.contains(document.activeElement)) {\n\t\t\t\t\t\tonBlur?.();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\thandleRef = (ref: HTMLDivElement): HTMLDivElement => {\n\t\tthis.ref = ref;\n\t\t// Set up focus listener when ref becomes available\n\t\tif (ref) {\n\t\t\tref.addEventListener('focusout', this.handleFocusOut);\n\t\t}\n\t\treturn ref;\n\t};\n\n\t/**\n\t * Handles focus out events to detect when focus leaves the roving tabindex container\n\t * @param {FocusEvent} event - the focus out event\n\t * @returns {void}\n\t */\n\thandleFocusOut = (event: FocusEvent): void => {\n\t\tconst { onBlur } = this.props;\n\t\tconst relatedTarget = (event as FocusEvent & { relatedTarget?: HTMLElement }).relatedTarget;\n\n\t\t// Check if focus is moving to an element outside the container\n\t\tif (relatedTarget && !this.ref?.contains(relatedTarget)) {\n\t\t\t// Focus has moved from inside the container to outside\n\t\t\tonBlur?.();\n\t\t}\n\t};\n\n\t/**\n\t * Sets component array of elements\n\t * @returns {void}\n\t */\n\tsetElements = (): void => {\n\t\tif (!this.ref) return;\n\t\tthis.elements = getTabbableElements(this.ref, this.selector);\n\t};\n\n\t/**\n\t * Queries for a single element matching the selector within the container.\n\t * @param selector - CSS selector to query\n\t * @returns The matching element or null\n\t */\n\tqueryElement = (selector: string): HTMLElement | null => {\n\t\treturn this.ref?.querySelector(selector) as HTMLElement | null;\n\t};\n\n\t/**\n\t * Gets the active element based on priority order:\n\t * 1. Element matching the custom `activeSelector` prop (e.g., custom radio elements)\n\t * 2. Element with `data-roving-active` attribute (programmatically set active)\n\t * 3. First element with `data-roving` attribute (default fallback)\n\t *\n\t * Disabled elements are excluded unless `allowDisabled` is true.\n\t * @returns The active HTML element, or undefined if none found\n\t */\n\tgetActiveElement = (): HTMLElement | undefined => {\n\t\tconst { activeSelector, allowDisabled = DEFAULT_ALLOW_DISABLED } = this.props;\n\t\tconst disabledFilter = allowDisabled ? '' : DISABLED_EXCLUSION;\n\n\t\t// Priority 1: Custom active selector (e.g., for radio button groups)\n\t\t// An element with the matching activeSelector prop (example usage: custom radio elements)\n\t\tif (activeSelector) {\n\t\t\tconst customActiveElement = this.queryElement(\n\t\t\t\t`${activeSelector}[data-roving]${disabledFilter}`\n\t\t\t);\n\t\t\tif (customActiveElement) return customActiveElement;\n\t\t}\n\n\t\t// Priority 2: Programmatically marked active element\n\t\t// An element with a `data-roving-active` attribute, indicating the current active element\n\t\tconst markedActiveElement = this.queryElement(\n\t\t\t`[data-roving][data-roving-active]${disabledFilter}`\n\t\t);\n\t\tif (markedActiveElement) return markedActiveElement;\n\n\t\t// Priority 3: First roving element (uses pre-built selector with disabled handling)\n\t\t// If no active element is found, the first instance of an element with `data-roving=\"true\"`\n\t\tconst firstRovingElement = this.ref?.querySelectorAll(this.selector)[0];\n\t\treturn firstRovingElement as HTMLElement | undefined;\n\t};\n\n\t/**\n\t * Sets an element to `tabindex=0` and sets all other elements to `tabindex=-1`\n\t * @param {HTMLElement | undefined} el - the element to set as active\n\t * @returns {void}\n\t */\n\tsetActiveElement = (el: HTMLElement | undefined): void => {\n\t\tif (!el) return;\n\n\t\tthis.unsetTabbableElements();\n\t\tel.setAttribute('tabindex', '0');\n\t};\n\n\t/**\n\t * Sets focus to a specific element\n\t * @param {HTMLElement | undefined} el - the element to set in focus\n\t * @returns {void}\n\t */\n\tsetElementFocus = (el: HTMLElement | undefined): void => {\n\t\tif (!el) return;\n\n\t\t/**\n\t\t * Why data-roving-active?\n\t\t *\n\t\t * We only want to set data-roving-active when 'setElementFocus' is triggered because we don't want [tabindex=0] to be mutally exclusive with\n\t\t * [data-roving-active]. An item with [data-roving-active] can exist without having [tabindex=0] and vice versa. We only want to set [data-roving-active]\n\t\t * intentionally when a user action has occured to change it. Such as a keyboard event or moving focus manually with Javascript.\n\t\t */\n\t\tconst current = this.getActiveElement();\n\t\tif (current) current.removeAttribute('data-roving-active');\n\t\tel.setAttribute('data-roving-active', 'true');\n\n\t\tthis.setActiveElement(el);\n\t\tel.focus();\n\t};\n\n\t/**\n\t * Sets focus to an element based on a direction (`forward` or `back`)\n\t * Disabled elements are already excluded from this.elements via CSS selector\n\t * @param {NavigationDirection} direction 'forward' | 'back'\n\t * @returns {void}\n\t */\n\tsetFocusByDirection = (direction: NavigationDirection): void => {\n\t\tconst itemsLen = this.elements.length;\n\n\t\tif (itemsLen > 0) {\n\t\t\tconst currentIndex = this.elements.indexOf(document.activeElement);\n\n\t\t\tconst directionSum = direction === 'back' ? -1 : 1;\n\t\t\tlet nextIndex = currentIndex + directionSum;\n\n\t\t\tif (direction === 'back') {\n\t\t\t\tnextIndex = nextIndex < 0 ? itemsLen - 1 : nextIndex;\n\t\t\t}\n\n\t\t\tif (direction === 'forward') {\n\t\t\t\tnextIndex = nextIndex >= itemsLen ? 0 : nextIndex;\n\t\t\t}\n\n\t\t\tthis.setElementFocus(this.elements[nextIndex] as HTMLElement);\n\t\t}\n\t};\n\n\t/**\n\t * Sets all tabindex for elements of this component to -1\n\t * Also ensures disabled elements (excluded from roving tabindex) have tabindex=-1\n\t * @returns {void}\n\t */\n\tunsetTabbableElements = (): void => {\n\t\tif (!this.elements) return;\n\n\t\t// Set tabindex=-1 for all roving tabindex elements\n\t\tthis.elements.forEach((el: Element | null) => {\n\t\t\tel && el.setAttribute('tabindex', '-1');\n\t\t});\n\n\t\t// Also set tabindex=-1 for disabled elements that are excluded from roving tabindex\n\t\t// This ensures disabled elements are not tabbable even though they're not in the navigation order\n\t\tif (!this.ref || this.props.allowDisabled) return;\n\n\t\tconst disabledElements = this.ref.querySelectorAll(\n\t\t\t`[data-roving][disabled], [data-roving][aria-disabled=\"true\"]`\n\t\t);\n\t\tdisabledElements.forEach((el) => {\n\t\t\tel.setAttribute('tabindex', '-1');\n\t\t});\n\t};\n\n\t/**\n\t * Will return `false` if the orientation param matches the\n\t * orientation of the component and the actively focused element has a menu or select\n\t * @param orientation : 'horizontal' | 'vertical'\n\t * @returns boolean\n\t */\n\tcanUseArrows = (orientation: RovingOrientation): boolean => {\n\t\tconst { activeElement } = document;\n\t\tconst role = activeElement?.getAttribute('role');\n\t\tconst hasMenuOrSelect =\n\t\t\tactiveElement?.getAttribute('aria-haspopup') === 'true' ||\n\t\t\trole === 'combobox' ||\n\t\t\trole === 'option' ||\n\t\t\trole === 'listbox';\n\n\t\treturn !(this.orientation === orientation && hasMenuOrSelect);\n\t};\n\n\thandleKeyUp = (e: React.KeyboardEvent): void => {\n\t\tconst { ignoreElements } = this.props;\n\t\tconst allowKeyPress = !ignoreElements ? true : !document.activeElement?.closest(ignoreElements);\n\n\t\tconst modifierPressed = e.ctrlKey || e.metaKey || e.shiftKey;\n\n\t\tif (modifierPressed) return;\n\n\t\t/**\n\t\t * If elements within MrlRovingTabindex are added after the component mounts\n\t\t * they will not automatically be a `part of this.elements`. This checks if\n\t\t * `this.elements` contains all elements that MrlRovingTabindex should be aware\n\t\t * of and will update `this.elements` if neccessary.\n\t\t */\n\t\tconst knownTabbableElements = this.elements;\n\t\tconst allTabbableElements = getTabbableElements(this.ref, this.selector);\n\n\t\tif (\n\t\t\tknownTabbableElements.length !== allTabbableElements.length ||\n\t\t\t!arraysEqual(knownTabbableElements, allTabbableElements)\n\t\t) {\n\t\t\tthis.setElements();\n\t\t\tthis.setActiveElement(this.getActiveElement());\n\t\t}\n\n\t\tconst isActiveRoving = this.getActiveElement() === document.activeElement;\n\n\t\tif (allowKeyPress && isActiveRoving) {\n\t\t\te.stopPropagation();\n\t\t\tswitch (e.key) {\n\t\t\t\tcase 'ArrowDown':\n\t\t\t\t\tif (this.canUseArrows('horizontal')) this.setFocusByDirection('forward');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ArrowUp':\n\t\t\t\t\tif (this.canUseArrows('horizontal')) this.setFocusByDirection('back');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ArrowRight':\n\t\t\t\t\tif (this.canUseArrows('vertical')) this.setFocusByDirection('forward');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ArrowLeft':\n\t\t\t\t\tif (this.canUseArrows('vertical')) this.setFocusByDirection('back');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'End':\n\t\t\t\t\tthis.handleFocusedLast();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Home':\n\t\t\t\t\tthis.handleFocusedFirst();\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t};\n\n\thandleFocusedFirst = (): void => this.setElementFocus(this.elements[0] as HTMLElement);\n\n\thandleFocusedLast = (): void =>\n\t\tthis.setElementFocus(this.elements[this.elements.length - 1] as HTMLElement);\n\n\thandleRefocus = (): void => {\n\t\tthis.setActiveElement(document.activeElement as HTMLElement);\n\t\tthis.props.onRefocus?.(false);\n\t};\n\n\t/**\n\t * Mounts the MrlRovingTabindex component\n\t * @returns {void}\n\t */\n\tmount(): void {\n\t\tconst { focusOnInit, focusWithShortcut, isFocused } = this.props;\n\n\t\tif (!focusWithShortcut) {\n\t\t\t// get initial set of elements for the component\n\t\t\tthis.setElements();\n\n\t\t\t// sets the first element of the component to tabindex=0 but does not move focus\n\t\t\t// this allows users to tab to the component naturally based on tab order\n\t\t\tthis.setActiveElement(this.getActiveElement());\n\t\t} else {\n\t\t\t// When focusWithShortcut is true, we need to set up elements\n\t\t\t// but only set tabindex values based on isFocused state\n\t\t\tthis.setElements();\n\n\t\t\tif (!isFocused) {\n\t\t\t\t// If not focused initially, set all elements to tabindex=-1\n\t\t\t\tthis.unsetTabbableElements();\n\t\t\t} else {\n\t\t\t\t// If focused initially, set the active element properly\n\t\t\t\tthis.setActiveElement(this.getActiveElement());\n\t\t\t}\n\t\t}\n\n\t\tif (focusOnInit && this.elements.length > 0) {\n\t\t\tif (focusOnInit === 'first') {\n\t\t\t\tthis.handleFocusedFirst();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.handleFocusedLast();\n\t\t}\n\t}\n\n\t/**\n\t * Renders the MrlRovingTabindex component\n\t * @returns {HTMLDivElement} - the rendered MrlRovingTabindex component\n\t */\n\trender(): JSX.Element {\n\t\t/* eslint-disable @typescript-eslint/no-unused-vars */\n\t\t// Destructure component-specific props to prevent them from being spread to the DOM\n\t\tconst {\n\t\t\tactiveSelector,\n\t\t\tallowDisabled,\n\t\t\tchildren,\n\t\t\tdelayMount,\n\t\t\tfocusOnInit,\n\t\t\tfocusWithShortcut,\n\t\t\tforceUpdate,\n\t\t\thasChildRoving,\n\t\t\tignoreElements,\n\t\t\tisFocused,\n\t\t\tonBlur,\n\t\t\tonRefocus,\n\t\t\torientation,\n\t\t\tqa,\n\t\t\t...rest\n\t\t} = this.props;\n\t\t/* eslint-enable @typescript-eslint/no-unused-vars */\n\n\t\tconst dataQa = `${qa || 'generic'}-roving`;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tclassName=\"helpers-roving-tabindex-container\"\n\t\t\t\tdata-qa={dataQa}\n\t\t\t\tonKeyUp={this.handleKeyUp}\n\t\t\t\tref={this.handleRef}\n\t\t\t\trole=\"presentation\"\n\t\t\t\t// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex\n\t\t\t\ttabIndex={-1}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nexport { MrlRovingTabindex };\n"],"names":["getTabbableElements","ref","selector","elements","querySelectorAll","Array","prototype","slice","call","arraysEqual","a","b","length","every","el","i","DEFAULT_ALLOW_DISABLED","DISABLED_EXCLUSION","NESTED_ROVING_EXCLUSION","buildSelector","allowDisabled","hasChildRoving","disabledPart","nestedPart","concat","MrlRovingTabindex","React","Component","constructor","props","_defineProperty","addEventListener","handleFocusOut","event","_this$ref","onBlur","relatedTarget","contains","_this$ref2","querySelector","_this$ref3","_this$props","activeSelector","_this$props$allowDisa","disabledFilter","customActiveElement","queryElement","markedActiveElement","firstRovingElement","unsetTabbableElements","setAttribute","current","getActiveElement","removeAttribute","setActiveElement","focus","direction","itemsLen","currentIndex","indexOf","document","activeElement","directionSum","nextIndex","setElementFocus","forEach","disabledElements","orientation","_document","role","getAttribute","hasMenuOrSelect","e","_document$activeEleme","ignoreElements","allowKeyPress","closest","modifierPressed","ctrlKey","metaKey","shiftKey","knownTabbableElements","allTabbableElements","setElements","isActiveRoving","stopPropagation","key","canUseArrows","setFocusByDirection","handleFocusedLast","handleFocusedFirst","_this$props$onRefocus","_this$props2","onRefocus","_props$allowDisabled","_props$hasChildRoving","componentDidMount","delayMount","setTimeout","mount","componentWillUnmount","removeEventListener","componentDidUpdate","prevProps","_this$props3","_this$props3$allowDis","children","focusWithShortcut","_this$props3$hasChild","isFocused","handleRefocus","_this$ref4","_this$props4","focusOnInit","render","_this$props5","forceUpdate","qa","rest","_objectWithoutProperties","_excluded","dataQa","createElement","_extends","className","onKeyUp","handleKeyUp","handleRef","tabIndex"],"mappings":";;;;AAIA;AACA;AACA;AACA;AACA;AACA;IACaA,mBAAmB,GAAGA,CAACC,GAAY,EAAEC,QAAgB,KAAoB;EACrF,IAAMC,QAAQ,GAAGF,GAAG,KAAA,IAAA,IAAHA,GAAG,KAAA,MAAA,GAAA,MAAA,GAAHA,GAAG,CAAEG,gBAAgB,CAACF,QAAQ,CAAC;AAChD,EAAA,IAAI,CAACC,QAAQ,EAAE,OAAO,EAAE;EACxB,OAAOE,KAAK,CAACC,SAAS,CAACC,KAAK,CAACC,IAAI,CAACL,QAAQ,CAAC;AAC5C;AAEA,IAAMM,WAAW,GAAGA,CAACC,CAAqB,EAAEC,CAAqB,KAChED,CAAC,CAACE,MAAM,KAAKD,CAAC,CAACC,MAAM,IAAIF,CAAC,CAACG,KAAK,CAAC,CAACC,EAAE,EAAEC,CAAC,KAAKD,EAAE,KAAKH,CAAC,CAACI,CAAC,CAAC,CAAC;AA2CzD;AACA;AACA;AACA;AACA,IAAMC,sBAAsB,GAAG,IAAI;;AAEnC;AACA;AACA;AACA;AACA,IAAMC,kBAAkB,GAAG,8CAA8C;;AAEzE;AACA;AACA;AACA;AACA,IAAMC,uBAAuB,GAC5B,2FAA2F;;AAE5F;AACA;AACA;AACA;AACA;AACA;AACA,IAAMC,aAAa,GAAGA,CAACC,aAAsB,EAAEC,cAAuB,KAAa;AAClF,EAAA,IAAMC,YAAY,GAAGF,aAAa,GAAG,EAAE,GAAGH,kBAAkB;AAC5D,EAAA,IAAMM,UAAU,GAAGF,cAAc,GAAGH,uBAAuB,GAAG,EAAE;AAChE,EAAA,OAAA,eAAA,CAAAM,MAAA,CAAuBF,YAAY,CAAA,CAAAE,MAAA,CAAGD,UAA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AC;AAER,EAAA;AACD;;;;"}
|
|
1
|
+
{"version":3,"file":"MrlRovingTabindex.js","sources":["../../../../../src/components/rovingTabindex/MrlRovingTabindex/MrlRovingTabindex.tsx"],"sourcesContent":["import * as React from 'react';\n\ntype RefType = HTMLElement | HTMLDivElement | null;\n\n/**\n * Gets tabbable elements in a given bit of the DOM, excluding disabled elements\n * @param {RefType} ref - the ref of the container\n * @param {string} selector - the selector to query (should already exclude disabled elements)\n * @returns {HTMLElement[]} - an array of tabbable HTML elements\n */\nexport const getTabbableElements = (ref: RefType, selector: string): HTMLElement[] => {\n\tconst elements = ref?.querySelectorAll(selector);\n\tif (!elements) return [];\n\treturn Array.prototype.slice.call(elements);\n};\n\nconst arraysEqual = (a: (Element | null)[], b: (Element | null)[]): boolean =>\n\ta.length === b.length && a.every((el, i) => el === b[i]);\n\nexport type FocusOnInitPosition = 'first' | 'last';\nexport interface RovingPropTypes {\n\t/** CSS selector of the element that starts as the tab stop, for example a checked custom radio. Falls back to `[data-roving-active]`, then to the first `[data-roving]` element. */\n\tactiveSelector?: string;\n\t/**\n\t * If true, disabled elements (with disabled attribute or aria-disabled=\"true\")\n\t * will be included in the roving tabindex. Defaults to true (disabled elements are included).\n\t */\n\tallowDisabled?: boolean;\n\tchildren: React.ReactNode;\n\t/**\n\t * delayMount is used to apply a delay to the mounting\n\t * of the RovingTabindex component. This can be helpful in\n\t * the event that a component's children have not been fully\n\t * rendered by the time the componentDidMount function is triggered\n\t */\n\tdelayMount?: number;\n\t/** Moves focus to the first or last element when the component mounts (after `delayMount`, if set). */\n\tfocusOnInit?: FocusOnInitPosition;\n\t/** Keeps every element out of the tab order until `isFocused` becomes true. For groups reached through a keyboard shortcut instead of Tab. */\n\tfocusWithShortcut?: boolean;\n\t/** Has no effect. Kept for backwards compatibility. */\n\tforceUpdate?: boolean;\n\t/** Set when another roving tabindex is nested inside this one, so its elements are left to the inner instance. */\n\thasChildRoving?: boolean;\n\t/** CSS selector. Keyboard navigation is ignored while focus is inside a matching element, for example a text input. */\n\tignoreElements?: string;\n\t/** With `focusWithShortcut`, whether the group holds focus. Turning it on focuses the active element; turning it off removes the group from the tab order. */\n\tisFocused?: boolean;\n\t/** Called when focus moves from the group to another element outside it. With `focusWithShortcut`, also called when `isFocused` turns off while focus is outside the group. */\n\tonBlur?: () => void;\n\t/** Pass it after moving focus into the group programmatically. On the next update the focused element becomes the tab stop and the callback receives `false`, so the consumer can drop it. */\n\tonRefocus?: (shouldRefocus: boolean) => void;\n\t/** Axis of the group, read once at mount. Every arrow key moves focus, but the keys across the axis are left to a focused element with `aria-haspopup=\"true\"` or role combobox, listbox or option. Defaults to horizontal. */\n\torientation?: RovingOrientation;\n\tqa?: string;\n}\n\nexport type RovingOrientation = 'horizontal' | 'vertical';\ntype NavigationDirection = 'forward' | 'back';\n\n/**\n * Default value for allowDisabled prop.\n * When true, disabled elements are included in the roving tabindex navigation.\n */\nconst DEFAULT_ALLOW_DISABLED = true;\n\n/**\n * CSS selector to exclude disabled elements.\n * Excludes both native disabled attribute and ARIA-compliant disabled elements.\n */\nconst DISABLED_EXCLUSION = ':not([disabled]):not([aria-disabled=\"true\"])';\n\n/**\n * CSS selector suffix to exclude nested roving tabindex elements.\n * Prevents deeply nested elements from being included in parent roving tabindex.\n */\nconst NESTED_ROVING_EXCLUSION =\n\t':not(.helpers-roving-tabindex-container .helpers-roving-tabindex-container [data-roving])';\n\n/**\n * Builds the appropriate CSS selector based on configuration.\n * @param allowDisabled - Whether to include disabled elements in the roving tabindex\n * @param hasChildRoving - Whether nested roving tabindex containers should be excluded\n * @returns CSS selector string for querying roving elements\n */\nconst buildSelector = (allowDisabled: boolean, hasChildRoving: boolean): string => {\n\tconst disabledPart = allowDisabled ? '' : DISABLED_EXCLUSION;\n\tconst nestedPart = hasChildRoving ? NESTED_ROVING_EXCLUSION : '';\n\treturn `[data-roving]${disabledPart}${nestedPart}`;\n};\n\n/**\n * Component to create a Roving Tabindex in the DOM\n * @returns {HTMLDivElement}\n */\nclass MrlRovingTabindex extends React.Component<RovingPropTypes> {\n\telements: Array<Element | null>;\n\torientation: RovingOrientation;\n\tref!: HTMLDivElement | null;\n\tselector: string;\n\n\t/**\n\t * MrlRovingTabindex class constructor\n\t * @param props - the MrlRovingTabindex props\n\t * @returns new instance\n\t */\n\tconstructor(props: RovingPropTypes) {\n\t\tsuper(props);\n\n\t\tconst { allowDisabled = DEFAULT_ALLOW_DISABLED, hasChildRoving = false, orientation } = props;\n\n\t\tthis.elements = [];\n\t\tthis.orientation = orientation || 'horizontal';\n\t\tthis.selector = buildSelector(allowDisabled, hasChildRoving);\n\t}\n\n\t/**\n\t * Runs when the MrlRovingTabindex component mounts\n\t */\n\tcomponentDidMount(): void {\n\t\tconst { delayMount } = this.props;\n\t\tif (delayMount) {\n\t\t\tsetTimeout(() => this.mount(), delayMount);\n\t\t\treturn;\n\t\t}\n\n\t\tthis.mount();\n\t}\n\n\t/**\n\t * Runs when the MrlRovingTabindex component unmounts\n\t */\n\tcomponentWillUnmount(): void {\n\t\t// Remove focus event listener\n\t\tif (this.ref) {\n\t\t\tthis.ref.removeEventListener('focusout', this.handleFocusOut);\n\t\t}\n\t}\n\n\t/**\n\t * Runs when the MrlRovingTabindex component updates\n\t * @param {RovingPropTypes} prevProps - the props before the component updated\n\t */\n\tcomponentDidUpdate(prevProps: RovingPropTypes): void {\n\t\tconst {\n\t\t\tallowDisabled = DEFAULT_ALLOW_DISABLED,\n\t\t\tchildren,\n\t\t\tfocusWithShortcut,\n\t\t\thasChildRoving = false,\n\t\t\tisFocused,\n\t\t\tonBlur,\n\t\t\tonRefocus\n\t\t} = this.props;\n\n\t\t/**\n\t\t * If allowDisabled or hasChildRoving prop changes, rebuild the selector\n\t\t * and re-scan for elements to reflect the new configuration.\n\t\t */\n\t\tif (prevProps.allowDisabled !== allowDisabled || prevProps.hasChildRoving !== hasChildRoving) {\n\t\t\tthis.selector = buildSelector(allowDisabled, hasChildRoving);\n\t\t\tthis.setElements();\n\t\t\tthis.setActiveElement(this.getActiveElement());\n\t\t}\n\n\t\t/**\n\t\t * If focus is programatically moved to the MrlRovingTabindex\n\t\t * component from outside of the MrlRovingTabindex, passing\n\t\t * the prop of `onRefocus` will cause the component to go\n\t\t * through and make sure that only the active element\n\t\t * has a tabindex set to 0.\n\t\t */\n\t\tif (onRefocus) {\n\t\t\tthis.handleRefocus();\n\t\t}\n\n\t\t/**\n\t\t * When children change, re-scan for elements and update tabindex values.\n\t\t * This ensures that dynamically added/removed buttons are properly managed.\n\t\t */\n\t\tif (prevProps.children !== children && !focusWithShortcut) {\n\t\t\tthis.setElements();\n\t\t\tthis.setActiveElement(this.getActiveElement());\n\t\t}\n\n\t\tif (focusWithShortcut) {\n\t\t\t/**\n\t\t\t * If the component within MrlRovingTabindex shows on the page before it should\n\t\t\t * be reached with a keyboard the prop `focusWithiShortcut` can be used to\n\t\t\t * achieve that. The conditions below handle the various states that a\n\t\t\t * component can experience under this scenario.\n\t\t\t */\n\t\t\tif (!isFocused && !prevProps.isFocused) {\n\t\t\t\t/**\n\t\t\t\t * The component was not focus before and is not ready to be focused on\n\t\t\t\t */\n\t\t\t\tthis.unsetTabbableElements();\n\t\t\t}\n\n\t\t\tif (prevProps.isFocused && !isFocused) {\n\t\t\t\t/**\n\t\t\t\t * The component was focused but is not focused anymore\n\t\t\t\t */\n\t\t\t\tthis.unsetTabbableElements();\n\t\t\t\t// Only call onBlur if focus has truly left the container\n\t\t\t\tif (this.ref && !this.ref.contains(document.activeElement)) {\n\t\t\t\t\tonBlur?.();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!prevProps.isFocused && isFocused) {\n\t\t\t\t/**\n\t\t\t\t * The component was not focused before and is ready to be focused\n\t\t\t\t */\n\t\t\t\tthis.setElements();\n\t\t\t\tthis.setElementFocus(this.getActiveElement());\n\t\t\t}\n\n\t\t\tif (prevProps.children !== children && !isFocused && !prevProps.isFocused) {\n\t\t\t\t/**\n\t\t\t\t * Children changed but component is not focused\n\t\t\t\t * Ensure all new elements have tabindex=-1 to prevent Tab key access\n\t\t\t\t */\n\t\t\t\tthis.setElements();\n\t\t\t\tthis.unsetTabbableElements();\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tprevProps.children !== children &&\n\t\t\t\tprevProps.isFocused &&\n\t\t\t\tisFocused &&\n\t\t\t\t!this.ref?.contains(document.activeElement)\n\t\t\t) {\n\t\t\t\t/**\n\t\t\t\t * While the component was focused an action was performed that\n\t\t\t\t * changed the elements of the component and focus was moved to\n\t\t\t\t * a different element on the page\n\t\t\t\t */\n\t\t\t\tthis.setElements();\n\t\t\t\tthis.setActiveElement(this.getActiveElement());\n\n\t\t\t\tif (this.getActiveElement()) {\n\t\t\t\t\t/**\n\t\t\t\t\t * The active element is still within the roving tabindex so focus\n\t\t\t\t\t * on the element that should receive focus\n\t\t\t\t\t */\n\t\t\t\t\tthis.setElementFocus(this.getActiveElement());\n\t\t\t\t} else {\n\t\t\t\t\t/**\n\t\t\t\t\t * The active element has been moved outside of the MrlRovingTabindex\n\t\t\t\t\t * component so reset the component\n\t\t\t\t\t */\n\t\t\t\t\t// Only call onBlur if focus has truly left the container\n\t\t\t\t\tif (this.ref && !this.ref.contains(document.activeElement)) {\n\t\t\t\t\t\tonBlur?.();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\thandleRef = (ref: HTMLDivElement): HTMLDivElement => {\n\t\tthis.ref = ref;\n\t\t// Set up focus listener when ref becomes available\n\t\tif (ref) {\n\t\t\tref.addEventListener('focusout', this.handleFocusOut);\n\t\t}\n\t\treturn ref;\n\t};\n\n\t/**\n\t * Handles focus out events to detect when focus leaves the roving tabindex container\n\t * @param {FocusEvent} event - the focus out event\n\t * @returns {void}\n\t */\n\thandleFocusOut = (event: FocusEvent): void => {\n\t\tconst { onBlur } = this.props;\n\t\tconst relatedTarget = (event as FocusEvent & { relatedTarget?: HTMLElement }).relatedTarget;\n\n\t\t// Check if focus is moving to an element outside the container\n\t\tif (relatedTarget && !this.ref?.contains(relatedTarget)) {\n\t\t\t// Focus has moved from inside the container to outside\n\t\t\tonBlur?.();\n\t\t}\n\t};\n\n\t/**\n\t * Sets component array of elements\n\t * @returns {void}\n\t */\n\tsetElements = (): void => {\n\t\tif (!this.ref) return;\n\t\tthis.elements = getTabbableElements(this.ref, this.selector);\n\t};\n\n\t/**\n\t * Queries for a single element matching the selector within the container.\n\t * @param selector - CSS selector to query\n\t * @returns The matching element or null\n\t */\n\tqueryElement = (selector: string): HTMLElement | null => {\n\t\treturn this.ref?.querySelector(selector) as HTMLElement | null;\n\t};\n\n\t/**\n\t * Gets the active element based on priority order:\n\t * 1. Element matching the custom `activeSelector` prop (e.g., custom radio elements)\n\t * 2. Element with `data-roving-active` attribute (programmatically set active)\n\t * 3. First element with `data-roving` attribute (default fallback)\n\t *\n\t * Disabled elements are excluded unless `allowDisabled` is true.\n\t * @returns The active HTML element, or undefined if none found\n\t */\n\tgetActiveElement = (): HTMLElement | undefined => {\n\t\tconst { activeSelector, allowDisabled = DEFAULT_ALLOW_DISABLED } = this.props;\n\t\tconst disabledFilter = allowDisabled ? '' : DISABLED_EXCLUSION;\n\n\t\t// Priority 1: Custom active selector (e.g., for radio button groups)\n\t\t// An element with the matching activeSelector prop (example usage: custom radio elements)\n\t\tif (activeSelector) {\n\t\t\tconst customActiveElement = this.queryElement(\n\t\t\t\t`${activeSelector}[data-roving]${disabledFilter}`\n\t\t\t);\n\t\t\tif (customActiveElement) return customActiveElement;\n\t\t}\n\n\t\t// Priority 2: Programmatically marked active element\n\t\t// An element with a `data-roving-active` attribute, indicating the current active element\n\t\tconst markedActiveElement = this.queryElement(\n\t\t\t`[data-roving][data-roving-active]${disabledFilter}`\n\t\t);\n\t\tif (markedActiveElement) return markedActiveElement;\n\n\t\t// Priority 3: First roving element (uses pre-built selector with disabled handling)\n\t\t// If no active element is found, the first instance of an element with `data-roving=\"true\"`\n\t\tconst firstRovingElement = this.ref?.querySelectorAll(this.selector)[0];\n\t\treturn firstRovingElement as HTMLElement | undefined;\n\t};\n\n\t/**\n\t * Sets an element to `tabindex=0` and sets all other elements to `tabindex=-1`\n\t * @param {HTMLElement | undefined} el - the element to set as active\n\t * @returns {void}\n\t */\n\tsetActiveElement = (el: HTMLElement | undefined): void => {\n\t\tif (!el) return;\n\n\t\tthis.unsetTabbableElements();\n\t\tel.setAttribute('tabindex', '0');\n\t};\n\n\t/**\n\t * Sets focus to a specific element\n\t * @param {HTMLElement | undefined} el - the element to set in focus\n\t * @returns {void}\n\t */\n\tsetElementFocus = (el: HTMLElement | undefined): void => {\n\t\tif (!el) return;\n\n\t\t/**\n\t\t * Why data-roving-active?\n\t\t *\n\t\t * We only want to set data-roving-active when 'setElementFocus' is triggered because we don't want [tabindex=0] to be mutally exclusive with\n\t\t * [data-roving-active]. An item with [data-roving-active] can exist without having [tabindex=0] and vice versa. We only want to set [data-roving-active]\n\t\t * intentionally when a user action has occured to change it. Such as a keyboard event or moving focus manually with Javascript.\n\t\t */\n\t\tconst current = this.getActiveElement();\n\t\tif (current) current.removeAttribute('data-roving-active');\n\t\tel.setAttribute('data-roving-active', 'true');\n\n\t\tthis.setActiveElement(el);\n\t\tel.focus();\n\t};\n\n\t/**\n\t * Sets focus to an element based on a direction (`forward` or `back`)\n\t * Disabled elements are already excluded from this.elements via CSS selector\n\t * @param {NavigationDirection} direction 'forward' | 'back'\n\t * @returns {void}\n\t */\n\tsetFocusByDirection = (direction: NavigationDirection): void => {\n\t\tconst itemsLen = this.elements.length;\n\n\t\tif (itemsLen > 0) {\n\t\t\tconst currentIndex = this.elements.indexOf(document.activeElement);\n\n\t\t\tconst directionSum = direction === 'back' ? -1 : 1;\n\t\t\tlet nextIndex = currentIndex + directionSum;\n\n\t\t\tif (direction === 'back') {\n\t\t\t\tnextIndex = nextIndex < 0 ? itemsLen - 1 : nextIndex;\n\t\t\t}\n\n\t\t\tif (direction === 'forward') {\n\t\t\t\tnextIndex = nextIndex >= itemsLen ? 0 : nextIndex;\n\t\t\t}\n\n\t\t\tthis.setElementFocus(this.elements[nextIndex] as HTMLElement);\n\t\t}\n\t};\n\n\t/**\n\t * Sets all tabindex for elements of this component to -1\n\t * Also ensures disabled elements (excluded from roving tabindex) have tabindex=-1\n\t * @returns {void}\n\t */\n\tunsetTabbableElements = (): void => {\n\t\tif (!this.elements) return;\n\n\t\t// Set tabindex=-1 for all roving tabindex elements\n\t\tthis.elements.forEach((el: Element | null) => {\n\t\t\tel && el.setAttribute('tabindex', '-1');\n\t\t});\n\n\t\t// Also set tabindex=-1 for disabled elements that are excluded from roving tabindex\n\t\t// This ensures disabled elements are not tabbable even though they're not in the navigation order\n\t\tif (!this.ref || this.props.allowDisabled) return;\n\n\t\tconst disabledElements = this.ref.querySelectorAll(\n\t\t\t`[data-roving][disabled], [data-roving][aria-disabled=\"true\"]`\n\t\t);\n\t\tdisabledElements.forEach((el) => {\n\t\t\tel.setAttribute('tabindex', '-1');\n\t\t});\n\t};\n\n\t/**\n\t * Will return `false` if the orientation param matches the\n\t * orientation of the component and the actively focused element has a menu or select\n\t * @param orientation : 'horizontal' | 'vertical'\n\t * @returns boolean\n\t */\n\tcanUseArrows = (orientation: RovingOrientation): boolean => {\n\t\tconst { activeElement } = document;\n\t\tconst role = activeElement?.getAttribute('role');\n\t\tconst hasMenuOrSelect =\n\t\t\tactiveElement?.getAttribute('aria-haspopup') === 'true' ||\n\t\t\trole === 'combobox' ||\n\t\t\trole === 'option' ||\n\t\t\trole === 'listbox';\n\n\t\treturn !(this.orientation === orientation && hasMenuOrSelect);\n\t};\n\n\thandleKeyUp = (e: React.KeyboardEvent): void => {\n\t\tconst { ignoreElements } = this.props;\n\t\tconst allowKeyPress = !ignoreElements ? true : !document.activeElement?.closest(ignoreElements);\n\n\t\tconst modifierPressed = e.ctrlKey || e.metaKey || e.shiftKey;\n\n\t\tif (modifierPressed) return;\n\n\t\t/**\n\t\t * If elements within MrlRovingTabindex are added after the component mounts\n\t\t * they will not automatically be a `part of this.elements`. This checks if\n\t\t * `this.elements` contains all elements that MrlRovingTabindex should be aware\n\t\t * of and will update `this.elements` if neccessary.\n\t\t */\n\t\tconst knownTabbableElements = this.elements;\n\t\tconst allTabbableElements = getTabbableElements(this.ref, this.selector);\n\n\t\tif (\n\t\t\tknownTabbableElements.length !== allTabbableElements.length ||\n\t\t\t!arraysEqual(knownTabbableElements, allTabbableElements)\n\t\t) {\n\t\t\tthis.setElements();\n\t\t\tthis.setActiveElement(this.getActiveElement());\n\t\t}\n\n\t\tconst isActiveRoving = this.getActiveElement() === document.activeElement;\n\n\t\tif (allowKeyPress && isActiveRoving) {\n\t\t\te.stopPropagation();\n\t\t\tswitch (e.key) {\n\t\t\t\tcase 'ArrowDown':\n\t\t\t\t\tif (this.canUseArrows('horizontal')) this.setFocusByDirection('forward');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ArrowUp':\n\t\t\t\t\tif (this.canUseArrows('horizontal')) this.setFocusByDirection('back');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ArrowRight':\n\t\t\t\t\tif (this.canUseArrows('vertical')) this.setFocusByDirection('forward');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ArrowLeft':\n\t\t\t\t\tif (this.canUseArrows('vertical')) this.setFocusByDirection('back');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'End':\n\t\t\t\t\tthis.handleFocusedLast();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Home':\n\t\t\t\t\tthis.handleFocusedFirst();\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t};\n\n\thandleFocusedFirst = (): void => this.setElementFocus(this.elements[0] as HTMLElement);\n\n\thandleFocusedLast = (): void =>\n\t\tthis.setElementFocus(this.elements[this.elements.length - 1] as HTMLElement);\n\n\thandleRefocus = (): void => {\n\t\tthis.setActiveElement(document.activeElement as HTMLElement);\n\t\tthis.props.onRefocus?.(false);\n\t};\n\n\t/**\n\t * Mounts the MrlRovingTabindex component\n\t * @returns {void}\n\t */\n\tmount(): void {\n\t\tconst { focusOnInit, focusWithShortcut, isFocused } = this.props;\n\n\t\tif (!focusWithShortcut) {\n\t\t\t// get initial set of elements for the component\n\t\t\tthis.setElements();\n\n\t\t\t// sets the first element of the component to tabindex=0 but does not move focus\n\t\t\t// this allows users to tab to the component naturally based on tab order\n\t\t\tthis.setActiveElement(this.getActiveElement());\n\t\t} else {\n\t\t\t// When focusWithShortcut is true, we need to set up elements\n\t\t\t// but only set tabindex values based on isFocused state\n\t\t\tthis.setElements();\n\n\t\t\tif (!isFocused) {\n\t\t\t\t// If not focused initially, set all elements to tabindex=-1\n\t\t\t\tthis.unsetTabbableElements();\n\t\t\t} else {\n\t\t\t\t// If focused initially, set the active element properly\n\t\t\t\tthis.setActiveElement(this.getActiveElement());\n\t\t\t}\n\t\t}\n\n\t\tif (focusOnInit && this.elements.length > 0) {\n\t\t\tif (focusOnInit === 'first') {\n\t\t\t\tthis.handleFocusedFirst();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.handleFocusedLast();\n\t\t}\n\t}\n\n\t/**\n\t * Renders the MrlRovingTabindex component\n\t * @returns {HTMLDivElement} - the rendered MrlRovingTabindex component\n\t */\n\trender(): JSX.Element {\n\t\t/* eslint-disable @typescript-eslint/no-unused-vars */\n\t\t// Destructure component-specific props to prevent them from being spread to the DOM\n\t\tconst {\n\t\t\tactiveSelector,\n\t\t\tallowDisabled,\n\t\t\tchildren,\n\t\t\tdelayMount,\n\t\t\tfocusOnInit,\n\t\t\tfocusWithShortcut,\n\t\t\tforceUpdate,\n\t\t\thasChildRoving,\n\t\t\tignoreElements,\n\t\t\tisFocused,\n\t\t\tonBlur,\n\t\t\tonRefocus,\n\t\t\torientation,\n\t\t\tqa,\n\t\t\t...rest\n\t\t} = this.props;\n\t\t/* eslint-enable @typescript-eslint/no-unused-vars */\n\n\t\tconst dataQa = `${qa || 'generic'}-roving`;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tclassName=\"helpers-roving-tabindex-container\"\n\t\t\t\tdata-qa={dataQa}\n\t\t\t\tonKeyUp={this.handleKeyUp}\n\t\t\t\tref={this.handleRef}\n\t\t\t\trole=\"presentation\"\n\t\t\t\t// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex\n\t\t\t\ttabIndex={-1}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nexport { MrlRovingTabindex };\n"],"names":["getTabbableElements","ref","selector","elements","querySelectorAll","Array","prototype","slice","call","arraysEqual","a","b","length","every","el","i","DEFAULT_ALLOW_DISABLED","DISABLED_EXCLUSION","NESTED_ROVING_EXCLUSION","buildSelector","allowDisabled","hasChildRoving","disabledPart","nestedPart","concat","MrlRovingTabindex","React","Component","constructor","props","_defineProperty","addEventListener","handleFocusOut","event","_this$ref","onBlur","relatedTarget","contains","_this$ref2","querySelector","_this$ref3","_this$props","activeSelector","_this$props$allowDisa","disabledFilter","customActiveElement","queryElement","markedActiveElement","firstRovingElement","unsetTabbableElements","setAttribute","current","getActiveElement","removeAttribute","setActiveElement","focus","direction","itemsLen","currentIndex","indexOf","document","activeElement","directionSum","nextIndex","setElementFocus","forEach","disabledElements","orientation","_document","role","getAttribute","hasMenuOrSelect","e","_document$activeEleme","ignoreElements","allowKeyPress","closest","modifierPressed","ctrlKey","metaKey","shiftKey","knownTabbableElements","allTabbableElements","setElements","isActiveRoving","stopPropagation","key","canUseArrows","setFocusByDirection","handleFocusedLast","handleFocusedFirst","_this$props$onRefocus","_this$props2","onRefocus","_props$allowDisabled","_props$hasChildRoving","componentDidMount","delayMount","setTimeout","mount","componentWillUnmount","removeEventListener","componentDidUpdate","prevProps","_this$props3","_this$props3$allowDis","children","focusWithShortcut","_this$props3$hasChild","isFocused","handleRefocus","_this$ref4","_this$props4","focusOnInit","render","_this$props5","forceUpdate","qa","rest","_objectWithoutProperties","_excluded","dataQa","createElement","_extends","className","onKeyUp","handleKeyUp","handleRef","tabIndex"],"mappings":";;;;AAIA;A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;AACzB,IAAA;AACD,EAAA;;AAEA;AACD;AACA;AACA;AACCyB,EAAAA,MAAMA,GAAgB;AACrB;AACA;AACA,IAAA,IAAAC,YAAA,GAgBI,IAAI,CAACtF,KAAK;MAfCsF,YAAA,CAAdzE,cAAc;MACDyE,YAAA,CAAb/F,aAAa;UACbsF,QAAQ,GAAAS,YAAA,CAART,QAAQ;MACES,YAAA,CAAVlB,UAAU;MACCkB,YAAA,CAAXF,WAAW;MACME,YAAA,CAAjBR,iBAAiB;MACNQ,YAAA,CAAXC,WAAW;MACGD,YAAA,CAAd9F,cAAc;MACA8F,YAAA,CAAdzC,cAAc;MACLyC,YAAA,CAATN,SAAS;MACHM,YAAA,CAANhF,MAAM;MACGgF,YAAA,CAATtB,SAAS;MACEsB,YAAA,CAAXhD,WAAW;UACXkD,EAAE,GAAAF,YAAA,CAAFE,EAAE;AACCC,MAAAA,IAAI,GAAAC,wBAAA,CAAAJ,YAAA,EAAAK,SAAA;AAER;;AAEA,IAAA,IAAMC,MAAM,GAAA,EAAA,CAAAjG,MAAA,CAAM6F,EAAE,IAAI,SAAS,EAAA,SAAA,CAAS;AAE1C,IAAA,oBACC3F,KAAA,CAAAgG,aAAA,CAAA,KAAA,EAAAC,QAAA,KACKL,IAAI,EAAA;AACRM,MAAAA,SAAS,EAAC,mCAAmC;AAC7C,MAAA,SAAA,EAASH,MAAO;MAChBI,OAAO,EAAE,IAAI,CAACC,WAAY;MAC1B7H,GAAG,EAAE,IAAI,CAAC8H,SAAU;AACpB1D,MAAAA,IAAI,EAAC;AACL;AAAA;AACA2D,MAAAA,QAAQ,EAAE;AAAG,KAAA,CAAA,EAEZtB,QACG,CAAC;AAER,EAAA;AACD;;;;"}
|
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.85.0\";"],"names":["TOOLKIT_VERSION"],"mappings":"AAAO,IAAMA,eAAe,GAAG;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
type AvatarKind = (typeof avatarValues.kind)[number];
|
|
3
|
-
type AvatarSize = (typeof avatarValues.size)[number];
|
|
2
|
+
export type AvatarKind = (typeof avatarValues.kind)[number];
|
|
3
|
+
export type AvatarSize = (typeof avatarValues.size)[number];
|
|
4
4
|
interface avatarDefaults {
|
|
5
5
|
kind: AvatarKind;
|
|
6
6
|
size: AvatarSize;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { MrlPopoverProps } from '../../popover';
|
|
3
3
|
export type MrlCalloutPopoverProps = Omit<MrlPopoverProps, 'children' | 'actionState' | 'isSubMenu' | 'triggerRef' | 'kind'>;
|
|
4
|
-
interface MrlCalloutCTA {
|
|
4
|
+
export interface MrlCalloutCTA {
|
|
5
5
|
onClick: () => void;
|
|
6
6
|
dataQa?: string;
|
|
7
7
|
text: string;
|
|
@@ -45,4 +45,3 @@ export interface MrlCalloutProps extends MrlCalloutPopoverProps {
|
|
|
45
45
|
* @returns {React.ReactElement} The MrlCallout component.
|
|
46
46
|
*/
|
|
47
47
|
export declare const MrlCallout: (props: MrlCalloutProps) => React.ReactElement;
|
|
48
|
-
export {};
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { AttrsObject } from '../../../../utils';
|
|
3
|
-
import { CheckboxSelected, CheckboxStates, StaticIconConfig } from '../../constants';
|
|
3
|
+
import { CheckboxInputProps, CheckboxSelected, CheckboxStates, StaticIconConfig } from '../../constants';
|
|
4
4
|
import './MrlCheckbox.global.scss';
|
|
5
|
-
interface MrlCheckboxProps {
|
|
6
|
-
/**
|
|
5
|
+
interface MrlCheckboxProps extends CheckboxInputProps {
|
|
6
|
+
/**
|
|
7
|
+
* Applies additional HTML attributes to the checkbox element
|
|
8
|
+
*
|
|
9
|
+
* @deprecated - use the regular HTML attributes instead. When an attribute is passed both
|
|
10
|
+
* ways, the regular HTML attribute wins.
|
|
11
|
+
*/
|
|
7
12
|
attrs?: AttrsObject;
|
|
8
13
|
/** Additional class to add to the container of the checkbox and label */
|
|
9
14
|
className?: string;
|
|
@@ -21,12 +26,12 @@ interface MrlCheckboxProps {
|
|
|
21
26
|
* Description, additional context text for the user.
|
|
22
27
|
* It can be a string or a React component for custom render.
|
|
23
28
|
* When using a React component it's necessary to add an id to the custom element and
|
|
24
|
-
* pass it to the MrlCheckbox through
|
|
29
|
+
* pass it to the MrlCheckbox through "aria-describedby" to make it accessible
|
|
25
30
|
* to screen readers.
|
|
26
31
|
* Custom description should also implement the disabled state styles
|
|
27
32
|
* for text when the input is disabled or set color: inherit.
|
|
28
33
|
* @example
|
|
29
|
-
* <MrlCheckbox
|
|
34
|
+
* <MrlCheckbox aria-describedby={customId} description={
|
|
30
35
|
* <p id={customId}>description</p>
|
|
31
36
|
* }>
|
|
32
37
|
*/
|
|
@@ -43,5 +48,5 @@ interface MrlCheckboxProps {
|
|
|
43
48
|
* @param {MrlCheckboxProps} props - the component props
|
|
44
49
|
* @returns a checkbox element with an associated label
|
|
45
50
|
*/
|
|
46
|
-
export declare function MrlCheckbox({ attrs, className, description, hasMultilineLabel, state, selected, icon, label, eventId, ...rest }: MrlCheckboxProps): JSX.Element;
|
|
51
|
+
export declare function MrlCheckbox({ attrs, className, description, hasMultilineLabel, state, selected, icon, label, eventId, onChange, ...rest }: MrlCheckboxProps): JSX.Element;
|
|
47
52
|
export {};
|
package/dist/types/components/form/checkbox/MrlCheckboxStandalone/MrlCheckboxStandalone.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { AttrsObject } from '../../../../utils';
|
|
2
|
-
import { CheckboxSelected, CheckboxStates } from '../../constants';
|
|
2
|
+
import { CheckboxInputProps, CheckboxSelected, CheckboxStates } from '../../constants';
|
|
3
3
|
import './MrlCheckboxStandalone.global.scss';
|
|
4
|
-
interface MrlCheckboxStandaloneProps {
|
|
4
|
+
interface MrlCheckboxStandaloneProps extends CheckboxInputProps {
|
|
5
5
|
/**
|
|
6
|
-
* Applies additional HTML attributes to the checkbox element
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
6
|
+
* Applies additional HTML attributes to the checkbox element
|
|
7
|
+
*
|
|
8
|
+
* @deprecated - use the regular HTML attributes instead. When an attribute is passed both
|
|
9
|
+
* ways, the regular HTML attribute wins.
|
|
10
10
|
*/
|
|
11
11
|
attrs?: AttrsObject;
|
|
12
12
|
/** The current state of the checkbox input based on user interactions or permissions */
|
|
13
13
|
state?: CheckboxStates;
|
|
14
14
|
/**
|
|
15
15
|
* Sets what selection state the checkbox is in. The component is controlled: update it from
|
|
16
|
-
* the `onChange` handler
|
|
16
|
+
* the `onChange` handler.
|
|
17
17
|
*/
|
|
18
18
|
selected?: CheckboxSelected;
|
|
19
19
|
/**
|
|
@@ -25,9 +25,11 @@ interface MrlCheckboxStandaloneProps {
|
|
|
25
25
|
/**
|
|
26
26
|
* Input that allows the user to select one or more options from a provided list.
|
|
27
27
|
* Note, this component does not provide out of the box accessibility for ensuring
|
|
28
|
-
* an associated label and must be manually setup during adoption
|
|
28
|
+
* an associated label and must be manually setup during adoption: pass an `id` referenced
|
|
29
|
+
* by a `<label htmlFor>`, or `aria-labelledby` pointing to visible text (a console warning
|
|
30
|
+
* is logged when both are missing).
|
|
29
31
|
* @param {MrlCheckboxStandaloneProps} props - the component props
|
|
30
32
|
* @returns a checkbox element
|
|
31
33
|
*/
|
|
32
|
-
export declare function MrlCheckboxStandalone({ attrs, state, selected, eventId, ...rest }: MrlCheckboxStandaloneProps): JSX.Element;
|
|
34
|
+
export declare function MrlCheckboxStandalone({ attrs, state, selected, eventId, id, onChange, 'aria-labelledby': ariaLabelledby, ...rest }: MrlCheckboxStandaloneProps): JSX.Element;
|
|
33
35
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DSIconType } from '../svg';
|
|
3
|
+
import { DataQa } from '../../utils/dataQa';
|
|
3
4
|
/**
|
|
4
5
|
* This should be used to communciate error information for a specific input
|
|
5
6
|
*/
|
|
@@ -15,6 +16,11 @@ export declare const allowedCheckboxValues: {
|
|
|
15
16
|
};
|
|
16
17
|
export type CheckboxStates = (typeof allowedCheckboxValues.states)[number];
|
|
17
18
|
export type CheckboxSelected = (typeof allowedCheckboxValues.selected)[number];
|
|
19
|
+
/**
|
|
20
|
+
* Native attributes accepted by the checkbox `input`. The omitted ones are driven by the
|
|
21
|
+
* component's own props (`selected`, `state`) or do not apply to the element.
|
|
22
|
+
*/
|
|
23
|
+
export type CheckboxInputProps = Omit<React.ComponentPropsWithoutRef<'input'>, 'type' | 'checked' | 'defaultChecked' | 'disabled' | 'children' | 'className' | 'style'> & DataQa;
|
|
18
24
|
interface CheckboxDefaults {
|
|
19
25
|
selected: CheckboxSelected;
|
|
20
26
|
state: CheckboxStates;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AttrsObject } from '../../../../utils';
|
|
2
2
|
import './MrlTextarea.global.scss';
|
|
3
|
-
type MrlTextareaState = 'default' | 'disabled' | 'error' | 'read-only';
|
|
3
|
+
export type MrlTextareaState = 'default' | 'disabled' | 'error' | 'read-only';
|
|
4
4
|
interface MrlTextareaProps {
|
|
5
5
|
/** Applies additional HTML attributes to the textarea element */
|
|
6
6
|
attrs?: AttrsObject;
|
|
@@ -28,14 +28,14 @@ export type NumCols = 0 | ColSpan;
|
|
|
28
28
|
* offset?: number
|
|
29
29
|
* }
|
|
30
30
|
*/
|
|
31
|
-
type GridClassConfig = {
|
|
31
|
+
export type GridClassConfig = {
|
|
32
32
|
col?: ColSpan;
|
|
33
33
|
offset?: OffsetSpan;
|
|
34
34
|
};
|
|
35
35
|
/**
|
|
36
36
|
* Options to configure the number of columns to span on different screen sizes.
|
|
37
37
|
*/
|
|
38
|
-
type ColumnConfig = ColSpan | 'auto' | GridClassConfig | undefined;
|
|
38
|
+
export type ColumnConfig = ColSpan | 'auto' | GridClassConfig | undefined;
|
|
39
39
|
export interface GridColumns {
|
|
40
40
|
/**
|
|
41
41
|
* Columns that are the same from the smallest of devices to the largest.
|
|
@@ -111,4 +111,3 @@ export type GridBaseProps = Omit<React.ComponentPropsWithoutRef<'div'>, 'role'>
|
|
|
111
111
|
*/
|
|
112
112
|
role?: SafeLayoutRole;
|
|
113
113
|
};
|
|
114
|
-
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export * from './MrlGrid';
|
|
2
2
|
export * from './MrlRow';
|
|
3
3
|
export * from './MrlCol';
|
|
4
|
-
export type { AlignOptions, ColSpan, GridColumns, GutterSizes, JustifyOptions, NumCols, OffsetSpan, SafeLayoutRole } from './constants';
|
|
4
|
+
export type { AlignOptions, ColSpan, ColumnConfig, GridClassConfig, GridColumns, GutterSizes, JustifyOptions, NumCols, OffsetSpan, SafeLayoutRole } from './constants';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
type AriaRelevant = 'additions' | 'all' | 'removals' | 'text' | 'additions text' | undefined;
|
|
2
|
+
export type AriaRelevant = 'additions' | 'all' | 'removals' | 'text' | 'additions text' | undefined;
|
|
3
3
|
export interface MrlLiveRegionProps extends React.HTMLAttributes<HTMLParagraphElement> {
|
|
4
4
|
/** Sets `aria-atomic`: announce the whole region on every change instead of only the changed part. */
|
|
5
5
|
ariaAtomic?: boolean;
|
|
@@ -22,4 +22,3 @@ export interface MrlLiveRegionProps extends React.HTMLAttributes<HTMLParagraphEl
|
|
|
22
22
|
* @returns The live region component.
|
|
23
23
|
*/
|
|
24
24
|
export declare const MrlLiveRegion: ({ ariaAtomic, ariaLive, ariaRelevant, id, srContent, visible, shouldClearContent, ...props }: MrlLiveRegionProps) => React.ReactElement;
|
|
25
|
-
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { MrlLiveRegion } from './MrlLiveRegion';
|
|
1
|
+
export { MrlLiveRegion, type AriaRelevant } from './MrlLiveRegion';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { PortalProps } from '../../portal/MrlPortal';
|
|
3
3
|
import { MenuPosition, MenuAlignment, ActionState, CustomMenuPosition } from '../../menu/constants';
|
|
4
|
-
type RenderPropFn = ({ closeMenu }: {
|
|
4
|
+
export type RenderPropFn = ({ closeMenu }: {
|
|
5
5
|
closeMenu: () => void;
|
|
6
6
|
}) => JSX.Element;
|
|
7
7
|
export interface MrlPopoverProps {
|
|
@@ -140,4 +140,3 @@ export declare function MrlPopover({ alignment, ariaLabel, ariaLabelledBy, child
|
|
|
140
140
|
export declare namespace MrlPopover {
|
|
141
141
|
var componentType: string;
|
|
142
142
|
}
|
|
143
|
-
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { PORTAL_LAYERS } from '../../utils/layers';
|
|
3
|
-
type PortalLayer = (typeof PORTAL_LAYERS)[keyof typeof PORTAL_LAYERS];
|
|
3
|
+
export type PortalLayer = (typeof PORTAL_LAYERS)[keyof typeof PORTAL_LAYERS];
|
|
4
4
|
export interface PortalProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
className?: string;
|
|
@@ -18,4 +18,3 @@ export declare const MRL_PORTAL_ID: "mrl-root-portal";
|
|
|
18
18
|
* @returns MrlPortal component
|
|
19
19
|
*/
|
|
20
20
|
export declare const MrlPortal: ({ children, className, id, layer, ...remainingProps }: PortalProps) => React.ReactElement | null;
|
|
21
|
-
export {};
|
|
@@ -44,7 +44,7 @@ export interface RovingPropTypes {
|
|
|
44
44
|
orientation?: RovingOrientation;
|
|
45
45
|
qa?: string;
|
|
46
46
|
}
|
|
47
|
-
type RovingOrientation = 'horizontal' | 'vertical';
|
|
47
|
+
export type RovingOrientation = 'horizontal' | 'vertical';
|
|
48
48
|
type NavigationDirection = 'forward' | 'back';
|
|
49
49
|
/**
|
|
50
50
|
* Component to create a Roving Tabindex in the DOM
|