@oslokommune/punkt-react 19.18.1 → 19.18.3

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 (45) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/defineProperty.js +12 -0
  3. package/dist/_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/toPrimitive.js +14 -0
  4. package/dist/_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/toPropertyKey.js +9 -0
  5. package/dist/_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/typeof.js +11 -0
  6. package/dist/components/accordion/AccordionItem.js +1 -0
  7. package/dist/components/button/Button.js +1 -0
  8. package/dist/components/card/Card.js +1 -0
  9. package/dist/components/checkbox/Checkbox.js +1 -0
  10. package/dist/components/checkboxgroup/CheckboxGroup.js +1 -0
  11. package/dist/components/consent/Consent.js +1 -0
  12. package/dist/components/fileupload/types.js +6 -8
  13. package/dist/components/footer/Footer.js +1 -0
  14. package/dist/components/footerSimple/FooterSimple.js +1 -0
  15. package/dist/components/header/HeaderGlobal.js +1 -0
  16. package/dist/components/header/HeaderService.js +1 -0
  17. package/dist/components/header-menu/HeaderMenu.js +1 -0
  18. package/dist/components/icon/Icon.js +1 -0
  19. package/dist/components/inputwrapper/InputWrapper.js +1 -0
  20. package/dist/components/loader/Loader.d.ts +2 -1
  21. package/dist/components/loader/Loader.js +1 -0
  22. package/dist/components/messagebox/Messagebox.js +25 -25
  23. package/dist/components/modal/Modal.d.ts +2 -1
  24. package/dist/components/radio/RadioButton.js +1 -0
  25. package/dist/components/radiogroup/RadioGroup.js +1 -0
  26. package/dist/components/select/Select.js +1 -0
  27. package/dist/components/table/Table.js +1 -0
  28. package/dist/components/tag/Tag.d.ts +2 -2
  29. package/dist/components/textarea/Textarea.js +1 -0
  30. package/dist/components/timepicker/useTimepickerState.d.ts +1 -1
  31. package/dist/punkt-react.cjs +1 -1
  32. package/dist/shared-types/heading.d.ts +2 -1
  33. package/dist/shared-types/index.d.ts +2 -2
  34. package/dist/shared-types/index.js +18 -0
  35. package/dist/shared-types/size.d.ts +4 -12
  36. package/dist/shared-types/size.js +9 -0
  37. package/package.json +3 -2
  38. package/src/components/combobox/useComboboxState.ts +1 -0
  39. package/src/components/inputwrapper/InputWrapper.tsx +0 -2
  40. package/src/components/loader/Loader.tsx +2 -2
  41. package/src/components/messagebox/Messagebox.tsx +2 -4
  42. package/src/components/modal/Modal.tsx +2 -1
  43. package/src/components/stepper/Stepper.tsx +2 -0
  44. package/src/components/tabs/Tabs.tsx +1 -0
  45. package/src/components/tag/Tag.tsx +2 -2
package/CHANGELOG.md CHANGED
@@ -5,6 +5,33 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
5
5
 
6
6
  ---
7
7
 
8
+ ## [19.18.3](https://github.com/oslokommune/punkt/compare/19.18.2...19.18.3) (2026-10-20)
9
+
10
+ ---
11
+
12
+
13
+ ## [19.18.2](https://github.com/oslokommune/punkt/compare/19.18.1...19.18.2) (2026-10-20)
14
+
15
+ ### Bug Fixes
16
+ * Safari 15 i React, nettlesersjekk og lint i CI (#3775). - CI: Kjør lint i PR-workflowene, og rett feilene som lå på main
17
+ - CI: Sjekk at byggene ikke inneholder syntaks eller API-er Safari 15
18
+ mangler
19
+ - Elements: Ikke publiser typer for tester og dev-appen
20
+ - Elements: Fjern Babel, som ikke har vært i bruk siden Jest
21
+ - Elements: forwardSlots() venter til child er definert
22
+ - Elements: Riktige attributter på pkt-modal i header-demoene
23
+ - React: Bygg for Safari 15, så komponentene laster på eldre iPhoner
24
+
25
+ Fant masse greier med litt linting og sjekking av hva vi faktisk bygger
26
+ i pakkene våre. Litt mye krimskrams her, men alt hører på en måte sammen
27
+ under "kodeforbedringer"-paraplyen. Fant også ut at jeg kan få
28
+ forwardSlots til å feile dersom en child-komponent av en eller annen
29
+ grunn skulle drøye litt med å initialisere (dette skjer praktisk talt
30
+ aldri, men greit å ha en guard for det).
31
+
32
+ ---
33
+
34
+
8
35
  ## [19.18.1](https://github.com/oslokommune/punkt/compare/19.18.0...19.18.1) (2026-10-20)
9
36
 
10
37
  ### Bug Fixes
@@ -0,0 +1,12 @@
1
+ import e from "./toPropertyKey.js";
2
+ //#region \0@oxc-project+runtime@0.154.0/helpers/esm/defineProperty.js
3
+ function t(t, n, r) {
4
+ return (n = e(n)) in t ? Object.defineProperty(t, n, {
5
+ value: r,
6
+ enumerable: !0,
7
+ configurable: !0,
8
+ writable: !0
9
+ }) : t[n] = r, t;
10
+ }
11
+ //#endregion
12
+ export { t as default };
@@ -0,0 +1,14 @@
1
+ import e from "./typeof.js";
2
+ //#region \0@oxc-project+runtime@0.154.0/helpers/esm/toPrimitive.js
3
+ function t(t, n) {
4
+ if (e(t) != "object" || !t) return t;
5
+ var r = t[Symbol.toPrimitive];
6
+ if (r !== void 0) {
7
+ var i = r.call(t, n || "default");
8
+ if (e(i) != "object") return i;
9
+ throw TypeError("@@toPrimitive must return a primitive value.");
10
+ }
11
+ return (n === "string" ? String : Number)(t);
12
+ }
13
+ //#endregion
14
+ export { t as default };
@@ -0,0 +1,9 @@
1
+ import e from "./typeof.js";
2
+ import t from "./toPrimitive.js";
3
+ //#region \0@oxc-project+runtime@0.154.0/helpers/esm/toPropertyKey.js
4
+ function n(n) {
5
+ var r = t(n, "string");
6
+ return e(r) == "symbol" ? r : r + "";
7
+ }
8
+ //#endregion
9
+ export { n as default };
@@ -0,0 +1,11 @@
1
+ //#region \0@oxc-project+runtime@0.154.0/helpers/esm/typeof.js
2
+ function e(t) {
3
+ "@babel/helpers - typeof";
4
+ return e = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
5
+ return typeof e;
6
+ } : function(e) {
7
+ return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
8
+ }, e(t);
9
+ }
10
+ //#endregion
11
+ export { e as default };
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
  import { useAccordionContext as e } from "./Accordion.js";
3
3
  import { ACCORDION_LIGHT_ONLY_SKINS as t } from "../../shared-types/accordion.js";
4
+ import "../../shared-types/index.js";
4
5
  import { PktIcon as n } from "../icon/Icon.js";
5
6
  import { forwardRef as r, useState as i } from "react";
6
7
  import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
@@ -1,5 +1,6 @@
1
1
  "use client";
2
2
  import { ANIMATION_DEFAULT_PATH as e } from "../../shared-types/icon.js";
3
+ import "../../shared-types/index.js";
3
4
  import { PktIcon as t } from "../icon/Icon.js";
4
5
  import { forwardRef as n } from "react";
5
6
  import { jsx as r, jsxs as i } from "react/jsx-runtime";
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
  import { __toESM as e } from "../../_virtual/_rolldown/runtime.js";
3
3
  import { CARD_DEFAULTS as t } from "../../shared-types/card.js";
4
+ import "../../shared-types/index.js";
4
5
  import { require_classnames as n } from "../../node_modules/classnames/index.js";
5
6
  import { plural as r } from "../../shared-strings/format.js";
6
7
  import { usePktStrings as i } from "../../hooks/usePktStrings.js";
@@ -1,5 +1,6 @@
1
1
  "use client";
2
2
  import { CHECKBOX_DEFAULTS as e } from "../../shared-types/checkbox.js";
3
+ import "../../shared-types/index.js";
3
4
  import { usePktStrings as t } from "../../hooks/usePktStrings.js";
4
5
  import { useGeneratedId as n } from "../../hooks/useGeneratedId.js";
5
6
  import { useCheckboxGroupContext as ee } from "../checkboxgroup/CheckboxGroupContext.js";
@@ -1,5 +1,6 @@
1
1
  "use client";
2
2
  import { OPTION_GROUP_DEFAULTS as e } from "../../shared-types/option-group.js";
3
+ import "../../shared-types/index.js";
3
4
  import { usePktStrings as t } from "../../hooks/usePktStrings.js";
4
5
  import { useGeneratedId as n } from "../../hooks/useGeneratedId.js";
5
6
  import { CheckboxGroupContext as r } from "./CheckboxGroupContext.js";
@@ -1,5 +1,6 @@
1
1
  "use client";
2
2
  import { CONSENT_DEFAULTS as e } from "../../shared-types/consent.js";
3
+ import "../../shared-types/index.js";
3
4
  import { consentStrings as t } from "../../shared-strings/consent.js";
4
5
  import { PktButton as n } from "../button/Button.js";
5
6
  import { forwardRef as r, useEffect as i, useRef as a } from "react";
@@ -1,12 +1,10 @@
1
- import { uuidish as e } from "../../utils/stringutils.js";
1
+ import e from "../../_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/defineProperty.js";
2
+ import { uuidish as t } from "../../utils/stringutils.js";
2
3
  //#region src/components/fileupload/types.ts
3
- var t = class {
4
- fileId;
5
- file;
6
- attributes;
7
- constructor(t, n) {
8
- this.fileId = n || e(), this.file = t, this.attributes = { targetFilename: t.name };
4
+ var n = class {
5
+ constructor(n, r) {
6
+ e(this, "fileId", void 0), e(this, "file", void 0), e(this, "attributes", void 0), this.fileId = r || t(), this.file = n, this.attributes = { targetFilename: n.name };
9
7
  }
10
8
  };
11
9
  //#endregion
12
- export { t as FileItem };
10
+ export { n as FileItem };
@@ -1,5 +1,6 @@
1
1
  "use client";
2
2
  import "../../shared-types/footer.js";
3
+ import "../../shared-types/index.js";
3
4
  import { PktIcon as e } from "../icon/Icon.js";
4
5
  import { PktConsent as t } from "../consent/Consent.js";
5
6
  import { getLinkDomainLabel as n } from "../../shared-utils/header-footer/external-domain.js";
@@ -1,5 +1,6 @@
1
1
  "use client";
2
2
  import "../../shared-types/footer.js";
3
+ import "../../shared-types/index.js";
3
4
  import { PktIcon as e } from "../icon/Icon.js";
4
5
  import { PktConsent as t } from "../consent/Consent.js";
5
6
  import { getLinkDomainLabel as n } from "../../shared-utils/header-footer/external-domain.js";
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
  import { __toESM as e } from "../../_virtual/_rolldown/runtime.js";
3
3
  import { DEFAULT_HEADER_LOGO_LINK as t } from "../../shared-types/header-footer.js";
4
+ import "../../shared-types/index.js";
4
5
  import { require_classnames as n } from "../../node_modules/classnames/index.js";
5
6
  import { PktIcon as r } from "../icon/Icon.js";
6
7
  import { PktButton as i } from "../button/Button.js";
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
  import { __toESM as e } from "../../_virtual/_rolldown/runtime.js";
3
3
  import { DEFAULT_HEADER_LOGO_LINK as t } from "../../shared-types/header-footer.js";
4
+ import "../../shared-types/index.js";
4
5
  import { require_classnames as n } from "../../node_modules/classnames/index.js";
5
6
  import { PktIcon as r } from "../icon/Icon.js";
6
7
  import { PktButton as i } from "../button/Button.js";
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
  import { PktAccordion as e } from "../accordion/Accordion.js";
3
3
  import { DEFAULT_HEADER_FOOTER_URL as t } from "../../shared-types/header-footer.js";
4
+ import "../../shared-types/index.js";
4
5
  import { PktIcon as n } from "../icon/Icon.js";
5
6
  import { PktAccordionItem as r } from "../accordion/AccordionItem.js";
6
7
  import { usePktStrings as i } from "../../hooks/usePktStrings.js";
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
  import { __toESM as e } from "../../_virtual/_rolldown/runtime.js";
3
3
  import { ICON_DEFAULTS as t } from "../../shared-types/icon.js";
4
+ import "../../shared-types/index.js";
4
5
  import { require_classnames as n } from "../../node_modules/classnames/index.js";
5
6
  import { forwardRef as r, useEffect as i, useLayoutEffect as a, useRef as o } from "react";
6
7
  import { jsx as s } from "react/jsx-runtime";
@@ -1,5 +1,6 @@
1
1
  "use client";
2
2
  import { INPUT_WRAPPER_DEFAULTS as e } from "../../shared-types/input-wrapper.js";
3
+ import "../../shared-types/index.js";
3
4
  import { formatString as t } from "../../shared-strings/format.js";
4
5
  import { usePktStrings as n } from "../../hooks/usePktStrings.js";
5
6
  import { PktAlert as r } from "../alert/Alert.js";
@@ -1,11 +1,12 @@
1
1
  import { HTMLAttributes, ReactNode } from 'react';
2
+ import { TPktSizeBase } from '../../shared-types';
2
3
  declare global {
3
4
  interface Window {
4
5
  pktAnimationPath?: string;
5
6
  }
6
7
  }
7
8
  export type TPktLoaderVariant = 'blue' | 'rainbow' | 'shapes';
8
- export type TPktLoaderSize = 'small' | 'medium' | 'large';
9
+ export type TPktLoaderSize = TPktSizeBase;
9
10
  export interface IPktLoader extends HTMLAttributes<HTMLDivElement> {
10
11
  /**
11
12
  * Tid i millisekunder før loader vises. Nyttig når lastetiden kan være
@@ -1,6 +1,7 @@
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 "../../shared-types/index.js";
4
5
  import { require_classnames as n } from "../../node_modules/classnames/index.js";
5
6
  import { PktIcon as r } from "../icon/Icon.js";
6
7
  import { forwardRef as i, useEffect as a, useState as o } from "react";
@@ -1,50 +1,50 @@
1
1
  "use client";
2
2
  import { __toESM as e } from "../../_virtual/_rolldown/runtime.js";
3
3
  import { MESSAGEBOX_DEFAULTS as t } from "../../shared-types/messagebox.js";
4
+ import "../../shared-types/index.js";
4
5
  import { require_classnames as n } from "../../node_modules/classnames/index.js";
5
6
  import { PktIcon as r } from "../icon/Icon.js";
6
7
  import { usePktStrings as i } from "../../hooks/usePktStrings.js";
7
- import { createRef as a, useCallback as o, useState as s } from "react";
8
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
8
+ import { useCallback as a, useState as o } from "react";
9
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
9
10
  //#region src/components/messagebox/Messagebox.tsx
10
- var u = /* @__PURE__ */ e(n(), 1), d = ({ children: e, className: n, skin: d = t.skin, title: f, compact: p = t.compact, closable: m = t.closable, onClose: h, strings: g, ..._ }) => {
11
- let v = i(["generic"], g), [y, b] = s(!1), x = {
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 = {
12
13
  "pkt-messagebox": !0,
13
- "pkt-messagebox--compact": p,
14
- [`pkt-messagebox--${d}`]: d,
15
- "pkt-messagebox--closable": m,
16
- "pkt-hide": y
17
- }, S = a(), C = o(() => {
18
- b(!0), h && h();
19
- }, [b, h]);
20
- return /* @__PURE__ */ l("div", {
21
- ..._,
22
- className: (0, u.default)(x, n),
23
- ref: S,
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),
24
24
  children: [
25
- m && /* @__PURE__ */ c("div", {
25
+ p && /* @__PURE__ */ s("div", {
26
26
  className: "pkt-messagebox__close",
27
- children: /* @__PURE__ */ c("button", {
28
- onClick: C,
27
+ children: /* @__PURE__ */ s("button", {
28
+ onClick: x,
29
29
  className: "pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only",
30
- "aria-label": v.generic.close,
31
- children: /* @__PURE__ */ c(r, {
30
+ "aria-label": _.generic.close,
31
+ children: /* @__PURE__ */ s(r, {
32
32
  name: "close",
33
33
  className: "pkt-link__icon"
34
34
  })
35
35
  })
36
36
  }),
37
- f && /* @__PURE__ */ c("div", {
37
+ d && /* @__PURE__ */ s("div", {
38
38
  className: "pkt-messagebox__title",
39
- children: f
39
+ children: d
40
40
  }),
41
- /* @__PURE__ */ c("div", {
41
+ /* @__PURE__ */ s("div", {
42
42
  className: "pkt-messagebox__text",
43
43
  children: e
44
44
  })
45
45
  ]
46
46
  });
47
47
  };
48
- d.displayName = "PktMessagebox";
48
+ u.displayName = "PktMessagebox";
49
49
  //#endregion
50
- export { d as PktMessagebox };
50
+ export { u as PktMessagebox };
@@ -1,4 +1,5 @@
1
1
  import { HTMLAttributes, ReactNode, Ref } from 'react';
2
+ import { TPktSizeBase } from '../../shared-types';
2
3
  import { IPktStringsProps } from '../../shared-strings';
3
4
  export interface IPktModal extends Omit<HTMLAttributes<HTMLDialogElement>, 'onClose' | 'open'>, IPktStringsProps<'generic'> {
4
5
  open?: boolean;
@@ -7,7 +8,7 @@ export interface IPktModal extends Omit<HTMLAttributes<HTMLDialogElement>, 'onCl
7
8
  headingIconPath?: string;
8
9
  hideCloseButton?: boolean;
9
10
  closeOnBackdropClick?: boolean;
10
- size?: 'small' | 'medium' | 'large' | 'fit-content';
11
+ size?: TPktSizeBase | 'fit-content';
11
12
  removePadding?: boolean;
12
13
  closeButtonSkin?: 'blue' | 'yellow-filled';
13
14
  variant?: 'dialog' | 'drawer';
@@ -1,5 +1,6 @@
1
1
  "use client";
2
2
  import { RADIOBUTTON_DEFAULTS as e } from "../../shared-types/radiobutton.js";
3
+ import "../../shared-types/index.js";
3
4
  import { usePktStrings as t } from "../../hooks/usePktStrings.js";
4
5
  import { useGeneratedId as n } from "../../hooks/useGeneratedId.js";
5
6
  import { useRadioGroupContext as r } from "../radiogroup/RadioGroupContext.js";
@@ -1,5 +1,6 @@
1
1
  "use client";
2
2
  import { OPTION_GROUP_DEFAULTS as e } from "../../shared-types/option-group.js";
3
+ import "../../shared-types/index.js";
3
4
  import { useGeneratedId as t } from "../../hooks/useGeneratedId.js";
4
5
  import { useOptionGroupField as n } from "../../hooks/useOptionGroupField.js";
5
6
  import { PktInputWrapper as r } from "../inputwrapper/InputWrapper.js";
@@ -1,5 +1,6 @@
1
1
  "use client";
2
2
  import { SELECT_DEFAULTS as e } from "../../shared-types/select.js";
3
+ import "../../shared-types/index.js";
3
4
  import { useGeneratedId as t } from "../../hooks/useGeneratedId.js";
4
5
  import { describedByIds as n } from "../../shared-utils/forms/described-by.js";
5
6
  import { PktInputWrapper as r } from "../inputwrapper/InputWrapper.js";
@@ -1,5 +1,6 @@
1
1
  import { __toESM as e } from "../../_virtual/_rolldown/runtime.js";
2
2
  import { TABLE_DEFAULTS as t } from "../../shared-types/table.js";
3
+ import "../../shared-types/index.js";
3
4
  import { require_classnames as n } from "../../node_modules/classnames/index.js";
4
5
  import { jsx as r } from "react/jsx-runtime";
5
6
  //#region src/components/table/Table.tsx
@@ -1,10 +1,10 @@
1
1
  import { HTMLAttributes, ReactNode } from 'react';
2
- import { TTagSkin } from '../../shared-types';
2
+ import { TPktSizeBase, TTagSkin } from '../../shared-types';
3
3
  import { IPktStringsProps } from '../../shared-strings';
4
4
  interface BasePktTagProps extends IPktStringsProps<'tag'> {
5
5
  skin?: TTagSkin;
6
6
  textStyle?: 'normal-text' | 'thin-text';
7
- size?: 'small' | 'medium' | 'large';
7
+ size?: TPktSizeBase;
8
8
  closeTag?: boolean;
9
9
  iconName?: string;
10
10
  ariaLabel?: string;
@@ -1,5 +1,6 @@
1
1
  "use client";
2
2
  import { TEXTAREA_DEFAULTS as e } from "../../shared-types/textarea.js";
3
+ import "../../shared-types/index.js";
3
4
  import { useGeneratedId as t } from "../../hooks/useGeneratedId.js";
4
5
  import { describedByIds as n } from "../../shared-utils/forms/described-by.js";
5
6
  import { PktInputWrapper as r } from "../inputwrapper/InputWrapper.js";
@@ -4,7 +4,7 @@ export declare function useTimepickerState(props: IPktTimepicker, ref: React.For
4
4
  id: string;
5
5
  containerRef: import('react').RefObject<HTMLDivElement | null>;
6
6
  outerClasses: string;
7
- inputSize: "medium" | "small" | "xsmall";
7
+ inputSize: "small" | "medium" | "xsmall";
8
8
  strings: {
9
9
  hours: string;
10
10
  minutes: string;