@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
@@ -0,0 +1,26 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ import {useMemo} from 'react';
6
+ import {CommandPalette} from '@astryxdesign/core/CommandPalette';
7
+ import {Text} from '@astryxdesign/core/Text';
8
+ import {createStaticSource} from '@astryxdesign/core/Typeahead';
9
+
10
+ export default function CommandPaletteEmptyShowcase() {
11
+ const emptySource = useMemo(() => createStaticSource([]), []);
12
+
13
+ return (
14
+ <CommandPalette
15
+ isOpen
16
+ isInline
17
+ onOpenChange={() => {}}
18
+ searchSource={emptySource}
19
+ emptyBootstrapText={
20
+ <Text type="supporting" color="secondary">
21
+ No commands available yet
22
+ </Text>
23
+ }
24
+ />
25
+ );
26
+ }
@@ -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,8 +4,8 @@
4
4
  export const doc = {
5
5
  type: 'block',
6
6
  exampleFor: 'DateInput',
7
- name: 'DateInput — Date Range',
8
- displayName: 'DateInput — Date Range',
7
+ name: 'DateInput — Min/Max Constraints',
8
+ displayName: 'DateInput — Min/Max Constraints',
9
9
  description:
10
10
  'Date input constrained to a min/max window. Use when only certain dates are valid, like booking availability or a fiscal quarter.',
11
11
  isReady: true,
@@ -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}>
@@ -2,7 +2,6 @@
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 {Avatar} from '@astryxdesign/core/Avatar';
8
7
  import {Button} from '@astryxdesign/core/Button';
@@ -11,18 +10,13 @@ import {VStack, HStack} from '@astryxdesign/core/Layout';
11
10
  import {Text, Heading} from '@astryxdesign/core/Text';
12
11
  import {CalendarIcon} from '@heroicons/react/24/outline';
13
12
 
14
- const styles = stylex.create({
15
- avatar: {flexShrink: 0},
16
- content: {maxWidth: 280},
17
- });
18
-
19
13
  export default function HoverCardProfileHoverCard() {
20
14
  return (
21
15
  <HoverCard
22
16
  placement="below"
23
17
  content={
24
- <HStack gap={3} vAlign="start" xstyle={styles.content}>
25
- <Avatar name="Jane Doe" size={48} xstyle={styles.avatar} />
18
+ <HStack gap={3} vAlign="start" style={{maxWidth: 280}}>
19
+ <Avatar name="Jane Doe" size={48} style={{flexShrink: 0}} />
26
20
  <VStack gap={1}>
27
21
  <Heading level={3}>@janedoe</Heading>
28
22
  <Text type="body" color="secondary">
@@ -7,20 +7,13 @@ import {Button} from '@astryxdesign/core/Button';
7
7
  import {Stack} from '@astryxdesign/core/Layout';
8
8
  import {Text, Heading} from '@astryxdesign/core/Text';
9
9
  import {Avatar} from '@astryxdesign/core/Avatar';
10
- import * as stylex from '@stylexjs/stylex';
11
-
12
- const styles = stylex.create({
13
- card: {
14
- width: 240,
15
- },
16
- });
17
10
 
18
11
  export default function HoverCardShowcase() {
19
12
  return (
20
13
  <HoverCard
21
14
  placement="above"
22
15
  content={
23
- <Stack direction="vertical" gap={2} xstyle={styles.card}>
16
+ <Stack direction="vertical" gap={2} style={{width: 240}}>
24
17
  <Stack direction="horizontal" gap={2} vAlign="center">
25
18
  <Avatar name="Jane Doe" size="medium" />
26
19
  <Stack direction="vertical" gap={0}>
@@ -2,23 +2,20 @@
2
2
 
3
3
  'use client';
4
4
 
5
- import * as stylex from '@stylexjs/stylex';
6
5
  import {OverflowList} from '@astryxdesign/core/OverflowList';
7
6
  import {Badge} from '@astryxdesign/core/Badge';
8
7
  import {Card} from '@astryxdesign/core/Card';
9
8
 
10
- const styles = stylex.create({
11
- resizable: {
12
- resize: 'horizontal',
13
- overflow: 'hidden',
14
- minWidth: 80,
15
- width: 300,
16
- },
17
- });
18
-
19
9
  export default function OverflowListOverflowBadges() {
20
10
  return (
21
- <Card padding={2} xstyle={styles.resizable}>
11
+ <Card
12
+ padding={2}
13
+ style={{
14
+ resize: 'horizontal',
15
+ overflow: 'hidden',
16
+ minWidth: 80,
17
+ width: 300,
18
+ }}>
22
19
  <OverflowList
23
20
  gap={1}
24
21
  overflowRenderer={overflowItems => (
@@ -2,7 +2,6 @@
2
2
 
3
3
  'use client';
4
4
 
5
- import * as stylex from '@stylexjs/stylex';
6
5
  import {OverflowList} from '@astryxdesign/core/OverflowList';
7
6
  import {Button} from '@astryxdesign/core/Button';
8
7
  import {DropdownMenu} from '@astryxdesign/core/DropdownMenu';
@@ -10,19 +9,17 @@ import {Card} from '@astryxdesign/core/Card';
10
9
 
11
10
  const actions = ['Save', 'Edit', 'Duplicate', 'Share', 'Archive', 'Delete'];
12
11
 
13
- const styles = stylex.create({
14
- resizable: {
15
- resize: 'horizontal',
16
- overflow: 'hidden',
17
- minWidth: 100,
18
- width: 350,
19
- maxWidth: '100%',
20
- },
21
- });
22
-
23
12
  export default function OverflowListOverflowDropdownActions() {
24
13
  return (
25
- <Card padding={2} xstyle={styles.resizable}>
14
+ <Card
15
+ padding={2}
16
+ style={{
17
+ resize: 'horizontal',
18
+ overflow: 'hidden',
19
+ minWidth: 100,
20
+ width: 350,
21
+ maxWidth: '100%',
22
+ }}>
26
23
  <OverflowList
27
24
  gap={2}
28
25
  overflowRenderer={overflowItems => (
@@ -2,27 +2,12 @@
2
2
 
3
3
  'use client';
4
4
 
5
- import * as stylex from '@stylexjs/stylex';
6
5
  import {Overlay} from '@astryxdesign/core/Overlay';
7
6
  import {AspectRatio} from '@astryxdesign/core/AspectRatio';
8
7
  import {Badge} from '@astryxdesign/core/Badge';
9
8
  import {VStack} from '@astryxdesign/core/Layout';
10
9
  import {Text} from '@astryxdesign/core/Text';
11
10
 
12
- const styles = stylex.create({
13
- frame: {
14
- width: 420,
15
- maxWidth: '100%',
16
- borderRadius: 12,
17
- overflow: 'clip',
18
- },
19
- image: {
20
- width: '100%',
21
- height: '100%',
22
- objectFit: 'cover',
23
- },
24
- });
25
-
26
11
  export default function OverlayBottomStrip() {
27
12
  return (
28
13
  <Overlay
@@ -39,11 +24,13 @@ export default function OverlayBottomStrip() {
39
24
  </Text>
40
25
  </VStack>
41
26
  }>
42
- <AspectRatio ratio={16 / 9} xstyle={styles.frame}>
27
+ <AspectRatio
28
+ ratio={16 / 9}
29
+ style={{width: 420, maxWidth: '100%', borderRadius: 12, overflow: 'clip'}}>
43
30
  <img
44
31
  src="https://lookaside.facebook.com/assets/astryx/illustrative-horizontal-1.png"
45
32
  alt="Product highlight preview"
46
- {...stylex.props(styles.image)}
33
+ style={{width: '100%', height: '100%', objectFit: 'cover'}}
47
34
  />
48
35
  </AspectRatio>
49
36
  </Overlay>
@@ -2,24 +2,23 @@
2
2
 
3
3
  'use client';
4
4
 
5
- import * as stylex from '@stylexjs/stylex';
5
+ import type {CSSProperties} from 'react';
6
6
  import {Overlay} from '@astryxdesign/core/Overlay';
7
7
  import {AspectRatio} from '@astryxdesign/core/AspectRatio';
8
8
  import {Button} from '@astryxdesign/core/Button';
9
9
 
10
- const styles = stylex.create({
11
- frame: {
12
- width: 420,
13
- maxWidth: '100%',
14
- borderRadius: 12,
15
- overflow: 'clip',
16
- },
17
- image: {
18
- width: '100%',
19
- height: '100%',
20
- objectFit: 'cover',
21
- },
22
- });
10
+ const frame: CSSProperties = {
11
+ width: 420,
12
+ maxWidth: '100%',
13
+ borderRadius: 12,
14
+ overflow: 'clip',
15
+ };
16
+
17
+ const image: CSSProperties = {
18
+ width: '100%',
19
+ height: '100%',
20
+ objectFit: 'cover',
21
+ };
23
22
 
24
23
  export default function OverlayHoverReveal() {
25
24
  return (
@@ -27,11 +26,11 @@ export default function OverlayHoverReveal() {
27
26
  showOn="hover"
28
27
  align="center"
29
28
  content={<Button label="Quick view" variant="secondary" size="sm" />}>
30
- <AspectRatio ratio={16 / 9} xstyle={styles.frame}>
29
+ <AspectRatio ratio={16 / 9} style={frame}>
31
30
  <img
32
31
  src="https://lookaside.facebook.com/assets/astryx/light-working-horizontal-1.png"
33
32
  alt="Workspace preview"
34
- {...stylex.props(styles.image)}
33
+ style={image}
35
34
  />
36
35
  </AspectRatio>
37
36
  </Overlay>
@@ -2,47 +2,31 @@
2
2
 
3
3
  'use client';
4
4
 
5
- import * as stylex from '@stylexjs/stylex';
6
5
  import {Overlay} from '@astryxdesign/core/Overlay';
7
6
  import {AspectRatio} from '@astryxdesign/core/AspectRatio';
8
7
  import {Button} from '@astryxdesign/core/Button';
9
8
  import {VStack} from '@astryxdesign/core/Layout';
10
9
  import {Text} from '@astryxdesign/core/Text';
11
10
 
12
- const styles = stylex.create({
13
- frame: {
14
- width: 520,
15
- maxWidth: '100%',
16
- borderRadius: 16,
17
- overflow: 'clip',
18
- },
19
- image: {
20
- width: '100%',
21
- height: '100%',
22
- objectFit: 'cover',
23
- },
24
- content: {
25
- textAlign: 'center',
26
- },
27
- });
28
-
29
11
  export default function OverlayShowcase() {
30
12
  return (
31
13
  <Overlay
32
14
  align="center"
33
15
  content={
34
- <VStack gap={2} xstyle={styles.content}>
16
+ <VStack gap={2} style={{textAlign: 'center'}}>
35
17
  <Text type="supporting" weight="bold" color="inherit">
36
18
  Design system foundations
37
19
  </Text>
38
20
  <Button label="Open gallery" variant="secondary" size="sm" />
39
21
  </VStack>
40
22
  }>
41
- <AspectRatio ratio={16 / 9} xstyle={styles.frame}>
23
+ <AspectRatio
24
+ ratio={16 / 9}
25
+ style={{width: 520, maxWidth: '100%', borderRadius: 16, overflow: 'clip'}}>
42
26
  <img
43
27
  src="https://lookaside.facebook.com/assets/astryx/light-scene-horizontal-1.png"
44
28
  alt="Abstract landscape"
45
- {...stylex.props(styles.image)}
29
+ style={{width: '100%', height: '100%', objectFit: 'cover'}}
46
30
  />
47
31
  </AspectRatio>
48
32
  </Overlay>
@@ -10,7 +10,6 @@ import {Stack} from '@astryxdesign/core/Layout';
10
10
  import {Avatar} from '@astryxdesign/core/Avatar';
11
11
  import {Icon} from '@astryxdesign/core/Icon';
12
12
  import {StarIcon} from '@heroicons/react/24/solid';
13
- import * as stylex from '@stylexjs/stylex';
14
13
 
15
14
  const REVIEWS = [
16
15
  {
@@ -43,17 +42,6 @@ const REVIEWS = [
43
42
  },
44
43
  ];
45
44
 
46
- const styles = stylex.create({
47
- root: {
48
- maxWidth: 480,
49
- width: '100%',
50
- },
51
- pagination: {
52
- justifyContent: 'center',
53
- paddingTop: 4,
54
- },
55
- });
56
-
57
45
  function Stars({count}: {count: number}) {
58
46
  return (
59
47
  <Stack direction="horizontal" gap={0}>
@@ -69,7 +57,7 @@ export default function PaginationDotsCarousel() {
69
57
  const review = REVIEWS[page - 1];
70
58
 
71
59
  return (
72
- <Stack direction="vertical" gap={3} xstyle={styles.root}>
60
+ <Stack direction="vertical" gap={3} style={{maxWidth: 480, width: '100%'}}>
73
61
  <Card padding={5}>
74
62
  <Stack direction="vertical" gap={3}>
75
63
  <Stars count={review.stars} />
@@ -96,7 +84,7 @@ export default function PaginationDotsCarousel() {
96
84
  onChange={setPage}
97
85
  totalPages={REVIEWS.length}
98
86
  variant="dots"
99
- xstyle={styles.pagination}
87
+ style={{justifyContent: 'center', paddingTop: 4}}
100
88
  />
101
89
  </Stack>
102
90
  );