@lumx/react 3.12.1-alpha.2 → 3.12.1-alpha.4
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/package.json
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
"url": "https://github.com/lumapps/design-system/issues"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@lumx/core": "^3.12.1-alpha.
|
|
10
|
-
"@lumx/icons": "^3.12.1-alpha.
|
|
9
|
+
"@lumx/core": "^3.12.1-alpha.4",
|
|
10
|
+
"@lumx/icons": "^3.12.1-alpha.4",
|
|
11
11
|
"@popperjs/core": "^2.5.4",
|
|
12
12
|
"body-scroll-lock": "^3.1.5",
|
|
13
13
|
"classnames": "^2.3.2",
|
|
@@ -110,5 +110,5 @@
|
|
|
110
110
|
"build:storybook": "storybook build"
|
|
111
111
|
},
|
|
112
112
|
"sideEffects": false,
|
|
113
|
-
"version": "3.12.1-alpha.
|
|
113
|
+
"version": "3.12.1-alpha.4"
|
|
114
114
|
}
|
|
@@ -2,7 +2,9 @@ import {
|
|
|
2
2
|
ColorPalette,
|
|
3
3
|
ColorVariant,
|
|
4
4
|
FlexBox,
|
|
5
|
+
Heading,
|
|
5
6
|
Icon,
|
|
7
|
+
Text,
|
|
6
8
|
Link,
|
|
7
9
|
Typography,
|
|
8
10
|
TypographyInterface,
|
|
@@ -18,6 +20,7 @@ import { CustomLink } from '@lumx/react/stories/utils/CustomLink';
|
|
|
18
20
|
import { withWrapper } from '@lumx/react/stories/decorators/withWrapper';
|
|
19
21
|
import { withThemedBackground } from '@lumx/react/stories/decorators/withThemedBackground';
|
|
20
22
|
import { mdiEarth, mdiFoodApple, mdiPencil } from '@lumx/icons/override/generated';
|
|
23
|
+
import { withNestedProps } from '@lumx/react/stories/decorators/withNestedProps';
|
|
21
24
|
|
|
22
25
|
const linkTypographies = { ...TypographyInterface, ...TypographyTitleCustom };
|
|
23
26
|
|
|
@@ -140,3 +143,33 @@ export const AllColors = {
|
|
|
140
143
|
}),
|
|
141
144
|
],
|
|
142
145
|
};
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Check how link inherit the parent typography & color
|
|
149
|
+
*/
|
|
150
|
+
export const ParentTypographyAndColor = {
|
|
151
|
+
args: {
|
|
152
|
+
children: ['Link', <Icon key="icon" icon={mdiEarth} />, 'with icon'],
|
|
153
|
+
'parent.typography': undefined,
|
|
154
|
+
'parent.color': undefined,
|
|
155
|
+
},
|
|
156
|
+
render: ({ parent: { typography, color }, ...args }: any) => (
|
|
157
|
+
<Text as="p" color={color} typography={typography}>
|
|
158
|
+
<Link {...args} />
|
|
159
|
+
</Text>
|
|
160
|
+
),
|
|
161
|
+
decorators: [
|
|
162
|
+
withNestedProps(),
|
|
163
|
+
withCombinations({
|
|
164
|
+
combinations: {
|
|
165
|
+
sections: { Button: {}, Link: { href: '#' } },
|
|
166
|
+
rows: {
|
|
167
|
+
Default: {},
|
|
168
|
+
'Parent typography=title': { 'parent.typography': 'title' },
|
|
169
|
+
'Parent color=red': { 'parent.color': 'red' },
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
}),
|
|
173
|
+
withWrapper({ orientation: 'horizontal', vAlign: 'space-evenly', wrap: true, gap: 'huge' }, FlexBox),
|
|
174
|
+
],
|
|
175
|
+
};
|
|
@@ -24,14 +24,14 @@ export interface LinkProps extends GenericProps {
|
|
|
24
24
|
isDisabled?: boolean;
|
|
25
25
|
/**
|
|
26
26
|
* Left icon (SVG path).
|
|
27
|
-
* @deprecated
|
|
27
|
+
* @deprecated Instead, simply nest `<Icon />` in the children
|
|
28
28
|
*/
|
|
29
29
|
leftIcon?: string;
|
|
30
30
|
/** Custom react component for the link (can be used to inject react router Link). */
|
|
31
31
|
linkAs?: 'a' | any;
|
|
32
32
|
/**
|
|
33
33
|
* Right icon (SVG path).
|
|
34
|
-
* @deprecated
|
|
34
|
+
* @deprecated Instead, simply nest `<Icon />` in the children
|
|
35
35
|
*/
|
|
36
36
|
rightIcon?: string;
|
|
37
37
|
/** Link target. */
|
|
@@ -94,7 +94,7 @@ export const Link = forwardRef<LinkProps, HTMLAnchorElement | HTMLButtonElement>
|
|
|
94
94
|
{...baseProps}
|
|
95
95
|
className={classNames(
|
|
96
96
|
className,
|
|
97
|
-
handleBasicClasses({ prefix: CLASSNAME, color, colorVariant }),
|
|
97
|
+
handleBasicClasses({ prefix: CLASSNAME, color, colorVariant, hasTypography: !!typography }),
|
|
98
98
|
typography && getTypographyClassName(typography),
|
|
99
99
|
)}
|
|
100
100
|
>
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* File generated when storybook is started. Do not edit directly!
|
|
3
|
-
*/
|
|
4
|
-
export default { title: 'LumX components/link/Link Demos' };
|
|
5
|
-
|
|
6
|
-
export { App as Default } from './default';
|
|
7
|
-
export { App as Implicit } from './implicit';
|
|
8
|
-
export { App as Sizes } from './sizes';
|