@astryxdesign/core 0.1.5 → 0.1.6-canary.02f2602
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 +24 -0
- package/README.md +2 -0
- package/dist/AlertDialog/AlertDialog.d.ts +1 -1
- package/dist/AlertDialog/AlertDialog.d.ts.map +1 -1
- package/dist/AlertDialog/AlertDialog.js +21 -18
- package/dist/AlertDialog/useImperativeAlertDialog.d.ts +0 -2
- package/dist/AlertDialog/useImperativeAlertDialog.d.ts.map +1 -1
- package/dist/AlertDialog/useImperativeAlertDialog.js +3 -5
- package/dist/AppShell/AppShell.d.ts.map +1 -1
- package/dist/AppShell/AppShell.js +55 -53
- package/dist/AspectRatio/AspectRatio.js +5 -5
- package/dist/Avatar/Avatar.js +19 -19
- package/dist/Avatar/AvatarStatusDot.js +5 -5
- package/dist/AvatarGroup/AvatarGroup.d.ts +1 -1
- package/dist/AvatarGroup/AvatarGroup.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroup.js +9 -6
- package/dist/AvatarGroup/AvatarGroupOverflow.js +5 -5
- package/dist/Badge/Badge.js +3 -3
- package/dist/Banner/Banner.d.ts.map +1 -1
- package/dist/Banner/Banner.js +32 -30
- package/dist/Blockquote/Blockquote.js +7 -7
- package/dist/Breadcrumbs/BreadcrumbItem.js +17 -17
- package/dist/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.js +11 -8
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +53 -23
- package/dist/ButtonGroup/ButtonGroup.d.ts +20 -5
- package/dist/ButtonGroup/ButtonGroup.d.ts.map +1 -1
- package/dist/ButtonGroup/ButtonGroup.js +34 -18
- package/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +51 -48
- package/dist/Card/Card.js +3 -3
- package/dist/Carousel/Carousel.d.ts +1 -1
- package/dist/Carousel/Carousel.d.ts.map +1 -1
- package/dist/Carousel/Carousel.js +27 -24
- package/dist/Center/Center.js +3 -3
- package/dist/Chat/ChatComposer.d.ts.map +1 -1
- package/dist/Chat/ChatComposer.js +27 -24
- package/dist/Chat/ChatComposerDrawer.d.ts +1 -1
- package/dist/Chat/ChatComposerDrawer.d.ts.map +1 -1
- package/dist/Chat/ChatComposerDrawer.js +23 -16
- package/dist/Chat/ChatComposerInput.d.ts.map +1 -1
- package/dist/Chat/ChatComposerInput.js +20 -16
- package/dist/Chat/ChatDictationButton.js +10 -10
- package/dist/Chat/ChatLayout.d.ts +1 -11
- package/dist/Chat/ChatLayout.d.ts.map +1 -1
- package/dist/Chat/ChatLayout.js +23 -21
- package/dist/Chat/ChatLayoutScrollButton.d.ts.map +1 -1
- package/dist/Chat/ChatLayoutScrollButton.js +13 -11
- package/dist/Chat/ChatMessage.d.ts +1 -1
- package/dist/Chat/ChatMessage.d.ts.map +1 -1
- package/dist/Chat/ChatMessage.js +20 -14
- package/dist/Chat/ChatMessageBubble.d.ts +1 -1
- package/dist/Chat/ChatMessageBubble.d.ts.map +1 -1
- package/dist/Chat/ChatMessageBubble.js +10 -8
- package/dist/Chat/ChatMessageList.d.ts +1 -1
- package/dist/Chat/ChatMessageList.d.ts.map +1 -1
- package/dist/Chat/ChatMessageList.js +17 -15
- package/dist/Chat/ChatMessageMetadata.d.ts.map +1 -1
- package/dist/Chat/ChatMessageMetadata.js +24 -19
- package/dist/Chat/ChatPastedTextToken.d.ts.map +1 -1
- package/dist/Chat/ChatPastedTextToken.js +16 -14
- package/dist/Chat/ChatSendButton.d.ts.map +1 -1
- package/dist/Chat/ChatSendButton.js +6 -4
- package/dist/Chat/ChatSystemMessage.js +11 -11
- package/dist/Chat/ChatTokenizedText.js +8 -8
- package/dist/Chat/ChatToolCalls.js +73 -73
- 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 +19 -17
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +26 -24
- package/dist/CheckboxList/CheckboxList.d.ts +1 -1
- package/dist/CheckboxList/CheckboxList.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxList.js +12 -10
- package/dist/CheckboxList/CheckboxListItem.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListItem.js +8 -6
- package/dist/Citation/Citation.d.ts.map +1 -1
- package/dist/Citation/Citation.js +20 -12
- package/dist/ClickableCard/ClickableCard.js +6 -6
- package/dist/Code/Code.js +3 -3
- package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/CodeBlock/CodeBlock.js +114 -96
- package/dist/Collapsible/Collapsible.js +11 -11
- package/dist/Collapsible/CollapsibleGroup.js +7 -7
- package/dist/CommandPalette/CommandPalette.d.ts +1 -1
- package/dist/CommandPalette/CommandPalette.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPalette.js +39 -34
- package/dist/CommandPalette/CommandPaletteEmpty.js +3 -3
- package/dist/CommandPalette/CommandPaletteFooter.js +16 -16
- package/dist/CommandPalette/CommandPaletteGroup.js +5 -5
- package/dist/CommandPalette/CommandPaletteInput.d.ts +1 -1
- package/dist/CommandPalette/CommandPaletteInput.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteInput.js +17 -14
- package/dist/CommandPalette/CommandPaletteItem.js +3 -3
- package/dist/CommandPalette/CommandPaletteList.d.ts +1 -1
- package/dist/CommandPalette/CommandPaletteList.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteList.js +7 -4
- package/dist/ContextMenu/ContextMenu.d.ts +1 -1
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +14 -11
- package/dist/DateInput/DateInput.d.ts +1 -1
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +28 -23
- package/dist/DateRangeInput/DateRangeInput.d.ts +1 -1
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +32 -27
- package/dist/DateTimeInput/DateTimeInput.d.ts +1 -1
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +41 -33
- package/dist/Dialog/Dialog.js +9 -9
- package/dist/Dialog/DialogHeader.d.ts.map +1 -1
- package/dist/Dialog/DialogHeader.js +20 -18
- package/dist/Dialog/useImperativeDialog.js +3 -3
- package/dist/Divider/Divider.js +7 -7
- package/dist/DropdownMenu/DropdownMenu.d.ts +1 -1
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +21 -15
- package/dist/DropdownMenu/DropdownMenuItem.js +3 -3
- package/dist/DropdownMenu/renderDropdownItems.js +10 -10
- package/dist/EmptyState/EmptyState.d.ts +4 -1
- package/dist/EmptyState/EmptyState.d.ts.map +1 -1
- package/dist/EmptyState/EmptyState.js +9 -9
- package/dist/Field/Field.js +17 -17
- package/dist/Field/FieldLabel.js +15 -15
- package/dist/Field/InputClearButton.js +5 -5
- package/dist/FieldStatus/FieldStatus.js +3 -3
- package/dist/FileInput/FileInput.d.ts.map +1 -1
- package/dist/FileInput/FileInput.js +34 -30
- package/dist/FormLayout/FormLayout.js +5 -5
- package/dist/Grid/Grid.js +3 -3
- package/dist/Grid/GridSpan.js +3 -3
- package/dist/HStack/HStack.js +3 -3
- package/dist/Heading/Heading.js +10 -10
- package/dist/HoverCard/HoverCard.js +9 -9
- package/dist/HoverCard/useHoverCard.js +3 -3
- package/dist/Icon/Icon.js +11 -11
- package/dist/Icon/defaultIcons.js +116 -116
- package/dist/IconButton/IconButton.js +3 -3
- package/dist/InputGroup/InputGroup.js +9 -9
- package/dist/InputGroup/InputGroupText.js +3 -3
- package/dist/Item/Item.js +17 -17
- package/dist/Kbd/Kbd.js +5 -5
- package/dist/Layer/LayerProvider.js +7 -7
- package/dist/Layer/useLayer.js +5 -5
- package/dist/Layout/Layout.js +21 -21
- package/dist/Layout/LayoutContent.js +3 -3
- package/dist/Layout/LayoutFooter.js +5 -5
- package/dist/Layout/LayoutHeader.js +5 -5
- package/dist/Layout/LayoutPanel.js +3 -3
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +35 -33
- package/dist/Lightbox/useLightbox.d.ts +0 -1
- package/dist/Lightbox/useLightbox.d.ts.map +1 -1
- package/dist/Lightbox/useLightbox.js +3 -4
- package/dist/Link/Link.d.ts +5 -3
- package/dist/Link/Link.d.ts.map +1 -1
- package/dist/Link/Link.js +47 -18
- package/dist/Link/LinkProvider.js +3 -3
- package/dist/Link/useLinkify.js +3 -3
- package/dist/List/List.js +11 -11
- package/dist/List/ListItem.js +11 -11
- package/dist/Markdown/Markdown.d.ts.map +1 -1
- package/dist/Markdown/Markdown.js +111 -109
- package/dist/MetadataList/MetadataList.js +10 -10
- package/dist/MetadataList/MetadataListItem.js +15 -15
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +19 -17
- package/dist/MobileNav/MobileNavToggle.d.ts +1 -1
- package/dist/MobileNav/MobileNavToggle.d.ts.map +1 -1
- package/dist/MobileNav/MobileNavToggle.js +9 -6
- package/dist/MoreMenu/MoreMenu.d.ts +1 -1
- package/dist/MoreMenu/MoreMenu.d.ts.map +1 -1
- package/dist/MoreMenu/MoreMenu.js +7 -4
- package/dist/MultiSelector/MultiSelector.d.ts +1 -1
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +69 -62
- package/dist/NavIcon/NavIcon.js +3 -3
- package/dist/NavMenu/NavHeadingMenu.js +5 -5
- package/dist/NavMenu/NavHeadingMenuItem.js +8 -8
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +21 -17
- package/dist/Outline/Outline.d.ts +1 -1
- package/dist/Outline/Outline.d.ts.map +1 -1
- package/dist/Outline/Outline.js +19 -16
- package/dist/OverflowList/OverflowList.js +8 -8
- package/dist/Overlay/Overlay.js +3 -3
- package/dist/Overlay/OverlayScrim.js +5 -5
- package/dist/Overlay/useOverlay.d.ts +0 -3
- package/dist/Overlay/useOverlay.d.ts.map +1 -1
- package/dist/Overlay/useOverlay.js +3 -6
- package/dist/Pagination/Pagination.d.ts +1 -1
- package/dist/Pagination/Pagination.d.ts.map +1 -1
- package/dist/Pagination/Pagination.js +73 -46
- package/dist/Popover/Popover.js +16 -16
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/Popover/usePopover.js +11 -8
- package/dist/PowerSearch/PowerSearch.d.ts +1 -1
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +95 -85
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.js +109 -103
- package/dist/PowerSearch/PowerSearchFilterEditor.js +3 -3
- package/dist/PowerSearch/PowerSearchToken.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchToken.js +12 -8
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchValueEditor.js +88 -75
- 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/ProgressBar/ProgressBar.js +13 -13
- package/dist/RadioList/RadioList.js +7 -7
- package/dist/RadioList/RadioListItem.js +18 -18
- package/dist/Resizable/ResizeHandle.d.ts +1 -1
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +10 -7
- package/dist/Section/Section.js +5 -5
- package/dist/SegmentedControl/SegmentedControl.js +5 -5
- package/dist/SegmentedControl/SegmentedControlItem.js +7 -7
- package/dist/SelectableCard/SelectableCard.js +5 -5
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +57 -51
- package/dist/Selector/SelectorOption.js +3 -3
- package/dist/SideNav/SideNav.d.ts.map +1 -1
- package/dist/SideNav/SideNav.js +38 -36
- package/dist/SideNav/SideNavCollapseButton.d.ts.map +1 -1
- package/dist/SideNav/SideNavCollapseButton.js +8 -6
- package/dist/SideNav/SideNavHeading.d.ts.map +1 -1
- package/dist/SideNav/SideNavHeading.js +92 -90
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +49 -43
- package/dist/SideNav/SideNavSection.js +14 -14
- package/dist/Skeleton/Skeleton.js +3 -3
- package/dist/Slider/Slider.js +23 -23
- package/dist/Spinner/Spinner.js +9 -9
- package/dist/StatusDot/StatusDot.js +5 -5
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +29 -27
- package/dist/TabList/Tab.js +18 -18
- package/dist/TabList/TabList.d.ts +1 -1
- package/dist/TabList/TabList.d.ts.map +1 -1
- package/dist/TabList/TabList.js +9 -6
- package/dist/TabList/TabMenu.js +23 -23
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +39 -37
- package/dist/Table/Table.d.ts.map +1 -1
- package/dist/Table/Table.js +10 -8
- package/dist/Table/TableBody.js +3 -3
- package/dist/Table/TableCell.js +3 -3
- package/dist/Table/TableFooter.js +3 -3
- package/dist/Table/TableHeader.js +3 -3
- package/dist/Table/TableHeaderCell.js +3 -3
- package/dist/Table/TableRow.js +5 -5
- package/dist/Table/index.d.ts +4 -0
- package/dist/Table/index.d.ts.map +1 -1
- package/dist/Table/index.js +2 -0
- package/dist/Table/plugins/columnResize/useTableColumnResize.js +9 -9
- package/dist/Table/plugins/filtering/useTableFiltering.d.ts.map +1 -1
- package/dist/Table/plugins/filtering/useTableFiltering.js +127 -90
- package/dist/Table/plugins/groupedRows/index.d.ts +3 -0
- package/dist/Table/plugins/groupedRows/index.d.ts.map +1 -0
- package/dist/Table/plugins/groupedRows/index.js +3 -0
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts +78 -0
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts.map +1 -0
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.js +257 -0
- package/dist/Table/plugins/pagination/useTablePagination.d.ts.map +1 -1
- package/dist/Table/plugins/pagination/useTablePagination.js +12 -9
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +30 -28
- package/dist/Table/plugins/rowIndex/index.d.ts +3 -0
- package/dist/Table/plugins/rowIndex/index.d.ts.map +1 -0
- package/dist/Table/plugins/rowIndex/index.js +3 -0
- package/dist/Table/plugins/rowIndex/useTableRowIndex.d.ts +50 -0
- package/dist/Table/plugins/rowIndex/useTableRowIndex.d.ts.map +1 -0
- package/dist/Table/plugins/rowIndex/useTableRowIndex.js +91 -0
- package/dist/Table/plugins/selection/useTableSelection.d.ts.map +1 -1
- package/dist/Table/plugins/selection/useTableSelection.js +23 -20
- package/dist/Table/plugins/sortable/useTableSortable.d.ts.map +1 -1
- package/dist/Table/plugins/sortable/useTableSortable.js +23 -21
- package/dist/Table/tableContextMenu.js +9 -9
- package/dist/Text/Text.js +10 -10
- package/dist/TextArea/TextArea.js +14 -14
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +20 -16
- package/dist/Thumbnail/Thumbnail.d.ts.map +1 -1
- package/dist/Thumbnail/Thumbnail.js +37 -31
- package/dist/TimeInput/TimeInput.d.ts +1 -1
- package/dist/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +28 -23
- package/dist/Timestamp/Timestamp.d.ts.map +1 -1
- package/dist/Timestamp/Timestamp.js +29 -14
- package/dist/Toast/Toast.d.ts.map +1 -1
- package/dist/Toast/Toast.js +17 -15
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +14 -12
- package/dist/Toast/useToast.js +4 -4
- package/dist/ToggleButton/ToggleButton.js +12 -12
- package/dist/ToggleButton/ToggleButtonGroup.js +5 -5
- package/dist/Token/Token.d.ts.map +1 -1
- package/dist/Token/Token.js +29 -23
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +33 -31
- package/dist/Toolbar/Toolbar.js +18 -18
- package/dist/Tooltip/Tooltip.js +11 -11
- package/dist/Tooltip/useTooltip.js +3 -3
- package/dist/TopNav/TopNav.d.ts +2 -1
- package/dist/TopNav/TopNav.d.ts.map +1 -1
- package/dist/TopNav/TopNav.js +36 -33
- package/dist/TopNav/TopNavHeading.d.ts.map +1 -1
- package/dist/TopNav/TopNavHeading.js +72 -70
- package/dist/TopNav/TopNavItem.js +5 -5
- package/dist/TopNav/TopNavMegaMenu.js +30 -30
- package/dist/TopNav/TopNavMegaMenuFeaturedCard.js +10 -10
- package/dist/TopNav/TopNavMegaMenuItem.js +16 -16
- package/dist/TopNav/TopNavMenu.js +32 -32
- package/dist/TreeList/TreeList.d.ts.map +1 -1
- package/dist/TreeList/TreeList.js +13 -9
- package/dist/TreeList/TreeListBranches.js +11 -11
- package/dist/TreeList/TreeListItem.d.ts.map +1 -1
- package/dist/TreeList/TreeListItem.js +37 -31
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +26 -22
- package/dist/Typeahead/Typeahead.d.ts.map +1 -1
- package/dist/Typeahead/Typeahead.js +15 -13
- package/dist/Typeahead/TypeaheadItem.js +10 -10
- package/dist/VStack/VStack.js +3 -3
- package/dist/VisuallyHidden/VisuallyHidden.d.ts +1 -3
- package/dist/VisuallyHidden/VisuallyHidden.d.ts.map +1 -1
- package/dist/VisuallyHidden/VisuallyHidden.js +1 -3
- package/dist/astryx.css +20 -2
- package/dist/astryx.umd.js +66 -64
- 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/hooks/useKeyboardHint.js +9 -9
- 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 +62 -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/MediaTheme.js +3 -3
- package/dist/theme/Theme.js +7 -7
- package/dist/theme/syntax/SyntaxTheme.js +5 -5
- package/locales/en.json +746 -0
- package/locales/pseudo.json +560 -0
- package/package.json +24 -3
- package/src/AlertDialog/AlertDialog.doc.mjs +5 -0
- package/src/AlertDialog/AlertDialog.tsx +4 -1
- package/src/AlertDialog/useImperativeAlertDialog.tsx +0 -2
- 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.tsx +34 -4
- package/src/ButtonGroup/ButtonGroup.test.tsx +386 -2
- package/src/ButtonGroup/ButtonGroup.tsx +27 -11
- package/src/Calendar/Calendar.tsx +8 -5
- 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.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/useSpeechRecognition.ts +11 -2
- package/src/Chat/useTriggerMenu.tsx +4 -2
- 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 +3 -3
- 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.tsx +4 -1
- package/src/DateInput/DateInput.doc.mjs +2 -2
- package/src/DateInput/DateInput.tsx +13 -5
- package/src/DateRangeInput/DateRangeInput.doc.mjs +7 -7
- 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/DialogHeader.tsx +4 -2
- package/src/DropdownMenu/DropdownMenu.tsx +12 -8
- package/src/EmptyState/EmptyState.doc.mjs +3 -3
- package/src/EmptyState/EmptyState.tsx +4 -1
- package/src/Field/Field.doc.mjs +2 -2
- package/src/FileInput/FileInput.tsx +3 -1
- package/src/Grid/Grid.doc.mjs +5 -5
- package/src/InputGroup/InputGroup.doc.mjs +1 -1
- package/src/Layer/useLayer.doc.mjs +2 -2
- package/src/Lightbox/Lightbox.doc.mjs +7 -2
- package/src/Lightbox/Lightbox.tsx +6 -4
- package/src/Lightbox/useLightbox.tsx +0 -1
- package/src/Link/Link.test.tsx +74 -2
- package/src/Link/Link.tsx +48 -3
- 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.tsx +3 -1
- package/src/Outline/Outline.tsx +4 -1
- package/src/OverflowList/OverflowList.doc.mjs +2 -2
- package/src/Overlay/useOverlay.tsx +0 -3
- 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.tsx +11 -6
- 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.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 +2 -2
- package/src/Switch/Switch.test.tsx +16 -0
- package/src/Switch/Switch.tsx +4 -2
- package/src/TabList/TabList.tsx +4 -1
- package/src/Table/BaseTable.tsx +8 -1
- package/src/Table/Table.doc.mjs +1 -1
- package/src/Table/Table.tsx +3 -1
- package/src/Table/index.ts +7 -0
- package/src/Table/plugins/filtering/useTableFiltering.tsx +31 -30
- package/src/Table/plugins/groupedRows/index.ts +7 -0
- package/src/Table/plugins/groupedRows/useTableGroupedRows.test.tsx +231 -0
- package/src/Table/plugins/groupedRows/useTableGroupedRows.tsx +351 -0
- package/src/Table/plugins/pagination/useTablePagination.tsx +4 -1
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +8 -4
- package/src/Table/plugins/rowIndex/index.ts +4 -0
- package/src/Table/plugins/rowIndex/useTableRowIndex.test.tsx +132 -0
- package/src/Table/plugins/rowIndex/useTableRowIndex.tsx +114 -0
- package/src/Table/plugins/selection/useTableSelection.tsx +6 -7
- package/src/Table/plugins/sortable/useTableSortable.tsx +8 -5
- package/src/Table/useTableFiltering.doc.mjs +2 -2
- package/src/Table/useTableGroupedRows.doc.mjs +71 -0
- package/src/Table/useTableRowIndex.doc.mjs +50 -0
- package/src/Table/useTableSortable.doc.mjs +11 -11
- package/src/Text/Text.doc.mjs +2 -2
- 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/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 -3
- 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 +902 -0
- package/src/hooks/useHotkeys.doc.mjs +5 -5
- package/src/i18n/InternationalizationContext.ts +39 -0
- package/src/i18n/InternationalizationProvider.doc.mjs +72 -0
- package/src/i18n/InternationalizationProvider.tsx +83 -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/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
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file doc.ts
|
|
3
|
+
* @input A component/function/generic doc object (without the `type` tag).
|
|
4
|
+
* @output Type-preserving `createComponentDoc`/`createFunctionDoc`/`createDoc`
|
|
5
|
+
* helpers plus the doc-authoring TypeScript surface.
|
|
6
|
+
* @position Integration-author authoring surface. See `./index.ts` for why
|
|
7
|
+
* these authoring factories live in `@astryxdesign/core`.
|
|
8
|
+
*
|
|
9
|
+
* A doc describes a documentable unit of the design system so the CLI and docs
|
|
10
|
+
* surfaces can list, search, and render it. There are three kinds, each a tiny
|
|
11
|
+
* runtime identity helper that stamps a `type` discriminant:
|
|
12
|
+
*
|
|
13
|
+
* - `createComponentDoc` -> `type: 'component'` — a component (or a family).
|
|
14
|
+
* - `createFunctionDoc` -> `type: 'function'` — any function, including
|
|
15
|
+
* hooks: an "inputs + outputs" surface (`params` + `returns`).
|
|
16
|
+
* - `createDoc` -> `type: 'generic'` — reference/topic docs.
|
|
17
|
+
*
|
|
18
|
+
* These factories do NOT validate. Validation happens at the CLI load boundary,
|
|
19
|
+
* where doc discovery runs the loaded value through a schema that accepts BOTH
|
|
20
|
+
* the stamped formats and the legacy loose `export const docs = {...}` shape.
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* Fields shared by every doc kind (component + function + generic).
|
|
24
|
+
*
|
|
25
|
+
* `group` vs `parent` are distinct:
|
|
26
|
+
* - `group` is a FLAT sidebar bucket label; many docs can share it and it is
|
|
27
|
+
* NOT an inheritance key.
|
|
28
|
+
* - `parent` is a DIRECTED inheritance/composition pointer — a doc naming the
|
|
29
|
+
* doc it belongs to (e.g. a sub-component naming its parent component). The
|
|
30
|
+
* legacy `subComponentOf` field is a synonym.
|
|
31
|
+
*
|
|
32
|
+
* `relatedDocs` is a single flat curated cross-reference list; it replaces the
|
|
33
|
+
* legacy split `relatedComponents` + `relatedHooks`.
|
|
34
|
+
*/
|
|
35
|
+
export interface AstryxBaseDocInput {
|
|
36
|
+
/** Name of the documented unit, without any prefix, PascalCase. Required. */
|
|
37
|
+
name: string;
|
|
38
|
+
/** Human-readable display name for gallery/sidebar. */
|
|
39
|
+
displayName?: string;
|
|
40
|
+
/** Short description. */
|
|
41
|
+
description?: string;
|
|
42
|
+
/** Usage documentation (description, best practices, anatomy, slotElements). */
|
|
43
|
+
usage?: unknown;
|
|
44
|
+
/** Flat sidebar grouping label (not an inheritance key). */
|
|
45
|
+
group?: string;
|
|
46
|
+
/** Overview-page functional category. */
|
|
47
|
+
category?: string;
|
|
48
|
+
/** CLI fuzzy-search keywords. */
|
|
49
|
+
keywords?: string[];
|
|
50
|
+
/** Directed inheritance/composition pointer to the doc this belongs to. */
|
|
51
|
+
parent?: string;
|
|
52
|
+
/** Flat curated cross-reference list of related doc names. */
|
|
53
|
+
relatedDocs?: string[];
|
|
54
|
+
/** Hide the whole doc from human-facing UI (stays importable/discoverable). */
|
|
55
|
+
hidden?: boolean;
|
|
56
|
+
/** Exclude from the categorized overview page (kept in sidebar/CLI). */
|
|
57
|
+
isHiddenFromOverview?: boolean;
|
|
58
|
+
/** Any additional fields the rich doc surface carries. */
|
|
59
|
+
[key: string]: unknown;
|
|
60
|
+
}
|
|
61
|
+
/** A single documented prop (mirrors `PropDoc` from core docs-types). */
|
|
62
|
+
export interface AstryxPropInput {
|
|
63
|
+
name: string;
|
|
64
|
+
type: string;
|
|
65
|
+
description: string;
|
|
66
|
+
default?: string;
|
|
67
|
+
required?: boolean;
|
|
68
|
+
[key: string]: unknown;
|
|
69
|
+
}
|
|
70
|
+
/** A single documented param (mirrors `HookParamDoc`). */
|
|
71
|
+
export interface AstryxParamInput {
|
|
72
|
+
name: string;
|
|
73
|
+
type: string;
|
|
74
|
+
description: string;
|
|
75
|
+
default?: string;
|
|
76
|
+
required?: boolean;
|
|
77
|
+
[key: string]: unknown;
|
|
78
|
+
}
|
|
79
|
+
/** A single documented return field (mirrors `HookReturnDoc`). */
|
|
80
|
+
export interface AstryxReturnInput {
|
|
81
|
+
name: string;
|
|
82
|
+
type: string;
|
|
83
|
+
description: string;
|
|
84
|
+
[key: string]: unknown;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Input accepted by {@link createComponentDoc}. A component (or a family). The
|
|
88
|
+
* `type` discriminant is injected by the factory. `anatomy`/`slotElements` live
|
|
89
|
+
* inside `usage`; `importPath` is DERIVED (never authored).
|
|
90
|
+
*/
|
|
91
|
+
export interface AstryxComponentDocInput extends AstryxBaseDocInput {
|
|
92
|
+
/** All public props for the component. */
|
|
93
|
+
props: AstryxPropInput[];
|
|
94
|
+
/** Theming/selector-surface metadata. */
|
|
95
|
+
theming?: unknown;
|
|
96
|
+
/** Interactive-preview playground configuration. */
|
|
97
|
+
playground?: unknown;
|
|
98
|
+
/** Short code examples rendered after the props table. */
|
|
99
|
+
examples?: unknown[];
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Input accepted by {@link createFunctionDoc}. Covers any function, including
|
|
103
|
+
* hooks: an inputs (`params`) + outputs (`returns`) surface. The `type`
|
|
104
|
+
* discriminant is injected by the factory; `importPath` is DERIVED.
|
|
105
|
+
*/
|
|
106
|
+
export interface AstryxFunctionDocInput extends AstryxBaseDocInput {
|
|
107
|
+
/** Function/hook parameters or options-object fields. */
|
|
108
|
+
params: AstryxParamInput[];
|
|
109
|
+
/** Return value documentation. One entry per field (or a single primitive). */
|
|
110
|
+
returns: AstryxReturnInput[];
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Input accepted by {@link createDoc}. A generic reference/topic doc — just the
|
|
114
|
+
* shared base. The `type` discriminant is injected by the factory.
|
|
115
|
+
*/
|
|
116
|
+
export type AstryxGenericDocInput = AstryxBaseDocInput;
|
|
117
|
+
/**
|
|
118
|
+
* Back-compat alias. Previously `createDoc` accepted a broad component-doc
|
|
119
|
+
* record; the union of the three input kinds preserves that permissiveness for
|
|
120
|
+
* any code referring to the old name.
|
|
121
|
+
*/
|
|
122
|
+
export type AstryxComponentDoc = AstryxComponentDocInput | AstryxFunctionDocInput | AstryxGenericDocInput;
|
|
123
|
+
/**
|
|
124
|
+
* Author a component doc. Stamp-only: returns the def with `type: 'component'`
|
|
125
|
+
* injected. Validation happens at the CLI load boundary.
|
|
126
|
+
*/
|
|
127
|
+
export declare function createComponentDoc<T extends AstryxComponentDocInput>(def: T): T & {
|
|
128
|
+
type: 'component';
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* Author a function doc (covers any function, including hooks). Stamp-only:
|
|
132
|
+
* returns the def with `type: 'function'` injected. Validation happens at the
|
|
133
|
+
* CLI load boundary.
|
|
134
|
+
*/
|
|
135
|
+
export declare function createFunctionDoc<T extends AstryxFunctionDocInput>(def: T): T & {
|
|
136
|
+
type: 'function';
|
|
137
|
+
};
|
|
138
|
+
/**
|
|
139
|
+
* Author a generic reference/topic doc. Stamp-only: returns the def with
|
|
140
|
+
* `type: 'generic'` injected. Validation happens at the CLI load boundary.
|
|
141
|
+
*/
|
|
142
|
+
export declare function createDoc<T extends AstryxGenericDocInput>(def: T): T & {
|
|
143
|
+
type: 'generic';
|
|
144
|
+
};
|
|
145
|
+
//# sourceMappingURL=doc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doc.d.ts","sourceRoot":"","sources":["../../src/authoring/doc.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,kBAAkB;IACjC,6EAA6E;IAC7E,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yBAAyB;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gFAAgF;IAChF,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,4DAA4D;IAC5D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yCAAyC;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,2EAA2E;IAC3E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8DAA8D;IAC9D,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,+EAA+E;IAC/E,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,wEAAwE;IACxE,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,0DAA0D;IAC1D,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,yEAAyE;AACzE,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,0DAA0D;AAC1D,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,kEAAkE;AAClE,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,WAAW,uBAAwB,SAAQ,kBAAkB;IACjE,0CAA0C;IAC1C,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB,yCAAyC;IACzC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,oDAAoD;IACpD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;CACtB;AAED;;;;GAIG;AACH,MAAM,WAAW,sBAAuB,SAAQ,kBAAkB;IAChE,yDAAyD;IACzD,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,+EAA+E;IAC/E,OAAO,EAAE,iBAAiB,EAAE,CAAC;CAC9B;AAED;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG,kBAAkB,CAAC;AAEvD;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAC1B,uBAAuB,GACvB,sBAAsB,GACtB,qBAAqB,CAAC;AAE1B;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,uBAAuB,EAClE,GAAG,EAAE,CAAC,GACL,CAAC,GAAG;IAAC,IAAI,EAAE,WAAW,CAAA;CAAC,CAEzB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,sBAAsB,EAChE,GAAG,EAAE,CAAC,GACL,CAAC,GAAG;IAAC,IAAI,EAAE,UAAU,CAAA;CAAC,CAExB;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,qBAAqB,EACvD,GAAG,EAAE,CAAC,GACL,CAAC,GAAG;IAAC,IAAI,EAAE,SAAS,CAAA;CAAC,CAEvB"}
|
|
@@ -0,0 +1,100 @@
|
|
|
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
|
+
|
|
39
|
+
/** A single documented prop (mirrors `PropDoc` from core docs-types). */
|
|
40
|
+
|
|
41
|
+
/** A single documented param (mirrors `HookParamDoc`). */
|
|
42
|
+
|
|
43
|
+
/** A single documented return field (mirrors `HookReturnDoc`). */
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Input accepted by {@link createComponentDoc}. A component (or a family). The
|
|
47
|
+
* `type` discriminant is injected by the factory. `anatomy`/`slotElements` live
|
|
48
|
+
* inside `usage`; `importPath` is DERIVED (never authored).
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Input accepted by {@link createFunctionDoc}. Covers any function, including
|
|
53
|
+
* hooks: an inputs (`params`) + outputs (`returns`) surface. The `type`
|
|
54
|
+
* discriminant is injected by the factory; `importPath` is DERIVED.
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Input accepted by {@link createDoc}. A generic reference/topic doc — just the
|
|
59
|
+
* shared base. The `type` discriminant is injected by the factory.
|
|
60
|
+
*/
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Back-compat alias. Previously `createDoc` accepted a broad component-doc
|
|
64
|
+
* record; the union of the three input kinds preserves that permissiveness for
|
|
65
|
+
* any code referring to the old name.
|
|
66
|
+
*/
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Author a component doc. Stamp-only: returns the def with `type: 'component'`
|
|
70
|
+
* injected. Validation happens at the CLI load boundary.
|
|
71
|
+
*/
|
|
72
|
+
export function createComponentDoc(def) {
|
|
73
|
+
return {
|
|
74
|
+
...def,
|
|
75
|
+
type: 'component'
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Author a function doc (covers any function, including hooks). Stamp-only:
|
|
81
|
+
* returns the def with `type: 'function'` injected. Validation happens at the
|
|
82
|
+
* CLI load boundary.
|
|
83
|
+
*/
|
|
84
|
+
export function createFunctionDoc(def) {
|
|
85
|
+
return {
|
|
86
|
+
...def,
|
|
87
|
+
type: 'function'
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Author a generic reference/topic doc. Stamp-only: returns the def with
|
|
93
|
+
* `type: 'generic'` injected. Validation happens at the CLI load boundary.
|
|
94
|
+
*/
|
|
95
|
+
export function createDoc(def) {
|
|
96
|
+
return {
|
|
97
|
+
...def,
|
|
98
|
+
type: 'generic'
|
|
99
|
+
};
|
|
100
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file index.ts
|
|
3
|
+
* @input None (barrel).
|
|
4
|
+
* @output The Astryx integration-authoring surface: the stamp-only factories an
|
|
5
|
+
* integration package uses to describe what it contributes (integrations,
|
|
6
|
+
* templates, docs), plus their TypeScript input/output types.
|
|
7
|
+
* @position Producer-facing authoring surface, exported as
|
|
8
|
+
* `@astryxdesign/core/authoring`.
|
|
9
|
+
*
|
|
10
|
+
* ## Why these live in core
|
|
11
|
+
*
|
|
12
|
+
* These factories are tiny, zero-runtime-dependency identity functions whose
|
|
13
|
+
* value is their TypeScript surface. Hosting them in `@astryxdesign/core` (the
|
|
14
|
+
* base of the dependency graph) means core's own docs can adopt them without a
|
|
15
|
+
* core -> cli -> core cycle, and integration authors get the types without a
|
|
16
|
+
* hard dependency on the CLI. The CLI re-exports every factory from its
|
|
17
|
+
* existing subpaths (`@astryxdesign/cli/integration|template|doc`) for
|
|
18
|
+
* back-compat; the CLI keeps the Zod validation schemas at its load boundary.
|
|
19
|
+
*
|
|
20
|
+
* `createConfig` is intentionally NOT here — it is a consumer surface (every app
|
|
21
|
+
* with an `astryx.config`), exported separately as `@astryxdesign/core/config`.
|
|
22
|
+
*/
|
|
23
|
+
export { createIntegration } from './integration';
|
|
24
|
+
export type { AstryxIntegration } from './integration';
|
|
25
|
+
export { createPageTemplate, createBlockTemplate } from './template';
|
|
26
|
+
export type { AstryxTemplatePreview, AstryxTemplateInput, AstryxPageTemplateInput, AstryxBlockTemplateInput, AstryxPageTemplate, AstryxBlockTemplate, AstryxTemplate, } from './template';
|
|
27
|
+
export { createComponentDoc, createFunctionDoc, createDoc } from './doc';
|
|
28
|
+
export type { AstryxBaseDocInput, AstryxPropInput, AstryxParamInput, AstryxReturnInput, AstryxComponentDocInput, AstryxFunctionDocInput, AstryxGenericDocInput, AstryxComponentDoc, } from './doc';
|
|
29
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/authoring/index.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAChD,YAAY,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAErD,OAAO,EAAC,kBAAkB,EAAE,mBAAmB,EAAC,MAAM,YAAY,CAAC;AACnE,YAAY,EACV,qBAAqB,EACrB,mBAAmB,EACnB,uBAAuB,EACvB,wBAAwB,EACxB,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,GACf,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAC,kBAAkB,EAAE,iBAAiB,EAAE,SAAS,EAAC,MAAM,OAAO,CAAC;AACvE,YAAY,EACV,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,OAAO,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
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.js";
|
|
27
|
+
export { createPageTemplate, createBlockTemplate } from "./template.js";
|
|
28
|
+
export { createComponentDoc, createFunctionDoc, createDoc } from "./doc.js";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file integration.ts
|
|
3
|
+
* @input An integration package's manifest object.
|
|
4
|
+
* @output A type-preserving `createIntegration` helper plus the
|
|
5
|
+
* `AstryxIntegration` manifest surface.
|
|
6
|
+
* @position Integration-author authoring surface. See `./index.ts` for why
|
|
7
|
+
* these authoring factories live in `@astryxdesign/core`.
|
|
8
|
+
*
|
|
9
|
+
* `createIntegration` is an intentionally tiny runtime identity function: it
|
|
10
|
+
* returns its argument unchanged. Validation is NOT performed here — it happens
|
|
11
|
+
* at the CLI load boundary.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Integration manifest exported from a conventional root manifest file
|
|
15
|
+
* (astryx.integration.{ts,mjs,js}) sibling to the integration package's
|
|
16
|
+
* package.json. Identity (name/version) comes from the package's
|
|
17
|
+
* package.json, not from the manifest.
|
|
18
|
+
*/
|
|
19
|
+
export interface AstryxIntegration {
|
|
20
|
+
/** Relative path to the components/docs root (resolved to absolute). */
|
|
21
|
+
components?: string;
|
|
22
|
+
/** Relative path to the templates root (resolved to absolute). */
|
|
23
|
+
templates?: string;
|
|
24
|
+
/** Relative path to the codemods root (resolved to absolute). */
|
|
25
|
+
codemods?: string;
|
|
26
|
+
/** Where to file issues/feedback for this integration. */
|
|
27
|
+
issuesUrl?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Type-preserving helper for an Astryx integration manifest. Returns its
|
|
31
|
+
* argument unchanged; the value is the exported TypeScript surface. Validation
|
|
32
|
+
* happens at the CLI load boundary.
|
|
33
|
+
*/
|
|
34
|
+
export declare function createIntegration<T extends AstryxIntegration>(integration: T): T;
|
|
35
|
+
//# sourceMappingURL=integration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../src/authoring/integration.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,wEAAwE;IACxE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iEAAiE;IACjE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,iBAAiB,EAC3D,WAAW,EAAE,CAAC,GACb,CAAC,CAEH"}
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Type-preserving helper for an Astryx integration manifest. Returns its
|
|
25
|
+
* argument unchanged; the value is the exported TypeScript surface. Validation
|
|
26
|
+
* happens at the CLI load boundary.
|
|
27
|
+
*/
|
|
28
|
+
export function createIntegration(integration) {
|
|
29
|
+
return integration;
|
|
30
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file template.ts
|
|
3
|
+
* @input A page/block template doc object (without the `type` tag).
|
|
4
|
+
* @output Type-preserving `createPageTemplate`/`createBlockTemplate` helpers
|
|
5
|
+
* plus the authored-template TypeScript surface.
|
|
6
|
+
* @position Integration-author authoring surface. See `./index.ts` for why
|
|
7
|
+
* these authoring factories live in `@astryxdesign/core`.
|
|
8
|
+
*
|
|
9
|
+
* A template doc lives in a `<id>.doc.{ts,mjs,js}` file with a required
|
|
10
|
+
* same-stem sibling source file (`<id>.tsx`). The doc's `type` (page or block)
|
|
11
|
+
* — injected by the create* helpers — decides how the template is scaffolded.
|
|
12
|
+
*
|
|
13
|
+
* These are tiny runtime identity helpers that inject the `type` discriminant.
|
|
14
|
+
* They do NOT validate — validation happens at the CLI load boundary, where
|
|
15
|
+
* integration template discovery runs the module's default export through the
|
|
16
|
+
* template envelope schema.
|
|
17
|
+
*/
|
|
18
|
+
/** Optional preview metadata for a template (used by docs surfaces). */
|
|
19
|
+
export interface AstryxTemplatePreview {
|
|
20
|
+
/** Path or URL to a preview image. */
|
|
21
|
+
image?: string;
|
|
22
|
+
/** CSS aspect-ratio hint for the preview, e.g. "16 / 9". */
|
|
23
|
+
aspectRatio?: string;
|
|
24
|
+
}
|
|
25
|
+
/** Fields common to page and block template docs (without the `type` tag). */
|
|
26
|
+
export interface AstryxTemplateInput {
|
|
27
|
+
/** Human-readable template name. Required. */
|
|
28
|
+
name: string;
|
|
29
|
+
/** One-line description of what the template provides. Required. */
|
|
30
|
+
description: string;
|
|
31
|
+
/** Optional grouping/category label. */
|
|
32
|
+
category?: string;
|
|
33
|
+
/** Component display names the template composes. */
|
|
34
|
+
componentsUsed?: string[];
|
|
35
|
+
/** Optional preview metadata. */
|
|
36
|
+
preview?: AstryxTemplatePreview;
|
|
37
|
+
}
|
|
38
|
+
/** Input accepted by {@link createPageTemplate} (no `type` field). */
|
|
39
|
+
export type AstryxPageTemplateInput = AstryxTemplateInput;
|
|
40
|
+
/** Input accepted by {@link createBlockTemplate} (no `type` field). */
|
|
41
|
+
export type AstryxBlockTemplateInput = AstryxTemplateInput;
|
|
42
|
+
/** A validated page template doc. */
|
|
43
|
+
export type AstryxPageTemplate = AstryxTemplateInput & {
|
|
44
|
+
type: 'page';
|
|
45
|
+
};
|
|
46
|
+
/** A validated block template doc. */
|
|
47
|
+
export type AstryxBlockTemplate = AstryxTemplateInput & {
|
|
48
|
+
type: 'block';
|
|
49
|
+
};
|
|
50
|
+
/** A validated template doc (page or block). */
|
|
51
|
+
export type AstryxTemplate = AstryxPageTemplate | AstryxBlockTemplate;
|
|
52
|
+
/**
|
|
53
|
+
* Author an Astryx page template doc. Stamp-only: returns the def with
|
|
54
|
+
* `type: 'page'` injected. Validation happens at the CLI load boundary.
|
|
55
|
+
*/
|
|
56
|
+
export declare function createPageTemplate<T extends AstryxPageTemplateInput>(def: T): T & {
|
|
57
|
+
type: 'page';
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Author an Astryx block template doc. Stamp-only: returns the def with
|
|
61
|
+
* `type: 'block'` injected. Validation happens at the CLI load boundary.
|
|
62
|
+
*/
|
|
63
|
+
export declare function createBlockTemplate<T extends AstryxBlockTemplateInput>(def: T): T & {
|
|
64
|
+
type: 'block';
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../src/authoring/template.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;GAgBG;AAEH,wEAAwE;AACxE,MAAM,WAAW,qBAAqB;IACpC,sCAAsC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4DAA4D;IAC5D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,8EAA8E;AAC9E,MAAM,WAAW,mBAAmB;IAClC,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,WAAW,EAAE,MAAM,CAAC;IACpB,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,iCAAiC;IACjC,OAAO,CAAC,EAAE,qBAAqB,CAAC;CACjC;AAED,sEAAsE;AACtE,MAAM,MAAM,uBAAuB,GAAG,mBAAmB,CAAC;AAC1D,uEAAuE;AACvE,MAAM,MAAM,wBAAwB,GAAG,mBAAmB,CAAC;AAE3D,qCAAqC;AACrC,MAAM,MAAM,kBAAkB,GAAG,mBAAmB,GAAG;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,CAAC;AACtE,sCAAsC;AACtC,MAAM,MAAM,mBAAmB,GAAG,mBAAmB,GAAG;IAAC,IAAI,EAAE,OAAO,CAAA;CAAC,CAAC;AAExE,gDAAgD;AAChD,MAAM,MAAM,cAAc,GAAG,kBAAkB,GAAG,mBAAmB,CAAC;AAEtE;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,uBAAuB,EAClE,GAAG,EAAE,CAAC,GACL,CAAC,GAAG;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,CAEpB;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,wBAAwB,EACpE,GAAG,EAAE,CAAC,GACL,CAAC,GAAG;IAAC,IAAI,EAAE,OAAO,CAAA;CAAC,CAErB"}
|
|
@@ -0,0 +1,55 @@
|
|
|
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
|
+
|
|
23
|
+
/** Fields common to page and block template docs (without the `type` tag). */
|
|
24
|
+
|
|
25
|
+
/** Input accepted by {@link createPageTemplate} (no `type` field). */
|
|
26
|
+
|
|
27
|
+
/** Input accepted by {@link createBlockTemplate} (no `type` field). */
|
|
28
|
+
|
|
29
|
+
/** A validated page template doc. */
|
|
30
|
+
|
|
31
|
+
/** A validated block template doc. */
|
|
32
|
+
|
|
33
|
+
/** A validated template doc (page or block). */
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Author an Astryx page template doc. Stamp-only: returns the def with
|
|
37
|
+
* `type: 'page'` injected. Validation happens at the CLI load boundary.
|
|
38
|
+
*/
|
|
39
|
+
export function createPageTemplate(def) {
|
|
40
|
+
return {
|
|
41
|
+
...def,
|
|
42
|
+
type: 'page'
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Author an Astryx block template doc. Stamp-only: returns the def with
|
|
48
|
+
* `type: 'block'` injected. Validation happens at the CLI load boundary.
|
|
49
|
+
*/
|
|
50
|
+
export function createBlockTemplate(def) {
|
|
51
|
+
return {
|
|
52
|
+
...def,
|
|
53
|
+
type: 'block'
|
|
54
|
+
};
|
|
55
|
+
}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file config.ts
|
|
3
|
+
* @input An app's Astryx config object.
|
|
4
|
+
* @output A type-preserving `createConfig` helper plus the `AstryxConfig`
|
|
5
|
+
* surface authors write in `astryx.config.{ts,mjs,js}`.
|
|
6
|
+
* @position Consumer-facing authoring surface. Lives in `@astryxdesign/core`
|
|
7
|
+
* (not the CLI) so an app's config file gets editor/type feedback without
|
|
8
|
+
* taking a dependency on the CLI. The CLI re-exports this from
|
|
9
|
+
* `@astryxdesign/cli/config` for back-compat.
|
|
10
|
+
*
|
|
11
|
+
* `createConfig` is an intentionally tiny runtime identity function: it returns
|
|
12
|
+
* its argument unchanged. Its value is the exported TypeScript surface.
|
|
13
|
+
* Validation is NOT performed here — it happens at the CLI load boundary.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* A command to run as part of a post-codemod hook. Returned by a hook's
|
|
17
|
+
* `buildCommand` and executed after codemods write files.
|
|
18
|
+
*/
|
|
19
|
+
export interface PostCodemodCommand {
|
|
20
|
+
command: string;
|
|
21
|
+
args?: string[];
|
|
22
|
+
options?: {
|
|
23
|
+
cwd?: string;
|
|
24
|
+
env?: NodeJS.ProcessEnv;
|
|
25
|
+
timeout?: number;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* A post-codemod hook. `buildCommand` receives the package directory and the
|
|
30
|
+
* list of files changed by codemods, and returns the command to run (or a
|
|
31
|
+
* nullish value to skip).
|
|
32
|
+
*/
|
|
33
|
+
export type PostCodemodHook = {
|
|
34
|
+
name?: string;
|
|
35
|
+
buildCommand: (ctx: {
|
|
36
|
+
packageDir: string;
|
|
37
|
+
files: string[];
|
|
38
|
+
}) => PostCodemodCommand | null | undefined | Promise<PostCodemodCommand | null | undefined>;
|
|
39
|
+
};
|
|
40
|
+
/** A component XLE layout expressions can reference by name via `{hint}`. */
|
|
41
|
+
export interface XleComponent {
|
|
42
|
+
/** Import specifier the component is imported from, e.g. '@/components/KpiCard'. */
|
|
43
|
+
from: string;
|
|
44
|
+
/** Optional human description shown in tooling. */
|
|
45
|
+
description?: string;
|
|
46
|
+
/** Import as the module's default export instead of a named export. Defaults to false. */
|
|
47
|
+
default?: boolean;
|
|
48
|
+
}
|
|
49
|
+
/** User config exported from astryx.config.{ts,mjs,js}. */
|
|
50
|
+
export interface AstryxConfig {
|
|
51
|
+
/** Integration package names to load. */
|
|
52
|
+
integrations?: string[];
|
|
53
|
+
/** Where to file issues/feedback for this project. */
|
|
54
|
+
issuesUrl?: string;
|
|
55
|
+
/** Lifecycle hooks. */
|
|
56
|
+
hooks?: {
|
|
57
|
+
postCodemod?: PostCodemodHook[];
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* EXPERIMENTAL — shape may change and is not part of the stable config
|
|
61
|
+
* contract. Provisional home for features still being proven out.
|
|
62
|
+
*/
|
|
63
|
+
experimental?: {
|
|
64
|
+
/** Experimental XLE (layout expression) configuration. */
|
|
65
|
+
xle?: {
|
|
66
|
+
/**
|
|
67
|
+
* Register app-local components so XLE layout expressions can
|
|
68
|
+
* reference them by name via {hint}. Keyed by component name.
|
|
69
|
+
*/
|
|
70
|
+
components?: Record<string, XleComponent>;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Type-preserving helper for the Astryx config file. Returns its argument
|
|
76
|
+
* unchanged; the value is the exported TypeScript surface so config files get
|
|
77
|
+
* editor/type feedback. Validation happens at the CLI load boundary.
|
|
78
|
+
*/
|
|
79
|
+
export declare function createConfig<T extends AstryxConfig>(config: T): T;
|
|
80
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AAEH;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,CAAC,EAAE;QACR,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;QACxB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACH;AAED;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,CAAC,GAAG,EAAE;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,KAAK,EAAE,MAAM,EAAE,CAAC;KACjB,KACG,kBAAkB,GAClB,IAAI,GACJ,SAAS,GACT,OAAO,CAAC,kBAAkB,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;CACpD,CAAC;AAEF,6EAA6E;AAC7E,MAAM,WAAW,YAAY;IAC3B,oFAAoF;IACpF,IAAI,EAAE,MAAM,CAAC;IACb,mDAAmD;IACnD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0FAA0F;IAC1F,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,2DAA2D;AAC3D,MAAM,WAAW,YAAY;IAC3B,yCAAyC;IACzC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uBAAuB;IACvB,KAAK,CAAC,EAAE;QACN,WAAW,CAAC,EAAE,eAAe,EAAE,CAAC;KACjC,CAAC;IACF;;;OAGG;IACH,YAAY,CAAC,EAAE;QACb,0DAA0D;QAC1D,GAAG,CAAC,EAAE;YACJ;;;eAGG;YACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;SAC3C,CAAC;KACH,CAAC;CACH;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,YAAY,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAEjE"}
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
|
|
23
|
+
/**
|
|
24
|
+
* A post-codemod hook. `buildCommand` receives the package directory and the
|
|
25
|
+
* list of files changed by codemods, and returns the command to run (or a
|
|
26
|
+
* nullish value to skip).
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/** A component XLE layout expressions can reference by name via `{hint}`. */
|
|
30
|
+
|
|
31
|
+
/** User config exported from astryx.config.{ts,mjs,js}. */
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Type-preserving helper for the Astryx config file. Returns its argument
|
|
35
|
+
* unchanged; the value is the exported TypeScript surface so config files get
|
|
36
|
+
* editor/type feedback. Validation happens at the CLI load boundary.
|
|
37
|
+
*/
|
|
38
|
+
export function createConfig(config) {
|
|
39
|
+
return config;
|
|
40
|
+
}
|