@foxford/ui 2.24.0 → 2.26.0-beta-47ce7b9-20240425
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/Input/Input.js.map +1 -1
- package/components/Popover/Popover.js +2 -0
- package/components/Popover/Popover.js.map +1 -0
- package/components/PopoverComponent/PopoverComponent.js +2 -0
- package/components/PopoverComponent/PopoverComponent.js.map +1 -0
- package/components/PopoverComponent/constants.js +2 -0
- package/components/PopoverComponent/constants.js.map +1 -0
- package/components/PopoverComponent/images/close.module.svg.js +2 -0
- package/components/PopoverComponent/images/close.module.svg.js.map +1 -0
- package/components/PopoverComponent/style.js +2 -0
- package/components/PopoverComponent/style.js.map +1 -0
- package/components/Tooltip/Tooltip.js +1 -1
- package/components/Tooltip/Tooltip.js.map +1 -1
- package/components/Tooltip/TooltipWrapper.js +2 -0
- package/components/Tooltip/TooltipWrapper.js.map +1 -0
- package/components/Tooltip/default-constants.js +2 -0
- package/components/Tooltip/default-constants.js.map +1 -0
- package/components/TooltipComponent/TooltipComponent.js +2 -0
- package/components/TooltipComponent/TooltipComponent.js.map +1 -0
- package/components/TooltipComponent/constants.js +2 -0
- package/components/TooltipComponent/constants.js.map +1 -0
- package/components/TooltipComponent/images/close.module.svg.js +2 -0
- package/components/TooltipComponent/images/close.module.svg.js.map +1 -0
- package/components/TooltipComponent/style.js +2 -0
- package/components/TooltipComponent/style.js.map +1 -0
- package/dts/index.d.ts +378 -186
- package/hooks/useKeyboardListener.js +2 -0
- package/hooks/useKeyboardListener.js.map +1 -0
- package/index.cjs.js +1 -1
- package/index.cjs.js.map +1 -1
- package/index.js +1 -1
- package/package.json +2 -1
- package/theme/themes.js +1 -1
- package/theme/themes.js.map +1 -1
- package/components/Tooltip/tooltip-styles.js +0 -2
- package/components/Tooltip/tooltip-styles.js.map +0 -1
package/dts/index.d.ts
CHANGED
|
@@ -3,11 +3,11 @@ import * as react from 'react';
|
|
|
3
3
|
import { CSSProperties, Component, ForwardRefExoticComponent, PropsWithoutRef, RefAttributes, PureComponent } from 'react';
|
|
4
4
|
import * as styled_components from 'styled-components';
|
|
5
5
|
import { DefaultTheme, FlattenSimpleInterpolation, CSSObject, Interpolation, ThemeProps, SimpleInterpolation, css, StyledProps } from 'styled-components';
|
|
6
|
+
import { Props, PopperInstance, PlacementOptions, SelectorOrElement, Styles } from 'react-floater/lib/types';
|
|
6
7
|
import { Classes } from 'react-modal';
|
|
7
8
|
import * as rc_scrollbars_lib_Scrollbars_types from 'rc-scrollbars/lib/Scrollbars/types';
|
|
8
9
|
import * as rc_scrollbars from 'rc-scrollbars';
|
|
9
10
|
import { ScrollbarsProps } from 'rc-scrollbars';
|
|
10
|
-
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
|
|
|
@@ -1814,6 +1814,376 @@ DisplayProperty, Omit<React.ComponentPropsWithRef<'div'>, 'color' | 'children'>
|
|
|
1814
1814
|
*/
|
|
1815
1815
|
declare const Badge: React.ForwardRefExoticComponent<BadgeProps>;
|
|
1816
1816
|
|
|
1817
|
+
declare type SkeletonPalette = {
|
|
1818
|
+
color: CSSColor;
|
|
1819
|
+
gradientColor: CSSColor;
|
|
1820
|
+
gradientHighlightColor: CSSColor;
|
|
1821
|
+
};
|
|
1822
|
+
interface SkeletonProps extends ResponsiveMarginProps, React.ComponentPropsWithRef<'div'> {
|
|
1823
|
+
/** Element to infer sizing */
|
|
1824
|
+
children?: React.ReactNode;
|
|
1825
|
+
/** Custom colors */
|
|
1826
|
+
palette?: Partial<Record<keyof SkeletonPalette, Color>>;
|
|
1827
|
+
/** Display 'inline-block' */
|
|
1828
|
+
inline?: boolean;
|
|
1829
|
+
/** Root border-radius: 50% */
|
|
1830
|
+
round?: boolean;
|
|
1831
|
+
/** Root border-radius */
|
|
1832
|
+
borderRadius?: string | number;
|
|
1833
|
+
/** Root width */
|
|
1834
|
+
width?: string | number;
|
|
1835
|
+
/** Root height */
|
|
1836
|
+
height?: string | number;
|
|
1837
|
+
/** Value (ms) to control animation speed */
|
|
1838
|
+
animationDuration?: number;
|
|
1839
|
+
/** Delay to animation start (ms) to avoid flicker at fast connection */
|
|
1840
|
+
animationDelay?: number;
|
|
1841
|
+
/** Appearance variant */
|
|
1842
|
+
primary?: boolean;
|
|
1843
|
+
/** Appearance variant */
|
|
1844
|
+
secondary?: boolean;
|
|
1845
|
+
/** Appearance variant */
|
|
1846
|
+
onColored?: boolean;
|
|
1847
|
+
}
|
|
1848
|
+
|
|
1849
|
+
/**
|
|
1850
|
+
*
|
|
1851
|
+
* Component accepts all \<div\> attributes.
|
|
1852
|
+
*
|
|
1853
|
+
* Responsive "margin" props are supported.
|
|
1854
|
+
*
|
|
1855
|
+
* Exposed "ref" attached to root node.
|
|
1856
|
+
*
|
|
1857
|
+
* See full [SkeletonProps](https://github.com/foxford/ui/blob/master/src/components/Skeleton/types.ts)
|
|
1858
|
+
*/
|
|
1859
|
+
declare const Skeleton: React.ForwardRefExoticComponent<SkeletonProps>;
|
|
1860
|
+
|
|
1861
|
+
declare type TooltipComponentPalette = {
|
|
1862
|
+
color: CSSColor;
|
|
1863
|
+
backgroundColor: CSSColor;
|
|
1864
|
+
shadowColor: CSSColor;
|
|
1865
|
+
closeColor: CSSColor;
|
|
1866
|
+
closeColorHover: CSSColor;
|
|
1867
|
+
closeColorActive: CSSColor;
|
|
1868
|
+
closeColorDisabled: CSSColor;
|
|
1869
|
+
};
|
|
1870
|
+
interface TooltipComponentProps extends ResponsiveSizeProps, Omit<React.ComponentPropsWithRef<'div'>, 'children' | 'title'> {
|
|
1871
|
+
/** Custom colors */
|
|
1872
|
+
palette?: Partial<Record<keyof TooltipComponentPalette, Color>>;
|
|
1873
|
+
/** Appearance variant */
|
|
1874
|
+
black?: boolean;
|
|
1875
|
+
/** Appearance variant */
|
|
1876
|
+
contrast?: boolean;
|
|
1877
|
+
/** Title text */
|
|
1878
|
+
title?: React.ReactNode;
|
|
1879
|
+
/** Props for title text component */
|
|
1880
|
+
titleProps?: TextProps;
|
|
1881
|
+
/** Main content text */
|
|
1882
|
+
content?: React.ReactNode;
|
|
1883
|
+
/** Props for content text component */
|
|
1884
|
+
contentProps?: TextProps;
|
|
1885
|
+
/** Footer segment */
|
|
1886
|
+
footer?: React.ReactNode;
|
|
1887
|
+
/** Show close button */
|
|
1888
|
+
showCloseButton?: boolean;
|
|
1889
|
+
/** Props for close button */
|
|
1890
|
+
closeButtonProps?: React.ComponentPropsWithoutRef<'button'>;
|
|
1891
|
+
/** Apply drop shadow filter */
|
|
1892
|
+
elevated?: boolean;
|
|
1893
|
+
/** @ignore */
|
|
1894
|
+
closeFn?: () => void;
|
|
1895
|
+
}
|
|
1896
|
+
|
|
1897
|
+
/**
|
|
1898
|
+
*
|
|
1899
|
+
* Component accepts all \<div\> attributes.
|
|
1900
|
+
*
|
|
1901
|
+
* Responsive "size" props are supported.
|
|
1902
|
+
*
|
|
1903
|
+
* Exposed "ref" attached to root node.
|
|
1904
|
+
*
|
|
1905
|
+
* See full [TooltipComponentProps](https://github.com/foxford/ui/blob/master/src/components/TooltipComponent/types.ts)
|
|
1906
|
+
*/
|
|
1907
|
+
declare const TooltipComponent: React.ForwardRefExoticComponent<TooltipComponentProps>;
|
|
1908
|
+
|
|
1909
|
+
interface TooltipProps extends ResponsiveSizeProps, React.RefAttributes<HTMLDivElement> {
|
|
1910
|
+
/** UI: brand (v3), or default (v2) */
|
|
1911
|
+
preset?: ThemePreset;
|
|
1912
|
+
/** Custom colors */
|
|
1913
|
+
palette?: Partial<Record<keyof TooltipComponentPalette, Color>>;
|
|
1914
|
+
/** Appearance variant */
|
|
1915
|
+
black?: boolean;
|
|
1916
|
+
/** Appearance variant */
|
|
1917
|
+
contrast?: boolean;
|
|
1918
|
+
/** Open automatically */
|
|
1919
|
+
autoOpen?: boolean;
|
|
1920
|
+
/** It will be called on state change */
|
|
1921
|
+
callback?: (action: 'open' | 'close', props: Props) => void;
|
|
1922
|
+
/** Default tooltip target */
|
|
1923
|
+
children?: React.ReactNode;
|
|
1924
|
+
/** Custom UI for tooltip */
|
|
1925
|
+
component?: React.ReactElement | ((props: Pick<TooltipProps, 'size' | 'sizeXXS' | 'sizeXS' | 'sizeS' | 'sizeM' | 'sizeL' | 'sizeXL' | 'black' | 'contrast' | 'showCloseButton' | 'closeButtonProps'> & {
|
|
1926
|
+
id?: string;
|
|
1927
|
+
role?: string;
|
|
1928
|
+
closeFn?: () => void;
|
|
1929
|
+
}) => React.ReactElement);
|
|
1930
|
+
/** Tooltip content */
|
|
1931
|
+
content?: React.ReactNode;
|
|
1932
|
+
/** Props for content text component */
|
|
1933
|
+
contentProps?: TextProps;
|
|
1934
|
+
/** Debugging logs in console */
|
|
1935
|
+
debug?: boolean;
|
|
1936
|
+
/** Don't adjust tooltip on scroll / resize */
|
|
1937
|
+
disableFlip?: boolean;
|
|
1938
|
+
/** Don't convert 'hover' to 'click' event on mobile */
|
|
1939
|
+
disableHoverToClick?: boolean;
|
|
1940
|
+
/** Trigger event for tooltip */
|
|
1941
|
+
event?: 'click' | 'hover';
|
|
1942
|
+
/** Pause in 'seconds' to wait before close tooltip (valid for 'hover' event) */
|
|
1943
|
+
eventDelay?: number;
|
|
1944
|
+
/** Tooltip footer */
|
|
1945
|
+
footer?: React.ReactNode;
|
|
1946
|
+
/** Callback to get popper.js instance */
|
|
1947
|
+
getPopper?: (popper: PopperInstance, origin: 'floater' | 'wrapper') => void;
|
|
1948
|
+
/** Don't show tooltip arrow */
|
|
1949
|
+
hideArrow?: boolean;
|
|
1950
|
+
/** Distance in 'px' between tooltip and its target */
|
|
1951
|
+
offset?: number;
|
|
1952
|
+
/** Switch between normal and controlled modes. It will disable built in tooltip behavior */
|
|
1953
|
+
open?: boolean;
|
|
1954
|
+
/** Tooltip position relative to its target */
|
|
1955
|
+
placement?: PlacementOptions;
|
|
1956
|
+
/** CSS selector or element to render tooltips */
|
|
1957
|
+
portalElement?: SelectorOrElement;
|
|
1958
|
+
/** Custom styles */
|
|
1959
|
+
styles?: Partial<Styles>;
|
|
1960
|
+
/** Show button to close tooltip */
|
|
1961
|
+
showCloseButton?: boolean;
|
|
1962
|
+
/** Props for button to close tooltip */
|
|
1963
|
+
closeButtonProps?: React.ComponentPropsWithoutRef<'button'>;
|
|
1964
|
+
/** Tooltip target. If it's not set, 'children' will be used */
|
|
1965
|
+
target?: SelectorOrElement;
|
|
1966
|
+
/** Tooltip title */
|
|
1967
|
+
title?: React.ReactNode;
|
|
1968
|
+
/** Props for title text component */
|
|
1969
|
+
titleProps?: TextProps;
|
|
1970
|
+
/** Position of tooltip wrapper relative to target */
|
|
1971
|
+
wrapperOptions?: {
|
|
1972
|
+
offset?: number;
|
|
1973
|
+
placement?: Omit<PlacementOptions, 'center'>;
|
|
1974
|
+
position?: boolean;
|
|
1975
|
+
};
|
|
1976
|
+
}
|
|
1977
|
+
|
|
1978
|
+
/**
|
|
1979
|
+
*
|
|
1980
|
+
* Component accepts ["react-floater"](https://www.npmjs.com/package/react-floater/v/0.8.2) v0.8.2 props.
|
|
1981
|
+
*
|
|
1982
|
+
* Responsive "size" props are supported.
|
|
1983
|
+
*
|
|
1984
|
+
* Exposed "ref" attached to tooltip component root.
|
|
1985
|
+
*
|
|
1986
|
+
* See full [TooltipProps](https://github.com/foxford/ui/blob/master/src/components/Tooltip/types.ts)
|
|
1987
|
+
*/
|
|
1988
|
+
declare const Tooltip: React.ForwardRefExoticComponent<TooltipProps> & {
|
|
1989
|
+
Component: typeof TooltipComponent;
|
|
1990
|
+
};
|
|
1991
|
+
|
|
1992
|
+
declare type PopoverComponentPalette = {
|
|
1993
|
+
color: CSSColor;
|
|
1994
|
+
backgroundColor: CSSColor;
|
|
1995
|
+
mediaPlaceholderColor: CSSColor;
|
|
1996
|
+
shadowColor: CSSColor;
|
|
1997
|
+
closeColor: CSSColor;
|
|
1998
|
+
closeBackgroundColor: CSSColor;
|
|
1999
|
+
closeColorHover: CSSColor;
|
|
2000
|
+
closeBackgroundColorHover: CSSColor;
|
|
2001
|
+
closeColorActive: CSSColor;
|
|
2002
|
+
closeBackgroundColorActive: CSSColor;
|
|
2003
|
+
closeColorDisabled: CSSColor;
|
|
2004
|
+
closeBackgroundColorDisabled: CSSColor;
|
|
2005
|
+
};
|
|
2006
|
+
interface PopoverComponentProps extends ResponsiveSizeProps, Omit<React.ComponentPropsWithRef<'div'>, 'children' | 'title'> {
|
|
2007
|
+
/** Custom colors */
|
|
2008
|
+
palette?: Partial<Record<keyof PopoverComponentPalette, Color>>;
|
|
2009
|
+
/** Relationship of width to height */
|
|
2010
|
+
orientation?: 'portrait' | 'landscape';
|
|
2011
|
+
/** Loading appearance */
|
|
2012
|
+
loading?: boolean;
|
|
2013
|
+
/** Badge in header */
|
|
2014
|
+
badge?: {
|
|
2015
|
+
text?: React.ReactNode;
|
|
2016
|
+
badgeProps?: BadgeProps;
|
|
2017
|
+
};
|
|
2018
|
+
/** Short text in header */
|
|
2019
|
+
caption?: React.ReactNode;
|
|
2020
|
+
/** Props for text component in header */
|
|
2021
|
+
captionProps?: TextProps;
|
|
2022
|
+
/** Title text */
|
|
2023
|
+
title?: React.ReactNode;
|
|
2024
|
+
/** Props for title text component */
|
|
2025
|
+
titleProps?: TextProps;
|
|
2026
|
+
/** Main text content */
|
|
2027
|
+
content?: React.ReactNode;
|
|
2028
|
+
/** Props for main text component */
|
|
2029
|
+
contentProps?: TextProps;
|
|
2030
|
+
/** Show close button */
|
|
2031
|
+
showCloseButton?: boolean;
|
|
2032
|
+
/** Props for close button */
|
|
2033
|
+
closeButtonProps?: React.ComponentPropsWithoutRef<'button'>;
|
|
2034
|
+
/** Flex-direction for footer with buttons */
|
|
2035
|
+
controlsDirection?: 'row' | 'column';
|
|
2036
|
+
/** Media to display: \<img\> or \<video\> */
|
|
2037
|
+
media?: {
|
|
2038
|
+
imgProps?: React.ComponentPropsWithoutRef<'img'>;
|
|
2039
|
+
videoProps?: React.ComponentPropsWithoutRef<'video'>;
|
|
2040
|
+
};
|
|
2041
|
+
/** Buttons in footer */
|
|
2042
|
+
controls?: {
|
|
2043
|
+
secondary?: {
|
|
2044
|
+
text?: React.ReactNode;
|
|
2045
|
+
buttonProps?: ButtonProps;
|
|
2046
|
+
};
|
|
2047
|
+
primary?: {
|
|
2048
|
+
text?: React.ReactNode;
|
|
2049
|
+
buttonProps?: ButtonProps;
|
|
2050
|
+
};
|
|
2051
|
+
};
|
|
2052
|
+
/** Apply drop shadow filter */
|
|
2053
|
+
elevated?: boolean;
|
|
2054
|
+
/** @ignore */
|
|
2055
|
+
black?: boolean;
|
|
2056
|
+
/** @ignore */
|
|
2057
|
+
contrast?: boolean;
|
|
2058
|
+
/** @ignore */
|
|
2059
|
+
closeFn?: () => void;
|
|
2060
|
+
}
|
|
2061
|
+
|
|
2062
|
+
/**
|
|
2063
|
+
*
|
|
2064
|
+
* Component accepts all \<div\> attributes.
|
|
2065
|
+
*
|
|
2066
|
+
* Responsive "size" props are supported.
|
|
2067
|
+
*
|
|
2068
|
+
* Exposed "ref" attached to root node.
|
|
2069
|
+
*
|
|
2070
|
+
* See full [PopoverComponentProps](https://github.com/foxford/ui/blob/master/src/components/PopoverComponent/types.ts)
|
|
2071
|
+
*
|
|
2072
|
+
*/
|
|
2073
|
+
declare const PopoverComponent: React.ForwardRefExoticComponent<PopoverComponentProps>;
|
|
2074
|
+
|
|
2075
|
+
interface PopoverProps extends ResponsiveSizeProps, React.RefAttributes<HTMLDivElement> {
|
|
2076
|
+
/** Custom colors */
|
|
2077
|
+
palette?: Partial<Record<keyof PopoverComponentPalette, Color>>;
|
|
2078
|
+
/** Open automatically */
|
|
2079
|
+
autoOpen?: boolean;
|
|
2080
|
+
/** It will be called on state change */
|
|
2081
|
+
callback?: (action: 'open' | 'close', props: Props) => void;
|
|
2082
|
+
/** Default tooltip target */
|
|
2083
|
+
children?: React.ReactNode;
|
|
2084
|
+
/** Debugging logs in console */
|
|
2085
|
+
debug?: boolean;
|
|
2086
|
+
/** Don't adjust tooltip on scroll / resize */
|
|
2087
|
+
disableFlip?: boolean;
|
|
2088
|
+
/** Don't convert 'hover' to 'click' event on mobile */
|
|
2089
|
+
disableHoverToClick?: boolean;
|
|
2090
|
+
/** Trigger event for tooltip */
|
|
2091
|
+
event?: 'click' | 'hover';
|
|
2092
|
+
/** Pause in 'seconds' to wait before close tooltip (valid for 'hover' event) */
|
|
2093
|
+
eventDelay?: number;
|
|
2094
|
+
/** Callback to get popper.js instance */
|
|
2095
|
+
getPopper?: (popper: PopperInstance, origin: 'floater' | 'wrapper') => void;
|
|
2096
|
+
/** Don't show tooltip arrow */
|
|
2097
|
+
hideArrow?: boolean;
|
|
2098
|
+
/** Distance in 'px' between tooltip and its target */
|
|
2099
|
+
offset?: number;
|
|
2100
|
+
/** Switch between normal and controlled modes. It will disable built in tooltip behavior */
|
|
2101
|
+
open?: boolean;
|
|
2102
|
+
/** Tooltip position relative to its target */
|
|
2103
|
+
placement?: PlacementOptions;
|
|
2104
|
+
/** CSS selector or element to render tooltips */
|
|
2105
|
+
portalElement?: SelectorOrElement;
|
|
2106
|
+
/** Custom styles */
|
|
2107
|
+
styles?: Partial<Styles>;
|
|
2108
|
+
/** Show button to close tooltip */
|
|
2109
|
+
showCloseButton?: boolean;
|
|
2110
|
+
/** Props for close button */
|
|
2111
|
+
closeButtonProps?: React.ComponentPropsWithoutRef<'button'>;
|
|
2112
|
+
/** Tooltip target. If it's not set, 'children' will be used */
|
|
2113
|
+
target?: SelectorOrElement;
|
|
2114
|
+
/** Position of tooltip wrapper relative to target */
|
|
2115
|
+
wrapperOptions?: {
|
|
2116
|
+
offset?: number;
|
|
2117
|
+
placement?: Omit<PlacementOptions, 'center'>;
|
|
2118
|
+
position?: boolean;
|
|
2119
|
+
};
|
|
2120
|
+
/** Relationship of width to height */
|
|
2121
|
+
orientation?: 'portrait' | 'landscape';
|
|
2122
|
+
/** Loading appearance */
|
|
2123
|
+
loading?: boolean;
|
|
2124
|
+
/** Badge in header */
|
|
2125
|
+
badge?: {
|
|
2126
|
+
text?: React.ReactNode;
|
|
2127
|
+
badgeProps?: BadgeProps;
|
|
2128
|
+
};
|
|
2129
|
+
/** Short text in header */
|
|
2130
|
+
caption?: React.ReactNode;
|
|
2131
|
+
/** Props for text component in header */
|
|
2132
|
+
captionProps?: TextProps;
|
|
2133
|
+
/** Title text */
|
|
2134
|
+
title?: React.ReactNode;
|
|
2135
|
+
/** Props for title text component */
|
|
2136
|
+
titleProps?: TextProps;
|
|
2137
|
+
/** Main text content */
|
|
2138
|
+
content?: React.ReactNode;
|
|
2139
|
+
/** Props for main text component */
|
|
2140
|
+
contentProps?: TextProps;
|
|
2141
|
+
/** Flex-direction in footer */
|
|
2142
|
+
controlsDirection?: 'row' | 'column';
|
|
2143
|
+
/** Media to display: \<img\> or \<video\> */
|
|
2144
|
+
media?: {
|
|
2145
|
+
imgProps?: React.ComponentPropsWithoutRef<'img'>;
|
|
2146
|
+
videoProps?: React.ComponentPropsWithoutRef<'video'>;
|
|
2147
|
+
};
|
|
2148
|
+
/** Buttons in footer */
|
|
2149
|
+
controls?: {
|
|
2150
|
+
secondary?: {
|
|
2151
|
+
text?: React.ReactNode;
|
|
2152
|
+
buttonProps?: ButtonProps;
|
|
2153
|
+
};
|
|
2154
|
+
primary?: {
|
|
2155
|
+
text?: React.ReactNode;
|
|
2156
|
+
buttonProps?: ButtonProps;
|
|
2157
|
+
};
|
|
2158
|
+
};
|
|
2159
|
+
/** @ignore */
|
|
2160
|
+
footer?: React.ReactNode;
|
|
2161
|
+
/** @ignore */
|
|
2162
|
+
black?: boolean;
|
|
2163
|
+
/** @ignore */
|
|
2164
|
+
contrast?: boolean;
|
|
2165
|
+
/** @ignore */
|
|
2166
|
+
component?: React.ReactElement | ((props: Pick<PopoverProps, 'size' | 'sizeXXS' | 'sizeXS' | 'sizeS' | 'sizeM' | 'sizeL' | 'sizeXL' | 'black' | 'contrast' | 'showCloseButton' | 'closeButtonProps'> & {
|
|
2167
|
+
id?: string;
|
|
2168
|
+
role?: string;
|
|
2169
|
+
closeFn?: () => void;
|
|
2170
|
+
}) => React.ReactElement);
|
|
2171
|
+
}
|
|
2172
|
+
|
|
2173
|
+
/**
|
|
2174
|
+
*
|
|
2175
|
+
* Component accepts ["react-floater"](https://www.npmjs.com/package/react-floater/v/0.8.2) v0.8.2 props.
|
|
2176
|
+
*
|
|
2177
|
+
* Responsive "size" props are supported.
|
|
2178
|
+
*
|
|
2179
|
+
* Exposed "ref" attached to popover component root.
|
|
2180
|
+
*
|
|
2181
|
+
* See full [PopoverProps](https://github.com/foxford/ui/blob/master/src/components/Popover/types.ts)
|
|
2182
|
+
*/
|
|
2183
|
+
declare const Popover: React.ForwardRefExoticComponent<PopoverProps> & {
|
|
2184
|
+
Component: typeof PopoverComponent;
|
|
2185
|
+
};
|
|
2186
|
+
|
|
1817
2187
|
interface Theme {
|
|
1818
2188
|
breakpoints: Readonly<Record<Lowercase<Breakpoint>, number>>;
|
|
1819
2189
|
colors: Record<keyof typeof ColorNames, CSSColor>;
|
|
@@ -1847,6 +2217,11 @@ interface Theme {
|
|
|
1847
2217
|
Tab?: TabProps;
|
|
1848
2218
|
Badge?: BadgeProps;
|
|
1849
2219
|
Anchor?: AnchorProps;
|
|
2220
|
+
Skeleton?: SkeletonProps;
|
|
2221
|
+
Tooltip?: TooltipProps;
|
|
2222
|
+
TooltipComponent?: TooltipComponentProps;
|
|
2223
|
+
Popover?: PopoverProps;
|
|
2224
|
+
PopoverComponent?: PopoverComponentProps;
|
|
1850
2225
|
};
|
|
1851
2226
|
}
|
|
1852
2227
|
|
|
@@ -2829,145 +3204,6 @@ declare namespace Tabs {
|
|
|
2829
3204
|
var Tab: react.ForwardRefExoticComponent<TabProps>;
|
|
2830
3205
|
}
|
|
2831
3206
|
|
|
2832
|
-
/**
|
|
2833
|
-
Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
|
|
2834
|
-
|
|
2835
|
-
@category Type
|
|
2836
|
-
*/
|
|
2837
|
-
type Primitive =
|
|
2838
|
-
| null
|
|
2839
|
-
| undefined
|
|
2840
|
-
| string
|
|
2841
|
-
| number
|
|
2842
|
-
| boolean
|
|
2843
|
-
| symbol
|
|
2844
|
-
| bigint;
|
|
2845
|
-
|
|
2846
|
-
declare global {
|
|
2847
|
-
interface SymbolConstructor {
|
|
2848
|
-
readonly observable: symbol;
|
|
2849
|
-
}
|
|
2850
|
-
}
|
|
2851
|
-
|
|
2852
|
-
/**
|
|
2853
|
-
Matches any primitive, `Date`, or `RegExp` value.
|
|
2854
|
-
*/
|
|
2855
|
-
type BuiltIns = Primitive | Date | RegExp;
|
|
2856
|
-
|
|
2857
|
-
/**
|
|
2858
|
-
Create a type from another type with all keys and nested keys set to optional.
|
|
2859
|
-
|
|
2860
|
-
Use-cases:
|
|
2861
|
-
- Merging a default settings/config object with another object, the second object would be a deep partial of the default object.
|
|
2862
|
-
- Mocking and testing complex entities, where populating an entire object with its keys would be redundant in terms of the mock or test.
|
|
2863
|
-
|
|
2864
|
-
@example
|
|
2865
|
-
```
|
|
2866
|
-
import type {PartialDeep} from 'type-fest';
|
|
2867
|
-
|
|
2868
|
-
const settings: Settings = {
|
|
2869
|
-
textEditor: {
|
|
2870
|
-
fontSize: 14;
|
|
2871
|
-
fontColor: '#000000';
|
|
2872
|
-
fontWeight: 400;
|
|
2873
|
-
}
|
|
2874
|
-
autocomplete: false;
|
|
2875
|
-
autosave: true;
|
|
2876
|
-
};
|
|
2877
|
-
|
|
2878
|
-
const applySavedSettings = (savedSettings: PartialDeep<Settings>) => {
|
|
2879
|
-
return {...settings, ...savedSettings};
|
|
2880
|
-
}
|
|
2881
|
-
|
|
2882
|
-
settings = applySavedSettings({textEditor: {fontWeight: 500}});
|
|
2883
|
-
```
|
|
2884
|
-
|
|
2885
|
-
@category Object
|
|
2886
|
-
@category Array
|
|
2887
|
-
@category Set
|
|
2888
|
-
@category Map
|
|
2889
|
-
*/
|
|
2890
|
-
type PartialDeep<T> = T extends BuiltIns
|
|
2891
|
-
? T
|
|
2892
|
-
: T extends Map<infer KeyType, infer ValueType>
|
|
2893
|
-
? PartialMapDeep<KeyType, ValueType>
|
|
2894
|
-
: T extends Set<infer ItemType>
|
|
2895
|
-
? PartialSetDeep<ItemType>
|
|
2896
|
-
: T extends ReadonlyMap<infer KeyType, infer ValueType>
|
|
2897
|
-
? PartialReadonlyMapDeep<KeyType, ValueType>
|
|
2898
|
-
: T extends ReadonlySet<infer ItemType>
|
|
2899
|
-
? PartialReadonlySetDeep<ItemType>
|
|
2900
|
-
: T extends ((...arguments: any[]) => unknown)
|
|
2901
|
-
? T | undefined
|
|
2902
|
-
: T extends object
|
|
2903
|
-
? T extends Array<infer ItemType> // Test for arrays/tuples, per https://github.com/microsoft/TypeScript/issues/35156
|
|
2904
|
-
? ItemType[] extends T // Test for arrays (non-tuples) specifically
|
|
2905
|
-
? Array<PartialDeep<ItemType | undefined>> // Recreate relevant array type to prevent eager evaluation of circular reference
|
|
2906
|
-
: PartialObjectDeep<T> // Tuples behave properly
|
|
2907
|
-
: PartialObjectDeep<T>
|
|
2908
|
-
: unknown;
|
|
2909
|
-
|
|
2910
|
-
/**
|
|
2911
|
-
Same as `PartialDeep`, but accepts only `Map`s and as inputs. Internal helper for `PartialDeep`.
|
|
2912
|
-
*/
|
|
2913
|
-
interface PartialMapDeep<KeyType, ValueType> extends Map<PartialDeep<KeyType>, PartialDeep<ValueType>> {}
|
|
2914
|
-
|
|
2915
|
-
/**
|
|
2916
|
-
Same as `PartialDeep`, but accepts only `Set`s as inputs. Internal helper for `PartialDeep`.
|
|
2917
|
-
*/
|
|
2918
|
-
interface PartialSetDeep<T> extends Set<PartialDeep<T>> {}
|
|
2919
|
-
|
|
2920
|
-
/**
|
|
2921
|
-
Same as `PartialDeep`, but accepts only `ReadonlyMap`s as inputs. Internal helper for `PartialDeep`.
|
|
2922
|
-
*/
|
|
2923
|
-
interface PartialReadonlyMapDeep<KeyType, ValueType> extends ReadonlyMap<PartialDeep<KeyType>, PartialDeep<ValueType>> {}
|
|
2924
|
-
|
|
2925
|
-
/**
|
|
2926
|
-
Same as `PartialDeep`, but accepts only `ReadonlySet`s as inputs. Internal helper for `PartialDeep`.
|
|
2927
|
-
*/
|
|
2928
|
-
interface PartialReadonlySetDeep<T> extends ReadonlySet<PartialDeep<T>> {}
|
|
2929
|
-
|
|
2930
|
-
/**
|
|
2931
|
-
Same as `PartialDeep`, but accepts only `object`s as inputs. Internal helper for `PartialDeep`.
|
|
2932
|
-
*/
|
|
2933
|
-
type PartialObjectDeep<ObjectType extends object> = {
|
|
2934
|
-
[KeyType in keyof ObjectType]?: PartialDeep<ObjectType[KeyType]>
|
|
2935
|
-
};
|
|
2936
|
-
|
|
2937
|
-
declare type TooltipDefaultProps = {
|
|
2938
|
-
autoOpen: boolean;
|
|
2939
|
-
disableAnimation: boolean;
|
|
2940
|
-
disableFlip: boolean;
|
|
2941
|
-
disableHoverToClick: boolean;
|
|
2942
|
-
event: string;
|
|
2943
|
-
eventDelay: number;
|
|
2944
|
-
offset: number;
|
|
2945
|
-
placement: string;
|
|
2946
|
-
showCloseButton: boolean;
|
|
2947
|
-
styles: PartialDeep<Styles> | undefined;
|
|
2948
|
-
target: null;
|
|
2949
|
-
wrapperOptions: {
|
|
2950
|
-
position: boolean;
|
|
2951
|
-
};
|
|
2952
|
-
component: null;
|
|
2953
|
-
};
|
|
2954
|
-
declare type TooltipDefaultStyles = {
|
|
2955
|
-
tooltipStyles: PartialDeep<Styles> | undefined;
|
|
2956
|
-
tooltipDisplayBlockStyles: PartialDeep<Styles> | undefined;
|
|
2957
|
-
tooltipStylesRounend: PartialDeep<Styles> | undefined;
|
|
2958
|
-
};
|
|
2959
|
-
|
|
2960
|
-
declare type TooltipProps = Props;
|
|
2961
|
-
/**
|
|
2962
|
-
* Основан на [react-floater](https://github.com/gilbarbara/react-floater).
|
|
2963
|
-
*/
|
|
2964
|
-
declare function Tooltip({ children, styles, ...props }: TooltipProps): JSX.Element;
|
|
2965
|
-
declare namespace Tooltip {
|
|
2966
|
-
var defaultProps: TooltipDefaultProps;
|
|
2967
|
-
var themes: TooltipDefaultStyles;
|
|
2968
|
-
var displayName: string;
|
|
2969
|
-
}
|
|
2970
|
-
|
|
2971
3207
|
interface TagProps extends BaseProps, DisplayProperty, ColorProperty, ResponsiveNamedProperty<'height'>, ResponsiveNamedProperty<'width'> {
|
|
2972
3208
|
as?: 'button' | 'div' | 'input' | 'label';
|
|
2973
3209
|
/**
|
|
@@ -3393,7 +3629,7 @@ declare type StyledBaseInputProps = React.ComponentPropsWithoutRef<'input'> & Pi
|
|
|
3393
3629
|
|
|
3394
3630
|
/**
|
|
3395
3631
|
*
|
|
3396
|
-
* Component accepts all \<input\> attributes and "react-input-mask" props.
|
|
3632
|
+
* Component accepts all \<input\> attributes and "react-input-mask" v2.0.4 props.
|
|
3397
3633
|
*
|
|
3398
3634
|
* Responsive "size", "margin" props are supported.
|
|
3399
3635
|
*
|
|
@@ -3609,48 +3845,4 @@ interface FormLabelProps extends ResponsiveSizeProps, ResponsiveMarginProps, Rea
|
|
|
3609
3845
|
*/
|
|
3610
3846
|
declare const FormLabel: React.ForwardRefExoticComponent<FormLabelProps>;
|
|
3611
3847
|
|
|
3612
|
-
|
|
3613
|
-
color: CSSColor;
|
|
3614
|
-
gradientColor: CSSColor;
|
|
3615
|
-
gradientHighlightColor: CSSColor;
|
|
3616
|
-
};
|
|
3617
|
-
interface SkeletonProps extends ResponsiveMarginProps, React.ComponentPropsWithRef<'div'> {
|
|
3618
|
-
/** Element to infer sizing */
|
|
3619
|
-
children?: React.ReactNode;
|
|
3620
|
-
/** Custom colors */
|
|
3621
|
-
palette?: Partial<Record<keyof SkeletonPalette, Color>>;
|
|
3622
|
-
/** Display 'inline-block' */
|
|
3623
|
-
inline?: boolean;
|
|
3624
|
-
/** Root border-radius: 50% */
|
|
3625
|
-
round?: boolean;
|
|
3626
|
-
/** Root border-radius */
|
|
3627
|
-
borderRadius?: string | number;
|
|
3628
|
-
/** Root width */
|
|
3629
|
-
width?: string | number;
|
|
3630
|
-
/** Root height */
|
|
3631
|
-
height?: string | number;
|
|
3632
|
-
/** Value (ms) to control animation speed */
|
|
3633
|
-
animationDuration?: number;
|
|
3634
|
-
/** Delay to animation start (ms) to avoid flicker at fast connection */
|
|
3635
|
-
animationDelay?: number;
|
|
3636
|
-
/** Appearance variant */
|
|
3637
|
-
primary?: boolean;
|
|
3638
|
-
/** Appearance variant */
|
|
3639
|
-
secondary?: boolean;
|
|
3640
|
-
/** Appearance variant */
|
|
3641
|
-
onColored?: boolean;
|
|
3642
|
-
}
|
|
3643
|
-
|
|
3644
|
-
/**
|
|
3645
|
-
*
|
|
3646
|
-
* Component accepts all \<div\> attributes.
|
|
3647
|
-
*
|
|
3648
|
-
* Responsive "margin" props are supported.
|
|
3649
|
-
*
|
|
3650
|
-
* Exposed "ref" attached to root node.
|
|
3651
|
-
*
|
|
3652
|
-
* See full [SkeletonProps](https://github.com/foxford/ui/blob/master/src/components/Skeleton/types.ts)
|
|
3653
|
-
*/
|
|
3654
|
-
declare const Skeleton: React.ForwardRefExoticComponent<SkeletonProps>;
|
|
3655
|
-
|
|
3656
|
-
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, ColorPaletteKey, Container, ContextMenu, CurrencyCodes, DEFAULT_MASK, FormLabel, HEX, INITIAL_MASK, Icon, Input, Modal, Nullable, Paper, Progress, RGB, RGBA, Radio, withThemeScrollable as Scrollable, Section, Select, Separator, Size, Sizes, Skeleton, Spacer, Spinner, Switcher, Tab, 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 };
|
|
3848
|
+
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, ColorPaletteKey, Container, ContextMenu, CurrencyCodes, DEFAULT_MASK, FormLabel, HEX, INITIAL_MASK, Icon, Input, Modal, Nullable, Paper, Popover, Progress, RGB, RGBA, Radio, withThemeScrollable as Scrollable, Section, Select, Separator, Size, Sizes, Skeleton, Spacer, Spinner, Switcher, Tab, 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 };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useKeyboardListener.js","sources":["../../../src/hooks/useKeyboardListener.ts"],"sourcesContent":["import { useEffect } from 'react'\n\nexport const useKeyboardListener = (\n keyboardEvtType: 'keydown' | 'keyup',\n keyboardKeys: string[],\n keyboardEvtHandler: (evt: KeyboardEvent) => void\n) => {\n useEffect(() => {\n const handleKeyboardEvt = (evt: KeyboardEvent) => {\n if (keyboardKeys.includes(evt.key)) keyboardEvtHandler(evt)\n }\n\n document.addEventListener(keyboardEvtType, handleKeyboardEvt)\n\n return () => {\n document.removeEventListener(keyboardEvtType, handleKeyboardEvt)\n }\n }, [keyboardEvtType, keyboardEvtHandler, keyboardKeys])\n}\n"],"names":["useKeyboardListener","keyboardEvtType","keyboardKeys","keyboardEvtHandler","useEffect","handleKeyboardEvt","evt","includes","key","document","addEventListener","removeEventListener"],"mappings":"kCAEO,IAAMA,EAAsB,CACjCC,EACAC,EACAC,KAEAC,GAAAA,KACE,IAAMC,EAAqBC,IACrBJ,EAAaK,SAASD,EAAIE,MAAML,EAAmBG,IAKzD,OAFAG,SAASC,iBAAiBT,EAAiBI,GAEpC,KACLI,SAASE,oBAAoBV,EAAiBI,MAE/C,CAACJ,EAAiBE,EAAoBD"}
|