@formixru/b2b-ui 3.4.1 → 3.6.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formixru/b2b-ui",
3
- "version": "3.4.1",
3
+ "version": "3.6.0",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -10,7 +10,7 @@
10
10
  "browserslist": [
11
11
  "defaults and fully supports es6-module"
12
12
  ],
13
- "packageManager": "yarn@4.12.0",
13
+ "packageManager": "yarn@4.14.1",
14
14
  "scripts": {
15
15
  "_postinstall": "husky",
16
16
  "prepack": "yarn pinst --disable",
@@ -24,46 +24,47 @@
24
24
  },
25
25
  "devDependencies": {
26
26
  "@advdominion/css-var": "^1.0.1",
27
- "@advdominion/eslint-config": "^2.0.0",
27
+ "@advdominion/eslint-config": "^2.1.0",
28
28
  "@advdominion/get-scrollbar-width": "^2.0.1",
29
29
  "@advdominion/pluralize": "^1.0.2",
30
30
  "@advdominion/scroll-to": "^1.0.1",
31
31
  "@advdominion/stylelint-config": "^1.1.0",
32
32
  "@advdominion/tooltip": "^6.0.0",
33
- "@floating-ui/dom": "^1.7.5",
33
+ "@floating-ui/dom": "^1.7.6",
34
34
  "@popperjs/core": "^2.11.8",
35
- "@prettier/plugin-php": "^0.24.0",
36
- "@storybook/addon-designs": "^11.1.2",
37
- "@storybook/addon-docs": "^10.2.13",
38
- "@storybook/addon-links": "^10.2.13",
39
- "@storybook/vue3-vite": "^10.2.13",
40
- "@vitejs/plugin-vue": "^6.0.4",
41
- "@vueless/storybook-dark-mode": "^10.0.7",
42
- "browserslist": "^4.28.1",
35
+ "@prettier/plugin-php": "^0.25.0",
36
+ "@storybook/addon-designs": "^11.1.3",
37
+ "@storybook/addon-docs": "^10.4.0",
38
+ "@storybook/addon-links": "^10.4.0",
39
+ "@storybook/vue3-vite": "^10.4.0",
40
+ "@vitejs/plugin-vue": "^6.0.7",
41
+ "@vueless/storybook-dark-mode": "^10.0.8",
42
+ "browserslist": "^4.28.2",
43
43
  "color": "^5.0.3",
44
- "dayjs": "^1.11.19",
45
- "es-toolkit": "^1.44.0",
46
- "eslint": "^10.0.2",
44
+ "dayjs": "^1.11.20",
45
+ "es-toolkit": "^1.46.1",
46
+ "eslint": "^10.4.0",
47
47
  "husky": "^9.1.7",
48
48
  "imask": "^7.6.1",
49
- "lint-staged": "^16.2.7",
49
+ "js-cookie": "^3.0.7",
50
+ "lint-staged": "^17.0.5",
50
51
  "mime": "^4.1.0",
51
- "msw": "^2.12.10",
52
- "msw-storybook-addon": "^2.0.6",
52
+ "msw": "^2.14.6",
53
+ "msw-storybook-addon": "^2.0.7",
53
54
  "nouislider": "^15.8.1",
54
55
  "pinst": "^3.0.0",
55
- "postcss": "^8.5.6",
56
- "postcss-preset-env": "^11.2.0",
57
- "prettier": "^3.8.1",
56
+ "postcss": "^8.5.14",
57
+ "postcss-preset-env": "^11.3.0",
58
+ "prettier": "^3.8.3",
58
59
  "reset-css": "^5.0.2",
59
- "sass-embedded": "^1.97.3",
60
- "storybook": "^10.2.13",
61
- "stylelint": "^17.4.0",
62
- "swiper": "^12.1.2",
60
+ "sass-embedded": "^1.99.0",
61
+ "storybook": "^10.4.0",
62
+ "stylelint": "^17.11.1",
63
+ "swiper": "^12.1.4",
63
64
  "update-browserslist-db": "^1.2.3",
64
65
  "v-calendar": "3.0.1",
65
- "vite": "^7.3.1",
66
- "vue": "^3.5.29",
66
+ "vite": "^8.0.13",
67
+ "vue": "^3.5.34",
67
68
  "vue-eslint-parser": "^10.4.0",
68
69
  "yargs": "^18.0.0"
69
70
  },
@@ -77,6 +78,7 @@
77
78
  "dayjs": "^1.0.0",
78
79
  "es-toolkit": "^1.0.0",
79
80
  "imask": "^7.0.0",
81
+ "js-cookie": "^3.0.0",
80
82
  "mime": "^4.0.0",
81
83
  "nouislider": "^15.0.0",
82
84
  "reset-css": "^5.0.0",
@@ -0,0 +1,44 @@
1
+ import { cssVar } from '@advdominion/css-var';
2
+
3
+ export const hide = async ($b) => {
4
+ await $b.animate([{ transform: 'translateY(0)' }, { transform: 'translateY(100%)' }], {
5
+ duration: cssVar('--duration-leave-s'),
6
+ easing: cssVar('--easing-acceleration'),
7
+ }).finished;
8
+
9
+ $b.remove();
10
+ };
11
+
12
+ export const show = async ($b) => {
13
+ $b.hidden = false;
14
+
15
+ await $b.animate([{ transform: 'translateY(100%)' }, { transform: 'translateY(0)' }], {
16
+ duration: cssVar('--duration-enter-s'),
17
+ easing: cssVar('--easing-deceleration'),
18
+ }).finished;
19
+ };
20
+
21
+ export const init = async ($b) => {
22
+ const { default: Cookies } = await import('js-cookie');
23
+ const $button = $b.querySelector('.cookies__button');
24
+
25
+ $button.addEventListener('click', () => {
26
+ try {
27
+ const cookies = JSON.parse($button.dataset.cookies);
28
+ for (const [name, value] of Object.entries(cookies)) {
29
+ Cookies.set(name, value, { expires: 365 });
30
+ }
31
+ } catch (error) {
32
+ if (error.message.endsWith('is not valid JSON')) {
33
+ console.error('Похоже, что атрибут data-cookies не установлен или имеет некорректное значение');
34
+ }
35
+ console.error(error);
36
+ }
37
+
38
+ if (Cookies.get('APPSTORE') === 'Y') {
39
+ location.reload();
40
+ } else {
41
+ hide($b);
42
+ }
43
+ });
44
+ };
@@ -0,0 +1,73 @@
1
+ @use '../../variables' as *;
2
+ @use '../button';
3
+
4
+ $b: '.cookies';
5
+
6
+ #{$b} {
7
+ background-color: $cookies-bg;
8
+ bottom: calc(env(safe-area-inset-bottom) + var(--tab-bar-height));
9
+ box-shadow: $cookies-shadow;
10
+ left: 0;
11
+ position: fixed;
12
+ width: 100%;
13
+ z-index: 1050;
14
+
15
+ @include dark-border;
16
+ @include dark-border-disable((right, bottom, left));
17
+
18
+ @media (--tablet-landscape-up) {
19
+ bottom: 0;
20
+ }
21
+
22
+ &__wrapper {
23
+ align-items: center;
24
+ display: flex;
25
+ flex-direction: column;
26
+ padding-bottom: 16px;
27
+ padding-top: 16px;
28
+
29
+ @media (--tablet-landscape-up) {
30
+ flex-direction: row;
31
+ padding-bottom: 24px;
32
+ padding-top: 24px;
33
+ }
34
+ }
35
+
36
+ &__descr {
37
+ color: $cookies-descr-color;
38
+ flex-grow: 1;
39
+ text-align: center;
40
+
41
+ @include font($cookies-descr-mobile-font);
42
+
43
+ @media (--tablet-landscape-up) {
44
+ text-align: left;
45
+
46
+ @include font($cookies-descr-desktop-font);
47
+ }
48
+ }
49
+
50
+ &__button {
51
+ flex-shrink: 0;
52
+ margin-top: 16px;
53
+ width: 100%;
54
+
55
+ @include button.button(
56
+ $font: $button-small-font,
57
+ $height: $button-small-height,
58
+ $min-width: $button-small-min-width,
59
+ $padding: $button-small-padding
60
+ );
61
+
62
+ @media (--tablet-landscape-up) {
63
+ height: $button-height;
64
+ margin-left: 24px;
65
+ margin-top: 0;
66
+ min-width: $button-min-width;
67
+ padding: $button-padding;
68
+ width: auto;
69
+
70
+ @include font($button-font);
71
+ }
72
+ }
73
+ }
@@ -7,14 +7,14 @@ $b: '.empty-list';
7
7
  border-radius: $empty-list-radius;
8
8
  display: flex;
9
9
  flex-direction: column;
10
- padding: 4px * 6 4px * 4;
10
+ padding: 24px 16px;
11
11
 
12
12
  @include dark-border;
13
13
 
14
14
  @media (--tablet-landscape-up) {
15
15
  align-items: center;
16
16
  flex-direction: row;
17
- padding: 4px * 10 4px * 6;
17
+ padding: 40px 24px;
18
18
  }
19
19
 
20
20
  &_shadow {
@@ -25,13 +25,14 @@ $b: '.empty-list';
25
25
  align-self: center;
26
26
  fill: $empty-list-icon-color;
27
27
  flex-shrink: 0;
28
- margin-bottom: 4px * 6;
29
- width: 4px * 30;
28
+ margin-bottom: 24px;
29
+ user-select: none;
30
+ width: 120px;
30
31
 
31
32
  @media (--tablet-landscape-up) {
32
33
  margin-bottom: 0;
33
- margin-right: 4px * 12;
34
- width: 4px * 60;
34
+ margin-right: 48px;
35
+ width: 240px;
35
36
  }
36
37
  }
37
38
 
@@ -40,7 +41,7 @@ $b: '.empty-list';
40
41
  }
41
42
 
42
43
  &__title {
43
- margin-bottom: 4px * 4;
44
+ margin-bottom: 16px;
44
45
 
45
46
  @include font($empty-list-title-mobile-font);
46
47
 
@@ -50,22 +51,22 @@ $b: '.empty-list';
50
51
  }
51
52
 
52
53
  &__descr {
53
- max-width: 4px * 150;
54
+ max-width: 600px;
54
55
  }
55
56
 
56
57
  &__action {
57
- margin-top: 4px * 4;
58
+ margin-top: 16px;
58
59
  }
59
60
 
60
61
  &__footer {
61
62
  border-top: $empty-list-footer-separator-width solid $empty-list-footer-separator-color;
62
- margin-top: 4px * 4;
63
- padding-top: 4px * 4;
63
+ margin-top: 16px;
64
+ padding-top: 16px;
64
65
  }
65
66
 
66
67
  &__action-list {
67
68
  #{$b}__descr + & {
68
- margin-top: 4px * 4;
69
+ margin-top: 16px;
69
70
  }
70
71
  }
71
72
 
@@ -75,19 +76,19 @@ $b: '.empty-list';
75
76
  &__action-link {
76
77
  align-items: center;
77
78
  display: flex;
78
- padding-bottom: 4px * 2;
79
- padding-top: 4px * 2;
79
+ padding-bottom: 8px;
80
+ padding-top: 8px;
80
81
  }
81
82
 
82
83
  &__action-icon {
83
84
  fill: $empty-list-action-icon-color;
84
85
  flex-shrink: 0;
85
- height: 4px * 6;
86
- margin-right: 4px * 2;
86
+ height: 24px;
87
+ margin-right: 8px;
87
88
  transition-duration: var(--duration-micro-s);
88
89
  transition-property: color;
89
90
  transition-timing-function: var(--easing-standard);
90
- width: 4px * 6;
91
+ width: 24px;
91
92
 
92
93
  #{$b}__action-link:hover &,
93
94
  #{$b}__action-link:focus-visible & {
@@ -48,7 +48,7 @@
48
48
 
49
49
  import { pluralize } from '@advdominion/pluralize';
50
50
  import mime from 'mime';
51
- import { computed, nextTick, onMounted, ref, toRefs } from 'vue';
51
+ import { computed, nextTick, onMounted, ref, toRefs, watch } from 'vue';
52
52
 
53
53
  const ICONS_PATH = window.ICONS_PATH;
54
54
 
@@ -141,17 +141,24 @@ const descr = computed(() => {
141
141
  const $root = ref();
142
142
  const $input = ref();
143
143
 
144
- if (value.value) {
145
- for (const name of value.value.split(',')) {
146
- if (files.value.length < maxCount.value) {
147
- files.value.push({
148
- name: name.trim(),
149
- uploaded: true,
150
- error: false,
151
- });
144
+ watch(
145
+ value,
146
+ (newValue) => {
147
+ files.value = [];
148
+ if (newValue) {
149
+ for (const name of newValue.split(',')) {
150
+ if (files.value.length < maxCount.value) {
151
+ files.value.push({
152
+ name: name.trim(),
153
+ uploaded: true,
154
+ error: false,
155
+ });
156
+ }
157
+ }
152
158
  }
153
- }
154
- }
159
+ },
160
+ { immediate: true },
161
+ );
155
162
 
156
163
  const selectFiles = () => {
157
164
  $input.value.click();
@@ -0,0 +1,13 @@
1
+ document.body.addEventListener('click', (event) => {
2
+ if (!event.target.closest('.password__toggle')) {
3
+ return;
4
+ }
5
+
6
+ const $input = event.currentTarget.querySelector('.password').querySelector('.password__input');
7
+
8
+ if ($input.getAttribute('type') === 'password') {
9
+ $input.setAttribute('type', 'text');
10
+ } else {
11
+ $input.setAttribute('type', 'password');
12
+ }
13
+ });
@@ -0,0 +1,60 @@
1
+ @use 'sass:math';
2
+ @use '../../variables' as *;
3
+
4
+ $b: '.password';
5
+
6
+ #{$b} {
7
+ position: relative;
8
+
9
+ &__input {
10
+ }
11
+
12
+ &__toggle {
13
+ align-items: center;
14
+ color: $password-color;
15
+ cursor: pointer;
16
+ display: flex;
17
+ height: $input-height - $input-border-width * 2;
18
+ justify-content: center;
19
+ position: absolute;
20
+ right: 1px;
21
+ top: 1px;
22
+ transition-duration: var(--duration-micro-s);
23
+ transition-property: color;
24
+ transition-timing-function: var(--easing-standard);
25
+ width: $input-height - $input-border-width * 2;
26
+
27
+ &:hover,
28
+ &:focus-visible {
29
+ color: $password-active-color;
30
+ }
31
+
32
+ .input_small ~ & {
33
+ height: $input-small-height - $input-border-width * 2;
34
+ width: $input-small-height - $input-border-width * 2;
35
+ }
36
+ }
37
+
38
+ &__icon {
39
+ fill: currentcolor;
40
+ height: math.div($input-height, 2.5);
41
+ width: math.div($input-height, 2.5);
42
+
43
+ &_show {
44
+ #{$b}__input[type='text'] ~ #{$b}__toggle & {
45
+ display: none;
46
+ }
47
+ }
48
+
49
+ &_hide {
50
+ #{$b}__input[type='password'] ~ #{$b}__toggle & {
51
+ display: none;
52
+ }
53
+ }
54
+
55
+ .input_small ~ #{$b}__toggle & {
56
+ height: math.div($input-small-height, 2.5);
57
+ width: math.div($input-small-height, 2.5);
58
+ }
59
+ }
60
+ }
@@ -0,0 +1,43 @@
1
+ @use '../../variables' as *;
2
+
3
+ $b: '.rating';
4
+
5
+ #{$b} {
6
+ align-items: center;
7
+ display: flex;
8
+
9
+ &__stars {
10
+ align-items: center;
11
+ display: flex;
12
+ }
13
+
14
+ &__star {
15
+ fill: $rating-star-color;
16
+ height: 16px;
17
+ width: 16px;
18
+
19
+ &:not(:first-child) {
20
+ margin-left: 4px;
21
+ }
22
+
23
+ &_active {
24
+ fill: $rating-star-active-color;
25
+ }
26
+ }
27
+
28
+ &__label {
29
+ display: inline-flex;
30
+ margin-left: 12px;
31
+ position: relative;
32
+ top: 2px;
33
+
34
+ @include font($rating-label-font);
35
+
36
+ @media (--tablet-landscape-up) {
37
+ display: inline;
38
+ }
39
+
40
+ > span {
41
+ }
42
+ }
43
+ }
@@ -0,0 +1,33 @@
1
+ @use '../../variables' as *;
2
+
3
+ $b: '.wrapper';
4
+
5
+ #{$b} {
6
+ margin-left: auto;
7
+ margin-right: auto;
8
+ max-width: 1500px;
9
+ padding-left: 16px;
10
+ padding-right: 16px;
11
+ width: 100%;
12
+
13
+ @media (--tablet-landscape-up) {
14
+ padding-left: 32px;
15
+ padding-right: 32px;
16
+ }
17
+
18
+ &_no-max-width {
19
+ max-width: none;
20
+ }
21
+
22
+ &_no-padding {
23
+ padding-left: 0;
24
+ padding-right: 0;
25
+ }
26
+
27
+ &_no-mobile-padding {
28
+ @media (--tablet-portrait-down) {
29
+ padding-left: 0;
30
+ padding-right: 0;
31
+ }
32
+ }
33
+ }
@@ -317,7 +317,7 @@ $font-h4-desktop: () !default;
317
317
 
318
318
  $font: ('font-size': $font-size, 'line-height': $line-height) !default;
319
319
 
320
- $radius: 4px * 2 !default;
320
+ $radius: 8px !default;
321
321
  $radius-s: 4px !default;
322
322
  $radius-l: 10000px !default;
323
323
 
@@ -454,9 +454,9 @@ $button-border-color: $color-primary !default;
454
454
  $button-radius: $radius-l !default;
455
455
  $button-color: $color-white !default;
456
456
  $button-font: ('font-weight': bold, 'font-size': $font-size, 'line-height': 1) !default;
457
- $button-height: 4px * 12 !default;
458
- $button-min-width: 4px * 38 !default;
459
- $button-padding: 0 4px * 7 !default;
457
+ $button-height: 48px !default;
458
+ $button-min-width: 152px !default;
459
+ $button-padding: 0 28px !default;
460
460
 
461
461
  $button-disabled-bg: color.change($color-primary, $alpha: 0.35) !default;
462
462
  $button-disabled-border-color: color.change($color-primary, $alpha: 0.35) !default;
@@ -466,19 +466,19 @@ $button-active-bg: $color-primary-40 !default;
466
466
  $button-active-border-color: $color-primary-40 !default;
467
467
  $button-active-color: $color-white !default;
468
468
 
469
- $button-icon-size: 4px * 6 !default;
470
- $button-icon-space-before: 4px * 2 !default;
471
- $button-icon-space-after: 4px * 2 !default;
469
+ $button-icon-size: 24px !default;
470
+ $button-icon-space-before: 8px !default;
471
+ $button-icon-space-after: 8px !default;
472
472
 
473
473
  $button-small-font: ('font-weight': bold, 'font-size': $font-size-s, 'line-height': 1) !default;
474
- $button-small-height: 4px * 10 !default;
475
- $button-small-min-width: 4px * 18 !default;
476
- $button-small-padding: 0 4px * 4 !default;
474
+ $button-small-height: 40px !default;
475
+ $button-small-min-width: 72px !default;
476
+ $button-small-padding: 0 16px !default;
477
477
 
478
478
  $button-square-radius: $radius !default;
479
479
 
480
- $button-wide-min-width: 4px * 52 !default;
481
- $button-small-wide-min-width: 4px * 32 !default;
480
+ $button-wide-min-width: 208px !default;
481
+ $button-small-wide-min-width: 128px !default;
482
482
 
483
483
  // Secondary (.button_alt)
484
484
 
@@ -549,9 +549,9 @@ $input-radius: $radius !default;
549
549
  $input-color: $font-color-primary !default;
550
550
  $input-font: ('font-size': $font-size, 'line-height': $line-height-s, 'font-family': $font-family) !default;
551
551
  $input-placeholder-color: color.change($input-color, $alpha: 0.5) !default;
552
- $input-height: 4px * 12 !default;
553
- $input-padding-x: 4px * 4 !default;
554
- $input-padding-y: 4px * 3 !default;
552
+ $input-height: 48px !default;
553
+ $input-padding-x: 16px !default;
554
+ $input-padding-y: 12px !default;
555
555
 
556
556
  $input-filled-border-color: $color-primary !default;
557
557
 
@@ -570,18 +570,23 @@ $input-error-border-color: $color-error !default;
570
570
  $input-error-color: $input-color !default;
571
571
 
572
572
  $input-small-font: () !default;
573
- $input-small-height: 4px * 10 !default;
574
- $input-small-padding-x: 4px * 4 !default;
573
+ $input-small-height: 40px !default;
574
+ $input-small-padding-x: 16px !default;
575
575
  $input-small-padding-y: 4px !default;
576
576
 
577
577
  $input-textarea-font: ('line-height': $line-height) !default;
578
- $input-textarea-min-height: 4px * 36 !default;
578
+ $input-textarea-min-height: 144px !default;
579
579
 
580
- $input-textarea-small-min-height: 4px * 18 !default;
580
+ $input-textarea-small-min-height: 72px !default;
581
+
582
+ /********** Поле ввода пароля (.password) **********/
583
+
584
+ $password-color: $color-grey-40;
585
+ $password-active-color: $color-primary-40;
581
586
 
582
587
  /********** Поле ввода с подсказкамми (.suggest-input) **********/
583
588
 
584
- $suggest-input-item-height: 4px * 10 !default;
589
+ $suggest-input-item-height: 40px !default;
585
590
  $suggest-input-item-color: $color-grey-20 !default;
586
591
  $suggest-input-item-font: ('font-size': $font-size, 'line-height': $line-height) !default;
587
592
  $suggest-input-item-mark-color: inherit !default;
@@ -604,8 +609,8 @@ $suggest-input-clear-active-color: $color-grey-40 !default;
604
609
 
605
610
  $date-input-icon-color: $color-grey-70 !default;
606
611
  $date-input-disabled-icon-color: $color-grey-80 !default;
607
- $date-input-icon-size: 4px * 6 !default;
608
- $date-input-small-icon-size: 4px * 5 !default;
612
+ $date-input-icon-size: 16px !default;
613
+ $date-input-small-icon-size: 20px !default;
609
614
 
610
615
  $date-input-bg: $bg-color-primary !default;
611
616
  $date-input-radius: $input-radius !default;
@@ -896,7 +901,7 @@ $form-submit-error-shadow: $shadow !default;
896
901
  $form-submit-error-color: $font-color-error !default;
897
902
  $form-submit-error-mobile-font: ('font-size': $font-size-xs, 'line-height': $line-height) !default;
898
903
  $form-submit-error-desktop-font: ('font-size': $font-size-s) !default;
899
- $form-submit-error-padding: 4px * 4 4px * 6 !default;
904
+ $form-submit-error-padding: 16px 24px !default;
900
905
 
901
906
  /********** Диалоговое окно (.dialog) **********/
902
907
 
@@ -1228,6 +1233,22 @@ $counter-font: ('font-weight': bold, 'font-size': 9px, 'line-height': 1);
1228
1233
  $counter-radius: $radius-l;
1229
1234
  $counter-size: 16px;
1230
1235
 
1236
+ /********** Уведомление об использовании cookies (.cookies) **********/
1237
+
1238
+ $cookies-bg: $color-grey-100;
1239
+ $cookies-shadow: $shadow;
1240
+
1241
+ $cookies-descr-color: $font-color-secondary;
1242
+ $cookies-descr-mobile-font: ('font-size': $font-size-xs, 'line-height': $line-height);
1243
+ $cookies-descr-desktop-font: ('font-size': $font-size);
1244
+
1245
+ /********** Рейтинг товара (.rating) **********/
1246
+
1247
+ $rating-star-color: #fbe7cd;
1248
+ $rating-star-active-color: #f09135;
1249
+
1250
+ $rating-label-font: ('font-size': $font-size-s, 'line-height': 1);
1251
+
1231
1252
  /********** Адаптивные точки **********/
1232
1253
 
1233
1254
  // При изменении устройств изменить их так же в mm.js