Skip to content

Commit 951782d

Browse files
committed
formatting
1 parent 240c548 commit 951782d

File tree

19 files changed

+329
-248
lines changed

19 files changed

+329
-248
lines changed

web/common/.storybook/main.ts

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
1-
import type { StorybookConfig } from '@storybook/react-vite';
1+
import type { StorybookConfig } from '@storybook/react-vite'
22

33
const config: StorybookConfig = {
4-
"stories": [
5-
"../src/**/*.mdx",
6-
"../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"
4+
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
5+
addons: [
6+
'@storybook/addon-essentials',
7+
'@storybook/addon-docs',
8+
'@storybook/addon-onboarding',
79
],
8-
"addons": [
9-
"@storybook/addon-essentials",
10-
"@storybook/addon-docs",
11-
"@storybook/addon-onboarding"
12-
],
13-
"framework": {
14-
"name": "@storybook/react-vite",
15-
"options": {}
16-
}
17-
};
18-
export default config;
10+
framework: {
11+
name: '@storybook/react-vite',
12+
options: {},
13+
},
14+
}
15+
export default config

web/common/.storybook/preview.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ const preview: Preview = {
55
parameters: {
66
controls: {
77
matchers: {
8-
color: /(background|color)$/i,
9-
date: /Date$/i,
8+
color: /(background|color)$/i,
9+
date: /Date$/i,
1010
},
1111
},
1212
},
13-
};
13+
}
1414

15-
export default preview;
15+
export default preview

web/common/eslint.config.mjs

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
// For more info, see https://github.com/storybookjs/eslint-plugin-storybook#configuration-flat-config-format
2-
import storybook from "eslint-plugin-storybook";
2+
import storybook from 'eslint-plugin-storybook'
33

44
import eslint from '@eslint/js'
55
import tseslint from 'typescript-eslint'
66

7-
export default tseslint.config(eslint.configs.recommended, tseslint.configs.recommended, {
8-
rules: {
9-
'@typescript-eslint/no-explicit-any': 'off',
10-
'@typescript-eslint/no-unused-vars': 'off',
11-
'@typescript-eslint/no-empty-object-type': 'off',
12-
'@typescript-eslint/no-unused-expressions': 'off',
13-
'no-empty': 'off',
7+
export default tseslint.config(
8+
eslint.configs.recommended,
9+
tseslint.configs.recommended,
10+
{
11+
rules: {
12+
'@typescript-eslint/no-explicit-any': 'off',
13+
'@typescript-eslint/no-unused-vars': 'off',
14+
'@typescript-eslint/no-empty-object-type': 'off',
15+
'@typescript-eslint/no-unused-expressions': 'off',
16+
'no-empty': 'off',
17+
},
1418
},
15-
}, storybook.configs["flat/recommended"]);
19+
storybook.configs['flat/recommended'],
20+
)

web/common/postcss.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ export default {
33
tailwindcss: {},
44
autoprefixer: {},
55
},
6-
}
6+
}

web/common/src/components/Badge/Badge.stories.tsx

Lines changed: 41 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,43 @@
1-
import type { Meta, StoryObj } from "@storybook/react-vite";
1+
import type { Meta, StoryObj } from '@storybook/react-vite'
22

3-
import { EnumShape, EnumSize } from "@/types/enums";
4-
import { Badge } from "./Badge";
3+
import { EnumShape, EnumSize } from '@/types/enums'
4+
import { Badge } from './Badge'
55

66
const meta: Meta<typeof Badge> = {
7-
title: "Components/Badge",
7+
title: 'Components/Badge',
88
component: Badge,
9-
tags: ["autodocs"],
9+
tags: ['autodocs'],
1010
argTypes: {
1111
size: {
12-
control: { type: "select" },
12+
control: { type: 'select' },
1313
options: Object.values(EnumSize),
1414
},
1515
shape: {
16-
control: { type: "select" },
16+
control: { type: 'select' },
1717
options: Object.values(EnumShape),
1818
},
19-
children: { control: "text" },
19+
children: { control: 'text' },
2020
},
21-
};
21+
}
2222

23-
export default meta;
24-
type Story = StoryObj<typeof Badge>;
23+
export default meta
24+
type Story = StoryObj<typeof Badge>
2525

2626
export const Default: Story = {
2727
args: {
28-
children: "Default Badge",
28+
children: 'Default Badge',
2929
},
30-
};
30+
}
3131

3232
export const Sizes: Story = {
33-
render: (args) => (
34-
<div style={{ display: "flex", gap: 8, flexWrap: "wrap" }}>
35-
{Object.values(EnumSize).map((size) => (
36-
<Badge key={size} size={size} {...args}>
33+
render: args => (
34+
<div style={{ display: 'flex', gap: 8, flexWrap: 'wrap' }}>
35+
{Object.values(EnumSize).map(size => (
36+
<Badge
37+
key={size}
38+
size={size}
39+
{...args}
40+
>
3741
{size} Badge
3842
</Badge>
3943
))}
@@ -42,13 +46,17 @@ export const Sizes: Story = {
4246
args: {
4347
children: undefined,
4448
},
45-
};
49+
}
4650

4751
export const Shapes: Story = {
48-
render: (args) => (
49-
<div style={{ display: "flex", gap: 8, flexWrap: "wrap" }}>
50-
{Object.values(EnumShape).map((shape) => (
51-
<Badge key={shape} shape={shape} {...args}>
52+
render: args => (
53+
<div style={{ display: 'flex', gap: 8, flexWrap: 'wrap' }}>
54+
{Object.values(EnumShape).map(shape => (
55+
<Badge
56+
key={shape}
57+
shape={shape}
58+
{...args}
59+
>
5260
{shape} Badge
5361
</Badge>
5462
))}
@@ -57,11 +65,18 @@ export const Shapes: Story = {
5765
args: {
5866
children: undefined,
5967
},
60-
};
68+
}
6169

6270
export const Colors: Story = {
63-
render: (args) => (
64-
<div style={{ display: "flex", gap: 8, flexWrap: "wrap", alignItems: "center" }}>
71+
render: args => (
72+
<div
73+
style={{
74+
display: 'flex',
75+
gap: 8,
76+
flexWrap: 'wrap',
77+
alignItems: 'center',
78+
}}
79+
>
6580
<Badge
6681
size={EnumSize.S}
6782
shape={EnumShape.Pill}
@@ -99,5 +114,4 @@ export const Colors: Story = {
99114
args: {
100115
children: undefined,
101116
},
102-
};
103-
117+
}
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
import { Slot } from "@radix-ui/react-slot";
2-
import { type VariantProps } from "class-variance-authority";
3-
import React from "react";
1+
import { Slot } from '@radix-ui/react-slot'
2+
import { type VariantProps } from 'class-variance-authority'
3+
import React from 'react'
44

5-
import { type Size, type Shape } from "@/types/enums";
6-
import { cn } from "@/utils";
7-
import { badgeVariants } from "./help";
5+
import { type Size, type Shape } from '@/types/enums'
6+
import { cn } from '@/utils'
7+
import { badgeVariants } from './help'
88

99
export interface BadgeProps
1010
extends React.HTMLAttributes<HTMLSpanElement>,
11-
VariantProps<typeof badgeVariants> {
12-
asChild?: boolean;
13-
size?: Size;
14-
shape?: Shape;
11+
VariantProps<typeof badgeVariants> {
12+
asChild?: boolean
13+
size?: Size
14+
shape?: Shape
1515
}
1616

1717
export const Badge = React.forwardRef<HTMLSpanElement, BadgeProps>(
1818
({ className, size, shape, asChild = false, ...props }, ref) => {
19-
const Comp = asChild ? Slot : "span";
19+
const Comp = asChild ? Slot : 'span'
2020
return (
2121
<Comp
2222
className={cn(badgeVariants({ size, shape, className }))}
2323
ref={ref}
2424
{...props}
2525
/>
26-
);
26+
)
2727
},
28-
);
29-
Badge.displayName = "Badge";
28+
)
29+
Badge.displayName = 'Badge'
Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
import { cva } from "class-variance-authority";
1+
import { cva } from 'class-variance-authority'
22

3-
import { EnumShape, EnumSize } from "@/types/enums";
3+
import { EnumShape, EnumSize } from '@/types/enums'
44

55
export const badgeVariants = cva(
6-
"bg-badge-background text-badge-foreground font-mono inline-flex align-middle items-center justify-center gap-2 leading-none whitespace-nowrap font-semibold",
6+
'bg-badge-background text-badge-foreground font-mono inline-flex align-middle items-center justify-center gap-2 leading-none whitespace-nowrap font-semibold',
77
{
88
variants: {
99
size: {
10-
[EnumSize.XXS]: "h-5 px-2 text-2xs leading-none rounded-2xs",
11-
[EnumSize.XS]: "h-6 px-2 text-2xs rounded-xs",
12-
[EnumSize.S]: "h-7 px-3 text-xs rounded-sm",
13-
[EnumSize.M]: "h-8 px-4 rounded-md",
14-
[EnumSize.L]: "h-9 px-4 rounded-lg",
15-
[EnumSize.XL]: "h-10 px-4 rounded-xl",
16-
[EnumSize.XXL]: "h-11 px-6 rounded-2xl",
10+
[EnumSize.XXS]: 'h-5 px-2 text-2xs leading-none rounded-2xs',
11+
[EnumSize.XS]: 'h-6 px-2 text-2xs rounded-xs',
12+
[EnumSize.S]: 'h-7 px-3 text-xs rounded-sm',
13+
[EnumSize.M]: 'h-8 px-4 rounded-md',
14+
[EnumSize.L]: 'h-9 px-4 rounded-lg',
15+
[EnumSize.XL]: 'h-10 px-4 rounded-xl',
16+
[EnumSize.XXL]: 'h-11 px-6 rounded-2xl',
1717
},
1818
shape: {
19-
[EnumShape.Square]: "rounded-none",
20-
[EnumShape.Round]: "rounded-inherit",
21-
[EnumShape.Pill]: "rounded-full",
22-
}
19+
[EnumShape.Square]: 'rounded-none',
20+
[EnumShape.Round]: 'rounded-inherit',
21+
[EnumShape.Pill]: 'rounded-full',
22+
},
2323
},
2424
defaultVariants: {
2525
size: EnumSize.S,
2626
shape: EnumShape.Round,
2727
},
2828
},
29-
);
29+
)

0 commit comments

Comments
 (0)