@fy-/fws-vue 0.0.6 → 0.0.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.
@@ -13,9 +13,13 @@ const props = withDefaults(
13
13
  cmsAlias: string;
14
14
  notFound: Component;
15
15
  baseBreadcrumb?: BreadcrumbLink[];
16
+ showImage?: boolean;
17
+ showPreview?: boolean;
16
18
  }>(),
17
19
  {
18
20
  baseBreadcrumb: () => [],
21
+ showImage: true,
22
+ showPreview: true,
19
23
  },
20
24
  );
21
25
 
@@ -87,12 +91,13 @@ useSeo(seo);
87
91
  </h1>
88
92
  <p
89
93
  class="font-light text-center text-fv-neutral-500 dark:text-fv-neutral-400 sm:text-xl"
94
+ v-if="showPreview"
90
95
  >
91
96
  {{ post.Overview }}
92
97
  </p>
93
98
  </div>
94
99
  <img
95
- v-if="post.CoverUUID"
100
+ v-if="post.CoverUUID && showImage"
96
101
  :src="`https://s.nocachenocry.com/${post.CoverUUID}?vars=format=webp:resize=768x768`"
97
102
  :alt="post.Title"
98
103
  class="h-auto rounded-xl shadow max-w-[768px] max-h-[280px] mx-auto mb-6"
@@ -209,22 +209,22 @@ defineExpose({ focus, getInputRef });
209
209
  @apply mt-2 text-sm text-fv-neutral-500 dark:text-fv-neutral-400;
210
210
  }
211
211
  .fws-input {
212
- @apply shadow-sm bg-fv-neutral-50 border border-fv-neutral-300 text-fv-neutral-900 text-sm rounded-lg focus:ring-fv-primary-500 focus:border-fv-primary-500 block w-full p-2.5 dark:bg-fv-neutral-700 dark:border-fv-neutral-600 dark:placeholder-fv-neutral-400 dark:text-white dark:focus:ring-fv-primary-500 dark:focus:border-fv-primary-500;
212
+ @apply shadow-sm bg-fv-neutral-50 border border-fv-neutral-300 text-fv-neutral-900 text-sm rounded-sm focus:ring-fv-primary-500 focus:border-fv-primary-500 block w-full p-2.5 dark:bg-fv-neutral-700 dark:border-fv-neutral-600 dark:placeholder-fv-neutral-400 dark:text-white dark:focus:ring-fv-primary-500 dark:focus:border-fv-primary-500;
213
213
  &.error {
214
- @apply bg-red-50 border border-red-500 text-red-900 placeholder-red-700 text-sm rounded-lg focus:ring-red-500 focus:border-red-500 block w-full p-2.5 dark:bg-red-100 dark:border-red-400;
214
+ @apply bg-red-50 border border-red-500 text-red-900 placeholder-red-700 text-sm rounded-sm focus:ring-red-500 focus:border-red-500 block w-full p-2.5 dark:bg-red-100 dark:border-red-400;
215
215
  }
216
216
  }
217
217
  .fws-textarea {
218
- @apply block p-2.5 w-full text-sm text-fv-neutral-900 bg-fv-neutral-50 rounded-lg border border-fv-neutral-300 focus:ring-fv-primary-500 focus:border-fv-primary-500 dark:bg-fv-neutral-700 dark:border-fv-neutral-600 dark:placeholder-fv-neutral-400 dark:text-white dark:focus:ring-fv-primary-500 dark:focus:border-fv-primary-500;
218
+ @apply block p-2.5 w-full text-sm text-fv-neutral-900 bg-fv-neutral-50 rounded-sm border border-fv-neutral-300 focus:ring-fv-primary-500 focus:border-fv-primary-500 dark:bg-fv-neutral-700 dark:border-fv-neutral-600 dark:placeholder-fv-neutral-400 dark:text-white dark:focus:ring-fv-primary-500 dark:focus:border-fv-primary-500;
219
219
  &.error {
220
- @apply bg-red-50 border border-red-500 text-red-900 placeholder-red-700 text-sm rounded-lg focus:ring-red-500 focus:border-red-500 block w-full p-2.5 dark:bg-red-100 dark:border-red-400;
220
+ @apply bg-red-50 border border-red-500 text-red-900 placeholder-red-700 text-sm rounded-sm focus:ring-red-500 focus:border-red-500 block w-full p-2.5 dark:bg-red-100 dark:border-red-400;
221
221
  }
222
222
  }
223
223
 
224
224
  .fws-select {
225
- @apply bg-fv-neutral-50 border border-fv-neutral-300 text-fv-neutral-900 text-sm rounded-lg focus:ring-fv-primary-500 focus:border-fv-primary-500 block w-full p-2.5 dark:bg-fv-neutral-700 dark:border-fv-neutral-600 dark:placeholder-fv-neutral-400 dark:text-white dark:focus:ring-fv-primary-500 dark:focus:border-fv-primary-500;
225
+ @apply bg-fv-neutral-50 border border-fv-neutral-300 text-fv-neutral-900 text-sm rounded-sm focus:ring-fv-primary-500 focus:border-fv-primary-500 block w-full p-2.5 dark:bg-fv-neutral-700 dark:border-fv-neutral-600 dark:placeholder-fv-neutral-400 dark:text-white dark:focus:ring-fv-primary-500 dark:focus:border-fv-primary-500;
226
226
  &.error {
227
- @apply bg-red-50 border border-red-500 text-red-900 placeholder-red-700 text-sm rounded-lg focus:ring-red-500 focus:border-red-500 block w-full p-2.5 dark:bg-red-100 dark:border-red-400;
227
+ @apply bg-red-50 border border-red-500 text-red-900 placeholder-red-700 text-sm rounded-sm focus:ring-red-500 focus:border-red-500 block w-full p-2.5 dark:bg-red-100 dark:border-red-400;
228
228
  }
229
229
  }
230
230
  .fws-checkbox {
@@ -234,7 +234,7 @@ defineExpose({ focus, getInputRef });
234
234
  .fws-checkbox input {
235
235
  @apply w-4 h-4 text-fv-primary-600 bg-fv-neutral-100 border-fv-neutral-300 rounded focus:ring-fv-primary-500 dark:focus:ring-fv-primary-600 dark:ring-offset-fv-neutral-800 dark:focus:ring-offset-fv-neutral-800 focus:ring-2 dark:bg-fv-neutral-700 dark:border-fv-neutral-600;
236
236
  &.error {
237
- @apply bg-red-50 border border-red-500 text-red-900 placeholder-red-700 text-sm rounded-lg focus:ring-red-500 focus:border-red-500 block w-full p-2.5 dark:bg-red-100 dark:border-red-400;
237
+ @apply bg-red-50 border border-red-500 text-red-900 placeholder-red-700 text-sm rounded-sm focus:ring-red-500 focus:border-red-500 block w-full p-2.5 dark:bg-red-100 dark:border-red-400;
238
238
  }
239
239
  }
240
240
  .fws-checkbox label {
@@ -0,0 +1,139 @@
1
+ <script lang="ts" setup>
2
+ import { NavLink } from "../../types";
3
+ import { ArrowRightIcon, ArrowLeftIcon } from "@heroicons/vue/24/solid";
4
+ import { useStorage } from "@vueuse/core";
5
+ import { useRoute } from "vue-router";
6
+
7
+ const props = withDefaults(
8
+ defineProps<{
9
+ links: NavLink[];
10
+ id?: string;
11
+ baseUrl?: string;
12
+ }>(),
13
+ {
14
+ id: "main",
15
+ baseUrl: "/",
16
+ },
17
+ );
18
+ const route = useRoute();
19
+ const isLinkActive = (link: NavLink) => {
20
+ if (link.to != props.baseUrl) {
21
+ if (route.path == link.to || route.path.includes(link.to))
22
+ return "fvside-active";
23
+ } else {
24
+ if (route.path == link.to) {
25
+ return "fvside-active";
26
+ }
27
+ }
28
+ return "";
29
+ };
30
+ const isOpen = useStorage(`isOpenSidebar-${props.id}`, true);
31
+ </script>
32
+ <template>
33
+ <aside class="fui-sidebar" :class="isOpen ? '' : 'fui-sidebar__md'">
34
+ <div class="fui-sidebar__controller">
35
+ <button
36
+ class="btn neutral defaults"
37
+ aria-controls="side-nav"
38
+ @click="isOpen = !isOpen"
39
+ >
40
+ <ArrowLeftIcon v-if="isOpen" />
41
+ <ArrowRightIcon v-else />
42
+ <span class="sr-only">{{ $t("sidebar_size_control") }}</span>
43
+ </button>
44
+ </div>
45
+ <slot name="before"></slot>
46
+ <ul role="list" id="side-nav">
47
+ <li v-for="(link, index) of links" :key="`aside_link_${index}`">
48
+ <RouterLink
49
+ :to="link.to"
50
+ class="fui-sidebar__link"
51
+ :class="isLinkActive(link)"
52
+ >
53
+ <div role="tooltip" class="fui-tooltip">
54
+ {{ link.name }}
55
+ </div>
56
+ <component :is="link.icon" v-if="link.icon" />
57
+ <span>{{ link.name }}</span>
58
+ <span class="sr-only">{{ link.name }}</span>
59
+ </RouterLink>
60
+ </li>
61
+ <slot name="lis"></slot>
62
+ </ul>
63
+ <slot name="after"></slot>
64
+ </aside>
65
+ </template>
66
+ <style lang="scss" scoped>
67
+ .fui-sidebar {
68
+ @apply w-60;
69
+ transition: width 600ms ease-in-out;
70
+ .fui-sidebar__controller {
71
+ @apply py-3 flex items-center justify-end pr-3;
72
+ svg {
73
+ @apply w-4 h-4;
74
+ }
75
+ }
76
+ .fui-sidebar__link {
77
+ @apply relative flex w-full items-center py-3 px-3 font-semibold text-sm border-l-[.4rem] border-l-transparent;
78
+ @apply text-fv-neutral-600 hover:bg-fv-neutral-200/[.3] focus:bg-fv-neutral-200/[.3] hover:text-fv-primary-600;
79
+ @apply dark:text-fv-neutral-300 dark:hover:bg-fv-neutral-700/[.3] dark:focus:bg-fv-neutral-700/[.3] dark:hover:text-fv-primary-400;
80
+ &.fvside-active {
81
+ @apply border-l-fv-primary-500 bg-fv-neutral-200 hover:text-fv-neutral-600 focus:text-fv-neutral-600;
82
+ @apply dark:bg-fv-neutral-700 dark:hover:text-fv-neutral-300 dark:text-fv-neutral-300;
83
+ }
84
+ svg {
85
+ @apply w-6 h-6 mr-2 -ml-1 text-fv-neutral-400 dark:text-fv-neutral-500;
86
+ }
87
+ span {
88
+ @apply whitespace-nowrap;
89
+ }
90
+ transition: all 300ms ease-in-out;
91
+ }
92
+
93
+ &.fui-sidebar__md {
94
+ @apply w-12;
95
+ &.fui-sidebar__md {
96
+ @apply w-12;
97
+ }
98
+ .fui-sidebar__link {
99
+ @apply flex flex-col text-xs;
100
+ svg {
101
+ @apply mr-0;
102
+ }
103
+ span {
104
+ @apply hidden;
105
+ }
106
+ }
107
+ .fui-sidebar__link:hover .fui-tooltip,
108
+ .fui-sidebar__link:focus .fui-tooltip,
109
+ .fui-sidebar__link:active .fui-tooltip {
110
+ @apply visible opacity-100 left-11 top-0 bottom-0 flex items-center;
111
+ }
112
+ }
113
+ }
114
+ @media screen and (max-width: 640px) {
115
+ .fui-sidebar {
116
+ @apply w-12;
117
+ &.fui-sidebar__md {
118
+ @apply w-12;
119
+ }
120
+ .fui-sidebar__controller {
121
+ @apply hidden;
122
+ }
123
+ .fui-sidebar__link {
124
+ @apply flex flex-col text-xs;
125
+ svg {
126
+ @apply mr-0;
127
+ }
128
+ span {
129
+ @apply hidden;
130
+ }
131
+ }
132
+ .fui-sidebar__link:hover .fui-tooltip,
133
+ .fui-sidebar__link:focus .fui-tooltip,
134
+ .fui-sidebar__link:active .fui-tooltip {
135
+ @apply visible opacity-100 left-11 top-0 bottom-0 flex items-center;
136
+ }
137
+ }
138
+ }
139
+ </style>
package/index.ts CHANGED
@@ -33,6 +33,7 @@ import DefaultConfirm from "./components/ui/DefaultConfirm.vue";
33
33
  import DefaultPaging from "./components/ui/DefaultPaging.vue";
34
34
  import DefaultBreadcrumb from "./components/ui/DefaultBreadcrumb.vue";
35
35
  import DefaultLoader from "./components/ui/DefaultLoader.vue";
36
+ import DefaultSidebar from "./components/ui/DefaultSidebar.vue";
36
37
 
37
38
  // Components/FWS
38
39
  import UserFlow from "./components/fws/UserFlow.vue";
@@ -113,6 +114,7 @@ export {
113
114
  DefaultPaging,
114
115
  DefaultBreadcrumb,
115
116
  DefaultLoader,
117
+ DefaultSidebar,
116
118
 
117
119
  // FWS
118
120
  UserFlow,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fy-/fws-vue",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "author": "Florian 'Fy' Gasquez <m@fy.to>",
5
5
  "license": "MIT",
6
6
  "repository": {
package/style.css CHANGED
@@ -10,21 +10,21 @@
10
10
  }
11
11
 
12
12
  .btn {
13
- @apply text-white bg-gradient-to-br hover:bg-gradient-to-bl focus:ring-4 focus:outline-none font-medium rounded-lg text-center transition-colors ease-in-out motion-reduce:transition-none;
13
+ @apply inline-flex gap-3 text-white focus:ring-4 font-medium rounded-lg text-sm focus:outline-none transition-colors ease-in-out motion-reduce:transition-none;
14
14
  &.primary {
15
- @apply from-fv-primary-600 to-fv-primary-500 focus:ring-fv-primary-300 dark:focus:ring-fv-primary-800;
15
+ @apply bg-fv-primary-700 hover:bg-fv-primary-800 focus:ring-fv-primary-300 dark:bg-fv-primary-600 dark:hover:bg-fv-primary-700 dark:focus:ring-fv-primary-800;
16
16
  }
17
17
  &.accent {
18
- @apply from-fv-accent-600 to-fv-accent-500 focus:ring-fv-accent-300 dark:focus:ring-fv-accent-800;
18
+ @apply bg-fv-accent-700 hover:bg-fv-accent-800 focus:ring-fv-accent-300 dark:bg-fv-accent-600 dark:hover:bg-fv-accent-700 dark:focus:ring-fv-accent-800;
19
19
  }
20
20
  &.success,&.valid {
21
- @apply from-green-600 to-green-500 focus:ring-green-300 dark:focus:ring-green-800;
21
+ @apply bg-green-700 hover:bg-green-800 focus:ring-green-300 dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-800;
22
22
  }
23
23
  &.error,&.danger {
24
- @apply from-red-600 to-red-500 focus:ring-red-300 dark:focus:ring-red-800;
24
+ @apply bg-red-700 hover:bg-red-800 focus:ring-red-300 dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-800;
25
25
  }
26
26
  &.neutral {
27
- @apply from-fv-neutral-600 to-fv-neutral-500 focus:ring-fv-neutral-300 dark:focus:ring-fv-neutral-800;
27
+ @apply bg-fv-neutral-700 hover:bg-fv-neutral-800 focus:ring-fv-neutral-300 dark:bg-fv-neutral-600 dark:hover:bg-fv-neutral-700 dark:focus:ring-fv-neutral-800;
28
28
  }
29
29
 
30
30
  &.defaults {
@@ -40,3 +40,4 @@
40
40
  @apply px-6 py-3 text-base;
41
41
  }
42
42
  }
43
+
package/types.d.ts CHANGED
@@ -2,3 +2,11 @@ export interface BreadcrumbLink {
2
2
  name: string;
3
3
  to?: string;
4
4
  }
5
+ export type NavLink = {
6
+ to: string;
7
+ isExternal?: boolean;
8
+ name: string;
9
+ childrens?: NavLink[];
10
+ icon?: Component;
11
+ id?: string;
12
+ };
package/components.d.ts DELETED
@@ -1,22 +0,0 @@
1
- /* eslint-disable */
2
- /* prettier-ignore */
3
- // @ts-nocheck
4
- // Generated by unplugin-vue-components
5
- // Read more: https://github.com/vuejs/core/pull/3399
6
- export {}
7
-
8
- declare module 'vue' {
9
- export interface GlobalComponents {
10
- CollapseTransition: typeof import('./components/ui/transitions/CollapseTransition.vue')['default']
11
- DefaultConfirm: typeof import('./components/ui/DefaultConfirm.vue')['default']
12
- DefaultInput: typeof import('./components/ui/DefaultInput.vue')['default']
13
- DefaultModal: typeof import('./components/ui/DefaultModal.vue')['default']
14
- ExpandTransition: typeof import('./components/ui/transitions/ExpandTransition.vue')['default']
15
- FadeTransition: typeof import('./components/ui/transitions/FadeTransition.vue')['default']
16
- RouterLink: typeof import('vue-router')['RouterLink']
17
- RouterView: typeof import('vue-router')['RouterView']
18
- ScaleTransition: typeof import('./components/ui/transitions/ScaleTransition.vue')['default']
19
- SlideTransition: typeof import('./components/ui/transitions/SlideTransition.vue')['default']
20
- UserFlow: typeof import('./components/fws/UserFlow.vue')['default']
21
- }
22
- }