Skip to content
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
## [`master`](https://github.com/elastic/eui/tree/master)

No public interface changes since `37.6.1`.
- Changed `EuiPageHeader`'s tab implementation to use size `xl` when only content ([#5135](https://github.com/elastic/eui/pull/5135))
- Added `pageTitleProps` prop to `EuiPageHeader` to pass through props to the `EuiTitle` ([#5135](https://github.com/elastic/eui/pull/5135))
- Added screen-reader only `<h1>` to `EuiPageHeader` when tabs exist without a `pageTitle` ([#5135](https://github.com/elastic/eui/pull/5135))
- Added `bottomBorder` prop and `xl` `size` to `EuiTabs` ([#5135](https://github.com/elastic/eui/pull/5135))
- Added `prepend` and `append` props to `EuiTab` ([#5135](https://github.com/elastic/eui/pull/5135))
- Refactored styles of `EuiTabs` ([#5135](https://github.com/elastic/eui/pull/5135))
- Removed Sass variables for `EuiTabs` font size (`$euiTabFontSize, $euiTabFontSizeS, $euiTabFontSizeL`) ([#5135](https://github.com/elastic/eui/pull/5135))

**Theme: Amsterdam**

- Deprecated `display` prop of `EuiTabs` in favor of unified styles and `bottomBorder` ([#5135](https://github.com/elastic/eui/pull/5135))

## [`37.6.1`](https://github.com/elastic/eui/tree/v37.6.1)

Expand Down
2 changes: 1 addition & 1 deletion src-docs/src/components/guide_section/_guide_section.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
}
}

.guideSectionTabs__tab {
.guideSectionTabs__tab > * {
font-weight: $euiFontWeightMedium !important; // sass-lint:disable-line no-important
}

Expand Down
38 changes: 0 additions & 38 deletions src-docs/src/views/page_header/page_header.js

This file was deleted.

15 changes: 15 additions & 0 deletions src-docs/src/views/page_header/page_header.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react';

import { EuiPageHeader, EuiButton } from '../../../../src/components';

export default () => (
<EuiPageHeader
pageTitle="Page title"
iconType="logoKibana"
description="This description should be describing the current page as depicted by the page title. It will never extend beneath the right side content."
rightSideItems={[
<EuiButton fill>Add something</EuiButton>,
<EuiButton>Do something</EuiButton>,
]}
/>
);
42 changes: 37 additions & 5 deletions src-docs/src/views/page_header/page_header_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ const pageHeaderSource = require('!!raw-loader!./page_header');

import PageHeaderTabs from './page_header_tabs';
const pageHeaderTabsSource = require('!!raw-loader!./page_header_tabs');
import PageHeaderTabsTitle from './page_header_tabs_title';
const pageHeaderTabsTitleSource = require('!!raw-loader!./page_header_tabs_title');

import PageHeaderCustom from './page_header_custom';
import { EuiText } from '../../../../src/components/text';
Expand Down Expand Up @@ -76,10 +78,6 @@ export const PageHeaderExample = {
props: { EuiPageHeader },
snippet: `<EuiPageHeader
pageTitle="Page title"
tabs={[
{ label:"Tab 1", isSelected: true },
{ label:"Tab 2" }
]}
description="Example of a description."
rightSideItems={[
<EuiButton fill>Button 1</EuiButton>,
Expand All @@ -89,6 +87,39 @@ export const PageHeaderExample = {
},
{
title: 'Tabs in the page header',
source: [
{
type: GuideSectionTypes.JS,
code: pageHeaderTabsTitleSource,
},
],
text: (
<>
<p>
A set of <EuiCode>tabs</EuiCode> can be displayed inside the page
header by passing an array of{' '}
<Link to="/navigation/tabs">
<strong>EuiTab</strong>
</Link>{' '}
objects using the label key for the tab content. When displaying
tabs it is recommended to also apply the{' '}
<EuiCode>bottomBorder</EuiCode> prop to create separation of the
header and content. You&apos;ll still need to manage the page
content and selected tab in your own instance.
</p>
</>
),
demo: <PageHeaderTabsTitle />,
props: { EuiPageHeader },
snippet: `<EuiPageHeader
pageTitle="Page title"
tabs={[
{ label:"Tab 1", isSelected: true },
{ label:"Tab 2" }
]}
/>`,
},
{
source: [
{
type: GuideSectionTypes.JS,
Expand All @@ -102,7 +133,8 @@ export const PageHeaderExample = {
<EuiCode>pageTitle</EuiCode>, <strong>EuiPageHeader</strong> will
promote those tabs as if they are the page title. This means that
any <EuiCode>description</EuiCode> or <EuiCode>children</EuiCode>{' '}
will sit <strong>below</strong> the tabs.
will sit <strong>below</strong> the tabs and should be describing
the currently selected tab.
</p>
</>
),
Expand Down
36 changes: 0 additions & 36 deletions src-docs/src/views/page_header/page_header_tabs.js

This file was deleted.

19 changes: 19 additions & 0 deletions src-docs/src/views/page_header/page_header_tabs.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from 'react';

import { EuiPageHeader } from '../../../../src/components';

export default () => (
<EuiPageHeader
tabs={[
{
label: 'Tab 1',
isSelected: true,
},
{
label: 'Tab 2',
},
]}
description="This description should be describing the current page as depicted by the current tab. It has grow set to false to ensure a readable line-length."
bottomBorder
/>
);
23 changes: 23 additions & 0 deletions src-docs/src/views/page_header/page_header_tabs_title.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React from 'react';

import { EuiPageHeader, EuiButton } from '../../../../src/components';

export default () => (
<EuiPageHeader
pageTitle="Page title"
tabs={[
{
label: 'Tab 1',
isSelected: true,
},
{
label: 'Tab 2',
},
]}
rightSideItems={[
<EuiButton fill>Add something</EuiButton>,
<EuiButton>Do something</EuiButton>,
]}
bottomBorder
/>
);
10 changes: 10 additions & 0 deletions src-docs/src/views/page_header/playground.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ export const pageHeaderConfig = () => {
type: PropTypes.String,
};

propsToUse.alignItems = {
...propsToUse.alignItems,
value: 'top',
};

propsToUse.restrictWidth = {
...propsToUse.restrictWidth,
type: PropTypes.Number,
};

propsToUse.rightSideItems = simulateFunction({
...propsToUse.rightSideItems,
custom: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
EuiButton,
EuiIcon,
EuiTabbedContent,
EuiTitle,
EuiText,
EuiSpacer,
} from '../../../../src/components';
Expand All @@ -16,15 +15,14 @@ const tabs = [
content: (
<Fragment>
<EuiSpacer />
<EuiTitle>
<h3>Cobalt</h3>
</EuiTitle>
<EuiText>
Cobalt is a chemical element with symbol Co and atomic number 27. Like
nickel, cobalt is found in the Earth&rsquo;s crust only in chemically
combined form, save for small deposits found in alloys of natural
meteoric iron. The free element, produced by reductive smelting, is a
hard, lustrous, silver-gray metal.
<p>
Cobalt is a chemical element with symbol Co and atomic number 27.
Like nickel, cobalt is found in the Earth&rsquo;s crust only in
chemically combined form, save for small deposits found in alloys of
natural meteoric iron. The free element, produced by reductive
smelting, is a hard, lustrous, silver-gray metal.
</p>
</EuiText>
</Fragment>
),
Expand All @@ -35,35 +33,29 @@ const tabs = [
content: (
<Fragment>
<EuiSpacer />
<EuiTitle>
<h3>Dextrose</h3>
</EuiTitle>
<EuiText>
Intravenous sugar solution, also known as dextrose solution, is a
mixture of dextrose (glucose) and water. It is used to treat low blood
sugar or water loss without electrolyte loss.
<p>
Intravenous sugar solution, also known as dextrose solution, is a
mixture of dextrose (glucose) and water. It is used to treat low
blood sugar or water loss without electrolyte loss.
</p>
</EuiText>
</Fragment>
),
},
{
id: 'hydrogen',
name: (
<span>
<EuiIcon type="heatmap" />
&nbsp;Hydrogen
</span>
),
name: 'Hydrogen',
prepend: <EuiIcon type="heatmap" />,
content: (
<Fragment>
<EuiSpacer />
<EuiTitle>
<h3>Hydrogen</h3>
</EuiTitle>
<EuiText>
Hydrogen is a chemical element with symbol H and atomic number 1. With
a standard atomic weight of 1.008, hydrogen is the lightest element on
the periodic table
<p>
Hydrogen is a chemical element with symbol H and atomic number 1.
With a standard atomic weight of 1.008, hydrogen is the lightest
element on the periodic table
</p>
</EuiText>
</Fragment>
),
Expand All @@ -74,14 +66,13 @@ const tabs = [
content: (
<Fragment>
<EuiSpacer />
<EuiTitle>
<h3>Monosodium Glutamate</h3>
</EuiTitle>
<EuiText>
Monosodium glutamate (MSG, also known as sodium glutamate) is the
sodium salt of glutamic acid, one of the most abundant naturally
occurring non-essential amino acids. Monosodium glutamate is found
naturally in tomatoes, cheese and other foods.
<p>
Monosodium glutamate (MSG, also known as sodium glutamate) is the
sodium salt of glutamic acid, one of the most abundant naturally
occurring non-essential amino acids. Monosodium glutamate is found
naturally in tomatoes, cheese and other foods.
</p>
</EuiText>
</Fragment>
),
Expand All @@ -91,7 +82,7 @@ const tabs = [
export default () => {
const [selectedTab, setSelectedTab] = useState(tabs[1]);

const onTabClick = (selectedTab) => {
const onTabClick = (selectedTab: any) => {
setSelectedTab(selectedTab);
};

Expand Down
3 changes: 2 additions & 1 deletion src-docs/src/views/tabs/playground.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ export const tabsConfig = () => {
const propsToUse = propUtilityForPlayground(docgenInfo.props);

propsToUse.children = {
value: '<EuiTab>Tab 1</EuiTab><EuiTab isSelected>Tab 2</EuiTab>',
value:
'<EuiTab>Tab 1</EuiTab><EuiTab isSelected>Tab 2</EuiTab><EuiTab disabled>Tab 3</EuiTab><EuiTab href="#">Tab link</EuiTab>',
type: PropTypes.ReactNode,
hidden: false,
};
Expand Down
Loading