@oslokommune/punkt-react 19.20.0 → 20.0.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.
Files changed (41) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/README.md +3 -2
  3. package/dist/components/card/Card.js +77 -70
  4. package/dist/components/checkbox/Checkbox.js +1 -1
  5. package/dist/components/inputwrapper/InputWrapper.js +1 -1
  6. package/dist/components/link/Link.d.ts +0 -1
  7. package/dist/components/link/Link.js +10 -12
  8. package/dist/components/linkcard/LinkCard.d.ts +1 -1
  9. package/dist/components/linkcard/LinkCard.js +23 -20
  10. package/dist/components/messagebox/Messagebox.js +29 -28
  11. package/dist/components/radio/RadioButton.js +1 -1
  12. package/dist/components/tag/Tag.d.ts +2 -1
  13. package/dist/components/tag/Tag.js +37 -35
  14. package/dist/punkt-react.cjs +1 -1
  15. package/dist/shared-types/card.d.ts +5 -17
  16. package/dist/shared-types/card.js +9 -8
  17. package/dist/shared-types/combobox.d.ts +3 -3
  18. package/dist/shared-types/icon.d.ts +2 -2
  19. package/dist/shared-types/icon.js +1 -1
  20. package/dist/shared-types/index.d.ts +9 -8
  21. package/dist/shared-types/index.js +17 -16
  22. package/dist/shared-types/linkcard.d.ts +7 -4
  23. package/dist/shared-types/linkcard.js +9 -0
  24. package/dist/shared-types/messagebox.d.ts +4 -2
  25. package/dist/shared-types/messagebox.js +8 -3
  26. package/dist/shared-types/skin.d.ts +8 -2
  27. package/package.json +4 -4
  28. package/src/components/button/Button.test.tsx +1 -1
  29. package/src/components/card/Card.test.tsx +78 -43
  30. package/src/components/card/Card.tsx +17 -24
  31. package/src/components/checkbox/Checkbox.tsx +1 -1
  32. package/src/components/inputwrapper/InputWrapper.tsx +1 -1
  33. package/src/components/link/Link.test.tsx +9 -21
  34. package/src/components/link/Link.tsx +0 -4
  35. package/src/components/linkcard/LinkCard.test.tsx +20 -9
  36. package/src/components/linkcard/LinkCard.tsx +5 -11
  37. package/src/components/messagebox/Messagebox.test.tsx +10 -1
  38. package/src/components/messagebox/Messagebox.tsx +11 -2
  39. package/src/components/radio/RadioButton.tsx +1 -1
  40. package/src/components/tag/Tag.test.tsx +21 -0
  41. package/src/components/tag/Tag.tsx +6 -2
package/CHANGELOG.md CHANGED
@@ -5,6 +5,65 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
5
5
 
6
6
  ---
7
7
 
8
+ ## [20.0.0](https://github.com/oslokommune/punkt/compare/19.20.0...20.0.0) (2026-11-03)
9
+
10
+ ### ⚠ BREAKING CHANGES
11
+ * Punkt 20: Ny card, tag, messagebox, CDN for ikoner og mye mer (#3782). BREAKING CHANGE: Card: standard-skin er `gray`, ikke `outlined`. Sett
12
+ `skin="outlined"` for å beholde rammen.
13
+
14
+ BREAKING CHANGE: Card: `padding`, `imageShape`, `borderOnHover` og
15
+ `restrictImageHeight` er fjernet, sammen med CSS-klassene,
16
+ `TCardPadding`, `TCardImageShape`, `CARD_PADDINGS` og
17
+ `CARD_IMAGE_SHAPES`. Bildet har fast høyde. Bruk `imageAspect` for
18
+ sideforhold.
19
+
20
+ BREAKING CHANGE: Card: skin `outlined-beige` er fjernet. Bruk
21
+ `outlined`.
22
+
23
+ BREAKING CHANGE: Card: liggende card stables etter bredden på cardet,
24
+ ikke skjermen. Egen HTML må ha `.pkt-card__container` rundt bilde og
25
+ tekst, og `pkt-card--clickable` på klikkbare card.
26
+
27
+ BREAKING CHANGE: Messagebox: standard-skin er `gray`, ikke `beige`. Sett
28
+ `skin="beige"` for å beholde utseendet.
29
+
30
+ BREAKING CHANGE: Tag: standard-skin er `gray`, ikke `blue`. Sett
31
+ `skin="blue"` for å beholde utseendet.
32
+
33
+ BREAKING CHANGE: `grey` er fjernet. Bruk `gray`. Det gjelder `skin` på
34
+ Tag og Link card, `tagSkin` på tab items, `tagSkinColor` i Combobox og
35
+ `pkt-section--grey`. På Link card blir `grey-outline` til `outlined`.
36
+
37
+ BREAKING CHANGE: Link card: skin `beige-outline` er fjernet. Bruk
38
+ `outlined`. Skin `no-padding` er fjernet, og link card uten skin har
39
+ ikke lenger padding.
40
+
41
+ BREAKING CHANGE: Link og Link card: `external` er fjernet, sammen med
42
+ ikonet og klassen `pkt-link--external`. Bruk `rel="noopener noreferrer"`
43
+ på Link.
44
+
45
+ BREAKING CHANGE: Icon: ikonene hentes fra
46
+ `https://cdn.ikoner.oslo.kommune.no/icons/`, ikke punkt-cdn. En Content
47
+ Security Policy må tillate domenet i `connect-src`. Ikonene
48
+ `search-icon-round-*` og `search-icon-square-*` er fjernet.
49
+
50
+ Verktøyet migrerer det meste: `npx @oslokommune/punkt-migrate@20 .
51
+ --dry-run`
52
+
53
+ Se
54
+ https://punkt.oslo.kommune.no/latest/grunnleggende/for-utviklere/migrering-punkt-20/
55
+ for mer informasjon.
56
+
57
+ ### Features
58
+ * Card er tegnet om, med pil etter overskriften på klikkbare. card og ny skin `transparent`.
59
+ * Tag har nye farger med light-varianter og nye state-farger..
60
+ * Link card har fått samme skins som Card. `normal` og. `gray-outline` virker fortsatt.
61
+ * Dark mode for Card, Tag, Messagebox og Link card. Skins uten. mørk variant holder seg lyse.
62
+ * punkt-migrate@20 migrerer props og attributter i alle. rammeverk, og tar prosjekter på 18 via 19.
63
+
64
+ ---
65
+
66
+
8
67
  ## [19.20.0](https://github.com/oslokommune/punkt/compare/19.19.1...19.20.0) (2026-11-03)
9
68
 
10
69
  ### Features
package/README.md CHANGED
@@ -40,9 +40,10 @@ import { PktButton, PktTextInput } from "@oslokommune/punkt-react";
40
40
  ## 🟪 Ikoner
41
41
 
42
42
  Alle våre komponenter bruker PktIcon-komponenten for å importere
43
- ikonene via vår [CDN](https://punkt-cdn.oslo.kommune.no/).
43
+ ikonene fra Oslo kommunes [ikonbibliotek](https://cdn.ikoner.oslo.kommune.no/).
44
44
 
45
- Om du har en content security policy(CSP) satt opp må du åpne for https://punkt-cdn.oslo.kommune.no/ i din CSP.
45
+ Om du har en content security policy(CSP) satt opp må du åpne for https://punkt-cdn.oslo.kommune.no/ og
46
+ https://cdn.ikoner.oslo.kommune.no/ i din CSP.
46
47
 
47
48
  ## 🔢 Versjonering
48
49
 
@@ -1,100 +1,107 @@
1
1
  "use client";
2
2
  import { __toESM as e } from "../../_virtual/_rolldown/runtime.js";
3
- import { CARD_DEFAULTS as t } from "../../shared-types/card.js";
3
+ import { CARD_DEFAULTS as t, CARD_LIGHT_ONLY_SKINS as n } from "../../shared-types/card.js";
4
4
  import "../../shared-types/index.js";
5
- import { require_classnames as n } from "../../node_modules/classnames/index.js";
6
- import { plural as r } from "../../shared-strings/format.js";
7
- import { usePktStrings as i } from "../../hooks/usePktStrings.js";
8
- import { withStableKeys as a } from "../../utils/stableKeys.js";
9
- import { PktHeading as o } from "../heading/Heading.js";
10
- import { PktTag as s } from "../tag/Tag.js";
11
- import { forwardRef as c } from "react";
12
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
5
+ import { require_classnames as r } from "../../node_modules/classnames/index.js";
6
+ import { PktIcon as i } from "../icon/Icon.js";
7
+ import { plural as a } from "../../shared-strings/format.js";
8
+ import { usePktStrings as o } from "../../hooks/usePktStrings.js";
9
+ import { withStableKeys as s } from "../../utils/stableKeys.js";
10
+ import { PktHeading as c } from "../heading/Heading.js";
11
+ import { PktTag as l } from "../tag/Tag.js";
12
+ import { forwardRef as u } from "react";
13
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
13
14
  //#region src/components/card/Card.tsx
14
- var d = /* @__PURE__ */ e(n(), 1), f = c(({ children: e, className: n, ariaLabel: c, metaLead: f, borderOnHover: p = t.borderOnHover, metaTrail: m, layout: h = t.layout, heading: g = "", headingLevel: _ = t.headingLevel, image: v, imageShape: y = t.imageShape, imageAspect: b, restrictImageHeight: x = t.restrictImageHeight, clickCardLink: S, padding: C = t.padding, openLinkInNewTab: w = t.openLinkInNewTab, skin: T = t.skin, subheading: E = "", tagPosition: D = t.tagPosition, zoom: O = t.zoom, tags: k = [], strings: A, ...j }, M) => {
15
- let N = i(["card"], A), P = (0, d.default)({
15
+ var p = /* @__PURE__ */ e(r(), 1), m = u(({ children: e, className: r, ariaLabel: u, metaLead: m, metaTrail: h, layout: g = t.layout, heading: _ = "", headingLevel: v = t.headingLevel, image: y, imageAspect: b, clickCardLink: x, openLinkInNewTab: S = t.openLinkInNewTab, skin: C = t.skin, subheading: w = "", tagPosition: T = t.tagPosition, zoom: E = t.zoom, tags: D = [], strings: O, ...k }, A) => {
16
+ let j = o(["card"], O), M = (0, p.default)({
16
17
  "pkt-card": !0,
17
- [`pkt-card--${T}`]: T,
18
- [`pkt-card--${h}`]: h,
19
- [`pkt-card--padding-${C}`]: C,
20
- "pkt-card--border-on-hover": p,
21
- "pkt-card--zoom": O
22
- }), F = c?.trim() || (g ? `${g} lenkekort` : "lenkekort"), I = c?.trim() || g || "kort", L = () => v?.src ? /* @__PURE__ */ l("div", {
23
- className: (0, d.default)("pkt-card__image", `pkt-card__image-${y}`, b && `pkt-card__image-aspect-${b}`, x && "pkt-card__image-restricted"),
24
- children: /* @__PURE__ */ l("img", {
25
- src: v.src,
26
- alt: v.alt || ""
18
+ [`pkt-card--${C}`]: C,
19
+ [`pkt-card--${g}`]: g,
20
+ "pkt-card--clickable": !!x,
21
+ "pkt-card--zoom": E
22
+ }), N = u?.trim() || (_ ? `${_} lenkekort` : "lenkekort"), P = u?.trim() || _ || "kort", F = () => y?.src ? /* @__PURE__ */ d("div", {
23
+ className: (0, p.default)("pkt-card__image", b && `pkt-card__image-aspect-${b}`),
24
+ children: /* @__PURE__ */ d("img", {
25
+ src: y.src,
26
+ alt: y.alt || ""
27
27
  })
28
- }) : null, R = () => k.length === 0 ? null : /* @__PURE__ */ l("div", {
29
- className: (0, d.default)("pkt-card__tags", `pkt-card__tags-${D}`),
28
+ }) : null, I = () => D.length === 0 ? null : /* @__PURE__ */ d("div", {
29
+ className: (0, p.default)("pkt-card__tags", `pkt-card__tags-${T}`),
30
30
  role: "list",
31
- "aria-label": r(k.length, N.card.tagsLabelOne, N.card.tagsLabelOther),
32
- children: a(k, (e) => e.text).map(({ item: e, key: t }) => /* @__PURE__ */ l(s, {
31
+ "aria-label": a(D.length, j.card.tagsLabelOne, j.card.tagsLabelOther),
32
+ children: s(D, (e) => e.text).map(({ item: e, key: t }) => /* @__PURE__ */ d(l, {
33
33
  role: "listitem",
34
34
  textStyle: "normal-text",
35
35
  size: "medium",
36
36
  skin: e.skin,
37
37
  iconName: e.iconName,
38
- children: /* @__PURE__ */ l("span", { children: e.text })
38
+ children: /* @__PURE__ */ d("span", { children: e.text })
39
39
  }, t))
40
- }), z = () => !g || S ? null : /* @__PURE__ */ l(o, {
40
+ }), L = () => !_ || x ? null : /* @__PURE__ */ d(c, {
41
41
  className: "pkt-card__heading",
42
- level: _,
42
+ level: v,
43
43
  size: "medium",
44
- weight: "regular",
45
- children: g
46
- }), B = () => S ? /* @__PURE__ */ l(o, {
44
+ weight: "medium",
45
+ children: _
46
+ }), R = () => x ? /* @__PURE__ */ f(c, {
47
47
  className: "pkt-card__link-heading pkt-card__heading",
48
- level: _,
48
+ level: v,
49
49
  size: "medium",
50
- weight: "regular",
51
- children: /* @__PURE__ */ l("a", {
50
+ weight: "medium",
51
+ children: [/* @__PURE__ */ d("a", {
52
52
  className: "pkt-card__link",
53
- href: S,
54
- target: w ? "_blank" : "_self",
55
- rel: w ? "noopener noreferrer" : void 0,
56
- children: g
57
- })
58
- }) : null, V = () => E ? /* @__PURE__ */ l("p", {
53
+ href: x,
54
+ target: S ? "_blank" : "_self",
55
+ rel: S ? "noopener noreferrer" : void 0,
56
+ children: _
57
+ }), /* @__PURE__ */ d(i, {
58
+ className: "pkt-card__link-icon",
59
+ name: "arrow-link"
60
+ })]
61
+ }) : null, z = () => w ? /* @__PURE__ */ d("p", {
59
62
  className: "pkt-card__subheading",
60
- children: E
61
- }) : null, H = () => !g && !E ? null : /* @__PURE__ */ u("header", {
63
+ children: w
64
+ }) : null, B = () => !_ && !w ? null : /* @__PURE__ */ f("header", {
62
65
  className: "pkt-card__header",
63
66
  children: [
64
- z(),
65
- B(),
66
- V()
67
+ L(),
68
+ R(),
69
+ z()
67
70
  ]
68
- }), U = () => !f && !m ? null : /* @__PURE__ */ u("footer", {
71
+ }), V = () => !m && !h ? null : /* @__PURE__ */ f("footer", {
69
72
  className: "pkt-card__metadata",
70
- children: [f && /* @__PURE__ */ l("span", {
73
+ children: [m && /* @__PURE__ */ d("span", {
71
74
  className: "pkt-card__metadata-lead",
72
- children: f
73
- }), m && /* @__PURE__ */ l("span", {
74
- className: "pkt-card__metadata-trail",
75
75
  children: m
76
+ }), h && /* @__PURE__ */ d("span", {
77
+ className: "pkt-card__metadata-trail",
78
+ children: h
76
79
  })]
77
80
  });
78
- return /* @__PURE__ */ u("article", {
79
- ...j,
80
- ref: M,
81
- className: (0, d.default)(P, n),
82
- "aria-label": S ? F : I,
83
- children: [L(), /* @__PURE__ */ u("div", {
84
- className: "pkt-card__wrapper",
85
- children: [
86
- D === "top" && R(),
87
- H(),
88
- /* @__PURE__ */ l("section", {
89
- className: "pkt-card__content",
90
- children: e
91
- }),
92
- D === "bottom" && R(),
93
- U()
94
- ]
95
- })]
81
+ return /* @__PURE__ */ d("article", {
82
+ ...k,
83
+ ref: A,
84
+ className: (0, p.default)(M, r),
85
+ "aria-label": x ? N : P,
86
+ "data-mode": n.includes(C) ? "light" : void 0,
87
+ children: /* @__PURE__ */ f("div", {
88
+ className: "pkt-card__container",
89
+ children: [F(), /* @__PURE__ */ f("div", {
90
+ className: "pkt-card__wrapper",
91
+ children: [
92
+ T === "top" && I(),
93
+ B(),
94
+ /* @__PURE__ */ d("section", {
95
+ className: "pkt-card__content",
96
+ children: e
97
+ }),
98
+ T === "bottom" && I(),
99
+ V()
100
+ ]
101
+ })]
102
+ })
96
103
  });
97
104
  });
98
- f.displayName = "PktCard";
105
+ m.displayName = "PktCard";
99
106
  //#endregion
100
- export { f as PktCard };
107
+ export { m as PktCard };
@@ -48,7 +48,7 @@ var l = r(({ id: r, hasTile: l = e.hasTile, disabled: u = e.disabled, label: d,
48
48
  children: E
49
49
  }),
50
50
  x && /* @__PURE__ */ s("span", {
51
- className: Y + " pkt-tag--blue-light",
51
+ className: Y + " pkt-tag--blue-pale",
52
52
  children: S ?? N.forms.optional
53
53
  }),
54
54
  C && /* @__PURE__ */ s("span", {
@@ -41,7 +41,7 @@ var p = l(({ id: l, forId: p, label: m, helptext: h, helptextDropdown: g, helpte
41
41
  children: T
42
42
  }),
43
43
  x && /* @__PURE__ */ d("span", {
44
- className: X + " pkt-tag--blue-light",
44
+ className: X + " pkt-tag--blue-pale",
45
45
  children: S ?? U.forms.optional
46
46
  }),
47
47
  C && /* @__PURE__ */ d("span", {
@@ -5,7 +5,6 @@ interface IPktLink extends LinkHTMLAttributes<HTMLAnchorElement> {
5
5
  iconName?: string | undefined;
6
6
  className?: string | undefined;
7
7
  iconPosition?: string | undefined;
8
- external?: boolean;
9
8
  target?: string | undefined;
10
9
  renderLink?: TRenderLink<ReactNode, AnchorHTMLAttributes<HTMLAnchorElement>>;
11
10
  }
@@ -3,29 +3,27 @@ import { require_classnames as t } from "../../node_modules/classnames/index.js"
3
3
  import { PktIcon as n } from "../icon/Icon.js";
4
4
  import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
5
5
  //#region src/components/link/Link.tsx
6
- var o = /* @__PURE__ */ e(t(), 1), s = ({ href: e, iconName: t, className: s, iconPosition: c, external: l, target: u, renderLink: d, children: f, ...p }) => {
7
- let m = {
6
+ var o = /* @__PURE__ */ e(t(), 1), s = ({ href: e, iconName: t, className: s, iconPosition: c, target: l, renderLink: u, children: d, ...f }) => {
7
+ let p = {
8
8
  "pkt-link": !0,
9
9
  "pkt-link--icon-left": !!t && c === "left" || !(!t || c),
10
- "pkt-link--icon-right": !!t && c === "right",
11
- "pkt-link--external": l
12
- }, h = /* @__PURE__ */ a(r, { children: [t && /* @__PURE__ */ i(n, {
10
+ "pkt-link--icon-right": !!t && c === "right"
11
+ }, m = /* @__PURE__ */ a(r, { children: [t && /* @__PURE__ */ i(n, {
13
12
  name: t,
14
13
  className: "pkt-link__icon"
15
- }), f] });
16
- return (d || (({ href: e, className: t, children: n, props: r }) => /* @__PURE__ */ i("a", {
14
+ }), d] });
15
+ return (u || (({ href: e, className: t, children: n, props: r }) => /* @__PURE__ */ i("a", {
17
16
  href: e,
18
17
  className: t,
19
18
  ...r,
20
19
  children: n
21
20
  })))({
22
21
  href: e ?? "",
23
- className: (0, o.default)(m, s),
24
- children: h,
22
+ className: (0, o.default)(p, s),
23
+ children: m,
25
24
  props: {
26
- ...p,
27
- target: u,
28
- rel: l ? "noopener noreferrer" : void 0
25
+ ...f,
26
+ target: l
29
27
  }
30
28
  });
31
29
  };
@@ -5,6 +5,6 @@ export interface IPktLinkCard extends IPktLinkCardBase, Omit<HTMLAttributes<HTML
5
5
  children?: ReactNode;
6
6
  }
7
7
  export declare const PktLinkCard: {
8
- ({ children, skin, title, href, iconName, openInNewTab, external, className, strings, ...props }: IPktLinkCard): import('react').JSX.Element;
8
+ ({ children, skin, title, href, iconName, openInNewTab, className, strings, ...props }: IPktLinkCard): import('react').JSX.Element;
9
9
  displayName: string;
10
10
  };
@@ -1,38 +1,41 @@
1
1
  "use client";
2
2
  import { __toESM as e } from "../../_virtual/_rolldown/runtime.js";
3
- import { require_classnames as t } from "../../node_modules/classnames/index.js";
4
- import { PktIcon as n } from "../icon/Icon.js";
5
- import { usePktStrings as r } from "../../hooks/usePktStrings.js";
6
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
3
+ import { LINKCARD_LIGHT_ONLY_SKINS as t } from "../../shared-types/linkcard.js";
4
+ 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 { usePktStrings as i } from "../../hooks/usePktStrings.js";
8
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
7
9
  //#region src/components/linkcard/LinkCard.tsx
8
- var o = /* @__PURE__ */ e(t(), 1), s = ({ children: e, skin: t, title: s, href: c, iconName: l, openInNewTab: u, external: d, className: f, strings: p, ...m }) => {
9
- let h = r(["linkcard"], p), g = ["pkt-linkcard", t && `pkt-linkcard--${t}`].filter(Boolean).join(" "), _ = ["pkt-linkcard__title", d && "pkt-link pkt-link--external"].filter(Boolean).join(" ");
10
- return /* @__PURE__ */ a("a", {
10
+ var s = /* @__PURE__ */ e(n(), 1), c = ({ children: e, skin: n, title: c, href: l, iconName: u, openInNewTab: d, className: f, strings: p, ...m }) => {
11
+ let h = i(["linkcard"], p), g = ["pkt-linkcard", n && `pkt-linkcard--${n}`].filter(Boolean).join(" ");
12
+ return /* @__PURE__ */ o("a", {
11
13
  ...m,
12
- href: c,
13
- className: (0, o.default)(g, f),
14
- target: u ? "_blank" : "_self",
15
- rel: u ? "noopener noreferrer" : void 0,
14
+ href: l,
15
+ className: (0, s.default)(g, f),
16
+ "data-mode": n && t.includes(n) ? "light" : void 0,
17
+ target: d ? "_blank" : "_self",
18
+ rel: d ? "noopener noreferrer" : void 0,
16
19
  children: [
17
- l && /* @__PURE__ */ i(n, {
20
+ u && /* @__PURE__ */ a(r, {
18
21
  className: "pkt-link__icon",
19
- name: l
22
+ name: u
20
23
  }),
21
- s && /* @__PURE__ */ i("div", {
22
- className: (0, o.default)(_),
23
- children: s
24
+ c && /* @__PURE__ */ a("div", {
25
+ className: "pkt-linkcard__title",
26
+ children: c
24
27
  }),
25
- u && h.linkcard.openInNewTab ? /* @__PURE__ */ i("span", {
28
+ d && h.linkcard.openInNewTab ? /* @__PURE__ */ a("span", {
26
29
  className: "pkt-sr-only",
27
30
  children: h.linkcard.openInNewTab
28
31
  }) : null,
29
- /* @__PURE__ */ i("div", {
32
+ /* @__PURE__ */ a("div", {
30
33
  className: "pkt-linkcard__text",
31
34
  children: e
32
35
  })
33
36
  ]
34
37
  });
35
38
  };
36
- s.displayName = "PktLinkCard";
39
+ c.displayName = "PktLinkCard";
37
40
  //#endregion
38
- export { s as PktLinkCard };
41
+ export { c as PktLinkCard };
@@ -1,50 +1,51 @@
1
1
  "use client";
2
2
  import { __toESM as e } from "../../_virtual/_rolldown/runtime.js";
3
- import { MESSAGEBOX_DEFAULTS as t } from "../../shared-types/messagebox.js";
3
+ import { MESSAGEBOX_DEFAULTS as t, MESSAGEBOX_LIGHT_ONLY_SKINS as n } from "../../shared-types/messagebox.js";
4
4
  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 { usePktStrings as i } from "../../hooks/usePktStrings.js";
8
- import { useCallback as a, useState as o } from "react";
9
- import { jsx as s, jsxs as c } from "react/jsx-runtime";
5
+ import { require_classnames as r } from "../../node_modules/classnames/index.js";
6
+ import { PktIcon as i } from "../icon/Icon.js";
7
+ import { usePktStrings as a } from "../../hooks/usePktStrings.js";
8
+ import { useCallback as o, useState as s } from "react";
9
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
10
10
  //#region src/components/messagebox/Messagebox.tsx
11
- var l = /* @__PURE__ */ e(n(), 1), u = ({ children: e, className: n, skin: u = t.skin, title: d, compact: f = t.compact, closable: p = t.closable, onClose: m, strings: h, ...g }) => {
12
- let _ = i(["generic"], h), [v, y] = o(!1), b = {
11
+ var u = /* @__PURE__ */ e(r(), 1), d = ({ children: e, className: r, skin: d = t.skin, title: f, compact: p = t.compact, closable: m = t.closable, onClose: h, strings: g, ..._ }) => {
12
+ let v = a(["generic"], g), [y, b] = s(!1), x = {
13
13
  "pkt-messagebox": !0,
14
- "pkt-messagebox--compact": f,
15
- [`pkt-messagebox--${u}`]: u,
16
- "pkt-messagebox--closable": p,
17
- "pkt-hide": v
18
- }, x = a(() => {
19
- y(!0), m && m();
20
- }, [y, m]);
21
- return /* @__PURE__ */ c("div", {
22
- ...g,
23
- className: (0, l.default)(b, n),
14
+ "pkt-messagebox--compact": p,
15
+ [`pkt-messagebox--${d}`]: d,
16
+ "pkt-messagebox--closable": m,
17
+ "pkt-hide": y
18
+ }, S = o(() => {
19
+ b(!0), h && h();
20
+ }, [b, h]);
21
+ return /* @__PURE__ */ l("div", {
22
+ ..._,
23
+ className: (0, u.default)(x, r),
24
+ "data-mode": d && n.includes(d) ? "light" : void 0,
24
25
  children: [
25
- p && /* @__PURE__ */ s("div", {
26
+ m && /* @__PURE__ */ c("div", {
26
27
  className: "pkt-messagebox__close",
27
- children: /* @__PURE__ */ s("button", {
28
- onClick: x,
28
+ children: /* @__PURE__ */ c("button", {
29
+ onClick: S,
29
30
  className: "pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only",
30
- "aria-label": _.generic.close,
31
- children: /* @__PURE__ */ s(r, {
31
+ "aria-label": v.generic.close,
32
+ children: /* @__PURE__ */ c(i, {
32
33
  name: "close",
33
34
  className: "pkt-link__icon"
34
35
  })
35
36
  })
36
37
  }),
37
- d && /* @__PURE__ */ s("div", {
38
+ f && /* @__PURE__ */ c("div", {
38
39
  className: "pkt-messagebox__title",
39
- children: d
40
+ children: f
40
41
  }),
41
- /* @__PURE__ */ s("div", {
42
+ /* @__PURE__ */ c("div", {
42
43
  className: "pkt-messagebox__text",
43
44
  children: e
44
45
  })
45
46
  ]
46
47
  });
47
48
  };
48
- u.displayName = "PktMessagebox";
49
+ d.displayName = "PktMessagebox";
49
50
  //#endregion
50
- export { u as PktMessagebox };
51
+ export { d as PktMessagebox };
@@ -36,7 +36,7 @@ var l = i(({ id: i, name: l, label: u, className: d, hasTile: f = e.hasTile, inp
36
36
  children: w
37
37
  }),
38
38
  y && /* @__PURE__ */ s("span", {
39
- className: q + " pkt-tag--blue-light",
39
+ className: q + " pkt-tag--blue-pale",
40
40
  children: b ?? j.forms.optional
41
41
  }),
42
42
  x && /* @__PURE__ */ s("span", {
@@ -1,8 +1,9 @@
1
1
  import { HTMLAttributes, ReactNode } from 'react';
2
- import { TPktSizeBase, TTagSkin } from '../../shared-types';
2
+ import { TPktSizeBase, TTagSkin, TTagState } from '../../shared-types';
3
3
  import { IPktStringsProps } from '../../shared-strings';
4
4
  interface BasePktTagProps extends IPktStringsProps<'tag'> {
5
5
  skin?: TTagSkin;
6
+ state?: TTagState;
6
7
  textStyle?: 'normal-text' | 'thin-text';
7
8
  size?: TPktSizeBase;
8
9
  closeTag?: boolean;
@@ -7,49 +7,51 @@ import { usePktStrings as i } from "../../hooks/usePktStrings.js";
7
7
  import { forwardRef as a, useCallback as o, useEffect as s, useMemo as c, useRef as l, useState as u } from "react";
8
8
  import { jsx as d, jsxs as f } from "react/jsx-runtime";
9
9
  //#region src/components/tag/Tag.tsx
10
- var p = /* @__PURE__ */ e(t(), 1), m = a(({ children: e, skin: t = "blue", textStyle: a, size: m = "medium", closeTag: h, className: g, iconName: _, ariaLabel: v, onClose: y, type: b = "button", "aria-description": x, strings: S, ...C }, w) => {
11
- let [T, E] = u(!1), D = o(() => {
12
- E(!0), y && y();
13
- }, [y]), O = l(null), [k, A] = u("");
10
+ var p = /* @__PURE__ */ e(t(), 1), m = a(({ children: e, skin: t = "gray", state: a, textStyle: m, size: h = "medium", closeTag: g, className: _, iconName: v, ariaLabel: y, onClose: b, type: x = "button", "aria-description": S, strings: C, ...w }, T) => {
11
+ let [E, D] = u(!1), O = o(() => {
12
+ D(!0), b && b();
13
+ }, [b]), k = l(null), [A, j] = u("");
14
14
  s(() => {
15
- A(O.current?.textContent?.trim() ?? "");
15
+ j(k.current?.textContent?.trim() ?? "");
16
16
  }, [e]);
17
- let j = i(["tag"], S), M = c(() => {
18
- if (h && !v) return k && r(j.tag.remove, { label: k }) || x;
17
+ let M = i(["tag"], C), N = c(() => {
18
+ if (g && !y) return A && r(M.tag.remove, { label: A }) || S;
19
19
  }, [
20
- h,
21
- v,
22
- k,
23
- x,
24
- j
25
- ]), N = {
20
+ g,
21
+ y,
22
+ A,
23
+ S,
24
+ M
25
+ ]), P = {
26
26
  "pkt-tag": !0,
27
- [`pkt-tag--${m}`]: !!m,
27
+ [`pkt-tag--${h}`]: !!h,
28
28
  [`pkt-tag--${t}`]: !!t,
29
- [`pkt-tag--${a}`]: !!a
30
- }, P = {
31
- "pkt-tag": !0,
32
29
  [`pkt-tag--${a}`]: !!a,
30
+ [`pkt-tag--${m}`]: !!m
31
+ }, F = {
32
+ "pkt-tag": !0,
33
33
  [`pkt-tag--${m}`]: !!m,
34
+ [`pkt-tag--${h}`]: !!h,
34
35
  [`pkt-tag--${t}`]: !!t,
35
- "pkt-hide": T
36
+ [`pkt-tag--${a}`]: !!a,
37
+ "pkt-hide": E
36
38
  };
37
- return h ? /* @__PURE__ */ f("button", {
38
- ...C,
39
- className: (0, p.default)(P, g),
40
- type: b,
41
- onClick: D,
42
- "aria-label": v,
43
- "aria-description": M,
44
- ref: w,
39
+ return g ? /* @__PURE__ */ f("button", {
40
+ ...w,
41
+ className: (0, p.default)(F, _),
42
+ type: x,
43
+ onClick: O,
44
+ "aria-label": y,
45
+ "aria-description": N,
46
+ ref: T,
45
47
  children: [
46
- _ && /* @__PURE__ */ d(n, {
48
+ v && /* @__PURE__ */ d(n, {
47
49
  className: "pkt-tag__icon",
48
- name: _,
50
+ name: v,
49
51
  "aria-hidden": "true"
50
52
  }),
51
53
  /* @__PURE__ */ d("span", {
52
- ref: O,
54
+ ref: k,
53
55
  children: e
54
56
  }),
55
57
  /* @__PURE__ */ d(n, {
@@ -58,15 +60,15 @@ var p = /* @__PURE__ */ e(t(), 1), m = a(({ children: e, skin: t = "blue", textS
58
60
  })
59
61
  ]
60
62
  }) : /* @__PURE__ */ f("span", {
61
- ...C,
62
- className: (0, p.default)(N, g),
63
- ref: w,
64
- children: [_ && /* @__PURE__ */ d(n, {
63
+ ...w,
64
+ className: (0, p.default)(P, _),
65
+ ref: T,
66
+ children: [v && /* @__PURE__ */ d(n, {
65
67
  className: "pkt-tag__icon",
66
- name: _,
68
+ name: v,
67
69
  "aria-hidden": "true"
68
70
  }), /* @__PURE__ */ d("span", {
69
- ref: O,
71
+ ref: k,
70
72
  children: e
71
73
  })]
72
74
  });