diff --git a/package-lock.json b/package-lock.json index 3204177..0ac1d61 100644 --- a/package-lock.json +++ b/package-lock.json @@ -41,6 +41,7 @@ "eslint-config-prettier": "^10.0.1", "eslint-plugin-svelte": "^2.46.1", "globals": "^15.14.0", + "mdsvex": "^0.12.3", "prettier": "^3.4.2", "prettier-plugin-svelte": "^3.3.3", "prettier-plugin-tailwindcss": "^0.6.11", @@ -2167,6 +2168,12 @@ "meshoptimizer": "~0.18.1" } }, + "node_modules/@types/unist": { + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.11.tgz", + "integrity": "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==", + "dev": true + }, "node_modules/@types/webxr": { "version": "0.5.21", "resolved": "https://registry.npmjs.org/@types/webxr/-/webxr-0.5.21.tgz", @@ -4323,6 +4330,21 @@ "@jridgewell/sourcemap-codec": "^1.5.0" } }, + "node_modules/mdsvex": { + "version": "0.12.3", + "resolved": "https://registry.npmjs.org/mdsvex/-/mdsvex-0.12.3.tgz", + "integrity": "sha512-C/uIJamjNo5PHHnR3JHqsBPoLcfUBpzRmAEB6FLMXI/s7XHOceswjDMKqSPEW2WHmYpKm0taZ3U20GSyhMridA==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.3", + "prism-svelte": "^0.4.7", + "prismjs": "^1.17.1", + "vfile-message": "^2.0.4" + }, + "peerDependencies": { + "svelte": "^3.56.0 || ^4.0.0 || ^5.0.0-next.120" + } + }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -4974,6 +4996,21 @@ } } }, + "node_modules/prism-svelte": { + "version": "0.4.7", + "resolved": "https://registry.npmjs.org/prism-svelte/-/prism-svelte-0.4.7.tgz", + "integrity": "sha512-yABh19CYbM24V7aS7TuPYRNMqthxwbvx6FF/Rw920YbyBWO3tnyPIqRMgHuSVsLmuHkkBS1Akyof463FVdkeDQ==", + "dev": true + }, + "node_modules/prismjs": { + "version": "1.29.0", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.29.0.tgz", + "integrity": "sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -5954,6 +5991,19 @@ "multiformats": "^9.4.2" } }, + "node_modules/unist-util-stringify-position": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz", + "integrity": "sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.2" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -5973,6 +6023,20 @@ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" }, + "node_modules/vfile-message": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-2.0.4.tgz", + "integrity": "sha512-DjssxRGkMvifUOJre00juHoP9DPWuzjxKuMDrhNbk2TdaYYBNMStsNhEOt3idrtI12VQYM/1+iM0KOzXi4pxwQ==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/vite": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/vite/-/vite-6.2.0.tgz", diff --git a/package.json b/package.json index b613dd8..8b9539b 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "eslint-config-prettier": "^10.0.1", "eslint-plugin-svelte": "^2.46.1", "globals": "^15.14.0", + "mdsvex": "^0.12.3", "prettier": "^3.4.2", "prettier-plugin-svelte": "^3.3.3", "prettier-plugin-tailwindcss": "^0.6.11", diff --git a/src/lib/cards/graphs/CardLineGraph.svelte b/src/lib/cards/graphs/CardLineGraph.svelte index ac2b14e..0bcfc60 100644 --- a/src/lib/cards/graphs/CardLineGraph.svelte +++ b/src/lib/cards/graphs/CardLineGraph.svelte @@ -3,13 +3,13 @@ const data = [ { x: new Date('2020-01-01'), value: 10 }, - { x: new Date('2020-01-20'), value: 50 }, + { x: new Date('2020-01-20'), value: 40 }, { x: new Date('2020-02-02'), value: 20 }, { x: new Date('2020-03-03'), value: 30 }, { x: new Date('2020-04-04'), value: 20 }, - { x: new Date('2020-04-20'), value: 80 }, - { x: new Date('2020-05-05'), value: 50 }, - { x: new Date('2020-05-20'), value: 10 } + { x: new Date('2020-04-20'), value: 30 }, + { x: new Date('2020-05-05'), value: 60 }, + { x: new Date('2020-05-20'), value: 50 } ]; diff --git a/src/lib/components/base/accordion/accordion-content.svelte b/src/lib/components/base/accordion/accordion-content.svelte new file mode 100644 index 0000000..d359786 --- /dev/null +++ b/src/lib/components/base/accordion/accordion-content.svelte @@ -0,0 +1,24 @@ + + + +
+ {@render children?.()} +
+
diff --git a/src/lib/components/base/accordion/accordion-item.svelte b/src/lib/components/base/accordion/accordion-item.svelte new file mode 100644 index 0000000..4ef4a59 --- /dev/null +++ b/src/lib/components/base/accordion/accordion-item.svelte @@ -0,0 +1,12 @@ + + + diff --git a/src/lib/components/base/accordion/accordion-trigger.svelte b/src/lib/components/base/accordion/accordion-trigger.svelte new file mode 100644 index 0000000..5d54832 --- /dev/null +++ b/src/lib/components/base/accordion/accordion-trigger.svelte @@ -0,0 +1,40 @@ + + + + svg]:rotate-180', + className + )} + {...restProps} + > + {@render children?.()} + + + + + + diff --git a/src/lib/components/base/accordion/index.ts b/src/lib/components/base/accordion/index.ts new file mode 100644 index 0000000..ed49213 --- /dev/null +++ b/src/lib/components/base/accordion/index.ts @@ -0,0 +1,17 @@ +import { Accordion as AccordionPrimitive } from "bits-ui"; +import Content from "./accordion-content.svelte"; +import Item from "./accordion-item.svelte"; +import Trigger from "./accordion-trigger.svelte"; +const Root = AccordionPrimitive.Root; + +export { + Root, + Content, + Item, + Trigger, + // + Root as Accordion, + Content as AccordionContent, + Item as AccordionItem, + Trigger as AccordionTrigger, +}; diff --git a/src/lib/components/charts/heatmap/Heatmap.svelte b/src/lib/components/charts/heatmap/Heatmap.svelte index e0a1e37..fa09882 100644 --- a/src/lib/components/charts/heatmap/Heatmap.svelte +++ b/src/lib/components/charts/heatmap/Heatmap.svelte @@ -14,7 +14,7 @@ } = $props(); -
+
{#each data as week}
{#each week as day} diff --git a/src/lib/docs/Logo.svelte b/src/lib/docs/Logo.svelte new file mode 100644 index 0000000..8e67e9f --- /dev/null +++ b/src/lib/docs/Logo.svelte @@ -0,0 +1,9 @@ + + +
+ ui kit + alpha +
diff --git a/src/lib/preview/AccordionPreview.svelte b/src/lib/preview/AccordionPreview.svelte new file mode 100644 index 0000000..8121d01 --- /dev/null +++ b/src/lib/preview/AccordionPreview.svelte @@ -0,0 +1,17 @@ + + +Accordion + + + + Is it accessible? + Yes. It adheres to the WAI-ARIA design pattern. + + + Is it accessible? + Yes. It adheres to the WAI-ARIA design pattern. + + diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index d0ea98a..e8a0e1b 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -23,12 +23,14 @@ import CardHeatmap from '$lib/cards/graphs/CardHeatmap.svelte'; import CardLineGraph from '$lib/cards/graphs/CardLineGraph.svelte'; import CardRingChart from '$lib/cards/graphs/CardRingChart.svelte'; - import { Button, buttonVariants } from '$lib/components/base/button'; + import Badge from '$lib/components/base/badge/Badge.svelte'; + import { buttonVariants } from '$lib/components/base/button'; import Navbar from '$lib/components/base/navbar/Navbar.svelte'; import * as Popover from '$lib/components/base/popover'; import { ThemeToggle } from '$lib/components/base/theme-toggle'; import { Github } from '$lib/components/extra/social-icons'; + import Logo from '$lib/docs/Logo.svelte'; import SelectTheme from '$lib/preview/SelectTheme.svelte'; import { cn } from '$lib/utils'; @@ -184,21 +186,8 @@ -
- +
+
diff --git a/src/routes/components/+layout.svelte b/src/routes/components/+layout.svelte index 0684573..910565c 100644 --- a/src/routes/components/+layout.svelte +++ b/src/routes/components/+layout.svelte @@ -13,6 +13,7 @@ import SelectTheme from '$lib/preview/SelectTheme.svelte'; import { cn } from '$lib/utils'; import Github from '$lib/components/extra/social-icons/Github.svelte'; + import Logo from '$lib/docs/Logo.svelte'; const components = [ { label: 'Alerts', href: 'alert' }, @@ -53,7 +54,8 @@ { label: 'Post', href: 'post' }, { label: 'Voxel Art', href: 'voxel-art' }, { label: 'Following Pointer', href: 'following-pointer' }, - { label: 'Audio Visualizer', href: 'audio-visualizer' } + { label: 'Audio Visualizer', href: 'audio-visualizer' }, + { label: 'Accordion', href: 'accordion' } ]; // sort components by label @@ -63,7 +65,7 @@ -
+
+ +
diff --git a/src/routes/components/accordion/+page.svelte b/src/routes/components/accordion/+page.svelte new file mode 100644 index 0000000..3d13845 --- /dev/null +++ b/src/routes/components/accordion/+page.svelte @@ -0,0 +1,6 @@ + + + \ No newline at end of file diff --git a/svelte.config.js b/svelte.config.js index 7d8121f..9b633df 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -1,3 +1,4 @@ +import { mdsvex } from 'mdsvex'; import adapter from '@sveltejs/adapter-static'; import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; @@ -5,7 +6,7 @@ import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; const config = { // Consult https://svelte.dev/docs/kit/integrations // for more information about preprocessors - preprocess: vitePreprocess(), + preprocess: [vitePreprocess(), mdsvex({ extensions: ['.svx', '.md'] })], kit: { // adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list. @@ -15,7 +16,9 @@ const config = { paths: { base: '/ui-kit' } - } + }, + + extensions: ['.svelte', '.svx', '.md'] }; export default config;