Skip to content

Commit 30c7515

Browse files
committed
feat: migrate to biome js + fix issues
1 parent 452650f commit 30c7515

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+3302
-6245
lines changed

apps/storybook/.eslintrc.cjs

Lines changed: 0 additions & 14 deletions
This file was deleted.

apps/storybook/package.json

Lines changed: 27 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,39 @@
11
{
2-
"type": "module",
3-
"scripts": {
4-
"panda-watch": "pnpm exec panda cssgen --watch --outfile dist/styles.css",
5-
"dev": "storybook dev -p 6006 --disable-telemetry --no-open",
6-
"build": "storybook build",
7-
"preview": "pnpm build && pnpm dlx http-server storybook-static -p 8080"
8-
},
92
"dependencies": {
10-
"@storybook/theming": "^8.1.11",
11-
"lucide-react": "^0.399.0",
3+
"@storybook/theming": "^8.3.6",
4+
"lucide-react": "^0.453.0",
125
"react": "^18.3.1",
13-
"react-aria": "^3.33.1",
14-
"react-aria-components": "^1.2.1",
6+
"react-aria": "^3.35.1",
7+
"react-aria-components": "^1.4.1",
158
"react-dom": "^18.3.1",
16-
"react-stately": "^3.31.1"
9+
"react-stately": "^3.33.0"
1710
},
1811
"devDependencies": {
19-
"@chromatic-com/storybook": "^1.6.0",
20-
"@pandacss/dev": "^0.41.0",
21-
"@storybook/addon-a11y": "^8.1.11",
22-
"@storybook/addon-essentials": "^8.1.11",
23-
"@storybook/addon-interactions": "^8.1.11",
24-
"@storybook/addon-links": "^8.1.11",
25-
"@storybook/addon-themes": "^8.1.11",
26-
"@storybook/blocks": "^8.1.11",
27-
"@storybook/react": "^8.1.11",
28-
"@storybook/react-vite": "^8.1.11",
29-
"@storybook/test": "^8.1.11",
12+
"@chromatic-com/storybook": "^3.1.0",
13+
"@pandacss/dev": "^0.47.0",
14+
"@storybook/addon-a11y": "^8.3.6",
15+
"@storybook/addon-essentials": "^8.3.6",
16+
"@storybook/addon-interactions": "^8.3.6",
17+
"@storybook/addon-links": "^8.3.6",
18+
"@storybook/addon-themes": "^8.3.6",
19+
"@storybook/blocks": "^8.3.6",
20+
"@storybook/react": "^8.3.6",
21+
"@storybook/react-vite": "^8.3.6",
22+
"@storybook/test": "^8.3.6",
3023
"@types/react": "^18.3.3",
3124
"@types/react-dom": "^18.3.0",
32-
"@typescript-eslint/eslint-plugin": "^7.14.1",
33-
"@typescript-eslint/parser": "^7.14.1",
3425
"@vitejs/plugin-react-swc": "^3.7.0",
35-
"eslint": "^9.6.0",
36-
"eslint-plugin-react-hooks": "^4.6.2",
37-
"eslint-plugin-react-refresh": "^0.4.7",
38-
"eslint-plugin-storybook": "^0.8.0",
3926
"pandacss-preset-react-aria-components": "workspace:*",
40-
"storybook": "^8.1.11",
27+
"storybook": "^8.3.6",
4128
"typescript": "^5.5.2",
4229
"vite": "^5.3.2",
43-
"vite-tsconfig-paths": "^4.3.2"
44-
}
45-
}
30+
"vite-tsconfig-paths": "^5.0.1"
31+
},
32+
"scripts": {
33+
"build": "storybook build",
34+
"dev": "storybook dev -p 6006 --disable-telemetry --no-open",
35+
"panda-watch": "pnpm exec panda cssgen --watch --outfile dist/styles.css",
36+
"preview": "pnpm build && pnpm dlx http-server storybook-static -p 8080"
37+
},
38+
"type": "module"
39+
}

apps/storybook/postcss.config.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
22
plugins: [require("@pandacss/dev/postcss")()],
3-
};
3+
};

apps/storybook/src/components/AlertDialog.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { type ReactNode } from "react";
1+
import type { ReactNode } from "react";
22
import { chain } from "react-aria";
3-
import { Heading, type DialogProps } from "react-aria-components";
4-
import { css, cva, type RecipeVariantProps } from "../../styled-system/css";
3+
import { type DialogProps, Heading } from "react-aria-components";
4+
import { type RecipeVariantProps, css, cva } from "../../styled-system/css";
55
import { Button } from "./Button";
66
import { Dialog } from "./Dialog";
77
import { Icon } from "./Icon";
@@ -49,13 +49,13 @@ export function AlertDialog(props: AlertDialogProps) {
4949
{({ close }) => (
5050
<>
5151
<Heading
52-
slot="title"
5352
className={css({
5453
fontSize: "xl",
5554
lineHeight: "tight",
5655
fontWeight: "semibold",
5756
my: "0",
5857
})}
58+
slot="title"
5959
>
6060
{title}
6161
</Heading>
@@ -83,17 +83,17 @@ export function AlertDialog(props: AlertDialogProps) {
8383
gap: "2",
8484
})}
8585
>
86-
<Button variant="secondary" onPress={close}>
86+
<Button onPress={close} variant="secondary">
8787
{cancelLabel || "Cancel"}
8888
</Button>
8989
<Button
90+
autoFocus
91+
onPress={chain(onAction, close)}
9092
variant={
9193
variantProps.variant === "destructive"
9294
? "destructive"
9395
: "primary"
9496
}
95-
autoFocus
96-
onPress={chain(onAction, close)}
9797
>
9898
{actionLabel}
9999
</Button>

apps/storybook/src/components/Breadcrumbs.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
2-
BreadcrumbProps,
3-
BreadcrumbsProps,
4-
LinkProps,
2+
type BreadcrumbProps,
3+
type BreadcrumbsProps,
4+
type LinkProps,
55
Breadcrumb as RACBreadcrumb,
66
Breadcrumbs as RACBreadcrumbs,
77
} from "react-aria-components";
@@ -19,26 +19,26 @@ export const Breadcrumbs = <T extends object>(props: BreadcrumbsProps<T>) => {
1919
};
2020

2121
export const Breadcrumb = (
22-
props: BreadcrumbProps & Omit<LinkProps, "className">
22+
props: BreadcrumbProps & Omit<LinkProps, "className">,
2323
) => {
2424
return (
2525
<RACBreadcrumb
2626
{...props}
2727
className={cx(
2828
props.className,
29-
css({ display: "flex", alignItems: "center", gap: "1" })
29+
css({ display: "flex", alignItems: "center", gap: "1" }),
3030
)}
3131
>
3232
<Link variant="secondary" {...props} />
3333
{props.href && (
3434
<Icon
35-
name="chevron-right"
3635
className={css({
3736
w: "3",
3837
h: "3",
3938
color: "gray.600",
4039
_dark: { color: "zinc.400" },
4140
})}
41+
name="chevron-right"
4242
/>
4343
)}
4444
</RACBreadcrumb>

apps/storybook/src/components/Button.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {
22
Button as RACButton,
33
type ButtonProps as RACButtonProps,
44
} from "react-aria-components";
5-
import { cva, cx, type RecipeVariantProps } from "../../styled-system/css";
5+
import { type RecipeVariantProps, cva, cx } from "../../styled-system/css";
66
import { focusRing } from "./focusRing";
77

88
const buttonRecipe = cva({
@@ -116,7 +116,7 @@ export const Button = (props: ButtonProps) => {
116116
const className = cx(
117117
buttonRecipe(variantProps),
118118
focusRing,
119-
localProps.className
119+
localProps.className,
120120
);
121121

122122
return <RACButton {...localProps} className={className} />;

apps/storybook/src/components/Calendar.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import {
44
CalendarGrid,
55
CalendarGridBody,
66
CalendarHeaderCell,
7-
DateValue,
7+
type DateValue,
88
Heading,
99
Calendar as RACCalendar,
1010
CalendarGridHeader as RACCalendarGridHeader,
11-
CalendarProps as RACCalendarProps,
11+
type CalendarProps as RACCalendarProps,
1212
Text,
1313
useLocale,
1414
} from "react-aria-components";
@@ -62,19 +62,19 @@ export const Calendar = <T extends DateValue>({
6262
<CalendarGridBody>
6363
{(date) => (
6464
<CalendarCell
65-
date={date}
6665
className={cx(calendarStyle, focusRing)}
66+
date={date}
6767
/>
6868
)}
6969
</CalendarGridBody>
7070
</CalendarGrid>
7171
{errorMessage && (
7272
<Text
73-
slot="errorMessage"
7473
className={css({
7574
fontSize: "sm",
7675
color: "red.600",
7776
})}
77+
slot="errorMessage"
7878
>
7979
{errorMessage}
8080
</Text>
@@ -84,7 +84,7 @@ export const Calendar = <T extends DateValue>({
8484
};
8585

8686
export const CalendarHeader = () => {
87-
let { direction } = useLocale();
87+
const { direction } = useLocale();
8888

8989
return (
9090
<header
@@ -98,7 +98,7 @@ export const CalendarHeader = () => {
9898
w: "full",
9999
})}
100100
>
101-
<Button variant="icon" slot="previous">
101+
<Button slot="previous" variant="icon">
102102
{direction === "rtl" ? (
103103
<ChevronRight aria-hidden />
104104
) : (
@@ -117,7 +117,7 @@ export const CalendarHeader = () => {
117117
_dark: { color: "zinc.200" },
118118
})}
119119
/>
120-
<Button variant="icon" slot="next">
120+
<Button slot="next" variant="icon">
121121
{direction === "rtl" ? (
122122
<ChevronLeft aria-hidden />
123123
) : (

apps/storybook/src/components/Checkbox.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { type ReactNode } from "react";
1+
import type { ReactNode } from "react";
22
import {
33
Checkbox as RACCheckbox,
44
CheckboxGroup as RACCheckboxGroup,
5-
ValidationResult,
65
type CheckboxGroupProps as RACCheckboxGroupProps,
76
type CheckboxProps as RACCheckboxProps,
7+
type ValidationResult,
88
} from "react-aria-components";
99
import { css, cx } from "../../styled-system/css";
1010
import { Description, FieldError, Label } from "./Field";
@@ -26,7 +26,7 @@ export function CheckboxGroup(props: CheckboxGroupProps) {
2626
{...props}
2727
className={cx(
2828
props.className,
29-
css({ display: "flex", flexDir: "column", gap: "2" })
29+
css({ display: "flex", flexDir: "column", gap: "2" }),
3030
)}
3131
>
3232
<Label>{props.label}</Label>
@@ -127,9 +127,9 @@ export const Checkbox = (props: CheckboxProps) => {
127127
<>
128128
<div className={cx(boxStyles, focusRing)}>
129129
{isIndeterminate ? (
130-
<Icon name="minus" className={iconStyles} />
130+
<Icon className={iconStyles} name="minus" />
131131
) : isSelected ? (
132-
<Icon name="check" className={iconStyles} />
132+
<Icon className={iconStyles} name="check" />
133133
) : null}
134134
</div>
135135
{props.children}

apps/storybook/src/components/ComboBox.tsx

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
import {
22
ListBox,
3-
ListBoxItemProps,
3+
type ListBoxItemProps,
44
ComboBox as RACComboBox,
5-
ValidationResult,
65
type ComboBoxProps as RACComboBoxProps,
6+
type ValidationResult,
77
} from "react-aria-components";
88
import { css, cx } from "../../styled-system/css";
99
import { Button } from "./Button";
1010
import { Description, FieldError, FieldGroup, Input, Label } from "./Field";
1111
import { Icon } from "./Icon";
12-
import { DropdownItem, DropdownSection, DropdownSectionProps } from "./ListBox";
12+
import {
13+
DropdownItem,
14+
DropdownSection,
15+
type DropdownSectionProps,
16+
} from "./ListBox";
1317
import { Popover } from "./Popover";
1418

1519
export interface ComboBoxProps<T extends object>
@@ -35,50 +39,50 @@ export const ComboBox = <T extends object>({
3539
{...props}
3640
className={cx(
3741
props.className,
38-
css({ display: "flex", flexDir: "column", gap: "1" })
42+
css({ display: "flex", flexDir: "column", gap: "1" }),
3943
)}
4044
>
4145
<Label>{label}</Label>
4246
<FieldGroup>
4347
<Input />
4448
<Button
45-
variant="icon"
4649
className={css({
4750
w: "6",
4851
mr: "1",
4952
borderRadius: "sm",
5053
outlineOffset: "0",
5154
})}
55+
variant="icon"
5256
>
53-
<Icon name="chevron-down" className={css({ w: "4", h: "4" })} />
57+
<Icon className={css({ w: "4", h: "4" })} name="chevron-down" />
5458
</Button>
5559
</FieldGroup>
5660
{description && <Description>{description}</Description>}
5761
<FieldError>{errorMessage}</FieldError>
5862
<Popover className={css({ w: "var(--trigger-width)" })}>
5963
<ListBox
60-
items={items}
6164
className={css({
6265
ringWidth: "0",
6366
p: "1",
6467
maxH: "inherit",
6568
overflow: "auto",
6669
clipPath: "inset(0 0 0 0 round .75rem)",
6770
})}
71+
items={items}
6872
>
6973
{children}
7074
</ListBox>
7175
</Popover>
7276
</RACComboBox>
7377
);
74-
}
78+
};
7579

7680
export const ComboBoxItem = (props: ListBoxItemProps) => {
7781
return <DropdownItem {...props} />;
7882
};
7983

8084
export const ComboBoxSection = <T extends object>(
81-
props: DropdownSectionProps<T>
85+
props: DropdownSectionProps<T>,
8286
) => {
8387
return <DropdownSection {...props} />;
8488
};

0 commit comments

Comments
 (0)