@oslokommune/punkt-vue 11.13.2 → 11.13.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.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,23 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
5
5
 
6
6
  ---
7
7
 
8
+ ## [11.13.3](https://github.com/oslokommune/punkt/compare/11.13.2...11.13.3) (2024-05-29)
9
+
10
+ ### ⚠ BREAKING CHANGES
11
+ Ingen
12
+
13
+ ### Features
14
+ Ingen
15
+
16
+ ### Bug Fixes
17
+ Ingen
18
+
19
+ ### Chores
20
+ Ingen
21
+
22
+ ---
23
+
24
+
8
25
  ## [11.13.1](https://github.com/oslokommune/punkt/compare/11.13.0...11.13.1) (2024-05-23)
9
26
 
10
27
  ### ⚠ BREAKING CHANGES
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),l=require("./_plugin-vue_export-helper-jfW5FsfF.cjs"),o=require("./plugins-IAlvxbZ2.cjs"),i={name:"PktMessagebox",props:{skin:{type:String,default:"beige",validator(t){return["beige","green","red","blue"].includes(t)}},title:{type:String,default:""},compact:{type:Boolean,default:!1}},computed:{skinClass(){return[`pkt-messagebox--${this.skin}`]}}},c={class:"pkt-messagebox__title"},u={class:"pkt-messagebox__text"};function d(t,p,s,g,_,r){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({"pkt-messagebox":!0,[r.skinClass]:!0,"pkt-messagebox--compact":s.compact})},[e.createElementVNode("div",c,e.toDisplayString(s.title),1),e.createElementVNode("div",u,[e.renderSlot(t.$slots,"default")])],2)}const n=l._export_sfc(i,[["render",d]]),a={install(t){o.registerComponent(t,n)}};o.use(a);exports.PktMessagebox=n;exports.default=a;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("./Icon-7iwiZOEn.cjs"),e=require("vue"),d=require("./_plugin-vue_export-helper-jfW5FsfF.cjs"),c=require("./plugins-IAlvxbZ2.cjs"),p={name:"PktMessagebox",components:{PktIcon:u.PktIcon},props:{skin:{type:String,default:"beige",validator(s){return["beige","green","red","blue"].includes(s)}},title:{type:String,default:""},compact:{type:Boolean,default:!1},closable:{type:Boolean,default:!1}},computed:{skinClass(){return[`pkt-messagebox--${this.skin}`]},open(){return!this.closed}},data:()=>({closed:!1}),methods:{close(){this.closed=!0,this.$emit("on-close",this.closed)}}},m={key:0,class:"pkt-messagebox__close"},k={class:"pkt-messagebox__title"},b={class:"pkt-messagebox__text"};function _(s,o,l,g,f,t){const i=e.resolveComponent("PktIcon");return e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({"pkt-messagebox":!0,[t.skinClass]:!0,"pkt-messagebox--compact":l.compact})},[l.closable?(e.openBlock(),e.createElementBlock("div",m,[e.createElementVNode("button",{class:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only",type:"button",role:"button",tabindex:"0","aria-label":"close",onKeyup:o[0]||(o[0]=e.withKeys((...n)=>t.close&&t.close(...n),["enter"])),onClick:o[1]||(o[1]=(...n)=>t.close&&t.close(...n))},[e.createVNode(i,{class:"pkt-btn__icon",name:"close"})],32)])):e.createCommentVNode("",!0),e.createElementVNode("div",k,e.toDisplayString(l.title),1),e.createElementVNode("div",b,[e.renderSlot(s.$slots,"default")])],2)),[[e.vShow,t.open]])}const a=d._export_sfc(p,[["render",_]]),r={install(s){c.registerComponent(s,a)}};c.use(r);exports.PktMessagebox=a;exports.default=r;
@@ -1,14 +1,18 @@
1
- import { openBlock as o, createElementBlock as n, normalizeClass as r, createElementVNode as s, toDisplayString as i, renderSlot as l } from "vue";
2
- import { _ as c } from "./_plugin-vue_export-helper-hUChTQA_.js";
3
- import { u as m, a as p } from "./plugins-UPM181Xt.js";
4
- const d = {
1
+ import { P as i } from "./Icon-8MjQJfqx.js";
2
+ import { resolveComponent as m, withDirectives as d, openBlock as a, createElementBlock as c, normalizeClass as p, createElementVNode as n, withKeys as u, createVNode as b, createCommentVNode as k, toDisplayString as _, renderSlot as f, vShow as g } from "vue";
3
+ import { _ as x } from "./_plugin-vue_export-helper-hUChTQA_.js";
4
+ import { u as y, a as h } from "./plugins-UPM181Xt.js";
5
+ const v = {
5
6
  name: "PktMessagebox",
7
+ components: {
8
+ PktIcon: i
9
+ },
6
10
  props: {
7
11
  skin: {
8
12
  type: String,
9
13
  default: "beige",
10
- validator(e) {
11
- return ["beige", "green", "red", "blue"].includes(e);
14
+ validator(t) {
15
+ return ["beige", "green", "red", "blue"].includes(t);
12
16
  }
13
17
  },
14
18
  title: {
@@ -18,31 +22,68 @@ const d = {
18
22
  compact: {
19
23
  type: Boolean,
20
24
  default: !1
25
+ },
26
+ closable: {
27
+ type: Boolean,
28
+ default: !1
21
29
  }
22
30
  },
23
31
  computed: {
24
32
  skinClass() {
25
33
  return [`pkt-messagebox--${this.skin}`];
34
+ },
35
+ open() {
36
+ return !this.closed;
37
+ }
38
+ },
39
+ data: () => ({
40
+ closed: !1
41
+ }),
42
+ methods: {
43
+ close() {
44
+ this.closed = !0, this.$emit("on-close", this.closed);
26
45
  }
27
46
  }
28
- }, u = { class: "pkt-messagebox__title" }, g = { class: "pkt-messagebox__text" };
29
- function _(e, b, t, x, h, a) {
30
- return o(), n("div", {
31
- class: r({ "pkt-messagebox": !0, [a.skinClass]: !0, "pkt-messagebox--compact": t.compact })
47
+ }, C = {
48
+ key: 0,
49
+ class: "pkt-messagebox__close"
50
+ }, P = { class: "pkt-messagebox__title" }, S = { class: "pkt-messagebox__text" };
51
+ function B(t, s, o, M, N, e) {
52
+ const r = m("PktIcon");
53
+ return d((a(), c("div", {
54
+ class: p({ "pkt-messagebox": !0, [e.skinClass]: !0, "pkt-messagebox--compact": o.compact })
32
55
  }, [
33
- s("div", u, i(t.title), 1),
34
- s("div", g, [
35
- l(e.$slots, "default")
56
+ o.closable ? (a(), c("div", C, [
57
+ n("button", {
58
+ class: "pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only",
59
+ type: "button",
60
+ role: "button",
61
+ tabindex: "0",
62
+ "aria-label": "close",
63
+ onKeyup: s[0] || (s[0] = u((...l) => e.close && e.close(...l), ["enter"])),
64
+ onClick: s[1] || (s[1] = (...l) => e.close && e.close(...l))
65
+ }, [
66
+ b(r, {
67
+ class: "pkt-btn__icon",
68
+ name: "close"
69
+ })
70
+ ], 32)
71
+ ])) : k("", !0),
72
+ n("div", P, _(o.title), 1),
73
+ n("div", S, [
74
+ f(t.$slots, "default")
36
75
  ])
37
- ], 2);
76
+ ], 2)), [
77
+ [g, e.open]
78
+ ]);
38
79
  }
39
- const f = /* @__PURE__ */ c(d, [["render", _]]), k = {
40
- install(e) {
41
- p(e, f);
80
+ const w = /* @__PURE__ */ x(v, [["render", B]]), I = {
81
+ install(t) {
82
+ h(t, w);
42
83
  }
43
84
  };
44
- m(k);
85
+ y(I);
45
86
  export {
46
- f as PktMessagebox,
47
- k as default
87
+ w as PktMessagebox,
88
+ I as default
48
89
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oslokommune/punkt-vue",
3
- "version": "11.13.2",
3
+ "version": "11.13.3",
4
4
  "description": "Vue komponentbibliotek til Punkt, et designsystem laget av Oslo Origo",
5
5
  "homepage": "https://punkt.oslo.kommune.no",
6
6
  "author": "Team Designsystem, Oslo Origo",
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "devDependencies": {
29
29
  "@oslokommune/punkt-assets": "^11.13.2",
30
- "@oslokommune/punkt-css": "^11.13.2",
30
+ "@oslokommune/punkt-css": "^11.13.3",
31
31
  "@vitejs/plugin-vue": "^4.5.2",
32
32
  "edit-json-file": "^1.7.0",
33
33
  "sass": "^1.69.5",
@@ -65,5 +65,5 @@
65
65
  "url": "https://github.com/oslokommune/punkt/issues"
66
66
  },
67
67
  "license": "MIT",
68
- "gitHead": "6f42516f8ea54808ba227247a390d119aef1fbe5"
68
+ "gitHead": "344b120d07c6db09133e94caa559da4919afc23e"
69
69
  }
@@ -1,5 +1,19 @@
1
1
  <template>
2
- <div :class="{ 'pkt-messagebox': true, [skinClass]: true, 'pkt-messagebox--compact': compact }">
2
+ <div :class="{ 'pkt-messagebox': true, [skinClass]: true, 'pkt-messagebox--compact': compact }" v-show="open">
3
+ <div class="pkt-messagebox__close" v-if="closable">
4
+ <button
5
+ class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only"
6
+ type="button"
7
+ role="button"
8
+ tabindex="0"
9
+ aria-label="close"
10
+ @keyup.enter="close"
11
+ @click="close"
12
+ >
13
+ <PktIcon class="pkt-btn__icon" name="close"></PktIcon>
14
+ </button>
15
+ </div>
16
+
3
17
  <div class="pkt-messagebox__title">
4
18
  {{ title }}
5
19
  </div>
@@ -9,14 +23,19 @@
9
23
  </template>
10
24
 
11
25
  <script>
26
+ import PktIcon from '../icon/Icon.vue'
27
+
12
28
  export default {
13
29
  name: 'PktMessagebox',
30
+ components: {
31
+ PktIcon,
32
+ },
14
33
  props: {
15
34
  skin: {
16
35
  type: String,
17
36
  default: 'beige',
18
37
  validator(value) {
19
- return ['beige', 'green', 'red', 'blue'].includes(value);
38
+ return ['beige', 'green', 'red', 'blue'].includes(value)
20
39
  },
21
40
  },
22
41
 
@@ -28,11 +47,27 @@ export default {
28
47
  type: Boolean,
29
48
  default: false,
30
49
  },
50
+ closable: {
51
+ type: Boolean,
52
+ default: false,
53
+ },
31
54
  },
32
55
  computed: {
33
56
  skinClass() {
34
57
  return [`pkt-messagebox--${this.skin}`]
35
58
  },
59
+ open() {
60
+ return !this.closed
61
+ },
62
+ },
63
+ data: () => ({
64
+ closed: false,
65
+ }),
66
+ methods: {
67
+ close() {
68
+ this.closed = true
69
+ this.$emit('on-close', this.closed)
70
+ },
36
71
  },
37
72
  }
38
73
  </script>