@ntbjs/react-components 2.0.8-rc.1 → 2.0.8-rc.2
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/index.js +0 -1
- package/build/data/index.js.map +1 -1
- package/build/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.js +0 -1
- package/build/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.js.map +1 -1
- package/build/inputs/CompactStarRating/CompactStarRating.js +0 -1
- package/build/inputs/CompactStarRating/CompactStarRating.js.map +1 -1
- package/build/inputs/CompactTextInput/CompactTextInput.js +0 -1
- package/build/inputs/CompactTextInput/CompactTextInput.js.map +1 -1
- package/build/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.js +0 -1
- package/build/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.js.map +1 -1
- package/build/inputs/TextArea/TextArea.js +0 -1
- package/build/inputs/TextArea/TextArea.js.map +1 -1
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.js +1 -2
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.js.map +1 -1
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.styled.js +4 -2
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.styled.js.map +1 -1
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.js +1 -2
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.js.map +1 -1
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.styled.js +5 -3
- package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.styled.js.map +1 -1
- package/build/widgets/AssetGallery/asset.propType.js +2 -1
- package/build/widgets/AssetGallery/asset.propType.js.map +1 -1
- package/build/{data → widgets}/InstructionsSeverityDisplay/InstructionsSeverityDisplay.js +29 -27
- package/build/widgets/InstructionsSeverityDisplay/InstructionsSeverityDisplay.js.map +1 -0
- package/build/{data → widgets}/InstructionsSeverityDisplay/InstructionsSeverityDisplay.styled.js +14 -9
- package/build/widgets/InstructionsSeverityDisplay/InstructionsSeverityDisplay.styled.js.map +1 -0
- package/build/widgets/SummaryCard/SummaryCard.js +12 -14
- package/build/widgets/SummaryCard/SummaryCard.js.map +1 -1
- package/build/widgets/SummaryCard/SummaryCard.styled.js +1 -0
- package/build/widgets/SummaryCard/SummaryCard.styled.js.map +1 -1
- package/build/widgets/index.js +1 -0
- package/build/widgets/index.js.map +1 -1
- package/package.json +1 -1
- package/build/data/InstructionsSeverityDisplay/InstructionsSeverityDisplay.js.map +0 -1
- package/build/data/InstructionsSeverityDisplay/InstructionsSeverityDisplay.styled.js.map +0 -1
|
@@ -28,11 +28,12 @@ const assetShape = {
|
|
|
28
28
|
onClick: PropTypes.func,
|
|
29
29
|
onContextMenu: PropTypes.func,
|
|
30
30
|
onMouseEnter: PropTypes.func,
|
|
31
|
+
instructionsSeverity: PropTypes.oneOf([1, 2, 3, 4, 5]),
|
|
31
32
|
summary: PropTypes.shape({
|
|
32
33
|
title: PropTypes.string,
|
|
33
34
|
description: PropTypes.string,
|
|
34
35
|
instructions: PropTypes.string,
|
|
35
|
-
|
|
36
|
+
instructionsSeverity: PropTypes.oneOf([1, 2, 3, 4, 5]),
|
|
36
37
|
headerLeft: PropTypes.node,
|
|
37
38
|
headerRight: PropTypes.node,
|
|
38
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 summary: PropTypes.shape({\n title: PropTypes.string,\n description: PropTypes.string,\n instructions: PropTypes.string,\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 instructionsSeverity: PropTypes.oneOf([1, 2, 3, 4, 5]),\n summary: PropTypes.shape({\n title: PropTypes.string,\n description: PropTypes.string,\n instructions: PropTypes.string,\n instructionsSeverity: 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","instructionsSeverity","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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,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACtDqB,UAAU,EAAEpC,SAAS,CAACqC,IAAI;IAC1BC,WAAW,EAAEtC,SAAS,CAACqC,IAAI;IAC3BE,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;;;;"}
|
|
@@ -13,56 +13,58 @@ const InformationIcon = () => React__default.createElement("svg", {
|
|
|
13
13
|
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",
|
|
14
14
|
fill: "currentColor"
|
|
15
15
|
}));
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
case 3:
|
|
24
|
-
case 4:
|
|
25
|
-
return {
|
|
26
|
-
label: 'Limited use'
|
|
27
|
-
};
|
|
28
|
-
case 5:
|
|
29
|
-
return {
|
|
30
|
-
label: 'Highly restricted'
|
|
31
|
-
};
|
|
32
|
-
default:
|
|
33
|
-
return null;
|
|
34
|
-
}
|
|
16
|
+
const defaultLabels = {
|
|
17
|
+
1: 'Info',
|
|
18
|
+
2: 'Info',
|
|
19
|
+
3: 'Limited use',
|
|
20
|
+
4: 'Limited use',
|
|
21
|
+
5: 'Highly restricted'
|
|
35
22
|
};
|
|
36
23
|
const InstructionsSeverityDisplay = React__default.forwardRef(function InstructionsSeverityDisplay({
|
|
37
24
|
severity,
|
|
38
25
|
instructionText,
|
|
39
26
|
severityLabel,
|
|
27
|
+
labels,
|
|
40
28
|
icon,
|
|
41
29
|
showCard = true,
|
|
30
|
+
padding,
|
|
31
|
+
badgeFontSize,
|
|
32
|
+
detailsFontSize,
|
|
33
|
+
bgLight,
|
|
34
|
+
bgDark,
|
|
42
35
|
...props
|
|
43
36
|
}, forwardedRef) {
|
|
44
37
|
if (!instructionText) {
|
|
45
38
|
return null;
|
|
46
39
|
}
|
|
47
|
-
const
|
|
48
|
-
if (!config) {
|
|
49
|
-
return null;
|
|
50
|
-
}
|
|
51
|
-
const displayLabel = severityLabel || config.label;
|
|
40
|
+
const displayLabel = severityLabel || labels && labels[severity] || defaultLabels[severity] || defaultLabels[1];
|
|
52
41
|
return React__default.createElement(Card, _extends({
|
|
53
42
|
ref: forwardedRef,
|
|
54
43
|
$severity: severity,
|
|
55
|
-
$showCard: showCard
|
|
44
|
+
$showCard: showCard,
|
|
45
|
+
$padding: padding,
|
|
46
|
+
$bgLight: bgLight,
|
|
47
|
+
$bgDark: bgDark
|
|
56
48
|
}, props), React__default.createElement(BadgePill, {
|
|
57
49
|
$severity: severity
|
|
58
|
-
}, icon || React__default.createElement(InformationIcon, null), React__default.createElement(BadgeText,
|
|
50
|
+
}, icon || React__default.createElement(InformationIcon, null), React__default.createElement(BadgeText, {
|
|
51
|
+
$fontSize: badgeFontSize
|
|
52
|
+
}, displayLabel)), React__default.createElement(InstructionText, {
|
|
53
|
+
$fontSize: detailsFontSize
|
|
54
|
+
}, instructionText));
|
|
59
55
|
});
|
|
60
56
|
InstructionsSeverityDisplay.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
61
57
|
severity: PropTypes.oneOf([1, 2, 3, 4, 5]),
|
|
62
58
|
instructionText: PropTypes.string,
|
|
63
59
|
severityLabel: PropTypes.string,
|
|
60
|
+
labels: PropTypes.objectOf(PropTypes.string),
|
|
64
61
|
icon: PropTypes.element,
|
|
65
|
-
showCard: PropTypes.bool
|
|
62
|
+
showCard: PropTypes.bool,
|
|
63
|
+
padding: PropTypes.string,
|
|
64
|
+
badgeFontSize: PropTypes.string,
|
|
65
|
+
detailsFontSize: PropTypes.string,
|
|
66
|
+
bgLight: PropTypes.string,
|
|
67
|
+
bgDark: PropTypes.string
|
|
66
68
|
} : {};
|
|
67
69
|
|
|
68
70
|
export { InstructionsSeverityDisplay as default };
|
|
@@ -0,0 +1 @@
|
|
|
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,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,CAACwB,eAAiB,EAAA;AAACQ,IAAAA,SAAS,EAAEd,eAAAA;GAAkBP,EAAAA,eAAmC,CAC7E,CAAC,CAAA;AAEb,CAAC,EAAC;AAEFH,2BAA2B,CAACyB,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,KAAG,YAAA,GAAA;AAEtC1B,EAAAA,QAAQ,EAAE2B,SAAS,CAACC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;EAE1C3B,eAAe,EAAE0B,SAAS,CAACE,MAAM;EAEjC3B,aAAa,EAAEyB,SAAS,CAACE,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;;;;"}
|
package/build/{data → widgets}/InstructionsSeverityDisplay/InstructionsSeverityDisplay.styled.js
RENAMED
|
@@ -10,12 +10,17 @@ const Card = styled.div.withConfig({
|
|
|
10
10
|
display: flex;
|
|
11
11
|
flex-direction: column;
|
|
12
12
|
gap: 8px;
|
|
13
|
-
padding: 14px 10px;
|
|
14
|
-
${props =>
|
|
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
|
+
}}
|
|
15
20
|
|
|
16
21
|
${props => props.$showCard && css`
|
|
17
22
|
border-radius: 10px;
|
|
18
|
-
box-shadow: 0px
|
|
23
|
+
box-shadow: 0px 0px 26px #0000001a;
|
|
19
24
|
`}
|
|
20
25
|
|
|
21
26
|
${props => props.$severity === 5 && props.$showCard && css`
|
|
@@ -32,7 +37,7 @@ const BadgePill = styled.span.withConfig({
|
|
|
32
37
|
padding: 2px 8px;
|
|
33
38
|
border-radius: 9999px;
|
|
34
39
|
width: fit-content;
|
|
35
|
-
|
|
40
|
+
height: 24px;
|
|
36
41
|
${props => (props.$severity === 1 || props.$severity === 2) && css`
|
|
37
42
|
border-style: solid;
|
|
38
43
|
border-width: 1px;
|
|
@@ -43,25 +48,25 @@ const BadgePill = styled.span.withConfig({
|
|
|
43
48
|
|
|
44
49
|
${props => (props.$severity === 3 || props.$severity === 4) && css`
|
|
45
50
|
${props.theme.themeProp('background', '#2e2301', '#faeeb3')}
|
|
46
|
-
${props.theme.themeProp('color', '#eab308', '#
|
|
51
|
+
${props.theme.themeProp('color', '#eab308', '#78350F')}
|
|
47
52
|
`}
|
|
48
53
|
|
|
49
54
|
${props => props.$severity === 5 && css`
|
|
50
|
-
${props.theme.themeProp('background', '
|
|
51
|
-
${props.theme.themeProp('color', '#
|
|
55
|
+
${props.theme.themeProp('background', '#7E1B1B', 'rgba(182, 41, 2, 0.1)')}
|
|
56
|
+
${props.theme.themeProp('color', '#e8d5d6', '#b62902')}
|
|
52
57
|
`}
|
|
53
58
|
`;
|
|
54
59
|
const BadgeText = styled.span.withConfig({
|
|
55
60
|
shouldForwardProp
|
|
56
61
|
}).attrs(applyDefaultTheme)`
|
|
57
|
-
font-size: 12px;
|
|
62
|
+
font-size: ${props => props.$fontSize || '12px'};
|
|
58
63
|
font-weight: 500;
|
|
59
64
|
line-height: 1.333em;
|
|
60
65
|
`;
|
|
61
66
|
const InstructionText = styled.p.withConfig({
|
|
62
67
|
shouldForwardProp
|
|
63
68
|
}).attrs(applyDefaultTheme)`
|
|
64
|
-
font-size: 14px;
|
|
69
|
+
font-size: ${props => props.$fontSize || '14px'};
|
|
65
70
|
font-weight: 400;
|
|
66
71
|
line-height: 1.286em;
|
|
67
72
|
margin: 0;
|
|
@@ -0,0 +1 @@
|
|
|
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,CAAA;AAC3B;AACA;AACA;AACA,WAAA,EAAaC,KAAK,IAAIA,KAAK,CAACC,QAAQ,IAAI,WAAW,CAAA;AACnD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C,CAAC,CACDO,KAAK,CAACC,iBAAiB,CAAC,CAAA;AAC3B,aAAA,EAAeC,KAAK,IAAIA,KAAK,CAACa,SAAS,IAAI,MAAM,CAAA;AACjD;AACA;AACA,EAAC;AAEM,MAAMC,eAAe,GAAGnB,MAAM,CAACoB,CAAC,CACpClB,UAAU,CAAC;AACVN,EAAAA,iBAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAACC,iBAAiB,CAAC,CAAA;AAC3B,aAAA,EAAeC,KAAK,IAAIA,KAAK,CAACa,SAAS,IAAI,MAAM,CAAA;AACjD;AACA;AACA;AACA,EAAIb,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;;;;"}
|
|
@@ -1,14 +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 '
|
|
5
|
-
import '../../data/Badge/Badge.js';
|
|
6
|
-
import InstructionsSeverityDisplay from '../../data/InstructionsSeverityDisplay/InstructionsSeverityDisplay.js';
|
|
7
|
-
import '../../data/Popover/Popover.js';
|
|
8
|
-
import '../../data/Tab/Tab.js';
|
|
9
|
-
import '../../data/Tabs/Tabs.js';
|
|
10
|
-
import '../../data/Tooltip/Tooltip.js';
|
|
11
|
-
import '../../data/VerificationStatusIcon/VerificationStatusIcon.js';
|
|
4
|
+
import InstructionsSeverityDisplay from '../InstructionsSeverityDisplay/InstructionsSeverityDisplay.js';
|
|
12
5
|
import { SummaryCard as SummaryCard$1, Gutter, Header, HeaderLeft, HeaderRight, Title, Description, Footer, FooterLeft, FooterRight } from './SummaryCard.styled.js';
|
|
13
6
|
|
|
14
7
|
const SummaryCard = React__default.forwardRef(function AssetSummaryCard({
|
|
@@ -16,7 +9,7 @@ const SummaryCard = React__default.forwardRef(function AssetSummaryCard({
|
|
|
16
9
|
title,
|
|
17
10
|
description,
|
|
18
11
|
instructions,
|
|
19
|
-
|
|
12
|
+
instructionsSeverity,
|
|
20
13
|
headerLeft,
|
|
21
14
|
headerRight,
|
|
22
15
|
footerLeft,
|
|
@@ -24,6 +17,7 @@ const SummaryCard = React__default.forwardRef(function AssetSummaryCard({
|
|
|
24
17
|
width,
|
|
25
18
|
useBorder,
|
|
26
19
|
view,
|
|
20
|
+
instructionLabels,
|
|
27
21
|
...props
|
|
28
22
|
}, forwardedRef) {
|
|
29
23
|
const shouldRenderInstructions = !!instructions;
|
|
@@ -48,9 +42,12 @@ const SummaryCard = React__default.forwardRef(function AssetSummaryCard({
|
|
|
48
42
|
}), description && React__default.createElement(Description, null, description), React__default.createElement(Gutter, {
|
|
49
43
|
$gutter: 16
|
|
50
44
|
}), shouldRenderInstructions && React__default.createElement(InstructionsSeverityDisplay, {
|
|
45
|
+
labels: instructionLabels,
|
|
51
46
|
instructionText: instructions,
|
|
52
|
-
severity:
|
|
53
|
-
showCard: false
|
|
47
|
+
severity: instructionsSeverity,
|
|
48
|
+
showCard: false,
|
|
49
|
+
padding: `14px 17px`,
|
|
50
|
+
detailsFontSize: `12px`
|
|
54
51
|
}), shouldAddGutterAfterInstructions && React__default.createElement(Gutter, {
|
|
55
52
|
$gutter: 16
|
|
56
53
|
}), shouldRenderFooter && React__default.createElement(Footer, null, React__default.createElement(FooterLeft, null, footerLeft), React__default.createElement(FooterRight, null, footerRight)), shouldRenderFooter && React__default.createElement(Gutter, {
|
|
@@ -62,20 +59,21 @@ SummaryCard.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
62
59
|
title: PropTypes.string,
|
|
63
60
|
description: PropTypes.string,
|
|
64
61
|
instructions: PropTypes.string,
|
|
65
|
-
|
|
62
|
+
instructionsSeverity: PropTypes.oneOf([1, 2, 3, 4, 5]),
|
|
66
63
|
headerLeft: PropTypes.node,
|
|
67
64
|
headerRight: PropTypes.node,
|
|
68
65
|
footerLeft: PropTypes.node,
|
|
69
66
|
footerRight: PropTypes.node,
|
|
70
67
|
width: PropTypes.number,
|
|
71
68
|
useBorder: PropTypes.bool,
|
|
72
|
-
view: PropTypes.string
|
|
69
|
+
view: PropTypes.string,
|
|
70
|
+
instructionLabels: PropTypes.objectOf(PropTypes.string)
|
|
73
71
|
} : {};
|
|
74
72
|
SummaryCard.defaultProps = {
|
|
75
73
|
title: '',
|
|
76
74
|
description: '',
|
|
77
75
|
instructions: '',
|
|
78
|
-
|
|
76
|
+
instructionsSeverity: 1,
|
|
79
77
|
headerLeft: null,
|
|
80
78
|
headerRight: null,
|
|
81
79
|
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 InstructionsSeverityDisplay from '../InstructionsSeverityDisplay';\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 `instructionsSeverity` 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 instructionsSeverity,\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 <InstructionsSeverityDisplay\n labels={instructionLabels}\n instructionText={instructions}\n severity={instructionsSeverity}\n showCard={false}\n padding={`14px 17px`}\n detailsFontSize={`12px`}\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 instructionsSeverity: 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 instructionsSeverity: 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","instructionsSeverity","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","InstructionsSeverityDisplay","labels","instructionText","severity","showCard","padding","detailsFontSize","propTypes","process","env","NODE_ENV","PropTypes","bool","string","oneOf","node","number","objectOf","defaultProps"],"mappings":";;;;;;AA6BMA,MAAAA,WAAW,GAAGC,cAAK,CAACC,UAAU,CAAC,SAASC,g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AAoB,EAAE,CAAC;AACvBC,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,6 +11,7 @@ const SummaryCard = styled.div.withConfig({
|
|
|
11
11
|
display: flex;
|
|
12
12
|
flex-direction: column;
|
|
13
13
|
border-radius: 4px;
|
|
14
|
+
overflow:hidden;
|
|
14
15
|
width: ${props => props.width ? `${props.width}px` : '100%'};
|
|
15
16
|
${props => props.view === 'compact' ? props.theme.themeProp('background', props.theme.getColor('gray-700'), props.theme.getColor('white')) : 'background: transparent'};
|
|
16
17
|
|
|
@@ -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 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","width","view","theme","themeProp","getColor","$useBorder","Gutter","renderAsMargin","css","$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,SAAA,EAAWC,KAAK,IAAKA,KAAK,CAACC,KAAK,GAAG,CAAGD,EAAAA,KAAK,CAACC,KAAK,CAAI,EAAA,CAAA,GAAG,MAAO,CAAA;AAC/D,EAAA,EAAID,KAAK,IACLA,KAAK,CAACE,IAAI,KAAK,SAAS,GACpBF,KAAK,CAACG,KAAK,CAACC,SAAS,CACnB,YAAY,EACZJ,KAAK,CAACG,KAAK,CAACE,QAAQ,CAAC,UA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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,CAACG,KAAK,CAACC,SAAS,CAAC,MAAM,EAAEJ,KAAK,CAACG,KAAK,CAACE,QAAQ,CAAC,UAAU,CAAC,EAAEL,KAAK,CAACG,KAAK,CAACE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAA;AAClG;;;;"}
|
|
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","width","view","theme","themeProp","getColor","$useBorder","Gutter","renderAsMargin","css","$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,CA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,CAACE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAA;AAClG;;;;"}
|
package/build/widgets/index.js
CHANGED
|
@@ -8,4 +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 InstructionsSeverityDisplay } from './InstructionsSeverityDisplay/InstructionsSeverityDisplay.js';
|
|
11
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InstructionsSeverityDisplay.js","sources":["../../../src/components/data/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 getSeverityConfig = severity => {\n switch (severity) {\n case 1:\n case 2:\n return { label: 'Info' };\n case 3:\n case 4:\n return { label: 'Limited use' };\n case 5:\n return { label: 'Highly restricted' };\n default:\n return null;\n }\n};\n\n/**\n * Displays instruction text with a severity-level badge.\n *\n * ### Import\n *\n * ``` js\n * import { InstructionsSeverityDisplay } from '@ntbjs/react-components/data'\n * // or\n * import InstructionsSeverityDisplay from '@ntbjs/react-components/data/InstructionsSeverityDisplay'\n * ```\n *\n * ## Props\n * ```\n * Pass `severity` (1-5) to control the visual style.\n * Pass `instructionText` to display the instruction content.\n * Optionally pass `severityLabel` to override the default badge label.\n * Optionally pass `icon` to override the default icon element.\n * Pass `showCard={false}` to render without border-radius, shadow, and border.\n * ```\n */\n\nconst InstructionsSeverityDisplay = React.forwardRef(function InstructionsSeverityDisplay(\n { severity, instructionText, severityLabel, icon, showCard = true, ...props },\n forwardedRef\n) {\n if (!instructionText) {\n return null;\n }\n\n const config = getSeverityConfig(severity);\n\n if (!config) {\n return null;\n }\n\n const displayLabel = severityLabel || config.label;\n\n return (\n <S.Card ref={forwardedRef} $severity={severity} $showCard={showCard} {...props}>\n <S.BadgePill $severity={severity}>\n {icon || <InformationIcon />}\n <S.BadgeText>{displayLabel}</S.BadgeText>\n </S.BadgePill>\n <S.InstructionText>{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 /** 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};\n\nexport default InstructionsSeverityDisplay;\n"],"names":["InformationIcon","React","createElement","width","height","viewBox","fill","xmlns","d","getSeverityConfig","severity","label","InstructionsSeverityDisplay","forwardRef","instructionText","severityLabel","icon","showCard","props","forwardedRef","config","displayLabel","S","_extends","ref","$severity","$showCard","propTypes","process","env","NODE_ENV","PropTypes","oneOf","string","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,iBAAiB,GAAGC,QAAQ,IAAI;AACpC,EAAA,QAAQA,QAAQ;AACd,IAAA,KAAK,CAAC,CAAA;AACN,IAAA,KAAK,CAAC;MACJ,OAAO;AAAEC,QAAAA,KAAK,EAAE,MAAA;OAAQ,CAAA;AAC1B,IAAA,KAAK,CAAC,CAAA;AACN,IAAA,KAAK,CAAC;MACJ,OAAO;AAAEA,QAAAA,KAAK,EAAE,aAAA;OAAe,CAAA;AACjC,IAAA,KAAK,CAAC;MACJ,OAAO;AAAEA,QAAAA,KAAK,EAAE,mBAAA;OAAqB,CAAA;AACvC,IAAA;AACE,MAAA,OAAO,IAAI,CAAA;AACf,GAAA;AACF,CAAC,CAAA;AAuBKC,MAAAA,2BAA2B,GAAGX,cAAK,CAACY,UAAU,CAAC,SAASD,2BAA2BA,CACvF;EAAEF,QAAQ;EAAEI,eAAe;EAAEC,aAAa;EAAEC,IAAI;AAAEC,EAAAA,QAAQ,GAAG,IAAI;EAAE,GAAGC,KAAAA;AAAM,CAAC,EAC7EC,YAAY,E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@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InstructionsSeverityDisplay.styled.js","sources":["../../../src/components/data/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: 14px 10px;\n ${props => props.theme.themeProp('background', props.theme.getColor('gray-900'), props.theme.getColor('white'))}\n\n ${props =>\n props.$showCard &&\n css`\n border-radius: 10px;\n box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.16);\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\n ${props =>\n (props.$severity === 1 || props.$severity === 2) &&\n css`\n border-style: solid;\n border-width: 1px;\n ${props.theme.themeProp('background', props.theme.getColor('gray-800'), props.theme.getColor('white'))}\n ${props.theme.themeProp('border-color', '#3a3a3a', '#ece4e1')}\n ${props.theme.themeProp('color', props.theme.getColor('gray-300'), props.theme.getColor('black'))}\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', '#3b302b')}\n `}\n\n ${props =>\n props.$severity === 5 &&\n css`\n ${props.theme.themeProp('background', 'rgba(182, 41, 2, 0.2)', 'rgba(182, 41, 2, 0.1)')}\n ${props.theme.themeProp('color', '#ef4444', '#b62902')}\n `}\n`;\n\nexport const BadgeText = styled.span\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n font-size: 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: 14px;\n font-weight: 400;\n line-height: 1.286em;\n margin: 0;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-300'),\n props.theme.getColor('black')\n )}\n`;\n"],"names":["shouldForwardProp","prop","startsWith","Card","styled","div","withConfig","attrs","applyDefaultTheme","props","theme","themeProp","getColor","$showCard","css","$severity","BadgePill","span","BadgeText","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,CAAA;AAC3B;AACA;AACA;AACA;AACA,EAAIC,EAAAA,KAAK,IAAIA,KAAK,CAACC,KAAK,CAACC,SAAS,CAAC,YAAY,EAAEF,KAAK,CAACC,KAAK,CAACE,QAAQ,CAAC,UAAU,CAAC,EAAEH,KAAK,CAACC,KAAK,CAACE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAA;AACjH;AACA,EAAA,EAAIH,KAAK,IACLA,KAAK,CAACI,SAAS,IACfC,GAAG,CAAA;AACP;AACA;AACA,IAAK,CAAA,CAAA;AACL;AACA,EAAA,EAAIL,KAAK,IACLA,KAAK,CAACM,SAAS,KAAK,CAAC,IACrBN,KAAK,CAACI,SAAS,IACfC,GAAG,CAAA;AACP,MAAQL,EAAAA,KAAK,CAACC,KAAK,CAACC,SAAS,CAAC,QAAQ,EAAE,mBAAmB,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