@astryxdesign/cli 0.1.4 → 0.1.5-canary.76e6697

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 (75) hide show
  1. package/CHANGELOG.md +45 -1
  2. package/docs/getting-started.doc.mjs +4 -0
  3. package/docs/migration.doc.mjs +134 -0
  4. package/docs/styling.doc.mjs +53 -0
  5. package/docs/working-with-ai.doc.mjs +1 -1
  6. package/package.json +15 -10
  7. package/src/api/component.mjs +2 -1
  8. package/src/api/doctor.mjs +13 -2
  9. package/src/api/template.mjs +14 -3
  10. package/src/codemods/__tests__/registry.test.mjs +1 -0
  11. package/src/codemods/__tests__/runner.test.mjs +38 -0
  12. package/src/codemods/registry.mjs +1 -0
  13. package/src/codemods/runner.mjs +2 -0
  14. package/src/codemods/transforms/v0.1.5/__tests__/rename-switch-label-spacing-default-to-hug.test.mjs +93 -0
  15. package/src/codemods/transforms/v0.1.5/index.mjs +19 -0
  16. package/src/codemods/transforms/v0.1.5/rename-switch-label-spacing-default-to-hug.mjs +140 -0
  17. package/src/commands/agent-docs.mjs +9 -6
  18. package/src/commands/agent-docs.test.mjs +33 -0
  19. package/src/commands/build-theme.color-scheme.test.mjs +153 -0
  20. package/src/commands/build-theme.mjs +112 -14
  21. package/src/commands/build-theme.variants.test.mjs +193 -0
  22. package/src/commands/component-resolution.test.mjs +4 -4
  23. package/src/commands/doctor.test.mjs +34 -0
  24. package/src/commands/init.mjs +1 -1
  25. package/src/commands/swizzle.mjs +34 -0
  26. package/src/commands/swizzle.routing.test.mjs +67 -0
  27. package/src/lib/component-discovery.mjs +8 -4
  28. package/templates/blocks/components/AspectRatio/AspectRatioCircleImage.tsx +1 -6
  29. package/templates/blocks/components/AspectRatio/AspectRatioImageGallery.tsx +2 -7
  30. package/templates/blocks/components/AspectRatio/AspectRatioShowcase.tsx +2 -5
  31. package/templates/blocks/components/AspectRatio/AspectRatioSquareImage.tsx +1 -6
  32. package/templates/blocks/components/AspectRatio/AspectRatioWidescreen.tsx +1 -6
  33. package/templates/blocks/components/BaseTypeahead/BaseTypeaheadCustomSearch.doc.mjs +14 -0
  34. package/templates/blocks/components/BaseTypeahead/BaseTypeaheadCustomSearch.tsx +58 -0
  35. package/templates/blocks/components/CodeBlock/CodeBlockTerminal.doc.mjs +14 -0
  36. package/templates/blocks/components/CodeBlock/CodeBlockTerminal.tsx +24 -0
  37. package/templates/blocks/components/Collapsible/CollapsibleDividedAccordion.doc.mjs +13 -0
  38. package/templates/blocks/components/Collapsible/CollapsibleDividedAccordion.tsx +33 -0
  39. package/templates/blocks/components/Collapsible/CollapsibleWithoutCard.tsx +25 -23
  40. package/templates/blocks/components/CommandPaletteGroup/CommandPaletteGroupShowcase.tsx +27 -48
  41. package/templates/blocks/components/CommandPaletteInput/CommandPaletteInputBasic.doc.mjs +15 -0
  42. package/templates/blocks/components/CommandPaletteInput/CommandPaletteInputBasic.tsx +39 -0
  43. package/templates/blocks/components/CommandPaletteInput/CommandPaletteInputShowcase.doc.mjs +15 -0
  44. package/templates/blocks/components/CommandPaletteInput/CommandPaletteInputShowcase.tsx +39 -0
  45. package/templates/blocks/components/CommandPaletteItem/CommandPaletteItemShowcase.tsx +31 -54
  46. package/templates/blocks/components/CommandPaletteList/CommandPaletteListBasic.doc.mjs +15 -0
  47. package/templates/blocks/components/CommandPaletteList/CommandPaletteListBasic.tsx +27 -0
  48. package/templates/blocks/components/CommandPaletteList/CommandPaletteListShowcase.doc.mjs +15 -0
  49. package/templates/blocks/components/CommandPaletteList/CommandPaletteListShowcase.tsx +38 -0
  50. package/templates/blocks/components/ContextMenuItem/ContextMenuItemBasic.doc.mjs +14 -0
  51. package/templates/blocks/components/ContextMenuItem/ContextMenuItemBasic.tsx +44 -0
  52. package/templates/blocks/components/ContextMenuItem/ContextMenuItemShowcase.doc.mjs +15 -0
  53. package/templates/blocks/components/ContextMenuItem/ContextMenuItemShowcase.tsx +107 -0
  54. package/templates/blocks/components/NavHeadingMenu/NavHeadingMenuShowcase.doc.mjs +15 -0
  55. package/templates/blocks/components/NavHeadingMenu/NavHeadingMenuShowcase.tsx +47 -0
  56. package/templates/blocks/components/Table/TableGroupedRowsTable.doc.mjs +14 -0
  57. package/templates/blocks/components/Table/TableGroupedRowsTable.tsx +66 -0
  58. package/templates/pages/classic-gallery/page.tsx +1 -1
  59. package/templates/pages/dashboard/page.tsx +1 -1
  60. package/templates/pages/documentation/page.tsx +1 -1
  61. package/templates/pages/incident-console/page.tsx +580 -0
  62. package/templates/pages/incident-console/template.doc.mjs +12 -0
  63. package/templates/pages/kanban-board/page.tsx +37 -13
  64. package/templates/pages/messaging-shell/page.tsx +676 -0
  65. package/templates/pages/messaging-shell/template.doc.mjs +12 -0
  66. package/templates/pages/mixed-gallery/page.tsx +1 -1
  67. package/templates/pages/payment-form/page.tsx +2 -6
  68. package/templates/pages/product-detail/page.tsx +3 -11
  69. package/templates/pages/product-gallery/page.tsx +1 -1
  70. package/templates/pages/settings/page.tsx +1 -1
  71. package/templates/pages/side-gallery/page.tsx +1 -1
  72. package/templates/pages/table-page/page.tsx +1 -1
  73. package/templates/pages/table-page-chart/page.tsx +4 -14
  74. package/templates/pages/table-page-heatmap-status/page.tsx +1 -1
  75. package/templates/pages/table-page-shoe-store-heatmap/page.tsx +5 -19
@@ -153,10 +153,6 @@ const fmt = (n: number) => `$${n.toFixed(2)}`;
153
153
  // :root by `@astryxdesign/core/astryx.css`). No StyleX compiler required.
154
154
 
155
155
  const fullWidth: CSSProperties = {width: '100%'};
156
- // LayoutContent clips overflow by default, which traps position:sticky
157
- // children (the sticky order summary). With height="auto" the page scrolls
158
- // at the window, so let overflow be visible here so sticky can pin.
159
- const visibleOverflow: CSSProperties = {overflow: 'visible'};
160
156
  // Form column flex-basis so the two checkout columns share width evenly.
161
157
  const formColBasis: CSSProperties = {flexBasis: 0};
162
158
  // Space the Order Summary content below its collapsible trigger title.
@@ -266,9 +262,9 @@ export default function PaymentFormPage() {
266
262
 
267
263
  return (
268
264
  <Layout
269
- height="auto"
265
+ height="fill"
270
266
  content={
271
- <LayoutContent padding={0} style={visibleOverflow}>
267
+ <LayoutContent padding={0}>
272
268
  <Center axis="horizontal">
273
269
  <Section
274
270
  variant="transparent"
@@ -3,12 +3,7 @@
3
3
  'use client';
4
4
 
5
5
  import {useState} from 'react';
6
- import {
7
- VStack,
8
- HStack,
9
- Layout,
10
- LayoutContent,
11
- } from '@astryxdesign/core/Layout';
6
+ import {VStack, HStack, Layout, LayoutContent} from '@astryxdesign/core/Layout';
12
7
  import {Center} from '@astryxdesign/core/Center';
13
8
  import {Grid} from '@astryxdesign/core/Grid';
14
9
  import {Text, Heading} from '@astryxdesign/core/Text';
@@ -203,10 +198,7 @@ function ProductInfo() {
203
198
  <VStack gap={2}>
204
199
  <Text type="label">Finish</Text>
205
200
  <VStack hAlign="start">
206
- <SegmentedControl
207
- value={finish}
208
- onChange={setFinish}
209
- label="Finish">
201
+ <SegmentedControl value={finish} onChange={setFinish} label="Finish">
210
202
  {FINISHES.map(f => (
211
203
  <SegmentedControlItem
212
204
  key={f.value}
@@ -286,7 +278,7 @@ export default function ProductDetailTemplate() {
286
278
 
287
279
  return (
288
280
  <Layout
289
- height="auto"
281
+ height="fill"
290
282
  contentWidth={1200}
291
283
  content={
292
284
  <LayoutContent padding={6}>
@@ -119,7 +119,7 @@ function ProductCard({product}: {product: Product}) {
119
119
  export default function ProductGalleryTemplate() {
120
120
  return (
121
121
  <Layout
122
- height="auto"
122
+ height="fill"
123
123
  contentWidth={1200}
124
124
  content={
125
125
  <LayoutContent padding={6}>
@@ -70,7 +70,7 @@ export default function SettingsTemplate() {
70
70
 
71
71
  return (
72
72
  <Layout
73
- height="auto"
73
+ height="fill"
74
74
  contentWidth={1440}
75
75
  header={
76
76
  <LayoutHeader hasDivider>
@@ -101,7 +101,7 @@ function ImageGrid() {
101
101
  export default function SideGalleryTemplate() {
102
102
  return (
103
103
  <Layout
104
- height="auto"
104
+ height="fill"
105
105
  contentWidth={1400}
106
106
  content={
107
107
  <LayoutContent padding={6}>
@@ -389,7 +389,7 @@ export default function TablePageTemplate() {
389
389
 
390
390
  return (
391
391
  <Layout
392
- height="auto"
392
+ height="fill"
393
393
  header={
394
394
  <LayoutHeader hasDivider>
395
395
  <HStack gap={2} vAlign="center">
@@ -19,13 +19,7 @@ import {Link} from '@astryxdesign/core/Link';
19
19
  import {Thumbnail} from '@astryxdesign/core/Thumbnail';
20
20
  import {Table, proportional, pixel} from '@astryxdesign/core/Table';
21
21
  import type {TableColumn} from '@astryxdesign/core/Table';
22
- import {
23
- ChartV2 as Chart,
24
- ChartGrid,
25
- ChartAxis,
26
- area,
27
- line,
28
- } from '@astryxdesign/lab';
22
+ import {Chart, ChartGrid, ChartAxis, area, line} from '@astryxdesign/charts';
29
23
  import {
30
24
  FunnelIcon,
31
25
  ArrowDownTrayIcon,
@@ -481,17 +475,13 @@ const columns: TableColumn<OrderRow>[] = [
481
475
  key: 'amount',
482
476
  header: 'Amount',
483
477
  width: pixel(90),
484
- renderCell: (item: OrderRow) => (
485
- <Text type="body">${item.amount}</Text>
486
- ),
478
+ renderCell: (item: OrderRow) => <Text type="body">${item.amount}</Text>,
487
479
  },
488
480
  {
489
481
  key: 'customer',
490
482
  header: 'Customer',
491
483
  width: proportional(2),
492
- renderCell: (item: OrderRow) => (
493
- <Text type="body">{item.customer}</Text>
494
- ),
484
+ renderCell: (item: OrderRow) => <Text type="body">{item.customer}</Text>,
495
485
  },
496
486
  {
497
487
  key: 'email',
@@ -523,7 +513,7 @@ const columns: TableColumn<OrderRow>[] = [
523
513
  export default function TablePageChartTemplate() {
524
514
  return (
525
515
  <Layout
526
- height="auto"
516
+ height="fill"
527
517
  header={
528
518
  <LayoutHeader hasDivider>
529
519
  <HStack gap={2} vAlign="center">
@@ -430,7 +430,7 @@ function OutageHeatmap() {
430
430
  export default function TablePageHeatmapStatusTemplate() {
431
431
  return (
432
432
  <Layout
433
- height="auto"
433
+ height="fill"
434
434
  header={
435
435
  <LayoutHeader hasDivider>
436
436
  <HStack gap={2} vAlign="center">
@@ -19,13 +19,7 @@ import {Link} from '@astryxdesign/core/Link';
19
19
  import {Thumbnail} from '@astryxdesign/core/Thumbnail';
20
20
  import {Table, proportional, pixel} from '@astryxdesign/core/Table';
21
21
  import type {TableColumn} from '@astryxdesign/core/Table';
22
- import {
23
- ChartV2 as Chart,
24
- ChartGrid,
25
- ChartAxis,
26
- area,
27
- line,
28
- } from '@astryxdesign/lab';
22
+ import {Chart, ChartGrid, ChartAxis, area, line} from '@astryxdesign/charts';
29
23
  import {
30
24
  FunnelIcon,
31
25
  ArrowDownTrayIcon,
@@ -35,11 +29,7 @@ import {
35
29
  // ============= DATA =============
36
30
 
37
31
  type ProductCategory =
38
- | 'Running'
39
- | 'Lifestyle'
40
- | 'Basketball'
41
- | 'Training'
42
- | 'Skateboarding';
32
+ 'Running' | 'Lifestyle' | 'Basketball' | 'Training' | 'Skateboarding';
43
33
 
44
34
  function shoeSvg(bg: string, accent: string) {
45
35
  const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect width="100" height="100" rx="12" fill="${bg}"/><g transform="translate(22.5, 22.5) scale(2.29)" fill="none" stroke="${accent}" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="m15 10.42 4.8-5.07"/><path d="M19 18h3"/><path d="M9.5 22 21.414 9.415A2 2 0 0 0 21.2 6.4l-5.61-4.208A1 1 0 0 0 14 3v2a2 2 0 0 1-1.394 1.906L8.677 8.053A1 1 0 0 0 8 9c-.155 6.393-2.082 9-4 9a2 2 0 0 0 0 4h14"/></g></svg>`;
@@ -839,17 +829,13 @@ const columns: TableColumn<OrderRow>[] = [
839
829
  key: 'amount',
840
830
  header: 'Amount',
841
831
  width: pixel(90),
842
- renderCell: (item: OrderRow) => (
843
- <Text type="body">${item.amount}</Text>
844
- ),
832
+ renderCell: (item: OrderRow) => <Text type="body">${item.amount}</Text>,
845
833
  },
846
834
  {
847
835
  key: 'customer',
848
836
  header: 'Customer',
849
837
  width: proportional(2),
850
- renderCell: (item: OrderRow) => (
851
- <Text type="body">{item.customer}</Text>
852
- ),
838
+ renderCell: (item: OrderRow) => <Text type="body">{item.customer}</Text>,
853
839
  },
854
840
  {
855
841
  key: 'email',
@@ -881,7 +867,7 @@ const columns: TableColumn<OrderRow>[] = [
881
867
  export default function TablePageShoeStoreHeatmapTemplate() {
882
868
  return (
883
869
  <Layout
884
- height="auto"
870
+ height="fill"
885
871
  header={
886
872
  <LayoutHeader hasDivider>
887
873
  <HStack gap={2} vAlign="center">