jamespot-react-components 1.0.2 → 1.0.16
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/.storybook/StorybookContainer/StorybookContainer.css +1 -0
- package/babel.config.js +0 -1
- package/build/jamespot-react-components.js +254 -235
- package/build/jamespot-react-components.js.LICENSE.txt +19 -13
- 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/JRCAppContainer/JRCAppContainer.d.ts +1 -0
- 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/components/Templates/JRCBase.template.d.ts +9 -0
- package/build/src/components/Templates/JRCTemplate.stories.d.ts +13 -0
- package/build/src/components/Templates/JRCTwoColumns.template.d.ts +7 -0
- package/build/src/hooks/UseDidMountEffect.d.ts +1 -2
- package/build/src/index.d.ts +11 -8
- package/build/src/styles/theme.d.ts +4 -1
- package/build/src/types.d.ts +6 -2
- package/externals.d.ts +0 -1
- package/externals.json +3 -1
- package/package.json +4 -4
- 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/JRCAppContainer/JRCAppContainer.tsx +6 -2
- package/src/components/JRCAppLeftColumn/JRCAppLeftColumn.styles.tsx +2 -1
- package/src/components/JRCAvatar/JRCAvatar.test.tsx +10 -6
- package/src/components/JRCAvatar/JRCAvatar.tsx +1 -0
- 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/JRCButton/__snapshots__/JRCButton.test.tsx.snap +1 -2
- 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 +75 -61
- package/src/components/JRCTag/JRCTag.tsx +29 -9
- package/src/components/JRCThemeProvider/animation.css +19 -0
- package/src/components/JRCThemeProvider/font.css +1 -1
- package/src/components/JRCThemeProvider/gabarit.css +4 -0
- package/src/components/JRCTooltip/JRCTooltip.tsx +5 -2
- package/src/components/JRCTypography/__snapshots__/JRCTypography.test.tsx.snap +1 -1
- package/src/components/Templates/JRCBase.template.tsx +39 -0
- package/src/components/Templates/JRCTemplate.stories.tsx +55 -0
- package/src/components/Templates/JRCTwoColumns.template.tsx +20 -0
- package/src/hooks/UseDidMountEffect.tsx +1 -3
- package/src/index.tsx +17 -10
- package/src/styles/theme.tsx +12 -6
- package/src/translation/lang.json +3 -2
- package/src/types.ts +8 -2
- 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/build/src/components/JRCColumnCenterTitle/JRCColumnCenterTitle.d.ts +0 -12
- package/src/components/Form/Input/JRCFormTextEditor/JRCFormTextEditor.stories.tsx +0 -30
- package/src/components/Form/Input/JRCFormTextEditor/JRCFormTextEditor.tsx +0 -36
- package/src/components/JRCColumnCenterTitle/JRCColumnCenterTitle.tsx +0 -26
- package/src/variables.scss +0 -67
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { JRCTemplateBase, JRCTemplateBaseProps } from './JRCBase.template';
|
|
3
|
+
import { Story } from '@storybook/react';
|
|
4
|
+
import { JRCTemplateTwoColumns, JRCTemplateTwoColumnsProps } from './JRCTwoColumns.template';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'JRCTemplateBase',
|
|
8
|
+
component: JRCTemplateBase,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const Template: Story<JRCTemplateBaseProps> = (args: JRCTemplateBaseProps) => {
|
|
12
|
+
return <JRCTemplateBase {...args}>{args.children}</JRCTemplateBase>;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const BaseTemplateDemo = Template.bind({});
|
|
16
|
+
BaseTemplateDemo.args = {
|
|
17
|
+
children: 'App content',
|
|
18
|
+
title: 'content title',
|
|
19
|
+
};
|
|
20
|
+
export const BaseTemplateDemoLoading = Template.bind({});
|
|
21
|
+
BaseTemplateDemoLoading.args = {
|
|
22
|
+
children: 'App content',
|
|
23
|
+
isLoading: true,
|
|
24
|
+
title: 'content title',
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const TemplateWithLeftColumn: Story<JRCTemplateTwoColumnsProps<any>> = (args: JRCTemplateTwoColumnsProps<any>) => {
|
|
28
|
+
return <JRCTemplateTwoColumns {...args}>{args.children}</JRCTemplateTwoColumns>;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const TemplateWithLeftColumnDemo = TemplateWithLeftColumn.bind({});
|
|
32
|
+
TemplateWithLeftColumnDemo.args = {
|
|
33
|
+
children: 'App content',
|
|
34
|
+
title: 'content title',
|
|
35
|
+
leftColumn: {
|
|
36
|
+
icon: 'icon-edit',
|
|
37
|
+
color: 'red',
|
|
38
|
+
title: 'App title',
|
|
39
|
+
description: 'description',
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const TemplateWithLeftColumnDemoLoading = TemplateWithLeftColumn.bind({});
|
|
44
|
+
|
|
45
|
+
TemplateWithLeftColumnDemoLoading.args = {
|
|
46
|
+
children: 'App content',
|
|
47
|
+
title: 'content title',
|
|
48
|
+
isLoading: true,
|
|
49
|
+
leftColumn: {
|
|
50
|
+
icon: 'icon-edit',
|
|
51
|
+
color: 'red',
|
|
52
|
+
title: 'App title',
|
|
53
|
+
description: 'description',
|
|
54
|
+
},
|
|
55
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { JRCAppContainer, JRCAppLeftColumn } from 'index';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { JRCAppLeftColumnProps, SectionEntry } from 'types';
|
|
4
|
+
import { ChildrenContainer, JRCTemplateBaseProps } from './JRCBase.template';
|
|
5
|
+
|
|
6
|
+
export type JRCTemplateTwoColumnsProps<T extends SectionEntry> = {
|
|
7
|
+
leftColumn: JRCAppLeftColumnProps<T>;
|
|
8
|
+
} & JRCTemplateBaseProps;
|
|
9
|
+
|
|
10
|
+
export const JRCTemplateTwoColumns: React.FC<any> = <T extends SectionEntry>(props: JRCTemplateTwoColumnsProps<T>) => {
|
|
11
|
+
const { icon, color, title, description } = props.leftColumn;
|
|
12
|
+
return (
|
|
13
|
+
<JRCAppContainer>
|
|
14
|
+
<JRCAppLeftColumn icon={icon} color={color} title={title} description={description} />
|
|
15
|
+
<ChildrenContainer title={props.title} isLoading={props.isLoading}>
|
|
16
|
+
{props.children}
|
|
17
|
+
</ChildrenContainer>
|
|
18
|
+
</JRCAppContainer>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DependencyList, useEffect, useRef } from 'react';
|
|
2
2
|
|
|
3
|
-
const useDidMountEffect = (func: Function, deps: DependencyList) => {
|
|
3
|
+
export const useDidMountEffect = (func: Function, deps: DependencyList) => {
|
|
4
4
|
const didMount = useRef(false);
|
|
5
5
|
|
|
6
6
|
useEffect(() => {
|
|
@@ -8,5 +8,3 @@ const useDidMountEffect = (func: Function, deps: DependencyList) => {
|
|
|
8
8
|
else didMount.current = true;
|
|
9
9
|
}, deps);
|
|
10
10
|
};
|
|
11
|
-
|
|
12
|
-
export default useDidMountEffect;
|
package/src/index.tsx
CHANGED
|
@@ -10,6 +10,7 @@ import * as jamespotUserApi from 'jamespot-user-api';
|
|
|
10
10
|
import * as reactDnd from 'react-dnd';
|
|
11
11
|
import * as reactDndHtml5Backend from 'react-dnd-html5-backend';
|
|
12
12
|
import * as reactHookForm from 'react-hook-form';
|
|
13
|
+
import * as reactRouterDom from 'react-router-dom';
|
|
13
14
|
|
|
14
15
|
/****
|
|
15
16
|
* DECLARE SHARED LIBRARIES ON GLOBAL
|
|
@@ -17,6 +18,8 @@ import * as reactHookForm from 'react-hook-form';
|
|
|
17
18
|
|
|
18
19
|
declare global {
|
|
19
20
|
interface Window {
|
|
21
|
+
React: any;
|
|
22
|
+
ReactDOM: any;
|
|
20
23
|
jamespotUserApi: any;
|
|
21
24
|
reactRedux: any;
|
|
22
25
|
redux: any;
|
|
@@ -27,6 +30,7 @@ declare global {
|
|
|
27
30
|
reactDnd: any;
|
|
28
31
|
reactDndHtml5Backend: any;
|
|
29
32
|
reactHookForm: any;
|
|
33
|
+
reactRouterDom: any;
|
|
30
34
|
}
|
|
31
35
|
}
|
|
32
36
|
|
|
@@ -43,6 +47,7 @@ window.styledComponents = styled;
|
|
|
43
47
|
window.reactDnd = reactDnd;
|
|
44
48
|
window.reactDndHtml5Backend = reactDndHtml5Backend;
|
|
45
49
|
window.reactHookForm = reactHookForm;
|
|
50
|
+
window.reactRouterDom = reactRouterDom;
|
|
46
51
|
|
|
47
52
|
/****
|
|
48
53
|
*
|
|
@@ -54,6 +59,7 @@ import JRCAlert from './components/JRCAlert/JRCAlert';
|
|
|
54
59
|
export { JRCAlert };
|
|
55
60
|
|
|
56
61
|
export { JRCAppHeader } from './components/JRCAppHeader/JRCAppHeader';
|
|
62
|
+
|
|
57
63
|
export { JRCAppContainer } from './components/JRCAppContainer/JRCAppContainer';
|
|
58
64
|
export { JRCAppLeftColumn } from './components/JRCAppLeftColumn/JRCAppLeftColumn';
|
|
59
65
|
|
|
@@ -77,9 +83,6 @@ export { JRCCard } from './components/JRCCard/JRCCard';
|
|
|
77
83
|
import JRCColumnCenter from './components/JRCColumnCenter/JRCColumnCenter';
|
|
78
84
|
export { JRCColumnCenter };
|
|
79
85
|
|
|
80
|
-
import JRCColumnCenterTitle from './components/JRCColumnCenterTitle/JRCColumnCenterTitle';
|
|
81
|
-
export { JRCColumnCenterTitle };
|
|
82
|
-
|
|
83
86
|
import JRCColumnLeft from './components/JRCColumnLeft/JRCColumnLeft';
|
|
84
87
|
export { JRCColumnLeft };
|
|
85
88
|
|
|
@@ -90,6 +93,8 @@ export { JRCConditionalWrapper } from './components/Common/JRCConditionalWrapper
|
|
|
90
93
|
|
|
91
94
|
export { JRCDate } from './components/JRCDate/JRCDate';
|
|
92
95
|
|
|
96
|
+
export { JRCEllipsis } from './components/JRCEllipsis/JRCEllipsis';
|
|
97
|
+
|
|
93
98
|
export { JRCFormCheckbox } from './components/Form/Input/JRCFormCheckbox/JRCFormCheckbox';
|
|
94
99
|
|
|
95
100
|
export { JRCFormColorField } from './components/Form/Input/JRCFormColor/JRCFormColor';
|
|
@@ -128,8 +133,6 @@ export { JRCPagination };
|
|
|
128
133
|
|
|
129
134
|
export { JRCFormTextarea, JRCFormTextareaField } from './components/Form/Input/JRCFormTextarea/JRCFormTextarea';
|
|
130
135
|
|
|
131
|
-
export { JRCFormTextEditorField } from './components/Form/Input/JRCFormTextEditor/JRCFormTextEditor';
|
|
132
|
-
|
|
133
136
|
export { JRCList } from './components/JRCList/JRCList';
|
|
134
137
|
|
|
135
138
|
import JRCModalImg from './components/JRCModalImg/JRCModalImg';
|
|
@@ -171,18 +174,17 @@ import { JRCH1, JRCH2, JRCH3, JRCH4, JRCH5, JRCText } from './components/JRCTypo
|
|
|
171
174
|
export { JRCH1, JRCH2, JRCH3, JRCH4, JRCH5, JRCText };
|
|
172
175
|
|
|
173
176
|
import { JRCTypography } from './components/JRCTypography/JRCTypography';
|
|
177
|
+
import { JRCAppHeader } from 'components/JRCAppHeader/JRCAppHeader';
|
|
174
178
|
export { JRCTypography };
|
|
175
179
|
|
|
176
180
|
export { JRCValidationButton } from './components/JRCButton/JRCValidationButton';
|
|
177
181
|
|
|
178
|
-
|
|
179
|
-
export {
|
|
182
|
+
export { default as Theme } from './styles/theme';
|
|
183
|
+
export { default as Resources } from './translation';
|
|
180
184
|
|
|
181
|
-
import Resources from './translation';
|
|
182
185
|
export { useTimeout } from './hooks/UseTimeout';
|
|
183
186
|
export { useDebounce } from './hooks/UseDebounce';
|
|
184
|
-
export {
|
|
185
|
-
export { Resources };
|
|
187
|
+
export { useDidMountEffect } from './hooks/UseDidMountEffect';
|
|
186
188
|
|
|
187
189
|
export { StyledInput } from './components/Form/Input/JRCStyledInput';
|
|
188
190
|
|
|
@@ -192,6 +194,11 @@ export { JRCInputSelect } from './components/Form/Input/JRCSelect/JRCInputSelect
|
|
|
192
194
|
export { JRCInputAutocomplete } from './components/Form/Input/JRCSelect/JRCInputAutocomplete';
|
|
193
195
|
export { JRCInputCommunity } from './components/Form/Input/JRCSelect/JRCAutocompleteCommunity';
|
|
194
196
|
export { JRCInputText } from './components/Form/Input/JRCInputText/JRCInputText';
|
|
197
|
+
export { JRCInputTextarea } from './components/Form/Input/JRCInputTextarea/JRCInputTextarea';
|
|
198
|
+
export { JRCInputDate } from './components/Form/Input/JRCInputDate/JRCInputDate';
|
|
199
|
+
|
|
200
|
+
export { JRCTemplateBase } from './components/Templates/JRCBase.template';
|
|
201
|
+
export { JRCTemplateTwoColumns } from './components/Templates/JRCTwoColumns.template';
|
|
195
202
|
|
|
196
203
|
/****
|
|
197
204
|
*
|
package/src/styles/theme.tsx
CHANGED
|
@@ -7,6 +7,7 @@ export interface ITheme {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export type ThemeConfigOptions = {
|
|
10
|
+
fontFamily: string;
|
|
10
11
|
linkColor: string;
|
|
11
12
|
buttonColor: string;
|
|
12
13
|
headerColor: string;
|
|
@@ -49,7 +50,6 @@ export type Colors =
|
|
|
49
50
|
| 'white';
|
|
50
51
|
type ThemeConfigColorType = { [color in Colors]: string };
|
|
51
52
|
|
|
52
|
-
// contained hover | outlined pressed | outlined hover | contained pressed
|
|
53
53
|
export type Shades =
|
|
54
54
|
| 'primaryL15'
|
|
55
55
|
| 'primaryL80'
|
|
@@ -66,19 +66,21 @@ export type Shades =
|
|
|
66
66
|
type ThemeConfigShadeType = { [color in Shades]: string };
|
|
67
67
|
|
|
68
68
|
export type FontWeight = {
|
|
69
|
+
light: number;
|
|
69
70
|
normal: number;
|
|
70
71
|
medium: number;
|
|
72
|
+
semiBold: number;
|
|
71
73
|
bold: number;
|
|
72
74
|
};
|
|
73
75
|
|
|
74
76
|
export type ThemeType = {
|
|
77
|
+
dpr: number;
|
|
75
78
|
font: {
|
|
76
79
|
family: string;
|
|
77
80
|
color: string;
|
|
78
81
|
hrefColor: string;
|
|
79
82
|
size: string;
|
|
80
83
|
lineHeight: string;
|
|
81
|
-
fontWeight: number;
|
|
82
84
|
weight: FontWeight;
|
|
83
85
|
};
|
|
84
86
|
color: ThemeConfigColorType & ThemeConfigShadeType;
|
|
@@ -147,7 +149,7 @@ const Theme: ITheme = {
|
|
|
147
149
|
black15: '#00000026',
|
|
148
150
|
black20: '#00000033',
|
|
149
151
|
|
|
150
|
-
grey6: '#
|
|
152
|
+
grey6: '#2E2E33',
|
|
151
153
|
grey5: '#4A4A52',
|
|
152
154
|
grey4: '#848491',
|
|
153
155
|
grey3: '#BEBED1',
|
|
@@ -175,18 +177,22 @@ const Theme: ITheme = {
|
|
|
175
177
|
};
|
|
176
178
|
|
|
177
179
|
this.config = {
|
|
180
|
+
dpr: Math.ceil(window?.devicePixelRatio || 2),
|
|
178
181
|
font: {
|
|
179
182
|
// Before using these properties, check JRCTypo.tsx
|
|
180
|
-
family:
|
|
183
|
+
family:
|
|
184
|
+
options && options.fontFamily
|
|
185
|
+
? "'" + options.fontFamily + "', sans-serif"
|
|
186
|
+
: "'Poppins', sans-serif",
|
|
181
187
|
color: defaultColors.grey5,
|
|
182
188
|
hrefColor: defaultColors.secondary,
|
|
183
189
|
size: '16px',
|
|
184
190
|
lineHeight: '1.5em',
|
|
185
|
-
// @deprecated
|
|
186
|
-
fontWeight: 400,
|
|
187
191
|
weight: {
|
|
192
|
+
light: 300,
|
|
188
193
|
normal: 400,
|
|
189
194
|
medium: 500,
|
|
195
|
+
semiBold: 600,
|
|
190
196
|
bold: 700,
|
|
191
197
|
},
|
|
192
198
|
},
|
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
"GLOBAL_Form_Controls_MinValue": "Must be at least {min}",
|
|
8
8
|
"GLOBAL_Form_Controls_MaxValue": "Must be at max {max}",
|
|
9
9
|
"GLOBAL_Form_Controls_Pattern": "Must follow the specified pattern {pattern}",
|
|
10
|
+
"GLOBAL_Error_occurred": "An error occurred",
|
|
10
11
|
"GLOBAL_Form_No_Options": "No options",
|
|
11
12
|
"GLOBAL_Form_Characters": "characters",
|
|
12
13
|
"GLOBAL_Loading": "Loading",
|
|
13
14
|
"GLOBAL_Validation": "Confirm",
|
|
14
|
-
"GLOBAL_Error_occurred": "An error occurred",
|
|
15
15
|
"GROUP_more": "More",
|
|
16
16
|
"GLOBAL_Select": "Select",
|
|
17
17
|
"ERROR_Mail_Invalid": "Must be a valid email",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"AppLeftColumn_App_Navigation": "App navigation",
|
|
25
25
|
"GLOBAL_Today": "Today",
|
|
26
26
|
"GLOBAL_Yesterday": "Yesterday",
|
|
27
|
-
"GLOBAL_Unsuported_File_Format": "Unsuported file format"
|
|
27
|
+
"GLOBAL_Unsuported_File_Format": "Unsuported file format",
|
|
28
|
+
"GLOBAL_Move": "Move"
|
|
28
29
|
}
|
|
29
30
|
}
|
package/src/types.ts
CHANGED
|
@@ -33,14 +33,13 @@ export { JRCButtonProps };
|
|
|
33
33
|
export { JRCButtonDropdownProps } from './components/JRCButtonDropdown/JRCButtonDropdown';
|
|
34
34
|
import { JRCColumnCenterProps } from './components/JRCColumnCenter/JRCColumnCenter';
|
|
35
35
|
export { JRCColumnCenterProps };
|
|
36
|
-
import { JRCColumnCenterTitleProps } from './components/JRCColumnCenterTitle/JRCColumnCenterTitle';
|
|
37
|
-
export { JRCColumnCenterTitleProps };
|
|
38
36
|
import { JRCColumnLeftProps } from './components/JRCColumnLeft/JRCColumnLeft';
|
|
39
37
|
export { JRCColumnLeftProps };
|
|
40
38
|
import { JRCColumnRightProps } from './components/JRCColumnRight/JRCColumnRight';
|
|
41
39
|
export { JRCColumnRightProps };
|
|
42
40
|
export { JRCDateProps } from './components/JRCDate/JRCDate';
|
|
43
41
|
export { JRCDropDownProps } from './components/JRCDropDown/JRCDropDown';
|
|
42
|
+
export { JRCEllipsisProps } from './components/JRCEllipsis/JRCEllipsis';
|
|
44
43
|
export { JRCFileOpenProps } from './components/JRCFileOpen/JRCFileOpen';
|
|
45
44
|
import { JRCGridProps } from './components/JRCGrid/JRCGrid';
|
|
46
45
|
export { JRCGridProps };
|
|
@@ -78,11 +77,18 @@ import { JRCValueLabelProps } from './components/Form/Common/types';
|
|
|
78
77
|
export { JRCValueLabelProps };
|
|
79
78
|
import { JRCWritableFormInputProps } from './components/Form/Input/JRCFormFieldRender';
|
|
80
79
|
export { JRCWritableFormInputProps };
|
|
80
|
+
|
|
81
|
+
export { JRCTemplateBaseProps } from './components/Templates/JRCBase.template';
|
|
82
|
+
export { JRCTemplateTwoColumnsProps } from './components/Templates/JRCTwoColumns.template';
|
|
83
|
+
|
|
81
84
|
import { JRCTypographyProps } from './components/JRCTypography/JRCTypography.d';
|
|
82
85
|
export { JRCTypographyProps };
|
|
83
86
|
export { JRCValidationButtonProps } from './components/JRCButton/JRCValidationButton';
|
|
84
87
|
|
|
85
88
|
export * from './components/Form/Input/JRCInputCheckbox/JRCInputCheckbox.types';
|
|
89
|
+
export { JRCInputDateProps } from './components/Form/Input/JRCInputDate/JRCInputDate';
|
|
90
|
+
export { JRCInputTextProps } from './components/Form/Input/JRCInputText/JRCInputText';
|
|
91
|
+
export { JRCInputTextareaProps } from './components/Form/Input/JRCInputTextarea/JRCInputTextarea';
|
|
86
92
|
export { JRCInputFieldProps } from './components/Form/Input/Common/JRCFormFieldRenderer.types';
|
|
87
93
|
export { JRCInputSelectProps } from './components/Form/Input/JRCSelect/JRCInputSelect.types';
|
|
88
94
|
export { JRCAutocompleteProps } from './components/Form/Input/JRCSelect/JRCInputSelect.types';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { JRCWritableFormInputProps } from '../JRCFormFieldRender';
|
|
2
|
-
import 'react-quill/dist/quill.snow.css';
|
|
3
|
-
/**
|
|
4
|
-
* @deprecated The component @link JRCFormRichTextField must be used to replace JRCFormTextEditorField
|
|
5
|
-
* Component used as a rich text editor
|
|
6
|
-
* @param props JRCWritableFormInputProps
|
|
7
|
-
* validation props: minValue, maxValue, required
|
|
8
|
-
* @returns JSX.Element
|
|
9
|
-
*/
|
|
10
|
-
export declare const JRCFormTextEditorField: (props: JRCWritableFormInputProps) => JSX.Element;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { JRCWritableFormInputProps } from '../JRCFormFieldRender';
|
|
2
|
-
import { Meta, Story } from '@storybook/react';
|
|
3
|
-
declare const _default: Meta<import("@storybook/react").Args>;
|
|
4
|
-
export default _default;
|
|
5
|
-
export declare const InputTextEditor: Story<JRCWritableFormInputProps>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Props type for JRCColumnCenterTitle
|
|
4
|
-
* @member title string : column title content
|
|
5
|
-
* @member children enclosed React component (rendered after the title)
|
|
6
|
-
*/
|
|
7
|
-
export interface JRCColumnCenterTitleProps {
|
|
8
|
-
title: string;
|
|
9
|
-
children: React.ReactNode;
|
|
10
|
-
}
|
|
11
|
-
declare const JRCColumnCenterTitle: (props: JRCColumnCenterTitleProps) => JSX.Element;
|
|
12
|
-
export default JRCColumnCenterTitle;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { withReduxForm } from '../../../../storybook/decorators';
|
|
3
|
-
import { JRCWritableFormInputProps } from '../JRCFormFieldRender';
|
|
4
|
-
import { JRCFormTextEditorField } from './JRCFormTextEditor';
|
|
5
|
-
import { Meta, Story } from '@storybook/react';
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
title: 'Inputs/old',
|
|
9
|
-
component: JRCFormTextEditorField,
|
|
10
|
-
decorators: [withReduxForm],
|
|
11
|
-
} as Meta;
|
|
12
|
-
|
|
13
|
-
const Template: Story<JRCWritableFormInputProps> = (args) => (
|
|
14
|
-
<>
|
|
15
|
-
<h1>Deprecated: use RichTextEditor</h1>
|
|
16
|
-
<JRCFormTextEditorField {...args} />
|
|
17
|
-
</>
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
export const InputTextEditor = Template.bind({});
|
|
21
|
-
InputTextEditor.args = {
|
|
22
|
-
name: 'name-storybook',
|
|
23
|
-
label: 'Article',
|
|
24
|
-
description: 'Ecrivez un article captivant pour vos auditeurs, ni trop long, ni trop court, juste suffisant.',
|
|
25
|
-
placeholder: "Moi, j'aime les haricots",
|
|
26
|
-
helper: { description: 'Si vis pacem, para bellum', title: 'Indication' },
|
|
27
|
-
minLength: 3,
|
|
28
|
-
maxLength: 2500,
|
|
29
|
-
required: false,
|
|
30
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Field, WrappedFieldInputProps } from 'redux-form';
|
|
3
|
-
import JRCFormFieldRender, { JRCWritableFormInputProps } from '../JRCFormFieldRender';
|
|
4
|
-
import { useControls } from '../ReduxFormControls';
|
|
5
|
-
import ReactQuill from 'react-quill';
|
|
6
|
-
import 'react-quill/dist/quill.snow.css';
|
|
7
|
-
import { useIntl } from 'react-intl';
|
|
8
|
-
|
|
9
|
-
const renderInput = (input: WrappedFieldInputProps) => {
|
|
10
|
-
return <ReactQuill theme="snow" value={input.value} onChange={input.onChange} />;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* @deprecated The component @link JRCFormRichTextField must be used to replace JRCFormTextEditorField
|
|
15
|
-
* Component used as a rich text editor
|
|
16
|
-
* @param props JRCWritableFormInputProps
|
|
17
|
-
* validation props: minValue, maxValue, required
|
|
18
|
-
* @returns JSX.Element
|
|
19
|
-
*/
|
|
20
|
-
export const JRCFormTextEditorField = (props: JRCWritableFormInputProps) => {
|
|
21
|
-
const validate = useControls({
|
|
22
|
-
intl: useIntl(),
|
|
23
|
-
minLength: props.minLength,
|
|
24
|
-
maxLength: props.maxLength,
|
|
25
|
-
required: props.required,
|
|
26
|
-
});
|
|
27
|
-
return (
|
|
28
|
-
<Field
|
|
29
|
-
component={JRCFormFieldRender}
|
|
30
|
-
renderInputFct={(input: WrappedFieldInputProps) => renderInput(input)}
|
|
31
|
-
validate={validate}
|
|
32
|
-
htmlFor={props.name}
|
|
33
|
-
{...props}
|
|
34
|
-
/>
|
|
35
|
-
);
|
|
36
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import styled from 'styled-components';
|
|
3
|
-
import { JRCH1 } from '../JRCTypo/JRCTypo';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Props type for JRCColumnCenterTitle
|
|
7
|
-
* @member title string : column title content
|
|
8
|
-
* @member children enclosed React component (rendered after the title)
|
|
9
|
-
*/
|
|
10
|
-
export interface JRCColumnCenterTitleProps {
|
|
11
|
-
title: string;
|
|
12
|
-
children: React.ReactNode;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const StyledDiv = styled.div`
|
|
16
|
-
border-bottom: 1px solid rgba(0, 0, 0, 0.08);
|
|
17
|
-
`;
|
|
18
|
-
|
|
19
|
-
const JRCColumnCenterTitle = (props: JRCColumnCenterTitleProps) => (
|
|
20
|
-
<StyledDiv>
|
|
21
|
-
<JRCH1>{props.title}</JRCH1>
|
|
22
|
-
{props.children}
|
|
23
|
-
</StyledDiv>
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
export default JRCColumnCenterTitle;
|
package/src/variables.scss
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
// COLORS //
|
|
2
|
-
|
|
3
|
-
// Primary Color
|
|
4
|
-
$linkColor: rgb(52, 230, 243);
|
|
5
|
-
|
|
6
|
-
// Originals colors
|
|
7
|
-
$grey: #a7a7a7;
|
|
8
|
-
$blue: #3ec3ef;
|
|
9
|
-
$blueDark: #0064cd;
|
|
10
|
-
$green: #4dbf96;
|
|
11
|
-
$red: #f67370;
|
|
12
|
-
$yellow: #f8d120;
|
|
13
|
-
$orange: #f89406;
|
|
14
|
-
$pink: #c3325f;
|
|
15
|
-
$purple: #7a43b6;
|
|
16
|
-
|
|
17
|
-
// black to white
|
|
18
|
-
$black: #000000;
|
|
19
|
-
$white: #ffffff;
|
|
20
|
-
|
|
21
|
-
// --------------------------------- //
|
|
22
|
-
|
|
23
|
-
// TEXT //
|
|
24
|
-
|
|
25
|
-
// Fonts
|
|
26
|
-
$sansSerif: sans-serif;
|
|
27
|
-
|
|
28
|
-
// Line height
|
|
29
|
-
$lineHeightBase: 18px;
|
|
30
|
-
|
|
31
|
-
// Text Color
|
|
32
|
-
$textColor: #3f3f3f;
|
|
33
|
-
$textColorBlur: #858585;
|
|
34
|
-
|
|
35
|
-
// Text Weights
|
|
36
|
-
$fontWeightLight: 300;
|
|
37
|
-
$fontWeightBase: 400;
|
|
38
|
-
$fontWeightBold: 700;
|
|
39
|
-
|
|
40
|
-
// Text Sizes
|
|
41
|
-
$fontSizeHeader: 22px;
|
|
42
|
-
$fontSizeTitle: 18px;
|
|
43
|
-
$fontSizeBase: 14.5px;
|
|
44
|
-
$fontSizeSmall: 12px;
|
|
45
|
-
|
|
46
|
-
// Text Modal Window
|
|
47
|
-
$fontSizeTitleModal: 18px;
|
|
48
|
-
|
|
49
|
-
// --------------------------------- //
|
|
50
|
-
|
|
51
|
-
// PADDINGS & MARGINS (En cours de réflexion) //
|
|
52
|
-
|
|
53
|
-
// Paddings
|
|
54
|
-
$paddingLight: 4px;
|
|
55
|
-
$paddingBase: 8px;
|
|
56
|
-
$paddingMedium: 16px;
|
|
57
|
-
$paddingBold: 24px;
|
|
58
|
-
$paddingExtraBold: 32px;
|
|
59
|
-
$paddingBlack: 48px;
|
|
60
|
-
|
|
61
|
-
// Margins
|
|
62
|
-
$marginLight: 4px;
|
|
63
|
-
$marginBase: 8px;
|
|
64
|
-
$marginMedium: 16px;
|
|
65
|
-
$marginBold: 24px;
|
|
66
|
-
$marginExtraBold: 32px;
|
|
67
|
-
$marginBlack: 48px;
|