@astryxdesign/core 0.1.6 → 0.1.7-canary.04cd8f7
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 +68 -0
- package/README.md +25 -14
- package/dist/AlertDialog/AlertDialog.d.ts +1 -1
- package/dist/AlertDialog/AlertDialog.d.ts.map +1 -1
- package/dist/AlertDialog/AlertDialog.js +4 -1
- package/dist/AppShell/AppShell.d.ts.map +1 -1
- package/dist/AppShell/AppShell.js +3 -1
- package/dist/AvatarGroup/AvatarGroup.d.ts +1 -1
- package/dist/AvatarGroup/AvatarGroup.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroup.js +4 -1
- package/dist/Banner/Banner.d.ts.map +1 -1
- package/dist/Banner/Banner.js +8 -6
- package/dist/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.js +4 -1
- package/dist/Button/Button.d.ts +10 -2
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +49 -6
- package/dist/ButtonGroup/ButtonGroup.d.ts +20 -5
- package/dist/ButtonGroup/ButtonGroup.d.ts.map +1 -1
- package/dist/ButtonGroup/ButtonGroup.js +27 -11
- package/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +29 -7
- package/dist/Carousel/Carousel.d.ts +1 -1
- package/dist/Carousel/Carousel.d.ts.map +1 -1
- package/dist/Carousel/Carousel.js +8 -5
- package/dist/Chat/ChatComposer.d.ts.map +1 -1
- package/dist/Chat/ChatComposer.js +4 -1
- package/dist/Chat/ChatComposerDrawer.d.ts +1 -1
- package/dist/Chat/ChatComposerDrawer.d.ts.map +1 -1
- package/dist/Chat/ChatComposerDrawer.js +9 -2
- package/dist/Chat/ChatComposerInput.d.ts.map +1 -1
- package/dist/Chat/ChatComposerInput.js +6 -2
- package/dist/Chat/ChatLayout.d.ts +1 -11
- package/dist/Chat/ChatLayout.d.ts.map +1 -1
- package/dist/Chat/ChatLayout.js +6 -4
- package/dist/Chat/ChatLayoutScrollButton.d.ts.map +1 -1
- package/dist/Chat/ChatLayoutScrollButton.js +4 -2
- package/dist/Chat/ChatMessage.d.ts +1 -1
- package/dist/Chat/ChatMessage.d.ts.map +1 -1
- package/dist/Chat/ChatMessage.js +8 -2
- package/dist/Chat/ChatMessageBubble.d.ts +1 -1
- package/dist/Chat/ChatMessageBubble.d.ts.map +1 -1
- package/dist/Chat/ChatMessageBubble.js +3 -1
- package/dist/Chat/ChatMessageList.d.ts +1 -1
- package/dist/Chat/ChatMessageList.d.ts.map +1 -1
- package/dist/Chat/ChatMessageList.js +3 -1
- package/dist/Chat/ChatMessageMetadata.d.ts.map +1 -1
- package/dist/Chat/ChatMessageMetadata.js +13 -8
- package/dist/Chat/ChatPastedTextToken.d.ts.map +1 -1
- package/dist/Chat/ChatPastedTextToken.js +3 -1
- package/dist/Chat/ChatSendButton.d.ts.map +1 -1
- package/dist/Chat/ChatSendButton.js +3 -1
- package/dist/Chat/index.d.ts +1 -1
- package/dist/Chat/index.d.ts.map +1 -1
- package/dist/Chat/useChatStreamScroll.d.ts +12 -1
- package/dist/Chat/useChatStreamScroll.d.ts.map +1 -1
- package/dist/Chat/useChatStreamScroll.js +43 -6
- package/dist/Chat/useSpeechRecognition.d.ts.map +1 -1
- package/dist/Chat/useSpeechRecognition.js +4 -2
- package/dist/Chat/useTriggerMenu.d.ts.map +1 -1
- package/dist/Chat/useTriggerMenu.js +4 -2
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +4 -2
- package/dist/CheckboxList/CheckboxList.d.ts +1 -1
- package/dist/CheckboxList/CheckboxList.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxList.js +3 -1
- package/dist/CheckboxList/CheckboxListItem.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListItem.js +3 -1
- package/dist/Citation/Citation.d.ts.map +1 -1
- package/dist/Citation/Citation.js +10 -2
- package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/CodeBlock/CodeBlock.js +71 -53
- package/dist/Collapsible/Collapsible.d.ts +11 -1
- package/dist/Collapsible/Collapsible.d.ts.map +1 -1
- package/dist/Collapsible/Collapsible.js +36 -4
- package/dist/CommandPalette/CommandPalette.d.ts +1 -1
- package/dist/CommandPalette/CommandPalette.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPalette.js +8 -3
- package/dist/CommandPalette/CommandPaletteInput.d.ts +1 -1
- package/dist/CommandPalette/CommandPaletteInput.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteInput.js +4 -1
- package/dist/CommandPalette/CommandPaletteList.d.ts +1 -1
- package/dist/CommandPalette/CommandPaletteList.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteList.js +4 -1
- package/dist/ContextMenu/ContextMenu.d.ts +1 -1
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +8 -4
- package/dist/ContextMenu/index.d.ts +3 -0
- package/dist/ContextMenu/index.d.ts.map +1 -1
- package/dist/ContextMenu/index.js +7 -1
- package/dist/DateInput/DateInput.d.ts +1 -1
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +10 -5
- package/dist/DateRangeInput/DateRangeInput.d.ts +1 -1
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +11 -6
- package/dist/DateTimeInput/DateTimeInput.d.ts +1 -1
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +15 -7
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +15 -12
- package/dist/Dialog/DialogHeader.d.ts +1 -1
- package/dist/Dialog/DialogHeader.d.ts.map +1 -1
- package/dist/Dialog/DialogHeader.js +7 -3
- package/dist/DropdownMenu/DropdownMenu.d.ts +1 -1
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +19 -9
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts +89 -0
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts.map +1 -0
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.js +170 -0
- package/dist/DropdownMenu/DropdownMenuContext.d.ts +17 -1
- package/dist/DropdownMenu/DropdownMenuContext.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuContext.js +18 -0
- package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts +69 -0
- package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts.map +1 -0
- package/dist/DropdownMenu/DropdownMenuRadioGroup.js +70 -0
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts +69 -0
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts.map +1 -0
- package/dist/DropdownMenu/DropdownMenuRadioItem.js +178 -0
- package/dist/DropdownMenu/index.d.ts +5 -1
- package/dist/DropdownMenu/index.d.ts.map +1 -1
- package/dist/DropdownMenu/index.js +10 -1
- package/dist/DropdownMenu/menuItemRoles.d.ts +13 -0
- package/dist/DropdownMenu/menuItemRoles.d.ts.map +1 -0
- package/dist/DropdownMenu/menuItemRoles.js +15 -0
- package/dist/EmptyState/EmptyState.d.ts +4 -1
- package/dist/EmptyState/EmptyState.d.ts.map +1 -1
- package/dist/FileInput/FileInput.d.ts.map +1 -1
- package/dist/FileInput/FileInput.js +11 -1
- package/dist/Icon/Icon.d.ts +17 -12
- package/dist/Icon/Icon.d.ts.map +1 -1
- package/dist/Icon/Icon.js +28 -20
- package/dist/Kbd/Kbd.js +1 -1
- package/dist/Layer/useLayer.d.ts +10 -0
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +23 -1
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +6 -4
- package/dist/Link/Link.d.ts +5 -1
- package/dist/Link/Link.d.ts.map +1 -1
- package/dist/Link/Link.js +32 -1
- package/dist/Markdown/Markdown.d.ts.map +1 -1
- package/dist/Markdown/Markdown.js +10 -8
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +4 -2
- package/dist/MobileNav/MobileNavToggle.d.ts +1 -1
- package/dist/MobileNav/MobileNavToggle.d.ts.map +1 -1
- package/dist/MobileNav/MobileNavToggle.js +4 -1
- package/dist/MoreMenu/MoreMenu.d.ts +1 -1
- package/dist/MoreMenu/MoreMenu.d.ts.map +1 -1
- package/dist/MoreMenu/MoreMenu.js +4 -1
- package/dist/MultiSelector/MultiSelector.d.ts +1 -1
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +13 -6
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +5 -1
- package/dist/Outline/Outline.d.ts +1 -1
- package/dist/Outline/Outline.d.ts.map +1 -1
- package/dist/Outline/Outline.js +4 -1
- package/dist/Pagination/Pagination.d.ts +1 -1
- package/dist/Pagination/Pagination.d.ts.map +1 -1
- package/dist/Pagination/Pagination.js +38 -11
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/Popover/usePopover.js +4 -1
- package/dist/PowerSearch/PowerSearch.d.ts +1 -1
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +22 -12
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.js +26 -20
- package/dist/PowerSearch/PowerSearchToken.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchToken.js +7 -3
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchValueEditor.js +34 -21
- package/dist/PowerSearch/formatFilterValue.d.ts +2 -1
- package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
- package/dist/PowerSearch/formatFilterValue.js +19 -9
- package/dist/PowerSearch/index.d.ts +2 -1
- package/dist/PowerSearch/index.d.ts.map +1 -1
- package/dist/PowerSearch/index.js +1 -0
- package/dist/PowerSearch/resolveOperatorLabel.d.ts +23 -0
- package/dist/PowerSearch/resolveOperatorLabel.d.ts.map +1 -0
- package/dist/PowerSearch/resolveOperatorLabel.js +28 -0
- package/dist/PowerSearch/types.d.ts +28 -2
- package/dist/PowerSearch/types.d.ts.map +1 -1
- package/dist/PowerSearch/usePowerSearchConfig.d.ts.map +1 -1
- package/dist/PowerSearch/usePowerSearchConfig.js +27 -27
- package/dist/PowerSearch/usePowerSearchSource.d.ts.map +1 -1
- package/dist/PowerSearch/usePowerSearchSource.js +15 -8
- package/dist/Resizable/ResizeHandle.d.ts +1 -1
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +4 -1
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +52 -14
- package/dist/SideNav/SideNav.d.ts.map +1 -1
- package/dist/SideNav/SideNav.js +4 -2
- package/dist/SideNav/SideNavCollapseButton.d.ts.map +1 -1
- package/dist/SideNav/SideNavCollapseButton.js +3 -1
- package/dist/SideNav/SideNavHeading.d.ts.map +1 -1
- package/dist/SideNav/SideNavHeading.js +5 -3
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +7 -1
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +4 -2
- package/dist/TabList/Tab.d.ts.map +1 -1
- package/dist/TabList/Tab.js +2 -2
- package/dist/TabList/TabList.d.ts +1 -1
- package/dist/TabList/TabList.d.ts.map +1 -1
- package/dist/TabList/TabList.js +6 -1
- package/dist/TabList/TabMenu.d.ts.map +1 -1
- package/dist/TabList/TabMenu.js +1 -1
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +29 -16
- package/dist/Table/Table.d.ts.map +1 -1
- package/dist/Table/Table.js +5 -3
- package/dist/Table/index.d.ts +2 -0
- package/dist/Table/index.d.ts.map +1 -1
- package/dist/Table/index.js +1 -0
- package/dist/Table/plugins/columnResize/useTableColumnResize.js +1 -1
- package/dist/Table/plugins/filtering/useTableFiltering.d.ts.map +1 -1
- package/dist/Table/plugins/filtering/useTableFiltering.js +56 -19
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts +1 -1
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts.map +1 -1
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.js +12 -5
- package/dist/Table/plugins/pagination/useTablePagination.d.ts.map +1 -1
- package/dist/Table/plugins/pagination/useTablePagination.js +6 -3
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +8 -6
- package/dist/Table/plugins/rowIndex/useTableRowIndex.d.ts +1 -1
- package/dist/Table/plugins/rowIndex/useTableRowIndex.js +1 -1
- package/dist/Table/plugins/selection/useTableSelection.d.ts.map +1 -1
- package/dist/Table/plugins/selection/useTableSelection.js +5 -2
- package/dist/Table/plugins/sortable/useTableSortable.d.ts.map +1 -1
- package/dist/Table/plugins/sortable/useTableSortable.js +6 -4
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.js +2 -2
- package/dist/Table/plugins/tree/index.d.ts +5 -0
- package/dist/Table/plugins/tree/index.d.ts.map +1 -0
- package/dist/Table/plugins/tree/index.js +4 -0
- package/dist/Table/plugins/tree/useTableTreeData.d.ts +38 -0
- package/dist/Table/plugins/tree/useTableTreeData.d.ts.map +1 -0
- package/dist/Table/plugins/tree/useTableTreeData.js +358 -0
- package/dist/Table/plugins/tree/useTableTreeState.d.ts +51 -0
- package/dist/Table/plugins/tree/useTableTreeState.d.ts.map +1 -0
- package/dist/Table/plugins/tree/useTableTreeState.js +175 -0
- package/dist/Table/types.d.ts +17 -10
- package/dist/Table/types.d.ts.map +1 -1
- package/dist/Table/useBaseTablePlugins.d.ts.map +1 -1
- package/dist/Table/useBaseTablePlugins.js +6 -3
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +5 -1
- package/dist/Thumbnail/Thumbnail.d.ts.map +1 -1
- package/dist/Thumbnail/Thumbnail.js +8 -2
- package/dist/TimeInput/TimeInput.d.ts +1 -1
- package/dist/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +7 -2
- package/dist/Timestamp/Timestamp.d.ts.map +1 -1
- package/dist/Timestamp/Timestamp.js +18 -3
- package/dist/Toast/Toast.d.ts.map +1 -1
- package/dist/Toast/Toast.js +3 -1
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +3 -1
- package/dist/Token/Token.d.ts.map +1 -1
- package/dist/Token/Token.js +8 -2
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +3 -1
- package/dist/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/Toolbar/Toolbar.js +8 -1
- package/dist/TopNav/TopNav.d.ts +2 -1
- package/dist/TopNav/TopNav.d.ts.map +1 -1
- package/dist/TopNav/TopNav.js +4 -1
- package/dist/TopNav/TopNavHeading.d.ts.map +1 -1
- package/dist/TopNav/TopNavHeading.js +5 -3
- package/dist/TreeList/TreeList.d.ts.map +1 -1
- package/dist/TreeList/TreeList.js +5 -1
- package/dist/TreeList/TreeListItem.d.ts.map +1 -1
- package/dist/TreeList/TreeListItem.js +7 -1
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +8 -4
- package/dist/Typeahead/Typeahead.d.ts.map +1 -1
- package/dist/Typeahead/Typeahead.js +3 -1
- package/dist/VisuallyHidden/VisuallyHidden.d.ts +1 -0
- package/dist/VisuallyHidden/VisuallyHidden.d.ts.map +1 -1
- package/dist/VisuallyHidden/VisuallyHidden.js +1 -0
- package/dist/astryx.css +38 -4
- package/dist/astryx.umd.js +62 -60
- package/dist/astryx.umd.js.map +4 -4
- package/dist/authoring/doc.d.ts +145 -0
- package/dist/authoring/doc.d.ts.map +1 -0
- package/dist/authoring/doc.js +100 -0
- package/dist/authoring/index.d.ts +29 -0
- package/dist/authoring/index.d.ts.map +1 -0
- package/dist/authoring/index.js +28 -0
- package/dist/authoring/integration.d.ts +35 -0
- package/dist/authoring/integration.d.ts.map +1 -0
- package/dist/authoring/integration.js +30 -0
- package/dist/authoring/template.d.ts +66 -0
- package/dist/authoring/template.d.ts.map +1 -0
- package/dist/authoring/template.js +55 -0
- package/dist/config.d.ts +80 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +40 -0
- package/dist/docs-types.d.ts +13 -4
- package/dist/docs-types.d.ts.map +1 -1
- package/dist/i18n/InternationalizationContext.d.ts +12 -0
- package/dist/i18n/InternationalizationContext.d.ts.map +1 -0
- package/dist/i18n/InternationalizationContext.js +29 -0
- package/dist/i18n/InternationalizationProvider.d.ts +61 -0
- package/dist/i18n/InternationalizationProvider.d.ts.map +1 -0
- package/dist/i18n/InternationalizationProvider.js +44 -0
- package/dist/i18n/index.d.ts +24 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +21 -0
- package/dist/i18n/resolve.d.ts +22 -0
- package/dist/i18n/resolve.d.ts.map +1 -0
- package/dist/i18n/resolve.js +141 -0
- package/dist/i18n/translator.d.ts +25 -0
- package/dist/i18n/translator.d.ts.map +1 -0
- package/dist/i18n/translator.js +1 -0
- package/dist/i18n/types.d.ts +47 -0
- package/dist/i18n/types.d.ts.map +1 -0
- package/dist/i18n/types.js +1 -0
- package/dist/i18n/useTranslator.d.ts +15 -0
- package/dist/i18n/useTranslator.d.ts.map +1 -0
- package/dist/i18n/useTranslator.js +39 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/theme/Theme.js +1 -1
- package/dist/theme/defineTheme.d.ts +1 -1
- package/dist/theme/defineTheme.js +1 -1
- package/dist/theme/hct.d.ts +0 -1
- package/dist/theme/hct.d.ts.map +1 -1
- package/dist/theme/hct.js +0 -3
- package/dist/utils/color.d.ts +13 -1
- package/dist/utils/color.d.ts.map +1 -1
- package/dist/utils/color.js +23 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -1
- package/locales/en.json +754 -0
- package/locales/pseudo.json +566 -0
- package/package.json +23 -2
- package/src/AlertDialog/AlertDialog.doc.mjs +5 -0
- package/src/AlertDialog/AlertDialog.tsx +4 -1
- package/src/AppShell/AppShell.doc.mjs +8 -2
- package/src/AppShell/AppShell.tsx +3 -1
- package/src/AvatarGroup/AvatarGroup.tsx +4 -1
- package/src/Banner/Banner.tsx +10 -5
- package/src/Breadcrumbs/Breadcrumbs.tsx +4 -1
- package/src/Button/Button.doc.mjs +8 -0
- package/src/Button/Button.test.tsx +27 -0
- package/src/Button/Button.tsx +51 -5
- package/src/ButtonGroup/ButtonGroup.test.tsx +386 -2
- package/src/ButtonGroup/ButtonGroup.tsx +27 -11
- package/src/Calendar/Calendar.test.tsx +103 -2
- package/src/Calendar/Calendar.tsx +29 -6
- package/src/Card/Card.doc.mjs +3 -3
- package/src/Carousel/Carousel.tsx +10 -7
- package/src/Chat/ChatComposer.tsx +5 -1
- package/src/Chat/ChatComposerDrawer.tsx +9 -2
- package/src/Chat/ChatComposerInput.tsx +10 -4
- package/src/Chat/ChatLayout.test.tsx +127 -2
- package/src/Chat/ChatLayout.tsx +5 -12
- package/src/Chat/ChatLayoutScrollButton.tsx +4 -2
- package/src/Chat/ChatMessage.tsx +5 -1
- package/src/Chat/ChatMessageBubble.tsx +2 -0
- package/src/Chat/ChatMessageList.doc.mjs +1 -1
- package/src/Chat/ChatMessageList.tsx +2 -0
- package/src/Chat/ChatMessageMetadata.tsx +15 -9
- package/src/Chat/ChatPastedTextToken.tsx +3 -1
- package/src/Chat/ChatSendButton.tsx +3 -1
- package/src/Chat/ChatToolCalls.doc.mjs +1 -1
- package/src/Chat/index.ts +1 -0
- package/src/Chat/useChatStreamScroll.test.tsx +168 -0
- package/src/Chat/useChatStreamScroll.ts +67 -11
- package/src/Chat/useSpeechRecognition.ts +11 -2
- package/src/Chat/useTriggerMenu.tsx +4 -2
- package/src/CheckboxInput/CheckboxInput.doc.mjs +1 -1
- package/src/CheckboxInput/CheckboxInput.test.tsx +16 -0
- package/src/CheckboxInput/CheckboxInput.tsx +4 -2
- package/src/CheckboxList/CheckboxList.doc.mjs +6 -1
- package/src/CheckboxList/CheckboxList.tsx +2 -0
- package/src/CheckboxList/CheckboxListItem.tsx +7 -1
- package/src/Citation/Citation.tsx +4 -2
- package/src/ClickableCard/ClickableCard.doc.mjs +1 -1
- package/src/CodeBlock/CodeBlock.tsx +91 -40
- package/src/Collapsible/Collapsible.doc.mjs +7 -0
- package/src/Collapsible/Collapsible.test.tsx +80 -0
- package/src/Collapsible/Collapsible.tsx +58 -5
- package/src/CommandPalette/CommandPalette.tsx +10 -3
- package/src/CommandPalette/CommandPaletteInput.test.tsx +1 -1
- package/src/CommandPalette/CommandPaletteInput.tsx +5 -1
- package/src/CommandPalette/CommandPaletteList.tsx +4 -1
- package/src/ContextMenu/ContextMenu.test.tsx +75 -1
- package/src/ContextMenu/ContextMenu.tsx +14 -6
- package/src/ContextMenu/index.ts +15 -0
- package/src/DateInput/DateInput.doc.mjs +2 -2
- package/src/DateInput/DateInput.test.tsx +17 -5
- package/src/DateInput/DateInput.tsx +13 -5
- package/src/DateRangeInput/DateRangeInput.doc.mjs +1 -1
- package/src/DateRangeInput/DateRangeInput.tsx +14 -6
- package/src/DateTimeInput/DateTimeInput.doc.mjs +2 -2
- package/src/DateTimeInput/DateTimeInput.tsx +17 -7
- package/src/Dialog/Dialog.tsx +11 -15
- package/src/Dialog/DialogHeader.tsx +7 -3
- package/src/DropdownMenu/DropdownMenu.doc.mjs +23 -0
- package/src/DropdownMenu/DropdownMenu.tsx +23 -14
- package/src/DropdownMenu/DropdownMenuCheckboxItem.doc.mjs +95 -0
- package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +237 -0
- package/src/DropdownMenu/DropdownMenuContext.tsx +29 -1
- package/src/DropdownMenu/DropdownMenuItem.doc.mjs +7 -1
- package/src/DropdownMenu/DropdownMenuRadioGroup.doc.mjs +80 -0
- package/src/DropdownMenu/DropdownMenuRadioGroup.tsx +119 -0
- package/src/DropdownMenu/DropdownMenuRadioItem.doc.mjs +80 -0
- package/src/DropdownMenu/DropdownMenuRadioItem.tsx +232 -0
- package/src/DropdownMenu/DropdownMenuSelectable.test.tsx +163 -0
- package/src/DropdownMenu/index.ts +23 -3
- package/src/DropdownMenu/menuItemRoles.ts +22 -0
- package/src/EmptyState/EmptyState.doc.mjs +3 -3
- package/src/EmptyState/EmptyState.tsx +4 -1
- package/src/Field/Field.doc.mjs +3 -3
- package/src/Field/FieldLabel.doc.mjs +1 -1
- package/src/FileInput/FileInput.test.tsx +40 -1
- package/src/FileInput/FileInput.tsx +12 -1
- package/src/Grid/Grid.doc.mjs +5 -5
- package/src/Icon/Icon.test.tsx +46 -0
- package/src/Icon/Icon.tsx +37 -24
- package/src/InputGroup/InputGroup.doc.mjs +1 -1
- package/src/Kbd/Kbd.test.tsx +26 -0
- package/src/Kbd/Kbd.tsx +1 -1
- package/src/Layer/useLayer.doc.mjs +8 -5
- package/src/Layer/useLayer.test.tsx +136 -1
- package/src/Layer/useLayer.tsx +34 -2
- package/src/Lightbox/Lightbox.doc.mjs +7 -2
- package/src/Lightbox/Lightbox.tsx +6 -4
- package/src/Link/Link.test.tsx +74 -2
- package/src/Link/Link.tsx +48 -1
- package/src/Markdown/Markdown.tsx +12 -4
- package/src/MobileNav/MobileNav.tsx +4 -2
- package/src/MobileNav/MobileNavToggle.tsx +5 -3
- package/src/MoreMenu/MoreMenu.tsx +4 -1
- package/src/MultiSelector/MultiSelector.tsx +14 -5
- package/src/NumberInput/NumberInput.doc.mjs +2 -2
- package/src/NumberInput/NumberInput.tsx +3 -1
- package/src/Outline/Outline.tsx +4 -1
- package/src/OverflowList/OverflowList.doc.mjs +2 -2
- package/src/Pagination/Pagination.tsx +35 -12
- package/src/Popover/usePopover.tsx +6 -1
- package/src/PowerSearch/PowerSearch.doc.mjs +9 -4
- package/src/PowerSearch/PowerSearch.tsx +22 -10
- package/src/PowerSearch/PowerSearchEditPopover.tsx +27 -20
- package/src/PowerSearch/PowerSearchToken.tsx +17 -6
- package/src/PowerSearch/PowerSearchValueEditor.tsx +34 -21
- package/src/PowerSearch/formatFilterValue.test.ts +282 -0
- package/src/PowerSearch/formatFilterValue.ts +21 -8
- package/src/PowerSearch/index.ts +5 -0
- package/src/PowerSearch/resolveOperatorLabel.ts +34 -0
- package/src/PowerSearch/types.ts +33 -9
- package/src/PowerSearch/usePowerSearchConfig.ts +59 -27
- package/src/PowerSearch/usePowerSearchSource.ts +17 -8
- package/src/RadioList/RadioList.doc.mjs +1 -1
- package/src/Resizable/ResizeHandle.tsx +4 -1
- package/src/Section/Section.doc.mjs +4 -4
- package/src/SelectableCard/SelectableCard.doc.mjs +1 -1
- package/src/Selector/Selector.doc.mjs +6 -3
- package/src/Selector/Selector.test.tsx +114 -6
- package/src/Selector/Selector.tsx +68 -17
- package/src/Selector/SelectorOption.doc.mjs +1 -1
- package/src/SideNav/SideNav.tsx +4 -2
- package/src/SideNav/SideNavCollapseButton.tsx +3 -1
- package/src/SideNav/SideNavHeading.tsx +5 -3
- package/src/SideNav/SideNavItem.doc.mjs +2 -2
- package/src/SideNav/SideNavItem.tsx +3 -1
- package/src/Slider/Slider.doc.mjs +2 -2
- package/src/Stack/Stack.doc.mjs +10 -10
- package/src/Switch/Switch.doc.mjs +3 -3
- package/src/Switch/Switch.test.tsx +16 -0
- package/src/Switch/Switch.tsx +4 -2
- package/src/TabList/Tab.tsx +5 -1
- package/src/TabList/TabList.doc.mjs +3 -3
- package/src/TabList/TabList.test.tsx +66 -0
- package/src/TabList/TabList.tsx +12 -1
- package/src/TabList/TabMenu.tsx +4 -1
- package/src/Table/BaseTable.tsx +36 -19
- package/src/Table/Table.doc.mjs +2 -0
- package/src/Table/Table.test.tsx +132 -1
- package/src/Table/Table.tsx +6 -4
- package/src/Table/index.ts +7 -0
- package/src/Table/plugins/columnResize/useTableColumnResize.tsx +1 -1
- package/src/Table/plugins/filtering/useTableFiltering.tsx +31 -30
- package/src/Table/plugins/groupedRows/useTableGroupedRows.tsx +7 -5
- package/src/Table/plugins/pagination/useTablePagination.tsx +4 -1
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +9 -8
- package/src/Table/plugins/rowIndex/useTableRowIndex.tsx +1 -1
- package/src/Table/plugins/selection/useTableSelection.tsx +6 -7
- package/src/Table/plugins/sortable/useTableSortable.tsx +8 -5
- package/src/Table/plugins/stickyColumns/useTableStickyColumns.tsx +4 -4
- package/src/Table/plugins/tree/index.ts +12 -0
- package/src/Table/plugins/tree/useTableTreeData-perf.test.tsx +163 -0
- package/src/Table/plugins/tree/useTableTreeData.test.tsx +594 -0
- package/src/Table/plugins/tree/useTableTreeData.tsx +495 -0
- package/src/Table/plugins/tree/useTableTreeState.test.tsx +636 -0
- package/src/Table/plugins/tree/useTableTreeState.tsx +253 -0
- package/src/Table/types.ts +18 -12
- package/src/Table/useBaseTablePlugins.ts +6 -2
- package/src/Table/useTableFiltering.doc.mjs +2 -2
- package/src/Table/useTableGroupedRows.doc.mjs +3 -3
- package/src/Table/useTableSortable.doc.mjs +11 -11
- package/src/Table/useTableTreeData.doc.mjs +75 -0
- package/src/Table/useTableTreeState.doc.mjs +98 -0
- package/src/Text/Text.doc.mjs +2 -2
- package/src/TextArea/TextArea.doc.mjs +1 -1
- package/src/TextInput/TextInput.doc.mjs +1 -1
- package/src/TextInput/TextInput.tsx +3 -1
- package/src/Thumbnail/Thumbnail.tsx +4 -2
- package/src/TimeInput/TimeInput.doc.mjs +2 -2
- package/src/TimeInput/TimeInput.tsx +6 -2
- package/src/Timestamp/Timestamp.doc.mjs +4 -4
- package/src/Timestamp/Timestamp.test.tsx +120 -7
- package/src/Timestamp/Timestamp.tsx +21 -1
- package/src/Toast/Toast.tsx +3 -1
- package/src/Toast/ToastViewport.tsx +3 -1
- package/src/Token/Token.tsx +4 -2
- package/src/Tokenizer/Tokenizer.doc.mjs +2 -2
- package/src/Tokenizer/Tokenizer.tsx +4 -4
- package/src/Toolbar/Toolbar.doc.mjs +1 -1
- package/src/Toolbar/Toolbar.tsx +10 -3
- package/src/TopNav/TopNav.doc.mjs +1 -0
- package/src/TopNav/TopNav.test.tsx +30 -0
- package/src/TopNav/TopNav.tsx +6 -4
- package/src/TopNav/TopNavHeading.tsx +5 -3
- package/src/TreeList/TreeList.tsx +5 -1
- package/src/TreeList/TreeListItem.tsx +6 -1
- package/src/Typeahead/BaseTypeahead.tsx +11 -4
- package/src/Typeahead/Typeahead.doc.mjs +1 -1
- package/src/Typeahead/Typeahead.tsx +3 -1
- package/src/VisuallyHidden/VisuallyHidden.tsx +1 -0
- package/src/authoring/doc.ts +166 -0
- package/src/authoring/index.test.ts +52 -0
- package/src/authoring/index.ts +50 -0
- package/src/authoring/integration.ts +42 -0
- package/src/authoring/template.ts +74 -0
- package/src/config.test.ts +16 -0
- package/src/config.ts +92 -0
- package/src/docPropLiterals.test.ts +938 -0
- package/src/docs-types.ts +15 -10
- package/src/i18n/InternationalizationContext.ts +39 -0
- package/src/i18n/InternationalizationProvider.doc.mjs +72 -0
- package/src/i18n/InternationalizationProvider.tsx +82 -0
- package/src/i18n/__tests__/e2e-pagination.test.tsx +172 -0
- package/src/i18n/__tests__/e2e-powersearch.test.tsx +130 -0
- package/src/i18n/__tests__/resolve.test.ts +284 -0
- package/src/i18n/index.ts +32 -0
- package/src/i18n/resolve.ts +165 -0
- package/src/i18n/translator.ts +31 -0
- package/src/i18n/types.ts +53 -0
- package/src/i18n/useTranslator.doc.mjs +46 -0
- package/src/i18n/useTranslator.ts +50 -0
- package/src/index.ts +3 -0
- package/src/theme/Theme.doc.mjs +4 -4
- package/src/theme/Theme.tsx +1 -1
- package/src/theme/defineTheme.ts +1 -1
- package/src/theme/hct.ts +0 -4
- package/src/utils/color.test.ts +101 -1
- package/src/utils/color.ts +23 -1
- package/src/utils/index.ts +8 -1
- package/dist/NavItem/index.d.ts +0 -9
- package/dist/NavItem/index.d.ts.map +0 -1
- package/dist/NavItem/index.js +0 -10
- package/src/NavItem/index.ts +0 -11
|
@@ -39,6 +39,7 @@ import type {BaseProps} from '../BaseProps';
|
|
|
39
39
|
import {useMenuHover} from '../hooks/useMenuHover';
|
|
40
40
|
import {NavHeadingCloseContext} from '../NavMenu/NavMenuContext';
|
|
41
41
|
import {themeProps} from '../utils/themeProps';
|
|
42
|
+
import {useTranslator} from '../i18n';
|
|
42
43
|
|
|
43
44
|
// =============================================================================
|
|
44
45
|
// Styles
|
|
@@ -318,6 +319,7 @@ export function TopNavHeading({
|
|
|
318
319
|
ref,
|
|
319
320
|
...props
|
|
320
321
|
}: TopNavHeadingProps) {
|
|
322
|
+
const t = useTranslator();
|
|
321
323
|
const LinkComponent = useLinkComponent(as);
|
|
322
324
|
// Support both headingHref and legacy href
|
|
323
325
|
const headingHref = headingHrefProp ?? href;
|
|
@@ -329,7 +331,7 @@ export function TopNavHeading({
|
|
|
329
331
|
const rootRef = useRef<HTMLElement>(null);
|
|
330
332
|
|
|
331
333
|
const popover = usePopover({
|
|
332
|
-
dialogLabel: '
|
|
334
|
+
dialogLabel: t('@astryx.topNav.heading.dialogLabel'),
|
|
333
335
|
hasCloseButton: false,
|
|
334
336
|
});
|
|
335
337
|
|
|
@@ -494,7 +496,7 @@ export function TopNavHeading({
|
|
|
494
496
|
{renderTextContent(
|
|
495
497
|
<button
|
|
496
498
|
type="button"
|
|
497
|
-
aria-label=
|
|
499
|
+
aria-label={t('@astryx.topNav.heading.openMenu')}
|
|
498
500
|
onClick={e => {
|
|
499
501
|
e.stopPropagation();
|
|
500
502
|
triggerProps.onClick();
|
|
@@ -557,7 +559,7 @@ export function TopNavHeading({
|
|
|
557
559
|
showChevron ? (
|
|
558
560
|
<button
|
|
559
561
|
type="button"
|
|
560
|
-
aria-label=
|
|
562
|
+
aria-label={t('@astryx.topNav.heading.openMenu')}
|
|
561
563
|
onClick={e => {
|
|
562
564
|
e.stopPropagation();
|
|
563
565
|
triggerProps.onClick();
|
|
@@ -208,8 +208,12 @@ export function TreeList({
|
|
|
208
208
|
// to this treeitem's own row — never a descendant treeitem's action inside an
|
|
209
209
|
// expanded group.
|
|
210
210
|
const activateItem = useCallback((current: HTMLElement): boolean => {
|
|
211
|
+
// The chevron toggle is marked with `data-tree-toggle` (set by
|
|
212
|
+
// TreeListItem) so this filter stays stable across locales — matching by
|
|
213
|
+
// aria-label would break under any locale where "Toggle children" is
|
|
214
|
+
// translated.
|
|
211
215
|
const candidates = current.querySelectorAll<HTMLElement>(
|
|
212
|
-
'a[href], button:not([
|
|
216
|
+
'a[href], button:not([data-tree-toggle])',
|
|
213
217
|
);
|
|
214
218
|
for (const candidate of candidates) {
|
|
215
219
|
if (candidate.closest('[role="treeitem"]') === current) {
|
|
@@ -31,6 +31,7 @@ import {TreeListBranches} from './TreeListBranches';
|
|
|
31
31
|
import type {TreeListDensity} from './TreeListTypes';
|
|
32
32
|
import {treeItemScope} from './treeListItem.markers.stylex';
|
|
33
33
|
import {themeProps} from '../utils/themeProps';
|
|
34
|
+
import {useTranslator} from '../i18n';
|
|
34
35
|
|
|
35
36
|
// =============================================================================
|
|
36
37
|
// Styles
|
|
@@ -299,6 +300,7 @@ export function TreeListItem({
|
|
|
299
300
|
setSize,
|
|
300
301
|
isTabbable,
|
|
301
302
|
}: TreeListItemInternalProps) {
|
|
303
|
+
const t = useTranslator();
|
|
302
304
|
const labelId = useId();
|
|
303
305
|
const descriptionId = useId();
|
|
304
306
|
const LinkComponent = useLinkComponent();
|
|
@@ -374,7 +376,10 @@ export function TreeListItem({
|
|
|
374
376
|
<button
|
|
375
377
|
type="button"
|
|
376
378
|
aria-expanded={isExpanded}
|
|
377
|
-
aria-label=
|
|
379
|
+
aria-label={t('@astryx.treeList.toggleChildren')}
|
|
380
|
+
// Stable identity for TreeList's activateItem selector — do not
|
|
381
|
+
// remove without also updating TreeList.tsx.
|
|
382
|
+
data-tree-toggle=""
|
|
378
383
|
disabled={isDisabled}
|
|
379
384
|
// Roving tabindex lives on the treeitem row; the chevron toggle is not
|
|
380
385
|
// a separate tab stop. Row-level Enter/Space forwards to this button.
|
|
@@ -44,6 +44,7 @@ import {getKey, mergeProps, mergeRefs} from '../utils';
|
|
|
44
44
|
import type {BaseProps} from '../BaseProps';
|
|
45
45
|
import type {SearchableItem, SearchSource} from './types';
|
|
46
46
|
import {themeProps} from '../utils/themeProps';
|
|
47
|
+
import {useTranslator} from '../i18n';
|
|
47
48
|
|
|
48
49
|
// =============================================================================
|
|
49
50
|
// Types
|
|
@@ -302,10 +303,10 @@ export const BaseTypeahead = function BaseTypeahead<T extends SearchableItem>({
|
|
|
302
303
|
value,
|
|
303
304
|
onChange,
|
|
304
305
|
renderItem,
|
|
305
|
-
placeholder
|
|
306
|
+
placeholder: placeholderFromProps,
|
|
306
307
|
hasEntriesOnFocus = false,
|
|
307
308
|
maxMenuItems = 10,
|
|
308
|
-
emptySearchResultsText
|
|
309
|
+
emptySearchResultsText: emptySearchResultsTextFromProps,
|
|
309
310
|
isDisabled = false,
|
|
310
311
|
isFocusableDisabled = false,
|
|
311
312
|
hasAutoFocus = false,
|
|
@@ -321,6 +322,12 @@ export const BaseTypeahead = function BaseTypeahead<T extends SearchableItem>({
|
|
|
321
322
|
size = 'md',
|
|
322
323
|
ref,
|
|
323
324
|
}: BaseTypeaheadProps<T>) {
|
|
325
|
+
const t = useTranslator();
|
|
326
|
+
const placeholder =
|
|
327
|
+
placeholderFromProps ?? t('@astryx.typeahead.searchPlaceholder');
|
|
328
|
+
const emptySearchResultsText =
|
|
329
|
+
emptySearchResultsTextFromProps ??
|
|
330
|
+
t('@astryx.typeahead.emptySearchResults');
|
|
324
331
|
const generatedId = useId();
|
|
325
332
|
const inputId = externalInputId ?? generatedId;
|
|
326
333
|
const listboxId = useId();
|
|
@@ -759,7 +766,7 @@ export const BaseTypeahead = function BaseTypeahead<T extends SearchableItem>({
|
|
|
759
766
|
{isLoading && (
|
|
760
767
|
<span
|
|
761
768
|
role="status"
|
|
762
|
-
aria-label=
|
|
769
|
+
aria-label={t('@astryx.typeahead.loading')}
|
|
763
770
|
{...stylex.props(styles.loadingSpinner)}>
|
|
764
771
|
<Icon icon="clock" size="sm" color="secondary" />
|
|
765
772
|
</span>
|
|
@@ -769,7 +776,7 @@ export const BaseTypeahead = function BaseTypeahead<T extends SearchableItem>({
|
|
|
769
776
|
<div
|
|
770
777
|
id={listboxId}
|
|
771
778
|
role="listbox"
|
|
772
|
-
aria-label=
|
|
779
|
+
aria-label={t('@astryx.typeahead.searchResults')}
|
|
773
780
|
{...mergeProps(
|
|
774
781
|
themeProps('typeahead-dropdown'),
|
|
775
782
|
stylex.props(styles.dropdown),
|
|
@@ -49,6 +49,7 @@ import type {BaseProps} from '../BaseProps';
|
|
|
49
49
|
import type {SizeValue} from '../utils/types';
|
|
50
50
|
import type {SearchableItem, SearchSource} from './types';
|
|
51
51
|
import {themeProps} from '../utils/themeProps';
|
|
52
|
+
import {useTranslator} from '../i18n';
|
|
52
53
|
|
|
53
54
|
export type {
|
|
54
55
|
InputStatus as TypeaheadStatus,
|
|
@@ -249,6 +250,7 @@ export function Typeahead<T extends SearchableItem>({
|
|
|
249
250
|
style,
|
|
250
251
|
'data-testid': testId,
|
|
251
252
|
}: TypeaheadProps<T>) {
|
|
253
|
+
const t = useTranslator();
|
|
252
254
|
const size = useSize(sizeProp, 'md');
|
|
253
255
|
const inputId = useId();
|
|
254
256
|
const inputLabelId = useId();
|
|
@@ -460,7 +462,7 @@ export function Typeahead<T extends SearchableItem>({
|
|
|
460
462
|
/>
|
|
461
463
|
{hasClear && value && !isDisabled && (
|
|
462
464
|
<InputClearButton
|
|
463
|
-
label=
|
|
465
|
+
label={t('@astryx.typeahead.clearSelection')}
|
|
464
466
|
onClick={e => {
|
|
465
467
|
e.stopPropagation();
|
|
466
468
|
handleClear();
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* - /packages/core/src/VisuallyHidden/VisuallyHidden.doc.mjs
|
|
14
14
|
* - /packages/core/src/VisuallyHidden/VisuallyHidden.test.tsx
|
|
15
15
|
* - /apps/storybook/stories/VisuallyHidden.stories.tsx
|
|
16
|
+
* - /packages/cli/templates/blocks/components/VisuallyHidden/ (showcase blocks)
|
|
16
17
|
*/
|
|
17
18
|
|
|
18
19
|
import {createElement, type ElementType, type ReactNode, type Ref} from 'react';
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file doc.ts
|
|
5
|
+
* @input A component/function/generic doc object (without the `type` tag).
|
|
6
|
+
* @output Type-preserving `createComponentDoc`/`createFunctionDoc`/`createDoc`
|
|
7
|
+
* helpers plus the doc-authoring TypeScript surface.
|
|
8
|
+
* @position Integration-author authoring surface. See `./index.ts` for why
|
|
9
|
+
* these authoring factories live in `@astryxdesign/core`.
|
|
10
|
+
*
|
|
11
|
+
* A doc describes a documentable unit of the design system so the CLI and docs
|
|
12
|
+
* surfaces can list, search, and render it. There are three kinds, each a tiny
|
|
13
|
+
* runtime identity helper that stamps a `type` discriminant:
|
|
14
|
+
*
|
|
15
|
+
* - `createComponentDoc` -> `type: 'component'` — a component (or a family).
|
|
16
|
+
* - `createFunctionDoc` -> `type: 'function'` — any function, including
|
|
17
|
+
* hooks: an "inputs + outputs" surface (`params` + `returns`).
|
|
18
|
+
* - `createDoc` -> `type: 'generic'` — reference/topic docs.
|
|
19
|
+
*
|
|
20
|
+
* These factories do NOT validate. Validation happens at the CLI load boundary,
|
|
21
|
+
* where doc discovery runs the loaded value through a schema that accepts BOTH
|
|
22
|
+
* the stamped formats and the legacy loose `export const docs = {...}` shape.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Fields shared by every doc kind (component + function + generic).
|
|
27
|
+
*
|
|
28
|
+
* `group` vs `parent` are distinct:
|
|
29
|
+
* - `group` is a FLAT sidebar bucket label; many docs can share it and it is
|
|
30
|
+
* NOT an inheritance key.
|
|
31
|
+
* - `parent` is a DIRECTED inheritance/composition pointer — a doc naming the
|
|
32
|
+
* doc it belongs to (e.g. a sub-component naming its parent component). The
|
|
33
|
+
* legacy `subComponentOf` field is a synonym.
|
|
34
|
+
*
|
|
35
|
+
* `relatedDocs` is a single flat curated cross-reference list; it replaces the
|
|
36
|
+
* legacy split `relatedComponents` + `relatedHooks`.
|
|
37
|
+
*/
|
|
38
|
+
export interface AstryxBaseDocInput {
|
|
39
|
+
/** Name of the documented unit, without any prefix, PascalCase. Required. */
|
|
40
|
+
name: string;
|
|
41
|
+
/** Human-readable display name for gallery/sidebar. */
|
|
42
|
+
displayName?: string;
|
|
43
|
+
/** Short description. */
|
|
44
|
+
description?: string;
|
|
45
|
+
/** Usage documentation (description, best practices, anatomy, slotElements). */
|
|
46
|
+
usage?: unknown;
|
|
47
|
+
/** Flat sidebar grouping label (not an inheritance key). */
|
|
48
|
+
group?: string;
|
|
49
|
+
/** Overview-page functional category. */
|
|
50
|
+
category?: string;
|
|
51
|
+
/** CLI fuzzy-search keywords. */
|
|
52
|
+
keywords?: string[];
|
|
53
|
+
/** Directed inheritance/composition pointer to the doc this belongs to. */
|
|
54
|
+
parent?: string;
|
|
55
|
+
/** Flat curated cross-reference list of related doc names. */
|
|
56
|
+
relatedDocs?: string[];
|
|
57
|
+
/** Hide the whole doc from human-facing UI (stays importable/discoverable). */
|
|
58
|
+
hidden?: boolean;
|
|
59
|
+
/** Exclude from the categorized overview page (kept in sidebar/CLI). */
|
|
60
|
+
isHiddenFromOverview?: boolean;
|
|
61
|
+
/** Any additional fields the rich doc surface carries. */
|
|
62
|
+
[key: string]: unknown;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** A single documented prop (mirrors `PropDoc` from core docs-types). */
|
|
66
|
+
export interface AstryxPropInput {
|
|
67
|
+
name: string;
|
|
68
|
+
type: string;
|
|
69
|
+
description: string;
|
|
70
|
+
default?: string;
|
|
71
|
+
required?: boolean;
|
|
72
|
+
[key: string]: unknown;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** A single documented param (mirrors `HookParamDoc`). */
|
|
76
|
+
export interface AstryxParamInput {
|
|
77
|
+
name: string;
|
|
78
|
+
type: string;
|
|
79
|
+
description: string;
|
|
80
|
+
default?: string;
|
|
81
|
+
required?: boolean;
|
|
82
|
+
[key: string]: unknown;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** A single documented return field (mirrors `HookReturnDoc`). */
|
|
86
|
+
export interface AstryxReturnInput {
|
|
87
|
+
name: string;
|
|
88
|
+
type: string;
|
|
89
|
+
description: string;
|
|
90
|
+
[key: string]: unknown;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Input accepted by {@link createComponentDoc}. A component (or a family). The
|
|
95
|
+
* `type` discriminant is injected by the factory. `anatomy`/`slotElements` live
|
|
96
|
+
* inside `usage`; `importPath` is DERIVED (never authored).
|
|
97
|
+
*/
|
|
98
|
+
export interface AstryxComponentDocInput extends AstryxBaseDocInput {
|
|
99
|
+
/** All public props for the component. */
|
|
100
|
+
props: AstryxPropInput[];
|
|
101
|
+
/** Theming/selector-surface metadata. */
|
|
102
|
+
theming?: unknown;
|
|
103
|
+
/** Interactive-preview playground configuration. */
|
|
104
|
+
playground?: unknown;
|
|
105
|
+
/** Short code examples rendered after the props table. */
|
|
106
|
+
examples?: unknown[];
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Input accepted by {@link createFunctionDoc}. Covers any function, including
|
|
111
|
+
* hooks: an inputs (`params`) + outputs (`returns`) surface. The `type`
|
|
112
|
+
* discriminant is injected by the factory; `importPath` is DERIVED.
|
|
113
|
+
*/
|
|
114
|
+
export interface AstryxFunctionDocInput extends AstryxBaseDocInput {
|
|
115
|
+
/** Function/hook parameters or options-object fields. */
|
|
116
|
+
params: AstryxParamInput[];
|
|
117
|
+
/** Return value documentation. One entry per field (or a single primitive). */
|
|
118
|
+
returns: AstryxReturnInput[];
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Input accepted by {@link createDoc}. A generic reference/topic doc — just the
|
|
123
|
+
* shared base. The `type` discriminant is injected by the factory.
|
|
124
|
+
*/
|
|
125
|
+
export type AstryxGenericDocInput = AstryxBaseDocInput;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Back-compat alias. Previously `createDoc` accepted a broad component-doc
|
|
129
|
+
* record; the union of the three input kinds preserves that permissiveness for
|
|
130
|
+
* any code referring to the old name.
|
|
131
|
+
*/
|
|
132
|
+
export type AstryxComponentDoc =
|
|
133
|
+
| AstryxComponentDocInput
|
|
134
|
+
| AstryxFunctionDocInput
|
|
135
|
+
| AstryxGenericDocInput;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Author a component doc. Stamp-only: returns the def with `type: 'component'`
|
|
139
|
+
* injected. Validation happens at the CLI load boundary.
|
|
140
|
+
*/
|
|
141
|
+
export function createComponentDoc<T extends AstryxComponentDocInput>(
|
|
142
|
+
def: T,
|
|
143
|
+
): T & {type: 'component'} {
|
|
144
|
+
return {...def, type: 'component'};
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Author a function doc (covers any function, including hooks). Stamp-only:
|
|
149
|
+
* returns the def with `type: 'function'` injected. Validation happens at the
|
|
150
|
+
* CLI load boundary.
|
|
151
|
+
*/
|
|
152
|
+
export function createFunctionDoc<T extends AstryxFunctionDocInput>(
|
|
153
|
+
def: T,
|
|
154
|
+
): T & {type: 'function'} {
|
|
155
|
+
return {...def, type: 'function'};
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Author a generic reference/topic doc. Stamp-only: returns the def with
|
|
160
|
+
* `type: 'generic'` injected. Validation happens at the CLI load boundary.
|
|
161
|
+
*/
|
|
162
|
+
export function createDoc<T extends AstryxGenericDocInput>(
|
|
163
|
+
def: T,
|
|
164
|
+
): T & {type: 'generic'} {
|
|
165
|
+
return {...def, type: 'generic'};
|
|
166
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
import {describe, expect, it} from 'vitest';
|
|
4
|
+
import {
|
|
5
|
+
createIntegration,
|
|
6
|
+
createPageTemplate,
|
|
7
|
+
createBlockTemplate,
|
|
8
|
+
createComponentDoc,
|
|
9
|
+
createFunctionDoc,
|
|
10
|
+
createDoc,
|
|
11
|
+
} from './index';
|
|
12
|
+
|
|
13
|
+
describe('authoring factories', () => {
|
|
14
|
+
it('createIntegration returns its argument unchanged', () => {
|
|
15
|
+
const input = {components: './c', templates: './t'};
|
|
16
|
+
expect(createIntegration(input)).toBe(input);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it('createPageTemplate / createBlockTemplate stamp the template type', () => {
|
|
20
|
+
expect(createPageTemplate({name: 'P', description: 'd'}).type).toBe('page');
|
|
21
|
+
expect(createBlockTemplate({name: 'B', description: 'd'}).type).toBe(
|
|
22
|
+
'block',
|
|
23
|
+
);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it('createPageTemplate preserves authored fields', () => {
|
|
27
|
+
const t = createPageTemplate({name: 'P', description: 'd', category: 'x'});
|
|
28
|
+
expect(t).toMatchObject({
|
|
29
|
+
name: 'P',
|
|
30
|
+
description: 'd',
|
|
31
|
+
category: 'x',
|
|
32
|
+
type: 'page',
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it('doc factories stamp the doc kind', () => {
|
|
37
|
+
expect(createComponentDoc({name: 'Button', props: []}).type).toBe(
|
|
38
|
+
'component',
|
|
39
|
+
);
|
|
40
|
+
expect(
|
|
41
|
+
createFunctionDoc({name: 'useX', params: [], returns: []}).type,
|
|
42
|
+
).toBe('function');
|
|
43
|
+
expect(createDoc({name: 'Topic'}).type).toBe('generic');
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('doc factories do not mutate the input object', () => {
|
|
47
|
+
const input = {name: 'Button', props: []};
|
|
48
|
+
const out = createComponentDoc(input);
|
|
49
|
+
expect(out).not.toBe(input);
|
|
50
|
+
expect(input).not.toHaveProperty('type');
|
|
51
|
+
});
|
|
52
|
+
});
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file index.ts
|
|
5
|
+
* @input None (barrel).
|
|
6
|
+
* @output The Astryx integration-authoring surface: the stamp-only factories an
|
|
7
|
+
* integration package uses to describe what it contributes (integrations,
|
|
8
|
+
* templates, docs), plus their TypeScript input/output types.
|
|
9
|
+
* @position Producer-facing authoring surface, exported as
|
|
10
|
+
* `@astryxdesign/core/authoring`.
|
|
11
|
+
*
|
|
12
|
+
* ## Why these live in core
|
|
13
|
+
*
|
|
14
|
+
* These factories are tiny, zero-runtime-dependency identity functions whose
|
|
15
|
+
* value is their TypeScript surface. Hosting them in `@astryxdesign/core` (the
|
|
16
|
+
* base of the dependency graph) means core's own docs can adopt them without a
|
|
17
|
+
* core -> cli -> core cycle, and integration authors get the types without a
|
|
18
|
+
* hard dependency on the CLI. The CLI re-exports every factory from its
|
|
19
|
+
* existing subpaths (`@astryxdesign/cli/integration|template|doc`) for
|
|
20
|
+
* back-compat; the CLI keeps the Zod validation schemas at its load boundary.
|
|
21
|
+
*
|
|
22
|
+
* `createConfig` is intentionally NOT here — it is a consumer surface (every app
|
|
23
|
+
* with an `astryx.config`), exported separately as `@astryxdesign/core/config`.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
export {createIntegration} from './integration';
|
|
27
|
+
export type {AstryxIntegration} from './integration';
|
|
28
|
+
|
|
29
|
+
export {createPageTemplate, createBlockTemplate} from './template';
|
|
30
|
+
export type {
|
|
31
|
+
AstryxTemplatePreview,
|
|
32
|
+
AstryxTemplateInput,
|
|
33
|
+
AstryxPageTemplateInput,
|
|
34
|
+
AstryxBlockTemplateInput,
|
|
35
|
+
AstryxPageTemplate,
|
|
36
|
+
AstryxBlockTemplate,
|
|
37
|
+
AstryxTemplate,
|
|
38
|
+
} from './template';
|
|
39
|
+
|
|
40
|
+
export {createComponentDoc, createFunctionDoc, createDoc} from './doc';
|
|
41
|
+
export type {
|
|
42
|
+
AstryxBaseDocInput,
|
|
43
|
+
AstryxPropInput,
|
|
44
|
+
AstryxParamInput,
|
|
45
|
+
AstryxReturnInput,
|
|
46
|
+
AstryxComponentDocInput,
|
|
47
|
+
AstryxFunctionDocInput,
|
|
48
|
+
AstryxGenericDocInput,
|
|
49
|
+
AstryxComponentDoc,
|
|
50
|
+
} from './doc';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file integration.ts
|
|
5
|
+
* @input An integration package's manifest object.
|
|
6
|
+
* @output A type-preserving `createIntegration` helper plus the
|
|
7
|
+
* `AstryxIntegration` manifest surface.
|
|
8
|
+
* @position Integration-author authoring surface. See `./index.ts` for why
|
|
9
|
+
* these authoring factories live in `@astryxdesign/core`.
|
|
10
|
+
*
|
|
11
|
+
* `createIntegration` is an intentionally tiny runtime identity function: it
|
|
12
|
+
* returns its argument unchanged. Validation is NOT performed here — it happens
|
|
13
|
+
* at the CLI load boundary.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Integration manifest exported from a conventional root manifest file
|
|
18
|
+
* (astryx.integration.{ts,mjs,js}) sibling to the integration package's
|
|
19
|
+
* package.json. Identity (name/version) comes from the package's
|
|
20
|
+
* package.json, not from the manifest.
|
|
21
|
+
*/
|
|
22
|
+
export interface AstryxIntegration {
|
|
23
|
+
/** Relative path to the components/docs root (resolved to absolute). */
|
|
24
|
+
components?: string;
|
|
25
|
+
/** Relative path to the templates root (resolved to absolute). */
|
|
26
|
+
templates?: string;
|
|
27
|
+
/** Relative path to the codemods root (resolved to absolute). */
|
|
28
|
+
codemods?: string;
|
|
29
|
+
/** Where to file issues/feedback for this integration. */
|
|
30
|
+
issuesUrl?: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Type-preserving helper for an Astryx integration manifest. Returns its
|
|
35
|
+
* argument unchanged; the value is the exported TypeScript surface. Validation
|
|
36
|
+
* happens at the CLI load boundary.
|
|
37
|
+
*/
|
|
38
|
+
export function createIntegration<T extends AstryxIntegration>(
|
|
39
|
+
integration: T,
|
|
40
|
+
): T {
|
|
41
|
+
return integration;
|
|
42
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file template.ts
|
|
5
|
+
* @input A page/block template doc object (without the `type` tag).
|
|
6
|
+
* @output Type-preserving `createPageTemplate`/`createBlockTemplate` helpers
|
|
7
|
+
* plus the authored-template TypeScript surface.
|
|
8
|
+
* @position Integration-author authoring surface. See `./index.ts` for why
|
|
9
|
+
* these authoring factories live in `@astryxdesign/core`.
|
|
10
|
+
*
|
|
11
|
+
* A template doc lives in a `<id>.doc.{ts,mjs,js}` file with a required
|
|
12
|
+
* same-stem sibling source file (`<id>.tsx`). The doc's `type` (page or block)
|
|
13
|
+
* — injected by the create* helpers — decides how the template is scaffolded.
|
|
14
|
+
*
|
|
15
|
+
* These are tiny runtime identity helpers that inject the `type` discriminant.
|
|
16
|
+
* They do NOT validate — validation happens at the CLI load boundary, where
|
|
17
|
+
* integration template discovery runs the module's default export through the
|
|
18
|
+
* template envelope schema.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/** Optional preview metadata for a template (used by docs surfaces). */
|
|
22
|
+
export interface AstryxTemplatePreview {
|
|
23
|
+
/** Path or URL to a preview image. */
|
|
24
|
+
image?: string;
|
|
25
|
+
/** CSS aspect-ratio hint for the preview, e.g. "16 / 9". */
|
|
26
|
+
aspectRatio?: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** Fields common to page and block template docs (without the `type` tag). */
|
|
30
|
+
export interface AstryxTemplateInput {
|
|
31
|
+
/** Human-readable template name. Required. */
|
|
32
|
+
name: string;
|
|
33
|
+
/** One-line description of what the template provides. Required. */
|
|
34
|
+
description: string;
|
|
35
|
+
/** Optional grouping/category label. */
|
|
36
|
+
category?: string;
|
|
37
|
+
/** Component display names the template composes. */
|
|
38
|
+
componentsUsed?: string[];
|
|
39
|
+
/** Optional preview metadata. */
|
|
40
|
+
preview?: AstryxTemplatePreview;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Input accepted by {@link createPageTemplate} (no `type` field). */
|
|
44
|
+
export type AstryxPageTemplateInput = AstryxTemplateInput;
|
|
45
|
+
/** Input accepted by {@link createBlockTemplate} (no `type` field). */
|
|
46
|
+
export type AstryxBlockTemplateInput = AstryxTemplateInput;
|
|
47
|
+
|
|
48
|
+
/** A validated page template doc. */
|
|
49
|
+
export type AstryxPageTemplate = AstryxTemplateInput & {type: 'page'};
|
|
50
|
+
/** A validated block template doc. */
|
|
51
|
+
export type AstryxBlockTemplate = AstryxTemplateInput & {type: 'block'};
|
|
52
|
+
|
|
53
|
+
/** A validated template doc (page or block). */
|
|
54
|
+
export type AstryxTemplate = AstryxPageTemplate | AstryxBlockTemplate;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Author an Astryx page template doc. Stamp-only: returns the def with
|
|
58
|
+
* `type: 'page'` injected. Validation happens at the CLI load boundary.
|
|
59
|
+
*/
|
|
60
|
+
export function createPageTemplate<T extends AstryxPageTemplateInput>(
|
|
61
|
+
def: T,
|
|
62
|
+
): T & {type: 'page'} {
|
|
63
|
+
return {...def, type: 'page'};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Author an Astryx block template doc. Stamp-only: returns the def with
|
|
68
|
+
* `type: 'block'` injected. Validation happens at the CLI load boundary.
|
|
69
|
+
*/
|
|
70
|
+
export function createBlockTemplate<T extends AstryxBlockTemplateInput>(
|
|
71
|
+
def: T,
|
|
72
|
+
): T & {type: 'block'} {
|
|
73
|
+
return {...def, type: 'block'};
|
|
74
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
import {describe, expect, it} from 'vitest';
|
|
4
|
+
import {createConfig} from './config';
|
|
5
|
+
|
|
6
|
+
describe('createConfig', () => {
|
|
7
|
+
it('returns its argument unchanged (identity)', () => {
|
|
8
|
+
const input = {integrations: ['@acme/astryx'], issuesUrl: 'https://x'};
|
|
9
|
+
expect(createConfig(input)).toBe(input);
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('does not stamp a discriminant', () => {
|
|
13
|
+
const cfg = createConfig({integrations: []}) as Record<string, unknown>;
|
|
14
|
+
expect(cfg.type).toBeUndefined();
|
|
15
|
+
});
|
|
16
|
+
});
|
package/src/config.ts
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file config.ts
|
|
5
|
+
* @input An app's Astryx config object.
|
|
6
|
+
* @output A type-preserving `createConfig` helper plus the `AstryxConfig`
|
|
7
|
+
* surface authors write in `astryx.config.{ts,mjs,js}`.
|
|
8
|
+
* @position Consumer-facing authoring surface. Lives in `@astryxdesign/core`
|
|
9
|
+
* (not the CLI) so an app's config file gets editor/type feedback without
|
|
10
|
+
* taking a dependency on the CLI. The CLI re-exports this from
|
|
11
|
+
* `@astryxdesign/cli/config` for back-compat.
|
|
12
|
+
*
|
|
13
|
+
* `createConfig` is an intentionally tiny runtime identity function: it returns
|
|
14
|
+
* its argument unchanged. Its value is the exported TypeScript surface.
|
|
15
|
+
* Validation is NOT performed here — it happens at the CLI load boundary.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* A command to run as part of a post-codemod hook. Returned by a hook's
|
|
20
|
+
* `buildCommand` and executed after codemods write files.
|
|
21
|
+
*/
|
|
22
|
+
export interface PostCodemodCommand {
|
|
23
|
+
command: string;
|
|
24
|
+
args?: string[];
|
|
25
|
+
options?: {
|
|
26
|
+
cwd?: string;
|
|
27
|
+
env?: NodeJS.ProcessEnv;
|
|
28
|
+
timeout?: number;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* A post-codemod hook. `buildCommand` receives the package directory and the
|
|
34
|
+
* list of files changed by codemods, and returns the command to run (or a
|
|
35
|
+
* nullish value to skip).
|
|
36
|
+
*/
|
|
37
|
+
export type PostCodemodHook = {
|
|
38
|
+
name?: string;
|
|
39
|
+
buildCommand: (ctx: {
|
|
40
|
+
packageDir: string;
|
|
41
|
+
files: string[];
|
|
42
|
+
}) =>
|
|
43
|
+
| PostCodemodCommand
|
|
44
|
+
| null
|
|
45
|
+
| undefined
|
|
46
|
+
| Promise<PostCodemodCommand | null | undefined>;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
/** A component XLE layout expressions can reference by name via `{hint}`. */
|
|
50
|
+
export interface XleComponent {
|
|
51
|
+
/** Import specifier the component is imported from, e.g. '@/components/KpiCard'. */
|
|
52
|
+
from: string;
|
|
53
|
+
/** Optional human description shown in tooling. */
|
|
54
|
+
description?: string;
|
|
55
|
+
/** Import as the module's default export instead of a named export. Defaults to false. */
|
|
56
|
+
default?: boolean;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** User config exported from astryx.config.{ts,mjs,js}. */
|
|
60
|
+
export interface AstryxConfig {
|
|
61
|
+
/** Integration package names to load. */
|
|
62
|
+
integrations?: string[];
|
|
63
|
+
/** Where to file issues/feedback for this project. */
|
|
64
|
+
issuesUrl?: string;
|
|
65
|
+
/** Lifecycle hooks. */
|
|
66
|
+
hooks?: {
|
|
67
|
+
postCodemod?: PostCodemodHook[];
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* EXPERIMENTAL — shape may change and is not part of the stable config
|
|
71
|
+
* contract. Provisional home for features still being proven out.
|
|
72
|
+
*/
|
|
73
|
+
experimental?: {
|
|
74
|
+
/** Experimental XLE (layout expression) configuration. */
|
|
75
|
+
xle?: {
|
|
76
|
+
/**
|
|
77
|
+
* Register app-local components so XLE layout expressions can
|
|
78
|
+
* reference them by name via {hint}. Keyed by component name.
|
|
79
|
+
*/
|
|
80
|
+
components?: Record<string, XleComponent>;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Type-preserving helper for the Astryx config file. Returns its argument
|
|
87
|
+
* unchanged; the value is the exported TypeScript surface so config files get
|
|
88
|
+
* editor/type feedback. Validation happens at the CLI load boundary.
|
|
89
|
+
*/
|
|
90
|
+
export function createConfig<T extends AstryxConfig>(config: T): T {
|
|
91
|
+
return config;
|
|
92
|
+
}
|