@astryxdesign/cli 0.1.7 → 0.1.8-canary.07362a9
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 +40 -0
- package/README.md +115 -19
- package/{src/api → api/blog}/blog.mjs +42 -6
- package/{src/api → api/blog}/blog.test.mjs +2 -2
- package/api/build/build.mjs +92 -0
- package/api/build/build.test.mjs +92 -0
- package/{src/api → api/component}/component.mjs +49 -26
- package/{src/api → api/discover}/discover.mjs +55 -18
- package/{src/api → api/docs}/docs.mjs +47 -21
- package/{src/api → api/doctor}/doctor.mjs +13 -10
- package/{src/api → api}/error.mjs +2 -2
- package/{src/api → api/hook}/hook.mjs +11 -11
- package/{src/api → api}/index.mjs +16 -9
- package/{src/api → api/integration}/validate-integration.mjs +48 -15
- package/{src/api → api/integration}/validate-integration.test.mjs +1 -1
- package/{src/api → api/layout}/layout.mjs +66 -17
- package/{src/api → api/layout}/layout.test.mjs +1 -1
- package/{src/api → api/search}/search.mjs +71 -12
- package/api/swizzle/swizzle.mjs +283 -0
- package/{src/commands → api/swizzle}/swizzle.test.mjs +26 -1
- package/{src/api → api/template}/template-integration.test.mjs +2 -2
- package/{src/api → api/template}/template-suffix.test.mjs +3 -3
- package/{src/api → api/template}/template.mjs +96 -19
- package/{src/api → api/theme}/theme-add.mjs +35 -7
- package/{src → authoring}/codemod.mjs +6 -6
- package/{src → authoring}/config.test.mjs +1 -1
- package/{src → authoring}/doc.mjs +1 -1
- package/{src → authoring}/doc.test.mjs +1 -1
- package/{src → authoring}/template.mjs +1 -1
- package/bin/astryx.mjs +12 -10
- package/{src → cli}/commands/blog.mjs +48 -7
- package/{src → cli}/commands/build-theme.mjs +133 -115
- package/cli/commands/build.mjs +172 -0
- package/cli/commands/cli-postinstall.test.mjs +42 -0
- package/{src → cli}/commands/component/index.mjs +52 -25
- package/{src → cli}/commands/component-ownership.test.mjs +3 -3
- package/{src → cli}/commands/component-package.test.mjs +1 -1
- package/{src → cli}/commands/component-resolution.test.mjs +2 -2
- package/{src → cli}/commands/discover.mjs +23 -12
- package/{src → cli}/commands/docs.mjs +42 -10
- package/{src → cli}/commands/docs.test.mjs +1 -1
- package/{src → cli}/commands/doctor.mjs +3 -3
- package/{src → cli}/commands/doctor.test.mjs +2 -2
- package/{src → cli}/commands/ensure-core-built.mjs +3 -2
- package/{src → cli}/commands/external-showcase.test.mjs +1 -1
- package/{src → cli}/commands/hook/index.mjs +40 -17
- package/{src → cli}/commands/import-hint-correctness.test.mjs +1 -1
- package/cli/commands/init.mjs +195 -0
- package/{src → cli}/commands/init.next-steps.test.mjs +1 -1
- package/cli/commands/interactive-guard.test.mjs +66 -0
- package/{src → cli}/commands/json-contract.test.mjs +2 -2
- package/{src → cli}/commands/layout.mjs +59 -19
- package/{src → cli}/commands/search.mjs +22 -15
- package/{src → cli}/commands/search.test.mjs +1 -1
- package/cli/commands/setup-nudge.test.mjs +108 -0
- package/cli/commands/swizzle.mjs +103 -0
- package/{src → cli}/commands/template.mjs +84 -53
- package/{src → cli}/commands/template.path-safety.test.mjs +2 -2
- package/{src → cli}/commands/upgrade.integration-policy.test.mjs +1 -1
- package/{src → cli}/commands/upgrade.mjs +291 -77
- package/cli/commands/upgrade.test.mjs +314 -0
- package/{src → cli}/commands/validate-integration.mjs +17 -37
- package/{src → cli}/index.mjs +55 -19
- package/{src/codemods → codemods}/__tests__/registry.test.mjs +1 -0
- package/{src/codemods → codemods}/ensure-jscodeshift.mjs +12 -28
- package/{src/codemods → codemods}/integration-discovery.mjs +6 -3
- package/{src/codemods → codemods}/integration-discovery.test.mjs +1 -1
- package/{src/codemods → codemods}/integration-runner.mjs +8 -3
- package/{src/codemods → codemods}/registry.mjs +4 -1
- package/{src/codemods → codemods}/run-codemod.mjs +18 -11
- package/{src/codemods → codemods}/runner.mjs +24 -14
- package/{src/codemods → codemods}/transforms/v0.0.10/remove-size-props.mjs +9 -4
- package/{src/codemods → codemods}/transforms/v0.0.12/add-is-icon-only.mjs +27 -22
- package/{src/codemods → codemods}/transforms/v0.0.13/icon-name-deprecations.mjs +12 -5
- package/{src/codemods → codemods}/transforms/v0.0.13/rename-attachments-to-drawer.mjs +15 -8
- package/{src/codemods → codemods}/transforms/v0.0.13/toolbar-density-to-size.mjs +10 -4
- package/{src/codemods → codemods}/transforms/v0.0.14/rename-action-props.mjs +11 -5
- package/{src/codemods → codemods}/transforms/v0.0.14/rename-section-wash-to-muted.mjs +11 -6
- package/{src/codemods → codemods}/transforms/v0.0.14/rename-status-variants.mjs +15 -10
- package/{src/codemods → codemods}/transforms/v0.0.15/migrate-item-children-to-endcontent.mjs +13 -8
- package/{src/codemods → codemods}/transforms/v0.0.15/migrate-selector-children-to-render-option.mjs +18 -13
- package/{src/codemods → codemods}/transforms/v0.0.15/migrate-theme-selectors-to-data-attrs.mjs +8 -4
- package/{src/codemods → codemods}/transforms/v0.0.15/rename-date-picker-to-input.mjs +11 -6
- package/{src/codemods → codemods}/transforms/v0.0.15/rename-imperative-ref-to-handleRef.mjs +6 -1
- package/{src/codemods → codemods}/transforms/v0.0.15/rename-isStreaming-to-isStopShown.mjs +6 -1
- package/{src/codemods → codemods}/transforms/v0.0.15/rename-stack-element-to-as.mjs +8 -3
- package/{src/codemods → codemods}/transforms/v0.0.2/migrate-badge-dot-to-statusdot.mjs +17 -10
- package/{src/codemods → codemods}/transforms/v0.0.2/migrate-gap-to-numeric.mjs +7 -1
- package/{src/codemods → codemods}/transforms/v0.0.2/migrate-isFullBleed-to-padding.mjs +9 -4
- package/{src/codemods → codemods}/transforms/v0.0.2/migrate-useXDSIcon-to-getIcon.mjs +12 -7
- package/{src/codemods → codemods}/transforms/v0.0.2/rename-banner-endButton-to-endContent.mjs +7 -2
- package/{src/codemods → codemods}/transforms/v0.0.2/rename-form-tooltip-startIcon.mjs +8 -2
- package/{src/codemods → codemods}/transforms/v0.0.2/rename-isShown-to-isOpen.mjs +7 -2
- package/{src/codemods → codemods}/transforms/v0.0.2/rename-selector-items-to-options.mjs +7 -2
- package/{src/codemods → codemods}/transforms/v0.0.2/rename-sidenav-header-to-heading.mjs +11 -4
- package/{src/codemods → codemods}/transforms/v0.0.2/rename-topnav-title-to-heading.mjs +10 -4
- package/{src/codemods → codemods}/transforms/v0.0.2/unify-uncontrolled-to-defaultX.mjs +7 -2
- package/{src/codemods → codemods}/transforms/v0.0.2/unify-visibility-to-onOpenChange.mjs +10 -5
- package/{src/codemods → codemods}/transforms/v0.0.6/migrate-badge-children-to-label.mjs +7 -2
- package/{src/codemods → codemods}/transforms/v0.0.6/migrate-collapse-to-collapsible.mjs +9 -3
- package/{src/codemods → codemods}/transforms/v0.0.6/migrate-radius-tokens.mjs +11 -5
- package/{src/codemods → codemods}/transforms/v0.0.6/migrate-shadow-tokens.mjs +13 -6
- package/{src/codemods → codemods}/transforms/v0.0.6/migrate-skeleton-radius.mjs +7 -1
- package/{src/codemods → codemods}/transforms/v0.0.6/migrate-token-names.mjs +11 -5
- package/{src/codemods → codemods}/transforms/v0.0.7/rename-banner-variant-to-container.mjs +8 -3
- package/{src/codemods → codemods}/transforms/v0.0.8/migrate-token-renames.mjs +15 -8
- package/{src/codemods → codemods}/transforms/v0.0.8/rename-endslot-to-endcontent.mjs +7 -2
- package/{src/codemods → codemods}/transforms/v0.1.0/__tests__/drop-xds-prefix-imports.test.mjs +42 -7
- package/{src/codemods → codemods}/transforms/v0.1.0/__tests__/migrate-xds-module-specifiers.test.mjs +43 -0
- package/{src/codemods → codemods}/transforms/v0.1.0/drop-xds-prefix-imports.mjs +117 -13
- package/{src/codemods → codemods}/transforms/v0.1.0/migrate-xds-css-surfaces.mjs +21 -17
- package/{src/codemods → codemods}/transforms/v0.1.0/migrate-xds-declare-module.mjs +7 -2
- package/{src/codemods → codemods}/transforms/v0.1.0/migrate-xds-module-specifiers.mjs +86 -15
- package/{src/codemods → codemods}/transforms/v0.1.2/rename-text-color-active-to-accent.mjs +15 -9
- package/{src/codemods → codemods}/transforms/v0.1.3/migrate-layout-components-to-experimental.mjs +17 -12
- package/{src/codemods → codemods}/transforms/v0.1.5/rename-switch-label-spacing-default-to-hug.mjs +15 -9
- package/{src/codemods → codemods}/transforms/v0.1.7/migrate-table-tableprops-to-direct-props.mjs +17 -10
- package/{src/codemods → codemods}/transforms/v0.1.7/rename-table-renderprops-styles-to-xstyle.mjs +18 -13
- package/codemods/transforms/v0.1.8/__tests__/rename-avatar-size-scale.test.mjs +161 -0
- package/codemods/transforms/v0.1.8/index.mjs +19 -0
- package/codemods/transforms/v0.1.8/rename-avatar-size-scale.mjs +239 -0
- package/docs/cli-integrations.doc.mjs +150 -0
- package/docs/elevation.doc.mjs +79 -1
- package/docs/getting-started.doc.mjs +9 -9
- package/docs/internationalization.doc.mjs +92 -46
- package/docs/migration.doc.mjs +18 -18
- package/docs/principles.doc.dense.mjs +1 -1
- package/docs/principles.doc.mjs +6 -6
- package/docs/principles.doc.zh.mjs +1 -1
- package/docs/styling-libraries.doc.mjs +3 -3
- package/docs/styling.doc.mjs +4 -4
- package/docs/theme.doc.dense.mjs +2 -2
- package/docs/theme.doc.mjs +7 -7
- package/docs/theme.doc.zh.mjs +1 -1
- package/docs/tokens.doc.mjs +1 -1
- package/docs/working-with-ai.doc.mjs +19 -19
- package/{src/commands → lib/agent-docs}/agent-docs.mjs +164 -29
- package/{src/commands → lib/agent-docs}/agent-docs.path-safety.test.mjs +1 -1
- package/{src/commands → lib/agent-docs}/agent-docs.test.mjs +123 -10
- package/{src/lib → lib}/cli-error.mjs +2 -2
- package/{src/lib → lib}/component-discovery.mjs +44 -2
- package/{src/lib → lib}/component-format.mjs +67 -25
- package/{src/lib → lib}/component-loader.mjs +27 -13
- package/{src/lib → lib}/componentDocOverlay.test.mjs +0 -1
- package/{src/lib → lib}/error-codes.test.mjs +1 -1
- package/{src/lib → lib}/hook-discovery.mjs +14 -1
- package/{src/lib → lib}/hook-format.mjs +29 -5
- package/{src/lib → lib}/integration-warnings.mjs +2 -2
- package/{src/lib → lib}/integrations.mjs +20 -0
- package/{src/lib → lib}/integrations.test.mjs +1 -1
- package/{src/lib → lib}/json-contract.test.mjs +1 -1
- package/{src/lib → lib}/json-shim.mjs +11 -6
- package/{src/lib → lib}/json-shim.test.mjs +1 -1
- package/{src/lib → lib}/json.mjs +3 -3
- package/{src/lib → lib}/levenshtein.mjs +6 -0
- package/{src/lib → lib}/manifest.mjs +7 -5
- package/{src/lib → lib}/manifest.test.mjs +2 -2
- package/{src/lib → lib}/module-loader.mjs +1 -0
- package/{src/lib → lib}/package-scanner.mjs +47 -0
- package/{src/lib → lib}/project.mjs +48 -18
- package/{src/lib → lib}/project.test.mjs +1 -1
- package/{src/lib → lib}/resolve-theme.mjs +5 -0
- package/{src/lib → lib}/string-utils.mjs +15 -0
- package/lib/term-log.mjs +57 -0
- package/{src/lib → lib}/xle/browser.mjs +18 -8
- package/{src/lib → lib}/xle/expand.mjs +155 -22
- package/{src/lib → lib}/xle/parse.mjs +119 -13
- package/{src/lib → lib}/xle/print.mjs +54 -14
- package/{src/lib → lib}/xle/registry-core.mjs +28 -3
- package/{src/lib → lib}/xle/registry.mjs +9 -4
- package/{src/lib → lib}/xle/splice.mjs +13 -2
- package/{src/lib → lib}/xle/validate.mjs +95 -14
- package/lib/xle/xle-ast.d.ts +214 -0
- package/package.json +37 -28
- package/scripts/postinstall.mjs +74 -0
- package/templates/blocks/components/Avatar/AvatarFallbackChain.tsx +4 -4
- package/templates/blocks/components/Avatar/AvatarGroup.tsx +2 -2
- package/templates/blocks/components/Avatar/AvatarInitialsFallback.tsx +1 -1
- package/templates/blocks/components/Avatar/AvatarShowcase.tsx +5 -5
- package/templates/blocks/components/Avatar/AvatarUserCard.tsx +1 -1
- package/templates/blocks/components/Avatar/AvatarWithImage.tsx +4 -4
- package/templates/blocks/components/Avatar/AvatarWithStatus.tsx +3 -3
- package/templates/blocks/components/AvatarGroup/AvatarGroupShowcase.tsx +2 -2
- package/templates/blocks/components/AvatarGroupOverflow/AvatarGroupOverflowCustomText.tsx +1 -1
- package/templates/blocks/components/AvatarGroupOverflow/AvatarGroupOverflowDefault.tsx +1 -1
- package/templates/blocks/components/AvatarGroupOverflow/AvatarGroupOverflowShowcase.tsx +2 -2
- package/templates/blocks/components/AvatarStatusDot/AvatarStatusDotShowcase.tsx +3 -3
- package/templates/blocks/components/AvatarStatusDot/AvatarStatusDotVariants.tsx +3 -3
- package/templates/blocks/components/Banner/BannerFloating.doc.mjs +14 -0
- package/templates/blocks/components/Banner/BannerFloating.tsx +16 -0
- package/templates/blocks/components/Button/ButtonFloating.doc.mjs +14 -0
- package/templates/blocks/components/Button/ButtonFloating.tsx +37 -0
- package/templates/blocks/components/ButtonGroup/ButtonGroupFloating.doc.mjs +14 -0
- package/templates/blocks/components/ButtonGroup/ButtonGroupFloating.tsx +23 -0
- package/templates/blocks/components/Card/CardElevations.doc.mjs +14 -0
- package/templates/blocks/components/Card/CardElevations.tsx +32 -0
- package/templates/blocks/components/Card/ClickableCardElevated.doc.mjs +14 -0
- package/templates/blocks/components/Card/ClickableCardElevated.tsx +21 -0
- package/templates/blocks/components/Card/SelectableCardElevated.doc.mjs +14 -0
- package/templates/blocks/components/Card/SelectableCardElevated.tsx +37 -0
- package/templates/blocks/components/Carousel/CarouselSnap.tsx +1 -1
- package/templates/blocks/components/ChatComposer/ChatComposerFlat.doc.mjs +14 -0
- package/templates/blocks/components/ChatComposer/ChatComposerFlat.tsx +75 -0
- package/templates/blocks/components/ChatMessage/ChatMessageAvatarName.tsx +2 -2
- package/templates/blocks/components/ChatMessage/ChatMessageMultiBubble.tsx +1 -1
- package/templates/blocks/components/ChatMessageBubble/ChatMessageBubbleGrouping.tsx +1 -1
- package/templates/blocks/components/ChatMessageBubble/ChatMessageBubbleMetadata.tsx +1 -1
- package/templates/blocks/components/ChatMessageList/ChatMessageListDensity.tsx +5 -9
- package/templates/blocks/components/ChatMessageList/ChatMessageListFullFeatured.tsx +1 -1
- package/templates/blocks/components/CodeBlock/CodeBlockTerminal.tsx +1 -1
- package/templates/blocks/components/HoverCard/HoverCardShowcase.tsx +1 -1
- package/templates/blocks/components/IconButton/IconButtonFloating.doc.mjs +14 -0
- package/templates/blocks/components/IconButton/IconButtonFloating.tsx +37 -0
- package/templates/blocks/components/InternationalizationProvider/InternationalizationProvider01ShippedLocale.doc.mjs +19 -0
- package/templates/blocks/components/InternationalizationProvider/InternationalizationProvider01ShippedLocale.tsx +46 -0
- package/templates/blocks/components/InternationalizationProvider/InternationalizationProvider02Overrides.doc.mjs +14 -0
- package/templates/blocks/components/InternationalizationProvider/InternationalizationProvider02Overrides.tsx +33 -0
- package/templates/blocks/components/Item/ItemWithMedia.tsx +2 -2
- package/templates/blocks/components/ListItem/ListItemWithMedia.tsx +2 -2
- package/templates/blocks/components/OverflowList/OverflowListCappedToolbar.doc.mjs +14 -0
- package/templates/blocks/components/OverflowList/OverflowListCappedToolbar.tsx +39 -0
- package/templates/blocks/components/OverflowList/OverflowListMultiRowTags.doc.mjs +14 -0
- package/templates/blocks/components/OverflowList/OverflowListMultiRowTags.tsx +44 -0
- package/templates/blocks/components/Pagination/PaginationDotsCarousel.tsx +2 -6
- package/templates/blocks/components/Stack/StackFillItem.tsx +2 -6
- package/templates/blocks/components/TabList/TabListTabsWithActions.doc.mjs +1 -1
- package/templates/blocks/components/TabList/TabListTabsWithActions.tsx +2 -7
- package/templates/blocks/components/Table/TableRowStatusTable.doc.mjs +14 -0
- package/templates/blocks/components/Table/TableRowStatusTable.tsx +59 -0
- package/templates/blocks/components/Thumbnail/ThumbnailDisabled.tsx +6 -1
- package/templates/blocks/components/Thumbnail/ThumbnailGallery.tsx +1 -0
- package/templates/blocks/components/Thumbnail/ThumbnailRemovable.tsx +1 -0
- package/templates/blocks/components/TypeaheadItem/TypeaheadItemShowcase.tsx +1 -1
- package/templates/pages/ai-chat/page.tsx +4 -4
- package/templates/pages/dashboard-portfolio/page.tsx +3 -11
- package/templates/pages/detail-page/page.tsx +5 -12
- package/templates/pages/documentation-design/page.tsx +1 -1
- package/templates/pages/messaging-shell/page.tsx +6 -8
- package/templates/pages/table-grouped/page.tsx +9 -14
- package/templates/pages/table-page/page.tsx +7 -9
- package/templates/pages/table-page-heatmap-status/page.tsx +5 -13
- package/{src/types → types}/api.contract.assert.ts +17 -8
- package/{src/types → types}/api.d.ts +110 -9
- package/{src/types → types}/base.d.ts +40 -4
- package/types/build.d.ts +53 -0
- package/types/codemod.d.ts +166 -0
- package/{src/types → types}/component.d.ts +1 -1
- package/{src/types → types}/discover.d.ts +1 -1
- package/{src/types → types}/docs.d.ts +1 -4
- package/{src/types → types}/hook.d.ts +1 -1
- package/{src/types → types}/index.d.ts +1 -0
- package/types/jscodeshift.d.ts +19 -0
- package/types/layout.d.ts +74 -0
- package/{src/types → types}/swizzle.d.ts +4 -0
- package/{src/types → types}/template-api.d.ts +4 -1
- package/types/theme.d.ts +53 -0
- package/types/upgrade.d.ts +108 -0
- package/utils/package-manager.mjs +178 -0
- package/utils/package-manager.test.mjs +220 -0
- package/{src/utils → utils}/path-safety.mjs +0 -18
- package/{src/utils → utils}/paths.mjs +4 -1
- package/{src/utils → utils}/update-check.mjs +5 -4
- package/{src/utils → utils}/update-check.test.mjs +3 -3
- package/docs/integration-authoring.md +0 -105
- package/src/commands/build.mjs +0 -196
- package/src/commands/init.mjs +0 -288
- package/src/commands/interactive-guard.test.mjs +0 -69
- package/src/commands/swizzle.mjs +0 -440
- package/src/commands/upgrade.test.mjs +0 -160
- package/src/types/codemod.d.ts +0 -81
- package/src/types/theme.d.ts +0 -23
- package/src/types/upgrade.d.ts +0 -64
- package/src/utils/interactive.mjs +0 -76
- package/src/utils/interactive.test.mjs +0 -70
- package/src/utils/package-manager.mjs +0 -74
- package/src/utils/package-manager.test.mjs +0 -113
- /package/{src/api → api/docs}/docOverlays.test.mjs +0 -0
- /package/{src/api → api/integration}/integration-block-exports.test.mjs +0 -0
- /package/{src/api → api/template}/template.test.mjs +0 -0
- /package/{src → authoring}/codemod.test.mjs +0 -0
- /package/{src → authoring}/config.mjs +0 -0
- /package/{src → authoring}/integration.mjs +0 -0
- /package/{src → authoring}/template.test.mjs +0 -0
- /package/{src → cli}/cli-exit-codes.test.mjs +0 -0
- /package/{src → cli}/commands/build-theme.color-scheme.test.mjs +0 -0
- /package/{src → cli}/commands/build-theme.import-path.test.mjs +0 -0
- /package/{src → cli}/commands/build-theme.path-safety.test.mjs +0 -0
- /package/{src → cli}/commands/build-theme.prose.test.mjs +0 -0
- /package/{src → cli}/commands/build-theme.variants.test.mjs +0 -0
- /package/{src → cli}/commands/build-theme.watch.test.mjs +0 -0
- /package/{src → cli}/commands/component.test.mjs +0 -0
- /package/{src → cli}/commands/detail-levels.test.mjs +0 -0
- /package/{src → cli}/commands/swizzle.path-safety.test.mjs +0 -0
- /package/{src → cli}/commands/swizzle.routing.test.mjs +0 -0
- /package/{src → cli}/commands/template.test.mjs +0 -0
- /package/{src → cli}/commands/upgrade.config-ordering.test.mjs +0 -0
- /package/{src → cli}/commands/validate-integration.test.mjs +0 -0
- /package/{src → cli}/update-hint-commands.test.mjs +0 -0
- /package/{src/codemods → codemods}/__tests__/rename-imperative-ref-to-handleRef.test.mjs +0 -0
- /package/{src/codemods → codemods}/__tests__/rename-isStreaming-to-isStopShown.test.mjs +0 -0
- /package/{src/codemods → codemods}/__tests__/rename-section-wash-to-muted.test.mjs +0 -0
- /package/{src/codemods → codemods}/__tests__/runner.test.mjs +0 -0
- /package/{src/codemods → codemods}/__tests__/toolbar-density-to-size.test.mjs +0 -0
- /package/{src/codemods → codemods}/__tests__/validation.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.10/__tests__/remove-size-props.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.10/index.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.12/__tests__/add-is-icon-only.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.12/index.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.13/__tests__/icon-name-deprecations.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.13/__tests__/rename-attachments-to-drawer.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.13/index.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.14/__tests__/rename-action-props.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.14/__tests__/rename-status-variants.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.14/index.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.15/__tests__/migrate-item-children-to-endcontent.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.15/__tests__/migrate-selector-children-to-render-option.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.15/__tests__/migrate-theme-selectors-to-data-attrs.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.15/__tests__/rename-date-picker-to-input.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.15/__tests__/rename-stack-element-to-as.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.15/index.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/migrate-badge-dot-to-statusdot.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/migrate-gap-to-numeric.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/migrate-isFullBleed-to-padding.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/migrate-useXDSIcon-to-getIcon.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/rename-banner-endButton-to-endContent.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/rename-form-tooltip-startIcon.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/rename-isShown-to-isOpen.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/rename-selector-items-to-options.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/rename-sidenav-header-to-heading.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/rename-topnav-title-to-heading.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/unify-uncontrolled-to-defaultX.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.2/__tests__/unify-visibility-to-onOpenChange.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.2/index.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.6/__tests__/migrate-collapse-to-collapsible.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.6/__tests__/migrate-radius-tokens.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.6/__tests__/migrate-shadow-tokens.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.6/__tests__/migrate-skeleton-radius.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.6/__tests__/migrate-token-names.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.6/index.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.7/__tests__/rename-banner-variant-to-container.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.7/index.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.8/__tests__/migrate-token-renames.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.8/__tests__/rename-endslot-to-endcontent.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.0.8/index.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.1.0/__tests__/migrate-xds-css-surfaces.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.1.0/__tests__/migrate-xds-declare-module.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.1.0/__tests__/v0.1.0-ordering.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.1.0/index.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.1.2/__tests__/rename-text-color-active-to-accent.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.1.2/index.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.1.3/__tests__/migrate-layout-components-to-experimental.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.1.3/index.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.1.5/__tests__/rename-switch-label-spacing-default-to-hug.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.1.5/index.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.1.7/__tests__/migrate-table-tableprops-to-direct-props.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.1.7/__tests__/rename-table-renderprops-styles-to-xstyle.test.mjs +0 -0
- /package/{src/codemods → codemods}/transforms/v0.1.7/index.mjs +0 -0
- /package/{src/lib → lib}/cli-error.test.mjs +0 -0
- /package/{src/lib → lib}/component-discovery.importpath.test.mjs +0 -0
- /package/{src/lib → lib}/component-format.test.mjs +0 -0
- /package/{src/lib → lib}/component-loader.test.mjs +0 -0
- /package/{src/lib → lib}/config-cache.mjs +0 -0
- /package/{src/lib → lib}/config-cache.test.mjs +0 -0
- /package/{src/lib → lib}/config-schema.mjs +0 -0
- /package/{src/lib → lib}/error-codes.mjs +0 -0
- /package/{src/lib → lib}/integration-warnings.test.mjs +0 -0
- /package/{src/lib → lib}/module-loader.test.mjs +0 -0
- /package/{src/lib → lib}/node-version.mjs +0 -0
- /package/{src/lib → lib}/node-version.test.mjs +0 -0
- /package/{src/lib → lib}/parse.mjs +0 -0
- /package/{src/lib → lib}/site.mjs +0 -0
- /package/{src/lib → lib}/xle/browser.d.ts +0 -0
- /package/{src/lib → lib}/xle/xle.test.mjs +0 -0
- /package/{src/schemas → schemas}/doc-schema.mjs +0 -0
- /package/{src/schemas → schemas}/template-schema.mjs +0 -0
- /package/{src/types → types}/config.d.ts +0 -0
- /package/{src/types → types}/doc.d.ts +0 -0
- /package/{src/types → types}/doctor.d.ts +0 -0
- /package/{src/types → types}/error-codes.d.ts +0 -0
- /package/{src/types → types}/integration.d.ts +0 -0
- /package/{src/types → types}/manifest.d.ts +0 -0
- /package/{src/types → types}/search.d.ts +0 -0
- /package/{src/types → types}/template.d.ts +0 -0
- /package/{src/types → types}/validate-integration.d.ts +0 -0
- /package/{src/utils → utils}/github.mjs +0 -0
- /package/{src/utils → utils}/path-safety.test.mjs +0 -0
- /package/{src/utils → utils}/paths.test.mjs +0 -0
- /package/{src/utils → utils}/semver.mjs +0 -0
- /package/{src/utils → utils}/semver.test.mjs +0 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {ChatComposer} from '@astryxdesign/core/Chat';
|
|
6
|
+
import {Button} from '@astryxdesign/core/Button';
|
|
7
|
+
import {DropdownMenu} from '@astryxdesign/core/DropdownMenu';
|
|
8
|
+
import {Icon} from '@astryxdesign/core/Icon';
|
|
9
|
+
import {Stack} from '@astryxdesign/core/Layout';
|
|
10
|
+
import {Text} from '@astryxdesign/core/Text';
|
|
11
|
+
import {
|
|
12
|
+
Cog6ToothIcon,
|
|
13
|
+
MicrophoneIcon,
|
|
14
|
+
SparklesIcon,
|
|
15
|
+
} from '@heroicons/react/24/outline';
|
|
16
|
+
|
|
17
|
+
export default function ChatComposerFlat() {
|
|
18
|
+
return (
|
|
19
|
+
<Stack direction="vertical" gap={2} style={{width: '100%', maxWidth: 450}}>
|
|
20
|
+
<Text type="supporting" color="secondary">
|
|
21
|
+
elevation="none" — flat, with a text-input-style border and
|
|
22
|
+
focus ring
|
|
23
|
+
</Text>
|
|
24
|
+
<ChatComposer
|
|
25
|
+
elevation="none"
|
|
26
|
+
onSubmit={value => {
|
|
27
|
+
console.log('Sent:', value);
|
|
28
|
+
}}
|
|
29
|
+
footerActions={
|
|
30
|
+
<>
|
|
31
|
+
<DropdownMenu
|
|
32
|
+
button={{
|
|
33
|
+
label: 'Auto',
|
|
34
|
+
variant: 'ghost',
|
|
35
|
+
size: 'md',
|
|
36
|
+
icon: <Icon icon={SparklesIcon} size="sm" />,
|
|
37
|
+
children: 'Auto',
|
|
38
|
+
}}
|
|
39
|
+
menuWidth={200}
|
|
40
|
+
items={[
|
|
41
|
+
{label: 'Auto', onClick: () => {}},
|
|
42
|
+
{label: 'Model A', onClick: () => {}},
|
|
43
|
+
{label: 'Model B', onClick: () => {}},
|
|
44
|
+
]}
|
|
45
|
+
/>
|
|
46
|
+
<DropdownMenu
|
|
47
|
+
button={{
|
|
48
|
+
label: 'Settings',
|
|
49
|
+
variant: 'ghost',
|
|
50
|
+
size: 'md',
|
|
51
|
+
icon: <Icon icon={Cog6ToothIcon} size="sm" />,
|
|
52
|
+
children: 'Settings',
|
|
53
|
+
}}
|
|
54
|
+
menuWidth={200}
|
|
55
|
+
items={[
|
|
56
|
+
{label: 'Preferences', onClick: () => {}},
|
|
57
|
+
{label: 'Keyboard shortcuts', onClick: () => {}},
|
|
58
|
+
{label: 'About', onClick: () => {}},
|
|
59
|
+
]}
|
|
60
|
+
/>
|
|
61
|
+
</>
|
|
62
|
+
}
|
|
63
|
+
sendActions={
|
|
64
|
+
<Button
|
|
65
|
+
label="Microphone"
|
|
66
|
+
variant="ghost"
|
|
67
|
+
size="md"
|
|
68
|
+
icon={<Icon icon={MicrophoneIcon} />}
|
|
69
|
+
isIconOnly
|
|
70
|
+
/>
|
|
71
|
+
}
|
|
72
|
+
/>
|
|
73
|
+
</Stack>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
@@ -17,7 +17,7 @@ export default function ChatMessageAvatarName() {
|
|
|
17
17
|
<ChatMessageList style={{maxWidth: 500}}>
|
|
18
18
|
<ChatMessage
|
|
19
19
|
sender="assistant"
|
|
20
|
-
avatar={<Avatar name="Agent" size="
|
|
20
|
+
avatar={<Avatar name="Agent" size="md" />}>
|
|
21
21
|
<ChatMessageBubble
|
|
22
22
|
name={
|
|
23
23
|
<Text type="supporting" weight="semibold" color="secondary">
|
|
@@ -50,7 +50,7 @@ export default function ChatMessageAvatarName() {
|
|
|
50
50
|
</ChatMessage>
|
|
51
51
|
<ChatMessage
|
|
52
52
|
sender="assistant"
|
|
53
|
-
avatar={<Avatar name="Agent" size="
|
|
53
|
+
avatar={<Avatar name="Agent" size="md" />}>
|
|
54
54
|
<ChatMessageBubble
|
|
55
55
|
name={
|
|
56
56
|
<Text type="supporting" weight="semibold" color="secondary">
|
|
@@ -17,7 +17,7 @@ export default function ChatMessageBubbleGrouping() {
|
|
|
17
17
|
<ChatMessageList style={{maxWidth: 500}}>
|
|
18
18
|
<ChatMessage
|
|
19
19
|
sender="assistant"
|
|
20
|
-
avatar={<Avatar name="Agent" size="
|
|
20
|
+
avatar={<Avatar name="Agent" size="md" />}>
|
|
21
21
|
<ChatMessageBubble
|
|
22
22
|
group="first"
|
|
23
23
|
name={
|
|
@@ -20,7 +20,7 @@ export default function ChatMessageBubbleMetadata() {
|
|
|
20
20
|
<ChatMessageList style={{maxWidth: 500}}>
|
|
21
21
|
<ChatMessage
|
|
22
22
|
sender="assistant"
|
|
23
|
-
avatar={<Avatar name="Agent" size="
|
|
23
|
+
avatar={<Avatar name="Agent" size="md" />}>
|
|
24
24
|
<ChatMessageBubble
|
|
25
25
|
name={
|
|
26
26
|
<Text type="supporting" weight="semibold" color="secondary">
|
|
@@ -16,9 +16,9 @@ import {Fragment} from 'react';
|
|
|
16
16
|
const DENSITIES = ['compact', 'balanced', 'spacious'] as const;
|
|
17
17
|
|
|
18
18
|
const AVATAR_SIZE = {
|
|
19
|
-
compact: '
|
|
20
|
-
balanced: '
|
|
21
|
-
spacious: '
|
|
19
|
+
compact: 'sm' as const,
|
|
20
|
+
balanced: 'md' as const,
|
|
21
|
+
spacious: 'md' as const,
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
export default function ChatMessageListDensity() {
|
|
@@ -34,15 +34,11 @@ export default function ChatMessageListDensity() {
|
|
|
34
34
|
<VStack style={{flex: 1, minHeight: 0}}>
|
|
35
35
|
<ChatMessageList density={density}>
|
|
36
36
|
<ChatMessage sender="user">
|
|
37
|
-
<ChatMessageBubble>
|
|
38
|
-
How does density work?
|
|
39
|
-
</ChatMessageBubble>
|
|
37
|
+
<ChatMessageBubble>How does density work?</ChatMessageBubble>
|
|
40
38
|
</ChatMessage>
|
|
41
39
|
<ChatMessage
|
|
42
40
|
sender="assistant"
|
|
43
|
-
avatar={
|
|
44
|
-
<Avatar name="Agent" size={AVATAR_SIZE[density]} />
|
|
45
|
-
}>
|
|
41
|
+
avatar={<Avatar name="Agent" size={AVATAR_SIZE[density]} />}>
|
|
46
42
|
<ChatMessageBubble>
|
|
47
43
|
Density provides default spacing at every level — message
|
|
48
44
|
gap, bubble padding, and gap between child elements. Use gap
|
|
@@ -42,7 +42,7 @@ export default function ChatMessageListFullFeatured() {
|
|
|
42
42
|
|
|
43
43
|
<ChatMessage
|
|
44
44
|
sender="assistant"
|
|
45
|
-
avatar={<Avatar name="Agent" size="
|
|
45
|
+
avatar={<Avatar name="Agent" size="md" />}>
|
|
46
46
|
<ChatMessageBubble group="first">
|
|
47
47
|
<Markdown density="compact">
|
|
48
48
|
{`Sure! Here's the key pattern from **useReducer.ts**:`}
|
|
@@ -7,7 +7,7 @@ import {githubDark} from '@astryxdesign/core/theme/syntax';
|
|
|
7
7
|
import {CodeBlock} from '@astryxdesign/core/CodeBlock';
|
|
8
8
|
|
|
9
9
|
const commands = `$ astryx init --features agents
|
|
10
|
-
✓ AI agent docs installed → .
|
|
10
|
+
✓ AI agent docs installed → AGENTS.md
|
|
11
11
|
$ pnpm astryx component CodeBlock --dense`;
|
|
12
12
|
|
|
13
13
|
export default function CodeBlockTerminal() {
|
|
@@ -15,7 +15,7 @@ export default function HoverCardShowcase() {
|
|
|
15
15
|
content={
|
|
16
16
|
<Stack direction="vertical" gap={2} style={{width: 240}}>
|
|
17
17
|
<Stack direction="horizontal" gap={2} vAlign="center">
|
|
18
|
-
<Avatar name="Jane Doe" size="
|
|
18
|
+
<Avatar name="Jane Doe" size="lg" />
|
|
19
19
|
<Stack direction="vertical" gap={0}>
|
|
20
20
|
<Heading level={5}>Jane Doe</Heading>
|
|
21
21
|
<Text type="supporting" color="secondary">
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
|
|
4
|
+
export const doc = {
|
|
5
|
+
type: 'block',
|
|
6
|
+
exampleFor: 'IconButton',
|
|
7
|
+
name: 'IconButton — Floating',
|
|
8
|
+
displayName: 'IconButton — Floating',
|
|
9
|
+
description:
|
|
10
|
+
'A floating action button (FAB) — the most common floating-button shape is icon-only. Raised here with `elevation="high"`.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 4 / 3,
|
|
13
|
+
componentsUsed: ['IconButton', 'Icon', 'Layout', 'Text'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {IconButton} from '@astryxdesign/core/IconButton';
|
|
6
|
+
import {Icon} from '@astryxdesign/core/Icon';
|
|
7
|
+
import {Stack} from '@astryxdesign/core/Layout';
|
|
8
|
+
import {Text} from '@astryxdesign/core/Text';
|
|
9
|
+
import {PlusIcon} from '@heroicons/react/24/outline';
|
|
10
|
+
|
|
11
|
+
const VARIANTS = [
|
|
12
|
+
{variant: 'primary' as const, label: 'Primary'},
|
|
13
|
+
{variant: 'secondary' as const, label: 'Secondary'},
|
|
14
|
+
{variant: 'ghost' as const, label: 'Ghost'},
|
|
15
|
+
{variant: 'destructive' as const, label: 'Destructive'},
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
export default function IconButtonFloating() {
|
|
19
|
+
return (
|
|
20
|
+
<Stack direction="vertical" gap={4}>
|
|
21
|
+
<Text type="supporting" color="secondary">
|
|
22
|
+
FABs are usually icon-only — raise one with `elevation="high"`
|
|
23
|
+
</Text>
|
|
24
|
+
<Stack direction="horizontal" gap={3} vAlign="center">
|
|
25
|
+
{VARIANTS.map(({variant, label}) => (
|
|
26
|
+
<IconButton
|
|
27
|
+
key={variant}
|
|
28
|
+
label={label}
|
|
29
|
+
variant={variant}
|
|
30
|
+
icon={<Icon icon={PlusIcon} />}
|
|
31
|
+
elevation="high"
|
|
32
|
+
/>
|
|
33
|
+
))}
|
|
34
|
+
</Stack>
|
|
35
|
+
</Stack>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
|
|
4
|
+
export const doc = {
|
|
5
|
+
type: 'block',
|
|
6
|
+
exampleFor: 'InternationalizationProvider',
|
|
7
|
+
name: 'InternationalizationProvider — Shipped Locale',
|
|
8
|
+
displayName: 'Internationalization Provider — Shipped Locale',
|
|
9
|
+
description:
|
|
10
|
+
'Load a locale catalog shipped by Astryx and re-render InternationalizationProvider with a new locale to update Astryx strings live.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 16 / 9,
|
|
13
|
+
componentsUsed: [
|
|
14
|
+
'InternationalizationProvider',
|
|
15
|
+
'SegmentedControl',
|
|
16
|
+
'Selector',
|
|
17
|
+
'Layout',
|
|
18
|
+
],
|
|
19
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {useState} from 'react';
|
|
6
|
+
import {InternationalizationProvider} from '@astryxdesign/core/i18n';
|
|
7
|
+
import frFR from '@astryxdesign/core/locales/fr-FR.json';
|
|
8
|
+
import {Stack} from '@astryxdesign/core/Layout';
|
|
9
|
+
import {
|
|
10
|
+
SegmentedControl,
|
|
11
|
+
SegmentedControlItem,
|
|
12
|
+
} from '@astryxdesign/core/SegmentedControl';
|
|
13
|
+
import {Selector} from '@astryxdesign/core/Selector';
|
|
14
|
+
|
|
15
|
+
type Locale = 'en' | 'fr-FR';
|
|
16
|
+
|
|
17
|
+
export default function InternationalizationProviderShippedLocale() {
|
|
18
|
+
const [locale, setLocale] = useState<Locale>('en');
|
|
19
|
+
const [value, setValue] = useState<string | null>(null);
|
|
20
|
+
return (
|
|
21
|
+
<InternationalizationProvider locale={locale} messages={{'fr-FR': frFR}}>
|
|
22
|
+
<Stack direction="vertical" gap={4} hAlign="center">
|
|
23
|
+
<SegmentedControl
|
|
24
|
+
label="Language"
|
|
25
|
+
value={locale}
|
|
26
|
+
onChange={nextLocale => setLocale(nextLocale as Locale)}
|
|
27
|
+
size="sm">
|
|
28
|
+
<SegmentedControlItem value="en" label="EN" />
|
|
29
|
+
<SegmentedControlItem value="fr-FR" label="FR" />
|
|
30
|
+
</SegmentedControl>
|
|
31
|
+
<Selector
|
|
32
|
+
style={{width: 300}}
|
|
33
|
+
label="Billing region"
|
|
34
|
+
options={[
|
|
35
|
+
{value: 'americas', label: 'Americas'},
|
|
36
|
+
{value: 'emea', label: 'EMEA'},
|
|
37
|
+
{value: 'apac', label: 'APAC'},
|
|
38
|
+
]}
|
|
39
|
+
value={value}
|
|
40
|
+
onChange={setValue}
|
|
41
|
+
hasClear
|
|
42
|
+
/>
|
|
43
|
+
</Stack>
|
|
44
|
+
</InternationalizationProvider>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
|
|
4
|
+
export const doc = {
|
|
5
|
+
type: 'block',
|
|
6
|
+
exampleFor: 'InternationalizationProvider',
|
|
7
|
+
name: 'InternationalizationProvider — Overrides',
|
|
8
|
+
displayName: 'Internationalization Provider — Overrides',
|
|
9
|
+
description:
|
|
10
|
+
'Override a small number of Astryx strings without providing a full locale catalog.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 16 / 9,
|
|
13
|
+
componentsUsed: ['InternationalizationProvider', 'Selector'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {useState} from 'react';
|
|
6
|
+
import {InternationalizationProvider} from '@astryxdesign/core/i18n';
|
|
7
|
+
import {Selector} from '@astryxdesign/core/Selector';
|
|
8
|
+
|
|
9
|
+
export default function InternationalizationProviderOverrides() {
|
|
10
|
+
const [value, setValue] = useState<string | null>(null);
|
|
11
|
+
return (
|
|
12
|
+
<InternationalizationProvider
|
|
13
|
+
locale="en"
|
|
14
|
+
overrides={{
|
|
15
|
+
en: {
|
|
16
|
+
'@astryx.selector.placeholder': 'Choose...',
|
|
17
|
+
},
|
|
18
|
+
}}>
|
|
19
|
+
<Selector
|
|
20
|
+
style={{width: 300}}
|
|
21
|
+
label="Billing region"
|
|
22
|
+
options={[
|
|
23
|
+
{value: 'americas', label: 'Americas'},
|
|
24
|
+
{value: 'emea', label: 'EMEA'},
|
|
25
|
+
{value: 'apac', label: 'APAC'},
|
|
26
|
+
]}
|
|
27
|
+
value={value}
|
|
28
|
+
onChange={setValue}
|
|
29
|
+
hasClear
|
|
30
|
+
/>
|
|
31
|
+
</InternationalizationProvider>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
@@ -13,14 +13,14 @@ export default function ItemWithMedia() {
|
|
|
13
13
|
return (
|
|
14
14
|
<Stack gap={0}>
|
|
15
15
|
<Item
|
|
16
|
-
startContent={<Avatar name="Ada Lovelace" size="
|
|
16
|
+
startContent={<Avatar name="Ada Lovelace" size="sm" />}
|
|
17
17
|
label="Ada Lovelace"
|
|
18
18
|
description="Design systems engineer"
|
|
19
19
|
endContent={<Badge label="Owner" variant="purple" />}
|
|
20
20
|
onClick={() => {}}
|
|
21
21
|
/>
|
|
22
22
|
<Item
|
|
23
|
-
startContent={<Avatar name="Grace Hopper" size="
|
|
23
|
+
startContent={<Avatar name="Grace Hopper" size="sm" />}
|
|
24
24
|
label="Grace Hopper"
|
|
25
25
|
description="Compiler platform"
|
|
26
26
|
endContent={<Text color="secondary">Online</Text>}
|
|
@@ -13,14 +13,14 @@ export default function ListItemWithMedia() {
|
|
|
13
13
|
<ListItem
|
|
14
14
|
label="Ada Lovelace"
|
|
15
15
|
description="Design systems engineer"
|
|
16
|
-
startContent={<Avatar name="Ada Lovelace" size="
|
|
16
|
+
startContent={<Avatar name="Ada Lovelace" size="sm" />}
|
|
17
17
|
endContent={<Badge label="Owner" variant="purple" />}
|
|
18
18
|
onClick={() => {}}
|
|
19
19
|
/>
|
|
20
20
|
<ListItem
|
|
21
21
|
label="Grace Hopper"
|
|
22
22
|
description="Platform infrastructure"
|
|
23
|
-
startContent={<Avatar name="Grace Hopper" size="
|
|
23
|
+
startContent={<Avatar name="Grace Hopper" size="sm" />}
|
|
24
24
|
endContent={<Badge label="On call" variant="blue" />}
|
|
25
25
|
onClick={() => {}}
|
|
26
26
|
/>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
|
|
4
|
+
export const doc = {
|
|
5
|
+
type: 'block',
|
|
6
|
+
exampleFor: 'OverflowList',
|
|
7
|
+
name: 'OverflowList — Capped Toolbar',
|
|
8
|
+
displayName: 'OverflowList — Capped Toolbar',
|
|
9
|
+
description:
|
|
10
|
+
'maxVisibleItems caps the row at three actions even when more would fit; the rest move to a dropdown',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 4 / 3,
|
|
13
|
+
componentsUsed: ['OverflowList', 'Button', 'DropdownMenu', 'Card', 'Center'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {OverflowList} from '@astryxdesign/core/OverflowList';
|
|
6
|
+
import {Button} from '@astryxdesign/core/Button';
|
|
7
|
+
import {DropdownMenu} from '@astryxdesign/core/DropdownMenu';
|
|
8
|
+
import {Card} from '@astryxdesign/core/Card';
|
|
9
|
+
import {Center} from '@astryxdesign/core/Center';
|
|
10
|
+
|
|
11
|
+
const actions = ['Save', 'Edit', 'Duplicate', 'Share', 'Archive', 'Delete'];
|
|
12
|
+
|
|
13
|
+
export default function OverflowListCappedToolbar() {
|
|
14
|
+
return (
|
|
15
|
+
<Center width={420}>
|
|
16
|
+
<Card padding={2}>
|
|
17
|
+
<OverflowList
|
|
18
|
+
gap={2}
|
|
19
|
+
maxVisibleItems={3}
|
|
20
|
+
overflowRenderer={overflowItems => (
|
|
21
|
+
<DropdownMenu
|
|
22
|
+
button={{
|
|
23
|
+
label: `+${overflowItems.length}`,
|
|
24
|
+
variant: 'ghost',
|
|
25
|
+
size: 'sm',
|
|
26
|
+
}}
|
|
27
|
+
items={overflowItems.map(({index}) => ({
|
|
28
|
+
label: actions[index],
|
|
29
|
+
}))}
|
|
30
|
+
/>
|
|
31
|
+
)}>
|
|
32
|
+
{actions.map(action => (
|
|
33
|
+
<Button key={action} label={action} size="sm" />
|
|
34
|
+
))}
|
|
35
|
+
</OverflowList>
|
|
36
|
+
</Card>
|
|
37
|
+
</Center>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
|
|
4
|
+
export const doc = {
|
|
5
|
+
type: 'block',
|
|
6
|
+
exampleFor: 'OverflowList',
|
|
7
|
+
name: 'OverflowList — Multi-row Tags',
|
|
8
|
+
displayName: 'OverflowList — Multi-row Tags',
|
|
9
|
+
description:
|
|
10
|
+
'Tags wrap onto up to two rows with maxRows, then collapse the rest into a count badge',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 4 / 3,
|
|
13
|
+
componentsUsed: ['OverflowList', 'Badge', 'Card'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {OverflowList} from '@astryxdesign/core/OverflowList';
|
|
6
|
+
import {Badge} from '@astryxdesign/core/Badge';
|
|
7
|
+
import {Card} from '@astryxdesign/core/Card';
|
|
8
|
+
|
|
9
|
+
const tags = [
|
|
10
|
+
'React',
|
|
11
|
+
'TypeScript',
|
|
12
|
+
'StyleX',
|
|
13
|
+
'Storybook',
|
|
14
|
+
'Vitest',
|
|
15
|
+
'Playwright',
|
|
16
|
+
'ESLint',
|
|
17
|
+
'Prettier',
|
|
18
|
+
'Vite',
|
|
19
|
+
'pnpm',
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
export default function OverflowListMultiRowTags() {
|
|
23
|
+
return (
|
|
24
|
+
<Card
|
|
25
|
+
padding={2}
|
|
26
|
+
style={{
|
|
27
|
+
resize: 'horizontal',
|
|
28
|
+
overflow: 'hidden',
|
|
29
|
+
minWidth: 120,
|
|
30
|
+
width: 260,
|
|
31
|
+
}}>
|
|
32
|
+
<OverflowList
|
|
33
|
+
gap={1}
|
|
34
|
+
maxRows={2}
|
|
35
|
+
overflowRenderer={overflowItems => (
|
|
36
|
+
<Badge variant="neutral" label={`+${overflowItems.length}`} />
|
|
37
|
+
)}>
|
|
38
|
+
{tags.map(tag => (
|
|
39
|
+
<Badge key={tag} variant="info" label={tag} />
|
|
40
|
+
))}
|
|
41
|
+
</OverflowList>
|
|
42
|
+
</Card>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
@@ -62,12 +62,8 @@ export default function PaginationDotsCarousel() {
|
|
|
62
62
|
<Stack direction="vertical" gap={3}>
|
|
63
63
|
<Stars count={review.stars} />
|
|
64
64
|
<Text type="body">{review.quote}</Text>
|
|
65
|
-
<Stack
|
|
66
|
-
|
|
67
|
-
gap={3}
|
|
68
|
-
vAlign="center"
|
|
69
|
-
hAlign="start">
|
|
70
|
-
<Avatar name={review.name} size="small" />
|
|
65
|
+
<Stack direction="horizontal" gap={3} vAlign="center" hAlign="start">
|
|
66
|
+
<Avatar name={review.name} size="md" />
|
|
71
67
|
<Stack direction="vertical" gap={0}>
|
|
72
68
|
<Text type="supporting" weight="bold">
|
|
73
69
|
{review.name}
|
|
@@ -17,13 +17,9 @@ export default function StackFillItem() {
|
|
|
17
17
|
return (
|
|
18
18
|
<Stack direction="vertical" gap={3} width="100%" style={{maxWidth: 300}}>
|
|
19
19
|
{USERS.map(user => (
|
|
20
|
-
<Stack
|
|
21
|
-
key={user.name}
|
|
22
|
-
direction="horizontal"
|
|
23
|
-
gap={3}
|
|
24
|
-
vAlign="center">
|
|
20
|
+
<Stack key={user.name} direction="horizontal" gap={3} vAlign="center">
|
|
25
21
|
<StackItem size="static">
|
|
26
|
-
<Avatar name={user.name} size="
|
|
22
|
+
<Avatar name={user.name} size="md" />
|
|
27
23
|
</StackItem>
|
|
28
24
|
<StackItem size="fill">
|
|
29
25
|
<Stack direction="vertical" gap={0}>
|
|
@@ -7,7 +7,7 @@ export const doc = {
|
|
|
7
7
|
name: 'TabList — With Actions',
|
|
8
8
|
displayName: 'TabList — With Actions',
|
|
9
9
|
description:
|
|
10
|
-
'Page header pattern with tabs on the left and action buttons pushed to the right. When hasDivider is true,
|
|
10
|
+
'Page header pattern with tabs on the left and action buttons pushed to the right. When hasDivider is true, match the Button size to the TabList size so the tabs and actions align to a shared baseline above the divider.',
|
|
11
11
|
isReady: true,
|
|
12
12
|
aspectRatio: 4 / 3,
|
|
13
13
|
componentsUsed: ['TabList', 'Tab', 'Button'],
|
|
@@ -55,16 +55,11 @@ export default function TabListTabsWithActions() {
|
|
|
55
55
|
<Button
|
|
56
56
|
label="Filter"
|
|
57
57
|
variant="ghost"
|
|
58
|
-
size="
|
|
58
|
+
size="lg"
|
|
59
59
|
icon={FilterIcon}
|
|
60
60
|
isIconOnly
|
|
61
61
|
/>
|
|
62
|
-
<Button
|
|
63
|
-
label="New item"
|
|
64
|
-
variant="primary"
|
|
65
|
-
size="sm"
|
|
66
|
-
icon={PlusIcon}
|
|
67
|
-
/>
|
|
62
|
+
<Button label="New item" variant="primary" size="lg" icon={PlusIcon} />
|
|
68
63
|
</div>
|
|
69
64
|
</TabList>
|
|
70
65
|
);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
|
|
4
|
+
export const doc = {
|
|
5
|
+
type: 'block',
|
|
6
|
+
exampleFor: 'useTableRowStatus',
|
|
7
|
+
name: 'useTableRowStatus - Status Dots',
|
|
8
|
+
displayName: 'useTableRowStatus - Status Dots',
|
|
9
|
+
description:
|
|
10
|
+
'A job table using useTableRowStatus to render a colored status dot (or icon) per row (failed / running / queued). Rows with no status show no dot.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 16 / 9,
|
|
13
|
+
componentsUsed: ['Table'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
Table,
|
|
7
|
+
useTableRowStatus,
|
|
8
|
+
proportional,
|
|
9
|
+
pixel,
|
|
10
|
+
} from '@astryxdesign/core/Table';
|
|
11
|
+
import type {TableColumn, TableRowStatus} from '@astryxdesign/core/Table';
|
|
12
|
+
|
|
13
|
+
interface Job extends Record<string, unknown> {
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
owner: string;
|
|
17
|
+
state: 'failed' | 'running' | 'queued' | 'succeeded';
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const jobs: Job[] = [
|
|
21
|
+
{id: 'j1', name: 'build-core', owner: 'Ava', state: 'failed'},
|
|
22
|
+
{id: 'j2', name: 'lint', owner: 'Liam', state: 'running'},
|
|
23
|
+
{id: 'j3', name: 'unit-tests', owner: 'Zoe', state: 'succeeded'},
|
|
24
|
+
{id: 'j4', name: 'docsite-deploy', owner: 'Max', state: 'queued'},
|
|
25
|
+
{id: 'j5', name: 'smoke-test', owner: 'Mia', state: 'succeeded'},
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
const columns: TableColumn<Job>[] = [
|
|
29
|
+
{key: 'name', header: 'Job', width: proportional(2)},
|
|
30
|
+
{key: 'owner', header: 'Owner', width: pixel(120)},
|
|
31
|
+
{key: 'state', header: 'State', width: pixel(120)},
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
function jobStatus(job: Job): TableRowStatus | null {
|
|
35
|
+
switch (job.state) {
|
|
36
|
+
case 'failed':
|
|
37
|
+
return {color: 'error', icon: 'error', label: 'Failed'};
|
|
38
|
+
case 'running':
|
|
39
|
+
return {color: 'warning', icon: 'warning', label: 'Running'};
|
|
40
|
+
case 'queued':
|
|
41
|
+
return {color: 'gray', label: 'Queued'};
|
|
42
|
+
default:
|
|
43
|
+
return null; // succeeded: no dot
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export default function TableRowStatusTable() {
|
|
48
|
+
const rowStatus = useTableRowStatus<Job>({getStatus: jobStatus});
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<Table
|
|
52
|
+
data={jobs}
|
|
53
|
+
columns={columns}
|
|
54
|
+
idKey="id"
|
|
55
|
+
hasHover
|
|
56
|
+
plugins={{rowStatus}}
|
|
57
|
+
/>
|
|
58
|
+
);
|
|
59
|
+
}
|