jaci-ui 0.3.0 → 0.4.0
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/CHANGELOG.md +6 -0
- package/README.md +48 -0
- package/dist/components/calendar/calendar.cjs +377 -0
- package/dist/components/calendar/calendar.cjs.map +1 -0
- package/dist/components/calendar/calendar.d.cts +56 -0
- package/dist/components/calendar/calendar.d.ts +56 -0
- package/dist/components/calendar/calendar.js +368 -0
- package/dist/components/calendar/calendar.js.map +1 -0
- package/dist/components/calendar/index.d.cts +2 -0
- package/dist/components/calendar/index.d.ts +2 -0
- package/dist/components/combobox/combobox.cjs +13 -1
- package/dist/components/combobox/combobox.cjs.map +1 -1
- package/dist/components/combobox/combobox.d.cts +7 -2
- package/dist/components/combobox/combobox.d.ts +7 -2
- package/dist/components/combobox/combobox.js +13 -2
- package/dist/components/combobox/combobox.js.map +1 -1
- package/dist/components/combobox/index.d.cts +2 -2
- package/dist/components/combobox/index.d.ts +2 -2
- package/dist/components/controls/input.cjs +26 -5
- package/dist/components/controls/input.cjs.map +1 -1
- package/dist/components/controls/input.d.cts +5 -2
- package/dist/components/controls/input.d.ts +5 -2
- package/dist/components/controls/input.js +28 -7
- package/dist/components/controls/input.js.map +1 -1
- package/dist/components/controls/textarea.cjs +26 -5
- package/dist/components/controls/textarea.cjs.map +1 -1
- package/dist/components/controls/textarea.d.cts +5 -2
- package/dist/components/controls/textarea.d.ts +5 -2
- package/dist/components/controls/textarea.js +28 -7
- package/dist/components/controls/textarea.js.map +1 -1
- package/dist/components/date-picker/date-picker.cjs +9 -9
- package/dist/components/date-picker/date-picker.cjs.map +1 -1
- package/dist/components/date-picker/date-picker.d.cts +3 -1
- package/dist/components/date-picker/date-picker.d.ts +3 -1
- package/dist/components/date-picker/date-picker.js +9 -9
- package/dist/components/date-picker/date-picker.js.map +1 -1
- package/dist/components/date-range-picker/date-range-picker.cjs +589 -0
- package/dist/components/date-range-picker/date-range-picker.cjs.map +1 -0
- package/dist/components/date-range-picker/date-range-picker.d.cts +134 -0
- package/dist/components/date-range-picker/date-range-picker.d.ts +134 -0
- package/dist/components/date-range-picker/date-range-picker.js +568 -0
- package/dist/components/date-range-picker/date-range-picker.js.map +1 -0
- package/dist/components/date-range-picker/index.d.cts +2 -0
- package/dist/components/date-range-picker/index.d.ts +2 -0
- package/dist/components/field/field.cjs +106 -11
- package/dist/components/field/field.cjs.map +1 -1
- package/dist/components/field/field.d.cts +22 -4
- package/dist/components/field/field.d.ts +22 -4
- package/dist/components/field/field.js +107 -13
- package/dist/components/field/field.js.map +1 -1
- package/dist/components/field/index.d.cts +2 -2
- package/dist/components/field/index.d.ts +2 -2
- package/dist/components/pin-input/index.d.cts +2 -0
- package/dist/components/pin-input/index.d.ts +2 -0
- package/dist/components/pin-input/pin-input.cjs +266 -0
- package/dist/components/pin-input/pin-input.cjs.map +1 -0
- package/dist/components/pin-input/pin-input.d.cts +46 -0
- package/dist/components/pin-input/pin-input.d.ts +46 -0
- package/dist/components/pin-input/pin-input.js +258 -0
- package/dist/components/pin-input/pin-input.js.map +1 -0
- package/dist/components/select/index.d.cts +2 -2
- package/dist/components/select/index.d.ts +2 -2
- package/dist/components/select/select.cjs +80 -3
- package/dist/components/select/select.cjs.map +1 -1
- package/dist/components/select/select.d.cts +18 -3
- package/dist/components/select/select.d.ts +18 -3
- package/dist/components/select/select.js +78 -5
- package/dist/components/select/select.js.map +1 -1
- package/dist/components/tags-input/tags-input.cjs +83 -5
- package/dist/components/tags-input/tags-input.cjs.map +1 -1
- package/dist/components/tags-input/tags-input.d.cts +3 -0
- package/dist/components/tags-input/tags-input.d.ts +3 -0
- package/dist/components/tags-input/tags-input.js +83 -5
- package/dist/components/tags-input/tags-input.js.map +1 -1
- package/dist/components/upload/index.d.cts +2 -2
- package/dist/components/upload/index.d.ts +2 -2
- package/dist/components/upload/upload.cjs +90 -10
- package/dist/components/upload/upload.cjs.map +1 -1
- package/dist/components/upload/upload.d.cts +25 -2
- package/dist/components/upload/upload.d.ts +25 -2
- package/dist/components/upload/upload.js +89 -11
- package/dist/components/upload/upload.js.map +1 -1
- package/dist/index.cjs +52 -1
- package/dist/index.d.cts +11 -5
- package/dist/index.d.ts +11 -5
- package/dist/index.js +9 -6
- package/dist/styled-system/recipes/calendar.cjs +43 -0
- package/dist/styled-system/recipes/calendar.cjs.map +1 -0
- package/dist/styled-system/recipes/calendar.js +43 -0
- package/dist/styled-system/recipes/calendar.js.map +1 -0
- package/dist/styled-system/recipes/combobox.cjs +1 -0
- package/dist/styled-system/recipes/combobox.cjs.map +1 -1
- package/dist/styled-system/recipes/combobox.js +1 -0
- package/dist/styled-system/recipes/combobox.js.map +1 -1
- package/dist/styled-system/recipes/date-range-picker.cjs +52 -0
- package/dist/styled-system/recipes/date-range-picker.cjs.map +1 -0
- package/dist/styled-system/recipes/date-range-picker.js +52 -0
- package/dist/styled-system/recipes/date-range-picker.js.map +1 -0
- package/dist/styled-system/recipes/pin-input.cjs +39 -0
- package/dist/styled-system/recipes/pin-input.cjs.map +1 -0
- package/dist/styled-system/recipes/pin-input.js +39 -0
- package/dist/styled-system/recipes/pin-input.js.map +1 -0
- package/dist/styled-system/recipes/select.cjs +5 -1
- package/dist/styled-system/recipes/select.cjs.map +1 -1
- package/dist/styled-system/recipes/select.js +5 -1
- package/dist/styled-system/recipes/select.js.map +1 -1
- package/dist/styled-system/recipes/upload.cjs +2 -0
- package/dist/styled-system/recipes/upload.cjs.map +1 -1
- package/dist/styled-system/recipes/upload.js +2 -0
- package/dist/styled-system/recipes/upload.js.map +1 -1
- package/dist/styles.css +745 -81
- package/package.json +3 -2
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cx } from "../../styled-system/css/cx.js";
|
|
3
|
+
import { calendar } from "../../styled-system/recipes/calendar.js";
|
|
4
|
+
import { addDays, addMonths, createCalendarDate, dateKey, formatMonthLabel, getCalendarDays, getWeekdayLabels, isAfterDay, isBeforeDay, isSameDay, startOfMonth } from "../date-picker/date-utils.js";
|
|
5
|
+
import { createContext, forwardRef, useCallback, useContext, useEffect, useId, useMemo, useRef, useState } from "react";
|
|
6
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/calendar/calendar.tsx
|
|
8
|
+
const CalendarContext = createContext(null);
|
|
9
|
+
function useCalendarContext() {
|
|
10
|
+
const context = useContext(CalendarContext);
|
|
11
|
+
if (!context) throw new Error("Calendar parts must be rendered inside Calendar.Root.");
|
|
12
|
+
return context;
|
|
13
|
+
}
|
|
14
|
+
function sameMonth(left, right) {
|
|
15
|
+
return left.getFullYear() === right.getFullYear() && left.getMonth() === right.getMonth();
|
|
16
|
+
}
|
|
17
|
+
const CalendarRoot = forwardRef(function CalendarRoot({ children, className, defaultValue = null, disabled = false, isDateDisabled, locale = "pt-BR", maxDate, minDate, onValueChange, referenceDate, value: controlledValue, weekStartsOn = 0, yearRange: configuredYearRange, ...props }, ref) {
|
|
18
|
+
const initialDate = controlledValue ?? defaultValue ?? referenceDate ?? /* @__PURE__ */ new Date();
|
|
19
|
+
const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);
|
|
20
|
+
const selected = controlledValue === void 0 ? uncontrolledValue : controlledValue;
|
|
21
|
+
const [month, setMonthState] = useState(() => startOfMonth(initialDate));
|
|
22
|
+
const [focusedDate, setFocusedDate] = useState(selected ?? initialDate);
|
|
23
|
+
const dayRefs = useRef(/* @__PURE__ */ new Map());
|
|
24
|
+
const calendarId = useId();
|
|
25
|
+
const styles = calendar();
|
|
26
|
+
const today = useMemo(() => createCalendarDate((referenceDate ?? /* @__PURE__ */ new Date()).getFullYear(), (referenceDate ?? /* @__PURE__ */ new Date()).getMonth(), (referenceDate ?? /* @__PURE__ */ new Date()).getDate()), [referenceDate]);
|
|
27
|
+
const minMonth = minDate ? startOfMonth(minDate) : void 0;
|
|
28
|
+
const maxMonth = maxDate ? startOfMonth(maxDate) : void 0;
|
|
29
|
+
const yearRange = useMemo(() => {
|
|
30
|
+
const start = configuredYearRange?.start ?? today.getFullYear() - 100;
|
|
31
|
+
const end = configuredYearRange?.end ?? today.getFullYear() + 20;
|
|
32
|
+
const years = [
|
|
33
|
+
selected?.getFullYear(),
|
|
34
|
+
minDate?.getFullYear(),
|
|
35
|
+
maxDate?.getFullYear()
|
|
36
|
+
].filter((year) => year !== void 0);
|
|
37
|
+
return {
|
|
38
|
+
start: Math.min(start, end, ...years),
|
|
39
|
+
end: Math.max(start, end, ...years)
|
|
40
|
+
};
|
|
41
|
+
}, [
|
|
42
|
+
configuredYearRange?.end,
|
|
43
|
+
configuredYearRange?.start,
|
|
44
|
+
maxDate,
|
|
45
|
+
minDate,
|
|
46
|
+
selected,
|
|
47
|
+
today
|
|
48
|
+
]);
|
|
49
|
+
const dateDisabled = useCallback((date) => Boolean(minDate && isBeforeDay(date, minDate) || maxDate && isAfterDay(date, maxDate) || isDateDisabled?.(date)), [
|
|
50
|
+
isDateDisabled,
|
|
51
|
+
maxDate,
|
|
52
|
+
minDate
|
|
53
|
+
]);
|
|
54
|
+
const monthDisabled = useCallback((date) => {
|
|
55
|
+
const first = startOfMonth(date);
|
|
56
|
+
const last = createCalendarDate(date.getFullYear(), date.getMonth() + 1, 0);
|
|
57
|
+
return Boolean(minDate && isBeforeDay(last, minDate) || maxDate && isAfterDay(first, maxDate));
|
|
58
|
+
}, [maxDate, minDate]);
|
|
59
|
+
const clampMonth = useCallback((date) => {
|
|
60
|
+
const normalized = startOfMonth(date);
|
|
61
|
+
if (minMonth && isBeforeDay(normalized, minMonth)) return minMonth;
|
|
62
|
+
if (maxMonth && isAfterDay(normalized, maxMonth)) return maxMonth;
|
|
63
|
+
return normalized;
|
|
64
|
+
}, [maxMonth, minMonth]);
|
|
65
|
+
const setMonth = useCallback((date) => setMonthState(clampMonth(date)), [clampMonth]);
|
|
66
|
+
const canNavigate = useCallback((amount) => {
|
|
67
|
+
const next = addMonths(month, amount);
|
|
68
|
+
return !(minMonth && isBeforeDay(next, minMonth)) && !(maxMonth && isAfterDay(next, maxMonth));
|
|
69
|
+
}, [
|
|
70
|
+
maxMonth,
|
|
71
|
+
minMonth,
|
|
72
|
+
month
|
|
73
|
+
]);
|
|
74
|
+
const setValue = useCallback((nextValue) => {
|
|
75
|
+
if (controlledValue === void 0) setUncontrolledValue(nextValue);
|
|
76
|
+
onValueChange?.(nextValue);
|
|
77
|
+
}, [controlledValue, onValueChange]);
|
|
78
|
+
const onSelect = useCallback((date) => {
|
|
79
|
+
if (disabled || dateDisabled(date)) return;
|
|
80
|
+
const next = createCalendarDate(date.getFullYear(), date.getMonth(), date.getDate());
|
|
81
|
+
setValue(next);
|
|
82
|
+
setFocusedDate(next);
|
|
83
|
+
setMonth(next);
|
|
84
|
+
}, [
|
|
85
|
+
dateDisabled,
|
|
86
|
+
disabled,
|
|
87
|
+
setMonth,
|
|
88
|
+
setValue
|
|
89
|
+
]);
|
|
90
|
+
const focusDate = useCallback((date, direction = 1) => {
|
|
91
|
+
let next = createCalendarDate(date.getFullYear(), date.getMonth(), date.getDate());
|
|
92
|
+
const step = direction < 0 ? -1 : 1;
|
|
93
|
+
let attempts = 0;
|
|
94
|
+
while (dateDisabled(next) && attempts < 366) {
|
|
95
|
+
next = addDays(next, step);
|
|
96
|
+
attempts += 1;
|
|
97
|
+
}
|
|
98
|
+
setFocusedDate(next);
|
|
99
|
+
setMonth(next);
|
|
100
|
+
const focusTarget = () => dayRefs.current.get(dateKey(next))?.focus();
|
|
101
|
+
focusTarget();
|
|
102
|
+
queueMicrotask(focusTarget);
|
|
103
|
+
}, [dateDisabled, setMonth]);
|
|
104
|
+
const selectMonth = useCallback((monthIndex) => setMonth(createCalendarDate(month.getFullYear(), monthIndex, 1)), [month, setMonth]);
|
|
105
|
+
const selectYear = useCallback((year) => setMonth(createCalendarDate(year, month.getMonth(), 1)), [month, setMonth]);
|
|
106
|
+
const registerDay = useCallback((key, node) => {
|
|
107
|
+
if (node) dayRefs.current.set(key, node);
|
|
108
|
+
else dayRefs.current.delete(key);
|
|
109
|
+
}, []);
|
|
110
|
+
useEffect(() => {
|
|
111
|
+
if (!selected) return;
|
|
112
|
+
setFocusedDate(selected);
|
|
113
|
+
setMonthState((current) => sameMonth(current, selected) ? current : clampMonth(selected));
|
|
114
|
+
}, [clampMonth, selected]);
|
|
115
|
+
const context = {
|
|
116
|
+
calendarId,
|
|
117
|
+
canNavigate,
|
|
118
|
+
dateDisabled,
|
|
119
|
+
disabled,
|
|
120
|
+
focusedDate,
|
|
121
|
+
focusDate,
|
|
122
|
+
locale,
|
|
123
|
+
month,
|
|
124
|
+
monthDisabled,
|
|
125
|
+
onSelect,
|
|
126
|
+
registerDay,
|
|
127
|
+
selected,
|
|
128
|
+
selectMonth,
|
|
129
|
+
selectYear,
|
|
130
|
+
setMonth,
|
|
131
|
+
styles,
|
|
132
|
+
today,
|
|
133
|
+
weekStartsOn,
|
|
134
|
+
yearRange
|
|
135
|
+
};
|
|
136
|
+
return /* @__PURE__ */ jsx(CalendarContext.Provider, {
|
|
137
|
+
value: context,
|
|
138
|
+
children: /* @__PURE__ */ jsx("section", {
|
|
139
|
+
...props,
|
|
140
|
+
"aria-label": props["aria-label"] ?? formatMonthLabel(month, locale),
|
|
141
|
+
className: cx(styles.root, className),
|
|
142
|
+
"data-jaci-component": "calendar",
|
|
143
|
+
"data-slot": "calendar",
|
|
144
|
+
ref,
|
|
145
|
+
children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(CalendarHeader, { children: [
|
|
146
|
+
/* @__PURE__ */ jsx(CalendarPrevious, {}),
|
|
147
|
+
/* @__PURE__ */ jsx(CalendarCaption, {}),
|
|
148
|
+
/* @__PURE__ */ jsx(CalendarNext, {})
|
|
149
|
+
] }), /* @__PURE__ */ jsx(CalendarGrid, {})] })
|
|
150
|
+
})
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
const CalendarHeader = forwardRef(function CalendarHeader({ className, ...props }, ref) {
|
|
154
|
+
const { styles } = useCalendarContext();
|
|
155
|
+
return /* @__PURE__ */ jsx("div", {
|
|
156
|
+
...props,
|
|
157
|
+
className: cx(styles.header, className),
|
|
158
|
+
"data-slot": "calendar-header",
|
|
159
|
+
ref
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
const CalendarCaption = forwardRef(function CalendarCaption({ children, className, ...props }, ref) {
|
|
163
|
+
const { locale, month, styles } = useCalendarContext();
|
|
164
|
+
return /* @__PURE__ */ jsx("span", {
|
|
165
|
+
...props,
|
|
166
|
+
className: cx(styles.caption, className),
|
|
167
|
+
"data-slot": "calendar-caption",
|
|
168
|
+
ref,
|
|
169
|
+
children: children ?? formatMonthLabel(month, locale)
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
const CalendarNavigationButton = forwardRef(function CalendarNavigationButton({ amount = 1, children, className, onClick, ...props }, ref) {
|
|
173
|
+
const { canNavigate, month, setMonth, styles } = useCalendarContext();
|
|
174
|
+
const isDisabled = props.disabled || !canNavigate(amount);
|
|
175
|
+
return /* @__PURE__ */ jsx("button", {
|
|
176
|
+
...props,
|
|
177
|
+
"aria-label": props["aria-label"] ?? (amount < 0 ? "Previous month" : "Next month"),
|
|
178
|
+
className: cx(styles.navigation, className),
|
|
179
|
+
"data-slot": amount < 0 ? "calendar-previous" : "calendar-next",
|
|
180
|
+
disabled: isDisabled,
|
|
181
|
+
onClick: (event) => {
|
|
182
|
+
if (!isDisabled) setMonth(addMonths(month, amount));
|
|
183
|
+
onClick?.(event);
|
|
184
|
+
},
|
|
185
|
+
ref,
|
|
186
|
+
type: "button",
|
|
187
|
+
children: children ?? (amount < 0 ? "‹" : "›")
|
|
188
|
+
});
|
|
189
|
+
});
|
|
190
|
+
const CalendarPrevious = forwardRef(function CalendarPrevious(props, ref) {
|
|
191
|
+
return /* @__PURE__ */ jsx(CalendarNavigationButton, {
|
|
192
|
+
...props,
|
|
193
|
+
amount: -1,
|
|
194
|
+
ref
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
const CalendarNext = forwardRef(function CalendarNext(props, ref) {
|
|
198
|
+
return /* @__PURE__ */ jsx(CalendarNavigationButton, {
|
|
199
|
+
...props,
|
|
200
|
+
amount: 1,
|
|
201
|
+
ref
|
|
202
|
+
});
|
|
203
|
+
});
|
|
204
|
+
const CalendarMonthSelect = forwardRef(function CalendarMonthSelect({ className, ...props }, ref) {
|
|
205
|
+
const { locale, month, monthDisabled, selectMonth, styles } = useCalendarContext();
|
|
206
|
+
const labels = Array.from({ length: 12 }, (_, index) => new Intl.DateTimeFormat(locale, { month: "long" }).format(createCalendarDate(2024, index, 1)));
|
|
207
|
+
return /* @__PURE__ */ jsx("select", {
|
|
208
|
+
...props,
|
|
209
|
+
"aria-label": props["aria-label"] ?? "Select month",
|
|
210
|
+
className: cx(styles.monthSelect, className),
|
|
211
|
+
"data-slot": "calendar-month-select",
|
|
212
|
+
onChange: (event) => selectMonth(Number(event.currentTarget.value)),
|
|
213
|
+
ref,
|
|
214
|
+
value: month.getMonth(),
|
|
215
|
+
children: labels.map((label, index) => /* @__PURE__ */ jsx("option", {
|
|
216
|
+
disabled: monthDisabled(createCalendarDate(month.getFullYear(), index, 1)),
|
|
217
|
+
value: index,
|
|
218
|
+
children: label
|
|
219
|
+
}, label))
|
|
220
|
+
});
|
|
221
|
+
});
|
|
222
|
+
const CalendarYearSelect = forwardRef(function CalendarYearSelect({ className, ...props }, ref) {
|
|
223
|
+
const { month, monthDisabled, selectYear, styles, yearRange } = useCalendarContext();
|
|
224
|
+
const years = Array.from({ length: yearRange.end - yearRange.start + 1 }, (_, index) => yearRange.start + index);
|
|
225
|
+
return /* @__PURE__ */ jsx("select", {
|
|
226
|
+
...props,
|
|
227
|
+
"aria-label": props["aria-label"] ?? "Select year",
|
|
228
|
+
className: cx(styles.yearSelect, className),
|
|
229
|
+
"data-slot": "calendar-year-select",
|
|
230
|
+
onChange: (event) => selectYear(Number(event.currentTarget.value)),
|
|
231
|
+
ref,
|
|
232
|
+
value: month.getFullYear(),
|
|
233
|
+
children: years.map((year) => /* @__PURE__ */ jsx("option", {
|
|
234
|
+
disabled: monthDisabled(createCalendarDate(year, month.getMonth(), 1)),
|
|
235
|
+
value: year,
|
|
236
|
+
children: year
|
|
237
|
+
}, year))
|
|
238
|
+
});
|
|
239
|
+
});
|
|
240
|
+
const CalendarDay = forwardRef(function CalendarDay({ children, className, date, disabled, onClick, onKeyDown, ...props }, ref) {
|
|
241
|
+
const { dateDisabled, disabled: calendarDisabled, focusDate, focusedDate, locale, month, onSelect, registerDay, selected, styles, today, weekStartsOn } = useCalendarContext();
|
|
242
|
+
const key = dateKey(date);
|
|
243
|
+
const outsideMonth = !sameMonth(date, month);
|
|
244
|
+
const isDisabled = Boolean(disabled || calendarDisabled || dateDisabled(date));
|
|
245
|
+
const isSelected = isSameDay(date, selected);
|
|
246
|
+
const isFocused = isSameDay(date, focusedDate);
|
|
247
|
+
const isToday = isSameDay(date, today);
|
|
248
|
+
return /* @__PURE__ */ jsx("button", {
|
|
249
|
+
...props,
|
|
250
|
+
"aria-label": props["aria-label"] ?? new Intl.DateTimeFormat(locale, { dateStyle: "full" }).format(date),
|
|
251
|
+
"aria-current": isToday ? "date" : void 0,
|
|
252
|
+
"aria-selected": isSelected,
|
|
253
|
+
className: cx(styles.day, className),
|
|
254
|
+
"data-date": key,
|
|
255
|
+
"data-disabled": isDisabled || void 0,
|
|
256
|
+
"data-outside-month": outsideMonth || void 0,
|
|
257
|
+
"data-selected": isSelected || void 0,
|
|
258
|
+
"data-slot": "calendar-day",
|
|
259
|
+
"data-today": isToday || void 0,
|
|
260
|
+
disabled: isDisabled,
|
|
261
|
+
onClick: (event) => {
|
|
262
|
+
onSelect(date);
|
|
263
|
+
onClick?.(event);
|
|
264
|
+
},
|
|
265
|
+
onKeyDown: (event) => {
|
|
266
|
+
if (!event.defaultPrevented) {
|
|
267
|
+
let nextDate;
|
|
268
|
+
switch (event.key) {
|
|
269
|
+
case "ArrowLeft":
|
|
270
|
+
nextDate = addDays(date, -1);
|
|
271
|
+
break;
|
|
272
|
+
case "ArrowRight":
|
|
273
|
+
nextDate = addDays(date, 1);
|
|
274
|
+
break;
|
|
275
|
+
case "ArrowUp":
|
|
276
|
+
nextDate = addDays(date, -7);
|
|
277
|
+
break;
|
|
278
|
+
case "ArrowDown":
|
|
279
|
+
nextDate = addDays(date, 7);
|
|
280
|
+
break;
|
|
281
|
+
case "Home":
|
|
282
|
+
nextDate = addDays(date, -((date.getDay() - weekStartsOn + 7) % 7));
|
|
283
|
+
break;
|
|
284
|
+
case "End":
|
|
285
|
+
nextDate = addDays(date, 6 - (date.getDay() - weekStartsOn + 7) % 7);
|
|
286
|
+
break;
|
|
287
|
+
case "PageUp":
|
|
288
|
+
nextDate = addMonths(date, event.shiftKey ? -12 : -1);
|
|
289
|
+
break;
|
|
290
|
+
case "PageDown":
|
|
291
|
+
nextDate = addMonths(date, event.shiftKey ? 12 : 1);
|
|
292
|
+
break;
|
|
293
|
+
case "Enter":
|
|
294
|
+
case " ":
|
|
295
|
+
if (!isDisabled) {
|
|
296
|
+
event.preventDefault();
|
|
297
|
+
onSelect(date);
|
|
298
|
+
}
|
|
299
|
+
break;
|
|
300
|
+
}
|
|
301
|
+
if (nextDate) {
|
|
302
|
+
event.preventDefault();
|
|
303
|
+
focusDate(nextDate, nextDate < date ? -1 : 1);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
onKeyDown?.(event);
|
|
307
|
+
},
|
|
308
|
+
ref: (node) => {
|
|
309
|
+
registerDay(key, node);
|
|
310
|
+
if (typeof ref === "function") ref(node);
|
|
311
|
+
else if (ref) ref.current = node;
|
|
312
|
+
},
|
|
313
|
+
role: "gridcell",
|
|
314
|
+
tabIndex: isFocused && !isDisabled ? 0 : -1,
|
|
315
|
+
type: "button",
|
|
316
|
+
children: children ?? date.getDate()
|
|
317
|
+
});
|
|
318
|
+
});
|
|
319
|
+
const CalendarGrid = forwardRef(function CalendarGrid({ "aria-label": ariaLabel, className, ...props }, ref) {
|
|
320
|
+
const { locale, month, styles, weekStartsOn } = useCalendarContext();
|
|
321
|
+
const days = useMemo(() => getCalendarDays(month, weekStartsOn), [month, weekStartsOn]);
|
|
322
|
+
const weeks = useMemo(() => Array.from({ length: Math.ceil(days.length / 7) }, (_, index) => days.slice(index * 7, index * 7 + 7)), [days]);
|
|
323
|
+
const weekdays = useMemo(() => getWeekdayLabels(locale, weekStartsOn), [locale, weekStartsOn]);
|
|
324
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
325
|
+
...props,
|
|
326
|
+
className: cx(styles.calendar, className),
|
|
327
|
+
"data-slot": "calendar-grid",
|
|
328
|
+
ref,
|
|
329
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
330
|
+
"aria-hidden": "true",
|
|
331
|
+
className: styles.weekdays,
|
|
332
|
+
"data-slot": "calendar-weekdays",
|
|
333
|
+
children: weekdays.map((weekday) => /* @__PURE__ */ jsx("span", {
|
|
334
|
+
className: styles.weekday,
|
|
335
|
+
"data-slot": "calendar-weekday",
|
|
336
|
+
children: weekday
|
|
337
|
+
}, weekday))
|
|
338
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
339
|
+
"aria-label": ariaLabel ?? formatMonthLabel(month, locale),
|
|
340
|
+
className: styles.grid,
|
|
341
|
+
"data-slot": "calendar-day-grid",
|
|
342
|
+
role: "grid",
|
|
343
|
+
children: weeks.map((week, index) => /* @__PURE__ */ jsx("div", {
|
|
344
|
+
"aria-rowindex": index + 1,
|
|
345
|
+
className: styles.row,
|
|
346
|
+
"data-slot": "calendar-week",
|
|
347
|
+
role: "row",
|
|
348
|
+
tabIndex: -1,
|
|
349
|
+
children: week.map((date) => /* @__PURE__ */ jsx(CalendarDay, { date }, dateKey(date)))
|
|
350
|
+
}, week.map(dateKey).join("-")))
|
|
351
|
+
})]
|
|
352
|
+
});
|
|
353
|
+
});
|
|
354
|
+
const Calendar = {
|
|
355
|
+
Root: CalendarRoot,
|
|
356
|
+
Header: CalendarHeader,
|
|
357
|
+
Caption: CalendarCaption,
|
|
358
|
+
Previous: CalendarPrevious,
|
|
359
|
+
Next: CalendarNext,
|
|
360
|
+
MonthSelect: CalendarMonthSelect,
|
|
361
|
+
YearSelect: CalendarYearSelect,
|
|
362
|
+
Grid: CalendarGrid,
|
|
363
|
+
Day: CalendarDay
|
|
364
|
+
};
|
|
365
|
+
//#endregion
|
|
366
|
+
export { Calendar, CalendarCaption, CalendarDay, CalendarGrid, CalendarHeader, CalendarMonthSelect, CalendarNext, CalendarPrevious, CalendarRoot, CalendarYearSelect };
|
|
367
|
+
|
|
368
|
+
//# sourceMappingURL=calendar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar.js","names":[],"sources":["../../../src/components/calendar/calendar.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef, useCallback, useEffect, useId, useMemo, useRef, useState } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { calendar } from \"../../styled-system/recipes\";\nimport {\n addDays,\n addMonths,\n createCalendarDate,\n dateKey,\n formatMonthLabel,\n getCalendarDays,\n getWeekdayLabels,\n isAfterDay,\n isBeforeDay,\n isSameDay,\n startOfMonth,\n} from \"../date-picker/date-utils\";\n\nexport interface CalendarYearRange {\n start: number;\n end: number;\n}\n\nexport interface CalendarRootProps\n extends Omit<ComponentPropsWithoutRef<\"section\">, \"children\" | \"defaultValue\" | \"value\"> {\n value?: Date | null;\n defaultValue?: Date | null;\n onValueChange?: (value: Date | null) => void;\n referenceDate?: Date;\n locale?: string;\n weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;\n minDate?: Date;\n maxDate?: Date;\n isDateDisabled?: (date: Date) => boolean;\n yearRange?: CalendarYearRange;\n disabled?: boolean;\n children?: ReactNode;\n}\n\ninterface CalendarContextValue {\n calendarId: string;\n dateDisabled: (date: Date) => boolean;\n disabled: boolean;\n focusedDate: Date;\n focusDate: (date: Date, direction?: number) => void;\n locale: string;\n month: Date;\n monthDisabled: (date: Date) => boolean;\n onSelect: (date: Date) => void;\n selected: Date | null;\n setMonth: (date: Date) => void;\n styles: ReturnType<typeof calendar>;\n today: Date;\n weekStartsOn: number;\n yearRange: CalendarYearRange;\n canNavigate: (amount: number) => boolean;\n selectMonth: (month: number) => void;\n selectYear: (year: number) => void;\n registerDay: (key: string, node: HTMLButtonElement | null) => void;\n}\n\nimport { createContext, useContext } from \"react\";\n\nconst CalendarContext = createContext<CalendarContextValue | null>(null);\n\nfunction useCalendarContext() {\n const context = useContext(CalendarContext);\n if (!context) throw new Error(\"Calendar parts must be rendered inside Calendar.Root.\");\n return context;\n}\n\nfunction sameMonth(left: Date, right: Date) {\n return left.getFullYear() === right.getFullYear() && left.getMonth() === right.getMonth();\n}\n\nexport const CalendarRoot = forwardRef<HTMLElement, CalendarRootProps>(function CalendarRoot(\n {\n children,\n className,\n defaultValue = null,\n disabled = false,\n isDateDisabled,\n locale = \"pt-BR\",\n maxDate,\n minDate,\n onValueChange,\n referenceDate,\n value: controlledValue,\n weekStartsOn = 0,\n yearRange: configuredYearRange,\n ...props\n },\n ref,\n) {\n const initialDate = controlledValue ?? defaultValue ?? referenceDate ?? new Date();\n const [uncontrolledValue, setUncontrolledValue] = useState<Date | null>(defaultValue);\n const selected = controlledValue === undefined ? uncontrolledValue : controlledValue;\n const [month, setMonthState] = useState(() => startOfMonth(initialDate));\n const [focusedDate, setFocusedDate] = useState(selected ?? initialDate);\n const dayRefs = useRef(new Map<string, HTMLButtonElement>());\n const calendarId = useId();\n const styles = calendar();\n const today = useMemo(\n () =>\n createCalendarDate(\n (referenceDate ?? new Date()).getFullYear(),\n (referenceDate ?? new Date()).getMonth(),\n (referenceDate ?? new Date()).getDate(),\n ),\n [referenceDate],\n );\n const minMonth = minDate ? startOfMonth(minDate) : undefined;\n const maxMonth = maxDate ? startOfMonth(maxDate) : undefined;\n const yearRange = useMemo(() => {\n const start = configuredYearRange?.start ?? today.getFullYear() - 100;\n const end = configuredYearRange?.end ?? today.getFullYear() + 20;\n const years = [selected?.getFullYear(), minDate?.getFullYear(), maxDate?.getFullYear()].filter(\n (year): year is number => year !== undefined,\n );\n return { start: Math.min(start, end, ...years), end: Math.max(start, end, ...years) };\n }, [configuredYearRange?.end, configuredYearRange?.start, maxDate, minDate, selected, today]);\n\n const dateDisabled = useCallback(\n (date: Date) =>\n Boolean(\n (minDate && isBeforeDay(date, minDate)) ||\n (maxDate && isAfterDay(date, maxDate)) ||\n isDateDisabled?.(date),\n ),\n [isDateDisabled, maxDate, minDate],\n );\n const monthDisabled = useCallback(\n (date: Date) => {\n const first = startOfMonth(date);\n const last = createCalendarDate(date.getFullYear(), date.getMonth() + 1, 0);\n return Boolean(\n (minDate && isBeforeDay(last, minDate)) || (maxDate && isAfterDay(first, maxDate)),\n );\n },\n [maxDate, minDate],\n );\n const clampMonth = useCallback(\n (date: Date) => {\n const normalized = startOfMonth(date);\n if (minMonth && isBeforeDay(normalized, minMonth)) return minMonth;\n if (maxMonth && isAfterDay(normalized, maxMonth)) return maxMonth;\n return normalized;\n },\n [maxMonth, minMonth],\n );\n const setMonth = useCallback((date: Date) => setMonthState(clampMonth(date)), [clampMonth]);\n const canNavigate = useCallback(\n (amount: number) => {\n const next = addMonths(month, amount);\n return (\n !(minMonth && isBeforeDay(next, minMonth)) && !(maxMonth && isAfterDay(next, maxMonth))\n );\n },\n [maxMonth, minMonth, month],\n );\n const setValue = useCallback(\n (nextValue: Date | null) => {\n if (controlledValue === undefined) setUncontrolledValue(nextValue);\n onValueChange?.(nextValue);\n },\n [controlledValue, onValueChange],\n );\n const onSelect = useCallback(\n (date: Date) => {\n if (disabled || dateDisabled(date)) return;\n const next = createCalendarDate(date.getFullYear(), date.getMonth(), date.getDate());\n setValue(next);\n setFocusedDate(next);\n setMonth(next);\n },\n [dateDisabled, disabled, setMonth, setValue],\n );\n const focusDate = useCallback(\n (date: Date, direction = 1) => {\n let next = createCalendarDate(date.getFullYear(), date.getMonth(), date.getDate());\n const step = direction < 0 ? -1 : 1;\n let attempts = 0;\n while (dateDisabled(next) && attempts < 366) {\n next = addDays(next, step);\n attempts += 1;\n }\n setFocusedDate(next);\n setMonth(next);\n const focusTarget = () => dayRefs.current.get(dateKey(next))?.focus();\n focusTarget();\n queueMicrotask(focusTarget);\n },\n [dateDisabled, setMonth],\n );\n const selectMonth = useCallback(\n (monthIndex: number) => setMonth(createCalendarDate(month.getFullYear(), monthIndex, 1)),\n [month, setMonth],\n );\n const selectYear = useCallback(\n (year: number) => setMonth(createCalendarDate(year, month.getMonth(), 1)),\n [month, setMonth],\n );\n const registerDay = useCallback((key: string, node: HTMLButtonElement | null) => {\n if (node) dayRefs.current.set(key, node);\n else dayRefs.current.delete(key);\n }, []);\n\n useEffect(() => {\n if (!selected) return;\n setFocusedDate(selected);\n setMonthState((current) => (sameMonth(current, selected) ? current : clampMonth(selected)));\n }, [clampMonth, selected]);\n\n const context: CalendarContextValue = {\n calendarId,\n canNavigate,\n dateDisabled,\n disabled,\n focusedDate,\n focusDate,\n locale,\n month,\n monthDisabled,\n onSelect,\n registerDay,\n selected,\n selectMonth,\n selectYear,\n setMonth,\n styles,\n today,\n weekStartsOn,\n yearRange,\n };\n\n return (\n <CalendarContext.Provider value={context}>\n <section\n {...props}\n aria-label={props[\"aria-label\"] ?? formatMonthLabel(month, locale)}\n className={cx(styles.root, className)}\n data-jaci-component=\"calendar\"\n data-slot=\"calendar\"\n ref={ref}\n >\n {children ?? (\n <>\n <CalendarHeader>\n <CalendarPrevious />\n <CalendarCaption />\n <CalendarNext />\n </CalendarHeader>\n <CalendarGrid />\n </>\n )}\n </section>\n </CalendarContext.Provider>\n );\n});\n\nexport type CalendarHeaderProps = ComponentPropsWithoutRef<\"div\">;\nexport const CalendarHeader = forwardRef<HTMLDivElement, CalendarHeaderProps>(\n function CalendarHeader({ className, ...props }, ref) {\n const { styles } = useCalendarContext();\n return (\n <div\n {...props}\n className={cx(styles.header, className)}\n data-slot=\"calendar-header\"\n ref={ref}\n />\n );\n },\n);\n\nexport type CalendarCaptionProps = ComponentPropsWithoutRef<\"span\">;\nexport const CalendarCaption = forwardRef<HTMLSpanElement, CalendarCaptionProps>(\n function CalendarCaption({ children, className, ...props }, ref) {\n const { locale, month, styles } = useCalendarContext();\n return (\n <span\n {...props}\n className={cx(styles.caption, className)}\n data-slot=\"calendar-caption\"\n ref={ref}\n >\n {children ?? formatMonthLabel(month, locale)}\n </span>\n );\n },\n);\n\nexport interface CalendarNavigationProps extends ComponentPropsWithoutRef<\"button\"> {\n amount?: number;\n}\n\nconst CalendarNavigationButton = forwardRef<HTMLButtonElement, CalendarNavigationProps>(\n function CalendarNavigationButton({ amount = 1, children, className, onClick, ...props }, ref) {\n const { canNavigate, month, setMonth, styles } = useCalendarContext();\n const isDisabled = props.disabled || !canNavigate(amount);\n return (\n <button\n {...props}\n aria-label={props[\"aria-label\"] ?? (amount < 0 ? \"Previous month\" : \"Next month\")}\n className={cx(styles.navigation, className)}\n data-slot={amount < 0 ? \"calendar-previous\" : \"calendar-next\"}\n disabled={isDisabled}\n onClick={(event) => {\n if (!isDisabled) setMonth(addMonths(month, amount));\n onClick?.(event);\n }}\n ref={ref}\n type=\"button\"\n >\n {children ?? (amount < 0 ? \"‹\" : \"›\")}\n </button>\n );\n },\n);\n\nexport const CalendarPrevious = forwardRef<HTMLButtonElement, CalendarNavigationProps>(\n function CalendarPrevious(props, ref) {\n return <CalendarNavigationButton {...props} amount={-1} ref={ref} />;\n },\n);\nexport const CalendarNext = forwardRef<HTMLButtonElement, CalendarNavigationProps>(\n function CalendarNext(props, ref) {\n return <CalendarNavigationButton {...props} amount={1} ref={ref} />;\n },\n);\n\nexport type CalendarMonthSelectProps = Omit<\n ComponentPropsWithoutRef<\"select\">,\n \"children\" | \"onChange\" | \"value\"\n>;\nexport const CalendarMonthSelect = forwardRef<HTMLSelectElement, CalendarMonthSelectProps>(\n function CalendarMonthSelect({ className, ...props }, ref) {\n const { locale, month, monthDisabled, selectMonth, styles } = useCalendarContext();\n const labels = Array.from({ length: 12 }, (_, index) =>\n new Intl.DateTimeFormat(locale, { month: \"long\" }).format(createCalendarDate(2024, index, 1)),\n );\n return (\n <select\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Select month\"}\n className={cx(styles.monthSelect, className)}\n data-slot=\"calendar-month-select\"\n onChange={(event) => selectMonth(Number(event.currentTarget.value))}\n ref={ref}\n value={month.getMonth()}\n >\n {labels.map((label, index) => (\n <option\n disabled={monthDisabled(createCalendarDate(month.getFullYear(), index, 1))}\n key={label}\n value={index}\n >\n {label}\n </option>\n ))}\n </select>\n );\n },\n);\n\nexport type CalendarYearSelectProps = Omit<\n ComponentPropsWithoutRef<\"select\">,\n \"children\" | \"onChange\" | \"value\"\n>;\nexport const CalendarYearSelect = forwardRef<HTMLSelectElement, CalendarYearSelectProps>(\n function CalendarYearSelect({ className, ...props }, ref) {\n const { month, monthDisabled, selectYear, styles, yearRange } = useCalendarContext();\n const years = Array.from(\n { length: yearRange.end - yearRange.start + 1 },\n (_, index) => yearRange.start + index,\n );\n return (\n <select\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Select year\"}\n className={cx(styles.yearSelect, className)}\n data-slot=\"calendar-year-select\"\n onChange={(event) => selectYear(Number(event.currentTarget.value))}\n ref={ref}\n value={month.getFullYear()}\n >\n {years.map((year) => (\n <option\n disabled={monthDisabled(createCalendarDate(year, month.getMonth(), 1))}\n key={year}\n value={year}\n >\n {year}\n </option>\n ))}\n </select>\n );\n },\n);\n\nexport interface CalendarDayProps extends Omit<ComponentPropsWithoutRef<\"button\">, \"value\"> {\n date: Date;\n}\n\nexport const CalendarDay = forwardRef<HTMLButtonElement, CalendarDayProps>(function CalendarDay(\n { children, className, date, disabled, onClick, onKeyDown, ...props },\n ref,\n) {\n const {\n dateDisabled,\n disabled: calendarDisabled,\n focusDate,\n focusedDate,\n locale,\n month,\n onSelect,\n registerDay,\n selected,\n styles,\n today,\n weekStartsOn,\n } = useCalendarContext();\n const key = dateKey(date);\n const outsideMonth = !sameMonth(date, month);\n const isDisabled = Boolean(disabled || calendarDisabled || dateDisabled(date));\n const isSelected = isSameDay(date, selected);\n const isFocused = isSameDay(date, focusedDate);\n const isToday = isSameDay(date, today);\n return (\n // biome-ignore lint/a11y/useSemanticElements: the roving button is the interactive grid cell.\n <button\n {...props}\n aria-label={\n props[\"aria-label\"] ?? new Intl.DateTimeFormat(locale, { dateStyle: \"full\" }).format(date)\n }\n aria-current={isToday ? \"date\" : undefined}\n aria-selected={isSelected}\n className={cx(styles.day, className)}\n data-date={key}\n data-disabled={isDisabled || undefined}\n data-outside-month={outsideMonth || undefined}\n data-selected={isSelected || undefined}\n data-slot=\"calendar-day\"\n data-today={isToday || undefined}\n disabled={isDisabled}\n onClick={(event) => {\n onSelect(date);\n onClick?.(event);\n }}\n onKeyDown={(event) => {\n if (!event.defaultPrevented) {\n let nextDate: Date | undefined;\n switch (event.key) {\n case \"ArrowLeft\":\n nextDate = addDays(date, -1);\n break;\n case \"ArrowRight\":\n nextDate = addDays(date, 1);\n break;\n case \"ArrowUp\":\n nextDate = addDays(date, -7);\n break;\n case \"ArrowDown\":\n nextDate = addDays(date, 7);\n break;\n case \"Home\":\n nextDate = addDays(date, -((date.getDay() - weekStartsOn + 7) % 7));\n break;\n case \"End\":\n nextDate = addDays(date, 6 - ((date.getDay() - weekStartsOn + 7) % 7));\n break;\n case \"PageUp\":\n nextDate = addMonths(date, event.shiftKey ? -12 : -1);\n break;\n case \"PageDown\":\n nextDate = addMonths(date, event.shiftKey ? 12 : 1);\n break;\n case \"Enter\":\n case \" \":\n if (!isDisabled) {\n event.preventDefault();\n onSelect(date);\n }\n break;\n }\n if (nextDate) {\n event.preventDefault();\n focusDate(nextDate, nextDate < date ? -1 : 1);\n }\n }\n onKeyDown?.(event);\n }}\n ref={(node) => {\n registerDay(key, node);\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n }}\n role=\"gridcell\"\n tabIndex={isFocused && !isDisabled ? 0 : -1}\n type=\"button\"\n >\n {children ?? date.getDate()}\n </button>\n );\n});\n\nexport interface CalendarGridProps extends Omit<ComponentPropsWithoutRef<\"div\">, \"children\"> {\n \"aria-label\"?: string;\n}\n\nexport const CalendarGrid = forwardRef<HTMLDivElement, CalendarGridProps>(function CalendarGrid(\n { \"aria-label\": ariaLabel, className, ...props },\n ref,\n) {\n const { locale, month, styles, weekStartsOn } = useCalendarContext();\n const days = useMemo(() => getCalendarDays(month, weekStartsOn), [month, weekStartsOn]);\n const weeks = useMemo(\n () =>\n Array.from({ length: Math.ceil(days.length / 7) }, (_, index) =>\n days.slice(index * 7, index * 7 + 7),\n ),\n [days],\n );\n const weekdays = useMemo(() => getWeekdayLabels(locale, weekStartsOn), [locale, weekStartsOn]);\n return (\n <div {...props} className={cx(styles.calendar, className)} data-slot=\"calendar-grid\" ref={ref}>\n <div aria-hidden=\"true\" className={styles.weekdays} data-slot=\"calendar-weekdays\">\n {weekdays.map((weekday) => (\n <span className={styles.weekday} data-slot=\"calendar-weekday\" key={weekday}>\n {weekday}\n </span>\n ))}\n </div>\n {/* biome-ignore lint/a11y/useSemanticElements: the calendar uses the ARIA grid pattern. */}\n <div\n aria-label={ariaLabel ?? formatMonthLabel(month, locale)}\n className={styles.grid}\n data-slot=\"calendar-day-grid\"\n role=\"grid\"\n >\n {weeks.map((week, index) => (\n // biome-ignore lint/a11y/useSemanticElements: Calendar rows use ARIA grid semantics while the day controls remain buttons.\n <div\n aria-rowindex={index + 1}\n className={styles.row}\n data-slot=\"calendar-week\"\n key={week.map(dateKey).join(\"-\")}\n role=\"row\"\n tabIndex={-1}\n >\n {week.map((date) => (\n <CalendarDay date={date} key={dateKey(date)} />\n ))}\n </div>\n ))}\n </div>\n </div>\n );\n});\n\nexport const Calendar = {\n Root: CalendarRoot,\n Header: CalendarHeader,\n Caption: CalendarCaption,\n Previous: CalendarPrevious,\n Next: CalendarNext,\n MonthSelect: CalendarMonthSelect,\n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C,KAAK,GAAG,CAO5B,CACN;EACE,CAAA,CACF;;AAET,CAAC;AAED,MAAa,WAAW;CACtB,MAAM;CACN,QAAQ;CACR,SAAS;CACT,UAAU;CACV,MAAM;CACN,aAAa;CACb,YAAY;CACZ,MAAM;CACN,KAAK;AACP"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { Calendar, CalendarCaption, CalendarCaptionProps, CalendarDay, CalendarDayProps, CalendarGrid, CalendarGridProps, CalendarHeader, CalendarHeaderProps, CalendarMonthSelect, CalendarMonthSelectProps, CalendarNavigationProps, CalendarNext, CalendarPrevious, CalendarRoot, CalendarRootProps, CalendarYearRange, CalendarYearSelect, CalendarYearSelectProps } from "./calendar.cjs";
|
|
2
|
+
export { Calendar, CalendarCaption, type CalendarCaptionProps, CalendarDay, type CalendarDayProps, CalendarGrid, type CalendarGridProps, CalendarHeader, type CalendarHeaderProps, CalendarMonthSelect, type CalendarMonthSelectProps, type CalendarNavigationProps, CalendarNext, CalendarPrevious, CalendarRoot, type CalendarRootProps, type CalendarYearRange, CalendarYearSelect, type CalendarYearSelectProps };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { Calendar, CalendarCaption, CalendarCaptionProps, CalendarDay, CalendarDayProps, CalendarGrid, CalendarGridProps, CalendarHeader, CalendarHeaderProps, CalendarMonthSelect, CalendarMonthSelectProps, CalendarNavigationProps, CalendarNext, CalendarPrevious, CalendarRoot, CalendarRootProps, CalendarYearRange, CalendarYearSelect, CalendarYearSelectProps } from "./calendar.js";
|
|
2
|
+
export { Calendar, CalendarCaption, type CalendarCaptionProps, CalendarDay, type CalendarDayProps, CalendarGrid, type CalendarGridProps, CalendarHeader, type CalendarHeaderProps, CalendarMonthSelect, type CalendarMonthSelectProps, type CalendarNavigationProps, CalendarNext, CalendarPrevious, CalendarRoot, type CalendarRootProps, type CalendarYearRange, CalendarYearSelect, type CalendarYearSelectProps };
|
|
@@ -17,7 +17,7 @@ function useComboboxStyles() {
|
|
|
17
17
|
* controlled `value`/`onValueChange` and uncontrolled `defaultValue` APIs,
|
|
18
18
|
* object values, grouped items, filtering and multiple selection.
|
|
19
19
|
*/
|
|
20
|
-
function ComboboxRoot({ children, className, errors, invalid, name, size = "md", ...props }) {
|
|
20
|
+
function ComboboxRoot({ children, className, errors, invalid, loading: _loading, name, size = "md", ...props }) {
|
|
21
21
|
const fieldProps = {
|
|
22
22
|
className: require_cx.cx(require_combobox.combobox({ size }).root, className),
|
|
23
23
|
...errors === void 0 ? {} : { errors },
|
|
@@ -155,6 +155,16 @@ const ComboboxClear = (0, react.forwardRef)(function ComboboxClear({ children =
|
|
|
155
155
|
children
|
|
156
156
|
});
|
|
157
157
|
});
|
|
158
|
+
const ComboboxLoading = (0, react.forwardRef)(function ComboboxLoading({ children = "Loading…", className, ...props }, ref) {
|
|
159
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
160
|
+
...props,
|
|
161
|
+
ref,
|
|
162
|
+
"aria-live": "polite",
|
|
163
|
+
className: require_cx.cx(useComboboxStyles().loading, className),
|
|
164
|
+
"data-slot": "combobox-loading",
|
|
165
|
+
children
|
|
166
|
+
});
|
|
167
|
+
});
|
|
158
168
|
const ComboboxStatus = (0, react.forwardRef)(function ComboboxStatus({ className, ...props }, ref) {
|
|
159
169
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_combobox.Combobox.Status, {
|
|
160
170
|
...props,
|
|
@@ -188,6 +198,7 @@ const Combobox = {
|
|
|
188
198
|
Group: ComboboxGroup,
|
|
189
199
|
GroupLabel: ComboboxGroupLabel,
|
|
190
200
|
Empty: ComboboxEmpty,
|
|
201
|
+
Loading: ComboboxLoading,
|
|
191
202
|
Clear: ComboboxClear,
|
|
192
203
|
Status: ComboboxStatus,
|
|
193
204
|
Arrow: ComboboxArrow,
|
|
@@ -207,6 +218,7 @@ exports.ComboboxItem = ComboboxItem;
|
|
|
207
218
|
exports.ComboboxItemIndicator = ComboboxItemIndicator;
|
|
208
219
|
exports.ComboboxLabel = ComboboxLabel;
|
|
209
220
|
exports.ComboboxList = ComboboxList;
|
|
221
|
+
exports.ComboboxLoading = ComboboxLoading;
|
|
210
222
|
exports.ComboboxPopup = ComboboxPopup;
|
|
211
223
|
exports.ComboboxPortal = ComboboxPortal;
|
|
212
224
|
exports.ComboboxPositioner = ComboboxPositioner;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox.cjs","names":["combobox","cx","Field","BaseCombobox","BaseField","withRecipeClassName"],"sources":["../../../src/components/combobox/combobox.tsx"],"sourcesContent":["\"use client\";\n\nimport { Combobox as BaseCombobox } from \"@base-ui/react/combobox\";\nimport { forwardRef, createContext, useContext } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport type { ComboboxRoot as BaseComboboxRoot } from \"@base-ui/react/combobox\";\nimport { Field as BaseField } from \"@base-ui/react/field\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { combobox } from \"../../styled-system/recipes\";\nimport { Field } from \"../field\";\nimport { withRecipeClassName } from \"../base-ui\";\n\nexport type ComboboxSize = \"sm\" | \"md\" | \"lg\";\n\nconst ComboboxSizeContext = createContext<ComboboxSize>(\"md\");\n\nfunction useComboboxStyles() {\n return combobox({ size: useContext(ComboboxSizeContext) });\n}\n\nexport interface ComboboxRootProps<Value, Multiple extends boolean | undefined = false>\n extends Omit<BaseComboboxRoot.Props<Value, Multiple>, \"children\" | \"className\"> {\n /** Visual size shared by the input and trigger. */\n size?: ComboboxSize;\n /** Marks the field invalid when an external validator owns its state. */\n invalid?: boolean;\n /** Direct error content rendered through the surrounding Field context. */\n errors?: ReactNode | ReactNode[];\n children?: ReactNode;\n className?: string;\n}\n\n/**\n * A searchable Base UI combobox with Field integration. It supports the\n * controlled `value`/`onValueChange` and uncontrolled `defaultValue` APIs,\n * object values, grouped items, filtering and multiple selection.\n */\nexport function ComboboxRoot<Value = string, Multiple extends boolean | undefined = false>({\n children,\n className,\n errors,\n invalid,\n name,\n size = \"md\",\n ...props\n}: ComboboxRootProps<Value, Multiple>) {\n const styles = combobox({ size });\n const fieldProps = {\n className: cx(styles.root, className),\n ...(errors === undefined ? {} : { errors }),\n ...(invalid === undefined ? {} : { invalid }),\n ...(name === undefined ? {} : { name }),\n };\n\n return (\n <ComboboxSizeContext.Provider value={size}>\n <Field {...fieldProps}>\n <BaseCombobox.Root {...props} {...(name === undefined ? {} : { name })}>\n {children}\n </BaseCombobox.Root>\n </Field>\n </ComboboxSizeContext.Provider>\n );\n}\n\nexport type ComboboxLabelProps = ComponentPropsWithoutRef<typeof BaseField.Label>;\n\nexport const ComboboxLabel = forwardRef<HTMLElement, ComboboxLabelProps>(function ComboboxLabel(\n { className, ...props },\n ref,\n) {\n return (\n <BaseField.Label\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().label, className)}\n data-slot=\"combobox-label\"\n />\n );\n});\n\nexport type ComboboxInputGroupProps = ComponentPropsWithoutRef<typeof BaseCombobox.InputGroup>;\n\nexport const ComboboxInputGroup = forwardRef<HTMLDivElement, ComboboxInputGroupProps>(\n function ComboboxInputGroup({ className, ...props }, ref) {\n return (\n <BaseCombobox.InputGroup\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().inputGroup, className)}\n data-slot=\"combobox-input-group\"\n />\n );\n },\n);\n\nexport type ComboboxInputProps = ComponentPropsWithoutRef<typeof BaseCombobox.Input>;\n\nexport const ComboboxInput = forwardRef<HTMLInputElement, ComboboxInputProps>(\n function ComboboxInput({ className, ...props }, ref) {\n return (\n <BaseCombobox.Input\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().input, className)}\n data-jaci-component=\"combobox\"\n data-slot=\"combobox-input\"\n />\n );\n },\n);\n\nexport type ComboboxTriggerProps = ComponentPropsWithoutRef<typeof BaseCombobox.Trigger>;\n\nexport const ComboboxTrigger = forwardRef<HTMLButtonElement, ComboboxTriggerProps>(\n function ComboboxTrigger({ className, ...props }, ref) {\n return (\n <BaseCombobox.Trigger\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().trigger, className)}\n data-slot=\"combobox-trigger\"\n />\n );\n },\n);\n\nexport type ComboboxIconProps = ComponentPropsWithoutRef<typeof BaseCombobox.Icon>;\n\nexport const ComboboxIcon = forwardRef<HTMLSpanElement, ComboboxIconProps>(function ComboboxIcon(\n { children = \"⌄\", className, ...props },\n ref,\n) {\n return (\n <BaseCombobox.Icon\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().icon, className)}\n data-slot=\"combobox-icon\"\n >\n {children}\n </BaseCombobox.Icon>\n );\n});\n\nexport type ComboboxValueProps = ComponentPropsWithoutRef<typeof BaseCombobox.Value>;\nexport const ComboboxValue = BaseCombobox.Value;\n\nexport const ComboboxPortal = BaseCombobox.Portal;\n\nexport type ComboboxPositionerProps = ComponentPropsWithoutRef<typeof BaseCombobox.Positioner>;\nexport const ComboboxPositioner = forwardRef<HTMLDivElement, ComboboxPositionerProps>(\n function ComboboxPositioner({ className, ...props }, ref) {\n return (\n <BaseCombobox.Positioner\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().positioner, className)}\n data-slot=\"combobox-positioner\"\n />\n );\n },\n);\n\nexport type ComboboxPopupProps = ComponentPropsWithoutRef<typeof BaseCombobox.Popup>;\nexport const ComboboxPopup = forwardRef<HTMLDivElement, ComboboxPopupProps>(function ComboboxPopup(\n { className, ...props },\n ref,\n) {\n return (\n <BaseCombobox.Popup\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().popup, className)}\n data-slot=\"combobox-popup\"\n />\n );\n});\n\nexport type ComboboxListProps = ComponentPropsWithoutRef<typeof BaseCombobox.List>;\nexport const ComboboxList = forwardRef<HTMLDivElement, ComboboxListProps>(function ComboboxList(\n { className, ...props },\n ref,\n) {\n return (\n <BaseCombobox.List\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().list, className)}\n data-slot=\"combobox-list\"\n />\n );\n});\n\nexport type ComboboxItemProps = ComponentPropsWithoutRef<typeof BaseCombobox.Item>;\nexport const ComboboxItem = forwardRef<HTMLDivElement, ComboboxItemProps>(function ComboboxItem(\n { className, ...props },\n ref,\n) {\n return (\n <BaseCombobox.Item\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().item, className)}\n data-slot=\"combobox-item\"\n />\n );\n});\n\nexport type ComboboxItemIndicatorProps = ComponentPropsWithoutRef<\n typeof BaseCombobox.ItemIndicator\n>;\nexport const ComboboxItemIndicator = forwardRef<HTMLSpanElement, ComboboxItemIndicatorProps>(\n function ComboboxItemIndicator({ children = \"✓\", className, ...props }, ref) {\n return (\n <BaseCombobox.ItemIndicator\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().itemIndicator, className)}\n data-slot=\"combobox-item-indicator\"\n >\n {children}\n </BaseCombobox.ItemIndicator>\n );\n },\n);\n\nexport type ComboboxGroupProps = ComponentPropsWithoutRef<typeof BaseCombobox.Group>;\nexport const ComboboxGroup = forwardRef<HTMLDivElement, ComboboxGroupProps>(function ComboboxGroup(\n { className, ...props },\n ref,\n) {\n return (\n <BaseCombobox.Group\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().group, className)}\n data-slot=\"combobox-group\"\n />\n );\n});\n\nexport type ComboboxGroupLabelProps = ComponentPropsWithoutRef<typeof BaseCombobox.GroupLabel>;\nexport const ComboboxGroupLabel = forwardRef<HTMLDivElement, ComboboxGroupLabelProps>(\n function ComboboxGroupLabel({ className, ...props }, ref) {\n return (\n <BaseCombobox.GroupLabel\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().groupLabel, className)}\n data-slot=\"combobox-group-label\"\n />\n );\n },\n);\n\nexport type ComboboxEmptyProps = ComponentPropsWithoutRef<typeof BaseCombobox.Empty>;\nexport const ComboboxEmpty = forwardRef<HTMLDivElement, ComboboxEmptyProps>(function ComboboxEmpty(\n { className, ...props },\n ref,\n) {\n return (\n <BaseCombobox.Empty\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().empty, className)}\n data-slot=\"combobox-empty\"\n />\n );\n});\n\nexport type ComboboxClearProps = ComponentPropsWithoutRef<typeof BaseCombobox.Clear>;\nexport const ComboboxClear = forwardRef<HTMLButtonElement, ComboboxClearProps>(\n function ComboboxClear({ children = \"×\", className, ...props }, ref) {\n return (\n <BaseCombobox.Clear\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().clear, className)}\n data-slot=\"combobox-clear\"\n aria-label={props[\"aria-label\"] ?? \"Clear selection\"}\n >\n {children}\n </BaseCombobox.Clear>\n );\n },\n);\n\nexport type ComboboxStatusProps = ComponentPropsWithoutRef<typeof BaseCombobox.Status>;\nexport const ComboboxStatus = forwardRef<HTMLDivElement, ComboboxStatusProps>(\n function ComboboxStatus({ className, ...props }, ref) {\n return (\n <BaseCombobox.Status\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().status, className)}\n data-slot=\"combobox-status\"\n />\n );\n },\n);\n\nexport type ComboboxArrowProps = ComponentPropsWithoutRef<typeof BaseCombobox.Arrow>;\nexport const ComboboxArrow = forwardRef<HTMLDivElement, ComboboxArrowProps>(function ComboboxArrow(\n { className, ...props },\n ref,\n) {\n return (\n <BaseCombobox.Arrow\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().arrow, className)}\n data-slot=\"combobox-arrow\"\n />\n );\n});\n\nexport const Combobox = {\n Root: ComboboxRoot,\n Label: ComboboxLabel,\n InputGroup: ComboboxInputGroup,\n Input: ComboboxInput,\n Trigger: ComboboxTrigger,\n Icon: ComboboxIcon,\n Value: ComboboxValue,\n Portal: ComboboxPortal,\n Positioner: ComboboxPositioner,\n Popup: ComboboxPopup,\n List: ComboboxList,\n Item: ComboboxItem,\n ItemIndicator: ComboboxItemIndicator,\n Group: ComboboxGroup,\n GroupLabel: ComboboxGroupLabel,\n Empty: ComboboxEmpty,\n Clear: ComboboxClear,\n Status: ComboboxStatus,\n Ar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AS;EACpE,aAAU;CACX,CAAA;AAEL,CACF;AAGA,MAAa,iBAAA,GAAA,MAAA,WAAA,CAA+D,SAAS,cACnF,EAAE,WAAW,GAAG,SAChB,KACA;CACA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACF,wBAAAA,SAAa,OAAd;EACE,GAAI;EACC;EACL,WAAWE,gBAAAA,oBAAoB,kBAAkB,CAAC,CAAC,OAAO,SAAS;EACnE,aAAU;CACX,CAAA;AAEL,CAAC;AAED,MAAa,WAAW;CACtB,MAAM;CACN,OAAO;CACP,YAAY;CACZ,OAAO;CACP,SAAS;CACT,MAAM;CACN,OAAO;CACP,QAAQ;CACR,YAAY;CACZ,OAAO;CACP,MAAM;CACN,MAAM;CACN,eAAe;CACf,OAAO;CACP,YAAY;CACZ,OAAO;CACP,OAAO;CACP,QAAQ;CACR,OAAO;CACP,WAAWF,wBAAAA,SAAa;AAC1B"}
|
|
1
|
+
{"version":3,"file":"combobox.cjs","names":["combobox","cx","Field","BaseCombobox","BaseField","withRecipeClassName"],"sources":["../../../src/components/combobox/combobox.tsx"],"sourcesContent":["\"use client\";\n\nimport { Combobox as BaseCombobox } from \"@base-ui/react/combobox\";\nimport { forwardRef, createContext, useContext } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport type { ComboboxRoot as BaseComboboxRoot } from \"@base-ui/react/combobox\";\nimport { Field as BaseField } from \"@base-ui/react/field\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { combobox } from \"../../styled-system/recipes\";\nimport { Field } from \"../field\";\nimport { withRecipeClassName } from \"../base-ui\";\n\nexport type ComboboxSize = \"sm\" | \"md\" | \"lg\";\n\nconst ComboboxSizeContext = createContext<ComboboxSize>(\"md\");\n\nfunction useComboboxStyles() {\n return combobox({ size: useContext(ComboboxSizeContext) });\n}\n\nexport interface ComboboxRootProps<Value, Multiple extends boolean | undefined = false>\n extends Omit<BaseComboboxRoot.Props<Value, Multiple>, \"children\" | \"className\"> {\n /** Visual size shared by the input and trigger. */\n size?: ComboboxSize;\n /** Marks the field invalid when an external validator owns its state. */\n invalid?: boolean;\n /** Shows a loading state through the optional Loading slot. */\n loading?: boolean;\n /** Direct error content rendered through the surrounding Field context. */\n errors?: ReactNode | ReactNode[];\n children?: ReactNode;\n className?: string;\n}\n\n/**\n * A searchable Base UI combobox with Field integration. It supports the\n * controlled `value`/`onValueChange` and uncontrolled `defaultValue` APIs,\n * object values, grouped items, filtering and multiple selection.\n */\nexport function ComboboxRoot<Value = string, Multiple extends boolean | undefined = false>({\n children,\n className,\n errors,\n invalid,\n loading: _loading,\n name,\n size = \"md\",\n ...props\n}: ComboboxRootProps<Value, Multiple>) {\n const styles = combobox({ size });\n const fieldProps = {\n className: cx(styles.root, className),\n ...(errors === undefined ? {} : { errors }),\n ...(invalid === undefined ? {} : { invalid }),\n ...(name === undefined ? {} : { name }),\n };\n\n return (\n <ComboboxSizeContext.Provider value={size}>\n <Field {...fieldProps}>\n <BaseCombobox.Root {...props} {...(name === undefined ? {} : { name })}>\n {children}\n </BaseCombobox.Root>\n </Field>\n </ComboboxSizeContext.Provider>\n );\n}\n\nexport type ComboboxLabelProps = ComponentPropsWithoutRef<typeof BaseField.Label>;\n\nexport const ComboboxLabel = forwardRef<HTMLElement, ComboboxLabelProps>(function ComboboxLabel(\n { className, ...props },\n ref,\n) {\n return (\n <BaseField.Label\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().label, className)}\n data-slot=\"combobox-label\"\n />\n );\n});\n\nexport type ComboboxInputGroupProps = ComponentPropsWithoutRef<typeof BaseCombobox.InputGroup>;\n\nexport const ComboboxInputGroup = forwardRef<HTMLDivElement, ComboboxInputGroupProps>(\n function ComboboxInputGroup({ className, ...props }, ref) {\n return (\n <BaseCombobox.InputGroup\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().inputGroup, className)}\n data-slot=\"combobox-input-group\"\n />\n );\n },\n);\n\nexport type ComboboxInputProps = ComponentPropsWithoutRef<typeof BaseCombobox.Input>;\n\nexport const ComboboxInput = forwardRef<HTMLInputElement, ComboboxInputProps>(\n function ComboboxInput({ className, ...props }, ref) {\n return (\n <BaseCombobox.Input\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().input, className)}\n data-jaci-component=\"combobox\"\n data-slot=\"combobox-input\"\n />\n );\n },\n);\n\nexport type ComboboxTriggerProps = ComponentPropsWithoutRef<typeof BaseCombobox.Trigger>;\n\nexport const ComboboxTrigger = forwardRef<HTMLButtonElement, ComboboxTriggerProps>(\n function ComboboxTrigger({ className, ...props }, ref) {\n return (\n <BaseCombobox.Trigger\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().trigger, className)}\n data-slot=\"combobox-trigger\"\n />\n );\n },\n);\n\nexport type ComboboxIconProps = ComponentPropsWithoutRef<typeof BaseCombobox.Icon>;\n\nexport const ComboboxIcon = forwardRef<HTMLSpanElement, ComboboxIconProps>(function ComboboxIcon(\n { children = \"⌄\", className, ...props },\n ref,\n) {\n return (\n <BaseCombobox.Icon\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().icon, className)}\n data-slot=\"combobox-icon\"\n >\n {children}\n </BaseCombobox.Icon>\n );\n});\n\nexport type ComboboxValueProps = ComponentPropsWithoutRef<typeof BaseCombobox.Value>;\nexport const ComboboxValue = BaseCombobox.Value;\n\nexport const ComboboxPortal = BaseCombobox.Portal;\n\nexport type ComboboxPositionerProps = ComponentPropsWithoutRef<typeof BaseCombobox.Positioner>;\nexport const ComboboxPositioner = forwardRef<HTMLDivElement, ComboboxPositionerProps>(\n function ComboboxPositioner({ className, ...props }, ref) {\n return (\n <BaseCombobox.Positioner\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().positioner, className)}\n data-slot=\"combobox-positioner\"\n />\n );\n },\n);\n\nexport type ComboboxPopupProps = ComponentPropsWithoutRef<typeof BaseCombobox.Popup>;\nexport const ComboboxPopup = forwardRef<HTMLDivElement, ComboboxPopupProps>(function ComboboxPopup(\n { className, ...props },\n ref,\n) {\n return (\n <BaseCombobox.Popup\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().popup, className)}\n data-slot=\"combobox-popup\"\n />\n );\n});\n\nexport type ComboboxListProps = ComponentPropsWithoutRef<typeof BaseCombobox.List>;\nexport const ComboboxList = forwardRef<HTMLDivElement, ComboboxListProps>(function ComboboxList(\n { className, ...props },\n ref,\n) {\n return (\n <BaseCombobox.List\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().list, className)}\n data-slot=\"combobox-list\"\n />\n );\n});\n\nexport type ComboboxItemProps = ComponentPropsWithoutRef<typeof BaseCombobox.Item>;\nexport const ComboboxItem = forwardRef<HTMLDivElement, ComboboxItemProps>(function ComboboxItem(\n { className, ...props },\n ref,\n) {\n return (\n <BaseCombobox.Item\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().item, className)}\n data-slot=\"combobox-item\"\n />\n );\n});\n\nexport type ComboboxItemIndicatorProps = ComponentPropsWithoutRef<\n typeof BaseCombobox.ItemIndicator\n>;\nexport const ComboboxItemIndicator = forwardRef<HTMLSpanElement, ComboboxItemIndicatorProps>(\n function ComboboxItemIndicator({ children = \"✓\", className, ...props }, ref) {\n return (\n <BaseCombobox.ItemIndicator\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().itemIndicator, className)}\n data-slot=\"combobox-item-indicator\"\n >\n {children}\n </BaseCombobox.ItemIndicator>\n );\n },\n);\n\nexport type ComboboxGroupProps = ComponentPropsWithoutRef<typeof BaseCombobox.Group>;\nexport const ComboboxGroup = forwardRef<HTMLDivElement, ComboboxGroupProps>(function ComboboxGroup(\n { className, ...props },\n ref,\n) {\n return (\n <BaseCombobox.Group\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().group, className)}\n data-slot=\"combobox-group\"\n />\n );\n});\n\nexport type ComboboxGroupLabelProps = ComponentPropsWithoutRef<typeof BaseCombobox.GroupLabel>;\nexport const ComboboxGroupLabel = forwardRef<HTMLDivElement, ComboboxGroupLabelProps>(\n function ComboboxGroupLabel({ className, ...props }, ref) {\n return (\n <BaseCombobox.GroupLabel\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().groupLabel, className)}\n data-slot=\"combobox-group-label\"\n />\n );\n },\n);\n\nexport type ComboboxEmptyProps = ComponentPropsWithoutRef<typeof BaseCombobox.Empty>;\nexport const ComboboxEmpty = forwardRef<HTMLDivElement, ComboboxEmptyProps>(function ComboboxEmpty(\n { className, ...props },\n ref,\n) {\n return (\n <BaseCombobox.Empty\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().empty, className)}\n data-slot=\"combobox-empty\"\n />\n );\n});\n\nexport type ComboboxClearProps = ComponentPropsWithoutRef<typeof BaseCombobox.Clear>;\nexport const ComboboxClear = forwardRef<HTMLButtonElement, ComboboxClearProps>(\n function ComboboxClear({ children = \"×\", className, ...props }, ref) {\n return (\n <BaseCombobox.Clear\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().clear, className)}\n data-slot=\"combobox-clear\"\n aria-label={props[\"aria-label\"] ?? \"Clear selection\"}\n >\n {children}\n </BaseCombobox.Clear>\n );\n },\n);\n\nexport type ComboboxLoadingProps = ComponentPropsWithoutRef<\"div\">;\nexport const ComboboxLoading = forwardRef<HTMLDivElement, ComboboxLoadingProps>(\n function ComboboxLoading({ children = \"Loading…\", className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n aria-live=\"polite\"\n className={cx(useComboboxStyles().loading, className)}\n data-slot=\"combobox-loading\"\n >\n {children}\n </div>\n );\n },\n);\n\nexport type ComboboxStatusProps = ComponentPropsWithoutRef<typeof BaseCombobox.Status>;\nexport const ComboboxStatus = forwardRef<HTMLDivElement, ComboboxStatusProps>(\n function ComboboxStatus({ className, ...props }, ref) {\n return (\n <BaseCombobox.Status\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().status, className)}\n data-slot=\"combobox-status\"\n />\n );\n },\n);\n\nexport type ComboboxArrowProps = ComponentPropsWithoutRef<typeof BaseCombobox.Arrow>;\nexport const ComboboxArrow = forwardRef<HTMLDivElement, ComboboxArrowProps>(function ComboboxArrow(\n { className, ...props },\n ref,\n) {\n return (\n <BaseCombobox.Arrow\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().arrow, className)}\n data-slot=\"combobox-arrow\"\n />\n );\n});\n\nexport const Combobox = {\n Root: ComboboxRoot,\n Label: ComboboxLabel,\n InputGroup: ComboboxInputGroup,\n Input: ComboboxInput,\n Trigger: ComboboxTrigger,\n Icon: ComboboxIcon,\n Value: ComboboxValue,\n Portal: ComboboxPortal,\n Positioner: ComboboxPositioner,\n Popup: ComboboxPopup,\n List: ComboboxList,\n Item: ComboboxItem,\n ItemIndicator: ComboboxItemIndicator,\n Group: ComboboxGroup,\n GroupLabel: ComboboxGroupLabel,\n Empty: ComboboxEmpty,\n Loading: ComboboxLoading,\n Clear: ComboboxClear,\n Status: ComboboxStatus,\n Arrow: ComboboxArrow,\n useFilter: BaseCombobox.useFilter,\n};\n"],"mappings":";;;;;;;;;;AAeA,MAAM,uBAAA,GAAA,MAAA,cAAA,CAAkD,IAAI;AAE5D,SAAS,oBAAoB;CAC3B,OAAOA,iBAAAA,SAAS,EAAE,OAAA,GAAA,MAAA,WAAA,CAAiB,mBAAmB,EAAE,CAAC;AAC3D;;;;;;AAqBA,SAAgB,aAA2E,EACzF,UACA,WACA,QACA,SACA,SAAS,UACT,MACA,OAAO,MACP,GAAG,SACkC;CAErC,MAAM,aAAa;EACjB,WAAWC,WAAAA,GAFED,iBAAAA,SAAS,EAAE,KAAK,CAEV,CAAC,CAAC,MAAM,SAAS;EACpC,GAAI,WAAW,KAAA,IAAY,CAAC,IAAI,EAAE,OAAO;EACzC,GAAI,YAAY,KAAA,IAAY,CAAC,IAAI,EAAE,QAAQ;EAC3C,GAAI,SAAS,KAAA,IAAY,CAAC,IAAI,EAAE,KAAK;CACvC;CA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CACtB,MAAM;CACN,OAAO;CACP,YAAY;CACZ,OAAO;CACP,SAAS;CACT,MAAM;CACN,OAAO;CACP,QAAQ;CACR,YAAY;CACZ,OAAO;CACP,MAAM;CACN,MAAM;CACN,eAAe;CACf,OAAO;CACP,YAAY;CACZ,OAAO;CACP,SAAS;CACT,OAAO;CACP,QAAQ;CACR,OAAO;CACP,WAAWF,wBAAAA,SAAa;AAC1B"}
|
|
@@ -8,6 +8,8 @@ interface ComboboxRootProps<Value, Multiple extends boolean | undefined = false>
|
|
|
8
8
|
size?: ComboboxSize;
|
|
9
9
|
/** Marks the field invalid when an external validator owns its state. */
|
|
10
10
|
invalid?: boolean;
|
|
11
|
+
/** Shows a loading state through the optional Loading slot. */
|
|
12
|
+
loading?: boolean;
|
|
11
13
|
/** Direct error content rendered through the surrounding Field context. */
|
|
12
14
|
errors?: ReactNode | ReactNode[];
|
|
13
15
|
children?: ReactNode;
|
|
@@ -18,7 +20,7 @@ interface ComboboxRootProps<Value, Multiple extends boolean | undefined = false>
|
|
|
18
20
|
* controlled `value`/`onValueChange` and uncontrolled `defaultValue` APIs,
|
|
19
21
|
* object values, grouped items, filtering and multiple selection.
|
|
20
22
|
*/
|
|
21
|
-
declare function ComboboxRoot$1<Value = string, Multiple extends boolean | undefined = false>({ children, className, errors, invalid, name, size, ...props }: ComboboxRootProps<Value, Multiple>): import("react").JSX.Element;
|
|
23
|
+
declare function ComboboxRoot$1<Value = string, Multiple extends boolean | undefined = false>({ children, className, errors, invalid, loading: _loading, name, size, ...props }: ComboboxRootProps<Value, Multiple>): import("react").JSX.Element;
|
|
22
24
|
type ComboboxLabelProps = ComponentPropsWithoutRef<typeof Field.Label>;
|
|
23
25
|
declare const ComboboxLabel: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").FieldLabelProps, "ref"> & import("react").RefAttributes<HTMLElement>, "ref"> & import("react").RefAttributes<HTMLElement>>;
|
|
24
26
|
type ComboboxInputGroupProps = ComponentPropsWithoutRef<typeof Combobox.InputGroup>;
|
|
@@ -50,6 +52,8 @@ type ComboboxEmptyProps = ComponentPropsWithoutRef<typeof Combobox.Empty>;
|
|
|
50
52
|
declare const ComboboxEmpty: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AutocompleteEmptyProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
51
53
|
type ComboboxClearProps = ComponentPropsWithoutRef<typeof Combobox.Clear>;
|
|
52
54
|
declare const ComboboxClear: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AutocompleteClearProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
55
|
+
type ComboboxLoadingProps = ComponentPropsWithoutRef<"div">;
|
|
56
|
+
declare const ComboboxLoading: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
53
57
|
type ComboboxStatusProps = ComponentPropsWithoutRef<typeof Combobox.Status>;
|
|
54
58
|
declare const ComboboxStatus: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AutocompleteStatusProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
55
59
|
type ComboboxArrowProps = ComponentPropsWithoutRef<typeof Combobox.Arrow>;
|
|
@@ -71,11 +75,12 @@ declare const Combobox$1: {
|
|
|
71
75
|
Group: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AutocompleteGroupProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
72
76
|
GroupLabel: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AutocompleteGroupLabelProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
73
77
|
Empty: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AutocompleteEmptyProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
78
|
+
Loading: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
74
79
|
Clear: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AutocompleteClearProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
75
80
|
Status: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AutocompleteStatusProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
76
81
|
Arrow: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AutocompleteArrowProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
77
82
|
useFilter: typeof Combobox.useFilter;
|
|
78
83
|
};
|
|
79
84
|
//#endregion
|
|
80
|
-
export { Combobox$1 as Combobox, ComboboxArrow, ComboboxArrowProps, ComboboxClear, ComboboxClearProps, ComboboxEmpty, ComboboxEmptyProps, ComboboxGroup, ComboboxGroupLabel, ComboboxGroupLabelProps, ComboboxGroupProps, ComboboxIcon, ComboboxIconProps, ComboboxInput, ComboboxInputGroup, ComboboxInputGroupProps, ComboboxInputProps, ComboboxItem, ComboboxItemIndicator, ComboboxItemIndicatorProps, ComboboxItemProps, ComboboxLabel, ComboboxLabelProps, ComboboxList, ComboboxListProps, ComboboxPopup, ComboboxPopupProps, ComboboxPortal, ComboboxPositioner, ComboboxPositionerProps, ComboboxRoot$1 as ComboboxRoot, ComboboxRootProps, ComboboxSize, ComboboxStatus, ComboboxStatusProps, ComboboxTrigger, ComboboxTriggerProps, ComboboxValue, ComboboxValueProps };
|
|
85
|
+
export { Combobox$1 as Combobox, ComboboxArrow, ComboboxArrowProps, ComboboxClear, ComboboxClearProps, ComboboxEmpty, ComboboxEmptyProps, ComboboxGroup, ComboboxGroupLabel, ComboboxGroupLabelProps, ComboboxGroupProps, ComboboxIcon, ComboboxIconProps, ComboboxInput, ComboboxInputGroup, ComboboxInputGroupProps, ComboboxInputProps, ComboboxItem, ComboboxItemIndicator, ComboboxItemIndicatorProps, ComboboxItemProps, ComboboxLabel, ComboboxLabelProps, ComboboxList, ComboboxListProps, ComboboxLoading, ComboboxLoadingProps, ComboboxPopup, ComboboxPopupProps, ComboboxPortal, ComboboxPositioner, ComboboxPositionerProps, ComboboxRoot$1 as ComboboxRoot, ComboboxRootProps, ComboboxSize, ComboboxStatus, ComboboxStatusProps, ComboboxTrigger, ComboboxTriggerProps, ComboboxValue, ComboboxValueProps };
|
|
81
86
|
//# sourceMappingURL=combobox.d.cts.map
|