-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/new-icons
- Loading branch information
Showing
42 changed files
with
10,019 additions
and
219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@ultraviolet/form": patch | ||
--- | ||
|
||
New component `<TimeInputFieldV2 />` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@ultraviolet/ui": minor | ||
--- | ||
|
||
New component `<TimeInputV2 />` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
'@ultraviolet/form': patch | ||
'@ultraviolet/icons': patch | ||
'@ultraviolet/plus': patch | ||
'@ultraviolet/ui': patch | ||
--- | ||
|
||
Updated dependency `@types/react` to `19.0.6`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@ultraviolet/ui": patch | ||
--- | ||
|
||
`<Slider />: when the component is disabled, the input is disabled too |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
packages/form/src/components/TimeInputFieldV2/__stories__/Playground.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { Template } from './Template.stories' | ||
|
||
export const Playground = Template.bind({}) | ||
|
||
Playground.args = Template.args |
17 changes: 17 additions & 0 deletions
17
packages/form/src/components/TimeInputFieldV2/__stories__/Required.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import type { StoryFn } from '@storybook/react' | ||
import { Stack } from '@ultraviolet/ui' | ||
import type { ComponentProps } from 'react' | ||
import { TimeInputFieldV2 } from '..' | ||
import { Submit } from '../../Submit' | ||
import { Template } from './Template.stories' | ||
|
||
export const Required: StoryFn< | ||
ComponentProps<typeof TimeInputFieldV2> | ||
> = args => ( | ||
<Stack gap={1}> | ||
<TimeInputFieldV2 {...args} /> | ||
<Submit>Submit</Submit> | ||
</Stack> | ||
) | ||
|
||
Required.args = { ...Template.args, required: true } |
19 changes: 19 additions & 0 deletions
19
packages/form/src/components/TimeInputFieldV2/__stories__/Template.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import type { StoryFn } from '@storybook/react' | ||
import { Stack } from '@ultraviolet/ui' | ||
import type { ComponentProps } from 'react' | ||
import { TimeInputFieldV2 } from '..' | ||
import { Submit } from '../..' | ||
|
||
export const Template: StoryFn< | ||
ComponentProps<typeof TimeInputFieldV2> | ||
> = args => ( | ||
<Stack gap="1"> | ||
<TimeInputFieldV2 {...args} /> | ||
<Submit>Submit</Submit> | ||
</Stack> | ||
) | ||
|
||
Template.args = { | ||
label: 'Label', | ||
name: 'example', | ||
} |
17 changes: 17 additions & 0 deletions
17
packages/form/src/components/TimeInputFieldV2/__stories__/TimeFormat.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import type { StoryFn } from '@storybook/react' | ||
import { Stack } from '@ultraviolet/ui' | ||
import type { ComponentProps } from 'react' | ||
import { TimeInputFieldV2 } from '..' | ||
import { Submit } from '../../Submit' | ||
import { Template } from './Template.stories' | ||
|
||
export const TimeFormat: StoryFn< | ||
ComponentProps<typeof TimeInputFieldV2> | ||
> = args => ( | ||
<Stack gap={1}> | ||
<TimeInputFieldV2 {...args} /> | ||
<Submit>Submit</Submit> | ||
</Stack> | ||
) | ||
|
||
TimeFormat.args = { ...Template.args, timeFormat: 12, label: '12-hour format' } |
72 changes: 72 additions & 0 deletions
72
packages/form/src/components/TimeInputFieldV2/__stories__/index.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import type { Meta } from '@storybook/react' | ||
import { Snippet, Stack, Text } from '@ultraviolet/ui' | ||
import { Form, TimeInputFieldV2 } from '../..' | ||
import { useForm } from '../../..' | ||
import { mockErrors } from '../../../mocks' | ||
|
||
export default { | ||
component: TimeInputFieldV2, | ||
decorators: [ | ||
ChildStory => { | ||
const methods = useForm() | ||
const { | ||
errors, | ||
isDirty, | ||
isSubmitting, | ||
touchedFields, | ||
submitCount, | ||
dirtyFields, | ||
isValid, | ||
isLoading, | ||
isSubmitted, | ||
isValidating, | ||
isSubmitSuccessful, | ||
} = methods.formState | ||
|
||
return ( | ||
<Form onSubmit={() => {}} errors={mockErrors} methods={methods}> | ||
<Stack gap={2}> | ||
<ChildStory /> | ||
<Stack gap={1}> | ||
<Text variant="bodyStrong" as="p"> | ||
Form input values: | ||
</Text> | ||
<Snippet prefix="lines" initiallyExpanded> | ||
{JSON.stringify(methods.watch(), null, 1)} | ||
</Snippet> | ||
</Stack> | ||
<Stack gap={1}> | ||
<Text variant="bodyStrong" as="p"> | ||
Form values: | ||
</Text> | ||
<Snippet prefix="lines"> | ||
{JSON.stringify( | ||
{ | ||
errors, | ||
isDirty, | ||
isSubmitting, | ||
touchedFields, | ||
submitCount, | ||
dirtyFields, | ||
isValid, | ||
isLoading, | ||
isSubmitted, | ||
isValidating, | ||
isSubmitSuccessful, | ||
}, | ||
null, | ||
1, | ||
)} | ||
</Snippet> | ||
</Stack> | ||
</Stack> | ||
</Form> | ||
) | ||
}, | ||
], | ||
title: 'Form/Components/Fields/TimeInputFieldV2', | ||
} as Meta | ||
|
||
export { Playground } from './Playground.stories' | ||
export { Required } from './Required.stories' | ||
export { TimeFormat } from './TimeFormat.stories' |
Oops, something went wrong.