@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
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
@import '../../style/variables.less';
|
|
2
|
+
|
|
3
|
+
.label {
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
|
|
7
|
+
&.labelLeft {
|
|
8
|
+
margin-bottom: 0;
|
|
9
|
+
flex-shrink: 0;
|
|
10
|
+
padding-right: 10px;
|
|
11
|
+
|
|
12
|
+
> label {
|
|
13
|
+
margin-bottom: 0;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.icons {
|
|
18
|
+
display: inline-flex;
|
|
19
|
+
|
|
20
|
+
> * {
|
|
21
|
+
margin-left: 8px;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.icon {
|
|
26
|
+
margin-left: auto;
|
|
27
|
+
color: var(--color-text-faint);
|
|
28
|
+
line-height: 0;
|
|
29
|
+
font-size: 13px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
> label {
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
font-weight: bold;
|
|
36
|
+
font-size: 13px;
|
|
37
|
+
margin-bottom: 5px;
|
|
38
|
+
|
|
39
|
+
span {
|
|
40
|
+
line-height: 0; // Strip whitespace from icon
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { useState } from '@storybook/addons';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Label } from '../../..';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Forms/Label',
|
|
7
|
+
component: Label,
|
|
8
|
+
args: {
|
|
9
|
+
label: 'Label',
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const Template = (args) => (
|
|
14
|
+
<Label
|
|
15
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
16
|
+
{...args}
|
|
17
|
+
/>
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
export const Default = Template.bind({});
|
|
21
|
+
|
|
22
|
+
export const HelpIconTooltip = Template.bind({});
|
|
23
|
+
HelpIconTooltip.args = {
|
|
24
|
+
helpText: 'Tooltip goes here',
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const HelpIconClickable = Template.bind({});
|
|
28
|
+
HelpIconClickable.args = {
|
|
29
|
+
onClickHelp: () => {},
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const InfoIcon = Template.bind({});
|
|
33
|
+
InfoIcon.args = {
|
|
34
|
+
info: 'Info goes here',
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const LockIcon = () => {
|
|
38
|
+
const [locked, setLocked] = useState(false);
|
|
39
|
+
const handleToggleLock = () => setLocked(!locked);
|
|
40
|
+
return (
|
|
41
|
+
<Label
|
|
42
|
+
label="Label"
|
|
43
|
+
lock={{
|
|
44
|
+
visible: true,
|
|
45
|
+
active: locked,
|
|
46
|
+
onClick: handleToggleLock,
|
|
47
|
+
tooltip: locked ? 'Unlock' : 'Lock',
|
|
48
|
+
testId: 'testId',
|
|
49
|
+
}}
|
|
50
|
+
/>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const LibraryIcon = Template.bind({});
|
|
55
|
+
LibraryIcon.args = {
|
|
56
|
+
libraryIcon: {
|
|
57
|
+
onClick: () => {},
|
|
58
|
+
tooltip: 'View in library',
|
|
59
|
+
},
|
|
60
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { StyledColumn } from './styles.js';
|
|
4
|
+
|
|
5
|
+
export const Column = ({
|
|
6
|
+
background,
|
|
7
|
+
borderLeft,
|
|
8
|
+
borderRight,
|
|
9
|
+
children,
|
|
10
|
+
flex,
|
|
11
|
+
flexbox,
|
|
12
|
+
padding,
|
|
13
|
+
scroll,
|
|
14
|
+
showScrollbar,
|
|
15
|
+
spacing,
|
|
16
|
+
width,
|
|
17
|
+
widthMobile,
|
|
18
|
+
widthTablet,
|
|
19
|
+
testId,
|
|
20
|
+
}) => {
|
|
21
|
+
const getWidthString = (w) => {
|
|
22
|
+
return typeof w === 'string'
|
|
23
|
+
? w
|
|
24
|
+
: typeof w === 'number'
|
|
25
|
+
? `${w}px`
|
|
26
|
+
: undefined;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<StyledColumn
|
|
31
|
+
background={background}
|
|
32
|
+
borderLeft={borderLeft}
|
|
33
|
+
borderRight={borderRight}
|
|
34
|
+
flex={flex}
|
|
35
|
+
flexbox={flexbox}
|
|
36
|
+
padding={padding}
|
|
37
|
+
scroll={scroll}
|
|
38
|
+
showScrollbar={showScrollbar}
|
|
39
|
+
spacing={spacing}
|
|
40
|
+
width={getWidthString(width)}
|
|
41
|
+
widthTablet={getWidthString(widthTablet)}
|
|
42
|
+
widthMobile={getWidthString(widthMobile)}
|
|
43
|
+
>
|
|
44
|
+
<div className="inner" data-testid={testId}>
|
|
45
|
+
{children}
|
|
46
|
+
</div>
|
|
47
|
+
</StyledColumn>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
Column.defaultProps = {
|
|
52
|
+
background: 'transparent',
|
|
53
|
+
borderLeft: null,
|
|
54
|
+
borderRight: null,
|
|
55
|
+
children: null,
|
|
56
|
+
flex: true,
|
|
57
|
+
flexbox: false,
|
|
58
|
+
padding: false,
|
|
59
|
+
scroll: false,
|
|
60
|
+
showScrollbar: true,
|
|
61
|
+
spacing: 20,
|
|
62
|
+
width: null,
|
|
63
|
+
widthMobile: null,
|
|
64
|
+
widthTablet: null,
|
|
65
|
+
testId: '',
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
Column.propTypes = {
|
|
69
|
+
background: PropTypes.string,
|
|
70
|
+
borderLeft: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
71
|
+
borderRight: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
72
|
+
children: PropTypes.node,
|
|
73
|
+
/** Fill available `Row` width */
|
|
74
|
+
flex: PropTypes.bool,
|
|
75
|
+
/** Give `Column` children flexbox layout */
|
|
76
|
+
flexbox: PropTypes.bool,
|
|
77
|
+
padding: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
78
|
+
scroll: PropTypes.bool,
|
|
79
|
+
showScrollbar: PropTypes.bool,
|
|
80
|
+
spacing: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
81
|
+
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
82
|
+
widthMobile: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
83
|
+
widthTablet: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
84
|
+
testId: PropTypes.string,
|
|
85
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
|
|
3
|
+
const noScrollbars = css`
|
|
4
|
+
scrollbar-width: none;
|
|
5
|
+
-ms-overflow-style: none;
|
|
6
|
+
&::-webkit-scrollbar {
|
|
7
|
+
display: none;
|
|
8
|
+
}
|
|
9
|
+
`;
|
|
10
|
+
|
|
11
|
+
export const StyledColumn = styled.div`
|
|
12
|
+
position: relative; //for react-laag
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
min-width: 0;
|
|
16
|
+
flex-basis: ${(p) => p.width || 'auto'};
|
|
17
|
+
flex-grow: ${(p) => (!p.width && p.flex ? '1' : '0')};
|
|
18
|
+
flex-shrink: ${(p) => (p.width || !p.flex ? '0' : '1')};
|
|
19
|
+
overflow: ${(p) => (p.scroll ? 'auto' : 'initial')};
|
|
20
|
+
background: ${(p) => p.background};
|
|
21
|
+
border-left: ${(p) =>
|
|
22
|
+
p.borderLeft === true ? '1px solid var(--color-border)' : p.borderLeft};
|
|
23
|
+
border-right: ${(p) =>
|
|
24
|
+
p.borderRight === true ? '1px solid var(--color-border)' : p.borderRight};
|
|
25
|
+
padding: ${(p) => (p.spacing ? `0 ${p.spacing / 2}px` : '0')};
|
|
26
|
+
${(p) => !p.showScrollbar && noScrollbars}
|
|
27
|
+
|
|
28
|
+
@media (max-width: 992px) {
|
|
29
|
+
${(p) => p.widthTablet && `flex-basis: ${p.widthTablet};`}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@media (max-width: 575px) {
|
|
33
|
+
${(p) => p.widthMobile && `flex-basis: ${p.widthMobile};`}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
> .inner {
|
|
37
|
+
flex-basis: 100%;
|
|
38
|
+
position: relative;
|
|
39
|
+
z-index: 0;
|
|
40
|
+
min-height: 0;
|
|
41
|
+
display: ${(p) => (p.flexbox && !p.scroll ? 'flex' : 'block')};
|
|
42
|
+
${(p) => p.flexbox && `flex-direction: column;`}
|
|
43
|
+
padding: ${(p) => (p.padding === true ? '16px 20px' : p.padding)};
|
|
44
|
+
}
|
|
45
|
+
`;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Column, Row, Heading } from '../../..';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Layout/Columns & Rows',
|
|
6
|
+
component: Column,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: 'fullscreen',
|
|
9
|
+
},
|
|
10
|
+
args: {
|
|
11
|
+
width: '400px',
|
|
12
|
+
padding: '20px',
|
|
13
|
+
borderRight: true,
|
|
14
|
+
},
|
|
15
|
+
argTypes: {
|
|
16
|
+
width: { control: { type: 'text' } },
|
|
17
|
+
padding: { control: { type: 'text' } },
|
|
18
|
+
borderLeft: { control: { type: 'boolean' } },
|
|
19
|
+
borderRight: { control: { type: 'boolean' } },
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const Template = (args) => {
|
|
24
|
+
const { height, wrap, ...columnArgs } = args;
|
|
25
|
+
return (
|
|
26
|
+
<Row spacing={0} height={height} wrap={wrap}>
|
|
27
|
+
<Column
|
|
28
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
29
|
+
{...columnArgs}
|
|
30
|
+
>
|
|
31
|
+
<Heading top>Column</Heading>
|
|
32
|
+
{'Example content goes here lorem ipsum. '.repeat(20)}
|
|
33
|
+
</Column>
|
|
34
|
+
<Column padding="20px" background="var(--color-background)" />
|
|
35
|
+
</Row>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const Default = Template.bind({});
|
|
40
|
+
|
|
41
|
+
export const Scroll = Template.bind({});
|
|
42
|
+
Scroll.args = {
|
|
43
|
+
scroll: true,
|
|
44
|
+
height: '200px',
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const HideScrollbar = Template.bind({});
|
|
48
|
+
HideScrollbar.args = {
|
|
49
|
+
scroll: true,
|
|
50
|
+
showScrollbar: false,
|
|
51
|
+
height: '200px',
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const ResponsiveWidth = Template.bind({});
|
|
55
|
+
ResponsiveWidth.args = {
|
|
56
|
+
wrap: true,
|
|
57
|
+
widthTablet: '50%',
|
|
58
|
+
widthMobile: '100%',
|
|
59
|
+
borderRight: false,
|
|
60
|
+
};
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { FaChevronLeft } from 'react-icons/fa';
|
|
3
|
+
import {
|
|
4
|
+
Page,
|
|
5
|
+
Column,
|
|
6
|
+
Row,
|
|
7
|
+
FormRow,
|
|
8
|
+
TopBar,
|
|
9
|
+
SideBar,
|
|
10
|
+
Heading,
|
|
11
|
+
Button,
|
|
12
|
+
Drawer,
|
|
13
|
+
List,
|
|
14
|
+
Field,
|
|
15
|
+
Input,
|
|
16
|
+
Select,
|
|
17
|
+
CheckBox,
|
|
18
|
+
Tabs,
|
|
19
|
+
Accordion,
|
|
20
|
+
InputGroup,
|
|
21
|
+
InputGroupAddon,
|
|
22
|
+
Spacer,
|
|
23
|
+
} from '../../../..';
|
|
24
|
+
|
|
25
|
+
const options = [
|
|
26
|
+
{
|
|
27
|
+
label: 'Settings',
|
|
28
|
+
value: 'settings',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
label: 'Simulation Results',
|
|
32
|
+
value: 'results',
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
const casingOptions = [
|
|
36
|
+
'30, Conductor, Casing',
|
|
37
|
+
'20, Surface, Casing',
|
|
38
|
+
'13 3/8, Intermediate, Casing',
|
|
39
|
+
'11 3/4, Surface, Casing',
|
|
40
|
+
'9 5/8, Production, Casing',
|
|
41
|
+
];
|
|
42
|
+
|
|
43
|
+
export default {
|
|
44
|
+
title: 'Layout/Layout Examples',
|
|
45
|
+
parameters: {
|
|
46
|
+
layout: 'fullscreen',
|
|
47
|
+
docs: {
|
|
48
|
+
inlineStories: false,
|
|
49
|
+
iframeHeight: 800,
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const AFESimulation = () => {
|
|
55
|
+
const [open, setOpen] = useState(true);
|
|
56
|
+
const [selectedTab, setSelectedTab] = useState(options[0]);
|
|
57
|
+
return (
|
|
58
|
+
<>
|
|
59
|
+
<TopBar />
|
|
60
|
+
<SideBar options={{ title: '', sections: [] }} />
|
|
61
|
+
<Page padding={false} scroll={false}>
|
|
62
|
+
<Row spacing={0} height="100%">
|
|
63
|
+
<Drawer
|
|
64
|
+
button={
|
|
65
|
+
<Button
|
|
66
|
+
onClick={() => setOpen(!open)}
|
|
67
|
+
round
|
|
68
|
+
icon={<FaChevronLeft />}
|
|
69
|
+
/>
|
|
70
|
+
}
|
|
71
|
+
open={open}
|
|
72
|
+
width={300}
|
|
73
|
+
closedWidth={50}
|
|
74
|
+
>
|
|
75
|
+
<List
|
|
76
|
+
drawer
|
|
77
|
+
narrow={!open}
|
|
78
|
+
list={{
|
|
79
|
+
name: 'AFE Simulation',
|
|
80
|
+
items: [
|
|
81
|
+
{
|
|
82
|
+
id: 1,
|
|
83
|
+
name: 'Simulation name here',
|
|
84
|
+
active: true,
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
id: 2,
|
|
88
|
+
name: 'Ipsum',
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
}}
|
|
92
|
+
/>
|
|
93
|
+
</Drawer>
|
|
94
|
+
<Column scroll padding borderLeft>
|
|
95
|
+
<Heading top>Simulation name here</Heading>
|
|
96
|
+
<Tabs
|
|
97
|
+
options={options}
|
|
98
|
+
value={selectedTab}
|
|
99
|
+
onChange={(evt) => {
|
|
100
|
+
const { value, label } = evt.target;
|
|
101
|
+
setSelectedTab({ value, label });
|
|
102
|
+
}}
|
|
103
|
+
/>
|
|
104
|
+
<FormRow>
|
|
105
|
+
<Field label="Name">
|
|
106
|
+
<Input value="Simulation name here" width="200px" />
|
|
107
|
+
</Field>
|
|
108
|
+
<Field label="Initial condition">
|
|
109
|
+
<Select
|
|
110
|
+
options={[
|
|
111
|
+
{
|
|
112
|
+
label: 'E3 - Circulation through drillpipe',
|
|
113
|
+
value: 'e3',
|
|
114
|
+
},
|
|
115
|
+
]}
|
|
116
|
+
value={{
|
|
117
|
+
label: 'E3 - Circulation through drillpipe',
|
|
118
|
+
value: 'e3',
|
|
119
|
+
}}
|
|
120
|
+
native
|
|
121
|
+
/>
|
|
122
|
+
</Field>
|
|
123
|
+
</FormRow>
|
|
124
|
+
<Spacer />
|
|
125
|
+
{casingOptions.map((option) => (
|
|
126
|
+
<div key={option}>
|
|
127
|
+
<Accordion
|
|
128
|
+
heading={<Heading>{option}</Heading>}
|
|
129
|
+
managed
|
|
130
|
+
bordered
|
|
131
|
+
>
|
|
132
|
+
<FormRow>
|
|
133
|
+
<Field label="Leak off @TVD 425">
|
|
134
|
+
<CheckBox label="Use formation data" checked />
|
|
135
|
+
</Field>
|
|
136
|
+
<Field>
|
|
137
|
+
<InputGroup>
|
|
138
|
+
<Input
|
|
139
|
+
width="200px"
|
|
140
|
+
disabled
|
|
141
|
+
value="1.532142857142857"
|
|
142
|
+
/>
|
|
143
|
+
<InputGroupAddon>m</InputGroupAddon>
|
|
144
|
+
</InputGroup>
|
|
145
|
+
</Field>
|
|
146
|
+
<Field>
|
|
147
|
+
<CheckBox label="Gas cap" />
|
|
148
|
+
</Field>
|
|
149
|
+
<Field>
|
|
150
|
+
<CheckBox label="Max allowable pressure buildup" />
|
|
151
|
+
</Field>
|
|
152
|
+
</FormRow>
|
|
153
|
+
</Accordion>
|
|
154
|
+
<Spacer height={5} />
|
|
155
|
+
</div>
|
|
156
|
+
))}
|
|
157
|
+
<Spacer />
|
|
158
|
+
<Field label="Final condition">
|
|
159
|
+
<Select
|
|
160
|
+
options={[
|
|
161
|
+
{
|
|
162
|
+
label: 'Undisturbed',
|
|
163
|
+
value: 'Undisturbed',
|
|
164
|
+
},
|
|
165
|
+
]}
|
|
166
|
+
value={{
|
|
167
|
+
label: 'Undisturbed',
|
|
168
|
+
value: 'Undisturbed',
|
|
169
|
+
}}
|
|
170
|
+
native
|
|
171
|
+
width="auto"
|
|
172
|
+
/>
|
|
173
|
+
</Field>
|
|
174
|
+
<Button label="Simulate" colored />
|
|
175
|
+
</Column>
|
|
176
|
+
</Row>
|
|
177
|
+
</Page>
|
|
178
|
+
</>
|
|
179
|
+
);
|
|
180
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FaQuestion } from 'react-icons/fa';
|
|
3
|
+
import {
|
|
4
|
+
TopBar,
|
|
5
|
+
SideBar,
|
|
6
|
+
Heading,
|
|
7
|
+
Button,
|
|
8
|
+
Card,
|
|
9
|
+
Column,
|
|
10
|
+
Row,
|
|
11
|
+
Page,
|
|
12
|
+
Spacer,
|
|
13
|
+
} from '../../../..';
|
|
14
|
+
|
|
15
|
+
const ImagePlaceholder = ({ width, height }) => (
|
|
16
|
+
<div style={{ background: '#ddd', width, height }}></div>
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
export default {
|
|
20
|
+
title: 'Layout/Layout Examples',
|
|
21
|
+
parameters: {
|
|
22
|
+
layout: 'fullscreen',
|
|
23
|
+
docs: {
|
|
24
|
+
inlineStories: false,
|
|
25
|
+
iframeHeight: 800,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const Blowout = () => {
|
|
31
|
+
return (
|
|
32
|
+
<>
|
|
33
|
+
<TopBar />
|
|
34
|
+
<SideBar options={{ title: '', sections: [] }} />
|
|
35
|
+
<Page padding="16px 20px">
|
|
36
|
+
<Row>
|
|
37
|
+
<Column width="80px">
|
|
38
|
+
<ImagePlaceholder width={60} height={80} />
|
|
39
|
+
</Column>
|
|
40
|
+
<Column>
|
|
41
|
+
<Heading top>Blowout Simulation</Heading>
|
|
42
|
+
<Button colored label="Save & run simulation" />
|
|
43
|
+
</Column>
|
|
44
|
+
<Column flex={false}>
|
|
45
|
+
<Button onClick={() => {}} round icon={<FaQuestion />} />
|
|
46
|
+
</Column>
|
|
47
|
+
</Row>
|
|
48
|
+
<Spacer />
|
|
49
|
+
<Row>
|
|
50
|
+
<Column>
|
|
51
|
+
<Card heading={<Heading>Reservoir Zones</Heading>}>Content</Card>
|
|
52
|
+
<Spacer />
|
|
53
|
+
<Card heading={<Heading>Simulation Models</Heading>}>Content</Card>
|
|
54
|
+
<Spacer />
|
|
55
|
+
<Card heading={<Heading>Simulation Options</Heading>}>Content</Card>
|
|
56
|
+
</Column>
|
|
57
|
+
<Column>
|
|
58
|
+
<Card heading={<Heading>Drill String</Heading>}>Content</Card>
|
|
59
|
+
<Spacer />
|
|
60
|
+
<Card heading={<Heading>Surface Roughness</Heading>}>Content</Card>
|
|
61
|
+
<Spacer />
|
|
62
|
+
<Card heading={<Heading>Weighted Rates</Heading>}>Content</Card>
|
|
63
|
+
</Column>
|
|
64
|
+
</Row>
|
|
65
|
+
</Page>
|
|
66
|
+
</>
|
|
67
|
+
);
|
|
68
|
+
};
|