@muraldevkit/ui-toolkit 1.27.1 → 1.29.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/index.js +2 -1
- package/dist/index.js.LICENSE.txt +8 -0
- package/dist/src/components/text/MrlText/MrlText.d.ts +21 -0
- package/dist/{components → src/components}/text/MrlTextHeading/MrlTextHeading.d.ts +2 -3
- package/dist/{components → src/components}/text/constants.d.ts +3 -7
- package/dist/src/hooks/index.d.ts +1 -0
- package/dist/src/hooks/useVirtualKeyboard/index.d.ts +1 -0
- package/dist/src/hooks/useVirtualKeyboard/useVirtualKeyboard.d.ts +24 -0
- package/dist/{index.d.ts → src/index.d.ts} +1 -0
- package/dist/{utils → src/utils}/index.d.ts +1 -0
- package/dist/src/utils/scrollToElementWithLabel/index.d.ts +1 -0
- package/dist/src/utils/scrollToElementWithLabel/scrollToElementWithLabel.d.ts +6 -0
- package/dist/src/utils/setAttributes/setAttributes.test.d.ts +1 -0
- package/dist/styles/MrlModal/global.scss +3 -5
- package/dist/styles/MrlText/variables.scss +0 -17
- package/dist/tests/mocks/patchGetBoundingRect.d.ts +7 -0
- package/package.json +1 -1
- package/dist/components/text/MrlText/MrlText.d.ts +0 -38
- /package/dist/{components → src/components}/button/MrlAnimatedIconButton/MrlAnimatedIconButton.d.ts +0 -0
- /package/dist/{components → src/components}/button/MrlAnimatedIconButton/index.d.ts +0 -0
- /package/dist/{components → src/components}/button/MrlButton/MrlButton.d.ts +0 -0
- /package/dist/{components → src/components}/button/MrlButton/index.d.ts +0 -0
- /package/dist/{components → src/components}/button/MrlIconButton/MrlIconButton.d.ts +0 -0
- /package/dist/{components → src/components}/button/MrlIconButton/index.d.ts +0 -0
- /package/dist/{components → src/components}/button/constants.d.ts +0 -0
- /package/dist/{components → src/components}/button/helpers.d.ts +0 -0
- /package/dist/{components → src/components}/button/index.d.ts +0 -0
- /package/dist/{components → src/components}/divider/MrlDivider/MrlDivider.d.ts +0 -0
- /package/dist/{components → src/components}/divider/MrlDivider/index.d.ts +0 -0
- /package/dist/{components → src/components}/divider/constants.d.ts +0 -0
- /package/dist/{components → src/components}/divider/index.d.ts +0 -0
- /package/dist/{components → src/components}/focus-trap/MrlFocusTrap/MrlFocusTrap.d.ts +0 -0
- /package/dist/{components → src/components}/focus-trap/MrlFocusTrap/index.d.ts +0 -0
- /package/dist/{components → src/components}/focus-trap/index.d.ts +0 -0
- /package/dist/{components → src/components}/form/checkbox/MrlCheckbox/MrlCheckbox.d.ts +0 -0
- /package/dist/{components → src/components}/form/checkbox/MrlCheckbox/index.d.ts +0 -0
- /package/dist/{components → src/components}/form/checkbox/MrlCheckboxStandalone/MrlCheckboxStandalone.d.ts +0 -0
- /package/dist/{components → src/components}/form/checkbox/MrlCheckboxStandalone/index.d.ts +0 -0
- /package/dist/{components → src/components}/form/constants.d.ts +0 -0
- /package/dist/{components → src/components}/form/fieldset/MrlFieldset/MrlFieldset.d.ts +0 -0
- /package/dist/{components → src/components}/form/fieldset/MrlFieldset/index.d.ts +0 -0
- /package/dist/{components → src/components}/form/index.d.ts +0 -0
- /package/dist/{components → src/components}/form/label/MrlLabel/MrlLabel.d.ts +0 -0
- /package/dist/{components → src/components}/form/label/MrlLabel/index.d.ts +0 -0
- /package/dist/{components → src/components}/form/select/MrlSelect/MrlSelect.d.ts +0 -0
- /package/dist/{components → src/components}/form/select/MrlSelect/index.d.ts +0 -0
- /package/dist/{components → src/components}/form/select/MrlSelectItem/MrlSelectItem.d.ts +0 -0
- /package/dist/{components → src/components}/form/select/MrlSelectItem/index.d.ts +0 -0
- /package/dist/{components → src/components}/form/select/MrlSelectMenu/MrlSelectMenu.d.ts +0 -0
- /package/dist/{components → src/components}/form/select/MrlSelectMenu/index.d.ts +0 -0
- /package/dist/{components → src/components}/form/select/context/SelectContext.d.ts +0 -0
- /package/dist/{components → src/components}/form/select/index.d.ts +0 -0
- /package/dist/{components → src/components}/form/text-input/MrlTextInput/MrlTextInput.d.ts +0 -0
- /package/dist/{components → src/components}/form/text-input/MrlTextInput/MrlTextInputRightIcon.d.ts +0 -0
- /package/dist/{components → src/components}/form/text-input/MrlTextInput/index.d.ts +0 -0
- /package/dist/{components → src/components}/form/text-input/MrlTextInput/useActiveColor.d.ts +0 -0
- /package/dist/{components → src/components}/form/textarea/MrlTextarea/MrlTextarea.d.ts +0 -0
- /package/dist/{components → src/components}/form/textarea/MrlTextarea/index.d.ts +0 -0
- /package/dist/{components → src/components}/form/utils.d.ts +0 -0
- /package/dist/{components → src/components}/index.d.ts +0 -0
- /package/dist/{components → src/components}/link/MrlLink/MrlLink.d.ts +0 -0
- /package/dist/{components → src/components}/link/constants.d.ts +0 -0
- /package/dist/{components → src/components}/link/index.d.ts +0 -0
- /package/dist/{components → src/components}/modal/MrlModal/index.d.ts +0 -0
- /package/dist/{components → src/components}/modal/MrlModalContent/index.d.ts +0 -0
- /package/dist/{components → src/components}/modal/MrlModalFooter/index.d.ts +0 -0
- /package/dist/{components → src/components}/modal/MrlModalHeader/index.d.ts +0 -0
- /package/dist/{components → src/components}/modal/MrlModalHeaderNative/index.d.ts +0 -0
- /package/dist/{components → src/components}/modal/constants.d.ts +0 -0
- /package/dist/{components → src/components}/modal/demo/ModalWithDevices.d.ts +0 -0
- /package/dist/{components → src/components}/modal/demo/ModalWithTriggerDemo.d.ts +0 -0
- /package/dist/{components → src/components}/modal/index.d.ts +0 -0
- /package/dist/{components → src/components}/notification/MrlBlockNotification/MrlBlockNotification.d.ts +0 -0
- /package/dist/{components → src/components}/notification/MrlBlockNotification/index.d.ts +0 -0
- /package/dist/{components → src/components}/notification/constants.d.ts +0 -0
- /package/dist/{components → src/components}/notification/index.d.ts +0 -0
- /package/dist/{components → src/components}/svg/MrlSvg/MrlSvg.d.ts +0 -0
- /package/dist/{components → src/components}/svg/MrlSvg/index.d.ts +0 -0
- /package/dist/{components → src/components}/svg/MrlSvgAnimate/MrlSvgAnimate.d.ts +0 -0
- /package/dist/{components → src/components}/svg/MrlSvgAnimate/index.d.ts +0 -0
- /package/dist/{components → src/components}/svg/config.d.ts +0 -0
- /package/dist/{components → src/components}/svg/constants.d.ts +0 -0
- /package/dist/{components → src/components}/svg/index.d.ts +0 -0
- /package/dist/{components → src/components}/text/MrlText/index.d.ts +0 -0
- /package/dist/{components → src/components}/text/MrlTextHeading/index.d.ts +0 -0
- /package/dist/{components → src/components}/text/index.d.ts +0 -0
- /package/dist/{components → src/components}/tooltip/MrlTooltip/MrlTooltip.d.ts +0 -0
- /package/dist/{components → src/components}/tooltip/MrlTooltip/index.d.ts +0 -0
- /package/dist/{components → src/components}/tooltip/MrlTooltipContent/MrlTooltipContent.d.ts +0 -0
- /package/dist/{components → src/components}/tooltip/MrlTooltipContent/index.d.ts +0 -0
- /package/dist/{components → src/components}/tooltip/constants.d.ts +0 -0
- /package/dist/{components → src/components}/tooltip/index.d.ts +0 -0
- /package/dist/{components → src/components}/tooltip/utils.d.ts +0 -0
- /package/dist/{contexts → src/contexts}/MrlDeviceProvider/MrlDeviceProvider.d.ts +0 -0
- /package/dist/{contexts → src/contexts}/MrlDeviceProvider/index.d.ts +0 -0
- /package/dist/{contexts → src/contexts}/index.d.ts +0 -0
- /package/dist/{utils → src/utils}/checkInvalidAttributes/index.d.ts +0 -0
- /package/dist/{utils → src/utils}/commonProps/index.d.ts +0 -0
- /package/dist/{utils → src/utils}/getCamelCase/getCamelCase.d.ts +0 -0
- /package/dist/{utils → src/utils}/getCamelCase/getCamelCase.test.d.ts +0 -0
- /package/dist/{utils → src/utils}/getCamelCase/index.d.ts +0 -0
- /package/dist/{utils → src/utils}/isElementScrollable/index.d.ts +0 -0
- /package/dist/{utils → src/utils}/isObject/index.d.ts +0 -0
- /package/dist/{utils → src/utils}/isObject/isObject.d.ts +0 -0
- /package/dist/{utils → src/utils}/isObject/isObject.test.d.ts +0 -0
- /package/dist/{utils → src/utils}/noop/index.d.ts +0 -0
- /package/dist/{utils/setAttributes/setAttributes.test.d.ts → src/utils/scrollToElementWithLabel/scrollToElementWithLabel.test.d.ts} +0 -0
- /package/dist/{utils → src/utils}/setAttributes/index.d.ts +0 -0
- /package/dist/{utils → src/utils}/setAttributes/setAttributes.d.ts +0 -0
- /package/dist/{utils → src/utils}/trapFocus/index.d.ts +0 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Lodash <https://lodash.com/>
|
|
4
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
5
|
+
* Released under MIT license <https://lodash.com/license>
|
|
6
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
7
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
8
|
+
*/
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AttrsObject } from '../../../utils';
|
|
3
|
+
import { TextSizes } from '../constants';
|
|
4
|
+
interface MrlTextProps {
|
|
5
|
+
/** Applies additional HTML attributes to the text element */
|
|
6
|
+
attrs?: AttrsObject;
|
|
7
|
+
/** Children to be rendered within the text component */
|
|
8
|
+
children?: React.ReactNode | string;
|
|
9
|
+
/** Visual size of the text element */
|
|
10
|
+
size?: TextSizes;
|
|
11
|
+
/** Textual content when it's a static string; if you have nested elements, use children to provide content */
|
|
12
|
+
text?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* MrlText Component
|
|
16
|
+
*
|
|
17
|
+
* @param {MrlTextProps} props - MrlText component props
|
|
18
|
+
* @returns a paragraph element
|
|
19
|
+
*/
|
|
20
|
+
export declare function MrlText(props: MrlTextProps): JSX.Element;
|
|
21
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AttrsObject } from '../../../utils';
|
|
3
|
-
import { LevelType, HeadingSizes, TextSizes,
|
|
3
|
+
import { LevelType, HeadingHierarchies, HeadingSizes, TextSizes, HeadingKinds } from '../constants';
|
|
4
4
|
interface MrlTextHeadingProps {
|
|
5
5
|
/** Applies additional HTML attributes to the text element */
|
|
6
6
|
attrs?: AttrsObject;
|
|
@@ -16,9 +16,8 @@ interface MrlTextHeadingProps {
|
|
|
16
16
|
*/
|
|
17
17
|
size?: HeadingSizes | TextSizes;
|
|
18
18
|
/** Clear and concise description of the content that the heading describes */
|
|
19
|
+
hierarchy?: HeadingHierarchies;
|
|
19
20
|
text?: string;
|
|
20
|
-
/** Hierarchy level within the use case and sizing scales */
|
|
21
|
-
hierarchy?: TextHierarchies;
|
|
22
21
|
}
|
|
23
22
|
/**
|
|
24
23
|
* MuralTextHeading component
|
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
import { AttrsObject } from '../../utils';
|
|
2
2
|
export type TextSizes = 'xxsmall' | 'xsmall' | 'small' | 'medium' | 'large';
|
|
3
|
-
export type TextHierarchies = 'primary' | 'secondary';
|
|
4
|
-
export type TextKinds = 'default' | 'body' | 'meta' | 'supporting';
|
|
5
3
|
export interface TextDefaults {
|
|
6
4
|
attrs: AttrsObject;
|
|
7
|
-
hierarchy: TextHierarchies;
|
|
8
5
|
size: TextSizes;
|
|
9
|
-
kind: TextKinds;
|
|
10
6
|
}
|
|
11
7
|
export declare const textAllowedValues: {
|
|
12
|
-
hierarchy: string[];
|
|
13
|
-
kind: string[];
|
|
14
8
|
sizes: string[];
|
|
15
9
|
};
|
|
16
10
|
/**
|
|
@@ -21,9 +15,10 @@ export declare const textDefaults: TextDefaults;
|
|
|
21
15
|
export type LevelType = '1' | '2' | '3' | '4' | '5' | '6';
|
|
22
16
|
export type HeadingKinds = 'poster' | 'display' | 'headline' | 'title';
|
|
23
17
|
export type HeadingSizes = 'small' | 'medium' | 'large';
|
|
18
|
+
export type HeadingHierarchies = 'primary' | 'secondary';
|
|
24
19
|
export interface HeadingDefaults {
|
|
25
20
|
attrs: AttrsObject;
|
|
26
|
-
hierarchy:
|
|
21
|
+
hierarchy: HeadingHierarchies;
|
|
27
22
|
kind: HeadingKinds;
|
|
28
23
|
level: LevelType;
|
|
29
24
|
size: HeadingSizes | TextSizes;
|
|
@@ -33,6 +28,7 @@ export interface HeadingDefaults {
|
|
|
33
28
|
* used for Storybook and testing
|
|
34
29
|
*/
|
|
35
30
|
export declare const headingAllowedValues: {
|
|
31
|
+
hierarchy: string[];
|
|
36
32
|
kinds: string[];
|
|
37
33
|
level: string[];
|
|
38
34
|
sizes: string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useVirtualKeyboard';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useVirtualKeyboard';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom event name for the virtual keyboard.
|
|
3
|
+
*/
|
|
4
|
+
export declare const MRL_VIRTUAL_KEYBOARD_EVENT_NAME = "mrl-virtual-keyboard";
|
|
5
|
+
/**
|
|
6
|
+
* Virtual keyboard event with the keyboard height information.
|
|
7
|
+
*/
|
|
8
|
+
export type MrlVirtualKeyboardEvent = CustomEvent<{
|
|
9
|
+
height: number;
|
|
10
|
+
}>;
|
|
11
|
+
/**
|
|
12
|
+
* Utility function to dispatch MrlKeyboardEvent from consumer
|
|
13
|
+
*
|
|
14
|
+
* @param height the height of the virtual keyboard, 0 if closed
|
|
15
|
+
*/
|
|
16
|
+
export declare function dispatchMrlKeyboardEvent(height: number): void;
|
|
17
|
+
/**
|
|
18
|
+
* Hook to access the virtual keyboard height
|
|
19
|
+
*
|
|
20
|
+
* @param disabled If disabled will always return 0
|
|
21
|
+
* @param content If a content is passed, this hook will return the height of the overlap between content and keyboard
|
|
22
|
+
* @returns virtual keyboard height or 0 if there isn't any.
|
|
23
|
+
*/
|
|
24
|
+
export declare function useVirtualKeyboard(disabled: boolean, content?: HTMLElement | null): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { scrollToElementWithLabel } from './scrollToElementWithLabel';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -16,11 +16,9 @@
|
|
|
16
16
|
|
|
17
17
|
.mrl-native-modal,
|
|
18
18
|
.mrl-display-modal {
|
|
19
|
-
max-height
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
calc(100vh - var(--mrl-spacing-09) - var(--mrl-spacing-08))
|
|
23
|
-
);
|
|
19
|
+
height: min(var(--mrl-modal-max-height), 100vh - var(--mrl-spacing-09) - var(--mrl-spacing-08));
|
|
20
|
+
margin-bottom: initial;
|
|
21
|
+
max-height: initial;
|
|
24
22
|
}
|
|
25
23
|
}
|
|
26
24
|
|
|
@@ -20,20 +20,3 @@
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
|
|
24
|
-
.MrlText--secondary {
|
|
25
|
-
--mrl-text-weight: var(--mrl-type-weight-text-secondary);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.MrlText--body {
|
|
29
|
-
--mrl-text-height: var(--mrl-type-line-height-text);
|
|
30
|
-
--mrl-text-weight: var(--mrl-type-weight-text);
|
|
31
|
-
--mrl-text-size: var(--mrl-type-size-text-xsmall);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.MrlText--meta,
|
|
35
|
-
.MrlText--supporting {
|
|
36
|
-
--mrl-text-height: var(--mrl-type-line-height-text);
|
|
37
|
-
--mrl-text-weight: var(--mrl-type-weight-title-secondary);
|
|
38
|
-
--mrl-text-size: var(--mrl-type-size-text-xxsmall);
|
|
39
|
-
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* getBoundingRect is not properly implemented in JSDom (it returns always 0). This function allows to set a hardcoded response for it.
|
|
3
|
+
*
|
|
4
|
+
* @param element the DOM to be patched
|
|
5
|
+
* @param patch a DOMReact to be returned by getBoundingReact
|
|
6
|
+
*/
|
|
7
|
+
export declare function patchGetBoundingRect(element: HTMLElement, patch: Partial<DOMRect>): void;
|
package/package.json
CHANGED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { AttrsObject } from '../../../utils';
|
|
3
|
-
import { TextHierarchies, TextKinds, TextSizes } from '../constants';
|
|
4
|
-
interface CommonProps {
|
|
5
|
-
/** Applies additional HTML attributes to the text element */
|
|
6
|
-
attrs?: AttrsObject;
|
|
7
|
-
/** Children to be rendered within the text component */
|
|
8
|
-
children?: React.ReactNode | string;
|
|
9
|
-
/** Hierarchy level within the use case and sizing scales */
|
|
10
|
-
hierarchy?: TextHierarchies;
|
|
11
|
-
/** Textual content when it's a static string; if you have nested elements, use children to provide content */
|
|
12
|
-
text?: string;
|
|
13
|
-
}
|
|
14
|
-
interface DefaultKindWithSize extends CommonProps {
|
|
15
|
-
/**
|
|
16
|
-
* Visual kind of the text
|
|
17
|
-
* If the value is default it allows to change the "size" prop
|
|
18
|
-
*/
|
|
19
|
-
kind: 'default';
|
|
20
|
-
/** Visual size of the text, only applies if kind="default" */
|
|
21
|
-
size: TextSizes;
|
|
22
|
-
}
|
|
23
|
-
interface KindWithoutSize extends CommonProps {
|
|
24
|
-
/**
|
|
25
|
-
* Visual kind of the text
|
|
26
|
-
* If the value is default it allows to change the "size" prop
|
|
27
|
-
*/
|
|
28
|
-
kind: Exclude<TextKinds, 'default'>;
|
|
29
|
-
}
|
|
30
|
-
type MrlTextProps = DefaultKindWithSize | KindWithoutSize;
|
|
31
|
-
/**
|
|
32
|
-
* MrlText Component
|
|
33
|
-
*
|
|
34
|
-
* @param {MrlTextProps} props - MrlText component props
|
|
35
|
-
* @returns a paragraph element
|
|
36
|
-
*/
|
|
37
|
-
export declare function MrlText(props: MrlTextProps): JSX.Element;
|
|
38
|
-
export {};
|
/package/dist/{components → src/components}/button/MrlAnimatedIconButton/MrlAnimatedIconButton.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/{components → src/components}/form/text-input/MrlTextInput/MrlTextInputRightIcon.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
/package/dist/{components → src/components}/form/text-input/MrlTextInput/useActiveColor.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/{components → src/components}/tooltip/MrlTooltipContent/MrlTooltipContent.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|