Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
1ff189d
[Theme] Base theme setup (#8030)
mgadewoll Oct 23, 2024
39e60d6
[Visual Refresh] Update Typography scale (#8103)
mgadewoll Oct 31, 2024
22b2d6c
[Visual Refresh] Setup semantic color tokens (#8097)
mgadewoll Oct 31, 2024
b6df1f3
[Visual Refresh] Design changes (#8111)
mgadewoll Nov 5, 2024
5e49686
fix: correct skeleton mapping
mgadewoll Nov 5, 2024
e33639a
refactor: prevent double background for seleton animation
mgadewoll Nov 5, 2024
c8aaaad
[Visual Refresh] Fix theme package builds (#8120)
mgadewoll Nov 7, 2024
68ced5b
[Visual Refresh] Provide legacy JSON theme tokens (#8115)
mgadewoll Nov 7, 2024
9f5f807
[Visual Refresh] Update vis colors and palettes (#8112)
mgadewoll Nov 7, 2024
baf3eee
chore: cleanup package.json
mgadewoll Nov 7, 2024
d8a5251
[Visual Refresh] Provide legacy JSON tokens via EUI (#8125)
mgadewoll Nov 11, 2024
7f7f303
[Visual Refresh] Fix computed border token mapping (#8170)
mgadewoll Nov 20, 2024
08c1e56
[Visual Refresh] Fix euiColorFullShade Sass variable mapping (#8178)
mgadewoll Nov 22, 2024
939cf97
chore: add licenses to eui-theme-borealis and eui-theme-common
tkajtoch Nov 20, 2024
9c846e4
chore: bump versions of `@elastic/eui-theme-borealis` and `@elastic/e…
tkajtoch Nov 27, 2024
98d81ac
build(eui): move `@elastic/eui-theme-common` to dependencies
tkajtoch Nov 27, 2024
5ebf470
chore(eui): bump version of `@elastic/eui`
tkajtoch Nov 27, 2024
060530d
[Visual Refresh] Add forms.maxWidth token (#8221)
mgadewoll Dec 11, 2024
0cbe955
[Visual Refresh] Update color token mappings (#8211)
mgadewoll Dec 12, 2024
c934fe7
[Visual Refresh] Set darker shade for subdued text (#8224)
ryankeairns Dec 12, 2024
4618641
[Visual Refresh] Remove support for accentSecondary badges (#8227)
mgadewoll Dec 13, 2024
963a999
[Visual Refresh] Introduce shared popover arrow styles to Borealis (#…
mgadewoll Dec 13, 2024
2f8376e
chore: update versions
tkajtoch Dec 16, 2024
d9185e7
test: update snapshot
tkajtoch Dec 17, 2024
d5ef329
chore: update versions
tkajtoch Dec 17, 2024
48232d4
[Visual Refresh] Add severity vis colors (#8247)
mgadewoll Dec 18, 2024
e136ce3
[Visual Refresh] Fix transparent color variable definitions (#8249)
mgadewoll Dec 18, 2024
f581efb
chore: update token deprecation JSDOC
mgadewoll Dec 19, 2024
c11b692
[Visual Refresh] Update `EuiToken` colors (#8250)
ryankeairns Dec 19, 2024
b597a53
chore: update versions
tkajtoch Dec 18, 2024
4410c9c
chore: update versions
tkajtoch Dec 19, 2024
615e56b
[Visual Refresh] Correct severity palette order for Amsterdam (#8254)
acstll Jan 7, 2025
99a8d5b
[Theme] Base theme setup (#8030)
mgadewoll Oct 23, 2024
8715070
[Visual Refresh] Update Typography scale (#8103)
mgadewoll Oct 31, 2024
f9b081f
[Visual Refresh] Setup semantic color tokens (#8097)
mgadewoll Oct 31, 2024
2e1cc64
[Visual Refresh] Design changes (#8111)
mgadewoll Nov 5, 2024
b507bb0
fix: correct skeleton mapping
mgadewoll Nov 5, 2024
9efd0c0
refactor: prevent double background for seleton animation
mgadewoll Nov 5, 2024
b8b6069
[Visual Refresh] Fix theme package builds (#8120)
mgadewoll Nov 7, 2024
9d647ed
[Visual Refresh] Provide legacy JSON theme tokens (#8115)
mgadewoll Nov 7, 2024
14281ab
[Visual Refresh] Update vis colors and palettes (#8112)
mgadewoll Nov 7, 2024
d6d0075
chore: cleanup package.json
mgadewoll Nov 7, 2024
b0d5736
[Visual Refresh] Provide legacy JSON tokens via EUI (#8125)
mgadewoll Nov 11, 2024
9ae61b1
[Visual Refresh] Fix computed border token mapping (#8170)
mgadewoll Nov 20, 2024
e199b81
[Visual Refresh] Fix euiColorFullShade Sass variable mapping (#8178)
mgadewoll Nov 22, 2024
07b5579
chore: add licenses to eui-theme-borealis and eui-theme-common
tkajtoch Nov 20, 2024
8ab1cc8
chore: bump versions of `@elastic/eui-theme-borealis` and `@elastic/e…
tkajtoch Nov 27, 2024
cb07ab7
build(eui): move `@elastic/eui-theme-common` to dependencies
tkajtoch Nov 27, 2024
07ab297
chore(eui): bump version of `@elastic/eui`
tkajtoch Nov 27, 2024
8dea907
[Visual Refresh] Add forms.maxWidth token (#8221)
mgadewoll Dec 11, 2024
c5af491
[Visual Refresh] Update color token mappings (#8211)
mgadewoll Dec 12, 2024
cd2ad55
[Visual Refresh] Set darker shade for subdued text (#8224)
ryankeairns Dec 12, 2024
dfb1367
[Visual Refresh] Remove support for accentSecondary badges (#8227)
mgadewoll Dec 13, 2024
3695e96
[Visual Refresh] Introduce shared popover arrow styles to Borealis (#…
mgadewoll Dec 13, 2024
f4e35ac
chore: update versions
tkajtoch Dec 16, 2024
2bdbb5a
test: update snapshot
tkajtoch Dec 17, 2024
91d93ee
chore: update versions
tkajtoch Dec 17, 2024
568747f
[Visual Refresh] Add severity vis colors (#8247)
mgadewoll Dec 18, 2024
63410a1
[Visual Refresh] Fix transparent color variable definitions (#8249)
mgadewoll Dec 18, 2024
d7b4209
chore: update token deprecation JSDOC
mgadewoll Dec 19, 2024
c8a2673
[Visual Refresh] Update `EuiToken` colors (#8250)
ryankeairns Dec 19, 2024
14f1296
chore: update versions
tkajtoch Dec 18, 2024
3c951b0
chore: update versions
tkajtoch Dec 19, 2024
d1e1f1c
[Visual Refresh] Correct severity palette order for Amsterdam (#8254)
acstll Jan 7, 2025
31f3739
Merge branch 'eui-theme/borealis' of https://github.com/elastic/eui i…
ek-so Jan 7, 2025
7c21c6e
[Visual Refresh] Add behindText vis color tokens (#8253)
mgadewoll Jan 7, 2025
b9c74a0
[Visual Refresh] Fix strong border token naming (#8262)
mgadewoll Jan 9, 2025
e689ca4
Merge branch 'main' into eui-theme/borealis
tkajtoch Jan 13, 2025
59791ef
chore: update versions
tkajtoch Jan 14, 2025
100d15e
[Visual Refresh] Update floating border on EuiPanel (#8270)
mgadewoll Jan 14, 2025
4b4866c
chore: update yarn.lock
mgadewoll Jan 15, 2025
ef28aee
Remap few colors for `EuiLoadingSpinner` and `EuiLoadingChart` (#8276)
ek-so Jan 17, 2025
305c92e
[Visual Refresh] Support new theme tokens on JSON exports (#8277)
mgadewoll Jan 20, 2025
ac705ec
fix: revert changed type module
mgadewoll Jan 21, 2025
7863bbe
Merge branch 'main' into eui-theme/borealis
tkajtoch Jan 21, 2025
f4892c3
update versions
tkajtoch Jan 22, 2025
4281f8b
[Visual Refresh] Make Borealis default theme in EUI (#8288)
mgadewoll Jan 29, 2025
84d8df3
[Visual Refresh] Provide hooks for color palette functions (#8284)
mgadewoll Jan 29, 2025
be22634
fix: update tests after merge with resulting conflicts of #8284 and #…
mgadewoll Feb 4, 2025
6a2e5f8
Merge branch 'main' into eui-theme/borealis
tkajtoch Feb 5, 2025
94f7781
update versions
tkajtoch Feb 5, 2025
81e285f
[Visual Refresh] Update docs to reflect new tokens (#8306)
mgadewoll Feb 6, 2025
6fc367a
Fixing styles for `euiKeyPadMenu` (#8294)
ek-so Feb 11, 2025
eb26a87
[Visual Refresh] Fix incorrect backgroundLight json tokens (#8316)
mgadewoll Feb 11, 2025
b698b25
[Visual Refresh] Resolve Amsterdam specific theme imports (#8318)
mgadewoll Feb 14, 2025
19eee10
Merge branch 'main' into eui-theme/borealis
tkajtoch Feb 19, 2025
6078ed0
update versions
tkajtoch Feb 19, 2025
aa6ac6b
Add CLI for monorepo releases (#8308)
tkajtoch Feb 28, 2025
4523653
Merge branch 'main' into eui-theme/borealis
tkajtoch Mar 3, 2025
81af8cd
update versions
tkajtoch Mar 3, 2025
6dfdc36
[Visual Refresh] Update Borealis VRT reference images (#8384)
mgadewoll Mar 3, 2025
3bce120
chore: add changelog
mgadewoll Mar 3, 2025
1746f64
test(VRT): update reference images
mgadewoll Mar 3, 2025
d90a419
build: fix missing dependency
mgadewoll Mar 3, 2025
d1aa2ae
docs: fix missing styles on colorMode switch
mgadewoll Mar 4, 2025
f8afd4d
docs: update localStorage theme key
mgadewoll Mar 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .buildkite/scripts/pipelines/pipeline_deploy_new_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ analytics_vault="secret/ci/elastic-eui/analytics"
export DOCS_BASE_URL="/${bucket_directory}"
export DOCS_GOOGLE_TAG_MANAGER_ID="$(retry 5 vault read -field=google_tag_manager_id "${analytics_vault}")"

yarn workspaces foreach -Rpt --from @elastic/eui-website run build
yarn workspace @elastic/eui-website run build:workspaces

echo "+++ Configuring environment for website deployment"

Expand Down
18 changes: 9 additions & 9 deletions .buildkite/scripts/pipelines/pipeline_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,53 +29,53 @@ COMMAND=""
case $TEST_TYPE in
lint)
echo "[TASK]: Running linters"
COMMAND="/opt/yarn*/bin/yarn --cwd packages/eui && yarn --cwd packages/eui lint"
COMMAND="/opt/yarn*/bin/yarn --cwd packages/eui && yarn --cwd packages/eui build:workspaces && yarn --cwd packages/eui lint"
;;

unit:ts)
echo "[TASK]: Running .ts and .js unit tests"
COMMAND="/opt/yarn*/bin/yarn --cwd packages/eui && yarn --cwd packages/eui test-unit --node-options=--max_old_space_size=2048 --testMatch=non-react"
COMMAND="/opt/yarn*/bin/yarn --cwd packages/eui && yarn --cwd packages/eui build:workspaces && yarn --cwd packages/eui test-unit --node-options=--max_old_space_size=2048 --testMatch=non-react"
;;

unit:tsx:16)
echo "[TASK]: Running Jest .tsx tests against React 16"
DOCKER_OPTIONS+=(--env BUILDKITE_ANALYTICS_TOKEN="$(retry 5 vault read -field=jest_token_react16 "${buildkite_analytics_vault}")")
COMMAND="/opt/yarn*/bin/yarn --cwd packages/eui && yarn --cwd packages/eui test-unit --node-options=--max_old_space_size=2048 --react-version=16 --testMatch=react"
COMMAND="/opt/yarn*/bin/yarn --cwd packages/eui && yarn --cwd packages/eui build:workspaces && yarn --cwd packages/eui test-unit --node-options=--max_old_space_size=2048 --react-version=16 --testMatch=react"
;;

unit:tsx:17)
echo "[TASK]: Running Jest .tsx tests against React 17"
DOCKER_OPTIONS+=(--env BUILDKITE_ANALYTICS_TOKEN="$(retry 5 vault read -field=jest_token_react17 "${buildkite_analytics_vault}")")
COMMAND="/opt/yarn*/bin/yarn --cwd packages/eui && yarn --cwd packages/eui test-unit --node-options=--max_old_space_size=2048 --react-version=17 --testMatch=react"
COMMAND="/opt/yarn*/bin/yarn --cwd packages/eui && yarn --cwd packages/eui build:workspaces && yarn --cwd packages/eui test-unit --node-options=--max_old_space_size=2048 --react-version=17 --testMatch=react"
;;

unit:tsx)
echo "[TASK]: Running Jest .tsx tests against React 18"
DOCKER_OPTIONS+=(--env BUILDKITE_ANALYTICS_TOKEN="$(retry 5 vault read -field=jest_token_react18 "${buildkite_analytics_vault}")")
COMMAND="/opt/yarn*/bin/yarn --cwd packages/eui && yarn --cwd packages/eui test-unit --node-options=--max_old_space_size=2048 --testMatch=react"
COMMAND="/opt/yarn*/bin/yarn --cwd packages/eui && yarn --cwd packages/eui build:workspaces && yarn --cwd packages/eui test-unit --node-options=--max_old_space_size=2048 --testMatch=react"
;;

cypress:16)
echo "[TASK]: Running Cypress tests against React 16"
DOCKER_OPTIONS+=(--env BUILDKITE_ANALYTICS_TOKEN="$(retry 5 vault read -field=cypress_token_react16 "${buildkite_analytics_vault}")")
COMMAND="/opt/yarn*/bin/yarn --cwd packages/eui && yarn --cwd packages/eui cypress install && yarn --cwd packages/eui test-cypress --node-options=--max_old_space_size=2048 --react-version=16"
COMMAND="/opt/yarn*/bin/yarn --cwd packages/eui && yarn --cwd packages/eui build:workspaces && yarn --cwd packages/eui cypress install && yarn --cwd packages/eui test-cypress --node-options=--max_old_space_size=2048 --react-version=16"
;;

cypress:17)
echo "[TASK]: Running Cypress tests against React 17"
DOCKER_OPTIONS+=(--env BUILDKITE_ANALYTICS_TOKEN="$(retry 5 vault read -field=cypress_token_react17 "${buildkite_analytics_vault}")")
COMMAND="/opt/yarn*/bin/yarn --cwd packages/eui && yarn --cwd packages/eui cypress install && yarn --cwd packages/eui test-cypress --node-options=--max_old_space_size=2048 --react-version=17"
COMMAND="/opt/yarn*/bin/yarn --cwd packages/eui && yarn --cwd packages/eui build:workspaces && yarn --cwd packages/eui cypress install && yarn --cwd packages/eui test-cypress --node-options=--max_old_space_size=2048 --react-version=17"
;;

cypress:18)
echo "[TASK]: Running Cypress tests against React 18"
DOCKER_OPTIONS+=(--env BUILDKITE_ANALYTICS_TOKEN="$(retry 5 vault read -field=cypress_token_react18 "${buildkite_analytics_vault}")")
COMMAND="/opt/yarn*/bin/yarn --cwd packages/eui && yarn --cwd packages/eui cypress install && yarn --cwd packages/eui test-cypress --node-options=--max_old_space_size=2048"
COMMAND="/opt/yarn*/bin/yarn --cwd packages/eui && yarn --cwd packages/eui build:workspaces && yarn --cwd packages/eui cypress install && yarn --cwd packages/eui test-cypress --node-options=--max_old_space_size=2048"
;;

cypress:a11y)
echo "[TASK]: Running Cypress accessibility tests against React 18"
COMMAND="/opt/yarn*/bin/yarn --cwd packages/eui && yarn --cwd packages/eui cypress install && yarn --cwd packages/eui run test-cypress-a11y --node-options=--max_old_space_size=2048"
COMMAND="/opt/yarn*/bin/yarn --cwd packages/eui && yarn --cwd packages/eui build:workspaces && yarn --cwd packages/eui cypress install && yarn --cwd packages/eui run test-cypress-a11y --node-options=--max_old_space_size=2048"
;;

*)
Expand Down
1 change: 1 addition & 0 deletions .buildkite/scripts/release/step_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ echo "+++ :yarn: Installing dependencies"
yarn

echo "+++ :yarn: Building @elastic/eui"
yarn build:workspaces
yarn build

echo "+++ :yarn: Built @elastic/eui"
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"pre-push": "yarn --cwd packages/eui pre-push",
"preinstall": "echo \"\\x1b[K\\x1b[37;41mWarning: EUI has recently migrated to a monorepo structure. Please run EUI scripts like \\x1b[1;4myarn start\\x1b[0m\\x1b[37;41m or \\x1b[1;4myarn build\\x1b[0m\\x1b[37;41m from the \\x1b[1;4mpackages/eui\\x1b[0m\\x1b[37;41m directory instead!\n\nIf this is the first time you're running EUI after the monorepo migration, please run this first from the root repository's directory to clean up your local environment:\n \\x1b[1;4mrm -rf node_modules .cache-loader dist es lib optimize test-env types .eslintcache .loki reports docs .nyc_output eui.d.ts && yarn\\x1b[0m\\x1b[37;41m\n\nInstall process will continue in 10 seconds...\\x1b[0m\"; sleep 10",
"start": "echo '\\x1b[K\\x1b[37;41mPlease run this script from the \\x1b[1;4mpackages/eui\\x1b[0m\\x1b[37;41m directory instead\\x1b[0m'; exit 1",
"build": "echo '\\x1b[K\\x1b[37;41mPlease run this script from the \\x1b[1;4mpackages/eui\\x1b[0m\\x1b[37;41m directory instead\\x1b[0m'; exit 1"
"build": "echo '\\x1b[K\\x1b[37;41mPlease run this script from the \\x1b[1;4mpackages/eui\\x1b[0m\\x1b[37;41m directory instead\\x1b[0m'; exit 1",
"release": "node scripts/release"
},
"repository": {
"type": "git",
Expand All @@ -24,6 +25,9 @@
"devDependencies": {
"pre-push": "^0.1.4"
},
"dependencies": {
"@elastic/eui-release-cli": "link:packages/release-cli"
},
"resolutions": {
"prismjs": "1.27.0",
"react": "^18",
Expand Down
3 changes: 2 additions & 1 deletion packages/docusaurus-theme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@
"@docusaurus/theme-common": "^3.5.2",
"@docusaurus/utils-validation": "^3.5.2",
"@elastic/datemath": "^5.0.3",
"@elastic/eui": "97.2.0",
"@elastic/eui": "workspace:^",
"@elastic/eui-docgen": "workspace:^",
"@elastic/eui-theme-borealis": "workspace:^",
"@emotion/css": "^11.11.2",
"@emotion/react": "^11.11.4",
"@types/react-window": "^1.8.8",
Expand Down
14 changes: 7 additions & 7 deletions packages/docusaurus-theme/src/components/call_out/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,31 @@ import {
import { FunctionComponent, PropsWithChildren } from 'react';

type VARIANTS = 'info' | 'tip' | 'note' | 'danger' | 'warning';
type TEXT_COLORS = 'primaryText' | 'successText' | 'dangerText' | 'warningText';
type TEXT_COLORS = 'textPrimary' | 'textSuccess' | 'textDanger' | 'textWarning';

const VARIANT_TO_COLOR_MAP: Record<
VARIANTS,
{ backgroundVariable: string; colorKey: TEXT_COLORS }
> = {
info: {
backgroundVariable: 'var(--eui-background-color-primary)',
colorKey: 'primaryText',
colorKey: 'textPrimary',
},
note: {
backgroundVariable: 'var(--eui-background-color-primary)',
colorKey: 'primaryText',
colorKey: 'textPrimary',
},
tip: {
backgroundVariable: 'var(--eui-background-color-success)',
colorKey: 'successText',
colorKey: 'textSuccess',
},
danger: {
backgroundVariable: 'var(--eui-background-color-danger)',
colorKey: 'dangerText',
colorKey: 'textDanger',
},
warning: {
backgroundVariable: 'var(--eui-background-color-warning)',
colorKey: 'warningText',
colorKey: 'textWarning',
},
};

Expand All @@ -52,7 +52,7 @@ const getStyles = (theme: UseEuiTheme, variant: VARIANTS) => {
.alert {
--ifm-alert-background-color: ${VARIANT_TO_COLOR_MAP[variant]
.backgroundVariable};
--ifm-alert-foreground-color: ${euiTheme.colors.text};
--ifm-alert-foreground-color: ${euiTheme.colors.textParagraph};
--ifm-alert-padding-horizontal: ${euiTheme.size.base};
--ifm-alert-padding-vertical: ${euiTheme.size.base};
--ifm-alert-border-width: ${euiTheme.border.width.thin};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,24 @@ const getDemoActionsBarStyles = (euiTheme: UseEuiTheme) => {
&:last-child {
// border radius should be 1px smaller to work nicely
// with the wrapper border width of 1px
border-radius: 0 0 calc(var(--docs-demo-border-radius) - 1px) calc(var(--docs-demo-border-radius) - 1px);
border-radius: 0 0 calc(var(--docs-demo-border-radius) - 1px)
calc(var(--docs-demo-border-radius) - 1px);
}
`,
button: css`
background: var(--eui-background-color-primary-opaque);
background: var(--eui-background-color-primary);
border: 1px solid var(--eui-border-color-primary);
margin-right: auto;
`,
};
}
};

export const DemoActionsBar = ({
isSourceOpen,
setSourceOpen,
onClickOpenInCodeSandbox,
onClickReloadExample,
onClickCopyToClipboard
onClickCopyToClipboard,
}: DemoActionsBarProps) => {
const styles = useEuiMemoizedStyles(getDemoActionsBarStyles);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ export const NavbarItem = (props: Props) => {
} = props;

const isBrowser = useIsBrowser();
const { theme } = useContext(AppThemeContext);
const { colorMode } = useContext(AppThemeContext);

const isDarkMode = theme === 'dark';
const isDarkMode = colorMode === 'dark';

const styles = useEuiMemoizedStyles(getStyles);
const cssStyles = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@ import {
EuiCode,
UseEuiTheme,
EuiTitle,
useEuiMemoizedStyles, EuiLink,
useEuiMemoizedStyles,
EuiLink,
} from '@elastic/eui';
import { ProcessedComponent, ProcessedComponentProp } from '@elastic/eui-docgen';
import {
ProcessedComponent,
ProcessedComponentProp,
} from '@elastic/eui-docgen';
import { useCallback, useMemo } from 'react';
import { css } from '@emotion/react';
import { PropTableExtendedTypes } from './extended_types';
Expand All @@ -19,9 +23,8 @@ export interface PropTableProps {
headingLevel?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
}

const getPropId = (prop: ProcessedComponentProp, componentName: string) => (
`${encodeURIComponent(componentName)}-prop-${prop.name}`
);
const getPropId = (prop: ProcessedComponentProp, componentName: string) =>
`${encodeURIComponent(componentName)}-prop-${prop.name}`;

const getPropTableStyles = ({ euiTheme }: UseEuiTheme) => ({
propTable: css`
Expand Down Expand Up @@ -53,7 +56,7 @@ const getPropTableStyles = ({ euiTheme }: UseEuiTheme) => ({
`,
required: css`
font-family: ${euiTheme.font.familyCode};
color: ${euiTheme.colors.dangerText};
color: ${euiTheme.colors.textDanger};
`,
type: css`
font-weight: ${euiTheme.font.weight.semiBold};
Expand All @@ -78,19 +81,23 @@ export const PropTable = ({
const styles = useEuiMemoizedStyles(getPropTableStyles);

const tableItems = useMemo<Array<ProcessedComponentProp>>(
() => Object.values(definition.props).sort(
(a, b) => +b.isRequired - +a.isRequired
),
[definition.props],
() =>
Object.values(definition.props).sort(
(a, b) => +b.isRequired - +a.isRequired
),
[definition.props]
);

const columns = useMemo<Array<EuiBasicTableColumn<ProcessedComponentProp>>>(
() => ([
() => [
{
field: 'name',
name: 'Prop',
width: "150",
render(value: ProcessedComponentProp['name'], prop: ProcessedComponentProp) {
width: '150',
render(
value: ProcessedComponentProp['name'],
prop: ProcessedComponentProp
) {
return (
<span css={styles.propName}>
{value}
Expand All @@ -110,44 +117,59 @@ export const PropTable = ({
{
field: 'description',
name: 'Description and type',
render(value: ProcessedComponentProp['description'], prop: ProcessedComponentProp) {
render(
value: ProcessedComponentProp['description'],
prop: ProcessedComponentProp
) {
return (
<EuiFlexGroup direction="column" alignItems="flexStart" gutterSize="s">
<EuiFlexGroup
direction="column"
alignItems="flexStart"
gutterSize="s"
>
{value?.trim() && (
<EuiMarkdownFormat css={styles.description}>{value}</EuiMarkdownFormat>
<EuiMarkdownFormat css={styles.description}>
{value}
</EuiMarkdownFormat>
)}
{prop.type && (
<span css={styles.type}>
Type: {' '}
Type:{' '}
<EuiCode language="ts">
{prop.type.raw || prop.type.name}
</EuiCode>
</span>
)}
</EuiFlexGroup>
);
}
},
},
{
field: 'defaultValue',
name: 'Default value',
width: "120",
render(value: ProcessedComponentProp['defaultValue'], prop: ProcessedComponentProp) {
width: '120',
render(
value: ProcessedComponentProp['defaultValue'],
prop: ProcessedComponentProp
) {
if (prop.isRequired && !value?.trim().length) {
return <EuiTextColor css={styles.required}>Required</EuiTextColor>
return <EuiTextColor css={styles.required}>Required</EuiTextColor>;
}

return value && <EuiCode>{value}</EuiCode>;
},
}
]),
[],
},
],
[]
);

const rowProps = useCallback((item: ProcessedComponentProp) => ({
id: getPropId(item, definition.displayName),
css: styles.tableRow,
}), [definition.displayName]);
const rowProps = useCallback(
(item: ProcessedComponentProp) => ({
id: getPropId(item, definition.displayName),
css: styles.tableRow,
}),
[definition.displayName]
);

return (
<EuiFlexGroup
Expand Down
Loading