@oliasoft-open-source/react-ui-library 2.4.8 → 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 -621
- 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 -875
- 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,55 +0,0 @@
|
|
|
1
|
-
import { Canvas, Meta, Story } from '@storybook/addon-docs';
|
|
2
|
-
import { FormRow, Button, TextLink } from '../..';
|
|
3
|
-
|
|
4
|
-
<Meta title="Buttons & Links" />
|
|
5
|
-
|
|
6
|
-
# Buttons & Links
|
|
7
|
-
|
|
8
|
-
## A single primary button
|
|
9
|
-
|
|
10
|
-
Primary (`colored`) buttons help highlight the most important action, but not if there are too many of them. Try not to use more than one per view or section.
|
|
11
|
-
|
|
12
|
-
<Canvas>
|
|
13
|
-
<FormRow>
|
|
14
|
-
<Button colored label="Save" />
|
|
15
|
-
<Button label="Cancel" />
|
|
16
|
-
</FormRow>
|
|
17
|
-
</Canvas>
|
|
18
|
-
|
|
19
|
-
## Error & success buttons
|
|
20
|
-
|
|
21
|
-
Like primary buttons, these should be used sparingly for particularly risky actions (`colored="red"`) or particularly rewarding ones (`colored="green"`).
|
|
22
|
-
|
|
23
|
-
<Canvas>
|
|
24
|
-
<FormRow>
|
|
25
|
-
<Button colored="red" label="Delete everything" />
|
|
26
|
-
<Button colored="green" label="Prevent disaster" />
|
|
27
|
-
</FormRow>
|
|
28
|
-
</Canvas>
|
|
29
|
-
|
|
30
|
-
## Basic buttons
|
|
31
|
-
|
|
32
|
-
Same height as other buttons, but without a background. Use when a default button is too heavy, but you want to line up with other buttons or form elements.
|
|
33
|
-
|
|
34
|
-
If you need a very unobtrusive button, combine `basic` with `colored="muted"`.
|
|
35
|
-
|
|
36
|
-
<Canvas>
|
|
37
|
-
<FormRow>
|
|
38
|
-
<Button colored label="Login" />
|
|
39
|
-
<Button label="Register" />
|
|
40
|
-
<Button basic label="Forgot password" />
|
|
41
|
-
<Button basic colored="muted" label="Help" />
|
|
42
|
-
</FormRow>
|
|
43
|
-
</Canvas>
|
|
44
|
-
|
|
45
|
-
## Links (`TextLink`)
|
|
46
|
-
|
|
47
|
-
Inline links without extra padding. Use when space is limited and/or extra padding would cause problems (e.g. for a link in a `Table` or an inline link).
|
|
48
|
-
|
|
49
|
-
<Canvas>
|
|
50
|
-
<>
|
|
51
|
-
Want to know more before trying Oliasoft WellDesign? – our{' '}
|
|
52
|
-
<TextLink onClick={() => {}}>Customer Success team</TextLink> is here to
|
|
53
|
-
answer your questions
|
|
54
|
-
</>
|
|
55
|
-
</Canvas>
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import cx from 'classnames';
|
|
4
|
-
import styles from './card.module.less';
|
|
5
|
-
|
|
6
|
-
export const Card = ({
|
|
7
|
-
bordered,
|
|
8
|
-
heading,
|
|
9
|
-
children,
|
|
10
|
-
margin,
|
|
11
|
-
padding,
|
|
12
|
-
raised,
|
|
13
|
-
}) => {
|
|
14
|
-
return (
|
|
15
|
-
<div
|
|
16
|
-
className={cx(
|
|
17
|
-
styles.card,
|
|
18
|
-
bordered ? styles.bordered : '',
|
|
19
|
-
raised ? styles.raised : '',
|
|
20
|
-
)}
|
|
21
|
-
style={{ margin }}
|
|
22
|
-
>
|
|
23
|
-
{heading ? <div className={cx(styles.cardHeader)}>{heading}</div> : null}
|
|
24
|
-
<div
|
|
25
|
-
className={cx(
|
|
26
|
-
styles.cardContent,
|
|
27
|
-
heading ? styles.cardContentBorderTop : '',
|
|
28
|
-
padding ? styles.padding : '',
|
|
29
|
-
)}
|
|
30
|
-
>
|
|
31
|
-
{children}
|
|
32
|
-
</div>
|
|
33
|
-
</div>
|
|
34
|
-
);
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
Card.defaultProps = {
|
|
38
|
-
bordered: true,
|
|
39
|
-
heading: null,
|
|
40
|
-
margin: '0',
|
|
41
|
-
padding: true,
|
|
42
|
-
raised: false,
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
Card.propTypes = {
|
|
46
|
-
bordered: PropTypes.bool,
|
|
47
|
-
heading: PropTypes.node,
|
|
48
|
-
margin: PropTypes.string,
|
|
49
|
-
padding: PropTypes.bool,
|
|
50
|
-
raised: PropTypes.bool,
|
|
51
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
@import '../../style/variables.less';
|
|
2
|
-
|
|
3
|
-
.card {
|
|
4
|
-
color: var(--color-text);
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.card.bordered {
|
|
8
|
-
background: var(--color-background-raised);
|
|
9
|
-
border: 1px solid var(--color-border);
|
|
10
|
-
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
|
11
|
-
border-radius: @card_border_radius;
|
|
12
|
-
|
|
13
|
-
&.raised {
|
|
14
|
-
box-shadow: 0 0px 4px rgba(0, 0, 0, 0.1), 0 3px 4px rgba(0, 0, 0, 0.1);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.cardHeader {
|
|
18
|
-
background-color: var(--color-background);
|
|
19
|
-
padding: @card_padding_y @card_padding_x;
|
|
20
|
-
border-top-left-radius: inherit;
|
|
21
|
-
border-top-right-radius: inherit;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.cardContentBorderTop {
|
|
25
|
-
border-top: 1px solid var(--color-border);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.padding {
|
|
29
|
-
padding: @card_padding_y @card_padding_x;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.cardContent {
|
|
34
|
-
&:first-child {
|
|
35
|
-
border-top-left-radius: inherit;
|
|
36
|
-
border-top-right-radius: inherit;
|
|
37
|
-
}
|
|
38
|
-
&:last-child {
|
|
39
|
-
border-bottom-left-radius: inherit;
|
|
40
|
-
border-bottom-right-radius: inherit;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.cardHeader {
|
|
45
|
-
display: flex;
|
|
46
|
-
align-items: center;
|
|
47
|
-
padding: @card_padding_y 0;
|
|
48
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Card, Heading } from '../../..';
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: 'Layout/Card',
|
|
6
|
-
component: Card,
|
|
7
|
-
|
|
8
|
-
args: {
|
|
9
|
-
raised: false,
|
|
10
|
-
children: 'Content goes here',
|
|
11
|
-
padding: true,
|
|
12
|
-
bordered: true,
|
|
13
|
-
},
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
const Template = (args) => (
|
|
17
|
-
<Card
|
|
18
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
19
|
-
{...args}
|
|
20
|
-
/>
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
export const Default = Template.bind({});
|
|
24
|
-
|
|
25
|
-
export const WithHeading = Template.bind({});
|
|
26
|
-
WithHeading.args = {
|
|
27
|
-
heading: <Heading>Heading</Heading>,
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export const WithHelpHeading = Template.bind({});
|
|
31
|
-
WithHelpHeading.args = {
|
|
32
|
-
heading: <Heading onClickHelp={() => console.log('help!')}>Heading</Heading>,
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export const NoPadding = Template.bind({});
|
|
36
|
-
NoPadding.args = { padding: false };
|
|
37
|
-
|
|
38
|
-
export const NoBorder = Template.bind({});
|
|
39
|
-
NoBorder.args = { bordered: false };
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import React, { useContext } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import cx from 'classnames';
|
|
4
|
-
import { FaCheck } from 'react-icons/fa';
|
|
5
|
-
import styles from './check-box.module.less';
|
|
6
|
-
import { DisabledContext } from '../../helpers/disabled-context';
|
|
7
|
-
|
|
8
|
-
export const CheckBox = ({
|
|
9
|
-
noMargin,
|
|
10
|
-
dataix,
|
|
11
|
-
isInTable,
|
|
12
|
-
tabIndex,
|
|
13
|
-
checked,
|
|
14
|
-
name,
|
|
15
|
-
key,
|
|
16
|
-
label,
|
|
17
|
-
disabled,
|
|
18
|
-
small,
|
|
19
|
-
onChange,
|
|
20
|
-
testId,
|
|
21
|
-
value,
|
|
22
|
-
}) => {
|
|
23
|
-
const disabledContext = useContext(DisabledContext);
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<div
|
|
27
|
-
className={cx(
|
|
28
|
-
styles.checkbox,
|
|
29
|
-
noMargin ? styles.noMargin : null,
|
|
30
|
-
isInTable ? styles.isInTable : null,
|
|
31
|
-
disabled || disabledContext ? styles.disabled : null,
|
|
32
|
-
small ? styles.small : null,
|
|
33
|
-
!label ? styles.noLabel : null,
|
|
34
|
-
)}
|
|
35
|
-
data-ix={dataix}
|
|
36
|
-
onClick={(evt) => {
|
|
37
|
-
evt.target.name = name;
|
|
38
|
-
evt.target.value = !checked;
|
|
39
|
-
evt.target.customValue = value;
|
|
40
|
-
evt.target.checked = !checked;
|
|
41
|
-
onChange(evt);
|
|
42
|
-
}}
|
|
43
|
-
data-testid={testId}
|
|
44
|
-
>
|
|
45
|
-
<input
|
|
46
|
-
type="checkbox"
|
|
47
|
-
tabIndex={tabIndex}
|
|
48
|
-
checked={checked}
|
|
49
|
-
name={name}
|
|
50
|
-
key={key}
|
|
51
|
-
onChange={() => {}}
|
|
52
|
-
disabled={disabled || disabledContext}
|
|
53
|
-
/>
|
|
54
|
-
<label htmlFor={name}>
|
|
55
|
-
<FaCheck className={styles.checkmark} />
|
|
56
|
-
{label}
|
|
57
|
-
</label>
|
|
58
|
-
</div>
|
|
59
|
-
);
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
CheckBox.defaultProps = {
|
|
63
|
-
checked: false,
|
|
64
|
-
isInTable: false,
|
|
65
|
-
label: '',
|
|
66
|
-
name: undefined,
|
|
67
|
-
noMargin: false,
|
|
68
|
-
onChange: () => {},
|
|
69
|
-
tabIndex: 0,
|
|
70
|
-
disabled: false,
|
|
71
|
-
small: false,
|
|
72
|
-
testId: undefined,
|
|
73
|
-
key: '',
|
|
74
|
-
dataix: 0,
|
|
75
|
-
value: undefined,
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
CheckBox.propTypes = {
|
|
79
|
-
checked: PropTypes.bool,
|
|
80
|
-
isInTable: PropTypes.bool,
|
|
81
|
-
label: PropTypes.string,
|
|
82
|
-
name: PropTypes.string,
|
|
83
|
-
noMargin: PropTypes.bool,
|
|
84
|
-
onChange: PropTypes.func,
|
|
85
|
-
tabIndex: PropTypes.number,
|
|
86
|
-
disabled: PropTypes.bool,
|
|
87
|
-
small: PropTypes.bool,
|
|
88
|
-
testId: PropTypes.string,
|
|
89
|
-
key: PropTypes.string, //deprecated
|
|
90
|
-
dataix: PropTypes.number, //deprecated (used in GenericTable)
|
|
91
|
-
value: PropTypes.string,
|
|
92
|
-
};
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
@import '../../style/variables.less';
|
|
2
|
-
|
|
3
|
-
.checkbox {
|
|
4
|
-
margin: 10px 0 11px 0;
|
|
5
|
-
position: relative;
|
|
6
|
-
display: inline-block;
|
|
7
|
-
backface-visibility: hidden;
|
|
8
|
-
vertical-align: baseline;
|
|
9
|
-
font-style: normal;
|
|
10
|
-
min-height: 17px;
|
|
11
|
-
font-size: inherit;
|
|
12
|
-
line-height: 17px;
|
|
13
|
-
min-width: 17px;
|
|
14
|
-
outline: 0px;
|
|
15
|
-
|
|
16
|
-
&.noLabel {
|
|
17
|
-
width: 17px;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
&.small {
|
|
21
|
-
margin: 3px 0;
|
|
22
|
-
font-size: @input_font_size_small;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
input {
|
|
26
|
-
cursor: pointer;
|
|
27
|
-
position: absolute;
|
|
28
|
-
top: 0px;
|
|
29
|
-
left: 0px;
|
|
30
|
-
width: 17px;
|
|
31
|
-
height: 17px;
|
|
32
|
-
opacity: 0 !important;
|
|
33
|
-
outline: 0px;
|
|
34
|
-
z-index: -1;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
label {
|
|
38
|
-
cursor: pointer;
|
|
39
|
-
user-select: none;
|
|
40
|
-
color: var(--color-text);
|
|
41
|
-
transition: color 0.1s ease 0s;
|
|
42
|
-
position: relative;
|
|
43
|
-
display: block;
|
|
44
|
-
padding-left: 1.85714em;
|
|
45
|
-
font-size: 1em;
|
|
46
|
-
outline: 0px;
|
|
47
|
-
|
|
48
|
-
.checkmark {
|
|
49
|
-
position: absolute;
|
|
50
|
-
top: 0px;
|
|
51
|
-
left: 0px;
|
|
52
|
-
width: 17px;
|
|
53
|
-
height: 17px;
|
|
54
|
-
padding: 2px;
|
|
55
|
-
background: var(--color-background-input);
|
|
56
|
-
border-radius: 0.214286rem;
|
|
57
|
-
transition: border 0.1s ease 0s, opacity 0.1s ease 0s,
|
|
58
|
-
transform 0.1s ease 0s, box-shadow 0.1s ease 0s;
|
|
59
|
-
border: 1px solid var(--color-border);
|
|
60
|
-
color: transparent;
|
|
61
|
-
|
|
62
|
-
&:hover {
|
|
63
|
-
border-color: var(--color-border-hover);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
input:checked ~ label .checkmark {
|
|
69
|
-
background: var(--color-background-primary);
|
|
70
|
-
border-color: transparent;
|
|
71
|
-
color: white;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
&.disabled {
|
|
75
|
-
cursor: default;
|
|
76
|
-
pointer-events: none;
|
|
77
|
-
|
|
78
|
-
label {
|
|
79
|
-
color: var(--color-text-muted);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.checkmark {
|
|
83
|
-
background: var(--color-background-disabled) !important;
|
|
84
|
-
border-color: var(--color-border) !important;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
input:checked ~ label .checkmark {
|
|
88
|
-
color: var(--color-text-faint);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.noMargin {
|
|
94
|
-
margin: 0;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.isInTable {
|
|
98
|
-
margin: 0;
|
|
99
|
-
position: relative;
|
|
100
|
-
top: 1px;
|
|
101
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { useArgs } from '@storybook/addons';
|
|
3
|
-
import { CheckBox } from './check-box';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: 'Forms/CheckBox',
|
|
7
|
-
component: CheckBox,
|
|
8
|
-
args: {
|
|
9
|
-
disabled: false,
|
|
10
|
-
label: 'Label',
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const Template = (args) => {
|
|
15
|
-
const [{ checked }, updateArgs] = useArgs();
|
|
16
|
-
const handleChange = () => {
|
|
17
|
-
updateArgs({ checked: !checked });
|
|
18
|
-
};
|
|
19
|
-
return (
|
|
20
|
-
<CheckBox
|
|
21
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
22
|
-
{...args}
|
|
23
|
-
onChange={handleChange}
|
|
24
|
-
/>
|
|
25
|
-
);
|
|
26
|
-
};
|
|
27
|
-
export const Default = Template.bind({});
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import React, { Fragment } from 'react';
|
|
2
|
-
import { toast } from '../../..';
|
|
3
|
-
|
|
4
|
-
export const colorsText = [
|
|
5
|
-
'--color-text',
|
|
6
|
-
'--color-text-muted',
|
|
7
|
-
'--color-text-faint',
|
|
8
|
-
'--color-text-error',
|
|
9
|
-
'--color-text-warning',
|
|
10
|
-
'--color-text-success',
|
|
11
|
-
'--color-text-info',
|
|
12
|
-
'--color-text-primary',
|
|
13
|
-
'--color-text-primary-hover',
|
|
14
|
-
'--color-text-primary-active',
|
|
15
|
-
];
|
|
16
|
-
|
|
17
|
-
export const colorsBackground = [
|
|
18
|
-
'--color-background',
|
|
19
|
-
'--color-background-raised',
|
|
20
|
-
'--color-background-primary',
|
|
21
|
-
'--color-background-info',
|
|
22
|
-
'--color-background-warning',
|
|
23
|
-
'--color-background-success',
|
|
24
|
-
'--color-background-error',
|
|
25
|
-
];
|
|
26
|
-
|
|
27
|
-
export const colorsBorder = [
|
|
28
|
-
'--color-border',
|
|
29
|
-
'--color-border-error',
|
|
30
|
-
'--color-border-warning',
|
|
31
|
-
'--color-border-focus',
|
|
32
|
-
];
|
|
33
|
-
|
|
34
|
-
export const ColorPalette = ({ colors }) => {
|
|
35
|
-
return (
|
|
36
|
-
<div
|
|
37
|
-
style={{
|
|
38
|
-
display: 'grid',
|
|
39
|
-
gridTemplateColumns: 'auto 1fr auto 1fr',
|
|
40
|
-
gap: 20,
|
|
41
|
-
alignItems: 'center',
|
|
42
|
-
}}
|
|
43
|
-
>
|
|
44
|
-
{colors.map((color, index) => {
|
|
45
|
-
const variable = `var(${color})`;
|
|
46
|
-
const handleClick = () => {
|
|
47
|
-
navigator.clipboard.writeText(variable);
|
|
48
|
-
toast({
|
|
49
|
-
message: {
|
|
50
|
-
type: 'Success',
|
|
51
|
-
content: 'Copied to clipboard',
|
|
52
|
-
},
|
|
53
|
-
});
|
|
54
|
-
};
|
|
55
|
-
return (
|
|
56
|
-
<Fragment key={index}>
|
|
57
|
-
<div
|
|
58
|
-
style={{
|
|
59
|
-
padding: '16px 20px',
|
|
60
|
-
backgroundColor: variable,
|
|
61
|
-
border: '1px solid rgba(0,0,0,0.1)',
|
|
62
|
-
}}
|
|
63
|
-
onClick={handleClick}
|
|
64
|
-
></div>
|
|
65
|
-
<code onClick={handleClick}>{variable}</code>
|
|
66
|
-
</Fragment>
|
|
67
|
-
);
|
|
68
|
-
})}
|
|
69
|
-
</div>
|
|
70
|
-
);
|
|
71
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { Canvas, Meta, Story } from '@storybook/addon-docs';
|
|
2
|
-
import { Fragment } from 'react';
|
|
3
|
-
import { toast, Toaster } from '../../..';
|
|
4
|
-
import {
|
|
5
|
-
ColorPalette,
|
|
6
|
-
colorsText,
|
|
7
|
-
colorsBackground,
|
|
8
|
-
colorsBorder,
|
|
9
|
-
} from './color.stories-data';
|
|
10
|
-
|
|
11
|
-
<Meta title="Colors" />
|
|
12
|
-
|
|
13
|
-
# Colors
|
|
14
|
-
|
|
15
|
-
When setting colors (either by component props or in custom styling), prefer CSS variables to literal color values.
|
|
16
|
-
|
|
17
|
-
**Click on a color below to copy the variable name to the clipboard.**
|
|
18
|
-
|
|
19
|
-
## Text
|
|
20
|
-
|
|
21
|
-
<Canvas>
|
|
22
|
-
<ColorPalette colors={colorsText} />
|
|
23
|
-
</Canvas>
|
|
24
|
-
|
|
25
|
-
## Backgrounds
|
|
26
|
-
|
|
27
|
-
<Canvas>
|
|
28
|
-
<ColorPalette colors={colorsBackground} />
|
|
29
|
-
</Canvas>
|
|
30
|
-
|
|
31
|
-
## Borders
|
|
32
|
-
|
|
33
|
-
<Canvas>
|
|
34
|
-
<ColorPalette colors={colorsBorder} />
|
|
35
|
-
</Canvas>
|
|
36
|
-
|
|
37
|
-
<Toaster />
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { FaTimes } from 'react-icons/fa';
|
|
4
|
-
import cx from 'classnames';
|
|
5
|
-
import { isArray } from 'lodash';
|
|
6
|
-
import { Heading } from '../heading/heading';
|
|
7
|
-
import styles from './dialog.module.less';
|
|
8
|
-
|
|
9
|
-
const convertStringToJsx = (children) => {
|
|
10
|
-
if (isArray(children)) {
|
|
11
|
-
return children.map((text) => (
|
|
12
|
-
<>
|
|
13
|
-
{text} <br />
|
|
14
|
-
</>
|
|
15
|
-
));
|
|
16
|
-
}
|
|
17
|
-
return children;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export const Dialog = ({ dialog }) => {
|
|
21
|
-
const {
|
|
22
|
-
heading,
|
|
23
|
-
content,
|
|
24
|
-
contentPadding = 20,
|
|
25
|
-
footer,
|
|
26
|
-
scroll,
|
|
27
|
-
width,
|
|
28
|
-
height,
|
|
29
|
-
onClose,
|
|
30
|
-
} = dialog;
|
|
31
|
-
return (
|
|
32
|
-
<div
|
|
33
|
-
className={cx(
|
|
34
|
-
styles.dialog,
|
|
35
|
-
width ? styles.inline : null,
|
|
36
|
-
scroll ? styles.scroll : null,
|
|
37
|
-
)}
|
|
38
|
-
style={{ width, height }}
|
|
39
|
-
>
|
|
40
|
-
<div className={styles.header}>
|
|
41
|
-
<Heading top marginBottom={0}>
|
|
42
|
-
{heading}
|
|
43
|
-
</Heading>
|
|
44
|
-
{onClose ? (
|
|
45
|
-
<div className={styles.dismiss}>
|
|
46
|
-
<FaTimes onClick={onClose} />
|
|
47
|
-
</div>
|
|
48
|
-
) : null}
|
|
49
|
-
</div>
|
|
50
|
-
<div className={styles.content} style={{ padding: contentPadding }}>
|
|
51
|
-
{convertStringToJsx(content)}
|
|
52
|
-
</div>
|
|
53
|
-
{footer && <div className={styles.footer}>{footer}</div>}
|
|
54
|
-
</div>
|
|
55
|
-
);
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
const dialogShape = PropTypes.shape({
|
|
59
|
-
heading: PropTypes.string,
|
|
60
|
-
content: PropTypes.oneOfType([
|
|
61
|
-
PropTypes.string,
|
|
62
|
-
PropTypes.number,
|
|
63
|
-
PropTypes.node,
|
|
64
|
-
PropTypes.arrayOf(PropTypes.string),
|
|
65
|
-
]).isRequired,
|
|
66
|
-
contentPadding: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
67
|
-
footer: PropTypes.node,
|
|
68
|
-
width: PropTypes.string,
|
|
69
|
-
height: PropTypes.string,
|
|
70
|
-
bordered: PropTypes.bool,
|
|
71
|
-
onClose: PropTypes.func,
|
|
72
|
-
scroll: PropTypes.bool,
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
Dialog.propTypes = {
|
|
76
|
-
dialog: dialogShape.isRequired,
|
|
77
|
-
};
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
@line_height: 20px;
|
|
2
|
-
@line_spacing: 3px;
|
|
3
|
-
|
|
4
|
-
.dialog {
|
|
5
|
-
border-radius: 4px;
|
|
6
|
-
background: var(--color-background-raised);
|
|
7
|
-
line-height: @line_height;
|
|
8
|
-
color: var(--color-text);
|
|
9
|
-
border: 1px solid var(--color-border);
|
|
10
|
-
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
|
11
|
-
display: flex;
|
|
12
|
-
flex-direction: column;
|
|
13
|
-
|
|
14
|
-
> :first-child {
|
|
15
|
-
border-top-left-radius: inherit;
|
|
16
|
-
border-top-right-radius: inherit;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
> :last-child {
|
|
20
|
-
border-bottom-left-radius: inherit;
|
|
21
|
-
border-bottom-right-radius: inherit;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
&.inline {
|
|
25
|
-
display: inline-flex;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
&.scroll {
|
|
29
|
-
max-height: 100%;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.header {
|
|
34
|
-
display: flex;
|
|
35
|
-
justify-content: space-between;
|
|
36
|
-
padding: 16px 20px;
|
|
37
|
-
background-color: var(--color-background);
|
|
38
|
-
border-bottom: 1px solid var(--color-border);
|
|
39
|
-
flex-shrink: 0;
|
|
40
|
-
|
|
41
|
-
.dismiss {
|
|
42
|
-
display: flex;
|
|
43
|
-
justify-content: center;
|
|
44
|
-
align-items: center;
|
|
45
|
-
margin-left: 20px;
|
|
46
|
-
opacity: 0.4;
|
|
47
|
-
|
|
48
|
-
&:hover {
|
|
49
|
-
opacity: 0.8;
|
|
50
|
-
cursor: pointer;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.content {
|
|
56
|
-
flex-grow: 1;
|
|
57
|
-
|
|
58
|
-
.scroll & {
|
|
59
|
-
overflow: auto;
|
|
60
|
-
min-height: 0;
|
|
61
|
-
height: 100%;
|
|
62
|
-
flex: 1 1 auto;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.footer {
|
|
67
|
-
display: flex;
|
|
68
|
-
padding: 16px 20px;
|
|
69
|
-
background-color: var(--color-background);
|
|
70
|
-
border-top: 1px solid var(--color-border);
|
|
71
|
-
flex-shrink: 0;
|
|
72
|
-
|
|
73
|
-
button:not(:last-child) {
|
|
74
|
-
margin-right: 12px;
|
|
75
|
-
}
|
|
76
|
-
}
|