@alfalab/core-components-international-phone-input 2.7.0 → 2.7.2

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 (69) hide show
  1. package/Component.responsive.d.ts +4 -4
  2. package/components/base-international-phone-input/Component.js +12 -2
  3. package/components/base-international-phone-input/index.css +6 -3
  4. package/components/country-select/Component.js +1 -1
  5. package/components/country-select/index.css +11 -8
  6. package/components/flag-icon/component.js +1 -1
  7. package/components/flag-icon/index.css +6 -3
  8. package/components/select-field/component.js +1 -1
  9. package/components/select-field/index.css +12 -9
  10. package/cssm/Component.responsive.d.ts +4 -4
  11. package/cssm/components/base-international-phone-input/Component.js +11 -1
  12. package/cssm/components/base-international-phone-input/index.module.css +4 -1
  13. package/cssm/components/country-select/index.module.css +3 -0
  14. package/cssm/components/flag-icon/index.module.css +3 -0
  15. package/cssm/components/select-field/index.module.css +3 -0
  16. package/cssm/index-464d40a4.d.ts +23 -0
  17. package/cssm/types.d.ts +1 -10
  18. package/cssm/typings-d515b24c.d.ts +1 -1
  19. package/cssm/use-skeleton-1328ead9.d.ts +7 -1
  20. package/cssm/utils/index.d.ts +3 -2
  21. package/cssm/utils/index.js +11 -5
  22. package/esm/Component.responsive.d.ts +4 -4
  23. package/esm/components/base-international-phone-input/Component.js +13 -3
  24. package/esm/components/base-international-phone-input/index.css +6 -3
  25. package/esm/components/country-select/Component.js +1 -1
  26. package/esm/components/country-select/index.css +11 -8
  27. package/esm/components/flag-icon/component.js +1 -1
  28. package/esm/components/flag-icon/index.css +6 -3
  29. package/esm/components/select-field/component.js +1 -1
  30. package/esm/components/select-field/index.css +12 -9
  31. package/esm/index-464d40a4.d.ts +23 -0
  32. package/esm/types.d.ts +1 -10
  33. package/esm/typings-d515b24c.d.ts +1 -1
  34. package/esm/use-skeleton-1328ead9.d.ts +7 -1
  35. package/esm/utils/index.d.ts +3 -2
  36. package/esm/utils/index.js +11 -5
  37. package/index-464d40a4.d.ts +23 -0
  38. package/modern/Component.responsive.d.ts +4 -4
  39. package/modern/components/base-international-phone-input/Component.js +11 -3
  40. package/modern/components/base-international-phone-input/index.css +6 -3
  41. package/modern/components/country-select/Component.js +1 -1
  42. package/modern/components/country-select/index.css +11 -8
  43. package/modern/components/flag-icon/component.js +1 -1
  44. package/modern/components/flag-icon/index.css +6 -3
  45. package/modern/components/select-field/component.js +1 -1
  46. package/modern/components/select-field/index.css +12 -9
  47. package/modern/index-464d40a4.d.ts +23 -0
  48. package/modern/types.d.ts +1 -10
  49. package/modern/typings-d515b24c.d.ts +1 -1
  50. package/modern/use-skeleton-1328ead9.d.ts +7 -1
  51. package/modern/utils/index.d.ts +3 -2
  52. package/modern/utils/index.js +9 -5
  53. package/moderncssm/Component.responsive.d.ts +4 -4
  54. package/moderncssm/components/base-international-phone-input/Component.js +10 -2
  55. package/moderncssm/index-464d40a4.d.ts +23 -0
  56. package/moderncssm/types.d.ts +1 -10
  57. package/moderncssm/typings-d515b24c.d.ts +1 -1
  58. package/moderncssm/use-skeleton-1328ead9.d.ts +7 -1
  59. package/moderncssm/utils/index.d.ts +3 -2
  60. package/moderncssm/utils/index.js +9 -5
  61. package/package.json +6 -6
  62. package/src/components/base-international-phone-input/Component.tsx +17 -1
  63. package/src/types.ts +3 -10
  64. package/src/utils/index.ts +16 -6
  65. package/types.d.ts +1 -10
  66. package/typings-d515b24c.d.ts +1 -1
  67. package/use-skeleton-1328ead9.d.ts +7 -1
  68. package/utils/index.d.ts +3 -2
  69. package/utils/index.js +11 -5
@@ -1,15 +1,17 @@
1
- import React, { forwardRef, useMemo, useRef, useState, useEffect } from 'react';
1
+ import React, { forwardRef, useRef, useMemo, useState, useEffect } from 'react';
2
2
  import mergeRefs from 'react-merge-refs';
3
3
  import { maskitoTransform } from '@maskito/core';
4
4
  import { useMaskito } from '@maskito/react';
5
5
  import { BaseOption } from '@alfalab/core-components-select/modern/shared';
6
+ import { isNullable } from '@alfalab/core-components-shared/modern';
6
7
  import { initCountries, findCountry, filterPhones, createMaskOptions, getClear, getPhoneData, getInitialValueFromCountry } from '../../utils/index.js';
7
8
  import { CountrySelect } from '../country-select/Component.js';
8
9
 
9
- const styles = {"component":"international-phone-input__component_1lzcp","addons":"international-phone-input__addons_1lzcp"};
10
+ const styles = {"component":"international-phone-input__component_1ym8l","addons":"international-phone-input__addons_1ym8l"};
10
11
  require('./index.css')
11
12
 
12
13
  const BaseInternationalPhoneInput = forwardRef(({ clearableCountryCode: clearableCountryCodeFromProps = true, value, country: countryProp, filterFn, onChange, onCountryChange, countrySelectProps, countries, defaultIso2, disabled, options, size = 56, Input, InputAutocomplete, SelectComponent, view, clear: clearProp, open: openProps, defaultOpen, customCountriesList, ...restProps }, ref) => {
14
+ const lastCountryRef = useRef(null);
13
15
  const countriesData = useMemo(() => initCountries(countries, customCountriesList), [countries, customCountriesList]);
14
16
  const inputRef = useRef(null);
15
17
  const inputWrapperRef = useRef(null);
@@ -25,7 +27,7 @@ const BaseInternationalPhoneInput = forwardRef(({ clearableCountryCode: clearabl
25
27
  };
26
28
  const preserveCountryCode = clearableCountryCodeFromProps === 'preserve';
27
29
  const clearableCountryCode = preserveCountryCode || clearableCountryCodeFromProps;
28
- const maskOptions = useMemo(() => createMaskOptions(country, clearableCountryCode, preserveCountryCode), [country, clearableCountryCode, preserveCountryCode]);
30
+ const maskOptions = useMemo(() => createMaskOptions(country, clearableCountryCode, preserveCountryCode, lastCountryRef), [country, clearableCountryCode, preserveCountryCode]);
29
31
  const maskRef = useMaskito({ options: maskOptions });
30
32
  const changeNumber = (phone) => {
31
33
  onChange?.(phone);
@@ -105,6 +107,12 @@ const BaseInternationalPhoneInput = forwardRef(({ clearableCountryCode: clearabl
105
107
  clear: getClear(clearProp, clearableCountryCode, value, country?.countryCode),
106
108
  ...restProps.inputProps,
107
109
  };
110
+ useEffect(() => {
111
+ if (!preserveCountryCode || isNullable(country)) {
112
+ return;
113
+ }
114
+ lastCountryRef.current = country;
115
+ }, [country, preserveCountryCode]);
108
116
  return Array.isArray(options) ? (React.createElement(InputAutocomplete, { closeOnSelect: true, Option: BaseOption, size: size, ...restProps, disabled: disabled, options: filteredOptions, value: value, open: showPhoneSelect, onOpen: handlePhoneSelectOpen, onChange: handleOptionSelect, onInput: (phone) => updatePhoneData(phone), inputProps: {
109
117
  ...inputProps,
110
118
  onClear: handleClear,
@@ -1,4 +1,4 @@
1
- /* hash: e77ll */
1
+ /* hash: 1d659 */
2
2
  :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
3
3
  } /* deprecated */ :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
4
4
  } :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
@@ -16,9 +16,12 @@
16
16
  } :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
17
17
 
18
18
  /* новые значения, используйте их */
19
- --gap-0: 0;
19
+
20
+ /* no-unit может приводить к проблемам в calc (#1559) */
21
+ /* stylelint-disable-next-line length-zero-no-unit */
22
+ --gap-0: 0px;
20
23
  } :root {
21
24
  } :root {
22
- } /* сбрасывает синюю подсветку при нажатии */ .international-phone-input__component_1lzcp .international-phone-input__addons_1lzcp {
25
+ } /* сбрасывает синюю подсветку при нажатии */ .international-phone-input__component_1ym8l .international-phone-input__addons_1ym8l {
23
26
  padding-left: var(--gap-0);
24
27
  }
@@ -5,7 +5,7 @@ import { WorldMagnifierMIcon } from '@alfalab/icons-glyph/WorldMagnifierMIcon';
5
5
  import { FlagIcon } from '../flag-icon/component.js';
6
6
  import { EMPTY_COUNTRY_SELECT_FIELD, SelectField } from '../select-field/component.js';
7
7
 
8
- const styles = {"component":"international-phone-input__component_9b812","option":"international-phone-input__option_9b812","flag":"international-phone-input__flag_9b812","countryName":"international-phone-input__countryName_9b812","dialCode":"international-phone-input__dialCode_9b812","flagIconWrapper":"international-phone-input__flagIconWrapper_9b812","emptyCountryIcon":"international-phone-input__emptyCountryIcon_9b812"};
8
+ const styles = {"component":"international-phone-input__component_4sw1e","option":"international-phone-input__option_4sw1e","flag":"international-phone-input__flag_4sw1e","countryName":"international-phone-input__countryName_4sw1e","dialCode":"international-phone-input__dialCode_4sw1e","flagIconWrapper":"international-phone-input__flagIconWrapper_4sw1e","emptyCountryIcon":"international-phone-input__emptyCountryIcon_4sw1e"};
9
9
  require('./index.css')
10
10
 
11
11
  const CountrySelect = ({ hideCountrySelect, countries, country, dataTestId, fieldWidth, onChange, view = 'desktop', SelectComponent, ...restProps }) => {
@@ -1,4 +1,4 @@
1
- /* hash: 1ugmp */
1
+ /* hash: no31x */
2
2
  :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
3
3
  } /* deprecated */ :root {
4
4
  --color-light-neutral-translucent-700: rgba(4, 4, 21, 0.47);
@@ -20,33 +20,36 @@
20
20
  --gap-s: 12px; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
21
21
 
22
22
  /* новые значения, используйте их */
23
+
24
+ /* no-unit может приводить к проблемам в calc (#1559) */
25
+ /* stylelint-disable-next-line length-zero-no-unit */
23
26
  --gap-8: var(--gap-xs);
24
27
  --gap-12: var(--gap-s);
25
28
  } :root {
26
29
  } :root {
27
- } /* сбрасывает синюю подсветку при нажатии */ .international-phone-input__component_9b812 {
30
+ } /* сбрасывает синюю подсветку при нажатии */ .international-phone-input__component_4sw1e {
28
31
  position: static;
29
32
  display: flex;
30
33
  min-width: initial;
31
34
  height: 100%;
32
- } .international-phone-input__option_9b812 {
35
+ } .international-phone-input__option_4sw1e {
33
36
  display: flex;
34
37
  align-items: flex-start;
35
38
  padding: var(--gap-12);
36
- } .international-phone-input__flag_9b812 {
39
+ } .international-phone-input__flag_4sw1e {
37
40
  flex-shrink: 0;
38
41
  margin-right: var(--gap-8);
39
- } .international-phone-input__countryName_9b812 {
42
+ } .international-phone-input__countryName_4sw1e {
40
43
  margin-right: var(--gap-8);
41
- } .international-phone-input__dialCode_9b812 {
44
+ } .international-phone-input__dialCode_4sw1e {
42
45
  color: var(--color-light-text-secondary);
43
- } .international-phone-input__flagIconWrapper_9b812 {
46
+ } .international-phone-input__flagIconWrapper_4sw1e {
44
47
  display: flex;
45
48
  justify-content: center;
46
49
  align-items: center;
47
50
  width: 24px;
48
51
  height: 24px;
49
52
  margin-left: var(--gap-12);
50
- } .international-phone-input__emptyCountryIcon_9b812 {
53
+ } .international-phone-input__emptyCountryIcon_4sw1e {
51
54
  color: var(--color-light-neutral-translucent-700);
52
55
  }
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import cn from 'classnames';
3
3
  import { flagSprite } from './flagSprite.js';
4
4
 
5
- const styles = {"flagIcon":"international-phone-input__flagIcon_3wu9f","flagPlaceholder":"international-phone-input__flagPlaceholder_3wu9f"};
5
+ const styles = {"flagIcon":"international-phone-input__flagIcon_8f693","flagPlaceholder":"international-phone-input__flagPlaceholder_8f693"};
6
6
  require('./index.css')
7
7
 
8
8
  /**
@@ -1,4 +1,4 @@
1
- /* hash: 175f8 */
1
+ /* hash: ewuu4 */
2
2
  :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
3
3
  } /* deprecated */ :root {
4
4
  --color-light-neutral-translucent-100: rgba(38, 55, 88, 0.06); /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
@@ -20,13 +20,16 @@
20
20
  --gap-3xs: 2px; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
21
21
 
22
22
  /* новые значения, используйте их */
23
+
24
+ /* no-unit может приводить к проблемам в calc (#1559) */
25
+ /* stylelint-disable-next-line length-zero-no-unit */
23
26
  --gap-2: var(--gap-3xs);
24
27
  } :root {
25
28
  } :root {
26
- } /* сбрасывает синюю подсветку при нажатии */ .international-phone-input__flagIcon_3wu9f {
29
+ } /* сбрасывает синюю подсветку при нажатии */ .international-phone-input__flagIcon_8f693 {
27
30
  max-width: 24px;
28
31
  max-height: 24px;
29
- } .international-phone-input__flagPlaceholder_3wu9f {
32
+ } .international-phone-input__flagPlaceholder_8f693 {
30
33
  width: 24px;
31
34
  height: 16px;
32
35
  max-height: 16px;
@@ -5,7 +5,7 @@ import { useFocus } from '@alfalab/hooks';
5
5
  import { WorldMagnifierMIcon } from '@alfalab/icons-glyph/WorldMagnifierMIcon';
6
6
  import { FlagIcon } from '../flag-icon/component.js';
7
7
 
8
- const styles = {"component":"international-phone-input__component_itnzc","flagIconContainer":"international-phone-input__flagIconContainer_itnzc","emptyCountryIcon":"international-phone-input__emptyCountryIcon_itnzc","disabled":"international-phone-input__disabled_itnzc","inner":"international-phone-input__inner_itnzc","size-64":"international-phone-input__size-64_itnzc","size-72":"international-phone-input__size-72_itnzc","focusVisible":"international-phone-input__focusVisible_itnzc"};
8
+ const styles = {"component":"international-phone-input__component_66s35","flagIconContainer":"international-phone-input__flagIconContainer_66s35","emptyCountryIcon":"international-phone-input__emptyCountryIcon_66s35","disabled":"international-phone-input__disabled_66s35","inner":"international-phone-input__inner_66s35","size-64":"international-phone-input__size-64_66s35","size-72":"international-phone-input__size-72_66s35","focusVisible":"international-phone-input__focusVisible_66s35"};
9
9
  require('./index.css')
10
10
 
11
11
  const EMPTY_COUNTRY_SELECT_FIELD = {
@@ -1,4 +1,4 @@
1
- /* hash: 1fb4c */
1
+ /* hash: gc6oa */
2
2
  :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
3
3
  } /* deprecated */ :root {
4
4
  --color-light-neutral-translucent-700: rgba(4, 4, 21, 0.47);
@@ -21,6 +21,9 @@
21
21
  --gap-m: 16px; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
22
22
 
23
23
  /* новые значения, используйте их */
24
+
25
+ /* no-unit может приводить к проблемам в calc (#1559) */
26
+ /* stylelint-disable-next-line length-zero-no-unit */
24
27
  --gap-4: var(--gap-2xs);
25
28
  --gap-12: var(--gap-s);
26
29
  --gap-16: var(--gap-m);
@@ -28,33 +31,33 @@
28
31
  } :root {
29
32
  --focus-color: var(--color-light-status-info);
30
33
  --disabled-cursor: not-allowed;
31
- } /* сбрасывает синюю подсветку при нажатии */ .international-phone-input__component_itnzc {
34
+ } /* сбрасывает синюю подсветку при нажатии */ .international-phone-input__component_66s35 {
32
35
  height: 100%;
33
36
  cursor: pointer;
34
37
  outline: none;
35
38
  position: relative;
36
- } .international-phone-input__flagIconContainer_itnzc {
39
+ } .international-phone-input__flagIconContainer_66s35 {
37
40
  display: flex;
38
41
  justify-content: center;
39
42
  align-items: center;
40
43
  width: 24px;
41
44
  height: 24px;
42
45
  margin-right: var(--gap-4);
43
- } .international-phone-input__emptyCountryIcon_itnzc {
46
+ } .international-phone-input__emptyCountryIcon_66s35 {
44
47
  color: var(--color-light-neutral-translucent-700);
45
- } .international-phone-input__disabled_itnzc {
48
+ } .international-phone-input__disabled_66s35 {
46
49
  cursor: var(--disabled-cursor);
47
- } .international-phone-input__inner_itnzc {
50
+ } .international-phone-input__inner_66s35 {
48
51
  position: relative;
49
52
  display: flex;
50
53
  align-items: center;
51
54
  height: 100%;
52
55
  padding-left: var(--gap-12);
53
56
  outline: none;
54
- } .international-phone-input__size-64_itnzc .international-phone-input__inner_itnzc,
55
- .international-phone-input__size-72_itnzc .international-phone-input__inner_itnzc {
57
+ } .international-phone-input__size-64_66s35 .international-phone-input__inner_66s35,
58
+ .international-phone-input__size-72_66s35 .international-phone-input__inner_66s35 {
56
59
  padding-left: var(--gap-16);
57
- } .international-phone-input__focusVisible_itnzc {
60
+ } .international-phone-input__focusVisible_66s35 {
58
61
  outline: 2px solid var(--focus-color);
59
62
  outline-offset: 2px;
60
63
  }
@@ -0,0 +1,23 @@
1
+ type BackgroundColorType = 'accent' | 'info' | 'attention-muted' | 'positive-muted' | 'negative-muted' | 'primary' | 'primary-inverted' | 'secondary' | 'secondary-inverted' | 'tertiary' | 'tertiary-inverted' | 'quaternary' | 'quaternary-inverted' | 'specialbg-component' | 'specialbg-component-inverted' | 'specialbg-primary-grouped' | 'specialbg-secondary-grouped' | 'specialbg-tertiary-grouped' | 'specialbg-secondary-transparent' | 'specialbg-secondary-transparent-inverted' | 'specialbg-tertiary-transparent' | 'specialbg-tertiary-transparent-inverted';
2
+ type BorderColorType = 'accent' | 'key' | 'key-inverted' | 'link' | 'primary' | 'primary-inverted' | 'secondary' | 'secondary-inverted' | 'tertiary' | 'tertiary-inverted' | 'underline' | 'underline-inverted' | 'graphic-attention' | 'graphic-link' | 'graphic-negative' | 'graphic-positive' | 'specialbg-secondary-transparent' | 'specialbg-secondary-transparent-inverted' | 'specialbg-tertiary-transparent' | 'specialbg-tertiary-transparent-inverted';
3
+ type GraphicColorType = 'accent' | 'link' | 'attention' | 'positive' | 'negative' | 'primary' | 'primary-inverted' | 'secondary' | 'secondary-inverted' | 'tertiary' | 'tertiary-inverted' | 'quaternary' | 'quaternary-inverted' | 'static-light' | 'static-accent' | 'static-dark';
4
+ type ShadowType = 'shadow-xs' | 'shadow-s' | 'shadow-m' | 'shadow-l' | 'shadow-xl' | 'shadow-xs-hard' | 'shadow-s-hard' | 'shadow-m-hard' | 'shadow-l-hard' | 'shadow-xl-hard' | 'shadow-xs-up' | 'shadow-s-up' | 'shadow-m-up' | 'shadow-l-up' | 'shadow-xl-up' | 'shadow-xs-hard-up' | 'shadow-s-hard-up' | 'shadow-m-hard-up' | 'shadow-l-hard-up' | 'shadow-xl-hard-up';
5
+ type GapType = '3xs' | '2xs' | 'xs' | 's' | 'm' | 'l' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | '7xl' | '8xl';
6
+ type PaddingType = number | string | {
7
+ top?: number;
8
+ right?: number;
9
+ bottom?: number;
10
+ left?: number;
11
+ };
12
+ type TypographyType = 'accent-caps' | 'accent-component-primary' | 'accent-component-secondary' | 'accent-primary-large' | 'accent-primary-medium' | 'accent-primary-small' | 'accent-secondary-large' | 'accent-secondary-medium' | 'accent-secondary-small' | 'action-caps' | 'action-component-primary' | 'action-component-secondary' | 'action-primary-large' | 'action-primary-medium' | 'action-primary-small' | 'action-secondary-large' | 'action-secondary-medium' | 'action-secondary-small' | 'headline-mobile-large' | 'headline-mobile-medium' | 'headline-mobile-small' | 'headline-mobile-xlarge' | 'headline-mobile-xsmall' | 'headline-system-mobile-large' | 'headline-system-mobile-medium' | 'headline-system-mobile-small' | 'headline-system-mobile-xlarge' | 'headline-system-mobile-xsmall' | 'headline-system-large' | 'headline-system-medium' | 'headline-system-small' | 'headline-system-xlarge' | 'headline-system-xsmall' | 'headline-large' | 'headline-medium' | 'headline-small' | 'headline-xlarge' | 'headline-xsmall' | 'key-large' | 'key-medium' | 'key-small' | 'key-xlarge' | 'key-xsmall' | 'paragraph-caps' | 'paragraph-component-primary' | 'paragraph-component-secondary' | 'paragraph-primary-large' | 'paragraph-primary-medium' | 'paragraph-primary-small' | 'paragraph-secondary-large' | 'paragraph-secondary-medium' | 'paragraph-secondary-small' | 'promo-mobile-large' | 'promo-mobile-medium' | 'promo-mobile-small' | 'promo-mobile-xlarge' | 'promo-mobile-xsmall' | 'promo-system-mobile-large' | 'promo-system-mobile-medium' | 'promo-system-mobile-small' | 'promo-system-mobile-xlarge' | 'promo-system-mobile-xsmall' | 'promo-system-large' | 'promo-system-medium' | 'promo-system-small' | 'promo-system-xlarge' | 'promo-system-xsmall' | 'promo-large' | 'promo-medium' | 'promo-small' | 'promo-xlarge' | 'promo-xsmall' | 'accent-component' | 'action-component' | 'paragraph-component';
13
+ type Country = {
14
+ name: string;
15
+ regions?: string[];
16
+ iso2: string;
17
+ countryCode: string;
18
+ dialCode: string;
19
+ format?: string;
20
+ priority: number;
21
+ mainCode?: boolean;
22
+ };
23
+ export { BackgroundColorType, BorderColorType, GraphicColorType, ShadowType, GapType, PaddingType, TypographyType, Country };
package/modern/types.d.ts CHANGED
@@ -6,18 +6,9 @@ import { InputAutocompleteProps } from "@alfalab/core-components-input-autocompl
6
6
  import { InputAutocompleteDesktopProps } from "@alfalab/core-components-input-autocomplete/desktop";
7
7
  import { InputAutocompleteMobileProps } from "@alfalab/core-components-input-autocomplete/mobile";
8
8
  import { OptionShape } from "./typings-d515b24c";
9
+ import { Country } from "./index-464d40a4";
9
10
  import { SharedCountrySelectProps } from "./components/country-select/index";
10
11
  import { CountriesData } from "./data/country-data";
11
- type Country = {
12
- name: string;
13
- regions?: string[];
14
- iso2: string;
15
- countryCode: string;
16
- dialCode: string;
17
- format?: string;
18
- priority: number;
19
- mainCode?: boolean;
20
- };
21
12
  type AreaItem = Country & {
22
13
  isAreaCode: boolean;
23
14
  areaCodeLength: number;
@@ -5,6 +5,7 @@ import { HTMLAttributes, ReactElement, ReactNode, RefObject, ButtonHTMLAttribute
5
5
  import { HandledEvents } from "react-swipeable/es/types";
6
6
  import { TransitionProps } from "react-transition-group/Transition";
7
7
  import { BaseModalProps, BaseModalContext } from "./index-11f20b2e";
8
+ import { BackgroundColorType } from "./index-464d40a4";
8
9
  import { BaseFormControlProps, BackdropProps } from "./index-ebda875c";
9
10
  import { ContentProps } from "./typings-4b7234ef";
10
11
  import { ModalResponsiveProps as ModalProps } from "./typings-4b7234ef";
@@ -175,7 +176,6 @@ type NavigationBarPrivateProps = {
175
176
  scrollableParentRef?: React.RefObject<HTMLDivElement>;
176
177
  };
177
178
  type NavigationBarProps = NavigationBarPrivateProps;
178
- type BackgroundColorType = "accent" | "info" | "attention-muted" | "positive-muted" | "negative-muted" | "primary" | "primary-inverted" | "secondary" | "secondary-inverted" | "tertiary" | "tertiary-inverted" | "quaternary" | "quaternary-inverted" | "specialbg-component" | "specialbg-component-inverted" | "specialbg-primary-grouped" | "specialbg-secondary-grouped" | "specialbg-tertiary-grouped" | "specialbg-secondary-transparent" | "specialbg-secondary-transparent-inverted" | "specialbg-tertiary-transparent" | "specialbg-tertiary-transparent-inverted";
179
179
  type BottomSheetTitleAlign = "center" | "left";
180
180
  type BottomSheetProps = {
181
181
  /**
@@ -2,6 +2,7 @@
2
2
  import React from "react";
3
3
  import { ReactNode } from "react";
4
4
  import { TextSkeletonProps } from "./types-1328ead9";
5
+ type BorderRadiusSize = 0 | 2 | 4 | 6 | 8 | 10 | 12 | 16 | 20 | 24 | 32 | 36 | 64 | "pill";
5
6
  type SkeletonProps = {
6
7
  /**
7
8
  * Флаг, явно задающий состояние, при котором контент закрывается прелоадером
@@ -36,6 +37,11 @@ type SkeletonProps = {
36
37
  * @default default
37
38
  */
38
39
  colors?: "default" | "inverted";
40
+ /**
41
+ * Скругление углов
42
+ * @default 8
43
+ */
44
+ borderRadius?: BorderRadiusSize;
39
45
  };
40
46
  declare const Skeleton: React.FC<SkeletonProps>;
41
47
  type SkeletonProps$0 = {
@@ -46,4 +52,4 @@ declare function useSkeleton(showSkeleton?: boolean, skeletonProps?: TextSkeleto
46
52
  renderSkeleton: (props: SkeletonProps$0) => React.JSX.Element | null;
47
53
  textRef: React.RefObject<HTMLElement>;
48
54
  };
49
- export { SkeletonProps, Skeleton, useSkeleton };
55
+ export { BorderRadiusSize, SkeletonProps, Skeleton, useSkeleton };
@@ -1,14 +1,15 @@
1
+ import { RefObject } from 'react';
1
2
  import { MaskitoOptions } from '@maskito/core';
2
3
  import { InputAutocompleteDesktopProps } from "@alfalab/core-components-input-autocomplete/desktop";
3
4
  import { GroupShape, OptionShape } from "@alfalab/core-components-select/shared";
4
5
  import { CountriesData } from "../data/country-data";
5
6
  import { Country } from "../types";
6
7
  declare function initCountries(iso2s?: string[], customCountriesList?: CountriesData[]): Country[][];
7
- declare function findCountry(countries: Country[][], value?: string, iso2?: string, country?: Country): Country | undefined;
8
+ declare function findCountry(countries: Country[][], value: string | undefined, iso2: string | undefined, country?: Country): Country | undefined;
8
9
  declare function guessCountry(inputNumber: string, data: Country[][]): Country | undefined;
9
10
  declare function clearMask(value: string): string;
10
11
  declare function createPhoneMaskExpression(country: Country | undefined, clearableCountryCode: boolean): Array<RegExp | string>;
11
- declare function createMaskOptions(country: Country | undefined, clearableCountryCode: boolean, preserveCountryCode: boolean): MaskitoOptions;
12
+ declare function createMaskOptions(country: Country | undefined, clearableCountryCode: boolean, preserveCountryCode: boolean, lastCountryRef: RefObject<Country | null>): MaskitoOptions;
12
13
  declare function defaultFilterFn(value: string | undefined, option: OptionShape): boolean;
13
14
  declare const filterPhones: (value?: string, options?: InputAutocompleteDesktopProps['options'], filterFn?: typeof defaultFilterFn) => (OptionShape | GroupShape)[];
14
15
  declare function getPhoneData(phone: string, countries: Country[][], defaultIso2?: string): {
@@ -115,17 +115,21 @@ function createPhoneMaskExpression(country, clearableCountryCode) {
115
115
  ...format.split('').map(itemToMask),
116
116
  ];
117
117
  }
118
- function createMaskOptions(country, clearableCountryCode, preserveCountryCode) {
118
+ function createMaskOptions(country, clearableCountryCode, preserveCountryCode, lastCountryRef) {
119
119
  const countryCode = country?.countryCode;
120
120
  const prefix = countryCode ? getInitialValueFromCountry(countryCode) : '';
121
121
  const prefixLen = !clearableCountryCode && prefix ? prefix.length : 0;
122
122
  const mask = createPhoneMaskExpression(country, clearableCountryCode);
123
+ const preprocessors = [
124
+ maskUtils.insertionPhonePreprocessor(mask, countryCode, clearableCountryCode),
125
+ ];
126
+ if (preserveCountryCode) {
127
+ const createMask = (lastCountry) => createPhoneMaskExpression(lastCountry, clearableCountryCode);
128
+ preprocessors.push(maskUtils.preserveCountryCodePreprocessor(lastCountryRef, createMask));
129
+ }
123
130
  return {
124
131
  mask,
125
- preprocessors: [
126
- maskUtils.insertionPhonePreprocessor(mask, countryCode, clearableCountryCode),
127
- maskUtils.preserveCountryCodePreprocessor(countryCode, preserveCountryCode),
128
- ],
132
+ preprocessors,
129
133
  postprocessors: [maskUtils.prefixPostprocessor(prefixLen > 0 ? prefix : '')],
130
134
  plugins: [
131
135
  maskUtils.caretGuard((value, [from, to]) => [
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import React from 'react';
3
3
  declare const InternationalPhoneInput: React.ForwardRefExoticComponent<(({
4
- country?: import("./types").Country | undefined;
4
+ country?: import("./index-464d40a4").Country | undefined;
5
5
  countries?: string[] | undefined;
6
6
  defaultIso2?: string | undefined;
7
7
  customCountriesList?: import("./index").CountriesData[] | undefined;
@@ -9,7 +9,7 @@ declare const InternationalPhoneInput: React.ForwardRefExoticComponent<(({
9
9
  countrySelectProps?: import("./components/country-select/index").SharedCountrySelectProps | undefined;
10
10
  clear?: boolean | undefined;
11
11
  filterFn?: ((value: string | undefined, option: import("./typings-d515b24c").OptionShape) => boolean) | undefined;
12
- onCountryChange?: ((country?: import("./types").Country | undefined) => void) | undefined;
12
+ onCountryChange?: ((country?: import("./index-464d40a4").Country | undefined) => void) | undefined;
13
13
  onChange?: ((phone: string) => void) | undefined;
14
14
  onBlur?: ((event: React.FocusEvent<HTMLDivElement | HTMLInputElement, Element>) => void) | undefined;
15
15
  onFocus?: ((event: React.FocusEvent<HTMLDivElement | HTMLInputElement, Element>) => void) | undefined;
@@ -22,7 +22,7 @@ declare const InternationalPhoneInput: React.ForwardRefExoticComponent<(({
22
22
  client?: "desktop" | "mobile" | undefined;
23
23
  defaultMatchMediaValue?: boolean | (() => boolean) | undefined;
24
24
  }) | ({
25
- country?: import("./types").Country | undefined;
25
+ country?: import("./index-464d40a4").Country | undefined;
26
26
  countries?: string[] | undefined;
27
27
  defaultIso2?: string | undefined;
28
28
  customCountriesList?: import("./index").CountriesData[] | undefined;
@@ -30,7 +30,7 @@ declare const InternationalPhoneInput: React.ForwardRefExoticComponent<(({
30
30
  countrySelectProps?: import("./components/country-select/index").SharedCountrySelectProps | undefined;
31
31
  clear?: boolean | undefined;
32
32
  filterFn?: ((value: string | undefined, option: import("./typings-d515b24c").OptionShape) => boolean) | undefined;
33
- onCountryChange?: ((country?: import("./types").Country | undefined) => void) | undefined;
33
+ onCountryChange?: ((country?: import("./index-464d40a4").Country | undefined) => void) | undefined;
34
34
  onChange?: ((phone: string) => void) | undefined;
35
35
  onBlur?: ((event: React.FocusEvent<HTMLDivElement | HTMLInputElement, Element>) => void) | undefined;
36
36
  onFocus?: ((event: React.FocusEvent<HTMLDivElement | HTMLInputElement, Element>) => void) | undefined;
@@ -1,13 +1,15 @@
1
- import React, { forwardRef, useMemo, useRef, useState, useEffect } from 'react';
1
+ import React, { forwardRef, useRef, useMemo, useState, useEffect } from 'react';
2
2
  import mergeRefs from 'react-merge-refs';
3
3
  import { maskitoTransform } from '@maskito/core';
4
4
  import { useMaskito } from '@maskito/react';
5
5
  import { BaseOption } from '@alfalab/core-components-select/moderncssm/shared';
6
+ import { isNullable } from '@alfalab/core-components-shared/moderncssm';
6
7
  import { initCountries, findCountry, filterPhones, createMaskOptions, getClear, getPhoneData, getInitialValueFromCountry } from '../../utils/index.js';
7
8
  import { CountrySelect } from '../country-select/Component.js';
8
9
  import styles from './index.module.css';
9
10
 
10
11
  const BaseInternationalPhoneInput = forwardRef(({ clearableCountryCode: clearableCountryCodeFromProps = true, value, country: countryProp, filterFn, onChange, onCountryChange, countrySelectProps, countries, defaultIso2, disabled, options, size = 56, Input, InputAutocomplete, SelectComponent, view, clear: clearProp, open: openProps, defaultOpen, customCountriesList, ...restProps }, ref) => {
12
+ const lastCountryRef = useRef(null);
11
13
  const countriesData = useMemo(() => initCountries(countries, customCountriesList), [countries, customCountriesList]);
12
14
  const inputRef = useRef(null);
13
15
  const inputWrapperRef = useRef(null);
@@ -23,7 +25,7 @@ const BaseInternationalPhoneInput = forwardRef(({ clearableCountryCode: clearabl
23
25
  };
24
26
  const preserveCountryCode = clearableCountryCodeFromProps === 'preserve';
25
27
  const clearableCountryCode = preserveCountryCode || clearableCountryCodeFromProps;
26
- const maskOptions = useMemo(() => createMaskOptions(country, clearableCountryCode, preserveCountryCode), [country, clearableCountryCode, preserveCountryCode]);
28
+ const maskOptions = useMemo(() => createMaskOptions(country, clearableCountryCode, preserveCountryCode, lastCountryRef), [country, clearableCountryCode, preserveCountryCode]);
27
29
  const maskRef = useMaskito({ options: maskOptions });
28
30
  const changeNumber = (phone) => {
29
31
  onChange?.(phone);
@@ -103,6 +105,12 @@ const BaseInternationalPhoneInput = forwardRef(({ clearableCountryCode: clearabl
103
105
  clear: getClear(clearProp, clearableCountryCode, value, country?.countryCode),
104
106
  ...restProps.inputProps,
105
107
  };
108
+ useEffect(() => {
109
+ if (!preserveCountryCode || isNullable(country)) {
110
+ return;
111
+ }
112
+ lastCountryRef.current = country;
113
+ }, [country, preserveCountryCode]);
106
114
  return Array.isArray(options) ? (React.createElement(InputAutocomplete, { closeOnSelect: true, Option: BaseOption, size: size, ...restProps, disabled: disabled, options: filteredOptions, value: value, open: showPhoneSelect, onOpen: handlePhoneSelectOpen, onChange: handleOptionSelect, onInput: (phone) => updatePhoneData(phone), inputProps: {
107
115
  ...inputProps,
108
116
  onClear: handleClear,
@@ -0,0 +1,23 @@
1
+ type BackgroundColorType = 'accent' | 'info' | 'attention-muted' | 'positive-muted' | 'negative-muted' | 'primary' | 'primary-inverted' | 'secondary' | 'secondary-inverted' | 'tertiary' | 'tertiary-inverted' | 'quaternary' | 'quaternary-inverted' | 'specialbg-component' | 'specialbg-component-inverted' | 'specialbg-primary-grouped' | 'specialbg-secondary-grouped' | 'specialbg-tertiary-grouped' | 'specialbg-secondary-transparent' | 'specialbg-secondary-transparent-inverted' | 'specialbg-tertiary-transparent' | 'specialbg-tertiary-transparent-inverted';
2
+ type BorderColorType = 'accent' | 'key' | 'key-inverted' | 'link' | 'primary' | 'primary-inverted' | 'secondary' | 'secondary-inverted' | 'tertiary' | 'tertiary-inverted' | 'underline' | 'underline-inverted' | 'graphic-attention' | 'graphic-link' | 'graphic-negative' | 'graphic-positive' | 'specialbg-secondary-transparent' | 'specialbg-secondary-transparent-inverted' | 'specialbg-tertiary-transparent' | 'specialbg-tertiary-transparent-inverted';
3
+ type GraphicColorType = 'accent' | 'link' | 'attention' | 'positive' | 'negative' | 'primary' | 'primary-inverted' | 'secondary' | 'secondary-inverted' | 'tertiary' | 'tertiary-inverted' | 'quaternary' | 'quaternary-inverted' | 'static-light' | 'static-accent' | 'static-dark';
4
+ type ShadowType = 'shadow-xs' | 'shadow-s' | 'shadow-m' | 'shadow-l' | 'shadow-xl' | 'shadow-xs-hard' | 'shadow-s-hard' | 'shadow-m-hard' | 'shadow-l-hard' | 'shadow-xl-hard' | 'shadow-xs-up' | 'shadow-s-up' | 'shadow-m-up' | 'shadow-l-up' | 'shadow-xl-up' | 'shadow-xs-hard-up' | 'shadow-s-hard-up' | 'shadow-m-hard-up' | 'shadow-l-hard-up' | 'shadow-xl-hard-up';
5
+ type GapType = '3xs' | '2xs' | 'xs' | 's' | 'm' | 'l' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | '7xl' | '8xl';
6
+ type PaddingType = number | string | {
7
+ top?: number;
8
+ right?: number;
9
+ bottom?: number;
10
+ left?: number;
11
+ };
12
+ type TypographyType = 'accent-caps' | 'accent-component-primary' | 'accent-component-secondary' | 'accent-primary-large' | 'accent-primary-medium' | 'accent-primary-small' | 'accent-secondary-large' | 'accent-secondary-medium' | 'accent-secondary-small' | 'action-caps' | 'action-component-primary' | 'action-component-secondary' | 'action-primary-large' | 'action-primary-medium' | 'action-primary-small' | 'action-secondary-large' | 'action-secondary-medium' | 'action-secondary-small' | 'headline-mobile-large' | 'headline-mobile-medium' | 'headline-mobile-small' | 'headline-mobile-xlarge' | 'headline-mobile-xsmall' | 'headline-system-mobile-large' | 'headline-system-mobile-medium' | 'headline-system-mobile-small' | 'headline-system-mobile-xlarge' | 'headline-system-mobile-xsmall' | 'headline-system-large' | 'headline-system-medium' | 'headline-system-small' | 'headline-system-xlarge' | 'headline-system-xsmall' | 'headline-large' | 'headline-medium' | 'headline-small' | 'headline-xlarge' | 'headline-xsmall' | 'key-large' | 'key-medium' | 'key-small' | 'key-xlarge' | 'key-xsmall' | 'paragraph-caps' | 'paragraph-component-primary' | 'paragraph-component-secondary' | 'paragraph-primary-large' | 'paragraph-primary-medium' | 'paragraph-primary-small' | 'paragraph-secondary-large' | 'paragraph-secondary-medium' | 'paragraph-secondary-small' | 'promo-mobile-large' | 'promo-mobile-medium' | 'promo-mobile-small' | 'promo-mobile-xlarge' | 'promo-mobile-xsmall' | 'promo-system-mobile-large' | 'promo-system-mobile-medium' | 'promo-system-mobile-small' | 'promo-system-mobile-xlarge' | 'promo-system-mobile-xsmall' | 'promo-system-large' | 'promo-system-medium' | 'promo-system-small' | 'promo-system-xlarge' | 'promo-system-xsmall' | 'promo-large' | 'promo-medium' | 'promo-small' | 'promo-xlarge' | 'promo-xsmall' | 'accent-component' | 'action-component' | 'paragraph-component';
13
+ type Country = {
14
+ name: string;
15
+ regions?: string[];
16
+ iso2: string;
17
+ countryCode: string;
18
+ dialCode: string;
19
+ format?: string;
20
+ priority: number;
21
+ mainCode?: boolean;
22
+ };
23
+ export { BackgroundColorType, BorderColorType, GraphicColorType, ShadowType, GapType, PaddingType, TypographyType, Country };
@@ -6,18 +6,9 @@ import { InputAutocompleteProps } from "@alfalab/core-components-input-autocompl
6
6
  import { InputAutocompleteDesktopProps } from "@alfalab/core-components-input-autocomplete/desktop";
7
7
  import { InputAutocompleteMobileProps } from "@alfalab/core-components-input-autocomplete/mobile";
8
8
  import { OptionShape } from "./typings-d515b24c";
9
+ import { Country } from "./index-464d40a4";
9
10
  import { SharedCountrySelectProps } from "./components/country-select/index";
10
11
  import { CountriesData } from "./data/country-data";
11
- type Country = {
12
- name: string;
13
- regions?: string[];
14
- iso2: string;
15
- countryCode: string;
16
- dialCode: string;
17
- format?: string;
18
- priority: number;
19
- mainCode?: boolean;
20
- };
21
12
  type AreaItem = Country & {
22
13
  isAreaCode: boolean;
23
14
  areaCodeLength: number;
@@ -5,6 +5,7 @@ import { HTMLAttributes, ReactElement, ReactNode, RefObject, ButtonHTMLAttribute
5
5
  import { HandledEvents } from "react-swipeable/es/types";
6
6
  import { TransitionProps } from "react-transition-group/Transition";
7
7
  import { BaseModalProps, BaseModalContext } from "./index-11f20b2e";
8
+ import { BackgroundColorType } from "./index-464d40a4";
8
9
  import { BaseFormControlProps, BackdropProps } from "./index-ebda875c";
9
10
  import { ContentProps } from "./typings-4b7234ef";
10
11
  import { ModalResponsiveProps as ModalProps } from "./typings-4b7234ef";
@@ -175,7 +176,6 @@ type NavigationBarPrivateProps = {
175
176
  scrollableParentRef?: React.RefObject<HTMLDivElement>;
176
177
  };
177
178
  type NavigationBarProps = NavigationBarPrivateProps;
178
- type BackgroundColorType = "accent" | "info" | "attention-muted" | "positive-muted" | "negative-muted" | "primary" | "primary-inverted" | "secondary" | "secondary-inverted" | "tertiary" | "tertiary-inverted" | "quaternary" | "quaternary-inverted" | "specialbg-component" | "specialbg-component-inverted" | "specialbg-primary-grouped" | "specialbg-secondary-grouped" | "specialbg-tertiary-grouped" | "specialbg-secondary-transparent" | "specialbg-secondary-transparent-inverted" | "specialbg-tertiary-transparent" | "specialbg-tertiary-transparent-inverted";
179
179
  type BottomSheetTitleAlign = "center" | "left";
180
180
  type BottomSheetProps = {
181
181
  /**