@laerdal/life-react-components 6.0.0-dev.27.full → 6.0.0-dev.30
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 +42 -0
- package/dist/Button/Button.cjs +469 -0
- package/dist/Button/Button.cjs.map +1 -0
- package/dist/Button/Button.d.ts +70 -0
- package/dist/Button/Button.js +461 -0
- package/dist/Button/Button.js.map +1 -0
- package/dist/Card/HorizontalCard/__tests__/VerticalCard.test.tsx +124 -0
- package/dist/Card/VerticalCard/Card.cjs +187 -0
- package/dist/Card/VerticalCard/Card.cjs.map +1 -0
- package/dist/Card/VerticalCard/Card.d.ts +25 -0
- package/dist/Card/VerticalCard/Card.js +178 -0
- package/dist/Card/VerticalCard/Card.js.map +1 -0
- package/dist/Card/VerticalCard/CardBottomSection.cjs +261 -0
- package/dist/Card/VerticalCard/CardBottomSection.cjs.map +1 -0
- package/dist/Card/VerticalCard/CardBottomSection.d.ts +53 -0
- package/dist/Card/VerticalCard/CardBottomSection.js +252 -0
- package/dist/Card/VerticalCard/CardBottomSection.js.map +1 -0
- package/dist/Card/VerticalCard/CardMiddleSection.cjs +145 -0
- package/dist/Card/VerticalCard/CardMiddleSection.cjs.map +1 -0
- package/dist/Card/VerticalCard/CardMiddleSection.d.ts +42 -0
- package/dist/Card/VerticalCard/CardMiddleSection.js +136 -0
- package/dist/Card/VerticalCard/CardMiddleSection.js.map +1 -0
- package/dist/Card/VerticalCard/CardTopSection.cjs +165 -0
- package/dist/Card/VerticalCard/CardTopSection.cjs.map +1 -0
- package/dist/Card/VerticalCard/CardTopSection.d.ts +45 -0
- package/dist/Card/VerticalCard/CardTopSection.js +156 -0
- package/dist/Card/VerticalCard/CardTopSection.js.map +1 -0
- package/dist/Card/__tests__/Card.test.tsx +146 -0
- package/dist/Footer/Components/FooterNewsletterAndSocialSection.cjs +0 -1
- package/dist/Footer/Components/FooterNewsletterAndSocialSection.cjs.map +1 -1
- package/dist/Footer/Components/FooterNewsletterAndSocialSection.js +0 -1
- package/dist/Footer/Components/FooterNewsletterAndSocialSection.js.map +1 -1
- package/dist/Footer/Components/FooterTop.cjs.map +1 -1
- package/dist/Footer/Components/FooterTop.js.map +1 -1
- package/dist/InputFields/RichTextField.cjs +3 -2
- package/dist/InputFields/RichTextField.cjs.map +1 -1
- package/dist/InputFields/RichTextField.d.ts +4 -5
- package/dist/InputFields/RichTextField.js +2 -1
- package/dist/InputFields/RichTextField.js.map +1 -1
- package/dist/InputFields/TextField.cjs +2 -5
- package/dist/InputFields/TextField.cjs.map +1 -1
- package/dist/InputFields/TextField.d.ts +0 -8
- package/dist/InputFields/TextField.js +2 -5
- package/dist/InputFields/TextField.js.map +1 -1
- package/dist/InputFields/styling.cjs +1 -4
- package/dist/InputFields/styling.cjs.map +1 -1
- package/dist/InputFields/styling.d.ts +0 -1
- package/dist/InputFields/styling.js +1 -4
- package/dist/InputFields/styling.js.map +1 -1
- package/package.json +148 -152
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = exports.CardMiddleSectionTitle = exports.CardMiddleSectionTagsStyles = exports.CardMiddleSectionContainer = exports.CardMiddleSectionColorBandStyles = exports.CardMiddleSectionCategoryStyles = void 0;
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
var React = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
11
|
+
var _index = require("../../index");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
14
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
15
|
+
const CardMiddleSectionContainer = exports.CardMiddleSectionContainer = _styledComponents.default.div`
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-grow: 1;
|
|
18
|
+
width: calc(100% - 32px);
|
|
19
|
+
position: relative;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
padding: 16px;
|
|
22
|
+
gap: 8px;
|
|
23
|
+
|
|
24
|
+
.descriptionBlock {
|
|
25
|
+
padding: 2px 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.titleBlock {
|
|
29
|
+
padding: 2px 0;
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
32
|
+
const CardMiddleSectionColorBandStyles = exports.CardMiddleSectionColorBandStyles = _styledComponents.default.div`
|
|
33
|
+
position: absolute;
|
|
34
|
+
width: 100%;
|
|
35
|
+
top: 0px;
|
|
36
|
+
left: 0px;
|
|
37
|
+
height: 8px;
|
|
38
|
+
background-color: ${props => props.$color};
|
|
39
|
+
`;
|
|
40
|
+
const CardMiddleSectionTagsStyles = exports.CardMiddleSectionTagsStyles = _styledComponents.default.div`
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-direction: row;
|
|
43
|
+
padding: 4px 0;
|
|
44
|
+
gap: 4px;
|
|
45
|
+
flex-wrap: wrap;
|
|
46
|
+
`;
|
|
47
|
+
const CardMiddleSectionCategoryStyles = exports.CardMiddleSectionCategoryStyles = _styledComponents.default.div`
|
|
48
|
+
display: flex;
|
|
49
|
+
flex-direction: row;
|
|
50
|
+
align-items: center;
|
|
51
|
+
padding: none;
|
|
52
|
+
gap: 6px;
|
|
53
|
+
|
|
54
|
+
svg {
|
|
55
|
+
color: ${props => _index.COLORS.generateToken({
|
|
56
|
+
componentType: 'text',
|
|
57
|
+
defaultVariant: 'subtle'
|
|
58
|
+
}, props.theme)};
|
|
59
|
+
flex-grow: 0;
|
|
60
|
+
flex-shrink: 0;
|
|
61
|
+
}
|
|
62
|
+
`;
|
|
63
|
+
const CardMiddleSectionTitle = exports.CardMiddleSectionTitle = _styledComponents.default.h3`
|
|
64
|
+
${props => (0, _index.ComponentXLStyling)(_index.ComponentTextStyle.Bold, props.$disabled ? _index.COLORS.generateToken({
|
|
65
|
+
componentType: 'text',
|
|
66
|
+
defaultVariant: 'subtle'
|
|
67
|
+
}, props.theme) : _index.COLORS.generateToken({
|
|
68
|
+
componentType: 'text',
|
|
69
|
+
defaultVariant: 'default'
|
|
70
|
+
}, props.theme))}
|
|
71
|
+
`;
|
|
72
|
+
const CardMiddleSection = _ref => {
|
|
73
|
+
let {
|
|
74
|
+
colorBandColor,
|
|
75
|
+
categoryIcon,
|
|
76
|
+
categoryLabel,
|
|
77
|
+
title,
|
|
78
|
+
description,
|
|
79
|
+
tags,
|
|
80
|
+
row2Tags,
|
|
81
|
+
disabled,
|
|
82
|
+
componentId
|
|
83
|
+
} = _ref;
|
|
84
|
+
const theme = (0, _styledComponents.useTheme)();
|
|
85
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(CardMiddleSectionContainer, {
|
|
86
|
+
"data-testid": 'card-middleSection',
|
|
87
|
+
children: [colorBandColor && /*#__PURE__*/(0, _jsxRuntime.jsx)(CardMiddleSectionColorBandStyles, {
|
|
88
|
+
$color: colorBandColor
|
|
89
|
+
}), (categoryIcon || categoryLabel) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(CardMiddleSectionCategoryStyles, {
|
|
90
|
+
$extraTopMargin: Boolean(colorBandColor),
|
|
91
|
+
$bottomMargin: Boolean(categoryIcon || categoryLabel),
|
|
92
|
+
children: [categoryIcon, /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ComponentS, {
|
|
93
|
+
textStyle: _index.ComponentTextStyle.Bold,
|
|
94
|
+
color: _index.COLORS.generateToken({
|
|
95
|
+
componentType: 'text',
|
|
96
|
+
defaultVariant: 'subtle'
|
|
97
|
+
}, theme),
|
|
98
|
+
children: categoryLabel
|
|
99
|
+
})]
|
|
100
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(CardMiddleSectionTitle, {
|
|
101
|
+
id: `${componentId}-title`,
|
|
102
|
+
className: "titleBlock",
|
|
103
|
+
$disabled: disabled,
|
|
104
|
+
children: title
|
|
105
|
+
}), description && /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ComponentS, {
|
|
106
|
+
className: "descriptionBlock",
|
|
107
|
+
color: _index.COLORS.generateToken({
|
|
108
|
+
componentType: 'text',
|
|
109
|
+
defaultVariant: 'subtle'
|
|
110
|
+
}, theme),
|
|
111
|
+
children: description
|
|
112
|
+
}), tags && /*#__PURE__*/(0, _jsxRuntime.jsx)(CardMiddleSectionTagsStyles, {
|
|
113
|
+
children: tags.map((x, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Tag, {
|
|
114
|
+
label: x.label,
|
|
115
|
+
variant: x.variant ?? 'neutral',
|
|
116
|
+
icon: x.icon
|
|
117
|
+
}, `${x.label}_${index}`))
|
|
118
|
+
}), row2Tags && /*#__PURE__*/(0, _jsxRuntime.jsx)(CardMiddleSectionTagsStyles, {
|
|
119
|
+
children: row2Tags.map((x, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Tag, {
|
|
120
|
+
label: x.label,
|
|
121
|
+
variant: x.variant ?? 'neutral',
|
|
122
|
+
icon: x.icon
|
|
123
|
+
}, `${x.label}_${index}`))
|
|
124
|
+
})]
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
CardMiddleSection.propTypes = {
|
|
128
|
+
colorBandColor: _propTypes.default.string,
|
|
129
|
+
categoryIcon: _propTypes.default.node,
|
|
130
|
+
categoryLabel: _propTypes.default.string,
|
|
131
|
+
title: _propTypes.default.string.isRequired,
|
|
132
|
+
description: _propTypes.default.string,
|
|
133
|
+
tags: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
134
|
+
label: _propTypes.default.string.isRequired,
|
|
135
|
+
icon: _propTypes.default.node
|
|
136
|
+
})),
|
|
137
|
+
row2Tags: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
138
|
+
label: _propTypes.default.string.isRequired,
|
|
139
|
+
icon: _propTypes.default.node
|
|
140
|
+
})),
|
|
141
|
+
disabled: _propTypes.default.bool,
|
|
142
|
+
componentId: _propTypes.default.string
|
|
143
|
+
};
|
|
144
|
+
var _default = exports.default = CardMiddleSection;
|
|
145
|
+
//# sourceMappingURL=CardMiddleSection.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CardMiddleSection.cjs","names":["React","_interopRequireWildcard","require","_styledComponents","_index","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","CardMiddleSectionContainer","exports","styled","div","CardMiddleSectionColorBandStyles","props","$color","CardMiddleSectionTagsStyles","CardMiddleSectionCategoryStyles","COLORS","generateToken","componentType","defaultVariant","theme","CardMiddleSectionTitle","h3","ComponentXLStyling","ComponentTextStyle","Bold","$disabled","CardMiddleSection","_ref","colorBandColor","categoryIcon","categoryLabel","title","description","tags","row2Tags","disabled","componentId","useTheme","jsxs","children","jsx","$extraTopMargin","Boolean","$bottomMargin","ComponentS","textStyle","color","id","className","map","x","index","Tag","label","variant","icon","propTypes","_propTypes","string","node","isRequired","arrayOf","shape","bool","_default"],"sources":["../../../src/Card/VerticalCard/CardMiddleSection.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport styled, { useTheme } from 'styled-components';\r\nimport { COLORS, ComponentS, ComponentTextStyle, ComponentXL, ComponentXLStyling, Tag, TagVariants } from '../../index';\r\nimport { ReactNode } from 'react';\r\n\r\nexport interface CardMiddleSectionProps {\r\n /** Color of the band to be shown on the top of middle section. */\r\n colorBandColor?: string;\r\n /** Icon to be shown on the left side of the categoryLabel. */\r\n categoryIcon?: React.ReactNode;\r\n /** Label to be shown at the top part of the middle section. */\r\n categoryLabel?: string;\r\n /** Main title of the Card component. */\r\n title: string;\r\n /** Description of the Card. */\r\n description?: string;\r\n /** Tags to be shown under the description. */\r\n tags?: CardTag[];\r\n /** Second row of tags if needed. */\r\n row2Tags?: CardTag[];\r\n /** This property is set by Card component itself and is based on 'disabled' flag of CardProps. */\r\n disabled?: boolean;\r\n /** Top level Id of Card component */\r\n componentId?: string;\r\n}\r\n\r\nexport interface CardTag {\r\n label: string;\r\n variant?: TagVariants;\r\n icon?: ReactNode\r\n}\r\n\r\nexport const CardMiddleSectionContainer = styled.div`\r\n display: flex;\r\n flex-grow: 1;\r\n width: calc(100% - 32px);\r\n position: relative;\r\n flex-direction: column;\r\n padding: 16px;\r\n gap: 8px;\r\n\r\n .descriptionBlock {\r\n padding: 2px 0;\r\n }\r\n\r\n .titleBlock {\r\n padding: 2px 0;\r\n }\r\n`;\r\n\r\nexport const CardMiddleSectionColorBandStyles = styled.div<{ $color: string }>`\r\n position: absolute;\r\n width: 100%;\r\n top: 0px;\r\n left: 0px;\r\n height: 8px;\r\n background-color: ${(props) => props.$color};\r\n`;\r\n\r\nexport const CardMiddleSectionTagsStyles = styled.div`\r\n display: flex;\r\n flex-direction: row;\r\n padding: 4px 0;\r\n gap: 4px;\r\n flex-wrap: wrap;\r\n`;\r\n\r\nexport const CardMiddleSectionCategoryStyles = styled.div<{ $extraTopMargin: boolean; $bottomMargin: boolean }>`\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n padding: none;\r\n gap: 6px;\r\n\r\n svg {\r\n color: ${props => COLORS.generateToken({ componentType: 'text', defaultVariant: 'subtle' }, props.theme)};\r\n flex-grow: 0;\r\n flex-shrink: 0;\r\n }\r\n`;\r\n\r\nexport const CardMiddleSectionTitle = styled.h3<{ $disabled?: boolean }>`\r\n ${props => ComponentXLStyling(ComponentTextStyle.Bold, props.$disabled \r\n ? COLORS.generateToken({componentType:'text',defaultVariant:'subtle'}, props.theme)\r\n : COLORS.generateToken({componentType:'text',defaultVariant:'default'}, props.theme)\r\n )}\r\n`;\r\n\r\nconst CardMiddleSection: React.FunctionComponent<CardMiddleSectionProps> = ({\r\n colorBandColor,\r\n categoryIcon,\r\n categoryLabel,\r\n title,\r\n description,\r\n tags,\r\n row2Tags,\r\n disabled,\r\n componentId\r\n}: CardMiddleSectionProps) => {\r\n const theme = useTheme();\r\n \r\n return (\r\n <CardMiddleSectionContainer data-testid={'card-middleSection'} >\r\n {colorBandColor && <CardMiddleSectionColorBandStyles $color={colorBandColor} />}\r\n {\r\n (categoryIcon || categoryLabel) &&\r\n <CardMiddleSectionCategoryStyles $extraTopMargin={Boolean(colorBandColor)} $bottomMargin={Boolean(categoryIcon || categoryLabel)}>\r\n {categoryIcon}\r\n <ComponentS textStyle={ComponentTextStyle.Bold} color={COLORS.generateToken({componentType:'text',defaultVariant:'subtle'}, theme)}>\r\n {categoryLabel}\r\n </ComponentS>\r\n </CardMiddleSectionCategoryStyles>\r\n }\r\n <CardMiddleSectionTitle \r\n id={`${componentId}-title`} \r\n className=\"titleBlock\"\r\n $disabled={disabled}>\r\n {title}\r\n </CardMiddleSectionTitle>\r\n {description && (\r\n <ComponentS className=\"descriptionBlock\" color={COLORS.generateToken({componentType:'text',defaultVariant:'subtle'}, theme)}>\r\n {description}\r\n </ComponentS>\r\n )}\r\n {tags && (\r\n <CardMiddleSectionTagsStyles>\r\n {tags.map((x, index) => (\r\n <Tag key={`${x.label}_${index}`} label={x.label} variant={x.variant ?? 'neutral'} icon={x.icon} />\r\n ))}\r\n </CardMiddleSectionTagsStyles>\r\n )}\r\n {row2Tags && (\r\n <CardMiddleSectionTagsStyles>\r\n {row2Tags.map((x, index) => (\r\n <Tag key={`${x.label}_${index}`} label={x.label} variant={x.variant ?? 'neutral'} icon={x.icon} />\r\n ))}\r\n </CardMiddleSectionTagsStyles>\r\n )}\r\n </CardMiddleSectionContainer>\r\n );\r\n};\r\n\r\nexport default CardMiddleSection;\r\n"],"mappings":";;;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAF,uBAAA,CAAAC,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAAwH,IAAAG,WAAA,GAAAH,OAAA;AAAA,SAAAI,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAN,wBAAAM,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CA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A,CAAAjE,OAAA,CAAAmE,IAAA;EAEZ7B,aAAa,EAAA2B,UAAA,CAAAjE,OAAA,CAAAkE,MAAA;EAEb3B,KAAK,EAAA0B,UAAA,CAAAjE,OAAA,CAAAkE,MAAA,CAAAE,UAAA;EAEL5B,WAAW,EAAAyB,UAAA,CAAAjE,OAAA,CAAAkE,MAAA;EAEXzB,IAAI,EAAAwB,UAAA,CAAAjE,OAAA,CAAAqE,OAAA,CAAAJ,UAAA,CAAAjE,OAAA,CAAAsE,KAAA;IAUJT,KAAK,EAAAI,UAAA,CAAAjE,OAAA,CAAAkE,MAAA,CAAAE,UAAA;IAELL,IAAI,EAAAE,UAAA,CAAAjE,OAAA,CAAAmE;EAAA;EAVJzB,QAAQ,EAAAuB,UAAA,CAAAjE,OAAA,CAAAqE,OAAA,CAAAJ,UAAA,CAAAjE,OAAA,CAAAsE,KAAA;IAQRT,KAAK,EAAAI,UAAA,CAAAjE,OAAA,CAAAkE,MAAA,CAAAE,UAAA;IAELL,IAAI,EAAAE,UAAA,CAAAjE,OAAA,CAAAmE;EAAA;EARJxB,QAAQ,EAAAsB,UAAA,CAAAjE,OAAA,CAAAuE,IAAA;EAER3B,WAAW,EAAAqB,UAAA,CAAAjE,OAAA,CAAAkE;AAAA;AAAA,IAAAM,QAAA,GAAAzD,OAAA,CAAAf,OAAA,GAuHEkC,iBAAiB","ignoreList":[]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { TagVariants } from '../../index';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
export interface CardMiddleSectionProps {
|
|
5
|
+
/** Color of the band to be shown on the top of middle section. */
|
|
6
|
+
colorBandColor?: string;
|
|
7
|
+
/** Icon to be shown on the left side of the categoryLabel. */
|
|
8
|
+
categoryIcon?: React.ReactNode;
|
|
9
|
+
/** Label to be shown at the top part of the middle section. */
|
|
10
|
+
categoryLabel?: string;
|
|
11
|
+
/** Main title of the Card component. */
|
|
12
|
+
title: string;
|
|
13
|
+
/** Description of the Card. */
|
|
14
|
+
description?: string;
|
|
15
|
+
/** Tags to be shown under the description. */
|
|
16
|
+
tags?: CardTag[];
|
|
17
|
+
/** Second row of tags if needed. */
|
|
18
|
+
row2Tags?: CardTag[];
|
|
19
|
+
/** This property is set by Card component itself and is based on 'disabled' flag of CardProps. */
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
/** Top level Id of Card component */
|
|
22
|
+
componentId?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface CardTag {
|
|
25
|
+
label: string;
|
|
26
|
+
variant?: TagVariants;
|
|
27
|
+
icon?: ReactNode;
|
|
28
|
+
}
|
|
29
|
+
export declare const CardMiddleSectionContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
30
|
+
export declare const CardMiddleSectionColorBandStyles: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
31
|
+
$color: string;
|
|
32
|
+
}>> & string;
|
|
33
|
+
export declare const CardMiddleSectionTagsStyles: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
34
|
+
export declare const CardMiddleSectionCategoryStyles: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
35
|
+
$extraTopMargin: boolean;
|
|
36
|
+
$bottomMargin: boolean;
|
|
37
|
+
}>> & string;
|
|
38
|
+
export declare const CardMiddleSectionTitle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, {
|
|
39
|
+
$disabled?: boolean;
|
|
40
|
+
}>> & string;
|
|
41
|
+
declare const CardMiddleSection: React.FunctionComponent<CardMiddleSectionProps>;
|
|
42
|
+
export default CardMiddleSection;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import _pt from "prop-types";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import styled, { useTheme } from 'styled-components';
|
|
4
|
+
import { COLORS, ComponentS, ComponentTextStyle, ComponentXLStyling, Tag } from '../../index';
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
export const CardMiddleSectionContainer = styled.div`
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-grow: 1;
|
|
9
|
+
width: calc(100% - 32px);
|
|
10
|
+
position: relative;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
padding: 16px;
|
|
13
|
+
gap: 8px;
|
|
14
|
+
|
|
15
|
+
.descriptionBlock {
|
|
16
|
+
padding: 2px 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.titleBlock {
|
|
20
|
+
padding: 2px 0;
|
|
21
|
+
}
|
|
22
|
+
`;
|
|
23
|
+
export const CardMiddleSectionColorBandStyles = styled.div`
|
|
24
|
+
position: absolute;
|
|
25
|
+
width: 100%;
|
|
26
|
+
top: 0px;
|
|
27
|
+
left: 0px;
|
|
28
|
+
height: 8px;
|
|
29
|
+
background-color: ${props => props.$color};
|
|
30
|
+
`;
|
|
31
|
+
export const CardMiddleSectionTagsStyles = styled.div`
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: row;
|
|
34
|
+
padding: 4px 0;
|
|
35
|
+
gap: 4px;
|
|
36
|
+
flex-wrap: wrap;
|
|
37
|
+
`;
|
|
38
|
+
export const CardMiddleSectionCategoryStyles = styled.div`
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-direction: row;
|
|
41
|
+
align-items: center;
|
|
42
|
+
padding: none;
|
|
43
|
+
gap: 6px;
|
|
44
|
+
|
|
45
|
+
svg {
|
|
46
|
+
color: ${props => COLORS.generateToken({
|
|
47
|
+
componentType: 'text',
|
|
48
|
+
defaultVariant: 'subtle'
|
|
49
|
+
}, props.theme)};
|
|
50
|
+
flex-grow: 0;
|
|
51
|
+
flex-shrink: 0;
|
|
52
|
+
}
|
|
53
|
+
`;
|
|
54
|
+
export const CardMiddleSectionTitle = styled.h3`
|
|
55
|
+
${props => ComponentXLStyling(ComponentTextStyle.Bold, props.$disabled ? COLORS.generateToken({
|
|
56
|
+
componentType: 'text',
|
|
57
|
+
defaultVariant: 'subtle'
|
|
58
|
+
}, props.theme) : COLORS.generateToken({
|
|
59
|
+
componentType: 'text',
|
|
60
|
+
defaultVariant: 'default'
|
|
61
|
+
}, props.theme))}
|
|
62
|
+
`;
|
|
63
|
+
const CardMiddleSection = _ref => {
|
|
64
|
+
let {
|
|
65
|
+
colorBandColor,
|
|
66
|
+
categoryIcon,
|
|
67
|
+
categoryLabel,
|
|
68
|
+
title,
|
|
69
|
+
description,
|
|
70
|
+
tags,
|
|
71
|
+
row2Tags,
|
|
72
|
+
disabled,
|
|
73
|
+
componentId
|
|
74
|
+
} = _ref;
|
|
75
|
+
const theme = useTheme();
|
|
76
|
+
return /*#__PURE__*/_jsxs(CardMiddleSectionContainer, {
|
|
77
|
+
"data-testid": 'card-middleSection',
|
|
78
|
+
children: [colorBandColor && /*#__PURE__*/_jsx(CardMiddleSectionColorBandStyles, {
|
|
79
|
+
$color: colorBandColor
|
|
80
|
+
}), (categoryIcon || categoryLabel) && /*#__PURE__*/_jsxs(CardMiddleSectionCategoryStyles, {
|
|
81
|
+
$extraTopMargin: Boolean(colorBandColor),
|
|
82
|
+
$bottomMargin: Boolean(categoryIcon || categoryLabel),
|
|
83
|
+
children: [categoryIcon, /*#__PURE__*/_jsx(ComponentS, {
|
|
84
|
+
textStyle: ComponentTextStyle.Bold,
|
|
85
|
+
color: COLORS.generateToken({
|
|
86
|
+
componentType: 'text',
|
|
87
|
+
defaultVariant: 'subtle'
|
|
88
|
+
}, theme),
|
|
89
|
+
children: categoryLabel
|
|
90
|
+
})]
|
|
91
|
+
}), /*#__PURE__*/_jsx(CardMiddleSectionTitle, {
|
|
92
|
+
id: `${componentId}-title`,
|
|
93
|
+
className: "titleBlock",
|
|
94
|
+
$disabled: disabled,
|
|
95
|
+
children: title
|
|
96
|
+
}), description && /*#__PURE__*/_jsx(ComponentS, {
|
|
97
|
+
className: "descriptionBlock",
|
|
98
|
+
color: COLORS.generateToken({
|
|
99
|
+
componentType: 'text',
|
|
100
|
+
defaultVariant: 'subtle'
|
|
101
|
+
}, theme),
|
|
102
|
+
children: description
|
|
103
|
+
}), tags && /*#__PURE__*/_jsx(CardMiddleSectionTagsStyles, {
|
|
104
|
+
children: tags.map((x, index) => /*#__PURE__*/_jsx(Tag, {
|
|
105
|
+
label: x.label,
|
|
106
|
+
variant: x.variant ?? 'neutral',
|
|
107
|
+
icon: x.icon
|
|
108
|
+
}, `${x.label}_${index}`))
|
|
109
|
+
}), row2Tags && /*#__PURE__*/_jsx(CardMiddleSectionTagsStyles, {
|
|
110
|
+
children: row2Tags.map((x, index) => /*#__PURE__*/_jsx(Tag, {
|
|
111
|
+
label: x.label,
|
|
112
|
+
variant: x.variant ?? 'neutral',
|
|
113
|
+
icon: x.icon
|
|
114
|
+
}, `${x.label}_${index}`))
|
|
115
|
+
})]
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
CardMiddleSection.propTypes = {
|
|
119
|
+
colorBandColor: _pt.string,
|
|
120
|
+
categoryIcon: _pt.node,
|
|
121
|
+
categoryLabel: _pt.string,
|
|
122
|
+
title: _pt.string.isRequired,
|
|
123
|
+
description: _pt.string,
|
|
124
|
+
tags: _pt.arrayOf(_pt.shape({
|
|
125
|
+
label: _pt.string.isRequired,
|
|
126
|
+
icon: _pt.node
|
|
127
|
+
})),
|
|
128
|
+
row2Tags: _pt.arrayOf(_pt.shape({
|
|
129
|
+
label: _pt.string.isRequired,
|
|
130
|
+
icon: _pt.node
|
|
131
|
+
})),
|
|
132
|
+
disabled: _pt.bool,
|
|
133
|
+
componentId: _pt.string
|
|
134
|
+
};
|
|
135
|
+
export default CardMiddleSection;
|
|
136
|
+
//# sourceMappingURL=CardMiddleSection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CardMiddleSection.js","names":["React","styled","useTheme","COLORS","ComponentS","ComponentTextStyle","ComponentXLStyling","Tag","jsx","_jsx","jsxs","_jsxs","CardMiddleSectionContainer","div","CardMiddleSectionColorBandStyles","props","$color","CardMiddleSectionTagsStyles","CardMiddleSectionCategoryStyles","generateToken","componentType","defaultVariant","theme","CardMiddleSectionTitle","h3","Bold","$disabled","CardMiddleSection","_ref","colorBandColor","categoryIcon","categoryLabel","title","description","tags","row2Tags","disabled","componentId","children","$extraTopMargin","Boolean","$bottomMargin","textStyle","color","id","className","map","x","index","label","variant","icon","propTypes","_pt","string","node","isRequired","arrayOf","shape","bool"],"sources":["../../../src/Card/VerticalCard/CardMiddleSection.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport styled, { useTheme } from 'styled-components';\r\nimport { COLORS, ComponentS, ComponentTextStyle, ComponentXL, ComponentXLStyling, Tag, TagVariants } from '../../index';\r\nimport { ReactNode } from 'react';\r\n\r\nexport interface CardMiddleSectionProps {\r\n /** Color of the band to be shown on the top of middle section. */\r\n colorBandColor?: string;\r\n /** Icon to be shown on the left side of the categoryLabel. */\r\n categoryIcon?: React.ReactNode;\r\n /** Label to be shown at the top part of the middle section. */\r\n categoryLabel?: string;\r\n /** Main title of the Card component. */\r\n title: string;\r\n /** Description of the Card. */\r\n description?: string;\r\n /** Tags to be shown under the description. */\r\n tags?: CardTag[];\r\n /** Second row of tags if needed. */\r\n row2Tags?: CardTag[];\r\n /** This property is set by Card component itself and is based on 'disabled' flag of CardProps. */\r\n disabled?: boolean;\r\n /** Top level Id of Card component */\r\n componentId?: string;\r\n}\r\n\r\nexport interface CardTag {\r\n label: string;\r\n variant?: TagVariants;\r\n icon?: ReactNode\r\n}\r\n\r\nexport const CardMiddleSectionContainer = styled.div`\r\n display: flex;\r\n flex-grow: 1;\r\n width: calc(100% - 32px);\r\n position: relative;\r\n flex-direction: column;\r\n padding: 16px;\r\n gap: 8px;\r\n\r\n .descriptionBlock {\r\n padding: 2px 0;\r\n }\r\n\r\n .titleBlock {\r\n padding: 2px 0;\r\n }\r\n`;\r\n\r\nexport const CardMiddleSectionColorBandStyles = styled.div<{ $color: string }>`\r\n position: absolute;\r\n width: 100%;\r\n top: 0px;\r\n left: 0px;\r\n height: 8px;\r\n background-color: ${(props) => props.$color};\r\n`;\r\n\r\nexport const CardMiddleSectionTagsStyles = styled.div`\r\n display: flex;\r\n flex-direction: row;\r\n padding: 4px 0;\r\n gap: 4px;\r\n flex-wrap: wrap;\r\n`;\r\n\r\nexport const CardMiddleSectionCategoryStyles = styled.div<{ $extraTopMargin: boolean; $bottomMargin: boolean }>`\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n padding: none;\r\n gap: 6px;\r\n\r\n svg {\r\n color: ${props => COLORS.generateToken({ componentType: 'text', defaultVariant: 'subtle' }, props.theme)};\r\n flex-grow: 0;\r\n flex-shrink: 0;\r\n }\r\n`;\r\n\r\nexport const CardMiddleSectionTitle = styled.h3<{ $disabled?: boolean }>`\r\n ${props => ComponentXLStyling(ComponentTextStyle.Bold, props.$disabled \r\n ? COLORS.generateToken({componentType:'text',defaultVariant:'subtle'}, props.theme)\r\n : COLORS.generateToken({componentType:'text',defaultVariant:'default'}, props.theme)\r\n )}\r\n`;\r\n\r\nconst CardMiddleSection: React.FunctionComponent<CardMiddleSectionProps> = ({\r\n colorBandColor,\r\n categoryIcon,\r\n categoryLabel,\r\n title,\r\n description,\r\n tags,\r\n row2Tags,\r\n disabled,\r\n componentId\r\n}: CardMiddleSectionProps) => {\r\n const theme = useTheme();\r\n \r\n return (\r\n <CardMiddleSectionContainer data-testid={'card-middleSection'} >\r\n {colorBandColor && <CardMiddleSectionColorBandStyles $color={colorBandColor} />}\r\n {\r\n (categoryIcon || categoryLabel) &&\r\n <CardMiddleSectionCategoryStyles $extraTopMargin={Boolean(colorBandColor)} $bottomMargin={Boolean(categoryIcon || categoryLabel)}>\r\n {categoryIcon}\r\n <ComponentS textStyle={ComponentTextStyle.Bold} color={COLORS.generateToken({componentType:'text',defaultVariant:'subtle'}, theme)}>\r\n {categoryLabel}\r\n </ComponentS>\r\n </CardMiddleSectionCategoryStyles>\r\n }\r\n <CardMiddleSectionTitle \r\n id={`${componentId}-title`} \r\n className=\"titleBlock\"\r\n $disabled={disabled}>\r\n {title}\r\n </CardMiddleSectionTitle>\r\n {description && (\r\n <ComponentS className=\"descriptionBlock\" color={COLORS.generateToken({componentType:'text',defaultVariant:'subtle'}, theme)}>\r\n {description}\r\n </ComponentS>\r\n )}\r\n {tags && (\r\n <CardMiddleSectionTagsStyles>\r\n {tags.map((x, index) => (\r\n <Tag key={`${x.label}_${index}`} label={x.label} variant={x.variant ?? 'neutral'} icon={x.icon} />\r\n ))}\r\n </CardMiddleSectionTagsStyles>\r\n )}\r\n {row2Tags && (\r\n <CardMiddleSectionTagsStyles>\r\n {row2Tags.map((x, index) => (\r\n <Tag key={`${x.label}_${index}`} label={x.label} variant={x.variant ?? 'neutral'} icon={x.icon} />\r\n ))}\r\n </CardMiddleSectionTagsStyles>\r\n )}\r\n </CardMiddleSectionContainer>\r\n );\r\n};\r\n\r\nexport default CardMiddleSection;\r\n"],"mappings":";AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,MAAM,IAAIC,QAAQ,QAAQ,mBAAmB;AACpD,SAASC,MAAM,EAAEC,UAAU,EAAEC,kBAAkB,EAAeC,kBAAkB,EAAEC,GAAG,QAAqB,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AA8BxH,OAAO,MAAMC,0BAA0B,GAAGX,MAAM,CAACY,GAAG;AACpD;AAC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efault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = exports.CardTopSectionTagContainer = exports.CardTopSectionRibbonContainer = exports.CardTopSectionImageContainer = exports.CardTopSectionContainer = exports.CardTopSectionCheckboxContainer = void 0;
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
var React = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
11
|
+
var _typography = require("../../styles/typography");
|
|
12
|
+
var _Checkbox = _interopRequireDefault(require("../../InputFields/Checkbox"));
|
|
13
|
+
var _Tag = require("../../Tag");
|
|
14
|
+
var _index = require("../../index");
|
|
15
|
+
var _Image = require("../../Image");
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
18
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
19
|
+
const CardTopSectionImageContainer = exports.CardTopSectionImageContainer = _styledComponents.default.div`
|
|
20
|
+
border-top-right-radius: 8px;
|
|
21
|
+
border-top-left-radius: 8px;
|
|
22
|
+
height: 100%;
|
|
23
|
+
width: 100%;
|
|
24
|
+
img{
|
|
25
|
+
object-fit: cover;
|
|
26
|
+
width: 100%;
|
|
27
|
+
height: 100%;
|
|
28
|
+
border-top-right-radius: 8px;
|
|
29
|
+
border-top-left-radius: 8px;
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
32
|
+
const CardTopSectionTagContainer = exports.CardTopSectionTagContainer = _styledComponents.default.div`
|
|
33
|
+
position: absolute;
|
|
34
|
+
|
|
35
|
+
top: 16px;
|
|
36
|
+
left: 16px;
|
|
37
|
+
width: calc(100% - 32px);
|
|
38
|
+
`;
|
|
39
|
+
const CardTopSectionContainer = exports.CardTopSectionContainer = _styledComponents.default.div`
|
|
40
|
+
position: relative;
|
|
41
|
+
width: 100%;
|
|
42
|
+
overflow: visible;
|
|
43
|
+
|
|
44
|
+
${props => props.disabled ? `
|
|
45
|
+
img, svg {
|
|
46
|
+
filter: grayscale(100%);
|
|
47
|
+
}` : ''}
|
|
48
|
+
`;
|
|
49
|
+
const CardTopSectionRibbonContainer = exports.CardTopSectionRibbonContainer = _styledComponents.default.div`
|
|
50
|
+
min-height: calc(40px - 16px);
|
|
51
|
+
background-color: ${props => props.$backgroundColor};
|
|
52
|
+
width: calc(100% - 32px);
|
|
53
|
+
position: absolute;
|
|
54
|
+
bottom: 0px;
|
|
55
|
+
left: 0px;
|
|
56
|
+
padding: 8px 16px 8px 16px;
|
|
57
|
+
display: flex;
|
|
58
|
+
flex-direction: row;
|
|
59
|
+
align-items: center;
|
|
60
|
+
gap: 8px;
|
|
61
|
+
|
|
62
|
+
svg {
|
|
63
|
+
color: ${props => props.$color};
|
|
64
|
+
width: 24px;
|
|
65
|
+
height: 24px;
|
|
66
|
+
flex-grow: 0;
|
|
67
|
+
flex-shrink: 0;
|
|
68
|
+
}
|
|
69
|
+
`;
|
|
70
|
+
const CardTopSectionCheckboxContainer = exports.CardTopSectionCheckboxContainer = _styledComponents.default.div`
|
|
71
|
+
position: absolute;
|
|
72
|
+
top: 0;
|
|
73
|
+
right: 0;
|
|
74
|
+
z-index: 1;
|
|
75
|
+
|
|
76
|
+
.checkbox-icon {
|
|
77
|
+
background-color: ${props => _index.COLORS.getColor('white', props.theme)};
|
|
78
|
+
}
|
|
79
|
+
`;
|
|
80
|
+
const CardTopSection = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
81
|
+
let {
|
|
82
|
+
selected,
|
|
83
|
+
setSelected,
|
|
84
|
+
image,
|
|
85
|
+
tagLabel,
|
|
86
|
+
tagIcon,
|
|
87
|
+
tagVariant = 'positive',
|
|
88
|
+
highlightRibbonIcon,
|
|
89
|
+
highlightRibbonText,
|
|
90
|
+
highlightRibbonContentColor,
|
|
91
|
+
highlightRibbonBgColor,
|
|
92
|
+
disabled
|
|
93
|
+
} = _ref;
|
|
94
|
+
const theme = (0, _styledComponents.useTheme)();
|
|
95
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(CardTopSectionContainer, {
|
|
96
|
+
disabled: disabled,
|
|
97
|
+
"data-testid": 'card-topSection',
|
|
98
|
+
style: {
|
|
99
|
+
height: image?.height ?? 200
|
|
100
|
+
},
|
|
101
|
+
children: [image && /*#__PURE__*/(0, _jsxRuntime.jsx)(CardTopSectionImageContainer, {
|
|
102
|
+
role: "none",
|
|
103
|
+
"aria-hidden": "true",
|
|
104
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Image.ImageWithFallbacks, {
|
|
105
|
+
fallbacks: image.fallbackSrc ?? '',
|
|
106
|
+
src: image.src,
|
|
107
|
+
alt: "",
|
|
108
|
+
loader: image.loader ?? false,
|
|
109
|
+
width: image.width,
|
|
110
|
+
height: image.height
|
|
111
|
+
})
|
|
112
|
+
}), (!!selected || !!setSelected) && /*#__PURE__*/(0, _jsxRuntime.jsx)(CardTopSectionCheckboxContainer, {
|
|
113
|
+
"data-testid": 'card-topSection-checkbox',
|
|
114
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Checkbox.default, {
|
|
115
|
+
ref: ref,
|
|
116
|
+
disabled: disabled,
|
|
117
|
+
select: selected => setSelected && setSelected(selected),
|
|
118
|
+
selected: selected || false
|
|
119
|
+
})
|
|
120
|
+
}), (tagLabel || tagIcon) && /*#__PURE__*/(0, _jsxRuntime.jsx)(CardTopSectionTagContainer, {
|
|
121
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tag.Tag, {
|
|
122
|
+
label: tagLabel,
|
|
123
|
+
variant: tagVariant,
|
|
124
|
+
icon: tagIcon
|
|
125
|
+
})
|
|
126
|
+
}), (highlightRibbonIcon || highlightRibbonText) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(CardTopSectionRibbonContainer, {
|
|
127
|
+
"data-testid": 'card-topSection-ribbon',
|
|
128
|
+
$color: highlightRibbonContentColor ?? '',
|
|
129
|
+
$backgroundColor: disabled ? _index.COLORS.generateToken({
|
|
130
|
+
componentType: 'bg-fill',
|
|
131
|
+
state: 'disabled'
|
|
132
|
+
}, theme) : highlightRibbonBgColor ?? '',
|
|
133
|
+
children: [highlightRibbonIcon, highlightRibbonText && /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.ComponentS, {
|
|
134
|
+
color: disabled ? _index.COLORS.generateToken({
|
|
135
|
+
componentType: 'text',
|
|
136
|
+
isOnFill: true,
|
|
137
|
+
state: 'disabled'
|
|
138
|
+
}, theme) : highlightRibbonContentColor ?? '',
|
|
139
|
+
textStyle: _typography.ComponentTextStyle.Regular,
|
|
140
|
+
children: highlightRibbonText
|
|
141
|
+
})]
|
|
142
|
+
})]
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
CardTopSection.propTypes = {
|
|
146
|
+
selected: _propTypes.default.bool,
|
|
147
|
+
setSelected: _propTypes.default.func,
|
|
148
|
+
tagLabel: _propTypes.default.string,
|
|
149
|
+
tagIcon: _propTypes.default.node,
|
|
150
|
+
highlightRibbonText: _propTypes.default.string,
|
|
151
|
+
highlightRibbonIcon: _propTypes.default.node,
|
|
152
|
+
highlightRibbonContentColor: _propTypes.default.string,
|
|
153
|
+
highlightRibbonBgColor: _propTypes.default.string,
|
|
154
|
+
image: _propTypes.default.shape({
|
|
155
|
+
src: _propTypes.default.string.isRequired,
|
|
156
|
+
fallbackSrc: _propTypes.default.string,
|
|
157
|
+
alt: _propTypes.default.string.isRequired,
|
|
158
|
+
height: _propTypes.default.string,
|
|
159
|
+
width: _propTypes.default.string,
|
|
160
|
+
loader: _propTypes.default.bool
|
|
161
|
+
}),
|
|
162
|
+
disabled: _propTypes.default.bool
|
|
163
|
+
};
|
|
164
|
+
var _default = exports.default = CardTopSection;
|
|
165
|
+
//# sourceMappingURL=CardTopSection.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CardTopSection.cjs","names":["React","_interopRequireWildcard","require","_styledComponents","_typography","_Checkbox","_interopRequireDefault","_Tag","_index","_Image","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","CardTopSectionImageContainer","exports","styled","div","CardTopSectionTagContainer","CardTopSectionContainer","props","disabled","CardTopSectionRibbonContainer","$backgroundColor","$color","CardTopSectionCheckboxContainer","COLORS","getColor","theme","CardTopSection","forwardRef","_ref","ref","selected","setSelected","image","tagLabel","tagIcon","tagVariant","highlightRibbonIcon","highlightRibbonText","highlightRibbonContentColor","highlightRibbonBgColor","useTheme","jsxs","style","height","children","jsx","role","ImageWithFallbacks","fallbacks","fallbackSrc","src","alt","loader","width","select","Tag","label","variant","icon","generateToken","componentType","state","ComponentS","color","isOnFill","textStyle","ComponentTextStyle","Regular","propTypes","_propTypes","bool","func","string","node","shape","isRequired","_default"],"sources":["../../../src/Card/VerticalCard/CardTopSection.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport styled, { useTheme } from 'styled-components';\r\nimport {ComponentS, ComponentTextStyle} from '../../styles/typography';\r\nimport Checkbox from '../../InputFields/Checkbox';\r\nimport {Tag, TagVariants} from '../../Tag';\r\n\r\nimport {COLORS} from '../../index';\r\nimport {ImageWithFallbacks} from \"../../Image\";\r\n\r\nexport interface CardTopSectionProps {\r\n /** Sets initial state of select Checkbox. */\r\n selected?: boolean;\r\n /** If this action is provided, then Checkbox will be shown on the top-right corner of the Card. */\r\n setSelected?: (arg0: boolean) => void;\r\n /** Label shown in the tag in the top-left corner of the Card. */\r\n tagLabel?: string;\r\n /** Icon shown in the tag in the top-left corner of the Card. */\r\n tagIcon?: React.ReactNode;\r\n /** Tag variant shown in the tag in the top-left corner of the Card. */\r\n tagVariant?: TagVariants;\r\n /** Text shown in the Ribbon, under the Image. */\r\n highlightRibbonText?: string;\r\n /** Icon shown in the Ribbon, under the Image. */\r\n highlightRibbonIcon?: React.ReactNode;\r\n /** Content color (text and image) of the Ribbon, under the Image. */\r\n highlightRibbonContentColor?: string;\r\n /** Background color of the Ribbon, shown under the Image. */\r\n highlightRibbonBgColor?: string;\r\n /** Details of the Image shown in the section. */\r\n image?: { src: string; fallbackSrc?: string; alt: string, height?: string; width?: string; loader?: boolean };\r\n /** This property is automatically set in the Card itself and is based on 'disabled' flag of CardProps. */\r\n disabled?: boolean;\r\n}\r\n\r\nexport const CardTopSectionImageContainer = styled.div`\r\n border-top-right-radius: 8px;\r\n border-top-left-radius: 8px;\r\n height: 100%;\r\n width: 100%;\r\n img{\r\n object-fit: cover;\r\n width: 100%;\r\n height: 100%;\r\n border-top-right-radius: 8px;\r\n border-top-left-radius: 8px;\r\n }\r\n`;\r\n\r\nexport const CardTopSectionTagContainer = styled.div`\r\n position: absolute;\r\n\r\n top: 16px;\r\n left: 16px;\r\n width: calc(100% - 32px);\r\n`;\r\n\r\nexport const CardTopSectionContainer = styled.div<{ disabled?: boolean }>`\r\n position: relative;\r\n width: 100%;\r\n overflow: visible;\r\n\r\n ${props => props.disabled ? `\r\n img, svg {\r\n filter: grayscale(100%);\r\n }` : ''}\r\n`;\r\n\r\nexport const CardTopSectionRibbonContainer = styled.div<{ $color: string; $backgroundColor: string }>`\r\n min-height: calc(40px - 16px);\r\n background-color: ${props => props.$backgroundColor};\r\n width: calc(100% - 32px);\r\n position: absolute;\r\n bottom: 0px;\r\n left: 0px;\r\n padding: 8px 16px 8px 16px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n gap: 8px;\r\n\r\n svg {\r\n color: ${props => props.$color};\r\n width: 24px;\r\n height: 24px;\r\n flex-grow: 0;\r\n flex-shrink: 0;\r\n }\r\n`;\r\n\r\nexport const CardTopSectionCheckboxContainer = styled.div`\r\n position: absolute;\r\n top: 0;\r\n right: 0;\r\n z-index: 1;\r\n\r\n .checkbox-icon {\r\n background-color: ${props => COLORS.getColor('white', props.theme)};\r\n }\r\n`;\r\n\r\nconst CardTopSection = React.forwardRef(({\r\n selected,\r\n setSelected,\r\n image,\r\n tagLabel,\r\n tagIcon,\r\n tagVariant = 'positive',\r\n highlightRibbonIcon,\r\n highlightRibbonText,\r\n highlightRibbonContentColor,\r\n highlightRibbonBgColor,\r\n disabled\r\n }: CardTopSectionProps, ref: React.Ref<HTMLDivElement>) => {\r\n\r\n const theme = useTheme();\r\n return (\r\n <CardTopSectionContainer disabled={disabled} data-testid={'card-topSection'} style={{height: image?.height ?? 200}}>\r\n {\r\n image &&\r\n <CardTopSectionImageContainer role=\"none\" aria-hidden=\"true\">\r\n <ImageWithFallbacks fallbacks={image.fallbackSrc ?? ''} src={image.src} alt=\"\" loader={image.loader ?? false} width={image.width} height={image.height}/>\r\n </CardTopSectionImageContainer>\r\n }\r\n {(!!selected || !!setSelected) && (\r\n <CardTopSectionCheckboxContainer data-testid={'card-topSection-checkbox'}>\r\n <Checkbox ref={ref}\r\n disabled={disabled}\r\n select={(selected: boolean) => setSelected && setSelected(selected)}\r\n selected={selected || false}/>\r\n </CardTopSectionCheckboxContainer>\r\n )}\r\n {(tagLabel || tagIcon) && (\r\n <CardTopSectionTagContainer>\r\n <Tag label={tagLabel} variant={tagVariant} icon={tagIcon}/>\r\n </CardTopSectionTagContainer>\r\n )}\r\n {(highlightRibbonIcon || highlightRibbonText) && (\r\n <CardTopSectionRibbonContainer data-testid={'card-topSection-ribbon'} $color={highlightRibbonContentColor ?? ''}\r\n $backgroundColor={disabled ? COLORS.generateToken({componentType:'bg-fill', state:'disabled'}, theme) : highlightRibbonBgColor ?? ''}>\r\n {highlightRibbonIcon}\r\n {highlightRibbonText && (\r\n <ComponentS color={disabled ? COLORS.generateToken({componentType:'text', isOnFill: true, state:'disabled'}, theme) : highlightRibbonContentColor ?? ''} textStyle={ComponentTextStyle.Regular}>\r\n {highlightRibbonText}\r\n </ComponentS>\r\n )}\r\n </CardTopSectionRibbonContainer>\r\n )}\r\n </CardTopSectionContainer>\r\n );\r\n});\r\n\r\nexport default CardTopSection;\r\n"],"mappings":";;;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAF,uBAAA,CAAAC,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,IAAA,GAAAL,OAAA;AAEA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAA+C,IAAAQ,WAAA,GAAAR,OAAA;AAAA,SAAAS,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAX,wBAAAW,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UA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OAAA,GAwHK6B,cAAc","ignoreList":[]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { TagVariants } from '../../Tag';
|
|
3
|
+
export interface CardTopSectionProps {
|
|
4
|
+
/** Sets initial state of select Checkbox. */
|
|
5
|
+
selected?: boolean;
|
|
6
|
+
/** If this action is provided, then Checkbox will be shown on the top-right corner of the Card. */
|
|
7
|
+
setSelected?: (arg0: boolean) => void;
|
|
8
|
+
/** Label shown in the tag in the top-left corner of the Card. */
|
|
9
|
+
tagLabel?: string;
|
|
10
|
+
/** Icon shown in the tag in the top-left corner of the Card. */
|
|
11
|
+
tagIcon?: React.ReactNode;
|
|
12
|
+
/** Tag variant shown in the tag in the top-left corner of the Card. */
|
|
13
|
+
tagVariant?: TagVariants;
|
|
14
|
+
/** Text shown in the Ribbon, under the Image. */
|
|
15
|
+
highlightRibbonText?: string;
|
|
16
|
+
/** Icon shown in the Ribbon, under the Image. */
|
|
17
|
+
highlightRibbonIcon?: React.ReactNode;
|
|
18
|
+
/** Content color (text and image) of the Ribbon, under the Image. */
|
|
19
|
+
highlightRibbonContentColor?: string;
|
|
20
|
+
/** Background color of the Ribbon, shown under the Image. */
|
|
21
|
+
highlightRibbonBgColor?: string;
|
|
22
|
+
/** Details of the Image shown in the section. */
|
|
23
|
+
image?: {
|
|
24
|
+
src: string;
|
|
25
|
+
fallbackSrc?: string;
|
|
26
|
+
alt: string;
|
|
27
|
+
height?: string;
|
|
28
|
+
width?: string;
|
|
29
|
+
loader?: boolean;
|
|
30
|
+
};
|
|
31
|
+
/** This property is automatically set in the Card itself and is based on 'disabled' flag of CardProps. */
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export declare const CardTopSectionImageContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
35
|
+
export declare const CardTopSectionTagContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
36
|
+
export declare const CardTopSectionContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
}>> & string;
|
|
39
|
+
export declare const CardTopSectionRibbonContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
40
|
+
$color: string;
|
|
41
|
+
$backgroundColor: string;
|
|
42
|
+
}>> & string;
|
|
43
|
+
export declare const CardTopSectionCheckboxContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
44
|
+
declare const CardTopSection: React.ForwardRefExoticComponent<CardTopSectionProps & React.RefAttributes<HTMLDivElement>>;
|
|
45
|
+
export default CardTopSection;
|