@muenchen/muc-patternlab-vue 1.8.0-beta.4 → 1.8.0-beta.6

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.
@@ -12,6 +12,10 @@ declare const _default: {
12
12
  type: import('vue').PropType<boolean>;
13
13
  default: boolean;
14
14
  };
15
+ iconAnimated: {
16
+ type: import('vue').PropType<boolean>;
17
+ default: boolean;
18
+ };
15
19
  }>> & {
16
20
  onClick?: (() => any) | undefined;
17
21
  }, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
@@ -28,11 +32,16 @@ declare const _default: {
28
32
  type: import('vue').PropType<boolean>;
29
33
  default: boolean;
30
34
  };
35
+ iconAnimated: {
36
+ type: import('vue').PropType<boolean>;
37
+ default: boolean;
38
+ };
31
39
  }>> & {
32
40
  onClick?: (() => any) | undefined;
33
41
  }, {
34
42
  variant: "primary" | "secondary" | "ghost";
35
43
  disabled: boolean;
44
+ iconAnimated: boolean;
36
45
  }, true, {}, {}, {
37
46
  P: {};
38
47
  B: {};
@@ -52,11 +61,16 @@ declare const _default: {
52
61
  type: import('vue').PropType<boolean>;
53
62
  default: boolean;
54
63
  };
64
+ iconAnimated: {
65
+ type: import('vue').PropType<boolean>;
66
+ default: boolean;
67
+ };
55
68
  }>> & {
56
69
  onClick?: (() => any) | undefined;
57
70
  }, {}, {}, {}, {}, {
58
71
  variant: "primary" | "secondary" | "ghost";
59
72
  disabled: boolean;
73
+ iconAnimated: boolean;
60
74
  }>;
61
75
  __isFragment?: undefined;
62
76
  __isTeleport?: undefined;
@@ -73,6 +87,10 @@ declare const _default: {
73
87
  type: import('vue').PropType<boolean>;
74
88
  default: boolean;
75
89
  };
90
+ iconAnimated: {
91
+ type: import('vue').PropType<boolean>;
92
+ default: boolean;
93
+ };
76
94
  }>> & {
77
95
  onClick?: (() => any) | undefined;
78
96
  }, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
@@ -80,6 +98,7 @@ declare const _default: {
80
98
  }, string, {
81
99
  variant: "primary" | "secondary" | "ghost";
82
100
  disabled: boolean;
101
+ iconAnimated: boolean;
83
102
  }, {}, string, {}> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
84
103
  $slots: Readonly<{
85
104
  default(): any;
@@ -130,3 +149,10 @@ export declare const Icon: {
130
149
  icon: string;
131
150
  };
132
151
  };
152
+ export declare const IconAnimated: {
153
+ args: {
154
+ default: string;
155
+ icon: string;
156
+ iconAnimated: boolean;
157
+ };
158
+ };
@@ -14,9 +14,16 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__
14
14
  * Choose an icon to be appended behind the slot. No icon will be placed if the prop is left empty.
15
15
  */
16
16
  icon?: string | undefined;
17
+ /**
18
+ * Wether the Icon should be animated on hover (slide-right) or not.
19
+ *
20
+ * Default is `false`
21
+ */
22
+ iconAnimated?: boolean | undefined;
17
23
  }>, {
18
24
  variant: string;
19
25
  disabled: boolean;
26
+ iconAnimated: boolean;
20
27
  }>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
21
28
  click: () => void;
22
29
  }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
@@ -34,14 +41,22 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__
34
41
  * Choose an icon to be appended behind the slot. No icon will be placed if the prop is left empty.
35
42
  */
36
43
  icon?: string | undefined;
44
+ /**
45
+ * Wether the Icon should be animated on hover (slide-right) or not.
46
+ *
47
+ * Default is `false`
48
+ */
49
+ iconAnimated?: boolean | undefined;
37
50
  }>, {
38
51
  variant: string;
39
52
  disabled: boolean;
53
+ iconAnimated: boolean;
40
54
  }>>> & {
41
55
  onClick?: (() => any) | undefined;
42
56
  }, {
43
57
  variant: buttonType;
44
58
  disabled: boolean;
59
+ iconAnimated: boolean;
45
60
  }, {}>, Readonly<{
46
61
  /**
47
62
  * Display content inside the button.
@@ -0,0 +1,93 @@
1
+ declare const _default: {
2
+ component: import('vue').DefineComponent<{
3
+ text: {
4
+ type: import('vue').PropType<string>;
5
+ required: true;
6
+ };
7
+ variant: {
8
+ type: import('vue').PropType<import('./CommentType').default>;
9
+ default: string;
10
+ };
11
+ rating: {
12
+ type: import('vue').PropType<number>;
13
+ required: true;
14
+ };
15
+ date: {
16
+ type: import('vue').PropType<string>;
17
+ };
18
+ initials: {
19
+ type: import('vue').PropType<string>;
20
+ };
21
+ author: {
22
+ type: import('vue').PropType<string>;
23
+ required: true;
24
+ };
25
+ datePrefix: {
26
+ type: import('vue').PropType<string>;
27
+ default: string;
28
+ };
29
+ headline: {
30
+ type: import('vue').PropType<string>;
31
+ };
32
+ }, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
33
+ text: {
34
+ type: import('vue').PropType<string>;
35
+ required: true;
36
+ };
37
+ variant: {
38
+ type: import('vue').PropType<import('./CommentType').default>;
39
+ default: string;
40
+ };
41
+ rating: {
42
+ type: import('vue').PropType<number>;
43
+ required: true;
44
+ };
45
+ date: {
46
+ type: import('vue').PropType<string>;
47
+ };
48
+ initials: {
49
+ type: import('vue').PropType<string>;
50
+ };
51
+ author: {
52
+ type: import('vue').PropType<string>;
53
+ required: true;
54
+ };
55
+ datePrefix: {
56
+ type: import('vue').PropType<string>;
57
+ default: string;
58
+ };
59
+ headline: {
60
+ type: import('vue').PropType<string>;
61
+ };
62
+ }>>, {
63
+ variant: import('./CommentType').default;
64
+ datePrefix: string;
65
+ }, {}>;
66
+ title: string;
67
+ tags: string[];
68
+ parameters: {
69
+ docs: {
70
+ description: {
71
+ component: string;
72
+ };
73
+ };
74
+ };
75
+ };
76
+ export default _default;
77
+ export declare const Default: {
78
+ args: {
79
+ rating: number;
80
+ author: string;
81
+ headline: string;
82
+ text: string;
83
+ };
84
+ };
85
+ export declare const Slider: {
86
+ args: {
87
+ rating: number;
88
+ author: string;
89
+ headline: string;
90
+ variant: string;
91
+ text: string;
92
+ };
93
+ };
@@ -8,7 +8,7 @@ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_T
8
8
  headline?: string | undefined;
9
9
  text: string;
10
10
  rating: number;
11
- variant: CommentType;
11
+ variant?: CommentType | undefined;
12
12
  }>, {
13
13
  datePrefix: string;
14
14
  variant: string;
@@ -20,7 +20,7 @@ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_T
20
20
  headline?: string | undefined;
21
21
  text: string;
22
22
  rating: number;
23
- variant: CommentType;
23
+ variant?: CommentType | undefined;
24
24
  }>, {
25
25
  datePrefix: string;
26
26
  variant: string;
@@ -1,13 +1,13 @@
1
- import { defineComponent as p, computed as l, openBlock as o, createElementBlock as r, createElementVNode as t, normalizeClass as y, renderSlot as i, createCommentVNode as g, toDisplayString as m, pushScopeId as B, popScopeId as E, useSlots as L, createTextVNode as h, Fragment as M, renderList as S, createBlock as O, unref as P, createSlots as T, withCtx as f } from "vue";
2
- const D = ["role", "aria-label"], R = { class: "container-fluid" }, A = /* @__PURE__ */ t("svg", { class: "icon" }, [
1
+ import { defineComponent as h, computed as d, openBlock as o, createElementBlock as i, createElementVNode as t, normalizeClass as b, renderSlot as c, createCommentVNode as g, toDisplayString as _, pushScopeId as I, popScopeId as B, useSlots as A, createTextVNode as m, Fragment as M, renderList as S, createBlock as O, unref as R, createSlots as T, withCtx as f } from "vue";
2
+ const L = ["role", "aria-label"], P = { class: "container-fluid" }, D = /* @__PURE__ */ t("svg", { class: "icon" }, [
3
3
  /* @__PURE__ */ t("use", { href: "#icon-information" })
4
- ], -1), H = /* @__PURE__ */ p({
4
+ ], -1), H = /* @__PURE__ */ h({
5
5
  __name: "MucBanner",
6
6
  props: {
7
7
  type: { default: "info" }
8
8
  },
9
9
  setup(a) {
10
- const e = a, s = l(() => {
10
+ const e = a, s = d(() => {
11
11
  switch (e.type) {
12
12
  case "info":
13
13
  return "m-banner--info";
@@ -18,7 +18,7 @@ const D = ["role", "aria-label"], R = { class: "container-fluid" }, A = /* @__PU
18
18
  default:
19
19
  return "m-banner--info";
20
20
  }
21
- }), n = l(() => {
21
+ }), n = d(() => {
22
22
  switch (e.type) {
23
23
  case "info":
24
24
  return "dialog";
@@ -29,7 +29,7 @@ const D = ["role", "aria-label"], R = { class: "container-fluid" }, A = /* @__PU
29
29
  default:
30
30
  return "dialog";
31
31
  }
32
- }), c = l(() => {
32
+ }), l = d(() => {
33
33
  switch (e.type) {
34
34
  case "info":
35
35
  return "Information";
@@ -41,37 +41,38 @@ const D = ["role", "aria-label"], R = { class: "container-fluid" }, A = /* @__PU
41
41
  return "Information";
42
42
  }
43
43
  });
44
- return (u, _) => (o(), r("div", null, [
44
+ return (u, p) => (o(), i("div", null, [
45
45
  t("div", null, [
46
46
  t("div", {
47
- class: y(["m-banner", s.value]),
47
+ class: b(["m-banner", s.value]),
48
48
  role: n.value,
49
- "aria-label": c.value
49
+ "aria-label": l.value
50
50
  }, [
51
- t("div", R, [
52
- A,
51
+ t("div", P, [
52
+ D,
53
53
  t("p", null, [
54
- i(u.$slots, "default")
54
+ c(u.$slots, "default")
55
55
  ])
56
56
  ])
57
- ], 10, D)
57
+ ], 10, L)
58
58
  ])
59
59
  ]));
60
60
  }
61
- }), W = ["disabled"], j = {
61
+ }), j = ["disabled"], N = {
62
62
  key: 0,
63
63
  "aria-hidden": "true",
64
64
  class: "m-button__icon"
65
- }, F = ["xlink:href"], N = /* @__PURE__ */ p({
65
+ }, V = ["xlink:href"], W = /* @__PURE__ */ h({
66
66
  __name: "MucButton",
67
67
  props: {
68
68
  variant: { default: "primary" },
69
69
  disabled: { type: Boolean, default: !1 },
70
- icon: {}
70
+ icon: {},
71
+ iconAnimated: { type: Boolean, default: !1 }
71
72
  },
72
73
  emits: ["click"],
73
74
  setup(a, { emit: e }) {
74
- const s = a, n = e, c = l(() => {
75
+ const s = a, n = e, l = d(() => {
75
76
  switch (s.variant) {
76
77
  case "secondary":
77
78
  return "m-button--secondary";
@@ -80,34 +81,34 @@ const D = ["role", "aria-label"], R = { class: "container-fluid" }, A = /* @__PU
80
81
  default:
81
82
  return "m-button--primary";
82
83
  }
83
- }), u = () => {
84
+ }), u = d(() => s.iconAnimated ? "m-button--animated-right" : ""), p = () => {
84
85
  n("click");
85
86
  };
86
- return (_, d) => (o(), r("button", {
87
- onClick: u,
88
- disabled: _.disabled,
89
- class: y(["m-button m-button--animated-right", c.value])
87
+ return (r, $) => (o(), i("button", {
88
+ onClick: p,
89
+ disabled: r.disabled,
90
+ class: b(["m-button", [l.value, u.value]])
90
91
  }, [
91
92
  t("span", null, [
92
- i(_.$slots, "default"),
93
- _.icon ? (o(), r("svg", j, [
93
+ c(r.$slots, "default"),
94
+ r.icon ? (o(), i("svg", N, [
94
95
  t("use", {
95
- "xlink:href": "#icon-" + _.icon
96
- }, null, 8, F)
96
+ "xlink:href": "#icon-" + r.icon
97
+ }, null, 8, V)
97
98
  ])) : g("", !0)
98
99
  ])
99
- ], 10, W));
100
+ ], 10, j));
100
101
  }
101
- }), V = ["aria-label"], x = { class: "m-callout__inner" }, z = { class: "m-callout__icon" }, U = {
102
+ }), F = ["aria-label"], x = { class: "m-callout__inner" }, z = { class: "m-callout__icon" }, U = {
102
103
  "aria-hidden": "true",
103
104
  class: "icon"
104
- }, X = ["xlink:href"], q = { class: "m-callout__body" }, G = { class: "m-callout__body__inner" }, J = { class: "m-callout__headline" }, K = { class: "m-callout__content" }, Q = /* @__PURE__ */ p({
105
+ }, X = ["xlink:href"], q = { class: "m-callout__body" }, G = { class: "m-callout__body__inner" }, J = { class: "m-callout__headline" }, K = { class: "m-callout__content" }, Q = /* @__PURE__ */ h({
105
106
  __name: "MucCallout",
106
107
  props: {
107
108
  type: { default: "info" }
108
109
  },
109
110
  setup(a) {
110
- const e = a, s = l(() => {
111
+ const e = a, s = d(() => {
111
112
  switch (e.type) {
112
113
  case "error":
113
114
  return "warning";
@@ -116,7 +117,7 @@ const D = ["role", "aria-label"], R = { class: "container-fluid" }, A = /* @__PU
116
117
  default:
117
118
  return "information";
118
119
  }
119
- }), n = l(() => {
120
+ }), n = d(() => {
120
121
  switch (e.type) {
121
122
  case "error":
122
123
  return "m-callout--error";
@@ -127,7 +128,7 @@ const D = ["role", "aria-label"], R = { class: "container-fluid" }, A = /* @__PU
127
128
  default:
128
129
  return "m-callout--default";
129
130
  }
130
- }), c = l(() => {
131
+ }), l = d(() => {
131
132
  switch (e.type) {
132
133
  case "success":
133
134
  return "Erfolgreich";
@@ -139,14 +140,14 @@ const D = ["role", "aria-label"], R = { class: "container-fluid" }, A = /* @__PU
139
140
  return "Information";
140
141
  }
141
142
  });
142
- return (u, _) => (o(), r("div", {
143
- class: y(["m-callout", n.value]),
144
- "aria-label": c.value
143
+ return (u, p) => (o(), i("div", {
144
+ class: b(["m-callout", n.value]),
145
+ "aria-label": l.value
145
146
  }, [
146
147
  t("div", x, [
147
148
  t("div", z, [
148
- i(u.$slots, "icon", {}, () => [
149
- (o(), r("svg", U, [
149
+ c(u.$slots, "icon", {}, () => [
150
+ (o(), i("svg", U, [
150
151
  t("use", {
151
152
  "xlink:href": `#icon-${s.value}`
152
153
  }, null, 8, X)
@@ -156,27 +157,27 @@ const D = ["role", "aria-label"], R = { class: "container-fluid" }, A = /* @__PU
156
157
  t("div", q, [
157
158
  t("div", G, [
158
159
  t("div", J, [
159
- i(u.$slots, "header", {}, void 0, !0)
160
+ c(u.$slots, "header", {}, void 0, !0)
160
161
  ]),
161
162
  t("div", K, [
162
163
  t("p", null, [
163
- i(u.$slots, "content", { class: "m-callout__content" }, void 0, !0)
164
+ c(u.$slots, "content", { class: "m-callout__content" }, void 0, !0)
164
165
  ])
165
166
  ])
166
167
  ])
167
168
  ])
168
169
  ])
169
- ], 10, V));
170
+ ], 10, F));
170
171
  }
171
- }), b = (a, e) => {
172
+ }), k = (a, e) => {
172
173
  const s = a.__vccOpts || a;
173
- for (const [n, c] of e)
174
- s[n] = c;
174
+ for (const [n, l] of e)
175
+ s[n] = l;
175
176
  return s;
176
- }, Y = /* @__PURE__ */ b(Q, [["__scopeId", "data-v-efad4956"]]), Z = (a) => (B("data-v-acf0a1dd"), a = a(), E(), a), tt = { class: "card-content" }, et = { class: "card-header" }, nt = {
177
+ }, Y = /* @__PURE__ */ k(Q, [["__scopeId", "data-v-efad4956"]]), Z = (a) => (I("data-v-acf0a1dd"), a = a(), B(), a), tt = { class: "card-content" }, et = { class: "card-header" }, nt = {
177
178
  key: 0,
178
179
  class: "card-tagline"
179
- }, st = /* @__PURE__ */ Z(() => /* @__PURE__ */ t("div", { class: "muc-divider" }, null, -1)), at = /* @__PURE__ */ p({
180
+ }, st = /* @__PURE__ */ Z(() => /* @__PURE__ */ t("div", { class: "muc-divider" }, null, -1)), at = /* @__PURE__ */ h({
180
181
  __name: "MucCard",
181
182
  props: {
182
183
  title: {},
@@ -185,33 +186,33 @@ const D = ["role", "aria-label"], R = { class: "container-fluid" }, A = /* @__PU
185
186
  emits: ["click"],
186
187
  setup(a, { emit: e }) {
187
188
  const s = e;
188
- return (n, c) => (o(), r("div", {
189
+ return (n, l) => (o(), i("div", {
189
190
  class: "card",
190
- onClick: c[0] || (c[0] = (u) => s("click", u))
191
+ onClick: l[0] || (l[0] = (u) => s("click", u))
191
192
  }, [
192
193
  t("div", tt, [
193
194
  t("div", et, [
194
- i(n.$slots, "headerPrefix", {}, void 0, !0),
195
+ c(n.$slots, "headerPrefix", {}, void 0, !0),
195
196
  t("div", null, [
196
- n.tagline ? (o(), r("div", nt, m(n.tagline), 1)) : g("", !0),
197
+ n.tagline ? (o(), i("div", nt, _(n.tagline), 1)) : g("", !0),
197
198
  t("div", null, [
198
- t("h3", null, m(n.title), 1)
199
+ t("h3", null, _(n.title), 1)
199
200
  ])
200
201
  ])
201
202
  ]),
202
203
  st,
203
- i(n.$slots, "content", {}, void 0, !0)
204
+ c(n.$slots, "content", {}, void 0, !0)
204
205
  ])
205
206
  ]));
206
207
  }
207
- }), ot = /* @__PURE__ */ b(at, [["__scopeId", "data-v-acf0a1dd"]]), rt = { class: "container card-container" }, it = /* @__PURE__ */ p({
208
+ }), ot = /* @__PURE__ */ k(at, [["__scopeId", "data-v-acf0a1dd"]]), it = { class: "container card-container" }, rt = /* @__PURE__ */ h({
208
209
  __name: "MucCardContainer",
209
210
  setup(a) {
210
- return (e, s) => (o(), r("div", rt, [
211
- i(e.$slots, "default", {}, void 0, !0)
211
+ return (e, s) => (o(), i("div", it, [
212
+ c(e.$slots, "default", {}, void 0, !0)
212
213
  ]));
213
214
  }
214
- }), ct = /* @__PURE__ */ b(it, [["__scopeId", "data-v-256852e7"]]), lt = { class: "m-comment__head" }, ut = { class: "m-comment__initials" }, dt = { class: "m-comment__info" }, _t = { class: "m-comment__author" }, mt = { key: 0 }, ht = { class: "m-comment__author" }, pt = { class: "m-comment__date" }, vt = ["aria-label"], ft = /* @__PURE__ */ t("svg", {
215
+ }), ct = /* @__PURE__ */ k(rt, [["__scopeId", "data-v-6740df8f"]]), lt = { class: "m-comment__head" }, dt = { class: "m-comment__initials" }, ut = { class: "m-comment__info" }, _t = { class: "m-comment__author" }, mt = { key: 0 }, ht = { class: "m-comment__author" }, pt = { class: "m-comment__date" }, vt = ["aria-label"], ft = /* @__PURE__ */ t("svg", {
215
216
  "aria-hidden": "true",
216
217
  class: "icon"
217
218
  }, [
@@ -235,74 +236,74 @@ const D = ["role", "aria-label"], R = { class: "container-fluid" }, A = /* @__PU
235
236
  /* @__PURE__ */ t("use", { "xlink:href": "#icon-solid-star" })
236
237
  ], -1), Ct = [
237
238
  kt
238
- ], Mt = { class: "m-star-rating__numeric" }, St = { class: "m-comment__body" }, wt = { class: "m-comment__headline" }, It = { class: "m-comment__text" }, Bt = "de-DE", Et = 0.2, Lt = 0.8, $ = 5, I = /* @__PURE__ */ p({
239
+ ], Mt = { class: "m-star-rating__numeric" }, St = { class: "m-comment__body" }, wt = { class: "m-comment__headline" }, Et = { class: "m-comment__text" }, It = "de-DE", Bt = 0.2, At = 0.8, y = 5, E = /* @__PURE__ */ h({
239
240
  __name: "MucComment",
240
241
  props: {
241
242
  rating: {},
242
243
  variant: { default: "listing" }
243
244
  },
244
245
  setup(a) {
245
- const e = L(), s = a, n = l(() => !!e.date), c = l(() => s.variant === "slider" ? "m-comment--slider" : "m-comment--listing"), u = l(() => s.rating.toLocaleString(Bt.valueOf(), {
246
+ const e = A(), s = a, n = d(() => !!e.date), l = d(() => s.variant === "slider" ? "m-comment--slider" : "m-comment--listing"), u = d(() => s.rating.toLocaleString(It.valueOf(), {
246
247
  minimumFractionDigits: 1
247
- })), _ = l(() => {
248
- const d = +(s.rating % 1).toFixed(1);
249
- let k = Math.min(Math.floor(s.rating), $), v = Math.floor($ - s.rating), C = !1;
250
- return s.rating !== 0 && s.rating !== $ && (d <= Et ? v++ : d >= Lt ? k++ : C = !0), {
251
- fullStars: k,
248
+ })), p = d(() => {
249
+ const r = +(s.rating % 1).toFixed(1);
250
+ let $ = Math.min(Math.floor(s.rating), y), v = Math.floor(y - s.rating), C = !1;
251
+ return s.rating !== 0 && s.rating !== y && (r <= Bt ? v++ : r >= At ? $++ : C = !0), {
252
+ fullStars: $,
252
253
  emptyStars: v,
253
254
  isHalfStar: C
254
255
  };
255
256
  });
256
- return (d, k) => (o(), r("div", {
257
- class: y(["m-comment", c.value])
257
+ return (r, $) => (o(), i("div", {
258
+ class: b(["m-comment", l.value])
258
259
  }, [
259
260
  t("div", lt, [
260
- t("div", ut, [
261
- i(d.$slots, "initials")
262
- ]),
263
261
  t("div", dt, [
262
+ c(r.$slots, "initials")
263
+ ]),
264
+ t("div", ut, [
264
265
  t("span", _t, [
265
- i(d.$slots, "author")
266
+ c(r.$slots, "author")
266
267
  ]),
267
- n.value ? (o(), r("span", mt, [
268
+ n.value ? (o(), i("span", mt, [
268
269
  t("span", ht, [
269
- h(" "),
270
- i(d.$slots, "datePrefix")
270
+ m(" "),
271
+ c(r.$slots, "datePrefix")
271
272
  ]),
272
273
  t("span", pt, [
273
- h(" "),
274
- i(d.$slots, "date")
274
+ m(" "),
275
+ c(r.$slots, "date")
275
276
  ])
276
277
  ])) : g("", !0),
277
278
  t("div", {
278
279
  class: "m-star-rating",
279
280
  role: "img",
280
- "aria-label": `Bewertung: ${d.rating} von ${$} Sternen`
281
+ "aria-label": `Bewertung: ${r.rating} von ${y} Sternen`
281
282
  }, [
282
- (o(!0), r(M, null, S(_.value.fullStars, (v) => (o(), r("div", {
283
+ (o(!0), i(M, null, S(p.value.fullStars, (v) => (o(), i("div", {
283
284
  key: v,
284
285
  class: "m-star-rating__item m-star-rating__item--full"
285
286
  }, gt))), 128)),
286
- _.value.isHalfStar ? (o(), r("div", $t, bt)) : g("", !0),
287
- (o(!0), r(M, null, S(_.value.emptyStars, (v) => (o(), r("div", {
287
+ p.value.isHalfStar ? (o(), i("div", $t, bt)) : g("", !0),
288
+ (o(!0), i(M, null, S(p.value.emptyStars, (v) => (o(), i("div", {
288
289
  key: v,
289
290
  class: "m-star-rating__item"
290
291
  }, Ct))), 128)),
291
- t("div", Mt, m(u.value), 1)
292
+ t("div", Mt, _(u.value), 1)
292
293
  ], 8, vt)
293
294
  ])
294
295
  ]),
295
296
  t("div", St, [
296
297
  t("div", wt, [
297
- i(d.$slots, "headline")
298
+ c(r.$slots, "headline")
298
299
  ]),
299
- t("div", It, [
300
- i(d.$slots, "text")
300
+ t("div", Et, [
301
+ c(r.$slots, "text")
301
302
  ])
302
303
  ])
303
304
  ], 2));
304
305
  }
305
- }), Ot = /* @__PURE__ */ p({
306
+ }), Ot = " ", Rt = /* @__PURE__ */ h({
306
307
  __name: "MucCommentText",
307
308
  props: {
308
309
  datePrefix: { default: "am" },
@@ -315,47 +316,47 @@ const D = ["role", "aria-label"], R = { class: "container-fluid" }, A = /* @__PU
315
316
  variant: { default: "listing" }
316
317
  },
317
318
  setup(a) {
318
- const e = a, s = l(() => e.initials ?? e.author.split(" ").map((n) => n.charAt(0)).join(""));
319
- return (n, c) => (o(), O(P(I), {
319
+ const e = a, s = d(() => ((e.initials ?? e.author.split(Ot).map((n) => n.charAt(0)).join("")).match(/^.|.$/g) ?? [""]).join(""));
320
+ return (n, l) => (o(), O(R(E), {
320
321
  rating: n.rating,
321
322
  variant: n.variant
322
323
  }, T({
323
324
  initials: f(() => [
324
- h(m(s.value), 1)
325
+ m(_(s.value), 1)
325
326
  ]),
326
327
  datePrefix: f(() => [
327
- h("am")
328
+ m("am")
328
329
  ]),
329
330
  author: f(() => [
330
- h(m(n.author), 1)
331
+ m(_(n.author), 1)
331
332
  ]),
332
333
  headline: f(() => [
333
- h(m(n.headline), 1)
334
+ m(_(n.headline), 1)
334
335
  ]),
335
336
  text: f(() => [
336
- h(m(n.text), 1)
337
+ m(_(n.text), 1)
337
338
  ]),
338
339
  _: 2
339
340
  }, [
340
341
  n.date ? {
341
342
  name: "date",
342
343
  fn: f(() => [
343
- h(m(n.date), 1)
344
+ m(_(n.date), 1)
344
345
  ]),
345
346
  key: "0"
346
347
  } : void 0
347
348
  ]), 1032, ["rating", "variant"]));
348
349
  }
349
- }), Pt = {
350
+ }), Tt = {
350
351
  class: "m-intro m-intro-static-image",
351
352
  style: { "background-color": "var(--color-neutrals-blue-xlight)" }
352
- }, Tt = { class: "container" }, Dt = { style: { width: "66.6%" } }, Rt = {
353
+ }, Lt = { class: "container" }, Pt = { style: { width: "66.6%" } }, Dt = {
353
354
  key: 0,
354
355
  class: "m-intro-vertical__tagline"
355
- }, At = { class: "m-intro-vertical__title" }, Ht = {
356
+ }, Ht = { class: "m-intro-vertical__title" }, jt = {
356
357
  key: 0,
357
358
  class: "muc-divider"
358
- }, Wt = { class: "m-intro-vertical__content" }, jt = { style: { "padding-bottom": "32px" } }, Ft = /* @__PURE__ */ p({
359
+ }, Nt = { class: "m-intro-vertical__content" }, Vt = { style: { "padding-bottom": "32px" } }, Wt = /* @__PURE__ */ h({
359
360
  __name: "MucIntro",
360
361
  props: {
361
362
  title: {},
@@ -363,47 +364,47 @@ const D = ["role", "aria-label"], R = { class: "container-fluid" }, A = /* @__PU
363
364
  divider: { type: Boolean }
364
365
  },
365
366
  setup(a) {
366
- return (e, s) => (o(), r("div", Pt, [
367
- t("div", Tt, [
368
- t("div", Dt, [
367
+ return (e, s) => (o(), i("div", Tt, [
368
+ t("div", Lt, [
369
+ t("div", Pt, [
369
370
  t("div", null, [
370
- e.tagline ? (o(), r("p", Rt, m(e.tagline), 1)) : g("", !0),
371
- t("h1", At, m(e.title), 1)
371
+ e.tagline ? (o(), i("p", Dt, _(e.tagline), 1)) : g("", !0),
372
+ t("h1", Ht, _(e.title), 1)
372
373
  ]),
373
- e.divider ? (o(), r("div", Ht)) : g("", !0),
374
- t("div", Wt, [
375
- t("p", jt, [
376
- i(e.$slots, "default", {}, void 0, !0)
374
+ e.divider ? (o(), i("div", jt)) : g("", !0),
375
+ t("div", Nt, [
376
+ t("p", Vt, [
377
+ c(e.$slots, "default", {}, void 0, !0)
377
378
  ])
378
379
  ])
379
380
  ])
380
381
  ])
381
382
  ]));
382
383
  }
383
- }), Nt = /* @__PURE__ */ b(Ft, [["__scopeId", "data-v-75c8321c"]]), w = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
384
+ }), Ft = /* @__PURE__ */ k(Wt, [["__scopeId", "data-v-3957c1bd"]]), w = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
384
385
  __proto__: null,
385
386
  MucBanner: H,
386
- MucButton: N,
387
+ MucButton: W,
387
388
  MucCallout: Y,
388
389
  MucCard: ot,
389
390
  MucCardContainer: ct,
390
- MucComment: I,
391
- MucCommentText: Ot,
392
- MucIntro: Nt
391
+ MucComment: E,
392
+ MucCommentText: Rt,
393
+ MucIntro: Ft
393
394
  }, Symbol.toStringTag, { value: "Module" }));
394
- function Vt(a) {
395
+ function xt(a) {
395
396
  for (const e in w)
396
397
  a.component(e, w[e]);
397
398
  }
398
- const zt = { install: Vt };
399
+ const Ut = { install: xt };
399
400
  export {
400
401
  H as MucBanner,
401
- N as MucButton,
402
+ W as MucButton,
402
403
  Y as MucCallout,
403
404
  ot as MucCard,
404
405
  ct as MucCardContainer,
405
- I as MucComment,
406
- Ot as MucCommentText,
407
- Nt as MucIntro,
408
- zt as default
406
+ E as MucComment,
407
+ Rt as MucCommentText,
408
+ Ft as MucIntro,
409
+ Ut as default
409
410
  };
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- .m-callout--success[data-v-efad4956]{background-color:#f1f6f3;border-color:#95b9a2}.m-callout--success .m-callout__icon[data-v-efad4956]{background-color:#3a7f53;box-shadow:0 .3125rem .625rem #005a9f33}.m-callout--error[data-v-efad4956]{background-color:#f8f2f2;border-color:#c79a9b}.m-callout--error .m-callout__icon[data-v-efad4956]{background-color:#984447;box-shadow:0 .3125rem .625rem #005a9f33}.card[data-v-acf0a1dd]{cursor:pointer;border:solid 1px var(--color-neutrals-blue);border-bottom:solid 5px var(--color-brand-main-blue);transition:background-color ease-in .15s}.card[data-v-acf0a1dd]:hover{background-color:#f1f1f1}.card-content[data-v-acf0a1dd]{padding:32px 24px}.card-header[data-v-acf0a1dd]{display:flex}.card-tagline[data-v-acf0a1dd]{font-size:16px;font-family:Open Sans,sans-serif;color:#005a9f;font-weight:700;line-height:24px;word-wrap:break-word;padding-bottom:4px}.muc-divider[data-v-acf0a1dd]{margin-top:16px;margin-bottom:16px}@media all and (min-width: 992px){.card-container[data-v-256852e7]{padding-left:0;padding-right:0;display:grid;grid-template-columns:repeat(auto-fit,384px);grid-column-gap:32px;grid-row-gap:32px}}@media all and (max-width: 992px){.card-container[data-v-256852e7]{padding-left:0;padding-right:0;display:inline-grid;grid-template-columns:1fr;grid-row-gap:32px}}.muc-divider[data-v-75c8321c]{margin-top:8px;margin-bottom:16px}
1
+ .m-callout--success[data-v-efad4956]{background-color:#f1f6f3;border-color:#95b9a2}.m-callout--success .m-callout__icon[data-v-efad4956]{background-color:#3a7f53;box-shadow:0 .3125rem .625rem #005a9f33}.m-callout--error[data-v-efad4956]{background-color:#f8f2f2;border-color:#c79a9b}.m-callout--error .m-callout__icon[data-v-efad4956]{background-color:#984447;box-shadow:0 .3125rem .625rem #005a9f33}.card[data-v-acf0a1dd]{cursor:pointer;border:solid 1px var(--color-neutrals-blue);border-bottom:solid 5px var(--color-brand-main-blue);transition:background-color ease-in .15s}.card[data-v-acf0a1dd]:hover{background-color:#f1f1f1}.card-content[data-v-acf0a1dd]{padding:32px 24px}.card-header[data-v-acf0a1dd]{display:flex}.card-tagline[data-v-acf0a1dd]{font-size:16px;font-family:Open Sans,sans-serif;color:#005a9f;font-weight:700;line-height:24px;word-wrap:break-word;padding-bottom:4px}.muc-divider[data-v-acf0a1dd]{margin-top:16px;margin-bottom:16px}@media all and (min-width: 992px){.card-container[data-v-6740df8f]{padding-left:0;padding-right:0;display:grid;grid-template-columns:repeat(auto-fit,384px);grid-column-gap:32px;grid-row-gap:32px}}@media all and (max-width: 992px){.card-container[data-v-6740df8f]{padding-left:0;padding-right:0;display:inline-grid;grid-template-columns:1fr;grid-row-gap:32px}}.muc-divider[data-v-3957c1bd]{margin-top:8px;margin-bottom:16px}
@@ -12,6 +12,10 @@ declare const _default: {
12
12
  type: import("vue").PropType<boolean>;
13
13
  default: boolean;
14
14
  };
15
+ iconAnimated: {
16
+ type: import("vue").PropType<boolean>;
17
+ default: boolean;
18
+ };
15
19
  }>> & {
16
20
  onClick?: (() => any) | undefined;
17
21
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -28,11 +32,16 @@ declare const _default: {
28
32
  type: import("vue").PropType<boolean>;
29
33
  default: boolean;
30
34
  };
35
+ iconAnimated: {
36
+ type: import("vue").PropType<boolean>;
37
+ default: boolean;
38
+ };
31
39
  }>> & {
32
40
  onClick?: (() => any) | undefined;
33
41
  }, {
34
42
  variant: "primary" | "secondary" | "ghost";
35
43
  disabled: boolean;
44
+ iconAnimated: boolean;
36
45
  }, true, {}, {}, {
37
46
  P: {};
38
47
  B: {};
@@ -52,11 +61,16 @@ declare const _default: {
52
61
  type: import("vue").PropType<boolean>;
53
62
  default: boolean;
54
63
  };
64
+ iconAnimated: {
65
+ type: import("vue").PropType<boolean>;
66
+ default: boolean;
67
+ };
55
68
  }>> & {
56
69
  onClick?: (() => any) | undefined;
57
70
  }, {}, {}, {}, {}, {
58
71
  variant: "primary" | "secondary" | "ghost";
59
72
  disabled: boolean;
73
+ iconAnimated: boolean;
60
74
  }>;
61
75
  __isFragment?: undefined;
62
76
  __isTeleport?: undefined;
@@ -73,6 +87,10 @@ declare const _default: {
73
87
  type: import("vue").PropType<boolean>;
74
88
  default: boolean;
75
89
  };
90
+ iconAnimated: {
91
+ type: import("vue").PropType<boolean>;
92
+ default: boolean;
93
+ };
76
94
  }>> & {
77
95
  onClick?: (() => any) | undefined;
78
96
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -80,6 +98,7 @@ declare const _default: {
80
98
  }, string, {
81
99
  variant: "primary" | "secondary" | "ghost";
82
100
  disabled: boolean;
101
+ iconAnimated: boolean;
83
102
  }, {}, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
84
103
  $slots: Readonly<{
85
104
  default(): any;
@@ -130,3 +149,10 @@ export declare const Icon: {
130
149
  icon: string;
131
150
  };
132
151
  };
152
+ export declare const IconAnimated: {
153
+ args: {
154
+ default: string;
155
+ icon: string;
156
+ iconAnimated: boolean;
157
+ };
158
+ };
@@ -14,9 +14,16 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
14
14
  * Choose an icon to be appended behind the slot. No icon will be placed if the prop is left empty.
15
15
  */
16
16
  icon?: string | undefined;
17
+ /**
18
+ * Wether the Icon should be animated on hover (slide-right) or not.
19
+ *
20
+ * Default is `false`
21
+ */
22
+ iconAnimated?: boolean | undefined;
17
23
  }>, {
18
24
  variant: string;
19
25
  disabled: boolean;
26
+ iconAnimated: boolean;
20
27
  }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
21
28
  click: () => void;
22
29
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<{
@@ -34,14 +41,22 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
34
41
  * Choose an icon to be appended behind the slot. No icon will be placed if the prop is left empty.
35
42
  */
36
43
  icon?: string | undefined;
44
+ /**
45
+ * Wether the Icon should be animated on hover (slide-right) or not.
46
+ *
47
+ * Default is `false`
48
+ */
49
+ iconAnimated?: boolean | undefined;
37
50
  }>, {
38
51
  variant: string;
39
52
  disabled: boolean;
53
+ iconAnimated: boolean;
40
54
  }>>> & {
41
55
  onClick?: (() => any) | undefined;
42
56
  }, {
43
57
  variant: buttonType;
44
58
  disabled: boolean;
59
+ iconAnimated: boolean;
45
60
  }, {}>, Readonly<{
46
61
  /**
47
62
  * Display content inside the button.
@@ -0,0 +1,93 @@
1
+ declare const _default: {
2
+ component: import("vue").DefineComponent<{
3
+ text: {
4
+ type: import("vue").PropType<string>;
5
+ required: true;
6
+ };
7
+ variant: {
8
+ type: import("vue").PropType<import("./CommentType.js").default>;
9
+ default: string;
10
+ };
11
+ rating: {
12
+ type: import("vue").PropType<number>;
13
+ required: true;
14
+ };
15
+ date: {
16
+ type: import("vue").PropType<string>;
17
+ };
18
+ initials: {
19
+ type: import("vue").PropType<string>;
20
+ };
21
+ author: {
22
+ type: import("vue").PropType<string>;
23
+ required: true;
24
+ };
25
+ datePrefix: {
26
+ type: import("vue").PropType<string>;
27
+ default: string;
28
+ };
29
+ headline: {
30
+ type: import("vue").PropType<string>;
31
+ };
32
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
33
+ text: {
34
+ type: import("vue").PropType<string>;
35
+ required: true;
36
+ };
37
+ variant: {
38
+ type: import("vue").PropType<import("./CommentType.js").default>;
39
+ default: string;
40
+ };
41
+ rating: {
42
+ type: import("vue").PropType<number>;
43
+ required: true;
44
+ };
45
+ date: {
46
+ type: import("vue").PropType<string>;
47
+ };
48
+ initials: {
49
+ type: import("vue").PropType<string>;
50
+ };
51
+ author: {
52
+ type: import("vue").PropType<string>;
53
+ required: true;
54
+ };
55
+ datePrefix: {
56
+ type: import("vue").PropType<string>;
57
+ default: string;
58
+ };
59
+ headline: {
60
+ type: import("vue").PropType<string>;
61
+ };
62
+ }>>, {
63
+ variant: import("./CommentType.js").default;
64
+ datePrefix: string;
65
+ }, {}>;
66
+ title: string;
67
+ tags: string[];
68
+ parameters: {
69
+ docs: {
70
+ description: {
71
+ component: string;
72
+ };
73
+ };
74
+ };
75
+ };
76
+ export default _default;
77
+ export declare const Default: {
78
+ args: {
79
+ rating: number;
80
+ author: string;
81
+ headline: string;
82
+ text: string;
83
+ };
84
+ };
85
+ export declare const Slider: {
86
+ args: {
87
+ rating: number;
88
+ author: string;
89
+ headline: string;
90
+ variant: string;
91
+ text: string;
92
+ };
93
+ };
@@ -7,7 +7,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
7
7
  headline?: string | undefined;
8
8
  text: string;
9
9
  rating: number;
10
- variant: CommentType;
10
+ variant?: CommentType | undefined;
11
11
  }>, {
12
12
  datePrefix: string;
13
13
  variant: string;
@@ -19,7 +19,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
19
19
  headline?: string | undefined;
20
20
  text: string;
21
21
  rating: number;
22
- variant: CommentType;
22
+ variant?: CommentType | undefined;
23
23
  }>, {
24
24
  datePrefix: string;
25
25
  variant: string;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "author": "FabianWilms",
4
4
  "description": "A vue component library of some of the components available from https://patternlab.muenchen.space",
5
5
  "license": "MIT",
6
- "version": "1.8.0-beta.4",
6
+ "version": "1.8.0-beta.6",
7
7
  "private": false,
8
8
  "module": "./dist/muc-patternlab-vue.es.js",
9
9
  "types": "./dist/types/index.d.ts",
@@ -53,3 +53,11 @@ export const Icon = {
53
53
  icon: "arrow-right",
54
54
  },
55
55
  };
56
+
57
+ export const IconAnimated = {
58
+ args: {
59
+ default: "With Icon",
60
+ icon: "arrow-right",
61
+ iconAnimated: true,
62
+ },
63
+ };
@@ -2,8 +2,8 @@
2
2
  <button
3
3
  @click="handleClick"
4
4
  :disabled="disabled"
5
- class="m-button m-button--animated-right"
6
- :class="buttonClass"
5
+ class="m-button"
6
+ :class="[buttonVariantClass, iconAnimatedClass]"
7
7
  >
8
8
  <span>
9
9
  <slot />
@@ -39,10 +39,17 @@ const props = withDefaults(
39
39
  * Choose an icon to be appended behind the slot. No icon will be placed if the prop is left empty.
40
40
  */
41
41
  icon?: string;
42
+ /**
43
+ * Wether the Icon should be animated on hover (slide-right) or not.
44
+ *
45
+ * Default is `false`
46
+ */
47
+ iconAnimated?: boolean;
42
48
  }>(),
43
49
  {
44
50
  variant: "primary",
45
51
  disabled: false,
52
+ iconAnimated: false,
46
53
  }
47
54
  );
48
55
 
@@ -61,7 +68,7 @@ const emit = defineEmits<{
61
68
  (e: "click"): void;
62
69
  }>();
63
70
 
64
- const buttonClass = computed(() => {
71
+ const buttonVariantClass = computed(() => {
65
72
  switch (props.variant) {
66
73
  case "secondary":
67
74
  return "m-button--secondary";
@@ -72,6 +79,8 @@ const buttonClass = computed(() => {
72
79
  }
73
80
  });
74
81
 
82
+ const iconAnimatedClass = computed(() => props.iconAnimated ? 'm-button--animated-right' : '');
83
+
75
84
  const handleClick = () => {
76
85
  emit("click");
77
86
  };
@@ -4,7 +4,7 @@ import MucCard from "./MucCard.vue";
4
4
 
5
5
  export default {
6
6
  component: MucCard,
7
- title: "MucCard",
7
+ title: "Card/MucCard",
8
8
  tags: ["autodocs"],
9
9
  // 👇 Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked
10
10
  args: { onClick: fn() },
@@ -6,7 +6,7 @@ import MucCardContainer from "./MucCardContainer.vue";
6
6
  export default {
7
7
  components: { MucCardContainer },
8
8
  component: MucCardContainer,
9
- title: "MucCardContainer",
9
+ title: "Card/MucCardContainer",
10
10
  tags: ["autodocs"],
11
11
  // 👇 Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked
12
12
  args: { onClick: fn() },
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="container card-container">
3
- <slot/>
3
+ <slot />
4
4
  </div>
5
5
  </template>
6
6
 
@@ -2,14 +2,13 @@ import MucComment from "./MucComment.vue";
2
2
 
3
3
  export default {
4
4
  component: MucComment,
5
- title: "MucComment",
5
+ title: "Comment/MucComment",
6
6
  tags: ["autodocs"],
7
7
  parameters: {
8
8
  docs: {
9
9
  description: {
10
10
  component: `The muc-comment component can be used to display a comment in e.g. a chat.
11
- If you would like to display only text, we suggest using the more specific \`muc-comment-text\`.
12
- For more general integration, we recommend the more general \`muc-comment\`.
11
+ The \`muc-comment\`-component is designed to be as generic as possible.
13
12
 
14
13
  [🔗 Patternlab-Docs](https://patternlab.muenchen.space/?p=viewall-elements-comment)
15
14
  `,
@@ -0,0 +1,38 @@
1
+ import MucCommentText from "./MucCommentText.vue";
2
+
3
+ export default {
4
+ component: MucCommentText,
5
+ title: "Comment/MucCommentText",
6
+ tags: ["autodocs"],
7
+ parameters: {
8
+ docs: {
9
+ description: {
10
+ component: `The muc-comment component can be used to display a comment in e.g. a chat.
11
+ If you would like to display only text, we suggest using this component instead of the more generic \`muc-comment\`.
12
+ Furthermore this component does limit the number of charactesr for the initials to two.
13
+
14
+ [🔗 Patternlab-Docs](https://patternlab.muenchen.space/?p=viewall-elements-comment)
15
+ `,
16
+ },
17
+ },
18
+ },
19
+ };
20
+
21
+ export const Default = {
22
+ args: {
23
+ rating: 4.2,
24
+ author: "Max Foo Bar Mustermann",
25
+ headline: "Initials shortend",
26
+ text: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonum eirmod tempor invidunt ut",
27
+ },
28
+ };
29
+
30
+ export const Slider = {
31
+ args: {
32
+ ...Default.args,
33
+ rating: 2.3,
34
+ author: "",
35
+ headline: "Empty Author",
36
+ variant: "slider",
37
+ },
38
+ };
@@ -22,6 +22,8 @@ import { computed } from "vue";
22
22
  import { MucComment } from "../index";
23
23
  import CommentType from "./CommentType";
24
24
 
25
+ const AUTHOR_NAME_SEPERATOR = " ";
26
+
25
27
  const props = withDefaults(
26
28
  defineProps<{
27
29
  datePrefix?: string;
@@ -31,7 +33,7 @@ const props = withDefaults(
31
33
  headline?: string;
32
34
  text: string;
33
35
  rating: number;
34
- variant: CommentType;
36
+ variant?: CommentType;
35
37
  }>(),
36
38
  {
37
39
  datePrefix: "am",
@@ -39,14 +41,20 @@ const props = withDefaults(
39
41
  }
40
42
  );
41
43
 
44
+ /**
45
+ * Initials will be computed if none are given.
46
+ * In the case of an empty author field, an empty string is returned for the initials.
47
+ */
42
48
  const computedInitials = computed(() => {
43
49
  return (
44
- props.initials ??
45
- props.author
46
- .split(" ")
47
- .map((word) => word.charAt(0))
48
- .join("")
49
- );
50
+ (
51
+ props.initials ??
52
+ props.author
53
+ .split(AUTHOR_NAME_SEPERATOR)
54
+ .map((word) => word.charAt(0))
55
+ .join("")
56
+ ).match(/^.|.$/g) ?? [""]
57
+ ).join("");
50
58
  });
51
59
  </script>
52
60
 
@@ -23,15 +23,16 @@ defineSlots<{
23
23
  </script>
24
24
 
25
25
  <template>
26
- <div class="m-intro m-intro-static-image" style="background-color: var(--color-neutrals-blue-xlight);">
27
- <div
28
- class="container"
29
- >
26
+ <div
27
+ class="m-intro m-intro-static-image"
28
+ style="background-color: var(--color-neutrals-blue-xlight)"
29
+ >
30
+ <div class="container">
30
31
  <div style="width: 66.6%">
31
32
  <div>
32
33
  <p
33
- v-if="tagline"
34
- class="m-intro-vertical__tagline"
34
+ v-if="tagline"
35
+ class="m-intro-vertical__tagline"
35
36
  >
36
37
  {{ tagline }}
37
38
  </p>
@@ -41,12 +42,12 @@ defineSlots<{
41
42
  </div>
42
43
 
43
44
  <div
44
- v-if="divider"
45
- class="muc-divider"
45
+ v-if="divider"
46
+ class="muc-divider"
46
47
  ></div>
47
48
 
48
49
  <div class="m-intro-vertical__content">
49
- <p style="padding-bottom: 32px;">
50
+ <p style="padding-bottom: 32px">
50
51
  <slot></slot>
51
52
  </p>
52
53
  </div>