@muraldevkit/ui-toolkit 1.27.1 → 1.28.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.
@@ -1,33 +1,16 @@
1
1
  import React from 'react';
2
2
  import { AttrsObject } from '../../../utils';
3
- import { TextHierarchies, TextKinds, TextSizes } from '../constants';
4
- interface CommonProps {
3
+ import { TextSizes } from '../constants';
4
+ interface MrlTextProps {
5
5
  /** Applies additional HTML attributes to the text element */
6
6
  attrs?: AttrsObject;
7
7
  /** Children to be rendered within the text component */
8
8
  children?: React.ReactNode | string;
9
- /** Hierarchy level within the use case and sizing scales */
10
- hierarchy?: TextHierarchies;
9
+ /** Visual size of the text element */
10
+ size?: TextSizes;
11
11
  /** Textual content when it's a static string; if you have nested elements, use children to provide content */
12
12
  text?: string;
13
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
14
  /**
32
15
  * MrlText Component
33
16
  *
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { AttrsObject } from '../../../utils';
3
- import { LevelType, HeadingSizes, TextSizes, TextHierarchies, HeadingKinds } from '../constants';
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: TextHierarchies;
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[];