Skip to content

Commit 3dc3cf3

Browse files
committed
fixup!
1 parent 690995d commit 3dc3cf3

4 files changed

Lines changed: 8 additions & 36 deletions

File tree

src/generators/jsx-ast/constants.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ export const TYPES_WITH_METHOD_SIGNATURES = [
161161
'classMethod',
162162
];
163163

164-
// Regex to trim leading whitespace and colons from strings
165-
export const TRIMMABLE_PADDING_REGEX = /^[\s:]+/;
164+
// Regex to trim leading whitespace, colons, and hyphens from strings
165+
export const TRIMMABLE_PADDING_REGEX = /^[\s:-]+/;
166166

167167
// Patterns to map deprecation "Type" text to AlertBox levels.
168168
// Order matters: first match wins.

src/generators/jsx-ast/utils/signature.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export const createSignatureTable = (node, remark) => {
141141
const items = parseListIntoProperties(node, remark);
142142

143143
return createJSXElement(JSX_IMPORTS.FunctionSignature.name, {
144-
title: items.length === 1 && !items[0].name ? 'Type' : 'Attributes',
144+
title: items.length > 1 ? 'Attributes' : undefined,
145145
items,
146146
});
147147
};

src/generators/jsx-ast/utils/types.mjs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,11 @@ export const extractPropertyName = (nodes, current) => {
7676
first.value = first.value.slice(match[0].length);
7777
shiftIfBlankText(nodes);
7878

79-
// "Type" itself is not a property name, only a type annotation hint
80-
const label = match[1] !== 'Type' && match[1];
81-
82-
if (label) {
83-
current.name = label;
84-
current.kind = label === 'Returns' ? 'return' : label.toLowerCase();
79+
if (match[1]) {
80+
current.name = match[1];
81+
// NOTE: We currently only have one "kind". Should others be added for other
82+
// starters, just replace the `undefined` with the other kinds.
83+
current.kind = match[1] === 'Returns' ? 'return' : undefined;
8584
}
8685
};
8786

src/generators/web/ui/index.css

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -16,33 +16,6 @@ main {
1616
word-break: break-word;
1717
}
1818

19-
/* Don't overflow the parent */
20-
.overflow-container {
21-
overflow-x: auto;
22-
width: 100%;
23-
table td a + a {
24-
margin-right: 0;
25-
}
26-
}
27-
28-
table {
29-
td {
30-
word-break: break-all;
31-
}
32-
33-
/* In tables, don't pad `a` elements */
34-
a {
35-
padding-right: unset;
36-
}
37-
38-
@media (min-width: 1024px) {
39-
td code {
40-
overflow-wrap: normal;
41-
word-break: normal;
42-
}
43-
}
44-
}
45-
4619
/* Change history positioning */
4720
div:has(> h1, > h2, > h3, > h4, > h5, > h6) {
4821
display: flex;

0 commit comments

Comments
 (0)