jamespot-react-components 1.2.39 → 1.2.40

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,6 +1,6 @@
1
1
  import { DateFormat } from '../../utils/utils.date';
2
2
  export interface JRCDateProps {
3
- date?: string;
3
+ date?: number | string | Date;
4
4
  dateSeparator?: '/' | '-' | ' ';
5
5
  timeSeparator?: ':' | ' ';
6
6
  useHumanDisplay?: boolean;
@@ -1,8 +1,8 @@
1
- import { ModalVariant } from './types';
1
+ import { ModalOverflow, ModalVariant } from './types';
2
2
  export type ModalBorderRadius = 'medium' | 'small';
3
3
  export declare const JRCModalBox: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
4
4
  isFullHeight?: boolean;
5
- overflow?: "hidden" | "scroll" | "visible" | "auto";
5
+ overflow?: ModalOverflow;
6
6
  zIndex?: number;
7
7
  }, never>;
8
8
  export declare const JRCModalContainerFull: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
@@ -19,14 +19,14 @@ export declare const JRCModalContainer: import("styled-components").StyledCompon
19
19
  export declare const JRCModalTitle: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
20
20
  export declare const JRCModalOptions: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
21
21
  export declare const JRCModalBody: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
22
- modalOverflow?: "hidden" | "scroll" | "visible" | "auto";
23
- contentBackgroundColor?: boolean;
22
+ $modalOverflow?: ModalOverflow;
23
+ $contentBackgroundColor?: boolean;
24
24
  }, never>;
25
25
  export declare const JRCModalContentFull: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
26
26
  export declare const JRCModalHeader: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
27
- modalOverflow?: "hidden" | "scroll" | "visible" | "auto";
27
+ $modalOverflow?: ModalOverflow;
28
28
  }, never>;
29
29
  export declare const JRCModalFooter: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
30
- modalOverflow?: "hidden" | "scroll" | "visible" | "auto";
30
+ $modalOverflow?: ModalOverflow;
31
31
  }, never>;
32
32
  export declare const JRCModalClose: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
@@ -1,11 +1,12 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { ButtonColors } from '../JRCButton/types';
3
+ import { ModalOverflow } from './types';
3
4
  export type JRCModalContentBase = {
4
5
  title?: ReactNode;
5
6
  subTitle?: ReactNode;
6
7
  children?: ReactNode;
7
8
  options?: ReactNode;
8
- overflow?: 'visible' | 'hidden' | 'scroll' | 'auto';
9
+ overflow?: ModalOverflow;
9
10
  onClickIconClose?: () => void;
10
11
  dataCy?: string;
11
12
  };
@@ -1,10 +1,11 @@
1
1
  import { FormEvent } from 'react';
2
2
  import { JRCModalButtonType, JRCModalContentBase } from './JRCModalContent';
3
- export type JRCModalContentFormProps = JRCModalContentBase & {
3
+ export type JRCModalContentFormExtra = {
4
4
  buttons?: JRCModalFormButtonType[];
5
5
  onSubmit: (e: FormEvent) => Promise<void>;
6
6
  loading?: boolean;
7
7
  };
8
+ export type JRCModalContentFormProps = JRCModalContentBase & JRCModalContentFormExtra;
8
9
  export interface JRCModalFormButtonType extends JRCModalButtonType {
9
10
  isSubmit?: boolean;
10
11
  }
@@ -3,7 +3,7 @@ import { JRCModalButtonType } from '../JRCModalContent';
3
3
  import { JRCIconButtonProps } from '../../JRCIconButton/JRCIconButton';
4
4
  import { ModalVariant } from '../types';
5
5
  import { JRCModalFormButtonType } from '../JRCModalContentForm';
6
- type JRCModalBaseProps = {
6
+ export type JRCModalBaseProps = {
7
7
  title?: ReactNode;
8
8
  subTitle?: ReactNode;
9
9
  children?: ReactNode;
@@ -31,4 +31,3 @@ export type JRCModalFormProps = JRCModalBaseProps & {
31
31
  loading?: boolean;
32
32
  maxHeight?: string;
33
33
  };
34
- export {};
@@ -1 +1,2 @@
1
1
  export type ModalVariant = 'full-width' | 'full-screen' | 'full-height' | 'fixed-height';
2
+ export type ModalOverflow = 'hidden' | 'scroll' | 'visible' | 'auto';
@@ -1,32 +1,2 @@
1
- import { ReactNode, RefObject } from 'react';
2
- import { JRCIconButtonProps } from '../JRCIconButton/JRCIconButton';
3
- import { JRCButtonDropdownOptionProps } from '../JRCButtonDropdown/JRCButtonDropdown.types';
4
- /**
5
- * Type for JRCSidePanelModal props
6
- */
7
- export type JRCSidePanelModalProps = {
8
- open: boolean;
9
- closeHandler: () => void;
10
- children?: ReactNode;
11
- title?: ReactNode;
12
- showIconClose?: boolean;
13
- enableClickAwayCloseModal?: boolean;
14
- position: 'left' | 'right';
15
- footer?: ReactNode;
16
- removePadding?: boolean;
17
- inplace?: boolean;
18
- offsetTop?: number;
19
- optionsButton?: JRCButtonDropdownOptionProps[];
20
- zIndex?: number;
21
- fixedFooter?: boolean;
22
- extraTopButtons?: JRCIconButtonProps[];
23
- focusOnCloseRef?: RefObject<HTMLElement>;
24
- };
25
- /**
26
- * ℹ️⚠️
27
- * Used as a child component of {@link JRCContainer}, the modal will be mounted in a preset portal container.
28
- * Otherwise :
29
- * - The modal will be mounted where it is declared (no portal).
30
- * - The modal can be mounted in a specific portal container provided manually with the 'jrc-container-panel' id.
31
- */
32
- export declare const JRCSidePanelModal: import("react").ForwardRefExoticComponent<JRCSidePanelModalProps & import("react").RefAttributes<HTMLDivElement>>;
1
+ import { JRCSidePanelModalProps } from './types';
2
+ export declare const JRCSidePanelModal: import("react").ForwardRefExoticComponent<Omit<JRCSidePanelModalProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,5 +1,5 @@
1
- import { JRCSidePanelModalProps } from './JRCSidePanelModal';
2
1
  import { Meta } from '@storybook/react-webpack5';
2
+ import { JRCSidePanelModalProps } from './types';
3
3
  declare const _default: Meta;
4
4
  export default _default;
5
5
  export declare const SidePanelModal: import("storybook/internal/csf").AnnotatedStoryFn<import("@storybook/react-webpack5").ReactRenderer, JRCSidePanelModalProps>;
@@ -1,20 +1,20 @@
1
1
  export type ModalBorderRadius = 'medium' | 'small';
2
2
  export declare const JRCModalBox: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
3
- position?: "right" | "left";
4
- open?: boolean;
5
- inplace?: boolean;
6
- offsetTop?: number;
7
- zIndex?: number;
3
+ $position?: "right" | "left";
4
+ $open?: boolean;
5
+ $inPlace?: boolean;
6
+ $offsetTop?: number;
7
+ $zIndex?: number;
8
8
  }, never>;
9
9
  export declare const JRCModalTitle: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
10
10
  export declare const JRCModalOptions: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
11
11
  export declare const JRCModalContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
12
- removePadding?: boolean;
12
+ $removePadding?: boolean;
13
13
  }, never>;
14
14
  export declare const JRCModalHeader: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
15
- removePadding?: boolean;
15
+ $removePadding?: boolean;
16
16
  }, never>;
17
17
  export declare const JRCModalFooter: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
18
- $fixed?: boolean;
18
+ $sticky?: boolean;
19
19
  }, never>;
20
20
  export declare const JRCModalClose: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
@@ -0,0 +1,2 @@
1
+ import { JRCSidePanelModalFormProps } from './types';
2
+ export declare const JRCSidePanelModalForm: import("react").ForwardRefExoticComponent<Omit<JRCSidePanelModalFormProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,5 @@
1
+ import { Meta } from '@storybook/react-webpack5';
2
+ import { JRCSidePanelModalFormProps } from './types';
3
+ declare const _default: Meta;
4
+ export default _default;
5
+ export declare const SidePanelModalForm: import("storybook/internal/csf").AnnotatedStoryFn<import("@storybook/react-webpack5").ReactRenderer, JRCSidePanelModalFormProps>;
@@ -0,0 +1,2 @@
1
+ import { SidePanelModalProps } from './types';
2
+ export declare const SidePanel: ({ open, portal, ...props }: SidePanelModalProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,18 @@
1
+ import { ReactNode } from 'react';
2
+ import { JRCButtonDropdownOptionProps } from '../JRCButtonDropdown/JRCButtonDropdown.types';
3
+ import { JRCModalContentFormProps } from '../JRCModal/JRCModalContentForm';
4
+ import { JRCModalBaseProps } from '../JRCModal/templates/JRCModal.types';
5
+ export type SidePanelModalProps = Omit<JRCModalBaseProps, 'portalId'> & {
6
+ showIconClose?: boolean;
7
+ position: 'left' | 'right';
8
+ removePadding?: boolean;
9
+ offsetTop?: number;
10
+ portal?: 'global' | 'container' | string;
11
+ };
12
+ export type JRCSidePanelModalProps = SidePanelModalProps & {
13
+ sticky?: boolean;
14
+ footer?: ReactNode;
15
+ options?: ReactNode;
16
+ optionsButton?: JRCButtonDropdownOptionProps[];
17
+ };
18
+ export type JRCSidePanelModalFormProps = SidePanelModalProps & Omit<JRCModalContentFormProps, 'onClickIconClose'>;
@@ -113,6 +113,7 @@ export { JRCPagination } from './JRCPagination/JRCPagination';
113
113
  export { JRCProgressBar } from './JRCProgressBar/JRCProgressBar';
114
114
  export { JRCPublishButton } from './JRCPublishButton/JRCPublishButton';
115
115
  export { JRCSidePanelModal } from './JRCSidePanelModal/JRCSidePanelModal';
116
+ export { JRCSidePanelModalForm } from './JRCSidePanelModal/JRCSidePanelModalForm';
116
117
  export { JRCSkeletonLine } from './JRCSkeleton/JRCSkeletonLine';
117
118
  export { JRCSkeletonList } from './JRCSkeleton/JRCSkeletonList';
118
119
  export { JRCSkeletonSquare } from './JRCSkeleton/JRCSkeletonSquare';
@@ -79,7 +79,7 @@ export type { JRCModalUserListProps } from './components/JRCModalUserList/JRCMod
79
79
  export type { JRCPaginationProps } from './components/JRCPagination/JRCPagination';
80
80
  export type { PublishButtonProps } from './components/JRCPublishButton/JRCPublishButton';
81
81
  export type { PublishButtonEntryProps } from './components/JRCPublishButton/PublishButtonEntry';
82
- export type { JRCSidePanelModalProps } from './components/JRCSidePanelModal/JRCSidePanelModal';
82
+ export type { JRCSidePanelModalProps, JRCSidePanelModalFormProps } from './components/JRCSidePanelModal/types';
83
83
  export type { JRCSkeletonLineProps } from './components/JRCSkeleton/JRCSkeletonLine';
84
84
  export type { JRCSkeletonSquareProps } from './components/JRCSkeleton/JRCSkeletonSquare';
85
85
  export type { ItemEntriesProps, JRCTabPanelProps, JRCTabsProps } from './components/JRCTabs/JRCTabs';
@@ -7,7 +7,8 @@ export interface extractDateProps {
7
7
  seconds: number;
8
8
  }
9
9
  export type DateFormat = 'date' | 'date-time' | 'date-time-sec' | 'time' | 'time-sec';
10
- export declare const extractDate: (str?: string | Date) => extractDateProps;
10
+ type DateArgs = number | string | Date;
11
+ export declare const extractDate: (str?: DateArgs) => extractDateProps;
11
12
  /**
12
13
  * Format date to YYYY-MM-DD
13
14
  * @param {Date} date - Date to format
@@ -21,11 +22,11 @@ export declare const formatTime: (date: Date) => string;
21
22
  * @returns {string} Formatted date string
22
23
  */
23
24
  export declare const formatDateTime: (date: Date) => string;
24
- export declare const isSameDay: (d1: string, d2: string) => boolean;
25
- export declare const isToday: (datetime: string) => boolean;
26
- export declare const isYesterday: (datetime: string) => boolean;
27
- export declare const isTomorrow: (datetime: string) => boolean;
28
- export declare const dateLabel: (date: string) => "GLOBAL_Today" | "GLOBAL_Yesterday" | "GLOBAL_Tomorrow" | null;
25
+ export declare const isSameDay: (d1: DateArgs, d2: DateArgs) => boolean;
26
+ export declare const isToday: (datetime: DateArgs) => boolean;
27
+ export declare const isYesterday: (datetime: DateArgs) => boolean;
28
+ export declare const isTomorrow: (datetime: DateArgs) => boolean;
29
+ export declare const dateLabel: (date: DateArgs) => "GLOBAL_Today" | "GLOBAL_Yesterday" | "GLOBAL_Tomorrow" | null;
29
30
  /**
30
31
  * Convert date string to timestamp
31
32
  * @param {string} str - Date format Y-m-d H:i:s
@@ -42,3 +43,4 @@ export declare const toHumanDate: (date: extractDateProps, format?: DateFormat)
42
43
  export declare const isValidDate: (date: string) => boolean;
43
44
  export declare const substractMonth: (date: Date) => Date;
44
45
  export declare const addMonth: (date: Date) => Date;
46
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jamespot-react-components",
3
- "version": "1.2.39",
3
+ "version": "1.2.40",
4
4
  "description": "",
5
5
  "main": "./build/jamespot-react-components.js",
6
6
  "types": "./build/src/index.d.ts",
@@ -68,7 +68,7 @@
68
68
  "html-webpack-plugin": "^5.6.4",
69
69
  "husky": "^7.0.4",
70
70
  "identity-obj-proxy": "^3.0.0",
71
- "jamespot-user-api": "^1.2.39",
71
+ "jamespot-user-api": "^1.2.40",
72
72
  "jest": "^30.1.2",
73
73
  "jest-environment-jsdom": "^30.1.2",
74
74
  "jest-styled-components": "^7.2.0",