Skip to content

Commit

Permalink
Merge branch 'main' into feat/new-icons
Browse files Browse the repository at this point in the history
  • Loading branch information
philibea authored Jan 16, 2025
2 parents 35d58a8 + d11059c commit fb3383e
Show file tree
Hide file tree
Showing 42 changed files with 10,019 additions and 219 deletions.
5 changes: 5 additions & 0 deletions .changeset/few-items-dream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ultraviolet/form": patch
---

New component `<TimeInputFieldV2 />`
5 changes: 5 additions & 0 deletions .changeset/funny-gifts-shave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ultraviolet/ui": minor
---

New component `<TimeInputV2 />`
8 changes: 8 additions & 0 deletions .changeset/renovate-7fe26da.md
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`.
5 changes: 5 additions & 0 deletions .changeset/weak-peas-marry.md
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
2 changes: 1 addition & 1 deletion examples/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"devDependencies": {
"@babel/core": "7.26.0",
"@types/node": "22.10.6",
"@types/react": "19.0.5",
"@types/react": "19.0.6",
"@types/react-syntax-highlighter": "15.5.13",
"next-transpile-modules": "10.0.1"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"devDependencies": {
"@emotion/babel-plugin": "11.13.5",
"@types/react": "19.0.5",
"@types/react": "19.0.6",
"@types/react-dom": "19.0.3",
"@vitejs/plugin-react": "4.3.4",
"typescript": "5.7.3",
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,16 +141,16 @@
"@testing-library/react": "16.1.0",
"@testing-library/user-event": "14.5.2",
"@types/node": "22.10.6",
"@types/react": "19.0.5",
"@types/react": "19.0.6",
"@types/react-datepicker": "6.2.0",
"@types/react-dom": "19.0.3",
"@types/zxcvbn": "4.4.5",
"@ultraviolet/fonts": "workspace:*",
"@ultraviolet/themes": "workspace:*",
"@ultraviolet/ui": "workspace:*",
"@vitejs/plugin-react": "4.3.4",
"@vitest/coverage-istanbul": "2.1.8",
"@vitest/ui": "2.1.8",
"@vitest/coverage-istanbul": "3.0.1",
"@vitest/ui": "3.0.1",
"babel-loader": "9.2.1",
"babel-plugin-annotate-pure-calls": "0.4.0",
"babel-plugin-named-exports-order": "0.0.2",
Expand All @@ -161,7 +161,7 @@
"emoji-toolkit": "9.0.1",
"esbuild-plugin-browserslist": "0.15.0",
"eslint": "9.17.0",
"eslint-plugin-oxlint": "0.15.5",
"eslint-plugin-oxlint": "0.15.6",
"eslint-plugin-testing-library": "7.1.1",
"expect": "29.7.0",
"file-loader": "6.2.0",
Expand All @@ -172,7 +172,7 @@
"identity-obj-proxy": "3.0.0",
"jest-axe": "9.0.0",
"lint-staged": "15.3.0",
"oxlint": "0.15.5",
"oxlint": "0.15.6",
"postcss": "8.4.49",
"publint": "0.3.2",
"react": "19.0.0",
Expand All @@ -192,7 +192,7 @@
"turbo": "2.3.3",
"typescript": "5.7.3",
"vite": "5.4.11",
"vitest": "2.1.8",
"vitest": "3.0.1",
"vitest-canvas-mock": "0.3.3",
"vitest-localstorage-mock": "0.1.2",
"zxcvbn": "4.4.2"
Expand Down
2 changes: 1 addition & 1 deletion packages/form/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"@emotion/react": "11.14.0",
"@emotion/styled": "11.14.0",
"@types/final-form-focus": "1.1.7",
"@types/react": "19.0.5",
"@types/react": "19.0.6",
"@types/react-dom": "19.0.3",
"@utils/test": "workspace:*",
"react": "19.0.0",
Expand Down
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
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 }
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',
}
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' }
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'
Loading

0 comments on commit fb3383e

Please sign in to comment.