From 8db410a2b938e3240f09b71e34a524fbb4ebe459 Mon Sep 17 00:00:00 2001 From: Barsnes Date: Wed, 5 Jun 2024 13:44:25 +0200 Subject: [PATCH] update showcase in SB --- apps/storybook/preview.tsx | 3 + packages/css/card.css | 3 + packages/react/stories/showcase.module.css | 120 ++++------- packages/react/stories/showcase.stories.tsx | 219 +++++++++++++++----- packages/react/stories/testing.stories.tsx | 13 ++ 5 files changed, 219 insertions(+), 139 deletions(-) diff --git a/apps/storybook/preview.tsx b/apps/storybook/preview.tsx index 98e5449e9a..e3e6024b43 100644 --- a/apps/storybook/preview.tsx +++ b/apps/storybook/preview.tsx @@ -162,6 +162,9 @@ const preview: Preview = { viewport: { viewports, }, + backgrounds: { + disable: true, + }, }, }; diff --git a/packages/css/card.css b/packages/css/card.css index e6299942c1..e5cbc4e741 100644 --- a/packages/css/card.css +++ b/packages/css/card.css @@ -74,6 +74,7 @@ font: var(--ds-typography-paragraph-md); font-family: inherit; padding: var(--ds-spacing-2) 0; + color: inherit; } .fds-card__content { @@ -88,6 +89,7 @@ font: var(--ds-typography-heading-md); font-family: inherit; padding: var(--ds-spacing-2) 0; + color: inherit; } .fds-card--link h1, @@ -99,6 +101,7 @@ text-decoration: underline; text-decoration-thickness: max(1px, 0.0625rem, 0.1025em); text-underline-offset: max(6px, 0.25rem, 0.22em); + color: inherit; } .fds-card--neutral { diff --git a/packages/react/stories/showcase.module.css b/packages/react/stories/showcase.module.css index a3f8e83f1d..0d665444ad 100644 --- a/packages/react/stories/showcase.module.css +++ b/packages/react/stories/showcase.module.css @@ -1,16 +1,19 @@ .components { width: 100%; display: grid; - grid-template-columns: repeat(5, 1fr); + grid-template-columns: repeat(4, 1fr); gap: var(--ds-spacing-8); max-width: 1440px; margin: 0 auto; + background-color: var(--ds-color-neutral-background-default); + border-radius: var(--ds-border-radius-md); + padding: 1rem; } -.components > * { - border: 1px solid var(--ds-color-accent-base-default); +.card { + background-color: var(--ds-color-neutral-background-subtle); border-radius: var(--ds-border-radius-md); - padding: 16px; + padding: 24px; } .cardTitle { @@ -18,49 +21,53 @@ } .checkbox { + grid-column: span 2; padding-bottom: 16px; - grid-column: 1; } -.login { - grid-column: 2; +.user { + grid-column: span 2; } .tableContainer { - grid-column: 3 / 6; + grid-column: span 4; } .help { - grid-column: 1 / 3; + grid-column: span 4; } -.tags { - grid-column: 3; +.radio { + grid-column: span 2; } -.radios { - grid-column: 5; +.tag { + grid-column: span 2; } .switches { - grid-column: 4; + grid-column: span 2; +} + +.combobox { + grid-column: span 2; } .tabs { + grid-column: span 4; display: flex; gap: 16px; flex-direction: column; - grid-column: 1 / 3; } .faq { - grid-column: 4 / 6; + grid-column: span 4; } .userLink { - text-align: right; - margin-top: var(--ds-spacing-5); + margin-top: 20px; margin-left: auto; + font-size: 16px; } .userTitle { @@ -80,6 +87,10 @@ margin-top: -7px; } +.tabs button { + min-height: 40px; +} + .table { width: 100%; margin-bottom: 24px; @@ -102,6 +113,7 @@ height: 36px; width: 36px; border-radius: 50%; + box-shadow: 0 0 4px #353535; } .tableAction { @@ -129,6 +141,7 @@ } .helpCards { + grid-column: 1 / 6; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; @@ -160,77 +173,14 @@ margin-top: 16px; } -.accordion > div button { - border-top: 1px solid var(--brandThree6); - border-radius: 0; -} - -.accordion > div:first-child button { - border: none; - border-radius: 4px 4px 0 0; -} - -.footerOne { - background-color: var(--brandOne9); - background-color: white; -} - -.footerOne h1 { - color: var(--brandOne14); -} - -.footerOne a { - color: var(--brandOne15); -} - -.footerTwo { - background-color: var(--brandTwo9); -} - -.footerTwo h1 { - color: var(--brandTwo14); -} - -.footerTwo a { - color: var(--brandTwo15); -} - -.footerThree { - background-color: var(--brandThree9); -} - -.footerThree h1 { - color: var(--brandThree14); -} - -.footerThree a { - color: var(--brandThree15); -} - -.footerHeading { - margin-bottom: 14px; -} - -.footerList { - display: flex; - flex-direction: column; - gap: 20px; -} - .switchGroup { display: flex; gap: 26px; flex-direction: column; } -.switchHeading { - margin-bottom: 12px; -} - -.switchParagraph { - margin-bottom: 20px; -} - -.panel { - background-color: white; +.toggleCombo { + display: flex; + flex-direction: column; + gap: var(--ds-spacing-2); } diff --git a/packages/react/stories/showcase.stories.tsx b/packages/react/stories/showcase.stories.tsx index f20007d95a..f65a06f75f 100644 --- a/packages/react/stories/showcase.stories.tsx +++ b/packages/react/stories/showcase.stories.tsx @@ -20,6 +20,9 @@ import { Paragraph, Accordion, Switch, + Combobox, + ToggleGroup, + Tooltip, } from '../src'; import classes from './showcase.module.css'; @@ -32,7 +35,7 @@ export const Showcase: StoryFn = () => { const [radioValue, setRadioValue] = useState('vanilje'); return (
-
+
{ To liter Farris Blomkål + + Pizza + + + Tre liter lettmelk + 2kg smågodt 10 poser med Smash
-
+
{ placeholder='Ola Normann' className={classes.userField} /> - + - Glemt passord? - + + Glemt passord? + +
-
+
{ @@ -116,6 +142,7 @@ export const Showcase: StoryFn = () => {
@@ -140,8 +167,8 @@ export const Showcase: StoryFn = () => { Bilde av dame Lise Nordmann @@ -152,8 +179,8 @@ export const Showcase: StoryFn = () => { Bilde av mann Ola Nordmann @@ -171,7 +198,7 @@ export const Showcase: StoryFn = () => { totalPages={6} /> -
+
{ Most provide as with carried business are much better more the. - - - Mat og helse - - - Most provide as with carried business are much better more the. - + + + + Mat og helse + + + Lenke til artikkel om mat og helse, der du kan lese mer om alt. + +
-
+
+ setRadioValue(e)} + > + Vanilje + Jordbær + Sjokolade + Jeg spiser ikke iskrem + +
+
Emner
{ > Utenriks - {/* + Helse og velvære - + PC Gaming - + Trening og livsstil - */} +
-
+
Innstillinger Her kan du justere på innstillingene dine
+ + TV-visning + Desktopvisning Tabletvisning - Mobilvisning + + Mobilvisning +
-
- + + Hvor er du fra? + + setRadioValue(e)} + spacing > - Vanilje - Jordbær - Sjokolade - Jeg spiser ikke iskrem - + Svar under så finner vi flyreise + +
+ + Norge + Sverige + Utlandet + + + Fant ingen treff + Leikanger + Oslo + Brønnøysund + Stavanger + Trondheim + Tromsø + Bergen + Mo i Rana + +
-
+
{ For å kunne bli registrert i{' '} - Frivillighetsregisteret, må organisasjonen drive - frivillig virksomhet. Det er bare foreninger,{' '} - stiftelser og som kan registreres. Virksomheten - kan ikke dele ut midler til fysiske personer. Virksomheten må ha et - styre. Virksomheten må være registrert i{' '} - Enhetsregisteret før den kan bli registrert. + + Frivillighetsregisteret + + , må organisasjonen drive frivillig virksomhet. Det er bare + foreninger,{' '} + + stiftelser + {' '} + og som kan registreres. Virksomheten kan ikke dele ut midler til + fysiske personer. Virksomheten må ha et styre. Virksomheten må være + registrert i{' '} + + Enhetsregisteret + {' '} + før den kan bli registrert.
- -
+
- Ofte stillte spørmsål + Ofte stillte spørsmål diff --git a/packages/react/stories/testing.stories.tsx b/packages/react/stories/testing.stories.tsx index 6c2e4859ba..b161ecfd68 100644 --- a/packages/react/stories/testing.stories.tsx +++ b/packages/react/stories/testing.stories.tsx @@ -14,6 +14,19 @@ import { export default { title: 'Testing', + decorators: [ + (Story) => ( +
+ +
+ ), + ], } as Meta; export const MediumRow: StoryFn<{