@navikt/ds-react 1.3.2 → 1.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_docs.json +42 -0
- package/cjs/table/Row.js +2 -1
- package/esm/table/Row.d.ts +5 -0
- package/esm/table/Row.js +2 -1
- package/esm/table/Row.js.map +1 -1
- package/package.json +3 -3
- package/src/table/Row.tsx +7 -1
- package/src/table/stories/table.stories.tsx +7 -3
package/_docs.json
CHANGED
|
@@ -5103,6 +5103,27 @@
|
|
|
5103
5103
|
"name": "boolean"
|
|
5104
5104
|
}
|
|
5105
5105
|
},
|
|
5106
|
+
"shadeOnHover": {
|
|
5107
|
+
"defaultValue": {
|
|
5108
|
+
"value": "true"
|
|
5109
|
+
},
|
|
5110
|
+
"description": "Shade the table row on hover.",
|
|
5111
|
+
"name": "shadeOnHover",
|
|
5112
|
+
"parent": {
|
|
5113
|
+
"fileName": "react/src/table/Row.tsx",
|
|
5114
|
+
"name": "RowProps"
|
|
5115
|
+
},
|
|
5116
|
+
"declarations": [
|
|
5117
|
+
{
|
|
5118
|
+
"fileName": "react/src/table/Row.tsx",
|
|
5119
|
+
"name": "RowProps"
|
|
5120
|
+
}
|
|
5121
|
+
],
|
|
5122
|
+
"required": false,
|
|
5123
|
+
"type": {
|
|
5124
|
+
"name": "boolean"
|
|
5125
|
+
}
|
|
5126
|
+
},
|
|
5106
5127
|
"className": {
|
|
5107
5128
|
"defaultValue": null,
|
|
5108
5129
|
"description": "",
|
|
@@ -5296,6 +5317,27 @@
|
|
|
5296
5317
|
"name": "boolean"
|
|
5297
5318
|
}
|
|
5298
5319
|
},
|
|
5320
|
+
"shadeOnHover": {
|
|
5321
|
+
"defaultValue": {
|
|
5322
|
+
"value": "true"
|
|
5323
|
+
},
|
|
5324
|
+
"description": "Shade the table row on hover.",
|
|
5325
|
+
"name": "shadeOnHover",
|
|
5326
|
+
"parent": {
|
|
5327
|
+
"fileName": "src/table/Row.tsx",
|
|
5328
|
+
"name": "RowProps"
|
|
5329
|
+
},
|
|
5330
|
+
"declarations": [
|
|
5331
|
+
{
|
|
5332
|
+
"fileName": "src/table/Row.tsx",
|
|
5333
|
+
"name": "RowProps"
|
|
5334
|
+
}
|
|
5335
|
+
],
|
|
5336
|
+
"required": false,
|
|
5337
|
+
"type": {
|
|
5338
|
+
"name": "boolean"
|
|
5339
|
+
}
|
|
5340
|
+
},
|
|
5299
5341
|
"className": {
|
|
5300
5342
|
"defaultValue": null,
|
|
5301
5343
|
"description": "",
|
package/cjs/table/Row.js
CHANGED
|
@@ -41,9 +41,10 @@ exports.Row = void 0;
|
|
|
41
41
|
const react_1 = __importStar(require("react"));
|
|
42
42
|
const clsx_1 = __importDefault(require("clsx"));
|
|
43
43
|
exports.Row = (0, react_1.forwardRef)((_a, ref) => {
|
|
44
|
-
var { className, selected = false } = _a, rest = __rest(_a, ["className", "selected"]);
|
|
44
|
+
var { className, selected = false, shadeOnHover = true } = _a, rest = __rest(_a, ["className", "selected", "shadeOnHover"]);
|
|
45
45
|
return (react_1.default.createElement("tr", Object.assign({}, rest, { ref: ref, className: (0, clsx_1.default)("navds-table__row", className, {
|
|
46
46
|
"navds-table__row--selected": selected,
|
|
47
|
+
"navds-table__row--shade-on-hover": shadeOnHover,
|
|
47
48
|
}) })));
|
|
48
49
|
});
|
|
49
50
|
exports.default = exports.Row;
|
package/esm/table/Row.d.ts
CHANGED
|
@@ -5,6 +5,11 @@ export interface RowProps extends React.HTMLAttributes<HTMLTableRowElement> {
|
|
|
5
5
|
* @default false
|
|
6
6
|
*/
|
|
7
7
|
selected?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Shade the table row on hover.
|
|
10
|
+
* @default true
|
|
11
|
+
*/
|
|
12
|
+
shadeOnHover?: boolean;
|
|
8
13
|
}
|
|
9
14
|
export interface RowType extends React.ForwardRefExoticComponent<RowProps & React.RefAttributes<HTMLTableRowElement>> {
|
|
10
15
|
}
|
package/esm/table/Row.js
CHANGED
|
@@ -12,9 +12,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import React, { forwardRef } from "react";
|
|
13
13
|
import cl from "clsx";
|
|
14
14
|
export const Row = forwardRef((_a, ref) => {
|
|
15
|
-
var { className, selected = false } = _a, rest = __rest(_a, ["className", "selected"]);
|
|
15
|
+
var { className, selected = false, shadeOnHover = true } = _a, rest = __rest(_a, ["className", "selected", "shadeOnHover"]);
|
|
16
16
|
return (React.createElement("tr", Object.assign({}, rest, { ref: ref, className: cl("navds-table__row", className, {
|
|
17
17
|
"navds-table__row--selected": selected,
|
|
18
|
+
"navds-table__row--shade-on-hover": shadeOnHover,
|
|
18
19
|
}) })));
|
|
19
20
|
});
|
|
20
21
|
export default Row;
|
package/esm/table/Row.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Row.js","sourceRoot":"","sources":["../../src/table/Row.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"Row.js","sourceRoot":"","sources":["../../src/table/Row.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,MAAM,MAAM,CAAC;AAoBtB,MAAM,CAAC,MAAM,GAAG,GAAY,UAAU,CACpC,CAAC,EAA6D,EAAE,GAAG,EAAE,EAAE;QAAtE,EAAE,SAAS,EAAE,QAAQ,GAAG,KAAK,EAAE,YAAY,GAAG,IAAI,OAAW,EAAN,IAAI,cAA3D,yCAA6D,CAAF;IAAY,OAAA,CACtE,4CACM,IAAI,IACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,kBAAkB,EAAE,SAAS,EAAE;YAC3C,4BAA4B,EAAE,QAAQ;YACtC,kCAAkC,EAAE,YAAY;SACjD,CAAC,IACF,CACH,CAAA;CAAA,CACF,CAAC;AAEF,eAAe,GAAG,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@navikt/ds-react",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.4",
|
|
4
4
|
"description": "NAV designsystem react components",
|
|
5
5
|
"author": "NAV Designsystem team",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@floating-ui/react-dom-interactions": "0.9.2",
|
|
39
|
-
"@navikt/ds-icons": "^1.3.
|
|
39
|
+
"@navikt/ds-icons": "^1.3.4",
|
|
40
40
|
"@radix-ui/react-tabs": "1.0.0",
|
|
41
41
|
"@radix-ui/react-toggle-group": "1.0.0",
|
|
42
42
|
"clsx": "^1.1.1",
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"optional": true
|
|
75
75
|
}
|
|
76
76
|
},
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "f3929075e3f936f2a0dd6369f197af21814c3400"
|
|
78
78
|
}
|
package/src/table/Row.tsx
CHANGED
|
@@ -7,6 +7,11 @@ export interface RowProps extends React.HTMLAttributes<HTMLTableRowElement> {
|
|
|
7
7
|
* @default false
|
|
8
8
|
*/
|
|
9
9
|
selected?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Shade the table row on hover.
|
|
12
|
+
* @default true
|
|
13
|
+
*/
|
|
14
|
+
shadeOnHover?: boolean;
|
|
10
15
|
}
|
|
11
16
|
|
|
12
17
|
export interface RowType
|
|
@@ -15,12 +20,13 @@ export interface RowType
|
|
|
15
20
|
> {}
|
|
16
21
|
|
|
17
22
|
export const Row: RowType = forwardRef(
|
|
18
|
-
({ className, selected = false, ...rest }, ref) => (
|
|
23
|
+
({ className, selected = false, shadeOnHover = true, ...rest }, ref) => (
|
|
19
24
|
<tr
|
|
20
25
|
{...rest}
|
|
21
26
|
ref={ref}
|
|
22
27
|
className={cl("navds-table__row", className, {
|
|
23
28
|
"navds-table__row--selected": selected,
|
|
29
|
+
"navds-table__row--shade-on-hover": shadeOnHover,
|
|
24
30
|
})}
|
|
25
31
|
/>
|
|
26
32
|
)
|
|
@@ -19,7 +19,7 @@ const TableComponent = (props) => (
|
|
|
19
19
|
</Table.Row>
|
|
20
20
|
</Table.Header>
|
|
21
21
|
<Table.Body>
|
|
22
|
-
<Table.Row>
|
|
22
|
+
<Table.Row shadeOnHover={props.shadeOnHover}>
|
|
23
23
|
{props.button && (
|
|
24
24
|
<Table.DataCell
|
|
25
25
|
style={{
|
|
@@ -35,7 +35,7 @@ const TableComponent = (props) => (
|
|
|
35
35
|
<Table.DataCell>Picard</Table.DataCell>
|
|
36
36
|
<Table.DataCell>Kaptein</Table.DataCell>
|
|
37
37
|
</Table.Row>
|
|
38
|
-
<Table.Row>
|
|
38
|
+
<Table.Row shadeOnHover={props.shadeOnHover}>
|
|
39
39
|
{props.button && (
|
|
40
40
|
<Table.DataCell
|
|
41
41
|
style={{
|
|
@@ -51,7 +51,7 @@ const TableComponent = (props) => (
|
|
|
51
51
|
<Table.DataCell>Riker</Table.DataCell>
|
|
52
52
|
<Table.DataCell>Kommandør</Table.DataCell>
|
|
53
53
|
</Table.Row>
|
|
54
|
-
<Table.Row>
|
|
54
|
+
<Table.Row shadeOnHover={props.shadeOnHover}>
|
|
55
55
|
{props.button && (
|
|
56
56
|
<Table.DataCell
|
|
57
57
|
style={{
|
|
@@ -73,6 +73,10 @@ const TableComponent = (props) => (
|
|
|
73
73
|
|
|
74
74
|
export const Default = () => <TableComponent />;
|
|
75
75
|
export const Zebra = () => <TableComponent zebraStripes />;
|
|
76
|
+
export const NoShadeOnHover = () => <TableComponent shadeOnHover={false} />;
|
|
77
|
+
export const ZebraNoShadeOnHover = () => (
|
|
78
|
+
<TableComponent zebraStripes shadeOnHover={false} />
|
|
79
|
+
);
|
|
76
80
|
export const Small = () => <TableComponent size="small" />;
|
|
77
81
|
export const Buttons = () => <TableComponent size="small" button />;
|
|
78
82
|
|