@muenchen/muc-patternlab-vue 1.13.0-beta.7 → 1.13.0-beta.8
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/components/Banner/MucBanner.stories.d.ts +70 -0
- package/components/Banner/MucBanner.vue.d.ts +37 -0
- package/components/BuisnessHours/BusinessHours.stories.d.ts +80 -0
- package/components/BuisnessHours/MucBusinessHours.vue.d.ts +56 -0
- package/components/Button/MucButton.stories.d.ts +114 -0
- package/{dist/components → components}/Button/MucButton.vue.d.ts +23 -43
- package/components/Callout/MucCallout.stories.d.ts +77 -0
- package/components/Callout/MucCallout.vue.d.ts +57 -0
- package/components/Card/MucCard.stories.d.ts +117 -0
- package/components/Card/MucCard.vue.d.ts +42 -0
- package/components/Card/MucCardContainer.stories.d.ts +124 -0
- package/components/Card/MucCardContainer.vue.d.ts +24 -0
- package/components/Comment/MucComment.stories.d.ts +82 -0
- package/components/Comment/MucComment.vue.d.ts +89 -0
- package/components/Comment/MucCommentText.stories.d.ts +51 -0
- package/components/Comment/MucCommentText.vue.d.ts +24 -0
- package/{dist/components → components}/Divider/MucDivider.stories.d.ts +1 -1
- package/{dist/components → components}/Divider/MucDivider.vue.d.ts +1 -1
- package/components/Form/MucCheckbox.stories.d.ts +33 -0
- package/components/Form/MucCheckbox.vue.d.ts +18 -0
- package/components/Form/MucCheckboxGroup.stories.d.ts +188 -0
- package/components/Form/MucCheckboxGroup.vue.d.ts +42 -0
- package/components/Form/MucCounter.stories.d.ts +63 -0
- package/components/Form/MucCounter.vue.d.ts +33 -0
- package/components/Form/MucErrorList.stories.d.ts +31 -0
- package/components/Form/MucErrorList.vue.d.ts +8 -0
- package/components/Form/MucInput.stories.d.ts +165 -0
- package/{dist/components → components}/Form/MucInput.vue.d.ts +23 -42
- package/components/Form/MucRadioButton.stories.d.ts +104 -0
- package/components/Form/MucRadioButton.vue.d.ts +38 -0
- package/components/Form/MucRadioButtonGroup.vue.d.ts +38 -0
- package/components/Form/MucSelect.stories.d.ts +82 -0
- package/{dist/components → components}/Form/MucSelect.vue.d.ts +5 -30
- package/components/Form/MucSelectItem.vue.d.ts +9 -0
- package/components/Form/MucTextArea.stories.d.ts +64 -0
- package/components/Form/MucTextArea.vue.d.ts +38 -0
- package/components/Icon/MucIcon.stories.d.ts +33 -0
- package/components/Icon/MucIcon.vue.d.ts +20 -0
- package/components/Intro/MucIntro.stories.d.ts +61 -0
- package/components/Intro/MucIntro.vue.d.ts +50 -0
- package/components/Link/MucLink.stories.d.ts +83 -0
- package/components/Link/MucLink.vue.d.ts +72 -0
- package/components/PercentageSpinner/MucPercentageSpinner.stories.d.ts +32 -0
- package/components/PercentageSpinner/MucPercentageSpinner.vue.d.ts +30 -0
- package/components/PercentageSpinner/index.d.ts +2 -0
- package/{dist/components → components}/index.d.ts +2 -1
- package/muc-patternlab-vue.es.js +1003 -0
- package/package.json +4 -7
- package/{dist/style.css → style.css} +1 -1
- package/LICENSE +0 -21
- package/README.md +0 -111
- package/dist/components/Banner/MucBanner.stories.d.ts +0 -82
- package/dist/components/Banner/MucBanner.vue.d.ts +0 -54
- package/dist/components/BuisnessHours/BusinessHours.stories.d.ts +0 -116
- package/dist/components/BuisnessHours/MucBusinessHours.vue.d.ts +0 -74
- package/dist/components/Button/MucButton.stories.d.ts +0 -158
- package/dist/components/Callout/MucCallout.stories.d.ts +0 -89
- package/dist/components/Callout/MucCallout.vue.d.ts +0 -73
- package/dist/components/Card/MucCard.stories.d.ts +0 -165
- package/dist/components/Card/MucCard.vue.d.ts +0 -46
- package/dist/components/Card/MucCardContainer.stories.d.ts +0 -148
- package/dist/components/Card/MucCardContainer.vue.d.ts +0 -19
- package/dist/components/Comment/MucComment.stories.d.ts +0 -106
- package/dist/components/Comment/MucComment.vue.d.ts +0 -105
- package/dist/components/Comment/MucCommentText.stories.d.ts +0 -93
- package/dist/components/Comment/MucCommentText.vue.d.ts +0 -47
- package/dist/components/Form/MucCheckbox.stories.d.ts +0 -40
- package/dist/components/Form/MucCheckbox.vue.d.ts +0 -26
- package/dist/components/Form/MucCheckboxGroup.stories.d.ts +0 -241
- package/dist/components/Form/MucCheckboxGroup.vue.d.ts +0 -46
- package/dist/components/Form/MucCounter.stories.d.ts +0 -89
- package/dist/components/Form/MucCounter.vue.d.ts +0 -54
- package/dist/components/Form/MucErrorList.stories.d.ts +0 -41
- package/dist/components/Form/MucErrorList.vue.d.ts +0 -17
- package/dist/components/Form/MucInput.stories.d.ts +0 -239
- package/dist/components/Form/MucRadioButton.stories.d.ts +0 -168
- package/dist/components/Form/MucRadioButton.vue.d.ts +0 -59
- package/dist/components/Form/MucRadioButtonGroup.vue.d.ts +0 -54
- package/dist/components/Form/MucSelect.stories.d.ts +0 -116
- package/dist/components/Form/MucSelectItem.vue.d.ts +0 -18
- package/dist/components/Form/MucTextArea.stories.d.ts +0 -94
- package/dist/components/Form/MucTextArea.vue.d.ts +0 -61
- package/dist/components/Icon/MucIcon.stories.d.ts +0 -43
- package/dist/components/Icon/MucIcon.vue.d.ts +0 -29
- package/dist/components/Intro/MucIntro.stories.d.ts +0 -97
- package/dist/components/Intro/MucIntro.vue.d.ts +0 -54
- package/dist/components/Link/MucLink.stories.d.ts +0 -139
- package/dist/components/Link/MucLink.vue.d.ts +0 -92
- package/dist/muc-patternlab-vue.es.js +0 -973
- package/src/components/Banner/MucBanner.stories.ts +0 -47
- package/src/components/Banner/MucBanner.vue +0 -109
- package/src/components/Banner/index.ts +0 -3
- package/src/components/BuisnessHours/BusinessHourType.ts +0 -28
- package/src/components/BuisnessHours/BusinessHours.stories.ts +0 -108
- package/src/components/BuisnessHours/MucBusinessHours.vue +0 -162
- package/src/components/Button/MucButton.stories.ts +0 -63
- package/src/components/Button/MucButton.vue +0 -89
- package/src/components/Button/index.ts +0 -3
- package/src/components/Callout/MucCallout.stories.ts +0 -49
- package/src/components/Callout/MucCallout.vue +0 -140
- package/src/components/Callout/index.ts +0 -3
- package/src/components/Card/MucCard.stories.ts +0 -55
- package/src/components/Card/MucCard.vue +0 -92
- package/src/components/Card/MucCardContainer.stories.ts +0 -43
- package/src/components/Card/MucCardContainer.vue +0 -37
- package/src/components/Card/index.ts +0 -4
- package/src/components/Comment/CommentType.ts +0 -3
- package/src/components/Comment/MucComment.stories.ts +0 -38
- package/src/components/Comment/MucComment.vue +0 -179
- package/src/components/Comment/MucCommentText.stories.ts +0 -38
- package/src/components/Comment/MucCommentText.vue +0 -61
- package/src/components/Comment/index.ts +0 -4
- package/src/components/Divider/MucDivider.stories.ts +0 -19
- package/src/components/Divider/MucDivider.vue +0 -9
- package/src/components/Divider/index.ts +0 -3
- package/src/components/Form/MucCheckbox.stories.ts +0 -25
- package/src/components/Form/MucCheckbox.vue +0 -47
- package/src/components/Form/MucCheckboxGroup.stories.ts +0 -43
- package/src/components/Form/MucCheckboxGroup.vue +0 -80
- package/src/components/Form/MucCounter.stories.ts +0 -47
- package/src/components/Form/MucCounter.vue +0 -128
- package/src/components/Form/MucErrorList.stories.ts +0 -31
- package/src/components/Form/MucErrorList.vue +0 -34
- package/src/components/Form/MucInput.stories.ts +0 -90
- package/src/components/Form/MucInput.vue +0 -198
- package/src/components/Form/MucRadioButton.stories.ts +0 -32
- package/src/components/Form/MucRadioButton.vue +0 -81
- package/src/components/Form/MucRadioButtonGroup.vue +0 -65
- package/src/components/Form/MucRadioButtonTypes.ts +0 -41
- package/src/components/Form/MucSelect.stories.ts +0 -69
- package/src/components/Form/MucSelect.vue +0 -352
- package/src/components/Form/MucSelectItem.vue +0 -25
- package/src/components/Form/MucSelectTypes.ts +0 -8
- package/src/components/Form/MucTextArea.stories.ts +0 -47
- package/src/components/Form/MucTextArea.vue +0 -80
- package/src/components/Form/index.ts +0 -23
- package/src/components/Icon/MucIcon.stories.ts +0 -35
- package/src/components/Icon/MucIcon.vue +0 -29
- package/src/components/Icon/index.ts +0 -3
- package/src/components/Intro/MucIntro.stories.ts +0 -37
- package/src/components/Intro/MucIntro.vue +0 -70
- package/src/components/Intro/index.ts +0 -3
- package/src/components/Link/MucLink.stories.ts +0 -36
- package/src/components/Link/MucLink.vue +0 -74
- package/src/components/Link/index.ts +0 -3
- package/src/components/index.ts +0 -43
- package/src/composables/useOnClickOutside.ts +0 -24
- package/src/index.ts +0 -14
- /package/{dist/assets → assets}/fonts/open-sans/open-sans-v27-latin-700.eot +0 -0
- /package/{dist/assets → assets}/fonts/open-sans/open-sans-v27-latin-700.svg +0 -0
- /package/{dist/assets → assets}/fonts/open-sans/open-sans-v27-latin-700.ttf +0 -0
- /package/{dist/assets → assets}/fonts/open-sans/open-sans-v27-latin-700.woff +0 -0
- /package/{dist/assets → assets}/fonts/open-sans/open-sans-v27-latin-700.woff2 +0 -0
- /package/{dist/assets → assets}/fonts/open-sans/open-sans-v27-latin-italic.eot +0 -0
- /package/{dist/assets → assets}/fonts/open-sans/open-sans-v27-latin-italic.svg +0 -0
- /package/{dist/assets → assets}/fonts/open-sans/open-sans-v27-latin-italic.ttf +0 -0
- /package/{dist/assets → assets}/fonts/open-sans/open-sans-v27-latin-italic.woff +0 -0
- /package/{dist/assets → assets}/fonts/open-sans/open-sans-v27-latin-italic.woff2 +0 -0
- /package/{dist/assets → assets}/fonts/open-sans/open-sans-v27-latin-regular.eot +0 -0
- /package/{dist/assets → assets}/fonts/open-sans/open-sans-v27-latin-regular.svg +0 -0
- /package/{dist/assets → assets}/fonts/open-sans/open-sans-v27-latin-regular.ttf +0 -0
- /package/{dist/assets → assets}/fonts/open-sans/open-sans-v27-latin-regular.woff +0 -0
- /package/{dist/assets → assets}/fonts/open-sans/open-sans-v27-latin-regular.woff2 +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-300.eot +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-300.svg +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-300.ttf +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-300.woff +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-300.woff2 +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-300italic.eot +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-300italic.svg +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-300italic.ttf +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-300italic.woff +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-300italic.woff2 +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-700.eot +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-700.svg +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-700.ttf +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-700.woff +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-700.woff2 +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-700italic.eot +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-700italic.svg +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-700italic.ttf +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-700italic.woff +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-700italic.woff2 +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-italic.eot +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-italic.svg +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-italic.ttf +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-italic.woff +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-italic.woff2 +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-regular.eot +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-regular.svg +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-regular.ttf +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-regular.woff +0 -0
- /package/{dist/assets → assets}/fonts/roboto-condensed/roboto-condensed-v19-latin-regular.woff2 +0 -0
- /package/{dist/assets → assets}/temporary/custom-icons.svg +0 -0
- /package/{dist/assets → assets}/temporary/custom-style.css +0 -0
- /package/{dist/assets → assets}/temporary/muc-icons.svg +0 -0
- /package/{dist/assets → assets}/temporary/muenchende-fontfaces.css +0 -0
- /package/{dist/assets → assets}/temporary/muenchende-style.css +0 -0
- /package/{dist/components → components}/Banner/index.d.ts +0 -0
- /package/{dist/components → components}/BuisnessHours/BusinessHourType.d.ts +0 -0
- /package/{dist/components → components}/Button/index.d.ts +0 -0
- /package/{dist/components → components}/Callout/index.d.ts +0 -0
- /package/{dist/components → components}/Card/index.d.ts +0 -0
- /package/{dist/components → components}/Comment/CommentType.d.ts +0 -0
- /package/{dist/components → components}/Comment/index.d.ts +0 -0
- /package/{dist/components → components}/Divider/index.d.ts +0 -0
- /package/{dist/components → components}/Form/MucRadioButtonTypes.d.ts +0 -0
- /package/{dist/components → components}/Form/MucSelectTypes.d.ts +0 -0
- /package/{dist/components → components}/Form/index.d.ts +0 -0
- /package/{dist/components → components}/Icon/index.d.ts +0 -0
- /package/{dist/components → components}/Intro/index.d.ts +0 -0
- /package/{dist/components → components}/Link/index.d.ts +0 -0
- /package/{dist/composables → composables}/useOnClickOutside.d.ts +0 -0
- /package/{dist/index.d.ts → index.d.ts} +0 -0
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import MucBanner from "./MucBanner.vue";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
component: MucBanner,
|
|
5
|
-
title: "MucBanner",
|
|
6
|
-
tags: ["autodocs"],
|
|
7
|
-
//👇 Our exports that end in "Data" are not stories.
|
|
8
|
-
excludeStories: /.*Data$/,
|
|
9
|
-
parameters: {
|
|
10
|
-
docs: {
|
|
11
|
-
description: {
|
|
12
|
-
component: `A banner-component used for single-line informations. Available in multiple types.
|
|
13
|
-
|
|
14
|
-
[🔗 Patternlab-Docs](https://patternlab.muenchen.space/?p=viewall-elements-banner)
|
|
15
|
-
`,
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export const Default = {
|
|
22
|
-
args: {
|
|
23
|
-
default: "Hi, I'm an Info-Banner!",
|
|
24
|
-
type: "info",
|
|
25
|
-
},
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export const Success = {
|
|
29
|
-
args: {
|
|
30
|
-
default: "Hi, I'm a Success-Banner!",
|
|
31
|
-
type: "success",
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export const Warning = {
|
|
36
|
-
args: {
|
|
37
|
-
default: "Hi, I'm a Warning-Banner!",
|
|
38
|
-
type: "warning",
|
|
39
|
-
},
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export const Emergency = {
|
|
43
|
-
args: {
|
|
44
|
-
default: "Hi, I'm an Emergency-Banner!",
|
|
45
|
-
type: "emergency",
|
|
46
|
-
},
|
|
47
|
-
};
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed } from "vue";
|
|
3
|
-
|
|
4
|
-
import { MucIcon } from "../Icon";
|
|
5
|
-
|
|
6
|
-
type bannerType = "info" | "success" | "warning" | "emergency";
|
|
7
|
-
|
|
8
|
-
const props = withDefaults(
|
|
9
|
-
defineProps<{
|
|
10
|
-
/**
|
|
11
|
-
* Changes the style of the banner. Available types are `info`, `warning` and `emergency`.
|
|
12
|
-
*/
|
|
13
|
-
type?: bannerType;
|
|
14
|
-
}>(),
|
|
15
|
-
{
|
|
16
|
-
type: "info",
|
|
17
|
-
}
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
defineSlots<{
|
|
21
|
-
/**
|
|
22
|
-
* Text-content of the banner.
|
|
23
|
-
*/
|
|
24
|
-
default(): any;
|
|
25
|
-
}>();
|
|
26
|
-
|
|
27
|
-
const typeClass = computed(() => {
|
|
28
|
-
switch (props.type) {
|
|
29
|
-
case "info":
|
|
30
|
-
return "m-banner--info";
|
|
31
|
-
case "success":
|
|
32
|
-
return "m-banner--success";
|
|
33
|
-
case "warning":
|
|
34
|
-
return "m-banner--warning";
|
|
35
|
-
case "emergency":
|
|
36
|
-
return "m-banner--emergency";
|
|
37
|
-
default:
|
|
38
|
-
return "m-banner--info";
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
const typeRole = computed(() => {
|
|
43
|
-
switch (props.type) {
|
|
44
|
-
case "info":
|
|
45
|
-
return "dialog";
|
|
46
|
-
case "success":
|
|
47
|
-
return "dialog";
|
|
48
|
-
case "warning":
|
|
49
|
-
return "alert";
|
|
50
|
-
case "emergency":
|
|
51
|
-
return "alert";
|
|
52
|
-
default:
|
|
53
|
-
return "dialog";
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
const typeAriaLabel = computed(() => {
|
|
58
|
-
switch (props.type) {
|
|
59
|
-
case "info":
|
|
60
|
-
return "Information";
|
|
61
|
-
case "success":
|
|
62
|
-
return "Erfolg";
|
|
63
|
-
case "warning":
|
|
64
|
-
return "Warnung";
|
|
65
|
-
case "emergency":
|
|
66
|
-
return "Emergency";
|
|
67
|
-
default:
|
|
68
|
-
return "Information";
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
const typeIcon = computed(() => {
|
|
73
|
-
switch (props.type) {
|
|
74
|
-
case "success":
|
|
75
|
-
return "check";
|
|
76
|
-
case "warning":
|
|
77
|
-
case "emergency":
|
|
78
|
-
return "warning";
|
|
79
|
-
case "info":
|
|
80
|
-
default:
|
|
81
|
-
return "information";
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
</script>
|
|
85
|
-
|
|
86
|
-
<template>
|
|
87
|
-
<div>
|
|
88
|
-
<div>
|
|
89
|
-
<div
|
|
90
|
-
class="m-banner"
|
|
91
|
-
:class="typeClass"
|
|
92
|
-
:role="typeRole"
|
|
93
|
-
:aria-label="typeAriaLabel"
|
|
94
|
-
>
|
|
95
|
-
<div class="container-fluid">
|
|
96
|
-
<muc-icon :icon="typeIcon" />
|
|
97
|
-
<slot />
|
|
98
|
-
</div>
|
|
99
|
-
</div>
|
|
100
|
-
</div>
|
|
101
|
-
</div>
|
|
102
|
-
</template>
|
|
103
|
-
|
|
104
|
-
<style scoped>
|
|
105
|
-
.m-banner--success {
|
|
106
|
-
background-color: #f1f6f3;
|
|
107
|
-
border-bottom: 1px solid #3a7f53;
|
|
108
|
-
}
|
|
109
|
-
</style>
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shorthand notation of all seven days in german.
|
|
3
|
-
*
|
|
4
|
-
* @typedef {"Mo" | "Di" | "Mi" | "Do" | "Fr" | "Sa" | "So"} WeekDays
|
|
5
|
-
*/
|
|
6
|
-
type WeekDays = "Mo" | "Di" | "Mi" | "Do" | "Fr" | "Sa" | "So";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @typedef {Object} OpeningHour
|
|
10
|
-
* @property {string} from - The start time of the opening period (in 'HH:mm' format).
|
|
11
|
-
* @property {string} to - The end time of the opening period (in 'HH:mm' format).
|
|
12
|
-
*/
|
|
13
|
-
type OpeningHour = {
|
|
14
|
-
from: string;
|
|
15
|
-
to: string;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* @typedef {Object} BusinessHourType
|
|
20
|
-
* @property {WeekDays} weekDay - The day of the week for which the opening hours apply.
|
|
21
|
-
* @property {OpeningHour[]} openingHours - A list of opening hours for the specified day of the week.
|
|
22
|
-
*/
|
|
23
|
-
type BusinessHourType = {
|
|
24
|
-
weekDay: WeekDays;
|
|
25
|
-
openingHours: OpeningHour[];
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export type { BusinessHourType, OpeningHour, WeekDays };
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import MucBusinessHours from "./MucBusinessHours.vue";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
component: MucBusinessHours,
|
|
5
|
-
title: "MucBusinessHours",
|
|
6
|
-
tags: ["autodocs"],
|
|
7
|
-
// 👇 Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked
|
|
8
|
-
parameters: {
|
|
9
|
-
docs: {
|
|
10
|
-
description: {
|
|
11
|
-
component: `
|
|
12
|
-
The businessHours component is used to display the business hours for each day of the week.
|
|
13
|
-
The current day is highlighted as well as the days that are closed.
|
|
14
|
-
In the toggleable variant, the current day and the opening hours are also displayed on the toggle button.
|
|
15
|
-
|
|
16
|
-
[🔗 Patternlab-Docs](https://patternlab.muenchen.space/?p=viewall-components-business-hours)
|
|
17
|
-
`,
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const businessHours = [
|
|
24
|
-
{
|
|
25
|
-
weekDay: "Mo",
|
|
26
|
-
openingHours: [
|
|
27
|
-
{
|
|
28
|
-
from: "08:00",
|
|
29
|
-
to: "12:00",
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
from: "14:00",
|
|
33
|
-
to: "18:00",
|
|
34
|
-
},
|
|
35
|
-
],
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
weekDay: "Di",
|
|
39
|
-
openingHours: [
|
|
40
|
-
{
|
|
41
|
-
from: "09:00",
|
|
42
|
-
to: "13:00",
|
|
43
|
-
},
|
|
44
|
-
],
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
weekDay: "Mi",
|
|
48
|
-
openingHours: [
|
|
49
|
-
{
|
|
50
|
-
from: "10:00",
|
|
51
|
-
to: "14:00",
|
|
52
|
-
},
|
|
53
|
-
],
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
weekDay: "Do",
|
|
57
|
-
openingHours: [
|
|
58
|
-
{
|
|
59
|
-
from: "08:00",
|
|
60
|
-
to: "12:00",
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
from: "15:00",
|
|
64
|
-
to: "19:00",
|
|
65
|
-
},
|
|
66
|
-
],
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
weekDay: "Fr",
|
|
70
|
-
openingHours: [
|
|
71
|
-
{
|
|
72
|
-
from: "08:00",
|
|
73
|
-
to: "12:00",
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
from: "13:00",
|
|
77
|
-
to: "17:00",
|
|
78
|
-
},
|
|
79
|
-
],
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
weekDay: "Sa",
|
|
83
|
-
openingHours: [
|
|
84
|
-
{
|
|
85
|
-
from: "10:00",
|
|
86
|
-
to: "13:00",
|
|
87
|
-
},
|
|
88
|
-
],
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
weekDay: "So",
|
|
92
|
-
openingHours: [],
|
|
93
|
-
},
|
|
94
|
-
];
|
|
95
|
-
|
|
96
|
-
export const Default = {
|
|
97
|
-
args: {
|
|
98
|
-
businessHours: businessHours,
|
|
99
|
-
toggleable: true,
|
|
100
|
-
},
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
export const Fixed = {
|
|
104
|
-
args: {
|
|
105
|
-
...Default.args,
|
|
106
|
-
toggleable: false,
|
|
107
|
-
},
|
|
108
|
-
};
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="m-business-hours-toggle">
|
|
3
|
-
<h3 class="m-business-hours-toggle__title visually-hidden">
|
|
4
|
-
Öffnungszeiten
|
|
5
|
-
</h3>
|
|
6
|
-
<button
|
|
7
|
-
v-if="toggleable"
|
|
8
|
-
@click="toggleCollapsable"
|
|
9
|
-
class="m-business-hours-toggle__trigger is-open"
|
|
10
|
-
:class="collapsedClass"
|
|
11
|
-
type="button"
|
|
12
|
-
data-bs-toggle="collapse"
|
|
13
|
-
:aria-expanded="!collapsed"
|
|
14
|
-
>
|
|
15
|
-
<muc-icon
|
|
16
|
-
:icon="icon"
|
|
17
|
-
class="icon icon--before"
|
|
18
|
-
/>
|
|
19
|
-
<div v-if="todaysBusinessHours">
|
|
20
|
-
<span> {{ todaysBusinessHours.weekDay }} geöffnet </span>
|
|
21
|
-
<span
|
|
22
|
-
v-for="(time, index) in todaysBusinessHours.openingHours"
|
|
23
|
-
:key="index"
|
|
24
|
-
>
|
|
25
|
-
{{ time.from }} bis {{ time.to }}
|
|
26
|
-
<span v-if="index < todaysBusinessHours.openingHours.length - 1">
|
|
27
|
-
und
|
|
28
|
-
</span>
|
|
29
|
-
</span>
|
|
30
|
-
</div>
|
|
31
|
-
<muc-icon
|
|
32
|
-
icon="chevron-down"
|
|
33
|
-
class="icon icon--after"
|
|
34
|
-
/>
|
|
35
|
-
</button>
|
|
36
|
-
<div
|
|
37
|
-
class="m-business-hours-toggle__content"
|
|
38
|
-
:class="collapseClass"
|
|
39
|
-
>
|
|
40
|
-
<ul class="ml-0">
|
|
41
|
-
<li
|
|
42
|
-
v-for="day in businessHours"
|
|
43
|
-
:key="day.weekDay"
|
|
44
|
-
:class="highlightBusinessDay(day)"
|
|
45
|
-
>
|
|
46
|
-
<span class="weekday">{{ day.weekDay }}</span>
|
|
47
|
-
<span class="hours">
|
|
48
|
-
<div v-if="day.openingHours.length === 0">geschlossen</div>
|
|
49
|
-
<div
|
|
50
|
-
v-else
|
|
51
|
-
v-for="time in day.openingHours"
|
|
52
|
-
:key="time.from"
|
|
53
|
-
>
|
|
54
|
-
{{ time.from }} - {{ time.to }}
|
|
55
|
-
</div>
|
|
56
|
-
</span>
|
|
57
|
-
</li>
|
|
58
|
-
</ul>
|
|
59
|
-
<div
|
|
60
|
-
v-if="slots['hint']"
|
|
61
|
-
class="hint"
|
|
62
|
-
>
|
|
63
|
-
<slot name="hint" />
|
|
64
|
-
</div>
|
|
65
|
-
</div>
|
|
66
|
-
</div>
|
|
67
|
-
</template>
|
|
68
|
-
|
|
69
|
-
<script setup lang="ts">
|
|
70
|
-
import { computed, ref } from "vue";
|
|
71
|
-
|
|
72
|
-
import { MucIcon } from "../Icon";
|
|
73
|
-
import { BusinessHourType } from "./BusinessHourType";
|
|
74
|
-
|
|
75
|
-
const LOCALES = "de-DE";
|
|
76
|
-
|
|
77
|
-
const props = withDefaults(
|
|
78
|
-
defineProps<{
|
|
79
|
-
/**
|
|
80
|
-
* This array includes all the opening hours for all days of the week.
|
|
81
|
-
*/
|
|
82
|
-
businessHours: BusinessHourType[];
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Lets you choose between the toggleable and fixed state of the component.
|
|
86
|
-
* In the fixed state, no toggle button will be shown.
|
|
87
|
-
*/
|
|
88
|
-
toggleable?: boolean;
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Choose an icon for the toggle button. The default if none is given is the time icon.
|
|
92
|
-
*/
|
|
93
|
-
icon?: string;
|
|
94
|
-
}>(),
|
|
95
|
-
{
|
|
96
|
-
icon: "time",
|
|
97
|
-
toggleable: false,
|
|
98
|
-
}
|
|
99
|
-
);
|
|
100
|
-
|
|
101
|
-
let collapsed = ref(props.toggleable);
|
|
102
|
-
|
|
103
|
-
const slots = defineSlots<{
|
|
104
|
-
/**
|
|
105
|
-
* Display a hint beneath all the opening hours.
|
|
106
|
-
*/
|
|
107
|
-
hint(): any;
|
|
108
|
-
}>();
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* Toggles the collapsed state of the business hours section.
|
|
112
|
-
*/
|
|
113
|
-
const toggleCollapsable = () => {
|
|
114
|
-
collapsed.value = !collapsed.value;
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Computes the CSS class for the collapse state.
|
|
119
|
-
*
|
|
120
|
-
* @returns {string} The CSS class for the collapse state.
|
|
121
|
-
*/
|
|
122
|
-
const collapseClass = computed(() => (collapsed.value ? "collapse" : ""));
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Computes the CSS class for the collapsed state.
|
|
126
|
-
*
|
|
127
|
-
* @returns {string} The CSS class for the collapsed state.
|
|
128
|
-
*/
|
|
129
|
-
const collapsedClass = computed(() => (collapsed.value ? "collapsed" : ""));
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* Computes the short name of today's day.
|
|
133
|
-
*
|
|
134
|
-
* @returns {string} The short name of today's day (e.g., "Mo", "Di").
|
|
135
|
-
*/
|
|
136
|
-
const todaysDayShortName = computed(() => {
|
|
137
|
-
const today = new Date();
|
|
138
|
-
return today.toLocaleDateString(LOCALES, { weekday: "short" });
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Highlights the business day based on whether it has opening hours and if it is today's day.
|
|
143
|
-
*
|
|
144
|
-
* @param {BusinessHourType} businessHour - The business hour object to check.
|
|
145
|
-
* @returns {string} The CSS class indicating if the business is open or closed.
|
|
146
|
-
*/
|
|
147
|
-
const highlightBusinessDay = (businessHour: BusinessHourType) => {
|
|
148
|
-
if (businessHour.openingHours.length === 0) return "is-closed";
|
|
149
|
-
if (businessHour.weekDay === todaysDayShortName.value) return "is-open";
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* Computes today's business hours from the provided business hours.
|
|
154
|
-
*
|
|
155
|
-
* @returns {BusinessHourType | undefined} The business hours for today, if available.
|
|
156
|
-
*/
|
|
157
|
-
const todaysBusinessHours = computed(() =>
|
|
158
|
-
props.businessHours.find((curr) => curr.weekDay === todaysDayShortName.value)
|
|
159
|
-
);
|
|
160
|
-
</script>
|
|
161
|
-
|
|
162
|
-
<style scoped></style>
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { fn } from "@storybook/test";
|
|
2
|
-
|
|
3
|
-
import MucButton from "./MucButton.vue";
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
component: MucButton,
|
|
7
|
-
title: "MucButton",
|
|
8
|
-
tags: ["autodocs"],
|
|
9
|
-
// 👇 Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked
|
|
10
|
-
args: { onClick: fn() },
|
|
11
|
-
parameters: {
|
|
12
|
-
docs: {
|
|
13
|
-
description: {
|
|
14
|
-
component: `The \`muc-button\` component themes the standard html button using the style from patternlab.
|
|
15
|
-
|
|
16
|
-
[🔗 Patternlab-Docs](https://patternlab.muenchen.space/?p=viewall-elements-buttons)
|
|
17
|
-
`,
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export const Default = {
|
|
24
|
-
args: {
|
|
25
|
-
default: "Primary",
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export const Secondary = {
|
|
30
|
-
args: {
|
|
31
|
-
default: "Secondary",
|
|
32
|
-
variant: "secondary",
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export const Ghost = {
|
|
37
|
-
args: {
|
|
38
|
-
default: "Ghost",
|
|
39
|
-
variant: "ghost",
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export const Disabled = {
|
|
44
|
-
args: {
|
|
45
|
-
default: "Disabled",
|
|
46
|
-
disabled: true,
|
|
47
|
-
},
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export const Icon = {
|
|
51
|
-
args: {
|
|
52
|
-
default: "With Icon",
|
|
53
|
-
icon: "arrow-right",
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export const IconAnimated = {
|
|
58
|
-
args: {
|
|
59
|
-
default: "With Icon",
|
|
60
|
-
icon: "arrow-right",
|
|
61
|
-
iconAnimated: true,
|
|
62
|
-
},
|
|
63
|
-
};
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<button
|
|
3
|
-
@click="handleClick"
|
|
4
|
-
:disabled="disabled"
|
|
5
|
-
class="m-button"
|
|
6
|
-
:class="[buttonVariantClass, iconAnimatedClass]"
|
|
7
|
-
>
|
|
8
|
-
<span>
|
|
9
|
-
<slot />
|
|
10
|
-
<muc-icon
|
|
11
|
-
v-if="icon"
|
|
12
|
-
:icon="icon"
|
|
13
|
-
class="m-button__icon"
|
|
14
|
-
/>
|
|
15
|
-
</span>
|
|
16
|
-
</button>
|
|
17
|
-
</template>
|
|
18
|
-
|
|
19
|
-
<script setup lang="ts">
|
|
20
|
-
import { computed } from "vue";
|
|
21
|
-
|
|
22
|
-
import { MucIcon } from "../Icon";
|
|
23
|
-
|
|
24
|
-
type buttonType = "primary" | "secondary" | "ghost";
|
|
25
|
-
|
|
26
|
-
const props = withDefaults(
|
|
27
|
-
defineProps<{
|
|
28
|
-
/**
|
|
29
|
-
* The variant prop gives you easy access to several different button styles.
|
|
30
|
-
*
|
|
31
|
-
* Available are `primary`, `secondary` and `ghost`.
|
|
32
|
-
*/
|
|
33
|
-
variant?: buttonType;
|
|
34
|
-
/**
|
|
35
|
-
* Let`s you indicate that the button is not currently interactive or clickable.
|
|
36
|
-
*/
|
|
37
|
-
disabled?: boolean;
|
|
38
|
-
/**
|
|
39
|
-
* Choose an icon to be appended behind the slot. No icon will be placed if the prop is left empty.
|
|
40
|
-
*/
|
|
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;
|
|
48
|
-
}>(),
|
|
49
|
-
{
|
|
50
|
-
variant: "primary",
|
|
51
|
-
disabled: false,
|
|
52
|
-
iconAnimated: false,
|
|
53
|
-
}
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
defineSlots<{
|
|
57
|
-
/**
|
|
58
|
-
* Display content inside the button.
|
|
59
|
-
*/
|
|
60
|
-
default(): any;
|
|
61
|
-
}>();
|
|
62
|
-
|
|
63
|
-
const emit = defineEmits<{
|
|
64
|
-
/**
|
|
65
|
-
* Triggered when button is clicked.
|
|
66
|
-
* @param e Click-Event
|
|
67
|
-
*/
|
|
68
|
-
(e: "click"): void;
|
|
69
|
-
}>();
|
|
70
|
-
|
|
71
|
-
const buttonVariantClass = computed(() => {
|
|
72
|
-
switch (props.variant) {
|
|
73
|
-
case "secondary":
|
|
74
|
-
return "m-button--secondary";
|
|
75
|
-
case "ghost":
|
|
76
|
-
return "m-button--ghost";
|
|
77
|
-
default:
|
|
78
|
-
return "m-button--primary";
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
const iconAnimatedClass = computed(() =>
|
|
83
|
-
props.iconAnimated ? "m-button--animated-right" : ""
|
|
84
|
-
);
|
|
85
|
-
|
|
86
|
-
const handleClick = () => {
|
|
87
|
-
emit("click");
|
|
88
|
-
};
|
|
89
|
-
</script>
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import MucCallout from "./MucCallout.vue";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
component: MucCallout,
|
|
5
|
-
title: "MucCallout",
|
|
6
|
-
tags: ["autodocs"],
|
|
7
|
-
parameters: {
|
|
8
|
-
docs: {
|
|
9
|
-
description: {
|
|
10
|
-
component: `The \`muc-callout\` component is used to convey important information to the user through the use of contextual types, icons, and colors.
|
|
11
|
-
|
|
12
|
-
[🔗 Patternlab-Docs](https://patternlab.muenchen.space/?p=viewall-components-callout)
|
|
13
|
-
`,
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export const Default = {
|
|
20
|
-
args: {
|
|
21
|
-
header: "Information",
|
|
22
|
-
content: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
|
|
23
|
-
type: "info",
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export const Success = {
|
|
28
|
-
args: {
|
|
29
|
-
...Default.args,
|
|
30
|
-
header: "Success",
|
|
31
|
-
type: "success",
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export const Warning = {
|
|
36
|
-
args: {
|
|
37
|
-
...Default.args,
|
|
38
|
-
header: "Warning",
|
|
39
|
-
type: "warning",
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export const Error = {
|
|
44
|
-
args: {
|
|
45
|
-
...Default.args,
|
|
46
|
-
header: "Error",
|
|
47
|
-
type: "error",
|
|
48
|
-
},
|
|
49
|
-
};
|