@peculiar/react-components 1.1.1-alpha.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Autocomplete/autocomplete.js +10 -19
- package/dist/cjs/Autocomplete/autocomplete.js.map +1 -1
- package/dist/cjs/NativeSelect/native_select.js +3 -14
- package/dist/cjs/NativeSelect/native_select.js.map +1 -1
- package/dist/cjs/Select/select.js +3 -14
- package/dist/cjs/Select/select.js.map +1 -1
- package/dist/cjs/TextField/text_field.js +3 -14
- package/dist/cjs/TextField/text_field.js.map +1 -1
- package/dist/cjs/TextareaField/textarea_field.js +3 -14
- package/dist/cjs/TextareaField/textarea_field.js.map +1 -1
- package/dist/cjs/hooks/use_clipboard.js +1 -1
- package/dist/esm/Autocomplete/autocomplete.js +10 -19
- package/dist/esm/Autocomplete/autocomplete.js.map +1 -1
- package/dist/esm/NativeSelect/native_select.js +3 -14
- package/dist/esm/NativeSelect/native_select.js.map +1 -1
- package/dist/esm/Select/select.js +3 -14
- package/dist/esm/Select/select.js.map +1 -1
- package/dist/esm/TextField/text_field.js +3 -14
- package/dist/esm/TextField/text_field.js.map +1 -1
- package/dist/esm/TextareaField/textarea_field.js +3 -14
- package/dist/esm/TextareaField/textarea_field.js.map +1 -1
- package/dist/esm/hooks/use_clipboard.js +1 -1
- package/dist/esnext/Autocomplete/autocomplete.js +10 -19
- package/dist/esnext/Autocomplete/autocomplete.js.map +1 -1
- package/dist/esnext/NativeSelect/native_select.js +3 -14
- package/dist/esnext/NativeSelect/native_select.js.map +1 -1
- package/dist/esnext/Select/select.js +3 -14
- package/dist/esnext/Select/select.js.map +1 -1
- package/dist/esnext/TextField/text_field.js +3 -14
- package/dist/esnext/TextField/text_field.js.map +1 -1
- package/dist/esnext/TextareaField/textarea_field.js +3 -14
- package/dist/esnext/TextareaField/textarea_field.js.map +1 -1
- package/dist/types/Alert/alert.d.ts +2 -2
- package/dist/types/Autocomplete/autocomplete.d.ts +3 -8
- package/dist/types/Avatar/avatar.d.ts +2 -2
- package/dist/types/Backdrop/backdrop.d.ts +2 -2
- package/dist/types/Box/box.d.ts +1 -1
- package/dist/types/Button/button.d.ts +1 -1
- package/dist/types/ButtonBase/button_base.d.ts +1 -1
- package/dist/types/Checkbox/checkbox.d.ts +2 -2
- package/dist/types/Chip/chip.d.ts +1 -1
- package/dist/types/CircularProgress/circular_progress.d.ts +2 -2
- package/dist/types/Collapse/collapse.d.ts +3 -3
- package/dist/types/Dialog/dialog.d.ts +1 -1
- package/dist/types/Dialog/dialog_actions.d.ts +1 -1
- package/dist/types/Dialog/dialog_content.d.ts +1 -1
- package/dist/types/Dialog/dialog_title.d.ts +1 -1
- package/dist/types/Drawer/drawer.d.ts +1 -1
- package/dist/types/Fab/fab.d.ts +1 -1
- package/dist/types/Fade/fade.d.ts +2 -2
- package/dist/types/Flex/flex.d.ts +1 -1
- package/dist/types/Flex/flex_container.d.ts +1 -1
- package/dist/types/FocusTrap/focus_trap.d.ts +1 -1
- package/dist/types/IconButton/icon_button.d.ts +1 -1
- package/dist/types/Image/image.d.ts +1 -1
- package/dist/types/LinearProgress/linear_progress.d.ts +1 -1
- package/dist/types/Menu/menu.d.ts +5 -5
- package/dist/types/MenuList/menu_item.d.ts +2 -2
- package/dist/types/MenuList/menu_list.d.ts +2 -2
- package/dist/types/Modal/modal.d.ts +2 -2
- package/dist/types/NativeSelect/native_select.d.ts +1 -1
- package/dist/types/OverridableComponent.d.ts +4 -4
- package/dist/types/Popover/popover.d.ts +2 -2
- package/dist/types/Popper/popper.d.ts +2 -2
- package/dist/types/Portal/portal.d.ts +1 -1
- package/dist/types/Radio/radio.d.ts +2 -2
- package/dist/types/Select/select.d.ts +2 -2
- package/dist/types/Skeleton/skeleton.d.ts +1 -1
- package/dist/types/Slide/slide.d.ts +2 -2
- package/dist/types/Slider/slider.d.ts +2 -2
- package/dist/types/Switch/switch.d.ts +2 -2
- package/dist/types/Tabs/tab.d.ts +1 -1
- package/dist/types/Tabs/tabs.d.ts +1 -1
- package/dist/types/TextField/text_field.d.ts +1 -1
- package/dist/types/TextareaField/textarea_field.d.ts +1 -1
- package/dist/types/Toast/toast.d.ts +1 -1
- package/dist/types/Toast/toast_container.d.ts +2 -2
- package/dist/types/Toast/toast_context.d.ts +3 -3
- package/dist/types/Toast/toast_provider.d.ts +1 -1
- package/dist/types/Tooltip/tooltip.d.ts +2 -2
- package/dist/types/Typography/typography.d.ts +1 -1
- package/dist/types/hooks/use_autocomplete.d.ts +9 -9
- package/dist/types/hooks/use_controllable.d.ts +1 -1
- package/dist/types/hooks/use_image.d.ts +3 -3
- package/dist/types/hooks/use_intersection_observer.d.ts +3 -3
- package/dist/types/icons/arrow_drop_down_icon.d.ts +1 -1
- package/dist/types/icons/arrow_rigth.d.ts +1 -1
- package/dist/types/icons/check_circle_icon.d.ts +1 -1
- package/dist/types/icons/check_icon.d.ts +1 -1
- package/dist/types/icons/close_circle_icon.d.ts +1 -1
- package/dist/types/icons/close_icon.d.ts +1 -1
- package/dist/types/icons/close_small_icon.d.ts +1 -1
- package/dist/types/icons/dot_icon.d.ts +1 -1
- package/dist/types/icons/minus_icon.d.ts +1 -1
- package/dist/types/icons/plus_icon.d.ts +1 -1
- package/dist/types/icons/warning_icon.d.ts +1 -1
- package/dist/types/styles/foundations/colors.d.ts +2 -2
- package/dist/types/styles/styled_engine_provider.d.ts +1 -1
- package/dist/types/styles/theme_provider.d.ts +1 -1
- package/dist/types/styles/types.d.ts +7 -7
- package/dist/types/utils/copy_to_clipboard.d.ts +1 -1
- package/package.json +10 -9
|
@@ -3,7 +3,7 @@ import { BackdropProps } from '../Backdrop';
|
|
|
3
3
|
/**
|
|
4
4
|
* Types.
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
type ModalOwnProps = {
|
|
7
7
|
/**
|
|
8
8
|
* A single child content element.
|
|
9
9
|
*/
|
|
@@ -51,7 +51,7 @@ declare type ModalOwnProps = {
|
|
|
51
51
|
*/
|
|
52
52
|
disableAutoFocus?: boolean;
|
|
53
53
|
};
|
|
54
|
-
export
|
|
54
|
+
export type ModalProps = ModalOwnProps & React.HTMLAttributes<HTMLDivElement>;
|
|
55
55
|
/**
|
|
56
56
|
*
|
|
57
57
|
*/
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
* Remove properties `K` from `T`.
|
|
4
4
|
* Distributive for union types.
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export type DistributiveOmit<T, K extends keyof any> = T extends any ? Omit<T, K> : never;
|
|
7
7
|
/**
|
|
8
8
|
* A component whose root component can be controlled via a `component` prop.
|
|
9
9
|
*
|
|
@@ -25,15 +25,15 @@ export interface OverridableComponent<M extends OverridableTypeMap> {
|
|
|
25
25
|
/**
|
|
26
26
|
* Props of the component if `component={Component}` is used.
|
|
27
27
|
*/
|
|
28
|
-
export
|
|
28
|
+
export type OverrideProps<M extends OverridableTypeMap, C extends React.ElementType> = (BaseProps<M> & DistributiveOmit<React.ComponentPropsWithRef<C>, keyof BaseProps<M>>);
|
|
29
29
|
/**
|
|
30
30
|
* Props if `component={Component}` is NOT used.
|
|
31
31
|
*/
|
|
32
|
-
export
|
|
32
|
+
export type DefaultComponentProps<M extends OverridableTypeMap> = BaseProps<M> & DistributiveOmit<React.ComponentPropsWithRef<M['defaultComponent']>, keyof BaseProps<M>>;
|
|
33
33
|
/**
|
|
34
34
|
* Props defined on the component.
|
|
35
35
|
*/
|
|
36
|
-
export
|
|
36
|
+
export type BaseProps<M extends OverridableTypeMap> = M['props'] & CommonProps;
|
|
37
37
|
/**
|
|
38
38
|
* Props that are valid for components.
|
|
39
39
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PopperProps } from 'react-popper';
|
|
3
3
|
import { ModalProps } from '../Modal';
|
|
4
|
-
|
|
4
|
+
type BaseProps = {
|
|
5
5
|
/**
|
|
6
6
|
* If `true`, the popover is visible.
|
|
7
7
|
*/
|
|
@@ -31,7 +31,7 @@ declare type BaseProps = {
|
|
|
31
31
|
*/
|
|
32
32
|
allowUseSameWidth?: boolean;
|
|
33
33
|
};
|
|
34
|
-
export
|
|
34
|
+
export type PopoverProps = BaseProps & Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>;
|
|
35
35
|
/**
|
|
36
36
|
*
|
|
37
37
|
*/
|
|
@@ -3,7 +3,7 @@ import { PopperProps as PopperReactProps, Modifier } from 'react-popper';
|
|
|
3
3
|
/**
|
|
4
4
|
* Types.
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
type BaseProps = {
|
|
7
7
|
/**
|
|
8
8
|
* If `true`, the popper is visible.
|
|
9
9
|
*/
|
|
@@ -34,7 +34,7 @@ declare type BaseProps = {
|
|
|
34
34
|
*/
|
|
35
35
|
modifiers?: Modifier<any>[];
|
|
36
36
|
};
|
|
37
|
-
|
|
37
|
+
type PopperProps = BaseProps & Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>;
|
|
38
38
|
/**
|
|
39
39
|
*
|
|
40
40
|
*/
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
/**
|
|
3
3
|
* Types.
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
type RadioOwnProps = {
|
|
6
6
|
/**
|
|
7
7
|
* If `true`, the component is checked.
|
|
8
8
|
*/
|
|
@@ -48,7 +48,7 @@ declare type RadioOwnProps = {
|
|
|
48
48
|
*/
|
|
49
49
|
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
50
50
|
};
|
|
51
|
-
export
|
|
51
|
+
export type RadioProps = RadioOwnProps & Omit<React.LabelHTMLAttributes<HTMLLabelElement>, 'children' | 'htmlFor' | 'onChange'>;
|
|
52
52
|
/**
|
|
53
53
|
*
|
|
54
54
|
*/
|
|
@@ -3,12 +3,12 @@ import { UseAutocompleteProps, UseAutocompleteReturnType, AutocompleteValue } fr
|
|
|
3
3
|
/**
|
|
4
4
|
* Types.
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export type SelectRenderGroupParams = {
|
|
7
7
|
key: string | number;
|
|
8
8
|
group: string;
|
|
9
9
|
children?: React.ReactNode;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type SelectOwnProps<T, Multiple extends boolean | undefined = undefined> = UseAutocompleteProps<T, Multiple> & {
|
|
12
12
|
/**
|
|
13
13
|
* The className of the component.
|
|
14
14
|
*/
|
|
@@ -27,7 +27,7 @@ export interface SkeletonTypeMap<P = {}, D extends React.ElementType = 'span'> {
|
|
|
27
27
|
props: P & SkeletonOwnProps;
|
|
28
28
|
defaultComponent: D;
|
|
29
29
|
}
|
|
30
|
-
export
|
|
30
|
+
export type SkeletonProps<D extends React.ElementType = SkeletonTypeMap['defaultComponent']> = OverrideProps<SkeletonTypeMap<{}, D>, D> & {
|
|
31
31
|
component?: D;
|
|
32
32
|
};
|
|
33
33
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { TransitionProps } from 'react-transition-group/Transition';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
type BaseTransitionProps = Pick<TransitionProps<HTMLElement>, ('onEnter' | 'onEntered' | 'onEntering' | 'onExit' | 'onExited' | 'onExiting')>;
|
|
4
|
+
type BaseProps = {
|
|
5
5
|
/**
|
|
6
6
|
* If `true`, the component will transition in.
|
|
7
7
|
*/
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
/**
|
|
3
3
|
* Types.
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
type SliderOwnProps = {
|
|
6
6
|
className?: string;
|
|
7
7
|
/**
|
|
8
8
|
* The default element value. Use when the component is not controlled.
|
|
@@ -37,7 +37,7 @@ declare type SliderOwnProps = {
|
|
|
37
37
|
*/
|
|
38
38
|
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
39
39
|
};
|
|
40
|
-
export
|
|
40
|
+
export type SliderProps = SliderOwnProps & Omit<React.HTMLAttributes<HTMLDivElement>, 'children' | 'defaultValue'>;
|
|
41
41
|
/**
|
|
42
42
|
*
|
|
43
43
|
*/
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
/**
|
|
3
3
|
* Types.
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
type SwitchOwnProps = {
|
|
6
6
|
/**
|
|
7
7
|
* If `true`, the component is checked.
|
|
8
8
|
*/
|
|
@@ -44,7 +44,7 @@ declare type SwitchOwnProps = {
|
|
|
44
44
|
*/
|
|
45
45
|
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
46
46
|
};
|
|
47
|
-
export
|
|
47
|
+
export type SwitchProps = SwitchOwnProps & Omit<React.LabelHTMLAttributes<HTMLLabelElement>, 'children' | 'htmlFor' | 'onChange'>;
|
|
48
48
|
/**
|
|
49
49
|
*
|
|
50
50
|
*/
|
package/dist/types/Tabs/tab.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export interface TabTypeMap<P = {}, D extends React.ElementType = 'button'> {
|
|
|
30
30
|
props: P & TabOwnProps;
|
|
31
31
|
defaultComponent: D;
|
|
32
32
|
}
|
|
33
|
-
export
|
|
33
|
+
export type TabProps<D extends React.ElementType = TabTypeMap['defaultComponent']> = OverrideProps<TabTypeMap<{}, D>, D> & {
|
|
34
34
|
component?: D;
|
|
35
35
|
};
|
|
36
36
|
/**
|
|
@@ -2,13 +2,13 @@ import * as React from 'react';
|
|
|
2
2
|
/**
|
|
3
3
|
* Types.
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
type ToastContainerOwnProps = {
|
|
6
6
|
/**
|
|
7
7
|
* The content of the component.
|
|
8
8
|
*/
|
|
9
9
|
children: React.ReactNode;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type ToastContainerProps = ToastContainerOwnProps & Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>;
|
|
12
12
|
/**
|
|
13
13
|
*
|
|
14
14
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { AlertProps } from '../Alert';
|
|
3
|
-
export
|
|
3
|
+
export type BaseToastType = {
|
|
4
4
|
/**
|
|
5
5
|
* The message of the toast.
|
|
6
6
|
*/
|
|
@@ -28,10 +28,10 @@ export declare type BaseToastType = {
|
|
|
28
28
|
*/
|
|
29
29
|
id?: string;
|
|
30
30
|
};
|
|
31
|
-
export
|
|
31
|
+
export type ToastType = BaseToastType & {
|
|
32
32
|
createdAt: number;
|
|
33
33
|
};
|
|
34
|
-
export
|
|
34
|
+
export type ToastContextType = {
|
|
35
35
|
addToast: (options: BaseToastType) => void;
|
|
36
36
|
removeToast: (id: string) => void;
|
|
37
37
|
removeAllToasts: () => void;
|
|
@@ -3,7 +3,7 @@ import { Placement } from '@popperjs/core';
|
|
|
3
3
|
/**
|
|
4
4
|
* Types.
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export type TooltipOwnProps = {
|
|
7
7
|
/**
|
|
8
8
|
* If `true`, the component is shown.
|
|
9
9
|
*/
|
|
@@ -70,7 +70,7 @@ export declare type TooltipOwnProps = {
|
|
|
70
70
|
*/
|
|
71
71
|
offset?: number;
|
|
72
72
|
};
|
|
73
|
-
export
|
|
73
|
+
export type TooltipProps = TooltipOwnProps & Omit<React.HTMLAttributes<HTMLDivElement>, 'title' | 'children'>;
|
|
74
74
|
/**
|
|
75
75
|
*
|
|
76
76
|
*/
|
|
@@ -28,7 +28,7 @@ export interface TypographyTypeMap<P = {}, D extends React.ElementType = 'p'> {
|
|
|
28
28
|
props: P & TypographyOwnProps;
|
|
29
29
|
defaultComponent: D;
|
|
30
30
|
}
|
|
31
|
-
export
|
|
31
|
+
export type TypographyProps<D extends React.ElementType = TypographyTypeMap['defaultComponent']> = OverrideProps<TypographyTypeMap<{}, D>, D> & {
|
|
32
32
|
component?: D;
|
|
33
33
|
};
|
|
34
34
|
export declare const Typography: OverridableComponent<TypographyTypeMap<{}, "p">>;
|
|
@@ -3,23 +3,23 @@ import type { PopoverProps } from '../Popover';
|
|
|
3
3
|
/**
|
|
4
4
|
* Types.
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
6
|
+
export type AutocompleteHighlightChangeReason = ('auto' | 'mouse' | 'keyboard');
|
|
7
|
+
export type AutocompleteHighlightChangeDirectionType = ('next' | 'previous');
|
|
8
|
+
export type AutocompleteHighlightChangeDiffType = (number | 'reset' | 'start' | 'end');
|
|
9
|
+
export type AutocompleteChangeReason = ('selectOption' | 'removeOption');
|
|
10
10
|
export interface AutocompleteChangeDetails<T = string> {
|
|
11
11
|
option: T;
|
|
12
12
|
index: number;
|
|
13
13
|
}
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
14
|
+
export type AutocompleteValue<T, Multiple> = Multiple extends undefined | false ? T | null : T[];
|
|
15
|
+
export type AutocompleteFilterOptionsType<T, Multiple> = (options: ReadonlyArray<T>, searchValue: string, value: AutocompleteValue<T, Multiple>, getOptionLabel: (option: T) => string) => ReadonlyArray<T>;
|
|
16
|
+
export type AutocompleteGroupedOption<T> = {
|
|
17
17
|
key: number;
|
|
18
18
|
index: number;
|
|
19
19
|
group: string;
|
|
20
20
|
options: T[];
|
|
21
21
|
};
|
|
22
|
-
export
|
|
22
|
+
export type UseAutocompleteProps<T, Multiple extends boolean | undefined = undefined> = {
|
|
23
23
|
/**
|
|
24
24
|
* This prop is used to help implement the accessibility logic.
|
|
25
25
|
* If you don't provide an id it will fall back to a randomly generated one.
|
|
@@ -87,7 +87,7 @@ export declare type UseAutocompleteProps<T, Multiple extends boolean | undefined
|
|
|
87
87
|
*/
|
|
88
88
|
onInputChange?: (event: React.SyntheticEvent, value: string) => void;
|
|
89
89
|
};
|
|
90
|
-
export
|
|
90
|
+
export type UseAutocompleteReturnType<T, Multiple extends boolean | undefined = undefined> = {
|
|
91
91
|
groupedOptions: ReadonlyArray<T> | ReadonlyArray<AutocompleteGroupedOption<T>>;
|
|
92
92
|
value: AutocompleteValue<T, Multiple>;
|
|
93
93
|
searchValue: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export
|
|
2
|
+
export type UseImageOptionsType = {
|
|
3
3
|
/**
|
|
4
4
|
* A callback for when the image `src` has been loaded.
|
|
5
5
|
*/
|
|
@@ -9,7 +9,7 @@ export declare type UseImageOptionsType = {
|
|
|
9
9
|
*/
|
|
10
10
|
onError?: (error: string | React.SyntheticEvent<HTMLImageElement, Event>) => void;
|
|
11
11
|
};
|
|
12
|
-
|
|
12
|
+
type Status = ('loading' | 'failed' | 'pending' | 'loaded');
|
|
13
13
|
/**
|
|
14
14
|
* React hook that loads an image in the browser,
|
|
15
15
|
* and let's us know the `status` so we can show image
|
|
@@ -26,7 +26,7 @@ declare type Status = ('loading' | 'failed' | 'pending' | 'loaded');
|
|
|
26
26
|
* }
|
|
27
27
|
* ```
|
|
28
28
|
*/
|
|
29
|
-
|
|
29
|
+
type UseImageReturnType = {
|
|
30
30
|
status: Status;
|
|
31
31
|
image?: HTMLImageElement;
|
|
32
32
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export type IntersectionObserverHookRefCallbackNode = HTMLElement | null;
|
|
2
|
+
export type IntersectionObserverHookRefCallback = (node: IntersectionObserverHookRefCallbackNode) => void;
|
|
3
|
+
export type IntersectionObserverHookResult = [
|
|
4
4
|
IntersectionObserverHookRefCallback,
|
|
5
5
|
{
|
|
6
6
|
isIntersecting: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
type ColorPalletteSuffix = {
|
|
2
2
|
'-tint-5': string;
|
|
3
3
|
'-tint-4': string;
|
|
4
4
|
'-tint-3': string;
|
|
@@ -11,7 +11,7 @@ declare type ColorPalletteSuffix = {
|
|
|
11
11
|
'-shade-4': string;
|
|
12
12
|
'-shade-5': string;
|
|
13
13
|
};
|
|
14
|
-
|
|
14
|
+
type RemapColorPaletteKeys<Type, Name extends string> = {
|
|
15
15
|
[K in keyof Type as `${Name}${string & K}`]: Type[K];
|
|
16
16
|
};
|
|
17
17
|
export declare const generateColorPalette: <Name extends string>(name: Name, hex: string) => RemapColorPaletteKeys<ColorPalletteSuffix, Name>;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export type ColorType = ('primary-tint-5' | 'primary-tint-4' | 'primary-tint-3' | 'primary-tint-2' | 'primary-tint-1' | 'primary' | 'primary-shade-1' | 'primary-shade-2' | 'primary-shade-3' | 'primary-shade-4' | 'primary-shade-5' | 'primary-contrast' | 'secondary-tint-5' | 'secondary-tint-4' | 'secondary-tint-3' | 'secondary-tint-2' | 'secondary-tint-1' | 'secondary' | 'secondary-shade-1' | 'secondary-shade-2' | 'secondary-shade-3' | 'secondary-shade-4' | 'secondary-shade-5' | 'secondary-contrast' | 'wrong-tint-5' | 'wrong-tint-4' | 'wrong-tint-3' | 'wrong-tint-2' | 'wrong-tint-1' | 'wrong' | 'wrong-shade-1' | 'wrong-shade-2' | 'wrong-shade-3' | 'wrong-shade-4' | 'wrong-shade-5' | 'wrong-contrast' | 'attention-tint-5' | 'attention-tint-4' | 'attention-tint-3' | 'attention-tint-2' | 'attention-tint-1' | 'attention' | 'attention-shade-1' | 'attention-shade-2' | 'attention-shade-3' | 'attention-shade-4' | 'attention-shade-5' | 'success-tint-5' | 'success-tint-4' | 'success-tint-3' | 'success-tint-2' | 'success-tint-1' | 'success' | 'success-shade-1' | 'success-shade-2' | 'success-shade-3' | 'success-shade-4' | 'success-shade-5' | 'black' | 'gray-10' | 'gray-9' | 'gray-8' | 'gray-7' | 'gray-6' | 'gray-5' | 'gray-4' | 'gray-3' | 'gray-2' | 'gray-1' | 'white' | 'extra-1' | 'extra-2');
|
|
2
|
+
export type ShadowType = ('light-low' | 'light-medium' | 'light-hight' | 'light-soft' | 'dark-medium' | 'dark-hight');
|
|
3
|
+
export type TypographyPropertiesType = {
|
|
4
4
|
weight: string;
|
|
5
5
|
size: string;
|
|
6
6
|
height: string;
|
|
7
7
|
spacing: string;
|
|
8
8
|
};
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
9
|
+
export type TypographyType = ('h1' | 'h2' | 'h3' | 'h4' | 'h5' | 's1' | 's2' | 'b1' | 'b2' | 'b3' | 'btn1' | 'btn2' | 'c1' | 'c2');
|
|
10
|
+
export type SizeType = ('base-half' | 'base' | 'base-2' | 'base-3' | 'base-4' | 'base-5' | 'base-6' | 'base-7' | 'base-8' | 'base-9' | 'base-10' | 'base-11' | 'base-12' | 'base-14' | 'base-16');
|
|
11
|
+
export type ThemeType = {
|
|
12
12
|
color: Record<ColorType, string>;
|
|
13
13
|
shadow: Record<ShadowType, string>;
|
|
14
14
|
text: Record<TypographyType, TypographyPropertiesType>;
|
|
15
15
|
size: Record<SizeType, string>;
|
|
16
16
|
};
|
|
17
|
-
export
|
|
17
|
+
export type ThemeOptionsType = {
|
|
18
18
|
color?: Partial<ThemeType['color']>;
|
|
19
19
|
shadow?: Partial<ThemeType['shadow']>;
|
|
20
20
|
text?: Partial<ThemeType['text']>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@peculiar/react-components",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.2",
|
|
5
5
|
"author": "PeculiarVentures Team",
|
|
6
6
|
"description": "A simple and customizable component library to build faster, beautiful, and more accessible React applications.",
|
|
7
7
|
"keywords": [
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@emotion/react": "^11.11.1",
|
|
50
50
|
"@emotion/styled": "^11.11.0",
|
|
51
|
-
"@peculiar/color": "^0.1.
|
|
51
|
+
"@peculiar/color": "^0.1.5",
|
|
52
52
|
"@popperjs/core": "^2.11.7",
|
|
53
53
|
"@types/flat": "^5.0.2",
|
|
54
54
|
"@types/react-transition-group": "^4.4.5",
|
|
@@ -60,18 +60,19 @@
|
|
|
60
60
|
"react-transition-group": "^4.4.5"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@
|
|
64
|
-
"@storybook/
|
|
65
|
-
"@storybook/react
|
|
63
|
+
"@babel/preset-env": "7.26.0",
|
|
64
|
+
"@storybook/addon-essentials": "8.4.7",
|
|
65
|
+
"@storybook/react": "8.4.7",
|
|
66
|
+
"@storybook/react-vite": "8.4.7",
|
|
66
67
|
"@types/react": "^18.0.34",
|
|
67
68
|
"@types/react-dom": "^18.0.11",
|
|
68
69
|
"@vitejs/plugin-react-swc": "^3.5.0",
|
|
69
70
|
"react": "^18.2.0",
|
|
70
71
|
"react-dom": "^18.2.0",
|
|
71
72
|
"rimraf": "^3.0.2",
|
|
72
|
-
"storybook": "
|
|
73
|
-
"storybook-dark-mode": "^
|
|
74
|
-
"typescript": "
|
|
73
|
+
"storybook": "8.4.7",
|
|
74
|
+
"storybook-dark-mode": "^4.0.2",
|
|
75
|
+
"typescript": "5.1.6",
|
|
75
76
|
"vite": "^5.4.8"
|
|
76
77
|
},
|
|
77
78
|
"publishConfig": {
|
|
@@ -81,5 +82,5 @@
|
|
|
81
82
|
"node": ">=18.x"
|
|
82
83
|
},
|
|
83
84
|
"license": "MIT",
|
|
84
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "d537ba8a16dbe15b908e873844ce8b53b7fb3603"
|
|
85
86
|
}
|