@nulogy/components 13.4.0 → 13.5.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/dist/main.js +11533 -1451
- package/dist/main.module.js +11592 -1511
- package/dist/src/DatePickers/DatePicker.d.ts +2 -3
- package/dist/src/DatePickers/MonthPicker.d.ts +4 -3
- package/dist/src/DatePickers/WeekPicker.d.ts +27 -0
- package/dist/src/DatePickers/custom/weekPickerStyles.d.ts +5 -0
- package/dist/src/DatePickers/index.d.ts +1 -0
- package/dist/src/DatePickers/shared/{BasePicker.d.ts → components/BasePicker.d.ts} +5 -4
- package/dist/src/DatePickers/{components → shared/components}/DatePickerInput.d.ts +3 -2
- package/dist/src/DatePickers/shared/helpers.d.ts +4 -0
- package/dist/src/DatePickers/shared/types.d.ts +1 -1
- package/dist/src/DatePickers/stories/DatePicker.story.d.ts +7 -42
- package/dist/src/DatePickers/stories/MonthPicker.story.d.ts +10 -0
- package/dist/src/DatePickers/stories/WeekPicker.story.d.ts +12 -0
- package/dist/src/NDSProvider/LocaleContext.d.ts +1 -1
- package/dist/src/Toggle/Toggle.d.ts +4 -7
- package/dist/src/Toggle/ToggleButton.d.ts +1 -1
- package/dist/src/Tooltip/Tooltip.story.d.ts +1 -0
- package/dist/src/index.d.ts +1 -1
- package/dist/src/utils/datePickerLocales.d.ts +1 -1
- package/package.json +1 -2
- package/dist/src/DatePickers/stories/DatePicker.month.story.d.ts +0 -35
- /package/dist/src/DatePickers/{components → custom}/MonthPickerHeader.d.ts +0 -0
- /package/dist/src/DatePickers/{components → shared/components}/DatePickerHeader.d.ts +0 -0
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
declare const DatePicker: React.ForwardRefExoticComponent<Omit<BaseDatePickerProps, "ref"> & React.RefAttributes<ReactDatePicker<never, undefined>>>;
|
|
2
|
+
import { DatePickerProps } from "./shared/types";
|
|
3
|
+
declare const DatePicker: React.ForwardRefExoticComponent<Omit<DatePickerProps, "ref"> & React.RefAttributes<ReactDatePicker>>;
|
|
5
4
|
export default DatePicker;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
declare const
|
|
2
|
+
import { DatePickerProps } from "./shared/types";
|
|
3
|
+
export declare const DEFAULT_MONTH_FORMAT = "yyyy-MMM";
|
|
4
|
+
export declare const DEFAULT_PLACEHOLDER = "YYYY-Mon";
|
|
5
|
+
declare const MonthPicker: React.ForwardRefExoticComponent<Omit<DatePickerProps, "ref"> & React.RefAttributes<ReactDatePicker>>;
|
|
5
6
|
export default MonthPicker;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { FieldProps } from "../Form/Field";
|
|
3
|
+
import { InputFieldProps } from "../Input/InputField";
|
|
4
|
+
type OmittedFieldProps = "onChange" | "onBlur" | "onFocus";
|
|
5
|
+
interface WeekRange {
|
|
6
|
+
startDate: Date;
|
|
7
|
+
endDate: Date;
|
|
8
|
+
weekNumber: number;
|
|
9
|
+
year: number;
|
|
10
|
+
}
|
|
11
|
+
interface WeekPickerProps extends Omit<FieldProps, OmittedFieldProps> {
|
|
12
|
+
selected?: Date | null;
|
|
13
|
+
onChange?: (weekRange: WeekRange) => void;
|
|
14
|
+
onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
15
|
+
onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
16
|
+
onInputChange?: (value: string) => void;
|
|
17
|
+
dateFormat?: string;
|
|
18
|
+
inputProps?: InputFieldProps;
|
|
19
|
+
errorMessage?: string;
|
|
20
|
+
errorList?: string[];
|
|
21
|
+
minDate?: Date;
|
|
22
|
+
maxDate?: Date;
|
|
23
|
+
locale?: string;
|
|
24
|
+
disableFlipping?: boolean;
|
|
25
|
+
}
|
|
26
|
+
declare const WeekPicker: React.ForwardRefExoticComponent<Omit<WeekPickerProps, "ref"> & React.RefAttributes<unknown>>;
|
|
27
|
+
export default WeekPicker;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
interface BasePickerProps extends
|
|
2
|
+
import { ReactDatePickerCustomHeaderProps } from "react-datepicker";
|
|
3
|
+
import { DatePickerProps } from "../types";
|
|
4
|
+
interface BasePickerProps extends DatePickerProps {
|
|
5
5
|
defaultFormat: string;
|
|
6
6
|
disabledKeyboardNavigation?: boolean;
|
|
7
7
|
defaultPlaceholder: string;
|
|
8
8
|
showMonthYearPicker?: boolean;
|
|
9
|
+
showWeekNumbers?: boolean;
|
|
9
10
|
renderHeader: (props: ReactDatePickerCustomHeaderProps) => JSX.Element;
|
|
10
11
|
onUpKeyPress?: () => void;
|
|
11
12
|
onDownKeyPress?: () => void;
|
|
12
13
|
onEnterKeyPress?: () => void;
|
|
13
14
|
}
|
|
14
|
-
export declare const BasePicker: React.ForwardRefExoticComponent<Omit<BasePickerProps, "ref"> & React.RefAttributes<ReactDatePicker
|
|
15
|
+
export declare const BasePicker: React.ForwardRefExoticComponent<Omit<BasePickerProps, "ref"> & React.RefAttributes<ReactDatePicker>>;
|
|
15
16
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { InputFieldProps } from "
|
|
3
|
-
import { ComponentVariant } from "
|
|
2
|
+
import { InputFieldProps } from "../../../Input/InputField";
|
|
3
|
+
import { ComponentVariant } from "../../../NDSProvider/ComponentVariantContext";
|
|
4
4
|
interface InputProps extends InputFieldProps {
|
|
5
5
|
placeholder?: string;
|
|
6
6
|
}
|
|
@@ -8,6 +8,7 @@ type DatePickerInputProps = React.ComponentPropsWithRef<"input"> & {
|
|
|
8
8
|
variant?: ComponentVariant;
|
|
9
9
|
dateFormat?: string;
|
|
10
10
|
inputProps?: InputProps;
|
|
11
|
+
locale: string;
|
|
11
12
|
onInputChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
12
13
|
onUpKeyPress?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
13
14
|
onDownKeyPress?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
@@ -3,7 +3,7 @@ import { InputFieldProps } from "../../Input/InputField";
|
|
|
3
3
|
import { ReactDatePickerProps } from "react-datepicker";
|
|
4
4
|
import { FieldProps } from "../../Form/Field";
|
|
5
5
|
type OmittedFieldProps = "onChange" | "onBlur" | "onFocus";
|
|
6
|
-
export interface
|
|
6
|
+
export interface DatePickerProps extends Omit<FieldProps, OmittedFieldProps> {
|
|
7
7
|
className?: string;
|
|
8
8
|
dateFormat?: string;
|
|
9
9
|
disableFlipping?: boolean;
|
|
@@ -3,45 +3,10 @@ declare const _default: {
|
|
|
3
3
|
title: string;
|
|
4
4
|
};
|
|
5
5
|
export default _default;
|
|
6
|
-
export declare const Default:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export declare const
|
|
13
|
-
(): React.JSX.Element;
|
|
14
|
-
story: {
|
|
15
|
-
name: string;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export declare const WithCustomPlaceholder: {
|
|
19
|
-
(): React.JSX.Element;
|
|
20
|
-
story: {
|
|
21
|
-
name: string;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
export declare const WithErrorState: {
|
|
25
|
-
(): React.JSX.Element;
|
|
26
|
-
story: {
|
|
27
|
-
name: string;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
export declare const WithMinAndMaxDate: {
|
|
31
|
-
(): React.JSX.Element;
|
|
32
|
-
story: {
|
|
33
|
-
name: string;
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
export declare const DisableFlipping: {
|
|
37
|
-
(): React.JSX.Element;
|
|
38
|
-
story: {
|
|
39
|
-
name: string;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
export declare const UsingRefToControlFocus: {
|
|
43
|
-
(): React.JSX.Element;
|
|
44
|
-
story: {
|
|
45
|
-
name: string;
|
|
46
|
-
};
|
|
47
|
-
};
|
|
6
|
+
export declare const Default: () => React.JSX.Element;
|
|
7
|
+
export declare const WithCustomDateFormat: () => React.JSX.Element;
|
|
8
|
+
export declare const WithCustomPlaceholder: () => React.JSX.Element;
|
|
9
|
+
export declare const WithErrorState: () => React.JSX.Element;
|
|
10
|
+
export declare const WithMinAndMaxDate: () => React.JSX.Element;
|
|
11
|
+
export declare const DisableFlipping: () => React.JSX.Element;
|
|
12
|
+
export declare const UsingRefToControlFocus: () => React.JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
};
|
|
5
|
+
export default _default;
|
|
6
|
+
export declare const Default: () => React.JSX.Element;
|
|
7
|
+
export declare const WithPlaceholder: () => React.JSX.Element;
|
|
8
|
+
export declare const Disabled: () => React.JSX.Element;
|
|
9
|
+
export declare const WithDefaultValue: () => React.JSX.Element;
|
|
10
|
+
export declare const WithMinMaxDate: () => React.JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
};
|
|
5
|
+
export default _default;
|
|
6
|
+
export declare const Default: () => React.JSX.Element;
|
|
7
|
+
export declare const WithError: () => React.JSX.Element;
|
|
8
|
+
export declare const WithMinMaxDates: () => React.JSX.Element;
|
|
9
|
+
export declare const WithCustomDateFormat: () => React.JSX.Element;
|
|
10
|
+
export declare const WithPreselectedDate: () => React.JSX.Element;
|
|
11
|
+
export declare const WithCustomLocale: () => React.JSX.Element;
|
|
12
|
+
export declare const Disabled: () => React.JSX.Element;
|
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
export declare const LocaleContext: React.Context<{
|
|
3
3
|
locale: string;
|
|
4
4
|
}>;
|
|
5
|
-
export declare const useLocale: () => {
|
|
5
|
+
export declare const useLocale: (locale?: string) => {
|
|
6
6
|
locale: string;
|
|
7
7
|
};
|
|
8
8
|
export declare const LocaleContextProvider: ({ locale, children }: {
|
|
@@ -3,7 +3,7 @@ import { SpaceProps } from "styled-system";
|
|
|
3
3
|
import { ComponentVariant } from "../NDSProvider/ComponentVariantContext";
|
|
4
4
|
import { DefaultNDSThemeType } from "../theme";
|
|
5
5
|
declare const ToggleComponent: React.ForwardRefExoticComponent<SpaceProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & {
|
|
6
|
-
onChange?: (
|
|
6
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
7
7
|
variant?: ComponentVariant;
|
|
8
8
|
toggled?: boolean;
|
|
9
9
|
disabled?: boolean;
|
|
@@ -16,15 +16,12 @@ declare const ToggleComponent: React.ForwardRefExoticComponent<SpaceProps<Requir
|
|
|
16
16
|
labelText?: string;
|
|
17
17
|
requirementText?: string;
|
|
18
18
|
error?: boolean;
|
|
19
|
-
onClick?:
|
|
20
|
-
innerRef?:
|
|
19
|
+
onClick?: (e: React.MouseEvent) => void;
|
|
20
|
+
innerRef?: React.Ref<HTMLInputElement>;
|
|
21
21
|
name?: string;
|
|
22
22
|
theme?: DefaultNDSThemeType;
|
|
23
23
|
"data-testid"?: string;
|
|
24
24
|
} & {
|
|
25
25
|
defaultToggled?: boolean;
|
|
26
|
-
|
|
27
|
-
} & React.RefAttributes<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & {
|
|
28
|
-
ref?: React.Ref<HTMLInputElement>;
|
|
29
|
-
}>>;
|
|
26
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
30
27
|
export default ToggleComponent;
|
|
@@ -7,5 +7,5 @@ type ToggleButtonProps = React.ComponentPropsWithRef<"input"> & {
|
|
|
7
7
|
name?: string;
|
|
8
8
|
theme?: DefaultNDSThemeType;
|
|
9
9
|
};
|
|
10
|
-
declare const ToggleButton: React.ForwardRefExoticComponent<Omit<ToggleButtonProps, "ref"> & React.RefAttributes<
|
|
10
|
+
declare const ToggleButton: React.ForwardRefExoticComponent<Omit<ToggleButtonProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
11
11
|
export default ToggleButton;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export { Button, ControlIcon, DangerButton, IconicButton, PrimaryButton, QuietBu
|
|
|
13
13
|
export { ButtonGroup } from "./ButtonGroup";
|
|
14
14
|
export { Card, CardSet } from "./Card";
|
|
15
15
|
export { Checkbox, CheckboxGroup } from "./Checkbox";
|
|
16
|
-
export { DatePicker, MonthPicker } from "./DatePickers";
|
|
16
|
+
export { DatePicker, MonthPicker, WeekPicker } from "./DatePickers";
|
|
17
17
|
export { DateRange } from "./DateRange";
|
|
18
18
|
export { DescriptionDetails, DescriptionList, DescriptionTerm } from "./DescriptionList";
|
|
19
19
|
export { Divider } from "./Divider";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export function registerDatePickerLocales():
|
|
1
|
+
export function registerDatePickerLocales(): any[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nulogy/components",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.5.1",
|
|
4
4
|
"description": "Component library for the Nulogy Design System - http://nulogy.design",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -95,7 +95,6 @@
|
|
|
95
95
|
"@types/jest": "^29.5.1",
|
|
96
96
|
"@types/node": "^14.0.14",
|
|
97
97
|
"@types/react": "^17.0.39",
|
|
98
|
-
"@types/react-datepicker": "^4.19.6",
|
|
99
98
|
"@types/react-dom": "^17.0.20",
|
|
100
99
|
"@types/react-router-dom": "5.3.0",
|
|
101
100
|
"@typescript-eslint/eslint-plugin": "^4.0.0",
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
declare const _default: {
|
|
3
|
-
title: string;
|
|
4
|
-
};
|
|
5
|
-
export default _default;
|
|
6
|
-
export declare const Default: {
|
|
7
|
-
(): React.JSX.Element;
|
|
8
|
-
story: {
|
|
9
|
-
name: string;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
export declare const WithPlaceholder: {
|
|
13
|
-
(): React.JSX.Element;
|
|
14
|
-
story: {
|
|
15
|
-
name: string;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export declare const Disabled: {
|
|
19
|
-
(): React.JSX.Element;
|
|
20
|
-
story: {
|
|
21
|
-
name: string;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
export declare const WithDefaultValue: {
|
|
25
|
-
(): React.JSX.Element;
|
|
26
|
-
story: {
|
|
27
|
-
name: string;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
export declare const WithMinMaxDate: {
|
|
31
|
-
(): React.JSX.Element;
|
|
32
|
-
story: {
|
|
33
|
-
name: string;
|
|
34
|
-
};
|
|
35
|
-
};
|
|
File without changes
|
|
File without changes
|