@astryxdesign/cli 0.1.0 → 0.1.1-canary.13763f6

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 (141) 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 +8 -8
  14. package/src/api/doctor.mjs +3 -3
  15. package/src/api/search.mjs +207 -13
  16. package/src/api/template.mjs +62 -11
  17. package/src/api/template.test.mjs +2 -0
  18. package/src/codemods/__tests__/registry.test.mjs +1 -0
  19. package/src/codemods/registry.mjs +1 -0
  20. package/src/codemods/runner.mjs +105 -51
  21. package/src/codemods/transforms/v0.1.0/__tests__/migrate-xds-config-surfaces.test.mjs +116 -0
  22. package/src/codemods/transforms/v0.1.0/__tests__/migrate-xds-module-specifiers.test.mjs +51 -0
  23. package/src/codemods/transforms/v0.1.0/index.mjs +28 -0
  24. package/src/codemods/transforms/v0.1.0/migrate-xds-config-surfaces.mjs +230 -0
  25. package/src/codemods/transforms/v0.1.0/migrate-xds-module-specifiers.mjs +84 -0
  26. package/src/commands/agent-docs.mjs +119 -66
  27. package/src/commands/agent-docs.path-safety.test.mjs +1 -1
  28. package/src/commands/agent-docs.test.mjs +87 -31
  29. package/src/commands/build-theme.import-path.test.mjs +1 -1
  30. package/src/commands/build-theme.path-safety.test.mjs +1 -1
  31. package/src/commands/build-theme.prose.test.mjs +1 -1
  32. package/src/commands/build.mjs +196 -0
  33. package/src/commands/component-package.test.mjs +1 -1
  34. package/src/commands/component.test.mjs +1 -1
  35. package/src/commands/docs.test.mjs +1 -1
  36. package/src/commands/doctor.test.mjs +1 -1
  37. package/src/commands/external-showcase.test.mjs +1 -1
  38. package/src/commands/init.mjs +10 -2
  39. package/src/commands/interactive-guard.test.mjs +1 -1
  40. package/src/commands/json-contract.test.mjs +10 -3
  41. package/src/commands/swizzle-gap-safety.test.mjs +1 -1
  42. package/src/commands/swizzle.path-safety.test.mjs +1 -1
  43. package/src/commands/template.path-safety.test.mjs +1 -1
  44. package/src/commands/template.test.mjs +1 -1
  45. package/src/commands/upgrade.mjs +353 -169
  46. package/src/commands/upgrade.test.mjs +41 -27
  47. package/src/index.mjs +1 -0
  48. package/src/lib/config.mjs +12 -0
  49. package/src/lib/config.test.mjs +42 -0
  50. package/src/lib/error-codes.mjs +3 -0
  51. package/src/types/error-codes.d.ts +1 -0
  52. package/src/utils/interactive.mjs +1 -1
  53. package/src/utils/interactive.test.mjs +2 -0
  54. package/src/utils/package-manager.mjs +1 -1
  55. package/src/utils/package-manager.test.mjs +1 -1
  56. package/src/utils/path-safety.test.mjs +1 -1
  57. package/src/utils/paths.test.mjs +8 -8
  58. package/src/utils/update-check.mjs +4 -26
  59. package/src/utils/update-check.test.mjs +2 -64
  60. package/templates/blocks/components/AppShell/AppShellContentOnly.tsx +1 -9
  61. package/templates/blocks/components/AppShell/AppShellShowcase.tsx +1 -10
  62. package/templates/blocks/components/AppShell/AppShellSideNavOnly.tsx +1 -9
  63. package/templates/blocks/components/AppShell/AppShellTopNavOnly.tsx +1 -9
  64. package/templates/blocks/components/AppShell/AppShellTopNavWithSideNav.tsx +1 -9
  65. package/templates/blocks/components/AppShell/AppShellWithBanner.tsx +1 -9
  66. package/templates/blocks/components/AspectRatio/AspectRatioShowcase.tsx +12 -19
  67. package/templates/blocks/components/Banner/BannerShowcase.tsx +1 -8
  68. package/templates/blocks/components/Blockquote/BlockquoteShowcase.tsx +1 -8
  69. package/templates/blocks/components/Carousel/CarouselShowcase.tsx +2 -12
  70. package/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerShowcase.tsx +6 -9
  71. package/templates/blocks/components/ChatLayout/ChatLayoutPanelChat.tsx +10 -12
  72. package/templates/blocks/components/ChatMessageList/ChatMessageListDensity.tsx +1 -9
  73. package/templates/blocks/components/ChatMessageList/ChatMessageListFullFeatured.tsx +1 -9
  74. package/templates/blocks/components/ChatMessageList/ChatMessageListShowcase.tsx +1 -9
  75. package/templates/blocks/components/ChatMessageMetadata/ChatMessageMetadataShowcase.tsx +1 -8
  76. package/templates/blocks/components/ChatSendButton/ChatSendButtonInComposer.tsx +1 -8
  77. package/templates/blocks/components/Citation/CitationInlineText.tsx +4 -4
  78. package/templates/blocks/components/Code/CodeInlineInParagraph.tsx +1 -8
  79. package/templates/blocks/components/CodeBlock/CodeBlockBashCommand.tsx +1 -1
  80. package/templates/blocks/components/CodeBlock/CodeBlockJSONConfig.tsx +1 -1
  81. package/templates/blocks/components/CommandPaletteItem/CommandPaletteItemShowcase.tsx +9 -12
  82. package/templates/blocks/components/ContextMenu/ContextMenuShowcase.tsx +13 -15
  83. package/templates/blocks/components/Divider/DividerShowcase.tsx +1 -8
  84. package/templates/blocks/components/Divider/DividerVertical.tsx +7 -9
  85. package/templates/blocks/components/Field/FieldShowcase.tsx +1 -8
  86. package/templates/blocks/components/FormLayout/FormLayoutHorizontal.tsx +1 -6
  87. package/templates/blocks/components/Grid/GridResponsiveAutoFit.tsx +1 -9
  88. package/templates/blocks/components/HoverCard/HoverCardInlineTextHoverCard.tsx +4 -6
  89. package/templates/blocks/components/HoverCard/HoverCardInteractiveContent.tsx +1 -6
  90. package/templates/blocks/components/HoverCard/HoverCardProfileHoverCard.tsx +2 -8
  91. package/templates/blocks/components/HoverCard/HoverCardShowcase.tsx +1 -8
  92. package/templates/blocks/components/MoreMenu/MoreMenuInToolbar.tsx +2 -12
  93. package/templates/blocks/components/OverflowList/OverflowListOverflowBadges.tsx +8 -11
  94. package/templates/blocks/components/OverflowList/OverflowListOverflowDropdownActions.tsx +9 -12
  95. package/templates/blocks/components/Overlay/OverlayBottomStrip.tsx +4 -17
  96. package/templates/blocks/components/Overlay/OverlayHoverReveal.tsx +15 -16
  97. package/templates/blocks/components/Overlay/OverlayShowcase.tsx +5 -21
  98. package/templates/blocks/components/Pagination/PaginationDotsCarousel.tsx +2 -14
  99. package/templates/blocks/components/Pagination/PaginationPageSize.tsx +12 -14
  100. package/templates/blocks/components/Pagination/PaginationVariants.tsx +1 -8
  101. package/templates/blocks/components/Pagination/PaginationWithTable.tsx +2 -14
  102. package/templates/blocks/components/Tokenizer/TokenizerClear.tsx +1 -6
  103. package/templates/blocks/components/Tokenizer/TokenizerCreatable.tsx +2 -7
  104. package/templates/blocks/components/Tokenizer/TokenizerEndContent.tsx +1 -6
  105. package/templates/blocks/components/Tokenizer/TokenizerIcon.tsx +1 -6
  106. package/templates/blocks/components/Tokenizer/TokenizerMaxEntries.tsx +1 -6
  107. package/templates/blocks/components/Tokenizer/TokenizerOverflow.tsx +2 -7
  108. package/templates/blocks/components/Tokenizer/TokenizerShowcase.tsx +1 -6
  109. package/templates/blocks/components/Tokenizer/TokenizerStates.tsx +4 -9
  110. package/templates/blocks/components/Toolbar/ToolbarCardHeader.tsx +1 -10
  111. package/templates/blocks/components/Toolbar/ToolbarSizes.tsx +1 -8
  112. package/templates/blocks/components/Toolbar/ToolbarTableFilter.tsx +1 -8
  113. package/templates/blocks/components/Toolbar/ToolbarThreeSlot.tsx +1 -10
  114. package/templates/blocks/components/Toolbar/ToolbarWithTabs.tsx +8 -11
  115. package/templates/pages/ai-chat/page.tsx +71 -64
  116. package/templates/pages/ai-chat-landing/page.tsx +8 -12
  117. package/templates/pages/centered-hero/page.tsx +13 -15
  118. package/templates/pages/classic-gallery/page.tsx +27 -34
  119. package/templates/pages/detail-page/page.tsx +18 -18
  120. package/templates/pages/documentation/page.tsx +42 -58
  121. package/templates/pages/documentation-design/page.tsx +82 -60
  122. package/templates/pages/documentation-technical/page.tsx +101 -60
  123. package/templates/pages/editor/page.tsx +42 -54
  124. package/templates/pages/file-explorer/page.tsx +13 -16
  125. package/templates/pages/form-two-column/page.tsx +13 -17
  126. package/templates/pages/gallery-hero/page.tsx +13 -15
  127. package/templates/pages/ide/page.tsx +188 -264
  128. package/templates/pages/library/page.tsx +16 -23
  129. package/templates/pages/login/page.tsx +14 -18
  130. package/templates/pages/login-card/page.tsx +14 -18
  131. package/templates/pages/login-split/page.tsx +50 -48
  132. package/templates/pages/login-sso/page.tsx +9 -13
  133. package/templates/pages/mixed-gallery/page.tsx +51 -45
  134. package/templates/pages/payment-form/page.tsx +56 -70
  135. package/templates/pages/product-detail/page.tsx +27 -33
  136. package/templates/pages/product-gallery/page.tsx +7 -13
  137. package/templates/pages/settings-dialog/page.tsx +35 -43
  138. package/templates/pages/settings-sidebar/page.tsx +39 -47
  139. package/templates/pages/side-gallery/page.tsx +6 -9
  140. package/templates/pages/table-grouped/page.tsx +11 -15
  141. package/templates/pages/theme-showcase/page.tsx +33 -37
@@ -2,9 +2,8 @@
2
2
 
3
3
  'use client';
4
4
 
5
- import {useState} from 'react';
5
+ import {useState, type CSSProperties} from 'react';
6
6
  import {useMediaQuery} from '@astryxdesign/core/hooks';
7
- import * as stylex from '@stylexjs/stylex';
8
7
  import {
9
8
  VStack,
10
9
  HStack,
@@ -27,11 +26,6 @@ import {TabList, Tab} from '@astryxdesign/core/TabList';
27
26
  import {Badge} from '@astryxdesign/core/Badge';
28
27
  import {Icon} from '@astryxdesign/core/Icon';
29
28
  import {Center} from '@astryxdesign/core/Center';
30
- import {
31
- colorVars,
32
- radiusVars,
33
- spacingVars,
34
- } from '@astryxdesign/core/theme/tokens.stylex';
35
29
  import {
36
30
  UserIcon,
37
31
  LockClosedIcon,
@@ -49,29 +43,27 @@ import {
49
43
  ChevronRightIcon,
50
44
  } from '@heroicons/react/24/outline';
51
45
 
52
- const styles = stylex.create({
53
- // Anchor the page to the viewport height so the sidebar + content fill the
54
- // screen. Layout height="fill" is min-height:100% which collapses when the
55
- // host container is content-sized; Layout has no viewport-height prop.
56
- fillViewport: {
57
- minHeight: '100dvh',
58
- },
59
- iconBox: {
60
- borderRadius: radiusVars['--radius-container'],
61
- backgroundColor: colorVars['--color-background-surface'],
62
- flexShrink: 0,
63
- },
64
- rowPadding: {
65
- paddingBlock: spacingVars['--spacing-4'],
66
- },
67
- sideNavPadding: {
68
- paddingBlock: spacingVars['--spacing-4'],
69
- paddingInline: spacingVars['--spacing-3'],
70
- },
71
- sideNavHeading: {
72
- marginInline: spacingVars['--spacing-4'],
73
- },
74
- });
46
+ // Anchor the page to the viewport height so the sidebar + content fill the
47
+ // screen. Layout height="fill" is min-height:100% which collapses when the
48
+ // host container is content-sized; Layout has no viewport-height prop.
49
+ const fillViewport: CSSProperties = {
50
+ minHeight: '100dvh',
51
+ };
52
+ const iconBox: CSSProperties = {
53
+ borderRadius: 'var(--radius-container)',
54
+ backgroundColor: 'var(--color-background-surface)',
55
+ flexShrink: 0,
56
+ };
57
+ const rowPadding: CSSProperties = {
58
+ paddingBlock: 'var(--spacing-4)',
59
+ };
60
+ const sideNavPadding: CSSProperties = {
61
+ paddingBlock: 'var(--spacing-4)',
62
+ paddingInline: 'var(--spacing-3)',
63
+ };
64
+ const sideNavHeading: CSSProperties = {
65
+ marginInline: 'var(--spacing-4)',
66
+ };
75
67
 
76
68
  const NAV_ITEMS = [
77
69
  {label: 'Personal information', icon: UserIcon},
@@ -129,7 +121,7 @@ const DEVICE_ROWS: {
129
121
  function InfoRowItem({label, value, action}: InfoRow) {
130
122
  return (
131
123
  <>
132
- <HStack hAlign="between" vAlign="start" xstyle={styles.rowPadding}>
124
+ <HStack hAlign="between" vAlign="start" style={rowPadding}>
133
125
  <VStack gap={0}>
134
126
  <Text type="body" weight="semibold" display="block">
135
127
  {label}
@@ -167,7 +159,7 @@ function ExpandableRow({
167
159
  return (
168
160
  <>
169
161
  {isExpanded ? (
170
- <VStack gap={4} xstyle={styles.rowPadding}>
162
+ <VStack gap={4} style={rowPadding}>
171
163
  <Text type="body" weight="semibold" display="block">
172
164
  {label}
173
165
  </Text>
@@ -178,7 +170,7 @@ function ExpandableRow({
178
170
  </HStack>
179
171
  </VStack>
180
172
  ) : (
181
- <HStack hAlign="between" vAlign="start" xstyle={styles.rowPadding}>
173
+ <HStack hAlign="between" vAlign="start" style={rowPadding}>
182
174
  <VStack gap={0}>
183
175
  <Text type="body" weight="semibold" display="block">
184
176
  {label}
@@ -263,8 +255,8 @@ export default function SettingsSecurityTemplate() {
263
255
  };
264
256
 
265
257
  const navList = (
266
- <VStack gap={4} xstyle={styles.sideNavPadding}>
267
- <Heading level={2} xstyle={styles.sideNavHeading}>
258
+ <VStack gap={4} style={sideNavPadding}>
259
+ <Heading level={2} style={sideNavHeading}>
268
260
  Account settings
269
261
  </Heading>
270
262
  <List density="spacious">
@@ -299,7 +291,7 @@ export default function SettingsSecurityTemplate() {
299
291
  return (
300
292
  <Layout
301
293
  height="fill"
302
- xstyle={styles.fillViewport}
294
+ style={fillViewport}
303
295
  content={<LayoutContent padding={2}>{navList}</LayoutContent>}
304
296
  />
305
297
  );
@@ -309,7 +301,7 @@ export default function SettingsSecurityTemplate() {
309
301
  <Layout
310
302
  height="fill"
311
303
  contentWidth={1200}
312
- xstyle={styles.fillViewport}
304
+ style={fillViewport}
313
305
  start={
314
306
  isNarrow ? undefined : (
315
307
  <LayoutPanel hasDivider padding={0}>
@@ -385,7 +377,7 @@ export default function SettingsSecurityTemplate() {
385
377
  key={i}
386
378
  gap={3}
387
379
  vAlign="start"
388
- xstyle={styles.rowPadding}>
380
+ style={rowPadding}>
389
381
  <Icon icon={ComputerDesktopIcon} />
390
382
  <StackItem size="fill">
391
383
  <VStack gap={0}>
@@ -419,7 +411,7 @@ export default function SettingsSecurityTemplate() {
419
411
  <HStack
420
412
  hAlign="between"
421
413
  vAlign="start"
422
- xstyle={styles.rowPadding}>
414
+ style={rowPadding}>
423
415
  <VStack gap={0}>
424
416
  <Text
425
417
  type="body"
@@ -459,7 +451,7 @@ export default function SettingsSecurityTemplate() {
459
451
  <Center
460
452
  width={48}
461
453
  height={48}
462
- xstyle={styles.iconBox}>
454
+ style={iconBox}>
463
455
  <Icon icon={LockClosedIcon} />
464
456
  </Center>
465
457
  <VStack gap={1}>
@@ -659,7 +651,7 @@ export default function SettingsSecurityTemplate() {
659
651
  <Card padding={4}>
660
652
  <VStack gap={4}>
661
653
  <HStack gap={3} vAlign="start">
662
- <Center width={48} height={48} xstyle={styles.iconBox}>
654
+ <Center width={48} height={48} style={iconBox}>
663
655
  <Icon icon={LockClosedIcon} />
664
656
  </Center>
665
657
  <VStack gap={0}>
@@ -677,7 +669,7 @@ export default function SettingsSecurityTemplate() {
677
669
  </HStack>
678
670
  <Divider />
679
671
  <HStack gap={3} vAlign="start">
680
- <Center width={48} height={48} xstyle={styles.iconBox}>
672
+ <Center width={48} height={48} style={iconBox}>
681
673
  <Icon icon={PencilSquareIcon} />
682
674
  </Center>
683
675
  <VStack gap={0}>
@@ -697,7 +689,7 @@ export default function SettingsSecurityTemplate() {
697
689
  </HStack>
698
690
  <Divider />
699
691
  <HStack gap={3} vAlign="start">
700
- <Center width={48} height={48} xstyle={styles.iconBox}>
692
+ <Center width={48} height={48} style={iconBox}>
701
693
  <Icon icon={ShareIcon} />
702
694
  </Center>
703
695
  <VStack gap={0}>
@@ -725,7 +717,7 @@ export default function SettingsSecurityTemplate() {
725
717
  <VStack gap={8}>
726
718
  <VStack gap={0}>
727
719
  <Heading level={3}>Messages</Heading>
728
- <VStack xstyle={styles.rowPadding}>
720
+ <VStack style={rowPadding}>
729
721
  <Switch
730
722
  label="Show people when I've read their messages."
731
723
  value={readReceipts}
@@ -737,7 +729,7 @@ export default function SettingsSecurityTemplate() {
737
729
  <HStack
738
730
  hAlign="between"
739
731
  vAlign="center"
740
- xstyle={styles.rowPadding}>
732
+ style={rowPadding}>
741
733
  <Text type="body" weight="semibold">
742
734
  Blocked people
743
735
  </Text>
@@ -748,7 +740,7 @@ export default function SettingsSecurityTemplate() {
748
740
 
749
741
  <VStack gap={0}>
750
742
  <Heading level={3}>Listings</Heading>
751
- <VStack xstyle={styles.rowPadding}>
743
+ <VStack style={rowPadding}>
752
744
  <Switch
753
745
  label="Include my listing(s) in search engines"
754
746
  description="Turning this on means search engines, like Google, will display your listing page(s) in search results."
@@ -833,7 +825,7 @@ export default function SettingsSecurityTemplate() {
833
825
  <Center
834
826
  width={48}
835
827
  height={48}
836
- xstyle={styles.iconBox}>
828
+ style={iconBox}>
837
829
  <Icon icon={ShieldCheckIcon} />
838
830
  </Center>
839
831
  <VStack gap={1}>
@@ -13,21 +13,18 @@ import {Button} from '@astryxdesign/core/Button';
13
13
  import {AspectRatio} from '@astryxdesign/core/AspectRatio';
14
14
  import {Grid} from '@astryxdesign/core/Grid';
15
15
  import {Divider} from '@astryxdesign/core/Divider';
16
- import * as stylex from '@stylexjs/stylex';
17
16
 
18
- // Image fill is a plain inline style (not stylex) so it survives the playground
19
- // preview's runtime TS compile, which doesn't run the StyleX babel plugin.
17
+ // Image fill is a plain inline style so it renders without any CSS compiler
18
+ // (works in the playground preview's runtime TS compile too).
20
19
  const imageStyle = {
21
20
  width: '100%',
22
21
  height: '100%',
23
22
  objectFit: 'cover' as const,
24
23
  };
25
24
 
26
- const styles = stylex.create({
27
- imageClip: {
28
- borderRadius: 'var(--radius-element)',
29
- },
30
- });
25
+ const imageClip = {
26
+ borderRadius: 'var(--radius-element)',
27
+ };
31
28
 
32
29
  // ─── Image Data ─────────────────────────────────────────────────────────────
33
30
 
@@ -91,7 +88,7 @@ function ImageGrid() {
91
88
  return (
92
89
  <Grid columns={3} gap={3}>
93
90
  {IMAGES.map(img => (
94
- <AspectRatio key={img.src} ratio={1} xstyle={styles.imageClip}>
91
+ <AspectRatio key={img.src} ratio={1} style={imageClip}>
95
92
  <img src={img.src} alt={img.alt} style={imageStyle} />
96
93
  </AspectRatio>
97
94
  ))}
@@ -5,7 +5,6 @@
5
5
  import React, {useState, useMemo} from 'react';
6
6
  import {useResizable, ResizeHandle} from '@astryxdesign/core/Resizable';
7
7
  import type {ResizableProps} from '@astryxdesign/core/Resizable';
8
- import * as stylex from '@stylexjs/stylex';
9
8
  import {
10
9
  Layout,
11
10
  LayoutContent,
@@ -56,15 +55,15 @@ import {
56
55
  import {XMarkIcon} from '@heroicons/react/24/outline';
57
56
  import {ChartBarIcon} from '@heroicons/react/24/solid';
58
57
 
59
- const pageStyles = stylex.create({
60
- groupHeaderRow: {
61
- cursor: 'pointer',
62
- backgroundColor: 'var(--color-background-muted)',
63
- },
64
- groupHeaderCell: {
65
- padding: 'var(--spacing-3) var(--spacing-4)',
66
- },
67
- });
58
+ // Plain inline styles using Astryx design-token CSS variables (declared at
59
+ // :root by `@astryxdesign/core/astryx.css`). No StyleX compiler required.
60
+ // The group-header background + cursor live on the colSpan TableCell (which
61
+ // reliably forwards `style`) so they fill the full row width.
62
+ const groupHeaderCell: React.CSSProperties = {
63
+ cursor: 'pointer',
64
+ backgroundColor: 'var(--color-background-muted)',
65
+ padding: 'var(--spacing-3) var(--spacing-4)',
66
+ };
68
67
 
69
68
  // Types
70
69
  type TaskStatus = 'in_progress' | 'todo' | 'backlog' | 'done';
@@ -988,11 +987,8 @@ export default function DataTableTemplate() {
988
987
  e.preventDefault();
989
988
  toggleGroup(key);
990
989
  }
991
- }}
992
- xstyle={[pageStyles.groupHeaderRow]}>
993
- <TableCell
994
- colSpan={COL_COUNT}
995
- xstyle={pageStyles.groupHeaderCell}>
990
+ }}>
991
+ <TableCell colSpan={COL_COUNT} style={groupHeaderCell}>
996
992
  <HStack gap={2} vAlign="center">
997
993
  <Icon
998
994
  icon={
@@ -3,7 +3,6 @@
3
3
  'use client';
4
4
 
5
5
  import {type CSSProperties, type ReactNode} from 'react';
6
- import * as stylex from '@stylexjs/stylex';
7
6
  import {
8
7
  Plus,
9
8
  Search,
@@ -55,10 +54,10 @@ import {
55
54
  ChatSystemMessage,
56
55
  } from '@astryxdesign/core/Chat';
57
56
 
58
- // Styles passed to Astryx components via their `xstyle` prop. These are
59
- // applied by the components themselves, so they work in compiled builds
60
- // and in the live playground preview alike.
61
- const styles = stylex.create({
57
+ // Styles passed to Astryx components via their `style` prop. Astryx components
58
+ // forward the DOM `style` prop, so these work with no CSS compiler — in
59
+ // compiled builds and in the live playground preview alike.
60
+ const styles: Record<string, CSSProperties> = {
62
61
  card: {
63
62
  backgroundColor: 'var(--color-background-body)',
64
63
  color: 'var(--color-text-primary)',
@@ -169,14 +168,11 @@ const styles = stylex.create({
169
168
  cartButton: {
170
169
  flex: 1,
171
170
  },
172
- });
171
+ };
173
172
 
174
173
  // Styles applied directly to plain DOM elements via the `style` prop.
175
- // Kept as inline styles (rather than stylex.create) so they render in the
176
- // playground preview, which can't compile StyleX `stylex.props()` is a
177
- // no-op there, so raw `{...stylex.props(...)}` on a <div>/<img> would lose
178
- // these declarations. All are static (no media/pseudo variants), so inline
179
- // styles reproduce them exactly.
174
+ // Plain inline styles so they render with no CSS compiler. All are static
175
+ // (no media/pseudo variants), so inline styles reproduce them exactly.
180
176
  const inlineStyles: Record<string, CSSProperties> = {
181
177
  inventoryBannerWrap: {
182
178
  paddingInline: 'var(--spacing-6)',
@@ -439,10 +435,10 @@ function StorePreview({
439
435
  />
440
436
 
441
437
  <Section padding={6} variant="transparent">
442
- <VStack gap={10} xstyle={[styles.content, styles.contentFluid]}>
438
+ <VStack gap={10} style={{...styles.content, ...styles.contentFluid}}>
443
439
  <Center>
444
- <VStack gap={4} hAlign="center" xstyle={styles.heroText}>
445
- <Text type="display-2" xstyle={styles.heroHeadline}>
440
+ <VStack gap={4} hAlign="center" style={styles.heroText}>
441
+ <Text type="display-2" style={styles.heroHeadline}>
446
442
  Little joys,
447
443
  <br />
448
444
  everywhere you go
@@ -457,7 +453,7 @@ function StorePreview({
457
453
  <Grid columns={isMobile ? 1 : {minWidth: 200, max: 3}} gap={4}>
458
454
  {products.map((p, i) => (
459
455
  <Card key={p.name} padding={0} height="100%">
460
- <VStack gap={0} xstyle={styles.cardStack}>
456
+ <VStack gap={0} style={styles.cardStack}>
461
457
  <AspectRatio ratio={1}>
462
458
  <img
463
459
  src={images[PRODUCT_IMAGE_KEYS[i]]}
@@ -469,17 +465,17 @@ function StorePreview({
469
465
  <VStack
470
466
  gap={2}
471
467
  hAlign="center"
472
- xstyle={styles.cardStack}>
468
+ style={styles.cardStack}>
473
469
  <HStack>
474
470
  <Badge label={p.badge} variant={p.badgeVariant} />
475
471
  </HStack>
476
- <Heading level={2} xstyle={styles.centerText}>
472
+ <Heading level={2} style={styles.centerText}>
477
473
  {p.name}
478
474
  </Heading>
479
475
  <Text
480
476
  type="supporting"
481
477
  color="secondary"
482
- xstyle={[styles.cardDescription, styles.centerText]}>
478
+ style={{...styles.cardDescription, ...styles.centerText}}>
483
479
  {p.description}
484
480
  </Text>
485
481
  <HStack gap={2} vAlign="center" hAlign="center">
@@ -491,14 +487,14 @@ function StorePreview({
491
487
  min={1}
492
488
  max={99}
493
489
  size="sm"
494
- xstyle={styles.quantityInput}
490
+ style={styles.quantityInput}
495
491
  />
496
492
  <Button
497
493
  label="Add to cart"
498
494
  variant="secondary"
499
495
  size="sm"
500
496
  href="#"
501
- xstyle={styles.cartButton}
497
+ style={styles.cartButton}
502
498
  />
503
499
  </HStack>
504
500
  </VStack>
@@ -516,11 +512,11 @@ function StorePreview({
516
512
 
517
513
  function CheckoutCard({isMobile}: {isMobile: boolean}) {
518
514
  return (
519
- <Card padding={5} xstyle={styles.card}>
520
- <VStack gap={4} xstyle={styles.checkoutStack}>
515
+ <Card padding={5} style={styles.card}>
516
+ <VStack gap={4} style={styles.checkoutStack}>
521
517
  <Heading level={2}>Checkout</Heading>
522
518
 
523
- <VStack gap={3} xstyle={styles.checkoutStack}>
519
+ <VStack gap={3} style={styles.checkoutStack}>
524
520
  <TextInput
525
521
  label="Email"
526
522
  placeholder="you@studio.com"
@@ -566,7 +562,7 @@ function CheckoutCard({isMobile}: {isMobile: boolean}) {
566
562
  />
567
563
  </RadioList>
568
564
 
569
- <VStack gap={2} xstyle={styles.checkoutStack}>
565
+ <VStack gap={2} style={styles.checkoutStack}>
570
566
  <Text type="supporting" weight="bold">
571
567
  Payment method
572
568
  </Text>
@@ -579,7 +575,7 @@ function CheckoutCard({isMobile}: {isMobile: boolean}) {
579
575
  <VStack
580
576
  gap={1}
581
577
  hAlign="center"
582
- xstyle={styles.paymentCardContent}>
578
+ style={styles.paymentCardContent}>
583
579
  <CreditCard size={20} />
584
580
  <Text type="supporting" weight="bold">
585
581
  Card
@@ -594,7 +590,7 @@ function CheckoutCard({isMobile}: {isMobile: boolean}) {
594
590
  <VStack
595
591
  gap={1}
596
592
  hAlign="center"
597
- xstyle={styles.paymentCardContent}>
593
+ style={styles.paymentCardContent}>
598
594
  <Smartphone size={20} />
599
595
  <Text type="supporting" weight="bold">
600
596
  Apple Pay
@@ -609,7 +605,7 @@ function CheckoutCard({isMobile}: {isMobile: boolean}) {
609
605
  <VStack
610
606
  gap={1}
611
607
  hAlign="center"
612
- xstyle={styles.paymentCardContent}>
608
+ style={styles.paymentCardContent}>
613
609
  <Wallet size={20} />
614
610
  <Text type="supporting" weight="bold">
615
611
  Google Pay
@@ -687,12 +683,12 @@ const SUGGESTED_QUESTIONS = [
687
683
 
688
684
  function ChatCard() {
689
685
  return (
690
- <Card padding={0} xstyle={styles.chatCard}>
686
+ <Card padding={0} style={styles.chatCard}>
691
687
  <HStack
692
688
  hAlign="between"
693
689
  vAlign="center"
694
690
  gap={3}
695
- xstyle={styles.chatHeader}>
691
+ style={styles.chatHeader}>
696
692
  <Heading level={2}>Studio AI</Heading>
697
693
 
698
694
  <HStack gap={1} vAlign="center">
@@ -894,8 +890,8 @@ function formatAmount(amount: number): string {
894
890
 
895
891
  function LatestActivityCard({isMobile}: {isMobile: boolean}) {
896
892
  return (
897
- <Card padding={5} xstyle={styles.activityCard}>
898
- <VStack gap={4} xstyle={styles.activityCardStack}>
893
+ <Card padding={5} style={styles.activityCard}>
894
+ <VStack gap={4} style={styles.activityCardStack}>
899
895
  <Heading level={2}>Revenue</Heading>
900
896
 
901
897
  <Grid columns={isMobile ? 1 : 2} gap={3}>
@@ -920,7 +916,7 @@ function LatestActivityCard({isMobile}: {isMobile: boolean}) {
920
916
  <Link href="#">See all</Link>
921
917
  </HStack>
922
918
 
923
- <VStack gap={1} xstyle={styles.activityListFade}>
919
+ <VStack gap={1} style={styles.activityListFade}>
924
920
  {ACTIVITY.map(item => (
925
921
  <Item
926
922
  key={item.id}
@@ -1110,11 +1106,11 @@ function InventoryCard({
1110
1106
  row => row.available < LOW_STOCK_THRESHOLD,
1111
1107
  ).length;
1112
1108
  return (
1113
- <Card padding={0} xstyle={styles.inventoryCard}>
1109
+ <Card padding={0} style={styles.inventoryCard}>
1114
1110
  <HStack
1115
1111
  hAlign="between"
1116
1112
  vAlign="center"
1117
- xstyle={styles.inventoryHeader}>
1113
+ style={styles.inventoryHeader}>
1118
1114
  <Heading level={2}>Inventory</Heading>
1119
1115
  <Button
1120
1116
  label="Add item"
@@ -1130,7 +1126,7 @@ function InventoryCard({
1130
1126
  gap={3}
1131
1127
  vAlign="center"
1132
1128
  hAlign="between"
1133
- xstyle={styles.inventoryFilterRow}>
1129
+ style={styles.inventoryFilterRow}>
1134
1130
  <HStack gap={2} vAlign="center" style={{flex: 1, minWidth: 0}}>
1135
1131
  <TextInput
1136
1132
  label="Search inventory"
@@ -1139,7 +1135,7 @@ function InventoryCard({
1139
1135
  value=""
1140
1136
  onChange={() => {}}
1141
1137
  startIcon={<Search size={16} />}
1142
- xstyle={styles.searchInput}
1138
+ style={styles.searchInput}
1143
1139
  />
1144
1140
  <OverflowList
1145
1141
  gap={2}
@@ -1226,7 +1222,7 @@ function InventoryCard({
1226
1222
  </div>
1227
1223
  )}
1228
1224
 
1229
- <div {...stylex.props(styles.inventoryTableWrap)}>
1225
+ <div style={styles.inventoryTableWrap}>
1230
1226
  <Table<InventoryRow>
1231
1227
  data={inventory}
1232
1228
  columns={[