@laerdal/life-react-components 3.6.0-dev.1.full → 3.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Accordion/__tests__/AccordionMenu.test.tsx +42 -0
- package/dist/Accordion/__tests__/ContentAccordion.test.tsx +150 -0
- package/dist/AuthPage/__tests__/AuthPage.test.tsx +27 -0
- package/dist/Banners/__tests__/Banner.test.tsx +47 -0
- package/dist/Banners/__tests__/OverviewBanner.test.tsx +20 -0
- package/dist/Breadcrumb/__tests__/Breadcrumb.test.tsx +78 -0
- package/dist/Button/TextButton.cjs +648 -0
- package/dist/Button/TextButton.cjs.map +1 -0
- package/dist/Button/TextButton.d.ts +77 -0
- package/dist/Button/TextButton.js +640 -0
- package/dist/Button/TextButton.js.map +1 -0
- package/dist/Button/__tests__/BackButton.test.tsx +32 -0
- package/dist/Button/__tests__/Button.test.tsx +45 -0
- package/dist/Button/__tests__/DualButton.test.tsx +119 -0
- package/dist/Button/__tests__/TextButton.test.tsx +45 -0
- package/dist/Card/HorizontalCard/__tests__/HorizontalCard.test.tsx +71 -0
- package/dist/Card/HorizontalCard/__tests__/VerticalCard.test.tsx +124 -0
- package/dist/Card/VerticalCard/VerticalCard.cjs +187 -0
- package/dist/Card/VerticalCard/VerticalCard.cjs.map +1 -0
- package/dist/Card/VerticalCard/VerticalCard.d.ts +25 -0
- package/dist/Card/VerticalCard/VerticalCard.js +178 -0
- package/dist/Card/VerticalCard/VerticalCard.js.map +1 -0
- package/dist/Card/VerticalCard/VerticalCardBottomSection.cjs +261 -0
- package/dist/Card/VerticalCard/VerticalCardBottomSection.cjs.map +1 -0
- package/dist/Card/VerticalCard/VerticalCardBottomSection.d.ts +53 -0
- package/dist/Card/VerticalCard/VerticalCardBottomSection.js +252 -0
- package/dist/Card/VerticalCard/VerticalCardBottomSection.js.map +1 -0
- package/dist/Card/VerticalCard/VerticalCardMiddleSection.cjs +145 -0
- package/dist/Card/VerticalCard/VerticalCardMiddleSection.cjs.map +1 -0
- package/dist/Card/VerticalCard/VerticalCardMiddleSection.d.ts +42 -0
- package/dist/Card/VerticalCard/VerticalCardMiddleSection.js +136 -0
- package/dist/Card/VerticalCard/VerticalCardMiddleSection.js.map +1 -0
- package/dist/Card/VerticalCard/VerticalCardTopSection.cjs +165 -0
- package/dist/Card/VerticalCard/VerticalCardTopSection.cjs.map +1 -0
- package/dist/Card/VerticalCard/VerticalCardTopSection.d.ts +45 -0
- package/dist/Card/VerticalCard/VerticalCardTopSection.js +156 -0
- package/dist/Card/VerticalCard/VerticalCardTopSection.js.map +1 -0
- package/dist/Card/VerticalCard/__tests__/VerticalCard.test.tsx +124 -0
- package/dist/Card/__tests__/Card.test.tsx +146 -0
- package/dist/Chips/ChoiceChips.cjs +0 -1
- package/dist/Chips/ChoiceChips.cjs.map +1 -1
- package/dist/Chips/ChoiceChips.js +0 -1
- package/dist/Chips/ChoiceChips.js.map +1 -1
- package/dist/Chips/__tests__/ActionChip.test.tsx +94 -0
- package/dist/Chips/__tests__/ChoiceChips.test.tsx +79 -0
- package/dist/Chips/__tests__/FilterChip.test.tsx +95 -0
- package/dist/Chips/__tests__/InputChip.test.tsx +155 -0
- package/dist/ChipsInput/ChipDropdownInput.cjs +1 -1
- package/dist/ChipsInput/ChipDropdownInput.cjs.map +1 -1
- package/dist/ChipsInput/ChipDropdownInput.js +1 -1
- package/dist/ChipsInput/ChipDropdownInput.js.map +1 -1
- package/dist/ChipsInput/__tests__/ChipDropdownInput.test.tsx +100 -0
- package/dist/ChipsInput/__tests__/ChipInputFields.test.tsx +155 -0
- package/dist/Dropdown/BasicDropdown.cjs +0 -2
- package/dist/Dropdown/BasicDropdown.cjs.map +1 -1
- package/dist/Dropdown/BasicDropdown.js +0 -2
- package/dist/Dropdown/BasicDropdown.js.map +1 -1
- package/dist/Dropdown/DropdownButton.cjs +0 -4
- package/dist/Dropdown/DropdownButton.cjs.map +1 -1
- package/dist/Dropdown/DropdownButton.js +0 -4
- package/dist/Dropdown/DropdownButton.js.map +1 -1
- package/dist/Dropdown/DropdownContent.cjs +1 -1
- package/dist/Dropdown/DropdownContent.cjs.map +1 -1
- package/dist/Dropdown/DropdownContent.js +1 -1
- package/dist/Dropdown/DropdownContent.js.map +1 -1
- package/dist/Dropdown/DropdownFilter.cjs +0 -2
- package/dist/Dropdown/DropdownFilter.cjs.map +1 -1
- package/dist/Dropdown/DropdownFilter.js +0 -2
- package/dist/Dropdown/DropdownFilter.js.map +1 -1
- package/dist/Dropdown/__tests__/DropdownFilter.test.tsx +39 -0
- package/dist/Footer/__tests__/Footer.test.tsx +182 -0
- package/dist/GlobalNavigationBar/__tests__/Logo.test.tsx +31 -0
- package/dist/GlobalNavigationBar/desktop/ExtendedMainMenu.cjs +1 -0
- package/dist/GlobalNavigationBar/desktop/ExtendedMainMenu.cjs.map +1 -1
- package/dist/GlobalNavigationBar/desktop/ExtendedMainMenu.js +1 -0
- package/dist/GlobalNavigationBar/desktop/ExtendedMainMenu.js.map +1 -1
- package/dist/GlobalNavigationBar/desktop/SubMenu.cjs +1 -0
- package/dist/GlobalNavigationBar/desktop/SubMenu.cjs.map +1 -1
- package/dist/GlobalNavigationBar/desktop/SubMenu.js +1 -0
- package/dist/GlobalNavigationBar/desktop/SubMenu.js.map +1 -1
- package/dist/GlobalNavigationBar/desktop/__tests__/DesktopActions.test.tsx +108 -0
- package/dist/GlobalNavigationBar/desktop/__tests__/ExtendedMainMenu.test.tsx +28 -0
- package/dist/GlobalNavigationBar/desktop/__tests__/MainMenu.test.tsx +55 -0
- package/dist/GlobalNavigationBar/desktop/__tests__/RightSideNav.test.tsx +45 -0
- package/dist/GlobalNavigationBar/desktop/__tests__/UserMenu.test.tsx +125 -0
- package/dist/GlobalNavigationBar/mobile/__tests__/MobileMenu.test.tsx +317 -0
- package/dist/GlobalNavigationBar/mobile/__tests__/MobileMenuContent.test.tsx +294 -0
- package/dist/GlobalNavigationBar/mobile/__tests__/MobileMenuHeader.test.tsx +195 -0
- package/dist/InputFields/QuickSearch.cjs +1 -1
- package/dist/InputFields/QuickSearch.cjs.map +1 -1
- package/dist/InputFields/QuickSearch.js +1 -1
- package/dist/InputFields/QuickSearch.js.map +1 -1
- package/dist/InputFields/__tests__/NumberField.test.tsx +67 -0
- package/dist/InputFields/__tests__/NumberInput.test.tsx +68 -0
- package/dist/InputFields/__tests__/QuickSearch.test.tsx +42 -0
- package/dist/LinearProgress/__tests__/LinearProgress.test.tsx +25 -0
- package/dist/List/__tests__/ListRow.test.tsx +18 -0
- package/dist/LoadingPage/__tests__/GlobalLoadingPage.test.tsx +23 -0
- package/dist/Modals/__tests__/Modal.test.tsx +169 -0
- package/dist/Modals/__tests__/ModalContainer.test.tsx +77 -0
- package/dist/Modals/__tests__/ModalContent.test.tsx +126 -0
- package/dist/NavItem/__tests__/NavItem.test.ts +6 -0
- package/dist/Navigation/NavigationProvider.cjs +43 -0
- package/dist/Navigation/NavigationProvider.cjs.map +1 -0
- package/dist/Navigation/NavigationProvider.d.ts +15 -0
- package/dist/Navigation/NavigationProvider.js +32 -0
- package/dist/Navigation/NavigationProvider.js.map +1 -0
- package/dist/Navigation/index.cjs +19 -0
- package/dist/Navigation/index.cjs.map +1 -0
- package/dist/Navigation/index.d.ts +2 -0
- package/dist/Navigation/index.js +2 -0
- package/dist/Navigation/index.js.map +1 -0
- package/dist/NotificationDot/__tests__/NotificationDot.test.tsx +33 -0
- package/dist/Paginator/__tests__/Paginator.test.tsx +33 -0
- package/dist/Popover/__tests__/Popover.test.tsx +64 -0
- package/dist/ProfileButton/__tests__/ProfileButton.test.tsx +31 -0
- package/dist/QuizButton/__tests__/QuizButton.test.tsx +53 -0
- package/dist/SegmentControl/__tests__/SegmentControl.test.tsx +145 -0
- package/dist/SideMenu/__tests__/SideMenu.test.tsx +99 -0
- package/dist/Switcher/__tests__/SwitcherMenuItem.tsx +14 -0
- package/dist/Table/Table.cjs +3 -1
- package/dist/Table/Table.cjs.map +1 -1
- package/dist/Table/Table.js +3 -1
- package/dist/Table/Table.js.map +1 -1
- package/dist/Table/TableBody.cjs +1 -1
- package/dist/Table/TableBody.cjs.map +1 -1
- package/dist/Table/TableBody.js +1 -1
- package/dist/Table/TableBody.js.map +1 -1
- package/dist/Table/TableFooter.cjs +0 -2
- package/dist/Table/TableFooter.cjs.map +1 -1
- package/dist/Table/TableFooter.js +0 -2
- package/dist/Table/TableFooter.js.map +1 -1
- package/dist/Table/__tests__/Table.test.tsx +499 -0
- package/dist/Tabs/__tests__/HorizontalTabs.test.tsx +95 -0
- package/dist/Tabs/__tests__/TabLink.test.tsx +40 -0
- package/dist/Tabs/__tests__/Tablist.test.tsx +37 -0
- package/dist/Tag/__tests__/Tag.test.tsx +86 -0
- package/dist/Toasters/__tests__/Toast.test.tsx +74 -0
- package/dist/Toggles/__tests__/ToggleButton.test.tsx +53 -0
- package/dist/Toggles/__tests__/ToggleSwitch.test.tsx +87 -0
- package/dist/Tooltips/__tests__/TooltipWrapper.test.tsx +16 -0
- package/dist/icons/systemicons/CreditCard.cjs +43 -0
- package/dist/icons/systemicons/CreditCard.cjs.map +1 -0
- package/dist/icons/systemicons/CreditCard.d.ts +3 -0
- package/dist/icons/systemicons/CreditCard.js +33 -0
- package/dist/icons/systemicons/CreditCard.js.map +1 -0
- package/dist/icons/systemicons/Discount.cjs +43 -0
- package/dist/icons/systemicons/Discount.cjs.map +1 -0
- package/dist/icons/systemicons/Discount.d.ts +3 -0
- package/dist/icons/systemicons/Discount.js +33 -0
- package/dist/icons/systemicons/Discount.js.map +1 -0
- package/dist/icons/systemicons/DocumentComplete.cjs +43 -0
- package/dist/icons/systemicons/DocumentComplete.cjs.map +1 -0
- package/dist/icons/systemicons/DocumentComplete.d.ts +3 -0
- package/dist/icons/systemicons/DocumentComplete.js +33 -0
- package/dist/icons/systemicons/DocumentComplete.js.map +1 -0
- package/dist/icons/systemicons/Folder.cjs +43 -0
- package/dist/icons/systemicons/Folder.cjs.map +1 -0
- package/dist/icons/systemicons/Folder.d.ts +3 -0
- package/dist/icons/systemicons/Folder.js +33 -0
- package/dist/icons/systemicons/Folder.js.map +1 -0
- package/dist/icons/systemicons/FolderNew.cjs +43 -0
- package/dist/icons/systemicons/FolderNew.cjs.map +1 -0
- package/dist/icons/systemicons/FolderNew.d.ts +3 -0
- package/dist/icons/systemicons/FolderNew.js +33 -0
- package/dist/icons/systemicons/FolderNew.js.map +1 -0
- package/dist/icons/systemicons/MoodHappy.cjs +43 -0
- package/dist/icons/systemicons/MoodHappy.cjs.map +1 -0
- package/dist/icons/systemicons/MoodHappy.d.ts +3 -0
- package/dist/icons/systemicons/MoodHappy.js +33 -0
- package/dist/icons/systemicons/MoodHappy.js.map +1 -0
- package/dist/icons/systemicons/MoodIndifferent.cjs +43 -0
- package/dist/icons/systemicons/MoodIndifferent.cjs.map +1 -0
- package/dist/icons/systemicons/MoodIndifferent.d.ts +3 -0
- package/dist/icons/systemicons/MoodIndifferent.js +33 -0
- package/dist/icons/systemicons/MoodIndifferent.js.map +1 -0
- package/dist/icons/systemicons/MoodSad.cjs +43 -0
- package/dist/icons/systemicons/MoodSad.cjs.map +1 -0
- package/dist/icons/systemicons/MoodSad.d.ts +3 -0
- package/dist/icons/systemicons/MoodSad.js +33 -0
- package/dist/icons/systemicons/MoodSad.js.map +1 -0
- package/dist/icons/systemicons/MoodVeryHappy.cjs +43 -0
- package/dist/icons/systemicons/MoodVeryHappy.cjs.map +1 -0
- package/dist/icons/systemicons/MoodVeryHappy.d.ts +3 -0
- package/dist/icons/systemicons/MoodVeryHappy.js +33 -0
- package/dist/icons/systemicons/MoodVeryHappy.js.map +1 -0
- package/dist/icons/systemicons/MoodVerySad.cjs +43 -0
- package/dist/icons/systemicons/MoodVerySad.cjs.map +1 -0
- package/dist/icons/systemicons/MoodVerySad.d.ts +3 -0
- package/dist/icons/systemicons/MoodVerySad.js +33 -0
- package/dist/icons/systemicons/MoodVerySad.js.map +1 -0
- package/dist/icons/systemicons/Orders.cjs +43 -0
- package/dist/icons/systemicons/Orders.cjs.map +1 -0
- package/dist/icons/systemicons/Orders.d.ts +3 -0
- package/dist/icons/systemicons/Orders.js +33 -0
- package/dist/icons/systemicons/Orders.js.map +1 -0
- package/dist/icons/systemicons/Palette.cjs +43 -0
- package/dist/icons/systemicons/Palette.cjs.map +1 -0
- package/dist/icons/systemicons/Palette.d.ts +3 -0
- package/dist/icons/systemicons/Palette.js +33 -0
- package/dist/icons/systemicons/Palette.js.map +1 -0
- package/dist/icons/systemicons/Stack.cjs +43 -0
- package/dist/icons/systemicons/Stack.cjs.map +1 -0
- package/dist/icons/systemicons/Stack.d.ts +3 -0
- package/dist/icons/systemicons/Stack.js +33 -0
- package/dist/icons/systemicons/Stack.js.map +1 -0
- package/dist/styles/design-tokens/dark/tokens.css +481 -0
- package/dist/styles/design-tokens/light/tokens.css +481 -0
- package/dist/styles/design-tokens/rqi_dark/tokens.css +481 -0
- package/dist/styles/design-tokens/rqi_light/tokens.css +481 -0
- package/dist/styles/react-datepicker.css +766 -0
- package/dist/styles/typography.cjs +35 -59
- package/dist/styles/typography.cjs.map +1 -1
- package/dist/styles/typography.d.ts +1 -1
- package/dist/styles/typography.js +35 -59
- package/dist/styles/typography.js.map +1 -1
- package/dist/test-utils.cjs +16 -10
- package/dist/test-utils.cjs.map +1 -1
- package/dist/test-utils.d.ts +5 -5
- package/dist/test-utils.js +14 -8
- package/dist/test-utils.js.map +1 -1
- package/dist/utils/color-tokens.cjs +91 -0
- package/dist/utils/color-tokens.cjs.map +1 -0
- package/dist/utils/color-tokens.d.ts +19 -0
- package/dist/utils/color-tokens.js +82 -0
- package/dist/utils/color-tokens.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = exports.VerticalCardMiddleSectionTitle = exports.VerticalCardMiddleSectionTagsStyles = exports.VerticalCardMiddleSectionContainer = exports.VerticalCardMiddleSectionColorBandStyles = exports.VerticalCardMiddleSectionCategoryStyles = void 0;
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
var React = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
11
|
+
var _index = require("../../index");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
14
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
15
|
+
const VerticalCardMiddleSectionContainer = exports.VerticalCardMiddleSectionContainer = _styledComponents.default.div`
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-grow: 1;
|
|
18
|
+
width: calc(100% - 32px);
|
|
19
|
+
position: relative;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
padding: 16px;
|
|
22
|
+
gap: 8px;
|
|
23
|
+
|
|
24
|
+
.descriptionBlock {
|
|
25
|
+
padding: 2px 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.titleBlock {
|
|
29
|
+
padding: 2px 0;
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
32
|
+
const VerticalCardMiddleSectionColorBandStyles = exports.VerticalCardMiddleSectionColorBandStyles = _styledComponents.default.div`
|
|
33
|
+
position: absolute;
|
|
34
|
+
width: 100%;
|
|
35
|
+
top: 0px;
|
|
36
|
+
left: 0px;
|
|
37
|
+
height: 8px;
|
|
38
|
+
background-color: ${props => props.$color};
|
|
39
|
+
`;
|
|
40
|
+
const VerticalCardMiddleSectionTagsStyles = exports.VerticalCardMiddleSectionTagsStyles = _styledComponents.default.div`
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-direction: row;
|
|
43
|
+
padding: 4px 0;
|
|
44
|
+
gap: 4px;
|
|
45
|
+
flex-wrap: wrap;
|
|
46
|
+
`;
|
|
47
|
+
const VerticalCardMiddleSectionCategoryStyles = exports.VerticalCardMiddleSectionCategoryStyles = _styledComponents.default.div`
|
|
48
|
+
display: flex;
|
|
49
|
+
flex-direction: row;
|
|
50
|
+
align-items: center;
|
|
51
|
+
padding: none;
|
|
52
|
+
gap: 6px;
|
|
53
|
+
|
|
54
|
+
svg {
|
|
55
|
+
color: ${props => _index.COLORS.generateToken({
|
|
56
|
+
componentType: 'text',
|
|
57
|
+
defaultVariant: 'subtle'
|
|
58
|
+
}, props.theme)};
|
|
59
|
+
flex-grow: 0;
|
|
60
|
+
flex-shrink: 0;
|
|
61
|
+
}
|
|
62
|
+
`;
|
|
63
|
+
const VerticalCardMiddleSectionTitle = exports.VerticalCardMiddleSectionTitle = _styledComponents.default.h3`
|
|
64
|
+
${props => (0, _index.ComponentXLStyling)(_index.ComponentTextStyle.Bold, props.$disabled ? _index.COLORS.generateToken({
|
|
65
|
+
componentType: 'text',
|
|
66
|
+
defaultVariant: 'subtle'
|
|
67
|
+
}, props.theme) : _index.COLORS.generateToken({
|
|
68
|
+
componentType: 'text',
|
|
69
|
+
defaultVariant: 'default'
|
|
70
|
+
}, props.theme))}
|
|
71
|
+
`;
|
|
72
|
+
const VerticalCardMiddleSection = _ref => {
|
|
73
|
+
let {
|
|
74
|
+
colorBandColor,
|
|
75
|
+
categoryIcon,
|
|
76
|
+
categoryLabel,
|
|
77
|
+
title,
|
|
78
|
+
description,
|
|
79
|
+
tags,
|
|
80
|
+
row2Tags,
|
|
81
|
+
disabled,
|
|
82
|
+
componentId
|
|
83
|
+
} = _ref;
|
|
84
|
+
const theme = (0, _styledComponents.useTheme)();
|
|
85
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(VerticalCardMiddleSectionContainer, {
|
|
86
|
+
"data-testid": 'card-middleSection',
|
|
87
|
+
children: [colorBandColor && /*#__PURE__*/(0, _jsxRuntime.jsx)(VerticalCardMiddleSectionColorBandStyles, {
|
|
88
|
+
$color: colorBandColor
|
|
89
|
+
}), (categoryIcon || categoryLabel) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(VerticalCardMiddleSectionCategoryStyles, {
|
|
90
|
+
$extraTopMargin: Boolean(colorBandColor),
|
|
91
|
+
$bottomMargin: Boolean(categoryIcon || categoryLabel),
|
|
92
|
+
children: [categoryIcon, /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ComponentS, {
|
|
93
|
+
textStyle: _index.ComponentTextStyle.Bold,
|
|
94
|
+
color: _index.COLORS.generateToken({
|
|
95
|
+
componentType: 'text',
|
|
96
|
+
defaultVariant: 'subtle'
|
|
97
|
+
}, theme),
|
|
98
|
+
children: categoryLabel
|
|
99
|
+
})]
|
|
100
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(VerticalCardMiddleSectionTitle, {
|
|
101
|
+
id: `${componentId}-title`,
|
|
102
|
+
className: "titleBlock",
|
|
103
|
+
$disabled: disabled,
|
|
104
|
+
children: title
|
|
105
|
+
}), description && /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ComponentS, {
|
|
106
|
+
className: "descriptionBlock",
|
|
107
|
+
color: _index.COLORS.generateToken({
|
|
108
|
+
componentType: 'text',
|
|
109
|
+
defaultVariant: 'subtle'
|
|
110
|
+
}, theme),
|
|
111
|
+
children: description
|
|
112
|
+
}), tags && /*#__PURE__*/(0, _jsxRuntime.jsx)(VerticalCardMiddleSectionTagsStyles, {
|
|
113
|
+
children: tags.map((x, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Tag, {
|
|
114
|
+
label: x.label,
|
|
115
|
+
variant: x.variant ?? 'neutral',
|
|
116
|
+
icon: x.icon
|
|
117
|
+
}, `${x.label}_${index}`))
|
|
118
|
+
}), row2Tags && /*#__PURE__*/(0, _jsxRuntime.jsx)(VerticalCardMiddleSectionTagsStyles, {
|
|
119
|
+
children: row2Tags.map((x, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Tag, {
|
|
120
|
+
label: x.label,
|
|
121
|
+
variant: x.variant ?? 'neutral',
|
|
122
|
+
icon: x.icon
|
|
123
|
+
}, `${x.label}_${index}`))
|
|
124
|
+
})]
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
VerticalCardMiddleSection.propTypes = {
|
|
128
|
+
colorBandColor: _propTypes.default.string,
|
|
129
|
+
categoryIcon: _propTypes.default.node,
|
|
130
|
+
categoryLabel: _propTypes.default.string,
|
|
131
|
+
title: _propTypes.default.string.isRequired,
|
|
132
|
+
description: _propTypes.default.string,
|
|
133
|
+
tags: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
134
|
+
label: _propTypes.default.string.isRequired,
|
|
135
|
+
icon: _propTypes.default.node
|
|
136
|
+
})),
|
|
137
|
+
row2Tags: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
138
|
+
label: _propTypes.default.string.isRequired,
|
|
139
|
+
icon: _propTypes.default.node
|
|
140
|
+
})),
|
|
141
|
+
disabled: _propTypes.default.bool,
|
|
142
|
+
componentId: _propTypes.default.string
|
|
143
|
+
};
|
|
144
|
+
var _default = exports.default = VerticalCardMiddleSection;
|
|
145
|
+
//# sourceMappingURL=VerticalCardMiddleSection.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VerticalCardMiddleSection.cjs","names":["React","_interopRequireWildcard","require","_styledComponents","_index","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","VerticalCardMiddleSectionContainer","exports","styled","div","VerticalCardMiddleSectionColorBandStyles","props","$color","VerticalCardMiddleSectionTagsStyles","VerticalCardMiddleSectionCategoryStyles","COLORS","generateToken","componentType","defaultVariant","theme","VerticalCardMiddleSectionTitle","h3","ComponentXLStyling","ComponentTextStyle","Bold","$disabled","VerticalCardMiddleSection","_ref","colorBandColor","categoryIcon","categoryLabel","title","description","tags","row2Tags","disabled","componentId","useTheme","jsxs","children","jsx","$extraTopMargin","Boolean","$bottomMargin","ComponentS","textStyle","color","id","className","map","x","index","Tag","label","variant","icon","propTypes","_propTypes","string","node","isRequired","arrayOf","shape","bool","_default"],"sources":["../../../src/Card/VerticalCard/VerticalCardMiddleSection.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport styled, { useTheme } from 'styled-components';\r\nimport { COLORS, ComponentS, ComponentTextStyle, ComponentXL, ComponentXLStyling, Tag, TagVariants } from '../../index';\r\nimport { ReactNode } from 'react';\r\n\r\nexport interface VerticalCardMiddleSectionProps {\r\n /** Color of the band to be shown on the top of middle section. */\r\n colorBandColor?: string;\r\n /** Icon to be shown on the left side of the categoryLabel. */\r\n categoryIcon?: React.ReactNode;\r\n /** Label to be shown at the top part of the middle section. */\r\n categoryLabel?: string;\r\n /** Main title of the Card component. */\r\n title: string;\r\n /** Description of the Card. */\r\n description?: string;\r\n /** Tags to be shown under the description. */\r\n tags?: VerticalCardTag[];\r\n /** Second row of tags if needed. */\r\n row2Tags?: VerticalCardTag[];\r\n /** This property is set by Card component itself and is based on 'disabled' flag of CardProps. */\r\n disabled?: boolean;\r\n /** Top level Id of Card component */\r\n componentId?: string;\r\n}\r\n\r\nexport interface VerticalCardTag {\r\n label: string;\r\n variant?: TagVariants;\r\n icon?: ReactNode\r\n}\r\n\r\nexport const VerticalCardMiddleSectionContainer = styled.div`\r\n display: flex;\r\n flex-grow: 1;\r\n width: calc(100% - 32px);\r\n position: relative;\r\n flex-direction: column;\r\n padding: 16px;\r\n gap: 8px;\r\n\r\n .descriptionBlock {\r\n padding: 2px 0;\r\n }\r\n\r\n .titleBlock {\r\n padding: 2px 0;\r\n }\r\n`;\r\n\r\nexport const VerticalCardMiddleSectionColorBandStyles = styled.div<{ $color: string }>`\r\n position: absolute;\r\n width: 100%;\r\n top: 0px;\r\n left: 0px;\r\n height: 8px;\r\n background-color: ${(props) => props.$color};\r\n`;\r\n\r\nexport const VerticalCardMiddleSectionTagsStyles = styled.div`\r\n display: flex;\r\n flex-direction: row;\r\n padding: 4px 0;\r\n gap: 4px;\r\n flex-wrap: wrap;\r\n`;\r\n\r\nexport const VerticalCardMiddleSectionCategoryStyles = styled.div<{ $extraTopMargin: boolean; $bottomMargin: boolean }>`\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n padding: none;\r\n gap: 6px;\r\n\r\n svg {\r\n color: ${props => COLORS.generateToken({ componentType: 'text', defaultVariant: 'subtle' }, props.theme)};\r\n flex-grow: 0;\r\n flex-shrink: 0;\r\n }\r\n`;\r\n\r\nexport const VerticalCardMiddleSectionTitle = styled.h3<{ $disabled?: boolean }>`\r\n ${props => ComponentXLStyling(ComponentTextStyle.Bold, props.$disabled \r\n ? COLORS.generateToken({componentType:'text',defaultVariant:'subtle'}, props.theme)\r\n : COLORS.generateToken({componentType:'text',defaultVariant:'default'}, props.theme)\r\n )}\r\n`;\r\n\r\nconst VerticalCardMiddleSection: React.FunctionComponent<VerticalCardMiddleSectionProps> = ({\r\n colorBandColor,\r\n categoryIcon,\r\n categoryLabel,\r\n title,\r\n description,\r\n tags,\r\n row2Tags,\r\n disabled,\r\n componentId\r\n}: VerticalCardMiddleSectionProps) => {\r\n const theme = useTheme();\r\n \r\n return (\r\n <VerticalCardMiddleSectionContainer data-testid={'card-middleSection'} >\r\n {colorBandColor && <VerticalCardMiddleSectionColorBandStyles $color={colorBandColor} />}\r\n {\r\n (categoryIcon || categoryLabel) &&\r\n <VerticalCardMiddleSectionCategoryStyles $extraTopMargin={Boolean(colorBandColor)} $bottomMargin={Boolean(categoryIcon || categoryLabel)}>\r\n {categoryIcon}\r\n <ComponentS textStyle={ComponentTextStyle.Bold} color={COLORS.generateToken({componentType:'text',defaultVariant:'subtle'}, theme)}>\r\n {categoryLabel}\r\n </ComponentS>\r\n </VerticalCardMiddleSectionCategoryStyles>\r\n }\r\n <VerticalCardMiddleSectionTitle \r\n id={`${componentId}-title`} \r\n className=\"titleBlock\"\r\n $disabled={disabled}>\r\n {title}\r\n </VerticalCardMiddleSectionTitle>\r\n {description && (\r\n <ComponentS className=\"descriptionBlock\" color={COLORS.generateToken({componentType:'text',defaultVariant:'subtle'}, theme)}>\r\n {description}\r\n </ComponentS>\r\n )}\r\n {tags && (\r\n <VerticalCardMiddleSectionTagsStyles>\r\n {tags.map((x, index) => (\r\n <Tag key={`${x.label}_${index}`} label={x.label} variant={x.variant ?? 'neutral'} icon={x.icon} />\r\n ))}\r\n </VerticalCardMiddleSectionTagsStyles>\r\n )}\r\n {row2Tags && (\r\n <VerticalCardMiddleSectionTagsStyles>\r\n {row2Tags.map((x, index) => (\r\n <Tag key={`${x.label}_${index}`} label={x.label} variant={x.variant ?? 'neutral'} icon={x.icon} />\r\n ))}\r\n </VerticalCardMiddleSectionTagsStyles>\r\n )}\r\n </VerticalCardMiddleSectionContainer>\r\n );\r\n};\r\n\r\nexport default VerticalCardMiddleSection;\r\n"],"mappings":";;;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAF,uBAAA,CAAAC,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAAwH,IAAAG,WAAA,GAAAH,OAAA;AAAA,SAAAI,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAA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AA,CAAAsE,KAAA;IAQRT,KAAK,EAAAI,UAAA,CAAAjE,OAAA,CAAAkE,MAAA,CAAAE,UAAA;IAELL,IAAI,EAAAE,UAAA,CAAAjE,OAAA,CAAAmE;EAAA;EARJxB,QAAQ,EAAAsB,UAAA,CAAAjE,OAAA,CAAAuE,IAAA;EAER3B,WAAW,EAAAqB,UAAA,CAAAjE,OAAA,CAAAkE;AAAA;AAAA,IAAAM,QAAA,GAAAzD,OAAA,CAAAf,OAAA,GAuHEkC,yBAAyB","ignoreList":[]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { TagVariants } from '../../index';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
export interface VerticalCardMiddleSectionProps {
|
|
5
|
+
/** Color of the band to be shown on the top of middle section. */
|
|
6
|
+
colorBandColor?: string;
|
|
7
|
+
/** Icon to be shown on the left side of the categoryLabel. */
|
|
8
|
+
categoryIcon?: React.ReactNode;
|
|
9
|
+
/** Label to be shown at the top part of the middle section. */
|
|
10
|
+
categoryLabel?: string;
|
|
11
|
+
/** Main title of the Card component. */
|
|
12
|
+
title: string;
|
|
13
|
+
/** Description of the Card. */
|
|
14
|
+
description?: string;
|
|
15
|
+
/** Tags to be shown under the description. */
|
|
16
|
+
tags?: VerticalCardTag[];
|
|
17
|
+
/** Second row of tags if needed. */
|
|
18
|
+
row2Tags?: VerticalCardTag[];
|
|
19
|
+
/** This property is set by Card component itself and is based on 'disabled' flag of CardProps. */
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
/** Top level Id of Card component */
|
|
22
|
+
componentId?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface VerticalCardTag {
|
|
25
|
+
label: string;
|
|
26
|
+
variant?: TagVariants;
|
|
27
|
+
icon?: ReactNode;
|
|
28
|
+
}
|
|
29
|
+
export declare const VerticalCardMiddleSectionContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
30
|
+
export declare const VerticalCardMiddleSectionColorBandStyles: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
31
|
+
$color: string;
|
|
32
|
+
}>> & string;
|
|
33
|
+
export declare const VerticalCardMiddleSectionTagsStyles: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
34
|
+
export declare const VerticalCardMiddleSectionCategoryStyles: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
35
|
+
$extraTopMargin: boolean;
|
|
36
|
+
$bottomMargin: boolean;
|
|
37
|
+
}>> & string;
|
|
38
|
+
export declare const VerticalCardMiddleSectionTitle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, {
|
|
39
|
+
$disabled?: boolean;
|
|
40
|
+
}>> & string;
|
|
41
|
+
declare const VerticalCardMiddleSection: React.FunctionComponent<VerticalCardMiddleSectionProps>;
|
|
42
|
+
export default VerticalCardMiddleSection;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import _pt from "prop-types";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import styled, { useTheme } from 'styled-components';
|
|
4
|
+
import { COLORS, ComponentS, ComponentTextStyle, ComponentXLStyling, Tag } from '../../index';
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
export const VerticalCardMiddleSectionContainer = styled.div`
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-grow: 1;
|
|
9
|
+
width: calc(100% - 32px);
|
|
10
|
+
position: relative;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
padding: 16px;
|
|
13
|
+
gap: 8px;
|
|
14
|
+
|
|
15
|
+
.descriptionBlock {
|
|
16
|
+
padding: 2px 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.titleBlock {
|
|
20
|
+
padding: 2px 0;
|
|
21
|
+
}
|
|
22
|
+
`;
|
|
23
|
+
export const VerticalCardMiddleSectionColorBandStyles = styled.div`
|
|
24
|
+
position: absolute;
|
|
25
|
+
width: 100%;
|
|
26
|
+
top: 0px;
|
|
27
|
+
left: 0px;
|
|
28
|
+
height: 8px;
|
|
29
|
+
background-color: ${props => props.$color};
|
|
30
|
+
`;
|
|
31
|
+
export const VerticalCardMiddleSectionTagsStyles = styled.div`
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: row;
|
|
34
|
+
padding: 4px 0;
|
|
35
|
+
gap: 4px;
|
|
36
|
+
flex-wrap: wrap;
|
|
37
|
+
`;
|
|
38
|
+
export const VerticalCardMiddleSectionCategoryStyles = styled.div`
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-direction: row;
|
|
41
|
+
align-items: center;
|
|
42
|
+
padding: none;
|
|
43
|
+
gap: 6px;
|
|
44
|
+
|
|
45
|
+
svg {
|
|
46
|
+
color: ${props => COLORS.generateToken({
|
|
47
|
+
componentType: 'text',
|
|
48
|
+
defaultVariant: 'subtle'
|
|
49
|
+
}, props.theme)};
|
|
50
|
+
flex-grow: 0;
|
|
51
|
+
flex-shrink: 0;
|
|
52
|
+
}
|
|
53
|
+
`;
|
|
54
|
+
export const VerticalCardMiddleSectionTitle = styled.h3`
|
|
55
|
+
${props => ComponentXLStyling(ComponentTextStyle.Bold, props.$disabled ? COLORS.generateToken({
|
|
56
|
+
componentType: 'text',
|
|
57
|
+
defaultVariant: 'subtle'
|
|
58
|
+
}, props.theme) : COLORS.generateToken({
|
|
59
|
+
componentType: 'text',
|
|
60
|
+
defaultVariant: 'default'
|
|
61
|
+
}, props.theme))}
|
|
62
|
+
`;
|
|
63
|
+
const VerticalCardMiddleSection = _ref => {
|
|
64
|
+
let {
|
|
65
|
+
colorBandColor,
|
|
66
|
+
categoryIcon,
|
|
67
|
+
categoryLabel,
|
|
68
|
+
title,
|
|
69
|
+
description,
|
|
70
|
+
tags,
|
|
71
|
+
row2Tags,
|
|
72
|
+
disabled,
|
|
73
|
+
componentId
|
|
74
|
+
} = _ref;
|
|
75
|
+
const theme = useTheme();
|
|
76
|
+
return /*#__PURE__*/_jsxs(VerticalCardMiddleSectionContainer, {
|
|
77
|
+
"data-testid": 'card-middleSection',
|
|
78
|
+
children: [colorBandColor && /*#__PURE__*/_jsx(VerticalCardMiddleSectionColorBandStyles, {
|
|
79
|
+
$color: colorBandColor
|
|
80
|
+
}), (categoryIcon || categoryLabel) && /*#__PURE__*/_jsxs(VerticalCardMiddleSectionCategoryStyles, {
|
|
81
|
+
$extraTopMargin: Boolean(colorBandColor),
|
|
82
|
+
$bottomMargin: Boolean(categoryIcon || categoryLabel),
|
|
83
|
+
children: [categoryIcon, /*#__PURE__*/_jsx(ComponentS, {
|
|
84
|
+
textStyle: ComponentTextStyle.Bold,
|
|
85
|
+
color: COLORS.generateToken({
|
|
86
|
+
componentType: 'text',
|
|
87
|
+
defaultVariant: 'subtle'
|
|
88
|
+
}, theme),
|
|
89
|
+
children: categoryLabel
|
|
90
|
+
})]
|
|
91
|
+
}), /*#__PURE__*/_jsx(VerticalCardMiddleSectionTitle, {
|
|
92
|
+
id: `${componentId}-title`,
|
|
93
|
+
className: "titleBlock",
|
|
94
|
+
$disabled: disabled,
|
|
95
|
+
children: title
|
|
96
|
+
}), description && /*#__PURE__*/_jsx(ComponentS, {
|
|
97
|
+
className: "descriptionBlock",
|
|
98
|
+
color: COLORS.generateToken({
|
|
99
|
+
componentType: 'text',
|
|
100
|
+
defaultVariant: 'subtle'
|
|
101
|
+
}, theme),
|
|
102
|
+
children: description
|
|
103
|
+
}), tags && /*#__PURE__*/_jsx(VerticalCardMiddleSectionTagsStyles, {
|
|
104
|
+
children: tags.map((x, index) => /*#__PURE__*/_jsx(Tag, {
|
|
105
|
+
label: x.label,
|
|
106
|
+
variant: x.variant ?? 'neutral',
|
|
107
|
+
icon: x.icon
|
|
108
|
+
}, `${x.label}_${index}`))
|
|
109
|
+
}), row2Tags && /*#__PURE__*/_jsx(VerticalCardMiddleSectionTagsStyles, {
|
|
110
|
+
children: row2Tags.map((x, index) => /*#__PURE__*/_jsx(Tag, {
|
|
111
|
+
label: x.label,
|
|
112
|
+
variant: x.variant ?? 'neutral',
|
|
113
|
+
icon: x.icon
|
|
114
|
+
}, `${x.label}_${index}`))
|
|
115
|
+
})]
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
VerticalCardMiddleSection.propTypes = {
|
|
119
|
+
colorBandColor: _pt.string,
|
|
120
|
+
categoryIcon: _pt.node,
|
|
121
|
+
categoryLabel: _pt.string,
|
|
122
|
+
title: _pt.string.isRequired,
|
|
123
|
+
description: _pt.string,
|
|
124
|
+
tags: _pt.arrayOf(_pt.shape({
|
|
125
|
+
label: _pt.string.isRequired,
|
|
126
|
+
icon: _pt.node
|
|
127
|
+
})),
|
|
128
|
+
row2Tags: _pt.arrayOf(_pt.shape({
|
|
129
|
+
label: _pt.string.isRequired,
|
|
130
|
+
icon: _pt.node
|
|
131
|
+
})),
|
|
132
|
+
disabled: _pt.bool,
|
|
133
|
+
componentId: _pt.string
|
|
134
|
+
};
|
|
135
|
+
export default VerticalCardMiddleSection;
|
|
136
|
+
//# sourceMappingURL=VerticalCardMiddleSection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VerticalCardMiddleSection.js","names":["React","styled","useTheme","COLORS","ComponentS","ComponentTextStyle","ComponentXLStyling","Tag","jsx","_jsx","jsxs","_jsxs","VerticalCardMiddleSectionContainer","div","VerticalCardMiddleSectionColorBandStyles","props","$color","VerticalCardMiddleSectionTagsStyles","VerticalCardMiddleSectionCategoryStyles","generateToken","componentType","defaultVariant","theme","VerticalCardMiddleSectionTitle","h3","Bold","$disabled","VerticalCardMiddleSection","_ref","colorBandColor","categoryIcon","categoryLabel","title","description","tags","row2Tags","disabled","componentId","children","$extraTopMargin","Boolean","$bottomMargin","textStyle","color","id","className","map","x","index","label","variant","icon","propTypes","_pt","string","node","isRequired","arrayOf","shape","bool"],"sources":["../../../src/Card/VerticalCard/VerticalCardMiddleSection.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport styled, { useTheme } from 'styled-components';\r\nimport { COLORS, ComponentS, ComponentTextStyle, ComponentXL, ComponentXLStyling, Tag, TagVariants } from '../../index';\r\nimport { ReactNode } from 'react';\r\n\r\nexport interface VerticalCardMiddleSectionProps {\r\n /** Color of the band to be shown on the top of middle section. */\r\n colorBandColor?: string;\r\n /** Icon to be shown on the left side of the categoryLabel. */\r\n categoryIcon?: React.ReactNode;\r\n /** Label to be shown at the top part of the middle section. */\r\n categoryLabel?: string;\r\n /** Main title of the Card component. */\r\n title: string;\r\n /** Description of the Card. */\r\n description?: string;\r\n /** Tags to be shown under the description. */\r\n tags?: VerticalCardTag[];\r\n /** Second row of tags if needed. */\r\n row2Tags?: VerticalCardTag[];\r\n /** This property is set by Card component itself and is based on 'disabled' flag of CardProps. */\r\n disabled?: boolean;\r\n /** Top level Id of Card component */\r\n componentId?: string;\r\n}\r\n\r\nexport interface VerticalCardTag {\r\n label: string;\r\n variant?: TagVariants;\r\n icon?: ReactNode\r\n}\r\n\r\nexport const VerticalCardMiddleSectionContainer = styled.div`\r\n display: flex;\r\n flex-grow: 1;\r\n width: calc(100% - 32px);\r\n position: relative;\r\n flex-direction: column;\r\n padding: 16px;\r\n gap: 8px;\r\n\r\n .descriptionBlock {\r\n padding: 2px 0;\r\n }\r\n\r\n .titleBlock {\r\n padding: 2px 0;\r\n }\r\n`;\r\n\r\nexport const VerticalCardMiddleSectionColorBandStyles = styled.div<{ $color: string }>`\r\n position: absolute;\r\n width: 100%;\r\n top: 0px;\r\n left: 0px;\r\n height: 8px;\r\n background-color: ${(props) => props.$color};\r\n`;\r\n\r\nexport const VerticalCardMiddleSectionTagsStyles = styled.div`\r\n display: flex;\r\n flex-direction: row;\r\n padding: 4px 0;\r\n gap: 4px;\r\n flex-wrap: wrap;\r\n`;\r\n\r\nexport const VerticalCardMiddleSectionCategoryStyles = styled.div<{ $extraTopMargin: boolean; $bottomMargin: boolean }>`\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n padding: none;\r\n gap: 6px;\r\n\r\n svg {\r\n color: ${props => COLORS.generateToken({ componentType: 'text', defaultVariant: 'subtle' }, props.theme)};\r\n flex-grow: 0;\r\n flex-shrink: 0;\r\n }\r\n`;\r\n\r\nexport const VerticalCardMiddleSectionTitle = styled.h3<{ $disabled?: boolean }>`\r\n ${props => ComponentXLStyling(ComponentTextStyle.Bold, props.$disabled \r\n ? COLORS.generateToken({componentType:'text',defaultVariant:'subtle'}, props.theme)\r\n : COLORS.generateToken({componentType:'text',defaultVariant:'default'}, props.theme)\r\n )}\r\n`;\r\n\r\nconst VerticalCardMiddleSection: React.FunctionComponent<VerticalCardMiddleSectionProps> = ({\r\n colorBandColor,\r\n categoryIcon,\r\n categoryLabel,\r\n title,\r\n description,\r\n tags,\r\n row2Tags,\r\n disabled,\r\n componentId\r\n}: VerticalCardMiddleSectionProps) => {\r\n const theme = useTheme();\r\n \r\n return (\r\n <VerticalCardMiddleSectionContainer data-testid={'card-middleSection'} >\r\n {colorBandColor && <VerticalCardMiddleSectionColorBandStyles $color={colorBandColor} />}\r\n {\r\n (categoryIcon || categoryLabel) &&\r\n <VerticalCardMiddleSectionCategoryStyles $extraTopMargin={Boolean(colorBandColor)} $bottomMargin={Boolean(categoryIcon || categoryLabel)}>\r\n {categoryIcon}\r\n <ComponentS textStyle={ComponentTextStyle.Bold} color={COLORS.generateToken({componentType:'text',defaultVariant:'subtle'}, theme)}>\r\n {categoryLabel}\r\n </ComponentS>\r\n </VerticalCardMiddleSectionCategoryStyles>\r\n }\r\n <VerticalCardMiddleSectionTitle \r\n id={`${componentId}-title`} \r\n className=\"titleBlock\"\r\n $disabled={disabled}>\r\n {title}\r\n </VerticalCardMiddleSectionTitle>\r\n {description && (\r\n <ComponentS className=\"descriptionBlock\" color={COLORS.generateToken({componentType:'text',defaultVariant:'subtle'}, theme)}>\r\n {description}\r\n </ComponentS>\r\n )}\r\n {tags && (\r\n <VerticalCardMiddleSectionTagsStyles>\r\n {tags.map((x, index) => (\r\n <Tag key={`${x.label}_${index}`} label={x.label} variant={x.variant ?? 'neutral'} icon={x.icon} />\r\n ))}\r\n </VerticalCardMiddleSectionTagsStyles>\r\n )}\r\n {row2Tags && (\r\n <VerticalCardMiddleSectionTagsStyles>\r\n {row2Tags.map((x, index) => (\r\n <Tag key={`${x.label}_${index}`} label={x.label} variant={x.variant ?? 'neutral'} icon={x.icon} />\r\n ))}\r\n </VerticalCardMiddleSectionTagsStyles>\r\n )}\r\n </VerticalCardMiddleSectionContainer>\r\n );\r\n};\r\n\r\nexport default VerticalCardMiddleSection;\r\n"],"mappings":";AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,MAAM,IAAIC,QAAQ,QAAQ,mBAAmB;AACpD,SAASC,MAAM,EAAEC,UAAU,EAAEC,kBAAkB,EAAeC,kBAAkB,EAAEC,GAAG,QAAqB,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AA8BxH,OAAO,MAAMC,kCAAkC,GAAGX,MAAM,CAACY,GAAG;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAED,OAAO,MAAMC,wCAAwC,GAAGb,MAAM,CAACY,GAAuB;AACtF;AACA;AACA;AACA;AACA;AACA,sBAAuBE,KAAK,IAAKA,KAAK,CAACC,MAAM;AAC7C,CAAC;AAED,OAAO,MAAMC,mCAAmC,GA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O,EAAEH,CAAC,CAACG,OAAO,IAAI,SAAU;QAACC,IAAI,EAAEJ,CAAC,CAACI;MAAK,GAArF,GAAGJ,CAAC,CAACE,KAAK,IAAID,KAAK,EAAoE,CAClG;IAAC,CACiC,CACtC;EAAA,CACiC,CAAC;AAEzC,CAAC;AAACrB,yBAAA,CAAAyB,SAAA;EArIAvB,cAAc,EAAAwB,GAAA,CAAAC,MAAA;EAEdxB,YAAY,EAAAuB,GAAA,CAAAE,IAAA;EAEZxB,aAAa,EAAAsB,GAAA,CAAAC,MAAA;EAEbtB,KAAK,EAAAqB,GAAA,CAAAC,MAAA,CAAAE,UAAA;EAELvB,WAAW,EAAAoB,GAAA,CAAAC,MAAA;EAEXpB,IAAI,EAAAmB,GAAA,CAAAI,OAAA,CAAAJ,GAAA,CAAAK,KAAA;IAUJT,KAAK,EAAAI,GAAA,CAAAC,MAAA,CAAAE,UAAA;IAELL,IAAI,EAAAE,GAAA,CAAAE;EAAA;EAVJpB,QAAQ,EAAAkB,GAAA,CAAAI,OAAA,CAAAJ,GAAA,CAAAK,KAAA;IAQRT,KAAK,EAAAI,GAAA,CAAAC,MAAA,CAAAE,UAAA;IAELL,IAAI,EAAAE,GAAA,CAAAE;EAAA;EARJnB,QAAQ,EAAAiB,GAAA,CAAAM,IAAA;EAERtB,WAAW,EAAAgB,GAAA,CAAAC;AAAA;AAuHb,eAAe3B,yBAAyB","ignoreList":[]}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = exports.VerticalCardTopSectionTagContainer = exports.VerticalCardTopSectionRibbonContainer = exports.VerticalCardTopSectionImageContainer = exports.VerticalCardTopSectionContainer = exports.VerticalCardTopSectionCheckboxContainer = void 0;
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
var React = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
11
|
+
var _typography = require("../../styles/typography");
|
|
12
|
+
var _Checkbox = _interopRequireDefault(require("../../InputFields/Checkbox"));
|
|
13
|
+
var _Tag = require("../../Tag");
|
|
14
|
+
var _index = require("../../index");
|
|
15
|
+
var _Image = require("../../Image");
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
18
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
19
|
+
const VerticalCardTopSectionImageContainer = exports.VerticalCardTopSectionImageContainer = _styledComponents.default.div`
|
|
20
|
+
border-top-right-radius: 8px;
|
|
21
|
+
border-top-left-radius: 8px;
|
|
22
|
+
height: 100%;
|
|
23
|
+
width: 100%;
|
|
24
|
+
img{
|
|
25
|
+
object-fit: cover;
|
|
26
|
+
width: 100%;
|
|
27
|
+
height: 100%;
|
|
28
|
+
border-top-right-radius: 8px;
|
|
29
|
+
border-top-left-radius: 8px;
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
32
|
+
const VerticalCardTopSectionTagContainer = exports.VerticalCardTopSectionTagContainer = _styledComponents.default.div`
|
|
33
|
+
position: absolute;
|
|
34
|
+
|
|
35
|
+
top: 16px;
|
|
36
|
+
left: 16px;
|
|
37
|
+
width: calc(100% - 32px);
|
|
38
|
+
`;
|
|
39
|
+
const VerticalCardTopSectionContainer = exports.VerticalCardTopSectionContainer = _styledComponents.default.div`
|
|
40
|
+
position: relative;
|
|
41
|
+
width: 100%;
|
|
42
|
+
overflow: visible;
|
|
43
|
+
|
|
44
|
+
${props => props.disabled ? `
|
|
45
|
+
img, svg {
|
|
46
|
+
filter: grayscale(100%);
|
|
47
|
+
}` : ''}
|
|
48
|
+
`;
|
|
49
|
+
const VerticalCardTopSectionRibbonContainer = exports.VerticalCardTopSectionRibbonContainer = _styledComponents.default.div`
|
|
50
|
+
min-height: calc(40px - 16px);
|
|
51
|
+
background-color: ${props => props.$backgroundColor};
|
|
52
|
+
width: calc(100% - 32px);
|
|
53
|
+
position: absolute;
|
|
54
|
+
bottom: 0px;
|
|
55
|
+
left: 0px;
|
|
56
|
+
padding: 8px 16px 8px 16px;
|
|
57
|
+
display: flex;
|
|
58
|
+
flex-direction: row;
|
|
59
|
+
align-items: center;
|
|
60
|
+
gap: 8px;
|
|
61
|
+
|
|
62
|
+
svg {
|
|
63
|
+
color: ${props => props.$color};
|
|
64
|
+
width: 24px;
|
|
65
|
+
height: 24px;
|
|
66
|
+
flex-grow: 0;
|
|
67
|
+
flex-shrink: 0;
|
|
68
|
+
}
|
|
69
|
+
`;
|
|
70
|
+
const VerticalCardTopSectionCheckboxContainer = exports.VerticalCardTopSectionCheckboxContainer = _styledComponents.default.div`
|
|
71
|
+
position: absolute;
|
|
72
|
+
top: 0;
|
|
73
|
+
right: 0;
|
|
74
|
+
z-index: 120;
|
|
75
|
+
|
|
76
|
+
.checkbox-icon {
|
|
77
|
+
background-color: ${props => _index.COLORS.getColor('white', props.theme)};
|
|
78
|
+
}
|
|
79
|
+
`;
|
|
80
|
+
const VerticalCardTopSection = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
81
|
+
let {
|
|
82
|
+
selected,
|
|
83
|
+
setSelected,
|
|
84
|
+
image,
|
|
85
|
+
tagLabel,
|
|
86
|
+
tagIcon,
|
|
87
|
+
tagVariant = 'positive',
|
|
88
|
+
highlightRibbonIcon,
|
|
89
|
+
highlightRibbonText,
|
|
90
|
+
highlightRibbonContentColor,
|
|
91
|
+
highlightRibbonBgColor,
|
|
92
|
+
disabled
|
|
93
|
+
} = _ref;
|
|
94
|
+
const theme = (0, _styledComponents.useTheme)();
|
|
95
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(VerticalCardTopSectionContainer, {
|
|
96
|
+
disabled: disabled,
|
|
97
|
+
"data-testid": 'card-topSection',
|
|
98
|
+
style: {
|
|
99
|
+
height: image?.height ?? 200
|
|
100
|
+
},
|
|
101
|
+
children: [image && /*#__PURE__*/(0, _jsxRuntime.jsx)(VerticalCardTopSectionImageContainer, {
|
|
102
|
+
role: "none",
|
|
103
|
+
"aria-hidden": "true",
|
|
104
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Image.ImageWithFallbacks, {
|
|
105
|
+
fallbacks: image.fallbackSrc ?? '',
|
|
106
|
+
src: image.src,
|
|
107
|
+
alt: "",
|
|
108
|
+
loader: image.loader ?? false,
|
|
109
|
+
width: image.width,
|
|
110
|
+
height: image.height
|
|
111
|
+
})
|
|
112
|
+
}), (!!selected || !!setSelected) && /*#__PURE__*/(0, _jsxRuntime.jsx)(VerticalCardTopSectionCheckboxContainer, {
|
|
113
|
+
"data-testid": 'card-topSection-checkbox',
|
|
114
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Checkbox.default, {
|
|
115
|
+
ref: ref,
|
|
116
|
+
disabled: disabled,
|
|
117
|
+
select: selected => setSelected && setSelected(selected),
|
|
118
|
+
selected: selected || false
|
|
119
|
+
})
|
|
120
|
+
}), (tagLabel || tagIcon) && /*#__PURE__*/(0, _jsxRuntime.jsx)(VerticalCardTopSectionTagContainer, {
|
|
121
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tag.Tag, {
|
|
122
|
+
label: tagLabel,
|
|
123
|
+
variant: tagVariant,
|
|
124
|
+
icon: tagIcon
|
|
125
|
+
})
|
|
126
|
+
}), (highlightRibbonIcon || highlightRibbonText) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(VerticalCardTopSectionRibbonContainer, {
|
|
127
|
+
"data-testid": 'card-topSection-ribbon',
|
|
128
|
+
$color: highlightRibbonContentColor ?? '',
|
|
129
|
+
$backgroundColor: disabled ? _index.COLORS.generateToken({
|
|
130
|
+
componentType: 'bg-fill',
|
|
131
|
+
state: 'disabled'
|
|
132
|
+
}, theme) : highlightRibbonBgColor ?? '',
|
|
133
|
+
children: [highlightRibbonIcon, highlightRibbonText && /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.ComponentS, {
|
|
134
|
+
color: disabled ? _index.COLORS.generateToken({
|
|
135
|
+
componentType: 'text',
|
|
136
|
+
isOnFill: true,
|
|
137
|
+
state: 'disabled'
|
|
138
|
+
}, theme) : highlightRibbonContentColor ?? '',
|
|
139
|
+
textStyle: _typography.ComponentTextStyle.Regular,
|
|
140
|
+
children: highlightRibbonText
|
|
141
|
+
})]
|
|
142
|
+
})]
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
VerticalCardTopSection.propTypes = {
|
|
146
|
+
selected: _propTypes.default.bool,
|
|
147
|
+
setSelected: _propTypes.default.func,
|
|
148
|
+
tagLabel: _propTypes.default.string,
|
|
149
|
+
tagIcon: _propTypes.default.node,
|
|
150
|
+
highlightRibbonText: _propTypes.default.string,
|
|
151
|
+
highlightRibbonIcon: _propTypes.default.node,
|
|
152
|
+
highlightRibbonContentColor: _propTypes.default.string,
|
|
153
|
+
highlightRibbonBgColor: _propTypes.default.string,
|
|
154
|
+
image: _propTypes.default.shape({
|
|
155
|
+
src: _propTypes.default.string.isRequired,
|
|
156
|
+
fallbackSrc: _propTypes.default.string,
|
|
157
|
+
alt: _propTypes.default.string.isRequired,
|
|
158
|
+
height: _propTypes.default.string,
|
|
159
|
+
width: _propTypes.default.string,
|
|
160
|
+
loader: _propTypes.default.bool
|
|
161
|
+
}),
|
|
162
|
+
disabled: _propTypes.default.bool
|
|
163
|
+
};
|
|
164
|
+
var _default = exports.default = VerticalCardTopSection;
|
|
165
|
+
//# sourceMappingURL=VerticalCardTopSection.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VerticalCardTopSection.cjs","names":["React","_interopRequireWildcard","require","_styledComponents","_typography","_Checkbox","_interopRequireDefault","_Tag","_index","_Image","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","VerticalCardTopSectionImageContainer","exports","styled","div","VerticalCardTopSectionTagContainer","VerticalCardTopSectionContainer","props","disabled","VerticalCardTopSectionRibbonContainer","$backgroundColor","$color","VerticalCardTopSectionCheckboxContainer","COLORS","getColor","theme","VerticalCardTopSection","forwardRef","_ref","ref","selected","setSelected","image","tagLabel","tagIcon","tagVariant","highlightRibbonIcon","highlightRibbonText","highlightRibbonContentColor","highlightRibbonBgColor","useTheme","jsxs","style","height","children","jsx","role","ImageWithFallbacks","fallbacks","fallbackSrc","src","alt","loader","width","select","Tag","label","variant","icon","generateToken","componentType","state","ComponentS","color","isOnFill","textStyle","ComponentTextStyle","Regular","propTypes","_propTypes","bool","func","string","node","shape","isRequired","_default"],"sources":["../../../src/Card/VerticalCard/VerticalCardTopSection.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport styled, { useTheme } from 'styled-components';\r\nimport {ComponentS, ComponentTextStyle} from '../../styles/typography';\r\nimport Checkbox from '../../InputFields/Checkbox';\r\nimport {Tag, TagVariants} from '../../Tag';\r\n\r\nimport {COLORS} from '../../index';\r\nimport {ImageWithFallbacks} from \"../../Image\";\r\n\r\nexport interface VerticalCardTopSectionProps {\r\n /** Sets initial state of select Checkbox. */\r\n selected?: boolean;\r\n /** If this action is provided, then Checkbox will be shown on the top-right corner of the Card. */\r\n setSelected?: (arg0: boolean) => void;\r\n /** Label shown in the tag in the top-left corner of the Card. */\r\n tagLabel?: string;\r\n /** Icon shown in the tag in the top-left corner of the Card. */\r\n tagIcon?: React.ReactNode;\r\n /** Tag variant shown in the tag in the top-left corner of the Card. */\r\n tagVariant?: TagVariants;\r\n /** Text shown in the Ribbon, under the Image. */\r\n highlightRibbonText?: string;\r\n /** Icon shown in the Ribbon, under the Image. */\r\n highlightRibbonIcon?: React.ReactNode;\r\n /** Content color (text and image) of the Ribbon, under the Image. */\r\n highlightRibbonContentColor?: string;\r\n /** Background color of the Ribbon, shown under the Image. */\r\n highlightRibbonBgColor?: string;\r\n /** Details of the Image shown in the section. */\r\n image?: { src: string; fallbackSrc?: string; alt: string, height?: string; width?: string; loader?: boolean };\r\n /** This property is automatically set in the Card itself and is based on 'disabled' flag of CardProps. */\r\n disabled?: boolean;\r\n}\r\n\r\nexport const VerticalCardTopSectionImageContainer = styled.div`\r\n border-top-right-radius: 8px;\r\n border-top-left-radius: 8px;\r\n height: 100%;\r\n width: 100%;\r\n img{\r\n object-fit: cover;\r\n width: 100%;\r\n height: 100%;\r\n border-top-right-radius: 8px;\r\n border-top-left-radius: 8px;\r\n }\r\n`;\r\n\r\nexport const VerticalCardTopSectionTagContainer = styled.div`\r\n position: absolute;\r\n\r\n top: 16px;\r\n left: 16px;\r\n width: calc(100% - 32px);\r\n`;\r\n\r\nexport const VerticalCardTopSectionContainer = styled.div<{ disabled?: boolean }>`\r\n position: relative;\r\n width: 100%;\r\n overflow: visible;\r\n\r\n ${props => props.disabled ? `\r\n img, svg {\r\n filter: grayscale(100%);\r\n }` : ''}\r\n`;\r\n\r\nexport const VerticalCardTopSectionRibbonContainer = styled.div<{ $color: string; $backgroundColor: string }>`\r\n min-height: calc(40px - 16px);\r\n background-color: ${props => props.$backgroundColor};\r\n width: calc(100% - 32px);\r\n position: absolute;\r\n bottom: 0px;\r\n left: 0px;\r\n padding: 8px 16px 8px 16px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n gap: 8px;\r\n\r\n svg {\r\n color: ${props => props.$color};\r\n width: 24px;\r\n height: 24px;\r\n flex-grow: 0;\r\n flex-shrink: 0;\r\n }\r\n`;\r\n\r\nexport const VerticalCardTopSectionCheckboxContainer = styled.div`\r\n position: absolute;\r\n top: 0;\r\n right: 0;\r\n z-index: 120;\r\n\r\n .checkbox-icon {\r\n background-color: ${props => COLORS.getColor('white', props.theme)};\r\n }\r\n`;\r\n\r\nconst VerticalCardTopSection = React.forwardRef(({\r\n selected,\r\n setSelected,\r\n image,\r\n tagLabel,\r\n tagIcon,\r\n tagVariant = 'positive',\r\n highlightRibbonIcon,\r\n highlightRibbonText,\r\n highlightRibbonContentColor,\r\n highlightRibbonBgColor,\r\n disabled\r\n }: VerticalCardTopSectionProps, ref: React.Ref<HTMLDivElement>) => {\r\n\r\n const theme = useTheme();\r\n return (\r\n <VerticalCardTopSectionContainer disabled={disabled} data-testid={'card-topSection'} style={{height: image?.height ?? 200}}>\r\n {\r\n image &&\r\n <VerticalCardTopSectionImageContainer role=\"none\" aria-hidden=\"true\">\r\n <ImageWithFallbacks fallbacks={image.fallbackSrc ?? ''} src={image.src} alt=\"\" loader={image.loader ?? false} width={image.width} height={image.height}/>\r\n </VerticalCardTopSectionImageContainer>\r\n }\r\n {(!!selected || !!setSelected) && (\r\n <VerticalCardTopSectionCheckboxContainer data-testid={'card-topSection-checkbox'}>\r\n <Checkbox ref={ref}\r\n disabled={disabled}\r\n select={(selected: boolean) => setSelected && setSelected(selected)}\r\n selected={selected || false}/>\r\n </VerticalCardTopSectionCheckboxContainer>\r\n )}\r\n {(tagLabel || tagIcon) && (\r\n <VerticalCardTopSectionTagContainer>\r\n <Tag label={tagLabel} variant={tagVariant} icon={tagIcon}/>\r\n </VerticalCardTopSectionTagContainer>\r\n )}\r\n {(highlightRibbonIcon || highlightRibbonText) && (\r\n <VerticalCardTopSectionRibbonContainer data-testid={'card-topSection-ribbon'} $color={highlightRibbonContentColor ?? ''}\r\n $backgroundColor={disabled ? COLORS.generateToken({componentType:'bg-fill', state:'disabled'}, theme) : highlightRibbonBgColor ?? ''}>\r\n {highlightRibbonIcon}\r\n {highlightRibbonText && (\r\n <ComponentS color={disabled ? COLORS.generateToken({componentType:'text', isOnFill: true, state:'disabled'}, theme) : highlightRibbonContentColor ?? ''} textStyle={ComponentTextStyle.Regular}>\r\n {highlightRibbonText}\r\n </ComponentS>\r\n )}\r\n </VerticalCardTopSectionRibbonContainer>\r\n )}\r\n </VerticalCardTopSectionContainer>\r\n );\r\n});\r\n\r\nexport default VerticalCardTopSection;\r\n"],"mappings":";;;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAF,uBAAA,CAAAC,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,IAAA,GAAAL,OAAA;AAEA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAA+C,IAAAQ,WAAA,GAAAR,OAAA;AAAA,SAAAS,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAX,wBAAAW,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UA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AAf,OAAA,GAwHK6B,sBAAsB","ignoreList":[]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { TagVariants } from '../../Tag';
|
|
3
|
+
export interface VerticalCardTopSectionProps {
|
|
4
|
+
/** Sets initial state of select Checkbox. */
|
|
5
|
+
selected?: boolean;
|
|
6
|
+
/** If this action is provided, then Checkbox will be shown on the top-right corner of the Card. */
|
|
7
|
+
setSelected?: (arg0: boolean) => void;
|
|
8
|
+
/** Label shown in the tag in the top-left corner of the Card. */
|
|
9
|
+
tagLabel?: string;
|
|
10
|
+
/** Icon shown in the tag in the top-left corner of the Card. */
|
|
11
|
+
tagIcon?: React.ReactNode;
|
|
12
|
+
/** Tag variant shown in the tag in the top-left corner of the Card. */
|
|
13
|
+
tagVariant?: TagVariants;
|
|
14
|
+
/** Text shown in the Ribbon, under the Image. */
|
|
15
|
+
highlightRibbonText?: string;
|
|
16
|
+
/** Icon shown in the Ribbon, under the Image. */
|
|
17
|
+
highlightRibbonIcon?: React.ReactNode;
|
|
18
|
+
/** Content color (text and image) of the Ribbon, under the Image. */
|
|
19
|
+
highlightRibbonContentColor?: string;
|
|
20
|
+
/** Background color of the Ribbon, shown under the Image. */
|
|
21
|
+
highlightRibbonBgColor?: string;
|
|
22
|
+
/** Details of the Image shown in the section. */
|
|
23
|
+
image?: {
|
|
24
|
+
src: string;
|
|
25
|
+
fallbackSrc?: string;
|
|
26
|
+
alt: string;
|
|
27
|
+
height?: string;
|
|
28
|
+
width?: string;
|
|
29
|
+
loader?: boolean;
|
|
30
|
+
};
|
|
31
|
+
/** This property is automatically set in the Card itself and is based on 'disabled' flag of CardProps. */
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export declare const VerticalCardTopSectionImageContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
35
|
+
export declare const VerticalCardTopSectionTagContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
36
|
+
export declare const VerticalCardTopSectionContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
}>> & string;
|
|
39
|
+
export declare const VerticalCardTopSectionRibbonContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
40
|
+
$color: string;
|
|
41
|
+
$backgroundColor: string;
|
|
42
|
+
}>> & string;
|
|
43
|
+
export declare const VerticalCardTopSectionCheckboxContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
44
|
+
declare const VerticalCardTopSection: React.ForwardRefExoticComponent<VerticalCardTopSectionProps & React.RefAttributes<HTMLDivElement>>;
|
|
45
|
+
export default VerticalCardTopSection;
|