plugin-ui-for-kzt 0.0.9 → 0.0.10
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/example/App.vue +355 -0
- package/example/index.html +12 -0
- package/example/main.ts +8 -0
- package/example/shims-vue.d.ts +5 -0
- package/package.json +17 -7
- package/src/assets/icons/arrow-down.svg +3 -0
- package/src/assets/icons/calendar.svg +12 -0
- package/src/assets/icons/checkbox-circle.svg +3 -0
- package/src/assets/icons/checkbox.svg +3 -0
- package/src/assets/icons/email-sms.svg +4 -0
- package/src/assets/icons/help.svg +3 -0
- package/src/assets/icons/kg.svg +16 -0
- package/src/assets/icons/kz.svg +42 -0
- package/src/assets/icons/loader.svg +13 -0
- package/src/assets/icons/ru.svg +12 -0
- package/src/assets/icons/uz.svg +26 -0
- package/src/components/BaseBreadCrumbs/BaseBreadCrumbs.vue +142 -0
- package/src/components/BaseBreadCrumbs/README.md +49 -0
- package/src/components/BaseButton/BaseButton.vue +489 -0
- package/src/components/BaseButton/README.md +53 -0
- package/src/components/BaseCalendar/BaseCalendar.vue +231 -0
- package/src/components/BaseCalendar/README.md +126 -0
- package/src/components/BaseCheckbox/BaseCheckbox.vue +252 -0
- package/src/components/BaseCheckbox/README.md +110 -0
- package/src/components/BaseDropdown/BaseDropdown.vue +160 -0
- package/src/components/BaseDropdown/README.md +91 -0
- package/src/components/BaseIcon/BaseIcon.vue +47 -0
- package/src/components/BaseIcon/README.md +35 -0
- package/src/components/BaseInput/BaseInput.vue +300 -0
- package/src/components/BaseInput/README.md +85 -0
- package/src/components/BaseInputCalendar/BaseInputCalendar.vue +242 -0
- package/src/components/BaseInputCalendar/README.md +84 -0
- package/src/components/BaseInputCurrency/BaseInputCurrency.vue +198 -0
- package/src/components/BaseInputCurrency/README.md +57 -0
- package/src/components/BaseInputEmail/BaseInputEmail.vue +89 -0
- package/src/components/BaseInputEmail/README.md +71 -0
- package/src/components/BaseInputPhone/BaseInputPhone.vue +175 -0
- package/src/components/BaseLoader/BaseLoader.vue +45 -0
- package/src/components/BaseLoader/README.md +29 -0
- package/src/components/BaseOpenedListItem/BaseOpenedListItem.vue +216 -0
- package/src/components/BaseOpenedListItem/README.md +67 -0
- package/src/components/BaseRadio/BaseRadio.vue +283 -0
- package/src/components/BaseRadio/README.md +74 -0
- package/src/components/BaseSegmentedButtons/BaseSegmentedButtons.vue +89 -0
- package/src/components/BaseSegmentedButtons/README.md +75 -0
- package/src/components/BaseSelect/BaseSelect.vue +370 -0
- package/src/components/BaseSelect/README.md +95 -0
- package/src/components/BaseSiteInput/BaseSiteInput.vue +153 -0
- package/src/components/BaseTextarea/BaseTextarea.vue +212 -0
- package/src/components/BaseTextarea/README.md +75 -0
- package/src/components/BaseToggle/BaseToggle.vue +271 -0
- package/src/components/BaseToggle/README.md +76 -0
- package/src/components/BaseTooltip/BaseTooltip.vue +318 -0
- package/src/components/BaseTooltip/README.md +74 -0
- package/src/components/Modal/Modal.vue +3 -1
- package/src/components/Spinner/Spinner.vue +2 -1
- package/src/composables/kit/color.ts +14 -0
- package/src/composables/kit/interactive.ts +53 -0
- package/src/composables/kit/size.ts +15 -0
- package/src/composables/kit/state.ts +28 -0
- package/src/composables/kit/style.ts +18 -0
- package/src/composables/kit/utils.ts +7 -0
- package/src/icons/index.ts +9 -0
- package/src/index.ts +93 -2
- package/src/shims-context.d.ts +19 -0
- package/src/styles/index.scss +2 -1
- package/src/styles/root.scss +167 -0
- package/src/styles/variables.scss +160 -0
- package/src/types/breadcrumbs.d.ts +13 -0
- package/src/types/button.d.ts +13 -0
- package/src/types/calendar.d.ts +16 -0
- package/src/types/checkbox-radio.d.ts +15 -0
- package/src/types/dropdown.d.ts +20 -0
- package/src/types/icon.d.ts +8 -0
- package/src/types/input.d.ts +56 -0
- package/src/types/toggle.d.ts +12 -0
- package/src/types/tooltip.d.ts +8 -0
- package/src/types/utils.d.ts +37 -0
- package/src/vue-virtual-scroller.d.ts +9 -0
- package/tsconfig.json +3 -1
- package/webpack.config.js +90 -35
- package/dist/components/DataTable/DataTable.vue.d.ts +0 -3
- package/dist/components/Modal/Modal.vue.d.ts +0 -3
- package/dist/components/Spinner/Spinner.vue.d.ts +0 -3
- package/dist/components/Toaster/Toaster.vue.d.ts +0 -3
- package/dist/components/Toaster/timer.d.ts +0 -12
- package/dist/components/Tooltip/Tooltip.vue.d.ts +0 -3
- package/dist/index.d.ts +0 -11
- package/dist/index.js +0 -4929
- package/dist/plugins/modalPlugin.d.ts +0 -17
- package/dist/plugins/toasterPlugin.d.ts +0 -26
- package/dist/store/modal.d.ts +0 -11
- package/dist/types/index.d.ts +0 -5
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<svg viewBox="0 0 32 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_333_23284)">
|
|
3
|
+
<path d="M6.10352e-05 3C6.10352e-05 1.34315 1.30251 0 2.90915 0H29.091C30.6976 0 32.0001 1.34315 32.0001 3V21C32.0001 22.6569 30.6976 24 29.091 24H2.90915C1.3025 24 6.10352e-05 22.6569 6.10352e-05 21V3Z" fill="#D80027"/>
|
|
4
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M-3.05176e-05 18H32V24H-3.05176e-05V18Z" fill="#00B731"/>
|
|
5
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.10352e-05 0H32.0001V6.66667H6.10352e-05V0Z" fill="#338AF3"/>
|
|
6
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M-3.05176e-05 8.16699H32V16.5003H-3.05176e-05V8.16699Z" fill="white"/>
|
|
7
|
+
<path d="M3.55107 3.39667C3.55107 2.40876 4.24537 1.58348 5.17255 1.38101C5.03007 1.34986 4.8822 1.33301 4.73033 1.33301C3.59059 1.33301 2.66663 2.25693 2.66663 3.39671C2.66663 4.53649 3.59051 5.46041 4.73033 5.46041C4.8822 5.46041 5.03003 5.44351 5.17255 5.41241C4.24542 5.20986 3.55107 4.38457 3.55107 3.39667Z" fill="white"/>
|
|
8
|
+
<path d="M6.39325 4.33496L6.53293 4.76491H6.985L6.61929 5.03066L6.75896 5.46061L6.39325 5.19489L6.02746 5.46061L6.16717 5.03066L5.80142 4.76491H6.25349L6.39325 4.33496Z" fill="white"/>
|
|
9
|
+
<path d="M7.83516 4.33496L7.97487 4.76491H8.42694L8.06119 5.03066L8.20091 5.46061L7.83516 5.19489L7.4694 5.46061L7.60912 5.03066L7.24341 4.76491H7.69544L7.83516 4.33496Z" fill="white"/>
|
|
10
|
+
<path d="M9.27744 4.33496L9.41711 4.76491H9.86923L9.50347 5.03066L9.64315 5.46061L9.27744 5.19489L8.91164 5.46061L9.0514 5.03066L8.68561 4.76491H9.13772L9.27744 4.33496Z" fill="white"/>
|
|
11
|
+
<path d="M10.7195 4.33496L10.8592 4.76491H11.3113L10.9456 5.03066L11.0853 5.46061L10.7195 5.19489L10.3537 5.46061L10.4935 5.03066L10.1277 4.76491H10.5798L10.7195 4.33496Z" fill="white"/>
|
|
12
|
+
<path d="M12.1649 4.33496L12.3046 4.76491H12.7567L12.391 5.03066L12.5307 5.46061L12.1649 5.19489L11.7992 5.46061L11.9389 5.03066L11.5732 4.76491H12.0252L12.1649 4.33496Z" fill="white"/>
|
|
13
|
+
<path d="M7.83516 2.83398L7.97487 3.26389H8.42694L8.06119 3.52969L8.20091 3.95959L7.83516 3.69388L7.4694 3.95959L7.60912 3.52969L7.24341 3.26389H7.69544L7.83516 2.83398Z" fill="white"/>
|
|
14
|
+
<path d="M9.27744 2.83398L9.41711 3.26389H9.86923L9.50347 3.52969L9.64315 3.95959L9.27744 3.69388L8.91164 3.95959L9.0514 3.52969L8.68561 3.26389H9.13772L9.27744 2.83398Z" fill="white"/>
|
|
15
|
+
<path d="M10.7195 2.83398L10.8592 3.26389H11.3113L10.9456 3.52969L11.0853 3.95959L10.7195 3.69388L10.3537 3.95959L10.4935 3.52969L10.1277 3.26389H10.5798L10.7195 2.83398Z" fill="white"/>
|
|
16
|
+
<path d="M12.1649 2.83398L12.3046 3.26389H12.7567L12.391 3.52969L12.5307 3.95959L12.1649 3.69388L11.7992 3.95959L11.9389 3.52969L11.5732 3.26389H12.0252L12.1649 2.83398Z" fill="white"/>
|
|
17
|
+
<path d="M9.27744 1.33301L9.41711 1.763H9.86923L9.50347 2.02871L9.64315 2.4587L9.27744 2.19298L8.91164 2.4587L9.0514 2.02871L8.68561 1.763H9.13772L9.27744 1.33301Z" fill="white"/>
|
|
18
|
+
<path d="M10.7195 1.33301L10.8592 1.763H11.3113L10.9456 2.02871L11.0853 2.4587L10.7195 2.19298L10.3537 2.4587L10.4935 2.02871L10.1277 1.763H10.5798L10.7195 1.33301Z" fill="white"/>
|
|
19
|
+
<path d="M12.1649 1.33301L12.3046 1.763H12.7567L12.391 2.02871L12.5307 2.4587L12.1649 2.19298L11.7992 2.4587L11.9389 2.02871L11.5732 1.763H12.0252L12.1649 1.33301Z" fill="white"/>
|
|
20
|
+
</g>
|
|
21
|
+
<defs>
|
|
22
|
+
<clipPath id="clip0_333_23284">
|
|
23
|
+
<rect width="32" height="24" rx="2" fill="white"/>
|
|
24
|
+
</clipPath>
|
|
25
|
+
</defs>
|
|
26
|
+
</svg>
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<nav class="base-breadcrumbs" :class="classList">
|
|
3
|
+
<ul class="base-breadcrumbs__list">
|
|
4
|
+
<li
|
|
5
|
+
v-for="(crumb, index) in displayedCrumbs"
|
|
6
|
+
:key="index"
|
|
7
|
+
class="base-breadcrumbs__item"
|
|
8
|
+
>
|
|
9
|
+
<span v-if="crumb?.isEllipsis" class="base-breadcrumbs__ellipsis">
|
|
10
|
+
...
|
|
11
|
+
</span>
|
|
12
|
+
|
|
13
|
+
<component
|
|
14
|
+
v-else-if="Number(index) < displayedCrumbs.length - 1 && crumb?.to"
|
|
15
|
+
:is="linkComponent"
|
|
16
|
+
:to="crumb.to"
|
|
17
|
+
:href="crumb.to"
|
|
18
|
+
class="base-breadcrumbs__link"
|
|
19
|
+
>
|
|
20
|
+
{{ crumb.label }}
|
|
21
|
+
</component>
|
|
22
|
+
|
|
23
|
+
<span v-else class="base-breadcrumbs__current">
|
|
24
|
+
{{ crumb?.label }}
|
|
25
|
+
</span>
|
|
26
|
+
|
|
27
|
+
<span
|
|
28
|
+
v-if="index < displayedCrumbs.length - 1"
|
|
29
|
+
class="base-breadcrumbs__separator"
|
|
30
|
+
>
|
|
31
|
+
/
|
|
32
|
+
</span>
|
|
33
|
+
</li>
|
|
34
|
+
</ul>
|
|
35
|
+
</nav>
|
|
36
|
+
</template>
|
|
37
|
+
|
|
38
|
+
<script setup lang="ts">
|
|
39
|
+
import type { IBaseBreadCrumbProps } from '../../types/breadcrumbs';
|
|
40
|
+
import { useKitSize } from '../../composables/kit/size';
|
|
41
|
+
import { computed, getCurrentInstance } from 'vue';
|
|
42
|
+
|
|
43
|
+
const props = withDefaults(defineProps<IBaseBreadCrumbProps>(), {
|
|
44
|
+
size: 'medium',
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const { sizeClassList } = useKitSize(props);
|
|
48
|
+
|
|
49
|
+
const classList = computed(() => [sizeClassList.value]);
|
|
50
|
+
|
|
51
|
+
const displayedCrumbs = computed<IBaseBreadCrumbProps['crumbs']>(() => {
|
|
52
|
+
const maxCrumbs = 5;
|
|
53
|
+
if (props.crumbs.length <= maxCrumbs) {
|
|
54
|
+
return props.crumbs;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return [
|
|
58
|
+
props.crumbs[0],
|
|
59
|
+
{ label: '...', isEllipsis: true },
|
|
60
|
+
...props.crumbs.slice(-4),
|
|
61
|
+
];
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
const linkComponent = computed(() => {
|
|
65
|
+
const instance = getCurrentInstance();
|
|
66
|
+
const hasRouterLink = instance?.appContext.components['RouterLink'] || false;
|
|
67
|
+
return hasRouterLink ? 'router-link' : 'a';
|
|
68
|
+
});
|
|
69
|
+
</script>
|
|
70
|
+
|
|
71
|
+
<style lang="scss" scoped>
|
|
72
|
+
@import '@/styles/variables';
|
|
73
|
+
@import '@/styles/root';
|
|
74
|
+
|
|
75
|
+
.base-breadcrumbs {
|
|
76
|
+
$breadcrumbs: &;
|
|
77
|
+
|
|
78
|
+
&__list {
|
|
79
|
+
display: flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
padding: 0;
|
|
82
|
+
margin: 0;
|
|
83
|
+
list-style: none;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&__item {
|
|
87
|
+
display: flex;
|
|
88
|
+
align-items: center;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
&__link {
|
|
92
|
+
color: var(--secondary-text-link-default-focus);
|
|
93
|
+
text-decoration: none;
|
|
94
|
+
transition: color 0.3s ease;
|
|
95
|
+
|
|
96
|
+
@include hover {
|
|
97
|
+
color: var(--secondary-text-link-hover);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
@include pressed {
|
|
101
|
+
color: var(--secondary-text-link-pressed);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&__current {
|
|
106
|
+
color: var(--primary-text-tertiary);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
&__ellipsis {
|
|
110
|
+
color: var(--primary-text-tertiary);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
&__separator {
|
|
114
|
+
margin: 0 var(--spacing-xs);
|
|
115
|
+
color: var(--primary-text-quaternary);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&.--small-size {
|
|
119
|
+
height: 18px;
|
|
120
|
+
|
|
121
|
+
#{$breadcrumbs} {
|
|
122
|
+
&__link,
|
|
123
|
+
&__current,
|
|
124
|
+
&__ellipsis {
|
|
125
|
+
font: var(--typography-text-xs-regular);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
&.--medium-size {
|
|
131
|
+
height: 20px;
|
|
132
|
+
|
|
133
|
+
#{$breadcrumbs} {
|
|
134
|
+
&__link,
|
|
135
|
+
&__current,
|
|
136
|
+
&__ellipsis {
|
|
137
|
+
font: var(--typography-text-s-regular);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
</style>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
Компонент `BaseBreadcrumbs` отображает навигационные "хлебные крошки". Поддерживает интеграцию с `vue-router` для навигации, но может работать и без него, используя обычные ссылки `<a>`.
|
|
2
|
+
|
|
3
|
+
### Шаблон:
|
|
4
|
+
- **Основной элемент** — это контейнер `<nav>`, который содержит список `<ul>`. Каждый элемент в списке (`<li>`) представляет собой хлебную крошку.
|
|
5
|
+
- Если элемент крошки является многоточием (`...`), то он отображается через `span` с классом `base-breadcrumbs__ellipsis`.
|
|
6
|
+
- Если крошка имеет свойство `to` и не является последним элементом, она становится ссылкой (`router-link`) или если в проекте не установлен vue-router, то используется тэг `a`, которая ведет на указанный путь.
|
|
7
|
+
- Если крошка — последняя, то она отображается как текст без ссылки.
|
|
8
|
+
- После каждой крошки, кроме последней, добавляется разделитель ("/"), чтобы показать визуальное разделение между элементами.
|
|
9
|
+
|
|
10
|
+
### Скрипт:
|
|
11
|
+
- **Props**: Компонент принимает один проп — `crumbs`, который представляет собой массив объектов, содержащих информацию о каждой крошке (например, метка и путь).
|
|
12
|
+
- **Composables**:
|
|
13
|
+
- `useKitSize`: Этот composable используется для вычисления нужных классов в зависимости от размера компонента (например, `small`, `medium`).
|
|
14
|
+
- **Вычисляемые свойства**:
|
|
15
|
+
- `classList`: Содержит список классов для управления размерами, полученный из composable.
|
|
16
|
+
- `displayedCrumbs`: Это вычисляемое свойство ограничивает количество отображаемых крошек. Если крошек больше 5, то показывается первая крошка, многоточие и последние 4 крошки.
|
|
17
|
+
|
|
18
|
+
### Стили:
|
|
19
|
+
- **Основной контейнер** имеет список с классом `base-breadcrumbs__list`, который отображает крошки горизонтально с помощью `flex`.
|
|
20
|
+
- Каждый элемент списка (`li`) отображается как флекс-контейнер, что позволяет правильно выравнивать содержимое.
|
|
21
|
+
- Крошки, которые являются ссылками, имеют стили для обычного состояния, наведения и нажатия.
|
|
22
|
+
- Для каждого размера (`small`, `medium`) предусмотрены свои стили, включая размеры шрифтов.
|
|
23
|
+
|
|
24
|
+
### Использование:
|
|
25
|
+
Чтобы использовать компонент, нужно передать в него массив крошек через проп `crumbs`. Каждая крошка может содержать следующие свойства:
|
|
26
|
+
- `label`: текст, который будет отображаться на крошке.
|
|
27
|
+
- `to`: путь для `router-link` или `a` (опционально).
|
|
28
|
+
- `isEllipsis`: если нужно показать многоточие, передайте это свойство.
|
|
29
|
+
|
|
30
|
+
Пример использования:
|
|
31
|
+
|
|
32
|
+
```vue
|
|
33
|
+
<BaseBreadcrumbs :crumbs="crumbs" size="medium" />
|
|
34
|
+
|
|
35
|
+
<script setup lang="ts">
|
|
36
|
+
import { ref } from 'vue';
|
|
37
|
+
|
|
38
|
+
const crumbs = ref([
|
|
39
|
+
{ label: 'Home', to: '/' },
|
|
40
|
+
{ label: 'Products', to: '/products' },
|
|
41
|
+
{ label: 'Electronics', to: '/products/electronics' },
|
|
42
|
+
{ label: 'Smartphones', to: '/products/electronics/smartphones' },
|
|
43
|
+
{ label: 'iPhone 12', to: '/products/electronics/smartphones/iphone-12' },
|
|
44
|
+
]);
|
|
45
|
+
</script>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Возможные улучшения:
|
|
49
|
+
- **Параметр для ограничения количества крошек**: Сейчас ограничение на количество крошек жестко прописано в коде (5). Можно сделать это настройкой пропса, чтобы компонент был более гибким.
|
|
@@ -0,0 +1,489 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Component
|
|
3
|
+
:is="componentTag"
|
|
4
|
+
v-bind="componentAttrs"
|
|
5
|
+
class="base-button"
|
|
6
|
+
:class="[classList]"
|
|
7
|
+
>
|
|
8
|
+
<template v-if="!loading">
|
|
9
|
+
<slot></slot>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<base-loader
|
|
13
|
+
v-else
|
|
14
|
+
class="base-button__loader"
|
|
15
|
+
/>
|
|
16
|
+
</Component>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script setup lang="ts">
|
|
20
|
+
import BaseLoader from '../BaseLoader/BaseLoader.vue';
|
|
21
|
+
import type { ICoreButtonProps } from '../../types/button';
|
|
22
|
+
import { useKitInteractive } from '../../composables/kit/interactive';
|
|
23
|
+
import { useAttrs, computed } from 'vue';
|
|
24
|
+
import { useKitSize } from '../../composables/kit/size'
|
|
25
|
+
import { useKitColor } from '../../composables/kit/color'
|
|
26
|
+
import { useKitState } from '../../composables/kit/state'
|
|
27
|
+
import { useKitStyle } from '../../composables/kit/style'
|
|
28
|
+
|
|
29
|
+
const props = withDefaults(defineProps<ICoreButtonProps>(), {
|
|
30
|
+
tag: 'button',
|
|
31
|
+
color: 'primary',
|
|
32
|
+
size: 'medium',
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const { componentTag, interactiveClassList } = useKitInteractive(props);
|
|
36
|
+
const { sizeClassList } = useKitSize(props);
|
|
37
|
+
const { colorClassList } = useKitColor(props);
|
|
38
|
+
const { stateClassList, stateAttrs } = useKitState(props);
|
|
39
|
+
const { styleClassList } = useKitStyle(props);
|
|
40
|
+
const attrs = useAttrs();
|
|
41
|
+
|
|
42
|
+
const externalLink = computed(() => {
|
|
43
|
+
if (attrs.to) {
|
|
44
|
+
return {
|
|
45
|
+
href: attrs.to,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
return {};
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
const componentAttrs = computed(() => ({
|
|
52
|
+
...attrs,
|
|
53
|
+
...stateAttrs.value,
|
|
54
|
+
...externalLink.value,
|
|
55
|
+
|
|
56
|
+
...(props.tag === 'button' && {
|
|
57
|
+
type: attrs.type || 'button',
|
|
58
|
+
}),
|
|
59
|
+
}));
|
|
60
|
+
|
|
61
|
+
const classList = computed(() => [
|
|
62
|
+
interactiveClassList.value,
|
|
63
|
+
sizeClassList.value,
|
|
64
|
+
colorClassList.value,
|
|
65
|
+
stateClassList.value,
|
|
66
|
+
styleClassList.value,
|
|
67
|
+
]);
|
|
68
|
+
</script>
|
|
69
|
+
|
|
70
|
+
<style lang="scss">
|
|
71
|
+
@import '@/styles/variables';
|
|
72
|
+
@import '@/styles/root';
|
|
73
|
+
|
|
74
|
+
.base-button {
|
|
75
|
+
@include reset-button;
|
|
76
|
+
@include is-disabled-state;
|
|
77
|
+
|
|
78
|
+
display: inline-flex;
|
|
79
|
+
align-items: center;
|
|
80
|
+
justify-content: center;
|
|
81
|
+
text-align: center;
|
|
82
|
+
text-decoration: none;
|
|
83
|
+
appearance: none;
|
|
84
|
+
cursor: pointer;
|
|
85
|
+
user-select: none;
|
|
86
|
+
transition: all var(--ui-transition);
|
|
87
|
+
|
|
88
|
+
&.--is-loading {
|
|
89
|
+
@include loading-element;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&__loader {
|
|
93
|
+
margin: auto;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&.--is-underline {
|
|
97
|
+
text-decoration: underline;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
&.--extra-small-size {
|
|
101
|
+
column-gap: var(--spacing-xs);
|
|
102
|
+
height: 32px;
|
|
103
|
+
padding: var(--spacing-2s) var(--spacing-m);
|
|
104
|
+
font: var(--typography-text-s-medium);
|
|
105
|
+
border-radius: var(--corner-radius-xs);
|
|
106
|
+
|
|
107
|
+
.loader__circle-icon {
|
|
108
|
+
width: 20px;
|
|
109
|
+
height: 20px;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
&.--small-size {
|
|
114
|
+
column-gap: var(--spacing-xs);
|
|
115
|
+
height: 40px;
|
|
116
|
+
padding: var(--spacing-2m) var(--spacing-l);
|
|
117
|
+
font: var(--typography-text-m-medium);
|
|
118
|
+
border-radius: var(--corner-radius-s);
|
|
119
|
+
|
|
120
|
+
.loader__circle-icon {
|
|
121
|
+
width: 20px;
|
|
122
|
+
height: 20px;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
&.--medium-size {
|
|
127
|
+
column-gap: var(--spacing-xs);
|
|
128
|
+
height: 48px;
|
|
129
|
+
padding: var(--spacing-m) var(--spacing-l);
|
|
130
|
+
font: var(--typography-text-l-medium);
|
|
131
|
+
border-radius: var(--corner-radius-m);
|
|
132
|
+
|
|
133
|
+
.loader__circle-icon {
|
|
134
|
+
width: 24px;
|
|
135
|
+
height: 24px;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
&.--large-size {
|
|
140
|
+
column-gap: var(--spacing-xs);
|
|
141
|
+
height: 56px;
|
|
142
|
+
padding: var(--spacing-m) var(--spacing-l);
|
|
143
|
+
font: var(--typography-text-l-medium);
|
|
144
|
+
border-radius: var(--corner-radius-m);
|
|
145
|
+
|
|
146
|
+
.loader__circle-icon {
|
|
147
|
+
width: 32px;
|
|
148
|
+
height: 32px;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
&.--is-interactive {
|
|
153
|
+
height: 22px;
|
|
154
|
+
padding: 0;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
&.--primary-color {
|
|
158
|
+
color: var(--primary-black-white);
|
|
159
|
+
background: var(--primary-blue);
|
|
160
|
+
|
|
161
|
+
i,svg {
|
|
162
|
+
color: var(--primary-black-white) !important;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
@include hover {
|
|
166
|
+
background: var(--primary-blue-800);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
@include pressed {
|
|
170
|
+
background: var(--primary-blue-deep);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
@include focused {
|
|
174
|
+
outline: 4px solid var(--effects-primary-focus);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
@include is-disabled-state {
|
|
178
|
+
color: var(--primary-blue-100);
|
|
179
|
+
background: var(--primary-blue-300);
|
|
180
|
+
|
|
181
|
+
i,svg {
|
|
182
|
+
color: var(--primary-blue-100) !important;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
&.--secondary-color {
|
|
188
|
+
color: var(--primary-black-800);
|
|
189
|
+
background: var(--primary-black-200);
|
|
190
|
+
|
|
191
|
+
i,svg {
|
|
192
|
+
color: var(--primary-black-800) !important;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
@include hover {
|
|
196
|
+
color: var(--primary-black-900);
|
|
197
|
+
background: var(--primary-black-300);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
@include pressed {
|
|
201
|
+
background: var(--primary-black-400);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
@include focused {
|
|
205
|
+
outline: 4px solid var(--effects-primary-focus);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
@include is-disabled-state {
|
|
209
|
+
color: var(--primary-black-400);
|
|
210
|
+
background: var(--primary-black-100);
|
|
211
|
+
|
|
212
|
+
i,svg {
|
|
213
|
+
color: var(--primary-black-400) !important;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
&.--tertiary-gray-color {
|
|
219
|
+
color: var(--primary-black-600);
|
|
220
|
+
background: transparent;
|
|
221
|
+
border: 1px solid var(--primary-black-400);
|
|
222
|
+
|
|
223
|
+
i,svg {
|
|
224
|
+
color: var(--primary-black-600) !important;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
@include hover {
|
|
228
|
+
color: var(--primary-black-700);
|
|
229
|
+
text-decoration: none;
|
|
230
|
+
border: 1px solid var(--primary-black-500);
|
|
231
|
+
|
|
232
|
+
i,svg {
|
|
233
|
+
color: var(--primary-black-700) !important;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
@include pressed {
|
|
238
|
+
color: var(--primary-black-800);
|
|
239
|
+
border: 1px solid var(--primary-black-600);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
@include focused {
|
|
243
|
+
border: 1px solid var(--primary-black-400);
|
|
244
|
+
outline: 4px solid var(--effects-primary-focus);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
@include is-disabled-state {
|
|
248
|
+
color: var(--primary-black-400);
|
|
249
|
+
border: 1px solid var(--primary-black-300);
|
|
250
|
+
|
|
251
|
+
i,svg {
|
|
252
|
+
color: var(--primary-black-400) !important;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
&.--tertiary-blue-color {
|
|
258
|
+
color: var(--primary-blue);
|
|
259
|
+
background: transparent;
|
|
260
|
+
border: 1px solid var(--primary-blue);
|
|
261
|
+
|
|
262
|
+
i,svg {
|
|
263
|
+
color: var(--primary-blue) !important;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
@include hover {
|
|
267
|
+
color: var(--primary-blue-800);
|
|
268
|
+
text-decoration: none;
|
|
269
|
+
border: 1px solid var(--primary-blue-800);
|
|
270
|
+
|
|
271
|
+
i,svg {
|
|
272
|
+
color: var(--primary-blue-800) !important;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
@include pressed {
|
|
277
|
+
color: var(--primary-blue-deep);
|
|
278
|
+
border: 1px solid var(--primary-blue-deep);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
@include focused {
|
|
282
|
+
outline: 4px solid var(--effects-primary-focus);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
@include is-disabled-state {
|
|
286
|
+
color: var(--primary-black-400);
|
|
287
|
+
border: 1px solid var(--primary-black-300);
|
|
288
|
+
|
|
289
|
+
i,svg {
|
|
290
|
+
color: var(--primary-black-400) !important;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
&.--quaternary-gray-color {
|
|
296
|
+
color: var(--primary-black-600);
|
|
297
|
+
background: transparent;
|
|
298
|
+
|
|
299
|
+
i,svg {
|
|
300
|
+
color: var(--primary-black-600) !important;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
@include hover {
|
|
304
|
+
color: var(--primary-black-700);
|
|
305
|
+
background: var(--primary-black-100);
|
|
306
|
+
|
|
307
|
+
i,svg {
|
|
308
|
+
color: var(--primary-black-700) !important;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
@include pressed {
|
|
313
|
+
color: var(--primary-black-800);
|
|
314
|
+
background: var(--primary-black-200);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
@include focused {
|
|
318
|
+
background: rgb(255 255 255 / 10%);
|
|
319
|
+
outline: 4px solid var(--effects-primary-focus);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
@include is-disabled-state {
|
|
323
|
+
color: var(--primary-black-400);
|
|
324
|
+
|
|
325
|
+
i,svg {
|
|
326
|
+
color: var(--primary-black-400) !important;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
&.--quaternary-blue-color {
|
|
332
|
+
color: var(--primary-blue);
|
|
333
|
+
background: transparent;
|
|
334
|
+
|
|
335
|
+
i,svg {
|
|
336
|
+
color: var(--primary-blue) !important;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
@include hover {
|
|
340
|
+
color: var(--primary-blue-900);
|
|
341
|
+
text-decoration: none;
|
|
342
|
+
background: var(--primary-blue-100);
|
|
343
|
+
|
|
344
|
+
i,svg {
|
|
345
|
+
color: var(--primary-blue-900) !important;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
@include pressed {
|
|
350
|
+
color: var(--primary-blue-deep);
|
|
351
|
+
background: var(--primary-blue-200);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
@include focused {
|
|
355
|
+
background: rgb(255 255 255 / 10%);
|
|
356
|
+
outline: 4px solid var(--effects-primary-focus);
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
@include is-disabled-state {
|
|
360
|
+
color: var(--primary-black-400);
|
|
361
|
+
|
|
362
|
+
i,svg {
|
|
363
|
+
color: var(--primary-black-400) !important;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
&.--link-blue-color {
|
|
369
|
+
color: var(--secondary-text-link-default-focus);
|
|
370
|
+
text-decoration: none;
|
|
371
|
+
background: transparent;
|
|
372
|
+
padding: var(--corner-radius-xxs);
|
|
373
|
+
|
|
374
|
+
i,svg {
|
|
375
|
+
color: var(--primary-blue) !important;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
@include hover {
|
|
379
|
+
color: var(--secondary-text-link-hover);
|
|
380
|
+
|
|
381
|
+
i,svg {
|
|
382
|
+
color: var(--primary-blue-700) !important;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
@include pressed {
|
|
387
|
+
color: var(--secondary-text-link-pressed);
|
|
388
|
+
|
|
389
|
+
i,svg {
|
|
390
|
+
color: var(--primary-blue-700) !important;
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
@include focused {
|
|
395
|
+
background: rgb(255 255 255 / 10%);
|
|
396
|
+
outline: 4px solid var(--effects-primary-focus);
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
@include is-disabled-state {
|
|
400
|
+
color: var(--secondary-text-link-disabled);
|
|
401
|
+
|
|
402
|
+
i,svg {
|
|
403
|
+
color: var(--primary-black-400) !important;
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
&.--link-critical-color {
|
|
409
|
+
color: var(--error-red);
|
|
410
|
+
text-decoration: none;
|
|
411
|
+
background: transparent;
|
|
412
|
+
padding: var(--corner-radius-xxs);
|
|
413
|
+
|
|
414
|
+
i,svg {
|
|
415
|
+
color: var(--error-red) !important;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
@include hover {
|
|
419
|
+
color: var(--error-red-light-01);
|
|
420
|
+
|
|
421
|
+
i,svg {
|
|
422
|
+
color: var(--error-red-light-01) !important;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
@include pressed {
|
|
427
|
+
color: var(--error-red-deep);
|
|
428
|
+
|
|
429
|
+
i,svg {
|
|
430
|
+
color: var(--error-red-deep) !important;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
@include focused {
|
|
435
|
+
background: rgb(255 255 255 / 10%);
|
|
436
|
+
outline: 4px solid var(--effects-error-focus);
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
@include is-disabled-state {
|
|
440
|
+
color: var(--primary-black-400);
|
|
441
|
+
|
|
442
|
+
i,svg {
|
|
443
|
+
color: var(--primary-black-400) !important;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
&.--link-gray-color {
|
|
449
|
+
color: var(--secondary-text-gray-link-default-focus);
|
|
450
|
+
background: transparent;
|
|
451
|
+
text-decoration: underline;
|
|
452
|
+
padding: var(--corner-radius-xxs);
|
|
453
|
+
|
|
454
|
+
i,svg {
|
|
455
|
+
color: var(--primary-black) !important;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
@include hover {
|
|
459
|
+
color: var(--secondary-text-gray-link-hover);
|
|
460
|
+
|
|
461
|
+
i,svg {
|
|
462
|
+
color: var(--primary-black-500) !important;
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
@include pressed {
|
|
467
|
+
color: var(--secondary-text-gray-link-pressed);
|
|
468
|
+
|
|
469
|
+
i,svg {
|
|
470
|
+
color: var(--primary-black-700) !important;
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
@include focused {
|
|
475
|
+
background: rgb(255 255 255 / 10%);
|
|
476
|
+
outline: 4px solid var(--effects-gray-focus);
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
@include is-disabled-state {
|
|
480
|
+
color: var(--secondary-text-gray-link-disabled);
|
|
481
|
+
border-bottom: none;
|
|
482
|
+
|
|
483
|
+
i,svg {
|
|
484
|
+
color: var(--primary-black-400) !important;
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
</style>
|