@astryxdesign/cli 0.1.0 → 0.1.1-canary.080d887
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +68 -0
- package/README.md +117 -75
- package/bin/astryx.mjs +22 -7
- package/docs/getting-started.doc.mjs +11 -11
- package/docs/icons.doc.mjs +1 -1
- package/docs/migration.doc.mjs +2 -2
- package/docs/shape.doc.mjs +1 -1
- package/docs/styling.doc.mjs +3 -4
- package/docs/theme.doc.dense.mjs +2 -2
- package/docs/theme.doc.mjs +14 -0
- package/docs/theme.doc.zh.mjs +2 -2
- package/docs/working-with-ai.doc.mjs +4 -4
- package/package.json +20 -9
- package/src/api/discover.mjs +78 -26
- package/src/api/doctor.mjs +3 -3
- package/src/api/layout.mjs +301 -0
- package/src/api/layout.test.mjs +238 -0
- package/src/api/search.mjs +207 -13
- package/src/api/template.mjs +193 -51
- package/src/api/template.test.mjs +2 -0
- package/src/codemods/__tests__/registry.test.mjs +1 -0
- package/src/codemods/registry.mjs +1 -0
- package/src/codemods/runner.mjs +105 -51
- package/src/codemods/transforms/v0.1.0/__tests__/migrate-xds-config-surfaces.test.mjs +116 -0
- package/src/codemods/transforms/v0.1.0/__tests__/migrate-xds-module-specifiers.test.mjs +51 -0
- package/src/codemods/transforms/v0.1.0/index.mjs +28 -0
- package/src/codemods/transforms/v0.1.0/migrate-xds-config-surfaces.mjs +230 -0
- package/src/codemods/transforms/v0.1.0/migrate-xds-module-specifiers.mjs +84 -0
- package/src/commands/agent-docs.mjs +119 -66
- package/src/commands/agent-docs.path-safety.test.mjs +1 -1
- package/src/commands/agent-docs.test.mjs +87 -31
- package/src/commands/build-theme.import-path.test.mjs +1 -1
- package/src/commands/build-theme.path-safety.test.mjs +1 -1
- package/src/commands/build-theme.prose.test.mjs +1 -1
- package/src/commands/build.mjs +196 -0
- package/src/commands/component-package.test.mjs +1 -1
- package/src/commands/component.test.mjs +1 -1
- package/src/commands/docs.test.mjs +1 -1
- package/src/commands/doctor.test.mjs +1 -1
- package/src/commands/external-showcase.test.mjs +1 -1
- package/src/commands/gap-report.mjs +17 -9
- package/src/commands/gap-report.test.mjs +21 -16
- package/src/commands/init.mjs +43 -9
- package/src/commands/init.next-steps.test.mjs +46 -0
- package/src/commands/interactive-guard.test.mjs +1 -1
- package/src/commands/json-contract.test.mjs +10 -3
- package/src/commands/layout.mjs +139 -0
- package/src/commands/swizzle-gap-safety.test.mjs +1 -1
- package/src/commands/swizzle.mjs +51 -23
- package/src/commands/swizzle.path-safety.test.mjs +1 -1
- package/src/commands/template.path-safety.test.mjs +1 -1
- package/src/commands/template.test.mjs +1 -1
- package/src/commands/upgrade.mjs +292 -177
- package/src/commands/upgrade.test.mjs +41 -27
- package/src/config.mjs +31 -0
- package/src/config.test.mjs +24 -0
- package/src/index.mjs +5 -0
- package/src/lib/config-schema.mjs +119 -0
- package/src/lib/config.mjs +45 -6
- package/src/lib/config.test.mjs +91 -0
- package/src/lib/error-codes.mjs +11 -0
- package/src/lib/integrations.mjs +155 -0
- package/src/lib/integrations.test.mjs +154 -0
- package/src/lib/levenshtein.mjs +29 -0
- package/src/lib/manifest.mjs +6 -0
- package/src/lib/package-scanner.mjs +31 -7
- package/src/lib/string-utils.mjs +5 -14
- package/src/lib/xle/browser.d.ts +91 -0
- package/src/lib/xle/browser.mjs +120 -0
- package/src/lib/xle/expand.mjs +622 -0
- package/src/lib/xle/parse.mjs +581 -0
- package/src/lib/xle/print.mjs +174 -0
- package/src/lib/xle/registry-core.mjs +170 -0
- package/src/lib/xle/registry.mjs +237 -0
- package/src/lib/xle/splice.mjs +137 -0
- package/src/lib/xle/validate.mjs +356 -0
- package/src/lib/xle/xle.test.mjs +333 -0
- package/src/types/config.d.ts +99 -0
- package/src/types/error-codes.d.ts +1 -0
- package/src/utils/github.mjs +12 -27
- package/src/utils/interactive.mjs +1 -1
- package/src/utils/interactive.test.mjs +2 -0
- package/src/utils/package-manager.mjs +1 -1
- package/src/utils/package-manager.test.mjs +1 -1
- package/src/utils/path-safety.test.mjs +1 -1
- package/src/utils/paths.test.mjs +8 -8
- package/src/utils/update-check.mjs +4 -26
- package/src/utils/update-check.test.mjs +2 -64
- package/templates/blocks/components/AppShell/AppShellContentOnly.tsx +1 -9
- package/templates/blocks/components/AppShell/AppShellShowcase.tsx +1 -10
- package/templates/blocks/components/AppShell/AppShellSideNavOnly.tsx +1 -9
- package/templates/blocks/components/AppShell/AppShellTopNavOnly.tsx +1 -9
- package/templates/blocks/components/AppShell/AppShellTopNavWithSideNav.tsx +1 -9
- package/templates/blocks/components/AppShell/AppShellWithBanner.tsx +1 -9
- package/templates/blocks/components/AspectRatio/AspectRatioShowcase.tsx +12 -19
- package/templates/blocks/components/Banner/BannerShowcase.tsx +1 -8
- package/templates/blocks/components/Blockquote/BlockquoteShowcase.tsx +1 -8
- package/templates/blocks/components/Carousel/CarouselShowcase.tsx +2 -12
- package/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerShowcase.tsx +6 -9
- package/templates/blocks/components/ChatLayout/ChatLayoutPanelChat.tsx +10 -12
- package/templates/blocks/components/ChatMessageList/ChatMessageListDensity.tsx +1 -9
- package/templates/blocks/components/ChatMessageList/ChatMessageListFullFeatured.tsx +1 -9
- package/templates/blocks/components/ChatMessageList/ChatMessageListShowcase.tsx +1 -9
- package/templates/blocks/components/ChatMessageMetadata/ChatMessageMetadataShowcase.tsx +1 -8
- package/templates/blocks/components/ChatSendButton/ChatSendButtonInComposer.tsx +1 -8
- package/templates/blocks/components/Citation/CitationInlineText.tsx +4 -4
- package/templates/blocks/components/Code/CodeInlineInParagraph.tsx +1 -8
- package/templates/blocks/components/CodeBlock/CodeBlockBashCommand.tsx +1 -1
- package/templates/blocks/components/CodeBlock/CodeBlockJSONConfig.tsx +1 -1
- package/templates/blocks/components/CommandPaletteEmpty/CommandPaletteEmptyShowcase.doc.mjs +15 -0
- package/templates/blocks/components/CommandPaletteEmpty/CommandPaletteEmptyShowcase.tsx +26 -0
- package/templates/blocks/components/CommandPaletteItem/CommandPaletteItemShowcase.tsx +9 -12
- package/templates/blocks/components/ContextMenu/ContextMenuShowcase.tsx +13 -15
- package/templates/blocks/components/DateInput/DateInputDateRange.doc.mjs +2 -2
- package/templates/blocks/components/Divider/DividerShowcase.tsx +1 -8
- package/templates/blocks/components/Divider/DividerVertical.tsx +7 -9
- package/templates/blocks/components/Field/FieldShowcase.tsx +1 -8
- package/templates/blocks/components/FormLayout/FormLayoutHorizontal.tsx +1 -6
- package/templates/blocks/components/Grid/GridResponsiveAutoFit.tsx +1 -9
- package/templates/blocks/components/HoverCard/HoverCardInlineTextHoverCard.tsx +4 -6
- package/templates/blocks/components/HoverCard/HoverCardInteractiveContent.tsx +1 -6
- package/templates/blocks/components/HoverCard/HoverCardProfileHoverCard.tsx +2 -8
- package/templates/blocks/components/HoverCard/HoverCardShowcase.tsx +1 -8
- package/templates/blocks/components/OverflowList/OverflowListOverflowBadges.tsx +8 -11
- package/templates/blocks/components/OverflowList/OverflowListOverflowDropdownActions.tsx +9 -12
- package/templates/blocks/components/Overlay/OverlayBottomStrip.tsx +4 -17
- package/templates/blocks/components/Overlay/OverlayHoverReveal.tsx +15 -16
- package/templates/blocks/components/Overlay/OverlayShowcase.tsx +5 -21
- package/templates/blocks/components/Pagination/PaginationDotsCarousel.tsx +2 -14
- package/templates/blocks/components/Pagination/PaginationPageSize.tsx +12 -14
- package/templates/blocks/components/Pagination/PaginationVariants.tsx +1 -8
- package/templates/blocks/components/Pagination/PaginationWithTable.tsx +2 -14
- package/templates/blocks/components/Slider/SliderShowcase.tsx +10 -1
- package/templates/blocks/components/ToggleButton/ToggleButtonGroup.doc.mjs +1 -1
- package/templates/blocks/components/Tokenizer/TokenizerClear.tsx +1 -6
- package/templates/blocks/components/Tokenizer/TokenizerCreatable.tsx +2 -7
- package/templates/blocks/components/Tokenizer/TokenizerEndContent.tsx +1 -6
- package/templates/blocks/components/Tokenizer/TokenizerIcon.tsx +1 -6
- package/templates/blocks/components/Tokenizer/TokenizerMaxEntries.tsx +1 -6
- package/templates/blocks/components/Tokenizer/TokenizerOverflow.tsx +2 -7
- package/templates/blocks/components/Tokenizer/TokenizerShowcase.tsx +1 -6
- package/templates/blocks/components/Tokenizer/TokenizerStates.tsx +4 -9
- package/templates/blocks/components/Toolbar/ToolbarCardHeader.tsx +1 -10
- package/templates/blocks/components/Toolbar/ToolbarSizes.tsx +1 -8
- package/templates/blocks/components/Toolbar/ToolbarTableFilter.tsx +1 -8
- package/templates/blocks/components/Toolbar/ToolbarThreeSlot.tsx +1 -10
- package/templates/blocks/components/Toolbar/ToolbarWithTabs.tsx +8 -11
- package/templates/pages/ai-chat/page.tsx +71 -64
- package/templates/pages/ai-chat-landing/page.tsx +8 -12
- package/templates/pages/centered-hero/page.tsx +13 -15
- package/templates/pages/classic-gallery/page.tsx +27 -34
- package/templates/pages/detail-page/page.tsx +18 -18
- package/templates/pages/documentation/page.tsx +42 -58
- package/templates/pages/documentation-design/page.tsx +82 -60
- package/templates/pages/documentation-technical/page.tsx +101 -60
- package/templates/pages/editor/page.tsx +42 -54
- package/templates/pages/file-explorer/page.tsx +13 -16
- package/templates/pages/form-two-column/page.tsx +13 -17
- package/templates/pages/gallery-hero/page.tsx +13 -15
- package/templates/pages/ide/page.tsx +188 -264
- package/templates/pages/library/page.tsx +16 -23
- package/templates/pages/login/page.tsx +14 -18
- package/templates/pages/login-card/page.tsx +14 -18
- package/templates/pages/login-split/page.tsx +50 -48
- package/templates/pages/login-sso/page.tsx +9 -13
- package/templates/pages/mixed-gallery/page.tsx +51 -45
- package/templates/pages/payment-form/page.tsx +56 -70
- package/templates/pages/product-detail/page.tsx +27 -33
- package/templates/pages/product-gallery/page.tsx +7 -13
- package/templates/pages/settings-dialog/page.tsx +35 -43
- package/templates/pages/settings-sidebar/page.tsx +39 -47
- package/templates/pages/side-gallery/page.tsx +6 -9
- package/templates/pages/table-grouped/page.tsx +11 -15
- package/templates/pages/theme-showcase/page.tsx +33 -37
- package/templates/blocks/components/MoreMenu/MoreMenuInToolbar.doc.mjs +0 -14
- package/templates/blocks/components/MoreMenu/MoreMenuInToolbar.tsx +0 -67
|
@@ -4,9 +4,8 @@
|
|
|
4
4
|
* @file Check for newer @astryxdesign/core versions via local signals.
|
|
5
5
|
*
|
|
6
6
|
* Resolution order:
|
|
7
|
-
* 1. $ASTRYX_LATEST_VERSION env var
|
|
8
|
-
* 2.
|
|
9
|
-
* 3. If neither: no hint (no network calls from this module)
|
|
7
|
+
* 1. $ASTRYX_LATEST_VERSION env var
|
|
8
|
+
* 2. If unset: no hint (no network calls from this module)
|
|
10
9
|
*
|
|
11
10
|
* When a newer version is detected, returns a hint string for CLI output.
|
|
12
11
|
* Also sets $ASTRYX_LATEST_VERSION for subsequent commands in the same shell.
|
|
@@ -23,34 +22,13 @@ import {semverGt} from './semver.mjs';
|
|
|
23
22
|
* @param {string} [cwd] - Project directory (default: process.cwd())
|
|
24
23
|
* @returns {string|null} Latest version string, or null if unknown
|
|
25
24
|
*/
|
|
26
|
-
export function getLatestVersion(
|
|
25
|
+
export function getLatestVersion() {
|
|
27
26
|
// 1. Check env var (fastest — set by previous CLI run)
|
|
28
27
|
const envVersion = process.env.ASTRYX_LATEST_VERSION;
|
|
29
28
|
if (envVersion && /^\d+\.\d+\.\d+/.test(envVersion)) {
|
|
30
29
|
return envVersion;
|
|
31
30
|
}
|
|
32
31
|
|
|
33
|
-
// 2. Check versionFile from package.json config
|
|
34
|
-
try {
|
|
35
|
-
const pkgPath = path.resolve(cwd, 'package.json');
|
|
36
|
-
if (fs.existsSync(pkgPath)) {
|
|
37
|
-
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
|
|
38
|
-
const versionFile = pkg.astryx?.versionFile;
|
|
39
|
-
|
|
40
|
-
if (versionFile) {
|
|
41
|
-
const filePath = path.resolve(cwd, versionFile);
|
|
42
|
-
if (fs.existsSync(filePath)) {
|
|
43
|
-
const version = fs.readFileSync(filePath, 'utf-8').trim();
|
|
44
|
-
if (/^\d+\.\d+\.\d+/.test(version)) {
|
|
45
|
-
return version;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
} catch {
|
|
51
|
-
// Silently fail — version check should never break the CLI
|
|
52
|
-
}
|
|
53
|
-
|
|
54
32
|
return null;
|
|
55
33
|
}
|
|
56
34
|
|
|
@@ -97,7 +75,7 @@ export function checkForUpdate(cwd = process.cwd()) {
|
|
|
97
75
|
// Use semver-aware comparison so '0.0.20' is correctly treated as greater
|
|
98
76
|
// than '0.0.5' (lexicographic compare gets that backwards).
|
|
99
77
|
if (semverGt(latest, installed)) {
|
|
100
|
-
return `FYI: A newer version of @astryxdesign/core (${latest}) is available.
|
|
78
|
+
return `FYI: A newer version of @astryxdesign/core (${latest}) is available. Install the new package version, then run: astryx upgrade --from <old-version> --apply`;
|
|
101
79
|
}
|
|
102
80
|
|
|
103
81
|
return null;
|
|
@@ -14,7 +14,7 @@ let tmpDir;
|
|
|
14
14
|
const originalEnv = {};
|
|
15
15
|
|
|
16
16
|
beforeEach(() => {
|
|
17
|
-
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), '
|
|
17
|
+
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'astryx-update-check-'));
|
|
18
18
|
// Save and clear env
|
|
19
19
|
originalEnv.ASTRYX_LATEST_VERSION = process.env.ASTRYX_LATEST_VERSION;
|
|
20
20
|
delete process.env.ASTRYX_LATEST_VERSION;
|
|
@@ -41,17 +41,6 @@ describe('getLatestVersion', () => {
|
|
|
41
41
|
expect(getLatestVersion(tmpDir)).toBeNull();
|
|
42
42
|
});
|
|
43
43
|
|
|
44
|
-
it('reads from versionFile in package.json', () => {
|
|
45
|
-
const versionFilePath = path.join(tmpDir, 'LATEST_VERSION');
|
|
46
|
-
fs.writeFileSync(versionFilePath, '0.0.9\n');
|
|
47
|
-
fs.writeFileSync(
|
|
48
|
-
path.join(tmpDir, 'package.json'),
|
|
49
|
-
JSON.stringify({astryx: {versionFile: './LATEST_VERSION'}}),
|
|
50
|
-
);
|
|
51
|
-
|
|
52
|
-
expect(getLatestVersion(tmpDir)).toBe('0.0.9');
|
|
53
|
-
});
|
|
54
|
-
|
|
55
44
|
it('returns null when no signals exist', () => {
|
|
56
45
|
fs.writeFileSync(
|
|
57
46
|
path.join(tmpDir, 'package.json'),
|
|
@@ -59,26 +48,6 @@ describe('getLatestVersion', () => {
|
|
|
59
48
|
);
|
|
60
49
|
expect(getLatestVersion(tmpDir)).toBeNull();
|
|
61
50
|
});
|
|
62
|
-
|
|
63
|
-
it('returns null when versionFile path does not exist', () => {
|
|
64
|
-
fs.writeFileSync(
|
|
65
|
-
path.join(tmpDir, 'package.json'),
|
|
66
|
-
JSON.stringify({astryx: {versionFile: './missing/LATEST_VERSION'}}),
|
|
67
|
-
);
|
|
68
|
-
expect(getLatestVersion(tmpDir)).toBeNull();
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
it('env var takes priority over versionFile', () => {
|
|
72
|
-
process.env.ASTRYX_LATEST_VERSION = '1.0.0';
|
|
73
|
-
const versionFilePath = path.join(tmpDir, 'LATEST_VERSION');
|
|
74
|
-
fs.writeFileSync(versionFilePath, '0.0.9\n');
|
|
75
|
-
fs.writeFileSync(
|
|
76
|
-
path.join(tmpDir, 'package.json'),
|
|
77
|
-
JSON.stringify({astryx: {versionFile: './LATEST_VERSION'}}),
|
|
78
|
-
);
|
|
79
|
-
|
|
80
|
-
expect(getLatestVersion(tmpDir)).toBe('1.0.0');
|
|
81
|
-
});
|
|
82
51
|
});
|
|
83
52
|
|
|
84
53
|
describe('getInstalledVersion', () => {
|
|
@@ -117,7 +86,7 @@ describe('checkForUpdate', () => {
|
|
|
117
86
|
|
|
118
87
|
const hint = checkForUpdate(tmpDir);
|
|
119
88
|
expect(hint).toContain('0.0.8');
|
|
120
|
-
expect(hint).toContain('astryx upgrade --
|
|
89
|
+
expect(hint).toContain('astryx upgrade --from <old-version> --apply');
|
|
121
90
|
expect(hint).toContain('FYI');
|
|
122
91
|
});
|
|
123
92
|
|
|
@@ -140,37 +109,6 @@ describe('checkForUpdate', () => {
|
|
|
140
109
|
expect(checkForUpdate(tmpDir)).toBeNull();
|
|
141
110
|
});
|
|
142
111
|
|
|
143
|
-
it('sets env var for subsequent calls', () => {
|
|
144
|
-
const versionFilePath = path.join(tmpDir, 'LATEST_VERSION');
|
|
145
|
-
fs.writeFileSync(versionFilePath, '0.0.8\n');
|
|
146
|
-
fs.writeFileSync(
|
|
147
|
-
path.join(tmpDir, 'package.json'),
|
|
148
|
-
JSON.stringify({
|
|
149
|
-
dependencies: {'@astryxdesign/core': '^0.0.7'},
|
|
150
|
-
astryx: {versionFile: './LATEST_VERSION'},
|
|
151
|
-
}),
|
|
152
|
-
);
|
|
153
|
-
|
|
154
|
-
checkForUpdate(tmpDir);
|
|
155
|
-
expect(process.env.ASTRYX_LATEST_VERSION).toBe('0.0.8');
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
it('reads from versionFile and produces hint', () => {
|
|
159
|
-
const versionFilePath = path.join(tmpDir, 'LATEST_VERSION');
|
|
160
|
-
fs.writeFileSync(versionFilePath, '0.0.9\n');
|
|
161
|
-
fs.writeFileSync(
|
|
162
|
-
path.join(tmpDir, 'package.json'),
|
|
163
|
-
JSON.stringify({
|
|
164
|
-
dependencies: {'@astryxdesign/core': '^0.0.7'},
|
|
165
|
-
astryx: {versionFile: './LATEST_VERSION'},
|
|
166
|
-
}),
|
|
167
|
-
);
|
|
168
|
-
|
|
169
|
-
const hint = checkForUpdate(tmpDir);
|
|
170
|
-
expect(hint).toContain('0.0.9');
|
|
171
|
-
expect(hint).toContain('FYI');
|
|
172
|
-
});
|
|
173
|
-
|
|
174
112
|
it('uses semver (not lexicographic) comparison for double-digit patches', () => {
|
|
175
113
|
// Regression: with string compare, '0.0.20' > '0.0.5' is false because
|
|
176
114
|
// '2' < '5' lexicographically. Users on 0.0.5 would never be told that
|
|
@@ -5,18 +5,10 @@
|
|
|
5
5
|
import {AppShell} from '@astryxdesign/core/AppShell';
|
|
6
6
|
import {VStack} from '@astryxdesign/core/Stack';
|
|
7
7
|
import {Heading, Text} from '@astryxdesign/core/Text';
|
|
8
|
-
import stylex from '@stylexjs/stylex';
|
|
9
|
-
|
|
10
|
-
const styles = stylex.create({
|
|
11
|
-
fit: {
|
|
12
|
-
height: '100%',
|
|
13
|
-
minHeight: 0,
|
|
14
|
-
},
|
|
15
|
-
});
|
|
16
8
|
|
|
17
9
|
export default function AppShellContentOnly() {
|
|
18
10
|
return (
|
|
19
|
-
<AppShell contentPadding={6}
|
|
11
|
+
<AppShell contentPadding={6} style={{height: '100%', minHeight: 0}}>
|
|
20
12
|
<VStack gap={4}>
|
|
21
13
|
<Heading level={3}>Page Content</Heading>
|
|
22
14
|
<Text type="body">
|
|
@@ -19,21 +19,12 @@ import {
|
|
|
19
19
|
} from '@heroicons/react/24/outline';
|
|
20
20
|
import {HomeIcon} from '@heroicons/react/24/solid';
|
|
21
21
|
import {CubeIcon} from '@heroicons/react/24/outline';
|
|
22
|
-
import stylex from '@stylexjs/stylex';
|
|
23
|
-
|
|
24
|
-
const styles = stylex.create({
|
|
25
|
-
fit: {
|
|
26
|
-
height: '100%',
|
|
27
|
-
minHeight: 0,
|
|
28
|
-
width: '100%',
|
|
29
|
-
},
|
|
30
|
-
});
|
|
31
22
|
|
|
32
23
|
export default function AppShellShowcase() {
|
|
33
24
|
return (
|
|
34
25
|
<AppShell
|
|
35
26
|
contentPadding={6}
|
|
36
|
-
|
|
27
|
+
style={{height: '100%', minHeight: 0, width: '100%'}}
|
|
37
28
|
sideNav={
|
|
38
29
|
<SideNav
|
|
39
30
|
header={
|
|
@@ -20,20 +20,12 @@ import {
|
|
|
20
20
|
} from '@heroicons/react/24/outline';
|
|
21
21
|
import {HomeIcon} from '@heroicons/react/24/solid';
|
|
22
22
|
import {CubeIcon} from '@heroicons/react/24/outline';
|
|
23
|
-
import stylex from '@stylexjs/stylex';
|
|
24
|
-
|
|
25
|
-
const styles = stylex.create({
|
|
26
|
-
fit: {
|
|
27
|
-
height: '100%',
|
|
28
|
-
minHeight: 0,
|
|
29
|
-
},
|
|
30
|
-
});
|
|
31
23
|
|
|
32
24
|
export default function AppShellSideNavOnly() {
|
|
33
25
|
return (
|
|
34
26
|
<AppShell
|
|
35
27
|
contentPadding={6}
|
|
36
|
-
|
|
28
|
+
style={{height: '100%', minHeight: 0}}
|
|
37
29
|
sideNav={
|
|
38
30
|
<SideNav
|
|
39
31
|
header={
|
|
@@ -8,20 +8,12 @@ import {Heading, Text} from '@astryxdesign/core/Text';
|
|
|
8
8
|
import {TopNav, TopNavHeading, TopNavItem} from '@astryxdesign/core/TopNav';
|
|
9
9
|
import {NavIcon} from '@astryxdesign/core/NavIcon';
|
|
10
10
|
import {CubeIcon} from '@heroicons/react/24/outline';
|
|
11
|
-
import stylex from '@stylexjs/stylex';
|
|
12
|
-
|
|
13
|
-
const styles = stylex.create({
|
|
14
|
-
fit: {
|
|
15
|
-
height: '100%',
|
|
16
|
-
minHeight: 0,
|
|
17
|
-
},
|
|
18
|
-
});
|
|
19
11
|
|
|
20
12
|
export default function AppShellTopNavOnly() {
|
|
21
13
|
return (
|
|
22
14
|
<AppShell
|
|
23
15
|
contentPadding={6}
|
|
24
|
-
|
|
16
|
+
style={{height: '100%', minHeight: 0}}
|
|
25
17
|
topNav={
|
|
26
18
|
<TopNav
|
|
27
19
|
label="Main navigation"
|
|
@@ -16,20 +16,12 @@ import {
|
|
|
16
16
|
} from '@heroicons/react/24/outline';
|
|
17
17
|
import {HomeIcon} from '@heroicons/react/24/solid';
|
|
18
18
|
import {CubeIcon} from '@heroicons/react/24/outline';
|
|
19
|
-
import stylex from '@stylexjs/stylex';
|
|
20
|
-
|
|
21
|
-
const styles = stylex.create({
|
|
22
|
-
fit: {
|
|
23
|
-
height: '100%',
|
|
24
|
-
minHeight: 0,
|
|
25
|
-
},
|
|
26
|
-
});
|
|
27
19
|
|
|
28
20
|
export default function AppShellTopNavWithSideNav() {
|
|
29
21
|
return (
|
|
30
22
|
<AppShell
|
|
31
23
|
contentPadding={6}
|
|
32
|
-
|
|
24
|
+
style={{height: '100%', minHeight: 0}}
|
|
33
25
|
topNav={
|
|
34
26
|
<TopNav
|
|
35
27
|
label="Main navigation"
|
|
@@ -17,20 +17,12 @@ import {
|
|
|
17
17
|
} from '@heroicons/react/24/outline';
|
|
18
18
|
import {HomeIcon} from '@heroicons/react/24/solid';
|
|
19
19
|
import {CubeIcon} from '@heroicons/react/24/outline';
|
|
20
|
-
import stylex from '@stylexjs/stylex';
|
|
21
|
-
|
|
22
|
-
const styles = stylex.create({
|
|
23
|
-
fit: {
|
|
24
|
-
height: '100%',
|
|
25
|
-
minHeight: 0,
|
|
26
|
-
},
|
|
27
|
-
});
|
|
28
20
|
|
|
29
21
|
export default function AppShellWithBanner() {
|
|
30
22
|
return (
|
|
31
23
|
<AppShell
|
|
32
24
|
contentPadding={6}
|
|
33
|
-
|
|
25
|
+
style={{height: '100%', minHeight: 0}}
|
|
34
26
|
topNav={
|
|
35
27
|
<TopNav
|
|
36
28
|
label="Main navigation"
|
|
@@ -2,26 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
'use client';
|
|
4
4
|
|
|
5
|
-
import * as stylex from '@stylexjs/stylex';
|
|
6
5
|
import {AspectRatio} from '@astryxdesign/core/AspectRatio';
|
|
7
6
|
import {HStack, VStack} from '@astryxdesign/core/Layout';
|
|
8
7
|
import {Text} from '@astryxdesign/core/Text';
|
|
9
|
-
import {radiusVars} from '@astryxdesign/core/theme/tokens.stylex';
|
|
10
|
-
|
|
11
|
-
const s = stylex.create({
|
|
12
|
-
// Fixed height with auto width lets the aspect ratio drive the width,
|
|
13
|
-
// so all three containers share the same height but differ in width.
|
|
14
|
-
ratioBox: {
|
|
15
|
-
height: 120,
|
|
16
|
-
width: 'auto',
|
|
17
|
-
borderRadius: radiusVars['--radius-container'],
|
|
18
|
-
},
|
|
19
|
-
image: {
|
|
20
|
-
width: '100%',
|
|
21
|
-
height: '100%',
|
|
22
|
-
objectFit: 'cover',
|
|
23
|
-
},
|
|
24
|
-
});
|
|
25
8
|
|
|
26
9
|
const items = [
|
|
27
10
|
{
|
|
@@ -49,8 +32,18 @@ export default function AspectRatioShowcase() {
|
|
|
49
32
|
<HStack gap={4} vAlign="start">
|
|
50
33
|
{items.map(({ratio, label, src, alt}) => (
|
|
51
34
|
<VStack key={label} gap={2} hAlign="center">
|
|
52
|
-
<AspectRatio
|
|
53
|
-
|
|
35
|
+
<AspectRatio
|
|
36
|
+
ratio={ratio}
|
|
37
|
+
style={{
|
|
38
|
+
height: 120,
|
|
39
|
+
width: 'auto',
|
|
40
|
+
borderRadius: 'var(--radius-container)',
|
|
41
|
+
}}>
|
|
42
|
+
<img
|
|
43
|
+
src={src}
|
|
44
|
+
alt={alt}
|
|
45
|
+
style={{width: '100%', height: '100%', objectFit: 'cover'}}
|
|
46
|
+
/>
|
|
54
47
|
</AspectRatio>
|
|
55
48
|
<Text type="supporting" color="secondary">
|
|
56
49
|
{label}
|
|
@@ -4,17 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
import {Banner} from '@astryxdesign/core/Banner';
|
|
6
6
|
import {Stack} from '@astryxdesign/core/Layout';
|
|
7
|
-
import * as stylex from '@stylexjs/stylex';
|
|
8
|
-
|
|
9
|
-
const styles = stylex.create({
|
|
10
|
-
root: {
|
|
11
|
-
maxWidth: 800,
|
|
12
|
-
},
|
|
13
|
-
});
|
|
14
7
|
|
|
15
8
|
export default function BannerShowcase() {
|
|
16
9
|
return (
|
|
17
|
-
<Stack direction="vertical" gap={3}
|
|
10
|
+
<Stack direction="vertical" gap={3} style={{maxWidth: 800}}>
|
|
18
11
|
<Banner status="info" title="A new software update is available." />
|
|
19
12
|
<Banner status="success" title="Your changes have been saved." />
|
|
20
13
|
<Banner
|
|
@@ -4,17 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
import {Blockquote} from '@astryxdesign/core/Blockquote';
|
|
6
6
|
import {Stack} from '@astryxdesign/core/Layout';
|
|
7
|
-
import * as stylex from '@stylexjs/stylex';
|
|
8
|
-
|
|
9
|
-
const styles = stylex.create({
|
|
10
|
-
root: {
|
|
11
|
-
width: 500,
|
|
12
|
-
},
|
|
13
|
-
});
|
|
14
7
|
|
|
15
8
|
export default function BlockquoteShowcase() {
|
|
16
9
|
return (
|
|
17
|
-
<Stack direction="vertical" gap={4}
|
|
10
|
+
<Stack direction="vertical" gap={4} style={{width: 500}}>
|
|
18
11
|
<Blockquote>
|
|
19
12
|
Design is not just what it looks like and feels like. Design is how it
|
|
20
13
|
works.
|
|
@@ -6,16 +6,6 @@ import {Carousel} from '@astryxdesign/core/Carousel';
|
|
|
6
6
|
import {Card} from '@astryxdesign/core/Card';
|
|
7
7
|
import {Stack} from '@astryxdesign/core/Layout';
|
|
8
8
|
import {Text, Heading} from '@astryxdesign/core/Text';
|
|
9
|
-
import * as stylex from '@stylexjs/stylex';
|
|
10
|
-
|
|
11
|
-
const styles = stylex.create({
|
|
12
|
-
root: {
|
|
13
|
-
maxWidth: 500,
|
|
14
|
-
},
|
|
15
|
-
card: {
|
|
16
|
-
minWidth: 200,
|
|
17
|
-
},
|
|
18
|
-
});
|
|
19
9
|
|
|
20
10
|
const ITEMS = [
|
|
21
11
|
{title: 'Design', body: 'Create wireframes and prototypes.'},
|
|
@@ -32,9 +22,9 @@ export default function CarouselShowcase() {
|
|
|
32
22
|
hasSnap
|
|
33
23
|
hasButtons={false}
|
|
34
24
|
aria-label="Workflow steps"
|
|
35
|
-
|
|
25
|
+
style={{maxWidth: 500}}>
|
|
36
26
|
{ITEMS.map(item => (
|
|
37
|
-
<Card key={item.title} padding={3}
|
|
27
|
+
<Card key={item.title} padding={3} style={{minWidth: 200}}>
|
|
38
28
|
<Stack direction="vertical" gap={1}>
|
|
39
29
|
<Heading level={5}>{item.title}</Heading>
|
|
40
30
|
<Text type="supporting" color="secondary">
|
|
@@ -8,15 +8,12 @@ import {Button} from '@astryxdesign/core/Button';
|
|
|
8
8
|
import {Icon} from '@astryxdesign/core/Icon';
|
|
9
9
|
import {Stack} from '@astryxdesign/core/Layout';
|
|
10
10
|
import {PaperClipIcon} from '@heroicons/react/24/outline';
|
|
11
|
-
import
|
|
12
|
-
import {colorVars, borderVars, radiusVars} from '@astryxdesign/core/theme/tokens.stylex';
|
|
11
|
+
import type {CSSProperties} from 'react';
|
|
13
12
|
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
},
|
|
19
|
-
});
|
|
13
|
+
const drawerBorder: CSSProperties = {
|
|
14
|
+
border: 'var(--border-width) solid var(--color-border)',
|
|
15
|
+
borderRadius: 'var(--radius-chat)',
|
|
16
|
+
};
|
|
20
17
|
|
|
21
18
|
export default function ChatComposerDrawerShowcase() {
|
|
22
19
|
return (
|
|
@@ -27,7 +24,7 @@ export default function ChatComposerDrawerShowcase() {
|
|
|
27
24
|
<ChatComposerDrawer
|
|
28
25
|
count={4}
|
|
29
26
|
label="Attachments"
|
|
30
|
-
|
|
27
|
+
style={drawerBorder}>
|
|
31
28
|
<Token label="design-spec.pdf" onRemove={() => {}} />
|
|
32
29
|
<Token label="api-schema.json" onRemove={() => {}} />
|
|
33
30
|
<Token label="screenshot.png" onRemove={() => {}} />
|
|
@@ -11,21 +11,19 @@ import {
|
|
|
11
11
|
ChatComposer,
|
|
12
12
|
} from '@astryxdesign/core/Chat';
|
|
13
13
|
import {Markdown} from '@astryxdesign/core/Markdown';
|
|
14
|
-
import
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
});
|
|
14
|
+
import type {CSSProperties} from 'react';
|
|
15
|
+
|
|
16
|
+
const panel: CSSProperties = {
|
|
17
|
+
width: 450,
|
|
18
|
+
height: 600,
|
|
19
|
+
borderRadius: 8,
|
|
20
|
+
overflow: 'hidden',
|
|
21
|
+
border: '1px solid var(--color-border)',
|
|
22
|
+
};
|
|
25
23
|
|
|
26
24
|
export default function ChatLayoutPanelChat() {
|
|
27
25
|
return (
|
|
28
|
-
<div {
|
|
26
|
+
<div style={panel}>
|
|
29
27
|
<ChatLayout
|
|
30
28
|
composer={
|
|
31
29
|
<ChatComposer onSubmit={() => {}} placeholder="Ask something..." />
|
|
@@ -12,14 +12,6 @@ import {Text} from '@astryxdesign/core/Text';
|
|
|
12
12
|
import {Avatar} from '@astryxdesign/core/Avatar';
|
|
13
13
|
import {Divider} from '@astryxdesign/core/Divider';
|
|
14
14
|
import {Fragment} from 'react';
|
|
15
|
-
import * as stylex from '@stylexjs/stylex';
|
|
16
|
-
|
|
17
|
-
const styles = stylex.create({
|
|
18
|
-
section: {
|
|
19
|
-
flex: 1,
|
|
20
|
-
minHeight: 0,
|
|
21
|
-
},
|
|
22
|
-
});
|
|
23
15
|
|
|
24
16
|
const DENSITIES = ['compact', 'balanced', 'spacious'] as const;
|
|
25
17
|
|
|
@@ -39,7 +31,7 @@ export default function ChatMessageListDensity() {
|
|
|
39
31
|
<Text type="supporting" color="secondary">
|
|
40
32
|
{density.charAt(0).toUpperCase() + density.slice(1)}
|
|
41
33
|
</Text>
|
|
42
|
-
<VStack
|
|
34
|
+
<VStack style={{flex: 1, minHeight: 0}}>
|
|
43
35
|
<ChatMessageList density={density}>
|
|
44
36
|
<ChatMessage sender="user">
|
|
45
37
|
<ChatMessageBubble>
|
|
@@ -15,18 +15,10 @@ import {Markdown} from '@astryxdesign/core/Markdown';
|
|
|
15
15
|
import {CodeBlock} from '@astryxdesign/core/CodeBlock';
|
|
16
16
|
import {Timestamp} from '@astryxdesign/core/Timestamp';
|
|
17
17
|
import {Token} from '@astryxdesign/core/Token';
|
|
18
|
-
import * as stylex from '@stylexjs/stylex';
|
|
19
|
-
|
|
20
|
-
const styles = stylex.create({
|
|
21
|
-
container: {
|
|
22
|
-
maxWidth: 500,
|
|
23
|
-
justifyContent: 'center',
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
18
|
|
|
27
19
|
export default function ChatMessageListFullFeatured() {
|
|
28
20
|
return (
|
|
29
|
-
<VStack
|
|
21
|
+
<VStack style={{maxWidth: 500, justifyContent: 'center'}}>
|
|
30
22
|
<ChatMessageList>
|
|
31
23
|
<ChatSystemMessage variant="divider">Today</ChatSystemMessage>
|
|
32
24
|
|
|
@@ -11,18 +11,10 @@ import {
|
|
|
11
11
|
} from '@astryxdesign/core/Chat';
|
|
12
12
|
import {VStack} from '@astryxdesign/core/Layout';
|
|
13
13
|
import {Timestamp} from '@astryxdesign/core/Timestamp';
|
|
14
|
-
import * as stylex from '@stylexjs/stylex';
|
|
15
|
-
|
|
16
|
-
const styles = stylex.create({
|
|
17
|
-
container: {
|
|
18
|
-
maxWidth: 600,
|
|
19
|
-
height: '100%',
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
14
|
|
|
23
15
|
export default function ChatMessageListShowcase() {
|
|
24
16
|
return (
|
|
25
|
-
<VStack
|
|
17
|
+
<VStack style={{maxWidth: 600, height: '100%'}}>
|
|
26
18
|
<ChatMessageList density="balanced">
|
|
27
19
|
<ChatSystemMessage variant="divider">
|
|
28
20
|
March 15, 2026
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
'use client';
|
|
4
4
|
|
|
5
|
-
import * as stylex from '@stylexjs/stylex';
|
|
6
5
|
import {
|
|
7
6
|
ChatMessageList,
|
|
8
7
|
ChatMessage,
|
|
@@ -21,15 +20,9 @@ import {
|
|
|
21
20
|
HandThumbDownIcon,
|
|
22
21
|
} from '@heroicons/react/24/outline';
|
|
23
22
|
|
|
24
|
-
const styles = stylex.create({
|
|
25
|
-
container: {
|
|
26
|
-
maxWidth: 600,
|
|
27
|
-
},
|
|
28
|
-
});
|
|
29
|
-
|
|
30
23
|
export default function ChatMessageMetadataShowcase() {
|
|
31
24
|
return (
|
|
32
|
-
<VStack
|
|
25
|
+
<VStack style={{maxWidth: 600}}>
|
|
33
26
|
<ChatMessageList>
|
|
34
27
|
<ChatMessage sender="assistant">
|
|
35
28
|
<ChatMessageBubble
|
|
@@ -2,19 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
'use client';
|
|
4
4
|
|
|
5
|
-
import * as stylex from '@stylexjs/stylex';
|
|
6
5
|
import {ChatComposer} from '@astryxdesign/core/Chat';
|
|
7
6
|
import {Stack} from '@astryxdesign/core/Layout';
|
|
8
7
|
|
|
9
|
-
const styles = stylex.create({
|
|
10
|
-
root: {
|
|
11
|
-
maxWidth: 450,
|
|
12
|
-
},
|
|
13
|
-
});
|
|
14
|
-
|
|
15
8
|
export default function ChatSendButtonInComposer() {
|
|
16
9
|
return (
|
|
17
|
-
<Stack direction="vertical" width="100%"
|
|
10
|
+
<Stack direction="vertical" width="100%" style={{maxWidth: 450}}>
|
|
18
11
|
<ChatComposer
|
|
19
12
|
onSubmit={() => {}}
|
|
20
13
|
value="Hello, how can you help?"
|
|
@@ -25,12 +25,12 @@ export default function CitationInlineText() {
|
|
|
25
25
|
.
|
|
26
26
|
</Text>
|
|
27
27
|
<Text type="body">
|
|
28
|
-
|
|
28
|
+
TypeScript adds static types to JavaScript for safer refactoring
|
|
29
29
|
<Citation
|
|
30
30
|
source={{
|
|
31
|
-
title: '
|
|
32
|
-
url: 'https://
|
|
33
|
-
icon: 'https://
|
|
31
|
+
title: 'TypeScript Documentation',
|
|
32
|
+
url: 'https://www.typescriptlang.org',
|
|
33
|
+
icon: 'https://www.typescriptlang.org/favicon-32x32.png',
|
|
34
34
|
}}
|
|
35
35
|
number={3}
|
|
36
36
|
variant="label"
|
|
@@ -4,17 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
import {Code} from '@astryxdesign/core/CodeBlock';
|
|
6
6
|
import {Text} from '@astryxdesign/core/Text';
|
|
7
|
-
import * as stylex from '@stylexjs/stylex';
|
|
8
|
-
|
|
9
|
-
const styles = stylex.create({
|
|
10
|
-
root: {
|
|
11
|
-
maxWidth: 400,
|
|
12
|
-
},
|
|
13
|
-
});
|
|
14
7
|
|
|
15
8
|
export default function CodeInlineInParagraph() {
|
|
16
9
|
return (
|
|
17
|
-
<Text type="body"
|
|
10
|
+
<Text type="body" style={{maxWidth: 400}}>Use <Code>useState</Code>for local state and{' '}
|
|
18
11
|
<Code>useEffect</Code>for side effects. If you need shared state
|
|
19
12
|
across components, consider <Code>useContext</Code>or a state
|
|
20
13
|
management library.
|
|
@@ -0,0 +1,15 @@
|
|
|
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: 'CommandPaletteEmpty',
|
|
7
|
+
name: 'CommandPaletteEmpty',
|
|
8
|
+
displayName: 'Command Palette Empty',
|
|
9
|
+
description:
|
|
10
|
+
'Command palette empty state shown when no commands are available.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
isShowcase: true,
|
|
13
|
+
aspectRatio: 4 / 3,
|
|
14
|
+
componentsUsed: ['CommandPalette', 'CommandPaletteEmpty', 'Text'],
|
|
15
|
+
};
|