@muraldevkit/ui-toolkit 1.5.2 → 1.6.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 +3 -2
- package/dist/components/index.d.ts +3 -2
- package/dist/components/link/constants.d.ts +18 -0
- package/dist/components/link/index.d.ts +39 -0
- package/dist/index.js +1 -1
- package/dist/src/components/link/link.module.scss +74 -0
- package/dist/utils/setAttributes/setAttributes.d.ts +1 -1
- package/package.json +7 -2
package/README.md
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const allowedValues: {
|
|
2
|
+
colors: readonly ["default", "mono", "inverse"];
|
|
3
|
+
sizes: readonly ["default", "large", "medium", "small", "xsmall"];
|
|
4
|
+
targets: readonly ["_blank", "_parent", "_top", "_self"];
|
|
5
|
+
};
|
|
6
|
+
export type LinkColor = (typeof allowedValues.colors)[number];
|
|
7
|
+
export type LinkSize = (typeof allowedValues.sizes)[number];
|
|
8
|
+
export type LinkTargetType = (typeof allowedValues.targets)[number];
|
|
9
|
+
export interface LinkDefaults {
|
|
10
|
+
color: LinkColor;
|
|
11
|
+
size: LinkSize;
|
|
12
|
+
target: LinkTargetType;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Default values for props on the Link component;
|
|
16
|
+
* Shared between the component and Storybook
|
|
17
|
+
*/
|
|
18
|
+
export declare const defaults: LinkDefaults;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { LinkTargetType, LinkColor, LinkSize } from './constants';
|
|
3
|
+
import { AttrsObject } from '../../utils';
|
|
4
|
+
export interface MrlLinkProptypes {
|
|
5
|
+
/** The textual label describing the link's purpose */
|
|
6
|
+
text: string;
|
|
7
|
+
/** Specifies where to redirect the linked document */
|
|
8
|
+
href: string;
|
|
9
|
+
/** Specifies how to open the linked document */
|
|
10
|
+
target?: LinkTargetType;
|
|
11
|
+
/**
|
|
12
|
+
* Color scheme to use based on the link's container background
|
|
13
|
+
* - default: most use cases
|
|
14
|
+
* - mono: use on colored/saturated backgrounds (e.g. warning notifications)
|
|
15
|
+
* - inverse: use on dark backgrounds
|
|
16
|
+
*/
|
|
17
|
+
color?: LinkColor;
|
|
18
|
+
/**
|
|
19
|
+
* Allows developers to chose a specific font-size for the link. By default,
|
|
20
|
+
* it will inherit the font-size of its parent/surrounding text.
|
|
21
|
+
*/
|
|
22
|
+
size?: LinkSize;
|
|
23
|
+
/**
|
|
24
|
+
* Applies additional HTML attributes to the nested anchor (`a`) element.
|
|
25
|
+
* Example: `attrs='{ "aria-label": "Special message for screen reader users" }'`
|
|
26
|
+
*/
|
|
27
|
+
attrs?: AttrsObject;
|
|
28
|
+
/**
|
|
29
|
+
* classes to apply to the component
|
|
30
|
+
*/
|
|
31
|
+
className?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Renders a link component
|
|
35
|
+
*
|
|
36
|
+
* @param {MrlLinkProptypes} props the props for your MrlLink
|
|
37
|
+
* @returns {React.ReactElement} an a element containing the text you pass
|
|
38
|
+
*/
|
|
39
|
+
export declare const MrlLink: ({ target, className, color, size, href, attrs, text }: MrlLinkProptypes) => React.ReactElement;
|