jamespot-react-components 1.0.140 → 1.0.142

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.
Files changed (28) hide show
  1. package/build/jamespot-react-components.js +544 -494
  2. package/build/jamespot-react-components.js.map +1 -1
  3. package/build/src/components/Form/Input/JRCInputDate/JRCInputDate.d.ts +5 -2
  4. package/build/src/components/Form/Input/JRCInputFile/JRCInputFile.d.ts +2 -0
  5. package/build/src/components/Form/Input/JRCInputImage/JRCInputImage.d.ts +3 -1
  6. package/build/src/components/Form/Input/JRCSelect/JRCInputAutocompleteViews.d.ts +4 -2
  7. package/build/src/components/Form/Input/JRCSelect/JRCInputSelect.style.d.ts +2 -1
  8. package/build/src/components/JRCCard/JRCCardImg.d.ts +1 -1
  9. package/build/src/components/JRCFolders/JRCFolderBreadcrumb.d.ts +3 -3
  10. package/build/src/components/JRCFolders/JRCFolders.d.ts +3 -1
  11. package/build/src/components/JRCFolders/JRCFolders.stories.d.ts +1 -1
  12. package/build/src/components/JRCFolders/mock.d.ts +1549 -0
  13. package/build/src/components/JRCFolders/styles.d.ts +11 -0
  14. package/build/src/components/JRCFolders/types.d.ts +12 -17
  15. package/build/src/components/JRCHtml/JRCHtml.d.ts +5 -1
  16. package/build/src/components/JRCImg/JRCImg.d.ts +1 -1
  17. package/build/src/components/JRCSidePanelModal/JRCSidePanelModal.d.ts +15 -0
  18. package/build/src/components/JRCSidePanelModal/JRCSidePanelModal.stories.d.ts +5 -0
  19. package/build/src/components/JRCSidePanelModal/JRCSidePanelModal.styles.d.ts +11 -0
  20. package/build/src/hooks/useCancelOnUnmount.d.ts +1 -0
  21. package/build/src/index.d.ts +3 -0
  22. package/build/src/utils/index.d.ts +1 -2
  23. package/package.json +2 -2
  24. package/build/src/components/JRCFolders/mock.folders.d.ts +0 -16
  25. package/build/src/components/JRCImg/JRCImg.utils.d.ts +0 -68
  26. package/build/src/components/JRCImg/JRCImg.utils.test.d.ts +0 -1
  27. package/build/src/utils/utils.uri.d.ts +0 -2
  28. package/build/src/utils/utils.uri.test.d.ts +0 -1
@@ -0,0 +1,11 @@
1
+ export declare const CSSTitleAccessor: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
2
+ export declare const CSSTitle: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
3
+ export declare const CSSActionAccessor: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
4
+ export declare const ListWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
5
+ export declare const CSSEmptyWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
6
+ export declare const CSSOpacityFilter: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
7
+ opacity?: number | undefined;
8
+ }, never>;
9
+ export declare const CSSPool: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
10
+ export declare const CSSListNoHead: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
11
+ export declare const CSSLoader: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
@@ -1,20 +1,15 @@
1
- /**
2
- * Props type for JRCFolders
3
- * @property getBanks, optional: Override getBanks api
4
- * @property getFolders, optional: Override getFolders api
5
- * @property preSelect, optional: Array of preselected object
6
- * @property onSelect, optional: Display a selection button
7
- * @property onPress, optional: FUTURE DEV
8
- * @property extendedListColumns, optional: FUTURE DEV
9
- */
10
- export interface JRCFoldersProps {
11
- getBanks?: () => Promise<any>;
12
- getFolders?: () => Promise<any>;
13
- preSelect?: Array<any>;
14
- onSelect?: (folder: any) => void;
15
- onPress?: (folder: any) => void;
16
- extendedListColumns?: any;
17
- }
1
+ import { ApiPagingResults, ApiWrapper, FileBankDocument, FileBankProps, FolderType } from 'jamespot-user-api';
2
+ export declare type JRCFoldersProps = {
3
+ loadDocuments?: boolean;
4
+ initialFolders?: string[];
5
+ initialDocuments?: string[];
6
+ allowMultiSelection?: boolean;
7
+ asyncBanksPromise: () => Promise<FileBankProps[]>;
8
+ asyncFoldersPromise: (uri: string) => Promise<ApiWrapper<FolderType[]>>;
9
+ asyncDocumentsPromise: (uri: string) => Promise<ApiPagingResults<FileBankDocument>>;
10
+ onSelectFolder?: (folder: FolderType[]) => void;
11
+ onSelectDocument?: (document: FileBankDocument[]) => void;
12
+ };
18
13
  export interface JRCFolderBreadcrumbProps {
19
14
  color: string;
20
15
  size: 'sm' | 'md' | 'lg';
@@ -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.142",
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.112",
111
111
  "moment": "^2.29.1",
112
112
  "react": "^17.x",
113
113
  "react-beautiful-dnd": "^13.1.1",
@@ -1,16 +0,0 @@
1
- declare const rootFoldersMockup: {
2
- id: number;
3
- uri: string;
4
- nbDocuments: number;
5
- title: string;
6
- type: string;
7
- folderColor: string;
8
- }[];
9
- declare const foldersMockup: {
10
- uri: string;
11
- title: string;
12
- type: string;
13
- parentURI: string;
14
- folderColor: string;
15
- }[];
16
- export { rootFoldersMockup, foldersMockup };
@@ -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 {};