@ankhorage/zora 28.11.2 → 28.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +1 -1
- package/dist/capabilities/index.js +9 -1
- package/dist/capabilities/index.js.map +3 -3
- package/dist/features/button/adapters/inbound/Button.d.ts.map +1 -1
- package/dist/features/button/adapters/inbound/Button.js +4 -2
- package/dist/features/button/adapters/inbound/Button.js.map +1 -1
- package/dist/features/data-table/adapters/inbound/DataTable.d.ts.map +1 -1
- package/dist/features/data-table/adapters/inbound/DataTable.js +32 -20
- package/dist/features/data-table/adapters/inbound/DataTable.js.map +1 -1
- package/dist/features/data-table/dataTableMeta.d.ts +14 -0
- package/dist/features/data-table/dataTableMeta.d.ts.map +1 -1
- package/dist/features/data-table/dataTableMeta.js +8 -0
- package/dist/features/data-table/dataTableMeta.js.map +1 -1
- package/dist/features/layout/adapters/inbound/Screen.d.ts.map +1 -1
- package/dist/features/layout/adapters/inbound/Screen.js +2 -2
- package/dist/features/layout/adapters/inbound/Screen.js.map +1 -1
- package/dist/features/master-detail/adapters/inbound/MasterDetail.js +14 -11
- package/dist/features/master-detail/adapters/inbound/MasterDetail.js.map +1 -1
- package/dist/features/registry/bindableComponentMeta.d.ts +14 -0
- package/dist/features/registry/bindableComponentMeta.d.ts.map +1 -1
- package/dist/features/registry/bindableComponentMeta.js +8 -0
- package/dist/features/registry/bindableComponentMeta.js.map +1 -1
- package/dist/features/selection/adapters/inbound/RuntimeAuthoringOverlay.d.ts.map +1 -1
- package/dist/features/selection/adapters/inbound/RuntimeAuthoringOverlay.js +8 -19
- package/dist/features/selection/adapters/inbound/RuntimeAuthoringOverlay.js.map +1 -1
- package/dist/features/typography/adapters/inbound/Heading.d.ts.map +1 -1
- package/dist/features/typography/adapters/inbound/Heading.js +4 -2
- package/dist/features/typography/adapters/inbound/Heading.js.map +1 -1
- package/dist/features/typography/adapters/inbound/Text.d.ts.map +1 -1
- package/dist/features/typography/adapters/inbound/Text.js +4 -2
- package/dist/features/typography/adapters/inbound/Text.js.map +1 -1
- package/dist/types/data-table.d.ts +2 -0
- package/dist/types/data-table.d.ts.map +1 -1
- package/dist/types/data-table.js.map +1 -1
- package/dist/types/heading.d.ts +3 -0
- package/dist/types/heading.d.ts.map +1 -1
- package/dist/types/heading.js.map +1 -1
- package/dist/types/layout.d.ts +2 -0
- package/dist/types/layout.d.ts.map +1 -1
- package/dist/types/layout.js.map +1 -1
- package/dist/types/master-detail.d.ts +3 -0
- package/dist/types/master-detail.d.ts.map +1 -1
- package/dist/types/master-detail.js.map +1 -1
- package/dist/types/text.d.ts +3 -0
- package/dist/types/text.d.ts.map +1 -1
- package/dist/types/text.js.map +1 -1
- package/package.json +2 -2
- package/src/features/button/adapters/inbound/Button.tsx +9 -1
- package/src/features/calendar/adapters/inbound/Calendar.interaction.test.tsx +54 -15
- package/src/features/data-table/adapters/inbound/DataTable.test.tsx +52 -5
- package/src/features/data-table/adapters/inbound/DataTable.tsx +79 -64
- package/src/features/data-table/dataTableMeta.ts +9 -0
- package/src/features/layout/adapters/inbound/Screen.tsx +2 -0
- package/src/features/list/adapters/inbound/virtualizedLists.test.tsx +1 -0
- package/src/features/master-detail/adapters/inbound/MasterDetail.runtime.test.tsx +29 -1
- package/src/features/master-detail/adapters/inbound/MasterDetail.tsx +62 -10
- package/src/features/matrix-grid/adapters/inbound/MatrixGrid.protected-focus.test.tsx +47 -12
- package/src/features/matrix-grid/adapters/inbound/MatrixGrid.test.tsx +58 -1
- package/src/features/registry/bindableComponentMeta.ts +9 -0
- package/src/features/selection/adapters/inbound/RuntimeAuthoringOverlay.test.tsx +24 -10
- package/src/features/selection/adapters/inbound/RuntimeAuthoringOverlay.tsx +10 -32
- package/src/features/typography/adapters/inbound/Heading.tsx +9 -1
- package/src/features/typography/adapters/inbound/Text.tsx +9 -1
- package/src/types/data-table.ts +2 -0
- package/src/types/heading.ts +3 -0
- package/src/types/layout.ts +2 -0
- package/src/types/master-detail.ts +3 -0
- package/src/types/text.ts +3 -0
- package/src/webPackageExports.test.ts +35 -5
- package/web-dist/authoring/index.d.ts +2 -2
- package/web-dist/authoring/index.js +5 -5
- package/web-dist/chunks/{Accordion-cah5j61y.js → Accordion-0khxr0bc.js} +1 -1
- package/web-dist/chunks/{Accordion-zagrbkq1.js → Accordion-0zg7bp65.js} +1 -1
- package/web-dist/chunks/{Accordion-h2rnzgyv.js → Accordion-13qdzpsw.js} +2 -2
- package/web-dist/chunks/{Accordion-gy3bx3xa.js → Accordion-1dv9qy83.js} +1 -1
- package/web-dist/chunks/{Accordion-7eysykr1.js → Accordion-215f8pzb.js} +6 -4
- package/web-dist/chunks/{Accordion-b1tqkxx6.js → Accordion-2khy77a4.js} +2 -2
- package/web-dist/chunks/{Accordion-5x4cv0kv.js → Accordion-31xdsdbt.js} +15 -2
- package/web-dist/chunks/{Accordion-qz6ddnmv.js → Accordion-451n4t9y.js} +2 -2
- package/web-dist/chunks/{Accordion-a8b6g53f.js → Accordion-4e5wzq5h.js} +5 -3
- package/web-dist/chunks/{Accordion-w4zh2nws.js → Accordion-5hs2x3mg.js} +8 -6
- package/web-dist/chunks/{Accordion-ajqj6ymg.js → Accordion-5ry809w9.js} +2 -2
- package/web-dist/chunks/Accordion-63x9gd07.js +21 -0
- package/web-dist/chunks/{Accordion-a0hbjxg9.js → Accordion-87rb2j42.js} +2 -2
- package/web-dist/chunks/{Accordion-nhf8zjt4.js → Accordion-8y0zdc9b.js} +1 -1
- package/web-dist/chunks/{Accordion-eysfka31.js → Accordion-9brxrdt0.js} +9 -7
- package/web-dist/chunks/{Accordion-et7xzm6k.js → Accordion-a3p5s8r5.js} +9 -7
- package/web-dist/chunks/{Accordion-vbh3xqv6.js → Accordion-b32cj447.js} +9 -4
- package/web-dist/chunks/{Accordion-afxbyvwp.js → Accordion-cx1wpv5h.js} +2 -2
- package/web-dist/chunks/{Accordion-p84h11ek.js → Accordion-e8e1qanc.js} +2 -2
- package/web-dist/chunks/{Accordion-ak6dvant.js → Accordion-fkdxf4za.js} +2 -2
- package/web-dist/chunks/{Accordion-mkd3k28h.js → Accordion-fx6h9j9b.js} +2 -2
- package/web-dist/chunks/{Accordion-dy1j2a7p.js → Accordion-hj2c784w.js} +4 -4
- package/web-dist/chunks/{Accordion-wkqemqjw.js → Accordion-j41dzcsm.js} +11 -10
- package/web-dist/chunks/{Accordion-e9jwetg7.js → Accordion-jf05jg7c.js} +2 -2
- package/web-dist/chunks/{Accordion-yannd7r3.js → Accordion-mb7bvv02.js} +2 -2
- package/web-dist/chunks/{Accordion-2b3sd76b.js → Accordion-n4pb4fxf.js} +1 -1
- package/web-dist/chunks/{Accordion-2kv6p7by.js → Accordion-ngp3wrcj.js} +22 -32
- package/web-dist/chunks/{Accordion-rv90tjqr.js → Accordion-r3s4hat8.js} +1 -1
- package/web-dist/chunks/{Accordion-x9sb23p3.js → Accordion-s6gkg1x4.js} +1 -1
- package/web-dist/chunks/{Accordion-95003ycq.js → Accordion-t3307xtr.js} +5 -5
- package/web-dist/chunks/{Accordion-th7yhwhf.js → Accordion-tchser6z.js} +6 -6
- package/web-dist/chunks/{Accordion-a49s4ywn.js → Accordion-tjdjcft9.js} +3 -3
- package/web-dist/chunks/{Accordion-ek0hh2nx.js → Accordion-v8296kpx.js} +5 -5
- package/web-dist/chunks/{Accordion-kxjjp03t.js → Accordion-xmstkrsz.js} +3 -3
- package/web-dist/chunks/{Accordion-zays65re.js → Accordion-y2vzyy2q.js} +4 -4
- package/web-dist/chunks/{Accordion-064hgrct.js → Accordion-znrwa5dy.js} +2 -2
- package/web-dist/chunks/{Accordion-dnfgtbq3.js → Accordion-zyjtbb0x.js} +8 -6
- package/web-dist/chunks/{RichTextClient-qd6gmm0x.js → RichTextClient-vvh5mm40.js} +12 -11
- package/web-dist/chunks/{Video.native-7zsbp5vg.js → Video.native-tth5fevy.js} +8 -7
- package/web-dist/components/accordion/Accordion.js +4 -3
- package/web-dist/components/accordion-item/AccordionItem.js +4 -3
- package/web-dist/components/app-bar/AppBar.js +7 -6
- package/web-dist/components/app-header/AppHeader.js +7 -6
- package/web-dist/components/app-shell/AppShell.js +2 -1
- package/web-dist/components/audio/Audio.js +8 -7
- package/web-dist/components/auth-screen/AuthScreen.js +8 -7
- package/web-dist/components/avatar/Avatar.js +4 -3
- package/web-dist/components/avatar-group/AvatarGroup.js +4 -3
- package/web-dist/components/barcode-scanner-view/BarcodeScannerView.js +8 -7
- package/web-dist/components/bottom-sheet/BottomSheet.js +3 -2
- package/web-dist/components/bottom-sheet-flat-list/BottomSheetFlatList.js +3 -2
- package/web-dist/components/bottom-sheet-scroll-view/BottomSheetScrollView.js +3 -2
- package/web-dist/components/bottom-sheet-section-list/BottomSheetSectionList.js +3 -2
- package/web-dist/components/bottom-sheet-view/BottomSheetView.js +3 -2
- package/web-dist/components/bottom-sheet-virtualized-list/BottomSheetVirtualizedList.js +3 -2
- package/web-dist/components/breadcrumbs/Breadcrumbs.js +7 -6
- package/web-dist/components/button/Button.js +4 -3
- package/web-dist/components/button-group/ButtonGroup.js +4 -3
- package/web-dist/components/calendar/Calendar.js +6 -5
- package/web-dist/components/camera-permission-view/CameraPermissionView.js +8 -7
- package/web-dist/components/card/Card.js +7 -6
- package/web-dist/components/chat-list-item/ChatListItem.js +5 -4
- package/web-dist/components/checkbox/Checkbox.js +4 -3
- package/web-dist/components/checkbox-group/CheckboxGroup.js +4 -3
- package/web-dist/components/chip/Chip.js +4 -3
- package/web-dist/components/chip-group/ChipGroup.js +4 -3
- package/web-dist/components/collection-editor/CollectionEditor.js +10 -9
- package/web-dist/components/color-hue-scale/ColorHueScale.js +12 -11
- package/web-dist/components/color-picker/ColorPicker.js +12 -11
- package/web-dist/components/color-tone/ColorTone.js +12 -11
- package/web-dist/components/color-wheel/ColorWheel.js +12 -11
- package/web-dist/components/content-rail/ContentRail.js +7 -6
- package/web-dist/components/data-table/DataTable.js +91 -74
- package/web-dist/components/data-table/DataTable.types-0.d.ts +2 -0
- package/web-dist/components/date-picker/DatePicker.js +9 -8
- package/web-dist/components/dialog/Dialog.js +4 -3
- package/web-dist/components/divider/Divider.js +2 -1
- package/web-dist/components/empty-state/EmptyState.js +9 -8
- package/web-dist/components/explorer/Explorer.js +5 -4
- package/web-dist/components/field/Field.js +4 -3
- package/web-dist/components/file-explorer/FileExplorer.js +5 -4
- package/web-dist/components/flat-list/FlatList.js +5 -4
- package/web-dist/components/flow-canvas/FlowCanvas.js +8 -7
- package/web-dist/components/forgot-password-form/ForgotPasswordForm.js +8 -7
- package/web-dist/components/form/Form.js +6 -5
- package/web-dist/components/form-actions/FormActions.js +6 -5
- package/web-dist/components/form-error/FormError.js +6 -5
- package/web-dist/components/game/Game.js +3 -2
- package/web-dist/components/game-entity/GameEntity.js +3 -2
- package/web-dist/components/game-field/GameField.js +3 -2
- package/web-dist/components/game-input-zone/GameInputZone.js +3 -2
- package/web-dist/components/game-measurement-probe/GameMeasurementProbe.js +3 -2
- package/web-dist/components/game-overlay/GameOverlay.js +3 -2
- package/web-dist/components/gradient/Gradient.js +3 -2
- package/web-dist/components/gradient-renderer-provider/GradientRendererProvider.js +3 -2
- package/web-dist/components/graph-node/GraphNode.js +8 -7
- package/web-dist/components/grid/Grid.js +2 -1
- package/web-dist/components/heading/Heading.js +2 -1
- package/web-dist/components/heading/Heading.types-0.d.ts +4 -0
- package/web-dist/components/hero/Hero.js +12 -10
- package/web-dist/components/icon-button/IconButton.js +4 -3
- package/web-dist/components/image/Image.js +3 -2
- package/web-dist/components/link/Link.js +2 -1
- package/web-dist/components/list/List.js +5 -4
- package/web-dist/components/list-item/ListItem.js +5 -4
- package/web-dist/components/list-section/ListSection.js +5 -4
- package/web-dist/components/master-detail/MasterDetail.js +21 -3
- package/web-dist/components/master-detail/MasterDetail.types-0.d.ts +4 -0
- package/web-dist/components/matrix-grid/MatrixGrid.js +1 -2
- package/web-dist/components/media-card/MediaCard.js +7 -6
- package/web-dist/components/media-explorer/MediaExplorer.js +5 -4
- package/web-dist/components/message-bubble/MessageBubble.js +5 -4
- package/web-dist/components/metric-card/MetricCard.js +7 -6
- package/web-dist/components/missing-element/MissingElement.js +3 -2
- package/web-dist/components/o-auth-provider-button/OAuthProviderButton.js +8 -7
- package/web-dist/components/o-auth-provider-list/OAuthProviderList.js +8 -7
- package/web-dist/components/otp-form/OtpForm.js +8 -7
- package/web-dist/components/pagination/Pagination.js +7 -6
- package/web-dist/components/palette-item/PaletteItem.js +7 -6
- package/web-dist/components/popover-menu/PopoverMenu.js +3 -2
- package/web-dist/components/post-card/PostCard.js +7 -6
- package/web-dist/components/product-card/ProductCard.js +7 -6
- package/web-dist/components/progress/Progress.js +4 -3
- package/web-dist/components/progress-ring/ProgressRing.js +4 -3
- package/web-dist/components/radio/Radio.js +4 -3
- package/web-dist/components/radio-group/RadioGroup.js +4 -3
- package/web-dist/components/rating/Rating.js +2 -1
- package/web-dist/components/reader/Reader.js +11 -10
- package/web-dist/components/rich-text/RichText.js +2 -2
- package/web-dist/components/runtime-authoring-overlay/RuntimeAuthoringOverlay.js +3 -6
- package/web-dist/components/scan-overlay/ScanOverlay.js +8 -7
- package/web-dist/components/screen/Screen.js +2 -1
- package/web-dist/components/screen/Screen.types-0.d.ts +4 -0
- package/web-dist/components/screen-section/ScreenSection.js +4 -3
- package/web-dist/components/scroll-view/ScrollView.js +2 -1
- package/web-dist/components/search-input/SearchInput.js +6 -5
- package/web-dist/components/section-header/SectionHeader.js +4 -3
- package/web-dist/components/section-list/SectionList.js +5 -4
- package/web-dist/components/select/Select.js +8 -7
- package/web-dist/components/selectable-item/SelectableItem.js +3 -6
- package/web-dist/components/selection-provider/SelectionProvider.js +3 -6
- package/web-dist/components/sign-in-form/SignInForm.js +8 -7
- package/web-dist/components/sign-up-form/SignUpForm.js +8 -7
- package/web-dist/components/skeleton/Skeleton.js +10 -9
- package/web-dist/components/skeleton-card/SkeletonCard.js +10 -9
- package/web-dist/components/skeleton-list/SkeletonList.js +10 -9
- package/web-dist/components/skeleton-text/SkeletonText.js +10 -9
- package/web-dist/components/text/Text.js +2 -1
- package/web-dist/components/text/Text.types-0.d.ts +4 -0
- package/web-dist/components/text-input/TextInput.js +5 -4
- package/web-dist/components/theme-mode-toggle/ThemeModeToggle.js +4 -3
- package/web-dist/components/time-picker/TimePicker.js +8 -7
- package/web-dist/components/timeline/Timeline.js +4 -3
- package/web-dist/components/toolbar/Toolbar.js +8 -7
- package/web-dist/components/tree-item/TreeItem.js +10 -9
- package/web-dist/components/uploader/Uploader.js +13 -12
- package/web-dist/components/video/Video.js +5 -4
- package/web-dist/components/view/View.js +2 -1
- package/web-dist/components/zora-web-style-sheet/ZoraWebStyleSheet.js +2 -1
- package/web-dist/manifest.json +626 -525
package/dist/types/layout.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../../src/types/layout.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n DividerProps as SurfaceDividerProps,\n GridProps as SurfaceGridProps,\n ScrollViewProps as SurfaceScrollViewProps,\n ViewProps as SurfaceViewProps,\n} from '@ankhorage/surface';\nimport type React from 'react';\n\nimport type { ZoraBaseProps } from './base';\n\nexport type ZoraContentWidth = 'narrow' | 'default' | 'wide';\n\nexport interface ViewProps extends ZoraBaseProps, Omit<SurfaceViewProps, 'mode' | 'themeId'> {}\nexport interface ScrollViewProps\n extends ZoraBaseProps, Omit<SurfaceScrollViewProps, 'mode' | 'testID' | 'themeId'> {}\nexport interface DividerProps\n extends ZoraBaseProps, Omit<SurfaceDividerProps, 'mode' | 'themeId'> {}\nexport interface GridProps extends ZoraBaseProps, Omit<SurfaceGridProps, 'mode' | 'themeId'> {}\n\nexport interface AppShellProps extends ZoraBaseProps {\n children?: React.ReactNode;\n header?: React.ReactNode;\n footer?: React.ReactNode;\n overlay?: React.ReactNode;\n}\n\nexport interface ScreenProps extends ZoraBaseProps {\n children?: React.ReactNode;\n footer?: React.ReactNode;\n scroll?: boolean;\n width?: ZoraContentWidth;\n}\n\n/** Exclusive-gesture coordination between a ZORA scroll container and its descendant surfaces. */\nexport interface ScrollGestureLock {\n /** Suspends scrolling until the returned release function runs; releasing twice is harmless. */\n readonly acquire: () => () => void;\n /** Reports whether this container currently has an active descendant gesture. */\n readonly isActive?: () => boolean;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../../src/types/layout.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n DividerProps as SurfaceDividerProps,\n GridProps as SurfaceGridProps,\n ScrollViewProps as SurfaceScrollViewProps,\n ViewProps as SurfaceViewProps,\n} from '@ankhorage/surface';\nimport type React from 'react';\n\nimport type { ZoraBaseProps } from './base';\n\nexport type ZoraContentWidth = 'narrow' | 'default' | 'wide';\n\nexport interface ViewProps extends ZoraBaseProps, Omit<SurfaceViewProps, 'mode' | 'themeId'> {}\nexport interface ScrollViewProps\n extends ZoraBaseProps, Omit<SurfaceScrollViewProps, 'mode' | 'testID' | 'themeId'> {}\nexport interface DividerProps\n extends ZoraBaseProps, Omit<SurfaceDividerProps, 'mode' | 'themeId'> {}\nexport interface GridProps extends ZoraBaseProps, Omit<SurfaceGridProps, 'mode' | 'themeId'> {}\n\nexport interface AppShellProps extends ZoraBaseProps {\n children?: React.ReactNode;\n header?: React.ReactNode;\n footer?: React.ReactNode;\n overlay?: React.ReactNode;\n}\n\nexport interface ScreenProps extends ZoraBaseProps {\n children?: React.ReactNode;\n footer?: React.ReactNode;\n scroll?: boolean;\n /** Internal authoring selection decoration applied to the bounded screen content host. */\n selectionDecoration?: SurfaceViewProps['selectionDecoration'];\n width?: ZoraContentWidth;\n}\n\n/** Exclusive-gesture coordination between a ZORA scroll container and its descendant surfaces. */\nexport interface ScrollGestureLock {\n /** Suspends scrolling until the returned release function runs; releasing twice is harmless. */\n readonly acquire: () => () => void;\n /** Reports whether this container currently has an active descendant gesture. */\n readonly isActive?: () => boolean;\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ViewProps as SurfaceViewProps } from '@ankhorage/surface';
|
|
1
2
|
import type React from 'react';
|
|
2
3
|
import type { ZoraBaseProps } from './base.js';
|
|
3
4
|
/** Identifies the compact pane selected by host-owned route state. */
|
|
@@ -21,5 +22,7 @@ export interface MasterDetailProps extends ZoraBaseProps {
|
|
|
21
22
|
masterScroll?: boolean;
|
|
22
23
|
/** Scrolls the detail pane. Set false for bounded content, such as a nested app, that owns its own scrolling. */
|
|
23
24
|
detailScroll?: boolean;
|
|
25
|
+
/** Internal authoring selection decoration applied to the active workspace host. */
|
|
26
|
+
selectionDecoration?: SurfaceViewProps['selectionDecoration'];
|
|
24
27
|
}
|
|
25
28
|
//# sourceMappingURL=master-detail.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"master-detail.d.ts","sourceRoot":"","sources":["../../src/types/master-detail.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5C,sEAAsE;AACtE,MAAM,MAAM,sBAAsB,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEzD,6EAA6E;AAC7E,MAAM,MAAM,uBAAuB,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEzD,kEAAkE;AAClE,MAAM,MAAM,uBAAuB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAExD;;;;GAIG;AACH,MAAM,WAAW,iBAAkB,SAAQ,aAAa;IACtD,kFAAkF;IAClF,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,UAAU,CAAC,EAAE,sBAAsB,CAAC;IACpC,WAAW,CAAC,EAAE,uBAAuB,CAAC;IACtC,WAAW,CAAC,EAAE,uBAAuB,CAAC;IACtC,0FAA0F;IAC1F,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,iHAAiH;IACjH,YAAY,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"master-detail.d.ts","sourceRoot":"","sources":["../../src/types/master-detail.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5C,sEAAsE;AACtE,MAAM,MAAM,sBAAsB,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEzD,6EAA6E;AAC7E,MAAM,MAAM,uBAAuB,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEzD,kEAAkE;AAClE,MAAM,MAAM,uBAAuB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAExD;;;;GAIG;AACH,MAAM,WAAW,iBAAkB,SAAQ,aAAa;IACtD,kFAAkF;IAClF,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,UAAU,CAAC,EAAE,sBAAsB,CAAC;IACpC,WAAW,CAAC,EAAE,uBAAuB,CAAC;IACtC,WAAW,CAAC,EAAE,uBAAuB,CAAC;IACtC,0FAA0F;IAC1F,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,iHAAiH;IACjH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,oFAAoF;IACpF,mBAAmB,CAAC,EAAE,gBAAgB,CAAC,qBAAqB,CAAC,CAAC;CAC/D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"master-detail.js","sourceRoot":"","sources":["../../src/types/master-detail.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nimport type { ZoraBaseProps } from './base';\n\n/** Identifies the compact pane selected by host-owned route state. */\nexport type MasterDetailActivePane = 'master' | 'detail';\n\n/** Controls the expanded-width presentation without changing route state. */\nexport type MasterDetailDesktopMode = 'split' | 'master';\n\n/** Limits the master column to readable workspace proportions. */\nexport type MasterDetailMasterWidth = 25 | 30 | 35 | 40;\n\n/**\n * Presentation-only workspace composition. Place it as a direct child of a non-scrolling Screen\n * so its panes own bounded scrolling. The host supplies activePane from its route state; ZORA\n * never creates routes or handles back navigation.\n */\nexport interface MasterDetailProps extends ZoraBaseProps {\n /** The first child is the master pane and the second child is the detail pane. */\n children?: React.ReactNode;\n activePane?: MasterDetailActivePane;\n desktopMode?: MasterDetailDesktopMode;\n masterWidth?: MasterDetailMasterWidth;\n /** Scrolls the master pane. Set false for bounded content that owns its own scrolling. */\n masterScroll?: boolean;\n /** Scrolls the detail pane. Set false for bounded content, such as a nested app, that owns its own scrolling. */\n detailScroll?: boolean;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"master-detail.js","sourceRoot":"","sources":["../../src/types/master-detail.ts"],"names":[],"mappings":"","sourcesContent":["import type { ViewProps as SurfaceViewProps } from '@ankhorage/surface';\nimport type React from 'react';\n\nimport type { ZoraBaseProps } from './base';\n\n/** Identifies the compact pane selected by host-owned route state. */\nexport type MasterDetailActivePane = 'master' | 'detail';\n\n/** Controls the expanded-width presentation without changing route state. */\nexport type MasterDetailDesktopMode = 'split' | 'master';\n\n/** Limits the master column to readable workspace proportions. */\nexport type MasterDetailMasterWidth = 25 | 30 | 35 | 40;\n\n/**\n * Presentation-only workspace composition. Place it as a direct child of a non-scrolling Screen\n * so its panes own bounded scrolling. The host supplies activePane from its route state; ZORA\n * never creates routes or handles back navigation.\n */\nexport interface MasterDetailProps extends ZoraBaseProps {\n /** The first child is the master pane and the second child is the detail pane. */\n children?: React.ReactNode;\n activePane?: MasterDetailActivePane;\n desktopMode?: MasterDetailDesktopMode;\n masterWidth?: MasterDetailMasterWidth;\n /** Scrolls the master pane. Set false for bounded content that owns its own scrolling. */\n masterScroll?: boolean;\n /** Scrolls the detail pane. Set false for bounded content, such as a nested app, that owns its own scrolling. */\n detailScroll?: boolean;\n /** Internal authoring selection decoration applied to the active workspace host. */\n selectionDecoration?: SurfaceViewProps['selectionDecoration'];\n}\n"]}
|
package/dist/types/text.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Responsive } from '@ankhorage/surface';
|
|
2
|
+
import type { ViewProps as SurfaceViewProps } from '@ankhorage/surface';
|
|
2
3
|
import type React from 'react';
|
|
3
4
|
import type { AccessibilityRole, StyleProp, TextProps as ReactNativeTextProps, TextStyle } from 'react-native';
|
|
4
5
|
import type { ZoraBaseProps } from './base.js';
|
|
@@ -27,5 +28,7 @@ export interface TextProps extends ZoraBaseProps {
|
|
|
27
28
|
accessibilityRole?: AccessibilityRole;
|
|
28
29
|
accessibilityLiveRegion?: ReactNativeTextProps['accessibilityLiveRegion'];
|
|
29
30
|
nativeID?: string;
|
|
31
|
+
/** Internal authoring selection decoration applied to the text host. */
|
|
32
|
+
selectionDecoration?: SurfaceViewProps['selectionDecoration'];
|
|
30
33
|
}
|
|
31
34
|
//# sourceMappingURL=text.d.ts.map
|
package/dist/types/text.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../src/types/text.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EACV,iBAAiB,EACjB,SAAS,EACT,SAAS,IAAI,oBAAoB,EACjC,SAAS,EACV,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvD,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAEnG,MAAM,MAAM,SAAS,GAAG,SAAS,CAAC;AAClC,MAAM,MAAM,YAAY,GAAG,YAAY,CAAC;AAExC,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAC;AAEpE,MAAM,MAAM,SAAS,GAAG,WAAW,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC;AAE5D,MAAM,WAAW,SAAU,SAAQ,aAAa;IAC9C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;IAClC,KAAK,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAC9B,QAAQ,CAAC,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;IACpC,KAAK,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAC9B,MAAM,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;IAChC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;IACpD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,uBAAuB,CAAC,EAAE,oBAAoB,CAAC,yBAAyB,CAAC,CAAC;IAC1E,QAAQ,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../src/types/text.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EACV,iBAAiB,EACjB,SAAS,EACT,SAAS,IAAI,oBAAoB,EACjC,SAAS,EACV,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvD,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAEnG,MAAM,MAAM,SAAS,GAAG,SAAS,CAAC;AAClC,MAAM,MAAM,YAAY,GAAG,YAAY,CAAC;AAExC,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAC;AAEpE,MAAM,MAAM,SAAS,GAAG,WAAW,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC;AAE5D,MAAM,WAAW,SAAU,SAAQ,aAAa;IAC9C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;IAClC,KAAK,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAC9B,QAAQ,CAAC,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;IACpC,KAAK,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAC9B,MAAM,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;IAChC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;IACpD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,uBAAuB,CAAC,EAAE,oBAAoB,CAAC,yBAAyB,CAAC,CAAC;IAC1E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wEAAwE;IACxE,mBAAmB,CAAC,EAAE,gBAAgB,CAAC,qBAAqB,CAAC,CAAC;CAC/D"}
|
package/dist/types/text.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../src/types/text.ts"],"names":[],"mappings":"","sourcesContent":["import type { Responsive } from '@ankhorage/surface';\nimport type React from 'react';\nimport type {\n AccessibilityRole,\n StyleProp,\n TextProps as ReactNativeTextProps,\n TextStyle,\n} from 'react-native';\n\nimport type { ZoraBaseProps } from './base';\nimport type { ZoraColor, ZoraEmphasis } from './theme';\n\nexport type TextVariant = 'body' | 'lead' | 'bodySmall' | 'caption' | 'label' | 'eyebrow' | 'code';\n\nexport type TextColor = ZoraColor;\nexport type TextEmphasis = ZoraEmphasis;\n\nexport type TextWeight = 'regular' | 'medium' | 'semiBold' | 'bold';\n\nexport type TextAlign = NonNullable<TextStyle['textAlign']>;\n\nexport interface TextProps extends ZoraBaseProps {\n children?: React.ReactNode;\n text?: string;\n i18nKey?: string;\n variant?: Responsive<TextVariant>;\n color?: Responsive<TextColor>;\n emphasis?: Responsive<TextEmphasis>;\n align?: Responsive<TextAlign>;\n weight?: Responsive<TextWeight>;\n italic?: boolean;\n numberOfLines?: number;\n ellipsizeMode?: 'head' | 'middle' | 'tail' | 'clip';\n selectable?: boolean;\n style?: StyleProp<TextStyle>;\n accessibilityLabel?: string;\n accessibilityHint?: string;\n accessibilityRole?: AccessibilityRole;\n accessibilityLiveRegion?: ReactNativeTextProps['accessibilityLiveRegion'];\n nativeID?: string;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../src/types/text.ts"],"names":[],"mappings":"","sourcesContent":["import type { Responsive } from '@ankhorage/surface';\nimport type { ViewProps as SurfaceViewProps } from '@ankhorage/surface';\nimport type React from 'react';\nimport type {\n AccessibilityRole,\n StyleProp,\n TextProps as ReactNativeTextProps,\n TextStyle,\n} from 'react-native';\n\nimport type { ZoraBaseProps } from './base';\nimport type { ZoraColor, ZoraEmphasis } from './theme';\n\nexport type TextVariant = 'body' | 'lead' | 'bodySmall' | 'caption' | 'label' | 'eyebrow' | 'code';\n\nexport type TextColor = ZoraColor;\nexport type TextEmphasis = ZoraEmphasis;\n\nexport type TextWeight = 'regular' | 'medium' | 'semiBold' | 'bold';\n\nexport type TextAlign = NonNullable<TextStyle['textAlign']>;\n\nexport interface TextProps extends ZoraBaseProps {\n children?: React.ReactNode;\n text?: string;\n i18nKey?: string;\n variant?: Responsive<TextVariant>;\n color?: Responsive<TextColor>;\n emphasis?: Responsive<TextEmphasis>;\n align?: Responsive<TextAlign>;\n weight?: Responsive<TextWeight>;\n italic?: boolean;\n numberOfLines?: number;\n ellipsizeMode?: 'head' | 'middle' | 'tail' | 'clip';\n selectable?: boolean;\n style?: StyleProp<TextStyle>;\n accessibilityLabel?: string;\n accessibilityHint?: string;\n accessibilityRole?: AccessibilityRole;\n accessibilityLiveRegion?: ReactNativeTextProps['accessibilityLiveRegion'];\n nativeID?: string;\n /** Internal authoring selection decoration applied to the text host. */\n selectionDecoration?: SurfaceViewProps['selectionDecoration'];\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/zora",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "28.
|
|
4
|
+
"version": "28.12.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": {
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@ankhorage/grid-view": "^0.5.0",
|
|
51
51
|
"@ankhorage/reader": "^0.1.4",
|
|
52
52
|
"@ankhorage/runtime": "^5.8.4",
|
|
53
|
-
"@ankhorage/surface": "^9.
|
|
53
|
+
"@ankhorage/surface": "^9.9.0",
|
|
54
54
|
"@ankhorage/utility": "^1.11.0",
|
|
55
55
|
"expo-asset": "~57.0.21",
|
|
56
56
|
"expo-audio": "~57.0.5",
|
|
@@ -2,6 +2,7 @@ import { Button as SurfaceButton } from '@ankhorage/surface';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
4
|
import type { ButtonProps } from '../../../../types/button';
|
|
5
|
+
import { View } from '../../../layout/public';
|
|
5
6
|
import { withZoraThemeScope } from '../../../theme/adapters/inbound/withZoraThemeScope';
|
|
6
7
|
import { useZoraThemeRecipe } from '../../../theme/composition/useZoraThemeRecipe';
|
|
7
8
|
import { resolveButtonThemeRecipe } from '../../utils/resolveButtonThemeRecipe';
|
|
@@ -22,12 +23,13 @@ function ButtonInner({
|
|
|
22
23
|
variant,
|
|
23
24
|
size,
|
|
24
25
|
interactionPolicy,
|
|
26
|
+
selectionDecoration,
|
|
25
27
|
...props
|
|
26
28
|
}: ButtonProps) {
|
|
27
29
|
const themeFields = useZoraThemeRecipe(buttonThemeRecipeMeta);
|
|
28
30
|
const recipe = resolveButtonThemeRecipe({ color, variant, size, themeFields });
|
|
29
31
|
|
|
30
|
-
|
|
32
|
+
const rendered = (
|
|
31
33
|
<SurfaceButton
|
|
32
34
|
{...props}
|
|
33
35
|
color={recipe.color}
|
|
@@ -36,4 +38,10 @@ function ButtonInner({
|
|
|
36
38
|
interactionPolicy={interactionPolicy}
|
|
37
39
|
/>
|
|
38
40
|
);
|
|
41
|
+
|
|
42
|
+
return selectionDecoration === undefined ? (
|
|
43
|
+
rendered
|
|
44
|
+
) : (
|
|
45
|
+
<View selectionDecoration={selectionDecoration}>{rendered}</View>
|
|
46
|
+
);
|
|
39
47
|
}
|
|
@@ -16,12 +16,56 @@ import type { ZoraProvider as ZoraProviderComponent } from '../../../theme/runti
|
|
|
16
16
|
import type { Calendar as CalendarComponent } from './Calendar';
|
|
17
17
|
|
|
18
18
|
const webDistRoot = join(import.meta.dir, '../../../../../web-dist');
|
|
19
|
+
let browserArtifact: Promise<BrowserArtifact> | undefined;
|
|
20
|
+
|
|
21
|
+
interface BrowserArtifact {
|
|
22
|
+
readonly Calendar: typeof CalendarComponent;
|
|
23
|
+
readonly ZoraProvider: typeof ZoraProviderComponent;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/*** Load the generated Calendar and provider through one browser-conditioned module graph. */
|
|
27
|
+
async function loadCalendar() {
|
|
28
|
+
browserArtifact ??= buildBrowserArtifact();
|
|
29
|
+
return browserArtifact;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/*** Bundle existing generated artifacts with browser dependency resolution for Bun's DOM assertions. */
|
|
33
|
+
async function buildBrowserArtifact(): Promise<BrowserArtifact> {
|
|
34
|
+
const entryPath = join(webDistRoot, '.calendar-browser-entry.mjs');
|
|
35
|
+
const outputPath = join(webDistRoot, '.calendar-browser-test.mjs');
|
|
36
|
+
await Bun.write(
|
|
37
|
+
entryPath,
|
|
38
|
+
"export { Calendar } from './components/calendar/index.js';\nexport { ZoraProvider } from './runtime/ZoraProvider.js';\n",
|
|
39
|
+
);
|
|
40
|
+
const build = await Bun.build({
|
|
41
|
+
entrypoints: [entryPath],
|
|
42
|
+
conditions: ['browser', 'import', 'default'],
|
|
43
|
+
external: ['react', 'react/*', 'react-dom', 'react-dom/*', 'react-native-web'],
|
|
44
|
+
format: 'esm',
|
|
45
|
+
minifyWhitespace: true,
|
|
46
|
+
outfile: outputPath,
|
|
47
|
+
plugins: [
|
|
48
|
+
{
|
|
49
|
+
name: 'calendar-browser-react-native-alias',
|
|
50
|
+
setup(builder) {
|
|
51
|
+
builder.onResolve({ filter: /^react-native$/u }, () => ({
|
|
52
|
+
external: true,
|
|
53
|
+
path: 'react-native-web',
|
|
54
|
+
}));
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
target: 'browser',
|
|
59
|
+
write: true,
|
|
60
|
+
});
|
|
61
|
+
if (!build.success || !build.outputs[0])
|
|
62
|
+
throw new Error(build.logs.map((log) => log.message).join('\n'));
|
|
63
|
+
await Bun.write(outputPath, build.outputs[0]);
|
|
64
|
+
return (await import(pathToFileURL(outputPath).href)) as BrowserArtifact;
|
|
65
|
+
}
|
|
19
66
|
|
|
20
67
|
test('selects adjacent days through the locked GridView in regular and compact calendars', async () => {
|
|
21
|
-
const
|
|
22
|
-
import(pathToFileURL(join(webDistRoot, 'components', 'calendar', 'index.js')).href),
|
|
23
|
-
import(pathToFileURL(join(webDistRoot, 'runtime/ZoraProvider.js')).href),
|
|
24
|
-
])) as [{ Calendar: typeof CalendarComponent }, { ZoraProvider: typeof ZoraProviderComponent }];
|
|
68
|
+
const { Calendar, ZoraProvider } = await loadCalendar();
|
|
25
69
|
|
|
26
70
|
await withBrowserAsync(async (host) => {
|
|
27
71
|
const selections: string[] = [];
|
|
@@ -82,10 +126,7 @@ test('selects adjacent days through the locked GridView in regular and compact c
|
|
|
82
126
|
});
|
|
83
127
|
|
|
84
128
|
test('renders responsive day columns, a time axis, and activatable event cards in a direct week Calendar', async () => {
|
|
85
|
-
const
|
|
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 }];
|
|
129
|
+
const { Calendar, ZoraProvider } = await loadCalendar();
|
|
89
130
|
|
|
90
131
|
await withBrowserAsync(async (host) => {
|
|
91
132
|
const activations: string[] = [];
|
|
@@ -109,6 +150,7 @@ test('renders responsive day columns, a time axis, and activatable event cards i
|
|
|
109
150
|
title: 'Planning',
|
|
110
151
|
},
|
|
111
152
|
]}
|
|
153
|
+
locale="en-US"
|
|
112
154
|
onEventActivate={({ eventId }) => activations.push(eventId)}
|
|
113
155
|
testID="direct-week-calendar"
|
|
114
156
|
timeZone="Europe/Zurich"
|
|
@@ -126,7 +168,7 @@ test('renders responsive day columns, a time axis, and activatable event cards i
|
|
|
126
168
|
);
|
|
127
169
|
if (!grid || !event) throw new Error('Missing responsive week Calendar grid or event card');
|
|
128
170
|
|
|
129
|
-
expect(host.textContent).
|
|
171
|
+
expect(host.textContent).toMatch(/Mon 30|30 Mon/);
|
|
130
172
|
expect(host.textContent).toContain('Planning');
|
|
131
173
|
expect(grid.getAttribute('style')).not.toContain('width: 320px');
|
|
132
174
|
await interactAsync(() => event.click());
|
|
@@ -138,14 +180,11 @@ test('renders responsive day columns, a time axis, and activatable event cards i
|
|
|
138
180
|
});
|
|
139
181
|
|
|
140
182
|
test('renders a Calendar manifest and reactively updates its controlled date and events', async () => {
|
|
141
|
-
const
|
|
142
|
-
import(pathToFileURL(join(webDistRoot, 'components', 'calendar', 'index.js')).href),
|
|
143
|
-
import(pathToFileURL(join(webDistRoot, 'runtime/ZoraProvider.js')).href),
|
|
144
|
-
])) as [{ Calendar: typeof CalendarComponent }, { ZoraProvider: typeof ZoraProviderComponent }];
|
|
183
|
+
const { Calendar, ZoraProvider } = await loadCalendar();
|
|
145
184
|
const node = {
|
|
146
185
|
id: 'calendar',
|
|
147
186
|
type: 'Calendar',
|
|
148
|
-
props: { testID: 'manifest-calendar', view: 'week' },
|
|
187
|
+
props: { locale: 'en-US', testID: 'manifest-calendar', view: 'week' },
|
|
149
188
|
} as const satisfies UiNode;
|
|
150
189
|
const bindings = {
|
|
151
190
|
calendar: {
|
|
@@ -212,7 +251,7 @@ test('renders a Calendar manifest and reactively updates its controlled date and
|
|
|
212
251
|
try {
|
|
213
252
|
await interactAsync(render);
|
|
214
253
|
expect(host.textContent).toContain('Zurich');
|
|
215
|
-
expect(host.textContent).
|
|
254
|
+
expect(host.textContent).toMatch(/Fri 4|4 Fri/);
|
|
216
255
|
expect(
|
|
217
256
|
host.querySelector('[data-testid="manifest-calendar-week-grid-viewport"]'),
|
|
218
257
|
).not.toBeNull();
|
|
@@ -40,14 +40,21 @@ await mock.module('react-native', () => ({
|
|
|
40
40
|
accessibilityLabel,
|
|
41
41
|
accessibilityRole,
|
|
42
42
|
children,
|
|
43
|
+
disabled,
|
|
43
44
|
onPress,
|
|
44
45
|
}: {
|
|
45
46
|
accessibilityLabel?: string;
|
|
46
47
|
accessibilityRole?: string;
|
|
47
48
|
children?: React.ReactNode;
|
|
48
|
-
|
|
49
|
+
disabled?: boolean;
|
|
50
|
+
onPress?: (event: { stopPropagation: () => void }) => void;
|
|
49
51
|
}) => (
|
|
50
|
-
<button
|
|
52
|
+
<button
|
|
53
|
+
aria-label={accessibilityLabel}
|
|
54
|
+
disabled={disabled}
|
|
55
|
+
onClick={(event) => onPress?.(event)}
|
|
56
|
+
role={accessibilityRole}
|
|
57
|
+
>
|
|
51
58
|
{children}
|
|
52
59
|
</button>
|
|
53
60
|
),
|
|
@@ -63,15 +70,19 @@ await mock.module('../../../button/public', () => ({
|
|
|
63
70
|
}));
|
|
64
71
|
await mock.module('../../../card/public', () => ({
|
|
65
72
|
Card: ({
|
|
73
|
+
accessibilityLabel,
|
|
66
74
|
actions,
|
|
67
75
|
children,
|
|
76
|
+
onPress,
|
|
68
77
|
title,
|
|
69
78
|
}: {
|
|
79
|
+
accessibilityLabel?: string;
|
|
70
80
|
actions?: React.ReactNode;
|
|
71
81
|
children?: React.ReactNode;
|
|
82
|
+
onPress?: () => void;
|
|
72
83
|
title?: React.ReactNode;
|
|
73
84
|
}) => (
|
|
74
|
-
<div>
|
|
85
|
+
<div aria-label={accessibilityLabel} onClick={onPress} role={onPress ? 'button' : undefined}>
|
|
75
86
|
{title}
|
|
76
87
|
{actions}
|
|
77
88
|
{children}
|
|
@@ -117,7 +128,11 @@ await mock.module('../../../image/public', () => ({
|
|
|
117
128
|
Image: ({ alt, source }: { alt?: string; source?: string }) => <img alt={alt} src={source} />,
|
|
118
129
|
}));
|
|
119
130
|
await mock.module('../../../layout/public', () => ({ View }));
|
|
120
|
-
await mock.module('../../../popover-menu/public', () => ({
|
|
131
|
+
await mock.module('../../../popover-menu/public', () => ({
|
|
132
|
+
PopoverMenu: ({ trigger }: { trigger: (input: { toggle: () => void }) => React.ReactNode }) => (
|
|
133
|
+
<>{trigger({ toggle: () => undefined })}</>
|
|
134
|
+
),
|
|
135
|
+
}));
|
|
121
136
|
await mock.module('../../../skeleton/public', () => ({ SkeletonList: View }));
|
|
122
137
|
await mock.module('../../../theme/adapters/inbound/withZoraThemeScope', () => ({
|
|
123
138
|
withZoraThemeScope: <P,>(Component: React.ComponentType<P>) => Component,
|
|
@@ -208,6 +223,7 @@ test('uses stable row identities for controlled checkbox and all-visible selecti
|
|
|
208
223
|
/>,
|
|
209
224
|
);
|
|
210
225
|
expect(all?.getAttribute('aria-checked')).toBe('true');
|
|
226
|
+
expect(mounted.host.querySelector('[aria-label="Activate row acme"]')).toBeNull();
|
|
211
227
|
expect(mounted.host.textContent).not.toContain('Actions');
|
|
212
228
|
expect(mounted.host.innerHTML).not.toContain('min-width: 720px');
|
|
213
229
|
expect(mounted.host.innerHTML).not.toContain('min-width: 140px');
|
|
@@ -358,7 +374,7 @@ test('uses desktop stable row ids and the controlled callback in mobile cards',
|
|
|
358
374
|
'{"selectedRowIds":["company-acme","company-zora"]}',
|
|
359
375
|
);
|
|
360
376
|
|
|
361
|
-
const activation = mounted.host.querySelector<
|
|
377
|
+
const activation = mounted.host.querySelector<HTMLElement>(
|
|
362
378
|
'[aria-label="Activate row company-acme"]',
|
|
363
379
|
);
|
|
364
380
|
activation?.click();
|
|
@@ -370,6 +386,37 @@ test('uses desktop stable row ids and the controlled callback in mobile cards',
|
|
|
370
386
|
const companyLink = mounted.host.querySelector<HTMLButtonElement>('[role="link"]');
|
|
371
387
|
companyLink?.click();
|
|
372
388
|
expect(openedUrls).toEqual(['https://acme.test']);
|
|
389
|
+
expect(activationEvents).toEqual([{ rowId: 'company-acme' }]);
|
|
390
|
+
} finally {
|
|
391
|
+
mobilePresentation = false;
|
|
392
|
+
await mounted.unmount();
|
|
393
|
+
mounted.host.remove();
|
|
394
|
+
}
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
test('keeps mobile row activation and row actions independent', async () => {
|
|
398
|
+
mobilePresentation = true;
|
|
399
|
+
const mounted = mount();
|
|
400
|
+
const activationEvents: { rowId: string }[] = [];
|
|
401
|
+
|
|
402
|
+
try {
|
|
403
|
+
await mounted.render(
|
|
404
|
+
<DataTable
|
|
405
|
+
columns={[{ accessor: 'name', header: 'Company', id: 'company' }]}
|
|
406
|
+
onRowActivate={(event) => activationEvents.push(event)}
|
|
407
|
+
rowActions={() => [{ id: 'archive', onPress: () => undefined, title: 'Archive' }]}
|
|
408
|
+
rowKey="id"
|
|
409
|
+
rows={[{ id: 'acme', name: 'Acme' }]}
|
|
410
|
+
/>,
|
|
411
|
+
);
|
|
412
|
+
|
|
413
|
+
mounted.host.querySelector<HTMLButtonElement>('[aria-label="Row actions"]')?.click();
|
|
414
|
+
expect(activationEvents).toEqual([]);
|
|
415
|
+
|
|
416
|
+
const row = mounted.host.querySelector<HTMLDivElement>('[aria-label="Activate row acme"]');
|
|
417
|
+
expect(row?.getAttribute('role')).toBe('button');
|
|
418
|
+
row?.click();
|
|
419
|
+
expect(activationEvents).toEqual([{ rowId: 'acme' }]);
|
|
373
420
|
} finally {
|
|
374
421
|
mobilePresentation = false;
|
|
375
422
|
await mounted.unmount();
|
|
@@ -152,7 +152,13 @@ function renderPortableCell<TRow extends object>(
|
|
|
152
152
|
const label = resolveCellString(resolveCellField(row, cell.label ?? cell.href)) ?? href;
|
|
153
153
|
const externalUrl = href ? resolveExternalWebsiteUrl(href) : undefined;
|
|
154
154
|
return externalUrl ? (
|
|
155
|
-
<Pressable
|
|
155
|
+
<Pressable
|
|
156
|
+
accessibilityRole="link"
|
|
157
|
+
onPress={(event) => {
|
|
158
|
+
event.stopPropagation();
|
|
159
|
+
openExternalUrl(externalUrl);
|
|
160
|
+
}}
|
|
161
|
+
>
|
|
156
162
|
<Text color="primary" variant={cell.variant ?? 'bodySmall'} weight="medium">
|
|
157
163
|
{label}
|
|
158
164
|
</Text>
|
|
@@ -396,6 +402,7 @@ function DataTableDesktop<TRow extends object>({
|
|
|
396
402
|
rowActions,
|
|
397
403
|
rowId,
|
|
398
404
|
rowKey,
|
|
405
|
+
activeRowId,
|
|
399
406
|
selectedRowIds,
|
|
400
407
|
onSelectedRowIdsChange,
|
|
401
408
|
onSelectionChange,
|
|
@@ -447,11 +454,12 @@ function DataTableDesktop<TRow extends object>({
|
|
|
447
454
|
{rows.map((row, rowIndex) => {
|
|
448
455
|
const currentRowId = resolveDataTableRowKey(row, rowIndex, rowKey, rowId);
|
|
449
456
|
const selected = selectedRowIdSet.has(currentRowId);
|
|
457
|
+
const active = activeRowId === currentRowId;
|
|
450
458
|
|
|
451
459
|
return (
|
|
452
460
|
<View
|
|
453
|
-
bg=
|
|
454
|
-
borderColor=
|
|
461
|
+
bg={active ? 'subtle' : 'surface'}
|
|
462
|
+
borderColor={active ? 'primary' : 'border'}
|
|
455
463
|
borderWidth={1}
|
|
456
464
|
key={currentRowId}
|
|
457
465
|
radius="m"
|
|
@@ -480,28 +488,41 @@ function DataTableDesktop<TRow extends object>({
|
|
|
480
488
|
/>
|
|
481
489
|
</View>
|
|
482
490
|
) : null}
|
|
483
|
-
<View direction="row" style={{ flexGrow: 1, flexShrink: 1 }}>
|
|
484
|
-
{columns.map((column) => (
|
|
485
|
-
<View
|
|
486
|
-
key={column.id}
|
|
487
|
-
px={padding.px}
|
|
488
|
-
py={padding.py}
|
|
489
|
-
style={resolveCellStyle(column)}
|
|
490
|
-
>
|
|
491
|
-
{renderTableCell(column, row, rowIndex)}
|
|
492
|
-
</View>
|
|
493
|
-
))}
|
|
494
|
-
</View>
|
|
495
491
|
{onRowActivate ? (
|
|
496
|
-
<
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
492
|
+
<Pressable
|
|
493
|
+
accessibilityLabel={`Activate row ${currentRowId}`}
|
|
494
|
+
accessibilityRole="button"
|
|
495
|
+
disabled={interactionPolicy === 'passive'}
|
|
500
496
|
onPress={() => onRowActivate({ rowId: currentRowId })}
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
497
|
+
style={{ flexGrow: 1, flexShrink: 1 }}
|
|
498
|
+
>
|
|
499
|
+
<View direction="row">
|
|
500
|
+
{columns.map((column) => (
|
|
501
|
+
<View
|
|
502
|
+
key={column.id}
|
|
503
|
+
px={padding.px}
|
|
504
|
+
py={padding.py}
|
|
505
|
+
style={resolveCellStyle(column)}
|
|
506
|
+
>
|
|
507
|
+
{renderTableCell(column, row, rowIndex)}
|
|
508
|
+
</View>
|
|
509
|
+
))}
|
|
510
|
+
</View>
|
|
511
|
+
</Pressable>
|
|
512
|
+
) : (
|
|
513
|
+
<View direction="row">
|
|
514
|
+
{columns.map((column) => (
|
|
515
|
+
<View
|
|
516
|
+
key={column.id}
|
|
517
|
+
px={padding.px}
|
|
518
|
+
py={padding.py}
|
|
519
|
+
style={resolveCellStyle(column)}
|
|
520
|
+
>
|
|
521
|
+
{renderTableCell(column, row, rowIndex)}
|
|
522
|
+
</View>
|
|
523
|
+
))}
|
|
524
|
+
</View>
|
|
525
|
+
)}
|
|
505
526
|
{hasRowActions ? (
|
|
506
527
|
<View
|
|
507
528
|
px={padding.px}
|
|
@@ -528,6 +549,7 @@ function DataTableMobile<TRow extends object>({
|
|
|
528
549
|
rowActions,
|
|
529
550
|
rowId,
|
|
530
551
|
rowKey,
|
|
552
|
+
activeRowId,
|
|
531
553
|
selectedRowIds,
|
|
532
554
|
onSelectedRowIdsChange,
|
|
533
555
|
onSelectionChange,
|
|
@@ -547,58 +569,23 @@ function DataTableMobile<TRow extends object>({
|
|
|
547
569
|
<View gap="s">
|
|
548
570
|
{rows.map((row, rowIndex) => {
|
|
549
571
|
const currentRowId = resolveDataTableRowKey(row, rowIndex, rowKey, rowId);
|
|
572
|
+
const active = activeRowId === currentRowId;
|
|
550
573
|
const title = primaryColumn
|
|
551
574
|
? renderCell(primaryColumn, row, rowIndex)
|
|
552
575
|
: `Row ${rowIndex + 1}`;
|
|
553
576
|
const actions = renderRowActions({ row, rowActions, rowIndex, testID, interactionPolicy });
|
|
554
|
-
const
|
|
555
|
-
<IconButton
|
|
556
|
-
icon={{ name: 'arrow-forward' }}
|
|
557
|
-
interactionPolicy={interactionPolicy}
|
|
558
|
-
label={`Activate row ${currentRowId}`}
|
|
559
|
-
onPress={() => onRowActivate({ rowId: currentRowId })}
|
|
560
|
-
size="s"
|
|
561
|
-
variant="ghost"
|
|
562
|
-
/>
|
|
563
|
-
) : null;
|
|
564
|
-
|
|
565
|
-
return (
|
|
577
|
+
const card = (
|
|
566
578
|
<Card
|
|
567
|
-
actions={
|
|
568
|
-
|
|
569
|
-
<View direction="row" gap="xs">
|
|
570
|
-
{rowActivation}
|
|
571
|
-
{actions}
|
|
572
|
-
</View>
|
|
573
|
-
) : null
|
|
574
|
-
}
|
|
579
|
+
actions={onRowActivate ? undefined : actions}
|
|
580
|
+
accessibilityLabel={onRowActivate ? `Activate row ${currentRowId}` : undefined}
|
|
575
581
|
compact
|
|
576
582
|
interactionPolicy={interactionPolicy}
|
|
577
|
-
|
|
583
|
+
onPress={onRowActivate ? () => onRowActivate({ rowId: currentRowId }) : undefined}
|
|
578
584
|
testID={testID ? `${testID}-card-${rowIndex}` : undefined}
|
|
579
585
|
title={title}
|
|
586
|
+
tone={active ? 'subtle' : undefined}
|
|
580
587
|
>
|
|
581
588
|
<View gap="s">
|
|
582
|
-
{selectionEnabled ? (
|
|
583
|
-
<Checkbox
|
|
584
|
-
accessibilityLabel={`Select row ${currentRowId}`}
|
|
585
|
-
checked={selectedRowIdSet.has(currentRowId)}
|
|
586
|
-
disabled={selectionDisabled}
|
|
587
|
-
interactionPolicy={interactionPolicy}
|
|
588
|
-
onCheckedChange={(nextSelected) => {
|
|
589
|
-
if (selectionDisabled) return;
|
|
590
|
-
emitSelectionChange(
|
|
591
|
-
resolveNextSelectedRowIds(
|
|
592
|
-
controlledSelectedRowIds,
|
|
593
|
-
currentRowId,
|
|
594
|
-
nextSelected,
|
|
595
|
-
),
|
|
596
|
-
onSelectedRowIdsChange,
|
|
597
|
-
onSelectionChange,
|
|
598
|
-
);
|
|
599
|
-
}}
|
|
600
|
-
/>
|
|
601
|
-
) : null}
|
|
602
589
|
{detailColumns.map((column) => (
|
|
603
590
|
<View gap="xxs" key={column.id}>
|
|
604
591
|
<Text emphasis="muted" variant="caption" weight="semiBold">
|
|
@@ -616,6 +603,34 @@ function DataTableMobile<TRow extends object>({
|
|
|
616
603
|
</View>
|
|
617
604
|
</Card>
|
|
618
605
|
);
|
|
606
|
+
return (
|
|
607
|
+
<View gap="s" key={currentRowId}>
|
|
608
|
+
{onRowActivate && actions ? (
|
|
609
|
+
<View align="flex-start" direction="row" gap="xs">
|
|
610
|
+
<View flex={1}>{card}</View>
|
|
611
|
+
{actions}
|
|
612
|
+
</View>
|
|
613
|
+
) : (
|
|
614
|
+
card
|
|
615
|
+
)}
|
|
616
|
+
{selectionEnabled ? (
|
|
617
|
+
<Checkbox
|
|
618
|
+
accessibilityLabel={`Select row ${currentRowId}`}
|
|
619
|
+
checked={selectedRowIdSet.has(currentRowId)}
|
|
620
|
+
disabled={selectionDisabled}
|
|
621
|
+
interactionPolicy={interactionPolicy}
|
|
622
|
+
onCheckedChange={(nextSelected) => {
|
|
623
|
+
if (selectionDisabled) return;
|
|
624
|
+
emitSelectionChange(
|
|
625
|
+
resolveNextSelectedRowIds(controlledSelectedRowIds, currentRowId, nextSelected),
|
|
626
|
+
onSelectedRowIdsChange,
|
|
627
|
+
onSelectionChange,
|
|
628
|
+
);
|
|
629
|
+
}}
|
|
630
|
+
/>
|
|
631
|
+
) : null}
|
|
632
|
+
</View>
|
|
633
|
+
);
|
|
619
634
|
})}
|
|
620
635
|
</View>
|
|
621
636
|
);
|
|
@@ -52,6 +52,14 @@ export const dataTableMeta = {
|
|
|
52
52
|
acceptsFallback: true,
|
|
53
53
|
acceptsTransforms: true,
|
|
54
54
|
},
|
|
55
|
+
activeRowId: {
|
|
56
|
+
label: 'Active row ID',
|
|
57
|
+
description:
|
|
58
|
+
'Controlled stable row identity visibly activated independently of checkbox selection.',
|
|
59
|
+
value: { type: 'string' },
|
|
60
|
+
acceptsFallback: true,
|
|
61
|
+
acceptsTransforms: true,
|
|
62
|
+
},
|
|
55
63
|
},
|
|
56
64
|
events: {
|
|
57
65
|
selectionChange: {
|
|
@@ -98,6 +106,7 @@ export const dataTableMeta = {
|
|
|
98
106
|
],
|
|
99
107
|
},
|
|
100
108
|
selectedRowIds: { type: 'array', category: 'Selection', label: 'Selected row IDs' },
|
|
109
|
+
activeRowId: { type: 'string', category: 'Selection', label: 'Active row ID' },
|
|
101
110
|
loading: { type: 'boolean', category: 'State' },
|
|
102
111
|
loadingRows: { type: 'number', category: 'State' },
|
|
103
112
|
emptyTitle: { type: 'string', category: 'Content' },
|
|
@@ -13,6 +13,7 @@ function ScreenInner({
|
|
|
13
13
|
children,
|
|
14
14
|
footer,
|
|
15
15
|
scroll = true,
|
|
16
|
+
selectionDecoration,
|
|
16
17
|
width = 'default',
|
|
17
18
|
testID,
|
|
18
19
|
}: ScreenProps) {
|
|
@@ -26,6 +27,7 @@ function ScreenInner({
|
|
|
26
27
|
minWidth={scroll ? undefined : 0}
|
|
27
28
|
px={{ base: 16, md: 24, lg: 32 }}
|
|
28
29
|
py="xl"
|
|
30
|
+
selectionDecoration={selectionDecoration}
|
|
29
31
|
testID={testID}
|
|
30
32
|
width="100%"
|
|
31
33
|
>
|
|
@@ -38,6 +38,7 @@ await mock.module('@ankhorage/surface', () => ({
|
|
|
38
38
|
resolveResponsive: <T,>(value: T) => value,
|
|
39
39
|
useResponsiveRuntime: () => ({ breakpoint: undefined }),
|
|
40
40
|
useTheme: () => ({ theme: {} }),
|
|
41
|
+
View: ({ children }: React.PropsWithChildren) => <>{children}</>,
|
|
41
42
|
}));
|
|
42
43
|
await mock.module('../../../layout/public', () => ({ Divider: () => null }));
|
|
43
44
|
|