@astryxdesign/cli 0.1.7 → 0.1.8-canary.08a0957
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.
- package/CHANGELOG.md +40 -0
- package/README.md +115 -19
- package/docs/cli-integrations.doc.mjs +150 -0
- package/docs/getting-started.doc.mjs +9 -9
- package/docs/migration.doc.mjs +18 -18
- package/docs/principles.doc.dense.mjs +1 -1
- package/docs/principles.doc.mjs +6 -6
- package/docs/principles.doc.zh.mjs +1 -1
- package/docs/styling-libraries.doc.mjs +3 -3
- package/docs/styling.doc.mjs +4 -4
- package/docs/theme.doc.dense.mjs +2 -2
- package/docs/theme.doc.mjs +7 -7
- package/docs/theme.doc.zh.mjs +1 -1
- package/docs/tokens.doc.mjs +1 -1
- package/docs/working-with-ai.doc.mjs +19 -19
- package/package.json +11 -10
- package/scripts/postinstall.mjs +74 -0
- package/src/api/doctor.mjs +3 -3
- package/src/codemods/__tests__/registry.test.mjs +1 -0
- package/src/codemods/ensure-jscodeshift.mjs +11 -27
- package/src/codemods/registry.mjs +1 -0
- package/src/codemods/run-codemod.mjs +1 -1
- package/src/codemods/runner.mjs +2 -2
- package/src/codemods/transforms/v0.1.0/__tests__/drop-xds-prefix-imports.test.mjs +42 -7
- package/src/codemods/transforms/v0.1.0/__tests__/migrate-xds-module-specifiers.test.mjs +43 -0
- package/src/codemods/transforms/v0.1.0/drop-xds-prefix-imports.mjs +102 -3
- package/src/codemods/transforms/v0.1.0/migrate-xds-module-specifiers.mjs +72 -6
- package/src/codemods/transforms/v0.1.8/__tests__/rename-avatar-size-scale.test.mjs +161 -0
- package/src/codemods/transforms/v0.1.8/index.mjs +19 -0
- package/src/codemods/transforms/v0.1.8/rename-avatar-size-scale.mjs +234 -0
- package/src/commands/agent-docs.mjs +136 -20
- package/src/commands/agent-docs.test.mjs +123 -10
- package/src/commands/build-theme.mjs +10 -71
- package/src/commands/build.mjs +15 -15
- package/src/commands/cli-postinstall.test.mjs +42 -0
- package/src/commands/component/index.mjs +4 -4
- package/src/commands/discover.mjs +7 -5
- package/src/commands/docs.mjs +4 -4
- package/src/commands/hook/index.mjs +4 -4
- package/src/commands/init.mjs +48 -152
- package/src/commands/init.next-steps.test.mjs +1 -1
- package/src/commands/interactive-guard.test.mjs +19 -22
- package/src/commands/json-contract.test.mjs +2 -2
- package/src/commands/layout.mjs +1 -1
- package/src/commands/search.mjs +4 -4
- package/src/commands/setup-nudge.test.mjs +108 -0
- package/src/commands/swizzle.mjs +11 -34
- package/src/commands/template.mjs +11 -31
- package/src/commands/upgrade.mjs +138 -32
- package/src/commands/upgrade.test.mjs +155 -1
- package/src/index.mjs +40 -6
- package/src/lib/component-format.mjs +2 -1
- package/src/lib/term-log.mjs +48 -0
- package/src/types/template-api.d.ts +4 -1
- package/src/types/upgrade.d.ts +39 -2
- package/src/utils/package-manager.mjs +78 -0
- package/src/utils/package-manager.test.mjs +108 -1
- package/src/utils/path-safety.mjs +0 -18
- package/src/utils/update-check.mjs +2 -1
- package/templates/blocks/components/Avatar/AvatarFallbackChain.tsx +4 -4
- package/templates/blocks/components/Avatar/AvatarGroup.tsx +2 -2
- package/templates/blocks/components/Avatar/AvatarInitialsFallback.tsx +1 -1
- package/templates/blocks/components/Avatar/AvatarShowcase.tsx +4 -4
- package/templates/blocks/components/Avatar/AvatarUserCard.tsx +1 -1
- package/templates/blocks/components/Avatar/AvatarWithImage.tsx +4 -4
- package/templates/blocks/components/Avatar/AvatarWithStatus.tsx +3 -3
- package/templates/blocks/components/AvatarGroup/AvatarGroupShowcase.tsx +2 -2
- package/templates/blocks/components/AvatarGroupOverflow/AvatarGroupOverflowCustomText.tsx +1 -1
- package/templates/blocks/components/AvatarGroupOverflow/AvatarGroupOverflowDefault.tsx +1 -1
- package/templates/blocks/components/AvatarGroupOverflow/AvatarGroupOverflowShowcase.tsx +2 -2
- package/templates/blocks/components/AvatarStatusDot/AvatarStatusDotShowcase.tsx +3 -3
- package/templates/blocks/components/AvatarStatusDot/AvatarStatusDotVariants.tsx +3 -3
- package/templates/blocks/components/Carousel/CarouselSnap.tsx +1 -1
- package/templates/blocks/components/ChatMessage/ChatMessageAvatarName.tsx +2 -2
- package/templates/blocks/components/ChatMessage/ChatMessageMultiBubble.tsx +1 -1
- package/templates/blocks/components/ChatMessageBubble/ChatMessageBubbleGrouping.tsx +1 -1
- package/templates/blocks/components/ChatMessageBubble/ChatMessageBubbleMetadata.tsx +1 -1
- package/templates/blocks/components/ChatMessageList/ChatMessageListDensity.tsx +5 -9
- package/templates/blocks/components/ChatMessageList/ChatMessageListFullFeatured.tsx +1 -1
- package/templates/blocks/components/CodeBlock/CodeBlockTerminal.tsx +1 -1
- package/templates/blocks/components/HoverCard/HoverCardShowcase.tsx +1 -1
- package/templates/blocks/components/Item/ItemWithMedia.tsx +2 -2
- package/templates/blocks/components/ListItem/ListItemWithMedia.tsx +2 -2
- package/templates/blocks/components/Pagination/PaginationDotsCarousel.tsx +2 -6
- package/templates/blocks/components/Stack/StackFillItem.tsx +2 -6
- package/templates/blocks/components/TabList/TabListTabsWithActions.doc.mjs +1 -1
- package/templates/blocks/components/TabList/TabListTabsWithActions.tsx +2 -7
- package/templates/blocks/components/Table/TableRowStatusTable.doc.mjs +14 -0
- package/templates/blocks/components/Table/TableRowStatusTable.tsx +59 -0
- package/templates/blocks/components/TypeaheadItem/TypeaheadItemShowcase.tsx +1 -1
- package/templates/pages/ai-chat/page.tsx +4 -4
- package/templates/pages/dashboard-portfolio/page.tsx +3 -11
- package/templates/pages/detail-page/page.tsx +5 -12
- package/templates/pages/documentation-design/page.tsx +1 -1
- package/templates/pages/messaging-shell/page.tsx +6 -8
- package/templates/pages/table-grouped/page.tsx +9 -14
- package/templates/pages/table-page/page.tsx +7 -9
- package/templates/pages/table-page-heatmap-status/page.tsx +5 -13
- package/docs/integration-authoring.md +0 -105
- package/src/utils/interactive.mjs +0 -76
- 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="
|
|
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="
|
|
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="
|
|
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="
|
|
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="
|
|
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="
|
|
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="
|
|
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="
|
|
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="
|
|
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="
|
|
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="
|
|
30
|
+
size="xl"
|
|
31
31
|
status={<AvatarStatusDot variant="error" label="Online" />}
|
|
32
32
|
/>
|
|
33
33
|
</Stack>
|
|
@@ -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="
|
|
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="
|
|
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="
|
|
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="
|
|
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="
|
|
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="
|
|
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="
|
|
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="
|
|
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="
|
|
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="
|
|
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="
|
|
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="
|
|
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="
|
|
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="
|
|
13
|
+
size="xl"
|
|
14
14
|
status={<AvatarStatusDot variant="success" label="Online" />}
|
|
15
15
|
/>
|
|
16
16
|
<Avatar
|
|
17
17
|
name="Away User"
|
|
18
|
-
size="
|
|
18
|
+
size="xl"
|
|
19
19
|
status={<AvatarStatusDot variant="neutral" label="Away" />}
|
|
20
20
|
/>
|
|
21
21
|
<Avatar
|
|
22
22
|
name="Busy User"
|
|
23
|
-
size="
|
|
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="
|
|
13
|
+
size="xl"
|
|
14
14
|
status={<AvatarStatusDot variant="success" label="Online" />}
|
|
15
15
|
/>
|
|
16
16
|
<Avatar
|
|
17
17
|
name="Ben Okafor"
|
|
18
|
-
size="
|
|
18
|
+
size="xl"
|
|
19
19
|
status={<AvatarStatusDot variant="neutral" label="Away" />}
|
|
20
20
|
/>
|
|
21
21
|
<Avatar
|
|
22
22
|
name="Cleo Marsh"
|
|
23
|
-
size="
|
|
23
|
+
size="xl"
|
|
24
24
|
status={<AvatarStatusDot variant="error" label="Do not disturb" />}
|
|
25
25
|
/>
|
|
26
26
|
</HStack>
|
|
@@ -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="
|
|
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}
|
|
@@ -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="
|
|
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="
|
|
53
|
+
avatar={<Avatar name="Agent" size="md" />}>
|
|
54
54
|
<ChatMessageBubble
|
|
55
55
|
name={
|
|
56
56
|
<Text type="supporting" weight="semibold" color="secondary">
|
|
@@ -17,7 +17,7 @@ export default function ChatMessageBubbleGrouping() {
|
|
|
17
17
|
<ChatMessageList style={{maxWidth: 500}}>
|
|
18
18
|
<ChatMessage
|
|
19
19
|
sender="assistant"
|
|
20
|
-
avatar={<Avatar name="Agent" size="
|
|
20
|
+
avatar={<Avatar name="Agent" size="md" />}>
|
|
21
21
|
<ChatMessageBubble
|
|
22
22
|
group="first"
|
|
23
23
|
name={
|
|
@@ -20,7 +20,7 @@ export default function ChatMessageBubbleMetadata() {
|
|
|
20
20
|
<ChatMessageList style={{maxWidth: 500}}>
|
|
21
21
|
<ChatMessage
|
|
22
22
|
sender="assistant"
|
|
23
|
-
avatar={<Avatar name="Agent" size="
|
|
23
|
+
avatar={<Avatar name="Agent" size="md" />}>
|
|
24
24
|
<ChatMessageBubble
|
|
25
25
|
name={
|
|
26
26
|
<Text type="supporting" weight="semibold" color="secondary">
|
|
@@ -16,9 +16,9 @@ import {Fragment} from 'react';
|
|
|
16
16
|
const DENSITIES = ['compact', 'balanced', 'spacious'] as const;
|
|
17
17
|
|
|
18
18
|
const AVATAR_SIZE = {
|
|
19
|
-
compact: '
|
|
20
|
-
balanced: '
|
|
21
|
-
spacious: '
|
|
19
|
+
compact: 'sm' as const,
|
|
20
|
+
balanced: 'md' as const,
|
|
21
|
+
spacious: 'md' as const,
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
export default function ChatMessageListDensity() {
|
|
@@ -34,15 +34,11 @@ export default function ChatMessageListDensity() {
|
|
|
34
34
|
<VStack style={{flex: 1, minHeight: 0}}>
|
|
35
35
|
<ChatMessageList density={density}>
|
|
36
36
|
<ChatMessage sender="user">
|
|
37
|
-
<ChatMessageBubble>
|
|
38
|
-
How does density work?
|
|
39
|
-
</ChatMessageBubble>
|
|
37
|
+
<ChatMessageBubble>How does density work?</ChatMessageBubble>
|
|
40
38
|
</ChatMessage>
|
|
41
39
|
<ChatMessage
|
|
42
40
|
sender="assistant"
|
|
43
|
-
avatar={
|
|
44
|
-
<Avatar name="Agent" size={AVATAR_SIZE[density]} />
|
|
45
|
-
}>
|
|
41
|
+
avatar={<Avatar name="Agent" size={AVATAR_SIZE[density]} />}>
|
|
46
42
|
<ChatMessageBubble>
|
|
47
43
|
Density provides default spacing at every level — message
|
|
48
44
|
gap, bubble padding, and gap between child elements. Use gap
|
|
@@ -42,7 +42,7 @@ export default function ChatMessageListFullFeatured() {
|
|
|
42
42
|
|
|
43
43
|
<ChatMessage
|
|
44
44
|
sender="assistant"
|
|
45
|
-
avatar={<Avatar name="Agent" size="
|
|
45
|
+
avatar={<Avatar name="Agent" size="md" />}>
|
|
46
46
|
<ChatMessageBubble group="first">
|
|
47
47
|
<Markdown density="compact">
|
|
48
48
|
{`Sure! Here's the key pattern from **useReducer.ts**:`}
|
|
@@ -7,7 +7,7 @@ import {githubDark} from '@astryxdesign/core/theme/syntax';
|
|
|
7
7
|
import {CodeBlock} from '@astryxdesign/core/CodeBlock';
|
|
8
8
|
|
|
9
9
|
const commands = `$ astryx init --features agents
|
|
10
|
-
✓ AI agent docs installed → .
|
|
10
|
+
✓ AI agent docs installed → AGENTS.md
|
|
11
11
|
$ pnpm astryx component CodeBlock --dense`;
|
|
12
12
|
|
|
13
13
|
export default function CodeBlockTerminal() {
|
|
@@ -15,7 +15,7 @@ export default function HoverCardShowcase() {
|
|
|
15
15
|
content={
|
|
16
16
|
<Stack direction="vertical" gap={2} style={{width: 240}}>
|
|
17
17
|
<Stack direction="horizontal" gap={2} vAlign="center">
|
|
18
|
-
<Avatar name="Jane Doe" size="
|
|
18
|
+
<Avatar name="Jane Doe" size="lg" />
|
|
19
19
|
<Stack direction="vertical" gap={0}>
|
|
20
20
|
<Heading level={5}>Jane Doe</Heading>
|
|
21
21
|
<Text type="supporting" color="secondary">
|
|
@@ -13,14 +13,14 @@ export default function ItemWithMedia() {
|
|
|
13
13
|
return (
|
|
14
14
|
<Stack gap={0}>
|
|
15
15
|
<Item
|
|
16
|
-
startContent={<Avatar name="Ada Lovelace" size="
|
|
16
|
+
startContent={<Avatar name="Ada Lovelace" size="sm" />}
|
|
17
17
|
label="Ada Lovelace"
|
|
18
18
|
description="Design systems engineer"
|
|
19
19
|
endContent={<Badge label="Owner" variant="purple" />}
|
|
20
20
|
onClick={() => {}}
|
|
21
21
|
/>
|
|
22
22
|
<Item
|
|
23
|
-
startContent={<Avatar name="Grace Hopper" size="
|
|
23
|
+
startContent={<Avatar name="Grace Hopper" size="sm" />}
|
|
24
24
|
label="Grace Hopper"
|
|
25
25
|
description="Compiler platform"
|
|
26
26
|
endContent={<Text color="secondary">Online</Text>}
|
|
@@ -13,14 +13,14 @@ export default function ListItemWithMedia() {
|
|
|
13
13
|
<ListItem
|
|
14
14
|
label="Ada Lovelace"
|
|
15
15
|
description="Design systems engineer"
|
|
16
|
-
startContent={<Avatar name="Ada Lovelace" size="
|
|
16
|
+
startContent={<Avatar name="Ada Lovelace" size="sm" />}
|
|
17
17
|
endContent={<Badge label="Owner" variant="purple" />}
|
|
18
18
|
onClick={() => {}}
|
|
19
19
|
/>
|
|
20
20
|
<ListItem
|
|
21
21
|
label="Grace Hopper"
|
|
22
22
|
description="Platform infrastructure"
|
|
23
|
-
startContent={<Avatar name="Grace Hopper" size="
|
|
23
|
+
startContent={<Avatar name="Grace Hopper" size="sm" />}
|
|
24
24
|
endContent={<Badge label="On call" variant="blue" />}
|
|
25
25
|
onClick={() => {}}
|
|
26
26
|
/>
|
|
@@ -62,12 +62,8 @@ export default function PaginationDotsCarousel() {
|
|
|
62
62
|
<Stack direction="vertical" gap={3}>
|
|
63
63
|
<Stars count={review.stars} />
|
|
64
64
|
<Text type="body">{review.quote}</Text>
|
|
65
|
-
<Stack
|
|
66
|
-
|
|
67
|
-
gap={3}
|
|
68
|
-
vAlign="center"
|
|
69
|
-
hAlign="start">
|
|
70
|
-
<Avatar name={review.name} size="small" />
|
|
65
|
+
<Stack direction="horizontal" gap={3} vAlign="center" hAlign="start">
|
|
66
|
+
<Avatar name={review.name} size="md" />
|
|
71
67
|
<Stack direction="vertical" gap={0}>
|
|
72
68
|
<Text type="supporting" weight="bold">
|
|
73
69
|
{review.name}
|
|
@@ -17,13 +17,9 @@ export default function StackFillItem() {
|
|
|
17
17
|
return (
|
|
18
18
|
<Stack direction="vertical" gap={3} width="100%" style={{maxWidth: 300}}>
|
|
19
19
|
{USERS.map(user => (
|
|
20
|
-
<Stack
|
|
21
|
-
key={user.name}
|
|
22
|
-
direction="horizontal"
|
|
23
|
-
gap={3}
|
|
24
|
-
vAlign="center">
|
|
20
|
+
<Stack key={user.name} direction="horizontal" gap={3} vAlign="center">
|
|
25
21
|
<StackItem size="static">
|
|
26
|
-
<Avatar name={user.name} size="
|
|
22
|
+
<Avatar name={user.name} size="md" />
|
|
27
23
|
</StackItem>
|
|
28
24
|
<StackItem size="fill">
|
|
29
25
|
<Stack direction="vertical" gap={0}>
|
|
@@ -7,7 +7,7 @@ export const doc = {
|
|
|
7
7
|
name: 'TabList — With Actions',
|
|
8
8
|
displayName: 'TabList — With Actions',
|
|
9
9
|
description:
|
|
10
|
-
'Page header pattern with tabs on the left and action buttons pushed to the right. When hasDivider is true,
|
|
10
|
+
'Page header pattern with tabs on the left and action buttons pushed to the right. When hasDivider is true, match the Button size to the TabList size so the tabs and actions align to a shared baseline above the divider.',
|
|
11
11
|
isReady: true,
|
|
12
12
|
aspectRatio: 4 / 3,
|
|
13
13
|
componentsUsed: ['TabList', 'Tab', 'Button'],
|
|
@@ -55,16 +55,11 @@ export default function TabListTabsWithActions() {
|
|
|
55
55
|
<Button
|
|
56
56
|
label="Filter"
|
|
57
57
|
variant="ghost"
|
|
58
|
-
size="
|
|
58
|
+
size="lg"
|
|
59
59
|
icon={FilterIcon}
|
|
60
60
|
isIconOnly
|
|
61
61
|
/>
|
|
62
|
-
<Button
|
|
63
|
-
label="New item"
|
|
64
|
-
variant="primary"
|
|
65
|
-
size="sm"
|
|
66
|
-
icon={PlusIcon}
|
|
67
|
-
/>
|
|
62
|
+
<Button label="New item" variant="primary" size="lg" icon={PlusIcon} />
|
|
68
63
|
</div>
|
|
69
64
|
</TabList>
|
|
70
65
|
);
|
|
@@ -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: 'useTableRowStatus',
|
|
7
|
+
name: 'useTableRowStatus - Status Dots',
|
|
8
|
+
displayName: 'useTableRowStatus - Status Dots',
|
|
9
|
+
description:
|
|
10
|
+
'A job table using useTableRowStatus to render a colored status dot (or icon) per row (failed / running / queued). Rows with no status show no dot.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 16 / 9,
|
|
13
|
+
componentsUsed: ['Table'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
Table,
|
|
7
|
+
useTableRowStatus,
|
|
8
|
+
proportional,
|
|
9
|
+
pixel,
|
|
10
|
+
} from '@astryxdesign/core/Table';
|
|
11
|
+
import type {TableColumn, TableRowStatus} from '@astryxdesign/core/Table';
|
|
12
|
+
|
|
13
|
+
interface Job extends Record<string, unknown> {
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
owner: string;
|
|
17
|
+
state: 'failed' | 'running' | 'queued' | 'succeeded';
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const jobs: Job[] = [
|
|
21
|
+
{id: 'j1', name: 'build-core', owner: 'Ava', state: 'failed'},
|
|
22
|
+
{id: 'j2', name: 'lint', owner: 'Liam', state: 'running'},
|
|
23
|
+
{id: 'j3', name: 'unit-tests', owner: 'Zoe', state: 'succeeded'},
|
|
24
|
+
{id: 'j4', name: 'docsite-deploy', owner: 'Max', state: 'queued'},
|
|
25
|
+
{id: 'j5', name: 'smoke-test', owner: 'Mia', state: 'succeeded'},
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
const columns: TableColumn<Job>[] = [
|
|
29
|
+
{key: 'name', header: 'Job', width: proportional(2)},
|
|
30
|
+
{key: 'owner', header: 'Owner', width: pixel(120)},
|
|
31
|
+
{key: 'state', header: 'State', width: pixel(120)},
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
function jobStatus(job: Job): TableRowStatus | null {
|
|
35
|
+
switch (job.state) {
|
|
36
|
+
case 'failed':
|
|
37
|
+
return {color: 'error', icon: 'error', label: 'Failed'};
|
|
38
|
+
case 'running':
|
|
39
|
+
return {color: 'warning', icon: 'warning', label: 'Running'};
|
|
40
|
+
case 'queued':
|
|
41
|
+
return {color: 'gray', label: 'Queued'};
|
|
42
|
+
default:
|
|
43
|
+
return null; // succeeded: no dot
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export default function TableRowStatusTable() {
|
|
48
|
+
const rowStatus = useTableRowStatus<Job>({getStatus: jobStatus});
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<Table
|
|
52
|
+
data={jobs}
|
|
53
|
+
columns={columns}
|
|
54
|
+
idKey="id"
|
|
55
|
+
hasHover
|
|
56
|
+
plugins={{rowStatus}}
|
|
57
|
+
/>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
@@ -40,7 +40,7 @@ export default function TypeaheadItemShowcase() {
|
|
|
40
40
|
renderItem={(item: PersonItem) => (
|
|
41
41
|
<TypeaheadItem
|
|
42
42
|
item={item}
|
|
43
|
-
icon={<Avatar name={item.label} size="
|
|
43
|
+
icon={<Avatar name={item.label} size="md" />}
|
|
44
44
|
description={item.auxiliaryData.role}
|
|
45
45
|
/>
|
|
46
46
|
)}
|
|
@@ -390,7 +390,7 @@ export default function AIChatConversationTemplate() {
|
|
|
390
390
|
{/* Assistant message: tool calls, markdown, code block */}
|
|
391
391
|
<ChatMessage
|
|
392
392
|
sender="assistant"
|
|
393
|
-
avatar={<Avatar name="Agent" size="
|
|
393
|
+
avatar={<Avatar name="Agent" size="md" />}>
|
|
394
394
|
<ChatMessageBubble variant="ghost">
|
|
395
395
|
Looking into the auth files now. Let me read through the
|
|
396
396
|
code and trace the token refresh flow.
|
|
@@ -510,7 +510,7 @@ The fix is to catch \`TokenExpiredError\` specifically and attempt a refresh bef
|
|
|
510
510
|
{/* Assistant message: test results table + code block */}
|
|
511
511
|
<ChatMessage
|
|
512
512
|
sender="assistant"
|
|
513
|
-
avatar={<Avatar name="Agent" size="
|
|
513
|
+
avatar={<Avatar name="Agent" size="md" />}>
|
|
514
514
|
<ChatToolCalls
|
|
515
515
|
defaultIsExpanded
|
|
516
516
|
calls={[
|
|
@@ -608,7 +608,7 @@ The fix is to catch \`TokenExpiredError\` specifically and attempt a refresh bef
|
|
|
608
608
|
{/* Assistant message: artifact card */}
|
|
609
609
|
<ChatMessage
|
|
610
610
|
sender="assistant"
|
|
611
|
-
avatar={<Avatar name="Agent" size="
|
|
611
|
+
avatar={<Avatar name="Agent" size="md" />}>
|
|
612
612
|
<ChatMessageBubble variant="ghost">
|
|
613
613
|
<Markdown density="compact">
|
|
614
614
|
{`I've drafted a design doc covering the problem, the fix, and the test matrix — pulling straight from the changes we just made.\n\nOpen the document below to review it. Want me to expand any section?`}
|
|
@@ -647,7 +647,7 @@ The fix is to catch \`TokenExpiredError\` specifically and attempt a refresh bef
|
|
|
647
647
|
{/* Assistant message: in-progress tool call */}
|
|
648
648
|
<ChatMessage
|
|
649
649
|
sender="assistant"
|
|
650
|
-
avatar={<Avatar name="Agent" size="
|
|
650
|
+
avatar={<Avatar name="Agent" size="md" />}>
|
|
651
651
|
<ChatMessageBubble variant="ghost">
|
|
652
652
|
<Markdown density="compact">
|
|
653
653
|
{`On it — adding a **Rollout & Monitoring** section with a staged flag ramp and the alert thresholds. Updating the document now.`}
|
|
@@ -4,12 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import {useState} from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
VStack,
|
|
9
|
-
HStack,
|
|
10
|
-
Layout,
|
|
11
|
-
LayoutContent,
|
|
12
|
-
} from '@astryxdesign/core/Layout';
|
|
7
|
+
import {VStack, HStack, Layout, LayoutContent} from '@astryxdesign/core/Layout';
|
|
13
8
|
import {Text, Heading} from '@astryxdesign/core/Text';
|
|
14
9
|
import {Card} from '@astryxdesign/core/Card';
|
|
15
10
|
import {Grid, GridSpan} from '@astryxdesign/core/Grid';
|
|
@@ -642,7 +637,7 @@ function AssetRow({
|
|
|
642
637
|
label={<Text weight="bold">{ticker}</Text>}
|
|
643
638
|
description={name}
|
|
644
639
|
href="#"
|
|
645
|
-
startContent={<Avatar name={ticker} size="
|
|
640
|
+
startContent={<Avatar name={ticker} size="md" />}
|
|
646
641
|
endContent={
|
|
647
642
|
<VStack gap={0} hAlign="end">
|
|
648
643
|
<Text type="body">{value}</Text>
|
|
@@ -693,10 +688,7 @@ export default function DashboardPortfolioTemplate() {
|
|
|
693
688
|
{/* KPI metric cards */}
|
|
694
689
|
<Grid columns={{minWidth: 280, repeat: 'fit'}} gap={4}>
|
|
695
690
|
{Array.from({length: Math.ceil(metrics.length / 2)}, (_, i) => (
|
|
696
|
-
<Grid
|
|
697
|
-
key={i}
|
|
698
|
-
columns={{minWidth: 280, repeat: 'fit'}}
|
|
699
|
-
gap={4}>
|
|
691
|
+
<Grid key={i} columns={{minWidth: 280, repeat: 'fit'}} gap={4}>
|
|
700
692
|
{metrics.slice(i * 2, i * 2 + 2).map(m => (
|
|
701
693
|
<MetricCard key={m.label} {...m} />
|
|
702
694
|
))}
|