@oliasoft-open-source/react-ui-library 2.4.7 → 3.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/README.md +0 -1
- package/dist/global.css +21840 -0
- package/dist/index.js +43567 -0
- package/package.json +37 -55
- package/.eslintignore +0 -2
- package/.eslintrc.js +0 -125
- package/.gitlab-ci.yml +0 -76
- package/.husky/pre-commit +0 -4
- package/.prettierignore +0 -3
- package/.prettierrc +0 -4
- package/.storybook/main.js +0 -36
- package/.storybook/preview.js +0 -40
- package/.storybook/storybook.less +0 -8
- package/babel.config.js +0 -31
- package/index.js +0 -76
- package/jest.config.js +0 -9
- package/scripts/send-mattermost-message.sh +0 -21
- package/src/components/accordion/accordion.jsx +0 -132
- package/src/components/accordion/accordion.module.less +0 -66
- package/src/components/accordion/accordion.stories.jsx +0 -171
- package/src/components/accordion/chevron/chevron.jsx +0 -12
- package/src/components/accordion/chevron/chevron.module.less +0 -12
- package/src/components/accordion/helpers/accordion-with-default-toggle.jsx +0 -106
- package/src/components/accordion/helpers/accordion-with-default-toggle.module.less +0 -24
- package/src/components/actions/actions.jsx +0 -129
- package/src/components/actions/actions.module.less +0 -44
- package/src/components/actions/actions.shape.js +0 -32
- package/src/components/actions/actions.stories.jsx +0 -79
- package/src/components/badge/badge.jsx +0 -58
- package/src/components/badge/badge.module.less +0 -55
- package/src/components/badge/badge.stories.jsx +0 -31
- package/src/components/breadcrumb/breadcrumb.jsx +0 -49
- package/src/components/breadcrumb/breadcrumb.module.less +0 -39
- package/src/components/breadcrumb/breadcrumb.stories.jsx +0 -45
- package/src/components/breadcrumb/link.jsx +0 -31
- package/src/components/button/button.jsx +0 -156
- package/src/components/button/button.module.less +0 -300
- package/src/components/button/button.stories.jsx +0 -74
- package/src/components/button-group/button-group.jsx +0 -140
- package/src/components/button-group/button-group.module.less +0 -24
- package/src/components/button-group/button-group.stories-data.jsx +0 -67
- package/src/components/button-group/button-group.stories.jsx +0 -63
- package/src/components/buttons-and-links.stories.mdx +0 -55
- package/src/components/card/card.jsx +0 -51
- package/src/components/card/card.module.less +0 -48
- package/src/components/card/card.stories.jsx +0 -39
- package/src/components/check-box/check-box.jsx +0 -92
- package/src/components/check-box/check-box.module.less +0 -101
- package/src/components/check-box/check-box.stories.jsx +0 -27
- package/src/components/color/color.stories-data.jsx +0 -71
- package/src/components/color/color.stories.mdx +0 -37
- package/src/components/dialog/dialog.jsx +0 -77
- package/src/components/dialog/dialog.module.less +0 -76
- package/src/components/divider/divider.jsx +0 -40
- package/src/components/divider/divider.module.less +0 -28
- package/src/components/divider/divider.stories.jsx +0 -50
- package/src/components/drawer/drawer-resize-wrapper.jsx +0 -76
- package/src/components/drawer/drawer-tabs.jsx +0 -44
- package/src/components/drawer/drawer.jsx +0 -161
- package/src/components/drawer/drawer.module.less +0 -217
- package/src/components/drawer/drawer.stories.jsx +0 -296
- package/src/components/empty/empty.jsx +0 -52
- package/src/components/empty/empty.module.less +0 -17
- package/src/components/empty/empty.stories.jsx +0 -26
- package/src/components/file-input/file-input.jsx +0 -101
- package/src/components/file-input/file-input.module.less +0 -3
- package/src/components/file-input/file-input.stories.jsx +0 -109
- package/src/components/form/field.jsx +0 -96
- package/src/components/form/field.stories.jsx +0 -101
- package/src/components/form/form.module.less +0 -30
- package/src/components/form/form.stories.jsx +0 -191
- package/src/components/heading/heading.jsx +0 -105
- package/src/components/heading/heading.module.less +0 -59
- package/src/components/heading/heading.stories.jsx +0 -60
- package/src/components/icon/deprecated-icon.jsx +0 -97
- package/src/components/icon/icon.jsx +0 -71
- package/src/components/icon/icon.module.less +0 -33
- package/src/components/icon/icon.stories.jsx +0 -37
- package/src/components/icon/icons.example.module.less +0 -4
- package/src/components/input/input.jsx +0 -167
- package/src/components/input/input.module.less +0 -94
- package/src/components/input/input.stories.jsx +0 -28
- package/src/components/input-group/input-group-addon/input-group-addon.jsx +0 -36
- package/src/components/input-group/input-group-addon/input-group-addon.module.less +0 -31
- package/src/components/input-group/input-group.jsx +0 -51
- package/src/components/input-group/input-group.module.less +0 -10
- package/src/components/input-group/input-group.stories.jsx +0 -77
- package/src/components/input-validation.stories.mdx +0 -61
- package/src/components/inputs.stories.mdx +0 -201
- package/src/components/label/label.jsx +0 -115
- package/src/components/label/label.module.less +0 -43
- package/src/components/label/label.stories.jsx +0 -60
- package/src/components/layout/column/column.jsx +0 -85
- package/src/components/layout/column/styles.js +0 -45
- package/src/components/layout/column.stories.jsx +0 -60
- package/src/components/layout/examples/afe.stories.jsx +0 -180
- package/src/components/layout/examples/blowout.stories.jsx +0 -68
- package/src/components/layout/examples/casing-loads.stories.jsx +0 -297
- package/src/components/layout/examples/formation.stories.jsx +0 -110
- package/src/components/layout/examples/projects.stories.jsx +0 -108
- package/src/components/layout/examples/reservoirs.stories.jsx +0 -211
- package/src/components/layout/examples/site.stories.jsx +0 -263
- package/src/components/layout/flex/flex.jsx +0 -48
- package/src/components/layout/flex/flex.stories.jsx +0 -59
- package/src/components/layout/form-row/form-row.jsx +0 -15
- package/src/components/layout/form-row/form-row.module.less +0 -11
- package/src/components/layout/grid/grid.jsx +0 -62
- package/src/components/layout/grid/grid.stories.jsx +0 -67
- package/src/components/layout/page/page.jsx +0 -42
- package/src/components/layout/page/page.module.less +0 -27
- package/src/components/layout/page.stories.jsx +0 -93
- package/src/components/layout/placeholder.jsx +0 -2
- package/src/components/layout/print-header/print-header.jsx +0 -22
- package/src/components/layout/print-header/print-header.module.less +0 -9
- package/src/components/layout/row/row.jsx +0 -75
- package/src/components/layout/row/row.module.less +0 -7
- package/src/components/layout/spacer/spacer.jsx +0 -26
- package/src/components/layout/spacer/spacer.stories.jsx +0 -50
- package/src/components/layout-forms.stories.mdx +0 -104
- package/src/components/layout-general.stories.mdx +0 -215
- package/src/components/list/list-row/item-content.jsx +0 -15
- package/src/components/list/list-row/label.jsx +0 -11
- package/src/components/list/list-row/list-heading.jsx +0 -52
- package/src/components/list/list-row/list-row.jsx +0 -128
- package/src/components/list/list-row/list-subheading.jsx +0 -72
- package/src/components/list/list-row/meta-content.jsx +0 -24
- package/src/components/list/list-row/meta-count.jsx +0 -10
- package/src/components/list/list-row/name.jsx +0 -45
- package/src/components/list/list.jsx +0 -276
- package/src/components/list/list.module.less +0 -256
- package/src/components/list/list.stories-data.jsx +0 -287
- package/src/components/list/list.stories.jsx +0 -458
- package/src/components/list/toggle-narrow.jsx +0 -13
- package/src/components/loader/loader.jsx +0 -63
- package/src/components/loader/loader.module.less +0 -63
- package/src/components/loader/loader.stories.jsx +0 -155
- package/src/components/menu/index.js +0 -7
- package/src/components/menu/layer/divider.jsx +0 -4
- package/src/components/menu/layer/heading.jsx +0 -15
- package/src/components/menu/layer/layer.jsx +0 -82
- package/src/components/menu/layer/option.jsx +0 -77
- package/src/components/menu/layer/path.js +0 -44
- package/src/components/menu/layer/placementOptions.js +0 -6
- package/src/components/menu/layer/section.jsx +0 -66
- package/src/components/menu/menu.jsx +0 -359
- package/src/components/menu/menu.module.less +0 -241
- package/src/components/menu/menu.stories-data.jsx +0 -168
- package/src/components/menu/menu.stories.jsx +0 -126
- package/src/components/menu/menu.test.js +0 -58
- package/src/components/menu/trigger/button.jsx +0 -50
- package/src/components/menu/trigger/component.jsx +0 -14
- package/src/components/menu/trigger/text.jsx +0 -25
- package/src/components/menu/trigger/trigger.jsx +0 -86
- package/src/components/message/dismiss.jsx +0 -26
- package/src/components/message/message.jsx +0 -137
- package/src/components/message/message.module.less +0 -114
- package/src/components/message/message.stories.jsx +0 -84
- package/src/components/modal/modal.jsx +0 -50
- package/src/components/modal/modal.module.less +0 -39
- package/src/components/modal/modal.stories.jsx +0 -162
- package/src/components/option-dropdown/heading.jsx +0 -6
- package/src/components/option-dropdown/layer.jsx +0 -81
- package/src/components/option-dropdown/option-dropdown.jsx +0 -53
- package/src/components/option-dropdown/option-dropdown.module.less +0 -50
- package/src/components/option-dropdown/option-dropdown.stories.jsx +0 -35
- package/src/components/option-dropdown/option.jsx +0 -13
- package/src/components/pagination/pagination.jsx +0 -139
- package/src/components/pagination/pagination.module.less +0 -11
- package/src/components/pagination/pagination.stories.jsx +0 -78
- package/src/components/pagination/pagination.test.js +0 -92
- package/src/components/pagination/pagination.viewdata.js +0 -66
- package/src/components/pop-confirm/content.jsx +0 -25
- package/src/components/pop-confirm/pop-confirm.jsx +0 -61
- package/src/components/pop-confirm/pop-confirm.module.less +0 -18
- package/src/components/pop-confirm/pop-confirm.stories.jsx +0 -53
- package/src/components/popover/popover.jsx +0 -112
- package/src/components/popover/popover.module.less +0 -22
- package/src/components/popover/popover.stories.jsx +0 -59
- package/src/components/portal/portal.jsx +0 -16
- package/src/components/portal/portal.stories.jsx +0 -69
- package/src/components/progress-bar/progress-bar.jsx +0 -64
- package/src/components/progress-bar/progress-bar.module.less +0 -64
- package/src/components/progress-bar/progress-bar.stories.jsx +0 -23
- package/src/components/radio-button/radio-button.jsx +0 -139
- package/src/components/radio-button/radio-button.module.less +0 -135
- package/src/components/radio-button/radio-button.stories.jsx +0 -37
- package/src/components/radio-button/radio-input.jsx +0 -52
- package/src/components/select/custom-select/custom-select.jsx +0 -440
- package/src/components/select/custom-select/custom-select.module.less +0 -123
- package/src/components/select/custom-select/custom-select.reducer.js +0 -157
- package/src/components/select/custom-select/layer/heading.jsx +0 -13
- package/src/components/select/custom-select/layer/layer.jsx +0 -73
- package/src/components/select/custom-select/layer/option.jsx +0 -54
- package/src/components/select/custom-select/layer/placementOptions.js +0 -7
- package/src/components/select/custom-select/layer/section.jsx +0 -35
- package/src/components/select/custom-select/trigger/input.jsx +0 -100
- package/src/components/select/custom-select/trigger/trigger.jsx +0 -155
- package/src/components/select/custom-select/trigger/trigger.module.less +0 -289
- package/src/components/select/native-select/native-select.jsx +0 -198
- package/src/components/select/native-select/native-select.module.less +0 -107
- package/src/components/select/select.input.js +0 -146
- package/src/components/select/select.jsx +0 -207
- package/src/components/select/select.stories-data.jsx +0 -92
- package/src/components/select/select.stories.jsx +0 -135
- package/src/components/select/select.test.js +0 -519
- package/src/components/side-bar/container.module.less +0 -29
- package/src/components/side-bar/link.jsx +0 -83
- package/src/components/side-bar/sections.jsx +0 -23
- package/src/components/side-bar/side-bar.jsx +0 -102
- package/src/components/side-bar/side-bar.module.less +0 -137
- package/src/components/side-bar/side-bar.stories.jsx +0 -101
- package/src/components/slider/rc-slider.less +0 -47
- package/src/components/slider/slider-tooltip.jsx +0 -20
- package/src/components/slider/slider.jsx +0 -233
- package/src/components/slider/slider.module.less +0 -40
- package/src/components/slider/slider.stories.jsx +0 -110
- package/src/components/spinner/spinner.jsx +0 -37
- package/src/components/spinner/spinner.module.less +0 -115
- package/src/components/spinner/spinner.stories.jsx +0 -24
- package/src/components/table/cell/cell.jsx +0 -617
- package/src/components/table/cell/cell.module.less +0 -164
- package/src/components/table/footer/footer.jsx +0 -66
- package/src/components/table/footer/footer.module.less +0 -14
- package/src/components/table/helper.js +0 -64
- package/src/components/table/helper.test.js +0 -166
- package/src/components/table/icon/icon.module.less +0 -31
- package/src/components/table/row/expanded-content-row.jsx +0 -16
- package/src/components/table/row/row.jsx +0 -253
- package/src/components/table/row/row.module.less +0 -62
- package/src/components/table/table-scroll-wrapper.jsx +0 -49
- package/src/components/table/table.jsx +0 -234
- package/src/components/table/table.module.less +0 -146
- package/src/components/table/table.stories-data.jsx +0 -874
- package/src/components/table/table.stories.jsx +0 -759
- package/src/components/table/table.test.js +0 -30
- package/src/components/table/table.variables.less +0 -11
- package/src/components/table/table.viewdata.js +0 -26
- package/src/components/table/title/title.jsx +0 -30
- package/src/components/table/title/title.module.less +0 -11
- package/src/components/tabs/content.jsx +0 -14
- package/src/components/tabs/label.jsx +0 -50
- package/src/components/tabs/tabs.jsx +0 -191
- package/src/components/tabs/tabs.module.less +0 -73
- package/src/components/tabs/tabs.stories.jsx +0 -110
- package/src/components/text/text.jsx +0 -64
- package/src/components/text/text.module.less +0 -45
- package/src/components/text/text.stories.jsx +0 -31
- package/src/components/text-link/text-link.jsx +0 -23
- package/src/components/text-link/text-link.stories.jsx +0 -20
- package/src/components/textarea/textarea.jsx +0 -126
- package/src/components/textarea/textarea.module.less +0 -55
- package/src/components/textarea/textarea.stories.jsx +0 -26
- package/src/components/toaster/toaster.jsx +0 -39
- package/src/components/toaster/toaster.less +0 -17
- package/src/components/toaster/toaster.stories.jsx +0 -116
- package/src/components/toggle/toggle.jsx +0 -65
- package/src/components/toggle/toggle.module.less +0 -139
- package/src/components/toggle/toggle.stories.jsx +0 -26
- package/src/components/tooltip/tooltip-layer.jsx +0 -72
- package/src/components/tooltip/tooltip.jsx +0 -108
- package/src/components/tooltip/tooltip.module.less +0 -28
- package/src/components/tooltip/tooltip.stories.jsx +0 -71
- package/src/components/top-bar/element/element.jsx +0 -72
- package/src/components/top-bar/element/link.jsx +0 -29
- package/src/components/top-bar/title.jsx +0 -24
- package/src/components/top-bar/top-bar.jsx +0 -79
- package/src/components/top-bar/top-bar.module.less +0 -190
- package/src/components/top-bar/top-bar.stories.jsx +0 -137
- package/src/components/top-bar/warning.jsx +0 -6
- package/src/components/tree/tree-item.jsx +0 -79
- package/src/components/tree/tree-placeholder.jsx +0 -6
- package/src/components/tree/tree.jsx +0 -129
- package/src/components/tree/tree.module.less +0 -33
- package/src/components/tree/tree.stories-data.jsx +0 -89
- package/src/components/tree/tree.stories.jsx +0 -106
- package/src/docs/components/page/page.jsx +0 -16
- package/src/docs/config/config.js +0 -1
- package/src/docs/html/favicon.png +0 -0
- package/src/docs/html/index.html +0 -11
- package/src/docs/navigation/footer/footer.jsx +0 -48
- package/src/docs/navigation/header/header.jsx +0 -39
- package/src/docs/navigation/header/header.module.less +0 -32
- package/src/docs/navigation/routes/routes.jsx +0 -16
- package/src/docs/start.jsx +0 -12
- package/src/docs/views/main/main.jsx +0 -209
- package/src/docs/views/main/main.module.less +0 -14
- package/src/docs/views/not-found/not-found.jsx +0 -5
- package/src/helpers/disabled-context.js +0 -8
- package/src/helpers/styles.js +0 -68
- package/src/helpers/text.js +0 -6
- package/src/helpers/types.js +0 -5
- package/src/hooks/index.js +0 -3
- package/src/hooks/use-focus.js +0 -11
- package/src/hooks/use-keyboard-event.js +0 -16
- package/src/hooks/use-window-width.js +0 -20
- 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 +0 -4
- package/src/images/logo.png +0 -0
- package/src/images/logo.svg +0 -13
- package/src/images/oliasoft-logo.svg +0 -1
- package/src/style/colors.less +0 -26
- package/src/style/external.less +0 -10
- 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 +0 -27
- package/src/style/global.less +0 -51
- package/src/style/mixins.less +0 -68
- package/src/style/reset/reset.less +0 -34
- package/src/style/shared.less +0 -25
- package/src/style/theme.dark.less +0 -37
- package/src/style/theme.default.less +0 -74
- package/src/style/variables.less +0 -49
- package/webpack/webpack.common.js +0 -39
- package/webpack/webpack.common.rules.js +0 -102
- package/webpack/webpack.dev.js +0 -22
- package/webpack/webpack.prod.js +0 -23
- package/webpack/webpack.resolve.js +0 -22
|
@@ -1,62 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Grid, Card } from '../../../..';
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: 'Layout/Grid',
|
|
6
|
-
component: Grid,
|
|
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
|
-
columns: '1fr 1fr 1fr',
|
|
24
|
-
children: (
|
|
25
|
-
<>
|
|
26
|
-
<Card>Item 1</Card>
|
|
27
|
-
<Card>Item 2</Card>
|
|
28
|
-
<Card>Item 3</Card>
|
|
29
|
-
<Card>Item 4</Card>
|
|
30
|
-
<Card>Item 5</Card>
|
|
31
|
-
<Card>Item 6</Card>
|
|
32
|
-
</>
|
|
33
|
-
),
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const Template = (args) => (
|
|
38
|
-
<Grid
|
|
39
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
40
|
-
{...args}
|
|
41
|
-
/>
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
export const Default = Template.bind({});
|
|
45
|
-
|
|
46
|
-
export const DefaultGap = Template.bind({});
|
|
47
|
-
DefaultGap.args = { gap: true };
|
|
48
|
-
|
|
49
|
-
export const CustomGap = Template.bind({});
|
|
50
|
-
CustomGap.args = { gap: '50px' };
|
|
51
|
-
|
|
52
|
-
export const CustomColumnWidth = Template.bind({});
|
|
53
|
-
CustomColumnWidth.args = {
|
|
54
|
-
columns: '200px 50% 1fr',
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export const Height = Template.bind({});
|
|
58
|
-
Height.args = {
|
|
59
|
-
height: '200px',
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export const Responsive = Template.bind({});
|
|
63
|
-
Responsive.args = {
|
|
64
|
-
columns: '1fr 1fr 1fr',
|
|
65
|
-
columnsTablet: '1fr 1fr',
|
|
66
|
-
columnsMobile: '1fr',
|
|
67
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import cx from 'classnames';
|
|
4
|
-
|
|
5
|
-
import styles from './page.module.less';
|
|
6
|
-
|
|
7
|
-
export const Page = ({ children, left, padding: paddingProp, scroll, top }) => {
|
|
8
|
-
const padding =
|
|
9
|
-
typeof paddingProp === 'string'
|
|
10
|
-
? paddingProp
|
|
11
|
-
: paddingProp === true
|
|
12
|
-
? '20px'
|
|
13
|
-
: '0';
|
|
14
|
-
return (
|
|
15
|
-
<div
|
|
16
|
-
className={cx(styles.page, scroll ? styles.scroll : '')}
|
|
17
|
-
style={{ left, padding, top }}
|
|
18
|
-
>
|
|
19
|
-
{children}
|
|
20
|
-
</div>
|
|
21
|
-
);
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
Page.defaultProps = {
|
|
25
|
-
children: null,
|
|
26
|
-
padding: true,
|
|
27
|
-
left: '70px',
|
|
28
|
-
scroll: true,
|
|
29
|
-
top: '60px',
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
Page.propTypes = {
|
|
33
|
-
children: PropTypes.node,
|
|
34
|
-
padding: PropTypes.oneOfType([
|
|
35
|
-
PropTypes.bool,
|
|
36
|
-
PropTypes.string,
|
|
37
|
-
PropTypes.number,
|
|
38
|
-
]),
|
|
39
|
-
left: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
40
|
-
scroll: PropTypes.bool,
|
|
41
|
-
top: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
42
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
@import '../../../style/variables.less';
|
|
2
|
-
|
|
3
|
-
.page {
|
|
4
|
-
background-color: var(--color-background);
|
|
5
|
-
position: fixed;
|
|
6
|
-
right: 0;
|
|
7
|
-
bottom: 0;
|
|
8
|
-
display: flex;
|
|
9
|
-
flex-direction: column;
|
|
10
|
-
overflow: hidden;
|
|
11
|
-
|
|
12
|
-
@media print {
|
|
13
|
-
background-color: white;
|
|
14
|
-
color: black !important;
|
|
15
|
-
position: relative !important;
|
|
16
|
-
left: 0 !important;
|
|
17
|
-
top: 0 !important;
|
|
18
|
-
overflow: visible !important;
|
|
19
|
-
padding: 0 !important;
|
|
20
|
-
width: 100%;
|
|
21
|
-
height: 100%;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
&.scroll {
|
|
25
|
-
overflow: auto;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Page, TopBar, SideBar, Heading } from '../../..';
|
|
3
|
-
import { PrintHeader } from './print-header/print-header';
|
|
4
|
-
import { placeholder } from './placeholder';
|
|
5
|
-
import LogoSVG from '../../images/logo.svg';
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
title: 'Layout/Page',
|
|
9
|
-
component: Page,
|
|
10
|
-
parameters: {
|
|
11
|
-
layout: 'fullscreen',
|
|
12
|
-
docs: {
|
|
13
|
-
inlineStories: false,
|
|
14
|
-
iframeHeight: 500,
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
argTypes: {
|
|
18
|
-
top: { control: 'text' },
|
|
19
|
-
left: { control: 'text' },
|
|
20
|
-
padding: { control: { type: 'boolean' } },
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export const Default = () => (
|
|
25
|
-
<>
|
|
26
|
-
<TopBar />
|
|
27
|
-
<SideBar options={{ title: '', sections: [] }} />
|
|
28
|
-
<Page>
|
|
29
|
-
<Heading top>Heading</Heading>
|
|
30
|
-
{placeholder}
|
|
31
|
-
</Page>
|
|
32
|
-
</>
|
|
33
|
-
);
|
|
34
|
-
|
|
35
|
-
export const NoPadding = () => (
|
|
36
|
-
<>
|
|
37
|
-
<TopBar />
|
|
38
|
-
<SideBar options={{ title: '', sections: [] }} />
|
|
39
|
-
<Page padding={false}>
|
|
40
|
-
<Heading top>Heading</Heading>
|
|
41
|
-
{placeholder}
|
|
42
|
-
</Page>
|
|
43
|
-
</>
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
export const NoScroll = () => (
|
|
47
|
-
<>
|
|
48
|
-
<TopBar />
|
|
49
|
-
<SideBar options={{ title: '', sections: [] }} />
|
|
50
|
-
<Page scroll={false}>
|
|
51
|
-
<Heading top>Heading</Heading>
|
|
52
|
-
{placeholder}
|
|
53
|
-
</Page>
|
|
54
|
-
</>
|
|
55
|
-
);
|
|
56
|
-
|
|
57
|
-
export const NoTopBar = () => (
|
|
58
|
-
<>
|
|
59
|
-
<SideBar options={{ title: '', sections: [] }} />
|
|
60
|
-
<Page top={0}>
|
|
61
|
-
<Heading top>Heading</Heading>
|
|
62
|
-
{placeholder}
|
|
63
|
-
</Page>
|
|
64
|
-
</>
|
|
65
|
-
);
|
|
66
|
-
|
|
67
|
-
export const NoSideBar = () => (
|
|
68
|
-
<>
|
|
69
|
-
<TopBar />
|
|
70
|
-
<Page left={0}>
|
|
71
|
-
<Heading top>Heading</Heading>
|
|
72
|
-
{placeholder}
|
|
73
|
-
</Page>
|
|
74
|
-
</>
|
|
75
|
-
);
|
|
76
|
-
|
|
77
|
-
// TODO: Work out why this is crashing: something to do with SVGs & webpack updates?
|
|
78
|
-
|
|
79
|
-
// export const WithPrintHeader = () => (
|
|
80
|
-
// <>
|
|
81
|
-
// <PrintHeader
|
|
82
|
-
// logo={LogoSVG}
|
|
83
|
-
// logoWidth="60px"
|
|
84
|
-
// alt="company logo"
|
|
85
|
-
// />
|
|
86
|
-
// <TopBar />
|
|
87
|
-
// <SideBar options={{ title: '', sections: [] }} />
|
|
88
|
-
// <Page>
|
|
89
|
-
// <Heading top>Heading</Heading>
|
|
90
|
-
// {placeholder}
|
|
91
|
-
// </Page>
|
|
92
|
-
// </>
|
|
93
|
-
// );
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export const placeholder =
|
|
2
|
-
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum vestibulum velit vitae dolor eleifend, quis cursus tortor tempor. Etiam laoreet tempor turpis ut tristique. In hac habitasse platea dictumst. Ut viverra vestibulum facilisis. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Curabitur commodo egestas magna, at molestie quam euismod ut. Aliquam suscipit at velit vel venenatis. Morbi rhoncus odio neque, volutpat finibus risus hendrerit quis. Sed vitae justo at elit dictum semper. Suspendisse non luctus nulla. Suspendisse condimentum tellus ac elit ornare porttitor. In dignissim libero erat, eget varius nisl tincidunt sed. Duis vel viverra dolor. Mauris nisl lorem, consectetur sed ullamcorper consequat, dictum eu diam. Fusce pretium velit vitae urna tempor, id luctus velit lacinia. Suspendisse lacinia, ante eget egestas mollis, magna magna imperdiet lacus, vitae molestie purus urna et ipsum. Nulla facilisi. Nam augue sapien, dapibus id nunc a, iaculis vulputate urna. Nullam sit amet rutrum tortor. Fusce vel augue vel orci porttitor auctor. Vivamus pulvinar urna quam, non posuere lorem mollis fringilla. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Quisque porta odio quis urna pulvinar hendrerit. Nam eros sapien, cursus at maximus id, suscipit et erat. Praesent semper consectetur lacus eu suscipit. In mi ex, feugiat sagittis facilisis ut, fermentum quis mi. Nunc egestas tempor pharetra. Nulla condimentum massa non facilisis bibendum. Sed at justo eget massa lobortis ultricies sit amet eu ex. Nullam auctor ex ac elit laoreet, vitae convallis sem egestas. Maecenas gravida eros sit amet orci dapibus, rutrum gravida nisl finibus. Pellentesque vitae lorem vulputate, accumsan ligula quis, rhoncus urna. Vestibulum velit ex, venenatis ut sagittis id, malesuada vel diam. Suspendisse et turpis eu metus luctus fermentum at consectetur est. Suspendisse sit amet tincidunt dolor. Curabitur imperdiet congue urna in fringilla. Donec nec accumsan purus. Cras et blandit turpis. Curabitur sed libero nibh. Morbi scelerisque, metus vel cursus dapibus, quam lorem placerat odio, at rhoncus diam diam eget nisi. Nulla sagittis posuere ex, vel scelerisque justo egestas vel. Duis aliquam mollis est id tristique. Ut eros libero, faucibus sed ante sit amet, euismod condimentum dolor. Aenean feugiat augue tortor, id egestas tellus porta eu. Maecenas sed dui vitae erat fringilla lacinia. Etiam nisi felis, rhoncus nec vestibulum vel, mattis eget ligula. Cras sed quam sed nisi mollis eleifend. Nulla commodo, dolor nec bibendum finibus, lorem quam tincidunt lectus, sed volutpat lorem ligula vitae leo. Aliquam efficitur eu felis at dignissim. Fusce auctor eleifend justo, ut varius sapien ullamcorper mattis. Curabitur suscipit pellentesque augue sed bibendum.';
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import styles from './print-header.module.less';
|
|
4
|
-
|
|
5
|
-
export const PrintHeader = ({ logo, logoWidth, alt }) => (
|
|
6
|
-
<img
|
|
7
|
-
src={logo}
|
|
8
|
-
alt={alt}
|
|
9
|
-
className={styles.printHeader}
|
|
10
|
-
style={{ width: logoWidth }}
|
|
11
|
-
/>
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
PrintHeader.defaultProps = {
|
|
15
|
-
logoWidth: '100px',
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
PrintHeader.defaultProps = {
|
|
19
|
-
logo: PropTypes.node.isRequired,
|
|
20
|
-
logoWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
21
|
-
alt: PropTypes.string.isRequired,
|
|
22
|
-
};
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import React, { Fragment, isValidElement } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import cx from 'classnames';
|
|
4
|
-
|
|
5
|
-
import styles from './row.module.less';
|
|
6
|
-
|
|
7
|
-
export const Row = ({
|
|
8
|
-
alignItems,
|
|
9
|
-
justifyContent,
|
|
10
|
-
children,
|
|
11
|
-
flex,
|
|
12
|
-
height,
|
|
13
|
-
marginBottom,
|
|
14
|
-
marginTop,
|
|
15
|
-
spacing,
|
|
16
|
-
wrap,
|
|
17
|
-
testId,
|
|
18
|
-
}) => {
|
|
19
|
-
const childElements =
|
|
20
|
-
children === null || children === false
|
|
21
|
-
? []
|
|
22
|
-
: children instanceof Array
|
|
23
|
-
? children.filter((c) => isValidElement(c))
|
|
24
|
-
: [children];
|
|
25
|
-
const columns = childElements.map((item, index) => (
|
|
26
|
-
<Fragment key={index}>{React.cloneElement(item, { spacing })}</Fragment>
|
|
27
|
-
));
|
|
28
|
-
|
|
29
|
-
return (
|
|
30
|
-
<div
|
|
31
|
-
className={cx(styles.row)}
|
|
32
|
-
style={{
|
|
33
|
-
alignItems,
|
|
34
|
-
justifyContent,
|
|
35
|
-
flexGrow: flex ? 1 : 0,
|
|
36
|
-
flexShrink: flex ? 1 : 0,
|
|
37
|
-
flexWrap: wrap ? 'wrap' : 'nowrap',
|
|
38
|
-
height,
|
|
39
|
-
marginLeft: spacing * -0.5,
|
|
40
|
-
marginRight: spacing * -0.5,
|
|
41
|
-
marginBottom,
|
|
42
|
-
marginTop,
|
|
43
|
-
}}
|
|
44
|
-
data-testid={testId}
|
|
45
|
-
>
|
|
46
|
-
{columns}
|
|
47
|
-
</div>
|
|
48
|
-
);
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
Row.defaultProps = {
|
|
52
|
-
alignItems: 'initial',
|
|
53
|
-
justifyContent: 'initial',
|
|
54
|
-
children: null,
|
|
55
|
-
flex: false,
|
|
56
|
-
height: 'auto',
|
|
57
|
-
marginBottom: '0',
|
|
58
|
-
marginTop: '0',
|
|
59
|
-
spacing: 20,
|
|
60
|
-
wrap: false,
|
|
61
|
-
testId: '',
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
Row.propTypes = {
|
|
65
|
-
alignItems: PropTypes.string,
|
|
66
|
-
justifyContent: PropTypes.string,
|
|
67
|
-
children: PropTypes.node,
|
|
68
|
-
flex: PropTypes.bool,
|
|
69
|
-
height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
70
|
-
marginBottom: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
71
|
-
marginTop: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
72
|
-
spacing: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
73
|
-
wrap: PropTypes.bool,
|
|
74
|
-
testId: PropTypes.string,
|
|
75
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
|
|
4
|
-
export const Spacer = ({ height, width, flex }) => (
|
|
5
|
-
<div
|
|
6
|
-
style={{
|
|
7
|
-
height,
|
|
8
|
-
width: width || 'auto',
|
|
9
|
-
flexGrow: flex ? 1 : 0,
|
|
10
|
-
flexShrink: 0,
|
|
11
|
-
display: width ? 'inline-block' : 'block',
|
|
12
|
-
}}
|
|
13
|
-
/>
|
|
14
|
-
);
|
|
15
|
-
|
|
16
|
-
Spacer.defaultProps = {
|
|
17
|
-
height: '20px',
|
|
18
|
-
width: null,
|
|
19
|
-
flex: false,
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
Spacer.propTypes = {
|
|
23
|
-
height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
24
|
-
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
25
|
-
flex: PropTypes.bool,
|
|
26
|
-
};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Spacer, Flex, Button } from '../../../..';
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: 'Layout/Spacer',
|
|
6
|
-
component: Spacer,
|
|
7
|
-
argTypes: { width: { control: 'text' }, height: { control: 'text' } },
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
const Template = (args) => (
|
|
11
|
-
<Spacer
|
|
12
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
13
|
-
{...args}
|
|
14
|
-
/>
|
|
15
|
-
);
|
|
16
|
-
|
|
17
|
-
export const Default = Template.bind({});
|
|
18
|
-
Default.decorators = [
|
|
19
|
-
(story) => (
|
|
20
|
-
<>
|
|
21
|
-
<Button label="Button" />
|
|
22
|
-
{story()}
|
|
23
|
-
<Button label="Button" />
|
|
24
|
-
</>
|
|
25
|
-
),
|
|
26
|
-
];
|
|
27
|
-
|
|
28
|
-
export const Height = Template.bind({});
|
|
29
|
-
Height.args = { height: '10px' };
|
|
30
|
-
Height.decorators = [
|
|
31
|
-
(story) => (
|
|
32
|
-
<>
|
|
33
|
-
<Button label="Button" />
|
|
34
|
-
{story()}
|
|
35
|
-
<Button label="Button" />
|
|
36
|
-
</>
|
|
37
|
-
),
|
|
38
|
-
];
|
|
39
|
-
|
|
40
|
-
export const Width = Template.bind({});
|
|
41
|
-
Width.args = { width: '16px' };
|
|
42
|
-
Width.decorators = [
|
|
43
|
-
(story) => (
|
|
44
|
-
<Flex>
|
|
45
|
-
<Button label="Button" />
|
|
46
|
-
{story()}
|
|
47
|
-
<Button label="Button" />
|
|
48
|
-
</Flex>
|
|
49
|
-
),
|
|
50
|
-
];
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { Canvas, Meta, Story } from '@storybook/addon-docs';
|
|
2
|
-
import { Input, TextArea, Select, RadioButton, FormRow, Field } from '../..';
|
|
3
|
-
|
|
4
|
-
<Meta title="Layout (Forms)" />
|
|
5
|
-
|
|
6
|
-
# Layout (Forms)
|
|
7
|
-
|
|
8
|
-
## Field
|
|
9
|
-
|
|
10
|
-
This is a wrapper for any form element with default bottom margin, and props like `label` for other default styling. For inline labels, use the `labelLeft` prop (and the optional `labelWidth`).
|
|
11
|
-
|
|
12
|
-
<Canvas>
|
|
13
|
-
<>
|
|
14
|
-
<Field label="Label">
|
|
15
|
-
<Input />
|
|
16
|
-
</Field>
|
|
17
|
-
<Field label="Label" labelLeft>
|
|
18
|
-
<Input />
|
|
19
|
-
</Field>
|
|
20
|
-
</>
|
|
21
|
-
</Canvas>
|
|
22
|
-
|
|
23
|
-
## Stacked
|
|
24
|
-
|
|
25
|
-
This is the simplest form layout, and works well when horizontal space is limited, or inputs vary in height (e.g. `TextArea`).
|
|
26
|
-
|
|
27
|
-
<Canvas>
|
|
28
|
-
<>
|
|
29
|
-
<Field label="Label">
|
|
30
|
-
<Input />
|
|
31
|
-
</Field>
|
|
32
|
-
<Field label="Label">
|
|
33
|
-
<Select native options={['R', 'O', 'Y', 'G', 'B', 'I', 'V']} value="" />
|
|
34
|
-
</Field>
|
|
35
|
-
<Field label="Label">
|
|
36
|
-
<TextArea />
|
|
37
|
-
</Field>
|
|
38
|
-
<Field label="Label">
|
|
39
|
-
<RadioButton
|
|
40
|
-
options={[
|
|
41
|
-
{ label: 'Delivery', value: 'delivery' },
|
|
42
|
-
{ label: 'Collection', value: 'collection' },
|
|
43
|
-
]}
|
|
44
|
-
value={{ label: 'Collection', value: 'collection' }}
|
|
45
|
-
noMargin
|
|
46
|
-
inline
|
|
47
|
-
/>
|
|
48
|
-
</Field>
|
|
49
|
-
</>
|
|
50
|
-
</Canvas>
|
|
51
|
-
|
|
52
|
-
## Stacked with inline labels
|
|
53
|
-
|
|
54
|
-
This has the same markup, but with `labelLeft` and `labelWidth` set on each field.
|
|
55
|
-
|
|
56
|
-
<Canvas>
|
|
57
|
-
<>
|
|
58
|
-
<Field label="Label" labelLeft labelWidth="100px">
|
|
59
|
-
<Input />
|
|
60
|
-
</Field>
|
|
61
|
-
<Field label="Label" labelLeft labelWidth="100px">
|
|
62
|
-
<Select native options={['R', 'O', 'Y', 'G', 'B', 'I', 'V']} value="" />
|
|
63
|
-
</Field>
|
|
64
|
-
<Field label="Label" labelLeft labelWidth="100px">
|
|
65
|
-
<TextArea />
|
|
66
|
-
</Field>
|
|
67
|
-
<Field label="Label" labelLeft labelWidth="100px">
|
|
68
|
-
<RadioButton
|
|
69
|
-
options={[
|
|
70
|
-
{ label: 'Delivery', value: 'delivery' },
|
|
71
|
-
{ label: 'Collection', value: 'collection' },
|
|
72
|
-
]}
|
|
73
|
-
value={{ label: 'Collection', value: 'collection' }}
|
|
74
|
-
noMargin
|
|
75
|
-
inline
|
|
76
|
-
/>
|
|
77
|
-
</Field>
|
|
78
|
-
</>
|
|
79
|
-
</Canvas>
|
|
80
|
-
|
|
81
|
-
## Row
|
|
82
|
-
|
|
83
|
-
Wrapping a group of form controls in `FormRow` arranges them horizontally, and applies default spacing between each item. This works well when vertical space is limited, because inputs will only wrap onto the next line when they need to.
|
|
84
|
-
|
|
85
|
-
<Canvas>
|
|
86
|
-
<FormRow>
|
|
87
|
-
<Field label="Label">
|
|
88
|
-
<Input width="200px" />
|
|
89
|
-
</Field>
|
|
90
|
-
<Field label="Label">
|
|
91
|
-
<Select native options={['R', 'O', 'Y', 'G', 'B', 'I', 'V']} value="" />
|
|
92
|
-
</Field>
|
|
93
|
-
<Field label="Label">
|
|
94
|
-
<RadioButton
|
|
95
|
-
options={[
|
|
96
|
-
{ label: 'Delivery', value: 'delivery' },
|
|
97
|
-
{ label: 'Collection', value: 'collection' },
|
|
98
|
-
]}
|
|
99
|
-
value={{ label: 'Collection', value: 'collection' }}
|
|
100
|
-
inline
|
|
101
|
-
/>
|
|
102
|
-
</Field>
|
|
103
|
-
</FormRow>
|
|
104
|
-
</Canvas>
|