@oliasoft-open-source/react-ui-library 1.0.0
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/.eslintignore +2 -0
- package/.eslintrc.js +125 -0
- package/.gitlab-ci.yml +45 -0
- package/.husky/pre-commit +4 -0
- package/.prettierignore +3 -0
- package/.prettierrc +4 -0
- package/.storybook/main.js +36 -0
- package/.storybook/preview.js +40 -0
- package/.storybook/storybook.less +8 -0
- package/LICENSE +21 -0
- package/README.md +5 -0
- package/babel.config.js +31 -0
- package/index.js +76 -0
- package/jest.config.js +9 -0
- package/package.json +136 -0
- package/src/components/accordion/accordion.jsx +132 -0
- package/src/components/accordion/accordion.module.less +66 -0
- package/src/components/accordion/accordion.stories.jsx +171 -0
- package/src/components/accordion/chevron/chevron.jsx +12 -0
- package/src/components/accordion/chevron/chevron.module.less +12 -0
- package/src/components/accordion/helpers/accordion-with-default-toggle.jsx +106 -0
- package/src/components/accordion/helpers/accordion-with-default-toggle.module.less +24 -0
- package/src/components/actions/actions.jsx +129 -0
- package/src/components/actions/actions.module.less +44 -0
- package/src/components/actions/actions.shape.js +32 -0
- package/src/components/actions/actions.stories.jsx +79 -0
- package/src/components/badge/badge.jsx +58 -0
- package/src/components/badge/badge.module.less +55 -0
- package/src/components/badge/badge.stories.jsx +31 -0
- package/src/components/breadcrumb/breadcrumb.jsx +49 -0
- package/src/components/breadcrumb/breadcrumb.module.less +39 -0
- package/src/components/breadcrumb/breadcrumb.stories.jsx +45 -0
- package/src/components/breadcrumb/link.jsx +31 -0
- package/src/components/button/button.jsx +156 -0
- package/src/components/button/button.module.less +300 -0
- package/src/components/button/button.stories.jsx +74 -0
- package/src/components/button-group/button-group.jsx +140 -0
- package/src/components/button-group/button-group.module.less +24 -0
- package/src/components/button-group/button-group.stories-data.jsx +67 -0
- package/src/components/button-group/button-group.stories.jsx +63 -0
- package/src/components/buttons-and-links.stories.mdx +55 -0
- package/src/components/card/card.jsx +51 -0
- package/src/components/card/card.module.less +48 -0
- package/src/components/card/card.stories.jsx +39 -0
- package/src/components/check-box/check-box.jsx +92 -0
- package/src/components/check-box/check-box.module.less +101 -0
- package/src/components/check-box/check-box.stories.jsx +27 -0
- package/src/components/color/color.stories-data.jsx +71 -0
- package/src/components/color/color.stories.mdx +37 -0
- package/src/components/dialog/dialog.jsx +64 -0
- package/src/components/dialog/dialog.module.less +76 -0
- package/src/components/divider/divider.jsx +40 -0
- package/src/components/divider/divider.module.less +28 -0
- package/src/components/divider/divider.stories.jsx +50 -0
- package/src/components/drawer/drawer-tabs.jsx +43 -0
- package/src/components/drawer/drawer.jsx +150 -0
- package/src/components/drawer/drawer.module.less +167 -0
- package/src/components/drawer/drawer.stories.jsx +156 -0
- package/src/components/empty/empty.jsx +52 -0
- package/src/components/empty/empty.module.less +17 -0
- package/src/components/empty/empty.stories.jsx +26 -0
- package/src/components/file-input/file-input.jsx +101 -0
- package/src/components/file-input/file-input.module.less +3 -0
- package/src/components/file-input/file-input.stories.jsx +109 -0
- package/src/components/form/field.jsx +96 -0
- package/src/components/form/field.stories.jsx +101 -0
- package/src/components/form/form.module.less +30 -0
- package/src/components/form/form.stories.jsx +191 -0
- package/src/components/heading/heading.jsx +105 -0
- package/src/components/heading/heading.module.less +59 -0
- package/src/components/heading/heading.stories.jsx +60 -0
- package/src/components/icon/deprecated-icon.jsx +97 -0
- package/src/components/icon/icon.jsx +71 -0
- package/src/components/icon/icon.module.less +33 -0
- package/src/components/icon/icon.stories.jsx +37 -0
- package/src/components/icon/icons.example.module.less +4 -0
- package/src/components/input/input.jsx +167 -0
- package/src/components/input/input.module.less +94 -0
- package/src/components/input/input.stories.jsx +28 -0
- package/src/components/input-group/input-group-addon/input-group-addon.jsx +36 -0
- package/src/components/input-group/input-group-addon/input-group-addon.module.less +31 -0
- package/src/components/input-group/input-group.jsx +51 -0
- package/src/components/input-group/input-group.module.less +10 -0
- package/src/components/input-group/input-group.stories.jsx +77 -0
- package/src/components/input-validation.stories.mdx +61 -0
- package/src/components/inputs.stories.mdx +201 -0
- package/src/components/label/label.jsx +115 -0
- package/src/components/label/label.module.less +43 -0
- package/src/components/label/label.stories.jsx +60 -0
- package/src/components/layout/column/column.jsx +85 -0
- package/src/components/layout/column/styles.js +45 -0
- package/src/components/layout/column.stories.jsx +60 -0
- package/src/components/layout/examples/afe.stories.jsx +180 -0
- package/src/components/layout/examples/blowout.stories.jsx +68 -0
- package/src/components/layout/examples/casing-loads.stories.jsx +297 -0
- package/src/components/layout/examples/formation.stories.jsx +110 -0
- package/src/components/layout/examples/projects.stories.jsx +108 -0
- package/src/components/layout/examples/reservoirs.stories.jsx +211 -0
- package/src/components/layout/examples/site.stories.jsx +263 -0
- package/src/components/layout/flex/flex.jsx +48 -0
- package/src/components/layout/flex/flex.stories.jsx +54 -0
- package/src/components/layout/form-row/form-row.jsx +15 -0
- package/src/components/layout/form-row/form-row.module.less +11 -0
- package/src/components/layout/grid/grid.jsx +62 -0
- package/src/components/layout/grid/grid.stories.jsx +65 -0
- package/src/components/layout/page/page.jsx +42 -0
- package/src/components/layout/page/page.module.less +27 -0
- package/src/components/layout/page.stories.jsx +93 -0
- package/src/components/layout/placeholder.jsx +2 -0
- package/src/components/layout/print-header/print-header.jsx +22 -0
- package/src/components/layout/print-header/print-header.module.less +9 -0
- package/src/components/layout/row/row.jsx +75 -0
- package/src/components/layout/row/row.module.less +7 -0
- package/src/components/layout/spacer/spacer.jsx +26 -0
- package/src/components/layout/spacer/spacer.stories.jsx +50 -0
- package/src/components/layout-forms.stories.mdx +104 -0
- package/src/components/layout-general.stories.mdx +215 -0
- package/src/components/list/list-row/item-content.jsx +15 -0
- package/src/components/list/list-row/label.jsx +11 -0
- package/src/components/list/list-row/list-heading.jsx +52 -0
- package/src/components/list/list-row/list-row.jsx +128 -0
- package/src/components/list/list-row/list-subheading.jsx +72 -0
- package/src/components/list/list-row/meta-content.jsx +24 -0
- package/src/components/list/list-row/meta-count.jsx +10 -0
- package/src/components/list/list-row/name.jsx +45 -0
- package/src/components/list/list.jsx +276 -0
- package/src/components/list/list.module.less +256 -0
- package/src/components/list/list.stories-data.jsx +287 -0
- package/src/components/list/list.stories.jsx +458 -0
- package/src/components/list/toggle-narrow.jsx +13 -0
- package/src/components/loader/loader.jsx +63 -0
- package/src/components/loader/loader.module.less +63 -0
- package/src/components/loader/loader.stories.jsx +155 -0
- package/src/components/menu/index.js +7 -0
- package/src/components/menu/layer/divider.jsx +4 -0
- package/src/components/menu/layer/heading.jsx +15 -0
- package/src/components/menu/layer/layer.jsx +82 -0
- package/src/components/menu/layer/option.jsx +77 -0
- package/src/components/menu/layer/path.js +44 -0
- package/src/components/menu/layer/placementOptions.js +6 -0
- package/src/components/menu/layer/section.jsx +66 -0
- package/src/components/menu/menu.jsx +359 -0
- package/src/components/menu/menu.module.less +241 -0
- package/src/components/menu/menu.stories-data.jsx +168 -0
- package/src/components/menu/menu.stories.jsx +126 -0
- package/src/components/menu/menu.test.js +58 -0
- package/src/components/menu/trigger/button.jsx +50 -0
- package/src/components/menu/trigger/component.jsx +14 -0
- package/src/components/menu/trigger/text.jsx +25 -0
- package/src/components/menu/trigger/trigger.jsx +86 -0
- package/src/components/message/dismiss.jsx +26 -0
- package/src/components/message/message.jsx +137 -0
- package/src/components/message/message.module.less +114 -0
- package/src/components/message/message.stories.jsx +84 -0
- package/src/components/modal/modal.jsx +50 -0
- package/src/components/modal/modal.module.less +35 -0
- package/src/components/modal/modal.stories.jsx +159 -0
- package/src/components/option-dropdown/heading.jsx +6 -0
- package/src/components/option-dropdown/layer.jsx +81 -0
- package/src/components/option-dropdown/option-dropdown.jsx +53 -0
- package/src/components/option-dropdown/option-dropdown.module.less +50 -0
- package/src/components/option-dropdown/option-dropdown.stories.jsx +35 -0
- package/src/components/option-dropdown/option.jsx +13 -0
- package/src/components/pagination/pagination.jsx +139 -0
- package/src/components/pagination/pagination.module.less +11 -0
- package/src/components/pagination/pagination.stories.jsx +78 -0
- package/src/components/pagination/pagination.test.js +92 -0
- package/src/components/pagination/pagination.viewdata.js +66 -0
- package/src/components/pop-confirm/content.jsx +25 -0
- package/src/components/pop-confirm/pop-confirm.jsx +61 -0
- package/src/components/pop-confirm/pop-confirm.module.less +18 -0
- package/src/components/pop-confirm/pop-confirm.stories.jsx +53 -0
- package/src/components/popover/popover.jsx +112 -0
- package/src/components/popover/popover.module.less +22 -0
- package/src/components/popover/popover.stories.jsx +59 -0
- package/src/components/portal/portal.jsx +16 -0
- package/src/components/portal/portal.stories.jsx +69 -0
- package/src/components/progress-bar/progress-bar.jsx +64 -0
- package/src/components/progress-bar/progress-bar.module.less +64 -0
- package/src/components/progress-bar/progress-bar.stories.jsx +23 -0
- package/src/components/radio-button/radio-button.jsx +139 -0
- package/src/components/radio-button/radio-button.module.less +135 -0
- package/src/components/radio-button/radio-button.stories.jsx +37 -0
- package/src/components/radio-button/radio-input.jsx +52 -0
- package/src/components/select/custom-select/custom-select.jsx +440 -0
- package/src/components/select/custom-select/custom-select.module.less +123 -0
- package/src/components/select/custom-select/custom-select.reducer.js +157 -0
- package/src/components/select/custom-select/layer/heading.jsx +13 -0
- package/src/components/select/custom-select/layer/layer.jsx +73 -0
- package/src/components/select/custom-select/layer/option.jsx +54 -0
- package/src/components/select/custom-select/layer/placementOptions.js +7 -0
- package/src/components/select/custom-select/layer/section.jsx +35 -0
- package/src/components/select/custom-select/trigger/input.jsx +100 -0
- package/src/components/select/custom-select/trigger/trigger.jsx +155 -0
- package/src/components/select/custom-select/trigger/trigger.module.less +289 -0
- package/src/components/select/native-select/native-select.jsx +198 -0
- package/src/components/select/native-select/native-select.module.less +107 -0
- package/src/components/select/select.input.js +146 -0
- package/src/components/select/select.jsx +207 -0
- package/src/components/select/select.stories-data.jsx +92 -0
- package/src/components/select/select.stories.jsx +135 -0
- package/src/components/select/select.test.js +519 -0
- package/src/components/side-bar/container.module.less +29 -0
- package/src/components/side-bar/link.jsx +83 -0
- package/src/components/side-bar/sections.jsx +23 -0
- package/src/components/side-bar/side-bar.jsx +102 -0
- package/src/components/side-bar/side-bar.module.less +137 -0
- package/src/components/side-bar/side-bar.stories.jsx +101 -0
- package/src/components/slider/rc-slider.less +47 -0
- package/src/components/slider/slider-tooltip.jsx +20 -0
- package/src/components/slider/slider.jsx +233 -0
- package/src/components/slider/slider.module.less +40 -0
- package/src/components/slider/slider.stories.jsx +110 -0
- package/src/components/spinner/spinner.jsx +37 -0
- package/src/components/spinner/spinner.module.less +115 -0
- package/src/components/spinner/spinner.stories.jsx +24 -0
- package/src/components/table/cell/cell.jsx +614 -0
- package/src/components/table/cell/cell.module.less +152 -0
- package/src/components/table/footer/footer.jsx +66 -0
- package/src/components/table/footer/footer.module.less +14 -0
- package/src/components/table/helper.js +64 -0
- package/src/components/table/helper.test.js +166 -0
- package/src/components/table/icon/icon.module.less +31 -0
- package/src/components/table/row/expanded-content-row.jsx +16 -0
- package/src/components/table/row/row.jsx +253 -0
- package/src/components/table/row/row.module.less +62 -0
- package/src/components/table/table-scroll-wrapper.jsx +48 -0
- package/src/components/table/table.jsx +232 -0
- package/src/components/table/table.module.less +145 -0
- package/src/components/table/table.stories-data.jsx +752 -0
- package/src/components/table/table.stories.jsx +814 -0
- package/src/components/table/table.test.js +30 -0
- package/src/components/table/table.variables.less +19 -0
- package/src/components/table/table.viewdata.js +26 -0
- package/src/components/table/title/title.jsx +30 -0
- package/src/components/table/title/title.module.less +9 -0
- package/src/components/tabs/content.jsx +14 -0
- package/src/components/tabs/label.jsx +50 -0
- package/src/components/tabs/tabs.jsx +191 -0
- package/src/components/tabs/tabs.module.less +73 -0
- package/src/components/tabs/tabs.stories.jsx +110 -0
- package/src/components/text/text.jsx +64 -0
- package/src/components/text/text.module.less +45 -0
- package/src/components/text/text.stories.jsx +31 -0
- package/src/components/text-link/text-link.jsx +23 -0
- package/src/components/text-link/text-link.stories.jsx +20 -0
- package/src/components/textarea/textarea.jsx +126 -0
- package/src/components/textarea/textarea.module.less +55 -0
- package/src/components/textarea/textarea.stories.jsx +26 -0
- package/src/components/toaster/toaster.jsx +39 -0
- package/src/components/toaster/toaster.less +17 -0
- package/src/components/toaster/toaster.stories.jsx +116 -0
- package/src/components/toggle/toggle.jsx +65 -0
- package/src/components/toggle/toggle.module.less +139 -0
- package/src/components/toggle/toggle.stories.jsx +26 -0
- package/src/components/tooltip/tooltip-layer.jsx +72 -0
- package/src/components/tooltip/tooltip.jsx +108 -0
- package/src/components/tooltip/tooltip.module.less +28 -0
- package/src/components/tooltip/tooltip.stories.jsx +71 -0
- package/src/components/top-bar/element/element.jsx +72 -0
- package/src/components/top-bar/element/link.jsx +29 -0
- package/src/components/top-bar/title.jsx +24 -0
- package/src/components/top-bar/top-bar.jsx +79 -0
- package/src/components/top-bar/top-bar.module.less +191 -0
- package/src/components/top-bar/top-bar.stories.jsx +137 -0
- package/src/components/top-bar/warning.jsx +6 -0
- package/src/components/tree/tree-item.jsx +79 -0
- package/src/components/tree/tree-placeholder.jsx +6 -0
- package/src/components/tree/tree.jsx +129 -0
- package/src/components/tree/tree.module.less +33 -0
- package/src/components/tree/tree.stories-data.jsx +89 -0
- package/src/components/tree/tree.stories.jsx +106 -0
- package/src/docs/components/page/page.jsx +16 -0
- package/src/docs/config/config.js +1 -0
- package/src/docs/html/favicon.png +0 -0
- package/src/docs/html/index.html +11 -0
- package/src/docs/navigation/footer/footer.jsx +48 -0
- package/src/docs/navigation/header/header.jsx +39 -0
- package/src/docs/navigation/header/header.module.less +32 -0
- package/src/docs/navigation/routes/routes.jsx +16 -0
- package/src/docs/start.jsx +12 -0
- package/src/docs/views/main/main.jsx +209 -0
- package/src/docs/views/main/main.module.less +14 -0
- package/src/docs/views/not-found/not-found.jsx +5 -0
- package/src/helpers/disabled-context.js +8 -0
- package/src/helpers/styles.js +68 -0
- package/src/helpers/text.js +6 -0
- package/src/helpers/types.js +5 -0
- package/src/hooks/index.js +3 -0
- package/src/hooks/use-focus.js +11 -0
- package/src/hooks/use-keyboard-event.js +16 -0
- package/src/hooks/use-window-width.js +20 -0
- package/src/images/icons/icon-drop.png +0 -0
- package/src/images/icons/icon-share.png +0 -0
- package/src/images/icons/icons8-junction.svg +4 -0
- package/src/images/logo.png +0 -0
- package/src/images/logo.svg +13 -0
- package/src/images/oliasoft-logo.svg +1 -0
- package/src/style/colors.less +26 -0
- package/src/style/external.less +10 -0
- package/src/style/fonts/lato/Lato-Bold.woff2 +0 -0
- package/src/style/fonts/lato/Lato-BoldItalic.woff2 +0 -0
- package/src/style/fonts/lato/Lato-Italic.woff2 +0 -0
- package/src/style/fonts/lato/Lato-Regular.woff2 +0 -0
- package/src/style/fonts.less +27 -0
- package/src/style/global.less +51 -0
- package/src/style/mixins.less +67 -0
- package/src/style/reset/reset.less +34 -0
- package/src/style/shared.less +25 -0
- package/src/style/theme.dark.less +37 -0
- package/src/style/theme.default.less +74 -0
- package/src/style/variables.less +49 -0
- package/webpack/webpack.common.js +39 -0
- package/webpack/webpack.common.rules.js +102 -0
- package/webpack/webpack.dev.js +22 -0
- package/webpack/webpack.prod.js +23 -0
- package/webpack/webpack.resolve.js +22 -0
package/.eslintignore
ADDED
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
env: {
|
|
3
|
+
browser: true,
|
|
4
|
+
es2021: true,
|
|
5
|
+
node: true,
|
|
6
|
+
jest: true,
|
|
7
|
+
},
|
|
8
|
+
extends: ['plugin:react/recommended', 'airbnb', 'prettier'],
|
|
9
|
+
parser: '@babel/eslint-parser',
|
|
10
|
+
parserOptions: {
|
|
11
|
+
ecmaFeatures: {
|
|
12
|
+
jsx: true,
|
|
13
|
+
},
|
|
14
|
+
ecmaVersion: 12,
|
|
15
|
+
sourceType: 'module',
|
|
16
|
+
},
|
|
17
|
+
plugins: ['react'],
|
|
18
|
+
settings: {
|
|
19
|
+
'import/resolver': {
|
|
20
|
+
alias: {
|
|
21
|
+
map: [
|
|
22
|
+
['~components', './src/components'],
|
|
23
|
+
['~docs', './src/docs'],
|
|
24
|
+
['~helpers', './src/helpers'],
|
|
25
|
+
['~style', './src/style'],
|
|
26
|
+
['~vendor', './src/vendor'],
|
|
27
|
+
],
|
|
28
|
+
extensions: ['.js', '.jsx'],
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
rules: {
|
|
33
|
+
'arrow-parens': 0,
|
|
34
|
+
'array-callback-return': 0,
|
|
35
|
+
camelcase: 0,
|
|
36
|
+
'comma-dangle': 0,
|
|
37
|
+
'consistent-return': 0,
|
|
38
|
+
curly: 0,
|
|
39
|
+
'class-methods-use-this': 0,
|
|
40
|
+
'default-case': 0,
|
|
41
|
+
eqeqeq: 0,
|
|
42
|
+
'eol-last': 0,
|
|
43
|
+
'function-paren-newline': 0,
|
|
44
|
+
'max-len': 0,
|
|
45
|
+
'import/extensions': 0,
|
|
46
|
+
'import/prefer-default-export': 0,
|
|
47
|
+
'object-curly-newline': 0,
|
|
48
|
+
'object-curly-spacing': 0,
|
|
49
|
+
'one-var-declaration-per-line': 0,
|
|
50
|
+
'one-var': 0,
|
|
51
|
+
radix: 0,
|
|
52
|
+
'prefer-template': 0,
|
|
53
|
+
'prefer-const': 0,
|
|
54
|
+
'prefer-destructuring': [
|
|
55
|
+
'error',
|
|
56
|
+
{
|
|
57
|
+
VariableDeclarator: {
|
|
58
|
+
array: false,
|
|
59
|
+
object: true,
|
|
60
|
+
},
|
|
61
|
+
AssignmentExpression: {
|
|
62
|
+
array: false,
|
|
63
|
+
object: false,
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
enforceForRenamedProperties: false,
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
'spaced-comment': 0,
|
|
71
|
+
'no-multi-spaces': 0,
|
|
72
|
+
'arrow-body-style': 0,
|
|
73
|
+
'no-shadow': 0,
|
|
74
|
+
'no-else-return': 0,
|
|
75
|
+
'no-param-reassign': 0,
|
|
76
|
+
'no-plusplus': 0,
|
|
77
|
+
'no-restricted-globals': 0,
|
|
78
|
+
'no-unused-vars': 0,
|
|
79
|
+
'no-unused-state': 0,
|
|
80
|
+
'no-case-declarations': 0,
|
|
81
|
+
'no-return-assign': 0,
|
|
82
|
+
'no-prototype-builtins': 0,
|
|
83
|
+
'no-restricted-syntax': 0,
|
|
84
|
+
'no-cond-assign': [2, 'except-parens'],
|
|
85
|
+
'no-console': 0,
|
|
86
|
+
'no-constant-condition': 0,
|
|
87
|
+
'no-underscore-dangle': 0,
|
|
88
|
+
'no-restricted-properties': 0,
|
|
89
|
+
'no-nested-ternary': 0,
|
|
90
|
+
'no-mixed-operators': 0,
|
|
91
|
+
'no-confusing-arrow': 0,
|
|
92
|
+
'no-lonely-if': 0,
|
|
93
|
+
'nonblock-statement-body-position': 0,
|
|
94
|
+
'react/jsx-tag-spacing': 0,
|
|
95
|
+
'react/jsx-one-expression-per-line': 0,
|
|
96
|
+
'react/no-array-index-key': 0,
|
|
97
|
+
'react/forbid-prop-types': 0,
|
|
98
|
+
'react/destructuring-assignment': 0,
|
|
99
|
+
'react/no-unused-state': 0,
|
|
100
|
+
'react/no-access-state-in-setstate': 0,
|
|
101
|
+
'react/no-did-update-set-state': 0,
|
|
102
|
+
'react/prop-types': 0,
|
|
103
|
+
'react/self-closing-comp': [
|
|
104
|
+
'error',
|
|
105
|
+
{
|
|
106
|
+
component: true,
|
|
107
|
+
html: false,
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
'jsx-a11y/no-static-element-interactions': 0,
|
|
111
|
+
'jsx-a11y/click-events-have-key-events': 0,
|
|
112
|
+
'jsx-a11y/tabindex-no-positive': 0,
|
|
113
|
+
'jsx-a11y/label-has-associated-control': 0,
|
|
114
|
+
'jsx-a11y/label-has-for': 0,
|
|
115
|
+
'import/no-extraneous-dependencies': [
|
|
116
|
+
'error',
|
|
117
|
+
{
|
|
118
|
+
devDependencies: [
|
|
119
|
+
'src/components/**/*.stories.{js,jsx}',
|
|
120
|
+
'webpack/**/*.js',
|
|
121
|
+
],
|
|
122
|
+
},
|
|
123
|
+
],
|
|
124
|
+
},
|
|
125
|
+
};
|
package/.gitlab-ci.yml
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
test:
|
|
2
|
+
image: node:18
|
|
3
|
+
stage: test
|
|
4
|
+
only:
|
|
5
|
+
- merge_requests
|
|
6
|
+
script:
|
|
7
|
+
- npm install --progress=false --no-save
|
|
8
|
+
- npm run build
|
|
9
|
+
- npm run test
|
|
10
|
+
|
|
11
|
+
cache:
|
|
12
|
+
paths:
|
|
13
|
+
- node_modules/
|
|
14
|
+
- public/
|
|
15
|
+
|
|
16
|
+
pages:
|
|
17
|
+
image: node:18
|
|
18
|
+
script:
|
|
19
|
+
- npm install
|
|
20
|
+
- npm run build
|
|
21
|
+
- cp public/index.html public/404.html
|
|
22
|
+
artifacts:
|
|
23
|
+
paths:
|
|
24
|
+
- public
|
|
25
|
+
only:
|
|
26
|
+
- master
|
|
27
|
+
|
|
28
|
+
publish:
|
|
29
|
+
stage: publish
|
|
30
|
+
only:
|
|
31
|
+
- tags
|
|
32
|
+
script:
|
|
33
|
+
- npm run ci-publish
|
|
34
|
+
|
|
35
|
+
publish:
|
|
36
|
+
stage: publish
|
|
37
|
+
only:
|
|
38
|
+
- master
|
|
39
|
+
script:
|
|
40
|
+
- echo '//gitlab.com/api/v4/packages/npm/:_authToken=${CI_JOB_TOKEN}' >> .npmrc
|
|
41
|
+
- echo '//gitlab.com/api/v4/projects/${CI_PROJECT_ID}/packages/npm/:_authToken=${CI_JOB_TOKEN}' >.npmrc
|
|
42
|
+
- echo '@oliasoft:registry=https://gitlab.com/api/v4/projects/${CI_PROJECT_ID}/packages/npm/' >>.npmrc
|
|
43
|
+
-
|
|
44
|
+
- npm config set -- '//gitlab.com/api/v4/projects/<your_project_id>/packages/npm/:_authToken' "<your_token>"
|
|
45
|
+
- npm publish --access public
|
package/.prettierignore
ADDED
package/.prettierrc
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const { merge } = require('webpack-merge');
|
|
2
|
+
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
3
|
+
const getRules = require('../webpack/webpack.common.rules.js');
|
|
4
|
+
const resolve = require('../webpack/webpack.resolve.js').resolve;
|
|
5
|
+
|
|
6
|
+
module.exports = {
|
|
7
|
+
stories: ['../src/components/**/*.stories.@(js|jsx|mdx)'],
|
|
8
|
+
addons: [
|
|
9
|
+
'@storybook/addon-actions',
|
|
10
|
+
{
|
|
11
|
+
name: '@storybook/addon-docs',
|
|
12
|
+
options: {
|
|
13
|
+
sourceLoaderOptions: {
|
|
14
|
+
injectStoryParameters: false,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
'storybook-dark-mode',
|
|
19
|
+
],
|
|
20
|
+
features: {
|
|
21
|
+
modernInlineRender: true,
|
|
22
|
+
},
|
|
23
|
+
core: {
|
|
24
|
+
builder: 'webpack5',
|
|
25
|
+
},
|
|
26
|
+
webpackFinal: (config) =>
|
|
27
|
+
merge(config, {
|
|
28
|
+
module: { rules: getRules('development') },
|
|
29
|
+
plugins: [
|
|
30
|
+
new MiniCssExtractPlugin({
|
|
31
|
+
filename: '[name].css',
|
|
32
|
+
}),
|
|
33
|
+
],
|
|
34
|
+
resolve,
|
|
35
|
+
}),
|
|
36
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Toaster } from '../';
|
|
3
|
+
import { useDarkMode } from 'storybook-dark-mode';
|
|
4
|
+
import { themes } from '@storybook/theming';
|
|
5
|
+
import { DocsContainer } from '@storybook/addon-docs';
|
|
6
|
+
import '../src/style/global.less';
|
|
7
|
+
import './storybook.less';
|
|
8
|
+
|
|
9
|
+
export const decorators = [
|
|
10
|
+
(Story) => {
|
|
11
|
+
document.documentElement.setAttribute(
|
|
12
|
+
'data-theme',
|
|
13
|
+
useDarkMode() ? 'dark' : 'default',
|
|
14
|
+
);
|
|
15
|
+
return (
|
|
16
|
+
<>
|
|
17
|
+
<Story />
|
|
18
|
+
<Toaster />
|
|
19
|
+
</>
|
|
20
|
+
);
|
|
21
|
+
},
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
export const parameters = {
|
|
25
|
+
/**
|
|
26
|
+
* Fix for dark mode docs from https://github.com/hipstersmoothie/storybook-dark-mode/issues/180
|
|
27
|
+
*/
|
|
28
|
+
docs: {
|
|
29
|
+
container: (props) => {
|
|
30
|
+
const isDark = useDarkMode();
|
|
31
|
+
const { id: storyId, storyById } = props.context;
|
|
32
|
+
const {
|
|
33
|
+
parameters: { docs = {} },
|
|
34
|
+
} = storyById(storyId);
|
|
35
|
+
docs.theme = isDark ? themes.dark : themes.light;
|
|
36
|
+
|
|
37
|
+
return React.createElement(DocsContainer, props);
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
};
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 Oliasoft AS and contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
package/babel.config.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
module.exports = (api) => {
|
|
2
|
+
api.cache(true);
|
|
3
|
+
|
|
4
|
+
const presets = [
|
|
5
|
+
[
|
|
6
|
+
'@babel/preset-env',
|
|
7
|
+
{
|
|
8
|
+
targets: {
|
|
9
|
+
browsers: ['defaults'],
|
|
10
|
+
},
|
|
11
|
+
useBuiltIns: 'usage',
|
|
12
|
+
corejs: 3,
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
'@babel/preset-react',
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
const plugins = [
|
|
19
|
+
'@babel/plugin-proposal-class-properties',
|
|
20
|
+
'babel-plugin-transform-md-import-to-string',
|
|
21
|
+
[
|
|
22
|
+
'babel-plugin-webpack-aliases',
|
|
23
|
+
{ config: './webpack/webpack.resolve.js' },
|
|
24
|
+
],
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
return {
|
|
28
|
+
presets,
|
|
29
|
+
plugins,
|
|
30
|
+
};
|
|
31
|
+
};
|
package/index.js
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Components
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export { Accordion } from './src/components/accordion/accordion';
|
|
6
|
+
export { AccordionWithDefaultToggle } from './src/components/accordion/helpers/accordion-with-default-toggle';
|
|
7
|
+
export { Actions } from './src/components/actions/actions';
|
|
8
|
+
export { Badge } from './src/components/badge/badge';
|
|
9
|
+
export { Breadcrumb } from './src/components/breadcrumb/breadcrumb';
|
|
10
|
+
export { Button } from './src/components/button/button';
|
|
11
|
+
export { ButtonGroup } from './src/components/button-group/button-group';
|
|
12
|
+
export { Card } from './src/components/card/card';
|
|
13
|
+
export { CheckBox } from './src/components/check-box/check-box';
|
|
14
|
+
export { Column } from './src/components/layout/column/column';
|
|
15
|
+
export { Divider } from './src/components/divider/divider';
|
|
16
|
+
export { Dialog } from './src/components/dialog/dialog';
|
|
17
|
+
export { Drawer } from './src/components/drawer/drawer';
|
|
18
|
+
export { Empty } from './src/components/empty/empty';
|
|
19
|
+
export { FileInput } from './src/components/file-input/file-input';
|
|
20
|
+
export { readFile } from './src/components/file-input/file-input';
|
|
21
|
+
export { Field } from './src/components/form/field';
|
|
22
|
+
export { Flex } from './src/components/layout/flex/flex';
|
|
23
|
+
export { FormRow } from './src/components/layout/form-row/form-row';
|
|
24
|
+
export { Grid } from './src/components/layout/grid/grid';
|
|
25
|
+
export { Icon } from './src/components/icon/icon';
|
|
26
|
+
export { InputGroup } from './src/components/input-group/input-group';
|
|
27
|
+
export { InputGroupAddon } from './src/components/input-group/input-group-addon/input-group-addon';
|
|
28
|
+
export { Heading } from './src/components/heading/heading';
|
|
29
|
+
export { Input, widthOfCharacters } from './src/components/input/input';
|
|
30
|
+
export { Label } from './src/components/label/label';
|
|
31
|
+
export { List } from './src/components/list/list';
|
|
32
|
+
export { ListHeading } from './src/components/list/list-row/list-heading';
|
|
33
|
+
export { ListSubheading } from './src/components/list/list-row/list-subheading';
|
|
34
|
+
export { Loader } from './src/components/loader/loader';
|
|
35
|
+
export { Menu } from './src/components/menu/menu';
|
|
36
|
+
export { Message } from './src/components/message/message';
|
|
37
|
+
export { Modal } from './src/components/modal/modal';
|
|
38
|
+
export { OptionDropdown } from './src/components/option-dropdown/option-dropdown';
|
|
39
|
+
export { Page } from './src/components/layout/page/page';
|
|
40
|
+
export { Pagination } from './src/components/pagination/pagination';
|
|
41
|
+
export { Popover } from './src/components/popover/popover';
|
|
42
|
+
export { Portal } from './src/components/portal/portal';
|
|
43
|
+
export { PrintHeader } from './src/components/layout/print-header/print-header';
|
|
44
|
+
export { ProgressBar } from './src/components/progress-bar/progress-bar';
|
|
45
|
+
export { RadioButton } from './src/components/radio-button/radio-button';
|
|
46
|
+
export { NativeSelect } from './src/components/select/native-select/native-select';
|
|
47
|
+
export { Row } from './src/components/layout/row/row';
|
|
48
|
+
export { Select } from './src/components/select/select';
|
|
49
|
+
export { SideBar } from './src/components/side-bar/side-bar';
|
|
50
|
+
export { Slider } from './src/components/slider/slider';
|
|
51
|
+
export { Spacer } from './src/components/layout/spacer/spacer';
|
|
52
|
+
export { Spinner } from './src/components/spinner/spinner';
|
|
53
|
+
export { Table } from './src/components/table/table';
|
|
54
|
+
export { Tabs } from './src/components/tabs/tabs';
|
|
55
|
+
export { Text } from './src/components/text/text';
|
|
56
|
+
export { TextLink } from './src/components/text-link/text-link';
|
|
57
|
+
export { TextArea } from './src/components/textarea/textarea';
|
|
58
|
+
export { Toaster, toast } from './src/components/toaster/toaster';
|
|
59
|
+
export { Toggle } from './src/components/toggle/toggle';
|
|
60
|
+
export { Tooltip } from './src/components/tooltip/tooltip';
|
|
61
|
+
export { TopBar } from './src/components/top-bar/top-bar';
|
|
62
|
+
export { PopConfirm } from './src/components/pop-confirm/pop-confirm';
|
|
63
|
+
export { Tree } from './src/components/tree/tree';
|
|
64
|
+
|
|
65
|
+
/*
|
|
66
|
+
Hooks
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
export { useKeyboardEvent, useFocus, useWindowWidth } from './src/hooks';
|
|
70
|
+
|
|
71
|
+
/*
|
|
72
|
+
Helpers
|
|
73
|
+
*/
|
|
74
|
+
|
|
75
|
+
export { styleVariables } from './src/helpers/styles';
|
|
76
|
+
export { DisabledContext } from './src/helpers/disabled-context';
|
package/jest.config.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@oliasoft-open-source/react-ui-library",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Reusable UI components for React projects",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "npm run build:docs && npm run build:storybook",
|
|
8
|
+
"build:docs": "webpack --config webpack/webpack.prod.js",
|
|
9
|
+
"build:css": "lessc src/style/external.less dist/gui-library.css",
|
|
10
|
+
"build:storybook": "build-storybook --quiet --output-dir ./public/storybook",
|
|
11
|
+
"dev:storybook": "start-storybook -p 6006",
|
|
12
|
+
"dev:docs": "webpack serve --config webpack/webpack.dev.js",
|
|
13
|
+
"test": "npm run prettier:check && npm run lint:check && npm run test:unit",
|
|
14
|
+
"test:unit": "jest",
|
|
15
|
+
"lint:check": "eslint \"**/*.{js,jsx}\"",
|
|
16
|
+
"lint:fix": "eslint --fix \"**/*.{js,jsx}\"",
|
|
17
|
+
"prettier:check": "prettier --check \"**/*.{js,jsx,json,css,less}\"",
|
|
18
|
+
"prettier:fix": "prettier --write \"**/*.{js,jsx,json,css,less}\"",
|
|
19
|
+
"prepare": "husky install"
|
|
20
|
+
},
|
|
21
|
+
"lint-staged": {
|
|
22
|
+
"*.js": "eslint --cache --fix",
|
|
23
|
+
"*.{js,jsx,json,css,less}": [
|
|
24
|
+
"prettier --write"
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "git+https://gitlab.com/oliasoft-open-source/react-ui-library.git"
|
|
30
|
+
},
|
|
31
|
+
"author": "Oliasoft AS and contributors",
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"bugs": {
|
|
34
|
+
"url": "https://https://gitlab.com/oliasoft-open-source/react-ui-library/issues"
|
|
35
|
+
},
|
|
36
|
+
"homepage": "https://oliasoft-open-source.gitlab.io/react-ui-library",
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@babel/cli": "^7.15.4",
|
|
39
|
+
"@babel/core": "^7.15.5",
|
|
40
|
+
"@babel/eslint-parser": "^7.15.4",
|
|
41
|
+
"@babel/node": "^7.15.4",
|
|
42
|
+
"@babel/plugin-proposal-class-properties": "^7.14.5",
|
|
43
|
+
"@babel/plugin-proposal-decorators": "^7.15.4",
|
|
44
|
+
"@babel/plugin-proposal-export-namespace-from": "^7.14.5",
|
|
45
|
+
"@babel/plugin-proposal-function-sent": "^7.14.5",
|
|
46
|
+
"@babel/plugin-proposal-json-strings": "^7.14.5",
|
|
47
|
+
"@babel/plugin-proposal-numeric-separator": "^7.14.5",
|
|
48
|
+
"@babel/plugin-proposal-object-rest-spread": "^7.15.6",
|
|
49
|
+
"@babel/plugin-proposal-throw-expressions": "^7.14.5",
|
|
50
|
+
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
51
|
+
"@babel/plugin-syntax-import-meta": "^7.10.4",
|
|
52
|
+
"@babel/preset-env": "^7.15.6",
|
|
53
|
+
"@babel/preset-react": "^7.14.5",
|
|
54
|
+
"@babel/runtime": "^7.15.4",
|
|
55
|
+
"@storybook/addon-actions": "^6.5.10",
|
|
56
|
+
"@storybook/addon-essentials": "^6.5.10",
|
|
57
|
+
"@storybook/addons": "^6.5.10",
|
|
58
|
+
"@storybook/builder-webpack5": "^6.5.10",
|
|
59
|
+
"@storybook/manager-webpack5": "^6.5.10",
|
|
60
|
+
"@storybook/react": "^6.5.10",
|
|
61
|
+
"@types/lodash": "^4.14.172",
|
|
62
|
+
"@types/mocha": "^9.0.0",
|
|
63
|
+
"@types/react": "^17.0.21",
|
|
64
|
+
"@types/react-redux": "^7.1.18",
|
|
65
|
+
"@types/seamless-immutable": "^7.1.16",
|
|
66
|
+
"autoprefixer": "^10.3.4",
|
|
67
|
+
"babel-eslint": "^10.1.0",
|
|
68
|
+
"babel-jest": "^27.2.0",
|
|
69
|
+
"babel-loader": "^8.2.2",
|
|
70
|
+
"babel-plugin-transform-md-import-to-string": "^1.0.6",
|
|
71
|
+
"babel-plugin-webpack-aliases": "^1.1.3",
|
|
72
|
+
"clean-css": "^5.1.5",
|
|
73
|
+
"css-loader": "^6.2.0",
|
|
74
|
+
"css-minimizer-webpack-plugin": "^3.0.2",
|
|
75
|
+
"cssnano": "^5.0.8",
|
|
76
|
+
"eslint": "^7.32.0",
|
|
77
|
+
"eslint-config-airbnb": "^18.2.1",
|
|
78
|
+
"eslint-config-prettier": "^8.3.0",
|
|
79
|
+
"eslint-import-resolver-alias": "^1.1.2",
|
|
80
|
+
"eslint-plugin-import": "^2.24.2",
|
|
81
|
+
"eslint-plugin-jsx-a11y": "^6.4.1",
|
|
82
|
+
"eslint-plugin-react": "^7.25.1",
|
|
83
|
+
"eslint-plugin-react-hooks": "^4.2.0",
|
|
84
|
+
"html-loader": "^2.1.2",
|
|
85
|
+
"html-webpack-plugin": "^5.3.2",
|
|
86
|
+
"husky": "^7.0.2",
|
|
87
|
+
"jest": "^27.2.0",
|
|
88
|
+
"jest-transform-stub": "^2.0.0",
|
|
89
|
+
"less": "^4.1.1",
|
|
90
|
+
"less-loader": "^10.0.1",
|
|
91
|
+
"lint-staged": "^11.1.2",
|
|
92
|
+
"mini-css-extract-plugin": "^2.3.0",
|
|
93
|
+
"prettier": "2.4.0",
|
|
94
|
+
"react": "^17.0",
|
|
95
|
+
"react-dom": "^17.0",
|
|
96
|
+
"storybook-dark-mode": "^1.1.0",
|
|
97
|
+
"terser-webpack-plugin": "^5.2.4",
|
|
98
|
+
"webpack": "^5.52.1",
|
|
99
|
+
"webpack-cli": "^4.8.0",
|
|
100
|
+
"webpack-dev-server": "^4.2.1",
|
|
101
|
+
"webpack-merge": "^5.8.0"
|
|
102
|
+
},
|
|
103
|
+
"peerDependencies": {
|
|
104
|
+
"react": "^17.0",
|
|
105
|
+
"react-dom": "^17.0"
|
|
106
|
+
},
|
|
107
|
+
"dependencies": {
|
|
108
|
+
"@babel/polyfill": "^7.8.7",
|
|
109
|
+
"@mdx-js/loader": "^1.6.22",
|
|
110
|
+
"@mdx-js/react": "^1.6.22",
|
|
111
|
+
"@minoru/react-dnd-treeview": "^1.6.1",
|
|
112
|
+
"classnames": "^2.3.1",
|
|
113
|
+
"core-js": "^3.17.3",
|
|
114
|
+
"expose-loader": "^3.0.0",
|
|
115
|
+
"immer": "^9.0.6",
|
|
116
|
+
"less-vars-to-js": "^1.3.0",
|
|
117
|
+
"lodash": "^4.17.21",
|
|
118
|
+
"memoize-one": "^5.2.1",
|
|
119
|
+
"normalize.css": "^8.0.1",
|
|
120
|
+
"prop-types": "^15.7.2",
|
|
121
|
+
"rc-slider": "^9.7.2",
|
|
122
|
+
"react-beautiful-dnd": "^13.1.0",
|
|
123
|
+
"react-fast-compare": "^3.2.0",
|
|
124
|
+
"react-faux-dom": "^4.5.0",
|
|
125
|
+
"react-icons": "^4.2.0",
|
|
126
|
+
"react-infinite-scroll-component": "^6.1.0",
|
|
127
|
+
"react-keyboard-event-handler": "^1.5.4",
|
|
128
|
+
"react-laag": "^2.0.3",
|
|
129
|
+
"react-router-dom": "^5.3.0",
|
|
130
|
+
"react-svg": "^14.0.12",
|
|
131
|
+
"react-toastify": "^8.0.2",
|
|
132
|
+
"react-window": "^1.8.6",
|
|
133
|
+
"resize-observer-polyfill": "^1.5.1",
|
|
134
|
+
"styled-components": "^5.3.1"
|
|
135
|
+
}
|
|
136
|
+
}
|