@festo-ui/react 7.3.0-dev.538 → 7.3.0-dev.551
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/lib/components/buttons/button/Button.d.ts +1 -0
- package/lib/components/buttons/button/Button.js +4 -1
- package/lib/components/buttons/button/Button.stories.d.ts +1 -0
- package/lib/components/buttons/button/Button.stories.js +13 -4
- package/lib/components/card/CardHeader.d.ts +3 -2
- package/lib/components/card/CardHeader.js +18 -10
- package/lib/components/card/CardHeader.stories.helper.d.ts +3 -0
- package/lib/components/card/CardHeader.stories.helper.js +9 -0
- package/lib/helper/types.d.ts +5 -0
- package/node/lib/components/buttons/button/Button.js +4 -1
- package/node/lib/components/buttons/button/Button.stories.js +14 -5
- package/node/lib/components/card/CardHeader.js +17 -10
- package/node/lib/components/card/CardHeader.stories.helper.js +17 -0
- package/package.json +1 -1
|
@@ -13,6 +13,7 @@ const Button = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
13
13
|
floating = false,
|
|
14
14
|
onClick,
|
|
15
15
|
primary = false,
|
|
16
|
+
tertiary = false,
|
|
16
17
|
className,
|
|
17
18
|
children,
|
|
18
19
|
...props
|
|
@@ -22,7 +23,9 @@ const Button = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
22
23
|
}, {
|
|
23
24
|
'fwe-disabled': disabled
|
|
24
25
|
}, {
|
|
25
|
-
'fwe-btn-hero': primary
|
|
26
|
+
'fwe-btn-hero': primary && !tertiary
|
|
27
|
+
}, {
|
|
28
|
+
'fwe-btn-link': tertiary && !primary
|
|
26
29
|
}, {
|
|
27
30
|
'fwe-btn-lg': large
|
|
28
31
|
}, {
|
|
@@ -6,6 +6,7 @@ type Story = StoryObj<typeof Button>;
|
|
|
6
6
|
export declare const Overview: Story;
|
|
7
7
|
export declare const Primary: Story;
|
|
8
8
|
export declare const Secondary: Story;
|
|
9
|
+
export declare const Tertiary: Story;
|
|
9
10
|
export declare const Sizes: Story;
|
|
10
11
|
export declare const Icon: Story;
|
|
11
12
|
export declare const IconOnly: Story;
|
|
@@ -12,19 +12,22 @@ export const Overview = {
|
|
|
12
12
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
13
13
|
className: "fwe-d-flex fwe-justify-content-space-between fwe-align-items-end",
|
|
14
14
|
children: [/*#__PURE__*/_jsx(Button, {
|
|
15
|
+
primary: true,
|
|
16
|
+
children: "Hero"
|
|
17
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
15
18
|
children: "Secondary"
|
|
19
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
20
|
+
tertiary: true,
|
|
21
|
+
children: "Tertiary"
|
|
16
22
|
}), /*#__PURE__*/_jsx(Button, {
|
|
17
23
|
disabled: true,
|
|
18
24
|
children: "Disabled"
|
|
19
|
-
}), /*#__PURE__*/_jsx(Button, {
|
|
20
|
-
primary: true,
|
|
21
|
-
children: "Hero"
|
|
22
25
|
}), /*#__PURE__*/_jsx(Button, {
|
|
23
26
|
large: true,
|
|
24
27
|
children: "Large"
|
|
25
28
|
})]
|
|
26
29
|
}), /*#__PURE__*/_jsxs("div", {
|
|
27
|
-
className: "fwe-mt-m fwe-d-flex fwe-justify-content-space-between fwe-align-items-end",
|
|
30
|
+
className: "fwe-mt-m fwe-mb-l fwe-d-flex fwe-justify-content-space-between fwe-align-items-end",
|
|
28
31
|
children: [/*#__PURE__*/_jsx(Button, {
|
|
29
32
|
icon: "ecommerce-core-range-product",
|
|
30
33
|
children: "Icon from iconfont"
|
|
@@ -49,6 +52,12 @@ export const Secondary = {
|
|
|
49
52
|
children: 'Secondary'
|
|
50
53
|
}
|
|
51
54
|
};
|
|
55
|
+
export const Tertiary = {
|
|
56
|
+
args: {
|
|
57
|
+
tertiary: true,
|
|
58
|
+
children: 'Tertiary'
|
|
59
|
+
}
|
|
60
|
+
};
|
|
52
61
|
export const Sizes = {
|
|
53
62
|
args: {
|
|
54
63
|
children: 'Large Button',
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ClassNameProps } from '../../helper/types';
|
|
2
|
+
import { Image, ClassNameProps } from '../../helper/types';
|
|
3
3
|
interface CardHeaderProps extends ClassNameProps {
|
|
4
4
|
title: string;
|
|
5
5
|
subtitle?: string;
|
|
6
6
|
action?: React.ReactNode;
|
|
7
|
+
image?: Image;
|
|
7
8
|
}
|
|
8
|
-
declare function CardHeader({ title, subtitle, action, className }: CardHeaderProps): JSX.Element;
|
|
9
|
+
declare function CardHeader({ title, subtitle, action, image, className }: CardHeaderProps): JSX.Element;
|
|
9
10
|
export default CardHeader;
|
|
@@ -1,23 +1,31 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
4
5
|
function CardHeader(_ref) {
|
|
5
6
|
let {
|
|
6
7
|
title,
|
|
7
8
|
subtitle,
|
|
8
9
|
action,
|
|
10
|
+
image,
|
|
9
11
|
className
|
|
10
12
|
} = _ref;
|
|
11
|
-
return /*#__PURE__*/_jsxs(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
className:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
14
|
+
children: [image ? /*#__PURE__*/_jsx("img", {
|
|
15
|
+
alt: image.alt,
|
|
16
|
+
className: `fwe-card-img-${image.aspectRatio === '3/2' ? '32' : '169'}`,
|
|
17
|
+
src: image.src
|
|
18
|
+
}) : null, /*#__PURE__*/_jsxs("div", {
|
|
19
|
+
className: classNames('fwe-card-header', className),
|
|
20
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
21
|
+
className: "fwe-card-title",
|
|
22
|
+
children: [/*#__PURE__*/_jsx("h5", {
|
|
23
|
+
children: title
|
|
24
|
+
}), subtitle && /*#__PURE__*/_jsx("p", {
|
|
25
|
+
children: subtitle
|
|
26
|
+
})]
|
|
27
|
+
}), action]
|
|
28
|
+
})]
|
|
21
29
|
});
|
|
22
30
|
}
|
|
23
31
|
export default CardHeader;
|
package/lib/helper/types.d.ts
CHANGED
|
@@ -5,6 +5,11 @@ export interface ClassNameProps {
|
|
|
5
5
|
export interface ClassNamePropsWithChildren extends ClassNameProps {
|
|
6
6
|
children?: React.ReactNode;
|
|
7
7
|
}
|
|
8
|
+
export interface Image {
|
|
9
|
+
src: string;
|
|
10
|
+
alt: string;
|
|
11
|
+
aspectRatio: '3/2' | '16/9';
|
|
12
|
+
}
|
|
8
13
|
export interface SelectConfiguration {
|
|
9
14
|
hideLabel?: boolean;
|
|
10
15
|
contentWidth?: string;
|
|
@@ -19,6 +19,7 @@ const Button = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
19
19
|
floating = false,
|
|
20
20
|
onClick,
|
|
21
21
|
primary = false,
|
|
22
|
+
tertiary = false,
|
|
22
23
|
className,
|
|
23
24
|
children,
|
|
24
25
|
...props
|
|
@@ -28,7 +29,9 @@ const Button = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
28
29
|
}, {
|
|
29
30
|
'fwe-disabled': disabled
|
|
30
31
|
}, {
|
|
31
|
-
'fwe-btn-hero': primary
|
|
32
|
+
'fwe-btn-hero': primary && !tertiary
|
|
33
|
+
}, {
|
|
34
|
+
'fwe-btn-link': tertiary && !primary
|
|
32
35
|
}, {
|
|
33
36
|
'fwe-btn-lg': large
|
|
34
37
|
}, {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = exports.Sizes = exports.Secondary = exports.Primary = exports.Overview = exports.IconOnly = exports.Icon = exports.Floating = void 0;
|
|
6
|
+
exports.default = exports.Tertiary = exports.Sizes = exports.Secondary = exports.Primary = exports.Overview = exports.IconOnly = exports.Icon = exports.Floating = void 0;
|
|
7
7
|
var _reactIcons = require("@festo-ui/react-icons");
|
|
8
8
|
var _Button = _interopRequireDefault(require("./Button.js"));
|
|
9
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -18,19 +18,22 @@ const Overview = exports.Overview = {
|
|
|
18
18
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
19
19
|
className: "fwe-d-flex fwe-justify-content-space-between fwe-align-items-end",
|
|
20
20
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
|
|
21
|
+
primary: true,
|
|
22
|
+
children: "Hero"
|
|
23
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
|
|
21
24
|
children: "Secondary"
|
|
25
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
|
|
26
|
+
tertiary: true,
|
|
27
|
+
children: "Tertiary"
|
|
22
28
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
|
|
23
29
|
disabled: true,
|
|
24
30
|
children: "Disabled"
|
|
25
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
|
|
26
|
-
primary: true,
|
|
27
|
-
children: "Hero"
|
|
28
31
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
|
|
29
32
|
large: true,
|
|
30
33
|
children: "Large"
|
|
31
34
|
})]
|
|
32
35
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
33
|
-
className: "fwe-mt-m fwe-d-flex fwe-justify-content-space-between fwe-align-items-end",
|
|
36
|
+
className: "fwe-mt-m fwe-mb-l fwe-d-flex fwe-justify-content-space-between fwe-align-items-end",
|
|
34
37
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
|
|
35
38
|
icon: "ecommerce-core-range-product",
|
|
36
39
|
children: "Icon from iconfont"
|
|
@@ -55,6 +58,12 @@ const Secondary = exports.Secondary = {
|
|
|
55
58
|
children: 'Secondary'
|
|
56
59
|
}
|
|
57
60
|
};
|
|
61
|
+
const Tertiary = exports.Tertiary = {
|
|
62
|
+
args: {
|
|
63
|
+
tertiary: true,
|
|
64
|
+
children: 'Tertiary'
|
|
65
|
+
}
|
|
66
|
+
};
|
|
58
67
|
const Sizes = exports.Sizes = {
|
|
59
68
|
args: {
|
|
60
69
|
children: 'Large Button',
|
|
@@ -12,18 +12,25 @@ function CardHeader(_ref) {
|
|
|
12
12
|
title,
|
|
13
13
|
subtitle,
|
|
14
14
|
action,
|
|
15
|
+
image,
|
|
15
16
|
className
|
|
16
17
|
} = _ref;
|
|
17
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
className:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
19
|
+
children: [image ? /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
20
|
+
alt: image.alt,
|
|
21
|
+
className: `fwe-card-img-${image.aspectRatio === '3/2' ? '32' : '169'}`,
|
|
22
|
+
src: image.src
|
|
23
|
+
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
24
|
+
className: (0, _classnames.default)('fwe-card-header', className),
|
|
25
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
26
|
+
className: "fwe-card-title",
|
|
27
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("h5", {
|
|
28
|
+
children: title
|
|
29
|
+
}), subtitle && /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
30
|
+
children: subtitle
|
|
31
|
+
})]
|
|
32
|
+
}), action]
|
|
33
|
+
})]
|
|
27
34
|
});
|
|
28
35
|
}
|
|
29
36
|
var _default = exports.default = CardHeader;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _gallery01Webp = _interopRequireDefault(require("../../../../../web-essentials/stories/assets/gallery-01.webp.js"));
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
+
/* eslint-disable import/no-relative-packages */
|
|
10
|
+
// @ts-ignore
|
|
11
|
+
|
|
12
|
+
const cardImage = {
|
|
13
|
+
src: _gallery01Webp.default,
|
|
14
|
+
alt: 'Asset',
|
|
15
|
+
aspectRatio: '16/9'
|
|
16
|
+
};
|
|
17
|
+
var _default = exports.default = cardImage;
|
package/package.json
CHANGED