@hjmds/design-contracts 1.34.0 → 1.35.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.
Files changed (158) hide show
  1. package/dist/anchor.d.ts +4 -1
  2. package/dist/anchor.d.ts.map +1 -1
  3. package/dist/anchor.js +3 -3
  4. package/dist/anchor.js.map +1 -1
  5. package/dist/base-recipes.d.ts +15 -1
  6. package/dist/base-recipes.d.ts.map +1 -1
  7. package/dist/base-recipes.js +14 -3
  8. package/dist/base-recipes.js.map +1 -1
  9. package/dist/behaviors.d.ts +22 -0
  10. package/dist/behaviors.d.ts.map +1 -1
  11. package/dist/behaviors.js +2 -0
  12. package/dist/behaviors.js.map +1 -1
  13. package/dist/calendar.d.ts +9 -7
  14. package/dist/calendar.d.ts.map +1 -1
  15. package/dist/calendar.js +31 -2
  16. package/dist/calendar.js.map +1 -1
  17. package/dist/card.d.ts +15 -1
  18. package/dist/card.d.ts.map +1 -1
  19. package/dist/card.js +14 -1
  20. package/dist/card.js.map +1 -1
  21. package/dist/carousel.d.ts +3 -0
  22. package/dist/carousel.d.ts.map +1 -1
  23. package/dist/carousel.js +10 -1
  24. package/dist/carousel.js.map +1 -1
  25. package/dist/catalog.d.ts +147 -17
  26. package/dist/catalog.d.ts.map +1 -1
  27. package/dist/catalog.js +9 -6
  28. package/dist/catalog.js.map +1 -1
  29. package/dist/colors.d.ts +1 -0
  30. package/dist/colors.d.ts.map +1 -1
  31. package/dist/colors.js +2 -0
  32. package/dist/colors.js.map +1 -1
  33. package/dist/component-recipes.d.ts +45 -11
  34. package/dist/component-recipes.d.ts.map +1 -1
  35. package/dist/component-recipes.js +35 -15
  36. package/dist/component-recipes.js.map +1 -1
  37. package/dist/component-references.d.ts +2 -2
  38. package/dist/component-references.js +1 -1
  39. package/dist/component-references.js.map +1 -1
  40. package/dist/design-profile.d.ts +14 -0
  41. package/dist/design-profile.d.ts.map +1 -1
  42. package/dist/design-profile.js +15 -0
  43. package/dist/design-profile.js.map +1 -1
  44. package/dist/index.d.ts +2 -1
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +2 -1
  47. package/dist/index.js.map +1 -1
  48. package/dist/progress-recipe.d.ts +6 -0
  49. package/dist/progress-recipe.d.ts.map +1 -1
  50. package/dist/progress-recipe.js +15 -2
  51. package/dist/progress-recipe.js.map +1 -1
  52. package/dist/recipes.d.ts +2 -2
  53. package/dist/recipes.d.ts.map +1 -1
  54. package/dist/recipes.js +2 -2
  55. package/dist/recipes.js.map +1 -1
  56. package/dist/screen-patterns.d.ts +32 -2
  57. package/dist/screen-patterns.d.ts.map +1 -1
  58. package/dist/screen-patterns.js +26 -2
  59. package/dist/screen-patterns.js.map +1 -1
  60. package/dist/semantic-colors.d.ts +5 -0
  61. package/dist/semantic-colors.d.ts.map +1 -1
  62. package/dist/semantic-colors.js +2 -0
  63. package/dist/semantic-colors.js.map +1 -1
  64. package/dist/sheet.d.ts +15 -0
  65. package/dist/sheet.d.ts.map +1 -1
  66. package/dist/sheet.js +11 -0
  67. package/dist/sheet.js.map +1 -1
  68. package/dist/shortcut-rail.d.ts +20 -0
  69. package/dist/shortcut-rail.d.ts.map +1 -0
  70. package/dist/shortcut-rail.js +28 -0
  71. package/dist/shortcut-rail.js.map +1 -0
  72. package/dist/showcase.js +2 -2
  73. package/dist/showcase.js.map +1 -1
  74. package/dist/steps.d.ts +6 -4
  75. package/dist/steps.d.ts.map +1 -1
  76. package/dist/steps.js +3 -0
  77. package/dist/steps.js.map +1 -1
  78. package/dist/time-picker.d.ts +70 -0
  79. package/dist/time-picker.d.ts.map +1 -0
  80. package/dist/time-picker.js +51 -0
  81. package/dist/time-picker.js.map +1 -0
  82. package/dist/timeline.d.ts +13 -1
  83. package/dist/timeline.d.ts.map +1 -1
  84. package/dist/timeline.js +11 -1
  85. package/dist/timeline.js.map +1 -1
  86. package/dist/version.d.ts +1 -1
  87. package/dist/version.js +1 -1
  88. package/dist/version.js.map +1 -1
  89. package/docs/calendar.md +19 -1
  90. package/docs/carousel.md +10 -0
  91. package/docs/collapsible.md +9 -0
  92. package/docs/consumer-policy.md +8 -12
  93. package/docs/design-profile.md +9 -0
  94. package/docs/expansion-roadmap.md +1 -1
  95. package/docs/generated/component-maturity.md +5 -4
  96. package/docs/generated/renderer-evidence.json +141 -16
  97. package/docs/generated/renderer-evidence.md +5 -3
  98. package/docs/generated/showcase-manifest.json +69 -7
  99. package/docs/optional-adapters.md +11 -0
  100. package/docs/stable-core.md +25 -0
  101. package/docs/steps.md +4 -0
  102. package/docs/theme-palette.md +2 -0
  103. package/docs/time-picker.md +22 -114
  104. package/docs/usage/README.md +9 -7
  105. package/docs/usage/SELECTION.md +44 -2
  106. package/docs/usage/components/accordion.md +4 -2
  107. package/docs/usage/components/alert-dialog.md +5 -0
  108. package/docs/usage/components/anchor.md +4 -1
  109. package/docs/usage/components/badge.md +7 -4
  110. package/docs/usage/components/bottom-cta.md +29 -4
  111. package/docs/usage/components/bottom-navigation.md +8 -0
  112. package/docs/usage/components/button.md +42 -2
  113. package/docs/usage/components/calendar.md +8 -1
  114. package/docs/usage/components/card.md +111 -7
  115. package/docs/usage/components/carousel.md +4 -1
  116. package/docs/usage/components/chat-screen.md +1 -1
  117. package/docs/usage/components/checkbox-group.md +33 -3
  118. package/docs/usage/components/checkbox.md +8 -2
  119. package/docs/usage/components/chip.md +5 -0
  120. package/docs/usage/components/collapsible.md +16 -1
  121. package/docs/usage/components/comment-thread-screen.md +12 -3
  122. package/docs/usage/components/composition-layout.md +6 -1
  123. package/docs/usage/components/conversation-row.md +2 -1
  124. package/docs/usage/components/data-table.md +10 -0
  125. package/docs/usage/components/description-list.md +1 -0
  126. package/docs/usage/components/field.md +8 -0
  127. package/docs/usage/components/icon-tile.md +29 -10
  128. package/docs/usage/components/image-choice-group.md +6 -0
  129. package/docs/usage/components/image.md +8 -1
  130. package/docs/usage/components/list-detail-screen.md +10 -4
  131. package/docs/usage/components/list-row.md +3 -0
  132. package/docs/usage/components/list.md +33 -1
  133. package/docs/usage/components/message-composer.md +2 -0
  134. package/docs/usage/components/notice.md +5 -1
  135. package/docs/usage/components/notification-row.md +19 -9
  136. package/docs/usage/components/onboarding-screen.md +3 -0
  137. package/docs/usage/components/page-indicator.md +12 -0
  138. package/docs/usage/components/profile-summary.md +16 -3
  139. package/docs/usage/components/progress.md +24 -0
  140. package/docs/usage/components/radio-group.md +45 -3
  141. package/docs/usage/components/radio.md +8 -2
  142. package/docs/usage/components/repeatable-field-group.md +1 -0
  143. package/docs/usage/components/screen-layout.md +46 -3
  144. package/docs/usage/components/search-screen.md +29 -1
  145. package/docs/usage/components/segmented-control.md +19 -3
  146. package/docs/usage/components/select.md +2 -0
  147. package/docs/usage/components/sheet.md +56 -3
  148. package/docs/usage/components/spinner.md +10 -0
  149. package/docs/usage/components/statistic.md +23 -0
  150. package/docs/usage/components/steps.md +11 -4
  151. package/docs/usage/components/switch.md +5 -0
  152. package/docs/usage/components/tabs.md +4 -0
  153. package/docs/usage/components/time-picker.md +88 -0
  154. package/docs/usage/components/timeline.md +19 -6
  155. package/docs/usage/components/top-bar.md +7 -0
  156. package/docs/usage/compositions/shortcut-rail.md +99 -0
  157. package/docs/usage/compositions/time-selection.md +5 -0
  158. package/package.json +17 -4
@@ -1 +1 @@
1
- {"version":3,"file":"calendar.js","sourceRoot":"","sources":["../src/calendar.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,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,CAA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;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"]}
1
+ {"version":3,"file":"calendar.js","sourceRoot":"","sources":["../src/calendar.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,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;;;GAGG;AACH,M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nB,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, 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 descriptor accepts product-owned calendar keys. 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\n/** Civil Gregorian display cells only; business dates, time zones and the clock remain caller-owned. */\nexport function createCalendarMonthCells(\n month: string,\n { weekStartsOn = 0, outsideMonth = \"adjacent\" }: Readonly<{\n weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;\n outsideMonth?: \"adjacent\" | \"blank\";\n }> = {},\n): readonly CalendarDateCellDescriptor[] {\n assertIsoCalendarMonth(month, \"month\");\n if (!Number.isInteger(weekStartsOn) || weekStartsOn < 0 || weekStartsOn > 6) {\n throw new RangeError(\"Calendar weekStartsOn must be an integer from zero to six\");\n }\n if (outsideMonth !== \"adjacent\" && outsideMonth !== \"blank\") {\n throw new TypeError(\"Calendar outsideMonth must be adjacent or blank\");\n }\n // UTC is a coordinate system for civil-day layout, never a conversion of the\n // traveller's/service's date. Local Date arithmetic skips/repeats hours at DST.\n const first = new Date(`${month}-01T00:00:00Z`);\n const next = new Date(first);\n next.setUTCMonth(next.getUTCMonth() + 1);\n const day = 86_400_000;\n const leading = (first.getUTCDay() - weekStartsOn + 7) % 7;\n const count = Math.ceil((leading + (next.getTime() - first.getTime()) / day) / 7) * 7;\n return Array.from({ length: count }, (_, index) => {\n const value = new Date(first.getTime() + (index - leading) * day);\n // Four-digit descriptor keys cannot represent the adjacent year at the\n // outer supported boundaries. Those cells stay non-interactive fillers.\n if (value.getUTCFullYear() < 0 || value.getUTCFullYear() > 9999) return {};\n const date = value.toISOString().slice(0, 10);\n const outsideFocusedMonth = !date.startsWith(month);\n return outsideFocusedMonth\n ? outsideMonth === \"blank\" ? {} : { date, outsideFocusedMonth: true }\n : { date };\n });\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. Use createCalendarMonthCells\n * for a plain Gregorian page or supply a product-specific grid with content.\n * The renderer validates shape and resolves semantic state, without reading a clock.\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"]}
package/dist/card.d.ts CHANGED
@@ -4,7 +4,7 @@ export type CardHeadingLevel = 2 | 3 | 4;
4
4
  * `View` on Native), while these slots and defaults stay identical.
5
5
  */
6
6
  export declare const cardRecipe: {
7
- readonly slots: readonly ["root", "media", "body", "header", "leading", "title", "description", "content", "actions"];
7
+ readonly slots: readonly ["root", "media", "backgroundMedia", "backgroundInteraction", "mediaBadges", "badges", "mediaAction", "body", "header", "leading", "title", "description", "content", "actions"];
8
8
  readonly defaults: {
9
9
  readonly tone: "raised";
10
10
  readonly selected: false;
@@ -17,12 +17,26 @@ export declare const cardRecipe: {
17
17
  readonly disabledOpacity: 0.5;
18
18
  readonly pressedOpacity: 0.86;
19
19
  };
20
+ readonly mediaAction: {
21
+ readonly inset: 12;
22
+ readonly diameter: 44;
23
+ readonly iconSize: 20;
24
+ };
25
+ readonly backgroundMedia: {
26
+ readonly scrim: "rgba(0, 0, 0, 0.6)";
27
+ readonly foreground: "#ffffff";
28
+ };
29
+ readonly quotation: {
30
+ readonly gap: 8;
31
+ readonly markSize: 24;
32
+ };
20
33
  readonly body: {
21
34
  readonly padding: 16;
22
35
  readonly gap: 8;
23
36
  };
24
37
  readonly header: {
25
38
  readonly gap: 12;
39
+ readonly alignItems: "center";
26
40
  };
27
41
  readonly title: {
28
42
  readonly variant: "title";
@@ -1 +1 @@
1
- {"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../src/card.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,gBAAgB,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEzC;;;GAGG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiFtB,CAAC"}
1
+ {"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../src/card.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,gBAAgB,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEzC;;;GAGG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsGtB,CAAC"}
package/dist/card.js CHANGED
@@ -1,4 +1,4 @@
1
- import { spacing } from "./foundations.js";
1
+ import { control, glyph, spacing } from "./foundations.js";
2
2
  import { buttonRecipe, } from "./base-recipes.js";
3
3
  /**
4
4
  * Shared Card anatomy. Renderers own their host nodes (`article` on Web,
@@ -8,6 +8,11 @@ export const cardRecipe = {
8
8
  slots: [
9
9
  "root",
10
10
  "media",
11
+ "backgroundMedia",
12
+ "backgroundInteraction",
13
+ "mediaBadges",
14
+ "badges",
15
+ "mediaAction",
11
16
  "body",
12
17
  "header",
13
18
  "leading",
@@ -29,12 +34,20 @@ export const cardRecipe = {
29
34
  // BurnTok's compact 3-column picker (2026-10-10) needs the whole card to activate.
30
35
  // Reuse control state opacity instead of a product Pressable with a second visual contract.
31
36
  interaction: { disabledOpacity: buttonRecipe.opacity.disabled, pressedOpacity: buttonRecipe.opacity.pressed },
37
+ // A playable cover is one target beside independent creator/comment actions (BurnTok screen migration).
38
+ mediaAction: { inset: spacing.sm, diameter: control.minTouchTarget, iconSize: glyph.sm },
39
+ // Decorative artwork needs fixed contrast independent of brand onPrimary (which can be dark).
40
+ // A 60% black scrim keeps white card text readable even over a white source image.
41
+ backgroundMedia: { scrim: "rgba(0, 0, 0, 0.6)", foreground: "#ffffff" },
42
+ quotation: { gap: spacing.xs, markSize: glyph.md },
32
43
  body: {
33
44
  padding: spacing.md,
34
45
  gap: spacing.xs,
35
46
  },
36
47
  header: {
37
48
  gap: spacing.sm,
49
+ // Short copy and independent commands share one vertical center (BurnTok profile, 2026-10-20).
50
+ alignItems: "center",
38
51
  },
39
52
  title: {
40
53
  variant: "title",
package/dist/card.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"card.js","sourceRoot":"","sources":["../src/card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EACL,YAAY,GAGb,MAAM,mBAAmB,CAAC;AAI3B;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,KAAK,EAAE;QACL,MAAM;QACN,OAAO;QACP,MAAM;QACN,QAAQ;QACR,SAAS;QACT,OAAO;QACP,aAAa;QACb,SAAS;QACT,SAAS;KACD;IACV,QAAQ,EAAE;QACR,8EAA8E;QAC9E,0EAA0E;QAC1E,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,KAAK;QACf,QAAQ,EAAE,IAAI;QACd,YAAY,EAAE,CAAC;QACf,OAAO,EAAE,IAAI;KACd;IACD,YAAY,EAAE,QAAQ;IACtB,mFAAmF;IACnF,4FAA4F;IAC5F,WAAW,EAAE,EAAE,eAAe,EAAE,YAAY,CAAC,OAAO,CAAC,QAAQ,EAAE,cAAc,EAAE,YAAY,CAAC,OAAO,CAAC,OAAO,EAAE;IAC7G,IAAI,EAAE;QACJ,OAAO,EAAE,OAAO,CAAC,EAAE;QACnB,GAAG,EAAE,OAAO,CAAC,EAAE;KAChB;IACD,MAAM,EAAE;QACN,GAAG,EAAE,OAAO,CAAC,EAAE;KAChB;IACD,KAAK,EAAE;QACL,OAAO,EAAE,OAAO;QAChB,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,QAAQ;KACnB;IACD,WAAW,EAAE;QACX,OAAO,EAAE,MAAM;QACf,IAAI,EAAE,OAAO;QACb,QAAQ,EAAE,SAAS;KACpB;IACD,OAAO,EAAE;QACP,GAAG,EAAE,OAAO,CAAC,EAAE;QACf,iBAAiB,EAAE,OAAO,CAAC,EAAE;QAC7B,aAAa,EAAE,OAAO,CAAC,EAAE;KAC1B;CAmCF,CAAC","sourcesContent":["import { spacing } from \"./foundations.js\";\nimport {\n buttonRecipe,\n type SurfacePadding,\n type SurfaceTone,\n} from \"./base-recipes.js\";\n\nexport type CardHeadingLevel = 2 | 3 | 4;\n\n/**\n * Shared Card anatomy. Renderers own their host nodes (`article` on Web,\n * `View` on Native), while these slots and defaults stay identical.\n */\nexport const cardRecipe = {\n slots: [\n \"root\",\n \"media\",\n \"body\",\n \"header\",\n \"leading\",\n \"title\",\n \"description\",\n \"content\",\n \"actions\",\n ] as const,\n defaults: {\n // Today Baseball's schedule cards establish the shared raised card treatment.\n // Keep plain Surface defaults independent so layout containers stay flat.\n tone: \"raised\",\n selected: false,\n bordered: true,\n headingLevel: 3,\n padding: \"md\",\n },\n selectedTone: \"accent\",\n // BurnTok's compact 3-column picker (2026-10-10) needs the whole card to activate.\n // Reuse control state opacity instead of a product Pressable with a second visual contract.\n interaction: { disabledOpacity: buttonRecipe.opacity.disabled, pressedOpacity: buttonRecipe.opacity.pressed },\n body: {\n padding: spacing.md,\n gap: spacing.xs,\n },\n header: {\n gap: spacing.sm,\n },\n title: {\n variant: \"title\",\n tone: \"primary\",\n emphasis: \"strong\",\n },\n description: {\n variant: \"body\",\n tone: \"muted\",\n emphasis: \"regular\",\n },\n actions: {\n gap: spacing.sm,\n paddingHorizontal: spacing.md,\n paddingBottom: spacing.md,\n },\n} as const satisfies {\n slots: readonly [\n \"root\",\n \"media\",\n \"body\",\n \"header\",\n \"leading\",\n \"title\",\n \"description\",\n \"content\",\n \"actions\",\n ];\n defaults: {\n tone: SurfaceTone;\n selected: boolean;\n bordered: boolean;\n headingLevel: CardHeadingLevel;\n padding: SurfacePadding;\n };\n selectedTone: SurfaceTone;\n interaction: { disabledOpacity: number; pressedOpacity: number };\n body: { padding: number; gap: number };\n header: { gap: number };\n title: {\n variant: \"title\";\n tone: \"primary\";\n emphasis: \"strong\";\n };\n description: {\n variant: \"body\";\n tone: \"muted\";\n emphasis: \"regular\";\n };\n actions: { gap: number; paddingHorizontal: number; paddingBottom: number };\n};\n"]}
1
+ {"version":3,"file":"card.js","sourceRoot":"","sources":["../src/card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EACL,YAAY,GAGb,MAAM,mBAAmB,CAAC;AAI3B;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,KAAK,EAAE;QACL,MAAM;QACN,OAAO;QACP,iBAAiB;QACjB,uBAAuB;QACvB,aAAa;QACb,QAAQ;QACR,aAAa;QACb,MAAM;QACN,QAAQ;QACR,SAAS;QACT,OAAO;QACP,aAAa;QACb,SAAS;QACT,SAAS;KACD;IACV,QAAQ,EAAE;QACR,8EAA8E;QAC9E,0EAA0E;QAC1E,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,KAAK;QACf,QAAQ,EAAE,IAAI;QACd,YAAY,EAAE,CAAC;QACf,OAAO,EAAE,IAAI;KACd;IACD,YAAY,EAAE,QAAQ;IACtB,mFAAmF;IACnF,4FAA4F;IAC5F,WAAW,EAAE,EAAE,eAAe,EAAE,YAAY,CAAC,OAAO,CAAC,QAAQ,EAAE,cAAc,EAAE,YAAY,CAAC,OAAO,CAAC,OAAO,EAAE;IAC7G,wGAAwG;IACxG,WAAW,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,cAAc,EAAE,QAAQ,EAAE,KAAK,CAAC,EAAE,EAAE;IACxF,8FAA8F;IAC9F,mFAAmF;IACnF,eAAe,EAAE,EAAE,KAAK,EAAE,oBAAoB,EAAE,UAAU,EAAE,SAAS,EAAE;IACvE,SAAS,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,EAAE,EAAE;IAClD,IAAI,EAAE;QACJ,OAAO,EAAE,OAAO,CAAC,EAAE;QACnB,GAAG,EAAE,OAAO,CAAC,EAAE;KAChB;IACD,MAAM,EAAE;QACN,GAAG,EAAE,OAAO,CAAC,EAAE;QACf,+FAA+F;QAC/F,UAAU,EAAE,QAAQ;KACrB;IACD,KAAK,EAAE;QACL,OAAO,EAAE,OAAO;QAChB,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,QAAQ;KACnB;IACD,WAAW,EAAE;QACX,OAAO,EAAE,MAAM;QACf,IAAI,EAAE,OAAO;QACb,QAAQ,EAAE,SAAS;KACpB;IACD,OAAO,EAAE;QACP,GAAG,EAAE,OAAO,CAAC,EAAE;QACf,iBAAiB,EAAE,OAAO,CAAC,EAAE;QAC7B,aAAa,EAAE,OAAO,CAAC,EAAE;KAC1B;CA2CF,CAAC","sourcesContent":["import { control, glyph, spacing } from \"./foundations.js\";\nimport {\n buttonRecipe,\n type SurfacePadding,\n type SurfaceTone,\n} from \"./base-recipes.js\";\n\nexport type CardHeadingLevel = 2 | 3 | 4;\n\n/**\n * Shared Card anatomy. Renderers own their host nodes (`article` on Web,\n * `View` on Native), while these slots and defaults stay identical.\n */\nexport const cardRecipe = {\n slots: [\n \"root\",\n \"media\",\n \"backgroundMedia\",\n \"backgroundInteraction\",\n \"mediaBadges\",\n \"badges\",\n \"mediaAction\",\n \"body\",\n \"header\",\n \"leading\",\n \"title\",\n \"description\",\n \"content\",\n \"actions\",\n ] as const,\n defaults: {\n // Today Baseball's schedule cards establish the shared raised card treatment.\n // Keep plain Surface defaults independent so layout containers stay flat.\n tone: \"raised\",\n selected: false,\n bordered: true,\n headingLevel: 3,\n padding: \"md\",\n },\n selectedTone: \"accent\",\n // BurnTok's compact 3-column picker (2026-10-10) needs the whole card to activate.\n // Reuse control state opacity instead of a product Pressable with a second visual contract.\n interaction: { disabledOpacity: buttonRecipe.opacity.disabled, pressedOpacity: buttonRecipe.opacity.pressed },\n // A playable cover is one target beside independent creator/comment actions (BurnTok screen migration).\n mediaAction: { inset: spacing.sm, diameter: control.minTouchTarget, iconSize: glyph.sm },\n // Decorative artwork needs fixed contrast independent of brand onPrimary (which can be dark).\n // A 60% black scrim keeps white card text readable even over a white source image.\n backgroundMedia: { scrim: \"rgba(0, 0, 0, 0.6)\", foreground: \"#ffffff\" },\n quotation: { gap: spacing.xs, markSize: glyph.md },\n body: {\n padding: spacing.md,\n gap: spacing.xs,\n },\n header: {\n gap: spacing.sm,\n // Short copy and independent commands share one vertical center (BurnTok profile, 2026-10-20).\n alignItems: \"center\",\n },\n title: {\n variant: \"title\",\n tone: \"primary\",\n emphasis: \"strong\",\n },\n description: {\n variant: \"body\",\n tone: \"muted\",\n emphasis: \"regular\",\n },\n actions: {\n gap: spacing.sm,\n paddingHorizontal: spacing.md,\n paddingBottom: spacing.md,\n },\n} as const satisfies {\n slots: readonly [\n \"root\",\n \"media\",\n \"backgroundMedia\",\n \"backgroundInteraction\",\n \"mediaBadges\",\n \"badges\",\n \"mediaAction\",\n \"body\",\n \"header\",\n \"leading\",\n \"title\",\n \"description\",\n \"content\",\n \"actions\",\n ];\n defaults: {\n tone: SurfaceTone;\n selected: boolean;\n bordered: boolean;\n headingLevel: CardHeadingLevel;\n padding: SurfacePadding;\n };\n selectedTone: SurfaceTone;\n interaction: { disabledOpacity: number; pressedOpacity: number };\n mediaAction: { inset: number; diameter: number; iconSize: number };\n backgroundMedia: { scrim: string; foreground: string };\n quotation: { gap: number; markSize: number };\n body: { padding: number; gap: number };\n header: { gap: number; alignItems: \"center\" };\n title: {\n variant: \"title\";\n tone: \"primary\";\n emphasis: \"strong\";\n };\n description: {\n variant: \"body\";\n tone: \"muted\";\n emphasis: \"regular\";\n };\n actions: { gap: number; paddingHorizontal: number; paddingBottom: number };\n};\n"]}
@@ -132,6 +132,8 @@ export type PageIndicatorDescriptor = Readonly<{
132
132
  count: number;
133
133
  /** Zero-based current page. */
134
134
  currentIndex: number;
135
+ /** Limit the visible window around the current page; omitted shows every page. */
136
+ maxVisibleDots?: number;
135
137
  }>;
136
138
  export type PageIndicatorAccessibleNameInfo = Readonly<{
137
139
  position: number;
@@ -166,6 +168,7 @@ export declare const carouselRecipe: {
166
168
  };
167
169
  readonly dot: {
168
170
  readonly diameter: 8;
171
+ readonly compactGap: 8;
169
172
  readonly hitTarget: 44;
170
173
  readonly color: {
171
174
  readonly inactive: Readonly<{
@@ -1 +1 @@
1
- {"version":3,"file":"carousel.d.ts","sourceRoot":"","sources":["../src/carousel.ts"],"names":[],"mappings":"AAQA;;;;;GAKG;AACH,MAAM,MAAM,uBAAuB,CAAC,EAAE,SAAS,MAAM,GAAG,MAAM,IAAI,QAAQ,CAAC;IACzE,EAAE,EAAE,EAAE,CAAC;IACP,wGAAwG;IACxG,KAAK,EAAE,MAAM,CAAC;CACf,CAAC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,QAAQ,CAAC;IAC5C,sEAAsE;IACtE,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,MAAM,2BAA2B,CAAC,EAAE,SAAS,MAAM,GAAG,MAAM,IAAI,QAAQ,CAAC;IAC7E,UAAU,EAAE,EAAE,CAAC;IACf,iBAAiB,CAAC,EAAE,KAAK,CAAC;IAC1B,kBAAkB,CAAC,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC;CACnC,CAAC,CAAC;AAEH;;+EAE+E;AAC/E,MAAM,MAAM,6BAA6B,CAAC,EAAE,SA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AAM,YAAY,GAAG,QAAQ,CAAC;AAEpC,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA2BzB,2GAA2G;;;;;;;;;;;;;;;;;;;IAW3G;;;;OAIG;;;;;;CAuBJ,CAAC"}
package/dist/carousel.js CHANGED
@@ -134,13 +134,21 @@ export function validatePageIndicatorDescriptor(descriptor) {
134
134
  descriptor.currentIndex >= descriptor.count) {
135
135
  throw new RangeError(`PageIndicator currentIndex is out of range: ${String(descriptor.currentIndex)}`);
136
136
  }
137
+ if (descriptor.maxVisibleDots !== undefined && (!Number.isSafeInteger(descriptor.maxVisibleDots) || descriptor.maxVisibleDots < 1)) {
138
+ throw new RangeError("PageIndicator maxVisibleDots must be a positive integer");
139
+ }
137
140
  }
138
141
  export function resolvePageIndicator(descriptor, composeAccessibleName) {
139
142
  validatePageIndicatorDescriptor(descriptor);
140
143
  if (typeof composeAccessibleName !== "function") {
141
144
  throw new TypeError("PageIndicator composeAccessibleName must be a function");
142
145
  }
143
- return Array.from({ length: descriptor.count }, (_, index) => {
146
+ // Product-owned launchers can contain many pages. Keep the current page in a bounded window without
147
+ // renumbering it: accessibility names and navigation still address the complete pager.
148
+ const length = Math.min(descriptor.count, descriptor.maxVisibleDots ?? descriptor.count);
149
+ const start = Math.max(0, Math.min(descriptor.currentIndex - Math.floor(length / 2), descriptor.count - length));
150
+ return Array.from({ length }, (_, offset) => {
151
+ const index = start + offset;
144
152
  const accessibleName = composeAccessibleName({ position: index + 1, total: descriptor.count });
145
153
  if (typeof accessibleName !== "string" || accessibleName.trim().length === 0) {
146
154
  throw new TypeError("PageIndicator composeAccessibleName must return a non-empty string");
@@ -177,6 +185,7 @@ export const carouselRecipe = {
177
185
  },
178
186
  dot: {
179
187
  diameter: 8,
188
+ compactGap: spacing.xs,
180
189
  hitTarget: control.minTouchTarget,
181
190
  color: {
182
191
  inactive: semanticColors.border.strong,
@@ -1 +1 @@
1
- {"version":3,"file":"carousel.js","sourceRoot":"","s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;IAC5C,IAAI,MAAM,KAAK,OAAO;QAAE,OAAO,CAAC,CAAC;IACjC,IAAI,MAAM,KAAK,MAAM;QAAE,OAAO,UAAU,CAAC,KAAK,GAAG,CAAC,CAAC;IACnD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,YAAY,GAAG,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;AAC7G,CAAC;AAID,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,KAAK,EAAE;QACL,MAAM;QACN,OAAO;QACP,OAAO;QACP,MAAM;QACN,KAAK;QACL,iBAAiB;QACjB,aAAa;KACL;IACV,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC5B,KAAK,EAAE;QACL,MAAM,EAAE;YACN,GAAG,EAAE,OAAO,CAAC,EAAE;YACf,gBAAgB,EAAE,OAAO,CAAC,cAAc;YACxC,WAAW,EAAE,IAAI;SAClB;KACF;IACD,GAAG,EAAE;QACH,QAAQ,EAAE,CAAC;QACX,SAAS,EAAE,OAAO,CAAC,cAAc;QACjC,KAAK,EAAE;YACL,QAAQ,EAAE,cAAc,CAAC,MAAM,CAAC,MAAM;YACtC,OAAO,EAAE,cAAc,CAAC,OAAO,CAAC,KAAK;SACtC;KACF;IACD,2GAA2G;IAC3G,OAAO,EAAE;QACP,KAAK,EAAE;YACL,QAAQ,EAAE,cAAc;YACxB,IAAI,EAAE,YAAY;SACiE;KACtF;IACD,MAAM,EAAE;QACN,KAAK,EAAE,sBAAsB;QAC7B,cAAc,EAAE,OAAO,CAAC,OAAO;KAChC;IACD;;;;OAIG;IACH,UAAU,EAAE,YAAY,CAAC,OAAO;CAqBjC,CAAC","sourcesContent":["import type { BehaviorContract } from \"./behaviors.js\";\nimport type { ColorReference } from \"./color-references.js\";\nimport type { SemanticIconName } from \"./icon.js\";\nimport { focusIndicatorContract } from \"./component-contracts.js\";\nimport { control, motionPreset, opacity, spacing } from \"./foundations.js\";\nimport { assertFiniteNumber } from \"./number-field.js\";\nimport { semanticColors } from \"./semantic-colors.js\";\n\n/**\n * Ant Design Carousel's default infinite loop is intentionally not reproduced;\n * autoplay remains opt-in in both libraries — automatic movement can obscure what this contract treats as\n * non-negotiable: a reliable answer to \"where am I, and where does it end\".\n * See docs/carousel.md for the accessibility rationale on every point below.\n */\nexport type CarouselSlideDescriptor<Id extends string = string> = Readonly<{\n id: Id;\n /** Accessible name for the slide, e.g. \"8/19 두산 vs LG\". The slide's visual content is product-owned. */\n label: string;\n}>;\n\nexport type CarouselAutoplayConfig = Readonly<{\n /** Minimum time a slide stays current before an automatic advance. */\n intervalMs: number;\n}>;\n\n/**\n * Renderer-facing prop shape only — mirrors SelectSelection's controlled/\n * uncontrolled duality, but the resolver below always takes a concrete,\n * already-resolved `currentKey` (see CarouselDescriptor) so validation and\n * position math never have to branch on which mode the product chose.\n */\nexport type ControlledCarouselSelection<Id extends string = string> = Readonly<{\n currentKey: Id;\n defaultCurrentKey?: never;\n onCurrentKeyChange(key: Id): void;\n}>;\n\n/** After mount, removing the current slide selects the slide at its previous\n * position, clamped to the new last position, and emits onCurrentKeyChange once.\n * An invalid initial default and an empty collection still fail validation. */\nexport type UncontrolledCarouselSelection<Id extends string = string> = Readonly<{\n currentKey?: never;\n defaultCurrentKey?: Id;\n onCurrentKeyChange?: (key: Id) => void;\n}>;\n\nexport type CarouselSelection<Id extends string = string> =\n | ControlledCarouselSelection<Id>\n | UncontrolledCarouselSelection<Id>;\n\nexport type CarouselDescriptor<Id extends string = string> = Readonly<{\n slides: readonly CarouselSlideDescriptor<Id>[];\n currentKey: Id;\n /** Absent by default. Autoplay is opt-in — see docs/carousel.md. */\n autoplay?: CarouselAutoplayConfig;\n}>;\n\nfunction assertNonEmpty(value: string, field: string): void {\n if (value.trim().length === 0) {\n throw new TypeError(`Carousel ${field} must not be empty`);\n }\n}\n\nexport function validateCarouselSlide<Id extends string>(\n slide: CarouselSlideDescriptor<Id>,\n): void {\n assertNonEmpty(slide.id, \"slide id\");\n if (slide.id !== slide.id.trim()) {\n throw new TypeError(\"Carousel slide id must not start or end with whitespace\");\n }\n assertNonEmpty(slide.label, \"slide label\");\n}\n\nexport function validateCarouselAutoplayConfig(\n autoplay: CarouselAutoplayConfig,\n): void {\n assertFiniteNumber(autoplay.intervalMs, \"autoplay.intervalMs\");\n if (autoplay.intervalMs <= 0) {\n throw new RangeError(\"Carousel autoplay.intervalMs must be greater than zero\");\n }\n}\n\nexport function validateCarouselDescriptor<Id extends string>(\n descriptor: CarouselDescriptor<Id>,\n): void {\n if (descriptor.slides.length === 0) {\n throw new RangeError(\"Carousel must contain at least one slide\");\n }\n const ids = new Set<Id>();\n for (const slide of descriptor.slides) {\n validateCarouselSlide(slide);\n if (ids.has(slide.id)) {\n throw new TypeError(`Duplicate Carousel slide id: ${slide.id}`);\n }\n ids.add(slide.id);\n }\n if (!ids.has(descriptor.currentKey)) {\n throw new RangeError(\n `Carousel currentKey does not match any slide id: ${String(descriptor.currentKey)}`,\n );\n }\n if (descriptor.autoplay) {\n validateCarouselAutoplayConfig(descriptor.autoplay);\n }\n}\n\nexport type CarouselAccessibleNameInfo = Readonly<{\n position: number;\n total: number;\n label: string;\n}>;\n\n/**\n * Same reason Steps and Timeline do not assemble their own accessible name:\n * counter-word grammar and phrase order are product-owned copy decisions.\n */\nexport type ComposeCarouselAccessibleName = (\n info: CarouselAccessibleNameInfo,\n) => string;\n\nexport type ResolvedCarouselSlideDescriptor<Id extends string = string> =\n CarouselSlideDescriptor<Id> &\n Readonly<{\n /** 1-indexed so position and label both preserve reading order for renderers. */\n position: number;\n total: number;\n current: boolean;\n /**\n * True for every slide but the current one. A renderer must exclude an\n * inert slide's interactive content from both focus and the\n * accessibility tree — a hidden slide whose link can still receive\n * focus is worse than one that is simply unreachable until the user\n * advances to it (see docs/carousel.md).\n */\n inert: boolean;\n accessibleName: string;\n }>;\n\nexport type ResolveCarouselOptions = Readonly<{\n composeAccessibleName: ComposeCarouselAccessibleName;\n}>;\n\n/**\n * Attaches order, current/inert, and the composed accessible name used by\n * both the slide group and its indicator dot — one composer, reused for\n * every render target, the same way Steps reuses a single composer.\n */\nexport function resolveCarouselDescriptor<Id extends string>(\n descriptor: CarouselDescriptor<Id>,\n options: ResolveCarouselOptions,\n): readonly ResolvedCarouselSlideDescriptor<Id>[] {\n validateCarouselDescriptor(descriptor);\n if (typeof options.composeAccessibleName !== \"function\") {\n throw new TypeError(\"Carousel composeAccessibleName must be a function\");\n }\n\n const total = descriptor.slides.length;\n return descriptor.slides.map((slide, index) => {\n const position = index + 1;\n const current = slide.id === descriptor.currentKey;\n const accessibleName = options.composeAccessibleName({\n position,\n total,\n label: slide.label,\n });\n if (typeof accessibleName !== \"string\" || accessibleName.trim().length === 0) {\n throw new TypeError(\n \"Carousel composeAccessibleName must return a non-empty string\",\n );\n }\n return { ...slide, position, total, current, inert: !current, accessibleName };\n });\n}\n\nexport type CarouselNavigationIntent = \"next\" | \"previous\" | \"first\" | \"last\";\n\n/**\n * Clamps at the first/last slide instead of wrapping — infinite loop is out\n * of scope (see docs/carousel.md), so there is no modulo here at all, unlike\n * getCollectionNavigationTarget's `loop` parameter elsewhere in this package.\n */\nexport function getCarouselNavigationTarget<Id extends string>(\n descriptor: CarouselDescriptor<Id>,\n intent: CarouselNavigationIntent,\n): Id {\n validateCarouselDescriptor(descriptor);\n const { slides, currentKey } = descriptor;\n if (intent === \"first\") return slides[0]!.id;\n if (intent === \"last\") return slides.at(-1)!.id;\n const currentIndex = slides.findIndex((slide) => slide.id === currentKey);\n const delta = intent === \"next\" ? 1 : -1;\n const clampedIndex = Math.min(\n Math.max(currentIndex + delta, 0),\n slides.length - 1,\n );\n return slides[clampedIndex]!.id;\n}\n\nexport type CarouselAutoplayInputs = Readonly<{\n /** True whenever a platform reduce-motion preference is active. */\n reducedMotion: boolean;\n /** Renderer-combined pointer hover, focus-within, and drag signal. */\n paused: boolean;\n}>;\n\n/**\n * Autoplay is never active without an explicit config, under reduce motion,\n * or while the user is hovering, focusing, or dragging the carousel — the\n * three guards the brief requires are one function so a renderer cannot wire\n * an autoplay timer that forgets one of them.\n */\nexport function isCarouselAutoplayActive(\n autoplay: CarouselAutoplayConfig | undefined,\n inputs: CarouselAutoplayInputs,\n): boolean {\n if (!autoplay) return false;\n validateCarouselAutoplayConfig(autoplay);\n return !inputs.reducedMotion && !inputs.paused;\n}\n\nexport const carouselBehaviorDefaults = {\n autoplay: false,\n} as const satisfies Readonly<{ autoplay: boolean }>;\n\nexport const carouselBehavior = {\n controlled: [\"currentKey\", \"defaultCurrentKey\", \"onCurrentKeyChange\"],\n inputs: [\"autoplay\", \"reducedMotion\", \"dragged\"],\n defaults: carouselBehaviorDefaults,\n stateAxes: {\n interaction: [\"idle\", \"dragged\"],\n value: [\"selected\"],\n },\n web: {\n roles: [\"region\", \"group\"],\n keyboard: [\"Tab\", \"Enter\", \"Space\", \"ArrowLeft\", \"ArrowRight\"],\n focus: \"native\",\n },\n native: {\n roles: [\"adjustable\"],\n states: [\"selected\"],\n actions: [\"increment\", \"decrement\"],\n },\n scenarios: [\n \"current-position-is-announced-with-a-readable-name-not-dots-alone\",\n \"inactive-slide-content-is-excluded-from-focus-and-the-accessibility-tree\",\n \"previous-next-and-dot-controls-stay-in-tab-order-regardless-of-current-slide\",\n \"arrow-keys-move-one-slide-on-web-swipe-moves-one-slide-on-native\",\n \"boundary-slides-clamp-instead-of-wrapping-because-loop-is-out-of-scope\",\n \"autoplay-is-opt-in-and-off-by-default\",\n \"autoplay-never-runs-when-reduced-motion-is-active\",\n \"autoplay-pauses-on-hover-focus-or-drag-and-does-not-announce-automatic-transitions\",\n ],\n} as const satisfies BehaviorContract;\n\n/**\n * PageIndicator is Carousel's position dot row on its own, for a product-owned pager (a paging FlatList or\n * scroll-snap row) that Carousel cannot host because Carousel owns its slides. It reuses `carouselRecipe.dot`\n * and the same clamped navigation, so both rows look and behave the same. Added 2026-10-18 for the Utilverse\n * launcher, which drew its own dots under a native pager.\n */\nexport type PageIndicatorDescriptor = Readonly<{\n /** Number of pages, at least 1. */\n count: number;\n /** Zero-based current page. */\n currentIndex: number;\n}>;\n\nexport type PageIndicatorAccessibleNameInfo = Readonly<{ position: number; total: number }>;\n\n/** Product-owned copy for one page, e.g. \"Home page 2 of 5\" — counter grammar is not the renderer's. */\nexport type ComposePageIndicatorAccessibleName = (info: PageIndicatorAccessibleNameInfo) => string;\n\nexport type ResolvedPageIndicatorDot = Readonly<{\n index: number;\n /** 1-indexed reading position. */\n position: number;\n total: number;\n current: boolean;\n accessibleName: string;\n}>;\n\nexport function validatePageIndicatorDescriptor(descriptor: PageIndicatorDescriptor): void {\n if (!Number.isSafeInteger(descriptor.count) || descriptor.count < 1) {\n throw new RangeError(\"PageIndicator count must be a positive integer\");\n }\n if (\n !Number.isSafeInteger(descriptor.currentIndex) ||\n descriptor.currentIndex < 0 ||\n descriptor.currentIndex >= descriptor.count\n ) {\n throw new RangeError(`PageIndicator currentIndex is out of range: ${String(descriptor.currentIndex)}`);\n }\n}\n\nexport function resolvePageIndicator(\n descriptor: PageIndicatorDescriptor,\n composeAccessibleName: ComposePageIndicatorAccessibleName,\n): readonly ResolvedPageIndicatorDot[] {\n validatePageIndicatorDescriptor(descriptor);\n if (typeof composeAccessibleName !== \"function\") {\n throw new TypeError(\"PageIndicator composeAccessibleName must be a function\");\n }\n return Array.from({ length: descriptor.count }, (_, index) => {\n const accessibleName = composeAccessibleName({ position: index + 1, total: descriptor.count });\n if (typeof accessibleName !== \"string\" || accessibleName.trim().length === 0) {\n throw new TypeError(\"PageIndicator composeAccessibleName must return a non-empty string\");\n }\n return { index, position: index + 1, total: descriptor.count, current: index === descriptor.currentIndex, accessibleName };\n });\n}\n\n/** Clamps like getCarouselNavigationTarget: a pager indicator has an end, it never wraps. */\nexport function getPageIndicatorTarget(\n descriptor: PageIndicatorDescriptor,\n intent: CarouselNavigationIntent,\n): number {\n validatePageIndicatorDescriptor(descriptor);\n if (intent === \"first\") return 0;\n if (intent === \"last\") return descriptor.count - 1;\n return Math.min(Math.max(descriptor.currentIndex + (intent === \"next\" ? 1 : -1), 0), descriptor.count - 1);\n}\n\nexport type CarouselSize = \"medium\";\n\nexport const carouselRecipe = {\n slots: [\n \"root\",\n \"track\",\n \"slide\",\n \"dots\",\n \"dot\",\n \"previousControl\",\n \"nextControl\",\n ] as const,\n defaults: { size: \"medium\" },\n sizes: {\n medium: {\n gap: spacing.sm,\n controlHitTarget: control.minTouchTarget,\n controlIcon: \"sm\",\n },\n },\n dot: {\n diameter: 8,\n hitTarget: control.minTouchTarget,\n color: {\n inactive: semanticColors.border.strong,\n current: semanticColors.content.brand,\n },\n },\n /** Previous/next chrome is composed from IconButton (ghost tone) rather than owning new button visuals. */\n control: {\n icons: {\n previous: \"chevronStart\",\n next: \"chevronEnd\",\n } as const satisfies Readonly<{ previous: SemanticIconName; next: SemanticIconName }>,\n },\n states: {\n focus: focusIndicatorContract,\n draggedOpacity: opacity.dragged,\n },\n /**\n * Manual slide-to-slide movement crossfades rather than snapping under\n * Reduce Motion, reusing the existing \"context\" preset instead of a new\n * token — autoplay itself simply does not run at all (isCarouselAutoplayActive).\n */\n transition: motionPreset.context,\n} as const satisfies {\n slots: readonly string[];\n defaults: { size: CarouselSize };\n sizes: Record<\n CarouselSize,\n { gap: number; controlHitTarget: number; controlIcon: string }\n >;\n dot: {\n diameter: number;\n hitTarget: number;\n color: Record<\"inactive\" | \"current\", ColorReference>;\n };\n control: {\n icons: Readonly<{ previous: SemanticIconName; next: SemanticIconName }>;\n };\n states: {\n focus: typeof focusIndicatorContract;\n draggedOpacity: number;\n };\n transition: typeof motionPreset.context;\n};\n"]}
1
+ {"version":3,"file":"carousel.js","sourceRoot":"","sources":["../src/carousel.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,sBAAsB,EAAE,M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xC,WAAW,EAAE,IAAI;SAClB;KACF;IACD,GAAG,EAAE;QACH,QAAQ,EAAE,CAAC;QACX,UAAU,EAAE,OAAO,CAAC,EAAE;QACtB,SAAS,EAAE,OAAO,CAAC,cAAc;QACjC,KAAK,EAAE;YACL,QAAQ,EAAE,cAAc,CAAC,MAAM,CAAC,MAAM;YACtC,OAAO,EAAE,cAAc,CAAC,OAAO,CAAC,KAAK;SACtC;KACF;IACD,2GAA2G;IAC3G,OAAO,EAAE;QACP,KAAK,EAAE;YACL,QAAQ,EAAE,cAAc;YACxB,IAAI,EAAE,YAAY;SACiE;KACtF;IACD,MAAM,EAAE;QACN,KAAK,EAAE,sBAAsB;QAC7B,cAAc,EAAE,OAAO,CAAC,OAAO;KAChC;IACD;;;;OAIG;IACH,UAAU,EAAE,YAAY,CAAC,OAAO;CAsBjC,CAAC","sourcesContent":["import type { BehaviorContract } from \"./behaviors.js\";\nimport type { ColorReference } from \"./color-references.js\";\nimport type { SemanticIconName } from \"./icon.js\";\nimport { focusIndicatorContract } from \"./component-contracts.js\";\nimport { control, motionPreset, opacity, spacing } from \"./foundations.js\";\nimport { assertFiniteNumber } from \"./number-field.js\";\nimport { semanticColors } from \"./semantic-colors.js\";\n\n/**\n * Ant Design Carousel's default infinite loop is intentionally not reproduced;\n * autoplay remains opt-in in both libraries — automatic movement can obscure what this contract treats as\n * non-negotiable: a reliable answer to \"where am I, and where does it end\".\n * See docs/carousel.md for the accessibility rationale on every point below.\n */\nexport type CarouselSlideDescriptor<Id extends string = string> = Readonly<{\n id: Id;\n /** Accessible name for the slide, e.g. \"8/19 두산 vs LG\". The slide's visual content is product-owned. */\n label: string;\n}>;\n\nexport type CarouselAutoplayConfig = Readonly<{\n /** Minimum time a slide stays current before an automatic advance. */\n intervalMs: number;\n}>;\n\n/**\n * Renderer-facing prop shape only — mirrors SelectSelection's controlled/\n * uncontrolled duality, but the resolver below always takes a concrete,\n * already-resolved `currentKey` (see CarouselDescriptor) so validation and\n * position math never have to branch on which mode the product chose.\n */\nexport type ControlledCarouselSelection<Id extends string = string> = Readonly<{\n currentKey: Id;\n defaultCurrentKey?: never;\n onCurrentKeyChange(key: Id): void;\n}>;\n\n/** After mount, removing the current slide selects the slide at its previous\n * position, clamped to the new last position, and emits onCurrentKeyChange once.\n * An invalid initial default and an empty collection still fail validation. */\nexport type UncontrolledCarouselSelection<Id extends string = string> = Readonly<{\n currentKey?: never;\n defaultCurrentKey?: Id;\n onCurrentKeyChange?: (key: Id) => void;\n}>;\n\nexport type CarouselSelection<Id extends string = string> =\n | ControlledCarouselSelection<Id>\n | UncontrolledCarouselSelection<Id>;\n\nexport type CarouselDescriptor<Id extends string = string> = Readonly<{\n slides: readonly CarouselSlideDescriptor<Id>[];\n currentKey: Id;\n /** Absent by default. Autoplay is opt-in — see docs/carousel.md. */\n autoplay?: CarouselAutoplayConfig;\n}>;\n\nfunction assertNonEmpty(value: string, field: string): void {\n if (value.trim().length === 0) {\n throw new TypeError(`Carousel ${field} must not be empty`);\n }\n}\n\nexport function validateCarouselSlide<Id extends string>(\n slide: CarouselSlideDescriptor<Id>,\n): void {\n assertNonEmpty(slide.id, \"slide id\");\n if (slide.id !== slide.id.trim()) {\n throw new TypeError(\"Carousel slide id must not start or end with whitespace\");\n }\n assertNonEmpty(slide.label, \"slide label\");\n}\n\nexport function validateCarouselAutoplayConfig(\n autoplay: CarouselAutoplayConfig,\n): void {\n assertFiniteNumber(autoplay.intervalMs, \"autoplay.intervalMs\");\n if (autoplay.intervalMs <= 0) {\n throw new RangeError(\"Carousel autoplay.intervalMs must be greater than zero\");\n }\n}\n\nexport function validateCarouselDescriptor<Id extends string>(\n descriptor: CarouselDescriptor<Id>,\n): void {\n if (descriptor.slides.length === 0) {\n throw new RangeError(\"Carousel must contain at least one slide\");\n }\n const ids = new Set<Id>();\n for (const slide of descriptor.slides) {\n validateCarouselSlide(slide);\n if (ids.has(slide.id)) {\n throw new TypeError(`Duplicate Carousel slide id: ${slide.id}`);\n }\n ids.add(slide.id);\n }\n if (!ids.has(descriptor.currentKey)) {\n throw new RangeError(\n `Carousel currentKey does not match any slide id: ${String(descriptor.currentKey)}`,\n );\n }\n if (descriptor.autoplay) {\n validateCarouselAutoplayConfig(descriptor.autoplay);\n }\n}\n\nexport type CarouselAccessibleNameInfo = Readonly<{\n position: number;\n total: number;\n label: string;\n}>;\n\n/**\n * Same reason Steps and Timeline do not assemble their own accessible name:\n * counter-word grammar and phrase order are product-owned copy decisions.\n */\nexport type ComposeCarouselAccessibleName = (\n info: CarouselAccessibleNameInfo,\n) => string;\n\nexport type ResolvedCarouselSlideDescriptor<Id extends string = string> =\n CarouselSlideDescriptor<Id> &\n Readonly<{\n /** 1-indexed so position and label both preserve reading order for renderers. */\n position: number;\n total: number;\n current: boolean;\n /**\n * True for every slide but the current one. A renderer must exclude an\n * inert slide's interactive content from both focus and the\n * accessibility tree — a hidden slide whose link can still receive\n * focus is worse than one that is simply unreachable until the user\n * advances to it (see docs/carousel.md).\n */\n inert: boolean;\n accessibleName: string;\n }>;\n\nexport type ResolveCarouselOptions = Readonly<{\n composeAccessibleName: ComposeCarouselAccessibleName;\n}>;\n\n/**\n * Attaches order, current/inert, and the composed accessible name used by\n * both the slide group and its indicator dot — one composer, reused for\n * every render target, the same way Steps reuses a single composer.\n */\nexport function resolveCarouselDescriptor<Id extends string>(\n descriptor: CarouselDescriptor<Id>,\n options: ResolveCarouselOptions,\n): readonly ResolvedCarouselSlideDescriptor<Id>[] {\n validateCarouselDescriptor(descriptor);\n if (typeof options.composeAccessibleName !== \"function\") {\n throw new TypeError(\"Carousel composeAccessibleName must be a function\");\n }\n\n const total = descriptor.slides.length;\n return descriptor.slides.map((slide, index) => {\n const position = index + 1;\n const current = slide.id === descriptor.currentKey;\n const accessibleName = options.composeAccessibleName({\n position,\n total,\n label: slide.label,\n });\n if (typeof accessibleName !== \"string\" || accessibleName.trim().length === 0) {\n throw new TypeError(\n \"Carousel composeAccessibleName must return a non-empty string\",\n );\n }\n return { ...slide, position, total, current, inert: !current, accessibleName };\n });\n}\n\nexport type CarouselNavigationIntent = \"next\" | \"previous\" | \"first\" | \"last\";\n\n/**\n * Clamps at the first/last slide instead of wrapping — infinite loop is out\n * of scope (see docs/carousel.md), so there is no modulo here at all, unlike\n * getCollectionNavigationTarget's `loop` parameter elsewhere in this package.\n */\nexport function getCarouselNavigationTarget<Id extends string>(\n descriptor: CarouselDescriptor<Id>,\n intent: CarouselNavigationIntent,\n): Id {\n validateCarouselDescriptor(descriptor);\n const { slides, currentKey } = descriptor;\n if (intent === \"first\") return slides[0]!.id;\n if (intent === \"last\") return slides.at(-1)!.id;\n const currentIndex = slides.findIndex((slide) => slide.id === currentKey);\n const delta = intent === \"next\" ? 1 : -1;\n const clampedIndex = Math.min(\n Math.max(currentIndex + delta, 0),\n slides.length - 1,\n );\n return slides[clampedIndex]!.id;\n}\n\nexport type CarouselAutoplayInputs = Readonly<{\n /** True whenever a platform reduce-motion preference is active. */\n reducedMotion: boolean;\n /** Renderer-combined pointer hover, focus-within, and drag signal. */\n paused: boolean;\n}>;\n\n/**\n * Autoplay is never active without an explicit config, under reduce motion,\n * or while the user is hovering, focusing, or dragging the carousel — the\n * three guards the brief requires are one function so a renderer cannot wire\n * an autoplay timer that forgets one of them.\n */\nexport function isCarouselAutoplayActive(\n autoplay: CarouselAutoplayConfig | undefined,\n inputs: CarouselAutoplayInputs,\n): boolean {\n if (!autoplay) return false;\n validateCarouselAutoplayConfig(autoplay);\n return !inputs.reducedMotion && !inputs.paused;\n}\n\nexport const carouselBehaviorDefaults = {\n autoplay: false,\n} as const satisfies Readonly<{ autoplay: boolean }>;\n\nexport const carouselBehavior = {\n controlled: [\"currentKey\", \"defaultCurrentKey\", \"onCurrentKeyChange\"],\n inputs: [\"autoplay\", \"reducedMotion\", \"dragged\"],\n defaults: carouselBehaviorDefaults,\n stateAxes: {\n interaction: [\"idle\", \"dragged\"],\n value: [\"selected\"],\n },\n web: {\n roles: [\"region\", \"group\"],\n keyboard: [\"Tab\", \"Enter\", \"Space\", \"ArrowLeft\", \"ArrowRight\"],\n focus: \"native\",\n },\n native: {\n roles: [\"adjustable\"],\n states: [\"selected\"],\n actions: [\"increment\", \"decrement\"],\n },\n scenarios: [\n \"current-position-is-announced-with-a-readable-name-not-dots-alone\",\n \"inactive-slide-content-is-excluded-from-focus-and-the-accessibility-tree\",\n \"previous-next-and-dot-controls-stay-in-tab-order-regardless-of-current-slide\",\n \"arrow-keys-move-one-slide-on-web-swipe-moves-one-slide-on-native\",\n \"boundary-slides-clamp-instead-of-wrapping-because-loop-is-out-of-scope\",\n \"autoplay-is-opt-in-and-off-by-default\",\n \"autoplay-never-runs-when-reduced-motion-is-active\",\n \"autoplay-pauses-on-hover-focus-or-drag-and-does-not-announce-automatic-transitions\",\n ],\n} as const satisfies BehaviorContract;\n\n/**\n * PageIndicator is Carousel's position dot row on its own, for a product-owned pager (a paging FlatList or\n * scroll-snap row) that Carousel cannot host because Carousel owns its slides. It reuses `carouselRecipe.dot`\n * and the same clamped navigation, so both rows look and behave the same. Added 2026-10-18 for the Utilverse\n * launcher, which drew its own dots under a native pager.\n */\nexport type PageIndicatorDescriptor = Readonly<{\n /** Number of pages, at least 1. */\n count: number;\n /** Zero-based current page. */\n currentIndex: number;\n /** Limit the visible window around the current page; omitted shows every page. */\n maxVisibleDots?: number;\n}>;\n\nexport type PageIndicatorAccessibleNameInfo = Readonly<{ position: number; total: number }>;\n\n/** Product-owned copy for one page, e.g. \"Home page 2 of 5\" — counter grammar is not the renderer's. */\nexport type ComposePageIndicatorAccessibleName = (info: PageIndicatorAccessibleNameInfo) => string;\n\nexport type ResolvedPageIndicatorDot = Readonly<{\n index: number;\n /** 1-indexed reading position. */\n position: number;\n total: number;\n current: boolean;\n accessibleName: string;\n}>;\n\nexport function validatePageIndicatorDescriptor(descriptor: PageIndicatorDescriptor): void {\n if (!Number.isSafeInteger(descriptor.count) || descriptor.count < 1) {\n throw new RangeError(\"PageIndicator count must be a positive integer\");\n }\n if (\n !Number.isSafeInteger(descriptor.currentIndex) ||\n descriptor.currentIndex < 0 ||\n descriptor.currentIndex >= descriptor.count\n ) {\n throw new RangeError(`PageIndicator currentIndex is out of range: ${String(descriptor.currentIndex)}`);\n }\n if (descriptor.maxVisibleDots !== undefined && (!Number.isSafeInteger(descriptor.maxVisibleDots) || descriptor.maxVisibleDots < 1)) {\n throw new RangeError(\"PageIndicator maxVisibleDots must be a positive integer\");\n }\n}\n\nexport function resolvePageIndicator(\n descriptor: PageIndicatorDescriptor,\n composeAccessibleName: ComposePageIndicatorAccessibleName,\n): readonly ResolvedPageIndicatorDot[] {\n validatePageIndicatorDescriptor(descriptor);\n if (typeof composeAccessibleName !== \"function\") {\n throw new TypeError(\"PageIndicator composeAccessibleName must be a function\");\n }\n // Product-owned launchers can contain many pages. Keep the current page in a bounded window without\n // renumbering it: accessibility names and navigation still address the complete pager.\n const length = Math.min(descriptor.count, descriptor.maxVisibleDots ?? descriptor.count);\n const start = Math.max(0, Math.min(descriptor.currentIndex - Math.floor(length / 2), descriptor.count - length));\n return Array.from({ length }, (_, offset) => {\n const index = start + offset;\n const accessibleName = composeAccessibleName({ position: index + 1, total: descriptor.count });\n if (typeof accessibleName !== \"string\" || accessibleName.trim().length === 0) {\n throw new TypeError(\"PageIndicator composeAccessibleName must return a non-empty string\");\n }\n return { index, position: index + 1, total: descriptor.count, current: index === descriptor.currentIndex, accessibleName };\n });\n}\n\n/** Clamps like getCarouselNavigationTarget: a pager indicator has an end, it never wraps. */\nexport function getPageIndicatorTarget(\n descriptor: PageIndicatorDescriptor,\n intent: CarouselNavigationIntent,\n): number {\n validatePageIndicatorDescriptor(descriptor);\n if (intent === \"first\") return 0;\n if (intent === \"last\") return descriptor.count - 1;\n return Math.min(Math.max(descriptor.currentIndex + (intent === \"next\" ? 1 : -1), 0), descriptor.count - 1);\n}\n\nexport type CarouselSize = \"medium\";\n\nexport const carouselRecipe = {\n slots: [\n \"root\",\n \"track\",\n \"slide\",\n \"dots\",\n \"dot\",\n \"previousControl\",\n \"nextControl\",\n ] as const,\n defaults: { size: \"medium\" },\n sizes: {\n medium: {\n gap: spacing.sm,\n controlHitTarget: control.minTouchTarget,\n controlIcon: \"sm\",\n },\n },\n dot: {\n diameter: 8,\n compactGap: spacing.xs,\n hitTarget: control.minTouchTarget,\n color: {\n inactive: semanticColors.border.strong,\n current: semanticColors.content.brand,\n },\n },\n /** Previous/next chrome is composed from IconButton (ghost tone) rather than owning new button visuals. */\n control: {\n icons: {\n previous: \"chevronStart\",\n next: \"chevronEnd\",\n } as const satisfies Readonly<{ previous: SemanticIconName; next: SemanticIconName }>,\n },\n states: {\n focus: focusIndicatorContract,\n draggedOpacity: opacity.dragged,\n },\n /**\n * Manual slide-to-slide movement crossfades rather than snapping under\n * Reduce Motion, reusing the existing \"context\" preset instead of a new\n * token — autoplay itself simply does not run at all (isCarouselAutoplayActive).\n */\n transition: motionPreset.context,\n} as const satisfies {\n slots: readonly string[];\n defaults: { size: CarouselSize };\n sizes: Record<\n CarouselSize,\n { gap: number; controlHitTarget: number; controlIcon: string }\n >;\n dot: {\n diameter: number;\n compactGap: number;\n hitTarget: number;\n color: Record<\"inactive\" | \"current\", ColorReference>;\n };\n control: {\n icons: Readonly<{ previous: SemanticIconName; next: SemanticIconName }>;\n };\n states: {\n focus: typeof focusIndicatorContract;\n draggedOpacity: number;\n };\n transition: typeof motionPreset.context;\n};\n"]}