Skip to content

Commit 97fea1c

Browse files
authored
Merge branch 'webpack:main' into fix-search-icon-color
2 parents 393bc83 + 29288b2 commit 97fea1c

File tree

28 files changed

+256
-498
lines changed

28 files changed

+256
-498
lines changed

src/components/Configuration/Configuration.scss

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/components/Configuration/components.jsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import PropTypes from "prop-types";
22
import { Component, isValidElement } from "react";
33
import Popover from "react-tiny-popover";
4-
import "./Configuration.scss";
54

65
const DEFAULT_CHILDREN_SIZE = 4;
76

@@ -17,9 +16,14 @@ const addLink = (child, i, url) =>
1716
) : (
1817
child
1918
);
19+
2020
const Card = ({ body }) => (
21-
<div className="markdown">
22-
<pre className="inline">
21+
// Applied .shadow > .markdown styles: max-height and overflow
22+
<div className="markdown max-h-[48vh] overflow-auto">
23+
{/* Combined .inline and .shadow pre.inline styles:
24+
display: block, margin: 0, padding: 0 with right-padding override
25+
*/}
26+
<pre className="block m-0 p-0 pr-[15px]">
2327
<code>{body}</code>
2428
</pre>
2529
</div>
@@ -83,7 +87,8 @@ export class Details extends Component {
8387
position={["right", "top"]}
8488
padding={0}
8589
onClickOutside={this.clickOutsideHandler}
86-
containerClassName={"shadow"}
90+
// Replaced .shadow with Tailwind equivalents, including the custom rgba box-shadow
91+
containerClassName="overflow-visible rounded shadow-[-1px_1px_10px_0_rgba(255,255,255,0.44)]"
8792
content={<Card body={content} />}
8893
>
8994
<span
Lines changed: 45 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import PropTypes from "prop-types";
22
import { Component } from "react";
33

4-
import "./Dropdown.scss";
5-
64
export default class Dropdown extends Component {
75
static propTypes = {
86
className: PropTypes.string,
@@ -14,56 +12,53 @@ export default class Dropdown extends Component {
1412
};
1513

1614
componentDidMount() {
17-
this._boundCloseOnEsc = this._closeDropdownOnEsc.bind(this);
18-
this._boundCloseLostFocus = this._closeDropdownIfFocusLost.bind(this);
19-
20-
document.addEventListener("keyup", this._boundCloseOnEsc, true);
21-
document.addEventListener("focus", this._boundCloseLostFocus, true);
22-
document.addEventListener("click", this._boundCloseLostFocus, true);
15+
document.addEventListener("keyup", this._closeDropdownOnEsc, true);
16+
document.addEventListener("focus", this._closeDropdownIfFocusLost, true);
17+
document.addEventListener("click", this._closeDropdownIfFocusLost, true);
2318
}
2419

2520
componentWillUnmount() {
26-
document.removeEventListener("keyup", this._boundCloseOnEsc, true);
27-
document.removeEventListener("focus", this._boundCloseLostFocus, true);
28-
document.removeEventListener("click", this._boundCloseLostFocus, true);
21+
document.removeEventListener("keyup", this._closeDropdownOnEsc, true);
22+
document.removeEventListener("focus", this._closeDropdownIfFocusLost, true);
23+
document.removeEventListener("click", this._closeDropdownIfFocusLost, true);
2924
}
3025

31-
_closeDropdownOnEsc(event) {
26+
_closeDropdownOnEsc = (event) => {
3227
if (event.key === "Escape" && this.state.active) {
3328
this.setState({ active: false }, () => {
3429
this.dropdownButton.focus();
3530
});
3631
}
37-
}
32+
};
3833

39-
_closeDropdownIfFocusLost(event) {
34+
_closeDropdownIfFocusLost = (event) => {
4035
if (this.state.active && !this.dropdown.contains(event.target)) {
4136
this.setState({ active: false });
4237
}
43-
}
38+
};
4439

4540
render() {
4641
const { className = "", items = [] } = this.props;
47-
const activeMod = this.state.active ? "dropdown__list--active" : "";
4842

4943
return (
5044
<nav
51-
className={`dropdown ${className}`}
45+
className={`relative ${className}`}
5246
ref={(el) => (this.dropdown = el)}
53-
onMouseOver={this._toggle.bind(this, true)}
54-
onMouseLeave={this._toggle.bind(this, false)}
47+
onMouseOver={this._handleMouseOver}
48+
onMouseLeave={this._handleMouseLeave}
5549
>
5650
<button
5751
ref={(el) => (this.dropdownButton = el)}
5852
aria-haspopup="true"
5953
aria-expanded={String(this.state.active)}
6054
aria-label="Select language"
61-
onClick={this._handleClick.bind(this)}
55+
onClick={this._handleClick}
56+
className="cursor-pointer text-white border-none bg-transparent m-0 p-0 text-[length:inherit] flex items-center"
6257
>
6358
<svg
6459
viewBox="0 0 610 560"
6560
xmlns="http://www.w3.org/2000/svg"
66-
className="dropdown__language text-gray-100 hover:text-blue-200 transition-colors duration-200"
61+
className="w-20 h-20 align-middle text-gray-100 hover:text-blue-200 transition-colors duration-200"
6762
>
6863
<path d="m304.8 99.2-162.5-57.3v353.6l162.5-52.6z" />
6964
<path
@@ -91,25 +86,32 @@ export default class Dropdown extends Component {
9186
</svg>
9287
{/* Commented out until media breakpoints are in place
9388
<span>{ items[0].title }</span> */}
94-
<i aria-hidden="true" className="dropdown__arrow" />
89+
<i aria-hidden="true" className="leading-none before:content-['▾']" />
9590
</button>
96-
<div className={`dropdown__list ${activeMod}`}>
97-
<ul>
91+
<div
92+
className={`${
93+
this.state.active ? "block" : "hidden"
94+
} absolute top-full right-0 text-[13px] bg-[#526b78] rounded-md shadow-[0_4px_12px_rgba(0,0,0,0.4)] z-[9999]`}
95+
>
96+
<ul className="pt-1">
9897
{items.map((item, i) => (
99-
<li key={item.title}>
98+
<li
99+
key={item.title}
100+
className="py-1 px-2 list-none text-white transition-all duration-[250ms] hover:bg-[#175d96]"
101+
>
100102
<a
101-
onKeyDown={this._handleArrowKeys.bind(
102-
this,
103-
i,
104-
items.length - 1,
105-
)}
103+
onKeyDown={(event) =>
104+
this._handleArrowKeys(i, items.length - 1, event)
105+
}
106106
ref={(node) =>
107107
this.links ? this.links.push(node) : (this.links = [node])
108108
}
109109
href={item.url}
110-
className="px-5 block"
110+
className="px-5 block text-white visited:text-white hover:text-white"
111111
>
112-
<span lang={item.lang}>{item.title}</span>
112+
<span lang={item.lang} className="align-top text-left">
113+
{item.title}
114+
</span>
113115
</a>
114116
</li>
115117
))}
@@ -119,7 +121,7 @@ export default class Dropdown extends Component {
119121
);
120122
}
121123

122-
_handleArrowKeys(currentIndex, lastIndex, event) {
124+
_handleArrowKeys = (currentIndex, lastIndex, event) => {
123125
if (["ArrowDown", "ArrowUp"].includes(event.key)) {
124126
event.preventDefault();
125127
}
@@ -140,24 +142,21 @@ export default class Dropdown extends Component {
140142
}
141143

142144
this.links[newIndex].focus();
143-
}
145+
};
144146

145-
_handleClick() {
147+
_handleClick = () => {
146148
this.setState({ active: !this.state.active }, () => {
147149
if (this.state.active) {
148150
this.links[0].focus();
149151
}
150152
});
151-
}
153+
};
152154

153-
/**
154-
* Toggle visibility of dropdown items
155-
*
156-
* @param {boolean} state - Whether to display or hide the items
157-
*/
158-
_toggle(state = false) {
159-
this.setState({
160-
active: state,
161-
});
162-
}
155+
_handleMouseOver = () => {
156+
this.setState({ active: true });
157+
};
158+
159+
_handleMouseLeave = () => {
160+
this.setState({ active: false });
161+
};
163162
}

src/components/Dropdown/Dropdown.scss

Lines changed: 0 additions & 73 deletions
This file was deleted.

src/components/Footer/Footer.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const footerLinkClasses =
99
"text-[11px] uppercase text-[#777676] hover:text-[#333333]";
1010

1111
const Footer = () => (
12-
<footer className="w-full flex-[0_0_auto]">
12+
<footer className="w-full flex-[0_0_auto] print:hidden">
1313
<Container className="mx-auto max-w-[900px] px-5 pb-[30px] pt-[40px] text-center [&_a]:text-[#3b7eb5]">
1414
<div className="mb-[24px] flex justify-center">
1515
<a href="https://openjsf.org" target="_blank" rel="noopener noreferrer">

src/components/Navigation/Navigation.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ function Navigation({ links, pathname, hash = "", toggleSidebar }) {
128128

129129
return (
130130
<>
131-
<header className="bg-blue-800 dark:bg-gray-900">
131+
<header className="bg-blue-800 dark:bg-gray-900 print:hidden">
132132
<div className="flex items-center py-10 px-[16px] justify-between md:px-[24px] md:max-w-[1024px] md:mx-auto md:justify-start">
133133
<button
134134
aria-label="Toggle navigation menu"

src/components/OfflineBanner/OfflineBanner.jsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { useEffect, useState } from "react";
22
import isClient from "../../utilities/is-client.js";
3-
import "./OfflineBanner.scss";
43

54
export default function OfflineBanner() {
65
const [online, setOnline] = useState(() =>
@@ -26,21 +25,21 @@ export default function OfflineBanner() {
2625

2726
return (
2827
<div
29-
className="offline-banner"
28+
className="flex items-center justify-center px-20 py-[8px] bg-blue-600 text-white text-14 font-medium text-center border-b border-blue-800"
3029
role="status"
3130
aria-live="polite"
3231
data-testid="offline-banner"
3332
>
34-
<div className="offline-banner__content">
33+
<div className="flex items-center gap-[8px]">
3534
<svg
36-
className="offline-banner__icon"
35+
className="shrink-0 w-[16px] h-[16px] fill-blue-200"
3736
aria-hidden="true"
3837
viewBox="0 0 24 24"
3938
xmlns="http://www.w3.org/2000/svg"
4039
>
4140
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z" />
4241
</svg>
43-
<span className="offline-banner__text">
42+
<span className="tracking-[0.01em]">
4443
You are currently offline. Some features may be unavailable.
4544
</span>
4645
</div>

src/components/OfflineBanner/OfflineBanner.scss

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)