Skip to content

Commit 8f3212d

Browse files
fix: added semantic markup, strong instead of font-weight (#1062)
Co-authored-by: Cody's Dad <40604284+AceTheCreator@users.noreply.github.com>
1 parent d4bc82e commit 8f3212d

File tree

9 files changed

+51
-51
lines changed

9 files changed

+51
-51
lines changed

library/src/components/Bindings.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ export const Bindings: React.FunctionComponent<Props> = ({
2525
const schemaName = (
2626
<div className="inline-block text-sm">
2727
<span>{name}</span>
28-
<span className="bg-teal-500 font-bold no-underline text-white uppercase rounded mx-2 px-2 py-1 text-xs">
28+
<strong className="bg-teal-500 no-underline text-white uppercase rounded mx-2 px-2 py-1 text-xs">
2929
{protocol}
30-
</span>
30+
</strong>
3131
</div>
3232
);
3333
return (

library/src/components/Schema.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -160,37 +160,37 @@ export const Schema: React.FunctionComponent<Props> = ({
160160
</div>
161161
<div className="inline-block">
162162
{schema.format() && (
163-
<span className="bg-yellow-600 font-bold no-underline text-white rounded lowercase mr-2 p-1 text-xs">
163+
<strong className="bg-yellow-600 no-underline text-white rounded lowercase mr-2 p-1 text-xs">
164164
format: {schema.format()}
165-
</span>
165+
</strong>
166166
)}
167167

168168
{/* related to string */}
169169
{schema.pattern() !== undefined && (
170-
<span className="bg-yellow-600 font-bold no-underline text-white rounded mr-2 p-1 text-xs">
170+
<strong className="bg-yellow-600 no-underline text-white rounded mr-2 p-1 text-xs">
171171
must match: {schema.pattern()}
172-
</span>
172+
</strong>
173173
)}
174174
{schema.contentMediaType() !== undefined && (
175-
<span className="bg-yellow-600 font-bold no-underline text-white rounded lowercase mr-2 p-1 text-xs">
175+
<strong className="bg-yellow-600 no-underline text-white rounded lowercase mr-2 p-1 text-xs">
176176
media type: {schema.contentMediaType()}
177-
</span>
177+
</strong>
178178
)}
179179
{schema.contentEncoding() !== undefined && (
180-
<span className="bg-yellow-600 font-bold no-underline text-white rounded lowercase mr-2 p-1 text-xs">
180+
<strong className="bg-yellow-600 no-underline text-white rounded lowercase mr-2 p-1 text-xs">
181181
encoding: {schema.contentEncoding()}
182-
</span>
182+
</strong>
183183
)}
184184

185185
{/* constraints */}
186186
{!!constraints.length &&
187187
constraints.map((c) => (
188-
<span
189-
className="bg-purple-600 font-bold no-underline text-white rounded lowercase mr-2 p-1 text-xs"
188+
<strong
189+
className="bg-purple-600 no-underline text-white rounded lowercase mr-2 p-1 text-xs"
190190
key={c}
191191
>
192192
{c}
193-
</span>
193+
</strong>
194194
))}
195195

196196
{uid && !uid.startsWith('<anonymous-') && (
@@ -244,14 +244,14 @@ export const Schema: React.FunctionComponent<Props> = ({
244244
</div>
245245
)}
246246
{externalDocs && (
247-
<span className="border border-solid border-orange-300 hover:bg-orange-300 hover:text-orange-600 text-orange-500 font-bold no-underline text-xs uppercase rounded px-2 py-0">
247+
<strong className="border border-solid border-orange-300 hover:bg-orange-300 hover:text-orange-600 text-orange-500 no-underline text-xs uppercase rounded px-2 py-0">
248248
<Href
249249
href={externalDocs.url()}
250250
title={externalDocs.description() ?? ''}
251251
>
252252
Documentation
253253
</Href>
254-
</span>
254+
</strong>
255255
)}
256256
{schema.examples() && (
257257
<ul className="text-xs">

library/src/containers/Info/Info.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ export const Info: React.FunctionComponent = () => {
4646
<span>{license.name()}</span>
4747
</Href>
4848
) : (
49-
<span className="border border-solid border-orange-300 hover:bg-orange-300 hover:text-orange-600 text-orange-500 font-bold no-underline text-xs uppercase rounded px-3 py-1">
49+
<strong className="border border-solid border-orange-300 hover:bg-orange-300 hover:text-orange-600 text-orange-500 no-underline text-xs uppercase rounded px-3 py-1">
5050
{license.name()}
51-
</span>
51+
</strong>
5252
)}
5353
</li>
5454
)}
@@ -108,9 +108,9 @@ export const Info: React.FunctionComponent = () => {
108108
)}
109109
{specId && (
110110
<li className="inline-block mt-2 mr-2">
111-
<span className="border border-solid border-blue-300 hover:bg-blue-300 hover:text-blue-600 text-blue-500 font-bold no-underline text-xs uppercase rounded px-3 py-1">
111+
<strong className="border border-solid border-blue-300 hover:bg-blue-300 hover:text-blue-600 text-blue-500 no-underline text-xs uppercase rounded px-3 py-1">
112112
ID: {specId}
113-
</span>
113+
</strong>
114114
</li>
115115
)}
116116
</ul>

library/src/containers/Messages/Message.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export const Message: React.FunctionComponent<Props> = ({
5555
<div className="shadow rounded bg-gray-200 p-4 border">
5656
<div>
5757
{index !== undefined && (
58-
<span className="text-gray-700 font-bold mr-2">#{index}</span>
58+
<strong className="text-gray-700 mr-2">#{index}</strong>
5959
)}
6060
{title && <span className="text-gray-700 mr-2">{title}</span>}
6161
<span className="border text-orange-600 rounded text-xs py-0 px-2">

library/src/containers/Operations/Operation.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ export const OperationReplyInfo: React.FunctionComponent<Props> = (props) => {
262262
: 'bg-blue-600 border-blue-600'
263263
} text-sm rounded-t h-8 px-4 border text-white flex items-center`}
264264
>
265-
<span className="font-bold">REPLY INFORMATION</span>
265+
<strong>REPLY INFORMATION</strong>
266266
</div>
267267
<div className="flex">
268268
<div

library/src/containers/Servers/Security.tsx

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -130,22 +130,22 @@ const SecurityItem: React.FunctionComponent<SecurityItemProps> = ({
130130
<div className="px-4 py-2 ml-2 mb-2 border border-gray-400 bg-gray-100 rounded">
131131
{securityProtocol && (
132132
<div className="mt-1">
133-
<span className="text-xs font-bold text-gray-600 mt-1 mr-1 uppercase">
133+
<strong className="text-xs text-gray-600 mt-1 mr-1 uppercase">
134134
security.protocol:
135-
</span>
136-
<span className="inline-block font-bold no-underline bg-indigo-400 text-white text-xs rounded py-0 px-1 ml-1">
135+
</strong>
136+
<strong className="inline-block no-underline bg-indigo-400 text-white text-xs rounded py-0 px-1 ml-1">
137137
{securityProtocol}
138-
</span>
138+
</strong>
139139
</div>
140140
)}
141141
{saslMechanism && (
142142
<div className="mt-1">
143-
<span className="text-xs font-bold text-gray-600 mt-1 mr-1 uppercase">
143+
<strong className="text-xs text-gray-600 mt-1 mr-1 uppercase">
144144
sasl.mechanism:
145-
</span>
146-
<span className="inline-block font-bold no-underline bg-indigo-400 text-white text-xs rounded py-0 px-1 ml-1">
145+
</strong>
146+
<strong className="inline-block no-underline bg-indigo-400 text-white text-xs rounded py-0 px-1 ml-1">
147147
{saslMechanism}
148-
</span>
148+
</strong>
149149
</div>
150150
)}
151151
</div>
@@ -179,49 +179,49 @@ const SecurityItem: React.FunctionComponent<SecurityItemProps> = ({
179179
key={flowName}
180180
>
181181
<div>
182-
<span className="text-xs font-bold text-gray-600 mt-1 mr-1 uppercase">
182+
<strong className="text-xs text-gray-600 mt-1 mr-1 uppercase">
183183
Flow:
184-
</span>
185-
<span className="text-xs font-bold text-gray-600 mt-1 mr-1 uppercase">
184+
</strong>
185+
<strong className="text-xs text-gray-600 mt-1 mr-1 uppercase">
186186
{ServerHelpers.flowName(flowName)}
187-
</span>
187+
</strong>
188188
</div>
189189

190190
{authorizationUrl && (
191191
<div className="mt-1">
192-
<span className="text-xs font-bold text-gray-600 mt-1 mr-1 uppercase">
192+
<strong className="text-xs text-gray-600 mt-1 mr-1 uppercase">
193193
Auth URL:
194-
</span>
194+
</strong>
195195
<Href href={authorizationUrl} className="underline">
196196
{authorizationUrl}
197197
</Href>
198198
</div>
199199
)}
200200
{tokenUrl && (
201201
<div className="mt-1">
202-
<span className="text-xs font-bold text-gray-600 mt-1 mr-1 uppercase">
202+
<strong className="text-xs text-gray-600 mt-1 mr-1 uppercase">
203203
Token URL:
204-
</span>
204+
</strong>
205205
<Href href={tokenUrl} className="underline">
206206
{tokenUrl}
207207
</Href>
208208
</div>
209209
)}
210210
{refreshUrl && (
211211
<div className="mt-1">
212-
<span className="text-xs font-bold text-gray-600 mt-1 mr-1 uppercase">
212+
<strong className="text-xs text-gray-600 mt-1 mr-1 uppercase">
213213
Refresh URL:
214-
</span>
214+
</strong>
215215
<Href href={refreshUrl} className="underline">
216216
{refreshUrl}
217217
</Href>
218218
</div>
219219
)}
220220
{scopes && (
221221
<div className="mt-1">
222-
<span className="text-xs font-bold text-gray-600 mt-1 mr-1 uppercase">
222+
<strong className="text-xs text-gray-600 mt-1 mr-1 uppercase">
223223
Scopes:
224-
</span>
224+
</strong>
225225
<ul className="inline-block">
226226
{scopes &&
227227
Object.entries(scopes).map(([scopeName, scopeDesc]) => (

library/src/containers/Servers/Server.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ export const Server: React.FunctionComponent<Props> = ({
3434
<div className="shadow rounded bg-gray-200 p-4 border bg-gray-100">
3535
<div>
3636
<span className="font-mono text-base">{server.url()}</span>
37-
<span className="bg-teal-500 font-bold no-underline text-white uppercase rounded mx-2 px-2 py-1 text-sm">
37+
<strong className="bg-teal-500 no-underline text-white uppercase rounded mx-2 px-2 py-1 text-sm">
3838
{protocolVersion
3939
? `${server.protocol()} ${protocolVersion}`
4040
: server.protocol()}
41-
</span>
42-
<span className="bg-blue-500 font-bold no-underline text-white uppercase rounded px-2 py-1 text-sm">
41+
</strong>
42+
<strong className="bg-blue-500 no-underline text-white uppercase rounded px-2 py-1 text-sm">
4343
{serverName}
44-
</span>
44+
</strong>
4545
</div>
4646

4747
{server.hasDescription() && (

library/src/containers/Sidebar/Sidebar.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,12 +356,12 @@ const OperationItem: React.FunctionComponent<OperationItemProps> = ({
356356
href={`#${operationHrefId}`}
357357
onClick={() => setShowSidebar(false)}
358358
>
359-
<span
360-
className={`font-bold h-6 no-underline text-white uppercase p-1 mr-2 rounded text-xs ${bgColors.includes(backgroundColor) && backgroundColor}`}
359+
<strong
360+
className={`h-6 no-underline text-white uppercase p-1 mr-2 rounded text-xs ${bgColors.includes(backgroundColor) && backgroundColor}`}
361361
title={typeLabel}
362362
>
363363
{typeLabel}
364-
</span>
364+
</strong>
365365
<span className="break-all inline-block">{label}</span>
366366
</a>
367367
</li>

library/src/containers/Sidebar/__tests__/SideBar.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,10 @@ describe('Sidebar component', () => {
121121
'smartylighting.streetlights.1.0.action.{streetlightId}.dim',
122122
];
123123
for (let i = 0; i < operations.length; i++) {
124+
const description = operations[i].querySelector('span');
125+
124126
// eslint-disable-next-line jest/no-standalone-expect
125-
expect(operations[i].querySelectorAll('span')[1].textContent).toBe(
126-
expectedOperationDescriptions[i],
127-
);
127+
expect(description?.textContent).toBe(expectedOperationDescriptions[i]);
128128
}
129129
});
130130
});

0 commit comments

Comments
 (0)