From f530a059dfd8a04c3efaeee1a15bd48041512696 Mon Sep 17 00:00:00 2001 From: ChitlangeSahas Date: Fri, 4 Nov 2022 14:40:09 -0700 Subject: [PATCH 1/2] feat(Notifications): Clockface 4 updates --- .../Documentation/FunnelPage.stories.tsx | 2 - .../Documentation/Notification.stories.tsx | 13 ----- src/Components/Notification/Notification.scss | 19 ++++--- src/Components/Notification/Notification.tsx | 11 +--- .../Notification/NotificationDialog.tsx | 54 ++++++++----------- src/Sandbox/Portals.stories.tsx | 9 +--- src/Types/index.tsx | 20 ++++++- 7 files changed, 51 insertions(+), 77 deletions(-) diff --git a/src/Components/FunnelPage/Documentation/FunnelPage.stories.tsx b/src/Components/FunnelPage/Documentation/FunnelPage.stories.tsx index e69a286a..86bca2d8 100644 --- a/src/Components/FunnelPage/Documentation/FunnelPage.stories.tsx +++ b/src/Components/FunnelPage/Documentation/FunnelPage.stories.tsx @@ -31,7 +31,6 @@ import { ComponentSize, Columns, HeadingElement, - Gradients, } from '../../../Types' // Notes @@ -224,7 +223,6 @@ funnelPageExampleStories.add( size={ComponentSize.Small} visible={notificationState} icon={IconFont.Zap} - gradient={Gradients.KawaiiDesu} onDismiss={handleDismissNotification} > Yeehaw I'm a notification diff --git a/src/Components/Notification/Documentation/Notification.stories.tsx b/src/Components/Notification/Documentation/Notification.stories.tsx index 6f10a46d..644b70df 100644 --- a/src/Components/Notification/Documentation/Notification.stories.tsx +++ b/src/Components/Notification/Documentation/Notification.stories.tsx @@ -10,7 +10,6 @@ import { text, select, boolean, - color, number, object, } from '@storybook/addon-knobs' @@ -31,7 +30,6 @@ import {Notification, NotificationDialog, NotificationDialogRef} from '../index' import { IconFont, Gradients, - InfluxColors, Alignment, VerticalAlignment, ComponentSize, @@ -231,7 +229,6 @@ notificationStories.add( id={notification.id} visible={notification.visible} icon={notification.icon} - gradient={notification.gradient} onDismiss={handleDismiss} size={ComponentSize.Small} horizontalAlignment={notification.horizontalAlign} @@ -285,15 +282,6 @@ notificationStories.add( ) ] } - gradient={ - Gradients[ - select( - 'gradient', - {None: 'none', ...mapEnumKeys(Gradients)}, - 'GarageBand' - ) - ] - } color={ ComponentColor[ select( @@ -303,7 +291,6 @@ notificationStories.add( ) ] } - backgroundColor={color('backgroundColor', `${InfluxColors.Castle}`)} onDismiss={boolean('dismissable', true) ? handleClose : undefined} > {text('text', 'Congrats! The thing has happened!')} diff --git a/src/Components/Notification/Notification.scss b/src/Components/Notification/Notification.scss index 9fb4c141..dfb2a8c1 100644 --- a/src/Components/Notification/Notification.scss +++ b/src/Components/Notification/Notification.scss @@ -9,12 +9,11 @@ $cf-notification-screen-margin: $cf-space-s; .cf-notification { margin-bottom: $cf-space-3xs; - color: $g18-cloud; + color: $cf-white; display: inline-flex; justify-content: space-between; align-items: center; - border-radius: $cf-radius; - font-weight: $cf-font-weight--medium; + border-radius: $cf-radius*2; .cf-notification--contents { display: inline-flex; @@ -30,7 +29,7 @@ $cf-notification-screen-margin: $cf-space-s; } .cf-notification--icon { - font-size: 1.125em; + font-size: 1.5em; margin-right: $cf-space-s; display: inline-flex; flex-shrink: 0; @@ -44,8 +43,8 @@ $cf-notification-screen-margin: $cf-space-s; background-color: transparent; background-image: none; border: none; - color: $g18-cloud; - opacity: 0.6; + color: $cf-white; + font-size: 1.5em; transition: opacity $cf-transition-default, transform $cf-transition-default; &:active, @@ -145,17 +144,17 @@ $cf-notification-screen-margin: $cf-space-s; */ .cf-notification__dark-text { - color: rgba($g2-kevlar, 0.85); + color: $cf-grey-1; .cf-notification--dismiss { - color: rgba($g2-kevlar, 0.85); + color: $cf-grey-1; } } .cf-notification__light-text { - color: rgba($g20-white, 0.85); + color: $cf-white; .cf-notification--dismiss { - color: rgba($g20-white, 0.85); + color: $cf-white; } } diff --git a/src/Components/Notification/Notification.tsx b/src/Components/Notification/Notification.tsx index 1c57470c..621096ca 100644 --- a/src/Components/Notification/Notification.tsx +++ b/src/Components/Notification/Notification.tsx @@ -7,12 +7,7 @@ import * as easings from 'd3-ease' import {NotificationDialog} from './NotificationDialog' // Types -import { - Alignment, - InfluxColors, - VerticalAlignment, - ComponentSize, -} from '../../Types' +import {Alignment, VerticalAlignment, ComponentSize} from '../../Types' import { NotificationDialogProps, NotificationDialogRef, @@ -52,11 +47,9 @@ export const NotificationRoot = forwardRef( visible = true, duration = Infinity, children, - gradient, onDismiss, className, onTimeout, - backgroundColor = InfluxColors.Castle, verticalAlignment = VerticalAlignment.Top, horizontalAlignment = Alignment.Right, }, @@ -115,10 +108,8 @@ export const NotificationRoot = forwardRef( visible && (props => (