@oslokommune/punkt-elements 20.0.5 → 20.1.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 (71) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/{alert-DPtmkrJq.cjs → alert-0a5lX0pL.cjs} +1 -1
  3. package/dist/{alert-B00bIA5q.js → alert-ZrB-P881.js} +1 -1
  4. package/dist/button-CJzu0l5A.js +125 -0
  5. package/dist/button-DHVRpzpS.cjs +32 -0
  6. package/dist/{checkbox-group-DHi7HgkS.cjs → checkbox-group-BF29zyLd.cjs} +1 -1
  7. package/dist/{checkbox-group-D038oaif.js → checkbox-group-CRIV5CX0.js} +1 -1
  8. package/dist/{combobox-BR2qOS5z.js → combobox-CDJcIkNJ.js} +1 -1
  9. package/dist/{combobox-Bn51heWm.cjs → combobox-DuXavWEY.cjs} +1 -1
  10. package/dist/{consent-ifEcAAhG.cjs → consent-BOSXNt4Y.cjs} +1 -1
  11. package/dist/{consent-KrraWq7K.js → consent-DwppvYBR.js} +1 -1
  12. package/dist/{datepicker-Bt8zKLPK.cjs → datepicker-Cnrbqm62.cjs} +1 -1
  13. package/dist/{datepicker-BZpiJeLW.js → datepicker-DHdFA8Dx.js} +1 -1
  14. package/dist/{fileupload-A7RNV7ic.js → fileupload-BQw5nlzQ.js} +2 -2
  15. package/dist/{fileupload-Cw4xeUZn.cjs → fileupload-Cjde62AR.cjs} +1 -1
  16. package/dist/{footer-dnW2aMEr.cjs → footer-NQaQc2DH.cjs} +1 -1
  17. package/dist/{footer-HqNhiUa1.js → footer-SbOYv50e.js} +1 -1
  18. package/dist/{header-VOj1cfsA.js → header-CZnKVVt4.js} +2 -2
  19. package/dist/{header-CKGwNWBI.cjs → header-YbbGgmsD.cjs} +1 -1
  20. package/dist/{input-wrapper-CdH6RH0a.cjs → input-wrapper-CbYMk21W.cjs} +1 -1
  21. package/dist/{input-wrapper-C6BRd-cu.js → input-wrapper-DYg1VHPv.js} +1 -1
  22. package/dist/{option-group-element-C8oJxuQQ.js → option-group-element-DtSw52Dr.js} +1 -1
  23. package/dist/{option-group-element-_LrpXfK1.cjs → option-group-element-dN0ntPZk.cjs} +1 -1
  24. package/dist/pkt-alert.cjs +1 -1
  25. package/dist/pkt-alert.js +1 -1
  26. package/dist/pkt-button.cjs +1 -1
  27. package/dist/pkt-button.js +1 -1
  28. package/dist/pkt-checkbox-group.cjs +1 -1
  29. package/dist/pkt-checkbox-group.js +1 -1
  30. package/dist/pkt-combobox.cjs +1 -1
  31. package/dist/pkt-combobox.js +1 -1
  32. package/dist/pkt-consent.cjs +1 -1
  33. package/dist/pkt-consent.js +1 -1
  34. package/dist/pkt-datepicker.cjs +1 -1
  35. package/dist/pkt-datepicker.js +1 -1
  36. package/dist/pkt-fileupload.cjs +1 -1
  37. package/dist/pkt-fileupload.js +1 -1
  38. package/dist/pkt-footer.cjs +1 -1
  39. package/dist/pkt-footer.js +1 -1
  40. package/dist/pkt-header.cjs +1 -1
  41. package/dist/pkt-header.js +1 -1
  42. package/dist/pkt-index.cjs +1 -1
  43. package/dist/pkt-index.js +15 -15
  44. package/dist/pkt-input-wrapper.cjs +1 -1
  45. package/dist/pkt-input-wrapper.js +1 -1
  46. package/dist/pkt-radio-group.cjs +1 -1
  47. package/dist/pkt-radio-group.js +1 -1
  48. package/dist/pkt-select.cjs +1 -1
  49. package/dist/pkt-select.js +1 -1
  50. package/dist/pkt-textarea.cjs +1 -1
  51. package/dist/pkt-textarea.js +1 -1
  52. package/dist/pkt-textinput.cjs +1 -1
  53. package/dist/pkt-textinput.js +1 -1
  54. package/dist/pkt-timepicker.cjs +1 -1
  55. package/dist/pkt-timepicker.js +1 -1
  56. package/dist/{radio-group-Kr2BCSvg.js → radio-group-bRF8fnPW.js} +1 -1
  57. package/dist/{radio-group-RWgTs_uV.cjs → radio-group-u1IH7g-4.cjs} +1 -1
  58. package/dist/{select-CZ3L48N_.cjs → select-C7kAlSxs.cjs} +1 -1
  59. package/dist/{select-Curv4lWO.js → select-CXIEM2qY.js} +1 -1
  60. package/dist/shared-types/button.d.ts +13 -0
  61. package/dist/shared-types/index.d.ts +1 -1
  62. package/dist/{textarea-B1iUKCro.js → textarea-12le8b4I.js} +1 -1
  63. package/dist/{textarea-DbD7sOLV.cjs → textarea-CRcSfWgX.cjs} +1 -1
  64. package/dist/{textinput-CKbUvHNH.js → textinput-CC0zxUBT.js} +1 -1
  65. package/dist/{textinput-C_5jzdg3.cjs → textinput-Dooq2n8W.cjs} +1 -1
  66. package/dist/{timepicker-By-kvx3z.cjs → timepicker-BM4I5w-i.cjs} +1 -1
  67. package/dist/{timepicker-DkXpFBpQ.js → timepicker-Cz81VQu3.js} +1 -1
  68. package/package.json +2 -2
  69. package/src/components/button/button.ts +14 -14
  70. package/dist/button-BI1PsdE1.cjs +0 -32
  71. package/dist/button-Bd-0TYe7.js +0 -113
@@ -1,113 +0,0 @@
1
- import { i as e, t } from "./element-with-slot-47quDZRt.js";
2
- import { _ as n, d as r, h as i, l as a, n as o, u as s } from "./element-Bwc-likm.js";
3
- import { t as c } from "./class-map-C9n5CNC8.js";
4
- import { t as l } from "./if-defined-B3pYog2C.js";
5
- import "./icon-CZDw42U7.js";
6
- // src/components/button/button.ts
7
- var u, d = "https://punkt-cdn.oslo.kommune.no/latest/animations/";
8
- typeof window < "u" && (window.pktAnimationPath = window.pktAnimationPath || d);
9
- var f = class r extends t {
10
- constructor(...e) {
11
- super(...e), this.iconName = "user", this.secondIconName = "user", this.size = "medium", this.fullWidth = !1, this.fullWidthOnMobile = !1, this.skin = "primary", this.variant = "label-only", this.state = void 0, this.type = "button", this.form = void 0, this.isLoading = !1, this.disabled = !1, this.loadingAnimationPath = typeof window < "u" ? window.pktAnimationPath : d, this.relocatedAria = {};
12
- }
13
- connectedCallback() {
14
- super.connectedCallback(), this.addEventListener("click", (e) => {
15
- (this.disabled || this.hasAttribute("disabled") || this.isLoading) && (e.preventDefault(), e.stopImmediatePropagation());
16
- }, !0), this.addEventListener("keydown", (e) => {
17
- (this.disabled || this.hasAttribute("disabled") || this.isLoading) && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopImmediatePropagation());
18
- }, !0);
19
- }
20
- attributeChangedCallback(e, t, n) {
21
- super.attributeChangedCallback(e, t, n), e === "disabled" && n === "false" && (this.disabled = !1), (e === "isloading" || e === "isLoading") && n === "false" && (this.isLoading = !1);
22
- }
23
- willUpdate(e) {
24
- super.willUpdate(e);
25
- let t = !1, n = { ...this.relocatedAria };
26
- for (let e of r.relocatedAriaAttributes) {
27
- let r = this.getAttribute(e);
28
- r !== null && (n[e] = r, this.removeAttribute(e), t = !0);
29
- }
30
- t && (this.relocatedAria = n);
31
- }
32
- firstUpdated(e) {
33
- super.firstUpdated(e), this.disabled === "false" && (this.disabled = !1), this.isLoading === "false" && (this.isLoading = !1);
34
- }
35
- render() {
36
- let t = this.form ?? this.getAttribute("form") ?? void 0, r = {
37
- "pkt-btn": !0,
38
- [`pkt-btn--${this.size}`]: !!this.size,
39
- [`pkt-btn--${this.skin}`]: !!this.skin,
40
- [`pkt-btn--${this.variant}`]: !!this.variant,
41
- [`pkt-btn--${this.color}`]: !!this.color,
42
- [`pkt-btn--${this.state}`]: !!this.state,
43
- "pkt-btn--full": !!this.fullWidth,
44
- "pkt-btn--full-small": !!this.fullWidthOnMobile,
45
- "pkt-btn--isLoading": !!this.isLoading
46
- };
47
- return n`
48
- <button
49
- class=${c(r)}
50
- type=${this.type}
51
- ?disabled=${!!this.disabled}
52
- aria-busy=${l(this.isLoading ? "true" : void 0)}
53
- aria-disabled=${l(this.disabled || this.isLoading ? "true" : void 0)}
54
- aria-haspopup=${l(this.relocatedAria["aria-haspopup"])}
55
- aria-expanded=${l(this.relocatedAria["aria-expanded"])}
56
- aria-controls=${l(this.relocatedAria["aria-controls"])}
57
- aria-label=${l(this.relocatedAria["aria-label"])}
58
- tabindex=${l(this.relocatedAria.tabindex)}
59
- form=${l(t)}
60
- >
61
- ${this.isLoading ? n`<pkt-icon
62
- class="pkt-btn__icon pkt-btn__spinner"
63
- name="spinner-blue"
64
- path=${l(this.loadingAnimationPath)}
65
- ></pkt-icon>` : i}
66
- ${this.variant === "label-only" ? i : n`<pkt-icon
67
- class="pkt-btn__icon pkt-icon"
68
- name=${this.iconName}
69
- path=${l(this.iconPath)}
70
- ></pkt-icon>`}
71
- <span class="pkt-btn__text">${e(this)}</span>
72
- ${this.variant === "icons-right-and-left" ? n`<pkt-icon
73
- class="pkt-btn__icon"
74
- name=${this.secondIconName}
75
- path=${l(this.secondIconPath)}
76
- ></pkt-icon>` : i}
77
- </button>
78
- `;
79
- }
80
- };
81
- u = f, u.relocatedAriaAttributes = [
82
- "aria-haspopup",
83
- "aria-expanded",
84
- "aria-controls",
85
- "aria-label",
86
- "tabindex"
87
- ], o([s({ type: String })], f.prototype, "iconName", void 0), o([s({ type: String })], f.prototype, "secondIconName", void 0), o([s({ type: String })], f.prototype, "iconPath", void 0), o([s({ type: String })], f.prototype, "secondIconPath", void 0), o([s({ type: String })], f.prototype, "size", void 0), o([s({
88
- type: Boolean,
89
- attribute: "full-width"
90
- })], f.prototype, "fullWidth", void 0), o([s({
91
- type: Boolean,
92
- attribute: "full-width-on-mobile"
93
- })], f.prototype, "fullWidthOnMobile", void 0), o([s({ type: String })], f.prototype, "color", void 0), o([s({ type: String })], f.prototype, "skin", void 0), o([s({ type: String })], f.prototype, "variant", void 0), o([s({
94
- type: String,
95
- reflect: !0
96
- })], f.prototype, "state", void 0), o([s({
97
- type: String,
98
- reflect: !0
99
- })], f.prototype, "type", void 0), o([s({ type: String })], f.prototype, "form", void 0), o([s({
100
- type: Boolean,
101
- reflect: !0
102
- })], f.prototype, "isLoading", void 0), o([s({
103
- type: Boolean,
104
- reflect: !0
105
- })], f.prototype, "disabled", void 0), o([s({ type: String })], f.prototype, "loadingAnimationPath", void 0), o([a()], f.prototype, "relocatedAria", void 0);
106
- try {
107
- r("pkt-button")(f);
108
- } catch {
109
- console.warn("Forsøker å definere <pkt-button>, men den er allerede definert");
110
- }
111
- // src/components/button/index.ts
112
- var p = f;
113
- export { f as n, p as t };