@sereno-ds/ui 0.25.7 → 0.26.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/dist/forms/DatePicker.d.ts +37 -0
- package/dist/forms/DatePicker.js +182 -0
- package/dist/forms/DatePicker.js.map +1 -0
- package/dist/forms/DateTimePicker.d.ts +4 -0
- package/dist/forms/DateTimePicker.js +10 -383
- package/dist/forms/DateTimePicker.js.map +1 -1
- package/dist/forms/Select.js +1 -31
- package/dist/forms/Select.js.map +1 -1
- package/dist/forms/_internal/CalendarGrid.d.ts +41 -0
- package/dist/forms/_internal/CalendarGrid.js +409 -0
- package/dist/forms/_internal/CalendarGrid.js.map +1 -0
- package/dist/forms/_internal/fieldBoxStyle.d.ts +14 -0
- package/dist/forms/_internal/fieldBoxStyle.js +37 -0
- package/dist/forms/_internal/fieldBoxStyle.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { ChevronDown, ChevronLeft, ChevronRight } from "lucide-react";
|
|
5
|
+
import { sx } from "../../_internal/style";
|
|
6
|
+
import { IconButton } from "../../core/IconButton";
|
|
7
|
+
const DOW = ["D", "S", "T", "Q", "Q", "S", "S"];
|
|
8
|
+
const MONTHS = ["janeiro", "fevereiro", "mar\xE7o", "abril", "maio", "junho", "julho", "agosto", "setembro", "outubro", "novembro", "dezembro"];
|
|
9
|
+
const MONTHS_SHORT = ["jan", "fev", "mar", "abr", "mai", "jun", "jul", "ago", "set", "out", "nov", "dez"];
|
|
10
|
+
function daysIn(y, m) {
|
|
11
|
+
return new Date(y, m + 1, 0).getDate();
|
|
12
|
+
}
|
|
13
|
+
function CalendarGrid({
|
|
14
|
+
year,
|
|
15
|
+
month,
|
|
16
|
+
selectedDate,
|
|
17
|
+
unavailable = [],
|
|
18
|
+
onSelectDate,
|
|
19
|
+
onMonthChange,
|
|
20
|
+
renderDay,
|
|
21
|
+
squareCells = false,
|
|
22
|
+
trimEmptyRows = false
|
|
23
|
+
}) {
|
|
24
|
+
const now = React.useMemo(() => /* @__PURE__ */ new Date(), []);
|
|
25
|
+
const initialIndex = (year ?? now.getFullYear()) * 12 + (month ?? now.getMonth());
|
|
26
|
+
const [viewIndex, setViewIndex] = React.useState(initialIndex);
|
|
27
|
+
const viewYear = Math.floor(viewIndex / 12);
|
|
28
|
+
const viewMonth = viewIndex % 12;
|
|
29
|
+
const [selectionIndex, setSelectionIndex] = React.useState(initialIndex);
|
|
30
|
+
const [open, setOpen] = React.useState(false);
|
|
31
|
+
const [picker, setPicker] = React.useState("month");
|
|
32
|
+
const [yearBase, setYearBase] = React.useState(() => (year ?? now.getFullYear()) - 5);
|
|
33
|
+
const rootRef = React.useRef(null);
|
|
34
|
+
const titleRef = React.useRef(null);
|
|
35
|
+
const popRef = React.useRef(null);
|
|
36
|
+
const gridRef = React.useRef(null);
|
|
37
|
+
const [activeDay, setActiveDay] = React.useState(() => {
|
|
38
|
+
if (selectedDate) return selectedDate;
|
|
39
|
+
const todayIndex = now.getFullYear() * 12 + now.getMonth();
|
|
40
|
+
return todayIndex === initialIndex ? now.getDate() : 1;
|
|
41
|
+
});
|
|
42
|
+
const shouldFocusDayRef = React.useRef(false);
|
|
43
|
+
const onMonthChangeRef = React.useRef(onMonthChange);
|
|
44
|
+
React.useEffect(() => {
|
|
45
|
+
onMonthChangeRef.current = onMonthChange;
|
|
46
|
+
});
|
|
47
|
+
const didMount = React.useRef(false);
|
|
48
|
+
React.useEffect(() => {
|
|
49
|
+
if (!didMount.current) {
|
|
50
|
+
didMount.current = true;
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
onMonthChangeRef.current?.(Math.floor(viewIndex / 12), viewIndex % 12);
|
|
54
|
+
}, [viewIndex]);
|
|
55
|
+
React.useEffect(() => {
|
|
56
|
+
if (!open) return;
|
|
57
|
+
const onDown = (e) => {
|
|
58
|
+
if (rootRef.current && !rootRef.current.contains(e.target)) {
|
|
59
|
+
setOpen(false);
|
|
60
|
+
setPicker("month");
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
document.addEventListener("pointerdown", onDown, true);
|
|
64
|
+
const id = requestAnimationFrame(() => popRef.current?.focus());
|
|
65
|
+
return () => {
|
|
66
|
+
document.removeEventListener("pointerdown", onDown, true);
|
|
67
|
+
cancelAnimationFrame(id);
|
|
68
|
+
};
|
|
69
|
+
}, [open]);
|
|
70
|
+
const closePopover = React.useCallback(() => {
|
|
71
|
+
setOpen(false);
|
|
72
|
+
setPicker("month");
|
|
73
|
+
titleRef.current?.focus();
|
|
74
|
+
}, []);
|
|
75
|
+
const toggleOpen = React.useCallback(() => {
|
|
76
|
+
setOpen((v) => {
|
|
77
|
+
if (v) setPicker("month");
|
|
78
|
+
return !v;
|
|
79
|
+
});
|
|
80
|
+
}, []);
|
|
81
|
+
const first = new Date(viewYear, viewMonth, 1).getDay();
|
|
82
|
+
const total = daysIn(viewYear, viewMonth);
|
|
83
|
+
const cells = [...Array(first).fill(null), ...Array.from({ length: total }, (_, i) => i + 1)];
|
|
84
|
+
while (cells.length < 42) cells.push(null);
|
|
85
|
+
if (trimEmptyRows) {
|
|
86
|
+
while (cells.length > 7 && cells.slice(-7).every((c) => c === null)) cells.length -= 7;
|
|
87
|
+
}
|
|
88
|
+
const cellSizing = renderDay ? { height: 48 } : squareCells ? { aspectRatio: "1" } : { height: 38 };
|
|
89
|
+
const years = Array.from({ length: 12 }, (_, i) => yearBase + i);
|
|
90
|
+
const rovingDay = Math.min(Math.max(1, activeDay), total);
|
|
91
|
+
const onGridKeyDown = (e) => {
|
|
92
|
+
let delta = 0;
|
|
93
|
+
switch (e.key) {
|
|
94
|
+
case "ArrowRight":
|
|
95
|
+
delta = 1;
|
|
96
|
+
break;
|
|
97
|
+
case "ArrowLeft":
|
|
98
|
+
delta = -1;
|
|
99
|
+
break;
|
|
100
|
+
case "ArrowDown":
|
|
101
|
+
delta = 7;
|
|
102
|
+
break;
|
|
103
|
+
case "ArrowUp":
|
|
104
|
+
delta = -7;
|
|
105
|
+
break;
|
|
106
|
+
case "Home": {
|
|
107
|
+
e.preventDefault();
|
|
108
|
+
const row = Math.floor((first + rovingDay - 1) / 7);
|
|
109
|
+
shouldFocusDayRef.current = true;
|
|
110
|
+
setActiveDay(Math.max(1, row * 7 - first + 1));
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
case "End": {
|
|
114
|
+
e.preventDefault();
|
|
115
|
+
const row = Math.floor((first + rovingDay - 1) / 7);
|
|
116
|
+
shouldFocusDayRef.current = true;
|
|
117
|
+
setActiveDay(Math.min(total, row * 7 + 7 - first));
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
case "PageUp":
|
|
121
|
+
e.preventDefault();
|
|
122
|
+
shouldFocusDayRef.current = true;
|
|
123
|
+
setViewIndex((i) => i - 1);
|
|
124
|
+
return;
|
|
125
|
+
case "PageDown":
|
|
126
|
+
e.preventDefault();
|
|
127
|
+
shouldFocusDayRef.current = true;
|
|
128
|
+
setViewIndex((i) => i + 1);
|
|
129
|
+
return;
|
|
130
|
+
default:
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
e.preventDefault();
|
|
134
|
+
const next = new Date(viewYear, viewMonth, rovingDay + delta);
|
|
135
|
+
const nextViewIndex = next.getFullYear() * 12 + next.getMonth();
|
|
136
|
+
shouldFocusDayRef.current = true;
|
|
137
|
+
if (nextViewIndex !== viewIndex) setViewIndex(nextViewIndex);
|
|
138
|
+
setActiveDay(next.getDate());
|
|
139
|
+
};
|
|
140
|
+
React.useLayoutEffect(() => {
|
|
141
|
+
if (!shouldFocusDayRef.current) return;
|
|
142
|
+
shouldFocusDayRef.current = false;
|
|
143
|
+
gridRef.current?.querySelector(`[data-day="${rovingDay}"]`)?.focus();
|
|
144
|
+
}, [viewIndex, rovingDay]);
|
|
145
|
+
return /* @__PURE__ */ jsxs("div", { ref: rootRef, children: [
|
|
146
|
+
/* @__PURE__ */ jsxs(
|
|
147
|
+
"div",
|
|
148
|
+
{
|
|
149
|
+
style: sx({
|
|
150
|
+
position: "relative",
|
|
151
|
+
display: "grid",
|
|
152
|
+
gridTemplateColumns: "auto 1fr auto",
|
|
153
|
+
alignItems: "center",
|
|
154
|
+
gap: "var(--space-1)",
|
|
155
|
+
marginBottom: "var(--space-3)"
|
|
156
|
+
}),
|
|
157
|
+
children: [
|
|
158
|
+
/* @__PURE__ */ jsx(IconButton, { label: "M\xEAs anterior", size: "sm", onClick: () => setViewIndex((i) => i - 1), children: /* @__PURE__ */ jsx(ChevronLeft, { size: 18, strokeWidth: 1.75 }) }),
|
|
159
|
+
/* @__PURE__ */ jsxs(
|
|
160
|
+
"button",
|
|
161
|
+
{
|
|
162
|
+
ref: titleRef,
|
|
163
|
+
type: "button",
|
|
164
|
+
className: "sereno-dtp-title",
|
|
165
|
+
"aria-haspopup": "dialog",
|
|
166
|
+
"aria-expanded": open,
|
|
167
|
+
onClick: toggleOpen,
|
|
168
|
+
style: sx({
|
|
169
|
+
display: "inline-flex",
|
|
170
|
+
alignItems: "center",
|
|
171
|
+
justifyContent: "center",
|
|
172
|
+
gap: 4,
|
|
173
|
+
margin: "0 auto",
|
|
174
|
+
padding: "4px 8px",
|
|
175
|
+
border: "none",
|
|
176
|
+
borderRadius: "var(--radius-sm)",
|
|
177
|
+
background: "transparent",
|
|
178
|
+
cursor: "pointer",
|
|
179
|
+
fontFamily: "var(--font-display)",
|
|
180
|
+
fontSize: "var(--text-base)",
|
|
181
|
+
fontWeight: "var(--weight-bold)",
|
|
182
|
+
color: "var(--text-primary)",
|
|
183
|
+
textTransform: "capitalize"
|
|
184
|
+
}),
|
|
185
|
+
children: [
|
|
186
|
+
MONTHS[viewMonth],
|
|
187
|
+
" ",
|
|
188
|
+
viewYear,
|
|
189
|
+
/* @__PURE__ */ jsx(ChevronDown, { size: 15, strokeWidth: 2, style: { opacity: 0.6 } })
|
|
190
|
+
]
|
|
191
|
+
}
|
|
192
|
+
),
|
|
193
|
+
/* @__PURE__ */ jsx(IconButton, { label: "Pr\xF3ximo m\xEAs", size: "sm", onClick: () => setViewIndex((i) => i + 1), children: /* @__PURE__ */ jsx(ChevronRight, { size: 18, strokeWidth: 1.75 }) }),
|
|
194
|
+
open && /* @__PURE__ */ jsxs(
|
|
195
|
+
"div",
|
|
196
|
+
{
|
|
197
|
+
ref: popRef,
|
|
198
|
+
role: "dialog",
|
|
199
|
+
"aria-label": "Escolher m\xEAs e ano",
|
|
200
|
+
tabIndex: -1,
|
|
201
|
+
onKeyDown: (e) => {
|
|
202
|
+
if (e.key === "Escape") {
|
|
203
|
+
e.stopPropagation();
|
|
204
|
+
closePopover();
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
className: "sereno-dtp-pop",
|
|
208
|
+
style: sx({
|
|
209
|
+
position: "absolute",
|
|
210
|
+
top: "calc(100% + 6px)",
|
|
211
|
+
left: "50%",
|
|
212
|
+
transform: "translateX(-50%)",
|
|
213
|
+
zIndex: 20,
|
|
214
|
+
width: 248,
|
|
215
|
+
maxWidth: "calc(100vw - 24px)",
|
|
216
|
+
background: "var(--bg-surface)",
|
|
217
|
+
border: "var(--border-width-hairline) solid var(--border-default)",
|
|
218
|
+
borderRadius: "var(--radius-md)",
|
|
219
|
+
boxShadow: "var(--shadow-lg)",
|
|
220
|
+
padding: "var(--space-3)",
|
|
221
|
+
outline: "none"
|
|
222
|
+
}),
|
|
223
|
+
children: [
|
|
224
|
+
/* @__PURE__ */ jsxs(
|
|
225
|
+
"div",
|
|
226
|
+
{
|
|
227
|
+
style: sx({
|
|
228
|
+
display: "grid",
|
|
229
|
+
gridTemplateColumns: "auto 1fr auto",
|
|
230
|
+
alignItems: "center",
|
|
231
|
+
marginBottom: "var(--space-2)"
|
|
232
|
+
}),
|
|
233
|
+
children: [
|
|
234
|
+
/* @__PURE__ */ jsx(
|
|
235
|
+
IconButton,
|
|
236
|
+
{
|
|
237
|
+
label: picker === "month" ? "Ano anterior" : "Anos anteriores",
|
|
238
|
+
size: "sm",
|
|
239
|
+
onClick: () => picker === "month" ? setViewIndex((i) => i - 12) : setYearBase((b) => b - 12),
|
|
240
|
+
children: /* @__PURE__ */ jsx(ChevronLeft, { size: 18, strokeWidth: 1.75 })
|
|
241
|
+
}
|
|
242
|
+
),
|
|
243
|
+
picker === "month" ? /* @__PURE__ */ jsx(
|
|
244
|
+
"button",
|
|
245
|
+
{
|
|
246
|
+
type: "button",
|
|
247
|
+
className: "sereno-dtp-title",
|
|
248
|
+
onClick: () => {
|
|
249
|
+
setYearBase(viewYear - 5);
|
|
250
|
+
setPicker("year");
|
|
251
|
+
},
|
|
252
|
+
style: sx({
|
|
253
|
+
margin: "0 auto",
|
|
254
|
+
padding: "4px 8px",
|
|
255
|
+
border: "none",
|
|
256
|
+
borderRadius: "var(--radius-sm)",
|
|
257
|
+
background: "transparent",
|
|
258
|
+
cursor: "pointer",
|
|
259
|
+
fontFamily: "var(--font-display)",
|
|
260
|
+
fontSize: "var(--text-sm)",
|
|
261
|
+
fontWeight: "var(--weight-bold)",
|
|
262
|
+
color: "var(--text-primary)"
|
|
263
|
+
}),
|
|
264
|
+
children: viewYear
|
|
265
|
+
}
|
|
266
|
+
) : /* @__PURE__ */ jsxs(
|
|
267
|
+
"span",
|
|
268
|
+
{
|
|
269
|
+
style: sx({
|
|
270
|
+
textAlign: "center",
|
|
271
|
+
fontFamily: "var(--font-body)",
|
|
272
|
+
fontSize: "var(--text-sm)",
|
|
273
|
+
fontWeight: "var(--weight-semibold)",
|
|
274
|
+
color: "var(--text-secondary)"
|
|
275
|
+
}),
|
|
276
|
+
children: [
|
|
277
|
+
years[0],
|
|
278
|
+
"\u2013",
|
|
279
|
+
years[11]
|
|
280
|
+
]
|
|
281
|
+
}
|
|
282
|
+
),
|
|
283
|
+
/* @__PURE__ */ jsx(
|
|
284
|
+
IconButton,
|
|
285
|
+
{
|
|
286
|
+
label: picker === "month" ? "Pr\xF3ximo ano" : "Pr\xF3ximos anos",
|
|
287
|
+
size: "sm",
|
|
288
|
+
onClick: () => picker === "month" ? setViewIndex((i) => i + 12) : setYearBase((b) => b + 12),
|
|
289
|
+
children: /* @__PURE__ */ jsx(ChevronRight, { size: 18, strokeWidth: 1.75 })
|
|
290
|
+
}
|
|
291
|
+
)
|
|
292
|
+
]
|
|
293
|
+
}
|
|
294
|
+
),
|
|
295
|
+
/* @__PURE__ */ jsx("div", { className: "sereno-dtp-grid", style: sx({ display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: "var(--space-1)" }), children: picker === "month" ? MONTHS_SHORT.map((mo, i) => /* @__PURE__ */ jsx(
|
|
296
|
+
"button",
|
|
297
|
+
{
|
|
298
|
+
type: "button",
|
|
299
|
+
"data-current": i === viewMonth || void 0,
|
|
300
|
+
"aria-current": i === viewMonth ? "true" : void 0,
|
|
301
|
+
onClick: () => {
|
|
302
|
+
setViewIndex(viewYear * 12 + i);
|
|
303
|
+
closePopover();
|
|
304
|
+
},
|
|
305
|
+
children: mo
|
|
306
|
+
},
|
|
307
|
+
mo
|
|
308
|
+
)) : years.map((y) => /* @__PURE__ */ jsx(
|
|
309
|
+
"button",
|
|
310
|
+
{
|
|
311
|
+
type: "button",
|
|
312
|
+
"data-current": y === viewYear || void 0,
|
|
313
|
+
"aria-current": y === viewYear ? "true" : void 0,
|
|
314
|
+
onClick: () => {
|
|
315
|
+
setViewIndex(y * 12 + viewMonth);
|
|
316
|
+
setPicker("month");
|
|
317
|
+
},
|
|
318
|
+
children: y
|
|
319
|
+
},
|
|
320
|
+
y
|
|
321
|
+
)) })
|
|
322
|
+
]
|
|
323
|
+
}
|
|
324
|
+
)
|
|
325
|
+
]
|
|
326
|
+
}
|
|
327
|
+
),
|
|
328
|
+
/* @__PURE__ */ jsx("div", { style: sx({ display: "grid", gridTemplateColumns: "repeat(7,1fr)", gap: "var(--space-1)", marginBottom: "var(--space-1)" }), children: DOW.map((d, i) => /* @__PURE__ */ jsx(
|
|
329
|
+
"span",
|
|
330
|
+
{
|
|
331
|
+
style: sx({
|
|
332
|
+
textAlign: "center",
|
|
333
|
+
fontFamily: "var(--font-body)",
|
|
334
|
+
fontSize: "var(--text-2xs)",
|
|
335
|
+
fontWeight: "var(--weight-semibold)",
|
|
336
|
+
color: "var(--text-muted)",
|
|
337
|
+
letterSpacing: "var(--tracking-caps)"
|
|
338
|
+
}),
|
|
339
|
+
children: d
|
|
340
|
+
},
|
|
341
|
+
i
|
|
342
|
+
)) }),
|
|
343
|
+
/* @__PURE__ */ jsx(
|
|
344
|
+
"div",
|
|
345
|
+
{
|
|
346
|
+
ref: gridRef,
|
|
347
|
+
onKeyDown: onGridKeyDown,
|
|
348
|
+
className: "sereno-dtp-days",
|
|
349
|
+
style: sx({ display: "grid", gridTemplateColumns: "repeat(7,1fr)", gap: "var(--space-1)" }),
|
|
350
|
+
children: cells.map((d, i) => {
|
|
351
|
+
if (d === null) return /* @__PURE__ */ jsx("span", { "aria-hidden": true, style: cellSizing }, i);
|
|
352
|
+
const off = unavailable.includes(d);
|
|
353
|
+
const sel = selectedDate === d && viewIndex === selectionIndex;
|
|
354
|
+
const extra = renderDay?.(d);
|
|
355
|
+
return /* @__PURE__ */ jsxs(
|
|
356
|
+
"button",
|
|
357
|
+
{
|
|
358
|
+
type: "button",
|
|
359
|
+
"data-day": d,
|
|
360
|
+
"aria-disabled": off || void 0,
|
|
361
|
+
tabIndex: d === rovingDay ? 0 : -1,
|
|
362
|
+
"aria-pressed": sel,
|
|
363
|
+
onClick: () => {
|
|
364
|
+
if (off) return;
|
|
365
|
+
setSelectionIndex(viewIndex);
|
|
366
|
+
setActiveDay(d);
|
|
367
|
+
onSelectDate?.(d);
|
|
368
|
+
},
|
|
369
|
+
style: sx({
|
|
370
|
+
...cellSizing,
|
|
371
|
+
display: "flex",
|
|
372
|
+
flexDirection: "column",
|
|
373
|
+
alignItems: "center",
|
|
374
|
+
justifyContent: "center",
|
|
375
|
+
gap: 1,
|
|
376
|
+
borderRadius: "var(--radius-sm)",
|
|
377
|
+
border: "none",
|
|
378
|
+
padding: 0,
|
|
379
|
+
cursor: off ? "not-allowed" : "pointer",
|
|
380
|
+
background: sel ? "var(--interactive-primary)" : "transparent",
|
|
381
|
+
color: sel ? "var(--interactive-primary-fg)" : off ? "var(--text-disabled)" : "var(--text-primary)",
|
|
382
|
+
fontFamily: "var(--font-body)",
|
|
383
|
+
fontSize: "var(--text-sm)",
|
|
384
|
+
fontWeight: sel ? "var(--weight-bold)" : "var(--weight-medium)",
|
|
385
|
+
textDecoration: off ? "line-through" : "none",
|
|
386
|
+
transition: "var(--transition-control)"
|
|
387
|
+
// Not inline outline:none — that would always beat the
|
|
388
|
+
// .sereno-dtp-days:focus-visible rule below no matter what
|
|
389
|
+
// it says (inline style always outranks a class selector).
|
|
390
|
+
// Suppressed as a class rule instead, same specificity as
|
|
391
|
+
// the :focus-visible override that re-enables it.
|
|
392
|
+
}),
|
|
393
|
+
children: [
|
|
394
|
+
/* @__PURE__ */ jsx("span", { children: d }),
|
|
395
|
+
renderDay ? /* @__PURE__ */ jsx("span", { style: sx({ display: "flex", minHeight: 12, lineHeight: 1 }), children: extra }) : null
|
|
396
|
+
]
|
|
397
|
+
},
|
|
398
|
+
i
|
|
399
|
+
);
|
|
400
|
+
})
|
|
401
|
+
},
|
|
402
|
+
viewIndex
|
|
403
|
+
)
|
|
404
|
+
] });
|
|
405
|
+
}
|
|
406
|
+
export {
|
|
407
|
+
CalendarGrid
|
|
408
|
+
};
|
|
409
|
+
//# sourceMappingURL=CalendarGrid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/forms/_internal/CalendarGrid.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { ChevronDown, ChevronLeft, ChevronRight } from 'lucide-react';\nimport { sx } from '../../_internal/style';\nimport { IconButton } from '../../core/IconButton';\n\n/**\n * The month calendar body — header (‹ / › month nav + a month/year jump\n * popover) and the day grid with roving-tabindex keyboard navigation\n * (SS-228). Shared by `DateTimePicker` (rendered inline, with an optional\n * time-slot list under it) and `DatePicker` (rendered inside its own\n * trigger+popover shell) — extracted so neither has to duplicate the\n * keyboard-grid math (SS-243). See `DateTimePicker`'s own doc comment for\n * the full behavior description; this component owns exactly the same\n * state and logic it always has, just without the outer card chrome or\n * the time-slot section, neither of which any of this depends on.\n */\nexport interface CalendarGridProps {\n year?: number;\n month?: number;\n selectedDate?: number;\n unavailable?: number[];\n onSelectDate?: (day: number) => void;\n onMonthChange?: (year: number, month: number) => void;\n renderDay?: (day: number) => React.ReactNode;\n /**\n * Day cells are perfect squares (`aspect-ratio`) instead of a fixed pixel\n * height — `DatePicker` (SS-243) opts into this since its popover can be\n * narrower than `DateTimePicker`'s own card, where a fixed height was\n * already tuned and shipped. Ignored when `renderDay` is set — that case\n * always needs the extra fixed height for its own content.\n */\n squareCells?: boolean;\n /**\n * Drop wholly-blank trailing rows instead of always padding to 6 (SS-243)\n * — `DateTimePicker` needs the fixed 6 rows so its *always-visible* card\n * never jumps height as you navigate months; `DatePicker`'s popover opens\n * and closes anyway, so a variable height per month reads better than a\n * dead empty row (e.g. a 30-day month starting on Sunday only needs 5).\n */\n trimEmptyRows?: boolean;\n}\n\nconst DOW = ['D', 'S', 'T', 'Q', 'Q', 'S', 'S'];\nconst MONTHS = ['janeiro', 'fevereiro', 'março', 'abril', 'maio', 'junho', 'julho', 'agosto', 'setembro', 'outubro', 'novembro', 'dezembro'];\nconst MONTHS_SHORT = ['jan', 'fev', 'mar', 'abr', 'mai', 'jun', 'jul', 'ago', 'set', 'out', 'nov', 'dez'];\n\nfunction daysIn(y: number, m: number): number {\n return new Date(y, m + 1, 0).getDate();\n}\n\nexport function CalendarGrid({\n year,\n month,\n selectedDate,\n unavailable = [],\n onSelectDate,\n onMonthChange,\n renderDay,\n squareCells = false,\n trimEmptyRows = false,\n}: CalendarGridProps) {\n const now = React.useMemo(() => new Date(), []);\n // One integer for the visible month — `year*12 + month`. Keeps ‹ / › arithmetic\n // (and rapid clicks) correct across year boundaries with no Date() juggling.\n // `year` / `month` are the *initial* view; the component then owns it. A\n // consumer that needs to reset the view (DatePicker, on reopen) remounts\n // this component instead — see its own comment.\n const initialIndex = (year ?? now.getFullYear()) * 12 + (month ?? now.getMonth());\n const [viewIndex, setViewIndex] = React.useState(initialIndex);\n const viewYear = Math.floor(viewIndex / 12);\n const viewMonth = viewIndex % 12;\n // `selectedDate` is only a day number, so remember which month that pick was\n // made in — the highlight shows only there, never on the same day of another\n // month you navigate to.\n const [selectionIndex, setSelectionIndex] = React.useState(initialIndex);\n const [open, setOpen] = React.useState(false);\n const [picker, setPicker] = React.useState<'month' | 'year'>('month');\n const [yearBase, setYearBase] = React.useState(() => (year ?? now.getFullYear()) - 5);\n\n const rootRef = React.useRef<HTMLDivElement>(null);\n const titleRef = React.useRef<HTMLButtonElement>(null);\n const popRef = React.useRef<HTMLDivElement>(null);\n const gridRef = React.useRef<HTMLDivElement>(null);\n\n // Roving tabindex for the day grid: only one cell is ever in the Tab\n // order (below), so Tab enters/leaves the whole grid in one stop instead\n // of one per day. `activeDay` is the day-of-month that cell represents —\n // clamped to the visible month's length at render (below), since it\n // persists across a month change (‹ / › or an arrow-key crossing) where\n // the same day number may no longer exist (e.g. the 31st, into February).\n const [activeDay, setActiveDay] = React.useState(() => {\n if (selectedDate) return selectedDate;\n const todayIndex = now.getFullYear() * 12 + now.getMonth();\n return todayIndex === initialIndex ? now.getDate() : 1;\n });\n // Set right before a keyboard move changes activeDay/viewIndex; consumed\n // by the layout effect below to focus the new cell once it's in the DOM —\n // never on an unrelated render (a prop change, a re-render from the\n // parent) or the initial mount.\n const shouldFocusDayRef = React.useRef(false);\n\n // Notify on navigation — never on mount, always with the settled value.\n const onMonthChangeRef = React.useRef(onMonthChange);\n React.useEffect(() => {\n onMonthChangeRef.current = onMonthChange;\n });\n const didMount = React.useRef(false);\n React.useEffect(() => {\n if (!didMount.current) {\n didMount.current = true;\n return;\n }\n onMonthChangeRef.current?.(Math.floor(viewIndex / 12), viewIndex % 12);\n }, [viewIndex]);\n\n // close on outside pointer; move focus into the popover on open\n React.useEffect(() => {\n if (!open) return;\n const onDown = (e: PointerEvent) => {\n if (rootRef.current && !rootRef.current.contains(e.target as Node)) {\n setOpen(false);\n setPicker('month');\n }\n };\n document.addEventListener('pointerdown', onDown, true);\n const id = requestAnimationFrame(() => popRef.current?.focus());\n return () => {\n document.removeEventListener('pointerdown', onDown, true);\n cancelAnimationFrame(id);\n };\n }, [open]);\n\n const closePopover = React.useCallback(() => {\n setOpen(false);\n setPicker('month');\n titleRef.current?.focus();\n }, []);\n const toggleOpen = React.useCallback(() => {\n setOpen((v) => {\n if (v) setPicker('month');\n return !v;\n });\n }, []);\n\n const first = new Date(viewYear, viewMonth, 1).getDay();\n const total = daysIn(viewYear, viewMonth);\n // Always 6 rows (42 cells) so the calendar's height never shifts between\n // months — trailing blanks pad it out and carry the cell height too.\n const cells: (number | null)[] = [...Array(first).fill(null), ...Array.from({ length: total }, (_, i) => i + 1)];\n while (cells.length < 42) cells.push(null);\n if (trimEmptyRows) {\n while (cells.length > 7 && cells.slice(-7).every((c) => c === null)) cells.length -= 7;\n }\n // A plain day cell is a perfect square via aspect-ratio when `squareCells`\n // is set — its height then tracks the grid's actual column width (SS-243:\n // DatePicker's popover can be narrower than DateTimePicker's own card)\n // instead of a fixed guess that only looks square at one particular width.\n // `renderDay` needs literal extra height for its own content underneath\n // the day number regardless, so that case always keeps a fixed height.\n const cellSizing: React.CSSProperties = renderDay ? { height: 48 } : squareCells ? { aspectRatio: '1' } : { height: 38 };\n const years = Array.from({ length: 12 }, (_, i) => yearBase + i);\n const rovingDay = Math.min(Math.max(1, activeDay), total);\n\n // Arrow keys move the roving cursor by real calendar days — crossing into\n // the adjacent month's grid when they overflow the visible one, rather\n // than stopping dead at the edge. Home/End stay within the current week\n // row; PageUp/PageDown step the month (reusing the same ‹ / › state\n // change, so onMonthChange fires identically either way).\n const onGridKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {\n let delta = 0;\n switch (e.key) {\n case 'ArrowRight':\n delta = 1;\n break;\n case 'ArrowLeft':\n delta = -1;\n break;\n case 'ArrowDown':\n delta = 7;\n break;\n case 'ArrowUp':\n delta = -7;\n break;\n case 'Home': {\n e.preventDefault();\n const row = Math.floor((first + rovingDay - 1) / 7);\n shouldFocusDayRef.current = true;\n setActiveDay(Math.max(1, row * 7 - first + 1));\n return;\n }\n case 'End': {\n e.preventDefault();\n const row = Math.floor((first + rovingDay - 1) / 7);\n shouldFocusDayRef.current = true;\n setActiveDay(Math.min(total, row * 7 + 7 - first));\n return;\n }\n case 'PageUp':\n e.preventDefault();\n shouldFocusDayRef.current = true;\n setViewIndex((i) => i - 1);\n return;\n case 'PageDown':\n e.preventDefault();\n shouldFocusDayRef.current = true;\n setViewIndex((i) => i + 1);\n return;\n default:\n return;\n }\n e.preventDefault();\n const next = new Date(viewYear, viewMonth, rovingDay + delta);\n const nextViewIndex = next.getFullYear() * 12 + next.getMonth();\n shouldFocusDayRef.current = true;\n if (nextViewIndex !== viewIndex) setViewIndex(nextViewIndex);\n setActiveDay(next.getDate());\n };\n\n // Runs after the grid above (keyed on viewIndex, so a month change remounts\n // it) has committed the DOM for the new activeDay/viewIndex — only then\n // does the target cell actually exist to focus.\n React.useLayoutEffect(() => {\n if (!shouldFocusDayRef.current) return;\n shouldFocusDayRef.current = false;\n gridRef.current?.querySelector<HTMLButtonElement>(`[data-day=\"${rovingDay}\"]`)?.focus();\n }, [viewIndex, rovingDay]);\n\n return (\n <div ref={rootRef}>\n <div\n style={sx({\n position: 'relative',\n display: 'grid',\n gridTemplateColumns: 'auto 1fr auto',\n alignItems: 'center',\n gap: 'var(--space-1)',\n marginBottom: 'var(--space-3)',\n })}\n >\n <IconButton label=\"Mês anterior\" size=\"sm\" onClick={() => setViewIndex((i) => i - 1)}>\n <ChevronLeft size={18} strokeWidth={1.75} />\n </IconButton>\n\n <button\n ref={titleRef}\n type=\"button\"\n className=\"sereno-dtp-title\"\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n onClick={toggleOpen}\n style={sx({\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n gap: 4,\n margin: '0 auto',\n padding: '4px 8px',\n border: 'none',\n borderRadius: 'var(--radius-sm)',\n background: 'transparent',\n cursor: 'pointer',\n fontFamily: 'var(--font-display)',\n fontSize: 'var(--text-base)',\n fontWeight: 'var(--weight-bold)',\n color: 'var(--text-primary)',\n textTransform: 'capitalize',\n })}\n >\n {MONTHS[viewMonth]} {viewYear}\n <ChevronDown size={15} strokeWidth={2} style={{ opacity: 0.6 }} />\n </button>\n\n <IconButton label=\"Próximo mês\" size=\"sm\" onClick={() => setViewIndex((i) => i + 1)}>\n <ChevronRight size={18} strokeWidth={1.75} />\n </IconButton>\n\n {open && (\n <div\n ref={popRef}\n role=\"dialog\"\n aria-label=\"Escolher mês e ano\"\n tabIndex={-1}\n onKeyDown={(e) => {\n if (e.key === 'Escape') {\n e.stopPropagation();\n closePopover();\n }\n }}\n className=\"sereno-dtp-pop\"\n style={sx({\n position: 'absolute',\n top: 'calc(100% + 6px)',\n left: '50%',\n transform: 'translateX(-50%)',\n zIndex: 20,\n width: 248,\n maxWidth: 'calc(100vw - 24px)',\n background: 'var(--bg-surface)',\n border: 'var(--border-width-hairline) solid var(--border-default)',\n borderRadius: 'var(--radius-md)',\n boxShadow: 'var(--shadow-lg)',\n padding: 'var(--space-3)',\n outline: 'none',\n })}\n >\n <div\n style={sx({\n display: 'grid',\n gridTemplateColumns: 'auto 1fr auto',\n alignItems: 'center',\n marginBottom: 'var(--space-2)',\n })}\n >\n <IconButton\n label={picker === 'month' ? 'Ano anterior' : 'Anos anteriores'}\n size=\"sm\"\n onClick={() => (picker === 'month' ? setViewIndex((i) => i - 12) : setYearBase((b) => b - 12))}\n >\n <ChevronLeft size={18} strokeWidth={1.75} />\n </IconButton>\n\n {picker === 'month' ? (\n <button\n type=\"button\"\n className=\"sereno-dtp-title\"\n onClick={() => {\n setYearBase(viewYear - 5);\n setPicker('year');\n }}\n style={sx({\n margin: '0 auto',\n padding: '4px 8px',\n border: 'none',\n borderRadius: 'var(--radius-sm)',\n background: 'transparent',\n cursor: 'pointer',\n fontFamily: 'var(--font-display)',\n fontSize: 'var(--text-sm)',\n fontWeight: 'var(--weight-bold)',\n color: 'var(--text-primary)',\n })}\n >\n {viewYear}\n </button>\n ) : (\n <span\n style={sx({\n textAlign: 'center',\n fontFamily: 'var(--font-body)',\n fontSize: 'var(--text-sm)',\n fontWeight: 'var(--weight-semibold)',\n color: 'var(--text-secondary)',\n })}\n >\n {years[0]}–{years[11]}\n </span>\n )}\n\n <IconButton\n label={picker === 'month' ? 'Próximo ano' : 'Próximos anos'}\n size=\"sm\"\n onClick={() => (picker === 'month' ? setViewIndex((i) => i + 12) : setYearBase((b) => b + 12))}\n >\n <ChevronRight size={18} strokeWidth={1.75} />\n </IconButton>\n </div>\n\n <div className=\"sereno-dtp-grid\" style={sx({ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 'var(--space-1)' })}>\n {picker === 'month'\n ? MONTHS_SHORT.map((mo, i) => (\n <button\n key={mo}\n type=\"button\"\n data-current={i === viewMonth || undefined}\n aria-current={i === viewMonth ? 'true' : undefined}\n onClick={() => {\n setViewIndex(viewYear * 12 + i);\n closePopover();\n }}\n >\n {mo}\n </button>\n ))\n : years.map((y) => (\n <button\n key={y}\n type=\"button\"\n data-current={y === viewYear || undefined}\n aria-current={y === viewYear ? 'true' : undefined}\n onClick={() => {\n setViewIndex(y * 12 + viewMonth);\n setPicker('month');\n }}\n >\n {y}\n </button>\n ))}\n </div>\n </div>\n )}\n </div>\n\n <div style={sx({ display: 'grid', gridTemplateColumns: 'repeat(7,1fr)', gap: 'var(--space-1)', marginBottom: 'var(--space-1)' })}>\n {DOW.map((d, i) => (\n <span\n key={i}\n style={sx({\n textAlign: 'center',\n fontFamily: 'var(--font-body)',\n fontSize: 'var(--text-2xs)',\n fontWeight: 'var(--weight-semibold)',\n color: 'var(--text-muted)',\n letterSpacing: 'var(--tracking-caps)',\n })}\n >\n {d}\n </span>\n ))}\n </div>\n {/* keyed on the month so cells remount cleanly — no bg transition when a\n slot morphs from one day to another on navigation. */}\n <div\n key={viewIndex}\n ref={gridRef}\n onKeyDown={onGridKeyDown}\n className=\"sereno-dtp-days\"\n style={sx({ display: 'grid', gridTemplateColumns: 'repeat(7,1fr)', gap: 'var(--space-1)' })}\n >\n {cells.map((d, i) => {\n // Blank cells still take the row height so the 6-row grid can't collapse.\n if (d === null) return <span key={i} aria-hidden style={cellSizing} />;\n const off = unavailable.includes(d);\n const sel = selectedDate === d && viewIndex === selectionIndex;\n const extra = renderDay?.(d);\n return (\n <button\n key={i}\n type=\"button\"\n data-day={d}\n // Not the native `disabled` — an unavailable day stays a real,\n // focusable stop on the roving cursor (aria-disabled only) so\n // arrow-key navigation can still land on it and the user can\n // tell it exists, matching the WAI-ARIA date-grid pattern. A\n // truly `disabled` button can't receive focus at all, which\n // would make the roving tabindex below silently break.\n aria-disabled={off || undefined}\n tabIndex={d === rovingDay ? 0 : -1}\n aria-pressed={sel}\n onClick={() => {\n if (off) return;\n setSelectionIndex(viewIndex);\n // Keep the roving cursor in sync with a mouse pick too — a\n // click already moves real DOM focus onto this button\n // natively, so without this the *next* arrow press would\n // jump from wherever the keyboard cursor was left instead\n // of from the day the user can see is focused/selected.\n setActiveDay(d);\n onSelectDate?.(d);\n }}\n style={sx({\n ...cellSizing,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n gap: 1,\n borderRadius: 'var(--radius-sm)',\n border: 'none',\n padding: 0,\n cursor: off ? 'not-allowed' : 'pointer',\n background: sel ? 'var(--interactive-primary)' : 'transparent',\n color: sel ? 'var(--interactive-primary-fg)' : off ? 'var(--text-disabled)' : 'var(--text-primary)',\n fontFamily: 'var(--font-body)',\n fontSize: 'var(--text-sm)',\n fontWeight: sel ? 'var(--weight-bold)' : 'var(--weight-medium)',\n textDecoration: off ? 'line-through' : 'none',\n transition: 'var(--transition-control)',\n // Not inline outline:none — that would always beat the\n // .sereno-dtp-days:focus-visible rule below no matter what\n // it says (inline style always outranks a class selector).\n // Suppressed as a class rule instead, same specificity as\n // the :focus-visible override that re-enables it.\n })}\n >\n <span>{d}</span>\n {renderDay ? <span style={sx({ display: 'flex', minHeight: 12, lineHeight: 1 })}>{extra}</span> : null}\n </button>\n );\n })}\n </div>\n </div>\n );\n}\n"],"mappings":";AAkPU,cAGF,YAHE;AAhPV,YAAY,WAAW;AACvB,SAAS,aAAa,aAAa,oBAAoB;AACvD,SAAS,UAAU;AACnB,SAAS,kBAAkB;AAuC3B,MAAM,MAAM,CAAC,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,GAAG;AAC9C,MAAM,SAAS,CAAC,WAAW,aAAa,YAAS,SAAS,QAAQ,SAAS,SAAS,UAAU,YAAY,WAAW,YAAY,UAAU;AAC3I,MAAM,eAAe,CAAC,OAAO,OAAO,OAAO,OAAO,OAAO,OAAO,OAAO,OAAO,OAAO,OAAO,OAAO,KAAK;AAExG,SAAS,OAAO,GAAW,GAAmB;AAC5C,SAAO,IAAI,KAAK,GAAG,IAAI,GAAG,CAAC,EAAE,QAAQ;AACvC;AAEO,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA,cAAc,CAAC;AAAA,EACf;AAAA,EACA;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd,gBAAgB;AAClB,GAAsB;AACpB,QAAM,MAAM,MAAM,QAAQ,MAAM,oBAAI,KAAK,GAAG,CAAC,CAAC;AAM9C,QAAM,gBAAgB,QAAQ,IAAI,YAAY,KAAK,MAAM,SAAS,IAAI,SAAS;AAC/E,QAAM,CAAC,WAAW,YAAY,IAAI,MAAM,SAAS,YAAY;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,gBACR,SAAS;AAAA,gBACT,QAAQ,MAAM,gBAAgB;AAAA,gBAC9B,YAAY,MAAM,+BAA+B;AAAA,gBACjD,OAAO,MAAM,kCAAkC,MAAM,yBAAyB;AAAA,gBAC9E,YAAY;AAAA,gBACZ,UAAU;AAAA,gBACV,YAAY,MAAM,uBAAuB;AAAA,gBACzC,gBAAgB,MAAM,iBAAiB;AAAA,gBACvC,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAMd,CAAC;AAAA,cAED;AAAA,oCAAC,UAAM,aAAE;AAAA,gBACR,YAAY,oBAAC,UAAK,OAAO,GAAG,EAAE,SAAS,QAAQ,WAAW,IAAI,YAAY,EAAE,CAAC,GAAI,iBAAM,IAAU;AAAA;AAAA;AAAA,YAjD7F;AAAA,UAkDP;AAAA,QAEJ,CAAC;AAAA;AAAA,MAlEI;AAAA,IAmEP;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
|
|
3
|
+
type FieldBoxSize = 'sm' | 'md' | 'lg';
|
|
4
|
+
declare const CONTROL_HEIGHT: Record<FieldBoxSize, string>;
|
|
5
|
+
/**
|
|
6
|
+
* The bordered field-box chrome shared by any control whose trigger looks
|
|
7
|
+
* like a text field but opens something else on click — `Select`'s
|
|
8
|
+
* `<button role="combobox">`, `DatePicker`'s calendar trigger (SS-243).
|
|
9
|
+
* Not for `Input`/`Textarea` themselves — those style their own `<input>`/
|
|
10
|
+
* `<textarea>` directly, with no separate "trigger vs. panel" split.
|
|
11
|
+
*/
|
|
12
|
+
declare function fieldBoxStyle(size: FieldBoxSize, error: boolean, open: boolean, disabled: boolean): CSSProperties;
|
|
13
|
+
|
|
14
|
+
export { CONTROL_HEIGHT, type FieldBoxSize, fieldBoxStyle };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { sx } from "../../_internal/style";
|
|
2
|
+
const CONTROL_HEIGHT = {
|
|
3
|
+
sm: "var(--control-height-sm)",
|
|
4
|
+
md: "var(--control-height-md)",
|
|
5
|
+
lg: "var(--control-height-lg)"
|
|
6
|
+
};
|
|
7
|
+
function fieldBoxStyle(size, error, open, disabled) {
|
|
8
|
+
const active = open && !error;
|
|
9
|
+
return sx({
|
|
10
|
+
display: "flex",
|
|
11
|
+
alignItems: "center",
|
|
12
|
+
gap: "var(--space-2)",
|
|
13
|
+
width: "100%",
|
|
14
|
+
height: CONTROL_HEIGHT[size],
|
|
15
|
+
// Longhand (not the `padding` shorthand) so callers can override one side
|
|
16
|
+
// — e.g. NativeSelect's right pad — without React leaving the others blank.
|
|
17
|
+
paddingTop: 0,
|
|
18
|
+
paddingRight: "var(--space-3)",
|
|
19
|
+
paddingBottom: 0,
|
|
20
|
+
paddingLeft: "var(--space-3)",
|
|
21
|
+
borderRadius: "var(--radius-control)",
|
|
22
|
+
background: disabled ? "var(--interactive-disabled-bg)" : "var(--bg-surface)",
|
|
23
|
+
border: "var(--border-width-hairline) solid " + (error ? "var(--interactive-error)" : open ? "var(--border-focus)" : "var(--border-default)"),
|
|
24
|
+
boxShadow: active ? "var(--focus-ring)" : "none",
|
|
25
|
+
fontFamily: "var(--font-body)",
|
|
26
|
+
fontSize: size === "sm" ? "var(--text-sm)" : "var(--text-base)",
|
|
27
|
+
color: disabled ? "var(--text-disabled)" : "var(--text-primary)",
|
|
28
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
|
29
|
+
transition: "var(--transition-control)",
|
|
30
|
+
textAlign: "left"
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
CONTROL_HEIGHT,
|
|
35
|
+
fieldBoxStyle
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=fieldBoxStyle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/forms/_internal/fieldBoxStyle.ts"],"sourcesContent":["import type { CSSProperties } from 'react';\nimport { sx } from '../../_internal/style';\n\nexport type FieldBoxSize = 'sm' | 'md' | 'lg';\n\nexport const CONTROL_HEIGHT: Record<FieldBoxSize, string> = {\n sm: 'var(--control-height-sm)',\n md: 'var(--control-height-md)',\n lg: 'var(--control-height-lg)',\n};\n\n/**\n * The bordered field-box chrome shared by any control whose trigger looks\n * like a text field but opens something else on click — `Select`'s\n * `<button role=\"combobox\">`, `DatePicker`'s calendar trigger (SS-243).\n * Not for `Input`/`Textarea` themselves — those style their own `<input>`/\n * `<textarea>` directly, with no separate \"trigger vs. panel\" split.\n */\nexport function fieldBoxStyle(size: FieldBoxSize, error: boolean, open: boolean, disabled: boolean): CSSProperties {\n const active = open && !error;\n return sx({\n display: 'flex',\n alignItems: 'center',\n gap: 'var(--space-2)',\n width: '100%',\n height: CONTROL_HEIGHT[size],\n // Longhand (not the `padding` shorthand) so callers can override one side\n // — e.g. NativeSelect's right pad — without React leaving the others blank.\n paddingTop: 0,\n paddingRight: 'var(--space-3)',\n paddingBottom: 0,\n paddingLeft: 'var(--space-3)',\n borderRadius: 'var(--radius-control)',\n background: disabled ? 'var(--interactive-disabled-bg)' : 'var(--bg-surface)',\n border: 'var(--border-width-hairline) solid ' + (error ? 'var(--interactive-error)' : open ? 'var(--border-focus)' : 'var(--border-default)'),\n boxShadow: active ? 'var(--focus-ring)' : 'none',\n fontFamily: 'var(--font-body)',\n fontSize: size === 'sm' ? 'var(--text-sm)' : 'var(--text-base)',\n color: disabled ? 'var(--text-disabled)' : 'var(--text-primary)',\n cursor: disabled ? 'not-allowed' : 'pointer',\n transition: 'var(--transition-control)',\n textAlign: 'left',\n });\n}\n"],"mappings":"AACA,SAAS,UAAU;AAIZ,MAAM,iBAA+C;AAAA,EAC1D,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AASO,SAAS,cAAc,MAAoB,OAAgB,MAAe,UAAkC;AACjH,QAAM,SAAS,QAAQ,CAAC;AACxB,SAAO,GAAG;AAAA,IACR,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,KAAK;AAAA,IACL,OAAO;AAAA,IACP,QAAQ,eAAe,IAAI;AAAA;AAAA;AAAA,IAG3B,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,eAAe;AAAA,IACf,aAAa;AAAA,IACb,cAAc;AAAA,IACd,YAAY,WAAW,mCAAmC;AAAA,IAC1D,QAAQ,yCAAyC,QAAQ,6BAA6B,OAAO,wBAAwB;AAAA,IACrH,WAAW,SAAS,sBAAsB;AAAA,IAC1C,YAAY;AAAA,IACZ,UAAU,SAAS,OAAO,mBAAmB;AAAA,IAC7C,OAAO,WAAW,yBAAyB;AAAA,IAC3C,QAAQ,WAAW,gBAAgB;AAAA,IACnC,YAAY;AAAA,IACZ,WAAW;AAAA,EACb,CAAC;AACH;","names":[]}
|
package/dist/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export { Checkbox, CheckboxProps } from './forms/Checkbox.js';
|
|
|
13
13
|
export { Radio, RadioProps } from './forms/Radio.js';
|
|
14
14
|
export { Switch, SwitchProps } from './forms/Switch.js';
|
|
15
15
|
export { DateTimePicker, DateTimePickerProps, TimeSlot } from './forms/DateTimePicker.js';
|
|
16
|
+
export { DatePicker, DatePickerProps } from './forms/DatePicker.js';
|
|
16
17
|
export { FileUpload, FileUploadProps } from './forms/FileUpload.js';
|
|
17
18
|
export { AvatarUpload, AvatarUploadProps } from './forms/AvatarUpload.js';
|
|
18
19
|
export { SearchInput, SearchInputProps } from './forms/SearchInput.js';
|
package/dist/index.js
CHANGED
|
@@ -15,6 +15,7 @@ import { Checkbox } from "./forms/Checkbox";
|
|
|
15
15
|
import { Radio } from "./forms/Radio";
|
|
16
16
|
import { Switch } from "./forms/Switch";
|
|
17
17
|
import { DateTimePicker } from "./forms/DateTimePicker";
|
|
18
|
+
import { DatePicker } from "./forms/DatePicker";
|
|
18
19
|
import { FileUpload } from "./forms/FileUpload";
|
|
19
20
|
import { AvatarUpload } from "./forms/AvatarUpload";
|
|
20
21
|
import { SearchInput } from "./forms/SearchInput";
|
|
@@ -46,6 +47,7 @@ export {
|
|
|
46
47
|
Button,
|
|
47
48
|
Card,
|
|
48
49
|
Checkbox,
|
|
50
|
+
DatePicker,
|
|
49
51
|
DateTimePicker,
|
|
50
52
|
Dialog,
|
|
51
53
|
EmptyState,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// Sereno Design System — public component surface. See the /design-system\n// showcase for the live catalog, or the barrel smoke test for the full list.\n// Icons are passed in as props (lucide-react), never imported here; theming is\n// 100% CSS custom properties.\n\n// core\nexport { Button, type ButtonProps } from './core/Button';\nexport { IconButton, type IconButtonProps } from './core/IconButton';\nexport { Badge, type BadgeProps } from './core/Badge';\nexport { Card, type CardProps } from './core/Card';\nexport { Avatar, type AvatarProps } from './core/Avatar';\nexport { Brand, type BrandProps } from './core/Brand';\nexport { Menu, type MenuProps, type MenuItem, type MenuEntry, type MenuSeparator, type MenuHeading } from './core/Menu';\nexport {\n Table,\n type TableProps,\n type TableRowProps,\n type HeaderCellProps,\n type CellProps,\n type TableSort,\n type SortDirection,\n} from './core/Table';\n\n// forms\nexport { Input, type InputProps } from './forms/Input';\nexport { Textarea, type TextareaProps } from './forms/Textarea';\nexport { Select, type SelectProps, type SelectOption } from './forms/Select';\nexport { Checkbox, type CheckboxProps } from './forms/Checkbox';\nexport { Radio, type RadioProps } from './forms/Radio';\nexport { Switch, type SwitchProps } from './forms/Switch';\nexport { DateTimePicker, type DateTimePickerProps, type TimeSlot } from './forms/DateTimePicker';\nexport { FileUpload, type FileUploadProps } from './forms/FileUpload';\nexport { AvatarUpload, type AvatarUploadProps } from './forms/AvatarUpload';\nexport { SearchInput, type SearchInputProps } from './forms/SearchInput';\n\n// navigation\nexport { TopBar, type TopBarProps, type TopBarLeadingProps, type TopBarTitleProps, type TopBarActionsProps } from './navigation/TopBar';\nexport { Tabs, type TabsProps, type TabsListProps, type TabsTabProps, type TabsPanelProps } from './navigation/Tabs';\nexport { BottomNav, type BottomNavProps, type BottomNavItemProps } from './navigation/BottomNav';\nexport {\n SidebarNav,\n type SidebarNavProps,\n type SidebarNavSectionProps,\n type SidebarNavItemProps,\n type SidebarNavSubItemProps,\n} from './navigation/SidebarNav';\nexport { Stepper, type StepperProps, type StepperStepProps } from './navigation/Stepper';\n\n// feedback\nexport { Alert, type AlertProps } from './feedback/Alert';\nexport { Toast, type ToastProps } from './feedback/Toast';\nexport {\n ToastProvider,\n useToast,\n type ToastProviderProps,\n type ToastOptions,\n type ToastApi,\n type ToastContextValue,\n type ToastPosition,\n} from './feedback/ToastProvider';\nexport { Dialog, type DialogProps, type DialogHeaderProps, type DialogBodyProps, type DialogFooterProps } from './feedback/Dialog';\nexport { Skeleton, type SkeletonProps } from './feedback/Skeleton';\nexport { EmptyState, type EmptyStateProps } from './feedback/EmptyState';\n\n// theme — the `data-theme` provider (next-themes) + the light/dark toggle\nexport { ThemeProvider } from './theme/ThemeProvider';\nexport { ThemeToggle } from './theme/ThemeToggle';\n"],"mappings":"AAMA,SAAS,cAAgC;AACzC,SAAS,kBAAwC;AACjD,SAAS,aAA8B;AACvC,SAAS,YAA4B;AACrC,SAAS,cAAgC;AACzC,SAAS,aAA8B;AACvC,SAAS,YAAiG;AAC1G;AAAA,EACE;AAAA,OAOK;AAGP,SAAS,aAA8B;AACvC,SAAS,gBAAoC;AAC7C,SAAS,cAAmD;AAC5D,SAAS,gBAAoC;AAC7C,SAAS,aAA8B;AACvC,SAAS,cAAgC;AACzC,SAAS,sBAA+D;AACxE,SAAS,kBAAwC;AACjD,SAAS,oBAA4C;AACrD,SAAS,mBAA0C;AAGnD,SAAS,cAAyG;AAClH,SAAS,YAAwF;AACjG,SAAS,iBAA+D;AACxE;AAAA,EACE;AAAA,OAKK;AACP,SAAS,eAAyD;AAGlE,SAAS,aAA8B;AACvC,SAAS,aAA8B;AACvC;AAAA,EACE;AAAA,EACA;AAAA,OAMK;AACP,SAAS,cAAsG;AAC/G,SAAS,gBAAoC;AAC7C,SAAS,kBAAwC;AAGjD,SAAS,qBAAqB;AAC9B,SAAS,mBAAmB;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// Sereno Design System — public component surface. See the /design-system\n// showcase for the live catalog, or the barrel smoke test for the full list.\n// Icons are passed in as props (lucide-react), never imported here; theming is\n// 100% CSS custom properties.\n\n// core\nexport { Button, type ButtonProps } from './core/Button';\nexport { IconButton, type IconButtonProps } from './core/IconButton';\nexport { Badge, type BadgeProps } from './core/Badge';\nexport { Card, type CardProps } from './core/Card';\nexport { Avatar, type AvatarProps } from './core/Avatar';\nexport { Brand, type BrandProps } from './core/Brand';\nexport { Menu, type MenuProps, type MenuItem, type MenuEntry, type MenuSeparator, type MenuHeading } from './core/Menu';\nexport {\n Table,\n type TableProps,\n type TableRowProps,\n type HeaderCellProps,\n type CellProps,\n type TableSort,\n type SortDirection,\n} from './core/Table';\n\n// forms\nexport { Input, type InputProps } from './forms/Input';\nexport { Textarea, type TextareaProps } from './forms/Textarea';\nexport { Select, type SelectProps, type SelectOption } from './forms/Select';\nexport { Checkbox, type CheckboxProps } from './forms/Checkbox';\nexport { Radio, type RadioProps } from './forms/Radio';\nexport { Switch, type SwitchProps } from './forms/Switch';\nexport { DateTimePicker, type DateTimePickerProps, type TimeSlot } from './forms/DateTimePicker';\nexport { DatePicker, type DatePickerProps } from './forms/DatePicker';\nexport { FileUpload, type FileUploadProps } from './forms/FileUpload';\nexport { AvatarUpload, type AvatarUploadProps } from './forms/AvatarUpload';\nexport { SearchInput, type SearchInputProps } from './forms/SearchInput';\n\n// navigation\nexport { TopBar, type TopBarProps, type TopBarLeadingProps, type TopBarTitleProps, type TopBarActionsProps } from './navigation/TopBar';\nexport { Tabs, type TabsProps, type TabsListProps, type TabsTabProps, type TabsPanelProps } from './navigation/Tabs';\nexport { BottomNav, type BottomNavProps, type BottomNavItemProps } from './navigation/BottomNav';\nexport {\n SidebarNav,\n type SidebarNavProps,\n type SidebarNavSectionProps,\n type SidebarNavItemProps,\n type SidebarNavSubItemProps,\n} from './navigation/SidebarNav';\nexport { Stepper, type StepperProps, type StepperStepProps } from './navigation/Stepper';\n\n// feedback\nexport { Alert, type AlertProps } from './feedback/Alert';\nexport { Toast, type ToastProps } from './feedback/Toast';\nexport {\n ToastProvider,\n useToast,\n type ToastProviderProps,\n type ToastOptions,\n type ToastApi,\n type ToastContextValue,\n type ToastPosition,\n} from './feedback/ToastProvider';\nexport { Dialog, type DialogProps, type DialogHeaderProps, type DialogBodyProps, type DialogFooterProps } from './feedback/Dialog';\nexport { Skeleton, type SkeletonProps } from './feedback/Skeleton';\nexport { EmptyState, type EmptyStateProps } from './feedback/EmptyState';\n\n// theme — the `data-theme` provider (next-themes) + the light/dark toggle\nexport { ThemeProvider } from './theme/ThemeProvider';\nexport { ThemeToggle } from './theme/ThemeToggle';\n"],"mappings":"AAMA,SAAS,cAAgC;AACzC,SAAS,kBAAwC;AACjD,SAAS,aAA8B;AACvC,SAAS,YAA4B;AACrC,SAAS,cAAgC;AACzC,SAAS,aAA8B;AACvC,SAAS,YAAiG;AAC1G;AAAA,EACE;AAAA,OAOK;AAGP,SAAS,aAA8B;AACvC,SAAS,gBAAoC;AAC7C,SAAS,cAAmD;AAC5D,SAAS,gBAAoC;AAC7C,SAAS,aAA8B;AACvC,SAAS,cAAgC;AACzC,SAAS,sBAA+D;AACxE,SAAS,kBAAwC;AACjD,SAAS,kBAAwC;AACjD,SAAS,oBAA4C;AACrD,SAAS,mBAA0C;AAGnD,SAAS,cAAyG;AAClH,SAAS,YAAwF;AACjG,SAAS,iBAA+D;AACxE;AAAA,EACE;AAAA,OAKK;AACP,SAAS,eAAyD;AAGlE,SAAS,aAA8B;AACvC,SAAS,aAA8B;AACvC;AAAA,EACE;AAAA,EACA;AAAA,OAMK;AACP,SAAS,cAAsG;AAC/G,SAAS,gBAAoC;AAC7C,SAAS,kBAAwC;AAGjD,SAAS,qBAAqB;AAC9B,SAAS,mBAAmB;","names":[]}
|