@ginia/ui 0.1.23 → 0.1.25
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/AGENTS.md +7 -4
- package/dist/components/ui/button/button.cjs +1 -1
- package/dist/components/ui/button/button.cjs.map +1 -1
- package/dist/components/ui/button/button.js +1 -1
- package/dist/components/ui/button/button.js.map +1 -1
- package/dist/components/ui/calendar/calendar.cjs +4 -2
- package/dist/components/ui/calendar/calendar.cjs.map +1 -1
- package/dist/components/ui/calendar/calendar.d.cts +1 -1
- package/dist/components/ui/calendar/calendar.d.ts +1 -1
- package/dist/components/ui/calendar/calendar.js +4 -2
- package/dist/components/ui/calendar/calendar.js.map +1 -1
- package/dist/components/ui/date-picker/date-picker.cjs +173 -51
- package/dist/components/ui/date-picker/date-picker.cjs.map +1 -1
- package/dist/components/ui/date-picker/date-picker.d.cts +11 -1
- package/dist/components/ui/date-picker/date-picker.d.ts +11 -1
- package/dist/components/ui/date-picker/date-picker.js +180 -53
- package/dist/components/ui/date-picker/date-picker.js.map +1 -1
- package/dist/components/ui/date-picker/index.d.cts +1 -0
- package/dist/components/ui/date-picker/index.d.ts +1 -0
- package/dist/components/ui/index.cjs +2 -2
- package/dist/components/ui/index.cjs.map +1 -1
- package/dist/components/ui/index.d.cts +2 -1
- package/dist/components/ui/index.d.ts +2 -1
- package/dist/components/ui/index.js +1 -1
- package/dist/components/ui/index.js.map +1 -1
- package/dist/components/ui/{ginia-wordmark → wordmark}/index.cjs +7 -7
- package/dist/components/ui/wordmark/index.cjs.map +1 -0
- package/dist/components/ui/{ginia-wordmark → wordmark}/index.d.cts +1 -1
- package/dist/components/ui/{ginia-wordmark → wordmark}/index.d.ts +1 -1
- package/dist/components/ui/wordmark/index.js +6 -0
- package/dist/components/ui/wordmark/index.js.map +1 -0
- package/dist/components/ui/{ginia-wordmark/ginia-wordmark.cjs → wordmark/wordmark.cjs} +14 -12
- package/dist/components/ui/wordmark/wordmark.cjs.map +1 -0
- package/dist/components/ui/{ginia-wordmark/ginia-wordmark.d.cts → wordmark/wordmark.d.cts} +10 -5
- package/dist/components/ui/{ginia-wordmark/ginia-wordmark.d.ts → wordmark/wordmark.d.ts} +10 -5
- package/dist/components/ui/{ginia-wordmark/ginia-wordmark.js → wordmark/wordmark.js} +10 -8
- package/dist/components/ui/wordmark/wordmark.js.map +1 -0
- package/dist/constants/index.cjs +2 -0
- package/dist/constants/index.cjs.map +1 -1
- package/dist/constants/index.d.cts +3 -1
- package/dist/constants/index.d.ts +3 -1
- package/dist/constants/index.js +2 -0
- package/dist/constants/index.js.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/package.json +1 -1
- package/dist/components/ui/ginia-wordmark/ginia-wordmark.cjs.map +0 -1
- package/dist/components/ui/ginia-wordmark/ginia-wordmark.js.map +0 -1
- package/dist/components/ui/ginia-wordmark/index.cjs.map +0 -1
- package/dist/components/ui/ginia-wordmark/index.js +0 -6
- package/dist/components/ui/ginia-wordmark/index.js.map +0 -1
|
@@ -1,70 +1,151 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import { format } from "date-fns";
|
|
4
|
+
import { addDays, format, startOfWeek } from "date-fns";
|
|
5
5
|
import { es } from "date-fns/locale";
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
Calendar as CalendarIcon,
|
|
8
|
+
ChevronDown,
|
|
9
|
+
ChevronLeft,
|
|
10
|
+
ChevronRight
|
|
11
|
+
} from "lucide-react";
|
|
7
12
|
import { cn } from "../../../lib/utils";
|
|
8
13
|
import { Button } from "../button";
|
|
9
14
|
import { Popover, PopoverContent, PopoverTrigger } from "../popover";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
function getWeekStartsOn(locale) {
|
|
16
|
+
const w = locale.options?.weekStartsOn;
|
|
17
|
+
if (w === void 0) return 1;
|
|
18
|
+
return w;
|
|
19
|
+
}
|
|
20
|
+
function useMonthLabels(locale) {
|
|
21
|
+
return React.useMemo(
|
|
22
|
+
() => Array.from({ length: 12 }, (_, i) => format(new Date(2024, i, 1), "LLL", { locale })),
|
|
23
|
+
[locale]
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
function weekdayTwoLetterLabel(abbrev) {
|
|
27
|
+
const graphemes = [...abbrev.normalize("NFC")];
|
|
28
|
+
if (graphemes.length <= 2) {
|
|
29
|
+
return abbrev;
|
|
30
|
+
}
|
|
31
|
+
return graphemes.slice(0, 2).join("");
|
|
32
|
+
}
|
|
33
|
+
function useWeekdayLabels(locale) {
|
|
34
|
+
return React.useMemo(() => {
|
|
35
|
+
const weekStartsOn = getWeekStartsOn(locale);
|
|
36
|
+
const start = startOfWeek(new Date(2024, 0, 3), { weekStartsOn });
|
|
37
|
+
return Array.from({ length: 7 }, (_, i) => {
|
|
38
|
+
const abbrev = format(addDays(start, i), "EEE", { locale });
|
|
39
|
+
return weekdayTwoLetterLabel(abbrev);
|
|
40
|
+
});
|
|
41
|
+
}, [locale]);
|
|
42
|
+
}
|
|
43
|
+
function getDaysInMonth(date, weekStartsOn) {
|
|
44
|
+
const year = date.getFullYear();
|
|
45
|
+
const month = date.getMonth();
|
|
46
|
+
const lastDay = new Date(year, month + 1, 0);
|
|
47
|
+
const daysInMonth = lastDay.getDate();
|
|
48
|
+
const firstDay = new Date(year, month, 1);
|
|
49
|
+
const startingDayOfWeek = firstDay.getDay();
|
|
50
|
+
const offset = (startingDayOfWeek - weekStartsOn + 7) % 7;
|
|
51
|
+
const days = [];
|
|
52
|
+
for (let i = 0; i < offset; i++) {
|
|
53
|
+
days.push(null);
|
|
54
|
+
}
|
|
55
|
+
for (let day = 1; day <= daysInMonth; day++) {
|
|
56
|
+
days.push(new Date(year, month, day));
|
|
57
|
+
}
|
|
58
|
+
return days;
|
|
59
|
+
}
|
|
60
|
+
function DatePickerSelect({
|
|
61
|
+
className,
|
|
62
|
+
wrapperClassName,
|
|
63
|
+
children,
|
|
64
|
+
...props
|
|
65
|
+
}) {
|
|
66
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("relative", wrapperClassName), children: [
|
|
67
|
+
/* @__PURE__ */ jsx(
|
|
68
|
+
"select",
|
|
69
|
+
{
|
|
70
|
+
...props,
|
|
71
|
+
className: cn(
|
|
72
|
+
"h-9 w-full min-w-0 cursor-pointer appearance-none rounded-md border border-input bg-card py-0 pl-2 pr-9 text-left text-sm shadow-xs outline-none",
|
|
73
|
+
"focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50",
|
|
74
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
75
|
+
className
|
|
76
|
+
),
|
|
77
|
+
children
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
/* @__PURE__ */ jsx(
|
|
81
|
+
ChevronDown,
|
|
82
|
+
{
|
|
83
|
+
className: "pointer-events-none absolute right-2 top-1/2 size-4 -translate-y-1/2 shrink-0 text-muted-foreground opacity-80",
|
|
84
|
+
"aria-hidden": true
|
|
85
|
+
}
|
|
86
|
+
)
|
|
87
|
+
] });
|
|
88
|
+
}
|
|
25
89
|
function DatePicker({
|
|
26
90
|
value,
|
|
27
91
|
onChange,
|
|
28
92
|
placeholder = "Seleccionar fecha",
|
|
29
93
|
disabled = false,
|
|
30
|
-
className
|
|
94
|
+
className,
|
|
95
|
+
locale = es,
|
|
96
|
+
fromYear,
|
|
97
|
+
toYear
|
|
31
98
|
}) {
|
|
32
99
|
const [open, setOpen] = React.useState(false);
|
|
33
|
-
const [currentMonth, setCurrentMonth] = React.useState(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
days2.push(null);
|
|
100
|
+
const [currentMonth, setCurrentMonth] = React.useState(() => {
|
|
101
|
+
const base = value ?? /* @__PURE__ */ new Date();
|
|
102
|
+
return new Date(base.getFullYear(), base.getMonth(), 1);
|
|
103
|
+
});
|
|
104
|
+
const monthLabels = useMonthLabels(locale);
|
|
105
|
+
const weekdayLabels = useWeekdayLabels(locale);
|
|
106
|
+
const weekStartsOn = getWeekStartsOn(locale);
|
|
107
|
+
React.useEffect(() => {
|
|
108
|
+
if (value) {
|
|
109
|
+
setCurrentMonth(new Date(value.getFullYear(), value.getMonth(), 1));
|
|
44
110
|
}
|
|
45
|
-
|
|
46
|
-
|
|
111
|
+
}, [value]);
|
|
112
|
+
const days = React.useMemo(
|
|
113
|
+
() => getDaysInMonth(currentMonth, weekStartsOn),
|
|
114
|
+
[currentMonth, weekStartsOn]
|
|
115
|
+
);
|
|
116
|
+
const yearOptions = React.useMemo(() => {
|
|
117
|
+
const y = (/* @__PURE__ */ new Date()).getFullYear();
|
|
118
|
+
const from = fromYear ?? y - 100;
|
|
119
|
+
const to = toYear ?? y + 10;
|
|
120
|
+
const list = [];
|
|
121
|
+
for (let i = from; i <= to; i++) {
|
|
122
|
+
list.push(i);
|
|
47
123
|
}
|
|
48
|
-
return
|
|
49
|
-
};
|
|
50
|
-
const days = getDaysInMonth(currentMonth);
|
|
124
|
+
return list;
|
|
125
|
+
}, [fromYear, toYear]);
|
|
51
126
|
const handleDateSelect = (date) => {
|
|
52
127
|
onChange?.(date);
|
|
53
128
|
setOpen(false);
|
|
54
129
|
};
|
|
55
130
|
const goToPreviousMonth = () => {
|
|
56
|
-
setCurrentMonth(new Date(currentMonth.getFullYear(), currentMonth.getMonth() - 1));
|
|
131
|
+
setCurrentMonth(new Date(currentMonth.getFullYear(), currentMonth.getMonth() - 1, 1));
|
|
57
132
|
};
|
|
58
133
|
const goToNextMonth = () => {
|
|
59
|
-
setCurrentMonth(new Date(currentMonth.getFullYear(), currentMonth.getMonth() + 1));
|
|
134
|
+
setCurrentMonth(new Date(currentMonth.getFullYear(), currentMonth.getMonth() + 1, 1));
|
|
135
|
+
};
|
|
136
|
+
const setMonthFromSelect = (monthIndex) => {
|
|
137
|
+
setCurrentMonth(new Date(currentMonth.getFullYear(), monthIndex, 1));
|
|
138
|
+
};
|
|
139
|
+
const setYearFromSelect = (year) => {
|
|
140
|
+
setCurrentMonth(new Date(year, currentMonth.getMonth(), 1));
|
|
60
141
|
};
|
|
61
142
|
const isToday = (date) => {
|
|
62
143
|
const today = /* @__PURE__ */ new Date();
|
|
63
|
-
return date.
|
|
144
|
+
return date.getFullYear() === today.getFullYear() && date.getMonth() === today.getMonth() && date.getDate() === today.getDate();
|
|
64
145
|
};
|
|
65
146
|
const isSelected = (date) => {
|
|
66
147
|
if (!value) return false;
|
|
67
|
-
return date.
|
|
148
|
+
return date.getFullYear() === value.getFullYear() && date.getMonth() === value.getMonth() && date.getDate() === value.getDate();
|
|
68
149
|
};
|
|
69
150
|
return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
|
|
70
151
|
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
@@ -79,32 +160,78 @@ function DatePicker({
|
|
|
79
160
|
),
|
|
80
161
|
disabled,
|
|
81
162
|
children: [
|
|
82
|
-
/* @__PURE__ */ jsx(CalendarIcon, { className: "mr-2 h-4 w-4" }),
|
|
83
|
-
value ? format(value, "
|
|
163
|
+
/* @__PURE__ */ jsx(CalendarIcon, { className: "mr-2 h-4 w-4 shrink-0" }),
|
|
164
|
+
value ? format(value, "P", { locale }) : placeholder
|
|
84
165
|
]
|
|
85
166
|
}
|
|
86
167
|
) }),
|
|
87
|
-
/* @__PURE__ */ jsx(PopoverContent, { className: "w-auto p-0", align: "start", children: /* @__PURE__ */ jsxs("div", { className: "p-3", children: [
|
|
88
|
-
/* @__PURE__ */ jsxs("div", { className: "mb-
|
|
89
|
-
/* @__PURE__ */ jsx(
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
168
|
+
/* @__PURE__ */ jsx(PopoverContent, { className: "w-auto bg-white p-0 dark:bg-card", align: "start", children: /* @__PURE__ */ jsxs("div", { className: "p-3", children: [
|
|
169
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-3 flex flex-wrap items-center justify-center gap-1.5", children: [
|
|
170
|
+
/* @__PURE__ */ jsx(
|
|
171
|
+
Button,
|
|
172
|
+
{
|
|
173
|
+
type: "button",
|
|
174
|
+
variant: "outline",
|
|
175
|
+
size: "sm",
|
|
176
|
+
onClick: goToPreviousMonth,
|
|
177
|
+
className: "h-9 w-9 shrink-0 p-0",
|
|
178
|
+
"aria-label": locale.code?.startsWith("es") ? "Mes anterior" : "Previous month",
|
|
179
|
+
children: /* @__PURE__ */ jsx(ChevronLeft, { className: "h-4 w-4" })
|
|
180
|
+
}
|
|
181
|
+
),
|
|
182
|
+
/* @__PURE__ */ jsx(
|
|
183
|
+
DatePickerSelect,
|
|
184
|
+
{
|
|
185
|
+
wrapperClassName: "w-[6.75rem] shrink-0",
|
|
186
|
+
value: currentMonth.getMonth(),
|
|
187
|
+
onChange: (e) => setMonthFromSelect(Number(e.target.value)),
|
|
188
|
+
"aria-label": locale.code?.startsWith("es") ? "Mes" : "Month",
|
|
189
|
+
children: monthLabels.map((label, i) => /* @__PURE__ */ jsx("option", { value: i, children: label }, label))
|
|
190
|
+
}
|
|
191
|
+
),
|
|
192
|
+
/* @__PURE__ */ jsx(
|
|
193
|
+
DatePickerSelect,
|
|
194
|
+
{
|
|
195
|
+
wrapperClassName: "w-[5.5rem] shrink-0",
|
|
196
|
+
className: "tabular-nums text-center",
|
|
197
|
+
value: currentMonth.getFullYear(),
|
|
198
|
+
onChange: (e) => setYearFromSelect(Number(e.target.value)),
|
|
199
|
+
"aria-label": locale.code?.startsWith("es") ? "A\xF1o" : "Year",
|
|
200
|
+
children: yearOptions.map((y) => /* @__PURE__ */ jsx("option", { value: y, children: y }, y))
|
|
201
|
+
}
|
|
202
|
+
),
|
|
203
|
+
/* @__PURE__ */ jsx(
|
|
204
|
+
Button,
|
|
205
|
+
{
|
|
206
|
+
type: "button",
|
|
207
|
+
variant: "outline",
|
|
208
|
+
size: "sm",
|
|
209
|
+
onClick: goToNextMonth,
|
|
210
|
+
className: "h-9 w-9 shrink-0 p-0",
|
|
211
|
+
"aria-label": locale.code?.startsWith("es") ? "Mes siguiente" : "Next month",
|
|
212
|
+
children: /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" })
|
|
213
|
+
}
|
|
214
|
+
)
|
|
96
215
|
] }),
|
|
97
|
-
/* @__PURE__ */ jsx("div", { className: "mb-2 grid grid-cols-7 gap-1", children:
|
|
216
|
+
/* @__PURE__ */ jsx("div", { className: "mb-2 grid grid-cols-7 gap-1", children: weekdayLabels.map((day, i) => /* @__PURE__ */ jsx(
|
|
217
|
+
"div",
|
|
218
|
+
{
|
|
219
|
+
className: "px-0.5 py-2 text-center text-sm font-medium capitalize leading-tight text-muted-foreground",
|
|
220
|
+
children: day
|
|
221
|
+
},
|
|
222
|
+
i
|
|
223
|
+
)) }),
|
|
98
224
|
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-7 gap-1", children: days.map((day, index) => /* @__PURE__ */ jsx("div", { className: "flex h-9 w-9 items-center justify-center", children: day ? /* @__PURE__ */ jsx(
|
|
99
225
|
Button,
|
|
100
226
|
{
|
|
227
|
+
type: "button",
|
|
101
228
|
variant: "ghost",
|
|
102
229
|
size: "sm",
|
|
103
230
|
className: cn(
|
|
104
231
|
"h-9 w-9 p-0 font-normal",
|
|
105
|
-
isSelected(day) && "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground",
|
|
106
|
-
isToday(day) && !isSelected(day) && "bg-accent text-accent-foreground",
|
|
107
|
-
"hover:bg-muted"
|
|
232
|
+
isSelected(day) && "bg-primary text-primary-foreground hover:bg-primary-dark hover:text-primary-foreground",
|
|
233
|
+
isToday(day) && !isSelected(day) && "bg-accent text-accent-foreground hover:bg-accent/80 hover:text-accent-foreground",
|
|
234
|
+
!isSelected(day) && !isToday(day) && "hover:bg-muted hover:text-foreground"
|
|
108
235
|
),
|
|
109
236
|
onClick: () => handleDateSelect(day),
|
|
110
237
|
children: day.getDate()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/ui/date-picker/date-picker.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { format } from \"date-fns\";\nimport { es } from \"date-fns/locale\";\nimport { Calendar as CalendarIcon, ChevronLeft, ChevronRight } from \"lucide-react\";\n\nimport { cn } from \"../../../lib/utils\";\nimport { Button } from \"../button\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../popover\";\n\nexport interface DatePickerProps {\n value?: Date;\n onChange?: (date: Date | undefined) => void;\n placeholder?: string;\n disabled?: boolean;\n className?: string;\n}\n\nconst monthNames = [\n \"Enero\",\n \"Febrero\",\n \"Marzo\",\n \"Abril\",\n \"Mayo\",\n \"Junio\",\n \"Julio\",\n \"Agosto\",\n \"Septiembre\",\n \"Octubre\",\n \"Noviembre\",\n \"Diciembre\",\n];\nconst dayNames = [\"Do\", \"Lu\", \"Ma\", \"Mi\", \"Ju\", \"Vi\", \"Sá\"];\n\nfunction DatePicker({\n value,\n onChange,\n placeholder = \"Seleccionar fecha\",\n disabled = false,\n className,\n}: DatePickerProps) {\n const [open, setOpen] = React.useState(false);\n const [currentMonth, setCurrentMonth] = React.useState(value || new Date());\n\n const getDaysInMonth = (date: Date) => {\n const year = date.getFullYear();\n const month = date.getMonth();\n const firstDay = new Date(year, month, 1);\n const lastDay = new Date(year, month + 1, 0);\n const daysInMonth = lastDay.getDate();\n const startingDayOfWeek = firstDay.getDay();\n\n const days: (Date | null)[] = [];\n\n for (let i = 0; i < startingDayOfWeek; i++) {\n days.push(null);\n }\n\n for (let day = 1; day <= daysInMonth; day++) {\n days.push(new Date(Date.UTC(year, month, day)));\n }\n\n return days;\n };\n\n const days = getDaysInMonth(currentMonth);\n\n const handleDateSelect = (date: Date) => {\n onChange?.(date);\n setOpen(false);\n };\n\n const goToPreviousMonth = () => {\n setCurrentMonth(new Date(currentMonth.getFullYear(), currentMonth.getMonth() - 1));\n };\n\n const goToNextMonth = () => {\n setCurrentMonth(new Date(currentMonth.getFullYear(), currentMonth.getMonth() + 1));\n };\n\n const isToday = (date: Date) => {\n const today = new Date();\n return (\n date.getUTCFullYear() === today.getFullYear() &&\n date.getUTCMonth() === today.getMonth() &&\n date.getUTCDate() === today.getDate()\n );\n };\n\n const isSelected = (date: Date) => {\n if (!value) return false;\n return (\n date.getUTCFullYear() === value.getFullYear() &&\n date.getUTCMonth() === value.getMonth() &&\n date.getUTCDate() === value.getDate()\n );\n };\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <Button\n variant=\"outline\"\n data-slot=\"date-picker\"\n className={cn(\n \"w-full justify-start text-left font-normal\",\n !value && \"text-muted-foreground\",\n className,\n )}\n disabled={disabled}\n >\n <CalendarIcon className=\"mr-2 h-4 w-4\" />\n {value ? format(value, \"dd/MM/yyyy\", { locale: es }) : placeholder}\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-auto p-0\" align=\"start\">\n <div className=\"p-3\">\n <div className=\"mb-4 flex items-center justify-between\">\n <Button variant=\"outline\" size=\"sm\" onClick={goToPreviousMonth} className=\"h-7 w-7 p-0\">\n <ChevronLeft className=\"h-4 w-4\" />\n </Button>\n <div className=\"text-sm font-medium\">\n {monthNames[currentMonth.getMonth()]} {currentMonth.getFullYear()}\n </div>\n <Button variant=\"outline\" size=\"sm\" onClick={goToNextMonth} className=\"h-7 w-7 p-0\">\n <ChevronRight className=\"h-4 w-4\" />\n </Button>\n </div>\n\n <div className=\"mb-2 grid grid-cols-7 gap-1\">\n {dayNames.map((day) => (\n <div key={day} className=\"py-2 text-center text-xs font-medium text-muted-foreground\">\n {day}\n </div>\n ))}\n </div>\n\n <div className=\"grid grid-cols-7 gap-1\">\n {days.map((day, index) => (\n <div key={index} className=\"flex h-9 w-9 items-center justify-center\">\n {day ? (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n className={cn(\n \"h-9 w-9 p-0 font-normal\",\n isSelected(day) &&\n \"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground\",\n isToday(day) && !isSelected(day) && \"bg-accent text-accent-foreground\",\n \"hover:bg-muted\",\n )}\n onClick={() => handleDateSelect(day)}\n >\n {day.getDate()}\n </Button>\n ) : (\n <div className=\"h-9 w-9\" />\n )}\n </div>\n ))}\n </div>\n </div>\n </PopoverContent>\n </Popover>\n );\n}\n\nexport { DatePicker };\n"],"mappings":";AAsGQ,SAUE,KAVF;AApGR,YAAY,WAAW;AACvB,SAAS,cAAc;AACvB,SAAS,UAAU;AACnB,SAAS,YAAY,cAAc,aAAa,oBAAoB;AAEpE,SAAS,UAAU;AACnB,SAAS,cAAc;AACvB,SAAS,SAAS,gBAAgB,sBAAsB;AAUxD,MAAM,aAAa;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AACA,MAAM,WAAW,CAAC,MAAM,MAAM,MAAM,MAAM,MAAM,MAAM,OAAI;AAE1D,SAAS,WAAW;AAAA,EAClB;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd,WAAW;AAAA,EACX;AACF,GAAoB;AAClB,QAAM,CAAC,MAAM,OAAO,IAAI,MAAM,SAAS,KAAK;AAC5C,QAAM,CAAC,cAAc,eAAe,IAAI,MAAM,SAAS,SAAS,oBAAI,KAAK,CAAC;AAE1E,QAAM,iBAAiB,CAAC,SAAe;AACrC,UAAM,OAAO,KAAK,YAAY;AAC9B,UAAM,QAAQ,KAAK,SAAS;AAC5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,KAjBnB,KAmBV,CACD,GACH;AAAA,OACF,GACF;AAAA,KACF;AAEJ;","names":["days"]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/date-picker/date-picker.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { addDays, format, startOfWeek } from \"date-fns\";\nimport type { Locale } from \"date-fns\";\nimport { es } from \"date-fns/locale\";\nimport {\n Calendar as CalendarIcon,\n ChevronDown,\n ChevronLeft,\n ChevronRight,\n} from \"lucide-react\";\n\nimport { cn } from \"../../../lib/utils\";\nimport { Button } from \"../button\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../popover\";\n\nexport interface DatePickerProps {\n value?: Date;\n onChange?: (date: Date | undefined) => void;\n placeholder?: string;\n disabled?: boolean;\n className?: string;\n /**\n * Locale de `date-fns` para nombres de mes/día y formato de la fecha en el botón.\n * Por defecto español (`es`).\n */\n locale?: Locale;\n /** Año mínimo en el selector (inclusive). */\n fromYear?: number;\n /** Año máximo en el selector (inclusive). */\n toYear?: number;\n}\n\nfunction getWeekStartsOn(locale: Locale): 0 | 1 | 2 | 3 | 4 | 5 | 6 {\n const w = locale.options?.weekStartsOn;\n if (w === undefined) return 1;\n return w as 0 | 1 | 2 | 3 | 4 | 5 | 6;\n}\n\n/** Meses abreviados (`LLL`) para que el `<select>` sea compacto dentro del popover. */\nfunction useMonthLabels(locale: Locale) {\n return React.useMemo(\n () => Array.from({ length: 12 }, (_, i) => format(new Date(2024, i, 1), \"LLL\", { locale })),\n [locale],\n );\n}\n\n/** Abreviatura del día en exactamente dos caracteres visibles (p. ej. lun → lu, Wed → We). */\nfunction weekdayTwoLetterLabel(abbrev: string): string {\n const graphemes = [...abbrev.normalize(\"NFC\")];\n if (graphemes.length <= 2) {\n return abbrev;\n }\n return graphemes.slice(0, 2).join(\"\");\n}\n\nfunction useWeekdayLabels(locale: Locale) {\n return React.useMemo(() => {\n const weekStartsOn = getWeekStartsOn(locale);\n const start = startOfWeek(new Date(2024, 0, 3), { weekStartsOn });\n return Array.from({ length: 7 }, (_, i) => {\n const abbrev = format(addDays(start, i), \"EEE\", { locale });\n return weekdayTwoLetterLabel(abbrev);\n });\n }, [locale]);\n}\n\nfunction getDaysInMonth(date: Date, weekStartsOn: 0 | 1 | 2 | 3 | 4 | 5 | 6) {\n const year = date.getFullYear();\n const month = date.getMonth();\n const lastDay = new Date(year, month + 1, 0);\n const daysInMonth = lastDay.getDate();\n const firstDay = new Date(year, month, 1);\n const startingDayOfWeek = firstDay.getDay();\n const offset = (startingDayOfWeek - weekStartsOn + 7) % 7;\n\n const days: (Date | null)[] = [];\n for (let i = 0; i < offset; i++) {\n days.push(null);\n }\n for (let day = 1; day <= daysInMonth; day++) {\n days.push(new Date(year, month, day));\n }\n return days;\n}\n\n/** Select nativo sin flecha del sistema: el chevron es un icono con margen fijo (padding fiable en todos los navegadores). */\nfunction DatePickerSelect({\n className,\n wrapperClassName,\n children,\n ...props\n}: React.ComponentProps<\"select\"> & { wrapperClassName?: string }) {\n return (\n <div className={cn(\"relative\", wrapperClassName)}>\n <select\n {...props}\n className={cn(\n \"h-9 w-full min-w-0 cursor-pointer appearance-none rounded-md border border-input bg-card py-0 pl-2 pr-9 text-left text-sm shadow-xs outline-none\",\n \"focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50\",\n \"disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n >\n {children}\n </select>\n <ChevronDown\n className=\"pointer-events-none absolute right-2 top-1/2 size-4 -translate-y-1/2 shrink-0 text-muted-foreground opacity-80\"\n aria-hidden\n />\n </div>\n );\n}\n\nfunction DatePicker({\n value,\n onChange,\n placeholder = \"Seleccionar fecha\",\n disabled = false,\n className,\n locale = es,\n fromYear,\n toYear,\n}: DatePickerProps) {\n const [open, setOpen] = React.useState(false);\n const [currentMonth, setCurrentMonth] = React.useState(() => {\n const base = value ?? new Date();\n return new Date(base.getFullYear(), base.getMonth(), 1);\n });\n\n const monthLabels = useMonthLabels(locale);\n const weekdayLabels = useWeekdayLabels(locale);\n const weekStartsOn = getWeekStartsOn(locale);\n\n React.useEffect(() => {\n if (value) {\n setCurrentMonth(new Date(value.getFullYear(), value.getMonth(), 1));\n }\n }, [value]);\n\n const days = React.useMemo(\n () => getDaysInMonth(currentMonth, weekStartsOn),\n [currentMonth, weekStartsOn],\n );\n\n const yearOptions = React.useMemo(() => {\n const y = new Date().getFullYear();\n const from = fromYear ?? y - 100;\n const to = toYear ?? y + 10;\n const list: number[] = [];\n for (let i = from; i <= to; i++) {\n list.push(i);\n }\n return list;\n }, [fromYear, toYear]);\n\n const handleDateSelect = (date: Date) => {\n onChange?.(date);\n setOpen(false);\n };\n\n const goToPreviousMonth = () => {\n setCurrentMonth(new Date(currentMonth.getFullYear(), currentMonth.getMonth() - 1, 1));\n };\n\n const goToNextMonth = () => {\n setCurrentMonth(new Date(currentMonth.getFullYear(), currentMonth.getMonth() + 1, 1));\n };\n\n const setMonthFromSelect = (monthIndex: number) => {\n setCurrentMonth(new Date(currentMonth.getFullYear(), monthIndex, 1));\n };\n\n const setYearFromSelect = (year: number) => {\n setCurrentMonth(new Date(year, currentMonth.getMonth(), 1));\n };\n\n const isToday = (date: Date) => {\n const today = new Date();\n return (\n date.getFullYear() === today.getFullYear() &&\n date.getMonth() === today.getMonth() &&\n date.getDate() === today.getDate()\n );\n };\n\n const isSelected = (date: Date) => {\n if (!value) return false;\n return (\n date.getFullYear() === value.getFullYear() &&\n date.getMonth() === value.getMonth() &&\n date.getDate() === value.getDate()\n );\n };\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <Button\n variant=\"outline\"\n data-slot=\"date-picker\"\n className={cn(\n \"w-full justify-start text-left font-normal\",\n !value && \"text-muted-foreground\",\n className,\n )}\n disabled={disabled}\n >\n <CalendarIcon className=\"mr-2 h-4 w-4 shrink-0\" />\n {value ? format(value, \"P\", { locale }) : placeholder}\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-auto bg-white p-0 dark:bg-card\" align=\"start\">\n <div className=\"p-3\">\n <div className=\"mb-3 flex flex-wrap items-center justify-center gap-1.5\">\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n onClick={goToPreviousMonth}\n className=\"h-9 w-9 shrink-0 p-0\"\n aria-label={locale.code?.startsWith(\"es\") ? \"Mes anterior\" : \"Previous month\"}\n >\n <ChevronLeft className=\"h-4 w-4\" />\n </Button>\n <DatePickerSelect\n wrapperClassName=\"w-[6.75rem] shrink-0\"\n value={currentMonth.getMonth()}\n onChange={(e) => setMonthFromSelect(Number(e.target.value))}\n aria-label={locale.code?.startsWith(\"es\") ? \"Mes\" : \"Month\"}\n >\n {monthLabels.map((label, i) => (\n <option key={label} value={i}>\n {label}\n </option>\n ))}\n </DatePickerSelect>\n <DatePickerSelect\n wrapperClassName=\"w-[5.5rem] shrink-0\"\n className=\"tabular-nums text-center\"\n value={currentMonth.getFullYear()}\n onChange={(e) => setYearFromSelect(Number(e.target.value))}\n aria-label={locale.code?.startsWith(\"es\") ? \"Año\" : \"Year\"}\n >\n {yearOptions.map((y) => (\n <option key={y} value={y}>\n {y}\n </option>\n ))}\n </DatePickerSelect>\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n onClick={goToNextMonth}\n className=\"h-9 w-9 shrink-0 p-0\"\n aria-label={locale.code?.startsWith(\"es\") ? \"Mes siguiente\" : \"Next month\"}\n >\n <ChevronRight className=\"h-4 w-4\" />\n </Button>\n </div>\n\n <div className=\"mb-2 grid grid-cols-7 gap-1\">\n {weekdayLabels.map((day, i) => (\n <div\n key={i}\n className=\"px-0.5 py-2 text-center text-sm font-medium capitalize leading-tight text-muted-foreground\"\n >\n {day}\n </div>\n ))}\n </div>\n\n <div className=\"grid grid-cols-7 gap-1\">\n {days.map((day, index) => (\n <div key={index} className=\"flex h-9 w-9 items-center justify-center\">\n {day ? (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className={cn(\n \"h-9 w-9 p-0 font-normal\",\n isSelected(day) &&\n \"bg-primary text-primary-foreground hover:bg-primary-dark hover:text-primary-foreground\",\n isToday(day) &&\n !isSelected(day) &&\n \"bg-accent text-accent-foreground hover:bg-accent/80 hover:text-accent-foreground\",\n !isSelected(day) && !isToday(day) && \"hover:bg-muted hover:text-foreground\",\n )}\n onClick={() => handleDateSelect(day)}\n >\n {day.getDate()}\n </Button>\n ) : (\n <div className=\"h-9 w-9\" />\n )}\n </div>\n ))}\n </div>\n </div>\n </PopoverContent>\n </Popover>\n );\n}\n\nexport { DatePicker };\n"],"mappings":";AA+FI,SACE,KADF;AA7FJ,YAAY,WAAW;AACvB,SAAS,SAAS,QAAQ,mBAAmB;AAE7C,SAAS,UAAU;AACnB;AAAA,EACE,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,UAAU;AACnB,SAAS,cAAc;AACvB,SAAS,SAAS,gBAAgB,sBAAsB;AAmBxD,SAAS,gBAAgB,QAA2C;AAClE,QAAM,IAAI,OAAO,SAAS;AAC1B,MAAI,MAAM,OAAW,QAAO;AAC5B,SAAO;AACT;AAGA,SAAS,eAAe,QAAgB;AACtC,SAAO,MAAM;AAAA,IACX,MAAM,MAAM,KAAK,EAAE,QAAQ,GAAG,GAAG,CAAC,GAAG,MAAM,OAAO,IAAI,KAAK,MAAM,GAAG,CAAC,GAAG,OAAO,EAAE,OAAO,CAAC,CAAC;AAAA,IAC1F,CAAC,MAAM;AAAA,EACT;AACF;AAGA,SAAS,sBAAsB,QAAwB;AACrD,QAAM,YAAY,CAAC,GAAG,OAAO,UAAU,KAAK,CAAC;AAC7C,MAAI,UAAU,UAAU,GAAG;AACzB,WAAO;AAAA,EACT;AACA,SAAO,UAAU,MAAM,GAAG,CAAC,EAAE,KAAK,EAAE;AACtC;AAEA,SAAS,iBAAiB,QAAgB;AACxC,SAAO,MAAM,QAAQ,MAAM;AACzB,UAAM,eAAe,gBAAgB,MAAM;AAC3C,UAAM,QAA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C,SAAgB,WAAU,4CACxB,gBACC;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,SAAQ;AAAA,UACR,MAAK;AAAA,UACL,WAAW;AAAA,YACT;AAAA,YACA,WAAW,GAAG,KACZ;AAAA,YACF,QAAQ,GAAG,KACT,CAAC,WAAW,GAAG,KACf;AAAA,YACF,CAAC,WAAW,GAAG,KAAK,CAAC,QAAQ,GAAG,KAAK;AAAA,UACvC;AAAA,UACA,SAAS,MAAM,iBAAiB,GAAG;AAAA,UAElC,cAAI,QAAQ;AAAA;AAAA,MACf,IAEA,oBAAC,SAAI,WAAU,WAAU,KApBnB,KAsBV,CACD,GACH;AAAA,OACF,GACF;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -38,7 +38,7 @@ __reExport(ui_exports, require("./dialog"), module.exports);
|
|
|
38
38
|
__reExport(ui_exports, require("./drawer"), module.exports);
|
|
39
39
|
__reExport(ui_exports, require("./dropdown-menu"), module.exports);
|
|
40
40
|
__reExport(ui_exports, require("./form"), module.exports);
|
|
41
|
-
__reExport(ui_exports, require("./
|
|
41
|
+
__reExport(ui_exports, require("./wordmark"), module.exports);
|
|
42
42
|
__reExport(ui_exports, require("./hover-card"), module.exports);
|
|
43
43
|
__reExport(ui_exports, require("./icon"), module.exports);
|
|
44
44
|
__reExport(ui_exports, require("./input"), module.exports);
|
|
@@ -101,7 +101,7 @@ __reExport(ui_exports, require("./typography"), module.exports);
|
|
|
101
101
|
...require("./drawer"),
|
|
102
102
|
...require("./dropdown-menu"),
|
|
103
103
|
...require("./form"),
|
|
104
|
-
...require("./
|
|
104
|
+
...require("./wordmark"),
|
|
105
105
|
...require("./hover-card"),
|
|
106
106
|
...require("./icon"),
|
|
107
107
|
...require("./input"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ui/index.ts"],"sourcesContent":["export * from \"./accordion\";\nexport * from \"./alert\";\nexport * from \"./alert-dialog\";\nexport * from \"./aspect-ratio\";\nexport * from \"./autocomplete\";\nexport * from \"./avatar\";\nexport * from \"./background\";\nexport * from \"./badge\";\nexport * from \"./breadcrumb\";\nexport * from \"./button\";\nexport * from \"./calendar\";\nexport * from \"./card\";\nexport * from \"./carousel\";\nexport * from \"./checkbox\";\nexport * from \"./collapsible\";\nexport * from \"./combobox\";\nexport * from \"./command\";\nexport * from \"./context-menu\";\nexport * from \"./date-picker\";\nexport * from \"./dialog\";\nexport * from \"./drawer\";\nexport * from \"./dropdown-menu\";\nexport * from \"./form\";\nexport * from \"./
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ui/index.ts"],"sourcesContent":["export * from \"./accordion\";\nexport * from \"./alert\";\nexport * from \"./alert-dialog\";\nexport * from \"./aspect-ratio\";\nexport * from \"./autocomplete\";\nexport * from \"./avatar\";\nexport * from \"./background\";\nexport * from \"./badge\";\nexport * from \"./breadcrumb\";\nexport * from \"./button\";\nexport * from \"./calendar\";\nexport * from \"./card\";\nexport * from \"./carousel\";\nexport * from \"./checkbox\";\nexport * from \"./collapsible\";\nexport * from \"./combobox\";\nexport * from \"./command\";\nexport * from \"./context-menu\";\nexport * from \"./date-picker\";\nexport * from \"./dialog\";\nexport * from \"./drawer\";\nexport * from \"./dropdown-menu\";\nexport * from \"./form\";\nexport * from \"./wordmark\";\nexport * from \"./hover-card\";\nexport * from \"./icon\";\nexport * from \"./input\";\nexport * from \"./input-field\";\nexport * from \"./input-otp\";\nexport * from \"./label\";\nexport * from \"./logo\";\nexport * from \"./loading-state\";\nexport * from \"./menubar\";\nexport * from \"./month-year-picker\";\nexport * from \"./multi-select\";\nexport * from \"./navigation-menu\";\nexport * from \"./pagination\";\nexport * from \"./popover\";\nexport * from \"./progress\";\nexport * from \"./radio-group\";\nexport * from \"./resizable\";\nexport * from \"./rich-text-editor\";\nexport * from \"./scroll-area\";\nexport * from \"./section-loader\";\nexport * from \"./select\";\nexport * from \"./separator\";\nexport * from \"./sheet\";\nexport * from \"./skeleton\";\nexport * from \"./slider\";\nexport * from \"./sonner\";\nexport * from \"./spinner\";\nexport * from \"./switch\";\nexport * from \"./table\";\nexport * from \"./tabs\";\nexport * from \"./tag-input\";\nexport * from \"./textarea\";\nexport * from \"./toast\";\nexport * from \"./toggle\";\nexport * from \"./toggle-group\";\nexport * from \"./tooltip\";\nexport * from \"./typography\";\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,uBAAc,wBAAd;AACA,uBAAc,oBADd;AAEA,uBAAc,2BAFd;AAGA,uBAAc,2BAHd;AAIA,uBAAc,2BAJd;AAKA,uBAAc,qBALd;AAMA,uBAAc,yBANd;AAOA,uBAAc,oBAPd;AAQA,uBAAc,yBARd;AASA,uBAAc,qBATd;AAUA,uBAAc,uBAVd;AAWA,uBAAc,mBAXd;AAYA,uBAAc,uBAZd;AAaA,uBAAc,uBAbd;AAcA,uBAAc,0BAdd;AAeA,uBAAc,uBAfd;AAgBA,uBAAc,sBAhBd;AAiBA,uBAAc,2BAjBd;AAkBA,uBAAc,0BAlBd;AAmBA,uBAAc,qBAnBd;AAoBA,uBAAc,qBApBd;AAqBA,uBAAc,4BArBd;AAsBA,uBAAc,mBAtBd;AAuBA,uBAAc,uBAvBd;AAwBA,uBAAc,yBAxBd;AAyBA,uBAAc,mBAzBd;AA0BA,uBAAc,oBA1Bd;AA2BA,uBAAc,0BA3Bd;AA4BA,uBAAc,wBA5Bd;AA6BA,uBAAc,oBA7Bd;AA8BA,uBAAc,mBA9Bd;AA+BA,uBAAc,4BA/Bd;AAgCA,uBAAc,sBAhCd;AAiCA,uBAAc,gCAjCd;AAkCA,uBAAc,2BAlCd;AAmCA,uBAAc,8BAnCd;AAoCA,uBAAc,yBApCd;AAqCA,uBAAc,sBArCd;AAsCA,uBAAc,uBAtCd;AAuCA,uBAAc,0BAvCd;AAwCA,uBAAc,wBAxCd;AAyCA,uBAAc,+BAzCd;AA0CA,uBAAc,0BA1Cd;AA2CA,uBAAc,6BA3Cd;AA4CA,uBAAc,qBA5Cd;AA6CA,uBAAc,wBA7Cd;AA8CA,uBAAc,oBA9Cd;AA+CA,uBAAc,uBA/Cd;AAgDA,uBAAc,qBAhDd;AAiDA,uBAAc,qBAjDd;AAkDA,uBAAc,sBAlDd;AAmDA,uBAAc,qBAnDd;AAoDA,uBAAc,oBApDd;AAqDA,uBAAc,mBArDd;AAsDA,uBAAc,wBAtDd;AAuDA,uBAAc,uBAvDd;AAwDA,uBAAc,oBAxDd;AAyDA,uBAAc,qBAzDd;AA0DA,uBAAc,2BA1Dd;AA2DA,uBAAc,sBA3Dd;AA4DA,uBAAc,yBA5Dd;","names":[]}
|
|
@@ -21,7 +21,7 @@ export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, Di
|
|
|
21
21
|
export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger } from './drawer/drawer.cjs';
|
|
22
22
|
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from './dropdown-menu/dropdown-menu.cjs';
|
|
23
23
|
export { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField } from './form/form.cjs';
|
|
24
|
-
export {
|
|
24
|
+
export { Wordmark, WordmarkProps, wordmarkVariants } from './wordmark/wordmark.cjs';
|
|
25
25
|
export { HoverCard, HoverCardContent, HoverCardTrigger } from './hover-card/hover-card.cjs';
|
|
26
26
|
export { Icon, IconProps, IconSize, iconSizes } from './icon/icon.cjs';
|
|
27
27
|
export { Input } from './input/input.cjs';
|
|
@@ -74,6 +74,7 @@ import '@radix-ui/react-collapsible';
|
|
|
74
74
|
import '@radix-ui/react-dialog';
|
|
75
75
|
import 'cmdk';
|
|
76
76
|
import '@radix-ui/react-context-menu';
|
|
77
|
+
import 'date-fns';
|
|
77
78
|
import 'vaul';
|
|
78
79
|
import '@radix-ui/react-dropdown-menu';
|
|
79
80
|
import 'react-hook-form';
|
|
@@ -21,7 +21,7 @@ export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, Di
|
|
|
21
21
|
export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger } from './drawer/drawer.js';
|
|
22
22
|
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from './dropdown-menu/dropdown-menu.js';
|
|
23
23
|
export { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField } from './form/form.js';
|
|
24
|
-
export {
|
|
24
|
+
export { Wordmark, WordmarkProps, wordmarkVariants } from './wordmark/wordmark.js';
|
|
25
25
|
export { HoverCard, HoverCardContent, HoverCardTrigger } from './hover-card/hover-card.js';
|
|
26
26
|
export { Icon, IconProps, IconSize, iconSizes } from './icon/icon.js';
|
|
27
27
|
export { Input } from './input/input.js';
|
|
@@ -74,6 +74,7 @@ import '@radix-ui/react-collapsible';
|
|
|
74
74
|
import '@radix-ui/react-dialog';
|
|
75
75
|
import 'cmdk';
|
|
76
76
|
import '@radix-ui/react-context-menu';
|
|
77
|
+
import 'date-fns';
|
|
77
78
|
import 'vaul';
|
|
78
79
|
import '@radix-ui/react-dropdown-menu';
|
|
79
80
|
import 'react-hook-form';
|
|
@@ -21,7 +21,7 @@ export * from "./dialog";
|
|
|
21
21
|
export * from "./drawer";
|
|
22
22
|
export * from "./dropdown-menu";
|
|
23
23
|
export * from "./form";
|
|
24
|
-
export * from "./
|
|
24
|
+
export * from "./wordmark";
|
|
25
25
|
export * from "./hover-card";
|
|
26
26
|
export * from "./icon";
|
|
27
27
|
export * from "./input";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ui/index.ts"],"sourcesContent":["export * from \"./accordion\";\nexport * from \"./alert\";\nexport * from \"./alert-dialog\";\nexport * from \"./aspect-ratio\";\nexport * from \"./autocomplete\";\nexport * from \"./avatar\";\nexport * from \"./background\";\nexport * from \"./badge\";\nexport * from \"./breadcrumb\";\nexport * from \"./button\";\nexport * from \"./calendar\";\nexport * from \"./card\";\nexport * from \"./carousel\";\nexport * from \"./checkbox\";\nexport * from \"./collapsible\";\nexport * from \"./combobox\";\nexport * from \"./command\";\nexport * from \"./context-menu\";\nexport * from \"./date-picker\";\nexport * from \"./dialog\";\nexport * from \"./drawer\";\nexport * from \"./dropdown-menu\";\nexport * from \"./form\";\nexport * from \"./
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ui/index.ts"],"sourcesContent":["export * from \"./accordion\";\nexport * from \"./alert\";\nexport * from \"./alert-dialog\";\nexport * from \"./aspect-ratio\";\nexport * from \"./autocomplete\";\nexport * from \"./avatar\";\nexport * from \"./background\";\nexport * from \"./badge\";\nexport * from \"./breadcrumb\";\nexport * from \"./button\";\nexport * from \"./calendar\";\nexport * from \"./card\";\nexport * from \"./carousel\";\nexport * from \"./checkbox\";\nexport * from \"./collapsible\";\nexport * from \"./combobox\";\nexport * from \"./command\";\nexport * from \"./context-menu\";\nexport * from \"./date-picker\";\nexport * from \"./dialog\";\nexport * from \"./drawer\";\nexport * from \"./dropdown-menu\";\nexport * from \"./form\";\nexport * from \"./wordmark\";\nexport * from \"./hover-card\";\nexport * from \"./icon\";\nexport * from \"./input\";\nexport * from \"./input-field\";\nexport * from \"./input-otp\";\nexport * from \"./label\";\nexport * from \"./logo\";\nexport * from \"./loading-state\";\nexport * from \"./menubar\";\nexport * from \"./month-year-picker\";\nexport * from \"./multi-select\";\nexport * from \"./navigation-menu\";\nexport * from \"./pagination\";\nexport * from \"./popover\";\nexport * from \"./progress\";\nexport * from \"./radio-group\";\nexport * from \"./resizable\";\nexport * from \"./rich-text-editor\";\nexport * from \"./scroll-area\";\nexport * from \"./section-loader\";\nexport * from \"./select\";\nexport * from \"./separator\";\nexport * from \"./sheet\";\nexport * from \"./skeleton\";\nexport * from \"./slider\";\nexport * from \"./sonner\";\nexport * from \"./spinner\";\nexport * from \"./switch\";\nexport * from \"./table\";\nexport * from \"./tabs\";\nexport * from \"./tag-input\";\nexport * from \"./textarea\";\nexport * from \"./toast\";\nexport * from \"./toggle\";\nexport * from \"./toggle-group\";\nexport * from \"./tooltip\";\nexport * from \"./typography\";\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
|
|
@@ -16,16 +16,16 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
21
|
-
|
|
22
|
-
wordmarkVariants: () =>
|
|
19
|
+
var wordmark_exports = {};
|
|
20
|
+
__export(wordmark_exports, {
|
|
21
|
+
Wordmark: () => import_wordmark.Wordmark,
|
|
22
|
+
wordmarkVariants: () => import_wordmark.wordmarkVariants
|
|
23
23
|
});
|
|
24
|
-
module.exports = __toCommonJS(
|
|
25
|
-
var
|
|
24
|
+
module.exports = __toCommonJS(wordmark_exports);
|
|
25
|
+
var import_wordmark = require("./wordmark");
|
|
26
26
|
// Annotate the CommonJS export names for ESM import in node:
|
|
27
27
|
0 && (module.exports = {
|
|
28
|
-
|
|
28
|
+
Wordmark,
|
|
29
29
|
wordmarkVariants
|
|
30
30
|
});
|
|
31
31
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/wordmark/index.ts"],"sourcesContent":["export { Wordmark, wordmarkVariants } from \"./wordmark\";\nexport type { WordmarkProps } from \"./wordmark\";\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAA2C;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/wordmark/index.ts"],"sourcesContent":["export { Wordmark, wordmarkVariants } from \"./wordmark\";\nexport type { WordmarkProps } from \"./wordmark\";\n"],"mappings":"AAAA,SAAS,UAAU,wBAAwB;","names":[]}
|
|
@@ -17,12 +17,12 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
-
var
|
|
21
|
-
__export(
|
|
22
|
-
|
|
20
|
+
var wordmark_exports = {};
|
|
21
|
+
__export(wordmark_exports, {
|
|
22
|
+
Wordmark: () => Wordmark,
|
|
23
23
|
wordmarkVariants: () => wordmarkVariants
|
|
24
24
|
});
|
|
25
|
-
module.exports = __toCommonJS(
|
|
25
|
+
module.exports = __toCommonJS(wordmark_exports);
|
|
26
26
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
27
27
|
var import_class_variance_authority = require("class-variance-authority");
|
|
28
28
|
var import_utils = require("../../../lib/utils");
|
|
@@ -56,30 +56,32 @@ const labelVariants = (0, import_class_variance_authority.cva)("font-semibold tr
|
|
|
56
56
|
size: "md"
|
|
57
57
|
}
|
|
58
58
|
});
|
|
59
|
-
function
|
|
59
|
+
function Wordmark({
|
|
60
60
|
className,
|
|
61
61
|
size = "md",
|
|
62
|
-
|
|
62
|
+
text = "Ginia",
|
|
63
|
+
label,
|
|
63
64
|
...props
|
|
64
65
|
}) {
|
|
66
|
+
const ariaLabel = label ?? text;
|
|
65
67
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
66
68
|
"div",
|
|
67
69
|
{
|
|
68
70
|
className: (0, import_utils.cn)(wordmarkVariants({ size }), className),
|
|
69
71
|
role: "img",
|
|
70
|
-
"aria-label":
|
|
71
|
-
"data-slot": "
|
|
72
|
+
"aria-label": ariaLabel,
|
|
73
|
+
"data-slot": "wordmark",
|
|
72
74
|
...props,
|
|
73
75
|
children: [
|
|
74
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_logo.Logo, { "data-slot": "
|
|
75
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: (0, import_utils.cn)(labelVariants({ size })), "aria-hidden": true, children:
|
|
76
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_logo.Logo, { "data-slot": "wordmark-logo", "aria-hidden": true, className: (0, import_utils.cn)(logoSizeClass[size ?? "md"], "shrink-0") }),
|
|
77
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: (0, import_utils.cn)(labelVariants({ size })), "aria-hidden": true, children: text })
|
|
76
78
|
]
|
|
77
79
|
}
|
|
78
80
|
);
|
|
79
81
|
}
|
|
80
82
|
// Annotate the CommonJS export names for ESM import in node:
|
|
81
83
|
0 && (module.exports = {
|
|
82
|
-
|
|
84
|
+
Wordmark,
|
|
83
85
|
wordmarkVariants
|
|
84
86
|
});
|
|
85
|
-
//# sourceMappingURL=
|
|
87
|
+
//# sourceMappingURL=wordmark.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/wordmark/wordmark.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"../../../lib/utils\";\nimport { Logo } from \"../logo/logo\";\n\nconst wordmarkVariants = cva(\"inline-flex items-center\", {\n variants: {\n size: {\n sm: \"gap-1.5\",\n md: \"gap-2\",\n lg: \"gap-2.5\",\n },\n },\n defaultVariants: {\n size: \"md\",\n },\n});\n\nconst logoSizeClass = {\n sm: \"size-6\",\n md: \"size-8\",\n lg: \"size-10\",\n} as const;\n\nconst labelVariants = cva(\"font-semibold tracking-tight text-foreground\", {\n variants: {\n size: {\n sm: \"text-lg\",\n md: \"text-xl\",\n lg: \"text-2xl\",\n },\n },\n defaultVariants: {\n size: \"md\",\n },\n});\n\nexport interface WordmarkProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Visual scale of the mark and label. */\n size?: VariantProps<typeof wordmarkVariants>[\"size\"];\n /** Text next to the logo. Defaults to `\"Ginia\"`. */\n text?: string;\n /**\n * Accessible label for the lockup. Defaults to `text` when omitted\n * (override if the visible text should not be read verbatim).\n */\n label?: string;\n}\n\n/**\n * Brand lockup: Ginia logo (mark) plus a word (default “Ginia”).\n *\n * Use in headers, splash screens, and anywhere the product name should appear with the icon.\n */\nfunction Wordmark({\n className,\n size = \"md\",\n text = \"Ginia\",\n label,\n ...props\n}: WordmarkProps) {\n const ariaLabel = label ?? text;\n\n return (\n <div\n className={cn(wordmarkVariants({ size }), className)}\n role=\"img\"\n aria-label={ariaLabel}\n data-slot=\"wordmark\"\n {...props}\n >\n <Logo data-slot=\"wordmark-logo\" aria-hidden className={cn(logoSizeClass[size ?? \"md\"], \"shrink-0\")} />\n <span className={cn(labelVariants({ size }))} aria-hidden>\n {text}\n </span>\n </div>\n );\n}\n\nexport { Wordmark, wordmarkVariants };\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmEI;AAhEJ,sCAAuC;AAEvC,mBAAmB;AACnB,kBAAqB;AAErB,MAAM,uBAAmB,qCAAI,4BAA4B;AAAA,EACvD,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IACN;AAAA,EACF;AAAA,EACA,iBAAiB;AAAA,IACf,MAAM;AAAA,EACR;AACF,CAAC;AAED,MAAM,gBAAgB;AAAA,EACpB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,MAAM,oBAAgB,qCAAI,gDAAgD;AAAA,EACxE,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IACN;AAAA,EACF;AAAA,EACA,iBAAiB;AAAA,IACf,MAAM;AAAA,EACR;AACF,CAAC;AAmBD,SAAS,SAAS;AAAA,EAChB;AAAA,EACA,OAAO;AAAA,EACP,OAAO;AAAA,EACP;AAAA,EACA,GAAG;AACL,GAAkB;AAChB,QAAM,YAAY,SAAS;AAE3B,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAW,iBAAG,iBAAiB,EAAE,KAAK,CAAC,GAAG,SAAS;AAAA,MACnD,MAAK;AAAA,MACL,cAAY;AAAA,MACZ,aAAU;AAAA,MACT,GAAG;AAAA,MAEJ;AAAA,oDAAC,oBAAK,aAAU,iBAAgB,eAAW,MAAC,eAAW,iBAAG,cAAc,QAAQ,IAAI,GAAG,UAAU,GAAG;AAAA,QACpG,4CAAC,UAAK,eAAW,iBAAG,cAAc,EAAE,KAAK,CAAC,CAAC,GAAG,eAAW,MACtD,gBACH;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -6,17 +6,22 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
6
6
|
declare const wordmarkVariants: (props?: ({
|
|
7
7
|
size?: "sm" | "lg" | "md" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
|
-
interface
|
|
9
|
+
interface WordmarkProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
10
10
|
/** Visual scale of the mark and label. */
|
|
11
11
|
size?: VariantProps<typeof wordmarkVariants>["size"];
|
|
12
|
-
/**
|
|
12
|
+
/** Text next to the logo. Defaults to `"Ginia"`. */
|
|
13
|
+
text?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Accessible label for the lockup. Defaults to `text` when omitted
|
|
16
|
+
* (override if the visible text should not be read verbatim).
|
|
17
|
+
*/
|
|
13
18
|
label?: string;
|
|
14
19
|
}
|
|
15
20
|
/**
|
|
16
|
-
* Brand lockup: Ginia logo (mark) plus
|
|
21
|
+
* Brand lockup: Ginia logo (mark) plus a word (default “Ginia”).
|
|
17
22
|
*
|
|
18
23
|
* Use in headers, splash screens, and anywhere the product name should appear with the icon.
|
|
19
24
|
*/
|
|
20
|
-
declare function
|
|
25
|
+
declare function Wordmark({ className, size, text, label, ...props }: WordmarkProps): react_jsx_runtime.JSX.Element;
|
|
21
26
|
|
|
22
|
-
export {
|
|
27
|
+
export { Wordmark, type WordmarkProps, wordmarkVariants };
|