diff --git a/package/src/App.tsx b/package/src/App.tsx index d3abf5f0..ecb03c44 100644 --- a/package/src/App.tsx +++ b/package/src/App.tsx @@ -1,8 +1,8 @@ import LayoutDefault from './layout/Default' -import { Button, DateRange, Drawer, Form, Icon } from './library' +import { Form, DatePicker } from './library' import { zodResolver } from '@hookform/resolvers/zod' -import { Eraser, X } from '@phosphor-icons/react' +import { Eraser, Calendar as CalendarIcon } from '@phosphor-icons/react' import { useState } from 'react' import { SubmitHandler, useForm } from 'react-hook-form' import { z } from 'zod' @@ -13,6 +13,10 @@ const formSchema = z.object({ type FormSchemaProps = z.infer +type DateRange = { + from: Date | undefined + to?: Date | undefined +} function App() { const [test, setTest] = useState() const { @@ -43,8 +47,6 @@ function App() { } } - console.log(selectedDates) - return ( {/* ================================= TEST AREA ================================= */} - - - - - - - Title - - - - - - - -
Anything
-
- - - - - - -
-
+
+ } + mode="multiple" + options={{ + weekday: 'long', + year: 'numeric', + month: 'long', + day: 'numeric', + }} + /> +
{/* ================================= TEST AREA ================================= */}
diff --git a/package/src/library/DatePicker/index.tsx b/package/src/library/DatePicker/index.tsx index d3cb5662..abf9db2e 100644 --- a/package/src/library/DatePicker/index.tsx +++ b/package/src/library/DatePicker/index.tsx @@ -8,6 +8,8 @@ type DatePickerProps = CalendarProps & { placeholder?: string icon?: InputIconProps['icon'] options?: Intl.DateTimeFormatOptions + className?: string + align?: 'center' | 'start' | 'end' | undefined } export const formatDate = ( @@ -25,7 +27,8 @@ const DatePicker = ({ placeholder, icon, options, - + className, + align, ...rest }: DatePickerProps) => { const formatDates = (dates: Date[]) => { @@ -58,24 +61,22 @@ const DatePicker = ({ } return ( -
- - - - - - - - - - - -
+ + + + + + + + + + + ) } diff --git a/package/src/library/Popover/Content.tsx b/package/src/library/Popover/Content.tsx index 2f77c90b..b87cb466 100644 --- a/package/src/library/Popover/Content.tsx +++ b/package/src/library/Popover/Content.tsx @@ -3,20 +3,28 @@ import { cn } from '@/src/utils/class-merge.helper' import * as RadixPopover from '@radix-ui/react-popover' import { FC } from 'react' -export interface PopoverContentProps extends RadixPopover.PopoverContentProps {} +export interface PopoverContentProps extends RadixPopover.PopoverContentProps { + autoSize?: boolean +} -const PopoverContent: FC = ({ className, ...rest }) => { +const PopoverContent: FC = ({ + className, + autoSize, + ...rest +}) => { return ( ) } - PopoverContent.displayName = 'Popover.Content' - export default PopoverContent