Skip to content
This repository was archived by the owner on Dec 27, 2022. It is now read-only.
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
2 changes: 1 addition & 1 deletion emotion.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import type { SCWUITheme } from '@scaleway/ui'

declare module '@emotion/react' {
// https://emotion.sh/docs/typescript#define-a-theme
// eslint-disable-next-line @typescript-eslint/no-empty-interface
// eslint-disable-next-line @typescript-eslint/no-empty-interface, @typescript-eslint/consistent-type-definitions
export interface Theme extends SCWUITheme {}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
"@rollup/plugin-babel": "6.0.3",
"@rollup/plugin-node-resolve": "15.0.1",
"@rollup/plugin-url": "8.0.1",
"@scaleway/eslint-config-react": "3.10.5",
"@scaleway/eslint-config-react": "3.11.0",
"@scaleway/jest-helpers": "2.0.24",
"@semantic-release/changelog": "6.0.2",
"@semantic-release/commit-analyzer": "9.0.2",
Expand Down
18 changes: 9 additions & 9 deletions pnpm-lock.yaml

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

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Story } from '@storybook/react'
import type { Story } from '@storybook/react'
import { CheckboxField } from '..'
import { Form, FormProps } from '../../Form'
import type { FormProps } from '../../Form'
import { Form } from '../../Form'

export const BooleanChecked: Story<FormProps> = ({ errors }) => (
<Form onRawSubmit={() => {}} errors={errors} initialValues={{ foo: true }}>
Expand Down
4 changes: 2 additions & 2 deletions src/components/CheckboxField/__stories__/Checked.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Story } from '@storybook/react'
import type { Story } from '@storybook/react'
import { CheckboxField } from '..'
import { FormProps } from '../..'
import type { FormProps } from '../..'
import { Form } from '../../Form'

export const Checked: Story<FormProps> = ({ errors }) => (
Expand Down
4 changes: 2 additions & 2 deletions src/components/CheckboxField/__stories__/Required.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Stack } from '@scaleway/ui'
import { Story } from '@storybook/react'
import { ComponentProps } from 'react'
import type { Story } from '@storybook/react'
import type { ComponentProps } from 'react'
import { CheckboxField } from '..'
import { Submit } from '../../Submit'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ComponentStory } from '@storybook/react'
import type { ComponentStory } from '@storybook/react'
import { CheckboxField } from '..'

export const Template: ComponentStory<typeof CheckboxField> = args => (
Expand Down
2 changes: 1 addition & 1 deletion src/components/CheckboxField/__stories__/index.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Meta } from '@storybook/react'
import type { Meta } from '@storybook/react'
import { CheckboxField, Form } from '../..'
import { mockErrors } from '../../../mocks'

Expand Down
7 changes: 4 additions & 3 deletions src/components/CheckboxField/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Checkbox } from '@scaleway/ui'
import { FieldState } from 'final-form'
import { ComponentProps, ReactNode, Ref, forwardRef } from 'react'
import type { FieldState } from 'final-form'
import type { ComponentProps, ReactNode, Ref } from 'react'
import { forwardRef } from 'react'
import { useFormField } from '../../hooks'
import { useErrors } from '../../providers/ErrorContext'
import { BaseFieldProps } from '../../types'
import type { BaseFieldProps } from '../../types'

type CheckboxValue = string

Expand Down
4 changes: 2 additions & 2 deletions src/components/DateField/__stories__/MinMaxDate.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Stack } from '@scaleway/ui'
import { Story } from '@storybook/react'
import { ComponentProps } from 'react'
import type { Story } from '@storybook/react'
import type { ComponentProps } from 'react'
import { DateField } from '..'
import { Submit } from '../../Submit'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Stack } from '@scaleway/ui'
import { Story } from '@storybook/react'
import { ComponentProps } from 'react'
import type { Story } from '@storybook/react'
import type { ComponentProps } from 'react'
import { DateField } from '..'
import { Submit } from '../../Submit'
import { TimeField } from '../../TimeField'
Expand Down
4 changes: 2 additions & 2 deletions src/components/DateField/__stories__/Required.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Stack } from '@scaleway/ui'
import { Story } from '@storybook/react'
import { ComponentProps } from 'react'
import type { Story } from '@storybook/react'
import type { ComponentProps } from 'react'
import { DateField } from '..'
import { Submit } from '../../Submit'

Expand Down
4 changes: 2 additions & 2 deletions src/components/DateField/__stories__/Template.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Story } from '@storybook/react'
import { ComponentProps } from 'react'
import type { Story } from '@storybook/react'
import type { ComponentProps } from 'react'
import { DateField } from '..'

export const Template: Story<ComponentProps<typeof DateField>> = args => (
Expand Down
2 changes: 1 addition & 1 deletion src/components/DateField/__stories__/index.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled from '@emotion/styled'
import { Meta } from '@storybook/react'
import type { Meta } from '@storybook/react'
import { DateField, Form } from '../..'
import { mockErrors } from '../../../mocks'

Expand Down
6 changes: 3 additions & 3 deletions src/components/DateField/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { DateInput } from '@scaleway/ui'
import { FieldState } from 'final-form'
import { ComponentProps, FocusEvent } from 'react'
import type { FieldState } from 'final-form'
import type { ComponentProps, FocusEvent } from 'react'
import { useFormField } from '../../hooks'
import { useErrors } from '../../providers/ErrorContext'
import { BaseFieldProps } from '../../types'
import type { BaseFieldProps } from '../../types'

type DateFieldProps = BaseFieldProps<Date> &
Omit<
Expand Down
5 changes: 3 additions & 2 deletions src/components/Form/__stories__/Playground.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Checkbox, Stack } from '@scaleway/ui'
import { ComponentStory } from '@storybook/react'
import { ChangeEvent, useState } from 'react'
import type { ComponentStory } from '@storybook/react'
import type { ChangeEvent } from 'react'
import { useState } from 'react'
import {
CheckboxField,
Form,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Form/__stories__/index.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Meta } from '@storybook/react'
import type { Meta } from '@storybook/react'
import { Form } from '../..'

export default {
Expand Down
10 changes: 5 additions & 5 deletions src/components/Form/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { Decorator } from 'final-form'
import type { Decorator } from 'final-form'
import arrayMutators from 'final-form-arrays'
import createDecorator from 'final-form-focus'
import { ReactNode } from 'react'
import {
import type { ReactNode } from 'react'
import type {
FormRenderProps,
Form as ReactFinalForm,
FormProps as ReactFinalFormProps,
} from 'react-final-form'
import { Form as ReactFinalForm } from 'react-final-form'
import { ErrorProvider } from '../../providers'
import { FormErrors } from '../../types'
import type { FormErrors } from '../../types'

const focusOnErrors = createDecorator()

Expand Down
5 changes: 3 additions & 2 deletions src/components/RadioField/__stories__/Checked.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Story } from '@storybook/react'
import type { Story } from '@storybook/react'
import { RadioField } from '..'
import { Form, FormProps } from '../../Form'
import type { FormProps } from '../../Form'
import { Form } from '../../Form'

export const Checked: Story<FormProps> = ({ errors }) => (
<Form onRawSubmit={() => {}} errors={errors} initialValues={{ foo: 'bar' }}>
Expand Down
4 changes: 2 additions & 2 deletions src/components/RadioField/__stories__/Required.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Stack } from '@scaleway/ui'
import { Story } from '@storybook/react'
import { ComponentProps } from 'react'
import type { Story } from '@storybook/react'
import type { ComponentProps } from 'react'
import { RadioField } from '..'
import { Submit } from '../../Submit'

Expand Down
4 changes: 2 additions & 2 deletions src/components/RadioField/__stories__/Template.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Story } from '@storybook/react'
import { ComponentProps } from 'react'
import type { Story } from '@storybook/react'
import type { ComponentProps } from 'react'
import { RadioField } from '..'

export const Template: Story<ComponentProps<typeof RadioField>> = args => (
Expand Down
2 changes: 1 addition & 1 deletion src/components/RadioField/__stories__/index.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Meta } from '@storybook/react'
import type { Meta } from '@storybook/react'
import { Form, RadioField } from '../..'
import { mockErrors } from '../../../mocks'

Expand Down
6 changes: 3 additions & 3 deletions src/components/RadioField/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Radio } from '@scaleway/ui'
import { FieldState } from 'final-form'
import { ComponentProps, ReactNode } from 'react'
import type { FieldState } from 'final-form'
import type { ComponentProps, ReactNode } from 'react'
import { useFormField } from '../../hooks'
import { useErrors } from '../../providers/ErrorContext'
import { BaseFieldProps } from '../../types'
import type { BaseFieldProps } from '../../types'

type RadioValue = NonNullable<ComponentProps<typeof Radio>['value']>

Expand Down
5 changes: 3 additions & 2 deletions src/components/RichSelectField/__stories__/Groups.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Story } from '@storybook/react'
import { RichSelectField, RichSelectFieldProps } from '..'
import type { Story } from '@storybook/react'
import type { RichSelectFieldProps } from '..'
import { RichSelectField } from '..'

export const Groups: Story<RichSelectFieldProps> = () => (
<RichSelectField
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Story } from '@storybook/react'
import { RichSelectField, RichSelectFieldProps } from '..'
import type { Story } from '@storybook/react'
import type { RichSelectFieldProps } from '..'
import { RichSelectField } from '..'

export const Template: Story<RichSelectFieldProps> = args => (
<RichSelectField {...args}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled from '@emotion/styled'
import { Meta } from '@storybook/react'
import type { Meta } from '@storybook/react'
import { Form, RichSelectField } from '../..'
import { mockErrors } from '../../../mocks'

Expand Down
13 changes: 4 additions & 9 deletions src/components/RichSelectField/index.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
import { RichSelect } from '@scaleway/ui'
import { FieldState } from 'final-form'
import {
Children,
ComponentProps,
ReactElement,
useCallback,
useMemo,
} from 'react'
import type { FieldState } from 'final-form'
import type { ComponentProps, ReactElement } from 'react'
import { Children, useCallback, useMemo } from 'react'
import { useFormField } from '../../hooks'
import { useErrors } from '../../providers/ErrorContext'
import { BaseFieldProps } from '../../types'
import type { BaseFieldProps } from '../../types'

type RichSelectProps = ComponentProps<typeof RichSelect>
type RichSelectOptionProps = ComponentProps<typeof RichSelect.Option>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Stack } from '@scaleway/ui'
import { Story } from '@storybook/react'
import { ComponentProps } from 'react'
import type { Story } from '@storybook/react'
import type { ComponentProps } from 'react'
import { SelectNumberField } from '..'
import { Submit } from '../../Submit'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Story } from '@storybook/react'
import { ComponentProps } from 'react'
import type { Story } from '@storybook/react'
import type { ComponentProps } from 'react'
import { SelectNumberField } from '..'

export const Template: Story<
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Meta } from '@storybook/react'
import type { Meta } from '@storybook/react'
import { Form, SelectNumberField } from '../..'
import { mockErrors } from '../../../mocks/mockErrors'

Expand Down
4 changes: 2 additions & 2 deletions src/components/SelectNumberField/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { SelectNumber } from '@scaleway/ui'
import { ComponentProps, FocusEvent, FocusEventHandler } from 'react'
import type { ComponentProps, FocusEvent, FocusEventHandler } from 'react'
import { useFormField } from '../../hooks'
import { BaseFieldProps } from '../../types'
import type { BaseFieldProps } from '../../types'

type SelectNumberValue = NonNullable<
ComponentProps<typeof SelectNumber>['value']
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Stack } from '@scaleway/ui'
import { Story } from '@storybook/react'
import type { Story } from '@storybook/react'
import { SelectableCardField } from '..'
import { Form, FormProps } from '../../Form'
import type { FormProps } from '../../Form'
import { Form } from '../../Form'

export const Checked: Story<FormProps> = ({ errors }) => (
<Form onRawSubmit={() => {}} errors={errors} initialValues={{ foo: 'bar' }}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Stack } from '@scaleway/ui'
import { Story } from '@storybook/react'
import { ComponentProps } from 'react'
import type { Story } from '@storybook/react'
import type { ComponentProps } from 'react'
import { SelectableCardField } from '..'
import { Submit } from '../../Submit'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Story } from '@storybook/react'
import { ComponentProps } from 'react'
import type { Story } from '@storybook/react'
import type { ComponentProps } from 'react'
import { SelectableCardField } from '..'

export const Template: Story<
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Meta } from '@storybook/react'
import type { Meta } from '@storybook/react'
import { Form, SelectableCardField } from '../..'
import { mockErrors } from '../../../mocks'

Expand Down
Loading