@scm-manager/ui-components 2.25.1-20211003-143409 → 2.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/package.json +10 -8
  2. package/src/Autocomplete.tsx +6 -6
  3. package/src/BranchSelector.stories.tsx +1 -1
  4. package/src/Breadcrumb.tsx +4 -1
  5. package/src/CardColumn.stories.tsx +2 -2
  6. package/src/CardColumn.tsx +1 -2
  7. package/src/HelpIcon.tsx +3 -1
  8. package/src/Icon.stories.tsx +3 -3
  9. package/src/Notification.stories.tsx +1 -1
  10. package/src/Paginator.test.tsx +16 -16
  11. package/src/ProtectedRoute.tsx +3 -3
  12. package/src/Tag.tsx +1 -1
  13. package/src/__resources__/Diff.markdown.ts +19 -21
  14. package/src/__resources__/changesets.tsx +73 -109
  15. package/src/__resources__/repository.ts +8 -8
  16. package/src/__snapshots__/storyshots.test.ts.snap +71237 -71286
  17. package/src/buttons/Button.tsx +63 -74
  18. package/src/buttons/ButtonAddons.tsx +1 -1
  19. package/src/buttons/ButtonGroup.tsx +1 -1
  20. package/src/buttons/SubmitButton.tsx +1 -1
  21. package/src/buttons/index.stories.tsx +5 -6
  22. package/src/comparators.test.ts +6 -6
  23. package/src/comparators.ts +1 -1
  24. package/src/devBuild.ts +1 -1
  25. package/src/forms/AddKeyValueEntryToTableField.stories.tsx +1 -1
  26. package/src/forms/AutocompleteAddEntryToTableField.tsx +1 -1
  27. package/src/forms/Checkbox.stories.tsx +4 -4
  28. package/src/forms/DropDown.stories.tsx +4 -4
  29. package/src/forms/DropDown.tsx +1 -1
  30. package/src/forms/FileInput.stories.tsx +1 -1
  31. package/src/forms/FilterInput.tsx +1 -1
  32. package/src/forms/InputField.stories.tsx +1 -1
  33. package/src/forms/MemberNameTagGroup.tsx +3 -3
  34. package/src/forms/PasswordConfirmation.tsx +4 -4
  35. package/src/forms/Radio.stories.tsx +2 -2
  36. package/src/forms/Select.stories.tsx +4 -5
  37. package/src/forms/Textarea.stories.tsx +1 -1
  38. package/src/languages.ts +1 -1
  39. package/src/layout/Footer.stories.tsx +3 -3
  40. package/src/layout/SecondaryNavigationColumn.tsx +1 -1
  41. package/src/layout/Title.tsx +2 -2
  42. package/src/markdown/MarkdownCodeRenderer.tsx +1 -1
  43. package/src/markdown/MarkdownHeadingRenderer.tsx +2 -2
  44. package/src/markdown/MarkdownLinkRenderer.test.tsx +1 -1
  45. package/src/markdown/MarkdownLinkRenderer.tsx +1 -1
  46. package/src/markdown/MarkdownView.stories.tsx +4 -4
  47. package/src/markdown/MarkdownView.tsx +9 -9
  48. package/src/markdown/createComponentList.ts +1 -1
  49. package/src/markdown/createMdastPlugin.ts +1 -1
  50. package/src/markdown/markdownExtensions.ts +1 -1
  51. package/src/markdown/remarkChangesetShortLinkParser.ts +7 -7
  52. package/src/markdown/remarkToRehypeRendererAdapters.ts +10 -9
  53. package/src/modals/ConfirmAlert.stories.tsx +5 -5
  54. package/src/modals/ConfirmAlert.tsx +2 -2
  55. package/src/modals/CreateTagModal.tsx +4 -4
  56. package/src/modals/Modal.stories.tsx +1 -1
  57. package/src/navigation/MenuContext.tsx +2 -2
  58. package/src/navigation/NavAction.tsx +3 -3
  59. package/src/navigation/SecondaryNavigation.stories.tsx +4 -4
  60. package/src/navigation/SubNavigation.tsx +2 -2
  61. package/src/popover/Popover.stories.tsx +37 -35
  62. package/src/popover/usePopover.ts +10 -10
  63. package/src/repos/Diff.stories.tsx +1 -1
  64. package/src/repos/DiffExpander.test.ts +39 -41
  65. package/src/repos/DiffExpander.ts +10 -10
  66. package/src/repos/RepositoryEntry.stories.tsx +1 -1
  67. package/src/repos/RepositoryFlag.tsx +1 -1
  68. package/src/repos/Tokenize.worker.ts +3 -3
  69. package/src/repos/TokenizedDiffView.tsx +1 -1
  70. package/src/repos/annotate/Annotate.stories.tsx +29 -29
  71. package/src/repos/changesets/ChangesetAuthor.tsx +4 -4
  72. package/src/repos/changesets/ChangesetDescription.tsx +2 -2
  73. package/src/repos/changesets/ChangesetDiff.test.ts +18 -18
  74. package/src/repos/changesets/ChangesetId.tsx +1 -1
  75. package/src/repos/changesets/ChangesetList.tsx +1 -1
  76. package/src/repos/changesets/ChangesetTagsCollapsed.tsx +1 -1
  77. package/src/repos/changesets/Changesets.stories.tsx +185 -142
  78. package/src/repos/changesets/SignatureIcon.tsx +4 -4
  79. package/src/repos/changesets/changesets.ts +1 -1
  80. package/src/repos/diffs.test.ts +3 -3
  81. package/src/repos/refractorAdapter.ts +3 -3
  82. package/src/repositories.test.ts +18 -18
  83. package/src/storyshots.test.ts +3 -3
  84. package/src/syntax-highlighting.module.css +17 -16
  85. package/src/syntax-highlighting.ts +59 -54
  86. package/src/table/Table.stories.tsx +7 -7
  87. package/src/table/Table.tsx +1 -1
  88. package/src/table/TextColumn.tsx +1 -1
  89. package/src/textSplitAndReplace.test.ts +3 -3
  90. package/src/textSplitAndReplace.ts +2 -2
  91. package/src/toast/Toast.tsx +2 -2
  92. package/src/toast/index.stories.tsx +2 -2
  93. package/src/toast/themes.ts +6 -6
  94. package/src/useDateFormatter.ts +3 -3
  95. package/src/validation.test.ts +6 -6
  96. package/src/validation.ts +1 -4
@@ -21,9 +21,9 @@
21
21
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
22
  * SOFTWARE.
23
23
  */
24
- import React, { MouseEvent, ReactNode } from "react";
24
+ import React, { FC, MouseEvent, ReactNode } from "react";
25
25
  import classNames from "classnames";
26
- import { RouteComponentProps, withRouter } from "react-router-dom";
26
+ import { Link } from "react-router-dom";
27
27
  import Icon from "../Icon";
28
28
  import { createAttributesForTesting } from "../devBuild";
29
29
 
@@ -42,90 +42,79 @@ export type ButtonProps = {
42
42
  testId?: string;
43
43
  };
44
44
 
45
- type Props = ButtonProps &
46
- RouteComponentProps & {
47
- type?: "button" | "submit" | "reset";
48
- color?: string;
49
- };
50
-
51
- class Button extends React.Component<Props> {
52
- static defaultProps: Partial<Props> = {
53
- type: "button",
54
- color: "default",
55
- };
45
+ type Props = ButtonProps & {
46
+ type?: "button" | "submit" | "reset";
47
+ color?: string;
48
+ };
56
49
 
57
- onClick = (event: React.MouseEvent) => {
58
- const { action, link, history } = this.props;
59
- if (action) {
60
- action(event);
61
- } else if (link) {
62
- history.push(link);
63
- }
50
+ const Button: FC<Props> = ({
51
+ link,
52
+ className,
53
+ icon,
54
+ fullWidth,
55
+ reducedMobile,
56
+ testId,
57
+ children,
58
+ label,
59
+ type = "button",
60
+ title,
61
+ loading,
62
+ disabled,
63
+ action,
64
+ color = "default",
65
+ }) => {
66
+ const renderIcon = () => {
67
+ return <>{icon ? <Icon name={icon} color="inherit" className="is-medium pr-1" /> : null}</>;
64
68
  };
65
69
 
66
- render() {
67
- const {
68
- label,
69
- title,
70
- loading,
71
- disabled,
72
- type,
73
- color,
74
- className,
75
- icon,
76
- fullWidth,
77
- reducedMobile,
78
- children,
79
- testId,
80
- } = this.props;
81
- if (icon) {
82
- return (
83
- <button
84
- type={type}
85
- title={title}
86
- disabled={disabled}
87
- onClick={this.onClick}
88
- className={classNames(
89
- "button",
90
- "is-" + color,
91
- { "is-loading": loading },
92
- { "is-fullwidth": fullWidth },
93
- { "is-reduced-mobile": reducedMobile },
94
- className
95
- )}
96
- {...createAttributesForTesting(testId)}
97
- >
98
- <span className="icon is-medium">
99
- <Icon name={icon} color="inherit" />
100
- </span>
101
- {(label || children) && (
102
- <span>
103
- {label} {children}
104
- </span>
105
- )}
106
- </button>
107
- );
108
- }
109
-
70
+ if (link) {
110
71
  return (
111
- <button
112
- type={type}
113
- title={title}
114
- disabled={disabled}
115
- onClick={this.onClick}
72
+ <Link
116
73
  className={classNames(
117
74
  "button",
118
75
  "is-" + color,
119
76
  { "is-loading": loading },
120
77
  { "is-fullwidth": fullWidth },
78
+ { "is-reduced-mobile": reducedMobile },
121
79
  className
122
80
  )}
123
- {...createAttributesForTesting(testId)}
81
+ to={link}
82
+ aria-label={label}
124
83
  >
125
- {label} {children}
126
- </button>
84
+ {renderIcon()}{" "}
85
+ {(label || children) && (
86
+ <>
87
+ {label} {children}
88
+ </>
89
+ )}
90
+ </Link>
127
91
  );
128
92
  }
129
- }
130
93
 
131
- export default withRouter(Button);
94
+ return (
95
+ <button
96
+ type={type}
97
+ title={title}
98
+ disabled={disabled}
99
+ onClick={(event) => action && action(event)}
100
+ className={classNames(
101
+ "button",
102
+ "is-" + color,
103
+ { "is-loading": loading },
104
+ { "is-fullwidth": fullWidth },
105
+ { "is-reduced-mobile": reducedMobile },
106
+ className
107
+ )}
108
+ {...createAttributesForTesting(testId)}
109
+ >
110
+ {renderIcon()}{" "}
111
+ {(label || children) && (
112
+ <>
113
+ {label} {children}
114
+ </>
115
+ )}
116
+ </button>
117
+ );
118
+ };
119
+
120
+ export default Button;
@@ -41,7 +41,7 @@ class ButtonAddons extends React.Component<Props> {
41
41
  const { className, children } = this.props;
42
42
 
43
43
  const childWrapper: ReactNode[] = [];
44
- React.Children.forEach(children, child => {
44
+ React.Children.forEach(children, (child) => {
45
45
  if (child) {
46
46
  childWrapper.push(
47
47
  <p className="control" key={childWrapper.length}>
@@ -34,7 +34,7 @@ class ButtonGroup extends React.Component<Props> {
34
34
  const { className, children } = this.props;
35
35
 
36
36
  const childWrapper: ReactNode[] = [];
37
- React.Children.forEach(children, child => {
37
+ React.Children.forEach(children, (child) => {
38
38
  if (child) {
39
39
  childWrapper.push(
40
40
  <div className="control" key={childWrapper.length}>
@@ -31,7 +31,7 @@ type SubmitButtonProps = ButtonProps & {
31
31
 
32
32
  class SubmitButton extends React.Component<SubmitButtonProps> {
33
33
  static defaultProps = {
34
- scrollToTop: true
34
+ scrollToTop: true,
35
35
  };
36
36
 
37
37
  render() {
@@ -21,7 +21,7 @@
21
21
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
22
  * SOFTWARE.
23
23
  */
24
- import React, { ReactNode } from "react";
24
+ import React, { ReactElement, ReactNode } from "react";
25
25
  import Button from "./Button";
26
26
  import { storiesOf } from "@storybook/react";
27
27
  import styled from "styled-components";
@@ -31,7 +31,6 @@ import DeleteButton from "./DeleteButton";
31
31
  import DownloadButton from "./DownloadButton";
32
32
  import EditButton from "./EditButton";
33
33
  import SubmitButton from "./SubmitButton";
34
- import { ReactElement } from "react";
35
34
  import { MemoryRouter } from "react-router-dom";
36
35
 
37
36
  const colors = ["primary", "link", "info", "success", "warning", "danger", "white", "light", "dark", "black", "text"];
@@ -43,11 +42,11 @@ const Spacing = styled.div`
43
42
  const SpacingDecorator = (story: () => ReactNode) => <Spacing>{story()}</Spacing>;
44
43
  const RoutingDecorator = (story: () => ReactNode) => <MemoryRouter initialEntries={["/"]}>{story()}</MemoryRouter>;
45
44
 
46
- storiesOf("Buttons|Button", module)
45
+ storiesOf("Buttons/Button", module)
47
46
  .addDecorator(RoutingDecorator)
48
47
  .add("Colors", () => (
49
48
  <div>
50
- {colors.map(color => (
49
+ {colors.map((color) => (
51
50
  <Spacing key={color}>
52
51
  <Button color={color} label={color} />
53
52
  </Spacing>
@@ -63,7 +62,7 @@ storiesOf("Buttons|Button", module)
63
62
  ))
64
63
  .add("Disabled", () => (
65
64
  <div>
66
- {colors.map(color => (
65
+ {colors.map((color) => (
67
66
  <Spacing key={color}>
68
67
  <Button color={color} label={color} disabled={true} />
69
68
  </Spacing>
@@ -72,7 +71,7 @@ storiesOf("Buttons|Button", module)
72
71
  ));
73
72
 
74
73
  const buttonStory = (name: string, storyFn: () => ReactElement) => {
75
- return storiesOf("Buttons|" + name, module)
74
+ return storiesOf("Buttons/" + name, module)
76
75
  .addDecorator(RoutingDecorator)
77
76
  .addDecorator(SpacingDecorator)
78
77
  .add("Default", storyFn);
@@ -26,12 +26,12 @@ import { byKey, byValueLength, byNestedKeys } from "./comparators";
26
26
 
27
27
  const createObject = (key: string, value?: string) => {
28
28
  return {
29
- [key]: value
29
+ [key]: value,
30
30
  };
31
31
  };
32
32
 
33
33
  const createObjects = (key: string, values: Array<string | undefined>) => {
34
- return values.map(v => createObject(key, v));
34
+ return values.map((v) => createObject(key, v));
35
35
  };
36
36
 
37
37
  describe("key comparator tests", () => {
@@ -98,18 +98,18 @@ describe("nested key comparator tests", () => {
98
98
  const createObject = (key: string, nested?: string, value?: string) => {
99
99
  if (!nested) {
100
100
  return {
101
- [key]: undefined
101
+ [key]: undefined,
102
102
  };
103
103
  }
104
104
  return {
105
105
  [key]: {
106
- [nested]: value
107
- }
106
+ [nested]: value,
107
+ },
108
108
  };
109
109
  };
110
110
 
111
111
  const createObjects = (key: string, nested: string, values: Array<string | undefined>) => {
112
- return values.map(v => createObject(key, nested, v));
112
+ return values.map((v) => createObject(key, nested, v));
113
113
  };
114
114
 
115
115
  it("should sort array", () => {
@@ -95,5 +95,5 @@ export const byNestedKeys = (key: string, nestedKey: string) => {
95
95
  export default {
96
96
  byKey,
97
97
  byValueLength,
98
- byNestedKeys
98
+ byNestedKeys,
99
99
  };
package/src/devBuild.ts CHANGED
@@ -31,7 +31,7 @@ export const createAttributesForTesting = (testId?: string) => {
31
31
  return undefined;
32
32
  }
33
33
  return {
34
- "data-testid": normalizeTestId(testId)
34
+ "data-testid": normalizeTestId(testId),
35
35
  };
36
36
  };
37
37
 
@@ -26,7 +26,7 @@ import { MemoryRouter } from "react-router-dom";
26
26
  import { storiesOf } from "@storybook/react";
27
27
  import AddKeyValueEntryToTableField from "./AddKeyValueEntryToTableField";
28
28
 
29
- storiesOf("Forms|AddKeyValueEntryToTableField", module)
29
+ storiesOf("Forms/AddKeyValueEntryToTableField", module)
30
30
  .addDecorator((story) => <MemoryRouter initialEntries={["/"]}>{story()}</MemoryRouter>)
31
31
  .add("Default", () => (
32
32
  <div className="m-6">
@@ -53,7 +53,7 @@ const AutocompleteAddEntryToTableField: FC<Props> = ({
53
53
  loadSuggestions,
54
54
  placeholder,
55
55
  loadingMessage,
56
- noOptionsMessage
56
+ noOptionsMessage,
57
57
  }) => {
58
58
  const [selectedValue, setSelectedValue] = useState<SelectValue | undefined>(undefined);
59
59
 
@@ -64,8 +64,8 @@ const ReactHookForm: FC = () => {
64
64
  const { register, handleSubmit } = useForm<Settings>({
65
65
  defaultValues: {
66
66
  disabled: true,
67
- readonly: true
68
- }
67
+ readonly: true,
68
+ },
69
69
  });
70
70
  const [stored, setStored] = useState<Settings>();
71
71
 
@@ -105,8 +105,8 @@ const LegacyEvents: FC = () => {
105
105
  );
106
106
  };
107
107
 
108
- storiesOf("Forms|Checkbox", module)
109
- .addDecorator(storyFn => <MemoryRouter>{storyFn()}</MemoryRouter>)
108
+ storiesOf("Forms/Checkbox", module)
109
+ .addDecorator((storyFn) => <MemoryRouter>{storyFn()}</MemoryRouter>)
110
110
  .add("Default", () => (
111
111
  <Spacing>
112
112
  <Checkbox label="Not checked" checked={false} />
@@ -25,7 +25,7 @@ import React from "react";
25
25
  import { storiesOf } from "@storybook/react";
26
26
  import DropDown from "./DropDown";
27
27
 
28
- storiesOf("Forms|DropDown", module)
28
+ storiesOf("Forms/DropDown", module)
29
29
  .add("Default", () => (
30
30
  <DropDown
31
31
  options={["en", "de", "es"]}
@@ -41,10 +41,10 @@ storiesOf("Forms|DropDown", module)
41
41
  options={[
42
42
  "The Hitchhiker's Guide to the Galaxy",
43
43
  "Dirk Gently’s Holistic Detective Agency",
44
- "The Meaning Of Liff"
44
+ "The Meaning Of Liff",
45
45
  ]}
46
46
  preselectedOption={"dirk"}
47
- optionSelected={selection => {
47
+ optionSelected={(selection) => {
48
48
  // nothing to do
49
49
  }}
50
50
  />
@@ -54,7 +54,7 @@ storiesOf("Forms|DropDown", module)
54
54
  optionValues={["alpha", "beta", "gamma"]}
55
55
  options={["A", "B", "C"]}
56
56
  preselectedOption={"D"}
57
- optionSelected={selection => {
57
+ optionSelected={(selection) => {
58
58
  // nothing to do
59
59
  }}
60
60
  />
@@ -45,7 +45,7 @@ class DropDown extends React.Component<Props> {
45
45
  render() {
46
46
  const { options, optionValues, preselectedOption, className, disabled } = this.props;
47
47
 
48
- if (preselectedOption && options.filter(o => o === preselectedOption).length === 0) {
48
+ if (preselectedOption && options.filter((o) => o === preselectedOption).length === 0) {
49
49
  options.push(preselectedOption);
50
50
  }
51
51
 
@@ -63,7 +63,7 @@ const ReactHookForm: FC = () => {
63
63
  );
64
64
  };
65
65
 
66
- storiesOf("Forms|FileInput", module)
66
+ storiesOf("Forms/FileInput", module)
67
67
  .addDecorator((storyFn) => <Decorator>{storyFn()}</Decorator>)
68
68
  .addDecorator((storyFn) => <MemoryRouter>{storyFn()}</MemoryRouter>)
69
69
  .add("Default", () => <ReactHookForm />);
@@ -77,7 +77,7 @@ const FilterInput: FC<Props> = ({ filter, value, testId, placeholder, autoFocus,
77
77
  type="search"
78
78
  placeholder={placeholder || t("filterEntries")}
79
79
  value={stateValue}
80
- onChange={event => setStateValue(event.target.value)}
80
+ onChange={(event) => setStateValue(event.target.value)}
81
81
  autoFocus={autoFocus || false}
82
82
  />
83
83
  <span className="icon is-small is-left">
@@ -127,7 +127,7 @@ const LegacyEvents: FC = () => {
127
127
  );
128
128
  };
129
129
 
130
- storiesOf("Forms|InputField", module)
130
+ storiesOf("Forms/InputField", module)
131
131
  .addDecorator((storyFn) => <Decorator>{storyFn()}</Decorator>)
132
132
  .addDecorator((storyFn) => <MemoryRouter>{storyFn()}</MemoryRouter>)
133
133
  .add("AutoFocus", () => <InputField label="Field with AutoFocus" autofocus={true} />)
@@ -36,11 +36,11 @@ type Props = WithTranslation & {
36
36
  class MemberNameTagGroup extends React.Component<Props> {
37
37
  render() {
38
38
  const { members, label, helpText, t } = this.props;
39
- const membersExtended = members.map(id => {
39
+ const membersExtended = members.map((id) => {
40
40
  return {
41
41
  id,
42
42
  displayName: id,
43
- mail: ""
43
+ mail: "",
44
44
  };
45
45
  });
46
46
  return (
@@ -54,7 +54,7 @@ class MemberNameTagGroup extends React.Component<Props> {
54
54
  }
55
55
 
56
56
  removeEntry = (membersExtended: DisplayedUser[]) => {
57
- const members = membersExtended.map(function(item) {
57
+ const members = membersExtended.map(function (item) {
58
58
  return item["id"];
59
59
  });
60
60
  this.props.memberListChanged(members);
@@ -44,7 +44,7 @@ class PasswordConfirmation extends React.Component<Props, State> {
44
44
  password: "",
45
45
  confirmedPassword: "",
46
46
  passwordValid: true,
47
- passwordConfirmationFailed: false
47
+ passwordConfirmationFailed: false,
48
48
  };
49
49
  }
50
50
 
@@ -53,7 +53,7 @@ class PasswordConfirmation extends React.Component<Props, State> {
53
53
  password: "",
54
54
  confirmedPassword: "",
55
55
  passwordValid: true,
56
- passwordConfirmationFailed: false
56
+ passwordConfirmationFailed: false,
57
57
  });
58
58
  }
59
59
 
@@ -101,7 +101,7 @@ class PasswordConfirmation extends React.Component<Props, State> {
101
101
  this.setState(
102
102
  {
103
103
  confirmedPassword,
104
- passwordConfirmationFailed: !passwordConfirmed
104
+ passwordConfirmationFailed: !passwordConfirmed,
105
105
  },
106
106
  this.propagateChange
107
107
  );
@@ -114,7 +114,7 @@ class PasswordConfirmation extends React.Component<Props, State> {
114
114
  {
115
115
  passwordValid: this.validatePassword(password),
116
116
  passwordConfirmationFailed,
117
- password: password
117
+ password: password,
118
118
  },
119
119
  this.propagateChange
120
120
  );
@@ -112,8 +112,8 @@ const LegacyEvents: FC = () => {
112
112
  );
113
113
  };
114
114
 
115
- storiesOf("Forms|Radio", module)
116
- .addDecorator(storyFn => <MemoryRouter>{storyFn()}</MemoryRouter>)
115
+ storiesOf("Forms/Radio", module)
116
+ .addDecorator((storyFn) => <MemoryRouter>{storyFn()}</MemoryRouter>)
117
117
  .add("Default", () => (
118
118
  <Spacing>
119
119
  <Radio label="Not checked" checked={false} />
@@ -187,8 +187,8 @@ const PreselectOption: FC = () => {
187
187
  },
188
188
  {
189
189
  label: "USCSS Prometheus",
190
- value: "uscss-prometheus"
191
- }
190
+ value: "uscss-prometheus",
191
+ },
192
192
  ]}
193
193
  onChange={setValue}
194
194
  value={value}
@@ -198,11 +198,10 @@ const PreselectOption: FC = () => {
198
198
  );
199
199
  };
200
200
 
201
- storiesOf("Forms|Select", module)
201
+ storiesOf("Forms/Select", module)
202
202
  .addDecorator((storyFn) => <MemoryRouter>{storyFn()}</MemoryRouter>)
203
203
  .add("Add no existing value", () => <AddNoExistingValue />)
204
204
  .add("Ref", () => <Ref />)
205
205
  .add("Legacy Events", () => <LegacyEvents />)
206
206
  .add("ReactHookForm", () => <ReactHookForm />)
207
- .add("Preselect option", () => <PreselectOption />)
208
- ;
207
+ .add("Preselect option", () => <PreselectOption />);
@@ -170,7 +170,7 @@ const LegacyEvents: FC = () => {
170
170
  );
171
171
  };
172
172
 
173
- storiesOf("Forms|Textarea", module)
173
+ storiesOf("Forms/Textarea", module)
174
174
  .addDecorator((storyFn) => <MemoryRouter>{storyFn()}</MemoryRouter>)
175
175
  .add("OnChange", () => <OnChangeTextarea />)
176
176
  .add("OnSubmit", () => <OnSubmitTextare />)
package/src/languages.ts CHANGED
@@ -24,7 +24,7 @@
24
24
 
25
25
  // this aliases are only to map from spotter detection to prismjs
26
26
  const languageAliases: { [key: string]: string } = {
27
- golang: "go"
27
+ golang: "go",
28
28
  };
29
29
 
30
30
  export const defaultLanguage = "text";
@@ -40,7 +40,7 @@ const trillian: Me = {
40
40
  displayName: "Trillian McMillian",
41
41
  mail: "tricia@hitchhiker.com",
42
42
  groups: ["crew"],
43
- _links: {}
43
+ _links: {},
44
44
  };
45
45
 
46
46
  const bindAvatar = (binder: Binder, avatar: string) => {
@@ -64,8 +64,8 @@ const withBinder = (binder: Binder) => {
64
64
  );
65
65
  };
66
66
 
67
- storiesOf("Layout|Footer", module)
68
- .addDecorator(story => <MemoryRouter initialEntries={["/"]}>{story()}</MemoryRouter>)
67
+ storiesOf("Footer", module)
68
+ .addDecorator((story) => <MemoryRouter initialEntries={["/"]}>{story()}</MemoryRouter>)
69
69
  .add("Default", () => {
70
70
  return <Footer me={trillian} version="2.0.0" links={{}} />;
71
71
  })
@@ -29,7 +29,7 @@ const SecondaryColumn = styled.div<{ collapsed: boolean }>`
29
29
  /* In Bulma there is unfortunately no intermediate step between .is-1 and .is-2, hence the size.
30
30
  Navigation size should be as constant as possible. */
31
31
  flex: none;
32
- width: ${props => (props.collapsed ? "5.5rem" : "20.5rem")};
32
+ width: ${(props) => (props.collapsed ? "5.5rem" : "20.5rem")};
33
33
  max-width: ${(props: { collapsed: boolean }) => (props.collapsed ? "11.3%" : "25%")};
34
34
  /* Render this column to full size if column construct breaks (page size too small). */
35
35
  @media (max-width: 785px) {
@@ -31,7 +31,7 @@ type Props = {
31
31
  className?: string;
32
32
  };
33
33
 
34
- const Title: FC<Props> = ({ title, preventRefreshingPageTitle, customPageTitle, className , children}) => {
34
+ const Title: FC<Props> = ({ title, preventRefreshingPageTitle, customPageTitle, className, children }) => {
35
35
  useEffect(() => {
36
36
  if (!preventRefreshingPageTitle) {
37
37
  if (customPageTitle) {
@@ -51,7 +51,7 @@ const Title: FC<Props> = ({ title, preventRefreshingPageTitle, customPageTitle,
51
51
  };
52
52
 
53
53
  Title.defaultProps = {
54
- preventRefreshingPageTitle: false
54
+ preventRefreshingPageTitle: false,
55
55
  };
56
56
 
57
57
  export default Title;
@@ -32,7 +32,7 @@ type Props = {
32
32
  value: string;
33
33
  };
34
34
 
35
- const MarkdownCodeRenderer: FC<Props> = props => {
35
+ const MarkdownCodeRenderer: FC<Props> = (props) => {
36
36
  const binder = useBinder();
37
37
  const indexLinks = useIndexLinks();
38
38
  const { language } = props;
@@ -94,7 +94,7 @@ const MarkdownHeadingRenderer: FC<Props> = ({ children, level, permalink, id })
94
94
  <Icon name="link" onClick={copyPermalink} alt={t("sources.content.copyPermalink")} />
95
95
  </Tooltip>
96
96
  );
97
- const headingElement = React.createElement("h" + level, {id: anchorId}, [...reactChildren, CopyButton]);
97
+ const headingElement = React.createElement("h" + level, { id: anchorId }, [...reactChildren, CopyButton]);
98
98
  const href = urls.withContextPath(location.pathname + "#" + anchorId);
99
99
  const permalinkHref =
100
100
  window.location.protocol +
@@ -110,7 +110,7 @@ const MarkdownHeadingRenderer: FC<Props> = ({ children, level, permalink, id })
110
110
  };
111
111
 
112
112
  export const create = (permalink: string): FC<Props> => {
113
- return props => <MarkdownHeadingRenderer {...props} permalink={permalink} />;
113
+ return (props) => <MarkdownHeadingRenderer {...props} permalink={permalink} />;
114
114
  };
115
115
 
116
116
  export default MarkdownHeadingRenderer;
@@ -26,7 +26,7 @@ import {
26
26
  isExternalLink,
27
27
  isLinkWithProtocol,
28
28
  createLocalLink,
29
- isInternalScmRepoLink
29
+ isInternalScmRepoLink,
30
30
  } from "./MarkdownLinkRenderer";
31
31
 
32
32
  describe("test isAnchorLink", () => {
@@ -136,7 +136,7 @@ const MarkdownLinkRenderer: FC<Props> = ({ href = "", base, children, ...props }
136
136
  // we use a factory method, because react-markdown does not pass
137
137
  // base as prop down to our link component.
138
138
  export const create = (base?: string, protocolExtensions: ProtocolLinkRendererExtensionMap = {}): FC<LinkProps> => {
139
- return props => {
139
+ return (props) => {
140
140
  const protocolLinkContext = isLinkWithProtocol(props.href || "");
141
141
  if (protocolLinkContext) {
142
142
  const { link, protocol } = protocolLinkContext;
@@ -46,8 +46,8 @@ const Spacing = styled.div`
46
46
  `;
47
47
 
48
48
  storiesOf("MarkdownView", module)
49
- .addDecorator(story => <MemoryRouter initialEntries={["/"]}>{story()}</MemoryRouter>)
50
- .addDecorator(story => <Spacing>{story()}</Spacing>)
49
+ .addDecorator((story) => <MemoryRouter initialEntries={["/"]}>{story()}</MemoryRouter>)
50
+ .addDecorator((story) => <Spacing>{story()}</Spacing>)
51
51
  .add("Default", () => <MarkdownView content={TestPage} skipHtml={false} />)
52
52
  .add("Skip Html", () => <MarkdownView content={TestPage} skipHtml={true} />)
53
53
  .add("Code without Lang", () => <MarkdownView content={MarkdownWithoutLang} skipHtml={false} />)
@@ -63,7 +63,7 @@ storiesOf("MarkdownView", module)
63
63
  const binder = new Binder("custom protocol link renderer");
64
64
  binder.bind("markdown-renderer.link.protocol", {
65
65
  protocol: "scw",
66
- renderer: ProtocolLinkRenderer
66
+ renderer: ProtocolLinkRenderer,
67
67
  } as ProtocolLinkRendererExtension);
68
68
  return (
69
69
  <BinderContext.Provider value={binder}>
@@ -75,7 +75,7 @@ storiesOf("MarkdownView", module)
75
75
  const binder = new Binder("custom protocol link renderer");
76
76
  binder.bind("markdown-renderer.link.protocol", {
77
77
  protocol: "scw",
78
- renderer: ProtocolLinkRenderer
78
+ renderer: ProtocolLinkRenderer,
79
79
  } as ProtocolLinkRendererExtension);
80
80
  return (
81
81
  <BinderContext.Provider value={binder}>