From 698d555c68340522d8a25800364dde9ae0da5ade Mon Sep 17 00:00:00 2001 From: lisa Date: Thu, 2 Jan 2025 15:35:05 +0100 Subject: [PATCH 1/2] feat: timeInputV2 --- .changeset/funny-gifts-shave.md | 5 + .../__stories__/Controlled.stories.tsx | 54 + .../__stories__/Disabled.stories.tsx | 7 + .../TimeInputV2/__stories__/Error.stories.tsx | 13 + .../__stories__/Placeholder.stories.tsx | 18 + .../__stories__/Playground.stories.tsx | 8 + .../__stories__/ReadOnly.stories.tsx | 7 + .../__stories__/Required.stories.tsx | 14 + .../TimeInputV2/__stories__/Size.stories.tsx | 11 + .../__stories__/Template.stories.tsx | 6 + .../__stories__/TimeFormat.stories.tsx | 35 + .../TimeInputV2/__stories__/index.stories.tsx | 22 + .../__snapshots__/index.test.tsx.snap | 5801 +++++++++++++++++ .../TimeInputV2/__tests__/helper.test.ts | 74 + .../TimeInputV2/__tests__/index.test.tsx | 231 + .../src/components/TimeInputV2/constants.ts | 12 + .../ui/src/components/TimeInputV2/helpers.ts | 67 + .../ui/src/components/TimeInputV2/index.tsx | 469 ++ packages/ui/src/components/index.ts | 1 + 19 files changed, 6855 insertions(+) create mode 100644 .changeset/funny-gifts-shave.md create mode 100644 packages/ui/src/components/TimeInputV2/__stories__/Controlled.stories.tsx create mode 100644 packages/ui/src/components/TimeInputV2/__stories__/Disabled.stories.tsx create mode 100644 packages/ui/src/components/TimeInputV2/__stories__/Error.stories.tsx create mode 100644 packages/ui/src/components/TimeInputV2/__stories__/Placeholder.stories.tsx create mode 100644 packages/ui/src/components/TimeInputV2/__stories__/Playground.stories.tsx create mode 100644 packages/ui/src/components/TimeInputV2/__stories__/ReadOnly.stories.tsx create mode 100644 packages/ui/src/components/TimeInputV2/__stories__/Required.stories.tsx create mode 100644 packages/ui/src/components/TimeInputV2/__stories__/Size.stories.tsx create mode 100644 packages/ui/src/components/TimeInputV2/__stories__/Template.stories.tsx create mode 100644 packages/ui/src/components/TimeInputV2/__stories__/TimeFormat.stories.tsx create mode 100644 packages/ui/src/components/TimeInputV2/__stories__/index.stories.tsx create mode 100644 packages/ui/src/components/TimeInputV2/__tests__/__snapshots__/index.test.tsx.snap create mode 100644 packages/ui/src/components/TimeInputV2/__tests__/helper.test.ts create mode 100644 packages/ui/src/components/TimeInputV2/__tests__/index.test.tsx create mode 100644 packages/ui/src/components/TimeInputV2/constants.ts create mode 100644 packages/ui/src/components/TimeInputV2/helpers.ts create mode 100644 packages/ui/src/components/TimeInputV2/index.tsx diff --git a/.changeset/funny-gifts-shave.md b/.changeset/funny-gifts-shave.md new file mode 100644 index 0000000000..fe430e8705 --- /dev/null +++ b/.changeset/funny-gifts-shave.md @@ -0,0 +1,5 @@ +--- +"@ultraviolet/ui": minor +--- + +New component `` diff --git a/packages/ui/src/components/TimeInputV2/__stories__/Controlled.stories.tsx b/packages/ui/src/components/TimeInputV2/__stories__/Controlled.stories.tsx new file mode 100644 index 0000000000..b6eba69cd4 --- /dev/null +++ b/packages/ui/src/components/TimeInputV2/__stories__/Controlled.stories.tsx @@ -0,0 +1,54 @@ +import type { StoryFn } from '@storybook/react' +import { useState } from 'react' +import { type Time, TimeInputV2 } from '..' +import { Button } from '../../Button' +import { Stack } from '../../Stack' + +export const Controlled: StoryFn = args => { + const [value24, setValue24] = useState