To optimize the final bundle of my application, I add dependencies only to the components I use. Each time I create a color variant for my application, but when I use the DatePicker components, I don't apply the inputWrapper classes
// components/date-picker/index.tsx
"use client";
import { DatePicker as NextDatePicker } from "@nextui-org/date-picker";
import { extendVariants } from "@nextui-org/system";
export const DatePicker = extendVariants(NextDatePicker, {
variants: {
color: {
stone: {
inputWrapper: [
"bg-red-500", // <- i tried others classes
],
selectorButton: [
"bg-red-500", // <- this works
]
},
}
},
defaultVariants: {
color: "stone",
radius: "sm",
labelPlacement: "outside",
},
});
export * from "@nextui-org/date-picker";
Usage in my application:
// path/register-from.tsx
import { Input, DatePicker } from "#/components";
// ↑
// Yes, i add index.ts in this folder
<DatePicker
// @ts-ignore
maxValue={today(getLocalTimeZone())}
showMonthAndYearPickers
label="Birth date"
color="default"
isRequired
/>
NextUI Version
2.1.6
Describe the bug
To optimize the final bundle of my application, I add dependencies only to the components I use. Each time I create a color variant for my application, but when I use the
DatePicker
components, I don't apply theinputWrapper
classesUsage in my application:
Your Example Website or App
No response
Steps to Reproduce the Bug or Issue
Follow the docs after install
DatePicker
component.Create a
extendVariants
of theDatePicker
componentAdd custom classNames (try all and some of them work, it seems that only the
DateInput
component works)Use your custom component.
Expected behavior
I expected the color of the
inputWrapper
andselectorButton
to apply, but only the color of the selector appliesScreenshots or Videos
No response
Operating System Version
Linux
Browser
Chrome