From 8eff585d1b083ee61dc2e9dea5085b49e37774e4 Mon Sep 17 00:00:00 2001 From: "inna.ivashchuk" Date: Thu, 27 Jul 2023 17:58:34 +0300 Subject: [PATCH] fix(TDOPS-4875): elevation improvements and added story in DS --- .../stylesheets/bootstrap/_variables.scss | 15 +++--- .../TooltipTrigger/TooltipTrigger.module.scss | 3 +- .../Elevation/Elevation.stories.mdx | 38 ++++++++++++++ .../Elevation/Elevation.stories.tsx | 49 +++++++++++++++++++ 4 files changed, 95 insertions(+), 10 deletions(-) create mode 100644 packages/storybook/src/design-system/Elevation/Elevation.stories.mdx create mode 100644 packages/storybook/src/design-system/Elevation/Elevation.stories.tsx diff --git a/fork/bootstrap-sass/assets/stylesheets/bootstrap/_variables.scss b/fork/bootstrap-sass/assets/stylesheets/bootstrap/_variables.scss index 88cea55d23e..cfcd80619e2 100644 --- a/fork/bootstrap-sass/assets/stylesheets/bootstrap/_variables.scss +++ b/fork/bootstrap-sass/assets/stylesheets/bootstrap/_variables.scss @@ -274,14 +274,13 @@ $dropdown-caret-color: #000 !default; // // Note: These variables are not generated into the Customizer. -$zindex-navbar: 1000 !default; -$zindex-dropdown: 1000 !default; -$zindex-popover: 1060 !default; -$zindex-tooltip: 1070 !default; -$zindex-navbar-fixed: 1030 !default; -$zindex-modal-background: 1040 !default; -$zindex-modal: 1050 !default; - +$zindex-navbar: tokens.$coral-elevation-layer-flat !default; // 0 +$zindex-dropdown: tokens.$coral-elevation-layer-interactive-front !default; // 8 +$zindex-navbar-fixed: tokens.$coral-elevation-layer-standard-front !default; // 4 +$zindex-modal-background: tokens.$coral-elevation-layer-standard-front !default; // 4 +$zindex-modal: tokens.$coral-elevation-layer-standard-front !default; // 4 +$zindex-popover: tokens.$coral-elevation-layer-interactive-front !default; // 8 +$zindex-tooltip: tokens.$coral-elevation-layer-overlay !default; // 16 //== Media queries breakpoints // diff --git a/packages/components/src/TooltipTrigger/TooltipTrigger.module.scss b/packages/components/src/TooltipTrigger/TooltipTrigger.module.scss index 513641a03d9..76c3d466c40 100644 --- a/packages/components/src/TooltipTrigger/TooltipTrigger.module.scss +++ b/packages/components/src/TooltipTrigger/TooltipTrigger.module.scss @@ -8,7 +8,6 @@ $tc-tooltip-background: tokens.$coral-color-neutral-text !default; $tc-tooltip-border-radius: 0.2rem !default; $tc-tooltip-box-shadow: 0 0.1rem 0.3rem 0 rgba(0, 0, 0, 0.2) !default; $tc-tooltip-margin: 1rem !default; -$tc-tooltip-z-index: $zindex-tooltip !default; $tc-tooltip-arrow-border-size: 0.5rem !default; $tc-tooltip-arrow-color: $tc-tooltip-background !default; @@ -21,7 +20,7 @@ $tc-tooltip-arrow-color: $tc-tooltip-background !default; padding: 0 $tc-tooltip-margin; width: $tc-tooltip-max-width; pointer-events: none; - z-index: $tc-tooltip-z-index; + z-index: tokens.$coral-elevation-layer-overlay; } &-body { diff --git a/packages/storybook/src/design-system/Elevation/Elevation.stories.mdx b/packages/storybook/src/design-system/Elevation/Elevation.stories.mdx new file mode 100644 index 00000000000..25441a5df99 --- /dev/null +++ b/packages/storybook/src/design-system/Elevation/Elevation.stories.mdx @@ -0,0 +1,38 @@ +import { Meta, Story } from '@storybook/addon-docs'; +import { FigmaImage, FigmaLink, Use } from '~docs'; + +import { Modal } from '@talend/design-system'; + +import * as Stories from './Elevation.stories'; + + + +# Elevation for different components combination + +Different component overlay + +## Zoning + +### Variations + +**Modal with info in Popover** + + + + + +## States + +## Interactions + +## Content + +## Usage + +## Accessibility diff --git a/packages/storybook/src/design-system/Elevation/Elevation.stories.tsx b/packages/storybook/src/design-system/Elevation/Elevation.stories.tsx new file mode 100644 index 00000000000..9708e39bb94 --- /dev/null +++ b/packages/storybook/src/design-system/Elevation/Elevation.stories.tsx @@ -0,0 +1,49 @@ +import { Story, ComponentStory } from '@storybook/react'; +import { useState } from 'react'; +import { action } from '@storybook/addon-actions'; + +import { Popover, ButtonIcon, ButtonPrimary, Modal } from '@talend/design-system'; +import { ModalPropsType } from '@talend/design-system/lib/components/Modal'; + +export default { + component: Modal, +}; + +function ModalStory(props: Partial) { + const [modalOpen, setModalOpen] = useState(false); + + return ( + <> + setModalOpen(true)} data-test="open-modal"> + See + + + {modalOpen && ( + { + action('onClose'); + setModalOpen(false); + }} + {...props} + /> + )} + + ); +} + +export const DialogWithTooltipAndPopover: ComponentStory = props => ( + + action('click')}> + Hey I am tooltip. Click to see the Popover + + } + > + Hey I am Popover + + Default story child + +);