@laerdal/life-react-components 1.5.1 → 1.6.0-dev.10
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/Banners/Banner.cjs +21 -5
- package/dist/Banners/Banner.cjs.map +1 -1
- package/dist/Banners/Banner.js +20 -5
- package/dist/Banners/Banner.js.map +1 -1
- package/dist/Button/Iconbutton.cjs +16 -14
- package/dist/Button/Iconbutton.cjs.map +1 -1
- package/dist/Button/Iconbutton.d.ts +2 -0
- package/dist/Button/Iconbutton.js +16 -14
- package/dist/Button/Iconbutton.js.map +1 -1
- package/dist/Card/Card.cjs +101 -0
- package/dist/Card/Card.cjs.map +1 -0
- package/dist/Card/Card.d.ts +23 -0
- package/dist/Card/Card.js +74 -0
- package/dist/Card/Card.js.map +1 -0
- package/dist/Card/CardBottomSection.cjs +133 -0
- package/dist/Card/CardBottomSection.cjs.map +1 -0
- package/dist/Card/CardBottomSection.d.ts +22 -0
- package/dist/Card/CardBottomSection.js +105 -0
- package/dist/Card/CardBottomSection.js.map +1 -0
- package/dist/Card/CardMiddleSection.cjs +94 -0
- package/dist/Card/CardMiddleSection.cjs.map +1 -0
- package/dist/Card/CardMiddleSection.d.ts +14 -0
- package/dist/Card/CardMiddleSection.js +71 -0
- package/dist/Card/CardMiddleSection.js.map +1 -0
- package/dist/Card/CardTopSection.cjs +112 -0
- package/dist/Card/CardTopSection.cjs.map +1 -0
- package/dist/Card/CardTopSection.d.ts +19 -0
- package/dist/Card/CardTopSection.js +85 -0
- package/dist/Card/CardTopSection.js.map +1 -0
- package/dist/Card/index.cjs +52 -0
- package/dist/Card/index.cjs.map +1 -0
- package/dist/Card/index.d.ts +5 -0
- package/dist/Card/index.js +6 -0
- package/dist/Card/index.js.map +1 -0
- package/dist/Dropdown/BasicDropdown.cjs +38 -55
- package/dist/Dropdown/BasicDropdown.cjs.map +1 -1
- package/dist/Dropdown/BasicDropdown.js +36 -53
- package/dist/Dropdown/BasicDropdown.js.map +1 -1
- package/dist/Dropdown/CommonStyling.cjs +9 -17
- package/dist/Dropdown/CommonStyling.cjs.map +1 -1
- package/dist/Dropdown/CommonStyling.d.ts +0 -3
- package/dist/Dropdown/CommonStyling.js +8 -12
- package/dist/Dropdown/CommonStyling.js.map +1 -1
- package/dist/Dropdown/DropdownButton.cjs +11 -24
- package/dist/Dropdown/DropdownButton.cjs.map +1 -1
- package/dist/Dropdown/DropdownButton.js +11 -24
- package/dist/Dropdown/DropdownButton.js.map +1 -1
- package/dist/Dropdown/DropdownContent.cjs +21 -12
- package/dist/Dropdown/DropdownContent.cjs.map +1 -1
- package/dist/Dropdown/DropdownContent.js +21 -12
- package/dist/Dropdown/DropdownContent.js.map +1 -1
- package/dist/Dropdown/DropdownFilter.cjs +43 -46
- package/dist/Dropdown/DropdownFilter.cjs.map +1 -1
- package/dist/Dropdown/DropdownFilter.js +41 -45
- package/dist/Dropdown/DropdownFilter.js.map +1 -1
- package/dist/HyperLink/HyperLink.cjs +3 -1
- package/dist/HyperLink/HyperLink.cjs.map +1 -1
- package/dist/HyperLink/HyperLink.d.ts +4 -0
- package/dist/HyperLink/HyperLink.js +1 -1
- package/dist/HyperLink/HyperLink.js.map +1 -1
- package/dist/HyperLink/styling.cjs +1 -1
- package/dist/HyperLink/styling.cjs.map +1 -1
- package/dist/HyperLink/styling.js +1 -1
- package/dist/HyperLink/styling.js.map +1 -1
- package/dist/Image/ImageWithFallbacks.cjs +122 -0
- package/dist/Image/ImageWithFallbacks.cjs.map +1 -0
- package/dist/Image/ImageWithFallbacks.d.ts +21 -0
- package/dist/Image/ImageWithFallbacks.js +109 -0
- package/dist/Image/ImageWithFallbacks.js.map +1 -0
- package/dist/Image/index.cjs +16 -0
- package/dist/Image/index.cjs.map +1 -0
- package/dist/Image/index.d.ts +2 -0
- package/dist/Image/index.js +3 -0
- package/dist/Image/index.js.map +1 -0
- package/dist/InputFields/DatepickerField.cjs +53 -17
- package/dist/InputFields/DatepickerField.cjs.map +1 -1
- package/dist/InputFields/DatepickerField.js +52 -16
- package/dist/InputFields/DatepickerField.js.map +1 -1
- package/dist/InputFields/styling.cjs +2 -2
- package/dist/InputFields/styling.cjs.map +1 -1
- package/dist/InputFields/styling.js +2 -2
- package/dist/InputFields/styling.js.map +1 -1
- package/dist/LinearProgress/LinearProgress.cjs +142 -0
- package/dist/LinearProgress/LinearProgress.cjs.map +1 -0
- package/dist/LinearProgress/LinearProgress.d.ts +25 -0
- package/dist/LinearProgress/LinearProgress.js +111 -0
- package/dist/LinearProgress/LinearProgress.js.map +1 -0
- package/dist/LinearProgress/index.cjs +32 -0
- package/dist/LinearProgress/index.cjs.map +1 -0
- package/dist/LinearProgress/index.d.ts +3 -0
- package/dist/LinearProgress/index.js +4 -0
- package/dist/LinearProgress/index.js.map +1 -0
- package/dist/Modals/ModalContainer.cjs +10 -4
- package/dist/Modals/ModalContainer.cjs.map +1 -1
- package/dist/Modals/ModalContainer.d.ts +1 -0
- package/dist/Modals/ModalContainer.js +10 -4
- package/dist/Modals/ModalContainer.js.map +1 -1
- package/dist/Modals/ModalContent.cjs +235 -0
- package/dist/Modals/ModalContent.cjs.map +1 -0
- package/dist/Modals/ModalContent.d.ts +18 -0
- package/dist/Modals/ModalContent.js +204 -0
- package/dist/Modals/ModalContent.js.map +1 -0
- package/dist/Modals/ModalDialog.cjs +71 -8
- package/dist/Modals/ModalDialog.cjs.map +1 -1
- package/dist/Modals/ModalDialog.d.ts +8 -1
- package/dist/Modals/ModalDialog.js +74 -11
- package/dist/Modals/ModalDialog.js.map +1 -1
- package/dist/Modals/ModalStyles.cjs +3 -3
- package/dist/Modals/ModalStyles.cjs.map +1 -1
- package/dist/Modals/ModalStyles.js +3 -3
- package/dist/Modals/ModalStyles.js.map +1 -1
- package/dist/Modals/ModalTypes.d.ts +5 -0
- package/dist/Modals/index.cjs +8 -0
- package/dist/Modals/index.cjs.map +1 -1
- package/dist/Modals/index.d.ts +3 -2
- package/dist/Modals/index.js +2 -1
- package/dist/Modals/index.js.map +1 -1
- package/dist/SegmentControl/SegmentControl.cjs +99 -0
- package/dist/SegmentControl/SegmentControl.cjs.map +1 -0
- package/dist/SegmentControl/SegmentControl.d.ts +19 -0
- package/dist/SegmentControl/SegmentControl.js +71 -0
- package/dist/SegmentControl/SegmentControl.js.map +1 -0
- package/dist/SegmentControl/index.cjs +16 -0
- package/dist/SegmentControl/index.cjs.map +1 -0
- package/dist/SegmentControl/index.d.ts +3 -0
- package/dist/SegmentControl/index.js +3 -0
- package/dist/SegmentControl/index.js.map +1 -0
- package/dist/SkipToContent/SkipToContent.cjs +2 -2
- package/dist/SkipToContent/SkipToContent.cjs.map +1 -1
- package/dist/SkipToContent/SkipToContent.js +2 -2
- package/dist/SkipToContent/SkipToContent.js.map +1 -1
- package/dist/Table/TableFooter.cjs +1 -1
- package/dist/Table/TableFooter.cjs.map +1 -1
- package/dist/Table/TableFooter.js +1 -1
- package/dist/Table/TableFooter.js.map +1 -1
- package/dist/Table/TableStyles.cjs +1 -1
- package/dist/Table/TableStyles.cjs.map +1 -1
- package/dist/Table/TableStyles.js +1 -1
- package/dist/Table/TableStyles.js.map +1 -1
- package/dist/Tag/Tag.cjs +95 -0
- package/dist/Tag/Tag.cjs.map +1 -0
- package/dist/Tag/Tag.d.ts +9 -0
- package/dist/Tag/Tag.js +73 -0
- package/dist/Tag/Tag.js.map +1 -0
- package/dist/Tag/index.cjs +16 -0
- package/dist/Tag/index.cjs.map +1 -0
- package/dist/Tag/index.d.ts +2 -0
- package/dist/Tag/index.js +2 -0
- package/dist/Tag/index.js.map +1 -0
- package/dist/common/InputStyling.cjs +1 -1
- package/dist/common/InputStyling.cjs.map +1 -1
- package/dist/common/InputStyling.js +1 -1
- package/dist/common/InputStyling.js.map +1 -1
- package/dist/index.cjs +113 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/types.cjs +9 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.ts +4 -0
- package/dist/types.js +7 -0
- package/dist/types.js.map +1 -1
- package/package.json +4 -3
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.default = void 0;
|
|
11
|
+
|
|
12
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
13
|
+
|
|
14
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
+
|
|
16
|
+
var React = _interopRequireWildcard(require("react"));
|
|
17
|
+
|
|
18
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
19
|
+
|
|
20
|
+
var _ = require("..");
|
|
21
|
+
|
|
22
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
|
+
|
|
24
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
25
|
+
|
|
26
|
+
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); }
|
|
27
|
+
|
|
28
|
+
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; }
|
|
29
|
+
|
|
30
|
+
var Container = _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\n ", "\n"])), function (props) {
|
|
31
|
+
return props.interactionType == _.InteractionType.Clickable ? "\n cursor: ".concat(props.disabled ? 'not-allowed' : 'pointer', ";\n ") : '';
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
var ColorBand = _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) {
|
|
35
|
+
return props.$color;
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
var TagsContainer = _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"])));
|
|
39
|
+
|
|
40
|
+
var CategoryContainer = _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"])), _.COLORS.neutral_500);
|
|
41
|
+
|
|
42
|
+
var CardMiddleSection = function CardMiddleSection(_ref) {
|
|
43
|
+
var interactionType = _ref.interactionType,
|
|
44
|
+
colorBandColor = _ref.colorBandColor,
|
|
45
|
+
categoryIcon = _ref.categoryIcon,
|
|
46
|
+
categoryLabel = _ref.categoryLabel,
|
|
47
|
+
title = _ref.title,
|
|
48
|
+
description = _ref.description,
|
|
49
|
+
tags = _ref.tags,
|
|
50
|
+
disabled = _ref.disabled;
|
|
51
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Container, {
|
|
52
|
+
disabled: disabled,
|
|
53
|
+
interactionType: interactionType,
|
|
54
|
+
children: [colorBandColor && /*#__PURE__*/(0, _jsxRuntime.jsx)(ColorBand, {
|
|
55
|
+
$color: colorBandColor
|
|
56
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(CategoryContainer, {
|
|
57
|
+
extraTopMargin: Boolean(colorBandColor),
|
|
58
|
+
bottomMargin: Boolean(categoryIcon || categoryLabel),
|
|
59
|
+
children: [categoryIcon, /*#__PURE__*/(0, _jsxRuntime.jsx)(_.ComponentS, {
|
|
60
|
+
textStyle: _.ComponentTextStyle.Bold,
|
|
61
|
+
color: _.COLORS.neutral_500,
|
|
62
|
+
children: categoryLabel
|
|
63
|
+
})]
|
|
64
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.ComponentXL, {
|
|
65
|
+
className: "titleBlock",
|
|
66
|
+
textStyle: _.ComponentTextStyle.Bold,
|
|
67
|
+
color: disabled ? _.COLORS.neutral_500 : _.COLORS.black,
|
|
68
|
+
children: title
|
|
69
|
+
}), description && /*#__PURE__*/(0, _jsxRuntime.jsx)(_.ComponentS, {
|
|
70
|
+
className: "descriptionBlock",
|
|
71
|
+
color: _.COLORS.neutral_600,
|
|
72
|
+
children: description
|
|
73
|
+
}), tags && /*#__PURE__*/(0, _jsxRuntime.jsx)(TagsContainer, {
|
|
74
|
+
children: tags.map(function (x) {
|
|
75
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Tag, {
|
|
76
|
+
label: x
|
|
77
|
+
});
|
|
78
|
+
})
|
|
79
|
+
})]
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
CardMiddleSection.propTypes = {
|
|
84
|
+
colorBandColor: _propTypes.default.string,
|
|
85
|
+
categoryIcon: _propTypes.default.node,
|
|
86
|
+
categoryLabel: _propTypes.default.string,
|
|
87
|
+
title: _propTypes.default.string.isRequired,
|
|
88
|
+
description: _propTypes.default.string,
|
|
89
|
+
tags: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
90
|
+
disabled: _propTypes.default.bool.isRequired
|
|
91
|
+
};
|
|
92
|
+
var _default = CardMiddleSection;
|
|
93
|
+
exports.default = _default;
|
|
94
|
+
//# sourceMappingURL=CardMiddleSection.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/Card/CardMiddleSection.tsx"],"names":["Container","styled","div","props","interactionType","InteractionType","Clickable","disabled","ColorBand","$color","TagsContainer","CategoryContainer","COLORS","neutral_500","CardMiddleSection","colorBandColor","categoryIcon","categoryLabel","title","description","tags","Boolean","ComponentTextStyle","Bold","black","neutral_600","map","x"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;;;;;;;;;AAaA,IAAMA,SAAS,GAAGC,0BAAOC,GAAV,iVAiBX,UAAAC,KAAK;AAAA,SACLA,KAAK,CAACC,eAAN,IAAyBC,kBAAgBC,SAAzC,2BAEUH,KAAK,CAACI,QAAN,GAAiB,aAAjB,GAAiC,SAF3C,aAII,EALC;AAAA,CAjBM,CAAf;;AAyBA,IAAMC,SAAS,GAAGP,0BAAOC,GAAV,qMAMO,UAAAC,KAAK;AAAA,SAAIA,KAAK,CAACM,MAAV;AAAA,CANZ,CAAf;;AASA,IAAMC,aAAa,GAAGT,0BAAOC,GAAV,qLAAnB;;AAQA,IAAMS,iBAAiB,GAAGV,0BAAOC,GAAV,qQAQVU,SAAOC,WARG,CAAvB;;AAcA,IAAMC,iBAAkE,GAAG,SAArEA,iBAAqE,OAS7C;AAAA,MAR5BV,eAQ4B,QAR5BA,eAQ4B;AAAA,MAP5BW,cAO4B,QAP5BA,cAO4B;AAAA,MAN5BC,YAM4B,QAN5BA,YAM4B;AAAA,MAL5BC,aAK4B,QAL5BA,aAK4B;AAAA,MAJ5BC,KAI4B,QAJ5BA,KAI4B;AAAA,MAH5BC,WAG4B,QAH5BA,WAG4B;AAAA,MAF5BC,IAE4B,QAF5BA,IAE4B;AAAA,MAD5Bb,QAC4B,QAD5BA,QAC4B;AAC5B,sBACE,sBAAC,SAAD;AAAW,IAAA,QAAQ,EAAEA,QAArB;AAA+B,IAAA,eAAe,EAAEH,eAAhD;AAAA,eACGW,cAAc,iBAAI,qBAAC,SAAD;AAAW,MAAA,MAAM,EAAEA;AAAnB,MADrB,eAEE,sBAAC,iBAAD;AAAmB,MAAA,cAAc,EAAEM,OAAO,CAACN,cAAD,CAA1C;AAA4D,MAAA,YAAY,EAAEM,OAAO,CAACL,YAAY,IAAIC,aAAjB,CAAjF;AAAA,iBACGD,YADH,eAEE,qBAAC,YAAD;AAAY,QAAA,SAAS,EAAEM,qBAAmBC,IAA1C;AAAgD,QAAA,KAAK,EAAEX,SAAOC,WAA9D;AAAA,kBACGI;AADH,QAFF;AAAA,MAFF,eAQE,qBAAC,aAAD;AAAa,MAAA,SAAS,EAAC,YAAvB;AAAoC,MAAA,SAAS,EAAEK,qBAAmBC,IAAlE;AAAwE,MAAA,KAAK,EAAEhB,QAAQ,GAAGK,SAAOC,WAAV,GAAwBD,SAAOY,KAAtH;AAAA,gBACGN;AADH,MARF,EAWGC,WAAW,iBACV,qBAAC,YAAD;AAAY,MAAA,SAAS,EAAC,kBAAtB;AAAyC,MAAA,KAAK,EAAEP,SAAOa,WAAvD;AAAA,gBACGN;AADH,MAZJ,EAgBGC,IAAI,iBACH,qBAAC,aAAD;AAAA,gBACGA,IAAI,CAACM,GAAL,CAAS,UAAAC,CAAC;AAAA,4BACT,qBAAC,KAAD;AAAK,UAAA,KAAK,EAAEA;AAAZ,UADS;AAAA,OAAV;AADH,MAjBJ;AAAA,IADF;AA0BD,CApCD;;;AAlEEZ,EAAAA,c;AAEAC,EAAAA,Y;AACAC,EAAAA,a;AACAC,EAAAA,K;AACAC,EAAAA,W;AACAC,EAAAA,I;AACAb,EAAAA,Q;;eAiGaO,iB","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport { COLORS, ComponentS, ComponentTextStyle, ComponentXL, ComponentXS, InteractionType, Tag } from '..';\n\nexport interface CardMiddleSectionProps {\n colorBandColor?: string;\n interactionType: InteractionType;\n categoryIcon?: React.ReactNode;\n categoryLabel?: string;\n title: string;\n description?: string;\n tags?: string[];\n disabled: boolean;\n}\n\nconst Container = styled.div<{ interactionType: InteractionType; disabled: boolean }>`\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 ${props =>\n props.interactionType == InteractionType.Clickable\n ? `\n cursor: ${props.disabled ? 'not-allowed' : 'pointer'};\n `\n : ''}\n`;\n\nconst ColorBand = 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\nconst TagsContainer = styled.div`\n display: flex;\n flex-direction: row;\n padding: 4px 0;\n gap: 4px;\n flex-wrap: wrap;\n`;\n\nconst CategoryContainer = 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 interactionType,\n colorBandColor,\n categoryIcon,\n categoryLabel,\n title,\n description,\n tags,\n disabled\n}: CardMiddleSectionProps) => {\n return (\n <Container disabled={disabled} interactionType={interactionType}>\n {colorBandColor && <ColorBand $color={colorBandColor} />}\n <CategoryContainer extraTopMargin={Boolean(colorBandColor)} bottomMargin={Boolean(categoryIcon || categoryLabel)}>\n {categoryIcon}\n <ComponentS textStyle={ComponentTextStyle.Bold} color={COLORS.neutral_500}>\n {categoryLabel}\n </ComponentS>\n </CategoryContainer>\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 <TagsContainer>\n {tags.map(x => (\n <Tag label={x} />\n ))}\n </TagsContainer>\n )}\n </Container>\n );\n};\n\nexport default CardMiddleSection;\n"],"file":"CardMiddleSection.cjs"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { InteractionType } from '..';
|
|
3
|
+
export interface CardMiddleSectionProps {
|
|
4
|
+
colorBandColor?: string;
|
|
5
|
+
interactionType: InteractionType;
|
|
6
|
+
categoryIcon?: React.ReactNode;
|
|
7
|
+
categoryLabel?: string;
|
|
8
|
+
title: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
tags?: string[];
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare const CardMiddleSection: React.FunctionComponent<CardMiddleSectionProps>;
|
|
14
|
+
export default CardMiddleSection;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
+
import _pt from "prop-types";
|
|
3
|
+
|
|
4
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
5
|
+
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
import styled from 'styled-components';
|
|
8
|
+
import { COLORS, ComponentS, ComponentTextStyle, ComponentXL, InteractionType, Tag } from '..';
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
var Container = 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\n ", "\n"])), function (props) {
|
|
12
|
+
return props.interactionType == InteractionType.Clickable ? "\n cursor: ".concat(props.disabled ? 'not-allowed' : 'pointer', ";\n ") : '';
|
|
13
|
+
});
|
|
14
|
+
var ColorBand = 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) {
|
|
15
|
+
return props.$color;
|
|
16
|
+
});
|
|
17
|
+
var TagsContainer = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n padding: 4px 0;\n gap: 4px;\n flex-wrap: wrap;\n"])));
|
|
18
|
+
var CategoryContainer = 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);
|
|
19
|
+
|
|
20
|
+
var CardMiddleSection = function CardMiddleSection(_ref) {
|
|
21
|
+
var interactionType = _ref.interactionType,
|
|
22
|
+
colorBandColor = _ref.colorBandColor,
|
|
23
|
+
categoryIcon = _ref.categoryIcon,
|
|
24
|
+
categoryLabel = _ref.categoryLabel,
|
|
25
|
+
title = _ref.title,
|
|
26
|
+
description = _ref.description,
|
|
27
|
+
tags = _ref.tags,
|
|
28
|
+
disabled = _ref.disabled;
|
|
29
|
+
return /*#__PURE__*/_jsxs(Container, {
|
|
30
|
+
disabled: disabled,
|
|
31
|
+
interactionType: interactionType,
|
|
32
|
+
children: [colorBandColor && /*#__PURE__*/_jsx(ColorBand, {
|
|
33
|
+
$color: colorBandColor
|
|
34
|
+
}), /*#__PURE__*/_jsxs(CategoryContainer, {
|
|
35
|
+
extraTopMargin: Boolean(colorBandColor),
|
|
36
|
+
bottomMargin: Boolean(categoryIcon || categoryLabel),
|
|
37
|
+
children: [categoryIcon, /*#__PURE__*/_jsx(ComponentS, {
|
|
38
|
+
textStyle: ComponentTextStyle.Bold,
|
|
39
|
+
color: COLORS.neutral_500,
|
|
40
|
+
children: categoryLabel
|
|
41
|
+
})]
|
|
42
|
+
}), /*#__PURE__*/_jsx(ComponentXL, {
|
|
43
|
+
className: "titleBlock",
|
|
44
|
+
textStyle: ComponentTextStyle.Bold,
|
|
45
|
+
color: disabled ? COLORS.neutral_500 : COLORS.black,
|
|
46
|
+
children: title
|
|
47
|
+
}), description && /*#__PURE__*/_jsx(ComponentS, {
|
|
48
|
+
className: "descriptionBlock",
|
|
49
|
+
color: COLORS.neutral_600,
|
|
50
|
+
children: description
|
|
51
|
+
}), tags && /*#__PURE__*/_jsx(TagsContainer, {
|
|
52
|
+
children: tags.map(function (x) {
|
|
53
|
+
return /*#__PURE__*/_jsx(Tag, {
|
|
54
|
+
label: x
|
|
55
|
+
});
|
|
56
|
+
})
|
|
57
|
+
})]
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
CardMiddleSection.propTypes = {
|
|
62
|
+
colorBandColor: _pt.string,
|
|
63
|
+
categoryIcon: _pt.node,
|
|
64
|
+
categoryLabel: _pt.string,
|
|
65
|
+
title: _pt.string.isRequired,
|
|
66
|
+
description: _pt.string,
|
|
67
|
+
tags: _pt.arrayOf(_pt.string),
|
|
68
|
+
disabled: _pt.bool.isRequired
|
|
69
|
+
};
|
|
70
|
+
export default CardMiddleSection;
|
|
71
|
+
//# sourceMappingURL=CardMiddleSection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/Card/CardMiddleSection.tsx"],"names":["React","styled","COLORS","ComponentS","ComponentTextStyle","ComponentXL","InteractionType","Tag","Container","div","props","interactionType","Clickable","disabled","ColorBand","$color","TagsContainer","CategoryContainer","neutral_500","CardMiddleSection","colorBandColor","categoryIcon","categoryLabel","title","description","tags","Boolean","Bold","black","neutral_600","map","x"],"mappings":";;;;;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,SAASC,MAAT,EAAiBC,UAAjB,EAA6BC,kBAA7B,EAAiDC,WAAjD,EAA2EC,eAA3E,EAA4FC,GAA5F,QAAuG,IAAvG;;;AAaA,IAAMC,SAAS,GAAGP,MAAM,CAACQ,GAAV,mUAiBX,UAAAC,KAAK;AAAA,SACLA,KAAK,CAACC,eAAN,IAAyBL,eAAe,CAACM,SAAzC,2BAEUF,KAAK,CAACG,QAAN,GAAiB,aAAjB,GAAiC,SAF3C,aAII,EALC;AAAA,CAjBM,CAAf;AAyBA,IAAMC,SAAS,GAAGb,MAAM,CAACQ,GAAV,uLAMO,UAAAC,KAAK;AAAA,SAAIA,KAAK,CAACK,MAAV;AAAA,CANZ,CAAf;AASA,IAAMC,aAAa,GAAGf,MAAM,CAACQ,GAAV,uKAAnB;AAQA,IAAMQ,iBAAiB,GAAGhB,MAAM,CAACQ,GAAV,uPAQVP,MAAM,CAACgB,WARG,CAAvB;;AAcA,IAAMC,iBAAkE,GAAG,SAArEA,iBAAqE,OAS7C;AAAA,MAR5BR,eAQ4B,QAR5BA,eAQ4B;AAAA,MAP5BS,cAO4B,QAP5BA,cAO4B;AAAA,MAN5BC,YAM4B,QAN5BA,YAM4B;AAAA,MAL5BC,aAK4B,QAL5BA,aAK4B;AAAA,MAJ5BC,KAI4B,QAJ5BA,KAI4B;AAAA,MAH5BC,WAG4B,QAH5BA,WAG4B;AAAA,MAF5BC,IAE4B,QAF5BA,IAE4B;AAAA,MAD5BZ,QAC4B,QAD5BA,QAC4B;AAC5B,sBACE,MAAC,SAAD;AAAW,IAAA,QAAQ,EAAEA,QAArB;AAA+B,IAAA,eAAe,EAAEF,eAAhD;AAAA,eACGS,cAAc,iBAAI,KAAC,SAAD;AAAW,MAAA,MAAM,EAAEA;AAAnB,MADrB,eAEE,MAAC,iBAAD;AAAmB,MAAA,cAAc,EAAEM,OAAO,CAACN,cAAD,CAA1C;AAA4D,MAAA,YAAY,EAAEM,OAAO,CAACL,YAAY,IAAIC,aAAjB,CAAjF;AAAA,iBACGD,YADH,eAEE,KAAC,UAAD;AAAY,QAAA,SAAS,EAAEjB,kBAAkB,CAACuB,IAA1C;AAAgD,QAAA,KAAK,EAAEzB,MAAM,CAACgB,WAA9D;AAAA,kBACGI;AADH,QAFF;AAAA,MAFF,eAQE,KAAC,WAAD;AAAa,MAAA,SAAS,EAAC,YAAvB;AAAoC,MAAA,SAAS,EAAElB,kBAAkB,CAACuB,IAAlE;AAAwE,MAAA,KAAK,EAAEd,QAAQ,GAAGX,MAAM,CAACgB,WAAV,GAAwBhB,MAAM,CAAC0B,KAAtH;AAAA,gBACGL;AADH,MARF,EAWGC,WAAW,iBACV,KAAC,UAAD;AAAY,MAAA,SAAS,EAAC,kBAAtB;AAAyC,MAAA,KAAK,EAAEtB,MAAM,CAAC2B,WAAvD;AAAA,gBACGL;AADH,MAZJ,EAgBGC,IAAI,iBACH,KAAC,aAAD;AAAA,gBACGA,IAAI,CAACK,GAAL,CAAS,UAAAC,CAAC;AAAA,4BACT,KAAC,GAAD;AAAK,UAAA,KAAK,EAAEA;AAAZ,UADS;AAAA,OAAV;AADH,MAjBJ;AAAA,IADF;AA0BD,CApCD;;;AAlEEX,EAAAA,c;AAEAC,EAAAA,Y;AACAC,EAAAA,a;AACAC,EAAAA,K;AACAC,EAAAA,W;AACAC,EAAAA,I;AACAZ,EAAAA,Q;;AAiGF,eAAeM,iBAAf","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport { COLORS, ComponentS, ComponentTextStyle, ComponentXL, ComponentXS, InteractionType, Tag } from '..';\n\nexport interface CardMiddleSectionProps {\n colorBandColor?: string;\n interactionType: InteractionType;\n categoryIcon?: React.ReactNode;\n categoryLabel?: string;\n title: string;\n description?: string;\n tags?: string[];\n disabled: boolean;\n}\n\nconst Container = styled.div<{ interactionType: InteractionType; disabled: boolean }>`\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 ${props =>\n props.interactionType == InteractionType.Clickable\n ? `\n cursor: ${props.disabled ? 'not-allowed' : 'pointer'};\n `\n : ''}\n`;\n\nconst ColorBand = 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\nconst TagsContainer = styled.div`\n display: flex;\n flex-direction: row;\n padding: 4px 0;\n gap: 4px;\n flex-wrap: wrap;\n`;\n\nconst CategoryContainer = 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 interactionType,\n colorBandColor,\n categoryIcon,\n categoryLabel,\n title,\n description,\n tags,\n disabled\n}: CardMiddleSectionProps) => {\n return (\n <Container disabled={disabled} interactionType={interactionType}>\n {colorBandColor && <ColorBand $color={colorBandColor} />}\n <CategoryContainer extraTopMargin={Boolean(colorBandColor)} bottomMargin={Boolean(categoryIcon || categoryLabel)}>\n {categoryIcon}\n <ComponentS textStyle={ComponentTextStyle.Bold} color={COLORS.neutral_500}>\n {categoryLabel}\n </ComponentS>\n </CategoryContainer>\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 <TagsContainer>\n {tags.map(x => (\n <Tag label={x} />\n ))}\n </TagsContainer>\n )}\n </Container>\n );\n};\n\nexport default CardMiddleSection;\n"],"file":"CardMiddleSection.js"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.default = void 0;
|
|
11
|
+
|
|
12
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
13
|
+
|
|
14
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
+
|
|
16
|
+
var React = _interopRequireWildcard(require("react"));
|
|
17
|
+
|
|
18
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
19
|
+
|
|
20
|
+
var _typography = require("../styles/typography");
|
|
21
|
+
|
|
22
|
+
var _Checkbox = _interopRequireDefault(require("../InputFields/Checkbox"));
|
|
23
|
+
|
|
24
|
+
var _Tag = require("../Tag");
|
|
25
|
+
|
|
26
|
+
var _ = require("..");
|
|
27
|
+
|
|
28
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
29
|
+
|
|
30
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
31
|
+
|
|
32
|
+
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); }
|
|
33
|
+
|
|
34
|
+
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; }
|
|
35
|
+
|
|
36
|
+
var Img = _styledComponents.default.img(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n object-fit: cover;\n width: 100%;\n height: 100%;\n border-top-right-radius: 8px;\n border-top-left-radius: 8px;\n"])));
|
|
37
|
+
|
|
38
|
+
var TagContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n\n top: 16px;\n left: 16px;\n"])));
|
|
39
|
+
|
|
40
|
+
var Container = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n width: 100%;\n height: 200px;\n overflow: visible;\n\n ", "\n\n ", "\n"])), function (props) {
|
|
41
|
+
return props.disabled ? "\n img, svg {\n filter: grayscale(100%);\n }" : '';
|
|
42
|
+
}, function (props) {
|
|
43
|
+
return props.interactionType == _.InteractionType.Clickable ? "\n cursor: ".concat(props.disabled ? 'not-allowed' : 'pointer', ";\n ") : '';
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
var RibbonContainer = _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\n svg {\n color: ", ";\n margin-right: 9px;\n width: 24px;\n height: 24px;\n flex-grow: 0;\n flex-shrink: 0;\n }\n"])), function (props) {
|
|
47
|
+
return props.$backgroundColor;
|
|
48
|
+
}, function (props) {
|
|
49
|
+
return props.$color;
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
var CheckboxContainer = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n top: 0px;\n right: 0px;\n\n .checkbox-icon {\n background-color: ", ";\n }\n"])), _.COLORS.white);
|
|
53
|
+
|
|
54
|
+
var CardTopSection = function CardTopSection(_ref) {
|
|
55
|
+
var interactionType = _ref.interactionType,
|
|
56
|
+
selected = _ref.selected,
|
|
57
|
+
setSelected = _ref.setSelected,
|
|
58
|
+
image = _ref.image,
|
|
59
|
+
tagLabel = _ref.tagLabel,
|
|
60
|
+
tagIcon = _ref.tagIcon,
|
|
61
|
+
_ref$tagVariant = _ref.tagVariant,
|
|
62
|
+
tagVariant = _ref$tagVariant === void 0 ? 'positive' : _ref$tagVariant,
|
|
63
|
+
highlightRibbonIcon = _ref.highlightRibbonIcon,
|
|
64
|
+
highlightRibbonText = _ref.highlightRibbonText,
|
|
65
|
+
highlightRibbonContentColor = _ref.highlightRibbonContentColor,
|
|
66
|
+
highlightRibbonBgColor = _ref.highlightRibbonBgColor,
|
|
67
|
+
disabled = _ref.disabled;
|
|
68
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Container, {
|
|
69
|
+
disabled: disabled,
|
|
70
|
+
interactionType: interactionType,
|
|
71
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Img, {
|
|
72
|
+
src: image
|
|
73
|
+
}), (selected !== undefined || setSelected !== undefined) && interactionType == _.InteractionType.Selectable && /*#__PURE__*/(0, _jsxRuntime.jsx)(CheckboxContainer, {
|
|
74
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Checkbox.default, {
|
|
75
|
+
select: function select(selected) {
|
|
76
|
+
return setSelected(selected);
|
|
77
|
+
},
|
|
78
|
+
selected: selected
|
|
79
|
+
})
|
|
80
|
+
}), (tagLabel || tagIcon) && /*#__PURE__*/(0, _jsxRuntime.jsx)(TagContainer, {
|
|
81
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tag.Tag, {
|
|
82
|
+
label: tagLabel,
|
|
83
|
+
variant: tagVariant,
|
|
84
|
+
icon: tagIcon
|
|
85
|
+
})
|
|
86
|
+
}), (highlightRibbonIcon || highlightRibbonText) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(RibbonContainer, {
|
|
87
|
+
$color: highlightRibbonContentColor !== null && highlightRibbonContentColor !== void 0 ? highlightRibbonContentColor : '',
|
|
88
|
+
$backgroundColor: disabled ? _.COLORS.neutral_300 : highlightRibbonBgColor !== null && highlightRibbonBgColor !== void 0 ? highlightRibbonBgColor : '',
|
|
89
|
+
children: [highlightRibbonIcon, highlightRibbonText && /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.ComponentS, {
|
|
90
|
+
color: highlightRibbonContentColor !== null && highlightRibbonContentColor !== void 0 ? highlightRibbonContentColor : '',
|
|
91
|
+
textStyle: _typography.ComponentTextStyle.Regular,
|
|
92
|
+
children: highlightRibbonText
|
|
93
|
+
})]
|
|
94
|
+
})]
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
CardTopSection.propTypes = {
|
|
99
|
+
selected: _propTypes.default.bool.isRequired,
|
|
100
|
+
setSelected: _propTypes.default.func.isRequired,
|
|
101
|
+
tagLabel: _propTypes.default.string,
|
|
102
|
+
tagIcon: _propTypes.default.node,
|
|
103
|
+
highlightRibbonText: _propTypes.default.string,
|
|
104
|
+
highlightRibbonIcon: _propTypes.default.string,
|
|
105
|
+
highlightRibbonContentColor: _propTypes.default.string,
|
|
106
|
+
highlightRibbonBgColor: _propTypes.default.string,
|
|
107
|
+
image: _propTypes.default.string,
|
|
108
|
+
disabled: _propTypes.default.bool.isRequired
|
|
109
|
+
};
|
|
110
|
+
var _default = CardTopSection;
|
|
111
|
+
exports.default = _default;
|
|
112
|
+
//# sourceMappingURL=CardTopSection.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/Card/CardTopSection.tsx"],"names":["Img","styled","img","TagContainer","div","Container","props","disabled","interactionType","InteractionType","Clickable","RibbonContainer","$backgroundColor","$color","CheckboxContainer","COLORS","white","CardTopSection","selected","setSelected","image","tagLabel","tagIcon","tagVariant","highlightRibbonIcon","highlightRibbonText","highlightRibbonContentColor","highlightRibbonBgColor","undefined","Selectable","neutral_300","ComponentTextStyle","Regular"],"mappings":"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","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport { ComponentS, ComponentTextStyle } from '../styles/typography';\nimport Checkbox, { StyledCheckBox } from '../InputFields/Checkbox';\nimport { Tag, TagVariants } from '../Tag';\n\nimport { COLORS, InteractionType } from '..';\n\nexport interface CardTopSectionProps {\n interactionType: InteractionType;\n selected: boolean;\n setSelected: (arg0: boolean) => void;\n tagLabel?: string;\n tagIcon?: React.ReactNode;\n tagVariant?: TagVariants;\n highlightRibbonText?: string;\n highlightRibbonIcon?: string;\n highlightRibbonContentColor?: string;\n highlightRibbonBgColor?: string;\n image?: string;\n disabled: boolean;\n}\n\nconst Img = styled.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\nconst TagContainer = styled.div`\n position: absolute;\n\n top: 16px;\n left: 16px;\n`;\n\nconst Container = styled.div<{ interactionType: InteractionType; disabled: boolean }>`\n position: relative;\n width: 100%;\n height: 200px;\n overflow: visible;\n\n ${props => props.disabled ? `\n img, svg {\n filter: grayscale(100%);\n }` : ''}\n\n ${props =>\n props.interactionType == InteractionType.Clickable\n ? `\n cursor: ${props.disabled ? 'not-allowed' : 'pointer'};\n `\n : ''}\n`;\n\nconst RibbonContainer = styled.div<{ $color: string; $backgroundColor: string }>`\n min-height: calc(40px - 16px);\n background-color: ${props => props.$backgroundColor};\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\n svg {\n color: ${props => props.$color};\n margin-right: 9px;\n width: 24px;\n height: 24px;\n flex-grow: 0;\n flex-shrink: 0;\n }\n`;\n\nconst CheckboxContainer = styled.div`\n position: absolute;\n top: 0px;\n right: 0px;\n\n .checkbox-icon {\n background-color: ${COLORS.white};\n }\n`;\n\nconst CardTopSection: React.FunctionComponent<CardTopSectionProps> = ({\n interactionType,\n selected,\n setSelected,\n image,\n tagLabel,\n tagIcon,\n tagVariant = 'positive',\n highlightRibbonIcon,\n highlightRibbonText,\n highlightRibbonContentColor,\n highlightRibbonBgColor,\n disabled\n}: CardTopSectionProps) => {\n return (\n <Container disabled={disabled} interactionType={interactionType}>\n <Img src={image} />\n {(selected !== undefined || setSelected !== undefined) && interactionType == InteractionType.Selectable && (\n <CheckboxContainer>\n <Checkbox select={(selected: boolean) => setSelected(selected)} selected={selected} />\n </CheckboxContainer>\n )}\n {(tagLabel || tagIcon) && (\n <TagContainer>\n <Tag label={tagLabel} variant={tagVariant} icon={tagIcon} />\n </TagContainer>\n )}\n {(highlightRibbonIcon || highlightRibbonText) && (\n <RibbonContainer $color={highlightRibbonContentColor ?? ''} $backgroundColor={disabled ? COLORS.neutral_300 : highlightRibbonBgColor ?? ''}>\n {highlightRibbonIcon}\n {highlightRibbonText && (\n <ComponentS color={highlightRibbonContentColor ?? ''} textStyle={ComponentTextStyle.Regular}>\n {highlightRibbonText}\n </ComponentS>\n )}\n </RibbonContainer>\n )}\n </Container>\n );\n};\n\nexport default CardTopSection;\n"],"file":"CardTopSection.cjs"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { TagVariants } from '../Tag';
|
|
3
|
+
import { InteractionType } from '..';
|
|
4
|
+
export interface CardTopSectionProps {
|
|
5
|
+
interactionType: InteractionType;
|
|
6
|
+
selected: boolean;
|
|
7
|
+
setSelected: (arg0: boolean) => void;
|
|
8
|
+
tagLabel?: string;
|
|
9
|
+
tagIcon?: React.ReactNode;
|
|
10
|
+
tagVariant?: TagVariants;
|
|
11
|
+
highlightRibbonText?: string;
|
|
12
|
+
highlightRibbonIcon?: string;
|
|
13
|
+
highlightRibbonContentColor?: string;
|
|
14
|
+
highlightRibbonBgColor?: string;
|
|
15
|
+
image?: string;
|
|
16
|
+
disabled: boolean;
|
|
17
|
+
}
|
|
18
|
+
declare const CardTopSection: React.FunctionComponent<CardTopSectionProps>;
|
|
19
|
+
export default CardTopSection;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
+
import _pt from "prop-types";
|
|
3
|
+
|
|
4
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
5
|
+
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
import styled from 'styled-components';
|
|
8
|
+
import { ComponentS, ComponentTextStyle } from '../styles/typography';
|
|
9
|
+
import Checkbox from '../InputFields/Checkbox';
|
|
10
|
+
import { Tag } from '../Tag';
|
|
11
|
+
import { COLORS, InteractionType } from '..';
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
var Img = styled.img(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n object-fit: cover;\n width: 100%;\n height: 100%;\n border-top-right-radius: 8px;\n border-top-left-radius: 8px;\n"])));
|
|
15
|
+
var TagContainer = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: absolute;\n\n top: 16px;\n left: 16px;\n"])));
|
|
16
|
+
var Container = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: relative;\n width: 100%;\n height: 200px;\n overflow: visible;\n\n ", "\n\n ", "\n"])), function (props) {
|
|
17
|
+
return props.disabled ? "\n img, svg {\n filter: grayscale(100%);\n }" : '';
|
|
18
|
+
}, function (props) {
|
|
19
|
+
return props.interactionType == InteractionType.Clickable ? "\n cursor: ".concat(props.disabled ? 'not-allowed' : 'pointer', ";\n ") : '';
|
|
20
|
+
});
|
|
21
|
+
var RibbonContainer = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\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\n svg {\n color: ", ";\n margin-right: 9px;\n width: 24px;\n height: 24px;\n flex-grow: 0;\n flex-shrink: 0;\n }\n"])), function (props) {
|
|
22
|
+
return props.$backgroundColor;
|
|
23
|
+
}, function (props) {
|
|
24
|
+
return props.$color;
|
|
25
|
+
});
|
|
26
|
+
var CheckboxContainer = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n position: absolute;\n top: 0px;\n right: 0px;\n\n .checkbox-icon {\n background-color: ", ";\n }\n"])), COLORS.white);
|
|
27
|
+
|
|
28
|
+
var CardTopSection = function CardTopSection(_ref) {
|
|
29
|
+
var interactionType = _ref.interactionType,
|
|
30
|
+
selected = _ref.selected,
|
|
31
|
+
setSelected = _ref.setSelected,
|
|
32
|
+
image = _ref.image,
|
|
33
|
+
tagLabel = _ref.tagLabel,
|
|
34
|
+
tagIcon = _ref.tagIcon,
|
|
35
|
+
_ref$tagVariant = _ref.tagVariant,
|
|
36
|
+
tagVariant = _ref$tagVariant === void 0 ? 'positive' : _ref$tagVariant,
|
|
37
|
+
highlightRibbonIcon = _ref.highlightRibbonIcon,
|
|
38
|
+
highlightRibbonText = _ref.highlightRibbonText,
|
|
39
|
+
highlightRibbonContentColor = _ref.highlightRibbonContentColor,
|
|
40
|
+
highlightRibbonBgColor = _ref.highlightRibbonBgColor,
|
|
41
|
+
disabled = _ref.disabled;
|
|
42
|
+
return /*#__PURE__*/_jsxs(Container, {
|
|
43
|
+
disabled: disabled,
|
|
44
|
+
interactionType: interactionType,
|
|
45
|
+
children: [/*#__PURE__*/_jsx(Img, {
|
|
46
|
+
src: image
|
|
47
|
+
}), (selected !== undefined || setSelected !== undefined) && interactionType == InteractionType.Selectable && /*#__PURE__*/_jsx(CheckboxContainer, {
|
|
48
|
+
children: /*#__PURE__*/_jsx(Checkbox, {
|
|
49
|
+
select: function select(selected) {
|
|
50
|
+
return setSelected(selected);
|
|
51
|
+
},
|
|
52
|
+
selected: selected
|
|
53
|
+
})
|
|
54
|
+
}), (tagLabel || tagIcon) && /*#__PURE__*/_jsx(TagContainer, {
|
|
55
|
+
children: /*#__PURE__*/_jsx(Tag, {
|
|
56
|
+
label: tagLabel,
|
|
57
|
+
variant: tagVariant,
|
|
58
|
+
icon: tagIcon
|
|
59
|
+
})
|
|
60
|
+
}), (highlightRibbonIcon || highlightRibbonText) && /*#__PURE__*/_jsxs(RibbonContainer, {
|
|
61
|
+
$color: highlightRibbonContentColor !== null && highlightRibbonContentColor !== void 0 ? highlightRibbonContentColor : '',
|
|
62
|
+
$backgroundColor: disabled ? COLORS.neutral_300 : highlightRibbonBgColor !== null && highlightRibbonBgColor !== void 0 ? highlightRibbonBgColor : '',
|
|
63
|
+
children: [highlightRibbonIcon, highlightRibbonText && /*#__PURE__*/_jsx(ComponentS, {
|
|
64
|
+
color: highlightRibbonContentColor !== null && highlightRibbonContentColor !== void 0 ? highlightRibbonContentColor : '',
|
|
65
|
+
textStyle: ComponentTextStyle.Regular,
|
|
66
|
+
children: highlightRibbonText
|
|
67
|
+
})]
|
|
68
|
+
})]
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
CardTopSection.propTypes = {
|
|
73
|
+
selected: _pt.bool.isRequired,
|
|
74
|
+
setSelected: _pt.func.isRequired,
|
|
75
|
+
tagLabel: _pt.string,
|
|
76
|
+
tagIcon: _pt.node,
|
|
77
|
+
highlightRibbonText: _pt.string,
|
|
78
|
+
highlightRibbonIcon: _pt.string,
|
|
79
|
+
highlightRibbonContentColor: _pt.string,
|
|
80
|
+
highlightRibbonBgColor: _pt.string,
|
|
81
|
+
image: _pt.string,
|
|
82
|
+
disabled: _pt.bool.isRequired
|
|
83
|
+
};
|
|
84
|
+
export default CardTopSection;
|
|
85
|
+
//# sourceMappingURL=CardTopSection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/Card/CardTopSection.tsx"],"names":["React","styled","ComponentS","ComponentTextStyle","Checkbox","Tag","COLORS","InteractionType","Img","img","TagContainer","div","Container","props","disabled","interactionType","Clickable","RibbonContainer","$backgroundColor","$color","CheckboxContainer","white","CardTopSection","selected","setSelected","image","tagLabel","tagIcon","tagVariant","highlightRibbonIcon","highlightRibbonText","highlightRibbonContentColor","highlightRibbonBgColor","undefined","Selectable","neutral_300","Regular"],"mappings":"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","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport { ComponentS, ComponentTextStyle } from '../styles/typography';\nimport Checkbox, { StyledCheckBox } from '../InputFields/Checkbox';\nimport { Tag, TagVariants } from '../Tag';\n\nimport { COLORS, InteractionType } from '..';\n\nexport interface CardTopSectionProps {\n interactionType: InteractionType;\n selected: boolean;\n setSelected: (arg0: boolean) => void;\n tagLabel?: string;\n tagIcon?: React.ReactNode;\n tagVariant?: TagVariants;\n highlightRibbonText?: string;\n highlightRibbonIcon?: string;\n highlightRibbonContentColor?: string;\n highlightRibbonBgColor?: string;\n image?: string;\n disabled: boolean;\n}\n\nconst Img = styled.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\nconst TagContainer = styled.div`\n position: absolute;\n\n top: 16px;\n left: 16px;\n`;\n\nconst Container = styled.div<{ interactionType: InteractionType; disabled: boolean }>`\n position: relative;\n width: 100%;\n height: 200px;\n overflow: visible;\n\n ${props => props.disabled ? `\n img, svg {\n filter: grayscale(100%);\n }` : ''}\n\n ${props =>\n props.interactionType == InteractionType.Clickable\n ? `\n cursor: ${props.disabled ? 'not-allowed' : 'pointer'};\n `\n : ''}\n`;\n\nconst RibbonContainer = styled.div<{ $color: string; $backgroundColor: string }>`\n min-height: calc(40px - 16px);\n background-color: ${props => props.$backgroundColor};\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\n svg {\n color: ${props => props.$color};\n margin-right: 9px;\n width: 24px;\n height: 24px;\n flex-grow: 0;\n flex-shrink: 0;\n }\n`;\n\nconst CheckboxContainer = styled.div`\n position: absolute;\n top: 0px;\n right: 0px;\n\n .checkbox-icon {\n background-color: ${COLORS.white};\n }\n`;\n\nconst CardTopSection: React.FunctionComponent<CardTopSectionProps> = ({\n interactionType,\n selected,\n setSelected,\n image,\n tagLabel,\n tagIcon,\n tagVariant = 'positive',\n highlightRibbonIcon,\n highlightRibbonText,\n highlightRibbonContentColor,\n highlightRibbonBgColor,\n disabled\n}: CardTopSectionProps) => {\n return (\n <Container disabled={disabled} interactionType={interactionType}>\n <Img src={image} />\n {(selected !== undefined || setSelected !== undefined) && interactionType == InteractionType.Selectable && (\n <CheckboxContainer>\n <Checkbox select={(selected: boolean) => setSelected(selected)} selected={selected} />\n </CheckboxContainer>\n )}\n {(tagLabel || tagIcon) && (\n <TagContainer>\n <Tag label={tagLabel} variant={tagVariant} icon={tagIcon} />\n </TagContainer>\n )}\n {(highlightRibbonIcon || highlightRibbonText) && (\n <RibbonContainer $color={highlightRibbonContentColor ?? ''} $backgroundColor={disabled ? COLORS.neutral_300 : highlightRibbonBgColor ?? ''}>\n {highlightRibbonIcon}\n {highlightRibbonText && (\n <ComponentS color={highlightRibbonContentColor ?? ''} textStyle={ComponentTextStyle.Regular}>\n {highlightRibbonText}\n </ComponentS>\n )}\n </RibbonContainer>\n )}\n </Container>\n );\n};\n\nexport default CardTopSection;\n"],"file":"CardTopSection.js"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
Object.defineProperty(exports, "Card", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function get() {
|
|
13
|
+
return _Card.default;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(exports, "CardBottomSection", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function get() {
|
|
19
|
+
return _CardBottomSection.default;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
Object.defineProperty(exports, "CardMiddleSection", {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function get() {
|
|
25
|
+
return _CardMiddleSection.default;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(exports, "CardTopSection", {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: function get() {
|
|
31
|
+
return _CardTopSection.default;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
Object.defineProperty(exports, "InteractionType", {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
get: function get() {
|
|
37
|
+
return _Card.InteractionType;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
var _Card = _interopRequireWildcard(require("./Card"));
|
|
42
|
+
|
|
43
|
+
var _CardBottomSection = _interopRequireDefault(require("./CardBottomSection"));
|
|
44
|
+
|
|
45
|
+
var _CardMiddleSection = _interopRequireDefault(require("./CardMiddleSection"));
|
|
46
|
+
|
|
47
|
+
var _CardTopSection = _interopRequireDefault(require("./CardTopSection"));
|
|
48
|
+
|
|
49
|
+
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); }
|
|
50
|
+
|
|
51
|
+
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; }
|
|
52
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/Card/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA","sourcesContent":["export {default as Card} from './Card';\nexport {default as CardBottomSection} from './CardBottomSection';\nexport {default as CardMiddleSection} from './CardMiddleSection';\nexport {default as CardTopSection} from './CardTopSection';\nexport {InteractionType} from './Card';"],"file":"index.cjs"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as Card } from './Card';
|
|
2
|
+
export { default as CardBottomSection } from './CardBottomSection';
|
|
3
|
+
export { default as CardMiddleSection } from './CardMiddleSection';
|
|
4
|
+
export { default as CardTopSection } from './CardTopSection';
|
|
5
|
+
export { InteractionType } from './Card';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as Card } from './Card';
|
|
2
|
+
export { default as CardBottomSection } from './CardBottomSection';
|
|
3
|
+
export { default as CardMiddleSection } from './CardMiddleSection';
|
|
4
|
+
export { default as CardTopSection } from './CardTopSection';
|
|
5
|
+
export { InteractionType } from './Card';
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/Card/index.tsx"],"names":["default","Card","CardBottomSection","CardMiddleSection","CardTopSection","InteractionType"],"mappings":"AAAA,SAAQA,OAAO,IAAIC,IAAnB,QAA8B,QAA9B;AACA,SAAQD,OAAO,IAAIE,iBAAnB,QAA2C,qBAA3C;AACA,SAAQF,OAAO,IAAIG,iBAAnB,QAA2C,qBAA3C;AACA,SAAQH,OAAO,IAAII,cAAnB,QAAwC,kBAAxC;AACA,SAAQC,eAAR,QAA8B,QAA9B","sourcesContent":["export {default as Card} from './Card';\nexport {default as CardBottomSection} from './CardBottomSection';\nexport {default as CardMiddleSection} from './CardMiddleSection';\nexport {default as CardTopSection} from './CardTopSection';\nexport {InteractionType} from './Card';"],"file":"index.js"}
|