@oslokommune/punkt-react 19.18.3 → 19.19.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/CHANGELOG.md CHANGED
@@ -5,6 +5,31 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
5
5
 
6
6
  ---
7
7
 
8
+ ## [19.19.0](https://github.com/oslokommune/punkt/compare/19.18.5...19.19.0) (2026-10-28)
9
+
10
+ ### Features
11
+ * Dunkelmodus for table, switch, modal, loader, timepicker og stepper (#3787). - Table: grå zebra-striper og tydeligere hover. Ny skin `zebra`
12
+ erstatter `zebra-blue` (prop og CSS-klasse), som er deprecated og
13
+ fjernes i en kommende versjon (resolves #3771)
14
+ - Switch: på-tilstanden er lys i dark mode og lyseblå ved hover
15
+ (resolves #3770)
16
+ - Modal: fjernet et lyst felt nederst i innholdet i dark mode (resolves
17
+ #3758)
18
+ - Loader: støtter dark mode, med tre nye fargetokens for spinneren
19
+ (resolves #3751)
20
+ - Timepicker: hover på klokkeslett virker nå og har samme farge som i
21
+ datepicker (resolves #3772)
22
+ - Stepper: støtter dark mode. Aktivt steg har grå bakgrunn, og kommende
23
+ steg har ikke lenger nedtonet tekst (resolves #3761)
24
+
25
+ ---
26
+
27
+
28
+ ## [19.19.0](https://github.com/oslokommune/punkt/compare/19.18.4...19.19.0) (2026-10-22)
29
+
30
+ ---
31
+
32
+
8
33
  ## [19.18.3](https://github.com/oslokommune/punkt/compare/19.18.2...19.18.3) (2026-10-20)
9
34
 
10
35
  ---
@@ -1,42 +1,13 @@
1
1
  import { HTMLAttributes, ReactNode } from 'react';
2
- import { TPktSizeBase } from '../../shared-types';
2
+ import { IPktLoaderBase, TPktLoaderVariant, TPktSizeBase } from '../../shared-types';
3
3
  declare global {
4
4
  interface Window {
5
5
  pktAnimationPath?: string;
6
6
  }
7
7
  }
8
- export type TPktLoaderVariant = 'blue' | 'rainbow' | 'shapes';
8
+ export type { TPktLoaderVariant };
9
9
  export type TPktLoaderSize = TPktSizeBase;
10
- export interface IPktLoader extends HTMLAttributes<HTMLDivElement> {
11
- /**
12
- * Tid i millisekunder før loader vises. Nyttig når lastetiden kan være
13
- * så kort at loader ikke trengs.
14
- */
15
- delay?: number;
16
- /**
17
- * Vises loader inline eller som blokk.
18
- */
19
- inline?: boolean;
20
- /**
21
- * Styrer om loader eller barnenoder vises. Når `false` vises barnenoder.
22
- */
23
- isLoading?: boolean;
24
- /**
25
- * Meldingstekst som vises sammen med loader.
26
- */
27
- message?: string | null;
28
- /**
29
- * Størrelse på loader. Standard er "medium".
30
- */
31
- size?: TPktLoaderSize;
32
- /**
33
- * Loader-variant. Standard er "rainbow". "shapes" er Oslo-bølgene, "blue" en blå spinner.
34
- */
35
- variant?: TPktLoaderVariant;
36
- /**
37
- * Overstyrer stien til loader-animasjoner.
38
- */
39
- loadingAnimationPath?: string;
10
+ export interface IPktLoader extends IPktLoaderBase, HTMLAttributes<HTMLDivElement> {
40
11
  children?: ReactNode;
41
12
  }
42
13
  export declare const PktLoader: import('react').ForwardRefExoticComponent<IPktLoader & import('react').RefAttributes<HTMLDivElement>>;
@@ -1,48 +1,49 @@
1
1
  "use client";
2
2
  import { __toESM as e } from "../../_virtual/_rolldown/runtime.js";
3
3
  import { ANIMATION_DEFAULT_PATH as t } from "../../shared-types/icon.js";
4
+ import { LOADER_DEFAULTS as n } from "../../shared-types/loader.js";
4
5
  import "../../shared-types/index.js";
5
- import { require_classnames as n } from "../../node_modules/classnames/index.js";
6
- import { PktIcon as r } from "../icon/Icon.js";
7
- import { forwardRef as i, useEffect as a, useState as o } from "react";
8
- import { jsx as s, jsxs as c } from "react/jsx-runtime";
6
+ import { require_classnames as r } from "../../node_modules/classnames/index.js";
7
+ import { PktIcon as i } from "../icon/Icon.js";
8
+ import { forwardRef as a, useEffect as o, useState as s } from "react";
9
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
9
10
  //#region src/components/loader/Loader.tsx
10
- var l = /* @__PURE__ */ e(n(), 1);
11
+ var u = /* @__PURE__ */ e(r(), 1);
11
12
  typeof window < "u" && (window.pktAnimationPath = window.pktAnimationPath || "https://punkt-cdn.oslo.kommune.no/latest/animations/");
12
- var u = (e) => {
13
+ var d = (e) => {
13
14
  switch (e) {
14
15
  case "blue": return "spinner-blue";
15
16
  case "rainbow": return "spinner";
16
17
  default: return "loader";
17
18
  }
18
- }, d = i(function({ delay: e = 0, inline: n = !1, isLoading: i = !0, message: d = null, size: f = "medium", variant: p = "rainbow", loadingAnimationPath: m = typeof window < "u" ? window.pktAnimationPath : t, className: h, children: g, ..._ }, v) {
19
- let [y, b] = o(!1), [x, S] = o(e);
20
- e !== x && (S(e), b(!1)), a(() => {
19
+ }, f = a(function({ delay: e = n.delay, inline: r = n.inline, isLoading: a = n.isLoading, message: f = n.message, size: p = n.size, variant: m = n.variant, loadingAnimationPath: h = typeof window < "u" ? window.pktAnimationPath : t, className: g, children: _, ...v }, y) {
20
+ let [b, x] = s(!1), [S, C] = s(e);
21
+ e !== S && (C(e), x(!1)), o(() => {
21
22
  if (e <= 0) return;
22
- let t = setTimeout(() => b(!0), e);
23
+ let t = setTimeout(() => x(!0), e);
23
24
  return () => clearTimeout(t);
24
25
  }, [e]);
25
- let C = e <= 0 || y, w = (0, l.default)("pkt-loader", n ? "pkt-loader--inline" : "pkt-loader--box", `pkt-loader--${f}`, h);
26
- return /* @__PURE__ */ c("div", {
27
- ..._,
28
- ref: v,
26
+ let w = e <= 0 || b, T = (0, u.default)("pkt-loader", r ? "pkt-loader--inline" : "pkt-loader--box", `pkt-loader--${p}`, g);
27
+ return /* @__PURE__ */ l("div", {
28
+ ...v,
29
+ ref: y,
29
30
  role: "status",
30
31
  "aria-live": "polite",
31
- "aria-busy": i ? "true" : "false",
32
- className: w,
33
- children: [i && C && /* @__PURE__ */ c("div", {
32
+ "aria-busy": a ? "true" : "false",
33
+ className: T,
34
+ children: [a && w && /* @__PURE__ */ l("div", {
34
35
  className: "pkt-loader__spinner",
35
- children: [/* @__PURE__ */ s(r, {
36
- name: u(p),
37
- path: m,
38
- className: `pkt-loader__svg pkt-loader__${p}`
39
- }), d && /* @__PURE__ */ s("p", { children: d })]
40
- }), /* @__PURE__ */ s("div", {
41
- className: (0, l.default)("pkt-contents", i && "pkt-hide"),
42
- children: g
36
+ children: [/* @__PURE__ */ c(i, {
37
+ name: d(m),
38
+ path: h,
39
+ className: `pkt-loader__svg pkt-loader__${m}`
40
+ }), f && /* @__PURE__ */ c("p", { children: f })]
41
+ }), /* @__PURE__ */ c("div", {
42
+ className: (0, u.default)("pkt-contents", a && "pkt-hide"),
43
+ children: _
43
44
  })]
44
45
  });
45
46
  });
46
- d.displayName = "PktLoader";
47
+ f.displayName = "PktLoader";
47
48
  //#endregion
48
- export { d as PktLoader };
49
+ export { f as PktLoader };
@@ -11,7 +11,7 @@ var i = /* @__PURE__ */ e(t(), 1), a = /* @__PURE__ */ n("svg", {
11
11
  cx: "12",
12
12
  cy: "12",
13
13
  r: "7",
14
- style: { fill: "var(--pkt-color-brand-neutrals-300, #CCC)" }
14
+ fill: "#CCC"
15
15
  })
16
16
  }), o = /* @__PURE__ */ r("svg", {
17
17
  xmlns: "http://www.w3.org/2000/svg",
@@ -4,17 +4,18 @@ import "../../shared-types/index.js";
4
4
  import { require_classnames as n } from "../../node_modules/classnames/index.js";
5
5
  import { jsx as r } from "react/jsx-runtime";
6
6
  //#region src/components/table/Table.tsx
7
- var i = /* @__PURE__ */ e(n(), 1), a = ({ className: e, compact: n = t.compact, skin: a = t.skin, responsiveView: o = t.responsiveView, children: s, ...c }) => /* @__PURE__ */ r("table", {
7
+ var i = /* @__PURE__ */ e(n(), 1), a = !1, o = ({ className: e, compact: n = t.compact, skin: o = t.skin, responsiveView: s = t.responsiveView, children: c, ...l }) => (o === "zebra-blue" && !a && (a = !0, console.warn("PktTable: skin=\"zebra-blue\" is deprecated and will be removed in a future version. Please use skin=\"zebra\" instead.")), /* @__PURE__ */ r("table", {
8
8
  "data-testid": "pkt-table",
9
9
  className: (0, i.default)(e, "pkt-table", {
10
- "pkt-table--responsive": o,
10
+ "pkt-table--responsive": s,
11
11
  "pkt-table--compact": n,
12
- "pkt-table--basic": a === "basic",
13
- "pkt-table--zebra-blue": a === "zebra-blue"
12
+ "pkt-table--basic": o === "basic",
13
+ "pkt-table--zebra": o === "zebra" || o === "zebra-blue",
14
+ "pkt-table--zebra-blue": o === "zebra-blue"
14
15
  }),
15
16
  role: "table",
16
- ...c,
17
- children: s
18
- });
17
+ ...l,
18
+ children: c
19
+ }));
19
20
  //#endregion
20
- export { a as PktTable };
21
+ export { o as PktTable };