adata-ui 2.1.39 → 2.1.40-beta.1

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 (31) hide show
  1. package/.playground/app.vue +102 -0
  2. package/components/elements/button-login/index.vue +6 -10
  3. package/components/features/color-mode/AColorMode.client.vue +74 -32
  4. package/components/features/dropdown/ADropdownV2.vue +141 -0
  5. package/components/features/lang-switcher/lang-switcher.vue +120 -40
  6. package/components/features/pk-mobile-services/APkMobileServices.vue +5 -27
  7. package/components/features//321/201hange-version/AChangeVersion.vue +1 -1
  8. package/components/navigation/header/AHeader.vue +56 -33
  9. package/components/navigation/header/AlmatyContacts.vue +1 -1
  10. package/components/navigation/header/CardGallery.vue +5 -3
  11. package/components/navigation/header/ContactMenu.vue +26 -92
  12. package/components/navigation/header/HeaderLink.vue +189 -215
  13. package/components/navigation/header/HeaderUsage.vue +125 -0
  14. package/components/navigation/header/NavList.vue +56 -91
  15. package/components/navigation/header/ProductMenu.vue +79 -127
  16. package/components/navigation/header/ProfileMenu.vue +131 -150
  17. package/components/navigation/header/SystemNotification.vue +110 -0
  18. package/components/navigation/mobile-navigation/AMobileNavigation.vue +23 -15
  19. package/components/navigation/pill-tabs/APillTabs.vue +7 -2
  20. package/components/overlays/tooltip/ATooltipV2.vue +233 -0
  21. package/components/overlays/tooltip/types.ts +26 -0
  22. package/components/overlays/tooltip/useTooltipTrigger.ts +101 -0
  23. package/composables/useActiveNavigation.ts +84 -0
  24. package/composables/useHeaderNavigationLinks.ts +14 -7
  25. package/icons/gauge.vue +17 -0
  26. package/icons/sun.vue +13 -3
  27. package/lang/en.ts +6 -0
  28. package/lang/kk.ts +6 -0
  29. package/lang/ru.ts +6 -0
  30. package/package.json +1 -1
  31. package/components/navigation/header/TopHeader.vue +0 -196
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { PAGES } from '#adata-ui/shared/constans/pages'
2
+ import { useActiveNavigation } from '#adata-ui/composables/useActiveNavigation'
3
3
 
4
4
  interface NavList {
5
5
  title: string
@@ -13,119 +13,84 @@ const props = defineProps<{
13
13
  title: string
14
14
  link: string
15
15
  badge?: boolean
16
- to: string
16
+ to?: string
17
17
  navList: NavList[]
18
18
  currentModule: boolean
19
19
  }>()
20
20
 
21
- const colorMode = useColorMode()
22
-
23
- const isDark = computed(() => colorMode.value === 'dark')
21
+ const { isActiveService } = useActiveNavigation()
24
22
 
25
23
  function isActive(itemPath: string) {
26
24
  if (!props.currentModule) return false
27
-
28
- const currentUrl = window.location.href.split('/').filter(item => !['kk', 'en'].includes(item)).join('/')
29
- const section = PAGES[props.id]
30
-
31
- const currentPath = itemPath.split('/').filter(item => !['kk', 'en'].includes(item)).join('/')
32
-
33
- if (currentUrl === currentPath) return true
34
-
35
- if (currentPath.endsWith('/')) {
36
- let atLeastOne = false
37
-
38
- for (const key in section) {
39
- const path = section[key]
40
- if (key !== 'main') {
41
- const includes = currentUrl.includes(path) || currentUrl.includes('car-result')
42
- if (includes) {
43
- atLeastOne = true
44
- break
45
- }
46
- }
47
- }
48
-
49
- return !atLeastOne
50
- }
51
-
52
- if (currentPath.includes('check-car')) {
53
- if (currentUrl.includes('car-result')) {
54
- return true
55
- }
56
- }
57
-
58
- for (const key in section) {
59
- const path = section[key]
60
- if (key !== 'main') {
61
- const includesBoth = currentUrl.includes(path) && currentUrl.startsWith(currentPath)
62
- if (includesBoth) {
63
- return true
64
- }
65
- }
66
- }
67
-
68
- return false
25
+ return isActiveService(itemPath)
69
26
  }
70
27
  </script>
71
28
 
72
29
  <template>
73
- <div
74
- class="flex flex-col gap-2"
75
- :class="{ 'rounded-md bg-gray-50 p-2 dark:bg-gray-800': currentModule }"
30
+ <section
31
+ class="group/section overflow-hidden rounded-xl border p-3 shadow-sm transition-colors"
32
+ :class="currentModule
33
+ ? 'border-blue-700/20 bg-blue-50 hover:border-blue-700/40 dark:border-blue-500/20 dark:bg-blue-500/5 dark:hover:border-blue-500/40'
34
+ : 'border-gray-200 bg-white hover:border-blue-700/40 dark:border-gray-800 dark:bg-gray-950 dark:hover:border-blue-500/40'"
76
35
  >
77
- <nuxt-link-locale class="flex items-center gap-2 pl-[10px] hover:text-blue-700 dark:hover:text-blue-500" :to="link">
78
- <p class="text-sm font-semibold">
79
- {{ title }}
80
- </p>
81
- <a-status-badge
82
- v-if="badge"
83
- type="primary"
84
- class="w-fit"
85
- size="xs"
86
- view="inverted"
36
+ <div class="mb-3 flex items-start justify-between gap-2">
37
+ <nuxt-link-locale
38
+ :to="link"
39
+ class="group/title flex min-w-0 items-center gap-2 text-sm font-bold text-deepblue-900 transition-colors hover:text-blue-700 dark:text-gray-100 dark:hover:text-blue-500"
87
40
  >
88
- NEW
89
- </a-status-badge>
90
- </nuxt-link-locale>
91
- <ul class="flex flex-col gap-2">
41
+ <span
42
+ class="flex size-8 shrink-0 items-center justify-center rounded-lg bg-blue-700/10 text-blue-700 transition-colors group-hover/title:bg-blue-700 group-hover/title:text-white dark:bg-blue-500/10 dark:text-blue-500">
43
+ <component
44
+ :is="icon"
45
+ class="size-4"
46
+ />
47
+ </span>
48
+ <span class="block truncate normal-case">{{ title }}</span>
49
+ </nuxt-link-locale>
50
+
51
+ <div class="flex shrink-0 items-center gap-1">
52
+ <span
53
+ v-if="badge"
54
+ class="rounded-full bg-blue-700/10 px-1.5 py-0.5 text-[10px] font-bold uppercase leading-none text-blue-700 dark:bg-blue-500/10 dark:text-blue-500"
55
+ >NEW</span>
56
+ <a-icon-arrow-side-up
57
+ class="size-4 text-gray-500 transition-colors group-hover/section:text-blue-700 dark:group-hover/section:text-blue-500"/>
58
+ </div>
59
+ </div>
60
+
61
+ <ul class="grid gap-1">
92
62
  <li
93
63
  v-for="item in navList"
94
64
  :key="item.title"
95
- class="flex w-full items-center gap-2 rounded-md px-[10px] py-[6px] hover:bg-blue-100 dark:hover:bg-gray-200/10 text-gray-600 dark:text-gray-200 hover:text-blue-700 dark:hover:text-blue-500"
96
- :class="{ 'bg-blue-100 dark:bg-gray-200/10': isActive(item.to) }"
97
65
  >
98
- <div class="rounded-lg p-1" :class="{ 'bg-gradient-blue-dark ': isDark, 'bg-gradient-blue-light': !isDark }">
99
- <component
100
- :is="item.icon"
101
- class="size-[18px] text-white dark:text-gray-900"
102
- />
103
- </div>
104
66
  <nuxt-link-locale
105
67
  v-if="item.to"
106
68
  :to="item.to"
107
69
  itemprop="name"
108
- class="inline-block normal-case w-full cursor-pointer align-middle text-sm font-semibold text-inherit hover:text-inherit"
70
+ class="group/item flex items-center gap-2 rounded-lg px-2 py-1.5 transition-colors hover:bg-blue-100 dark:hover:bg-gray-200/10"
71
+ :class="{ 'bg-blue-100 dark:bg-gray-200/10': isActive(item.to) }"
109
72
  >
110
- {{ item.title }}
73
+ <span
74
+ class="flex size-7 shrink-0 items-center justify-center rounded-md transition-colors group-hover/item:bg-blue-700/10 group-hover/item:text-blue-700 dark:group-hover/item:text-blue-500"
75
+ :class="{
76
+ 'bg-blue-700/10 text-blue-700 dark:bg-blue-500/10 dark:text-blue-500': isActive(item.to),
77
+ 'bg-gray-100 text-gray-600 dark:bg-gray-800 dark:text-gray-300': !isActive(item.to),
78
+ // 'bg-white text-gray-600 dark:bg-white dark:text-gray-300': currentModule,
79
+ }"
80
+ >
81
+ <component
82
+ :is="item.icon"
83
+ class="size-[14px]"
84
+ />
85
+ </span>
86
+ <span
87
+ class="truncate text-sm font-semibold normal-case transition-colors group-hover/item:text-deepblue-900 dark:group-hover/item:text-gray-100"
88
+ :class="isActive(item.to)
89
+ ? 'text-blue-700 dark:text-blue-500'
90
+ : 'text-gray-600 dark:text-gray-300'"
91
+ >{{ item.title }}</span>
111
92
  </nuxt-link-locale>
112
- <div
113
- v-else
114
- class="inline-block w-full align-middle text-sm font-semibold text-gray-600 dark:text-gray-200"
115
- >
116
- {{ item.title }}
117
- </div>
118
93
  </li>
119
94
  </ul>
120
- </div>
95
+ </section>
121
96
  </template>
122
-
123
- <style scoped lang="scss">
124
- .bg-gradient-blue-dark {
125
- background: linear-gradient(236.46deg, #4FBDFF -2.39%, #1B98E2 79.1%);
126
- }
127
-
128
- .bg-gradient-blue-light {
129
- background: linear-gradient(236.46deg, #479FFF -2.39%, #0070EB 79.1%);
130
- }
131
- </style>
@@ -1,146 +1,98 @@
1
1
  <script setup lang="ts">
2
- import { useHeaderNavigationLinks } from '#adata-ui/composables/useHeaderNavigationLinks'
3
- import NavList from '#adata-ui/components/navigation/header/NavList.vue'
4
2
  import CardGallery from '#adata-ui/components/navigation/header/CardGallery.vue'
3
+ import NavList from '#adata-ui/components/navigation/header/NavList.vue'
4
+ import { useActiveNavigation } from '#adata-ui/composables/useActiveNavigation'
5
+ import { useHeaderNavigationLinks } from '#adata-ui/composables/useHeaderNavigationLinks'
5
6
 
6
- const props = withDefaults(
7
- defineProps<{
8
- animation?: string
9
- index?: number
10
- url?: string
11
- }>(),
12
- {
13
- animation: 'next',
14
- index: 0,
15
- url: ''
16
- }
17
- )
18
-
7
+ defineProps<{ url?: string }>()
19
8
  defineEmits(['outerClick', 'mouseOver'])
20
9
 
21
- const pageUrl = useRequestURL()
22
- const filteredItems = useHeaderNavigationLinks()
10
+ const { t } = useI18n()
11
+ const modules = useHeaderNavigationLinks()
12
+ const { isActiveModule } = useActiveNavigation()
23
13
 
24
- function isCurrentModule(currentModule: string) {
25
- if (currentModule === 'fines') return 'avto'
26
- if (currentModule === 'analytics') return 'analytics'
27
- if (currentModule === 'compliance') return 'ac'
28
- if (currentModule === 'fea') return 'tnved'
29
- if (currentModule === 'tenders') return 'zakupki'
14
+ // Fixed EDO promo card on the left (like edo-editor); EDO is excluded from the catalog grid below.
15
+ const edoModule = computed(() => modules.value.find(module => module.key === 'edo') ?? null)
30
16
 
31
- return currentModule
32
- }
17
+ const COLUMN_KEYS = [['pk', 'fines', 'work'], ['fea', 'tenders'], ['compliance', 'analytics']]
18
+ const catalogColumns = computed(() =>
19
+ COLUMN_KEYS.map(keys =>
20
+ keys
21
+ .map(key => modules.value.find(module => module.key === key))
22
+ .filter((module): module is NonNullable<typeof module> => module !== undefined),
23
+ ),
24
+ )
33
25
  </script>
34
26
 
35
27
  <template>
36
28
  <div class="capitalize">
37
29
  <div class="relative bg-white dark:bg-gray-950">
38
- <transition :name="animation">
39
- <div
40
- :key="index"
41
- class="a-container py-8"
42
- >
43
- <div class="flex justify-between gap-5">
44
- <div class="flex gap-[10px] divide-x divide-gray-500/50">
45
- <div class="flex flex-col gap-5 w-[290px]">
46
- <nav-list
47
- v-for="module in filteredItems.slice(0,3)"
48
- :id="module.key"
49
- :key="module.key"
50
- :current-module="pageUrl.hostname.startsWith(isCurrentModule(module.key))"
51
- :title="module.name"
52
- :link="module.link"
53
- :nav-list="module.items"
54
- :to="module.to"
55
- :icon="module.icon"
56
- :badge="module.is_new"
57
- :data-test-id="module.data_attribute"
58
- />
59
- </div>
60
- <div class="flex flex-col gap-5 w-[290px] pl-[10px]">
61
- <nav-list
62
- v-for="module in filteredItems.slice(3,5)"
63
- :id="module.key"
64
- :key="module.key"
65
- :current-module="pageUrl.hostname.startsWith(isCurrentModule(module.key))"
66
- :title="module.name"
67
- :link="module.link"
68
- :nav-list="module.items"
69
- :to="module.to"
70
- :icon="module.icon"
71
- :badge="module.is_new"
72
- :data-test-id="module.data_attribute"
73
- />
74
- </div>
75
- <div class="flex flex-col gap-5 w-[330px] pl-[10px]">
76
- <nav-list
77
- v-for="module in filteredItems.slice(5,8)"
78
- :id="module.key"
79
- :key="module.key"
80
- :current-module="pageUrl.hostname.startsWith(isCurrentModule(module.key))"
81
- :title="module.name"
82
- :link="module.link"
83
- :nav-list="module.items"
84
- :to="module.to"
85
- :icon="module.icon"
86
- :badge="module.is_new"
87
- :data-test-id="module.data_attribute"
88
- />
30
+ <div class="a-container max-h-[calc(100dvh-4rem)] overflow-y-auto overscroll-contain py-8">
31
+ <div class="flex justify-between gap-5">
32
+ <!-- Left sidebar: EDO promo card (edo-editor style) + promo carousel. -->
33
+ <aside class="flex w-[320px] shrink-0 flex-col gap-5">
34
+ <nuxt-link-locale
35
+ v-if="edoModule"
36
+ :to="edoModule.link"
37
+ class="group block overflow-hidden rounded-xl border border-blue-700/20 p-4 shadow-sm transition-colors hover:border-blue-700/40 hover:bg-blue-100 dark:border-blue-500/20 dark:hover:border-blue-500/40 dark:hover:bg-blue-500/10"
38
+ :data-test-id="edoModule.data_attribute"
39
+ >
40
+ <div class="flex items-start gap-3">
41
+ <div
42
+ class="flex size-10 shrink-0 items-center justify-center rounded-lg bg-blue-700 text-white shadow-sm">
43
+ <component
44
+ :is="edoModule.icon"
45
+ class="size-5"
46
+ />
47
+ </div>
48
+ <div class="min-w-0">
49
+ <div class="flex items-center justify-between gap-2">
50
+ <h3 class="text-base font-bold normal-case text-deepblue-900 dark:text-gray-100">
51
+ {{ edoModule.name }}
52
+ </h3>
53
+ <div class="flex items-center gap-1 justify-end">
54
+ <span
55
+ v-if="edoModule.is_new"
56
+ class="rounded-full bg-blue-700/10 px-1.5 py-0.5 text-[10px] font-bold uppercase leading-none text-blue-700 dark:bg-blue-500/10 dark:text-blue-500"
57
+ >NEW</span>
58
+ <a-icon-arrow-side-up
59
+ class="size-4 text-gray-500 transition group-hover:-translate-y-0.5 group-hover:translate-x-0.5 group-hover:text-blue-700 dark:text-gray-400 dark:group-hover:text-blue-500"/>
60
+ </div>
61
+ </div>
62
+ <p class="mt-1 text-sm normal-case leading-snug text-gray-600 dark:text-gray-300">
63
+ {{ t('header.products.edo.heroSubtitle') }}
64
+ </p>
65
+ </div>
89
66
  </div>
67
+ </nuxt-link-locale>
68
+
69
+ <card-gallery class="hidden lg:block"/>
70
+ </aside>
71
+
72
+ <!-- Catalog grid: products as bordered section cards (EDO lives in the hero). -->
73
+ <div class="grid min-w-0 flex-1 grid-cols-3 gap-3">
74
+ <div
75
+ v-for="(column, index) in catalogColumns"
76
+ :key="index"
77
+ class="flex flex-col gap-3"
78
+ >
79
+ <nav-list
80
+ v-for="module in column"
81
+ :id="module.key"
82
+ :key="module.key"
83
+ :current-module="isActiveModule(module)"
84
+ :title="module.name"
85
+ :link="module.link"
86
+ :nav-list="module.items"
87
+ :to="module.to"
88
+ :icon="module.icon"
89
+ :badge="module.is_new"
90
+ :data-test-id="module.data_attribute"
91
+ />
90
92
  </div>
91
- <card-gallery class="hidden xl:block" />
92
93
  </div>
93
94
  </div>
94
- </transition>
95
- <button
96
- class="absolute right-8 top-4"
97
- @click="$emit('outerClick')"
98
- >
99
- <a-icon-x-mark
100
- width="32"
101
- height="32"
102
- />
103
- </button>
95
+ </div>
104
96
  </div>
105
97
  </div>
106
98
  </template>
107
-
108
- <style scoped lang="scss">
109
- $percent: 30%;
110
- .next-enter-from,
111
- .next-leave-to {
112
- opacity: 0;
113
- transform: translateX($percent);
114
- position: absolute;
115
- }
116
-
117
- .next-enter-active {
118
- transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
119
- }
120
-
121
- .next-leave-active {
122
- transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
123
- opacity: 0;
124
- transform: translateX(-$percent);
125
- }
126
-
127
- // Backwards transition
128
-
129
- .prev-enter-from,
130
- .prev-leave-to {
131
- position: absolute;
132
-
133
- opacity: 0;
134
- transform: translateX(-$percent);
135
- }
136
-
137
- .prev-enter-active {
138
- transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
139
- }
140
-
141
- .prev-leave-active {
142
- transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
143
- opacity: 0;
144
- transform: translateX($percent);
145
- }
146
- </style>