@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,211 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { FaQuestion, FaChevronLeft } from 'react-icons/fa';
|
|
3
|
+
import {
|
|
4
|
+
TopBar,
|
|
5
|
+
SideBar,
|
|
6
|
+
Heading,
|
|
7
|
+
Button,
|
|
8
|
+
Card,
|
|
9
|
+
Drawer,
|
|
10
|
+
List,
|
|
11
|
+
Field,
|
|
12
|
+
Input,
|
|
13
|
+
RadioButton,
|
|
14
|
+
Select,
|
|
15
|
+
CheckBox,
|
|
16
|
+
Spacer,
|
|
17
|
+
Page,
|
|
18
|
+
Row,
|
|
19
|
+
Column,
|
|
20
|
+
FormRow,
|
|
21
|
+
} from '../../../..';
|
|
22
|
+
|
|
23
|
+
const ImagePlaceholder = ({ width, height }) => (
|
|
24
|
+
<div style={{ background: '#ddd', width, height }}></div>
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
export default {
|
|
28
|
+
title: 'Layout/Layout Examples',
|
|
29
|
+
parameters: {
|
|
30
|
+
layout: 'fullscreen',
|
|
31
|
+
docs: {
|
|
32
|
+
inlineStories: false,
|
|
33
|
+
iframeHeight: 800,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const Reservoirs = () => {
|
|
39
|
+
const [open, setOpen] = useState(true);
|
|
40
|
+
return (
|
|
41
|
+
<>
|
|
42
|
+
<TopBar />
|
|
43
|
+
<SideBar options={{ title: '', sections: [] }} />
|
|
44
|
+
<Page padding={false} scroll={false}>
|
|
45
|
+
<Row spacing={0} height="100%">
|
|
46
|
+
<Drawer
|
|
47
|
+
button={
|
|
48
|
+
<Button
|
|
49
|
+
onClick={() => setOpen(!open)}
|
|
50
|
+
round
|
|
51
|
+
icon={<FaChevronLeft />}
|
|
52
|
+
/>
|
|
53
|
+
}
|
|
54
|
+
open={open}
|
|
55
|
+
width={300}
|
|
56
|
+
closedWidth={50}
|
|
57
|
+
>
|
|
58
|
+
<List
|
|
59
|
+
drawer
|
|
60
|
+
narrow={!open}
|
|
61
|
+
list={{
|
|
62
|
+
name: 'Reservoirs',
|
|
63
|
+
items: [
|
|
64
|
+
{
|
|
65
|
+
id: 1,
|
|
66
|
+
name: 'Lorem',
|
|
67
|
+
active: true,
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
id: 2,
|
|
71
|
+
name: 'Ipsum',
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
}}
|
|
75
|
+
/>
|
|
76
|
+
</Drawer>
|
|
77
|
+
<Column scroll padding borderLeft>
|
|
78
|
+
<Row>
|
|
79
|
+
<Column>
|
|
80
|
+
<Heading top>Reservoir name here</Heading>
|
|
81
|
+
<FormRow>
|
|
82
|
+
<Field label="Name">
|
|
83
|
+
<Input value="Reservoir name here" width="200px" />
|
|
84
|
+
</Field>
|
|
85
|
+
<Field label="Lorem">
|
|
86
|
+
<RadioButton
|
|
87
|
+
name="example"
|
|
88
|
+
options={[
|
|
89
|
+
{ label: 'Aardvarks', value: 'termites' },
|
|
90
|
+
{ label: 'Monkeys', value: 'bananas' },
|
|
91
|
+
]}
|
|
92
|
+
value={{ label: 'Monkeys', value: 'bananas' }}
|
|
93
|
+
inline
|
|
94
|
+
/>
|
|
95
|
+
</Field>
|
|
96
|
+
<Field label="Ipsum">
|
|
97
|
+
<Select
|
|
98
|
+
name="example"
|
|
99
|
+
options={[
|
|
100
|
+
{ label: 'Monkeys', value: 'bananas' },
|
|
101
|
+
{ label: 'Possums', value: 'slugs' },
|
|
102
|
+
]}
|
|
103
|
+
value={{ label: 'Monkeys', value: 'bananas' }}
|
|
104
|
+
native
|
|
105
|
+
/>
|
|
106
|
+
</Field>
|
|
107
|
+
<Field>
|
|
108
|
+
<CheckBox label="Dolor" />
|
|
109
|
+
</Field>
|
|
110
|
+
</FormRow>
|
|
111
|
+
</Column>
|
|
112
|
+
<Column flex={false}>
|
|
113
|
+
<Button onClick={() => {}} round icon={<FaQuestion />} />
|
|
114
|
+
</Column>
|
|
115
|
+
</Row>
|
|
116
|
+
<Spacer height={10} />
|
|
117
|
+
<Row>
|
|
118
|
+
<Column width="50%">
|
|
119
|
+
<Card
|
|
120
|
+
heading={
|
|
121
|
+
<Heading onClickHelp={() => console.log('help!')}>
|
|
122
|
+
Reservoir Zone
|
|
123
|
+
</Heading>
|
|
124
|
+
}
|
|
125
|
+
>
|
|
126
|
+
<Row>
|
|
127
|
+
<Column width="50%">
|
|
128
|
+
<Field label="Label" helpText="Lorem ipsum">
|
|
129
|
+
<RadioButton
|
|
130
|
+
options={[
|
|
131
|
+
{ label: 'Aardvarks', value: 'termites' },
|
|
132
|
+
{ label: 'Monkeys', value: 'bananas' },
|
|
133
|
+
]}
|
|
134
|
+
value={{ label: 'Monkeys', value: 'bananas' }}
|
|
135
|
+
inline
|
|
136
|
+
/>
|
|
137
|
+
<Input width="100%" />
|
|
138
|
+
</Field>
|
|
139
|
+
<Field label="Label" helpText="Lorem ipsum">
|
|
140
|
+
<CheckBox label="Lorem ipsum" />
|
|
141
|
+
<Input width="100%" disabled />
|
|
142
|
+
</Field>
|
|
143
|
+
|
|
144
|
+
<Field label="Label" helpText="Lorem ipsum">
|
|
145
|
+
<Input width="100%" />
|
|
146
|
+
</Field>
|
|
147
|
+
<Field label="Label" helpText="Lorem ipsum">
|
|
148
|
+
<Input width="100%" />
|
|
149
|
+
</Field>
|
|
150
|
+
</Column>
|
|
151
|
+
<Column width="50%">
|
|
152
|
+
<Field label="Label" helpText="Lorem ipsum">
|
|
153
|
+
<Input width="100%" />
|
|
154
|
+
</Field>
|
|
155
|
+
<Field label="Label" helpText="Lorem ipsum">
|
|
156
|
+
<Input width="100%" />
|
|
157
|
+
</Field>
|
|
158
|
+
<Field label="Label" helpText="Lorem ipsum">
|
|
159
|
+
<Input width="100%" />
|
|
160
|
+
</Field>
|
|
161
|
+
<Field label="Label" helpText="Lorem ipsum">
|
|
162
|
+
<Input width="100%" />
|
|
163
|
+
</Field>
|
|
164
|
+
</Column>
|
|
165
|
+
</Row>
|
|
166
|
+
</Card>
|
|
167
|
+
</Column>
|
|
168
|
+
<Column width="50%">
|
|
169
|
+
<Card heading={<Heading>Reservoir Size</Heading>}>
|
|
170
|
+
<Row>
|
|
171
|
+
<Column width="160px">
|
|
172
|
+
<Field label="Length">
|
|
173
|
+
<Input width="100%" />
|
|
174
|
+
</Field>
|
|
175
|
+
<Field label="Width">
|
|
176
|
+
<Input width="100%" />
|
|
177
|
+
</Field>
|
|
178
|
+
</Column>
|
|
179
|
+
<Column>
|
|
180
|
+
<ImagePlaceholder width="100%" height="100%" />
|
|
181
|
+
</Column>
|
|
182
|
+
</Row>
|
|
183
|
+
</Card>
|
|
184
|
+
<Spacer />
|
|
185
|
+
<Card heading={<Heading>Reservoir Properties</Heading>}>
|
|
186
|
+
<Row>
|
|
187
|
+
<Column>
|
|
188
|
+
<Field label="Label">
|
|
189
|
+
<Input width="100%" />
|
|
190
|
+
</Field>
|
|
191
|
+
</Column>
|
|
192
|
+
<Column>
|
|
193
|
+
<Field label="Label">
|
|
194
|
+
<Input width="100%" />
|
|
195
|
+
</Field>
|
|
196
|
+
</Column>
|
|
197
|
+
<Column>
|
|
198
|
+
<Field label="Label">
|
|
199
|
+
<Input width="100%" />
|
|
200
|
+
</Field>
|
|
201
|
+
</Column>
|
|
202
|
+
</Row>
|
|
203
|
+
</Card>
|
|
204
|
+
</Column>
|
|
205
|
+
</Row>
|
|
206
|
+
</Column>
|
|
207
|
+
</Row>
|
|
208
|
+
</Page>
|
|
209
|
+
</>
|
|
210
|
+
);
|
|
211
|
+
};
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { FaChevronLeft } from 'react-icons/fa';
|
|
3
|
+
import {
|
|
4
|
+
Accordion,
|
|
5
|
+
TopBar,
|
|
6
|
+
SideBar,
|
|
7
|
+
Heading,
|
|
8
|
+
Button,
|
|
9
|
+
Drawer,
|
|
10
|
+
List,
|
|
11
|
+
Field,
|
|
12
|
+
Input,
|
|
13
|
+
CheckBox,
|
|
14
|
+
Page,
|
|
15
|
+
Row,
|
|
16
|
+
Column,
|
|
17
|
+
Spacer,
|
|
18
|
+
Tabs,
|
|
19
|
+
} from '../../../..';
|
|
20
|
+
|
|
21
|
+
const options = [
|
|
22
|
+
{
|
|
23
|
+
label: 'Import',
|
|
24
|
+
value: 'import',
|
|
25
|
+
right: true,
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
label: 'Settings',
|
|
29
|
+
value: 'settings',
|
|
30
|
+
right: true,
|
|
31
|
+
},
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
const MapPlaceholder = () => (
|
|
35
|
+
<div
|
|
36
|
+
style={{
|
|
37
|
+
background: '#AAD3DF',
|
|
38
|
+
borderLeft: '1px solid #8AB3BF',
|
|
39
|
+
display: 'flex',
|
|
40
|
+
alignItems: 'center',
|
|
41
|
+
justifyContent: 'center',
|
|
42
|
+
color: 'white',
|
|
43
|
+
height: '100%',
|
|
44
|
+
}}
|
|
45
|
+
>
|
|
46
|
+
MAP
|
|
47
|
+
</div>
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
export default {
|
|
51
|
+
title: 'Layout/Layout Examples',
|
|
52
|
+
parameters: {
|
|
53
|
+
layout: 'fullscreen',
|
|
54
|
+
docs: {
|
|
55
|
+
inlineStories: false,
|
|
56
|
+
iframeHeight: 800,
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const Site = () => {
|
|
62
|
+
const [open, setOpen] = useState(true);
|
|
63
|
+
return (
|
|
64
|
+
<>
|
|
65
|
+
<TopBar />
|
|
66
|
+
<SideBar options={{ title: '', sections: [] }} width="250px" />
|
|
67
|
+
<Page padding={false} scroll={false}>
|
|
68
|
+
<Row spacing={0} flex>
|
|
69
|
+
<Drawer
|
|
70
|
+
button={
|
|
71
|
+
<Button
|
|
72
|
+
onClick={() => setOpen(!open)}
|
|
73
|
+
round
|
|
74
|
+
icon={<FaChevronLeft />}
|
|
75
|
+
/>
|
|
76
|
+
}
|
|
77
|
+
open={open}
|
|
78
|
+
width={300}
|
|
79
|
+
closedWidth={50}
|
|
80
|
+
>
|
|
81
|
+
<List
|
|
82
|
+
drawer
|
|
83
|
+
narrow={!open}
|
|
84
|
+
list={{
|
|
85
|
+
name: 'Sites',
|
|
86
|
+
items: [
|
|
87
|
+
{
|
|
88
|
+
id: 1,
|
|
89
|
+
name: 'Main Site',
|
|
90
|
+
type: 'Heading',
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
id: 2,
|
|
94
|
+
name: 'Site name here',
|
|
95
|
+
active: true,
|
|
96
|
+
label: {
|
|
97
|
+
value: 1,
|
|
98
|
+
color: '#69779b',
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
id: 3,
|
|
103
|
+
name: 'Locations',
|
|
104
|
+
type: 'Heading',
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
id: 4,
|
|
108
|
+
name: 'Ipsum',
|
|
109
|
+
label: {
|
|
110
|
+
value: 2,
|
|
111
|
+
color: '#69779b',
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
id: 5,
|
|
116
|
+
name: 'Dolor',
|
|
117
|
+
label: {
|
|
118
|
+
value: 3,
|
|
119
|
+
color: '#69779b',
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
],
|
|
123
|
+
}}
|
|
124
|
+
/>
|
|
125
|
+
<List
|
|
126
|
+
drawer
|
|
127
|
+
narrow={!open}
|
|
128
|
+
list={{
|
|
129
|
+
name: 'Wells',
|
|
130
|
+
items: [
|
|
131
|
+
{
|
|
132
|
+
id: 1,
|
|
133
|
+
name: 'Main Wellbore',
|
|
134
|
+
type: 'Heading',
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
id: 2,
|
|
138
|
+
name: 'Lorem',
|
|
139
|
+
label: {
|
|
140
|
+
value: 1,
|
|
141
|
+
color: '#77699b',
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
],
|
|
145
|
+
}}
|
|
146
|
+
/>
|
|
147
|
+
<List
|
|
148
|
+
drawer
|
|
149
|
+
narrow={!open}
|
|
150
|
+
list={{
|
|
151
|
+
name: 'Targets',
|
|
152
|
+
items: [
|
|
153
|
+
{
|
|
154
|
+
id: 1,
|
|
155
|
+
name: 'Lorem',
|
|
156
|
+
label: {
|
|
157
|
+
value: 1,
|
|
158
|
+
color: '#9b6977',
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
],
|
|
162
|
+
}}
|
|
163
|
+
/>
|
|
164
|
+
</Drawer>
|
|
165
|
+
<Column borderLeft flexbox>
|
|
166
|
+
<Tabs padding margin={false} options={options} />
|
|
167
|
+
<Row spacing={0} flex>
|
|
168
|
+
<Column scroll padding width={550}>
|
|
169
|
+
<Heading top>Site name here</Heading>
|
|
170
|
+
<Field label="Name">
|
|
171
|
+
<Input value="Site name here" width="200px" />
|
|
172
|
+
</Field>
|
|
173
|
+
<Spacer />
|
|
174
|
+
<Accordion
|
|
175
|
+
heading={<Heading>Coordinate Reference System</Heading>}
|
|
176
|
+
managed
|
|
177
|
+
>
|
|
178
|
+
<Field label="Label" labelLeft labelWidth="50px">
|
|
179
|
+
<Input value="Value" width="100%" />
|
|
180
|
+
</Field>
|
|
181
|
+
<Field label="Label" labelLeft labelWidth="50px">
|
|
182
|
+
<Input value="Value" width="100%" />
|
|
183
|
+
</Field>
|
|
184
|
+
<Field label="Label" labelLeft labelWidth="50px">
|
|
185
|
+
<Input value="Value" width="100%" />
|
|
186
|
+
</Field>
|
|
187
|
+
<Field>
|
|
188
|
+
<CheckBox label="Dolor" />
|
|
189
|
+
</Field>
|
|
190
|
+
</Accordion>
|
|
191
|
+
<Spacer />
|
|
192
|
+
<Heading marginBottom={10}>Location</Heading>
|
|
193
|
+
<Row spacing={10}>
|
|
194
|
+
<Column>
|
|
195
|
+
<Field label="Label">
|
|
196
|
+
<Input value="Value" width="100%" />
|
|
197
|
+
</Field>
|
|
198
|
+
</Column>
|
|
199
|
+
<Column>
|
|
200
|
+
<Field label="Label">
|
|
201
|
+
<Input value="Value" width="100%" />
|
|
202
|
+
</Field>
|
|
203
|
+
</Column>
|
|
204
|
+
<Column>
|
|
205
|
+
<Field label="Label">
|
|
206
|
+
<Input value="Value" width="100%" />
|
|
207
|
+
</Field>
|
|
208
|
+
</Column>
|
|
209
|
+
<Column>
|
|
210
|
+
<Field label="Label">
|
|
211
|
+
<Input value="Value" width="100%" />
|
|
212
|
+
</Field>
|
|
213
|
+
</Column>
|
|
214
|
+
</Row>
|
|
215
|
+
<Spacer />
|
|
216
|
+
<Heading marginBottom={10}>Model</Heading>
|
|
217
|
+
<Row spacing={10}>
|
|
218
|
+
<Column>
|
|
219
|
+
<Field label="Label">
|
|
220
|
+
<Input value="Value" width="100%" />
|
|
221
|
+
</Field>
|
|
222
|
+
</Column>
|
|
223
|
+
<Column>
|
|
224
|
+
<Field label="Label">
|
|
225
|
+
<Input value="Value" width="100%" />
|
|
226
|
+
</Field>
|
|
227
|
+
</Column>
|
|
228
|
+
</Row>
|
|
229
|
+
<Spacer />
|
|
230
|
+
<Accordion heading={<Heading>Settings</Heading>} managed>
|
|
231
|
+
<Field>
|
|
232
|
+
<CheckBox label="Dolor" />
|
|
233
|
+
</Field>
|
|
234
|
+
<Row spacing={10}>
|
|
235
|
+
<Column>
|
|
236
|
+
<Field label="Label">
|
|
237
|
+
<Input value="Value" width="100%" />
|
|
238
|
+
</Field>
|
|
239
|
+
<Field label="Label">
|
|
240
|
+
<Input value="Value" width="100%" />
|
|
241
|
+
</Field>
|
|
242
|
+
</Column>
|
|
243
|
+
<Column>
|
|
244
|
+
<Field label="Label">
|
|
245
|
+
<Input value="Value" width="100%" />
|
|
246
|
+
</Field>
|
|
247
|
+
<Field label="Label">
|
|
248
|
+
<Input value="Value" width="100%" />
|
|
249
|
+
</Field>
|
|
250
|
+
</Column>
|
|
251
|
+
</Row>
|
|
252
|
+
</Accordion>
|
|
253
|
+
</Column>
|
|
254
|
+
<Column>
|
|
255
|
+
<MapPlaceholder />
|
|
256
|
+
</Column>
|
|
257
|
+
</Row>
|
|
258
|
+
</Column>
|
|
259
|
+
</Row>
|
|
260
|
+
</Page>
|
|
261
|
+
</>
|
|
262
|
+
);
|
|
263
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React, { Fragment, isValidElement } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
|
|
4
|
+
export const Flex = ({
|
|
5
|
+
alignItems,
|
|
6
|
+
justifyContent,
|
|
7
|
+
direction,
|
|
8
|
+
height,
|
|
9
|
+
children,
|
|
10
|
+
wrap,
|
|
11
|
+
gap,
|
|
12
|
+
}) => {
|
|
13
|
+
return (
|
|
14
|
+
<div
|
|
15
|
+
style={{
|
|
16
|
+
display: 'flex',
|
|
17
|
+
flexDirection: direction,
|
|
18
|
+
alignItems,
|
|
19
|
+
justifyContent,
|
|
20
|
+
height,
|
|
21
|
+
flexWrap: wrap ? 'wrap' : 'nowrap',
|
|
22
|
+
gap: gap === false ? 0 : gap === true ? '20px' : gap,
|
|
23
|
+
}}
|
|
24
|
+
>
|
|
25
|
+
{children}
|
|
26
|
+
</div>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
Flex.defaultProps = {
|
|
31
|
+
alignItems: 'initial',
|
|
32
|
+
direction: 'initial',
|
|
33
|
+
height: 'initial',
|
|
34
|
+
justifyContent: 'initial',
|
|
35
|
+
children: null,
|
|
36
|
+
wrap: true,
|
|
37
|
+
gap: false,
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
Flex.propTypes = {
|
|
41
|
+
alignItems: PropTypes.string,
|
|
42
|
+
direction: PropTypes.string,
|
|
43
|
+
height: PropTypes.string,
|
|
44
|
+
justifyContent: PropTypes.string,
|
|
45
|
+
children: PropTypes.node,
|
|
46
|
+
wrap: PropTypes.bool,
|
|
47
|
+
gap: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
48
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Flex, Button, Text } from '../../../..';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Layout/Flex',
|
|
6
|
+
component: Flex,
|
|
7
|
+
argTypes: {
|
|
8
|
+
alignItems: {
|
|
9
|
+
control: {
|
|
10
|
+
type: 'inline-radio',
|
|
11
|
+
},
|
|
12
|
+
options: ['flex-start', 'center', 'flex-end'],
|
|
13
|
+
},
|
|
14
|
+
justifyContent: {
|
|
15
|
+
control: {
|
|
16
|
+
type: 'inline-radio',
|
|
17
|
+
},
|
|
18
|
+
options: ['flex-start', 'center', 'flex-end', 'space-between'],
|
|
19
|
+
},
|
|
20
|
+
gap: { control: { type: 'boolean' } },
|
|
21
|
+
},
|
|
22
|
+
args: {
|
|
23
|
+
alignItems: undefined,
|
|
24
|
+
justifyContent: undefined,
|
|
25
|
+
children: [<Button label="Button" />, <Text>Text</Text>],
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const Template = (args) => (
|
|
30
|
+
<Flex
|
|
31
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
32
|
+
{...args}
|
|
33
|
+
/>
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
export const Default = Template.bind({});
|
|
37
|
+
|
|
38
|
+
export const DefaultGap = Template.bind({});
|
|
39
|
+
DefaultGap.args = { gap: true };
|
|
40
|
+
|
|
41
|
+
export const CustomGap = Template.bind({});
|
|
42
|
+
CustomGap.args = { gap: '50px' };
|
|
43
|
+
|
|
44
|
+
export const Center = Template.bind({});
|
|
45
|
+
Center.args = {
|
|
46
|
+
height: '200px',
|
|
47
|
+
alignItems: 'center',
|
|
48
|
+
justifyContent: 'center',
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const SpaceBetween = Template.bind({});
|
|
52
|
+
SpaceBetween.args = {
|
|
53
|
+
justifyContent: 'space-between',
|
|
54
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import styles from './form-row.module.less';
|
|
4
|
+
|
|
5
|
+
export const FormRow = ({ children }) => {
|
|
6
|
+
return <div className={styles.formRow}>{children}</div>;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
FormRow.defaultProps = {
|
|
10
|
+
children: null,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
FormRow.propTypes = {
|
|
14
|
+
children: PropTypes.node,
|
|
15
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
|
|
5
|
+
const StyledGrid = styled.div`
|
|
6
|
+
display: grid;
|
|
7
|
+
gap: ${(p) => p.gap};
|
|
8
|
+
grid-template-rows: ${(p) => p.rows};
|
|
9
|
+
grid-template-columns: ${(p) => p.columns};
|
|
10
|
+
height: ${(p) => p.height};
|
|
11
|
+
|
|
12
|
+
@media (max-width: 992px) {
|
|
13
|
+
${(p) => p.columnsTablet && `grid-template-columns: ${p.columnsTablet};`}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@media (max-width: 575px) {
|
|
17
|
+
${(p) => p.columnsMobile && `grid-template-columns: ${p.columnsMobile};`}
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
20
|
+
|
|
21
|
+
export const Grid = ({
|
|
22
|
+
rows,
|
|
23
|
+
columns,
|
|
24
|
+
columnsTablet,
|
|
25
|
+
columnsMobile,
|
|
26
|
+
gap,
|
|
27
|
+
height,
|
|
28
|
+
children,
|
|
29
|
+
}) => {
|
|
30
|
+
return (
|
|
31
|
+
<StyledGrid
|
|
32
|
+
rows={rows}
|
|
33
|
+
columns={columns}
|
|
34
|
+
columnsTablet={columnsTablet}
|
|
35
|
+
columnsMobile={columnsMobile}
|
|
36
|
+
gap={gap === false ? 0 : gap === true ? '20px' : gap}
|
|
37
|
+
height={height}
|
|
38
|
+
>
|
|
39
|
+
{children}
|
|
40
|
+
</StyledGrid>
|
|
41
|
+
);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
Grid.defaultProps = {
|
|
45
|
+
rows: 'initial',
|
|
46
|
+
columns: 'initial',
|
|
47
|
+
columnsTablet: null,
|
|
48
|
+
columnsMobile: null,
|
|
49
|
+
gap: false,
|
|
50
|
+
height: 'initial',
|
|
51
|
+
children: null,
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
Grid.propTypes = {
|
|
55
|
+
rows: PropTypes.string,
|
|
56
|
+
columns: PropTypes.string,
|
|
57
|
+
columnsTablet: PropTypes.string,
|
|
58
|
+
columnsMobile: PropTypes.string,
|
|
59
|
+
gap: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
60
|
+
height: PropTypes.string,
|
|
61
|
+
children: PropTypes.node,
|
|
62
|
+
};
|