@nulogy/components 10.0.2 → 10.0.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.
@@ -1,23 +1,24 @@
1
1
  import React from "react";
2
2
  import type { ReactDatePickerProps } from "react-datepicker";
3
- import { FieldProps } from "../Form/Field";
4
3
  import { ComponentSize } from "../NDSProvider/ComponentSizeContext";
5
- type DatePickerProps = Omit<FieldProps, "size"> & {
4
+ import { InputFieldProps } from "../Input/InputField";
5
+ import { FieldProps } from "../Form/Field";
6
+ type OmittedFieldProps = "size" | "onChange" | "onBlur" | "onFocus";
7
+ interface DatePickerProps extends Omit<FieldProps, OmittedFieldProps> {
6
8
  size?: ComponentSize;
7
- selected?: any;
9
+ onChange?: (date: Date) => void;
10
+ onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
11
+ onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;
8
12
  dateFormat?: string;
9
- onChange?: ReactDatePickerProps["onChange"];
10
- onBlur?: ReactDatePickerProps["onBlur"];
11
- onFocus?: ReactDatePickerProps["onFocus"];
12
- onInputChange?: (...args: any[]) => any;
13
- inputProps?: any;
13
+ onInputChange?: (value: string) => void;
14
+ inputProps?: InputFieldProps;
14
15
  errorMessage?: string;
15
16
  errorList?: string[];
16
- minDate?: any;
17
- maxDate?: any;
18
- highlightDates?: {}[];
17
+ minDate?: Date;
18
+ maxDate?: Date;
19
+ highlightDates?: ReactDatePickerProps["highlightDates"];
19
20
  disableFlipping?: boolean;
20
- className?: string;
21
- };
22
- declare const DatePicker: React.FC<DatePickerProps>;
21
+ selected?: Date;
22
+ }
23
+ declare const DatePicker: React.ForwardRefExoticComponent<Omit<DatePickerProps, "ref"> & React.RefAttributes<unknown>>;
23
24
  export default DatePicker;
@@ -1,20 +1,17 @@
1
1
  import React from "react";
2
+ import { InputFieldProps } from "../Input/InputField";
2
3
  import { ComponentSize } from "../NDSProvider/ComponentSizeContext";
3
- type DatePickerInputProps = {
4
+ interface InputProps extends InputFieldProps {
5
+ placeholder?: string;
6
+ }
7
+ type DatePickerInputProps = Omit<React.ComponentPropsWithRef<"input">, "size"> & {
4
8
  size?: ComponentSize;
5
- onBlur?: React.ComponentPropsWithRef<"input">["onBlur"];
6
- onFocus?: React.ComponentPropsWithRef<"input">["onFocus"];
7
- onClick?: (...args: any[]) => any;
8
- onChange?: (...args: any[]) => any;
9
- onUpKeyPress?: (...args: any[]) => any;
10
- onDownKeyPress?: (...args: any[]) => any;
11
- onEnterKeyPress?: (...args: any[]) => any;
12
- onSpaceKeyPress?: (...args: any[]) => any;
13
- value?: string;
14
- onInputChange: (...args: any[]) => any;
15
9
  dateFormat?: string;
16
- inputProps?: any;
17
- "aria-label"?: string;
10
+ inputProps?: InputProps;
11
+ onInputChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
12
+ onUpKeyPress: (e: React.KeyboardEvent<HTMLInputElement>) => void;
13
+ onDownKeyPress: (e: React.KeyboardEvent<HTMLInputElement>) => void;
14
+ onEnterKeyPress: (e: React.KeyboardEvent<HTMLInputElement>) => void;
18
15
  };
19
- declare const DatePickerInput: React.FC<DatePickerInputProps>;
16
+ declare const DatePickerInput: React.ForwardRefExoticComponent<Omit<DatePickerInputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
20
17
  export default DatePickerInput;
@@ -1,5 +1,4 @@
1
1
  import React from "react";
2
- import { TextAlignProps } from "styled-system";
3
2
  import { ComponentSize } from "../NDSProvider/ComponentSizeContext";
4
3
  type NativeInputProps = Omit<React.ComponentPropsWithRef<"input">, "size">;
5
4
  export type InputFieldProps = NativeInputProps & {
@@ -9,15 +8,16 @@ export type InputFieldProps = NativeInputProps & {
9
8
  error?: boolean;
10
9
  labelText?: string;
11
10
  requirementText?: string;
12
- helpText?: React.ReactNode;
11
+ helpText?: string;
13
12
  suffix?: string;
14
13
  prefix?: string;
15
14
  suffixWidth?: string;
16
15
  prefixWidth?: string;
17
- suffixAlignment?: TextAlignProps["textAlign"];
18
- prefixAlignment?: TextAlignProps["textAlign"];
16
+ suffixAlignment?: "left" | "right";
17
+ prefixAlignment?: "left" | "right";
19
18
  iconSize?: string;
20
19
  inputWidth?: string;
21
20
  };
22
21
  export declare const InputField: React.FC<InputFieldProps>;
22
+ export declare const InputFieldDefaultProps: InputFieldProps;
23
23
  export {};
@@ -301,13 +301,13 @@ declare const TimePickerInput: import("styled-components").StyledComponent<impor
301
301
  error?: boolean;
302
302
  labelText?: string;
303
303
  requirementText?: string;
304
- helpText?: import("react").ReactNode;
304
+ helpText?: string;
305
305
  suffix?: string;
306
306
  prefix?: string;
307
307
  suffixWidth?: string;
308
308
  prefixWidth?: string;
309
- suffixAlignment?: import("styled-system").ResponsiveValue<import("csstype").Property.TextAlign, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>>;
310
- prefixAlignment?: import("styled-system").ResponsiveValue<import("csstype").Property.TextAlign, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>>;
309
+ suffixAlignment?: "left" | "right";
310
+ prefixAlignment?: "left" | "right";
311
311
  iconSize?: string;
312
312
  inputWidth?: string;
313
313
  } & {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nulogy/components",
3
- "version": "10.0.2",
3
+ "version": "10.0.3",
4
4
  "description": "Component library for the Nulogy Design System - http://nulogy.design",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -1,50 +0,0 @@
1
- export namespace InputFieldPropTypes {
2
- const icon: PropTypes.Requireable<string>;
3
- const disabled: PropTypes.Requireable<boolean>;
4
- const error: PropTypes.Requireable<boolean>;
5
- const required: PropTypes.Requireable<boolean>;
6
- const labelText: PropTypes.Requireable<string>;
7
- const requirementText: PropTypes.Requireable<string>;
8
- const helpText: PropTypes.Requireable<string>;
9
- const suffix: PropTypes.Requireable<string>;
10
- const prefix: PropTypes.Requireable<string>;
11
- const suffixWidth: PropTypes.Requireable<string>;
12
- const prefixWidth: PropTypes.Requireable<string>;
13
- const suffixAlignment: PropTypes.Requireable<string>;
14
- const prefixAlignment: PropTypes.Requireable<string>;
15
- const iconSize: PropTypes.Requireable<string>;
16
- const inputWidth: PropTypes.Requireable<string>;
17
- }
18
- export namespace InputFieldDefaultProps {
19
- const disabled_1: boolean;
20
- export { disabled_1 as disabled };
21
- const required_1: boolean;
22
- export { required_1 as required };
23
- const error_1: boolean;
24
- export { error_1 as error };
25
- const labelText_1: any;
26
- export { labelText_1 as labelText };
27
- const helpText_1: any;
28
- export { helpText_1 as helpText };
29
- const requirementText_1: any;
30
- export { requirementText_1 as requirementText };
31
- const suffix_1: any;
32
- export { suffix_1 as suffix };
33
- const suffixWidth_1: any;
34
- export { suffixWidth_1 as suffixWidth };
35
- const suffixAlignment_1: string;
36
- export { suffixAlignment_1 as suffixAlignment };
37
- const prefix_1: any;
38
- export { prefix_1 as prefix };
39
- const prefixWidth_1: any;
40
- export { prefixWidth_1 as prefixWidth };
41
- const prefixAlignment_1: string;
42
- export { prefixAlignment_1 as prefixAlignment };
43
- const icon_1: any;
44
- export { icon_1 as icon };
45
- const iconSize_1: any;
46
- export { iconSize_1 as iconSize };
47
- const inputWidth_1: any;
48
- export { inputWidth_1 as inputWidth };
49
- }
50
- import PropTypes from "prop-types";