@foxford/ui 2.12.1-beta-d3894fd-20231002 → 2.13.0-beta-264f0a6-20231011
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/Button/Button.js +1 -1
- package/components/Button/Button.js.map +1 -1
- package/components/Button/constants.js +1 -1
- package/components/Button/constants.js.map +1 -1
- package/components/Button/style.js +1 -1
- package/components/Button/style.js.map +1 -1
- package/dts/index.d.ts +33 -43
- package/index.cjs.js +1 -1
- package/index.cjs.js.map +1 -1
- package/index.js +1 -1
- package/mixins/color.js.map +1 -1
- package/mixins/responsive-property.js +1 -1
- package/mixins/responsive-property.js.map +1 -1
- package/mixins/screen.js.map +1 -1
- package/mixins/shared.js +1 -1
- package/mixins/shared.js.map +1 -1
- package/mixins/sizing.js +2 -0
- package/mixins/sizing.js.map +1 -0
- package/package.json +1 -1
package/dts/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import { CSSProperties, Component, ForwardRefExoticComponent, PropsWithoutRef, RefAttributes, PureComponent } from 'react';
|
|
2
4
|
import * as styled_components from 'styled-components';
|
|
3
5
|
import { DefaultTheme, FlattenSimpleInterpolation, CSSObject, Interpolation, ThemeProps, SimpleInterpolation, css } from 'styled-components';
|
|
4
6
|
import { Link, NavLink } from 'react-router-dom';
|
|
5
|
-
import * as react from 'react';
|
|
6
|
-
import { Component, ForwardRefExoticComponent, PropsWithoutRef, RefAttributes, PureComponent } from 'react';
|
|
7
7
|
import { Classes } from 'react-modal';
|
|
8
8
|
import * as rc_scrollbars_lib_Scrollbars_types from 'rc-scrollbars/lib/Scrollbars/types';
|
|
9
9
|
import * as rc_scrollbars from 'rc-scrollbars';
|
|
@@ -797,26 +797,14 @@ declare type Color = keyof typeof ColorNames | ColorValue;
|
|
|
797
797
|
declare type ColorProperty<T extends ColorPropertyVariants = 'color'> = {
|
|
798
798
|
[key in `${T}`]?: Color;
|
|
799
799
|
};
|
|
800
|
-
declare const color: (color?: Color, cssProperty?: ColorCssProperty) => () => (props: {
|
|
800
|
+
declare const color: (color?: Color | string, cssProperty?: ColorCssProperty) => () => (props: {
|
|
801
801
|
theme: DefaultTheme;
|
|
802
802
|
}) => FlattenSimpleInterpolation | null;
|
|
803
803
|
|
|
804
|
-
declare enum SizeLatin {
|
|
805
|
-
xxxl = "xxxl",
|
|
806
|
-
xxl = "xxl",
|
|
807
|
-
xl = "xl",
|
|
808
|
-
l = "l",
|
|
809
|
-
m = "m",
|
|
810
|
-
s = "s",
|
|
811
|
-
xs = "xs",
|
|
812
|
-
xxs = "xxs",
|
|
813
|
-
xxxs = "xxxs"
|
|
814
|
-
}
|
|
815
|
-
|
|
816
804
|
/**
|
|
817
805
|
* Value for breakpoint
|
|
818
806
|
*/
|
|
819
|
-
declare type PossibleValues = number |
|
|
807
|
+
declare type PossibleValues = number | Size | 'auto' | 'initial' | 'inherit' | boolean;
|
|
820
808
|
declare type PropsProperties = 'size' | 'fontSize' | 'height' | 'width' | 'top' | 'right' | 'bottom' | 'left' | 'padding' | 'paddingTop' | 'paddingRight' | 'paddingBottom' | 'paddingLeft' | 'margin' | 'marginTop' | 'marginRight' | 'marginBottom' | 'marginLeft' | 'fluid';
|
|
821
809
|
declare type CalcProperty = (_size: number | 'auto' | 'initial' | 'inherit' | boolean, _sizing?: null | string) => FlattenSimpleInterpolation | null;
|
|
822
810
|
declare type CssProperty = string | CalcProperty;
|
|
@@ -824,29 +812,15 @@ declare type ResponsiveKeys = '' | 'XXS' | 'XS' | 'S' | 'M' | 'L' | 'XL';
|
|
|
824
812
|
declare type ResponsiveNamedProperty<T extends PropsProperties, V extends PossibleValues = PossibleValues> = {
|
|
825
813
|
[key in `${T}${ResponsiveKeys}`]?: V;
|
|
826
814
|
};
|
|
827
|
-
declare type ResponsiveProperty<V = number |
|
|
828
|
-
declare const property: (value: PossibleValues, cssProperty?: CssProperty, sizing?: null | string, sizes?: Record<
|
|
829
|
-
/**
|
|
830
|
-
* Sort keys as desktop first
|
|
831
|
-
* @param a key a
|
|
832
|
-
* @param b key b
|
|
833
|
-
* @returns number
|
|
834
|
-
*/
|
|
835
|
-
declare const desktopFirst: (a: string, b: string) => number;
|
|
836
|
-
/**
|
|
837
|
-
* Sort keys as mobile first
|
|
838
|
-
* @param a key a
|
|
839
|
-
* @param b key b
|
|
840
|
-
* @returns number
|
|
841
|
-
*/
|
|
842
|
-
declare const mobileFirst: (a: string, b: string) => number;
|
|
815
|
+
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];
|
|
816
|
+
declare const property: (value: PossibleValues, cssProperty?: CssProperty, sizing?: null | string, sizes?: Record<Size, number>) => () => () => FlattenSimpleInterpolation | null;
|
|
843
817
|
interface ResponsiveNamedPropertyPayload<T extends PropsProperties> {
|
|
844
818
|
sizes: ResponsiveNamedProperty<T>;
|
|
845
819
|
cssProperty: CssProperty;
|
|
846
820
|
sizing?: null | string;
|
|
847
821
|
customSizeHandler?: (_value: PossibleValues) => PossibleValues;
|
|
848
822
|
sort?: (_a: string, _b: string) => number;
|
|
849
|
-
predefinedSizes?: Record<
|
|
823
|
+
predefinedSizes?: Record<Size, number>;
|
|
850
824
|
}
|
|
851
825
|
/**
|
|
852
826
|
* Миксин для генерации media запросов
|
|
@@ -883,6 +857,11 @@ declare type FontWeight = 'normal' | 'bold' | 'lighter' | 'bolder' | number;
|
|
|
883
857
|
declare type ThemePreset = 'default' | 'brand';
|
|
884
858
|
declare type ThemeMode = 'light' | 'dark';
|
|
885
859
|
declare type ThemeName = 'mother' | 'baby' | 'teen' | 'adult';
|
|
860
|
+
declare type Size = 'xxxl' | 'xxl' | 'xl' | 'l' | 'm' | 's' | 'xs' | 'xxs' | 'xxxs';
|
|
861
|
+
declare type Breakpoint = 'XXS' | 'XS' | 'S' | 'M' | 'L' | 'XL';
|
|
862
|
+
declare type CSSUnit = 'px' | 'rem' | 'em' | '%';
|
|
863
|
+
declare type SizeValue = Size | number;
|
|
864
|
+
declare type Sizes = Record<Size, CSSProperties>;
|
|
886
865
|
interface BaseProps {
|
|
887
866
|
/** Appearance preset */
|
|
888
867
|
preset?: 'default' | 'brand';
|
|
@@ -925,6 +904,19 @@ interface InputField extends ColorProperty, ColorProperty<'placeholderColor'>, R
|
|
|
925
904
|
readOnly?: boolean | undefined;
|
|
926
905
|
required?: boolean | undefined;
|
|
927
906
|
}
|
|
907
|
+
declare type ResponsiveSizeProps = {
|
|
908
|
+
sizeUnits?: CSSUnit;
|
|
909
|
+
sizes?: Partial<Sizes>;
|
|
910
|
+
size?: SizeValue | [desktop: SizeValue, tablet: SizeValue, mobile: SizeValue] | [xl: SizeValue, l: SizeValue, m: SizeValue, s: SizeValue, xs: SizeValue, xxs: SizeValue];
|
|
911
|
+
} & {
|
|
912
|
+
[key in `size${Breakpoint}`]?: SizeValue;
|
|
913
|
+
};
|
|
914
|
+
declare type ResponsiveInterpolationProps<T extends ResponsiveSizeProps> = Omit<T, 'sizes' | 'size'> & {
|
|
915
|
+
dynamicSizeDeclaration?: (size: number, cssProperty: keyof CSSProperties, cssUnit: CSSUnit) => CSSProperties;
|
|
916
|
+
sizeProperty?: keyof CSSProperties;
|
|
917
|
+
sizes: Sizes;
|
|
918
|
+
size: SizeValue | [desktop: SizeValue, tablet: SizeValue, mobile: SizeValue] | [xl: SizeValue, l: SizeValue, m: SizeValue, s: SizeValue, xs: SizeValue, xxs: SizeValue];
|
|
919
|
+
};
|
|
928
920
|
|
|
929
921
|
/**
|
|
930
922
|
* Converts HEX color code to RGB(A) string
|
|
@@ -1028,13 +1020,9 @@ declare namespace Anchor {
|
|
|
1028
1020
|
};
|
|
1029
1021
|
}
|
|
1030
1022
|
|
|
1031
|
-
|
|
1032
|
-
declare type ButtonSize = ButtonStaticSize | ResponsiveProperty<`${number}rem` | number>;
|
|
1033
|
-
interface ButtonProps extends BaseProps, DisplayProperty, ColorProperty, ColorProperty<'fontColor'>, ResponsiveNamedProperty<'padding'>, ResponsiveNamedProperty<'paddingTop'>, ResponsiveNamedProperty<'paddingRight'>, ResponsiveNamedProperty<'paddingBottom'>, ResponsiveNamedProperty<'paddingLeft'>, ResponsiveNamedProperty<'margin'>, ResponsiveNamedProperty<'marginTop'>, ResponsiveNamedProperty<'marginRight'>, ResponsiveNamedProperty<'marginBottom'>, ResponsiveNamedProperty<'marginLeft'>, ResponsiveNamedProperty<'fontSize'>, ResponsiveNamedProperty<'fluid', boolean>, ResponsiveNamedProperty<'width', 'auto' | 'l' | 'm' | 's' | 'xs' | number>, ResponsiveNamedProperty<'height', 'l' | 'm' | 's' | 'xs' | number> {
|
|
1023
|
+
interface ButtonProps extends BaseProps, ResponsiveSizeProps, DisplayProperty, ColorProperty, ColorProperty<'fontColor'>, ResponsiveNamedProperty<'padding'>, ResponsiveNamedProperty<'paddingTop'>, ResponsiveNamedProperty<'paddingRight'>, ResponsiveNamedProperty<'paddingBottom'>, ResponsiveNamedProperty<'paddingLeft'>, ResponsiveNamedProperty<'margin'>, ResponsiveNamedProperty<'marginTop'>, ResponsiveNamedProperty<'marginRight'>, ResponsiveNamedProperty<'marginBottom'>, ResponsiveNamedProperty<'marginLeft'>, ResponsiveNamedProperty<'fontSize'>, ResponsiveNamedProperty<'fluid', boolean>, ResponsiveNamedProperty<'width', 'auto' | 'l' | 'm' | 's' | 'xs' | number>, ResponsiveNamedProperty<'height', 'l' | 'm' | 's' | 'xs' | number> {
|
|
1034
1024
|
/** Root node polymorphic type */
|
|
1035
1025
|
as?: 'div' | 'span' | 'a' | 'button' | typeof Link | typeof Anchor;
|
|
1036
|
-
/** Button size */
|
|
1037
|
-
size?: ButtonSize;
|
|
1038
1026
|
/** Button type attribute */
|
|
1039
1027
|
type?: 'button' | 'submit' | 'reset';
|
|
1040
1028
|
/** Button icons */
|
|
@@ -1091,7 +1079,7 @@ interface ButtonProps extends BaseProps, DisplayProperty, ColorProperty, ColorPr
|
|
|
1091
1079
|
/** @deprecated Use children */
|
|
1092
1080
|
content?: React.ReactNode;
|
|
1093
1081
|
/** @deprecated Use ref */
|
|
1094
|
-
innerRef?:
|
|
1082
|
+
innerRef?: any;
|
|
1095
1083
|
/** Component's children */
|
|
1096
1084
|
children?: React.ReactNode | React.ReactNode[];
|
|
1097
1085
|
onClick?: (evt: React.SyntheticEvent<HTMLElement>) => void;
|
|
@@ -1280,7 +1268,7 @@ interface TextProps extends DisplayProperty, ColorProperty, ResponsiveNamedPrope
|
|
|
1280
1268
|
/** Use predefined props with low priority */
|
|
1281
1269
|
appearance?: TextAppearance;
|
|
1282
1270
|
/** Custom sizes set */
|
|
1283
|
-
sizes?: Record<
|
|
1271
|
+
sizes?: Record<Size, number>;
|
|
1284
1272
|
/** Sizing units */
|
|
1285
1273
|
fontUnits?: string;
|
|
1286
1274
|
/** Font family */
|
|
@@ -1314,7 +1302,7 @@ interface TextComponent extends ForwardRefExoticComponent<PropsWithoutRef<TextPr
|
|
|
1314
1302
|
declare const Text: TextComponent;
|
|
1315
1303
|
|
|
1316
1304
|
declare type AlertType = 'warning' | 'error' | 'info' | 'success';
|
|
1317
|
-
declare type AlertSize =
|
|
1305
|
+
declare type AlertSize = 'l' | 's';
|
|
1318
1306
|
interface AlertProps extends BaseProps {
|
|
1319
1307
|
/** Text of the timer cancellation button */
|
|
1320
1308
|
cancelTimerText?: string | React.ReactNode;
|
|
@@ -1594,7 +1582,9 @@ declare const screenMinXl: (params?: MediaQueryParams) => <T extends object>(arg
|
|
|
1594
1582
|
*/
|
|
1595
1583
|
declare const screenRetina: (args_0: TemplateStringsArray | CSSObject, args_1: SimpleInterpolation) => styled_components.FlattenSimpleInterpolation;
|
|
1596
1584
|
|
|
1597
|
-
declare function buildMediaQuery(value: number |
|
|
1585
|
+
declare function buildMediaQuery(value: number | Size | 'auto' | 'initial' | 'inherit' | boolean, property: string | ((_size: number | 'auto' | 'initial' | 'inherit' | boolean, _sizing?: null | string) => FlattenSimpleInterpolation | null), screenQueryFunction: typeof screenXs, sizing: null | string, sizes?: Record<Size, number>): ReturnType<typeof css>;
|
|
1586
|
+
declare const desktopFirst: (a: string, b: string) => number;
|
|
1587
|
+
declare const mobileFirst: (a: string, b: string) => number;
|
|
1598
1588
|
|
|
1599
1589
|
interface ActionBtnProps extends BaseProps, DisplayProperty {
|
|
1600
1590
|
/** Icon name (for inner Icon component) */
|
|
@@ -3197,4 +3187,4 @@ declare namespace Select {
|
|
|
3197
3187
|
var displayName: string;
|
|
3198
3188
|
}
|
|
3199
3189
|
|
|
3200
|
-
export { ActionBtn, Alert, Amount, Anchor, Arrow, Avatar, Badge, BaseProps, Button, COUNTRY_DATA, CURRENCY_MAP, Checkbox, ColorNames, Container, ContextMenu, CurrencyCodes, DEFAULT_MASK, FontWeight, HEX, INITIAL_MASK, Icon, Input, InputField, Modal, Nullable, Paper, Progress, RGB, RGBA, Radio, withThemeScrollable as Scrollable, Section, Select, Separator, Spacer, Spinner, Switcher, Tabs, Tag, Text, Textarea, Theme, ThemeMode, ThemeName, ThemePreset, ThemeProvider, Tooltip, 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 };
|
|
3190
|
+
export { ActionBtn, Alert, Amount, Anchor, Arrow, Avatar, Badge, BaseProps, Breakpoint, Button, COUNTRY_DATA, CSSUnit, CURRENCY_MAP, Checkbox, ColorNames, Container, ContextMenu, CurrencyCodes, DEFAULT_MASK, FontWeight, HEX, INITIAL_MASK, Icon, Input, InputField, Modal, Nullable, Paper, Progress, RGB, RGBA, Radio, ResponsiveInterpolationProps, ResponsiveSizeProps, withThemeScrollable as Scrollable, Section, Select, Separator, Size, SizeValue, Sizes, Spacer, Spinner, Switcher, Tabs, Tag, Text, Textarea, Theme, ThemeMode, ThemeName, ThemePreset, ThemeProvider, Tooltip, 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 };
|