@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.
Files changed (176) hide show
  1. package/CHANGELOG.md +68 -0
  2. package/README.md +117 -75
  3. package/bin/astryx.mjs +22 -7
  4. package/docs/getting-started.doc.mjs +11 -11
  5. package/docs/icons.doc.mjs +1 -1
  6. package/docs/migration.doc.mjs +2 -2
  7. package/docs/shape.doc.mjs +1 -1
  8. package/docs/styling.doc.mjs +3 -4
  9. package/docs/theme.doc.dense.mjs +2 -2
  10. package/docs/theme.doc.mjs +14 -0
  11. package/docs/theme.doc.zh.mjs +2 -2
  12. package/docs/working-with-ai.doc.mjs +4 -4
  13. package/package.json +20 -9
  14. package/src/api/discover.mjs +78 -26
  15. package/src/api/doctor.mjs +3 -3
  16. package/src/api/layout.mjs +301 -0
  17. package/src/api/layout.test.mjs +238 -0
  18. package/src/api/search.mjs +207 -13
  19. package/src/api/template.mjs +193 -51
  20. package/src/api/template.test.mjs +2 -0
  21. package/src/codemods/__tests__/registry.test.mjs +1 -0
  22. package/src/codemods/registry.mjs +1 -0
  23. package/src/codemods/runner.mjs +105 -51
  24. package/src/codemods/transforms/v0.1.0/__tests__/migrate-xds-config-surfaces.test.mjs +116 -0
  25. package/src/codemods/transforms/v0.1.0/__tests__/migrate-xds-module-specifiers.test.mjs +51 -0
  26. package/src/codemods/transforms/v0.1.0/index.mjs +28 -0
  27. package/src/codemods/transforms/v0.1.0/migrate-xds-config-surfaces.mjs +230 -0
  28. package/src/codemods/transforms/v0.1.0/migrate-xds-module-specifiers.mjs +84 -0
  29. package/src/commands/agent-docs.mjs +119 -66
  30. package/src/commands/agent-docs.path-safety.test.mjs +1 -1
  31. package/src/commands/agent-docs.test.mjs +87 -31
  32. package/src/commands/build-theme.import-path.test.mjs +1 -1
  33. package/src/commands/build-theme.path-safety.test.mjs +1 -1
  34. package/src/commands/build-theme.prose.test.mjs +1 -1
  35. package/src/commands/build.mjs +196 -0
  36. package/src/commands/component-package.test.mjs +1 -1
  37. package/src/commands/component.test.mjs +1 -1
  38. package/src/commands/docs.test.mjs +1 -1
  39. package/src/commands/doctor.test.mjs +1 -1
  40. package/src/commands/external-showcase.test.mjs +1 -1
  41. package/src/commands/gap-report.mjs +17 -9
  42. package/src/commands/gap-report.test.mjs +21 -16
  43. package/src/commands/init.mjs +43 -9
  44. package/src/commands/init.next-steps.test.mjs +46 -0
  45. package/src/commands/interactive-guard.test.mjs +1 -1
  46. package/src/commands/json-contract.test.mjs +10 -3
  47. package/src/commands/layout.mjs +139 -0
  48. package/src/commands/swizzle-gap-safety.test.mjs +1 -1
  49. package/src/commands/swizzle.mjs +51 -23
  50. package/src/commands/swizzle.path-safety.test.mjs +1 -1
  51. package/src/commands/template.path-safety.test.mjs +1 -1
  52. package/src/commands/template.test.mjs +1 -1
  53. package/src/commands/upgrade.mjs +292 -177
  54. package/src/commands/upgrade.test.mjs +41 -27
  55. package/src/config.mjs +31 -0
  56. package/src/config.test.mjs +24 -0
  57. package/src/index.mjs +5 -0
  58. package/src/lib/config-schema.mjs +119 -0
  59. package/src/lib/config.mjs +45 -6
  60. package/src/lib/config.test.mjs +91 -0
  61. package/src/lib/error-codes.mjs +11 -0
  62. package/src/lib/integrations.mjs +155 -0
  63. package/src/lib/integrations.test.mjs +154 -0
  64. package/src/lib/levenshtein.mjs +29 -0
  65. package/src/lib/manifest.mjs +6 -0
  66. package/src/lib/package-scanner.mjs +31 -7
  67. package/src/lib/string-utils.mjs +5 -14
  68. package/src/lib/xle/browser.d.ts +91 -0
  69. package/src/lib/xle/browser.mjs +120 -0
  70. package/src/lib/xle/expand.mjs +622 -0
  71. package/src/lib/xle/parse.mjs +581 -0
  72. package/src/lib/xle/print.mjs +174 -0
  73. package/src/lib/xle/registry-core.mjs +170 -0
  74. package/src/lib/xle/registry.mjs +237 -0
  75. package/src/lib/xle/splice.mjs +137 -0
  76. package/src/lib/xle/validate.mjs +356 -0
  77. package/src/lib/xle/xle.test.mjs +333 -0
  78. package/src/types/config.d.ts +99 -0
  79. package/src/types/error-codes.d.ts +1 -0
  80. package/src/utils/github.mjs +12 -27
  81. package/src/utils/interactive.mjs +1 -1
  82. package/src/utils/interactive.test.mjs +2 -0
  83. package/src/utils/package-manager.mjs +1 -1
  84. package/src/utils/package-manager.test.mjs +1 -1
  85. package/src/utils/path-safety.test.mjs +1 -1
  86. package/src/utils/paths.test.mjs +8 -8
  87. package/src/utils/update-check.mjs +4 -26
  88. package/src/utils/update-check.test.mjs +2 -64
  89. package/templates/blocks/components/AppShell/AppShellContentOnly.tsx +1 -9
  90. package/templates/blocks/components/AppShell/AppShellShowcase.tsx +1 -10
  91. package/templates/blocks/components/AppShell/AppShellSideNavOnly.tsx +1 -9
  92. package/templates/blocks/components/AppShell/AppShellTopNavOnly.tsx +1 -9
  93. package/templates/blocks/components/AppShell/AppShellTopNavWithSideNav.tsx +1 -9
  94. package/templates/blocks/components/AppShell/AppShellWithBanner.tsx +1 -9
  95. package/templates/blocks/components/AspectRatio/AspectRatioShowcase.tsx +12 -19
  96. package/templates/blocks/components/Banner/BannerShowcase.tsx +1 -8
  97. package/templates/blocks/components/Blockquote/BlockquoteShowcase.tsx +1 -8
  98. package/templates/blocks/components/Carousel/CarouselShowcase.tsx +2 -12
  99. package/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerShowcase.tsx +6 -9
  100. package/templates/blocks/components/ChatLayout/ChatLayoutPanelChat.tsx +10 -12
  101. package/templates/blocks/components/ChatMessageList/ChatMessageListDensity.tsx +1 -9
  102. package/templates/blocks/components/ChatMessageList/ChatMessageListFullFeatured.tsx +1 -9
  103. package/templates/blocks/components/ChatMessageList/ChatMessageListShowcase.tsx +1 -9
  104. package/templates/blocks/components/ChatMessageMetadata/ChatMessageMetadataShowcase.tsx +1 -8
  105. package/templates/blocks/components/ChatSendButton/ChatSendButtonInComposer.tsx +1 -8
  106. package/templates/blocks/components/Citation/CitationInlineText.tsx +4 -4
  107. package/templates/blocks/components/Code/CodeInlineInParagraph.tsx +1 -8
  108. package/templates/blocks/components/CodeBlock/CodeBlockBashCommand.tsx +1 -1
  109. package/templates/blocks/components/CodeBlock/CodeBlockJSONConfig.tsx +1 -1
  110. package/templates/blocks/components/CommandPaletteEmpty/CommandPaletteEmptyShowcase.doc.mjs +15 -0
  111. package/templates/blocks/components/CommandPaletteEmpty/CommandPaletteEmptyShowcase.tsx +26 -0
  112. package/templates/blocks/components/CommandPaletteItem/CommandPaletteItemShowcase.tsx +9 -12
  113. package/templates/blocks/components/ContextMenu/ContextMenuShowcase.tsx +13 -15
  114. package/templates/blocks/components/DateInput/DateInputDateRange.doc.mjs +2 -2
  115. package/templates/blocks/components/Divider/DividerShowcase.tsx +1 -8
  116. package/templates/blocks/components/Divider/DividerVertical.tsx +7 -9
  117. package/templates/blocks/components/Field/FieldShowcase.tsx +1 -8
  118. package/templates/blocks/components/FormLayout/FormLayoutHorizontal.tsx +1 -6
  119. package/templates/blocks/components/Grid/GridResponsiveAutoFit.tsx +1 -9
  120. package/templates/blocks/components/HoverCard/HoverCardInlineTextHoverCard.tsx +4 -6
  121. package/templates/blocks/components/HoverCard/HoverCardInteractiveContent.tsx +1 -6
  122. package/templates/blocks/components/HoverCard/HoverCardProfileHoverCard.tsx +2 -8
  123. package/templates/blocks/components/HoverCard/HoverCardShowcase.tsx +1 -8
  124. package/templates/blocks/components/OverflowList/OverflowListOverflowBadges.tsx +8 -11
  125. package/templates/blocks/components/OverflowList/OverflowListOverflowDropdownActions.tsx +9 -12
  126. package/templates/blocks/components/Overlay/OverlayBottomStrip.tsx +4 -17
  127. package/templates/blocks/components/Overlay/OverlayHoverReveal.tsx +15 -16
  128. package/templates/blocks/components/Overlay/OverlayShowcase.tsx +5 -21
  129. package/templates/blocks/components/Pagination/PaginationDotsCarousel.tsx +2 -14
  130. package/templates/blocks/components/Pagination/PaginationPageSize.tsx +12 -14
  131. package/templates/blocks/components/Pagination/PaginationVariants.tsx +1 -8
  132. package/templates/blocks/components/Pagination/PaginationWithTable.tsx +2 -14
  133. package/templates/blocks/components/Slider/SliderShowcase.tsx +10 -1
  134. package/templates/blocks/components/ToggleButton/ToggleButtonGroup.doc.mjs +1 -1
  135. package/templates/blocks/components/Tokenizer/TokenizerClear.tsx +1 -6
  136. package/templates/blocks/components/Tokenizer/TokenizerCreatable.tsx +2 -7
  137. package/templates/blocks/components/Tokenizer/TokenizerEndContent.tsx +1 -6
  138. package/templates/blocks/components/Tokenizer/TokenizerIcon.tsx +1 -6
  139. package/templates/blocks/components/Tokenizer/TokenizerMaxEntries.tsx +1 -6
  140. package/templates/blocks/components/Tokenizer/TokenizerOverflow.tsx +2 -7
  141. package/templates/blocks/components/Tokenizer/TokenizerShowcase.tsx +1 -6
  142. package/templates/blocks/components/Tokenizer/TokenizerStates.tsx +4 -9
  143. package/templates/blocks/components/Toolbar/ToolbarCardHeader.tsx +1 -10
  144. package/templates/blocks/components/Toolbar/ToolbarSizes.tsx +1 -8
  145. package/templates/blocks/components/Toolbar/ToolbarTableFilter.tsx +1 -8
  146. package/templates/blocks/components/Toolbar/ToolbarThreeSlot.tsx +1 -10
  147. package/templates/blocks/components/Toolbar/ToolbarWithTabs.tsx +8 -11
  148. package/templates/pages/ai-chat/page.tsx +71 -64
  149. package/templates/pages/ai-chat-landing/page.tsx +8 -12
  150. package/templates/pages/centered-hero/page.tsx +13 -15
  151. package/templates/pages/classic-gallery/page.tsx +27 -34
  152. package/templates/pages/detail-page/page.tsx +18 -18
  153. package/templates/pages/documentation/page.tsx +42 -58
  154. package/templates/pages/documentation-design/page.tsx +82 -60
  155. package/templates/pages/documentation-technical/page.tsx +101 -60
  156. package/templates/pages/editor/page.tsx +42 -54
  157. package/templates/pages/file-explorer/page.tsx +13 -16
  158. package/templates/pages/form-two-column/page.tsx +13 -17
  159. package/templates/pages/gallery-hero/page.tsx +13 -15
  160. package/templates/pages/ide/page.tsx +188 -264
  161. package/templates/pages/library/page.tsx +16 -23
  162. package/templates/pages/login/page.tsx +14 -18
  163. package/templates/pages/login-card/page.tsx +14 -18
  164. package/templates/pages/login-split/page.tsx +50 -48
  165. package/templates/pages/login-sso/page.tsx +9 -13
  166. package/templates/pages/mixed-gallery/page.tsx +51 -45
  167. package/templates/pages/payment-form/page.tsx +56 -70
  168. package/templates/pages/product-detail/page.tsx +27 -33
  169. package/templates/pages/product-gallery/page.tsx +7 -13
  170. package/templates/pages/settings-dialog/page.tsx +35 -43
  171. package/templates/pages/settings-sidebar/page.tsx +39 -47
  172. package/templates/pages/side-gallery/page.tsx +6 -9
  173. package/templates/pages/table-grouped/page.tsx +11 -15
  174. package/templates/pages/theme-showcase/page.tsx +33 -37
  175. package/templates/blocks/components/MoreMenu/MoreMenuInToolbar.doc.mjs +0 -14
  176. package/templates/blocks/components/MoreMenu/MoreMenuInToolbar.tsx +0 -67
@@ -2,9 +2,7 @@
2
2
 
3
3
  'use client';
4
4
 
5
- import {useRef, useState} from 'react';
6
- import * as stylex from '@stylexjs/stylex';
7
- import {spacingVars} from '@astryxdesign/core/theme/tokens.stylex';
5
+ import {useRef, useState, type CSSProperties} from 'react';
8
6
 
9
7
  import {
10
8
  HStack,
@@ -55,56 +53,66 @@ import {
55
53
  // Below this width the split-pane collapses to a single chat column. Shared by
56
54
  // the CSS container query and the JS check in openArtifact so they can't drift.
57
55
  const MOBILE_MAX_WIDTH = 767;
58
- const MOBILE = `@container artifact (max-width: ${MOBILE_MAX_WIDTH}px)`;
59
-
60
- const styles = stylex.create({
61
- root: {
62
- height: '100dvh',
63
- width: '100%',
64
- containerType: 'inline-size',
65
- containerName: 'artifact',
66
- },
67
- chatColumn: {
68
- flex: 1,
69
- width: '100%',
70
- minWidth: 0,
71
- height: '100%',
72
- },
73
- chatLayout: {
74
- flex: 1,
75
- minHeight: 0,
76
- },
77
- artifactPanel: {
78
- overflow: 'hidden',
79
- flexDirection: 'column',
80
- display: {default: 'flex', [MOBILE]: 'none'},
81
- },
82
- resizeHandle: {
83
- display: {default: 'flex', [MOBILE]: 'none'},
84
- },
85
- artifactCard: {
86
- marginBlockStart: spacingVars['--spacing-2'],
87
- },
88
- artifactScroll: {
89
- flex: 1,
90
- overflowY: 'auto',
91
- },
92
- articleBody: {
93
- maxWidth: 720,
94
- marginInline: 'auto',
95
- },
96
- });
97
-
98
- // Runtime width for the artifact panel; the MOBILE override forces full width.
99
- const dynamicStyles = stylex.create({
100
- artifactPanelWidth: (size: number | string) => ({
101
- width: {
102
- default: typeof size === 'number' ? `${size}px` : size,
103
- [MOBILE]: '100%',
104
- },
105
- flexShrink: {default: 0, [MOBILE]: 1},
106
- }),
107
- });
56
+
57
+ const root: CSSProperties = {
58
+ height: '100dvh',
59
+ width: '100%',
60
+ containerType: 'inline-size',
61
+ containerName: 'artifact',
62
+ };
63
+ const chatColumn: CSSProperties = {
64
+ flex: 1,
65
+ width: '100%',
66
+ minWidth: 0,
67
+ height: '100%',
68
+ };
69
+ const chatLayout: CSSProperties = {
70
+ flex: 1,
71
+ minHeight: 0,
72
+ };
73
+ const artifactCard: CSSProperties = {
74
+ marginBlockStart: 'var(--spacing-2)',
75
+ };
76
+ const artifactScroll: CSSProperties = {
77
+ flex: 1,
78
+ overflowY: 'auto',
79
+ };
80
+ const articleBody: CSSProperties = {
81
+ maxWidth: 720,
82
+ marginInline: 'auto',
83
+ };
84
+
85
+ // Runtime width for the artifact panel, passed in via the --artifact-panel-width
86
+ // custom property so the MOBILE container query can still override it to 100%
87
+ // (an inline `width` would beat the class rule). The container query lives in a
88
+ // plain <style> tag below so it needs NO CSS compiler.
89
+ const artifactPanelWidthVar = (size: number | string): CSSProperties =>
90
+ ({
91
+ '--artifact-panel-width': typeof size === 'number' ? `${size}px` : size,
92
+ }) as CSSProperties;
93
+
94
+ const AI_CHAT_CSS = `
95
+ .ai-chat-resize-handle {
96
+ display: flex;
97
+ }
98
+ .ai-chat-artifact-panel {
99
+ overflow: hidden;
100
+ display: flex;
101
+ flex-direction: column;
102
+ width: var(--artifact-panel-width);
103
+ flex-shrink: 0;
104
+ }
105
+ @container artifact (max-width: ${MOBILE_MAX_WIDTH}px) {
106
+ .ai-chat-resize-handle {
107
+ display: none;
108
+ }
109
+ .ai-chat-artifact-panel {
110
+ display: none;
111
+ width: 100%;
112
+ flex-shrink: 1;
113
+ }
114
+ }
115
+ `;
108
116
 
109
117
  // Artifact content
110
118
 
@@ -225,8 +233,8 @@ function MobileArtifactActions() {
225
233
  // Scrollable artifact body — the formatted document.
226
234
  function ArtifactBody() {
227
235
  return (
228
- <Section variant="transparent" xstyle={styles.artifactScroll}>
229
- <VStack gap={2} xstyle={styles.articleBody}>
236
+ <Section variant="transparent" style={artifactScroll}>
237
+ <VStack gap={2} style={articleBody}>
230
238
  <Heading level={1}>{ARTIFACT_TITLE}</Heading>
231
239
  <Markdown>{ARTIFACT_CONTENT}</Markdown>
232
240
  </VStack>
@@ -243,7 +251,7 @@ function ArtifactCard({onOpen}: {onOpen: () => void}) {
243
251
  variant="muted"
244
252
  padding={3}
245
253
  maxWidth={360}
246
- xstyle={styles.artifactCard}>
254
+ style={artifactCard}>
247
255
  <HStack gap={3} vAlign="center" width="100%">
248
256
  <Icon icon={DocumentTextIcon} size="md" color="secondary" />
249
257
  <StackItem size="fill">
@@ -288,17 +296,18 @@ export default function AIChatConversationTemplate() {
288
296
  };
289
297
 
290
298
  return (
291
- <VStack ref={rootRef} xstyle={styles.root}>
299
+ <VStack ref={rootRef} style={root}>
300
+ <style>{AI_CHAT_CSS}</style>
292
301
  <Layout
293
302
  height="fill"
294
303
  content={
295
304
  <LayoutContent padding={0}>
296
305
  <HStack height="100%">
297
306
  {/* Chat column — flexes to fill the space the artifact leaves */}
298
- <VStack xstyle={styles.chatColumn}>
307
+ <VStack style={chatColumn}>
299
308
  <ChatLayout
300
309
  density="spacious"
301
- xstyle={styles.chatLayout}
310
+ style={chatLayout}
302
311
  composer={
303
312
  <ChatComposer
304
313
  onSubmit={() => {}}
@@ -677,17 +686,15 @@ The fix is to catch \`TokenExpiredError\` specifically and attempt a refresh bef
677
686
  pillPlacement="start"
678
687
  hasDivider
679
688
  label="Resize artifact panel"
680
- xstyle={styles.resizeHandle}
689
+ className="ai-chat-resize-handle"
681
690
  />
682
691
 
683
692
  {/* Toolbar as the card header, body below */}
684
693
  <Card
685
694
  variant="transparent"
686
695
  height="100%"
687
- xstyle={[
688
- styles.artifactPanel,
689
- dynamicStyles.artifactPanelWidth(artifactResize.size),
690
- ]}>
696
+ className="ai-chat-artifact-panel"
697
+ style={artifactPanelWidthVar(artifactResize.size)}>
691
698
  <Toolbar
692
699
  label="Artifact actions"
693
700
  dividers={['bottom']}
@@ -2,9 +2,7 @@
2
2
 
3
3
  'use client';
4
4
 
5
- import {useRef, useState} from 'react';
6
- import * as stylex from '@stylexjs/stylex';
7
- import {spacingVars} from '@astryxdesign/core/theme/tokens.stylex';
5
+ import {useRef, useState, type CSSProperties} from 'react';
8
6
 
9
7
  import {Layout, LayoutContent, VStack, HStack} from '@astryxdesign/core/Layout';
10
8
  import {Text, Heading} from '@astryxdesign/core/Text';
@@ -40,12 +38,10 @@ import {
40
38
  LightBulbIcon,
41
39
  } from '@heroicons/react/24/outline';
42
40
 
43
- const styles = stylex.create({
44
- // Fill the content area so the greeting and composer stay vertically centered.
45
- page: {minHeight: '100%'},
46
- composerInput: {minHeight: 84},
47
- categories: {paddingInline: spacingVars['--spacing-3']},
48
- });
41
+ // Fill the content area so the greeting and composer stay vertically centered.
42
+ const pageStyle: CSSProperties = {minHeight: '100%'};
43
+ const composerInput: CSSProperties = {minHeight: 84};
44
+ const categories: CSSProperties = {paddingInline: 'var(--spacing-3)'};
49
45
 
50
46
  // Suggestion cards shown once a category is selected.
51
47
  const CATEGORY_SUGGESTIONS: Record<
@@ -311,7 +307,7 @@ export default function AIChatTemplate() {
311
307
  padding={6}
312
308
  content={
313
309
  <LayoutContent>
314
- <VStack gap={8} vAlign="center" xstyle={styles.page}>
310
+ <VStack gap={8} vAlign="center" style={pageStyle}>
315
311
  {/* Greeting */}
316
312
  <VStack gap={1}>
317
313
  <HStack gap={2} vAlign="center">
@@ -333,7 +329,7 @@ export default function AIChatTemplate() {
333
329
  <ChatComposerInput
334
330
  handleRef={composerInputRef}
335
331
  triggers={composerTriggers}
336
- xstyle={styles.composerInput}
332
+ style={composerInput}
337
333
  onFiles={files =>
338
334
  setAttachments(prev => [...prev, ...files.map(f => f.name)])
339
335
  }
@@ -435,7 +431,7 @@ export default function AIChatTemplate() {
435
431
  />
436
432
 
437
433
  {/* Category filters + suggestion cards */}
438
- <VStack gap={6} xstyle={styles.categories}>
434
+ <VStack gap={6} style={categories}>
439
435
  <ToggleButtonGroup
440
436
  label="Category"
441
437
  value={category}
@@ -2,7 +2,7 @@
2
2
 
3
3
  'use client';
4
4
 
5
- import * as stylex from '@stylexjs/stylex';
5
+ import type {CSSProperties} from 'react';
6
6
  import {
7
7
  VStack,
8
8
  HStack,
@@ -19,18 +19,16 @@ import {ArrowRightIcon} from '@heroicons/react/20/solid';
19
19
  const IMAGE_URL =
20
20
  'https://lookaside.facebook.com/assets/astryx/light-scene-horizontal-1.png';
21
21
 
22
- const styles = stylex.create({
23
- heroImage: {
24
- width: '100%',
25
- height: '100%',
26
- objectFit: 'cover',
27
- },
28
- heroFrame: {
29
- maxWidth: 1200,
30
- marginInline: 'auto',
31
- borderRadius: 'var(--radius-page)',
32
- },
33
- });
22
+ const heroImage: CSSProperties = {
23
+ width: '100%',
24
+ height: '100%',
25
+ objectFit: 'cover',
26
+ };
27
+ const heroFrame: CSSProperties = {
28
+ maxWidth: 1200,
29
+ marginInline: 'auto',
30
+ borderRadius: 'var(--radius-page)',
31
+ };
34
32
 
35
33
  export default function CenteredHero() {
36
34
  return (
@@ -68,9 +66,9 @@ export default function CenteredHero() {
68
66
  </HStack>
69
67
  </VStack>
70
68
  <Section variant="transparent" padding={0}>
71
- <AspectRatio ratio={16 / 9} xstyle={styles.heroFrame}>
69
+ <AspectRatio ratio={16 / 9} style={heroFrame}>
72
70
  <img
73
- {...stylex.props(styles.heroImage)}
71
+ style={heroImage}
74
72
  src={IMAGE_URL}
75
73
  alt="A bright, colorful lifestyle scene"
76
74
  />
@@ -2,41 +2,38 @@
2
2
 
3
3
  'use client';
4
4
 
5
- import {useState} from 'react';
5
+ import {useState, type CSSProperties} from 'react';
6
6
  import {VStack, Layout, LayoutContent} from '@astryxdesign/core/Layout';
7
7
  import {Center} from '@astryxdesign/core/Center';
8
8
  import {Text, Heading} from '@astryxdesign/core/Text';
9
9
  import {Grid} from '@astryxdesign/core/Grid';
10
10
  import {Section} from '@astryxdesign/core/Section';
11
11
  import {TabList, Tab} from '@astryxdesign/core/TabList';
12
- import * as stylex from '@stylexjs/stylex';
13
12
 
14
13
  // ─── Styles ─────────────────────────────────────────────────────────────────
15
14
 
16
- const styles = stylex.create({
17
- outer: {
18
- maxWidth: 1200,
19
- width: '100%',
20
- paddingInline: 'var(--spacing-6)',
21
- paddingBlock: 'var(--spacing-8)',
22
- },
23
- imageWrapper: {
24
- position: 'relative',
25
- aspectRatio: '3/2',
26
- borderRadius: 'var(--radius-container)',
27
- overflow: 'clip',
28
- },
29
- textCenter: {
30
- textAlign: 'center',
31
- },
32
- imgFill: {
33
- position: 'absolute',
34
- inset: 0,
35
- width: '100%',
36
- height: '100%',
37
- objectFit: 'cover',
38
- },
39
- });
15
+ const outer: CSSProperties = {
16
+ maxWidth: 1200,
17
+ width: '100%',
18
+ paddingInline: 'var(--spacing-6)',
19
+ paddingBlock: 'var(--spacing-8)',
20
+ };
21
+ const imageWrapper: CSSProperties = {
22
+ position: 'relative',
23
+ aspectRatio: '3/2',
24
+ borderRadius: 'var(--radius-container)',
25
+ overflow: 'clip',
26
+ };
27
+ const textCenter: CSSProperties = {
28
+ textAlign: 'center',
29
+ };
30
+ const imgFill: CSSProperties = {
31
+ position: 'absolute',
32
+ inset: 0,
33
+ width: '100%',
34
+ height: '100%',
35
+ objectFit: 'cover',
36
+ };
40
37
 
41
38
  // ─── Gallery Data ───────────────────────────────────────────────────────────
42
39
 
@@ -117,11 +114,11 @@ export default function ClassicGalleryTemplate() {
117
114
  content={
118
115
  <LayoutContent padding={0}>
119
116
  <Center axis="horizontal">
120
- <VStack gap={8} xstyle={styles.outer}>
117
+ <VStack gap={8} style={outer}>
121
118
  {/* Header */}
122
119
  <Center axis="horizontal">
123
120
  <Section variant="transparent" maxWidth={680} padding={0}>
124
- <VStack gap={4} hAlign="center" xstyle={styles.textCenter}>
121
+ <VStack gap={4} hAlign="center" style={textCenter}>
125
122
  <VStack gap={2} hAlign="center">
126
123
  <Heading level={1}>
127
124
  Make every day a little more delightful, one detail at a
@@ -150,12 +147,8 @@ export default function ClassicGalleryTemplate() {
150
147
  {/* Gallery Grid */}
151
148
  <Grid columns={{minWidth: 260, repeat: 'fit'}} gap={4}>
152
149
  {filteredImages.map((image, i) => (
153
- <div key={i} {...stylex.props(styles.imageWrapper)}>
154
- <img
155
- src={image.src}
156
- alt={image.alt}
157
- {...stylex.props(styles.imgFill)}
158
- />
150
+ <div key={i} style={imageWrapper}>
151
+ <img src={image.src} alt={image.alt} style={imgFill} />
159
152
  </div>
160
153
  ))}
161
154
  </Grid>
@@ -41,26 +41,26 @@ import {
41
41
  } from '@heroicons/react/24/outline';
42
42
 
43
43
  // ─── Styles ─────────────────────────────────────────────────────────────────
44
- import * as stylex from '@stylexjs/stylex';
44
+ import type {CSSProperties} from 'react';
45
45
 
46
46
  // The only custom CSS in this template is small optical-alignment negative
47
47
  // margins: LayoutHeader/TabList have no edge-dock prop (#2622) and List
48
48
  // has no "bleed to container edge" prop (#2626). Everything else uses props.
49
- const pageStyles = stylex.create({
50
- // Bleed the tab bar to the header's content edges so the active-tab underline
51
- // meets the header divider. No edge-dock prop on TabList (#2622).
52
- tabsRow: {
53
- marginInline: -12,
54
- marginBottom: -16,
55
- marginTop: 12,
56
- },
57
- // Pull the list items' inner padding back so their content optically aligns
58
- // with the section heading above (ListItem insets content by ~8px). No
59
- // edge/inset prop on List (#2626).
60
- itemsList: {
61
- marginInline: -8,
62
- },
63
- });
49
+ // Plain inline styles — no StyleX compiler required.
50
+
51
+ // Bleed the tab bar to the header's content edges so the active-tab underline
52
+ // meets the header divider. No edge-dock prop on TabList (#2622).
53
+ const tabsRow: CSSProperties = {
54
+ marginInline: -12,
55
+ marginBottom: -16,
56
+ marginTop: 12,
57
+ };
58
+ // Pull the list items' inner padding back so their content optically aligns
59
+ // with the section heading above (ListItem insets content by ~8px). No
60
+ // edge/inset prop on List (#2626).
61
+ const itemsList: CSSProperties = {
62
+ marginInline: -8,
63
+ };
64
64
 
65
65
  // ─── Product data ───────────────────────────────────────────────────────────
66
66
  const PRODUCT_IMAGES = [
@@ -258,7 +258,7 @@ function PageHeader({
258
258
  </HStack>
259
259
  )}
260
260
 
261
- <HStack vAlign="center" xstyle={pageStyles.tabsRow}>
261
+ <HStack vAlign="center" style={tabsRow}>
262
262
  <StackItem size="fill">
263
263
  <TabList value={activeTab} onChange={onTabChange} size="lg">
264
264
  <Tab value="details" label="Details" />
@@ -305,7 +305,7 @@ function ItemsCard() {
305
305
  </HStack>
306
306
  </HStack>
307
307
 
308
- <List density="spacious" xstyle={pageStyles.itemsList}>
308
+ <List density="spacious" style={itemsList}>
309
309
  {PRODUCTS.map((product, i) => (
310
310
  <ListItem
311
311
  key={i}
@@ -2,27 +2,23 @@
2
2
 
3
3
  'use client';
4
4
 
5
- import * as stylex from '@stylexjs/stylex';
6
- import {
7
- SideNav,
8
- SideNavHeading,
9
- SideNavItem,
10
- SideNavSection,
11
- } from '@astryxdesign/core/SideNav';
12
- import {Text} from '@astryxdesign/core/Text';
5
+ import type {CSSProperties} from 'react';
6
+ import {Heading, Text} from '@astryxdesign/core/Text';
13
7
  import {Button} from '@astryxdesign/core/Button';
14
8
  import {Card} from '@astryxdesign/core/Card';
9
+ import {ClickableCard} from '@astryxdesign/core/ClickableCard';
15
10
  import {HStack, VStack, StackItem} from '@astryxdesign/core/Stack';
16
- import {Layout, LayoutContent, LayoutPanel} from '@astryxdesign/core/Layout';
11
+ import {Layout, LayoutContent} from '@astryxdesign/core/Layout';
17
12
  import {Grid} from '@astryxdesign/core/Grid';
18
- import {radiusVars} from '@astryxdesign/core/theme/tokens.stylex';
19
13
 
20
- const styles = stylex.create({
21
- previewCard: {
22
- borderRadius: radiusVars['--radius-container'],
23
- cursor: 'pointer',
24
- },
25
- });
14
+ const previewCard: CSSProperties = {
15
+ borderRadius: 'var(--radius-element)',
16
+ };
17
+ // Negative margin offsets each card's 8px padding so the grid content stays
18
+ // visually aligned while giving every card a padded hover/click target.
19
+ const cardGrid: CSSProperties = {
20
+ margin: -8,
21
+ };
26
22
 
27
23
  // ---------------------------------------------------------------------------
28
24
  // Data
@@ -213,30 +209,12 @@ const COMPONENT_CATEGORIES = [
213
209
  export default function DocumentationOverviewPage() {
214
210
  return (
215
211
  <Layout
216
- height="fill"
212
+ height="auto"
217
213
  contentWidth={1200}
218
- start={
219
- <LayoutPanel hasDivider padding={0}>
220
- <SideNav header={<SideNavHeading heading="Product Name" />}>
221
- <SideNavSection title="Navigation" isHeaderHidden>
222
- <SideNavItem label="Home" isSelected />
223
- <SideNavItem label="Getting started" />
224
- </SideNavSection>
225
-
226
- {COMPONENT_CATEGORIES.map(category => (
227
- <SideNavSection key={category.label} title={category.label}>
228
- {category.items.map(item => (
229
- <SideNavItem key={item.key} label={item.name} />
230
- ))}
231
- </SideNavSection>
232
- ))}
233
- </SideNav>
234
- </LayoutPanel>
235
- }
236
214
  content={
237
215
  <LayoutContent padding={8}>
238
216
  <VStack gap={10}>
239
- <Card variant="cyan" padding={10}>
217
+ <Card variant="gray" padding={10}>
240
218
  <HStack gap={8} vAlign="center">
241
219
  <StackItem size="fill">
242
220
  <VStack gap={4}>
@@ -246,11 +224,7 @@ export default function DocumentationOverviewPage() {
246
224
  beautiful, accessible products.
247
225
  </Text>
248
226
  <HStack>
249
- <Button
250
- label="Get started"
251
- variant="primary"
252
- size="lg"
253
- />
227
+ <Button label="Get started" variant="primary" size="lg" />
254
228
  </HStack>
255
229
  </VStack>
256
230
  </StackItem>
@@ -260,25 +234,35 @@ export default function DocumentationOverviewPage() {
260
234
 
261
235
  {COMPONENT_CATEGORIES.map(category => (
262
236
  <VStack key={category.label} gap={4}>
263
- <Text type="display-2">{category.label}</Text>
264
- <Grid columns={{minWidth: 260}} gap={8}>
237
+ <Heading level={2}>{category.label}</Heading>
238
+ <Grid
239
+ columns={{minWidth: 260}}
240
+ gap={2}
241
+ style={cardGrid}>
265
242
  {category.items.map(item => (
266
- <VStack key={item.key} gap={3}>
267
- <Card
268
- variant="muted"
269
- padding={0}
270
- minHeight={160}
271
- xstyle={styles.previewCard}
272
- />
273
- <VStack gap={0.5}>
274
- <Text type="body" weight="bold">
275
- {item.name}
276
- </Text>
277
- <Text type="body" color="secondary">
278
- {item.desc}
279
- </Text>
243
+ <ClickableCard
244
+ key={item.key}
245
+ label={`Open ${item.name}`}
246
+ onClick={() => {}}
247
+ variant="transparent"
248
+ padding={2}>
249
+ <VStack gap={3}>
250
+ <Card
251
+ variant="muted"
252
+ padding={0}
253
+ minHeight={160}
254
+ style={previewCard}
255
+ />
256
+ <VStack gap={0.5}>
257
+ <Text type="body" weight="bold">
258
+ {item.name}
259
+ </Text>
260
+ <Text type="body" color="secondary" maxLines={3}>
261
+ {item.desc}
262
+ </Text>
263
+ </VStack>
280
264
  </VStack>
281
- </VStack>
265
+ </ClickableCard>
282
266
  ))}
283
267
  </Grid>
284
268
  </VStack>