@muraldevkit/ui-toolkit 1.11.0 → 1.12.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/components/index.d.ts +1 -0
- package/dist/components/text/MrlText/MrlText.d.ts +38 -0
- package/dist/components/text/MrlText/index.d.ts +1 -0
- package/dist/components/text/MrlTextHeading/MrlTextHeading.d.ts +31 -0
- package/dist/components/text/MrlTextHeading/index.d.ts +1 -0
- package/dist/components/text/constants.d.ts +44 -0
- package/dist/components/text/index.d.ts +2 -0
- package/dist/index.js +1 -1
- package/dist/styles/MrlText/module.scss +14 -0
- package/dist/styles/MrlText/variables.scss +39 -0
- package/dist/styles/MrlTextHeading/module.scss +35 -0
- package/dist/styles/MrlTextHeading/variables.scss +53 -0
- package/package.json +1 -1
|
@@ -0,0 +1,38 @@
|
|
|
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 {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MrlText';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AttrsObject } from '../../../utils';
|
|
3
|
+
import { LevelType, HeadingSizes, TextSizes, TextHierarchies, HeadingKinds } from '../constants';
|
|
4
|
+
interface MrlTextHeadingProps {
|
|
5
|
+
/** Applies additional HTML attributes to the text element */
|
|
6
|
+
attrs?: AttrsObject;
|
|
7
|
+
/** Children to be rendered within the text heading component */
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
/** Set the semantic level of the heading based on its usage in the page hierarchy */
|
|
10
|
+
level?: LevelType;
|
|
11
|
+
/** Visual styling use case for the heading */
|
|
12
|
+
kind?: HeadingKinds;
|
|
13
|
+
/**
|
|
14
|
+
* Visual size of the heading
|
|
15
|
+
* xsmall and xxsmall are only supported when kind="title"
|
|
16
|
+
*/
|
|
17
|
+
size?: HeadingSizes | TextSizes;
|
|
18
|
+
/** Clear and concise description of the content that the heading describes */
|
|
19
|
+
text?: string;
|
|
20
|
+
/** Hierarchy level within the use case and sizing scales */
|
|
21
|
+
hierarchy?: TextHierarchies;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* MuralTextHeading component
|
|
25
|
+
* Used for creating semantic headings within a page
|
|
26
|
+
*
|
|
27
|
+
* @param {MrlTextHeadingProps} props - MrlTextHeading component props
|
|
28
|
+
* @returns a heading element
|
|
29
|
+
*/
|
|
30
|
+
export declare function MrlTextHeading({ attrs, children, hierarchy, kind, level, size, text }: MrlTextHeadingProps): JSX.Element;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MrlTextHeading';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { AttrsObject } from '../../utils';
|
|
2
|
+
export type TextSizes = 'xxsmall' | 'xsmall' | 'small' | 'medium' | 'large';
|
|
3
|
+
export type TextHierarchies = 'primary' | 'secondary';
|
|
4
|
+
export type TextKinds = 'default' | 'body' | 'meta' | 'supporting';
|
|
5
|
+
export interface TextDefaults {
|
|
6
|
+
attrs: AttrsObject;
|
|
7
|
+
hierarchy: TextHierarchies;
|
|
8
|
+
size: TextSizes;
|
|
9
|
+
kind: TextKinds;
|
|
10
|
+
}
|
|
11
|
+
export declare const textAllowedValues: {
|
|
12
|
+
hierarchy: string[];
|
|
13
|
+
kind: string[];
|
|
14
|
+
sizes: string[];
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Default values for props on the Text component;
|
|
18
|
+
* Shared between the component and Storybook
|
|
19
|
+
*/
|
|
20
|
+
export declare const textDefaults: TextDefaults;
|
|
21
|
+
export type LevelType = '1' | '2' | '3' | '4' | '5' | '6';
|
|
22
|
+
export type HeadingKinds = 'poster' | 'display' | 'headline' | 'title';
|
|
23
|
+
export type HeadingSizes = 'small' | 'medium' | 'large';
|
|
24
|
+
export interface HeadingDefaults {
|
|
25
|
+
attrs: AttrsObject;
|
|
26
|
+
hierarchy: TextHierarchies;
|
|
27
|
+
kind: HeadingKinds;
|
|
28
|
+
level: LevelType;
|
|
29
|
+
size: HeadingSizes | TextSizes;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Defines all of classes allowed for the type attribute;
|
|
33
|
+
* used for Storybook and testing
|
|
34
|
+
*/
|
|
35
|
+
export declare const headingAllowedValues: {
|
|
36
|
+
kinds: string[];
|
|
37
|
+
level: string[];
|
|
38
|
+
sizes: string[];
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Default values for props on the Text component;
|
|
42
|
+
* Shared between the component and Storybook
|
|
43
|
+
*/
|
|
44
|
+
export declare const headingDefaults: HeadingDefaults;
|