From 2c68d9a4d906e035c8dfb6baa90ea40358642c5b Mon Sep 17 00:00:00 2001 From: Stoyan Delev Date: Fri, 17 Mar 2023 15:49:32 +0200 Subject: [PATCH 1/2] docs(PPDSC-2692): update date-time stories --- src/date-time/__tests__/date-time.stories.tsx | 178 +++++++++++------- 1 file changed, 107 insertions(+), 71 deletions(-) diff --git a/src/date-time/__tests__/date-time.stories.tsx b/src/date-time/__tests__/date-time.stories.tsx index 241ca85da8..938d9766ad 100644 --- a/src/date-time/__tests__/date-time.stories.tsx +++ b/src/date-time/__tests__/date-time.stories.tsx @@ -1,90 +1,110 @@ import * as React from 'react'; +import {Story as StoryType} from '@storybook/react'; import {DateTime} from '..'; -import { - StorybookHeading, - StorybookSubHeading, -} from '../../test/storybook-comps'; +import {StorybookPage, StorybookCase} from '../../test/storybook-comps'; +import {ThemeProvider} from '../../theme'; + import {styled} from '../../utils'; +import {createCustomThemeWithBaseThemeSwitch} from '../../test/theme-select-object'; const StyledDiv = styled.div` border: 1px red dotted; `; -export const StoryDateTime = () => ( - <> - DateTime - default - - with prefix - - with suffix - - with prefix and suffix - -
- DateTime with overrides - on prefix - - on suffix - - on prefix and suffix - ( + + + + + +); +StoryDateTimeDefault.storyName = 'Default'; + +export const StoryDateTimeVariations = () => ( + + + + + + + + + + + +); +StoryDateTimeVariations.storyName = 'Variations'; + +export const StoryDateTimeLogicalProps = () => ( + + + + + + + +); +StoryDateTimeLogicalProps.storyName = 'Logical props'; + +export const StoryDateTimeOverrides = () => ( + + + - with logical props - + typographyPreset: 'utilityMeta020', + prefix: { + typographyPreset: 'utilityButton030', + stylePreset: 'inkBrand010', + }, + }} + /> + + + + + - - + + ); -StoryDateTime.storyName = 'date-time'; +StoryDateTimeOverrides.storyName = 'Styling overrides'; export default { title: 'Components/Date Time', @@ -97,4 +117,20 @@ export default { 'The date time component is a styled, HTML5 time element for displaying date and time.', }, }, + decorators: [ + ( + Story: StoryType, + context: {name: string; globals: {backgrounds: {value: string}}}, + ) => ( + + + + ), + ], }; From b728b7cc4b16e42683fb5973434fad70a0f51325 Mon Sep 17 00:00:00 2001 From: Stoyan Delev Date: Mon, 20 Mar 2023 10:07:44 +0200 Subject: [PATCH 2/2] docs(PPDSC-2692): fix url in docs --- site/pages/components/date-time.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/pages/components/date-time.tsx b/site/pages/components/date-time.tsx index c75a2aa799..97d1c930ea 100644 --- a/site/pages/components/date-time.tsx +++ b/site/pages/components/date-time.tsx @@ -35,7 +35,7 @@ const DateTimeComponent = (layoutProps: LayoutProps) => ( introduced: 'v0.18.0', codeUrl: 'https://github.com/newscorp-ghfb/newskit/tree/main/src/date-time', - storybookId: 'components-date-time--story-date-time', + storybookId: 'components-date-time--story-date-time-default', figmaUrl: 'https://www.figma.com/file/FSbCQa6SzVR3K48ZWLeD77/%F0%9F%9F%A2-NK-Web-Components?node-id=2057%3A5&t=iP77Jd8O6cCJYM4p-1', }}