jamespot-react-components 1.0.1 → 1.0.9
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.
- package/.github/workflows/increment-npm-version.yml +26 -0
- package/build/jamespot-react-components.js +247 -231
- package/build/jamespot-react-components.js.LICENSE.txt +0 -16
- package/build/jamespot-react-components.js.map +1 -1
- package/build/src/components/Common/JRCConditionalWrapper.d.ts +4 -4
- package/build/src/components/Form/Input/JRCInputCheckbox/JRCInputCheckbox.d.ts +5 -2
- package/build/src/components/Form/Input/JRCInputDate/JRCInputDate.d.ts +11 -0
- package/build/src/components/Form/Input/JRCInputDate/JRCInputDate.stories.d.ts +5 -0
- package/build/src/components/Form/Input/JRCInputText/JRCInputText.d.ts +1 -1
- package/build/src/components/Form/Input/JRCInputTextarea/JRCInputTextarea.d.ts +15 -0
- package/build/src/components/Form/Input/JRCInputTextarea/JRCInputTextarea.stories.d.ts +5 -0
- package/build/src/components/JRCAppLeftColumn/JRCAppLeftColumn.d.ts +1 -1
- package/build/src/components/JRCButton/JRCButton.d.ts +25 -0
- package/build/src/components/JRCButton/JRCButtonConfig.d.ts +1 -2
- package/build/src/components/JRCEllipsis/JRCEllipsis.d.ts +5 -0
- package/build/src/components/JRCEllipsis/JRCEllipsis.stories.d.ts +5 -0
- package/build/src/components/JRCHref/JRCHref.d.ts +18 -10
- package/build/src/components/JRCImg/url.util.d.ts +3 -3
- package/build/src/components/JRCList/JRCList.d.ts +2 -0
- package/build/src/components/JRCModal/JRCModal.d.ts +5 -1
- package/build/src/components/JRCModal/JRCModal.styles.d.ts +0 -1
- package/build/src/components/JRCTag/JRCTag.d.ts +2 -0
- package/build/src/hooks/UseDidMountEffect.d.ts +1 -2
- package/build/src/index.d.ts +8 -7
- package/build/src/styles/theme.d.ts +1 -0
- package/build/src/types.d.ts +4 -0
- package/externals.d.ts +0 -1
- package/externals.json +2 -1
- package/package.json +5 -5
- package/src/components/Common/JRCConditionalWrapper.tsx +6 -13
- package/src/components/Form/Input/JRCFormColor/JRCFormColor.tsx +12 -12
- package/src/components/Form/Input/JRCFormEmail/JRCInputEmail.tsx +4 -8
- package/src/components/Form/Input/JRCFormSelect/JRCFormSelect.tsx +5 -1
- package/src/components/Form/Input/JRCFormSelect/JRCFormSelectTag.tsx +3 -1
- package/src/components/Form/Input/JRCInputCheckbox/JRCInputCheckbox.stories.tsx +1 -4
- package/src/components/Form/Input/JRCInputCheckbox/JRCInputCheckbox.tsx +12 -10
- package/src/components/Form/Input/JRCInputDate/JRCInputDate.stories.tsx +50 -0
- package/src/components/Form/Input/JRCInputDate/JRCInputDate.tsx +26 -0
- package/src/components/Form/Input/JRCInputText/JRCInputText.tsx +2 -2
- package/src/components/Form/Input/JRCInputTextarea/JRCInputTextarea.stories.tsx +52 -0
- package/src/components/Form/Input/JRCInputTextarea/JRCInputTextarea.tsx +36 -0
- package/src/components/Form/Input/JRCSelect/JRCInputSelect.tsx +1 -1
- package/src/components/JRCAppLeftColumn/JRCAppLeftColumn.tsx +1 -1
- package/src/components/JRCButton/JRCButton.stories.tsx +1 -1
- package/src/components/JRCButton/JRCButton.tsx +9 -3
- package/src/components/JRCButton/JRCButtonConfig.tsx +1 -1
- package/src/components/JRCButton/JRCValidationButton.tsx +10 -4
- package/src/components/JRCButtonDropdown/JRCButtonDropdown.tsx +2 -2
- package/src/components/JRCEllipsis/JRCEllipsis.stories.tsx +18 -0
- package/src/components/JRCEllipsis/JRCEllipsis.tsx +22 -0
- package/src/components/JRCHref/JRCHref.stories.tsx +2 -0
- package/src/components/JRCHref/JRCHref.tsx +42 -15
- package/src/components/JRCIcon/JRCIcon.tsx +1 -1
- package/src/components/JRCIconButton/JRCIconButton.tsx +1 -4
- package/src/components/JRCImg/JRCImg.tsx +4 -2
- package/src/components/JRCImg/url.util.ts +7 -6
- package/src/components/JRCImg/url.utils.test.ts +7 -1
- package/src/components/JRCList/JRCList.styles.tsx +16 -2
- package/src/components/JRCList/JRCList.tsx +5 -5
- package/src/components/JRCList/JRCListMockData.stories.tsx +1 -1
- package/src/components/JRCModal/JRCModal.styles.tsx +0 -6
- package/src/components/JRCModal/JRCModal.tsx +77 -62
- package/src/components/JRCTag/JRCTag.tsx +29 -9
- package/src/components/JRCThemeProvider/animation.css +19 -0
- package/src/components/JRCThemeProvider/gabarit.css +4 -0
- package/src/components/JRCTooltip/JRCTooltip.tsx +5 -2
- package/src/hooks/UseDidMountEffect.tsx +1 -3
- package/src/index.tsx +9 -10
- package/src/styles/theme.tsx +3 -2
- package/src/translation/lang.json +3 -2
- package/src/types.ts +4 -0
- package/tsconfig.json +1 -0
- package/build/src/components/Form/Input/JRCFormTextEditor/JRCFormTextEditor.d.ts +0 -10
- package/build/src/components/Form/Input/JRCFormTextEditor/JRCFormTextEditor.stories.d.ts +0 -5
- package/src/components/Form/Input/JRCFormTextEditor/JRCFormTextEditor.stories.tsx +0 -30
- package/src/components/Form/Input/JRCFormTextEditor/JRCFormTextEditor.tsx +0 -36
- package/src/variables.scss +0 -67
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export interface JRCConditionalWrapperProps {
|
|
3
3
|
condition: boolean;
|
|
4
|
-
wrapper: (children: React.ReactNode) => React.
|
|
5
|
-
wrapperFalse?: (children: React.ReactNode) => React.
|
|
6
|
-
children?: React.
|
|
4
|
+
wrapper: (children: React.ReactNode) => React.ReactNode;
|
|
5
|
+
wrapperFalse?: (children: React.ReactNode) => React.ReactNode;
|
|
6
|
+
children?: React.ReactNode;
|
|
7
7
|
}
|
|
8
|
-
export declare const JRCConditionalWrapper: ({ condition, wrapper, wrapperFalse, children
|
|
8
|
+
export declare const JRCConditionalWrapper: ({ condition, wrapper, wrapperFalse, children }: JRCConditionalWrapperProps) => JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { ControllerRenderProps } from 'react-hook-form/dist/types/controller';
|
|
2
3
|
import { DataCy } from '../../../../types/dataAttributes';
|
|
3
4
|
import { JRCInputFieldProps } from '../Common/JRCFormFieldRenderer.types';
|
|
4
|
-
declare type Value<T> = string | number | T;
|
|
5
5
|
declare type CheckboxOption<TFieldValues> = {
|
|
6
6
|
label: string | JSX.Element;
|
|
7
|
-
value:
|
|
7
|
+
value: string | number | TFieldValues;
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
};
|
|
10
10
|
export declare type CheckboxProps<TFieldValues> = DataCy & {
|
|
@@ -20,6 +20,9 @@ export declare type CheckboxProps<TFieldValues> = DataCy & {
|
|
|
20
20
|
valueTypeIsBoolean?: boolean;
|
|
21
21
|
};
|
|
22
22
|
export declare type JRCInputCheckboxProps<TFieldValues> = CheckboxProps<TFieldValues> & JRCInputFieldProps<TFieldValues>;
|
|
23
|
+
export declare type NativeCheckboxProps<TFieldValues> = CheckboxProps<TFieldValues> & Omit<ControllerRenderProps<TFieldValues>, 'value'> & {
|
|
24
|
+
value: TFieldValues | TFieldValues[];
|
|
25
|
+
};
|
|
23
26
|
export declare function JRCInputCheckbox<TFieldValues>({ name, control, rules, label, htmlFor, labelIsLegend, description, helper, ...props }: JRCInputCheckboxProps<TFieldValues>): JSX.Element;
|
|
24
27
|
export declare namespace JRCInputCheckbox {
|
|
25
28
|
var defaultProps: {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { JRCInputFieldProps } from '../Common/JRCFormFieldRenderer.types';
|
|
3
|
+
import { DataCy } from '../../../../types/dataAttributes';
|
|
4
|
+
export declare type JRCInputDateProps = DataCy & React.ComponentPropsWithoutRef<'input'>;
|
|
5
|
+
/**
|
|
6
|
+
* Component used as a <input type="date"/>
|
|
7
|
+
* @param props JRCInputFieldProps
|
|
8
|
+
* validation props: required
|
|
9
|
+
* @returns JSX.Element
|
|
10
|
+
*/
|
|
11
|
+
export declare function JRCInputDate<T>(props: JRCInputFieldProps<T>): JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { JRCInputFieldProps } from '../Common/JRCFormFieldRenderer.types';
|
|
2
|
+
import { Meta, Story } from '@storybook/react';
|
|
3
|
+
declare const _default: Meta<import("@storybook/react").Args>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const InputDate: Story<JRCInputFieldProps<"date">>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { JRCInputFieldProps } from '../Common/JRCFormFieldRenderer.types';
|
|
3
3
|
import { DataCy } from '../../../../types/dataAttributes';
|
|
4
|
-
export declare type
|
|
4
|
+
export declare type JRCInputTextProps = DataCy & React.ComponentPropsWithoutRef<'input'>;
|
|
5
5
|
/**
|
|
6
6
|
* Component used as a <input type="text"/>
|
|
7
7
|
* @param props JRCInputFieldProps
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { JRCInputFieldProps } from '../Common/JRCFormFieldRenderer.types';
|
|
3
|
+
import { DataCy } from '../../../../types/dataAttributes';
|
|
4
|
+
export declare type JRCInputTextareaProps = DataCy & React.ComponentPropsWithoutRef<'textarea'>;
|
|
5
|
+
export declare const StyledTextArea: import("styled-components").StyledComponent<"textarea", any, DataCy & {
|
|
6
|
+
error?: boolean | undefined;
|
|
7
|
+
valid?: boolean | undefined;
|
|
8
|
+
}, never>;
|
|
9
|
+
/**
|
|
10
|
+
* Component used as a <input type="text"/>
|
|
11
|
+
* @param props JRCInputFieldProps
|
|
12
|
+
* validation props: required
|
|
13
|
+
* @returns JSX.Element
|
|
14
|
+
*/
|
|
15
|
+
export declare function JRCInputTextarea<T>(props: JRCInputFieldProps<T>): JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { JRCInputFieldProps } from '../Common/JRCFormFieldRenderer.types';
|
|
2
|
+
import { Meta, Story } from '@storybook/react';
|
|
3
|
+
declare const _default: Meta<import("@storybook/react").Args>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const InputTextarea: Story<JRCInputFieldProps<"textarea">>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { JRCAppLeftColumnProps, SectionEntry } from './JRCAppLeftColumn.types';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* /!\ This component should be use into JRCAppContainer
|
|
4
4
|
* @param Component
|
|
5
5
|
* @param {sections, icon, color, title, description, activeItem, callback} props, @see JRCAppLeftColumnProps interface
|
|
6
6
|
* @returns JSX.Element
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { JRCIconProps } from '../JRCIcon/JRCIcon';
|
|
3
|
+
import { ButtonType } from './JRCButtonConfig';
|
|
3
4
|
import { DataCy } from '../../types/dataAttributes';
|
|
4
5
|
export declare type JRCButtonProps = React.ComponentPropsWithoutRef<'button'> & DataCy & {
|
|
5
6
|
/** Color of the background of the button */
|
|
@@ -20,6 +21,30 @@ export declare type JRCButtonProps = React.ComponentPropsWithoutRef<'button'> &
|
|
|
20
21
|
minWidth?: string;
|
|
21
22
|
};
|
|
22
23
|
export declare const transformColor: (color?: string | undefined) => JRCIconProps['color'];
|
|
24
|
+
/**
|
|
25
|
+
* Button styling. May be used as a <a> tag
|
|
26
|
+
*/
|
|
27
|
+
export declare const Button: import("styled-components").StyledComponent<"button", any, {
|
|
28
|
+
themeButton: ButtonType;
|
|
29
|
+
hasChildren: boolean;
|
|
30
|
+
} & Pick<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "key" | keyof React.ButtonHTMLAttributes<HTMLButtonElement>> & DataCy & {
|
|
31
|
+
/** Color of the background of the button */
|
|
32
|
+
color?: "primary" | "valid" | "danger" | "secondary" | undefined;
|
|
33
|
+
/** Indicates loading of content on the button */
|
|
34
|
+
loader?: boolean | undefined;
|
|
35
|
+
/** This Boolean attribute specifies that the button should have input focus when the page loads */
|
|
36
|
+
autofocus?: boolean | undefined;
|
|
37
|
+
/** Defines the value associated with the button’s name when it’s submitted with the form data */
|
|
38
|
+
value?: string | undefined;
|
|
39
|
+
/** Enhance your button with an icon */
|
|
40
|
+
icon?: string | undefined;
|
|
41
|
+
/** The variant is used to define what type of action the button will take */
|
|
42
|
+
variant?: "contained" | "outlined" | undefined;
|
|
43
|
+
/** CSS float attribute */
|
|
44
|
+
float?: "left" | "right" | undefined;
|
|
45
|
+
/** CSS min-width attribute */
|
|
46
|
+
minWidth?: string | undefined;
|
|
47
|
+
}, never>;
|
|
23
48
|
declare const JRCButton: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "key" | keyof React.ButtonHTMLAttributes<HTMLButtonElement>> & DataCy & {
|
|
24
49
|
/** Color of the background of the button */
|
|
25
50
|
color?: "primary" | "valid" | "danger" | "secondary" | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const
|
|
1
|
+
export declare const BUTTON_CONFIG: {
|
|
2
2
|
contained: {
|
|
3
3
|
primary: {
|
|
4
4
|
color: string;
|
|
@@ -134,7 +134,6 @@ declare const _default: {
|
|
|
134
134
|
};
|
|
135
135
|
};
|
|
136
136
|
};
|
|
137
|
-
export default _default;
|
|
138
137
|
export declare type ButtonType = {
|
|
139
138
|
color: string;
|
|
140
139
|
background: string;
|
|
@@ -2,20 +2,28 @@ import * as React from 'react';
|
|
|
2
2
|
import { DataCy } from '../../types/dataAttributes';
|
|
3
3
|
/**
|
|
4
4
|
* Props type for JRCLinkToArticle and JRCLinkToUser
|
|
5
|
-
* @member
|
|
6
|
-
* @member href string : href for href
|
|
7
|
-
* @member children: enclosed React component
|
|
5
|
+
* @member idObject number : id of the record
|
|
8
6
|
*/
|
|
9
|
-
export
|
|
7
|
+
export declare type JRCLinkToProps = DataCy & React.ComponentPropsWithoutRef<'a'> & {
|
|
10
8
|
idObject?: number;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
};
|
|
10
|
+
declare type AnchorProps = {
|
|
11
|
+
as?: 'a';
|
|
12
|
+
};
|
|
13
|
+
declare type ButtonProps = {
|
|
14
|
+
variant?: 'contained' | 'outlined';
|
|
15
|
+
color?: 'primary' | 'valid' | 'danger' | 'secondary';
|
|
16
|
+
float?: 'left' | 'right';
|
|
17
|
+
children?: React.ReactNode;
|
|
18
|
+
} & {
|
|
19
|
+
as: 'button';
|
|
20
|
+
};
|
|
14
21
|
/**
|
|
15
22
|
* Props type for JRCStyledHref
|
|
16
|
-
* @
|
|
23
|
+
* @member as render the link styled as a button
|
|
17
24
|
*/
|
|
18
|
-
export declare type JRCStyledHrefProps = DataCy & React.ComponentPropsWithoutRef<'a'
|
|
19
|
-
export declare const JRCStyledHref:
|
|
25
|
+
export declare type JRCStyledHrefProps = DataCy & React.ComponentPropsWithoutRef<'a'> & (AnchorProps | ButtonProps);
|
|
26
|
+
export declare const JRCStyledHref: (props: JRCStyledHrefProps) => JSX.Element;
|
|
20
27
|
export declare const JRCLinkToArticle: ({ idObject, href, children, ...props }: JRCLinkToProps) => JSX.Element;
|
|
21
28
|
export declare const JRCLinkToUser: ({ idObject, href, children, ...props }: JRCLinkToProps) => JSX.Element;
|
|
29
|
+
export {};
|
|
@@ -39,10 +39,10 @@ export declare type ImgUrlProps = {
|
|
|
39
39
|
format?: string;
|
|
40
40
|
timestamp?: string | number;
|
|
41
41
|
};
|
|
42
|
-
export declare function getFrom(arg: Pick<ImgUrlProps, 'from'>): string
|
|
42
|
+
export declare function getFrom(arg: Pick<ImgUrlProps, 'from'>): string;
|
|
43
43
|
export declare function getTimestamp(arg: Timestamp): string;
|
|
44
44
|
export declare function getUri(arg: UriOrTypeId): string;
|
|
45
|
-
export declare function getSize(arg: Size & WidthHeight): string;
|
|
45
|
+
export declare function getSize(arg: Size & WidthHeight, dpr?: number): string;
|
|
46
46
|
export declare function getFormat(arg: Format): string;
|
|
47
47
|
export declare function getUrl(url: string): URL | undefined;
|
|
48
48
|
/**
|
|
@@ -58,5 +58,5 @@ export declare function getUrl(url: string): URL | undefined;
|
|
|
58
58
|
* The final url is {from}/{size}/{uri}.{format}?_={timestamp}
|
|
59
59
|
* @param arg
|
|
60
60
|
*/
|
|
61
|
-
export declare function formatImgUrl(arg: ImgUrlProps): string;
|
|
61
|
+
export declare function formatImgUrl(arg: ImgUrlProps, dpr?: number): string;
|
|
62
62
|
export {};
|
|
@@ -6,6 +6,7 @@ import type { Orders } from 'jamespot-user-api';
|
|
|
6
6
|
* @member data default react-table data props
|
|
7
7
|
* @member eventHandlers event handlers: onDrag, onSort and onPage. You Must rearrange the array of data when these events are dispatched
|
|
8
8
|
* @member config config object. See the Type for use
|
|
9
|
+
* @member className className
|
|
9
10
|
*/
|
|
10
11
|
export declare type JRCListProps<T extends Record<string, unknown>> = {
|
|
11
12
|
columns: Array<Column<T>>;
|
|
@@ -26,5 +27,6 @@ export declare type JRCListProps<T extends Record<string, unknown>> = {
|
|
|
26
27
|
nbResults: number;
|
|
27
28
|
};
|
|
28
29
|
};
|
|
30
|
+
className?: string;
|
|
29
31
|
};
|
|
30
32
|
export declare const JRCList: <T extends Record<string, unknown>>(props: JRCListProps<T>) => JSX.Element;
|
|
@@ -23,6 +23,8 @@ export interface JRCModalButtonType extends ComponentPropsWithoutRef<'button'> {
|
|
|
23
23
|
* @member enableClickAwayCloseModal boolean to enable the close of the Modal by Click Outside of Modal
|
|
24
24
|
* @member children default ReactNode children in the Modal content
|
|
25
25
|
* @member portalId id attribute for createPortal
|
|
26
|
+
* @member inPlace if true, does not use a portal
|
|
27
|
+
* @member className use for overriding the styled-components styles
|
|
26
28
|
*/
|
|
27
29
|
export interface JRCModalProps {
|
|
28
30
|
open: boolean;
|
|
@@ -35,6 +37,8 @@ export interface JRCModalProps {
|
|
|
35
37
|
isFull?: boolean;
|
|
36
38
|
headerButtons?: ReactNode;
|
|
37
39
|
portalId?: string;
|
|
40
|
+
inPlace?: boolean;
|
|
41
|
+
className?: string;
|
|
38
42
|
}
|
|
39
|
-
declare const JRCModal:
|
|
43
|
+
declare const JRCModal: React.ForwardRefExoticComponent<JRCModalProps & React.RefAttributes<HTMLDivElement>>;
|
|
40
44
|
export default JRCModal;
|
|
@@ -4,6 +4,5 @@ export declare const JRCModalContainer: import("styled-components").StyledCompon
|
|
|
4
4
|
export declare const JRCModalContent: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
5
|
export declare const JRCModalContentScrollbox: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
6
6
|
export declare const JRCModalHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
7
|
-
export declare const JRCModalHeaderTitle: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
8
7
|
export declare const JRCModalFooter: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
9
8
|
export declare const JRCModalClose: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -13,6 +13,7 @@ import { UriOrTypeId } from 'components/Form/Common/types';
|
|
|
13
13
|
* @member focusable - whether the element is focusable. Independant of onClick property
|
|
14
14
|
* @member isFocused - whether the element is focused. Property used with variant for styling the component
|
|
15
15
|
* @member tooltipDescription - if present, show a tooltip with the description
|
|
16
|
+
* @member clickVariant - whether the hover/focus style is a selectable item or a deletable item
|
|
16
17
|
*/
|
|
17
18
|
export declare type JRCTagProps<T> = UriOrTypeId & {
|
|
18
19
|
collapsed?: boolean;
|
|
@@ -25,5 +26,6 @@ export declare type JRCTagProps<T> = UriOrTypeId & {
|
|
|
25
26
|
isFocused?: boolean;
|
|
26
27
|
tooltipDescription?: string;
|
|
27
28
|
alt?: string;
|
|
29
|
+
clickVariant?: 'select' | 'delete';
|
|
28
30
|
};
|
|
29
31
|
export declare function JRCTag<T>(props: JRCTagProps<T>): JSX.Element;
|
package/build/src/index.d.ts
CHANGED
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
*/
|
|
4
4
|
declare global {
|
|
5
5
|
interface Window {
|
|
6
|
+
React: any;
|
|
7
|
+
ReactDOM: any;
|
|
6
8
|
jamespotUserApi: any;
|
|
7
9
|
reactRedux: any;
|
|
8
10
|
redux: any;
|
|
9
11
|
reduxForm: any;
|
|
10
12
|
reactIntl: any;
|
|
11
13
|
reactSelect: any;
|
|
12
|
-
reactTransitionGroup: any;
|
|
13
14
|
styledComponents: any;
|
|
14
15
|
reactDnd: any;
|
|
15
16
|
reactDndHtml5Backend: any;
|
|
@@ -46,6 +47,7 @@ import JRCColumnRight from './components/JRCColumnRight/JRCColumnRight';
|
|
|
46
47
|
export { JRCColumnRight };
|
|
47
48
|
export { JRCConditionalWrapper } from './components/Common/JRCConditionalWrapper';
|
|
48
49
|
export { JRCDate } from './components/JRCDate/JRCDate';
|
|
50
|
+
export { JRCEllipsis } from './components/JRCEllipsis/JRCEllipsis';
|
|
49
51
|
export { JRCFormCheckbox } from './components/Form/Input/JRCFormCheckbox/JRCFormCheckbox';
|
|
50
52
|
export { JRCFormColorField } from './components/Form/Input/JRCFormColor/JRCFormColor';
|
|
51
53
|
export { JRCFormDatetimeField } from './components/Form/Input/JRCFormDateTime/JRCFormDateTime';
|
|
@@ -66,7 +68,6 @@ export { JRCGrid };
|
|
|
66
68
|
import JRCPagination from './components/JRCPagination/JRCPagination';
|
|
67
69
|
export { JRCPagination };
|
|
68
70
|
export { JRCFormTextarea, JRCFormTextareaField } from './components/Form/Input/JRCFormTextarea/JRCFormTextarea';
|
|
69
|
-
export { JRCFormTextEditorField } from './components/Form/Input/JRCFormTextEditor/JRCFormTextEditor';
|
|
70
71
|
export { JRCList } from './components/JRCList/JRCList';
|
|
71
72
|
import JRCModalImg from './components/JRCModalImg/JRCModalImg';
|
|
72
73
|
export { JRCModalImg };
|
|
@@ -96,13 +97,11 @@ export { JRCH1, JRCH2, JRCH3, JRCH4, JRCH5, JRCText };
|
|
|
96
97
|
import { JRCTypography } from './components/JRCTypography/JRCTypography';
|
|
97
98
|
export { JRCTypography };
|
|
98
99
|
export { JRCValidationButton } from './components/JRCButton/JRCValidationButton';
|
|
99
|
-
|
|
100
|
-
export {
|
|
101
|
-
import Resources from './translation';
|
|
100
|
+
export { default as Theme } from './styles/theme';
|
|
101
|
+
export { default as Resources } from './translation';
|
|
102
102
|
export { useTimeout } from './hooks/UseTimeout';
|
|
103
103
|
export { useDebounce } from './hooks/UseDebounce';
|
|
104
|
-
export {
|
|
105
|
-
export { Resources };
|
|
104
|
+
export { useDidMountEffect } from './hooks/UseDidMountEffect';
|
|
106
105
|
export { StyledInput } from './components/Form/Input/JRCStyledInput';
|
|
107
106
|
export { JRCInputCheckbox } from './components/Form/Input/JRCInputCheckbox/JRCInputCheckbox';
|
|
108
107
|
export { JRCInputEmail } from './components/Form/Input/JRCFormEmail/JRCInputEmail';
|
|
@@ -110,6 +109,8 @@ export { JRCInputSelect } from './components/Form/Input/JRCSelect/JRCInputSelect
|
|
|
110
109
|
export { JRCInputAutocomplete } from './components/Form/Input/JRCSelect/JRCInputAutocomplete';
|
|
111
110
|
export { JRCInputCommunity } from './components/Form/Input/JRCSelect/JRCAutocompleteCommunity';
|
|
112
111
|
export { JRCInputText } from './components/Form/Input/JRCInputText/JRCInputText';
|
|
112
|
+
export { JRCInputTextarea } from './components/Form/Input/JRCInputTextarea/JRCInputTextarea';
|
|
113
|
+
export { JRCInputDate } from './components/Form/Input/JRCInputDate/JRCInputDate';
|
|
113
114
|
/****
|
|
114
115
|
*
|
|
115
116
|
* PLEASE RESPECT ALPHABETICAL ORDER
|
package/build/src/types.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ import { JRCColumnRightProps } from './components/JRCColumnRight/JRCColumnRight'
|
|
|
39
39
|
export { JRCColumnRightProps };
|
|
40
40
|
export { JRCDateProps } from './components/JRCDate/JRCDate';
|
|
41
41
|
export { JRCDropDownProps } from './components/JRCDropDown/JRCDropDown';
|
|
42
|
+
export { JRCEllipsisProps } from './components/JRCEllipsis/JRCEllipsis';
|
|
42
43
|
export { JRCFileOpenProps } from './components/JRCFileOpen/JRCFileOpen';
|
|
43
44
|
import { JRCGridProps } from './components/JRCGrid/JRCGrid';
|
|
44
45
|
export { JRCGridProps };
|
|
@@ -80,6 +81,9 @@ import { JRCTypographyProps } from './components/JRCTypography/JRCTypography.d';
|
|
|
80
81
|
export { JRCTypographyProps };
|
|
81
82
|
export { JRCValidationButtonProps } from './components/JRCButton/JRCValidationButton';
|
|
82
83
|
export * from './components/Form/Input/JRCInputCheckbox/JRCInputCheckbox.types';
|
|
84
|
+
export { JRCInputDateProps } from './components/Form/Input/JRCInputDate/JRCInputDate';
|
|
85
|
+
export { JRCInputTextProps } from './components/Form/Input/JRCInputText/JRCInputText';
|
|
86
|
+
export { JRCInputTextareaProps } from './components/Form/Input/JRCInputTextarea/JRCInputTextarea';
|
|
83
87
|
export { JRCInputFieldProps } from './components/Form/Input/Common/JRCFormFieldRenderer.types';
|
|
84
88
|
export { JRCInputSelectProps } from './components/Form/Input/JRCSelect/JRCInputSelect.types';
|
|
85
89
|
export { JRCAutocompleteProps } from './components/Form/Input/JRCSelect/JRCInputSelect.types';
|
package/externals.d.ts
CHANGED
package/externals.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jamespot-react-components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/jamespot-react-components.js",
|
|
6
6
|
"types": "./build/src/index.d.ts",
|
|
@@ -87,6 +87,7 @@
|
|
|
87
87
|
"dependencies": {
|
|
88
88
|
"@quickbaseoss/babel-plugin-styled-components-css-namespace": "^1.0.1",
|
|
89
89
|
"@tiptap/extension-color": "^2.0.0-beta.8",
|
|
90
|
+
"@tiptap/extension-heading": "^2.0.0-beta.23",
|
|
90
91
|
"@tiptap/extension-link": "^2.0.0-beta.28",
|
|
91
92
|
"@tiptap/extension-text-align": "^2.0.0-beta.28",
|
|
92
93
|
"@tiptap/extension-text-style": "^2.0.0-beta.22",
|
|
@@ -95,22 +96,21 @@
|
|
|
95
96
|
"@types/redux-logger": "^3.0.8",
|
|
96
97
|
"chroma-js": "^2.1.1",
|
|
97
98
|
"classnames": "^2.3.1",
|
|
98
|
-
"jamespot-user-api": "
|
|
99
|
+
"jamespot-user-api": "1.0.13",
|
|
99
100
|
"moment": "^2.29.1",
|
|
100
|
-
"react": "^17.
|
|
101
|
+
"react": "^17.x",
|
|
101
102
|
"react-dnd": "^14.0.4",
|
|
102
103
|
"react-dnd-html5-backend": "^14.0.2",
|
|
103
104
|
"react-dom": "^17.0.2",
|
|
104
105
|
"react-hook-form": "^7.25.0",
|
|
105
106
|
"react-intl": "^5.8.6",
|
|
106
|
-
"react-quill": "^1.3.5",
|
|
107
107
|
"react-redux": "^7.2.3",
|
|
108
108
|
"react-select": "^3.2.0",
|
|
109
109
|
"react-slick": "^0.28.1",
|
|
110
110
|
"react-table": "^7.7.0",
|
|
111
111
|
"react-tooltip": "^4.2.21",
|
|
112
112
|
"redux": "^4.0.5",
|
|
113
|
-
"redux-form": "^8.
|
|
113
|
+
"redux-form": "^8.x",
|
|
114
114
|
"redux-logger": "^3.0.6",
|
|
115
115
|
"slick-carousel": "^1.8.1",
|
|
116
116
|
"styled-components": "^5.2.1",
|
|
@@ -2,18 +2,11 @@ import * as React from 'react';
|
|
|
2
2
|
|
|
3
3
|
export interface JRCConditionalWrapperProps {
|
|
4
4
|
condition: boolean;
|
|
5
|
-
wrapper: (children: React.ReactNode) => React.
|
|
6
|
-
wrapperFalse?: (children: React.ReactNode) => React.
|
|
7
|
-
children?: React.
|
|
5
|
+
wrapper: (children: React.ReactNode) => React.ReactNode;
|
|
6
|
+
wrapperFalse?: (children: React.ReactNode) => React.ReactNode;
|
|
7
|
+
children?: React.ReactNode;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
export const JRCConditionalWrapper = ({
|
|
11
|
-
condition
|
|
12
|
-
|
|
13
|
-
wrapperFalse,
|
|
14
|
-
children,
|
|
15
|
-
}: JRCConditionalWrapperProps): React.ReactElement =>
|
|
16
|
-
// FIXME TYPESCRIPT-STRICT
|
|
17
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
18
|
-
// @ts-ignore
|
|
19
|
-
condition ? wrapper(children) : wrapperFalse ? wrapperFalse(children) : children;
|
|
10
|
+
export const JRCConditionalWrapper = ({ condition, wrapper, wrapperFalse, children }: JRCConditionalWrapperProps) => (
|
|
11
|
+
<>{condition ? wrapper(children) : wrapperFalse ? wrapperFalse(children) : children}</>
|
|
12
|
+
);
|
|
@@ -8,32 +8,32 @@ import { ClickAwayListener } from '../../Common/ClickAwayListener';
|
|
|
8
8
|
|
|
9
9
|
const StyledInputColor = styled.input.attrs(() => ({ type: 'color' }))<FormInputProps>`
|
|
10
10
|
&&& {
|
|
11
|
-
padding: 8px;
|
|
12
|
-
margin: 0px;
|
|
13
11
|
width: 40px;
|
|
14
12
|
height: 40px;
|
|
13
|
+
border: none;
|
|
14
|
+
padding: 0;
|
|
15
|
+
margin: 0;
|
|
15
16
|
cursor: pointer;
|
|
16
|
-
border-radius:
|
|
17
|
-
text-align: center;
|
|
17
|
+
border-radius: 8px;
|
|
18
18
|
box-sizing: border-box;
|
|
19
19
|
::-webkit-color-swatch {
|
|
20
20
|
border-color: transparent;
|
|
21
|
+
border: none;
|
|
21
22
|
}
|
|
22
23
|
::-moz-color-swatch {
|
|
23
24
|
border-color: transparent;
|
|
25
|
+
border: none;
|
|
26
|
+
}
|
|
27
|
+
::-webkit-color-swatch-wrapper {
|
|
28
|
+
padding: 0;
|
|
24
29
|
}
|
|
25
30
|
}
|
|
26
31
|
`;
|
|
27
32
|
|
|
28
33
|
const Container = styled.div`
|
|
29
|
-
display: flex;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
justify-content: flex-start;
|
|
33
|
-
align-items: center;
|
|
34
|
-
margin: 0px;
|
|
35
|
-
padding: 5px;
|
|
36
|
-
border-radius: 4px;
|
|
34
|
+
display: inline-flex;
|
|
35
|
+
border-radius: 8px;
|
|
36
|
+
overflow: hidden;
|
|
37
37
|
`;
|
|
38
38
|
|
|
39
39
|
const JRCFormColorFieldRender = (input: WrappedFieldInputProps, props: JRCWritableFormInputProps) => {
|
|
@@ -2,15 +2,11 @@ import * as React from 'react';
|
|
|
2
2
|
import { StyledInput } from '../JRCStyledInput';
|
|
3
3
|
import { JRCInputFieldProps } from '../Common/JRCFormFieldRenderer.types';
|
|
4
4
|
import { JRCFormFieldRenderer } from '../Common/JRCFormFieldRenderer';
|
|
5
|
+
import { JRCInputTextProps } from '../JRCInputText/JRCInputText';
|
|
5
6
|
|
|
6
|
-
const RenderInput = React.forwardRef(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
// @ts-ignore
|
|
10
|
-
(props: React.ComponentPropsWithoutRef<'input'>, ref: React.RefCallback<HTMLInputElement>) => {
|
|
11
|
-
return <StyledInput type="text" id={props.name} {...props} ref={ref} />;
|
|
12
|
-
},
|
|
13
|
-
);
|
|
7
|
+
const RenderInput = React.forwardRef((props: JRCInputTextProps, ref: React.ForwardedRef<HTMLInputElement>) => {
|
|
8
|
+
return <StyledInput type="text" id={props.name} {...props} ref={ref} />;
|
|
9
|
+
});
|
|
14
10
|
|
|
15
11
|
/**
|
|
16
12
|
* Component used as a <input type="text"/>
|
|
@@ -150,7 +150,11 @@ export const JRCFormSelectInput = (props: any) => {
|
|
|
150
150
|
const intl = useIntl();
|
|
151
151
|
const { selectedOption, onInputChange, components, placeholder, options, ...otherProps } = props;
|
|
152
152
|
|
|
153
|
-
const [loadedOptions, setLoadedOptions] = React.useState(
|
|
153
|
+
const [loadedOptions, setLoadedOptions] = React.useState([]);
|
|
154
|
+
|
|
155
|
+
React.useEffect(() => {
|
|
156
|
+
if (!props.asyncPromise) setLoadedOptions(options);
|
|
157
|
+
}, [options]);
|
|
154
158
|
|
|
155
159
|
React.useEffect(() => {
|
|
156
160
|
if (props.frontFiltering && props.asyncPromise) {
|
|
@@ -49,6 +49,7 @@ const JRCFormSelectTagRenderer = <T,>(
|
|
|
49
49
|
onMouseDown={props.removeProps.onMouseDown}
|
|
50
50
|
onClick={(e) => props.removeProps.onClick(e)}
|
|
51
51
|
focusable={true}
|
|
52
|
+
clickVariant="delete"
|
|
52
53
|
isFocused={props.isFocused}
|
|
53
54
|
uri={props.data.uri}
|
|
54
55
|
label={getOptionLabel(props)}
|
|
@@ -60,7 +61,7 @@ const JRCFormSelectTagRenderer = <T,>(
|
|
|
60
61
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
61
62
|
// @ts-ignore
|
|
62
63
|
SingleValue: (props: SingleValueProps<OptionTypeBase>) => (
|
|
63
|
-
<JRCTag uri={props.data.uri} label={getOptionLabel(props)} />
|
|
64
|
+
<JRCTag uri={props.data.uri} label={getOptionLabel(props)} clickVariant="delete" />
|
|
64
65
|
),
|
|
65
66
|
// FIXME TYPESCRIPT-STRICT
|
|
66
67
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -88,6 +89,7 @@ const Option = <isMulti extends boolean>(props: OptionProps<OptionTypeBase, isMu
|
|
|
88
89
|
<JRCTag
|
|
89
90
|
uri={props.data.uri}
|
|
90
91
|
focusable={true}
|
|
92
|
+
clickVariant="select"
|
|
91
93
|
isFocused={props.isFocused}
|
|
92
94
|
label={getOptionLabel(props)}
|
|
93
95
|
/>
|
|
@@ -13,7 +13,7 @@ export default {
|
|
|
13
13
|
const Template: Story<JRCInputCheckboxProps<any>> = (args) => {
|
|
14
14
|
const { handleSubmit, control } = useForm({
|
|
15
15
|
defaultValues: {
|
|
16
|
-
|
|
16
|
+
checkbox: [],
|
|
17
17
|
},
|
|
18
18
|
criteriaMode: 'all',
|
|
19
19
|
});
|
|
@@ -23,9 +23,6 @@ const Template: Story<JRCInputCheckboxProps<any>> = (args) => {
|
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
return (
|
|
26
|
-
// FIXME TYPESCRIPT-STRICT
|
|
27
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
28
|
-
// @ts-ignore
|
|
29
26
|
<form onSubmit={handleSubmit(onSubmit)}>
|
|
30
27
|
<JRCInputCheckbox {...args} control={control as any} />
|
|
31
28
|
<input type="submit" />
|