@dargmuesli/nuxt-vio 3.0.0-beta.14 → 3.0.0-beta.16

Sign up to get free protection for your applications and to get access to all the features.
@@ -51,7 +51,7 @@
51
51
  />
52
52
  <div v-if="validationProperty && isValidatable">
53
53
  <VioFormInputIconWrapper v-if="validationProperty.$pending">
54
- <IconHourglass
54
+ <VioIconHourglass
55
55
  class="text-blue-600"
56
56
  :title="t('globalStatusLoading')"
57
57
  />
@@ -61,14 +61,14 @@
61
61
  validationProperty.$model && !validationProperty.$invalid
62
62
  "
63
63
  >
64
- <IconCheckCircle class="text-green-600" :title="t('valid')" />
64
+ <VioIconCheckCircle class="text-green-600" :title="t('valid')" />
65
65
  </VioFormInputIconWrapper>
66
66
  <VioFormInputIconWrapper
67
67
  v-else-if="
68
68
  validationProperty.$model && validationProperty.$invalid
69
69
  "
70
70
  >
71
- <IconExclamationCircle
71
+ <VioIconExclamationCircle
72
72
  class="text-red-600"
73
73
  :title="t('validNot')"
74
74
  />
@@ -11,7 +11,7 @@
11
11
  "
12
12
  class="text-red-600"
13
13
  >
14
- <IconExclamationCircle v-if="formInput && validationProperty" />
14
+ <VioIconExclamationCircle v-if="formInput && validationProperty" />
15
15
  <slot />
16
16
  </VioFormInputState>
17
17
  </template>
@@ -11,7 +11,7 @@
11
11
  "
12
12
  class="text-gray-500 dark:text-gray-400"
13
13
  >
14
- <IconInformationCircle />
14
+ <VioIconInformationCircle />
15
15
  <slot />
16
16
  </VioFormInputState>
17
17
  </template>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <IconContainer
2
+ <VioIconContainer
3
3
  fill="none"
4
4
  viewBox="0 0 24 24"
5
5
  stroke="currentColor"
@@ -11,7 +11,7 @@
11
11
  stroke-linejoin="round"
12
12
  d="M14 5l7 7m0 0l-7 7m7-7H3"
13
13
  />
14
- </IconContainer>
14
+ </VioIconContainer>
15
15
  </template>
16
16
 
17
17
  <script setup lang="ts">
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <IconContainer
2
+ <VioIconContainer
3
3
  fill="none"
4
4
  viewBox="0 0 24 24"
5
5
  stroke="currentColor"
@@ -11,7 +11,7 @@
11
11
  stroke-width="2"
12
12
  d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"
13
13
  />
14
- </IconContainer>
14
+ </VioIconContainer>
15
15
  </template>
16
16
 
17
17
  <script setup lang="ts">
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <IconContainer
2
+ <VioIconContainer
3
3
  viewBox="0 0 20 20"
4
4
  fill="currentColor"
5
5
  :title="title || t('title')"
@@ -9,7 +9,7 @@
9
9
  d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z"
10
10
  clip-rule="evenodd"
11
11
  />
12
- </IconContainer>
12
+ </VioIconContainer>
13
13
  </template>
14
14
 
15
15
  <script setup lang="ts">
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <IconContainer
2
+ <VioIconContainer
3
3
  fill="none"
4
4
  viewBox="0 0 24 24"
5
5
  stroke="currentColor"
@@ -11,7 +11,7 @@
11
11
  stroke-width="2"
12
12
  d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"
13
13
  />
14
- </IconContainer>
14
+ </VioIconContainer>
15
15
  </template>
16
16
 
17
17
  <script setup lang="ts">
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <IconContainer
2
+ <VioIconContainer
3
3
  viewBox="0 0 20 20"
4
4
  fill="currentColor"
5
5
  :title="title || t('title')"
@@ -9,7 +9,7 @@
9
9
  d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z"
10
10
  clip-rule="evenodd"
11
11
  />
12
- </IconContainer>
12
+ </VioIconContainer>
13
13
  </template>
14
14
 
15
15
  <script setup lang="ts">
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <IconContainer
2
+ <VioIconContainer
3
3
  fill="none"
4
4
  viewBox="0 0 24 24"
5
5
  stroke="currentColor"
@@ -11,7 +11,7 @@
11
11
  stroke-width="2"
12
12
  d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"
13
13
  />
14
- </IconContainer>
14
+ </VioIconContainer>
15
15
  </template>
16
16
 
17
17
  <script setup lang="ts">
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <IconContainer
2
+ <VioIconContainer
3
3
  aria-hidden="true"
4
4
  focusable="false"
5
5
  data-prefix="fas"
@@ -12,7 +12,7 @@
12
12
  fill="currentColor"
13
13
  d="M352 0C369.7 0 384 14.33 384 32C384 49.67 369.7 64 352 64V74.98C352 117.4 335.1 158.1 305.1 188.1L237.3 256L305.1 323.9C335.1 353.9 352 394.6 352 437V448C369.7 448 384 462.3 384 480C384 497.7 369.7 512 352 512H32C14.33 512 0 497.7 0 480C0 462.3 14.33 448 32 448V437C32 394.6 48.86 353.9 78.86 323.9L146.7 256L78.86 188.1C48.86 158.1 32 117.4 32 74.98V64C14.33 64 0 49.67 0 32C0 14.33 14.33 0 32 0H352zM111.1 128H272C282.4 112.4 288 93.98 288 74.98V64H96V74.98C96 93.98 101.6 112.4 111.1 128zM111.1 384H272C268.5 378.7 264.5 373.7 259.9 369.1L192 301.3L124.1 369.1C119.5 373.7 115.5 378.7 111.1 384V384z"
14
14
  />
15
- </IconContainer>
15
+ </VioIconContainer>
16
16
  </template>
17
17
 
18
18
  <script setup lang="ts">
@@ -6,7 +6,7 @@
6
6
  :is-colored="false"
7
7
  :to="localePath('/')"
8
8
  >
9
- <IconHome classes="h-6 w-6" />
9
+ <VioIconHome classes="h-6 w-6" />
10
10
  </VioLink>
11
11
  <ul v-if="prefixes" class="flex items-center gap-2">
12
12
  <li
@@ -3,7 +3,7 @@
3
3
  <div class="flex flex-col gap-8">
4
4
  <div class="flex items-center">
5
5
  <VioLayoutHr />
6
- <IconLogo class="mx-12 h-12 w-12 opacity-60 brightness-0 invert" />
6
+ <slot name="logo" />
7
7
  <VioLayoutHr />
8
8
  </div>
9
9
  <!-- Justifying evenly, instead of "between", centers a single element. -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dargmuesli/nuxt-vio",
3
- "version": "3.0.0-beta.14",
3
+ "version": "3.0.0-beta.16",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -30,3 +30,48 @@ export const I18N_VUE_CONFIG = {
30
30
  export const TIMEZONE_COOKIE_NAME = [COOKIE_PREFIX, 'tz'].join(COOKIE_SEPARATOR)
31
31
  export const TIMEZONE_HEADER_KEY = `X-${SITE_NAME}-Timezone`
32
32
  export const VALIDATION_SUGGESTION_TITLE_LENGTH_MAXIMUM = 300
33
+ export const VIO_NUXT_BASE_CONFIG = ({
34
+ baseUrl,
35
+ siteName,
36
+ stagingHost,
37
+ }: {
38
+ baseUrl: string
39
+ siteName: string
40
+ stagingHost: string
41
+ }) => ({
42
+ app: {
43
+ head: {
44
+ title: SITE_NAME, // fallback data to prevent invalid html at generation
45
+ },
46
+ },
47
+ runtimeConfig: {
48
+ public: {
49
+ i18n: {
50
+ baseUrl,
51
+ },
52
+ vio: {
53
+ stagingHost:
54
+ process.env.NODE_ENV !== 'production' &&
55
+ !process.env.NUXT_PUBLIC_STACK_DOMAIN
56
+ ? stagingHost
57
+ : undefined,
58
+ },
59
+ },
60
+ },
61
+ typescript: {
62
+ tsConfig: {
63
+ compilerOptions: {
64
+ esModuleInterop: true,
65
+ // moduleResolution: 'bundler',
66
+ // noErrorTruncation: true,
67
+ },
68
+ },
69
+ },
70
+
71
+ // modules
72
+ i18n: I18N_MODULE_CONFIG, // `langDir`, `lazy` and `locales` must be configured to extend a layer having lazy-loaded translations (https://v8.i18n.nuxtjs.org/guide/layers#locales)
73
+ site: {
74
+ name: siteName,
75
+ url: baseUrl,
76
+ },
77
+ })
@@ -1,101 +0,0 @@
1
- <template>
2
- <header class="mb-8 flex items-center justify-between gap-4">
3
- <VioButton :aria-label="t('creal')" :to="localePath('/')">
4
- <span class="text-lg font-bold">{{ t('creal') }}</span>
5
- <template #prefix>
6
- <IconLogo class="h-10 w-10" />
7
- </template>
8
- </VioButton>
9
- <VioLink
10
- v-if="eventsCurrentCount"
11
- class="flex items-center gap-2 rounded-full border px-4 py-2 font-bold focus:rounded-full sm:px-4"
12
- :is-colored="false"
13
- :to="localePath('/events')"
14
- >
15
- <VioLayoutLivePulse />
16
- <span class="hidden whitespace-nowrap sm:inline">
17
- {{ t('live') }}
18
- </span>
19
- </VioLink>
20
- <VioLink
21
- v-else-if="eventsFutureCount"
22
- class="flex items-center gap-2 rounded-full border px-2 py-2 font-bold focus:rounded-full sm:px-4"
23
- :is-colored="false"
24
- :to="localePath('/events')"
25
- >
26
- <VioLayoutLivePulse />
27
- <span class="hidden whitespace-nowrap sm:inline">
28
- {{ t('eventsFuture') }}
29
- </span>
30
- </VioLink>
31
- <VioButton
32
- :aria-label="t('bookCreal')"
33
- class="basis-0 text-lg font-bold"
34
- :is-colored="false"
35
- :to="`mailto:e-mail+creal@jonas-thelemann.de?subject=${encodeURIComponent(
36
- t('bookingSubject'),
37
- )}`"
38
- >
39
- <span class="basis-0 whitespace-nowrap">{{ t('bookCreal') }}</span>
40
- <template #suffix>
41
- <IconArrowRight />
42
- </template>
43
- </VioButton>
44
- </header>
45
- </template>
46
-
47
- <script setup lang="ts">
48
- const { t } = useI18n()
49
- const localePath = useLocalePath()
50
- const strapiFetch = useStrapiFetch()
51
- const dateTime = useDateTime()
52
-
53
- // async data
54
- let eventsCurrentCount = 0
55
- let eventsFutureCount = 0
56
-
57
- // data
58
- const now = dateTime()
59
-
60
- // methods
61
- const init = async () => {
62
- eventsCurrentCount = (
63
- (await strapiFetch('/events', {
64
- query: {
65
- 'filters[$and][0][dateStart][$lte]': now.toISOString(),
66
- 'filters[$and][1][$or][0][dateEnd][$gt]': now.toISOString(),
67
- 'filters[$and][1][$or][1][dateStart][$gte]': now
68
- .startOf('day')
69
- .toISOString(),
70
- },
71
- })) as any
72
- ).meta.pagination.total
73
- eventsFutureCount = (
74
- (await strapiFetch('/events', {
75
- query: {
76
- 'filters[dateStart][$gt]': now.toISOString(),
77
- },
78
- })) as any
79
- ).meta.pagination.total
80
- }
81
-
82
- // initialization
83
- try {
84
- await init()
85
- } catch (error: any) {}
86
- </script>
87
-
88
- <i18n lang="yaml">
89
- en:
90
- bookCreal: Book cReal
91
- bookingSubject: Booking Request
92
- creal: cReal
93
- eventsFuture: Upcoming events
94
- live: Live
95
- de:
96
- bookCreal: cReal buchen
97
- bookingSubject: Buchungsanfrage
98
- creal: cReal
99
- eventsFuture: Kommende Veranstaltungen
100
- live: Live
101
- </i18n>