@clidey/dory 1.0.8 → 1.9.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 (198) hide show
  1. package/README.md +12 -1
  2. package/bin/chat-server.ts +270 -0
  3. package/bin/dist/analytics-server.d.ts +11 -0
  4. package/bin/dist/analytics-server.d.ts.map +1 -0
  5. package/bin/dist/analytics-server.js +121 -0
  6. package/bin/dist/analytics-server.js.map +1 -0
  7. package/bin/dist/automation.d.ts +35 -0
  8. package/bin/dist/automation.d.ts.map +1 -0
  9. package/bin/dist/automation.js +259 -0
  10. package/bin/dist/automation.js.map +1 -0
  11. package/bin/dist/chat-server.d.ts +8 -0
  12. package/bin/dist/chat-server.d.ts.map +1 -0
  13. package/bin/dist/chat-server.js +322 -0
  14. package/bin/dist/chat-server.js.map +1 -0
  15. package/bin/dist/check.d.ts +16 -0
  16. package/bin/dist/check.d.ts.map +1 -0
  17. package/bin/dist/check.js +247 -0
  18. package/bin/dist/check.js.map +1 -0
  19. package/bin/dist/dory.js +252 -402
  20. package/bin/dist/dory.js.map +1 -1
  21. package/bin/dist/i18n-init.d.ts +6 -0
  22. package/bin/dist/i18n-init.d.ts.map +1 -0
  23. package/bin/dist/i18n-init.js +56 -0
  24. package/bin/dist/i18n-init.js.map +1 -0
  25. package/bin/dist/mcp-http.d.ts +8 -0
  26. package/bin/dist/mcp-http.d.ts.map +1 -0
  27. package/bin/dist/mcp-http.js +72 -0
  28. package/bin/dist/mcp-http.js.map +1 -0
  29. package/bin/dist/mcp.d.ts +2 -0
  30. package/bin/dist/mcp.d.ts.map +1 -0
  31. package/bin/dist/mcp.js +81 -0
  32. package/bin/dist/mcp.js.map +1 -0
  33. package/bin/dist/preview-entry.d.ts +2 -0
  34. package/bin/dist/preview-entry.d.ts.map +1 -0
  35. package/bin/dist/preview-entry.js +6 -0
  36. package/bin/dist/preview-entry.js.map +1 -0
  37. package/bin/dist/preview-server.d.ts +5 -0
  38. package/bin/dist/preview-server.d.ts.map +1 -0
  39. package/bin/dist/preview-server.js +159 -0
  40. package/bin/dist/preview-server.js.map +1 -0
  41. package/bin/dist/project-config.d.ts +22 -0
  42. package/bin/dist/project-config.d.ts.map +1 -0
  43. package/bin/dist/project-config.js +44 -0
  44. package/bin/dist/project-config.js.map +1 -0
  45. package/dist/index.html +57 -0
  46. package/dist/runtime/dory-runtime.css +2 -0
  47. package/dist/runtime/dory-runtime.html +14 -0
  48. package/dist/runtime/dory-runtime.js +5490 -0
  49. package/docs/api-playground-demo.mdx +119 -0
  50. package/docs/api-reference/asyncapi.json +324 -0
  51. package/docs/api-reference/openapi.json +366 -0
  52. package/docs/api-reference/operations/create.mdx +5 -0
  53. package/docs/api-reference/operations/delete.mdx +5 -0
  54. package/docs/api-reference/operations/get.mdx +5 -0
  55. package/docs/api-reference/operations/update.mdx +5 -0
  56. package/docs/api-reference/websocket-operations/receive-chat-message.mdx +5 -0
  57. package/docs/api-reference/websocket-operations/receive-notifications.mdx +5 -0
  58. package/docs/api-reference/websocket-operations/receive-presence-update.mdx +5 -0
  59. package/docs/api-reference/websocket-operations/send-chat-message.mdx +5 -0
  60. package/docs/api-reference/websocket-operations/send-presence-update.mdx +5 -0
  61. package/docs/assets/dory.jpeg +0 -0
  62. package/docs/components/accordion.mdx +145 -0
  63. package/docs/components/callouts.mdx +134 -0
  64. package/docs/components/cards.mdx +153 -0
  65. package/docs/components/code-blocks.mdx +281 -0
  66. package/docs/components/expandable.mdx +189 -0
  67. package/docs/components/icons.mdx +71 -0
  68. package/docs/components/images.mdx +82 -0
  69. package/docs/components/latex.mdx +148 -0
  70. package/docs/components/layout.mdx +175 -0
  71. package/docs/components/lists.mdx +134 -0
  72. package/docs/components/mermaid.mdx +149 -0
  73. package/docs/components/overview.mdx +81 -0
  74. package/docs/components/source.mdx +130 -0
  75. package/docs/components/steps.mdx +122 -0
  76. package/docs/components/tables.mdx +114 -0
  77. package/docs/components/tags.mdx +179 -0
  78. package/docs/components/typography.mdx +185 -0
  79. package/docs/configuration/analytics.mdx +45 -0
  80. package/docs/configuration/chat.mdx +59 -0
  81. package/docs/configuration/dory-json.mdx +278 -0
  82. package/docs/configuration/embed.mdx +73 -0
  83. package/docs/configuration/fonts.mdx +86 -0
  84. package/docs/configuration/internationalization.mdx +61 -0
  85. package/docs/configuration/navigation.mdx +217 -0
  86. package/docs/configuration/theming.mdx +166 -0
  87. package/docs/dory.json +129 -0
  88. package/docs/embed-example.html +176 -0
  89. package/docs/favicon.svg +18 -0
  90. package/docs/features.mdx +440 -0
  91. package/docs/getting-started/automation.mdx +76 -0
  92. package/docs/getting-started/configuration.mdx +95 -0
  93. package/docs/getting-started/installation.mdx +88 -0
  94. package/docs/getting-started/quick-start.mdx +53 -0
  95. package/docs/getting-started/whodb-ee-apps.mdx +122 -0
  96. package/docs/introduction.mdx +50 -0
  97. package/docs/logo/logo.svg +18 -0
  98. package/docs/playgrounds/api-playground.mdx +122 -0
  99. package/docs/playgrounds/websocket-playground.mdx +98 -0
  100. package/docs/social-card.png +0 -0
  101. package/docs/social-card.svg +17 -0
  102. package/docs/websocket-playground-demo.mdx +135 -0
  103. package/package.json +23 -17
  104. package/scripts/verify-runtime-parity.mjs +146 -0
  105. package/src/app.css +19 -1
  106. package/src/assets/fonts/HankenGrotesk.ttf +0 -0
  107. package/src/assets/fonts/OFL.txt +94 -0
  108. package/src/components/chat-assistant.tsx +229 -0
  109. package/src/components/dropdown.tsx +3 -3
  110. package/src/components/error-boundary.tsx +2 -2
  111. package/src/components/hooks.tsx +20 -1
  112. package/src/components/navigation.tsx +82 -51
  113. package/src/components/notification.tsx +2 -3
  114. package/src/components/routes.tsx +17 -19
  115. package/src/components/search-index.test.ts +15 -0
  116. package/src/components/search-index.ts +49 -48
  117. package/src/components/search.tsx +208 -104
  118. package/src/components/store.ts +27 -9
  119. package/src/config/mdx-common.ts +11 -0
  120. package/src/config/mdx.ts +10 -11
  121. package/src/embed/loader.ts +0 -3
  122. package/src/embed/types.ts +0 -2
  123. package/src/embed/widget-iframe.ts +19 -21
  124. package/src/embedded-runtime/config.ts +138 -0
  125. package/src/embedded-runtime/index.tsx +680 -0
  126. package/src/embedded-runtime/runtime.html +14 -0
  127. package/src/entry-server.tsx +46 -124
  128. package/src/main.tsx +16 -4
  129. package/src/mdx/accordion.tsx +3 -3
  130. package/src/mdx/api-playground.tsx +18 -16
  131. package/src/mdx/async-api.tsx +2 -2
  132. package/src/mdx/card.tsx +3 -2
  133. package/src/mdx/code.tsx +11 -9
  134. package/src/mdx/fence.tsx +6 -5
  135. package/src/mdx/icon-grid.tsx +4 -1
  136. package/src/mdx/icon-names.test.ts +15 -0
  137. package/src/mdx/icon-names.ts +60 -0
  138. package/src/mdx/icon-source-variants.ts +102 -0
  139. package/src/mdx/icon.tsx +12 -73
  140. package/src/mdx/latex.tsx +3 -2
  141. package/src/mdx/mdx.tsx +1 -1
  142. package/src/mdx/mermaid.tsx +12 -6
  143. package/src/mdx/open-api.tsx +130 -74
  144. package/src/mdx/preprocess.test.ts +16 -0
  145. package/src/mdx/preprocess.ts +61 -0
  146. package/src/mdx/processor.ts +4 -96
  147. package/src/mdx/source.tsx +5 -4
  148. package/src/mdx/specimen.tsx +38 -6
  149. package/src/mdx/tabs.tsx +29 -21
  150. package/src/mdx/text.tsx +9 -9
  151. package/src/mdx/try-it-panel.tsx +284 -0
  152. package/src/mdx/type-scale.tsx +4 -4
  153. package/src/mdx/websocket-playground.tsx +21 -14
  154. package/src/plugins/analytics-injector.ts +8 -0
  155. package/src/plugins/chat-dev-server.ts +32 -0
  156. package/src/plugins/docs-assets.test.ts +25 -0
  157. package/src/plugins/docs-assets.ts +6 -2
  158. package/src/plugins/frontmatter-dev-server.ts +2 -2
  159. package/src/plugins/frontmatter-generator.ts +1 -1
  160. package/src/plugins/html-files-middleware.test.ts +21 -1
  161. package/src/plugins/html-files-middleware.ts +26 -6
  162. package/src/plugins/html-metadata-injector.ts +24 -4
  163. package/src/plugins/llm-txt-dev-server.ts +2 -2
  164. package/src/plugins/llm-txt-generator.ts +21 -4
  165. package/src/plugins/prerender.ts +47 -20
  166. package/src/plugins/robots-generator.ts +1 -1
  167. package/src/plugins/sanitize.ts +1 -1
  168. package/src/plugins/shared.ts +6 -18
  169. package/src/plugins/sitemap-generator.ts +1 -1
  170. package/src/plugins/social-preview.test.ts +71 -0
  171. package/src/plugins/social-preview.ts +87 -0
  172. package/src/plugins/unified-mdx-plugin.ts +1 -1
  173. package/src/theme.scss +630 -207
  174. package/src/types/config.ts +53 -1
  175. package/src/ui/breadcrumb.tsx +17 -0
  176. package/src/ui/docs-header-view.tsx +32 -0
  177. package/src/ui/docs-navigation-view.tsx +69 -0
  178. package/src/ui/docs-page-frame.tsx +50 -0
  179. package/src/ui/dory-mark.tsx +9 -0
  180. package/src/ui/header.tsx +33 -90
  181. package/src/ui/layout.tsx +99 -153
  182. package/src/ui/mobile-navigation.tsx +10 -8
  183. package/src/ui/page-actions.tsx +67 -0
  184. package/src/ui/page-feedback.tsx +50 -0
  185. package/src/ui/page-footer.tsx +23 -0
  186. package/src/ui/prev-next-link.tsx +15 -69
  187. package/src/ui/prev-next-view.tsx +27 -0
  188. package/src/ui/table-of-content-view.tsx +167 -0
  189. package/src/ui/table-of-content.tsx +25 -183
  190. package/src/utils/analytics.test.ts +36 -0
  191. package/src/utils/analytics.ts +35 -0
  192. package/src/utils/colors.ts +7 -0
  193. package/src/utils/content-scope.test.ts +26 -0
  194. package/src/utils/content-scope.ts +39 -0
  195. package/src/utils/search-content.ts +12 -0
  196. package/src/utils/theme.ts +1 -7
  197. package/vite.config.ssr.ts +3 -3
  198. package/vite.config.ts +21 -15
@@ -0,0 +1,189 @@
1
+ ---
2
+ title: 'Expandable'
3
+ description: 'Expandable sections for API response fields, nested properties, and schema documentation.'
4
+ ---
5
+
6
+ # Expandable
7
+
8
+ The `Expandable` component and its companion components (`ResponseField`, `Properties`, `Property`) are designed for documenting API response schemas and nested data structures.
9
+
10
+ ## Expandable
11
+
12
+ A collapsible section with a title and optional icon:
13
+
14
+ <Specimen label="&lt;Expandable&gt;">
15
+
16
+ ```mdx
17
+ <Expandable title="Response Body">
18
+ The response includes the following fields:
19
+
20
+ - `id` — Unique identifier
21
+ - `name` — Display name
22
+ - `created_at` — ISO 8601 timestamp
23
+ </Expandable>
24
+ ```
25
+
26
+ <Expandable title="Response Body">
27
+ The response includes the following fields:
28
+
29
+ - `id` — Unique identifier
30
+ - `name` — Display name
31
+ - `created_at` — ISO 8601 timestamp
32
+ </Expandable>
33
+
34
+ </Specimen>
35
+
36
+ ## Expandable with Icon
37
+
38
+ <Specimen label="&lt;Expandable&gt;">
39
+
40
+ ```mdx
41
+ <Expandable title="Advanced Options" icon="settings-2">
42
+ These options are optional and have sensible defaults.
43
+
44
+ - `timeout` — Request timeout in milliseconds (default: `5000`)
45
+ - `retries` — Number of retries on failure (default: `3`)
46
+ </Expandable>
47
+ ```
48
+
49
+ <Expandable title="Advanced Options" icon="settings-2">
50
+ These options are optional and have sensible defaults.
51
+
52
+ - `timeout` — Request timeout in milliseconds (default: `5000`)
53
+ - `retries` — Number of retries on failure (default: `3`)
54
+ </Expandable>
55
+
56
+ </Specimen>
57
+
58
+ ## ResponseField
59
+
60
+ Document a single API response field with its type and description:
61
+
62
+ <Specimen label="&lt;ResponseField&gt;">
63
+
64
+ ```mdx
65
+ <ResponseField name="id" type="string" required>
66
+ Unique identifier for the resource. Format: UUID v4.
67
+ </ResponseField>
68
+
69
+ <ResponseField name="name" type="string" required>
70
+ Display name of the resource. Max 255 characters.
71
+ </ResponseField>
72
+
73
+ <ResponseField name="metadata" type="object">
74
+ Optional key-value metadata attached to the resource.
75
+ </ResponseField>
76
+
77
+ <ResponseField name="created_at" type="string (ISO 8601)">
78
+ Timestamp when the resource was created.
79
+ </ResponseField>
80
+ ```
81
+
82
+ <ResponseField name="id" type="string" required>
83
+ Unique identifier for the resource. Format: UUID v4.
84
+ </ResponseField>
85
+
86
+ <ResponseField name="name" type="string" required>
87
+ Display name of the resource. Max 255 characters.
88
+ </ResponseField>
89
+
90
+ <ResponseField name="metadata" type="object">
91
+ Optional key-value metadata attached to the resource.
92
+ </ResponseField>
93
+
94
+ <ResponseField name="created_at" type="string (ISO 8601)">
95
+ Timestamp when the resource was created.
96
+ </ResponseField>
97
+
98
+ </Specimen>
99
+
100
+ ## Properties and Property
101
+
102
+ Document a group of schema properties:
103
+
104
+ <Specimen label="&lt;Properties&gt; &lt;Property&gt;">
105
+
106
+ ```mdx
107
+ <Properties>
108
+ <Property name="user_id" type="string">
109
+ ID of the authenticated user making the request.
110
+ </Property>
111
+ <Property name="workspace" type="string">
112
+ Workspace slug. Defaults to the user's personal workspace.
113
+ </Property>
114
+ <Property name="dry_run" type="boolean">
115
+ If `true`, validates the request without making changes.
116
+ </Property>
117
+ </Properties>
118
+ ```
119
+
120
+ <Properties>
121
+ <Property name="user_id" type="string">
122
+ ID of the authenticated user making the request.
123
+ </Property>
124
+ <Property name="workspace" type="string">
125
+ Workspace slug. Defaults to the user's personal workspace.
126
+ </Property>
127
+ <Property name="dry_run" type="boolean">
128
+ If `true`, validates the request without making changes.
129
+ </Property>
130
+ </Properties>
131
+
132
+ </Specimen>
133
+
134
+ ## Nested Schema Example
135
+
136
+ Combine `Expandable` with `ResponseField` and `Properties` for complex nested schemas:
137
+
138
+ <Specimen label="&lt;ResponseField&gt; &lt;Expandable&gt;">
139
+
140
+ ```mdx
141
+ <ResponseField name="user" type="object" required>
142
+ The authenticated user object.
143
+
144
+ <Expandable title="user fields">
145
+ <ResponseField name="user.id" type="string">UUID of the user.</ResponseField>
146
+ <ResponseField name="user.email" type="string">Email address.</ResponseField>
147
+ <ResponseField name="user.role" type="string">One of: `admin`, `editor`, `viewer`.</ResponseField>
148
+ </Expandable>
149
+ </ResponseField>
150
+ ```
151
+
152
+ <ResponseField name="user" type="object" required>
153
+ The authenticated user object.
154
+
155
+ <Expandable title="user fields">
156
+ <ResponseField name="user.id" type="string">UUID of the user.</ResponseField>
157
+ <ResponseField name="user.email" type="string">Email address.</ResponseField>
158
+ <ResponseField name="user.role" type="string">One of: `admin`, `editor`, `viewer`.</ResponseField>
159
+ </Expandable>
160
+ </ResponseField>
161
+
162
+ </Specimen>
163
+
164
+ ## Props Reference
165
+
166
+ ### Expandable Props
167
+
168
+ | Prop | Type | Description |
169
+ | --- | --- | --- |
170
+ | `title` | `string` | Label shown when the section is collapsed. |
171
+ | `icon` | `string` | Optional Clidey Design icon name. |
172
+ | `children` | `ReactNode` | Content shown when expanded. |
173
+
174
+ ### ResponseField Props
175
+
176
+ | Prop | Type | Description |
177
+ | --- | --- | --- |
178
+ | `name` | `string` | Field name (e.g. `"user_id"`). |
179
+ | `type` | `string` | Data type (e.g. `"string"`, `"object"`, `"boolean"`). |
180
+ | `required` | `boolean` | If true, shows a "Required" badge. |
181
+ | `children` | `ReactNode` | Description of the field. |
182
+
183
+ ### Property Props
184
+
185
+ | Prop | Type | Description |
186
+ | --- | --- | --- |
187
+ | `name` | `string` | Property name. |
188
+ | `type` | `string` | Data type. |
189
+ | `children` | `ReactNode` | Description of the property. |
@@ -0,0 +1,71 @@
1
+ ---
2
+ title: 'Icons'
3
+ description: 'The shared Clidey Design icon suite for inline content and components.'
4
+ ---
5
+
6
+ # Icons
7
+
8
+ The `<Icon>` component renders icons from `@clidey/ux/icons`. Icons inherit the text color unless you set `color`. Names use kebab-case.
9
+
10
+ ## Basic Usage
11
+
12
+ <Specimen label="&lt;Icon&gt;">
13
+
14
+ ```mdx
15
+ <Icon icon="promote" />
16
+ <Icon icon="code" />
17
+ <Icon icon="check-circle" />
18
+ ```
19
+
20
+ <Icon icon="promote" /> <Icon icon="code" /> <Icon icon="check-circle" />
21
+
22
+ </Specimen>
23
+
24
+ ## Color and Size
25
+
26
+ <Specimen label="&lt;Icon&gt;">
27
+
28
+ ```mdx
29
+ <Icon icon="star" color="#f59e0b" size={16} />
30
+ <Icon icon="star" color="#f59e0b" size={24} />
31
+ <Icon icon="star" color="#f59e0b" size={40} />
32
+ ```
33
+
34
+ <Icon icon="star" color="#f59e0b" size={16} /> <Icon icon="star" color="#f59e0b" size={24} /> <Icon icon="star" color="#f59e0b" size={40} />
35
+
36
+ </Specimen>
37
+
38
+ ## Icons in Context
39
+
40
+ <Specimen label="&lt;Icon&gt;">
41
+
42
+ ```mdx
43
+ <Icon icon="terminal" size={16} /> Run `dory build` to compile your site.
44
+
45
+ <Icon icon="packages" size={16} /> Install with `npm install -g @clidey/dory`.
46
+
47
+ <Icon icon="branch" size={16} /> Push the `dist/` directory to your hosting provider.
48
+ ```
49
+
50
+ <Icon icon="terminal" size={16} /> Run `dory build` to compile your site.
51
+
52
+ <Icon icon="packages" size={16} /> Install with `npm install -g @clidey/dory`.
53
+
54
+ <Icon icon="branch" size={16} /> Push the `dist/` directory to your hosting provider.
55
+
56
+ </Specimen>
57
+
58
+ ## Icon Catalog
59
+
60
+ The catalog includes every icon published by Clidey Design, including distinct variants with `-alt` suffixes. Click an icon to copy its MDX tag. Existing source-prefixed names such as `enterprise/chevron-down` continue to work.
61
+
62
+ <IconGrid />
63
+
64
+ ## Props Reference
65
+
66
+ | Prop | Type | Default | Description |
67
+ | --- | --- | --- | --- |
68
+ | `icon` | `string` | — | Clidey Design icon name, such as `check-circle`. |
69
+ | `color` | `string` | Inherits from text | CSS color value. |
70
+ | `size` | `number` | `24` | Icon size in pixels. |
71
+ | `className` | `string` | — | Additional CSS classes. |
@@ -0,0 +1,82 @@
1
+ ---
2
+ title: 'Images'
3
+ description: 'Clickable images with fullscreen modal overlay using the img component.'
4
+ ---
5
+
6
+ # Images
7
+
8
+ Images in Dory support click-to-fullscreen functionality. Clicking any image opens it in a fullscreen modal overlay with a dark background.
9
+
10
+ ## Basic Usage
11
+
12
+ Use standard Markdown image syntax:
13
+
14
+ <Specimen label="![alt](src)">
15
+
16
+ ```mdx
17
+ ![Dory logo](../assets/dory.jpeg)
18
+ ```
19
+
20
+ ![Dory logo](../assets/dory.jpeg)
21
+
22
+ </Specimen>
23
+
24
+ ## HTML img Tag
25
+
26
+ You can also use the HTML `<img>` tag for more control:
27
+
28
+ <Specimen label="&lt;img&gt;">
29
+
30
+ ```mdx
31
+ <img src="../assets/dory.jpeg" alt="Dory logo" className="w-32 h-32 object-cover rounded" />
32
+ ```
33
+
34
+ <img src="../assets/dory.jpeg" alt="Dory logo" className="w-32 h-32 object-cover rounded" />
35
+
36
+ </Specimen>
37
+
38
+ ## Fullscreen Behavior
39
+
40
+ When a user clicks an image:
41
+ 1. A fullscreen overlay appears with a black semi-transparent background
42
+ 2. The image is displayed centered at full size
43
+ 3. Clicking anywhere on the overlay closes it
44
+
45
+ This is useful for screenshots, diagrams, and any image where detail matters.
46
+
47
+ ## Images in Columns
48
+
49
+ Images can be combined with `<Row>` and `<Col>` for side-by-side layouts:
50
+
51
+ ```mdx
52
+ <Row>
53
+ <Col>
54
+ **Light Mode**
55
+
56
+ ![Light mode](../assets/light-mode.png)
57
+ </Col>
58
+ <Col>
59
+ **Dark Mode**
60
+
61
+ ![Dark mode](../assets/dark-mode.png)
62
+ </Col>
63
+ </Row>
64
+ ```
65
+
66
+ ## Best Practices
67
+
68
+ <Note>
69
+ Store images in the `assets/` directory inside your docs folder. Reference them with paths relative to the MDX file, as your editor previews them (e.g. `../assets/image.png` from a page in `components/`). Dory rewrites relative paths to site-root paths at build time, so they work on every page and host. Root paths such as `/assets/image.png` also work.
70
+ </Note>
71
+
72
+ <Tip>
73
+ Use SVG images where possible — they scale perfectly at any size and the fullscreen mode will display them at full resolution without any blurriness.
74
+ </Tip>
75
+
76
+ ## Props
77
+
78
+ | Attribute | Type | Description |
79
+ | --- | --- | --- |
80
+ | `src` | `string` | Image URL or path. |
81
+ | `alt` | `string` | Alt text for accessibility. |
82
+ | `className` | `string` | CSS classes for sizing and styling. |
@@ -0,0 +1,148 @@
1
+ ---
2
+ title: 'LaTeX Math'
3
+ description: 'Render mathematical expressions and equations using KaTeX with the Latex component.'
4
+ ---
5
+
6
+ # LaTeX Math
7
+
8
+ The `<Latex>` component renders mathematical expressions using [KaTeX](https://katex.org). Use it for equations, formulas, and any mathematical notation.
9
+
10
+ <Note>
11
+ In MDX, curly braces inside JSX content are parsed as JavaScript expressions. For LaTeX expressions containing curly braces (like `\frac{a}{b}`), use a JavaScript string literal: `{'\\frac{a}{b}'}`.
12
+ </Note>
13
+
14
+ ## Basic Expressions
15
+
16
+ Simple expressions without curly braces work directly:
17
+
18
+ <Specimen label="&lt;Latex&gt;">
19
+
20
+ ```mdx
21
+ <Row cols={2}>
22
+ <Col><Latex>E = mc^2</Latex></Col>
23
+ <Col><Latex>a^2 + b^2 = c^2</Latex></Col>
24
+ </Row>
25
+
26
+ Inline math sits in the sentence: sorting the index costs <Latex inline>O(n \log n)</Latex> comparisons.
27
+ ```
28
+
29
+ <Row cols={2} className="py-0">
30
+ <Col><Latex>E = mc^2</Latex></Col>
31
+ <Col><Latex>a^2 + b^2 = c^2</Latex></Col>
32
+ </Row>
33
+
34
+ Inline math sits in the sentence: sorting the index costs <Latex inline>O(n \log n)</Latex> comparisons.
35
+
36
+ <SpecimenProps>
37
+
38
+ <Prop name="children" type="string">LaTeX expression.</Prop>
39
+ <Prop name="inline" type="boolean">Render inline with the text instead of as a display tile. Default: `false`.</Prop>
40
+
41
+ </SpecimenProps>
42
+
43
+ </Specimen>
44
+
45
+ ## Fractions and Derivatives
46
+
47
+ For LaTeX with curly braces, wrap in a JS string literal:
48
+
49
+ <Specimen label="&lt;Latex&gt;">
50
+
51
+ ```mdx
52
+ <Latex>{'\\frac{d}{dx}\\left(\\int_0^x f(t)\\,dt\\right) = f(x)'}</Latex>
53
+ ```
54
+
55
+ <Latex>{'\\frac{d}{dx}\\left(\\int_0^x f(t)\\,dt\\right) = f(x)'}</Latex>
56
+
57
+ </Specimen>
58
+
59
+ <Specimen label="&lt;Latex&gt;">
60
+
61
+ ```mdx
62
+ <Latex>{'x = \\frac{-b \\pm \\sqrt{b^2 - 4ac}}{2a}'}</Latex>
63
+ ```
64
+
65
+ <Latex>{'x = \\frac{-b \\pm \\sqrt{b^2 - 4ac}}{2a}'}</Latex>
66
+
67
+ </Specimen>
68
+
69
+ ## Summation
70
+
71
+ <Specimen label="&lt;Latex&gt;">
72
+
73
+ ```mdx
74
+ <Latex>{'\\sum_{i=1}^{n} i = \\frac{n(n+1)}{2}'}</Latex>
75
+ ```
76
+
77
+ <Latex>{'\\sum_{i=1}^{n} i = \\frac{n(n+1)}{2}'}</Latex>
78
+
79
+ </Specimen>
80
+
81
+ ## Integrals
82
+
83
+ <Specimen label="&lt;Latex&gt;">
84
+
85
+ ```mdx
86
+ <Latex>{'\\int_{-\\infty}^{\\infty} e^{-x^2}\\,dx = \\sqrt{\\pi}'}</Latex>
87
+ ```
88
+
89
+ <Latex>{'\\int_{-\\infty}^{\\infty} e^{-x^2}\\,dx = \\sqrt{\\pi}'}</Latex>
90
+
91
+ </Specimen>
92
+
93
+ ## Normal Distribution
94
+
95
+ <Specimen label="&lt;Latex&gt;">
96
+
97
+ ```mdx
98
+ <Latex>{'f(x) = \\frac{1}{\\sigma\\sqrt{2\\pi}}e^{-\\frac{(x-\\mu)^2}{2\\sigma^2}}'}</Latex>
99
+ ```
100
+
101
+ <Latex>{'f(x) = \\frac{1}{\\sigma\\sqrt{2\\pi}}e^{-\\frac{(x-\\mu)^2}{2\\sigma^2}}'}</Latex>
102
+
103
+ </Specimen>
104
+
105
+ ## Euler's Identity
106
+
107
+ <Specimen label="&lt;Latex&gt;">
108
+
109
+ ```mdx
110
+ <Latex>e^{i\pi} + 1 = 0</Latex>
111
+ ```
112
+
113
+ <Latex>{'e^{i\\pi} + 1 = 0'}</Latex>
114
+
115
+ </Specimen>
116
+
117
+ ## Using Strings vs Direct Content
118
+
119
+ <Row>
120
+ <Col>
121
+ **Direct content (works for simple expressions)**
122
+
123
+ ```mdx
124
+ <Latex>a^2 + b^2 = c^2</Latex>
125
+ ```
126
+
127
+ Works when the expression has no `{` or `}` characters.
128
+ </Col>
129
+ <Col>
130
+ **String literal (required for complex expressions)**
131
+
132
+ ```mdx
133
+ <Latex>{'\\frac{a}{b}'}</Latex>
134
+ ```
135
+
136
+ Required when the expression contains `{...}` braces. Use `\\` for backslashes in the string.
137
+ </Col>
138
+ </Row>
139
+
140
+ ## Props Reference
141
+
142
+ | Prop | Type | Description |
143
+ | --- | --- | --- |
144
+ | `children` | `string` | LaTeX expression string. |
145
+
146
+ <Note>
147
+ KaTeX supports a large subset of LaTeX. See the [KaTeX supported functions](https://katex.org/docs/supported) documentation for the complete list.
148
+ </Note>
@@ -0,0 +1,175 @@
1
+ ---
2
+ title: 'Layout'
3
+ description: 'Row and Col components for multi-column grid layouts within MDX pages.'
4
+ ---
5
+
6
+ # Layout
7
+
8
+ The `<Row>` and `<Col>` components create responsive multi-column layouts inside your MDX content.
9
+
10
+ ## Basic Two-Column Layout
11
+
12
+ <Specimen label="&lt;Row&gt; &lt;Col&gt;">
13
+
14
+ ```mdx
15
+ <Row>
16
+ <Col>
17
+ Left column content here.
18
+ </Col>
19
+ <Col>
20
+ Right column content here.
21
+ </Col>
22
+ </Row>
23
+ ```
24
+
25
+ <Row>
26
+ <Col>
27
+ **Left column**
28
+
29
+ Content on the left side. Columns are equal width by default.
30
+ </Col>
31
+ <Col>
32
+ **Right column**
33
+
34
+ Content on the right side.
35
+ </Col>
36
+ </Row>
37
+
38
+ </Specimen>
39
+
40
+ ## Prose + Code Pattern
41
+
42
+ The most common layout: prose on the left, a sticky code column on the right.
43
+ Use `sticky` on the code column so it stays visible while the prose scrolls.
44
+
45
+ <Specimen label="&lt;Row&gt; &lt;Col&gt;">
46
+
47
+ ```mdx
48
+ <Row>
49
+ <Col>
50
+ ## Creating a user
51
+
52
+ Send a POST request to /api/users with the user's name and email.
53
+
54
+ ### Required fields
55
+
56
+ - `name` — Display name (max 255 characters)
57
+ - `email` — Valid email address
58
+ </Col>
59
+ <Col sticky>
60
+ Request and response examples here.
61
+ </Col>
62
+ </Row>
63
+ ```
64
+
65
+ <Row>
66
+ <Col>
67
+ ## Creating a user
68
+
69
+ Send a `POST` request to `/api/users` with the user's name and email.
70
+
71
+ The response includes the new user's `id`, which you'll need for subsequent requests.
72
+
73
+ ### Required fields
74
+
75
+ - `name` — Display name (max 255 characters)
76
+ - `email` — Valid email address (must be unique)
77
+ </Col>
78
+ <Col sticky>
79
+ **Request**
80
+
81
+ `POST /api/users`
82
+
83
+ `Content-Type: application/json`
84
+
85
+ **Response**
86
+
87
+ `201 Created`
88
+ </Col>
89
+ </Row>
90
+
91
+ </Specimen>
92
+
93
+ ## Three Columns
94
+
95
+ <Specimen label="&lt;Row&gt; &lt;Col&gt;">
96
+
97
+ ```mdx
98
+ <Row cols={3}>
99
+ <Col>Column 1</Col>
100
+ <Col>Column 2</Col>
101
+ <Col>Column 3</Col>
102
+ </Row>
103
+ ```
104
+
105
+ <Row cols={3}>
106
+ <Col>
107
+ **Column 1**
108
+
109
+ First piece of content.
110
+ </Col>
111
+ <Col>
112
+ **Column 2**
113
+
114
+ Second piece of content.
115
+ </Col>
116
+ <Col>
117
+ **Column 3**
118
+
119
+ Third piece of content.
120
+ </Col>
121
+ </Row>
122
+
123
+ </Specimen>
124
+
125
+ ## Specimen
126
+
127
+ `<Specimen>` frames a component example with **Preview**, **Code** and **Props** tabs. Put the MDX source in an ` ```mdx ` fence, the rendered example after it, and optional `<Prop>` rows inside `<SpecimenProps>`. Tabs only appear for the parts you include.
128
+
129
+ <Specimen label="&lt;Specimen&gt; &lt;SpecimenProps&gt;">
130
+
131
+ `````mdx
132
+ <Specimen label="&lt;Tag&gt;">
133
+
134
+ ````mdx
135
+ <Tag color="sky">Beta</Tag>
136
+ ````
137
+
138
+ <Tag color="sky">Beta</Tag>
139
+
140
+ <SpecimenProps>
141
+ <Prop name="color" type="string">Badge color.</Prop>
142
+ </SpecimenProps>
143
+
144
+ </Specimen>
145
+ `````
146
+
147
+ <Tag color="sky">Beta</Tag>
148
+
149
+ <SpecimenProps>
150
+
151
+ <Prop name="label" type="string">Mono caption in the header, usually the component tag. Write angle brackets as `&lt;` and `&gt;`.</Prop>
152
+ <Prop name="children" type="ReactNode">An ` ```mdx ` fence (Code tab), a `<SpecimenProps>` block (Props tab), and the preview.</Prop>
153
+
154
+ </SpecimenProps>
155
+
156
+ </Specimen>
157
+
158
+ ## Props Reference
159
+
160
+ ### Row Props
161
+
162
+ | Prop | Type | Default | Description |
163
+ | --- | --- | --- | --- |
164
+ | `cols` | `number` | `1` | Grid column count. |
165
+ | `className` | `string` | — | Additional CSS classes. |
166
+ | `children` | `ReactNode` | — | `Col` components. |
167
+
168
+ ### Col Props
169
+
170
+ | Prop | Type | Default | Description |
171
+ | --- | --- | --- | --- |
172
+ | `sticky` | `boolean` | `false` | Enables `xl:sticky top-24` positioning. Keeps the column visible while adjacent content scrolls. |
173
+ | `rows` | `number` | `1` | Number of CSS grid rows this column spans. |
174
+ | `gap` | `number` | `4` | Spacing (Tailwind scale) between items inside the column. |
175
+ | `children` | `ReactNode` | — | Column content. |