jamespot-react-components 1.0.140 → 1.0.141

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.
@@ -2,11 +2,14 @@ import * as React from 'react';
2
2
  import { JRCInputFieldProps } from '../Common/JRCFormFieldRenderer.types';
3
3
  import { DataCy } from '../../../../types/dataAttributes';
4
4
  import { FieldValues } from 'react-hook-form/dist/types';
5
- export declare type JRCInputDateProps = DataCy & React.ComponentPropsWithoutRef<'input'>;
5
+ export declare type NativeInputProps = DataCy & React.ComponentPropsWithoutRef<'input'> & {
6
+ type?: 'date' | 'time' | 'datetime-local';
7
+ };
8
+ export declare type JRCInputDateProps<TFieldValues extends FieldValues = FieldValues> = NativeInputProps & JRCInputFieldProps<TFieldValues>;
6
9
  /**
7
10
  * Component used as a <input type="date"/>
8
11
  * @param props JRCInputFieldProps
9
12
  * validation props: required
10
13
  * @returns JSX.Element
11
14
  */
12
- export declare function JRCInputDate<T extends FieldValues = FieldValues>(props: JRCInputFieldProps<T>): JSX.Element;
15
+ export declare function JRCInputDate<T extends FieldValues = FieldValues>(props: JRCInputDateProps<T>): JSX.Element;
@@ -5,6 +5,7 @@ import { FieldValues } from 'react-hook-form/dist/types';
5
5
  import { ApiWrapper, FileResponse } from 'jamespot-user-api';
6
6
  export declare type NativeInputFileProps = DataCy & Omit<React.ComponentPropsWithoutRef<'input'>, 'value' | 'onChange'> & {
7
7
  token?: string | undefined;
8
+ attrName?: string;
8
9
  onLoading?: (state: boolean) => void;
9
10
  value: ApiWrapper<FileResponse>[];
10
11
  onChange: (files: ApiWrapper<FileResponse>[]) => void;
@@ -12,6 +13,7 @@ export declare type NativeInputFileProps = DataCy & Omit<React.ComponentPropsWit
12
13
  export declare type JRCInputFileProps<T extends FieldValues = FieldValues> = JRCInputFieldProps<T> & Omit<NativeInputFileProps, 'value' | 'onChange'>;
13
14
  export declare const InputFile: React.ForwardRefExoticComponent<DataCy & Omit<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "onChange" | "value"> & {
14
15
  token?: string | undefined;
16
+ attrName?: string | undefined;
15
17
  onLoading?: ((state: boolean) => void) | undefined;
16
18
  value: ApiWrapper<FileResponse>[];
17
19
  onChange: (files: ApiWrapper<FileResponse>[]) => void;
@@ -5,9 +5,10 @@ import { FieldValues } from 'react-hook-form/dist/types';
5
5
  import { FileResponse } from 'jamespot-user-api';
6
6
  export declare type NativeInputImageProps = DataCy & Omit<React.ComponentPropsWithoutRef<'input'>, 'value' | 'onChange'> & {
7
7
  token?: string | undefined;
8
+ attrName?: string;
8
9
  onLoading?: (state: boolean) => void;
9
10
  aspectRatio?: number | undefined;
10
- defaultImages: {
11
+ defaultImages?: {
11
12
  imgs: Array<{
12
13
  src: string;
13
14
  alt: string;
@@ -21,6 +22,7 @@ export declare type NativeInputImageProps = DataCy & Omit<React.ComponentPropsWi
21
22
  timestamp?: string | number;
22
23
  });
23
24
  onChange: (files: undefined | FileResponse) => void;
25
+ disableCrop?: boolean;
24
26
  };
25
27
  export declare type JRCInputImageProps<T extends FieldValues = FieldValues> = JRCInputFieldProps<T> & Omit<NativeInputImageProps, 'value' | 'onChange'>;
26
28
  /**
@@ -273,7 +273,8 @@ export declare const OptionMenu: import("styled-components").StyledComponent<"di
273
273
  export declare const SelectedOptionWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
274
274
  export declare const SelectedOption: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
275
275
  type: "button";
276
- }, "type">;
276
+ readOnly: boolean;
277
+ }, "type" | "readOnly">;
277
278
  export declare const JRCDefaultSelectedOption: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
278
279
  export declare const TimesIcon: import("styled-components").StyledComponent<"i", import("styled-components").DefaultTheme, {
279
280
  className: "react-icon icon-times";
@@ -1,4 +1,4 @@
1
- import { ImgUrlProps } from 'components/JRCImg/JRCImg.utils';
1
+ import { ImgUrlProps } from 'jamespot-user-api';
2
2
  import * as React from 'react';
3
3
  declare const ASPECTS: {
4
4
  '4:3': number;
@@ -5,4 +5,8 @@ export declare type JRCHtmlProps = LimitLinesProps & {
5
5
  as?: React.ElementType | keyof JSX.IntrinsicElements;
6
6
  __html: string | undefined;
7
7
  };
8
- export declare const JRCHtml: ({ __html, ...props }: JRCHtmlProps) => JSX.Element | null;
8
+ export declare const JRCHtml: React.ForwardRefExoticComponent<LimitLinesProps & {
9
+ className?: string | undefined;
10
+ as?: "symbol" | "object" | "g" | "b" | "div" | "big" | "link" | "small" | "sub" | "sup" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "base" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "main" | "map" | "mark" | "menu" | "menuitem" | "meta" | "meter" | "nav" | "noindex" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "slot" | "script" | "section" | "select" | "source" | "span" | "strong" | "style" | "summary" | "table" | "template" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" | "svg" | "animate" | "animateMotion" | "animateTransform" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | React.ComponentClass<any, any> | React.FunctionComponent<any> | undefined;
11
+ __html: string | undefined;
12
+ } & React.RefAttributes<HTMLDivElement>>;
@@ -1,4 +1,4 @@
1
- import { ImgUrlProps } from './JRCImg.utils';
1
+ import { ImgUrlProps } from 'jamespot-user-api';
2
2
  /**
3
3
  * @see ImgUrlProps
4
4
  * @property loading - img loading attribute - default is lazy
@@ -0,0 +1,15 @@
1
+ import React, { ReactNode } from 'react';
2
+ /**
3
+ * Type for JRCSidePanelModal props
4
+ */
5
+ export declare type JRCSidePanelModalProps = {
6
+ open: boolean;
7
+ closeHandler: () => void;
8
+ children?: ReactNode;
9
+ title?: React.ReactNode;
10
+ showIconClose?: boolean;
11
+ enableClickAwayCloseModal?: boolean;
12
+ position: 'left' | 'right';
13
+ footer?: ReactNode;
14
+ };
15
+ export declare const JRCSidePanelModal: React.ForwardRefExoticComponent<JRCSidePanelModalProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,5 @@
1
+ import { JRCSidePanelModalProps } from './JRCSidePanelModal';
2
+ import { Meta, Story } from '@storybook/react';
3
+ declare const _default: Meta<import("@storybook/react").Args>;
4
+ export default _default;
5
+ export declare const SidePanelModal: Story<JRCSidePanelModalProps>;
@@ -0,0 +1,11 @@
1
+ export declare type ModalBorderRadius = 'medium' | 'small';
2
+ export declare const JRCModalBox: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
3
+ position?: "left" | "right" | undefined;
4
+ open?: boolean | undefined;
5
+ }, never>;
6
+ export declare const JRCModalTitle: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
7
+ export declare const JRCModalOptions: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
8
+ export declare const JRCModalContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
9
+ export declare const JRCModalHeader: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
10
+ export declare const JRCModalFooter: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
11
+ export declare const JRCModalClose: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
@@ -0,0 +1 @@
1
+ export declare function useCancelOnUnmount(): (<K>(p: Promise<K>) => Promise<K>)[];
@@ -25,6 +25,7 @@ declare global {
25
25
  */
26
26
  export { default as Resources } from './translation';
27
27
  export { default as Theme } from './styles/theme';
28
+ export { ClickAwayListener } from './components/Form/Common/ClickAwayListener';
28
29
  export { JRC404 } from './components/404';
29
30
  export { JRCAlert } from './components/JRCAlert/JRCAlert';
30
31
  export { JRCAppColumn } from './components/Templates/JRCAppColumn';
@@ -111,6 +112,7 @@ export { JRCModal } from './components/JRCModal/JRCModal';
111
112
  export { JRCModalImg } from './components/JRCModalImg/JRCModalImg';
112
113
  export { JRCPagination } from './components/JRCPagination/JRCPagination';
113
114
  export { JRCPanel } from './components/Templates/JRCPanel';
115
+ export { JRCSidePanelModal } from './components/JRCSidePanelModal/JRCSidePanelModal';
114
116
  export { JRCSkeletonLine } from './components/JRCSkeleton/JRCSkeletonLine';
115
117
  export { JRCSkeletonList } from './components/JRCSkeleton/JRCSkeletonList';
116
118
  export { JRCSkeletonSquare } from './components/JRCSkeleton/JRCSkeletonSquare';
@@ -145,6 +147,7 @@ export { useDidMountEffect } from './hooks/UseDidMountEffect';
145
147
  export { useImageLoader } from './hooks/UseImageLoader';
146
148
  export { useKeyPress } from './hooks/UseKeyPress';
147
149
  export { useTimeout } from './hooks/UseTimeout';
150
+ export { useCancelOnUnmount } from './hooks/useCancelOnUnmount';
148
151
  /****
149
152
  *
150
153
  * PLEASE RESPECT ALPHABETICAL ORDER
@@ -6,6 +6,5 @@ import * as object from './utils.object';
6
6
  import * as regexp from './utils.regexp';
7
7
  import * as string from './utils.string';
8
8
  import * as time from './utils.time';
9
- import * as uri from './utils.uri';
10
9
  import * as image from './utils.image';
11
- export { array, date, document, misc, object, regexp, string, time, uri, image };
10
+ export { array, date, document, misc, object, regexp, string, time, image };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jamespot-react-components",
3
- "version": "1.0.140",
3
+ "version": "1.0.141",
4
4
  "description": "",
5
5
  "main": "./build/jamespot-react-components.js",
6
6
  "types": "./build/src/index.d.ts",
@@ -107,7 +107,7 @@
107
107
  "chroma-js": "^2.1.1",
108
108
  "classnames": "^2.3.1",
109
109
  "dompurify": "^3.0.5",
110
- "jamespot-user-api": "^1.0.110",
110
+ "jamespot-user-api": "^1.0.111",
111
111
  "moment": "^2.29.1",
112
112
  "react": "^17.x",
113
113
  "react-beautiful-dnd": "^13.1.1",
@@ -1,68 +0,0 @@
1
- /**
2
- * @see JRCImgProps
3
- */
4
- declare type WidthHeight = {
5
- width?: number;
6
- height?: number;
7
- };
8
- /**
9
- * @see JRCImgProps
10
- */
11
- declare type Size = {
12
- size?: string;
13
- };
14
- /**
15
- * @see JRCImgProps
16
- */
17
- declare type Format = {
18
- format?: string;
19
- };
20
- /**
21
- * @see JRCImgProps
22
- */
23
- declare type Timestamp = {
24
- timestamp?: string | number;
25
- };
26
- declare type Args = Timestamp & {
27
- iconColor?: 'white';
28
- };
29
- /**
30
- * @see JRCImgProps
31
- */
32
- export declare type ImgUrlProps = {
33
- url?: string;
34
- fallbackUrl?: string;
35
- size?: string;
36
- width?: number;
37
- height?: number;
38
- maxWidth?: string;
39
- from?: string;
40
- uri?: string;
41
- recordId?: string | number;
42
- type?: string;
43
- format?: string;
44
- iconColor?: 'white';
45
- timestamp?: string | number;
46
- };
47
- export declare function getFrom(arg: Pick<ImgUrlProps, 'from'>): string;
48
- export declare function getTimestamp(arg: Timestamp): string;
49
- export declare function getArgs(arg: Args): string;
50
- export declare function getSize(arg: Size & WidthHeight, dpr?: number): string;
51
- export declare function getFormat(arg: Format): string;
52
- export declare function getUrl(url: string): URL | undefined;
53
- /**
54
- * Format an img url
55
- * If url arg is provided, it is used, in addition with an optional timestamp
56
- * If not parsable or not passed, one should provide:
57
- * - optional from
58
- * - size in either size or width/height argument.
59
- * If width & height are provided, the downloaded image take car of the screen resolution
60
- * - uri or type/recordId
61
- * - optional format, default png
62
- * - optional timestamp
63
- * The final url is {from}/{size}/{uri}.{format}?_={timestamp}
64
- * @param arg
65
- * @param dpr device pixel ratio
66
- */
67
- export declare function formatImgUrl(arg: ImgUrlProps, dpr?: number): string;
68
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- import { UriOrTypeId } from '../components/Form/Common/types';
2
- export declare function getUri(arg: UriOrTypeId): string;
@@ -1 +0,0 @@
1
- export {};