@kroo-web/design-system 1.1.106 → 1.1.107
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/examples/form/index.d.ts +16 -49
- package/dist/cjs/index.js +15 -15
- package/dist/cjs/src/__tests__/setup.d.ts +5 -0
- package/dist/cjs/src/components/Accordion/config.d.ts +1 -1
- package/dist/cjs/src/components/Accordion/index.d.ts +12 -12
- package/dist/cjs/src/components/Button/index.d.ts +6 -6
- package/dist/cjs/src/components/Callout/index.d.ts +2 -2
- package/dist/cjs/src/components/Card/index.d.ts +7 -7
- package/dist/cjs/src/components/Cards/index.d.ts +2 -2
- package/dist/cjs/src/components/Checkbox/index.d.ts +8 -9
- package/dist/cjs/src/components/Columns/index.d.ts +2 -2
- package/dist/cjs/src/components/ComboBox/index.d.ts +8 -9
- package/dist/cjs/src/components/DatePicker/index.d.ts +8 -17
- package/dist/cjs/src/components/Disclosure/index.d.ts +2 -2
- package/dist/cjs/src/components/Form/index.d.ts +7 -3
- package/dist/cjs/src/components/Icon/index.d.ts +2 -2
- package/dist/cjs/src/components/Link/index.d.ts +3 -3
- package/dist/cjs/src/components/Loading/index.d.ts +3 -3
- package/dist/cjs/src/components/Modal/index.d.ts +8 -8
- package/dist/cjs/src/components/NumberField/index.d.ts +10 -20
- package/dist/cjs/src/components/PhoneField/index.d.ts +6 -26
- package/dist/cjs/src/components/PinInput/index.d.ts +8 -7
- package/dist/cjs/src/components/Popover/index.d.ts +2 -2
- package/dist/cjs/src/components/ProgressIndicator/index.d.ts +3 -3
- package/dist/cjs/src/components/RadioGroup/index.d.ts +10 -18
- package/dist/cjs/src/components/Range/index.d.ts +9 -19
- package/dist/cjs/src/components/Select/index.d.ts +13 -14
- package/dist/cjs/src/components/Skeleton/index.d.ts +2 -2
- package/dist/cjs/src/components/Table/index.d.ts +4 -4
- package/dist/cjs/src/components/Tabs/index.d.ts +3 -3
- package/dist/cjs/src/components/Tag/index.d.ts +4 -4
- package/dist/cjs/src/components/TextField/index.d.ts +12 -13
- package/dist/cjs/src/components/Toast/index.d.ts +3 -3
- package/dist/cjs/src/components/Tooltip/index.d.ts +7 -7
- package/dist/cjs/src/components/Typography/index.d.ts +6 -7
- package/dist/cjs/src/components/Wrapper/index.d.ts +7 -7
- package/dist/cjs/src/components/shared/FormField/index.d.ts +4 -4
- package/dist/cjs/src/hooks/useWindowSize.d.ts +1 -1
- package/dist/cjs/src/types/PolymorphicWithoutRef.d.ts +2 -2
- package/dist/cjs/src/utils/decorators/Grid/index.d.ts +1 -1
- package/dist/esm/examples/form/index.d.ts +16 -49
- package/dist/esm/index.js +16 -16
- package/dist/esm/src/__tests__/setup.d.ts +5 -0
- package/dist/esm/src/components/Accordion/config.d.ts +1 -1
- package/dist/esm/src/components/Accordion/index.d.ts +12 -12
- package/dist/esm/src/components/Button/index.d.ts +6 -6
- package/dist/esm/src/components/Callout/index.d.ts +2 -2
- package/dist/esm/src/components/Card/index.d.ts +7 -7
- package/dist/esm/src/components/Cards/index.d.ts +2 -2
- package/dist/esm/src/components/Checkbox/index.d.ts +8 -9
- package/dist/esm/src/components/Columns/index.d.ts +2 -2
- package/dist/esm/src/components/ComboBox/index.d.ts +8 -9
- package/dist/esm/src/components/DatePicker/index.d.ts +8 -17
- package/dist/esm/src/components/Disclosure/index.d.ts +2 -2
- package/dist/esm/src/components/Form/index.d.ts +7 -3
- package/dist/esm/src/components/Icon/index.d.ts +2 -2
- package/dist/esm/src/components/Link/index.d.ts +3 -3
- package/dist/esm/src/components/Loading/index.d.ts +3 -3
- package/dist/esm/src/components/Modal/index.d.ts +8 -8
- package/dist/esm/src/components/NumberField/index.d.ts +10 -20
- package/dist/esm/src/components/PhoneField/index.d.ts +6 -26
- package/dist/esm/src/components/PinInput/index.d.ts +8 -7
- package/dist/esm/src/components/Popover/index.d.ts +2 -2
- package/dist/esm/src/components/ProgressIndicator/index.d.ts +3 -3
- package/dist/esm/src/components/RadioGroup/index.d.ts +10 -18
- package/dist/esm/src/components/Range/index.d.ts +9 -19
- package/dist/esm/src/components/Select/index.d.ts +13 -14
- package/dist/esm/src/components/Skeleton/index.d.ts +2 -2
- package/dist/esm/src/components/Table/index.d.ts +4 -4
- package/dist/esm/src/components/Tabs/index.d.ts +3 -3
- package/dist/esm/src/components/Tag/index.d.ts +4 -4
- package/dist/esm/src/components/TextField/index.d.ts +12 -13
- package/dist/esm/src/components/Toast/index.d.ts +3 -3
- package/dist/esm/src/components/Tooltip/index.d.ts +7 -7
- package/dist/esm/src/components/Typography/index.d.ts +6 -7
- package/dist/esm/src/components/Wrapper/index.d.ts +7 -7
- package/dist/esm/src/components/shared/FormField/index.d.ts +4 -4
- package/dist/esm/src/hooks/useWindowSize.d.ts +1 -1
- package/dist/esm/src/types/PolymorphicWithoutRef.d.ts +2 -2
- package/dist/esm/src/utils/decorators/Grid/index.d.ts +1 -1
- package/dist/types.d.ts +175 -242
- package/package.json +19 -11
- package/dist/cjs/examples/CheckboxWithController/index.d.ts +0 -6
- package/dist/cjs/examples/ComboBoxWithController/index.d.ts +0 -6
- package/dist/cjs/examples/MagicForm/index.d.ts +0 -7
- package/dist/cjs/examples/NumberFieldWithController/index.d.ts +0 -6
- package/dist/cjs/examples/PhoneFieldWithController/index.d.ts +0 -6
- package/dist/cjs/examples/PinInputWithController/index.d.ts +0 -6
- package/dist/cjs/examples/RadioGroupWithController/index.d.ts +0 -8
- package/dist/cjs/src/utils/composeRefs.d.ts +0 -2
- package/dist/cjs/src/utils/parseInt.d.ts +0 -1
- package/dist/esm/examples/CheckboxWithController/index.d.ts +0 -6
- package/dist/esm/examples/ComboBoxWithController/index.d.ts +0 -6
- package/dist/esm/examples/MagicForm/index.d.ts +0 -7
- package/dist/esm/examples/NumberFieldWithController/index.d.ts +0 -6
- package/dist/esm/examples/PhoneFieldWithController/index.d.ts +0 -6
- package/dist/esm/examples/PinInputWithController/index.d.ts +0 -6
- package/dist/esm/examples/RadioGroupWithController/index.d.ts +0 -8
- package/dist/esm/src/utils/composeRefs.d.ts +0 -2
- package/dist/esm/src/utils/parseInt.d.ts +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { TTypographyProps } from '../Typography';
|
|
3
3
|
export type TTagProps = {
|
|
4
|
-
|
|
4
|
+
children: ReactNode | ReactNode[];
|
|
5
5
|
circularIcon?: boolean;
|
|
6
6
|
className?: string;
|
|
7
7
|
icon: boolean;
|
|
8
|
-
|
|
8
|
+
variant?: 'danger' | 'night' | 'positive' | 'primary' | 'secondary' | 'tertiary' | 'warning';
|
|
9
9
|
};
|
|
10
10
|
export declare const Tag: {
|
|
11
|
-
Root: ({ variant, children, className, icon, circularIcon, ...rest }: TTagProps) => React.JSX.Element;
|
|
12
|
-
Icon: ({ size, weight, ...rest }: import("../Icon").TIconProps) => React.JSX.Element;
|
|
13
11
|
Content: ({ children, ...rest }: TTypographyProps) => React.JSX.Element;
|
|
12
|
+
Icon: ({ size, weight, ...rest }: import("../Icon").TIconProps) => React.JSX.Element;
|
|
13
|
+
Root: ({ children, circularIcon, className, icon, variant, ...rest }: TTagProps) => React.JSX.Element;
|
|
14
14
|
};
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import React, { DetailedHTMLProps, InputHTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { FieldValues, Path } from 'react-hook-form';
|
|
3
|
+
export type TTextFieldProps<T extends FieldValues> = {
|
|
4
|
+
className?: string;
|
|
5
5
|
disabled?: boolean;
|
|
6
|
+
disableError?: boolean;
|
|
6
7
|
helper?: {
|
|
7
8
|
message: ReactNode | string;
|
|
8
9
|
};
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
suffix?: string | ReactNode;
|
|
12
|
-
className?: string;
|
|
13
|
-
rightContent?: ReactNode | string;
|
|
10
|
+
id: string;
|
|
11
|
+
label: string;
|
|
14
12
|
leftContent?: ReactNode | string;
|
|
15
13
|
missing?: boolean;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
name: Path<T>;
|
|
15
|
+
prefix?: ReactNode | string;
|
|
16
|
+
rightContent?: ReactNode | string;
|
|
17
|
+
suffix?: ReactNode | string;
|
|
18
|
+
type?: DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>['type'];
|
|
20
19
|
} & DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
|
|
21
|
-
export declare const TextField: React.ForwardRefExoticComponent<Omit<TTextFieldProps
|
|
20
|
+
export declare const TextField: React.ForwardRefExoticComponent<Omit<TTextFieldProps<FieldValues>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -4,16 +4,16 @@ export type TToastRootProps = {
|
|
|
4
4
|
children: React.ReactNode;
|
|
5
5
|
};
|
|
6
6
|
export type TToastTitleProps = {
|
|
7
|
-
className?: string;
|
|
8
7
|
children: React.ReactNode;
|
|
8
|
+
className?: string;
|
|
9
9
|
};
|
|
10
10
|
export type TToastDescriptionProps = {
|
|
11
11
|
children: React.ReactNode;
|
|
12
12
|
};
|
|
13
13
|
export type TToastIconProps = TIconProps;
|
|
14
14
|
export declare const Toast: {
|
|
15
|
-
Root: ({ children }: TToastRootProps) => React.JSX.Element;
|
|
16
|
-
Title: ({ className, children }: TToastTitleProps) => React.JSX.Element;
|
|
17
15
|
Description: ({ children }: TToastDescriptionProps) => React.JSX.Element;
|
|
18
16
|
Icon: (props: TToastIconProps) => React.JSX.Element;
|
|
17
|
+
Root: ({ children }: TToastRootProps) => React.JSX.Element;
|
|
18
|
+
Title: ({ children, className }: TToastTitleProps) => React.JSX.Element;
|
|
19
19
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import * as RadixTooltip from '@radix-ui/react-tooltip';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
export type TTooltipRootProps = React.ComponentProps<typeof RadixTooltip.Root>;
|
|
4
|
-
export type TTooltipTriggerProps =
|
|
4
|
+
export type TTooltipTriggerProps = {
|
|
5
5
|
className?: string;
|
|
6
|
-
}
|
|
7
|
-
export type TTooltipContentProps =
|
|
6
|
+
} & React.ComponentProps<typeof RadixTooltip.Trigger>;
|
|
7
|
+
export type TTooltipContentProps = {
|
|
8
8
|
className?: string;
|
|
9
|
-
}
|
|
9
|
+
} & React.ComponentProps<typeof RadixTooltip.Content>;
|
|
10
10
|
export declare const Tooltip: {
|
|
11
|
+
Content: ({ children, className, ...rest }: TTooltipContentProps) => React.JSX.Element;
|
|
11
12
|
Root: ({ children, ...rest }: TTooltipRootProps) => React.JSX.Element;
|
|
12
|
-
Trigger: ({
|
|
13
|
-
Content: ({ className, children, ...rest }: TTooltipContentProps) => React.JSX.Element;
|
|
13
|
+
Trigger: ({ children, className, ...rest }: TTooltipTriggerProps) => React.JSX.Element;
|
|
14
14
|
};
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import React
|
|
2
|
-
export type TLegacyMarketingText = 'marketing-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type TLegacyMarketingText = 'marketing-large-light' | 'marketing-large-regular' | 'marketing-large-semi-bold' | 'marketing-medium-light' | 'marketing-medium-regular' | 'marketing-medium-semi-bold' | 'marketing-quote-light' | 'marketing-quote-regular' | 'marketing-quote-semi-bold' | 'marketing-small-light' | 'marketing-small-regular' | 'marketing-small-semi-bold' | 'marketing-tag-light' | 'marketing-tag-regular' | 'marketing-tag-semi-bold' | 'marketing-text-light' | 'marketing-text-regular' | 'marketing-text-semi-bold';
|
|
3
3
|
export type TLegacyMarketingHeading = 'marketing-heading-1' | 'marketing-heading-2' | 'marketing-heading-3' | 'marketing-heading-4' | 'marketing-heading-5' | 'marketing-heading-6' | 'marketing-heading-7';
|
|
4
4
|
export type TLegacyMarketingFooter = 'footer-regular' | 'footer-semi-bold';
|
|
5
|
-
export type TTypography = '
|
|
6
|
-
export type TTypographyVariants =
|
|
5
|
+
export type TTypography = 'content-large' | 'content-large-light' | 'content-large-semi-bold' | 'content-regular' | 'content-regular-light' | 'content-regular-semi-bold' | 'content-title' | 'content-title-light' | 'content-title-semi-bold' | 'form-button' | 'form-helper' | 'form-input-normal' | 'form-input-semi-bold' | 'form-label' | 'tag';
|
|
6
|
+
export type TTypographyVariants = TLegacyMarketingFooter | TLegacyMarketingHeading | TLegacyMarketingText | TTypography;
|
|
7
7
|
export type TTypographyProps<C extends React.ElementType = 'p'> = {
|
|
8
8
|
as?: C;
|
|
9
|
-
variant?: TTypographyVariants;
|
|
10
9
|
children?: React.ReactNode;
|
|
11
10
|
className?: string;
|
|
11
|
+
variant?: TTypographyVariants;
|
|
12
12
|
} & React.ComponentPropsWithoutRef<C>;
|
|
13
|
-
export declare const
|
|
14
|
-
export declare const Typography: React.ForwardRefExoticComponent<Omit<TTypographyProps<React.ElementType<any, keyof React.JSX.IntrinsicElements>>, "ref"> & React.RefAttributes<React.ElementType<any, keyof React.JSX.IntrinsicElements>>>;
|
|
13
|
+
export declare const Typography: <C extends React.ElementType = "p">({ as, children, className, variant, ...rest }: TTypographyProps<C>) => React.JSX.Element;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React, { PropsWithChildren } from 'react';
|
|
2
|
-
export interface WrapperProps extends PropsWithChildren {
|
|
3
|
-
as?: 'li' | 'div';
|
|
4
|
-
variants?: WrapperVariants;
|
|
5
|
-
className?: string;
|
|
6
|
-
}
|
|
7
2
|
export type WrapperVariants = {
|
|
8
|
-
visual?: 'paper' | 'bento' | 'bento-icon';
|
|
9
3
|
orientation?: 'center';
|
|
10
4
|
type?: 'trustPilot';
|
|
5
|
+
visual?: 'bento' | 'bento-icon' | 'paper';
|
|
11
6
|
};
|
|
12
|
-
export
|
|
7
|
+
export interface WrapperProps extends PropsWithChildren {
|
|
8
|
+
as?: 'div' | 'li';
|
|
9
|
+
className?: string;
|
|
10
|
+
variants?: WrapperVariants;
|
|
11
|
+
}
|
|
12
|
+
export declare const Wrapper: ({ as, children, className, variants }: WrapperProps) => React.JSX.Element;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
export type TFormFieldProps = {
|
|
3
|
-
|
|
4
|
-
label: string;
|
|
3
|
+
children: ReactNode;
|
|
5
4
|
error?: string;
|
|
6
5
|
helper?: string;
|
|
7
|
-
|
|
6
|
+
id: string;
|
|
7
|
+
label: string;
|
|
8
8
|
};
|
|
9
|
-
export declare const FormField: ({
|
|
9
|
+
export declare const FormField: ({ children, error, helper, id, label }: TFormFieldProps) => React.JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
type Merge<T, U> = Omit<T, keyof U> & U;
|
|
2
|
-
type PropsWithAs<P, T extends React.ElementType> =
|
|
2
|
+
type PropsWithAs<P, T extends React.ElementType> = {
|
|
3
3
|
as?: T;
|
|
4
|
-
};
|
|
4
|
+
} & P;
|
|
5
5
|
export type PolymorphicPropsWithoutRef<P, T extends React.ElementType> = Merge<T extends keyof JSX.IntrinsicElements ? React.PropsWithoutRef<JSX.IntrinsicElements[T]> : React.ComponentPropsWithoutRef<T>, PropsWithAs<P, T>>;
|
|
6
6
|
export {};
|
|
@@ -2,4 +2,4 @@ import React, { PropsWithChildren } from 'react';
|
|
|
2
2
|
export type TGridDecoratorProps = PropsWithChildren<{
|
|
3
3
|
columns?: number;
|
|
4
4
|
}>;
|
|
5
|
-
export declare const GridDecorator: ({
|
|
5
|
+
export declare const GridDecorator: ({ children, columns }: TGridDecoratorProps) => React.JSX.Element;
|
|
@@ -1,78 +1,45 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import * as z from 'zod';
|
|
3
|
-
import { Control, FieldValues, Path } from 'react-hook-form';
|
|
4
|
-
export type TFieldWithController<T extends FieldValues, C> = {
|
|
5
|
-
control: Control<T, object>;
|
|
6
|
-
name: Path<T>;
|
|
7
|
-
props: C;
|
|
8
|
-
};
|
|
9
3
|
export declare const exampleSchema: z.ZodObject<{
|
|
10
|
-
textField: z.ZodString;
|
|
11
|
-
select: z.ZodString;
|
|
12
|
-
radioGroup: z.ZodString;
|
|
13
|
-
numberField: z.ZodNumber;
|
|
14
4
|
datePicker: z.ZodDate;
|
|
15
5
|
disclosureTextField: z.ZodString;
|
|
16
|
-
|
|
6
|
+
numberField: z.ZodNumber;
|
|
17
7
|
processor: z.ZodString;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
8
|
+
radioGroup: z.ZodString;
|
|
9
|
+
range: z.ZodNumber;
|
|
10
|
+
select: z.ZodString;
|
|
11
|
+
textField: z.ZodString;
|
|
21
12
|
}, "strip", z.ZodTypeAny, {
|
|
22
13
|
select: string;
|
|
23
14
|
radioGroup: string;
|
|
24
|
-
pin: string;
|
|
25
15
|
range: number;
|
|
26
|
-
textField: string;
|
|
27
|
-
numberField: number;
|
|
28
16
|
disclosureTextField: string;
|
|
17
|
+
numberField: number;
|
|
18
|
+
textField: string;
|
|
29
19
|
datePicker: Date;
|
|
30
20
|
processor: string;
|
|
31
|
-
phoneField: string;
|
|
32
|
-
terms: boolean;
|
|
33
21
|
}, {
|
|
34
22
|
select: string;
|
|
35
23
|
radioGroup: string;
|
|
36
|
-
pin: string;
|
|
37
24
|
range: number;
|
|
38
|
-
textField: string;
|
|
39
|
-
numberField: number;
|
|
40
25
|
disclosureTextField: string;
|
|
26
|
+
numberField: number;
|
|
27
|
+
textField: string;
|
|
41
28
|
datePicker: Date;
|
|
42
29
|
processor: string;
|
|
43
|
-
phoneField: string;
|
|
44
|
-
terms: boolean;
|
|
45
30
|
}>;
|
|
46
31
|
export type TFormExample = {
|
|
32
|
+
disabled?: boolean;
|
|
47
33
|
values: {
|
|
48
|
-
textField?: string;
|
|
49
34
|
currencyField?: string;
|
|
50
|
-
select?: string;
|
|
51
|
-
radioGroup?: string;
|
|
52
|
-
numberField?: number;
|
|
53
35
|
datePicker?: string;
|
|
54
36
|
disclosureTextField?: string;
|
|
55
|
-
|
|
37
|
+
numberField?: number;
|
|
56
38
|
processor?: string;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
39
|
+
radioGroup?: string;
|
|
40
|
+
range?: number;
|
|
41
|
+
select?: string;
|
|
42
|
+
textField?: string;
|
|
60
43
|
};
|
|
61
|
-
error?: boolean;
|
|
62
|
-
disabled?: boolean;
|
|
63
|
-
};
|
|
64
|
-
export type FormValues = {
|
|
65
|
-
textField: string;
|
|
66
|
-
currencyField: string;
|
|
67
|
-
select: string;
|
|
68
|
-
radioGroup: string;
|
|
69
|
-
numberField: number;
|
|
70
|
-
datePicker: string;
|
|
71
|
-
disclosureTextField: string;
|
|
72
|
-
range: number;
|
|
73
|
-
processor: string;
|
|
74
|
-
phoneField: string;
|
|
75
|
-
terms: boolean;
|
|
76
|
-
pin: string;
|
|
77
44
|
};
|
|
78
|
-
export declare const FormExample: ({
|
|
45
|
+
export declare const FormExample: ({ disabled, values }: TFormExample) => React.JSX.Element;
|