@lumx/react 3.12.1-alpha.3 → 3.12.1-alpha.5
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.5",
|
|
10
|
+
"@lumx/icons": "^3.12.1-alpha.5",
|
|
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.5"
|
|
114
114
|
}
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
ColorVariant,
|
|
4
4
|
FlexBox,
|
|
5
5
|
Icon,
|
|
6
|
+
Text,
|
|
6
7
|
Link,
|
|
7
8
|
Typography,
|
|
8
9
|
TypographyInterface,
|
|
@@ -18,6 +19,7 @@ import { CustomLink } from '@lumx/react/stories/utils/CustomLink';
|
|
|
18
19
|
import { withWrapper } from '@lumx/react/stories/decorators/withWrapper';
|
|
19
20
|
import { withThemedBackground } from '@lumx/react/stories/decorators/withThemedBackground';
|
|
20
21
|
import { mdiEarth, mdiFoodApple, mdiPencil } from '@lumx/icons/override/generated';
|
|
22
|
+
import { withNestedProps } from '@lumx/react/stories/decorators/withNestedProps';
|
|
21
23
|
|
|
22
24
|
const linkTypographies = { ...TypographyInterface, ...TypographyTitleCustom };
|
|
23
25
|
|
|
@@ -140,3 +142,33 @@ export const AllColors = {
|
|
|
140
142
|
}),
|
|
141
143
|
],
|
|
142
144
|
};
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Check how link inherit the parent typography & color
|
|
148
|
+
*/
|
|
149
|
+
export const ParentTypographyAndColor = {
|
|
150
|
+
args: {
|
|
151
|
+
children: ['Link', <Icon key="icon" icon={mdiEarth} />, 'with icon'],
|
|
152
|
+
'parent.typography': undefined,
|
|
153
|
+
'parent.color': undefined,
|
|
154
|
+
},
|
|
155
|
+
render: ({ parent: { typography, color }, ...args }: any) => (
|
|
156
|
+
<Text as="p" color={color} typography={typography}>
|
|
157
|
+
<Link {...args} />
|
|
158
|
+
</Text>
|
|
159
|
+
),
|
|
160
|
+
decorators: [
|
|
161
|
+
withNestedProps(),
|
|
162
|
+
withCombinations({
|
|
163
|
+
combinations: {
|
|
164
|
+
sections: { Button: {}, Link: { href: '#' } },
|
|
165
|
+
rows: {
|
|
166
|
+
Default: {},
|
|
167
|
+
'Parent typography=title': { 'parent.typography': 'title' },
|
|
168
|
+
'Parent color=red': { 'parent.color': 'red' },
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
}),
|
|
172
|
+
withWrapper({ orientation: 'horizontal', vAlign: 'space-evenly', wrap: true, gap: 'huge' }, FlexBox),
|
|
173
|
+
],
|
|
174
|
+
};
|
|
@@ -45,7 +45,7 @@ describe(`<${Link.displayName}>`, () => {
|
|
|
45
45
|
|
|
46
46
|
it('should render typography', () => {
|
|
47
47
|
const { link } = setup({ href: 'https://google.com', typography: Typography.title });
|
|
48
|
-
expect(link.className).toBe('lumx-link lumx-typography-title');
|
|
48
|
+
expect(link.className).toBe('lumx-link lumx-link--has-typography lumx-typography-title');
|
|
49
49
|
});
|
|
50
50
|
|
|
51
51
|
it('should render a button', () => {
|
|
@@ -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';
|