@laerdal/life-react-components 1.9.8-dev.1.full → 1.9.8-dev.11

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.
Files changed (101) hide show
  1. package/dist/Accordion/styles.cjs +1 -1
  2. package/dist/Accordion/styles.cjs.map +1 -1
  3. package/dist/Accordion/styles.js +1 -1
  4. package/dist/Accordion/styles.js.map +1 -1
  5. package/dist/Card/HorizontalCard/HorizontalCard.cjs +97 -0
  6. package/dist/Card/HorizontalCard/HorizontalCard.cjs.map +1 -0
  7. package/dist/Card/HorizontalCard/HorizontalCard.d.ts +4 -0
  8. package/dist/Card/HorizontalCard/HorizontalCard.js +74 -0
  9. package/dist/Card/HorizontalCard/HorizontalCard.js.map +1 -0
  10. package/dist/Card/HorizontalCard/HorizontalCardActions.cjs +124 -0
  11. package/dist/Card/HorizontalCard/HorizontalCardActions.cjs.map +1 -0
  12. package/dist/Card/HorizontalCard/HorizontalCardActions.d.ts +5 -0
  13. package/dist/Card/HorizontalCard/HorizontalCardActions.js +98 -0
  14. package/dist/Card/HorizontalCard/HorizontalCardActions.js.map +1 -0
  15. package/dist/Card/HorizontalCard/HorizontalCardBody.cjs +60 -0
  16. package/dist/Card/HorizontalCard/HorizontalCardBody.cjs.map +1 -0
  17. package/dist/Card/HorizontalCard/HorizontalCardBody.d.ts +5 -0
  18. package/dist/Card/HorizontalCard/HorizontalCardBody.js +40 -0
  19. package/dist/Card/HorizontalCard/HorizontalCardBody.js.map +1 -0
  20. package/dist/Card/HorizontalCard/HorizontalCardThumbnail.cjs +49 -0
  21. package/dist/Card/HorizontalCard/HorizontalCardThumbnail.cjs.map +1 -0
  22. package/dist/Card/HorizontalCard/HorizontalCardThumbnail.d.ts +5 -0
  23. package/dist/Card/HorizontalCard/HorizontalCardThumbnail.js +33 -0
  24. package/dist/Card/HorizontalCard/HorizontalCardThumbnail.js.map +1 -0
  25. package/dist/Card/HorizontalCard/index.cjs +33 -0
  26. package/dist/Card/HorizontalCard/index.cjs.map +1 -0
  27. package/dist/Card/HorizontalCard/index.d.ts +2 -0
  28. package/dist/Card/HorizontalCard/index.js +3 -0
  29. package/dist/Card/HorizontalCard/index.js.map +1 -0
  30. package/dist/Card/HorizontalCard/types.cjs +6 -0
  31. package/dist/Card/HorizontalCard/types.cjs.map +1 -0
  32. package/dist/Card/HorizontalCard/types.d.ts +40 -0
  33. package/dist/Card/HorizontalCard/types.js +2 -0
  34. package/dist/Card/HorizontalCard/types.js.map +1 -0
  35. package/dist/Card/{Card.cjs → VerticalCard/Card.cjs} +32 -9
  36. package/dist/Card/VerticalCard/Card.cjs.map +1 -0
  37. package/dist/Card/{Card.d.ts → VerticalCard/Card.d.ts} +2 -1
  38. package/dist/Card/{Card.js → VerticalCard/Card.js} +29 -8
  39. package/dist/Card/VerticalCard/Card.js.map +1 -0
  40. package/dist/Card/{CardBottomSection.cjs → VerticalCard/CardBottomSection.cjs} +40 -25
  41. package/dist/Card/VerticalCard/CardBottomSection.cjs.map +1 -0
  42. package/dist/Card/{CardBottomSection.d.ts → VerticalCard/CardBottomSection.d.ts} +4 -4
  43. package/dist/Card/{CardBottomSection.js → VerticalCard/CardBottomSection.js} +25 -11
  44. package/dist/Card/VerticalCard/CardBottomSection.js.map +1 -0
  45. package/dist/Card/{CardMiddleSection.cjs → VerticalCard/CardMiddleSection.cjs} +13 -13
  46. package/dist/Card/VerticalCard/CardMiddleSection.cjs.map +1 -0
  47. package/dist/Card/{CardMiddleSection.d.ts → VerticalCard/CardMiddleSection.d.ts} +2 -2
  48. package/dist/Card/{CardMiddleSection.js → VerticalCard/CardMiddleSection.js} +2 -2
  49. package/dist/Card/VerticalCard/CardMiddleSection.js.map +1 -0
  50. package/dist/Card/{CardTopSection.cjs → VerticalCard/CardTopSection.cjs} +11 -12
  51. package/dist/Card/VerticalCard/CardTopSection.cjs.map +1 -0
  52. package/dist/Card/{CardTopSection.d.ts → VerticalCard/CardTopSection.d.ts} +5 -5
  53. package/dist/Card/{CardTopSection.js → VerticalCard/CardTopSection.js} +9 -10
  54. package/dist/Card/VerticalCard/CardTopSection.js.map +1 -0
  55. package/dist/Card/VerticalCard/index.cjs +88 -0
  56. package/dist/Card/VerticalCard/index.cjs.map +1 -0
  57. package/dist/Card/VerticalCard/index.d.ts +7 -0
  58. package/dist/Card/VerticalCard/index.js +8 -0
  59. package/dist/Card/VerticalCard/index.js.map +1 -0
  60. package/dist/Card/index.cjs +8 -64
  61. package/dist/Card/index.cjs.map +1 -1
  62. package/dist/Card/index.d.ts +2 -7
  63. package/dist/Card/index.js +2 -7
  64. package/dist/Card/index.js.map +1 -1
  65. package/dist/Dropdown/DropdownButton.cjs +3 -3
  66. package/dist/Dropdown/DropdownButton.cjs.map +1 -1
  67. package/dist/Dropdown/DropdownButton.d.ts +5 -1
  68. package/dist/Dropdown/DropdownButton.js +3 -4
  69. package/dist/Dropdown/DropdownButton.js.map +1 -1
  70. package/dist/InputFields/NumberField.cjs +139 -63
  71. package/dist/InputFields/NumberField.cjs.map +1 -1
  72. package/dist/InputFields/NumberField.d.ts +4 -1
  73. package/dist/InputFields/NumberField.js +138 -63
  74. package/dist/InputFields/NumberField.js.map +1 -1
  75. package/dist/List/ListRow.cjs +24 -3
  76. package/dist/List/ListRow.cjs.map +1 -1
  77. package/dist/List/ListRow.d.ts +3 -0
  78. package/dist/List/ListRow.js +22 -3
  79. package/dist/List/ListRow.js.map +1 -1
  80. package/dist/MenuItem/MenuItem.cjs +1 -1
  81. package/dist/MenuItem/MenuItem.cjs.map +1 -1
  82. package/dist/MenuItem/MenuItem.js +1 -1
  83. package/dist/MenuItem/MenuItem.js.map +1 -1
  84. package/dist/Toggles/ToggleButton.cjs +3 -2
  85. package/dist/Toggles/ToggleButton.cjs.map +1 -1
  86. package/dist/Toggles/ToggleButton.d.ts +1 -1
  87. package/dist/Toggles/ToggleButton.js +3 -2
  88. package/dist/Toggles/ToggleButton.js.map +1 -1
  89. package/dist/common/ActionWithin.cjs.map +1 -1
  90. package/dist/common/ActionWithin.js.map +1 -1
  91. package/dist/index.cjs.map +1 -1
  92. package/dist/index.js.map +1 -1
  93. package/package.json +1 -1
  94. package/dist/Card/Card.cjs.map +0 -1
  95. package/dist/Card/Card.js.map +0 -1
  96. package/dist/Card/CardBottomSection.cjs.map +0 -1
  97. package/dist/Card/CardBottomSection.js.map +0 -1
  98. package/dist/Card/CardMiddleSection.cjs.map +0 -1
  99. package/dist/Card/CardMiddleSection.js.map +0 -1
  100. package/dist/Card/CardTopSection.cjs.map +0 -1
  101. package/dist/Card/CardTopSection.js.map +0 -1
@@ -9,6 +9,8 @@ Object.defineProperty(exports, "__esModule", {
9
9
  });
10
10
  exports.default = exports.CardProgressContainer = exports.CardNotesContainer = exports.CardNoteRight = exports.CardNoteLeft = exports.CardButtonRowContainer = exports.CardBottomSectionContainer = exports.CardBottomDivider = exports.CardAuthorContainer = void 0;
11
11
 
12
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
+
12
14
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
13
15
 
14
16
  var _propTypes = _interopRequireDefault(require("prop-types"));
@@ -17,9 +19,9 @@ var React = _interopRequireWildcard(require("react"));
17
19
 
18
20
  var _styledComponents = _interopRequireDefault(require("styled-components"));
19
21
 
20
- var _ = require("..");
22
+ var _index = require("../../index");
21
23
 
22
- var _Button = require("../Button");
24
+ var _Button = require("../../Button");
23
25
 
24
26
  var _jsxRuntime = require("react/jsx-runtime");
25
27
 
@@ -33,17 +35,17 @@ var CardProgressContainer = _styledComponents.default.div(_templateObject || (_t
33
35
 
34
36
  exports.CardProgressContainer = CardProgressContainer;
35
37
 
36
- var CardNotesContainer = _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"])), _.COLORS.neutral_500);
38
+ var CardNotesContainer = _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);
37
39
 
38
40
  exports.CardNotesContainer = CardNotesContainer;
39
41
 
40
42
  var CardAuthorContainer = _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) {
41
- return props.disabled ? "\n color: ".concat(_.COLORS.neutral_300, ";\n svg, img {\n filter: grayscale(100%);\n }\n \n ") : '';
43
+ return props.disabled ? "\n color: ".concat(_index.COLORS.neutral_300, ";\n svg, img {\n filter: grayscale(100%);\n }\n \n ") : '';
42
44
  });
43
45
 
44
46
  exports.CardAuthorContainer = CardAuthorContainer;
45
47
 
46
- var CardBottomDivider = _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"])), _.COLORS.neutral_100);
48
+ var CardBottomDivider = _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);
47
49
 
48
50
  exports.CardBottomDivider = CardBottomDivider;
49
51
 
@@ -55,19 +57,18 @@ var CardNoteRight = _styledComponents.default.div(_templateObject6 || (_template
55
57
 
56
58
  exports.CardNoteRight = CardNoteRight;
57
59
 
58
- var CardButtonRowContainer = _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"])), _.COLORS.neutral_100, _.COLORS.neutral_600);
60
+ var CardButtonRowContainer = _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);
59
61
 
60
62
  exports.CardButtonRowContainer = CardButtonRowContainer;
61
63
 
62
64
  var CardBottomSectionContainer = _styledComponents.default.div(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n padding: 0px 16px 8px 16px;\n width: calc(100% - 32px);\n"])));
63
65
 
64
66
  exports.CardBottomSectionContainer = CardBottomSectionContainer;
65
-
66
- var CardBottomSection = function CardBottomSection(_ref) {
67
+ var CardBottomSection = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
67
68
  var progressLevel = _ref.progressLevel,
68
69
  progressMax = _ref.progressMax,
69
70
  _ref$progressType = _ref.progressType,
70
- progressType = _ref$progressType === void 0 ? _.LinearProgressType.Line : _ref$progressType,
71
+ progressType = _ref$progressType === void 0 ? _index.LinearProgressType.Line : _ref$progressType,
71
72
  noteLeft = _ref.noteLeft,
72
73
  noteLeftIcon = _ref.noteLeftIcon,
73
74
  noteRight = _ref.noteRight,
@@ -76,52 +77,66 @@ var CardBottomSection = function CardBottomSection(_ref) {
76
77
  logo = _ref.logo,
77
78
  actions = _ref.actions,
78
79
  disabled = _ref.disabled;
80
+
81
+ var _React$useState = React.useState([]),
82
+ _React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
83
+ elRefs = _React$useState2[0],
84
+ setElRefs = _React$useState2[1];
85
+
86
+ var length = (actions === null || actions === void 0 ? void 0 : actions.length) || 0;
87
+ React.useEffect(function () {
88
+ setElRefs(Array(length || 0).fill(null).map(function () {
89
+ return /*#__PURE__*/React.createRef();
90
+ }));
91
+ }, [length]);
92
+ React.useImperativeHandle(ref, function () {
93
+ return elRefs;
94
+ }, [elRefs]);
79
95
  var haveAtLeastSomething = progressLevel != undefined || noteLeft || noteLeftIcon || noteRight || noteRightIcon || authorName;
80
96
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(CardBottomSectionContainer, {
81
97
  children: [haveAtLeastSomething && /*#__PURE__*/(0, _jsxRuntime.jsx)(CardBottomDivider, {}), progressLevel != undefined && /*#__PURE__*/(0, _jsxRuntime.jsx)(CardProgressContainer, {
82
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_.LinearProgress, {
83
- size: _.Size.Small,
98
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.LinearProgress, {
99
+ size: _index.Size.Small,
84
100
  type: progressType,
85
- variant: _.LinearProgressVariant.Normal,
101
+ variant: _index.LinearProgressVariant.Normal,
86
102
  value: progressLevel,
87
103
  max: progressMax !== null && progressMax !== void 0 ? progressMax : progressLevel
88
104
  })
89
105
  }), (noteLeft || noteLeftIcon || noteRight || noteRightIcon) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(CardNotesContainer, {
90
106
  children: [(noteLeft || noteLeftIcon) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(CardNoteLeft, {
91
- children: [noteLeftIcon, /*#__PURE__*/(0, _jsxRuntime.jsx)(_.ComponentXXS, {
92
- color: _.COLORS.neutral_500,
93
- textStyle: _.ComponentTextStyle.Bold,
107
+ children: [noteLeftIcon, /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ComponentXXS, {
108
+ color: _index.COLORS.neutral_500,
109
+ textStyle: _index.ComponentTextStyle.Bold,
94
110
  children: noteLeft
95
111
  })]
96
112
  }), (noteRight || noteRightIcon) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(CardNoteRight, {
97
- children: [noteRightIcon, /*#__PURE__*/(0, _jsxRuntime.jsx)(_.ComponentXXS, {
98
- color: _.COLORS.neutral_500,
99
- textStyle: _.ComponentTextStyle.Bold,
113
+ children: [noteRightIcon, /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ComponentXXS, {
114
+ color: _index.COLORS.neutral_500,
115
+ textStyle: _index.ComponentTextStyle.Bold,
100
116
  children: noteRight
101
117
  })]
102
118
  })]
103
119
  }), (authorName || logo) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(CardAuthorContainer, {
104
120
  disabled: disabled,
105
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.ComponentXXS, {
121
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ComponentXXS, {
106
122
  children: authorName
107
123
  }), logo]
108
124
  }), actions && /*#__PURE__*/(0, _jsxRuntime.jsx)(CardButtonRowContainer, {
109
- children: actions.map(function (x) {
125
+ children: actions.map(function (x, index) {
110
126
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.IconButton, {
127
+ ref: elRefs[index],
111
128
  disabled: disabled,
112
129
  variant: "secondary",
113
130
  shape: "circular",
114
131
  action: function action(e) {
115
- e === null || e === void 0 ? void 0 : e.stopPropagation();
116
132
  x.onClick();
117
133
  },
118
134
  children: x.icon
119
- });
135
+ }, index);
120
136
  })
121
137
  })]
122
138
  });
123
- };
124
-
139
+ });
125
140
  CardBottomSection.propTypes = {
126
141
  progressLevel: _propTypes.default.number,
127
142
  progressMax: _propTypes.default.number,
@@ -135,7 +150,7 @@ CardBottomSection.propTypes = {
135
150
  onClick: _propTypes.default.func.isRequired
136
151
  })),
137
152
  logo: _propTypes.default.node,
138
- disabled: _propTypes.default.bool.isRequired
153
+ disabled: _propTypes.default.bool
139
154
  };
140
155
  var _default = CardBottomSection;
141
156
  exports.default = _default;
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/Card/VerticalCard/CardBottomSection.tsx"],"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"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AASA;;;;;;;;;;AAuBO,IAAMA,qBAAqB,GAAGC,0BAAOC,GAAV,wGAA3B;;;;AAIA,IAAMC,kBAAkB,GAAGF,0BAAOC,GAAV,kNAGpBE,cAAOC,WAHa,CAAxB;;;;AASA,IAAMC,mBAAmB,GAAGL,0BAAOC,GAAV,mTAgB5B,UAAAK,KAAK;AAAA,SAAIA,KAAK,CAACC,QAAN,0BACAJ,cAAOK,WADP,0EAMP,EANG;AAAA,CAhBuB,CAAzB;;;;AAyBA,IAAMC,iBAAiB,GAAGT,0BAAOC,GAAV,mLAERE,cAAOO,WAFC,CAAvB;;;;AAOA,IAAMC,YAAY,GAAGX,0BAAOC,GAAV,8QAAlB;;;;AAcA,IAAMW,aAAa,GAAGZ,0BAAOC,GAAV,+QAAnB;;;;AAcA,IAAMY,sBAAsB,GAAGb,0BAAOC,GAAV,maAMbE,cAAOO,WANM,EAkBtBP,cAAOW,WAlBe,CAA5B;;;;AAsBA,IAAMC,0BAA0B,GAAGf,0BAAOC,GAAV,mJAAhC;;;AAKP,IAAMe,iBAAiB,gBAAGC,KAAK,CAACC,UAAN,CAAiB,gBAaCC,GAbD,EAa0D;AAAA,MAZvDC,aAYuD,QAZvDA,aAYuD;AAAA,MAXvDC,WAWuD,Q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IY,UAAA,KAAK,EAAC,UAJlB;AAKY,UAAA,MAAM,EAAE,gBAAC6C,CAAD,EAAO;AACbF,YAAAA,CAAC,CAACG,OAAF;AACD,WAPb;AAAA,oBAQGH,CAAC,CAACI;AARL,WACiBH,KADjB,CADW;AAAA,OAAZ;AADS,MA9Bd;AAAA,IADF;AA+CD,CA1EyB,CAA1B;;AAnHE/B,EAAAA,a;AACAC,EAAAA,W;AAGAI,EAAAA,Q;AACAC,EAAAA,Y;AACAC,EAAAA,S;AACAC,EAAAA,a;AAEAC,EAAAA,U;AACAE,EAAAA,O;AAfAuB,IAAAA,I;AACAD,IAAAA,O;;AAeAvB,EAAAA,I;AACAvB,EAAAA,Q;;eAmLaS,iB","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>\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}>\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"],"file":"CardBottomSection.cjs"}
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { LinearProgressType } from '..';
2
+ import { LinearProgressType } from '../../index';
3
3
  export interface ActionItem {
4
4
  icon: React.ReactNode;
5
5
  onClick: () => void;
@@ -15,17 +15,17 @@ export interface CardBottomSectionProps {
15
15
  authorName?: string;
16
16
  actions?: ActionItem[];
17
17
  logo?: React.ReactNode;
18
- disabled: boolean;
18
+ disabled?: boolean;
19
19
  }
20
20
  export declare const CardProgressContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
21
21
  export declare const CardNotesContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
22
22
  export declare const CardAuthorContainer: import("styled-components").StyledComponent<"div", any, {
23
- disabled: boolean;
23
+ disabled?: boolean | undefined;
24
24
  }, never>;
25
25
  export declare const CardBottomDivider: import("styled-components").StyledComponent<"div", any, {}, never>;
26
26
  export declare const CardNoteLeft: import("styled-components").StyledComponent<"div", any, {}, never>;
27
27
  export declare const CardNoteRight: import("styled-components").StyledComponent<"div", any, {}, never>;
28
28
  export declare const CardButtonRowContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
29
29
  export declare const CardBottomSectionContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
30
- declare const CardBottomSection: React.FunctionComponent<CardBottomSectionProps>;
30
+ declare const CardBottomSection: React.ForwardRefExoticComponent<CardBottomSectionProps & React.RefAttributes<React.RefObject<HTMLButtonElement>[]>>;
31
31
  export default CardBottomSection;
@@ -1,3 +1,4 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
1
2
  import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
2
3
  import _pt from "prop-types";
3
4
 
@@ -5,8 +6,8 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _temp
5
6
 
6
7
  import * as React from 'react';
7
8
  import styled from 'styled-components';
8
- import { COLORS, ComponentTextStyle, ComponentXXS, LinearProgress, LinearProgressType, LinearProgressVariant, Size } from '..';
9
- import { IconButton } from '../Button';
9
+ import { COLORS, ComponentTextStyle, ComponentXXS, LinearProgress, LinearProgressType, LinearProgressVariant, Size } from '../../index';
10
+ import { IconButton } from '../../Button';
10
11
  import { jsx as _jsx } from "react/jsx-runtime";
11
12
  import { jsxs as _jsxs } from "react/jsx-runtime";
12
13
  export var CardProgressContainer = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: 8px 0;\n"])));
@@ -17,10 +18,9 @@ export var CardAuthorContainer = styled.div(_templateObject3 || (_templateObject
17
18
  export var CardBottomDivider = 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);
18
19
  export var CardNoteLeft = 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"])));
19
20
  export var CardNoteRight = 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"])));
20
- export var CardButtonRowContainer = 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);
21
+ export var CardButtonRowContainer = 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);
21
22
  export var CardBottomSectionContainer = styled.div(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n padding: 0px 16px 8px 16px;\n width: calc(100% - 32px);\n"])));
22
-
23
- var CardBottomSection = function CardBottomSection(_ref) {
23
+ var CardBottomSection = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
24
24
  var progressLevel = _ref.progressLevel,
25
25
  progressMax = _ref.progressMax,
26
26
  _ref$progressType = _ref.progressType,
@@ -33,6 +33,21 @@ var CardBottomSection = function CardBottomSection(_ref) {
33
33
  logo = _ref.logo,
34
34
  actions = _ref.actions,
35
35
  disabled = _ref.disabled;
36
+
37
+ var _React$useState = React.useState([]),
38
+ _React$useState2 = _slicedToArray(_React$useState, 2),
39
+ elRefs = _React$useState2[0],
40
+ setElRefs = _React$useState2[1];
41
+
42
+ var length = (actions === null || actions === void 0 ? void 0 : actions.length) || 0;
43
+ React.useEffect(function () {
44
+ setElRefs(Array(length || 0).fill(null).map(function () {
45
+ return /*#__PURE__*/React.createRef();
46
+ }));
47
+ }, [length]);
48
+ React.useImperativeHandle(ref, function () {
49
+ return elRefs;
50
+ }, [elRefs]);
36
51
  var haveAtLeastSomething = progressLevel != undefined || noteLeft || noteLeftIcon || noteRight || noteRightIcon || authorName;
37
52
  return /*#__PURE__*/_jsxs(CardBottomSectionContainer, {
38
53
  children: [haveAtLeastSomething && /*#__PURE__*/_jsx(CardBottomDivider, {}), progressLevel != undefined && /*#__PURE__*/_jsx(CardProgressContainer, {
@@ -63,22 +78,21 @@ var CardBottomSection = function CardBottomSection(_ref) {
63
78
  children: authorName
64
79
  }), logo]
65
80
  }), actions && /*#__PURE__*/_jsx(CardButtonRowContainer, {
66
- children: actions.map(function (x) {
81
+ children: actions.map(function (x, index) {
67
82
  return /*#__PURE__*/_jsx(IconButton, {
83
+ ref: elRefs[index],
68
84
  disabled: disabled,
69
85
  variant: "secondary",
70
86
  shape: "circular",
71
87
  action: function action(e) {
72
- e === null || e === void 0 ? void 0 : e.stopPropagation();
73
88
  x.onClick();
74
89
  },
75
90
  children: x.icon
76
- });
91
+ }, index);
77
92
  })
78
93
  })]
79
94
  });
80
- };
81
-
95
+ });
82
96
  CardBottomSection.propTypes = {
83
97
  progressLevel: _pt.number,
84
98
  progressMax: _pt.number,
@@ -92,7 +106,7 @@ CardBottomSection.propTypes = {
92
106
  onClick: _pt.func.isRequired
93
107
  })),
94
108
  logo: _pt.node,
95
- disabled: _pt.bool.isRequired
109
+ disabled: _pt.bool
96
110
  };
97
111
  export default CardBottomSection;
98
112
  //# sourceMappingURL=CardBottomSection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/Card/VerticalCard/CardBottomSection.tsx"],"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"],"mappings":";;;;;;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,SACEC,MADF,EAEEC,kBAFF,EAGEC,YAHF,EAIEC,cAJF,EAKEC,kBALF,EAMEC,qBANF,EAOEC,IAPF,QAQO,aARP;AASA,SAAQC,UAAR,QAAyB,cAAzB;;;AAuBA,OAAO,IAAMC,qBAAqB,GAAGT,MAAM,CAACU,GAAV,0FAA3B;AAIP,OAAO,IAAMC,kBAAkB,GAAGX,MAAM,CAACU,GAAV,oMAGpBT,MAAM,CAACW,WAHa,CAAxB;AASP,OAAO,IAAMC,mBAAmB,GAAGb,MAAM,CAACU,GAAV,qSAgB5B,UAAAI,KAAK;AAAA,SAAIA,KAAK,CAACC,QAAN,0BACAd,MAAM,CAACe,WADP,0EAMP,EANG;AAAA,CAhBuB,CAAzB;AAyBP,OAAO,IAAMC,iBAAiB,GAAGjB,MAAM,CAACU,GAAV,qKAERT,MAAM,CAACiB,WAFC,CAAvB;AAOP,OAAO,IAAMC,YAAY,GAAGnB,MAAM,CAACU,GAAV,gQAAlB;AAcP,OAAO,IAAMU,aAAa,GAAGpB,MAAM,CAACU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AAAqB,MAAA,QAAQ,EAAErB,QAA/B;AAAA,8BACvB,KAAC,YAAD;AAAA,kBAAeoB;AAAf,QADuB,EAEtBC,IAFsB;AAAA,MAzB3B,EA8BGC,OAAO,iBAAI,KAAC,sBAAD;AAAA,gBACTA,OAAO,CAACQ,GAAR,CAAY,UAACQ,CAAD,EAAIC,KAAJ;AAAA,4BACX,KAAC,UAAD;AAAY,UAAA,GAAG,EAAEf,MAAM,CAACe,KAAD,CAAvB;AAEY,UAAA,QAAQ,EAAEvC,QAFtB;AAGY,UAAA,OAAO,EAAC,WAHpB;AAIY,UAAA,KAAK,EAAC,UAJlB;AAKY,UAAA,MAAM,EAAE,gBAACwC,CAAD,EAAO;AACbF,YAAAA,CAAC,CAACG,OAAF;AACD,WAPb;AAAA,oBAQGH,CAAC,CAACI;AARL,WACiBH,KADjB,CADW;AAAA,OAAZ;AADS,MA9Bd;AAAA,IADF;AA+CD,CA1EyB,CAA1B;;AAnHE3B,EAAAA,a;AACAC,EAAAA,W;AAGAG,EAAAA,Q;AACAC,EAAAA,Y;AACAC,EAAAA,S;AACAC,EAAAA,a;AAEAC,EAAAA,U;AACAE,EAAAA,O;AAfAoB,IAAAA,I;AACAD,IAAAA,O;;AAeApB,EAAAA,I;AACArB,EAAAA,Q;;AAmLF,eAAeS,iBAAf","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>\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}>\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"],"file":"CardBottomSection.js"}
@@ -17,7 +17,7 @@ var React = _interopRequireWildcard(require("react"));
17
17
 
18
18
  var _styledComponents = _interopRequireDefault(require("styled-components"));
19
19
 
20
- var _ = require("..");
20
+ var _index = require("../../index");
21
21
 
22
22
  var _jsxRuntime = require("react/jsx-runtime");
23
23
 
@@ -41,7 +41,7 @@ var CardTagsContainer = _styledComponents.default.div(_templateObject3 || (_temp
41
41
 
42
42
  exports.CardTagsContainer = CardTagsContainer;
43
43
 
44
- var CardCategoryContainer = _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);
44
+ var CardCategoryContainer = _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);
45
45
 
46
46
  exports.CardCategoryContainer = CardCategoryContainer;
47
47
 
@@ -60,25 +60,25 @@ var CardMiddleSection = function CardMiddleSection(_ref) {
60
60
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(CardCategoryContainer, {
61
61
  extraTopMargin: Boolean(colorBandColor),
62
62
  bottomMargin: Boolean(categoryIcon || categoryLabel),
63
- children: [categoryIcon, /*#__PURE__*/(0, _jsxRuntime.jsx)(_.ComponentS, {
64
- textStyle: _.ComponentTextStyle.Bold,
65
- color: _.COLORS.neutral_500,
63
+ children: [categoryIcon, /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ComponentS, {
64
+ textStyle: _index.ComponentTextStyle.Bold,
65
+ color: _index.COLORS.neutral_500,
66
66
  children: categoryLabel
67
67
  })]
68
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.ComponentXL, {
68
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ComponentXL, {
69
69
  className: "titleBlock",
70
- textStyle: _.ComponentTextStyle.Bold,
71
- color: disabled ? _.COLORS.neutral_500 : _.COLORS.black,
70
+ textStyle: _index.ComponentTextStyle.Bold,
71
+ color: disabled ? _index.COLORS.neutral_500 : _index.COLORS.black,
72
72
  children: title
73
- }), description && /*#__PURE__*/(0, _jsxRuntime.jsx)(_.ComponentS, {
73
+ }), description && /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ComponentS, {
74
74
  className: "descriptionBlock",
75
- color: _.COLORS.neutral_600,
75
+ color: _index.COLORS.neutral_600,
76
76
  children: description
77
77
  }), tags && /*#__PURE__*/(0, _jsxRuntime.jsx)(CardTagsContainer, {
78
78
  children: tags.map(function (x, index) {
79
79
  var _x$variant;
80
80
 
81
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Tag, {
81
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Tag, {
82
82
  label: x.label,
83
83
  variant: (_x$variant = x.variant) !== null && _x$variant !== void 0 ? _x$variant : 'neutral'
84
84
  }, "".concat(x.label, "_").concat(index));
@@ -87,7 +87,7 @@ var CardMiddleSection = function CardMiddleSection(_ref) {
87
87
  children: row2Tags.map(function (x, index) {
88
88
  var _x$variant2;
89
89
 
90
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Tag, {
90
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Tag, {
91
91
  label: x.label,
92
92
  variant: (_x$variant2 = x.variant) !== null && _x$variant2 !== void 0 ? _x$variant2 : 'neutral'
93
93
  }, "".concat(x.label, "_").concat(index));
@@ -108,7 +108,7 @@ CardMiddleSection.propTypes = {
108
108
  row2Tags: _propTypes.default.arrayOf(_propTypes.default.shape({
109
109
  label: _propTypes.default.string.isRequired
110
110
  })),
111
- disabled: _propTypes.default.bool.isRequired
111
+ disabled: _propTypes.default.bool
112
112
  };
113
113
  var _default = CardMiddleSection;
114
114
  exports.default = _default;
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/Card/VerticalCard/CardMiddleSection.tsx"],"names":["CardMiddleSectionContainer","styled","div","CardColorBand","props","$color","CardTagsContainer","CardCategoryContainer","COLORS","neutral_500","CardMiddleSection","colorBandColor","categoryIcon","categoryLabel","title","description","tags","row2Tags","disabled","Boolean","ComponentTextStyle","Bold","black","neutral_600","map","x","index","label","variant"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;;;;;;;;;AAkBO,IAAMA,0BAA0B,GAAGC,0BAAOC,GAAV,sUAAhC;;;;AAkBA,IAAMC,aAAa,GAAGF,0BAAOC,GAAV,qMAMJ,UAACE,KAAD;AAAA,SAAWA,KAAK,CAACC,MAAjB;AAAA,CANI,CAAnB;;;;AASA,IAAMC,iBAAiB,GAAGL,0BAAOC,GAAV,qLAAvB;;;;AAQA,IAAMK,qBAAqB,GAAGN,0BAAOC,GAAV,mQAQrBM,cAAOC,WARc,CAA3B;;;;AAcP,IAAMC,iBAAkE,GAAG,SAArEA,iBAAqE,OAS7C;AAAA,MAR5BC,cAQ4B,QAR5BA,cAQ4B;AAAA,MAP5BC,YAO4B,QAP5BA,YAO4B;AAAA,MAN5BC,aAM4B,QAN5BA,aAM4B;AAAA,MAL5BC,KAK4B,QAL5BA,KAK4B;AAAA,MAJ5BC,WAI4B,QAJ5BA,WAI4B;AAAA,MAH5BC,IAG4B,QAH5BA,IAG4B;AAAA,MAF5BC,QAE4B,QAF5BA,QAE4B;AAAA,MAD5BC,QAC4B,QAD5BA,QAC4B;AAC5B,sBACE,sBAAC,0BAAD;AAAA,eACGP,cAAc,iBAAI,qBAAC,aAAD;AAAe,MAAA,MAAM,EAAEA;AAAvB,MADrB,eAEE,sBAAC,qBAAD;AAAuB,MAAA,cAAc,EAAEQ,OAAO,CAACR,cAAD,CAA9C;AAAgE,MAAA,YAAY,EAAEQ,OAAO,CAACP,YAAY,IAAIC,aAAjB,CAArF;AAAA,iBACGD,YADH,eAEE,qBAAC,iBAAD;AAAY,QAAA,SAAS,EAAEQ,0BAAmBC,IAA1C;AAAgD,QAAA,KAAK,EAAEb,cAA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port 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 CardColorBand = 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 CardTagsContainer = styled.div`\n display: flex;\n flex-direction: row;\n padding: 4px 0;\n gap: 4px;\n flex-wrap: wrap;\n`;\n\nexport const CardCategoryContainer = 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>\n {colorBandColor && <CardColorBand $color={colorBandColor} />}\n <CardCategoryContainer extraTopMargin={Boolean(colorBandColor)} bottomMargin={Boolean(categoryIcon || categoryLabel)}>\n {categoryIcon}\n <ComponentS textStyle={ComponentTextStyle.Bold} color={COLORS.neutral_500}>\n {categoryLabel}\n </ComponentS>\n </CardCategoryContainer>\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 <CardTagsContainer>\n {tags.map((x, index) => (\n <Tag key={`${x.label}_${index}`} label={x.label} variant={x.variant ?? 'neutral'} />\n ))}\n </CardTagsContainer>\n )}\n {row2Tags && (\n <CardTagsContainer>\n {row2Tags.map((x, index) => (\n <Tag key={`${x.label}_${index}`} label={x.label} variant={x.variant ?? 'neutral'} />\n ))}\n </CardTagsContainer>\n )}\n </CardMiddleSectionContainer>\n );\n};\n\nexport default CardMiddleSection;\n"],"file":"CardMiddleSection.cjs"}
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { TagVariants } from '..';
2
+ import { TagVariants } from '../../index';
3
3
  export interface CardMiddleSectionProps {
4
4
  colorBandColor?: string;
5
5
  categoryIcon?: React.ReactNode;
@@ -8,7 +8,7 @@ export interface CardMiddleSectionProps {
8
8
  description?: string;
9
9
  tags?: CardTag[];
10
10
  row2Tags?: CardTag[];
11
- disabled: boolean;
11
+ disabled?: boolean;
12
12
  }
13
13
  export interface CardTag {
14
14
  label: string;
@@ -5,7 +5,7 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4;
5
5
 
6
6
  import * as React from 'react';
7
7
  import styled from 'styled-components';
8
- import { COLORS, ComponentS, ComponentTextStyle, ComponentXL, Tag } from '..';
8
+ import { COLORS, ComponentS, ComponentTextStyle, ComponentXL, Tag } from '../../index';
9
9
  import { jsx as _jsx } from "react/jsx-runtime";
10
10
  import { jsxs as _jsxs } from "react/jsx-runtime";
11
11
  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"])));
@@ -78,7 +78,7 @@ CardMiddleSection.propTypes = {
78
78
  row2Tags: _pt.arrayOf(_pt.shape({
79
79
  label: _pt.string.isRequired
80
80
  })),
81
- disabled: _pt.bool.isRequired
81
+ disabled: _pt.bool
82
82
  };
83
83
  export default CardMiddleSection;
84
84
  //# sourceMappingURL=CardMiddleSection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/Card/VerticalCard/CardMiddleSection.tsx"],"names":["React","styled","COLORS","ComponentS","ComponentTextStyle","ComponentXL","Tag","CardMiddleSectionContainer","div","CardColorBand","props","$color","CardTagsContainer","CardCategoryContainer","neutral_500","CardMiddleSection","colorBandColor","categoryIcon","categoryLabel","title","description","tags","row2Tags","disabled","Boolean","Bold","black","neutral_600","map","x","index","label","variant"],"mappings":";;;;;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,SAASC,MAAT,EAAiBC,UAAjB,EAA6BC,kBAA7B,EAAiDC,WAAjD,EAA8DC,GAA9D,QAAsF,aAAtF;;;AAkBA,OAAO,IAAMC,0BAA0B,GAAGN,MAAM,CAACO,GAAV,wTAAhC;AAkBP,OAAO,IAAMC,aAAa,GAAGR,MAAM,CAACO,GAAV,uLAMJ,UAACE,KAAD;AAAA,SAAWA,KAAK,CAACC,MAAjB;AAAA,CANI,CAAnB;AASP,OAAO,IAAMC,iBAAiB,GAAGX,MAAM,CAACO,GAAV,uKAAvB;AAQP,OAAO,IAAMK,qBAAqB,GAAGZ,MAAM,CAACO,GAAV,qPAQrBN,MAAM,CAACY,WARc,CAA3B;;AAcP,IAAMC,iBAAkE,GAAG,SAArEA,iBAAqE,OAS7C;AAAA,MAR5BC,cAQ4B,QAR5BA,cAQ4B;AAAA,MAP5BC,YAO4B,QAP5BA,YAO4B;AAAA,MAN5BC,aAM4B,QAN5BA,aAM4B;AAAA,MAL5BC,KAK4B,QAL5BA,KAK4B;AAAA,MAJ5BC,WAI4B,QAJ5BA,WAI4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,CAACM,GAAT,CAAa,UAACC,CAAD,EAAIC,KAAJ;AAAA;;AAAA,4BACZ,KAAC,GAAD;AAAiC,UAAA,KAAK,EAAED,CAAC,CAACE,KAA1C;AAAiD,UAAA,OAAO,iBAAEF,CAAC,CAACG,OAAJ,qDAAe;AAAvE,qBAAaH,CAAC,CAACE,KAAf,cAAwBD,KAAxB,EADY;AAAA,OAAb;AADH,MAxBJ;AAAA,IADF;AAiCD,CA3CD;;;AAhEEd,EAAAA,c;AACAC,EAAAA,Y;AACAC,EAAAA,a;AACAC,EAAAA,K;AACAC,EAAAA,W;AACAC,EAAAA,I;AAMAU,IAAAA,K;;AALAT,EAAAA,Q;AAKAS,IAAAA,K;;AAJAR,EAAAA,Q;;AAsGF,eAAeR,iBAAf","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 CardColorBand = 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 CardTagsContainer = styled.div`\n display: flex;\n flex-direction: row;\n padding: 4px 0;\n gap: 4px;\n flex-wrap: wrap;\n`;\n\nexport const CardCategoryContainer = 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>\n {colorBandColor && <CardColorBand $color={colorBandColor} />}\n <CardCategoryContainer extraTopMargin={Boolean(colorBandColor)} bottomMargin={Boolean(categoryIcon || categoryLabel)}>\n {categoryIcon}\n <ComponentS textStyle={ComponentTextStyle.Bold} color={COLORS.neutral_500}>\n {categoryLabel}\n </ComponentS>\n </CardCategoryContainer>\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 <CardTagsContainer>\n {tags.map((x, index) => (\n <Tag key={`${x.label}_${index}`} label={x.label} variant={x.variant ?? 'neutral'} />\n ))}\n </CardTagsContainer>\n )}\n {row2Tags && (\n <CardTagsContainer>\n {row2Tags.map((x, index) => (\n <Tag key={`${x.label}_${index}`} label={x.label} variant={x.variant ?? 'neutral'} />\n ))}\n </CardTagsContainer>\n )}\n </CardMiddleSectionContainer>\n );\n};\n\nexport default CardMiddleSection;\n"],"file":"CardMiddleSection.js"}
@@ -17,13 +17,13 @@ var React = _interopRequireWildcard(require("react"));
17
17
 
18
18
  var _styledComponents = _interopRequireDefault(require("styled-components"));
19
19
 
20
- var _typography = require("../styles/typography");
20
+ var _typography = require("../../styles/typography");
21
21
 
22
- var _Checkbox = _interopRequireDefault(require("../InputFields/Checkbox"));
22
+ var _Checkbox = _interopRequireDefault(require("../../InputFields/Checkbox"));
23
23
 
24
- var _Tag = require("../Tag");
24
+ var _Tag = require("../../Tag");
25
25
 
26
- var _ = require("..");
26
+ var _index = require("../../index");
27
27
 
28
28
  var _jsxRuntime = require("react/jsx-runtime");
29
29
 
@@ -55,11 +55,10 @@ var CardRibbonContainer = _styledComponents.default.div(_templateObject4 || (_te
55
55
 
56
56
  exports.CardRibbonContainer = CardRibbonContainer;
57
57
 
58
- var CardCheckboxContainer = _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"])), _.COLORS.white);
58
+ var CardCheckboxContainer = _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);
59
59
 
60
60
  exports.CardCheckboxContainer = CardCheckboxContainer;
61
-
62
- var CardTopSection = function CardTopSection(_ref) {
61
+ var CardTopSection = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
63
62
  var selected = _ref.selected,
64
63
  setSelected = _ref.setSelected,
65
64
  image = _ref.image,
@@ -78,6 +77,7 @@ var CardTopSection = function CardTopSection(_ref) {
78
77
  src: image
79
78
  }), (!!selected || !!setSelected) && /*#__PURE__*/(0, _jsxRuntime.jsx)(CardCheckboxContainer, {
80
79
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Checkbox.default, {
80
+ ref: ref,
81
81
  disabled: disabled,
82
82
  select: function select(selected) {
83
83
  return setSelected && setSelected(selected);
@@ -92,7 +92,7 @@ var CardTopSection = function CardTopSection(_ref) {
92
92
  })
93
93
  }), (highlightRibbonIcon || highlightRibbonText) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(CardRibbonContainer, {
94
94
  $color: highlightRibbonContentColor !== null && highlightRibbonContentColor !== void 0 ? highlightRibbonContentColor : '',
95
- $backgroundColor: disabled ? _.COLORS.neutral_300 : highlightRibbonBgColor !== null && highlightRibbonBgColor !== void 0 ? highlightRibbonBgColor : '',
95
+ $backgroundColor: disabled ? _index.COLORS.neutral_300 : highlightRibbonBgColor !== null && highlightRibbonBgColor !== void 0 ? highlightRibbonBgColor : '',
96
96
  children: [highlightRibbonIcon, highlightRibbonText && /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.ComponentS, {
97
97
  color: highlightRibbonContentColor !== null && highlightRibbonContentColor !== void 0 ? highlightRibbonContentColor : '',
98
98
  textStyle: _typography.ComponentTextStyle.Regular,
@@ -100,19 +100,18 @@ var CardTopSection = function CardTopSection(_ref) {
100
100
  })]
101
101
  })]
102
102
  });
103
- };
104
-
103
+ });
105
104
  CardTopSection.propTypes = {
106
105
  selected: _propTypes.default.bool,
107
106
  setSelected: _propTypes.default.func,
108
107
  tagLabel: _propTypes.default.string,
109
108
  tagIcon: _propTypes.default.node,
110
109
  highlightRibbonText: _propTypes.default.string,
111
- highlightRibbonIcon: _propTypes.default.string,
110
+ highlightRibbonIcon: _propTypes.default.node,
112
111
  highlightRibbonContentColor: _propTypes.default.string,
113
112
  highlightRibbonBgColor: _propTypes.default.string,
114
113
  image: _propTypes.default.string,
115
- disabled: _propTypes.default.bool.isRequired
114
+ disabled: _propTypes.default.bool
116
115
  };
117
116
  var _default = CardTopSection;
118
117
  exports.default = _default;
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/Card/VerticalCard/CardTopSection.tsx"],"names":["CardImg","styled","img","CardTopTagContainer","div","CardTopSectionContainer","props","disabled","CardRibbonContainer","$backgroundColor","$color","CardCheckboxContainer","COLORS","white","CardTopSection","React","forwardRef","ref","selected","setSelected","image","tagLabel","tagIcon","tagVariant","highlightRibbonIcon","highlightRibbonText","highlightRibbonContentColor","highlightRibbonBgColor","neutral_300","ComponentTextStyle","Regular"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;;;;;AAgBO,IAAMA,OAAO,GAAGC,0BAAOC,GAAV,6MAAb;;;;AAQA,IAAMC,m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,QAAA,MAAM,EAAE,gBAACW,QAAD;AAAA,iBAAuBC,WAAW,IAAIA,WAAW,CAACD,QAAD,CAAjD;AAAA,SAFlB;AAGU,QAAA,QAAQ,EAAEA,QAAQ,IAAI;AAHhC;AADF,MAHJ,EAUG,CAACG,QAAQ,IAAIC,OAAb,kBACC,qBAAC,mBAAD;AAAA,6BACE,qBAAC,QAAD;AAAK,QAAA,KAAK,EAAED,QAAZ;AAAsB,QAAA,OAAO,EAAEE,UAA/B;AAA2C,QAAA,IAAI,EAAED;AAAjD;AADF,MAXJ,EAeG,CAACE,mBAAmB,IAAIC,mBAAxB,kBACC,sBAAC,mBAAD;AAAqB,MAAA,MAAM,EAAEC,2BAAF,aAAEA,2BAAF,cAAEA,2BAAF,GAAiC,EAA5D;AACqB,MAAA,gBAAgB,EAAEnB,QAAQ,GAAGK,cAAOgB,WAAV,GAAwBD,sBAAxB,aAAwBA,sBAAxB,cAAwBA,sBAAxB,GAAkD,EADjG;AAAA,iBAEGH,mBAFH,EAGGC,mBAAmB,iBAClB,qBAAC,sBAAD;AAAY,QAAA,KAAK,EAAEC,2BAAF,aAAEA,2BAAF,cAAEA,2BAAF,GAAiC,EAAlD;AAAsD,QAAA,SAAS,EAAEG,+BAAmBC,OAApF;AAAA,kBACGL;AADH,QAJJ;AAAA,MAhBJ;AAAA,IADF;AA6BD,CA3CsB,CAAvB;;AA1EEP,EAAAA,Q;AACAC,EAAAA,W;AACAE,EAAAA,Q;AACAC,EAAAA,O;AAEAG,EAAAA,mB;AACAD,EAAAA,mB;AACAE,EAAAA,2B;AACAC,EAAAA,sB;AACAP,EAAAA,K;AACAb,EAAAA,Q;;eA6GaO,c","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport {ComponentS, ComponentTextStyle} from '../../styles/typography';\nimport Checkbox from '../../InputFields/Checkbox';\nimport {Tag, TagVariants} from '../../Tag';\n\nimport {COLORS} from '../../index';\n\nexport interface CardTopSectionProps {\n selected?: boolean;\n setSelected?: (arg0: boolean) => void;\n tagLabel?: string;\n tagIcon?: React.ReactNode;\n tagVariant?: TagVariants;\n highlightRibbonText?: string;\n highlightRibbonIcon?: React.ReactNode;\n highlightRibbonContentColor?: string;\n highlightRibbonBgColor?: string;\n image?: string;\n disabled?: boolean;\n}\n\nexport const CardImg = 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\nexport const CardTopTagContainer = styled.div`\n position: absolute;\n\n top: 16px;\n left: 16px;\n width: calc(100% - 32px);\n`;\n\nexport const CardTopSectionContainer = styled.div<{ 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\nexport const CardRibbonContainer = 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 gap: 8px;\n\n svg {\n color: ${props => props.$color};\n width: 24px;\n height: 24px;\n flex-grow: 0;\n flex-shrink: 0;\n }\n`;\n\nexport const CardCheckboxContainer = styled.div`\n position: absolute;\n top: 0;\n right: 0;\n z-index: 1;\n\n .checkbox-icon {\n background-color: ${COLORS.white};\n }\n`;\n\nconst CardTopSection = React.forwardRef(({\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, ref: React.Ref<HTMLDivElement>) => {\n\n return (\n <CardTopSectionContainer disabled={disabled}>\n <CardImg src={image}/>\n {(!!selected || !!setSelected) && (\n <CardCheckboxContainer>\n <Checkbox ref={ref}\n disabled={disabled}\n select={(selected: boolean) => setSelected && setSelected(selected)}\n selected={selected || false}/>\n </CardCheckboxContainer>\n )}\n {(tagLabel || tagIcon) && (\n <CardTopTagContainer>\n <Tag label={tagLabel} variant={tagVariant} icon={tagIcon}/>\n </CardTopTagContainer>\n )}\n {(highlightRibbonIcon || highlightRibbonText) && (\n <CardRibbonContainer $color={highlightRibbonContentColor ?? ''}\n $backgroundColor={disabled ? COLORS.neutral_300 : highlightRibbonBgColor ?? ''}>\n {highlightRibbonIcon}\n {highlightRibbonText && (\n <ComponentS color={highlightRibbonContentColor ?? ''} textStyle={ComponentTextStyle.Regular}>\n {highlightRibbonText}\n </ComponentS>\n )}\n </CardRibbonContainer>\n )}\n </CardTopSectionContainer>\n );\n});\n\nexport default CardTopSection;\n"],"file":"CardTopSection.cjs"}
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { TagVariants } from '../Tag';
2
+ import { TagVariants } from '../../Tag';
3
3
  export interface CardTopSectionProps {
4
4
  selected?: boolean;
5
5
  setSelected?: (arg0: boolean) => void;
@@ -7,21 +7,21 @@ export interface CardTopSectionProps {
7
7
  tagIcon?: React.ReactNode;
8
8
  tagVariant?: TagVariants;
9
9
  highlightRibbonText?: string;
10
- highlightRibbonIcon?: string;
10
+ highlightRibbonIcon?: React.ReactNode;
11
11
  highlightRibbonContentColor?: string;
12
12
  highlightRibbonBgColor?: string;
13
13
  image?: string;
14
- disabled: boolean;
14
+ disabled?: boolean;
15
15
  }
16
16
  export declare const CardImg: import("styled-components").StyledComponent<"img", any, {}, never>;
17
17
  export declare const CardTopTagContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
18
18
  export declare const CardTopSectionContainer: import("styled-components").StyledComponent<"div", any, {
19
- disabled: boolean;
19
+ disabled?: boolean | undefined;
20
20
  }, never>;
21
21
  export declare const CardRibbonContainer: import("styled-components").StyledComponent<"div", any, {
22
22
  $color: string;
23
23
  $backgroundColor: string;
24
24
  }, never>;
25
25
  export declare const CardCheckboxContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
26
- declare const CardTopSection: React.FunctionComponent<CardTopSectionProps>;
26
+ declare const CardTopSection: React.ForwardRefExoticComponent<CardTopSectionProps & React.RefAttributes<HTMLDivElement>>;
27
27
  export default CardTopSection;