@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.
@@ -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?: FormValue[];
7
- items: FormValue[];
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<FormValue[]>;
16
+ setActive?: SetState<T[]>;
17
17
  shape?: ShapeProp;
18
18
  template?: React.JSX.Element;
19
19
  }
20
- declare const CheckboxAll: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLInputElement>>;
21
- export default CheckboxAll;
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?: FormValue[];
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<FormValue[]>;
16
+ setActive?: SetState<T[]>;
17
17
  shape?: ShapeProp;
18
18
  template?: React.JSX.Element;
19
19
  }
20
- declare const CheckboxGroup: React.FC<Props>;
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,
@@ -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?: FormValue[];
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<FormValue[]>;
19
+ setActive?: SetState<T[]>;
20
20
  setChecked?: SetState<boolean>;
21
21
  shape?: ShapeProp;
22
22
  template?: React.JSX.Element;
23
- value?: FormValue;
23
+ value?: T;
24
24
  }
25
- declare const Checkbox: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLInputElement>>;
26
- export default Checkbox;
25
+ declare const _default: <T extends FormValue = FormValue>(props: Props<T> & React.RefAttributes<HTMLInputElement>) => React.ReactElement | null;
26
+ export default _default;
@@ -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: FormValue;
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<FormValue>;
16
+ setActive: SetState<T>;
17
17
  template?: React.JSX.Element;
18
18
  }
19
- declare const RadioGroup: React.FC<Props>;
19
+ declare const RadioGroup: <T extends FormValue = FormValue>(props: Props<T>) => React.JSX.Element;
20
20
  export default RadioGroup;
@@ -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?: FormValue;
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<FormValue>;
17
+ setActive?: SetState<T>;
18
18
  template?: React.JSX.Element;
19
- value: FormValue;
19
+ value: T;
20
20
  }
21
- declare const Radio: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLInputElement>>;
22
- export default Radio;
21
+ declare const _default: <T extends FormValue = FormValue>(props: Props<T> & React.RefAttributes<HTMLInputElement>) => React.ReactElement | null;
22
+ export default _default;
@@ -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
- export interface Props extends GenericProps, Partial<ResponsiveProp<'searchInputSize', SizeProp>> {
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 SelectBox: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLInputElement>>;
15
- export default SelectBox;
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 Select: React.ForwardRefExoticComponent<GenericProps & React.RefAttributes<HTMLInputElement>>;
5
- export default Select;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smart-react-components/ui",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "license": "MIT",
5
5
  "main": "index.js",
6
6
  "description": "SRC UI includes React and Styled components.",
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: FormValue | FormValue[];
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<FormValue | FormValue[]>;
24
+ setActive: SetState<T>;
25
25
  waveEffectPalette?: PaletteProp;
26
26
  }