@laerdal/life-react-components 1.5.1-dev.16 → 1.5.1-dev.19
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/Tag/Tag.cjs +92 -0
- package/dist/Tag/Tag.cjs.map +1 -0
- package/dist/Tag/Tag.d.ts +9 -0
- package/dist/Tag/Tag.js +70 -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 +1 -0
- package/dist/Tag/index.js +2 -0
- package/dist/Tag/index.js.map +1 -0
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/Card/Card.cjs +0 -101
- package/dist/Card/Card.cjs.map +0 -1
- package/dist/Card/Card.d.ts +0 -23
- package/dist/Card/Card.js +0 -74
- package/dist/Card/Card.js.map +0 -1
- package/dist/Card/CardBottomSection.cjs +0 -139
- package/dist/Card/CardBottomSection.cjs.map +0 -1
- package/dist/Card/CardBottomSection.d.ts +0 -22
- package/dist/Card/CardBottomSection.js +0 -109
- package/dist/Card/CardBottomSection.js.map +0 -1
- package/dist/Card/CardMiddleSection.cjs +0 -104
- package/dist/Card/CardMiddleSection.cjs.map +0 -1
- package/dist/Card/CardMiddleSection.d.ts +0 -14
- package/dist/Card/CardMiddleSection.js +0 -80
- package/dist/Card/CardMiddleSection.js.map +0 -1
- package/dist/Card/CardTopSection.cjs +0 -106
- package/dist/Card/CardTopSection.cjs.map +0 -1
- package/dist/Card/CardTopSection.d.ts +0 -17
- package/dist/Card/CardTopSection.js +0 -80
- package/dist/Card/CardTopSection.js.map +0 -1
- package/dist/Card/index.cjs +0 -52
- package/dist/Card/index.cjs.map +0 -1
- package/dist/Card/index.d.ts +0 -5
- package/dist/Card/index.js +0 -6
- package/dist/Card/index.js.map +0 -1
|
@@ -1,106 +0,0 @@
|
|
|
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 _ = require("..");
|
|
25
|
-
|
|
26
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
27
|
-
|
|
28
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
29
|
-
|
|
30
|
-
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); }
|
|
31
|
-
|
|
32
|
-
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; }
|
|
33
|
-
|
|
34
|
-
var Img = _styledComponents.default.img(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n object-fit: cover;\n width: 100%;\n height: 100%;\n"])));
|
|
35
|
-
|
|
36
|
-
var TagContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n background-color: ", ";\n color: white;\n border-radius: 2px;\n padding: 4px;\n display: flex;\n position: absolute;\n flex-direction: row;\n align-items: center;\n top: 16px;\n left: 16px;\n\n svg {\n color: white;\n margin-right: 4px;\n }\n"])), _.COLORS.correct_500);
|
|
37
|
-
|
|
38
|
-
var Container = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n width: 100%;\n height: 200px;\n overflow: hidden;\n border-top-right-radius: 8px;\n border-top-left-radius: 8px;\n\n ", "\n\n ", "\n"])), function (props) {
|
|
39
|
-
return props.disabled ? "\n img, svg {\n filter: grayscale(100%);\n }" : '';
|
|
40
|
-
}, function (props) {
|
|
41
|
-
return props.interactionType == _.InteractionType.Clickable ? "\n cursor: ".concat(props.disabled ? 'not-allowed' : 'pointer', ";\n ") : '';
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
var RibbonContainer = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n 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 }\n"])), function (props) {
|
|
45
|
-
return props.$backgroundColor;
|
|
46
|
-
}, function (props) {
|
|
47
|
-
return props.$color;
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
var CheckboxContainer = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n top: 14px;\n right: 14px;\n\n .checkbox-icon {\n background-color: ", ";\n }\n"])), _.COLORS.white);
|
|
51
|
-
|
|
52
|
-
var CardTopSection = function CardTopSection(_ref) {
|
|
53
|
-
var interactionType = _ref.interactionType,
|
|
54
|
-
selected = _ref.selected,
|
|
55
|
-
setSelected = _ref.setSelected,
|
|
56
|
-
image = _ref.image,
|
|
57
|
-
tagLabel = _ref.tagLabel,
|
|
58
|
-
tagIcon = _ref.tagIcon,
|
|
59
|
-
highlightRibbonIcon = _ref.highlightRibbonIcon,
|
|
60
|
-
highlightRibbonText = _ref.highlightRibbonText,
|
|
61
|
-
highlightRibbonContentColor = _ref.highlightRibbonContentColor,
|
|
62
|
-
highlightRibbonBgColor = _ref.highlightRibbonBgColor,
|
|
63
|
-
disabled = _ref.disabled;
|
|
64
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Container, {
|
|
65
|
-
disabled: disabled,
|
|
66
|
-
interactionType: interactionType,
|
|
67
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Img, {
|
|
68
|
-
src: image
|
|
69
|
-
}), (selected !== undefined || setSelected !== undefined) && interactionType == _.InteractionType.Selectable && /*#__PURE__*/(0, _jsxRuntime.jsx)(CheckboxContainer, {
|
|
70
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Checkbox.default, {
|
|
71
|
-
select: function select(selected) {
|
|
72
|
-
return setSelected(selected);
|
|
73
|
-
},
|
|
74
|
-
selected: selected
|
|
75
|
-
})
|
|
76
|
-
}), (tagLabel || tagIcon) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(TagContainer, {
|
|
77
|
-
children: [tagIcon, /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
78
|
-
children: tagLabel
|
|
79
|
-
})]
|
|
80
|
-
}), (highlightRibbonIcon || highlightRibbonText) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(RibbonContainer, {
|
|
81
|
-
$color: highlightRibbonContentColor !== null && highlightRibbonContentColor !== void 0 ? highlightRibbonContentColor : '',
|
|
82
|
-
$backgroundColor: disabled ? _.COLORS.neutral_300 : highlightRibbonBgColor !== null && highlightRibbonBgColor !== void 0 ? highlightRibbonBgColor : '',
|
|
83
|
-
children: [highlightRibbonIcon, highlightRibbonText && /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.ComponentS, {
|
|
84
|
-
color: highlightRibbonContentColor !== null && highlightRibbonContentColor !== void 0 ? highlightRibbonContentColor : '',
|
|
85
|
-
textStyle: _typography.ComponentTextStyle.Regular,
|
|
86
|
-
children: highlightRibbonText
|
|
87
|
-
})]
|
|
88
|
-
})]
|
|
89
|
-
});
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
CardTopSection.propTypes = {
|
|
93
|
-
selected: _propTypes.default.bool.isRequired,
|
|
94
|
-
setSelected: _propTypes.default.func.isRequired,
|
|
95
|
-
tagLabel: _propTypes.default.string,
|
|
96
|
-
tagIcon: _propTypes.default.node,
|
|
97
|
-
highlightRibbonText: _propTypes.default.string,
|
|
98
|
-
highlightRibbonIcon: _propTypes.default.string,
|
|
99
|
-
highlightRibbonContentColor: _propTypes.default.string,
|
|
100
|
-
highlightRibbonBgColor: _propTypes.default.string,
|
|
101
|
-
image: _propTypes.default.string,
|
|
102
|
-
disabled: _propTypes.default.bool.isRequired
|
|
103
|
-
};
|
|
104
|
-
var _default = CardTopSection;
|
|
105
|
-
exports.default = _default;
|
|
106
|
-
//# sourceMappingURL=CardTopSection.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Card/CardTopSection.tsx"],"names":["Img","styled","img","TagContainer","div","COLORS","correct_500","Container","props","disabled","interactionType","InteractionType","Clickable","RibbonContainer","$backgroundColor","$color","CheckboxContainer","white","CardTopSection","selected","setSelected","image","tagLabel","tagIcon","highlightRibbonIcon","highlightRibbonText","highlightRibbonContentColor","highlightRibbonBgColor","undefined","Selectable","neutral_300","ComponentTextStyle","Regular"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;;;;;;;;;AAgBA,IAAMA,GAAG,GAAGC,0BAAOC,GAAV,4IAAT;;AAMA,IAAMC,YAAY,GAAGF,0BAAOG,GAAV,6VACIC,SAAOC,WADX,CAAlB;;AAkBA,IAAMC,SAAS,GAAGN,0BAAOG,GAAV,2PAQX,UAAAI,KAAK;AAAA,SAAIA,KAAK,CAACC,QAAN,yDAGN,EAHE;AAAA,CARM,EAaX,UAAAD,KAAK;AAAA,SACLA,KAAK,CAACE,eAAN,IAAyBC,kBAAgBC,SAAzC,2BAEUJ,KAAK,CAACC,QAAN,GAAiB,aAAjB,GAAiC,SAF3C,aAII,EALC;AAAA,CAbM,CAAf;;AAqBA,IAAMI,eAAe,GAAGZ,0BAAOG,GAAV,8XAEC,UAAAI,KAAK;AAAA,SAAIA,KAAK,CAACM,gBAAV;AAAA,CAFN,EAaR,UAAAN,KAAK;AAAA,SAAIA,KAAK,CAACO,MAAV;AAAA,CAbG,CAArB;;AAkBA,IAAMC,iBAAiB,GAAGf,0BAAOG,GAAV,qMAMCC,SAAOY,KANR,CAAvB;;AAUA,IAAMC,cAA4D,GAAG,SAA/DA,cAA+D,OAY1C;AAAA,MAXzBR,eAWyB,QAXzBA,eAWyB;AAAA,MAVzBS,QAUyB,QAVzBA,QAUyB;AAAA,MATzBC,WASyB,QATzBA,WASyB;AAAA,MARzBC,KAQyB,QARzBA,KAQyB;AAAA,MAPzBC,QAOyB,QAPzBA,QAOyB;AAAA,MANzBC,OAMyB,QANzBA,OAMyB;AAAA,MALzBC,mBAKyB,QALzBA,mBAKyB;AAAA,MAJzBC,mBAIyB,QAJzBA,mBAIyB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O;AACAE,EAAAA,mB;AACAD,EAAAA,mB;AACAE,EAAAA,2B;AACAC,EAAAA,sB;AACAN,EAAAA,K;AACAZ,EAAAA,Q;;eAqHaS,c","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport { ComponentS, ComponentTextStyle } from '../styles/typography';\nimport Checkbox, { StyledCheckBox } from '../InputFields/Checkbox';\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 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`;\n\nconst TagContainer = styled.div`\n background-color: ${COLORS.correct_500};\n color: white;\n border-radius: 2px;\n padding: 4px;\n display: flex;\n position: absolute;\n flex-direction: row;\n align-items: center;\n top: 16px;\n left: 16px;\n\n svg {\n color: white;\n margin-right: 4px;\n }\n`;\n\nconst Container = styled.div<{ interactionType: InteractionType; disabled: boolean }>`\n position: relative;\n width: 100%;\n height: 200px;\n overflow: hidden;\n border-top-right-radius: 8px;\n border-top-left-radius: 8px;\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 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 }\n`;\n\nconst CheckboxContainer = styled.div`\n position: absolute;\n top: 14px;\n right: 14px;\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 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 {tagIcon}\n <div>{tagLabel}</div>\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"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { InteractionType } from '..';
|
|
3
|
-
export interface CardTopSectionProps {
|
|
4
|
-
interactionType: InteractionType;
|
|
5
|
-
selected: boolean;
|
|
6
|
-
setSelected: (arg0: boolean) => void;
|
|
7
|
-
tagLabel?: string;
|
|
8
|
-
tagIcon?: React.ReactNode;
|
|
9
|
-
highlightRibbonText?: string;
|
|
10
|
-
highlightRibbonIcon?: string;
|
|
11
|
-
highlightRibbonContentColor?: string;
|
|
12
|
-
highlightRibbonBgColor?: string;
|
|
13
|
-
image?: string;
|
|
14
|
-
disabled: boolean;
|
|
15
|
-
}
|
|
16
|
-
declare const CardTopSection: React.FunctionComponent<CardTopSectionProps>;
|
|
17
|
-
export default CardTopSection;
|
|
@@ -1,80 +0,0 @@
|
|
|
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 { COLORS, InteractionType } from '..';
|
|
11
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
var Img = styled.img(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n object-fit: cover;\n width: 100%;\n height: 100%;\n"])));
|
|
14
|
-
var TagContainer = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background-color: ", ";\n color: white;\n border-radius: 2px;\n padding: 4px;\n display: flex;\n position: absolute;\n flex-direction: row;\n align-items: center;\n top: 16px;\n left: 16px;\n\n svg {\n color: white;\n margin-right: 4px;\n }\n"])), COLORS.correct_500);
|
|
15
|
-
var Container = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: relative;\n width: 100%;\n height: 200px;\n overflow: hidden;\n border-top-right-radius: 8px;\n border-top-left-radius: 8px;\n\n ", "\n\n ", "\n"])), function (props) {
|
|
16
|
-
return props.disabled ? "\n img, svg {\n filter: grayscale(100%);\n }" : '';
|
|
17
|
-
}, function (props) {
|
|
18
|
-
return props.interactionType == InteractionType.Clickable ? "\n cursor: ".concat(props.disabled ? 'not-allowed' : 'pointer', ";\n ") : '';
|
|
19
|
-
});
|
|
20
|
-
var RibbonContainer = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n 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 }\n"])), function (props) {
|
|
21
|
-
return props.$backgroundColor;
|
|
22
|
-
}, function (props) {
|
|
23
|
-
return props.$color;
|
|
24
|
-
});
|
|
25
|
-
var CheckboxContainer = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n position: absolute;\n top: 14px;\n right: 14px;\n\n .checkbox-icon {\n background-color: ", ";\n }\n"])), COLORS.white);
|
|
26
|
-
|
|
27
|
-
var CardTopSection = function CardTopSection(_ref) {
|
|
28
|
-
var interactionType = _ref.interactionType,
|
|
29
|
-
selected = _ref.selected,
|
|
30
|
-
setSelected = _ref.setSelected,
|
|
31
|
-
image = _ref.image,
|
|
32
|
-
tagLabel = _ref.tagLabel,
|
|
33
|
-
tagIcon = _ref.tagIcon,
|
|
34
|
-
highlightRibbonIcon = _ref.highlightRibbonIcon,
|
|
35
|
-
highlightRibbonText = _ref.highlightRibbonText,
|
|
36
|
-
highlightRibbonContentColor = _ref.highlightRibbonContentColor,
|
|
37
|
-
highlightRibbonBgColor = _ref.highlightRibbonBgColor,
|
|
38
|
-
disabled = _ref.disabled;
|
|
39
|
-
return /*#__PURE__*/_jsxs(Container, {
|
|
40
|
-
disabled: disabled,
|
|
41
|
-
interactionType: interactionType,
|
|
42
|
-
children: [/*#__PURE__*/_jsx(Img, {
|
|
43
|
-
src: image
|
|
44
|
-
}), (selected !== undefined || setSelected !== undefined) && interactionType == InteractionType.Selectable && /*#__PURE__*/_jsx(CheckboxContainer, {
|
|
45
|
-
children: /*#__PURE__*/_jsx(Checkbox, {
|
|
46
|
-
select: function select(selected) {
|
|
47
|
-
return setSelected(selected);
|
|
48
|
-
},
|
|
49
|
-
selected: selected
|
|
50
|
-
})
|
|
51
|
-
}), (tagLabel || tagIcon) && /*#__PURE__*/_jsxs(TagContainer, {
|
|
52
|
-
children: [tagIcon, /*#__PURE__*/_jsx("div", {
|
|
53
|
-
children: tagLabel
|
|
54
|
-
})]
|
|
55
|
-
}), (highlightRibbonIcon || highlightRibbonText) && /*#__PURE__*/_jsxs(RibbonContainer, {
|
|
56
|
-
$color: highlightRibbonContentColor !== null && highlightRibbonContentColor !== void 0 ? highlightRibbonContentColor : '',
|
|
57
|
-
$backgroundColor: disabled ? COLORS.neutral_300 : highlightRibbonBgColor !== null && highlightRibbonBgColor !== void 0 ? highlightRibbonBgColor : '',
|
|
58
|
-
children: [highlightRibbonIcon, highlightRibbonText && /*#__PURE__*/_jsx(ComponentS, {
|
|
59
|
-
color: highlightRibbonContentColor !== null && highlightRibbonContentColor !== void 0 ? highlightRibbonContentColor : '',
|
|
60
|
-
textStyle: ComponentTextStyle.Regular,
|
|
61
|
-
children: highlightRibbonText
|
|
62
|
-
})]
|
|
63
|
-
})]
|
|
64
|
-
});
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
CardTopSection.propTypes = {
|
|
68
|
-
selected: _pt.bool.isRequired,
|
|
69
|
-
setSelected: _pt.func.isRequired,
|
|
70
|
-
tagLabel: _pt.string,
|
|
71
|
-
tagIcon: _pt.node,
|
|
72
|
-
highlightRibbonText: _pt.string,
|
|
73
|
-
highlightRibbonIcon: _pt.string,
|
|
74
|
-
highlightRibbonContentColor: _pt.string,
|
|
75
|
-
highlightRibbonBgColor: _pt.string,
|
|
76
|
-
image: _pt.string,
|
|
77
|
-
disabled: _pt.bool.isRequired
|
|
78
|
-
};
|
|
79
|
-
export default CardTopSection;
|
|
80
|
-
//# sourceMappingURL=CardTopSection.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Card/CardTopSection.tsx"],"names":["React","styled","ComponentS","ComponentTextStyle","Checkbox","COLORS","InteractionType","Img","img","TagContainer","div","correct_500","Container","props","disabled","interactionType","Clickable","RibbonContainer","$backgroundColor","$color","CheckboxContainer","white","CardTopSection","selected","setSelected","image","tagLabel","tagIcon","highlightRibbonIcon","highlightRibbonText","highlightRibbonContentColor","highlightRibbonBgColor","undefined","Selectable","neutral_300","Regular"],"mappings":";;;;;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,SAASC,UAAT,EAAqBC,kBAArB,QAA+C,sBAA/C;AACA,OAAOC,QAAP,MAAyC,yBAAzC;AAEA,SAASC,MAAT,EAAiBC,eAAjB,QAAwC,IAAxC;;;AAgBA,IAAMC,GAAG,GAAGN,MAAM,CAACO,GAAV,8HAAT;AAMA,IAAMC,YAAY,GAAGR,MAAM,CAACS,GAAV,+UACIL,MAAM,CAACM,WADX,CAAlB;AAkBA,IAAMC,SAAS,GAAGX,MAAM,CAACS,GAAV,6OAQX,UAAAG,KAAK;AAAA,SAAIA,KAAK,CAACC,QAAN,yDAGN,EAHE;AAAA,CARM,EAaX,UAAAD,KAAK;AAAA,SACLA,KAAK,CAACE,eAAN,IAAyBT,eAAe,CAACU,SAAzC,2BAEUH,KAAK,CAACC,QAAN,GAAiB,aAAjB,GAAiC,SAF3C,aAII,EALC;AAAA,CAbM,CAAf;AAqBA,IAAMG,eAAe,GAAGhB,MAAM,CAACS,GAAV,gXAEC,UAAAG,KAAK;AAAA,SAAIA,KAAK,CAACK,gBAAV;AAAA,CAFN,EAaR,UAAAL,KAAK;AAAA,SAAIA,KAAK,CAACM,MAAV;AAAA,CAbG,CAArB;AAkBA,IAAMC,iBAAiB,GAAGnB,MAAM,CAACS,GAAV,uLAMCL,MAAM,CAACgB,KANR,CAAvB;;AAUA,IAAMC,cAA4D,GAAG,SAA/DA,cAA+D,OAY1C;AAAA,MAXzBP,eAWyB,QAXzBA,eAWyB;AAAA,MAVzBQ,QAUyB,QAVzBA,QAUyB;AAAA,MATzBC,WASyB,QATzBA,WASyB;AAAA,MARzBC,KAQyB,QARzBA,KAQyB;AAAA,MAPzBC,QAOyB,Q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AAAA,kBACGN;AADH,QAHJ;AAAA,MAdJ;AAAA,IADF;AA0BD,CAvCD;;;AArFEN,EAAAA,Q;AACAC,EAAAA,W;AACAE,EAAAA,Q;AACAC,EAAAA,O;AACAE,EAAAA,mB;AACAD,EAAAA,mB;AACAE,EAAAA,2B;AACAC,EAAAA,sB;AACAN,EAAAA,K;AACAX,EAAAA,Q;;AAqHF,eAAeQ,cAAf","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport { ComponentS, ComponentTextStyle } from '../styles/typography';\nimport Checkbox, { StyledCheckBox } from '../InputFields/Checkbox';\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 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`;\n\nconst TagContainer = styled.div`\n background-color: ${COLORS.correct_500};\n color: white;\n border-radius: 2px;\n padding: 4px;\n display: flex;\n position: absolute;\n flex-direction: row;\n align-items: center;\n top: 16px;\n left: 16px;\n\n svg {\n color: white;\n margin-right: 4px;\n }\n`;\n\nconst Container = styled.div<{ interactionType: InteractionType; disabled: boolean }>`\n position: relative;\n width: 100%;\n height: 200px;\n overflow: hidden;\n border-top-right-radius: 8px;\n border-top-left-radius: 8px;\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 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 }\n`;\n\nconst CheckboxContainer = styled.div`\n position: absolute;\n top: 14px;\n right: 14px;\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 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 {tagIcon}\n <div>{tagLabel}</div>\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"}
|
package/dist/Card/index.cjs
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
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
|
package/dist/Card/index.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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"}
|
package/dist/Card/index.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
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';
|
package/dist/Card/index.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
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
|
package/dist/Card/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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"}
|