@laerdal/life-react-components 3.0.1-dev.2 → 3.0.1-dev.20
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/dist/Accordion/AccordionItem.cjs +2 -2
- package/dist/Accordion/AccordionItem.cjs.map +1 -1
- package/dist/Accordion/AccordionItem.js +3 -3
- package/dist/Accordion/AccordionItem.js.map +1 -1
- package/dist/Accordion/index.cjs +46 -4
- package/dist/Accordion/index.cjs.map +1 -1
- package/dist/Accordion/index.d.ts +4 -1
- package/dist/Accordion/index.js +4 -1
- package/dist/Accordion/index.js.map +1 -1
- package/dist/Accordion/styles.cjs +6 -6
- package/dist/Accordion/styles.cjs.map +1 -1
- package/dist/Accordion/styles.d.ts +2 -2
- package/dist/Accordion/styles.js +3 -3
- package/dist/Accordion/styles.js.map +1 -1
- package/dist/AuthPage/AuthPage.cjs +4 -3
- package/dist/AuthPage/AuthPage.cjs.map +1 -1
- package/dist/AuthPage/AuthPage.d.ts +2 -1
- package/dist/AuthPage/AuthPage.js +2 -2
- package/dist/AuthPage/AuthPage.js.map +1 -1
- package/dist/AuthPage/index.cjs +31 -3
- package/dist/AuthPage/index.cjs.map +1 -1
- package/dist/AuthPage/index.d.ts +4 -3
- package/dist/AuthPage/index.js +4 -3
- package/dist/AuthPage/index.js.map +1 -1
- package/dist/Banners/Banner.cjs +16 -11
- package/dist/Banners/Banner.cjs.map +1 -1
- package/dist/Banners/Banner.d.ts +33 -1
- package/dist/Banners/Banner.js +10 -10
- package/dist/Banners/Banner.js.map +1 -1
- package/dist/Banners/OverviewBanner.cjs +7 -5
- package/dist/Banners/OverviewBanner.cjs.map +1 -1
- package/dist/Banners/OverviewBanner.d.ts +8 -2
- package/dist/Banners/OverviewBanner.js +4 -4
- package/dist/Banners/OverviewBanner.js.map +1 -1
- package/dist/Banners/index.cjs +31 -3
- package/dist/Banners/index.cjs.map +1 -1
- package/dist/Banners/index.d.ts +4 -3
- package/dist/Banners/index.js +4 -5
- package/dist/Banners/index.js.map +1 -1
- package/dist/Breadcrumb/Breadcrumb.cjs +2 -2
- package/dist/Breadcrumb/Breadcrumb.cjs.map +1 -1
- package/dist/Breadcrumb/Breadcrumb.d.ts +1 -1
- package/dist/Breadcrumb/Breadcrumb.js +3 -3
- package/dist/Breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/Breadcrumb/index.cjs +42 -2
- package/dist/Breadcrumb/index.cjs.map +1 -1
- package/dist/Breadcrumb/index.d.ts +3 -0
- package/dist/Breadcrumb/index.js +3 -0
- package/dist/Breadcrumb/index.js.map +1 -1
- package/dist/Breadcrumb/styles.cjs +5 -5
- package/dist/Breadcrumb/styles.cjs.map +1 -1
- package/dist/Breadcrumb/styles.d.ts +2 -2
- package/dist/Breadcrumb/styles.js +2 -2
- package/dist/Breadcrumb/styles.js.map +1 -1
- package/dist/Button/BackButton.cjs +2 -2
- package/dist/Button/BackButton.cjs.map +1 -1
- package/dist/Button/BackButton.d.ts +1 -1
- package/dist/Button/BackButton.js +2 -2
- package/dist/Button/BackButton.js.map +1 -1
- package/dist/Button/DualFunctionButton.cjs +3 -3
- package/dist/Button/DualFunctionButton.cjs.map +1 -1
- package/dist/Button/DualFunctionButton.js +4 -4
- package/dist/Button/DualFunctionButton.js.map +1 -1
- package/dist/Button/Iconbutton.cjs +10 -10
- package/dist/Button/Iconbutton.cjs.map +1 -1
- package/dist/Button/Iconbutton.d.ts +1 -1
- package/dist/Button/Iconbutton.js +8 -8
- package/dist/Button/Iconbutton.js.map +1 -1
- package/dist/Button/index.cjs +57 -5
- package/dist/Button/index.cjs.map +1 -1
- package/dist/Button/index.d.ts +4 -0
- package/dist/Button/index.js +4 -0
- package/dist/Button/index.js.map +1 -1
- package/dist/Card/VerticalCard/Card.cjs +7 -7
- package/dist/Card/VerticalCard/Card.cjs.map +1 -1
- package/dist/Card/VerticalCard/Card.d.ts +2 -2
- package/dist/Card/VerticalCard/Card.js +4 -4
- package/dist/Card/VerticalCard/Card.js.map +1 -1
- package/dist/Card/VerticalCard/CardBottomSection.cjs +21 -21
- package/dist/Card/VerticalCard/CardBottomSection.cjs.map +1 -1
- package/dist/Card/VerticalCard/CardBottomSection.d.ts +7 -7
- package/dist/Card/VerticalCard/CardBottomSection.js +13 -13
- package/dist/Card/VerticalCard/CardBottomSection.js.map +1 -1
- package/dist/Card/VerticalCard/CardMiddleSection.cjs +11 -11
- package/dist/Card/VerticalCard/CardMiddleSection.cjs.map +1 -1
- package/dist/Card/VerticalCard/CardMiddleSection.d.ts +3 -3
- package/dist/Card/VerticalCard/CardMiddleSection.js +7 -7
- package/dist/Card/VerticalCard/CardMiddleSection.js.map +1 -1
- package/dist/Card/VerticalCard/CardTopSection.cjs +13 -13
- package/dist/Card/VerticalCard/CardTopSection.cjs.map +1 -1
- package/dist/Card/VerticalCard/CardTopSection.d.ts +4 -4
- package/dist/Card/VerticalCard/CardTopSection.js +8 -8
- package/dist/Card/VerticalCard/CardTopSection.js.map +1 -1
- package/dist/Chips/index.cjs +19 -0
- package/dist/Chips/index.cjs.map +1 -1
- package/dist/Chips/index.d.ts +1 -0
- package/dist/Chips/index.js +1 -0
- package/dist/Chips/index.js.map +1 -1
- package/dist/Dropdown/BasicDropdown.cjs +3 -3
- package/dist/Dropdown/BasicDropdown.cjs.map +1 -1
- package/dist/Dropdown/BasicDropdown.d.ts +5 -5
- package/dist/Dropdown/BasicDropdown.js +4 -4
- package/dist/Dropdown/BasicDropdown.js.map +1 -1
- package/dist/Dropdown/CommonStyling.cjs +19 -19
- package/dist/Dropdown/CommonStyling.cjs.map +1 -1
- package/dist/Dropdown/CommonStyling.d.ts +9 -9
- package/dist/Dropdown/CommonStyling.js +9 -9
- package/dist/Dropdown/CommonStyling.js.map +1 -1
- package/dist/Dropdown/DropdownButton.cjs +9 -8
- package/dist/Dropdown/DropdownButton.cjs.map +1 -1
- package/dist/Dropdown/DropdownButton.d.ts +1 -0
- package/dist/Dropdown/DropdownButton.js +8 -8
- package/dist/Dropdown/DropdownButton.js.map +1 -1
- package/dist/Dropdown/DropdownContent.cjs +18 -16
- package/dist/Dropdown/DropdownContent.cjs.map +1 -1
- package/dist/Dropdown/DropdownContent.d.ts +10 -1
- package/dist/Dropdown/DropdownContent.js +15 -15
- package/dist/Dropdown/DropdownContent.js.map +1 -1
- package/dist/Dropdown/DropdownFilter.cjs +3 -3
- package/dist/Dropdown/DropdownFilter.cjs.map +1 -1
- package/dist/Dropdown/DropdownFilter.d.ts +1 -1
- package/dist/Dropdown/DropdownFilter.js +4 -4
- package/dist/Dropdown/DropdownFilter.js.map +1 -1
- package/dist/Dropdown/index.cjs +57 -5
- package/dist/Dropdown/index.cjs.map +1 -1
- package/dist/Dropdown/index.d.ts +4 -0
- package/dist/Dropdown/index.js +4 -0
- package/dist/Dropdown/index.js.map +1 -1
- package/dist/InputFields/DatepickerField.cjs +80 -4
- package/dist/InputFields/DatepickerField.cjs.map +1 -1
- package/dist/InputFields/DatepickerField.d.ts +2 -0
- package/dist/InputFields/DatepickerField.js +80 -4
- package/dist/InputFields/DatepickerField.js.map +1 -1
- package/dist/InputFields/NumberField.cjs +1 -1
- package/dist/InputFields/NumberField.cjs.map +1 -1
- package/dist/InputFields/NumberField.js +1 -1
- package/dist/InputFields/NumberField.js.map +1 -1
- package/dist/ProfileButton/ProfileButton.cjs +1 -1
- package/dist/ProfileButton/ProfileButton.cjs.map +1 -1
- package/dist/ProfileButton/ProfileButton.js +2 -2
- package/dist/ProfileButton/ProfileButton.js.map +1 -1
- package/dist/Table/Table.cjs +18 -6
- package/dist/Table/Table.cjs.map +1 -1
- package/dist/Table/Table.js +18 -6
- package/dist/Table/Table.js.map +1 -1
- package/dist/Table/TableBody.cjs +6 -4
- package/dist/Table/TableBody.cjs.map +1 -1
- package/dist/Table/TableBody.js +6 -4
- package/dist/Table/TableBody.js.map +1 -1
- package/dist/Table/TableStyles.cjs +4 -1
- package/dist/Table/TableStyles.cjs.map +1 -1
- package/dist/Table/TableStyles.d.ts +3 -1
- package/dist/Table/TableStyles.js +4 -1
- package/dist/Table/TableStyles.js.map +1 -1
- package/dist/Table/TableTypes.cjs.map +1 -1
- package/dist/Table/TableTypes.d.ts +2 -0
- package/dist/Table/TableTypes.js.map +1 -1
- package/dist/Toggles/ToggleButton.cjs +3 -2
- package/dist/Toggles/ToggleButton.cjs.map +1 -1
- package/dist/Toggles/ToggleButton.js +4 -3
- package/dist/Toggles/ToggleButton.js.map +1 -1
- package/dist/Toggles/ToggleSwitch.cjs +3 -0
- package/dist/Toggles/ToggleSwitch.cjs.map +1 -1
- package/dist/Toggles/ToggleSwitch.js +3 -0
- package/dist/Toggles/ToggleSwitch.js.map +1 -1
- package/dist/Toggles/TogglerStyles.cjs +5 -10
- package/dist/Toggles/TogglerStyles.cjs.map +1 -1
- package/dist/Toggles/TogglerStyles.js +5 -7
- package/dist/Toggles/TogglerStyles.js.map +1 -1
- package/dist/Tooltips/TooltipStyles.cjs +1 -1
- package/dist/Tooltips/TooltipStyles.cjs.map +1 -1
- package/dist/Tooltips/TooltipStyles.js +1 -1
- package/dist/Tooltips/TooltipStyles.js.map +1 -1
- package/dist/styles/z-indexes.cjs +1 -0
- package/dist/styles/z-indexes.cjs.map +1 -1
- package/dist/styles/z-indexes.d.ts +1 -0
- package/dist/styles/z-indexes.js +1 -0
- package/dist/styles/z-indexes.js.map +1 -1
- package/package.json +2 -2
|
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.default = exports.
|
|
8
|
+
exports.default = exports.CardBottomSectionProgressStyles = exports.CardBottomSectionNotesStyles = exports.CardBottomSectionNoteRightStyles = exports.CardBottomSectionNoteLeftStyles = exports.CardBottomSectionDivider = exports.CardBottomSectionContainer = exports.CardBottomSectionButtonRowContainerStyles = exports.CardBottomSectionAuthorStyles = void 0;
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
@@ -17,22 +17,22 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
17
17
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
|
|
18
18
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
19
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
20
|
-
var
|
|
21
|
-
exports.
|
|
22
|
-
var
|
|
23
|
-
exports.
|
|
24
|
-
var
|
|
20
|
+
var CardBottomSectionProgressStyles = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n padding: 8px 0;\n"])));
|
|
21
|
+
exports.CardBottomSectionProgressStyles = CardBottomSectionProgressStyles;
|
|
22
|
+
var CardBottomSectionNotesStyles = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n height: 48px;\n position: relative;\n color: ", ";\n display: flex;\n flex-direction: row;\n align-items: center;\n"])), _index.COLORS.neutral_500);
|
|
23
|
+
exports.CardBottomSectionNotesStyles = CardBottomSectionNotesStyles;
|
|
24
|
+
var CardBottomSectionAuthorStyles = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: row;\n align-items: center;\n height: 48px;\n\n div:first-child {\n flex-grow: 2;\n }\n\n svg, img {\n width: 80px;\n flex-grow: 0;\n flex-shrink: 0;\n }\n\n ", "\n"])), function (props) {
|
|
25
25
|
return props.disabled ? "\n color: ".concat(_index.COLORS.neutral_300, ";\n svg, img {\n filter: grayscale(100%);\n }\n \n ") : '';
|
|
26
26
|
});
|
|
27
|
-
exports.
|
|
28
|
-
var
|
|
29
|
-
exports.
|
|
30
|
-
var
|
|
31
|
-
exports.
|
|
32
|
-
var
|
|
33
|
-
exports.
|
|
34
|
-
var
|
|
35
|
-
exports.
|
|
27
|
+
exports.CardBottomSectionAuthorStyles = CardBottomSectionAuthorStyles;
|
|
28
|
+
var CardBottomSectionDivider = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n border-top: 1px;\n border-top-color: ", ";\n border-top-style: solid;\n width: 100%;\n"])), _index.COLORS.neutral_100);
|
|
29
|
+
exports.CardBottomSectionDivider = CardBottomSectionDivider;
|
|
30
|
+
var CardBottomSectionNoteLeftStyles = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n left: 0px;\n display: flex;\n flex-direction: row;\n align-items: center;\n\n svg {\n margin-right: 4px;\n flex-grow: 0;\n flex-shrink: 0;\n }\n"])));
|
|
31
|
+
exports.CardBottomSectionNoteLeftStyles = CardBottomSectionNoteLeftStyles;
|
|
32
|
+
var CardBottomSectionNoteRightStyles = _styledComponents.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n right: 0px;\n display: flex;\n flex-direction: row;\n align-items: center;\n\n svg {\n margin-right: 4px;\n flex-grow: 0;\n flex-shrink: 0;\n }\n"])));
|
|
33
|
+
exports.CardBottomSectionNoteRightStyles = CardBottomSectionNoteRightStyles;
|
|
34
|
+
var CardBottomSectionButtonRowContainerStyles = _styledComponents.default.div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: row;\n justify-content: flex-end;\n align-items: center;\n border-top: 1px;\n border-top-color: ", ";\n border-top-style: solid;\n\n button:last-child {\n margin: 8px 0px 0px 0px;\n }\n\n button:not(:last-child) {\n margin: 8px 0px 0px 0px;\n }\n\n svg {\n color: ", ";\n }\n"])), _index.COLORS.neutral_100, _index.COLORS.neutral_600);
|
|
35
|
+
exports.CardBottomSectionButtonRowContainerStyles = CardBottomSectionButtonRowContainerStyles;
|
|
36
36
|
var CardBottomSectionContainer = _styledComponents.default.div(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n padding: 0px 16px 8px 16px;\n width: calc(100% - 32px);\n"])));
|
|
37
37
|
exports.CardBottomSectionContainer = CardBottomSectionContainer;
|
|
38
38
|
var CardBottomSection = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
@@ -64,7 +64,7 @@ var CardBottomSection = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
64
64
|
var haveAtLeastSomething = progressLevel != undefined || noteLeft || noteLeftIcon || noteRight || noteRightIcon || authorName;
|
|
65
65
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(CardBottomSectionContainer, {
|
|
66
66
|
"data-testid": 'card-bottomSection',
|
|
67
|
-
children: [haveAtLeastSomething && /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
67
|
+
children: [haveAtLeastSomething && /*#__PURE__*/(0, _jsxRuntime.jsx)(CardBottomSectionDivider, {}), progressLevel != undefined && /*#__PURE__*/(0, _jsxRuntime.jsx)(CardBottomSectionProgressStyles, {
|
|
68
68
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.LinearProgress, {
|
|
69
69
|
size: _index.Size.Small,
|
|
70
70
|
type: progressType,
|
|
@@ -72,27 +72,27 @@ var CardBottomSection = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
72
72
|
value: progressLevel,
|
|
73
73
|
max: progressMax !== null && progressMax !== void 0 ? progressMax : progressLevel
|
|
74
74
|
})
|
|
75
|
-
}), (noteLeft || noteLeftIcon || noteRight || noteRightIcon) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
76
|
-
children: [(noteLeft || noteLeftIcon) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
75
|
+
}), (noteLeft || noteLeftIcon || noteRight || noteRightIcon) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(CardBottomSectionNotesStyles, {
|
|
76
|
+
children: [(noteLeft || noteLeftIcon) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(CardBottomSectionNoteLeftStyles, {
|
|
77
77
|
children: [noteLeftIcon, /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ComponentXXS, {
|
|
78
78
|
color: _index.COLORS.neutral_500,
|
|
79
79
|
textStyle: _index.ComponentTextStyle.Bold,
|
|
80
80
|
children: noteLeft
|
|
81
81
|
})]
|
|
82
|
-
}), (noteRight || noteRightIcon) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
82
|
+
}), (noteRight || noteRightIcon) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(CardBottomSectionNoteRightStyles, {
|
|
83
83
|
children: [noteRightIcon, /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ComponentXXS, {
|
|
84
84
|
color: _index.COLORS.neutral_500,
|
|
85
85
|
textStyle: _index.ComponentTextStyle.Bold,
|
|
86
86
|
children: noteRight
|
|
87
87
|
})]
|
|
88
88
|
})]
|
|
89
|
-
}), (authorName || logo) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
89
|
+
}), (authorName || logo) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(CardBottomSectionAuthorStyles, {
|
|
90
90
|
disabled: disabled,
|
|
91
91
|
"data-testid": 'card-bottomSection-author',
|
|
92
92
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ComponentXXS, {
|
|
93
93
|
children: authorName
|
|
94
94
|
}), logo]
|
|
95
|
-
}), actions && /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
95
|
+
}), actions && /*#__PURE__*/(0, _jsxRuntime.jsx)(CardBottomSectionButtonRowContainerStyles, {
|
|
96
96
|
children: actions.map(function (x, index) {
|
|
97
97
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.IconButton, {
|
|
98
98
|
ref: elRefs[index],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardBottomSection.cjs","names":["CardProgressContainer","styled","div","CardNotesContainer","COLORS","neutral_500","CardAuthorContainer","props","disabled","neutral_300","CardBottomDivider","neutral_100","CardNoteLeft","CardNoteRight","CardButtonRowContainer","neutral_600","CardBottomSectionContainer","CardBottomSection","React","forwardRef","ref","progressLevel","progressMax","progressType","LinearProgressType","Line","noteLeft","noteLeftIcon","noteRight","noteRightIcon","authorName","logo","actions","useState","elRefs","setElRefs","length","useEffect","Array","fill","map","createRef","useImperativeHandle","haveAtLeastSomething","undefined","Size","Small","LinearProgressVariant","Normal","ComponentTextStyle","Bold","x","index","e","onClick","icon"],"sources":["../../../src/Card/VerticalCard/CardBottomSection.tsx"],"sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport {\n COLORS,\n ComponentTextStyle,\n ComponentXXS,\n LinearProgress,\n LinearProgressType,\n LinearProgressVariant,\n Size\n} from '../../index';\nimport {IconButton} from '../../Button';\n\nexport interface ActionItem {\n icon: React.ReactNode;\n onClick: () => void;\n}\n\nexport interface CardBottomSectionProps {\n progressLevel?: number;\n progressMax?: number;\n progressType?: LinearProgressType;\n\n noteLeft?: string;\n noteLeftIcon?: React.ReactNode;\n noteRight?: string;\n noteRightIcon?: React.ReactNode;\n\n authorName?: string;\n actions?: ActionItem[];\n logo?: React.ReactNode;\n disabled?: boolean;\n}\n\nexport const CardProgressContainer = styled.div`\n padding: 8px 0;\n`;\n\nexport const CardNotesContainer = styled.div`\n height: 48px;\n position: relative;\n color: ${COLORS.neutral_500};\n display: flex;\n flex-direction: row;\n align-items: center;\n`;\n\nexport const CardAuthorContainer = styled.div<{ disabled?: boolean }>`\n display: flex;\n flex-direction: row;\n align-items: center;\n height: 48px;\n\n div:first-child {\n flex-grow: 2;\n }\n\n svg, img {\n width: 80px;\n flex-grow: 0;\n flex-shrink: 0;\n }\n\n ${props => props.disabled ? `\n color: ${COLORS.neutral_300};\n svg, img {\n filter: grayscale(100%);\n }\n \n ` : ''}\n`;\n\nexport const CardBottomDivider = styled.div`\n border-top: 1px;\n border-top-color: ${COLORS.neutral_100};\n border-top-style: solid;\n width: 100%;\n`;\n\nexport const CardNoteLeft = styled.div`\n position: absolute;\n left: 0px;\n display: flex;\n flex-direction: row;\n align-items: center;\n\n svg {\n margin-right: 4px;\n flex-grow: 0;\n flex-shrink: 0;\n }\n`;\n\nexport const CardNoteRight = styled.div`\n position: absolute;\n right: 0px;\n display: flex;\n flex-direction: row;\n align-items: center;\n\n svg {\n margin-right: 4px;\n flex-grow: 0;\n flex-shrink: 0;\n }\n`;\n\nexport const CardButtonRowContainer = styled.div`\n display: flex;\n flex-direction: row;\n justify-content: flex-end;\n align-items: center;\n border-top: 1px;\n border-top-color: ${COLORS.neutral_100};\n border-top-style: solid;\n\n button:last-child {\n margin: 8px 0px 0px 0px;\n }\n\n button:not(:last-child) {\n margin: 8px 0px 0px 0px;\n }\n\n svg {\n color: ${COLORS.neutral_600};\n }\n`;\n\nexport const CardBottomSectionContainer = styled.div`\n padding: 0px 16px 8px 16px;\n width: calc(100% - 32px);\n`;\n\nconst CardBottomSection = React.forwardRef(({\n progressLevel,\n progressMax,\n progressType = LinearProgressType.Line,\n noteLeft,\n noteLeftIcon,\n noteRight,\n noteRightIcon,\n authorName,\n logo,\n actions,\n disabled\n }: CardBottomSectionProps,\n ref: React.Ref<React.RefObject<HTMLButtonElement>[]>) => {\n\n const [elRefs, setElRefs] = React.useState<React.RefObject<HTMLButtonElement>[]>([]);\n\n const length = actions?.length || 0;\n\n React.useEffect(() => {\n setElRefs(Array(length || 0).fill(null).map(() => React.createRef<HTMLButtonElement>()));\n }, [length]);\n\n React.useImperativeHandle(ref, () => elRefs, [elRefs]);\n\n const haveAtLeastSomething = progressLevel != undefined || noteLeft || noteLeftIcon || noteRight || noteRightIcon || authorName;\n\n return (\n <CardBottomSectionContainer data-testid={'card-bottomSection'}>\n {haveAtLeastSomething && <CardBottomDivider/>}\n {progressLevel != undefined && <CardProgressContainer>\n <LinearProgress size={Size.Small}\n type={progressType}\n variant={LinearProgressVariant.Normal}\n value={progressLevel}\n max={progressMax ?? progressLevel}/>\n </CardProgressContainer>}\n\n {(noteLeft || noteLeftIcon || noteRight || noteRightIcon) && <CardNotesContainer>\n {(noteLeft || noteLeftIcon) && (\n <CardNoteLeft>\n {noteLeftIcon}\n <ComponentXXS color={COLORS.neutral_500} textStyle={ComponentTextStyle.Bold}>{noteLeft}</ComponentXXS>\n </CardNoteLeft>\n )}\n {(noteRight || noteRightIcon) && (\n <CardNoteRight>\n {noteRightIcon}\n <ComponentXXS color={COLORS.neutral_500} textStyle={ComponentTextStyle.Bold}>{noteRight}</ComponentXXS>\n </CardNoteRight>\n )}\n </CardNotesContainer>}\n\n {(authorName || logo) && <CardAuthorContainer disabled={disabled} data-testid={'card-bottomSection-author'}>\n <ComponentXXS>{authorName}</ComponentXXS>\n {logo}\n </CardAuthorContainer>}\n\n {actions && <CardButtonRowContainer>\n {actions.map((x, index) => (\n <IconButton ref={elRefs[index]}\n key={index}\n disabled={disabled}\n variant=\"secondary\"\n shape=\"circular\"\n action={(e) => {\n x.onClick();\n }}>\n {x.icon}\n </IconButton>\n ))}\n </CardButtonRowContainer>}\n </CardBottomSectionContainer>\n );\n});\n\nexport default CardBottomSection;\n"],"mappings":";;;;;;;;;;;AAAA;AACA;AACA;AASA;AAAwC;AAAA;AAAA;AAAA;AAuBjC,IAAMA,qBAAqB,GAAGC,yBAAM,CAACC,GAAG,wGAE9C;AAAC;AAEK,IAAMC,kBAAkB,GAAGF,yBAAM,CAACC,GAAG,kNAGjCE,aAAM,CAACC,WAAW,CAI5B;AAAC;AAEK,IAAMC,mBAAmB,GAAGL,yBAAM,CAACC,GAAG,mTAgBzC,UAAAK,KAAK;EAAA,OAAIA,KAAK,CAACC,QAAQ,0BACdJ,aAAM,CAACK,WAAW,0EAKzB,EAAE;AAAA,EACP;AAAC;AAEK,IAAMC,iBAAiB,GAAGT,yBAAM,CAACC,GAAG,mLAErBE,aAAM,CAACO,WAAW,CAGvC;AAAC;AAEK,IAAMC,YAAY,GAAGX,yBAAM,CAACC,GAAG,8QAYrC;AAAC;AAEK,IAAMW,aAAa,GAAGZ,yBAAM,CAACC,GAAG,+QAYtC;AAAC;AAEK,IAAMY,sBAAsB,GAAGb,yBAAM,CAACC,GAAG,maAM1BE,aAAM,CAACO,WAAW,EAY3BP,aAAM,CAACW,WAAW,CAE9B;AAAC;AAEK,IAAMC,0BAA0B,GAAGf,yBAAM,CAACC,GAAG,mJAGnD;AAAC;AAEF,IAAMe,iBAAiB,gBAAGC,KAAK,CAACC,UAAU,CAAC,gBAaCC,GAAoD,EAAK;EAAA,IAZvDC,aAAa,QAAbA,aAAa;IACbC,WAAW,QAAXA,WAAW;IAAA,yBACXC,YAAY;IAAZA,YAAY,kCAAGC,yBAAkB,CAACC,IAAI;IACtCC,QAAQ,QAARA,QAAQ;IACRC,YAAY,QAAZA,YAAY;IACZC,SAAS,QAATA,SAAS;IACTC,aAAa,QAAbA,aAAa;IACbC,UAAU,QAAVA,UAAU;IACVC,IAAI,QAAJA,IAAI;IACJC,OAAO,QAAPA,OAAO;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ectionProgressStyles","styled","div","CardBottomSectionNotesStyles","COLORS","neutral_500","CardBottomSectionAuthorStyles","props","disabled","neutral_300","CardBottomSectionDivider","neutral_100","CardBottomSectionNoteLeftStyles","CardBottomSectionNoteRightStyles","CardBottomSectionButtonRowContainerStyles","neutral_600","CardBottomSectionContainer","CardBottomSection","React","forwardRef","ref","progressLevel","progressMax","progressType","LinearProgressType","Line","noteLeft","noteLeftIcon","noteRight","noteRightIcon","authorName","logo","actions","useState","elRefs","setElRefs","length","useEffect","Array","fill","map","createRef","useImperativeHandle","haveAtLeastSomething","undefined","Size","Small","LinearProgressVariant","Normal","ComponentTextStyle","Bold","x","index","e","onClick","icon"],"sources":["../../../src/Card/VerticalCard/CardBottomSection.tsx"],"sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport {\n COLORS,\n ComponentTextStyle,\n ComponentXXS,\n LinearProgress,\n LinearProgressType,\n LinearProgressVariant,\n Size\n} from '../../index';\nimport {IconButton} from '../../Button';\n\nexport interface ActionItem {\n icon: React.ReactNode;\n onClick: () => void;\n}\n\nexport interface CardBottomSectionProps {\n progressLevel?: number;\n progressMax?: number;\n progressType?: LinearProgressType;\n\n noteLeft?: string;\n noteLeftIcon?: React.ReactNode;\n noteRight?: string;\n noteRightIcon?: React.ReactNode;\n\n authorName?: string;\n actions?: ActionItem[];\n logo?: React.ReactNode;\n disabled?: boolean;\n}\n\nexport const CardBottomSectionProgressStyles = styled.div`\n padding: 8px 0;\n`;\n\nexport const CardBottomSectionNotesStyles = styled.div`\n height: 48px;\n position: relative;\n color: ${COLORS.neutral_500};\n display: flex;\n flex-direction: row;\n align-items: center;\n`;\n\nexport const CardBottomSectionAuthorStyles = styled.div<{ disabled?: boolean }>`\n display: flex;\n flex-direction: row;\n align-items: center;\n height: 48px;\n\n div:first-child {\n flex-grow: 2;\n }\n\n svg, img {\n width: 80px;\n flex-grow: 0;\n flex-shrink: 0;\n }\n\n ${props => props.disabled ? `\n color: ${COLORS.neutral_300};\n svg, img {\n filter: grayscale(100%);\n }\n \n ` : ''}\n`;\n\nexport const CardBottomSectionDivider = styled.div`\n border-top: 1px;\n border-top-color: ${COLORS.neutral_100};\n border-top-style: solid;\n width: 100%;\n`;\n\nexport const CardBottomSectionNoteLeftStyles = styled.div`\n position: absolute;\n left: 0px;\n display: flex;\n flex-direction: row;\n align-items: center;\n\n svg {\n margin-right: 4px;\n flex-grow: 0;\n flex-shrink: 0;\n }\n`;\n\nexport const CardBottomSectionNoteRightStyles = styled.div`\n position: absolute;\n right: 0px;\n display: flex;\n flex-direction: row;\n align-items: center;\n\n svg {\n margin-right: 4px;\n flex-grow: 0;\n flex-shrink: 0;\n }\n`;\n\nexport const CardBottomSectionButtonRowContainerStyles = styled.div`\n display: flex;\n flex-direction: row;\n justify-content: flex-end;\n align-items: center;\n border-top: 1px;\n border-top-color: ${COLORS.neutral_100};\n border-top-style: solid;\n\n button:last-child {\n margin: 8px 0px 0px 0px;\n }\n\n button:not(:last-child) {\n margin: 8px 0px 0px 0px;\n }\n\n svg {\n color: ${COLORS.neutral_600};\n }\n`;\n\nexport const CardBottomSectionContainer = styled.div`\n padding: 0px 16px 8px 16px;\n width: calc(100% - 32px);\n`;\n\nconst CardBottomSection = React.forwardRef(({\n progressLevel,\n progressMax,\n progressType = LinearProgressType.Line,\n noteLeft,\n noteLeftIcon,\n noteRight,\n noteRightIcon,\n authorName,\n logo,\n actions,\n disabled\n }: CardBottomSectionProps,\n ref: React.Ref<React.RefObject<HTMLButtonElement>[]>) => {\n\n const [elRefs, setElRefs] = React.useState<React.RefObject<HTMLButtonElement>[]>([]);\n\n const length = actions?.length || 0;\n\n React.useEffect(() => {\n setElRefs(Array(length || 0).fill(null).map(() => React.createRef<HTMLButtonElement>()));\n }, [length]);\n\n React.useImperativeHandle(ref, () => elRefs, [elRefs]);\n\n const haveAtLeastSomething = progressLevel != undefined || noteLeft || noteLeftIcon || noteRight || noteRightIcon || authorName;\n\n return (\n <CardBottomSectionContainer data-testid={'card-bottomSection'}>\n {haveAtLeastSomething && <CardBottomSectionDivider/>}\n {progressLevel != undefined && <CardBottomSectionProgressStyles>\n <LinearProgress size={Size.Small}\n type={progressType}\n variant={LinearProgressVariant.Normal}\n value={progressLevel}\n max={progressMax ?? progressLevel}/>\n </CardBottomSectionProgressStyles>}\n\n {(noteLeft || noteLeftIcon || noteRight || noteRightIcon) && <CardBottomSectionNotesStyles>\n {(noteLeft || noteLeftIcon) && (\n <CardBottomSectionNoteLeftStyles>\n {noteLeftIcon}\n <ComponentXXS color={COLORS.neutral_500} textStyle={ComponentTextStyle.Bold}>{noteLeft}</ComponentXXS>\n </CardBottomSectionNoteLeftStyles>\n )}\n {(noteRight || noteRightIcon) && (\n <CardBottomSectionNoteRightStyles>\n {noteRightIcon}\n <ComponentXXS color={COLORS.neutral_500} textStyle={ComponentTextStyle.Bold}>{noteRight}</ComponentXXS>\n </CardBottomSectionNoteRightStyles>\n )}\n </CardBottomSectionNotesStyles>}\n\n {(authorName || logo) && <CardBottomSectionAuthorStyles disabled={disabled} data-testid={'card-bottomSection-author'}>\n <ComponentXXS>{authorName}</ComponentXXS>\n {logo}\n </CardBottomSectionAuthorStyles>}\n\n {actions && <CardBottomSectionButtonRowContainerStyles>\n {actions.map((x, index) => (\n <IconButton ref={elRefs[index]}\n key={index}\n disabled={disabled}\n variant=\"secondary\"\n shape=\"circular\"\n action={(e) => {\n x.onClick();\n }}>\n {x.icon}\n </IconButton>\n ))}\n </CardBottomSectionButtonRowContainerStyles>}\n </CardBottomSectionContainer>\n );\n});\n\nexport default CardBottomSection;\n"],"mappings":";;;;;;;;;;;AAAA;AACA;AACA;AASA;AAAwC;AAAA;AAAA;AAAA;AAuBjC,IAAMA,+BAA+B,GAAGC,yBAAM,CAACC,GAAG,wGAExD;AAAC;AAEK,IAAMC,4BAA4B,GAAGF,yBAAM,CAACC,GAAG,kNAG3CE,aAAM,CAACC,WAAW,CAI5B;AAAC;AAEK,IAAMC,6BAA6B,GAAGL,yBAAM,CAAC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AAA,EAE1G;IAAA,EAC4B,EAE9B,CAACE,UAAU,IAAIC,IAAI,kBAAK,sBAAC,6BAA6B;MAAC,QAAQ,EAAEvB,QAAS;MAAC,eAAa,2BAA4B;MAAA,wBACnH,qBAAC,mBAAY;QAAA,UAAEsB;MAAU,EAAgB,EACxCC,IAAI;IAAA,EACyB,EAE/BC,OAAO,iBAAI,qBAAC,yCAAyC;MAAA,UACnDA,OAAO,CAACQ,GAAG,CAAC,UAACW,CAAC,EAAEC,KAAK;QAAA,oBACpB,qBAAC,kBAAU;UAAC,GAAG,EAAElB,MAAM,CAACkB,KAAK,CAAE;UAEnB,QAAQ,EAAE5C,QAAS;UACnB,OAAO,EAAC,WAAW;UACnB,KAAK,EAAC,UAAU;UAChB,MAAM,EAAE,gBAAC6C,CAAC,EAAK;YACbF,CAAC,CAACG,OAAO,EAAE;UACb,CAAE;UAAA,UACXH,CAAC,CAACI;QAAI,GAPQH,KAAK,CAQT;MAAA,CACd;IAAC,EACwC;EAAA,EACjB;AAEjC,CAAC,CAAC;AAAC;EA7LD/B,aAAa;EACbC,WAAW;EAGXI,QAAQ;EACRC,YAAY;EACZC,SAAS;EACTC,aAAa;EAEbC,UAAU;EACVE,OAAO;IAfPuB,IAAI;IACJD,OAAO;EAAA;EAePvB,IAAI;EACJvB,QAAQ;AAAA;AAAA,eAmLKS,iBAAiB;AAAA"}
|
|
@@ -17,15 +17,15 @@ export interface CardBottomSectionProps {
|
|
|
17
17
|
logo?: React.ReactNode;
|
|
18
18
|
disabled?: boolean;
|
|
19
19
|
}
|
|
20
|
-
export declare const
|
|
21
|
-
export declare const
|
|
22
|
-
export declare const
|
|
20
|
+
export declare const CardBottomSectionProgressStyles: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
21
|
+
export declare const CardBottomSectionNotesStyles: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
22
|
+
export declare const CardBottomSectionAuthorStyles: import("styled-components").StyledComponent<"div", any, {
|
|
23
23
|
disabled?: boolean | undefined;
|
|
24
24
|
}, never>;
|
|
25
|
-
export declare const
|
|
26
|
-
export declare const
|
|
27
|
-
export declare const
|
|
28
|
-
export declare const
|
|
25
|
+
export declare const CardBottomSectionDivider: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
26
|
+
export declare const CardBottomSectionNoteLeftStyles: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
27
|
+
export declare const CardBottomSectionNoteRightStyles: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
28
|
+
export declare const CardBottomSectionButtonRowContainerStyles: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
29
29
|
export declare const CardBottomSectionContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
30
30
|
declare const CardBottomSection: React.ForwardRefExoticComponent<CardBottomSectionProps & React.RefAttributes<React.RefObject<HTMLButtonElement>[]>>;
|
|
31
31
|
export default CardBottomSection;
|
|
@@ -8,15 +8,15 @@ import { COLORS, ComponentTextStyle, ComponentXXS, LinearProgress, LinearProgres
|
|
|
8
8
|
import { IconButton } from '../../Button';
|
|
9
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
10
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
-
export var
|
|
12
|
-
export var
|
|
13
|
-
export var
|
|
11
|
+
export var CardBottomSectionProgressStyles = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: 8px 0;\n"])));
|
|
12
|
+
export var CardBottomSectionNotesStyles = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n height: 48px;\n position: relative;\n color: ", ";\n display: flex;\n flex-direction: row;\n align-items: center;\n"])), COLORS.neutral_500);
|
|
13
|
+
export var CardBottomSectionAuthorStyles = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n align-items: center;\n height: 48px;\n\n div:first-child {\n flex-grow: 2;\n }\n\n svg, img {\n width: 80px;\n flex-grow: 0;\n flex-shrink: 0;\n }\n\n ", "\n"])), function (props) {
|
|
14
14
|
return props.disabled ? "\n color: ".concat(COLORS.neutral_300, ";\n svg, img {\n filter: grayscale(100%);\n }\n \n ") : '';
|
|
15
15
|
});
|
|
16
|
-
export var
|
|
17
|
-
export var
|
|
18
|
-
export var
|
|
19
|
-
export var
|
|
16
|
+
export var CardBottomSectionDivider = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n border-top: 1px;\n border-top-color: ", ";\n border-top-style: solid;\n width: 100%;\n"])), COLORS.neutral_100);
|
|
17
|
+
export var CardBottomSectionNoteLeftStyles = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n position: absolute;\n left: 0px;\n display: flex;\n flex-direction: row;\n align-items: center;\n\n svg {\n margin-right: 4px;\n flex-grow: 0;\n flex-shrink: 0;\n }\n"])));
|
|
18
|
+
export var CardBottomSectionNoteRightStyles = styled.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n position: absolute;\n right: 0px;\n display: flex;\n flex-direction: row;\n align-items: center;\n\n svg {\n margin-right: 4px;\n flex-grow: 0;\n flex-shrink: 0;\n }\n"])));
|
|
19
|
+
export var CardBottomSectionButtonRowContainerStyles = styled.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n justify-content: flex-end;\n align-items: center;\n border-top: 1px;\n border-top-color: ", ";\n border-top-style: solid;\n\n button:last-child {\n margin: 8px 0px 0px 0px;\n }\n\n button:not(:last-child) {\n margin: 8px 0px 0px 0px;\n }\n\n svg {\n color: ", ";\n }\n"])), COLORS.neutral_100, COLORS.neutral_600);
|
|
20
20
|
export var CardBottomSectionContainer = styled.div(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n padding: 0px 16px 8px 16px;\n width: calc(100% - 32px);\n"])));
|
|
21
21
|
var CardBottomSection = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
22
22
|
var progressLevel = _ref.progressLevel,
|
|
@@ -47,7 +47,7 @@ var CardBottomSection = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
47
47
|
var haveAtLeastSomething = progressLevel != undefined || noteLeft || noteLeftIcon || noteRight || noteRightIcon || authorName;
|
|
48
48
|
return /*#__PURE__*/_jsxs(CardBottomSectionContainer, {
|
|
49
49
|
"data-testid": 'card-bottomSection',
|
|
50
|
-
children: [haveAtLeastSomething && /*#__PURE__*/_jsx(
|
|
50
|
+
children: [haveAtLeastSomething && /*#__PURE__*/_jsx(CardBottomSectionDivider, {}), progressLevel != undefined && /*#__PURE__*/_jsx(CardBottomSectionProgressStyles, {
|
|
51
51
|
children: /*#__PURE__*/_jsx(LinearProgress, {
|
|
52
52
|
size: Size.Small,
|
|
53
53
|
type: progressType,
|
|
@@ -55,27 +55,27 @@ var CardBottomSection = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
55
55
|
value: progressLevel,
|
|
56
56
|
max: progressMax !== null && progressMax !== void 0 ? progressMax : progressLevel
|
|
57
57
|
})
|
|
58
|
-
}), (noteLeft || noteLeftIcon || noteRight || noteRightIcon) && /*#__PURE__*/_jsxs(
|
|
59
|
-
children: [(noteLeft || noteLeftIcon) && /*#__PURE__*/_jsxs(
|
|
58
|
+
}), (noteLeft || noteLeftIcon || noteRight || noteRightIcon) && /*#__PURE__*/_jsxs(CardBottomSectionNotesStyles, {
|
|
59
|
+
children: [(noteLeft || noteLeftIcon) && /*#__PURE__*/_jsxs(CardBottomSectionNoteLeftStyles, {
|
|
60
60
|
children: [noteLeftIcon, /*#__PURE__*/_jsx(ComponentXXS, {
|
|
61
61
|
color: COLORS.neutral_500,
|
|
62
62
|
textStyle: ComponentTextStyle.Bold,
|
|
63
63
|
children: noteLeft
|
|
64
64
|
})]
|
|
65
|
-
}), (noteRight || noteRightIcon) && /*#__PURE__*/_jsxs(
|
|
65
|
+
}), (noteRight || noteRightIcon) && /*#__PURE__*/_jsxs(CardBottomSectionNoteRightStyles, {
|
|
66
66
|
children: [noteRightIcon, /*#__PURE__*/_jsx(ComponentXXS, {
|
|
67
67
|
color: COLORS.neutral_500,
|
|
68
68
|
textStyle: ComponentTextStyle.Bold,
|
|
69
69
|
children: noteRight
|
|
70
70
|
})]
|
|
71
71
|
})]
|
|
72
|
-
}), (authorName || logo) && /*#__PURE__*/_jsxs(
|
|
72
|
+
}), (authorName || logo) && /*#__PURE__*/_jsxs(CardBottomSectionAuthorStyles, {
|
|
73
73
|
disabled: disabled,
|
|
74
74
|
"data-testid": 'card-bottomSection-author',
|
|
75
75
|
children: [/*#__PURE__*/_jsx(ComponentXXS, {
|
|
76
76
|
children: authorName
|
|
77
77
|
}), logo]
|
|
78
|
-
}), actions && /*#__PURE__*/_jsx(
|
|
78
|
+
}), actions && /*#__PURE__*/_jsx(CardBottomSectionButtonRowContainerStyles, {
|
|
79
79
|
children: actions.map(function (x, index) {
|
|
80
80
|
return /*#__PURE__*/_jsx(IconButton, {
|
|
81
81
|
ref: elRefs[index],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardBottomSection.js","names":["React","styled","COLORS","ComponentTextStyle","ComponentXXS","LinearProgress","LinearProgressType","LinearProgressVariant","Size","IconButton","CardProgressContainer","div","CardNotesContainer","neutral_500","CardAuthorContainer","props","disabled","neutral_300","CardBottomDivider","neutral_100","CardNoteLeft","CardNoteRight","CardButtonRowContainer","neutral_600","CardBottomSectionContainer","CardBottomSection","forwardRef","ref","progressLevel","progressMax","progressType","Line","noteLeft","noteLeftIcon","noteRight","noteRightIcon","authorName","logo","actions","useState","elRefs","setElRefs","length","useEffect","Array","fill","map","createRef","useImperativeHandle","haveAtLeastSomething","undefined","Small","Normal","Bold","x","index","e","onClick","icon"],"sources":["../../../src/Card/VerticalCard/CardBottomSection.tsx"],"sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport {\n COLORS,\n ComponentTextStyle,\n ComponentXXS,\n LinearProgress,\n LinearProgressType,\n LinearProgressVariant,\n Size\n} from '../../index';\nimport {IconButton} from '../../Button';\n\nexport interface ActionItem {\n icon: React.ReactNode;\n onClick: () => void;\n}\n\nexport interface CardBottomSectionProps {\n progressLevel?: number;\n progressMax?: number;\n progressType?: LinearProgressType;\n\n noteLeft?: string;\n noteLeftIcon?: React.ReactNode;\n noteRight?: string;\n noteRightIcon?: React.ReactNode;\n\n authorName?: string;\n actions?: ActionItem[];\n logo?: React.ReactNode;\n disabled?: boolean;\n}\n\nexport const CardProgressContainer = styled.div`\n padding: 8px 0;\n`;\n\nexport const CardNotesContainer = styled.div`\n height: 48px;\n position: relative;\n color: ${COLORS.neutral_500};\n display: flex;\n flex-direction: row;\n align-items: center;\n`;\n\nexport const CardAuthorContainer = styled.div<{ disabled?: boolean }>`\n display: flex;\n flex-direction: row;\n align-items: center;\n height: 48px;\n\n div:first-child {\n flex-grow: 2;\n }\n\n svg, img {\n width: 80px;\n flex-grow: 0;\n flex-shrink: 0;\n }\n\n ${props => props.disabled ? `\n color: ${COLORS.neutral_300};\n svg, img {\n filter: grayscale(100%);\n }\n \n ` : ''}\n`;\n\nexport const CardBottomDivider = styled.div`\n border-top: 1px;\n border-top-color: ${COLORS.neutral_100};\n border-top-style: solid;\n width: 100%;\n`;\n\nexport const CardNoteLeft = styled.div`\n position: absolute;\n left: 0px;\n display: flex;\n flex-direction: row;\n align-items: center;\n\n svg {\n margin-right: 4px;\n flex-grow: 0;\n flex-shrink: 0;\n }\n`;\n\nexport const CardNoteRight = styled.div`\n position: absolute;\n right: 0px;\n display: flex;\n flex-direction: row;\n align-items: center;\n\n svg {\n margin-right: 4px;\n flex-grow: 0;\n flex-shrink: 0;\n }\n`;\n\nexport const CardButtonRowContainer = styled.div`\n display: flex;\n flex-direction: row;\n justify-content: flex-end;\n align-items: center;\n border-top: 1px;\n border-top-color: ${COLORS.neutral_100};\n border-top-style: solid;\n\n button:last-child {\n margin: 8px 0px 0px 0px;\n }\n\n button:not(:last-child) {\n margin: 8px 0px 0px 0px;\n }\n\n svg {\n color: ${COLORS.neutral_600};\n }\n`;\n\nexport const CardBottomSectionContainer = styled.div`\n padding: 0px 16px 8px 16px;\n width: calc(100% - 32px);\n`;\n\nconst CardBottomSection = React.forwardRef(({\n progressLevel,\n progressMax,\n progressType = LinearProgressType.Line,\n noteLeft,\n noteLeftIcon,\n noteRight,\n noteRightIcon,\n authorName,\n logo,\n actions,\n disabled\n }: CardBottomSectionProps,\n ref: React.Ref<React.RefObject<HTMLButtonElement>[]>) => {\n\n const [elRefs, setElRefs] = React.useState<React.RefObject<HTMLButtonElement>[]>([]);\n\n const length = actions?.length || 0;\n\n React.useEffect(() => {\n setElRefs(Array(length || 0).fill(null).map(() => React.createRef<HTMLButtonElement>()));\n }, [length]);\n\n React.useImperativeHandle(ref, () => elRefs, [elRefs]);\n\n const haveAtLeastSomething = progressLevel != undefined || noteLeft || noteLeftIcon || noteRight || noteRightIcon || authorName;\n\n return (\n <CardBottomSectionContainer data-testid={'card-bottomSection'}>\n {haveAtLeastSomething && <CardBottomDivider/>}\n {progressLevel != undefined && <CardProgressContainer>\n <LinearProgress size={Size.Small}\n type={progressType}\n variant={LinearProgressVariant.Normal}\n value={progressLevel}\n max={progressMax ?? progressLevel}/>\n </CardProgressContainer>}\n\n {(noteLeft || noteLeftIcon || noteRight || noteRightIcon) && <CardNotesContainer>\n {(noteLeft || noteLeftIcon) && (\n <CardNoteLeft>\n {noteLeftIcon}\n <ComponentXXS color={COLORS.neutral_500} textStyle={ComponentTextStyle.Bold}>{noteLeft}</ComponentXXS>\n </CardNoteLeft>\n )}\n {(noteRight || noteRightIcon) && (\n <CardNoteRight>\n {noteRightIcon}\n <ComponentXXS color={COLORS.neutral_500} textStyle={ComponentTextStyle.Bold}>{noteRight}</ComponentXXS>\n </CardNoteRight>\n )}\n </CardNotesContainer>}\n\n {(authorName || logo) && <CardAuthorContainer disabled={disabled} data-testid={'card-bottomSection-author'}>\n <ComponentXXS>{authorName}</ComponentXXS>\n {logo}\n </CardAuthorContainer>}\n\n {actions && <CardButtonRowContainer>\n {actions.map((x, index) => (\n <IconButton ref={elRefs[index]}\n key={index}\n disabled={disabled}\n variant=\"secondary\"\n shape=\"circular\"\n action={(e) => {\n x.onClick();\n }}>\n {x.icon}\n </IconButton>\n ))}\n </CardButtonRowContainer>}\n </CardBottomSectionContainer>\n );\n});\n\nexport default CardBottomSection;\n"],"mappings":";;;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,MAAM,MAAM,mBAAmB;AACtC,SACEC,MAAM,EACNC,kBAAkB,EAClBC,YAAY,EACZC,cAAc,EACdC,kBAAkB,EAClBC,qBAAqB,EACrBC,IAAI,QACC,aAAa;AACpB,SAAQC,UAAU,QAAO,cAAc;AAAC;AAAA;AAuBxC,OAAO,IAAMC,qBAAqB,GAAGT,MAAM,CAACU,GAAG,0FAE9C;AAED,OAAO,IAAMC,kBAAkB,GAAGX,MAAM,CAACU,GAAG,oMAGjCT,MAAM,CAACW,WAAW,CAI5B;AAED,OAAO,IAAMC,mBAAmB,GAAGb,MAAM,CAACU,GAAG,qSAgBzC,UAAAI,KAAK;EAAA,OAAIA,KAAK,CAACC,QAAQ,0BACdd,MAAM,CAACe,WAAW,0EAKzB,EAAE;AAAA,EACP;AAED,OAAO,IAAMC,iBAAiB,GAAGjB,MAAM,CAACU,GAAG,qKAErBT,MAAM,CAACiB,WAAW,CAGvC;AAED,OAAO,IAAMC,YAAY,GAAGnB,MAAM,CAACU,GAAG,gQAYrC;AAED,OAAO,IAAMU,aAAa,GAAGpB,MAAM,CAACU,GAAG,iQAYtC;AAED,OAAO,IAAMW,sBAAsB,GAAGrB,MAAM,CAACU,GAAG,qZAM1BT,MAAM,CAACiB,WAAW,EAY3BjB,MAAM,CAACqB,WAAW,CAE9B;AAED,OAAO,IAAMC,0BAA0B,GAAGvB,MAAM,CAACU,GAAG,qIAGnD;AAED,IAAMc,iBAAiB,gBAAGzB,KAAK,CAAC0B,UAAU,CAAC,gBAaCC,GAAoD,EAAK;EAAA,IAZvDC,a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jC,CAAC,CAAC;AAAC;EA7LD3B,aAAa;EACbC,WAAW;EAGXG,QAAQ;EACRC,YAAY;EACZC,SAAS;EACTC,aAAa;EAEbC,UAAU;EACVE,OAAO;IAfPoB,IAAI;IACJD,OAAO;EAAA;EAePpB,IAAI;EACJrB,QAAQ;AAAA;AAmLV,eAAeS,iBAAiB"}
|
|
1
|
+
{"version":3,"file":"CardBottomSection.js","names":["React","styled","COLORS","ComponentTextStyle","ComponentXXS","LinearProgress","LinearProgressType","LinearProgressVariant","Size","IconButton","CardBottomSectionProgressStyles","div","CardBottomSectionNotesStyles","neutral_500","CardBottomSectionAuthorStyles","props","disabled","neutral_300","CardBottomSectionDivider","neutral_100","CardBottomSectionNoteLeftStyles","CardBottomSectionNoteRightStyles","CardBottomSectionButtonRowContainerStyles","neutral_600","CardBottomSectionContainer","CardBottomSection","forwardRef","ref","progressLevel","progressMax","progressType","Line","noteLeft","noteLeftIcon","noteRight","noteRightIcon","authorName","logo","actions","useState","elRefs","setElRefs","length","useEffect","Array","fill","map","createRef","useImperativeHandle","haveAtLeastSomething","undefined","Small","Normal","Bold","x","index","e","onClick","icon"],"sources":["../../../src/Card/VerticalCard/CardBottomSection.tsx"],"sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport {\n COLORS,\n ComponentTextStyle,\n ComponentXXS,\n LinearProgress,\n LinearProgressType,\n LinearProgressVariant,\n Size\n} from '../../index';\nimport {IconButton} from '../../Button';\n\nexport interface ActionItem {\n icon: React.ReactNode;\n onClick: () => void;\n}\n\nexport interface CardBottomSectionProps {\n progressLevel?: number;\n progressMax?: number;\n progressType?: LinearProgressType;\n\n noteLeft?: string;\n noteLeftIcon?: React.ReactNode;\n noteRight?: string;\n noteRightIcon?: React.ReactNode;\n\n authorName?: string;\n actions?: ActionItem[];\n logo?: React.ReactNode;\n disabled?: boolean;\n}\n\nexport const CardBottomSectionProgressStyles = styled.div`\n padding: 8px 0;\n`;\n\nexport const CardBottomSectionNotesStyles = styled.div`\n height: 48px;\n position: relative;\n color: ${COLORS.neutral_500};\n display: flex;\n flex-direction: row;\n align-items: center;\n`;\n\nexport const CardBottomSectionAuthorStyles = styled.div<{ disabled?: boolean }>`\n display: flex;\n flex-direction: row;\n align-items: center;\n height: 48px;\n\n div:first-child {\n flex-grow: 2;\n }\n\n svg, img {\n width: 80px;\n flex-grow: 0;\n flex-shrink: 0;\n }\n\n ${props => props.disabled ? `\n color: ${COLORS.neutral_300};\n svg, img {\n filter: grayscale(100%);\n }\n \n ` : ''}\n`;\n\nexport const CardBottomSectionDivider = styled.div`\n border-top: 1px;\n border-top-color: ${COLORS.neutral_100};\n border-top-style: solid;\n width: 100%;\n`;\n\nexport const CardBottomSectionNoteLeftStyles = styled.div`\n position: absolute;\n left: 0px;\n display: flex;\n flex-direction: row;\n align-items: center;\n\n svg {\n margin-right: 4px;\n flex-grow: 0;\n flex-shrink: 0;\n }\n`;\n\nexport const CardBottomSectionNoteRightStyles = styled.div`\n position: absolute;\n right: 0px;\n display: flex;\n flex-direction: row;\n align-items: center;\n\n svg {\n margin-right: 4px;\n flex-grow: 0;\n flex-shrink: 0;\n }\n`;\n\nexport const CardBottomSectionButtonRowContainerStyles = styled.div`\n display: flex;\n flex-direction: row;\n justify-content: flex-end;\n align-items: center;\n border-top: 1px;\n border-top-color: ${COLORS.neutral_100};\n border-top-style: solid;\n\n button:last-child {\n margin: 8px 0px 0px 0px;\n }\n\n button:not(:last-child) {\n margin: 8px 0px 0px 0px;\n }\n\n svg {\n color: ${COLORS.neutral_600};\n }\n`;\n\nexport const CardBottomSectionContainer = styled.div`\n padding: 0px 16px 8px 16px;\n width: calc(100% - 32px);\n`;\n\nconst CardBottomSection = React.forwardRef(({\n progressLevel,\n progressMax,\n progressType = LinearProgressType.Line,\n noteLeft,\n noteLeftIcon,\n noteRight,\n noteRightIcon,\n authorName,\n logo,\n actions,\n disabled\n }: CardBottomSectionProps,\n ref: React.Ref<React.RefObject<HTMLButtonElement>[]>) => {\n\n const [elRefs, setElRefs] = React.useState<React.RefObject<HTMLButtonElement>[]>([]);\n\n const length = actions?.length || 0;\n\n React.useEffect(() => {\n setElRefs(Array(length || 0).fill(null).map(() => React.createRef<HTMLButtonElement>()));\n }, [length]);\n\n React.useImperativeHandle(ref, () => elRefs, [elRefs]);\n\n const haveAtLeastSomething = progressLevel != undefined || noteLeft || noteLeftIcon || noteRight || noteRightIcon || authorName;\n\n return (\n <CardBottomSectionContainer data-testid={'card-bottomSection'}>\n {haveAtLeastSomething && <CardBottomSectionDivider/>}\n {progressLevel != undefined && <CardBottomSectionProgressStyles>\n <LinearProgress size={Size.Small}\n type={progressType}\n variant={LinearProgressVariant.Normal}\n value={progressLevel}\n max={progressMax ?? progressLevel}/>\n </CardBottomSectionProgressStyles>}\n\n {(noteLeft || noteLeftIcon || noteRight || noteRightIcon) && <CardBottomSectionNotesStyles>\n {(noteLeft || noteLeftIcon) && (\n <CardBottomSectionNoteLeftStyles>\n {noteLeftIcon}\n <ComponentXXS color={COLORS.neutral_500} textStyle={ComponentTextStyle.Bold}>{noteLeft}</ComponentXXS>\n </CardBottomSectionNoteLeftStyles>\n )}\n {(noteRight || noteRightIcon) && (\n <CardBottomSectionNoteRightStyles>\n {noteRightIcon}\n <ComponentXXS color={COLORS.neutral_500} textStyle={ComponentTextStyle.Bold}>{noteRight}</ComponentXXS>\n </CardBottomSectionNoteRightStyles>\n )}\n </CardBottomSectionNotesStyles>}\n\n {(authorName || logo) && <CardBottomSectionAuthorStyles disabled={disabled} data-testid={'card-bottomSection-author'}>\n <ComponentXXS>{authorName}</ComponentXXS>\n {logo}\n </CardBottomSectionAuthorStyles>}\n\n {actions && <CardBottomSectionButtonRowContainerStyles>\n {actions.map((x, index) => (\n <IconButton ref={elRefs[index]}\n key={index}\n disabled={disabled}\n variant=\"secondary\"\n shape=\"circular\"\n action={(e) => {\n x.onClick();\n }}>\n {x.icon}\n </IconButton>\n ))}\n </CardBottomSectionButtonRowContainerStyles>}\n </CardBottomSectionContainer>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ePpB,IAAI;EACJrB,QAAQ;AAAA;AAmLV,eAAeS,iBAAiB"}
|
|
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.default = exports.
|
|
8
|
+
exports.default = exports.CardMiddleSectionTagsStyles = exports.CardMiddleSectionContainer = exports.CardMiddleSectionColorBandStyles = exports.CardMiddleSectionCategoryStyles = void 0;
|
|
9
9
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
@@ -17,14 +17,14 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
17
17
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
18
18
|
var CardMiddleSectionContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-grow: 1;\n width: calc(100% - 32px);\n position: relative;\n flex-direction: column;\n padding: 16px;\n gap: 8px;\n\n .descriptionBlock {\n padding: 2px 0;\n }\n\n .titleBlock {\n padding: 2px 0;\n }\n"])));
|
|
19
19
|
exports.CardMiddleSectionContainer = CardMiddleSectionContainer;
|
|
20
|
-
var
|
|
20
|
+
var CardMiddleSectionColorBandStyles = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n width: 100%;\n top: 0px;\n left: 0px;\n height: 8px;\n background-color: ", ";\n"])), function (props) {
|
|
21
21
|
return props.$color;
|
|
22
22
|
});
|
|
23
|
-
exports.
|
|
24
|
-
var
|
|
25
|
-
exports.
|
|
26
|
-
var
|
|
27
|
-
exports.
|
|
23
|
+
exports.CardMiddleSectionColorBandStyles = CardMiddleSectionColorBandStyles;
|
|
24
|
+
var CardMiddleSectionTagsStyles = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: row;\n padding: 4px 0;\n gap: 4px;\n flex-wrap: wrap;\n"])));
|
|
25
|
+
exports.CardMiddleSectionTagsStyles = CardMiddleSectionTagsStyles;
|
|
26
|
+
var CardMiddleSectionCategoryStyles = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: none;\n gap: 6px;\n\n svg {\n color: ", ";\n flex-grow: 0;\n flex-shrink: 0;\n }\n"])), _index.COLORS.neutral_500);
|
|
27
|
+
exports.CardMiddleSectionCategoryStyles = CardMiddleSectionCategoryStyles;
|
|
28
28
|
var CardMiddleSection = function CardMiddleSection(_ref) {
|
|
29
29
|
var colorBandColor = _ref.colorBandColor,
|
|
30
30
|
categoryIcon = _ref.categoryIcon,
|
|
@@ -36,9 +36,9 @@ var CardMiddleSection = function CardMiddleSection(_ref) {
|
|
|
36
36
|
disabled = _ref.disabled;
|
|
37
37
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(CardMiddleSectionContainer, {
|
|
38
38
|
"data-testid": 'card-middleSection',
|
|
39
|
-
children: [colorBandColor && /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
39
|
+
children: [colorBandColor && /*#__PURE__*/(0, _jsxRuntime.jsx)(CardMiddleSectionColorBandStyles, {
|
|
40
40
|
$color: colorBandColor
|
|
41
|
-
}), (categoryIcon || categoryLabel) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
41
|
+
}), (categoryIcon || categoryLabel) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(CardMiddleSectionCategoryStyles, {
|
|
42
42
|
extraTopMargin: Boolean(colorBandColor),
|
|
43
43
|
bottomMargin: Boolean(categoryIcon || categoryLabel),
|
|
44
44
|
children: [categoryIcon, /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ComponentS, {
|
|
@@ -55,7 +55,7 @@ var CardMiddleSection = function CardMiddleSection(_ref) {
|
|
|
55
55
|
className: "descriptionBlock",
|
|
56
56
|
color: _index.COLORS.neutral_600,
|
|
57
57
|
children: description
|
|
58
|
-
}), tags && /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
58
|
+
}), tags && /*#__PURE__*/(0, _jsxRuntime.jsx)(CardMiddleSectionTagsStyles, {
|
|
59
59
|
children: tags.map(function (x, index) {
|
|
60
60
|
var _x$variant;
|
|
61
61
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Tag, {
|
|
@@ -63,7 +63,7 @@ var CardMiddleSection = function CardMiddleSection(_ref) {
|
|
|
63
63
|
variant: (_x$variant = x.variant) !== null && _x$variant !== void 0 ? _x$variant : 'neutral'
|
|
64
64
|
}, "".concat(x.label, "_").concat(index));
|
|
65
65
|
})
|
|
66
|
-
}), row2Tags && /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
66
|
+
}), row2Tags && /*#__PURE__*/(0, _jsxRuntime.jsx)(CardMiddleSectionTagsStyles, {
|
|
67
67
|
children: row2Tags.map(function (x, index) {
|
|
68
68
|
var _x$variant2;
|
|
69
69
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Tag, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardMiddleSection.cjs","names":["CardMiddleSectionContainer","styled","div","
|
|
1
|
+
{"version":3,"file":"CardMiddleSection.cjs","names":["CardMiddleSectionContainer","styled","div","CardMiddleSectionColorBandStyles","props","$color","CardMiddleSectionTagsStyles","CardMiddleSectionCategoryStyles","COLORS","neutral_500","CardMiddleSection","colorBandColor","categoryIcon","categoryLabel","title","description","tags","row2Tags","disabled","Boolean","ComponentTextStyle","Bold","black","neutral_600","map","x","index","label","variant"],"sources":["../../../src/Card/VerticalCard/CardMiddleSection.tsx"],"sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport { COLORS, ComponentS, ComponentTextStyle, ComponentXL, Tag, TagVariants } from '../../index';\n\nexport interface CardMiddleSectionProps {\n colorBandColor?: string;\n categoryIcon?: React.ReactNode;\n categoryLabel?: string;\n title: string;\n description?: string;\n tags?: CardTag[];\n row2Tags?: CardTag[];\n disabled?: boolean;\n}\n\nexport interface CardTag {\n label: string;\n variant?: TagVariants;\n}\n\nexport const CardMiddleSectionContainer = styled.div`\n display: flex;\n flex-grow: 1;\n width: calc(100% - 32px);\n position: relative;\n flex-direction: column;\n padding: 16px;\n gap: 8px;\n\n .descriptionBlock {\n padding: 2px 0;\n }\n\n .titleBlock {\n padding: 2px 0;\n }\n`;\n\nexport const CardMiddleSectionColorBandStyles = styled.div<{ $color: string }>`\n position: absolute;\n width: 100%;\n top: 0px;\n left: 0px;\n height: 8px;\n background-color: ${(props) => props.$color};\n`;\n\nexport const CardMiddleSectionTagsStyles = styled.div`\n display: flex;\n flex-direction: row;\n padding: 4px 0;\n gap: 4px;\n flex-wrap: wrap;\n`;\n\nexport const CardMiddleSectionCategoryStyles = styled.div<{ extraTopMargin: boolean; bottomMargin: boolean }>`\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: none;\n gap: 6px;\n\n svg {\n color: ${COLORS.neutral_500};\n flex-grow: 0;\n flex-shrink: 0;\n }\n`;\n\nconst CardMiddleSection: React.FunctionComponent<CardMiddleSectionProps> = ({\n colorBandColor,\n categoryIcon,\n categoryLabel,\n title,\n description,\n tags,\n row2Tags,\n disabled,\n}: CardMiddleSectionProps) => {\n return (\n <CardMiddleSectionContainer data-testid={'card-middleSection'} >\n {colorBandColor && <CardMiddleSectionColorBandStyles $color={colorBandColor} />}\n {\n (categoryIcon || categoryLabel) &&\n <CardMiddleSectionCategoryStyles extraTopMargin={Boolean(colorBandColor)} bottomMargin={Boolean(categoryIcon || categoryLabel)}>\n {categoryIcon}\n <ComponentS textStyle={ComponentTextStyle.Bold} color={COLORS.neutral_500}>\n {categoryLabel}\n </ComponentS>\n </CardMiddleSectionCategoryStyles>\n }\n <ComponentXL className=\"titleBlock\" textStyle={ComponentTextStyle.Bold} color={disabled ? COLORS.neutral_500 : COLORS.black}>\n {title}\n </ComponentXL>\n {description && (\n <ComponentS className=\"descriptionBlock\" color={COLORS.neutral_600}>\n {description}\n </ComponentS>\n )}\n {tags && (\n <CardMiddleSectionTagsStyles>\n {tags.map((x, index) => (\n <Tag key={`${x.label}_${index}`} label={x.label} variant={x.variant ?? 'neutral'} />\n ))}\n </CardMiddleSectionTagsStyles>\n )}\n {row2Tags && (\n <CardMiddleSectionTagsStyles>\n {row2Tags.map((x, index) => (\n <Tag key={`${x.label}_${index}`} label={x.label} variant={x.variant ?? 'neutral'} />\n ))}\n </CardMiddleSectionTagsStyles>\n )}\n </CardMiddleSectionContainer>\n );\n};\n\nexport default CardMiddleSection;\n"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;AAAoG;AAAA;AAAA;AAAA;AAkB7F,IAAMA,0BAA0B,GAAGC,yBAAM,CAACC,GAAG,sUAgBnD;AAAC;AAEK,IAAMC,gCAAgC,GAAGF,yBAAM,CAACC,GAAG,qMAMpC,UAACE,KAAK;EAAA,OAAKA,KAAK,CAACC,MAAM;AAAA,EAC5C;AAAC;AAEK,IAAMC,2BAA2B,GAAGL,yBAAM,CAACC,GAAG,qLAMpD;AAAC;AAEK,IAAMK,+BAA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ACE,KAAM;UAAC,OAAO,gBAAEF,CAAC,CAACG,OAAO,mDAAI;QAAU,aAApEH,CAAC,CAACE,KAAK,cAAID,KAAK,EAAuD;MAAA,CACrF;IAAC,EAEL,EACAT,QAAQ,iBACP,qBAAC,2BAA2B;MAAA,UACzBA,QAAQ,CAACO,GAAG,CAAC,UAACC,CAAC,EAAEC,KAAK;QAAA;QAAA,oBACrB,qBAAC,UAAG;UAA6B,KAAK,EAAED,CAAC,CAACE,KAAM;UAAC,OAAO,iBAAEF,CAAC,CAACG,OAAO,qDAAI;QAAU,aAApEH,CAAC,CAACE,KAAK,cAAID,KAAK,EAAuD;MAAA,CACrF;IAAC,EAEL;EAAA,EAC0B;AAEjC,CAAC;AAAC;EA9GAf,cAAc;EACdC,YAAY;EACZC,aAAa;EACbC,KAAK;EACLC,WAAW;EACXC,IAAI;IAMJW,KAAK;EAAA;EALLV,QAAQ;IAKRU,KAAK;EAAA;EAJLT,QAAQ;AAAA;AAAA,eAyGKR,iBAAiB;AAAA"}
|
|
@@ -15,11 +15,11 @@ export interface CardTag {
|
|
|
15
15
|
variant?: TagVariants;
|
|
16
16
|
}
|
|
17
17
|
export declare const CardMiddleSectionContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
18
|
-
export declare const
|
|
18
|
+
export declare const CardMiddleSectionColorBandStyles: import("styled-components").StyledComponent<"div", any, {
|
|
19
19
|
$color: string;
|
|
20
20
|
}, never>;
|
|
21
|
-
export declare const
|
|
22
|
-
export declare const
|
|
21
|
+
export declare const CardMiddleSectionTagsStyles: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
22
|
+
export declare const CardMiddleSectionCategoryStyles: import("styled-components").StyledComponent<"div", any, {
|
|
23
23
|
extraTopMargin: boolean;
|
|
24
24
|
bottomMargin: boolean;
|
|
25
25
|
}, never>;
|
|
@@ -7,11 +7,11 @@ import { COLORS, ComponentS, ComponentTextStyle, ComponentXL, Tag } from '../../
|
|
|
7
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
8
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
9
|
export var CardMiddleSectionContainer = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-grow: 1;\n width: calc(100% - 32px);\n position: relative;\n flex-direction: column;\n padding: 16px;\n gap: 8px;\n\n .descriptionBlock {\n padding: 2px 0;\n }\n\n .titleBlock {\n padding: 2px 0;\n }\n"])));
|
|
10
|
-
export var
|
|
10
|
+
export var CardMiddleSectionColorBandStyles = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: absolute;\n width: 100%;\n top: 0px;\n left: 0px;\n height: 8px;\n background-color: ", ";\n"])), function (props) {
|
|
11
11
|
return props.$color;
|
|
12
12
|
});
|
|
13
|
-
export var
|
|
14
|
-
export var
|
|
13
|
+
export var CardMiddleSectionTagsStyles = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n padding: 4px 0;\n gap: 4px;\n flex-wrap: wrap;\n"])));
|
|
14
|
+
export var CardMiddleSectionCategoryStyles = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: none;\n gap: 6px;\n\n svg {\n color: ", ";\n flex-grow: 0;\n flex-shrink: 0;\n }\n"])), COLORS.neutral_500);
|
|
15
15
|
var CardMiddleSection = function CardMiddleSection(_ref) {
|
|
16
16
|
var colorBandColor = _ref.colorBandColor,
|
|
17
17
|
categoryIcon = _ref.categoryIcon,
|
|
@@ -23,9 +23,9 @@ var CardMiddleSection = function CardMiddleSection(_ref) {
|
|
|
23
23
|
disabled = _ref.disabled;
|
|
24
24
|
return /*#__PURE__*/_jsxs(CardMiddleSectionContainer, {
|
|
25
25
|
"data-testid": 'card-middleSection',
|
|
26
|
-
children: [colorBandColor && /*#__PURE__*/_jsx(
|
|
26
|
+
children: [colorBandColor && /*#__PURE__*/_jsx(CardMiddleSectionColorBandStyles, {
|
|
27
27
|
$color: colorBandColor
|
|
28
|
-
}), (categoryIcon || categoryLabel) && /*#__PURE__*/_jsxs(
|
|
28
|
+
}), (categoryIcon || categoryLabel) && /*#__PURE__*/_jsxs(CardMiddleSectionCategoryStyles, {
|
|
29
29
|
extraTopMargin: Boolean(colorBandColor),
|
|
30
30
|
bottomMargin: Boolean(categoryIcon || categoryLabel),
|
|
31
31
|
children: [categoryIcon, /*#__PURE__*/_jsx(ComponentS, {
|
|
@@ -42,7 +42,7 @@ var CardMiddleSection = function CardMiddleSection(_ref) {
|
|
|
42
42
|
className: "descriptionBlock",
|
|
43
43
|
color: COLORS.neutral_600,
|
|
44
44
|
children: description
|
|
45
|
-
}), tags && /*#__PURE__*/_jsx(
|
|
45
|
+
}), tags && /*#__PURE__*/_jsx(CardMiddleSectionTagsStyles, {
|
|
46
46
|
children: tags.map(function (x, index) {
|
|
47
47
|
var _x$variant;
|
|
48
48
|
return /*#__PURE__*/_jsx(Tag, {
|
|
@@ -50,7 +50,7 @@ var CardMiddleSection = function CardMiddleSection(_ref) {
|
|
|
50
50
|
variant: (_x$variant = x.variant) !== null && _x$variant !== void 0 ? _x$variant : 'neutral'
|
|
51
51
|
}, "".concat(x.label, "_").concat(index));
|
|
52
52
|
})
|
|
53
|
-
}), row2Tags && /*#__PURE__*/_jsx(
|
|
53
|
+
}), row2Tags && /*#__PURE__*/_jsx(CardMiddleSectionTagsStyles, {
|
|
54
54
|
children: row2Tags.map(function (x, index) {
|
|
55
55
|
var _x$variant2;
|
|
56
56
|
return /*#__PURE__*/_jsx(Tag, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardMiddleSection.js","names":["React","styled","COLORS","ComponentS","ComponentTextStyle","ComponentXL","Tag","CardMiddleSectionContainer","div","
|
|
1
|
+
{"version":3,"file":"CardMiddleSection.js","names":["React","styled","COLORS","ComponentS","ComponentTextStyle","ComponentXL","Tag","CardMiddleSectionContainer","div","CardMiddleSectionColorBandStyles","props","$color","CardMiddleSectionTagsStyles","CardMiddleSectionCategoryStyles","neutral_500","CardMiddleSection","colorBandColor","categoryIcon","categoryLabel","title","description","tags","row2Tags","disabled","Boolean","Bold","black","neutral_600","map","x","index","label","variant"],"sources":["../../../src/Card/VerticalCard/CardMiddleSection.tsx"],"sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport { COLORS, ComponentS, ComponentTextStyle, ComponentXL, Tag, TagVariants } from '../../index';\n\nexport interface CardMiddleSectionProps {\n colorBandColor?: string;\n categoryIcon?: React.ReactNode;\n categoryLabel?: string;\n title: string;\n description?: string;\n tags?: CardTag[];\n row2Tags?: CardTag[];\n disabled?: boolean;\n}\n\nexport interface CardTag {\n label: string;\n variant?: TagVariants;\n}\n\nexport const CardMiddleSectionContainer = styled.div`\n display: flex;\n flex-grow: 1;\n width: calc(100% - 32px);\n position: relative;\n flex-direction: column;\n padding: 16px;\n gap: 8px;\n\n .descriptionBlock {\n padding: 2px 0;\n }\n\n .titleBlock {\n padding: 2px 0;\n }\n`;\n\nexport const CardMiddleSectionColorBandStyles = styled.div<{ $color: string }>`\n position: absolute;\n width: 100%;\n top: 0px;\n left: 0px;\n height: 8px;\n background-color: ${(props) => props.$color};\n`;\n\nexport const CardMiddleSectionTagsStyles = styled.div`\n display: flex;\n flex-direction: row;\n padding: 4px 0;\n gap: 4px;\n flex-wrap: wrap;\n`;\n\nexport const CardMiddleSectionCategoryStyles = styled.div<{ extraTopMargin: boolean; bottomMargin: boolean }>`\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: none;\n gap: 6px;\n\n svg {\n color: ${COLORS.neutral_500};\n flex-grow: 0;\n flex-shrink: 0;\n }\n`;\n\nconst CardMiddleSection: React.FunctionComponent<CardMiddleSectionProps> = ({\n colorBandColor,\n categoryIcon,\n categoryLabel,\n title,\n description,\n tags,\n row2Tags,\n disabled,\n}: CardMiddleSectionProps) => {\n return (\n <CardMiddleSectionContainer data-testid={'card-middleSection'} >\n {colorBandColor && <CardMiddleSectionColorBandStyles $color={colorBandColor} />}\n {\n (categoryIcon || categoryLabel) &&\n <CardMiddleSectionCategoryStyles extraTopMargin={Boolean(colorBandColor)} bottomMargin={Boolean(categoryIcon || categoryLabel)}>\n {categoryIcon}\n <ComponentS textStyle={ComponentTextStyle.Bold} color={COLORS.neutral_500}>\n {categoryLabel}\n </ComponentS>\n </CardMiddleSectionCategoryStyles>\n }\n <ComponentXL className=\"titleBlock\" textStyle={ComponentTextStyle.Bold} color={disabled ? COLORS.neutral_500 : COLORS.black}>\n {title}\n </ComponentXL>\n {description && (\n <ComponentS className=\"descriptionBlock\" color={COLORS.neutral_600}>\n {description}\n </ComponentS>\n )}\n {tags && (\n <CardMiddleSectionTagsStyles>\n {tags.map((x, index) => (\n <Tag key={`${x.label}_${index}`} label={x.label} variant={x.variant ?? 'neutral'} />\n ))}\n </CardMiddleSectionTagsStyles>\n )}\n {row2Tags && (\n <CardMiddleSectionTagsStyles>\n {row2Tags.map((x, index) => (\n <Tag key={`${x.label}_${index}`} label={x.label} variant={x.variant ?? 'neutral'} />\n ))}\n </CardMiddleSectionTagsStyles>\n )}\n </CardMiddleSectionContainer>\n );\n};\n\nexport default CardMiddleSection;\n"],"mappings":";;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,MAAM,MAAM,mBAAmB;AACtC,SAASC,MAAM,EAAEC,UAAU,EAAEC,kBAAkB,EAAEC,WAAW,EAAEC,GAAG,QAAqB,aAAa;AAAC;AAAA;AAkBpG,OAAO,IAAMC,0BAA0B,GAAGN,MAAM,CAACO,GAAG,wTAgBnD;AAED,OAAO,IAAMC,gCAAgC,GAAGR,MAAM,CAACO,GAAG,uLAMpC,UAACE,KAAK;EAAA,OAAKA,KAAK,CAACC,MAAM;AAAA,EAC5C;AAED,OAAO,IAAMC,2BAA2B,GAAGX,MAAM,CAACO,GAAG,uKAMpD;AAED,OAAO,IAAMK,+BAA+B,GAAGZ,MAAM,CAACO,GAAG,qPAQ5CN,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;QAAU,aAApEH,CAAC,CAACE,KAAK,cAAID,KAAK,EAAuD;MAAA,CACrF;IAAC,EAEL,EACAR,QAAQ,iBACP,KAAC,2BAA2B;MAAA,UACzBA,QAAQ,CAACM,GAAG,CAAC,UAACC,CAAC,EAAEC,KAAK;QAAA;QAAA,oBACrB,KAAC,GAAG;UAA6B,KAAK,EAAED,CAAC,CAACE,KAAM;UAAC,OAAO,iBAAEF,CAAC,CAACG,OAAO,qDAAI;QAAU,aAApEH,CAAC,CAACE,KAAK,cAAID,KAAK,EAAuD;MAAA,CACrF;IAAC,EAEL;EAAA,EAC0B;AAEjC,CAAC;AAAC;EA9GAd,cAAc;EACdC,YAAY;EACZC,aAAa;EACbC,KAAK;EACLC,WAAW;EACXC,IAAI;IAMJU,KAAK;EAAA;EALLT,QAAQ;IAKRS,KAAK;EAAA;EAJLR,QAAQ;AAAA;AAyGV,eAAeR,iBAAiB"}
|
|
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.default = exports.
|
|
8
|
+
exports.default = exports.CardTopSectionTagContainer = exports.CardTopSectionRibbonContainer = exports.CardTopSectionImageContainer = exports.CardTopSectionContainer = exports.CardTopSectionCheckboxContainer = void 0;
|
|
9
9
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
@@ -19,22 +19,22 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
19
19
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
20
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
21
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
22
|
-
var
|
|
23
|
-
exports.
|
|
24
|
-
var
|
|
25
|
-
exports.
|
|
22
|
+
var CardTopSectionImageContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n border-top-right-radius: 8px;\n border-top-left-radius: 8px;\n height: 100%;\n width: 100%;\n img{\n object-fit: cover;\n width: 100%;\n height: 100%;\n border-top-right-radius: 8px;\n border-top-left-radius: 8px;\n }\n"])));
|
|
23
|
+
exports.CardTopSectionImageContainer = CardTopSectionImageContainer;
|
|
24
|
+
var CardTopSectionTagContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n\n top: 16px;\n left: 16px;\n width: calc(100% - 32px);\n"])));
|
|
25
|
+
exports.CardTopSectionTagContainer = CardTopSectionTagContainer;
|
|
26
26
|
var CardTopSectionContainer = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n width: 100%;\n overflow: visible;\n\n ", "\n"])), function (props) {
|
|
27
27
|
return props.disabled ? "\n img, svg {\n filter: grayscale(100%);\n }" : '';
|
|
28
28
|
});
|
|
29
29
|
exports.CardTopSectionContainer = CardTopSectionContainer;
|
|
30
|
-
var
|
|
30
|
+
var CardTopSectionRibbonContainer = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n min-height: calc(40px - 16px);\n background-color: ", ";\n width: calc(100% - 32px);\n position: absolute;\n bottom: 0px;\n left: 0px;\n padding: 8px 16px 8px 16px;\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 8px;\n\n svg {\n color: ", ";\n width: 24px;\n height: 24px;\n flex-grow: 0;\n flex-shrink: 0;\n }\n"])), function (props) {
|
|
31
31
|
return props.$backgroundColor;
|
|
32
32
|
}, function (props) {
|
|
33
33
|
return props.$color;
|
|
34
34
|
});
|
|
35
|
-
exports.
|
|
36
|
-
var
|
|
37
|
-
exports.
|
|
35
|
+
exports.CardTopSectionRibbonContainer = CardTopSectionRibbonContainer;
|
|
36
|
+
var CardTopSectionCheckboxContainer = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n top: 0;\n right: 0;\n z-index: 1;\n\n .checkbox-icon {\n background-color: ", ";\n }\n"])), _index.COLORS.white);
|
|
37
|
+
exports.CardTopSectionCheckboxContainer = CardTopSectionCheckboxContainer;
|
|
38
38
|
var CardTopSection = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
39
39
|
var _image$height, _image$fallbackSrc, _image$loader;
|
|
40
40
|
var selected = _ref.selected,
|
|
@@ -55,7 +55,7 @@ var CardTopSection = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
55
55
|
style: {
|
|
56
56
|
height: (_image$height = image === null || image === void 0 ? void 0 : image.height) !== null && _image$height !== void 0 ? _image$height : 200
|
|
57
57
|
},
|
|
58
|
-
children: [image && /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
58
|
+
children: [image && /*#__PURE__*/(0, _jsxRuntime.jsx)(CardTopSectionImageContainer, {
|
|
59
59
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Image.ImageWithFallbacks, {
|
|
60
60
|
fallbacks: (_image$fallbackSrc = image.fallbackSrc) !== null && _image$fallbackSrc !== void 0 ? _image$fallbackSrc : '',
|
|
61
61
|
src: image.src,
|
|
@@ -64,7 +64,7 @@ var CardTopSection = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
64
64
|
width: image.width,
|
|
65
65
|
height: image.height
|
|
66
66
|
})
|
|
67
|
-
}), (!!selected || !!setSelected) && /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
67
|
+
}), (!!selected || !!setSelected) && /*#__PURE__*/(0, _jsxRuntime.jsx)(CardTopSectionCheckboxContainer, {
|
|
68
68
|
"data-testid": 'card-topSection-checkbox',
|
|
69
69
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Checkbox.default, {
|
|
70
70
|
ref: ref,
|
|
@@ -74,13 +74,13 @@ var CardTopSection = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
74
74
|
},
|
|
75
75
|
selected: selected || false
|
|
76
76
|
})
|
|
77
|
-
}), (tagLabel || tagIcon) && /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
77
|
+
}), (tagLabel || tagIcon) && /*#__PURE__*/(0, _jsxRuntime.jsx)(CardTopSectionTagContainer, {
|
|
78
78
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tag.Tag, {
|
|
79
79
|
label: tagLabel,
|
|
80
80
|
variant: tagVariant,
|
|
81
81
|
icon: tagIcon
|
|
82
82
|
})
|
|
83
|
-
}), (highlightRibbonIcon || highlightRibbonText) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
83
|
+
}), (highlightRibbonIcon || highlightRibbonText) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(CardTopSectionRibbonContainer, {
|
|
84
84
|
"data-testid": 'card-topSection-ribbon',
|
|
85
85
|
$color: highlightRibbonContentColor !== null && highlightRibbonContentColor !== void 0 ? highlightRibbonContentColor : '',
|
|
86
86
|
$backgroundColor: disabled ? _index.COLORS.neutral_300 : highlightRibbonBgColor !== null && highlightRibbonBgColor !== void 0 ? highlightRibbonBgColor : '',
|