@ntbjs/react-components 2.0.9-rc.2 → 2.0.9-rc.4
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/build/data/Badge/Badge.js +5 -2
- package/build/data/Badge/Badge.js.map +1 -1
- package/build/data/Badge/Badge.styled.js +6 -1
- package/build/data/Badge/Badge.styled.js.map +1 -1
- package/build/icons/index.js +2 -0
- package/build/icons/info-red.svg +11 -0
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.js +6 -3
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.js.map +1 -1
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.js +4 -4
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.js.map +1 -1
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.styled.js +5 -1
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.styled.js.map +1 -1
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.js +3 -3
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.js.map +1 -1
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.styled.js +5 -1
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.styled.js.map +1 -1
- package/build/widgets/AssetGallery/asset.propType.js +2 -2
- package/build/widgets/AssetGallery/asset.propType.js.map +1 -1
- package/build/widgets/{InstructionsSeverityDisplay/InstructionsSeverityDisplay.js → InstructionSeverityDisplay/InstructionSeverityDisplay.js} +50 -13
- package/build/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.js.map +1 -0
- package/build/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.styled.js +52 -0
- package/build/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.styled.js.map +1 -0
- package/build/widgets/SummaryCard/SummaryCard.js +8 -7
- package/build/widgets/SummaryCard/SummaryCard.js.map +1 -1
- package/build/widgets/SummaryCard/SummaryCard.styled.js +6 -1
- package/build/widgets/SummaryCard/SummaryCard.styled.js.map +1 -1
- package/build/widgets/index.js +1 -1
- package/icons/index.js +2 -0
- package/icons/info-red.svg +11 -0
- package/package.json +1 -1
- package/build/widgets/InstructionsSeverityDisplay/InstructionsSeverityDisplay.js.map +0 -1
- package/build/widgets/InstructionsSeverityDisplay/InstructionsSeverityDisplay.styled.js +0 -77
- package/build/widgets/InstructionsSeverityDisplay/InstructionsSeverityDisplay.styled.js.map +0 -1
|
@@ -28,12 +28,12 @@ const assetShape = {
|
|
|
28
28
|
onClick: PropTypes.func,
|
|
29
29
|
onContextMenu: PropTypes.func,
|
|
30
30
|
onMouseEnter: PropTypes.func,
|
|
31
|
-
|
|
31
|
+
instructionSeverity: PropTypes.oneOf([1, 2, 3, 4, 5]),
|
|
32
32
|
summary: PropTypes.shape({
|
|
33
33
|
title: PropTypes.string,
|
|
34
34
|
description: PropTypes.string,
|
|
35
35
|
instructions: PropTypes.string,
|
|
36
|
-
|
|
36
|
+
instructionSeverity: PropTypes.oneOf([1, 2, 3, 4, 5]),
|
|
37
37
|
headerLeft: PropTypes.node,
|
|
38
38
|
headerRight: PropTypes.node,
|
|
39
39
|
footerLeft: PropTypes.node,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asset.propType.js","sources":["../../../src/components/widgets/AssetGallery/asset.propType.js"],"sourcesContent":["import PropTypes from 'prop-types';\n\nexport const assetShape = {\n key: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\n previewUrl: PropTypes.string,\n title: PropTypes.string,\n note: PropTypes.shape({\n icon: PropTypes.element,\n message: PropTypes.string\n }),\n width: PropTypes.number,\n height: PropTypes.number,\n fileType: PropTypes.oneOf(['image', 'video', 'pdf', 'file', 'audio']).isRequired,\n fileTypeIconPosition: PropTypes.oneOf(['top-left', 'top-right']),\n group: PropTypes.string,\n actions: PropTypes.arrayOf(\n PropTypes.shape({\n title: PropTypes.string.isRequired,\n icon: PropTypes.element.isRequired,\n onClick: PropTypes.func.isRequired,\n className: PropTypes.shape,\n component: PropTypes.func\n })\n ),\n statusIcon: PropTypes.element,\n overlay: PropTypes.element,\n completed: PropTypes.bool,\n hasError: PropTypes.bool,\n disabled: PropTypes.bool,\n onClick: PropTypes.func,\n onContextMenu: PropTypes.func,\n onMouseEnter: PropTypes.func,\n
|
|
1
|
+
{"version":3,"file":"asset.propType.js","sources":["../../../src/components/widgets/AssetGallery/asset.propType.js"],"sourcesContent":["import PropTypes from 'prop-types';\n\nexport const assetShape = {\n key: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\n previewUrl: PropTypes.string,\n title: PropTypes.string,\n note: PropTypes.shape({\n icon: PropTypes.element,\n message: PropTypes.string\n }),\n width: PropTypes.number,\n height: PropTypes.number,\n fileType: PropTypes.oneOf(['image', 'video', 'pdf', 'file', 'audio']).isRequired,\n fileTypeIconPosition: PropTypes.oneOf(['top-left', 'top-right']),\n group: PropTypes.string,\n actions: PropTypes.arrayOf(\n PropTypes.shape({\n title: PropTypes.string.isRequired,\n icon: PropTypes.element.isRequired,\n onClick: PropTypes.func.isRequired,\n className: PropTypes.shape,\n component: PropTypes.func\n })\n ),\n statusIcon: PropTypes.element,\n overlay: PropTypes.element,\n completed: PropTypes.bool,\n hasError: PropTypes.bool,\n disabled: PropTypes.bool,\n onClick: PropTypes.func,\n onContextMenu: PropTypes.func,\n onMouseEnter: PropTypes.func,\n instructionSeverity: PropTypes.oneOf([1, 2, 3, 4, 5]),\n summary: PropTypes.shape({\n title: PropTypes.string,\n description: PropTypes.string,\n instructions: PropTypes.string,\n instructionSeverity: PropTypes.oneOf([1, 2, 3, 4, 5]),\n headerLeft: PropTypes.node,\n headerRight: PropTypes.node,\n footerLeft: PropTypes.node,\n footerRight: PropTypes.node\n })\n};\n\nexport const assetShapeWithLayout = {\n ...assetShape,\n layout: PropTypes.shape({\n width: PropTypes.number.isRequired,\n height: PropTypes.number.isRequired,\n translateX: PropTypes.number.isRequired,\n translateY: PropTypes.number.isRequired,\n type: PropTypes.oneOf(['groupLabel', 'asset']).isRequired,\n hasHeightAndWidth: PropTypes.bool\n }).isRequired\n};\n"],"names":["assetShape","key","PropTypes","oneOfType","string","number","isRequired","previewUrl","title","note","shape","icon","element","message","width","height","fileType","oneOf","fileTypeIconPosition","group","actions","arrayOf","onClick","func","className","component","statusIcon","overlay","completed","bool","hasError","disabled","onContextMenu","onMouseEnter","instructionSeverity","summary","description","instructions","headerLeft","node","headerRight","footerLeft","footerRight","assetShapeWithLayout","layout","translateX","translateY","type","hasHeightAndWidth"],"mappings":";;AAEO,MAAMA,UAAU,GAAG;AACxBC,EAAAA,GAAG,EAAEC,SAAS,CAACC,SAAS,CAAC,CAACD,SAAS,CAACE,MAAM,EAAEF,SAAS,CAACG,MAAM,CAAC,CAAC,CAACC,UAAU;EACzEC,UAAU,EAAEL,SAAS,CAACE,MAAM;EAC5BI,KAAK,EAAEN,SAAS,CAACE,MAAM;AACvBK,EAAAA,IAAI,EAAEP,SAAS,CAACQ,KAAK,CAAC;IACpBC,IAAI,EAAET,SAAS,CAACU,OAAO;IACvBC,OAAO,EAAEX,SAAS,CAACE,MAAAA;AACrB,GAAC,CAAC;EACFU,KAAK,EAAEZ,SAAS,CAACG,MAAM;EACvBU,MAAM,EAAEb,SAAS,CAACG,MAAM;AACxBW,EAAAA,QAAQ,EAAEd,SAAS,CAACe,KAAK,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAACX,UAAU;EAChFY,oBAAoB,EAAEhB,SAAS,CAACe,KAAK,CAAC,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;EAChEE,KAAK,EAAEjB,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3BE,UAAU,EAAEvC,SAAS,CAACqC,IAAI;IAC1BG,WAAW,EAAExC,SAAS,CAACqC,IAAAA;GACxB,CAAA;AACH,EAAC;AAEM,MAAMI,oBAAoB,GAAG;AAClC,EAAA,GAAG3C,UAAU;AACb4C,EAAAA,MAAM,EAAE1C,SAAS,CAACQ,KAAK,CAAC;AACtBI,IAAAA,KAAK,EAAEZ,SAAS,CAACG,MAAM,CAACC,UAAU;AAClCS,IAAAA,MAAM,EAAEb,SAAS,CAACG,MAAM,CAACC,UAAU;AACnCuC,IAAAA,UAAU,EAAE3C,SAAS,CAACG,MAAM,CAACC,UAAU;AACvCwC,IAAAA,UAAU,EAAE5C,SAAS,CAACG,MAAM,CAACC,UAAU;AACvCyC,IAAAA,IAAI,EAAE7C,SAAS,CAACe,KAAK,CAAC,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAACX,UAAU;IACzD0C,iBAAiB,EAAE9C,SAAS,CAAC2B,IAAAA;AAC/B,GAAC,CAAC,CAACvB,UAAAA;AACL;;;;"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import
|
|
4
|
+
import Badge from '../../data/Badge/Badge.js';
|
|
5
|
+
import { Card, InstructionText } from './InstructionSeverityDisplay.styled.js';
|
|
5
6
|
|
|
6
7
|
const InformationIcon = () => React__default.createElement("svg", {
|
|
7
8
|
width: "12",
|
|
@@ -20,7 +21,31 @@ const defaultLabels = {
|
|
|
20
21
|
4: 'Limited use',
|
|
21
22
|
5: 'Highly restricted'
|
|
22
23
|
};
|
|
23
|
-
const
|
|
24
|
+
const severityBadgeProps = {
|
|
25
|
+
1: {
|
|
26
|
+
backgroundColors: ['#272727', '#ffffff'],
|
|
27
|
+
colors: ['#d9dce0', '#202435'],
|
|
28
|
+
borderColors: ['#3a3a3a', '#ece4e1']
|
|
29
|
+
},
|
|
30
|
+
2: {
|
|
31
|
+
backgroundColors: ['#272727', '#ffffff'],
|
|
32
|
+
colors: ['#d9dce0', '#202435'],
|
|
33
|
+
borderColors: ['#3a3a3a', '#ece4e1']
|
|
34
|
+
},
|
|
35
|
+
3: {
|
|
36
|
+
backgroundColors: ['#2e2301', '#faeeb3'],
|
|
37
|
+
colors: ['#eab308', '#78350F']
|
|
38
|
+
},
|
|
39
|
+
4: {
|
|
40
|
+
backgroundColors: ['#2e2301', '#faeeb3'],
|
|
41
|
+
colors: ['#eab308', '#78350F']
|
|
42
|
+
},
|
|
43
|
+
5: {
|
|
44
|
+
backgroundColors: ['#7E1B1B', 'rgba(182, 41, 2, 0.1)'],
|
|
45
|
+
colors: ['#e8d5d6', '#b62902']
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
const InstructionSeverityDisplay = React__default.forwardRef(function InstructionSeverityDisplay({
|
|
24
49
|
severity,
|
|
25
50
|
instructionText,
|
|
26
51
|
severityLabel,
|
|
@@ -32,6 +57,7 @@ const InstructionsSeverityDisplay = React__default.forwardRef(function Instructi
|
|
|
32
57
|
detailsFontSize,
|
|
33
58
|
bgLight,
|
|
34
59
|
bgDark,
|
|
60
|
+
maxLines,
|
|
35
61
|
...props
|
|
36
62
|
}, forwardedRef) {
|
|
37
63
|
if (!instructionText) {
|
|
@@ -45,15 +71,25 @@ const InstructionsSeverityDisplay = React__default.forwardRef(function Instructi
|
|
|
45
71
|
$padding: padding,
|
|
46
72
|
$bgLight: bgLight,
|
|
47
73
|
$bgDark: bgDark
|
|
48
|
-
}, props), React__default.createElement(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
74
|
+
}, props), React__default.createElement(Badge, {
|
|
75
|
+
badgeIcon: icon || React__default.createElement(InformationIcon, null),
|
|
76
|
+
badgeContent: displayLabel,
|
|
77
|
+
backgroundColors: (severityBadgeProps[severity] || severityBadgeProps[1]).backgroundColors,
|
|
78
|
+
colors: (severityBadgeProps[severity] || severityBadgeProps[1]).colors,
|
|
79
|
+
borderColors: (severityBadgeProps[severity] || severityBadgeProps[1]).borderColors,
|
|
80
|
+
fontSize: badgeFontSize ? parseInt(badgeFontSize, 10) : 12,
|
|
81
|
+
fontWeight: 500,
|
|
82
|
+
height: 24,
|
|
83
|
+
horizontalPadding: 8,
|
|
84
|
+
verticalPadding: 2
|
|
85
|
+
}), React__default.createElement(InstructionText, {
|
|
86
|
+
$fontSize: detailsFontSize,
|
|
87
|
+
$maxLines: maxLines
|
|
88
|
+
}, maxLines ? React__default.createElement("span", {
|
|
89
|
+
title: instructionText
|
|
90
|
+
}, instructionText) : instructionText));
|
|
55
91
|
});
|
|
56
|
-
|
|
92
|
+
InstructionSeverityDisplay.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
57
93
|
severity: PropTypes.oneOf([1, 2, 3, 4, 5]),
|
|
58
94
|
instructionText: PropTypes.string,
|
|
59
95
|
severityLabel: PropTypes.string,
|
|
@@ -64,8 +100,9 @@ InstructionsSeverityDisplay.propTypes = process.env.NODE_ENV !== "production" ?
|
|
|
64
100
|
badgeFontSize: PropTypes.string,
|
|
65
101
|
detailsFontSize: PropTypes.string,
|
|
66
102
|
bgLight: PropTypes.string,
|
|
67
|
-
bgDark: PropTypes.string
|
|
103
|
+
bgDark: PropTypes.string,
|
|
104
|
+
maxLines: PropTypes.number
|
|
68
105
|
} : {};
|
|
69
106
|
|
|
70
|
-
export {
|
|
71
|
-
//# sourceMappingURL=
|
|
107
|
+
export { InstructionSeverityDisplay as default };
|
|
108
|
+
//# sourceMappingURL=InstructionSeverityDisplay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InstructionSeverityDisplay.js","sources":["../../../src/components/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Badge from '../../data/Badge/Badge';\nimport * as S from './InstructionSeverityDisplay.styled';\n\nconst InformationIcon = () => (\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M6 11C3.2385 11 1 8.7615 1 6C1 3.2385 3.2385 1 6 1C8.7615 1 11 3.2385 11 6C11 8.7615 8.7615 11 6 11ZM6 10C7.06087 10 8.07828 9.57857 8.82843 8.82843C9.57857 8.07828 10 7.06087 10 6C10 4.93913 9.57857 3.92172 8.82843 3.17157C8.07828 2.42143 7.06087 2 6 2C4.93913 2 3.92172 2.42143 3.17157 3.17157C2.42143 3.92172 2 4.93913 2 6C2 7.06087 2.42143 8.07828 3.17157 8.82843C3.92172 9.57857 4.93913 10 6 10ZM5.5 3.5H6.5V4.5H5.5V3.5ZM5.5 5.5H6.5V8.5H5.5V5.5Z\"\n fill=\"currentColor\"\n />\n </svg>\n);\n\nconst defaultLabels = {\n 1: 'Info',\n 2: 'Info',\n 3: 'Limited use',\n 4: 'Limited use',\n 5: 'Highly restricted'\n};\n\nconst severityBadgeProps = {\n 1: {\n backgroundColors: ['#272727', '#ffffff'],\n colors: ['#d9dce0', '#202435'],\n borderColors: ['#3a3a3a', '#ece4e1']\n },\n 2: {\n backgroundColors: ['#272727', '#ffffff'],\n colors: ['#d9dce0', '#202435'],\n borderColors: ['#3a3a3a', '#ece4e1']\n },\n 3: { backgroundColors: ['#2e2301', '#faeeb3'], colors: ['#eab308', '#78350F'] },\n 4: { backgroundColors: ['#2e2301', '#faeeb3'], colors: ['#eab308', '#78350F'] },\n 5: { backgroundColors: ['#7E1B1B', 'rgba(182, 41, 2, 0.1)'], colors: ['#e8d5d6', '#b62902'] }\n};\n\nconst InstructionSeverityDisplay = React.forwardRef(function InstructionSeverityDisplay(\n {\n severity,\n instructionText,\n severityLabel,\n labels,\n icon,\n showCard = true,\n padding,\n badgeFontSize,\n detailsFontSize,\n bgLight,\n bgDark,\n maxLines,\n ...props\n },\n forwardedRef\n) {\n if (!instructionText) {\n return null;\n }\n\n const displayLabel =\n severityLabel || (labels && labels[severity]) || defaultLabels[severity] || defaultLabels[1];\n\n return (\n <S.Card\n ref={forwardedRef}\n $severity={severity}\n $showCard={showCard}\n $padding={padding}\n $bgLight={bgLight}\n $bgDark={bgDark}\n {...props}\n >\n <Badge\n badgeIcon={icon || <InformationIcon />}\n badgeContent={displayLabel}\n backgroundColors={(severityBadgeProps[severity] || severityBadgeProps[1]).backgroundColors}\n colors={(severityBadgeProps[severity] || severityBadgeProps[1]).colors}\n borderColors={(severityBadgeProps[severity] || severityBadgeProps[1]).borderColors}\n fontSize={badgeFontSize ? parseInt(badgeFontSize, 10) : 12}\n fontWeight={500}\n height={24}\n horizontalPadding={8}\n verticalPadding={2}\n />\n <S.InstructionText $fontSize={detailsFontSize} $maxLines={maxLines}>\n {maxLines ? <span title={instructionText}>{instructionText}</span> : instructionText}\n </S.InstructionText>\n </S.Card>\n );\n});\n\nInstructionSeverityDisplay.propTypes = {\n /** Severity level (1-5). 1=Info, 3=Limited use, 5=Highly restricted. */\n severity: PropTypes.oneOf([1, 2, 3, 4, 5]),\n /** The instruction text to display. Component returns null if empty. */\n instructionText: PropTypes.string,\n /** Override the default badge label for the severity level. */\n severityLabel: PropTypes.string,\n /** Map of severity level to translated label string, e.g. { 1: 'Info', 3: 'Begrenset bruk', 5: 'Svært begrenset' }. */\n labels: PropTypes.objectOf(PropTypes.string),\n /** Override the default icon element. */\n icon: PropTypes.element,\n /** Whether to show card styling (border-radius, shadow, border). Defaults to true. */\n showCard: PropTypes.bool,\n /** Custom card padding, e.g. \"8px 6px\" or \"20px\". Defaults to \"14px 10px\". */\n padding: PropTypes.string,\n /** Custom font size for the badge text, e.g. \"10px\" or \"0.75rem\". Defaults to \"12px\". */\n badgeFontSize: PropTypes.string,\n /** Custom font size for the details/instruction text, e.g. \"12px\" or \"0.875rem\". Defaults to \"14px\". */\n detailsFontSize: PropTypes.string,\n /** Override card background color in light mode, e.g. \"#ffffff\" or \"transparent\". */\n bgLight: PropTypes.string,\n /** Override card background color in dark mode, e.g. \"#1a1a1a\" or \"transparent\". */\n bgDark: PropTypes.string,\n /** Max number of lines for instruction text before clamping with ellipsis. */\n maxLines: PropTypes.number\n};\n\nexport default InstructionSeverityDisplay;\n"],"names":["InformationIcon","React","createElement","width","height","viewBox","fill","xmlns","d","defaultLabels","severityBadgeProps","backgroundColors","colors","borderColors","InstructionSeverityDisplay","forwardRef","severity","instructionText","severityLabel","labels","icon","showCard","padding","badgeFontSize","detailsFontSize","bgLight","bgDark","maxLines","props","forwardedRef","displayLabel","S","_extends","ref","$severity","$showCard","$padding","$bgLight","$bgDark","Badge","badgeIcon","badgeContent","fontSize","parseInt","fontWeight","horizontalPadding","verticalPadding","$fontSize","$maxLines","title","propTypes","process","env","NODE_ENV","PropTypes","oneOf","string","objectOf","element","bool","number"],"mappings":";;;;;;AAKA,MAAMA,eAAe,GAAGA,MACtBC,cAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AAAKC,EAAAA,KAAK,EAAC,IAAI;AAACC,EAAAA,MAAM,EAAC,IAAI;AAACC,EAAAA,OAAO,EAAC,WAAW;AAACC,EAAAA,IAAI,EAAC,MAAM;AAACC,EAAAA,KAAK,EAAC,4BAAA;AAA4B,CAC5FN,EAAAA,cAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AACEM,EAAAA,CAAC,EAAC,ocAAoc;AACtcF,EAAAA,IAAI,EAAC,cAAA;AAAc,CACpB,CACE,CACN,CAAA;AAED,MAAMG,aAAa,GAAG;AACpB,EAAA,CAAC,EAAE,MAAM;AACT,EAAA,CAAC,EAAE,MAAM;AACT,EAAA,CAAC,EAAE,aAAa;AAChB,EAAA,CAAC,EAAE,aAAa;AAChB,EAAA,CAAC,EAAE,mBAAA;AACL,CAAC,CAAA;AAED,MAAMC,kBAAkB,GAAG;AACzB,EAAA,CAAC,EAAE;AACDC,IAAAA,gBAAgB,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC;AACxCC,IAAA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A,QAAQ,GAAG1B,cAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AAAM+C,IAAAA,KAAK,EAAEhC,eAAAA;AAAgB,GAAA,EAAEA,eAAsB,CAAC,GAAGA,eACpD,CACb,CAAC,CAAA;AAEb,CAAC,EAAC;AAEFH,0BAA0B,CAACoC,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,KAAG,YAAA,GAAA;AAErCrC,EAAAA,QAAQ,EAAEsC,SAAS,CAACC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;EAE1CtC,eAAe,EAAEqC,SAAS,CAACE,MAAM;EAEjCtC,aAAa,EAAEoC,SAAS,CAACE,MAAM;EAE/BrC,MAAM,EAAEmC,SAAS,CAACG,QAAQ,CAACH,SAAS,CAACE,MAAM,CAAC;EAE5CpC,IAAI,EAAEkC,SAAS,CAACI,OAAO;EAEvBrC,QAAQ,EAAEiC,SAAS,CAACK,IAAI;EAExBrC,OAAO,EAAEgC,SAAS,CAACE,MAAM;EAEzBjC,aAAa,EAAE+B,SAAS,CAACE,MAAM;EAE/BhC,eAAe,EAAE8B,SAAS,CAACE,MAAM;EAEjC/B,OAAO,EAAE6B,SAAS,CAACE,MAAM;EAEzB9B,MAAM,EAAE4B,SAAS,CAACE,MAAM;EAExB7B,QAAQ,EAAE2B,SAAS,CAACM,MAAAA;AACtB,CAAC,GAAA,EAAA;;;;"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
import { applyDefaultTheme } from '../../utils/defaultTheme.js';
|
|
3
|
+
|
|
4
|
+
const shouldForwardProp = prop => {
|
|
5
|
+
return prop !== 'theme' && !prop.startsWith('$');
|
|
6
|
+
};
|
|
7
|
+
const Card = styled.div.withConfig({
|
|
8
|
+
shouldForwardProp
|
|
9
|
+
}).attrs(applyDefaultTheme)`
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
gap: 8px;
|
|
13
|
+
align-items: flex-start;
|
|
14
|
+
padding: ${props => props.$padding || '14px 10px'};
|
|
15
|
+
${props => {
|
|
16
|
+
if (props.$bgDark || props.$bgLight) {
|
|
17
|
+
return props.theme.themeProp('background', props.$bgDark || props.theme.getColor('gray-900'), props.$bgLight || props.theme.getColor('gray-200'));
|
|
18
|
+
}
|
|
19
|
+
return props.theme.themeProp('background', props.theme.getColor('gray-900'), props.theme.getColor('gray-200'));
|
|
20
|
+
}}
|
|
21
|
+
|
|
22
|
+
${props => props.$showCard && css`
|
|
23
|
+
border-radius: 10px;
|
|
24
|
+
box-shadow: 0px 0px 26px #0000001a;
|
|
25
|
+
`}
|
|
26
|
+
|
|
27
|
+
${props => props.$severity === 5 && props.$showCard && css`
|
|
28
|
+
outline-offset: -1px;
|
|
29
|
+
${props.theme.themeProp('outline', '1px solid #7f1d1d', '1px solid #dc2626')}
|
|
30
|
+
`}
|
|
31
|
+
`;
|
|
32
|
+
const InstructionText = styled.p.withConfig({
|
|
33
|
+
shouldForwardProp
|
|
34
|
+
}).attrs(applyDefaultTheme)`
|
|
35
|
+
font-size: ${props => props.$fontSize || '14px'};
|
|
36
|
+
font-weight: 400;
|
|
37
|
+
line-height: 1.286em;
|
|
38
|
+
margin: 0;
|
|
39
|
+
overflow-wrap: break-word;
|
|
40
|
+
word-break: break-word;
|
|
41
|
+
${props => props.theme.themeProp('color', props.theme.getColor('gray-300'), props.theme.getColor('black'))}
|
|
42
|
+
|
|
43
|
+
${props => props.$maxLines && css`
|
|
44
|
+
display: -webkit-box;
|
|
45
|
+
-webkit-line-clamp: ${props.$maxLines};
|
|
46
|
+
-webkit-box-orient: vertical;
|
|
47
|
+
overflow: hidden;
|
|
48
|
+
`}
|
|
49
|
+
`;
|
|
50
|
+
|
|
51
|
+
export { Card, InstructionText };
|
|
52
|
+
//# sourceMappingURL=InstructionSeverityDisplay.styled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InstructionSeverityDisplay.styled.js","sources":["../../../src/components/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.styled.js"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\n\nconst shouldForwardProp = prop => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\nexport const Card = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: flex;\n flex-direction: column;\n gap: 8px;\n align-items: flex-start;\n padding: ${props => props.$padding || '14px 10px'};\n ${props => {\n if (props.$bgDark || props.$bgLight) {\n return props.theme.themeProp(\n 'background',\n props.$bgDark || props.theme.getColor('gray-900'),\n props.$bgLight || props.theme.getColor('gray-200')\n );\n }\n return props.theme.themeProp(\n 'background',\n props.theme.getColor('gray-900'),\n props.theme.getColor('gray-200')\n );\n }}\n\n ${props =>\n props.$showCard &&\n css`\n border-radius: 10px;\n box-shadow: 0px 0px 26px #0000001a;\n `}\n\n ${props =>\n props.$severity === 5 &&\n props.$showCard &&\n css`\n outline-offset: -1px;\n ${props.theme.themeProp('outline', '1px solid #7f1d1d', '1px solid #dc2626')}\n `}\n`;\n\nexport const InstructionText = styled.p\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n font-size: ${props => props.$fontSize || '14px'};\n font-weight: 400;\n line-height: 1.286em;\n margin: 0;\n overflow-wrap: break-word;\n word-break: break-word;\n ${props =>\n props.theme.themeProp('color', props.theme.getColor('gray-300'), props.theme.getColor('black'))}\n\n ${props =>\n props.$maxLines &&\n css`\n display: -webkit-box;\n -webkit-line-clamp: ${props.$maxLines};\n -webkit-box-orient: vertical;\n overflow: hidden;\n `}\n`;\n"],"names":["shouldForwardProp","prop","startsWith","Card","styled","div","withConfig","attrs","applyDefaultTheme","props","$padding","$bgDark","$bgLight","theme","themeProp","getColor","$showCard","css","$severity","InstructionText","p","$fontSize","$maxLines"],"mappings":";;;AAGA,MAAMA,i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AK,CAAA,CAAA;AACL,EAAC;AAEM,MAAMK,eAAe,GAAGf,MAAM,CAACgB,CAAC,CACpCd,UAAU,CAAC;AACVN,EAAAA,iBAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAACC,iBAAiB,CAAC,CAAA;AAC3B,aAAA,EAAeC,KAAK,IAAIA,KAAK,CAACY,SAAS,IAAI,MAAM,CAAA;AACjD;AACA;AACA;AACA;AACA;AACA,EAAIZ,EAAAA,KAAK,IACLA,KAAK,CAACI,KAAK,CAACC,SAAS,CAAC,OAAO,EAAEL,KAAK,CAACI,KAAK,CAACE,QAAQ,CAAC,UAAU,CAAC,EAAEN,KAAK,CAACI,KAAK,CAACE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAA;AACnG;AACA,EAAA,EAAIN,KAAK,IACLA,KAAK,CAACa,SAAS,IACfL,GAAG,CAAA;AACP;AACA,0BAA4BR,EAAAA,KAAK,CAACa,SAAS,CAAA;AAC3C;AACA;AACA,IAAK,CAAA,CAAA;AACL;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import React__default from 'react';
|
|
4
|
-
import
|
|
4
|
+
import InstructionSeverityDisplay from '../InstructionSeverityDisplay/InstructionSeverityDisplay.js';
|
|
5
5
|
import { SummaryCard as SummaryCard$1, Gutter, Header, HeaderLeft, HeaderRight, Title, Description, Footer, FooterLeft, FooterRight } from './SummaryCard.styled.js';
|
|
6
6
|
|
|
7
7
|
const SummaryCard = React__default.forwardRef(function AssetSummaryCard({
|
|
@@ -9,7 +9,7 @@ const SummaryCard = React__default.forwardRef(function AssetSummaryCard({
|
|
|
9
9
|
title,
|
|
10
10
|
description,
|
|
11
11
|
instructions,
|
|
12
|
-
|
|
12
|
+
instructionSeverity,
|
|
13
13
|
headerLeft,
|
|
14
14
|
headerRight,
|
|
15
15
|
footerLeft,
|
|
@@ -41,13 +41,14 @@ const SummaryCard = React__default.forwardRef(function AssetSummaryCard({
|
|
|
41
41
|
$gutter: 4
|
|
42
42
|
}), description && React__default.createElement(Description, null, description), React__default.createElement(Gutter, {
|
|
43
43
|
$gutter: 16
|
|
44
|
-
}), shouldRenderInstructions && React__default.createElement(
|
|
44
|
+
}), shouldRenderInstructions && React__default.createElement(InstructionSeverityDisplay, {
|
|
45
45
|
labels: instructionLabels,
|
|
46
46
|
instructionText: instructions,
|
|
47
|
-
severity:
|
|
47
|
+
severity: instructionSeverity,
|
|
48
48
|
showCard: false,
|
|
49
49
|
padding: `14px 17px`,
|
|
50
|
-
detailsFontSize: `12px
|
|
50
|
+
detailsFontSize: `12px`,
|
|
51
|
+
maxLines: view === 'grid' ? 3 : undefined
|
|
51
52
|
}), shouldAddGutterAfterInstructions && React__default.createElement(Gutter, {
|
|
52
53
|
$gutter: 16
|
|
53
54
|
}), shouldRenderFooter && React__default.createElement(Footer, null, React__default.createElement(FooterLeft, null, footerLeft), React__default.createElement(FooterRight, null, footerRight)), shouldRenderFooter && React__default.createElement(Gutter, {
|
|
@@ -59,7 +60,7 @@ SummaryCard.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
59
60
|
title: PropTypes.string,
|
|
60
61
|
description: PropTypes.string,
|
|
61
62
|
instructions: PropTypes.string,
|
|
62
|
-
|
|
63
|
+
instructionSeverity: PropTypes.oneOf([1, 2, 3, 4, 5]),
|
|
63
64
|
headerLeft: PropTypes.node,
|
|
64
65
|
headerRight: PropTypes.node,
|
|
65
66
|
footerLeft: PropTypes.node,
|
|
@@ -73,7 +74,7 @@ SummaryCard.defaultProps = {
|
|
|
73
74
|
title: '',
|
|
74
75
|
description: '',
|
|
75
76
|
instructions: '',
|
|
76
|
-
|
|
77
|
+
instructionSeverity: 1,
|
|
77
78
|
headerLeft: null,
|
|
78
79
|
headerRight: null,
|
|
79
80
|
footerLeft: null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SummaryCard.js","sources":["../../../src/components/widgets/SummaryCard/SummaryCard.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\nimport
|
|
1
|
+
{"version":3,"file":"SummaryCard.js","sources":["../../../src/components/widgets/SummaryCard/SummaryCard.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\nimport InstructionSeverityDisplay from '../InstructionSeverityDisplay';\nimport * as S from './SummaryCard.styled';\n\n/**\n * ### Import\n *\n * ``` js\n * import { SummaryCard } from '@ntbjs/react-components/widgets'\n * // or\n * import SummaryCard from '@ntbjs/react-components/widgets/SummaryCard'\n * ```\n *\n * ### Props\n * ```\n * Pass `title=\"Title\"` to set the title of the card.\n * Pass `description=\"Description\"` to set the description of the card.\n * Pass `instructions=\"Instructions\"` to set the instructions of the card.\n * Pass 1-5 to `instructionSeverity` to reflect the severity of the instructions.\n * Pass `headerLeft={<div>Left</div>}` to set the left header of the card.\n * Pass `headerRight={<div>Right</div>}` to set the right header of the card.\n * Pass `footerLeft={<div>Left</div>}` to set the left footer of the card.\n * Pass `footerRight={<div>Right</div>}` to set the right footer of the card.\n * Pass `width={300}` to set the width of the card.\n * Pass `useBorder={true}` to set the border of the card.\n * ```\n */\n\nconst SummaryCard = React.forwardRef(function AssetSummaryCard(\n {\n activeSummaryCard,\n title,\n description,\n instructions,\n instructionSeverity,\n headerLeft,\n headerRight,\n footerLeft,\n footerRight,\n width,\n useBorder,\n view,\n instructionLabels,\n ...props\n },\n forwardedRef\n) {\n const shouldRenderInstructions = !!instructions;\n const shouldRenderHeader = !!headerLeft || !!headerRight;\n const shouldRenderFooter = !!footerLeft || !!footerRight;\n const shouldAddGutterAfterInstructions = shouldRenderInstructions && shouldRenderFooter;\n const shouldAddGutterAfterTitle =\n !!title && (!!description || !!instructions || shouldRenderFooter);\n\n if (!activeSummaryCard) return null;\n\n const filteredProps = Object.fromEntries(\n Object.entries(props).filter(([key]) => key !== 'compact')\n );\n\n return (\n <S.SummaryCard\n ref={forwardedRef}\n width={width}\n $useBorder={useBorder}\n {...filteredProps}\n view={view}\n >\n {shouldRenderHeader && (\n <>\n <S.Gutter $gutter={8} />\n <S.Header>\n <S.HeaderLeft>{headerLeft}</S.HeaderLeft>\n <S.HeaderRight>{headerRight}</S.HeaderRight>\n </S.Header>\n </>\n )}\n <S.Gutter $gutter={shouldRenderHeader ? 8 : 16} />\n {title && <S.Title>{title}</S.Title>}\n {shouldAddGutterAfterTitle && <S.Gutter $gutter={4} />}\n {description && <S.Description>{description}</S.Description>}\n <S.Gutter $gutter={16} />\n\n {shouldRenderInstructions && (\n <InstructionSeverityDisplay\n labels={instructionLabels}\n instructionText={instructions}\n severity={instructionSeverity}\n showCard={false}\n padding={`14px 17px`}\n detailsFontSize={`12px`}\n maxLines={view === 'grid' ? 3 : undefined}\n />\n )}\n {shouldAddGutterAfterInstructions && <S.Gutter $gutter={16} />}\n {shouldRenderFooter && (\n <S.Footer>\n <S.FooterLeft>{footerLeft}</S.FooterLeft>\n <S.FooterRight>{footerRight}</S.FooterRight>\n </S.Footer>\n )}\n {shouldRenderFooter && <S.Gutter $gutter={16} />}\n </S.SummaryCard>\n );\n});\n\nSummaryCard.propTypes = {\n /**\n * Wether the SummaryCard is active or not.\n */\n activeSummaryCard: PropTypes.bool,\n /**\n * Title of the content\n */\n title: PropTypes.string,\n /**\n * Description of the content\n */\n description: PropTypes.string,\n /**\n * Special instructions for the content\n */\n instructions: PropTypes.string,\n /**\n * Type of instructions\n */\n instructionSeverity: PropTypes.oneOf([1, 2, 3, 4, 5]),\n /**\n * One or more children to render in the left half of the header\n */\n headerLeft: PropTypes.node,\n /**\n * One or more children to render in the right half of the header\n */\n headerRight: PropTypes.node,\n /**\n * One or more children to render in the left half of the footer\n */\n footerLeft: PropTypes.node,\n /**\n * One or more children to render in the right half of the footer\n */\n footerRight: PropTypes.node,\n /**\n * Width of the card\n */\n width: PropTypes.number,\n /**\n * Whether or not to use a border around the card\n */\n useBorder: PropTypes.bool,\n /**\n * Whether or not the Summary Card is within the CompactCard view or Grid view\n */\n view: PropTypes.string,\n /**\n * Translated labels object for instruction(Info,Limited Use etc)\n */\n instructionLabels: PropTypes.objectOf(PropTypes.string)\n};\n\nSummaryCard.defaultProps = {\n title: '',\n description: '',\n instructions: '',\n instructionSeverity: 1,\n headerLeft: null,\n headerRight: null,\n footerLeft: null,\n footerRight: null,\n useBorder: false,\n activeSummaryCard: false\n};\n\nexport default SummaryCard;\n"],"names":["SummaryCard","React","forwardRef","AssetSummaryCard","activeSummaryCard","title","description","instructions","instructionSeverity","headerLeft","headerRight","footerLeft","footerRight","width","useBorder","view","instructionLabels","props","forwardedRef","shouldRenderInstructions","shouldRenderHeader","shouldRenderFooter","shouldAddGutterAfterInstructions","shouldAddGutterAfterTitle","filteredProps","Object","fromEntries","entries","filter","key","createElement","S","_extends","ref","$useBorder","Fragment","$gutter","InstructionSeverityDisplay","labels","instructionText","severity","showCard","padding","detailsFontSize","maxLines","undefined","propTypes","process","env","NODE_ENV","PropTypes","bool","string","oneOf","node","number","objectOf","defaultProps"],"mappings":";;;;;;AA6BMA,MAAAA,WAAW,GAAGC,cAAK,CAACC,UAAU,CAAC,SAASC,gBAAgBA,CAC5D;EACEC,iBAAiB;EACjBC,KAAK;EACLC,WAAW;EACXC,YAAY;EACZC,mBAAmB;EACnBC,UAAU;EACVC,WAAW;EACXC,UAAU;EACVC,WAAW;EACXC,KAAK;EACLC,SAAS;EACTC,IAAI;EACJC,iBAAiB;EACjB,GAAGC,KAAAA;AACL,CAAC,EACDC,YAAY,EACZ;AACA,EAAA,MAAMC,wBAAwB,GAAG,CAAC,CAACZ,YAAY,CAAA;EAC/C,MAAMa,kBAAkB,GAAG,CAAC,CAACX,UAAU,IAAI,CAAC,CAACC,WAAW,CAAA;EACxD,MAAMW,kBAAkB,GAAG,CAAC,CAACV,UAAU,IAAI,CAAC,CAACC,WAAW,CAAA;AACxD,EAAA,MAAMU,gCAAgC,GAAGH,wBAAwB,IAAIE,kBAAkB,CAAA;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C,KAAK,EAAE6C,SAAS,CAACE,MAAM;EAIvB9C,WAAW,EAAE4C,SAAS,CAACE,MAAM;EAI7B7C,YAAY,EAAE2C,SAAS,CAACE,MAAM;AAI9B5C,EAAAA,mBAAmB,EAAE0C,SAAS,CAACG,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;EAIrD5C,UAAU,EAAEyC,SAAS,CAACI,IAAI;EAI1B5C,WAAW,EAAEwC,SAAS,CAACI,IAAI;EAI3B3C,UAAU,EAAEuC,SAAS,CAACI,IAAI;EAI1B1C,WAAW,EAAEsC,SAAS,CAACI,IAAI;EAI3BzC,KAAK,EAAEqC,SAAS,CAACK,MAAM;EAIvBzC,SAAS,EAAEoC,SAAS,CAACC,IAAI;EAIzBpC,IAAI,EAAEmC,SAAS,CAACE,MAAM;AAItBpC,EAAAA,iBAAiB,EAAEkC,SAAS,CAACM,QAAQ,CAACN,SAAS,CAACE,MAAM,CAAA;AACxD,CAAC,GAAA,EAAA,CAAA;AAEDpD,WAAW,CAACyD,YAAY,GAAG;AACzBpD,EAAAA,KAAK,EAAE,EAAE;AACTC,EAAAA,WAAW,EAAE,EAAE;AACfC,EAAAA,YAAY,EAAE,EAAE;AAChBC,EAAAA,mBAAmB,EAAE,CAAC;AACtBC,EAAAA,UAAU,EAAE,IAAI;AAChBC,EAAAA,WAAW,EAAE,IAAI;AACjBC,EAAAA,UAAU,EAAE,IAAI;AAChBC,EAAAA,WAAW,EAAE,IAAI;AACjBE,EAAAA,SAAS,EAAE,KAAK;AAChBV,EAAAA,iBAAiB,EAAE,KAAA;AACrB,CAAC;;;;"}
|
|
@@ -11,7 +11,10 @@ const SummaryCard = styled.div.withConfig({
|
|
|
11
11
|
display: flex;
|
|
12
12
|
flex-direction: column;
|
|
13
13
|
border-radius: 4px;
|
|
14
|
-
|
|
14
|
+
${props => props.view === 'compact' && css`
|
|
15
|
+
overflow: hidden;
|
|
16
|
+
box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
|
|
17
|
+
`}
|
|
15
18
|
width: ${props => props.width ? `${props.width}px` : '100%'};
|
|
16
19
|
${props => props.view === 'compact' ? props.theme.themeProp('background', props.theme.getColor('gray-700'), props.theme.getColor('white')) : 'background: transparent'};
|
|
17
20
|
|
|
@@ -92,6 +95,8 @@ const Description = styled.span.withConfig({
|
|
|
92
95
|
overflow: hidden;
|
|
93
96
|
text-overflow: ellipsis;
|
|
94
97
|
box-sizing: border-box;
|
|
98
|
+
overflow-wrap: break-word;
|
|
99
|
+
word-break: break-word;
|
|
95
100
|
|
|
96
101
|
${props => props.theme.themeProp('color', props.theme.getColor('white'), props.theme.getColor('gray-700'))};
|
|
97
102
|
`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SummaryCard.styled.js","sources":["../../../src/components/widgets/SummaryCard/SummaryCard.styled.js"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\nimport { FloatingArrow } from '@floating-ui/react';\n\nconst shouldForwardProp = prop => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\nexport const SummaryCard = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: flex;\n flex-direction: column;\n border-radius: 4px;\n overflow:hidden;\n width: ${props => (props.width ? `${props.width}px` : '100%')};\n ${props =>\n props.view === 'compact'\n ? props.theme.themeProp(\n 'background',\n props.theme.getColor('gray-700'),\n props.theme.getColor('white')\n )\n : 'background: transparent'};\n\n ${props =>\n props.$useBorder\n ? props.theme.themeProp(\n 'border',\n `1px solid ${props.theme.getColor('gray-500')}`,\n `1px solid ${props.theme.getColor('gray-300')}`\n )\n : null}\n`;\n\nexport const Gutter = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n ${props => {\n if (props.renderAsMargin) {\n return css`\n margin-bottom: ${props.$gutter || 8}px;\n `;\n } else {\n return css`\n padding-bottom: ${props.$gutter || 8}px;\n `;\n }\n }}\n padding-bottom: ${props => props.$gutter || 8}px;\n`;\n\nexport const Header = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0 16px;\n`;\n\nexport const HeaderLeft = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: flex;\n align-items: center;\n justify-content: flex-start;\n\n > * {\n margin-right: 4px;\n }\n`;\n\nexport const HeaderRight = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: flex;\n align-items: center;\n justify-content: flex-end;\n\n > * {\n margin-left: 4px;\n }\n`;\n\nexport const Title = styled.span\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: inline-block;\n padding: 0 16px;\n font: normal normal 500 14px/19px Roboto;\n letter-spacing: 0.28px;\n display: -webkit-box;\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n box-sizing: border-box;\n\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('white'),\n props.theme.getColor('gray-700')\n )};\n`;\n\nexport const Description = styled.span\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n padding: 0 16px;\n text-align: left;\n font: normal normal normal 12px/16px Roboto;\n letter-spacing: 0.24px;\n display: -webkit-box;\n -webkit-line-clamp: 3;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n box-sizing: border-box;\n\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('white'),\n props.theme.getColor('gray-700')\n )};\n`;\n\nexport const Instruction = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)``;\n\nexport const Footer = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0 16px;\n`;\n\nexport const FooterLeft = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: flex;\n align-items: center;\n justify-content: flex-start;\n\n > * {\n margin-right: 4px;\n }\n`;\n\nexport const FooterRight = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: flex;\n align-items: center;\n justify-content: flex-end;\n\n > * {\n margin-left: 4px;\n }\n`;\n\nexport const StyledFloatingArrow = styled(FloatingArrow)\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n ${props =>\n props.theme.themeProp('fill', props.theme.getColor('gray-700'), props.theme.getColor('white'))}\n`;\n"],"names":["shouldForwardProp","prop","startsWith","SummaryCard","styled","div","withConfig","attrs","applyDefaultTheme","props","
|
|
1
|
+
{"version":3,"file":"SummaryCard.styled.js","sources":["../../../src/components/widgets/SummaryCard/SummaryCard.styled.js"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\nimport { FloatingArrow } from '@floating-ui/react';\n\nconst shouldForwardProp = prop => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\nexport const SummaryCard = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: flex;\n flex-direction: column;\n border-radius: 4px;\n ${props =>\n props.view === 'compact' &&\n css`\n overflow: hidden;\n box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);\n `}\n width: ${props => (props.width ? `${props.width}px` : '100%')};\n ${props =>\n props.view === 'compact'\n ? props.theme.themeProp(\n 'background',\n props.theme.getColor('gray-700'),\n props.theme.getColor('white')\n )\n : 'background: transparent'};\n\n ${props =>\n props.$useBorder\n ? props.theme.themeProp(\n 'border',\n `1px solid ${props.theme.getColor('gray-500')}`,\n `1px solid ${props.theme.getColor('gray-300')}`\n )\n : null}\n`;\n\nexport const Gutter = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n ${props => {\n if (props.renderAsMargin) {\n return css`\n margin-bottom: ${props.$gutter || 8}px;\n `;\n } else {\n return css`\n padding-bottom: ${props.$gutter || 8}px;\n `;\n }\n }}\n padding-bottom: ${props => props.$gutter || 8}px;\n`;\n\nexport const Header = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0 16px;\n`;\n\nexport const HeaderLeft = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: flex;\n align-items: center;\n justify-content: flex-start;\n\n > * {\n margin-right: 4px;\n }\n`;\n\nexport const HeaderRight = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: flex;\n align-items: center;\n justify-content: flex-end;\n\n > * {\n margin-left: 4px;\n }\n`;\n\nexport const Title = styled.span\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: inline-block;\n padding: 0 16px;\n font: normal normal 500 14px/19px Roboto;\n letter-spacing: 0.28px;\n display: -webkit-box;\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n box-sizing: border-box;\n\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('white'),\n props.theme.getColor('gray-700')\n )};\n`;\n\nexport const Description = styled.span\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n padding: 0 16px;\n text-align: left;\n font: normal normal normal 12px/16px Roboto;\n letter-spacing: 0.24px;\n display: -webkit-box;\n -webkit-line-clamp: 3;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n box-sizing: border-box;\n overflow-wrap: break-word;\n word-break: break-word;\n\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('white'),\n props.theme.getColor('gray-700')\n )};\n`;\n\nexport const Instruction = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)``;\n\nexport const Footer = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0 16px;\n`;\n\nexport const FooterLeft = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: flex;\n align-items: center;\n justify-content: flex-start;\n\n > * {\n margin-right: 4px;\n }\n`;\n\nexport const FooterRight = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: flex;\n align-items: center;\n justify-content: flex-end;\n\n > * {\n margin-left: 4px;\n }\n`;\n\nexport const StyledFloatingArrow = styled(FloatingArrow)\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n ${props =>\n props.theme.themeProp('fill', props.theme.getColor('gray-700'), props.theme.getColor('white'))}\n`;\n"],"names":["shouldForwardProp","prop","startsWith","SummaryCard","styled","div","withConfig","attrs","applyDefaultTheme","props","view","css","width","theme","themeProp","getColor","$useBorder","Gutter","renderAsMargin","$gutter","Header","HeaderLeft","HeaderRight","Title","span","Description","Footer","FooterLeft","FooterRight","FloatingArrow"],"mappings":";;;;AAIA,MAAMA,iBAAiB,GAAGC,IAAI,IAAI;EAChC,OAAOA,IAAI,KAAK,OAAO,IAAI,CAACA,IAAI,CAACC,UAAU,CAAC,GAAG,CAAC,CAAA;AAClD,CAAC,CAAA;AAEM,MAAMC,WAAW,GAAGC,MAAM,CAACC,GAAG,CAClCC,UAAU,CAAC;AACVN,EAAAA,iBAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAACC,iBAAiB,CAAC,CAAA;AAC3B;AACA;AACA;AACA,EAAIC,EAAAA,KAAK,IACLA,KAAK,CAACC,IAAI,KAAK,SAAS,IACxBC,GAAG,CAAA;AACP;AACA;AACA,IAAK,CAAA,CAAA;AACL,SAAA,EAAWF,KAAK,IAAKA,KAAK,CAACG,KAAK,GAAG,CAAGH,EAAAA,KAAK,CAACG,KAAK,CAAI,EAAA,CAAA,GAA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AAQ,CAAC,UAAU,CACjC,CAAC,CAAA;AACL,EAAC;AAE0BX,MAAM,CAACC,GAAG,CAClCC,UAAU,CAAC;AACVN,EAAAA,iBAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAACC,iBAAiB,CAAC,CAAE,EAAA;AAEtB,MAAMkB,MAAM,GAAGtB,MAAM,CAACC,GAAG,CAC7BC,UAAU,CAAC;AACVN,EAAAA,iBAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAACC,iBAAiB,CAAC,CAAA;AAC3B;AACA;AACA;AACA;AACA,EAAC;AAEM,MAAMmB,UAAU,GAAGvB,MAAM,CAACC,GAAG,CACjCC,UAAU,CAAC;AACVN,EAAAA,iBAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAACC,iBAAiB,CAAC,CAAA;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AAEM,MAAMoB,WAAW,GAAGxB,MAAM,CAACC,GAAG,CAClCC,UAAU,CAAC;AACVN,EAAAA,iBAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAACC,iBAAiB,CAAC,CAAA;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AAEkCJ,MAAM,CAACyB,aAAa,CAAC,CACrDvB,UAAU,CAAC;AACVN,EAAAA,iBAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAACC,iBAAiB,CAAC,CAAA;AAC3B,EAAIC,EAAAA,KAAK,IACLA,KAAK,CAACI,KAAK,CAACC,SAAS,CAAC,MAAM,EAAEL,KAAK,CAACI,KAAK,CAACE,QAAQ,CAAC,UAAU,CAAC,EAAEN,KAAK,CAACI,KAAK,CAACE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAA;AAClG;;;;"}
|
package/build/widgets/index.js
CHANGED
|
@@ -8,5 +8,5 @@ export { default as AssetActionBase } from './AssetActionsBase/AssetActionsBase.
|
|
|
8
8
|
export { default as AssetAction } from './AssetAction/AssetAction.js';
|
|
9
9
|
export { default as ProgressBar } from './ProgressBar/ProgressBar.js';
|
|
10
10
|
export { default as InfoCard } from './InfoCard/InfoCard.js';
|
|
11
|
-
export { default as
|
|
11
|
+
export { default as InstructionSeverityDisplay } from './InstructionSeverityDisplay/InstructionSeverityDisplay.js';
|
|
12
12
|
//# sourceMappingURL=index.js.map
|
package/icons/index.js
CHANGED
|
@@ -36,6 +36,7 @@ import { ReactComponent as TriangleRightIcon } from './triangle-right.svg';
|
|
|
36
36
|
import { ReactComponent as VerificationIcon } from './verification.svg';
|
|
37
37
|
import { ReactComponent as WarningCircleIcon } from './warning-circle.svg';
|
|
38
38
|
import { ReactComponent as WarningTriangleIcon } from './warning-triangle.svg';
|
|
39
|
+
import { ReactComponent as InfoRedIcon } from './info-red.svg';
|
|
39
40
|
import { ReactComponent as InfoYellowIcon } from './info-yellow.svg';
|
|
40
41
|
export {
|
|
41
42
|
AddIcon,
|
|
@@ -76,5 +77,6 @@ export {
|
|
|
76
77
|
VerificationIcon,
|
|
77
78
|
WarningCircleIcon,
|
|
78
79
|
WarningTriangleIcon,
|
|
80
|
+
InfoRedIcon,
|
|
79
81
|
InfoYellowIcon
|
|
80
82
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<svg viewBox="5 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_red)">
|
|
3
|
+
<rect width="28" height="28" transform="translate(5)" fill="#B62902"/>
|
|
4
|
+
<path d="M19.0007 25.6663C12.5572 25.6663 7.33398 20.4432 7.33398 13.9997C7.33398 7.55617 12.5572 2.33301 19.0007 2.33301C25.4442 2.33301 30.6673 7.55617 30.6673 13.9997C30.6673 20.4432 25.4442 25.6663 19.0007 25.6663ZM19.0007 23.333C21.476 23.333 23.85 22.3497 25.6003 20.5993C27.3507 18.849 28.334 16.475 28.334 13.9997C28.334 11.5243 27.3507 9.15035 25.6003 7.40001C23.85 5.64967 21.476 4.66634 19.0007 4.66634C16.5253 4.66634 14.1513 5.64967 12.401 7.40001C10.6506 9.15035 9.66732 11.5243 9.66732 13.9997C9.66732 16.475 10.6506 18.849 12.401 20.5993C14.1513 22.3497 16.5253 23.333 19.0007 23.333ZM17.834 8.16634H20.1673V10.4997H17.834V8.16634ZM17.834 12.833H20.1673V19.833H17.834V12.833Z" fill="#FECACA"/>
|
|
5
|
+
</g>
|
|
6
|
+
<defs>
|
|
7
|
+
<clipPath id="clip0_red">
|
|
8
|
+
<path d="M5 14C5 6.26801 11.268 0 19 0C26.732 0 33 6.26801 33 14C33 21.732 26.732 28 19 28C11.268 28 5 21.732 5 14Z" fill="white"/>
|
|
9
|
+
</clipPath>
|
|
10
|
+
</defs>
|
|
11
|
+
</svg>
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InstructionsSeverityDisplay.js","sources":["../../../src/components/widgets/InstructionsSeverityDisplay/InstructionsSeverityDisplay.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport * as S from './InstructionsSeverityDisplay.styled';\n\nconst InformationIcon = () => (\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M6 11C3.2385 11 1 8.7615 1 6C1 3.2385 3.2385 1 6 1C8.7615 1 11 3.2385 11 6C11 8.7615 8.7615 11 6 11ZM6 10C7.06087 10 8.07828 9.57857 8.82843 8.82843C9.57857 8.07828 10 7.06087 10 6C10 4.93913 9.57857 3.92172 8.82843 3.17157C8.07828 2.42143 7.06087 2 6 2C4.93913 2 3.92172 2.42143 3.17157 3.17157C2.42143 3.92172 2 4.93913 2 6C2 7.06087 2.42143 8.07828 3.17157 8.82843C3.92172 9.57857 4.93913 10 6 10ZM5.5 3.5H6.5V4.5H5.5V3.5ZM5.5 5.5H6.5V8.5H5.5V5.5Z\"\n fill=\"currentColor\"\n />\n </svg>\n);\n\nconst defaultLabels = {\n 1: 'Info',\n 2: 'Info',\n 3: 'Limited use',\n 4: 'Limited use',\n 5: 'Highly restricted'\n};\n\nconst InstructionsSeverityDisplay = React.forwardRef(function InstructionsSeverityDisplay(\n {\n severity,\n instructionText,\n severityLabel,\n labels,\n icon,\n showCard = true,\n padding,\n badgeFontSize,\n detailsFontSize,\n bgLight,\n bgDark,\n ...props\n },\n forwardedRef\n) {\n if (!instructionText) {\n return null;\n }\n\n const displayLabel =\n severityLabel || (labels && labels[severity]) || defaultLabels[severity] || defaultLabels[1];\n\n return (\n <S.Card\n ref={forwardedRef}\n $severity={severity}\n $showCard={showCard}\n $padding={padding}\n $bgLight={bgLight}\n $bgDark={bgDark}\n {...props}\n >\n <S.BadgePill $severity={severity}>\n {icon || <InformationIcon />}\n <S.BadgeText $fontSize={badgeFontSize}>{displayLabel}</S.BadgeText>\n </S.BadgePill>\n <S.InstructionText $fontSize={detailsFontSize}>{instructionText}</S.InstructionText>\n </S.Card>\n );\n});\n\nInstructionsSeverityDisplay.propTypes = {\n /** Severity level (1-5). 1=Info, 3=Limited use, 5=Highly restricted. */\n severity: PropTypes.oneOf([1, 2, 3, 4, 5]),\n /** The instruction text to display. Component returns null if empty. */\n instructionText: PropTypes.string,\n /** Override the default badge label for the severity level. */\n severityLabel: PropTypes.string,\n /** Map of severity level to translated label string, e.g. { 1: 'Info', 3: 'Begrenset bruk', 5: 'Svært begrenset' }. */\n labels: PropTypes.objectOf(PropTypes.string),\n /** Override the default icon element. */\n icon: PropTypes.element,\n /** Whether to show card styling (border-radius, shadow, border). Defaults to true. */\n showCard: PropTypes.bool,\n /** Custom card padding, e.g. \"8px 6px\" or \"20px\". Defaults to \"14px 10px\". */\n padding: PropTypes.string,\n /** Custom font size for the badge text, e.g. \"10px\" or \"0.75rem\". Defaults to \"12px\". */\n badgeFontSize: PropTypes.string,\n /** Custom font size for the details/instruction text, e.g. \"12px\" or \"0.875rem\". Defaults to \"14px\". */\n detailsFontSize: PropTypes.string,\n /** Override card background color in light mode, e.g. \"#ffffff\" or \"transparent\". */\n bgLight: PropTypes.string,\n /** Override card background color in dark mode, e.g. \"#1a1a1a\" or \"transparent\". */\n bgDark: PropTypes.string\n};\n\nexport default InstructionsSeverityDisplay;\n"],"names":["InformationIcon","React","createElement","width","height","viewBox","fill","xmlns","d","defaultLabels","InstructionsSeverityDisplay","forwardRef","severity","instructionText","severityLabel","labels","icon","showCard","padding","badgeFontSize","detailsFontSize","bgLight","bgDark","props","forwardedRef","displayLabel","S","_extends","ref","$severity","$showCard","$padding","$bgLight","$bgDark","$fontSize","propTypes","process","env","NODE_ENV","PropTypes","oneOf","string","objectOf","element","bool"],"mappings":";;;;;AAIA,MAAMA,eAAe,GAAGA,MACtBC,cAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AAAKC,EAAAA,KAAK,EAAC,IAAI;AAACC,EAAAA,MAAM,EAAC,IAAI;AAACC,EAAAA,OAAO,EAAC,WAAW;AAACC,EAAAA,IAAI,EAAC,MAAM;AAACC,EAAAA,KAAK,EAAC,4BAAA;AAA4B,CAC5FN,EAAAA,cAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AACEM,EAAAA,CAAC,EAAC,ocAAoc;AACtcF,EAAAA,IAAI,EAAC,cAAA;AAAc,CACpB,CACE,CACN,CAAA;AAED,MAAMG,aAAa,GAAG;AACpB,EAAA,CAAC,EAAE,MAAM;AACT,EAAA,CAAC,EAAE,MAAM;AACT,EAAA,CAAC,EAAE,aAAa;AAChB,EAAA,CAAC,EAAE,aAAa;AAChB,EAAA,CAAC,EAAE,mBAAA;AACL,CAAC,CAAA;AAEKC,MAAAA,2BAA2B,GAAGT,cAAK,CAACU,UAAU,CAAC,SAASD,2BAA2BA,CACvF;EACEE,QAAQ;EACRC,eAAe;EACfC,aAAa;EACbC,MAAM;EACNC,IAAI;AACJC,EAAAA,QAAQ,GAAG,IAAI;EACfC,OAAO;EACPC,aAAa;EACbC,eAAe;EACfC,OAAO;EACPC,MAAM;EACN,GAAGC,KAAAA;AACL,CAAC,EACDC,YAAY,EACZ;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,MAAM;EAE/B1B,MAAM,EAAEwB,SAAS,CAACG,QAAQ,CAACH,SAAS,CAACE,MAAM,CAAC;EAE5CzB,IAAI,EAAEuB,SAAS,CAACI,OAAO;EAEvB1B,QAAQ,EAAEsB,SAAS,CAACK,IAAI;EAExB1B,OAAO,EAAEqB,SAAS,CAACE,MAAM;EAEzBtB,aAAa,EAAEoB,SAAS,CAACE,MAAM;EAE/BrB,eAAe,EAAEmB,SAAS,CAACE,MAAM;EAEjCpB,OAAO,EAAEkB,SAAS,CAACE,MAAM;EAEzBnB,MAAM,EAAEiB,SAAS,CAACE,MAAAA;AACpB,CAAC,GAAA,EAAA;;;;"}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import styled, { css } from 'styled-components';
|
|
2
|
-
import { applyDefaultTheme } from '../../utils/defaultTheme.js';
|
|
3
|
-
|
|
4
|
-
const shouldForwardProp = prop => {
|
|
5
|
-
return prop !== 'theme' && !prop.startsWith('$');
|
|
6
|
-
};
|
|
7
|
-
const Card = styled.div.withConfig({
|
|
8
|
-
shouldForwardProp
|
|
9
|
-
}).attrs(applyDefaultTheme)`
|
|
10
|
-
display: flex;
|
|
11
|
-
flex-direction: column;
|
|
12
|
-
gap: 8px;
|
|
13
|
-
padding: ${props => props.$padding || '14px 10px'};
|
|
14
|
-
${props => {
|
|
15
|
-
if (props.$bgDark || props.$bgLight) {
|
|
16
|
-
return props.theme.themeProp('background', props.$bgDark || props.theme.getColor('gray-900'), props.$bgLight || props.theme.getColor('gray-200'));
|
|
17
|
-
}
|
|
18
|
-
return props.theme.themeProp('background', props.theme.getColor('gray-900'), props.theme.getColor('gray-200'));
|
|
19
|
-
}}
|
|
20
|
-
|
|
21
|
-
${props => props.$showCard && css`
|
|
22
|
-
border-radius: 10px;
|
|
23
|
-
box-shadow: 0px 0px 26px #0000001a;
|
|
24
|
-
`}
|
|
25
|
-
|
|
26
|
-
${props => props.$severity === 5 && props.$showCard && css`
|
|
27
|
-
${props.theme.themeProp('border', '1px solid #7f1d1d', '1px solid #dc2626')}
|
|
28
|
-
`}
|
|
29
|
-
`;
|
|
30
|
-
const BadgePill = styled.span.withConfig({
|
|
31
|
-
shouldForwardProp
|
|
32
|
-
}).attrs(applyDefaultTheme)`
|
|
33
|
-
display: flex;
|
|
34
|
-
flex-direction: row;
|
|
35
|
-
align-items: center;
|
|
36
|
-
gap: 4px;
|
|
37
|
-
padding: 2px 8px;
|
|
38
|
-
border-radius: 9999px;
|
|
39
|
-
width: fit-content;
|
|
40
|
-
height: 24px;
|
|
41
|
-
${props => (props.$severity === 1 || props.$severity === 2) && css`
|
|
42
|
-
border-style: solid;
|
|
43
|
-
border-width: 1px;
|
|
44
|
-
${props.theme.themeProp('background', props.theme.getColor('gray-800'), props.theme.getColor('white'))}
|
|
45
|
-
${props.theme.themeProp('border-color', '#3a3a3a', '#ece4e1')}
|
|
46
|
-
${props.theme.themeProp('color', props.theme.getColor('gray-300'), props.theme.getColor('black'))}
|
|
47
|
-
`}
|
|
48
|
-
|
|
49
|
-
${props => (props.$severity === 3 || props.$severity === 4) && css`
|
|
50
|
-
${props.theme.themeProp('background', '#2e2301', '#faeeb3')}
|
|
51
|
-
${props.theme.themeProp('color', '#eab308', '#78350F')}
|
|
52
|
-
`}
|
|
53
|
-
|
|
54
|
-
${props => props.$severity === 5 && css`
|
|
55
|
-
${props.theme.themeProp('background', '#7E1B1B', 'rgba(182, 41, 2, 0.1)')}
|
|
56
|
-
${props.theme.themeProp('color', '#e8d5d6', '#b62902')}
|
|
57
|
-
`}
|
|
58
|
-
`;
|
|
59
|
-
const BadgeText = styled.span.withConfig({
|
|
60
|
-
shouldForwardProp
|
|
61
|
-
}).attrs(applyDefaultTheme)`
|
|
62
|
-
font-size: ${props => props.$fontSize || '12px'};
|
|
63
|
-
font-weight: 500;
|
|
64
|
-
line-height: 1.333em;
|
|
65
|
-
`;
|
|
66
|
-
const InstructionText = styled.p.withConfig({
|
|
67
|
-
shouldForwardProp
|
|
68
|
-
}).attrs(applyDefaultTheme)`
|
|
69
|
-
font-size: ${props => props.$fontSize || '14px'};
|
|
70
|
-
font-weight: 400;
|
|
71
|
-
line-height: 1.286em;
|
|
72
|
-
margin: 0;
|
|
73
|
-
${props => props.theme.themeProp('color', props.theme.getColor('gray-300'), props.theme.getColor('black'))}
|
|
74
|
-
`;
|
|
75
|
-
|
|
76
|
-
export { BadgePill, BadgeText, Card, InstructionText };
|
|
77
|
-
//# sourceMappingURL=InstructionsSeverityDisplay.styled.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InstructionsSeverityDisplay.styled.js","sources":["../../../src/components/widgets/InstructionsSeverityDisplay/InstructionsSeverityDisplay.styled.js"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\n\nconst shouldForwardProp = prop => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\nexport const Card = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: flex;\n flex-direction: column;\n gap: 8px;\n padding: ${props => props.$padding || '14px 10px'};\n ${props => {\n if (props.$bgDark || props.$bgLight) {\n return props.theme.themeProp(\n 'background',\n props.$bgDark || props.theme.getColor('gray-900'),\n props.$bgLight || props.theme.getColor('gray-200')\n );\n }\n return props.theme.themeProp(\n 'background',\n props.theme.getColor('gray-900'),\n props.theme.getColor('gray-200')\n );\n }}\n\n ${props =>\n props.$showCard &&\n css`\n border-radius: 10px;\n box-shadow: 0px 0px 26px #0000001a;\n `}\n\n ${props =>\n props.$severity === 5 &&\n props.$showCard &&\n css`\n ${props.theme.themeProp('border', '1px solid #7f1d1d', '1px solid #dc2626')}\n `}\n`;\n\nexport const BadgePill = styled.span\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 4px;\n padding: 2px 8px;\n border-radius: 9999px;\n width: fit-content;\n height: 24px;\n ${props =>\n (props.$severity === 1 || props.$severity === 2) &&\n css`\n border-style: solid;\n border-width: 1px;\n ${props.theme.themeProp(\n 'background',\n props.theme.getColor('gray-800'),\n props.theme.getColor('white')\n )}\n ${props.theme.themeProp('border-color', '#3a3a3a', '#ece4e1')}\n ${props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-300'),\n props.theme.getColor('black')\n )}\n `}\n\n ${props =>\n (props.$severity === 3 || props.$severity === 4) &&\n css`\n ${props.theme.themeProp('background', '#2e2301', '#faeeb3')}\n ${props.theme.themeProp('color', '#eab308', '#78350F')}\n `}\n\n ${props =>\n props.$severity === 5 &&\n css`\n ${props.theme.themeProp('background', '#7E1B1B', 'rgba(182, 41, 2, 0.1)')}\n ${props.theme.themeProp('color', '#e8d5d6', '#b62902')}\n `}\n`;\n\nexport const BadgeText = styled.span\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n font-size: ${props => props.$fontSize || '12px'};\n font-weight: 500;\n line-height: 1.333em;\n`;\n\nexport const InstructionText = styled.p\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n font-size: ${props => props.$fontSize || '14px'};\n font-weight: 400;\n line-height: 1.286em;\n margin: 0;\n ${props =>\n props.theme.themeProp('color', props.theme.getColor('gray-300'), props.theme.getColor('black'))}\n`;\n"],"names":["shouldForwardProp","prop","startsWith","Card","styled","div","withConfig","attrs","applyDefaultTheme","props","$padding","$bgDark","$bgLight","theme","themeProp","getColor","$showCard","css","$severity","BadgePill","span","BadgeText","$fontSize","InstructionText","p"],"mappings":";;;AAGA,MAAMA,iBAAiB,GAAGC,IAAI,IAAI;EAChC,OAAOA,IAAI,KAAK,OAAO,IAAI,CAACA,IAAI,CAACC,UAAU,CAAC,GAAG,CAAC,CAAA;AAClD,CAAC,CAAA;AAEM,MAAMC,IAAI,GAAGC,MAAM,CAACC,GAAG,CAC3BC,UAAU,CAAC;AACVN,EAAAA,iBAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAACC,iBAAiB,CAAC,CA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