@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.
Files changed (174) hide show
  1. package/CHANGELOG.md +4 -1
  2. package/dist/cjs/cmem/markdown/Markdown.js +14 -2
  3. package/dist/cjs/cmem/markdown/Markdown.js.map +1 -1
  4. package/dist/cjs/cmem/react-flow/ReactFlow/ReactFlow.js +0 -4
  5. package/dist/cjs/cmem/react-flow/ReactFlow/ReactFlow.js.map +1 -1
  6. package/dist/cjs/components/Accordion/Accordion.js +7 -2
  7. package/dist/cjs/components/Accordion/Accordion.js.map +1 -1
  8. package/dist/cjs/components/Accordion/AccordionItem.js.map +1 -1
  9. package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js +59 -33
  10. package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
  11. package/dist/cjs/components/AutoSuggestion/AutoSuggestionList.js +10 -1
  12. package/dist/cjs/components/AutoSuggestion/AutoSuggestionList.js.map +1 -1
  13. package/dist/cjs/components/AutoSuggestion/SingleLineCodeEditor.js +10 -4
  14. package/dist/cjs/components/AutoSuggestion/SingleLineCodeEditor.js.map +1 -1
  15. package/dist/cjs/components/AutocompleteField/AutoCompleteField.js +13 -8
  16. package/dist/cjs/components/AutocompleteField/AutoCompleteField.js.map +1 -1
  17. package/dist/cjs/components/Button/Button.js.map +1 -1
  18. package/dist/cjs/components/Checkbox/Checkbox.js +1 -0
  19. package/dist/cjs/components/Checkbox/Checkbox.js.map +1 -1
  20. package/dist/cjs/components/Form/FieldItem.js.map +1 -1
  21. package/dist/cjs/components/Icon/canonicalIconNames.js +12 -16
  22. package/dist/cjs/components/Icon/canonicalIconNames.js.map +1 -1
  23. package/dist/cjs/components/Menu/Menu.js +2 -2
  24. package/dist/cjs/components/Menu/Menu.js.map +1 -1
  25. package/dist/cjs/components/Menu/MenuDivider.js +2 -2
  26. package/dist/cjs/components/Menu/MenuDivider.js.map +1 -1
  27. package/dist/cjs/components/Menu/MenuItem.js +5 -3
  28. package/dist/cjs/components/Menu/MenuItem.js.map +1 -1
  29. package/dist/cjs/components/MultiSelect/MultiSelect.js +17 -4
  30. package/dist/cjs/components/MultiSelect/MultiSelect.js.map +1 -1
  31. package/dist/cjs/components/Pagination/Pagination.js.map +1 -1
  32. package/dist/cjs/components/RadioButton/RadioButton.js +1 -0
  33. package/dist/cjs/components/RadioButton/RadioButton.js.map +1 -1
  34. package/dist/cjs/components/Separation/Spacing.js +4 -1
  35. package/dist/cjs/components/Separation/Spacing.js.map +1 -1
  36. package/dist/cjs/components/Spinner/Spinner.js +3 -3
  37. package/dist/cjs/components/Spinner/Spinner.js.map +1 -1
  38. package/dist/cjs/components/Switch/Switch.js.map +1 -1
  39. package/dist/cjs/extensions/react-flow/edges/EdgeDefault.js.map +1 -1
  40. package/dist/esm/cmem/markdown/Markdown.js +13 -2
  41. package/dist/esm/cmem/markdown/Markdown.js.map +1 -1
  42. package/dist/esm/cmem/react-flow/ReactFlow/ReactFlow.js +0 -4
  43. package/dist/esm/cmem/react-flow/ReactFlow/ReactFlow.js.map +1 -1
  44. package/dist/esm/components/Accordion/Accordion.js +8 -3
  45. package/dist/esm/components/Accordion/Accordion.js.map +1 -1
  46. package/dist/esm/components/Accordion/AccordionItem.js +1 -1
  47. package/dist/esm/components/Accordion/AccordionItem.js.map +1 -1
  48. package/dist/esm/components/AutoSuggestion/AutoSuggestion.js +71 -45
  49. package/dist/esm/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
  50. package/dist/esm/components/AutoSuggestion/AutoSuggestionList.js +11 -2
  51. package/dist/esm/components/AutoSuggestion/AutoSuggestionList.js.map +1 -1
  52. package/dist/esm/components/AutoSuggestion/SingleLineCodeEditor.js +11 -5
  53. package/dist/esm/components/AutoSuggestion/SingleLineCodeEditor.js.map +1 -1
  54. package/dist/esm/components/AutocompleteField/AutoCompleteField.js +19 -14
  55. package/dist/esm/components/AutocompleteField/AutoCompleteField.js.map +1 -1
  56. package/dist/esm/components/Button/Button.js.map +1 -1
  57. package/dist/esm/components/Checkbox/Checkbox.js +1 -0
  58. package/dist/esm/components/Checkbox/Checkbox.js.map +1 -1
  59. package/dist/esm/components/Form/FieldItem.js.map +1 -1
  60. package/dist/esm/components/Icon/canonicalIconNames.js +12 -16
  61. package/dist/esm/components/Icon/canonicalIconNames.js.map +1 -1
  62. package/dist/esm/components/Menu/Menu.js +3 -3
  63. package/dist/esm/components/Menu/Menu.js.map +1 -1
  64. package/dist/esm/components/Menu/MenuDivider.js +3 -3
  65. package/dist/esm/components/Menu/MenuDivider.js.map +1 -1
  66. package/dist/esm/components/Menu/MenuItem.js +5 -3
  67. package/dist/esm/components/Menu/MenuItem.js.map +1 -1
  68. package/dist/esm/components/MultiSelect/MultiSelect.js +22 -9
  69. package/dist/esm/components/MultiSelect/MultiSelect.js.map +1 -1
  70. package/dist/esm/components/Pagination/Pagination.js +1 -1
  71. package/dist/esm/components/Pagination/Pagination.js.map +1 -1
  72. package/dist/esm/components/RadioButton/RadioButton.js +2 -1
  73. package/dist/esm/components/RadioButton/RadioButton.js.map +1 -1
  74. package/dist/esm/components/Separation/Spacing.js +4 -1
  75. package/dist/esm/components/Separation/Spacing.js.map +1 -1
  76. package/dist/esm/components/Spinner/Spinner.js +3 -4
  77. package/dist/esm/components/Spinner/Spinner.js.map +1 -1
  78. package/dist/esm/components/Switch/Switch.js +1 -1
  79. package/dist/esm/components/Switch/Switch.js.map +1 -1
  80. package/dist/esm/extensions/react-flow/edges/EdgeDefault.js.map +1 -1
  81. package/dist/types/cmem/markdown/Markdown.d.ts +19 -3
  82. package/dist/types/cmem/react-flow/ReactFlow/ReactFlow.d.ts +1 -1
  83. package/dist/types/components/Accordion/Accordion.d.ts +12 -1
  84. package/dist/types/components/Accordion/AccordionItem.d.ts +21 -6
  85. package/dist/types/components/AutoSuggestion/AutoSuggestionList.d.ts +4 -2
  86. package/dist/types/components/AutocompleteField/AutoCompleteField.d.ts +7 -0
  87. package/dist/types/components/Button/Button.d.ts +1 -1
  88. package/dist/types/components/Checkbox/Checkbox.d.ts +4 -1
  89. package/dist/types/components/Form/FieldItem.d.ts +32 -2
  90. package/dist/types/components/Icon/canonicalIconNames.d.ts +1 -1
  91. package/dist/types/components/Menu/Menu.d.ts +4 -1
  92. package/dist/types/components/Menu/MenuDivider.d.ts +4 -1
  93. package/dist/types/components/Menu/MenuItem.d.ts +5 -2
  94. package/dist/types/components/Pagination/Pagination.d.ts +9 -5
  95. package/dist/types/components/RadioButton/RadioButton.d.ts +4 -1
  96. package/dist/types/components/Separation/Spacing.d.ts +17 -3
  97. package/dist/types/components/Spinner/Spinner.d.ts +38 -5
  98. package/dist/types/components/Switch/Switch.d.ts +6 -3
  99. package/dist/types/extensions/react-flow/edges/EdgeDefault.d.ts +15 -0
  100. package/package.json +4 -6
  101. package/src/cmem/markdown/Markdown.stories.tsx +55 -0
  102. package/src/cmem/markdown/Markdown.tsx +21 -9
  103. package/src/cmem/react-flow/ReactFlow/ReactFlow.stories.tsx +15 -86
  104. package/src/cmem/react-flow/ReactFlow/ReactFlow.tsx +1 -5
  105. package/src/cmem/react-flow/nodes/_stickynote.scss +1 -1
  106. package/src/components/Accordion/Accordion.tsx +33 -3
  107. package/src/components/Accordion/AccordionItem.tsx +23 -33
  108. package/src/components/Accordion/Stories/Accordion.stories.tsx +33 -0
  109. package/src/components/Accordion/Stories/AccordionItem.stories.tsx +27 -0
  110. package/src/components/Accordion/accordion.scss +20 -1
  111. package/src/components/AutoSuggestion/AutoSuggestion.tsx +73 -39
  112. package/src/components/AutoSuggestion/AutoSuggestionList.tsx +15 -2
  113. package/src/components/AutoSuggestion/SingleLineCodeEditor.tsx +17 -9
  114. package/src/components/AutoSuggestion/tests/AutoSuggestionList.test.tsx +9 -7
  115. package/src/components/AutocompleteField/AutoCompleteField.tsx +24 -6
  116. package/src/components/AutocompleteField/autoCompleteFieldUtils.tsx +1 -1
  117. package/src/components/AutocompleteField/autocompletefield.scss +1 -1
  118. package/src/components/AutocompleteField/stories/AutoCompleteField.stories.tsx +1 -1
  119. package/src/components/Button/Button.stories.tsx +1 -107
  120. package/src/components/Button/Button.tsx +2 -2
  121. package/src/components/Card/stories/Card.stories.tsx +2 -21
  122. package/src/components/Checkbox/Checkbox.tsx +9 -2
  123. package/src/components/Checkbox/Stories/Checkbox.stories.tsx +30 -0
  124. package/src/components/Checkbox/checkbox.scss +4 -0
  125. package/src/components/ContextOverlay/ContextMenu.stories.tsx +2 -2
  126. package/src/components/Dialog/stories/Modal.stories.tsx +1 -61
  127. package/src/components/Dialog/stories/SimpleDialog.stories.tsx +1 -2
  128. package/src/components/Form/FieldItem.tsx +32 -2
  129. package/src/components/Form/Stories/FieldItem.stories.tsx +27 -0
  130. package/src/components/Form/Stories/FieldItemRow.stories.tsx +31 -0
  131. package/src/components/Icon/canonicalIconNames.tsx +113 -119
  132. package/src/components/Label/Label.stories.tsx +1 -1
  133. package/src/components/Menu/Menu.tsx +21 -3
  134. package/src/components/Menu/MenuDivider.tsx +20 -3
  135. package/src/components/Menu/MenuItem.tsx +13 -10
  136. package/src/components/Menu/Stories/Menu.stories.tsx +31 -0
  137. package/src/components/Menu/Stories/MenuItem.stories.tsx +25 -0
  138. package/src/components/MultiSelect/MultiSelect.stories.tsx +2 -21
  139. package/src/components/MultiSelect/MultiSelect.tsx +22 -5
  140. package/src/components/Notification/Notification.stories.tsx +1 -29
  141. package/src/components/Pagination/Pagination.tsx +13 -6
  142. package/src/components/Pagination/Stories/Pagination.stories.tsx +32 -0
  143. package/src/components/Pagination/pagination.scss +2 -2
  144. package/src/components/ProgressBar/Stories/ProgressBar.stories.tsx +25 -0
  145. package/src/components/RadioButton/RadioButton.tsx +9 -2
  146. package/src/components/RadioButton/Stories/RadioButton.stories.tsx +30 -0
  147. package/src/components/Select/Select.stories.tsx +1 -1
  148. package/src/components/Separation/Spacing.tsx +17 -4
  149. package/src/components/Separation/Stories/Spacing.stories.tsx +25 -0
  150. package/src/components/Spinner/Spinner.tsx +39 -7
  151. package/src/components/Spinner/Stories/spinner.stories.tsx +26 -0
  152. package/src/components/Switch/Stories/Switch.stories.tsx +27 -0
  153. package/src/components/Switch/Switch.tsx +9 -3
  154. package/src/components/Tabs/stories/Tab.stories.tsx +1 -32
  155. package/src/components/Tabs/stories/Tabs.stories.tsx +1 -39
  156. package/src/components/Tag/Tag.stories.tsx +1 -9
  157. package/src/components/TextField/stories/TextArea.stories.tsx +10 -25
  158. package/src/components/TextField/stories/TextField.stories.tsx +2 -73
  159. package/src/components/Typography/typography.scss +3 -3
  160. package/src/extensions/react-flow/edges/EdgeDefault.tsx +19 -0
  161. package/src/extensions/react-flow/edges/stories/EdgeDefault.stories.tsx +121 -0
  162. package/src/extensions/react-flow/nodes/stories/NodeContent.stories.tsx +1 -1
  163. package/dist/cjs/cmem/react-flow/configuration/customLabel.js +0 -13
  164. package/dist/cjs/cmem/react-flow/configuration/customLabel.js.map +0 -1
  165. package/dist/cjs/cmem/react-flow/configuration/inverseEdge.js +0 -13
  166. package/dist/cjs/cmem/react-flow/configuration/inverseEdge.js.map +0 -1
  167. package/dist/esm/cmem/react-flow/configuration/customLabel.js +0 -10
  168. package/dist/esm/cmem/react-flow/configuration/customLabel.js.map +0 -1
  169. package/dist/esm/cmem/react-flow/configuration/inverseEdge.js +0 -10
  170. package/dist/esm/cmem/react-flow/configuration/inverseEdge.js.map +0 -1
  171. package/dist/types/cmem/react-flow/configuration/customLabel.d.ts +0 -8
  172. package/dist/types/cmem/react-flow/configuration/inverseEdge.d.ts +0 -8
  173. package/src/cmem/react-flow/configuration/customLabel.ts +0 -11
  174. 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: "Components/AutoCompleteField",
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<HTMLElement> {
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
- } from "../";
12
- import Divider from "../../Separation/Divider";
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 { Checkbox as BlueprintCheckbox } from "@blueprintjs/core";
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
- }: any) {
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
+ };
@@ -63,3 +63,7 @@ $switch-checked-background-color-disabled: rgba($switch-checked-background-color
63
63
  }
64
64
  }
65
65
  }
66
+
67
+ .#{$ns}-control-indicator + * {
68
+ margin-top: -1 * $eccgui-size-typo-text * $eccgui-size-typo-text-lineheight;
69
+ }
@@ -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="m0" text={"First sub option"} />
30
- <MenuItem key="m1" text={"Sub item two"} />
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
- children: JSX.Element | JSX.Element[] | null
22
- className?: string
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
+ };