prev-cli 0.24.20 → 0.25.0

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 (150) hide show
  1. package/dist/cli.js +2006 -1714
  2. package/dist/previews/components/cart-item/index.d.ts +5 -0
  3. package/dist/previews/components/price-tag/index.d.ts +6 -0
  4. package/dist/previews/screens/cart/empty.d.ts +1 -0
  5. package/dist/previews/screens/cart/index.d.ts +1 -0
  6. package/dist/previews/screens/payment/error.d.ts +1 -0
  7. package/dist/previews/screens/payment/index.d.ts +1 -0
  8. package/dist/previews/screens/payment/processing.d.ts +1 -0
  9. package/dist/previews/screens/receipt/index.d.ts +1 -0
  10. package/dist/previews/shared/data.d.ts +30 -0
  11. package/dist/src/content/config-parser.d.ts +30 -0
  12. package/dist/src/content/flow-verifier.d.ts +21 -0
  13. package/dist/src/content/preview-types.d.ts +288 -0
  14. package/dist/{vite → src/content}/previews.d.ts +3 -11
  15. package/dist/{preview-runtime → src/preview-runtime}/build-optimized.d.ts +2 -0
  16. package/dist/{preview-runtime → src/preview-runtime}/build.d.ts +1 -1
  17. package/dist/src/preview-runtime/region-bridge.d.ts +1 -0
  18. package/dist/{preview-runtime → src/preview-runtime}/types.d.ts +18 -0
  19. package/dist/src/preview-runtime/vendors.d.ts +11 -0
  20. package/dist/{renderers → src/renderers}/index.d.ts +1 -1
  21. package/dist/{renderers → src/renderers}/types.d.ts +3 -31
  22. package/dist/src/server/build.d.ts +6 -0
  23. package/dist/src/server/dev.d.ts +13 -0
  24. package/dist/src/server/plugins/aliases.d.ts +5 -0
  25. package/dist/src/server/plugins/mdx.d.ts +5 -0
  26. package/dist/src/server/plugins/virtual-modules.d.ts +8 -0
  27. package/dist/src/server/preview.d.ts +10 -0
  28. package/dist/src/server/routes/component-bundle.d.ts +1 -0
  29. package/dist/src/server/routes/jsx-bundle.d.ts +3 -0
  30. package/dist/src/server/routes/og-image.d.ts +15 -0
  31. package/dist/src/server/routes/preview-bundle.d.ts +1 -0
  32. package/dist/src/server/routes/preview-config.d.ts +1 -0
  33. package/dist/src/server/routes/tokens.d.ts +1 -0
  34. package/dist/{vite → src/server}/start.d.ts +5 -2
  35. package/dist/{ui → src/ui}/button.d.ts +1 -1
  36. package/dist/{validators → src/validators}/index.d.ts +0 -5
  37. package/dist/{validators → src/validators}/semantic-validator.d.ts +2 -3
  38. package/package.json +8 -11
  39. package/src/jsx/CLAUDE.md +18 -0
  40. package/src/jsx/jsx-runtime.ts +1 -1
  41. package/src/preview-runtime/CLAUDE.md +21 -0
  42. package/src/preview-runtime/build-optimized.ts +189 -73
  43. package/src/preview-runtime/build.ts +75 -79
  44. package/src/preview-runtime/fast-template.html +5 -1
  45. package/src/preview-runtime/region-bridge.test.ts +41 -0
  46. package/src/preview-runtime/region-bridge.ts +101 -0
  47. package/src/preview-runtime/types.ts +6 -0
  48. package/src/preview-runtime/vendors.ts +215 -22
  49. package/src/primitives/CLAUDE.md +17 -0
  50. package/src/theme/CLAUDE.md +20 -0
  51. package/src/theme/Preview.tsx +10 -4
  52. package/src/theme/Toolbar.tsx +2 -2
  53. package/src/theme/entry.tsx +247 -121
  54. package/src/theme/hooks/useAnnotations.ts +77 -0
  55. package/src/theme/hooks/useApprovalStatus.ts +50 -0
  56. package/src/theme/hooks/useSnapshots.ts +147 -0
  57. package/src/theme/hooks/useStorage.ts +26 -0
  58. package/src/theme/hooks/useTokenOverrides.ts +56 -0
  59. package/src/theme/hooks/useViewport.ts +23 -0
  60. package/src/theme/icons.tsx +39 -1
  61. package/src/theme/index.html +18 -0
  62. package/src/theme/mdx-components.tsx +1 -1
  63. package/src/theme/previews/AnnotationLayer.tsx +285 -0
  64. package/src/theme/previews/AnnotationPin.tsx +61 -0
  65. package/src/theme/previews/AnnotationThread.tsx +257 -0
  66. package/src/theme/previews/CLAUDE.md +18 -0
  67. package/src/theme/previews/ComponentPreview.tsx +487 -107
  68. package/src/theme/previews/FlowDiagram.tsx +111 -0
  69. package/src/theme/previews/FlowPreview.tsx +938 -174
  70. package/src/theme/previews/PreviewRouter.tsx +1 -4
  71. package/src/theme/previews/ScreenPreview.tsx +515 -175
  72. package/src/theme/previews/SnapshotButton.tsx +68 -0
  73. package/src/theme/previews/SnapshotCompare.tsx +216 -0
  74. package/src/theme/previews/SnapshotPanel.tsx +274 -0
  75. package/src/theme/previews/StatusBadge.tsx +66 -0
  76. package/src/theme/previews/StatusDropdown.tsx +158 -0
  77. package/src/theme/previews/TokenPlayground.tsx +438 -0
  78. package/src/theme/previews/ViewportControls.tsx +67 -0
  79. package/src/theme/previews/flow-diagram.test.ts +141 -0
  80. package/src/theme/previews/flow-diagram.ts +109 -0
  81. package/src/theme/previews/flow-navigation.test.ts +90 -0
  82. package/src/theme/previews/flow-navigation.ts +47 -0
  83. package/src/theme/previews/machines/derived.test.ts +225 -0
  84. package/src/theme/previews/machines/derived.ts +73 -0
  85. package/src/theme/previews/machines/flow-machine.test.ts +379 -0
  86. package/src/theme/previews/machines/flow-machine.ts +207 -0
  87. package/src/theme/previews/machines/screen-machine.test.ts +149 -0
  88. package/src/theme/previews/machines/screen-machine.ts +76 -0
  89. package/src/theme/previews/stores/flow-store.test.ts +157 -0
  90. package/src/theme/previews/stores/flow-store.ts +49 -0
  91. package/src/theme/previews/stores/screen-store.test.ts +68 -0
  92. package/src/theme/previews/stores/screen-store.ts +33 -0
  93. package/src/theme/storage.test.ts +97 -0
  94. package/src/theme/storage.ts +71 -0
  95. package/src/theme/styles.css +296 -25
  96. package/src/theme/types.ts +64 -0
  97. package/src/tokens/CLAUDE.md +16 -0
  98. package/src/tokens/resolver.ts +1 -1
  99. package/dist/preview-runtime/vendors.d.ts +0 -6
  100. package/dist/vite/config-parser.d.ts +0 -13
  101. package/dist/vite/config.d.ts +0 -12
  102. package/dist/vite/plugins/config-plugin.d.ts +0 -3
  103. package/dist/vite/plugins/debug-plugin.d.ts +0 -3
  104. package/dist/vite/plugins/entry-plugin.d.ts +0 -2
  105. package/dist/vite/plugins/fumadocs-plugin.d.ts +0 -9
  106. package/dist/vite/plugins/pages-plugin.d.ts +0 -5
  107. package/dist/vite/plugins/previews-plugin.d.ts +0 -2
  108. package/dist/vite/plugins/tokens-plugin.d.ts +0 -2
  109. package/dist/vite/preview-types.d.ts +0 -70
  110. package/src/theme/previews/AtlasPreview.tsx +0 -528
  111. package/dist/{cli.d.ts → src/cli.d.ts} +0 -0
  112. package/dist/{config → src/config}/index.d.ts +0 -0
  113. package/dist/{config → src/config}/loader.d.ts +0 -0
  114. package/dist/{config → src/config}/schema.d.ts +0 -0
  115. package/dist/{vite → src/content}/pages.d.ts +0 -0
  116. package/dist/{jsx → src/jsx}/adapters/html.d.ts +0 -0
  117. package/dist/{jsx → src/jsx}/adapters/react.d.ts +0 -0
  118. package/dist/{jsx → src/jsx}/define-component.d.ts +0 -0
  119. package/dist/{jsx → src/jsx}/index.d.ts +0 -0
  120. package/dist/{jsx → src/jsx}/jsx-runtime.d.ts +0 -0
  121. package/dist/{jsx → src/jsx}/migrate.d.ts +0 -0
  122. package/dist/{jsx → src/jsx}/schemas/index.d.ts +0 -0
  123. package/dist/{jsx → src/jsx}/schemas/primitives.d.ts +10 -10
  124. package/dist/{jsx → src/jsx}/schemas/tokens.d.ts +3 -3
  125. /package/dist/{jsx → src/jsx}/validation.d.ts +0 -0
  126. /package/dist/{jsx → src/jsx}/vnode.d.ts +0 -0
  127. /package/dist/{migrate.d.ts → src/migrate.d.ts} +0 -0
  128. /package/dist/{preview-runtime → src/preview-runtime}/tailwind.d.ts +0 -0
  129. /package/dist/{primitives → src/primitives}/index.d.ts +0 -0
  130. /package/dist/{primitives → src/primitives}/migrate.d.ts +0 -0
  131. /package/dist/{primitives → src/primitives}/parser.d.ts +0 -0
  132. /package/dist/{primitives → src/primitives}/template-parser.d.ts +0 -0
  133. /package/dist/{primitives → src/primitives}/template-renderer.d.ts +0 -0
  134. /package/dist/{primitives → src/primitives}/types.d.ts +0 -0
  135. /package/dist/{renderers → src/renderers}/html/index.d.ts +0 -0
  136. /package/dist/{renderers → src/renderers}/react/index.d.ts +0 -0
  137. /package/dist/{renderers → src/renderers}/registry.d.ts +0 -0
  138. /package/dist/{renderers → src/renderers}/render.d.ts +0 -0
  139. /package/dist/{tokens → src/tokens}/defaults.d.ts +0 -0
  140. /package/dist/{tokens → src/tokens}/resolver.d.ts +0 -0
  141. /package/dist/{tokens → src/tokens}/utils.d.ts +0 -0
  142. /package/dist/{tokens → src/tokens}/validation.d.ts +0 -0
  143. /package/dist/{typecheck → src/typecheck}/index.d.ts +0 -0
  144. /package/dist/{ui → src/ui}/card.d.ts +0 -0
  145. /package/dist/{ui → src/ui}/index.d.ts +0 -0
  146. /package/dist/{ui → src/ui}/utils.d.ts +0 -0
  147. /package/dist/{utils → src/utils}/cache.d.ts +0 -0
  148. /package/dist/{utils → src/utils}/debug.d.ts +0 -0
  149. /package/dist/{utils → src/utils}/port.d.ts +0 -0
  150. /package/dist/{validators → src/validators}/schema-validator.d.ts +0 -0
@@ -0,0 +1,71 @@
1
+ export interface StorageAdapter {
2
+ get<T>(key: string): T | null
3
+ set<T>(key: string, value: T): void
4
+ remove(key: string): void
5
+ list(prefix: string): string[]
6
+ clear(prefix: string): void
7
+ }
8
+
9
+ interface StorageBackend {
10
+ getItem(key: string): string | null
11
+ setItem(key: string, value: string): void
12
+ removeItem(key: string): void
13
+ key(index: number): string | null
14
+ readonly length: number
15
+ }
16
+
17
+ export class PrefixedStorageAdapter implements StorageAdapter {
18
+ constructor(
19
+ private backend: StorageBackend,
20
+ private prefix = 'prev:',
21
+ ) {}
22
+
23
+ get<T>(key: string): T | null {
24
+ try {
25
+ const raw = this.backend.getItem(this.prefix + key)
26
+ return raw ? JSON.parse(raw) : null
27
+ } catch {
28
+ return null
29
+ }
30
+ }
31
+
32
+ set<T>(key: string, value: T): void {
33
+ try {
34
+ this.backend.setItem(this.prefix + key, JSON.stringify(value))
35
+ } catch {
36
+ // Silently ignore quota errors
37
+ }
38
+ }
39
+
40
+ remove(key: string): void {
41
+ this.backend.removeItem(this.prefix + key)
42
+ }
43
+
44
+ list(prefix: string): string[] {
45
+ const fullPrefix = this.prefix + prefix
46
+ const keys: string[] = []
47
+ for (let i = 0; i < this.backend.length; i++) {
48
+ const key = this.backend.key(i)
49
+ if (key?.startsWith(fullPrefix)) {
50
+ keys.push(key.slice(this.prefix.length))
51
+ }
52
+ }
53
+ return keys
54
+ }
55
+
56
+ clear(prefix: string): void {
57
+ this.list(prefix).forEach(k => this.remove(k))
58
+ }
59
+ }
60
+
61
+ // Default singleton using localStorage (browser environment)
62
+ export const storage: StorageAdapter = typeof localStorage !== 'undefined'
63
+ ? new PrefixedStorageAdapter(localStorage)
64
+ : new PrefixedStorageAdapter({
65
+ // No-op fallback for SSR/non-browser
66
+ getItem: () => null,
67
+ setItem: () => {},
68
+ removeItem: () => {},
69
+ key: () => null,
70
+ length: 0,
71
+ })
@@ -606,18 +606,25 @@ body {
606
606
 
607
607
  /* Preview detail page - full available space */
608
608
  .preview-detail-page {
609
+ display: flex;
610
+ flex-direction: column;
609
611
  height: calc(100vh - 4rem);
610
612
  padding: 0;
611
613
  margin: -2rem; /* Negate parent padding */
612
614
  margin-bottom: 3rem; /* Space for toolbar */
613
- }
614
-
615
- .preview-detail-page > div {
616
- height: 100%;
617
615
  border-radius: 0;
618
616
  overflow: hidden;
619
617
  }
620
618
 
619
+ .preview-detail-page > .preview-state-selector {
620
+ flex-shrink: 0;
621
+ }
622
+
623
+ .preview-detail-page > div:last-child {
624
+ flex: 1;
625
+ min-height: 0;
626
+ }
627
+
621
628
  @media (min-width: 769px) {
622
629
  .preview-detail-page {
623
630
  margin: -2rem;
@@ -626,7 +633,7 @@ body {
626
633
  padding: 1rem;
627
634
  }
628
635
 
629
- .preview-detail-page > div {
636
+ .preview-detail-page > div:last-child {
630
637
  border-radius: 12px;
631
638
  border: 1px solid var(--fd-border);
632
639
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
@@ -638,7 +645,7 @@ body {
638
645
  =========================================== */
639
646
 
640
647
  .previews-catalog {
641
- padding: 16px;
648
+ padding: 12px;
642
649
  }
643
650
 
644
651
  @media (min-width: 640px) {
@@ -647,28 +654,236 @@ body {
647
654
  }
648
655
  }
649
656
 
650
- .previews-grid {
651
- display: grid;
652
- grid-template-columns: 1fr;
653
- gap: 16px;
657
+ /* Catalog Header */
658
+ .catalog-header {
659
+ margin-bottom: 16px;
654
660
  }
655
661
 
656
- @media (min-width: 480px) {
657
- .previews-grid {
658
- grid-template-columns: repeat(2, 1fr);
662
+ @media (min-width: 640px) {
663
+ .catalog-header {
664
+ margin-bottom: 32px;
659
665
  }
660
666
  }
661
667
 
662
- @media (min-width: 768px) {
663
- .previews-grid {
664
- grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
665
- gap: 20px;
668
+ .catalog-title {
669
+ font-size: 20px;
670
+ font-weight: bold;
671
+ margin: 0 0 4px 0;
672
+ }
673
+
674
+ @media (min-width: 640px) {
675
+ .catalog-title {
676
+ font-size: 28px;
677
+ margin-bottom: 8px;
678
+ }
679
+ }
680
+
681
+ .catalog-subtitle {
682
+ font-size: 13px;
683
+ color: var(--fd-muted-foreground);
684
+ margin: 0;
685
+ }
686
+
687
+ @media (min-width: 640px) {
688
+ .catalog-subtitle {
689
+ font-size: 16px;
690
+ }
691
+ }
692
+
693
+ /* Catalog Tip - hidden on mobile */
694
+ .catalog-tip {
695
+ display: none;
696
+ margin-top: 32px;
697
+ padding: 14px 16px;
698
+ background-color: var(--fd-muted);
699
+ border: 1px solid var(--fd-border);
700
+ border-radius: 10px;
701
+ }
702
+
703
+ @media (min-width: 640px) {
704
+ .catalog-tip {
705
+ display: block;
706
+ }
707
+ }
708
+
709
+ .catalog-tip p {
710
+ margin: 0;
711
+ font-size: 14px;
712
+ color: var(--fd-muted-foreground);
713
+ }
714
+
715
+ .catalog-tip strong {
716
+ color: var(--fd-foreground);
717
+ }
718
+
719
+ .catalog-tip code {
720
+ background-color: var(--fd-accent);
721
+ padding: 2px 6px;
722
+ border-radius: 4px;
723
+ font-family: var(--fd-font-mono);
724
+ }
725
+
726
+ /* Category Section */
727
+ .category-section {
728
+ margin-bottom: 24px;
729
+ }
730
+
731
+ @media (min-width: 640px) {
732
+ .category-section {
733
+ margin-bottom: 32px;
734
+ }
735
+ }
736
+
737
+ .category-header {
738
+ display: flex;
739
+ align-items: center;
740
+ gap: 8px;
741
+ margin-bottom: 12px;
742
+ padding-bottom: 8px;
743
+ border-bottom: 1px solid var(--fd-border);
744
+ }
745
+
746
+ @media (min-width: 640px) {
747
+ .category-header {
748
+ gap: 10px;
749
+ margin-bottom: 16px;
750
+ padding-bottom: 12px;
751
+ }
752
+ }
753
+
754
+ .category-icon {
755
+ font-size: 16px;
756
+ flex-shrink: 0;
757
+ }
758
+
759
+ @media (min-width: 640px) {
760
+ .category-icon {
761
+ font-size: 20px;
762
+ }
763
+ }
764
+
765
+ .category-info {
766
+ flex: 1;
767
+ min-width: 0;
768
+ }
769
+
770
+ .category-title {
771
+ font-size: 14px;
772
+ font-weight: 600;
773
+ margin: 0;
774
+ color: var(--fd-foreground);
775
+ }
776
+
777
+ @media (min-width: 640px) {
778
+ .category-title {
779
+ font-size: 18px;
780
+ }
781
+ }
782
+
783
+ .category-count {
784
+ margin-left: 6px;
785
+ font-size: 12px;
786
+ font-weight: 400;
787
+ color: var(--fd-muted-foreground);
788
+ }
789
+
790
+ @media (min-width: 640px) {
791
+ .category-count {
792
+ margin-left: 8px;
793
+ font-size: 14px;
794
+ }
795
+ }
796
+
797
+ .category-description {
798
+ display: none;
799
+ font-size: 13px;
800
+ color: var(--fd-muted-foreground);
801
+ margin: 0;
802
+ }
803
+
804
+ @media (min-width: 640px) {
805
+ .category-description {
806
+ display: block;
807
+ }
808
+ }
809
+
810
+ /* Category Navigation Buttons */
811
+ .category-nav {
812
+ display: flex;
813
+ gap: 4px;
814
+ flex-shrink: 0;
815
+ }
816
+
817
+ .category-nav-btn {
818
+ display: flex;
819
+ align-items: center;
820
+ justify-content: center;
821
+ width: 28px;
822
+ height: 28px;
823
+ border: 1px solid var(--fd-border);
824
+ border-radius: 6px;
825
+ background: var(--fd-background);
826
+ color: var(--fd-muted-foreground);
827
+ cursor: pointer;
828
+ transition: all 0.15s ease;
829
+ }
830
+
831
+ @media (min-width: 640px) {
832
+ .category-nav-btn {
833
+ width: 32px;
834
+ height: 32px;
666
835
  }
667
836
  }
668
837
 
838
+ .category-nav-btn:hover {
839
+ background: var(--fd-muted);
840
+ color: var(--fd-foreground);
841
+ border-color: var(--fd-foreground);
842
+ }
843
+
844
+ .category-nav-btn:active {
845
+ transform: scale(0.95);
846
+ }
847
+
848
+ /* Horizontal carousel for preview cards */
849
+ .previews-grid {
850
+ display: flex;
851
+ gap: 16px;
852
+ overflow-x: auto;
853
+ overflow-y: hidden;
854
+ scroll-snap-type: x mandatory;
855
+ scroll-behavior: smooth;
856
+ padding-bottom: 8px;
857
+ margin: 0 -16px;
858
+ padding-left: 16px;
859
+ padding-right: 16px;
860
+ /* Hide scrollbar but keep functionality */
861
+ scrollbar-width: thin;
862
+ scrollbar-color: var(--fd-border) transparent;
863
+ }
864
+
865
+ .previews-grid::-webkit-scrollbar {
866
+ height: 6px;
867
+ }
868
+
869
+ .previews-grid::-webkit-scrollbar-track {
870
+ background: transparent;
871
+ }
872
+
873
+ .previews-grid::-webkit-scrollbar-thumb {
874
+ background-color: var(--fd-border);
875
+ border-radius: 3px;
876
+ }
877
+
878
+ .previews-grid::-webkit-scrollbar-thumb:hover {
879
+ background-color: var(--fd-muted-foreground);
880
+ }
881
+
669
882
  /* Preview card enhancements */
670
883
  .previews-grid a {
671
884
  display: block;
885
+ flex: 0 0 260px;
886
+ scroll-snap-align: start;
672
887
  border: 1px solid var(--fd-border);
673
888
  border-radius: 12px;
674
889
  overflow: hidden;
@@ -678,6 +893,12 @@ body {
678
893
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
679
894
  }
680
895
 
896
+ @media (min-width: 768px) {
897
+ .previews-grid a {
898
+ flex: 0 0 280px;
899
+ }
900
+ }
901
+
681
902
  .previews-grid a:hover {
682
903
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
683
904
  transform: translateY(-2px);
@@ -690,22 +911,16 @@ body {
690
911
 
691
912
  /* Preview Card Component Styles */
692
913
  .preview-card-thumbnail {
693
- height: 140px;
914
+ height: 120px;
694
915
  overflow: hidden;
695
916
  position: relative;
696
917
  background-color: var(--fd-muted);
697
918
  pointer-events: none;
698
919
  }
699
920
 
700
- @media (min-width: 480px) {
701
- .preview-card-thumbnail {
702
- height: 160px;
703
- }
704
- }
705
-
706
921
  @media (min-width: 768px) {
707
922
  .preview-card-thumbnail {
708
- height: 180px;
923
+ height: 140px;
709
924
  }
710
925
  }
711
926
 
@@ -774,6 +989,62 @@ body {
774
989
  font-family: var(--fd-font-mono);
775
990
  }
776
991
 
992
+ /* ===========================================
993
+ Preview State Selector
994
+ =========================================== */
995
+
996
+ .preview-state-selector {
997
+ display: flex;
998
+ align-items: center;
999
+ gap: 12px;
1000
+ padding: 12px 16px;
1001
+ background-color: var(--fd-card);
1002
+ border-bottom: 1px solid var(--fd-border);
1003
+ }
1004
+
1005
+ .preview-state-label {
1006
+ font-size: 12px;
1007
+ font-weight: 600;
1008
+ color: var(--fd-muted-foreground);
1009
+ text-transform: uppercase;
1010
+ letter-spacing: 0.05em;
1011
+ }
1012
+
1013
+ .preview-state-buttons {
1014
+ display: flex;
1015
+ flex-direction: row;
1016
+ align-items: center;
1017
+ gap: 4px;
1018
+ background-color: var(--fd-muted);
1019
+ border-radius: 8px;
1020
+ padding: 4px;
1021
+ }
1022
+
1023
+ .preview-state-btn {
1024
+ padding: 6px 12px;
1025
+ font-size: 13px;
1026
+ font-weight: 400;
1027
+ border: none;
1028
+ border-radius: 6px;
1029
+ cursor: pointer;
1030
+ background-color: transparent;
1031
+ color: var(--fd-muted-foreground);
1032
+ transition: all 0.15s ease;
1033
+ text-transform: capitalize;
1034
+ }
1035
+
1036
+ .preview-state-btn:hover {
1037
+ background-color: var(--fd-background);
1038
+ color: var(--fd-foreground);
1039
+ }
1040
+
1041
+ .preview-state-btn.active {
1042
+ font-weight: 600;
1043
+ background-color: var(--fd-background);
1044
+ color: var(--fd-foreground);
1045
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
1046
+ }
1047
+
777
1048
  /* ===========================================
778
1049
  Dead Link Warning (Dev Mode Only)
779
1050
  =========================================== */
@@ -0,0 +1,64 @@
1
+ // === Annotations ===
2
+ export type AnnotationCategory = 'bug' | 'copy' | 'design' | 'general'
3
+
4
+ export interface Annotation {
5
+ id: string
6
+ previewName: string
7
+ stateOrStep: string
8
+ x: number // % relative to iframe width
9
+ y: number // % relative to iframe height
10
+ category: AnnotationCategory
11
+ resolved: boolean
12
+ createdAt: string
13
+ comments: AnnotationComment[]
14
+ }
15
+
16
+ export interface AnnotationComment {
17
+ id: string
18
+ author: string
19
+ text: string
20
+ createdAt: string
21
+ }
22
+
23
+ // === Snapshots ===
24
+ export interface Snapshot {
25
+ id: string
26
+ previewName: string
27
+ stateOrStep: string
28
+ viewport: string
29
+ screenshotDataUrl: string
30
+ createdAt: string
31
+ label?: string
32
+ }
33
+
34
+ // === Status / Approval ===
35
+ export type ApprovalStatus = 'draft' | 'in-review' | 'approved' | 'needs-changes'
36
+
37
+ export interface StatusEntry {
38
+ previewName: string
39
+ status: ApprovalStatus
40
+ updatedAt: string
41
+ updatedBy: string
42
+ }
43
+
44
+ export interface AuditLogEntry {
45
+ previewName: string
46
+ from: ApprovalStatus
47
+ to: ApprovalStatus
48
+ changedBy: string
49
+ changedAt: string
50
+ }
51
+
52
+ // === Token Overrides ===
53
+ export interface TokenOverride {
54
+ category: string
55
+ name: string
56
+ originalValue: string
57
+ overrideValue: string
58
+ }
59
+
60
+ // === User Identity (mock) ===
61
+ export interface UserIdentity {
62
+ name: string
63
+ avatar?: string
64
+ }
@@ -0,0 +1,16 @@
1
+ <!-- c3-generated: c3-701, c3-702, c3-703 -->
2
+ # c3-7: Tokens
3
+
4
+ Before modifying this code, read:
5
+ - `.c3/c3-7-tokens/c3-701-resolver.md` - Token resolution (TokensConfig, resolveTokens)
6
+ - `.c3/c3-7-tokens/c3-702-defaults.md` - Default shadcn token values
7
+ - `.c3/c3-7-tokens/c3-703-validation.md` - Token validation with suggestions
8
+
9
+ Token categories: `colors`, `backgrounds`, `spacing`, `typography.sizes`, `typography.weights`, `radius`, `shadows`
10
+
11
+ Key files:
12
+ - `resolver.ts` - `resolveTokens()`, `TokensConfig`, `PartialTokensConfig`
13
+ - `defaults.ts` - `DEFAULT_TOKENS`
14
+ - `validation.ts` - `validateToken()`, `isValidToken()`, `ValidationError`
15
+ - `utils.ts` - `mergeTokenConfigs()`, `levenshtein()`
16
+ <!-- end-c3-generated -->
@@ -125,7 +125,7 @@ function loadPartialTokens(filePath: string): PartialTokensConfig {
125
125
  export function resolveTokens(options: ResolveTokensOptions = {}): TokensConfig {
126
126
  const { userTokens, defaultsPath } = options
127
127
 
128
- // Check for user tokens path from Vite plugin or options
128
+ // Check for user tokens path from build plugin or options
129
129
  let userTokensPath = options.userTokensPath
130
130
  if (!userTokensPath && typeof globalThis !== 'undefined') {
131
131
  userTokensPath = (globalThis as any).__PREV_USER_TOKENS_PATH
@@ -1,6 +0,0 @@
1
- export interface VendorBundleResult {
2
- success: boolean;
3
- code: string;
4
- error?: string;
5
- }
6
- export declare function buildVendorBundle(): Promise<VendorBundleResult>;
@@ -1,13 +0,0 @@
1
- import { type PreviewConfig, type FlowDefinition, type AtlasDefinition } from './preview-types';
2
- /**
3
- * Parse a config.yaml or config.yml file and validate against schema
4
- */
5
- export declare function parsePreviewConfig(filePath: string): Promise<PreviewConfig | null>;
6
- /**
7
- * Parse a flow index.yaml file
8
- */
9
- export declare function parseFlowDefinition(filePath: string): Promise<FlowDefinition | null>;
10
- /**
11
- * Parse an atlas index.yaml file
12
- */
13
- export declare function parseAtlasDefinition(filePath: string): Promise<AtlasDefinition | null>;
@@ -1,12 +0,0 @@
1
- import type { InlineConfig } from 'vite';
2
- import { getDebugCollector } from '../utils/debug';
3
- export { getDebugCollector };
4
- export interface ConfigOptions {
5
- rootDir: string;
6
- mode: 'development' | 'production';
7
- port?: number;
8
- include?: string[];
9
- base?: string;
10
- debug?: boolean;
11
- }
12
- export declare function createViteConfig(options: ConfigOptions): Promise<InlineConfig>;
@@ -1,3 +0,0 @@
1
- import type { Plugin } from 'vite';
2
- import type { PrevConfig } from '../../config';
3
- export declare function createConfigPlugin(config: PrevConfig): Plugin;
@@ -1,3 +0,0 @@
1
- import type { Plugin } from 'vite';
2
- import { DebugCollector } from '../../utils/debug';
3
- export declare function debugPlugin(collector: DebugCollector): Plugin;
@@ -1,2 +0,0 @@
1
- import type { Plugin } from 'vite';
2
- export declare function entryPlugin(rootDir?: string): Plugin;
@@ -1,9 +0,0 @@
1
- import type { Plugin } from 'vite';
2
- /**
3
- * Vite plugin to resolve fumadocs subpath exports.
4
- *
5
- * Fumadocs uses Node.js subpath exports which Vite's esbuild pre-bundler
6
- * can't resolve when packages are in CLI's node_modules (not user's project).
7
- * This plugin uses resolveId hook to dynamically resolve imports to dist files.
8
- */
9
- export declare function fumadocsPlugin(nodeModulesPath: string): Plugin;
@@ -1,5 +0,0 @@
1
- import type { Plugin } from 'vite';
2
- export interface PagesPluginOptions {
3
- include?: string[];
4
- }
5
- export declare function pagesPlugin(rootDir: string, options?: PagesPluginOptions): Plugin;
@@ -1,2 +0,0 @@
1
- import type { Plugin } from 'vite';
2
- export declare function previewsPlugin(rootDir: string): Plugin;
@@ -1,2 +0,0 @@
1
- import type { Plugin } from 'vite';
2
- export declare function tokensPlugin(rootDir: string): Plugin;
@@ -1,70 +0,0 @@
1
- import { z } from 'zod';
2
- export type PreviewType = 'component' | 'screen' | 'flow' | 'atlas';
3
- export declare const configSchema: z.ZodObject<{
4
- tags: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodPipe<z.ZodString, z.ZodTransform<string[], string>>]>>;
5
- category: z.ZodOptional<z.ZodString>;
6
- status: z.ZodOptional<z.ZodEnum<{
7
- draft: "draft";
8
- stable: "stable";
9
- deprecated: "deprecated";
10
- }>>;
11
- title: z.ZodOptional<z.ZodString>;
12
- description: z.ZodOptional<z.ZodString>;
13
- order: z.ZodOptional<z.ZodNumber>;
14
- }, z.core.$strip>;
15
- export type PreviewConfig = z.infer<typeof configSchema>;
16
- export interface PreviewUnit {
17
- type: PreviewType;
18
- name: string;
19
- path: string;
20
- route: string;
21
- config: PreviewConfig | null;
22
- files: {
23
- index: string;
24
- states?: string[];
25
- schema?: string;
26
- docs?: string;
27
- };
28
- }
29
- export interface FlowStep {
30
- screen: string;
31
- state?: string;
32
- note?: string;
33
- trigger?: string;
34
- highlight?: string[];
35
- }
36
- export interface FlowDefinition {
37
- name: string;
38
- description?: string;
39
- steps: FlowStep[];
40
- }
41
- export interface AtlasArea {
42
- title: string;
43
- description?: string;
44
- parent?: string;
45
- children?: string[];
46
- access?: string;
47
- }
48
- export interface AtlasDefinition {
49
- name: string;
50
- description?: string;
51
- hierarchy: {
52
- root: string;
53
- areas: Record<string, AtlasArea>;
54
- };
55
- routes?: Record<string, {
56
- area: string;
57
- screen: string;
58
- guard?: string;
59
- }>;
60
- navigation?: Record<string, Array<{
61
- area?: string;
62
- icon?: string;
63
- action?: string;
64
- }>>;
65
- relationships?: Array<{
66
- from: string;
67
- to: string;
68
- type: string;
69
- }>;
70
- }