@terrafirmagreg-team/ui 0.0.0-stage → 1.2.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 (225) hide show
  1. package/package.json +93 -3
  2. package/src/components/blocks/button/icon-button.tsx +49 -0
  3. package/src/components/blocks/canvas/chevron-edge.tsx +242 -0
  4. package/src/components/blocks/canvas/flow-canvas.tsx +181 -0
  5. package/src/components/blocks/canvas/flow-toolbar.tsx +33 -0
  6. package/src/components/blocks/canvas/flow-viewport.tsx +244 -0
  7. package/src/components/blocks/fit-box.tsx +26 -0
  8. package/src/components/blocks/git/github-info.tsx +78 -0
  9. package/src/components/blocks/lang/content.tsx +52 -0
  10. package/src/components/blocks/lang/flag.tsx +25 -0
  11. package/src/components/blocks/lang/link.tsx +23 -0
  12. package/src/components/blocks/lang/redirect.tsx +48 -0
  13. package/src/components/blocks/lang/switcher.tsx +54 -0
  14. package/src/components/blocks/lang/untranslated-callout.tsx +29 -0
  15. package/src/components/blocks/lang/untranslated-chip.tsx +53 -0
  16. package/src/components/blocks/link/link-preview.tsx +257 -0
  17. package/src/components/blocks/list/row.tsx +92 -0
  18. package/src/components/blocks/media/glb/model.tsx +244 -0
  19. package/src/components/blocks/media/glb/scene.tsx +373 -0
  20. package/src/components/blocks/media/glb/viewer.tsx +52 -0
  21. package/src/components/blocks/media/image.tsx +136 -0
  22. package/src/components/blocks/media/slideshow.tsx +178 -0
  23. package/src/components/blocks/nav/breadcrumb.tsx +51 -0
  24. package/src/components/blocks/nav/copy-menu.tsx +37 -0
  25. package/src/components/blocks/nav/link.tsx +86 -0
  26. package/src/components/blocks/nav/site-menu.tsx +78 -0
  27. package/src/components/blocks/nav/site-title.tsx +61 -0
  28. package/src/components/blocks/nav/switcher.tsx +206 -0
  29. package/src/components/blocks/page/empty-state.tsx +32 -0
  30. package/src/components/blocks/page/heading.tsx +54 -0
  31. package/src/components/blocks/page/pager.tsx +220 -0
  32. package/src/components/blocks/readability/fields.tsx +250 -0
  33. package/src/components/blocks/readability/menu.tsx +247 -0
  34. package/src/components/blocks/readability/track.tsx +165 -0
  35. package/src/components/blocks/search/command.tsx +80 -0
  36. package/src/components/blocks/search/dialog.tsx +724 -0
  37. package/src/components/blocks/search/provider.tsx +118 -0
  38. package/src/components/blocks/sidebar.tsx +406 -0
  39. package/src/components/blocks/sprite.tsx +231 -0
  40. package/src/components/blocks/text/format-text.tsx +110 -0
  41. package/src/components/blocks/theme/toggle.tsx +75 -0
  42. package/src/components/blocks/tooltip/hint.tsx +28 -0
  43. package/src/components/blocks/tooltip/lazy.tsx +41 -0
  44. package/src/components/blocks/viewer/controls.tsx +284 -0
  45. package/src/components/blocks/viewer/float-bar.tsx +51 -0
  46. package/src/components/layouts/layout.tsx +94 -0
  47. package/src/components/layouts/left-sidebar/content.tsx +63 -0
  48. package/src/components/layouts/left-sidebar/context.tsx +55 -0
  49. package/src/components/layouts/left-sidebar/expand.tsx +23 -0
  50. package/src/components/layouts/left-sidebar/footer.tsx +111 -0
  51. package/src/components/layouts/left-sidebar/index.ts +29 -0
  52. package/src/components/layouts/left-sidebar/items.tsx +103 -0
  53. package/src/components/layouts/left-sidebar/search.tsx +75 -0
  54. package/src/components/layouts/left-sidebar/sidebar.tsx +189 -0
  55. package/src/components/layouts/left-sidebar/tree.tsx +157 -0
  56. package/src/components/layouts/right-sidebar.tsx +96 -0
  57. package/src/components/layouts/tree-context.tsx +42 -0
  58. package/src/components/mdx/accordion.tsx +185 -0
  59. package/src/components/mdx/banner.tsx +157 -0
  60. package/src/components/mdx/callout.tsx +97 -0
  61. package/src/components/mdx/card.tsx +56 -0
  62. package/src/components/mdx/codeblock.tsx +250 -0
  63. package/src/components/mdx/collapsible.tsx +33 -0
  64. package/src/components/mdx/files.tsx +63 -0
  65. package/src/components/mdx/glow-header.tsx +54 -0
  66. package/src/components/mdx/gradient-text.tsx +28 -0
  67. package/src/components/mdx/icon.tsx +35 -0
  68. package/src/components/mdx/image-zoom.tsx +315 -0
  69. package/src/components/mdx/math.tsx +30 -0
  70. package/src/components/mdx/mermaid.tsx +23 -0
  71. package/src/components/mdx/multiblock.tsx +19 -0
  72. package/src/components/mdx/preview.tsx +101 -0
  73. package/src/components/mdx/steps.tsx +10 -0
  74. package/src/components/mdx/table.tsx +14 -0
  75. package/src/components/mdx/tabs.tsx +354 -0
  76. package/src/components/mdx/type-table.tsx +171 -0
  77. package/src/components/provider.tsx +139 -0
  78. package/src/components/ui/accordion.tsx +71 -0
  79. package/src/components/ui/alert-dialog.tsx +187 -0
  80. package/src/components/ui/alert.tsx +75 -0
  81. package/src/components/ui/aspect-ratio.tsx +22 -0
  82. package/src/components/ui/attachment.tsx +207 -0
  83. package/src/components/ui/avatar.tsx +108 -0
  84. package/src/components/ui/badge.tsx +51 -0
  85. package/src/components/ui/breadcrumb.tsx +124 -0
  86. package/src/components/ui/bubble.tsx +127 -0
  87. package/src/components/ui/button-group.tsx +87 -0
  88. package/src/components/ui/button.tsx +57 -0
  89. package/src/components/ui/calendar.tsx +221 -0
  90. package/src/components/ui/card.tsx +102 -0
  91. package/src/components/ui/carousel.tsx +242 -0
  92. package/src/components/ui/chart.tsx +371 -0
  93. package/src/components/ui/checkbox.tsx +28 -0
  94. package/src/components/ui/collapsible.tsx +21 -0
  95. package/src/components/ui/combobox.tsx +297 -0
  96. package/src/components/ui/command.tsx +198 -0
  97. package/src/components/ui/context-menu.tsx +270 -0
  98. package/src/components/ui/dialog.tsx +160 -0
  99. package/src/components/ui/direction.tsx +6 -0
  100. package/src/components/ui/drawer.tsx +227 -0
  101. package/src/components/ui/dropdown-menu.tsx +269 -0
  102. package/src/components/ui/empty.tsx +103 -0
  103. package/src/components/ui/field.tsx +238 -0
  104. package/src/components/ui/hover-card.tsx +50 -0
  105. package/src/components/ui/input-group.tsx +158 -0
  106. package/src/components/ui/input-otp.tsx +86 -0
  107. package/src/components/ui/input.tsx +19 -0
  108. package/src/components/ui/item.tsx +201 -0
  109. package/src/components/ui/kbd.tsx +26 -0
  110. package/src/components/ui/label.tsx +19 -0
  111. package/src/components/ui/marker.tsx +70 -0
  112. package/src/components/ui/menubar.tsx +280 -0
  113. package/src/components/ui/message-scroller.tsx +131 -0
  114. package/src/components/ui/message.tsx +91 -0
  115. package/src/components/ui/native-select.tsx +60 -0
  116. package/src/components/ui/navigation-menu.tsx +167 -0
  117. package/src/components/ui/pagination.tsx +130 -0
  118. package/src/components/ui/popover.tsx +91 -0
  119. package/src/components/ui/progress.tsx +82 -0
  120. package/src/components/ui/questionnaire.tsx +324 -0
  121. package/src/components/ui/radio-group.tsx +37 -0
  122. package/src/components/ui/resizable.tsx +49 -0
  123. package/src/components/ui/scroll-area.tsx +54 -0
  124. package/src/components/ui/select.tsx +200 -0
  125. package/src/components/ui/separator.tsx +24 -0
  126. package/src/components/ui/sheet.tsx +138 -0
  127. package/src/components/ui/sidebar.tsx +730 -0
  128. package/src/components/ui/skeleton.tsx +13 -0
  129. package/src/components/ui/slider.tsx +51 -0
  130. package/src/components/ui/spinner.tsx +10 -0
  131. package/src/components/ui/switch.tsx +31 -0
  132. package/src/components/ui/table.tsx +115 -0
  133. package/src/components/ui/tabs.tsx +81 -0
  134. package/src/components/ui/textarea.tsx +17 -0
  135. package/src/components/ui/toast.tsx +234 -0
  136. package/src/components/ui/toggle-group.tsx +89 -0
  137. package/src/components/ui/toggle.tsx +44 -0
  138. package/src/components/ui/tooltip.tsx +65 -0
  139. package/src/hooks/canvas/use-flow-hover.ts +19 -0
  140. package/src/hooks/canvas/use-flow-viewport-persist.ts +34 -0
  141. package/src/hooks/page/use-fit-pages.ts +92 -0
  142. package/src/hooks/page/use-location-search.ts +31 -0
  143. package/src/hooks/page/use-page-preview.ts +41 -0
  144. package/src/hooks/page/use-paged-list.ts +21 -0
  145. package/src/hooks/readability/use-readability.ts +87 -0
  146. package/src/hooks/search/use-dialog.ts +42 -0
  147. package/src/hooks/search/use-highlight-query.ts +58 -0
  148. package/src/hooks/search/use-provider.ts +26 -0
  149. package/src/hooks/use-async-value.ts +60 -0
  150. package/src/hooks/use-close-on-scroll.ts +24 -0
  151. package/src/hooks/use-copy-button.ts +47 -0
  152. package/src/hooks/use-cycle-index.ts +76 -0
  153. package/src/hooks/use-document-title.ts +10 -0
  154. package/src/hooks/use-element-size.ts +36 -0
  155. package/src/hooks/use-external-meta.ts +133 -0
  156. package/src/hooks/use-hot-key.ts +34 -0
  157. package/src/hooks/use-hover-follow.ts +55 -0
  158. package/src/hooks/use-in-view.ts +31 -0
  159. package/src/hooks/use-lang.ts +9 -0
  160. package/src/hooks/use-last-value.ts +16 -0
  161. package/src/hooks/use-layout.ts +19 -0
  162. package/src/hooks/use-marquee.ts +52 -0
  163. package/src/hooks/use-media-query.ts +15 -0
  164. package/src/hooks/use-mobile.ts +20 -0
  165. package/src/hooks/use-modifier-keys.ts +32 -0
  166. package/src/hooks/use-on-change.ts +36 -0
  167. package/src/hooks/use-pane-keys.ts +29 -0
  168. package/src/hooks/use-sidebar.ts +64 -0
  169. package/src/hooks/use-swipe.ts +27 -0
  170. package/src/hooks/use-tree.ts +100 -0
  171. package/src/hooks/viewer/use-in-float-bar.ts +7 -0
  172. package/src/hooks/viewer/use-viewer-prefs.ts +78 -0
  173. package/src/lib/canvas/edge.ts +202 -0
  174. package/src/lib/canvas/geometry.ts +54 -0
  175. package/src/lib/canvas/state.ts +48 -0
  176. package/src/lib/canvas/viewport.ts +38 -0
  177. package/src/lib/canvas/xyflow.ts +2 -0
  178. package/src/lib/config.ts +106 -0
  179. package/src/lib/mdx/callout.ts +21 -0
  180. package/src/lib/mdx/gradient.ts +16 -0
  181. package/src/lib/mdx/mermaid.ts +15 -0
  182. package/src/lib/media/crop-opaque.ts +77 -0
  183. package/src/lib/media/nearby-indexes.ts +7 -0
  184. package/src/lib/media/trim-transparent.ts +118 -0
  185. package/src/lib/readability/config.ts +11 -0
  186. package/src/lib/readability/spotlight.ts +187 -0
  187. package/src/lib/readability/store.ts +147 -0
  188. package/src/lib/tree.ts +90 -0
  189. package/src/lib/utils/cn.ts +2 -0
  190. package/src/lib/utils/format.ts +22 -0
  191. package/src/lib/utils/highlight-style.ts +10 -0
  192. package/src/lib/utils/history.ts +10 -0
  193. package/src/lib/utils/merge-refs.ts +14 -0
  194. package/src/lib/utils/nav-active.ts +59 -0
  195. package/src/lib/utils/stored-value.ts +137 -0
  196. package/src/lib/utils/urls.ts +18 -0
  197. package/src/locales/en_us.json +110 -0
  198. package/src/locales/pl_pl.json +33 -0
  199. package/src/locales/ru_ru.json +110 -0
  200. package/src/locales/uk_ua.json +33 -0
  201. package/src/locales/zh_cn.json +15 -0
  202. package/src/locales/zh_tw.json +15 -0
  203. package/src/locales.ts +6 -0
  204. package/src/types/canvas.ts +54 -0
  205. package/src/types/glb.ts +26 -0
  206. package/src/types/mdx-directives.ts +106 -0
  207. package/src/types/nav.ts +96 -0
  208. package/src/types/preview.ts +15 -0
  209. package/src/types/readability.ts +29 -0
  210. package/src/types/search.ts +57 -0
  211. package/src/types/tree.ts +19 -0
  212. package/src/types/viewer.ts +54 -0
  213. package/styles/content/base.css +198 -0
  214. package/styles/content/default-colors.css +51 -0
  215. package/styles/content/shiki.css +107 -0
  216. package/styles/content/typography.mjs +3637 -0
  217. package/styles/content.css +5 -0
  218. package/styles/image-zoom.css +83 -0
  219. package/styles/layout.css +28 -0
  220. package/styles/left-sidebar.css +140 -0
  221. package/styles/readability.css +50 -0
  222. package/styles/right-sidebar.css +6 -0
  223. package/styles/workspace.css +26 -0
  224. package/styles.css +430 -0
  225. package/README.md +0 -3
@@ -0,0 +1,26 @@
1
+ import type { OrbitControls } from '@react-three/drei';
2
+ import type { ComponentRef } from 'react';
3
+
4
+ export type GlbOrbitControls = ComponentRef<typeof OrbitControls>;
5
+
6
+ export type GlbHomeView = {
7
+ position: [number, number, number];
8
+ target: [number, number, number];
9
+ };
10
+
11
+ export type GlbSceneHandle = {
12
+ zoomBy: (factor: number) => void;
13
+ reset: () => void;
14
+ };
15
+
16
+ export type GlbSessionProps = {
17
+ src?: string | null;
18
+ sources?: string[];
19
+ title?: string;
20
+ scale?: number;
21
+ offset?: number;
22
+ bare?: boolean;
23
+
24
+ resolveResource?: (resourceUrl: string, modelUrl: string) => string | undefined;
25
+ };
26
+
@@ -0,0 +1,106 @@
1
+ import type { CalloutType } from '@terrafirmagreg-team/ui/components/mdx/callout';
2
+
3
+ export type IconDirectiveProps = {
4
+ name: string;
5
+ size?: number | string;
6
+ color?: string;
7
+ strokeWidth?: number;
8
+ className?: string;
9
+ };
10
+
11
+ export type GradientDirectiveProps = {
12
+ from?: string;
13
+ to?: string;
14
+ dir?: string;
15
+ image?: string;
16
+ children: string;
17
+ className?: string;
18
+ };
19
+
20
+ export type GlowDirectiveProps = {
21
+ from?: string;
22
+ to?: string;
23
+ dir?: string;
24
+ image?: string;
25
+ gradient?: boolean;
26
+ fade?: boolean;
27
+ children: string;
28
+ className?: string;
29
+ };
30
+
31
+ export type CalloutDirectiveProps = {
32
+ type?: CalloutType;
33
+ title?: string;
34
+ children: string;
35
+ className?: string;
36
+ };
37
+
38
+ export type CardDirectiveProps = {
39
+ title?: string;
40
+ icon?: string;
41
+ description?: string;
42
+ href?: string;
43
+ external?: boolean;
44
+ children?: string;
45
+ className?: string;
46
+ };
47
+
48
+ export type BannerDirectiveProps = {
49
+ id?: string;
50
+ height?: string;
51
+ variant?: 'rainbow' | 'normal';
52
+ rainbowColors?: string[];
53
+ changeLayout?: boolean;
54
+ children?: string;
55
+ className?: string;
56
+ };
57
+
58
+ export type TabsDirectiveProps = {
59
+ items?: string[];
60
+ defaultIndex?: number;
61
+ label?: string;
62
+ children: string;
63
+ className?: string;
64
+ };
65
+
66
+ export type AccordionsDirectiveProps = {
67
+ multiple?: boolean;
68
+ defaultValue?: string | string[];
69
+ children: string;
70
+ className?: string;
71
+ };
72
+
73
+ export type StepsDirectiveProps = {
74
+ children: string;
75
+ className?: string;
76
+ };
77
+
78
+ export type FilesDirectiveProps = {
79
+ children: string;
80
+ className?: string;
81
+ };
82
+
83
+ export type CodeFenceMetaProps = {
84
+ title?: string;
85
+ lineNumbers?: boolean;
86
+ tab?: string;
87
+ noCopy?: boolean;
88
+ twoslash?: boolean;
89
+ };
90
+
91
+ export type MermaidDirectiveProps = {
92
+ chart: string;
93
+ };
94
+
95
+ export type MathDirectiveProps = {
96
+ children: string;
97
+ block?: boolean;
98
+ };
99
+
100
+ export type TypeTableDirectiveProps = {
101
+ path?: string;
102
+ name?: string;
103
+ type?: string;
104
+ cwd?: boolean;
105
+ };
106
+
@@ -0,0 +1,96 @@
1
+ import type { ComponentProps, ReactNode } from 'react';
2
+
3
+ export type SwitcherOption = {
4
+ value: string;
5
+ title: ReactNode;
6
+ description?: ReactNode;
7
+ icon?: ReactNode;
8
+ url?: string;
9
+ disabled?: boolean;
10
+ };
11
+
12
+ export type SwitcherProps = Omit<ComponentProps<'button'>, 'onSelect'> & {
13
+ options: SwitcherOption[];
14
+ selected?: string;
15
+ onSelect?: (value: string) => void;
16
+ placeholder?: ReactNode;
17
+ icon?: ReactNode;
18
+ header?: ReactNode;
19
+ side?: 'top' | 'bottom' | 'left' | 'right';
20
+ };
21
+
22
+ export type LinkProps = ComponentProps<'a'> & {
23
+ href?: string;
24
+ external?: boolean;
25
+ prefetch?: boolean;
26
+ children?: ReactNode;
27
+ };
28
+
29
+ interface Filterable {
30
+
31
+ on?: 'menu' | 'nav' | 'all';
32
+ }
33
+
34
+ interface WithHref {
35
+ url: string;
36
+
37
+ active?: 'url' | 'nested-url' | 'none';
38
+ external?: boolean;
39
+ }
40
+
41
+ export interface MainItemType extends WithHref, Filterable {
42
+ type?: 'main';
43
+ icon?: ReactNode;
44
+ text: ReactNode;
45
+ description?: ReactNode;
46
+ }
47
+
48
+ export interface IconItemType extends WithHref, Filterable {
49
+ type: 'icon';
50
+
51
+ label?: string;
52
+ icon: ReactNode;
53
+ text: ReactNode;
54
+
55
+ secondary?: boolean;
56
+ }
57
+
58
+ export interface ButtonItemType extends WithHref, Filterable {
59
+ type: 'button';
60
+ icon?: ReactNode;
61
+ text: ReactNode;
62
+
63
+ secondary?: boolean;
64
+ }
65
+
66
+ export interface MenuItemType extends Partial<WithHref>, Filterable {
67
+ type: 'menu';
68
+ icon?: ReactNode;
69
+ text: ReactNode;
70
+ items: (
71
+ | (MainItemType & {
72
+
73
+ menu?: ComponentProps<'a'> & {
74
+ banner?: ReactNode;
75
+ };
76
+ })
77
+ | CustomItemType
78
+ )[];
79
+
80
+ secondary?: boolean;
81
+ }
82
+
83
+ export interface CustomItemType extends Filterable {
84
+ type: 'custom';
85
+
86
+ secondary?: boolean;
87
+ children: ReactNode;
88
+ }
89
+
90
+ export type LinkItemType =
91
+ | MainItemType
92
+ | IconItemType
93
+ | ButtonItemType
94
+ | MenuItemType
95
+ | CustomItemType;
96
+
@@ -0,0 +1,15 @@
1
+ export type PreviewIcon =
2
+ | { type: 'icon'; name: string }
3
+ | {
4
+ type: 'entry';
5
+ kind: string;
6
+ id: string;
7
+ dataset?: { id: string; version?: string };
8
+ };
9
+
10
+ export type PagePreviewData = {
11
+ title: string;
12
+ description?: string;
13
+ icon?: PreviewIcon;
14
+ };
15
+
@@ -0,0 +1,29 @@
1
+ export const readabilityLayouts = [
2
+ 'full',
3
+ 'sidebar',
4
+ 'both',
5
+ 'original',
6
+ ] as const;
7
+ export type ReadabilityLayout = (typeof readabilityLayouts)[number];
8
+
9
+ export const spotlightStyles = ['under', 'aside'] as const;
10
+ export type SpotlightStyle = (typeof spotlightStyles)[number];
11
+
12
+ export type ReadabilityState = {
13
+ layout: ReadabilityLayout;
14
+ pageWidth: number;
15
+ contentWidth: number;
16
+ spotlight: boolean;
17
+ spotlightStyle: SpotlightStyle;
18
+ };
19
+
20
+ export type ReadabilityValue = ReadabilityState & {
21
+ coarsePointer: boolean;
22
+ smallScreen: boolean;
23
+ setLayout: (layout: ReadabilityLayout) => void;
24
+ setPageWidth: (value: number) => void;
25
+ setContentWidth: (value: number) => void;
26
+ setSpotlight: (enabled: boolean) => void;
27
+ setSpotlightStyle: (style: SpotlightStyle) => void;
28
+ };
29
+
@@ -0,0 +1,57 @@
1
+ import type { Dialog } from '@base-ui/react/dialog';
2
+ import type { Root } from 'hast';
3
+ import type { ReactNode } from 'react';
4
+
5
+ export interface SharedProps {
6
+ open: boolean;
7
+ onOpenChange: (open: boolean) => void;
8
+ dialogHandle: Dialog.Handle<unknown>;
9
+ }
10
+
11
+ export interface SortedResult<Content = string> {
12
+ id: string;
13
+ url: string;
14
+ type: 'page' | 'heading' | 'text';
15
+ content: Content;
16
+
17
+ breadcrumbs?: Content[];
18
+
19
+ table?: string;
20
+ }
21
+
22
+ export type ReactSortedResult = SortedResult<ReactNode>;
23
+
24
+ export interface SearchResultRecord extends SortedResult {
25
+
26
+ hastContent: Root;
27
+ }
28
+
29
+ export interface SearchResultTable {
30
+ type: 'table';
31
+
32
+ id: string;
33
+ columns: number;
34
+
35
+ header?: Root;
36
+ rows: SearchResultRecord[];
37
+ }
38
+
39
+ export type SearchResultItem = SearchResultRecord | SearchResultTable;
40
+
41
+ export interface SearchResult {
42
+
43
+ query: string;
44
+ items: SearchResultItem[];
45
+ }
46
+
47
+ export type SearchItemType =
48
+ | ((ReactSortedResult | SearchResultRecord) & {
49
+ external?: boolean;
50
+ })
51
+ | {
52
+ id: string;
53
+ type: 'action';
54
+ node: ReactNode;
55
+ onSelect: () => void;
56
+ };
57
+
@@ -0,0 +1,19 @@
1
+ import type * as PageTree from '@terrafirmagreg-team/translate/types/tree';
2
+ import type { ReactNode } from 'react';
3
+
4
+ export interface TreeContextValue {
5
+
6
+ root: PageTree.Root | PageTree.Folder;
7
+ full: PageTree.Root;
8
+ }
9
+
10
+ export interface TabOption {
11
+ url: string;
12
+ title?: ReactNode;
13
+ icon?: ReactNode;
14
+ description?: ReactNode;
15
+ unlisted?: boolean;
16
+ $folder?: PageTree.Folder;
17
+ urls?: Set<string>;
18
+ }
19
+
@@ -0,0 +1,54 @@
1
+ import type { ReactNode, RefObject } from 'react';
2
+
3
+ export type ZoomControlsProps = {
4
+ onZoomIn: () => void;
5
+ onZoomOut: () => void;
6
+ onFit?: () => void;
7
+ fitLabel?: string;
8
+ };
9
+
10
+ export type PagerControlsProps = {
11
+ index: number;
12
+ count: number;
13
+ onSelect: (index: number) => void;
14
+ };
15
+
16
+ export type ExpandButtonProps = {
17
+ target: RefObject<HTMLElement | null>;
18
+ };
19
+
20
+ export type ViewerSliderSetting = {
21
+ label: ReactNode;
22
+ icon?: ReactNode;
23
+ value: number;
24
+ onChange: (value: number) => void;
25
+ min?: number;
26
+ max?: number;
27
+ step?: number;
28
+ format?: (value: number) => string;
29
+ disabled?: boolean;
30
+ live?: boolean;
31
+ };
32
+
33
+ export type ViewerToggleSetting = {
34
+ label: ReactNode;
35
+ icon?: ReactNode;
36
+ checked: boolean;
37
+ onChange: (value: boolean) => void;
38
+ };
39
+
40
+ export type ViewerSettingsProps = {
41
+ label: string;
42
+ sliders?: ViewerSliderSetting[];
43
+ toggles?: ViewerToggleSetting[];
44
+ };
45
+
46
+ export type ViewerControlsProps = {
47
+ start?: ReactNode;
48
+ pager?: PagerControlsProps;
49
+ zoom?: ZoomControlsProps;
50
+ expand?: ExpandButtonProps;
51
+ extra?: ReactNode;
52
+ settings?: ViewerSettingsProps;
53
+ };
54
+
@@ -0,0 +1,198 @@
1
+ :root {
2
+ --sidebar-drawer-offset: 100%;
3
+ }
4
+
5
+ [dir='rtl'] {
6
+ --sidebar-drawer-offset: -100%;
7
+ }
8
+
9
+ @theme {
10
+ --animate-fade-in: fade-in 300ms ease;
11
+ --animate-fade-out: fade-out 300ms ease;
12
+
13
+ --animate-roll-in: roll-in 320ms cubic-bezier(0.22, 1, 0.36, 1);
14
+
15
+ --animate-dialog-in: dialog-in 300ms cubic-bezier(0.16, 1, 0.3, 1);
16
+ --animate-dialog-out: dialog-out 300ms cubic-bezier(0.16, 1, 0.3, 1);
17
+
18
+ --animate-popover-in: popover-in 100ms ease;
19
+ --animate-popover-out: popover-out 100ms ease;
20
+
21
+ --animate-sidebar-in: sidebar-in 250ms ease;
22
+ --animate-sidebar-out: sidebar-out 250ms ease;
23
+
24
+ @keyframes sidebar-in {
25
+ from {
26
+ transform: translateX(var(--sidebar-drawer-offset));
27
+ }
28
+ }
29
+
30
+ @keyframes sidebar-out {
31
+ to {
32
+ transform: translateX(var(--sidebar-drawer-offset));
33
+ }
34
+ }
35
+
36
+ @keyframes dialog-in {
37
+ from {
38
+ transform: scale(1.06);
39
+ opacity: 0;
40
+ }
41
+ to {
42
+ transform: scale(1);
43
+ }
44
+ }
45
+
46
+ @keyframes dialog-out {
47
+ from {
48
+ transform: scale(1);
49
+ }
50
+ to {
51
+ transform: scale(1.04);
52
+ opacity: 0;
53
+ }
54
+ }
55
+
56
+ @keyframes popover-in {
57
+ from {
58
+ opacity: 0;
59
+ transform: scale(0.9);
60
+ }
61
+ }
62
+
63
+ @keyframes popover-out {
64
+ to {
65
+ opacity: 0;
66
+ transform: scale(0.9);
67
+ }
68
+ }
69
+
70
+ @keyframes fade-in {
71
+ from {
72
+ opacity: 0;
73
+ }
74
+ to {
75
+ opacity: 1;
76
+ }
77
+ }
78
+
79
+ @keyframes roll-in {
80
+ from {
81
+ opacity: 0;
82
+ translate: 0 calc(var(--roll, 1) * 0.6em);
83
+ filter: blur(2px);
84
+ }
85
+ }
86
+
87
+ @keyframes fade-out {
88
+ from {
89
+ opacity: 1;
90
+ }
91
+ to {
92
+ opacity: 0;
93
+ }
94
+ }
95
+ }
96
+
97
+ @layer base {
98
+ *,
99
+ ::after,
100
+ ::before,
101
+ ::backdrop,
102
+ ::file-selector-button {
103
+ border-color: var(--color-border, currentColor);
104
+ }
105
+
106
+ body {
107
+ background-color: var(--color-background);
108
+ color: var(--color-foreground);
109
+ }
110
+ }
111
+
112
+ @utility scroll-container {
113
+ &::-webkit-scrollbar {
114
+ width: 5px;
115
+ height: 5px;
116
+ }
117
+
118
+ &::-webkit-scrollbar-thumb {
119
+ border-radius: 5px;
120
+ background: var(--color-border);
121
+ }
122
+
123
+ &::-webkit-scrollbar-track {
124
+ background: transparent;
125
+ }
126
+
127
+ &::-webkit-scrollbar-corner {
128
+ display: none;
129
+ }
130
+ }
131
+
132
+ @utility fd-steps {
133
+ counter-reset: step;
134
+ position: relative;
135
+ @apply ps-6 ms-2 border-s sm:ms-4 sm:ps-7;
136
+ }
137
+
138
+ @utility fd-step {
139
+ position: relative;
140
+ @apply pb-6;
141
+ &:before {
142
+ background-color: var(--color-secondary);
143
+ color: var(--color-secondary-foreground);
144
+ content: counter(step);
145
+ counter-increment: step;
146
+ justify-content: center;
147
+ align-items: center;
148
+ font-size: 0.875rem;
149
+ line-height: 1.25rem;
150
+ display: flex;
151
+ position: absolute;
152
+ top: 0;
153
+ inset-inline-end: calc(100% + 0.5rem);
154
+ @media (min-width: 40rem) {
155
+ inset-inline-end: calc(100% + 0.75rem);
156
+ }
157
+ @apply size-8 rounded-full;
158
+ }
159
+ }
160
+
161
+ @utility prose-no-margin {
162
+ & > :first-child {
163
+ margin-top: 0;
164
+ }
165
+
166
+ & > :last-child {
167
+ margin-bottom: 0;
168
+ }
169
+ }
170
+
171
+ @variant dark (&:where(.dark, .dark *));
172
+
173
+ @variant layout {
174
+ #docs-layout:has(&),
175
+ #notebook-layout:has(&),
176
+ #home-layout:has(&),
177
+ #flux-layout:has(&),
178
+ #glass-layout:has(&),
179
+ #spacious-layout:has(&) {
180
+ @slot;
181
+ }
182
+ }
183
+
184
+ @property --sidebar-col {
185
+ syntax: '<length>';
186
+ inherits: true;
187
+ initial-value: 0px;
188
+ }
189
+
190
+ @property --ai-chat-col {
191
+ syntax: '<length>';
192
+ inherits: true;
193
+ initial-value: 0px;
194
+ }
195
+
196
+ .fd-page-tree-item-name {
197
+ @apply inline-flex items-center gap-1 w-full;
198
+ }
@@ -0,0 +1,51 @@
1
+ @theme {
2
+ --color-background: hsl(0, 0%, 96%);
3
+ --color-foreground: hsl(0, 0%, 3.9%);
4
+ --color-muted: hsl(0, 0%, 96.1%);
5
+ --color-muted-foreground: hsl(0, 0%, 45.1%);
6
+ --color-popover: hsl(0, 0%, 98%);
7
+ --color-popover-foreground: hsl(0, 0%, 15.1%);
8
+ --color-card: hsl(0, 0%, 94.7%);
9
+ --color-card-foreground: hsl(0, 0%, 3.9%);
10
+ --color-border: hsla(0, 0%, 80%, 50%);
11
+ --color-primary: hsl(0, 0%, 9%);
12
+ --color-primary-foreground: hsl(0, 0%, 98%);
13
+ --color-secondary: hsl(0, 0%, 93.1%);
14
+ --color-secondary-foreground: hsl(0, 0%, 9%);
15
+ --color-accent: hsla(0, 0%, 82%, 50%);
16
+ --color-accent-foreground: hsl(0, 0%, 9%);
17
+ --color-ring: hsl(0, 0%, 63.9%);
18
+ --color-overlay: hsla(0, 0%, 0%, 0.2);
19
+ }
20
+
21
+ .dark {
22
+ --color-background: hsl(0, 0%, 7.04%);
23
+ --color-foreground: hsl(0, 0%, 92%);
24
+ --color-muted: hsl(0, 0%, 12.9%);
25
+ --color-muted-foreground: hsla(0, 0%, 70%, 0.8);
26
+ --color-popover: hsl(0, 0%, 11.6%);
27
+ --color-popover-foreground: hsl(0, 0%, 86.9%);
28
+ --color-card: hsl(0, 0%, 9.8%);
29
+ --color-card-foreground: hsl(0, 0%, 98%);
30
+ --color-border: hsla(0, 0%, 40%, 20%);
31
+ --color-primary: hsl(0, 0%, 98%);
32
+ --color-primary-foreground: hsl(0, 0%, 9%);
33
+ --color-secondary: hsl(0, 0%, 12.9%);
34
+ --color-secondary-foreground: hsl(0, 0%, 92%);
35
+ --color-accent: hsla(0, 0%, 40.9%, 30%);
36
+ --color-accent-foreground: hsl(0, 0%, 90%);
37
+ --color-ring: hsl(0, 0%, 54.9%);
38
+ --color-overlay: hsla(0, 0%, 0%, 0.2);
39
+ }
40
+
41
+ @theme static {
42
+ --color-info: oklch(62.3% 0.214 259.815);
43
+ --color-warning: oklch(76.9% 0.188 70.08);
44
+ --color-error: oklch(63.7% 0.237 25.331);
45
+ --color-success: oklch(72.3% 0.219 149.579);
46
+ --color-idea: oklch(70.5% 0.209 60.849);
47
+ --color-diff-remove: rgba(200, 10, 100, 0.12);
48
+ --color-diff-remove-symbol: rgb(230, 10, 100);
49
+ --color-diff-add: rgba(14, 180, 100, 0.1);
50
+ --color-diff-add-symbol: rgb(10, 200, 100);
51
+ }