@foxford/ui 2.23.0 → 2.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/Input/Input.js.map +1 -1
- package/components/Skeleton/Skeleton.js +2 -0
- package/components/Skeleton/Skeleton.js.map +1 -0
- package/components/Skeleton/style.js +2 -0
- package/components/Skeleton/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 +186 -134
- package/hooks/useKeyboardListener.js +2 -0
- package/hooks/useKeyboardListener.js.map +1 -0
- package/hooks/usePalette.js +2 -0
- package/hooks/usePalette.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 +1 -1
- package/theme/colors-dark.js +1 -1
- package/theme/colors-dark.js.map +1 -1
- package/theme/colors-light.js +1 -1
- package/theme/colors-light.js.map +1 -1
- package/theme/colors.js +1 -1
- package/theme/colors.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
|
@@ -7,7 +7,7 @@ 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';
|
|
9
9
|
import { ScrollbarsProps } from 'rc-scrollbars';
|
|
10
|
-
import {
|
|
10
|
+
import { Props, PopperInstance, PlacementOptions, SelectorOrElement, Styles } from 'react-floater/lib/types';
|
|
11
11
|
import { InputState, MaskOptions } from 'react-input-mask';
|
|
12
12
|
import { ReactSelectProps } from 'react-select';
|
|
13
13
|
|
|
@@ -275,7 +275,15 @@ declare enum BaseColorNames {
|
|
|
275
275
|
'product-bg-course' = "product-bg-course",
|
|
276
276
|
'product-bg-tutor' = "product-bg-tutor",
|
|
277
277
|
'product-bg-group' = "product-bg-group",
|
|
278
|
-
'product-bg-complect' = "product-bg-complect"
|
|
278
|
+
'product-bg-complect' = "product-bg-complect",
|
|
279
|
+
'skeleton-onmain-primary' = "skeleton-onmain-primary",
|
|
280
|
+
'skeleton-onmain-secondary' = "skeleton-onmain-secondary",
|
|
281
|
+
'skeleton-gradient-from-color-onmain' = "skeleton-gradient-from-color-onmain",
|
|
282
|
+
'skeleton-gradient-to-color-onmain' = "skeleton-gradient-to-color-onmain",
|
|
283
|
+
'skeleton-oncolor-primary' = "skeleton-oncolor-primary",
|
|
284
|
+
'skeleton-oncolor-secondary' = "skeleton-oncolor-secondary",
|
|
285
|
+
'skeleton-gradient-from-color-oncolor' = "skeleton-gradient-from-color-oncolor",
|
|
286
|
+
'skeleton-gradient-to-color-oncolor' = "skeleton-gradient-to-color-oncolor"
|
|
279
287
|
}
|
|
280
288
|
declare enum BrandColorNames {
|
|
281
289
|
'content-brand-primary' = "content-brand-primary",
|
|
@@ -490,6 +498,14 @@ declare const ColorNames: {
|
|
|
490
498
|
'product-bg-tutor': (typeof BaseColorNames)["product-bg-tutor"];
|
|
491
499
|
'product-bg-group': (typeof BaseColorNames)["product-bg-group"];
|
|
492
500
|
'product-bg-complect': (typeof BaseColorNames)["product-bg-complect"];
|
|
501
|
+
'skeleton-onmain-primary': (typeof BaseColorNames)["skeleton-onmain-primary"];
|
|
502
|
+
'skeleton-onmain-secondary': (typeof BaseColorNames)["skeleton-onmain-secondary"];
|
|
503
|
+
'skeleton-gradient-from-color-onmain': (typeof BaseColorNames)["skeleton-gradient-from-color-onmain"];
|
|
504
|
+
'skeleton-gradient-to-color-onmain': (typeof BaseColorNames)["skeleton-gradient-to-color-onmain"];
|
|
505
|
+
'skeleton-oncolor-primary': (typeof BaseColorNames)["skeleton-oncolor-primary"];
|
|
506
|
+
'skeleton-oncolor-secondary': (typeof BaseColorNames)["skeleton-oncolor-secondary"];
|
|
507
|
+
'skeleton-gradient-from-color-oncolor': (typeof BaseColorNames)["skeleton-gradient-from-color-oncolor"];
|
|
508
|
+
'skeleton-gradient-to-color-oncolor': (typeof BaseColorNames)["skeleton-gradient-to-color-oncolor"];
|
|
493
509
|
profession: UnitColorNames.profession;
|
|
494
510
|
professionDark: UnitColorNames.professionDark;
|
|
495
511
|
camps: UnitColorNames.camps;
|
|
@@ -2813,144 +2829,136 @@ declare namespace Tabs {
|
|
|
2813
2829
|
var Tab: react.ForwardRefExoticComponent<TabProps>;
|
|
2814
2830
|
}
|
|
2815
2831
|
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
| string
|
|
2825
|
-
| number
|
|
2826
|
-
| boolean
|
|
2827
|
-
| symbol
|
|
2828
|
-
| bigint;
|
|
2829
|
-
|
|
2830
|
-
declare global {
|
|
2831
|
-
interface SymbolConstructor {
|
|
2832
|
-
readonly observable: symbol;
|
|
2833
|
-
}
|
|
2834
|
-
}
|
|
2835
|
-
|
|
2836
|
-
/**
|
|
2837
|
-
Matches any primitive, `Date`, or `RegExp` value.
|
|
2838
|
-
*/
|
|
2839
|
-
type BuiltIns = Primitive | Date | RegExp;
|
|
2840
|
-
|
|
2841
|
-
/**
|
|
2842
|
-
Create a type from another type with all keys and nested keys set to optional.
|
|
2843
|
-
|
|
2844
|
-
Use-cases:
|
|
2845
|
-
- Merging a default settings/config object with another object, the second object would be a deep partial of the default object.
|
|
2846
|
-
- Mocking and testing complex entities, where populating an entire object with its keys would be redundant in terms of the mock or test.
|
|
2847
|
-
|
|
2848
|
-
@example
|
|
2849
|
-
```
|
|
2850
|
-
import type {PartialDeep} from 'type-fest';
|
|
2851
|
-
|
|
2852
|
-
const settings: Settings = {
|
|
2853
|
-
textEditor: {
|
|
2854
|
-
fontSize: 14;
|
|
2855
|
-
fontColor: '#000000';
|
|
2856
|
-
fontWeight: 400;
|
|
2857
|
-
}
|
|
2858
|
-
autocomplete: false;
|
|
2859
|
-
autosave: true;
|
|
2832
|
+
declare type TooltipComponentPalette = {
|
|
2833
|
+
color: CSSColor;
|
|
2834
|
+
backgroundColor: CSSColor;
|
|
2835
|
+
shadowColor: CSSColor;
|
|
2836
|
+
closeColor: CSSColor;
|
|
2837
|
+
closeColorHover: CSSColor;
|
|
2838
|
+
closeColorActive: CSSColor;
|
|
2839
|
+
closeColorDisabled: CSSColor;
|
|
2860
2840
|
};
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
? T extends Array<infer ItemType> // Test for arrays/tuples, per https://github.com/microsoft/TypeScript/issues/35156
|
|
2888
|
-
? ItemType[] extends T // Test for arrays (non-tuples) specifically
|
|
2889
|
-
? Array<PartialDeep<ItemType | undefined>> // Recreate relevant array type to prevent eager evaluation of circular reference
|
|
2890
|
-
: PartialObjectDeep<T> // Tuples behave properly
|
|
2891
|
-
: PartialObjectDeep<T>
|
|
2892
|
-
: unknown;
|
|
2893
|
-
|
|
2894
|
-
/**
|
|
2895
|
-
Same as `PartialDeep`, but accepts only `Map`s and as inputs. Internal helper for `PartialDeep`.
|
|
2896
|
-
*/
|
|
2897
|
-
interface PartialMapDeep<KeyType, ValueType> extends Map<PartialDeep<KeyType>, PartialDeep<ValueType>> {}
|
|
2898
|
-
|
|
2899
|
-
/**
|
|
2900
|
-
Same as `PartialDeep`, but accepts only `Set`s as inputs. Internal helper for `PartialDeep`.
|
|
2901
|
-
*/
|
|
2902
|
-
interface PartialSetDeep<T> extends Set<PartialDeep<T>> {}
|
|
2903
|
-
|
|
2904
|
-
/**
|
|
2905
|
-
Same as `PartialDeep`, but accepts only `ReadonlyMap`s as inputs. Internal helper for `PartialDeep`.
|
|
2906
|
-
*/
|
|
2907
|
-
interface PartialReadonlyMapDeep<KeyType, ValueType> extends ReadonlyMap<PartialDeep<KeyType>, PartialDeep<ValueType>> {}
|
|
2908
|
-
|
|
2909
|
-
/**
|
|
2910
|
-
Same as `PartialDeep`, but accepts only `ReadonlySet`s as inputs. Internal helper for `PartialDeep`.
|
|
2911
|
-
*/
|
|
2912
|
-
interface PartialReadonlySetDeep<T> extends ReadonlySet<PartialDeep<T>> {}
|
|
2841
|
+
interface TooltipComponentProps extends ResponsiveSizeProps, Omit<React.ComponentPropsWithRef<'div'>, 'children' | 'title'> {
|
|
2842
|
+
/** Custom colors */
|
|
2843
|
+
palette?: Partial<Record<keyof TooltipComponentPalette, Color>>;
|
|
2844
|
+
/** Appearance variant */
|
|
2845
|
+
black?: boolean;
|
|
2846
|
+
/** Appearance variant */
|
|
2847
|
+
contrast?: boolean;
|
|
2848
|
+
/** Title text */
|
|
2849
|
+
title?: React.ReactNode;
|
|
2850
|
+
/** Props for title text component */
|
|
2851
|
+
titleProps?: TextProps;
|
|
2852
|
+
/** Main content text */
|
|
2853
|
+
content?: React.ReactNode;
|
|
2854
|
+
/** Props for content text component */
|
|
2855
|
+
contentProps?: TextProps;
|
|
2856
|
+
/** Footer segment */
|
|
2857
|
+
footer?: React.ReactNode;
|
|
2858
|
+
/** Show close button */
|
|
2859
|
+
showCloseButton?: boolean;
|
|
2860
|
+
/** Props for close button */
|
|
2861
|
+
closeButtonProps?: React.ComponentPropsWithoutRef<'button'>;
|
|
2862
|
+
/** Apply drop shadow filter */
|
|
2863
|
+
elevated?: boolean;
|
|
2864
|
+
/** @ignore */
|
|
2865
|
+
closeFn?: () => void;
|
|
2866
|
+
}
|
|
2913
2867
|
|
|
2914
2868
|
/**
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2869
|
+
*
|
|
2870
|
+
* Component accepts all \<div\> attributes.
|
|
2871
|
+
*
|
|
2872
|
+
* Responsive "size" props are supported.
|
|
2873
|
+
*
|
|
2874
|
+
* Exposed "ref" attached to root node.
|
|
2875
|
+
*
|
|
2876
|
+
* See full [TooltipComponentProps](https://github.com/foxford/ui/blob/master/src/components/TooltipComponent/types.ts)
|
|
2877
|
+
*/
|
|
2878
|
+
declare const TooltipComponent: React.ForwardRefExoticComponent<TooltipComponentProps>;
|
|
2920
2879
|
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2880
|
+
interface TooltipProps extends ResponsiveSizeProps, React.RefAttributes<HTMLDivElement> {
|
|
2881
|
+
/** UI: brand (v3), or default (v2) */
|
|
2882
|
+
preset?: ThemePreset;
|
|
2883
|
+
/** Custom colors */
|
|
2884
|
+
palette?: Partial<Record<keyof TooltipComponentPalette, Color>>;
|
|
2885
|
+
/** Appearance variant */
|
|
2886
|
+
black?: boolean;
|
|
2887
|
+
/** Appearance variant */
|
|
2888
|
+
contrast?: boolean;
|
|
2889
|
+
/** Open automatically */
|
|
2890
|
+
autoOpen?: boolean;
|
|
2891
|
+
/** It will be called on state change */
|
|
2892
|
+
callback?: (action: 'open' | 'close', props: Props) => void;
|
|
2893
|
+
/** Default tooltip target */
|
|
2894
|
+
children?: React.ReactNode;
|
|
2895
|
+
/** Custom UI for tooltip */
|
|
2896
|
+
component?: React.ReactElement | ((props: Pick<TooltipProps, 'size' | 'sizeXXS' | 'sizeXS' | 'sizeS' | 'sizeM' | 'sizeL' | 'sizeXL' | 'black' | 'contrast' | 'showCloseButton' | 'closeButtonProps'> & {
|
|
2897
|
+
id?: string;
|
|
2898
|
+
role?: string;
|
|
2899
|
+
closeFn?: () => void;
|
|
2900
|
+
}) => React.ReactElement);
|
|
2901
|
+
/** Tooltip content */
|
|
2902
|
+
content?: React.ReactNode;
|
|
2903
|
+
/** Props for content text component */
|
|
2904
|
+
contentProps?: TextProps;
|
|
2905
|
+
/** Debugging logs in console */
|
|
2906
|
+
debug?: boolean;
|
|
2907
|
+
/** Don't adjust tooltip on scroll / resize */
|
|
2908
|
+
disableFlip?: boolean;
|
|
2909
|
+
/** Don't convert 'hover' to 'click' event on mobile */
|
|
2910
|
+
disableHoverToClick?: boolean;
|
|
2911
|
+
/** Trigger event for tooltip */
|
|
2912
|
+
event?: 'click' | 'hover';
|
|
2913
|
+
/** Pause in 'seconds' to wait before close tooltip (valid for 'hover' event) */
|
|
2914
|
+
eventDelay?: number;
|
|
2915
|
+
/** Tooltip footer */
|
|
2916
|
+
footer?: React.ReactNode;
|
|
2917
|
+
/** Callback to get popper.js instance */
|
|
2918
|
+
getPopper?: (popper: PopperInstance, origin: 'floater' | 'wrapper') => void;
|
|
2919
|
+
/** Don't show tooltip arrow */
|
|
2920
|
+
hideArrow?: boolean;
|
|
2921
|
+
/** Distance in 'px' between tooltip and its target */
|
|
2922
|
+
offset?: number;
|
|
2923
|
+
/** Switch between normal and controlled modes. It will disable built in tooltip behavior */
|
|
2924
|
+
open?: boolean;
|
|
2925
|
+
/** Tooltip position relative to its target */
|
|
2926
|
+
placement?: PlacementOptions;
|
|
2927
|
+
/** CSS selector or element to render tooltips */
|
|
2928
|
+
portalElement?: SelectorOrElement;
|
|
2929
|
+
/** Custom styles */
|
|
2930
|
+
styles?: Partial<Styles>;
|
|
2931
|
+
/** Show button to close tooltip */
|
|
2932
|
+
showCloseButton?: boolean;
|
|
2933
|
+
/** Props for button to close tooltip */
|
|
2934
|
+
closeButtonProps?: React.ComponentPropsWithoutRef<'button'>;
|
|
2935
|
+
/** Tooltip target. If it's not set, 'children' will be used */
|
|
2936
|
+
target?: SelectorOrElement;
|
|
2937
|
+
/** Tooltip title */
|
|
2938
|
+
title?: React.ReactNode;
|
|
2939
|
+
/** Props for title text component */
|
|
2940
|
+
titleProps?: TextProps;
|
|
2941
|
+
/** Position of tooltip wrapper relative to target */
|
|
2942
|
+
wrapperOptions?: {
|
|
2943
|
+
offset?: number;
|
|
2944
|
+
placement?: Omit<PlacementOptions, 'center'>;
|
|
2945
|
+
position?: boolean;
|
|
2935
2946
|
};
|
|
2936
|
-
|
|
2937
|
-
};
|
|
2938
|
-
declare type TooltipDefaultStyles = {
|
|
2939
|
-
tooltipStyles: PartialDeep<Styles> | undefined;
|
|
2940
|
-
tooltipDisplayBlockStyles: PartialDeep<Styles> | undefined;
|
|
2941
|
-
tooltipStylesRounend: PartialDeep<Styles> | undefined;
|
|
2942
|
-
};
|
|
2947
|
+
}
|
|
2943
2948
|
|
|
2944
|
-
declare type TooltipProps = Props;
|
|
2945
2949
|
/**
|
|
2946
|
-
*
|
|
2950
|
+
*
|
|
2951
|
+
* Component accepts ["react-floater"](https://www.npmjs.com/package/react-floater/v/0.8.2) v0.8.2 props.
|
|
2952
|
+
*
|
|
2953
|
+
* Responsive "size" props are supported.
|
|
2954
|
+
*
|
|
2955
|
+
* Exposed "ref" attached to tooltip component root.
|
|
2956
|
+
*
|
|
2957
|
+
* See full [TooltipProps](https://github.com/foxford/ui/blob/master/src/components/Tooltip/types.ts)
|
|
2947
2958
|
*/
|
|
2948
|
-
declare
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
var themes: TooltipDefaultStyles;
|
|
2952
|
-
var displayName: string;
|
|
2953
|
-
}
|
|
2959
|
+
declare const Tooltip: React.ForwardRefExoticComponent<TooltipProps> & {
|
|
2960
|
+
Component: typeof TooltipComponent;
|
|
2961
|
+
};
|
|
2954
2962
|
|
|
2955
2963
|
interface TagProps extends BaseProps, DisplayProperty, ColorProperty, ResponsiveNamedProperty<'height'>, ResponsiveNamedProperty<'width'> {
|
|
2956
2964
|
as?: 'button' | 'div' | 'input' | 'label';
|
|
@@ -3377,7 +3385,7 @@ declare type StyledBaseInputProps = React.ComponentPropsWithoutRef<'input'> & Pi
|
|
|
3377
3385
|
|
|
3378
3386
|
/**
|
|
3379
3387
|
*
|
|
3380
|
-
* Component accepts all \<input\> attributes and "react-input-mask" props.
|
|
3388
|
+
* Component accepts all \<input\> attributes and "react-input-mask" v2.0.4 props.
|
|
3381
3389
|
*
|
|
3382
3390
|
* Responsive "size", "margin" props are supported.
|
|
3383
3391
|
*
|
|
@@ -3593,4 +3601,48 @@ interface FormLabelProps extends ResponsiveSizeProps, ResponsiveMarginProps, Rea
|
|
|
3593
3601
|
*/
|
|
3594
3602
|
declare const FormLabel: React.ForwardRefExoticComponent<FormLabelProps>;
|
|
3595
3603
|
|
|
3596
|
-
|
|
3604
|
+
declare type SkeletonPalette = {
|
|
3605
|
+
color: CSSColor;
|
|
3606
|
+
gradientColor: CSSColor;
|
|
3607
|
+
gradientHighlightColor: CSSColor;
|
|
3608
|
+
};
|
|
3609
|
+
interface SkeletonProps extends ResponsiveMarginProps, React.ComponentPropsWithRef<'div'> {
|
|
3610
|
+
/** Element to infer sizing */
|
|
3611
|
+
children?: React.ReactNode;
|
|
3612
|
+
/** Custom colors */
|
|
3613
|
+
palette?: Partial<Record<keyof SkeletonPalette, Color>>;
|
|
3614
|
+
/** Display 'inline-block' */
|
|
3615
|
+
inline?: boolean;
|
|
3616
|
+
/** Root border-radius: 50% */
|
|
3617
|
+
round?: boolean;
|
|
3618
|
+
/** Root border-radius */
|
|
3619
|
+
borderRadius?: string | number;
|
|
3620
|
+
/** Root width */
|
|
3621
|
+
width?: string | number;
|
|
3622
|
+
/** Root height */
|
|
3623
|
+
height?: string | number;
|
|
3624
|
+
/** Value (ms) to control animation speed */
|
|
3625
|
+
animationDuration?: number;
|
|
3626
|
+
/** Delay to animation start (ms) to avoid flicker at fast connection */
|
|
3627
|
+
animationDelay?: number;
|
|
3628
|
+
/** Appearance variant */
|
|
3629
|
+
primary?: boolean;
|
|
3630
|
+
/** Appearance variant */
|
|
3631
|
+
secondary?: boolean;
|
|
3632
|
+
/** Appearance variant */
|
|
3633
|
+
onColored?: boolean;
|
|
3634
|
+
}
|
|
3635
|
+
|
|
3636
|
+
/**
|
|
3637
|
+
*
|
|
3638
|
+
* Component accepts all \<div\> attributes.
|
|
3639
|
+
*
|
|
3640
|
+
* Responsive "margin" props are supported.
|
|
3641
|
+
*
|
|
3642
|
+
* Exposed "ref" attached to root node.
|
|
3643
|
+
*
|
|
3644
|
+
* See full [SkeletonProps](https://github.com/foxford/ui/blob/master/src/components/Skeleton/types.ts)
|
|
3645
|
+
*/
|
|
3646
|
+
declare const Skeleton: React.ForwardRefExoticComponent<SkeletonProps>;
|
|
3647
|
+
|
|
3648
|
+
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 };
|
|
@@ -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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePalette.js","sources":["../../../src/hooks/usePalette.ts"],"sourcesContent":["import { useTheme } from 'styled-components'\nimport type { ColorPaletteKey, Color, CSSColor } from 'shared/types'\n\ntype PropsWithPalette = {\n palette?: Partial<Record<ColorPaletteKey, Color>>\n}\n\nexport const usePalette = ({ palette }: PropsWithPalette): Record<ColorPaletteKey, CSSColor> => {\n const theme = useTheme()\n\n return palette\n ? Object.keys(palette).reduce((injected, key) => {\n injected[key] = theme.colors[palette[key]] ?? palette[key]\n return injected\n }, {} as Record<ColorPaletteKey, CSSColor>)\n : {}\n}\n"],"names":["usePalette","_ref","palette","theme","useTheme","Object","keys","reduce","injected","key","_theme$colors$palette","colors"],"mappings":"6CAOO,IAAMA,EAAaC,IAAsE,IAArEC,QAAEA,GAAmED,EAC9F,IAAME,EAAQC,IAEd,OAAOF,EACHG,OAAOC,KAAKJ,GAASK,SAAQC,EAAUC,KAAQ,IAAAC,EAE7C,OADAF,EAASC,WAAON,EAAAA,EAAMQ,OAAOT,EAAQO,WAAAA,QAASP,EAAQO,GAC/CD,IACN,IACH"}
|