diff --git a/.changeset/yellow-years-listen.md b/.changeset/yellow-years-listen.md new file mode 100644 index 000000000..ee2d31b14 --- /dev/null +++ b/.changeset/yellow-years-listen.md @@ -0,0 +1,5 @@ +--- +"@heroui/date-picker": patch +--- + +remove dateInputClassNames for date picker (#4495) diff --git a/apps/docs/content/docs/components/date-input.mdx b/apps/docs/content/docs/components/date-input.mdx index 65e42c000..b1a1eddd9 100644 --- a/apps/docs/content/docs/components/date-input.mdx +++ b/apps/docs/content/docs/components/date-input.mdx @@ -415,6 +415,12 @@ import {parseZonedDateTime} from "@internationalized/date"; type: "boolean", description: "Whether to disable animations.", default: "false" + }, + { + attribute: "classNames", + type: "Partial>", + description: "Allows to set custom class names for the date-input slots.", + default: "-" } ]} /> diff --git a/apps/docs/content/docs/components/date-picker.mdx b/apps/docs/content/docs/components/date-picker.mdx index b0a1a3161..592140062 100644 --- a/apps/docs/content/docs/components/date-picker.mdx +++ b/apps/docs/content/docs/components/date-picker.mdx @@ -488,7 +488,55 @@ import {I18nProvider} from "@react-aria/i18n"; type: "boolean", description: "Whether to always show leading zeros in the month, day, and hour fields.", default: "true" - } + }, + { + attribute: "CalendarBottomContent", + type: "ReactNode", + description: "Bottom content to be rendered in the calendar component.", + default: "-" + }, + { + attribute: "showMonthAndYearPickers", + type: "boolean | undefined", + description: "Whether the calendar should show month and year pickers.", + default: "false" + }, + { + attribute: "popoverProps", + type: "PopoverProps | undefined", + description: "Props to be passed to the popover component.", + default: `{ placement: "bottom", triggerScaleOnOpen: false, offset: 13 }` + }, + { + attribute: "selectorButtonProps", + type: "ButtonProps | undefined", + description: "Props to be passed to the selector button component.", + default: `{ size: "sm", variant: "light", radius: "full", isIconOnly: true }` + }, + { + attribute: "calendarProps", + type: "CalendarProps | undefined", + description: "Props to be passed to the calendar component.", + default: `{ size: "sm", variant: "light", radius: "full", isIconOnly: true }` + }, + { + attribute: "timeInputProps", + type: "TimeInputProps | undefined", + description: "Props to be passed to the time input component.", + default: `{ size: "sm", variant: "light", radius: "full", isIconOnly: true }` + }, + { + attribute: "disableAnimation", + type: "boolean", + description: "Whether to disable all animations in the date picker. Including the DateInput, Button, Calendar, and Popover.", + default: "false" + }, + { + attribute: "classNames", + type: `Partial>`, + description: "Allows to set custom class names for the date-picker slots. You can also pass Date Input classNames here.", + default: "-" + }, ]} /> diff --git a/apps/docs/content/docs/components/date-range-picker.mdx b/apps/docs/content/docs/components/date-range-picker.mdx index e181a9747..65a2cc77b 100644 --- a/apps/docs/content/docs/components/date-range-picker.mdx +++ b/apps/docs/content/docs/components/date-range-picker.mdx @@ -628,8 +628,8 @@ You can customize the `DateRangePicker` component by passing custom Tailwind CSS }, { attribute: "classNames", - type: "Partial>", - description: "Allows to set custom class names for the date-range-picker slots.", + type: "Partial>", + description: "Allows to set custom class names for the date-range-picker slots. You can also pass Date Input classNames here.", default: "-" } ]} diff --git a/packages/components/date-picker/__tests__/date-picker.test.tsx b/packages/components/date-picker/__tests__/date-picker.test.tsx index 8aea12353..cbe1f7c23 100644 --- a/packages/components/date-picker/__tests__/date-picker.test.tsx +++ b/packages/components/date-picker/__tests__/date-picker.test.tsx @@ -242,7 +242,7 @@ describe("DatePicker", () => { it("should apply custom dateInput classNames", function () { const {getByText} = render( classNames?: SlotsToClasses & DateInputProps["classNames"]; } -export type UseDatePickerProps = Props & - AriaDatePickerProps & { - /** - * Classname or List of classes to change the classNames of the date input element. - */ - dateInputClassNames?: DateInputProps["classNames"]; - }; +export type UseDatePickerProps = Props & AriaDatePickerProps; export function useDatePicker({ className, @@ -143,7 +137,7 @@ export function useDatePicker({ const getDateInputProps = () => { return { ...dateInputProps, - classNames: {...originalProps?.dateInputClassNames}, + classNames, groupProps, labelProps, createCalendar, diff --git a/packages/components/date-picker/src/use-date-range-picker.ts b/packages/components/date-picker/src/use-date-range-picker.ts index b44df7fb2..6ed5802a4 100644 --- a/packages/components/date-picker/src/use-date-range-picker.ts +++ b/packages/components/date-picker/src/use-date-range-picker.ts @@ -46,6 +46,8 @@ interface Props * separator: "separator-classes", * bottomContent: "bottom-content-classes", * timeInputWrapper: "time-input-wrapper-classes", + * timeInputLabel: "time-input-label-classes", + * timeInput: "time-input-classes", * helperWrapper: "helper-wrapper-classes", * description: "description-classes", * errorMessage: "error-message-classes", diff --git a/packages/components/date-picker/stories/date-picker.stories.tsx b/packages/components/date-picker/stories/date-picker.stories.tsx index af9e7537d..5c6439a0d 100644 --- a/packages/components/date-picker/stories/date-picker.stories.tsx +++ b/packages/components/date-picker/stories/date-picker.stories.tsx @@ -683,7 +683,7 @@ export const WithDateInputClassNames = { render: Template, args: { ...defaultProps, - dateInputClassNames: { + classNames: { base: "bg-gray-200 p-2 rounded-md", label: "text-blue-400 font-semibold", inputWrapper: "border-3 border-solid border-blue-400 p-2 rounded-md",