jamespot-react-components 1.0.0 → 1.0.3

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 (63) hide show
  1. package/.github/workflows/deploy-dev-branches.yml +1 -1
  2. package/.github/workflows/increment-npm-version.yml +26 -0
  3. package/.github/workflows/npm-package.yml +33 -0
  4. package/build/jamespot-react-components.js +505 -310
  5. package/build/jamespot-react-components.js.LICENSE.txt +0 -16
  6. package/build/jamespot-react-components.js.map +1 -1
  7. package/build/src/components/Common/util/getColor.util.d.ts +2 -0
  8. package/build/src/components/Form/Common/FormHelper.d.ts +1 -0
  9. package/build/src/components/Form/Input/JRCFormCheckbox/JRCFormCheckbox.style.d.ts +5 -2
  10. package/build/src/components/Form/Input/JRCFormCheckbox/JRCToggle.d.ts +2 -1
  11. package/build/src/components/Form/Input/{JRCFormCheckbox → JRCInputCheckbox}/JRCInputCheckbox.d.ts +1 -1
  12. package/build/src/components/Form/Input/{JRCFormCheckbox → JRCInputCheckbox}/JRCInputCheckbox.stories.d.ts +1 -1
  13. package/build/src/components/Form/Input/JRCInputCheckbox/JRCInputCheckbox.types.d.ts +25 -0
  14. package/build/src/components/JRCAlert/JRCAlert.d.ts +2 -2
  15. package/build/src/components/JRCAppContainer/JRCAppContainer.d.ts +6 -0
  16. package/build/src/components/JRCAppHeader/JRCAppHeader.d.ts +4 -1
  17. package/build/src/components/JRCAppHeader/JRCAppHeader.styles.d.ts +3 -1
  18. package/build/src/components/JRCAppLeftColumn/JRCAppLeftColumn.d.ts +9 -0
  19. package/build/src/components/JRCAppLeftColumn/JRCAppLeftColumn.stories.d.ts +8 -0
  20. package/build/src/components/JRCAppLeftColumn/JRCAppLeftColumn.styles.d.ts +55 -0
  21. package/build/src/components/JRCAppLeftColumn/JRCAppLeftColumn.types.d.ts +59 -0
  22. package/build/src/components/JRCAppLeftColumn/JRCDefaultMenu.d.ts +2 -0
  23. package/build/src/components/JRCButtonDropdown/JRCButtonDropdown.d.ts +4 -0
  24. package/build/src/components/JRCCard/JRCCard.d.ts +5 -1
  25. package/build/src/components/JRCFileOpen/JRCFileOpen.d.ts +9 -0
  26. package/build/src/components/JRCFileOpen/extensions.d.ts +1 -0
  27. package/build/src/components/JRCIconButton/JRCIconButton.d.ts +5 -0
  28. package/build/src/components/JRCList/JRCList.d.ts +8 -3
  29. package/build/src/components/JRCList/JRCList.stories.d.ts +2 -1
  30. package/build/src/components/JRCList/JRCList.styles.d.ts +8 -7
  31. package/build/src/components/JRCLoader/JRCLoader.d.ts +6 -2
  32. package/build/src/components/JRCLoader/JRCLoader.stories.d.ts +2 -1
  33. package/build/src/components/JRCLoader/JRCSkeleton.d.ts +1 -0
  34. package/build/src/components/JRCMenuItem/JRCMenuItem.d.ts +21 -0
  35. package/build/src/components/JRCModal/JRCModal.d.ts +6 -4
  36. package/build/src/components/JRCModal/JRCModal.stories.d.ts +1 -0
  37. package/build/src/components/JRCModal/JRCModal.styles.d.ts +3 -9
  38. package/build/src/components/JRCTabs/JRCTabs.d.ts +7 -5
  39. package/build/src/components/JRCTooltip/JRCTooltip.d.ts +1 -1
  40. package/build/src/hooks/UseTimeout.d.ts +7 -0
  41. package/build/src/index.d.ts +10 -4
  42. package/build/src/types.d.ts +6 -2
  43. package/externals.d.ts +0 -1
  44. package/package.json +11 -11
  45. package/src/components/Common/util/getColor.util.ts +12 -0
  46. package/src/components/Form/Input/JRCFormColor/JRCFormColor.stories.tsx +1 -1
  47. package/src/components/Form/Input/JRCFormColor/JRCFormColor.tsx +5 -345
  48. package/src/components/JRCAlert/JRCAlert.tsx +3 -15
  49. package/src/components/JRCAppLeftColumn/JRCAppLeftColumn.tsx +1 -1
  50. package/src/components/JRCCard/JRCCard.tsx +6 -4
  51. package/src/components/JRCLoader/JRCLoader.stories.tsx +6 -1
  52. package/src/components/JRCLoader/JRCLoader.tsx +13 -3
  53. package/src/components/JRCLoader/JRCSkeleton.tsx +77 -0
  54. package/src/components/JRCModal/JRCModal.styles.tsx +1 -0
  55. package/src/index.tsx +0 -5
  56. package/src/translation/lang.json +1 -0
  57. package/src/types.ts +2 -1
  58. package/tsconfig.json +1 -0
  59. package/.github/workflows/create-stable-branch.yml +0 -80
  60. package/build/src/components/Form/Input/JRCFormTextEditor/JRCFormTextEditor.d.ts +0 -10
  61. package/build/src/components/Form/Input/JRCFormTextEditor/JRCFormTextEditor.stories.d.ts +0 -5
  62. package/src/components/Form/Input/JRCFormTextEditor/JRCFormTextEditor.stories.tsx +0 -30
  63. package/src/components/Form/Input/JRCFormTextEditor/JRCFormTextEditor.tsx +0 -36
@@ -0,0 +1,77 @@
1
+ import * as React from 'react';
2
+ import styled from 'styled-components';
3
+
4
+ type SSkeletonLineProps = {
5
+ width?: string;
6
+ height?: string;
7
+ translucent?: boolean;
8
+ };
9
+
10
+ const SSkeletonLine = styled.div<SSkeletonLineProps>`
11
+ display: inline-block;
12
+ width: ${(props) => props.width || `20em`};
13
+ height: ${(props) => props.height || `0.5em`};
14
+ border-radius: 5px;
15
+ margin: 5px;
16
+ background: linear-gradient(-90deg, #f0f0f0 0%, #f8f8f8 50%, #f0f0f0 100%);
17
+ background-size: 400% 400%;
18
+ animation: pulse 1.2s ease-in-out infinite;
19
+ @keyframes pulse {
20
+ 0% {
21
+ background-position: 0% 0%;
22
+ }
23
+ 100% {
24
+ background-position: -135% 0%;
25
+ }
26
+ }
27
+ `;
28
+ const SkeletonRowContainer = styled.div`
29
+ display: flex;
30
+ flex-direction: row;
31
+ flex-wrap: nowrap;
32
+ justify-content: flex-start;
33
+ align-items: flex-start;
34
+ flex: 1 100%;
35
+ overflow: hidden;
36
+ border-radius: 6px;
37
+ border: 1px solid ${(props) => props.theme.color.grey1};
38
+ margin: 8px 32px;
39
+ padding: 22px;
40
+ cursor: pointer;
41
+ &:hover {
42
+ border: 1px solid ${(props) => props.theme.color.lavender};
43
+ background: ${(props) => props.theme.color.grey0};
44
+ }
45
+ `;
46
+
47
+ const SkeletonLines = styled.div`
48
+ display: flex;
49
+ flex: 4;
50
+ flex-direction: column;
51
+ flex-wrap: wrap;
52
+ justify-content: flex-start;
53
+ align-items: flex-start;
54
+ margin: 2px 8px;
55
+ `;
56
+
57
+ const SkeletonPart = () => (
58
+ <SkeletonRowContainer data-theme="skeleton">
59
+ <SkeletonLines>
60
+ <SSkeletonLine width="50%" />
61
+ <SSkeletonLine width="30%" />
62
+ <br />
63
+ <SSkeletonLine width="50%" />
64
+ <SSkeletonLine width="30%" />
65
+ <SSkeletonLine width="10%" />
66
+ </SkeletonLines>
67
+ </SkeletonRowContainer>
68
+ );
69
+
70
+ export const Skeleton = () => (
71
+ <>
72
+ <SkeletonPart />
73
+ <SkeletonPart />
74
+ <SkeletonPart />
75
+ <SkeletonPart />
76
+ </>
77
+ );
@@ -60,6 +60,7 @@ export const JRCModalHeader = styled.div`
60
60
  margin: 24px;
61
61
  display: flex;
62
62
  align-items: center;
63
+ justify-content: space-between;
63
64
  `;
64
65
 
65
66
  export const JRCModalHeaderTitle = styled.div`
package/src/index.tsx CHANGED
@@ -4,7 +4,6 @@ import * as reduxFormLib from 'redux-form';
4
4
  import * as reduxLib from 'redux';
5
5
  import * as reactReduxLib from 'react-redux';
6
6
  import * as reactIntl from 'react-intl';
7
- import * as reactTransitionGroup from 'react-transition-group';
8
7
  import styled from 'styled-components';
9
8
  import * as reactSelect from 'react-select';
10
9
  import * as jamespotUserApi from 'jamespot-user-api';
@@ -24,7 +23,6 @@ declare global {
24
23
  reduxForm: any;
25
24
  reactIntl: any;
26
25
  reactSelect: any;
27
- reactTransitionGroup: any;
28
26
  styledComponents: any;
29
27
  reactDnd: any;
30
28
  reactDndHtml5Backend: any;
@@ -41,7 +39,6 @@ window.redux = reduxLib;
41
39
  window.reduxForm = reduxFormLib;
42
40
  window.reactIntl = reactIntl;
43
41
  window.reactSelect = reactSelect;
44
- window.reactTransitionGroup = reactTransitionGroup;
45
42
  window.styledComponents = styled;
46
43
  window.reactDnd = reactDnd;
47
44
  window.reactDndHtml5Backend = reactDndHtml5Backend;
@@ -131,8 +128,6 @@ export { JRCPagination };
131
128
 
132
129
  export { JRCFormTextarea, JRCFormTextareaField } from './components/Form/Input/JRCFormTextarea/JRCFormTextarea';
133
130
 
134
- export { JRCFormTextEditorField } from './components/Form/Input/JRCFormTextEditor/JRCFormTextEditor';
135
-
136
131
  export { JRCList } from './components/JRCList/JRCList';
137
132
 
138
133
  import JRCModalImg from './components/JRCModalImg/JRCModalImg';
@@ -11,6 +11,7 @@
11
11
  "GLOBAL_Form_Characters": "characters",
12
12
  "GLOBAL_Loading": "Loading",
13
13
  "GLOBAL_Validation": "Confirm",
14
+ "GLOBAL_Error_occurred": "An error occurred",
14
15
  "GROUP_more": "More",
15
16
  "GLOBAL_Select": "Select",
16
17
  "ERROR_Mail_Invalid": "Must be a valid email",
package/src/types.ts CHANGED
@@ -24,7 +24,8 @@ export { JRCFormSendAlertInputProps };
24
24
  import { TextareaFormInputProps } from './components/Form/Input/JRCFormTextarea/JRCFormTextarea';
25
25
  export { TextareaFormInputProps };
26
26
 
27
- export { JRCAlertProps, AlertType } from './components/JRCAlert/JRCAlert';
27
+ export { MessageType } from './components/Common/util/getColor.util';
28
+ export { JRCAlertProps } from './components/JRCAlert/JRCAlert';
28
29
  import { JRCAvatarProps } from './components/JRCAvatar/JRCAvatar';
29
30
  export { JRCAvatarProps };
30
31
  import { JRCButtonProps } from './components/JRCButton/JRCButton';
package/tsconfig.json CHANGED
@@ -2,6 +2,7 @@
2
2
  "compilerOptions": {
3
3
  "baseUrl": "./src",
4
4
  "outDir": "./build",
5
+ "lib": ["dom", "es2019"],
5
6
  "noImplicitAny": true,
6
7
  "module": "esnext",
7
8
  "moduleResolution": "node",
@@ -1,80 +0,0 @@
1
- name: remote-stable
2
-
3
- on:
4
- push:
5
- branches: [master]
6
- jobs:
7
- build:
8
- runs-on: ubuntu-latest
9
-
10
- steps:
11
- - uses: actions/checkout@v3
12
- with:
13
- persist-credentials: false
14
- - name: Select Node v. 16.x (and thus npm v. 7.x)
15
- uses: actions/setup-node@v2
16
- with:
17
- node-version: 16.x
18
- - name: Reconfigure git to use HTTP authentication
19
- run: >
20
- git config --global url."https://${{ secrets.ONE_TOKEN_TO_RULE_THEM_ALL }}@github.com/".insteadOf ssh://git@github.com/
21
- - name: Delete stable
22
- uses: dawidd6/action-delete-branch@v3
23
- with:
24
- branches: remote-stable
25
- github_token: ${{ secrets.ONE_TOKEN_TO_RULE_THEM_ALL }}
26
- continue-on-error: true
27
- - name: New remote-stable branch
28
- uses: peterjgrainger/action-create-branch@v2.0.1
29
- env:
30
- GITHUB_TOKEN: ${{ secrets.ONE_TOKEN_TO_RULE_THEM_ALL }}
31
- with:
32
- branch: remote-stable
33
- - name: Merge master -> remote-stable
34
- uses: devmasx/merge-branch@master
35
- with:
36
- type: now
37
- from_branch: master
38
- target_branch: remote-stable
39
- github_token: ${{ secrets.ONE_TOKEN_TO_RULE_THEM_ALL }}
40
- - name: ⬇️ Checkout js-util-create-stable-branch
41
- uses: actions/checkout@v3
42
- with:
43
- repository: Jamespot/js-util-create-stable-branch
44
- token: ${{ secrets.ONE_TOKEN_TO_RULE_THEM_ALL }}
45
- path: js-util-create-stable-branch
46
- persist-credentials: false
47
- - name: ⬇️ Checkout remote-stable branch
48
- uses: actions/checkout@v3
49
- with:
50
- token: ${{ secrets.ONE_TOKEN_TO_RULE_THEM_ALL }}
51
- ref: remote-stable
52
- path: newbranch
53
- persist-credentials: false
54
- - name: 🔨 Change package.json
55
- run: |
56
- pwd
57
- cd js-util-create-stable-branch
58
- node updatePackage.js ../newbranch
59
- cd ../newbranch
60
- pwd
61
- - name: Cache dependencies
62
- uses: actions/cache@v2
63
- with:
64
- path: ~/.npm
65
- key: npm-${{ hashFiles('package-lock.json') }}
66
- restore-keys: npm-
67
- - name: Install dependencies
68
- run: |
69
- pwd
70
- cp newbranch/package.json ./
71
- cat package.json
72
- npm i --legacy-peer-deps
73
- cp package-lock.json ./newbranch
74
- - name: push
75
- uses: actions-x/commit@v4
76
- with:
77
- token: ${{ secrets.ONE_TOKEN_TO_RULE_THEM_ALL }}
78
- branch: remote-stable
79
- force: true
80
- directory: newbranch
@@ -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,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
- };