@zap-wunschlachen/wl-shared-components 1.0.37 → 1.0.39
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/App.vue +2 -12
- package/package.json +1 -1
- package/src/assets/css/base.css +2 -0
- package/src/assets/css/variables.css +3 -0
- package/src/components/StagingBanner/StagingBanner.css +19 -0
- package/src/components/StagingBanner/StagingBanner.vue +82 -0
- package/src/components/index.ts +1 -0
- package/src/utils/index.ts +7 -0
- package/public/audio/test.aac +0 -0
- /package/src/components/Icons/{calendar.vue → Calendar.vue} +0 -0
package/App.vue
CHANGED
|
@@ -1,24 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="app">
|
|
3
3
|
<div class="element-container">
|
|
4
|
-
|
|
5
|
-
length="6"
|
|
6
|
-
:boxStyle="{ backgroundColor: siteColors['slot-bg'], color: siteColors['slot-text'] }"
|
|
7
|
-
phone-number="+49123445"
|
|
8
|
-
:loading="true"
|
|
9
|
-
:submit-fn="() => {}"
|
|
10
|
-
:resend-fn="() => {}"
|
|
11
|
-
/> -->
|
|
12
|
-
|
|
13
|
-
<Audio src="public/audio/test.aac" :cloudStatus="false" :showDeleteButton="false"/>
|
|
4
|
+
<StagingBanner show/>
|
|
14
5
|
</div>
|
|
15
6
|
</div>
|
|
16
7
|
</template>
|
|
17
8
|
|
|
18
9
|
<script setup lang="ts">
|
|
19
|
-
import
|
|
10
|
+
import StagingBanner from "@/components/StagingBanner/StagingBanner.vue";
|
|
20
11
|
import { siteColors } from "@/utils/index";
|
|
21
|
-
import Audio from "@/components/Audio/Audio.vue";
|
|
22
12
|
</script>
|
|
23
13
|
|
|
24
14
|
<style scoped>
|
package/package.json
CHANGED
package/src/assets/css/base.css
CHANGED
|
@@ -85,6 +85,7 @@ h6 {
|
|
|
85
85
|
font-style: normal;
|
|
86
86
|
font-weight: 600;
|
|
87
87
|
line-height: 120%;
|
|
88
|
+
color: var(--primary-color);
|
|
88
89
|
}
|
|
89
90
|
|
|
90
91
|
h1 {
|
|
@@ -128,6 +129,7 @@ p,
|
|
|
128
129
|
font-style: normal;
|
|
129
130
|
font-weight: 300;
|
|
130
131
|
line-height: 120%;
|
|
132
|
+
color: var(--primary-color);
|
|
131
133
|
}
|
|
132
134
|
|
|
133
135
|
.p-medium {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.staging-banner {
|
|
2
|
+
position: fixed;
|
|
3
|
+
top: 0;
|
|
4
|
+
left: 0;
|
|
5
|
+
right: 0;
|
|
6
|
+
background: #ff6b35;
|
|
7
|
+
color: white;
|
|
8
|
+
text-align: center;
|
|
9
|
+
padding: 10px;
|
|
10
|
+
z-index: 99999;
|
|
11
|
+
font-weight: bold;
|
|
12
|
+
font-size: 14px;
|
|
13
|
+
font-family: inherit;
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.staging-banner--hidden {
|
|
18
|
+
display: none;
|
|
19
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="isVisible" class="staging-banner">
|
|
3
|
+
{{ displayText }}
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup lang="ts">
|
|
8
|
+
import { computed, onMounted, ref } from 'vue';
|
|
9
|
+
import './StagingBanner.css';
|
|
10
|
+
|
|
11
|
+
const props = defineProps({
|
|
12
|
+
/**
|
|
13
|
+
* Custom text to display in the banner.
|
|
14
|
+
* Default: "⚠️ STAGING - Testumgebung (keine echten Daten)"
|
|
15
|
+
*/
|
|
16
|
+
text: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: ''
|
|
19
|
+
},
|
|
20
|
+
/**
|
|
21
|
+
* Force the banner to show regardless of hostname.
|
|
22
|
+
* Useful for testing or manual control.
|
|
23
|
+
*/
|
|
24
|
+
show: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: undefined
|
|
27
|
+
},
|
|
28
|
+
/**
|
|
29
|
+
* Whether to auto-detect staging based on hostname.
|
|
30
|
+
* Looks for "staging." or "staging-" in the hostname.
|
|
31
|
+
* Default: true
|
|
32
|
+
*/
|
|
33
|
+
autoDetect: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: true
|
|
36
|
+
},
|
|
37
|
+
/**
|
|
38
|
+
* Whether to add padding to the body to account for the banner.
|
|
39
|
+
* Default: true
|
|
40
|
+
*/
|
|
41
|
+
addBodyPadding: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: true
|
|
44
|
+
},
|
|
45
|
+
/**
|
|
46
|
+
* Custom padding value for the body (in pixels).
|
|
47
|
+
* Default: 40
|
|
48
|
+
*/
|
|
49
|
+
bodyPaddingPx: {
|
|
50
|
+
type: Number,
|
|
51
|
+
default: 40
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
const isStaging = ref(false);
|
|
56
|
+
|
|
57
|
+
const displayText = computed(() => {
|
|
58
|
+
return props.text || '⚠️ STAGING - Testumgebung (keine echten Daten)';
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
const isVisible = computed(() => {
|
|
62
|
+
// If show prop is explicitly set, use that
|
|
63
|
+
if (props.show !== undefined) {
|
|
64
|
+
return props.show;
|
|
65
|
+
}
|
|
66
|
+
// Otherwise use auto-detection result
|
|
67
|
+
return props.autoDetect && isStaging.value;
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
onMounted(() => {
|
|
71
|
+
// Check if running in browser
|
|
72
|
+
if (typeof window !== 'undefined') {
|
|
73
|
+
const hostname = window.location.hostname;
|
|
74
|
+
isStaging.value = hostname.includes('staging.') || hostname.includes('staging-');
|
|
75
|
+
|
|
76
|
+
// Add body padding if visible and option is enabled
|
|
77
|
+
if (isVisible.value && props.addBodyPadding) {
|
|
78
|
+
document.body.style.paddingTop = `${props.bodyPaddingPx}px`;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
</script>
|
package/src/components/index.ts
CHANGED
|
@@ -24,5 +24,6 @@ export { default as Loader } from './Loader/Loader.vue';
|
|
|
24
24
|
export { default as AnamneseNotification } from './Appointment/Card/AnamneseNotification.vue';
|
|
25
25
|
export { default as ErrorPage } from './ErrorPage/ErrorPage.vue';
|
|
26
26
|
export { default as MaintenanceBanner } from './MaintenanceBanner/MaintenanceBanner.vue';
|
|
27
|
+
export { default as StagingBanner } from './StagingBanner/StagingBanner.vue';
|
|
27
28
|
export { default as Logo } from './Icons/Logo.vue';
|
|
28
29
|
export { default as MiniLogo } from './Icons/MiniLogo.vue';
|
package/src/utils/index.ts
CHANGED
|
@@ -65,6 +65,7 @@ if (currentDomain.includes("white-cocoon")) {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
let siteColors: any = {
|
|
68
|
+
"primary-color": "var(--Dental-Blue-0)",
|
|
68
69
|
"border-color": "var(--Dental-Blue-0)",
|
|
69
70
|
font_color: "!text-[var(--Dental-Blue-1)]",
|
|
70
71
|
font_color_title: "!text-[var(--Dental-Blue-0)]",
|
|
@@ -84,6 +85,7 @@ let siteColors: any = {
|
|
|
84
85
|
|
|
85
86
|
if (domain.value === "domain-cocoon") {
|
|
86
87
|
siteColors = {
|
|
88
|
+
"primary-color": "var(--Dark-Nude-2)",
|
|
87
89
|
font_color: "!text-[var(--Dark-Nude-3)]",
|
|
88
90
|
font_color_title: "!text-[var(--Dark-Nude-2)]",
|
|
89
91
|
font_color_code: "var(--Dark-Nude-3)",
|
|
@@ -103,6 +105,11 @@ if (domain.value === "domain-cocoon") {
|
|
|
103
105
|
};
|
|
104
106
|
}
|
|
105
107
|
|
|
108
|
+
// Set CSS variable on document root so base.css can use it
|
|
109
|
+
if (typeof document !== 'undefined') {
|
|
110
|
+
document.documentElement.style.setProperty('--primary-color', siteColors["primary-color"]);
|
|
111
|
+
}
|
|
112
|
+
|
|
106
113
|
export {
|
|
107
114
|
siteColors,
|
|
108
115
|
getDomainName,
|
package/public/audio/test.aac
DELETED
|
Binary file
|
|
File without changes
|