jamespot-react-components 1.2.51 → 1.2.53

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.
@@ -0,0 +1,6 @@
1
+ import { Meta, StoryObj } from '@storybook/react-webpack5';
2
+ import { ClickAwayListener } from './ClickAwayListener';
3
+ declare const meta: Meta;
4
+ export default meta;
5
+ type Story = StoryObj<typeof ClickAwayListener>;
6
+ export declare const Default: Story;
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { ControllerRenderProps, FieldValues, RegisterOptions, UseControllerProps } from 'react-hook-form';
2
+ import { ControllerRenderProps, FieldValues, Path, PathValue, RegisterOptions, UseControllerProps } from 'react-hook-form';
3
3
  import { DataCy } from '../../../../types/dataAttributes';
4
4
  import { JRCTooltipProps } from '../../../JRCTooltip/types';
5
5
  import { FormControls, JRCFormControls } from './useFormControls';
@@ -42,6 +42,7 @@ export type JRCFormFieldRendererProps<T extends FieldValues = FieldValues> = Fie
42
42
  width?: string | undefined;
43
43
  readOnly?: boolean;
44
44
  noLabel?: boolean;
45
+ fieldDefaultValue?: PathValue<T, Path<T>>;
45
46
  srOnly?: string;
46
47
  id?: string;
47
48
  };
@@ -56,6 +57,7 @@ export type JRCInputFieldProps<T extends FieldValues = FieldValues> = FieldRende
56
57
  width?: string | undefined;
57
58
  readOnly?: boolean;
58
59
  noLabel?: boolean;
60
+ fieldDefaultValue?: PathValue<T, Path<T>>;
59
61
  srOnly?: string;
60
62
  id?: string;
61
63
  };
@@ -1,7 +1,7 @@
1
- import { Meta } from '@storybook/react-webpack5';
2
- import { JRCInputFieldProps } from '../Common/JRCFormFieldRenderer.types';
3
- declare const _default: Meta;
4
- export default _default;
5
- export declare const InputDateTime: import("storybook/internal/csf").AnnotatedStoryFn<import("@storybook/react-webpack5").ReactRenderer, JRCInputFieldProps<{
6
- date: string;
7
- }>>;
1
+ import { Meta, StoryObj } from '@storybook/react-webpack5';
2
+ import { JRCInputDateTime } from './JRCInputDateTime';
3
+ declare const meta: Meta;
4
+ export default meta;
5
+ type Story = StoryObj<typeof JRCInputDateTime>;
6
+ export declare const InputDateTime: Story;
7
+ export declare const InputDate: Story;
@@ -72,7 +72,6 @@ export type SelectProps<T = any> = DataCy & {
72
72
  minWidth?: string | false;
73
73
  noMargin?: boolean;
74
74
  defaultOpen?: boolean;
75
- onClose?: () => void;
76
75
  };
77
76
  /**
78
77
  * Autocomplete
@@ -1,6 +1,6 @@
1
1
  import { ComponentPropsWithoutRef, ReactNode } from 'react';
2
- import { MessageType } from '../Common/util/getColor.util';
3
2
  import { JRCButtonProps } from '../JRCButton/JRCButton';
3
+ import { MessageType } from '../../utils/utils.color';
4
4
  export interface JRCAlertProps extends ComponentPropsWithoutRef<'div'> {
5
5
  /** Alert title */
6
6
  label: string | ReactNode;
@@ -26,6 +26,7 @@ export type JRCButtonDropdownProps = {
26
26
  defaultOpen?: boolean;
27
27
  onClose?: () => void;
28
28
  noMargin?: boolean;
29
+ dataCy?: string;
29
30
  };
30
31
  export type ButtonProps = {
31
32
  borderLeft?: boolean;
@@ -3,4 +3,4 @@ export type CalendarOption = {
3
3
  label: string;
4
4
  value: CalendarView;
5
5
  };
6
- export declare const JRCCalendar: ({ events, loading, views, handler, defaultView, fluid, mode, fullScreen, deportedToolbar, withPadding, eventModalExtraComponent, onChangeView, onChangeDates, onError, onSuccess, onDeleteEvent, onClickUpdateEvent, onUpdateStatus, isUpdateStatusLoading, }: JRCCalendarProps) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const JRCCalendar: ({ events, loading, views, handler, defaultView, fluid, mode, fullScreen, deportedToolbar, withPadding, eventModalExtraComponent, onChangeView, onChangeDates, onError, onSuccess, onDeleteEvent, onClickUpdateEvent, onUpdateStatus, isUpdateStatusLoading, onSelect, }: JRCCalendarProps) => import("react/jsx-runtime").JSX.Element;
@@ -44,6 +44,11 @@ export type JRCCalendarProps = {
44
44
  type: string;
45
45
  }) => void;
46
46
  isUpdateStatusLoading: (id: number) => boolean;
47
+ onSelect?: (params: {
48
+ start: Date;
49
+ end: Date;
50
+ allDay: boolean;
51
+ } | null) => void;
47
52
  };
48
53
  export type JRCCalendarEventProps = {
49
54
  id: string;
@@ -1,5 +1,5 @@
1
1
  import { ComponentPropsWithoutRef } from 'react';
2
- import { MessageType } from '../Common/util/getColor.util';
2
+ import { MessageType } from '../../utils/utils.color';
3
3
  export type TVariants = 'span' | 'div';
4
4
  export type JRCCardProps = ComponentPropsWithoutRef<'div'> & {
5
5
  variant?: TVariants;
@@ -1,11 +1,11 @@
1
- import { CommentWithExtensions, JDriveApi, JFileApi, JGlobalApi, JQuestionAnswerApi, JUserApi, Model, UpdateCommentParams, WidgetDisplayMode, WidgetWrapperProps, jCommentList } from 'jamespot-user-api';
1
+ import { CommentWithExtensions, JDriveApi, JFileApi, JFileIntegrity, JGlobalApi, JQuestionAnswerApi, JUserApi, Model, UpdateCommentParams, WidgetDisplayMode, WidgetWrapperProps, jCommentList } from 'jamespot-user-api';
2
2
  import { ReactNode } from 'react';
3
3
  import { DriveOrFilebank } from '../Form/Input/JRCInputFileAdvanced/JRCInputFileAdvancedRaw';
4
4
  import { JRCInputTinyMCERawProps } from '../Form/Input/JRCInputTinyMCERaw/JRCInputTinyMCERaw';
5
5
  import { FoldersHandlers } from '../JRCFolders/types';
6
6
  export type JRCCommentProps = {
7
7
  isFocused: boolean;
8
- comment: CommentWithExtensions<jCommentList, ['actions']> & {
8
+ comment: CommentWithExtensions<jCommentList, ['actions', 'quarantine']> & {
9
9
  pending?: boolean;
10
10
  };
11
11
  token?: string;
@@ -24,6 +24,7 @@ export type JRCCommentProps = {
24
24
  activeDrives: DriveOrFilebank[];
25
25
  handlers: FoldersHandlers & {
26
26
  file: Pick<JFileApi, 'copy'>;
27
+ fileIntegrity: Pick<JFileIntegrity, 'getCommentQuarantines'>;
27
28
  drive: Pick<JDriveApi, 'msDocuments' | 'dropboxDocuments' | 'groups' | 'tenants' | 'listAccount' | 'isAccountLogged' | 'checkAccountToken' | 'getAccount' | 'logout' | 'setDefaultAccount' | 'getDocument'>;
28
29
  user: Pick<JUserApi, 'get' | 'getFields'>;
29
30
  global: Pick<JGlobalApi, 'addAction' | 'removeAction' | 'getUsers'>;
@@ -1,11 +1,11 @@
1
- import { AddCommentParams, CommentWithExtensions, JDriveApi, JFileApi, JGlobalApi, JQuestionAnswerApi, JUserApi, Model, UpdateCommentParams, WidgetDisplayMode, WidgetWrapperProps, jCommentList, jUserList } from 'jamespot-user-api';
1
+ import { AddCommentParams, CommentWithExtensions, JDriveApi, JFileApi, JGlobalApi, JQuestionAnswerApi, JUserApi, Model, UpdateCommentParams, WidgetDisplayMode, WidgetWrapperProps, jCommentList, jUserList, JFileIntegrity } from 'jamespot-user-api';
2
2
  import { ReactNode } from 'react';
3
3
  import { DriveOrFilebank } from '../Form/Input/JRCInputFileAdvanced/JRCInputFileAdvancedRaw';
4
4
  import { JRCInputTinyMCERawProps } from '../Form/Input/JRCInputTinyMCERaw/JRCInputTinyMCERaw';
5
5
  import { FoldersHandlers } from '../JRCFolders/types';
6
6
  import { TinyMCEExtension } from '../Form/Input/JRCInputTinyMCERaw/types';
7
7
  export type JRCCommentsBlocProps = {
8
- comments?: Array<CommentWithExtensions<jCommentList, ['actions']> & {
8
+ comments?: Array<CommentWithExtensions<jCommentList, ['actions', 'quarantine']> & {
9
9
  pending?: boolean;
10
10
  }>;
11
11
  initialCommentsNumber?: number;
@@ -32,6 +32,7 @@ export type JRCCommentsBlocProps = {
32
32
  canComment: boolean;
33
33
  handlers: FoldersHandlers & {
34
34
  file: Pick<JFileApi, 'copy' | 'deleteFile'>;
35
+ fileIntegrity: Pick<JFileIntegrity, 'getCommentQuarantines'>;
35
36
  drive: Pick<JDriveApi, 'msDocuments' | 'dropboxDocuments' | 'groups' | 'tenants' | 'listAccount' | 'isAccountLogged' | 'checkAccountToken' | 'getAccount' | 'logout' | 'setDefaultAccount' | 'getDocument'>;
36
37
  user: Pick<JUserApi, 'get' | 'getFields'>;
37
38
  global: Pick<JGlobalApi, 'addAction' | 'removeAction' | 'getUsers'>;
@@ -1,5 +1,6 @@
1
- import { JRCDropDownProps } from './JRCDropDown';
2
- import { Meta } from '@storybook/react-webpack5';
3
- declare const _default: Meta;
4
- export default _default;
5
- export declare const Simple: import("storybook/internal/csf").AnnotatedStoryFn<import("@storybook/react-webpack5").ReactRenderer, JRCDropDownProps>;
1
+ import { Meta, StoryObj } from '@storybook/react-webpack5';
2
+ import { JRCDropDown } from './JRCDropDown';
3
+ declare const meta: Meta;
4
+ export default meta;
5
+ type Story = StoryObj<typeof JRCDropDown>;
6
+ export declare const Default: Story;
@@ -0,0 +1,6 @@
1
+ import { Meta, StoryObj } from '@storybook/react-webpack5';
2
+ import { JRCFlexBox } from './JRCFlexBox';
3
+ declare const meta: Meta;
4
+ export default meta;
5
+ type Story = StoryObj<typeof JRCFlexBox>;
6
+ export declare const Default: Story;
@@ -0,0 +1,9 @@
1
+ import { ApiWrapper, ArticleWithExtensions, jQuarantineList } from 'jamespot-user-api';
2
+ type JRCQuarantineFilesProps = {
3
+ count: number;
4
+ commentId: number;
5
+ load: (commentId: number) => Promise<ApiWrapper<ArticleWithExtensions<jQuarantineList, ['attachments']>[]>>;
6
+ onError?: (message?: string) => void;
7
+ };
8
+ export declare const JRCQuarantineFiles: ({ count, commentId, load, onError }: JRCQuarantineFilesProps) => import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,5 @@
1
+ import { Meta, StoryObj } from '@storybook/react-webpack5';
2
+ declare const meta: Meta;
3
+ export default meta;
4
+ export declare const UseDebounce: StoryObj;
5
+ export declare const UseDebouncedCallback: StoryObj;
@@ -2,7 +2,7 @@ export type { CalendarApi } from '@fullcalendar/core';
2
2
  export type { Editor } from 'tinymce';
3
3
  export type { JRCDragAndDropProps } from './components/Beta/BETA_JRCDragAndDrop/BETA_JRCDragAndDrop';
4
4
  export type { JRCConditionalWrapperProps } from './components/Common/JRCConditionalWrapper';
5
- export type { MessageType } from './components/Common/util/getColor.util';
5
+ export type { MessageType } from './utils/utils.color';
6
6
  export type { JRCEllipsisProps } from './components/Deprecated/Deprecated_JRCEllipsis/Deprecated_JRCEllipsis';
7
7
  export * from './components/Form/Common/types';
8
8
  export type { JRCInputFieldProps, NameControl } from './components/Form/Input/Common/JRCFormFieldRenderer.types';
@@ -52,4 +52,10 @@ export declare const colorimetry: {
52
52
  export declare const getContrast50: (hexcolor: string) => "black" | "white";
53
53
  export declare const getContrastYIQ: (hexcolor: string) => "black" | "white";
54
54
  export declare function isValidHexColor(color: string): boolean;
55
+ export type MessageType = 'success' | 'error' | 'warning';
56
+ export declare const MessageColor: {
57
+ readonly success: "green";
58
+ readonly error: "orange";
59
+ readonly warning: "yellow";
60
+ };
55
61
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jamespot-react-components",
3
- "version": "1.2.51",
3
+ "version": "1.2.53",
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.51",
71
+ "jamespot-user-api": "^1.2.53",
72
72
  "jest": "^30.2.0",
73
73
  "jest-environment-jsdom": "^30.2.0",
74
74
  "jest-styled-components": "^7.2.0",
@@ -129,6 +129,9 @@
129
129
  "node": ">=20.17.0 <21.0.0",
130
130
  "pnpm": ">=9.9.0 <10"
131
131
  },
132
+ "dependencies": {
133
+ "@fullcalendar/interaction": "^6.1.19"
134
+ },
132
135
  "scripts": {
133
136
  "dev": "webpack --env NODE_ENV=development",
134
137
  "local": "webpack --env NODE_ENV=development WATCH=true",
@@ -1,2 +0,0 @@
1
- export type MessageType = 'success' | 'error' | 'warning';
2
- export declare const getColor: (type: MessageType) => "orange" | "yellow" | "green";