@smart-react-components/ui 2.2.0 → 2.2.1
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/Checkbox/CheckboxAll.d.ts +6 -6
- package/Checkbox/CheckboxGroup.d.ts +4 -4
- package/Checkbox/CheckboxGroup.js +1 -1
- package/Checkbox/index.d.ts +6 -6
- package/Radio/RadioGroup.d.ts +4 -4
- package/Radio/RadioGroup.js +1 -1
- package/Radio/index.d.ts +6 -6
- package/Select/SelectBox.d.ts +4 -3
- package/Select/index.d.ts +4 -3
- package/package.json +1 -1
- package/types/form.d.ts +3 -3
|
@@ -2,9 +2,9 @@ import { IntrinsicStyledCoreProps } from '@smart-react-components/core/element-p
|
|
|
2
2
|
import { ContentElement, PaletteProp, Partial, ResponsiveProp, SetState, ShapeProp, SizeProp } from '@smart-react-components/core/types';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { FormValue, OrderPosition } from '../types';
|
|
5
|
-
export interface Props extends Partial<ResponsiveProp<'size', SizeProp>>, IntrinsicStyledCoreProps {
|
|
6
|
-
active?:
|
|
7
|
-
items:
|
|
5
|
+
export interface Props<T extends FormValue = FormValue> extends Partial<ResponsiveProp<'size', SizeProp>>, IntrinsicStyledCoreProps {
|
|
6
|
+
active?: T[];
|
|
7
|
+
items: T[];
|
|
8
8
|
isBlock?: boolean;
|
|
9
9
|
isDisabled?: boolean;
|
|
10
10
|
isOutline?: boolean;
|
|
@@ -13,9 +13,9 @@ export interface Props extends Partial<ResponsiveProp<'size', SizeProp>>, Intrin
|
|
|
13
13
|
name?: string;
|
|
14
14
|
palette?: PaletteProp;
|
|
15
15
|
position?: OrderPosition;
|
|
16
|
-
setActive?: SetState<
|
|
16
|
+
setActive?: SetState<T[]>;
|
|
17
17
|
shape?: ShapeProp;
|
|
18
18
|
template?: React.JSX.Element;
|
|
19
19
|
}
|
|
20
|
-
declare const
|
|
21
|
-
export default
|
|
20
|
+
declare const _default: <T extends FormValue = FormValue>(props: Props<T> & React.RefAttributes<HTMLInputElement>) => React.ReactElement | null;
|
|
21
|
+
export default _default;
|
|
@@ -3,8 +3,8 @@ import { PaletteProp, Partial, ResponsiveProp, SetState, ShapeProp, SizeProp } f
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { FormValue, OrderPosition } from '../types';
|
|
5
5
|
export { OrderPosition as Position } from '../types';
|
|
6
|
-
export interface Props extends Partial<ResponsiveProp<'size', SizeProp>>, IntrinsicStyledCoreProps {
|
|
7
|
-
active?:
|
|
6
|
+
export interface Props<T extends FormValue = FormValue> extends Partial<ResponsiveProp<'size', SizeProp>>, IntrinsicStyledCoreProps {
|
|
7
|
+
active?: T[];
|
|
8
8
|
children: React.JSX.Element[];
|
|
9
9
|
isBlock?: boolean;
|
|
10
10
|
isOutline?: boolean;
|
|
@@ -13,9 +13,9 @@ export interface Props extends Partial<ResponsiveProp<'size', SizeProp>>, Intrin
|
|
|
13
13
|
name?: string;
|
|
14
14
|
palette?: PaletteProp;
|
|
15
15
|
position?: OrderPosition;
|
|
16
|
-
setActive?: SetState<
|
|
16
|
+
setActive?: SetState<T[]>;
|
|
17
17
|
shape?: ShapeProp;
|
|
18
18
|
template?: React.JSX.Element;
|
|
19
19
|
}
|
|
20
|
-
declare const CheckboxGroup: React.
|
|
20
|
+
declare const CheckboxGroup: <T extends FormValue = FormValue>(props: Props<T>) => React.JSX.Element;
|
|
21
21
|
export default CheckboxGroup;
|
|
@@ -10,7 +10,7 @@ const react_1 = __importDefault(require("react"));
|
|
|
10
10
|
const FormGroup_1 = __importDefault(require("../components/Form/FormGroup"));
|
|
11
11
|
var types_1 = require("../types");
|
|
12
12
|
Object.defineProperty(exports, "Position", { enumerable: true, get: function () { return types_1.OrderPosition; } });
|
|
13
|
-
const CheckboxGroup = props => (react_1.default.createElement(FormGroup_1.default, { isBlock: props.isBlock, ...(0, element_props_1.default)(props, [intrinsic_styled_core_props_1.default]) }, props.children.map((item, idx) => { var _a; return react_1.default.cloneElement(item, {
|
|
13
|
+
const CheckboxGroup = (props) => (react_1.default.createElement(FormGroup_1.default, { isBlock: props.isBlock, ...(0, element_props_1.default)(props, [intrinsic_styled_core_props_1.default]) }, props.children.map((item, idx) => { var _a; return react_1.default.cloneElement(item, {
|
|
14
14
|
key: (_a = item.key) !== null && _a !== void 0 ? _a : idx,
|
|
15
15
|
active: props.active,
|
|
16
16
|
isBlock: props.isBlock,
|
package/Checkbox/index.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { ContentElement, PaletteProp, Partial, ResponsiveProp, SetState, ShapePr
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { FormValue, OrderPosition } from '../types';
|
|
5
5
|
export { OrderPosition as Position } from '../types';
|
|
6
|
-
export interface Props extends Partial<ResponsiveProp<'size', SizeProp>>, IntrinsicStyledCoreProps {
|
|
7
|
-
active?:
|
|
6
|
+
export interface Props<T extends FormValue = FormValue> extends Partial<ResponsiveProp<'size', SizeProp>>, IntrinsicStyledCoreProps {
|
|
7
|
+
active?: T[];
|
|
8
8
|
isBlock?: boolean;
|
|
9
9
|
isChecked?: boolean;
|
|
10
10
|
isIndeterminate?: boolean;
|
|
@@ -16,11 +16,11 @@ export interface Props extends Partial<ResponsiveProp<'size', SizeProp>>, Intrin
|
|
|
16
16
|
name?: string;
|
|
17
17
|
palette?: PaletteProp;
|
|
18
18
|
position?: OrderPosition;
|
|
19
|
-
setActive?: SetState<
|
|
19
|
+
setActive?: SetState<T[]>;
|
|
20
20
|
setChecked?: SetState<boolean>;
|
|
21
21
|
shape?: ShapeProp;
|
|
22
22
|
template?: React.JSX.Element;
|
|
23
|
-
value?:
|
|
23
|
+
value?: T;
|
|
24
24
|
}
|
|
25
|
-
declare const
|
|
26
|
-
export default
|
|
25
|
+
declare const _default: <T extends FormValue = FormValue>(props: Props<T> & React.RefAttributes<HTMLInputElement>) => React.ReactElement | null;
|
|
26
|
+
export default _default;
|
package/Radio/RadioGroup.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { PaletteProp, Partial, ResponsiveProp, SetState, SizeProp } from '@smart
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { FormValue, OrderPosition } from '../types';
|
|
5
5
|
export { OrderPosition as Position } from '../types';
|
|
6
|
-
export interface Props extends Partial<ResponsiveProp<'size', SizeProp>>, IntrinsicStyledCoreProps {
|
|
7
|
-
active:
|
|
6
|
+
export interface Props<T extends FormValue = FormValue> extends Partial<ResponsiveProp<'size', SizeProp>>, IntrinsicStyledCoreProps {
|
|
7
|
+
active: T;
|
|
8
8
|
children: React.JSX.Element[];
|
|
9
9
|
isBlock?: boolean;
|
|
10
10
|
isOutline?: boolean;
|
|
@@ -13,8 +13,8 @@ export interface Props extends Partial<ResponsiveProp<'size', SizeProp>>, Intrin
|
|
|
13
13
|
name?: string;
|
|
14
14
|
palette?: PaletteProp;
|
|
15
15
|
position?: OrderPosition;
|
|
16
|
-
setActive: SetState<
|
|
16
|
+
setActive: SetState<T>;
|
|
17
17
|
template?: React.JSX.Element;
|
|
18
18
|
}
|
|
19
|
-
declare const RadioGroup: React.
|
|
19
|
+
declare const RadioGroup: <T extends FormValue = FormValue>(props: Props<T>) => React.JSX.Element;
|
|
20
20
|
export default RadioGroup;
|
package/Radio/RadioGroup.js
CHANGED
|
@@ -10,7 +10,7 @@ const react_1 = __importDefault(require("react"));
|
|
|
10
10
|
const FormGroup_1 = __importDefault(require("../components/Form/FormGroup"));
|
|
11
11
|
var types_1 = require("../types");
|
|
12
12
|
Object.defineProperty(exports, "Position", { enumerable: true, get: function () { return types_1.OrderPosition; } });
|
|
13
|
-
const RadioGroup = props => (react_1.default.createElement(FormGroup_1.default, { isBlock: props.isBlock, ...(0, element_props_1.default)(props, [intrinsic_styled_core_props_1.default]) }, props.children.map((item, idx) => { var _a; return react_1.default.cloneElement(item, {
|
|
13
|
+
const RadioGroup = (props) => (react_1.default.createElement(FormGroup_1.default, { isBlock: props.isBlock, ...(0, element_props_1.default)(props, [intrinsic_styled_core_props_1.default]) }, props.children.map((item, idx) => { var _a; return react_1.default.cloneElement(item, {
|
|
14
14
|
key: (_a = item.key) !== null && _a !== void 0 ? _a : idx,
|
|
15
15
|
active: props.active,
|
|
16
16
|
isBlock: props.isBlock,
|
package/Radio/index.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { ContentElement, PaletteProp, Partial, ResponsiveProp, SetState, SizePro
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { FormValue, OrderPosition } from '../types';
|
|
5
5
|
export { OrderPosition as Position } from '../types';
|
|
6
|
-
export interface Props extends Partial<ResponsiveProp<'size', SizeProp>>, IntrinsicStyledCoreProps {
|
|
7
|
-
active?:
|
|
6
|
+
export interface Props<T extends FormValue = FormValue> extends Partial<ResponsiveProp<'size', SizeProp>>, IntrinsicStyledCoreProps {
|
|
7
|
+
active?: T;
|
|
8
8
|
isBlock?: boolean;
|
|
9
9
|
isDisabled?: boolean;
|
|
10
10
|
isOutline?: boolean;
|
|
@@ -14,9 +14,9 @@ export interface Props extends Partial<ResponsiveProp<'size', SizeProp>>, Intrin
|
|
|
14
14
|
name?: string;
|
|
15
15
|
palette?: PaletteProp;
|
|
16
16
|
position?: OrderPosition;
|
|
17
|
-
setActive?: SetState<
|
|
17
|
+
setActive?: SetState<T>;
|
|
18
18
|
template?: React.JSX.Element;
|
|
19
|
-
value:
|
|
19
|
+
value: T;
|
|
20
20
|
}
|
|
21
|
-
declare const
|
|
22
|
-
export default
|
|
21
|
+
declare const _default: <T extends FormValue = FormValue>(props: Props<T> & React.RefAttributes<HTMLInputElement>) => React.ReactElement | null;
|
|
22
|
+
export default _default;
|
package/Select/SelectBox.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { GenericProps } from '../types/form';
|
|
2
2
|
import { JSXElementProps, PaletteProp, ResponsiveProp, SizeProp } from '@smart-react-components/core/types';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
|
|
4
|
+
import { FormValue } from '../types';
|
|
5
|
+
export interface Props<T extends FormValue | FormValue[] = FormValue | FormValue[]> extends GenericProps<T>, Partial<ResponsiveProp<'searchInputSize', SizeProp>> {
|
|
5
6
|
dropdownArrowIconElementProps?: JSXElementProps;
|
|
6
7
|
dropdownPalette?: PaletteProp;
|
|
7
8
|
hasSearch?: boolean;
|
|
@@ -11,5 +12,5 @@ export interface Props extends GenericProps, Partial<ResponsiveProp<'searchInput
|
|
|
11
12
|
searchInputPalette?: PaletteProp;
|
|
12
13
|
searchInputPlaceholder?: string;
|
|
13
14
|
}
|
|
14
|
-
declare const
|
|
15
|
-
export default
|
|
15
|
+
declare const _default: <T extends FormValue | FormValue[] = FormValue | FormValue[]>(props: Props<T> & React.RefAttributes<HTMLInputElement>) => React.ReactElement | null;
|
|
16
|
+
export default _default;
|
package/Select/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { FormValue } from '../types';
|
|
2
3
|
import { GenericProps } from '../types/form';
|
|
3
|
-
export type Props = GenericProps
|
|
4
|
-
declare const
|
|
5
|
-
export default
|
|
4
|
+
export type Props<T extends FormValue | FormValue[] = FormValue | FormValue[]> = GenericProps<T>;
|
|
5
|
+
declare const _default: <T extends FormValue | FormValue[] = FormValue | FormValue[]>(props: Props<T> & React.RefAttributes<HTMLInputElement>) => React.ReactElement | null;
|
|
6
|
+
export default _default;
|
package/package.json
CHANGED
package/types/form.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { IntrinsicStyledCoreProps } from '@smart-react-components/core/element-p
|
|
|
2
2
|
import { ContentElement, JSXElementProps, PaletteProp, Partial, ResponsiveProp, SetState, ShapeProp, SizeProp } from '@smart-react-components/core/types';
|
|
3
3
|
import { JSX } from 'react';
|
|
4
4
|
import { FormValue } from '../types';
|
|
5
|
-
export interface GenericProps extends Partial<ResponsiveProp<'size', SizeProp>>, IntrinsicStyledCoreProps {
|
|
6
|
-
active:
|
|
5
|
+
export interface GenericProps<T extends FormValue | FormValue[] = FormValue | FormValue[]> extends Partial<ResponsiveProp<'size', SizeProp>>, IntrinsicStyledCoreProps {
|
|
6
|
+
active: T;
|
|
7
7
|
children: JSX.Element | JSX.Element[];
|
|
8
8
|
elementProps?: JSXElementProps;
|
|
9
9
|
hasBorder?: boolean;
|
|
@@ -21,6 +21,6 @@ export interface GenericProps extends Partial<ResponsiveProp<'size', SizeProp>>,
|
|
|
21
21
|
rightAddon?: ContentElement;
|
|
22
22
|
rightIcon?: ContentElement;
|
|
23
23
|
shape?: ShapeProp;
|
|
24
|
-
setActive: SetState<
|
|
24
|
+
setActive: SetState<T>;
|
|
25
25
|
waveEffectPalette?: PaletteProp;
|
|
26
26
|
}
|