@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
|
@@ -6,7 +6,7 @@ import {extractSearchWords, matchesAllWords} from "../../Typography/Highlighter"
|
|
|
6
6
|
import {createNewItemRendererFactory} from "../autoCompleteFieldUtils";
|
|
7
7
|
|
|
8
8
|
const AutoCompleteFieldStory: ComponentMeta<typeof AutoCompleteField> = {
|
|
9
|
-
title: "
|
|
9
|
+
title: "Forms/AutoCompleteField",
|
|
10
10
|
component: AutoCompleteField,
|
|
11
11
|
argTypes: {
|
|
12
12
|
},
|
|
@@ -1,125 +1,19 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
3
|
-
|
|
4
|
-
import Button from "./Button";
|
|
5
|
-
import Icon from "../Icon/Icon";
|
|
6
|
-
import Spacing from "../Separation/Spacing";
|
|
3
|
+
import { Button, Icon, Spacing} from "../../../index";
|
|
7
4
|
|
|
8
5
|
export default {
|
|
9
6
|
title: "Components/Button",
|
|
10
7
|
component: Button,
|
|
11
8
|
argTypes: {
|
|
12
|
-
active: {
|
|
13
|
-
description: "Button will display in an active state.",
|
|
14
|
-
control: "boolean",
|
|
15
|
-
table: {
|
|
16
|
-
defaultValue: { summary: false },
|
|
17
|
-
type: { summary: "boolean" },
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
className: {
|
|
21
|
-
description: "A space-delimited list of class names.",
|
|
22
|
-
control: "text",
|
|
23
|
-
table: {
|
|
24
|
-
defaultValue: { summary: undefined },
|
|
25
|
-
type: { summary: "string" },
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
disabled: {
|
|
29
|
-
description: "Whether this action is non-interactive and the button is not usable.",
|
|
30
|
-
control: "boolean",
|
|
31
|
-
table: {
|
|
32
|
-
defaultValue: { summary: false },
|
|
33
|
-
type: { summary: "boolean" },
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
minimal: {
|
|
37
|
-
description: "Whether this button should use minimal styles.",
|
|
38
|
-
control: "boolean",
|
|
39
|
-
table: {
|
|
40
|
-
defaultValue: { summary: false },
|
|
41
|
-
type: { summary: "boolean" },
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
outlined: {
|
|
45
|
-
description: "Whether this button should use outlined styles.",
|
|
46
|
-
control: "boolean",
|
|
47
|
-
table: {
|
|
48
|
-
defaultValue: { summary: false },
|
|
49
|
-
type: { summary: "boolean" },
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
text: {
|
|
53
|
-
description: "Action text. Can be any single React renderable. Can be used as alternative to include `children` elements.",
|
|
54
|
-
control: "text",
|
|
55
|
-
table: {
|
|
56
|
-
defaultValue: { summary: undefined },
|
|
57
|
-
type: { summary: "React.ReactNode" },
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
type: {
|
|
61
|
-
description: "HTML type attribute of button. Note that this prop has no effect on buttons with `href` property set.",
|
|
62
|
-
control: "text",
|
|
63
|
-
table: {
|
|
64
|
-
defaultValue: { summary: "button" },
|
|
65
|
-
type: { summary: "button | reset | submit" },
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
loading: {
|
|
69
|
-
description: "Button is displayed disabled and contains a spinner instead of its contents.",
|
|
70
|
-
control: "boolean",
|
|
71
|
-
table: {
|
|
72
|
-
defaultValue: { summary: false },
|
|
73
|
-
type: { summary: "boolean" },
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
fill: {
|
|
77
|
-
description: "Whether this button should expand to fill its container.",
|
|
78
|
-
control: "boolean",
|
|
79
|
-
table: {
|
|
80
|
-
defaultValue: { summary: false },
|
|
81
|
-
type: { summary: "boolean" },
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
large: {
|
|
85
|
-
description: "Whether this button should use large styles.",
|
|
86
|
-
control: "boolean",
|
|
87
|
-
table: {
|
|
88
|
-
defaultValue: { summary: false },
|
|
89
|
-
type: { summary: "boolean" },
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
small: {
|
|
93
|
-
description: "Whether this button should use small styles",
|
|
94
|
-
control: "boolean",
|
|
95
|
-
table: {
|
|
96
|
-
defaultValue: { summary: false },
|
|
97
|
-
type: { summary: "boolean" },
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
9
|
icon: {
|
|
101
|
-
description: "Left aligned icon, can be a canonical icon name or an `Icon` element.",
|
|
102
10
|
control: { disable: true, },
|
|
103
|
-
table: {
|
|
104
|
-
defaultValue: { summary: undefined },
|
|
105
|
-
type: { summary: "Icon | string" },
|
|
106
|
-
}
|
|
107
11
|
},
|
|
108
12
|
rightIcon: {
|
|
109
|
-
description: "Right aligned icon, can be a canonical icon name or an `Icon` element.",
|
|
110
13
|
control: { disable: true, },
|
|
111
|
-
table: {
|
|
112
|
-
defaultValue: { summary: undefined },
|
|
113
|
-
type: { summary: "Icon | string" },
|
|
114
|
-
}
|
|
115
14
|
},
|
|
116
15
|
onClick: {
|
|
117
|
-
description: "Click event handler.",
|
|
118
16
|
action: "clicked",
|
|
119
|
-
table: {
|
|
120
|
-
defaultValue: { summary: undefined },
|
|
121
|
-
type: { summary: "(event: MouseEvent<HTMLElement>) => void" },
|
|
122
|
-
}
|
|
123
17
|
},
|
|
124
18
|
},
|
|
125
19
|
} as ComponentMeta<typeof Button>;
|
|
@@ -13,7 +13,7 @@ import {ValidIconName} from "../Icon/canonicalIconNames";
|
|
|
13
13
|
|
|
14
14
|
export type AnchorOrButtonProps = Omit<BlueprintButtonProps, "elementRef" | "icon" | "rightIcon"> | Omit<BlueprintAnchorButtonProps, "elementRef" | "icon" | "rightIcon">;
|
|
15
15
|
|
|
16
|
-
export interface ButtonProps extends React.HTMLAttributes<
|
|
16
|
+
export interface ButtonProps extends React.HTMLAttributes<HTMLButtonElement | HTMLAnchorElement> {
|
|
17
17
|
/**
|
|
18
18
|
* Always use this when the button triggers an affirmative action, e.g. confirm a process.
|
|
19
19
|
* The button is displayed with primary color scheme.
|
|
@@ -100,7 +100,7 @@ function Button({
|
|
|
100
100
|
break;
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
let ButtonType = restProps.href ? BlueprintAnchorButton : BlueprintButton;
|
|
103
|
+
let ButtonType: any = restProps.href ? BlueprintAnchorButton : BlueprintButton;
|
|
104
104
|
|
|
105
105
|
const button = (
|
|
106
106
|
<ButtonType
|
|
@@ -8,8 +8,8 @@ import {
|
|
|
8
8
|
CardTitle,
|
|
9
9
|
CardOptions,
|
|
10
10
|
CardActions,
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
Divider,
|
|
12
|
+
} from "../../../../index";
|
|
13
13
|
|
|
14
14
|
import { Default as CardHeaderExample } from "./CardHeader.stories";
|
|
15
15
|
import { Default as CardContentExample } from "./CardContent.stories";
|
|
@@ -29,28 +29,9 @@ export default {
|
|
|
29
29
|
argTypes: {
|
|
30
30
|
elevation: {
|
|
31
31
|
control: { type: "number", min: 0, max: 4 },
|
|
32
|
-
description: "Intensity of the drop shadow beneath the card. At elevation 0, no drop shadow is applied.",
|
|
33
|
-
table: {
|
|
34
|
-
type: { summary: "number: 0 to 5" },
|
|
35
|
-
defaultValue: { summary: 1 },
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
interactive: {
|
|
39
|
-
control: "boolean",
|
|
40
|
-
description: "Card responds to user interactions, hovering over the card will increase the card's elevation and change the mouse cursor to a pointer. Is set automatically to `true` if an `onClick` handler is available.",
|
|
41
|
-
table: {
|
|
42
|
-
type: { summary: "boolean" },
|
|
43
|
-
defaultValue: { summary: false },
|
|
44
|
-
}
|
|
45
32
|
},
|
|
46
33
|
onClick: {
|
|
47
34
|
...helpersArgTypes.handlerOnClick,
|
|
48
|
-
description: "Callback invoked when the card is clicked.",
|
|
49
|
-
defaultValue: null,
|
|
50
|
-
table: {
|
|
51
|
-
type: { summary: "(e: MouseEvent<HTMLDivElement>) => void" },
|
|
52
|
-
defaultValue: { summary: undefined },
|
|
53
|
-
}
|
|
54
35
|
},
|
|
55
36
|
children: {
|
|
56
37
|
control: "none",
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
Checkbox as BlueprintCheckbox,
|
|
4
|
+
CheckboxProps as BlueprintCheckboxProps
|
|
5
|
+
} from "@blueprintjs/core";
|
|
3
6
|
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
4
7
|
|
|
8
|
+
interface CheckboxProps extends BlueprintCheckboxProps {
|
|
9
|
+
// currently we do not alter it
|
|
10
|
+
};
|
|
11
|
+
|
|
5
12
|
function Checkbox({
|
|
6
13
|
children,
|
|
7
14
|
className='',
|
|
8
15
|
...restProps
|
|
9
|
-
}:
|
|
16
|
+
}: CheckboxProps) {
|
|
10
17
|
return (
|
|
11
18
|
<BlueprintCheckbox
|
|
12
19
|
{...restProps}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
3
|
+
import { Checkbox, HtmlContentBlock } from "../../../../index";
|
|
4
|
+
import { LoremIpsum } from 'react-lorem-ipsum';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: "Forms/Checkbox",
|
|
8
|
+
component: Checkbox,
|
|
9
|
+
argTypes: {
|
|
10
|
+
onChange : {action : 'clicked'}
|
|
11
|
+
},
|
|
12
|
+
} as ComponentMeta<typeof Checkbox>
|
|
13
|
+
|
|
14
|
+
const Template:ComponentStory<typeof Checkbox> = (args) => (
|
|
15
|
+
<Checkbox {...args} />
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
export const SimpleTextLabel = Template.bind({});
|
|
19
|
+
SimpleTextLabel.args = {
|
|
20
|
+
label : "Checkbox 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
|
+
};
|
|
@@ -26,8 +26,8 @@ Default.args = {
|
|
|
26
26
|
children: [
|
|
27
27
|
<MenuItem key="m0" text={"First option"} />,
|
|
28
28
|
<MenuItem key="m1" text={"Item two"}>
|
|
29
|
-
<MenuItem key="
|
|
30
|
-
<MenuItem key="
|
|
29
|
+
<MenuItem key="m2" text={"First sub option"} />
|
|
30
|
+
<MenuItem key="m3" text={"Sub item two"} />
|
|
31
31
|
</MenuItem>
|
|
32
32
|
]
|
|
33
33
|
}
|
|
@@ -1,72 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
3
|
-
|
|
4
|
-
import Modal from "./../Modal";
|
|
5
|
-
import Card from "../../Card/Card";
|
|
3
|
+
import { Modal, Card } from "./../../../../index";
|
|
6
4
|
import { SimpleCard } from "../../Card/stories/Card.stories";
|
|
7
5
|
|
|
8
6
|
export default {
|
|
9
7
|
title: "Components/Dialog/Modal",
|
|
10
8
|
component: Modal,
|
|
11
9
|
argTypes: {
|
|
12
|
-
autoFocus: {
|
|
13
|
-
description: "Modal acquires application focus when it first opens.",
|
|
14
|
-
control: "boolean",
|
|
15
|
-
table: {
|
|
16
|
-
type: { summary: "boolean" },
|
|
17
|
-
defaultValue: { summary: true },
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
canEscapeKeyClose: {
|
|
21
|
-
description: "Pressing the `esc` key triggers `onClose` handler.",
|
|
22
|
-
control: "boolean",
|
|
23
|
-
table: {
|
|
24
|
-
type: { summary: "boolean" },
|
|
25
|
-
defaultValue: { summary: false },
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
canOutsideClickClose: {
|
|
29
|
-
description: "Clicking outside the modal triggers `onClose` handler.",
|
|
30
|
-
control: "boolean",
|
|
31
|
-
table: {
|
|
32
|
-
type: { summary: "boolean" },
|
|
33
|
-
defaultValue: { summary: false },
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
enforceFocus: {
|
|
37
|
-
description: "Prevent focus from leaving modal element. If an element outside the modal is focused then the modal will immediately bring focus back to itself. If you are nesting modal components, either disable this prop on the outermost modal or mark the nested ones `usePortal={false}`.",
|
|
38
|
-
control: "boolean",
|
|
39
|
-
table: {
|
|
40
|
-
type: { summary: "boolean" },
|
|
41
|
-
defaultValue: { summary: true },
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
isOpen: {
|
|
45
|
-
description: "Toggles the visibility of the overlay and its children, this prop is required because the component is controlled",
|
|
46
|
-
},
|
|
47
|
-
onClose: {
|
|
48
|
-
description: "A callback that is invoked when user interaction causes the modal to close.",
|
|
49
|
-
table: {
|
|
50
|
-
type: { summary: "(event: SyntheticEvent<HTMLElement>) => void" },
|
|
51
|
-
defaultValue: { summary: undefined },
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
shouldReturnFocusOnClose: {
|
|
55
|
-
description: "Return focus to the last active element in the document after modal closes.",
|
|
56
|
-
control: "boolean",
|
|
57
|
-
table: {
|
|
58
|
-
type: { summary: "boolean" },
|
|
59
|
-
defaultValue: { summary: true },
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
usePortal: {
|
|
63
|
-
description: "Whether the modal should be wrapped in a Portal, which renders its contents in a new element attached to `portalContainer` prop, by default to `document.body`.",
|
|
64
|
-
control: "boolean",
|
|
65
|
-
table: {
|
|
66
|
-
type: { summary: "boolean" },
|
|
67
|
-
defaultValue: { summary: true },
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
10
|
children: {
|
|
71
11
|
control: "none",
|
|
72
12
|
description: "Elements to include into the modal container."
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
3
|
-
|
|
4
|
-
import SimpleDialog from "./../SimpleDialog";
|
|
3
|
+
import { SimpleDialog } from "./../../../../index";
|
|
5
4
|
import storyModal from "./Modal.stories";
|
|
6
5
|
import { Default as CardContentExample } from "./../../Card/stories/CardContent.stories";
|
|
7
6
|
import { Default as CardActionsExample } from "./../../Card/stories/CardActions.stories";
|
|
@@ -14,15 +14,45 @@ import {TestableComponent} from "../interfaces";
|
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
export interface FieldItemProps extends React.HTMLAttributes<HTMLDivElement>, TestableComponent {
|
|
17
|
+
/**
|
|
18
|
+
* Set primary state.
|
|
19
|
+
* This is not routed through automatically.
|
|
20
|
+
*/
|
|
17
21
|
hasStatePrimary?: boolean
|
|
22
|
+
/**
|
|
23
|
+
* Set success state.
|
|
24
|
+
* This is not routed through automatically.
|
|
25
|
+
*/
|
|
18
26
|
hasStateSuccess?: boolean
|
|
27
|
+
/**
|
|
28
|
+
* Set warning state.
|
|
29
|
+
* This is not routed through automatically.
|
|
30
|
+
*/
|
|
19
31
|
hasStateWarning?: boolean
|
|
32
|
+
/**
|
|
33
|
+
* Set danger state.
|
|
34
|
+
* This is not routed through automatically.
|
|
35
|
+
*/
|
|
20
36
|
hasStateDanger?: boolean
|
|
21
|
-
|
|
22
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Is disabled.
|
|
39
|
+
* The included inout element nedd to set disabled directly itself.
|
|
40
|
+
* This is not routed through automatically.
|
|
41
|
+
*/
|
|
23
42
|
disabled?: boolean
|
|
43
|
+
/**
|
|
44
|
+
* Used to set properties for the `Label` element that is used.
|
|
45
|
+
*/
|
|
24
46
|
labelProps?: LabelProps
|
|
47
|
+
/**
|
|
48
|
+
* Text for user help.
|
|
49
|
+
* Is displayed between label and input element.
|
|
50
|
+
*/
|
|
25
51
|
helperText?: string | JSX.Element
|
|
52
|
+
/**
|
|
53
|
+
* Feedback notification.
|
|
54
|
+
* Is displayed below the included input element.
|
|
55
|
+
*/
|
|
26
56
|
messageText?: string
|
|
27
57
|
}
|
|
28
58
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
3
|
+
import { FieldItem, TextField } from '../../../../index';
|
|
4
|
+
import { LoremIpsum } from 'react-lorem-ipsum';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: "Forms/FieldItem",
|
|
8
|
+
component: FieldItem,
|
|
9
|
+
argTypes: {
|
|
10
|
+
children: {
|
|
11
|
+
control: "none",
|
|
12
|
+
},
|
|
13
|
+
}
|
|
14
|
+
} as ComponentMeta<typeof FieldItem>;
|
|
15
|
+
|
|
16
|
+
const Template: ComponentStory<typeof FieldItem> = (args) => (
|
|
17
|
+
<FieldItem {...args} />
|
|
18
|
+
);
|
|
19
|
+
export const Default = Template.bind({});
|
|
20
|
+
Default.args = {
|
|
21
|
+
children : <TextField />,
|
|
22
|
+
messageText : <LoremIpsum p={1} avgSentencesPerParagraph={2} random={false} />,
|
|
23
|
+
helperText: <LoremIpsum p={1} avgSentencesPerParagraph={1} random={false} />,
|
|
24
|
+
labelProps: {
|
|
25
|
+
text: "Input label"
|
|
26
|
+
}
|
|
27
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
3
|
+
import FieldItem from '../FieldItem'
|
|
4
|
+
import FieldItemRow from "../FieldItemRow";
|
|
5
|
+
import { Default as FieldItemStory } from "./FieldItem.stories";
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: "Forms/FieldItemRow",
|
|
9
|
+
component: FieldItemRow,
|
|
10
|
+
argTypes: {
|
|
11
|
+
children: {
|
|
12
|
+
control: "none",
|
|
13
|
+
description: "Elements to include into the Accordion component"
|
|
14
|
+
},
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
} as ComponentMeta<typeof FieldItemRow>;
|
|
18
|
+
|
|
19
|
+
const Template: ComponentStory<typeof FieldItemRow> = (args) => (
|
|
20
|
+
<FieldItemRow {...args} />
|
|
21
|
+
);
|
|
22
|
+
export const Default = Template.bind({});
|
|
23
|
+
Default.args = {
|
|
24
|
+
children : [
|
|
25
|
+
<>
|
|
26
|
+
<FieldItem {...FieldItemStory.args}/>
|
|
27
|
+
<FieldItem {...FieldItemStory.args}/>
|
|
28
|
+
<FieldItem {...FieldItemStory.args}/>
|
|
29
|
+
</>
|
|
30
|
+
]
|
|
31
|
+
};
|