@astryxdesign/cli 0.1.0-canary.f94dd07 → 0.1.1-canary.a514b99
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 +68 -0
- package/README.md +117 -75
- package/bin/astryx.mjs +22 -7
- package/docs/icons.doc.mjs +1 -1
- package/docs/migration.doc.mjs +2 -2
- package/docs/shape.doc.mjs +1 -1
- package/docs/styling.doc.mjs +2 -2
- package/docs/theme.doc.dense.mjs +2 -2
- package/docs/theme.doc.mjs +14 -0
- package/docs/theme.doc.zh.mjs +2 -2
- package/docs/working-with-ai.doc.mjs +4 -4
- package/package.json +8 -8
- package/src/api/search.mjs +207 -13
- package/src/api/template.mjs +2 -1
- package/src/codemods/__tests__/registry.test.mjs +1 -0
- package/src/codemods/registry.mjs +1 -0
- package/src/codemods/runner.mjs +105 -51
- package/src/codemods/transforms/v0.1.0/__tests__/migrate-xds-config-surfaces.test.mjs +116 -0
- package/src/codemods/transforms/v0.1.0/__tests__/migrate-xds-module-specifiers.test.mjs +51 -0
- package/src/codemods/transforms/v0.1.0/index.mjs +28 -0
- package/src/codemods/transforms/v0.1.0/migrate-xds-config-surfaces.mjs +230 -0
- package/src/codemods/transforms/v0.1.0/migrate-xds-module-specifiers.mjs +84 -0
- package/src/commands/agent-docs.mjs +92 -56
- package/src/commands/agent-docs.path-safety.test.mjs +1 -1
- package/src/commands/agent-docs.test.mjs +66 -10
- package/src/commands/build-theme.import-path.test.mjs +1 -1
- package/src/commands/build-theme.path-safety.test.mjs +1 -1
- package/src/commands/build-theme.prose.test.mjs +1 -1
- package/src/commands/build.mjs +196 -0
- package/src/commands/component-package.test.mjs +1 -1
- package/src/commands/component.test.mjs +1 -1
- package/src/commands/docs.test.mjs +1 -1
- package/src/commands/doctor.test.mjs +1 -1
- package/src/commands/external-showcase.test.mjs +1 -1
- package/src/commands/init.mjs +9 -1
- package/src/commands/interactive-guard.test.mjs +1 -1
- package/src/commands/json-contract.test.mjs +10 -3
- package/src/commands/swizzle-gap-safety.test.mjs +1 -1
- package/src/commands/swizzle.path-safety.test.mjs +1 -1
- package/src/commands/template.path-safety.test.mjs +1 -1
- package/src/commands/template.test.mjs +1 -1
- package/src/commands/upgrade.mjs +353 -169
- package/src/commands/upgrade.test.mjs +41 -27
- package/src/index.mjs +1 -0
- package/src/lib/config.mjs +12 -0
- package/src/lib/config.test.mjs +42 -0
- package/src/lib/error-codes.mjs +3 -0
- package/src/types/error-codes.d.ts +1 -0
- package/src/utils/interactive.mjs +1 -1
- package/src/utils/interactive.test.mjs +2 -0
- package/src/utils/package-manager.test.mjs +1 -1
- package/src/utils/path-safety.test.mjs +1 -1
- package/src/utils/paths.test.mjs +8 -8
- package/src/utils/update-check.mjs +4 -26
- package/src/utils/update-check.test.mjs +2 -64
- package/templates/blocks/components/AppShell/AppShellContentOnly.tsx +1 -9
- package/templates/blocks/components/AppShell/AppShellShowcase.tsx +1 -10
- package/templates/blocks/components/AppShell/AppShellSideNavOnly.tsx +1 -9
- package/templates/blocks/components/AppShell/AppShellTopNavOnly.tsx +1 -9
- package/templates/blocks/components/AppShell/AppShellTopNavWithSideNav.tsx +1 -9
- package/templates/blocks/components/AppShell/AppShellWithBanner.tsx +1 -9
- package/templates/blocks/components/AspectRatio/AspectRatioShowcase.tsx +12 -19
- package/templates/blocks/components/Banner/BannerShowcase.tsx +1 -8
- package/templates/blocks/components/Blockquote/BlockquoteShowcase.tsx +1 -8
- package/templates/blocks/components/Carousel/CarouselShowcase.tsx +2 -12
- package/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerShowcase.tsx +6 -9
- package/templates/blocks/components/ChatLayout/ChatLayoutPanelChat.tsx +10 -12
- package/templates/blocks/components/ChatMessageList/ChatMessageListDensity.tsx +1 -9
- package/templates/blocks/components/ChatMessageList/ChatMessageListFullFeatured.tsx +1 -9
- package/templates/blocks/components/ChatMessageList/ChatMessageListShowcase.tsx +1 -9
- package/templates/blocks/components/ChatMessageMetadata/ChatMessageMetadataShowcase.tsx +1 -8
- package/templates/blocks/components/ChatSendButton/ChatSendButtonInComposer.tsx +1 -8
- package/templates/blocks/components/Citation/CitationInlineText.tsx +4 -4
- package/templates/blocks/components/Code/CodeInlineInParagraph.tsx +1 -8
- package/templates/blocks/components/CodeBlock/CodeBlockBashCommand.tsx +1 -1
- package/templates/blocks/components/CodeBlock/CodeBlockJSONConfig.tsx +1 -1
- package/templates/blocks/components/CommandPaletteItem/CommandPaletteItemShowcase.tsx +9 -12
- package/templates/blocks/components/ContextMenu/ContextMenuShowcase.tsx +13 -15
- package/templates/blocks/components/Divider/DividerShowcase.tsx +1 -8
- package/templates/blocks/components/Divider/DividerVertical.tsx +7 -9
- package/templates/blocks/components/Field/FieldShowcase.tsx +1 -8
- package/templates/blocks/components/FormLayout/FormLayoutHorizontal.tsx +1 -6
- package/templates/blocks/components/Grid/GridResponsiveAutoFit.tsx +1 -9
- package/templates/blocks/components/HoverCard/HoverCardInlineTextHoverCard.tsx +4 -6
- package/templates/blocks/components/HoverCard/HoverCardInteractiveContent.tsx +1 -6
- package/templates/blocks/components/HoverCard/HoverCardProfileHoverCard.tsx +2 -8
- package/templates/blocks/components/HoverCard/HoverCardShowcase.tsx +1 -8
- package/templates/blocks/components/MoreMenu/MoreMenuInToolbar.tsx +2 -12
- package/templates/blocks/components/OverflowList/OverflowListOverflowBadges.tsx +8 -11
- package/templates/blocks/components/OverflowList/OverflowListOverflowDropdownActions.tsx +9 -12
- package/templates/blocks/components/Overlay/OverlayBottomStrip.tsx +4 -17
- package/templates/blocks/components/Overlay/OverlayHoverReveal.tsx +15 -16
- package/templates/blocks/components/Overlay/OverlayShowcase.tsx +5 -21
- package/templates/blocks/components/Pagination/PaginationDotsCarousel.tsx +2 -14
- package/templates/blocks/components/Pagination/PaginationPageSize.tsx +12 -14
- package/templates/blocks/components/Pagination/PaginationVariants.tsx +1 -8
- package/templates/blocks/components/Pagination/PaginationWithTable.tsx +2 -14
- package/templates/blocks/components/Tokenizer/TokenizerClear.tsx +1 -6
- package/templates/blocks/components/Tokenizer/TokenizerCreatable.tsx +2 -7
- package/templates/blocks/components/Tokenizer/TokenizerEndContent.tsx +1 -6
- package/templates/blocks/components/Tokenizer/TokenizerIcon.tsx +1 -6
- package/templates/blocks/components/Tokenizer/TokenizerMaxEntries.tsx +1 -6
- package/templates/blocks/components/Tokenizer/TokenizerOverflow.tsx +2 -7
- package/templates/blocks/components/Tokenizer/TokenizerShowcase.tsx +1 -6
- package/templates/blocks/components/Tokenizer/TokenizerStates.tsx +4 -9
- package/templates/blocks/components/Toolbar/ToolbarCardHeader.tsx +1 -10
- package/templates/blocks/components/Toolbar/ToolbarSizes.tsx +1 -8
- package/templates/blocks/components/Toolbar/ToolbarTableFilter.tsx +1 -8
- package/templates/blocks/components/Toolbar/ToolbarThreeSlot.tsx +1 -10
- package/templates/blocks/components/Toolbar/ToolbarWithTabs.tsx +8 -11
- package/templates/pages/ai-chat/page.tsx +71 -64
- package/templates/pages/ai-chat-landing/page.tsx +8 -12
- package/templates/pages/centered-hero/page.tsx +13 -15
- package/templates/pages/classic-gallery/page.tsx +27 -34
- package/templates/pages/detail-page/page.tsx +18 -18
- package/templates/pages/documentation/page.tsx +11 -14
- package/templates/pages/documentation-design/page.tsx +10 -13
- package/templates/pages/documentation-technical/page.tsx +15 -16
- package/templates/pages/editor/page.tsx +42 -54
- package/templates/pages/file-explorer/page.tsx +13 -16
- package/templates/pages/form-two-column/page.tsx +13 -17
- package/templates/pages/gallery-hero/page.tsx +13 -15
- package/templates/pages/ide/page.tsx +32 -39
- package/templates/pages/library/page.tsx +16 -23
- package/templates/pages/login/page.tsx +14 -18
- package/templates/pages/login-card/page.tsx +14 -18
- package/templates/pages/login-split/page.tsx +50 -48
- package/templates/pages/login-sso/page.tsx +9 -13
- package/templates/pages/mixed-gallery/page.tsx +51 -45
- package/templates/pages/payment-form/page.tsx +56 -70
- package/templates/pages/product-detail/page.tsx +27 -33
- package/templates/pages/product-gallery/page.tsx +7 -13
- package/templates/pages/settings-dialog/page.tsx +35 -43
- package/templates/pages/settings-sidebar/page.tsx +39 -47
- package/templates/pages/side-gallery/page.tsx +6 -9
- package/templates/pages/table-grouped/page.tsx +11 -15
- package/templates/pages/theme-showcase/page.tsx +33 -37
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
'use client';
|
|
4
4
|
|
|
5
5
|
import {type CSSProperties, type ReactNode} from 'react';
|
|
6
|
-
import * as stylex from '@stylexjs/stylex';
|
|
7
6
|
import {
|
|
8
7
|
Plus,
|
|
9
8
|
Search,
|
|
@@ -55,10 +54,10 @@ import {
|
|
|
55
54
|
ChatSystemMessage,
|
|
56
55
|
} from '@astryxdesign/core/Chat';
|
|
57
56
|
|
|
58
|
-
// Styles passed to Astryx components via their `
|
|
59
|
-
//
|
|
60
|
-
// and in the live playground preview alike.
|
|
61
|
-
const styles =
|
|
57
|
+
// Styles passed to Astryx components via their `style` prop. Astryx components
|
|
58
|
+
// forward the DOM `style` prop, so these work with no CSS compiler — in
|
|
59
|
+
// compiled builds and in the live playground preview alike.
|
|
60
|
+
const styles: Record<string, CSSProperties> = {
|
|
62
61
|
card: {
|
|
63
62
|
backgroundColor: 'var(--color-background-body)',
|
|
64
63
|
color: 'var(--color-text-primary)',
|
|
@@ -169,14 +168,11 @@ const styles = stylex.create({
|
|
|
169
168
|
cartButton: {
|
|
170
169
|
flex: 1,
|
|
171
170
|
},
|
|
172
|
-
}
|
|
171
|
+
};
|
|
173
172
|
|
|
174
173
|
// Styles applied directly to plain DOM elements via the `style` prop.
|
|
175
|
-
//
|
|
176
|
-
//
|
|
177
|
-
// no-op there, so raw `{...stylex.props(...)}` on a <div>/<img> would lose
|
|
178
|
-
// these declarations. All are static (no media/pseudo variants), so inline
|
|
179
|
-
// styles reproduce them exactly.
|
|
174
|
+
// Plain inline styles so they render with no CSS compiler. All are static
|
|
175
|
+
// (no media/pseudo variants), so inline styles reproduce them exactly.
|
|
180
176
|
const inlineStyles: Record<string, CSSProperties> = {
|
|
181
177
|
inventoryBannerWrap: {
|
|
182
178
|
paddingInline: 'var(--spacing-6)',
|
|
@@ -439,10 +435,10 @@ function StorePreview({
|
|
|
439
435
|
/>
|
|
440
436
|
|
|
441
437
|
<Section padding={6} variant="transparent">
|
|
442
|
-
<VStack gap={10}
|
|
438
|
+
<VStack gap={10} style={{...styles.content, ...styles.contentFluid}}>
|
|
443
439
|
<Center>
|
|
444
|
-
<VStack gap={4} hAlign="center"
|
|
445
|
-
<Text type="display-2"
|
|
440
|
+
<VStack gap={4} hAlign="center" style={styles.heroText}>
|
|
441
|
+
<Text type="display-2" style={styles.heroHeadline}>
|
|
446
442
|
Little joys,
|
|
447
443
|
<br />
|
|
448
444
|
everywhere you go
|
|
@@ -457,7 +453,7 @@ function StorePreview({
|
|
|
457
453
|
<Grid columns={isMobile ? 1 : {minWidth: 200, max: 3}} gap={4}>
|
|
458
454
|
{products.map((p, i) => (
|
|
459
455
|
<Card key={p.name} padding={0} height="100%">
|
|
460
|
-
<VStack gap={0}
|
|
456
|
+
<VStack gap={0} style={styles.cardStack}>
|
|
461
457
|
<AspectRatio ratio={1}>
|
|
462
458
|
<img
|
|
463
459
|
src={images[PRODUCT_IMAGE_KEYS[i]]}
|
|
@@ -469,17 +465,17 @@ function StorePreview({
|
|
|
469
465
|
<VStack
|
|
470
466
|
gap={2}
|
|
471
467
|
hAlign="center"
|
|
472
|
-
|
|
468
|
+
style={styles.cardStack}>
|
|
473
469
|
<HStack>
|
|
474
470
|
<Badge label={p.badge} variant={p.badgeVariant} />
|
|
475
471
|
</HStack>
|
|
476
|
-
<Heading level={2}
|
|
472
|
+
<Heading level={2} style={styles.centerText}>
|
|
477
473
|
{p.name}
|
|
478
474
|
</Heading>
|
|
479
475
|
<Text
|
|
480
476
|
type="supporting"
|
|
481
477
|
color="secondary"
|
|
482
|
-
|
|
478
|
+
style={{...styles.cardDescription, ...styles.centerText}}>
|
|
483
479
|
{p.description}
|
|
484
480
|
</Text>
|
|
485
481
|
<HStack gap={2} vAlign="center" hAlign="center">
|
|
@@ -491,14 +487,14 @@ function StorePreview({
|
|
|
491
487
|
min={1}
|
|
492
488
|
max={99}
|
|
493
489
|
size="sm"
|
|
494
|
-
|
|
490
|
+
style={styles.quantityInput}
|
|
495
491
|
/>
|
|
496
492
|
<Button
|
|
497
493
|
label="Add to cart"
|
|
498
494
|
variant="secondary"
|
|
499
495
|
size="sm"
|
|
500
496
|
href="#"
|
|
501
|
-
|
|
497
|
+
style={styles.cartButton}
|
|
502
498
|
/>
|
|
503
499
|
</HStack>
|
|
504
500
|
</VStack>
|
|
@@ -516,11 +512,11 @@ function StorePreview({
|
|
|
516
512
|
|
|
517
513
|
function CheckoutCard({isMobile}: {isMobile: boolean}) {
|
|
518
514
|
return (
|
|
519
|
-
<Card padding={5}
|
|
520
|
-
<VStack gap={4}
|
|
515
|
+
<Card padding={5} style={styles.card}>
|
|
516
|
+
<VStack gap={4} style={styles.checkoutStack}>
|
|
521
517
|
<Heading level={2}>Checkout</Heading>
|
|
522
518
|
|
|
523
|
-
<VStack gap={3}
|
|
519
|
+
<VStack gap={3} style={styles.checkoutStack}>
|
|
524
520
|
<TextInput
|
|
525
521
|
label="Email"
|
|
526
522
|
placeholder="you@studio.com"
|
|
@@ -566,7 +562,7 @@ function CheckoutCard({isMobile}: {isMobile: boolean}) {
|
|
|
566
562
|
/>
|
|
567
563
|
</RadioList>
|
|
568
564
|
|
|
569
|
-
<VStack gap={2}
|
|
565
|
+
<VStack gap={2} style={styles.checkoutStack}>
|
|
570
566
|
<Text type="supporting" weight="bold">
|
|
571
567
|
Payment method
|
|
572
568
|
</Text>
|
|
@@ -579,7 +575,7 @@ function CheckoutCard({isMobile}: {isMobile: boolean}) {
|
|
|
579
575
|
<VStack
|
|
580
576
|
gap={1}
|
|
581
577
|
hAlign="center"
|
|
582
|
-
|
|
578
|
+
style={styles.paymentCardContent}>
|
|
583
579
|
<CreditCard size={20} />
|
|
584
580
|
<Text type="supporting" weight="bold">
|
|
585
581
|
Card
|
|
@@ -594,7 +590,7 @@ function CheckoutCard({isMobile}: {isMobile: boolean}) {
|
|
|
594
590
|
<VStack
|
|
595
591
|
gap={1}
|
|
596
592
|
hAlign="center"
|
|
597
|
-
|
|
593
|
+
style={styles.paymentCardContent}>
|
|
598
594
|
<Smartphone size={20} />
|
|
599
595
|
<Text type="supporting" weight="bold">
|
|
600
596
|
Apple Pay
|
|
@@ -609,7 +605,7 @@ function CheckoutCard({isMobile}: {isMobile: boolean}) {
|
|
|
609
605
|
<VStack
|
|
610
606
|
gap={1}
|
|
611
607
|
hAlign="center"
|
|
612
|
-
|
|
608
|
+
style={styles.paymentCardContent}>
|
|
613
609
|
<Wallet size={20} />
|
|
614
610
|
<Text type="supporting" weight="bold">
|
|
615
611
|
Google Pay
|
|
@@ -687,12 +683,12 @@ const SUGGESTED_QUESTIONS = [
|
|
|
687
683
|
|
|
688
684
|
function ChatCard() {
|
|
689
685
|
return (
|
|
690
|
-
<Card padding={0}
|
|
686
|
+
<Card padding={0} style={styles.chatCard}>
|
|
691
687
|
<HStack
|
|
692
688
|
hAlign="between"
|
|
693
689
|
vAlign="center"
|
|
694
690
|
gap={3}
|
|
695
|
-
|
|
691
|
+
style={styles.chatHeader}>
|
|
696
692
|
<Heading level={2}>Studio AI</Heading>
|
|
697
693
|
|
|
698
694
|
<HStack gap={1} vAlign="center">
|
|
@@ -894,8 +890,8 @@ function formatAmount(amount: number): string {
|
|
|
894
890
|
|
|
895
891
|
function LatestActivityCard({isMobile}: {isMobile: boolean}) {
|
|
896
892
|
return (
|
|
897
|
-
<Card padding={5}
|
|
898
|
-
<VStack gap={4}
|
|
893
|
+
<Card padding={5} style={styles.activityCard}>
|
|
894
|
+
<VStack gap={4} style={styles.activityCardStack}>
|
|
899
895
|
<Heading level={2}>Revenue</Heading>
|
|
900
896
|
|
|
901
897
|
<Grid columns={isMobile ? 1 : 2} gap={3}>
|
|
@@ -920,7 +916,7 @@ function LatestActivityCard({isMobile}: {isMobile: boolean}) {
|
|
|
920
916
|
<Link href="#">See all</Link>
|
|
921
917
|
</HStack>
|
|
922
918
|
|
|
923
|
-
<VStack gap={1}
|
|
919
|
+
<VStack gap={1} style={styles.activityListFade}>
|
|
924
920
|
{ACTIVITY.map(item => (
|
|
925
921
|
<Item
|
|
926
922
|
key={item.id}
|
|
@@ -1110,11 +1106,11 @@ function InventoryCard({
|
|
|
1110
1106
|
row => row.available < LOW_STOCK_THRESHOLD,
|
|
1111
1107
|
).length;
|
|
1112
1108
|
return (
|
|
1113
|
-
<Card padding={0}
|
|
1109
|
+
<Card padding={0} style={styles.inventoryCard}>
|
|
1114
1110
|
<HStack
|
|
1115
1111
|
hAlign="between"
|
|
1116
1112
|
vAlign="center"
|
|
1117
|
-
|
|
1113
|
+
style={styles.inventoryHeader}>
|
|
1118
1114
|
<Heading level={2}>Inventory</Heading>
|
|
1119
1115
|
<Button
|
|
1120
1116
|
label="Add item"
|
|
@@ -1130,7 +1126,7 @@ function InventoryCard({
|
|
|
1130
1126
|
gap={3}
|
|
1131
1127
|
vAlign="center"
|
|
1132
1128
|
hAlign="between"
|
|
1133
|
-
|
|
1129
|
+
style={styles.inventoryFilterRow}>
|
|
1134
1130
|
<HStack gap={2} vAlign="center" style={{flex: 1, minWidth: 0}}>
|
|
1135
1131
|
<TextInput
|
|
1136
1132
|
label="Search inventory"
|
|
@@ -1139,7 +1135,7 @@ function InventoryCard({
|
|
|
1139
1135
|
value=""
|
|
1140
1136
|
onChange={() => {}}
|
|
1141
1137
|
startIcon={<Search size={16} />}
|
|
1142
|
-
|
|
1138
|
+
style={styles.searchInput}
|
|
1143
1139
|
/>
|
|
1144
1140
|
<OverflowList
|
|
1145
1141
|
gap={2}
|
|
@@ -1226,7 +1222,7 @@ function InventoryCard({
|
|
|
1226
1222
|
</div>
|
|
1227
1223
|
)}
|
|
1228
1224
|
|
|
1229
|
-
<div {
|
|
1225
|
+
<div style={styles.inventoryTableWrap}>
|
|
1230
1226
|
<Table<InventoryRow>
|
|
1231
1227
|
data={inventory}
|
|
1232
1228
|
columns={[
|