Skip to content

Commit 5833735

Browse files
committed
pr feedback
2 parents 743e378 + 4ef461c commit 5833735

126 files changed

Lines changed: 6201 additions & 521 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ Remove or strikethrough items that do not apply to your PR.
2626
- [ ] A **[changelog](https://github.com/elastic/eui/blob/main/wiki/contributing-to-eui/documenting/changelogs.md)** entry exists and is marked appropriately.
2727
- [ ] If applicable, added the **breaking change** issue label (and filled out the breaking change checklist)
2828
- Designer checklist
29-
- [ ] Updated the **[Figma](https://www.figma.com/community/file/964536385682658129)** library counterpart
29+
- [ ] If applicable, [file an issue](https://github.com/elastic/platform-ux-team/issues/new/choose) to update [EUI's Figma library](https://www.figma.com/community/file/964536385682658129) with any corresponding UI changes. _(This is an internal repo, if you are external to Elastic, ask a maintainer to submit this request)_
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
diff --git a/base.d.ts b/base.d.ts
2+
index 67d7514cc700338442c49cb1fcdf868d5ef3bf67..ec12157f934136844ff5973811022fd3563fed09 100755
3+
--- a/base.d.ts
4+
+++ b/base.d.ts
5+
@@ -191,7 +191,9 @@ declare module "jsdom" {
6+
7+
/* ECMAScript Globals */
8+
globalThis: DOMWindow;
9+
+ // @ts-ignore This fails on TypeScript 4.x
10+
readonly ["Infinity"]: number;
11+
+ // @ts-ignore This fails on TypeScript 4.x
12+
readonly ["NaN"]: number;
13+
readonly undefined: undefined;
14+

.yarnrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ nodeLinker: node-modules
22

33
yarnPath: .yarn/releases/yarn-4.2.2.cjs
44

5-
nmHoistingLimits: workspaces
5+
nmHoistingLimits: none
66

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
"@types/react": "^18",
3131
"react-focus-lock": "2.9.5",
3232
"@babel/core": "^7.21.8",
33-
"jsdom": "24.1.0"
33+
"jsdom": "24.1.0",
34+
"@types/jsdom@npm:^20.0.0": "patch:@types/jsdom@npm%3A20.0.1#~/.yarn/patches/@types-jsdom-npm-20.0.1-5bb899e006.patch"
3435
},
3536
"packageManager": "yarn@4.2.2"
3637
}

packages/docusaurus-theme/package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
},
1616
"devDependencies": {
1717
"@docusaurus/types": "^3.4.0",
18-
"@types/react": "^18",
19-
"@types/react-dom": "^18",
18+
"@types/react-is": "^18",
2019
"typescript": "~5.4.5"
2120
},
2221
"main": "lib/index.js",
@@ -30,12 +29,17 @@
3029
"dependencies": {
3130
"@docusaurus/core": "^3.4.0",
3231
"@docusaurus/module-type-aliases": "^3.4.0",
32+
"@docusaurus/theme-common": "^3.4.0",
3333
"@docusaurus/utils-validation": "^3.4.0",
3434
"@elastic/datemath": "^5.0.3",
3535
"@elastic/eui": "94.5.0",
3636
"@emotion/css": "^11.11.2",
3737
"@emotion/react": "^11.11.4",
38-
"moment": "^2.30.1"
38+
"clsx": "^2.1.1",
39+
"moment": "^2.30.1",
40+
"prism-react-renderer": "^2.3.1",
41+
"react-is": "^18.3.1",
42+
"react-live": "^4.1.7"
3943
},
4044
"peerDependencies": {
4145
"react": "^18.0.0",

packages/docusaurus-theme/src/components/call_out/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ const getStyles = ({ euiTheme }: UseEuiTheme, variant: VARIANTS) => {
3737

3838
return {
3939
note: css`
40-
&:not(:last-of-type) {
41-
margin-block-end: ${euiTheme.size.m};
40+
&:not(:last-child) {
41+
margin-block-end: ${euiTheme.size.xl};
4242
}
4343
4444
.alert {
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export const CodeSandboxIcon = () => (
2+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" preserveAspectRatio="xMidYMid"
3+
viewBox="-20 0 296 296">
4+
<path
5+
d="M115.498 261.088v-106.61L23.814 101.73v60.773l41.996 24.347v45.7l49.688 28.54Zm23.814.627 50.605-29.151V185.78l42.269-24.495v-60.011l-92.874 53.621v106.82Zm80.66-180.887-48.817-28.289-42.863 24.872-43.188-24.897-49.252 28.667 91.914 52.882 92.206-53.235ZM0 222.212V74.495L127.987 0 256 74.182v147.797l-128.016 73.744L0 222.212Z" />
6+
</svg>
7+
);
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { CodeSandboxIcon } from './codesandbox_icon';
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
import {
2+
EuiButton,
3+
EuiButtonIcon,
4+
EuiFlexGroup,
5+
EuiToolTip,
6+
useEuiMemoizedStyles,
7+
UseEuiTheme,
8+
darken,
9+
} from '@elastic/eui';
10+
import { css } from '@emotion/react';
11+
import { CodeSandboxIcon } from '../../codesandbox_icon';
12+
13+
export interface DemoActionsBarProps {
14+
isSourceOpen: boolean;
15+
setSourceOpen(isOpen: boolean): void;
16+
onClickReloadExample(): void;
17+
onClickCopyToClipboard(): void;
18+
onClickOpenInCodeSandbox(): void;
19+
}
20+
21+
const getDemoActionsBarStyles = (euiTheme: UseEuiTheme) => {
22+
return {
23+
actionsBar: css`
24+
padding: var(--eui-size-s);
25+
background: ${darken(euiTheme.euiTheme.colors.body, 0.05)};
26+
border-top: 1px solid var(--docs-demo-border-color);
27+
28+
&:last-child {
29+
// border radius should be 1px smaller to work nicely
30+
// with the wrapper border width of 1px
31+
border-radius: 0 0 calc(var(--docs-demo-border-radius) - 1px) calc(var(--docs-demo-border-radius) - 1px);
32+
}
33+
`,
34+
button: css`
35+
background: var(--eui-background-color-primary-opaque);
36+
border: 1px solid var(--eui-border-color-primary);
37+
margin-right: auto;
38+
`,
39+
};
40+
}
41+
42+
export const DemoActionsBar = ({
43+
isSourceOpen,
44+
setSourceOpen,
45+
onClickOpenInCodeSandbox,
46+
onClickReloadExample,
47+
onClickCopyToClipboard
48+
}: DemoActionsBarProps) => {
49+
const styles = useEuiMemoizedStyles(getDemoActionsBarStyles);
50+
51+
return (
52+
<EuiFlexGroup alignItems="center" css={styles.actionsBar} gutterSize="s">
53+
<EuiButton
54+
css={styles.button}
55+
onClick={() => setSourceOpen(!isSourceOpen)}
56+
size="s"
57+
minWidth={false}
58+
>
59+
{isSourceOpen ? 'Hide source' : 'Show source'}
60+
</EuiButton>
61+
<EuiToolTip content="Open in CodeSandbox">
62+
<EuiButtonIcon
63+
size="s"
64+
iconType={CodeSandboxIcon}
65+
color="text"
66+
aria-label="Open in CodeSandbox"
67+
onClick={onClickOpenInCodeSandbox}
68+
/>
69+
</EuiToolTip>
70+
<EuiToolTip content="Copy to clipboard">
71+
<EuiButtonIcon
72+
size="s"
73+
iconType="copyClipboard"
74+
color="text"
75+
onClick={onClickCopyToClipboard}
76+
aria-label="Copy code to clipboard"
77+
/>
78+
</EuiToolTip>
79+
<EuiToolTip content="Reload example">
80+
<EuiButtonIcon
81+
size="s"
82+
iconType="refresh"
83+
color="text"
84+
onClick={onClickReloadExample}
85+
aria-label="Reload example"
86+
/>
87+
</EuiToolTip>
88+
</EuiFlexGroup>
89+
);
90+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { DemoActionsBar, type DemoActionsBarProps } from './actions_bar';

0 commit comments

Comments
 (0)