@ankhorage/zora 18.0.0 → 19.0.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.
- package/CHANGELOG.md +12 -0
- package/README.md +1 -1
- package/dist/constants.d.ts +2 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +2 -1
- package/dist/constants.js.map +1 -1
- package/dist/corePluginMetadata.d.ts.map +1 -1
- package/dist/corePluginMetadata.js +1 -5
- package/dist/corePluginMetadata.js.map +1 -1
- package/dist/features/accordion/accordionItemMeta.d.ts +1 -1
- package/dist/features/bottom-sheet/bottomSheetMeta.d.ts +1 -1
- package/dist/features/card/cardMeta.d.ts +1 -1
- package/dist/features/card/mediaCardMeta.d.ts +1 -1
- package/dist/features/card/postCardMeta.d.ts +1 -1
- package/dist/{patterns/chat-list-item → features/chat/adapters/inbound}/ChatListItem.d.ts +1 -1
- package/dist/features/chat/adapters/inbound/ChatListItem.d.ts.map +1 -0
- package/dist/{patterns/chat-list-item → features/chat/adapters/inbound}/ChatListItem.js +9 -9
- package/dist/features/chat/adapters/inbound/ChatListItem.js.map +1 -0
- package/dist/{patterns/message-bubble → features/chat/adapters/inbound}/MessageBubble.d.ts +1 -1
- package/dist/features/chat/adapters/inbound/MessageBubble.d.ts.map +1 -0
- package/dist/{patterns/message-bubble → features/chat/adapters/inbound}/MessageBubble.js +8 -8
- package/dist/features/chat/adapters/inbound/MessageBubble.js.map +1 -0
- package/dist/{patterns/chat-list-item/meta.d.ts → features/chat/chatListItemMeta.d.ts} +1 -1
- package/dist/features/chat/chatListItemMeta.d.ts.map +1 -0
- package/dist/{patterns/chat-list-item/meta.js → features/chat/chatListItemMeta.js} +1 -1
- package/dist/features/chat/chatListItemMeta.js.map +1 -0
- package/dist/{patterns/message-bubble/meta.d.ts → features/chat/messageBubbleMeta.d.ts} +2 -2
- package/dist/features/chat/messageBubbleMeta.d.ts.map +1 -0
- package/dist/{patterns/message-bubble/meta.js → features/chat/messageBubbleMeta.js} +1 -1
- package/dist/features/chat/messageBubbleMeta.js.map +1 -0
- package/dist/features/chat/public.d.ts +4 -0
- package/dist/features/chat/public.d.ts.map +1 -0
- package/dist/features/chat/public.js +3 -0
- package/dist/features/chat/public.js.map +1 -0
- package/dist/features/chip/adapters/inbound/Chip.js +3 -3
- package/dist/features/chip/adapters/inbound/Chip.js.map +1 -1
- package/dist/{patterns/collection-editor → features/collection-editor/adapters/inbound}/CollectionEditor.d.ts +1 -1
- package/dist/features/collection-editor/adapters/inbound/CollectionEditor.d.ts.map +1 -0
- package/dist/{patterns/collection-editor → features/collection-editor/adapters/inbound}/CollectionEditor.js +8 -8
- package/dist/features/collection-editor/adapters/inbound/CollectionEditor.js.map +1 -0
- package/dist/features/collection-editor/meta.d.ts.map +1 -0
- package/dist/{patterns → features}/collection-editor/meta.js.map +1 -1
- package/dist/features/collection-editor/public.d.ts +3 -0
- package/dist/features/collection-editor/public.d.ts.map +1 -0
- package/dist/features/collection-editor/public.js +2 -0
- package/dist/features/collection-editor/public.js.map +1 -0
- package/dist/features/content-rail/contentRailMeta.d.ts +2 -2
- package/dist/features/dialog/dialogMeta.d.ts +2 -2
- package/dist/features/form/field/meta.d.ts +1 -1
- package/dist/features/form/field/meta.d.ts.map +1 -1
- package/dist/features/form/field/meta.js +1 -0
- package/dist/features/form/field/meta.js.map +1 -1
- package/dist/features/form/switch/adapters/inbound/Switch.d.ts +5 -0
- package/dist/features/form/switch/adapters/inbound/Switch.d.ts.map +1 -0
- package/dist/features/form/switch/adapters/inbound/Switch.js +9 -0
- package/dist/features/form/switch/adapters/inbound/Switch.js.map +1 -0
- package/dist/features/form/switch/public.d.ts +3 -0
- package/dist/features/form/switch/public.d.ts.map +1 -0
- package/dist/features/form/switch/public.js +2 -0
- package/dist/features/form/switch/public.js.map +1 -0
- package/dist/features/form/switch/switchMeta.d.ts +33 -0
- package/dist/features/form/switch/switchMeta.d.ts.map +1 -0
- package/dist/features/form/switch/switchMeta.js +13 -0
- package/dist/features/form/switch/switchMeta.js.map +1 -0
- package/dist/features/gradient/gradientMeta.d.ts +1 -1
- package/dist/features/keyboard-avoiding-view/keyboardAvoidingViewMeta.d.ts +1 -1
- package/dist/features/layout/gridMeta.d.ts +1 -1
- package/dist/features/layout/public.d.ts +1 -2
- package/dist/features/layout/public.d.ts.map +1 -1
- package/dist/features/layout/public.js +0 -1
- package/dist/features/layout/public.js.map +1 -1
- package/dist/features/layout/screenMeta.d.ts +1 -1
- package/dist/features/layout/scrollViewMeta.d.ts +1 -1
- package/dist/features/layout/viewMeta.d.ts +1 -1
- package/dist/features/list/adapters/inbound/ListSection.d.ts.map +1 -1
- package/dist/features/list/adapters/inbound/ListSection.js +1 -1
- package/dist/features/list/adapters/inbound/ListSection.js.map +1 -1
- package/dist/features/list/flatListMeta.d.ts +1 -1
- package/dist/features/list/sectionListMeta.d.ts +1 -1
- package/dist/{patterns/reader → features/reader/adapters/inbound}/ReaderSurface.d.ts +1 -1
- package/dist/features/reader/adapters/inbound/ReaderSurface.d.ts.map +1 -0
- package/dist/{patterns/reader → features/reader/adapters/inbound}/ReaderSurface.js +9 -9
- package/dist/features/reader/adapters/inbound/ReaderSurface.js.map +1 -0
- package/dist/{patterns → features}/reader/meta.d.ts +2 -2
- package/dist/{patterns → features}/reader/meta.d.ts.map +1 -1
- package/dist/{patterns → features}/reader/meta.js.map +1 -1
- package/dist/features/reader/public.d.ts +4 -0
- package/dist/features/reader/public.d.ts.map +1 -0
- package/dist/features/reader/public.js +3 -0
- package/dist/features/reader/public.js.map +1 -0
- package/dist/features/reader/utils/resolveReaderProgress.d.ts.map +1 -0
- package/dist/features/reader/utils/resolveReaderProgress.js.map +1 -0
- package/dist/{patterns/scanner → features/scanner/adapters/inbound}/BarcodeScannerView.d.ts +1 -1
- package/dist/features/scanner/adapters/inbound/BarcodeScannerView.d.ts.map +1 -0
- package/dist/{patterns/scanner → features/scanner/adapters/inbound}/BarcodeScannerView.js +5 -5
- package/dist/features/scanner/adapters/inbound/BarcodeScannerView.js.map +1 -0
- package/dist/{patterns/scanner → features/scanner/adapters/inbound}/CameraPermissionView.d.ts +1 -1
- package/dist/features/scanner/adapters/inbound/CameraPermissionView.d.ts.map +1 -0
- package/dist/{patterns/scanner → features/scanner/adapters/inbound}/CameraPermissionView.js +5 -5
- package/dist/features/scanner/adapters/inbound/CameraPermissionView.js.map +1 -0
- package/dist/{patterns/scanner → features/scanner/adapters/inbound}/ScanOverlay.d.ts +1 -1
- package/dist/features/scanner/adapters/inbound/ScanOverlay.d.ts.map +1 -0
- package/dist/{patterns/scanner → features/scanner/adapters/inbound}/ScanOverlay.js +5 -5
- package/dist/features/scanner/adapters/inbound/ScanOverlay.js.map +1 -0
- package/dist/{patterns → features}/scanner/meta.d.ts +2 -2
- package/dist/{patterns → features}/scanner/meta.d.ts.map +1 -1
- package/dist/{patterns → features}/scanner/meta.js.map +1 -1
- package/dist/features/scanner/public.d.ts +5 -0
- package/dist/features/scanner/public.d.ts.map +1 -0
- package/dist/features/scanner/public.js +4 -0
- package/dist/features/scanner/public.js.map +1 -0
- package/dist/features/{layout → section}/adapters/inbound/ScreenSection.d.ts +1 -1
- package/dist/features/section/adapters/inbound/ScreenSection.d.ts.map +1 -0
- package/dist/features/{layout → section}/adapters/inbound/ScreenSection.js +2 -2
- package/dist/features/section/adapters/inbound/ScreenSection.js.map +1 -0
- package/dist/{patterns/section-header → features/section/adapters/inbound}/SectionHeader.d.ts +1 -1
- package/dist/features/section/adapters/inbound/SectionHeader.d.ts.map +1 -0
- package/dist/{patterns/section-header → features/section/adapters/inbound}/SectionHeader.js +4 -4
- package/dist/features/section/adapters/inbound/SectionHeader.js.map +1 -0
- package/dist/features/section/public.d.ts +4 -0
- package/dist/features/section/public.d.ts.map +1 -0
- package/dist/features/section/public.js +3 -0
- package/dist/features/section/public.js.map +1 -0
- package/dist/features/{layout → section}/screenSectionMeta.d.ts +1 -1
- package/dist/features/section/screenSectionMeta.d.ts.map +1 -0
- package/dist/features/section/screenSectionMeta.js.map +1 -0
- package/dist/{patterns/section-header/meta.d.ts → features/section/sectionHeaderMeta.d.ts} +1 -1
- package/dist/features/section/sectionHeaderMeta.d.ts.map +1 -0
- package/dist/{patterns/section-header/meta.js → features/section/sectionHeaderMeta.js} +1 -1
- package/dist/features/section/sectionHeaderMeta.js.map +1 -0
- package/dist/{patterns/selection → features/selection/adapters/inbound}/SelectableItem.d.ts +1 -1
- package/dist/features/selection/adapters/inbound/SelectableItem.d.ts.map +1 -0
- package/dist/{patterns/selection → features/selection/adapters/inbound}/SelectableItem.js +4 -4
- package/dist/features/selection/adapters/inbound/SelectableItem.js.map +1 -0
- package/dist/{patterns/selection → features/selection/adapters/inbound}/SelectionProvider.d.ts +1 -1
- package/dist/features/selection/adapters/inbound/SelectionProvider.d.ts.map +1 -0
- package/dist/{patterns/selection → features/selection/adapters/inbound}/SelectionProvider.js +1 -1
- package/dist/features/selection/adapters/inbound/SelectionProvider.js.map +1 -0
- package/dist/{patterns → features}/selection/meta.d.ts.map +1 -1
- package/dist/{patterns → features}/selection/meta.js.map +1 -1
- package/dist/features/selection/public.d.ts +4 -0
- package/dist/features/selection/public.d.ts.map +1 -0
- package/dist/features/selection/public.js +3 -0
- package/dist/features/selection/public.js.map +1 -0
- package/dist/{patterns/selection → features/selection/utils}/resolveSelectionNextIds.d.ts +1 -1
- package/dist/features/selection/utils/resolveSelectionNextIds.d.ts.map +1 -0
- package/dist/features/selection/utils/resolveSelectionNextIds.js.map +1 -0
- package/dist/features/surface/surfaceMeta.d.ts +1 -1
- package/dist/features/tabs/tabPanelMeta.d.ts +1 -1
- package/dist/{patterns/timeline → features/timeline/adapters/inbound}/Timeline.d.ts +1 -1
- package/dist/features/timeline/adapters/inbound/Timeline.d.ts.map +1 -0
- package/dist/{patterns/timeline → features/timeline/adapters/inbound}/Timeline.js +7 -7
- package/dist/features/timeline/adapters/inbound/Timeline.js.map +1 -0
- package/dist/features/timeline/meta.d.ts.map +1 -0
- package/dist/{patterns → features}/timeline/meta.js.map +1 -1
- package/dist/features/timeline/public.d.ts +3 -0
- package/dist/features/timeline/public.d.ts.map +1 -0
- package/dist/features/timeline/public.js +2 -0
- package/dist/features/timeline/public.js.map +1 -0
- package/dist/{patterns/tree-view → features/tree-view/adapters/inbound}/TreeItem.d.ts +2 -2
- package/dist/features/tree-view/adapters/inbound/TreeItem.d.ts.map +1 -0
- package/dist/{patterns/tree-view → features/tree-view/adapters/inbound}/TreeItem.js +4 -4
- package/dist/features/tree-view/adapters/inbound/TreeItem.js.map +1 -0
- package/dist/{patterns/tree-view → features/tree-view/adapters/inbound}/TreeView.d.ts +1 -1
- package/dist/features/tree-view/adapters/inbound/TreeView.d.ts.map +1 -0
- package/dist/{patterns/tree-view → features/tree-view/adapters/inbound}/TreeView.js +2 -2
- package/dist/features/tree-view/adapters/inbound/TreeView.js.map +1 -0
- package/dist/{patterns → features}/tree-view/meta.d.ts.map +1 -1
- package/dist/{patterns → features}/tree-view/meta.js.map +1 -1
- package/dist/features/tree-view/public.d.ts +4 -0
- package/dist/features/tree-view/public.d.ts.map +1 -0
- package/dist/features/tree-view/public.js +3 -0
- package/dist/features/tree-view/public.js.map +1 -0
- package/dist/index.d.ts +18 -34
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -17
- package/dist/index.js.map +1 -1
- package/dist/metadata/allowedChildren.d.ts +4 -4
- package/dist/metadata/allowedChildren.d.ts.map +1 -1
- package/dist/metadata/allowedChildren.js +0 -3
- package/dist/metadata/allowedChildren.js.map +1 -1
- package/dist/metadata/bindableComponentMeta.d.ts +23 -23
- package/dist/metadata/bindableComponentMeta.d.ts.map +1 -1
- package/dist/metadata/bindableComponentMeta.js +20 -28
- package/dist/metadata/bindableComponentMeta.js.map +1 -1
- package/dist/metadata/componentMeta.d.ts.map +1 -1
- package/dist/metadata/componentMeta.js +12 -24
- package/dist/metadata/componentMeta.js.map +1 -1
- package/dist/metadata/themeRecipeMeta.d.ts.map +1 -1
- package/dist/metadata/themeRecipeMeta.js +0 -2
- package/dist/metadata/themeRecipeMeta.js.map +1 -1
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +11 -24
- package/dist/registry.js.map +1 -1
- package/dist/{patterns/message-bubble/types.d.ts → types/chat.d.ts} +29 -4
- package/dist/types/chat.d.ts.map +1 -0
- package/dist/types/chat.js +2 -0
- package/dist/types/chat.js.map +1 -0
- package/dist/{patterns/collection-editor/types.d.ts → types/collection-editor.d.ts} +2 -2
- package/dist/types/collection-editor.d.ts.map +1 -0
- package/dist/types/collection-editor.js +2 -0
- package/dist/types/collection-editor.js.map +1 -0
- package/dist/types/layout.d.ts +0 -6
- package/dist/types/layout.d.ts.map +1 -1
- package/dist/types/layout.js.map +1 -1
- package/dist/{patterns/reader/types.d.ts → types/reader.d.ts} +2 -2
- package/dist/types/reader.d.ts.map +1 -0
- package/dist/types/reader.js +2 -0
- package/dist/types/reader.js.map +1 -0
- package/dist/{patterns/scanner/types.d.ts → types/scanner.d.ts} +3 -3
- package/dist/types/scanner.d.ts.map +1 -0
- package/dist/types/scanner.js +2 -0
- package/dist/types/scanner.js.map +1 -0
- package/dist/types/section.d.ts +15 -0
- package/dist/types/section.d.ts.map +1 -0
- package/dist/types/section.js +2 -0
- package/dist/types/section.js.map +1 -0
- package/dist/{patterns/selection/types.d.ts → types/selection.d.ts} +1 -1
- package/dist/types/selection.d.ts.map +1 -0
- package/dist/types/selection.js +2 -0
- package/dist/types/selection.js.map +1 -0
- package/dist/types/switch.d.ts +5 -0
- package/dist/types/switch.d.ts.map +1 -0
- package/dist/types/switch.js +2 -0
- package/dist/types/switch.js.map +1 -0
- package/dist/{patterns/timeline/types.d.ts → types/timeline.d.ts} +3 -3
- package/dist/types/timeline.d.ts.map +1 -0
- package/dist/types/timeline.js +2 -0
- package/dist/types/timeline.js.map +1 -0
- package/dist/{patterns/tree-view/types.d.ts → types/tree-view.d.ts} +2 -2
- package/dist/types/tree-view.d.ts.map +1 -0
- package/dist/types/tree-view.js +2 -0
- package/dist/types/tree-view.js.map +1 -0
- package/package.json +2 -2
- package/src/audit.test.ts +3 -3
- package/src/constants.ts +2 -1
- package/src/corePluginMetadata.ts +1 -5
- package/src/featureManifest.test.ts +2 -1
- package/src/features/bottom-sheet/public.test.ts +1 -1
- package/src/{patterns/chat-list-item → features/chat/adapters/inbound}/ChatListItem.test.tsx +1 -1
- package/src/{patterns/chat-list-item → features/chat/adapters/inbound}/ChatListItem.tsx +10 -10
- package/src/{patterns/message-bubble → features/chat/adapters/inbound}/MessageBubble.tsx +9 -9
- package/src/features/chat/public.ts +11 -0
- package/src/features/chip/adapters/inbound/Chip.tsx +3 -3
- package/src/{patterns/collection-editor → features/collection-editor/adapters/inbound}/CollectionEditor.tsx +9 -9
- package/src/features/collection-editor/public.ts +5 -0
- package/src/features/form/field/meta.ts +1 -0
- package/src/features/form/switch/adapters/inbound/Switch.tsx +12 -0
- package/src/features/form/switch/public.ts +2 -0
- package/src/features/form/switch/switchMeta.ts +14 -0
- package/src/features/layout/public.test.ts +3 -11
- package/src/features/layout/public.ts +0 -2
- package/src/features/list/adapters/inbound/ListSection.tsx +1 -1
- package/src/features/missing-element/MissingElement.test.ts +2 -2
- package/src/{patterns/reader → features/reader/adapters/inbound}/ReaderSurface.test.ts +3 -3
- package/src/{patterns/reader → features/reader/adapters/inbound}/ReaderSurface.tsx +10 -10
- package/src/{patterns/reader/index.ts → features/reader/public.ts} +3 -3
- package/src/{patterns/scanner → features/scanner/adapters/inbound}/BarcodeScannerView.tsx +6 -6
- package/src/{patterns/scanner → features/scanner/adapters/inbound}/CameraPermissionView.tsx +6 -6
- package/src/{patterns/scanner → features/scanner/adapters/inbound}/ScanOverlay.tsx +6 -6
- package/src/features/scanner/public.ts +10 -0
- package/src/features/{layout → section}/adapters/inbound/ScreenSection.tsx +3 -3
- package/src/{patterns/section-header → features/section/adapters/inbound}/SectionHeader.tsx +5 -5
- package/src/features/section/public.ts +3 -0
- package/src/{patterns/selection → features/selection/adapters/inbound}/SelectableItem.tsx +9 -5
- package/src/{patterns/selection → features/selection/adapters/inbound}/SelectionProvider.tsx +12 -2
- package/src/features/selection/public.ts +10 -0
- package/src/{patterns/selection → features/selection/utils}/resolveSelectionNextIds.test.ts +1 -1
- package/src/{patterns/selection → features/selection/utils}/resolveSelectionNextIds.ts +1 -1
- package/src/{patterns/timeline → features/timeline/adapters/inbound}/Timeline.tsx +9 -9
- package/src/features/timeline/public.ts +2 -0
- package/src/{patterns/tree-view → features/tree-view/adapters/inbound}/TreeItem.tsx +6 -6
- package/src/{patterns/tree-view → features/tree-view/adapters/inbound}/TreeView.tsx +3 -3
- package/src/features/tree-view/public.ts +3 -0
- package/src/index.ts +58 -76
- package/src/interactionPolicy.test.ts +8 -12
- package/src/metadata/allowedChildren.ts +0 -3
- package/src/metadata/authoringMeta.test.ts +1 -1
- package/src/metadata/bindableComponentMeta.ts +20 -28
- package/src/metadata/componentMeta.test.ts +2 -3
- package/src/metadata/componentMeta.ts +16 -28
- package/src/metadata/radioGroupReachability.test.ts +0 -1
- package/src/metadata/themeRecipeMeta.test.ts +0 -1
- package/src/metadata/themeRecipeMeta.ts +0 -2
- package/src/platformAcceptance.test.ts +1 -1
- package/src/registry.ts +11 -32
- package/src/showcaseCoverage.test.ts +1 -7
- package/src/theme/themeScopeStructure.test.ts +13 -21
- package/src/{patterns/message-bubble/types.ts → types/chat.ts} +30 -3
- package/src/{patterns/collection-editor/types.ts → types/collection-editor.ts} +2 -2
- package/src/types/layout.ts +0 -7
- package/src/{patterns/reader/types.ts → types/reader.ts} +1 -1
- package/src/{patterns/scanner/types.ts → types/scanner.ts} +2 -2
- package/src/types/section.ts +17 -0
- package/src/types/switch.ts +5 -0
- package/src/{patterns/timeline/types.ts → types/timeline.ts} +2 -2
- package/src/{patterns/tree-view/types.ts → types/tree-view.ts} +1 -1
- package/dist/features/layout/adapters/inbound/ScreenSection.d.ts.map +0 -1
- package/dist/features/layout/adapters/inbound/ScreenSection.js.map +0 -1
- package/dist/features/layout/screenSectionMeta.d.ts.map +0 -1
- package/dist/features/layout/screenSectionMeta.js.map +0 -1
- package/dist/patterns/chat-list-item/ChatListItem.d.ts.map +0 -1
- package/dist/patterns/chat-list-item/ChatListItem.js.map +0 -1
- package/dist/patterns/chat-list-item/index.d.ts +0 -3
- package/dist/patterns/chat-list-item/index.d.ts.map +0 -1
- package/dist/patterns/chat-list-item/index.js +0 -2
- package/dist/patterns/chat-list-item/index.js.map +0 -1
- package/dist/patterns/chat-list-item/meta.d.ts.map +0 -1
- package/dist/patterns/chat-list-item/meta.js.map +0 -1
- package/dist/patterns/chat-list-item/types.d.ts +0 -31
- package/dist/patterns/chat-list-item/types.d.ts.map +0 -1
- package/dist/patterns/chat-list-item/types.js +0 -2
- package/dist/patterns/chat-list-item/types.js.map +0 -1
- package/dist/patterns/collection-editor/CollectionEditor.d.ts.map +0 -1
- package/dist/patterns/collection-editor/CollectionEditor.js.map +0 -1
- package/dist/patterns/collection-editor/index.d.ts +0 -3
- package/dist/patterns/collection-editor/index.d.ts.map +0 -1
- package/dist/patterns/collection-editor/index.js +0 -3
- package/dist/patterns/collection-editor/index.js.map +0 -1
- package/dist/patterns/collection-editor/meta.d.ts.map +0 -1
- package/dist/patterns/collection-editor/types.d.ts.map +0 -1
- package/dist/patterns/collection-editor/types.js +0 -2
- package/dist/patterns/collection-editor/types.js.map +0 -1
- package/dist/patterns/confirm-dialog/ConfirmDialog.d.ts +0 -9
- package/dist/patterns/confirm-dialog/ConfirmDialog.d.ts.map +0 -1
- package/dist/patterns/confirm-dialog/ConfirmDialog.js +0 -24
- package/dist/patterns/confirm-dialog/ConfirmDialog.js.map +0 -1
- package/dist/patterns/confirm-dialog/index.d.ts +0 -3
- package/dist/patterns/confirm-dialog/index.d.ts.map +0 -1
- package/dist/patterns/confirm-dialog/index.js +0 -2
- package/dist/patterns/confirm-dialog/index.js.map +0 -1
- package/dist/patterns/confirm-dialog/meta.d.ts +0 -9
- package/dist/patterns/confirm-dialog/meta.d.ts.map +0 -1
- package/dist/patterns/confirm-dialog/meta.js +0 -9
- package/dist/patterns/confirm-dialog/meta.js.map +0 -1
- package/dist/patterns/confirm-dialog/types.d.ts +0 -18
- package/dist/patterns/confirm-dialog/types.d.ts.map +0 -1
- package/dist/patterns/confirm-dialog/types.js +0 -2
- package/dist/patterns/confirm-dialog/types.js.map +0 -1
- package/dist/patterns/filter-bar/FilterBar.d.ts +0 -9
- package/dist/patterns/filter-bar/FilterBar.d.ts.map +0 -1
- package/dist/patterns/filter-bar/FilterBar.js +0 -17
- package/dist/patterns/filter-bar/FilterBar.js.map +0 -1
- package/dist/patterns/filter-bar/index.d.ts +0 -3
- package/dist/patterns/filter-bar/index.d.ts.map +0 -1
- package/dist/patterns/filter-bar/index.js +0 -2
- package/dist/patterns/filter-bar/index.js.map +0 -1
- package/dist/patterns/filter-bar/meta.d.ts +0 -9
- package/dist/patterns/filter-bar/meta.d.ts.map +0 -1
- package/dist/patterns/filter-bar/meta.js +0 -9
- package/dist/patterns/filter-bar/meta.js.map +0 -1
- package/dist/patterns/filter-bar/types.d.ts +0 -9
- package/dist/patterns/filter-bar/types.d.ts.map +0 -1
- package/dist/patterns/filter-bar/types.js +0 -2
- package/dist/patterns/filter-bar/types.js.map +0 -1
- package/dist/patterns/inspector-field/InspectorField.d.ts +0 -9
- package/dist/patterns/inspector-field/InspectorField.d.ts.map +0 -1
- package/dist/patterns/inspector-field/InspectorField.js +0 -19
- package/dist/patterns/inspector-field/InspectorField.js.map +0 -1
- package/dist/patterns/inspector-field/index.d.ts +0 -3
- package/dist/patterns/inspector-field/index.d.ts.map +0 -1
- package/dist/patterns/inspector-field/index.js +0 -3
- package/dist/patterns/inspector-field/index.js.map +0 -1
- package/dist/patterns/inspector-field/meta.d.ts +0 -9
- package/dist/patterns/inspector-field/meta.d.ts.map +0 -1
- package/dist/patterns/inspector-field/meta.js +0 -9
- package/dist/patterns/inspector-field/meta.js.map +0 -1
- package/dist/patterns/inspector-field/types.d.ts +0 -15
- package/dist/patterns/inspector-field/types.d.ts.map +0 -1
- package/dist/patterns/inspector-field/types.js +0 -2
- package/dist/patterns/inspector-field/types.js.map +0 -1
- package/dist/patterns/message-bubble/MessageBubble.d.ts.map +0 -1
- package/dist/patterns/message-bubble/MessageBubble.js.map +0 -1
- package/dist/patterns/message-bubble/index.d.ts +0 -3
- package/dist/patterns/message-bubble/index.d.ts.map +0 -1
- package/dist/patterns/message-bubble/index.js +0 -2
- package/dist/patterns/message-bubble/index.js.map +0 -1
- package/dist/patterns/message-bubble/meta.d.ts.map +0 -1
- package/dist/patterns/message-bubble/meta.js.map +0 -1
- package/dist/patterns/message-bubble/types.d.ts.map +0 -1
- package/dist/patterns/message-bubble/types.js +0 -2
- package/dist/patterns/message-bubble/types.js.map +0 -1
- package/dist/patterns/notice/Notice.d.ts +0 -9
- package/dist/patterns/notice/Notice.d.ts.map +0 -1
- package/dist/patterns/notice/Notice.js +0 -20
- package/dist/patterns/notice/Notice.js.map +0 -1
- package/dist/patterns/notice/index.d.ts +0 -3
- package/dist/patterns/notice/index.d.ts.map +0 -1
- package/dist/patterns/notice/index.js +0 -2
- package/dist/patterns/notice/index.js.map +0 -1
- package/dist/patterns/notice/meta.d.ts +0 -34
- package/dist/patterns/notice/meta.d.ts.map +0 -1
- package/dist/patterns/notice/meta.js +0 -35
- package/dist/patterns/notice/meta.js.map +0 -1
- package/dist/patterns/notice/types.d.ts +0 -11
- package/dist/patterns/notice/types.d.ts.map +0 -1
- package/dist/patterns/notice/types.js +0 -2
- package/dist/patterns/notice/types.js.map +0 -1
- package/dist/patterns/panel/Panel.d.ts +0 -7
- package/dist/patterns/panel/Panel.d.ts.map +0 -1
- package/dist/patterns/panel/Panel.js +0 -15
- package/dist/patterns/panel/Panel.js.map +0 -1
- package/dist/patterns/panel/index.d.ts +0 -3
- package/dist/patterns/panel/index.d.ts.map +0 -1
- package/dist/patterns/panel/index.js +0 -2
- package/dist/patterns/panel/index.js.map +0 -1
- package/dist/patterns/panel/meta.d.ts +0 -80
- package/dist/patterns/panel/meta.d.ts.map +0 -1
- package/dist/patterns/panel/meta.js +0 -49
- package/dist/patterns/panel/meta.js.map +0 -1
- package/dist/patterns/panel/themeRecipeMeta.d.ts +0 -31
- package/dist/patterns/panel/themeRecipeMeta.d.ts.map +0 -1
- package/dist/patterns/panel/themeRecipeMeta.js +0 -31
- package/dist/patterns/panel/themeRecipeMeta.js.map +0 -1
- package/dist/patterns/panel/types.d.ts +0 -16
- package/dist/patterns/panel/types.d.ts.map +0 -1
- package/dist/patterns/panel/types.js +0 -2
- package/dist/patterns/panel/types.js.map +0 -1
- package/dist/patterns/reader/ReaderSurface.d.ts.map +0 -1
- package/dist/patterns/reader/ReaderSurface.js.map +0 -1
- package/dist/patterns/reader/index.d.ts +0 -4
- package/dist/patterns/reader/index.d.ts.map +0 -1
- package/dist/patterns/reader/index.js +0 -3
- package/dist/patterns/reader/index.js.map +0 -1
- package/dist/patterns/reader/resolveReaderProgress.d.ts.map +0 -1
- package/dist/patterns/reader/resolveReaderProgress.js.map +0 -1
- package/dist/patterns/reader/types.d.ts.map +0 -1
- package/dist/patterns/reader/types.js +0 -2
- package/dist/patterns/reader/types.js.map +0 -1
- package/dist/patterns/scanner/BarcodeScannerView.d.ts.map +0 -1
- package/dist/patterns/scanner/BarcodeScannerView.js.map +0 -1
- package/dist/patterns/scanner/CameraPermissionView.d.ts.map +0 -1
- package/dist/patterns/scanner/CameraPermissionView.js.map +0 -1
- package/dist/patterns/scanner/ScanOverlay.d.ts.map +0 -1
- package/dist/patterns/scanner/ScanOverlay.js.map +0 -1
- package/dist/patterns/scanner/index.d.ts +0 -5
- package/dist/patterns/scanner/index.d.ts.map +0 -1
- package/dist/patterns/scanner/index.js +0 -4
- package/dist/patterns/scanner/index.js.map +0 -1
- package/dist/patterns/scanner/types.d.ts.map +0 -1
- package/dist/patterns/scanner/types.js +0 -2
- package/dist/patterns/scanner/types.js.map +0 -1
- package/dist/patterns/section-header/SectionHeader.d.ts.map +0 -1
- package/dist/patterns/section-header/SectionHeader.js.map +0 -1
- package/dist/patterns/section-header/index.d.ts +0 -3
- package/dist/patterns/section-header/index.d.ts.map +0 -1
- package/dist/patterns/section-header/index.js +0 -2
- package/dist/patterns/section-header/index.js.map +0 -1
- package/dist/patterns/section-header/meta.d.ts.map +0 -1
- package/dist/patterns/section-header/meta.js.map +0 -1
- package/dist/patterns/section-header/types.d.ts +0 -9
- package/dist/patterns/section-header/types.d.ts.map +0 -1
- package/dist/patterns/section-header/types.js +0 -2
- package/dist/patterns/section-header/types.js.map +0 -1
- package/dist/patterns/selection/SelectableItem.d.ts.map +0 -1
- package/dist/patterns/selection/SelectableItem.js.map +0 -1
- package/dist/patterns/selection/SelectionProvider.d.ts.map +0 -1
- package/dist/patterns/selection/SelectionProvider.js.map +0 -1
- package/dist/patterns/selection/index.d.ts +0 -4
- package/dist/patterns/selection/index.d.ts.map +0 -1
- package/dist/patterns/selection/index.js +0 -3
- package/dist/patterns/selection/index.js.map +0 -1
- package/dist/patterns/selection/resolveSelectionNextIds.d.ts.map +0 -1
- package/dist/patterns/selection/resolveSelectionNextIds.js.map +0 -1
- package/dist/patterns/selection/types.d.ts.map +0 -1
- package/dist/patterns/selection/types.js +0 -2
- package/dist/patterns/selection/types.js.map +0 -1
- package/dist/patterns/switch-field/SwitchField.d.ts +0 -8
- package/dist/patterns/switch-field/SwitchField.d.ts.map +0 -1
- package/dist/patterns/switch-field/SwitchField.js +0 -13
- package/dist/patterns/switch-field/SwitchField.js.map +0 -1
- package/dist/patterns/switch-field/index.d.ts +0 -3
- package/dist/patterns/switch-field/index.d.ts.map +0 -1
- package/dist/patterns/switch-field/index.js +0 -3
- package/dist/patterns/switch-field/index.js.map +0 -1
- package/dist/patterns/switch-field/meta.d.ts +0 -9
- package/dist/patterns/switch-field/meta.d.ts.map +0 -1
- package/dist/patterns/switch-field/meta.js +0 -9
- package/dist/patterns/switch-field/meta.js.map +0 -1
- package/dist/patterns/switch-field/types.d.ts +0 -10
- package/dist/patterns/switch-field/types.d.ts.map +0 -1
- package/dist/patterns/switch-field/types.js +0 -2
- package/dist/patterns/switch-field/types.js.map +0 -1
- package/dist/patterns/theme-composer/ThemeComposer.d.ts +0 -9
- package/dist/patterns/theme-composer/ThemeComposer.d.ts.map +0 -1
- package/dist/patterns/theme-composer/ThemeComposer.js +0 -217
- package/dist/patterns/theme-composer/ThemeComposer.js.map +0 -1
- package/dist/patterns/theme-composer/index.d.ts +0 -3
- package/dist/patterns/theme-composer/index.d.ts.map +0 -1
- package/dist/patterns/theme-composer/index.js +0 -2
- package/dist/patterns/theme-composer/index.js.map +0 -1
- package/dist/patterns/theme-composer/meta.d.ts +0 -9
- package/dist/patterns/theme-composer/meta.d.ts.map +0 -1
- package/dist/patterns/theme-composer/meta.js +0 -9
- package/dist/patterns/theme-composer/meta.js.map +0 -1
- package/dist/patterns/theme-composer/types.d.ts +0 -12
- package/dist/patterns/theme-composer/types.d.ts.map +0 -1
- package/dist/patterns/theme-composer/types.js +0 -2
- package/dist/patterns/theme-composer/types.js.map +0 -1
- package/dist/patterns/timeline/Timeline.d.ts.map +0 -1
- package/dist/patterns/timeline/Timeline.js.map +0 -1
- package/dist/patterns/timeline/index.d.ts +0 -3
- package/dist/patterns/timeline/index.d.ts.map +0 -1
- package/dist/patterns/timeline/index.js +0 -2
- package/dist/patterns/timeline/index.js.map +0 -1
- package/dist/patterns/timeline/meta.d.ts.map +0 -1
- package/dist/patterns/timeline/types.d.ts.map +0 -1
- package/dist/patterns/timeline/types.js +0 -2
- package/dist/patterns/timeline/types.js.map +0 -1
- package/dist/patterns/tree-view/TreeItem.d.ts.map +0 -1
- package/dist/patterns/tree-view/TreeItem.js.map +0 -1
- package/dist/patterns/tree-view/TreeView.d.ts.map +0 -1
- package/dist/patterns/tree-view/TreeView.js.map +0 -1
- package/dist/patterns/tree-view/index.d.ts +0 -4
- package/dist/patterns/tree-view/index.d.ts.map +0 -1
- package/dist/patterns/tree-view/index.js +0 -4
- package/dist/patterns/tree-view/index.js.map +0 -1
- package/dist/patterns/tree-view/types.d.ts.map +0 -1
- package/dist/patterns/tree-view/types.js +0 -2
- package/dist/patterns/tree-view/types.js.map +0 -1
- package/src/patterns/chat-list-item/index.ts +0 -2
- package/src/patterns/chat-list-item/types.ts +0 -33
- package/src/patterns/collection-editor/index.ts +0 -2
- package/src/patterns/confirm-dialog/ConfirmDialog.tsx +0 -69
- package/src/patterns/confirm-dialog/index.ts +0 -2
- package/src/patterns/confirm-dialog/meta.ts +0 -10
- package/src/patterns/confirm-dialog/types.ts +0 -19
- package/src/patterns/filter-bar/FilterBar.tsx +0 -31
- package/src/patterns/filter-bar/index.ts +0 -2
- package/src/patterns/filter-bar/meta.ts +0 -10
- package/src/patterns/filter-bar/types.ts +0 -10
- package/src/patterns/inspector-field/InspectorField.tsx +0 -32
- package/src/patterns/inspector-field/index.ts +0 -2
- package/src/patterns/inspector-field/meta.ts +0 -10
- package/src/patterns/inspector-field/types.ts +0 -16
- package/src/patterns/message-bubble/index.ts +0 -8
- package/src/patterns/notice/Notice.tsx +0 -41
- package/src/patterns/notice/index.ts +0 -2
- package/src/patterns/notice/meta.ts +0 -36
- package/src/patterns/notice/types.ts +0 -12
- package/src/patterns/panel/Panel.tsx +0 -26
- package/src/patterns/panel/index.ts +0 -2
- package/src/patterns/panel/meta.ts +0 -51
- package/src/patterns/panel/themeRecipeMeta.ts +0 -32
- package/src/patterns/panel/types.ts +0 -17
- package/src/patterns/scanner/index.ts +0 -10
- package/src/patterns/section-header/index.ts +0 -2
- package/src/patterns/section-header/types.ts +0 -10
- package/src/patterns/selection/index.ts +0 -10
- package/src/patterns/switch-field/SwitchField.tsx +0 -42
- package/src/patterns/switch-field/index.ts +0 -2
- package/src/patterns/switch-field/meta.ts +0 -10
- package/src/patterns/switch-field/types.ts +0 -11
- package/src/patterns/theme-composer/ThemeComposer.test.ts +0 -212
- package/src/patterns/theme-composer/ThemeComposer.tsx +0 -321
- package/src/patterns/theme-composer/index.ts +0 -2
- package/src/patterns/theme-composer/meta.ts +0 -10
- package/src/patterns/theme-composer/types.ts +0 -13
- package/src/patterns/timeline/index.ts +0 -2
- package/src/patterns/tree-view/index.ts +0 -3
- /package/dist/{patterns → features}/collection-editor/meta.d.ts +0 -0
- /package/dist/{patterns → features}/collection-editor/meta.js +0 -0
- /package/dist/{patterns → features}/reader/meta.js +0 -0
- /package/dist/{patterns/reader → features/reader/utils}/resolveReaderProgress.d.ts +0 -0
- /package/dist/{patterns/reader → features/reader/utils}/resolveReaderProgress.js +0 -0
- /package/dist/{patterns → features}/scanner/meta.js +0 -0
- /package/dist/features/{layout → section}/screenSectionMeta.js +0 -0
- /package/dist/{patterns → features}/selection/meta.d.ts +0 -0
- /package/dist/{patterns → features}/selection/meta.js +0 -0
- /package/dist/{patterns/selection → features/selection/utils}/resolveSelectionNextIds.js +0 -0
- /package/dist/{patterns → features}/timeline/meta.d.ts +0 -0
- /package/dist/{patterns → features}/timeline/meta.js +0 -0
- /package/dist/{patterns → features}/tree-view/meta.d.ts +0 -0
- /package/dist/{patterns → features}/tree-view/meta.js +0 -0
- /package/src/{patterns/chat-list-item/meta.ts → features/chat/chatListItemMeta.ts} +0 -0
- /package/src/{patterns/message-bubble/meta.ts → features/chat/messageBubbleMeta.ts} +0 -0
- /package/src/{patterns → features}/collection-editor/meta.ts +0 -0
- /package/src/{patterns → features}/reader/meta.ts +0 -0
- /package/src/{patterns/reader → features/reader/utils}/resolveReaderProgress.test.ts +0 -0
- /package/src/{patterns/reader → features/reader/utils}/resolveReaderProgress.ts +0 -0
- /package/src/{patterns → features}/scanner/meta.ts +0 -0
- /package/src/features/{layout → section}/screenSectionMeta.ts +0 -0
- /package/src/{patterns/section-header/meta.ts → features/section/sectionHeaderMeta.ts} +0 -0
- /package/src/{patterns → features}/selection/meta.ts +0 -0
- /package/src/{patterns → features}/timeline/meta.ts +0 -0
- /package/src/{patterns → features}/tree-view/meta.ts +0 -0
- /package/src/{patterns/selection/types.ts → types/selection.ts} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/patterns/scanner/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC","sourcesContent":["export { BarcodeScannerView } from './BarcodeScannerView';\nexport { CameraPermissionView } from './CameraPermissionView';\nexport { ScanOverlay } from './ScanOverlay';\nexport type {\n BarcodeScannerViewProps,\n BarcodeScanResult,\n CameraPermissionStatus,\n CameraPermissionViewProps,\n ScanOverlayProps,\n} from './types';\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/patterns/scanner/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,GAAG,QAAQ,CAAC;AAErF,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAiB,SAAQ,aAAa;IACrD,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC/B;AAED,MAAM,WAAW,yBAA0B,SAAQ,aAAa;IAC9D,MAAM,EAAE,OAAO,CAAC,sBAAsB,EAAE,SAAS,CAAC,CAAC;IACnD,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACx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C3C,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACxE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/patterns/scanner/types.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nimport type { ButtonProps } from '../../features/button/public';\nimport type { ZoraBaseProps } from '../../theme/ZoraBaseProps';\n\nexport type CameraPermissionStatus = 'unknown' | 'requesting' | 'granted' | 'denied';\n\nexport interface BarcodeScanResult {\n value: string;\n type?: string;\n}\n\nexport interface ScanOverlayProps extends ZoraBaseProps {\n title?: React.ReactNode;\n description?: React.ReactNode;\n cornerLabel?: React.ReactNode;\n}\n\nexport interface CameraPermissionViewProps extends ZoraBaseProps {\n status: Exclude<CameraPermissionStatus, 'granted'>;\n title?: React.ReactNode;\n description?: React.ReactNode;\n requestLabel?: React.ReactNode;\n deniedLabel?: React.ReactNode;\n manualEntryLabel?: React.ReactNode;\n onRequestPermission?: () => void | Promise<void>;\n onManualEntry?: () => void | Promise<void>;\n requestButtonProps?: Omit<ButtonProps, 'children' | 'onPress'>;\n manualEntryButtonProps?: Omit<ButtonProps, 'children' | 'onPress'>;\n}\n\nexport interface BarcodeScannerViewProps extends ZoraBaseProps {\n permissionStatus: CameraPermissionStatus;\n camera?: React.ReactNode;\n children?: React.ReactNode;\n title?: React.ReactNode;\n description?: React.ReactNode;\n overlayTitle?: React.ReactNode;\n overlayDescription?: React.ReactNode;\n cornerLabel?: React.ReactNode;\n requestPermissionLabel?: React.ReactNode;\n deniedPermissionLabel?: React.ReactNode;\n manualEntryLabel?: React.ReactNode;\n onRequestPermission?: () => void | Promise<void>;\n onManualEntry?: () => void | Promise<void>;\n onBarcodeScanned?: (result: BarcodeScanResult) => void | Promise<void>;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SectionHeader.d.ts","sourceRoot":"","sources":["../../../src/patterns/section-header/SectionHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAwClD;;;;GAIG;AACH,eAAO,MAAM,aAAa,0DAAyC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SectionHeader.js","sourceRoot":"","sources":["../../../src/patterns/section-header/SectionHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,kCAAkC,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGpE,SAAS,kBAAkB,CAAC,EAC1B,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,iBAAiB,EAAE,kBAAkB,EACrC,KAAK,EACL,WAAW,EACX,OAAO,EACP,OAAO,EACP,MAAM,GACa;IACnB,OAAO,CACL,CAAC,IAAI,CACH,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,CAC5C,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CACzC,GAAG,CAAC,GAAG,CACP,OAAO,CAAC,eAAe,CACvB,MAAM,CAAC,CAAC,MAAM,CAAC,CAEf;MAAA,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,CACzD;QAAA,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CACZ;UAAA,CAAC,OAAO,CAAC,CAAC,CAAC,CACT,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CACxD;cAAA,CAAC,OAAO,CACV;YAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,IAAI,CACR;UAAA,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,OAAO,CACnC;UAAA,CAAC,WAAW,CAAC,CAAC,CAAC,CACb,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CACxC;cAAA,CAAC,WAAW,CACd;YAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,IAAI,CACV;QAAA,EAAE,IAAI,CACR;MAAA,EAAE,IAAI,CACN;MAAA,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAC1C;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,kBAAkB,CAAC,kBAAkB,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport { View } from '../../features/layout/public';\nimport { Heading } from '../../features/typography/public';\nimport { Text } from '../../features/typography/public';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport type { SectionHeaderProps } from './types';\n\nfunction SectionHeaderInner({\n themeId: _themeId,\n mode: _mode,\n interactionPolicy: _interactionPolicy,\n title,\n description,\n eyebrow,\n actions,\n testID,\n}: SectionHeaderProps) {\n return (\n <View\n align={{ base: 'flex-start', md: 'center' }}\n direction={{ base: 'column', md: 'row' }}\n gap=\"m\"\n justify=\"space-between\"\n testID={testID}\n >\n <View flex={{ md: 1 }} width={{ base: '100%', md: 'auto' }}>\n <View gap=\"xs\">\n {eyebrow ? (\n <Text emphasis=\"muted\" variant=\"caption\" weight=\"semiBold\">\n {eyebrow}\n </Text>\n ) : null}\n <Heading level={3}>{title}</Heading>\n {description ? (\n <Text emphasis=\"muted\" variant=\"bodySmall\">\n {description}\n </Text>\n ) : null}\n </View>\n </View>\n {actions ? <View>{actions}</View> : null}\n </View>\n );\n}\n\n/***\n * Section heading pattern with optional description and action slot.\n *\n \n */\nexport const SectionHeader = withZoraThemeScope(SectionHeaderInner);\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/patterns/section-header/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/patterns/section-header/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["export { SectionHeader } from './SectionHeader';\nexport type { SectionHeaderProps } from './types';\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/patterns/section-header/meta.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BQ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../src/patterns/section-header/meta.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,IAAI,EAAE,eAAe;IACrB,QAAQ,EAAE,SAAS;IACnB,kBAAkB,EAAE,IAAI;IACxB,eAAe,EAAE,EAAE;IACnB,SAAS,EAAE;QACT,KAAK,EAAE,gBAAgB;QACvB,YAAY,EAAE;YACZ,KAAK,EAAE,eAAe;YACtB,WAAW,EAAE,oBAAoB;SAClC;KACF;IACD,KAAK,EAAE;QACL,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,SAAS;YACnB,KAAK,EAAE,OAAO;YACd,OAAO,EAAE,eAAe;SACzB;QACD,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,SAAS;YACnB,KAAK,EAAE,aAAa;YACpB,OAAO,EAAE,oBAAoB;SAC9B;QACD,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,SAAS;YACnB,KAAK,EAAE,SAAS;SACjB;KACF;CACmC,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../metadata';\n\nexport const sectionHeaderMeta = {\n name: 'SectionHeader',\n category: 'pattern',\n directManifestNode: true,\n allowedChildren: [],\n blueprint: {\n label: 'Section header',\n defaultProps: {\n title: 'Section title',\n description: 'Short description.',\n },\n },\n props: {\n title: {\n type: 'string',\n category: 'Content',\n label: 'Title',\n default: 'Section title',\n },\n description: {\n type: 'string',\n category: 'Content',\n label: 'Description',\n default: 'Short description.',\n },\n eyebrow: {\n type: 'string',\n category: 'Content',\n label: 'Eyebrow',\n },\n },\n} as const satisfies ZoraComponentMeta;\n"]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
3
|
-
export interface SectionHeaderProps extends ZoraBaseProps {
|
|
4
|
-
title: React.ReactNode;
|
|
5
|
-
description?: React.ReactNode;
|
|
6
|
-
eyebrow?: React.ReactNode;
|
|
7
|
-
actions?: React.ReactNode;
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/patterns/section-header/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,MAAM,WAAW,kBAAmB,SAAQ,aAAa;IACvD,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/patterns/section-header/types.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nimport type { ZoraBaseProps } from '../../theme/ZoraBaseProps';\n\nexport interface SectionHeaderProps extends ZoraBaseProps {\n title: React.ReactNode;\n description?: React.ReactNode;\n eyebrow?: React.ReactNode;\n actions?: React.ReactNode;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectableItem.d.ts","sourceRoot":"","sources":["../../../src/patterns/selection/SelectableItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,mBAAmB,EAAyC,MAAM,SAAS,CAAC;AAY1F;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,EAC7B,EAAE,EACF,OAAO,EACP,QAAgB,EAChB,iBAAiB,EACjB,QAAQ,GACT,EAAE,mBAAmB,qBAiFrB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectableItem.js","sourceRoot":"","sources":["../../../src/patterns/selection/SelectableItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGnD,SAAS,cA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AAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAChC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YACrB,OAAO;QACT,CAAC;QAED,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACvB,CAAC,CAAC;IAEF,OAAO,CACL,CAAC,UAAU,CACT,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,iBAAiB,CAAC,QAAQ,CAC1B,kBAAkB,CAAC,CAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAE,QAAQ,EAAE,CAAC,CAC7D,QAAQ,CAAC,CAAC,gBAAgB,CAAC,CAC3B,WAAW,CAAC,CAAC,eAAe,KAAK,WAAW,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,CAAC,CAC3E,OAAO,CAAC,CAAC,eAAe,KAAK,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAE/D;MAAA,CAAC,OAAO,CACV;IAAA,EAAE,UAAU,CAAC,CACd,CAAC;AACJ,CAAC","sourcesContent":["import { ButtonBase } from '@ankhorage/surface';\nimport React from 'react';\nimport type { GestureResponderEvent } from 'react-native';\n\nimport { useSelection } from './SelectionProvider';\nimport type { SelectableItemProps, SelectableItemState, SelectionTrigger } from './types';\n\nfunction resolveTrigger(trigger: SelectionTrigger | undefined): SelectionTrigger {\n return trigger ?? 'manual';\n}\n\nfunction isRenderProp(\n children: SelectableItemProps['children'],\n): children is (state: SelectableItemState) => React.ReactNode {\n return typeof children === 'function';\n}\n\n/***\n * Adds selection behavior to arbitrary child content via render props.\n *\n \n */\nexport function SelectableItem({\n id,\n trigger,\n disabled = false,\n interactionPolicy,\n children,\n}: SelectableItemProps) {\n const selection = useSelection();\n const resolvedTrigger = resolveTrigger(trigger);\n const resolvedDisabled = selection.disabled || disabled;\n const selected = selection.isSelected(id);\n\n const select = React.useCallback(() => {\n if (resolvedDisabled) return;\n if (interactionPolicy === 'passive') return;\n selection.select(id);\n }, [id, resolvedDisabled, interactionPolicy, selection]);\n\n const toggle = React.useCallback(() => {\n if (resolvedDisabled) return;\n if (interactionPolicy === 'passive') return;\n selection.toggle(id);\n }, [id, resolvedDisabled, interactionPolicy, selection]);\n\n const clear = React.useCallback(() => {\n if (selection.disabled) return;\n if (interactionPolicy === 'passive') return;\n selection.clear();\n }, [interactionPolicy, selection]);\n\n const itemState = React.useMemo<SelectableItemState>(() => {\n return {\n id,\n selected,\n disabled: resolvedDisabled,\n mode: selection.mode,\n select,\n toggle,\n clear,\n };\n }, [clear, id, resolvedDisabled, select, selected, selection.mode, toggle]);\n\n // IMPORTANT:\n // Do not pass `children` directly into ButtonBase. ButtonBase also supports function children,\n // but its function signature receives interaction state, not SelectableItemState.\n const content = isRenderProp(children) ? children(itemState) : children;\n\n if (resolvedTrigger === 'manual') {\n return <>{content}</>;\n }\n\n const handlePress = (event: GestureResponderEvent) => {\n event.stopPropagation();\n if (resolvedDisabled) return;\n if (interactionPolicy === 'passive') return;\n if (selection.mode === 'single') {\n selection.select(id);\n return;\n }\n\n selection.toggle(id);\n };\n\n const handleLongPress = (event: GestureResponderEvent) => {\n event.stopPropagation();\n if (resolvedDisabled) return;\n if (interactionPolicy === 'passive') return;\n if (selection.mode === 'single') {\n selection.select(id);\n return;\n }\n\n selection.toggle(id);\n };\n\n return (\n <ButtonBase\n interactionPolicy={interactionPolicy}\n accessibilityRole=\"button\"\n accessibilityState={{ disabled: resolvedDisabled, selected }}\n disabled={resolvedDisabled}\n onLongPress={resolvedTrigger === 'longPress' ? handleLongPress : undefined}\n onPress={resolvedTrigger === 'press' ? handlePress : undefined}\n >\n {content}\n </ButtonBase>\n );\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectionProvider.d.ts","sourceRoot":"","sources":["../../../src/patterns/selection/SelectionProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAiB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AEjG,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,gBAAgB,CAAC,CAAC;AACvE,CAAC","sourcesContent":["import React from 'react';\n\nimport { areIdsEqual, clearIds, normalizeIds, selectId, toggleId } from './resolveSelectionNextIds';\nimport type { SelectionMode, SelectionProviderProps, UseSelectionResult } from './types';\n\nconst MISSING_CONTEXT_MESSAGE =\n 'ZORA selection context is missing. Wrap this tree in <SelectionProvider>.';\n\ntype SelectionContextValue = UseSelectionResult;\n\nconst SelectionContext = React.createContext<SelectionContextValue | null>(null);\n\n/*** Resolve the effective selection mode. */\nfunction resolveMode(mode: SelectionMode | undefined): SelectionMode {\n return mode ?? 'single';\n}\n\n/*** Resolve the effective disabled state. */\nfunction resolveDisabled(disabled: boolean | undefined): boolean {\n return disabled ?? false;\n}\n\n/***\n * Accesses selection state provided by `SelectionProvider`.\n */\nexport function useSelection(): UseSelectionResult {\n const value = React.use(SelectionContext);\n if (!value) {\n throw new Error(MISSING_CONTEXT_MESSAGE);\n }\n\n return value;\n}\n\n/***\n * Provides selection state for building selectable lists and grids.\n */\nexport function SelectionProvider({\n children,\n selectedIds,\n defaultSelectedIds,\n mode,\n disabled,\n onSelectionChange,\n interactionPolicy,\n}: SelectionProviderProps) {\n const resolvedMode = resolveMode(mode);\n const resolvedDisabled = resolveDisabled(disabled);\n const isControlled = selectedIds !== undefined;\n\n const [uncontrolledIds, setUncontrolledIds] = React.useState<readonly string[]>(\n defaultSelectedIds ?? [],\n );\n\n const rawIds = isControlled ? selectedIds : uncontrolledIds;\n const currentNormalizedIds = normalizeIds(rawIds, resolvedMode);\n\n const selectedIdSet = React.useMemo(() => new Set(currentNormalizedIds), [currentNormalizedIds]);\n\n const commitSelectionChange = React.useCallback(\n (nextNormalizedIds: readonly string[]) => {\n if (resolvedDisabled) return;\n if (interactionPolicy === 'passive') return;\n if (areIdsEqual(nextNormalizedIds, currentNormalizedIds)) return;\n\n onSelectionChange?.(nextNormalizedIds);\n\n if (!isControlled) {\n setUncontrolledIds(nextNormalizedIds);\n }\n },\n [currentNormalizedIds, interactionPolicy, isControlled, onSelectionChange, resolvedDisabled],\n );\n\n const clear = React.useCallback(() => {\n commitSelectionChange(normalizeIds(clearIds(), resolvedMode));\n }, [commitSelectionChange, resolvedMode]);\n\n const select = React.useCallback(\n (id: string) => {\n const nextIds = selectId({ mode: resolvedMode, ids: currentNormalizedIds, id });\n const nextNormalizedIds = normalizeIds(nextIds, resolvedMode);\n commitSelectionChange(nextNormalizedIds);\n },\n [commitSelectionChange, currentNormalizedIds, resolvedMode],\n );\n\n const toggle = React.useCallback(\n (id: string) => {\n const nextIds = toggleId({ mode: resolvedMode, ids: currentNormalizedIds, id });\n const nextNormalizedIds = normalizeIds(nextIds, resolvedMode);\n commitSelectionChange(nextNormalizedIds);\n },\n [commitSelectionChange, currentNormalizedIds, resolvedMode],\n );\n\n const value = React.useMemo<UseSelectionResult>(() => {\n return {\n mode: resolvedMode,\n disabled: resolvedDisabled,\n selectedIds: currentNormalizedIds,\n selectedCount: currentNormalizedIds.length,\n hasSelection: currentNormalizedIds.length > 0,\n isSelected: (id: string) => selectedIdSet.has(id),\n select,\n toggle,\n clear,\n };\n }, [clear, currentNormalizedIds, resolvedDisabled, resolvedMode, select, selectedIdSet, toggle]);\n\n return <SelectionContext value={value}>{children}</SelectionContext>;\n}\n"]}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { SelectableItem } from './SelectableItem';
|
|
2
|
-
export { SelectionProvider, useSelection } from './SelectionProvider';
|
|
3
|
-
export type { SelectableItemProps, SelectableItemState, SelectionMode, SelectionProviderProps, SelectionTrigger, UseSelectionResult, } from './types';
|
|
4
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/patterns/selection/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACtE,YAAY,EACV,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,EACb,sBAAsB,EACtB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/patterns/selection/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC","sourcesContent":["export { SelectableItem } from './SelectableItem';\nexport { SelectionProvider, useSelection } from './SelectionProvider';\nexport type {\n SelectableItemProps,\n SelectableItemState,\n SelectionMode,\n SelectionProviderProps,\n SelectionTrigger,\n UseSelectionResult,\n} from './types';\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolveSelectionNextIds.d.ts","sourceRoot":"","sources":["../../../src/patterns/selection/resolveSelectionNextIds.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,wBAAgB,YAAY,CAC1B,GAAG,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,EAClC,IAAI,EAAE,aAAa,GAClB,SAAS,MAAM,EAAE,CAYnB;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,SAAS,MAAM,EAAE,EAAE,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAO/E;AAED,wBAAgB,QAAQ,IAAI,SAAS,MAAM,EAAE,CAE5C;AAED,wBAAgB,QAAQ,CAAC,EACvB,IAAI,EACJ,GAAG,EACH,EAAE,GACH,EAAE;IACD,IAAI,EAAE,aAAa,CAAC;IACpB,GAAG,EAAE,SAAS,MAAM,EAAE,CAAC;IACvB,EAAE,EA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CAAC;AAED,MAAM,UAAU,QAAQ;IACtB,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,EACvB,IAAI,EACJ,GAAG,EACH,EAAE,GAKH;IACC,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;QACtB,OAAO,CAAC,EAAE,CAAC,CAAC;IACd,CAAC;IAED,IAAI,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC;QACrB,OAAO,GAAG,CAAC;IACb,CAAC;IAED,OAAO,CAAC,GAAG,GAAG,EAAE,EAAE,CAAC,CAAC;AACtB,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,EACvB,IAAI,EACJ,GAAG,EACH,EAAE,GAKH;IACC,IAAI,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC;QACrB,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,KAAK,EAAE,CAAC,CAAC;IACvD,CAAC;IAED,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;QACtB,OAAO,CAAC,EAAE,CAAC,CAAC;IACd,CAAC;IAED,OAAO,CAAC,GAAG,GAAG,EAAE,EAAE,CAAC,CAAC;AACtB,CAAC","sourcesContent":["import type { SelectionMode } from './types';\n\nexport function normalizeIds(\n ids: readonly string[] | undefined,\n mode: SelectionMode,\n): readonly string[] {\n const uniqueIds: string[] = [];\n const seen = new Set<string>();\n\n for (const id of ids ?? []) {\n if (seen.has(id)) continue;\n seen.add(id);\n uniqueIds.push(id);\n if (mode === 'single') break;\n }\n\n return uniqueIds;\n}\n\nexport function areIdsEqual(a: readonly string[], b: readonly string[]): boolean {\n if (a.length !== b.length) return false;\n for (let index = 0; index < a.length; index += 1) {\n if (a.at(index) !== b.at(index)) return false;\n }\n\n return true;\n}\n\nexport function clearIds(): readonly string[] {\n return [];\n}\n\nexport function selectId({\n mode,\n ids,\n id,\n}: {\n mode: SelectionMode;\n ids: readonly string[];\n id: string;\n}): readonly string[] {\n if (mode === 'single') {\n return [id];\n }\n\n if (ids.includes(id)) {\n return ids;\n }\n\n return [...ids, id];\n}\n\nexport function toggleId({\n mode,\n ids,\n id,\n}: {\n mode: SelectionMode;\n ids: readonly string[];\n id: string;\n}): readonly string[] {\n if (ids.includes(id)) {\n return ids.filter((existingId) => existingId !== id);\n }\n\n if (mode === 'single') {\n return [id];\n }\n\n return [...ids, id];\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/patterns/selection/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE/C,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,WAAW,GAAG,QAAQ,CAAC;AAEhE,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,kBAAkB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iBAAiB,CAAC,EAAE,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,KAAK,IAAI,CAAC;IACrD,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CACvC;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,aAAa,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC;IACpC,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,aAAa,CAAC;IACpB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,QAAQ,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE,mBAAmB,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;CAC/E"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/patterns/selection/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { InteractionPolicy } from '@ankhorage/surface';\nimport type React from 'react';\n\nexport type SelectionMode = 'single' | 'multi';\n\nexport type SelectionTrigger = 'press' | 'longPress' | 'manual';\n\nexport interface SelectionProviderProps {\n children: React.ReactNode;\n selectedIds?: readonly string[];\n defaultSelectedIds?: readonly string[];\n mode?: SelectionMode;\n disabled?: boolean;\n onSelectionChange?: (ids: readonly string[]) => void;\n interactionPolicy?: InteractionPolicy;\n}\n\nexport interface UseSelectionResult {\n mode: SelectionMode;\n disabled: boolean;\n selectedIds: readonly string[];\n selectedCount: number;\n hasSelection: boolean;\n isSelected: (id: string) => boolean;\n select: (id: string) => void;\n toggle: (id: string) => void;\n clear: () => void;\n}\n\nexport interface SelectableItemState {\n id: string;\n selected: boolean;\n disabled: boolean;\n mode: SelectionMode;\n select: () => void;\n toggle: () => void;\n clear: () => void;\n}\n\nexport interface SelectableItemProps {\n id: string;\n trigger?: SelectionTrigger;\n disabled?: boolean;\n interactionPolicy?: InteractionPolicy;\n children: React.ReactNode | ((state: SelectableItemState) => React.ReactNode);\n}\n"]}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { SwitchFieldProps } from './types';
|
|
3
|
-
/***
|
|
4
|
-
* Labeled switch field pattern built on the card-style `ListItem` presentation.
|
|
5
|
-
*
|
|
6
|
-
*/
|
|
7
|
-
export declare const SwitchField: (props: SwitchFieldProps) => React.ReactElement | null;
|
|
8
|
-
//# sourceMappingURL=SwitchField.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SwitchField.d.ts","sourceRoot":"","sources":["../../../src/patterns/switch-field/SwitchField.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAgChD;;;GAGG;AACH,eAAO,MAAM,WAAW,wDAAuC,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Switch } from '@ankhorage/surface';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { ListItem } from '../../features/list/public';
|
|
4
|
-
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
5
|
-
function SwitchFieldInner({ themeId: _themeId, mode: _mode, label, description, value, onValueChange, disabled, testID, interactionPolicy, }) {
|
|
6
|
-
return (<ListItem action={<Switch checked={value} disabled={disabled} interactionPolicy={interactionPolicy} onCheckedChange={onValueChange}/>} description={description} disabled={disabled} testID={testID} title={label} variant="card"/>);
|
|
7
|
-
}
|
|
8
|
-
/***
|
|
9
|
-
* Labeled switch field pattern built on the card-style `ListItem` presentation.
|
|
10
|
-
*
|
|
11
|
-
*/
|
|
12
|
-
export const SwitchField = withZoraThemeScope(SwitchFieldInner);
|
|
13
|
-
//# sourceMappingURL=SwitchField.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SwitchField.js","sourceRoot":"","sources":["../../../src/patterns/switch-field/SwitchField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGpE,SAAS,gBAAgB,CAAC,EACxB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,KAAK,EACL,WAAW,EACX,KAAK,EACL,aAAa,EACb,QAAQ,EACR,MAAM,EACN,iBAAiB,GACA;IACjB,OAAO,CACL,CAAC,QAAQ,CACP,MAAM,CAAC,CACL,CAAC,MAAM,CACL,OAAO,CAAC,CAAC,KAAK,CAAC,CACf,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,eAAe,CAAC,CAAC,aAAa,CAAC,EAEnC,CAAC,CACD,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,OAAO,CAAC,MAAM,EACd,CACH,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,kBAAkB,CAAC,gBAAgB,CAAC,CAAC","sourcesContent":["import { Switch } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { ListItem } from '../../features/list/public';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport type { SwitchFieldProps } from './types';\n\nfunction SwitchFieldInner({\n themeId: _themeId,\n mode: _mode,\n label,\n description,\n value,\n onValueChange,\n disabled,\n testID,\n interactionPolicy,\n}: SwitchFieldProps) {\n return (\n <ListItem\n action={\n <Switch\n checked={value}\n disabled={disabled}\n interactionPolicy={interactionPolicy}\n onCheckedChange={onValueChange}\n />\n }\n description={description}\n disabled={disabled}\n testID={testID}\n title={label}\n variant=\"card\"\n />\n );\n}\n\n/***\n * Labeled switch field pattern built on the card-style `ListItem` presentation.\n *\n */\nexport const SwitchField = withZoraThemeScope(SwitchFieldInner);\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/patterns/switch-field/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/patterns/switch-field/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC","sourcesContent":["export * from './SwitchField';\nexport * from './types';\n"]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const switchFieldMeta: {
|
|
2
|
-
readonly name: "SwitchField";
|
|
3
|
-
readonly category: "pattern";
|
|
4
|
-
readonly directManifestNode: false;
|
|
5
|
-
readonly allowedChildren: readonly [];
|
|
6
|
-
readonly note: "Form pattern; not represented as a manifest node in v1.";
|
|
7
|
-
readonly props: {};
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=meta.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/patterns/switch-field/meta.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe;;;;;;;CAOU,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../src/patterns/switch-field/meta.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,aAAa;IACnB,QAAQ,EAAE,SAAS;IACnB,kBAAkB,EAAE,KAAK;IACzB,eAAe,EAAE,EAAE;IACnB,IAAI,EAAE,yDAAyD;IAC/D,KAAK,EAAE,EAAE;CAC2B,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../metadata';\n\nexport const switchFieldMeta = {\n name: 'SwitchField',\n category: 'pattern',\n directManifestNode: false,\n allowedChildren: [],\n note: 'Form pattern; not represented as a manifest node in v1.',\n props: {},\n} as const satisfies ZoraComponentMeta;\n"]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
3
|
-
export interface SwitchFieldProps extends ZoraBaseProps {
|
|
4
|
-
label: ReactNode;
|
|
5
|
-
description?: ReactNode;
|
|
6
|
-
value: boolean;
|
|
7
|
-
onValueChange: (value: boolean) => void;
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/patterns/switch-field/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,MAAM,WAAW,gBAAiB,SAAQ,aAAa;IACrD,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,KAAK,EAAE,OAAO,CAAC;IACf,aAAa,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/patterns/switch-field/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode } from 'react';\n\nimport type { ZoraBaseProps } from '../../theme/ZoraBaseProps';\n\nexport interface SwitchFieldProps extends ZoraBaseProps {\n label: ReactNode;\n description?: ReactNode;\n value: boolean;\n onValueChange: (value: boolean) => void;\n disabled?: boolean;\n}\n"]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ThemeComposerProps } from './types';
|
|
3
|
-
/***
|
|
4
|
-
* UI for composing and applying a theme via structured controls.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
export declare const ThemeComposer: (props: ThemeComposerProps) => React.ReactElement | null;
|
|
9
|
-
//# sourceMappingURL=ThemeComposer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeComposer.d.ts","sourceRoot":"","sources":["../../../src/patterns/theme-composer/ThemeComposer.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAc1B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AA0SlD;;;;GAIG;AACH,eAAO,MAAM,aAAa,0DAAyC,CAAC"}
|
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
import { COLOR_HARMONIES, parseHexColorOrThrow } from '@ankhorage/color-theory';
|
|
2
|
-
import { APP_CATEGORIES } from '@ankhorage/contracts';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { Badge } from '../../features/badge/public';
|
|
5
|
-
import { Button } from '../../features/button/public';
|
|
6
|
-
import { Card } from '../../features/card/public';
|
|
7
|
-
import { ChipGroup } from '../../features/chip/public';
|
|
8
|
-
import { Select } from '../../features/form/select/public';
|
|
9
|
-
import { TextInput } from '../../features/form/text-input/public';
|
|
10
|
-
import { View } from '../../features/layout/public';
|
|
11
|
-
import { Heading } from '../../features/typography/public';
|
|
12
|
-
import { Text } from '../../features/typography/public';
|
|
13
|
-
import { useZoraTheme } from '../../theme/useZoraTheme';
|
|
14
|
-
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
15
|
-
const HEX_ERROR_MESSAGE = 'Enter a valid 6-digit hex color.';
|
|
16
|
-
const HEX_INPUT_PLACEHOLDER = 'Enter hex color';
|
|
17
|
-
const NAME_ERROR_MESSAGE = 'Theme name cannot be empty.';
|
|
18
|
-
function createInputDraft(sourceValue) {
|
|
19
|
-
return { inputValue: sourceValue, error: undefined };
|
|
20
|
-
}
|
|
21
|
-
function isValidHex(value) {
|
|
22
|
-
try {
|
|
23
|
-
parseHexColorOrThrow(value);
|
|
24
|
-
return true;
|
|
25
|
-
}
|
|
26
|
-
catch {
|
|
27
|
-
return false;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
function formatAppCategoryLabel(category) {
|
|
31
|
-
return category
|
|
32
|
-
.split('_')
|
|
33
|
-
.map((part) => part.charAt(0).toUpperCase() + part.slice(1))
|
|
34
|
-
.join(' ');
|
|
35
|
-
}
|
|
36
|
-
const HARMONY_OPTIONS = COLOR_HARMONIES.map((h) => ({ value: h, label: h }));
|
|
37
|
-
const MODE_OPTIONS = [
|
|
38
|
-
{ value: 'light', label: 'Light' },
|
|
39
|
-
{ value: 'dark', label: 'Dark' },
|
|
40
|
-
];
|
|
41
|
-
function ThemeComposerInner({ themeId: _themeId, value, onChange, mode, onModeChange, onSubmit, appCategories, testID, }) {
|
|
42
|
-
const { theme } = useZoraTheme();
|
|
43
|
-
const [hexDraft, setHexDraft] = React.useState(() => createInputDraft(value.primaryColor));
|
|
44
|
-
const [nameDraft, setNameDraft] = React.useState(() => createInputDraft(value.name));
|
|
45
|
-
const [previousPrimaryColor, setPreviousPrimaryColor] = React.useState(value.primaryColor);
|
|
46
|
-
const [previousName, setPreviousName] = React.useState(value.name);
|
|
47
|
-
if (previousPrimaryColor !== value.primaryColor) {
|
|
48
|
-
setPreviousPrimaryColor(value.primaryColor);
|
|
49
|
-
setHexDraft(createInputDraft(value.primaryColor));
|
|
50
|
-
}
|
|
51
|
-
if (previousName !== value.name) {
|
|
52
|
-
setPreviousName(value.name);
|
|
53
|
-
setNameDraft(createInputDraft(value.name));
|
|
54
|
-
}
|
|
55
|
-
function handleNameChange(text) {
|
|
56
|
-
const error = text.trim().length === 0 ? NAME_ERROR_MESSAGE : undefined;
|
|
57
|
-
setNameDraft({ inputValue: text, error });
|
|
58
|
-
if (!error) {
|
|
59
|
-
onChange({ ...value, name: text });
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
function handleHexChange(text) {
|
|
63
|
-
const normalized = text.startsWith('#') ? text : `#${text}`;
|
|
64
|
-
const error = isValidHex(normalized) ? undefined : HEX_ERROR_MESSAGE;
|
|
65
|
-
setHexDraft({ inputValue: normalized, error });
|
|
66
|
-
if (!error) {
|
|
67
|
-
onChange({ ...value, primaryColor: normalized });
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
function handleSubmit() {
|
|
71
|
-
const hasValidName = nameDraft.inputValue.trim().length > 0;
|
|
72
|
-
const hasValidHex = isValidHex(hexDraft.inputValue);
|
|
73
|
-
if (!hasValidName) {
|
|
74
|
-
setNameDraft((current) => ({ ...current, error: NAME_ERROR_MESSAGE }));
|
|
75
|
-
}
|
|
76
|
-
if (!hasValidHex) {
|
|
77
|
-
setHexDraft((current) => ({ ...current, error: HEX_ERROR_MESSAGE }));
|
|
78
|
-
}
|
|
79
|
-
if (!hasValidName || !hasValidHex) {
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
onSubmit?.({
|
|
83
|
-
...value,
|
|
84
|
-
name: nameDraft.inputValue,
|
|
85
|
-
primaryColor: hexDraft.inputValue,
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
const activeMode = mode ?? 'light';
|
|
89
|
-
const categoryOptions = (appCategories ?? APP_CATEGORIES).map((c) => ({
|
|
90
|
-
value: c,
|
|
91
|
-
label: formatAppCategoryLabel(c),
|
|
92
|
-
}));
|
|
93
|
-
return (<View gap="l" testID={testID}>
|
|
94
|
-
{/* Section: Theme identity */}
|
|
95
|
-
<Card title="Theme identity" description="Name your theme. The ID is assigned automatically and shown for reference.">
|
|
96
|
-
<View gap="m">
|
|
97
|
-
<View gap="xs">
|
|
98
|
-
<Text variant="label">Name</Text>
|
|
99
|
-
<TextInput value={nameDraft.inputValue} onChangeText={handleNameChange} placeholder="My theme" autoCorrect={false} invalid={nameDraft.error !== undefined} testID={testID ? `${testID}-name-input` : undefined}/>
|
|
100
|
-
{nameDraft.error ? (<Text color="danger" variant="bodySmall">
|
|
101
|
-
{nameDraft.error}
|
|
102
|
-
</Text>) : null}
|
|
103
|
-
</View>
|
|
104
|
-
<View gap="xs">
|
|
105
|
-
<Text variant="label">ID</Text>
|
|
106
|
-
<Text emphasis="muted" variant="bodySmall" testID={testID ? `${testID}-id-display` : undefined}>
|
|
107
|
-
{value.id}
|
|
108
|
-
</Text>
|
|
109
|
-
</View>
|
|
110
|
-
</View>
|
|
111
|
-
</Card>
|
|
112
|
-
|
|
113
|
-
{/* Section: App category */}
|
|
114
|
-
<Card title="App category" description="Choose the category that best describes this app.">
|
|
115
|
-
<Select value={value.appCategory} options={categoryOptions} onValueChange={(c) => onChange({ ...value, appCategory: c })} testID={testID ? `${testID}-category-select` : undefined}/>
|
|
116
|
-
</Card>
|
|
117
|
-
|
|
118
|
-
{/* Section: Primary Color */}
|
|
119
|
-
<Card title="Primary color" description="Set the seed color for your theme palette.">
|
|
120
|
-
<View gap="m">
|
|
121
|
-
<View direction="row" gap="m" align="center">
|
|
122
|
-
<View flex={1}>
|
|
123
|
-
<TextInput value={hexDraft.inputValue} onChangeText={handleHexChange} placeholder={HEX_INPUT_PLACEHOLDER} autoCapitalize="none" autoCorrect={false} maxLength={7} invalid={hexDraft.error !== undefined} testID={testID ? `${testID}-hex-input` : undefined}/>
|
|
124
|
-
</View>
|
|
125
|
-
{/* Color preview chip */}
|
|
126
|
-
<View width={36} height={36} radius="m" style={{
|
|
127
|
-
backgroundColor: isValidHex(hexDraft.inputValue)
|
|
128
|
-
? hexDraft.inputValue
|
|
129
|
-
: theme.colors.border,
|
|
130
|
-
borderWidth: 1,
|
|
131
|
-
borderColor: theme.colors.border,
|
|
132
|
-
}}/>
|
|
133
|
-
</View>
|
|
134
|
-
{hexDraft.error ? (<Text color="danger" variant="bodySmall">
|
|
135
|
-
{hexDraft.error}
|
|
136
|
-
</Text>) : null}
|
|
137
|
-
</View>
|
|
138
|
-
</Card>
|
|
139
|
-
|
|
140
|
-
{/* Section: Harmony */}
|
|
141
|
-
<Card title="Harmony" description="Choose how accent hues are generated from your primary color.">
|
|
142
|
-
<Select value={value.harmony} options={HARMONY_OPTIONS} onValueChange={(h) => onChange({ ...value, harmony: h })} testID={testID ? `${testID}-harmony-select` : undefined}/>
|
|
143
|
-
</Card>
|
|
144
|
-
|
|
145
|
-
{/* Section: Mode */}
|
|
146
|
-
<Card title="Mode" description="Switch between light and dark presentation.">
|
|
147
|
-
<ChipGroup value={activeMode} items={MODE_OPTIONS} onValueChange={(nextMode) => onModeChange?.(nextMode)} testID={testID ? `${testID}-mode` : undefined}/>
|
|
148
|
-
</Card>
|
|
149
|
-
|
|
150
|
-
{/* Section: Preview */}
|
|
151
|
-
<Card title="Preview" description="A quick look at how your theme renders common controls.">
|
|
152
|
-
<View gap="m">
|
|
153
|
-
<View gap="xs">
|
|
154
|
-
<Text variant="label">Name</Text>
|
|
155
|
-
<Text>{value.name}</Text>
|
|
156
|
-
</View>
|
|
157
|
-
<View gap="xs">
|
|
158
|
-
<Text variant="label">Category</Text>
|
|
159
|
-
<Text>{formatAppCategoryLabel(value.appCategory)}</Text>
|
|
160
|
-
</View>
|
|
161
|
-
<View gap="xs">
|
|
162
|
-
<Text variant="label">Primary color</Text>
|
|
163
|
-
<Text emphasis="muted" variant="bodySmall">
|
|
164
|
-
{value.primaryColor}
|
|
165
|
-
</Text>
|
|
166
|
-
</View>
|
|
167
|
-
<View gap="xs">
|
|
168
|
-
<Text variant="label">Harmony</Text>
|
|
169
|
-
<Text emphasis="muted" variant="bodySmall">
|
|
170
|
-
{value.harmony}
|
|
171
|
-
</Text>
|
|
172
|
-
</View>
|
|
173
|
-
<Heading level={4}>Heading</Heading>
|
|
174
|
-
<Text>Body text — this shows default text color and weight.</Text>
|
|
175
|
-
<Text emphasis="muted" variant="bodySmall">
|
|
176
|
-
Muted caption text.
|
|
177
|
-
</Text>
|
|
178
|
-
<View direction="row" gap="s" align="center">
|
|
179
|
-
<Button color="primary" variant="solid" size="m">
|
|
180
|
-
Primary
|
|
181
|
-
</Button>
|
|
182
|
-
<Button color="neutral" variant="soft" size="m">
|
|
183
|
-
Neutral
|
|
184
|
-
</Button>
|
|
185
|
-
<Button color="danger" variant="ghost" size="m">
|
|
186
|
-
Danger
|
|
187
|
-
</Button>
|
|
188
|
-
</View>
|
|
189
|
-
<View direction="row" gap="s" align="center">
|
|
190
|
-
<Badge color="primary">Primary</Badge>
|
|
191
|
-
<Badge color="success" variant="soft">
|
|
192
|
-
Success
|
|
193
|
-
</Badge>
|
|
194
|
-
<Badge color="warning" variant="soft">
|
|
195
|
-
Warning
|
|
196
|
-
</Badge>
|
|
197
|
-
<Badge color="danger" variant="soft">
|
|
198
|
-
Danger
|
|
199
|
-
</Badge>
|
|
200
|
-
</View>
|
|
201
|
-
<Card tone="subtle" title="Nested card" description="Subtle tone inside the preview." compact/>
|
|
202
|
-
</View>
|
|
203
|
-
</Card>
|
|
204
|
-
|
|
205
|
-
{/* Submit */}
|
|
206
|
-
{onSubmit ? (<Button color="primary" variant="solid" onPress={handleSubmit} testID={testID ? `${testID}-submit` : undefined}>
|
|
207
|
-
Apply theme
|
|
208
|
-
</Button>) : null}
|
|
209
|
-
</View>);
|
|
210
|
-
}
|
|
211
|
-
/***
|
|
212
|
-
* UI for composing and applying a theme via structured controls.
|
|
213
|
-
*
|
|
214
|
-
*
|
|
215
|
-
*/
|
|
216
|
-
export const ThemeComposer = withZoraThemeScope(ThemeComposerInner);
|
|
217
|
-
//# sourceMappingURL=ThemeComposer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeComposer.js","sourceRoot":"","sources":["../../../src/patterns/theme-composer/ThemeComposer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAEhF,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,kCAAkC,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGpE,MAAM,iBAAiB,GAAG,kCAAkC,CAAC;AAC7D,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAChD,MAAM,kBAAkB,GAAG,6BAA6B,CAAC;AAOzD,SAAS,gBAAgB,CAAC,WAAmB;IAC3C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;AACvD,CAAC;AAED,SAAS,UAAU,CAAC,KAAa;IAC/B,IAAI,CA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AAK,CACP;YAAA,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CACnC;;YACF,EAAE,KAAK,CACP;YAAA,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAClC;;YACF,EAAE,KAAK,CACT;UAAA,EAAE,IAAI,CACN;UAAA,CAAC,IAAI,CACH,IAAI,CAAC,QAAQ,CACb,KAAK,CAAC,aAAa,CACnB,WAAW,CAAC,iCAAiC,CAC7C,OAAO,EAEX;QAAA,EAAE,IAAI,CACR;MAAA,EAAE,IAAI,CAEN;;MAAA,CAAC,YAAY,CACb;MAAA,CAAC,QAAQ,CAAC,CAAC,CAAC,CACV,CAAC,MAAM,CACL,KAAK,CAAC,SAAS,CACf,OAAO,CAAC,OAAO,CACf,OAAO,CAAC,CAAC,YAAY,CAAC,CACtB,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAEhD;;QACF,EAAE,MAAM,CAAC,CACV,CAAC,CAAC,CAAC,IAAI,CACV;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,kBAAkB,CAAC,kBAAkB,CAAC,CAAC","sourcesContent":["import { COLOR_HARMONIES, parseHexColorOrThrow } from '@ankhorage/color-theory';\nimport type { AppCategory } from '@ankhorage/contracts';\nimport { APP_CATEGORIES } from '@ankhorage/contracts';\nimport React from 'react';\n\nimport { Badge } from '../../features/badge/public';\nimport { Button } from '../../features/button/public';\nimport { Card } from '../../features/card/public';\nimport { ChipGroup } from '../../features/chip/public';\nimport { Select } from '../../features/form/select/public';\nimport { TextInput } from '../../features/form/text-input/public';\nimport { View } from '../../features/layout/public';\nimport { Heading } from '../../features/typography/public';\nimport { Text } from '../../features/typography/public';\nimport type { ZoraThemeMode } from '../../theme/types';\nimport { useZoraTheme } from '../../theme/useZoraTheme';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport type { ThemeComposerProps } from './types';\n\nconst HEX_ERROR_MESSAGE = 'Enter a valid 6-digit hex color.';\nconst HEX_INPUT_PLACEHOLDER = 'Enter hex color';\nconst NAME_ERROR_MESSAGE = 'Theme name cannot be empty.';\n\ninterface InputDraft {\n inputValue: string;\n error: string | undefined;\n}\n\nfunction createInputDraft(sourceValue: string): InputDraft {\n return { inputValue: sourceValue, error: undefined };\n}\n\nfunction isValidHex(value: string): boolean {\n try {\n parseHexColorOrThrow(value);\n return true;\n } catch {\n return false;\n }\n}\n\nfunction formatAppCategoryLabel(category: AppCategory): string {\n return category\n .split('_')\n .map((part) => part.charAt(0).toUpperCase() + part.slice(1))\n .join(' ');\n}\n\nconst HARMONY_OPTIONS = COLOR_HARMONIES.map((h) => ({ value: h, label: h }));\n\nconst MODE_OPTIONS = [\n { value: 'light' as ZoraThemeMode, label: 'Light' },\n { value: 'dark' as ZoraThemeMode, label: 'Dark' },\n];\n\nfunction ThemeComposerInner({\n themeId: _themeId,\n value,\n onChange,\n mode,\n onModeChange,\n onSubmit,\n appCategories,\n testID,\n}: ThemeComposerProps) {\n const { theme } = useZoraTheme();\n\n const [hexDraft, setHexDraft] = React.useState<InputDraft>(() =>\n createInputDraft(value.primaryColor),\n );\n const [nameDraft, setNameDraft] = React.useState<InputDraft>(() => createInputDraft(value.name));\n const [previousPrimaryColor, setPreviousPrimaryColor] = React.useState(value.primaryColor);\n const [previousName, setPreviousName] = React.useState(value.name);\n\n if (previousPrimaryColor !== value.primaryColor) {\n setPreviousPrimaryColor(value.primaryColor);\n setHexDraft(createInputDraft(value.primaryColor));\n }\n\n if (previousName !== value.name) {\n setPreviousName(value.name);\n setNameDraft(createInputDraft(value.name));\n }\n\n function handleNameChange(text: string) {\n const error = text.trim().length === 0 ? NAME_ERROR_MESSAGE : undefined;\n setNameDraft({ inputValue: text, error });\n\n if (!error) {\n onChange({ ...value, name: text });\n }\n }\n\n function handleHexChange(text: string) {\n const normalized = text.startsWith('#') ? text : `#${text}`;\n const error = isValidHex(normalized) ? undefined : HEX_ERROR_MESSAGE;\n setHexDraft({ inputValue: normalized, error });\n\n if (!error) {\n onChange({ ...value, primaryColor: normalized });\n }\n }\n\n function handleSubmit() {\n const hasValidName = nameDraft.inputValue.trim().length > 0;\n const hasValidHex = isValidHex(hexDraft.inputValue);\n\n if (!hasValidName) {\n setNameDraft((current) => ({ ...current, error: NAME_ERROR_MESSAGE }));\n }\n\n if (!hasValidHex) {\n setHexDraft((current) => ({ ...current, error: HEX_ERROR_MESSAGE }));\n }\n\n if (!hasValidName || !hasValidHex) {\n return;\n }\n\n onSubmit?.({\n ...value,\n name: nameDraft.inputValue,\n primaryColor: hexDraft.inputValue,\n });\n }\n\n const activeMode = mode ?? 'light';\n const categoryOptions = (appCategories ?? APP_CATEGORIES).map((c) => ({\n value: c,\n label: formatAppCategoryLabel(c),\n }));\n\n return (\n <View gap=\"l\" testID={testID}>\n {/* Section: Theme identity */}\n <Card\n title=\"Theme identity\"\n description=\"Name your theme. The ID is assigned automatically and shown for reference.\"\n >\n <View gap=\"m\">\n <View gap=\"xs\">\n <Text variant=\"label\">Name</Text>\n <TextInput\n value={nameDraft.inputValue}\n onChangeText={handleNameChange}\n placeholder=\"My theme\"\n autoCorrect={false}\n invalid={nameDraft.error !== undefined}\n testID={testID ? `${testID}-name-input` : undefined}\n />\n {nameDraft.error ? (\n <Text color=\"danger\" variant=\"bodySmall\">\n {nameDraft.error}\n </Text>\n ) : null}\n </View>\n <View gap=\"xs\">\n <Text variant=\"label\">ID</Text>\n <Text\n emphasis=\"muted\"\n variant=\"bodySmall\"\n testID={testID ? `${testID}-id-display` : undefined}\n >\n {value.id}\n </Text>\n </View>\n </View>\n </Card>\n\n {/* Section: App category */}\n <Card title=\"App category\" description=\"Choose the category that best describes this app.\">\n <Select\n value={value.appCategory}\n options={categoryOptions}\n onValueChange={(c) => onChange({ ...value, appCategory: c })}\n testID={testID ? `${testID}-category-select` : undefined}\n />\n </Card>\n\n {/* Section: Primary Color */}\n <Card title=\"Primary color\" description=\"Set the seed color for your theme palette.\">\n <View gap=\"m\">\n <View direction=\"row\" gap=\"m\" align=\"center\">\n <View flex={1}>\n <TextInput\n value={hexDraft.inputValue}\n onChangeText={handleHexChange}\n placeholder={HEX_INPUT_PLACEHOLDER}\n autoCapitalize=\"none\"\n autoCorrect={false}\n maxLength={7}\n invalid={hexDraft.error !== undefined}\n testID={testID ? `${testID}-hex-input` : undefined}\n />\n </View>\n {/* Color preview chip */}\n <View\n width={36}\n height={36}\n radius=\"m\"\n style={{\n backgroundColor: isValidHex(hexDraft.inputValue)\n ? hexDraft.inputValue\n : theme.colors.border,\n borderWidth: 1,\n borderColor: theme.colors.border,\n }}\n />\n </View>\n {hexDraft.error ? (\n <Text color=\"danger\" variant=\"bodySmall\">\n {hexDraft.error}\n </Text>\n ) : null}\n </View>\n </Card>\n\n {/* Section: Harmony */}\n <Card\n title=\"Harmony\"\n description=\"Choose how accent hues are generated from your primary color.\"\n >\n <Select\n value={value.harmony}\n options={HARMONY_OPTIONS}\n onValueChange={(h) => onChange({ ...value, harmony: h })}\n testID={testID ? `${testID}-harmony-select` : undefined}\n />\n </Card>\n\n {/* Section: Mode */}\n <Card title=\"Mode\" description=\"Switch between light and dark presentation.\">\n <ChipGroup\n value={activeMode}\n items={MODE_OPTIONS}\n onValueChange={(nextMode) => onModeChange?.(nextMode)}\n testID={testID ? `${testID}-mode` : undefined}\n />\n </Card>\n\n {/* Section: Preview */}\n <Card title=\"Preview\" description=\"A quick look at how your theme renders common controls.\">\n <View gap=\"m\">\n <View gap=\"xs\">\n <Text variant=\"label\">Name</Text>\n <Text>{value.name}</Text>\n </View>\n <View gap=\"xs\">\n <Text variant=\"label\">Category</Text>\n <Text>{formatAppCategoryLabel(value.appCategory)}</Text>\n </View>\n <View gap=\"xs\">\n <Text variant=\"label\">Primary color</Text>\n <Text emphasis=\"muted\" variant=\"bodySmall\">\n {value.primaryColor}\n </Text>\n </View>\n <View gap=\"xs\">\n <Text variant=\"label\">Harmony</Text>\n <Text emphasis=\"muted\" variant=\"bodySmall\">\n {value.harmony}\n </Text>\n </View>\n <Heading level={4}>Heading</Heading>\n <Text>Body text — this shows default text color and weight.</Text>\n <Text emphasis=\"muted\" variant=\"bodySmall\">\n Muted caption text.\n </Text>\n <View direction=\"row\" gap=\"s\" align=\"center\">\n <Button color=\"primary\" variant=\"solid\" size=\"m\">\n Primary\n </Button>\n <Button color=\"neutral\" variant=\"soft\" size=\"m\">\n Neutral\n </Button>\n <Button color=\"danger\" variant=\"ghost\" size=\"m\">\n Danger\n </Button>\n </View>\n <View direction=\"row\" gap=\"s\" align=\"center\">\n <Badge color=\"primary\">Primary</Badge>\n <Badge color=\"success\" variant=\"soft\">\n Success\n </Badge>\n <Badge color=\"warning\" variant=\"soft\">\n Warning\n </Badge>\n <Badge color=\"danger\" variant=\"soft\">\n Danger\n </Badge>\n </View>\n <Card\n tone=\"subtle\"\n title=\"Nested card\"\n description=\"Subtle tone inside the preview.\"\n compact\n />\n </View>\n </Card>\n\n {/* Submit */}\n {onSubmit ? (\n <Button\n color=\"primary\"\n variant=\"solid\"\n onPress={handleSubmit}\n testID={testID ? `${testID}-submit` : undefined}\n >\n Apply theme\n </Button>\n ) : null}\n </View>\n );\n}\n\n/***\n * UI for composing and applying a theme via structured controls.\n *\n *\n */\nexport const ThemeComposer = withZoraThemeScope(ThemeComposerInner);\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/patterns/theme-composer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/patterns/theme-composer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["export { ThemeComposer } from './ThemeComposer';\nexport type { ThemeComposerProps } from './types';\n"]}
|