@oslokommune/punkt-react 20.0.5 → 20.1.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/CHANGELOG.md CHANGED
@@ -5,6 +5,14 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
5
5
 
6
6
  ---
7
7
 
8
+ ## [20.1.0](https://github.com/oslokommune/punkt/compare/20.0.5...20.1.0) (2026-11-09)
9
+
10
+ ### Features
11
+ * Button - bruk felles standardverdier (#3820).
12
+
13
+ ---
14
+
15
+
8
16
  ## [20.0.5](https://github.com/oslokommune/punkt/compare/20.0.4...20.0.5) (2026-11-09)
9
17
 
10
18
  ---
@@ -1,54 +1,55 @@
1
1
  "use client";
2
2
  import { ANIMATION_DEFAULT_PATH as e } from "../../shared-types/icon.js";
3
+ import { BUTTON_DEFAULTS as t } from "../../shared-types/button.js";
3
4
  import "../../shared-types/index.js";
4
- import { PktIcon as t } from "../icon/Icon.js";
5
- import { forwardRef as n } from "react";
6
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
+ import { PktIcon as n } from "../icon/Icon.js";
6
+ import { forwardRef as r } from "react";
7
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
7
8
  // src/components/button/Button.tsx
8
9
  typeof window < "u" && (window.pktAnimationPath = window.pktAnimationPath || "https://punkt-cdn.oslo.kommune.no/latest/animations/");
9
- var a = n(({ children: n, className: a, iconName: o = "user", secondIconName: s = "user", iconPath: c, secondIconPath: l, size: u = "medium", fullWidth: d = !1, fullWidthOnMobile: f = !1, skin: p = "primary", type: m = "button", variant: h = "label-only", state: g, color: _, isLoading: v = void 0, disabled: y = void 0, loadingAnimationPath: b = typeof window < "u" ? window.pktAnimationPath : e, ...x }, S) => {
10
- let C = [
11
- a,
10
+ var o = r(({ children: r, className: o, iconName: s = t.iconName, secondIconName: c = t.secondIconName, iconPath: l, secondIconPath: u, size: d = t.size, fullWidth: f = t.fullWidth, fullWidthOnMobile: p = t.fullWidthOnMobile, skin: m = t.skin, type: h = t.type, variant: g = t.variant, state: _, color: v, isLoading: y = t.isLoading, disabled: b = t.disabled, loadingAnimationPath: x = typeof window < "u" ? window.pktAnimationPath : e, ...S }, C) => {
11
+ let w = [
12
+ o,
12
13
  "pkt-btn",
13
- u && `pkt-btn--${u}`,
14
- d && "pkt-btn--full",
15
- f && "pkt-btn--full-small",
16
- p && `pkt-btn--${p}`,
17
- h && `pkt-btn--${h}`,
18
- _ && `pkt-btn--${_}`,
14
+ d && `pkt-btn--${d}`,
15
+ f && "pkt-btn--full",
16
+ p && "pkt-btn--full-small",
17
+ m && `pkt-btn--${m}`,
19
18
  g && `pkt-btn--${g}`,
20
- v && "pkt-btn--isLoading"
19
+ v && `pkt-btn--${v}`,
20
+ _ && `pkt-btn--${_}`,
21
+ y && "pkt-btn--isLoading"
21
22
  ].filter(Boolean).join(" ");
22
- return /* @__PURE__ */ i("button", {
23
- ...x,
24
- "aria-busy": v || void 0,
25
- "aria-disabled": y || void 0,
26
- disabled: y,
27
- className: C,
28
- type: m,
29
- ref: S,
23
+ return /* @__PURE__ */ a("button", {
24
+ ...S,
25
+ "aria-busy": y || void 0,
26
+ "aria-disabled": b || void 0,
27
+ disabled: b,
28
+ className: w,
29
+ type: h,
30
+ ref: C,
30
31
  children: [
31
- v && /* @__PURE__ */ r(t, {
32
+ y && /* @__PURE__ */ i(n, {
32
33
  className: "pkt-btn__icon pkt-btn__spinner",
33
34
  name: "spinner-blue",
34
- path: b
35
+ path: x
35
36
  }),
36
- h !== "label-only" && /* @__PURE__ */ r(t, {
37
+ g !== "label-only" && /* @__PURE__ */ i(n, {
37
38
  className: "pkt-btn__icon",
38
- name: o,
39
- ...c && { path: c }
39
+ name: s,
40
+ ...l && { path: l }
40
41
  }),
41
- /* @__PURE__ */ r("span", {
42
+ /* @__PURE__ */ i("span", {
42
43
  className: "pkt-btn__text",
43
- children: n
44
+ children: r
44
45
  }),
45
- h === "icons-right-and-left" && /* @__PURE__ */ r(t, {
46
+ g === "icons-right-and-left" && /* @__PURE__ */ i(n, {
46
47
  className: "pkt-btn__icon",
47
- name: s,
48
- ...l && { path: l }
48
+ name: c,
49
+ ...u && { path: u }
49
50
  })
50
51
  ]
51
52
  });
52
53
  });
53
- a.displayName = "PktButton";
54
- export { a as PktButton };
54
+ o.displayName = "PktButton";
55
+ export { o as PktButton };