@formixru/b2b-ui 1.0.0

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 (73) hide show
  1. package/CONTRIBUTING.md +61 -0
  2. package/README.md +30 -0
  3. package/package.json +110 -0
  4. package/src/base.scss +89 -0
  5. package/src/components/action-list/index.scss +38 -0
  6. package/src/components/banner/index.scss +30 -0
  7. package/src/components/breadcrumbs/index.js +8 -0
  8. package/src/components/breadcrumbs/index.scss +55 -0
  9. package/src/components/button/index.scss +223 -0
  10. package/src/components/checkbox/index.scss +94 -0
  11. package/src/components/color-input/index.scss +88 -0
  12. package/src/components/color-input/index.vue +156 -0
  13. package/src/components/date-input/index.scss +126 -0
  14. package/src/components/date-input/index.vue +240 -0
  15. package/src/components/delete-all/index.scss +44 -0
  16. package/src/components/dialog/index.js +221 -0
  17. package/src/components/dialog/index.scss +198 -0
  18. package/src/components/empty-list/index.scss +97 -0
  19. package/src/components/file-input/index.scss +119 -0
  20. package/src/components/file-input/index.vue +333 -0
  21. package/src/components/font-input/index.scss +47 -0
  22. package/src/components/font-input/index.vue +154 -0
  23. package/src/components/form/index.js +228 -0
  24. package/src/components/form/index.scss +398 -0
  25. package/src/components/header-announcement/index.scss +48 -0
  26. package/src/components/input/index.js +85 -0
  27. package/src/components/input/index.scss +87 -0
  28. package/src/components/link/index.scss +266 -0
  29. package/src/components/loader/index.js +65 -0
  30. package/src/components/loader/index.scss +99 -0
  31. package/src/components/nobr/index.scss +5 -0
  32. package/src/components/overlay/index.js +82 -0
  33. package/src/components/overlay/index.scss +29 -0
  34. package/src/components/pagination/index.scss +59 -0
  35. package/src/components/pagination-group/index.js +5 -0
  36. package/src/components/pagination-group/index.scss +86 -0
  37. package/src/components/quantity-input/index.scss +179 -0
  38. package/src/components/quantity-input/index.vue +141 -0
  39. package/src/components/radio/index.scss +80 -0
  40. package/src/components/radio-list/index.scss +79 -0
  41. package/src/components/range-input/index.scss +109 -0
  42. package/src/components/range-input/index.vue +185 -0
  43. package/src/components/rating-input/index.js +32 -0
  44. package/src/components/rating-input/index.scss +36 -0
  45. package/src/components/select/index.js +6 -0
  46. package/src/components/select/index.scss +84 -0
  47. package/src/components/sidebar/index.js +174 -0
  48. package/src/components/sidebar/index.scss +398 -0
  49. package/src/components/simple-page/index.scss +32 -0
  50. package/src/components/slider-nav/index.scss +82 -0
  51. package/src/components/slider-pagination/index.scss +130 -0
  52. package/src/components/spinner/index.scss +35 -0
  53. package/src/components/sr-only/index.scss +25 -0
  54. package/src/components/steps/index.scss +155 -0
  55. package/src/components/suggest-input/index.scss +141 -0
  56. package/src/components/suggest-input/index.vue +324 -0
  57. package/src/components/tabs/index.js +192 -0
  58. package/src/components/tabs/index.scss +137 -0
  59. package/src/components/time-select/index.scss +27 -0
  60. package/src/components/toggle/index.scss +76 -0
  61. package/src/components/tooltip/index.js +69 -0
  62. package/src/components/tooltip/index.scss +112 -0
  63. package/src/components/total/index.scss +162 -0
  64. package/src/components/warning-message/index.scss +170 -0
  65. package/src/components/warning-message/index.vue +94 -0
  66. package/src/components/wysiwyg/index.scss +344 -0
  67. package/src/helpers/css-var.js +8 -0
  68. package/src/helpers/error-handler.js +61 -0
  69. package/src/helpers/get-smart-captcha.js +7 -0
  70. package/src/helpers/is-in-viewport.js +10 -0
  71. package/src/helpers/mm.js +52 -0
  72. package/src/helpers/scroll-to.js +21 -0
  73. package/src/variables.scss +1295 -0
@@ -0,0 +1,29 @@
1
+ @use '../../variables' as *;
2
+
3
+ $b: '.overlay';
4
+
5
+ :root {
6
+ --overlay-z-index: 900;
7
+ }
8
+
9
+ #{$b} {
10
+ background-color: $overlay-bg;
11
+ height: 100%;
12
+ left: 0;
13
+ opacity: 0;
14
+ position: fixed;
15
+ top: 0;
16
+ transform: translateX(-100%);
17
+ transition-duration: var(--duration-leave-s);
18
+ transition-property: opacity;
19
+ transition-timing-function: var(--easing-acceleration);
20
+ width: 100%;
21
+ z-index: var(--overlay-z-index);
22
+
23
+ &_active {
24
+ opacity: 1;
25
+ transform: translateX(0);
26
+ transition-duration: var(--duration-enter-s);
27
+ transition-timing-function: var(--easing-deceleration);
28
+ }
29
+ }
@@ -0,0 +1,59 @@
1
+ @use '../../variables' as *;
2
+
3
+ $b: '.pagination';
4
+
5
+ #{$b} {
6
+ align-items: center;
7
+ display: flex;
8
+ justify-content: center;
9
+
10
+ &__item {
11
+ align-items: center;
12
+ color: $pagination-item-color;
13
+ display: flex;
14
+ justify-content: center;
15
+ padding: 4px * 2;
16
+ transition-duration: var(--duration-micro-s);
17
+ transition-property: color;
18
+ transition-timing-function: var(--easing-standard);
19
+
20
+ @include font($pagination-item-font);
21
+
22
+ &:first-child {
23
+ padding-right: 4px * 2;
24
+ }
25
+
26
+ &:last-child {
27
+ padding-left: 4px * 2;
28
+ }
29
+
30
+ &:any-link {
31
+ text-decoration: none;
32
+
33
+ &:hover,
34
+ &:focus-visible {
35
+ color: $pagination-item-active-color;
36
+ }
37
+ }
38
+
39
+ &_disabled {
40
+ color: $pagination-item-disabled-color;
41
+ }
42
+
43
+ &_active {
44
+ color: $pagination-item-active-color;
45
+ }
46
+ }
47
+
48
+ &__arrow {
49
+ fill: currentcolor;
50
+ height: 1em;
51
+ width: 1em;
52
+
53
+ &_prev {
54
+ }
55
+
56
+ &_next {
57
+ }
58
+ }
59
+ }
@@ -0,0 +1,5 @@
1
+ document.body.addEventListener('change', (event) => {
2
+ if (event.target.matches('.pagination-group__per-page select')) {
3
+ location.assign(event.target.value);
4
+ }
5
+ });
@@ -0,0 +1,86 @@
1
+ @use 'sass:math';
2
+ @use '../../variables' as *;
3
+
4
+ $b: '.pagination-group';
5
+
6
+ #{$b} {
7
+ color: $pagination-group-color;
8
+ display: flex;
9
+ flex-direction: column;
10
+
11
+ @media (--tablet-landscape-up) {
12
+ flex-direction: row;
13
+ flex-wrap: wrap;
14
+ }
15
+
16
+ &_compact {
17
+ }
18
+
19
+ .lk-table + & {
20
+ margin-top: 4px * 4;
21
+ }
22
+
23
+ &__per-page {
24
+ width: math.div(100%, 3);
25
+
26
+ @media (--tablet-portrait-down) {
27
+ display: none;
28
+ }
29
+
30
+ label {
31
+ align-items: center;
32
+ display: flex;
33
+ width: 100%;
34
+ }
35
+
36
+ .select {
37
+ margin-left: 4px * 4;
38
+ width: 4px * 28;
39
+ }
40
+ }
41
+
42
+ &__infinite {
43
+ display: flex;
44
+ justify-content: center;
45
+ width: 100%;
46
+
47
+ &:not(:first-child) {
48
+ @media (--tablet-landscape-up) {
49
+ width: math.div(100%, 3);
50
+ }
51
+
52
+ #{$b}_compact & {
53
+ @media (--tablet-landscape-only) {
54
+ margin-top: 4px * 6;
55
+ width: 100%;
56
+ }
57
+ }
58
+ }
59
+
60
+ &:empty {
61
+ display: none;
62
+ }
63
+ }
64
+
65
+ &__pagination {
66
+ width: 100%;
67
+
68
+ &:not(:first-child) {
69
+ @media (--tablet-landscape-up) {
70
+ margin-top: 4px * 6;
71
+ }
72
+
73
+ #{$b}__infinite:first-child:empty + & {
74
+ @media (--tablet-landscape-up) {
75
+ margin-top: 0;
76
+ }
77
+ }
78
+ }
79
+
80
+ #{$b}__infinite:not(:empty) + & {
81
+ @media (--tablet-portrait-down) {
82
+ margin-top: 4px * 6;
83
+ }
84
+ }
85
+ }
86
+ }
@@ -0,0 +1,179 @@
1
+ @use '../../variables' as *;
2
+
3
+ $b: '.quantity-input';
4
+
5
+ #{$b} {
6
+ display: flex;
7
+
8
+ &_medium {
9
+ }
10
+
11
+ &_big {
12
+ }
13
+
14
+ &__button {
15
+ align-items: center;
16
+ background-color: $quantity-input-button-bg;
17
+ border: $quantity-input-button-border-width solid $quantity-input-button-border-color;
18
+ color: $quantity-input-button-color;
19
+ cursor: pointer;
20
+ display: flex;
21
+ flex-shrink: 0;
22
+ height: 4px * 10;
23
+ justify-content: center;
24
+ transition-duration: var(--duration-micro-s);
25
+ transition-property: background-color, border-color, color;
26
+ transition-timing-function: var(--easing-standard);
27
+ width: 4px * 6;
28
+
29
+ &:disabled {
30
+ background-color: $quantity-input-button-disabled-bg;
31
+ border-color: $quantity-input-button-border-disabled-color;
32
+ cursor: default;
33
+ }
34
+
35
+ &:not(:disabled):hover,
36
+ &:not(:disabled):focus-visible {
37
+ border-color: $quantity-input-button-border-active-color;
38
+ }
39
+
40
+ &_minus {
41
+ border-bottom-left-radius: $quantity-input-radius;
42
+ border-top-left-radius: $quantity-input-radius;
43
+
44
+ #{$b}_medium & {
45
+ @media (--tablet-landscape-up) {
46
+ border-bottom-left-radius: $quantity-input-medium-radius;
47
+ border-top-left-radius: $quantity-input-medium-radius;
48
+ }
49
+ }
50
+
51
+ #{$b}_big & {
52
+ border-bottom-left-radius: $quantity-input-big-radius;
53
+ border-top-left-radius: $quantity-input-big-radius;
54
+ }
55
+ }
56
+
57
+ &_plus {
58
+ border-bottom-right-radius: $quantity-input-radius;
59
+ border-top-right-radius: $quantity-input-radius;
60
+
61
+ #{$b}_medium & {
62
+ @media (--tablet-landscape-up) {
63
+ border-bottom-right-radius: $quantity-input-medium-radius;
64
+ border-top-right-radius: $quantity-input-medium-radius;
65
+ }
66
+ }
67
+
68
+ #{$b}_big & {
69
+ border-bottom-right-radius: $quantity-input-big-radius;
70
+ border-top-right-radius: $quantity-input-big-radius;
71
+ }
72
+ }
73
+
74
+ #{$b}_medium & {
75
+ @media (--tablet-landscape-up) {
76
+ height: 4px * 12;
77
+ width: 4px * 10;
78
+ }
79
+ }
80
+
81
+ #{$b}_big & {
82
+ height: 4px * 12;
83
+ width: 4px * 16;
84
+ }
85
+ }
86
+
87
+ &__icon {
88
+ fill: currentcolor;
89
+ height: 4px * 2;
90
+ width: 4px * 2;
91
+
92
+ #{$b}_medium & {
93
+ @media (--tablet-landscape-up) {
94
+ height: 4px * 3;
95
+ width: 4px * 3;
96
+ }
97
+ }
98
+
99
+ #{$b}_medium #{$b}__button_minus & {
100
+ @media (--tablet-landscape-up) {
101
+ margin-left: 2px;
102
+ }
103
+ }
104
+
105
+ #{$b}_medium #{$b}__button_plus & {
106
+ @media (--tablet-landscape-up) {
107
+ margin-right: 2px;
108
+ }
109
+ }
110
+
111
+ #{$b}_big & {
112
+ height: 4px * 3;
113
+ width: 4px * 3;
114
+ }
115
+
116
+ #{$b}_big #{$b}__button_minus & {
117
+ margin-left: 4px;
118
+ }
119
+
120
+ #{$b}_big #{$b}__button_plus & {
121
+ margin-right: 4px;
122
+ }
123
+ }
124
+
125
+ &__input {
126
+ appearance: none;
127
+ background-color: $quantity-input-bg;
128
+ border-bottom: $quantity-input-border-width solid $quantity-input-border-color;
129
+ border-left-style: none;
130
+ border-radius: 0;
131
+ border-right-style: none;
132
+ border-top: $quantity-input-border-width solid $quantity-input-border-color;
133
+ color: $quantity-input-color;
134
+ flex-grow: 1;
135
+ flex-shrink: 1;
136
+ height: 4px * 10;
137
+ text-align: center;
138
+ transition-duration: var(--duration-micro-s);
139
+ transition-property: border-color, color;
140
+ transition-timing-function: var(--easing-standard);
141
+ width: 0%; /* Иначе в Firefox не уменьшается (например, в блоке "Комплектации" на странице товара) */
142
+
143
+ @include font($quantity-input-font);
144
+
145
+ @media (--tablet-landscape-up) {
146
+ appearance: textfield;
147
+ }
148
+
149
+ &::-webkit-inner-spin-button,
150
+ &::-webkit-outer-spin-button {
151
+ @media (--tablet-landscape-up) {
152
+ appearance: none;
153
+ }
154
+ }
155
+
156
+ &:disabled {
157
+ border-color: $quantity-input-disabled-border-color;
158
+ color: $quantity-input-disabled-color;
159
+ }
160
+
161
+ &:not(:disabled):focus-visible {
162
+ border-color: $quantity-input-disabled-focus-visible-border-color;
163
+ }
164
+
165
+ #{$b}_medium & {
166
+ @media (--tablet-landscape-up) {
167
+ height: 4px * 12;
168
+
169
+ @include font($quantity-input-medium-font);
170
+ }
171
+ }
172
+
173
+ #{$b}_big & {
174
+ height: 4px * 12;
175
+
176
+ @include font($quantity-input-big-font);
177
+ }
178
+ }
179
+ }
@@ -0,0 +1,141 @@
1
+ <template>
2
+ <div
3
+ class="quantity-input"
4
+ :class="{ 'quantity-input_medium': size === 'medium', 'quantity-input_big': size === 'big' }"
5
+ >
6
+ <button
7
+ class="quantity-input__button quantity-input__button_minus"
8
+ type="button"
9
+ :disabled="(disabled && !focus) || quantity <= min"
10
+ @click="input(Number((quantity - step).toFixed(digits)))"
11
+ >
12
+ <svg class="quantity-input__icon"><use :href="`${ICONS_PATH}#minus`" /></svg>
13
+ </button>
14
+ <input
15
+ class="quantity-input__input"
16
+ type="number"
17
+ :name="name"
18
+ :value="quantity"
19
+ :disabled="(disabled && !focus) || auth.length > 0"
20
+ @input="input($event.target.value)"
21
+ />
22
+ <button
23
+ class="quantity-input__button quantity-input__button_plus"
24
+ type="button"
25
+ :disabled="(disabled && !focus) || quantity >= max"
26
+ @click="input(Number((quantity + step).toFixed(digits)))"
27
+ >
28
+ <svg class="quantity-input__icon"><use :href="`${ICONS_PATH}#plus`" /></svg>
29
+ </button>
30
+ </div>
31
+ </template>
32
+
33
+ <script setup>
34
+ import { computed, ref, toRefs, watch } from 'vue';
35
+
36
+ import { show as showDialog } from '../dialog/index.js';
37
+
38
+ const ICONS_PATH = window.ICONS_PATH;
39
+
40
+ const emit = defineEmits(['input', 'disableOthers', 'enableOthers']);
41
+
42
+ const props = defineProps({
43
+ value: {
44
+ type: Number,
45
+ required: true,
46
+ },
47
+ disabled: {
48
+ type: Boolean,
49
+ },
50
+ concurrent: {
51
+ type: Boolean,
52
+ },
53
+ max: {
54
+ type: Number,
55
+ default: 0,
56
+ },
57
+ min: {
58
+ type: Number,
59
+ default: 0,
60
+ },
61
+ step: {
62
+ type: Number,
63
+ default: 1,
64
+ },
65
+ name: {
66
+ type: String,
67
+ default: '',
68
+ },
69
+ size: {
70
+ type: String,
71
+ default: '',
72
+ },
73
+ auth: {
74
+ type: String,
75
+ default: '',
76
+ },
77
+ throttle: {
78
+ type: Number,
79
+ default: 1000,
80
+ },
81
+ });
82
+
83
+ const { value, disabled, concurrent, max, min, step, name, size, auth, throttle } = toRefs(props);
84
+ const quantity = ref(value.value);
85
+ const focus = ref(false);
86
+
87
+ const digits = computed(() => {
88
+ const arr = String(step.value).split('.');
89
+ if (arr.length === 1) {
90
+ return 0;
91
+ }
92
+ return arr.at(-1).length;
93
+ });
94
+
95
+ watch(value, (newValue) => {
96
+ quantity.value = newValue;
97
+ });
98
+
99
+ let throttleTimeout;
100
+ const input = (value) => {
101
+ if (auth.value) {
102
+ showDialog(document.querySelector(auth.value));
103
+ } else {
104
+ if (value === '') {
105
+ quantity.value = value;
106
+ value = min.value;
107
+ } else {
108
+ quantity.value = Number(value);
109
+ if (quantity.value < min.value) {
110
+ value = min.value;
111
+ quantity.value = min.value;
112
+ } else if (quantity.value > max.value) {
113
+ value = max.value;
114
+ quantity.value = max.value;
115
+ } else {
116
+ value = quantity.value;
117
+ }
118
+ }
119
+ if (!concurrent.value) {
120
+ focus.value = true;
121
+ emit('disableOthers');
122
+ }
123
+ clearTimeout(throttleTimeout);
124
+ throttleTimeout = setTimeout(() => {
125
+ emit('input', value);
126
+ }, throttle.value);
127
+ }
128
+ };
129
+
130
+ const update = () => {
131
+ quantity.value = value.value;
132
+ if (!concurrent.value) {
133
+ focus.value = false;
134
+ emit('enableOthers');
135
+ }
136
+ };
137
+
138
+ defineExpose({
139
+ update,
140
+ });
141
+ </script>
@@ -0,0 +1,80 @@
1
+ @use '../../variables' as *;
2
+
3
+ $b: '.radio';
4
+
5
+ #{$b} {
6
+ align-items: baseline;
7
+ display: inline-flex;
8
+
9
+ &__input {
10
+ align-items: center;
11
+ background-color: $radio-bg;
12
+ border: $radio-border-width solid $radio-border-color;
13
+ border-radius: 50%;
14
+ cursor: pointer;
15
+ display: flex;
16
+ flex-shrink: 0;
17
+ height: $radio-size;
18
+ justify-content: center;
19
+ top: 2px;
20
+ transition-duration: var(--duration-micro-s);
21
+ transition-property: background-color, border-color;
22
+ transition-timing-function: var(--easing-standard);
23
+ width: $radio-size;
24
+
25
+ &::before {
26
+ background-color: $radio-dot-color;
27
+ border-radius: 50%;
28
+ content: '';
29
+ height: 100%;
30
+ transform: scale(0);
31
+ transition-duration: var(--duration-micro-s);
32
+ transition-property: opacity, transform;
33
+ transition-timing-function: var(--easing-acceleration);
34
+ width: 100%;
35
+ }
36
+
37
+ :focus-visible + & {
38
+ background-color: $radio-active-bg;
39
+ border-color: $radio-active-border-color;
40
+ }
41
+
42
+ :disabled + & {
43
+ background-color: $radio-disabled-bg;
44
+ border-color: $radio-disabled-border-color;
45
+ cursor: default;
46
+ }
47
+
48
+ :checked + &::before {
49
+ transform: scale(0.5);
50
+ transition-timing-function: var(--easing-deceleration);
51
+ }
52
+
53
+ :checked:disabled + &::before {
54
+ opacity: 0.5;
55
+ }
56
+ }
57
+
58
+ &__label {
59
+ color: $radio-label-color;
60
+ cursor: pointer;
61
+ display: flex;
62
+ flex-basis: 100%;
63
+ flex-direction: column;
64
+ margin-left: 4px * 2;
65
+ transition-duration: var(--duration-micro-s);
66
+ transition-property: color;
67
+ transition-timing-function: var(--easing-standard);
68
+
69
+ @include font($radio-label-font);
70
+
71
+ :checked ~ & {
72
+ cursor: default;
73
+ }
74
+
75
+ :disabled ~ & {
76
+ color: $radio-disabled-label-color;
77
+ cursor: default;
78
+ }
79
+ }
80
+ }
@@ -0,0 +1,79 @@
1
+ @use 'sass:color';
2
+ @use '../../variables' as *;
3
+
4
+ $b: '.radio-list';
5
+
6
+ #{$b} {
7
+ display: flex;
8
+
9
+ &__item {
10
+ }
11
+
12
+ &__item-label {
13
+ align-items: center;
14
+ background-color: $radio-list-bg;
15
+ border: $radio-list-border-width solid $radio-list-border-color;
16
+ color: $radio-list-color;
17
+ cursor: pointer;
18
+ display: flex;
19
+ height: 4px * 10;
20
+ justify-content: center;
21
+ padding-left: 4px * 4;
22
+ padding-right: 4px * 4;
23
+ text-align: center;
24
+ text-decoration: none;
25
+ transition-duration: var(--duration-micro-s);
26
+ transition-property: background-color, border-color, color;
27
+ transition-timing-function: var(--easing-standard);
28
+ user-select: none;
29
+ white-space: nowrap;
30
+
31
+ @include font($radio-list-font);
32
+
33
+ #{$b}__item:first-child & {
34
+ border-bottom-left-radius: $radio-list-radius;
35
+ border-top-left-radius: $radio-list-radius;
36
+ }
37
+
38
+ #{$b}__item:last-child & {
39
+ border-bottom-right-radius: $radio-list-radius;
40
+ border-top-right-radius: $radio-list-radius;
41
+ }
42
+
43
+ #{$b}__item:not(:last-child) & {
44
+ border-right-style: none;
45
+ }
46
+
47
+ &:hover,
48
+ &:focus-visible {
49
+ background-color: $radio-list-active-bg;
50
+ border-color: $radio-list-active-border-color;
51
+ color: $radio-list-active-color;
52
+ }
53
+
54
+ :disabled + & {
55
+ background-color: $radio-list-disabled-bg;
56
+ border-color: $radio-list-disabled-border-color;
57
+ color: $radio-list-disabled-color;
58
+ cursor: default;
59
+ }
60
+
61
+ :checked + & {
62
+ background-color: $radio-list-selected-bg;
63
+ border-color: $radio-list-selected-border-color;
64
+ color: $radio-list-selected-color;
65
+ cursor: default;
66
+ }
67
+
68
+ :checked:disabled + & {
69
+ background-color: $radio-list-selected-disabled-bg;
70
+ color: $radio-list-selected-disabled-color;
71
+
72
+ @if color.alpha($button-disabled-bg) == 1 {
73
+ border-color: $radio-list-selected-disabled-border-color;
74
+ } @else {
75
+ border-color: transparent;
76
+ }
77
+ }
78
+ }
79
+ }