Skip to content

Commit

Permalink
chore(doc): fix lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
Franck Gaudin committed Dec 15, 2023
1 parent 6c781e4 commit 59d5424
Show file tree
Hide file tree
Showing 23 changed files with 70 additions and 68 deletions.
3 changes: 2 additions & 1 deletion apps/docs/app/playground/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ export default function PlaygroundPage() {
flexDirection: "column",
gap: "0.75rem",
marginBlock: "2rem"
}}>
}}
>
<li>
<Link href="/playground/codeblock">Codeblock →</Link>
</li>
Expand Down
6 changes: 3 additions & 3 deletions apps/docs/components/copyButton/CopyButton.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const meta = {
title: "Component/CopyButton",
component: CopyButton,
args: {
text: "storybook is awesome",
text: "storybook is awesome"
}
} satisfies Meta<typeof CopyButton>;

Expand All @@ -18,12 +18,12 @@ export const Default: Story = {};
export const Inline: Story = {
args: {
variant: "inline"
},
}
};

export const Ghost: Story = {
args: {
variant: "ghost",
children: "this text can be copied in 1 click"
},
}
};
4 changes: 2 additions & 2 deletions apps/docs/components/copyButton/CopyButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const CopyButton = (
const [isCopied, setIsCopied] = React.useState(false);

const classes = clsx("hd-copy-button", {
[`hd-copy-button--${variant}`]: variant !== "default",
[`hd-copy-button--${variant}`]: variant !== "default"
}, className);

const copy = async () => {
Expand All @@ -47,7 +47,7 @@ const CopyButton = (
: CopiedSvg
);

const content = children ?? CopySvg
const content = children ?? CopySvg;

return (
<Button isDisabled={isCopied} onPress={copy} className={classes} aria-label="Copy" {...rest}>
Expand Down
5 changes: 2 additions & 3 deletions apps/docs/components/iconTable/IconItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ function toKebabCase(str: string) {
}

const IconItem: React.FC<IconItemProps> = ({ name, type, size }) => {

const getIconNumericSize = (iconSize: IconItemProps["size"]) => {
switch (iconSize) {
case "sm":
Expand Down Expand Up @@ -46,10 +45,10 @@ const IconItem: React.FC<IconItemProps> = ({ name, type, size }) => {
<div className="hd-icon-item-content">
<span className="hd-icon-item__icon">
<CopyButton className="hd-icon-item-copy" text={copyString} variant="ghost">
<Component size={size}/>
<Component size={size} />
</CopyButton>
</span>
<div className="hd-icon-item__title">
<div className="hd-icon-item__title">
{formattedName}
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/components/iconTable/IconTable.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { IconTable } from "./IconTable";

const meta = {
title: "Component/IconTable",
component: IconTable,
component: IconTable
} satisfies Meta<typeof IconTable>;

export default meta;
Expand Down
18 changes: 9 additions & 9 deletions apps/docs/components/preview/Preview.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Preview from "./Preview";
const meta = {
title: "Component/Preview",
component: Preview
} satisfies Meta<typeof Preview>
} satisfies Meta<typeof Preview>;

export default meta;
type Story = StoryObj<typeof meta>;
Expand All @@ -18,60 +18,60 @@ export const Color: Story = {
name: "sapphire-500",
value: "#5f61c5"
}
}
};

export const FontFamily: Story = {
args: {
category: "fontFamily",
name: "font-family-primary",
value: "ABC Favorit"
}
}
};

export const FontSize: Story = {
args: {
category: "fontSize",
name: "font-size-120",
value: "1rem"
}
}
};

export const FontWeight: Story = {
args: {
category: "fontWeight",
name: "font-weight-400",
value: "400"
}
}
};

export const LineHeight: Story = {
args: {
category: "lineHeight",
name: "line-height-120",
value: "1.125rem"
}
}
};

export const BorderRadius: Story = {
args: {
category: "borderRadius",
name: "border-radius-4",
value: "1.5rem"
}
}
};

export const Size: Story = {
args: {
category: "size",
name: "space-1280",
value: "8rem"
}
}
};

export const Shadow: Story = {
args: {
category: "shadow",
name: "shadow-sm",
value: "0 1px 6px 0 rgba(60, 60, 60, 0.10)"
}
}
};
2 changes: 1 addition & 1 deletion apps/docs/components/ui/header/Header.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Header from "./Header";
const meta = {
title: "Ui/Header",
component: Header
} satisfies Meta<typeof Header>
} satisfies Meta<typeof Header>;

export default meta;
type Story = StoryObj<typeof meta>;
Expand Down
3 changes: 2 additions & 1 deletion apps/docs/components/ui/iconButton/IconButton.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ const meta = {
export default meta;
type Story = StoryObj<typeof meta>;

/* eslint-disable max-len */
const copyIcon = <svg stroke="currentColor" width="16" height="16" className="hd-codeblock-copy-button__icon" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13.3333 6H7.33333C6.59695 6 6 6.59695 6 7.33333V13.3333C6 14.0697 6.59695 14.6667 7.33333 14.6667H13.3333C14.0697 14.6667 14.6667 14.0697 14.6667 13.3333V7.33333C14.6667 6.59695 14.0697 6 13.3333 6Z" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" /><path d="M3.33337 9.99992H2.66671C2.31309 9.99992 1.97395 9.85944 1.7239 9.60939C1.47385 9.35935 1.33337 9.02021 1.33337 8.66659V2.66659C1.33337 2.31296 1.47385 1.97382 1.7239 1.72378C1.97395 1.47373 2.31309 1.33325 2.66671 1.33325H8.66671C9.02033 1.33325 9.35947 1.47373 9.60952 1.72378C9.85956 1.97382 10 2.31296 10 2.66659V3.33325" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" /></svg>;

export const Default: Story = {
args: {
children: copyIcon
}
}
};
14 changes: 7 additions & 7 deletions apps/docs/components/ui/image/Image.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import type { Meta, StoryObj } from '@storybook/react';
import type { Meta, StoryObj } from "@storybook/react";

import Image from './Image';
import Image from "./Image";

const meta = {
title: 'Ui/Image',
title: "Ui/Image",
component: Image
} satisfies Meta<typeof Image>
} satisfies Meta<typeof Image>;

export default meta;
type Story = StoryObj<typeof meta>;

export const Default: Story = {
args: {
src: 'https://placebear.com/640/360',
alt: 'Image',
src: "https://placebear.com/640/360",
alt: "Image",
width: 640,
height: 360
}
}
};
1 change: 1 addition & 0 deletions apps/docs/components/ui/mdx/Mdx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ interface MdxProps {

const Mdx = ({ code }: MdxProps) => {
const Component = useMDXComponent(code);

return <Component components={components} />;
};

Expand Down
10 changes: 5 additions & 5 deletions apps/docs/components/ui/mobileMenu/MobileMenu.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ type TriggerStory = StoryObj<typeof MobileMenuTrigger>;
export const Default: Story = {
args: {
isOpen: true
},
}
}
};

export const Trigger: TriggerStory = {
args: {
onToggle: () => {}
},
render: (args) => {
render: args => {
return (
<MobileMenuTrigger {...args} />
)
},
);
}
};
2 changes: 1 addition & 1 deletion apps/docs/components/ui/nav/Nav.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ export const Default: Story = {
}
]
}
}
};
2 changes: 1 addition & 1 deletion apps/docs/components/ui/overlay/Overlay.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ export const Default: Story = {
args: {
isOpen: true
}
}
};
4 changes: 2 additions & 2 deletions apps/docs/components/ui/pre/Pre.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ export const Default: Story = {
"data-language": "tsx",
children: <code>const foo = 'bar';</code>
}
}
};

export const WithoutTitle: Story = {
args: {
raw: "const foo = 'bar';",
"data-language": "tsx",
children: <code>const foo = 'bar';</code>
}
}
};
10 changes: 5 additions & 5 deletions apps/docs/components/ui/pre/Pre.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ const Pre = ({ children, title, "data-language": dataLanguage, raw, ...props }:

const langContent = dataLanguage && (
<span className="hd-pre-header__lang">
<LangIcon lang={dataLanguage} className="hd-pre-header__lang-icon"/>
<LangIcon lang={dataLanguage} className="hd-pre-header__lang-icon" />
</span>
)
);

const titleContent = <span className="hd-pre-header__title">{title}</span>
const copyButton = raw && <CopyButton text={raw}/>
const titleContent = <span className="hd-pre-header__title">{title}</span>;
const copyButton = raw && <CopyButton text={raw} />;

return (
<pre {...props} className={classes}>
Expand All @@ -46,7 +46,7 @@ const Pre = ({ children, title, "data-language": dataLanguage, raw, ...props }:
<div className="hd-pre__code">
{children}
</div>
{!title && <div className="hd-pre__action">{copyButton}</div> }
{!title && <div className="hd-pre__action">{copyButton}</div>}
</pre>
);
};
Expand Down
4 changes: 2 additions & 2 deletions apps/docs/components/ui/pre/pre.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.hd-pre {
overflow: hidden;
border: var(--hd-border-size) solid var(--hd-color-neutral-border);

/* the radius top is larger to eliminate a visual glitch with the header */
border-radius: 0.6rem 0.6rem 0.5rem 0.5rem;
color: var(--hd-color-neutral-text);
Expand Down Expand Up @@ -28,8 +29,7 @@
/* pre HEADER */
.hd-pre-header {
display: flex;
padding-inline-start: var(--hd-space-2);
padding-inline-end: var(--hd-space-1);
padding-inline: var(--hd-space-2) var(--hd-space-1);
height: 3rem;
font-size: 0.875rem;
font-family: var(--hd-default-font-family);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ export const Default: Story = {
url: "#section-3",
id: "section-3"
}
],
},
}
]
}
};
16 changes: 8 additions & 8 deletions apps/docs/components/ui/sidebar/Sidebar.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const meta = {
defaultViewport: "mobile1"
}
}
} satisfies Meta<typeof Sidebar>
} satisfies Meta<typeof Sidebar>;

export default meta;
type Story = StoryObj<typeof meta>;
Expand All @@ -23,27 +23,27 @@ export const Default: Story = {
title: "Getting Started",
_raw: {
flattenedPath: "/getting-started",
sourceFileDir: "/pages",
},
sourceFileDir: "/pages"
}
},
{
_id: "2",
title: "Components",
_raw: {
flattenedPath: "/components",
sourceFileDir: "/pages",
},
sourceFileDir: "/pages"
}
},
{
_id: "3",
title: "Icons",
_raw: {
flattenedPath: "/icons",
sourceFileDir: "/pages",
},
sourceFileDir: "/pages"
}
}
],
isOpen: true,
onClose: () => {}
}
}
};
4 changes: 2 additions & 2 deletions apps/docs/components/ui/subHeader/SubHeader.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ export const Default: Story = {
}
],
toggleOpenState: () => {}
},
}
}
};
10 changes: 5 additions & 5 deletions apps/docs/components/ui/switcher/Switcher.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ import Switcher from "./Switcher";
const meta = {
title: "Ui/Switcher",
component: Switcher
} satisfies Meta<typeof Switcher>
} satisfies Meta<typeof Switcher>;

export default meta;
type Story = StoryObj<typeof meta>;

export const React: Story = {
args: {
type: "react"
},
}
}
};

export const Svg: Story = {
args: {
type: "svg"
},
}
}
};
Loading

0 comments on commit 59d5424

Please sign in to comment.