@navikt/ds-react 7.11.0 → 7.12.1
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/cjs/chips/Toggle.js +2 -2
- package/cjs/chips/Toggle.js.map +1 -1
- package/cjs/copybutton/CopyButton.d.ts +2 -11
- package/cjs/copybutton/CopyButton.js +16 -4
- package/cjs/copybutton/CopyButton.js.map +1 -1
- package/cjs/index.d.ts +4 -0
- package/cjs/index.js +6 -1
- package/cjs/index.js.map +1 -1
- package/cjs/internal-header/InternalHeader.js +1 -1
- package/cjs/internal-header/InternalHeader.js.map +1 -1
- package/cjs/list/{ListItem.d.ts → List.Item.d.ts} +1 -1
- package/cjs/list/{ListItem.js → List.Item.js} +3 -3
- package/cjs/list/List.Item.js.map +1 -0
- package/{esm/list/context.d.ts → cjs/list/List.context.d.ts} +1 -1
- package/cjs/list/{context.js → List.context.js} +1 -1
- package/cjs/list/List.context.js.map +1 -0
- package/cjs/list/List.d.ts +2 -2
- package/cjs/list/List.js +19 -5
- package/cjs/list/List.js.map +1 -1
- package/cjs/list/{types.d.ts → List.types.d.ts} +3 -0
- package/cjs/list/{types.js → List.types.js} +1 -1
- package/cjs/list/List.types.js.map +1 -0
- package/cjs/list/index.d.ts +2 -2
- package/cjs/list/index.js +2 -2
- package/cjs/list/index.js.map +1 -1
- package/cjs/overlays/action-menu/ActionMenu.js +2 -2
- package/cjs/table/ColumnHeader.js +1 -1
- package/cjs/table/ColumnHeader.js.map +1 -1
- package/cjs/theme/Theme.d.ts +2 -2
- package/cjs/theme/index.d.ts +1 -1
- package/cjs/theme/index.js.map +1 -1
- package/esm/chips/Toggle.js +2 -2
- package/esm/chips/Toggle.js.map +1 -1
- package/esm/copybutton/CopyButton.d.ts +2 -11
- package/esm/copybutton/CopyButton.js +16 -4
- package/esm/copybutton/CopyButton.js.map +1 -1
- package/esm/index.d.ts +4 -0
- package/esm/index.js +4 -0
- package/esm/index.js.map +1 -1
- package/esm/internal-header/InternalHeader.js +1 -1
- package/esm/internal-header/InternalHeader.js.map +1 -1
- package/esm/list/{ListItem.d.ts → List.Item.d.ts} +1 -1
- package/esm/list/{ListItem.js → List.Item.js} +2 -2
- package/esm/list/List.Item.js.map +1 -0
- package/{cjs/list/context.d.ts → esm/list/List.context.d.ts} +1 -1
- package/esm/list/{context.js → List.context.js} +1 -1
- package/esm/list/List.context.js.map +1 -0
- package/esm/list/List.d.ts +2 -2
- package/esm/list/List.js +16 -2
- package/esm/list/List.js.map +1 -1
- package/esm/list/{types.d.ts → List.types.d.ts} +3 -0
- package/esm/list/List.types.js +2 -0
- package/esm/list/List.types.js.map +1 -0
- package/esm/list/index.d.ts +2 -2
- package/esm/list/index.js +1 -1
- package/esm/list/index.js.map +1 -1
- package/esm/overlays/action-menu/ActionMenu.js +2 -2
- package/esm/table/ColumnHeader.js +2 -2
- package/esm/table/ColumnHeader.js.map +1 -1
- package/esm/theme/Theme.d.ts +2 -2
- package/esm/theme/index.d.ts +1 -1
- package/esm/theme/index.js.map +1 -1
- package/package.json +14 -4
- package/src/chips/Toggle.tsx +2 -2
- package/src/copybutton/CopyButton.tsx +43 -14
- package/src/index.ts +5 -0
- package/src/internal-header/InternalHeader.tsx +1 -1
- package/src/list/{ListItem.tsx → List.Item.tsx} +2 -2
- package/src/list/{context.ts → List.context.ts} +1 -1
- package/src/list/List.tsx +37 -3
- package/src/list/{types.ts → List.types.ts} +3 -0
- package/src/list/index.ts +2 -2
- package/src/overlays/action-menu/ActionMenu.tsx +2 -2
- package/src/table/ColumnHeader.tsx +4 -4
- package/src/tag/Tag.tsx +6 -6
- package/src/theme/Theme.tsx +2 -2
- package/src/theme/index.ts +1 -1
- package/cjs/list/ListItem.js.map +0 -1
- package/cjs/list/context.js.map +0 -1
- package/cjs/list/types.js.map +0 -1
- package/esm/list/ListItem.js.map +0 -1
- package/esm/list/context.js.map +0 -1
- package/esm/list/types.js +0 -2
- package/esm/list/types.js.map +0 -1
|
@@ -51,7 +51,7 @@ export const InternalHeader = forwardRef((_a, ref) => {
|
|
|
51
51
|
* Component is always in "dark" mode, so we manually override global theme.
|
|
52
52
|
*/
|
|
53
53
|
if (themeContext) {
|
|
54
|
-
return (React.createElement(Theme, { theme: "dark", asChild: true },
|
|
54
|
+
return (React.createElement(Theme, { theme: "dark", asChild: true, hasBackground: false },
|
|
55
55
|
React.createElement("header", Object.assign({}, rest, { ref: ref, className: cl("navds-internalheader", className) }))));
|
|
56
56
|
}
|
|
57
57
|
return (React.createElement("header", Object.assign({ "data-theme": "dark" }, rest, { ref: ref, className: cl("navds-internalheader", className) })));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InternalHeader.js","sourceRoot":"","sources":["../../src/internal-header/InternalHeader.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,KAAK,EAAE,EAAkB,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,OAAO,oBAEN,MAAM,wBAAwB,CAAC;AAChC,OAAO,mBAEN,MAAM,uBAAuB,CAAC;AAC/B,OAAO,kBAEN,MAAM,sBAAsB,CAAC;AAC9B,OAAO,wBAEN,MAAM,4BAA4B,CAAC;AAoCpC;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAC,CAAC,EAAsB,EAAE,GAAG,EAAE,EAAE;QAA/B,EAAE,SAAS,OAAW,EAAN,IAAI,cAApB,aAAsB,CAAF;IAC5D,MAAM,YAAY,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAE7C;;OAEG;IACH,IAAI,YAAY,EAAE,CAAC;QACjB,OAAO,CACL,oBAAC,KAAK,IAAC,KAAK,EAAC,MAAM,EAAC,OAAO;
|
|
1
|
+
{"version":3,"file":"InternalHeader.js","sourceRoot":"","sources":["../../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AAe,cAAc,CAAC"}
|
|
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import cl from "clsx";
|
|
13
13
|
import React, { forwardRef, useContext } from "react";
|
|
14
14
|
import { BodyLong } from "../typography/index.js";
|
|
15
|
-
import { ListContext } from "./context.js";
|
|
15
|
+
import { ListContext } from "./List.context.js";
|
|
16
16
|
/**
|
|
17
17
|
* @see 🏷️ {@link ListItemProps}
|
|
18
18
|
*/
|
|
@@ -34,4 +34,4 @@ export const ListItem = forwardRef((_a, ref) => {
|
|
|
34
34
|
});
|
|
35
35
|
ListItem.displayName = "List.Item";
|
|
36
36
|
export default ListItem;
|
|
37
|
-
//# sourceMappingURL=
|
|
37
|
+
//# sourceMappingURL=List.Item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"List.Item.js","sourceRoot":"","sources":["../../src/list/List.Item.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAChC,CAAC,EAA6C,EAAE,GAAG,EAAE,EAAE;QAAtD,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,OAAW,EAAN,IAAI,cAA3C,0CAA6C,CAAF;IAC1C,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC;IAEnD,IAAI,QAAQ,KAAK,IAAI,IAAI,IAAI,EAAE,CAAC;QAC9B,OAAO,CAAC,IAAI,CACV,sFAAsF,CACvF,CAAC;IACJ,CAAC;IAED,OAAO,CACL,4CAAQ,IAAI,IAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,CAAC,kBAAkB,EAAE,SAAS,CAAC;QACjE,QAAQ,KAAK,IAAI,IAAI,CACpB,6BACE,SAAS,EAAE,EAAE,CAAC,yBAAyB,EAAE;gBACvC,+BAA+B,EAAE,IAAI;gBACrC,iCAAiC,EAAE,CAAC,IAAI;aACzC,CAAC,IAED,IAAI,CAAC,CAAC,CAAC,CACN,IAAI,CACL,CAAC,CAAC,CAAC,CACF,6BACE,KAAK,EAAC,UAAU,EAChB,MAAM,EAAC,UAAU,EACjB,OAAO,EAAC,SAAS,EACjB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,uBAElC,SAAS,EAAE,KAAK,EAChB,IAAI,EAAC,KAAK;YAEV,8BAAM,KAAK,EAAC,GAAG,EAAC,MAAM,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,EAAC,IAAI,EAAC,cAAc,GAAG,CACpD,CACP,CACG,CACP;QAED;YACG,KAAK,IAAI,CACR,oBAAC,QAAQ,IAAC,EAAE,EAAC,GAAG,EAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAC,UAAU,IAC3C,KAAK,CACG,CACZ;YACA,QAAQ,CACL,CACH,CACN,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,QAAQ,CAAC,WAAW,GAAG,WAAW,CAAC;AACnC,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"List.context.js","sourceRoot":"","sources":["../../src/list/List.context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAQtC,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAmB;IACzD,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE,QAAQ;CACf,CAAC,CAAC"}
|
package/esm/list/List.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { ListItem } from "./
|
|
3
|
-
import type { ListProps } from "./types.js";
|
|
2
|
+
import { ListItem } from "./List.Item.js";
|
|
3
|
+
import type { ListProps } from "./List.types.js";
|
|
4
4
|
export interface ListComponent extends React.ForwardRefExoticComponent<ListProps & React.RefAttributes<HTMLDivElement>> {
|
|
5
5
|
/**
|
|
6
6
|
* @see 🏷️ {@link ListItemProps}
|
package/esm/list/List.js
CHANGED
|
@@ -11,9 +11,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import cl from "clsx";
|
|
13
13
|
import React, { forwardRef, useContext } from "react";
|
|
14
|
+
import { useThemeInternal } from "../theme/Theme.js";
|
|
14
15
|
import { BodyLong, BodyShort, Heading } from "../typography/index.js";
|
|
15
|
-
import { ListItem } from "./
|
|
16
|
-
import { ListContext } from "./context.js";
|
|
16
|
+
import { ListItem } from "./List.Item.js";
|
|
17
|
+
import { ListContext } from "./List.context.js";
|
|
17
18
|
const headingSizeMap = {
|
|
18
19
|
small: "xsmall",
|
|
19
20
|
medium: "small",
|
|
@@ -37,7 +38,20 @@ const headingSizeMap = {
|
|
|
37
38
|
export const List = forwardRef((_a, ref) => {
|
|
38
39
|
var { children, className, as: ListTag = "ul", title, description, headingTag = "h3", size } = _a, rest = __rest(_a, ["children", "className", "as", "title", "description", "headingTag", "size"]);
|
|
39
40
|
const { size: contextSize } = useContext(ListContext);
|
|
41
|
+
const themeContext = useThemeInternal(false);
|
|
40
42
|
const listSize = size !== null && size !== void 0 ? size : contextSize;
|
|
43
|
+
if (themeContext) {
|
|
44
|
+
if (process.env.NODE_ENV !== "production" &&
|
|
45
|
+
(title || description || headingTag)) {
|
|
46
|
+
console.warn("List: title, description and headingTag are deprecated and will not work with updated theme for Aksel.");
|
|
47
|
+
}
|
|
48
|
+
return (React.createElement(ListContext.Provider, { value: {
|
|
49
|
+
listType: ListTag,
|
|
50
|
+
size: listSize,
|
|
51
|
+
} },
|
|
52
|
+
React.createElement(BodyLong, Object.assign({ as: "div" }, rest, { size: listSize, ref: ref, className: cl("navds-list", `navds-list--${listSize}`, className) }),
|
|
53
|
+
React.createElement(ListTag, { role: "list" }, children))));
|
|
54
|
+
}
|
|
41
55
|
return (React.createElement(ListContext.Provider, { value: {
|
|
42
56
|
listType: ListTag,
|
|
43
57
|
size: listSize,
|
package/esm/list/List.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.js","sourceRoot":"","sources":["../../src/list/List.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAgB,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"List.js","sourceRoot":"","sources":["../../src/list/List.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAgB,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAI7C,MAAM,cAAc,GAGhB;IACF,KAAK,EAAE,QAAQ;IACf,MAAM,EAAE,OAAO;IACf,KAAK,EAAE,QAAQ;CAChB,CAAC;AAYF;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,UAAU,CAC5B,CACE,EASC,EACD,GAAG,EACH,EAAE;QAXF,EACE,QAAQ,EACR,SAAS,EACT,EAAE,EAAE,OA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I,CACR,oBAAC,OAAO,IAAC,IAAI,EAAE,cAAc,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,UAAU,IACpD,KAAK,CACE,CACX;YACA,WAAW,IAAI,oBAAC,SAAS,IAAC,IAAI,EAAE,QAAQ,IAAG,WAAW,CAAa;YACpE,oBAAC,OAAO,IAAC,IAAI,EAAC,MAAM,IAAE,QAAQ,CAAW,CAChC,CACU,CACxB,CAAC;AACJ,CAAC,CACe,CAAC;AAEnB,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC;AAErB,eAAe,IAAI,CAAC"}
|
|
@@ -7,15 +7,18 @@ export interface ListProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
7
7
|
as?: "ul" | "ol";
|
|
8
8
|
/**
|
|
9
9
|
* List heading title.
|
|
10
|
+
* @deprecated Prop will be removed in future versions.
|
|
10
11
|
*/
|
|
11
12
|
title?: string;
|
|
12
13
|
/**
|
|
13
14
|
* List heading description.
|
|
15
|
+
* @deprecated Prop will be removed in future versions.
|
|
14
16
|
*/
|
|
15
17
|
description?: string;
|
|
16
18
|
/**
|
|
17
19
|
* Allows setting a different HTML h-tag.
|
|
18
20
|
* @default "h3"
|
|
21
|
+
* @deprecated Prop will be removed in future versions.
|
|
19
22
|
*/
|
|
20
23
|
headingTag?: React.ElementType<any>;
|
|
21
24
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"List.types.js","sourceRoot":"","sources":["../../src/list/List.types.ts"],"names":[],"mappings":""}
|
package/esm/list/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { default as List } from "./List.js";
|
|
2
|
-
export type { ListProps, ListItemProps } from "./types.js";
|
|
3
|
-
export { default as ListItem } from "./
|
|
2
|
+
export type { ListProps, ListItemProps } from "./List.types.js";
|
|
3
|
+
export { default as ListItem } from "./List.Item.js";
|
package/esm/list/index.js
CHANGED
package/esm/list/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/list/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEzC,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/list/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEzC,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -111,7 +111,7 @@ export const ActionMenuCheckboxItem = forwardRef((_a, ref) => {
|
|
|
111
111
|
React.createElement(Menu.ItemIndicator, { className: "navds-action-menu__indicator" },
|
|
112
112
|
React.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "navds-action-menu__indicator-icon", "aria-hidden": true },
|
|
113
113
|
React.createElement("g", { className: "navds-action-menu__indicator-icon--unchecked" },
|
|
114
|
-
React.createElement("rect", { width: "24", height: "24", rx: "4", fill: "var(--ax-border-
|
|
114
|
+
React.createElement("rect", { width: "24", height: "24", rx: "4", fill: "var(--ax-border-neutral, var(--a-border-default))" }),
|
|
115
115
|
React.createElement("rect", { x: "1", y: "1", width: "22", height: "22", rx: "3", fill: "var(--ax-bg-default, var(--a-surface-default))", strokeWidth: "2" })),
|
|
116
116
|
React.createElement("g", { className: "navds-action-menu__indicator-icon--indeterminate" },
|
|
117
117
|
React.createElement("rect", { width: "24", height: "24", rx: "4", fill: "var(--ax-bg-accent-strong-pressed, var(--a-surface-action-selected))" }),
|
|
@@ -142,7 +142,7 @@ export const ActionMenuRadioItem = forwardRef((_a, ref) => {
|
|
|
142
142
|
React.createElement(Menu.ItemIndicator, { className: "navds-action-menu__indicator" },
|
|
143
143
|
React.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "navds-action-menu__indicator-icon", "aria-hidden": true },
|
|
144
144
|
React.createElement("g", { className: "navds-action-menu__indicator-icon--unchecked" },
|
|
145
|
-
React.createElement("rect", { width: "24", height: "24", rx: "12", fill: "var(--ax-border-
|
|
145
|
+
React.createElement("rect", { width: "24", height: "24", rx: "12", fill: "var(--ax-border-neutral, var(--a-border-default))" }),
|
|
146
146
|
React.createElement("rect", { x: "1", y: "1", width: "22", height: "22", rx: "11", strokeWidth: "2", fill: "var(--ax-bg-default, var(--a-surface-default))" })),
|
|
147
147
|
themeContext ? (React.createElement("g", { className: "navds-action-menu__indicator-icon--checked" },
|
|
148
148
|
React.createElement("rect", { width: "24", height: "24", rx: "12", fill: "var(--ax-bg-accent-strong-pressed)" }),
|
|
@@ -10,7 +10,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import React, { forwardRef, useContext } from "react";
|
|
13
|
-
import {
|
|
13
|
+
import { ArrowsUpDownIcon, SortDownIcon, SortUpIcon, } from "@navikt/aksel-icons";
|
|
14
14
|
import HeaderCell from "./HeaderCell.js";
|
|
15
15
|
import { TableContext } from "./context.js";
|
|
16
16
|
export const ColumnHeader = forwardRef((_a, ref) => {
|
|
@@ -28,7 +28,7 @@ export const ColumnHeader = forwardRef((_a, ref) => {
|
|
|
28
28
|
? () => { var _a; return (_a = context === null || context === void 0 ? void 0 : context.onSortChange) === null || _a === void 0 ? void 0 : _a.call(context, sortKey); }
|
|
29
29
|
: undefined },
|
|
30
30
|
children,
|
|
31
|
-
((_d = context === null || context === void 0 ? void 0 : context.sort) === null || _d === void 0 ? void 0 : _d.orderBy) === sortKey ? (((_e = context === null || context === void 0 ? void 0 : context.sort) === null || _e === void 0 ? void 0 : _e.direction) === "descending" ? (React.createElement(
|
|
31
|
+
((_d = context === null || context === void 0 ? void 0 : context.sort) === null || _d === void 0 ? void 0 : _d.orderBy) === sortKey ? (((_e = context === null || context === void 0 ? void 0 : context.sort) === null || _e === void 0 ? void 0 : _e.direction) === "descending" ? (React.createElement(SortDownIcon, { "aria-hidden": true })) : (React.createElement(SortUpIcon, { "aria-hidden": true }))) : (React.createElement(ArrowsUpDownIcon, { "aria-hidden": true })))) : (children)));
|
|
32
32
|
});
|
|
33
33
|
export default ColumnHeader;
|
|
34
34
|
//# sourceMappingURL=ColumnHeader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColumnHeader.js","sourceRoot":"","sources":["../../src/table/ColumnHeader.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"ColumnHeader.js","sourceRoot":"","sources":["../../src/table/ColumnHeader.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,UAAU,GACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,UAA+B,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAkBzC,MAAM,CAAC,MAAM,YAAY,GAAqB,UAAU,CACtD,CAAC,EAA2D,EAAE,GAAG,EAAE,EAAE;;QAApE,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,GAAG,KAAK,EAAE,OAAO,OAAW,EAAN,IAAI,cAAzD,gDAA2D,CAAF;IACxD,MAAM,OAAO,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;IAEzC,IAAI,QAAQ,IAAI,CAAC,OAAO,EAAE,CAAC;QACzB,OAAO,CAAC,IAAI,CAAC,wDAAwD,CAAC,CAAC;IACzE,CAAC;IAED,OAAO,CACL,oBAA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| "dark";
|
|
9
9
|
};
|
|
10
10
|
declare const useThemeInternal: <S extends boolean = true>(strict?: S) => S extends true ? ThemeContext : ThemeContext | undefined;
|
|
11
|
-
type ThemeProps = {
|
|
11
|
+
export type ThemeProps = {
|
|
12
12
|
className?: string;
|
|
13
13
|
hasBackground?: boolean;
|
|
14
14
|
} & ThemeContext & AsChildProps;
|
package/esm/theme/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Theme } from "./Theme.js";
|
|
1
|
+
export { Theme, ThemeProps } from "./Theme.js";
|
package/esm/theme/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,OAAO,EAAE,KAAK,EAAc,MAAM,SAAS,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@navikt/ds-react",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.12.1",
|
|
4
4
|
"description": "React components from the Norwegian Labour and Welfare Administration.",
|
|
5
5
|
"author": "Aksel, a team part of the Norwegian Labour and Welfare Administration.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -600,7 +600,17 @@
|
|
|
600
600
|
"default": "./cjs/form/form-progress/index.js"
|
|
601
601
|
}
|
|
602
602
|
},
|
|
603
|
-
"./package.json": "./package.json"
|
|
603
|
+
"./package.json": "./package.json",
|
|
604
|
+
"./Theme": {
|
|
605
|
+
"import": {
|
|
606
|
+
"types": "./esm/theme/index.d.ts",
|
|
607
|
+
"default": "./esm/theme/index.js"
|
|
608
|
+
},
|
|
609
|
+
"require": {
|
|
610
|
+
"types": "./cjs/theme/index.d.ts",
|
|
611
|
+
"default": "./cjs/theme/index.js"
|
|
612
|
+
}
|
|
613
|
+
}
|
|
604
614
|
},
|
|
605
615
|
"scripts": {
|
|
606
616
|
"docgen": "tsx ../../../scripts/docgen.ts",
|
|
@@ -615,8 +625,8 @@
|
|
|
615
625
|
"dependencies": {
|
|
616
626
|
"@floating-ui/react": "0.25.4",
|
|
617
627
|
"@floating-ui/react-dom": "^2.0.9",
|
|
618
|
-
"@navikt/aksel-icons": "^7.
|
|
619
|
-
"@navikt/ds-tokens": "^7.
|
|
628
|
+
"@navikt/aksel-icons": "^7.12.1",
|
|
629
|
+
"@navikt/ds-tokens": "^7.12.1",
|
|
620
630
|
"clsx": "^2.1.0",
|
|
621
631
|
"date-fns": "^3.0.0",
|
|
622
632
|
"react-day-picker": "8.10.1"
|
package/src/chips/Toggle.tsx
CHANGED
|
@@ -77,8 +77,8 @@ export const ToggleChips: OverridableComponent<
|
|
|
77
77
|
/* After removing old fallbacks, change to currentColor */
|
|
78
78
|
fill={`var(${
|
|
79
79
|
variant === "action"
|
|
80
|
-
? "--ax-text-accent
|
|
81
|
-
: "--ax-text-
|
|
80
|
+
? "--ax-text-accent"
|
|
81
|
+
: "--ax-text-neutral"
|
|
82
82
|
}, var(--ac-chip-toggle-circle-border, var(--a-border-default)))`}
|
|
83
83
|
/>
|
|
84
84
|
)}
|
|
@@ -7,18 +7,16 @@ import React, {
|
|
|
7
7
|
useState,
|
|
8
8
|
} from "react";
|
|
9
9
|
import { CheckmarkIcon, FilesIcon } from "@navikt/aksel-icons";
|
|
10
|
+
import { Button, ButtonProps } from "../button";
|
|
11
|
+
import { useThemeInternal } from "../theme/Theme";
|
|
10
12
|
import { Label } from "../typography";
|
|
11
13
|
import { composeEventHandlers } from "../util/composeEventHandlers";
|
|
12
14
|
import copy from "../util/copy";
|
|
13
15
|
import { useI18n } from "../util/i18n/i18n.hooks";
|
|
14
16
|
|
|
15
17
|
export interface CopyButtonProps
|
|
16
|
-
extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children"
|
|
17
|
-
|
|
18
|
-
* `"xsmall"` should _only_ be used in tables.
|
|
19
|
-
* @default "medium"
|
|
20
|
-
*/
|
|
21
|
-
size?: "medium" | "small" | "xsmall";
|
|
18
|
+
extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children">,
|
|
19
|
+
Pick<ButtonProps, "iconPosition" | "size"> {
|
|
22
20
|
/**
|
|
23
21
|
* @default "neutral"
|
|
24
22
|
*/
|
|
@@ -63,11 +61,6 @@ export interface CopyButtonProps
|
|
|
63
61
|
* @default "Kopier"
|
|
64
62
|
*/
|
|
65
63
|
title?: string;
|
|
66
|
-
/**
|
|
67
|
-
* Icon position in button.
|
|
68
|
-
* @default "left"
|
|
69
|
-
*/
|
|
70
|
-
iconPosition?: "left" | "right";
|
|
71
64
|
}
|
|
72
65
|
|
|
73
66
|
/**
|
|
@@ -89,7 +82,6 @@ export const CopyButton = forwardRef<HTMLButtonElement, CopyButtonProps>(
|
|
|
89
82
|
text,
|
|
90
83
|
activeText,
|
|
91
84
|
variant = "neutral",
|
|
92
|
-
size = "medium",
|
|
93
85
|
onActiveChange,
|
|
94
86
|
icon,
|
|
95
87
|
activeIcon,
|
|
@@ -97,6 +89,7 @@ export const CopyButton = forwardRef<HTMLButtonElement, CopyButtonProps>(
|
|
|
97
89
|
title,
|
|
98
90
|
iconPosition = "left",
|
|
99
91
|
onClick,
|
|
92
|
+
size = "medium",
|
|
100
93
|
...rest
|
|
101
94
|
},
|
|
102
95
|
ref,
|
|
@@ -105,6 +98,8 @@ export const CopyButton = forwardRef<HTMLButtonElement, CopyButtonProps>(
|
|
|
105
98
|
const timeoutRef = useRef<number>();
|
|
106
99
|
const translate = useI18n("CopyButton");
|
|
107
100
|
|
|
101
|
+
const themeContext = useThemeInternal(false);
|
|
102
|
+
|
|
108
103
|
useEffect(() => {
|
|
109
104
|
return () => {
|
|
110
105
|
timeoutRef.current && clearTimeout(timeoutRef.current);
|
|
@@ -126,23 +121,44 @@ export const CopyButton = forwardRef<HTMLButtonElement, CopyButtonProps>(
|
|
|
126
121
|
const activeString = activeText || translate("activeText");
|
|
127
122
|
|
|
128
123
|
const copyIcon = (
|
|
129
|
-
<
|
|
124
|
+
<LegacyIconWrapper useLegacy={!themeContext}>
|
|
130
125
|
{active
|
|
131
126
|
? activeIcon ?? (
|
|
132
127
|
<CheckmarkIcon
|
|
133
128
|
aria-hidden={!!text}
|
|
134
129
|
title={text ? undefined : activeString}
|
|
130
|
+
className={themeContext ? "navds-copybutton__icon" : undefined}
|
|
135
131
|
/>
|
|
136
132
|
)
|
|
137
133
|
: icon ?? (
|
|
138
134
|
<FilesIcon
|
|
139
135
|
aria-hidden={!!text}
|
|
140
136
|
title={text ? undefined : title || translate("title")}
|
|
137
|
+
className={themeContext ? "navds-copybutton__icon" : undefined}
|
|
141
138
|
/>
|
|
142
139
|
)}
|
|
143
|
-
</
|
|
140
|
+
</LegacyIconWrapper>
|
|
144
141
|
);
|
|
145
142
|
|
|
143
|
+
if (themeContext) {
|
|
144
|
+
return (
|
|
145
|
+
<Button
|
|
146
|
+
ref={ref}
|
|
147
|
+
type="button"
|
|
148
|
+
className={cl("navds-copybutton", className)}
|
|
149
|
+
{...rest}
|
|
150
|
+
variant={variant === "action" ? "tertiary" : "tertiary-neutral"}
|
|
151
|
+
onClick={composeEventHandlers(onClick, handleClick)}
|
|
152
|
+
iconPosition={iconPosition}
|
|
153
|
+
icon={copyIcon}
|
|
154
|
+
data-active={active}
|
|
155
|
+
size={size}
|
|
156
|
+
>
|
|
157
|
+
{text ? (active ? activeString : text) : null}
|
|
158
|
+
</Button>
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
|
|
146
162
|
return (
|
|
147
163
|
<button
|
|
148
164
|
ref={ref}
|
|
@@ -175,4 +191,17 @@ export const CopyButton = forwardRef<HTMLButtonElement, CopyButtonProps>(
|
|
|
175
191
|
},
|
|
176
192
|
);
|
|
177
193
|
|
|
194
|
+
function LegacyIconWrapper({
|
|
195
|
+
children,
|
|
196
|
+
useLegacy,
|
|
197
|
+
}: {
|
|
198
|
+
children: React.ReactNode;
|
|
199
|
+
useLegacy: boolean;
|
|
200
|
+
}) {
|
|
201
|
+
if (!useLegacy) {
|
|
202
|
+
return children;
|
|
203
|
+
}
|
|
204
|
+
return <span className="navds-copybutton__icon">{children}</span>;
|
|
205
|
+
}
|
|
206
|
+
|
|
178
207
|
export default CopyButton;
|
package/src/index.ts
CHANGED
|
@@ -151,6 +151,11 @@ export { Switch, type SwitchProps } from "./form/switch";
|
|
|
151
151
|
export { Textarea, type TextareaProps } from "./form/textarea";
|
|
152
152
|
export { TextField, type TextFieldProps } from "./form/textfield";
|
|
153
153
|
|
|
154
|
+
/**
|
|
155
|
+
* Theming
|
|
156
|
+
*/
|
|
157
|
+
export { Theme, type ThemeProps } from "./theme";
|
|
158
|
+
|
|
154
159
|
/**
|
|
155
160
|
* @deprecated
|
|
156
161
|
*/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import cl from "clsx";
|
|
2
2
|
import React, { forwardRef, useContext } from "react";
|
|
3
3
|
import { BodyLong } from "../typography";
|
|
4
|
-
import { ListContext } from "./context";
|
|
5
|
-
import type { ListItemProps } from "./types";
|
|
4
|
+
import { ListContext } from "./List.context";
|
|
5
|
+
import type { ListItemProps } from "./List.types";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* @see 🏷️ {@link ListItemProps}
|
package/src/list/List.tsx
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import cl from "clsx";
|
|
2
2
|
import React, { forwardRef, useContext } from "react";
|
|
3
|
+
import { useThemeInternal } from "../theme/Theme";
|
|
3
4
|
import { BodyLong, BodyShort, Heading, HeadingProps } from "../typography";
|
|
4
|
-
import { ListItem } from "./
|
|
5
|
-
import { ListContext } from "./context";
|
|
5
|
+
import { ListItem } from "./List.Item";
|
|
6
|
+
import { ListContext } from "./List.context";
|
|
6
7
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7
|
-
import type { ListItemProps, ListProps } from "./types";
|
|
8
|
+
import type { ListItemProps, ListProps } from "./List.types";
|
|
8
9
|
|
|
9
10
|
const headingSizeMap: Record<
|
|
10
11
|
Exclude<ListProps["size"], undefined>,
|
|
@@ -56,7 +57,40 @@ export const List = forwardRef<HTMLDivElement, ListProps>(
|
|
|
56
57
|
) => {
|
|
57
58
|
const { size: contextSize } = useContext(ListContext);
|
|
58
59
|
|
|
60
|
+
const themeContext = useThemeInternal(false);
|
|
61
|
+
|
|
59
62
|
const listSize = size ?? contextSize;
|
|
63
|
+
|
|
64
|
+
if (themeContext) {
|
|
65
|
+
if (
|
|
66
|
+
process.env.NODE_ENV !== "production" &&
|
|
67
|
+
(title || description || headingTag)
|
|
68
|
+
) {
|
|
69
|
+
console.warn(
|
|
70
|
+
"List: title, description and headingTag are deprecated and will not work with updated theme for Aksel.",
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return (
|
|
75
|
+
<ListContext.Provider
|
|
76
|
+
value={{
|
|
77
|
+
listType: ListTag,
|
|
78
|
+
size: listSize,
|
|
79
|
+
}}
|
|
80
|
+
>
|
|
81
|
+
<BodyLong
|
|
82
|
+
as="div"
|
|
83
|
+
{...rest}
|
|
84
|
+
size={listSize}
|
|
85
|
+
ref={ref}
|
|
86
|
+
className={cl("navds-list", `navds-list--${listSize}`, className)}
|
|
87
|
+
>
|
|
88
|
+
<ListTag role="list">{children}</ListTag>
|
|
89
|
+
</BodyLong>
|
|
90
|
+
</ListContext.Provider>
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
|
|
60
94
|
return (
|
|
61
95
|
<ListContext.Provider
|
|
62
96
|
value={{
|
|
@@ -7,15 +7,18 @@ export interface ListProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
7
7
|
as?: "ul" | "ol";
|
|
8
8
|
/**
|
|
9
9
|
* List heading title.
|
|
10
|
+
* @deprecated Prop will be removed in future versions.
|
|
10
11
|
*/
|
|
11
12
|
title?: string;
|
|
12
13
|
/**
|
|
13
14
|
* List heading description.
|
|
15
|
+
* @deprecated Prop will be removed in future versions.
|
|
14
16
|
*/
|
|
15
17
|
description?: string;
|
|
16
18
|
/**
|
|
17
19
|
* Allows setting a different HTML h-tag.
|
|
18
20
|
* @default "h3"
|
|
21
|
+
* @deprecated Prop will be removed in future versions.
|
|
19
22
|
*/
|
|
20
23
|
headingTag?: React.ElementType<any>;
|
|
21
24
|
/**
|
package/src/list/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
export { default as List } from "./List";
|
|
3
|
-
export type { ListProps, ListItemProps } from "./types";
|
|
4
|
-
export { default as ListItem } from "./
|
|
3
|
+
export type { ListProps, ListItemProps } from "./List.types";
|
|
4
|
+
export { default as ListItem } from "./List.Item";
|
|
@@ -634,7 +634,7 @@ export const ActionMenuCheckboxItem = forwardRef<
|
|
|
634
634
|
width="24"
|
|
635
635
|
height="24"
|
|
636
636
|
rx="4"
|
|
637
|
-
fill="var(--ax-border-
|
|
637
|
+
fill="var(--ax-border-neutral, var(--a-border-default))"
|
|
638
638
|
/>
|
|
639
639
|
<rect
|
|
640
640
|
x="1"
|
|
@@ -771,7 +771,7 @@ export const ActionMenuRadioItem = forwardRef<
|
|
|
771
771
|
width="24"
|
|
772
772
|
height="24"
|
|
773
773
|
rx="12"
|
|
774
|
-
fill="var(--ax-border-
|
|
774
|
+
fill="var(--ax-border-neutral, var(--a-border-default))"
|
|
775
775
|
/>
|
|
776
776
|
<rect
|
|
777
777
|
x="1"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { forwardRef, useContext } from "react";
|
|
2
2
|
import {
|
|
3
|
-
ArrowDownIcon,
|
|
4
|
-
ArrowUpIcon,
|
|
5
3
|
ArrowsUpDownIcon,
|
|
4
|
+
SortDownIcon,
|
|
5
|
+
SortUpIcon,
|
|
6
6
|
} from "@navikt/aksel-icons";
|
|
7
7
|
import HeaderCell, { HeaderCellProps } from "./HeaderCell";
|
|
8
8
|
import { TableContext } from "./context";
|
|
@@ -58,9 +58,9 @@ export const ColumnHeader: ColumnHeaderType = forwardRef(
|
|
|
58
58
|
{children}
|
|
59
59
|
{context?.sort?.orderBy === sortKey ? (
|
|
60
60
|
context?.sort?.direction === "descending" ? (
|
|
61
|
-
<
|
|
61
|
+
<SortDownIcon aria-hidden />
|
|
62
62
|
) : (
|
|
63
|
-
<
|
|
63
|
+
<SortUpIcon aria-hidden />
|
|
64
64
|
)
|
|
65
65
|
) : (
|
|
66
66
|
<ArrowsUpDownIcon aria-hidden />
|
package/src/tag/Tag.tsx
CHANGED
|
@@ -34,12 +34,12 @@ export interface TagProps extends HTMLAttributes<HTMLSpanElement> {
|
|
|
34
34
|
| "alt3-moderate";
|
|
35
35
|
|
|
36
36
|
/* Temp hide these until naming is resolved */
|
|
37
|
-
// | "meta-
|
|
38
|
-
// | "meta-
|
|
39
|
-
// | "meta-
|
|
40
|
-
// | "meta-
|
|
41
|
-
// | "meta-
|
|
42
|
-
// | "meta-
|
|
37
|
+
// | "meta-purple"
|
|
38
|
+
// | "meta-purple-filled"
|
|
39
|
+
// | "meta-purple-moderate"
|
|
40
|
+
// | "meta-lime"
|
|
41
|
+
// | "meta-lime-filled"
|
|
42
|
+
// | "meta-lime-moderate";
|
|
43
43
|
/**
|
|
44
44
|
* @default "medium"
|
|
45
45
|
*/
|
package/src/theme/Theme.tsx
CHANGED
|
@@ -9,7 +9,7 @@ type ThemeContext = {
|
|
|
9
9
|
* Color theme
|
|
10
10
|
* @default "light"
|
|
11
11
|
*/
|
|
12
|
-
theme
|
|
12
|
+
theme?: "light" | "dark";
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
const [ThemeProvider, useThemeInternal] = createContext<ThemeContext>({
|
|
@@ -18,7 +18,7 @@ const [ThemeProvider, useThemeInternal] = createContext<ThemeContext>({
|
|
|
18
18
|
providerName: "ThemeProvider",
|
|
19
19
|
});
|
|
20
20
|
|
|
21
|
-
type ThemeProps = {
|
|
21
|
+
export type ThemeProps = {
|
|
22
22
|
className?: string;
|
|
23
23
|
hasBackground?: boolean;
|
|
24
24
|
} & ThemeContext &
|
package/src/theme/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export { Theme } from "./Theme";
|
|
2
|
+
export { Theme, ThemeProps } from "./Theme";
|