Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

datePicker and dateTimePicker #58

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions components/kit/components/form/dateTimePicker/DatePicker.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from 'react';

export const DatePicker = () => {
return (
<label className="text-gray-700" htmlFor="date">
<input
className="border border-gray-300 w-full py-2 px-4 bg-white text-gray-700 rounded-lg text-base focus:outline-none focus:ring-2 focus:ring-purple-600 focus:border-transparent flex-1 dark:bg-gray-800 dark:text-white dark:border-none"
type="date"
/>
</label>
);
};
12 changes: 12 additions & 0 deletions components/kit/components/form/dateTimePicker/DateTimePicker.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from 'react';

export const DateTimePicker = () => {
return (
<label className="text-gray-700" htmlFor="datetime">
<input
className="border border-gray-300 w-full py-2 px-4 bg-white text-gray-700 rounded-lg text-base focus:outline-none focus:ring-2 focus:ring-purple-600 focus:border-transparent flex-1 dark:bg-gray-800 dark:text-white dark:border-none"
type="datetime-local"
/>
</label>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const TimePicker = () => {
return (
<label className="text-gray-700" htmlFor="time">
<input
className="appearance-none border border-gray-300 w-full py-2 px-4 bg-white text-gray-700 placeholder-gray-400 rounded-lg text-base focus:outline-none focus:ring-2 focus:ring-purple-600 focus:border-transparent flex-1"
className="appearance-none border border-gray-300 w-full py-2 px-4 bg-white text-gray-700 rounded-lg text-base focus:outline-none focus:ring-2 focus:ring-purple-600 focus:border-transparent flex-1"
type="time"
/>
</label>
Expand Down
9 changes: 9 additions & 0 deletions pages/components/inputtext/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import InputText from '../../../components/kit/components/form/inputtext/InputTe
import InputArea from '../../../components/kit/components/form/inputtext/InputArea';
import InputGroup from '../../../components/kit/components/form/inputtext/InputGroup';
import { TimePicker } from '../../../components/kit/components/form/dateTimePicker/TimePicker';
import { DatePicker } from '../../../components/kit/components/form/dateTimePicker/DatePicker';
import { DateTimePicker } from '../../../components/kit/components/form/dateTimePicker/DateTimePicker';

const InputTextPage: FC = () => {
return (
Expand Down Expand Up @@ -103,6 +105,13 @@ const InputTextPage: FC = () => {
<ComponentLayout title="Group" element={<InputGroup />} component={InputText} />
<ComponentLayout title="textarea" element={<InputArea />} component={InputArea} />
<ComponentLayout title="Time Picker" element={<TimePicker />} component={TimePicker} />
<ComponentLayout title="Date Picker" element={<DatePicker />} component={DatePicker} showSwitchMode />
<ComponentLayout
title="DateTime Picker"
element={<DateTimePicker />}
component={DateTimePicker}
showSwitchMode
/>
</AppLayout>
);
};
Expand Down