@ankhorage/zora 28.8.3 → 28.10.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 (102) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +1 -1
  3. package/dist/capabilities/index.js +133 -5
  4. package/dist/capabilities/index.js.map +8 -7
  5. package/dist/constants/authoring.d.ts +4 -3
  6. package/dist/constants/authoring.d.ts.map +1 -1
  7. package/dist/constants/authoring.js +3 -0
  8. package/dist/constants/authoring.js.map +1 -1
  9. package/dist/features/accordion/accordionItemMeta.d.ts +1 -1
  10. package/dist/features/bottom-sheet/bottomSheetMeta.d.ts +1 -1
  11. package/dist/features/calendar/adapters/inbound/Calendar.d.ts +1 -1
  12. package/dist/features/calendar/adapters/inbound/Calendar.d.ts.map +1 -1
  13. package/dist/features/calendar/adapters/inbound/Calendar.js +207 -75
  14. package/dist/features/calendar/adapters/inbound/Calendar.js.map +1 -1
  15. package/dist/features/calendar/calendarMeta.d.ts +106 -4
  16. package/dist/features/calendar/calendarMeta.d.ts.map +1 -1
  17. package/dist/features/calendar/calendarMeta.js +44 -4
  18. package/dist/features/calendar/calendarMeta.js.map +1 -1
  19. package/dist/features/calendar/public.d.ts +1 -1
  20. package/dist/features/calendar/public.d.ts.map +1 -1
  21. package/dist/features/calendar/public.js.map +1 -1
  22. package/dist/features/card/cardMeta.d.ts +1 -1
  23. package/dist/features/card/mediaCardMeta.d.ts +1 -1
  24. package/dist/features/card/postCardMeta.d.ts +1 -1
  25. package/dist/features/chat/messageBubbleMeta.d.ts +1 -1
  26. package/dist/features/data-table/dataTableMeta.d.ts +10 -0
  27. package/dist/features/data-table/dataTableMeta.d.ts.map +1 -1
  28. package/dist/features/data-table/dataTableMeta.js +7 -0
  29. package/dist/features/data-table/dataTableMeta.js.map +1 -1
  30. package/dist/features/dialog/dialogMeta.d.ts +2 -2
  31. package/dist/features/gradient/gradientMeta.d.ts +1 -1
  32. package/dist/features/keyboard-avoiding-view/keyboardAvoidingViewMeta.d.ts +1 -1
  33. package/dist/features/layout/gridMeta.d.ts +1 -1
  34. package/dist/features/layout/screenMeta.d.ts +1 -1
  35. package/dist/features/layout/scrollViewMeta.d.ts +1 -1
  36. package/dist/features/layout/viewMeta.d.ts +1 -1
  37. package/dist/features/list/flatListMeta.d.ts +1 -1
  38. package/dist/features/list/sectionListMeta.d.ts +1 -1
  39. package/dist/features/master-detail/masterDetailMeta.d.ts +1 -1
  40. package/dist/features/popover/adapters/inbound/Popover.js +6 -3
  41. package/dist/features/popover/adapters/inbound/Popover.js.map +1 -1
  42. package/dist/features/popover/popoverMeta.d.ts +101 -0
  43. package/dist/features/popover/popoverMeta.d.ts.map +1 -0
  44. package/dist/features/popover/popoverMeta.js +78 -0
  45. package/dist/features/popover/popoverMeta.js.map +1 -0
  46. package/dist/features/reader/meta.d.ts +2 -2
  47. package/dist/features/registry/ZORA_BASE_COMPONENT_REGISTRY.d.ts.map +1 -1
  48. package/dist/features/registry/ZORA_BASE_COMPONENT_REGISTRY.js +2 -0
  49. package/dist/features/registry/ZORA_BASE_COMPONENT_REGISTRY.js.map +1 -1
  50. package/dist/features/registry/bindableComponentMeta.d.ts +2 -2
  51. package/dist/features/registry/componentMeta.d.ts.map +1 -1
  52. package/dist/features/registry/componentMeta.js +2 -0
  53. package/dist/features/registry/componentMeta.js.map +1 -1
  54. package/dist/features/scanner/meta.d.ts +2 -2
  55. package/dist/features/section/screenSectionMeta.d.ts +1 -1
  56. package/dist/features/surface/surfaceMeta.d.ts +1 -1
  57. package/dist/features/tabs/tabPanelMeta.d.ts +1 -1
  58. package/dist/readerFree.d.ts +1 -0
  59. package/dist/readerFree.d.ts.map +1 -1
  60. package/dist/readerFree.js +1 -0
  61. package/dist/readerFree.js.map +1 -1
  62. package/dist/types/calendar.d.ts +40 -19
  63. package/dist/types/calendar.d.ts.map +1 -1
  64. package/dist/types/calendar.js.map +1 -1
  65. package/dist/types/popover.d.ts +4 -1
  66. package/dist/types/popover.d.ts.map +1 -1
  67. package/dist/types/popover.js.map +1 -1
  68. package/package.json +102 -1
  69. package/src/constants/authoring.ts +3 -0
  70. package/src/features/calendar/adapters/inbound/Calendar.interaction.test.tsx +95 -0
  71. package/src/features/calendar/adapters/inbound/Calendar.tsx +425 -135
  72. package/src/features/calendar/calendarMeta.ts +44 -4
  73. package/src/features/calendar/public.test.ts +8 -5
  74. package/src/features/calendar/public.ts +4 -0
  75. package/src/features/data-table/adapters/inbound/DataTable.test.tsx +52 -1
  76. package/src/features/data-table/dataTableMeta.test.ts +8 -1
  77. package/src/features/data-table/dataTableMeta.ts +7 -0
  78. package/src/features/popover/adapters/inbound/Popover.tsx +17 -2
  79. package/src/features/popover/manifest.test.tsx +153 -0
  80. package/src/features/popover/popoverMeta.ts +79 -0
  81. package/src/features/popover/public.test.ts +2 -1
  82. package/src/features/registry/ZORA_BASE_COMPONENT_REGISTRY.ts +2 -0
  83. package/src/features/registry/componentMeta.test.ts +2 -0
  84. package/src/features/registry/componentMeta.ts +2 -0
  85. package/src/features/registry/featureManifest.test.ts +11 -0
  86. package/src/readerFree.ts +6 -0
  87. package/src/types/calendar.ts +44 -19
  88. package/src/types/popover.ts +5 -1
  89. package/src/webPackageExports.test.ts +1 -0
  90. package/web-dist/chunks/Accordion-59x6e7bs.js +200 -0
  91. package/web-dist/chunks/Accordion-q2yxtdzc.js +426 -0
  92. package/web-dist/components/calendar/Calendar.d.ts +2 -2
  93. package/web-dist/components/calendar/Calendar.dependency-2.d.ts +165 -0
  94. package/web-dist/components/calendar/Calendar.js +2 -1
  95. package/web-dist/components/calendar/Calendar.types-0.d.ts +45 -19
  96. package/web-dist/components/calendar/index.d.ts +1 -1
  97. package/web-dist/components/date-picker/DatePicker.js +2 -1
  98. package/web-dist/components/popover/Popover.js +10 -2
  99. package/web-dist/components/popover/Popover.types-0.d.ts +4 -1
  100. package/web-dist/components/time-grid/TimeGrid.js +4 -198
  101. package/web-dist/manifest.json +6 -2
  102. package/web-dist/chunks/Accordion-v3bmbnfh.js +0 -237
@@ -23,6 +23,7 @@ export declare const FEATURE_MANIFEST_ELEMENTS: {
23
23
  readonly 'date-picker': readonly ["DatePicker"];
24
24
  readonly explorer: readonly ["MediaExplorer", "FileExplorer"];
25
25
  readonly dialog: readonly ["Dialog"];
26
+ readonly popover: readonly ["Popover"];
26
27
  readonly form: readonly ["Form", "FormError", "Field"];
27
28
  readonly gradient: readonly ["Gradient"];
28
29
  readonly button: readonly ["Button", "IconButton", "ButtonGroup"];
@@ -51,12 +52,12 @@ export declare const FEATURE_MANIFEST_ELEMENTS: {
51
52
  readonly game: readonly ["Game", "GameField", "GameEntity", "GameInputZone", "GameMeasurementProbe", "GameOverlay"];
52
53
  readonly tabletop: readonly ["TabletopTable", "PokerTrainingTable"];
53
54
  };
54
- export declare const CONTAINER_ALLOWED_CHILDREN: readonly ["ActivityIndicator", "Audio", "AuthScreen", "ForgotPasswordForm", "OAuthProviderButton", "OAuthProviderList", "OtpForm", "SignInForm", "SignUpForm", "Accordion", "Surface", "Avatar", "AvatarGroup", "Badge", "MediaCard", "MetricCard", "Chip", "ChipGroup", "DataTable", "DatePicker", "Dialog", "Pagination", "Rating", "SearchInput", "Tabs", "Toolbar", "Skeleton", "SkeletonCard", "SkeletonList", "SkeletonText", "IconButton", "Uploader", "MediaExplorer", "FileExplorer", "FlatList", "SectionList", "BottomSheet", "ProductCard", "View", "ScrollView", "Grid", "Gradient", "Divider", "Text", "Heading", "Icon", "Image", "Hero", "KeyboardAvoidingView", "Link", "MasterDetail", "Button", "ButtonGroup", "RadioGroup", "ThemeModeToggle", "TextInput", "RichText", "TimePicker", "Timeline", "Form", "Card", "EmptyState", "SectionHeader", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "Reader", "ContentRail", "MissingElement", "Video"];
55
+ export declare const CONTAINER_ALLOWED_CHILDREN: readonly ["ActivityIndicator", "Audio", "AuthScreen", "ForgotPasswordForm", "OAuthProviderButton", "OAuthProviderList", "OtpForm", "SignInForm", "SignUpForm", "Accordion", "Surface", "Avatar", "AvatarGroup", "Badge", "MediaCard", "MetricCard", "Chip", "ChipGroup", "DataTable", "DatePicker", "Dialog", "Pagination", "Rating", "SearchInput", "Tabs", "Toolbar", "Skeleton", "SkeletonCard", "SkeletonList", "SkeletonText", "IconButton", "Uploader", "MediaExplorer", "FileExplorer", "FlatList", "SectionList", "BottomSheet", "Popover", "Select", "ProductCard", "View", "ScrollView", "Grid", "Gradient", "Divider", "Text", "Heading", "Icon", "Image", "Hero", "KeyboardAvoidingView", "Link", "MasterDetail", "Button", "ButtonGroup", "RadioGroup", "ThemeModeToggle", "TextInput", "RichText", "TimePicker", "Timeline", "Form", "Card", "EmptyState", "SectionHeader", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "Reader", "ContentRail", "MissingElement", "Video"];
55
56
  export declare const GAME_ALLOWED_CHILDREN: readonly ["Game", "GameField"];
56
57
  export declare const CHESS_ALLOWED_CHILDREN: readonly ["ChessBoard", "OpeningBook"];
57
58
  export declare const TABLETOP_ALLOWED_CHILDREN: readonly ["TabletopTable", "PokerTrainingTable"];
58
59
  export declare const CONTENT_RAIL_ALLOWED_CHILDREN: readonly ["Chip", "ChipGroup", "MediaCard", "MetricCard", "Avatar", "AvatarGroup", "Badge", "Button", "IconButton", "View", "ScrollView", "Card", "Image", "ProductCard", "PostCard", "ChatListItem", "MessageBubble", "MissingElement"];
59
- export declare const SCREEN_SECTION_ALLOWED_CHILDREN: readonly ["ActivityIndicator", "Audio", "AuthScreen", "ForgotPasswordForm", "OAuthProviderButton", "OAuthProviderList", "OtpForm", "SignInForm", "SignUpForm", "Accordion", "Surface", "Avatar", "AvatarGroup", "Badge", "MediaCard", "MetricCard", "Chip", "ChipGroup", "DataTable", "DatePicker", "Dialog", "Pagination", "Rating", "SearchInput", "Tabs", "Toolbar", "Skeleton", "SkeletonCard", "SkeletonList", "SkeletonText", "IconButton", "Uploader", "MediaExplorer", "FileExplorer", "FlatList", "SectionList", "BottomSheet", "ProductCard", "View", "ScrollView", "Grid", "Gradient", "Divider", "Text", "Heading", "Icon", "Image", "Hero", "KeyboardAvoidingView", "Link", "MasterDetail", "Button", "ButtonGroup", "RadioGroup", "ThemeModeToggle", "TextInput", "RichText", "TimePicker", "Timeline", "Form", "Card", "EmptyState", "SectionHeader", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "Reader", "ContentRail", "MissingElement", "Video", "ChessBoard", "OpeningBook", "Game", "GameField", "TabletopTable", "PokerTrainingTable"];
60
- export declare const SCREEN_ALLOWED_CHILDREN: readonly ["ScreenSection", "ActivityIndicator", "Audio", "AuthScreen", "ForgotPasswordForm", "OAuthProviderButton", "OAuthProviderList", "OtpForm", "SignInForm", "SignUpForm", "Accordion", "Surface", "Avatar", "AvatarGroup", "Badge", "MediaCard", "MetricCard", "Chip", "ChipGroup", "DataTable", "DatePicker", "Dialog", "Pagination", "Rating", "SearchInput", "Tabs", "Toolbar", "Skeleton", "SkeletonCard", "SkeletonList", "SkeletonText", "IconButton", "Uploader", "MediaExplorer", "FileExplorer", "FlatList", "SectionList", "BottomSheet", "ProductCard", "View", "ScrollView", "Grid", "Gradient", "Divider", "Text", "Heading", "Icon", "Image", "Hero", "KeyboardAvoidingView", "Link", "MasterDetail", "Button", "ButtonGroup", "RadioGroup", "ThemeModeToggle", "TextInput", "RichText", "TimePicker", "Timeline", "Form", "Card", "EmptyState", "SectionHeader", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "Reader", "ContentRail", "MissingElement", "Video", "ChessBoard", "OpeningBook", "Game", "GameField", "TabletopTable", "PokerTrainingTable"];
60
+ export declare const SCREEN_SECTION_ALLOWED_CHILDREN: readonly ["ActivityIndicator", "Audio", "AuthScreen", "ForgotPasswordForm", "OAuthProviderButton", "OAuthProviderList", "OtpForm", "SignInForm", "SignUpForm", "Accordion", "Surface", "Avatar", "AvatarGroup", "Badge", "MediaCard", "MetricCard", "Chip", "ChipGroup", "DataTable", "DatePicker", "Dialog", "Pagination", "Rating", "SearchInput", "Tabs", "Toolbar", "Skeleton", "SkeletonCard", "SkeletonList", "SkeletonText", "IconButton", "Uploader", "MediaExplorer", "FileExplorer", "FlatList", "SectionList", "BottomSheet", "Popover", "Select", "ProductCard", "View", "ScrollView", "Grid", "Gradient", "Divider", "Text", "Heading", "Icon", "Image", "Hero", "KeyboardAvoidingView", "Link", "MasterDetail", "Button", "ButtonGroup", "RadioGroup", "ThemeModeToggle", "TextInput", "RichText", "TimePicker", "Timeline", "Form", "Card", "EmptyState", "SectionHeader", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "Reader", "ContentRail", "MissingElement", "Video", "ChessBoard", "OpeningBook", "Game", "GameField", "TabletopTable", "PokerTrainingTable"];
61
+ export declare const SCREEN_ALLOWED_CHILDREN: readonly ["ScreenSection", "ActivityIndicator", "Audio", "AuthScreen", "ForgotPasswordForm", "OAuthProviderButton", "OAuthProviderList", "OtpForm", "SignInForm", "SignUpForm", "Accordion", "Surface", "Avatar", "AvatarGroup", "Badge", "MediaCard", "MetricCard", "Chip", "ChipGroup", "DataTable", "DatePicker", "Dialog", "Pagination", "Rating", "SearchInput", "Tabs", "Toolbar", "Skeleton", "SkeletonCard", "SkeletonList", "SkeletonText", "IconButton", "Uploader", "MediaExplorer", "FileExplorer", "FlatList", "SectionList", "BottomSheet", "Popover", "Select", "ProductCard", "View", "ScrollView", "Grid", "Gradient", "Divider", "Text", "Heading", "Icon", "Image", "Hero", "KeyboardAvoidingView", "Link", "MasterDetail", "Button", "ButtonGroup", "RadioGroup", "ThemeModeToggle", "TextInput", "RichText", "TimePicker", "Timeline", "Form", "Card", "EmptyState", "SectionHeader", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "Reader", "ContentRail", "MissingElement", "Video", "ChessBoard", "OpeningBook", "Game", "GameField", "TabletopTable", "PokerTrainingTable"];
61
62
  export declare const ZORA_THEME_TOKEN_FAMILIES: readonly ["colors", "spacing", "radii", "typography", "shadows"];
62
63
  //# sourceMappingURL=authoring.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"authoring.d.ts","sourceRoot":"","sources":["../../src/constants/authoring.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB;;;;CAI5B,CAAC;AAEX,eAAO,MAAM,sBAAsB;;;;;;;CAKzB,CAAC;AAEX,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+C5B,CAAC;AAEX,eAAO,MAAM,0BAA0B,u7BAwE7B,CAAC;AAEX,eAAO,MAAM,qBAAqB,gCAAiC,CAAC;AAEpE,eAAO,MAAM,sBAAsB,wCAAyC,CAAC;AAC7E,eAAO,MAAM,yBAAyB,kDAAmD,CAAC;AAE1F,eAAO,MAAM,6BAA6B,0OAmBhC,CAAC;AAEX,eAAO,MAAM,+BAA+B,ghCAKlC,CAAC;AAEX,eAAO,MAAM,uBAAuB,iiCAG1B,CAAC;AAEX,eAAO,MAAM,yBAAyB,kEAM5B,CAAC"}
1
+ {"version":3,"file":"authoring.d.ts","sourceRoot":"","sources":["../../src/constants/authoring.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB;;;;CAI5B,CAAC;AAEX,eAAO,MAAM,sBAAsB;;;;;;;CAKzB,CAAC;AAEX,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgD5B,CAAC;AAEX,eAAO,MAAM,0BAA0B,48BA0E7B,CAAC;AAEX,eAAO,MAAM,qBAAqB,gCAAiC,CAAC;AAEpE,eAAO,MAAM,sBAAsB,wCAAyC,CAAC;AAC7E,eAAO,MAAM,yBAAyB,kDAAmD,CAAC;AAE1F,eAAO,MAAM,6BAA6B,0OAmBhC,CAAC;AAEX,eAAO,MAAM,+BAA+B,qiCAKlC,CAAC;AAEX,eAAO,MAAM,uBAAuB,sjCAG1B,CAAC;AAEX,eAAO,MAAM,yBAAyB,kEAM5B,CAAC"}
@@ -29,6 +29,7 @@ export const FEATURE_MANIFEST_ELEMENTS = {
29
29
  'date-picker': ['DatePicker'],
30
30
  explorer: ['MediaExplorer', 'FileExplorer'],
31
31
  dialog: ['Dialog'],
32
+ popover: ['Popover'],
32
33
  form: ['Form', 'FormError', 'Field'],
33
34
  gradient: ['Gradient'],
34
35
  button: ['Button', 'IconButton', 'ButtonGroup'],
@@ -95,6 +96,8 @@ export const CONTAINER_ALLOWED_CHILDREN = [
95
96
  'FlatList',
96
97
  'SectionList',
97
98
  'BottomSheet',
99
+ 'Popover',
100
+ 'Select',
98
101
  'ProductCard',
99
102
  'View',
100
103
  'ScrollView',
@@ -1 +1 @@
1
- {"version":3,"file":"authoring.js","sourceRoot":"","sources":["../../src/constants/authoring.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,SAAS,EAAE,OAAO;IAClB,KAAK,EAAE,WAAW;IAClB,qBAAqB,EAAE,IAAI;CACnB,CAAC;AAEX,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,IAAI,EAAE,SAAS;IACf,QAAQ,EAAE,OAAO;IACjB,KAAK,EAAE,iEAAiE;IACxE,SAAS,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE;CAC5B,CAAC;AAEX,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,IAAI,EAAE;QACJ,YAAY;QACZ,oBAAoB;QACpB,qBAAqB;QACrB,mBAAmB;QACnB,SAAS;QACT,YAAY;QACZ,YAAY;KACb;IACD,KAAK,EAAE,CAAC,OAAO,CAAC;IAChB,OAAO,EAAE,CAAC,SAAS,CAAC;IACpB,MAAM,EAAE,CAAC,QAAQ,EAAE,aAAa,CAAC;IACjC,KAAK,EAAE,CAAC,OAAO,CAAC;IAChB,IAAI,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,CAAC;IACpE,IAAI,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC;IAC3B,YAAY,EAAE,CAAC,WAA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,CAAC,MAAM,yBAAyB,GAAG,CAAC,eAAe,EAAE,oBAAoB,CAAU,CAAC;AAE1F,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C,MAAM;IACN,WAAW;IACX,WAAW;IACX,YAAY;IACZ,QAAQ;IACR,aAAa;IACb,OAAO;IACP,QAAQ;IACR,YAAY;IACZ,MAAM;IACN,YAAY;IACZ,MAAM;IACN,OAAO;IACP,aAAa;IACb,UAAU;IACV,cAAc;IACd,eAAe;IACf,gBAAgB;CACR,CAAC;AAEX,MAAM,CAAC,MAAM,+BAA+B,GAAG;IAC7C,GAAG,0BAA0B;IAC7B,GAAG,sBAAsB;IACzB,GAAG,qBAAqB;IACxB,GAAG,yBAAyB;CACpB,CAAC;AAEX,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,eAAe;IACf,GAAG,+BAA+B;CAC1B,CAAC;AAEX,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,QAAQ;IACR,SAAS;IACT,OAAO;IACP,YAAY;IACZ,SAAS;CACD,CAAC","sourcesContent":["export const COMPONENT_THEME_AUTHORING = {\n authority: 'theme',\n scope: 'component',\n allowInstanceOverride: true,\n} as const;\n\nexport const INVERTED_POLARITY_PROP = {\n type: 'boolean',\n category: 'Theme',\n label: 'Inverted surface polarity (inherits when omitted; false resets)',\n authoring: { authority: 'instance' },\n} as const;\n\nexport const FEATURE_MANIFEST_ELEMENTS = {\n auth: [\n 'AuthScreen',\n 'ForgotPasswordForm',\n 'OAuthProviderButton',\n 'OAuthProviderList',\n 'OtpForm',\n 'SignInForm',\n 'SignUpForm',\n ],\n audio: ['Audio'],\n surface: ['Surface'],\n avatar: ['Avatar', 'AvatarGroup'],\n badge: ['Badge'],\n card: ['Card', 'MediaCard', 'MetricCard', 'PostCard', 'ProductCard'],\n chip: ['Chip', 'ChipGroup'],\n 'data-table': ['DataTable'],\n 'date-picker': ['DatePicker'],\n explorer: ['MediaExplorer', 'FileExplorer'],\n dialog: ['Dialog'],\n form: ['Form', 'FormError', 'Field'],\n gradient: ['Gradient'],\n button: ['Button', 'IconButton', 'ButtonGroup'],\n icon: ['Icon'],\n image: ['Image'],\n 'keyboard-avoiding-view': ['KeyboardAvoidingView'],\n link: ['Link'],\n 'master-detail': ['MasterDetail'],\n 'content-rail': ['ContentRail'],\n 'rich-text': ['RichText'],\n layout: ['Divider', 'Grid', 'Screen', 'ScrollView', 'View'],\n section: ['ScreenSection', 'SectionHeader'],\n list: ['FlatList', 'SectionList'],\n pagination: ['Pagination'],\n rating: ['Rating'],\n skeleton: ['Skeleton', 'SkeletonCard', 'SkeletonList', 'SkeletonText'],\n tabs: ['Tabs', 'TabList', 'Tab', 'TabPanel'],\n toolbar: ['Toolbar'],\n typography: ['Heading', 'Text'],\n 'time-picker': ['TimePicker'],\n timeline: ['Timeline'],\n uploader: ['Uploader'],\n video: ['Video'],\n 'bottom-sheet': ['BottomSheet'],\n chess: ['ChessBoard', 'OpeningBook'],\n game: ['Game', 'GameField', 'GameEntity', 'GameInputZone', 'GameMeasurementProbe', 'GameOverlay'],\n tabletop: ['TabletopTable', 'PokerTrainingTable'],\n} as const;\n\nexport const CONTAINER_ALLOWED_CHILDREN = [\n 'ActivityIndicator',\n 'Audio',\n 'AuthScreen',\n 'ForgotPasswordForm',\n 'OAuthProviderButton',\n 'OAuthProviderList',\n 'OtpForm',\n 'SignInForm',\n 'SignUpForm',\n 'Accordion',\n 'Surface',\n 'Avatar',\n 'AvatarGroup',\n 'Badge',\n 'MediaCard',\n 'MetricCard',\n 'Chip',\n 'ChipGroup',\n 'DataTable',\n 'DatePicker',\n 'Dialog',\n 'Pagination',\n 'Rating',\n 'SearchInput',\n 'Tabs',\n 'Toolbar',\n 'Skeleton',\n 'SkeletonCard',\n 'SkeletonList',\n 'SkeletonText',\n 'IconButton',\n 'Uploader',\n 'MediaExplorer',\n 'FileExplorer',\n 'FlatList',\n 'SectionList',\n 'BottomSheet',\n 'ProductCard',\n 'View',\n 'ScrollView',\n 'Grid',\n 'Gradient',\n 'Divider',\n 'Text',\n 'Heading',\n 'Icon',\n 'Image',\n 'Hero',\n 'KeyboardAvoidingView',\n 'Link',\n 'MasterDetail',\n 'Button',\n 'ButtonGroup',\n 'RadioGroup',\n 'ThemeModeToggle',\n 'TextInput',\n 'RichText',\n 'TimePicker',\n 'Timeline',\n 'Form',\n 'Card',\n 'EmptyState',\n 'SectionHeader',\n 'PostCard',\n 'ChatListItem',\n 'MessageBubble',\n 'ProgressRing',\n 'Reader',\n 'ContentRail',\n 'MissingElement',\n 'Video',\n] as const;\n\nexport const GAME_ALLOWED_CHILDREN = ['Game', 'GameField'] as const;\n\nexport const CHESS_ALLOWED_CHILDREN = ['ChessBoard', 'OpeningBook'] as const;\nexport const TABLETOP_ALLOWED_CHILDREN = ['TabletopTable', 'PokerTrainingTable'] as const;\n\nexport const CONTENT_RAIL_ALLOWED_CHILDREN = [\n 'Chip',\n 'ChipGroup',\n 'MediaCard',\n 'MetricCard',\n 'Avatar',\n 'AvatarGroup',\n 'Badge',\n 'Button',\n 'IconButton',\n 'View',\n 'ScrollView',\n 'Card',\n 'Image',\n 'ProductCard',\n 'PostCard',\n 'ChatListItem',\n 'MessageBubble',\n 'MissingElement',\n] as const;\n\nexport const SCREEN_SECTION_ALLOWED_CHILDREN = [\n ...CONTAINER_ALLOWED_CHILDREN,\n ...CHESS_ALLOWED_CHILDREN,\n ...GAME_ALLOWED_CHILDREN,\n ...TABLETOP_ALLOWED_CHILDREN,\n] as const;\n\nexport const SCREEN_ALLOWED_CHILDREN = [\n 'ScreenSection',\n ...SCREEN_SECTION_ALLOWED_CHILDREN,\n] as const;\n\nexport const ZORA_THEME_TOKEN_FAMILIES = [\n 'colors',\n 'spacing',\n 'radii',\n 'typography',\n 'shadows',\n] as const;\n"]}
1
+ {"version":3,"file":"authoring.js","sourceRoot":"","sources":["../../src/constants/authoring.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,SAAS,EAAE,OAA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AAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,eAAe;IACf,GAAG,+BAA+B;CAC1B,CAAC;AAEX,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,QAAQ;IACR,SAAS;IACT,OAAO;IACP,YAAY;IACZ,SAAS;CACD,CAAC","sourcesContent":["export const COMPONENT_THEME_AUTHORING = {\n authority: 'theme',\n scope: 'component',\n allowInstanceOverride: true,\n} as const;\n\nexport const INVERTED_POLARITY_PROP = {\n type: 'boolean',\n category: 'Theme',\n label: 'Inverted surface polarity (inherits when omitted; false resets)',\n authoring: { authority: 'instance' },\n} as const;\n\nexport const FEATURE_MANIFEST_ELEMENTS = {\n auth: [\n 'AuthScreen',\n 'ForgotPasswordForm',\n 'OAuthProviderButton',\n 'OAuthProviderList',\n 'OtpForm',\n 'SignInForm',\n 'SignUpForm',\n ],\n audio: ['Audio'],\n surface: ['Surface'],\n avatar: ['Avatar', 'AvatarGroup'],\n badge: ['Badge'],\n card: ['Card', 'MediaCard', 'MetricCard', 'PostCard', 'ProductCard'],\n chip: ['Chip', 'ChipGroup'],\n 'data-table': ['DataTable'],\n 'date-picker': ['DatePicker'],\n explorer: ['MediaExplorer', 'FileExplorer'],\n dialog: ['Dialog'],\n popover: ['Popover'],\n form: ['Form', 'FormError', 'Field'],\n gradient: ['Gradient'],\n button: ['Button', 'IconButton', 'ButtonGroup'],\n icon: ['Icon'],\n image: ['Image'],\n 'keyboard-avoiding-view': ['KeyboardAvoidingView'],\n link: ['Link'],\n 'master-detail': ['MasterDetail'],\n 'content-rail': ['ContentRail'],\n 'rich-text': ['RichText'],\n layout: ['Divider', 'Grid', 'Screen', 'ScrollView', 'View'],\n section: ['ScreenSection', 'SectionHeader'],\n list: ['FlatList', 'SectionList'],\n pagination: ['Pagination'],\n rating: ['Rating'],\n skeleton: ['Skeleton', 'SkeletonCard', 'SkeletonList', 'SkeletonText'],\n tabs: ['Tabs', 'TabList', 'Tab', 'TabPanel'],\n toolbar: ['Toolbar'],\n typography: ['Heading', 'Text'],\n 'time-picker': ['TimePicker'],\n timeline: ['Timeline'],\n uploader: ['Uploader'],\n video: ['Video'],\n 'bottom-sheet': ['BottomSheet'],\n chess: ['ChessBoard', 'OpeningBook'],\n game: ['Game', 'GameField', 'GameEntity', 'GameInputZone', 'GameMeasurementProbe', 'GameOverlay'],\n tabletop: ['TabletopTable', 'PokerTrainingTable'],\n} as const;\n\nexport const CONTAINER_ALLOWED_CHILDREN = [\n 'ActivityIndicator',\n 'Audio',\n 'AuthScreen',\n 'ForgotPasswordForm',\n 'OAuthProviderButton',\n 'OAuthProviderList',\n 'OtpForm',\n 'SignInForm',\n 'SignUpForm',\n 'Accordion',\n 'Surface',\n 'Avatar',\n 'AvatarGroup',\n 'Badge',\n 'MediaCard',\n 'MetricCard',\n 'Chip',\n 'ChipGroup',\n 'DataTable',\n 'DatePicker',\n 'Dialog',\n 'Pagination',\n 'Rating',\n 'SearchInput',\n 'Tabs',\n 'Toolbar',\n 'Skeleton',\n 'SkeletonCard',\n 'SkeletonList',\n 'SkeletonText',\n 'IconButton',\n 'Uploader',\n 'MediaExplorer',\n 'FileExplorer',\n 'FlatList',\n 'SectionList',\n 'BottomSheet',\n 'Popover',\n 'Select',\n 'ProductCard',\n 'View',\n 'ScrollView',\n 'Grid',\n 'Gradient',\n 'Divider',\n 'Text',\n 'Heading',\n 'Icon',\n 'Image',\n 'Hero',\n 'KeyboardAvoidingView',\n 'Link',\n 'MasterDetail',\n 'Button',\n 'ButtonGroup',\n 'RadioGroup',\n 'ThemeModeToggle',\n 'TextInput',\n 'RichText',\n 'TimePicker',\n 'Timeline',\n 'Form',\n 'Card',\n 'EmptyState',\n 'SectionHeader',\n 'PostCard',\n 'ChatListItem',\n 'MessageBubble',\n 'ProgressRing',\n 'Reader',\n 'ContentRail',\n 'MissingElement',\n 'Video',\n] as const;\n\nexport const GAME_ALLOWED_CHILDREN = ['Game', 'GameField'] as const;\n\nexport const CHESS_ALLOWED_CHILDREN = ['ChessBoard', 'OpeningBook'] as const;\nexport const TABLETOP_ALLOWED_CHILDREN = ['TabletopTable', 'PokerTrainingTable'] as const;\n\nexport const CONTENT_RAIL_ALLOWED_CHILDREN = [\n 'Chip',\n 'ChipGroup',\n 'MediaCard',\n 'MetricCard',\n 'Avatar',\n 'AvatarGroup',\n 'Badge',\n 'Button',\n 'IconButton',\n 'View',\n 'ScrollView',\n 'Card',\n 'Image',\n 'ProductCard',\n 'PostCard',\n 'ChatListItem',\n 'MessageBubble',\n 'MissingElement',\n] as const;\n\nexport const SCREEN_SECTION_ALLOWED_CHILDREN = [\n ...CONTAINER_ALLOWED_CHILDREN,\n ...CHESS_ALLOWED_CHILDREN,\n ...GAME_ALLOWED_CHILDREN,\n ...TABLETOP_ALLOWED_CHILDREN,\n] as const;\n\nexport const SCREEN_ALLOWED_CHILDREN = [\n 'ScreenSection',\n ...SCREEN_SECTION_ALLOWED_CHILDREN,\n] as const;\n\nexport const ZORA_THEME_TOKEN_FAMILIES = [\n 'colors',\n 'spacing',\n 'radii',\n 'typography',\n 'shadows',\n] as const;\n"]}
@@ -3,7 +3,7 @@ export declare const accordionItemMeta: {
3
3
  readonly category: "component";
4
4
  readonly description: "One expandable accordion item with authored content and optional actions.";
5
5
  readonly directManifestNode: true;
6
- readonly allowedChildren: readonly ["ActivityIndicator", "Audio", "AuthScreen", "ForgotPasswordForm", "OAuthProviderButton", "OAuthProviderList", "OtpForm", "SignInForm", "SignUpForm", "Accordion", "Surface", "Avatar", "AvatarGroup", "Badge", "MediaCard", "MetricCard", "Chip", "ChipGroup", "DataTable", "DatePicker", "Dialog", "Pagination", "Rating", "SearchInput", "Tabs", "Toolbar", "Skeleton", "SkeletonCard", "SkeletonList", "SkeletonText", "IconButton", "Uploader", "MediaExplorer", "FileExplorer", "FlatList", "SectionList", "BottomSheet", "ProductCard", "View", "ScrollView", "Grid", "Gradient", "Divider", "Text", "Heading", "Icon", "Image", "Hero", "KeyboardAvoidingView", "Link", "MasterDetail", "Button", "ButtonGroup", "RadioGroup", "ThemeModeToggle", "TextInput", "RichText", "TimePicker", "Timeline", "Form", "Card", "EmptyState", "SectionHeader", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "Reader", "ContentRail", "MissingElement", "Video"];
6
+ readonly allowedChildren: readonly ["ActivityIndicator", "Audio", "AuthScreen", "ForgotPasswordForm", "OAuthProviderButton", "OAuthProviderList", "OtpForm", "SignInForm", "SignUpForm", "Accordion", "Surface", "Avatar", "AvatarGroup", "Badge", "MediaCard", "MetricCard", "Chip", "ChipGroup", "DataTable", "DatePicker", "Dialog", "Pagination", "Rating", "SearchInput", "Tabs", "Toolbar", "Skeleton", "SkeletonCard", "SkeletonList", "SkeletonText", "IconButton", "Uploader", "MediaExplorer", "FileExplorer", "FlatList", "SectionList", "BottomSheet", "Popover", "Select", "ProductCard", "View", "ScrollView", "Grid", "Gradient", "Divider", "Text", "Heading", "Icon", "Image", "Hero", "KeyboardAvoidingView", "Link", "MasterDetail", "Button", "ButtonGroup", "RadioGroup", "ThemeModeToggle", "TextInput", "RichText", "TimePicker", "Timeline", "Form", "Card", "EmptyState", "SectionHeader", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "Reader", "ContentRail", "MissingElement", "Video"];
7
7
  readonly blueprint: {
8
8
  readonly label: "Accordion item";
9
9
  readonly defaultProps: {
@@ -2,7 +2,7 @@ export declare const bottomSheetMeta: {
2
2
  readonly name: "BottomSheet";
3
3
  readonly category: "layout";
4
4
  readonly directManifestNode: true;
5
- readonly allowedChildren: readonly ["ActivityIndicator", "Audio", "AuthScreen", "ForgotPasswordForm", "OAuthProviderButton", "OAuthProviderList", "OtpForm", "SignInForm", "SignUpForm", "Accordion", "Surface", "Avatar", "AvatarGroup", "Badge", "MediaCard", "MetricCard", "Chip", "ChipGroup", "DataTable", "DatePicker", "Dialog", "Pagination", "Rating", "SearchInput", "Tabs", "Toolbar", "Skeleton", "SkeletonCard", "SkeletonList", "SkeletonText", "IconButton", "Uploader", "MediaExplorer", "FileExplorer", "FlatList", "SectionList", "BottomSheet", "ProductCard", "View", "ScrollView", "Grid", "Gradient", "Divider", "Text", "Heading", "Icon", "Image", "Hero", "KeyboardAvoidingView", "Link", "MasterDetail", "Button", "ButtonGroup", "RadioGroup", "ThemeModeToggle", "TextInput", "RichText", "TimePicker", "Timeline", "Form", "Card", "EmptyState", "SectionHeader", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "Reader", "ContentRail", "MissingElement", "Video"];
5
+ readonly allowedChildren: readonly ["ActivityIndicator", "Audio", "AuthScreen", "ForgotPasswordForm", "OAuthProviderButton", "OAuthProviderList", "OtpForm", "SignInForm", "SignUpForm", "Accordion", "Surface", "Avatar", "AvatarGroup", "Badge", "MediaCard", "MetricCard", "Chip", "ChipGroup", "DataTable", "DatePicker", "Dialog", "Pagination", "Rating", "SearchInput", "Tabs", "Toolbar", "Skeleton", "SkeletonCard", "SkeletonList", "SkeletonText", "IconButton", "Uploader", "MediaExplorer", "FileExplorer", "FlatList", "SectionList", "BottomSheet", "Popover", "Select", "ProductCard", "View", "ScrollView", "Grid", "Gradient", "Divider", "Text", "Heading", "Icon", "Image", "Hero", "KeyboardAvoidingView", "Link", "MasterDetail", "Button", "ButtonGroup", "RadioGroup", "ThemeModeToggle", "TextInput", "RichText", "TimePicker", "Timeline", "Form", "Card", "EmptyState", "SectionHeader", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "Reader", "ContentRail", "MissingElement", "Video"];
6
6
  readonly description: "Controlled presentation through the shared single-sheet host. Bind dismiss to clear open.";
7
7
  readonly events: {
8
8
  readonly dismiss: {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import type { CalendarProps } from '../../../../types/calendar';
3
- /*** Renders a locale-aware, accessible month calendar using canonical GridView geometry. */
3
+ /*** Renders controlled month, week, and day Calendar views through GridView and TimeGrid. */
4
4
  export declare const Calendar: (props: CalendarProps) => React.ReactElement | null;
5
5
  //# sourceMappingURL=Calendar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Calendar.d.ts","sourceRoot":"","sources":["../../../../../src/features/calendar/adapters/inbound/Calendar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAYhE,4FAA4F;AAC5F,eAAO,MAAM,QAAQ,qDAAoC,CAAC"}
1
+ {"version":3,"file":"Calendar.d.ts","sourceRoot":"","sources":["../../../../../src/features/calendar/adapters/inbound/Calendar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,aAAa,EAAgB,MAAM,4BAA4B,CAAC;AAoB9E,6FAA6F;AAC7F,eAAO,MAAM,QAAQ,qDAAoC,CAAC"}
@@ -3,124 +3,256 @@ import { Button } from '../../../button/public.js';
3
3
  import { GridView } from '../../../grid-view/public.js';
4
4
  import { View } from '../../../layout/public.js';
5
5
  import { withZoraThemeScope } from '../../../theme/adapters/inbound/withZoraThemeScope.js';
6
+ import { TimeGrid } from '../../../time-grid/public.js';
6
7
  import { Text } from '../../../typography/public.js';
7
8
  import { createCalendarMonth } from '../../application/createCalendarMonth.js';
8
9
  import { isCalendarDateDisabled } from '../../application/isCalendarDateDisabled.js';
9
10
  const GRID_COLUMNS = 7;
10
11
  const GRID_ROWS = 6;
11
- /*** Renders a locale-aware, accessible month calendar using canonical GridView geometry. */
12
+ const MINUTES_PER_DAY = 24 * 60;
13
+ /*** Renders controlled month, week, and day Calendar views through GridView and TimeGrid. */
12
14
  export const Calendar = withZoraThemeScope(CalendarInner);
13
- /*** Connects controlled Calendar state to the shared month grid presentation. */
14
- function CalendarInner({ defaultDisplayedMonth, density = 'regular', disabledDates = [], displayedMonth: controlledDisplayedMonth, interactionPolicy, isDateDisabled, locale, maxDate, minDate, onDisplayedMonthChange, onSelectedDateChange, selectedDate, testID, weekStartsOn = 0, }) {
15
- const [uncontrolledDisplayedMonth, setUncontrolledDisplayedMonth] = React.useState(() => startOfLocalMonth(defaultDisplayedMonth ?? selectedDate ?? minDate ?? new Date()));
16
- const displayedMonth = startOfLocalMonth(controlledDisplayedMonth ?? uncontrolledDisplayedMonth);
17
- const cellSize = density === 'compact' ? 42 : 48;
18
- const gridWidth = cellSize * GRID_COLUMNS;
19
- const gridHeight = cellSize * GRID_ROWS;
20
- const cells = React.useMemo(() => createCalendarMonth(displayedMonth, weekStartsOn), [displayedMonth, weekStartsOn]);
21
- const gridItems = React.useMemo(() => cells.map((cell, index) => ({
22
- height: cellSize,
23
- id: cell.id,
24
- width: cellSize,
25
- x: (index % GRID_COLUMNS) * cellSize,
26
- y: Math.floor(index / GRID_COLUMNS) * cellSize,
27
- })), [cellSize, cells]);
28
- const cellsById = React.useMemo(() => new Map(cells.map((cell) => [cell.id, cell])), [cells]);
29
- const disabledDateIds = React.useMemo(() => new Set(disabledDates.map(formatCalendarDate)), [disabledDates]);
30
- const weekdays = React.useMemo(() => createWeekdayLabels(locale, weekStartsOn), [locale, weekStartsOn]);
31
- const setDisplayedMonth = React.useCallback((month) => {
32
- const nextMonth = startOfLocalMonth(month);
33
- if (controlledDisplayedMonth === undefined)
34
- setUncontrolledDisplayedMonth(nextMonth);
35
- onDisplayedMonthChange?.(nextMonth);
36
- }, [controlledDisplayedMonth, onDisplayedMonthChange]);
37
- const previousMonth = addMonths(displayedMonth, -1);
38
- const nextMonth = addMonths(displayedMonth, 1);
39
- return (<View accessibilityLabel="Calendar" gap={density === 'compact' ? 's' : 'm'} testID={testID}>
15
+ /*** Connects serializable manifest state and the DatePicker-compatible code API to Calendar views. */
16
+ function CalendarInner(props) {
17
+ const { defaultDisplayedDate, defaultDisplayedMonth, defaultView = 'month', density = 'regular', displayedDate: controlledDisplayedDate, displayedMonth: controlledDisplayedMonth, events = [], locale, onDateChange, onDisplayedMonthChange, onEventActivate, onViewChange, timeZone, view: controlledView, weekStartsOn = 0, } = props;
18
+ const [uncontrolledDate, setUncontrolledDate] = React.useState(() => parseCalendarDate(defaultDisplayedDate) ??
19
+ startOfLocalDay(defaultDisplayedMonth ?? props.selectedDate ?? props.minDate ?? new Date()));
20
+ const [uncontrolledView, setUncontrolledView] = React.useState(defaultView);
21
+ const displayedDate = parseCalendarDate(controlledDisplayedDate) ??
22
+ startOfLocalDay(controlledDisplayedMonth ?? uncontrolledDate);
23
+ const view = controlledView ?? uncontrolledView;
24
+ const setDisplayedDate = React.useCallback((value) => {
25
+ const next = startOfLocalDay(value);
26
+ if (controlledDisplayedDate === undefined && controlledDisplayedMonth === undefined)
27
+ setUncontrolledDate(next);
28
+ onDisplayedMonthChange?.(startOfLocalMonth(next));
29
+ onDateChange?.({ date: formatCalendarDate(next) });
30
+ }, [controlledDisplayedDate, controlledDisplayedMonth, onDateChange, onDisplayedMonthChange]);
31
+ const setView = React.useCallback((next) => {
32
+ if (controlledView === undefined)
33
+ setUncontrolledView(next);
34
+ onViewChange?.({ view: next });
35
+ }, [controlledView, onViewChange]);
36
+ const navigate = React.useCallback((offset) => setDisplayedDate(view === 'month'
37
+ ? addMonths(displayedDate, offset)
38
+ : addDays(displayedDate, offset * (view === 'week' ? 7 : 1))), [displayedDate, setDisplayedDate, view]);
39
+ return (<View accessibilityLabel="Calendar" gap={density === 'compact' ? 's' : 'm'} testID={props.testID}>
40
40
  <View align="center" direction="row" justify="space-between">
41
- <Button disabled={!monthIntersectsRange(previousMonth, minDate, maxDate)} interactionPolicy={interactionPolicy} onPress={() => setDisplayedMonth(previousMonth)} size="s" variant="ghost">
41
+ <Button interactionPolicy={props.interactionPolicy} onPress={() => navigate(-1)} size="s" testID={withTestId(props.testID, 'previous')} variant="ghost">
42
42
  Previous
43
43
  </Button>
44
44
  <Text accessibilityRole="header" align="center" variant="label" weight="semiBold">
45
- {formatMonthLabel(displayedMonth, locale)}
45
+ {formatViewLabel(displayedDate, locale, view)}
46
46
  </Text>
47
- <Button disabled={!monthIntersectsRange(nextMonth, minDate, maxDate)} interactionPolicy={interactionPolicy} onPress={() => setDisplayedMonth(nextMonth)} size="s" variant="ghost">
47
+ <Button interactionPolicy={props.interactionPolicy} onPress={() => navigate(1)} size="s" testID={withTestId(props.testID, 'next')} variant="ghost">
48
48
  Next
49
49
  </Button>
50
50
  </View>
51
+ <View direction="row" justify="space-between">
52
+ {['day', 'week', 'month'].map((candidate) => (<Button key={candidate} interactionPolicy={props.interactionPolicy} onPress={() => setView(candidate)} size="s" testID={withTestId(props.testID, `view-${candidate}`)} variant={view === candidate ? 'solid' : 'ghost'}>
53
+ {candidate}
54
+ </Button>))}
55
+ <Button interactionPolicy={props.interactionPolicy} onPress={() => setDisplayedDate(new Date())} size="s" testID={withTestId(props.testID, 'today')} variant="ghost">
56
+ Today
57
+ </Button>
58
+ </View>
59
+ {view === 'month' ? (<CalendarMonth {...props} activateEvent={(id) => onEventActivate?.({ eventId: id })} cellSize={density === 'compact' ? 42 : 48} displayedDate={displayedDate} events={events} timeZone={timeZone} weekStartsOn={weekStartsOn} onSelectDate={(date) => {
60
+ setDisplayedDate(date);
61
+ props.onSelectedDateChange?.(date);
62
+ }}/>) : (<CalendarTimeView activateEvent={(id) => onEventActivate?.({ eventId: id })} displayedDate={displayedDate} events={events} interactionPolicy={props.interactionPolicy} locale={locale} testID={props.testID} timeZone={timeZone} view={view} weekStartsOn={weekStartsOn}/>)}
63
+ </View>);
64
+ }
65
+ /*** Renders the canonical GridView month geometry with stable event activation. */
66
+ function CalendarMonth({ activateEvent, cellSize, displayedDate, events, onSelectDate, timeZone, weekStartsOn, ...props }) {
67
+ const cells = React.useMemo(() => createCalendarMonth(displayedDate, weekStartsOn), [displayedDate, weekStartsOn]);
68
+ const gridItems = React.useMemo(() => cells.map((cell, index) => ({
69
+ height: cellSize,
70
+ id: cell.id,
71
+ width: cellSize,
72
+ x: (index % GRID_COLUMNS) * cellSize,
73
+ y: Math.floor(index / GRID_COLUMNS) * cellSize,
74
+ })), [cellSize, cells]);
75
+ const cellsById = React.useMemo(() => new Map(cells.map((cell) => [cell.id, cell])), [cells]);
76
+ const disabledDateIds = React.useMemo(() => new Set((props.disabledDates ?? []).map(formatCalendarDate)), [props.disabledDates]);
77
+ const eventsByDate = React.useMemo(() => createEventsByDate(events, cells.map((cell) => cell.date), timeZone), [cells, events, timeZone]);
78
+ return (<>
51
79
  <View direction="row">
52
- {weekdays.map((weekday) => (<View key={weekday.id} width={cellSize}>
80
+ {createWeekdayLabels(props.locale, weekStartsOn).map((weekday) => (<View key={weekday.id} width={cellSize}>
53
81
  <Text align="center" emphasis="muted" variant="caption" weight="semiBold">
54
82
  {weekday.label}
55
83
  </Text>
56
84
  </View>))}
57
85
  </View>
58
- <GridView contentHeight={gridHeight} contentWidth={gridWidth} height={gridHeight} interactionPolicy={interactionPolicy} items={gridItems} overscanPixels={0} renderItem={(item) => {
86
+ <GridView contentHeight={cellSize * GRID_ROWS} contentWidth={cellSize * GRID_COLUMNS} height={cellSize * GRID_ROWS} interactionPolicy={props.interactionPolicy} items={gridItems} overscanPixels={0} renderItem={(item) => {
59
87
  const cell = cellsById.get(item.id);
60
88
  if (!cell)
61
89
  return null;
62
- const selected = selectedDate !== null &&
63
- selectedDate !== undefined &&
64
- isSameLocalDay(selectedDate, cell.date);
90
+ const selected = props.selectedDate !== null &&
91
+ props.selectedDate !== undefined &&
92
+ isSameLocalDay(props.selectedDate, cell.date);
65
93
  const disabled = isCalendarDateDisabled({
66
94
  date: cell.date,
67
95
  disabledDateIds,
68
- isDateDisabled,
69
- maxDate,
70
- minDate,
96
+ isDateDisabled: props.isDateDisabled,
97
+ maxDate: props.maxDate,
98
+ minDate: props.minDate,
71
99
  });
72
- const selectCell = () => {
73
- if (!cell.inDisplayedMonth)
74
- setDisplayedMonth(cell.date);
75
- onSelectedDateChange?.(cell.date);
76
- };
77
- return (<Button accessibilityState={{ disabled, selected }} color={selected ? 'primary' : 'neutral'} disabled={disabled} interactionPolicy={interactionPolicy} onPress={selectCell} size="s" testID={testID ? `${testID}-day-${cell.id}` : undefined} variant={selected ? 'solid' : cell.inDisplayedMonth ? 'ghost' : 'outline'}>
78
- {cell.date.getDate()}
79
- </Button>);
80
- }} testID={testID ? `${testID}-grid` : undefined} viewportInteraction="locked" width={gridWidth}/>
81
- </View>);
100
+ const event = eventsByDate.get(cell.id)?.[0];
101
+ return (<View gap="xxs">
102
+ <Button accessibilityState={{ disabled, selected }} color={selected ? 'primary' : 'neutral'} disabled={disabled} interactionPolicy={props.interactionPolicy} onPress={() => onSelectDate(cell.date)} size="s" testID={withTestId(props.testID, `day-${cell.id}`)} variant={selected ? 'solid' : cell.inDisplayedMonth ? 'ghost' : 'outline'}>
103
+ {cell.date.getDate()}
104
+ </Button>
105
+ {props.density !== 'compact' && event ? (<Button interactionPolicy={props.interactionPolicy} onPress={() => activateEvent(event.id)} size="s" testID={withTestId(props.testID, `event-${event.id}`)} variant="outline">
106
+ {event.title}
107
+ </Button>) : null}
108
+ </View>);
109
+ }} testID={withTestId(props.testID, 'grid')} viewportInteraction="locked" width={cellSize * GRID_COLUMNS}/>
110
+ </>);
111
+ }
112
+ /*** Renders day and week event lanes through the existing TimeGrid foundation. */
113
+ function CalendarTimeView({ activateEvent, displayedDate, events, interactionPolicy, locale, testID, timeZone, view, weekStartsOn, }) {
114
+ const dates = view === 'day' ? [displayedDate] : createWeek(displayedDate, weekStartsOn);
115
+ const eventById = new Map(events.map((event) => [event.id, event]));
116
+ return (<TimeGrid contentWidth={MINUTES_PER_DAY} height={Math.min(56 * dates.length, 336)} interactionPolicy={interactionPolicy} intervals={createTimeGridIntervals(events, dates, timeZone)} lanes={dates.map((date) => ({ height: 56, id: formatCalendarDate(date) }))} onIntervalPress={(interval) => activateEvent(interval.id)} overscanPixels={0} renderInterval={(interval) => (<Text variant="caption">{eventById.get(interval.id)?.title}</Text>)} renderLaneLabel={(lane) => (<Text variant="caption">
117
+ {formatDayLabel(parseCalendarDate(lane.id) ?? displayedDate, locale)}
118
+ </Text>)} testID={withTestId(testID, view)} width={320}/>);
82
119
  }
83
- /*** Produces the ordered weekday labels for one local calendar week. */
120
+ /*** Produces weekday labels for one local calendar week. */
84
121
  function createWeekdayLabels(locale, weekStartsOn) {
85
122
  const formatter = new Intl.DateTimeFormat(locale, { weekday: 'short' });
86
- const sunday = new Date(2023, 0, 1);
87
- return Array.from({ length: GRID_COLUMNS }, (_, index) => {
88
- const day = new Date(sunday.getFullYear(), sunday.getMonth(), sunday.getDate() + ((weekStartsOn + index) % GRID_COLUMNS));
89
- return { id: String(index), label: formatter.format(day) };
90
- });
123
+ return Array.from({ length: GRID_COLUMNS }, (_, index) => ({
124
+ id: String(index),
125
+ label: formatter.format(addDays(new Date(2023, 0, 1), (weekStartsOn + index) % GRID_COLUMNS)),
126
+ }));
127
+ }
128
+ /*** Creates the visible local dates for a week view. */
129
+ function createWeek(date, weekStartsOn) {
130
+ const first = addDays(date, -((date.getDay() - weekStartsOn + GRID_COLUMNS) % GRID_COLUMNS));
131
+ return Array.from({ length: GRID_COLUMNS }, (_, index) => addDays(first, index));
132
+ }
133
+ /*** Indexes events by each displayed local date they intersect in the Calendar timezone. */
134
+ function createEventsByDate(events, dates, timeZone) {
135
+ return new Map(dates.map((date) => [
136
+ formatCalendarDate(date),
137
+ events.filter((event) => eventIntersectsDate(event, formatCalendarDate(date), timeZone)),
138
+ ]));
139
+ }
140
+ /*** Maps timed events into TimeGrid lane-local minute coordinates. */
141
+ function createTimeGridIntervals(events, dates, timeZone) {
142
+ return dates.flatMap((date) => events.flatMap((event) => {
143
+ const dateId = formatCalendarDate(date);
144
+ if (!isTemporalTimedEvent(event))
145
+ return [];
146
+ if (!eventIntersectsDate(event, dateId, timeZone))
147
+ return [];
148
+ const zone = timeZone ?? event.range.timeZone;
149
+ const start = getZonedDateTimeParts(event.range.start, zone);
150
+ const end = getZonedDateTimeParts(resolveTimedEnd(event), zone);
151
+ const startMinute = start.date === dateId ? start.hour * 60 + start.minute : 0;
152
+ const endMinute = end.date === dateId ? end.hour * 60 + end.minute : MINUTES_PER_DAY;
153
+ return [
154
+ {
155
+ extent: Math.max(1, endMinute - startMinute),
156
+ id: event.id,
157
+ laneId: dateId,
158
+ start: startMinute,
159
+ },
160
+ ];
161
+ }));
162
+ }
163
+ /*** Reports whether an event overlaps one local Calendar date. */
164
+ function eventIntersectsDate(event, date, timeZone) {
165
+ if (!isTemporalTimedEvent(event))
166
+ return (event.range.start <= date &&
167
+ date < (event.range.end ?? addDaysToDate(event.range.start, event.range.duration)));
168
+ const zone = timeZone ?? event.range.timeZone;
169
+ return (getZonedDateTimeParts(event.range.start, zone).date <= date &&
170
+ date <= getZonedDateTimeParts(resolveTimedEnd(event), zone).date);
171
+ }
172
+ /*** Narrows a serializable Calendar event to the instant-based timed variant. */
173
+ function isTemporalTimedEvent(event) {
174
+ return event.range.allDay === false;
175
+ }
176
+ /*** Resolves the exclusive timed end, including the existing duration alternative. */
177
+ function resolveTimedEnd(event) {
178
+ return (event.range.end ??
179
+ new Date(Date.parse(event.range.start) + parseDurationMinutes(event.range.duration) * 60_000).toISOString());
180
+ }
181
+ /*** Reads a UTC instant as a local date and wall-clock time in an IANA timezone. */
182
+ function getZonedDateTimeParts(instant, timeZone) {
183
+ const parts = new Intl.DateTimeFormat('en-CA', {
184
+ day: '2-digit',
185
+ hour: '2-digit',
186
+ hourCycle: 'h23',
187
+ minute: '2-digit',
188
+ month: '2-digit',
189
+ timeZone,
190
+ year: 'numeric',
191
+ }).formatToParts(new Date(instant));
192
+ const values = Object.fromEntries(parts.map((part) => [part.type, part.value]));
193
+ return {
194
+ date: `${values.year}-${values.month}-${values.day}`,
195
+ hour: Number(values.hour),
196
+ minute: Number(values.minute),
197
+ };
91
198
  }
92
- /*** Moves a local month without carrying a day-of-month overflow into the target month. */
199
+ /*** Parses the bounded hour-and-minute duration form used for Calendar placement. */
200
+ function parseDurationMinutes(duration) {
201
+ const match = /^PT(?:(\d+)H)?(?:(\d+)M)?$/.exec(duration ?? 'PT60M');
202
+ return match ? Number(match[1] ?? 0) * 60 + Number(match[2] ?? 0) : 60;
203
+ }
204
+ /*** Adds a date-only duration without introducing a timezone. */
205
+ function addDaysToDate(start, duration) {
206
+ return formatCalendarDate(addDays(parseCalendarDate(start) ?? new Date(), Math.max(1, Math.ceil(parseDurationMinutes(duration) / MINUTES_PER_DAY))));
207
+ }
208
+ /*** Parses a local YYYY-MM-DD date without UTC conversion. */
209
+ function parseCalendarDate(value) {
210
+ if (!value || !/^\d{4}-\d{2}-\d{2}$/.test(value))
211
+ return undefined;
212
+ const [year, month, day] = value.split('-').map(Number);
213
+ return year === undefined || month === undefined || day === undefined
214
+ ? undefined
215
+ : new Date(year, month - 1, day);
216
+ }
217
+ /*** Moves a local calendar day. */
218
+ function addDays(date, count) {
219
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate() + count);
220
+ }
221
+ /*** Moves a local month without day overflow. */
93
222
  function addMonths(month, count) {
94
- return new Date(month.getFullYear(), month.getMonth() + count, 1);
223
+ const year = month.getFullYear();
224
+ const targetMonth = month.getMonth() + count;
225
+ const lastDay = new Date(year, targetMonth + 1, 0).getDate();
226
+ return new Date(year, targetMonth, Math.min(month.getDate(), lastDay));
95
227
  }
96
228
  /*** Normalizes a value to the first local day of its month. */
97
229
  function startOfLocalMonth(value) {
98
230
  return new Date(value.getFullYear(), value.getMonth(), 1);
99
231
  }
232
+ /*** Normalizes a value to its local calendar date. */
233
+ function startOfLocalDay(value) {
234
+ return new Date(value.getFullYear(), value.getMonth(), value.getDate());
235
+ }
100
236
  /*** Formats a Date as a timezone-independent local calendar identifier. */
101
237
  function formatCalendarDate(value) {
102
- const year = String(value.getFullYear()).padStart(4, '0');
103
- const month = String(value.getMonth() + 1).padStart(2, '0');
104
- const day = String(value.getDate()).padStart(2, '0');
105
- return `${year}-${month}-${day}`;
238
+ return `${String(value.getFullYear()).padStart(4, '0')}-${String(value.getMonth() + 1).padStart(2, '0')}-${String(value.getDate()).padStart(2, '0')}`;
106
239
  }
107
240
  /*** Compares local calendar dates using their canonical date-only identifiers. */
108
- function compareLocalDates(left, right) {
109
- return formatCalendarDate(left).localeCompare(formatCalendarDate(right));
110
- }
111
- /*** Reports whether a candidate month contains at least one date inside the configured range. */
112
- function monthIntersectsRange(month, minDate, maxDate) {
113
- const first = startOfLocalMonth(month);
114
- const last = new Date(first.getFullYear(), first.getMonth() + 1, 0);
115
- return ((!minDate || compareLocalDates(last, minDate) >= 0) &&
116
- (!maxDate || compareLocalDates(first, maxDate) <= 0));
117
- }
118
- /*** Reports whether two values identify the same local calendar day. */
119
241
  function isSameLocalDay(left, right) {
120
242
  return formatCalendarDate(left) === formatCalendarDate(right);
121
243
  }
122
- /*** Formats a display month with the caller's locale. */
123
- function formatMonthLabel(value, locale) {
124
- return new Intl.DateTimeFormat(locale, { month: 'long', year: 'numeric' }).format(value);
244
+ /*** Formats the controlled view title. */
245
+ function formatViewLabel(value, locale, view) {
246
+ return new Intl.DateTimeFormat(locale, view === 'month'
247
+ ? { month: 'long', year: 'numeric' }
248
+ : { day: 'numeric', month: 'short', year: 'numeric' }).format(value);
249
+ }
250
+ /*** Formats a compact lane label for day and week views. */
251
+ function formatDayLabel(value, locale) {
252
+ return new Intl.DateTimeFormat(locale, { day: 'numeric', weekday: 'short' }).format(value);
253
+ }
254
+ /*** Resolves a test identifier suffix only when a test root is provided. */
255
+ function withTestId(testID, suffix) {
256
+ return testID === undefined ? undefined : `${testID}-${suffix}`;
125
257
  }
126
258
  //# sourceMappingURL=Calendar.js.map