{title && (
- {title}
+ {parse(parseMarkdownInlineCode(title))}
)}
{parse(out)}
diff --git a/docs-ui/src/components/CodeBlock/index.tsx b/docs-ui/src/components/CodeBlock/index.tsx
index 4c0fe72960..1467bca465 100644
--- a/docs-ui/src/components/CodeBlock/index.tsx
+++ b/docs-ui/src/components/CodeBlock/index.tsx
@@ -1,4 +1,5 @@
import type { BundledLanguage } from 'shiki';
+import { transformerNotationDiff } from '@shikijs/transformers';
import { codeToHtml } from 'shiki';
import { CodeBlockClient } from './client';
@@ -8,14 +9,24 @@ export interface CodeBlockProps {
code?: string;
}
-export async function CodeBlock({ lang = 'tsx', title, code }: CodeBlockProps) {
- const out = await codeToHtml(code || '', {
- lang: lang,
+export async function CodeBlock(props: CodeBlockProps) {
+ const { lang = 'tsx', title, code } = props;
+ let out = await codeToHtml(code || '', {
+ lang,
+ transformers: [transformerNotationDiff({ matchAlgorithm: 'v3' })],
themes: {
- light: 'min-light',
+ light: 'github-dark',
dark: 'min-dark',
},
});
+ // Remove background-color from the pre tag to use our theme colors
+ out = out.replace(
+ /style="([^"]*?)background-color:[^;]+;?([^"]*?)"/g,
+ 'style="$1$2"',
+ );
+ // Clean up empty style attributes
+ out = out.replace(/style=""\s?/g, '');
+
return
;
}
diff --git a/docs-ui/src/components/CodeBlock/styles.module.css b/docs-ui/src/components/CodeBlock/styles.module.css
index 767982a582..30e1837f60 100644
--- a/docs-ui/src/components/CodeBlock/styles.module.css
+++ b/docs-ui/src/components/CodeBlock/styles.module.css
@@ -1,23 +1,29 @@
.codeBlock {
- border-radius: 4px;
- border: 1px solid var(--border);
+ border-radius: 8px;
position: relative;
background: transparent;
overflow-x: auto;
font-family: var(--font-mono);
- background-color: #fff;
+ background-color: var(--code-bg);
margin-bottom: 1rem;
}
-[data-theme-mode='dark'] .codeBlock {
- background-color: #121212;
+.title {
+ padding: 12px 20px;
+ font-size: 0.8125rem;
+ color: #fff;
+ font-family: var(--font-regular);
+ font-weight: var(--font-weight-bold);
+ background-color: var(--code-title);
}
-.title {
- border-bottom: 1px solid var(--border);
- padding: 12px 20px;
- font-size: 0.875rem;
- color: var(--secondary);
+.title code {
+ background-color: rgba(255, 255, 255, 0.1);
+ padding: 0.2rem 0.375rem;
+ border-radius: 0.25rem;
+ color: #fff;
+ font-size: 0.75rem;
+ font-weight: var(--font-weight-bold);
}
.code {
diff --git a/docs-ui/src/components/ComponentCards/ComponentCards.module.css b/docs-ui/src/components/ComponentCards/ComponentCards.module.css
index 688010110c..8eb9dbd3d0 100644
--- a/docs-ui/src/components/ComponentCards/ComponentCards.module.css
+++ b/docs-ui/src/components/ComponentCards/ComponentCards.module.css
@@ -28,7 +28,7 @@
display: flex;
flex-direction: column;
justify-content: flex-end;
- background-color: var(--panel);
+ background-color: var(--bg);
border-radius: 8px;
border: 1px solid var(--border);
padding: 16px;
@@ -36,7 +36,7 @@
min-height: 120px;
&:hover {
- background-color: var(--panel-hover);
+ background-color: var(--bg-hover);
}
}
diff --git a/docs-ui/src/components/CustomTheme/customTheme.tsx b/docs-ui/src/components/CustomTheme/customTheme.tsx
index c70d59173a..ae765d7d88 100644
--- a/docs-ui/src/components/CustomTheme/customTheme.tsx
+++ b/docs-ui/src/components/CustomTheme/customTheme.tsx
@@ -6,9 +6,9 @@ import { sass } from '@codemirror/lang-sass';
import styles from './styles.module.css';
import { usePlayground } from '@/utils/playground-context';
import { AnimatePresence, motion } from 'motion/react';
-import { Icon } from '../../../../packages/ui';
import { createTheme } from '@uiw/codemirror-themes';
import { tags as t } from '@lezer/highlight';
+import { RiArrowDownSLine } from '@remixicon/react';
const defaultTheme = `:root {
--bui-bg-solid: #000;
@@ -125,7 +125,12 @@ export const CustomTheme = () => {
className={styles.buttonClose}
onClick={() => setOpen(!open)}
>
-
+
diff --git a/docs-ui/src/components/CustomTheme/styles.module.css b/docs-ui/src/components/CustomTheme/styles.module.css
index 05604c48be..dddd3ff7e4 100644
--- a/docs-ui/src/components/CustomTheme/styles.module.css
+++ b/docs-ui/src/components/CustomTheme/styles.module.css
@@ -5,7 +5,7 @@
right: 16px;
width: 240px;
height: 47px;
- background-color: var(--panel);
+ background-color: var(--bg);
border-radius: 0.375rem;
border: 1px solid var(--border);
display: flex;
@@ -33,7 +33,7 @@
height: 46px;
flex-shrink: 0;
border-bottom: 1px solid var(--border);
- background-color: var(--panel);
+ background-color: var(--bg);
display: flex;
justify-content: space-between;
align-items: center;
diff --git a/docs-ui/src/components/HeadlessBanners/styles.module.css b/docs-ui/src/components/HeadlessBanners/styles.module.css
index 384327c394..c0066eccff 100644
--- a/docs-ui/src/components/HeadlessBanners/styles.module.css
+++ b/docs-ui/src/components/HeadlessBanners/styles.module.css
@@ -1,6 +1,6 @@
.container {
display: flex;
- background-color: var(--panel);
+ background-color: var(--bg);
padding: 1.5rem;
border-radius: 0.25rem;
border: 1px solid var(--border);
diff --git a/docs-ui/src/components/IconLibrary/IconLibrary.tsx b/docs-ui/src/components/IconLibrary/IconLibrary.tsx
deleted file mode 100644
index bad51e62bf..0000000000
--- a/docs-ui/src/components/IconLibrary/IconLibrary.tsx
+++ /dev/null
@@ -1,22 +0,0 @@
-'use client';
-
-import { Text, Icon, icons } from '../../../../packages/ui';
-import type { IconNames } from '../../../../packages/ui';
-import styles from './styles.module.css';
-
-export const IconLibrary = () => {
- const list = Object.keys(icons);
-
- return (
-