@norges-domstoler/dds-components 13.2.0 → 13.3.0
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/cjs/components/Table/Table.stories.d.ts +1 -0
- package/dist/cjs/components/Table/Table.tokens.d.ts +9 -0
- package/dist/cjs/components/Table/Table.types.d.ts +1 -1
- package/dist/cjs/index.js +20 -7
- package/dist/components/Table/Table.js +7 -4
- package/dist/components/Table/Table.stories.d.ts +1 -0
- package/dist/components/Table/Table.tokens.d.ts +9 -0
- package/dist/components/Table/Table.tokens.js +11 -1
- package/dist/components/Table/Table.types.d.ts +1 -1
- package/package.json +1 -1
|
@@ -41,6 +41,7 @@ export declare const Default: (args: TableProps) => JSX.Element;
|
|
|
41
41
|
export declare const WithDividers: (args: TableProps) => JSX.Element;
|
|
42
42
|
export declare const Focusable: (args: TableProps) => JSX.Element;
|
|
43
43
|
export declare const Compact: (args: TableProps) => JSX.Element;
|
|
44
|
+
export declare const ExtraCompact: (args: TableProps) => JSX.Element;
|
|
44
45
|
export declare const StickyHeader: (args: TableProps) => JSX.Element;
|
|
45
46
|
export declare const Hoverable: (args: TableProps) => JSX.Element;
|
|
46
47
|
export declare const WithButtonAndIcons: (args: TableProps) => JSX.Element;
|
|
@@ -24,6 +24,12 @@ export declare const tableTokens: {
|
|
|
24
24
|
borderBottom: string;
|
|
25
25
|
};
|
|
26
26
|
};
|
|
27
|
+
head: {
|
|
28
|
+
extraCompact: {
|
|
29
|
+
backgroundColor: string;
|
|
30
|
+
fontSize: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
27
33
|
};
|
|
28
34
|
cell: {
|
|
29
35
|
density: {
|
|
@@ -33,6 +39,9 @@ export declare const tableTokens: {
|
|
|
33
39
|
compact: {
|
|
34
40
|
padding: string;
|
|
35
41
|
};
|
|
42
|
+
extraCompact: {
|
|
43
|
+
padding: string;
|
|
44
|
+
};
|
|
36
45
|
};
|
|
37
46
|
head: {
|
|
38
47
|
backgroundColor: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
export type TableDensity = 'normal' | 'compact';
|
|
2
|
+
export type TableDensity = 'normal' | 'compact' | 'extraCompact';
|
|
3
3
|
export type TableProps = {
|
|
4
4
|
/**Spesifiserer hvor romslige cellene i tabellen skal være. */
|
|
5
5
|
density?: TableDensity;
|
package/dist/cjs/index.js
CHANGED
|
@@ -2228,11 +2228,11 @@ var renderInputMessage = function renderInputMessage(tip, tipId, errorMessage, e
|
|
|
2228
2228
|
|
|
2229
2229
|
var colors$r = ddsDesignTokens.ddsBaseTokens.colors,
|
|
2230
2230
|
borderRadius$9 = ddsDesignTokens.ddsBaseTokens.borderRadius,
|
|
2231
|
-
font = ddsDesignTokens.ddsBaseTokens.font;
|
|
2231
|
+
font$1 = ddsDesignTokens.ddsBaseTokens.font;
|
|
2232
2232
|
var paper = {
|
|
2233
2233
|
backgroundColor: colors$r.DdsColorNeutralsWhite,
|
|
2234
2234
|
borderRadius: borderRadius$9.RadiiDdsBorderRadius1Radius,
|
|
2235
|
-
fontFamily: font.DdsFontBodySans01FontFamily
|
|
2235
|
+
fontFamily: font$1.DdsFontBodySans01FontFamily
|
|
2236
2236
|
};
|
|
2237
2237
|
var paperTokens = {
|
|
2238
2238
|
paper: paper
|
|
@@ -6370,7 +6370,8 @@ var Search = Search$1;
|
|
|
6370
6370
|
Search.AutocompleteWrapper = SearchAutocompleteWrapper;
|
|
6371
6371
|
Search.Suggestions = SearchSuggestions;
|
|
6372
6372
|
|
|
6373
|
-
var
|
|
6373
|
+
var font = ddsDesignTokens.ddsBaseTokens.font,
|
|
6374
|
+
colors$h = ddsDesignTokens.ddsBaseTokens.colors,
|
|
6374
6375
|
border$7 = ddsDesignTokens.ddsBaseTokens.border,
|
|
6375
6376
|
spacing$q = ddsDesignTokens.ddsBaseTokens.spacing,
|
|
6376
6377
|
iconSizes$2 = ddsDesignTokens.ddsBaseTokens.iconSizes,
|
|
@@ -6399,6 +6400,12 @@ var row$2 = {
|
|
|
6399
6400
|
withDividers: {
|
|
6400
6401
|
borderBottom: "1px solid ".concat(colors$h.DdsColorNeutralsGray4)
|
|
6401
6402
|
}
|
|
6403
|
+
},
|
|
6404
|
+
head: {
|
|
6405
|
+
extraCompact: {
|
|
6406
|
+
backgroundColor: colors$h.DdsColorNeutralsWhite,
|
|
6407
|
+
fontSize: font.DdsFontBodySans01FontSize
|
|
6408
|
+
}
|
|
6402
6409
|
}
|
|
6403
6410
|
};
|
|
6404
6411
|
var cell$3 = {
|
|
@@ -6408,6 +6415,9 @@ var cell$3 = {
|
|
|
6408
6415
|
},
|
|
6409
6416
|
compact: {
|
|
6410
6417
|
padding: "".concat(spacing$q.SizesDdsSpacingLocalX075)
|
|
6418
|
+
},
|
|
6419
|
+
extraCompact: {
|
|
6420
|
+
padding: "".concat(spacing$q.SizesDdsSpacingLocalX025, " ").concat(spacing$q.SizesDdsSpacingLocalX05)
|
|
6411
6421
|
}
|
|
6412
6422
|
},
|
|
6413
6423
|
head: {
|
|
@@ -6442,14 +6452,17 @@ var cell$2 = tableTokens.cell,
|
|
|
6442
6452
|
var StyledTable$1 = styled__default.default.table.withConfig({
|
|
6443
6453
|
displayName: "Table__StyledTable",
|
|
6444
6454
|
componentId: "sc-bw0w0a-0"
|
|
6445
|
-
})(["border-spacing:0;border-collapse:collapse;*::selection{", "}", " ", " ", " ", " ", ""], selection, scrollbarStyling.webkit, scrollbarStyling.firefox, function (_ref) {
|
|
6455
|
+
})(["border-spacing:0;border-collapse:collapse;*::selection{", "}", " ", " ", " ", " ", " ", ""], selection, scrollbarStyling.webkit, scrollbarStyling.firefox, function (_ref) {
|
|
6446
6456
|
var density = _ref.density;
|
|
6447
6457
|
return styled.css(["td,th{padding:", ";}"], cell$2.density[density].padding);
|
|
6448
6458
|
}, function (_ref2) {
|
|
6449
|
-
var
|
|
6450
|
-
return
|
|
6459
|
+
var density = _ref2.density;
|
|
6460
|
+
return density === 'extraCompact' && styled.css(["th{background-color:", ";font-size:", ";}tr[type='body']{&:nth-of-type(even){background-color:", ";}&:nth-of-type(odd){background-color:", ";}}"], row$1.head.extraCompact.backgroundColor, row$1.head.extraCompact.fontSize, row$1.body.odd.backgroundColor, row$1.body.even.backgroundColor);
|
|
6451
6461
|
}, function (_ref3) {
|
|
6452
|
-
var
|
|
6462
|
+
var stickyHeader = _ref3.stickyHeader;
|
|
6463
|
+
return stickyHeader && styled.css(["tr[type='head']{th[type='head']{position:sticky;top:0;z-index:50;}}"]);
|
|
6464
|
+
}, function (_ref4) {
|
|
6465
|
+
var withDividers = _ref4.withDividers;
|
|
6453
6466
|
return withDividers && styled.css(["tr[type='body']{border-bottom:", ";}"], row$1.body.withDividers.borderBottom);
|
|
6454
6467
|
});
|
|
6455
6468
|
var Table$1 = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
@@ -17,14 +17,17 @@ var cell = tableTokens.cell,
|
|
|
17
17
|
var StyledTable = styled.table.withConfig({
|
|
18
18
|
displayName: "Table__StyledTable",
|
|
19
19
|
componentId: "sc-bw0w0a-0"
|
|
20
|
-
})(["border-spacing:0;border-collapse:collapse;*::selection{", "}", " ", " ", " ", " ", ""], selection, scrollbarStyling.webkit, scrollbarStyling.firefox, function (_ref) {
|
|
20
|
+
})(["border-spacing:0;border-collapse:collapse;*::selection{", "}", " ", " ", " ", " ", " ", ""], selection, scrollbarStyling.webkit, scrollbarStyling.firefox, function (_ref) {
|
|
21
21
|
var density = _ref.density;
|
|
22
22
|
return css(["td,th{padding:", ";}"], cell.density[density].padding);
|
|
23
23
|
}, function (_ref2) {
|
|
24
|
-
var
|
|
25
|
-
return
|
|
24
|
+
var density = _ref2.density;
|
|
25
|
+
return density === 'extraCompact' && css(["th{background-color:", ";font-size:", ";}tr[type='body']{&:nth-of-type(even){background-color:", ";}&:nth-of-type(odd){background-color:", ";}}"], row.head.extraCompact.backgroundColor, row.head.extraCompact.fontSize, row.body.odd.backgroundColor, row.body.even.backgroundColor);
|
|
26
26
|
}, function (_ref3) {
|
|
27
|
-
var
|
|
27
|
+
var stickyHeader = _ref3.stickyHeader;
|
|
28
|
+
return stickyHeader && css(["tr[type='head']{th[type='head']{position:sticky;top:0;z-index:50;}}"]);
|
|
29
|
+
}, function (_ref4) {
|
|
30
|
+
var withDividers = _ref4.withDividers;
|
|
28
31
|
return withDividers && css(["tr[type='body']{border-bottom:", ";}"], row.body.withDividers.borderBottom);
|
|
29
32
|
});
|
|
30
33
|
var Table = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
@@ -41,6 +41,7 @@ export declare const Default: (args: TableProps) => JSX.Element;
|
|
|
41
41
|
export declare const WithDividers: (args: TableProps) => JSX.Element;
|
|
42
42
|
export declare const Focusable: (args: TableProps) => JSX.Element;
|
|
43
43
|
export declare const Compact: (args: TableProps) => JSX.Element;
|
|
44
|
+
export declare const ExtraCompact: (args: TableProps) => JSX.Element;
|
|
44
45
|
export declare const StickyHeader: (args: TableProps) => JSX.Element;
|
|
45
46
|
export declare const Hoverable: (args: TableProps) => JSX.Element;
|
|
46
47
|
export declare const WithButtonAndIcons: (args: TableProps) => JSX.Element;
|
|
@@ -24,6 +24,12 @@ export declare const tableTokens: {
|
|
|
24
24
|
borderBottom: string;
|
|
25
25
|
};
|
|
26
26
|
};
|
|
27
|
+
head: {
|
|
28
|
+
extraCompact: {
|
|
29
|
+
backgroundColor: string;
|
|
30
|
+
fontSize: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
27
33
|
};
|
|
28
34
|
cell: {
|
|
29
35
|
density: {
|
|
@@ -33,6 +39,9 @@ export declare const tableTokens: {
|
|
|
33
39
|
compact: {
|
|
34
40
|
padding: string;
|
|
35
41
|
};
|
|
42
|
+
extraCompact: {
|
|
43
|
+
padding: string;
|
|
44
|
+
};
|
|
36
45
|
};
|
|
37
46
|
head: {
|
|
38
47
|
backgroundColor: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ddsBaseTokens } from '@norges-domstoler/dds-design-tokens';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var font = ddsBaseTokens.font,
|
|
4
|
+
colors = ddsBaseTokens.colors,
|
|
4
5
|
border = ddsBaseTokens.border,
|
|
5
6
|
spacing = ddsBaseTokens.spacing,
|
|
6
7
|
iconSizes = ddsBaseTokens.iconSizes,
|
|
@@ -29,6 +30,12 @@ var row = {
|
|
|
29
30
|
withDividers: {
|
|
30
31
|
borderBottom: "1px solid ".concat(colors.DdsColorNeutralsGray4)
|
|
31
32
|
}
|
|
33
|
+
},
|
|
34
|
+
head: {
|
|
35
|
+
extraCompact: {
|
|
36
|
+
backgroundColor: colors.DdsColorNeutralsWhite,
|
|
37
|
+
fontSize: font.DdsFontBodySans01FontSize
|
|
38
|
+
}
|
|
32
39
|
}
|
|
33
40
|
};
|
|
34
41
|
var cell = {
|
|
@@ -38,6 +45,9 @@ var cell = {
|
|
|
38
45
|
},
|
|
39
46
|
compact: {
|
|
40
47
|
padding: "".concat(spacing.SizesDdsSpacingLocalX075)
|
|
48
|
+
},
|
|
49
|
+
extraCompact: {
|
|
50
|
+
padding: "".concat(spacing.SizesDdsSpacingLocalX025, " ").concat(spacing.SizesDdsSpacingLocalX05)
|
|
41
51
|
}
|
|
42
52
|
},
|
|
43
53
|
head: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
export type TableDensity = 'normal' | 'compact';
|
|
2
|
+
export type TableDensity = 'normal' | 'compact' | 'extraCompact';
|
|
3
3
|
export type TableProps = {
|
|
4
4
|
/**Spesifiserer hvor romslige cellene i tabellen skal være. */
|
|
5
5
|
density?: TableDensity;
|