feat(date-picker): support configurable week starts

This commit is contained in:
2026-03-23 11:28:53 +08:00
parent 4d67f4ad76
commit c570431dba
5 changed files with 226 additions and 156 deletions
@@ -37,7 +37,7 @@ function DatePickerPlayground() {
function DatePickerScenarios() {
return (
<div className="grid w-full max-w-4xl gap-4 md:grid-cols-2">
<div className="grid w-full max-w-6xl gap-4 md:grid-cols-2 xl:grid-cols-3">
<Card>
<CardHeader>
<CardTitle>Empty state</CardTitle>
@@ -48,6 +48,24 @@ function DatePickerScenarios() {
</CardContent>
</Card>
<Card>
<CardHeader>
<CardTitle>Sunday-first calendar</CardTitle>
<CardDescription>
Opt into Sunday-through-Saturday when matching US-style calendar conventions.
</CardDescription>
</CardHeader>
<CardContent>
<DatePicker
aria-label="Sunday-first launch date"
defaultMonth={new Date(2026, 2, 1)}
defaultValue={new Date(2026, 2, 18)}
locale="en-US"
weekStartsOn="sunday"
/>
</CardContent>
</Card>
<Card>
<CardHeader>
<CardTitle>Guardrailed window</CardTitle>
@@ -76,7 +94,7 @@ const meta = {
docs: {
description: {
component:
"A single-date picker for launch windows, review deadlines, and operator scheduling surfaces. This first slice stays intentionally narrow: one date, one popover calendar, no range or timezone API."
"A single-date picker for launch windows, review deadlines, and operator scheduling surfaces. It defaults to a Monday-through-Sunday calendar, with an opt-in Sunday-first mode for teams that need that convention. This first slice stays intentionally narrow: one date, one popover calendar, no range or timezone API."
}
},
layout: "centered"