diff --git a/src/stories/Blocks/reservation-page/ReservationPage.stories.tsx b/src/stories/Blocks/reservation-page/ReservationPage.stories.tsx
index 3081f3326..f07152311 100644
--- a/src/stories/Blocks/reservation-page/ReservationPage.stories.tsx
+++ b/src/stories/Blocks/reservation-page/ReservationPage.stories.tsx
@@ -1,38 +1,38 @@
-import { ComponentStory } from "@storybook/react";
-import { withDesign } from "storybook-addon-designs";
+import { StoryFn } from "@storybook/react";
import ReservationPage, { ReservationPageProps } from "./ReservationPage";
export default {
title: "Blocks / Reservation / Reservation Page",
component: ReservationPage,
- decorators: [withDesign],
argTypes: {
headline: {
name: "Headline",
- defaultValue: "Your reservations",
control: { type: "text" },
},
readyForPickup: {
name: "Ready for pickup amount",
- defaultValue: 2,
control: { type: "number" },
},
physicalReservations: {
name: "Physical reservations amount",
- defaultValue: 2,
control: { type: "number" },
},
digitalReservations: {
name: "Digital reservations amount",
- defaultValue: 2,
control: { type: "number" },
},
skeletonVersion: {
name: "Is skeleton version?",
- defaultValue: false,
control: { type: "boolean" },
},
},
+ args: {
+ headline: "Your reservations",
+ readyForPickup: 2,
+ physicalReservations: 2,
+ digitalReservations: 2,
+ skeletonVersion: false,
+ },
parameters: {
design: {
type: "figma",
@@ -41,8 +41,8 @@ export default {
},
};
-const Template: ComponentStory = (
- args: ReservationPageProps
+const Template: StoryFn = (
+ args: ReservationPageProps,
) => ;
export const Default = Template.bind({});
diff --git a/src/stories/Blocks/reservation/forms/form.stories.tsx b/src/stories/Blocks/reservation/forms/form.stories.tsx
index b5de186e0..3472f98e1 100644
--- a/src/stories/Blocks/reservation/forms/form.stories.tsx
+++ b/src/stories/Blocks/reservation/forms/form.stories.tsx
@@ -1,5 +1,4 @@
-import { withDesign } from "storybook-addon-designs";
-import { ComponentMeta, ComponentStory } from "@storybook/react";
+import { Meta, StoryFn } from "@storybook/react";
import Reservation from "../../../Library/Modals/modal-reservation/Reservation";
import Email from "./Email";
import Sms from "./Sms";
@@ -9,7 +8,6 @@ import Collect from "./Collect";
export default {
title: "Blocks / Reservation / Forms",
component: Email,
- decorators: [withDesign],
parameters: {
design: {
type: "figma",
@@ -17,18 +15,18 @@ export default {
},
},
argTypes: {},
-} as ComponentMeta;
+} as Meta;
-const EmailModalTemplate: ComponentStory = (args) => {
+const EmailModalTemplate: StoryFn = (args) => {
return ;
};
-const SmsModalTemplate: ComponentStory = (args) => {
+const SmsModalTemplate: StoryFn = (args) => {
return ;
};
-const ExpirationModalTemplate: ComponentStory = (args) => {
+const ExpirationModalTemplate: StoryFn = (args) => {
return ;
};
-const CollectModalTemplate: ComponentStory = (args) => {
+const CollectModalTemplate: StoryFn = (args) => {
return ;
};
export const EmailModal = EmailModalTemplate.bind({});
diff --git a/src/stories/Blocks/status-loans/statusLoans.stories.tsx b/src/stories/Blocks/status-loans/statusLoans.stories.tsx
index 78ae4b6b9..47e34f10a 100644
--- a/src/stories/Blocks/status-loans/statusLoans.stories.tsx
+++ b/src/stories/Blocks/status-loans/statusLoans.stories.tsx
@@ -1,4 +1,4 @@
-import { ComponentMeta, ComponentStory } from "@storybook/react";
+import { Meta, StoryFn } from "@storybook/react";
import { StatusLoans as StatusLoansComp } from "./statusLoans";
export default {
@@ -11,37 +11,34 @@ export default {
},
},
argTypes: {
- statusBarsData: {
- defaultValue: [
- {
- title: "Lån pr. måned",
- statusBars: [
- { amount: 1, fullAmount: 4, title: "Ebøger", outOf: "ud af" },
- { amount: 2, fullAmount: 10, title: "Lydbøger", outOf: "ud af" },
- ],
- },
- ],
- },
- title: {
- defaultValue: "Digitale lån (Ereolen)",
- },
- bread: {
- defaultValue:
- "På mange digitale materialer, er der er begrænsning på, hvor mange du kan låne pr. måned. Der findes dog en række materialer uden begrænsning.",
- },
- reservationsText: {
- defaultValue: "You can reserve 3 ebooks and 3 audiobooks",
- },
- link: {
- defaultValue: {
- text: "Se titler du altid kan låne",
- link: "https://www.figma.com/file/xouARmJCONbzbZhpD8XpcM/Brugerprofil?node-id=1239%3A66855",
+ statusBarsData: { control: "object" },
+ title: { control: "text" },
+ bread: { control: "text" },
+ reservationsText: { control: "text" },
+ link: { control: "object" },
+ },
+ args: {
+ statusBarsData: [
+ {
+ title: "Lån pr. måned",
+ statusBars: [
+ { amount: 1, fullAmount: 4, title: "Ebøger", outOf: "ud af" },
+ { amount: 2, fullAmount: 10, title: "Lydbøger", outOf: "ud af" },
+ ],
},
+ ],
+ title: "Digitale lån (Ereolen)",
+ bread:
+ "På mange digitale materialer, er der er begrænsning på, hvor mange du kan låne pr. måned. Der findes dog en række materialer uden begrænsning.",
+ reservationsText: "You can reserve 3 ebooks and 3 audiobooks",
+ link: {
+ text: "Se titler du altid kan låne",
+ link: "https://www.figma.com/file/xouARmJCONbzbZhpD8XpcM/Brugerprofil?node-id=1239%3A66855",
},
},
-} as ComponentMeta;
+} as Meta;
-const Template: ComponentStory = (args) => (
+const Template: StoryFn = (args) => (
);
diff --git a/src/stories/Blocks/status-loans/statusLoans.tsx b/src/stories/Blocks/status-loans/statusLoans.tsx
index 375a66781..5f1b37c8f 100644
--- a/src/stories/Blocks/status-loans/statusLoans.tsx
+++ b/src/stories/Blocks/status-loans/statusLoans.tsx
@@ -55,7 +55,7 @@ export const StatusLoans = (props: StatusLoansProps) => {
outOf={outOf}
amount={amount}
/>
- )
+ ),
)}
))}
diff --git a/src/stories/Blocks/status-userprofile/statusUserprofile.stories.tsx b/src/stories/Blocks/status-userprofile/statusUserprofile.stories.tsx
index c99b8d4b2..bda5d45b7 100644
--- a/src/stories/Blocks/status-userprofile/statusUserprofile.stories.tsx
+++ b/src/stories/Blocks/status-userprofile/statusUserprofile.stories.tsx
@@ -1,4 +1,4 @@
-import { ComponentMeta, ComponentStory } from "@storybook/react";
+import { Meta, StoryFn } from "@storybook/react";
import { StatusUserprofile as StatusUserprofileComp } from "./statusUserprofile";
export default {
@@ -13,104 +13,75 @@ export default {
allowFullscreen: true,
},
argTypes: {
- loansTitle: {
- control: { type: "object" },
- defaultValue: [
- {
- title: "Fysiske lån",
- href: "/",
- counter: "12",
- },
- ],
- },
- loans: {
- control: { type: "object" },
- defaultValue: [
- {
- label: {
- label: "overskredet",
- status: "danger",
- },
- number: {
- label: 1,
- status: "danger",
- },
- title: "Afleveret for sent",
- showDot: true,
- href: "/",
- },
- {
- label: {
- label: "Udløber snart",
- status: "warning",
- },
- number: {
- label: 3,
- status: "warning",
- },
- title: "Afleveres snart",
- showDot: true,
- href: "/",
- },
- {
- number: {
- label: 8,
- status: "neutral",
- },
- title: "Længere afleveringstid",
- showDot: false,
- href: "/",
- },
- ],
- },
- reservationsTitle: {
- control: { type: "object" },
- defaultValue: [
- {
- title: "Reserveringer",
- href: "/",
- counter: "12",
- },
- ],
- },
- reservations: {
- control: { type: "object" },
- defaultValue: [
- {
- label: {
- label: "klar til lån",
- status: "info",
- },
- number: {
- label: 2,
- status: "info",
- },
- title: "Klar til dig",
- showDot: true,
- href: "/",
- },
- {
- number: {
- label: 10,
- status: "neutral",
- },
- title: "Stadig i kø",
- showDot: false,
- href: "/",
- },
- ],
- },
+ loansTitle: { control: { type: "object" } },
+ loans: { control: { type: "object" } },
+ reservationsTitle: { control: { type: "object" } },
+ reservations: { control: { type: "object" } },
},
-} as ComponentMeta
;
+} as Meta;
-const Template: ComponentStory = (args) => (
+const Template: StoryFn = (args) => (
);
export const StatusUserprofile = Template.bind({});
+StatusUserprofile.args = {
+ loansTitle: [
+ {
+ title: "Fysiske lån",
+ href: "/",
+ counter: "12",
+ },
+ ],
+ loans: [
+ {
+ label: { label: "overskredet", status: "danger" },
+ number: { label: 1, status: "danger" },
+ title: "Afleveret for sent",
+ showDot: true,
+ href: "/",
+ },
+ {
+ label: { label: "Udløber snart", status: "warning" },
+ number: { label: 3, status: "warning" },
+ title: "Afleveres snart",
+ showDot: true,
+ href: "/",
+ },
+ {
+ label: { label: "Længere afleveringstid", status: "neutral" },
+ number: { label: 8, status: "neutral" },
+ title: "Længere afleveringstid",
+ showDot: false,
+ href: "/",
+ },
+ ],
+ reservationsTitle: [
+ {
+ title: "Reserveringer",
+ href: "/",
+ counter: "12",
+ },
+ ],
+ reservations: [
+ {
+ label: { label: "klar til lån", status: "info" },
+ number: { label: 2, status: "info" },
+ title: "Klar til dig",
+ showDot: true,
+ href: "/",
+ },
+ {
+ label: { label: "Stadig i kø", status: "neutral" },
+ number: { label: 10, status: "neutral" },
+ title: "Stadig i kø",
+ showDot: false,
+ href: "/",
+ },
+ ],
+};
export const StatusUserprofileEmpty = Template.bind({});
-
StatusUserprofileEmpty.parameters = {
design: {
type: "figma",
@@ -119,33 +90,21 @@ StatusUserprofileEmpty.parameters = {
layout: "fullscreen",
allowFullscreen: true,
};
-StatusUserprofileEmpty.argTypes = {
- loansTitle: {
- control: { type: "object" },
- defaultValue: [
- {
- title: "Fysiske lån",
- href: "/",
- counter: "0",
- },
- ],
- },
- loans: {
- control: { type: "object" },
- defaultValue: [],
- },
- reservationsTitle: {
- control: { type: "object" },
- defaultValue: [
- {
- title: "Reserveringer",
- href: "/",
- counter: "0",
- },
- ],
- },
- reservations: {
- control: { type: "object" },
- defaultValue: [],
- },
+StatusUserprofileEmpty.args = {
+ loansTitle: [
+ {
+ title: "Fysiske lån",
+ href: "/",
+ counter: "0",
+ },
+ ],
+ loans: [],
+ reservationsTitle: [
+ {
+ title: "Reserveringer",
+ href: "/",
+ counter: "0",
+ },
+ ],
+ reservations: [],
};
diff --git a/src/stories/Introduction.stories.mdx b/src/stories/Introduction.mdx
similarity index 52%
rename from src/stories/Introduction.stories.mdx
rename to src/stories/Introduction.mdx
index 79c858684..279ae1b16 100644
--- a/src/stories/Introduction.stories.mdx
+++ b/src/stories/Introduction.mdx
@@ -1,123 +1,125 @@
-import { Meta } from "@storybook/addon-docs";
+import { Meta } from "@storybook/blocks";
-
+
+ .link-item img {
+ height: 40px;
+ width: 40px;
+ margin-right: 15px;
+ flex: none;
+ }
+
+ .link-item span {
+ font-size: 14px;
+ line-height: 20px;
+ }
+
+ .tip {
+ display: inline-block;
+ border-radius: 1em;
+ font-size: 11px;
+ line-height: 12px;
+ font-weight: 700;
+ background: #E7FDD8;
+ color: #66BF3C;
+ padding: $s-xs 12px;
+ margin-right: 10px;
+ vertical-align: top;
+ }
+
+ .tip-wrapper {
+ font-size: 13px;
+ line-height: 20px;
+ margin-top: 40px;
+ margin-bottom: 40px;
+ }
+
+ .tip-wrapper code {
+ font-size: 12px;
+ display: inline-block;
+ }
+
+
+ `}
+
# DPL Design System in Storybook
What is DPL Design System
DPL Design System is a library of UI components that should be used as a common base system for "Danmarks Biblioteker" / "Det Digitale Folkebibliotek".
-The design is implemented via Storybook/React and is output with HTML markup and css-classes through an addon in Storybook.
+The design is implemented via Storybook/React and is output with HTML markup and css-classes through an addon in Storybook.
The codebase follows the naming that designers have used in Figma closely to ensure consistency.
What is storybook
-Storybook is an open source tool for building UI components and pages in isolation from your app's business logic, data, and context.
-Storybook helps you document components for reuse and automatically visually test your components to prevent bugs.
+Storybook is an open source tool for building UI components and pages in isolation from your app's business logic, data, and context.
+Storybook helps you document components for reuse and automatically visually test your components to prevent bugs.
It promotes the [**component-driven**](https://componentdriven.org) process and agile development.
It is possible to extend Storybook with an ecosystem of addons that help you do things like fine-tune responsive layouts or verify accessibility.
@@ -149,34 +151,34 @@ divide into folders fx. `Library / Buttons / Button`
Storybook ships with some essential pre-installed [**addons**](https://storybook.js.org/addons/tag/essentials/) to power the core Storybook experience.
-- [**Controls**](https://storybook.js.org/addons/@storybook/addon-controls/)
-- [**Actions**](https://storybook.js.org/addons/@storybook/addon-actions/)
-- [**Docs**](https://storybook.js.org/addons/@storybook/addon-docs/)
-- [**Viewport**](https://storybook.js.org/addons/@storybook/addon-viewport/)
-- [**Backgrounds**](https://storybook.js.org/addons/@storybook/addon-backgrounds/)
-- [**Toolbars**](https://storybook.js.org/addons/@storybook/addon-toolbars/)
-- [**Measure**](https://storybook.js.org/addons/@storybook/addon-measure/)
-- [**Outline**](https://storybook.js.org/addons/@storybook/addon-outline/)
+* [**Controls**](https://storybook.js.org/addons/@storybook/addon-controls/)
+* [**Actions**](https://storybook.js.org/addons/@storybook/addon-actions/)
+* [**Docs**](https://storybook.js.org/addons/@storybook/addon-docs/)
+* [**Viewport**](https://storybook.js.org/addons/@storybook/addon-viewport/)
+* [**Backgrounds**](https://storybook.js.org/addons/@storybook/addon-backgrounds/)
+* [**Toolbars**](https://storybook.js.org/addons/@storybook/addon-toolbars/)
+* [**Measure**](https://storybook.js.org/addons/@storybook/addon-measure/)
+* [**Outline**](https://storybook.js.org/addons/@storybook/addon-outline/)
There are many other helpful addons to customise the usage and experience.
Additional addons used for this project:
-- [**HTML / storybook-addon-html**](https://storybook.js.org/addons/@whitespace/storybook-addon-html/):
+* [**HTML / storybook-addon-html**](https://storybook.js.org/addons/@whitespace/storybook-addon-html/):
This addon is used to display compiled HTML markup for each story and make it easier for developers to grab the code.
Because we are developing with React, it is necessary to be able to show the HTML markup with the css-classes to make it easier for other developers that will implement it in the future.
If a story has controls the HTML markup changes according to the controls that are set.
-- [**Designs / storybook-addon-designs**](https://storybook.js.org/addons/storybook-addon-designs/):
+* [**Designs / storybook-addon-designs**](https://storybook.js.org/addons/storybook-addon-designs/):
This addon is used to embed Figma in the addon panel for a better design-development workflow.
-- [**A11Y**](https://storybook.js.org/addons/@storybook/addon-a11y/):
+* [**A11Y**](https://storybook.js.org/addons/@storybook/addon-a11y/):
This addon is used to check the accessibility of the components.
All the addons can be found in `storybook/main.js` directory.
Important to notice
-**Internal classes**
+**Internal classes**
To display some of the components (fx Colors, Spacing) in a more presentable way, we are using some "internal" css-classes which can be found in the `styles/internal.scss` file.
All css-classes with "internal" in the front should therefore be ignored in the HTML markup.
diff --git a/src/stories/Library/Arrows/icon-arrow-accent/ArrowAccent.stories.tsx b/src/stories/Library/Arrows/icon-arrow-accent/ArrowAccent.stories.tsx
index 9eed64765..c8baa1317 100644
--- a/src/stories/Library/Arrows/icon-arrow-accent/ArrowAccent.stories.tsx
+++ b/src/stories/Library/Arrows/icon-arrow-accent/ArrowAccent.stories.tsx
@@ -1,11 +1,10 @@
import { Meta } from "@storybook/react";
-import { withDesign } from "storybook-addon-designs";
+
import { ReactComponent as ArrowAccentIcon } from "../../../../public/icons/arrow-accent/icon-arrow-accent.svg";
const StoryBase: Meta = {
title: "Library / Arrows / Arrow Accent",
component: ArrowAccentIcon,
- decorators: [withDesign],
parameters: {
design: {
type: "figma",
diff --git a/src/stories/Library/Arrows/icon-arrow-ui/ArrowUI.stories.tsx b/src/stories/Library/Arrows/icon-arrow-ui/ArrowUI.stories.tsx
index a88abfe70..afd0be8df 100644
--- a/src/stories/Library/Arrows/icon-arrow-ui/ArrowUI.stories.tsx
+++ b/src/stories/Library/Arrows/icon-arrow-ui/ArrowUI.stories.tsx
@@ -1,23 +1,25 @@
-import { withDesign } from "storybook-addon-designs";
-import { StoryBaseType } from "../../../../types/StorybookHelpers";
+import { Meta, StoryFn } from "@storybook/react";
+import { IconArrow as ArrowComp } from "./ArrowUI";
-import { IconArrow as ArrowComp, IconArrowProps } from "./ArrowUI";
-
-const StoryBase: StoryBaseType = {
+export default {
title: "Library / Arrows / Arrow UI",
component: ArrowComp,
- decorators: [withDesign],
argTypes: {
direction: {
- defaultValue: "right",
+ control: { type: "select" },
},
hover: {
- defaultValue: true,
+ control: { type: "boolean" },
},
size: {
- defaultValue: "large",
+ control: { type: "select" },
},
},
+ args: {
+ direction: "right",
+ hover: true,
+ size: "large",
+ },
parameters: {
design: {
type: "figma",
@@ -25,14 +27,14 @@ const StoryBase: StoryBaseType = {
},
layout: "centered",
},
-};
+} as Meta;
-export default StoryBase;
-
-export const ArrowUI = (props: IconArrowProps) => (
+const Template: StoryFn = (props) => (
To animate the arrow on hover, we have to embed the svg inline
);
+
+export const ArrowUI = Template.bind({});
diff --git a/src/stories/Library/Buttons/button-favourite/ButtonFavourite.stories.tsx b/src/stories/Library/Buttons/button-favourite/ButtonFavourite.stories.tsx
index 9e1f9f963..b7053e43c 100644
--- a/src/stories/Library/Buttons/button-favourite/ButtonFavourite.stories.tsx
+++ b/src/stories/Library/Buttons/button-favourite/ButtonFavourite.stories.tsx
@@ -1,12 +1,10 @@
-import { ComponentStory, ComponentMeta } from "@storybook/react";
-import { withDesign } from "storybook-addon-designs";
+import { StoryFn, Meta } from "@storybook/react";
import { ButtonFavourite } from "./ButtonFavourite";
export default {
title: "Library / Buttons / Button Favourite",
component: ButtonFavourite,
- decorators: [withDesign],
parameters: {
design: {
type: "figma",
@@ -17,14 +15,15 @@ export default {
argTypes: {
fill: {
control: "boolean",
- defaultValue: true,
},
},
-} as ComponentMeta;
+ args: {
+ fill: true,
+ },
+} as Meta;
-const Template: ComponentStory = (args) => (
+const Template: StoryFn = (args) => (
);
export const favourite = Template.bind({});
-favourite.args = {};
diff --git a/src/stories/Library/Buttons/button-ui/ButtonUI.stories.tsx b/src/stories/Library/Buttons/button-ui/ButtonUI.stories.tsx
index 30d9cf0bb..3b44bdfab 100644
--- a/src/stories/Library/Buttons/button-ui/ButtonUI.stories.tsx
+++ b/src/stories/Library/Buttons/button-ui/ButtonUI.stories.tsx
@@ -1,28 +1,31 @@
-import { ComponentStory, ComponentMeta } from "@storybook/react";
-import { withDesign } from "storybook-addon-designs";
+import { StoryFn, Meta } from "@storybook/react";
-import { ButtonUI } from "./ButtonUI";
+import { ButtonUI, ButtonUIProps } from "./ButtonUI";
export default {
- title: "Library / Buttons / Button",
+ title: "Library / Buttons / ButtonUI",
component: ButtonUI,
- decorators: [withDesign],
argTypes: {
- label: {
- defaultValue: "Se hele kalenderen",
+ content: {
+ control: "object",
},
- disabled: {
- defaultValue: false,
- },
- collapsible: {
- defaultValue: false,
- },
- size: {
- defaultValue: "medium",
- },
- variant: {
- defaultValue: "outline",
+ ariaLabel: { control: "text" },
+ label: { control: "text" },
+ disabled: { control: "boolean" },
+ collapsible: { control: "boolean" },
+ size: { control: "select" },
+ variant: { control: "select" },
+ },
+ args: {
+ content: {
+ kind: "LABEL",
+ label: "Se hele kalenderen",
},
+ ariaLabel: "Calendar button",
+ disabled: false,
+ collapsible: false,
+ size: "medium",
+ variant: "outline",
},
parameters: {
design: {
@@ -31,9 +34,9 @@ export default {
},
layout: "centered",
},
-} as ComponentMeta;
+} as Meta;
-const Template: ComponentStory = (args) => (
+const Template: StoryFn = (args: ButtonUIProps) => (
);
diff --git a/src/stories/Library/Buttons/button/Button.stories.tsx b/src/stories/Library/Buttons/button/Button.stories.tsx
index 7860df494..0429456c5 100644
--- a/src/stories/Library/Buttons/button/Button.stories.tsx
+++ b/src/stories/Library/Buttons/button/Button.stories.tsx
@@ -1,28 +1,25 @@
-import { ComponentStory, ComponentMeta } from "@storybook/react";
-import { withDesign } from "storybook-addon-designs";
+import { StoryFn, Meta } from "@storybook/react";
-import { Button } from "./Button";
+import { Button, ButtonProps } from "./Button";
export default {
title: "Library / Buttons / Button",
component: Button,
- decorators: [withDesign],
argTypes: {
- label: {
- defaultValue: "Se hele kalenderen",
- },
- disabled: {
- defaultValue: false,
- },
- collapsible: {
- defaultValue: false,
- },
- size: {
- defaultValue: "medium",
- },
- variant: {
- defaultValue: "outline",
- },
+ buttonType: { control: "select" },
+ label: { control: "text" },
+ disabled: { control: "boolean" },
+ collapsible: { control: "boolean" },
+ size: { control: "select" },
+ variant: { control: "select" },
+ },
+ args: {
+ buttonType: "none",
+ label: "Se hele kalenderen",
+ disabled: false,
+ collapsible: false,
+ size: "medium",
+ variant: "outline",
},
parameters: {
design: {
@@ -31,9 +28,11 @@ export default {
},
layout: "centered",
},
-} as ComponentMeta;
+} as Meta;
-const Template: ComponentStory = (args) => ;
+const Template: StoryFn = (args: ButtonProps) => (
+
+);
export const Default = Template.bind({});
Default.args = {
diff --git a/src/stories/Library/Buttons/button/Button.tsx b/src/stories/Library/Buttons/button/Button.tsx
index 818decced..efc6f4af5 100644
--- a/src/stories/Library/Buttons/button/Button.tsx
+++ b/src/stories/Library/Buttons/button/Button.tsx
@@ -32,7 +32,7 @@ export const Button: React.FC = ({
getVariant(variant),
getSize(size),
"arrow__hover--right-small",
- classNames
+ classNames,
)}
disabled={disabled}
onClick={onClick}
diff --git a/src/stories/Library/Buttons/button/LinkButton.stories.tsx b/src/stories/Library/Buttons/button/LinkButton.stories.tsx
index f0b788066..b4b9a9f9a 100644
--- a/src/stories/Library/Buttons/button/LinkButton.stories.tsx
+++ b/src/stories/Library/Buttons/button/LinkButton.stories.tsx
@@ -1,11 +1,10 @@
-import { ComponentStory, ComponentMeta } from "@storybook/react";
-import { withDesign } from "storybook-addon-designs";
+import { StoryFn, Meta } from "@storybook/react";
+
import { LinkButton } from "./LinkButton";
export default {
title: "Library / Buttons / Link Button",
component: LinkButton,
- decorators: [withDesign],
argTypes: {
href: {
control: {
@@ -40,11 +39,9 @@ export default {
},
layout: "centered",
},
-} as ComponentMeta;
+} as Meta;
-const Template: ComponentStory = (args) => (
-
-);
+const Template: StoryFn = (args) => ;
export const External = Template.bind({});
External.args = {
diff --git a/src/stories/Library/Buttons/button/LinkButton.tsx b/src/stories/Library/Buttons/button/LinkButton.tsx
index e6d8a70b0..260167a28 100644
--- a/src/stories/Library/Buttons/button/LinkButton.tsx
+++ b/src/stories/Library/Buttons/button/LinkButton.tsx
@@ -31,7 +31,7 @@ export const LinkButton = ({
getVariant(variant),
getSize(size),
"arrow__hover--right-small",
- classNames
+ classNames,
)}
>
{text}
diff --git a/src/stories/Library/Buttons/button/button-expand/button-expand.stories.tsx b/src/stories/Library/Buttons/button/button-expand/button-expand.stories.tsx
index 070f40d49..958dab4e2 100644
--- a/src/stories/Library/Buttons/button/button-expand/button-expand.stories.tsx
+++ b/src/stories/Library/Buttons/button/button-expand/button-expand.stories.tsx
@@ -1,4 +1,4 @@
-import { ComponentStory, ComponentMeta } from "@storybook/react";
+import { StoryFn, Meta } from "@storybook/react";
import ButtonExpand, { ButtonExpandProps } from "./ButtonExpand";
export default {
@@ -19,11 +19,11 @@ export default {
},
},
},
-} as ComponentMeta;
+} as Meta;
-const Template: ComponentStory = (
- args: ButtonExpandProps
-) => ;
+const Template: StoryFn = (args: ButtonExpandProps) => (
+
+);
export const Default = Template.bind({});
Default.args = {
diff --git a/src/stories/Library/Buttons/button/buttons.scss b/src/stories/Library/Buttons/button/buttons.scss
index ea110a2bf..13c8436ae 100644
--- a/src/stories/Library/Buttons/button/buttons.scss
+++ b/src/stories/Library/Buttons/button/buttons.scss
@@ -20,7 +20,9 @@ $color__btn-filled-hover: $color__text-secondary-gray;
border: 1px solid $color__btn-border-active;
cursor: pointer;
white-space: nowrap;
- transition: background-color 0.4s ease-in-out, color 0.2s ease-in-out,
+ transition:
+ background-color 0.4s ease-in-out,
+ color 0.2s ease-in-out,
opacity 0.4s ease-in-out;
text-decoration: none;
diff --git a/src/stories/Library/Buttons/button/helper.ts b/src/stories/Library/Buttons/button/helper.ts
index b3c6235e8..82301700d 100644
--- a/src/stories/Library/Buttons/button/helper.ts
+++ b/src/stories/Library/Buttons/button/helper.ts
@@ -28,12 +28,12 @@ export const getPagefoldClasses = ({
wrapper: clsx(
`pagefold-parent--${size}`,
{ "internal-pagefold-parent": isAContainer },
- className
+ className,
),
triangle: clsx(
`pagefold-triangle--${size}`,
{ [`pagefold-triangle--${type}`]: type },
- { "pagefold-inherit-parent": isInheriting }
+ { "pagefold-inherit-parent": isInheriting },
),
};
};
diff --git a/src/stories/Library/Buttons/icon-button/IconButton.stories.tsx b/src/stories/Library/Buttons/icon-button/IconButton.stories.tsx
index 8a2882450..162306056 100644
--- a/src/stories/Library/Buttons/icon-button/IconButton.stories.tsx
+++ b/src/stories/Library/Buttons/icon-button/IconButton.stories.tsx
@@ -1,21 +1,21 @@
-import { ComponentStory, ComponentMeta } from "@storybook/react";
-import { withDesign } from "storybook-addon-designs";
+import { StoryFn, Meta } from "@storybook/react";
import IconButton from "./IconButton";
export default {
title: "Library / Buttons / Button icon",
component: IconButton,
- decorators: [withDesign],
argTypes: {
src: {
- defaultValue: "icons/collection/Menu.svg",
control: "text",
},
altText: {
- defaultValue: "Denne knap sorterer listen efter dato",
control: "text",
},
},
+ args: {
+ src: "icons/collection/Menu.svg",
+ altText: "Denne knap sorterer listen efter dato",
+ },
parameters: {
design: {
type: "figma",
@@ -23,9 +23,9 @@ export default {
},
layout: "centered",
},
-} as ComponentMeta;
+} as Meta;
-const Template: ComponentStory = (props) => (
+const Template: StoryFn = (props) => (
);
export const IconButtonExample = Template.bind({});
diff --git a/src/stories/Library/Buttons/row-button/RowButton.stories.tsx b/src/stories/Library/Buttons/row-button/RowButton.stories.tsx
index 792c79d45..9ba1b617c 100644
--- a/src/stories/Library/Buttons/row-button/RowButton.stories.tsx
+++ b/src/stories/Library/Buttons/row-button/RowButton.stories.tsx
@@ -1,16 +1,18 @@
-import { ComponentStory, ComponentMeta } from "@storybook/react";
-import { withDesign } from "storybook-addon-designs";
+import { StoryFn, Meta } from "@storybook/react";
+
import RowButton from "./RowButton";
export default {
title: "Library / Buttons / RowButton",
component: RowButton,
- decorators: [withDesign],
argTypes: {
label: {
- defaultValue: "Netmedier",
+ control: "text",
},
},
+ args: {
+ label: "Netmedier",
+ },
parameters: {
design: {
type: "figma",
@@ -18,10 +20,8 @@ export default {
},
layout: "centered",
},
-} as ComponentMeta;
+} as Meta;
-const Template: ComponentStory = (args) => (
-
-);
+const Template: StoryFn = (args) => ;
export const Default = Template.bind({});
diff --git a/src/stories/Library/Buttons/row-button/RowButtons.stories.tsx b/src/stories/Library/Buttons/row-button/RowButtons.stories.tsx
index d4e9168a6..fb214110d 100644
--- a/src/stories/Library/Buttons/row-button/RowButtons.stories.tsx
+++ b/src/stories/Library/Buttons/row-button/RowButtons.stories.tsx
@@ -1,16 +1,18 @@
-import { ComponentStory, ComponentMeta } from "@storybook/react";
-import { withDesign } from "storybook-addon-designs";
+import { StoryFn, Meta } from "@storybook/react";
+
import RowButtons from "./RowButtons";
export default {
title: "Library / Buttons / RowButtons",
component: RowButtons,
- decorators: [withDesign],
argTypes: {
labels: {
- defaultValue: ["Netmedier"],
+ control: "object",
},
},
+ args: {
+ labels: ["Netmedier"],
+ },
parameters: {
design: {
type: "figma",
@@ -18,11 +20,9 @@ export default {
},
layout: "centered",
},
-} as ComponentMeta;
+} as Meta;
-const Template: ComponentStory = (args) => (
-
-);
+const Template: StoryFn = (args) => ;
export const TwoButtons = Template.bind({});
TwoButtons.args = {
diff --git a/src/stories/Library/Buttons/toggle-button/ToggleButton.stories.tsx b/src/stories/Library/Buttons/toggle-button/ToggleButton.stories.tsx
index 016257dd6..22a8e5859 100644
--- a/src/stories/Library/Buttons/toggle-button/ToggleButton.stories.tsx
+++ b/src/stories/Library/Buttons/toggle-button/ToggleButton.stories.tsx
@@ -1,11 +1,10 @@
-import { ComponentMeta, ComponentStory } from "@storybook/react";
-import { withDesign } from "storybook-addon-designs";
+import { Meta, StoryFn } from "@storybook/react";
+
import ToggleButton from "./ToggleButton";
export default {
title: "Library / Toggle button",
component: ToggleButton,
- decorators: [withDesign],
parameters: {
design: {
type: "figma",
@@ -14,17 +13,15 @@ export default {
layout: "centered",
},
argTypes: {
- isChecked: {
- defaultValue: false,
- },
+ isChecked: { control: "boolean" },
+ },
+ args: {
+ isChecked: false,
},
-} as ComponentMeta;
+} as Meta;
-const Template: ComponentStory = (args) => (
+const Template: StoryFn = (args) => (
);
export const ToggleButtonExample = Template.bind({});
-ToggleButtonExample.args = {
- isChecked: false,
-};
diff --git a/src/stories/Library/Forms/checkbox/Checkbox.stories.tsx b/src/stories/Library/Forms/checkbox/Checkbox.stories.tsx
index 079653533..922158caf 100644
--- a/src/stories/Library/Forms/checkbox/Checkbox.stories.tsx
+++ b/src/stories/Library/Forms/checkbox/Checkbox.stories.tsx
@@ -1,61 +1,33 @@
-import { ComponentMeta, ComponentStory } from "@storybook/react";
-import { withDesign } from "storybook-addon-designs";
+import { Meta, StoryFn } from "@storybook/react";
+
import { Checkbox } from "./Checkbox";
import { CheckboxDrupal } from "./CheckboxDrupal";
export default {
title: "Library / Forms / Checkbox",
component: Checkbox,
- decorators: [withDesign],
argTypes: {
- ariaLabel: {
- control: {
- type: "text",
- },
- },
- labelLinkText: {
- control: {
- type: "text",
- },
- },
- labelLinkHref: {
- control: {
- type: "text",
- },
- },
- validation: {
- control: {
- type: "text",
- defaultValue: "",
- },
- },
- includeHeadline: {
- control: {
- type: "null",
- },
- },
- description: {
- control: {
- type: "text",
- defaultValue: "This is a description.",
- },
- },
- // We disable the isChecked control, since it is not possible to
- // get the states from the React component to work with Storybook controls.
- isChecked: {
- control: {
- disable: true,
- },
- },
+ ariaLabel: { control: { type: "text" } },
+ labelLinkText: { control: { type: "text" } },
+ labelLinkHref: { control: { type: "text" } },
+ validation: { control: { type: "text" } },
+ includeHeadline: { control: { type: "null" } },
+ description: { control: { type: "text" } },
+ isChecked: { control: { disable: true } },
+ label: { control: { type: "text" } },
+ },
+ args: {
+ isChecked: false,
+ label: "Toggle this checkbox",
+ description: "This is a description.",
+ validation: "",
},
parameters: {
layout: "centered",
},
-} as ComponentMeta;
+} as Meta;
-const Template: ComponentStory = (args) => (
-
-);
+const Template: StoryFn = (args) => ;
export const Checked = Template.bind({});
Checked.args = {
@@ -86,7 +58,7 @@ hiddenLabel.args = {
};
// Show multiple checkboxes to make it easier to test keyboard navigation.
-const Several: ComponentStory = (args) => (
+const Several: StoryFn = (args) => (
<>
{[1, 2, 3, 4, 5].map((value) => {
const { label } = args;
@@ -104,7 +76,7 @@ Multiple.args = {
};
// The stories below mimic HTML structure from Drupal for checkbox usage.
-const DrupalCheckboxExample: ComponentStory = (args) => (
+const DrupalCheckboxExample: StoryFn = (args) => (
);
diff --git a/src/stories/Library/Forms/checkbox/CheckboxDrupal.tsx b/src/stories/Library/Forms/checkbox/CheckboxDrupal.tsx
index 1f6ed1974..e0ba17d3c 100644
--- a/src/stories/Library/Forms/checkbox/CheckboxDrupal.tsx
+++ b/src/stories/Library/Forms/checkbox/CheckboxDrupal.tsx
@@ -24,7 +24,7 @@ export const CheckboxDrupal: React.FC = ({
;
+} as Meta
;
-const Template: ComponentStory = (args) => (
-
-);
+const Template: StoryFn = (args) => ;
export const Default = Template.bind({});
diff --git a/src/stories/Library/Forms/date-picker/DatePicker.tsx b/src/stories/Library/Forms/date-picker/DatePicker.tsx
index 390594733..d95125b8f 100644
--- a/src/stories/Library/Forms/date-picker/DatePicker.tsx
+++ b/src/stories/Library/Forms/date-picker/DatePicker.tsx
@@ -29,7 +29,7 @@ const DatePicker = (props: DatePickerProps) => {
picker.current = flatpickr(node, options);
}
},
- [locale]
+ [locale],
);
return (
diff --git a/src/stories/Library/Forms/input/Input.stories.tsx b/src/stories/Library/Forms/input/Input.stories.tsx
index 4907a0cd4..b05608507 100644
--- a/src/stories/Library/Forms/input/Input.stories.tsx
+++ b/src/stories/Library/Forms/input/Input.stories.tsx
@@ -1,32 +1,22 @@
-import { ComponentStory, ComponentMeta } from "@storybook/react";
-import { withDesign } from "storybook-addon-designs";
+import { StoryFn, Meta } from "@storybook/react";
import Input from "./Input";
export default {
title: "Library / Forms / Input",
component: Input,
- decorators: [withDesign],
argTypes: {
- label: {
- defaultValue: "Navn",
- control: { type: "text" },
- },
- type: {
- defaultValue: "text",
- control: { type: "select", options: ["text", "password"] },
- },
- id: {
- defaultValue: "id",
- control: { type: "text" },
- },
- description: {
- defaultValue: "Dit fulde navn",
- control: { type: "text" },
- },
- validation: {
- defaultValue: "Fejlbesked lorem ipsum dolor",
- control: { type: "text" },
- },
+ label: { control: { type: "text" } },
+ type: { control: { type: "select", options: ["text", "password"] } },
+ id: { control: { type: "text" } },
+ description: { control: { type: "text" } },
+ validation: { control: { type: "text" } },
+ },
+ args: {
+ label: "Navn",
+ type: "text",
+ id: "id",
+ description: "Dit fulde navn",
+ validation: "Fejlbesked lorem ipsum dolor",
},
parameters: {
design: {
@@ -35,8 +25,8 @@ export default {
},
layout: "padded",
},
-} as ComponentMeta;
+} as Meta;
-const Template: ComponentStory = (args) => ;
+const Template: StoryFn = (args) => ;
export const Default = Template.bind({});
diff --git a/src/stories/Library/Forms/radio/Radio.stories.tsx b/src/stories/Library/Forms/radio/Radio.stories.tsx
index 00fab0358..e3143c78a 100644
--- a/src/stories/Library/Forms/radio/Radio.stories.tsx
+++ b/src/stories/Library/Forms/radio/Radio.stories.tsx
@@ -1,31 +1,28 @@
-import { ComponentMeta, ComponentStory } from "@storybook/react";
-import { withDesign } from "storybook-addon-designs";
+import { Meta, StoryFn } from "@storybook/react";
+
import { RadioDrupal } from "./RadioDrupal";
export default {
title: "Library / Forms / Radio",
component: RadioDrupal,
- decorators: [withDesign],
argTypes: {
legend: {
- control: {
- type: "text",
- defaultValue: "This is a legend.",
- },
+ control: "text",
},
description: {
- control: {
- type: "text",
- defaultValue: "This is a description.",
- },
+ control: "text",
},
},
+ args: {
+ legend: "This is a legend",
+ description: "This is a description.",
+ },
parameters: {
layout: "centered",
},
-} as ComponentMeta;
+} as Meta;
-const Template: ComponentStory = (args) => (
+const Template: StoryFn = (args) => (
);
diff --git a/src/stories/Library/Forms/submit-button/SubmitButton.stories.tsx b/src/stories/Library/Forms/submit-button/SubmitButton.stories.tsx
index 4d3e01cca..0bdc9a3df 100644
--- a/src/stories/Library/Forms/submit-button/SubmitButton.stories.tsx
+++ b/src/stories/Library/Forms/submit-button/SubmitButton.stories.tsx
@@ -1,16 +1,18 @@
-import { ComponentStory, ComponentMeta } from "@storybook/react";
-import { withDesign } from "storybook-addon-designs";
+import { StoryFn, Meta } from "@storybook/react";
+
import SubmitButton from "./SubmitButton";
export default {
title: "Library / Forms / Submit Button",
component: SubmitButton,
- decorators: [withDesign],
argTypes: {
buttonText: {
- defaultValue: "Save changes",
+ control: "text",
},
},
+ args: {
+ buttonText: "Save changes",
+ },
parameters: {
design: {
type: "figma",
@@ -18,9 +20,9 @@ export default {
},
layout: "padded",
},
-} as ComponentMeta;
+} as Meta;
-const Template: ComponentStory = (args) => (
+const Template: StoryFn = (args) => (
diff --git a/src/stories/Library/Forms/submit-button/SubmitButton.tsx b/src/stories/Library/Forms/submit-button/SubmitButton.tsx
index a99c58d78..828a8c0ca 100644
--- a/src/stories/Library/Forms/submit-button/SubmitButton.tsx
+++ b/src/stories/Library/Forms/submit-button/SubmitButton.tsx
@@ -15,7 +15,7 @@ const SubmitButton: FC = ({ buttonText, classNames }) => {
"arrow__hover--right-small",
"dpl-button",
],
- classNames
+ classNames,
);
return ;
diff --git a/src/stories/Library/Forms/textarea/Textarea.stories.tsx b/src/stories/Library/Forms/textarea/Textarea.stories.tsx
index 4b6af694b..c043a2c36 100644
--- a/src/stories/Library/Forms/textarea/Textarea.stories.tsx
+++ b/src/stories/Library/Forms/textarea/Textarea.stories.tsx
@@ -1,21 +1,19 @@
-import { ComponentStory, ComponentMeta } from "@storybook/react";
-import { withDesign } from "storybook-addon-designs";
+import { StoryFn, Meta } from "@storybook/react";
+
import Textarea from "./Textarea";
export default {
title: "Library / Forms / Textarea",
component: Textarea,
- decorators: [withDesign],
argTypes: {
- id: {
- defaultValue: "id",
- },
- name: {
- defaultValue: "name",
- },
- label: {
- defaultValue: "Besked",
- },
+ id: { control: "text" },
+ name: { control: "text" },
+ label: { control: "text" },
+ },
+ args: {
+ id: "id",
+ name: "name",
+ label: "Besked",
},
parameters: {
design: {
@@ -24,9 +22,9 @@ export default {
},
layout: "padded",
},
-} as ComponentMeta;
+} as Meta;
-const Template: ComponentStory = (args) => (
+const Template: StoryFn = (args) => (
diff --git a/src/stories/Library/Heros/hero-link/HeroLink.stories.tsx b/src/stories/Library/Heros/hero-link/HeroLink.stories.tsx
index f66ea709f..11b3805c3 100644
--- a/src/stories/Library/Heros/hero-link/HeroLink.stories.tsx
+++ b/src/stories/Library/Heros/hero-link/HeroLink.stories.tsx
@@ -1,12 +1,11 @@
-import { ComponentStory, ComponentMeta } from "@storybook/react";
-import { withDesign } from "storybook-addon-designs";
+import { StoryFn, Meta } from "@storybook/react";
+
import HeroLink from "./HeroLink";
import ImageCredited from "../../image-credited/ImageCredited";
export default {
title: "Library / Hero with link",
component: HeroLink,
- decorators: [withDesign],
parameters: {
design: {
type: "figma",
@@ -16,48 +15,49 @@ export default {
argTypes: {
url: {
name: "Url",
- defaultValue: "#",
control: { type: "text" },
},
image: {
- defaultValue: (
-
- ),
+ control: { type: "object" },
},
placeholderText: {
- defaultValue: "En spændende tekst",
- type: "string",
+ control: { type: "text" },
},
contentType: {
name: "Type",
- defaultValue: "Arrangement",
control: { type: "text" },
},
date: {
name: "Date",
- defaultValue: "06 Dec 2022",
control: { type: "text" },
},
title: {
name: "Title",
- defaultValue: "Stine Pilgaard vinder De Gyldne Laurbær",
control: { type: "text" },
},
description: {
name: "Description",
- defaultValue:
- "Boghandlernes store bogpris - De Gyldne går denne gang til Stine Pilgaard for hendes roman 'Meter i sekundet'. Stort tillykke til Stine Pilgaard.",
control: { type: "text" },
},
},
-} as ComponentMeta;
+ args: {
+ url: "#",
+ image: (
+
+ ),
+ placeholderText: "En spændende tekst",
+ contentType: "Arrangement",
+ date: "06 Dec 2022",
+ title: "Stine Pilgaard vinder De Gyldne Laurbær",
+ description:
+ "Boghandlernes store bogpris - De Gyldne går denne gang til Stine Pilgaard for hendes roman 'Meter i sekundet'. Stort tillykke til Stine Pilgaard.",
+ },
+} as Meta;
-const Template: ComponentStory = (args) => (
-
-);
+const Template: StoryFn = (args) => ;
export const Default = Template.bind({});
diff --git a/src/stories/Library/Heros/hero/Hero.stories.tsx b/src/stories/Library/Heros/hero/Hero.stories.tsx
index ee81b6fad..4cc71e0b0 100644
--- a/src/stories/Library/Heros/hero/Hero.stories.tsx
+++ b/src/stories/Library/Heros/hero/Hero.stories.tsx
@@ -1,12 +1,11 @@
-import { ComponentStory, ComponentMeta } from "@storybook/react";
-import { withDesign } from "storybook-addon-designs";
+import { StoryFn, Meta } from "@storybook/react";
+
import Hero from "./Hero";
import ImageCredited from "../../image-credited/ImageCredited";
export default {
title: "Library / Hero",
component: Hero,
- decorators: [withDesign],
parameters: {
design: {
type: "figma",
@@ -14,48 +13,35 @@ export default {
},
},
argTypes: {
- image: {
- defaultValue: (
-
- ),
- },
- placeholderText: {
- defaultValue: "Stine Pilgaard vinder De Gyldne Laurbær",
- type: "string",
- },
- contentType: {
- name: "Type",
- defaultValue: "Arrangement",
- control: { type: "text" },
- },
- date: {
- name: "Date",
- defaultValue: "06 Dec 2022",
- control: { type: "text" },
- },
- title: {
- name: "Title",
- defaultValue: "Stine Pilgaard vinder De Gyldne Laurbær",
- control: { type: "text" },
- },
- description: {
- name: "Description",
- defaultValue:
- "Boghandlernes store bogpris - De Gyldne går denne gang til Stine Pilgaard for hendes roman 'Meter i sekundet'. Stort tillykke til Stine Pilgaard.",
- control: { type: "text" },
- },
+ image: { control: "object" },
+ placeholderText: { control: "text" },
+ contentType: { control: "text" },
+ date: { control: "text" },
+ title: { control: "text" },
+ description: { control: "text" },
+ descriptionItems: { control: "object" },
+ },
+ args: {
+ image: (
+
+ ),
+ placeholderText: "Stine Pilgaard vinder De Gyldne Laurbær",
+ contentType: "Arrangement",
+ date: "06 Dec 2022",
+ title: "Stine Pilgaard vinder De Gyldne Laurbær",
+ description:
+ "Boghandlernes store bogpris - De Gyldne går denne gang til Stine Pilgaard for hendes roman 'Meter i sekundet'. Stort tillykke til Stine Pilgaard.",
descriptionItems: {
Type: { value: ["Bog"], type: "standard" },
Sprog: { value: ["Dansk"], type: "standard" },
},
},
-} as ComponentMeta;
+} as Meta;
-const Template: ComponentStory = (args) => ;
+const Template: StoryFn = (args) => ;
export const Default = Template.bind({});
diff --git a/src/stories/Library/Icons/icon-basic/IconBasic.stories.tsx b/src/stories/Library/Icons/icon-basic/IconBasic.stories.tsx
index b5c5aae3d..1e1d96564 100644
--- a/src/stories/Library/Icons/icon-basic/IconBasic.stories.tsx
+++ b/src/stories/Library/Icons/icon-basic/IconBasic.stories.tsx
@@ -1,13 +1,10 @@
import { Meta } from "@storybook/react";
-import { withDesign } from "storybook-addon-designs";
-
import { IconBasic as IconBasicComp } from "./IconBasic";
const StoryBase: Meta = {
title: "Library / Icons / Basic",
component: IconBasicComp,
- decorators: [withDesign],
parameters: {
design: {
type: "figma",
diff --git a/src/stories/Library/Icons/icon-collection/IconCollection.stories.tsx b/src/stories/Library/Icons/icon-collection/IconCollection.stories.tsx
index fba5b103f..59d34d633 100644
--- a/src/stories/Library/Icons/icon-collection/IconCollection.stories.tsx
+++ b/src/stories/Library/Icons/icon-collection/IconCollection.stories.tsx
@@ -1,13 +1,10 @@
import { Meta } from "@storybook/react";
-import { withDesign } from "storybook-addon-designs";
-
import { IconCollection as IconCollectionComp } from "./IconCollection";
const StoryBase: Meta = {
title: "Library / Icons / Collection",
component: IconCollectionComp,
- decorators: [withDesign],
parameters: {
design: {
type: "figma",
diff --git a/src/stories/Library/Icons/icon-favourite/IconFavourite.stories.tsx b/src/stories/Library/Icons/icon-favourite/IconFavourite.stories.tsx
index 825cf4d92..e19f4612c 100644
--- a/src/stories/Library/Icons/icon-favourite/IconFavourite.stories.tsx
+++ b/src/stories/Library/Icons/icon-favourite/IconFavourite.stories.tsx
@@ -1,27 +1,27 @@
-import { ComponentStory, ComponentMeta } from "@storybook/react";
-import { withDesign } from "storybook-addon-designs";
+import { StoryFn, Meta } from "@storybook/react";
import { IconFavourite } from "./IconFavourite";
export default {
title: "Library / Icons",
component: IconFavourite,
- decorators: [withDesign],
+ argTypes: {
+ fill: {
+ control: "boolean",
+ },
+ },
+ args: {
+ fill: true,
+ },
parameters: {
design: {
type: "figma",
url: "https://www.figma.com/file/Zx9GrkFA3l4ISvyZD2q0Qi/Designsystem?node-id=656%3A5407",
},
},
- argTypes: {
- fill: {
- control: "boolean",
- defaultValue: true,
- },
- },
-} as ComponentMeta;
+} as Meta;
-const Template: ComponentStory = (args) => (
+const Template: StoryFn = (args) => (
);
diff --git a/src/stories/Library/Icons/icon-social/IconSocial.stories.tsx b/src/stories/Library/Icons/icon-social/IconSocial.stories.tsx
index 19f7f48ee..9df1fd57e 100644
--- a/src/stories/Library/Icons/icon-social/IconSocial.stories.tsx
+++ b/src/stories/Library/Icons/icon-social/IconSocial.stories.tsx
@@ -1,13 +1,10 @@
import { Meta } from "@storybook/react";
-import { withDesign } from "storybook-addon-designs";
-
import { IconSocial as IconSocialComp } from "./IconSocial";
const StoryBase: Meta = {
title: "Library / Icons / Social",
component: IconSocialComp,
- decorators: [withDesign],
parameters: {
design: {
type: "figma",
diff --git a/src/stories/Library/Icons/icon-watch/IconWatch.stories.tsx b/src/stories/Library/Icons/icon-watch/IconWatch.stories.tsx
index 2fe73feab..45466f57c 100644
--- a/src/stories/Library/Icons/icon-watch/IconWatch.stories.tsx
+++ b/src/stories/Library/Icons/icon-watch/IconWatch.stories.tsx
@@ -1,13 +1,10 @@
import { Meta } from "@storybook/react";
-import { withDesign } from "storybook-addon-designs";
-
import { IconWatch as IconWatchComp } from "./IconWatch";
const StoryBase: Meta = {
title: "Library / Icons / Watch",
component: IconWatchComp,
- decorators: [withDesign],
parameters: {
design: {
type: "figma",
diff --git a/src/stories/Library/Lists/list-dashboard/ListDashboard.stories.tsx b/src/stories/Library/Lists/list-dashboard/ListDashboard.stories.tsx
index a83786331..d09425782 100644
--- a/src/stories/Library/Lists/list-dashboard/ListDashboard.stories.tsx
+++ b/src/stories/Library/Lists/list-dashboard/ListDashboard.stories.tsx
@@ -1,53 +1,53 @@
-import { withDesign } from "storybook-addon-designs";
-import { ComponentMeta, ComponentStory } from "@storybook/react";
+import { Meta, StoryFn } from "@storybook/react";
import { ListDashboard } from "./ListDashboard";
export default {
title: "Library / Lists / Dashboard",
component: ListDashboard,
- decorators: [withDesign],
argTypes: {
label: {
control: "object",
- defaultValue: {
- label: "overskredet",
- status: "danger",
- },
},
number: {
control: "object",
- defaultValue: {
- label: "2",
- status: "danger",
- },
},
title: {
control: "text",
- defaultValue: "Afleveret for sent",
},
showDot: {
control: "boolean",
- defaultValue: "true",
},
href: {
- control: "string",
- defaultValue: "/",
+ control: "text",
},
isSkeleton: {
control: "boolean",
- defaultValue: false,
},
},
+ args: {
+ label: {
+ label: "overskredet",
+ status: "danger",
+ },
+ number: {
+ label: 2,
+ status: "danger",
+ },
+ title: "Afleveret for sent",
+ showDot: true,
+ href: "/",
+ isSkeleton: false,
+ },
parameters: {
design: {
type: "figma",
url: "https://www.figma.com/file/Zx9GrkFA3l4ISvyZD2q0Qi/Designsystem?node-id=1543%3A5965",
},
},
-} as ComponentMeta;
+} as Meta;
-const Template: ComponentStory = (args) => (
+const Template: StoryFn = (args) => (
diff --git a/src/stories/Library/Lists/list-description/ListDescription.stories.tsx b/src/stories/Library/Lists/list-description/ListDescription.stories.tsx
index fbb42909d..c86a1c507 100644
--- a/src/stories/Library/Lists/list-description/ListDescription.stories.tsx
+++ b/src/stories/Library/Lists/list-description/ListDescription.stories.tsx
@@ -1,12 +1,10 @@
-import { withDesign } from "storybook-addon-designs";
-import { ComponentMeta, ComponentStory } from "@storybook/react";
+import { Meta, StoryFn } from "@storybook/react";
import ListDescription from "./ListDescription";
import fakeData from "./ListDescriptionFakeData";
export default {
title: "Library / Lists / Description",
component: ListDescription,
- decorators: [withDesign],
parameters: {
design: {
type: "figma",
@@ -16,12 +14,14 @@ export default {
argTypes: {
data: {
control: { type: "object" },
- defaultValue: fakeData,
},
},
-} as ComponentMeta;
+ args: {
+ data: fakeData,
+ },
+} as Meta;
-const Template: ComponentStory = (args) => {
+const Template: StoryFn = (args) => {
return ;
};
diff --git a/src/stories/Library/Lists/list-description/ListDescription.tsx b/src/stories/Library/Lists/list-description/ListDescription.tsx
index 72413bf41..e76b80c82 100644
--- a/src/stories/Library/Lists/list-description/ListDescription.tsx
+++ b/src/stories/Library/Lists/list-description/ListDescription.tsx
@@ -24,7 +24,7 @@ const ListDescription: React.FC<{ data: ListData; className?: string }> = ({
{type === "standard" &&
diff --git a/src/stories/Library/Lists/list-details/ListDetails.stories.tsx b/src/stories/Library/Lists/list-details/ListDetails.stories.tsx
index 882c92c79..4b96ba5a6 100644
--- a/src/stories/Library/Lists/list-details/ListDetails.stories.tsx
+++ b/src/stories/Library/Lists/list-details/ListDetails.stories.tsx
@@ -1,12 +1,11 @@
-import { withDesign } from "storybook-addon-designs";
-import { ComponentMeta, ComponentStory } from "@storybook/react";
+import { Meta, StoryFn } from "@storybook/react";
import { ListDetails } from "./ListDetails";
export default {
title: "Library / Lists / Details",
component: ListDetails,
- decorators: [withDesign],
+
argTypes: {},
parameters: {
design: {
@@ -14,9 +13,9 @@ export default {
url: "https://www.figma.com/file/Zx9GrkFA3l4ISvyZD2q0Qi/Designsystem?node-id=1385%3A8923",
},
},
-} as ComponentMeta;
+} as Meta;
-const Template: ComponentStory = (args) => (
+const Template: StoryFn = (args) => (
);
diff --git a/src/stories/Library/Lists/list-empty/ListEmpty.stories.tsx b/src/stories/Library/Lists/list-empty/ListEmpty.stories.tsx
index fa8e901e7..c2acd8a88 100644
--- a/src/stories/Library/Lists/list-empty/ListEmpty.stories.tsx
+++ b/src/stories/Library/Lists/list-empty/ListEmpty.stories.tsx
@@ -1,29 +1,25 @@
-import { withDesign } from "storybook-addon-designs";
-import { ComponentMeta, ComponentStory } from "@storybook/react";
+import { Meta, StoryFn } from "@storybook/react";
import ListEmpty from "./ListEmpty";
export default {
title: "Library / Lists / List - empty",
component: ListEmpty,
- decorators: [withDesign],
argTypes: {
- text: {
- defaultValue: "Du har i øjeblikket 0 Reserveringer",
- control: "text",
- },
- links: {
- control: "object",
- defaultValue: [
- {
- linkText: "link tekst 1",
- href: "https://example.com/",
- },
- {
- linkText: "link tekst 2",
- href: "https://example.com/",
- },
- ],
- },
+ text: { control: "text" },
+ links: { control: "object" },
+ },
+ args: {
+ text: "Du har i øjeblikket 0 Reserveringer",
+ links: [
+ {
+ linkText: "link tekst 1",
+ href: "https://example.com/",
+ },
+ {
+ linkText: "link tekst 2",
+ href: "https://example.com/",
+ },
+ ],
},
parameters: {
design: {
@@ -32,10 +28,8 @@ export default {
},
layout: "fullscreen",
},
-} as ComponentMeta;
+} as Meta;
-const Template: ComponentStory = (props) => (
-
-);
+const Template: StoryFn = (props) => ;
export const ListEmptyExample = Template.bind({});
diff --git a/src/stories/Library/Lists/list-find-on-shelf/ListFindOnShelf.stories.tsx b/src/stories/Library/Lists/list-find-on-shelf/ListFindOnShelf.stories.tsx
index 103a35219..b2078ce0e 100644
--- a/src/stories/Library/Lists/list-find-on-shelf/ListFindOnShelf.stories.tsx
+++ b/src/stories/Library/Lists/list-find-on-shelf/ListFindOnShelf.stories.tsx
@@ -1,43 +1,44 @@
-import { ComponentMeta, ComponentStory } from "@storybook/react";
-import { withDesign } from "storybook-addon-designs";
+import { Meta, StoryFn } from "@storybook/react";
+
import ListFindOnShelf, { ListFindOnShelfProps } from "./ListFindOnShelf";
export default {
title: "Library / Lists / Find On Shelf",
component: ListFindOnShelf,
- decorators: [withDesign],
argTypes: {
manifestationName: {
name: "Manifestation Name",
- defaultValue: "Vejen til Jerusalem, 2008",
control: { type: "text" },
},
location: {
name: "Location",
- defaultValue: "Voksen · Skønlitteratur · Standard · Guillou",
control: { type: "text" },
},
nrAvailable: {
name: "Amount of available manifestations",
- defaultValue: 1,
control: { type: "number" },
},
nrOfListItems: {
name: "Amount of lit items",
- defaultValue: 2,
control: { type: "number" },
},
},
+ args: {
+ manifestationName: "Vejen til Jerusalem, 2008",
+ location: "Voksen · Skønlitteratur · Standard · Guillou",
+ nrAvailable: 1,
+ nrOfListItems: 2,
+ },
parameters: {
design: {
type: "figma",
url: "https://www.figma.com/file/ETOZIfmgGS1HUfio57SOh7/S%C3%B8gning?node-id=4561%3A26097",
},
},
-} as ComponentMeta;
+} as Meta;
-const Template: ComponentStory = (
- args: ListFindOnShelfProps
+const Template: StoryFn = (
+ args: ListFindOnShelfProps,
) => ;
export const FindOnShelf = Template.bind({});
diff --git a/src/stories/Library/Lists/list-materials/ListMaterials.stories.tsx b/src/stories/Library/Lists/list-materials/ListMaterials.stories.tsx
index 5c1f3e9f7..fa6783891 100644
--- a/src/stories/Library/Lists/list-materials/ListMaterials.stories.tsx
+++ b/src/stories/Library/Lists/list-materials/ListMaterials.stories.tsx
@@ -1,11 +1,9 @@
-import { withDesign } from "storybook-addon-designs";
-import { ComponentMeta, ComponentStory } from "@storybook/react";
+import { Meta, StoryFn } from "@storybook/react";
import { ListMaterials } from "./ListMaterials";
export default {
title: "Library / Lists / Materials",
component: ListMaterials,
- decorators: [withDesign],
// We disable the isChecked control, since it is not possible to
// get the states from the React component to work with Storybook controls.
argTypes: {
@@ -21,9 +19,9 @@ export default {
url: "https://www.figma.com/file/Zx9GrkFA3l4ISvyZD2q0Qi/Designsystem?node-id=1385%3A8204",
},
},
-} as ComponentMeta;
+} as Meta;
-const Template: ComponentStory = (args) => (
+const Template: StoryFn = (args) => (
diff --git a/src/stories/Library/Lists/list-reservation/ListReservationsAndLoans.stories.tsx b/src/stories/Library/Lists/list-reservation/ListReservationsAndLoans.stories.tsx
index 5fabe14aa..6d128423a 100644
--- a/src/stories/Library/Lists/list-reservation/ListReservationsAndLoans.stories.tsx
+++ b/src/stories/Library/Lists/list-reservation/ListReservationsAndLoans.stories.tsx
@@ -1,11 +1,9 @@
-import { withDesign } from "storybook-addon-designs";
-import { ComponentMeta, ComponentStory } from "@storybook/react";
+import { Meta, StoryFn } from "@storybook/react";
import { ListReservationsAndLoans } from "./ListReservationsAndLoans";
export default {
title: "Library / Lists / ReservationAndLoans",
component: ListReservationsAndLoans,
- decorators: [withDesign],
argTypes: {},
parameters: {
design: {
@@ -13,9 +11,9 @@ export default {
url: "https://www.figma.com/file/Zx9GrkFA3l4ISvyZD2q0Qi/Designsystem?node-id=1181%3A5923",
},
},
-} as ComponentMeta;
+} as Meta;
-const Template: ComponentStory = (args) => (
+const Template: StoryFn = (args) => (
);
diff --git a/src/stories/Library/Lists/list-reservation/ListReservationsAndLoans.tsx b/src/stories/Library/Lists/list-reservation/ListReservationsAndLoans.tsx
index 974319f61..500162e63 100644
--- a/src/stories/Library/Lists/list-reservation/ListReservationsAndLoans.tsx
+++ b/src/stories/Library/Lists/list-reservation/ListReservationsAndLoans.tsx
@@ -23,7 +23,7 @@ export type ListReservationsAndLoansProps = {
};
export const ListReservationsAndLoans = (
- props: ListReservationsAndLoansProps
+ props: ListReservationsAndLoansProps,
) => {
const { cover, isStacked, counter, statusLabel, statusNotes, fee } = props;
@@ -57,7 +57,7 @@ export const ListReservationsAndLoans = (
aria-label="note about material"
className={clsx(
"list-reservation__note list-reservation__note--desktop color-secondary-gray",
- cover.noteAsWarning && "color-signal-alert"
+ cover.noteAsWarning && "color-signal-alert",
)}
>
{cover.noteLabel}
@@ -90,7 +90,7 @@ export const ListReservationsAndLoans = (
href={cover.noteUrl}
className={clsx(
"list-reservation__note list-reservation__note--mobile color-secondary-gray",
- cover.noteAsWarning && "color-signal-alert"
+ cover.noteAsWarning && "color-signal-alert",
)}
>
{cover.noteLabel}
diff --git a/src/stories/Library/Modals/modal-cta/ModalCTA.stories.tsx b/src/stories/Library/Modals/modal-cta/ModalCTA.stories.tsx
index 3b9e363de..fb740601b 100644
--- a/src/stories/Library/Modals/modal-cta/ModalCTA.stories.tsx
+++ b/src/stories/Library/Modals/modal-cta/ModalCTA.stories.tsx
@@ -1,12 +1,10 @@
-import { withDesign } from "storybook-addon-designs";
-import { ComponentMeta, ComponentStory } from "@storybook/react";
+import { Meta, StoryFn } from "@storybook/react";
import { ModalCTA } from "./ModalCTA";
export default {
title: "Library / Modals / CTA",
component: ModalCTA,
- decorators: [withDesign],
argTypes: {},
parameters: {
design: {
@@ -14,11 +12,9 @@ export default {
url: "https://www.figma.com/file/Zx9GrkFA3l4ISvyZD2q0Qi/Designsystem?node-id=2137%3A11410",
},
},
-} as ComponentMeta;
+} as Meta;
-const Template: ComponentStory = (args) => (
-
-);
+const Template: StoryFn = (args) => ;
export const Item = Template.bind({});
Item.args = {
diff --git a/src/stories/Library/Modals/modal-details/ModalDetails.stories.tsx b/src/stories/Library/Modals/modal-details/ModalDetails.stories.tsx
index 8b103f691..989461cb6 100644
--- a/src/stories/Library/Modals/modal-details/ModalDetails.stories.tsx
+++ b/src/stories/Library/Modals/modal-details/ModalDetails.stories.tsx
@@ -1,12 +1,10 @@
-import { withDesign } from "storybook-addon-designs";
-import { ComponentMeta, ComponentStory } from "@storybook/react";
+import { Meta, StoryFn } from "@storybook/react";
import { ModalDetails } from "./ModalDetails";
export default {
title: "Library / Modals / Details",
component: ModalDetails,
- decorators: [withDesign],
argTypes: {},
parameters: {
design: {
@@ -14,9 +12,9 @@ export default {
url: "https://www.figma.com/file/Zx9GrkFA3l4ISvyZD2q0Qi/Designsystem?node-id=2146%3A13292",
},
},
-} as ComponentMeta;
+} as Meta;
-const Template: ComponentStory = (args) => (
+const Template: StoryFn = (args) => (
);
diff --git a/src/stories/Library/Modals/modal-facet-browser/FacetBrowser.stories.tsx b/src/stories/Library/Modals/modal-facet-browser/FacetBrowser.stories.tsx
index eac1f0b8f..9d298ecdf 100644
--- a/src/stories/Library/Modals/modal-facet-browser/FacetBrowser.stories.tsx
+++ b/src/stories/Library/Modals/modal-facet-browser/FacetBrowser.stories.tsx
@@ -1,11 +1,9 @@
-import { withDesign } from "storybook-addon-designs";
-import { ComponentMeta, ComponentStory } from "@storybook/react";
+import { Meta, StoryFn } from "@storybook/react";
import FacetBrowser from "./FacetBrowser";
export default {
title: "Library / Modals / Facet Browser",
component: FacetBrowser,
- decorators: [withDesign],
parameters: {
design: {
type: "figma",
@@ -35,13 +33,13 @@ export default {
},
showResults: {
control: {
- type: "null",
+ type: "boolean",
},
},
},
-} as ComponentMeta;
+} as Meta;
-const Template: ComponentStory = (args) => {
+const Template: StoryFn = (args) => {
return ;
};
diff --git a/src/stories/Library/Modals/modal-find-on-shelf/ModalFindOnShelf.stories.tsx b/src/stories/Library/Modals/modal-find-on-shelf/ModalFindOnShelf.stories.tsx
index 003270fe1..312ed9dad 100644
--- a/src/stories/Library/Modals/modal-find-on-shelf/ModalFindOnShelf.stories.tsx
+++ b/src/stories/Library/Modals/modal-find-on-shelf/ModalFindOnShelf.stories.tsx
@@ -1,42 +1,24 @@
-import { ComponentMeta, ComponentStory } from "@storybook/react";
-import { withDesign } from "storybook-addon-designs";
+import { Meta, StoryFn } from "@storybook/react";
import ModalFindOnShelf, { ModalFindOnShelfProps } from "./ModalFindOnShelf";
export default {
title: "Library / Modals / Find On Shelf",
component: ModalFindOnShelf,
- decorators: [withDesign],
argTypes: {
- workTitle: {
- name: "Work title",
- defaultValue: "Vejen til Jerusalem",
- control: { type: "text" },
- },
- author: {
- name: "Author",
- defaultValue: "Jan Guillou",
- control: { type: "text" },
- },
- nrOfbranches: {
- name: "Amount of library branches",
- defaultValue: 3,
- control: { type: "number" },
- },
- nrOfManifestations: {
- name: "Amount of manifestations per branch",
- defaultValue: 2,
- control: { type: "number" },
- },
- showModal: {
- name: "Show modal?",
- defaultValue: true,
- control: { type: "boolean" },
- },
- isPeriodical: {
- name: "Is periodical (e.g. magazine)?",
- defaultValue: false,
- control: { type: "null" },
- },
+ workTitle: { control: { type: "text" } },
+ author: { control: { type: "text" } },
+ nrOfbranches: { control: { type: "number" } },
+ nrOfManifestations: { control: { type: "number" } },
+ showModal: { control: { type: "boolean" } },
+ isPeriodical: { control: { type: "boolean" } },
+ },
+ args: {
+ workTitle: "Vejen til Jerusalem",
+ author: "Jan Guillou",
+ nrOfbranches: 3,
+ nrOfManifestations: 2,
+ showModal: true,
+ isPeriodical: false,
},
parameters: {
design: {
@@ -44,10 +26,10 @@ export default {
url: "https://www.figma.com/file/ETOZIfmgGS1HUfio57SOh7/S%C3%B8gning?node-id=4561%3A26097",
},
},
-} as ComponentMeta;
+} as Meta;
-const Template: ComponentStory = (
- args: ModalFindOnShelfProps
+const Template: StoryFn = (
+ args: ModalFindOnShelfProps,
) => ;
export const Default = Template.bind({});
diff --git a/src/stories/Library/Modals/modal-header/ModalHeader.stories.tsx b/src/stories/Library/Modals/modal-header/ModalHeader.stories.tsx
index ec2e4f802..8af69fc05 100644
--- a/src/stories/Library/Modals/modal-header/ModalHeader.stories.tsx
+++ b/src/stories/Library/Modals/modal-header/ModalHeader.stories.tsx
@@ -1,11 +1,9 @@
-import { withDesign } from "storybook-addon-designs";
-import { ComponentMeta, ComponentStory } from "@storybook/react";
+import { Meta, StoryFn } from "@storybook/react";
import { ModalHeader } from "./ModalHeader";
export default {
title: "Library / Modals / Header",
component: ModalHeader,
- decorators: [withDesign],
argTypes: {},
parameters: {
design: {
@@ -13,9 +11,9 @@ export default {
url: "https://www.figma.com/file/Zx9GrkFA3l4ISvyZD2q0Qi/Designsystem?node-id=2137%3A11410",
},
},
-} as ComponentMeta;
+} as Meta;
-const Template: ComponentStory = (args) => (
+const Template: StoryFn = (args) => (
);
diff --git a/src/stories/Library/Modals/modal-infomedia/Infomedia.stories.tsx b/src/stories/Library/Modals/modal-infomedia/Infomedia.stories.tsx
index 639ca5383..7e48d6ad8 100644
--- a/src/stories/Library/Modals/modal-infomedia/Infomedia.stories.tsx
+++ b/src/stories/Library/Modals/modal-infomedia/Infomedia.stories.tsx
@@ -1,4 +1,4 @@
-import { ComponentMeta, ComponentStory } from "@storybook/react";
+import { Meta, StoryFn } from "@storybook/react";
import { Infomedia } from "./Infomedia";
export default {
@@ -21,11 +21,9 @@ export default {
},
},
},
-} as ComponentMeta;
+} as Meta;
-const Template: ComponentStory = (args) => (
-
-);
+const Template: StoryFn = (args) => ;
export const Text = Template.bind({});
Text.args = {
diff --git a/src/stories/Library/Modals/modal-loan/ModalLoan.stories.tsx b/src/stories/Library/Modals/modal-loan/ModalLoan.stories.tsx
index ca3c0be1e..49571d441 100644
--- a/src/stories/Library/Modals/modal-loan/ModalLoan.stories.tsx
+++ b/src/stories/Library/Modals/modal-loan/ModalLoan.stories.tsx
@@ -1,11 +1,9 @@
-import { withDesign } from "storybook-addon-designs";
-import { ComponentMeta, ComponentStory } from "@storybook/react";
+import { Meta, StoryFn } from "@storybook/react";
import { ModalLoan } from "./ModalLoan";
export default {
title: "Library / Modals / Loan",
component: ModalLoan,
- decorators: [withDesign],
argTypes: {},
parameters: {
design: {
@@ -13,11 +11,9 @@ export default {
url: "https://www.figma.com/file/Zx9GrkFA3l4ISvyZD2q0Qi/Designsystem?node-id=2137%3A11409",
},
},
-} as ComponentMeta;
+} as Meta;
-const Template: ComponentStory = (args) => (
-
-);
+const Template: StoryFn = (args) => ;
export const ModalLoanLoading = Template.bind({});
ModalLoanLoading.args = {
diff --git a/src/stories/Library/Modals/modal-login/ModalLogin.stories.tsx b/src/stories/Library/Modals/modal-login/ModalLogin.stories.tsx
index f014ca096..59b99bba0 100644
--- a/src/stories/Library/Modals/modal-login/ModalLogin.stories.tsx
+++ b/src/stories/Library/Modals/modal-login/ModalLogin.stories.tsx
@@ -1,11 +1,9 @@
-import { withDesign } from "storybook-addon-designs";
-import { ComponentMeta, ComponentStory } from "@storybook/react";
+import { Meta, StoryFn } from "@storybook/react";
import { ModalLogin } from "./ModalLogin";
export default {
title: "Library / Modals / Login",
component: ModalLogin,
- decorators: [withDesign],
argTypes: {},
parameters: {
design: {
@@ -13,11 +11,9 @@ export default {
url: "https://www.figma.com/file/Zx9GrkFA3l4ISvyZD2q0Qi/Designsystem?node-id=2137%3A11410",
},
},
-} as ComponentMeta;
+} as Meta;
-const Template: ComponentStory = (args) => (
-
-);
+const Template: StoryFn = (args) => ;
export const Item = Template.bind({});
Item.args = {
diff --git a/src/stories/Library/Modals/modal-pause/ModalPause.stories.tsx b/src/stories/Library/Modals/modal-pause/ModalPause.stories.tsx
index 266c1878a..b598f20c7 100644
--- a/src/stories/Library/Modals/modal-pause/ModalPause.stories.tsx
+++ b/src/stories/Library/Modals/modal-pause/ModalPause.stories.tsx
@@ -1,12 +1,10 @@
-import { withDesign } from "storybook-addon-designs";
-import { ComponentMeta, ComponentStory } from "@storybook/react";
+import { Meta, StoryFn } from "@storybook/react";
import { ModalPause } from "./ModalPause";
export default {
title: "Library / Modals / Pause",
component: ModalPause,
- decorators: [withDesign],
argTypes: {},
parameters: {
design: {
@@ -14,11 +12,9 @@ export default {
url: "https://www.figma.com/file/Zx9GrkFA3l4ISvyZD2q0Qi/Designsystem?node-id=2137%3A14335",
},
},
-} as ComponentMeta;
+} as Meta;
-const Template: ComponentStory = (args) => (
-
-);
+const Template: StoryFn = (args) => ;
export const Pause = Template.bind({});
Pause.args = {
diff --git a/src/stories/Library/Modals/modal-pause/ModalPause.tsx b/src/stories/Library/Modals/modal-pause/ModalPause.tsx
index 5d07ca699..368d11c1e 100644
--- a/src/stories/Library/Modals/modal-pause/ModalPause.tsx
+++ b/src/stories/Library/Modals/modal-pause/ModalPause.tsx
@@ -2,6 +2,7 @@ import React, { MutableRefObject, useCallback, useRef } from "react";
import { BaseOptions } from "flatpickr/dist/types/options";
import { Instance } from "flatpickr/dist/types/instance";
+import "flatpickr/dist/flatpickr.css";
import flatpickr from "flatpickr";
import { Button } from "../../Buttons/button/Button";
import { Links } from "../../links/Links";
diff --git a/src/stories/Library/Modals/modal-profile/ModalProfile.stories.tsx b/src/stories/Library/Modals/modal-profile/ModalProfile.stories.tsx
index d69b86de1..1d9522732 100644
--- a/src/stories/Library/Modals/modal-profile/ModalProfile.stories.tsx
+++ b/src/stories/Library/Modals/modal-profile/ModalProfile.stories.tsx
@@ -1,94 +1,88 @@
-import { withDesign } from "storybook-addon-designs";
-import { ComponentMeta, ComponentStory } from "@storybook/react";
+import { Meta, StoryFn } from "@storybook/react";
import { ModalProfile } from "./ModalProfile";
export default {
title: "Library / Modals / Profile",
component: ModalProfile,
- decorators: [withDesign],
argTypes: {
- showModal: {
- control: "boolean",
- defaultValue: true,
- },
- headerName: {
- control: { type: "text" },
- defaultValue: "Christine-Olivia Kristensen har et meget langt navn",
- },
- headerLinkHref: {
- control: { type: "text" },
- defaultValue: "/",
- },
- headerLinkText: {
- control: { type: "text" },
- defaultValue: "Se din profil",
- },
- notifications: {
- control: { type: "object" },
- defaultValue: [
- {
- label: {
- label: "overskredet",
- status: "danger",
- },
- number: {
- label: 2,
- status: "danger",
- },
- title: "Afleveret for sent",
- showDot: true,
- },
- {
- number: {
- label: 2,
- status: "warning",
- },
- title: "Lån overskredet",
- showDot: true,
- },
- ],
- },
- profileNavLinks: {
- control: { type: "object" },
- defaultValue: [
- {
- title: "Lån",
- href: "/",
- counter: "12",
- },
- {
- title: "Reserveringer",
- href: "/",
- counter: "7",
- },
- {
- title: "Huskeliste",
- href: "/",
- counter: "",
- },
- {
- title: "Gebyrer og erstatninger",
- href: "/",
- counter: "",
+ showModal: { control: "boolean" },
+ headerName: { control: "text" },
+ headerLinkHref: { control: "text" },
+ headerLinkText: { control: "text" },
+ notifications: { control: "object" },
+ profileNavLinks: { control: "object" },
+ },
+ args: {
+ showModal: true,
+ headerName: "Christine-Olivia Kristensen har et meget langt navn",
+ headerLinkHref: "/",
+ headerLinkText: "Se din profil",
+ notifications: [
+ {
+ href: "/",
+ label: {
+ label: "overskredet",
+ status: "danger",
},
- {
- title: "Gemte søgninger",
- href: "/",
- counter: "3",
+ number: {
+ label: 2,
+ status: "danger",
},
- {
- title: "Lånehistorik",
- href: "/",
- counter: "",
+ title: "Afleveret for sent",
+ showDot: true,
+ },
+ {
+ href: "/",
+ label: {
+ label: "overskredet",
+ status: "warning",
},
- {
- title: "Brugeroplysninger",
- href: "/",
- counter: "",
+ number: {
+ label: 2,
+ status: "warning",
},
- ],
- },
+ title: "Lån overskredet",
+ showDot: true,
+ },
+ ],
+ profileNavLinks: [
+ {
+ title: "Lån",
+ href: "/",
+ counter: "12",
+ },
+ {
+ title: "Reserveringer",
+ href: "/",
+ counter: "7",
+ },
+ {
+ title: "Huskeliste",
+ href: "/",
+ counter: "",
+ },
+ {
+ title: "Gebyrer og erstatninger",
+ href: "/",
+ counter: "",
+ },
+ {
+ title: "Gemte søgninger",
+ href: "/",
+ counter: "3",
+ },
+ {
+ title: "Lånehistorik",
+ href: "/",
+ counter: "",
+ },
+ {
+ title: "Brugeroplysninger",
+ href: "/",
+ counter: "",
+ },
+ ],
},
parameters: {
design: {
@@ -96,9 +90,9 @@ export default {
url: "https://www.figma.com/file/Zx9GrkFA3l4ISvyZD2q0Qi/Designsystem?node-id=2137%3A11410",
},
},
-} as ComponentMeta;
+} as Meta;
-const Template: ComponentStory = (args) => (
+const Template: StoryFn = (args) => (
);
diff --git a/src/stories/Library/Modals/modal-reservation/reservation.stories.tsx b/src/stories/Library/Modals/modal-reservation/reservation.stories.tsx
index 284061b87..1a700a32f 100644
--- a/src/stories/Library/Modals/modal-reservation/reservation.stories.tsx
+++ b/src/stories/Library/Modals/modal-reservation/reservation.stories.tsx
@@ -1,11 +1,9 @@
-import { withDesign } from "storybook-addon-designs";
-import { ComponentMeta, ComponentStory } from "@storybook/react";
+import { Meta, StoryFn } from "@storybook/react";
import Reservation from "./Reservation";
export default {
title: "Library / Modals / Reservation",
component: Reservation,
- decorators: [withDesign],
parameters: {
design: {
type: "figma",
@@ -13,42 +11,28 @@ export default {
},
},
argTypes: {
- title: {
- name: "Title",
- control: { type: "text" },
- },
- label: {
- name: "Label",
- control: { type: "text" },
- },
- author: {
- name: "Author",
- control: { type: "text" },
- },
- submitInfo: {
- name: "Submit Info text",
- control: { type: "text" },
- },
- submitButton: {
- name: "Submit Button text",
- control: { type: "text" },
- },
- state: {
- name: "State for reservation",
- defaultValue: "initial",
- },
- showPromoBar: {
- name: "Show PromoBar",
- defaultValue: false,
- },
- showInstantLoan: {
- name: "Show instant loan",
- defaultValue: false,
- },
+ title: { name: "Title", control: { type: "text" } },
+ label: { name: "Label", control: { type: "text" } },
+ author: { name: "Author", control: { type: "text" } },
+ submitInfo: { name: "Submit Info text", control: { type: "text" } },
+ submitButton: { name: "Submit Button text", control: { type: "text" } },
+ state: { name: "State for reservation", control: { type: "text" } },
+ showPromoBar: { name: "Show PromoBar", control: "boolean" },
+ showInstantLoan: { name: "Show instant loan", control: "boolean" },
+ },
+ args: {
+ state: "initial",
+ showPromoBar: false,
+ showInstantLoan: false,
+ label: "bog",
+ title: "Stephen Hawking",
+ author: "Af Isabel Sánchez Vegara, Amaia Arrazola (2018)",
+ submitInfo: "Vi har 8 eksemplarer og 21 står i kø",
+ submitButton: "GODKEND RESERVERING",
},
-} as ComponentMeta;
+} as Meta;
-const Template: ComponentStory = (args) => {
+const Template: StoryFn = (args) => {
return ;
};
diff --git a/src/stories/Library/Modals/modal-search/ModalSearch.stories.tsx b/src/stories/Library/Modals/modal-search/ModalSearch.stories.tsx
index b928d5b70..b8a111996 100644
--- a/src/stories/Library/Modals/modal-search/ModalSearch.stories.tsx
+++ b/src/stories/Library/Modals/modal-search/ModalSearch.stories.tsx
@@ -1,12 +1,10 @@
-import { withDesign } from "storybook-addon-designs";
-import { ComponentMeta, ComponentStory } from "@storybook/react";
+import { Meta, StoryFn } from "@storybook/react";
import { ModalSearch } from "./ModalSearch";
export default {
title: "Library / Modals / Search",
component: ModalSearch,
- decorators: [withDesign],
argTypes: {},
parameters: {
design: {
@@ -14,9 +12,9 @@ export default {
url: "https://www.figma.com/file/Zx9GrkFA3l4ISvyZD2q0Qi/Designsystem?node-id=2137%3A14335",
},
},
-} as ComponentMeta;
+} as Meta;
-const Template: ComponentStory = (args) => (
+const Template: StoryFn = (args) => (
);
diff --git a/src/stories/Library/Modals/modal-text/ModalText.stories.tsx b/src/stories/Library/Modals/modal-text/ModalText.stories.tsx
index 9e409ec25..3c2671f88 100644
--- a/src/stories/Library/Modals/modal-text/ModalText.stories.tsx
+++ b/src/stories/Library/Modals/modal-text/ModalText.stories.tsx
@@ -1,23 +1,19 @@
-import { withDesign } from "storybook-addon-designs";
-import { ComponentMeta, ComponentStory } from "@storybook/react";
+import { Meta, StoryFn } from "@storybook/react";
import { ModalText, textContent } from "./ModalText";
export default {
title: "Library / Modals / Text",
component: ModalText,
- decorators: [withDesign],
parameters: {
design: {
type: "figma",
url: "https://www.figma.com/file/Zx9GrkFA3l4ISvyZD2q0Qi/Designsystem?node-id=2137%3A11417",
},
},
-} as ComponentMeta;
+} as Meta;
-const Template: ComponentStory = (args) => (
-
-);
+const Template: StoryFn = (args) => ;
export const Text = Template.bind({});
Text.args = {
diff --git a/src/stories/Library/autosuggest-material/AutosuggestMaterial.stories.tsx b/src/stories/Library/autosuggest-material/AutosuggestMaterial.stories.tsx
index e6e853423..a8454d03a 100644
--- a/src/stories/Library/autosuggest-material/AutosuggestMaterial.stories.tsx
+++ b/src/stories/Library/autosuggest-material/AutosuggestMaterial.stories.tsx
@@ -1,5 +1,5 @@
-import { ComponentMeta, ComponentStory } from "@storybook/react";
-import { withDesign } from "storybook-addon-designs";
+import { Meta, StoryFn } from "@storybook/react";
+
import {
AutosuggestMaterial,
AutosuggestMaterialProps,
@@ -9,29 +9,28 @@ import { autosuggestMaterialSuggestions } from "./helper";
export default {
title: "Library / Autosuggest - Material",
component: AutosuggestMaterial,
- decorators: [withDesign],
argTypes: {
materialSuggestions: {
- name: "Material suggestions",
- defaultValue: autosuggestMaterialSuggestions,
- control: { type: "array" },
+ control: { type: "object" },
},
classes: {
- name: "Classes",
- defaultValue: undefined,
control: { type: "text" },
},
},
+ args: {
+ materialSuggestions: autosuggestMaterialSuggestions,
+ classes: undefined,
+ },
parameters: {
design: {
type: "figma",
url: "https://www.figma.com/file/ETOZIfmgGS1HUfio57SOh7/S%C3%B8gning?node-id=4709%3A24976",
},
},
-} as ComponentMeta;
+} as Meta;
-const Template: ComponentStory = (
- args: AutosuggestMaterialProps
+const Template: StoryFn = (
+ args: AutosuggestMaterialProps,
) => (
diff --git a/src/stories/Library/autosuggest-text/AutosuggestText.stories.tsx b/src/stories/Library/autosuggest-text/AutosuggestText.stories.tsx
index 2bf433926..72d977e90 100644
--- a/src/stories/Library/autosuggest-text/AutosuggestText.stories.tsx
+++ b/src/stories/Library/autosuggest-text/AutosuggestText.stories.tsx
@@ -1,34 +1,34 @@
-import { ComponentMeta, ComponentStory } from "@storybook/react";
-import { withDesign } from "storybook-addon-designs";
+import { Meta, StoryFn } from "@storybook/react";
import { AutosuggestText, AutosuggestTextProps } from "./AutosuggestText";
export default {
title: "Library / Autosuggest - Text",
component: AutosuggestText,
- decorators: [withDesign],
argTypes: {
textSuggestions: {
name: "Text suggestions",
- defaultValue: ["Item one (author)", "Item two (work)"],
- control: { type: "array" },
+ control: { type: "object" },
},
categoryText: {
name: "Category text",
- defaultValue: undefined,
control: { type: "text" },
},
},
+ args: {
+ textSuggestions: ["Item one (author)", "Item two (work)"],
+ categoryText: undefined,
+ },
parameters: {
design: {
type: "figma",
url: "https://www.figma.com/file/ETOZIfmgGS1HUfio57SOh7/S%C3%B8gning?node-id=4709%3A24976",
},
},
-} as ComponentMeta;
+} as Meta;
-const Template: ComponentStory = (
- args: AutosuggestTextProps
+const Template: StoryFn = (
+ args: AutosuggestTextProps,
) => (
diff --git a/src/stories/Library/availability-label/AvailabilityLabel.stories.tsx b/src/stories/Library/availability-label/AvailabilityLabel.stories.tsx
index c59cb0371..20c72d789 100644
--- a/src/stories/Library/availability-label/AvailabilityLabel.stories.tsx
+++ b/src/stories/Library/availability-label/AvailabilityLabel.stories.tsx
@@ -1,12 +1,10 @@
-import { ComponentMeta, ComponentStory } from "@storybook/react";
-import { withDesign } from "storybook-addon-designs";
+import { Meta, StoryFn } from "@storybook/react";
import AvailabilityLabel from "./AvailabilityLabel";
export default {
title: "Library / Availability Label",
component: AvailabilityLabel,
- decorators: [withDesign],
argTypes: {
manifestationType: {
name: "Manifestation Type",
@@ -33,9 +31,9 @@ export default {
},
},
parameters: {},
-} as ComponentMeta;
+} as Meta;
-const Template: ComponentStory = (args) => (
+const Template: StoryFn = (args) => (
);
diff --git a/src/stories/Library/availability-label/abilityLabel.hoc.tsx b/src/stories/Library/availability-label/abilityLabel.hoc.tsx
index 5022400d8..35c23d6b0 100644
--- a/src/stories/Library/availability-label/abilityLabel.hoc.tsx
+++ b/src/stories/Library/availability-label/abilityLabel.hoc.tsx
@@ -13,7 +13,7 @@ type PropsProcessedComponent = Omit<
};
export const withAvailabilityProps = (
- Component: React.FC
+ Component: React.FC,
): React.FC> => {
const defaultClasses = ["availability-label", "text-label"];
diff --git a/src/stories/Library/avatar/Avatar.stories.tsx b/src/stories/Library/avatar/Avatar.stories.tsx
index 2f4ed9ec2..2df97ecde 100644
--- a/src/stories/Library/avatar/Avatar.stories.tsx
+++ b/src/stories/Library/avatar/Avatar.stories.tsx
@@ -1,10 +1,8 @@
-import { withDesign } from "storybook-addon-designs";
import { StoryBaseType } from "../../../types/StorybookHelpers";
import { Avatar } from "./Avatar";
const StoryBase: StoryBaseType = {
title: "Library / Avatar",
- decorators: [withDesign],
argTypes: {},
parameters: {
design: {
diff --git a/src/stories/Library/banner/Banner.stories.tsx b/src/stories/Library/banner/Banner.stories.tsx
index 4f5ac8a6b..7e527025b 100644
--- a/src/stories/Library/banner/Banner.stories.tsx
+++ b/src/stories/Library/banner/Banner.stories.tsx
@@ -1,11 +1,10 @@
-import { ComponentMeta, ComponentStory } from "@storybook/react";
-import { withDesign } from "storybook-addon-designs";
+import { Meta, StoryFn } from "@storybook/react";
+
import Banner from "./Banner";
export default {
title: "Library / Banner",
component: Banner,
- decorators: [withDesign],
parameters: {
design: {
type: "figma",
@@ -14,29 +13,31 @@ export default {
},
argTypes: {
imageSrc: {
- defaultValue: "images/campaign_cover.jpg",
control: { type: "text" },
},
title: {
name: "Title",
- defaultValue: "Hvad skal jeg