From b5cdc46f997cf924687ea87974558a13a2ae1c72 Mon Sep 17 00:00:00 2001 From: AbhishekReddy1127 Date: Tue, 28 Feb 2023 19:45:08 +0000 Subject: [PATCH] update the content in the section Card by replacing icons, updating card titles, changing button labels, removing the lens card, and modiffingthe beta badge to use the experimental label Signed-off-by: AbhishekReddy1127 --- src-docs/src/views/card/card.js | 27 +++++++++-- src-docs/src/views/card/card_beta.js | 53 +++++++++------------- src-docs/src/views/card/card_children.js | 4 +- src-docs/src/views/card/card_display.js | 6 +-- src-docs/src/views/card/card_example.js | 33 +++++++------- src-docs/src/views/card/card_footer.js | 14 +++--- src-docs/src/views/card/card_image.js | 8 ++-- src-docs/src/views/card/card_layout.js | 8 ++-- src-docs/src/views/card/card_selectable.js | 6 ++- 9 files changed, 84 insertions(+), 75 deletions(-) diff --git a/src-docs/src/views/card/card.js b/src-docs/src/views/card/card.js index 2595e1114f..4ac0ef2785 100644 --- a/src-docs/src/views/card/card.js +++ b/src-docs/src/views/card/card.js @@ -18,15 +18,32 @@ import { OuiFlexItem, } from '../../../../src/components'; -const icons = ['Beats', 'Cloud', 'Logging', 'Kibana']; +const cards = { + Dashboards: { + title: 'Dashboards', + iconType: 'dashboardApp', + }, + Cloud: { + title: 'Visualize', + iconType: 'visualizeApp', + }, + Logging: { + title: 'Discover', + iconType: 'discoverApp', + }, + Search: { + title: 'Search', + iconType: 'search', + }, +}; -const cardNodes = icons.map(function (item, index) { +const cardNodes = Object.keys(cards).map(function (item, index) { return ( } - title={`Elastic ${item}`} - isDisabled={item === 'Kibana' ? true : false} + icon={} + title={cards[item].title} + isDisabled={item === 'Search' ? true : false} description="Example of a card's description. Stick to one or two sentences." onClick={() => {}} /> diff --git a/src-docs/src/views/card/card_beta.js b/src-docs/src/views/card/card_beta.js index 1bf49c5551..50861f1728 100644 --- a/src-docs/src/views/card/card_beta.js +++ b/src-docs/src/views/card/card_beta.js @@ -18,45 +18,36 @@ import { OuiFlexItem, } from '../../../../src/components'; -const icons = ['dashboard', 'monitoring']; -const badges = [null, 'Beta']; +const cards = { + dashboard: { + title: 'Dashboards', + icon: 'dashboardApp', + betaBadgeLabel: null, + betaBadgeTooltipContent: undefined, + }, + monitoring: { + title: 'Discover', + icon: 'discoverApp', + betaBadgeLabel: 'Experimental', + betaBadgeTooltipContent: + 'This module is not GA. Please help us by reporting any bugs.', + }, +}; -const cardNodes = icons.map(function (item, index) { +const cardNodes = Object.keys(cards).map(function (item, index) { + const { title, icon, betaBadgeLabel, betaBadgeTooltipContent } = cards[item]; return ( } - title={`Kibana ${item}`} + icon={} + title={title} description="Example of a card's description. Stick to one or two sentences." - betaBadgeLabel={badges[index]} - betaBadgeTooltipContent={ - badges[index] - ? 'This module is not GA. Please help us by reporting any bugs.' - : undefined - } + betaBadgeLabel={betaBadgeLabel} + betaBadgeTooltipContent={betaBadgeTooltipContent} onClick={() => {}} /> ); }); -export default () => ( - - {cardNodes} - - } - title="Lens" - isDisabled - description="Disabled cards can have active links using OuiBetaBadge." - betaBadgeProps={{ - href: 'http://www.elastic.co/subscriptions', - target: '_blank', - }} - betaBadgeLabel="Basic" - betaBadgeTooltipContent="This feature requires a Basic License" - onClick={() => {}} - /> - - -); +export default () => {cardNodes}; diff --git a/src-docs/src/views/card/card_children.js b/src-docs/src/views/card/card_children.js index fb71dbba6f..3470afd0bd 100644 --- a/src-docs/src/views/card/card_children.js +++ b/src-docs/src/views/card/card_children.js @@ -84,7 +84,7 @@ export default () => { Just be sure not to add any onClick handler to @@ -92,7 +92,7 @@ export default () => { }> - {'Hello, young Skywalker'} + {'Hello, world!'} diff --git a/src-docs/src/views/card/card_display.js b/src-docs/src/views/card/card_display.js index 311f9f94af..7d82fec650 100644 --- a/src-docs/src/views/card/card_display.js +++ b/src-docs/src/views/card/card_display.js @@ -15,7 +15,6 @@ import { OuiCard, OuiFlexGroup, OuiFlexItem, - OuiIcon, OuiSpacer, } from '../../../../src/components'; @@ -26,7 +25,6 @@ export default () => ( } onClick={() => {}} title="Plain" display="plain" @@ -35,7 +33,6 @@ export default () => ( } title="Subdued" display="subdued" description="This one has a subdued background color." @@ -45,11 +42,10 @@ export default () => ( } title="Transparent" display="transparent" description="This one doesn't have a background color anymore." - betaBadgeLabel="Beta" + betaBadgeLabel="experimental" betaBadgeTooltipContent="This module is not GA. Please help us by reporting any bugs." onClick={() => {}} /> diff --git a/src-docs/src/views/card/card_example.js b/src-docs/src/views/card/card_example.js index 7aa2944a80..e1969c86ac 100644 --- a/src-docs/src/views/card/card_example.js +++ b/src-docs/src/views/card/card_example.js @@ -148,11 +148,11 @@ export const CardExample = { color: 'subdued', }, snippet: ``, }, { @@ -193,11 +193,11 @@ export const CardExample = { color: 'subdued', }, snippet: ``, }, { @@ -242,7 +242,7 @@ export const CardExample = { />`, }, { - title: 'Beta badge', + title: 'Experimental badge', source: [ { type: GuideSectionTypes.JS, @@ -252,11 +252,12 @@ export const CardExample = { text: (

If the card links to or references a module that is not GA (beta, lab, - etc), you can add a betaBadgeLabel and{' '} - betaBadgeTooltipContent to the card and it will - properly create and position an OuiBetaBadge. If you - want to change the title of the tooltip, supply a{' '} - betaBadgeTitle prop. + etc), you can add a ExperimentalBadgeLabel and{' '} + experimentalBadgeTooltipContent to the card and it + will properly create and position an{' '} + OuiExperimentalBadge. If you want to change the title + of the tooltip, supply a experimentalBadgeTitle{' '} + prop.

), props: { OuiCard }, diff --git a/src-docs/src/views/card/card_footer.js b/src-docs/src/views/card/card_footer.js index 7932a4116e..69ffae5da3 100644 --- a/src-docs/src/views/card/card_footer.js +++ b/src-docs/src/views/card/card_footer.js @@ -31,11 +31,13 @@ export default () => ( description="Example of a short card description." footer={
- Go for it + + Choice One +

- Or try this + Choice Two

@@ -49,11 +51,11 @@ export default () => ( description="Example of a longer card description. See how the footers stay lined up." footer={
- Go for it + Choice One

- Or try this + Choice Two

@@ -67,11 +69,11 @@ export default () => ( description="Example of a short card description." footer={
- Go for it + Choice One

- Or try this + Choice Two

diff --git a/src-docs/src/views/card/card_image.js b/src-docs/src/views/card/card_image.js index 1ec60a2bc8..5d9a9611f9 100644 --- a/src-docs/src/views/card/card_image.js +++ b/src-docs/src/views/card/card_image.js @@ -22,7 +22,7 @@ import { const cardFooterContent = ( - Go for it + View Details ); @@ -40,7 +40,7 @@ export default () => ( /> } - title="Elastic in Nature" + title="Title" description="Example of a card's description. Stick to one or two sentences." footer={cardFooterContent} /> @@ -49,7 +49,7 @@ export default () => ( @@ -60,7 +60,7 @@ export default () => ( href="https://elastic.github.io/eui/" image="https://source.unsplash.com/400x200/?City" icon={} - title={'Beats in the City'} + title={'Title'} description="This card has an href and should be a link." />
diff --git a/src-docs/src/views/card/card_layout.js b/src-docs/src/views/card/card_layout.js index ae3e39dc29..4429611dfd 100644 --- a/src-docs/src/views/card/card_layout.js +++ b/src-docs/src/views/card/card_layout.js @@ -23,8 +23,8 @@ export default () => ( } - title={'Elastic Beats'} + icon={} + title={'Dashboards'} description="This card adds uses an 'xl' size icon which works well in a horizontal layout." onClick={() => {}} /> @@ -32,9 +32,9 @@ export default () => ( } + icon={} titleSize="xs" - title={'Elastic Cloud'} + title={'Visualize'} description="This card uses an 'l' size icon but also shrinks the 'titleSize' to 'xs'." onClick={() => {}} /> diff --git a/src-docs/src/views/card/card_selectable.js b/src-docs/src/views/card/card_selectable.js index 0a5faa2825..ee7414d0af 100644 --- a/src-docs/src/views/card/card_selectable.js +++ b/src-docs/src/views/card/card_selectable.js @@ -19,6 +19,8 @@ import { OuiFlexItem, } from '../../../../src/components'; +import logoFigma from '../../images/logo-figma.svg'; + export default () => { const [card1Selected, setCard1] = useState(true); const [card2Selected, setCard2] = useState(false); @@ -79,8 +81,8 @@ export default () => { } - title="Not Adobe" + icon={} + title="Figma" description="Example of a short card description." footer={