jamespot-react-components 1.0.110 → 1.0.113

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 (26) hide show
  1. package/build/jamespot-react-components.js +364 -326
  2. package/build/jamespot-react-components.js.map +1 -1
  3. package/build/src/components/Common/DashedFocusBorder.d.ts +1 -0
  4. package/build/src/components/Common/JRCConditionalWrapper.d.ts +4 -3
  5. package/build/src/components/Common/LimitLines.d.ts +4 -0
  6. package/build/src/components/Form/Input/Common/JRCFormFieldRenderer.types.d.ts +1 -1
  7. package/build/src/components/JRCAppLeftColumn/JRCAppLeftColumn.styles.d.ts +3 -1
  8. package/build/src/components/JRCButton/JRCButton.d.ts +13 -0
  9. package/build/src/components/JRCButtonDropdown/JRCButtonDropdown.styles.d.ts +2 -0
  10. package/build/src/components/JRCCard/JRCCardImg.d.ts +5 -0
  11. package/build/src/components/JRCDate/JRCDate.d.ts +0 -1
  12. package/build/src/components/JRCFlex/JRCFlexBox.d.ts +11 -2
  13. package/build/src/components/JRCHref/JRCHref.d.ts +3 -2
  14. package/build/src/components/JRCHtml/JRCHtml.d.ts +6 -0
  15. package/build/src/components/JRCHtml/JRCHtml.stories.d.ts +5 -0
  16. package/build/src/components/JRCIconButton/JRCIconButton.d.ts +8 -4
  17. package/build/src/components/Templates/template.styles.d.ts +1 -1
  18. package/build/src/index.d.ts +1 -0
  19. package/build/src/types.d.ts +1 -0
  20. package/build/src/utils/utils.date.d.ts +1 -1
  21. package/package.json +2 -2
  22. package/storybook-static/{55.ecc350e7.iframe.bundle.js → 55.5fa319f3.iframe.bundle.js} +2 -2
  23. package/storybook-static/{55.ecc350e7.iframe.bundle.js.LICENSE.txt → 55.5fa319f3.iframe.bundle.js.LICENSE.txt} +0 -0
  24. package/storybook-static/iframe.html +1 -1
  25. package/storybook-static/main.bb96e273.iframe.bundle.js +1 -0
  26. package/storybook-static/main.d0f92558.iframe.bundle.js +0 -1
@@ -7,3 +7,4 @@ export declare type DashedFocusBorderProps = {
7
7
  * @props offset offset of the dashed focus border, default to 2px
8
8
  */
9
9
  export declare const DashedFocusBorder: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<DashedFocusBorderProps, any>>;
10
+ export declare const DashedFocusBorderAbsolute: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<DashedFocusBorderProps, any>>;
@@ -8,9 +8,10 @@ export interface JRCConditionalWrapperProps {
8
8
  }
9
9
  export declare const JRCConditionalWrapper: ({ condition, wrapper, wrapperFalse, children }: JRCConditionalWrapperProps) => JSX.Element;
10
10
  export interface JRCConditionalTooltipProps {
11
- condition: boolean;
12
- tooltip: Omit<JRCTooltipProps, 'children'>;
11
+ condition?: boolean;
12
+ hasLicense?: boolean;
13
+ tooltip?: Omit<JRCTooltipProps, 'children'>;
13
14
  children?: React.ReactNode;
14
15
  className?: string;
15
16
  }
16
- export declare const JRCConditionalTooltip: ({ condition, tooltip, children, className }: JRCConditionalTooltipProps) => JSX.Element;
17
+ export declare const JRCConditionalTooltip: ({ condition, hasLicense, tooltip, children, className, }: JRCConditionalTooltipProps) => JSX.Element;
@@ -0,0 +1,4 @@
1
+ export declare type LimitLinesProps = {
2
+ lines?: number | undefined;
3
+ };
4
+ export declare const LimitLines: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<LimitLinesProps, any>>;
@@ -36,7 +36,7 @@ export interface RendererProps<T extends FieldValues = FieldValues> {
36
36
  */
37
37
  export declare type JRCFormFieldRendererProps<T extends FieldValues = FieldValues> = FieldRenderProps & NameControl<T> & RendererProps<T> & {
38
38
  rules?: FormControls & JRCFormControls;
39
- rulesValidate?: RegisterOptions['validate'];
39
+ rulesValidate?: RegisterOptions<T>['validate'];
40
40
  };
41
41
  /**
42
42
  * Prop types for an input rendered by react-hook-form
@@ -21,7 +21,7 @@ export declare const MenuWrapper: import("styled-components").StyledComponent<"d
21
21
  export declare const ItemsIcon: import("styled-components").StyledComponent<"button", any, import("../JRCTabs/JRCTabs").ItemProps, never>;
22
22
  export declare const TitleMenu: import("styled-components").StyledComponent<"h2", any, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "key" | keyof import("react").HTMLAttributes<HTMLHeadingElement>>, never>;
23
23
  export declare const JRCIconButtonAppLeftColumn: import("styled-components").StyledComponent<{
24
- (props: Pick<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "key" | keyof import("react").ButtonHTMLAttributes<HTMLButtonElement>> & import("../../types/dataAttributes").DataCy & {
24
+ ({ hasLicense, ...props }: Pick<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "key" | keyof import("react").ButtonHTMLAttributes<HTMLButtonElement>> & import("../../types/dataAttributes").DataCy & {
25
25
  icon: string;
26
26
  size?: "small" | "medium" | undefined;
27
27
  onClick?: ((event?: import("react").MouseEvent<HTMLButtonElement, MouseEvent> | undefined) => void) | undefined;
@@ -29,9 +29,11 @@ export declare const JRCIconButtonAppLeftColumn: import("styled-components").Sty
29
29
  value?: string | undefined;
30
30
  disabled?: boolean | undefined;
31
31
  type?: "button" | "reset" | "submit" | undefined;
32
+ bgBaseGrey?: 0 | 1 | 2 | undefined;
32
33
  color?: "inherit" | import("../../styles/theme").Colors | import("../../styles/theme").Shades | undefined;
33
34
  tooltip?: Omit<import("../..").JRCTooltipProps, "children"> | undefined;
34
35
  variant?: "circle" | "square" | undefined;
36
+ hasLicense?: boolean | undefined;
35
37
  } & {
36
38
  onClick: () => void;
37
39
  type: string;
@@ -3,6 +3,7 @@ import { JRCIconProps } from '../JRCIcon/JRCIcon';
3
3
  import { ButtonType } from './JRCButtonConfig';
4
4
  import { DataCy } from '../../types/dataAttributes';
5
5
  import { DashedFocusBorderProps } from '../Common/DashedFocusBorder';
6
+ import { JRCTooltipProps } from '../JRCTooltip/JRCTooltip';
6
7
  export declare type JRCButtonProps = React.ComponentPropsWithoutRef<'button'> & DataCy & {
7
8
  /** Color of the background of the button */
8
9
  color?: 'primary' | 'valid' | 'danger' | 'secondary';
@@ -22,6 +23,10 @@ export declare type JRCButtonProps = React.ComponentPropsWithoutRef<'button'> &
22
23
  float?: 'left' | 'right';
23
24
  /** CSS min-width attribute */
24
25
  minWidth?: string;
26
+ /** has license. If false, the button will be disabled with a license tooltip. Default to true */
27
+ hasLicense?: boolean;
28
+ /** tooltip tooltip props */
29
+ tooltip?: Omit<JRCTooltipProps, 'children'>;
25
30
  };
26
31
  export declare const transformColor: (color?: string | undefined) => JRCIconProps['color'];
27
32
  /**
@@ -49,6 +54,10 @@ export declare const Button: import("styled-components").StyledComponent<"button
49
54
  float?: "left" | "right" | undefined;
50
55
  /** CSS min-width attribute */
51
56
  minWidth?: string | undefined;
57
+ /** has license. If false, the button will be disabled with a license tooltip. Default to true */
58
+ hasLicense?: boolean | undefined;
59
+ /** tooltip tooltip props */
60
+ tooltip?: Omit<JRCTooltipProps, "children"> | undefined;
52
61
  } & DashedFocusBorderProps, never>;
53
62
  export declare const JRCButton: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "key" | keyof React.ButtonHTMLAttributes<HTMLButtonElement>> & DataCy & {
54
63
  /** Color of the background of the button */
@@ -69,4 +78,8 @@ export declare const JRCButton: React.ForwardRefExoticComponent<Pick<React.Detai
69
78
  float?: "left" | "right" | undefined;
70
79
  /** CSS min-width attribute */
71
80
  minWidth?: string | undefined;
81
+ /** has license. If false, the button will be disabled with a license tooltip. Default to true */
82
+ hasLicense?: boolean | undefined;
83
+ /** tooltip tooltip props */
84
+ tooltip?: Omit<JRCTooltipProps, "children"> | undefined;
72
85
  } & React.RefAttributes<HTMLButtonElement>>;
@@ -10,6 +10,8 @@ export declare const MarginLessJRCButton: import("styled-components").StyledComp
10
10
  variant?: "contained" | "outlined" | undefined;
11
11
  float?: "left" | "right" | undefined;
12
12
  minWidth?: string | undefined;
13
+ hasLicense?: boolean | undefined;
14
+ tooltip?: Omit<import("../..").JRCTooltipProps, "children"> | undefined;
13
15
  } & React.RefAttributes<HTMLButtonElement>>, any, ButtonProps, never>;
14
16
  export declare const MenuWithoutTitle: import("styled-components").StyledComponent<"div", any, {}, never>;
15
17
  export declare const MenuWithTitle: ({ direction, label, themeButton, children }: MenuWithTitleProps) => JSX.Element;
@@ -9,6 +9,7 @@ declare const ASPECTS: {
9
9
  '4:5': number;
10
10
  '9:16': number;
11
11
  };
12
+ export declare type ActionsPosition = 'top-left' | 'top-right';
12
13
  export declare type JRCCardImgProps = {
13
14
  color?: string;
14
15
  img?: string;
@@ -18,6 +19,10 @@ export declare type JRCCardImgProps = {
18
19
  aspect?: keyof typeof ASPECTS;
19
20
  href?: string;
20
21
  onClick?: (event: any) => any;
22
+ actions?: {
23
+ children: React.ReactNode;
24
+ position?: ActionsPosition;
25
+ };
21
26
  };
22
27
  export declare const JRCCardImg: (props: JRCCardImgProps) => JSX.Element;
23
28
  export {};
@@ -1,7 +1,6 @@
1
1
  import { DateFormat } from 'utils/utils.date';
2
2
  export interface JRCDateProps {
3
3
  date?: string;
4
- useHumanDisplay?: boolean;
5
4
  format?: DateFormat;
6
5
  }
7
6
  export declare const JRCDate: (props: JRCDateProps) => JSX.Element | null;
@@ -1,4 +1,5 @@
1
- declare type FlexBoxProps = {
1
+ import { FastCssProps } from '../Common/FastCss';
2
+ declare type FlexBoxProps = Omit<FastCssProps, 'display'> & {
2
3
  direction?: 'row' | 'column' | 'row-reverse' | 'column-reverse';
3
4
  inline?: boolean;
4
5
  flex?: boolean;
@@ -7,7 +8,15 @@ declare type FlexBoxProps = {
7
8
  y?: 'flex-start' | 'center' | 'flex-end';
8
9
  childFull?: boolean;
9
10
  };
10
- export declare const JRCFlexBox: import("styled-components").StyledComponent<"div", any, FlexBoxProps, never>;
11
+ export declare const JRCFlexBox: import("styled-components").StyledComponent<"div", any, Omit<FastCssProps, "display"> & {
12
+ direction?: "row" | "column" | "column-reverse" | "row-reverse" | undefined;
13
+ inline?: boolean | undefined;
14
+ flex?: boolean | undefined;
15
+ gap?: number | undefined;
16
+ x?: "center" | "flex-end" | "flex-start" | undefined;
17
+ y?: "center" | "flex-end" | "flex-start" | undefined;
18
+ childFull?: boolean | undefined;
19
+ }, never>;
11
20
  export declare type JRCFlexBoxProps = FlexBoxProps & {
12
21
  as?: string;
13
22
  };
@@ -10,6 +10,7 @@ export declare type JRCLinkToProps = DataCy & React.ComponentPropsWithoutRef<'a'
10
10
  declare type NativeProps = React.ComponentPropsWithoutRef<'a'> & {
11
11
  href: string;
12
12
  useLink?: boolean;
13
+ hasLicense?: boolean;
13
14
  };
14
15
  declare type AnchorProps = {
15
16
  as?: 'a';
@@ -18,8 +19,8 @@ declare type ButtonProps = {
18
19
  variant?: 'contained' | 'outlined';
19
20
  color?: 'primary' | 'valid' | 'danger' | 'secondary';
20
21
  float?: 'left' | 'right';
22
+ disabled?: boolean;
21
23
  children?: React.ReactNode;
22
- } & {
23
24
  as: 'button';
24
25
  };
25
26
  /**
@@ -27,5 +28,5 @@ declare type ButtonProps = {
27
28
  * @member as render the link styled as a button
28
29
  */
29
30
  export declare type JRCStyledHrefProps = DataCy & (AnchorProps | ButtonProps) & NativeProps;
30
- export declare const JRCStyledHref: ({ href, ...props }: JRCStyledHrefProps) => JSX.Element;
31
+ export declare const JRCStyledHref: ({ dataCy, hasLicense, href, useLink, ...props }: JRCStyledHrefProps) => JSX.Element;
31
32
  export {};
@@ -0,0 +1,6 @@
1
+ import { LimitLinesProps } from '../Common/LimitLines';
2
+ export declare type JRCHtmlProps = LimitLinesProps & {
3
+ className?: string;
4
+ html: string | undefined;
5
+ };
6
+ export declare const JRCHtml: ({ html, ...props }: JRCHtmlProps) => JSX.Element | null;
@@ -0,0 +1,5 @@
1
+ import { JRCHtmlProps } from './JRCHtml';
2
+ import { Meta, Story } from '@storybook/react';
3
+ declare const _default: Meta<import("@storybook/react").Args>;
4
+ export default _default;
5
+ export declare const Default: Story<JRCHtmlProps>;
@@ -5,14 +5,16 @@ import { DataCy } from '../../types/dataAttributes';
5
5
  /**
6
6
  * IconButton props
7
7
  * @member icon icon of the button
8
+ * @member size size of the button, default value, set to medium
8
9
  * @member onClick on click callback
9
10
  * @member name name (for form only)
10
11
  * @member value value (for form only)
11
12
  * @member disabled disable the button
12
- * @member size size of the button, default value, set to m
13
+ * @member type type of the button
14
+ * @member bgBaseGrey base grey color (hover, focus, disabled, default icon color will be compute from this base)
13
15
  * @member tooltip tooltip props
14
- * @member variant?: can be 'circle' | 'square' ;
15
-
16
+ * @member variant can be 'circle' | 'square';
17
+ * @member hasLicense If false, the button will be disabled with a license tooltip. Default to true
16
18
  */
17
19
  export declare type JRCIconButtonProps = React.ComponentPropsWithoutRef<'button'> & DataCy & {
18
20
  icon: string;
@@ -22,9 +24,11 @@ export declare type JRCIconButtonProps = React.ComponentPropsWithoutRef<'button'
22
24
  value?: string;
23
25
  disabled?: boolean;
24
26
  type?: 'submit' | 'reset' | 'button';
27
+ bgBaseGrey?: 0 | 1 | 2;
25
28
  color?: Colors | Shades | 'inherit';
26
29
  tooltip?: Omit<JRCTooltipProps, 'children'>;
27
30
  variant?: 'circle' | 'square';
31
+ hasLicense?: boolean;
28
32
  };
29
33
  declare const defaultProps: {
30
34
  onClick: () => void;
@@ -33,7 +37,7 @@ declare const defaultProps: {
33
37
  size: string;
34
38
  };
35
39
  declare const JRCIconButton: {
36
- (props: JRCIconButtonProps & typeof defaultProps): JSX.Element;
40
+ ({ hasLicense, ...props }: JRCIconButtonProps & typeof defaultProps): JSX.Element;
37
41
  defaultProps: {
38
42
  onClick: () => void;
39
43
  type: string;
@@ -298,7 +298,7 @@ export declare const AppTabContainer: import("styled-components").StyledComponen
298
298
  export declare const AppTab: import("styled-components").StyledComponent<"button", any, Open & {
299
299
  active?: boolean | undefined;
300
300
  }, never>;
301
- export declare const AppTabTooltip: import("styled-components").StyledComponent<({ condition, tooltip, children, className }: import("../Common/JRCConditionalWrapper").JRCConditionalTooltipProps) => JSX.Element, any, {}, never>;
301
+ export declare const AppTabTooltip: import("styled-components").StyledComponent<({ condition, hasLicense, tooltip, children, className, }: import("../Common/JRCConditionalWrapper").JRCConditionalTooltipProps) => JSX.Element, any, {}, never>;
302
302
  export declare const EllipsisWrapper: import("styled-components").StyledComponent<"span", any, Open, never>;
303
303
  export declare const AppTabNav: import("styled-components").StyledComponent<"nav", any, Open & {
304
304
  extraMargin: boolean;
@@ -72,6 +72,7 @@ export { JRCFormTextField } from './components/Form/Input/JRCFormText/JRCFormTex
72
72
  export { JRCFormUrlField } from './components/Form/Input/JRCFormURL/JRCFormUrl';
73
73
  export { JRCGrid } from './components/JRCGrid/JRCGrid';
74
74
  export { JRCH1, JRCH2, JRCH3, JRCH4, JRCH5, JRCText } from './components/JRCTypo/JRCTypo';
75
+ export { JRCHtml } from './components/JRCHtml/JRCHtml';
75
76
  export { JRCIcon } from './components/JRCIcon/JRCIcon';
76
77
  export { JRCIconButton } from './components/JRCIconButton/JRCIconButton';
77
78
  export { JRCImg } from './components/JRCImg/JRCImg';
@@ -33,6 +33,7 @@ export { JRCFormSelectProps } from './components/Form/Input/JRCFormSelect/JRCFor
33
33
  export { JRCFormSendAlertInputProps } from './components/Form/Input/JRCFormSendAlert/JRCFormSendAlert';
34
34
  export { JRCGridProps } from './components/JRCGrid/JRCGrid';
35
35
  export { JRCH1Props, JRCH2Props, JRCH3Props, JRCH4Props, JRCH5Props, JRCTextProps } from './components/JRCTypo/JRCTypo';
36
+ export { JRCHtmlProps } from './components/JRCHtml/JRCHtml';
36
37
  export { JRCIconButtonProps } from './components/JRCIconButton/JRCIconButton';
37
38
  export { JRCIconProps } from './components/JRCIcon/JRCIcon';
38
39
  export { JRCImgProps } from './components/JRCImg/JRCImg';
@@ -6,7 +6,7 @@ export interface extractDateProps {
6
6
  minutes: number;
7
7
  seconds: number;
8
8
  }
9
- export declare type DateFormat = 'date' | 'date-time' | 'date-time-sec';
9
+ export declare type DateFormat = 'date' | 'date-time' | 'date-time-sec' | 'time' | 'time-sec';
10
10
  export declare const extractDate: (str: string) => extractDateProps;
11
11
  /**
12
12
  * Convert date string to timestamp
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jamespot-react-components",
3
- "version": "1.0.110",
3
+ "version": "1.0.113",
4
4
  "description": "",
5
5
  "main": "./build/jamespot-react-components.js",
6
6
  "types": "./build/src/index.d.ts",
@@ -98,7 +98,7 @@
98
98
  "@tiptap/starter-kit": "^2.0.0-beta.203",
99
99
  "chroma-js": "^2.1.1",
100
100
  "classnames": "^2.3.1",
101
- "jamespot-user-api": "^1.0.82",
101
+ "jamespot-user-api": "^1.0.84",
102
102
  "moment": "^2.29.1",
103
103
  "react": "^17.x",
104
104
  "react-dnd": "^14.0.4",