@ankhorage/zora 27.5.3 → 27.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (268) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -1
  3. package/dist/capabilities/index.js +13 -1
  4. package/dist/capabilities/index.js.map +5 -4
  5. package/dist/features/calendar/adapters/inbound/Calendar.d.ts +5 -0
  6. package/dist/features/calendar/adapters/inbound/Calendar.d.ts.map +1 -0
  7. package/dist/features/calendar/adapters/inbound/Calendar.js +126 -0
  8. package/dist/features/calendar/adapters/inbound/Calendar.js.map +1 -0
  9. package/dist/features/calendar/application/createCalendarMonth.d.ts +9 -0
  10. package/dist/features/calendar/application/createCalendarMonth.d.ts.map +1 -0
  11. package/dist/features/calendar/application/createCalendarMonth.js +25 -0
  12. package/dist/features/calendar/application/createCalendarMonth.js.map +1 -0
  13. package/dist/features/calendar/application/isCalendarDateDisabled.d.ts +10 -0
  14. package/dist/features/calendar/application/isCalendarDateDisabled.d.ts.map +1 -0
  15. package/dist/features/calendar/application/isCalendarDateDisabled.js +23 -0
  16. package/dist/features/calendar/application/isCalendarDateDisabled.js.map +1 -0
  17. package/dist/features/calendar/calendarMeta.d.ts +10 -0
  18. package/dist/features/calendar/calendarMeta.d.ts.map +1 -0
  19. package/dist/features/calendar/calendarMeta.js +10 -0
  20. package/dist/features/calendar/calendarMeta.js.map +1 -0
  21. package/dist/features/calendar/public.d.ts +2 -0
  22. package/dist/features/calendar/public.d.ts.map +1 -1
  23. package/dist/features/calendar/public.js +1 -1
  24. package/dist/features/calendar/public.js.map +1 -1
  25. package/dist/features/data-table/adapters/inbound/DataTable.d.ts +1 -1
  26. package/dist/features/data-table/adapters/inbound/DataTable.d.ts.map +1 -1
  27. package/dist/features/data-table/adapters/inbound/DataTable.js +82 -23
  28. package/dist/features/data-table/adapters/inbound/DataTable.js.map +1 -1
  29. package/dist/features/date-picker/composition/DatePickerContent.d.ts +1 -1
  30. package/dist/features/date-picker/composition/DatePickerContent.d.ts.map +1 -1
  31. package/dist/features/date-picker/composition/DatePickerContent.js +5 -104
  32. package/dist/features/date-picker/composition/DatePickerContent.js.map +1 -1
  33. package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.d.ts.map +1 -1
  34. package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.js +19 -0
  35. package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.js.map +1 -1
  36. package/dist/features/grid-view/adapters/inbound/GridView.d.ts +1 -1
  37. package/dist/features/grid-view/adapters/inbound/GridView.d.ts.map +1 -1
  38. package/dist/features/grid-view/adapters/inbound/GridView.js +6 -5
  39. package/dist/features/grid-view/adapters/inbound/GridView.js.map +1 -1
  40. package/dist/features/registry/ZORA_BASE_COMPONENT_REGISTRY.d.ts.map +1 -1
  41. package/dist/features/registry/ZORA_BASE_COMPONENT_REGISTRY.js +2 -0
  42. package/dist/features/registry/ZORA_BASE_COMPONENT_REGISTRY.js.map +1 -1
  43. package/dist/features/registry/componentMeta.d.ts.map +1 -1
  44. package/dist/features/registry/componentMeta.js +2 -0
  45. package/dist/features/registry/componentMeta.js.map +1 -1
  46. package/dist/features/timeline/adapters/inbound/Timeline.d.ts.map +1 -1
  47. package/dist/features/timeline/adapters/inbound/Timeline.js +17 -11
  48. package/dist/features/timeline/adapters/inbound/Timeline.js.map +1 -1
  49. package/dist/readerFree.d.ts +1 -0
  50. package/dist/readerFree.d.ts.map +1 -1
  51. package/dist/readerFree.js +1 -0
  52. package/dist/readerFree.js.map +1 -1
  53. package/dist/types/calendar.d.ts +24 -0
  54. package/dist/types/calendar.d.ts.map +1 -0
  55. package/dist/types/calendar.js +2 -0
  56. package/dist/types/calendar.js.map +1 -0
  57. package/dist/types/data-table.d.ts +4 -0
  58. package/dist/types/data-table.d.ts.map +1 -1
  59. package/dist/types/data-table.js.map +1 -1
  60. package/dist/types/grid-view.d.ts +2 -0
  61. package/dist/types/grid-view.d.ts.map +1 -1
  62. package/dist/types/grid-view.js.map +1 -1
  63. package/dist/types/timeline.d.ts +3 -0
  64. package/dist/types/timeline.d.ts.map +1 -1
  65. package/dist/types/timeline.js.map +1 -1
  66. package/package.json +2 -2
  67. package/src/features/calendar/adapters/inbound/Calendar.interaction.test.tsx +115 -0
  68. package/src/features/calendar/adapters/inbound/Calendar.tsx +219 -0
  69. package/src/features/calendar/application/createCalendarMonth.test.ts +23 -0
  70. package/src/features/calendar/application/createCalendarMonth.ts +38 -0
  71. package/src/features/calendar/application/isCalendarDateDisabled.test.ts +49 -0
  72. package/src/features/calendar/application/isCalendarDateDisabled.ts +41 -0
  73. package/src/features/calendar/calendarMeta.ts +11 -0
  74. package/src/features/calendar/public.test.ts +14 -0
  75. package/src/features/calendar/public.ts +7 -0
  76. package/src/features/data-table/adapters/inbound/DataTable.test.tsx +242 -0
  77. package/src/features/data-table/adapters/inbound/DataTable.tsx +162 -38
  78. package/src/features/date-picker/composition/DatePickerContent.tsx +8 -192
  79. package/src/features/date-picker/public.test.ts +2 -1
  80. package/src/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.test.ts +102 -3
  81. package/src/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.ts +25 -0
  82. package/src/features/grid-view/adapters/inbound/GridView.tsx +6 -4
  83. package/src/features/registry/ZORA_BASE_COMPONENT_REGISTRY.ts +2 -0
  84. package/src/features/registry/componentMeta.ts +2 -0
  85. package/src/features/timeline/adapters/inbound/Timeline.test.tsx +175 -0
  86. package/src/features/timeline/adapters/inbound/Timeline.tsx +47 -26
  87. package/src/readerFree.ts +7 -0
  88. package/src/types/calendar.ts +25 -0
  89. package/src/types/data-table.ts +4 -0
  90. package/src/types/grid-view.ts +2 -0
  91. package/src/types/timeline.ts +3 -0
  92. package/web-dist/chunks/{Accordion-k81eyekh.js → Accordion-0j4xzcwz.js} +2 -2
  93. package/web-dist/chunks/{Accordion-5f9e10c6.js → Accordion-252dr90x.js} +1 -1
  94. package/web-dist/chunks/{Accordion-0pryvztw.js → Accordion-260pyaxy.js} +1 -1
  95. package/web-dist/chunks/{Accordion-g9hn7fht.js → Accordion-4c7hqeg3.js} +1 -1
  96. package/web-dist/chunks/{Accordion-0z8nry94.js → Accordion-4kmh6s2k.js} +1 -1
  97. package/web-dist/chunks/{Accordion-g758dqfc.js → Accordion-5pbvgvqc.js} +1 -1
  98. package/web-dist/chunks/{Accordion-jp5xt2kz.js → Accordion-5z8pbn4z.js} +1 -1
  99. package/web-dist/chunks/{Accordion-qzx53csd.js → Accordion-6jsea4e0.js} +4 -4
  100. package/web-dist/chunks/{Accordion-yd025qec.js → Accordion-7788ybcs.js} +2 -2
  101. package/web-dist/chunks/{Accordion-ppksc4jh.js → Accordion-7mnan4q4.js} +4 -4
  102. package/web-dist/chunks/{Accordion-0pm8dvcy.js → Accordion-8j7t77tf.js} +2 -2
  103. package/web-dist/chunks/{Accordion-6tesp7jr.js → Accordion-c44m1q0m.js} +1 -1
  104. package/web-dist/chunks/{Accordion-a6h4ff7g.js → Accordion-f2n2zz1x.js} +2 -2
  105. package/web-dist/chunks/{Accordion-ep9xpmbw.js → Accordion-fbehwpr1.js} +3 -3
  106. package/web-dist/chunks/{Accordion-j09h3pg1.js → Accordion-hf4nfkn0.js} +7 -7
  107. package/web-dist/chunks/{Accordion-xr81ntxh.js → Accordion-hh48jjhk.js} +4 -4
  108. package/web-dist/chunks/{Accordion-3qz6s2z9.js → Accordion-j6bs1yfn.js} +1 -1
  109. package/web-dist/chunks/{Accordion-dnpfe329.js → Accordion-jh94mg56.js} +3 -3
  110. package/web-dist/chunks/{Accordion-6c2ykyad.js → Accordion-jx9tc6p1.js} +2 -2
  111. package/web-dist/chunks/{Accordion-8xgdw6ry.js → Accordion-kcca65d8.js} +1 -1
  112. package/web-dist/chunks/{Accordion-g009pehq.js → Accordion-m3xb7z7j.js} +3 -3
  113. package/web-dist/chunks/{Accordion-eqkmzs33.js → Accordion-mpebzjby.js} +1 -1
  114. package/web-dist/chunks/{Accordion-n29svm40.js → Accordion-ms1y70gq.js} +1 -1
  115. package/web-dist/chunks/{Accordion-t0k1cjca.js → Accordion-neg1cgeh.js} +7 -5
  116. package/web-dist/chunks/{Accordion-wfrt39d2.js → Accordion-nnhznqgf.js} +1 -1
  117. package/web-dist/chunks/{Accordion-cqdfhyr9.js → Accordion-np16p9mh.js} +1 -1
  118. package/web-dist/chunks/{Accordion-zjygy6n2.js → Accordion-p2f0e4pn.js} +3 -3
  119. package/web-dist/chunks/{Accordion-q1vqpaw6.js → Accordion-p7mxkxhs.js} +4 -4
  120. package/web-dist/chunks/{Accordion-d6f4vr6s.js → Accordion-r6zvzrkd.js} +1 -1
  121. package/web-dist/chunks/Accordion-r86ce0wj.js +237 -0
  122. package/web-dist/chunks/{Accordion-b8659jt9.js → Accordion-rwc34cn2.js} +1 -1
  123. package/web-dist/chunks/{Accordion-rcff84ws.js → Accordion-s9nbkzky.js} +1 -1
  124. package/web-dist/chunks/{Accordion-01s50nga.js → Accordion-sxzts6bj.js} +1 -1
  125. package/web-dist/chunks/{Accordion-36nt5xmp.js → Accordion-t2cvrn0r.js} +4 -4
  126. package/web-dist/chunks/{Accordion-y5kdx80m.js → Accordion-tnt1txfq.js} +3 -3
  127. package/web-dist/chunks/{Accordion-bj7hv2dq.js → Accordion-vq8zrnwh.js} +1 -1
  128. package/web-dist/chunks/{Accordion-hh6jrz1e.js → Accordion-w0prbwy0.js} +4 -4
  129. package/web-dist/chunks/{Accordion-zqzqg9yc.js → Accordion-wvghkwxx.js} +6 -6
  130. package/web-dist/chunks/{Accordion-cp82h5jx.js → Accordion-wx0jp5cn.js} +4 -4
  131. package/web-dist/chunks/{Accordion-bwp6m0zd.js → Accordion-yb4as6wc.js} +2 -2
  132. package/web-dist/chunks/{Accordion-e9c80kn7.js → Accordion-yrzm02g2.js} +2 -2
  133. package/web-dist/components/accordion/Accordion.js +3 -3
  134. package/web-dist/components/accordion-item/AccordionItem.js +3 -3
  135. package/web-dist/components/app-bar/AppBar.js +8 -8
  136. package/web-dist/components/app-header/AppHeader.js +8 -8
  137. package/web-dist/components/app-shell/AppShell.js +2 -2
  138. package/web-dist/components/auth-screen/AuthScreen.js +12 -12
  139. package/web-dist/components/avatar/Avatar.js +3 -3
  140. package/web-dist/components/avatar-group/AvatarGroup.js +3 -3
  141. package/web-dist/components/badge/Badge.js +2 -2
  142. package/web-dist/components/barcode-scanner-view/BarcodeScannerView.js +11 -11
  143. package/web-dist/components/bottom-sheet/BottomSheet.js +3 -3
  144. package/web-dist/components/bottom-sheet-flat-list/BottomSheetFlatList.js +3 -3
  145. package/web-dist/components/bottom-sheet-scroll-view/BottomSheetScrollView.js +3 -3
  146. package/web-dist/components/bottom-sheet-section-list/BottomSheetSectionList.js +3 -3
  147. package/web-dist/components/bottom-sheet-view/BottomSheetView.js +3 -3
  148. package/web-dist/components/bottom-sheet-virtualized-list/BottomSheetVirtualizedList.js +3 -3
  149. package/web-dist/components/breadcrumbs/Breadcrumbs.js +5 -5
  150. package/web-dist/components/button/Button.js +5 -5
  151. package/web-dist/components/button-group/ButtonGroup.js +5 -5
  152. package/web-dist/components/calendar/Calendar.d.ts +8 -0
  153. package/web-dist/components/calendar/Calendar.dependency-0.d.ts +27 -0
  154. package/web-dist/components/calendar/Calendar.dependency-1.d.ts +3 -0
  155. package/web-dist/components/calendar/Calendar.js +25 -0
  156. package/web-dist/components/calendar/Calendar.types-0.d.ts +27 -0
  157. package/web-dist/components/calendar/Calendar.types-1.d.ts +146 -0
  158. package/web-dist/components/calendar/index.d.ts +2 -0
  159. package/web-dist/components/calendar/index.js +2 -0
  160. package/web-dist/components/camera-permission-view/CameraPermissionView.js +11 -11
  161. package/web-dist/components/card/Card.js +10 -10
  162. package/web-dist/components/chat-list-item/ChatListItem.js +6 -6
  163. package/web-dist/components/checkbox/Checkbox.js +4 -4
  164. package/web-dist/components/checkbox-group/CheckboxGroup.js +4 -4
  165. package/web-dist/components/chess-board/ChessBoard.js +2 -2
  166. package/web-dist/components/chip/Chip.js +4 -4
  167. package/web-dist/components/chip-group/ChipGroup.js +4 -4
  168. package/web-dist/components/collection-editor/CollectionEditor.js +10 -10
  169. package/web-dist/components/color-hue-scale/ColorHueScale.js +6 -6
  170. package/web-dist/components/color-picker/ColorPicker.js +6 -6
  171. package/web-dist/components/color-tone/ColorTone.js +6 -6
  172. package/web-dist/components/color-wheel/ColorWheel.js +6 -6
  173. package/web-dist/components/content-rail/ContentRail.js +5 -5
  174. package/web-dist/components/data-table/DataTable.d.ts +1 -1
  175. package/web-dist/components/data-table/DataTable.js +149 -64
  176. package/web-dist/components/data-table/DataTable.types-0.d.ts +4 -0
  177. package/web-dist/components/date-picker/DatePicker.js +19 -160
  178. package/web-dist/components/dialog/Dialog.js +4 -4
  179. package/web-dist/components/divider/Divider.js +2 -2
  180. package/web-dist/components/empty-state/EmptyState.js +11 -11
  181. package/web-dist/components/explorer/Explorer.js +5 -5
  182. package/web-dist/components/field/Field.js +4 -4
  183. package/web-dist/components/file-explorer/FileExplorer.js +5 -5
  184. package/web-dist/components/flat-list/FlatList.js +5 -5
  185. package/web-dist/components/forgot-password-form/ForgotPasswordForm.js +12 -12
  186. package/web-dist/components/form/Form.js +8 -8
  187. package/web-dist/components/form-actions/FormActions.js +8 -8
  188. package/web-dist/components/form-error/FormError.js +8 -8
  189. package/web-dist/components/game/Game.js +3 -3
  190. package/web-dist/components/game-entity/GameEntity.js +3 -3
  191. package/web-dist/components/game-field/GameField.js +3 -3
  192. package/web-dist/components/game-input-zone/GameInputZone.js +3 -3
  193. package/web-dist/components/game-measurement-probe/GameMeasurementProbe.js +3 -3
  194. package/web-dist/components/game-overlay/GameOverlay.js +3 -3
  195. package/web-dist/components/gradient/Gradient.js +3 -3
  196. package/web-dist/components/gradient-renderer-provider/GradientRendererProvider.js +3 -3
  197. package/web-dist/components/graph-view/GraphView.js +13 -0
  198. package/web-dist/components/grid/Grid.js +2 -2
  199. package/web-dist/components/grid-view/GridView.d.ts +1 -1
  200. package/web-dist/components/grid-view/GridView.js +1 -1
  201. package/web-dist/components/grid-view/GridView.types-0.d.ts +2 -0
  202. package/web-dist/components/hero/Hero.js +10 -10
  203. package/web-dist/components/icon-button/IconButton.js +5 -5
  204. package/web-dist/components/image/Image.js +3 -3
  205. package/web-dist/components/list/List.js +5 -5
  206. package/web-dist/components/list-item/ListItem.js +5 -5
  207. package/web-dist/components/list-section/ListSection.js +5 -5
  208. package/web-dist/components/matrix-grid/MatrixGrid.js +1 -1
  209. package/web-dist/components/media-card/MediaCard.js +10 -10
  210. package/web-dist/components/media-explorer/MediaExplorer.js +5 -5
  211. package/web-dist/components/message-bubble/MessageBubble.js +6 -6
  212. package/web-dist/components/metric-card/MetricCard.js +10 -10
  213. package/web-dist/components/missing-element/MissingElement.js +3 -3
  214. package/web-dist/components/o-auth-provider-button/OAuthProviderButton.js +12 -12
  215. package/web-dist/components/o-auth-provider-list/OAuthProviderList.js +12 -12
  216. package/web-dist/components/opening-book/OpeningBook.js +2 -2
  217. package/web-dist/components/otp-form/OtpForm.js +12 -12
  218. package/web-dist/components/pagination/Pagination.js +5 -5
  219. package/web-dist/components/palette-item/PaletteItem.js +10 -10
  220. package/web-dist/components/popover-menu/PopoverMenu.js +4 -4
  221. package/web-dist/components/post-card/PostCard.js +10 -10
  222. package/web-dist/components/product-card/ProductCard.js +10 -10
  223. package/web-dist/components/progress/Progress.js +3 -3
  224. package/web-dist/components/progress-ring/ProgressRing.js +3 -3
  225. package/web-dist/components/radio/Radio.js +4 -4
  226. package/web-dist/components/radio-group/RadioGroup.js +4 -4
  227. package/web-dist/components/rating/Rating.js +2 -2
  228. package/web-dist/components/reader/Reader.js +11 -11
  229. package/web-dist/components/scan-overlay/ScanOverlay.js +11 -11
  230. package/web-dist/components/screen/Screen.js +2 -2
  231. package/web-dist/components/screen-section/ScreenSection.js +3 -3
  232. package/web-dist/components/scroll-view/ScrollView.js +2 -2
  233. package/web-dist/components/search-input/SearchInput.js +6 -6
  234. package/web-dist/components/section-header/SectionHeader.js +3 -3
  235. package/web-dist/components/section-list/SectionList.js +5 -5
  236. package/web-dist/components/select/Select.js +8 -8
  237. package/web-dist/components/sign-in-form/SignInForm.js +12 -12
  238. package/web-dist/components/sign-up-form/SignUpForm.js +12 -12
  239. package/web-dist/components/skeleton/Skeleton.js +13 -13
  240. package/web-dist/components/skeleton-card/SkeletonCard.js +13 -13
  241. package/web-dist/components/skeleton-list/SkeletonList.js +13 -13
  242. package/web-dist/components/skeleton-text/SkeletonText.js +13 -13
  243. package/web-dist/components/spatial-grid/SpatialGrid.js +1 -1
  244. package/web-dist/components/surface/Surface.js +3 -3
  245. package/web-dist/components/switch/Switch.js +2 -2
  246. package/web-dist/components/tab/Tab.js +2 -2
  247. package/web-dist/components/tab-list/TabList.js +2 -2
  248. package/web-dist/components/tab-panel/TabPanel.js +2 -2
  249. package/web-dist/components/tabs/Tabs.js +2 -2
  250. package/web-dist/components/text-input/TextInput.js +6 -6
  251. package/web-dist/components/theme-mode-toggle/ThemeModeToggle.js +5 -5
  252. package/web-dist/components/tile-grid/TileGrid.js +1 -1
  253. package/web-dist/components/time-grid/TimeGrid.js +1 -1
  254. package/web-dist/components/time-picker/TimePicker.js +9 -9
  255. package/web-dist/components/timeline/Timeline.dependency-2.d.ts +8 -2
  256. package/web-dist/components/timeline/Timeline.dependency-3.d.ts +23 -0
  257. package/web-dist/components/timeline/Timeline.dependency-4.d.ts +3 -0
  258. package/web-dist/components/timeline/Timeline.js +30 -11
  259. package/web-dist/components/timeline/Timeline.types-0.d.ts +5 -1
  260. package/web-dist/components/toast/Toast.js +4 -4
  261. package/web-dist/components/toast-provider/ToastProvider.js +4 -4
  262. package/web-dist/components/toolbar/Toolbar.js +10 -10
  263. package/web-dist/components/tree-item/TreeItem.js +7 -7
  264. package/web-dist/components/uploader/Uploader.js +14 -14
  265. package/web-dist/components/view/View.js +2 -2
  266. package/web-dist/manifest.json +720 -673
  267. package/web-dist/runtime/ZoraProvider.js +3 -3
  268. /package/web-dist/chunks/{Accordion-kpk964z0.js → Accordion-a8k3cvj0.js} +0 -0
@@ -0,0 +1,219 @@
1
+ import type { GridRectItem } from '@ankhorage/grid-view';
2
+ import React from 'react';
3
+
4
+ import type { CalendarProps } from '../../../../types/calendar';
5
+ import { Button } from '../../../button/public';
6
+ import { GridView } from '../../../grid-view/public';
7
+ import { View } from '../../../layout/public';
8
+ import { withZoraThemeScope } from '../../../theme/adapters/inbound/withZoraThemeScope';
9
+ import { Text } from '../../../typography/public';
10
+ import { createCalendarMonth } from '../../application/createCalendarMonth';
11
+ import { isCalendarDateDisabled } from '../../application/isCalendarDateDisabled';
12
+
13
+ const GRID_COLUMNS = 7;
14
+ const GRID_ROWS = 6;
15
+
16
+ /*** Renders a locale-aware, accessible month calendar using canonical GridView geometry. */
17
+ export const Calendar = withZoraThemeScope(CalendarInner);
18
+
19
+ /*** Connects controlled Calendar state to the shared month grid presentation. */
20
+ function CalendarInner({
21
+ defaultDisplayedMonth,
22
+ density = 'regular',
23
+ disabledDates = [],
24
+ displayedMonth: controlledDisplayedMonth,
25
+ interactionPolicy,
26
+ isDateDisabled,
27
+ locale,
28
+ maxDate,
29
+ minDate,
30
+ onDisplayedMonthChange,
31
+ onSelectedDateChange,
32
+ selectedDate,
33
+ testID,
34
+ weekStartsOn = 0,
35
+ }: CalendarProps) {
36
+ const [uncontrolledDisplayedMonth, setUncontrolledDisplayedMonth] = React.useState(() =>
37
+ startOfLocalMonth(defaultDisplayedMonth ?? selectedDate ?? minDate ?? new Date()),
38
+ );
39
+ const displayedMonth = startOfLocalMonth(controlledDisplayedMonth ?? uncontrolledDisplayedMonth);
40
+ const cellSize = density === 'compact' ? 42 : 48;
41
+ const gridWidth = cellSize * GRID_COLUMNS;
42
+ const gridHeight = cellSize * GRID_ROWS;
43
+ const cells = React.useMemo(
44
+ () => createCalendarMonth(displayedMonth, weekStartsOn),
45
+ [displayedMonth, weekStartsOn],
46
+ );
47
+ const gridItems = React.useMemo<readonly GridRectItem[]>(
48
+ () =>
49
+ cells.map((cell, index) => ({
50
+ height: cellSize,
51
+ id: cell.id,
52
+ width: cellSize,
53
+ x: (index % GRID_COLUMNS) * cellSize,
54
+ y: Math.floor(index / GRID_COLUMNS) * cellSize,
55
+ })),
56
+ [cellSize, cells],
57
+ );
58
+ const cellsById = React.useMemo(() => new Map(cells.map((cell) => [cell.id, cell])), [cells]);
59
+ const disabledDateIds = React.useMemo(
60
+ () => new Set(disabledDates.map(formatCalendarDate)),
61
+ [disabledDates],
62
+ );
63
+ const weekdays = React.useMemo(
64
+ () => createWeekdayLabels(locale, weekStartsOn),
65
+ [locale, weekStartsOn],
66
+ );
67
+ const setDisplayedMonth = React.useCallback(
68
+ (month: Date) => {
69
+ const nextMonth = startOfLocalMonth(month);
70
+ if (controlledDisplayedMonth === undefined) setUncontrolledDisplayedMonth(nextMonth);
71
+ onDisplayedMonthChange?.(nextMonth);
72
+ },
73
+ [controlledDisplayedMonth, onDisplayedMonthChange],
74
+ );
75
+ const previousMonth = addMonths(displayedMonth, -1);
76
+ const nextMonth = addMonths(displayedMonth, 1);
77
+
78
+ return (
79
+ <View accessibilityLabel="Calendar" gap={density === 'compact' ? 's' : 'm'} testID={testID}>
80
+ <View align="center" direction="row" justify="space-between">
81
+ <Button
82
+ disabled={!monthIntersectsRange(previousMonth, minDate, maxDate)}
83
+ interactionPolicy={interactionPolicy}
84
+ onPress={() => setDisplayedMonth(previousMonth)}
85
+ size="s"
86
+ variant="ghost"
87
+ >
88
+ Previous
89
+ </Button>
90
+ <Text accessibilityRole="header" align="center" variant="label" weight="semiBold">
91
+ {formatMonthLabel(displayedMonth, locale)}
92
+ </Text>
93
+ <Button
94
+ disabled={!monthIntersectsRange(nextMonth, minDate, maxDate)}
95
+ interactionPolicy={interactionPolicy}
96
+ onPress={() => setDisplayedMonth(nextMonth)}
97
+ size="s"
98
+ variant="ghost"
99
+ >
100
+ Next
101
+ </Button>
102
+ </View>
103
+ <View direction="row">
104
+ {weekdays.map((weekday) => (
105
+ <View key={weekday.id} width={cellSize}>
106
+ <Text align="center" emphasis="muted" variant="caption" weight="semiBold">
107
+ {weekday.label}
108
+ </Text>
109
+ </View>
110
+ ))}
111
+ </View>
112
+ <GridView
113
+ contentHeight={gridHeight}
114
+ contentWidth={gridWidth}
115
+ height={gridHeight}
116
+ interactionPolicy={interactionPolicy}
117
+ items={gridItems}
118
+ overscanPixels={0}
119
+ renderItem={(item) => {
120
+ const cell = cellsById.get(item.id);
121
+ if (!cell) return null;
122
+ const selected =
123
+ selectedDate !== null &&
124
+ selectedDate !== undefined &&
125
+ isSameLocalDay(selectedDate, cell.date);
126
+ const disabled = isCalendarDateDisabled({
127
+ date: cell.date,
128
+ disabledDateIds,
129
+ isDateDisabled,
130
+ maxDate,
131
+ minDate,
132
+ });
133
+ const selectCell = () => {
134
+ if (!cell.inDisplayedMonth) setDisplayedMonth(cell.date);
135
+ onSelectedDateChange?.(cell.date);
136
+ };
137
+ return (
138
+ <Button
139
+ accessibilityState={{ disabled, selected }}
140
+ color={selected ? 'primary' : 'neutral'}
141
+ disabled={disabled}
142
+ interactionPolicy={interactionPolicy}
143
+ onPress={selectCell}
144
+ size="s"
145
+ testID={testID ? `${testID}-day-${cell.id}` : undefined}
146
+ variant={selected ? 'solid' : cell.inDisplayedMonth ? 'ghost' : 'outline'}
147
+ >
148
+ {cell.date.getDate()}
149
+ </Button>
150
+ );
151
+ }}
152
+ testID={testID ? `${testID}-grid` : undefined}
153
+ viewportInteraction="locked"
154
+ width={gridWidth}
155
+ />
156
+ </View>
157
+ );
158
+ }
159
+
160
+ /*** Produces the ordered weekday labels for one local calendar week. */
161
+ function createWeekdayLabels(locale: string | undefined, weekStartsOn: number) {
162
+ const formatter = new Intl.DateTimeFormat(locale, { weekday: 'short' });
163
+ const sunday = new Date(2023, 0, 1);
164
+ return Array.from({ length: GRID_COLUMNS }, (_, index) => {
165
+ const day = new Date(
166
+ sunday.getFullYear(),
167
+ sunday.getMonth(),
168
+ sunday.getDate() + ((weekStartsOn + index) % GRID_COLUMNS),
169
+ );
170
+ return { id: String(index), label: formatter.format(day) };
171
+ });
172
+ }
173
+
174
+ /*** Moves a local month without carrying a day-of-month overflow into the target month. */
175
+ function addMonths(month: Date, count: number): Date {
176
+ return new Date(month.getFullYear(), month.getMonth() + count, 1);
177
+ }
178
+
179
+ /*** Normalizes a value to the first local day of its month. */
180
+ function startOfLocalMonth(value: Date): Date {
181
+ return new Date(value.getFullYear(), value.getMonth(), 1);
182
+ }
183
+
184
+ /*** Formats a Date as a timezone-independent local calendar identifier. */
185
+ function formatCalendarDate(value: Date): string {
186
+ const year = String(value.getFullYear()).padStart(4, '0');
187
+ const month = String(value.getMonth() + 1).padStart(2, '0');
188
+ const day = String(value.getDate()).padStart(2, '0');
189
+ return `${year}-${month}-${day}`;
190
+ }
191
+
192
+ /*** Compares local calendar dates using their canonical date-only identifiers. */
193
+ function compareLocalDates(left: Date, right: Date): number {
194
+ return formatCalendarDate(left).localeCompare(formatCalendarDate(right));
195
+ }
196
+
197
+ /*** Reports whether a candidate month contains at least one date inside the configured range. */
198
+ function monthIntersectsRange(
199
+ month: Date,
200
+ minDate: Date | undefined,
201
+ maxDate: Date | undefined,
202
+ ): boolean {
203
+ const first = startOfLocalMonth(month);
204
+ const last = new Date(first.getFullYear(), first.getMonth() + 1, 0);
205
+ return (
206
+ (!minDate || compareLocalDates(last, minDate) >= 0) &&
207
+ (!maxDate || compareLocalDates(first, maxDate) <= 0)
208
+ );
209
+ }
210
+
211
+ /*** Reports whether two values identify the same local calendar day. */
212
+ function isSameLocalDay(left: Date, right: Date): boolean {
213
+ return formatCalendarDate(left) === formatCalendarDate(right);
214
+ }
215
+
216
+ /*** Formats a display month with the caller's locale. */
217
+ function formatMonthLabel(value: Date, locale: string | undefined): string {
218
+ return new Intl.DateTimeFormat(locale, { month: 'long', year: 'numeric' }).format(value);
219
+ }
@@ -0,0 +1,23 @@
1
+ import { describe, expect, test } from 'bun:test';
2
+
3
+ import { createCalendarMonth } from './createCalendarMonth';
4
+
5
+ describe('createCalendarMonth', () => {
6
+ test('creates six complete weeks around a leap-year February with Sunday week start', () => {
7
+ const cells = createCalendarMonth(new Date(2024, 1, 1), 0);
8
+
9
+ expect(cells).toHaveLength(42);
10
+ expect(cells[0]?.id).toBe('2024-01-28');
11
+ expect(cells.find((cell) => cell.id === '2024-02-29')?.inDisplayedMonth).toBe(true);
12
+ expect(cells[41]?.id).toBe('2024-03-09');
13
+ });
14
+
15
+ test('rotates month boundaries for Monday week starts without changing local date IDs', () => {
16
+ const sunday = createCalendarMonth(new Date(2026, 2, 1), 0);
17
+ const monday = createCalendarMonth(new Date(2026, 2, 1), 1);
18
+
19
+ expect(sunday[0]?.id).toBe('2026-03-01');
20
+ expect(monday[0]?.id).toBe('2026-02-23');
21
+ expect(monday.find((cell) => cell.id === '2026-03-01')?.inDisplayedMonth).toBe(true);
22
+ });
23
+ });
@@ -0,0 +1,38 @@
1
+ import type { CalendarWeekStart } from '../../../types/calendar';
2
+
3
+ export type CalendarMonthCell = Readonly<{
4
+ date: Date;
5
+ id: string;
6
+ inDisplayedMonth: boolean;
7
+ }>;
8
+
9
+ /*** Creates the fixed six-week local-date month geometry shared by every Calendar density. */
10
+ export function createCalendarMonth(
11
+ month: Date,
12
+ weekStartsOn: CalendarWeekStart,
13
+ ): readonly CalendarMonthCell[] {
14
+ const firstDay = startOfLocalMonth(month);
15
+ const leadingDays = (firstDay.getDay() - weekStartsOn + 7) % 7;
16
+
17
+ return Array.from({ length: 42 }, (_, index) => {
18
+ const date = new Date(firstDay.getFullYear(), firstDay.getMonth(), index - leadingDays + 1);
19
+ return {
20
+ date,
21
+ id: formatLocalDate(date),
22
+ inDisplayedMonth: date.getMonth() === firstDay.getMonth(),
23
+ };
24
+ });
25
+ }
26
+
27
+ /*** Formats a Date as a timezone-independent local calendar identifier. */
28
+ function formatLocalDate(value: Date): string {
29
+ const year = String(value.getFullYear()).padStart(4, '0');
30
+ const month = String(value.getMonth() + 1).padStart(2, '0');
31
+ const day = String(value.getDate()).padStart(2, '0');
32
+ return `${year}-${month}-${day}`;
33
+ }
34
+
35
+ /*** Normalizes a value to the first local day of its month. */
36
+ function startOfLocalMonth(value: Date): Date {
37
+ return new Date(value.getFullYear(), value.getMonth(), 1);
38
+ }
@@ -0,0 +1,49 @@
1
+ import { describe, expect, test } from 'bun:test';
2
+
3
+ import { isCalendarDateDisabled } from './isCalendarDateDisabled';
4
+
5
+ describe('isCalendarDateDisabled', () => {
6
+ test('applies local-date min/max bounds regardless of time of day', () => {
7
+ expect(
8
+ isCalendarDateDisabled({
9
+ date: new Date(2026, 4, 9, 23),
10
+ disabledDateIds: new Set(),
11
+ isDateDisabled: undefined,
12
+ maxDate: new Date(2026, 4, 20),
13
+ minDate: new Date(2026, 4, 10, 18),
14
+ }),
15
+ ).toBe(true);
16
+ expect(
17
+ isCalendarDateDisabled({
18
+ date: new Date(2026, 4, 20, 1),
19
+ disabledDateIds: new Set(),
20
+ isDateDisabled: undefined,
21
+ maxDate: new Date(2026, 4, 20, 0),
22
+ minDate: new Date(2026, 4, 10),
23
+ }),
24
+ ).toBe(false);
25
+ });
26
+
27
+ test('combines explicit and predicate disabled dates', () => {
28
+ const disabledDateIds = new Set(['2026-05-12']);
29
+
30
+ expect(
31
+ isCalendarDateDisabled({
32
+ date: new Date(2026, 4, 12),
33
+ disabledDateIds,
34
+ isDateDisabled: undefined,
35
+ maxDate: undefined,
36
+ minDate: undefined,
37
+ }),
38
+ ).toBe(true);
39
+ expect(
40
+ isCalendarDateDisabled({
41
+ date: new Date(2026, 4, 13),
42
+ disabledDateIds,
43
+ isDateDisabled: (date) => date.getDay() === 3,
44
+ maxDate: undefined,
45
+ minDate: undefined,
46
+ }),
47
+ ).toBe(true);
48
+ });
49
+ });
@@ -0,0 +1,41 @@
1
+ import type { CalendarProps } from '../../../types/calendar';
2
+
3
+ /*** Resolves whether local-date range and disabled-date policy prevent selecting a calendar day. */
4
+ export function isCalendarDateDisabled({
5
+ date,
6
+ disabledDateIds,
7
+ isDateDisabled,
8
+ maxDate,
9
+ minDate,
10
+ }: {
11
+ date: Date;
12
+ disabledDateIds: ReadonlySet<string>;
13
+ isDateDisabled: CalendarProps['isDateDisabled'];
14
+ maxDate: Date | undefined;
15
+ minDate: Date | undefined;
16
+ }): boolean {
17
+ return (
18
+ (minDate !== undefined && compareLocalDates(date, minDate) < 0) ||
19
+ (maxDate !== undefined && compareLocalDates(date, maxDate) > 0) ||
20
+ disabledDateIds.has(formatCalendarDate(date)) ||
21
+ isDateDisabled?.(date) === true
22
+ );
23
+ }
24
+
25
+ /*** Compares values by local calendar date rather than their instant or time of day. */
26
+ function compareLocalDates(left: Date, right: Date): number {
27
+ return startOfLocalDay(left).getTime() - startOfLocalDay(right).getTime();
28
+ }
29
+
30
+ /*** Removes a time-of-day component while retaining the caller's local calendar date. */
31
+ function startOfLocalDay(value: Date): Date {
32
+ return new Date(value.getFullYear(), value.getMonth(), value.getDate());
33
+ }
34
+
35
+ /*** Formats a Date as a timezone-independent local calendar identifier. */
36
+ function formatCalendarDate(value: Date): string {
37
+ const year = String(value.getFullYear()).padStart(4, '0');
38
+ const month = String(value.getMonth() + 1).padStart(2, '0');
39
+ const day = String(value.getDate()).padStart(2, '0');
40
+ return `${year}-${month}-${day}`;
41
+ }
@@ -0,0 +1,11 @@
1
+ import type { ZoraComponentMeta } from '../../types/authoring';
2
+
3
+ export const calendarMeta = {
4
+ name: 'Calendar',
5
+ category: 'component',
6
+ description: 'Reusable local-date calendar with a month view backed by GridView geometry.',
7
+ directManifestNode: false,
8
+ note: 'Uses Date values and executable change callbacks; available through the public code API.',
9
+ allowedChildren: [],
10
+ props: {},
11
+ } as const satisfies ZoraComponentMeta;
@@ -0,0 +1,14 @@
1
+ import { expect, test } from 'bun:test';
2
+
3
+ import { calendarMeta } from './calendarMeta';
4
+
5
+ test('Calendar publishes one locked GridView month presentation for both densities', async () => {
6
+ const source = await Bun.file('src/features/calendar/adapters/inbound/Calendar.tsx').text();
7
+
8
+ expect(calendarMeta.directManifestNode).toBe(false);
9
+ expect(calendarMeta.description).toContain('GridView');
10
+ expect(source).toContain('<GridView');
11
+ expect(source).toContain('viewportInteraction="locked"');
12
+ expect(source).toContain("density === 'compact' ? 42 : 48");
13
+ expect(source).toContain('onSelectedDateChange?.(cell.date)');
14
+ });
@@ -1,3 +1,9 @@
1
+ export type {
2
+ CalendarDensity,
3
+ CalendarProps,
4
+ CalendarView,
5
+ CalendarWeekStart,
6
+ } from '../../types/calendar';
1
7
  export type {
2
8
  TemporalAllDayEvent,
3
9
  TemporalAllDayRange,
@@ -20,3 +26,4 @@ export type {
20
26
  TemporalTimeZone,
21
27
  TemporalTone,
22
28
  } from '../../types/temporal';
29
+ export { Calendar } from './adapters/inbound/Calendar';
@@ -0,0 +1,242 @@
1
+ import { afterAll, expect, mock, test } from 'bun:test';
2
+ import { Window } from 'happy-dom';
3
+ import React, { act } from 'react';
4
+ import { createRoot } from 'react-dom/client';
5
+
6
+ let mobilePresentation = false;
7
+
8
+ const browser = new Window();
9
+ const globals = ['window', 'document', 'Node', 'navigator', 'IS_REACT_ACT_ENVIRONMENT'] as const;
10
+ const previousGlobals = globals.map(
11
+ (key) => [key, Object.getOwnPropertyDescriptor(globalThis, key)] as const,
12
+ );
13
+ Object.assign(globalThis, {
14
+ IS_REACT_ACT_ENVIRONMENT: true,
15
+ Node: browser.Node,
16
+ document: browser.document,
17
+ navigator: browser.navigator,
18
+ window: browser,
19
+ });
20
+
21
+ const View = ({
22
+ children,
23
+ style,
24
+ testID,
25
+ }: {
26
+ children?: React.ReactNode;
27
+ style?: object;
28
+ testID?: string;
29
+ }) => (
30
+ <div data-testid={testID} style={style}>
31
+ {children}
32
+ </div>
33
+ );
34
+
35
+ await mock.module('react-native', () => ({ ScrollView: View }));
36
+ await mock.module('../../../button/public', () => ({
37
+ Button: ({ children, onPress }: { children?: React.ReactNode; onPress?: () => void }) => (
38
+ <button onClick={onPress}>{children}</button>
39
+ ),
40
+ IconButton: ({ onPress }: { onPress?: () => void }) => <button onClick={onPress} />,
41
+ }));
42
+ await mock.module('../../../card/public', () => ({
43
+ Card: ({
44
+ actions,
45
+ children,
46
+ title,
47
+ }: {
48
+ actions?: React.ReactNode;
49
+ children?: React.ReactNode;
50
+ title?: React.ReactNode;
51
+ }) => (
52
+ <div>
53
+ {title}
54
+ {actions}
55
+ {children}
56
+ </div>
57
+ ),
58
+ }));
59
+ await mock.module('../../../empty-state/public', () => ({ EmptyState: View }));
60
+ await mock.module('../../../form/checkbox/public', () => ({
61
+ Checkbox: ({
62
+ accessibilityLabel,
63
+ checked,
64
+ disabled,
65
+ onCheckedChange,
66
+ }: {
67
+ accessibilityLabel?: string;
68
+ checked?: boolean;
69
+ disabled?: boolean;
70
+ onCheckedChange?: (checked: boolean) => void;
71
+ }) => (
72
+ <button
73
+ aria-checked={checked}
74
+ aria-label={accessibilityLabel}
75
+ disabled={disabled}
76
+ onClick={() => onCheckedChange?.(!checked)}
77
+ role="checkbox"
78
+ />
79
+ ),
80
+ }));
81
+ await mock.module('../../../layout/public', () => ({ View }));
82
+ await mock.module('../../../popover-menu/public', () => ({ PopoverMenu: View }));
83
+ await mock.module('../../../skeleton/public', () => ({ SkeletonList: View }));
84
+ await mock.module('../../../theme/adapters/inbound/withZoraThemeScope', () => ({
85
+ withZoraThemeScope: <P,>(Component: React.ComponentType<P>) => Component,
86
+ }));
87
+ await mock.module('../../../typography/public', () => ({
88
+ Text: ({ children }: { children?: React.ReactNode }) => <span>{children}</span>,
89
+ }));
90
+ await mock.module('@ankhorage/surface', () => ({
91
+ Show: ({ children, fallback }: { children?: React.ReactNode; fallback?: React.ReactNode }) => (
92
+ <>{mobilePresentation ? fallback : children}</>
93
+ ),
94
+ }));
95
+
96
+ const { DataTable } = await import('./DataTable');
97
+
98
+ afterAll(() => {
99
+ browser.close();
100
+ for (const [key, descriptor] of previousGlobals) {
101
+ if (descriptor) Object.defineProperty(globalThis, key, descriptor);
102
+ else Reflect.deleteProperty(globalThis, key);
103
+ }
104
+ });
105
+
106
+ /*** Renders DataTable against a DOM-backed primitive boundary. */
107
+ function mount() {
108
+ const host = document.createElement('div');
109
+ document.body.append(host);
110
+ const root = createRoot(host);
111
+ return {
112
+ host,
113
+ render: (element: React.ReactNode) =>
114
+ act(() => Promise.resolve().then(() => root.render(element))),
115
+ unmount: () => act(() => Promise.resolve().then(() => root.unmount())),
116
+ };
117
+ }
118
+
119
+ test('uses stable row identities for controlled checkbox and all-visible selection', async () => {
120
+ const mounted = mount();
121
+ const changes: string[][] = [];
122
+ const onSelectedRowIdsChange = (selectedRowIds: readonly string[]) =>
123
+ changes.push([...selectedRowIds]);
124
+
125
+ try {
126
+ await mounted.render(
127
+ <DataTable
128
+ columns={[{ accessor: 'name', header: 'Company', id: 'company' }]}
129
+ onSelectedRowIdsChange={onSelectedRowIdsChange}
130
+ rowKey="id"
131
+ rows={[
132
+ { id: 'acme', name: 'Acme' },
133
+ { id: 'zora', name: 'ZORA' },
134
+ ]}
135
+ selectedRowIds={['acme']}
136
+ />,
137
+ );
138
+
139
+ const zora = mounted.host.querySelector<HTMLButtonElement>('[aria-label="Select row zora"]');
140
+ expect(zora?.getAttribute('role')).toBe('checkbox');
141
+ expect(zora?.getAttribute('aria-checked')).toBe('false');
142
+ zora?.click();
143
+ expect(changes).toEqual([['acme', 'zora']]);
144
+
145
+ const all = mounted.host.querySelector<HTMLButtonElement>(
146
+ '[aria-label="Select all visible rows"]',
147
+ );
148
+ all?.click();
149
+ expect(changes).toEqual([
150
+ ['acme', 'zora'],
151
+ ['acme', 'zora'],
152
+ ]);
153
+
154
+ await mounted.render(
155
+ <DataTable
156
+ columns={[{ accessor: 'name', header: 'Company', id: 'company' }]}
157
+ onSelectedRowIdsChange={onSelectedRowIdsChange}
158
+ rowKey="id"
159
+ rows={[
160
+ { id: 'zora', name: 'ZORA' },
161
+ { id: 'acme', name: 'Acme' },
162
+ ]}
163
+ selectedRowIds={['acme', 'zora']}
164
+ />,
165
+ );
166
+ expect(all?.getAttribute('aria-checked')).toBe('true');
167
+ expect(mounted.host.textContent).not.toContain('Actions');
168
+ expect(mounted.host.innerHTML).not.toContain('min-width: 720px');
169
+ expect(mounted.host.innerHTML).not.toContain('min-width: 140px');
170
+ } finally {
171
+ await mounted.unmount();
172
+ mounted.host.remove();
173
+ }
174
+ });
175
+
176
+ test('keeps controlled selection visibly disabled in passive mode', async () => {
177
+ const mounted = mount();
178
+ const changes: string[][] = [];
179
+
180
+ try {
181
+ await mounted.render(
182
+ <DataTable
183
+ columns={[{ accessor: 'name', header: 'Company', id: 'company' }]}
184
+ interactionPolicy="passive"
185
+ onSelectedRowIdsChange={(selectedRowIds) => changes.push([...selectedRowIds])}
186
+ rowKey="id"
187
+ rows={[{ id: 'acme', name: 'Acme' }]}
188
+ selectedRowIds={[]}
189
+ />,
190
+ );
191
+
192
+ const checkbox = mounted.host.querySelector<HTMLButtonElement>(
193
+ '[aria-label="Select row acme"]',
194
+ );
195
+ expect(checkbox?.disabled).toBe(true);
196
+ checkbox?.click();
197
+ expect(changes).toEqual([]);
198
+ } finally {
199
+ await mounted.unmount();
200
+ mounted.host.remove();
201
+ }
202
+ });
203
+
204
+ test('uses desktop stable row ids and the controlled callback in mobile cards', async () => {
205
+ mobilePresentation = true;
206
+ const mounted = mount();
207
+ const changes: string[][] = [];
208
+
209
+ try {
210
+ await mounted.render(
211
+ <DataTable
212
+ columns={[
213
+ { accessor: 'name', header: 'Company', id: 'company' },
214
+ { accessor: 'location', header: 'Location', id: 'location' },
215
+ ]}
216
+ onSelectedRowIdsChange={(selectedRowIds) => changes.push([...selectedRowIds])}
217
+ rowId={(row) => `company-${row.id}`}
218
+ rows={[
219
+ { id: 'acme', location: 'Zurich', name: 'Acme' },
220
+ { id: 'zora', location: 'Bern', name: 'ZORA' },
221
+ ]}
222
+ selectedRowIds={['company-acme']}
223
+ />,
224
+ );
225
+
226
+ const selected = mounted.host.querySelector<HTMLButtonElement>(
227
+ '[aria-label="Select row company-acme"]',
228
+ );
229
+ const unselected = mounted.host.querySelector<HTMLButtonElement>(
230
+ '[aria-label="Select row company-zora"]',
231
+ );
232
+ expect(selected?.getAttribute('aria-checked')).toBe('true');
233
+ expect(unselected?.getAttribute('aria-checked')).toBe('false');
234
+
235
+ unselected?.click();
236
+ expect(changes).toEqual([['company-acme', 'company-zora']]);
237
+ } finally {
238
+ mobilePresentation = false;
239
+ await mounted.unmount();
240
+ mounted.host.remove();
241
+ }
242
+ });