@astryxdesign/cli 0.1.7 → 0.1.8-canary.0c4d8d7

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 (134) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/README.md +115 -19
  3. package/docs/cli-integrations.doc.mjs +150 -0
  4. package/docs/elevation.doc.mjs +79 -1
  5. package/docs/getting-started.doc.mjs +9 -9
  6. package/docs/migration.doc.mjs +18 -18
  7. package/docs/principles.doc.dense.mjs +1 -1
  8. package/docs/principles.doc.mjs +6 -6
  9. package/docs/principles.doc.zh.mjs +1 -1
  10. package/docs/styling-libraries.doc.mjs +3 -3
  11. package/docs/styling.doc.mjs +4 -4
  12. package/docs/theme.doc.dense.mjs +2 -2
  13. package/docs/theme.doc.mjs +7 -7
  14. package/docs/theme.doc.zh.mjs +1 -1
  15. package/docs/tokens.doc.mjs +1 -1
  16. package/docs/working-with-ai.doc.mjs +19 -19
  17. package/package.json +13 -11
  18. package/scripts/postinstall.mjs +74 -0
  19. package/src/api/doctor.mjs +3 -3
  20. package/src/api/error.mjs +2 -2
  21. package/src/codemods/__tests__/registry.test.mjs +1 -0
  22. package/src/codemods/ensure-jscodeshift.mjs +11 -27
  23. package/src/codemods/registry.mjs +1 -0
  24. package/src/codemods/run-codemod.mjs +1 -1
  25. package/src/codemods/runner.mjs +2 -2
  26. package/src/codemods/transforms/v0.1.0/__tests__/drop-xds-prefix-imports.test.mjs +42 -7
  27. package/src/codemods/transforms/v0.1.0/__tests__/migrate-xds-module-specifiers.test.mjs +43 -0
  28. package/src/codemods/transforms/v0.1.0/drop-xds-prefix-imports.mjs +102 -3
  29. package/src/codemods/transforms/v0.1.0/migrate-xds-module-specifiers.mjs +72 -6
  30. package/src/codemods/transforms/v0.1.8/__tests__/rename-avatar-size-scale.test.mjs +161 -0
  31. package/src/codemods/transforms/v0.1.8/index.mjs +19 -0
  32. package/src/codemods/transforms/v0.1.8/rename-avatar-size-scale.mjs +234 -0
  33. package/src/commands/agent-docs.mjs +136 -20
  34. package/src/commands/agent-docs.test.mjs +123 -10
  35. package/src/commands/build-theme.mjs +10 -71
  36. package/src/commands/build.mjs +15 -15
  37. package/src/commands/cli-postinstall.test.mjs +42 -0
  38. package/src/commands/component/index.mjs +4 -4
  39. package/src/commands/discover.mjs +7 -5
  40. package/src/commands/docs.mjs +4 -4
  41. package/src/commands/hook/index.mjs +4 -4
  42. package/src/commands/init.mjs +48 -152
  43. package/src/commands/init.next-steps.test.mjs +1 -1
  44. package/src/commands/interactive-guard.test.mjs +19 -22
  45. package/src/commands/json-contract.test.mjs +2 -2
  46. package/src/commands/layout.mjs +1 -1
  47. package/src/commands/search.mjs +4 -4
  48. package/src/commands/setup-nudge.test.mjs +108 -0
  49. package/src/commands/swizzle.mjs +12 -35
  50. package/src/commands/template.mjs +11 -31
  51. package/src/commands/upgrade.mjs +138 -32
  52. package/src/commands/upgrade.test.mjs +155 -1
  53. package/src/index.mjs +40 -6
  54. package/src/lib/cli-error.mjs +2 -2
  55. package/src/lib/component-format.mjs +2 -1
  56. package/src/lib/json-shim.mjs +1 -1
  57. package/src/lib/json.mjs +3 -3
  58. package/src/lib/term-log.mjs +48 -0
  59. package/src/types/api.d.ts +4 -9
  60. package/src/types/base.d.ts +24 -3
  61. package/src/types/build.d.ts +23 -0
  62. package/src/types/index.d.ts +1 -0
  63. package/src/types/swizzle.d.ts +4 -0
  64. package/src/types/template-api.d.ts +4 -1
  65. package/src/types/upgrade.d.ts +39 -2
  66. package/src/utils/package-manager.mjs +108 -4
  67. package/src/utils/package-manager.test.mjs +108 -1
  68. package/src/utils/path-safety.mjs +0 -18
  69. package/src/utils/update-check.mjs +5 -4
  70. package/src/utils/update-check.test.mjs +3 -3
  71. package/templates/blocks/components/Avatar/AvatarFallbackChain.tsx +4 -4
  72. package/templates/blocks/components/Avatar/AvatarGroup.tsx +2 -2
  73. package/templates/blocks/components/Avatar/AvatarInitialsFallback.tsx +1 -1
  74. package/templates/blocks/components/Avatar/AvatarShowcase.tsx +4 -4
  75. package/templates/blocks/components/Avatar/AvatarUserCard.tsx +1 -1
  76. package/templates/blocks/components/Avatar/AvatarWithImage.tsx +4 -4
  77. package/templates/blocks/components/Avatar/AvatarWithStatus.tsx +3 -3
  78. package/templates/blocks/components/AvatarGroup/AvatarGroupShowcase.tsx +2 -2
  79. package/templates/blocks/components/AvatarGroupOverflow/AvatarGroupOverflowCustomText.tsx +1 -1
  80. package/templates/blocks/components/AvatarGroupOverflow/AvatarGroupOverflowDefault.tsx +1 -1
  81. package/templates/blocks/components/AvatarGroupOverflow/AvatarGroupOverflowShowcase.tsx +2 -2
  82. package/templates/blocks/components/AvatarStatusDot/AvatarStatusDotShowcase.tsx +3 -3
  83. package/templates/blocks/components/AvatarStatusDot/AvatarStatusDotVariants.tsx +3 -3
  84. package/templates/blocks/components/Banner/BannerFloating.doc.mjs +14 -0
  85. package/templates/blocks/components/Banner/BannerFloating.tsx +16 -0
  86. package/templates/blocks/components/Button/ButtonFloating.doc.mjs +14 -0
  87. package/templates/blocks/components/Button/ButtonFloating.tsx +37 -0
  88. package/templates/blocks/components/ButtonGroup/ButtonGroupFloating.doc.mjs +14 -0
  89. package/templates/blocks/components/ButtonGroup/ButtonGroupFloating.tsx +23 -0
  90. package/templates/blocks/components/Card/CardElevations.doc.mjs +14 -0
  91. package/templates/blocks/components/Card/CardElevations.tsx +32 -0
  92. package/templates/blocks/components/Card/ClickableCardElevated.doc.mjs +14 -0
  93. package/templates/blocks/components/Card/ClickableCardElevated.tsx +21 -0
  94. package/templates/blocks/components/Card/SelectableCardElevated.doc.mjs +14 -0
  95. package/templates/blocks/components/Card/SelectableCardElevated.tsx +37 -0
  96. package/templates/blocks/components/Carousel/CarouselSnap.tsx +1 -1
  97. package/templates/blocks/components/ChatComposer/ChatComposerFlat.doc.mjs +14 -0
  98. package/templates/blocks/components/ChatComposer/ChatComposerFlat.tsx +75 -0
  99. package/templates/blocks/components/ChatMessage/ChatMessageAvatarName.tsx +2 -2
  100. package/templates/blocks/components/ChatMessage/ChatMessageMultiBubble.tsx +1 -1
  101. package/templates/blocks/components/ChatMessageBubble/ChatMessageBubbleGrouping.tsx +1 -1
  102. package/templates/blocks/components/ChatMessageBubble/ChatMessageBubbleMetadata.tsx +1 -1
  103. package/templates/blocks/components/ChatMessageList/ChatMessageListDensity.tsx +5 -9
  104. package/templates/blocks/components/ChatMessageList/ChatMessageListFullFeatured.tsx +1 -1
  105. package/templates/blocks/components/CodeBlock/CodeBlockTerminal.tsx +1 -1
  106. package/templates/blocks/components/HoverCard/HoverCardShowcase.tsx +1 -1
  107. package/templates/blocks/components/IconButton/IconButtonFloating.doc.mjs +14 -0
  108. package/templates/blocks/components/IconButton/IconButtonFloating.tsx +37 -0
  109. package/templates/blocks/components/Item/ItemWithMedia.tsx +2 -2
  110. package/templates/blocks/components/ListItem/ListItemWithMedia.tsx +2 -2
  111. package/templates/blocks/components/OverflowList/OverflowListCappedToolbar.doc.mjs +14 -0
  112. package/templates/blocks/components/OverflowList/OverflowListCappedToolbar.tsx +39 -0
  113. package/templates/blocks/components/OverflowList/OverflowListMultiRowTags.doc.mjs +14 -0
  114. package/templates/blocks/components/OverflowList/OverflowListMultiRowTags.tsx +44 -0
  115. package/templates/blocks/components/Pagination/PaginationDotsCarousel.tsx +2 -6
  116. package/templates/blocks/components/Stack/StackFillItem.tsx +2 -6
  117. package/templates/blocks/components/TabList/TabListTabsWithActions.doc.mjs +1 -1
  118. package/templates/blocks/components/TabList/TabListTabsWithActions.tsx +2 -7
  119. package/templates/blocks/components/Table/TableRowStatusTable.doc.mjs +14 -0
  120. package/templates/blocks/components/Table/TableRowStatusTable.tsx +59 -0
  121. package/templates/blocks/components/Thumbnail/ThumbnailElevated.doc.mjs +14 -0
  122. package/templates/blocks/components/Thumbnail/ThumbnailElevated.tsx +31 -0
  123. package/templates/blocks/components/TypeaheadItem/TypeaheadItemShowcase.tsx +1 -1
  124. package/templates/pages/ai-chat/page.tsx +4 -4
  125. package/templates/pages/dashboard-portfolio/page.tsx +3 -11
  126. package/templates/pages/detail-page/page.tsx +5 -12
  127. package/templates/pages/documentation-design/page.tsx +1 -1
  128. package/templates/pages/messaging-shell/page.tsx +6 -8
  129. package/templates/pages/table-grouped/page.tsx +9 -14
  130. package/templates/pages/table-page/page.tsx +7 -9
  131. package/templates/pages/table-page-heatmap-status/page.tsx +5 -13
  132. package/docs/integration-authoring.md +0 -105
  133. package/src/utils/interactive.mjs +0 -76
  134. package/src/utils/interactive.test.mjs +0 -70
@@ -13,7 +13,7 @@ export default function AvatarFallbackChain() {
13
13
  <Avatar
14
14
  src="https://lookaside.facebook.com/assets/astryx/DATA-Daniela-Gimenez.png"
15
15
  name="Daniela Gimenez"
16
- size="medium"
16
+ size="lg"
17
17
  />
18
18
  <Text type="supporting">Valid src</Text>
19
19
  </HStack>
@@ -22,7 +22,7 @@ export default function AvatarFallbackChain() {
22
22
  src="https://lookaside.facebook.com/assets/astryx/does-not-exist-primary.jpg"
23
23
  fallbackSrc="https://lookaside.facebook.com/assets/astryx/DATA-Ami-Pena.png"
24
24
  name="Invalid User"
25
- size="medium"
25
+ size="lg"
26
26
  />
27
27
  <Text type="supporting">Invalid src, valid fallbackSrc</Text>
28
28
  </HStack>
@@ -31,14 +31,14 @@ export default function AvatarFallbackChain() {
31
31
  src="https://lookaside.facebook.com/assets/astryx/does-not-exist-primary.jpg"
32
32
  fallbackSrc="https://lookaside.facebook.com/assets/astryx/does-not-exist-fallback.jpg"
33
33
  name="Test User"
34
- size="medium"
34
+ size="lg"
35
35
  />
36
36
  <Text type="supporting">Both invalid, has name</Text>
37
37
  </HStack>
38
38
  <HStack gap={3} vAlign="center">
39
39
  <Avatar
40
40
  src="https://lookaside.facebook.com/assets/astryx/does-not-exist-primary.jpg"
41
- size="medium"
41
+ size="lg"
42
42
  />
43
43
  <Text type="supporting">All invalid, no name</Text>
44
44
  </HStack>
@@ -37,7 +37,7 @@ export default function AvatarGroupBlock() {
37
37
  <Text type="supporting" color="secondary">
38
38
  Team members
39
39
  </Text>
40
- <AvatarGroup size="medium">
40
+ <AvatarGroup size="lg">
41
41
  {USERS.map(user => (
42
42
  <Avatar key={user.name} src={user.src} name={user.name} />
43
43
  ))}
@@ -48,7 +48,7 @@ export default function AvatarGroupBlock() {
48
48
  <Text type="supporting" color="secondary">
49
49
  Larger group
50
50
  </Text>
51
- <AvatarGroup size="medium">
51
+ <AvatarGroup size="lg">
52
52
  {USERS.slice(0, 3).map(user => (
53
53
  <Avatar key={user.name} src={user.src} name={user.name} />
54
54
  ))}
@@ -18,7 +18,7 @@ export default function AvatarInitialsFallback() {
18
18
  <Stack direction="horizontal" gap={6} vAlign="center">
19
19
  {NAMES.map(({name, note}) => (
20
20
  <Stack key={name} direction="vertical" gap={2} hAlign="center">
21
- <Avatar name={name} size="medium" />
21
+ <Avatar name={name} size="lg" />
22
22
  <Text type="supporting" color="secondary">
23
23
  {note}
24
24
  </Text>
@@ -11,23 +11,23 @@ export default function AvatarShowcase() {
11
11
  <Avatar
12
12
  src="https://lookaside.facebook.com/assets/astryx/DATA-Ana-Thomas.png"
13
13
  name="Ana Thomas"
14
- size="large"
14
+ size="xl"
15
15
  status={<AvatarStatusDot variant="success" label="Online" />}
16
16
  />
17
17
  <Avatar
18
18
  src="https://lookaside.facebook.com/assets/astryx/DATA-Drew-Young.png"
19
19
  name="Drew Young"
20
- size="large"
20
+ size="xl"
21
21
  />
22
22
  <Avatar
23
23
  src="https://lookaside.facebook.com/assets/astryx/DATA-Jihoo-Song.png"
24
24
  name="Jihoo Song"
25
- size="large"
25
+ size="xl"
26
26
  />
27
27
  <Avatar
28
28
  src="https://lookaside.facebook.com/assets/astryx/DATA-Nam-Tran.png"
29
29
  name="Nam Tran"
30
- size="large"
30
+ size="xl"
31
31
  status={<AvatarStatusDot variant="error" label="Online" />}
32
32
  />
33
33
  </Stack>
@@ -35,7 +35,7 @@ export default function AvatarUserCard() {
35
35
  <Avatar
36
36
  src={user.src}
37
37
  name={user.name}
38
- size="medium"
38
+ size="lg"
39
39
  status={
40
40
  <AvatarStatusDot variant={user.variant} label={user.variant} />
41
41
  }
@@ -11,22 +11,22 @@ export default function AvatarWithImage() {
11
11
  <Avatar
12
12
  src="https://lookaside.facebook.com/assets/astryx/DATA-Ami-Pena.png"
13
13
  name="Ami Pena"
14
- size="tiny"
14
+ size="xsm"
15
15
  />
16
16
  <Avatar
17
17
  src="https://lookaside.facebook.com/assets/astryx/DATA-Ana-Thomas.png"
18
18
  name="Ana Thomas"
19
- size="small"
19
+ size="md"
20
20
  />
21
21
  <Avatar
22
22
  src="https://lookaside.facebook.com/assets/astryx/DATA-Daniela-Gimenez.png"
23
23
  name="Daniela Gimenez"
24
- size="medium"
24
+ size="lg"
25
25
  />
26
26
  <Avatar
27
27
  src="https://lookaside.facebook.com/assets/astryx/DATA-Gabriela-Fernandez.png"
28
28
  name="Gabriela Fernandez"
29
- size="large"
29
+ size="xl"
30
30
  />
31
31
  </Stack>
32
32
  );
@@ -11,19 +11,19 @@ export default function AvatarWithStatus() {
11
11
  <Avatar
12
12
  src="https://lookaside.facebook.com/assets/astryx/DATA-Itai-Jordaan.png"
13
13
  name="Itai Jordaan"
14
- size="large"
14
+ size="xl"
15
15
  status={<AvatarStatusDot variant="success" label="Online" />}
16
16
  />
17
17
  <Avatar
18
18
  src="https://lookaside.facebook.com/assets/astryx/DATA-Margot-Schroder.png"
19
19
  name="Margot Schroder"
20
- size="large"
20
+ size="xl"
21
21
  status={<AvatarStatusDot variant="neutral" label="Offline" />}
22
22
  />
23
23
  <Avatar
24
24
  src="https://lookaside.facebook.com/assets/astryx/DATA-Pablo-Morales.png"
25
25
  name="Pablo Morales"
26
- size="large"
26
+ size="xl"
27
27
  status={<AvatarStatusDot variant="error" label="Busy" />}
28
28
  />
29
29
  </Stack>
@@ -36,7 +36,7 @@ export default function AvatarGroupShowcase() {
36
36
  <Text type="supporting" color="secondary">
37
37
  Team members
38
38
  </Text>
39
- <AvatarGroup size="medium">
39
+ <AvatarGroup size="lg">
40
40
  {USERS.map(u => (
41
41
  <Avatar key={u.key} name={u.name} />
42
42
  ))}
@@ -46,7 +46,7 @@ export default function AvatarGroupShowcase() {
46
46
  <Text type="supporting" color="secondary">
47
47
  With overflow
48
48
  </Text>
49
- <AvatarGroup size="medium">
49
+ <AvatarGroup size="lg">
50
50
  {USERS.slice(0, 3).map(u => (
51
51
  <Avatar key={u.key} name={u.name} />
52
52
  ))}
@@ -24,7 +24,7 @@ export default function AvatarGroupOverflowCustomText() {
24
24
  <Text type="supporting" color="secondary">
25
25
  Team members
26
26
  </Text>
27
- <AvatarGroup size="medium">
27
+ <AvatarGroup size="lg">
28
28
  {TEAM.map(member => (
29
29
  <Avatar key={member.name} name={member.name} />
30
30
  ))}
@@ -24,7 +24,7 @@ export default function AvatarGroupOverflowDefault() {
24
24
  <Text type="supporting" color="secondary">
25
25
  Reviewers
26
26
  </Text>
27
- <AvatarGroup size="medium">
27
+ <AvatarGroup size="lg">
28
28
  {REVIEWERS.map(reviewer => (
29
29
  <Avatar key={reviewer.name} name={reviewer.name} />
30
30
  ))}
@@ -25,7 +25,7 @@ export default function AvatarGroupOverflowShowcase() {
25
25
  <Text type="supporting" color="secondary">
26
26
  Default overflow
27
27
  </Text>
28
- <AvatarGroup size="medium">
28
+ <AvatarGroup size="lg">
29
29
  {USERS.map(user => (
30
30
  <Avatar key={user.name} name={user.name} />
31
31
  ))}
@@ -36,7 +36,7 @@ export default function AvatarGroupOverflowShowcase() {
36
36
  <Text type="supporting" color="secondary">
37
37
  Custom count text
38
38
  </Text>
39
- <AvatarGroup size="medium">
39
+ <AvatarGroup size="lg">
40
40
  {USERS.slice(0, 2).map(user => (
41
41
  <Avatar key={user.name} name={user.name} />
42
42
  ))}
@@ -10,17 +10,17 @@ export default function AvatarStatusDotShowcase() {
10
10
  <HStack gap={4} vAlign="center">
11
11
  <Avatar
12
12
  name="Online User"
13
- size="large"
13
+ size="xl"
14
14
  status={<AvatarStatusDot variant="success" label="Online" />}
15
15
  />
16
16
  <Avatar
17
17
  name="Away User"
18
- size="large"
18
+ size="xl"
19
19
  status={<AvatarStatusDot variant="neutral" label="Away" />}
20
20
  />
21
21
  <Avatar
22
22
  name="Busy User"
23
- size="large"
23
+ size="xl"
24
24
  status={<AvatarStatusDot variant="error" label="Busy" />}
25
25
  />
26
26
  </HStack>
@@ -10,17 +10,17 @@ export default function AvatarStatusDotVariants() {
10
10
  <HStack gap={4} vAlign="center">
11
11
  <Avatar
12
12
  name="Ana Silva"
13
- size="large"
13
+ size="xl"
14
14
  status={<AvatarStatusDot variant="success" label="Online" />}
15
15
  />
16
16
  <Avatar
17
17
  name="Ben Okafor"
18
- size="large"
18
+ size="xl"
19
19
  status={<AvatarStatusDot variant="neutral" label="Away" />}
20
20
  />
21
21
  <Avatar
22
22
  name="Cleo Marsh"
23
- size="large"
23
+ size="xl"
24
24
  status={<AvatarStatusDot variant="error" label="Do not disturb" />}
25
25
  />
26
26
  </HStack>
@@ -0,0 +1,14 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
4
+ export const doc = {
5
+ type: 'block',
6
+ exampleFor: 'Banner',
7
+ name: 'Banner — Floating',
8
+ displayName: 'Banner — Floating',
9
+ description:
10
+ 'A floating banner raised with `elevation="med"`. Banners are inline by default; raise one when it should read as an overlay above content.',
11
+ isReady: true,
12
+ aspectRatio: 16 / 9,
13
+ componentsUsed: ['Banner'],
14
+ };
@@ -0,0 +1,16 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ import {Banner} from '@astryxdesign/core/Banner';
6
+
7
+ export default function BannerFloating() {
8
+ return (
9
+ <Banner
10
+ status="info"
11
+ title="You have unsaved changes"
12
+ description="A raised banner reads as an overlay floating above the page."
13
+ elevation="med"
14
+ />
15
+ );
16
+ }
@@ -0,0 +1,14 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
4
+ export const doc = {
5
+ type: 'block',
6
+ exampleFor: 'Button',
7
+ name: 'Button — Floating',
8
+ displayName: 'Button — Floating',
9
+ description:
10
+ 'A floating action button raised with `elevation="med"`. Use elevation for buttons that hover above content, like a FAB.',
11
+ isReady: true,
12
+ aspectRatio: 16 / 9,
13
+ componentsUsed: ['Button', 'Icon', 'Layout', 'Text'],
14
+ };
@@ -0,0 +1,37 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ import {Button} from '@astryxdesign/core/Button';
6
+ import {Icon} from '@astryxdesign/core/Icon';
7
+ import {Stack} from '@astryxdesign/core/Layout';
8
+ import {Text} from '@astryxdesign/core/Text';
9
+ import {PlusIcon} from '@heroicons/react/24/outline';
10
+
11
+ const VARIANTS = [
12
+ {variant: 'primary' as const, label: 'Primary'},
13
+ {variant: 'secondary' as const, label: 'Secondary'},
14
+ {variant: 'ghost' as const, label: 'Ghost'},
15
+ {variant: 'destructive' as const, label: 'Destructive'},
16
+ ];
17
+
18
+ export default function ButtonFloating() {
19
+ return (
20
+ <Stack direction="vertical" gap={4}>
21
+ <Text type="supporting" color="secondary">
22
+ Floating action buttons — raised above content with `elevation="med"`
23
+ </Text>
24
+ <Stack direction="horizontal" gap={3} vAlign="center">
25
+ {VARIANTS.map(({variant, label}) => (
26
+ <Button
27
+ key={variant}
28
+ label={label}
29
+ variant={variant}
30
+ icon={<Icon icon={PlusIcon} />}
31
+ elevation="med"
32
+ />
33
+ ))}
34
+ </Stack>
35
+ </Stack>
36
+ );
37
+ }
@@ -0,0 +1,14 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
4
+ export const doc = {
5
+ type: 'block',
6
+ exampleFor: 'ButtonGroup',
7
+ name: 'ButtonGroup — Floating',
8
+ displayName: 'ButtonGroup — Floating',
9
+ description:
10
+ 'A grouped action bar raised with `elevation="med"`. The connected buttons share one surface, so the shadow lifts them as a unit.',
11
+ isReady: true,
12
+ aspectRatio: 16 / 9,
13
+ componentsUsed: ['ButtonGroup', 'Button', 'Layout', 'Text'],
14
+ };
@@ -0,0 +1,23 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ import {ButtonGroup} from '@astryxdesign/core/ButtonGroup';
6
+ import {Button} from '@astryxdesign/core/Button';
7
+ import {Stack} from '@astryxdesign/core/Layout';
8
+ import {Text} from '@astryxdesign/core/Text';
9
+
10
+ export default function ButtonGroupFloating() {
11
+ return (
12
+ <Stack direction="vertical" gap={3} hAlign="start">
13
+ <Text type="supporting" color="secondary">
14
+ The whole group shares one raised surface — a floating action bar
15
+ </Text>
16
+ <ButtonGroup label="Zoom controls" elevation="med">
17
+ <Button label="Zoom out" />
18
+ <Button label="Reset" />
19
+ <Button label="Zoom in" />
20
+ </ButtonGroup>
21
+ </Stack>
22
+ );
23
+ }
@@ -0,0 +1,14 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
4
+ export const doc = {
5
+ type: 'block',
6
+ exampleFor: 'Card',
7
+ name: 'Card — Elevations',
8
+ displayName: 'Card — Elevations',
9
+ description:
10
+ 'The four elevation levels side by side. Cards are flat by default; raise a card with `elevation` only when it needs to float above surrounding content.',
11
+ isReady: true,
12
+ aspectRatio: 16 / 9,
13
+ componentsUsed: ['Card', 'Layout', 'Text'],
14
+ };
@@ -0,0 +1,32 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ import {Card} from '@astryxdesign/core/Card';
6
+ import {Stack} from '@astryxdesign/core/Layout';
7
+ import {Grid} from '@astryxdesign/core/Grid';
8
+ import {Text, Heading} from '@astryxdesign/core/Text';
9
+
10
+ const LEVELS = [
11
+ {elevation: 'none' as const, caption: 'Flat — sits on the page (default)'},
12
+ {elevation: 'low' as const, caption: 'Low — lifts off slightly'},
13
+ {elevation: 'med' as const, caption: 'Med — clearly raised'},
14
+ {elevation: 'high' as const, caption: 'High — floats well above'},
15
+ ];
16
+
17
+ export default function CardElevations() {
18
+ return (
19
+ <Grid columns={2} gap={4} width={520}>
20
+ {LEVELS.map(({elevation, caption}) => (
21
+ <Card key={elevation} elevation={elevation}>
22
+ <Stack direction="vertical" gap={1}>
23
+ <Heading level={4}>elevation=&quot;{elevation}&quot;</Heading>
24
+ <Text type="supporting" color="secondary">
25
+ {caption}
26
+ </Text>
27
+ </Stack>
28
+ </Card>
29
+ ))}
30
+ </Grid>
31
+ );
32
+ }
@@ -0,0 +1,14 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
4
+ export const doc = {
5
+ type: 'block',
6
+ exampleFor: 'ClickableCard',
7
+ name: 'ClickableCard — Elevated',
8
+ displayName: 'Clickable Card — Elevated',
9
+ description:
10
+ 'A clickable card raised with `elevation="med"` so the shadow signals the whole surface is interactive.',
11
+ isReady: true,
12
+ aspectRatio: 1,
13
+ componentsUsed: ['ClickableCard', 'Layout', 'Text'],
14
+ };
@@ -0,0 +1,21 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ import {ClickableCard} from '@astryxdesign/core/ClickableCard';
6
+ import {Stack} from '@astryxdesign/core/Layout';
7
+ import {Text, Heading} from '@astryxdesign/core/Text';
8
+
9
+ export default function ClickableCardElevated() {
10
+ return (
11
+ <ClickableCard label="Open report" href="#" elevation="med" width={320}>
12
+ <Stack direction="vertical" gap={2}>
13
+ <Heading level={4}>Quarterly report</Heading>
14
+ <Text type="body" color="secondary">
15
+ A raised shadow signals the whole card is clickable, lifting it above
16
+ the surrounding content.
17
+ </Text>
18
+ </Stack>
19
+ </ClickableCard>
20
+ );
21
+ }
@@ -0,0 +1,14 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
4
+ export const doc = {
5
+ type: 'block',
6
+ exampleFor: 'SelectableCard',
7
+ name: 'SelectableCard — Elevated',
8
+ displayName: 'Selectable Card — Elevated',
9
+ description:
10
+ 'Raised selectable cards with `elevation="low"`. The inset selection ring composes on top of the shadow, so a selected card keeps its elevation.',
11
+ isReady: true,
12
+ aspectRatio: 2,
13
+ componentsUsed: ['SelectableCard', 'Layout', 'Text'],
14
+ };
@@ -0,0 +1,37 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ import {useState} from 'react';
6
+ import {SelectableCard} from '@astryxdesign/core/SelectableCard';
7
+ import {Grid} from '@astryxdesign/core/Grid';
8
+ import {Text} from '@astryxdesign/core/Text';
9
+
10
+ const PLANS = [
11
+ {id: 'starter', name: 'Starter'},
12
+ {id: 'pro', name: 'Pro'},
13
+ ];
14
+
15
+ export default function SelectableCardElevated() {
16
+ const [selected, setSelected] = useState('pro');
17
+
18
+ return (
19
+ <Grid columns={2} gap={3} width={420}>
20
+ {PLANS.map(plan => (
21
+ <SelectableCard
22
+ key={plan.id}
23
+ label={plan.name}
24
+ isSelected={selected === plan.id}
25
+ onChange={() => setSelected(plan.id)}
26
+ elevation="low">
27
+ <Text type="body" weight="bold">
28
+ {plan.name}
29
+ </Text>
30
+ <Text type="supporting" color="secondary">
31
+ The resting shadow stays put — the selection ring layers on top.
32
+ </Text>
33
+ </SelectableCard>
34
+ ))}
35
+ </Grid>
36
+ );
37
+ }
@@ -27,7 +27,7 @@ export default function CarouselSnap() {
27
27
  {TEAM.map(person => (
28
28
  <Card key={person.name} width={180} minHeight={140}>
29
29
  <Stack direction="vertical" gap={3} hAlign="center">
30
- <Avatar name={person.name} size="medium" />
30
+ <Avatar name={person.name} size="lg" />
31
31
  <Stack direction="vertical" gap={1} hAlign="center">
32
32
  <Text type="body" weight="bold">
33
33
  {person.name}
@@ -0,0 +1,14 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
4
+ export const doc = {
5
+ type: 'block',
6
+ exampleFor: 'ChatComposer',
7
+ name: 'ChatComposer — Flat',
8
+ displayName: 'ChatComposer — Flat',
9
+ description:
10
+ 'The composer is raised by default (`elevation="low"`). Set `elevation="none"` to flatten it — it then draws a border with the same rest / hover / focus treatment as a text input.',
11
+ isReady: true,
12
+ aspectRatio: 16 / 9,
13
+ componentsUsed: ['ChatComposer', 'Layout', 'Text'],
14
+ };
@@ -0,0 +1,75 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ import {ChatComposer} from '@astryxdesign/core/Chat';
6
+ import {Button} from '@astryxdesign/core/Button';
7
+ import {DropdownMenu} from '@astryxdesign/core/DropdownMenu';
8
+ import {Icon} from '@astryxdesign/core/Icon';
9
+ import {Stack} from '@astryxdesign/core/Layout';
10
+ import {Text} from '@astryxdesign/core/Text';
11
+ import {
12
+ Cog6ToothIcon,
13
+ MicrophoneIcon,
14
+ SparklesIcon,
15
+ } from '@heroicons/react/24/outline';
16
+
17
+ export default function ChatComposerFlat() {
18
+ return (
19
+ <Stack direction="vertical" gap={2} style={{width: '100%', maxWidth: 450}}>
20
+ <Text type="supporting" color="secondary">
21
+ elevation=&quot;none&quot; — flat, with a text-input-style border and
22
+ focus ring
23
+ </Text>
24
+ <ChatComposer
25
+ elevation="none"
26
+ onSubmit={value => {
27
+ console.log('Sent:', value);
28
+ }}
29
+ footerActions={
30
+ <>
31
+ <DropdownMenu
32
+ button={{
33
+ label: 'Auto',
34
+ variant: 'ghost',
35
+ size: 'md',
36
+ icon: <Icon icon={SparklesIcon} size="sm" />,
37
+ children: 'Auto',
38
+ }}
39
+ menuWidth={200}
40
+ items={[
41
+ {label: 'Auto', onClick: () => {}},
42
+ {label: 'Model A', onClick: () => {}},
43
+ {label: 'Model B', onClick: () => {}},
44
+ ]}
45
+ />
46
+ <DropdownMenu
47
+ button={{
48
+ label: 'Settings',
49
+ variant: 'ghost',
50
+ size: 'md',
51
+ icon: <Icon icon={Cog6ToothIcon} size="sm" />,
52
+ children: 'Settings',
53
+ }}
54
+ menuWidth={200}
55
+ items={[
56
+ {label: 'Preferences', onClick: () => {}},
57
+ {label: 'Keyboard shortcuts', onClick: () => {}},
58
+ {label: 'About', onClick: () => {}},
59
+ ]}
60
+ />
61
+ </>
62
+ }
63
+ sendActions={
64
+ <Button
65
+ label="Microphone"
66
+ variant="ghost"
67
+ size="md"
68
+ icon={<Icon icon={MicrophoneIcon} />}
69
+ isIconOnly
70
+ />
71
+ }
72
+ />
73
+ </Stack>
74
+ );
75
+ }
@@ -17,7 +17,7 @@ export default function ChatMessageAvatarName() {
17
17
  <ChatMessageList style={{maxWidth: 500}}>
18
18
  <ChatMessage
19
19
  sender="assistant"
20
- avatar={<Avatar name="Agent" size="small" />}>
20
+ avatar={<Avatar name="Agent" size="md" />}>
21
21
  <ChatMessageBubble
22
22
  name={
23
23
  <Text type="supporting" weight="semibold" color="secondary">
@@ -50,7 +50,7 @@ export default function ChatMessageAvatarName() {
50
50
  </ChatMessage>
51
51
  <ChatMessage
52
52
  sender="assistant"
53
- avatar={<Avatar name="Agent" size="small" />}>
53
+ avatar={<Avatar name="Agent" size="md" />}>
54
54
  <ChatMessageBubble
55
55
  name={
56
56
  <Text type="supporting" weight="semibold" color="secondary">