diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index bc73cd04..2a1e2305 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -27,6 +27,9 @@ jobs: - name: Patch run: yarn patch-package + - name: Lint + run: yarn lint + - name: Test run: yarn test:ci diff --git a/.storybook/preview.jsx b/.storybook/preview.jsx index 882ffe6f..d35f7267 100644 --- a/.storybook/preview.jsx +++ b/.storybook/preview.jsx @@ -22,12 +22,14 @@ export const parameters = { }, docs: { container: (context) => { + // eslint-disable-next-line react-hooks/rules-of-hooks const [isDark, setDark] = React.useState(); + // eslint-disable-next-line react-hooks/rules-of-hooks React.useEffect(() => { channel.on(DARK_MODE_EVENT_NAME, setDark); return () => channel.removeListener(DARK_MODE_EVENT_NAME, setDark); - }, [channel, setDark]); + }, [setDark]); const props = { ...context, diff --git a/components/AccessibleIcon/AccessibleIcon.stories.tsx b/components/AccessibleIcon/AccessibleIcon.stories.tsx index e400b257..db0d8b3e 100644 --- a/components/AccessibleIcon/AccessibleIcon.stories.tsx +++ b/components/AccessibleIcon/AccessibleIcon.stories.tsx @@ -1,9 +1,10 @@ -import React from 'react'; -import { Meta, StoryFn } from '@storybook/react'; -import { AccessibleIcon } from './AccessibleIcon'; import * as Icons from '@radix-ui/react-icons'; +import { Meta, StoryFn } from '@storybook/react'; +import React from 'react'; + import { Flex } from '../Flex'; import { IconButton } from '../IconButton'; +import { AccessibleIcon } from './AccessibleIcon'; const Component: Meta = { title: 'Components/AccessibleIcon', diff --git a/components/Accordion/Accordion.stories.tsx b/components/Accordion/Accordion.stories.tsx index d46984b6..96117d9b 100644 --- a/components/Accordion/Accordion.stories.tsx +++ b/components/Accordion/Accordion.stories.tsx @@ -1,15 +1,16 @@ +import { MagnifyingGlassIcon } from '@radix-ui/react-icons'; import { Meta, StoryFn } from '@storybook/react'; import React, { useState } from 'react'; -import { AccordionRoot, AccordionItem, AccordionTrigger, AccordionContent } from '.'; -import { modifyVariantsForStory } from '../../utils/modifyVariantsForStory'; + import { VariantProps } from '../../stitches.config'; -import { Dialog, DialogContent, DialogTrigger, DialogOverlay, DialogPortal } from '../Dialog'; +import { modifyVariantsForStory } from '../../utils/modifyVariantsForStory'; import { Badge } from '../Badge'; -import { Button } from '../Button'; -import { Text } from '../Text'; import { Box } from '../Box'; +import { Button } from '../Button'; +import { Dialog, DialogContent, DialogOverlay, DialogPortal, DialogTrigger } from '../Dialog'; import { Flex } from '../Flex'; -import { MagnifyingGlassIcon } from '@radix-ui/react-icons'; +import { Text } from '../Text'; +import { AccordionContent, AccordionItem, AccordionRoot, AccordionTrigger } from '.'; type AccordionVariants = VariantProps; @@ -119,6 +120,7 @@ Complex.argTypes = { }, }; +// eslint-disable-next-line @typescript-eslint/no-unused-vars const Customize: StoryFn = ({ size, ...args }) => ( diff --git a/components/Accordion/Accordion.themes.ts b/components/Accordion/Accordion.themes.ts index 81b54acd..a22097a5 100644 --- a/components/Accordion/Accordion.themes.ts +++ b/components/Accordion/Accordion.themes.ts @@ -1,7 +1,8 @@ import { Property } from '@stitches/react/types/css'; -import { ColorInfo } from '../../utils/getPrimaryColorInfo'; import tinycolor from 'tinycolor2'; +import { ColorInfo } from '../../utils/getPrimaryColorInfo'; + export namespace Theme { type Colors = { accordionBackground: Property.Color; diff --git a/components/Accordion/Accordion.tsx b/components/Accordion/Accordion.tsx index 7d3d3bdb..b7fa93d0 100644 --- a/components/Accordion/Accordion.tsx +++ b/components/Accordion/Accordion.tsx @@ -1,9 +1,10 @@ // @ts-nocheck -import React from 'react'; import * as AccordionPrimitive from '@radix-ui/react-accordion'; -import { keyframes, styled, VariantProps, CSS } from '../../stitches.config'; -import { elevationVariants } from '../Elevation'; import { ChevronRightIcon } from '@radix-ui/react-icons'; +import React from 'react'; + +import { CSS, keyframes, styled, VariantProps } from '../../stitches.config'; +import { elevationVariants } from '../Elevation'; const open = keyframes({ from: { height: 0 }, diff --git a/components/Alert/Alert.stories.tsx b/components/Alert/Alert.stories.tsx index 4127c289..5e86cb78 100644 --- a/components/Alert/Alert.stories.tsx +++ b/components/Alert/Alert.stories.tsx @@ -1,9 +1,10 @@ -import React from 'react'; import { Meta, StoryFn } from '@storybook/react'; -import { Text } from '../Text'; +import React from 'react'; + +import { modifyVariantsForStory } from '../../utils/modifyVariantsForStory'; import { H2 } from '../Heading'; +import { Text } from '../Text'; import { Alert, AlertProps, AlertVariants } from './Alert'; -import { modifyVariantsForStory } from '../../utils/modifyVariantsForStory'; const BaseAlert = (props: AlertProps): JSX.Element => ; const AlertForStory = modifyVariantsForStory(BaseAlert); @@ -38,6 +39,7 @@ Variants.argTypes = { }, }; +// eslint-disable-next-line @typescript-eslint/no-unused-vars const Customize: StoryFn = (args) => (

Alert

diff --git a/components/Alert/Alert.tsx b/components/Alert/Alert.tsx index 13b5a1dd..fcf4fa60 100644 --- a/components/Alert/Alert.tsx +++ b/components/Alert/Alert.tsx @@ -37,4 +37,4 @@ export const Alert = styled(Card, { }); export type AlertVariants = VariantProps; -export type AlertProps = AlertVariants & {}; +export type AlertProps = AlertVariants & NonNullable; diff --git a/components/AriaTable/AriaTable.stories.tsx b/components/AriaTable/AriaTable.stories.tsx index bcca4f33..e999c406 100644 --- a/components/AriaTable/AriaTable.stories.tsx +++ b/components/AriaTable/AriaTable.stories.tsx @@ -1,24 +1,25 @@ import { Meta, StoryFn } from '@storybook/react'; import React, { useCallback, useState } from 'react'; + +import { modifyVariantsForStory } from '../../utils/modifyVariantsForStory'; +import { Badge } from '../Badge'; +import { Button } from '../Button'; +import { Flex } from '../Flex'; +import { Image } from '../Image'; +import { UnstyledLink } from '../Link'; +import { Text } from '../Text'; import { + Caption, Table, TableProps, TableVariants, Tbody, Td, + Tfoot, Th, Thead, Tr, - Caption, - Tfoot, } from './AriaTable'; -import { Badge } from '../Badge'; -import { Button } from '../Button'; -import { Flex } from '../Flex'; -import { UnstyledLink } from '../Link'; -import { modifyVariantsForStory } from '../../utils/modifyVariantsForStory'; -import { Image } from '../Image'; -import { Text } from '../Text'; const BaseTable = (props: TableProps): JSX.Element => ; const TableForStory = modifyVariantsForStory(BaseTable); @@ -281,6 +282,7 @@ export const Links: StoryFn = (args) => (
); +// eslint-disable-next-line @typescript-eslint/no-unused-vars const Customize: StoryFn = (args) => ( ( ); -export const VerticalAlignment: StoryFn = (args) => ( +export const VerticalAlignment: StoryFn = () => ( diff --git a/components/AriaTable/AriaTable.test.tsx b/components/AriaTable/AriaTable.test.tsx index fa7079f4..2f4761c7 100644 --- a/components/AriaTable/AriaTable.test.tsx +++ b/components/AriaTable/AriaTable.test.tsx @@ -1,17 +1,7 @@ -import { - Table, - TableProps, - TableVariants, - Tbody, - Td, - Th, - Thead, - Tr, - Caption, - Tfoot, -} from './AriaTable'; -import { axe } from 'jest-axe'; import { render } from '@testing-library/react'; +import { axe } from 'jest-axe'; + +import { Table, Tbody, Td, Tfoot, Th, Thead, Tr } from './AriaTable'; describe('AriaTable', () => { it('should render table with no a11y issue', async () => { diff --git a/components/AriaTable/AriaTable.tsx b/components/AriaTable/AriaTable.tsx index 670c424f..a50e0822 100644 --- a/components/AriaTable/AriaTable.tsx +++ b/components/AriaTable/AriaTable.tsx @@ -1,29 +1,30 @@ +import { ChevronRightIcon } from '@radix-ui/react-icons'; +import { Slot } from '@radix-ui/react-slot'; +import merge from 'lodash.merge'; import React, { + Children, + cloneElement, ComponentProps, ElementRef, forwardRef, - useMemo, - Children, isValidElement, - useState, ReactNode, - cloneElement, + useMemo, + useState, } from 'react'; -import { Slot } from '@radix-ui/react-slot'; -import { styled, VariantProps, CSS } from '../../stitches.config'; + +import { styled, VariantProps } from '../../stitches.config'; +import { Box } from '../Box'; import { Caption as TableCaption, + StyledTr as TableTr, + Table as TableTable, Tbody as TableTbody, + Td as TableTd, Tfoot as TableTfoot, - StyledTr as TableTr, Th as TableTh, - Td as TableTd, Thead as TableThead, - Table as TableTable, } from '../Table'; -import merge from 'lodash.merge'; -import { Box } from '../Box'; -import { ChevronRightIcon } from '@radix-ui/react-icons'; export const Caption = styled('div', TableCaption, { display: 'table-caption', @@ -130,7 +131,7 @@ export const Tr = forwardRef, TrProps>( ) : ( ) - ) : !!collapsedContent ? ( + ) : collapsedContent ? ( { @@ -149,6 +150,7 @@ export const Tr = forwardRef, TrProps>( ) : null, + // eslint-disable-next-line react-hooks/exhaustive-deps [isCollapsed] ); @@ -161,7 +163,7 @@ export const Tr = forwardRef, TrProps>( ...children?.props, }, // @ts-ignore: Object is possibly 'null'. - [TdEl, ...children?.props?.children] + [TdEl, ...(children?.props?.children || [])] ); } @@ -252,7 +254,7 @@ const StyledThead = styled('div', TableThead, { }); export const Thead = forwardRef< ElementRef, - ComponentProps & VariantProps & {} + ComponentProps & VariantProps & NonNullable >((props, ref) => ); const StyledTable = styled('div', TableTable, { @@ -272,4 +274,4 @@ export const Table = forwardRef< )); export type TableVariants = VariantProps; -export type TableProps = TableVariants & {}; +export type TableProps = TableVariants & NonNullable; diff --git a/components/Avatar/Avatar.stories.tsx b/components/Avatar/Avatar.stories.tsx index 7ceabe0f..9740124a 100644 --- a/components/Avatar/Avatar.stories.tsx +++ b/components/Avatar/Avatar.stories.tsx @@ -1,5 +1,6 @@ -import React from 'react'; import { Meta, StoryFn } from '@storybook/react'; +import React from 'react'; + import { Avatar } from './Avatar'; const Component: Meta = { @@ -90,6 +91,8 @@ Variants.argTypes = { options: ['gray', 'red', 'purple', 'blue', 'green', 'orange'], }, }; + +// eslint-disable-next-line @typescript-eslint/no-unused-vars const Customize: StoryFn = (args) => ; export default Component; diff --git a/components/Avatar/Avatar.tsx b/components/Avatar/Avatar.tsx index 5198408d..471aecf6 100644 --- a/components/Avatar/Avatar.tsx +++ b/components/Avatar/Avatar.tsx @@ -1,6 +1,7 @@ -import React from 'react'; -import { styled, VariantProps, CSS } from '../../stitches.config'; import * as AvatarPrimitive from '@radix-ui/react-avatar'; +import React from 'react'; + +import { CSS, styled, VariantProps } from '../../stitches.config'; import { Box } from '../Box'; const StyledAvatar = styled(AvatarPrimitive.Root, { diff --git a/components/Badge/Badge.stories.tsx b/components/Badge/Badge.stories.tsx index d91a83e7..0727e523 100644 --- a/components/Badge/Badge.stories.tsx +++ b/components/Badge/Badge.stories.tsx @@ -1,13 +1,14 @@ import { Meta, StoryFn } from '@storybook/react'; import React from 'react'; + import { VariantProps } from '../../stitches.config'; -import { Badge, COLORS } from './Badge'; -import { Flex } from '../Flex'; import { modifyVariantsForStory } from '../../utils/modifyVariantsForStory'; +import { Flex } from '../Flex'; import { UnstyledLink } from '../Link'; +import { Badge, COLORS } from './Badge'; type BadgeVariants = VariantProps; -type BadgeProps = BadgeVariants & {}; +type BadgeProps = BadgeVariants & NonNullable; const BaseBadge = (props: BadgeProps): JSX.Element => ; const BadgeForStory = modifyVariantsForStory(BaseBadge); @@ -82,6 +83,7 @@ Interactive.args = { borderless: false, }; +// eslint-disable-next-line @typescript-eslint/no-unused-vars const Customize: StoryFn = (args) => ( Customize diff --git a/components/Badge/Badge.test.tsx b/components/Badge/Badge.test.tsx index e4cc5314..7f374fba 100644 --- a/components/Badge/Badge.test.tsx +++ b/components/Badge/Badge.test.tsx @@ -1,7 +1,8 @@ -import { Badge } from './Badge'; -import { UnstyledLink } from '../Link'; import { render } from '@testing-library/react'; +import { UnstyledLink } from '../Link'; +import { Badge } from './Badge'; + describe('Badge', () => { it('should render Badge as link', () => { const { getByRole } = render( diff --git a/components/Badge/Badge.themes.ts b/components/Badge/Badge.themes.ts index 9296fcd5..0e69de38 100644 --- a/components/Badge/Badge.themes.ts +++ b/components/Badge/Badge.themes.ts @@ -1,5 +1,6 @@ import { Property } from '@stitches/react/types/css'; import tinycolor from 'tinycolor2'; + import { ColorInfo } from '../../utils/getPrimaryColorInfo'; export namespace Theme { diff --git a/components/Badge/Badge.tsx b/components/Badge/Badge.tsx index b860d291..20f64470 100644 --- a/components/Badge/Badge.tsx +++ b/components/Badge/Badge.tsx @@ -1,9 +1,10 @@ +import { Slot } from '@radix-ui/react-slot'; import React, { ComponentProps, useMemo } from 'react'; + import { styled, VariantProps } from '../../stitches.config'; -import { Slot } from '@radix-ui/react-slot'; export const COLORS = ['gray', 'red', 'blue', 'green', 'neon', 'orange', 'purple'] as const; -type COLOR_VALUES = typeof COLORS[number]; +type COLOR_VALUES = (typeof COLORS)[number]; const getColorBadgeStyles = (color: COLOR_VALUES) => ({ bc: `$${color}6`, @@ -146,6 +147,7 @@ export const Badge = React.forwardRef return asChild ? StyledButtonBadgeSlot : StyledButtonBadge; } return asChild ? StyledSpanBadgeSlot : StyledSpanBadge; + // eslint-disable-next-line react-hooks/exhaustive-deps }, [asChild]); return ; diff --git a/components/Box/Box.stories.tsx b/components/Box/Box.stories.tsx index 30952fb5..2e45c89d 100644 --- a/components/Box/Box.stories.tsx +++ b/components/Box/Box.stories.tsx @@ -1,13 +1,13 @@ +import { Meta, StoryFn } from '@storybook/react'; import React from 'react'; -import { StoryFn, Meta } from '@storybook/react'; -import { VariantProps } from '../../stitches.config'; +import { VariantProps } from '../../stitches.config'; import { modifyVariantsForStory } from '../../utils/modifyVariantsForStory'; -import { Box } from './Box'; import { Text } from '../Text'; +import { Box } from './Box'; type BoxVariants = VariantProps; -type BoxProps = BoxVariants & {}; +type BoxProps = BoxVariants & NonNullable; const BaseBox = (props: BoxProps): JSX.Element => ; const BoxForStory = modifyVariantsForStory>( diff --git a/components/Bubble/Bubble.stories.tsx b/components/Bubble/Bubble.stories.tsx index 79f7b70c..7ead7261 100644 --- a/components/Bubble/Bubble.stories.tsx +++ b/components/Bubble/Bubble.stories.tsx @@ -1,12 +1,13 @@ -import React from 'react'; import { Meta, StoryFn } from '@storybook/react'; +import React from 'react'; + import { VariantProps } from '../../stitches.config'; -import { Bubble } from './Bubble'; -import { Flex } from '../Flex'; import { modifyVariantsForStory } from '../../utils/modifyVariantsForStory'; +import { Flex } from '../Flex'; +import { Bubble } from './Bubble'; type BubbleVariants = VariantProps; -type BubbleProps = BubbleVariants & {}; +type BubbleProps = BubbleVariants & NonNullable; const BaseBubble = (props: BubbleProps): JSX.Element => ; const BubbleForStory = modifyVariantsForStory(BaseBubble); @@ -64,6 +65,7 @@ Sizes.argTypes = { }, }; +// eslint-disable-next-line @typescript-eslint/no-unused-vars const Customize: StoryFn = (args) => ( ); diff --git a/components/Bubble/Bubble.tsx b/components/Bubble/Bubble.tsx index 9ba27a03..3287fb11 100644 --- a/components/Bubble/Bubble.tsx +++ b/components/Bubble/Bubble.tsx @@ -1,4 +1,4 @@ -import { keyframes, styled, config } from '../../stitches.config'; +import { keyframes, styled } from '../../stitches.config'; const bip = keyframes({ '0%': { diff --git a/components/Button/Button.stories.tsx b/components/Button/Button.stories.tsx index a9f10244..19606b57 100644 --- a/components/Button/Button.stories.tsx +++ b/components/Button/Button.stories.tsx @@ -1,11 +1,11 @@ +import { InfoCircledIcon } from '@radix-ui/react-icons'; +import { Meta, StoryFn } from '@storybook/react'; import React from 'react'; -import { StoryFn, Meta } from '@storybook/react'; -import { ButtonForStory } from './Button'; import { Flex } from '../Flex'; -import { Text } from '../Text'; -import { InfoCircledIcon } from '@radix-ui/react-icons'; import { UnstyledLink } from '../Link'; +import { Text } from '../Text'; +import { ButtonForStory } from './Button'; const Component: Meta = { title: 'Components/Button', @@ -57,6 +57,7 @@ const TemplateWithIcon: StoryFn = (args) => ( export const WithIcon: StoryFn = TemplateWithIcon.bind({}); +// eslint-disable-next-line @typescript-eslint/no-unused-vars const TemplateWithActive: StoryFn = ({ state, ...args }) => { const [active, setActive] = React.useState(0); @@ -88,6 +89,7 @@ Waiting.args = { state: 'waiting', }; +// eslint-disable-next-line @typescript-eslint/no-unused-vars const Customize: StoryFn = (args) => ( Button diff --git a/components/Button/Button.test.tsx b/components/Button/Button.test.tsx index f52f58fb..2a1c84b3 100644 --- a/components/Button/Button.test.tsx +++ b/components/Button/Button.test.tsx @@ -1,7 +1,8 @@ -import { Button } from './Button'; -import { UnstyledLink } from '../Link'; import { render } from '@testing-library/react'; +import { UnstyledLink } from '../Link'; +import { Button } from './Button'; + describe('Button', () => { it('should render Button as link', () => { const { getByRole } = render( diff --git a/components/Button/Button.themes.ts b/components/Button/Button.themes.ts index 70373272..19b0b6a7 100644 --- a/components/Button/Button.themes.ts +++ b/components/Button/Button.themes.ts @@ -1,5 +1,6 @@ import { Property } from '@stitches/react/types/css'; import tinycolor from 'tinycolor2'; + import { ColorInfo } from '../../utils/getPrimaryColorInfo'; export namespace Theme { diff --git a/components/Button/Button.tsx b/components/Button/Button.tsx index 3a252001..33e40bce 100644 --- a/components/Button/Button.tsx +++ b/components/Button/Button.tsx @@ -1,7 +1,8 @@ +import { Slot } from '@radix-ui/react-slot'; import React, { ComponentProps, useMemo } from 'react'; -import { styled, keyframes, CSS, VariantProps } from '../../stitches.config'; + +import { CSS, keyframes, styled, VariantProps } from '../../stitches.config'; import { modifyVariantsForStory } from '../../utils/modifyVariantsForStory'; -import { Slot } from '@radix-ui/react-slot'; export const BUTTON_BASE_STYLES = { appearance: 'none', diff --git a/components/ButtonSwitch/ButtonSwitch.stories.tsx b/components/ButtonSwitch/ButtonSwitch.stories.tsx index 1d19d433..09c7c69b 100644 --- a/components/ButtonSwitch/ButtonSwitch.stories.tsx +++ b/components/ButtonSwitch/ButtonSwitch.stories.tsx @@ -1,8 +1,9 @@ -import React from 'react'; import { Meta, StoryFn } from '@storybook/react'; -import { ButtonSwitchContainer, ButtonSwitchItem } from './ButtonSwitch'; +import React from 'react'; import { useState } from 'react'; +import { ButtonSwitchContainer, ButtonSwitchItem } from './ButtonSwitch'; + const Component: Meta = { title: 'Components/ButtonSwitch', component: ButtonSwitchContainer, diff --git a/components/ButtonSwitch/ButtonSwitch.themes.ts b/components/ButtonSwitch/ButtonSwitch.themes.ts index 125a6552..7cf8b2ff 100644 --- a/components/ButtonSwitch/ButtonSwitch.themes.ts +++ b/components/ButtonSwitch/ButtonSwitch.themes.ts @@ -1,4 +1,5 @@ import { Property } from '@stitches/react/types/css'; + import { ColorInfo } from '../../utils/getPrimaryColorInfo'; export namespace Theme { diff --git a/components/ButtonSwitch/ButtonSwitch.tsx b/components/ButtonSwitch/ButtonSwitch.tsx index 2888101f..db4d141a 100644 --- a/components/ButtonSwitch/ButtonSwitch.tsx +++ b/components/ButtonSwitch/ButtonSwitch.tsx @@ -1,4 +1,5 @@ import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group'; + import { styled } from '../../stitches.config'; export const ButtonSwitchContainer = styled(ToggleGroupPrimitive.Root, { diff --git a/components/Card/Card.stories.tsx b/components/Card/Card.stories.tsx index 1807d20c..f7d48efb 100644 --- a/components/Card/Card.stories.tsx +++ b/components/Card/Card.stories.tsx @@ -1,9 +1,10 @@ -import React from 'react'; import { Meta, StoryFn } from '@storybook/react'; +import React from 'react'; + +import { Flex } from '../Flex'; +import { H2 } from '../Heading'; import { Text } from '../Text'; import { Card } from './Card'; -import { H2 } from '../Heading'; -import { Flex } from '../Flex'; const Component: Meta = { title: 'Components/Card', @@ -56,7 +57,7 @@ Inner.args = { variant: 'inner', }; -export const Elevation: StoryFn = (args) => ( +export const Elevation: StoryFn = () => (

No Elevation

@@ -123,6 +124,7 @@ export const Elevation: StoryFn = (args) => ( Elevation.args = {}; +// eslint-disable-next-line @typescript-eslint/no-unused-vars const Customize: StoryFn = (args) => ( ); diff --git a/components/Card/Card.themes.ts b/components/Card/Card.themes.ts index 48808789..35a82c1d 100644 --- a/components/Card/Card.themes.ts +++ b/components/Card/Card.themes.ts @@ -1,5 +1,6 @@ -import tinycolor from 'tinycolor2'; import { Property } from '@stitches/react/types/css'; +import tinycolor from 'tinycolor2'; + import { ColorInfo } from '../../utils/getPrimaryColorInfo'; export namespace Theme { diff --git a/components/Card/Card.tsx b/components/Card/Card.tsx index fca6795f..030bfca7 100644 --- a/components/Card/Card.tsx +++ b/components/Card/Card.tsx @@ -1,4 +1,5 @@ import React, { ComponentProps, ElementRef } from 'react'; + import { styled, VariantProps } from '../../stitches.config'; import { elevationVariants } from '../Elevation/Elevation'; diff --git a/components/Checkbox/Checkbox.stories.tsx b/components/Checkbox/Checkbox.stories.tsx index 64a40ad9..ce31ac34 100644 --- a/components/Checkbox/Checkbox.stories.tsx +++ b/components/Checkbox/Checkbox.stories.tsx @@ -1,5 +1,5 @@ +import { Meta, StoryFn } from '@storybook/react'; import React from 'react'; -import { StoryFn, Meta } from '@storybook/react'; import { modifyVariantsForStory } from '../../utils/modifyVariantsForStory'; import { Checkbox, CheckboxProps, CheckboxVariants } from './Checkbox'; @@ -36,6 +36,7 @@ Disabled.args = { size: 'large', }; +// eslint-disable-next-line @typescript-eslint/no-unused-vars const Customize: StoryFn = (args) => ( ); diff --git a/components/Checkbox/Checkbox.themes.ts b/components/Checkbox/Checkbox.themes.ts index 4f52ca38..9c403976 100644 --- a/components/Checkbox/Checkbox.themes.ts +++ b/components/Checkbox/Checkbox.themes.ts @@ -1,5 +1,6 @@ -import tinycolor from 'tinycolor2'; import { Property } from '@stitches/react/types/css'; +import tinycolor from 'tinycolor2'; + import { ColorInfo } from '../../utils/getPrimaryColorInfo'; export namespace Theme { diff --git a/components/Checkbox/Checkbox.tsx b/components/Checkbox/Checkbox.tsx index 1d39ee8f..79a1a4ba 100644 --- a/components/Checkbox/Checkbox.tsx +++ b/components/Checkbox/Checkbox.tsx @@ -1,7 +1,8 @@ -import React from 'react'; -import { styled, CSS, VariantProps } from '../../stitches.config'; import * as CheckboxPrimitive from '@radix-ui/react-checkbox'; import { CheckIcon } from '@radix-ui/react-icons'; +import React from 'react'; + +import { CSS, styled, VariantProps } from '../../stitches.config'; const StyledIndicator = styled(CheckboxPrimitive.Indicator, { alignItems: 'center', diff --git a/components/Container/Container.stories.tsx b/components/Container/Container.stories.tsx index e4593c13..ce0c793f 100644 --- a/components/Container/Container.stories.tsx +++ b/components/Container/Container.stories.tsx @@ -1,13 +1,13 @@ +import { Meta, StoryFn } from '@storybook/react'; import React from 'react'; -import { StoryFn, Meta } from '@storybook/react'; -import { VariantProps } from '../../stitches.config'; +import { VariantProps } from '../../stitches.config'; import { modifyVariantsForStory } from '../../utils/modifyVariantsForStory'; -import { Container } from './Container'; import { Paragraph } from '../Paragraph'; +import { Container } from './Container'; type ContainerVariants = VariantProps; -type ContainerProps = ContainerVariants & {}; +type ContainerProps = ContainerVariants & NonNullable; const BaseContainer = (props: ContainerProps): JSX.Element => ; const ContainerForStory = modifyVariantsForStory< diff --git a/components/Dialog/Dialog.stories.tsx b/components/Dialog/Dialog.stories.tsx index b21f11d2..abc180b4 100644 --- a/components/Dialog/Dialog.stories.tsx +++ b/components/Dialog/Dialog.stories.tsx @@ -1,17 +1,18 @@ -import React from 'react'; import { Meta, StoryFn } from '@storybook/react'; +import React from 'react'; +import { useState } from 'react'; + +import { Box } from '../Box'; +import { Button } from '../Button'; +import { Text } from '../Text'; import { Dialog, DialogContent, - DialogTrigger, - StyledContent, DialogOverlay, DialogPortal, + DialogTrigger, + StyledContent, } from './Dialog'; -import { Text } from '../Text'; -import { useState } from 'react'; -import { Button } from '../Button'; -import { Box } from '../Box'; const Component: Meta = { title: 'Components/Dialog', @@ -75,6 +76,7 @@ export const Basic: StoryFn = () => { ); }; +// eslint-disable-next-line @typescript-eslint/no-unused-vars const Customize: StoryFn = () => { const [open, setOpen] = useState(false); diff --git a/components/Dialog/Dialog.themes.ts b/components/Dialog/Dialog.themes.ts index 699d366b..b4338533 100644 --- a/components/Dialog/Dialog.themes.ts +++ b/components/Dialog/Dialog.themes.ts @@ -1,4 +1,5 @@ import { Property } from '@stitches/react/types/css'; + import { ColorInfo } from '../../utils/getPrimaryColorInfo'; export namespace Theme { diff --git a/components/Dialog/Dialog.tsx b/components/Dialog/Dialog.tsx index ed87528b..343846ee 100644 --- a/components/Dialog/Dialog.tsx +++ b/components/Dialog/Dialog.tsx @@ -1,11 +1,12 @@ -import React, { ComponentProps } from 'react'; -import { CSS, styled, VariantProps } from '../../stitches.config'; import * as DialogPrimitive from '@radix-ui/react-dialog'; import { Cross1Icon } from '@radix-ui/react-icons'; -import { overlayStyles } from '../Overlay'; -import { IconButton } from '../IconButton'; +import React, { ComponentProps } from 'react'; + +import { CSS, styled, VariantProps } from '../../stitches.config'; import { Card } from '../Card'; import { elevationVariants } from '../Elevation/Elevation'; +import { IconButton } from '../IconButton'; +import { overlayStyles } from '../Overlay'; type DialogProps = React.ComponentProps & { children: React.ReactNode; diff --git a/components/DropdownMenu/DropdownMenu.stories.tsx b/components/DropdownMenu/DropdownMenu.stories.tsx index bede9045..1c53f2f9 100644 --- a/components/DropdownMenu/DropdownMenu.stories.tsx +++ b/components/DropdownMenu/DropdownMenu.stories.tsx @@ -1,20 +1,20 @@ +import { Meta, StoryFn } from '@storybook/react'; import React from 'react'; -import { StoryFn, Meta } from '@storybook/react'; +import { Button } from '../Button'; import { DropdownMenu, - DropdownMenuTrigger, - DropdownMenuContent, - DropdownMenuItem, DropdownMenuCheckboxItem, - DropdownMenuRadioItem, + DropdownMenuContent, DropdownMenuGroup, - DropdownMenuRadioGroup, + DropdownMenuItem, DropdownMenuLabel, - DropdownMenuSeparator, DropdownMenuPortal, + DropdownMenuRadioGroup, + DropdownMenuRadioItem, + DropdownMenuSeparator, + DropdownMenuTrigger, } from './DropdownMenu'; -import { Button } from '../Button'; const Component: Meta = { title: 'Components/DropdownMenu', @@ -64,6 +64,7 @@ DefaultOpen.args = { defaultOpen: true, }; +// eslint-disable-next-line @typescript-eslint/no-unused-vars const Customize: StoryFn = (args) => ( diff --git a/components/DropdownMenu/DropdownMenu.tsx b/components/DropdownMenu/DropdownMenu.tsx index f0dc6f00..f134865c 100644 --- a/components/DropdownMenu/DropdownMenu.tsx +++ b/components/DropdownMenu/DropdownMenu.tsx @@ -1,10 +1,11 @@ -import React from 'react'; -import { CheckIcon } from '@radix-ui/react-icons'; -import { styled, CSS } from '../../stitches.config'; import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu'; -import { menuCss, separatorCss, itemCss, labelCss } from '../Menu'; +import { CheckIcon } from '@radix-ui/react-icons'; +import React from 'react'; + +import { CSS, styled } from '../../stitches.config'; import { Box } from '../Box'; import { Flex } from '../Flex'; +import { itemCss, labelCss, menuCss, separatorCss } from '../Menu'; import { panelStyles } from '../Panel'; export const DropdownMenu = DropdownMenuPrimitive.Root; diff --git a/components/Elevation/Elevation.stories.tsx b/components/Elevation/Elevation.stories.tsx index 952c58f5..4a9bfcdb 100644 --- a/components/Elevation/Elevation.stories.tsx +++ b/components/Elevation/Elevation.stories.tsx @@ -1,15 +1,16 @@ -import React from 'react'; import { Meta, StoryFn } from '@storybook/react'; -import { Elevation } from './Elevation'; +import React from 'react'; + import { Flex } from '../Flex'; import { Text } from '../Text'; +import { Elevation } from './Elevation'; const Component: Meta = { title: 'Components/Elevation', component: Elevation, }; -export const Basic: StoryFn = (args) => ( +export const Basic: StoryFn = () => ( = () => ( ); diff --git a/components/Elevation/Elevation.tsx b/components/Elevation/Elevation.tsx index 3cfc76de..a8656da8 100644 --- a/components/Elevation/Elevation.tsx +++ b/components/Elevation/Elevation.tsx @@ -1,4 +1,4 @@ -import { styled, CSS } from '../../stitches.config'; +import { CSS, styled } from '../../stitches.config'; type ElevationVariant = Record; diff --git a/components/FaencyProvider.tsx b/components/FaencyProvider.tsx index 1edf4649..65459af7 100644 --- a/components/FaencyProvider.tsx +++ b/components/FaencyProvider.tsx @@ -1,5 +1,5 @@ -import React from 'react'; import { Provider as TooltipProvider } from '@radix-ui/react-tooltip'; +import React from 'react'; interface FaencyProviderProps { children?: React.ReactNode; diff --git a/components/Flex/Flex.stories.tsx b/components/Flex/Flex.stories.tsx index 54cee373..fafea997 100644 --- a/components/Flex/Flex.stories.tsx +++ b/components/Flex/Flex.stories.tsx @@ -1,8 +1,8 @@ +import { Meta, StoryFn } from '@storybook/react'; import React from 'react'; -import { StoryFn, Meta } from '@storybook/react'; -import { Flex } from './Flex'; import { Box } from '../Box'; +import { Flex } from './Flex'; const Component: Meta = { title: 'Components/Flex', @@ -23,6 +23,7 @@ Basic.args = { gap: '6', }; +// eslint-disable-next-line @typescript-eslint/no-unused-vars const Customize: StoryFn = (args) => ; export default Component; diff --git a/components/Grid/Grid.stories.tsx b/components/Grid/Grid.stories.tsx index 032746d5..2bd13c78 100644 --- a/components/Grid/Grid.stories.tsx +++ b/components/Grid/Grid.stories.tsx @@ -1,9 +1,9 @@ +import { Meta, StoryFn } from '@storybook/react'; import React from 'react'; -import { StoryFn, Meta } from '@storybook/react'; -import { Grid } from './Grid'; import { Box } from '../Box'; import { Text } from '../Text'; +import { Grid } from './Grid'; const Component: Meta = { title: 'Components/Grid', @@ -41,6 +41,7 @@ Basic.args = { gap: '6', }; +// eslint-disable-next-line @typescript-eslint/no-unused-vars const Customize: StoryFn = (args) => ; export default Component; diff --git a/components/Heading/Heading.stories.tsx b/components/Heading/Heading.stories.tsx index cf8b26e0..c17eee31 100644 --- a/components/Heading/Heading.stories.tsx +++ b/components/Heading/Heading.stories.tsx @@ -1,5 +1,5 @@ +import { Meta, StoryFn } from '@storybook/react'; import React from 'react'; -import { StoryFn, Meta } from '@storybook/react'; import { Flex } from '../Flex'; import { H1, H2, H3, H4, H5, H6 } from './Heading'; @@ -45,6 +45,7 @@ export const Transform: StoryFn = (args) => ( ); +// eslint-disable-next-line @typescript-eslint/no-unused-vars const Customize: StoryFn = (args) => (

Heading level 1 SemiBold diff --git a/components/Heading/Heading.test.tsx b/components/Heading/Heading.test.tsx index a35ae704..0e8a6499 100644 --- a/components/Heading/Heading.test.tsx +++ b/components/Heading/Heading.test.tsx @@ -1,6 +1,7 @@ -import { H1, H2, H3, H4, H5, H6 } from './Heading'; import { render } from '@testing-library/react'; +import { H1, H2, H3, H4, H5, H6 } from './Heading'; + const HEADINGS = [H1, H2, H3, H4, H5, H6]; describe('Heading', () => { diff --git a/components/Heading/Heading.themes.ts b/components/Heading/Heading.themes.ts index 6a899c2f..365f78ef 100644 --- a/components/Heading/Heading.themes.ts +++ b/components/Heading/Heading.themes.ts @@ -1,5 +1,6 @@ import { Property } from '@stitches/react/types/css'; import tinycolor from 'tinycolor2'; + import { ColorInfo } from '../../utils/getPrimaryColorInfo'; export namespace Theme { diff --git a/components/IconButton/IconButton.stories.tsx b/components/IconButton/IconButton.stories.tsx index c6fee8af..1a8c46c2 100644 --- a/components/IconButton/IconButton.stories.tsx +++ b/components/IconButton/IconButton.stories.tsx @@ -1,8 +1,9 @@ -import React from 'react'; -import { Meta, StoryFn } from '@storybook/react'; -import { IconButton } from './IconButton'; import * as Icons from '@radix-ui/react-icons'; +import { Meta, StoryFn } from '@storybook/react'; +import React from 'react'; + import { Flex } from '../Flex'; +import { IconButton } from './IconButton'; const Component: Meta = { title: 'Components/IconButton', @@ -71,6 +72,7 @@ Variants.argTypes = { }, }; +// eslint-disable-next-line @typescript-eslint/no-unused-vars const Customize: StoryFn = (args) => ( ); diff --git a/components/IconButton/IconButton.themes.ts b/components/IconButton/IconButton.themes.ts index a48bea57..35122552 100644 --- a/components/IconButton/IconButton.themes.ts +++ b/components/IconButton/IconButton.themes.ts @@ -1,4 +1,5 @@ import { Property } from '@stitches/react/types/css'; + import { ColorInfo } from '../../utils/getPrimaryColorInfo'; export namespace Theme { diff --git a/components/Image/Image.stories.tsx b/components/Image/Image.stories.tsx index a9ca3058..c0e2f995 100644 --- a/components/Image/Image.stories.tsx +++ b/components/Image/Image.stories.tsx @@ -1,5 +1,5 @@ +import { Meta, StoryFn } from '@storybook/react'; import React from 'react'; -import { StoryFn, Meta } from '@storybook/react'; import { Image } from './Image'; @@ -22,6 +22,7 @@ Large.args = { src: 'https://picsum.photos/2000/3000', }; +// eslint-disable-next-line @typescript-eslint/no-unused-vars const Customize: StoryFn = (args) => ; export default Component; diff --git a/components/Input/Input.stories.tsx b/components/Input/Input.stories.tsx index 75a10fbf..dab39dd6 100644 --- a/components/Input/Input.stories.tsx +++ b/components/Input/Input.stories.tsx @@ -1,15 +1,14 @@ +import { EyeOpenIcon, MagnifyingGlassIcon } from '@radix-ui/react-icons'; +import { Meta, StoryFn } from '@storybook/react'; import React from 'react'; -import { StoryFn, Meta } from '@storybook/react'; + import { styled } from '../../stitches.config'; +import ignoreArgType from '../../utils/ignoreArgType'; import { modifyVariantsForStory } from '../../utils/modifyVariantsForStory'; - -import { Input, InputProps, InputVariants } from './Input'; import { Box } from '../Box'; import { Flex } from '../Flex'; import { Label } from '../Label'; - -import { MagnifyingGlassIcon, EyeOpenIcon } from '@radix-ui/react-icons'; -import ignoreArgType from '../../utils/ignoreArgType'; +import { Input, InputProps, InputVariants } from './Input'; const StyledEyeOpenIcon = styled(EyeOpenIcon, { '@hover': { @@ -90,6 +89,7 @@ const INPUT_TYPES = [ 'url', ]; +// eslint-disable-next-line @typescript-eslint/no-unused-vars export const Types: StoryFn = ({ type, ...args }) => ( {INPUT_TYPES.map((type) => ( @@ -248,6 +248,7 @@ export const Autofill: StoryFn = (args) => ( ); +// eslint-disable-next-line @typescript-eslint/no-unused-vars const Customize: StoryFn = ({ id, ...args }) => ( ); diff --git a/components/Input/Input.themes.ts b/components/Input/Input.themes.ts index 89c5c351..ebdbd5d1 100644 --- a/components/Input/Input.themes.ts +++ b/components/Input/Input.themes.ts @@ -1,5 +1,6 @@ import { Property } from '@stitches/react/types/css'; import tinycolor from 'tinycolor2'; + import { ColorInfo } from '../../utils/getPrimaryColorInfo'; export namespace Theme { diff --git a/components/Input/Input.tsx b/components/Input/Input.tsx index 4a43275f..2c376abf 100644 --- a/components/Input/Input.tsx +++ b/components/Input/Input.tsx @@ -1,5 +1,6 @@ import React from 'react'; -import { styled, CSS, VariantProps } from '../../stitches.config'; + +import { CSS, styled, VariantProps } from '../../stitches.config'; import { elevationVariants } from '../Elevation'; // CONSTANTS diff --git a/components/Label/Label.stories.tsx b/components/Label/Label.stories.tsx index a02697ea..88e538e2 100644 --- a/components/Label/Label.stories.tsx +++ b/components/Label/Label.stories.tsx @@ -1,14 +1,14 @@ +import { Meta, StoryFn } from '@storybook/react'; import React from 'react'; -import { StoryFn, Meta } from '@storybook/react'; -import { VariantProps } from '../../stitches.config'; +import { VariantProps } from '../../stitches.config'; +import ignoreArgType from '../../utils/ignoreArgType'; import { modifyVariantsForStory } from '../../utils/modifyVariantsForStory'; -import { Label } from './Label'; import { Box } from '../Box'; -import ignoreArgType from '../../utils/ignoreArgType'; +import { Label } from './Label'; type LabelVariants = VariantProps; -type LabelProps = LabelVariants & {}; +type LabelProps = LabelVariants & NonNullable; const BaseLabel = (props: LabelProps): JSX.Element =>