@motor-hero/ui-kit 0.34.0 → 0.34.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/date-picker.d.ts.map +1 -1
- package/dist/index.cjs +14 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +14 -14
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/date-picker.tsx +18 -17
package/package.json
CHANGED
|
@@ -91,25 +91,26 @@ const triggerInputClass =
|
|
|
91
91
|
const fieldInputClass =
|
|
92
92
|
"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
93
93
|
|
|
94
|
+
/** Botão "ghost" (sem borda, hover:bg-accent) — mesma variante que o shadcn usa nas
|
|
95
|
+
* setas de navegação do calendário; inline porque o ui-kit não tem um Button próprio. */
|
|
96
|
+
const navButtonClass =
|
|
97
|
+
"inline-flex size-(--cell-size) shrink-0 select-none items-center justify-center rounded-md p-0 transition-colors hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:opacity-50"
|
|
98
|
+
|
|
94
99
|
const calendarClassNames = {
|
|
95
|
-
months: "flex flex-col",
|
|
96
|
-
month: "flex flex-col gap-4",
|
|
97
|
-
month_caption: "flex
|
|
98
|
-
caption_label: "text-sm font-medium",
|
|
99
|
-
nav: "
|
|
100
|
-
button_previous:
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
"inline-flex size-7 items-center justify-center rounded-md border border-input bg-transparent p-0 opacity-50 hover:opacity-100",
|
|
104
|
-
month_grid: "w-full border-collapse space-y-1",
|
|
100
|
+
months: "relative flex flex-col gap-4",
|
|
101
|
+
month: "flex w-full flex-col gap-4",
|
|
102
|
+
month_caption: "flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)",
|
|
103
|
+
caption_label: "text-sm font-medium select-none",
|
|
104
|
+
nav: "absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",
|
|
105
|
+
button_previous: navButtonClass,
|
|
106
|
+
button_next: navButtonClass,
|
|
107
|
+
month_grid: "w-full border-collapse",
|
|
105
108
|
weekdays: "flex",
|
|
106
|
-
weekday: "
|
|
107
|
-
week: "flex w-full
|
|
108
|
-
day: "relative p-0 text-center
|
|
109
|
+
weekday: "flex-1 select-none rounded-md text-[0.8rem] font-normal text-muted-foreground",
|
|
110
|
+
week: "mt-2 flex w-full",
|
|
111
|
+
day: "relative aspect-square h-full w-full select-none p-0 text-center aria-selected:[&>button]:bg-primary aria-selected:[&>button]:text-primary-foreground aria-selected:[&>button]:hover:bg-primary",
|
|
109
112
|
day_button:
|
|
110
|
-
"inline-flex size-
|
|
111
|
-
selected:
|
|
112
|
-
"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground rounded-md [&>button]:bg-primary [&>button]:text-primary-foreground",
|
|
113
|
+
"inline-flex aspect-square size-auto w-full min-w-(--cell-size) items-center justify-center rounded-md p-0 font-normal transition-colors hover:bg-accent hover:text-accent-foreground",
|
|
113
114
|
today: "bg-accent text-accent-foreground rounded-md",
|
|
114
115
|
outside: "text-muted-foreground opacity-50",
|
|
115
116
|
disabled: "text-muted-foreground opacity-50 pointer-events-none",
|
|
@@ -264,7 +265,7 @@ function DatePickerImpl({
|
|
|
264
265
|
defaultMonth={(withTime ? pendingDate : committedDate) ?? new Date()}
|
|
265
266
|
onSelect={(date) => date && handleCalendarSelect(date)}
|
|
266
267
|
disabled={matchers}
|
|
267
|
-
className={withTime ? "p-0" : "p-3"}
|
|
268
|
+
className={cn(withTime ? "p-0" : "p-3", "[--cell-size:2rem]")}
|
|
268
269
|
classNames={calendarClassNames}
|
|
269
270
|
components={calendarComponents}
|
|
270
271
|
/>
|