@scm-manager/ui-components 4.0.0-REACT18-20250701-125025 → 4.0.0-REACT19
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/package.json +46 -51
- package/src/BranchSelector.stories.tsx +60 -11
- package/src/Breadcrumb.stories.tsx +131 -57
- package/src/Breadcrumb.tsx +3 -3
- package/src/CardColumn.stories.tsx +94 -27
- package/src/CardColumnSmall.stories.tsx +102 -27
- package/src/CommaSeparatedList.tsx +2 -2
- package/src/Date.stories.tsx +64 -17
- package/src/Duration.stories.tsx +92 -45
- package/src/ErrorBoundary.tsx +38 -58
- package/src/ErrorNotification.tsx +1 -1
- package/src/Help.stories.tsx +61 -17
- package/src/Help.tsx +5 -11
- package/src/Icon.stories.tsx +93 -13
- package/src/LinkPaginator.tsx +9 -6
- package/src/Loading.stories.tsx +26 -6
- package/src/Logo.stories.tsx +44 -13
- package/src/Notification.stories.tsx +111 -23
- package/src/OverviewPageActions.tsx +5 -5
- package/src/Paginator.test.tsx +115 -94
- package/src/PdfViewer.stories.tsx +83 -5
- package/src/PreformattedCodeBlock.stories.tsx +97 -26
- package/src/ProtectedRoute.tsx +14 -39
- package/src/SmallLoadingSpinner.stories.tsx +26 -6
- package/src/SyntaxHighlighter.stories.tsx +122 -40
- package/src/SyntaxHighlighterRenderer.tsx +7 -7
- package/src/Tag.stories.tsx +135 -18
- package/src/Tag.tsx +2 -1
- package/src/Tooltip.stories.tsx +147 -34
- package/src/__snapshots__/storyshots.test.ts.snap +6 -112
- package/src/avatar/Avatar.ts +1 -1
- package/src/avatar/AvatarImage.tsx +1 -1
- package/src/avatar/AvatarWrapper.tsx +2 -2
- package/src/buttons/Button.stories.tsx +159 -0
- package/src/buttons/Button.tsx +5 -5
- package/src/config/ConfigurationBinder.tsx +39 -39
- package/src/config/ConfigurationForm.tsx +2 -1
- package/src/config/TitledSettings.tsx +4 -1
- package/src/forms/AddKeyValueEntryToTableField.stories.tsx +60 -25
- package/src/forms/Checkbox.stories.tsx +165 -27
- package/src/forms/Checkbox.tsx +1 -0
- package/src/forms/DropDown.stories.tsx +81 -35
- package/src/forms/FileInput.stories.tsx +85 -10
- package/src/forms/InputField.stories.tsx +210 -37
- package/src/forms/InputField.tsx +1 -0
- package/src/forms/Radio.stories.tsx +181 -34
- package/src/forms/Radio.tsx +1 -0
- package/src/forms/Select.stories.tsx +266 -46
- package/src/forms/Select.tsx +1 -0
- package/src/forms/Textarea.stories.tsx +99 -53
- package/src/forms/Textarea.tsx +1 -0
- package/src/forms/index.ts +3 -1
- package/src/index.ts +5 -5
- package/src/jest-dom.d.ts +17 -0
- package/src/layout/Footer.stories.tsx +114 -22
- package/src/layout/FooterSection.tsx +1 -0
- package/src/layout/Header.tsx +2 -1
- package/src/layout/Page.tsx +1 -3
- package/src/layout/PrimaryContentColumn.tsx +2 -2
- package/src/layout/SecondaryNavigationColumn.tsx +3 -3
- package/src/layout/SubSubtitle.tsx +2 -1
- package/src/layout/Subtitle.tsx +2 -1
- package/src/layout/Title.tsx +2 -5
- package/src/markdown/LazyMarkdownView.tsx +16 -5
- package/src/markdown/MarkdownHeadingRenderer.test.ts +9 -1
- package/src/markdown/MarkdownHeadingRenderer.tsx +3 -3
- package/src/markdown/MarkdownImageRenderer.test.ts +8 -1
- package/src/markdown/MarkdownImageRenderer.tsx +2 -1
- package/src/markdown/MarkdownLinkRenderer.test.tsx +9 -0
- package/src/markdown/MarkdownLinkRenderer.tsx +6 -4
- package/src/markdown/MarkdownView.stories.tsx +224 -72
- package/src/markdown/markdownExtensions.ts +6 -4
- package/src/modals/ConfirmAlert.stories.tsx +133 -44
- package/src/modals/ConfirmAlert.tsx +5 -4
- package/src/modals/Modal.stories.tsx +461 -252
- package/src/modals/Modal.tsx +12 -11
- package/src/modals/useRegisterModal.test.tsx +5 -4
- package/src/navigation/MenuContext.tsx +2 -2
- package/src/navigation/NavLink.tsx +4 -7
- package/src/navigation/PrimaryNavigation.tsx +2 -2
- package/src/navigation/PrimaryNavigationLink.tsx +6 -5
- package/src/navigation/RoutingProps.ts +1 -3
- package/src/navigation/SecondaryNavigation.stories.tsx +157 -45
- package/src/navigation/SecondaryNavigation.tsx +17 -16
- package/src/navigation/SecondaryNavigationItem.tsx +2 -1
- package/src/navigation/SubNavigation.tsx +4 -8
- package/src/navigation/useActiveMatch.ts +20 -22
- package/src/navigation/useNavigationLock.ts +1 -0
- package/src/popover/Popover.stories.tsx +111 -41
- package/src/popover/Popover.tsx +2 -5
- package/src/repos/Diff.stories.tsx +418 -223
- package/src/repos/Diff.tsx +1 -5
- package/src/repos/HunkExpandDivider.tsx +2 -2
- package/src/repos/LoadingDiff.tsx +11 -6
- package/src/repos/RepositoryEntry.stories.tsx +217 -53
- package/src/repos/RepositoryFlag.tsx +2 -1
- package/src/repos/TokenizedDiffView.tsx +4 -2
- package/src/repos/annotate/Annotate.stories.tsx +225 -111
- package/src/repos/annotate/AnnotateLine.tsx +2 -1
- package/src/repos/changesets/ChangesetAuthor.tsx +2 -2
- package/src/repos/changesets/ChangesetButtonGroup.test.tsx +9 -5
- package/src/repos/changesets/ChangesetDiff.test.ts +10 -2
- package/src/repos/changesets/Changesets.stories.tsx +388 -197
- package/src/repos/changesets/ContributorRow.tsx +2 -2
- package/src/repos/changesets/SignatureIcon.tsx +1 -0
- package/src/repos/diff/DiffFileTree.tsx +1 -1
- package/src/repos/diff/styledElements.tsx +4 -3
- package/src/repos/index.ts +15 -15
- package/src/search/Hit.tsx +3 -2
- package/src/search/TextHitField.stories.tsx +131 -43
- package/src/search/TextHitField.tsx +3 -2
- package/src/search/index.ts +1 -1
- package/src/storyshots.test.ts +66 -60
- package/src/table/Table.stories.tsx +146 -48
- package/src/table/Table.tsx +7 -8
- package/src/table/TextColumn.tsx +0 -9
- package/src/toast/Toast.tsx +2 -1
- package/src/toast/ToastArea.tsx +2 -2
- package/src/toast/ToastButton.tsx +2 -1
- package/src/toast/ToastButtons.tsx +4 -2
- package/src/toast/ToastNotification.tsx +2 -1
- package/src/toast/index.stories.tsx +144 -39
- package/src/toast/index.ts +1 -1
- package/src/buttons/index.stories.tsx +0 -85
package/src/Tooltip.stories.tsx
CHANGED
|
@@ -14,14 +14,100 @@
|
|
|
14
14
|
* along with this program. If not, see https://www.gnu.org/licenses/.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
+
// import styled from "styled-components";
|
|
18
|
+
// import * as React from "react";
|
|
19
|
+
// import { ReactNode } from "react";
|
|
20
|
+
// import { MemoryRouter } from "react-router-dom";
|
|
21
|
+
// import { storiesOf } from "@storybook/react";
|
|
22
|
+
// import Tooltip, { TooltipLocation } from "./Tooltip";
|
|
23
|
+
// import Button from "./buttons/Button";
|
|
24
|
+
//
|
|
25
|
+
// const Wrapper = styled.div`
|
|
26
|
+
// margin: 2rem;
|
|
27
|
+
// width: 100%;
|
|
28
|
+
// `;
|
|
29
|
+
//
|
|
30
|
+
// const Spacing = styled.div`
|
|
31
|
+
// padding: 2em 6em;
|
|
32
|
+
// width: 50%;
|
|
33
|
+
// margin: 0 auto;
|
|
34
|
+
// `;
|
|
35
|
+
//
|
|
36
|
+
// const positions: TooltipLocation[] = ["right", "top", "left", "bottom"];
|
|
37
|
+
//
|
|
38
|
+
// const message = "Heart of Gold";
|
|
39
|
+
//
|
|
40
|
+
// const mutltiline = `Characters:
|
|
41
|
+
//
|
|
42
|
+
// - Arthur Dent
|
|
43
|
+
// - Ford Prefect
|
|
44
|
+
// - Zaphod Beeblebrox
|
|
45
|
+
// - Marvin the Paranoid Android
|
|
46
|
+
// - Trillian
|
|
47
|
+
// - Slartibartfast`;
|
|
48
|
+
//
|
|
49
|
+
// const shortMultiline = `* a
|
|
50
|
+
// * b
|
|
51
|
+
// * c`;
|
|
52
|
+
//
|
|
53
|
+
// const RoutingDecorator = (story: () => ReactNode) => <MemoryRouter initialEntries={["/"]}>{story()}</MemoryRouter>;
|
|
54
|
+
//
|
|
55
|
+
// storiesOf("Tooltip", module)
|
|
56
|
+
// .addDecorator(RoutingDecorator)
|
|
57
|
+
// .add("Default", () => (
|
|
58
|
+
// <Wrapper>
|
|
59
|
+
// {positions.map((position) => (
|
|
60
|
+
// <Spacing>
|
|
61
|
+
// <Tooltip message={message} location={position}>
|
|
62
|
+
// <Button label={position} color="info" />{" "}
|
|
63
|
+
// </Tooltip>
|
|
64
|
+
// </Spacing>
|
|
65
|
+
// ))}
|
|
66
|
+
// </Wrapper>
|
|
67
|
+
// ))
|
|
68
|
+
// .add("Multiline", () => (
|
|
69
|
+
// <Wrapper>
|
|
70
|
+
// {positions.map((position) => (
|
|
71
|
+
// <Spacing>
|
|
72
|
+
// <Tooltip message={mutltiline} location={position}>
|
|
73
|
+
// <Button label={position} color="info" />{" "}
|
|
74
|
+
// </Tooltip>
|
|
75
|
+
// </Spacing>
|
|
76
|
+
// ))}
|
|
77
|
+
// </Wrapper>
|
|
78
|
+
// ))
|
|
79
|
+
// .add("Short Multiline", () => (
|
|
80
|
+
// <Wrapper>
|
|
81
|
+
// {positions.map((position) => (
|
|
82
|
+
// <Spacing>
|
|
83
|
+
// <Tooltip message={shortMultiline} location={position}>
|
|
84
|
+
// <Button label={position} color="info" />{" "}
|
|
85
|
+
// </Tooltip>
|
|
86
|
+
// </Spacing>
|
|
87
|
+
// ))}
|
|
88
|
+
// </Wrapper>
|
|
89
|
+
// ))
|
|
90
|
+
// .add("Styled", () => (
|
|
91
|
+
// <Wrapper>
|
|
92
|
+
// {positions.map((position) => (
|
|
93
|
+
// <Spacing>
|
|
94
|
+
// <Tooltip message={message} location={position} className={"has-text-warning"}>
|
|
95
|
+
// <Button label={position} color="info" />{" "}
|
|
96
|
+
// </Tooltip>
|
|
97
|
+
// </Spacing>
|
|
98
|
+
// ))}
|
|
99
|
+
// </Wrapper>
|
|
100
|
+
// ));
|
|
101
|
+
|
|
102
|
+
import React from "react";
|
|
17
103
|
import styled from "styled-components";
|
|
18
|
-
import
|
|
19
|
-
|
|
20
|
-
import { MemoryRouter } from "react-router-dom";
|
|
21
|
-
import { storiesOf } from "@storybook/react";
|
|
104
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
105
|
+
|
|
22
106
|
import Tooltip, { TooltipLocation } from "./Tooltip";
|
|
23
107
|
import Button from "./buttons/Button";
|
|
24
108
|
|
|
109
|
+
// --- Helper Components & Mock Data (preserved from your original story) ---
|
|
110
|
+
|
|
25
111
|
const Wrapper = styled.div`
|
|
26
112
|
margin: 2rem;
|
|
27
113
|
width: 100%;
|
|
@@ -31,13 +117,14 @@ const Spacing = styled.div`
|
|
|
31
117
|
padding: 2em 6em;
|
|
32
118
|
width: 50%;
|
|
33
119
|
margin: 0 auto;
|
|
120
|
+
text-align: center; // Center the button for better display
|
|
34
121
|
`;
|
|
35
122
|
|
|
36
123
|
const positions: TooltipLocation[] = ["right", "top", "left", "bottom"];
|
|
37
124
|
|
|
38
125
|
const message = "Heart of Gold";
|
|
39
126
|
|
|
40
|
-
const
|
|
127
|
+
const multiline = `Characters:
|
|
41
128
|
|
|
42
129
|
- Arthur Dent
|
|
43
130
|
- Ford Prefect
|
|
@@ -50,51 +137,77 @@ const shortMultiline = `* a
|
|
|
50
137
|
* b
|
|
51
138
|
* c`;
|
|
52
139
|
|
|
53
|
-
|
|
140
|
+
// --- Storybook Metadata ---
|
|
141
|
+
|
|
142
|
+
const meta: Meta<typeof Tooltip> = {
|
|
143
|
+
title: "Components/Tooltip",
|
|
144
|
+
component: Tooltip,
|
|
145
|
+
decorators: [(Story) => <Wrapper>{Story()}</Wrapper>],
|
|
146
|
+
tags: ["autodocs"],
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
export default meta;
|
|
150
|
+
|
|
151
|
+
// --- Story Definitions ---
|
|
54
152
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
153
|
+
type Story = StoryObj<typeof meta>;
|
|
154
|
+
|
|
155
|
+
// Since these stories showcase multiple components at once, we use
|
|
156
|
+
// a custom `render` function instead of the `args` object.
|
|
157
|
+
|
|
158
|
+
export const Default: Story = {
|
|
159
|
+
render: () => (
|
|
160
|
+
<>
|
|
59
161
|
{positions.map((position) => (
|
|
60
|
-
<Spacing>
|
|
162
|
+
<Spacing key={position}>
|
|
61
163
|
<Tooltip message={message} location={position}>
|
|
62
|
-
<Button label={position} color="info" />
|
|
164
|
+
<Button label={position} color="info" />
|
|
63
165
|
</Tooltip>
|
|
64
166
|
</Spacing>
|
|
65
167
|
))}
|
|
66
|
-
|
|
67
|
-
)
|
|
68
|
-
|
|
69
|
-
|
|
168
|
+
</>
|
|
169
|
+
),
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
export const Multiline: Story = {
|
|
173
|
+
render: () => (
|
|
174
|
+
<>
|
|
70
175
|
{positions.map((position) => (
|
|
71
|
-
<Spacing>
|
|
72
|
-
<Tooltip message={
|
|
73
|
-
<Button label={position} color="info" />
|
|
176
|
+
<Spacing key={position}>
|
|
177
|
+
<Tooltip message={multiline} location={position}>
|
|
178
|
+
<Button label={position} color="info" />
|
|
74
179
|
</Tooltip>
|
|
75
180
|
</Spacing>
|
|
76
181
|
))}
|
|
77
|
-
|
|
78
|
-
)
|
|
79
|
-
|
|
80
|
-
|
|
182
|
+
</>
|
|
183
|
+
),
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
export const ShortMultiline: Story = {
|
|
187
|
+
name: "Short Multiline", // Explicit name to maintain spacing
|
|
188
|
+
render: () => (
|
|
189
|
+
<>
|
|
81
190
|
{positions.map((position) => (
|
|
82
|
-
<Spacing>
|
|
191
|
+
<Spacing key={position}>
|
|
83
192
|
<Tooltip message={shortMultiline} location={position}>
|
|
84
|
-
<Button label={position} color="info" />
|
|
193
|
+
<Button label={position} color="info" />
|
|
85
194
|
</Tooltip>
|
|
86
195
|
</Spacing>
|
|
87
196
|
))}
|
|
88
|
-
|
|
89
|
-
)
|
|
90
|
-
|
|
91
|
-
|
|
197
|
+
</>
|
|
198
|
+
),
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
export const Styled: Story = {
|
|
202
|
+
render: () => (
|
|
203
|
+
<>
|
|
92
204
|
{positions.map((position) => (
|
|
93
|
-
<Spacing>
|
|
94
|
-
<Tooltip message={message} location={position} className=
|
|
95
|
-
<Button label={position} color="info" />
|
|
205
|
+
<Spacing key={position}>
|
|
206
|
+
<Tooltip message={message} location={position} className="has-text-warning">
|
|
207
|
+
<Button label={position} color="info" />
|
|
96
208
|
</Tooltip>
|
|
97
209
|
</Spacing>
|
|
98
210
|
))}
|
|
99
|
-
|
|
100
|
-
)
|
|
211
|
+
</>
|
|
212
|
+
),
|
|
213
|
+
};
|