adata-ui 4.0.10 → 4.0.12

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.
Files changed (40) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +2 -1
  3. package/dist/runtime/components/Alert.vue +62 -0
  4. package/dist/runtime/components/Alert.vue.d.ts +29 -0
  5. package/dist/runtime/components/ColorMode.vue +45 -0
  6. package/dist/runtime/components/ColorMode.vue.d.ts +2 -0
  7. package/dist/runtime/components/Footer.vue +171 -6
  8. package/dist/runtime/components/FooterAccordion.vue +46 -4
  9. package/dist/runtime/components/FooterAccordion.vue.d.ts +10 -1
  10. package/dist/runtime/components/Header.vue +35 -21
  11. package/dist/runtime/components/Tag.vue.d.ts +1 -1
  12. package/dist/runtime/components/Toggle.vue +138 -0
  13. package/dist/runtime/components/Toggle.vue.d.ts +39 -0
  14. package/dist/runtime/components/button/Button.vue +133 -0
  15. package/dist/runtime/components/button/Button.vue.d.ts +37 -0
  16. package/dist/runtime/components/button/types.d.ts +21 -0
  17. package/dist/runtime/components/button/types.js +0 -0
  18. package/dist/runtime/components/header/ProductMenu.vue +236 -3
  19. package/dist/runtime/components/header/ProfileMenu.vue +69 -15
  20. package/dist/runtime/components/header/TopHeader.vue +9 -6
  21. package/dist/runtime/i18n.d.ts +1 -1
  22. package/dist/runtime/icons/arrow/chevron-down.vue +19 -0
  23. package/dist/runtime/icons/arrow/chevron-down.vue.d.ts +2 -0
  24. package/dist/runtime/icons/bookmark.vue +19 -0
  25. package/dist/runtime/icons/bookmark.vue.d.ts +2 -0
  26. package/dist/runtime/icons/history.vue +19 -0
  27. package/dist/runtime/icons/history.vue.d.ts +2 -0
  28. package/dist/runtime/icons/lock.vue +19 -0
  29. package/dist/runtime/icons/lock.vue.d.ts +2 -0
  30. package/dist/runtime/icons/message.vue +24 -0
  31. package/dist/runtime/icons/message.vue.d.ts +2 -0
  32. package/dist/runtime/icons/moon.vue +10 -0
  33. package/dist/runtime/icons/moon.vue.d.ts +2 -0
  34. package/dist/runtime/icons/sun.vue +14 -0
  35. package/dist/runtime/icons/sun.vue.d.ts +2 -0
  36. package/dist/runtime/icons/warning-triangle.vue +29 -0
  37. package/dist/runtime/icons/warning-triangle.vue.d.ts +2 -0
  38. package/package.json +1 -1
  39. package/dist/runtime/composables/useHeaderNavigationLinks.d.ts +0 -28
  40. package/dist/runtime/composables/useHeaderNavigationLinks.js +0 -238
package/dist/module.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "nuxt": ">=3.16.0"
6
6
  },
7
7
  "failOnWarn": false,
8
- "version": "4.0.10",
8
+ "version": "4.0.12",
9
9
  "builder": {
10
10
  "@nuxt/module-builder": "1.0.1",
11
11
  "unbuild": "3.5.0"
package/dist/module.mjs CHANGED
@@ -34,7 +34,8 @@ const module = defineNuxtModule({
34
34
  }
35
35
  addComponentsDir({
36
36
  path: resolver.resolve("./runtime/components"),
37
- prefix: "Adt"
37
+ prefix: "Adt",
38
+ global: true
38
39
  });
39
40
  _nuxt.options.alias["#icons"] = resolver.resolve("./runtime/icons");
40
41
  addComponentsDir({
@@ -0,0 +1,62 @@
1
+ <template>
2
+ <div
3
+ class="inline-flex w-full rounded-md"
4
+ :class="twMerge(colorOptions.description[color], textBgClasses)"
5
+ >
6
+ <div
7
+ class="flex items-center justify-center rounded-l-md"
8
+ :class="twMerge([colorOptions.icon[color], sizeOptions[size]], iconBgClasses)"
9
+ >
10
+ <slot name="icon">
11
+ <i-info-circle
12
+ v-if="iconType == 'circle'"
13
+ :class="`w-[${iconSize}] h-[${iconSize}]`"
14
+ />
15
+ <i-warning-triangle
16
+ v-if="iconType == 'triangle'"
17
+ :class="`w-[${iconSize}] h-[${iconSize}]`"
18
+ />
19
+ </slot>
20
+ </div>
21
+ <div
22
+ :class="sizeOptions[size]"
23
+ class="rounded-r-md flex items-center"
24
+ >
25
+ <slot name="default" />
26
+ </div>
27
+ </div>
28
+ </template>
29
+
30
+ <script setup>
31
+ import { twMerge } from "tailwind-merge";
32
+ defineOptions({ name: "AAlert" });
33
+ defineProps({
34
+ size: { type: String, required: false, default: "sm" },
35
+ color: { type: String, required: false, default: "blue" },
36
+ iconBgClasses: { type: String, required: false, default: "" },
37
+ textBgClasses: { type: String, required: false, default: "" },
38
+ iconType: { type: String, required: false, default: "circle" },
39
+ iconSize: { type: String, required: false, default: "16px" }
40
+ });
41
+ const sizeOptions = {
42
+ lg: "text-base p-2",
43
+ sm: "text-sm px-2 py-[3.5px]",
44
+ xs: "text-xs px-2 py-[3.5px]"
45
+ };
46
+ const colorOptions = {
47
+ icon: {
48
+ blue: "bg-blue-700 text-white dark:bg-blue-500 dark:text-gray-900",
49
+ green: "bg-green-500 text-white dark:text-gray-900",
50
+ orange: "bg-orange-500 text-white dark:text-gray-900",
51
+ deepblue: "bg-deepblue-900 text-white dark:text-gray-900",
52
+ red: "bg-red-500 text-white dark:bg-red-400 dark:text-gray-900"
53
+ },
54
+ description: {
55
+ blue: "bg-blue-100 dark:bg-gray-200/10 text-blue-700 dark:text-blue-500",
56
+ green: "bg-green-100 text-green-500",
57
+ orange: "bg-orange-100 text-orange-500 dark:bg-[#FFF5E6]",
58
+ deepblue: "bg-deepblue-100 text-deepblue-900",
59
+ red: "bg-red-100 text-red-500 dark:bg-[#3A3133] dark:text-red-400"
60
+ }
61
+ };
62
+ </script>
@@ -0,0 +1,29 @@
1
+ interface Props {
2
+ size?: 'lg' | 'sm' | 'xs';
3
+ color?: 'blue' | 'green' | 'red' | 'deepblue' | 'orange';
4
+ iconBgClasses?: string;
5
+ textBgClasses?: string;
6
+ iconType?: 'triangle' | 'circle';
7
+ iconSize?: string;
8
+ }
9
+ declare var __VLS_1: {}, __VLS_11: {};
10
+ type __VLS_Slots = {} & {
11
+ icon?: (props: typeof __VLS_1) => any;
12
+ } & {
13
+ default?: (props: typeof __VLS_11) => any;
14
+ };
15
+ declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
16
+ size: "lg" | "sm" | "xs";
17
+ color: "blue" | "green" | "red" | "deepblue" | "orange";
18
+ iconBgClasses: string;
19
+ textBgClasses: string;
20
+ iconType: "triangle" | "circle";
21
+ iconSize: string;
22
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
23
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
24
+ export default _default;
25
+ type __VLS_WithSlots<T, S> = T & {
26
+ new (): {
27
+ $slots: S;
28
+ };
29
+ };
@@ -0,0 +1,45 @@
1
+ <script setup>
2
+ import AToggle from "./Toggle.vue";
3
+ import Sun from "#icons/color-mode/sun.vue";
4
+ import Moon from "#icons/color-mode/moon.vue";
5
+ import { useColorMode } from "#imports";
6
+ const colorMode = useColorMode();
7
+ const setColorMode = useCookie("colorMode");
8
+ if (setColorMode.value) {
9
+ colorMode.preference = setColorMode.value;
10
+ }
11
+ const mode = computed({
12
+ get() {
13
+ return colorMode.value === "dark";
14
+ },
15
+ set() {
16
+ const value = colorMode.value === "dark" ? "light" : "dark";
17
+ const hostname = location.hostname.split(".").reverse();
18
+ const maxAge = 60 * 60 * 24 * 365;
19
+ colorMode.preference = value;
20
+ document.cookie = `colorMode=${value}; max-age=${maxAge}; domain=.${hostname[1]}.${hostname[0]}; path=/`;
21
+ }
22
+ });
23
+ onMounted(() => {
24
+ window.addEventListener("storage", (event) => {
25
+ if (event.key === "nuxt-color-mode") {
26
+ colorMode.preference = event.newValue;
27
+ }
28
+ });
29
+ });
30
+ </script>
31
+
32
+ <template>
33
+ <client-only>
34
+ <a-toggle
35
+ v-model="mode"
36
+ size="2xl"
37
+ :on-icon="Moon"
38
+ :off-icon="Sun"
39
+ off-icon-class="w-4 h-4"
40
+ on-icon-class="w-4 h-4"
41
+ active-class="data-[state=checked]:bg-gray-800"
42
+ active-container-class="data-[state=checked]:bg-black"
43
+ />
44
+ </client-only>
45
+ </template>
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ export default _default;
@@ -1,4 +1,5 @@
1
1
  <script setup>
2
+ import { PAGES } from "../shared/constants/pages";
2
3
  import ISocialsLinkedin from "#icons/socials/linkedin.vue";
3
4
  import ISocialsYoutube from "#icons/socials/youtube.vue";
4
5
  import ISocialsInstagram from "#icons/socials/instagram.vue";
@@ -6,9 +7,11 @@ import ISocialsTelegram from "#icons/socials/telegram.vue";
6
7
  import ISocialsFacebook from "#icons/socials/facebook.vue";
7
8
  import ISocialsTiktok from "#icons/socials/tik-tok.vue";
8
9
  import IAdata from "#icons/logo/adata.vue";
9
- import { useI18n, ref } from "#imports";
10
+ import { useI18n } from "#imports";
10
11
  const year = (/* @__PURE__ */ new Date()).getFullYear();
11
12
  const { t } = useI18n();
13
+ const appConfig = useAppConfig();
14
+ const mode = appConfig.adataUI.mode;
12
15
  const socialMedia = [
13
16
  {
14
17
  icon: ISocialsLinkedin,
@@ -41,8 +44,170 @@ const socialMedia = [
41
44
  name: "Tiktok"
42
45
  }
43
46
  ];
44
- const links = ref([]);
45
- const info = ref([]);
47
+ const mainLinks = {
48
+ counterparties: {
49
+ title: "footer.counterparties.title",
50
+ link: "https://pk.adata.kz",
51
+ items: [
52
+ {
53
+ title: "footer.counterparties.checkCounterparties",
54
+ link: `https://pk.${mode}.kz` + PAGES.pk.main
55
+ },
56
+ {
57
+ title: "footer.counterparties.compareCounterparties",
58
+ link: `https://pk.${mode}.kz` + PAGES.pk.compare
59
+ },
60
+ {
61
+ title: "footer.counterparties.indirectConnections",
62
+ link: `https://pk.${mode}.kz` + PAGES.pk.connections
63
+ },
64
+ {
65
+ title: "footer.counterparties.massCheck",
66
+ link: `https://pk.${mode}.kz` + PAGES.pk.employees
67
+ },
68
+ {
69
+ title: "footer.counterparties.foreignCounterparties",
70
+ link: `https://pk.${mode}.kz` + PAGES.pk.foreign
71
+ },
72
+ {
73
+ title: "footer.counterparties.sanctions",
74
+ link: `https://pk.${mode}.kz` + PAGES.pk.sanctions
75
+ },
76
+ {
77
+ title: "footer.counterparties.offshores",
78
+ link: `https://pk.${mode}.kz` + PAGES.pk.offshore
79
+ }
80
+ ]
81
+ },
82
+ work: {
83
+ title: "footer.work.title",
84
+ link: `https://work.${mode}.kz` + PAGES.work.vacancy,
85
+ items: [
86
+ {
87
+ title: "footer.work.createFindVacancies",
88
+ link: `https://work.${mode}.kz` + PAGES.work.vacancy
89
+ },
90
+ {
91
+ title: "footer.work.createFindResume",
92
+ link: `https://work.${mode}.kz` + PAGES.work.summary
93
+ }
94
+ ]
95
+ },
96
+ tenders: {
97
+ title: "footer.tenders.title",
98
+ link: `https://tender.${mode}.kz` + PAGES.tender.main,
99
+ items: [
100
+ {
101
+ title: "footer.tenders.searchTenders",
102
+ link: `https://tender.${mode}.kz` + PAGES.tender.main
103
+ },
104
+ {
105
+ title: "footer.tenders.purchasePlans",
106
+ link: `https://tender.${mode}.kz` + PAGES.tender.plans
107
+ }
108
+ ]
109
+ },
110
+ fines: {
111
+ title: "footer.fines.title",
112
+ link: `https://avto.${mode}.kz` + PAGES.fines.main,
113
+ items: [
114
+ {
115
+ title: "footer.fines.checkFines",
116
+ link: `https://avto.${mode}.kz` + PAGES.fines.main
117
+ },
118
+ {
119
+ title: "footer.fines.checkAuto",
120
+ link: `https://avto.${mode}.kz` + PAGES.fines.avto
121
+ },
122
+ {
123
+ title: "footer.fines.massCheckAuto",
124
+ link: `https://avto.${mode}.kz` + PAGES.fines.bulk
125
+ }
126
+ ]
127
+ },
128
+ analytics: {
129
+ title: "footer.analytics.title",
130
+ link: `https://analytics-new.${mode}.kz` + PAGES.analytics.main,
131
+ items: [
132
+ {
133
+ title: "footer.analytics.purchaseAnalysis",
134
+ link: `https://analytics.${mode}.kz` + PAGES.analytics.analysis
135
+ },
136
+ {
137
+ title: "footer.analytics.businessActivityIndex",
138
+ link: `https://analytics-new.${mode}.kz` + PAGES.analytics.index
139
+ },
140
+ {
141
+ title: "footer.analytics.taxpayerRanking",
142
+ link: `https://analytics-new.${mode}.kz` + PAGES.analytics.rating
143
+ },
144
+ {
145
+ title: "footer.analytics.businessEntities",
146
+ link: `https://analytics-new.${mode}.kz` + PAGES.analytics.business
147
+ }
148
+ ]
149
+ },
150
+ fea: {
151
+ title: "footer.fea.title",
152
+ link: `https://tnved.${mode}.kz` + PAGES.fea.main,
153
+ items: [
154
+ {
155
+ title: "footer.fea.i",
156
+ link: `https://tnved.${mode}.kz` + PAGES.fea.t
157
+ },
158
+ {
159
+ title: "footer.fea.o",
160
+ link: `https://tnved.${mode}.kz` + PAGES.fea.o
161
+ },
162
+ {
163
+ title: "footer.fea.cp",
164
+ link: `https://tnved.${mode}.kz` + PAGES.fea.cp
165
+ },
166
+ {
167
+ title: "footer.fea.calc",
168
+ link: `https://tnved.${mode}.kz` + PAGES.fea.ca
169
+ },
170
+ {
171
+ title: "footer.fea.mr",
172
+ link: `https://tnved.${mode}.kz` + PAGES.fea.tr
173
+ }
174
+ ]
175
+ }
176
+ };
177
+ const infoLinks = [
178
+ {
179
+ title: "footer.info.tariff",
180
+ link: `https://${mode}.kz` + PAGES.tariffs
181
+ },
182
+ {
183
+ title: "footer.info.helpful",
184
+ link: `https://${mode}.kz` + PAGES.usefulMain
185
+ },
186
+ {
187
+ title: "footer.info.api",
188
+ link: `https://${mode}.kz` + PAGES.apiDescription
189
+ },
190
+ {
191
+ title: "footer.info.userAgreement",
192
+ link: `https://${mode}.kz` + PAGES.userAgreement
193
+ },
194
+ {
195
+ title: "footer.info.privacyPolicy",
196
+ link: `https://${mode}.kz` + PAGES.privacy
197
+ },
198
+ {
199
+ title: "footer.info.vacancy",
200
+ link: `https://${mode}.kz` + PAGES.vacancy
201
+ },
202
+ {
203
+ title: "footer.info.counterparty",
204
+ link: `https://pk.${mode}.kz` + PAGES.pk.counterparty
205
+ },
206
+ {
207
+ title: "footer.info.contacts",
208
+ link: `https://${mode}.kz` + PAGES.contacts
209
+ }
210
+ ];
46
211
  </script>
47
212
 
48
213
  <template>
@@ -58,10 +223,10 @@ const info = ref([]);
58
223
  />
59
224
  <div class="grid gap-5 lg:grid-cols-5 lg:gap-10 xl:grid-cols-6">
60
225
  <div
61
- v-for="(link, key) in links"
226
+ v-for="(link, key) in mainLinks"
62
227
  :key="key"
63
228
  >
64
- <div
229
+ <adt-footer-accordion
65
230
  :content="link.items"
66
231
  :label="t(link.title)"
67
232
  :link="link.link.replace(/\/$/, '')"
@@ -92,7 +257,7 @@ const info = ref([]);
92
257
  >
93
258
  <div class="flex flex-col gap-4 lg:flex-row lg:gap-6">
94
259
  <nuxt-link
95
- v-for="(item, idx) in info"
260
+ v-for="(item, idx) in infoLinks"
96
261
  :key="idx"
97
262
  target="_blank"
98
263
  class="text-[10px]"
@@ -1,13 +1,55 @@
1
- <script setup lang="ts">
2
-
1
+ <script setup>
2
+ import { useI18n } from "#imports";
3
+ defineProps({
4
+ label: { type: String, required: true },
5
+ link: { type: String, required: true },
6
+ content: { type: Array, required: true }
7
+ });
8
+ const { t } = useI18n();
3
9
  </script>
4
10
 
5
11
  <template>
6
- <div>
12
+ <div class="flex flex-col ">
13
+ <div
14
+ class="flex gap-2 justify-between "
15
+ >
16
+ <nuxt-link-locale
17
+ class="text-sm"
18
+ :to="link"
19
+ >
20
+ {{ label }}
21
+ </nuxt-link-locale>
7
22
 
23
+ <div
24
+ class="transition-all lg:hidden cursor-pointer"
25
+ >
26
+ <i-check-circle
27
+ v-if="content.length"
28
+ filled
29
+ :font-controlled="false"
30
+ class="w-6 h-6 "
31
+ />
32
+ </div>
33
+ </div>
34
+ <transition
35
+ name="accordion"
36
+ >
37
+ <div
38
+ class="mt-2 flex flex-col gap-2"
39
+ >
40
+ <nuxt-link-locale
41
+ v-for="(item, idx) in content"
42
+ :key="idx"
43
+ class="text-xs"
44
+ :to="item.link.replace(/\/$/, '')"
45
+ >
46
+ {{ t(item.title) }}
47
+ </nuxt-link-locale>
48
+ </div>
49
+ </transition>
8
50
  </div>
9
51
  </template>
10
52
 
11
53
  <style scoped>
12
-
54
+ .accordion-enter-active,.accordion-leave-active{overflow:hidden;transition:height .3s ease,opacity .3s ease,margin .3s ease}.accordion-enter-from,.accordion-leave-to{height:0!important;margin:0!important;opacity:0!important}
13
55
  </style>
@@ -1,2 +1,11 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
+ interface Item {
2
+ title: string;
3
+ link: string;
4
+ }
5
+ interface Props {
6
+ label: string;
7
+ link: string;
8
+ content: Item[];
9
+ }
10
+ declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
2
11
  export default _default;
@@ -1,4 +1,5 @@
1
1
  <script setup>
2
+ import { DropdownMenuContent, DropdownMenuPortal, DropdownMenuRoot, DropdownMenuTrigger } from "reka-ui";
2
3
  import TopHeader from "./header/TopHeader.vue";
3
4
  import HeaderLink from "./header/HeaderLink.vue";
4
5
  import ProfileMenu from "./header/ProfileMenu.vue";
@@ -7,6 +8,8 @@ import ILogo from "#icons/logo/logo.vue";
7
8
  import ILogout from "#icons/navigation/logout.vue";
8
9
  import IAdata from "#icons/logo/adata.vue";
9
10
  import ISearch from "#icons/search.vue";
11
+ import IChevronDown from "#icons/arrow/chevron-down.vue";
12
+ import ColorMode from "./ColorMode.vue";
10
13
  const props = defineProps({
11
14
  replenish: { type: String, required: false },
12
15
  hasNotification: { type: Boolean, required: false },
@@ -38,6 +41,7 @@ const goAuth = () => {
38
41
  const goToAnotherModule = () => {
39
42
  location.href = "https://adata.kz";
40
43
  };
44
+ const profileMenuOpen = ref(false);
41
45
  const fetchContacts = async () => {
42
46
  try {
43
47
  const response = await fetch(
@@ -133,28 +137,38 @@ onBeforeMount(() => {
133
137
  <div />
134
138
  <div v-if="langIsOn || module === 'fea'" />
135
139
  </div>
140
+ <color-mode />
141
+ <dropdown-menu-root
142
+ v-model:open="profileMenuOpen"
143
+ >
144
+ <dropdown-menu-trigger>
145
+ <div
146
+ v-show="isAuthenticated"
147
+ class="hidden cursor-pointer items-center gap-2 text-sm font-semibold lg:flex"
148
+ @click.stop="profileMenuOpen = true"
149
+ >
150
+ <span>{{ email }}</span>
151
+ <i-chevron-down :class="{ 'rotate-180': profileMenuOpen }" />
152
+ </div>
153
+ </dropdown-menu-trigger>
154
+ <dropdown-menu-portal>
155
+ <dropdown-menu-content
156
+ side="bottom"
157
+ align="end"
158
+ :side-offset="20"
159
+ >
160
+ <profile-menu
161
+ :balance="balance"
162
+ :days-remaining="daysRemaining"
163
+ :limit-remaining="limitRemaining"
164
+ :rate="rate"
165
+ :replenish="replenish"
166
+ @logout="$emit('logout')"
167
+ />
168
+ </dropdown-menu-content>
169
+ </dropdown-menu-portal>
170
+ </dropdown-menu-root>
136
171
 
137
- <!-- <div v-show="isAuthenticated"> -->
138
- <!-- <template #default="{ onExpand, expanded }"> -->
139
- <!-- <div -->
140
- <!-- class="hidden cursor-pointer items-center gap-2 text-sm font-semibold lg:flex" -->
141
- <!-- @click.stop="onExpand" -->
142
- <!-- > -->
143
- <!-- <span>{{ email }}</span> -->
144
- <!-- <arrow :class="{ 'rotate-180': expanded }" /> -->
145
- <!-- </div> -->
146
- <!-- </template> -->
147
- <!-- <template #content> -->
148
- <!-- <profile-menu -->
149
- <!-- :balance="balance" -->
150
- <!-- :days-remaining="daysRemaining" -->
151
- <!-- :limit-remaining="limitRemaining" -->
152
- <!-- :rate="rate" -->
153
- <!-- :replenish="replenish" -->
154
- <!-- @logout="$emit('logout')" -->
155
- <!-- /> -->
156
- <!-- </template> -->
157
- <!-- </div> -->
158
172
  <div
159
173
  v-show="!isAuthenticated && showLogIn"
160
174
  class="hidden cursor-pointer items-center gap-2 font-semibold lg:flex"
@@ -11,9 +11,9 @@ type __VLS_Slots = {} & {
11
11
  default?: (props: typeof __VLS_3) => any;
12
12
  };
13
13
  declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
14
+ size: "xs" | "sm" | "lg";
14
15
  type: "primary" | "success" | "danger" | "gray" | "orange" | "warning";
15
16
  view: "default" | "inverted" | "transparent";
16
- size: "xs" | "sm" | "lg";
17
17
  customClasses: string;
18
18
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
19
19
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
@@ -0,0 +1,138 @@
1
+ <script setup>
2
+ import { SwitchRoot, SwitchThumb } from "reka-ui";
3
+ import { twMerge, twJoin } from "tailwind-merge";
4
+ const props = defineProps({
5
+ disabled: { type: Boolean, required: false, default: false },
6
+ size: { type: String, required: false, default: "md" },
7
+ color: { type: String, required: false, default: "blue" },
8
+ switchClass: { type: String, required: false, default: "" },
9
+ activeClass: { type: String, required: false, default: "" },
10
+ inactiveClass: { type: String, required: false, default: "" },
11
+ onIcon: { type: null, required: false, default: null },
12
+ onIconClass: { type: [String, null], required: false, default: null },
13
+ offIcon: { type: null, required: false, default: null },
14
+ offIconClass: { type: [String, null], required: false, default: null },
15
+ activeContainerClass: { type: String, required: false, default: "" },
16
+ inactiveContainerClass: { type: String, required: false, default: "" }
17
+ });
18
+ const active = defineModel({ type: Boolean, ...{ required: true } });
19
+ const switchClass = computed(() => {
20
+ return twMerge(twJoin(
21
+ ui.base,
22
+ ui.size[props.size],
23
+ ui.rounded,
24
+ ui.ring,
25
+ props.disabled ? "opacity-20" : "",
26
+ props.color && (active.value ? ui.active[props.color] : ui.inactive),
27
+ active.value ? props.activeClass : props.inactiveClass
28
+ ), props.switchClass);
29
+ });
30
+ const containerClass = computed(() => {
31
+ return twMerge(twJoin(
32
+ ui.container.base,
33
+ ui.container.size[props.size],
34
+ active.value ? ui.container.active[props.size] : ui.container.inactive,
35
+ active.value ? props.activeContainerClass : props.inactiveContainerClass
36
+ ));
37
+ });
38
+ const onIconClassFormatted = computed(() => {
39
+ return twMerge(twJoin(
40
+ ui.icon.size[props.size],
41
+ props.onIconClass
42
+ ));
43
+ });
44
+ const offIconClassFormatted = computed(() => {
45
+ return twMerge(twJoin(
46
+ ui.icon.size[props.size],
47
+ props.offIconClass
48
+ ));
49
+ });
50
+ const ui = {
51
+ base: "relative inline-flex flex-shrink-0 border-2 border-transparent disabled:cursor-not-allowed disabled:opacity-50 focus:outline-none transition ease-in-out",
52
+ rounded: "rounded-full",
53
+ ring: "focus-visible:ring-2 focus-visible:ring-blue-500 dark:focus-visible:ring-blue-400 focus-visible:ring-offset-2 focus-visible:ring-offset-white dark:focus-visible:ring-offset-gray-900",
54
+ active: {
55
+ blue: "data-[state=unchecked]:bg-blue-700 data-[state=checked]:bg-blue-500",
56
+ green: "bg-green"
57
+ },
58
+ inactive: "data-[state=unchecked]:bg-gray-200 data-[state=checked]:dark:bg-gray-200/20",
59
+ size: {
60
+ "2xs": "h-3 w-5",
61
+ "xs": "h-3.5 w-6",
62
+ "sm": "h-4 w-7",
63
+ "md": "h-5 w-9",
64
+ "lg": "h-6 w-11",
65
+ "xl": "h-7 w-[3.25rem]",
66
+ "2xl": "h-8 w-[3.75rem]"
67
+ },
68
+ container: {
69
+ base: "pointer-events-none relative inline-block rounded-full data-[state=unchecked]:bg-white data-[state=checked]:bg-gray-900 shadow transform ring-0 transition ease-in-out duration-200",
70
+ active: {
71
+ "2xs": "translate-x-2 rtl:-translate-x-2",
72
+ "xs": "translate-x-2.5 rtl:-translate-x-2.5",
73
+ "sm": "translate-x-3 rtl:-translate-x-3",
74
+ "md": "translate-x-4 rtl:-translate-x-4",
75
+ "lg": "translate-x-5 rtl:-translate-x-5",
76
+ "xl": "translate-x-6 rtl:-translate-x-6",
77
+ "2xl": "translate-x-7 rtl:-translate-x-7"
78
+ },
79
+ inactive: "translate-x-0 rtl:-translate-x-0",
80
+ size: {
81
+ "2xs": "h-2 w-2",
82
+ "xs": "h-2.5 w-2.5",
83
+ "sm": "h-3 w-3",
84
+ "md": "h-4 w-4",
85
+ "lg": "h-5 w-5",
86
+ "xl": "h-6 w-6",
87
+ "2xl": "h-7 w-7"
88
+ }
89
+ },
90
+ icon: {
91
+ base: "absolute inset-0 h-full w-full flex items-center justify-center transition-opacity",
92
+ active: "opacity-100 ease-in duration-200",
93
+ inactive: "opacity-0 ease-out duration-100",
94
+ size: {
95
+ "2xs": "h-2 w-2",
96
+ "xs": "h-2 w-2",
97
+ "sm": "h-2 w-2",
98
+ "md": "h-3 w-3",
99
+ "lg": "h-4 w-4",
100
+ "xl": "h-5 w-5",
101
+ "2xl": "h-6 w-6"
102
+ }
103
+ }
104
+ };
105
+ </script>
106
+
107
+ <template>
108
+ <SwitchRoot
109
+ id="airplane-mode"
110
+ v-model="active"
111
+ :disabled="disabled"
112
+ :class="switchClass"
113
+ aria-label="Switch"
114
+ >
115
+ <SwitchThumb
116
+ :class="containerClass"
117
+ >
118
+ <span
119
+ v-if="onIcon"
120
+ :class="[active ? ui.icon.active : ui.icon.inactive, ui.icon.base]"
121
+ >
122
+ <component
123
+ :is="onIcon"
124
+ :class="onIconClassFormatted"
125
+ />
126
+ </span>
127
+ <span
128
+ v-if="offIcon"
129
+ :class="[active ? ui.icon.inactive : ui.icon.active, ui.icon.base]"
130
+ >
131
+ <component
132
+ :is="offIcon"
133
+ :class="offIconClassFormatted"
134
+ />
135
+ </span>
136
+ </SwitchThumb>
137
+ </SwitchRoot>
138
+ </template>