@hjmds/design-contracts 1.27.2 → 1.28.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/activity-chip.d.ts +1 -1
- package/dist/activity-chip.js +1 -1
- package/dist/activity-chip.js.map +1 -1
- package/dist/auth-screen.d.ts +77 -5
- package/dist/auth-screen.d.ts.map +1 -1
- package/dist/auth-screen.js +63 -2
- package/dist/auth-screen.js.map +1 -1
- package/dist/base-recipes.d.ts +1 -1
- package/dist/base-recipes.js +1 -1
- package/dist/base-recipes.js.map +1 -1
- package/dist/behaviors.d.ts +1 -1
- package/dist/breadcrumb.d.ts +1 -1
- package/dist/breadcrumb.js +1 -1
- package/dist/breadcrumb.js.map +1 -1
- package/dist/calendar.d.ts +1 -1
- package/dist/calendar.js +2 -2
- package/dist/calendar.js.map +1 -1
- package/dist/catalog.d.ts +131 -87
- package/dist/catalog.d.ts.map +1 -1
- package/dist/component-contracts.d.ts +1 -1
- package/dist/component-contracts.js +1 -1
- package/dist/component-contracts.js.map +1 -1
- package/dist/component-recipes.d.ts +85 -57
- package/dist/component-recipes.d.ts.map +1 -1
- package/dist/component-recipes.js +98 -60
- package/dist/component-recipes.js.map +1 -1
- package/dist/conversation-row.d.ts +2 -2
- package/dist/conversation-row.d.ts.map +1 -1
- package/dist/conversation-row.js +6 -4
- package/dist/conversation-row.js.map +1 -1
- package/dist/counter-badge-recipe.d.ts +1 -1
- package/dist/counter-badge-recipe.js +1 -1
- package/dist/counter-badge-recipe.js.map +1 -1
- package/dist/data-table.d.ts +4 -4
- package/dist/data-table.js +4 -4
- package/dist/data-table.js.map +1 -1
- package/dist/date-picker.d.ts +1 -1
- package/dist/design-profile.d.ts.map +1 -1
- package/dist/design-profile.js +19 -16
- package/dist/design-profile.js.map +1 -1
- package/dist/file-picker.d.ts +1 -1
- package/dist/file-picker.js +1 -1
- package/dist/file-picker.js.map +1 -1
- package/dist/foundations.d.ts +18 -14
- package/dist/foundations.d.ts.map +1 -1
- package/dist/foundations.js +18 -13
- package/dist/foundations.js.map +1 -1
- package/dist/heading.d.ts +13 -13
- package/dist/heading.js.map +1 -1
- package/dist/number-field.d.ts +1 -1
- package/dist/otp-field.d.ts +1 -1
- package/dist/password-field.d.ts +1 -1
- package/dist/result.d.ts +1 -1
- package/dist/result.js +2 -2
- package/dist/result.js.map +1 -1
- package/dist/screen-patterns.d.ts +36 -0
- package/dist/screen-patterns.d.ts.map +1 -1
- package/dist/screen-patterns.js +20 -0
- package/dist/screen-patterns.js.map +1 -1
- package/dist/semantic-colors.d.ts +10 -0
- package/dist/semantic-colors.d.ts.map +1 -1
- package/dist/semantic-colors.js +6 -0
- package/dist/semantic-colors.js.map +1 -1
- package/dist/sheet.d.ts +7 -4
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +8 -5
- package/dist/sheet.js.map +1 -1
- package/dist/side-panel.d.ts +1 -1
- package/dist/side-panel.js +2 -2
- package/dist/side-panel.js.map +1 -1
- package/dist/steps.d.ts +1 -1
- package/dist/steps.js +1 -1
- package/dist/steps.js.map +1 -1
- package/dist/tag.d.ts +1 -1
- package/dist/tag.js +1 -1
- package/dist/tag.js.map +1 -1
- package/dist/timeline.d.ts +1 -1
- package/dist/timeline.js +1 -1
- package/dist/timeline.js.map +1 -1
- package/dist/top.d.ts +4 -4
- package/dist/top.d.ts.map +1 -1
- package/dist/top.js +3 -1
- package/dist/top.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/docs/activity-chip.md +5 -1
- package/docs/auth-screen.md +2 -0
- package/docs/design-profile.md +14 -10
- package/docs/generated/component-maturity.md +1 -1
- package/docs/generated/renderer-evidence.json +9 -5
- package/docs/generated/renderer-evidence.md +1 -1
- package/docs/generated/showcase-manifest.json +1 -1
- package/docs/heading.md +14 -9
- package/docs/sheet.md +2 -0
- package/docs/top.md +4 -3
- package/docs/usage/README.md +1 -1
- package/docs/usage/SELECTION.md +1 -0
- package/docs/usage/components/auth-screen-layout.md +44 -11
- package/docs/usage/components/bottom-cta.md +6 -2
- package/docs/usage/components/breadcrumb.md +5 -1
- package/docs/usage/components/chat-screen.md +1 -0
- package/docs/usage/components/checkbox-group.md +5 -1
- package/docs/usage/components/collapsible.md +1 -0
- package/docs/usage/components/comment-thread-screen.md +2 -0
- package/docs/usage/components/dialog.md +1 -0
- package/docs/usage/components/editor-screen.md +1 -0
- package/docs/usage/components/effect-surface.md +2 -2
- package/docs/usage/components/field.md +1 -0
- package/docs/usage/components/heading.md +14 -12
- package/docs/usage/components/list-detail-screen.md +1 -0
- package/docs/usage/components/list-row.md +7 -3
- package/docs/usage/components/list.md +25 -4
- package/docs/usage/components/notification-item.md +5 -1
- package/docs/usage/components/onboarding-screen.md +1 -0
- package/docs/usage/components/photo-source-sheet.md +1 -1
- package/docs/usage/components/screen-layout.md +28 -3
- package/docs/usage/components/search-field.md +1 -0
- package/docs/usage/components/search-screen.md +4 -2
- package/docs/usage/components/section.md +5 -1
- package/docs/usage/components/segmented-control.md +1 -1
- package/docs/usage/components/sheet.md +18 -13
- package/docs/usage/components/skeleton.md +42 -15
- package/docs/usage/components/statistic.md +5 -1
- package/docs/usage/components/switch.md +3 -2
- package/docs/usage/components/tag.md +5 -1
- package/docs/usage/components/text-area.md +1 -0
- package/docs/usage/components/text.md +6 -4
- package/docs/usage/components/top.md +1 -1
- package/docs/usage/compositions/adaptive-content.md +5 -1
- package/docs/usage/compositions/compound-controls.md +2 -1
- package/docs/usage/compositions/design-profile-comparison.md +1 -1
- package/docs/usage/compositions/family-drawer.md +5 -3
- package/docs/usage/compositions/input-sheet.md +1 -1
- package/docs/usage/compositions/interaction-flow-apply.md +3 -3
- package/docs/usage/compositions/photo-source.md +3 -3
- package/docs/usage/compositions/selection-motion.md +5 -1
- package/docs/usage/compositions/visual-foundations.md +5 -4
- package/docs/usage/screens/common-login.md +9 -7
- package/docs/usage/screens/landing.md +15 -14
- package/docs/usage/screens/notification-settings.md +4 -2
- package/docs/usage/tokens/typography.md +21 -13
- package/package.json +1 -1
package/dist/calendar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar.js","sourceRoot":"","sources":["../src/calendar.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAA0D,MAAM,kBAAkB,CAAC;AACxJ,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,MAAM,gBAAgB,GAAG,qBAAqB,CAAC;AAC/C,MAAM,iBAAiB,GAAG,yBAAyB,CAAC;AACpD,MAAM,YAAY,GAAG,CAAC,CAAC;AAEvB,SAAS,cAAc,CAAC,KAAa,EAAE,KAAa;IAClD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3D,MAAM,IAAI,SAAS,CAAC,YAAY,KAAK,oBAAoB,CAAC,CAAC;IAC7D,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAa;IAC7C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACnE,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,KAAa,EAAE,KAAa;IAChE,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,SAAS,CAAC,YAAY,KAAK,0CAA0C,CAAC,CAAC;IACnF,CAAC;AACH,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,KAAa;IAC9C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACpE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CAAC,OAAO;SAC7C;QACD,KAAK,EAAE,sBAAsB;KAC9B;CAsBF,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,UAAU,EAAE;QACV,cAAc;QACd,qBAAqB;QACrB,mBAAmB;QACnB,cAAc;QACd,qBAAqB;QACrB,sBAAsB;KACvB;IACD,MAAM,EAAE,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,SAAS,EAAE;QACT,YAAY,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC;QACrC,KAAK,EAAE,CAAC,UAAU,CAAC;KACpB;IACD,GAAG,EAAE;QACH,KAAK,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,CAAC;QAC5C,QAAQ,EAAE;YACR,KAAK;YACL,OAAO;YACP,OAAO;YACP,SAAS;YACT,WAAW;YACX,WAAW;YACX,YAAY;YACZ,MAAM;YACN,KAAK;SACN;QACD,KAAK,EAAE,QAAQ;KAChB;IACD,MAAM,EAAE;QACN,KAAK,EAAE,CAAC,QAAQ,CAAC;QACjB,MAAM,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;QAChC,OAAO,EAAE,CAAC,UAAU,CAAC;KACtB;IACD,SAAS,EAAE;QACT,8DAA8D;QAC9D,oDAAoD;QACpD,+DAA+D;QAC/D,uEAAuE;QACvE,+EAA+E;QAC/E,0EAA0E;QAC1E,6DAA6D;QAC7D,kEAAkE;QAClE,6CAA6C;KAC9C;CACkC,CAAC","sourcesContent":["import type { ColorReference } from \"./color-references.js\";\nimport type { BehaviorContract, WebKeyboardKey } from \"./behaviors.js\";\nimport type { DesignSystemDirection } from \"./design-system-provider.js\";\nimport type { SemanticIconName } from \"./icon.js\";\nimport { control, fontWeight, glyph, layout, opacity, spacing, stroke, type FontWeightValue, type GlyphSize, type TextVariant } from \"./foundations.js\";\nimport { focusIndicatorContract } from \"./component-contracts.js\";\nimport { semanticColors } from \"./semantic-colors.js\";\n\nconst ISO_DATE_PATTERN = /^\\d{4}-\\d{2}-\\d{2}$/;\nconst ISO_MONTH_PATTERN = /^\\d{4}-(0[1-9]|1[0-2])$/;\nconst GRID_COLUMNS = 7;\n\nfunction assertNonEmpty(value: string, field: string): void {\n if (typeof value !== \"string\" || value.trim().length === 0) {\n throw new TypeError(`Calendar ${field} must not be empty`);\n }\n}\n\n/**\n * The grid never parses or computes dates — month/leap-year/timezone\n * arithmetic stays product-owned (see docs/calendar.md). This only checks the\n * \"YYYY-MM-DD\" shape products already use as their KBO schedule date key.\n */\nexport function isIsoCalendarDate(value: string): boolean {\n return typeof value === \"string\" && ISO_DATE_PATTERN.test(value);\n}\n\nexport function assertIsoCalendarDate(value: string, field: string): void {\n if (!isIsoCalendarDate(value)) {\n throw new TypeError(`Calendar ${field} must be an ISO \"YYYY-MM-DD\" date string`);\n }\n}\n\nexport function isIsoCalendarMonth(value: string): boolean {\n return typeof value === \"string\" && ISO_MONTH_PATTERN.test(value);\n}\n\nexport function assertIsoCalendarMonth(value: string, field: string): void {\n if (!isIsoCalendarMonth(value)) {\n throw new TypeError(`Calendar ${field} must be an ISO \"YYYY-MM\" month string`);\n }\n}\n\n/**\n * One visible cell. A cell with no `date` is a pure filler that keeps the\n * seven-column alignment (a leading/trailing blank before day 1 or after the\n * month's last day) — it is never focusable, selectable, or announced.\n * `content` is an opaque product payload (Yajalal's per-day game count, a\n * dot, anything) the renderer's cell-content slot receives untouched; the\n * grid never inspects it.\n */\nexport type CalendarDateCellDescriptor<Content = unknown> = Readonly<{\n date?: string;\n /** The date exists but falls outside the month currently in focus (a leading/trailing day from an adjacent month). Still selectable unless `disabled`. */\n outsideFocusedMonth?: boolean;\n disabled?: boolean;\n content?: Content;\n}>;\n\nexport type CalendarWeekdayLabels = readonly [\n string,\n string,\n string,\n string,\n string,\n string,\n string,\n];\n\n/**\n * Raw product data for one visible month page. HJM does not compute which\n * dates belong to a month or the leading/trailing blanks — the product\n * already owns that arithmetic (see `buildCalendarCells` in Yajalal's\n * schedule explorer). HJM only validates the row-major seven-column shape\n * and resolves per-cell semantic state on top of it.\n */\nexport type CalendarGridDescriptor<Content = unknown> = Readonly<{\n /** Row-major, seven columns per row (one per weekday), so length must be a positive multiple of seven. */\n cells: readonly CalendarDateCellDescriptor<Content>[];\n /** Localized short weekday labels in the same column order as `cells`, e.g. [\"일\",\"월\",\"화\",\"수\",\"목\",\"금\",\"토\"]. */\n weekdayLabels: CalendarWeekdayLabels;\n /** ISO date of \"today\" per the product's clock. The grid never calls `Date.now()` itself. */\n todayDate: string;\n}>;\n\nexport function validateCalendarGridDescriptor<Content>(\n grid: CalendarGridDescriptor<Content>,\n): void {\n if (grid.cells.length === 0 || grid.cells.length % GRID_COLUMNS !== 0) {\n throw new RangeError(\"Calendar grid cells must be a non-empty multiple of seven\");\n }\n if (grid.weekdayLabels.length !== GRID_COLUMNS) {\n throw new RangeError(\"Calendar weekdayLabels must have exactly seven entries\");\n }\n grid.weekdayLabels.forEach((label, index) => assertNonEmpty(label, `weekdayLabels[${index}]`));\n assertIsoCalendarDate(grid.todayDate, \"todayDate\");\n const seen = new Set<string>();\n for (const cell of grid.cells) {\n if (cell.date === undefined) continue;\n assertIsoCalendarDate(cell.date, \"cell date\");\n if (seen.has(cell.date)) {\n throw new TypeError(`Duplicate Calendar cell date: ${cell.date}`);\n }\n seen.add(cell.date);\n }\n}\n\n/**\n * A cursor's committed value and the one displayed month page are\n * independent controlled axes, mirroring `SelectSelection`/`SelectOpenState`\n * in spirit: paging the visible month never clears or moves the selection.\n */\nexport type CalendarMonthChangeReason = \"previous\" | \"next\" | \"jump\";\n\nexport type CalendarMonthNavigation =\n | Readonly<{\n focusedMonth: string;\n defaultFocusedMonth?: never;\n onFocusedMonthChange(month: string, reason: CalendarMonthChangeReason): void;\n }>\n | Readonly<{\n focusedMonth?: never;\n defaultFocusedMonth?: string;\n onFocusedMonthChange?: (month: string, reason: CalendarMonthChangeReason) => void;\n }>;\n\nexport function validateCalendarMonthNavigation(navigation: CalendarMonthNavigation): void {\n const month = navigation.focusedMonth ?? navigation.defaultFocusedMonth;\n if (month !== undefined) assertIsoCalendarMonth(month, \"focusedMonth\");\n}\n\n/**\n * Single committed date only. Range selection is deliberately excluded — no\n * Yajalal or BurnTok flow has measured demand for it (see docs/calendar.md).\n */\nexport type CalendarSelection =\n | Readonly<{\n selectedDate: string | null;\n defaultSelectedDate?: never;\n onSelectionChange(date: string | null): void;\n }>\n | Readonly<{\n selectedDate?: never;\n defaultSelectedDate?: string | null;\n onSelectionChange?: (date: string | null) => void;\n }>;\n\nexport function validateCalendarSelection(selection: CalendarSelection): void {\n const selected = selection.selectedDate ?? selection.defaultSelectedDate;\n if (selected != null) assertIsoCalendarDate(selected, \"selectedDate\");\n}\n\nexport type CalendarDescriptor<Content = unknown> = Readonly<{\n grid: CalendarGridDescriptor<Content>;\n /** Product-formatted heading copy (\"2026년 8월\"); the grid never formats a date itself. */\n monthLabel: string;\n}> &\n CalendarMonthNavigation &\n CalendarSelection;\n\nexport function validateCalendarDescriptor<Content>(\n descriptor: CalendarDescriptor<Content>,\n): void {\n validateCalendarGridDescriptor(descriptor.grid);\n assertNonEmpty(descriptor.monthLabel, \"monthLabel\");\n validateCalendarMonthNavigation(descriptor);\n validateCalendarSelection(descriptor);\n}\n\nexport type CalendarAccessibleNameInfo<Content = unknown> = Readonly<{\n date: string;\n isToday: boolean;\n isSelected: boolean;\n disabled: boolean;\n content?: Content;\n}>;\n\n/**\n * \"8월 19일 수요일, 경기 2개, 선택됨\" is assembled by the product from its own\n * `content` payload and locale/grammar — the same reason Steps takes\n * `composeAccessibleName` instead of assembling copy itself.\n */\nexport type ComposeCalendarAccessibleName<Content = unknown> = (\n info: CalendarAccessibleNameInfo<Content>,\n) => string;\n\nexport type ResolvedCalendarDateCell<Content = unknown> = CalendarDateCellDescriptor<Content> &\n Readonly<{\n date: string;\n /** 1-indexed. */\n row: number;\n /** 1-indexed, 1..7. */\n column: number;\n isToday: boolean;\n isSelected: boolean;\n /** `false` when disabled — the cell stays focusable (see `getCalendarNavigationTarget`) but must never commit or close on activate. */\n selectable: boolean;\n accessibleName: string;\n }>;\n\nexport type ResolvedCalendarFillerCell = Readonly<{\n date?: never;\n row: number;\n column: number;\n filler: true;\n}>;\n\nexport type ResolvedCalendarGridCell<Content = unknown> =\n | ResolvedCalendarDateCell<Content>\n | ResolvedCalendarFillerCell;\n\n/**\n * Resolves per-cell semantic state against a selection supplied separately\n * from the raw grid (mirroring `resolveSelectSelectedItem`'s separation of\n * source data from selection state) — the same grid page renders identically\n * whether it is hosted by Calendar or by DatePicker's popover/sheet.\n */\nexport function resolveCalendarGridDescriptor<Content>(\n grid: CalendarGridDescriptor<Content>,\n selectedDate: string | null,\n options: Readonly<{ composeAccessibleName: ComposeCalendarAccessibleName<Content> }>,\n): readonly ResolvedCalendarGridCell<Content>[] {\n validateCalendarGridDescriptor(grid);\n if (typeof options.composeAccessibleName !== \"function\") {\n throw new TypeError(\"Calendar composeAccessibleName must be a function\");\n }\n\n return grid.cells.map((cell, index) => {\n const row = Math.floor(index / GRID_COLUMNS) + 1;\n const column = (index % GRID_COLUMNS) + 1;\n if (cell.date === undefined) {\n return { row, column, filler: true as const };\n }\n const isToday = cell.date === grid.todayDate;\n const isSelected = cell.date === selectedDate;\n const disabled = cell.disabled ?? false;\n const nameInfo: CalendarAccessibleNameInfo<Content> =\n cell.content === undefined\n ? { date: cell.date, isToday, isSelected, disabled }\n : { date: cell.date, isToday, isSelected, disabled, content: cell.content };\n const accessibleName = options.composeAccessibleName(nameInfo);\n if (typeof accessibleName !== \"string\" || accessibleName.trim().length === 0) {\n throw new TypeError(\"Calendar composeAccessibleName must return a non-empty string\");\n }\n return {\n ...cell,\n date: cell.date,\n row,\n column,\n isToday,\n isSelected,\n selectable: !disabled,\n accessibleName,\n };\n });\n}\n\n/** Top-level entry point: validates the descriptor and resolves its grid page. */\nexport function resolveCalendarDescriptor<Content>(\n descriptor: CalendarDescriptor<Content>,\n options: Readonly<{ composeAccessibleName: ComposeCalendarAccessibleName<Content> }>,\n): readonly ResolvedCalendarGridCell<Content>[] {\n validateCalendarDescriptor(descriptor);\n const selectedDate = descriptor.selectedDate ?? descriptor.defaultSelectedDate ?? null;\n return resolveCalendarGridDescriptor(descriptor.grid, selectedDate, options);\n}\n\nexport type CalendarNavigationIntent =\n | \"next-day\"\n | \"previous-day\"\n | \"next-week\"\n | \"previous-week\"\n | \"first-of-week\"\n | \"last-of-week\";\n\n/**\n * ArrowLeft/Right flip under RTL, matching `getSelectionNavigationIntent`'s\n * `direction` parameter.\n */\nexport function getCalendarNavigationIntent(\n key: WebKeyboardKey,\n direction: DesignSystemDirection = \"ltr\",\n): CalendarNavigationIntent | undefined {\n if (key === \"Home\") return \"first-of-week\";\n if (key === \"End\") return \"last-of-week\";\n if (key === \"ArrowDown\") return \"next-week\";\n if (key === \"ArrowUp\") return \"previous-week\";\n if (key === \"ArrowRight\") return direction === \"rtl\" ? \"previous-day\" : \"next-day\";\n if (key === \"ArrowLeft\") return direction === \"rtl\" ? \"next-day\" : \"previous-day\";\n return undefined;\n}\n\nexport type CalendarNavigationResult =\n | Readonly<{ date: string; overflow?: never }>\n | Readonly<{ date?: never; overflow: \"before\" | \"after\" }>;\n\n/**\n * Pure index arithmetic over the fixed seven-column page. Unlike\n * `getCollectionNavigationTarget`, this does NOT skip disabled dates —\n * per the WAI-ARIA date picker dialog pattern, arrow-key focus must land\n * predictably (down always moves exactly one row) even on a disabled date;\n * only the *activate* action is expected to no-op there. Moving past the\n * edge of this page returns an `overflow` signal instead of wrapping, since\n * HJM does not know the adjacent month's shape — the product pages the\n * month and refocuses the corresponding day.\n */\nexport function getCalendarNavigationTarget<Content>(\n grid: CalendarGridDescriptor<Content>,\n currentDate: string,\n intent: CalendarNavigationIntent,\n): CalendarNavigationResult {\n validateCalendarGridDescriptor(grid);\n const currentIndex = grid.cells.findIndex((cell) => cell.date === currentDate);\n if (currentIndex < 0) {\n throw new RangeError(`Calendar currentDate is not part of this grid page: ${currentDate}`);\n }\n\n const findDated = (from: number, step: number): number | undefined => {\n for (let index = from; index >= 0 && index < grid.cells.length; index += step) {\n if (grid.cells[index]?.date !== undefined) return index;\n }\n return undefined;\n };\n\n const rowStart = Math.floor(currentIndex / GRID_COLUMNS) * GRID_COLUMNS;\n const rowEnd = rowStart + GRID_COLUMNS - 1;\n\n if (intent === \"first-of-week\") {\n const found = findDated(rowStart, 1);\n return found !== undefined && found <= rowEnd\n ? { date: grid.cells[found]!.date! }\n : { overflow: \"before\" };\n }\n if (intent === \"last-of-week\") {\n const found = findDated(rowEnd, -1);\n return found !== undefined && found >= rowStart\n ? { date: grid.cells[found]!.date! }\n : { overflow: \"after\" };\n }\n\n const forward = intent === \"next-day\" || intent === \"next-week\";\n const stride = intent === \"next-week\" || intent === \"previous-week\" ? GRID_COLUMNS : 1;\n const step = forward ? 1 : -1;\n const target = currentIndex + step * stride;\n if (target < 0) return { overflow: \"before\" };\n if (target >= grid.cells.length) return { overflow: \"after\" };\n if (grid.cells[target]?.date !== undefined) return { date: grid.cells[target]!.date! };\n // Landed on a filler (only reachable for a week-step into a partially\n // filled edge row): keep scanning the same direction for the nearest real\n // date rather than asking a renderer to interpret a blank cell.\n const resolved = findDated(target, step);\n return resolved !== undefined\n ? { date: grid.cells[resolved]!.date! }\n : { overflow: forward ? \"after\" : \"before\" };\n}\n\nexport type CalendarSize = \"compact\" | \"medium\" | \"large\";\n\n/**\n * `today` and `selected` are visually independent (a non-selected today and\n * a selected past day must both read clearly) and neither is color-only:\n * today gets a persistent border, selected gets a filled background, and\n * both remain in `accessibleName`/`isToday`/`isSelected` for assistive tech.\n */\nexport const calendarRecipe = {\n slots: [\n \"root\",\n \"header\",\n \"monthLabel\",\n \"previousMonth\",\n \"nextMonth\",\n \"weekdayRow\",\n \"weekdayLabel\",\n \"grid\",\n \"week\",\n \"day\",\n \"dayLabel\",\n \"content\",\n ] as const,\n defaults: { size: \"medium\" },\n // A week stays scannable: the 1280 Web host spread seven columns to ~135px each (2026-10-17 review). Same width as the\n // DatePicker popover.\n maxWidth: layout.readingMaxWidth / 2,\n header: {\n gap: spacing.xs,\n monthLabel: {\n textVariant: \"title\",\n fontWeight: fontWeight.bold,\n color: semanticColors.content.primary,\n },\n navButton: { diameter: control.buttonHeight.medium, color: semanticColors.content.secondary },\n navIcon: { previous: \"chevronStart\", next: \"chevronEnd\" },\n },\n weekdayLabel: {\n textVariant: \"label\",\n color: semanticColors.content.secondary,\n },\n sizes: {\n // Dense annotated calendars need a smaller visual marker without shrinking the hit target.\n compact: { cellDiameter: control.minTouchTarget, indicatorDiameter: 28, textVariant: \"body\", glyph: \"sm\" },\n medium: { cellDiameter: control.minTouchTarget, indicatorDiameter: control.minTouchTarget, textVariant: \"body\", glyph: \"sm\" },\n large: { cellDiameter: glyph.xxl, indicatorDiameter: glyph.xxl, textVariant: \"bodyLarge\", glyph: \"md\" },\n },\n day: {\n radius: \"full\" as const,\n label: { color: semanticColors.content.body, numericVariant: \"tabular\" },\n outsideFocusedMonthOpacity: opacity.muted,\n disabledOpacity: opacity.disabled,\n today: { border: semanticColors.border.focus, borderWidth: stroke.default },\n selected: {\n background: semanticColors.action.brand.background,\n content: semanticColors.action.brand.content,\n },\n focus: focusIndicatorContract,\n },\n} as const satisfies {\n slots: readonly string[];\n defaults: { size: CalendarSize };\n maxWidth: number;\n header: {\n gap: number;\n monthLabel: { textVariant: TextVariant; fontWeight: FontWeightValue; color: ColorReference };\n navButton: { diameter: number; color: ColorReference };\n navIcon: { previous: SemanticIconName; next: SemanticIconName };\n };\n weekdayLabel: { textVariant: TextVariant; color: ColorReference };\n sizes: Record<CalendarSize, { cellDiameter: number; indicatorDiameter: number; textVariant: TextVariant; glyph: GlyphSize }>;\n day: {\n radius: \"full\";\n label: { color: ColorReference; numericVariant: \"tabular\" };\n outsideFocusedMonthOpacity: number;\n disabledOpacity: number;\n today: { border: ColorReference; borderWidth: number };\n selected: { background: ColorReference; content: ColorReference };\n focus: typeof focusIndicatorContract;\n };\n};\n\n/**\n * Calendar is `shared`, not `adaptive`: the grid is always visible inline\n * (no popup/Sheet choice to make). Web gets `grid` role + roving-tabindex\n * arrow keys; Native has no composite-widget equivalent, so each date is\n * simply an independently focusable/tappable element and month paging goes\n * through the always-present previous/next buttons on both platforms — same\n * result (the user reaches and picks a date), different path, matching the\n * `beta → stable(adaptive)` gate's standard even though this component\n * itself is not adaptive.\n */\nexport const calendarBehavior = {\n controlled: [\n \"selectedDate\",\n \"defaultSelectedDate\",\n \"onSelectionChange\",\n \"focusedMonth\",\n \"defaultFocusedMonth\",\n \"onFocusedMonthChange\",\n ],\n inputs: [\"grid\", \"monthLabel\"],\n stateAxes: {\n availability: [\"enabled\", \"disabled\"],\n value: [\"selected\"],\n },\n web: {\n roles: [\"grid\", \"row\", \"gridcell\", \"button\"],\n keyboard: [\n \"Tab\",\n \"Enter\",\n \"Space\",\n \"ArrowUp\",\n \"ArrowDown\",\n \"ArrowLeft\",\n \"ArrowRight\",\n \"Home\",\n \"End\",\n ],\n focus: \"roving\",\n },\n native: {\n roles: [\"button\"],\n states: [\"disabled\", \"selected\"],\n actions: [\"activate\"],\n },\n scenarios: [\n \"today-and-selected-are-independent-and-both-non-color-marked\",\n \"disabled-dates-remain-focusable-but-never-activate\",\n \"arrow-keys-move-by-day-and-week-inside-the-visible-month-page\",\n \"home-and-end-move-to-the-first-and-last-dated-cell-of-the-focused-row\",\n \"moving-past-the-visible-grid-edge-requests-a-month-change-instead-of-wrapping\",\n \"filler-cells-carry-no-accessible-name-and-are-hidden-from-assistive-tech\",\n \"every-dated-cell-accessible-name-is-composed-by-the-product\",\n \"changing-the-focused-month-never-changes-or-clears-the-selection\",\n \"range-selection-is-not-part-of-the-contract\",\n ],\n} as const satisfies BehaviorContract;\n"]}
|
|
1
|
+
{"version":3,"file":"calendar.js","sourceRoot":"","sources":["../src/calendar.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,E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vB;IACD,MAAM,EAAE,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,SAAS,EAAE;QACT,YAAY,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC;QACrC,KAAK,EAAE,CAAC,UAAU,CAAC;KACpB;IACD,GAAG,EAAE;QACH,KAAK,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,CAAC;QAC5C,QAAQ,EAAE;YACR,KAAK;YACL,OAAO;YACP,OAAO;YACP,SAAS;YACT,WAAW;YACX,WAAW;YACX,YAAY;YACZ,MAAM;YACN,KAAK;SACN;QACD,KAAK,EAAE,QAAQ;KAChB;IACD,MAAM,EAAE;QACN,KAAK,EAAE,CAAC,QAAQ,CAAC;QACjB,MAAM,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;QAChC,OAAO,EAAE,CAAC,UAAU,CAAC;KACtB;IACD,SAAS,EAAE;QACT,8DAA8D;QAC9D,oDAAoD;QACpD,+DAA+D;QAC/D,uEAAuE;QACvE,+EAA+E;QAC/E,0EAA0E;QAC1E,6DAA6D;QAC7D,kEAAkE;QAClE,6CAA6C;KAC9C;CACkC,CAAC","sourcesContent":["import type { ColorReference } from \"./color-references.js\";\nimport type { BehaviorContract, WebKeyboardKey } from \"./behaviors.js\";\nimport type { DesignSystemDirection } from \"./design-system-provider.js\";\nimport type { SemanticIconName } from \"./icon.js\";\nimport { control, glyph, layout, opacity, spacing, stroke, typography, type FontWeightValue, type GlyphSize, type TextVariant } from \"./foundations.js\";\nimport { focusIndicatorContract } from \"./component-contracts.js\";\nimport { semanticColors } from \"./semantic-colors.js\";\n\nconst ISO_DATE_PATTERN = /^\\d{4}-\\d{2}-\\d{2}$/;\nconst ISO_MONTH_PATTERN = /^\\d{4}-(0[1-9]|1[0-2])$/;\nconst GRID_COLUMNS = 7;\n\nfunction assertNonEmpty(value: string, field: string): void {\n if (typeof value !== \"string\" || value.trim().length === 0) {\n throw new TypeError(`Calendar ${field} must not be empty`);\n }\n}\n\n/**\n * The grid never parses or computes dates — month/leap-year/timezone\n * arithmetic stays product-owned (see docs/calendar.md). This only checks the\n * \"YYYY-MM-DD\" shape products already use as their KBO schedule date key.\n */\nexport function isIsoCalendarDate(value: string): boolean {\n return typeof value === \"string\" && ISO_DATE_PATTERN.test(value);\n}\n\nexport function assertIsoCalendarDate(value: string, field: string): void {\n if (!isIsoCalendarDate(value)) {\n throw new TypeError(`Calendar ${field} must be an ISO \"YYYY-MM-DD\" date string`);\n }\n}\n\nexport function isIsoCalendarMonth(value: string): boolean {\n return typeof value === \"string\" && ISO_MONTH_PATTERN.test(value);\n}\n\nexport function assertIsoCalendarMonth(value: string, field: string): void {\n if (!isIsoCalendarMonth(value)) {\n throw new TypeError(`Calendar ${field} must be an ISO \"YYYY-MM\" month string`);\n }\n}\n\n/**\n * One visible cell. A cell with no `date` is a pure filler that keeps the\n * seven-column alignment (a leading/trailing blank before day 1 or after the\n * month's last day) — it is never focusable, selectable, or announced.\n * `content` is an opaque product payload (Yajalal's per-day game count, a\n * dot, anything) the renderer's cell-content slot receives untouched; the\n * grid never inspects it.\n */\nexport type CalendarDateCellDescriptor<Content = unknown> = Readonly<{\n date?: string;\n /** The date exists but falls outside the month currently in focus (a leading/trailing day from an adjacent month). Still selectable unless `disabled`. */\n outsideFocusedMonth?: boolean;\n disabled?: boolean;\n content?: Content;\n}>;\n\nexport type CalendarWeekdayLabels = readonly [\n string,\n string,\n string,\n string,\n string,\n string,\n string,\n];\n\n/**\n * Raw product data for one visible month page. HJM does not compute which\n * dates belong to a month or the leading/trailing blanks — the product\n * already owns that arithmetic (see `buildCalendarCells` in Yajalal's\n * schedule explorer). HJM only validates the row-major seven-column shape\n * and resolves per-cell semantic state on top of it.\n */\nexport type CalendarGridDescriptor<Content = unknown> = Readonly<{\n /** Row-major, seven columns per row (one per weekday), so length must be a positive multiple of seven. */\n cells: readonly CalendarDateCellDescriptor<Content>[];\n /** Localized short weekday labels in the same column order as `cells`, e.g. [\"일\",\"월\",\"화\",\"수\",\"목\",\"금\",\"토\"]. */\n weekdayLabels: CalendarWeekdayLabels;\n /** ISO date of \"today\" per the product's clock. The grid never calls `Date.now()` itself. */\n todayDate: string;\n}>;\n\nexport function validateCalendarGridDescriptor<Content>(\n grid: CalendarGridDescriptor<Content>,\n): void {\n if (grid.cells.length === 0 || grid.cells.length % GRID_COLUMNS !== 0) {\n throw new RangeError(\"Calendar grid cells must be a non-empty multiple of seven\");\n }\n if (grid.weekdayLabels.length !== GRID_COLUMNS) {\n throw new RangeError(\"Calendar weekdayLabels must have exactly seven entries\");\n }\n grid.weekdayLabels.forEach((label, index) => assertNonEmpty(label, `weekdayLabels[${index}]`));\n assertIsoCalendarDate(grid.todayDate, \"todayDate\");\n const seen = new Set<string>();\n for (const cell of grid.cells) {\n if (cell.date === undefined) continue;\n assertIsoCalendarDate(cell.date, \"cell date\");\n if (seen.has(cell.date)) {\n throw new TypeError(`Duplicate Calendar cell date: ${cell.date}`);\n }\n seen.add(cell.date);\n }\n}\n\n/**\n * A cursor's committed value and the one displayed month page are\n * independent controlled axes, mirroring `SelectSelection`/`SelectOpenState`\n * in spirit: paging the visible month never clears or moves the selection.\n */\nexport type CalendarMonthChangeReason = \"previous\" | \"next\" | \"jump\";\n\nexport type CalendarMonthNavigation =\n | Readonly<{\n focusedMonth: string;\n defaultFocusedMonth?: never;\n onFocusedMonthChange(month: string, reason: CalendarMonthChangeReason): void;\n }>\n | Readonly<{\n focusedMonth?: never;\n defaultFocusedMonth?: string;\n onFocusedMonthChange?: (month: string, reason: CalendarMonthChangeReason) => void;\n }>;\n\nexport function validateCalendarMonthNavigation(navigation: CalendarMonthNavigation): void {\n const month = navigation.focusedMonth ?? navigation.defaultFocusedMonth;\n if (month !== undefined) assertIsoCalendarMonth(month, \"focusedMonth\");\n}\n\n/**\n * Single committed date only. Range selection is deliberately excluded — no\n * Yajalal or BurnTok flow has measured demand for it (see docs/calendar.md).\n */\nexport type CalendarSelection =\n | Readonly<{\n selectedDate: string | null;\n defaultSelectedDate?: never;\n onSelectionChange(date: string | null): void;\n }>\n | Readonly<{\n selectedDate?: never;\n defaultSelectedDate?: string | null;\n onSelectionChange?: (date: string | null) => void;\n }>;\n\nexport function validateCalendarSelection(selection: CalendarSelection): void {\n const selected = selection.selectedDate ?? selection.defaultSelectedDate;\n if (selected != null) assertIsoCalendarDate(selected, \"selectedDate\");\n}\n\nexport type CalendarDescriptor<Content = unknown> = Readonly<{\n grid: CalendarGridDescriptor<Content>;\n /** Product-formatted heading copy (\"2026년 8월\"); the grid never formats a date itself. */\n monthLabel: string;\n}> &\n CalendarMonthNavigation &\n CalendarSelection;\n\nexport function validateCalendarDescriptor<Content>(\n descriptor: CalendarDescriptor<Content>,\n): void {\n validateCalendarGridDescriptor(descriptor.grid);\n assertNonEmpty(descriptor.monthLabel, \"monthLabel\");\n validateCalendarMonthNavigation(descriptor);\n validateCalendarSelection(descriptor);\n}\n\nexport type CalendarAccessibleNameInfo<Content = unknown> = Readonly<{\n date: string;\n isToday: boolean;\n isSelected: boolean;\n disabled: boolean;\n content?: Content;\n}>;\n\n/**\n * \"8월 19일 수요일, 경기 2개, 선택됨\" is assembled by the product from its own\n * `content` payload and locale/grammar — the same reason Steps takes\n * `composeAccessibleName` instead of assembling copy itself.\n */\nexport type ComposeCalendarAccessibleName<Content = unknown> = (\n info: CalendarAccessibleNameInfo<Content>,\n) => string;\n\nexport type ResolvedCalendarDateCell<Content = unknown> = CalendarDateCellDescriptor<Content> &\n Readonly<{\n date: string;\n /** 1-indexed. */\n row: number;\n /** 1-indexed, 1..7. */\n column: number;\n isToday: boolean;\n isSelected: boolean;\n /** `false` when disabled — the cell stays focusable (see `getCalendarNavigationTarget`) but must never commit or close on activate. */\n selectable: boolean;\n accessibleName: string;\n }>;\n\nexport type ResolvedCalendarFillerCell = Readonly<{\n date?: never;\n row: number;\n column: number;\n filler: true;\n}>;\n\nexport type ResolvedCalendarGridCell<Content = unknown> =\n | ResolvedCalendarDateCell<Content>\n | ResolvedCalendarFillerCell;\n\n/**\n * Resolves per-cell semantic state against a selection supplied separately\n * from the raw grid (mirroring `resolveSelectSelectedItem`'s separation of\n * source data from selection state) — the same grid page renders identically\n * whether it is hosted by Calendar or by DatePicker's popover/sheet.\n */\nexport function resolveCalendarGridDescriptor<Content>(\n grid: CalendarGridDescriptor<Content>,\n selectedDate: string | null,\n options: Readonly<{ composeAccessibleName: ComposeCalendarAccessibleName<Content> }>,\n): readonly ResolvedCalendarGridCell<Content>[] {\n validateCalendarGridDescriptor(grid);\n if (typeof options.composeAccessibleName !== \"function\") {\n throw new TypeError(\"Calendar composeAccessibleName must be a function\");\n }\n\n return grid.cells.map((cell, index) => {\n const row = Math.floor(index / GRID_COLUMNS) + 1;\n const column = (index % GRID_COLUMNS) + 1;\n if (cell.date === undefined) {\n return { row, column, filler: true as const };\n }\n const isToday = cell.date === grid.todayDate;\n const isSelected = cell.date === selectedDate;\n const disabled = cell.disabled ?? false;\n const nameInfo: CalendarAccessibleNameInfo<Content> =\n cell.content === undefined\n ? { date: cell.date, isToday, isSelected, disabled }\n : { date: cell.date, isToday, isSelected, disabled, content: cell.content };\n const accessibleName = options.composeAccessibleName(nameInfo);\n if (typeof accessibleName !== \"string\" || accessibleName.trim().length === 0) {\n throw new TypeError(\"Calendar composeAccessibleName must return a non-empty string\");\n }\n return {\n ...cell,\n date: cell.date,\n row,\n column,\n isToday,\n isSelected,\n selectable: !disabled,\n accessibleName,\n };\n });\n}\n\n/** Top-level entry point: validates the descriptor and resolves its grid page. */\nexport function resolveCalendarDescriptor<Content>(\n descriptor: CalendarDescriptor<Content>,\n options: Readonly<{ composeAccessibleName: ComposeCalendarAccessibleName<Content> }>,\n): readonly ResolvedCalendarGridCell<Content>[] {\n validateCalendarDescriptor(descriptor);\n const selectedDate = descriptor.selectedDate ?? descriptor.defaultSelectedDate ?? null;\n return resolveCalendarGridDescriptor(descriptor.grid, selectedDate, options);\n}\n\nexport type CalendarNavigationIntent =\n | \"next-day\"\n | \"previous-day\"\n | \"next-week\"\n | \"previous-week\"\n | \"first-of-week\"\n | \"last-of-week\";\n\n/**\n * ArrowLeft/Right flip under RTL, matching `getSelectionNavigationIntent`'s\n * `direction` parameter.\n */\nexport function getCalendarNavigationIntent(\n key: WebKeyboardKey,\n direction: DesignSystemDirection = \"ltr\",\n): CalendarNavigationIntent | undefined {\n if (key === \"Home\") return \"first-of-week\";\n if (key === \"End\") return \"last-of-week\";\n if (key === \"ArrowDown\") return \"next-week\";\n if (key === \"ArrowUp\") return \"previous-week\";\n if (key === \"ArrowRight\") return direction === \"rtl\" ? \"previous-day\" : \"next-day\";\n if (key === \"ArrowLeft\") return direction === \"rtl\" ? \"next-day\" : \"previous-day\";\n return undefined;\n}\n\nexport type CalendarNavigationResult =\n | Readonly<{ date: string; overflow?: never }>\n | Readonly<{ date?: never; overflow: \"before\" | \"after\" }>;\n\n/**\n * Pure index arithmetic over the fixed seven-column page. Unlike\n * `getCollectionNavigationTarget`, this does NOT skip disabled dates —\n * per the WAI-ARIA date picker dialog pattern, arrow-key focus must land\n * predictably (down always moves exactly one row) even on a disabled date;\n * only the *activate* action is expected to no-op there. Moving past the\n * edge of this page returns an `overflow` signal instead of wrapping, since\n * HJM does not know the adjacent month's shape — the product pages the\n * month and refocuses the corresponding day.\n */\nexport function getCalendarNavigationTarget<Content>(\n grid: CalendarGridDescriptor<Content>,\n currentDate: string,\n intent: CalendarNavigationIntent,\n): CalendarNavigationResult {\n validateCalendarGridDescriptor(grid);\n const currentIndex = grid.cells.findIndex((cell) => cell.date === currentDate);\n if (currentIndex < 0) {\n throw new RangeError(`Calendar currentDate is not part of this grid page: ${currentDate}`);\n }\n\n const findDated = (from: number, step: number): number | undefined => {\n for (let index = from; index >= 0 && index < grid.cells.length; index += step) {\n if (grid.cells[index]?.date !== undefined) return index;\n }\n return undefined;\n };\n\n const rowStart = Math.floor(currentIndex / GRID_COLUMNS) * GRID_COLUMNS;\n const rowEnd = rowStart + GRID_COLUMNS - 1;\n\n if (intent === \"first-of-week\") {\n const found = findDated(rowStart, 1);\n return found !== undefined && found <= rowEnd\n ? { date: grid.cells[found]!.date! }\n : { overflow: \"before\" };\n }\n if (intent === \"last-of-week\") {\n const found = findDated(rowEnd, -1);\n return found !== undefined && found >= rowStart\n ? { date: grid.cells[found]!.date! }\n : { overflow: \"after\" };\n }\n\n const forward = intent === \"next-day\" || intent === \"next-week\";\n const stride = intent === \"next-week\" || intent === \"previous-week\" ? GRID_COLUMNS : 1;\n const step = forward ? 1 : -1;\n const target = currentIndex + step * stride;\n if (target < 0) return { overflow: \"before\" };\n if (target >= grid.cells.length) return { overflow: \"after\" };\n if (grid.cells[target]?.date !== undefined) return { date: grid.cells[target]!.date! };\n // Landed on a filler (only reachable for a week-step into a partially\n // filled edge row): keep scanning the same direction for the nearest real\n // date rather than asking a renderer to interpret a blank cell.\n const resolved = findDated(target, step);\n return resolved !== undefined\n ? { date: grid.cells[resolved]!.date! }\n : { overflow: forward ? \"after\" : \"before\" };\n}\n\nexport type CalendarSize = \"compact\" | \"medium\" | \"large\";\n\n/**\n * `today` and `selected` are visually independent (a non-selected today and\n * a selected past day must both read clearly) and neither is color-only:\n * today gets a persistent border, selected gets a filled background, and\n * both remain in `accessibleName`/`isToday`/`isSelected` for assistive tech.\n */\nexport const calendarRecipe = {\n slots: [\n \"root\",\n \"header\",\n \"monthLabel\",\n \"previousMonth\",\n \"nextMonth\",\n \"weekdayRow\",\n \"weekdayLabel\",\n \"grid\",\n \"week\",\n \"day\",\n \"dayLabel\",\n \"content\",\n ] as const,\n defaults: { size: \"medium\" },\n // A week stays scannable: the 1280 Web host spread seven columns to ~135px each (2026-10-17 review). Same width as the\n // DatePicker popover.\n maxWidth: layout.readingMaxWidth / 2,\n header: {\n gap: spacing.xs,\n monthLabel: {\n textVariant: \"title\",\n fontWeight: typography.title.fontWeight,\n color: semanticColors.content.primary,\n },\n navButton: { diameter: control.buttonHeight.medium, color: semanticColors.content.secondary },\n navIcon: { previous: \"chevronStart\", next: \"chevronEnd\" },\n },\n weekdayLabel: {\n textVariant: \"label\",\n color: semanticColors.content.secondary,\n },\n sizes: {\n // Dense annotated calendars need a smaller visual marker without shrinking the hit target.\n compact: { cellDiameter: control.minTouchTarget, indicatorDiameter: 28, textVariant: \"body\", glyph: \"sm\" },\n medium: { cellDiameter: control.minTouchTarget, indicatorDiameter: control.minTouchTarget, textVariant: \"body\", glyph: \"sm\" },\n large: { cellDiameter: glyph.xxl, indicatorDiameter: glyph.xxl, textVariant: \"bodyLarge\", glyph: \"md\" },\n },\n day: {\n radius: \"full\" as const,\n label: { color: semanticColors.content.body, numericVariant: \"tabular\" },\n outsideFocusedMonthOpacity: opacity.muted,\n disabledOpacity: opacity.disabled,\n today: { border: semanticColors.border.focus, borderWidth: stroke.default },\n selected: {\n background: semanticColors.action.brand.background,\n content: semanticColors.action.brand.content,\n },\n focus: focusIndicatorContract,\n },\n} as const satisfies {\n slots: readonly string[];\n defaults: { size: CalendarSize };\n maxWidth: number;\n header: {\n gap: number;\n monthLabel: { textVariant: TextVariant; fontWeight: FontWeightValue; color: ColorReference };\n navButton: { diameter: number; color: ColorReference };\n navIcon: { previous: SemanticIconName; next: SemanticIconName };\n };\n weekdayLabel: { textVariant: TextVariant; color: ColorReference };\n sizes: Record<CalendarSize, { cellDiameter: number; indicatorDiameter: number; textVariant: TextVariant; glyph: GlyphSize }>;\n day: {\n radius: \"full\";\n label: { color: ColorReference; numericVariant: \"tabular\" };\n outsideFocusedMonthOpacity: number;\n disabledOpacity: number;\n today: { border: ColorReference; borderWidth: number };\n selected: { background: ColorReference; content: ColorReference };\n focus: typeof focusIndicatorContract;\n };\n};\n\n/**\n * Calendar is `shared`, not `adaptive`: the grid is always visible inline\n * (no popup/Sheet choice to make). Web gets `grid` role + roving-tabindex\n * arrow keys; Native has no composite-widget equivalent, so each date is\n * simply an independently focusable/tappable element and month paging goes\n * through the always-present previous/next buttons on both platforms — same\n * result (the user reaches and picks a date), different path, matching the\n * `beta → stable(adaptive)` gate's standard even though this component\n * itself is not adaptive.\n */\nexport const calendarBehavior = {\n controlled: [\n \"selectedDate\",\n \"defaultSelectedDate\",\n \"onSelectionChange\",\n \"focusedMonth\",\n \"defaultFocusedMonth\",\n \"onFocusedMonthChange\",\n ],\n inputs: [\"grid\", \"monthLabel\"],\n stateAxes: {\n availability: [\"enabled\", \"disabled\"],\n value: [\"selected\"],\n },\n web: {\n roles: [\"grid\", \"row\", \"gridcell\", \"button\"],\n keyboard: [\n \"Tab\",\n \"Enter\",\n \"Space\",\n \"ArrowUp\",\n \"ArrowDown\",\n \"ArrowLeft\",\n \"ArrowRight\",\n \"Home\",\n \"End\",\n ],\n focus: \"roving\",\n },\n native: {\n roles: [\"button\"],\n states: [\"disabled\", \"selected\"],\n actions: [\"activate\"],\n },\n scenarios: [\n \"today-and-selected-are-independent-and-both-non-color-marked\",\n \"disabled-dates-remain-focusable-but-never-activate\",\n \"arrow-keys-move-by-day-and-week-inside-the-visible-month-page\",\n \"home-and-end-move-to-the-first-and-last-dated-cell-of-the-focused-row\",\n \"moving-past-the-visible-grid-edge-requests-a-month-change-instead-of-wrapping\",\n \"filler-cells-carry-no-accessible-name-and-are-hidden-from-assistive-tech\",\n \"every-dated-cell-accessible-name-is-composed-by-the-product\",\n \"changing-the-focused-month-never-changes-or-clears-the-selection\",\n \"range-selection-is-not-part-of-the-contract\",\n ],\n} as const satisfies BehaviorContract;\n"]}
|