@astryxdesign/cli 0.1.0 → 0.1.1

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 (140) 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 +2 -2
  14. package/src/api/doctor.mjs +3 -3
  15. package/src/api/search.mjs +207 -13
  16. package/src/api/template.mjs +2 -1
  17. package/src/codemods/__tests__/registry.test.mjs +1 -0
  18. package/src/codemods/registry.mjs +1 -0
  19. package/src/codemods/runner.mjs +105 -51
  20. package/src/codemods/transforms/v0.1.0/__tests__/migrate-xds-config-surfaces.test.mjs +116 -0
  21. package/src/codemods/transforms/v0.1.0/__tests__/migrate-xds-module-specifiers.test.mjs +51 -0
  22. package/src/codemods/transforms/v0.1.0/index.mjs +28 -0
  23. package/src/codemods/transforms/v0.1.0/migrate-xds-config-surfaces.mjs +230 -0
  24. package/src/codemods/transforms/v0.1.0/migrate-xds-module-specifiers.mjs +84 -0
  25. package/src/commands/agent-docs.mjs +119 -66
  26. package/src/commands/agent-docs.path-safety.test.mjs +1 -1
  27. package/src/commands/agent-docs.test.mjs +87 -31
  28. package/src/commands/build-theme.import-path.test.mjs +1 -1
  29. package/src/commands/build-theme.path-safety.test.mjs +1 -1
  30. package/src/commands/build-theme.prose.test.mjs +1 -1
  31. package/src/commands/build.mjs +196 -0
  32. package/src/commands/component-package.test.mjs +1 -1
  33. package/src/commands/component.test.mjs +1 -1
  34. package/src/commands/docs.test.mjs +1 -1
  35. package/src/commands/doctor.test.mjs +1 -1
  36. package/src/commands/external-showcase.test.mjs +1 -1
  37. package/src/commands/init.mjs +10 -2
  38. package/src/commands/interactive-guard.test.mjs +1 -1
  39. package/src/commands/json-contract.test.mjs +10 -3
  40. package/src/commands/swizzle-gap-safety.test.mjs +1 -1
  41. package/src/commands/swizzle.path-safety.test.mjs +1 -1
  42. package/src/commands/template.path-safety.test.mjs +1 -1
  43. package/src/commands/template.test.mjs +1 -1
  44. package/src/commands/upgrade.mjs +353 -169
  45. package/src/commands/upgrade.test.mjs +41 -27
  46. package/src/index.mjs +1 -0
  47. package/src/lib/config.mjs +12 -0
  48. package/src/lib/config.test.mjs +42 -0
  49. package/src/lib/error-codes.mjs +3 -0
  50. package/src/types/error-codes.d.ts +1 -0
  51. package/src/utils/interactive.mjs +1 -1
  52. package/src/utils/interactive.test.mjs +2 -0
  53. package/src/utils/package-manager.mjs +1 -1
  54. package/src/utils/package-manager.test.mjs +1 -1
  55. package/src/utils/path-safety.test.mjs +1 -1
  56. package/src/utils/paths.test.mjs +8 -8
  57. package/src/utils/update-check.mjs +4 -26
  58. package/src/utils/update-check.test.mjs +2 -64
  59. package/templates/blocks/components/AppShell/AppShellContentOnly.tsx +1 -9
  60. package/templates/blocks/components/AppShell/AppShellShowcase.tsx +1 -10
  61. package/templates/blocks/components/AppShell/AppShellSideNavOnly.tsx +1 -9
  62. package/templates/blocks/components/AppShell/AppShellTopNavOnly.tsx +1 -9
  63. package/templates/blocks/components/AppShell/AppShellTopNavWithSideNav.tsx +1 -9
  64. package/templates/blocks/components/AppShell/AppShellWithBanner.tsx +1 -9
  65. package/templates/blocks/components/AspectRatio/AspectRatioShowcase.tsx +12 -19
  66. package/templates/blocks/components/Banner/BannerShowcase.tsx +1 -8
  67. package/templates/blocks/components/Blockquote/BlockquoteShowcase.tsx +1 -8
  68. package/templates/blocks/components/Carousel/CarouselShowcase.tsx +2 -12
  69. package/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerShowcase.tsx +6 -9
  70. package/templates/blocks/components/ChatLayout/ChatLayoutPanelChat.tsx +10 -12
  71. package/templates/blocks/components/ChatMessageList/ChatMessageListDensity.tsx +1 -9
  72. package/templates/blocks/components/ChatMessageList/ChatMessageListFullFeatured.tsx +1 -9
  73. package/templates/blocks/components/ChatMessageList/ChatMessageListShowcase.tsx +1 -9
  74. package/templates/blocks/components/ChatMessageMetadata/ChatMessageMetadataShowcase.tsx +1 -8
  75. package/templates/blocks/components/ChatSendButton/ChatSendButtonInComposer.tsx +1 -8
  76. package/templates/blocks/components/Citation/CitationInlineText.tsx +4 -4
  77. package/templates/blocks/components/Code/CodeInlineInParagraph.tsx +1 -8
  78. package/templates/blocks/components/CodeBlock/CodeBlockBashCommand.tsx +1 -1
  79. package/templates/blocks/components/CodeBlock/CodeBlockJSONConfig.tsx +1 -1
  80. package/templates/blocks/components/CommandPaletteItem/CommandPaletteItemShowcase.tsx +9 -12
  81. package/templates/blocks/components/ContextMenu/ContextMenuShowcase.tsx +13 -15
  82. package/templates/blocks/components/Divider/DividerShowcase.tsx +1 -8
  83. package/templates/blocks/components/Divider/DividerVertical.tsx +7 -9
  84. package/templates/blocks/components/Field/FieldShowcase.tsx +1 -8
  85. package/templates/blocks/components/FormLayout/FormLayoutHorizontal.tsx +1 -6
  86. package/templates/blocks/components/Grid/GridResponsiveAutoFit.tsx +1 -9
  87. package/templates/blocks/components/HoverCard/HoverCardInlineTextHoverCard.tsx +4 -6
  88. package/templates/blocks/components/HoverCard/HoverCardInteractiveContent.tsx +1 -6
  89. package/templates/blocks/components/HoverCard/HoverCardProfileHoverCard.tsx +2 -8
  90. package/templates/blocks/components/HoverCard/HoverCardShowcase.tsx +1 -8
  91. package/templates/blocks/components/MoreMenu/MoreMenuInToolbar.tsx +2 -12
  92. package/templates/blocks/components/OverflowList/OverflowListOverflowBadges.tsx +8 -11
  93. package/templates/blocks/components/OverflowList/OverflowListOverflowDropdownActions.tsx +9 -12
  94. package/templates/blocks/components/Overlay/OverlayBottomStrip.tsx +4 -17
  95. package/templates/blocks/components/Overlay/OverlayHoverReveal.tsx +15 -16
  96. package/templates/blocks/components/Overlay/OverlayShowcase.tsx +5 -21
  97. package/templates/blocks/components/Pagination/PaginationDotsCarousel.tsx +2 -14
  98. package/templates/blocks/components/Pagination/PaginationPageSize.tsx +12 -14
  99. package/templates/blocks/components/Pagination/PaginationVariants.tsx +1 -8
  100. package/templates/blocks/components/Pagination/PaginationWithTable.tsx +2 -14
  101. package/templates/blocks/components/Tokenizer/TokenizerClear.tsx +1 -6
  102. package/templates/blocks/components/Tokenizer/TokenizerCreatable.tsx +2 -7
  103. package/templates/blocks/components/Tokenizer/TokenizerEndContent.tsx +1 -6
  104. package/templates/blocks/components/Tokenizer/TokenizerIcon.tsx +1 -6
  105. package/templates/blocks/components/Tokenizer/TokenizerMaxEntries.tsx +1 -6
  106. package/templates/blocks/components/Tokenizer/TokenizerOverflow.tsx +2 -7
  107. package/templates/blocks/components/Tokenizer/TokenizerShowcase.tsx +1 -6
  108. package/templates/blocks/components/Tokenizer/TokenizerStates.tsx +4 -9
  109. package/templates/blocks/components/Toolbar/ToolbarCardHeader.tsx +1 -10
  110. package/templates/blocks/components/Toolbar/ToolbarSizes.tsx +1 -8
  111. package/templates/blocks/components/Toolbar/ToolbarTableFilter.tsx +1 -8
  112. package/templates/blocks/components/Toolbar/ToolbarThreeSlot.tsx +1 -10
  113. package/templates/blocks/components/Toolbar/ToolbarWithTabs.tsx +8 -11
  114. package/templates/pages/ai-chat/page.tsx +71 -64
  115. package/templates/pages/ai-chat-landing/page.tsx +8 -12
  116. package/templates/pages/centered-hero/page.tsx +13 -15
  117. package/templates/pages/classic-gallery/page.tsx +27 -34
  118. package/templates/pages/detail-page/page.tsx +18 -18
  119. package/templates/pages/documentation/page.tsx +42 -58
  120. package/templates/pages/documentation-design/page.tsx +82 -60
  121. package/templates/pages/documentation-technical/page.tsx +101 -60
  122. package/templates/pages/editor/page.tsx +42 -54
  123. package/templates/pages/file-explorer/page.tsx +13 -16
  124. package/templates/pages/form-two-column/page.tsx +13 -17
  125. package/templates/pages/gallery-hero/page.tsx +13 -15
  126. package/templates/pages/ide/page.tsx +188 -264
  127. package/templates/pages/library/page.tsx +16 -23
  128. package/templates/pages/login/page.tsx +14 -18
  129. package/templates/pages/login-card/page.tsx +14 -18
  130. package/templates/pages/login-split/page.tsx +50 -48
  131. package/templates/pages/login-sso/page.tsx +9 -13
  132. package/templates/pages/mixed-gallery/page.tsx +51 -45
  133. package/templates/pages/payment-form/page.tsx +56 -70
  134. package/templates/pages/product-detail/page.tsx +27 -33
  135. package/templates/pages/product-gallery/page.tsx +7 -13
  136. package/templates/pages/settings-dialog/page.tsx +35 -43
  137. package/templates/pages/settings-sidebar/page.tsx +39 -47
  138. package/templates/pages/side-gallery/page.tsx +6 -9
  139. package/templates/pages/table-grouped/page.tsx +11 -15
  140. package/templates/pages/theme-showcase/page.tsx +33 -37
@@ -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 ratio={ratio} xstyle={s.ratioBox}>
53
- <img src={src} alt={alt} {...stylex.props(s.image)} />
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} xstyle={styles.root}>
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} xstyle={styles.root}>
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
- xstyle={styles.root}>
25
+ style={{maxWidth: 500}}>
36
26
  {ITEMS.map(item => (
37
- <Card key={item.title} padding={3} xstyle={styles.card}>
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 * as stylex from '@stylexjs/stylex';
12
- import {colorVars, borderVars, radiusVars} from '@astryxdesign/core/theme/tokens.stylex';
11
+ import type {CSSProperties} from 'react';
13
12
 
14
- const styles = stylex.create({
15
- drawerBorder: {
16
- border: `${borderVars['--border-width']} solid ${colorVars['--color-border']}`,
17
- borderRadius: radiusVars['--radius-chat'],
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
- xstyle={styles.drawerBorder}>
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 * as stylex from '@stylexjs/stylex';
15
-
16
- const styles = stylex.create({
17
- panel: {
18
- width: 450,
19
- height: 600,
20
- borderRadius: 8,
21
- overflow: 'hidden',
22
- border: '1px solid var(--color-border)',
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 {...stylex.props(styles.panel)}>
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 xstyle={styles.section}>
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 xstyle={styles.container}>
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 xstyle={styles.container}>
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 xstyle={styles.container}>
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%" xstyle={styles.root}>
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
- StyleX compiles atomic CSS at build time for optimal performance
28
+ TypeScript adds static types to JavaScript for safer refactoring
29
29
  <Citation
30
30
  source={{
31
- title: 'StyleX Documentation',
32
- url: 'https://stylexjs.com',
33
- icon: 'https://stylexjs.com/img/favicon.ico',
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" xstyle={styles.root}>Use <Code>useState</Code>for local state and{' '}
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.
@@ -15,7 +15,7 @@ export default function CodeBlockBashCommand() {
15
15
  style={{width: '100%'}}
16
16
  />
17
17
  <CodeBlock
18
- code="yarn add @stylexjs/stylex"
18
+ code="yarn add @astryxdesign/theme-neutral"
19
19
  language="bash"
20
20
  hasCopyButton
21
21
  style={{width: '100%'}}
@@ -8,7 +8,7 @@ const code = `{
8
8
  "name": "@astryxdesign/core",
9
9
  "version": "0.0.5",
10
10
  "dependencies": {
11
- "@stylexjs/stylex": "^0.17.5",
11
+ "@astryxdesign/theme-neutral": "^0.1.0",
12
12
  "react": "^19.0.0"
13
13
  },
14
14
  "scripts": {
@@ -2,7 +2,7 @@
2
2
 
3
3
  'use client';
4
4
 
5
- import {useMemo} from 'react';
5
+ import {useMemo, type CSSProperties} from 'react';
6
6
  import {
7
7
  CommandPalette,
8
8
  CommandPaletteList,
@@ -14,13 +14,10 @@ import {Icon} from '@astryxdesign/core/Icon';
14
14
  import {createStaticSource} from '@astryxdesign/core/Typeahead';
15
15
  import {Stack} from '@astryxdesign/core/Layout';
16
16
  import type {SearchableItem} from '@astryxdesign/core/Typeahead';
17
- import * as stylex from '@stylexjs/stylex';
18
17
 
19
- const styles = stylex.create({
20
- itemLabel: {
21
- flexGrow: 1,
22
- },
23
- });
18
+ const itemLabel: CSSProperties = {
19
+ flexGrow: 1,
20
+ };
24
21
 
25
22
  type CommandItem = SearchableItem<{shortcut?: string}>;
26
23
 
@@ -48,7 +45,7 @@ export default function CommandPaletteItemShowcase() {
48
45
  searchSource={source}
49
46
  renderItem={(item: CommandItem) => (
50
47
  <>
51
- <Text type="body" xstyle={styles.itemLabel}>
48
+ <Text type="body" style={itemLabel}>
52
49
  {item.label}
53
50
  </Text>
54
51
  {item.auxiliaryData?.shortcut && (
@@ -65,18 +62,18 @@ export default function CommandPaletteItemShowcase() {
65
62
  <CommandPaletteList>
66
63
  <CommandPaletteItem value="home" onSelect={() => {}}>
67
64
  <Icon icon="externalLink" size="sm" />
68
- <Text type="body" xstyle={styles.itemLabel}>Home</Text>
65
+ <Text type="body" style={itemLabel}>Home</Text>
69
66
  </CommandPaletteItem>
70
67
  <CommandPaletteItem value="search" isHighlighted onSelect={() => {}}>
71
68
  <Icon icon="search" size="sm" />
72
- <Text type="body" xstyle={styles.itemLabel}>Search (highlighted)</Text>
69
+ <Text type="body" style={itemLabel}>Search (highlighted)</Text>
73
70
  </CommandPaletteItem>
74
71
  <CommandPaletteItem value="selected" isSelected onSelect={() => {}}>
75
72
  <Icon icon="check" size="sm" />
76
- <Text type="body" xstyle={styles.itemLabel}>Selected item</Text>
73
+ <Text type="body" style={itemLabel}>Selected item</Text>
77
74
  </CommandPaletteItem>
78
75
  <CommandPaletteItem value="disabled" isDisabled>
79
- <Text type="body" xstyle={styles.itemLabel}>Disabled item</Text>
76
+ <Text type="body" style={itemLabel}>Disabled item</Text>
80
77
  </CommandPaletteItem>
81
78
  </CommandPaletteList>
82
79
  </Stack>
@@ -1,22 +1,8 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
  'use client';
3
3
 
4
- import * as stylex from '@stylexjs/stylex';
5
4
  import {ContextMenu} from '@astryxdesign/core/ContextMenu';
6
5
 
7
- const styles = stylex.create({
8
- area: {
9
- padding: '48px',
10
- borderWidth: '2px',
11
- borderStyle: 'dashed',
12
- borderColor: '#d1d5db',
13
- borderRadius: '8px',
14
- textAlign: 'center',
15
- color: '#6b7280',
16
- userSelect: 'none',
17
- },
18
- });
19
-
20
6
  export default function ContextMenuShowcase() {
21
7
  return (
22
8
  <ContextMenu
@@ -25,7 +11,19 @@ export default function ContextMenuShowcase() {
25
11
  {label: 'Copy', onClick: () => {}},
26
12
  {label: 'Paste', onClick: () => {}},
27
13
  ]}>
28
- <div {...stylex.props(styles.area)}>Right-click this area</div>
14
+ <div
15
+ style={{
16
+ padding: '48px',
17
+ borderWidth: '2px',
18
+ borderStyle: 'dashed',
19
+ borderColor: '#d1d5db',
20
+ borderRadius: '8px',
21
+ textAlign: 'center',
22
+ color: '#6b7280',
23
+ userSelect: 'none',
24
+ }}>
25
+ Right-click this area
26
+ </div>
29
27
  </ContextMenu>
30
28
  );
31
29
  }
@@ -4,17 +4,10 @@
4
4
 
5
5
  import {Divider} from '@astryxdesign/core/Divider';
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 DividerShowcase() {
16
9
  return (
17
- <Stack direction="vertical" gap={4} xstyle={styles.root}>
10
+ <Stack direction="vertical" gap={4} style={{width: 500}}>
18
11
  <Divider variant="subtle" />
19
12
  <Divider variant="strong" />
20
13
  <Divider label="or" />
@@ -2,19 +2,17 @@
2
2
 
3
3
  'use client';
4
4
 
5
- import * as stylex from '@stylexjs/stylex';
5
+ import type {CSSProperties} from 'react';
6
6
  import {Divider} from '@astryxdesign/core/Divider';
7
7
  import {Card} from '@astryxdesign/core/Card';
8
8
  import {Section} from '@astryxdesign/core/Section';
9
9
  import {HStack, VStack, StackItem} from '@astryxdesign/core/Layout';
10
10
  import {Text} from '@astryxdesign/core/Text';
11
11
 
12
- const styles = stylex.create({
13
- dividerFill: {
14
- alignSelf: 'stretch',
15
- height: 'auto',
16
- },
17
- });
12
+ const dividerFill: CSSProperties = {
13
+ alignSelf: 'stretch',
14
+ height: 'auto',
15
+ };
18
16
 
19
17
  export default function DividerVertical() {
20
18
  return (
@@ -30,7 +28,7 @@ export default function DividerVertical() {
30
28
  </Text>
31
29
  </VStack>
32
30
  </StackItem>
33
- <Divider orientation="vertical" xstyle={styles.dividerFill} />
31
+ <Divider orientation="vertical" style={dividerFill} />
34
32
  <StackItem size="fill">
35
33
  <VStack gap={1}>
36
34
  <Text type="label">Users</Text>
@@ -40,7 +38,7 @@ export default function DividerVertical() {
40
38
  </Text>
41
39
  </VStack>
42
40
  </StackItem>
43
- <Divider orientation="vertical" xstyle={styles.dividerFill} />
41
+ <Divider orientation="vertical" style={dividerFill} />
44
42
  <StackItem size="fill">
45
43
  <VStack gap={1}>
46
44
  <Text type="label">Conversion</Text>
@@ -6,13 +6,6 @@ import {useState} from 'react';
6
6
  import {Field} from '@astryxdesign/core/Field';
7
7
  import {TextInput} from '@astryxdesign/core/TextInput';
8
8
  import {Stack} from '@astryxdesign/core/Layout';
9
- import * as stylex from '@stylexjs/stylex';
10
-
11
- const styles = stylex.create({
12
- root: {
13
- width: 320,
14
- },
15
- });
16
9
 
17
10
  export default function FieldShowcase() {
18
11
  const [email, setEmail] = useState('');
@@ -23,7 +16,7 @@ export default function FieldShowcase() {
23
16
  : undefined;
24
17
 
25
18
  return (
26
- <Stack direction="vertical" gap={3} xstyle={styles.root}>
19
+ <Stack direction="vertical" gap={3} style={{width: 320}}>
27
20
  <Field
28
21
  label="Email"
29
22
  inputID="field-email"
@@ -3,20 +3,15 @@
3
3
  'use client';
4
4
 
5
5
  import {useState} from 'react';
6
- import * as stylex from '@stylexjs/stylex';
7
6
  import {FormLayout} from '@astryxdesign/core/FormLayout';
8
7
  import {TextInput} from '@astryxdesign/core/TextInput';
9
8
 
10
- const styles = stylex.create({
11
- layout: {width: '100%', maxWidth: 400},
12
- });
13
-
14
9
  export default function FormLayoutHorizontal() {
15
10
  const [first, setFirst] = useState('Jordan');
16
11
  const [last, setLast] = useState('Rivera');
17
12
 
18
13
  return (
19
- <FormLayout direction="horizontal" xstyle={styles.layout}>
14
+ <FormLayout direction="horizontal" style={{width: '100%', maxWidth: 400}}>
20
15
  <TextInput label="First Name" value={first} onChange={setFirst} />
21
16
  <TextInput label="Last Name" value={last} onChange={setLast} />
22
17
  </FormLayout>
@@ -2,20 +2,12 @@
2
2
 
3
3
  'use client';
4
4
 
5
- import {spacingVars} from '@astryxdesign/core/theme/tokens.stylex';
6
5
  import {Grid} from '@astryxdesign/core/Grid';
7
6
  import {Card} from '@astryxdesign/core/Card';
8
7
  import {Layout, LayoutContent, LayoutPanel} from '@astryxdesign/core/Layout';
9
8
  import {useResizable, ResizeHandle} from '@astryxdesign/core/Resizable';
10
9
  import {VStack} from '@astryxdesign/core/Stack';
11
10
  import {Text} from '@astryxdesign/core/Text';
12
- import * as stylex from '@stylexjs/stylex';
13
-
14
- const styles = stylex.create({
15
- panel: {
16
- padding: spacingVars['--spacing-4'],
17
- },
18
- });
19
11
 
20
12
  const teams = [
21
13
  {name: 'Design Systems', members: 8},
@@ -47,7 +39,7 @@ export default function GridResponsiveAutoFit() {
47
39
  <LayoutPanel
48
40
  width={gridPanel.size}
49
41
  hasDivider={false}
50
- xstyle={styles.panel}>
42
+ style={{padding: 'var(--spacing-4)'}}>
51
43
  <Grid
52
44
  columns={{minWidth: 180, repeat: 'fit'}}
53
45
  gap={4}
@@ -2,21 +2,19 @@
2
2
 
3
3
  'use client';
4
4
 
5
- import * as stylex from '@stylexjs/stylex';
5
+ import type {CSSProperties} from 'react';
6
6
  import {HoverCard} from '@astryxdesign/core/HoverCard';
7
7
  import {VStack} from '@astryxdesign/core/Layout';
8
8
  import {Text} from '@astryxdesign/core/Text';
9
9
 
10
- const styles = stylex.create({
11
- content: {maxWidth: 200},
12
- });
10
+ const content: CSSProperties = {maxWidth: 200};
13
11
 
14
12
  export default function HoverCardInlineTextHoverCard() {
15
13
  return (
16
14
  <Text type="body">The component uses a{' '}
17
15
  <HoverCard
18
16
  content={
19
- <VStack gap={1} xstyle={styles.content}>
17
+ <VStack gap={1} style={content}>
20
18
  <Text type="label">Focus trap</Text>
21
19
  <Text type="body" color="secondary">
22
20
  A pattern that keeps keyboard focus inside a container, preventing
@@ -30,7 +28,7 @@ export default function HoverCardInlineTextHoverCard() {
30
28
  </HoverCard>{' '}to keep keyboard navigation inside the{' '}
31
29
  <HoverCard
32
30
  content={
33
- <VStack gap={1} xstyle={styles.content}>
31
+ <VStack gap={1} style={content}>
34
32
  <Text type="label">Modal dialog</Text>
35
33
  <Text type="body" color="secondary">
36
34
  An overlay that blocks interaction with the rest of the page until
@@ -2,24 +2,19 @@
2
2
 
3
3
  'use client';
4
4
 
5
- import * as stylex from '@stylexjs/stylex';
6
5
  import {HoverCard} from '@astryxdesign/core/HoverCard';
7
6
  import {Icon} from '@astryxdesign/core/Icon';
8
7
  import {VStack, HStack} from '@astryxdesign/core/Layout';
9
8
  import {Text} from '@astryxdesign/core/Text';
10
9
  import {LinkIcon} from '@heroicons/react/24/outline';
11
10
 
12
- const styles = stylex.create({
13
- content: {maxWidth: 280},
14
- });
15
-
16
11
  export default function HoverCardInteractiveContent() {
17
12
  return (
18
13
  <Text type="body">Read more in the{' '}
19
14
  <HoverCard
20
15
  placement="below"
21
16
  content={
22
- <VStack gap={2} xstyle={styles.content}>
17
+ <VStack gap={2} style={{maxWidth: 280}}>
23
18
  <HStack gap={2} vAlign="start">
24
19
  <Icon icon={LinkIcon} size="sm" color="secondary" />
25
20
  <VStack gap={1}>