Skip to content

Commit

Permalink
initial release (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
huntabyte authored Dec 2, 2024
1 parent fa36b15 commit 113b374
Show file tree
Hide file tree
Showing 28 changed files with 881 additions and 48 deletions.
5 changes: 5 additions & 0 deletions .changeset/calm-teachers-dream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@svecodocs/kit": patch
---

initial release
2 changes: 1 addition & 1 deletion .github/workflows/build-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: preview-build
path: sites/docs/.svelte-kit/cloudflare
path: docs/.svelte-kit/cloudflare
6 changes: 3 additions & 3 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ on:
branches:
- main
paths:
- sites/docs/**
- packages/bits-ui/**
- docs/**
- packages/kit/**

jobs:
deploy-production:
runs-on: ubuntu-latest
runs-on: macos-latest
permissions:
contents: read
deployments: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/preview-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
preview-release:
if: github.repository == 'huntabyte/bits-ui' && contains(github.event.pull_request.labels.*.name, 'publish:preview')
if: github.repository == 'svecosystem/svecodocs' && contains(github.event.pull_request.labels.*.name, 'publish:preview')
timeout-minutes: 5
runs-on: macos-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## SvecoDocs

SvecoDocs is a documentation kit for the various [Svecosystem](https://github.com/svecosystem) projects. It's built and maintained for our specific needs, and is not intended to be a general purpose documentation tool. We won't be accepting feature requests for it, but we'll be accepting bug reports and PRs.
SvecoDocs is a documentation kit for the various [Svecosystem](https://github.com/svecosystem) projects. It's built and maintained for our specific needs, and is not intended to be a general purpose documentation tool. We won't be accepting feature requests for it, but we'll be accepting bug reports and PRs.
4 changes: 2 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
"build": "velite && node ./scripts/update-velite-output.js && pnpm build:search && vite build",
"build:search": "node ./scripts/build-search-data.js",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check": "velite && svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "pnpm build:content && svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
},
"devDependencies": {
"@svecodocs/kit": "workspace:*",
"@sveltejs/adapter-auto": "^3.0.0",
"@sveltejs/adapter-cloudflare": "^4.8.0",
"@sveltejs/kit": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^4.0.0",
"@tailwindcss/vite": "4.0.0-beta.4",
Expand Down
5 changes: 5 additions & 0 deletions docs/src/routes/(landing)/+page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { redirect } from "@sveltejs/kit";

export function load() {
redirect(302, "/docs");
}
87 changes: 86 additions & 1 deletion docs/src/routes/api/search.json/search.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions docs/svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte";
import { mdsx } from "mdsx";
import mdsxConfig from "./mdsx.config.js";
import adapter from "@sveltejs/adapter-cloudflare";

/** @type {import('@sveltejs/kit').Config} */
const config = {
Expand All @@ -9,6 +10,7 @@ const config = {
alias: {
"$content/*": ".velite/*",
},
adapter: adapter(),
},
extensions: [".svelte", ".md"],
};
Expand Down
2 changes: 1 addition & 1 deletion packages/kit/src/lib/components/layout/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { default as DocsLayout } from "./docs-layout.svelte";
export { default as DocPage } from "./doc-page.svelte";
export { default as DocPage } from "./doc-page.svelte";
2 changes: 1 addition & 1 deletion packages/kit/src/lib/components/markdown/h4.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
let { class: className, children, ...restProps }: HTMLAttributes<HTMLHeadingElement> = $props();
</script>

<h4 class={cn("mt-8 -mb-2 scroll-m-20 text-lg font-bold tracking-tight", className)} {...restProps}>
<h4 class={cn("-mb-2 mt-8 scroll-m-20 text-lg font-bold tracking-tight", className)} {...restProps}>
{@render children?.()}
</h4>
2 changes: 1 addition & 1 deletion packages/kit/src/lib/components/tabs/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { default as Tabs } from "./tabs.svelte";
export { default as TabItem } from "./tab-item.svelte";
export { default as TabItem } from "./tab-item.svelte";
5 changes: 4 additions & 1 deletion packages/kit/src/lib/components/toc/toc-tree.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@

{#if tree?.items?.length && level < 3}
<ul
class={cn("m-0 list-none", { "pl-4": level !== 1, "border-border/50 border-l": level === 1 })}
class={cn("m-0 list-none", {
"pl-4": level !== 1,
"border-border/50 border-l": level === 1,
})}
>
{#each tree.items as item, index (index)}
{@const active = tocState.isActive(item)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<h5
bind:this={ref}
class={cn("mb-1 ml-8 pt-0.5 leading-none font-medium -tracking-[0.01em]", className)}
class={cn("mb-1 ml-8 pt-0.5 font-medium leading-none -tracking-[0.01em]", className)}
{...restProps}
>
{@render children?.()}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script lang="ts">
import { DropdownMenu as DropdownMenuPrimitive, type WithoutChildrenOrChild } from 'bits-ui';
import Check from 'phosphor-svelte/lib/Check';
import Minus from 'phosphor-svelte/lib/Minus';
import { cn } from '$lib/utils.js';
import type { Snippet } from 'svelte';
import { DropdownMenu as DropdownMenuPrimitive, type WithoutChildrenOrChild } from "bits-ui";
import Check from "phosphor-svelte/lib/Check";
import Minus from "phosphor-svelte/lib/Minus";
import { cn } from "$lib/utils.js";
import type { Snippet } from "svelte";
let {
ref = $bindable(null),
Expand All @@ -22,7 +22,7 @@
bind:checked
bind:indeterminate
class={cn(
'data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
"data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
className
)}
{...restProps}
Expand All @@ -32,7 +32,7 @@
{#if indeterminate}
<Minus class="size-4" />
{:else}
<Check class={cn('size-4', !checked && 'text-transparent')} />
<Check class={cn("size-4", !checked && "text-transparent")} />
{/if}
</span>
{@render childrenProp?.()}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { DropdownMenu as DropdownMenuPrimitive, type WithoutChild } from 'bits-ui';
import Circle from 'phosphor-svelte/lib/Circle';
import { cn } from '$lib/utils.js';
import { DropdownMenu as DropdownMenuPrimitive, type WithoutChild } from "bits-ui";
import Circle from "phosphor-svelte/lib/Circle";
import { cn } from "$lib/utils.js";
let {
ref = $bindable(null),
Expand All @@ -14,7 +14,7 @@
<DropdownMenuPrimitive.RadioItem
bind:ref
class={cn(
'data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
"data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
className
)}
{...restProps}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
import CaretRight from 'phosphor-svelte/lib/CaretRight';
import { cn } from '$lib/utils.js';
import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui";
import CaretRight from "phosphor-svelte/lib/CaretRight";
import { cn } from "$lib/utils.js";
let {
ref = $bindable(null),
Expand All @@ -17,8 +17,8 @@
<DropdownMenuPrimitive.SubTrigger
bind:ref
class={cn(
'data-[highlighted]:bg-accent data-[state=open]:bg-accent flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',
inset && 'pl-8',
"data-[highlighted]:bg-accent data-[state=open]:bg-accent flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
inset && "pl-8",
className
)}
{...restProps}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
bind:ref
{orientation}
class={cn(
"flex touch-none transition-colors select-none",
"flex touch-none select-none transition-colors",
orientation === "vertical" && "h-full w-[11px] border-l border-l-transparent p-px",
orientation === "horizontal" && "h-[11px] w-full border-t border-t-transparent p-px",
"data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out-0 data-[state=visible]:fade-in-0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
bind:this={ref}
data-sidebar="menu-badge"
class={cn(
"text-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none",
"text-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums",
"peer-hover/menu-button:text-muted-foreground peer-data-[active=true]/menu-button:text-muted-foreground",
"peer-data-[size=sm]/menu-button:top-1",
"peer-data-[size=default]/menu-button:top-1.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<Skeleton class="size-4 rounded-md" data-sidebar="menu-skeleton-icon" />
{/if}
<Skeleton
class="h-4 max-w-(--skeleton-width) flex-1"
class="max-w-(--skeleton-width) h-4 flex-1"
data-sidebar="menu-skeleton-text"
style="--skeleton-width: {width};"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
const mergedProps = $derived({
class: cn(
"text-foreground ring-sidebar-ring hover:bg-primary-hover hover:text-foreground active:bg-primary-active active:text-foreground [&>svg]:text-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-none focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 select-none",
"text-foreground ring-sidebar-ring hover:bg-primary-hover hover:text-foreground active:bg-primary-active active:text-foreground [&>svg]:text-foreground flex h-7 min-w-0 -translate-x-px select-none items-center gap-2 overflow-hidden rounded-md px-2 outline-none focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
"data-[active=true]:bg-primary-hover data-[active=true]:text-foreground",
size === "sm" && "text-xs",
size === "md" && "text-sm",
Expand Down
6 changes: 3 additions & 3 deletions packages/kit/src/lib/components/ui/sidebar/sidebar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
{#if collapsible === "none"}
<div
class={cn(
"bg-background-secondary text-foreground flex h-full w-(--sidebar-width) flex-col",
"bg-background-secondary text-foreground w-(--sidebar-width) flex h-full flex-col",
className
)}
bind:this={ref}
Expand Down Expand Up @@ -65,7 +65,7 @@
<!-- This is what handles the sidebar gap on desktop -->
<div
class={cn(
"relative h-svh w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear",
"w-(--sidebar-width) relative h-svh bg-transparent transition-[width] duration-200 ease-linear",
"group-data-[collapsible=offcanvas]:w-0",
"group-data-[side=right]:rotate-180",
variant === "floating" || variant === "inset"
Expand All @@ -75,7 +75,7 @@
></div>
<div
class={cn(
"fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",
"w-(--sidebar-width) fixed inset-y-0 z-10 hidden h-svh transition-[left,right,width] duration-200 ease-linear md:flex",
side === "left"
? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]"
: "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
Expand Down
4 changes: 2 additions & 2 deletions packages/kit/src/lib/components/ui/slider/slider.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<SliderPrimitive.Root
bind:ref
bind:value
class={cn("relative flex w-full touch-none items-center select-none", className)}
class={cn("relative flex w-full touch-none select-none items-center", className)}
{...restProps}
>
{#snippet children({ thumbs })}
Expand All @@ -23,7 +23,7 @@
{#each thumbs as thumb}
<SliderPrimitive.Thumb
index={thumb}
class="bg-brand-hover ring-offset-background focus-visible:ring-muted-foreground block size-6 rounded-full shadow-sm transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50"
class="bg-brand-hover ring-offset-background focus-visible:ring-muted-foreground block size-6 rounded-full shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"
/>
{/each}
{/snippet}
Expand Down
4 changes: 2 additions & 2 deletions packages/kit/src/lib/components/ui/switch/switch.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
bind:ref
bind:checked
class={cn(
"data-[state=checked]:bg-foreground data-[state=unchecked]:bg-muted inset-shadow-foreground/5 data-[state=checked]:inset-shadow-muted/10 inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full inset-shadow-2xs transition-colors disabled:pointer-events-none disabled:opacity-50 data-[state=checked]:brightness-[110%]",
"data-[state=checked]:bg-foreground data-[state=unchecked]:bg-muted inset-shadow-foreground/5 data-[state=checked]:inset-shadow-muted/10 inset-shadow-2xs inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full transition-colors disabled:pointer-events-none disabled:opacity-50 data-[state=checked]:brightness-[110%]",
className
)}
{...restProps}
>
<SwitchPrimitive.Thumb
class={cn(
"bg-background border-background inset-shadow-muted/20 inset-ring-muted/5 pointer-events-none block size-5 rounded-full border inset-ring inset-shadow-sm ring-0 shadow-lg transition-transform data-[state=checked]:translate-x-5.5 data-[state=unchecked]:translate-x-0.5"
"bg-background border-background inset-shadow-muted/20 inset-ring-muted/5 inset-ring inset-shadow-sm data-[state=checked]:translate-x-5.5 pointer-events-none block size-5 rounded-full border shadow-lg ring-0 transition-transform data-[state=unchecked]:translate-x-0.5"
)}
/>
</SwitchPrimitive.Root>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<TabsPrimitive.Trigger
bind:ref
class={cn(
"data-[state=active]:bg-background data-[state=active]:text-foreground inline-flex items-center justify-center rounded-md px-3 py-1.5 text-sm font-medium whitespace-nowrap transition-all disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm",
"data-[state=active]:bg-background data-[state=active]:text-foreground inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1.5 text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm",
className
)}
{...restProps}
Expand Down
3 changes: 2 additions & 1 deletion packages/kit/src/lib/hooks/use-toc.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ function useIsAtBottom() {
const buffer = 20;
untrack(() => {
isAtBottom =
window.innerHeight + window.scrollY >= document.documentElement.scrollHeight - buffer;
window.innerHeight + window.scrollY >=
document.documentElement.scrollHeight - buffer;
});
}

Expand Down
Loading

0 comments on commit 113b374

Please sign in to comment.