@muenchen/muc-patternlab-vue 1.13.0-beta.4 → 1.13.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.
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- .m-banner--success[data-v-53bc7eca]{background-color:#f1f6f3;border-bottom:1px solid #3a7f53}.m-callout--success[data-v-e6cf4104]{background-color:#f1f6f3;border-color:#95b9a2}.m-callout--success .m-callout__icon[data-v-e6cf4104]{background-color:#3a7f53;box-shadow:0 .3125rem .625rem #005a9f33}.m-callout--error[data-v-e6cf4104]{background-color:#f8f2f2;border-color:#c79a9b}.m-callout--error .m-callout__icon[data-v-e6cf4104]{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}}.divider-border[data-v-a2b37f5b]{border-bottom:1px solid var(--color-neutrals-blue)}.display-listbox[data-v-0f229e1b]{display:block!important}.muc-divider[data-v-9ad3adc7]{margin-top:8px;margin-bottom:16px}
1
+ .m-banner--success[data-v-53bc7eca]{background-color:#f1f6f3;border-bottom:1px solid #3a7f53}.m-callout--success[data-v-e6cf4104]{background-color:#f1f6f3;border-color:#95b9a2}.m-callout--success .m-callout__icon[data-v-e6cf4104]{background-color:#3a7f53;box-shadow:0 .3125rem .625rem #005a9f33}.m-callout--error[data-v-e6cf4104]{background-color:#f8f2f2;border-color:#c79a9b}.m-callout--error .m-callout__icon[data-v-e6cf4104]{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}}.divider-border[data-v-a2b37f5b]{border-bottom:1px solid var(--color-neutrals-blue)}.wrapper[data-v-a20e4a10]{display:flex}.wrapper[data-v-a20e4a10]>*{margin:0 8px}.centered-text[data-v-a20e4a10]{display:flex;justify-content:center;align-items:center;height:100%}.display-listbox[data-v-0f229e1b]{display:block!important}.muc-divider[data-v-5c768acc]{margin-top:8px;margin-bottom:16px}@media screen and (width >992px){.muc-intro-content[data-v-5c768acc]{width:66.6%}}
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.13.0-beta.4",
6
+ "version": "1.13.0-beta.6",
7
7
  "private": false,
8
8
  "module": "./dist/muc-patternlab-vue.es.js",
9
9
  "types": "./dist/types/index.d.ts",
@@ -68,7 +68,7 @@
68
68
  "@vue/tsconfig": "^0.5.1",
69
69
  "eslint": "^8.49.0",
70
70
  "eslint-plugin-vue": "^9.17.0",
71
- "jsdom": "^24.0.0",
71
+ "jsdom": "^25.0.0",
72
72
  "npm-run-all2": "^6.1.1",
73
73
  "prettier": "^3.0.3",
74
74
  "rimraf": "^6.0.0",
@@ -0,0 +1,47 @@
1
+ import MucCounter from "./MucCounter.vue";
2
+
3
+ export default {
4
+ component: MucCounter,
5
+ title: "Forms/MucCounter",
6
+ tags: ["autodocs"],
7
+ parameters: {
8
+ docs: {
9
+ description: {
10
+ component: `The MucCounter offers the functionality of a simple counter.
11
+
12
+ [🔗 Patternlab-Docs](https://patternlab.muenchen.space/?p=elements-combobox)
13
+ `,
14
+ },
15
+ },
16
+ },
17
+ };
18
+
19
+ export const Default = {
20
+ args: {
21
+ modelValue: 0,
22
+ label: "This is a label",
23
+ },
24
+ };
25
+
26
+ export const MinAndMax = {
27
+ args: {
28
+ ...Default.args,
29
+ modelValue: 2,
30
+ min: 2,
31
+ max: 10,
32
+ },
33
+ };
34
+
35
+ export const Link = {
36
+ args: {
37
+ ...Default.args,
38
+ link: "#",
39
+ },
40
+ };
41
+
42
+ export const Disabled = {
43
+ args: {
44
+ ...Default.args,
45
+ disabled: true,
46
+ },
47
+ };
@@ -0,0 +1,128 @@
1
+ <template>
2
+ <div class="wrapper">
3
+ <MucButton
4
+ v-on:click="clickedMinus"
5
+ variant="secondary"
6
+ :disabled="disableMinus"
7
+ >
8
+ <template #default><muc-icon icon="minus" /></template>
9
+ </MucButton>
10
+ <p>
11
+ <strong
12
+ class="centered-text"
13
+ style="color: var(--color-brand-main-blue)"
14
+ >
15
+ {{ modelValue }}
16
+ </strong>
17
+ </p>
18
+ <MucButton
19
+ v-on:click="clickedPlus"
20
+ variant="secondary"
21
+ :disabled="disablePlus"
22
+ >
23
+ <template #default><muc-icon icon="plus" /></template>
24
+ </MucButton>
25
+ <p v-if="link">
26
+ <label class="centered-text">
27
+ <muc-link
28
+ :label="label"
29
+ :href="link"
30
+ ></muc-link>
31
+ </label>
32
+ </p>
33
+
34
+ <p v-else>
35
+ <label class="centered-text">
36
+ {{ label }}
37
+ </label>
38
+ </p>
39
+ </div>
40
+ </template>
41
+
42
+ <script setup lang="ts">
43
+ import { computed } from "vue";
44
+
45
+ import { MucButton } from "../Button";
46
+ import { MucIcon } from "../Icon";
47
+ import { MucLink } from "../Link";
48
+
49
+ /**
50
+ * Input value from the counter component.
51
+ */
52
+ const modelValue = defineModel<number>({ default: 0 });
53
+
54
+ const props = withDefaults(
55
+ defineProps<{
56
+ /**
57
+ * Label shown after the counter
58
+ */
59
+ label: string;
60
+
61
+ /**
62
+ * Optional minimum of counter
63
+ */
64
+ min?: number;
65
+
66
+ /**
67
+ * Optional maximum of counter
68
+ */
69
+ max?: number;
70
+
71
+ /**
72
+ * Optional link for label
73
+ */
74
+ link?: string;
75
+
76
+ /**
77
+ * Optionally disable this specific counter
78
+ */
79
+ disabled?: boolean;
80
+ }>(),
81
+ {
82
+ disabled: false,
83
+ }
84
+ );
85
+
86
+ /**
87
+ * Function increases the value of modelValue by 1
88
+ */
89
+ const clickedPlus = () => modelValue.value++;
90
+ /**
91
+ * Function decreases the value of modelValue by 1
92
+ */
93
+ const clickedMinus = () => modelValue.value--;
94
+
95
+ /**
96
+ * Computed property if this plus button should be disabled
97
+ */
98
+ const disablePlus = computed(
99
+ () => (!!props.max && !(modelValue.value < props.max)) || props.disabled
100
+ );
101
+
102
+ /**
103
+ * Computed property if this minus button should be disabled
104
+ */
105
+ const disableMinus = computed(
106
+ () =>
107
+ modelValue.value == 0 ||
108
+ (!!props.min && !(modelValue.value > props.min)) ||
109
+ props.disabled
110
+ );
111
+ </script>
112
+
113
+ <style scoped>
114
+ .wrapper {
115
+ display: flex;
116
+ }
117
+
118
+ .wrapper > * {
119
+ margin: 0 8px;
120
+ }
121
+
122
+ .centered-text {
123
+ display: flex;
124
+ justify-content: center;
125
+ align-items: center;
126
+ height: 100%;
127
+ }
128
+ </style>
@@ -1,5 +1,6 @@
1
1
  import MucCheckbox from "./MucCheckbox.vue";
2
2
  import MucCheckboxGroup from "./MucCheckboxGroup.vue";
3
+ import MucCounter from "./MucCounter.vue";
3
4
  import MucErrorList from "./MucErrorList.vue";
4
5
  import MucForm from "./MucInput.vue";
5
6
  import MucInput from "./MucInput.vue";
@@ -12,6 +13,7 @@ export {
12
13
  MucForm,
13
14
  MucCheckbox,
14
15
  MucCheckboxGroup,
16
+ MucCounter,
15
17
  MucRadioButtonGroup,
16
18
  MucInput,
17
19
  MucRadioButton,
@@ -28,7 +28,7 @@ defineSlots<{
28
28
  style="background-color: var(--color-neutrals-blue-xlight)"
29
29
  >
30
30
  <div class="container">
31
- <div style="width: 66.6%">
31
+ <div class="muc-intro-content">
32
32
  <div>
33
33
  <p
34
34
  v-if="tagline"
@@ -61,4 +61,10 @@ defineSlots<{
61
61
  margin-top: 8px;
62
62
  margin-bottom: 16px;
63
63
  }
64
+
65
+ @media screen and (width >992px) {
66
+ .muc-intro-content {
67
+ width: 66.6%;
68
+ }
69
+ }
64
70
  </style>
@@ -7,6 +7,7 @@ import { MucDivider } from "./Divider";
7
7
  import {
8
8
  MucCheckbox,
9
9
  MucCheckboxGroup,
10
+ MucCounter,
10
11
  MucErrorList,
11
12
  MucInput,
12
13
  MucRadioButton,
@@ -38,4 +39,5 @@ export {
38
39
  MucIcon,
39
40
  MucDivider,
40
41
  MucLink,
42
+ MucCounter,
41
43
  };