Docs
diff --git a/docs/components/Toc.vue b/docs/components/Toc.vue
new file mode 100644
index 0000000..6b3c3de
--- /dev/null
+++ b/docs/components/Toc.vue
@@ -0,0 +1,91 @@
+
+
+
+
+
+ -
+
+ {{ item.text }}
+
+
+
+ -
+
+ {{ child.text }}
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/composables/useShikiHighlighter.ts b/docs/composables/useShikiHighlighter.ts
index f75de2f..9602fb3 100644
--- a/docs/composables/useShikiHighlighter.ts
+++ b/docs/composables/useShikiHighlighter.ts
@@ -1,7 +1,8 @@
import { createShikiHighlighter } from "@nuxtjs/mdc/runtime/highlighter/shiki";
import MaterialTheme from "shiki/themes/material-theme.mjs";
import MaterialThemeLighter from "shiki/themes/material-theme-lighter.mjs";
-import MaterialThemePalenight from "shiki/themes/material-theme-palenight.mjs";
+import LightPlus from "shiki/themes/light-plus.mjs";
+import DarkPlus from "shiki/themes/dark-plus.mjs";
import HtmlLang from "shiki/langs/html.mjs";
import MdcLang from "shiki/langs/mdc.mjs";
import VueLang from "shiki/langs/vue.mjs";
@@ -14,9 +15,10 @@ export const useShikiHighlighter = () => {
if (!highlighter) {
highlighter = createShikiHighlighter({
bundledThemes: {
- "material-theme": MaterialTheme,
"material-theme-lighter": MaterialThemeLighter,
- "material-theme-palenight": MaterialThemePalenight,
+ "material-theme": MaterialTheme,
+ "light-plus": LightPlus,
+ "dark-plus": DarkPlus,
},
bundledLangs: {
html: HtmlLang,
diff --git a/docs/content/2.components/button.md b/docs/content/2.components/button.md
index 38b3774..75725a5 100644
--- a/docs/content/2.components/button.md
+++ b/docs/content/2.components/button.md
@@ -1,25 +1,31 @@
-# Button
-
-Buttons are used to trigger an action or event, such as submitting a form, opening a dialog, canceling an action, or performing a delete operation.
+---
+description: Create a button component with different variants and colors
+---
## Usage
-```html
-
Click me
-```
+Default button style
----
-
-::DocExampleBlock
-test
-
-#code
-console.log('Hello Rayine')
+::ComponentPreview
+Button
::
-::RayButton
+### Variants
+
+::ComponentPreview
---
-color: red
+props:
+ variant: soft
---
-Hello Rayine
+Button
+::
+
+### Colors
+
+::ComponentPreview
+---
+props:
+ color: violet
+---
+Button
::
diff --git a/docs/content/index.md b/docs/content/index.md
index c7fea44..7f1afad 100644
--- a/docs/content/index.md
+++ b/docs/content/index.md
@@ -1,18 +1 @@
-::DocContentBlock
----
-title: Button
-accent-title: true
----
-::
-
-::DocContentBlock
----
-title: Variants
----
-::
-
-::DocExampleBlock
----
-lang: vue
----
-::
+# index
diff --git a/docs/layouts/default.vue b/docs/layouts/default.vue
index 32e801f..d80f80c 100644
--- a/docs/layouts/default.vue
+++ b/docs/layouts/default.vue
@@ -18,11 +18,13 @@ body {
@apply bg-white dark:bg-neutral-900 text-neutral-900 dark:text-neutral-100;
}
-.shiki,
+/* .shiki,
.shiki span {
background-color: rgba(0, 0, 0, 0) !important;
-}
+} */
+
+/*
@media (prefers-color-scheme: dark) {
.shiki,
@@ -34,5 +36,5 @@ body {
font-weight: var(--shiki-dark-font-weight) !important;
text-decoration: var(--shiki-dark-text-decoration) !important;
}
-}
+} */
diff --git a/docs/nuxt.config.ts b/docs/nuxt.config.ts
index 0ec59dd..cde4222 100644
--- a/docs/nuxt.config.ts
+++ b/docs/nuxt.config.ts
@@ -4,15 +4,15 @@ import defaultTheme from "tailwindcss/defaultTheme";
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
compatibilityDate: "2024-04-03",
- modules: ["@nuxt/content", "@nuxt/fonts", module],
+ modules: ["@nuxt/content", "@nuxt/fonts", "@nuxtjs/color-mode", module],
devtools: { enabled: true },
rayui: {
+ // @ts-ignore
globalComponents: true,
safeColors: ["amber", "emerald", "red", "sky", "violet", "cyan"],
},
tailwindcss: {
config: {
- darkMode: "media",
theme: {
extend: {
fontFamily: {
@@ -22,6 +22,10 @@ export default defineNuxtConfig({
},
},
},
+ colorMode: {
+ preference: "system",
+ classSuffix: "",
+ },
components: [
{
path: "~/components",
@@ -33,6 +37,11 @@ export default defineNuxtConfig({
langs: ["postcss", "mdc", "html", "vue", "ts", "js"],
},
},
+ mdc: {
+ highlight: {
+ themes: ["material-theme-lighter", "material-theme", "light-plus", "dark-plus"],
+ },
+ },
typescript: {
includeWorkspace: true,
},
diff --git a/docs/package.json b/docs/package.json
index 4a85c32..8480a9b 100644
--- a/docs/package.json
+++ b/docs/package.json
@@ -10,6 +10,7 @@
},
"dependencies": {
"@nuxt/content": "^2.13.4",
+ "@nuxtjs/color-mode": "^3.5.2",
"@nuxtjs/mdc": "^0.9.2",
"nuxt": "^3.14.159",
"nuxt-shiki": "^0.3.0",
diff --git a/docs/pages/[...slug].vue b/docs/pages/[...slug].vue
index fc8ec8c..3639812 100644
--- a/docs/pages/[...slug].vue
+++ b/docs/pages/[...slug].vue
@@ -1,4 +1,6 @@
-
-
+
+
+
+
{{ page?.title || 'untitled' }}
+
{{ page.description }}
+
+
+
+
+
+
+
+
+
+ Table of contents
+
+
+
+
diff --git a/docs/utils/index.ts b/docs/utils/index.ts
new file mode 100644
index 0000000..1c515ec
--- /dev/null
+++ b/docs/utils/index.ts
@@ -0,0 +1,17 @@
+export const renderObject = (obj: any): string => {
+ if (Array.isArray(obj)) {
+ return `[${obj.map(renderObject).join(", ")}]`;
+ }
+
+ if (typeof obj === "object") {
+ return `{ ${Object.entries(obj)
+ .map(([key, value]) => `${key}: ${renderObject(value)}`)
+ .join(", ")} }`;
+ }
+
+ if (typeof obj === "string") {
+ return `'${obj}'`;
+ }
+
+ return obj;
+};
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 614cc86..f99dda9 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -78,6 +78,9 @@ importers:
'@nuxt/content':
specifier: ^2.13.4
version: 2.13.4(ioredis@5.4.1)(magicast@0.3.5)(nuxt@3.14.159(@parcel/watcher@2.5.0)(@types/node@22.9.0)(eslint@9.15.0(jiti@2.4.0))(ioredis@5.4.1)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.27.2)(terser@5.36.0)(typescript@5.6.3)(vite@5.4.11(@types/node@22.9.0)(terser@5.36.0))(vue-tsc@2.1.10(typescript@5.6.3)))(rollup@4.27.2)(vue@3.5.13(typescript@5.6.3))
+ '@nuxtjs/color-mode':
+ specifier: ^3.5.2
+ version: 3.5.2(magicast@0.3.5)(rollup@4.27.2)
'@nuxtjs/mdc':
specifier: ^0.9.2
version: 0.9.2(magicast@0.3.5)(rollup@4.27.2)
@@ -950,6 +953,9 @@ packages:
peerDependencies:
vue: ^3.3.4
+ '@nuxtjs/color-mode@3.5.2':
+ resolution: {integrity: sha512-cC6RfgZh3guHBMLLjrBB2Uti5eUoGM9KyauOaYS9ETmxNWBMTvpgjvSiSJp1OFljIXPIqVTJ3xtJpSNZiO3ZaA==}
+
'@nuxtjs/mdc@0.9.2':
resolution: {integrity: sha512-dozIPTPjEYu8jChHNCICZP3mN0sFC6l3aLxTkgv/DAr1EI8jqqqoSZKevzuiHUWGNTguS70+fLcztCwrzWdoYA==}
@@ -6276,6 +6282,17 @@ snapshots:
- vti
- vue-tsc
+ '@nuxtjs/color-mode@3.5.2(magicast@0.3.5)(rollup@4.27.2)':
+ dependencies:
+ '@nuxt/kit': 3.14.159(magicast@0.3.5)(rollup@4.27.2)
+ pathe: 1.1.2
+ pkg-types: 1.2.1
+ semver: 7.6.3
+ transitivePeerDependencies:
+ - magicast
+ - rollup
+ - supports-color
+
'@nuxtjs/mdc@0.9.2(magicast@0.3.5)(rollup@4.27.2)':
dependencies:
'@nuxt/kit': 3.14.159(magicast@0.3.5)(rollup@4.27.2)