Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.2.5 #21

Merged
merged 4 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import type { Preview } from "@storybook/react";
import "./preview.scss";
import DocsLinks from "./preview/DocsLinks";

const preview: Preview = {
parameters: {
docs: {
container: DocsLinks,
},
layout: "padded",
},
tags: ["autodocs"],
Expand Down
15 changes: 15 additions & 0 deletions .storybook/preview/DocsLinks.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@use "@/index.module.scss" as *;

.docs-links {
position: absolute;
top: 0;
right: 0;
display: flex;
flex-direction: column;
background-color: $grey-1;

a {
padding: $space-4 $space-8;
color: $white;
}
}
40 changes: 40 additions & 0 deletions .storybook/preview/DocsLinks.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import type { DocsContainerProps } from "@storybook/blocks";
import type { StoryMetaParameters } from "../../src/types";

import { DocsContainer } from "@storybook/blocks";
import type { PropsWithChildren } from "react";
import "./DocsLinks.scss";

type Props = PropsWithChildren<DocsContainerProps> & {
context: { primaryStory: { parameters: StoryMetaParameters } };
};

const DocsLinks = ({ children, ...props }: Props) => {
const links = props.context.primaryStory.parameters.links;

return (
<DocsContainer {...props}>
{links && (
<div className="docs-links">
<a
href={`https://blue-tomato.atlassian.net/wiki/x/${links.confluence}`}
target="_blank"
rel="noreferrer"
>
Confluence
</a>
<a
href={`https://www.figma.com/design/${links.figma}`}
target="_blank"
rel="noreferrer"
>
Figma
</a>
</div>
)}
{children}
</DocsContainer>
);
};

export default DocsLinks;
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@
> the design system of Blue Tomato

![Logo](logo.png)

## Development

1. Clone the repository via `git clone [email protected]:blue-tomato/blueto.git`
2. Run `npm install` inside of the repository
3. Run `npm run dev`
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"enabled": true
},
"javascript": {
"globals": ["React"]
"globals": ["React", "StoryMeta"]
},
"linter": {
"enabled": true,
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@blue-tomato/blueto",
"version": "0.2.4",
"version": "0.2.5",
"license": "EUPL-1.2",
"description": "🪐 BLUETO - the design system of Blue Tomato",
"homepage": "https://blueto.blue-tomato.com",
Expand Down
2 changes: 1 addition & 1 deletion src/components/Icon.module.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@use "@/index.module.scss" as *;

.icon {
display: flex;
display: block;
}
5 changes: 5 additions & 0 deletions src/stories/components/Button.stories.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@use "@/index.module.scss" as *;

.long-text {
max-width: 128px;
}
25 changes: 0 additions & 25 deletions src/stories/components/Button.stories.ts

This file was deleted.

46 changes: 46 additions & 0 deletions src/stories/components/Button.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { Button } from "@/components";
import type { StoryMeta } from "@/types";
import styles from "./Button.stories.module.scss";

const Docs: StoryMeta<typeof Button> = {
title: "BLUETO/components/Button",
component: Button,
args: {
children: "Button",
disabled: false,
icon: undefined,
loading: false,
variant: "primary",
},
argTypes: {
icon: { control: "text" },
},
parameters: {
links: {
confluence: "3ArPKQ",
figma: "rUIq4O2W7nCzofq3nFoURP/BLUETO-Components?node-id=19-2",
},
},
};

const Default: StoryMeta<typeof Button> = {};

const WithIcon: StoryMeta<typeof Button> = {
args: {
icon: "flag.at",
},
};

const WithLongText: StoryMeta<typeof Button> = {
render: (props) => (
<div className={styles.longText}>
<Button {...props} />
</div>
),
args: {
children: "Button long text",
},
};

export default Docs;
export { Default, WithIcon, WithLongText };
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@use "@/index.module.scss" as *;

.wrapper {
display: flex;
gap: $space-16;
}
30 changes: 30 additions & 0 deletions src/stories/components/Buttongroup/CategoryButton.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { CategoryButton } from "@/components";
import type { Meta } from "@storybook/react";
import styles from "./CategoryButton.stories.module.scss";

const Docs: Meta<typeof CategoryButton> = {
title: "BLUETO/components/Buttongroup/CategoryButton",
render: (props) => (
<div className={styles.wrapper}>
<CategoryButton {...props} />
<CategoryButton {...props} />
</div>
),
args: {
active: false,
children: "CategoryButton",
color: "white",
size: "large",
},
parameters: {
links: {
confluence: "B4B6L",
figma: "rUIq4O2W7nCzofq3nFoURP/BLUETO-Components?node-id=420-52",
},
},
};

const Default: Meta<typeof CategoryButton> = {};

export default Docs;
export { Default };
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@use "@/index.module.scss" as *;

.wrapper {
display: flex;
gap: $space-16;
}
29 changes: 29 additions & 0 deletions src/stories/components/Buttongroup/SizeButton.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { SizeButton } from "@/components";
import type { Meta } from "@storybook/react";
import styles from "./SizeButton.stories.module.scss";

const Docs: Meta<typeof SizeButton> = {
title: "BLUETO/components/Buttongroup/SizeButton",
render: (props) => (
<div className={styles.wrapper}>
<SizeButton {...props} />
<SizeButton {...props} />
</div>
),
args: {
active: false,
children: "46",
disabled: false,
},
parameters: {
links: {
confluence: "CACDL",
figma: "rUIq4O2W7nCzofq3nFoURP/BLUETO-Components?node-id=420-52",
},
},
};

const Default: Meta<typeof SizeButton> = {};

export default Docs;
export { Default };
15 changes: 0 additions & 15 deletions src/stories/components/CategoryButton.stories.ts

This file was deleted.

17 changes: 13 additions & 4 deletions src/stories/components/Checkbox.stories.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Checkbox } from "@/components";
import type { Meta } from "@storybook/react";

export default {
title: "components/Checkbox",
const Docs: Meta<typeof Checkbox> = {
title: "BLUETO/components/Checkbox",
component: Checkbox,
args: {
children: "Checkbox",
Expand All @@ -11,12 +11,21 @@ export default {
argTypes: {
error: { control: "text" },
},
parameters: {
links: {
confluence: "NwA0L",
figma: "rUIq4O2W7nCzofq3nFoURP/BLUETO-Components?node-id=167-125",
},
},
};

export const Default: Meta<typeof Checkbox> = {};
const Default: Meta<typeof Checkbox> = {};

export const WithError: Meta<typeof Checkbox> = {
const WithError: Meta<typeof Checkbox> = {
args: {
error: "Error",
},
};

export default Docs;
export { Default, WithError };
15 changes: 12 additions & 3 deletions src/stories/components/Icon.stories.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
import { Icon } from "@/components";
import type { Meta } from "@storybook/react";

export default {
title: "components/Icon",
const Docs: Meta<typeof Icon> = {
title: "BLUETO/components/Icon",
component: Icon,
args: {
icon: "flag.at",
},
argTypes: {
icon: { control: "text" },
},
parameters: {
links: {
confluence: "AQBCHg",
figma: "4BjT8a6YN5icL5bpEfsszx/Foundation?node-id=3-6",
},
},
};

export const Default: Meta<typeof Icon> = {};
const Default: Meta<typeof Icon> = {};

export default Docs;
export { Default };
7 changes: 7 additions & 0 deletions src/stories/components/RadioButton.stories.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@use "@/index.module.scss" as *;

.wrapper {
display: flex;
flex-direction: column;
gap: $space-16;
}
Loading