@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.
- package/package.json +10 -8
- package/src/Autocomplete.tsx +6 -6
- package/src/BranchSelector.stories.tsx +1 -1
- package/src/Breadcrumb.tsx +4 -1
- package/src/CardColumn.stories.tsx +2 -2
- package/src/CardColumn.tsx +1 -2
- package/src/HelpIcon.tsx +3 -1
- package/src/Icon.stories.tsx +3 -3
- package/src/Notification.stories.tsx +1 -1
- package/src/Paginator.test.tsx +16 -16
- package/src/ProtectedRoute.tsx +3 -3
- package/src/Tag.tsx +1 -1
- package/src/__resources__/Diff.markdown.ts +19 -21
- package/src/__resources__/changesets.tsx +73 -109
- package/src/__resources__/repository.ts +8 -8
- package/src/__snapshots__/storyshots.test.ts.snap +71237 -71286
- package/src/buttons/Button.tsx +63 -74
- package/src/buttons/ButtonAddons.tsx +1 -1
- package/src/buttons/ButtonGroup.tsx +1 -1
- package/src/buttons/SubmitButton.tsx +1 -1
- package/src/buttons/index.stories.tsx +5 -6
- package/src/comparators.test.ts +6 -6
- package/src/comparators.ts +1 -1
- package/src/devBuild.ts +1 -1
- package/src/forms/AddKeyValueEntryToTableField.stories.tsx +1 -1
- package/src/forms/AutocompleteAddEntryToTableField.tsx +1 -1
- package/src/forms/Checkbox.stories.tsx +4 -4
- package/src/forms/DropDown.stories.tsx +4 -4
- package/src/forms/DropDown.tsx +1 -1
- package/src/forms/FileInput.stories.tsx +1 -1
- package/src/forms/FilterInput.tsx +1 -1
- package/src/forms/InputField.stories.tsx +1 -1
- package/src/forms/MemberNameTagGroup.tsx +3 -3
- package/src/forms/PasswordConfirmation.tsx +4 -4
- package/src/forms/Radio.stories.tsx +2 -2
- package/src/forms/Select.stories.tsx +4 -5
- package/src/forms/Textarea.stories.tsx +1 -1
- package/src/languages.ts +1 -1
- package/src/layout/Footer.stories.tsx +3 -3
- package/src/layout/SecondaryNavigationColumn.tsx +1 -1
- package/src/layout/Title.tsx +2 -2
- package/src/markdown/MarkdownCodeRenderer.tsx +1 -1
- package/src/markdown/MarkdownHeadingRenderer.tsx +2 -2
- package/src/markdown/MarkdownLinkRenderer.test.tsx +1 -1
- package/src/markdown/MarkdownLinkRenderer.tsx +1 -1
- package/src/markdown/MarkdownView.stories.tsx +4 -4
- package/src/markdown/MarkdownView.tsx +9 -9
- package/src/markdown/createComponentList.ts +1 -1
- package/src/markdown/createMdastPlugin.ts +1 -1
- package/src/markdown/markdownExtensions.ts +1 -1
- package/src/markdown/remarkChangesetShortLinkParser.ts +7 -7
- package/src/markdown/remarkToRehypeRendererAdapters.ts +10 -9
- package/src/modals/ConfirmAlert.stories.tsx +5 -5
- package/src/modals/ConfirmAlert.tsx +2 -2
- package/src/modals/CreateTagModal.tsx +4 -4
- package/src/modals/Modal.stories.tsx +1 -1
- package/src/navigation/MenuContext.tsx +2 -2
- package/src/navigation/NavAction.tsx +3 -3
- package/src/navigation/SecondaryNavigation.stories.tsx +4 -4
- package/src/navigation/SubNavigation.tsx +2 -2
- package/src/popover/Popover.stories.tsx +37 -35
- package/src/popover/usePopover.ts +10 -10
- package/src/repos/Diff.stories.tsx +1 -1
- package/src/repos/DiffExpander.test.ts +39 -41
- package/src/repos/DiffExpander.ts +10 -10
- package/src/repos/RepositoryEntry.stories.tsx +1 -1
- package/src/repos/RepositoryFlag.tsx +1 -1
- package/src/repos/Tokenize.worker.ts +3 -3
- package/src/repos/TokenizedDiffView.tsx +1 -1
- package/src/repos/annotate/Annotate.stories.tsx +29 -29
- package/src/repos/changesets/ChangesetAuthor.tsx +4 -4
- package/src/repos/changesets/ChangesetDescription.tsx +2 -2
- package/src/repos/changesets/ChangesetDiff.test.ts +18 -18
- package/src/repos/changesets/ChangesetId.tsx +1 -1
- package/src/repos/changesets/ChangesetList.tsx +1 -1
- package/src/repos/changesets/ChangesetTagsCollapsed.tsx +1 -1
- package/src/repos/changesets/Changesets.stories.tsx +185 -142
- package/src/repos/changesets/SignatureIcon.tsx +4 -4
- package/src/repos/changesets/changesets.ts +1 -1
- package/src/repos/diffs.test.ts +3 -3
- package/src/repos/refractorAdapter.ts +3 -3
- package/src/repositories.test.ts +18 -18
- package/src/storyshots.test.ts +3 -3
- package/src/syntax-highlighting.module.css +17 -16
- package/src/syntax-highlighting.ts +59 -54
- package/src/table/Table.stories.tsx +7 -7
- package/src/table/Table.tsx +1 -1
- package/src/table/TextColumn.tsx +1 -1
- package/src/textSplitAndReplace.test.ts +3 -3
- package/src/textSplitAndReplace.ts +2 -2
- package/src/toast/Toast.tsx +2 -2
- package/src/toast/index.stories.tsx +2 -2
- package/src/toast/themes.ts +6 -6
- package/src/useDateFormatter.ts +3 -3
- package/src/validation.test.ts +6 -6
- package/src/validation.ts +1 -4
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
|
|
44
44
|
pre[class*="language-"],
|
|
45
45
|
code[class*="language-"] {
|
|
46
|
-
color:
|
|
46
|
+
color: var(--sh-base-color);
|
|
47
47
|
font-size: 1rem;
|
|
48
48
|
text-shadow: none;
|
|
49
|
-
font-family:
|
|
49
|
+
font-family: var(--sh-font-family);
|
|
50
50
|
direction: ltr;
|
|
51
51
|
text-align: left;
|
|
52
52
|
white-space: pre;
|
|
@@ -67,7 +67,7 @@ code[class*="language-"]::selection,
|
|
|
67
67
|
pre[class*="language-"]::-moz-selection,
|
|
68
68
|
code[class*="language-"]::-moz-selection {
|
|
69
69
|
text-shadow: none;
|
|
70
|
-
background:
|
|
70
|
+
background: var(--sh-selected-color);
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
@media print {
|
|
@@ -83,14 +83,14 @@ pre[class*="language-"] {
|
|
|
83
83
|
padding: 1em;
|
|
84
84
|
margin: .5em 0;
|
|
85
85
|
overflow: auto;
|
|
86
|
-
background:
|
|
86
|
+
background: var(--sh-block-background);
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
:not(pre) > code[class*="language-"] {
|
|
90
90
|
padding: .1em .3em;
|
|
91
91
|
border-radius: .3em;
|
|
92
|
-
color:
|
|
93
|
-
background:
|
|
92
|
+
color: var(--sh-inline-code-color);
|
|
93
|
+
background: var(--sh-inline-code-background);
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
/*********************************************************
|
|
@@ -105,11 +105,11 @@ pre[class*="language-"] {
|
|
|
105
105
|
.token.prolog,
|
|
106
106
|
.token.doctype,
|
|
107
107
|
.token.cdata {
|
|
108
|
-
color:
|
|
108
|
+
color: var(--sh-comment-color);
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
.token.punctuation {
|
|
112
|
-
color:
|
|
112
|
+
color: var(--sh-punctuation-color);
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
.token.property,
|
|
@@ -119,7 +119,7 @@ pre[class*="language-"] {
|
|
|
119
119
|
.token.constant,
|
|
120
120
|
.token.symbol,
|
|
121
121
|
.token.deleted {
|
|
122
|
-
color:
|
|
122
|
+
color: var(--sh-property-color);
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
.token.selector,
|
|
@@ -128,7 +128,7 @@ pre[class*="language-"] {
|
|
|
128
128
|
.token.char,
|
|
129
129
|
.token.builtin,
|
|
130
130
|
.token.inserted {
|
|
131
|
-
color:
|
|
131
|
+
color: var(--sh-selector-color);
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
.token.operator,
|
|
@@ -136,23 +136,24 @@ pre[class*="language-"] {
|
|
|
136
136
|
.token.url,
|
|
137
137
|
.language-css .token.string,
|
|
138
138
|
.style .token.string {
|
|
139
|
-
color:
|
|
139
|
+
color: var(--sh-operator-color);
|
|
140
|
+
background: var(--sh-operator-bg);
|
|
140
141
|
}
|
|
141
142
|
|
|
142
143
|
.token.atrule,
|
|
143
144
|
.token.attr-value,
|
|
144
145
|
.token.keyword {
|
|
145
|
-
color:
|
|
146
|
+
color: var(--sh-keyword-color);
|
|
146
147
|
}
|
|
147
148
|
|
|
148
149
|
.token.function {
|
|
149
|
-
color:
|
|
150
|
+
color: var(--sh-function-color);
|
|
150
151
|
}
|
|
151
152
|
|
|
152
153
|
.token.regex,
|
|
153
154
|
.token.important,
|
|
154
155
|
.token.variable {
|
|
155
|
-
color:
|
|
156
|
+
color: var(--sh-variable-color);
|
|
156
157
|
}
|
|
157
158
|
|
|
158
159
|
.token.important,
|
|
@@ -188,8 +189,8 @@ pre[class*="language-"] > code[class*="language-"] {
|
|
|
188
189
|
right: 0;
|
|
189
190
|
padding: inherit 0;
|
|
190
191
|
margin-top: 1em;
|
|
191
|
-
background:
|
|
192
|
-
box-shadow: inset 5px 0 0
|
|
192
|
+
background: var(--sh-highlight-background);
|
|
193
|
+
box-shadow: inset 5px 0 0 var(--sh-highlight-accent);
|
|
193
194
|
z-index: 0;
|
|
194
195
|
pointer-events: none;
|
|
195
196
|
line-height: inherit;
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
|
|
28
28
|
export default {
|
|
29
29
|
'pre[class*="language-"]': {
|
|
30
|
-
color: "
|
|
30
|
+
color: "var(--sh-base-color)",
|
|
31
31
|
fontSize: "1rem",
|
|
32
32
|
textShadow: "none",
|
|
33
|
-
fontFamily: "
|
|
33
|
+
fontFamily: "var(--sh-font-family)",
|
|
34
34
|
direction: "ltr",
|
|
35
35
|
textAlign: "left",
|
|
36
36
|
whiteSpace: "pre",
|
|
@@ -47,13 +47,13 @@ export default {
|
|
|
47
47
|
padding: "1em",
|
|
48
48
|
margin: ".5em 0",
|
|
49
49
|
overflow: "auto",
|
|
50
|
-
background: "
|
|
50
|
+
background: "var(--sh-block-background)",
|
|
51
51
|
},
|
|
52
52
|
'code[class*="language-"]': {
|
|
53
|
-
color: "
|
|
53
|
+
color: "var(--sh-base-color)",
|
|
54
54
|
fontSize: "1rem",
|
|
55
55
|
textShadow: "none",
|
|
56
|
-
fontFamily: "
|
|
56
|
+
fontFamily: "var(--sh-font-family)",
|
|
57
57
|
direction: "ltr",
|
|
58
58
|
textAlign: "left",
|
|
59
59
|
whiteSpace: "pre",
|
|
@@ -66,140 +66,145 @@ export default {
|
|
|
66
66
|
WebkitHyphens: "none",
|
|
67
67
|
MozHyphens: "none",
|
|
68
68
|
msHyphens: "none",
|
|
69
|
-
hyphens: "none"
|
|
69
|
+
hyphens: "none",
|
|
70
70
|
},
|
|
71
71
|
'pre[class*="language-"]::selection': {
|
|
72
72
|
textShadow: "none",
|
|
73
|
-
background: "
|
|
73
|
+
background: "var(--sh-selected-color)",
|
|
74
74
|
},
|
|
75
75
|
'code[class*="language-"]::selection': {
|
|
76
76
|
textShadow: "none",
|
|
77
|
-
background: "
|
|
77
|
+
background: "var(--sh-selected-color)",
|
|
78
78
|
},
|
|
79
79
|
'pre[class*="language-"]::-moz-selection': {
|
|
80
80
|
textShadow: "none",
|
|
81
|
-
background: "
|
|
81
|
+
background: "var(--sh-selected-color)",
|
|
82
82
|
},
|
|
83
83
|
'code[class*="language-"]::-moz-selection': {
|
|
84
84
|
textShadow: "none",
|
|
85
|
-
background: "
|
|
85
|
+
background: "var(--sh-selected-color)",
|
|
86
86
|
},
|
|
87
87
|
':not(pre) > code[class*="language-"]': {
|
|
88
88
|
padding: ".1em .3em",
|
|
89
89
|
borderRadius: ".3em",
|
|
90
|
-
color: "
|
|
91
|
-
background: "
|
|
90
|
+
color: "var(--sh-inline-code-color)",
|
|
91
|
+
background: "var(--sh-inline-code-background)",
|
|
92
92
|
},
|
|
93
93
|
".namespace": {
|
|
94
|
-
Opacity: ".7"
|
|
94
|
+
Opacity: ".7",
|
|
95
95
|
},
|
|
96
96
|
comment: {
|
|
97
|
-
color: "
|
|
97
|
+
color: "var(--sh-comment-color)",
|
|
98
98
|
},
|
|
99
99
|
prolog: {
|
|
100
|
-
color: "
|
|
100
|
+
color: "var(--sh-comment-color)",
|
|
101
101
|
},
|
|
102
102
|
doctype: {
|
|
103
|
-
color: "
|
|
103
|
+
color: "var(--sh-comment-color)",
|
|
104
104
|
},
|
|
105
105
|
cdata: {
|
|
106
|
-
color: "
|
|
106
|
+
color: "var(--sh-comment-color)",
|
|
107
107
|
},
|
|
108
108
|
punctuation: {
|
|
109
|
-
color: "
|
|
109
|
+
color: "var(--sh-punctuation-color)",
|
|
110
110
|
},
|
|
111
111
|
property: {
|
|
112
|
-
color: "
|
|
112
|
+
color: "var(--sh-property-color)",
|
|
113
113
|
},
|
|
114
114
|
tag: {
|
|
115
|
-
color: "
|
|
115
|
+
color: "var(--sh-property-color)",
|
|
116
116
|
},
|
|
117
117
|
boolean: {
|
|
118
|
-
color: "
|
|
118
|
+
color: "var(--sh-property-color)",
|
|
119
119
|
},
|
|
120
120
|
number: {
|
|
121
|
-
color: "
|
|
121
|
+
color: "var(--sh-property-color)",
|
|
122
122
|
},
|
|
123
123
|
constant: {
|
|
124
|
-
color: "
|
|
124
|
+
color: "var(--sh-property-color)",
|
|
125
125
|
},
|
|
126
126
|
symbol: {
|
|
127
|
-
color: "
|
|
127
|
+
color: "var(--sh-property-color)",
|
|
128
128
|
},
|
|
129
129
|
deleted: {
|
|
130
|
-
color: "
|
|
130
|
+
color: "var(--sh-property-color)",
|
|
131
131
|
},
|
|
132
132
|
selector: {
|
|
133
|
-
color: "
|
|
133
|
+
color: "var(--sh-selector-color)",
|
|
134
134
|
},
|
|
135
135
|
"attr-name": {
|
|
136
|
-
color: "
|
|
136
|
+
color: "var(--sh-selector-color)",
|
|
137
137
|
},
|
|
138
138
|
string: {
|
|
139
|
-
color: "
|
|
139
|
+
color: "var(--sh-selector-color)",
|
|
140
140
|
},
|
|
141
141
|
char: {
|
|
142
|
-
color: "
|
|
142
|
+
color: "var(--sh-selector-color)",
|
|
143
143
|
},
|
|
144
144
|
builtin: {
|
|
145
|
-
color: "
|
|
145
|
+
color: "var(--sh-selector-color)",
|
|
146
146
|
},
|
|
147
147
|
inserted: {
|
|
148
|
-
color: "
|
|
148
|
+
color: "var(--sh-selector-color)",
|
|
149
149
|
},
|
|
150
150
|
operator: {
|
|
151
|
-
color: "
|
|
151
|
+
color: "var(--sh-operator-color)",
|
|
152
|
+
background: "var(--sh-operator-bg)",
|
|
152
153
|
},
|
|
153
154
|
entity: {
|
|
154
|
-
color: "
|
|
155
|
-
|
|
155
|
+
color: "var(--sh-operator-color)",
|
|
156
|
+
background: "var(--sh-operator-bg)",
|
|
157
|
+
cursor: "help",
|
|
156
158
|
},
|
|
157
159
|
url: {
|
|
158
|
-
color: "
|
|
160
|
+
color: "var(--sh-operator-color)",
|
|
161
|
+
background: "var(--sh-operator-bg)",
|
|
159
162
|
},
|
|
160
163
|
".language-css .token.string": {
|
|
161
|
-
color: "
|
|
164
|
+
color: "var(--sh-operator-color)",
|
|
165
|
+
background: "var(--sh-operator-bg)",
|
|
162
166
|
},
|
|
163
167
|
".style .token.string": {
|
|
164
|
-
color: "
|
|
168
|
+
color: "var(--sh-operator-color)",
|
|
169
|
+
background: "var(--sh-operator-bg)",
|
|
165
170
|
},
|
|
166
171
|
atrule: {
|
|
167
|
-
color: "
|
|
172
|
+
color: "var(--sh-keyword-color)",
|
|
168
173
|
},
|
|
169
174
|
"attr-value": {
|
|
170
|
-
color: "
|
|
175
|
+
color: "var(--sh-keyword-color)",
|
|
171
176
|
},
|
|
172
177
|
keyword: {
|
|
173
|
-
color: "
|
|
178
|
+
color: "var(--sh-keyword-color)",
|
|
174
179
|
},
|
|
175
180
|
function: {
|
|
176
|
-
color: "
|
|
181
|
+
color: "var(--sh-function-color)",
|
|
177
182
|
},
|
|
178
183
|
regex: {
|
|
179
|
-
color: "
|
|
184
|
+
color: "var(--sh-variable-color)",
|
|
180
185
|
},
|
|
181
186
|
important: {
|
|
182
|
-
color: "
|
|
183
|
-
fontWeight: "bold"
|
|
187
|
+
color: "var(--sh-variable-color)",
|
|
188
|
+
fontWeight: "bold",
|
|
184
189
|
},
|
|
185
190
|
variable: {
|
|
186
|
-
color: "
|
|
191
|
+
color: "var(--sh-variable-color)",
|
|
187
192
|
},
|
|
188
193
|
bold: {
|
|
189
|
-
fontWeight: "bold"
|
|
194
|
+
fontWeight: "bold",
|
|
190
195
|
},
|
|
191
196
|
title: {
|
|
192
|
-
fontWeight: "bold"
|
|
197
|
+
fontWeight: "bold",
|
|
193
198
|
},
|
|
194
199
|
italic: {
|
|
195
|
-
fontStyle: "italic"
|
|
200
|
+
fontStyle: "italic",
|
|
196
201
|
},
|
|
197
202
|
"pre[data-line]": {
|
|
198
|
-
position: "relative"
|
|
203
|
+
position: "relative",
|
|
199
204
|
},
|
|
200
205
|
'pre[class*="language-"] > code[class*="language-"]': {
|
|
201
206
|
position: "relative",
|
|
202
|
-
zIndex: "1"
|
|
207
|
+
zIndex: "1",
|
|
203
208
|
},
|
|
204
209
|
".line-highlight": {
|
|
205
210
|
position: "absolute",
|
|
@@ -207,11 +212,11 @@ export default {
|
|
|
207
212
|
right: "0",
|
|
208
213
|
padding: "inherit 0",
|
|
209
214
|
marginTop: "1em",
|
|
210
|
-
background: "
|
|
211
|
-
boxShadow: "inset 5px 0 0
|
|
215
|
+
background: "var(--sh-highlight-background)",
|
|
216
|
+
boxShadow: "inset 5px 0 0 var(--sh-highlight-accent)",
|
|
212
217
|
zIndex: "0",
|
|
213
218
|
pointerEvents: "none",
|
|
214
219
|
lineHeight: "inherit",
|
|
215
|
-
whiteSpace: "pre"
|
|
216
|
-
}
|
|
220
|
+
whiteSpace: "pre",
|
|
221
|
+
},
|
|
217
222
|
};
|
|
@@ -38,12 +38,12 @@ const StyledTable = styled(Table)`
|
|
|
38
38
|
}
|
|
39
39
|
`;
|
|
40
40
|
|
|
41
|
-
storiesOf("Table
|
|
41
|
+
storiesOf("Table", module)
|
|
42
42
|
.add("Default", () => (
|
|
43
43
|
<Table
|
|
44
44
|
data={[
|
|
45
45
|
{ firstname: "Tricia", lastname: "McMillan", email: "tricia@hitchhiker.com" },
|
|
46
|
-
{ firstname: "Arthur", lastname: "Dent", email: "arthur@hitchhiker.com" }
|
|
46
|
+
{ firstname: "Arthur", lastname: "Dent", email: "arthur@hitchhiker.com" },
|
|
47
47
|
]}
|
|
48
48
|
>
|
|
49
49
|
<Column header={"First Name"}>{(row: any) => <h4>{row.firstname}</h4>}</Column>
|
|
@@ -63,7 +63,7 @@ storiesOf("Table|Table", module)
|
|
|
63
63
|
>
|
|
64
64
|
{(row: any) => <b style={{ color: "red" }}>{row.lastname}</b>}
|
|
65
65
|
</Column>
|
|
66
|
-
<Column header={"E-Mail"}>{(row: any) => <
|
|
66
|
+
<Column header={"E-Mail"}>{(row: any) => <span>{row.email}</span>}</Column>
|
|
67
67
|
</Table>
|
|
68
68
|
))
|
|
69
69
|
.add("TextColumn", () => (
|
|
@@ -71,7 +71,7 @@ storiesOf("Table|Table", module)
|
|
|
71
71
|
data={[
|
|
72
72
|
{ id: "21", title: "Pommes", desc: "Fried potato sticks" },
|
|
73
73
|
{ id: "42", title: "Quarter-Pounder", desc: "Big burger" },
|
|
74
|
-
{ id: "-84", title: "Icecream", desc: "Cold dessert" }
|
|
74
|
+
{ id: "-84", title: "Icecream", desc: "Cold dessert" },
|
|
75
75
|
]}
|
|
76
76
|
>
|
|
77
77
|
<TextColumn header="Id" dataKey="id" />
|
|
@@ -90,12 +90,12 @@ storiesOf("Table|Table", module)
|
|
|
90
90
|
data={[
|
|
91
91
|
{
|
|
92
92
|
id: "42",
|
|
93
|
-
name: "herp_derp_schlerp_ferp_gerp_nerp_terp_ierp_perp_lerp_merp_oerp_zerp_serp_verp_herp"
|
|
93
|
+
name: "herp_derp_schlerp_ferp_gerp_nerp_terp_ierp_perp_lerp_merp_oerp_zerp_serp_verp_herp",
|
|
94
94
|
},
|
|
95
95
|
{
|
|
96
96
|
id: "17",
|
|
97
|
-
name: "herp_derp_schlerp_ferp_gerp_nerp_terp_ierp_perp_lerp_merp_oerp_zerp_serp_verp"
|
|
98
|
-
}
|
|
97
|
+
name: "herp_derp_schlerp_ferp_gerp_nerp_terp_ierp_perp_lerp_merp_oerp_zerp_serp_verp",
|
|
98
|
+
},
|
|
99
99
|
]}
|
|
100
100
|
emptyMessage="No data found."
|
|
101
101
|
>
|
package/src/table/Table.tsx
CHANGED
|
@@ -127,7 +127,7 @@ const Table: FC<Props> = ({ data, sortable, children, emptyMessage, className })
|
|
|
127
127
|
};
|
|
128
128
|
|
|
129
129
|
Table.defaultProps = {
|
|
130
|
-
sortable: true
|
|
130
|
+
sortable: true,
|
|
131
131
|
};
|
|
132
132
|
|
|
133
133
|
const renderSortIcon = (child: ReactElement, ascending: boolean, showIcon: boolean) => {
|
package/src/table/TextColumn.tsx
CHANGED
|
@@ -83,7 +83,7 @@ describe("text split and replace", () => {
|
|
|
83
83
|
"'So this is it,' said Arthur, 'We are going to die.'",
|
|
84
84
|
[
|
|
85
85
|
{ textToReplace: "'", replacement: { text: "“" }, replaceAll: true },
|
|
86
|
-
{ textToReplace: "Arthur", replacement: { text: "Dent" }, replaceAll: true }
|
|
86
|
+
{ textToReplace: "Arthur", replacement: { text: "Dent" }, replaceAll: true },
|
|
87
87
|
],
|
|
88
88
|
testWrapper
|
|
89
89
|
);
|
|
@@ -106,7 +106,7 @@ describe("text split and replace", () => {
|
|
|
106
106
|
{ textToReplace: "said Arthur", replacement: { text: "to be replaced" } },
|
|
107
107
|
{ textToReplace: " said", replacement: { text: "to be ignored 1" }, replaceAll: true },
|
|
108
108
|
{ textToReplace: "d A", replacement: { text: "to be ignored 2" }, replaceAll: true },
|
|
109
|
-
{ textToReplace: "Arthur,", replacement: { text: "to be ignored 3" }, replaceAll: true }
|
|
109
|
+
{ textToReplace: "Arthur,", replacement: { text: "to be ignored 3" }, replaceAll: true },
|
|
110
110
|
],
|
|
111
111
|
testWrapper
|
|
112
112
|
);
|
|
@@ -122,7 +122,7 @@ describe("text split and replace", () => {
|
|
|
122
122
|
[
|
|
123
123
|
{ textToReplace: "'So this is it,'", replacement: { text: "one" } },
|
|
124
124
|
{ textToReplace: " said Arthur, ", replacement: { text: "two" } },
|
|
125
|
-
{ textToReplace: "'We are going to die.'", replacement: { text: "three" } }
|
|
125
|
+
{ textToReplace: "'We are going to die.'", replacement: { text: "three" } },
|
|
126
126
|
],
|
|
127
127
|
testWrapper
|
|
128
128
|
);
|
|
@@ -36,7 +36,7 @@ type PartToReplace<T> = {
|
|
|
36
36
|
|
|
37
37
|
function hasConflict<T>(alreadyFoundReplacements: PartToReplace<T>[], newReplacement: PartToReplace<T>) {
|
|
38
38
|
return !!alreadyFoundReplacements.find(
|
|
39
|
-
existing =>
|
|
39
|
+
(existing) =>
|
|
40
40
|
(existing.start <= newReplacement.start && existing.start + existing.length > newReplacement.start) ||
|
|
41
41
|
(newReplacement.start <= existing.start && newReplacement.start + newReplacement.length > existing.start)
|
|
42
42
|
);
|
|
@@ -49,7 +49,7 @@ export default function textSplitAndReplace<T>(
|
|
|
49
49
|
): T[] {
|
|
50
50
|
const partsToReplace: PartToReplace<T>[] = [];
|
|
51
51
|
|
|
52
|
-
replacements.forEach(replacement => {
|
|
52
|
+
replacements.forEach((replacement) => {
|
|
53
53
|
let lastIndex = -1;
|
|
54
54
|
do {
|
|
55
55
|
const start = text.indexOf(replacement.textToReplace, lastIndex);
|
package/src/toast/Toast.tsx
CHANGED
|
@@ -38,8 +38,8 @@ const Container = styled.div<Themeable>`
|
|
|
38
38
|
padding: 1.5rem;
|
|
39
39
|
right: 1.5rem;
|
|
40
40
|
bottom: 1.5rem;
|
|
41
|
-
color: ${props => props.theme.primary};
|
|
42
|
-
background-color: ${props => props.theme.secondary};
|
|
41
|
+
color: ${(props) => props.theme.primary};
|
|
42
|
+
background-color: ${(props) => props.theme.secondary};
|
|
43
43
|
max-width: 18rem;
|
|
44
44
|
font-size: 0.75rem;
|
|
45
45
|
border-radius: 5px;
|
|
@@ -77,7 +77,7 @@ const Closeable = () => {
|
|
|
77
77
|
toastStories.add("Open/Close", () => <Animator />);
|
|
78
78
|
toastStories.add("Click to close", () => <Closeable />);
|
|
79
79
|
|
|
80
|
-
types.forEach(type => {
|
|
80
|
+
types.forEach((type) => {
|
|
81
81
|
toastStories.add(type.charAt(0).toUpperCase() + type.slice(1), () => (
|
|
82
82
|
<Toast type={type} title="New Changes">
|
|
83
83
|
<p>The underlying Pull-Request has changed. Press reload to see the changes.</p>
|
|
@@ -92,7 +92,7 @@ types.forEach(type => {
|
|
|
92
92
|
|
|
93
93
|
toastStories.add("Multiple", () => (
|
|
94
94
|
<ToastArea>
|
|
95
|
-
{types.map(type => (
|
|
95
|
+
{types.map((type) => (
|
|
96
96
|
<ToastNotification key={type} type={type} title="New notification">
|
|
97
97
|
<p>The notification received.</p>
|
|
98
98
|
</ToastNotification>
|
package/src/toast/themes.ts
CHANGED
|
@@ -42,28 +42,28 @@ const themes: { [name in Type]: ToastTheme } = {
|
|
|
42
42
|
info: {
|
|
43
43
|
primary: "#363636",
|
|
44
44
|
secondary: "#99d8f3",
|
|
45
|
-
tertiary: "white"
|
|
45
|
+
tertiary: "white",
|
|
46
46
|
},
|
|
47
47
|
primary: {
|
|
48
48
|
primary: "#363636",
|
|
49
49
|
secondary: "#7fe8ef",
|
|
50
|
-
tertiary: "white"
|
|
50
|
+
tertiary: "white",
|
|
51
51
|
},
|
|
52
52
|
success: {
|
|
53
53
|
primary: "#363636",
|
|
54
54
|
secondary: "#7fe3cd",
|
|
55
|
-
tertiary: "white"
|
|
55
|
+
tertiary: "white",
|
|
56
56
|
},
|
|
57
57
|
warning: {
|
|
58
58
|
primary: "#905515",
|
|
59
59
|
secondary: "#ffeeab",
|
|
60
|
-
tertiary: "white"
|
|
60
|
+
tertiary: "white",
|
|
61
61
|
},
|
|
62
62
|
danger: {
|
|
63
63
|
primary: "#363636",
|
|
64
64
|
secondary: "#ff9baf",
|
|
65
|
-
tertiary: "white"
|
|
66
|
-
}
|
|
65
|
+
tertiary: "white",
|
|
66
|
+
},
|
|
67
67
|
};
|
|
68
68
|
|
|
69
69
|
export const getTheme = (name: Type) => {
|
package/src/useDateFormatter.ts
CHANGED
|
@@ -34,7 +34,7 @@ export const supportedLocales: LocaleMap = {
|
|
|
34
34
|
enUS,
|
|
35
35
|
en: enUS,
|
|
36
36
|
de,
|
|
37
|
-
es
|
|
37
|
+
es,
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
type Options = {
|
|
@@ -77,7 +77,7 @@ export type DateProps = {
|
|
|
77
77
|
const createOptions = (locale: Locale, timeZone?: string) => {
|
|
78
78
|
const options: Options = {
|
|
79
79
|
addSuffix: true,
|
|
80
|
-
locale
|
|
80
|
+
locale,
|
|
81
81
|
};
|
|
82
82
|
if (timeZone) {
|
|
83
83
|
options.timeZone = timeZone;
|
|
@@ -119,7 +119,7 @@ const useDateFormatter = ({ date, baseDate, timeZone }: DateProps) => {
|
|
|
119
119
|
},
|
|
120
120
|
formatDistance() {
|
|
121
121
|
return formatDistance(isoDate, base, options);
|
|
122
|
-
}
|
|
122
|
+
},
|
|
123
123
|
};
|
|
124
124
|
};
|
|
125
125
|
|
package/src/validation.test.ts
CHANGED
|
@@ -40,7 +40,7 @@ describe("test name validation", () => {
|
|
|
40
40
|
" invalid_name",
|
|
41
41
|
"%",
|
|
42
42
|
"test%name",
|
|
43
|
-
"test\\name"
|
|
43
|
+
"test\\name",
|
|
44
44
|
];
|
|
45
45
|
for (const name of invalidNames) {
|
|
46
46
|
it(`should return false for '${name}'`, () => {
|
|
@@ -75,7 +75,7 @@ describe("test name validation", () => {
|
|
|
75
75
|
"법률",
|
|
76
76
|
"المدن",
|
|
77
77
|
"אחד",
|
|
78
|
-
"Hu-rëm"
|
|
78
|
+
"Hu-rëm",
|
|
79
79
|
];
|
|
80
80
|
for (const name of validNames) {
|
|
81
81
|
it(`should return true for '${name}'`, () => {
|
|
@@ -92,7 +92,7 @@ describe("test mail validation", () => {
|
|
|
92
92
|
"s.sdorra@",
|
|
93
93
|
"s.sdorra@ostfalia",
|
|
94
94
|
"s.sdorra@ ostfalia.de",
|
|
95
|
-
"s.sdorra@[ostfalia.de"
|
|
95
|
+
"s.sdorra@[ostfalia.de",
|
|
96
96
|
];
|
|
97
97
|
for (const mail of invalid) {
|
|
98
98
|
it(`should return false for '${mail}'`, () => {
|
|
@@ -111,7 +111,7 @@ describe("test mail validation", () => {
|
|
|
111
111
|
"s.sdorra@example.xn--p1ai",
|
|
112
112
|
"s.sdorra@scm.solutions",
|
|
113
113
|
"s'sdorra@scm.solutions",
|
|
114
|
-
'"S Sdorra"@scm.solutions'
|
|
114
|
+
'"S Sdorra"@scm.solutions',
|
|
115
115
|
];
|
|
116
116
|
for (const mail of valid) {
|
|
117
117
|
it(`should return true for '${mail}'`, () => {
|
|
@@ -172,7 +172,7 @@ describe("test url validation", () => {
|
|
|
172
172
|
":// should fail",
|
|
173
173
|
"http://foo.bar/foo(bar)baz quux",
|
|
174
174
|
"http://.www.foo.bar/",
|
|
175
|
-
"http://.www.foo.bar./"
|
|
175
|
+
"http://.www.foo.bar./",
|
|
176
176
|
];
|
|
177
177
|
for (const url of invalid) {
|
|
178
178
|
it(`should return false for '${url}'`, () => {
|
|
@@ -225,7 +225,7 @@ describe("test url validation", () => {
|
|
|
225
225
|
"http://1337.net",
|
|
226
226
|
"http://a.b-c.de",
|
|
227
227
|
"http://223.255.255.254",
|
|
228
|
-
"http://0.0.0.0"
|
|
228
|
+
"http://0.0.0.0",
|
|
229
229
|
];
|
|
230
230
|
for (const url of valid) {
|
|
231
231
|
it(`should return true for '${url}'`, () => {
|
package/src/validation.ts
CHANGED
|
@@ -45,10 +45,7 @@ export const isNumberValid = (number: any) => {
|
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
export const isPathValid = (path: string) => {
|
|
48
|
-
return path !== "."
|
|
49
|
-
&& !path.includes("../")
|
|
50
|
-
&& !path.includes("//")
|
|
51
|
-
&& path !== "..";
|
|
48
|
+
return path !== "." && !path.includes("../") && !path.includes("//") && path !== "..";
|
|
52
49
|
};
|
|
53
50
|
|
|
54
51
|
const urlRegex = /^[A-Za-z0-9]+:\/\/[^\s$.?#].[^\s]*$/;
|