@eccenca/gui-elements 23.0.0-rc.6 → 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 (164) hide show
  1. package/CHANGELOG.md +3 -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/Menu/Menu.js +2 -2
  22. package/dist/cjs/components/Menu/Menu.js.map +1 -1
  23. package/dist/cjs/components/Menu/MenuDivider.js +2 -2
  24. package/dist/cjs/components/Menu/MenuDivider.js.map +1 -1
  25. package/dist/cjs/components/Menu/MenuItem.js +5 -3
  26. package/dist/cjs/components/Menu/MenuItem.js.map +1 -1
  27. package/dist/cjs/components/MultiSelect/MultiSelect.js +17 -4
  28. package/dist/cjs/components/MultiSelect/MultiSelect.js.map +1 -1
  29. package/dist/cjs/components/Pagination/Pagination.js.map +1 -1
  30. package/dist/cjs/components/RadioButton/RadioButton.js +1 -0
  31. package/dist/cjs/components/RadioButton/RadioButton.js.map +1 -1
  32. package/dist/cjs/components/Separation/Spacing.js +4 -1
  33. package/dist/cjs/components/Separation/Spacing.js.map +1 -1
  34. package/dist/cjs/components/Spinner/Spinner.js +3 -3
  35. package/dist/cjs/components/Spinner/Spinner.js.map +1 -1
  36. package/dist/cjs/components/Switch/Switch.js.map +1 -1
  37. package/dist/cjs/extensions/react-flow/edges/EdgeDefault.js.map +1 -1
  38. package/dist/esm/cmem/markdown/Markdown.js +13 -2
  39. package/dist/esm/cmem/markdown/Markdown.js.map +1 -1
  40. package/dist/esm/cmem/react-flow/ReactFlow/ReactFlow.js +0 -4
  41. package/dist/esm/cmem/react-flow/ReactFlow/ReactFlow.js.map +1 -1
  42. package/dist/esm/components/Accordion/Accordion.js +8 -3
  43. package/dist/esm/components/Accordion/Accordion.js.map +1 -1
  44. package/dist/esm/components/Accordion/AccordionItem.js +1 -1
  45. package/dist/esm/components/Accordion/AccordionItem.js.map +1 -1
  46. package/dist/esm/components/AutoSuggestion/AutoSuggestion.js +71 -45
  47. package/dist/esm/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
  48. package/dist/esm/components/AutoSuggestion/AutoSuggestionList.js +11 -2
  49. package/dist/esm/components/AutoSuggestion/AutoSuggestionList.js.map +1 -1
  50. package/dist/esm/components/AutoSuggestion/SingleLineCodeEditor.js +11 -5
  51. package/dist/esm/components/AutoSuggestion/SingleLineCodeEditor.js.map +1 -1
  52. package/dist/esm/components/AutocompleteField/AutoCompleteField.js +19 -14
  53. package/dist/esm/components/AutocompleteField/AutoCompleteField.js.map +1 -1
  54. package/dist/esm/components/Button/Button.js.map +1 -1
  55. package/dist/esm/components/Checkbox/Checkbox.js +1 -0
  56. package/dist/esm/components/Checkbox/Checkbox.js.map +1 -1
  57. package/dist/esm/components/Form/FieldItem.js.map +1 -1
  58. package/dist/esm/components/Menu/Menu.js +3 -3
  59. package/dist/esm/components/Menu/Menu.js.map +1 -1
  60. package/dist/esm/components/Menu/MenuDivider.js +3 -3
  61. package/dist/esm/components/Menu/MenuDivider.js.map +1 -1
  62. package/dist/esm/components/Menu/MenuItem.js +5 -3
  63. package/dist/esm/components/Menu/MenuItem.js.map +1 -1
  64. package/dist/esm/components/MultiSelect/MultiSelect.js +22 -9
  65. package/dist/esm/components/MultiSelect/MultiSelect.js.map +1 -1
  66. package/dist/esm/components/Pagination/Pagination.js +1 -1
  67. package/dist/esm/components/Pagination/Pagination.js.map +1 -1
  68. package/dist/esm/components/RadioButton/RadioButton.js +2 -1
  69. package/dist/esm/components/RadioButton/RadioButton.js.map +1 -1
  70. package/dist/esm/components/Separation/Spacing.js +4 -1
  71. package/dist/esm/components/Separation/Spacing.js.map +1 -1
  72. package/dist/esm/components/Spinner/Spinner.js +3 -4
  73. package/dist/esm/components/Spinner/Spinner.js.map +1 -1
  74. package/dist/esm/components/Switch/Switch.js +1 -1
  75. package/dist/esm/components/Switch/Switch.js.map +1 -1
  76. package/dist/esm/extensions/react-flow/edges/EdgeDefault.js.map +1 -1
  77. package/dist/types/cmem/markdown/Markdown.d.ts +3 -2
  78. package/dist/types/cmem/react-flow/ReactFlow/ReactFlow.d.ts +1 -1
  79. package/dist/types/components/Accordion/Accordion.d.ts +12 -1
  80. package/dist/types/components/Accordion/AccordionItem.d.ts +21 -6
  81. package/dist/types/components/AutoSuggestion/AutoSuggestionList.d.ts +4 -2
  82. package/dist/types/components/AutocompleteField/AutoCompleteField.d.ts +5 -0
  83. package/dist/types/components/Button/Button.d.ts +1 -1
  84. package/dist/types/components/Checkbox/Checkbox.d.ts +4 -1
  85. package/dist/types/components/Form/FieldItem.d.ts +32 -2
  86. package/dist/types/components/Menu/Menu.d.ts +4 -1
  87. package/dist/types/components/Menu/MenuDivider.d.ts +4 -1
  88. package/dist/types/components/Menu/MenuItem.d.ts +5 -2
  89. package/dist/types/components/Pagination/Pagination.d.ts +9 -5
  90. package/dist/types/components/RadioButton/RadioButton.d.ts +4 -1
  91. package/dist/types/components/Separation/Spacing.d.ts +17 -3
  92. package/dist/types/components/Spinner/Spinner.d.ts +38 -5
  93. package/dist/types/components/Switch/Switch.d.ts +6 -3
  94. package/dist/types/extensions/react-flow/edges/EdgeDefault.d.ts +15 -0
  95. package/package.json +4 -6
  96. package/src/cmem/markdown/Markdown.tsx +5 -4
  97. package/src/cmem/react-flow/ReactFlow/ReactFlow.stories.tsx +15 -86
  98. package/src/cmem/react-flow/ReactFlow/ReactFlow.tsx +1 -5
  99. package/src/components/Accordion/Accordion.tsx +33 -3
  100. package/src/components/Accordion/AccordionItem.tsx +23 -33
  101. package/src/components/Accordion/Stories/Accordion.stories.tsx +33 -0
  102. package/src/components/Accordion/Stories/AccordionItem.stories.tsx +27 -0
  103. package/src/components/Accordion/accordion.scss +20 -1
  104. package/src/components/AutoSuggestion/AutoSuggestion.tsx +73 -39
  105. package/src/components/AutoSuggestion/AutoSuggestionList.tsx +15 -2
  106. package/src/components/AutoSuggestion/SingleLineCodeEditor.tsx +17 -9
  107. package/src/components/AutoSuggestion/tests/AutoSuggestionList.test.tsx +9 -7
  108. package/src/components/AutocompleteField/AutoCompleteField.tsx +19 -6
  109. package/src/components/AutocompleteField/autoCompleteFieldUtils.tsx +1 -1
  110. package/src/components/AutocompleteField/stories/AutoCompleteField.stories.tsx +1 -1
  111. package/src/components/Button/Button.stories.tsx +1 -107
  112. package/src/components/Button/Button.tsx +2 -2
  113. package/src/components/Card/stories/Card.stories.tsx +2 -21
  114. package/src/components/Checkbox/Checkbox.tsx +9 -2
  115. package/src/components/Checkbox/Stories/Checkbox.stories.tsx +30 -0
  116. package/src/components/Checkbox/checkbox.scss +4 -0
  117. package/src/components/ContextOverlay/ContextMenu.stories.tsx +2 -2
  118. package/src/components/Dialog/stories/Modal.stories.tsx +1 -61
  119. package/src/components/Dialog/stories/SimpleDialog.stories.tsx +1 -2
  120. package/src/components/Form/FieldItem.tsx +32 -2
  121. package/src/components/Form/Stories/FieldItem.stories.tsx +27 -0
  122. package/src/components/Form/Stories/FieldItemRow.stories.tsx +31 -0
  123. package/src/components/Label/Label.stories.tsx +1 -1
  124. package/src/components/Menu/Menu.tsx +21 -3
  125. package/src/components/Menu/MenuDivider.tsx +20 -3
  126. package/src/components/Menu/MenuItem.tsx +13 -10
  127. package/src/components/Menu/Stories/Menu.stories.tsx +31 -0
  128. package/src/components/Menu/Stories/MenuItem.stories.tsx +25 -0
  129. package/src/components/MultiSelect/MultiSelect.stories.tsx +2 -21
  130. package/src/components/MultiSelect/MultiSelect.tsx +22 -5
  131. package/src/components/Notification/Notification.stories.tsx +1 -29
  132. package/src/components/Pagination/Pagination.tsx +13 -6
  133. package/src/components/Pagination/Stories/Pagination.stories.tsx +32 -0
  134. package/src/components/Pagination/pagination.scss +2 -2
  135. package/src/components/ProgressBar/Stories/ProgressBar.stories.tsx +25 -0
  136. package/src/components/RadioButton/RadioButton.tsx +9 -2
  137. package/src/components/RadioButton/Stories/RadioButton.stories.tsx +30 -0
  138. package/src/components/Select/Select.stories.tsx +1 -1
  139. package/src/components/Separation/Spacing.tsx +17 -4
  140. package/src/components/Separation/Stories/Spacing.stories.tsx +25 -0
  141. package/src/components/Spinner/Spinner.tsx +39 -7
  142. package/src/components/Spinner/Stories/spinner.stories.tsx +26 -0
  143. package/src/components/Switch/Stories/Switch.stories.tsx +27 -0
  144. package/src/components/Switch/Switch.tsx +9 -3
  145. package/src/components/Tabs/stories/Tab.stories.tsx +1 -32
  146. package/src/components/Tabs/stories/Tabs.stories.tsx +1 -39
  147. package/src/components/Tag/Tag.stories.tsx +1 -9
  148. package/src/components/TextField/stories/TextArea.stories.tsx +10 -25
  149. package/src/components/TextField/stories/TextField.stories.tsx +2 -73
  150. package/src/extensions/react-flow/edges/EdgeDefault.tsx +19 -0
  151. package/src/extensions/react-flow/edges/stories/EdgeDefault.stories.tsx +121 -0
  152. package/src/extensions/react-flow/nodes/stories/NodeContent.stories.tsx +1 -1
  153. package/dist/cjs/cmem/react-flow/configuration/customLabel.js +0 -13
  154. package/dist/cjs/cmem/react-flow/configuration/customLabel.js.map +0 -1
  155. package/dist/cjs/cmem/react-flow/configuration/inverseEdge.js +0 -13
  156. package/dist/cjs/cmem/react-flow/configuration/inverseEdge.js.map +0 -1
  157. package/dist/esm/cmem/react-flow/configuration/customLabel.js +0 -10
  158. package/dist/esm/cmem/react-flow/configuration/customLabel.js.map +0 -1
  159. package/dist/esm/cmem/react-flow/configuration/inverseEdge.js +0 -10
  160. package/dist/esm/cmem/react-flow/configuration/inverseEdge.js.map +0 -1
  161. package/dist/types/cmem/react-flow/configuration/customLabel.d.ts +0 -8
  162. package/dist/types/cmem/react-flow/configuration/inverseEdge.d.ts +0 -8
  163. package/src/cmem/react-flow/configuration/customLabel.ts +0 -11
  164. package/src/cmem/react-flow/configuration/inverseEdge.ts +0 -11
@@ -35,13 +35,13 @@ span.#{$prefix}--pagination__text {
35
35
  }
36
36
 
37
37
  .#{$eccgui}-pagination--hidepageselect {
38
- .#{$prefix}--pagination__right > *:not(button) {
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 > button {
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 { Radio as BlueprintRadioButton } from "@blueprintjs/core";
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
- }: any) {
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
+ };
@@ -9,7 +9,7 @@ import {
9
9
  } from "../../index";
10
10
 
11
11
  export default {
12
- title: "Components/Select",
12
+ title: "Forms/Select",
13
13
  component: Select,
14
14
  argTypes: {
15
15
  },
@@ -1,15 +1,28 @@
1
1
  import React from "react";
2
2
  import { CLASSPREFIX as eccgui } from "../../configuration/constants";
3
3
 
4
-
5
- interface IProps {
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
- /** Adds horizontal or vertical space between neighbouring elements. */
12
- function Spacing({ size = "medium", hasDivider = false, vertical = false }: IProps) {
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 Partial<BlueprintOverlayProps & Omit<BlueprintSpinnerProps, "size">> {
17
- // intent value or a valid css color definition
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
- description?: string
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
- // Delay when to show the spinner in ms, default: 0
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 soe equivalent CSS rule.
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
- {...otherProps}
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 { Switch as BlueprintSwitch, SwitchProps } from "@blueprintjs/core";
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 Props extends Omit<SwitchProps, "onChange"> {
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}: Props) {
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, Tab, TabTitle } from "./../../../";
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
- title: "Components/TextArea",
10
- component: CustomTextArea,
11
- argTypes: {
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
- <CustomTextArea {...args}></CustomTextArea>
14
+ <CustomTextArea {...args}></CustomTextArea>
30
15
  );
31
16
 
32
17
  export const Default = Template.bind({});
33
18
  Default.args = {
34
- hasStatePrimary: false,
35
- hasStateSuccess: false,
36
- hasStateWarning: false,
37
- hasStateDanger: false,
38
- rows: 5,
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: "Components/TextField",
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>;
@@ -10,14 +10,33 @@ import {
10
10
  import { drawEdgeStraight} from "./utils";
11
11
 
12
12
  export interface EdgeDefaultDataProps {
13
+ /**
14
+ * Size of the "glow" effect when the edge is hovered.
15
+ */
13
16
  pathGlowWidth?: number;
17
+ /*
18
+ * Direction of the SVG path is inversed.
19
+ * This is important for the placement of the markers and the animation movement.
20
+ */
14
21
  inversePath?: boolean;
22
+ /**
23
+ * Reference linnk to the SVG marker used for the start of the edge
24
+ */
15
25
  markerStart?: string;
26
+ /**
27
+ * Callback handler that returns a React element used as edge title.
28
+ */
16
29
  renderLabel?: (edgeCenter: [number, number, number, number]) => React.ReactNode;
17
30
  }
18
31
 
19
32
  export interface EdgeDefaultProps extends ReactFlowEdgeProps {
33
+ /**
34
+ * Defining content and markers for the edge.
35
+ */
20
36
  data?: EdgeDefaultDataProps,
37
+ /**
38
+ * Callback handler that returns a SVG path as string to define how the edge is rendered.
39
+ */
21
40
  drawSvgPath?: (edge: ReactFlowEdgeProps) => string;
22
41
  }
23
42