@cronocode/react-box 3.0.0-alpha.2 → 3.0.0-alpha.3
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/box.d.ts +3 -2
- package/components/button.d.ts +4 -4
- package/components/checkbox.d.ts +1 -1
- package/components/flex.d.ts +1 -2
- package/components/form.d.ts +3 -4
- package/components/grid.d.ts +1 -2
- package/components/radioButton.d.ts +4 -4
- package/components/textarea.d.ts +4 -4
- package/components/textbox.d.ts +4 -4
- package/components/tooltip.d.ts +2 -3
- package/package.json +1 -1
package/box.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { default as React, RefAttributes } from 'react';
|
|
1
|
+
import { default as React, Ref, RefAttributes } from 'react';
|
|
2
2
|
import { ClassNameType } from './core/classNames';
|
|
3
3
|
import { ExtractElementFromTag } from './core/coreTypes';
|
|
4
4
|
import { BoxStyleProps } from './types';
|
|
@@ -15,6 +15,7 @@ interface Props<TTag extends keyof React.JSX.IntrinsicElements> extends BoxStyle
|
|
|
15
15
|
className?: ClassNameType;
|
|
16
16
|
style?: React.ComponentProps<TTag>['style'];
|
|
17
17
|
}
|
|
18
|
+
declare function BoxComponent<TTag extends keyof React.JSX.IntrinsicElements = 'div'>(props: Props<TTag>, ref: Ref<ExtractElementFromTag<TTag>>): React.ReactElement<React.ComponentProps<TTag>, string | React.JSXElementConstructor<any>>;
|
|
18
19
|
interface BoxType {
|
|
19
20
|
<TTag extends keyof React.JSX.IntrinsicElements = 'div'>(props: Props<TTag> & RefAttributes<ExtractElementFromTag<TTag>>): React.ReactNode;
|
|
20
21
|
extend: typeof BoxExtends.extend;
|
|
@@ -22,5 +23,5 @@ interface BoxType {
|
|
|
22
23
|
}
|
|
23
24
|
declare const Box: BoxType;
|
|
24
25
|
export default Box;
|
|
25
|
-
export type BoxProps<TTag extends keyof React.JSX.IntrinsicElements = 'div'> = React.ComponentProps<typeof
|
|
26
|
+
export type BoxProps<TTag extends keyof React.JSX.IntrinsicElements = 'div'> = React.ComponentProps<typeof BoxComponent<TTag>>;
|
|
26
27
|
export type BoxTagProps<TTag extends keyof React.JSX.IntrinsicElements = 'div'> = Required<BoxProps<TTag>>['props'];
|
package/components/button.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type
|
|
3
|
-
type BoxTagProps = Required<
|
|
1
|
+
import { BoxProps } from '../box';
|
|
2
|
+
type ButtonProps = Omit<BoxProps<'button'>, 'ref' | 'tag'>;
|
|
3
|
+
type BoxTagProps = Required<ButtonProps>['props'];
|
|
4
4
|
declare const tagProps: readonly ["type", "onClick"];
|
|
5
5
|
type TagPropsType = (typeof tagProps)[number];
|
|
6
6
|
type ButtonTagProps = Omit<BoxTagProps, TagPropsType>;
|
|
7
7
|
type ButtonType = Required<React.ComponentProps<'button'>>['type'];
|
|
8
|
-
interface Props extends Omit<
|
|
8
|
+
interface Props extends Omit<ButtonProps, 'props'> {
|
|
9
9
|
props?: ButtonTagProps;
|
|
10
10
|
type?: ButtonType;
|
|
11
11
|
onClick?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
package/components/checkbox.d.ts
CHANGED
|
@@ -13,5 +13,5 @@ interface Props extends CheckboxProps {
|
|
|
13
13
|
readOnly?: boolean;
|
|
14
14
|
defaultChecked?: boolean;
|
|
15
15
|
}
|
|
16
|
-
declare const _default: import('react').ForwardRefExoticComponent<
|
|
16
|
+
declare const _default: import('react').ForwardRefExoticComponent<Props & import('react').RefAttributes<HTMLInputElement>>;
|
|
17
17
|
export default _default;
|
package/components/flex.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { RefAttributes } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { BoxProps } from '../box';
|
|
3
3
|
import { ExtractElementFromTag } from '../core/coreTypes';
|
|
4
|
-
type BoxProps<TTag extends keyof React.JSX.IntrinsicElements = 'div'> = Omit<React.ComponentProps<typeof Box<TTag>>, 'ref'>;
|
|
5
4
|
declare const _default: <TTag extends keyof React.JSX.IntrinsicElements = "div">(props: BoxProps<TTag> & RefAttributes<ExtractElementFromTag<TTag>>) => React.ReactNode;
|
|
6
5
|
export default _default;
|
package/components/form.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type
|
|
3
|
-
type BoxTagProps = Required<BoxProps>['props'];
|
|
1
|
+
import { BoxProps } from '../box';
|
|
2
|
+
type BoxTagProps = Required<BoxProps<'form'>>['props'];
|
|
4
3
|
type FormTagProps = Omit<BoxTagProps, 'onSubmit' | 'ref'>;
|
|
5
|
-
interface Props<T> extends Omit<BoxProps
|
|
4
|
+
interface Props<T> extends Omit<BoxProps<'form'>, 'props' | 'tag'> {
|
|
6
5
|
props?: FormTagProps;
|
|
7
6
|
onSubmit: (obj: T, e: React.ChangeEvent<HTMLFormElement>) => void;
|
|
8
7
|
}
|
package/components/grid.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { RefAttributes } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { BoxProps } from '../box';
|
|
3
3
|
import { ExtractElementFromTag } from '../core/coreTypes';
|
|
4
|
-
type BoxProps<TTag extends keyof React.JSX.IntrinsicElements = 'div'> = Omit<React.ComponentProps<typeof Box<TTag>>, 'ref'>;
|
|
5
4
|
declare const _default: <TTag extends keyof React.JSX.IntrinsicElements = "div">(props: BoxProps<TTag> & RefAttributes<ExtractElementFromTag<TTag>>) => React.ReactNode;
|
|
6
5
|
export default _default;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type
|
|
3
|
-
type BoxTagProps = Required<
|
|
1
|
+
import { BoxProps } from '../box';
|
|
2
|
+
type RadioButtonProps = Omit<BoxProps<'input'>, 'ref' | 'tag'>;
|
|
3
|
+
type BoxTagProps = Required<RadioButtonProps>['props'];
|
|
4
4
|
declare const tagProps: readonly ["name", "onInput", "onChange", "value", "autoFocus", "readOnly", "defaultChecked"];
|
|
5
5
|
type TagPropsType = (typeof tagProps)[number];
|
|
6
6
|
type RadioButtonTagProps = Omit<BoxTagProps, TagPropsType | 'type'>;
|
|
7
|
-
interface Props extends Omit<
|
|
7
|
+
interface Props extends Omit<RadioButtonProps, 'props'> {
|
|
8
8
|
name?: string;
|
|
9
9
|
props?: RadioButtonTagProps;
|
|
10
10
|
onInput?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
package/components/textarea.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type
|
|
3
|
-
type BoxTagProps = Required<
|
|
1
|
+
import { BoxProps } from '../box';
|
|
2
|
+
type TextareaProps = Omit<BoxProps<'textarea'>, 'ref' | 'tag'>;
|
|
3
|
+
type BoxTagProps = Required<TextareaProps>['props'];
|
|
4
4
|
declare const tagProps: readonly ["name", "onInput", "onChange", "placeholder", "value", "defaultValue", "rows", "cols", "autoFocus", "maxLength", "minLength", "readOnly"];
|
|
5
5
|
type TagPropsType = (typeof tagProps)[number];
|
|
6
6
|
type TextareaTagProps = Omit<BoxTagProps, TagPropsType>;
|
|
7
|
-
interface Props extends Omit<
|
|
7
|
+
interface Props extends Omit<TextareaProps, 'props'> {
|
|
8
8
|
name?: string;
|
|
9
9
|
props?: TextareaTagProps;
|
|
10
10
|
onInput?: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
package/components/textbox.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type
|
|
3
|
-
type BoxTagProps = Required<
|
|
1
|
+
import { BoxProps } from '../box';
|
|
2
|
+
type TextareaProps = Omit<BoxProps<'input'>, 'ref' | 'tag'>;
|
|
3
|
+
type BoxTagProps = Required<TextareaProps>['props'];
|
|
4
4
|
declare const tagProps: readonly ["name", "onInput", "onChange", "type", "placeholder", "defaultValue", "autoFocus", "readOnly", "required", "value", "pattern"];
|
|
5
5
|
type TagPropsType = (typeof tagProps)[number];
|
|
6
6
|
type TextboxTagProps = Omit<BoxTagProps, TagPropsType>;
|
|
7
7
|
type TextboxType = 'date' | 'datetime-local' | 'email' | 'hidden' | 'month' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'time' | 'url' | 'week';
|
|
8
|
-
interface Props extends Omit<
|
|
8
|
+
interface Props extends Omit<TextareaProps, 'props'> {
|
|
9
9
|
name?: string;
|
|
10
10
|
props?: TextboxTagProps;
|
|
11
11
|
onInput?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
package/components/tooltip.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
interface Props extends React.ComponentProps<typeof Box> {
|
|
1
|
+
import { BoxProps } from '../box';
|
|
2
|
+
interface Props extends BoxProps {
|
|
4
3
|
onPositionChange?(position: {
|
|
5
4
|
top: number;
|
|
6
5
|
left: number;
|