@foxford/ui 2.19.2 → 2.20.0-beta-74e0253-20240306

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 (35) hide show
  1. package/components/Anchor/Anchor.js.map +1 -1
  2. package/components/ArrowBadge/ArrowBadge.js.map +1 -1
  3. package/components/Badge/Badge.js.map +1 -1
  4. package/components/Button/Button.js.map +1 -1
  5. package/components/FormInputLabel/FormInputLabel.js +2 -0
  6. package/components/FormInputLabel/FormInputLabel.js.map +1 -0
  7. package/components/FormInputLabel/constants.js +2 -0
  8. package/components/FormInputLabel/constants.js.map +1 -0
  9. package/components/FormInputLabel/style.js +2 -0
  10. package/components/FormInputLabel/style.js.map +1 -0
  11. package/components/FormLabel/FormLabel.js.map +1 -1
  12. package/components/Input/Input.js +1 -1
  13. package/components/Input/Input.js.map +1 -1
  14. package/components/Input/images/minus.module.svg.js +2 -0
  15. package/components/Input/images/minus.module.svg.js.map +1 -0
  16. package/components/Input/images/plus.module.svg.js +2 -0
  17. package/components/Input/images/plus.module.svg.js.map +1 -0
  18. package/components/Input/style.js +1 -1
  19. package/components/Input/style.js.map +1 -1
  20. package/components/Input.Phone/Input.Phone.js +1 -1
  21. package/components/Input.Phone/Input.Phone.js.map +1 -1
  22. package/components/InputCheckbox/InputCheckbox.js.map +1 -1
  23. package/components/InputRadio/InputRadio.js.map +1 -1
  24. package/components/Tab/Tab.js.map +1 -1
  25. package/components/Text/Text.js.map +1 -1
  26. package/components/Text/style.js +1 -1
  27. package/components/Text/style.js.map +1 -1
  28. package/components/Textarea/Textarea.js.map +1 -1
  29. package/components/Textarea/style.js.map +1 -1
  30. package/dts/index.d.ts +282 -273
  31. package/index.cjs.js +1 -1
  32. package/index.cjs.js.map +1 -1
  33. package/mixins/create-responsive-props.js +1 -1
  34. package/mixins/create-responsive-props.js.map +1 -1
  35. package/package.json +3 -5
package/dts/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  /// <reference types="react" />
2
- import * as styled_components from 'styled-components';
3
- import { DefaultTheme, FlattenSimpleInterpolation, CSSObject, Interpolation, ThemeProps, SimpleInterpolation, css } from 'styled-components';
4
2
  import * as react from 'react';
5
- import { CSSProperties, Component, ForwardRefExoticComponent, PropsWithoutRef, RefAttributes, PureComponent } from 'react';
3
+ import { Component, CSSProperties, ForwardRefExoticComponent, PropsWithoutRef, RefAttributes, PureComponent } from 'react';
4
+ import * as styled_components from 'styled-components';
5
+ import { DefaultTheme, FlattenSimpleInterpolation, CSSObject, Interpolation, ThemeProps, SimpleInterpolation, css, StyledProps } from 'styled-components';
6
6
  import { Classes } from 'react-modal';
7
7
  import * as rc_scrollbars_lib_Scrollbars_types from 'rc-scrollbars/lib/Scrollbars/types';
8
8
  import * as rc_scrollbars from 'rc-scrollbars';
@@ -11,6 +11,59 @@ import { Styles, Props } from 'react-floater/lib/types';
11
11
  import { InputState, MaskOptions } from 'react-input-mask';
12
12
  import { ReactSelectProps } from 'react-select';
13
13
 
14
+ declare type H = 'h1' | 'h2' | 'h3' | 'h4';
15
+ interface TextHeadingProps extends Omit<TextProps, 'content' | 'as'> {
16
+ /** Default set of size, lineHeight and weight props */
17
+ h?: H;
18
+ /** Children react node */
19
+ children?: React.ReactNode;
20
+ }
21
+
22
+ /**
23
+ * @visibleName Text.Heading
24
+ */
25
+ declare const TextHeading: {
26
+ (props: TextHeadingProps): JSX.Element;
27
+ displayName: string;
28
+ };
29
+
30
+ interface TextEllipseProps extends Omit<TextProps, 'content'> {
31
+ /** Toggle text for folded state */
32
+ moreText?: string;
33
+ /** Toggle text for unfolded state */
34
+ lessText?: string;
35
+ /** Classname */
36
+ className?: string;
37
+ /** Html content */
38
+ content: string | string[];
39
+ /** Characters quantity for ellipsed text */
40
+ chars?: number;
41
+ /** Wrap text in quotes */
42
+ quoted?: boolean;
43
+ /** Flag to show toggler */
44
+ showToggler?: boolean;
45
+ }
46
+ interface TextEllipseState {
47
+ isUnFolded: boolean;
48
+ isEllipsed: boolean;
49
+ }
50
+ /**
51
+ * Расширен:
52
+ * - [`BaseProps`](#/Миксины)
53
+ * - [`Color`](#/Миксины)
54
+ * - [`Display`](#/Миксины)
55
+ * - [`ResponsiveNamedProperty<'size'>`](#/Миксины)
56
+ */
57
+ declare class TextEllipse extends Component<TextEllipseProps, TextEllipseState> {
58
+ static displayName: string;
59
+ constructor(props: TextEllipseProps);
60
+ componentDidUpdate({ content }: TextEllipseProps): void;
61
+ getContent: (props: Omit<TextEllipseProps, 'className' | 'moreText' | 'lessText' | 'showToggler'>) => "" | JSX.Element;
62
+ getQuted: (content: string) => string;
63
+ toggle: () => void;
64
+ render(): JSX.Element;
65
+ }
66
+
14
67
  declare enum DefaultColorNames {
15
68
  white = "white",
16
69
  black = "black",
@@ -817,110 +870,6 @@ declare type ThemePreset = 'default' | 'brand';
817
870
  declare type ThemeMode = 'light' | 'dark';
818
871
  declare type ThemeName = 'mother' | 'baby' | 'teen' | 'adult';
819
872
 
820
- declare type ColorPropertyVariants = 'color' | 'fontColor' | `${string}Color` | `color${string}`;
821
- declare type ColorCalcProperty = (_color: CSSColor) => FlattenSimpleInterpolation | null;
822
- declare type ColorCssProperty = string | ColorCalcProperty;
823
- declare type ColorProperty<T extends ColorPropertyVariants = 'color'> = {
824
- [key in `${T}`]?: Color;
825
- };
826
- declare const color: (color?: Color | string, cssProperty?: ColorCssProperty) => () => (props: {
827
- theme: DefaultTheme;
828
- }) => FlattenSimpleInterpolation | null;
829
-
830
- /**
831
- * Value for breakpoint
832
- */
833
- declare type PossibleValues = number | Size | 'auto' | 'initial' | 'inherit' | boolean;
834
- declare type PropsProperties = 'size' | 'fontSize' | 'height' | 'width' | 'top' | 'right' | 'bottom' | 'left' | 'padding' | 'paddingTop' | 'paddingRight' | 'paddingBottom' | 'paddingLeft' | 'margin' | 'marginTop' | 'marginRight' | 'marginBottom' | 'marginLeft' | 'fluid';
835
- declare type CalcProperty = (_size: number | 'auto' | 'initial' | 'inherit' | boolean, _sizing?: null | string) => FlattenSimpleInterpolation | null;
836
- declare type CssProperty = string | CalcProperty;
837
- declare type ResponsiveKeys = '' | 'XXS' | 'XS' | 'S' | 'M' | 'L' | 'XL';
838
- declare type ResponsiveNamedProperty<T extends PropsProperties, V extends PossibleValues = PossibleValues> = {
839
- [key in `${T}${ResponsiveKeys}`]?: V;
840
- };
841
- declare type ResponsiveProperty<V = number | Size> = V | [desktop: V, tablet: V, mobile: V] | [xl: V, l: V, m: V, s: V, xs: V, xxs: V];
842
- declare const property: (value: PossibleValues, cssProperty?: CssProperty, sizing?: null | string, sizes?: Record<Size, number>) => () => () => FlattenSimpleInterpolation | null;
843
- interface ResponsiveNamedPropertyPayload<T extends PropsProperties> {
844
- sizes: ResponsiveNamedProperty<T>;
845
- cssProperty: CssProperty;
846
- sizing?: null | string;
847
- customSizeHandler?: (_value: PossibleValues) => PossibleValues;
848
- sort?: (_a: string, _b: string) => number;
849
- predefinedSizes?: Record<Size, number>;
850
- }
851
- /**
852
- * Миксин для генерации media запросов
853
- *
854
- * @param obj.sizes Объект, в качестве ключей брэйкпоинт, в качестве значений - величина
855
- * @param obj.cssProperty CSS свойство, может быть функцией, возвращающей css`` из styled-components
856
- * @param obj.sizing значение величины, по умолчанию `px`
857
- * @param obj.customSizeHandler функция для вычисления кастомных значений величин
858
- * @returns строки медиазапросов
859
- */
860
- declare const responsiveNamedProperty: <T extends PropsProperties>({ sizes, predefinedSizes, cssProperty, sizing, customSizeHandler, sort, }: ResponsiveNamedPropertyPayload<T>) => () => () => styled_components.FlattenInterpolation<styled_components.ThemeProps<styled_components.DefaultTheme>>[];
861
- /**
862
- * Миксин для генерации media запросов
863
- *
864
- * @param propName имя пропсы
865
- * @param cssProperty имя css свойства
866
- * @param sizing значение величины, по умолчанию `px`
867
- * @returns строки медиазапросов
868
- */
869
- declare const responsiveProperty: (propName: string, cssProperty?: string | null, sizing?: null | string) => () => (props: any) => styled_components.FlattenInterpolation<styled_components.ThemeProps<styled_components.DefaultTheme>> | null;
870
-
871
- declare type H = 'h1' | 'h2' | 'h3' | 'h4';
872
- interface TextHeadingProps extends Omit<TextProps, 'content' | 'as'> {
873
- /** Default set of size, lineHeight and weight props */
874
- h?: H;
875
- /** Children react node */
876
- children?: React.ReactNode;
877
- }
878
-
879
- /**
880
- * @visibleName Text.Heading
881
- */
882
- declare const TextHeading: {
883
- (props: TextHeadingProps): JSX.Element;
884
- displayName: string;
885
- };
886
-
887
- interface TextEllipseProps extends Omit<TextProps, 'content'> {
888
- /** Toggle text for folded state */
889
- moreText?: string;
890
- /** Toggle text for unfolded state */
891
- lessText?: string;
892
- /** Classname */
893
- className?: string;
894
- /** Html content */
895
- content: string | string[];
896
- /** Characters quantity for ellipsed text */
897
- chars?: number;
898
- /** Wrap text in quotes */
899
- quoted?: boolean;
900
- /** Flag to show toggler */
901
- showToggler?: boolean;
902
- }
903
- interface TextEllipseState {
904
- isUnFolded: boolean;
905
- isEllipsed: boolean;
906
- }
907
- /**
908
- * Расширен:
909
- * - [`BaseProps`](#/Миксины)
910
- * - [`Color`](#/Миксины)
911
- * - [`Display`](#/Миксины)
912
- * - [`ResponsiveNamedProperty<'size'>`](#/Миксины)
913
- */
914
- declare class TextEllipse extends Component<TextEllipseProps, TextEllipseState> {
915
- static displayName: string;
916
- constructor(props: TextEllipseProps);
917
- componentDidUpdate({ content }: TextEllipseProps): void;
918
- getContent: (props: Omit<TextEllipseProps, 'className' | 'moreText' | 'lessText' | 'showToggler'>) => "" | JSX.Element;
919
- getQuted: (content: string) => string;
920
- toggle: () => void;
921
- render(): JSX.Element;
922
- }
923
-
924
873
  declare type ResponsivePropKey = 'size' | keyof CSSProperties;
925
874
  declare type ResponsiveProps<K extends ResponsivePropKey, V> = {
926
875
  [key in K]?: V | [desktop: V, tablet: V, mobile: V] | [xl: V, l: V, m: V, s: V, xs: V, xxs: V];
@@ -940,6 +889,16 @@ declare type ResponsiveMarginProps = ResponsiveProps<MarginProperty, CSSProperti
940
889
  marginUnits?: CSSUnit;
941
890
  };
942
891
 
892
+ declare type ColorPropertyVariants = 'color' | 'fontColor' | `${string}Color` | `color${string}`;
893
+ declare type ColorCalcProperty = (_color: CSSColor) => FlattenSimpleInterpolation | null;
894
+ declare type ColorCssProperty = string | ColorCalcProperty;
895
+ declare type ColorProperty<T extends ColorPropertyVariants = 'color'> = {
896
+ [key in `${T}`]?: Color;
897
+ };
898
+ declare const color: (color?: Color | string, cssProperty?: ColorCssProperty) => () => (props: {
899
+ theme: DefaultTheme;
900
+ }) => FlattenSimpleInterpolation | null;
901
+
943
902
  declare type Display = 'block' | 'inline' | 'inline-block' | 'flex' | 'inline-flex' | 'table-cell' | 'inherit' | 'none';
944
903
  interface DisplayProperty {
945
904
  display?: Display;
@@ -955,6 +914,8 @@ interface TextProps extends ResponsiveSizeProps, ResponsiveMarginProps, DisplayP
955
914
  fontFamily?: string;
956
915
  /** Font weight */
957
916
  weight?: CSSFontWeight;
917
+ /** White space */
918
+ whiteSpace?: string;
958
919
  /** Font style */
959
920
  fontStyle?: 'normal' | 'italic';
960
921
  /** Text transform */
@@ -975,64 +936,25 @@ interface TextProps extends ResponsiveSizeProps, ResponsiveMarginProps, DisplayP
975
936
 
976
937
  /**
977
938
  *
978
- * Component interface extends:
979
- * - [`ResponsiveSizeProps`](#/Interfaces)
980
- * - [`ResponsiveMarginProps`](#/Interfaces)
981
- * - [`BaseProps`](#/Interfaces)
982
- * - [`React.ComponentPropsWithRef<'div'>`](#/Interfaces)
939
+ * Component accepts all \<div\> attributes.
940
+ *
941
+ * Responsive "size", "margin" props are supported.
942
+ *
943
+ * Exposed "ref" attached to root node.
944
+ *
945
+ * See full [TextProps](https://github.com/foxford/ui/blob/master/src/components/Text/types.ts)
983
946
  */
984
947
  declare const Text: React.ForwardRefExoticComponent<TextProps> & {
985
948
  Heading: typeof TextHeading;
986
949
  Ellipse: typeof TextEllipse;
987
950
  };
988
951
 
989
- declare enum SizeInput {
990
- l = 380,
991
- m = 300,
992
- s = 220,
993
- xs = 140
994
- }
995
-
996
952
  interface BaseProps {
997
953
  preset?: ThemePreset;
998
954
  className?: string;
999
955
  style?: React.CSSProperties;
1000
956
  cursor?: string;
1001
957
  }
1002
- interface InputField extends ColorProperty, ColorProperty<'placeholderColor'>, ResponsiveNamedProperty<'width', 'auto' | keyof typeof SizeInput | number> {
1003
- /**
1004
- * Is disabled field
1005
- */
1006
- disabled?: boolean;
1007
- /**
1008
- * Has error
1009
- */
1010
- error?: boolean;
1011
- /**
1012
- * Tab index
1013
- */
1014
- tabIndex?: number;
1015
- /**
1016
- * Take on the size of it's container.
1017
- */
1018
- fluid?: boolean;
1019
- /**
1020
- * @preset {Default} Rounded style
1021
- */
1022
- rounded?: boolean;
1023
- /**
1024
- * Placeholder text
1025
- */
1026
- placeholder?: string;
1027
- /**
1028
- * Field name attribute
1029
- */
1030
- name?: string;
1031
- autoComplete?: string | undefined;
1032
- autoFocus?: boolean | undefined;
1033
- readOnly?: boolean | undefined;
1034
- required?: boolean | undefined;
1035
- }
1036
958
  declare type ColorPaletteProps<T extends ColorPaletteKey = ColorPaletteKey> = {
1037
959
  palette?: Partial<Record<T, Color>>;
1038
960
  };
@@ -1086,6 +1008,47 @@ declare const teenDarkTheme: DefaultTheme;
1086
1008
  declare const adultLightTheme: DefaultTheme;
1087
1009
  declare const adultDarkTheme: DefaultTheme;
1088
1010
 
1011
+ /**
1012
+ * Value for breakpoint
1013
+ */
1014
+ declare type PossibleValues = number | Size | 'auto' | 'initial' | 'inherit' | boolean;
1015
+ declare type PropsProperties = 'size' | 'fontSize' | 'height' | 'width' | 'top' | 'right' | 'bottom' | 'left' | 'padding' | 'paddingTop' | 'paddingRight' | 'paddingBottom' | 'paddingLeft' | 'margin' | 'marginTop' | 'marginRight' | 'marginBottom' | 'marginLeft' | 'fluid';
1016
+ declare type CalcProperty = (_size: number | 'auto' | 'initial' | 'inherit' | boolean, _sizing?: null | string) => FlattenSimpleInterpolation | null;
1017
+ declare type CssProperty = string | CalcProperty;
1018
+ declare type ResponsiveKeys = '' | 'XXS' | 'XS' | 'S' | 'M' | 'L' | 'XL';
1019
+ declare type ResponsiveNamedProperty<T extends PropsProperties, V extends PossibleValues = PossibleValues> = {
1020
+ [key in `${T}${ResponsiveKeys}`]?: V;
1021
+ };
1022
+ declare type ResponsiveProperty<V = number | Size> = V | [desktop: V, tablet: V, mobile: V] | [xl: V, l: V, m: V, s: V, xs: V, xxs: V];
1023
+ declare const property: (value: PossibleValues, cssProperty?: CssProperty, sizing?: null | string, sizes?: Record<Size, number>) => () => () => FlattenSimpleInterpolation | null;
1024
+ interface ResponsiveNamedPropertyPayload<T extends PropsProperties> {
1025
+ sizes: ResponsiveNamedProperty<T>;
1026
+ cssProperty: CssProperty;
1027
+ sizing?: null | string;
1028
+ customSizeHandler?: (_value: PossibleValues) => PossibleValues;
1029
+ sort?: (_a: string, _b: string) => number;
1030
+ predefinedSizes?: Record<Size, number>;
1031
+ }
1032
+ /**
1033
+ * Миксин для генерации media запросов
1034
+ *
1035
+ * @param obj.sizes Объект, в качестве ключей брэйкпоинт, в качестве значений - величина
1036
+ * @param obj.cssProperty CSS свойство, может быть функцией, возвращающей css`` из styled-components
1037
+ * @param obj.sizing значение величины, по умолчанию `px`
1038
+ * @param obj.customSizeHandler функция для вычисления кастомных значений величин
1039
+ * @returns строки медиазапросов
1040
+ */
1041
+ declare const responsiveNamedProperty: <T extends PropsProperties>({ sizes, predefinedSizes, cssProperty, sizing, customSizeHandler, sort, }: ResponsiveNamedPropertyPayload<T>) => () => () => styled_components.FlattenInterpolation<styled_components.ThemeProps<styled_components.DefaultTheme>>[];
1042
+ /**
1043
+ * Миксин для генерации media запросов
1044
+ *
1045
+ * @param propName имя пропсы
1046
+ * @param cssProperty имя css свойства
1047
+ * @param sizing значение величины, по умолчанию `px`
1048
+ * @returns строки медиазапросов
1049
+ */
1050
+ declare const responsiveProperty: (propName: string, cssProperty?: string | null, sizing?: null | string) => () => (props: any) => styled_components.FlattenInterpolation<styled_components.ThemeProps<styled_components.DefaultTheme>> | null;
1051
+
1089
1052
  declare global {
1090
1053
  // Some users of this package are don't use "dom" libs
1091
1054
  interface EventTarget {}
@@ -1328,13 +1291,13 @@ DisplayProperty {
1328
1291
 
1329
1292
  /**
1330
1293
  *
1331
- * Component interface extends:
1332
- * - [`ResponsiveSizeProps`](#/Interfaces)
1333
- * - [`ResponsiveMarginProps`](#/Interfaces)
1334
- * - [`ColorPaletteProps<keyof AnchorPalette>`](#/Interfaces)
1335
- * - [`TypographyProps`](#/Interfaces)
1336
- * - [`BaseProps`](#/Interfaces)
1337
- * - [`React.ComponentPropsWithRef<'a'>`](#/Interfaces)
1294
+ * Component accepts all \<a\> attributes.
1295
+ *
1296
+ * Responsive "size", "margin" props are supported.
1297
+ *
1298
+ * Exposed "ref" attached to root node.
1299
+ *
1300
+ * See full [AnchorProps](https://github.com/foxford/ui/blob/master/src/components/Anchor/types.ts)
1338
1301
  */
1339
1302
  declare const Anchor: React.ForwardRefExoticComponent<AnchorProps>;
1340
1303
 
@@ -1435,12 +1398,13 @@ ResponsiveNamedProperty<'height', 'l' | 'm' | 's' | 'xs' | number> {
1435
1398
 
1436
1399
  /**
1437
1400
  *
1438
- * Component interface extends:
1439
- * - [`BaseProps`](#/Interfaces)
1440
- * - [`TypographyProps`](#/Interfaces)
1441
- * - [`ResponsiveSizeProps`](#/Interfaces)
1442
- * - [`ColorPaletteProps<keyof ButtonPalette>`](#/Interfaces)
1443
- * - [`React.ComponentPropsWithRef<'button'>`](#/Interfaces)
1401
+ * Component accepts all \<button\> attributes.
1402
+ *
1403
+ * Responsive "size" props are supported.
1404
+ *
1405
+ * Exposed "ref" attached to root node.
1406
+ *
1407
+ * See full [ButtonProps](https://github.com/foxford/ui/blob/master/src/components/Button/types.ts)
1444
1408
  */
1445
1409
  declare const Button: React.ForwardRefExoticComponent<ButtonProps>;
1446
1410
 
@@ -1598,22 +1562,26 @@ interface CheckboxComponent extends ForwardRefExoticComponent<PropsWithoutRef<Ch
1598
1562
 
1599
1563
  declare const Checkbox: CheckboxComponent;
1600
1564
 
1601
- declare type TextAreaHTMLAttributes = Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'cols' | 'rows' | 'color'>;
1602
- interface TextareaProps extends BaseProps, InputField, TextAreaHTMLAttributes {
1603
- /** Specifies the visible width of a text area */
1604
- cols?: number;
1605
- /** Specifies the visible number of lines in a text area */
1606
- rows?: number;
1565
+ declare enum SizeInput {
1566
+ l = 380,
1567
+ m = 300,
1568
+ s = 220,
1569
+ xs = 140
1570
+ }
1571
+
1572
+ interface TextareaProps extends BaseProps, ColorProperty, ColorProperty<'placeholderColor'>, ResponsiveNamedProperty<'width', 'auto' | keyof typeof SizeInput | number>, Omit<React.ComponentPropsWithoutRef<'textarea'>, 'color'> {
1607
1573
  /** Specifies the visible max number of lines in a text area */
1608
1574
  maxRows?: number;
1609
- /** Specifies the maximum number of characters allowed in the text area */
1610
- maxLength?: number;
1611
- /** On change handler */
1612
- onChange?(_event: React.ChangeEvent<HTMLTextAreaElement>): void;
1613
1575
  /** Value */
1614
1576
  value?: string;
1615
1577
  /** Autosize for textarea */
1616
1578
  autosize?: boolean;
1579
+ /** Has error */
1580
+ error?: boolean;
1581
+ /** Take on the size of it's container */
1582
+ fluid?: boolean;
1583
+ /** Rounded style */
1584
+ rounded?: boolean;
1617
1585
  }
1618
1586
 
1619
1587
  declare const Textarea: {
@@ -1661,14 +1629,13 @@ ColorProperty<'backgroundColor'>, ColorPaletteProps<keyof ArrowBadgePalette>, Ty
1661
1629
 
1662
1630
  /**
1663
1631
  *
1664
- * Component interface extends:
1665
- * - [`ResponsiveSizeProps`](#/Interfaces)
1666
- * - [`ResponsiveMarginProps`](#/Interfaces)
1667
- * - [`ColorSchemaProps`](#/Interfaces)
1668
- * - [`ColorPaletteProps<keyof ArrowBadgePalette>`](#/Interfaces)
1669
- * - [`TypographyProps`](#/Interfaces)
1670
- * - [`BaseProps`](#/Interfaces)
1671
- * - [`React.ComponentPropsWithRef<'div'>`](#/Interfaces)
1632
+ * Component accepts all \<div\> attributes.
1633
+ *
1634
+ * Responsive "size", "margin" props are supported.
1635
+ *
1636
+ * Exposed "ref" attached to root node.
1637
+ *
1638
+ * See full [ArrowBadgeProps](https://github.com/foxford/ui/blob/master/src/components/ArrowBadge/types.ts)
1672
1639
  */
1673
1640
  declare const ArrowBadge: React.ForwardRefExoticComponent<ArrowBadgeProps>;
1674
1641
 
@@ -1718,13 +1685,13 @@ ColorPaletteProps<keyof TabPalette>, TypographyProps, Omit<React.ComponentPropsW
1718
1685
 
1719
1686
  /**
1720
1687
  *
1721
- * Component interface extends:
1722
- * - [`ResponsiveSizeProps`](#/Interfaces)
1723
- * - [`ResponsiveMarginProps`](#/Interfaces)
1724
- * - [`ColorPaletteProps<keyof TabPalette>`](#/Interfaces)
1725
- * - [`TypographyProps`](#/Interfaces)
1726
- * - [`BaseProps`](#/Interfaces)
1727
- * - [`React.ComponentPropsWithRef<'button'>`](#/Interfaces)
1688
+ * Component accepts all \<button\> attributes.
1689
+ *
1690
+ * Responsive "size", "margin" props are supported.
1691
+ *
1692
+ * Exposed "ref" attached to root node.
1693
+ *
1694
+ * See full [TabProps](https://github.com/foxford/ui/blob/master/src/components/Tab/types.ts)
1728
1695
  */
1729
1696
  declare const Tab: React.ForwardRefExoticComponent<TabProps>;
1730
1697
 
@@ -1759,14 +1726,13 @@ DisplayProperty, ColorPaletteProps<keyof BadgePalette>, Omit<React.ComponentProp
1759
1726
 
1760
1727
  /**
1761
1728
  *
1762
- * Component interface extends:
1763
- * - [`ResponsiveSizeProps`](#/Interfaces)
1764
- * - [`ResponsiveMarginProps`](#/Interfaces)
1765
- * - [`ColorSchemaProps`](#/Interfaces)
1766
- * - [`ColorPaletteProps<keyof BadgePalette>`](#/Interfaces)
1767
- * - [`TypographyProps`](#/Interfaces)
1768
- * - [`BaseProps`](#/Interfaces)
1769
- * - [`React.ComponentPropsWithRef<'div'>`](#/Interfaces)
1729
+ * Component accepts all \<div\> attributes.
1730
+ *
1731
+ * Responsive "size", "margin" props are supported.
1732
+ *
1733
+ * Exposed "ref" attached to root node.
1734
+ *
1735
+ * See full [BadgeProps](https://github.com/foxford/ui/blob/master/src/components/Badge/types.ts)
1770
1736
  */
1771
1737
  declare const Badge: React.ForwardRefExoticComponent<BadgeProps>;
1772
1738
 
@@ -3222,15 +3188,15 @@ interface InputPhoneState {
3222
3188
  declare class InputPhone extends PureComponent<typeof InputPhone.defaultProps & InputPhoneProps, InputPhoneState> {
3223
3189
  static displayName: string;
3224
3190
  static defaultProps: {
3191
+ countryData: [string, string, string, RegExp][];
3192
+ defaultMask: string;
3193
+ initialMask: string;
3194
+ placeholder: string;
3225
3195
  rounded: boolean;
3226
3196
  type: string;
3227
3197
  color: string;
3228
3198
  mask: string;
3229
3199
  placeholderColor: string;
3230
- countryData: [string, string, string, RegExp][];
3231
- defaultMask: string;
3232
- initialMask: string;
3233
- placeholder: string;
3234
3200
  };
3235
3201
  autocorrectOf8: boolean;
3236
3202
  autocorrectOf9: boolean;
@@ -3249,76 +3215,118 @@ declare class InputPhone extends PureComponent<typeof InputPhone.defaultProps &
3249
3215
  render(): JSX.Element;
3250
3216
  }
3251
3217
 
3252
- declare type InputHTMLAttributes = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'color' | 'width'>;
3253
- interface InputProps extends BaseProps, InputField, InputHTMLAttributes {
3254
- /**
3255
- * Mask string. Format characters are:
3256
- * * `9`: `0-9`
3257
- * * `a`: `A-Z, a-z`
3258
- * * `\*`: `A-Z, a-z, 0-9`
3259
- *
3260
- * Any character can be escaped with backslash, which usually will appear as double backslash in JS strings.
3261
- * For example, German phone mask with unremoveable prefix +49 will look like `mask="+4\\9 99 999 99"` or `mask={"+4\\\\9 99 999 99"}`
3262
- */
3263
- mask?: string | Array<string | RegExp>;
3264
- /**
3265
- * Character to cover unfilled editable parts of mask. Default character is "_". If set to null, unfilled parts will be empty, like in ordinary input.
3266
- */
3218
+ declare type FormInputLabelPalette = {
3219
+ color: CSSColor;
3220
+ backgroundColor: CSSColor;
3221
+ borderColor: CSSColor;
3222
+ colorHover: CSSColor;
3223
+ backgroundColorHover: CSSColor;
3224
+ borderColorHover: CSSColor;
3225
+ };
3226
+
3227
+ declare type InputPalette = {
3228
+ inputColor: CSSColor;
3229
+ inputPlaceholderColor: CSSColor;
3230
+ inputColorDisabled: CSSColor;
3231
+ inputPlaceholderColorDisabled: CSSColor;
3232
+ };
3233
+ declare type InputControlsPalette = {
3234
+ controlsColor: CSSColor;
3235
+ controlsBackgroundColor: CSSColor;
3236
+ controlsSeparatorColor: CSSColor;
3237
+ controlsColorHover: CSSColor;
3238
+ controlsBackgroundColorHover: CSSColor;
3239
+ controlsColorActive: CSSColor;
3240
+ controlsBackgroundColorActive: CSSColor;
3241
+ controlsColorDisabled: CSSColor;
3242
+ controlsBackgroundColorDisabled: CSSColor;
3243
+ };
3244
+ interface InputProps extends BaseProps, ResponsiveSizeProps, ResponsiveMarginProps, TypographyProps, ColorPaletteProps<keyof InputPalette | keyof InputControlsPalette | keyof FormInputLabelPalette>, Omit<React.ComponentPropsWithRef<'input'>, 'children' | 'size' | 'type' | 'value' | 'defaultValue' | 'color' | 'width'>,
3245
+ /** @deprecated Use palette */
3246
+ ColorProperty,
3247
+ /** @deprecated Use palette */
3248
+ ColorProperty<'placeholderColor'>,
3249
+ /** @ignore Control width with container */
3250
+ ResponsiveNamedProperty<'width', 'auto' | keyof typeof SizeInput | number> {
3251
+ /** Input mask.
3252
+ * Look up [docs v2.0.4](https://www.npmjs.com/package/react-input-mask/v/2.0.4?activeTab=code) */
3253
+ mask?: string;
3254
+ /** Character to cover unfilled editable parts of mask.
3255
+ * Look up [docs v2.0.4](https://www.npmjs.com/package/react-input-mask/v/2.0.4?activeTab=code) */
3267
3256
  maskChar?: string | null;
3268
- /**
3269
- * Defines format characters with characters as keys and corresponding RegExp string as values. Default ones:
3270
- * ```
3271
- * {
3272
- * "9": "[0-9]",
3273
- * "a": "[A-Za-z]",
3274
- * "*": "[A-Za-z0-9]"
3275
- * }```
3276
- */
3277
- formatChars?: {
3278
- [key: string]: string;
3279
- };
3280
- /**
3281
- * Show mask even in empty input without focus.
3282
- */
3257
+ /** Defines format characters with characters as keys and corresponding RegExp string as values.
3258
+ * Look up [docs v2.0.4](https://www.npmjs.com/package/react-input-mask/v/2.0.4?activeTab=code) */
3259
+ formatChars?: Record<string, string>;
3260
+ /** Show mask in empty input without focus */
3283
3261
  alwaysShowMask?: boolean;
3284
- /**
3285
- * Use inputRef instead of ref if you need input node to manage focus, selection, etc.
3286
- */
3262
+ /** Callback to change masked value and cursor position before it will be applied to the input.
3263
+ * Look up [docs v2.0.4](https://www.npmjs.com/package/react-input-mask/v/2.0.4?activeTab=code) */
3264
+ beforeMaskedValueChange?: (newState: InputState, oldState: InputState, userInput: string, maskOptions: MaskOptions) => InputState;
3265
+ /** Type attribute */
3266
+ type?: 'email' | 'number' | 'password' | 'tel' | 'text' | 'url';
3267
+ /** Value for controlled input */
3268
+ value?: string | number;
3269
+ /** Default value for uncontrolled input */
3270
+ defaultValue?: string | number;
3271
+ /** Label for input */
3272
+ label?: React.ReactNode;
3273
+ /** Label position */
3274
+ labelPosition?: 'dynamic' | 'top' | 'center';
3275
+ /** Icon before input */
3276
+ icon?: JSX.Element;
3277
+ /** Props for icon component */
3278
+ iconProps?: IconProps;
3279
+ /** Input controls */
3280
+ controls?: {
3281
+ additional?: {
3282
+ icon: JSX.Element;
3283
+ iconProps?: IconProps;
3284
+ buttonProps?: React.ComponentPropsWithoutRef<'button'>;
3285
+ };
3286
+ number?: {
3287
+ icon?: [JSX.Element, JSX.Element];
3288
+ iconProps?: IconProps;
3289
+ buttonProps?: React.ComponentPropsWithoutRef<'button'> | [Nullable<React.ComponentPropsWithoutRef<'button'>>, Nullable<React.ComponentPropsWithoutRef<'button'>>];
3290
+ };
3291
+ };
3292
+ /** Content after input */
3293
+ text?: React.ReactNode;
3294
+ /** Appearance variant */
3295
+ primary?: boolean;
3296
+ /** Appearance variant */
3297
+ secondary?: boolean;
3298
+ /** Appearance variant */
3299
+ onColored?: boolean;
3300
+ /** Appearance variant */
3301
+ error?: boolean;
3302
+ /** Appearance variant */
3303
+ success?: boolean;
3304
+ /** Display inline */
3305
+ inline?: boolean;
3306
+ /** @ignore */
3307
+ fluid?: boolean;
3308
+ /** @ignore */
3309
+ rounded?: boolean;
3310
+ /** @ignore @deprecated Use ref */
3287
3311
  inputRef?: React.Ref<HTMLInputElement>;
3288
- /**
3289
- * In case you need to implement more complex masking behavior, you can provide
3290
- * beforeMaskedValueChange function to change masked value and cursor position
3291
- * before it will be applied to the input.
3292
- */
3293
- beforeMaskedValueChange?(_newState: InputState, _oldState: InputState, _userInput: string, _maskOptions: MaskOptions): InputState;
3294
- /**
3295
- * Input type
3296
- */
3297
- type?: string;
3298
- dataset?: Record<string, string>;
3299
3312
  }
3313
+ declare type StyledBaseInputProps = React.ComponentPropsWithoutRef<'input'> & Pick<InputProps, 'color' | 'placeholderColor' | 'width' | 'widthXXS' | 'widthXS' | 'widthS' | 'widthM' | 'widthL' | 'widthXL' | 'mask' | 'maskChar' | 'formatChars' | 'alwaysShowMask' | 'beforeMaskedValueChange' | 'error' | 'fluid' | 'rounded' | 'inputRef'>;
3314
+
3300
3315
  /**
3301
- * Расширен:
3302
- * - [`BaseProps`](#/Миксины)
3303
- * - [`InputField`](#/Миксины)
3304
- * - `React.InputHTMLAttributes<HTMLInputElement>`
3316
+ *
3317
+ * Component accepts all \<input\> attributes and "react-input-mask" props.
3318
+ *
3319
+ * Responsive "size", "margin" props are supported.
3320
+ *
3321
+ * Exposed "ref" attached to \<input\>.
3322
+ *
3323
+ * See full [InputProps](https://github.com/foxford/ui/blob/master/src/components/Input/types.ts)
3305
3324
  */
3306
- declare function Input(props: InputProps): JSX.Element;
3307
- declare namespace Input {
3308
- var defaultProps: {
3309
- rounded: boolean;
3310
- type: string;
3311
- color: string;
3312
- mask: string;
3313
- placeholderColor: string;
3314
- };
3315
- var Phone: typeof InputPhone;
3316
- var displayName: string;
3317
- }
3325
+ declare const Input: React.ForwardRefExoticComponent<InputProps> & {
3326
+ Phone: typeof InputPhone;
3327
+ };
3318
3328
 
3319
- declare const baseInputStyle: <T extends InputField>(props: T & {
3320
- theme: DefaultTheme;
3321
- }) => styled_components.FlattenInterpolation<styled_components.ThemeProps<DefaultTheme>>;
3329
+ declare const baseInputStyle: (props: StyledProps<Pick<StyledBaseInputProps, 'color' | 'placeholderColor' | 'disabled' | 'rounded' | 'width' | 'widthXS' | 'widthS' | 'widthM' | 'widthL' | 'widthXL' | 'fluid' | 'error'>>) => styled_components.FlattenInterpolation<styled_components.ThemeProps<styled_components.DefaultTheme>>;
3322
3330
 
3323
3331
  declare const INITIAL_MASK = "99999999999999999999";
3324
3332
  declare const DEFAULT_MASK: string;
@@ -3490,13 +3498,14 @@ interface FormLabelProps extends BaseProps, TypographyProps, ResponsiveSizeProps
3490
3498
 
3491
3499
  /**
3492
3500
  *
3493
- * Component interface extends:
3494
- * - [`BaseProps`](#/Interfaces)
3495
- * - [`ResponsiveSizeProps`](#/Interfaces)
3496
- * - [`ResponsiveMarginProps`](#/Interfaces)
3497
- * - [`ColorPaletteProps<keyof FormLabelPalette>`](#/Interfaces)
3498
- * - [`React.ComponentPropsWithRef<'label'>`](#/Interfaces)
3501
+ * Component accepts all \<label\> attributes.
3502
+ *
3503
+ * Responsive "size", "margin" props are supported.
3504
+ *
3505
+ * Exposed "ref" attached to root node.
3506
+ *
3507
+ * See full [FormLabelProps](https://github.com/foxford/ui/blob/master/src/components/FormLabel/types.ts)
3499
3508
  */
3500
3509
  declare const FormLabel: React.ForwardRefExoticComponent<FormLabelProps>;
3501
3510
 
3502
- export { ActionBtn, Alert, Amount, Anchor, Arrow, ArrowBadge, Avatar, Badge, BaseProps, Breakpoint, Button, COUNTRY_DATA, CSSBorderStyle, CSSColor, CSSFontWeight, CSSGlobalValue, CSSUnit, CSSVerticalAlign, CURRENCY_MAP, Checkbox, Color, ColorNames, ColorPaletteInterpolationProps, ColorPaletteKey, ColorPaletteProps, ColorSchemaProps, Container, ContextMenu, CurrencyCodes, DEFAULT_MASK, FormLabel, HEX, INITIAL_MASK, Icon, Input, InputField, Modal, Nullable, Paper, Progress, RGB, RGBA, Radio, RenderProps, withThemeScrollable as Scrollable, Section, Select, Separator, Size, Sizes, Spacer, Spinner, Switcher, Tab, Tabs, Tag, Text, Textarea, Theme, ThemeMode, ThemeName, ThemePreset, ThemeProvider, Tooltip, TypographyProps, adultDarkTheme, adultLightTheme, babyDarkTheme, babyLightTheme, baseInputStyle, buildMediaQuery, color, defaultIcons, desktopFirst, hexToRgbA, isHex, mobileFirst, motherDarkTheme, motherLightTheme, property, responsiveNamedProperty, responsiveProperty, screenL, screenM, screenMaxL, screenMaxM, screenMaxS, screenMaxXl, screenMaxXs, screenMaxXxs, screenMinL, screenMinM, screenMinS, screenMinXl, screenMinXs, screenRetina, screenS, screenXl, screenXs, teenDarkTheme, teenLightTheme, defaultTheme as theme, vAlign };
3511
+ export { ActionBtn, Alert, Amount, Anchor, Arrow, ArrowBadge, Avatar, Badge, BaseProps, Breakpoint, Button, COUNTRY_DATA, CSSBorderStyle, CSSColor, CSSFontWeight, CSSGlobalValue, CSSUnit, CSSVerticalAlign, CURRENCY_MAP, Checkbox, Color, ColorNames, ColorPaletteInterpolationProps, ColorPaletteKey, ColorPaletteProps, ColorSchemaProps, Container, ContextMenu, CurrencyCodes, DEFAULT_MASK, FormLabel, HEX, INITIAL_MASK, Icon, Input, Modal, Nullable, Paper, Progress, RGB, RGBA, Radio, RenderProps, withThemeScrollable as Scrollable, Section, Select, Separator, Size, Sizes, Spacer, Spinner, Switcher, Tab, Tabs, Tag, Text, Textarea, Theme, ThemeMode, ThemeName, ThemePreset, ThemeProvider, Tooltip, TypographyProps, adultDarkTheme, adultLightTheme, babyDarkTheme, babyLightTheme, baseInputStyle, buildMediaQuery, color, defaultIcons, desktopFirst, hexToRgbA, isHex, mobileFirst, motherDarkTheme, motherLightTheme, property, responsiveNamedProperty, responsiveProperty, screenL, screenM, screenMaxL, screenMaxM, screenMaxS, screenMaxXl, screenMaxXs, screenMaxXxs, screenMinL, screenMinM, screenMinS, screenMinXl, screenMinXs, screenRetina, screenS, screenXl, screenXs, teenDarkTheme, teenLightTheme, defaultTheme as theme, vAlign };