@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.
- package/CHANGELOG.md +59 -0
- package/README.md +3 -2
- package/dist/components/card/Card.js +77 -70
- package/dist/components/checkbox/Checkbox.js +1 -1
- package/dist/components/inputwrapper/InputWrapper.js +1 -1
- package/dist/components/link/Link.d.ts +0 -1
- package/dist/components/link/Link.js +10 -12
- package/dist/components/linkcard/LinkCard.d.ts +1 -1
- package/dist/components/linkcard/LinkCard.js +23 -20
- package/dist/components/messagebox/Messagebox.js +29 -28
- package/dist/components/radio/RadioButton.js +1 -1
- package/dist/components/tag/Tag.d.ts +2 -1
- package/dist/components/tag/Tag.js +37 -35
- package/dist/punkt-react.cjs +1 -1
- package/dist/shared-types/card.d.ts +5 -17
- package/dist/shared-types/card.js +9 -8
- package/dist/shared-types/combobox.d.ts +3 -3
- package/dist/shared-types/icon.d.ts +2 -2
- package/dist/shared-types/icon.js +1 -1
- package/dist/shared-types/index.d.ts +9 -8
- package/dist/shared-types/index.js +17 -16
- package/dist/shared-types/linkcard.d.ts +7 -4
- package/dist/shared-types/linkcard.js +9 -0
- package/dist/shared-types/messagebox.d.ts +4 -2
- package/dist/shared-types/messagebox.js +8 -3
- package/dist/shared-types/skin.d.ts +8 -2
- package/package.json +4 -4
- package/src/components/button/Button.test.tsx +1 -1
- package/src/components/card/Card.test.tsx +78 -43
- package/src/components/card/Card.tsx +17 -24
- package/src/components/checkbox/Checkbox.tsx +1 -1
- package/src/components/inputwrapper/InputWrapper.tsx +1 -1
- package/src/components/link/Link.test.tsx +9 -21
- package/src/components/link/Link.tsx +0 -4
- package/src/components/linkcard/LinkCard.test.tsx +20 -9
- package/src/components/linkcard/LinkCard.tsx +5 -11
- package/src/components/messagebox/Messagebox.test.tsx +10 -1
- package/src/components/messagebox/Messagebox.tsx +11 -2
- package/src/components/radio/RadioButton.tsx +1 -1
- package/src/components/tag/Tag.test.tsx +21 -0
- 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
|
|
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/
|
|
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
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
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
|
|
15
|
-
let
|
|
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--${
|
|
18
|
-
[`pkt-card--${
|
|
19
|
-
|
|
20
|
-
"pkt-card--
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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,
|
|
29
|
-
className: (0,
|
|
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":
|
|
32
|
-
children:
|
|
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__ */
|
|
38
|
+
children: /* @__PURE__ */ d("span", { children: e.text })
|
|
39
39
|
}, t))
|
|
40
|
-
}),
|
|
40
|
+
}), L = () => !_ || x ? null : /* @__PURE__ */ d(c, {
|
|
41
41
|
className: "pkt-card__heading",
|
|
42
|
-
level:
|
|
42
|
+
level: v,
|
|
43
43
|
size: "medium",
|
|
44
|
-
weight: "
|
|
45
|
-
children:
|
|
46
|
-
}),
|
|
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: "
|
|
51
|
-
children: /* @__PURE__ */
|
|
50
|
+
weight: "medium",
|
|
51
|
+
children: [/* @__PURE__ */ d("a", {
|
|
52
52
|
className: "pkt-card__link",
|
|
53
|
-
href:
|
|
54
|
-
target:
|
|
55
|
-
rel:
|
|
56
|
-
children:
|
|
57
|
-
})
|
|
58
|
-
|
|
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:
|
|
61
|
-
}) : null,
|
|
63
|
+
children: w
|
|
64
|
+
}) : null, B = () => !_ && !w ? null : /* @__PURE__ */ f("header", {
|
|
62
65
|
className: "pkt-card__header",
|
|
63
66
|
children: [
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
+
L(),
|
|
68
|
+
R(),
|
|
69
|
+
z()
|
|
67
70
|
]
|
|
68
|
-
}),
|
|
71
|
+
}), V = () => !m && !h ? null : /* @__PURE__ */ f("footer", {
|
|
69
72
|
className: "pkt-card__metadata",
|
|
70
|
-
children: [
|
|
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__ */
|
|
79
|
-
...
|
|
80
|
-
ref:
|
|
81
|
-
className: (0,
|
|
82
|
-
"aria-label":
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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
|
-
|
|
105
|
+
m.displayName = "PktCard";
|
|
99
106
|
//#endregion
|
|
100
|
-
export {
|
|
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-
|
|
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-
|
|
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,
|
|
7
|
-
let
|
|
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
|
-
|
|
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
|
-
}),
|
|
16
|
-
return (
|
|
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)(
|
|
24
|
-
children:
|
|
22
|
+
className: (0, o.default)(p, s),
|
|
23
|
+
children: m,
|
|
25
24
|
props: {
|
|
26
|
-
...
|
|
27
|
-
target:
|
|
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,
|
|
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 {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
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
|
|
9
|
-
let h =
|
|
10
|
-
return /* @__PURE__ */
|
|
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:
|
|
13
|
-
className: (0,
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
20
|
+
u && /* @__PURE__ */ a(r, {
|
|
18
21
|
className: "pkt-link__icon",
|
|
19
|
-
name:
|
|
22
|
+
name: u
|
|
20
23
|
}),
|
|
21
|
-
|
|
22
|
-
className:
|
|
23
|
-
children:
|
|
24
|
+
c && /* @__PURE__ */ a("div", {
|
|
25
|
+
className: "pkt-linkcard__title",
|
|
26
|
+
children: c
|
|
24
27
|
}),
|
|
25
|
-
|
|
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__ */
|
|
32
|
+
/* @__PURE__ */ a("div", {
|
|
30
33
|
className: "pkt-linkcard__text",
|
|
31
34
|
children: e
|
|
32
35
|
})
|
|
33
36
|
]
|
|
34
37
|
});
|
|
35
38
|
};
|
|
36
|
-
|
|
39
|
+
c.displayName = "PktLinkCard";
|
|
37
40
|
//#endregion
|
|
38
|
-
export {
|
|
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
|
|
6
|
-
import { PktIcon as
|
|
7
|
-
import { usePktStrings as
|
|
8
|
-
import { useCallback as
|
|
9
|
-
import { jsx as
|
|
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
|
|
12
|
-
let
|
|
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":
|
|
15
|
-
[`pkt-messagebox--${
|
|
16
|
-
"pkt-messagebox--closable":
|
|
17
|
-
"pkt-hide":
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
}, [
|
|
21
|
-
return /* @__PURE__ */
|
|
22
|
-
...
|
|
23
|
-
className: (0,
|
|
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
|
-
|
|
26
|
+
m && /* @__PURE__ */ c("div", {
|
|
26
27
|
className: "pkt-messagebox__close",
|
|
27
|
-
children: /* @__PURE__ */
|
|
28
|
-
onClick:
|
|
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":
|
|
31
|
-
children: /* @__PURE__ */
|
|
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
|
-
|
|
38
|
+
f && /* @__PURE__ */ c("div", {
|
|
38
39
|
className: "pkt-messagebox__title",
|
|
39
|
-
children:
|
|
40
|
+
children: f
|
|
40
41
|
}),
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
+
/* @__PURE__ */ c("div", {
|
|
42
43
|
className: "pkt-messagebox__text",
|
|
43
44
|
children: e
|
|
44
45
|
})
|
|
45
46
|
]
|
|
46
47
|
});
|
|
47
48
|
};
|
|
48
|
-
|
|
49
|
+
d.displayName = "PktMessagebox";
|
|
49
50
|
//#endregion
|
|
50
|
-
export {
|
|
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-
|
|
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 = "
|
|
11
|
-
let [
|
|
12
|
-
|
|
13
|
-
}, [
|
|
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
|
-
|
|
15
|
+
j(k.current?.textContent?.trim() ?? "");
|
|
16
16
|
}, [e]);
|
|
17
|
-
let
|
|
18
|
-
if (
|
|
17
|
+
let M = i(["tag"], C), N = c(() => {
|
|
18
|
+
if (g && !y) return A && r(M.tag.remove, { label: A }) || S;
|
|
19
19
|
}, [
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
]),
|
|
20
|
+
g,
|
|
21
|
+
y,
|
|
22
|
+
A,
|
|
23
|
+
S,
|
|
24
|
+
M
|
|
25
|
+
]), P = {
|
|
26
26
|
"pkt-tag": !0,
|
|
27
|
-
[`pkt-tag--${
|
|
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
|
-
|
|
36
|
+
[`pkt-tag--${a}`]: !!a,
|
|
37
|
+
"pkt-hide": E
|
|
36
38
|
};
|
|
37
|
-
return
|
|
38
|
-
...
|
|
39
|
-
className: (0, p.default)(
|
|
40
|
-
type:
|
|
41
|
-
onClick:
|
|
42
|
-
"aria-label":
|
|
43
|
-
"aria-description":
|
|
44
|
-
ref:
|
|
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
|
-
|
|
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:
|
|
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
|
-
...
|
|
62
|
-
className: (0, p.default)(
|
|
63
|
-
ref:
|
|
64
|
-
children: [
|
|
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:
|
|
71
|
+
ref: k,
|
|
70
72
|
children: e
|
|
71
73
|
})]
|
|
72
74
|
});
|