@ankhorage/zora 28.9.0 → 28.10.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 (44) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +1 -1
  3. package/dist/capabilities/index.js +52 -5
  4. package/dist/capabilities/index.js.map +4 -4
  5. package/dist/features/calendar/adapters/inbound/Calendar.d.ts +1 -1
  6. package/dist/features/calendar/adapters/inbound/Calendar.d.ts.map +1 -1
  7. package/dist/features/calendar/adapters/inbound/Calendar.js +207 -75
  8. package/dist/features/calendar/adapters/inbound/Calendar.js.map +1 -1
  9. package/dist/features/calendar/calendarMeta.d.ts +106 -4
  10. package/dist/features/calendar/calendarMeta.d.ts.map +1 -1
  11. package/dist/features/calendar/calendarMeta.js +44 -4
  12. package/dist/features/calendar/calendarMeta.js.map +1 -1
  13. package/dist/features/calendar/public.d.ts +1 -1
  14. package/dist/features/calendar/public.d.ts.map +1 -1
  15. package/dist/features/calendar/public.js.map +1 -1
  16. package/dist/features/data-table/dataTableMeta.d.ts +10 -0
  17. package/dist/features/data-table/dataTableMeta.d.ts.map +1 -1
  18. package/dist/features/data-table/dataTableMeta.js +7 -0
  19. package/dist/features/data-table/dataTableMeta.js.map +1 -1
  20. package/dist/types/calendar.d.ts +40 -19
  21. package/dist/types/calendar.d.ts.map +1 -1
  22. package/dist/types/calendar.js.map +1 -1
  23. package/package.json +79 -4
  24. package/src/features/calendar/adapters/inbound/Calendar.interaction.test.tsx +95 -0
  25. package/src/features/calendar/adapters/inbound/Calendar.tsx +425 -135
  26. package/src/features/calendar/calendarMeta.ts +44 -4
  27. package/src/features/calendar/public.test.ts +8 -5
  28. package/src/features/calendar/public.ts +4 -0
  29. package/src/features/data-table/adapters/inbound/DataTable.test.tsx +52 -1
  30. package/src/features/data-table/dataTableMeta.test.ts +8 -1
  31. package/src/features/data-table/dataTableMeta.ts +7 -0
  32. package/src/features/registry/componentMeta.test.ts +1 -0
  33. package/src/types/calendar.ts +44 -19
  34. package/web-dist/chunks/Accordion-59x6e7bs.js +200 -0
  35. package/web-dist/chunks/Accordion-q2yxtdzc.js +426 -0
  36. package/web-dist/components/calendar/Calendar.d.ts +2 -2
  37. package/web-dist/components/calendar/Calendar.dependency-2.d.ts +165 -0
  38. package/web-dist/components/calendar/Calendar.js +2 -1
  39. package/web-dist/components/calendar/Calendar.types-0.d.ts +45 -19
  40. package/web-dist/components/calendar/index.d.ts +1 -1
  41. package/web-dist/components/date-picker/DatePicker.js +2 -1
  42. package/web-dist/components/time-grid/TimeGrid.js +4 -198
  43. package/web-dist/manifest.json +6 -2
  44. package/web-dist/chunks/Accordion-v3bmbnfh.js +0 -237
@@ -1,10 +1,50 @@
1
1
  export const calendarMeta = {
2
2
  name: 'Calendar',
3
3
  category: 'component',
4
- description: 'Reusable local-date calendar with a month view backed by GridView geometry.',
5
- directManifestNode: false,
6
- note: 'Uses Date values and executable change callbacks; available through the public code API.',
4
+ description: 'Serializable Calendar with GridView month and TimeGrid day/week views.',
5
+ directManifestNode: true,
7
6
  allowedChildren: [],
8
- props: {},
7
+ blueprint: {
8
+ label: 'Calendar',
9
+ defaultProps: { displayedDate: '2026-12-04', events: [], view: 'month' },
10
+ },
11
+ events: {
12
+ dateChange: {
13
+ label: 'Date change',
14
+ eventType: 'calendar.dateChange',
15
+ payloadFields: [{ path: 'date', type: 'string', label: 'Date' }],
16
+ },
17
+ viewChange: {
18
+ label: 'View change',
19
+ eventType: 'calendar.viewChange',
20
+ payloadFields: [{ path: 'view', type: 'string', label: 'View' }],
21
+ },
22
+ eventActivate: {
23
+ label: 'Activate event',
24
+ eventType: 'calendar.eventActivate',
25
+ payloadFields: [{ path: 'eventId', type: 'string', label: 'Event ID' }],
26
+ },
27
+ },
28
+ bindings: {
29
+ props: {
30
+ displayedDate: { value: { type: 'string' }, acceptsFallback: true, acceptsTransforms: true },
31
+ events: {
32
+ value: { type: 'array', itemType: 'object' },
33
+ acceptsFallback: true,
34
+ acceptsTransforms: true,
35
+ },
36
+ view: { value: { type: 'string' }, acceptsFallback: true },
37
+ },
38
+ },
39
+ props: {
40
+ displayedDate: { type: 'string', category: 'State', label: 'Displayed date' },
41
+ defaultDisplayedDate: { type: 'string', category: 'State', label: 'Initial displayed date' },
42
+ view: { type: 'enum', category: 'State', enum: ['day', 'week', 'month'] },
43
+ timeZone: { type: 'string', category: 'State', label: 'Timezone' },
44
+ events: { type: 'array', category: 'Data', label: 'Events' },
45
+ locale: { type: 'string', category: 'Content', label: 'Locale' },
46
+ weekStartsOn: { type: 'number', category: 'Layout', label: 'Week starts on' },
47
+ density: { type: 'enum', category: 'Layout', enum: ['regular', 'compact'] },
48
+ },
9
49
  };
10
50
  //# sourceMappingURL=calendarMeta.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"calendarMeta.js","sourceRoot":"","sources":["../../../src/features/calendar/calendarMeta.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,UAAU;IAChB,QAAQ,EAAE,WAAW;IACrB,WAAW,EAAE,6EAA6E;IAC1F,kBAAkB,EAAE,KAAK;IACzB,IAAI,EAAE,0FAA0F;IAChG,eAAe,EAAE,EAAE;IACnB,KAAK,EAAE,EAAE;CAC2B,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../types/authoring';\n\nexport const calendarMeta = {\n name: 'Calendar',\n category: 'component',\n description: 'Reusable local-date calendar with a month view backed by GridView geometry.',\n directManifestNode: false,\n note: 'Uses Date values and executable change callbacks; available through the public code API.',\n allowedChildren: [],\n props: {},\n} as const satisfies ZoraComponentMeta;\n"]}
1
+ {"version":3,"file":"calendarMeta.js","sourceRoot":"","sources":["../../../src/features/calendar/calendarMeta.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,UAAU;IAChB,QAAQ,EAAE,WAAW;IACrB,WAAW,EAAE,wEAAwE;IACrF,kBAAkB,EAAE,I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,EAAE,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE;QAC7E,oBAAoB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,wBAAwB,EAAE;QAC5F,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QACzE,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE;QAClE,MAAM,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE;QAC5D,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE;QAChE,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,gBAAgB,EAAE;QAC7E,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC,EAAE;KAC5E;CACmC,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../types/authoring';\n\nexport const calendarMeta = {\n name: 'Calendar',\n category: 'component',\n description: 'Serializable Calendar with GridView month and TimeGrid day/week views.',\n directManifestNode: true,\n allowedChildren: [],\n blueprint: {\n label: 'Calendar',\n defaultProps: { displayedDate: '2026-12-04', events: [], view: 'month' },\n },\n events: {\n dateChange: {\n label: 'Date change',\n eventType: 'calendar.dateChange',\n payloadFields: [{ path: 'date', type: 'string', label: 'Date' }],\n },\n viewChange: {\n label: 'View change',\n eventType: 'calendar.viewChange',\n payloadFields: [{ path: 'view', type: 'string', label: 'View' }],\n },\n eventActivate: {\n label: 'Activate event',\n eventType: 'calendar.eventActivate',\n payloadFields: [{ path: 'eventId', type: 'string', label: 'Event ID' }],\n },\n },\n bindings: {\n props: {\n displayedDate: { value: { type: 'string' }, acceptsFallback: true, acceptsTransforms: true },\n events: {\n value: { type: 'array', itemType: 'object' },\n acceptsFallback: true,\n acceptsTransforms: true,\n },\n view: { value: { type: 'string' }, acceptsFallback: true },\n },\n },\n props: {\n displayedDate: { type: 'string', category: 'State', label: 'Displayed date' },\n defaultDisplayedDate: { type: 'string', category: 'State', label: 'Initial displayed date' },\n view: { type: 'enum', category: 'State', enum: ['day', 'week', 'month'] },\n timeZone: { type: 'string', category: 'State', label: 'Timezone' },\n events: { type: 'array', category: 'Data', label: 'Events' },\n locale: { type: 'string', category: 'Content', label: 'Locale' },\n weekStartsOn: { type: 'number', category: 'Layout', label: 'Week starts on' },\n density: { type: 'enum', category: 'Layout', enum: ['regular', 'compact'] },\n },\n} as const satisfies ZoraComponentMeta;\n"]}
@@ -1,4 +1,4 @@
1
- export type { CalendarDensity, CalendarProps, CalendarView, CalendarWeekStart, } from '../../types/calendar';
1
+ export type { CalendarDateChangeEvent, CalendarDensity, CalendarEventActivateEvent, CalendarManifestProps, CalendarProps, CalendarView, CalendarViewChangeEvent, CalendarWeekStart, } from '../../types/calendar';
2
2
  export type { TemporalAllDayEvent, TemporalAllDayRange, TemporalAvailability, TemporalDataValue, TemporalDate, TemporalDuration, TemporalEvent, TemporalEventStatus, TemporalInstant, TemporalInteroperabilityData, TemporalParticipant, TemporalRange, TemporalRecurrence, TemporalRecurrenceException, TemporalRecurrenceRule, TemporalReminder, TemporalTimedEvent, TemporalTimedRange, TemporalTimeZone, TemporalTone, } from '../../types/temporal';
3
3
  export { Calendar } from './adapters/inbound/Calendar';
4
4
  //# sourceMappingURL=public.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/features/calendar/public.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,aAAa,EACb,YAAY,EACZ,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,mBAAmB,EACnB,eAAe,EACf,4BAA4B,EAC5B,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,2BAA2B,EAC3B,sBAAsB,EACtB,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,GACb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC"}
1
+ {"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/features/calendar/public.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,uBAAuB,EACvB,eAAe,EACf,0BAA0B,EAC1B,qBAAqB,EACrB,aAAa,EACb,YAAY,EACZ,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,mBAAmB,EACnB,eAAe,EACf,4BAA4B,EAC5B,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,2BAA2B,EAC3B,sBAAsB,EACtB,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,GACb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/features/calendar/public.ts"],"names":[],"mappings":"AA4BA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC","sourcesContent":["export type {\n CalendarDensity,\n CalendarProps,\n CalendarView,\n CalendarWeekStart,\n} from '../../types/calendar';\nexport type {\n TemporalAllDayEvent,\n TemporalAllDayRange,\n TemporalAvailability,\n TemporalDataValue,\n TemporalDate,\n TemporalDuration,\n TemporalEvent,\n TemporalEventStatus,\n TemporalInstant,\n TemporalInteroperabilityData,\n TemporalParticipant,\n TemporalRange,\n TemporalRecurrence,\n TemporalRecurrenceException,\n TemporalRecurrenceRule,\n TemporalReminder,\n TemporalTimedEvent,\n TemporalTimedRange,\n TemporalTimeZone,\n TemporalTone,\n} from '../../types/temporal';\nexport { Calendar } from './adapters/inbound/Calendar';\n"]}
1
+ {"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/features/calendar/public.ts"],"names":[],"mappings":"AAgCA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC","sourcesContent":["export type {\n CalendarDateChangeEvent,\n CalendarDensity,\n CalendarEventActivateEvent,\n CalendarManifestProps,\n CalendarProps,\n CalendarView,\n CalendarViewChangeEvent,\n CalendarWeekStart,\n} from '../../types/calendar';\nexport type {\n TemporalAllDayEvent,\n TemporalAllDayRange,\n TemporalAvailability,\n TemporalDataValue,\n TemporalDate,\n TemporalDuration,\n TemporalEvent,\n TemporalEventStatus,\n TemporalInstant,\n TemporalInteroperabilityData,\n TemporalParticipant,\n TemporalRange,\n TemporalRecurrence,\n TemporalRecurrenceException,\n TemporalRecurrenceRule,\n TemporalReminder,\n TemporalTimedEvent,\n TemporalTimedRange,\n TemporalTimeZone,\n TemporalTone,\n} from '../../types/temporal';\nexport { Calendar } from './adapters/inbound/Calendar';\n"]}
@@ -44,6 +44,16 @@ export declare const dataTableMeta: {
44
44
  };
45
45
  readonly bindings: {
46
46
  readonly props: {
47
+ readonly rows: {
48
+ readonly label: "Rows";
49
+ readonly description: "Reactive serializable rows rendered by the data table.";
50
+ readonly value: {
51
+ readonly type: "array";
52
+ readonly itemType: "object";
53
+ };
54
+ readonly acceptsFallback: true;
55
+ readonly acceptsTransforms: true;
56
+ };
47
57
  readonly sort: {
48
58
  readonly value: {
49
59
  readonly type: "object";
@@ -1 +1 @@
1
- {"version":3,"file":"dataTableMeta.d.ts","sourceRoot":"","sources":["../../../src/features/data-table/dataTableMeta.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiGY,CAAC"}
1
+ {"version":3,"file":"dataTableMeta.d.ts","sourceRoot":"","sources":["../../../src/features/data-table/dataTableMeta.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwGY,CAAC"}
@@ -26,6 +26,13 @@ export const dataTableMeta = {
26
26
  },
27
27
  bindings: {
28
28
  props: {
29
+ rows: {
30
+ label: 'Rows',
31
+ description: 'Reactive serializable rows rendered by the data table.',
32
+ value: { type: 'array', itemType: 'object' },
33
+ acceptsFallback: true,
34
+ acceptsTransforms: true,
35
+ },
29
36
  sort: {
30
37
  value: {
31
38
  type: 'object',
@@ -1 +1 @@
1
- {"version":3,"file":"dataTableMeta.js","sourceRoot":"","sources":["../../../src/features/data-table/dataTableMeta.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,WAAW;IACjB,QAAQ,EAAE,WAAW;IACrB,kBAAkB,EAAE,IAAI;IACxB,eAAe,EAAE,EAAE;IACnB,SAAS,EAAE,EAAE,KAAK,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EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE;gBAChE,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE;gBACnE,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE;gBACtE;oBACE,GAAG,EAAE,MAAM;oBACX,MAAM,EAAE;wBACN,IAAI,EAAE,QAAQ;wBACd,QAAQ,EAAE,SAAS;wBACnB,KAAK,EAAE,4BAA4B;qBACpC;iBACF;aACF;SACF;QACD,cAAc,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,kBAAkB,EAAE;QACnF,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE;QAC/C,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE;QAClD,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE;QACnD,gBAAgB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE;QACzD,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,aAAa,EAAE,SAAS,CAAC,EAAE;KAChF;CACmC,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../types/authoring';\n\nexport const dataTableMeta = {\n name: 'DataTable',\n category: 'component',\n directManifestNode: true,\n allowedChildren: [],\n blueprint: { label: 'Data table', defaultProps: { rows: [], columns: [], rowKey: 'id' } },\n events: {\n sortChange: {\n label: 'Sort change',\n eventType: 'dataTable.sortChange',\n payloadFields: [\n { path: 'columnId', type: 'string' },\n { path: 'direction', type: 'string' },\n ],\n },\n selectionChange: {\n label: 'Selection change',\n eventType: 'dataTable.selectionChange',\n payloadFields: [{ path: 'selectedRowIds', type: 'unknown', label: 'Selected row IDs' }],\n },\n rowActivate: {\n label: 'Activate row',\n eventType: 'dataTable.rowActivate',\n payloadFields: [{ path: 'rowId', type: 'string', label: 'Row ID' }],\n },\n },\n bindings: {\n props: {\n sort: {\n value: {\n type: 'object',\n fields: [\n { path: 'columnId', type: 'string' },\n { path: 'direction', type: 'string' },\n ],\n },\n acceptsFallback: true,\n },\n selectedRowIds: {\n label: 'Selected row IDs',\n description: 'Controlled stable row identities selected with the checkbox column.',\n value: { type: 'array' },\n acceptsFallback: true,\n acceptsTransforms: true,\n },\n },\n events: {\n selectionChange: {\n label: 'Selection change',\n payload: {\n eventType: 'dataTable.selectionChange',\n fields: [{ path: 'selectedRowIds', type: 'unknown', label: 'Selected row IDs' }],\n },\n },\n rowActivate: {\n label: 'Activate row',\n payload: {\n eventType: 'dataTable.rowActivate',\n fields: [{ path: 'rowId', type: 'string', label: 'Row ID' }],\n },\n },\n },\n },\n props: {\n rows: { type: 'array', category: 'Data' },\n rowKey: { type: 'string', category: 'Identity', label: 'Row identity field' },\n columns: {\n type: 'array',\n category: 'Data',\n itemSchema: [\n { key: 'id', schema: { type: 'string', category: 'Identity' } },\n { key: 'header', schema: { type: 'string', category: 'Content' } },\n { key: 'accessor', schema: { type: 'string', category: 'Data' } },\n {\n key: 'align',\n schema: { type: 'enum', category: 'Layout', enum: ['start', 'center', 'end'] },\n },\n { key: 'width', schema: { type: 'number', category: 'Layout' } },\n { key: 'minWidth', schema: { type: 'number', category: 'Layout' } },\n { key: 'sortable', schema: { type: 'boolean', category: 'Behavior' } },\n {\n key: 'cell',\n schema: {\n type: 'object',\n category: 'Content',\n label: 'Portable cell presentation',\n },\n },\n ],\n },\n selectedRowIds: { type: 'array', category: 'Selection', label: 'Selected row IDs' },\n loading: { type: 'boolean', category: 'State' },\n loadingRows: { type: 'number', category: 'State' },\n emptyTitle: { type: 'string', category: 'Content' },\n emptyDescription: { type: 'string', category: 'Content' },\n density: { type: 'enum', category: 'Layout', enum: ['comfortable', 'compact'] },\n },\n} as const satisfies ZoraComponentMeta;\n"]}
1
+ {"version":3,"file":"dataTableMeta.js","sourceRoot":"","sources":["../../../src/features/data-table/dataTableMeta.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,WAAW;IACjB,QAAQ,EAAE,WAAW;IACrB,kBAAkB,EAAE,IAAI;IACxB,eAAe,EAAE,EAAE;IACnB,SAAS,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE;IACzF,MAAM,EAAE;QACN,UAAU,EAAE;YACV,KAAK,EAAE,aAAa;YACpB,SAAS,EAAE,sBAAsB;YACjC,aAAa,EAAE;gBACb,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACpC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE;aACtC;SACF;QACD,eAAe,EAAE;YACf,KAAK,EAAE,kBAAkB;YACzB,SAAS,EAAE,2BAA2B;YACtC,aAAa,EAAE,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,kBAAkB,EAAE,CAAC;SACxF;QACD,WAAW,EAAE;YACX,KAAK,EAAE,cAAc;YACrB,SAAS,EAAE,uBAAuB;YAClC,aAAa,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;SACpE;KACF;IACD,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,IAAI,EAAE;gBACJ,KAAK,EAAE,MAAM;gBACb,WAAW,EAAE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OAAO,EAAE;QAC/C,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE;QAClD,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE;QACnD,gBAAgB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE;QACzD,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,aAAa,EAAE,SAAS,CAAC,EAAE;KAChF;CACmC,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../types/authoring';\n\nexport const dataTableMeta = {\n name: 'DataTable',\n category: 'component',\n directManifestNode: true,\n allowedChildren: [],\n blueprint: { label: 'Data table', defaultProps: { rows: [], columns: [], rowKey: 'id' } },\n events: {\n sortChange: {\n label: 'Sort change',\n eventType: 'dataTable.sortChange',\n payloadFields: [\n { path: 'columnId', type: 'string' },\n { path: 'direction', type: 'string' },\n ],\n },\n selectionChange: {\n label: 'Selection change',\n eventType: 'dataTable.selectionChange',\n payloadFields: [{ path: 'selectedRowIds', type: 'unknown', label: 'Selected row IDs' }],\n },\n rowActivate: {\n label: 'Activate row',\n eventType: 'dataTable.rowActivate',\n payloadFields: [{ path: 'rowId', type: 'string', label: 'Row ID' }],\n },\n },\n bindings: {\n props: {\n rows: {\n label: 'Rows',\n description: 'Reactive serializable rows rendered by the data table.',\n value: { type: 'array', itemType: 'object' },\n acceptsFallback: true,\n acceptsTransforms: true,\n },\n sort: {\n value: {\n type: 'object',\n fields: [\n { path: 'columnId', type: 'string' },\n { path: 'direction', type: 'string' },\n ],\n },\n acceptsFallback: true,\n },\n selectedRowIds: {\n label: 'Selected row IDs',\n description: 'Controlled stable row identities selected with the checkbox column.',\n value: { type: 'array' },\n acceptsFallback: true,\n acceptsTransforms: true,\n },\n },\n events: {\n selectionChange: {\n label: 'Selection change',\n payload: {\n eventType: 'dataTable.selectionChange',\n fields: [{ path: 'selectedRowIds', type: 'unknown', label: 'Selected row IDs' }],\n },\n },\n rowActivate: {\n label: 'Activate row',\n payload: {\n eventType: 'dataTable.rowActivate',\n fields: [{ path: 'rowId', type: 'string', label: 'Row ID' }],\n },\n },\n },\n },\n props: {\n rows: { type: 'array', category: 'Data' },\n rowKey: { type: 'string', category: 'Identity', label: 'Row identity field' },\n columns: {\n type: 'array',\n category: 'Data',\n itemSchema: [\n { key: 'id', schema: { type: 'string', category: 'Identity' } },\n { key: 'header', schema: { type: 'string', category: 'Content' } },\n { key: 'accessor', schema: { type: 'string', category: 'Data' } },\n {\n key: 'align',\n schema: { type: 'enum', category: 'Layout', enum: ['start', 'center', 'end'] },\n },\n { key: 'width', schema: { type: 'number', category: 'Layout' } },\n { key: 'minWidth', schema: { type: 'number', category: 'Layout' } },\n { key: 'sortable', schema: { type: 'boolean', category: 'Behavior' } },\n {\n key: 'cell',\n schema: {\n type: 'object',\n category: 'Content',\n label: 'Portable cell presentation',\n },\n },\n ],\n },\n selectedRowIds: { type: 'array', category: 'Selection', label: 'Selected row IDs' },\n loading: { type: 'boolean', category: 'State' },\n loadingRows: { type: 'number', category: 'State' },\n emptyTitle: { type: 'string', category: 'Content' },\n emptyDescription: { type: 'string', category: 'Content' },\n density: { type: 'enum', category: 'Layout', enum: ['comfortable', 'compact'] },\n },\n} as const satisfies ZoraComponentMeta;\n"]}
@@ -1,24 +1,45 @@
1
1
  import type { ZoraBaseProps } from './base';
2
+ import type { TemporalDate, TemporalEvent, TemporalTimeZone } from './temporal';
2
3
  export type CalendarDensity = 'regular' | 'compact';
3
- export type CalendarView = 'month';
4
+ export type CalendarView = 'day' | 'month' | 'week';
4
5
  export type CalendarWeekStart = 0 | 1 | 2 | 3 | 4 | 5 | 6;
5
- /** Public Calendar state uses local calendar dates, never UTC instants. */
6
- export interface CalendarProps extends ZoraBaseProps {
7
- /** The only currently implemented Calendar presentation. */
8
- view?: CalendarView;
9
- density?: CalendarDensity;
10
- /** A local date within the controlled month to display. */
11
- displayedMonth?: Date;
12
- /** Initial local month when displayedMonth is not controlled. */
13
- defaultDisplayedMonth?: Date;
14
- onDisplayedMonthChange?: (month: Date) => void;
15
- selectedDate?: Date | null;
16
- onSelectedDateChange?: (date: Date) => void;
17
- locale?: string;
18
- weekStartsOn?: CalendarWeekStart;
19
- minDate?: Date;
20
- maxDate?: Date;
21
- disabledDates?: readonly Date[];
22
- isDateDisabled?: (date: Date) => boolean;
6
+ /** Serializable payload for a controlled Calendar date. */
7
+ export interface CalendarDateChangeEvent {
8
+ readonly date: TemporalDate;
9
+ }
10
+ /** Serializable payload for a controlled Calendar view. */
11
+ export interface CalendarViewChangeEvent {
12
+ readonly view: CalendarView;
13
+ }
14
+ /** Serializable payload emitted when an event is activated. */
15
+ export interface CalendarEventActivateEvent {
16
+ readonly eventId: string;
17
+ }
18
+ /** Serializable props accepted by a direct Calendar manifest node. */
19
+ export interface CalendarManifestProps {
20
+ readonly view?: CalendarView;
21
+ readonly displayedDate?: TemporalDate;
22
+ readonly defaultDisplayedDate?: TemporalDate;
23
+ readonly events?: readonly TemporalEvent[];
24
+ readonly timeZone?: TemporalTimeZone;
25
+ readonly locale?: string;
26
+ readonly weekStartsOn?: CalendarWeekStart;
27
+ readonly density?: CalendarDensity;
28
+ }
29
+ /** Code API retaining DatePicker's local-Date compatibility alongside manifest data. */
30
+ export interface CalendarProps extends ZoraBaseProps, CalendarManifestProps {
31
+ readonly displayedMonth?: Date;
32
+ readonly defaultDisplayedMonth?: Date;
33
+ readonly onDisplayedMonthChange?: (month: Date) => void;
34
+ readonly selectedDate?: Date | null;
35
+ readonly onSelectedDateChange?: (date: Date) => void;
36
+ readonly onDateChange?: (event: CalendarDateChangeEvent) => void;
37
+ readonly defaultView?: CalendarView;
38
+ readonly onViewChange?: (event: CalendarViewChangeEvent) => void;
39
+ readonly onEventActivate?: (event: CalendarEventActivateEvent) => void;
40
+ readonly minDate?: Date;
41
+ readonly maxDate?: Date;
42
+ readonly disabledDates?: readonly Date[];
43
+ readonly isDateDisabled?: (date: Date) => boolean;
23
44
  }
24
45
  //# sourceMappingURL=calendar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../src/types/calendar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5C,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,SAAS,CAAC;AACpD,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC;AACnC,MAAM,MAAM,iBAAiB,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAE1D,2EAA2E;AAC3E,MAAM,WAAW,aAAc,SAAQ,aAAa;IAClD,4DAA4D;IAC5D,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,2DAA2D;IAC3D,cAAc,CAAC,EAAE,IAAI,CAAC;IACtB,iEAAiE;IACjE,qBAAqB,CAAC,EAAE,IAAI,CAAC;IAC7B,sBAAsB,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,KAAK,IAAI,CAAC;IAC/C,YAAY,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAC3B,oBAAoB,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,iBAAiB,CAAC;IACjC,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,aAAa,CAAC,EAAE,SAAS,IAAI,EAAE,CAAC;IAChC,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC;CAC1C"}
1
+ {"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../src/types/calendar.ts"],"names":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AI,CAAC;IAC/B,QAAQ,CAAC,qBAAqB,CAAC,EAAE,IAAI,CAAC;IACtC,QAAQ,CAAC,sBAAsB,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,KAAK,IAAI,CAAC;IACxD,QAAQ,CAAC,YAAY,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,oBAAoB,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACrD,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,IAAI,CAAC;IACjE,QAAQ,CAAC,WAAW,CAAC,EAAE,YAAY,CAAC;IACpC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,IAAI,CAAC;IACjE,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,0BAA0B,KAAK,IAAI,CAAC;IACvE,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC;IACxB,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,IAAI,EAAE,CAAC;IACzC,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC;CACnD"}
@@ -1 +1 @@
1
- {"version":3,"file":"calendar.js","sourceRoot":"","sources":["../../src/types/calendar.ts"],"names":[],"mappings":"","sourcesContent":["import type { ZoraBaseProps } from './base';\n\nexport type CalendarDensity = 'regular' | 'compact';\nexport type CalendarView = 'month';\nexport type CalendarWeekStart = 0 | 1 | 2 | 3 | 4 | 5 | 6;\n\n/** Public Calendar state uses local calendar dates, never UTC instants. */\nexport interface CalendarProps extends ZoraBaseProps {\n /** The only currently implemented Calendar presentation. */\n view?: CalendarView;\n density?: CalendarDensity;\n /** A local date within the controlled month to display. */\n displayedMonth?: Date;\n /** Initial local month when displayedMonth is not controlled. */\n defaultDisplayedMonth?: Date;\n onDisplayedMonthChange?: (month: Date) => void;\n selectedDate?: Date | null;\n onSelectedDateChange?: (date: Date) => void;\n locale?: string;\n weekStartsOn?: CalendarWeekStart;\n minDate?: Date;\n maxDate?: Date;\n disabledDates?: readonly Date[];\n isDateDisabled?: (date: Date) => boolean;\n}\n"]}
1
+ {"version":3,"file":"calendar.js","sourceRoot":"","sources":["../../src/types/calendar.ts"],"names":[],"mappings":"","sourcesContent":["import type { ZoraBaseProps } from './base';\nimport type { TemporalDate, TemporalEvent, TemporalTimeZone } from './temporal';\n\nexport type CalendarDensity = 'regular' | 'compact';\nexport type CalendarView = 'day' | 'month' | 'week';\nexport type CalendarWeekStart = 0 | 1 | 2 | 3 | 4 | 5 | 6;\n\n/** Serializable payload for a controlled Calendar date. */\nexport interface CalendarDateChangeEvent {\n readonly date: TemporalDate;\n}\n\n/** Serializable payload for a controlled Calendar view. */\nexport interface CalendarViewChangeEvent {\n readonly view: CalendarView;\n}\n\n/** Serializable payload emitted when an event is activated. */\nexport interface CalendarEventActivateEvent {\n readonly eventId: string;\n}\n\n/** Serializable props accepted by a direct Calendar manifest node. */\nexport interface CalendarManifestProps {\n readonly view?: CalendarView;\n readonly displayedDate?: TemporalDate;\n readonly defaultDisplayedDate?: TemporalDate;\n readonly events?: readonly TemporalEvent[];\n readonly timeZone?: TemporalTimeZone;\n readonly locale?: string;\n readonly weekStartsOn?: CalendarWeekStart;\n readonly density?: CalendarDensity;\n}\n\n/** Code API retaining DatePicker's local-Date compatibility alongside manifest data. */\nexport interface CalendarProps extends ZoraBaseProps, CalendarManifestProps {\n readonly displayedMonth?: Date;\n readonly defaultDisplayedMonth?: Date;\n readonly onDisplayedMonthChange?: (month: Date) => void;\n readonly selectedDate?: Date | null;\n readonly onSelectedDateChange?: (date: Date) => void;\n readonly onDateChange?: (event: CalendarDateChangeEvent) => void;\n readonly defaultView?: CalendarView;\n readonly onViewChange?: (event: CalendarViewChangeEvent) => void;\n readonly onEventActivate?: (event: CalendarEventActivateEvent) => void;\n readonly minDate?: Date;\n readonly maxDate?: Date;\n readonly disabledDates?: readonly Date[];\n readonly isDateDisabled?: (date: Date) => boolean;\n}\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ankhorage/zora",
3
3
  "type": "module",
4
- "version": "28.9.0",
4
+ "version": "28.10.1",
5
5
  "description": "Opinionated React Native and React Native Web UI kit built on @ankhorage/surface.",
6
6
  "homepage": "https://github.com/ankhorage/zora#readme",
7
7
  "bugs": {
@@ -44,13 +44,13 @@
44
44
  "dependencies": {
45
45
  "@ankhorage/capability": "^0.2.3",
46
46
  "@ankhorage/color-theory": "^0.3.4",
47
- "@ankhorage/contracts": "^28.0.0",
47
+ "@ankhorage/contracts": "^28.1.0",
48
48
  "@ankhorage/game": "^0.1.4",
49
49
  "@ankhorage/graph": "^0.5.0",
50
50
  "@ankhorage/grid-view": "^0.5.0",
51
51
  "@ankhorage/reader": "^0.1.4",
52
- "@ankhorage/runtime": "^5.8.3",
53
- "@ankhorage/surface": "^9.8.11",
52
+ "@ankhorage/runtime": "^5.8.4",
53
+ "@ankhorage/surface": "^9.8.12",
54
54
  "@ankhorage/utility": "^1.11.0",
55
55
  "expo-asset": "~57.0.21",
56
56
  "expo-audio": "~57.0.5",
@@ -424,6 +424,81 @@
424
424
  }
425
425
  }
426
426
  },
427
+ {
428
+ "id": "calendar.dateChange",
429
+ "owner": "@ankhorage/zora",
430
+ "access": [
431
+ "emit"
432
+ ],
433
+ "binding": {
434
+ "kind": "event",
435
+ "bindableAs": [
436
+ "source"
437
+ ]
438
+ },
439
+ "label": "Date change",
440
+ "output": {
441
+ "schema": {
442
+ "type": "object",
443
+ "properties": {
444
+ "date": {
445
+ "type": "string",
446
+ "title": "Date"
447
+ }
448
+ }
449
+ }
450
+ }
451
+ },
452
+ {
453
+ "id": "calendar.eventActivate",
454
+ "owner": "@ankhorage/zora",
455
+ "access": [
456
+ "emit"
457
+ ],
458
+ "binding": {
459
+ "kind": "event",
460
+ "bindableAs": [
461
+ "source"
462
+ ]
463
+ },
464
+ "label": "Activate event",
465
+ "output": {
466
+ "schema": {
467
+ "type": "object",
468
+ "properties": {
469
+ "eventId": {
470
+ "type": "string",
471
+ "title": "Event ID"
472
+ }
473
+ }
474
+ }
475
+ }
476
+ },
477
+ {
478
+ "id": "calendar.viewChange",
479
+ "owner": "@ankhorage/zora",
480
+ "access": [
481
+ "emit"
482
+ ],
483
+ "binding": {
484
+ "kind": "event",
485
+ "bindableAs": [
486
+ "source"
487
+ ]
488
+ },
489
+ "label": "View change",
490
+ "output": {
491
+ "schema": {
492
+ "type": "object",
493
+ "properties": {
494
+ "view": {
495
+ "type": "string",
496
+ "title": "View"
497
+ }
498
+ }
499
+ }
500
+ }
501
+ },
427
502
  {
428
503
  "id": "card.press",
429
504
  "owner": "@ankhorage/zora",
@@ -1,6 +1,12 @@
1
1
  import { join } from 'node:path';
2
2
  import { pathToFileURL } from 'node:url';
3
3
 
4
+ import type { ComponentDataBindingRegistry, UiNode } from '@ankhorage/contracts';
5
+ import {
6
+ composeRuntimeCapabilityExecutor,
7
+ createRuntimeMemoryStateAdapter,
8
+ RuntimeRenderer,
9
+ } from '@ankhorage/runtime';
4
10
  import { expect, test } from 'bun:test';
5
11
  import { Window } from 'happy-dom';
6
12
  import React, { act } from 'react';
@@ -75,6 +81,95 @@ test('selects adjacent days through the locked GridView in regular and compact c
75
81
  });
76
82
  });
77
83
 
84
+ test('renders a Calendar manifest and reactively updates its controlled date and events', async () => {
85
+ const [{ Calendar }, { ZoraProvider }] = (await Promise.all([
86
+ import(pathToFileURL(join(webDistRoot, 'components', 'calendar', 'index.js')).href),
87
+ import(pathToFileURL(join(webDistRoot, 'runtime/ZoraProvider.js')).href),
88
+ ])) as [{ Calendar: typeof CalendarComponent }, { ZoraProvider: typeof ZoraProviderComponent }];
89
+ const node = {
90
+ id: 'calendar',
91
+ type: 'Calendar',
92
+ props: { testID: 'manifest-calendar', view: 'month' },
93
+ } as const satisfies UiNode;
94
+ const bindings = {
95
+ calendar: {
96
+ componentId: 'calendar',
97
+ events: {
98
+ dateChange: [
99
+ {
100
+ target: {
101
+ capability: 'state.set',
102
+ input: {
103
+ path: { kind: 'literal', value: 'calendar.date' },
104
+ value: { capability: 'calendar.dateChange', path: 'payload.date' },
105
+ },
106
+ },
107
+ },
108
+ ],
109
+ },
110
+ props: {
111
+ displayedDate: {
112
+ value: { kind: 'state', path: { kind: 'literal', value: 'calendar.date' } },
113
+ },
114
+ events: { value: { kind: 'state', path: { kind: 'literal', value: 'calendar.events' } } },
115
+ },
116
+ },
117
+ } as const satisfies ComponentDataBindingRegistry;
118
+ const stateAdapter = createRuntimeMemoryStateAdapter({
119
+ initialState: {
120
+ calendar: {
121
+ date: '2026-12-04',
122
+ events: [
123
+ {
124
+ id: 'zurich',
125
+ title: 'Zurich',
126
+ range: {
127
+ allDay: false,
128
+ start: '2026-12-04T09:00:00Z',
129
+ end: '2026-12-04T10:00:00Z',
130
+ timeZone: 'Europe/Zurich',
131
+ },
132
+ },
133
+ ],
134
+ },
135
+ },
136
+ });
137
+ const executeCapability = composeRuntimeCapabilityExecutor({ stateAdapter });
138
+ await withBrowserAsync(async (host) => {
139
+ const root = createRoot(host);
140
+ const render = () =>
141
+ root.render(
142
+ <ZoraProvider mode="light">
143
+ <RuntimeRenderer
144
+ dataBindings={bindings}
145
+ executeCapability={executeCapability}
146
+ isRoot
147
+ node={node}
148
+ registry={{ Calendar }}
149
+ resolveEventCapability={({ eventName }) =>
150
+ eventName === 'dateChange' ? 'calendar.dateChange' : undefined
151
+ }
152
+ stateAdapter={stateAdapter}
153
+ />
154
+ </ZoraProvider>,
155
+ );
156
+ try {
157
+ await interactAsync(render);
158
+ expect(host.textContent).toContain('Zurich');
159
+ const next = host.querySelector<HTMLButtonElement>('[data-testid="manifest-calendar-next"]');
160
+ if (!next) throw new Error('Missing manifest Calendar next navigation');
161
+ await interactAsync(() => next.click());
162
+ await new Promise((resolve) => setTimeout(resolve, 0));
163
+ expect(stateAdapter.get<string>('calendar.date')).toEqual({ data: '2027-01-04', ok: true });
164
+ stateAdapter.set('calendar.events', []);
165
+ await interactAsync(render);
166
+ expect(host.textContent).not.toContain('Zurich');
167
+ } finally {
168
+ await interactAsync(() => root.unmount());
169
+ }
170
+ });
171
+ });
172
+
78
173
  /*** Executes a React interaction after the renderer has a chance to flush effects. */
79
174
  function interactAsync(action: () => void): Promise<void> {
80
175
  return act(() => Promise.resolve().then(action));