@eccenca/gui-elements 23.0.0-rc.5 → 23.0.0-rc.7
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/CHANGELOG.md +4 -1
- package/dist/cjs/cmem/markdown/Markdown.js +14 -2
- package/dist/cjs/cmem/markdown/Markdown.js.map +1 -1
- package/dist/cjs/cmem/react-flow/ReactFlow/ReactFlow.js +0 -4
- package/dist/cjs/cmem/react-flow/ReactFlow/ReactFlow.js.map +1 -1
- package/dist/cjs/components/Accordion/Accordion.js +7 -2
- package/dist/cjs/components/Accordion/Accordion.js.map +1 -1
- package/dist/cjs/components/Accordion/AccordionItem.js.map +1 -1
- package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js +59 -33
- package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
- package/dist/cjs/components/AutoSuggestion/AutoSuggestionList.js +10 -1
- package/dist/cjs/components/AutoSuggestion/AutoSuggestionList.js.map +1 -1
- package/dist/cjs/components/AutoSuggestion/SingleLineCodeEditor.js +10 -4
- package/dist/cjs/components/AutoSuggestion/SingleLineCodeEditor.js.map +1 -1
- package/dist/cjs/components/AutocompleteField/AutoCompleteField.js +13 -8
- package/dist/cjs/components/AutocompleteField/AutoCompleteField.js.map +1 -1
- package/dist/cjs/components/Button/Button.js.map +1 -1
- package/dist/cjs/components/Checkbox/Checkbox.js +1 -0
- package/dist/cjs/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/cjs/components/Form/FieldItem.js.map +1 -1
- package/dist/cjs/components/Icon/canonicalIconNames.js +12 -16
- package/dist/cjs/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/cjs/components/Menu/Menu.js +2 -2
- package/dist/cjs/components/Menu/Menu.js.map +1 -1
- package/dist/cjs/components/Menu/MenuDivider.js +2 -2
- package/dist/cjs/components/Menu/MenuDivider.js.map +1 -1
- package/dist/cjs/components/Menu/MenuItem.js +5 -3
- package/dist/cjs/components/Menu/MenuItem.js.map +1 -1
- package/dist/cjs/components/MultiSelect/MultiSelect.js +17 -4
- package/dist/cjs/components/MultiSelect/MultiSelect.js.map +1 -1
- package/dist/cjs/components/Pagination/Pagination.js.map +1 -1
- package/dist/cjs/components/RadioButton/RadioButton.js +1 -0
- package/dist/cjs/components/RadioButton/RadioButton.js.map +1 -1
- package/dist/cjs/components/Separation/Spacing.js +4 -1
- package/dist/cjs/components/Separation/Spacing.js.map +1 -1
- package/dist/cjs/components/Spinner/Spinner.js +3 -3
- package/dist/cjs/components/Spinner/Spinner.js.map +1 -1
- package/dist/cjs/components/Switch/Switch.js.map +1 -1
- package/dist/cjs/extensions/react-flow/edges/EdgeDefault.js.map +1 -1
- package/dist/esm/cmem/markdown/Markdown.js +13 -2
- package/dist/esm/cmem/markdown/Markdown.js.map +1 -1
- package/dist/esm/cmem/react-flow/ReactFlow/ReactFlow.js +0 -4
- package/dist/esm/cmem/react-flow/ReactFlow/ReactFlow.js.map +1 -1
- package/dist/esm/components/Accordion/Accordion.js +8 -3
- package/dist/esm/components/Accordion/Accordion.js.map +1 -1
- package/dist/esm/components/Accordion/AccordionItem.js +1 -1
- package/dist/esm/components/Accordion/AccordionItem.js.map +1 -1
- package/dist/esm/components/AutoSuggestion/AutoSuggestion.js +71 -45
- package/dist/esm/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
- package/dist/esm/components/AutoSuggestion/AutoSuggestionList.js +11 -2
- package/dist/esm/components/AutoSuggestion/AutoSuggestionList.js.map +1 -1
- package/dist/esm/components/AutoSuggestion/SingleLineCodeEditor.js +11 -5
- package/dist/esm/components/AutoSuggestion/SingleLineCodeEditor.js.map +1 -1
- package/dist/esm/components/AutocompleteField/AutoCompleteField.js +19 -14
- package/dist/esm/components/AutocompleteField/AutoCompleteField.js.map +1 -1
- package/dist/esm/components/Button/Button.js.map +1 -1
- package/dist/esm/components/Checkbox/Checkbox.js +1 -0
- package/dist/esm/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/esm/components/Form/FieldItem.js.map +1 -1
- package/dist/esm/components/Icon/canonicalIconNames.js +12 -16
- package/dist/esm/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/esm/components/Menu/Menu.js +3 -3
- package/dist/esm/components/Menu/Menu.js.map +1 -1
- package/dist/esm/components/Menu/MenuDivider.js +3 -3
- package/dist/esm/components/Menu/MenuDivider.js.map +1 -1
- package/dist/esm/components/Menu/MenuItem.js +5 -3
- package/dist/esm/components/Menu/MenuItem.js.map +1 -1
- package/dist/esm/components/MultiSelect/MultiSelect.js +22 -9
- package/dist/esm/components/MultiSelect/MultiSelect.js.map +1 -1
- package/dist/esm/components/Pagination/Pagination.js +1 -1
- package/dist/esm/components/Pagination/Pagination.js.map +1 -1
- package/dist/esm/components/RadioButton/RadioButton.js +2 -1
- package/dist/esm/components/RadioButton/RadioButton.js.map +1 -1
- package/dist/esm/components/Separation/Spacing.js +4 -1
- package/dist/esm/components/Separation/Spacing.js.map +1 -1
- package/dist/esm/components/Spinner/Spinner.js +3 -4
- package/dist/esm/components/Spinner/Spinner.js.map +1 -1
- package/dist/esm/components/Switch/Switch.js +1 -1
- package/dist/esm/components/Switch/Switch.js.map +1 -1
- package/dist/esm/extensions/react-flow/edges/EdgeDefault.js.map +1 -1
- package/dist/types/cmem/markdown/Markdown.d.ts +19 -3
- package/dist/types/cmem/react-flow/ReactFlow/ReactFlow.d.ts +1 -1
- package/dist/types/components/Accordion/Accordion.d.ts +12 -1
- package/dist/types/components/Accordion/AccordionItem.d.ts +21 -6
- package/dist/types/components/AutoSuggestion/AutoSuggestionList.d.ts +4 -2
- package/dist/types/components/AutocompleteField/AutoCompleteField.d.ts +7 -0
- package/dist/types/components/Button/Button.d.ts +1 -1
- package/dist/types/components/Checkbox/Checkbox.d.ts +4 -1
- package/dist/types/components/Form/FieldItem.d.ts +32 -2
- package/dist/types/components/Icon/canonicalIconNames.d.ts +1 -1
- package/dist/types/components/Menu/Menu.d.ts +4 -1
- package/dist/types/components/Menu/MenuDivider.d.ts +4 -1
- package/dist/types/components/Menu/MenuItem.d.ts +5 -2
- package/dist/types/components/Pagination/Pagination.d.ts +9 -5
- package/dist/types/components/RadioButton/RadioButton.d.ts +4 -1
- package/dist/types/components/Separation/Spacing.d.ts +17 -3
- package/dist/types/components/Spinner/Spinner.d.ts +38 -5
- package/dist/types/components/Switch/Switch.d.ts +6 -3
- package/dist/types/extensions/react-flow/edges/EdgeDefault.d.ts +15 -0
- package/package.json +4 -6
- package/src/cmem/markdown/Markdown.stories.tsx +55 -0
- package/src/cmem/markdown/Markdown.tsx +21 -9
- package/src/cmem/react-flow/ReactFlow/ReactFlow.stories.tsx +15 -86
- package/src/cmem/react-flow/ReactFlow/ReactFlow.tsx +1 -5
- package/src/cmem/react-flow/nodes/_stickynote.scss +1 -1
- package/src/components/Accordion/Accordion.tsx +33 -3
- package/src/components/Accordion/AccordionItem.tsx +23 -33
- package/src/components/Accordion/Stories/Accordion.stories.tsx +33 -0
- package/src/components/Accordion/Stories/AccordionItem.stories.tsx +27 -0
- package/src/components/Accordion/accordion.scss +20 -1
- package/src/components/AutoSuggestion/AutoSuggestion.tsx +73 -39
- package/src/components/AutoSuggestion/AutoSuggestionList.tsx +15 -2
- package/src/components/AutoSuggestion/SingleLineCodeEditor.tsx +17 -9
- package/src/components/AutoSuggestion/tests/AutoSuggestionList.test.tsx +9 -7
- package/src/components/AutocompleteField/AutoCompleteField.tsx +24 -6
- package/src/components/AutocompleteField/autoCompleteFieldUtils.tsx +1 -1
- package/src/components/AutocompleteField/autocompletefield.scss +1 -1
- package/src/components/AutocompleteField/stories/AutoCompleteField.stories.tsx +1 -1
- package/src/components/Button/Button.stories.tsx +1 -107
- package/src/components/Button/Button.tsx +2 -2
- package/src/components/Card/stories/Card.stories.tsx +2 -21
- package/src/components/Checkbox/Checkbox.tsx +9 -2
- package/src/components/Checkbox/Stories/Checkbox.stories.tsx +30 -0
- package/src/components/Checkbox/checkbox.scss +4 -0
- package/src/components/ContextOverlay/ContextMenu.stories.tsx +2 -2
- package/src/components/Dialog/stories/Modal.stories.tsx +1 -61
- package/src/components/Dialog/stories/SimpleDialog.stories.tsx +1 -2
- package/src/components/Form/FieldItem.tsx +32 -2
- package/src/components/Form/Stories/FieldItem.stories.tsx +27 -0
- package/src/components/Form/Stories/FieldItemRow.stories.tsx +31 -0
- package/src/components/Icon/canonicalIconNames.tsx +113 -119
- package/src/components/Label/Label.stories.tsx +1 -1
- package/src/components/Menu/Menu.tsx +21 -3
- package/src/components/Menu/MenuDivider.tsx +20 -3
- package/src/components/Menu/MenuItem.tsx +13 -10
- package/src/components/Menu/Stories/Menu.stories.tsx +31 -0
- package/src/components/Menu/Stories/MenuItem.stories.tsx +25 -0
- package/src/components/MultiSelect/MultiSelect.stories.tsx +2 -21
- package/src/components/MultiSelect/MultiSelect.tsx +22 -5
- package/src/components/Notification/Notification.stories.tsx +1 -29
- package/src/components/Pagination/Pagination.tsx +13 -6
- package/src/components/Pagination/Stories/Pagination.stories.tsx +32 -0
- package/src/components/Pagination/pagination.scss +2 -2
- package/src/components/ProgressBar/Stories/ProgressBar.stories.tsx +25 -0
- package/src/components/RadioButton/RadioButton.tsx +9 -2
- package/src/components/RadioButton/Stories/RadioButton.stories.tsx +30 -0
- package/src/components/Select/Select.stories.tsx +1 -1
- package/src/components/Separation/Spacing.tsx +17 -4
- package/src/components/Separation/Stories/Spacing.stories.tsx +25 -0
- package/src/components/Spinner/Spinner.tsx +39 -7
- package/src/components/Spinner/Stories/spinner.stories.tsx +26 -0
- package/src/components/Switch/Stories/Switch.stories.tsx +27 -0
- package/src/components/Switch/Switch.tsx +9 -3
- package/src/components/Tabs/stories/Tab.stories.tsx +1 -32
- package/src/components/Tabs/stories/Tabs.stories.tsx +1 -39
- package/src/components/Tag/Tag.stories.tsx +1 -9
- package/src/components/TextField/stories/TextArea.stories.tsx +10 -25
- package/src/components/TextField/stories/TextField.stories.tsx +2 -73
- package/src/components/Typography/typography.scss +3 -3
- package/src/extensions/react-flow/edges/EdgeDefault.tsx +19 -0
- package/src/extensions/react-flow/edges/stories/EdgeDefault.stories.tsx +121 -0
- package/src/extensions/react-flow/nodes/stories/NodeContent.stories.tsx +1 -1
- package/dist/cjs/cmem/react-flow/configuration/customLabel.js +0 -13
- package/dist/cjs/cmem/react-flow/configuration/customLabel.js.map +0 -1
- package/dist/cjs/cmem/react-flow/configuration/inverseEdge.js +0 -13
- package/dist/cjs/cmem/react-flow/configuration/inverseEdge.js.map +0 -1
- package/dist/esm/cmem/react-flow/configuration/customLabel.js +0 -10
- package/dist/esm/cmem/react-flow/configuration/customLabel.js.map +0 -1
- package/dist/esm/cmem/react-flow/configuration/inverseEdge.js +0 -10
- package/dist/esm/cmem/react-flow/configuration/inverseEdge.js.map +0 -1
- package/dist/types/cmem/react-flow/configuration/customLabel.d.ts +0 -8
- package/dist/types/cmem/react-flow/configuration/inverseEdge.d.ts +0 -8
- package/src/cmem/react-flow/configuration/customLabel.ts +0 -11
- package/src/cmem/react-flow/configuration/inverseEdge.ts +0 -11
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Pagination } from "../../../../index";
|
|
3
|
+
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
4
|
+
export default {
|
|
5
|
+
title: "Components/Pagination",
|
|
6
|
+
component: Pagination,
|
|
7
|
+
argTypes: {
|
|
8
|
+
}
|
|
9
|
+
} as ComponentMeta<typeof Pagination>
|
|
10
|
+
|
|
11
|
+
const PaginationExample = (args) => (
|
|
12
|
+
<Pagination {...args}/>
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
export const Default : ComponentStory<typeof Pagination> = PaginationExample.bind({});
|
|
16
|
+
Default.args = {
|
|
17
|
+
pageSizes:[10,20,50,100],
|
|
18
|
+
totalItems : 60,
|
|
19
|
+
backwardText:"Previous page",
|
|
20
|
+
forwardText : "Next page",
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const ExtendedPagesizeSelection : ComponentStory<typeof Pagination> = PaginationExample.bind({});
|
|
24
|
+
ExtendedPagesizeSelection.args = {
|
|
25
|
+
...Default.args,
|
|
26
|
+
pageSizes:[
|
|
27
|
+
{text: "10", value : "10"},
|
|
28
|
+
{text: "20", value : "25"},
|
|
29
|
+
{text: "50", value : "50"},
|
|
30
|
+
{text : 'Large page with 100 items' , value : "100"}
|
|
31
|
+
],
|
|
32
|
+
};
|
|
@@ -35,13 +35,13 @@ span.#{$prefix}--pagination__text {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
.#{$eccgui}-pagination--hidepageselect {
|
|
38
|
-
.#{$prefix}--pagination__right > *:not(
|
|
38
|
+
.#{$prefix}--pagination__right > *:not(.#{$prefix}--pagination__control-buttons) {
|
|
39
39
|
display: none;
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
.#{$eccgui}-pagination--hidenavigation {
|
|
44
|
-
.#{$prefix}--pagination__right >
|
|
44
|
+
.#{$prefix}--pagination__right > .#{$prefix}--pagination__control-buttons {
|
|
45
45
|
display: none;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ProgressBar } from "../../../../index";
|
|
3
|
+
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
4
|
+
export default {
|
|
5
|
+
title: "Components/ProgressBar",
|
|
6
|
+
component: ProgressBar,
|
|
7
|
+
argTypes: {
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
} as ComponentMeta<typeof ProgressBar>
|
|
11
|
+
|
|
12
|
+
const ProgressBarExample : ComponentStory<typeof ProgressBar> = (args) => (
|
|
13
|
+
<ProgressBar {...args}></ProgressBar>
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
export const Default = ProgressBarExample.bind({});
|
|
17
|
+
Default.args = {
|
|
18
|
+
value : 0.61,
|
|
19
|
+
stripes: false,
|
|
20
|
+
animate : false
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const IndeterminateBar = ProgressBarExample.bind({});
|
|
24
|
+
IndeterminateBar.args = {
|
|
25
|
+
};
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
Radio as BlueprintRadioButton,
|
|
4
|
+
RadioProps as BlueprintRadioProps,
|
|
5
|
+
} from "@blueprintjs/core";
|
|
3
6
|
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
4
7
|
|
|
8
|
+
interface RadioButtonProps extends BlueprintRadioProps {
|
|
9
|
+
// currently we do not alter it
|
|
10
|
+
};
|
|
11
|
+
|
|
5
12
|
function RadioButton({
|
|
6
13
|
children,
|
|
7
14
|
className='',
|
|
8
15
|
...restProps
|
|
9
|
-
}:
|
|
16
|
+
}: RadioButtonProps) {
|
|
10
17
|
return (
|
|
11
18
|
<BlueprintRadioButton
|
|
12
19
|
{...restProps}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
3
|
+
import { RadioButton, HtmlContentBlock } from "../../../../index";
|
|
4
|
+
import { LoremIpsum } from 'react-lorem-ipsum';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: "Forms/RadioButton",
|
|
8
|
+
component: RadioButton,
|
|
9
|
+
argTypes: {
|
|
10
|
+
onChange : {action : 'clicked'},
|
|
11
|
+
}
|
|
12
|
+
} as ComponentMeta<typeof RadioButton>
|
|
13
|
+
|
|
14
|
+
const Template:ComponentStory<typeof RadioButton> = (args) => (
|
|
15
|
+
<RadioButton {...args} />
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
export const SimpleTextLabel = Template.bind({});
|
|
19
|
+
SimpleTextLabel.args = {
|
|
20
|
+
label : "Radio button label",
|
|
21
|
+
inline : true,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const ElementsAsLabel = Template.bind({});
|
|
25
|
+
ElementsAsLabel.args = {
|
|
26
|
+
...SimpleTextLabel.args,
|
|
27
|
+
label : undefined,
|
|
28
|
+
inline : false,
|
|
29
|
+
children: <HtmlContentBlock><LoremIpsum p={3} avgSentencesPerParagraph={3} random={false} /></HtmlContentBlock>
|
|
30
|
+
};
|
|
@@ -1,15 +1,28 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
export interface SpacingProps {
|
|
5
|
+
/**
|
|
6
|
+
* Set the amount of white space that separates two elements.
|
|
7
|
+
*/
|
|
6
8
|
size?: "tiny" | "small" | "medium" | "large"
|
|
9
|
+
/**
|
|
10
|
+
* If set then is a ruler displayed in the middle of the spacing area.
|
|
11
|
+
* The direction of the ruler is used from the spacing.
|
|
12
|
+
*/
|
|
7
13
|
hasDivider?: boolean
|
|
14
|
+
/**
|
|
15
|
+
* If set then the spacing separates two elements on the horizontal axis.
|
|
16
|
+
* The spacing area then is created on a vertical axis.
|
|
17
|
+
*/
|
|
8
18
|
vertical?: boolean
|
|
9
19
|
}
|
|
10
20
|
|
|
11
|
-
/**
|
|
12
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Adds horizontal or vertical space between neighbouring elements.
|
|
23
|
+
* It also can add a visual ruler inside.
|
|
24
|
+
*/
|
|
25
|
+
function Spacing({ size = "medium", hasDivider = false, vertical = false }: SpacingProps) {
|
|
13
26
|
const direction = vertical ? "vertical" : "horizontal";
|
|
14
27
|
return (
|
|
15
28
|
<div
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
3
|
+
import Button from '../../Button/Button'
|
|
4
|
+
import Spacing from '../Spacing'
|
|
5
|
+
export default {
|
|
6
|
+
title: "Components/Separation/Spacing",
|
|
7
|
+
component: Spacing,
|
|
8
|
+
argTypes: {
|
|
9
|
+
size: { control: 'radio'},
|
|
10
|
+
}
|
|
11
|
+
} as ComponentMeta<typeof Spacing>
|
|
12
|
+
|
|
13
|
+
// buttons used for only showing space with elements
|
|
14
|
+
const SpacingExample: ComponentStory<typeof Spacing> = (args) => (
|
|
15
|
+
<>
|
|
16
|
+
<Button children="Example element"/>
|
|
17
|
+
<Spacing {...args}/>
|
|
18
|
+
<Button children="Another element"/>
|
|
19
|
+
</>
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
export const Default = SpacingExample.bind({});
|
|
23
|
+
Default.args = {
|
|
24
|
+
size: "medium",
|
|
25
|
+
};
|
|
@@ -13,33 +13,65 @@ export type SpinnerStroke = "thin" | "medium" | "bold"
|
|
|
13
13
|
type Intent = "inherit" | "primary" | "success" | "warning" | "danger"
|
|
14
14
|
|
|
15
15
|
/** A spinner that is either displayed globally or locally. */
|
|
16
|
-
export interface SpinnerProps extends
|
|
17
|
-
|
|
16
|
+
export interface SpinnerProps extends Omit<BlueprintSpinnerProps, "size"> {
|
|
17
|
+
/**
|
|
18
|
+
* intent value or a valid css color definition
|
|
19
|
+
*/
|
|
18
20
|
color?: Intent | string
|
|
21
|
+
/**
|
|
22
|
+
* Additional CSS class names.
|
|
23
|
+
*/
|
|
19
24
|
className?: string
|
|
20
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Position where and how the spinner is displayed:
|
|
27
|
+
* * `local`: the spinner is displayed as centered overlay to the neareast parent with relative (or equivalent) positioning
|
|
28
|
+
* * `inline`: the spinner is displayed as inline element
|
|
29
|
+
* * `global`: the spinner is displayed including backdrop centered over the full viewport
|
|
30
|
+
*/
|
|
21
31
|
position?: SpinnerPosition
|
|
32
|
+
/**
|
|
33
|
+
* The size of the spinner.
|
|
34
|
+
* The default size relates to the `position`.
|
|
35
|
+
*/
|
|
22
36
|
size?: SpinnerSize
|
|
37
|
+
/**
|
|
38
|
+
* The stroke width that is used to visualize the spinner.
|
|
39
|
+
* The default size relates to the `position`.
|
|
40
|
+
* There are only rare cases to set this property,
|
|
41
|
+
*/
|
|
23
42
|
stroke?: SpinnerStroke
|
|
24
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Delay when to show the spinner in ms.
|
|
45
|
+
*/
|
|
25
46
|
delay?: number
|
|
26
47
|
/**
|
|
27
48
|
* Includes a backdrop behind the spinner that narrows visibility of the area behind the spinner.
|
|
28
49
|
* This option only works with "local" spinners, for "inline" spinners there is no backdrop, "global" spinners always have backdrops.
|
|
29
|
-
* The backdrop and the spinner are located over the nearest parent element that is styled by `position: relative` or
|
|
50
|
+
* The backdrop and the spinner are located over the nearest parent element that is styled by `position: relative` or some other CSS rule with an equivalent outcome.
|
|
30
51
|
*/
|
|
31
52
|
showLocalBackdrop?: boolean
|
|
53
|
+
/**
|
|
54
|
+
* Use this property to alter the display of the backdrop used for the global spinner
|
|
55
|
+
*/
|
|
56
|
+
overlayProps?: BlueprintOverlayProps;
|
|
57
|
+
/**
|
|
58
|
+
* Label displayed next to the spinner (planned).
|
|
59
|
+
* You can set it to document the purpose of the spinner.
|
|
60
|
+
* It is currently not supported and not displayed.
|
|
61
|
+
*/
|
|
62
|
+
description?: string
|
|
32
63
|
}
|
|
33
64
|
|
|
34
65
|
function Spinner({
|
|
35
66
|
className = "",
|
|
36
67
|
color = "inherit",
|
|
37
|
-
description = "Loading indicator", // currently unsupported (FIXME)
|
|
38
68
|
position = "local",
|
|
39
69
|
size,
|
|
40
70
|
stroke,
|
|
41
71
|
showLocalBackdrop = false,
|
|
42
72
|
delay = 0,
|
|
73
|
+
overlayProps,
|
|
74
|
+
description = "Loading indicator", // currently unsupported (FIXME):
|
|
43
75
|
...otherProps
|
|
44
76
|
}: SpinnerProps) {
|
|
45
77
|
const [showSpinner, setShowSpinner] = useState<boolean>(!delay || delay <= 0);
|
|
@@ -104,7 +136,7 @@ function Spinner({
|
|
|
104
136
|
|
|
105
137
|
return position === "global" ? (
|
|
106
138
|
<BlueprintOverlay
|
|
107
|
-
{...
|
|
139
|
+
{...overlayProps}
|
|
108
140
|
className={`${eccgui}-spinner__overlay`}
|
|
109
141
|
backdropClassName={`${eccgui}-spinner__backdrop`}
|
|
110
142
|
canOutsideClickClose={false}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
3
|
+
import Spinner from "../Spinner";
|
|
4
|
+
export default {
|
|
5
|
+
title: "Components/Spinner",
|
|
6
|
+
component: Spinner,
|
|
7
|
+
argTypes: {
|
|
8
|
+
color: { control: 'radio', options: ["inherit", "primary", "success", "warning", "danger"]},
|
|
9
|
+
position: { control: 'radio', options: ["local", "inline", "global"]},
|
|
10
|
+
size: { control: 'radio', options: ["tiny", "small", "medium", "large", "xlarge", "inherit"]},
|
|
11
|
+
stroke: { control: 'radio', options: ["thin", "medium", "bold"]},
|
|
12
|
+
}
|
|
13
|
+
} as ComponentMeta<typeof Spinner>
|
|
14
|
+
|
|
15
|
+
const SpinnerExample: ComponentStory<typeof Spinner> = (args) => (
|
|
16
|
+
<div style={{height: "300px", minHeight: "20vw", position: "relative"}}>
|
|
17
|
+
<Spinner {...args}/>
|
|
18
|
+
</div>
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
export const Default = SpinnerExample.bind({});
|
|
22
|
+
Default.args = {
|
|
23
|
+
color: "inherit",
|
|
24
|
+
position: "local",
|
|
25
|
+
showLocalBackdrop: false,
|
|
26
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
3
|
+
import Switch from '../Switch'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: "Forms/Switch",
|
|
7
|
+
component: Switch,
|
|
8
|
+
argTypes: {
|
|
9
|
+
},
|
|
10
|
+
} as ComponentMeta<typeof Switch>
|
|
11
|
+
|
|
12
|
+
const Template: ComponentStory<typeof Switch> = (args) => (
|
|
13
|
+
<Switch {...args} />
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
export const Default = Template.bind({});
|
|
17
|
+
Default.args = {
|
|
18
|
+
label : "Switch label",
|
|
19
|
+
inline : true,
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const WithStateLabel = Template.bind({});
|
|
23
|
+
WithStateLabel.args = {
|
|
24
|
+
...Default.args,
|
|
25
|
+
innerLabel : 'Off',
|
|
26
|
+
innerLabelChecked : "On"
|
|
27
|
+
}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import React, {memo, SyntheticEvent} from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
Switch as BlueprintSwitch,
|
|
4
|
+
SwitchProps as BlueprintSwitchProps,
|
|
5
|
+
} from "@blueprintjs/core";
|
|
3
6
|
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
4
7
|
|
|
5
|
-
interface
|
|
8
|
+
export interface SwitchProps extends Omit<BlueprintSwitchProps, "onChange"> {
|
|
9
|
+
/**
|
|
10
|
+
* Event handler for changed state.
|
|
11
|
+
*/
|
|
6
12
|
onChange?: (value: boolean) => any
|
|
7
13
|
}
|
|
8
14
|
|
|
9
|
-
function Switch({onChange, ...otherProps}:
|
|
15
|
+
function Switch({onChange, ...otherProps}: SwitchProps) {
|
|
10
16
|
const handleChange = (e: SyntheticEvent<HTMLInputElement>) => {
|
|
11
17
|
const checked = !!(e as any).target?.checked
|
|
12
18
|
onChange && onChange(checked);
|
|
@@ -1,42 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
3
|
-
import { Tabs } from "./../../../../";
|
|
4
|
-
import { TabDummyForStorybook } from "./../Tab";
|
|
3
|
+
import { Tabs, Tab as TabDummyForStorybook } from "./../../../../";
|
|
5
4
|
|
|
6
5
|
export default {
|
|
7
6
|
title: "Components/Tabs",
|
|
8
7
|
component: TabDummyForStorybook,
|
|
9
8
|
argTypes: {
|
|
10
|
-
id: {
|
|
11
|
-
description: "Unique identifier used to control which tab is selected.",
|
|
12
|
-
control: "text",
|
|
13
|
-
table: {
|
|
14
|
-
type: { summary: "string" },
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
className: {
|
|
18
|
-
description: "A space-delimited list of class names.",
|
|
19
|
-
control: "boolean",
|
|
20
|
-
table: {
|
|
21
|
-
defaultValue: { summary: undefined },
|
|
22
|
-
type: { summary: "string" },
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
disabled: {
|
|
26
|
-
description: "Whether this action is non-interactive and the button is not usable. This option must be repeated currently also in the `TabTitle` element.",
|
|
27
|
-
control: "boolean",
|
|
28
|
-
table: {
|
|
29
|
-
defaultValue: { summary: false },
|
|
30
|
-
type: { summary: "boolean" },
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
panel: {
|
|
34
|
-
description: "Panel content, rendered by the parent Tabs when this tab is active.",
|
|
35
|
-
table: {
|
|
36
|
-
defaultValue: { summary: undefined },
|
|
37
|
-
type: { summary: "JSX.Element" },
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
9
|
backgroundColor: {
|
|
41
10
|
control: "color",
|
|
42
11
|
},
|
|
@@ -1,26 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
3
|
-
import { Tabs,
|
|
3
|
+
import { Tabs, TabTitle } from "./../../../";
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
6
|
title: "Components/Tabs",
|
|
7
7
|
component: Tabs,
|
|
8
8
|
argTypes: {
|
|
9
|
-
id: {
|
|
10
|
-
description: "Unique identifier used to control which tab is selected.",
|
|
11
|
-
control: "text",
|
|
12
|
-
table: {
|
|
13
|
-
type: { summary: "string" },
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
className: {
|
|
17
|
-
description: "A space-delimited list of class names.",
|
|
18
|
-
control: "text",
|
|
19
|
-
table: {
|
|
20
|
-
defaultValue: { summary: undefined },
|
|
21
|
-
type: { summary: "string" },
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
9
|
/*
|
|
25
10
|
NOTE: we currently cannot support this because Blueprint set then !important
|
|
26
11
|
styles prevent tab background colors.
|
|
@@ -34,29 +19,6 @@ export default {
|
|
|
34
19
|
}
|
|
35
20
|
},
|
|
36
21
|
*/
|
|
37
|
-
defaultSelectedTabId: {
|
|
38
|
-
description: "Initial selected tab `id`, for uncontrolled usage.",
|
|
39
|
-
control: "text",
|
|
40
|
-
table: {
|
|
41
|
-
defaultValue: { summary: undefined },
|
|
42
|
-
type: { summary: "string" },
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
selectedTabId: {
|
|
46
|
-
description: "Selected tab id, for controlled usage. Providing this prop will put the component in controlled mode and the `onChange` handler must be set.",
|
|
47
|
-
control: "text",
|
|
48
|
-
table: {
|
|
49
|
-
defaultValue: { summary: undefined },
|
|
50
|
-
type: { summary: "string" },
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
onChange: {
|
|
54
|
-
description: "A callback function that is invoked when a tab in the tab list is clicked.",
|
|
55
|
-
table: {
|
|
56
|
-
defaultValue: { summary: undefined },
|
|
57
|
-
type: { summary: "(newTabId: TabId, prevTabId: TabId | undefined, event: MouseEvent<HTMLElement>) => void" },
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
22
|
},
|
|
61
23
|
} as ComponentMeta<typeof Tabs>;
|
|
62
24
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
3
|
-
|
|
4
|
-
import Tag from "./Tag";
|
|
3
|
+
import { Tag } from "./../../../index";
|
|
5
4
|
import { helpersArgTypes } from "../../../.storybook/helpers";
|
|
6
5
|
|
|
7
6
|
export default {
|
|
@@ -9,22 +8,15 @@ export default {
|
|
|
9
8
|
component: Tag,
|
|
10
9
|
argTypes: {
|
|
11
10
|
icon: {
|
|
12
|
-
description: "Icon element to render before the children.",
|
|
13
11
|
...helpersArgTypes.exampleIcon,
|
|
14
12
|
},
|
|
15
13
|
backgroundColor: {
|
|
16
14
|
control: "color",
|
|
17
15
|
},
|
|
18
|
-
minimal: {
|
|
19
|
-
description: "Whether this tag should use minimal (lighter) styles. **Important:** We use this internally as default, so you need to set it explicitely to `false` if necessary.",
|
|
20
|
-
control: "boolean",
|
|
21
|
-
},
|
|
22
16
|
onClick: {
|
|
23
|
-
description: "Callback invoked when the tag is clicked.",
|
|
24
17
|
...helpersArgTypes.handlerOnClick,
|
|
25
18
|
},
|
|
26
19
|
onRemove: {
|
|
27
|
-
description: "Click handler for remove button. The remove button will only be rendered if this prop is defined.",
|
|
28
20
|
...helpersArgTypes.handlerOnClick,
|
|
29
21
|
},
|
|
30
22
|
emphasized: { control: "none" },
|
|
@@ -1,39 +1,24 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
3
|
-
|
|
4
|
-
import CustomTextArea from "./../TextArea";
|
|
5
|
-
|
|
3
|
+
import { TextArea as CustomTextArea} from "./../../../../index";
|
|
6
4
|
type TextAreaType = typeof CustomTextArea;
|
|
7
5
|
|
|
8
6
|
export default {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
small: {
|
|
13
|
-
description: "Whether the text area should appear with small styling.",
|
|
14
|
-
control: "boolean",
|
|
15
|
-
},
|
|
16
|
-
large: {
|
|
17
|
-
description: "Whether the text area should appear with large styling",
|
|
18
|
-
control: "boolean",
|
|
19
|
-
},
|
|
20
|
-
growVertically: {
|
|
21
|
-
description:
|
|
22
|
-
"Whether the text area should automatically grow vertically to accommodate content.",
|
|
23
|
-
control: "boolean",
|
|
7
|
+
title: "Forms/TextArea",
|
|
8
|
+
component: CustomTextArea,
|
|
9
|
+
argTypes: {
|
|
24
10
|
},
|
|
25
|
-
},
|
|
26
11
|
} as ComponentMeta<TextAreaType>;
|
|
27
12
|
|
|
28
13
|
const Template: ComponentStory<TextAreaType> = (args) => (
|
|
29
|
-
|
|
14
|
+
<CustomTextArea {...args}></CustomTextArea>
|
|
30
15
|
);
|
|
31
16
|
|
|
32
17
|
export const Default = Template.bind({});
|
|
33
18
|
Default.args = {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
19
|
+
hasStatePrimary: false,
|
|
20
|
+
hasStateSuccess: false,
|
|
21
|
+
hasStateWarning: false,
|
|
22
|
+
hasStateDanger: false,
|
|
23
|
+
rows: 5,
|
|
39
24
|
};
|
|
@@ -1,88 +1,17 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
3
|
-
|
|
4
|
-
import TextField from "./../TextField";
|
|
3
|
+
import { TextField } from "./../../../../index";
|
|
5
4
|
import { helpersArgTypes } from "../../../../.storybook/helpers";
|
|
6
5
|
|
|
7
6
|
export default {
|
|
8
|
-
title: "
|
|
7
|
+
title: "Forms/TextField",
|
|
9
8
|
component: TextField,
|
|
10
9
|
argTypes: {
|
|
11
|
-
className: {
|
|
12
|
-
description: "A space-delimited list of class names.",
|
|
13
|
-
control: "boolean",
|
|
14
|
-
table: {
|
|
15
|
-
defaultValue: { summary: undefined },
|
|
16
|
-
type: { summary: "string" },
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
value: {
|
|
20
|
-
description: "Form value of the input, for controlled usage.",
|
|
21
|
-
control: "text",
|
|
22
|
-
table: {
|
|
23
|
-
defaultValue: { summary: undefined },
|
|
24
|
-
type: { summary: "string" },
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
type: {
|
|
28
|
-
description: "HTML `input` type attribute.",
|
|
29
|
-
control: "text",
|
|
30
|
-
table: {
|
|
31
|
-
defaultValue: { summary: "text" },
|
|
32
|
-
type: { summary: "string" },
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
placeholder: {
|
|
36
|
-
description: "Placeholder text in the absence of any value.",
|
|
37
|
-
control: "text",
|
|
38
|
-
table: {
|
|
39
|
-
defaultValue: { summary: undefined },
|
|
40
|
-
type: { summary: "string" },
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
disabled: {
|
|
44
|
-
description: "Whether this action is non-interactive and the button is not usable.",
|
|
45
|
-
control: "boolean",
|
|
46
|
-
table: {
|
|
47
|
-
defaultValue: { summary: false },
|
|
48
|
-
type: { summary: "boolean" },
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
10
|
leftIcon: {
|
|
52
11
|
...helpersArgTypes.exampleIcon,
|
|
53
|
-
description: "Left aligned icon, can be a canonical icon name or an `Icon` element.",
|
|
54
12
|
},
|
|
55
13
|
rightElement: {
|
|
56
14
|
...helpersArgTypes.exampleIcon,
|
|
57
|
-
description: "Right aligned element, mainly provided for user-interaction elements, e.g. minimal buttons, spinners, or tags.",
|
|
58
|
-
//control: { disable: true, },
|
|
59
|
-
table: {
|
|
60
|
-
defaultValue: { summary: undefined },
|
|
61
|
-
type: { summary: "JSX.Element" },
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
onChange: {
|
|
65
|
-
description: "Change event handler. Use `event.target.value` for new value.",
|
|
66
|
-
table: {
|
|
67
|
-
defaultValue: { summary: undefined },
|
|
68
|
-
type: { summary: "React.FormEventHandler<HTMLElement>" },
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
large: {
|
|
72
|
-
description: "Whether this input should use large styles.",
|
|
73
|
-
control: "boolean",
|
|
74
|
-
table: {
|
|
75
|
-
defaultValue: { summary: false },
|
|
76
|
-
type: { summary: "boolean" },
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
small: {
|
|
80
|
-
description: "Whether this input should use small styles",
|
|
81
|
-
control: "boolean",
|
|
82
|
-
table: {
|
|
83
|
-
defaultValue: { summary: false },
|
|
84
|
-
type: { summary: "boolean" },
|
|
85
|
-
}
|
|
86
15
|
},
|
|
87
16
|
},
|
|
88
17
|
} as ComponentMeta<typeof TextField>;
|
|
@@ -160,9 +160,8 @@ li {
|
|
|
160
160
|
.#{$eccgui}-typography__contentblock &,
|
|
161
161
|
&.#{$eccgui}-typography__text {
|
|
162
162
|
margin-left: $eccgui-size-block-whitespace * 2;
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}
|
|
163
|
+
margin-top: $eccgui-size-block-whitespace * 0.25;
|
|
164
|
+
margin-bottom: $eccgui-size-block-whitespace * 0.25;
|
|
166
165
|
}
|
|
167
166
|
}
|
|
168
167
|
|
|
@@ -170,6 +169,7 @@ blockquote {
|
|
|
170
169
|
.#{$eccgui}-typography__contentblock &,
|
|
171
170
|
&.#{$eccgui}-typography__text {
|
|
172
171
|
margin: $eccgui-size-block-whitespace * 2;
|
|
172
|
+
font-style: italic;
|
|
173
173
|
|
|
174
174
|
&:last-child {
|
|
175
175
|
margin-bottom: 0;
|