@laerdal/life-react-components 1.10.3-dev.5 → 1.10.3-dev.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/GlobalNavigationBar/mobile/MobileMenuContent.cjs +1 -1
- package/dist/GlobalNavigationBar/mobile/MobileMenuContent.cjs.map +1 -1
- package/dist/GlobalNavigationBar/mobile/MobileMenuContent.js +1 -1
- package/dist/GlobalNavigationBar/mobile/MobileMenuContent.js.map +1 -1
- package/dist/Table/Table.cjs +28 -21
- package/dist/Table/Table.cjs.map +1 -1
- package/dist/Table/Table.js +29 -22
- package/dist/Table/Table.js.map +1 -1
- package/dist/Table/TableBody.cjs +42 -122
- package/dist/Table/TableBody.cjs.map +1 -1
- package/dist/Table/TableBody.d.ts +1 -4
- package/dist/Table/TableBody.js +43 -120
- package/dist/Table/TableBody.js.map +1 -1
- package/dist/Table/TableFooter.cjs +59 -54
- package/dist/Table/TableFooter.cjs.map +1 -1
- package/dist/Table/TableFooter.js +59 -54
- package/dist/Table/TableFooter.js.map +1 -1
- package/dist/Table/TableHeaders.cjs +67 -13
- package/dist/Table/TableHeaders.cjs.map +1 -1
- package/dist/Table/TableHeaders.d.ts +4 -1
- package/dist/Table/TableHeaders.js +64 -15
- package/dist/Table/TableHeaders.js.map +1 -1
- package/dist/Table/TableStyles.cjs +20 -30
- package/dist/Table/TableStyles.cjs.map +1 -1
- package/dist/Table/TableStyles.d.ts +3 -5
- package/dist/Table/TableStyles.js +20 -23
- package/dist/Table/TableStyles.js.map +1 -1
- package/dist/Tag/Tag.cjs +9 -34
- package/dist/Tag/Tag.cjs.map +1 -1
- package/dist/Tag/Tag.js +9 -34
- package/dist/Tag/Tag.js.map +1 -1
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.TableWrapper = exports.StyledTableSpinner = exports.StyledTableNoRowsLabelRow = exports.StyledTableHeaderTitleContent = exports.StyledTableHeaderTitle = exports.
|
|
8
|
+
exports.TableWrapper = exports.StyledTableSpinner = exports.StyledTableNoRowsLabelRow = exports.StyledTableHeaderTitleContent = exports.StyledTableHeaderTitle = exports.StyledTableHeaderColumns = exports.StyledTableHeaderColumnContent = exports.StyledTableHeaderColumn = exports.StyledTableHeader = exports.StyledTableFooterCurrentInfo = exports.StyledTableFooterControls = exports.StyledTableFooterContent = exports.StyledTableFooterCollapseButton = exports.StyledTableFooter = exports.StyledTableCellText = exports.StyledTableCellIcon = exports.StyledTableCellContent = exports.StyledTableCell = exports.StyledTableBodyRow = exports.StyledTableBody = exports.StyledTable = void 0;
|
|
9
9
|
|
|
10
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
11
|
|
|
@@ -19,9 +19,7 @@ var _zIndexes = require("../styles/z-indexes");
|
|
|
19
19
|
|
|
20
20
|
var _Checkbox = require("../InputFields/Checkbox");
|
|
21
21
|
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23;
|
|
22
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21;
|
|
25
23
|
|
|
26
24
|
/**
|
|
27
25
|
* Table styles
|
|
@@ -34,11 +32,11 @@ var StyledTable = _styledComponents.default.table(_templateObject2 || (_template
|
|
|
34
32
|
|
|
35
33
|
exports.StyledTable = StyledTable;
|
|
36
34
|
|
|
37
|
-
var StyledTableHeader = _styledComponents.default.
|
|
35
|
+
var StyledTableHeader = _styledComponents.default.thead(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n"])));
|
|
38
36
|
|
|
39
37
|
exports.StyledTableHeader = StyledTableHeader;
|
|
40
38
|
|
|
41
|
-
var StyledTableHeaderTitle = _styledComponents.default.
|
|
39
|
+
var StyledTableHeaderTitle = _styledComponents.default.tr(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n"])));
|
|
42
40
|
|
|
43
41
|
exports.StyledTableHeaderTitle = StyledTableHeaderTitle;
|
|
44
42
|
|
|
@@ -46,75 +44,67 @@ var StyledTableHeaderTitleContent = _styledComponents.default.div(_templateObjec
|
|
|
46
44
|
|
|
47
45
|
exports.StyledTableHeaderTitleContent = StyledTableHeaderTitleContent;
|
|
48
46
|
|
|
49
|
-
var
|
|
50
|
-
|
|
51
|
-
exports.StyledTableHeaderRow = StyledTableHeaderRow;
|
|
52
|
-
|
|
53
|
-
var StyledTableHeaderColumns = _styledComponents.default.tr(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n"])));
|
|
47
|
+
var StyledTableHeaderColumns = _styledComponents.default.tr(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n"])));
|
|
54
48
|
|
|
55
49
|
exports.StyledTableHeaderColumns = StyledTableHeaderColumns;
|
|
56
50
|
|
|
57
|
-
var StyledTableHeaderColumnContent = _styledComponents.default.div(
|
|
51
|
+
var StyledTableHeaderColumnContent = _styledComponents.default.div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n box-sizing: border-box;\n min-height: 56px;\n padding: 0 16px;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n border-top: 1px solid ", ";\n border-bottom: 1px solid ", ";\n"])), _styles.COLORS.neutral_200, _styles.COLORS.neutral_200);
|
|
58
52
|
|
|
59
53
|
exports.StyledTableHeaderColumnContent = StyledTableHeaderColumnContent;
|
|
60
54
|
|
|
61
|
-
var StyledTableHeaderColumn = _styledComponents.default.th(
|
|
55
|
+
var StyledTableHeaderColumn = _styledComponents.default.th(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n position: relative;\n text-align: unset;\n background-color: ", ";\n\n //fixes header heights no idea why\n height: 1px;\n\n &.sortable {\n cursor: pointer;\n\n &:hover {\n background-color: ", ";\n color: ", ";\n z-index: ", ";\n }\n\n &:active {\n background-color: ", ";\n color: ", ";\n z-index: ", ";\n }\n\n &:focus {\n ", "\n }\n }\n\n &.sortable ", " > svg {\n opacity: 0;\n }\n\n &.sortable.sorted ", " > svg {\n opacity: 1;\n }\n\n &.sorted {\n background-color: ", ";\n }\n"])), (0, _typography.ComponentSStyling)(_typography.ComponentTextStyle.Bold, _styles.COLORS.neutral_600), _styles.COLORS.white, _styles.COLORS.primary_20, _styles.COLORS.primary_700, _zIndexes.Z_INDEXES.hover, _styles.COLORS.primary_100, _styles.COLORS.primary_800, _zIndexes.Z_INDEXES.active, _styles.focusStyles, StyledTableHeaderColumnContent, StyledTableHeaderColumnContent, _styles.COLORS.neutral_20);
|
|
62
56
|
|
|
63
57
|
exports.StyledTableHeaderColumn = StyledTableHeaderColumn;
|
|
64
58
|
|
|
65
|
-
var StyledTableBodyRow = _styledComponents.default.tr(
|
|
59
|
+
var StyledTableBodyRow = _styledComponents.default.tr(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n cursor: pointer;\n position: relative;\n outline: none;\n\n &.selected{\n background-color: ", ";\n }\n \n &:hover {\n background-color: ", ";\n z-index: ", ";\n }\n\n &:focus {\n ", "\n }\n\n &:active {\n z-index: ", ";\n }\n\n"])), _styles.COLORS.primary_100, _styles.COLORS.primary_200, _zIndexes.Z_INDEXES.hover, _styles.focusStyles, _zIndexes.Z_INDEXES.active);
|
|
66
60
|
|
|
67
61
|
exports.StyledTableBodyRow = StyledTableBodyRow;
|
|
68
62
|
|
|
69
|
-
var StyledTableNoRowsLabelRow = _styledComponents.default.tr(
|
|
63
|
+
var StyledTableNoRowsLabelRow = _styledComponents.default.tr(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n outline: none;\n background-color: ", ";\n"])), _styles.COLORS.neutral_50);
|
|
70
64
|
|
|
71
65
|
exports.StyledTableNoRowsLabelRow = StyledTableNoRowsLabelRow;
|
|
72
66
|
|
|
73
|
-
var StyledTableBody = _styledComponents.default.tbody(
|
|
67
|
+
var StyledTableBody = _styledComponents.default.tbody(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2.default)(["\n ", ":nth-child(odd):not(.selected):not(:hover):not(:focus):not(:active) {\n background-color: ", ";\n }\n\n ", ":nth-child(even):not(.selected):not(:hover):not(:focus):not(:active) {\n background-color: ", ";\n }\n"])), StyledTableBodyRow, _styles.COLORS.neutral_50, StyledTableBodyRow, _styles.COLORS.neutral_20);
|
|
74
68
|
|
|
75
69
|
exports.StyledTableBody = StyledTableBody;
|
|
76
70
|
|
|
77
|
-
var StyledTableCell = _styledComponents.default.td(
|
|
71
|
+
var StyledTableCell = _styledComponents.default.td(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2.default)([""])));
|
|
78
72
|
|
|
79
73
|
exports.StyledTableCell = StyledTableCell;
|
|
80
74
|
|
|
81
|
-
var StyledTableCellContent = _styledComponents.default.div(
|
|
75
|
+
var StyledTableCellContent = _styledComponents.default.div(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2.default)(["\n min-height: 48px;\n\n padding: 0 16px;\n ", "\n\n display: flex;\n align-items: center;\n justify-content: left;\n gap: 8px;\n\n &.truncate-text,\n &.truncate-text span {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n &.left {\n justify-content: left;\n }\n\n &.right {\n justify-content: right;\n }\n\n &.center {\n justify-content: center;\n }\n\n a:first-letter,\n span:first-letter {\n text-transform: uppercase;\n }\n \n ", "{\n width: fit-content;\n }\n"])), (0, _typography.ComponentSStyling)(_typography.ComponentTextStyle.Regular, _styles.COLORS.black), _Checkbox.StyledCheckBox);
|
|
82
76
|
|
|
83
77
|
exports.StyledTableCellContent = StyledTableCellContent;
|
|
84
78
|
|
|
85
|
-
var StyledTableCellIcon = _styledComponents.default.div(
|
|
79
|
+
var StyledTableCellIcon = _styledComponents.default.div(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n width: 24px;\n height: 24px;\n\n svg {\n color: ", ";\n width: 24px;\n height: 24px;\n }\n"])), _styles.COLORS.neutral_700, _styles.COLORS.neutral_700);
|
|
86
80
|
|
|
87
81
|
exports.StyledTableCellIcon = StyledTableCellIcon;
|
|
88
82
|
|
|
89
|
-
var StyledTableCellText = _styledComponents.default.span(
|
|
83
|
+
var StyledTableCellText = _styledComponents.default.span(_templateObject15 || (_templateObject15 = (0, _taggedTemplateLiteral2.default)(["\n padding: 12px 0;\n"])));
|
|
90
84
|
|
|
91
85
|
exports.StyledTableCellText = StyledTableCellText;
|
|
92
86
|
|
|
93
|
-
var StyledTableFooter = _styledComponents.default.
|
|
87
|
+
var StyledTableFooter = _styledComponents.default.tfoot(_templateObject16 || (_templateObject16 = (0, _taggedTemplateLiteral2.default)(["\n"])));
|
|
94
88
|
|
|
95
89
|
exports.StyledTableFooter = StyledTableFooter;
|
|
96
90
|
|
|
97
|
-
var StyledTableFooterContent = _styledComponents.default.div(
|
|
91
|
+
var StyledTableFooterContent = _styledComponents.default.div(_templateObject17 || (_templateObject17 = (0, _taggedTemplateLiteral2.default)(["\n border-top: 2px solid ", ";\n border-bottom: 1px solid ", ";\n box-sizing: border-box;\n min-height: 56px;\n\n display: flex;\n align-items: center;\n justify-content: right;\n\n"])), _styles.COLORS.neutral_200, _styles.COLORS.neutral_200);
|
|
98
92
|
|
|
99
93
|
exports.StyledTableFooterContent = StyledTableFooterContent;
|
|
100
94
|
|
|
101
|
-
var StyledTableFooterCurrentInfo = _styledComponents.default.span(
|
|
95
|
+
var StyledTableFooterCurrentInfo = _styledComponents.default.span(_templateObject18 || (_templateObject18 = (0, _taggedTemplateLiteral2.default)(["\n padding: 0 16px;\n ", "\n"])), (0, _typography.ComponentXSStyling)(_typography.ComponentTextStyle.Regular, _styles.COLORS.black));
|
|
102
96
|
|
|
103
97
|
exports.StyledTableFooterCurrentInfo = StyledTableFooterCurrentInfo;
|
|
104
98
|
|
|
105
|
-
var StyledTableFooterControls = _styledComponents.default.div(
|
|
99
|
+
var StyledTableFooterControls = _styledComponents.default.div(_templateObject19 || (_templateObject19 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n"])));
|
|
106
100
|
|
|
107
101
|
exports.StyledTableFooterControls = StyledTableFooterControls;
|
|
108
102
|
|
|
109
|
-
var StyledTableSpinner = _styledComponents.default.div(
|
|
103
|
+
var StyledTableSpinner = _styledComponents.default.div(_templateObject20 || (_templateObject20 = (0, _taggedTemplateLiteral2.default)(["\n height: 100%;\n width: 100%;\n position: absolute;\n background-color: rgba(255, 255, 255, 0.75);\n top: 0;\n z-index: ", ";\n"])), _zIndexes.Z_INDEXES.backdrop);
|
|
110
104
|
|
|
111
105
|
exports.StyledTableSpinner = StyledTableSpinner;
|
|
112
106
|
|
|
113
|
-
var StyledTableFooterCollapseButton = _styledComponents.default.button(
|
|
107
|
+
var StyledTableFooterCollapseButton = _styledComponents.default.button(_templateObject21 || (_templateObject21 = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n border-bottom: 1px solid ", ";\n border-top: 1px solid ", ";\n border-left: none;\n border-right: none;\n box-sizing: border-box;\n min-height: 48px;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: center;\n gap: 4px;\n background: ", ";\n\n cursor: pointer;\n\n ", "\n \n &:focus {\n ", "\n }\n\n &:hover {\n z-index: ", ";\n background: ", ";\n color: ", ";\n }\n\n &:active {\n z-index: ", ";\n background: ", ";\n color: ", ";\n }\n\n &:disabled {\n display: none;\n }\n\n"])), _styles.COLORS.neutral_200, _styles.COLORS.neutral_200, _styles.COLORS.white, (0, _typography.ComponentMStyling)(_typography.ComponentTextStyle.Bold, _styles.COLORS.neutral_600), _styles.focusStyles, _zIndexes.Z_INDEXES.hover, _styles.COLORS.primary_20, _styles.COLORS.primary_700, _zIndexes.Z_INDEXES.active, _styles.COLORS.primary_100, _styles.COLORS.primary_800);
|
|
114
108
|
|
|
115
109
|
exports.StyledTableFooterCollapseButton = StyledTableFooterCollapseButton;
|
|
116
|
-
|
|
117
|
-
var StyledTableBodyWrapper = _styledComponents.default.div(_templateObject23 || (_templateObject23 = (0, _taggedTemplateLiteral2.default)(["\n overflow-x: auto;\n ", "\n\n ::-webkit-scrollbar-track {\n margin: 6px;\n }\n\n &.scrollable{\n margin-bottom: 6px;\n padding-bottom: 10px;\n }\n"])), (0, _styles.scrollBarStyling)(_types.Size.Small));
|
|
118
|
-
|
|
119
|
-
exports.StyledTableBodyWrapper = StyledTableBodyWrapper;
|
|
120
110
|
//# sourceMappingURL=TableStyles.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Table/TableStyles.ts"],"names":["TableWrapper","styled","div","StyledTable","table","StyledTableHeader","StyledTableHeaderTitle","StyledTableHeaderTitleContent","COLORS","neutral_200","ComponentTextStyle","Bold","black","
|
|
1
|
+
{"version":3,"sources":["../../src/Table/TableStyles.ts"],"names":["TableWrapper","styled","div","StyledTable","table","StyledTableHeader","thead","StyledTableHeaderTitle","tr","StyledTableHeaderTitleContent","COLORS","neutral_200","ComponentTextStyle","Bold","black","StyledTableHeaderColumns","StyledTableHeaderColumnContent","StyledTableHeaderColumn","th","neutral_600","white","primary_20","primary_700","Z_INDEXES","hover","primary_100","primary_800","active","focusStyles","neutral_20","StyledTableBodyRow","primary_200","StyledTableNoRowsLabelRow","neutral_50","StyledTableBody","tbody","StyledTableCell","td","StyledTableCellContent","Regular","StyledCheckBox","StyledTableCellIcon","neutral_700","StyledTableCellText","span","StyledTableFooter","tfoot","StyledTableFooterContent","StyledTableFooterCurrentInfo","StyledTableFooterControls","StyledTableSpinner","backdrop","StyledTableFooterCollapseButton","button"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AAOA;;AACA;;;;AAEA;AACA;AACA;AAEO,IAAMA,YAAY,GAAGC,0BAAOC,GAAV,4GAAlB;;;;AAKA,IAAMC,WAAW,GAAGF,0BAAOG,KAAV,6NAAjB;;;;AAaA,IAAMC,iBAAiB,GAAGJ,0BAAOK,KAAV,uFAAvB;;;;AAGA,IAAMC,sBAAsB,GAAGN,0BAAOO,EAAV,uFAA5B;;;;AAGA,IAAMC,6BAA6B,GAAGR,0BAAOC,GAAV,oXAObQ,eAAOC,WAPM,EAQhBD,eAAOC,WARS,EAWtC,mCAAkBC,+BAAmBC,IAArC,EAA2CH,eAAOI,KAAlD,CAXsC,CAAnC;;;;AAiBA,IAAMC,wBAAwB,GAAGd,0BAAOO,EAAV,uFAA9B;;;;AAGA,IAAMQ,8BAA8B,GAAGf,0BAAOC,GAAV,2TAQjBQ,eAAOC,WARU,EASdD,eAAOC,WATO,CAApC;;;;AAYA,IAAMM,uBAAuB,GAAGhB,0BAAOiB,EAAV,mpBAChC,mCAAkBN,+BAAmBC,IAArC,EAA2CH,eAAOS,WAAlD,CADgC,EAIdT,eAAOU,KAJO,EAaVV,eAAOW,UAbG,EAcrBX,eAAOY,WAdc,EAenBC,oBAAUC,KAfS,EAmBVd,eAAOe,WAnBG,EAoBrBf,eAAOgB,WApBc,EAqBnBH,oBAAUI,MArBS,EAyB5BC,mBAzB4B,EA6BrBZ,8BA7BqB,EAiCdA,8BAjCc,EAsCZN,eAAOmB,UAtCK,CAA7B;;;;AA0CA,IAAMC,kBAAkB,GAAG7B,0BAAOO,EAAV,wVAMPE,eAAOe,WANA,EAUPf,eAAOqB,WAVA,EAWhBR,oBAAUC,KAXM,EAezBI,mBAf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BAAUC,KAxBmB,EAyB1Bd,eAAOW,UAzBmB,EA0B/BX,eAAOY,WA1BwB,EA8B7BC,oBAAUI,MA9BmB,EA+B1BjB,eAAOe,WA/BmB,EAgC/Bf,eAAOgB,WAhCwB,CAArC","sourcesContent":["/**\n * Import third-party libraries.\n */\nimport styled from 'styled-components';\n\n/**\n * Import custom style properties.\n */\nimport {COLORS, focusStyles} from '../styles';\nimport {\n ComponentLStyling,\n ComponentMStyling,\n ComponentSStyling,\n ComponentTextStyle,\n ComponentXSStyling\n} from '../styles/typography';\nimport {Z_INDEXES} from '../styles/z-indexes';\nimport {StyledCheckBox} from '../InputFields/Checkbox';\n\n/**\n * Table styles\n */\n\nexport const TableWrapper = styled.div`\n position: relative;\n`;\n\n\nexport const StyledTable = styled.table`\n background: transparent;\n width: 100%;\n\n &.fixed {\n table-layout: fixed;\n }\n\n &.auto {\n table-layout: auto;\n }\n`;\n\nexport const StyledTableHeader = styled.thead`\n`;\n\nexport const StyledTableHeaderTitle = styled.tr`\n`;\n\nexport const StyledTableHeaderTitleContent = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n box-sizing: border-box;\n min-height: 56px;\n border-bottom: 1px solid ${COLORS.neutral_200};\n border-top: 2px solid ${COLORS.neutral_200};\n padding: 0 16px;\n\n ${ComponentLStyling(ComponentTextStyle.Bold, COLORS.black)}\n .title-menu {\n margin-right: -16px;\n }\n`;\n\nexport const StyledTableHeaderColumns = styled.tr`\n`;\n\nexport const StyledTableHeaderColumnContent = styled.div`\n box-sizing: border-box;\n min-height: 56px;\n padding: 0 16px;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n border-top: 1px solid ${COLORS.neutral_200};\n border-bottom: 1px solid ${COLORS.neutral_200};\n`;\n\nexport const StyledTableHeaderColumn = styled.th`\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n position: relative;\n text-align: unset;\n background-color: ${COLORS.white};\n\n //fixes header heights no idea why\n height: 1px;\n\n &.sortable {\n cursor: pointer;\n\n &:hover {\n background-color: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n z-index: ${Z_INDEXES.hover};\n }\n\n &:active {\n background-color: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n z-index: ${Z_INDEXES.active};\n }\n\n &:focus {\n ${focusStyles}\n }\n }\n\n &.sortable ${StyledTableHeaderColumnContent} > svg {\n opacity: 0;\n }\n\n &.sortable.sorted ${StyledTableHeaderColumnContent} > svg {\n opacity: 1;\n }\n\n &.sorted {\n background-color: ${COLORS.neutral_20};\n }\n`;\n\nexport const StyledTableBodyRow = styled.tr`\n cursor: pointer;\n position: relative;\n outline: none;\n\n &.selected{\n background-color: ${COLORS.primary_100};\n }\n \n &:hover {\n background-color: ${COLORS.primary_200};\n z-index: ${Z_INDEXES.hover};\n }\n\n &:focus {\n ${focusStyles}\n }\n\n &:active {\n z-index: ${Z_INDEXES.active};\n }\n\n`;\n\nexport const StyledTableNoRowsLabelRow = styled.tr`\n position: relative;\n outline: none;\n background-color: ${COLORS.neutral_50};\n`;\n\nexport const StyledTableBody = styled.tbody`\n ${StyledTableBodyRow}:nth-child(odd):not(.selected):not(:hover):not(:focus):not(:active) {\n background-color: ${COLORS.neutral_50};\n }\n\n ${StyledTableBodyRow}:nth-child(even):not(.selected):not(:hover):not(:focus):not(:active) {\n background-color: ${COLORS.neutral_20};\n }\n`;\n\n\nexport const StyledTableCell = styled.td``;\n\nexport const StyledTableCellContent = styled.div`\n min-height: 48px;\n\n padding: 0 16px;\n ${ComponentSStyling(ComponentTextStyle.Regular, COLORS.black)}\n\n display: flex;\n align-items: center;\n justify-content: left;\n gap: 8px;\n\n &.truncate-text,\n &.truncate-text span {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n &.left {\n justify-content: left;\n }\n\n &.right {\n justify-content: right;\n }\n\n &.center {\n justify-content: center;\n }\n\n a:first-letter,\n span:first-letter {\n text-transform: uppercase;\n }\n \n ${StyledCheckBox}{\n width: fit-content;\n }\n`;\n\nexport const StyledTableCellIcon = styled.div`\n color: ${COLORS.neutral_700};\n width: 24px;\n height: 24px;\n\n svg {\n color: ${COLORS.neutral_700};\n width: 24px;\n height: 24px;\n }\n`;\n\nexport const StyledTableCellText = styled.span`\n padding: 12px 0;\n`;\n\n\nexport const StyledTableFooter = styled.tfoot`\n`;\n\nexport const StyledTableFooterContent = styled.div`\n border-top: 2px solid ${COLORS.neutral_200};\n border-bottom: 1px solid ${COLORS.neutral_200};\n box-sizing: border-box;\n min-height: 56px;\n\n display: flex;\n align-items: center;\n justify-content: right;\n\n`;\n\nexport const StyledTableFooterCurrentInfo = styled.span`\n padding: 0 16px;\n ${ComponentXSStyling(ComponentTextStyle.Regular, COLORS.black)}\n`;\n\nexport const StyledTableFooterControls = styled.div`\n display: flex;\n`;\n\nexport const StyledTableSpinner = styled.div`\n height: 100%;\n width: 100%;\n position: absolute;\n background-color: rgba(255, 255, 255, 0.75);\n top: 0;\n z-index: ${Z_INDEXES.backdrop};\n`;\n\nexport const StyledTableFooterCollapseButton = styled.button`\n position: relative;\n border-bottom: 1px solid ${COLORS.neutral_200};\n border-top: 1px solid ${COLORS.neutral_200};\n border-left: none;\n border-right: none;\n box-sizing: border-box;\n min-height: 48px;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: center;\n gap: 4px;\n background: ${COLORS.white};\n\n cursor: pointer;\n\n ${ComponentMStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n \n &:focus {\n ${focusStyles}\n }\n\n &:hover {\n z-index: ${Z_INDEXES.hover};\n background: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n }\n\n &:active {\n z-index: ${Z_INDEXES.active};\n background: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n }\n\n &:disabled {\n display: none;\n }\n\n`;\n"],"file":"TableStyles.cjs"}
|
|
@@ -3,10 +3,9 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export declare const TableWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
5
|
export declare const StyledTable: import("styled-components").StyledComponent<"table", any, {}, never>;
|
|
6
|
-
export declare const StyledTableHeader: import("styled-components").StyledComponent<"
|
|
7
|
-
export declare const StyledTableHeaderTitle: import("styled-components").StyledComponent<"
|
|
6
|
+
export declare const StyledTableHeader: import("styled-components").StyledComponent<"thead", any, {}, never>;
|
|
7
|
+
export declare const StyledTableHeaderTitle: import("styled-components").StyledComponent<"tr", any, {}, never>;
|
|
8
8
|
export declare const StyledTableHeaderTitleContent: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
9
|
-
export declare const StyledTableHeaderRow: import("styled-components").StyledComponent<"thead", any, {}, never>;
|
|
10
9
|
export declare const StyledTableHeaderColumns: import("styled-components").StyledComponent<"tr", any, {}, never>;
|
|
11
10
|
export declare const StyledTableHeaderColumnContent: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
12
11
|
export declare const StyledTableHeaderColumn: import("styled-components").StyledComponent<"th", any, {}, never>;
|
|
@@ -17,10 +16,9 @@ export declare const StyledTableCell: import("styled-components").StyledComponen
|
|
|
17
16
|
export declare const StyledTableCellContent: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
18
17
|
export declare const StyledTableCellIcon: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
19
18
|
export declare const StyledTableCellText: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
20
|
-
export declare const StyledTableFooter: import("styled-components").StyledComponent<"
|
|
19
|
+
export declare const StyledTableFooter: import("styled-components").StyledComponent<"tfoot", any, {}, never>;
|
|
21
20
|
export declare const StyledTableFooterContent: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
22
21
|
export declare const StyledTableFooterCurrentInfo: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
23
22
|
export declare const StyledTableFooterControls: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
24
23
|
export declare const StyledTableSpinner: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
25
24
|
export declare const StyledTableFooterCollapseButton: import("styled-components").StyledComponent<"button", any, {}, never>;
|
|
26
|
-
export declare const StyledTableBodyWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
2
|
|
|
3
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21
|
|
3
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21;
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Import third-party libraries.
|
|
@@ -10,36 +10,33 @@ import styled from 'styled-components';
|
|
|
10
10
|
* Import custom style properties.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import { COLORS, focusStyles
|
|
13
|
+
import { COLORS, focusStyles } from '../styles';
|
|
14
14
|
import { ComponentLStyling, ComponentMStyling, ComponentSStyling, ComponentTextStyle, ComponentXSStyling } from '../styles/typography';
|
|
15
15
|
import { Z_INDEXES } from '../styles/z-indexes';
|
|
16
16
|
import { StyledCheckBox } from '../InputFields/Checkbox';
|
|
17
|
-
import { Size } from "../types";
|
|
18
17
|
/**
|
|
19
18
|
* Table styles
|
|
20
19
|
*/
|
|
21
20
|
|
|
22
21
|
export var TableWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n"])));
|
|
23
22
|
export var StyledTable = styled.table(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background: transparent;\n width: 100%;\n\n &.fixed {\n table-layout: fixed;\n }\n\n &.auto {\n table-layout: auto;\n }\n"])));
|
|
24
|
-
export var StyledTableHeader = styled.
|
|
25
|
-
export var StyledTableHeaderTitle = styled.
|
|
23
|
+
export var StyledTableHeader = styled.thead(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n"])));
|
|
24
|
+
export var StyledTableHeaderTitle = styled.tr(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n"])));
|
|
26
25
|
export var StyledTableHeaderTitleContent = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n box-sizing: border-box;\n min-height: 56px;\n border-bottom: 1px solid ", ";\n border-top: 2px solid ", ";\n padding: 0 16px;\n\n ", "\n .title-menu {\n margin-right: -16px;\n }\n"])), COLORS.neutral_200, COLORS.neutral_200, ComponentLStyling(ComponentTextStyle.Bold, COLORS.black));
|
|
27
|
-
export var
|
|
28
|
-
export var
|
|
29
|
-
export var
|
|
30
|
-
export var
|
|
31
|
-
export var
|
|
32
|
-
export var
|
|
33
|
-
export var
|
|
34
|
-
export var
|
|
35
|
-
export var
|
|
36
|
-
export var
|
|
37
|
-
export var
|
|
38
|
-
export var
|
|
39
|
-
export var
|
|
40
|
-
export var
|
|
41
|
-
export var
|
|
42
|
-
export var
|
|
43
|
-
export var StyledTableFooterCollapseButton = styled.button(_templateObject22 || (_templateObject22 = _taggedTemplateLiteral(["\n position: relative;\n border-bottom: 1px solid ", ";\n border-top: 1px solid ", ";\n border-left: none;\n border-right: none;\n box-sizing: border-box;\n min-height: 48px;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: center;\n gap: 4px;\n background: ", ";\n\n cursor: pointer;\n\n ", "\n \n &:focus {\n ", "\n }\n\n &:hover {\n z-index: ", ";\n background: ", ";\n color: ", ";\n }\n\n &:active {\n z-index: ", ";\n background: ", ";\n color: ", ";\n }\n\n &:disabled {\n display: none;\n }\n\n"])), COLORS.neutral_200, COLORS.neutral_200, COLORS.white, ComponentMStyling(ComponentTextStyle.Bold, COLORS.neutral_600), focusStyles, Z_INDEXES.hover, COLORS.primary_20, COLORS.primary_700, Z_INDEXES.active, COLORS.primary_100, COLORS.primary_800);
|
|
44
|
-
export var StyledTableBodyWrapper = styled.div(_templateObject23 || (_templateObject23 = _taggedTemplateLiteral(["\n overflow-x: auto;\n ", "\n\n ::-webkit-scrollbar-track {\n margin: 6px;\n }\n\n &.scrollable{\n margin-bottom: 6px;\n padding-bottom: 10px;\n }\n"])), scrollBarStyling(Size.Small));
|
|
26
|
+
export var StyledTableHeaderColumns = styled.tr(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n"])));
|
|
27
|
+
export var StyledTableHeaderColumnContent = styled.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n box-sizing: border-box;\n min-height: 56px;\n padding: 0 16px;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n border-top: 1px solid ", ";\n border-bottom: 1px solid ", ";\n"])), COLORS.neutral_200, COLORS.neutral_200);
|
|
28
|
+
export var StyledTableHeaderColumn = styled.th(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n ", "\n position: relative;\n text-align: unset;\n background-color: ", ";\n\n //fixes header heights no idea why\n height: 1px;\n\n &.sortable {\n cursor: pointer;\n\n &:hover {\n background-color: ", ";\n color: ", ";\n z-index: ", ";\n }\n\n &:active {\n background-color: ", ";\n color: ", ";\n z-index: ", ";\n }\n\n &:focus {\n ", "\n }\n }\n\n &.sortable ", " > svg {\n opacity: 0;\n }\n\n &.sortable.sorted ", " > svg {\n opacity: 1;\n }\n\n &.sorted {\n background-color: ", ";\n }\n"])), ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600), COLORS.white, COLORS.primary_20, COLORS.primary_700, Z_INDEXES.hover, COLORS.primary_100, COLORS.primary_800, Z_INDEXES.active, focusStyles, StyledTableHeaderColumnContent, StyledTableHeaderColumnContent, COLORS.neutral_20);
|
|
29
|
+
export var StyledTableBodyRow = styled.tr(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n cursor: pointer;\n position: relative;\n outline: none;\n\n &.selected{\n background-color: ", ";\n }\n \n &:hover {\n background-color: ", ";\n z-index: ", ";\n }\n\n &:focus {\n ", "\n }\n\n &:active {\n z-index: ", ";\n }\n\n"])), COLORS.primary_100, COLORS.primary_200, Z_INDEXES.hover, focusStyles, Z_INDEXES.active);
|
|
30
|
+
export var StyledTableNoRowsLabelRow = styled.tr(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n position: relative;\n outline: none;\n background-color: ", ";\n"])), COLORS.neutral_50);
|
|
31
|
+
export var StyledTableBody = styled.tbody(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n ", ":nth-child(odd):not(.selected):not(:hover):not(:focus):not(:active) {\n background-color: ", ";\n }\n\n ", ":nth-child(even):not(.selected):not(:hover):not(:focus):not(:active) {\n background-color: ", ";\n }\n"])), StyledTableBodyRow, COLORS.neutral_50, StyledTableBodyRow, COLORS.neutral_20);
|
|
32
|
+
export var StyledTableCell = styled.td(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral([""])));
|
|
33
|
+
export var StyledTableCellContent = styled.div(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n min-height: 48px;\n\n padding: 0 16px;\n ", "\n\n display: flex;\n align-items: center;\n justify-content: left;\n gap: 8px;\n\n &.truncate-text,\n &.truncate-text span {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n &.left {\n justify-content: left;\n }\n\n &.right {\n justify-content: right;\n }\n\n &.center {\n justify-content: center;\n }\n\n a:first-letter,\n span:first-letter {\n text-transform: uppercase;\n }\n \n ", "{\n width: fit-content;\n }\n"])), ComponentSStyling(ComponentTextStyle.Regular, COLORS.black), StyledCheckBox);
|
|
34
|
+
export var StyledTableCellIcon = styled.div(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n color: ", ";\n width: 24px;\n height: 24px;\n\n svg {\n color: ", ";\n width: 24px;\n height: 24px;\n }\n"])), COLORS.neutral_700, COLORS.neutral_700);
|
|
35
|
+
export var StyledTableCellText = styled.span(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n padding: 12px 0;\n"])));
|
|
36
|
+
export var StyledTableFooter = styled.tfoot(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n"])));
|
|
37
|
+
export var StyledTableFooterContent = styled.div(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n border-top: 2px solid ", ";\n border-bottom: 1px solid ", ";\n box-sizing: border-box;\n min-height: 56px;\n\n display: flex;\n align-items: center;\n justify-content: right;\n\n"])), COLORS.neutral_200, COLORS.neutral_200);
|
|
38
|
+
export var StyledTableFooterCurrentInfo = styled.span(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["\n padding: 0 16px;\n ", "\n"])), ComponentXSStyling(ComponentTextStyle.Regular, COLORS.black));
|
|
39
|
+
export var StyledTableFooterControls = styled.div(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["\n display: flex;\n"])));
|
|
40
|
+
export var StyledTableSpinner = styled.div(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["\n height: 100%;\n width: 100%;\n position: absolute;\n background-color: rgba(255, 255, 255, 0.75);\n top: 0;\n z-index: ", ";\n"])), Z_INDEXES.backdrop);
|
|
41
|
+
export var StyledTableFooterCollapseButton = styled.button(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["\n position: relative;\n border-bottom: 1px solid ", ";\n border-top: 1px solid ", ";\n border-left: none;\n border-right: none;\n box-sizing: border-box;\n min-height: 48px;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: center;\n gap: 4px;\n background: ", ";\n\n cursor: pointer;\n\n ", "\n \n &:focus {\n ", "\n }\n\n &:hover {\n z-index: ", ";\n background: ", ";\n color: ", ";\n }\n\n &:active {\n z-index: ", ";\n background: ", ";\n color: ", ";\n }\n\n &:disabled {\n display: none;\n }\n\n"])), COLORS.neutral_200, COLORS.neutral_200, COLORS.white, ComponentMStyling(ComponentTextStyle.Bold, COLORS.neutral_600), focusStyles, Z_INDEXES.hover, COLORS.primary_20, COLORS.primary_700, Z_INDEXES.active, COLORS.primary_100, COLORS.primary_800);
|
|
45
42
|
//# sourceMappingURL=TableStyles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Table/TableStyles.ts"],"names":["styled","COLORS","focusStyles","scrollBarStyling","ComponentLStyling","ComponentMStyling","ComponentSStyling","ComponentTextStyle","ComponentXSStyling","Z_INDEXES","StyledCheckBox","Size","TableWrapper","div","StyledTable","table","StyledTableHeader","StyledTableHeaderTitle","StyledTableHeaderTitleContent","neutral_200","Bold","black","StyledTableHeaderRow","thead","StyledTableHeaderColumns","tr","StyledTableHeaderColumnContent","StyledTableHeaderColumn","th","neutral_600","white","primary_20","primary_700","hover","primary_100","primary_800","active","neutral_20","StyledTableBodyRow","primary_200","StyledTableNoRowsLabelRow","neutral_50","StyledTableBody","tbody","StyledTableCell","td","StyledTableCellContent","Regular","StyledTableCellIcon","neutral_700","StyledTableCellText","span","StyledTableFooter","StyledTableFooterContent","StyledTableFooterCurrentInfo","StyledTableFooterControls","StyledTableSpinner","backdrop","StyledTableFooterCollapseButton","button","StyledTableBodyWrapper","Small"],"mappings":";;;;AAAA;AACA;AACA;AACA,OAAOA,MAAP,MAAmB,mBAAnB;AAEA;AACA;AACA;;AACA,SAAQC,MAAR,EAAgBC,WAAhB,EAA6BC,gBAA7B,QAAoD,WAApD;AACA,SACEC,iBADF,EAEEC,iBAFF,EAGEC,iBAHF,EAIEC,kBAJF,EAKEC,kBALF,QAMO,sBANP;AAOA,SAAQC,SAAR,QAAwB,qBAAxB;AACA,SAAQC,cAAR,QAA6B,yBAA7B;AACA,SAAQC,IAAR,QAAmB,UAAnB;AAEA;AACA;AACA;;AAEA,OAAO,IAAMC,YAAY,GAAGZ,MAAM,CAACa,GAAV,8F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ACkB,WAFQ,EAGlBlB,MAAM,CAACkB,WAHW,EAa5BlB,MAAM,CAAC6B,KAbqB,EAiBxCzB,iBAAiB,CAACE,kBAAkB,CAACa,IAApB,EAA0BnB,MAAM,CAAC4B,WAAjC,CAjBuB,EAoBtC3B,WApBsC,EAwB7BO,SAAS,CAACwB,KAxBmB,EAyB1BhC,MAAM,CAAC8B,UAzBmB,EA0B/B9B,MAAM,CAAC+B,WA1BwB,EA8B7BvB,SAAS,CAAC2B,MA9BmB,EA+B1BnC,MAAM,CAACiC,WA/BmB,EAgC/BjC,MAAM,CAACkC,WAhCwB,CAArC;AA0CP,OAAO,IAAMyB,sBAAsB,GAAG5D,MAAM,CAACa,GAAV,6OAE/BV,gBAAgB,CAACQ,IAAI,CAACkD,KAAN,CAFe,CAA5B","sourcesContent":["/**\n * Import third-party libraries.\n */\nimport styled from 'styled-components';\n\n/**\n * Import custom style properties.\n */\nimport {COLORS, focusStyles, scrollBarStyling} from '../styles';\nimport {\n ComponentLStyling,\n ComponentMStyling,\n ComponentSStyling,\n ComponentTextStyle,\n ComponentXSStyling\n} from '../styles/typography';\nimport {Z_INDEXES} from '../styles/z-indexes';\nimport {StyledCheckBox} from '../InputFields/Checkbox';\nimport {Size} from \"../types\";\n\n/**\n * Table styles\n */\n\nexport const TableWrapper = styled.div`\n position: relative;\n`;\n\n\nexport const StyledTable = styled.table`\n background: transparent;\n width: 100%;\n\n &.fixed {\n table-layout: fixed;\n }\n\n &.auto {\n table-layout: auto;\n }\n`;\n\nexport const StyledTableHeader = styled.div`\n`;\n\nexport const StyledTableHeaderTitle = styled.div`\n`;\n\nexport const StyledTableHeaderTitleContent = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n box-sizing: border-box;\n min-height: 56px;\n border-bottom: 1px solid ${COLORS.neutral_200};\n border-top: 2px solid ${COLORS.neutral_200};\n padding: 0 16px;\n\n ${ComponentLStyling(ComponentTextStyle.Bold, COLORS.black)}\n .title-menu {\n margin-right: -16px;\n }\n`;\n\nexport const StyledTableHeaderRow = styled.thead`\n`;\n\nexport const StyledTableHeaderColumns = styled.tr`\n`;\n\nexport const StyledTableHeaderColumnContent = styled.div`\n box-sizing: border-box;\n min-height: 56px;\n padding: 0 16px;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n border-top: 1px solid ${COLORS.neutral_200};\n border-bottom: 1px solid ${COLORS.neutral_200};\n`;\n\nexport const StyledTableHeaderColumn = styled.th`\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n position: relative;\n text-align: unset;\n background-color: ${COLORS.white};\n\n //fixes header heights no idea why\n height: 1px;\n\n &.sortable {\n cursor: pointer;\n\n &:hover {\n background-color: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n z-index: ${Z_INDEXES.hover};\n }\n\n &:active {\n background-color: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n z-index: ${Z_INDEXES.active};\n }\n\n &:focus {\n ${focusStyles}\n }\n }\n\n &.sortable ${StyledTableHeaderColumnContent} > svg {\n opacity: 0;\n }\n\n &.sortable.sorted ${StyledTableHeaderColumnContent} > svg {\n opacity: 1;\n }\n\n &.sorted {\n background-color: ${COLORS.neutral_20};\n }\n`;\n\nexport const StyledTableBodyRow = styled.tr`\n cursor: pointer;\n position: relative;\n outline: none;\n\n &.selected{\n background-color: ${COLORS.primary_100};\n }\n \n &:hover {\n background-color: ${COLORS.primary_200};\n z-index: ${Z_INDEXES.hover};\n }\n\n &:focus {\n ${focusStyles}\n }\n\n &:active {\n z-index: ${Z_INDEXES.active};\n }\n\n`;\n\nexport const StyledTableNoRowsLabelRow = styled.tr`\n position: relative;\n outline: none;\n background-color: ${COLORS.neutral_50};\n`;\n\nexport const StyledTableBody = styled.tbody`\n ${StyledTableBodyRow}:nth-child(odd):not(.selected):not(:hover):not(:focus):not(:active) {\n background-color: ${COLORS.neutral_50};\n }\n\n ${StyledTableBodyRow}:nth-child(even):not(.selected):not(:hover):not(:focus):not(:active) {\n background-color: ${COLORS.neutral_20};\n }\n`;\n\n\nexport const StyledTableCell = styled.td``;\n\nexport const StyledTableCellContent = styled.div`\n min-height: 48px;\n\n padding: 0 16px;\n ${ComponentSStyling(ComponentTextStyle.Regular, COLORS.black)}\n\n display: flex;\n align-items: center;\n justify-content: left;\n gap: 8px;\n\n &.truncate-text,\n &.truncate-text span {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n &.left {\n justify-content: left;\n }\n\n &.right {\n justify-content: right;\n }\n\n &.center {\n justify-content: center;\n }\n\n a:first-letter,\n span:first-letter {\n text-transform: uppercase;\n }\n \n ${StyledCheckBox}{\n width: fit-content;\n }\n`;\n\nexport const StyledTableCellIcon = styled.div`\n color: ${COLORS.neutral_700};\n width: 24px;\n height: 24px;\n\n svg {\n color: ${COLORS.neutral_700};\n width: 24px;\n height: 24px;\n }\n`;\n\nexport const StyledTableCellText = styled.span`\n padding: 12px 0;\n`;\n\n\nexport const StyledTableFooter = styled.div`\n`;\n\nexport const StyledTableFooterContent = styled.div`\n border-top: 2px solid ${COLORS.neutral_200};\n border-bottom: 1px solid ${COLORS.neutral_200};\n box-sizing: border-box;\n min-height: 56px;\n\n display: flex;\n align-items: center;\n justify-content: right;\n\n`;\n\nexport const StyledTableFooterCurrentInfo = styled.span`\n padding: 0 16px;\n ${ComponentXSStyling(ComponentTextStyle.Regular, COLORS.black)}\n`;\n\nexport const StyledTableFooterControls = styled.div`\n display: flex;\n`;\n\nexport const StyledTableSpinner = styled.div`\n height: 100%;\n width: 100%;\n position: absolute;\n background-color: rgba(255, 255, 255, 0.75);\n top: 0;\n z-index: ${Z_INDEXES.backdrop};\n`;\n\nexport const StyledTableFooterCollapseButton = styled.button`\n position: relative;\n border-bottom: 1px solid ${COLORS.neutral_200};\n border-top: 1px solid ${COLORS.neutral_200};\n border-left: none;\n border-right: none;\n box-sizing: border-box;\n min-height: 48px;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: center;\n gap: 4px;\n background: ${COLORS.white};\n\n cursor: pointer;\n\n ${ComponentMStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n \n &:focus {\n ${focusStyles}\n }\n\n &:hover {\n z-index: ${Z_INDEXES.hover};\n background: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n }\n\n &:active {\n z-index: ${Z_INDEXES.active};\n background: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n }\n\n &:disabled {\n display: none;\n }\n\n`;\n\n\nexport const StyledTableBodyWrapper = styled.div`\n overflow-x: auto;\n ${scrollBarStyling(Size.Small)}\n\n ::-webkit-scrollbar-track {\n margin: 6px;\n }\n\n &.scrollable{\n margin-bottom: 6px;\n padding-bottom: 10px;\n }\n`;"],"file":"TableStyles.js"}
|
|
1
|
+
{"version":3,"sources":["../../src/Table/TableStyles.ts"],"names":["styled","COLORS","focusStyles","ComponentLStyling","ComponentMStyling","ComponentSStyling","ComponentTextStyle","ComponentXSStyling","Z_INDEXES","StyledCheckBox","TableWrapper","div","StyledTable","table","StyledTableHeader","thead","StyledTableHeaderTitle","tr","StyledTableHeaderTitleContent","neutral_200","Bold","black","StyledTableHeaderColumns","StyledTableHeaderColumnContent","StyledTableHeaderColumn","th","neutral_600","white","primary_20","primary_700","hover","primary_100","primary_800","active","neutral_20","StyledTableBodyRow","primary_200","StyledTableNoRowsLabelRow","neutral_50","StyledTableBody","tbody","StyledTableCell","td","StyledTableCellContent","Regular","StyledTableCellIcon","neutral_700","StyledTableCellText","span","StyledTableFooter","tfoot","StyledTableFooterContent","StyledTableFooterCurrentInfo","StyledTableFooterControls","StyledTableSpinner","backdrop","StyledTableFooterCollapseButton","button"],"mappings":";;;;AAAA;AACA;AACA;AACA,OAAOA,MAAP,MAAmB,mBAAnB;AAEA;AACA;AACA;;AACA,SAAQC,MAAR,EAAgBC,WAAhB,QAAkC,WAAlC;AACA,SACEC,iBADF,EAEEC,iBAFF,EAGEC,iBAHF,EAIEC,kBAJF,EAKEC,kBALF,QAMO,s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B;AASP,OAAO,IAAMC,+BAA+B,GAAGxD,MAAM,CAACyD,MAAV,yoBAEfxD,MAAM,CAACkB,WAFQ,EAGlBlB,MAAM,CAACkB,WAHW,EAa5BlB,MAAM,CAAC0B,KAbqB,EAiBxCvB,iBAAiB,CAACE,kBAAkB,CAACc,IAApB,EAA0BnB,MAAM,CAACyB,WAAjC,CAjBuB,EAoBtCxB,WApBsC,EAwB7BM,SAAS,CAACsB,KAxBmB,EAyB1B7B,MAAM,CAAC2B,UAzBmB,EA0B/B3B,MAAM,CAAC4B,WA1BwB,EA8B7BrB,SAAS,CAACyB,MA9BmB,EA+B1BhC,MAAM,CAAC8B,WA/BmB,EAgC/B9B,MAAM,CAAC+B,WAhCwB,CAArC","sourcesContent":["/**\n * Import third-party libraries.\n */\nimport styled from 'styled-components';\n\n/**\n * Import custom style properties.\n */\nimport {COLORS, focusStyles} from '../styles';\nimport {\n ComponentLStyling,\n ComponentMStyling,\n ComponentSStyling,\n ComponentTextStyle,\n ComponentXSStyling\n} from '../styles/typography';\nimport {Z_INDEXES} from '../styles/z-indexes';\nimport {StyledCheckBox} from '../InputFields/Checkbox';\n\n/**\n * Table styles\n */\n\nexport const TableWrapper = styled.div`\n position: relative;\n`;\n\n\nexport const StyledTable = styled.table`\n background: transparent;\n width: 100%;\n\n &.fixed {\n table-layout: fixed;\n }\n\n &.auto {\n table-layout: auto;\n }\n`;\n\nexport const StyledTableHeader = styled.thead`\n`;\n\nexport const StyledTableHeaderTitle = styled.tr`\n`;\n\nexport const StyledTableHeaderTitleContent = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n box-sizing: border-box;\n min-height: 56px;\n border-bottom: 1px solid ${COLORS.neutral_200};\n border-top: 2px solid ${COLORS.neutral_200};\n padding: 0 16px;\n\n ${ComponentLStyling(ComponentTextStyle.Bold, COLORS.black)}\n .title-menu {\n margin-right: -16px;\n }\n`;\n\nexport const StyledTableHeaderColumns = styled.tr`\n`;\n\nexport const StyledTableHeaderColumnContent = styled.div`\n box-sizing: border-box;\n min-height: 56px;\n padding: 0 16px;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n border-top: 1px solid ${COLORS.neutral_200};\n border-bottom: 1px solid ${COLORS.neutral_200};\n`;\n\nexport const StyledTableHeaderColumn = styled.th`\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n position: relative;\n text-align: unset;\n background-color: ${COLORS.white};\n\n //fixes header heights no idea why\n height: 1px;\n\n &.sortable {\n cursor: pointer;\n\n &:hover {\n background-color: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n z-index: ${Z_INDEXES.hover};\n }\n\n &:active {\n background-color: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n z-index: ${Z_INDEXES.active};\n }\n\n &:focus {\n ${focusStyles}\n }\n }\n\n &.sortable ${StyledTableHeaderColumnContent} > svg {\n opacity: 0;\n }\n\n &.sortable.sorted ${StyledTableHeaderColumnContent} > svg {\n opacity: 1;\n }\n\n &.sorted {\n background-color: ${COLORS.neutral_20};\n }\n`;\n\nexport const StyledTableBodyRow = styled.tr`\n cursor: pointer;\n position: relative;\n outline: none;\n\n &.selected{\n background-color: ${COLORS.primary_100};\n }\n \n &:hover {\n background-color: ${COLORS.primary_200};\n z-index: ${Z_INDEXES.hover};\n }\n\n &:focus {\n ${focusStyles}\n }\n\n &:active {\n z-index: ${Z_INDEXES.active};\n }\n\n`;\n\nexport const StyledTableNoRowsLabelRow = styled.tr`\n position: relative;\n outline: none;\n background-color: ${COLORS.neutral_50};\n`;\n\nexport const StyledTableBody = styled.tbody`\n ${StyledTableBodyRow}:nth-child(odd):not(.selected):not(:hover):not(:focus):not(:active) {\n background-color: ${COLORS.neutral_50};\n }\n\n ${StyledTableBodyRow}:nth-child(even):not(.selected):not(:hover):not(:focus):not(:active) {\n background-color: ${COLORS.neutral_20};\n }\n`;\n\n\nexport const StyledTableCell = styled.td``;\n\nexport const StyledTableCellContent = styled.div`\n min-height: 48px;\n\n padding: 0 16px;\n ${ComponentSStyling(ComponentTextStyle.Regular, COLORS.black)}\n\n display: flex;\n align-items: center;\n justify-content: left;\n gap: 8px;\n\n &.truncate-text,\n &.truncate-text span {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n &.left {\n justify-content: left;\n }\n\n &.right {\n justify-content: right;\n }\n\n &.center {\n justify-content: center;\n }\n\n a:first-letter,\n span:first-letter {\n text-transform: uppercase;\n }\n \n ${StyledCheckBox}{\n width: fit-content;\n }\n`;\n\nexport const StyledTableCellIcon = styled.div`\n color: ${COLORS.neutral_700};\n width: 24px;\n height: 24px;\n\n svg {\n color: ${COLORS.neutral_700};\n width: 24px;\n height: 24px;\n }\n`;\n\nexport const StyledTableCellText = styled.span`\n padding: 12px 0;\n`;\n\n\nexport const StyledTableFooter = styled.tfoot`\n`;\n\nexport const StyledTableFooterContent = styled.div`\n border-top: 2px solid ${COLORS.neutral_200};\n border-bottom: 1px solid ${COLORS.neutral_200};\n box-sizing: border-box;\n min-height: 56px;\n\n display: flex;\n align-items: center;\n justify-content: right;\n\n`;\n\nexport const StyledTableFooterCurrentInfo = styled.span`\n padding: 0 16px;\n ${ComponentXSStyling(ComponentTextStyle.Regular, COLORS.black)}\n`;\n\nexport const StyledTableFooterControls = styled.div`\n display: flex;\n`;\n\nexport const StyledTableSpinner = styled.div`\n height: 100%;\n width: 100%;\n position: absolute;\n background-color: rgba(255, 255, 255, 0.75);\n top: 0;\n z-index: ${Z_INDEXES.backdrop};\n`;\n\nexport const StyledTableFooterCollapseButton = styled.button`\n position: relative;\n border-bottom: 1px solid ${COLORS.neutral_200};\n border-top: 1px solid ${COLORS.neutral_200};\n border-left: none;\n border-right: none;\n box-sizing: border-box;\n min-height: 48px;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: center;\n gap: 4px;\n background: ${COLORS.white};\n\n cursor: pointer;\n\n ${ComponentMStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n \n &:focus {\n ${focusStyles}\n }\n\n &:hover {\n z-index: ${Z_INDEXES.hover};\n background: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n }\n\n &:active {\n z-index: ${Z_INDEXES.active};\n background: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n }\n\n &:disabled {\n display: none;\n }\n\n`;\n"],"file":"TableStyles.js"}
|
package/dist/Tag/Tag.cjs
CHANGED
|
@@ -25,7 +25,7 @@ var _ = require("..");
|
|
|
25
25
|
|
|
26
26
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
27
27
|
|
|
28
|
-
var _excluded = ["label", "icon", "variant"];
|
|
28
|
+
var _excluded = ["label", "icon", "variant", "className"];
|
|
29
29
|
|
|
30
30
|
var _templateObject, _templateObject2, _templateObject3;
|
|
31
31
|
|
|
@@ -37,53 +37,28 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
37
37
|
|
|
38
38
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
39
39
|
|
|
40
|
-
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n height: 24px;\n width: calc(100%);\n max-width: fit-content;\n min-width: ", ";\n border-radius: 2px;\n background: ", ";\n"])), function (props) {
|
|
40
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n height: 24px;\n width: calc(100%);\n max-width: fit-content;\n min-width: ", ";\n border-radius: 2px;\n\n &.neutral {\n background-color: ", ";\n color: ", ";\n }\n &.positive {\n background-color: ", ";\n color: ", ";\n }\n &.warning {\n background-color: ", ";\n color: ", ";\n }\n &.critical {\n background-color: ", ";\n color: ", ";\n }\n &.accent1 {\n background-color: ", ";\n color: ", ";\n }\n &.accent2 {\n background-color: ", ";\n color: ", ";\n }\n\n"])), function (props) {
|
|
41
41
|
return props.isLabelPresent ? '64px' : '';
|
|
42
|
-
},
|
|
43
|
-
return getBackgroundColor(props.variant);
|
|
44
|
-
});
|
|
42
|
+
}, _.COLORS.neutral_100, _.COLORS.neutral_600, _.COLORS.correct_100, _.COLORS.correct_600, _.COLORS.warning_100, _.COLORS.warning_600, _.COLORS.critical_100, _.COLORS.critical_600, _.COLORS.accent1_100, _.COLORS.accent1_600, _.COLORS.accent2_100, _.COLORS.accent2_600);
|
|
45
43
|
|
|
46
|
-
var IconContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n border-radius: 2px;\n margin: 4px;\n svg {\n width: 16px;\n height: 16px;\n
|
|
47
|
-
return props.variant === 'neutral' ? _.COLORS.neutral_600 : _.COLORS.white;
|
|
48
|
-
});
|
|
44
|
+
var IconContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n border-radius: 2px;\n margin: 4px;\n svg {\n width: 16px;\n height: 16px;\n }\n"])));
|
|
49
45
|
|
|
50
|
-
var TextContainer = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n
|
|
51
|
-
return props.variant === 'neutral' ? _.COLORS.neutral_600 : _.COLORS.white;
|
|
52
|
-
}, function (props) {
|
|
46
|
+
var TextContainer = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n border-radius: 2px;\n margin: ", ";\n height: 16px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden; \n ", "\n"])), function (props) {
|
|
53
47
|
return props.icon ? "4px 8px 4px 0" : "4px 8px";
|
|
54
48
|
}, (0, _.ComponentXSStyling)(_.ComponentTextStyle.Bold, null));
|
|
55
49
|
|
|
56
|
-
var getBackgroundColor = function getBackgroundColor(variant) {
|
|
57
|
-
switch (variant) {
|
|
58
|
-
case 'positive':
|
|
59
|
-
return _.COLORS.correct_500;
|
|
60
|
-
|
|
61
|
-
case 'warning':
|
|
62
|
-
return _.COLORS.warning_500;
|
|
63
|
-
|
|
64
|
-
case 'critical':
|
|
65
|
-
return _.COLORS.critical_500;
|
|
66
|
-
|
|
67
|
-
case 'accent1':
|
|
68
|
-
return _.COLORS.accent1_500;
|
|
69
|
-
|
|
70
|
-
case 'accent2':
|
|
71
|
-
return _.COLORS.accent2_500;
|
|
72
|
-
|
|
73
|
-
default:
|
|
74
|
-
return _.COLORS.neutral_100;
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
|
|
78
50
|
var Tag = function Tag(_ref) {
|
|
79
51
|
var label = _ref.label,
|
|
80
52
|
icon = _ref.icon,
|
|
81
53
|
_ref$variant = _ref.variant,
|
|
82
54
|
variant = _ref$variant === void 0 ? 'neutral' : _ref$variant,
|
|
55
|
+
className = _ref.className,
|
|
83
56
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
57
|
+
var cls = "".concat(className !== null && className !== void 0 ? className : '', " ").concat(variant);
|
|
84
58
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Container, _objectSpread(_objectSpread({
|
|
85
59
|
variant: variant,
|
|
86
|
-
isLabelPresent: !!label
|
|
60
|
+
isLabelPresent: !!label,
|
|
61
|
+
className: cls
|
|
87
62
|
}, rest), {}, {
|
|
88
63
|
children: [icon && /*#__PURE__*/(0, _jsxRuntime.jsx)(IconContainer, {
|
|
89
64
|
variant: variant,
|
package/dist/Tag/Tag.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Tag/Tag.tsx"],"names":["Container","styled","div","props","isLabelPresent","
|
|
1
|
+
{"version":3,"sources":["../../src/Tag/Tag.tsx"],"names":["Container","styled","div","props","isLabelPresent","COLORS","neutral_100","neutral_600","correct_100","correct_600","warning_100","warning_600","critical_100","critical_600","accent1_100","accent1_600","accent2_100","accent2_600","IconContainer","TextContainer","icon","ComponentTextStyle","Bold","Tag","label","variant","className","rest","cls"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;;;;;;;;;;;;;;;AAEA,IAAMA,SAAS,GAAGC,0BAAOC,GAAV,6mBAKA,UAAAC,KAAK;AAAA,SAAEA,KAAK,CAACC,cAAN,GAAuB,MAAvB,GAAgC,EAAlC;AAAA,CALL,EASSC,SAAOC,WAThB,EAUFD,SAAOE,WAVL,EAaSF,SAAOG,WAbhB,EAcFH,SAAOI,WAdL,EAiBSJ,SAAOK,WAjBhB,EAkBFL,SAAOM,WAlBL,EAqBSN,SAAOO,YArBhB,EAsBFP,SAAOQ,YAtBL,EAyBSR,SAAOS,WAzBhB,EA0BFT,SAAOU,WA1BL,EA6BSV,SAAOW,WA7BhB,EA8BFX,SAAOY,WA9BL,CAAf;;AAmCA,IAAMC,aAAa,GAAGjB,0BAAOC,GAAV,iLAAnB;;AASA,IAAMiB,aAAa,GAAGlB,0BAAOC,GAAV,oOAEP,UAAAC,KAAK;AAAA,SAAGA,KAAK,CAACiB,IAAN,8BAAH;AAAA,CAFE,EAOf,0BAAmBC,qBAAmBC,IAAtC,EAA4C,IAA5C,CAPe,CAAnB;;AAmBA,IAAMC,GAAsC,GAAG,SAAzCA,GAAyC,OAA0D;AAAA,MAAxDC,KAAwD,QAAxDA,KAAwD;AAAA,MAAjDJ,IAAiD,QAAjDA,IAAiD;AAAA,0BAA3CK,OAA2C;AAAA,MAA3CA,OAA2C,6BAAnC,SAAmC;AAAA,MAAxBC,SAAwB,QAAxBA,SAAwB;AAAA,MAAVC,IAAU;AACvG,MAAMC,GAAG,aAAMF,SAAN,aAAMA,SAAN,cAAMA,SAAN,GAAmB,EAAnB,cAAyBD,OAAzB,CAAT;AACA,sBACE,sBAAC,SAAD;AAAW,IAAA,OAAO,EAAEA,OAApB;AAA6B,IAAA,cAAc,EAAE,CAAC,CAACD,KAA/C;AAAsD,IAAA,SAAS,EAAEI;AAAjE,KAA0ED,IAA1E;AAAA,eACGP,IAAI,iBAAI,qBAAC,aAAD;AAAe,MAAA,OAAO,EAAEK,OAAxB;AAAiC,qBAAa,eAA9C;AAAA,gBACJL;AADI,MADX,EAKGI,KAAK,iBAAI,qBAAC,aAAD;AAAe,MAAA,OAAO,EAAEC,OAAxB;AAAiC,MAAA,IAAI,EAAEL,IAAvC;AAAA,gBACLI;AADK,MALZ;AAAA,KADF;AAYD,CAdD;;;AALEA,EAAAA,K;AACAJ,EAAAA,I;AACAK,EAAAA,O,4BALwB,S,EAAY,U,EAAa,S,EAAY,U,EAAa,S,EAAY,S;;eAwBzEF,G","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport { COLORS, ComponentTextStyle, ComponentXSStyling } from '..';\n\nconst Container = styled.div<{variant: TagVariants, isLabelPresent: boolean}>`\n display: flex;\n height: 24px;\n width: calc(100%);\n max-width: fit-content;\n min-width: ${props=>props.isLabelPresent ? '64px' : ''};\n border-radius: 2px;\n\n &.neutral {\n background-color: ${COLORS.neutral_100};\n color: ${COLORS.neutral_600};\n }\n &.positive {\n background-color: ${COLORS.correct_100};\n color: ${COLORS.correct_600};\n }\n &.warning {\n background-color: ${COLORS.warning_100};\n color: ${COLORS.warning_600};\n }\n &.critical {\n background-color: ${COLORS.critical_100};\n color: ${COLORS.critical_600};\n }\n &.accent1 {\n background-color: ${COLORS.accent1_100};\n color: ${COLORS.accent1_600};\n }\n &.accent2 {\n background-color: ${COLORS.accent2_100};\n color: ${COLORS.accent2_600};\n }\n\n`;\n\nconst IconContainer = styled.div<{variant: TagVariants}>`\n border-radius: 2px;\n margin: 4px;\n svg {\n width: 16px;\n height: 16px;\n }\n`;\n\nconst TextContainer = styled.div<{variant: TagVariants, icon: React.ReactNode}>`\n border-radius: 2px;\n margin: ${props=> props.icon ? `4px 8px 4px 0` : `4px 8px`};\n height: 16px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden; \n ${ComponentXSStyling(ComponentTextStyle.Bold, null)}\n`;\n\n\nexport type TagVariants = 'neutral' | 'positive' | 'warning' | 'critical' | 'accent1' | 'accent2';\n\ntype TagProps = React.HTMLAttributes<HTMLDivElement> & {\n label?: string;\n icon?: React.ReactNode;\n variant?: TagVariants;\n}\n\nconst Tag: React.FunctionComponent<TagProps> = ({label, icon, variant='neutral', className, ...rest}) => {\n const cls = `${className ?? ''} ${variant}`;\n return ( \n <Container variant={variant} isLabelPresent={!!label} className={cls} {...rest}>\n {icon && <IconContainer variant={variant} data-testid={'iconContainer'}>\n {icon}\n </IconContainer>\n }\n {label && <TextContainer variant={variant} icon={icon}>\n {label}\n </TextContainer>\n }\n </Container>\n );\n};\n\nexport default Tag;\n"],"file":"Tag.cjs"}
|
package/dist/Tag/Tag.js
CHANGED
|
@@ -2,7 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
3
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
4
4
|
import _pt from "prop-types";
|
|
5
|
-
var _excluded = ["label", "icon", "variant"];
|
|
5
|
+
var _excluded = ["label", "icon", "variant", "className"];
|
|
6
6
|
|
|
7
7
|
var _templateObject, _templateObject2, _templateObject3;
|
|
8
8
|
|
|
@@ -15,52 +15,27 @@ import styled from 'styled-components';
|
|
|
15
15
|
import { COLORS, ComponentTextStyle, ComponentXSStyling } from '..';
|
|
16
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
17
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
|
-
var Container = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n height: 24px;\n width: calc(100%);\n max-width: fit-content;\n min-width: ", ";\n border-radius: 2px;\n background: ", ";\n"])), function (props) {
|
|
18
|
+
var Container = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n height: 24px;\n width: calc(100%);\n max-width: fit-content;\n min-width: ", ";\n border-radius: 2px;\n\n &.neutral {\n background-color: ", ";\n color: ", ";\n }\n &.positive {\n background-color: ", ";\n color: ", ";\n }\n &.warning {\n background-color: ", ";\n color: ", ";\n }\n &.critical {\n background-color: ", ";\n color: ", ";\n }\n &.accent1 {\n background-color: ", ";\n color: ", ";\n }\n &.accent2 {\n background-color: ", ";\n color: ", ";\n }\n\n"])), function (props) {
|
|
19
19
|
return props.isLabelPresent ? '64px' : '';
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
var IconContainer = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n border-radius: 2px;\n margin: 4px;\n svg {\n width: 16px;\n height: 16px;\n color: ", ";\n }\n"])), function (props) {
|
|
24
|
-
return props.variant === 'neutral' ? COLORS.neutral_600 : COLORS.white;
|
|
25
|
-
});
|
|
26
|
-
var TextContainer = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n color: ", ";\n border-radius: 2px;\n margin: ", ";\n height: 16px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden; \n ", "\n"])), function (props) {
|
|
27
|
-
return props.variant === 'neutral' ? COLORS.neutral_600 : COLORS.white;
|
|
28
|
-
}, function (props) {
|
|
20
|
+
}, COLORS.neutral_100, COLORS.neutral_600, COLORS.correct_100, COLORS.correct_600, COLORS.warning_100, COLORS.warning_600, COLORS.critical_100, COLORS.critical_600, COLORS.accent1_100, COLORS.accent1_600, COLORS.accent2_100, COLORS.accent2_600);
|
|
21
|
+
var IconContainer = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n border-radius: 2px;\n margin: 4px;\n svg {\n width: 16px;\n height: 16px;\n }\n"])));
|
|
22
|
+
var TextContainer = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n border-radius: 2px;\n margin: ", ";\n height: 16px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden; \n ", "\n"])), function (props) {
|
|
29
23
|
return props.icon ? "4px 8px 4px 0" : "4px 8px";
|
|
30
24
|
}, ComponentXSStyling(ComponentTextStyle.Bold, null));
|
|
31
25
|
|
|
32
|
-
var getBackgroundColor = function getBackgroundColor(variant) {
|
|
33
|
-
switch (variant) {
|
|
34
|
-
case 'positive':
|
|
35
|
-
return COLORS.correct_500;
|
|
36
|
-
|
|
37
|
-
case 'warning':
|
|
38
|
-
return COLORS.warning_500;
|
|
39
|
-
|
|
40
|
-
case 'critical':
|
|
41
|
-
return COLORS.critical_500;
|
|
42
|
-
|
|
43
|
-
case 'accent1':
|
|
44
|
-
return COLORS.accent1_500;
|
|
45
|
-
|
|
46
|
-
case 'accent2':
|
|
47
|
-
return COLORS.accent2_500;
|
|
48
|
-
|
|
49
|
-
default:
|
|
50
|
-
return COLORS.neutral_100;
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
|
|
54
26
|
var Tag = function Tag(_ref) {
|
|
55
27
|
var label = _ref.label,
|
|
56
28
|
icon = _ref.icon,
|
|
57
29
|
_ref$variant = _ref.variant,
|
|
58
30
|
variant = _ref$variant === void 0 ? 'neutral' : _ref$variant,
|
|
31
|
+
className = _ref.className,
|
|
59
32
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
60
33
|
|
|
34
|
+
var cls = "".concat(className !== null && className !== void 0 ? className : '', " ").concat(variant);
|
|
61
35
|
return /*#__PURE__*/_jsxs(Container, _objectSpread(_objectSpread({
|
|
62
36
|
variant: variant,
|
|
63
|
-
isLabelPresent: !!label
|
|
37
|
+
isLabelPresent: !!label,
|
|
38
|
+
className: cls
|
|
64
39
|
}, rest), {}, {
|
|
65
40
|
children: [icon && /*#__PURE__*/_jsx(IconContainer, {
|
|
66
41
|
variant: variant,
|
package/dist/Tag/Tag.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Tag/Tag.tsx"],"names":["React","styled","COLORS","ComponentTextStyle","ComponentXSStyling","Container","div","props","isLabelPresent","
|
|
1
|
+
{"version":3,"sources":["../../src/Tag/Tag.tsx"],"names":["React","styled","COLORS","ComponentTextStyle","ComponentXSStyling","Container","div","props","isLabelPresent","neutral_100","neutral_600","correct_100","correct_600","warning_100","warning_600","critical_100","critical_600","accent1_100","accent1_600","accent2_100","accent2_600","IconContainer","TextContainer","icon","Bold","Tag","label","variant","className","rest","cls"],"mappings":";;;;;;;;;;;;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,SAASC,MAAT,EAAiBC,kBAAjB,EAAqCC,kBAArC,QAA+D,IAA/D;;;AAEA,IAAMC,SAAS,GAAGJ,MAAM,CAACK,GAAV,+lBAKA,UAAAC,KAAK;AAAA,SAAEA,KAAK,CAACC,cAAN,GAAuB,MAAvB,GAAgC,EAAlC;AAAA,CALL,EASSN,MAAM,CAACO,WAThB,EAUFP,MAAM,CAACQ,WAVL,EAaSR,MAAM,CAACS,WAbhB,EAcFT,MAAM,CAACU,WAdL,EAiBSV,MAAM,CAACW,WAjBhB,EAkBFX,MAAM,CAACY,WAlBL,EAqBSZ,MAAM,CAACa,YArBhB,EAsBFb,MAAM,CAACc,YAtBL,EAyBSd,MAAM,CAACe,WAzBhB,EA0BFf,MAAM,CAACgB,WA1BL,EA6BShB,MAAM,CAACiB,WA7BhB,EA8BFjB,MAAM,CAACkB,WA9BL,CAAf;AAmCA,IAAMC,aAAa,GAAGpB,MAAM,CAACK,GAAV,mKAAnB;AASA,IAAMgB,aAAa,GAAGrB,MAAM,CAACK,GAAV,sNAEP,UAAAC,KAAK;AAAA,SAAGA,KAAK,CAACgB,IAAN,8BAAH;AAAA,CAFE,EAOfnB,kBAAkB,CAACD,kBAAkB,CAACqB,IAApB,EAA0B,IAA1B,CAPH,CAAnB;;AAmBA,IAAMC,GAAsC,GAAG,SAAzCA,GAAyC,OAA0D;AAAA,MAAxDC,KAAwD,QAAxDA,KAAwD;AAAA,MAAjDH,IAAiD,QAAjDA,IAAiD;AAAA,0BAA3CI,OAA2C;AAAA,MAA3CA,OAA2C,6BAAnC,SAAmC;AAAA,MAAxBC,SAAwB,QAAxBA,SAAwB;AAAA,MAAVC,IAAU;;AACvG,MAAMC,GAAG,aAAMF,SAAN,aAAMA,SAAN,cAAMA,SAAN,GAAmB,EAAnB,cAAyBD,OAAzB,CAAT;AACA,sBACE,MAAC,SAAD;AAAW,IAAA,OAAO,EAAEA,OAApB;AAA6B,IAAA,cAAc,EAAE,CAAC,CAACD,KAA/C;AAAsD,IAAA,SAAS,EAAEI;AAAjE,KAA0ED,IAA1E;AAAA,eACGN,IAAI,iBAAI,KAAC,aAAD;AAAe,MAAA,OAAO,EAAEI,OAAxB;AAAiC,qBAAa,eAA9C;AAAA,gBACJJ;AADI,MADX,EAKGG,KAAK,iBAAI,KAAC,aAAD;AAAe,MAAA,OAAO,EAAEC,OAAxB;AAAiC,MAAA,IAAI,EAAEJ,IAAvC;AAAA,gBACLG;AADK,MALZ;AAAA,KADF;AAYD,CAdD;;;AALEA,EAAAA,K;AACAH,EAAAA,I;AACAI,EAAAA,O,aALwB,S,EAAY,U,EAAa,S,EAAY,U,EAAa,S,EAAY,S;;AAwBxF,eAAeF,GAAf","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport { COLORS, ComponentTextStyle, ComponentXSStyling } from '..';\n\nconst Container = styled.div<{variant: TagVariants, isLabelPresent: boolean}>`\n display: flex;\n height: 24px;\n width: calc(100%);\n max-width: fit-content;\n min-width: ${props=>props.isLabelPresent ? '64px' : ''};\n border-radius: 2px;\n\n &.neutral {\n background-color: ${COLORS.neutral_100};\n color: ${COLORS.neutral_600};\n }\n &.positive {\n background-color: ${COLORS.correct_100};\n color: ${COLORS.correct_600};\n }\n &.warning {\n background-color: ${COLORS.warning_100};\n color: ${COLORS.warning_600};\n }\n &.critical {\n background-color: ${COLORS.critical_100};\n color: ${COLORS.critical_600};\n }\n &.accent1 {\n background-color: ${COLORS.accent1_100};\n color: ${COLORS.accent1_600};\n }\n &.accent2 {\n background-color: ${COLORS.accent2_100};\n color: ${COLORS.accent2_600};\n }\n\n`;\n\nconst IconContainer = styled.div<{variant: TagVariants}>`\n border-radius: 2px;\n margin: 4px;\n svg {\n width: 16px;\n height: 16px;\n }\n`;\n\nconst TextContainer = styled.div<{variant: TagVariants, icon: React.ReactNode}>`\n border-radius: 2px;\n margin: ${props=> props.icon ? `4px 8px 4px 0` : `4px 8px`};\n height: 16px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden; \n ${ComponentXSStyling(ComponentTextStyle.Bold, null)}\n`;\n\n\nexport type TagVariants = 'neutral' | 'positive' | 'warning' | 'critical' | 'accent1' | 'accent2';\n\ntype TagProps = React.HTMLAttributes<HTMLDivElement> & {\n label?: string;\n icon?: React.ReactNode;\n variant?: TagVariants;\n}\n\nconst Tag: React.FunctionComponent<TagProps> = ({label, icon, variant='neutral', className, ...rest}) => {\n const cls = `${className ?? ''} ${variant}`;\n return ( \n <Container variant={variant} isLabelPresent={!!label} className={cls} {...rest}>\n {icon && <IconContainer variant={variant} data-testid={'iconContainer'}>\n {icon}\n </IconContainer>\n }\n {label && <TextContainer variant={variant} icon={icon}>\n {label}\n </TextContainer>\n }\n </Container>\n );\n};\n\nexport default Tag;\n"],"file":"Tag.js"}
|