@muenchen/muc-patternlab-vue 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.cjs +15 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- package/.github/workflows/build.yaml +23 -0
- package/.prettierrc.json +8 -0
- package/.vscode/extensions.json +8 -0
- package/CODE_OF_CONDUCT.md +127 -0
- package/LICENSE +21 -0
- package/README.md +81 -0
- package/docs/.gitkeep +0 -0
- package/docs/images/logo-footer-muenchen-de.svg +1 -0
- package/env.d.ts +1 -0
- package/index.html +18 -0
- package/package.json +57 -0
- package/public/assets/temporary/muc-icons.svg +109 -0
- package/public/assets/temporary/muenchende-fontfaces.css +47 -0
- package/public/assets/temporary/muenchende-style.css +1 -0
- package/renovate.json +6 -0
- package/src/App.vue +69 -0
- package/src/components/Banner/MucBanner.vue +73 -0
- package/src/components/Banner/index.ts +3 -0
- package/src/components/Button/MucButton.vue +18 -0
- package/src/components/Button/index.ts +3 -0
- package/src/components/Intro/MucIntro.vue +24 -0
- package/src/components/Intro/index.ts +3 -0
- package/src/components/index.ts +5 -0
- package/src/index.js +12 -0
- package/src/main.ts +4 -0
- package/tsconfig.app.json +14 -0
- package/tsconfig.json +14 -0
- package/tsconfig.node.json +19 -0
- package/tsconfig.vitest.json +11 -0
- package/vite.config.ts +39 -0
- package/vitest.config.ts +14 -0
package/renovate.json
ADDED
package/src/App.vue
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import sprites from "@/assets/temporary/muc-icons.svg?raw";
|
|
3
|
+
|
|
4
|
+
import MucButton from '@/components/Button/MucButton.vue';
|
|
5
|
+
import MucBanner from '@/components/Banner/MucBanner.vue';
|
|
6
|
+
import MucIntro from "@/components/Intro/MucIntro.vue";
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<div>
|
|
11
|
+
<svg
|
|
12
|
+
style="display: none;"
|
|
13
|
+
v-html="sprites">
|
|
14
|
+
</svg>
|
|
15
|
+
|
|
16
|
+
<table>
|
|
17
|
+
<tr>
|
|
18
|
+
<th>MucButton</th>
|
|
19
|
+
<td><muc-button>Test Me!</muc-button></td>
|
|
20
|
+
</tr>
|
|
21
|
+
<tr>
|
|
22
|
+
<th>MucBanner info</th>
|
|
23
|
+
<td>
|
|
24
|
+
<muc-banner type="info">
|
|
25
|
+
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt <a href="#">Mehr erfahren</a>
|
|
26
|
+
</muc-banner>
|
|
27
|
+
</td>
|
|
28
|
+
</tr>
|
|
29
|
+
<tr>
|
|
30
|
+
<th>MucBanner warning</th>
|
|
31
|
+
<td>
|
|
32
|
+
<muc-banner type="warning">
|
|
33
|
+
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt <a href="#">Mehr erfahren</a>
|
|
34
|
+
</muc-banner>
|
|
35
|
+
</td>
|
|
36
|
+
</tr>
|
|
37
|
+
<tr>
|
|
38
|
+
<th>MucBanner emergency</th>
|
|
39
|
+
<td>
|
|
40
|
+
<muc-banner type="emergency">
|
|
41
|
+
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt <a href="#">Mehr erfahren</a>
|
|
42
|
+
</muc-banner>
|
|
43
|
+
</td>
|
|
44
|
+
</tr>
|
|
45
|
+
<tr>
|
|
46
|
+
<th>MucIntro</th>
|
|
47
|
+
<td>
|
|
48
|
+
<muc-intro title="Testtitel">
|
|
49
|
+
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt <a href="#">Mehr erfahren</a>
|
|
50
|
+
</muc-intro>
|
|
51
|
+
</td>
|
|
52
|
+
</tr>
|
|
53
|
+
</table>
|
|
54
|
+
</div>
|
|
55
|
+
</template>
|
|
56
|
+
|
|
57
|
+
<style>
|
|
58
|
+
@import "@/assets/temporary/muenchende-style.css";
|
|
59
|
+
|
|
60
|
+
table {
|
|
61
|
+
width: 100%;
|
|
62
|
+
height: 100%;
|
|
63
|
+
border: 1px solid lightgray;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
th, td {
|
|
67
|
+
padding: 8px;
|
|
68
|
+
}
|
|
69
|
+
</style>
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import {computed, type PropType} from "vue";
|
|
3
|
+
|
|
4
|
+
type bannerType = "info" | "warning" | "emergency";
|
|
5
|
+
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
type: {
|
|
8
|
+
type: String as PropType<bannerType>,
|
|
9
|
+
default: "info"
|
|
10
|
+
}
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
const typeClass = computed(() => {
|
|
14
|
+
switch (props.type) {
|
|
15
|
+
case "info":
|
|
16
|
+
return "m-banner--info";
|
|
17
|
+
case "warning":
|
|
18
|
+
return "m-banner--emergency";
|
|
19
|
+
case "emergency":
|
|
20
|
+
return "m-banner--warning";
|
|
21
|
+
default:
|
|
22
|
+
return "m-banner--info";
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const typeRole = computed(() => {
|
|
27
|
+
switch (props.type) {
|
|
28
|
+
case "info":
|
|
29
|
+
return "dialog";
|
|
30
|
+
case "warning":
|
|
31
|
+
return "alert";
|
|
32
|
+
case "emergency":
|
|
33
|
+
return "alert";
|
|
34
|
+
default:
|
|
35
|
+
return "dialog";
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
const typeAriaLabel = computed(() => {
|
|
40
|
+
switch (props.type) {
|
|
41
|
+
case "info":
|
|
42
|
+
return "Information";
|
|
43
|
+
case "warning":
|
|
44
|
+
return "Warnung";
|
|
45
|
+
case "emergency":
|
|
46
|
+
return "Emergency";
|
|
47
|
+
default:
|
|
48
|
+
return "dialog";
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
<template>
|
|
54
|
+
<div>
|
|
55
|
+
<div>
|
|
56
|
+
<div
|
|
57
|
+
class="m-banner"
|
|
58
|
+
:class="typeClass"
|
|
59
|
+
:role="typeRole"
|
|
60
|
+
:aria-label="typeAriaLabel"
|
|
61
|
+
>
|
|
62
|
+
<div class="container-fluid">
|
|
63
|
+
<svg class="icon">
|
|
64
|
+
<use href="#icon-information"/>
|
|
65
|
+
</svg>
|
|
66
|
+
<p>
|
|
67
|
+
<slot/>
|
|
68
|
+
</p>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
</template>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const props = defineProps({
|
|
3
|
+
expanded: {
|
|
4
|
+
type: Boolean,
|
|
5
|
+
default: false
|
|
6
|
+
}
|
|
7
|
+
})
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<button class="m-button m-button--primary m-button--animated-right">
|
|
12
|
+
<slot />
|
|
13
|
+
</button>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<style scoped>
|
|
17
|
+
|
|
18
|
+
</style>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
defineProps({
|
|
3
|
+
title: {
|
|
4
|
+
type: String
|
|
5
|
+
}
|
|
6
|
+
})
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<div class="m-intro m-intro-summary-text">
|
|
11
|
+
<div class="container">
|
|
12
|
+
<div class="m-intro-summary-text__body">
|
|
13
|
+
<div class="m-intro-summary-text__grid">
|
|
14
|
+
<div class="m-intro-summary-text__content">
|
|
15
|
+
<h1 class="m-intro-summary-text__title">{{ title }}</h1>
|
|
16
|
+
<p>
|
|
17
|
+
<slot></slot>
|
|
18
|
+
</p>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
package/src/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as components from './components';
|
|
2
|
+
|
|
3
|
+
const componentsList = components?.default;
|
|
4
|
+
const MucComponents = {
|
|
5
|
+
install(Vue) {
|
|
6
|
+
Object.keys(componentsList).forEach(name => {
|
|
7
|
+
Vue.component(name, componentsList[name]);
|
|
8
|
+
})
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default MucComponents;
|
package/src/main.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "@vue/tsconfig/tsconfig.dom.json",
|
|
3
|
+
"include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
|
|
4
|
+
"exclude": ["src/**/__tests__/*"],
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"composite": true,
|
|
7
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
8
|
+
|
|
9
|
+
"baseUrl": ".",
|
|
10
|
+
"paths": {
|
|
11
|
+
"@/*": ["./src/*"]
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "@tsconfig/node20/tsconfig.json",
|
|
3
|
+
"include": [
|
|
4
|
+
"vite.config.*",
|
|
5
|
+
"vitest.config.*",
|
|
6
|
+
"cypress.config.*",
|
|
7
|
+
"nightwatch.conf.*",
|
|
8
|
+
"playwright.config.*"
|
|
9
|
+
],
|
|
10
|
+
"compilerOptions": {
|
|
11
|
+
"composite": true,
|
|
12
|
+
"noEmit": true,
|
|
13
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
|
14
|
+
|
|
15
|
+
"module": "ESNext",
|
|
16
|
+
"moduleResolution": "Bundler",
|
|
17
|
+
"types": ["node"]
|
|
18
|
+
}
|
|
19
|
+
}
|
package/vite.config.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { fileURLToPath, URL } from 'node:url'
|
|
2
|
+
|
|
3
|
+
import { resolve } from 'path'
|
|
4
|
+
import { defineConfig } from 'vite'
|
|
5
|
+
import vue from '@vitejs/plugin-vue'
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
// https://vitejs.dev/config/
|
|
9
|
+
export default defineConfig({
|
|
10
|
+
plugins: [
|
|
11
|
+
vue()
|
|
12
|
+
],
|
|
13
|
+
build: {
|
|
14
|
+
lib: {
|
|
15
|
+
// Could also be a dictionary or array of multiple entry points
|
|
16
|
+
entry: resolve(__dirname, 'src/index.js'),
|
|
17
|
+
name: 'muc-patternlab-vue',
|
|
18
|
+
// the proper extensions will be added
|
|
19
|
+
fileName: 'muc-patternlab-vue',
|
|
20
|
+
},
|
|
21
|
+
rollupOptions: {
|
|
22
|
+
// make sure to externalize deps that shouldn't be bundled
|
|
23
|
+
// into your library
|
|
24
|
+
external: ['vue'],
|
|
25
|
+
output: {
|
|
26
|
+
// Provide global variables to use in the UMD build
|
|
27
|
+
// for externalized deps
|
|
28
|
+
globals: {
|
|
29
|
+
vue: 'Vue',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
resolve: {
|
|
35
|
+
alias: {
|
|
36
|
+
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
})
|
package/vitest.config.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { fileURLToPath } from 'node:url'
|
|
2
|
+
import { mergeConfig, defineConfig, configDefaults } from 'vitest/config'
|
|
3
|
+
import viteConfig from './vite.config'
|
|
4
|
+
|
|
5
|
+
export default mergeConfig(
|
|
6
|
+
viteConfig,
|
|
7
|
+
defineConfig({
|
|
8
|
+
test: {
|
|
9
|
+
environment: 'jsdom',
|
|
10
|
+
exclude: [...configDefaults.exclude, 'e2e/*'],
|
|
11
|
+
root: fileURLToPath(new URL('./', import.meta.url))
|
|
12
|
+
}
|
|
13
|
+
})
|
|
14
|
+
)
|