@muraldevkit/ui-toolkit 2.4.1 → 2.5.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/README.md +1 -1
- package/dist/components/form/radio/MrlRadioButton/MrlRadioButton.d.ts +46 -0
- package/dist/components/form/radio/MrlRadioButton/index.d.ts +1 -0
- package/dist/components/form/utils.d.ts +12 -0
- package/dist/index.js +1 -1
- package/dist/styles/MrlBlockNotification/global.scss +0 -11
- package/dist/styles/MrlBlockNotification/mixins.scss +0 -28
- package/dist/styles/MrlBlockNotification/module.scss +0 -25
- package/dist/styles/MrlBlockNotification/variables.scss +0 -10
- package/dist/styles/MrlButton/global.scss +0 -20
- package/dist/styles/MrlCheckbox/global.scss +0 -7
- package/dist/styles/MrlCheckbox/module.scss +0 -6
- package/dist/styles/MrlCheckbox/variables.scss +1 -7
- package/dist/styles/MrlCheckboxStandalone/global.scss +0 -13
- package/dist/styles/MrlCheckboxStandalone/module.scss +0 -14
- package/dist/styles/MrlCheckboxStandalone/variables.scss +1 -15
- package/dist/styles/MrlDivider/module.scss +0 -13
- package/dist/styles/MrlFieldset/module.scss +0 -5
- package/dist/styles/MrlLabel/module.scss +0 -11
- package/dist/styles/MrlLabel/variables.scss +0 -9
- package/dist/styles/MrlLabelWithDescription/module.scss +0 -17
- package/dist/styles/MrlLabelWithDescription/variables.scss +0 -7
- package/dist/styles/MrlLink/module.scss +0 -26
- package/dist/styles/MrlModal/global.scss +0 -8
- package/dist/styles/MrlModal/mixins.scss +0 -23
- package/dist/styles/MrlModal/module.scss +0 -17
- package/dist/styles/MrlModal/variables.scss +0 -10
- package/dist/styles/MrlModalContent/module.scss +0 -5
- package/dist/styles/MrlModalFooter/global.scss +0 -2
- package/dist/styles/MrlModalFooter/module.scss +0 -11
- package/dist/styles/MrlModalFooter/variables.scss +0 -5
- package/dist/styles/MrlModalHeader/module.scss +0 -7
- package/dist/styles/MrlModalHeaderNative/module.scss +0 -10
- package/dist/styles/MrlRadioButton/module.scss +8 -0
- package/dist/styles/MrlRadioButtonStandalone/global.scss +0 -6
- package/dist/styles/MrlRadioButtonStandalone/module.scss +2 -11
- package/dist/styles/MrlRadioButtonStandalone/variables.scss +0 -8
- package/dist/styles/MrlSelect/module.scss +0 -43
- package/dist/styles/MrlSelect/variables.scss +1 -6
- package/dist/styles/MrlSelectItem/module.scss +0 -23
- package/dist/styles/MrlSelectItem/variables.scss +0 -10
- package/dist/styles/MrlSelectMenu/module.scss +1 -17
- package/dist/styles/MrlSelectMenu/variables.scss +0 -5
- package/dist/styles/MrlSmartTable/module.scss +0 -5
- package/dist/styles/MrlSvg/module.scss +0 -11
- package/dist/styles/MrlSvgAnimate/module.scss +0 -9
- package/dist/styles/MrlTable/module.scss +0 -5
- package/dist/styles/MrlTableBody/module.scss +0 -6
- package/dist/styles/MrlTableCell/module.scss +0 -5
- package/dist/styles/MrlTableColumn/module.scss +0 -8
- package/dist/styles/MrlTableEmptyState/module.scss +0 -5
- package/dist/styles/MrlTableHeader/module.scss +0 -5
- package/dist/styles/MrlTableRow/module.scss +0 -6
- package/dist/styles/MrlText/module.scss +0 -6
- package/dist/styles/MrlText/variables.scss +0 -8
- package/dist/styles/MrlTextHeading/module.scss +0 -14
- package/dist/styles/MrlTextHeading/variables.scss +0 -19
- package/dist/styles/MrlTextInput/module.scss +0 -29
- package/dist/styles/MrlTextInput/variables.scss +0 -1
- package/dist/styles/MrlTextarea/global.scss +1 -8
- package/dist/styles/MrlTextarea/module.scss +1 -8
- package/dist/styles/MrlTooltipContent/global.scss +1 -33
- package/dist/styles/MrlTooltipContent/variables.scss +0 -5
- package/dist/styles/button/global.scss +0 -29
- package/dist/styles/button/mixins.scss +0 -31
- package/dist/styles/button/variables.scss +2 -61
- package/dist/styles/divider/mixins.scss +0 -41
- package/dist/styles/divider/variables.scss +0 -12
- package/dist/styles/form/global.scss +0 -56
- package/dist/styles/form/variables.scss +0 -22
- package/dist/styles/grid/variables.scss +0 -11
- package/dist/styles/modal/variables.scss +0 -14
- package/dist/styles/svg/variables.scss +0 -8
- package/dist/styles/table/global.scss +0 -8
- package/dist/styles/table/variables.scss +0 -5
- package/dist/styles/tooltip/mixins.scss +0 -11
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StaticIconConfig } from '../../constants';
|
|
3
|
+
interface MrlRadioButtonProps extends React.ComponentPropsWithoutRef<'input'> {
|
|
4
|
+
/** Additional class to add to the container element */
|
|
5
|
+
className?: string;
|
|
6
|
+
/** Adjusts the styles of the label, icon and description when the label is multiline */
|
|
7
|
+
hasMultilineLabel?: boolean;
|
|
8
|
+
/** The text to display as the radio button's label */
|
|
9
|
+
label: string;
|
|
10
|
+
/** The radio button's name that will group it with others in a radio group */
|
|
11
|
+
name: string;
|
|
12
|
+
/** The radio button's value */
|
|
13
|
+
value: string;
|
|
14
|
+
/** Indicates if the radio button is disabled */
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/** Indicates if the radio button has an error */
|
|
17
|
+
hasError?: boolean;
|
|
18
|
+
/** Leading label icon */
|
|
19
|
+
icon?: StaticIconConfig;
|
|
20
|
+
/** Styles applied to the container element */
|
|
21
|
+
style?: React.CSSProperties;
|
|
22
|
+
/**
|
|
23
|
+
* Description, additional context text for the user.
|
|
24
|
+
* It can be a string or a React component for custom render.
|
|
25
|
+
* When using a React component it's necessary to add an id to the custom element and
|
|
26
|
+
* pass it to the MrlRadioButton through "aria-describedby" to make it accessible
|
|
27
|
+
* to screen readers.
|
|
28
|
+
* Custom description should also implement the disabled state styles
|
|
29
|
+
* for text when the input is disabled or set color: inherit.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* <MrlRadioButton aria-describedby={customId} description={
|
|
33
|
+
* <p id={customId}>description</p>
|
|
34
|
+
* }>
|
|
35
|
+
*/
|
|
36
|
+
description?: string | React.ReactNode;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Form element with an associated text label and description that allows the user to select one
|
|
40
|
+
* option from a provided list
|
|
41
|
+
*
|
|
42
|
+
* @param {MrlRadioButtonProps} props - the component props
|
|
43
|
+
* @returns an input with type "radio" with an associated label
|
|
44
|
+
*/
|
|
45
|
+
export declare function MrlRadioButton({ className, description, hasMultilineLabel, name, value, icon, disabled, hasError, label, style, ...rest }: MrlRadioButtonProps): JSX.Element;
|
|
46
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MrlRadioButton';
|
|
@@ -79,4 +79,16 @@ type CallbackType = (_debounce: number) => void;
|
|
|
79
79
|
* @todo - 4969 investigate combining this debounce function with the modal debounce function
|
|
80
80
|
*/
|
|
81
81
|
export declare const debounce: (func: () => void, timeout: number | undefined, debounce: DebounceType, callback: CallbackType) => (() => void);
|
|
82
|
+
type GetAriaDescribedByReturn = {
|
|
83
|
+
['aria-describedby']?: string;
|
|
84
|
+
} | {
|
|
85
|
+
['aria-describedby']: string;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Generates the 'aria-describedby' attribute from multiple ids
|
|
89
|
+
*
|
|
90
|
+
* @param {Array<string | undefined>} args ids
|
|
91
|
+
* @returns {GetAriaDescribedByReturn} an object with aria-describedby
|
|
92
|
+
*/
|
|
93
|
+
export declare function getDescribedby(...args: Array<string | undefined>): GetAriaDescribedByReturn;
|
|
82
94
|
export {};
|