@js-smart/react-kit 5.18.1 → 5.19.0

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.
@@ -12,6 +12,7 @@ type DismissibleAlertProps = {
12
12
  dismissible?: boolean;
13
13
  dismissOnTimeOut?: boolean;
14
14
  dismissTimeOut?: number;
15
+ ariaLabel?: string;
15
16
  };
16
17
  export declare function DismissibleAlert(props: Readonly<DismissibleAlertProps>): import("react/jsx-runtime").JSX.Element;
17
18
  export {};
@@ -4,6 +4,7 @@ interface Props {
4
4
  linkText?: string;
5
5
  target?: string;
6
6
  children?: React.ReactNode;
7
+ ariaLabel?: string;
7
8
  }
8
9
  /**
9
10
  * Reusable custom Next.js 13 Link component.
@@ -4,6 +4,7 @@ interface Props {
4
4
  linkText: string;
5
5
  target: string;
6
6
  children?: React.ReactNode;
7
+ ariaLabel?: string;
7
8
  }
8
9
  /**
9
10
  * Reusable component to open a link in new tab and show open new icon at the end
@@ -1,5 +1,5 @@
1
- import { default as React } from 'react';
2
1
  import { SxProps, Theme } from '@mui/material';
2
+ import { default as React } from 'react';
3
3
  /**
4
4
  * Reusable Success Button component properties
5
5
  *
@@ -12,11 +12,12 @@ interface CancelButtonProps {
12
12
  name?: string;
13
13
  dataCy?: string;
14
14
  sx?: SxProps<Theme>;
15
- type?: "button" | "submit" | "reset";
16
- variant?: "text" | "outlined" | "contained";
17
- color?: "inherit" | "primary" | "secondary" | "success" | "error" | "info" | "warning";
15
+ type?: 'button' | 'submit' | 'reset';
16
+ variant?: 'text' | 'outlined' | 'contained';
17
+ color?: 'inherit' | 'primary' | 'secondary' | 'success' | 'error' | 'info' | 'warning';
18
18
  onClick: () => void;
19
19
  startIcon?: React.ReactNode;
20
+ ariaLabel?: string;
20
21
  }
21
22
  /**
22
23
  * Reusable Cancel Button component
@@ -11,6 +11,7 @@ interface DeleteButtonProps {
11
11
  dataCy?: string;
12
12
  startIcon?: React.ReactNode;
13
13
  onClick: () => void;
14
+ ariaLabel?: string;
14
15
  }
15
16
  export declare function DeleteButton(props: DeleteButtonProps): import("react/jsx-runtime").JSX.Element;
16
17
  export {};
@@ -3,6 +3,7 @@ interface EditIconButtonProps {
3
3
  tooltipTitle: string;
4
4
  onClick: React.Dispatch<React.SetStateAction<boolean>>;
5
5
  color?: 'inherit' | 'default' | 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning';
6
+ ariaLabel?: string;
6
7
  }
7
8
  export declare function EditIconButton(props: Readonly<EditIconButtonProps>): import("react/jsx-runtime").JSX.Element;
8
9
  export {};
@@ -15,6 +15,7 @@ interface SuccessButtonProps {
15
15
  onClick: () => void;
16
16
  startIcon?: React.ReactNode;
17
17
  dataCy?: string;
18
+ ariaLabel?: string;
18
19
  }
19
20
  /**
20
21
  * Reusable Excel Button component
@@ -5,6 +5,7 @@ interface GoBackButtonProps {
5
5
  children?: React.ReactNode;
6
6
  navigate: NavigateFunction;
7
7
  color?: "inherit" | "primary" | "secondary" | "success" | "error" | "info" | "warning";
8
+ ariaLabel?: string;
8
9
  }
9
10
  export declare function GoBackButton(props: GoBackButtonProps): import("react/jsx-runtime").JSX.Element;
10
11
  export {};
@@ -17,6 +17,7 @@ interface HistoryButtonProps {
17
17
  startIcon?: React.ReactNode;
18
18
  variant?: 'text' | 'outlined' | 'contained';
19
19
  color?: 'inherit' | 'primary' | 'secondary' | 'success' | 'error' | 'info' | 'warning';
20
+ ariaLabel?: string;
20
21
  }
21
22
  /**
22
23
  * Reusable History Button component
@@ -1,5 +1,5 @@
1
- import { default as React } from 'react';
2
1
  import { SxProps, Theme } from '@mui/material';
2
+ import { default as React } from 'react';
3
3
  /**
4
4
  * Reusable Success Button component properties
5
5
  *
@@ -8,15 +8,16 @@ import { SxProps, Theme } from '@mui/material';
8
8
  */
9
9
  interface Props {
10
10
  children?: React.ReactNode;
11
- type?: "button" | "submit" | "reset";
11
+ type?: 'button' | 'submit' | 'reset';
12
12
  name?: string;
13
13
  loading: boolean;
14
14
  dataCy?: string;
15
15
  startIcon?: React.ReactNode;
16
16
  sx?: SxProps<Theme>;
17
17
  onClick?: () => void;
18
- variant?: "text" | "outlined" | "contained";
19
- color?: "inherit" | "primary" | "secondary" | "success" | "error" | "info" | "warning";
18
+ variant?: 'text' | 'outlined' | 'contained';
19
+ color?: 'inherit' | 'primary' | 'secondary' | 'success' | 'error' | 'info' | 'warning';
20
+ ariaLabel?: string;
20
21
  }
21
22
  /**
22
23
  * Reusable Success Loading Button
@@ -9,6 +9,7 @@ interface ManageButtonProps {
9
9
  startIcon?: React.ReactNode;
10
10
  onClick: () => void;
11
11
  children?: React.ReactNode;
12
+ ariaLabel?: string;
12
13
  }
13
14
  export declare function ManageButton(props: ManageButtonProps): import("react/jsx-runtime").JSX.Element;
14
15
  export {};
@@ -17,6 +17,7 @@ interface SuccessButtonProps {
17
17
  startIcon?: React.ReactNode;
18
18
  variant?: "text" | "outlined" | "contained";
19
19
  color?: "inherit" | "primary" | "secondary" | "success" | "error" | "info" | "warning";
20
+ ariaLabel?: string;
20
21
  }
21
22
  /**
22
23
  * Reusable Success Button component
@@ -10,6 +10,19 @@ export declare enum SystemConfig {
10
10
  SYSTEM_DATE_FORMAT = "MM/dd/yyyy",
11
11
  SYSTEM_DATE_TIME_FORMAT = "MM/dd/yyyy hh:mm:ss a",
12
12
  ISO_DATE_FORMAT = "yyyy-MM-dd",
13
- SYSTEM_COOKIE_TIMEOUT_HOURS = 24,
14
13
  SYSTEM_COOKIE_TIMEOUT_MILLI_SECONDS = 3600000
15
14
  }
15
+ /**
16
+ * Temporal Date Format Options
17
+ *
18
+ * @author Pavan Kumar Jadda
19
+ * @since 1.10.2
20
+ */
21
+ export declare const TEMPORAL_DATE_FORMAT: Intl.DateTimeFormatOptions;
22
+ /**
23
+ * Temporal Date Time Format Options
24
+ *
25
+ * @author Pavan Kumar Jadda
26
+ * @since 1.10.2
27
+ */
28
+ export declare const TEMPORAL_DATE_TIME_FORMAT: Intl.DateTimeFormatOptions;
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Format date using Temporal API to App Date Time Format
3
+ *
4
+ * @author Pavan Kumar Jadda
5
+ * @since 1.10.2
6
+ */
7
+ export declare const formatToAppDateTime: (date: Date | string | undefined) => string;
8
+ /**
9
+ * Format date using Temporal API to App Date Format
10
+ *
11
+ * @author Pavan Kumar Jadda
12
+ * @since 1.10.2
13
+ */
14
+ export declare const formatToAppDate: (date: Date | string | undefined) => string;
15
+ /**
16
+ * Format ISO formatted date to App Date Format
17
+ *
18
+ * @param date - The ISO formatted date to format
19
+ * @returns The formatted date
20
+ *
21
+ * @author Pavan Kumar Jadda
22
+ * @since 1.10.2
23
+ */
24
+ export declare const formatIsoToAppDate: (date: string | undefined) => string;
25
+ /**
26
+ * Format old date to ISO format date string (YYYY-MM-DD)
27
+ *
28
+ * @param date - The old date to format
29
+ * @returns The formatted date
30
+ *
31
+ * @author Pavan Kumar Jadda
32
+ * @since 1.10.2
33
+ */
34
+ export declare const formatOldDateToIsoString: (date: Date | string | undefined | null) => string;
35
+ /**
36
+ * Format old date to ISO format date string (YYYY-MM-DD)
37
+ *
38
+ * @param date - The old date to format
39
+ * @returns The formatted date
40
+ *
41
+ * @author Pavan Kumar Jadda
42
+ * @since 0.2.30
43
+ */
44
+ export declare const formatOldDateToIsoDate: (date: Date | string | undefined) => string;
45
+ /**
46
+ * Parse ISO formatted date to old date object
47
+ *
48
+ * @param date - The ISO formatted date to parse
49
+ * @returns The parsed date
50
+ *
51
+ * @author Pavan Kumar Jadda
52
+ * @since 1.10.2
53
+ */
54
+ export declare const parseIsoDate: (date: string | undefined | null) => Date | null;
55
+ /**
56
+ * Format Unix time to old date object
57
+ *
58
+ * @param date - The Unix time to format
59
+ * @returns The formatted date
60
+ *
61
+ * @author Pavan Kumar Jadda
62
+ * @since 1.10.2
63
+ */
64
+ export declare const formatUnixTimeToOldDate: (date: number | string | undefined) => Date | undefined;
65
+ /**
66
+ * Check if date1 is after date2
67
+ *
68
+ * @param date1 - The first date to compare
69
+ * @param date2 - The second date to compare
70
+ * @returns True if date1 is after date2, false otherwise
71
+ *
72
+ * @author Pavan Kumar Jadda
73
+ * @since 1.10.2
74
+ */
75
+ export declare const isAfter: (date1: Date | string | undefined, date2: Date | string | undefined) => boolean;
package/package.json CHANGED
@@ -1,46 +1,46 @@
1
1
  {
2
- "name": "@js-smart/react-kit",
3
- "private": false,
4
- "version": "5.18.1",
5
- "main": "./index.js",
6
- "types": "./index.d.ts",
7
- "publishConfig": {
8
- "access": "public"
9
- },
10
- "peerDependencies": {
11
- "@emotion/react": "^11.14.0",
12
- "@emotion/styled": "^11.14.1",
13
- "@mui/icons-material": "^7.3.1",
14
- "@mui/material": "^7.3.1",
15
- "date-fns": "^4.1.0",
16
- "react": "^18.3.1 || ^19.0.0",
17
- "react-dom": "^18.3.1 || ^19.0.0",
18
- "react-router-dom": "^7.8.0"
19
- },
20
- "exports": {
21
- ".": {
22
- "types": "./index.d.ts",
23
- "import": "./index.mjs",
24
- "require": "./index.js"
25
- }
26
- },
27
- "repository": {
28
- "type": "git",
29
- "url": "https://github.com/js-smart/react-kit"
30
- },
31
- "author": {
32
- "name": "Pavan Kumar Jadda",
33
- "email": "contact@pavankjadda.dev"
34
- },
35
- "keywords": [
36
- "react",
37
- "react-kit",
38
- "react-components",
39
- "react-utils",
40
- "typescript"
41
- ],
42
- "license": "MIT",
43
- "bugs": {
44
- "url": "https://github.com/js-smart/react-kit/issues"
45
- }
2
+ "name": "@js-smart/react-kit",
3
+ "private": false,
4
+ "version": "5.19.0",
5
+ "main": "./index.js",
6
+ "types": "./index.d.ts",
7
+ "publishConfig": {
8
+ "access": "public"
9
+ },
10
+ "peerDependencies": {
11
+ "@emotion/react": "^11.14.0",
12
+ "@emotion/styled": "^11.14.1",
13
+ "@mui/icons-material": "^7.3.1",
14
+ "@mui/material": "^7.3.1",
15
+ "date-fns": "^4.1.0",
16
+ "react": "^18.3.1 || ^19.0.0",
17
+ "react-dom": "^18.3.1 || ^19.0.0",
18
+ "react-router-dom": "^7.8.0"
19
+ },
20
+ "exports": {
21
+ ".": {
22
+ "types": "./index.d.ts",
23
+ "import": "./index.mjs",
24
+ "require": "./index.js"
25
+ }
26
+ },
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "https://github.com/js-smart/react-kit"
30
+ },
31
+ "author": {
32
+ "name": "Pavan Kumar Jadda",
33
+ "email": "contact@pavankjadda.dev"
34
+ },
35
+ "keywords": [
36
+ "react",
37
+ "react-kit",
38
+ "react-components",
39
+ "react-utils",
40
+ "typescript"
41
+ ],
42
+ "license": "MIT",
43
+ "bugs": {
44
+ "url": "https://github.com/js-smart/react-kit/issues"
45
+ }
46
46
  }
@@ -1,22 +0,0 @@
1
- /**
2
- * Sets Cookie expiration to 24 hours. By default, server sets 60 minutes expiration but after each API request it extends to another 60 minutes. In client side set 24 hours as expiration date,
3
- * if the user hasn't refreshed web page in 60 minutes, they would get HTTP 401 isError and redirected to login page. And redirect URL will be stored in cookie
4
- *
5
- * @author Pavan Kumar Jadda
6
- * @since 0.2.30
7
- */
8
- export declare const setCookieExpirationDate: () => Date;
9
- /**
10
- * Convert String format browser Date Time to ISO Date
11
- *
12
- * @author Pavan Kumar Jadda
13
- * @since 0.2.30
14
- */
15
- export declare const convertToIsoDate: (currentDateTime: string) => string;
16
- /**
17
- * Convert String format browser Date Time to ISO Date
18
- *
19
- * @author Pavan Kumar Jadda
20
- * @since 0.2.30
21
- */
22
- export declare const formatDate: (date: string | undefined, newFormat: string) => string;