From 75c1309516895e16815ec8d9c63302e854a27c97 Mon Sep 17 00:00:00 2001 From: Hunter Johnston Date: Thu, 9 Nov 2023 21:13:35 -0500 Subject: [PATCH 001/217] init calendar work; --- package.json | 1 + pnpm-lock.yaml | 16 +++- src/content/api-reference/index.ts | 4 +- .../bits/calendar/components/Calendar.svelte | 93 +++++++++++++++++++ .../components/CalendarHeading.svelte | 28 ++++++ .../components/CalendarNextButton.svelte | 24 +++++ .../components/CalendarPrevButton.svelte | 24 +++++ src/lib/bits/calendar/ctx.ts | 27 ++++++ src/lib/bits/calendar/index.ts | 0 src/lib/bits/calendar/types.ts | 42 +++++++++ 10 files changed, 257 insertions(+), 2 deletions(-) create mode 100644 src/lib/bits/calendar/components/Calendar.svelte create mode 100644 src/lib/bits/calendar/components/CalendarHeading.svelte create mode 100644 src/lib/bits/calendar/components/CalendarNextButton.svelte create mode 100644 src/lib/bits/calendar/components/CalendarPrevButton.svelte create mode 100644 src/lib/bits/calendar/ctx.ts create mode 100644 src/lib/bits/calendar/index.ts create mode 100644 src/lib/bits/calendar/types.ts diff --git a/package.json b/package.json index e0f862669..e5392aa8a 100644 --- a/package.json +++ b/package.json @@ -92,6 +92,7 @@ "types": "./dist/index.d.ts", "type": "module", "dependencies": { + "@internationalized/date": "^3.5.0", "@melt-ui/svelte": "0.60.1", "nanoid": "^5.0.3" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ecd0039d1..372d2221c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,6 +5,9 @@ settings: excludeLinksFromLockfile: false dependencies: + '@internationalized/date': + specifier: ^3.5.0 + version: 3.5.0 '@melt-ui/svelte': specifier: 0.60.1 version: 0.60.1(svelte@4.2.2) @@ -923,6 +926,12 @@ packages: vfile-message: 2.0.4 dev: true + /@internationalized/date@3.5.0: + resolution: {integrity: sha512-nw0Q+oRkizBWMioseI8+2TeUPEyopJVz5YxoYVzR0W1v+2YytiYah7s/ot35F149q/xAg4F1gT/6eTd+tsUpFQ==} + dependencies: + '@swc/helpers': 0.5.3 + dev: false + /@jest/expect-utils@29.7.0: resolution: {integrity: sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -1497,6 +1506,12 @@ packages: - encoding dev: true + /@swc/helpers@0.5.3: + resolution: {integrity: sha512-FaruWX6KdudYloq1AHD/4nU+UsMTdNE8CKyrseXWEcgjDAbvkwJg2QGPAnfIJLIWsjZOSPLOAykK6fuYp4vp4A==} + dependencies: + tslib: 2.6.2 + dev: false + /@tailwindcss/typography@0.5.10(tailwindcss@3.3.5): resolution: {integrity: sha512-Pe8BuPJQJd3FfRnm6H0ulKIGoMEQS+Vq01R6M5aCrFB/ccR/shT+0kXLjouGC1gFLm9hopTFN+DMP0pfwRWzPw==} peerDependencies: @@ -7058,7 +7073,6 @@ packages: /tslib@2.6.2: resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - dev: true /tty-table@4.2.1: resolution: {integrity: sha512-xz0uKo+KakCQ+Dxj1D/tKn2FSyreSYWzdkL/BYhgN6oMW808g8QRMuh1atAV9fjTPbWBjfbkKQpI/5rEcnAc7g==} diff --git a/src/content/api-reference/index.ts b/src/content/api-reference/index.ts index 0f9adb7e6..9e093c5a8 100644 --- a/src/content/api-reference/index.ts +++ b/src/content/api-reference/index.ts @@ -24,6 +24,7 @@ export const bits = [ "aspect-ratio", "avatar", "button", + "calendar", "checkbox", "collapsible", "context-menu", @@ -56,13 +57,14 @@ export type Bit = (typeof bits)[number]; export const apiSchemas: Record = { accordion, "alert-dialog": alertDialog, - dialog, "aspect-ratio": aspectRatio, avatar, button, + calendar: [], checkbox, collapsible, "context-menu": contextMenu, + dialog, "dropdown-menu": dropdownMenu, label, "link-preview": linkPreview, diff --git a/src/lib/bits/calendar/components/Calendar.svelte b/src/lib/bits/calendar/components/Calendar.svelte new file mode 100644 index 000000000..39119b93e --- /dev/null +++ b/src/lib/bits/calendar/components/Calendar.svelte @@ -0,0 +1,93 @@ + + +{#if asChild} + +{:else} +
+ +
+{/if} diff --git a/src/lib/bits/calendar/components/CalendarHeading.svelte b/src/lib/bits/calendar/components/CalendarHeading.svelte new file mode 100644 index 000000000..a8eec7138 --- /dev/null +++ b/src/lib/bits/calendar/components/CalendarHeading.svelte @@ -0,0 +1,28 @@ + + +{#if asChild} + +{:else} +
+ + {$headingValue} + +
+{/if} +``` diff --git a/src/lib/bits/calendar/components/CalendarNextButton.svelte b/src/lib/bits/calendar/components/CalendarNextButton.svelte new file mode 100644 index 000000000..b5285d949 --- /dev/null +++ b/src/lib/bits/calendar/components/CalendarNextButton.svelte @@ -0,0 +1,24 @@ + + +{#if asChild} + +{:else} + +{/if} diff --git a/src/lib/bits/calendar/components/CalendarPrevButton.svelte b/src/lib/bits/calendar/components/CalendarPrevButton.svelte new file mode 100644 index 000000000..b8abb847d --- /dev/null +++ b/src/lib/bits/calendar/components/CalendarPrevButton.svelte @@ -0,0 +1,24 @@ + + +{#if asChild} + +{:else} + +{/if} diff --git a/src/lib/bits/calendar/ctx.ts b/src/lib/bits/calendar/ctx.ts new file mode 100644 index 000000000..e75aef7fc --- /dev/null +++ b/src/lib/bits/calendar/ctx.ts @@ -0,0 +1,27 @@ +import { + createCalendar, + type Calendar as CalendarReturn, + type CreateCalendarProps +} from "@melt-ui/svelte"; +import { getContext, setContext } from "svelte"; +import { removeUndefined, getOptionUpdater, createBitAttrs } from "$lib/internal/index.js"; + +const NAME = "calendar"; +const PARTS = ["root", "prev-button", "next-button", "heading", "grid", "cell"]; + +export const getAttrs = createBitAttrs(NAME, PARTS); + +type GetReturn = CalendarReturn; + +export function setCtx(props: CreateCalendarProps) { + const calendar = createCalendar(removeUndefined(props)); + setContext(NAME, calendar); + return { + ...calendar, + updateOption: getOptionUpdater(calendar.options) + }; +} + +export function getCtx() { + return getContext(NAME); +} diff --git a/src/lib/bits/calendar/index.ts b/src/lib/bits/calendar/index.ts new file mode 100644 index 000000000..e69de29bb diff --git a/src/lib/bits/calendar/types.ts b/src/lib/bits/calendar/types.ts new file mode 100644 index 000000000..8c0177320 --- /dev/null +++ b/src/lib/bits/calendar/types.ts @@ -0,0 +1,42 @@ +import type { CreateCalendarProps } from "@melt-ui/svelte"; +import type { DateValue } from "@internationalized/date"; +import type { AsChild, HTMLDivAttributes, OnChangeFn } from "$lib/internal"; +import type { HTMLButtonAttributes } from "svelte/elements"; + +type Props = Expand< + Omit< + CreateCalendarProps, + | "placeholder" + | "defaultPlaceholder" + | "value" + | "defaultValue" + | "onPlaceholderChange" + | "onValueChange" + > & { + placeholder?: DateValue; + value?: DateValue; + onPlaceholderChange?: OnChangeFn; + onValueChange?: OnChangeFn; + asChild?: boolean; + } +> & + Omit; + +type ButtonProps = HTMLButtonAttributes & AsChild; + +type PrevButtonProps = ButtonProps; +type NextButtonProps = ButtonProps; + +type HeadingProps = HTMLDivAttributes & AsChild; + +export type { + Props, + PrevButtonProps, + NextButtonProps, + HeadingProps, + // + Props as CalendarProps, + PrevButtonProps as CalendarPrevButtonProps, + NextButtonProps as CalendarNextButtonProps, + HeadingProps as CalendarHeadingProps +}; From 1e744657107762008d9885ee8e0f8350b486c9f9 Mon Sep 17 00:00:00 2001 From: Hunter Johnston Date: Thu, 9 Nov 2023 21:19:33 -0500 Subject: [PATCH 002/217] more calendar stuff --- src/lib/bits/calendar/components/Calendar.svelte | 13 ++++++++++--- .../bits/calendar/components/CalendarCell.svelte | 0 .../bits/calendar/components/CalendarMonth.svelte | 0 src/lib/bits/calendar/types.ts | 12 ++++++++++-- 4 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 src/lib/bits/calendar/components/CalendarCell.svelte create mode 100644 src/lib/bits/calendar/components/CalendarMonth.svelte diff --git a/src/lib/bits/calendar/components/Calendar.svelte b/src/lib/bits/calendar/components/Calendar.svelte index 39119b93e..cb6c8a6b6 100644 --- a/src/lib/bits/calendar/components/Calendar.svelte +++ b/src/lib/bits/calendar/components/Calendar.svelte @@ -26,7 +26,7 @@ const { elements: { calendar }, - states: { value: localValue, placeholder: localPlaceholder }, + states: { value: localValue, placeholder: localPlaceholder, months, daysOfWeek }, updateOption, ids } = setCtx({ @@ -82,12 +82,19 @@ $: builder = $calendar; const attrs = getAttrs("root"); + + $: slotProps = { + builder, + attrs, + months: $months, + daysOfWeek: $daysOfWeek + }; {#if asChild} - + {:else}
- +
{/if} diff --git a/src/lib/bits/calendar/components/CalendarCell.svelte b/src/lib/bits/calendar/components/CalendarCell.svelte new file mode 100644 index 000000000..e69de29bb diff --git a/src/lib/bits/calendar/components/CalendarMonth.svelte b/src/lib/bits/calendar/components/CalendarMonth.svelte new file mode 100644 index 000000000..e69de29bb diff --git a/src/lib/bits/calendar/types.ts b/src/lib/bits/calendar/types.ts index 8c0177320..f8315ed4e 100644 --- a/src/lib/bits/calendar/types.ts +++ b/src/lib/bits/calendar/types.ts @@ -1,7 +1,7 @@ import type { CreateCalendarProps } from "@melt-ui/svelte"; import type { DateValue } from "@internationalized/date"; import type { AsChild, HTMLDivAttributes, OnChangeFn } from "$lib/internal"; -import type { HTMLButtonAttributes } from "svelte/elements"; +import type { HTMLButtonAttributes, HTMLTableAttributes } from "svelte/elements"; type Props = Expand< Omit< @@ -29,14 +29,22 @@ type NextButtonProps = ButtonProps; type HeadingProps = HTMLDivAttributes & AsChild; +type MonthProps = HTMLTableAttributes & AsChild; + +type CellProps = HTMLDivAttributes & AsChild; + export type { Props, PrevButtonProps, NextButtonProps, HeadingProps, + MonthProps, + CellProps, // Props as CalendarProps, PrevButtonProps as CalendarPrevButtonProps, NextButtonProps as CalendarNextButtonProps, - HeadingProps as CalendarHeadingProps + HeadingProps as CalendarHeadingProps, + MonthProps as CalendarMonthProps, + CellProps as CalendarCellProps }; From b2b8c658094e96649bbc6a28e7e811539f98e9d4 Mon Sep 17 00:00:00 2001 From: Hunter Johnston Date: Fri, 10 Nov 2023 20:06:18 -0500 Subject: [PATCH 003/217] more calendar stuff --- .../ui/calendar/index.ts} | 0 .../bits/calendar/components/Calendar.svelte | 4 +- .../calendar/components/CalendarGrid.svelte | 29 ++++++++++ .../components/CalendarGridBody.svelte | 17 ++++++ .../components/CalendarGridBodyCell.svelte | 37 +++++++++++++ .../components/CalendarGridHead.svelte | 17 ++++++ .../components/CalendarGridHeadCell.svelte | 17 ++++++ .../components/CalendarGridRow.svelte | 19 +++++++ .../calendar/components/CalendarHeader.svelte | 16 ++++++ .../calendar/components/CalendarMonth.svelte | 0 .../components/CalendarPrevButton.svelte | 9 ++- src/lib/bits/calendar/ctx.ts | 14 ++++- src/lib/bits/calendar/index.ts | 38 +++++++++++++ src/lib/bits/calendar/types.ts | 55 ++++++++++++++++--- 14 files changed, 258 insertions(+), 14 deletions(-) rename src/{lib/bits/calendar/components/CalendarCell.svelte => components/ui/calendar/index.ts} (100%) create mode 100644 src/lib/bits/calendar/components/CalendarGrid.svelte create mode 100644 src/lib/bits/calendar/components/CalendarGridBody.svelte create mode 100644 src/lib/bits/calendar/components/CalendarGridBodyCell.svelte create mode 100644 src/lib/bits/calendar/components/CalendarGridHead.svelte create mode 100644 src/lib/bits/calendar/components/CalendarGridHeadCell.svelte create mode 100644 src/lib/bits/calendar/components/CalendarGridRow.svelte create mode 100644 src/lib/bits/calendar/components/CalendarHeader.svelte delete mode 100644 src/lib/bits/calendar/components/CalendarMonth.svelte diff --git a/src/lib/bits/calendar/components/CalendarCell.svelte b/src/components/ui/calendar/index.ts similarity index 100% rename from src/lib/bits/calendar/components/CalendarCell.svelte rename to src/components/ui/calendar/index.ts diff --git a/src/lib/bits/calendar/components/Calendar.svelte b/src/lib/bits/calendar/components/Calendar.svelte index cb6c8a6b6..507e73909 100644 --- a/src/lib/bits/calendar/components/Calendar.svelte +++ b/src/lib/bits/calendar/components/Calendar.svelte @@ -92,9 +92,9 @@ {#if asChild} - + {:else}
- +
{/if} diff --git a/src/lib/bits/calendar/components/CalendarGrid.svelte b/src/lib/bits/calendar/components/CalendarGrid.svelte new file mode 100644 index 000000000..3c7b3f15f --- /dev/null +++ b/src/lib/bits/calendar/components/CalendarGrid.svelte @@ -0,0 +1,29 @@ + + +{#if asChild} + +{:else} + + +
+{/if} diff --git a/src/lib/bits/calendar/components/CalendarGridBody.svelte b/src/lib/bits/calendar/components/CalendarGridBody.svelte new file mode 100644 index 000000000..3dbc84e88 --- /dev/null +++ b/src/lib/bits/calendar/components/CalendarGridBody.svelte @@ -0,0 +1,17 @@ + + +{#if asChild} + +{:else} + + + +{/if} diff --git a/src/lib/bits/calendar/components/CalendarGridBodyCell.svelte b/src/lib/bits/calendar/components/CalendarGridBodyCell.svelte new file mode 100644 index 000000000..1cf53a06a --- /dev/null +++ b/src/lib/bits/calendar/components/CalendarGridBodyCell.svelte @@ -0,0 +1,37 @@ + + +{#if asChild} + +{:else} + +
+ +
+ +{/if} diff --git a/src/lib/bits/calendar/components/CalendarGridHead.svelte b/src/lib/bits/calendar/components/CalendarGridHead.svelte new file mode 100644 index 000000000..a290dbd42 --- /dev/null +++ b/src/lib/bits/calendar/components/CalendarGridHead.svelte @@ -0,0 +1,17 @@ + + +{#if asChild} + +{:else} + + + +{/if} diff --git a/src/lib/bits/calendar/components/CalendarGridHeadCell.svelte b/src/lib/bits/calendar/components/CalendarGridHeadCell.svelte new file mode 100644 index 000000000..89cd1c928 --- /dev/null +++ b/src/lib/bits/calendar/components/CalendarGridHeadCell.svelte @@ -0,0 +1,17 @@ + + +{#if asChild} + +{:else} + + + +{/if} diff --git a/src/lib/bits/calendar/components/CalendarGridRow.svelte b/src/lib/bits/calendar/components/CalendarGridRow.svelte new file mode 100644 index 000000000..760537779 --- /dev/null +++ b/src/lib/bits/calendar/components/CalendarGridRow.svelte @@ -0,0 +1,19 @@ + + +{#if asChild} + +{:else} + + + +{/if} +``` diff --git a/src/lib/bits/calendar/components/CalendarHeader.svelte b/src/lib/bits/calendar/components/CalendarHeader.svelte new file mode 100644 index 000000000..ec1df8ace --- /dev/null +++ b/src/lib/bits/calendar/components/CalendarHeader.svelte @@ -0,0 +1,16 @@ + + +{#if asChild} + +{:else} +
+ +
+{/if} diff --git a/src/lib/bits/calendar/components/CalendarMonth.svelte b/src/lib/bits/calendar/components/CalendarMonth.svelte deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/lib/bits/calendar/components/CalendarPrevButton.svelte b/src/lib/bits/calendar/components/CalendarPrevButton.svelte index b8abb847d..3775bc3c0 100644 --- a/src/lib/bits/calendar/components/CalendarPrevButton.svelte +++ b/src/lib/bits/calendar/components/CalendarPrevButton.svelte @@ -13,12 +13,17 @@ $: builder = $prevButton; const attrs = getAttrs("prev-button"); + + $: slotProps = { + builder, + attrs + }; {#if asChild} - + {:else} {/if} diff --git a/src/lib/bits/calendar/ctx.ts b/src/lib/bits/calendar/ctx.ts index e75aef7fc..9f23ec9f3 100644 --- a/src/lib/bits/calendar/ctx.ts +++ b/src/lib/bits/calendar/ctx.ts @@ -7,7 +7,19 @@ import { getContext, setContext } from "svelte"; import { removeUndefined, getOptionUpdater, createBitAttrs } from "$lib/internal/index.js"; const NAME = "calendar"; -const PARTS = ["root", "prev-button", "next-button", "heading", "grid", "cell"]; +const PARTS = [ + "root", + "prev-button", + "next-button", + "heading", + "grid", + "header", + "grid-head", + "grid-head-cell", + "grid-body", + "grid-body-cell", + "grid-row" +] as const; export const getAttrs = createBitAttrs(NAME, PARTS); diff --git a/src/lib/bits/calendar/index.ts b/src/lib/bits/calendar/index.ts index e69de29bb..de98ea725 100644 --- a/src/lib/bits/calendar/index.ts +++ b/src/lib/bits/calendar/index.ts @@ -0,0 +1,38 @@ +import Root from "./components/Calendar.svelte"; +import Grid from "./components/CalendarGrid.svelte"; +import GridBody from "./components/CalendarGridBody.svelte"; +import GridBodyCell from "./components/CalendarGridBodyCell.svelte"; +import GridHead from "./components/CalendarGridHead.svelte"; +import GridHeadCell from "./components/CalendarGridHeadCell.svelte"; +import GridRow from "./components/CalendarGridRow.svelte"; +import Header from "./components/CalendarHeader.svelte"; +import Heading from "./components/CalendarHeading.svelte"; +import NextButton from "./components/CalendarNextButton.svelte"; +import PrevButton from "./components/CalendarPrevButton.svelte"; + +export { + Root, + Grid, + GridBody, + GridBodyCell, + GridHead, + GridHeadCell, + GridRow, + Header, + Heading, + NextButton, + PrevButton, + // + Root as Calendar, + Grid as CalendarGrid, + GridBody as CalendarGridBody, + GridBodyCell as CalendarGridBodyCell, + GridHead as CalendarGridHead, + GridHeadCell as CalendarGridHeadCell, + GridRow as CalendarGridRow, + Header as CalendarHeader, + Heading as CalendarHeading, + NextButton as CalendarNextButton, + PrevButton as CalendarPrevButton +}; +export * from "./types.js"; diff --git a/src/lib/bits/calendar/types.ts b/src/lib/bits/calendar/types.ts index f8315ed4e..e898f19e3 100644 --- a/src/lib/bits/calendar/types.ts +++ b/src/lib/bits/calendar/types.ts @@ -1,7 +1,12 @@ import type { CreateCalendarProps } from "@melt-ui/svelte"; import type { DateValue } from "@internationalized/date"; import type { AsChild, HTMLDivAttributes, OnChangeFn } from "$lib/internal"; -import type { HTMLButtonAttributes, HTMLTableAttributes } from "svelte/elements"; +import type { + HTMLAttributes, + HTMLButtonAttributes, + HTMLTableAttributes, + HTMLThAttributes +} from "svelte/elements"; type Props = Expand< Omit< @@ -22,29 +27,61 @@ type Props = Expand< > & Omit; -type ButtonProps = HTMLButtonAttributes & AsChild; +type ButtonProps = Expand & HTMLButtonAttributes; type PrevButtonProps = ButtonProps; type NextButtonProps = ButtonProps; -type HeadingProps = HTMLDivAttributes & AsChild; +type HeadingProps = Expand & HTMLDivAttributes; -type MonthProps = HTMLTableAttributes & AsChild; +type HeaderProps = Expand & HTMLDivAttributes; -type CellProps = HTMLDivAttributes & AsChild; +type GridProps = Expand & HTMLTableAttributes; +type GridHeadProps = Expand & HTMLAttributes; + +type GridHeadCellProps = Expand & HTMLThAttributes; + +type GridBodyProps = Expand & HTMLAttributes; + +type GridRowProps = Expand & HTMLAttributes; + +type GridBodyCellProps = Expand< + { + /** + * The date value of the cell. + */ + date: DateValue; + + /** + * The month value that the cell belongs to. + */ + month: DateValue; + } & AsChild +> & + HTMLDivAttributes; export type { Props, PrevButtonProps, NextButtonProps, HeadingProps, - MonthProps, - CellProps, + GridProps, + GridBodyCellProps, + GridRowProps, + GridBodyProps, + GridHeadCellProps, + GridHeadProps, + HeaderProps, // Props as CalendarProps, PrevButtonProps as CalendarPrevButtonProps, NextButtonProps as CalendarNextButtonProps, HeadingProps as CalendarHeadingProps, - MonthProps as CalendarMonthProps, - CellProps as CalendarCellProps + HeaderProps as CalendarHeaderProps, + GridProps as CalendarGridProps, + GridHeadProps as CalendarGridHeadProps, + GridHeadCellProps as CalendarGridHeadCellProps, + GridBodyProps as CalendarGridBodyProps, + GridBodyCellProps as CalendarGridBodyCellProps, + GridRowProps as CalendarGridRowProps }; From 4146517ba9641d1e173c94974b8bbd85af6c74cd Mon Sep 17 00:00:00 2001 From: Hunter Johnston Date: Fri, 10 Nov 2023 21:01:38 -0500 Subject: [PATCH 004/217] init calendar preview --- content/components/calendar.md | 14 +++++ src/components/component-preview.svelte | 2 +- src/components/demos/calendar-demo.svelte | 63 +++++++++++++++++++ src/components/demos/index.ts | 1 + src/config/navigation.ts | 5 ++ .../calendar/components/CalendarDate.svelte | 37 +++++++++++ .../components/CalendarGridBodyCell.svelte | 26 +++----- .../components/CalendarGridRow.svelte | 1 - .../components/CalendarHeading.svelte | 1 - src/lib/bits/calendar/ctx.ts | 1 + src/lib/bits/calendar/index.ts | 3 + src/lib/bits/calendar/types.ts | 14 +++-- src/lib/bits/index.ts | 1 + 13 files changed, 144 insertions(+), 25 deletions(-) create mode 100644 content/components/calendar.md create mode 100644 src/components/demos/calendar-demo.svelte create mode 100644 src/lib/bits/calendar/components/CalendarDate.svelte diff --git a/content/components/calendar.md b/content/components/calendar.md new file mode 100644 index 000000000..7105b5c0d --- /dev/null +++ b/content/components/calendar.md @@ -0,0 +1,14 @@ +--- +title: Calendar +description: A calendar component. +--- + + + + + + + + diff --git a/src/components/component-preview.svelte b/src/components/component-preview.svelte index ec1088239..0594827b4 100644 --- a/src/components/component-preview.svelte +++ b/src/components/component-preview.svelte @@ -26,7 +26,7 @@ {:else} -
+
+ import { Calendar } from "$lib"; + import { cn } from "@/utils"; + import { ChevronLeft, ChevronRight } from "lucide-svelte"; + import { buttonVariants } from "../ui/button"; + + + + + + + + + + + + +
+ {#each months as month} + + + + {#each daysOfWeek as day} + +
{day}
+
+ {/each} +
+
+ + {#each month.weeks as weekDates} + + {#each weekDates as date} + + + + {/each} + + {/each} + +
+ {/each} +
+
diff --git a/src/components/demos/index.ts b/src/components/demos/index.ts index cdb136004..0807e9db0 100644 --- a/src/components/demos/index.ts +++ b/src/components/demos/index.ts @@ -3,6 +3,7 @@ export { default as AlertDialogDemo } from "./alert-dialog-demo.svelte"; export { default as AspectRatioDemo } from "./aspect-ratio-demo.svelte"; export { default as AvatarDemo } from "./avatar-demo.svelte"; export { default as ButtonDemo } from "./button-demo.svelte"; +export { default as CalendarDemo } from "./calendar-demo.svelte"; export { default as CheckboxDemo } from "./checkbox-demo.svelte"; export { default as CollapsibleDemo } from "./collapsible-demo.svelte"; export { default as ContextMenuDemo } from "./context-menu-demo.svelte"; diff --git a/src/config/navigation.ts b/src/config/navigation.ts index 6d250c0a8..9ddebd34e 100644 --- a/src/config/navigation.ts +++ b/src/config/navigation.ts @@ -75,6 +75,11 @@ export const navigation: Navigation = { href: "/docs/components/button", items: [] }, + { + title: "Calendar", + href: "/docs/components/calendar", + items: [] + }, { title: "Checkbox", href: "/docs/components/checkbox", diff --git a/src/lib/bits/calendar/components/CalendarDate.svelte b/src/lib/bits/calendar/components/CalendarDate.svelte new file mode 100644 index 000000000..a22ef45df --- /dev/null +++ b/src/lib/bits/calendar/components/CalendarDate.svelte @@ -0,0 +1,37 @@ + + +{#if asChild} + +{:else} +
+ + {date.day} + +
+{/if} diff --git a/src/lib/bits/calendar/components/CalendarGridBodyCell.svelte b/src/lib/bits/calendar/components/CalendarGridBodyCell.svelte index 1cf53a06a..0b3ac8678 100644 --- a/src/lib/bits/calendar/components/CalendarGridBodyCell.svelte +++ b/src/lib/bits/calendar/components/CalendarGridBodyCell.svelte @@ -1,37 +1,27 @@ {#if asChild} - + {:else} - -
- -
+ + {/if} diff --git a/src/lib/bits/calendar/components/CalendarGridRow.svelte b/src/lib/bits/calendar/components/CalendarGridRow.svelte index 760537779..ff14c3d16 100644 --- a/src/lib/bits/calendar/components/CalendarGridRow.svelte +++ b/src/lib/bits/calendar/components/CalendarGridRow.svelte @@ -16,4 +16,3 @@ {/if} -``` diff --git a/src/lib/bits/calendar/components/CalendarHeading.svelte b/src/lib/bits/calendar/components/CalendarHeading.svelte index a8eec7138..c4463f49a 100644 --- a/src/lib/bits/calendar/components/CalendarHeading.svelte +++ b/src/lib/bits/calendar/components/CalendarHeading.svelte @@ -25,4 +25,3 @@
{/if} -``` diff --git a/src/lib/bits/calendar/ctx.ts b/src/lib/bits/calendar/ctx.ts index 9f23ec9f3..fbbb99d54 100644 --- a/src/lib/bits/calendar/ctx.ts +++ b/src/lib/bits/calendar/ctx.ts @@ -13,6 +13,7 @@ const PARTS = [ "next-button", "heading", "grid", + "date", "header", "grid-head", "grid-head-cell", diff --git a/src/lib/bits/calendar/index.ts b/src/lib/bits/calendar/index.ts index de98ea725..846b19506 100644 --- a/src/lib/bits/calendar/index.ts +++ b/src/lib/bits/calendar/index.ts @@ -1,4 +1,5 @@ import Root from "./components/Calendar.svelte"; +import Date from "./components/CalendarDate.svelte"; import Grid from "./components/CalendarGrid.svelte"; import GridBody from "./components/CalendarGridBody.svelte"; import GridBodyCell from "./components/CalendarGridBodyCell.svelte"; @@ -12,6 +13,7 @@ import PrevButton from "./components/CalendarPrevButton.svelte"; export { Root, + Date, Grid, GridBody, GridBodyCell, @@ -24,6 +26,7 @@ export { PrevButton, // Root as Calendar, + Date as CalendarDate, Grid as CalendarGrid, GridBody as CalendarGridBody, GridBodyCell as CalendarGridBodyCell, diff --git a/src/lib/bits/calendar/types.ts b/src/lib/bits/calendar/types.ts index e898f19e3..69f83d276 100644 --- a/src/lib/bits/calendar/types.ts +++ b/src/lib/bits/calendar/types.ts @@ -5,6 +5,7 @@ import type { HTMLAttributes, HTMLButtonAttributes, HTMLTableAttributes, + HTMLTdAttributes, HTMLThAttributes } from "svelte/elements"; @@ -46,7 +47,7 @@ type GridBodyProps = Expand & HTMLAttributes; type GridRowProps = Expand & HTMLAttributes; -type GridBodyCellProps = Expand< +type BaseDateProps = Expand< { /** * The date value of the cell. @@ -58,8 +59,11 @@ type GridBodyCellProps = Expand< */ month: DateValue; } & AsChild -> & - HTMLDivAttributes; +>; + +type GridBodyCellProps = Expand> & HTMLTdAttributes; +type DateProps = Expand & HTMLDivAttributes; + export type { Props, PrevButtonProps, @@ -72,6 +76,7 @@ export type { GridHeadCellProps, GridHeadProps, HeaderProps, + DateProps, // Props as CalendarProps, PrevButtonProps as CalendarPrevButtonProps, @@ -83,5 +88,6 @@ export type { GridHeadCellProps as CalendarGridHeadCellProps, GridBodyProps as CalendarGridBodyProps, GridBodyCellProps as CalendarGridBodyCellProps, - GridRowProps as CalendarGridRowProps + GridRowProps as CalendarGridRowProps, + DateProps as CalendarDateProps }; diff --git a/src/lib/bits/index.ts b/src/lib/bits/index.ts index cbfd60bc0..2570b9940 100644 --- a/src/lib/bits/index.ts +++ b/src/lib/bits/index.ts @@ -3,6 +3,7 @@ export * as AlertDialog from "./alert-dialog/index.js"; export * as AspectRatio from "./aspect-ratio/index.js"; export * as Avatar from "./avatar/index.js"; export * as Button from "./button/index.js"; +export * as Calendar from "./calendar/index.js"; export * as Checkbox from "./checkbox/index.js"; export * as Collapsible from "./collapsible/index.js"; export * as ContextMenu from "./context-menu/index.js"; From 38c9ea78c38f1a8e4bdf3d3bc865e5599a046733 Mon Sep 17 00:00:00 2001 From: Hunter Johnston Date: Wed, 15 Nov 2023 12:08:55 -0500 Subject: [PATCH 005/217] add vars --- package.json | 1 + pnpm-lock.yaml | 11 +++ .../light-switch/light-switch.svelte | 46 ++--------- src/routes/+layout.svelte | 7 +- src/styles/app.postcss | 82 +++++-------------- tailwind.config.ts | 50 ++++++----- 6 files changed, 64 insertions(+), 133 deletions(-) diff --git a/package.json b/package.json index b59f8078b..7de7ffefe 100644 --- a/package.json +++ b/package.json @@ -62,6 +62,7 @@ "jest-axe": "^8.0.0", "jsdom": "^22.1.0", "lucide-svelte": "^0.292.0", + "mode-watcher": "^0.1.1", "phosphor-svelte": "^1.3.0", "postcss": "^8.4.31", "postcss-load-config": "^4.0.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0583fec8d..467900e22 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -100,6 +100,9 @@ devDependencies: lucide-svelte: specifier: ^0.292.0 version: 0.292.0(svelte@4.2.3) + mode-watcher: + specifier: ^0.1.1 + version: 0.1.1(svelte@4.2.3) phosphor-svelte: specifier: ^1.3.0 version: 1.3.0(svelte@4.2.3) @@ -5406,6 +5409,14 @@ packages: ufo: 1.2.0 dev: true + /mode-watcher@0.1.1(svelte@4.2.3): + resolution: {integrity: sha512-11B0IDiJE5lbWsCGAIpBSkD5TtzCooBHvIMNWsuTeAlBHL6HWLb55aslCcx939v8qUymjFgDtpQ70CU1JU73lg==} + peerDependencies: + svelte: ^4.0.0 + dependencies: + svelte: 4.2.3 + dev: true + /mri@1.2.0: resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} engines: {node: '>=4'} diff --git a/src/components/light-switch/light-switch.svelte b/src/components/light-switch/light-switch.svelte index e16f68d5b..11fe3fe08 100644 --- a/src/components/light-switch/light-switch.svelte +++ b/src/components/light-switch/light-switch.svelte @@ -1,55 +1,19 @@ diff --git a/src/components/site-header.svelte b/src/components/site-header.svelte index b11cab323..5efbd1f2d 100644 --- a/src/components/site-header.svelte +++ b/src/components/site-header.svelte @@ -1,39 +1,26 @@
-
+
-
+
-
diff --git a/src/components/ui/button/index.ts b/src/components/ui/button/index.ts index abd062e78..5f4a2cc7f 100644 --- a/src/components/ui/button/index.ts +++ b/src/components/ui/button/index.ts @@ -2,10 +2,10 @@ import { tv, type VariantProps } from "tailwind-variants"; import Root from "./button.svelte"; export const buttonVariants = tv({ - base: "inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50", + base: "inline-flex items-center justify-center text-sm font-medium transition-colors focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50", variants: { variant: { - default: "bg-primary text-primary-foreground shadow hover:bg-primary/90", + default: "bg-muted text-foreground shadow hover:bg-muted/50", destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90", outline: "border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground", @@ -14,9 +14,9 @@ export const buttonVariants = tv({ link: "text-primary underline-offset-4 hover:underline" }, size: { - default: "h-9 px-4 py-2", + default: "h-9 rounded-md px-4 py-2", sm: "h-8 rounded-md px-3 text-xs", - lg: "h-10 rounded-md px-8", + lg: "h-input-sm rounded-input px-4 font-semibold", icon: "h-9 w-9" } }, diff --git a/tailwind.config.ts b/tailwind.config.ts index b80a6c140..6d6367397 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -28,8 +28,8 @@ export default { alt: "hsl(var(--foreground-alt) / )" }, muted: { - DEFAULT: "hsl(var(--muted))", - foreground: "hsl(var(--muted-foreground))" + DEFAULT: "hsl(var(--muted) / )", + foreground: "hsl(var(--muted-foreground) / )" }, dark: { DEFAULT: "hsl(var(--dark) / )", From 0e29a26397315b89ac239f76ef815a46b29082c5 Mon Sep 17 00:00:00 2001 From: Hunter Johnston Date: Wed, 15 Nov 2023 13:17:46 -0500 Subject: [PATCH 008/217] tabs --- src/components/component-preview.svelte | 77 +++++++++++-------- src/components/markdown/pre.svelte | 2 +- src/components/ui/button/index.ts | 4 +- src/lib/bits/tabs/components/Tabs.svelte | 9 ++- .../bits/tabs/components/TabsContent.svelte | 9 ++- src/lib/bits/tabs/components/TabsList.svelte | 8 +- .../bits/tabs/components/TabsTrigger.svelte | 8 +- src/styles/app.postcss | 13 ++-- src/styles/markdown.postcss | 2 +- tailwind.config.ts | 3 + 10 files changed, 88 insertions(+), 47 deletions(-) diff --git a/src/components/component-preview.svelte b/src/components/component-preview.svelte index ec1088239..9267b3b14 100644 --- a/src/components/component-preview.svelte +++ b/src/components/component-preview.svelte @@ -1,47 +1,64 @@ {#if dev}
-
-
- -
- {#if showCode} -
-
- -
+ + + + Preview + + <Code> + + +
+
- {:else} -
-
- -
+ + +
+
- {/if} -
+
+
{/if} diff --git a/src/components/markdown/pre.svelte b/src/components/markdown/pre.svelte index 9f52e2190..a70f87ab8 100644 --- a/src/components/markdown/pre.svelte +++ b/src/components/markdown/pre.svelte @@ -9,7 +9,7 @@
 	
diff --git a/src/components/ui/button/index.ts b/src/components/ui/button/index.ts
index 5f4a2cc7f..64acd1ca9 100644
--- a/src/components/ui/button/index.ts
+++ b/src/components/ui/button/index.ts
@@ -5,7 +5,7 @@ export const buttonVariants = tv({
 	base: "inline-flex items-center justify-center text-sm font-medium transition-colors focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50",
 	variants: {
 		variant: {
-			default: "bg-muted text-foreground shadow hover:bg-muted/50",
+			default: "bg-muted text-foreground",
 			destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
 			outline:
 				"border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground",
@@ -14,7 +14,7 @@ export const buttonVariants = tv({
 			link: "text-primary underline-offset-4 hover:underline"
 		},
 		size: {
-			default: "h-9 rounded-md px-4 py-2",
+			default: "h-8 rounded-[7px] px-[14px] py-2 font-semibold",
 			sm: "h-8 rounded-md px-3 text-xs",
 			lg: "h-input-sm rounded-input px-4 font-semibold",
 			icon: "h-9 w-9"
diff --git a/src/lib/bits/tabs/components/Tabs.svelte b/src/lib/bits/tabs/components/Tabs.svelte
index a8941ef1c..f1fce12cf 100644
--- a/src/lib/bits/tabs/components/Tabs.svelte
+++ b/src/lib/bits/tabs/components/Tabs.svelte
@@ -39,12 +39,17 @@
 
 	$: builder = $root;
 	const attrs = getAttrs("root");
+	$: slotProps = {
+		builder,
+		attrs,
+		value: $localValue
+	};
 
 
 {#if asChild}
-	
+	
 {:else}
 	
- +
{/if} diff --git a/src/lib/bits/tabs/components/TabsContent.svelte b/src/lib/bits/tabs/components/TabsContent.svelte index 40dcd1d0c..521b6d819 100644 --- a/src/lib/bits/tabs/components/TabsContent.svelte +++ b/src/lib/bits/tabs/components/TabsContent.svelte @@ -12,12 +12,17 @@ $: builder = $content(value); const attrs = getAttrs("content"); + + $: slotProps = { + builder, + attrs + }; {#if asChild} - + {:else}
- +
{/if} diff --git a/src/lib/bits/tabs/components/TabsList.svelte b/src/lib/bits/tabs/components/TabsList.svelte index 2147c01e4..f973aeb41 100644 --- a/src/lib/bits/tabs/components/TabsList.svelte +++ b/src/lib/bits/tabs/components/TabsList.svelte @@ -11,12 +11,16 @@ $: builder = $list; const attrs = getAttrs("list"); + $: slotProps = { + builder, + attrs + }; {#if asChild} - + {:else}
- +
{/if} diff --git a/src/lib/bits/tabs/components/TabsTrigger.svelte b/src/lib/bits/tabs/components/TabsTrigger.svelte index 0084b944d..62efe6b62 100644 --- a/src/lib/bits/tabs/components/TabsTrigger.svelte +++ b/src/lib/bits/tabs/components/TabsTrigger.svelte @@ -17,10 +17,14 @@ $: builder = $trigger({ value, disabled }); const attrs = getAttrs("trigger"); + $: slotProps = { + builder, + attrs + }; {#if asChild} - + {:else} {/if} diff --git a/src/styles/app.postcss b/src/styles/app.postcss index ce1dad02a..69b9c75c9 100644 --- a/src/styles/app.postcss +++ b/src/styles/app.postcss @@ -16,6 +16,9 @@ --dark: 240 6% 10%; --dark-10: 240 6% 10% / 0.1; --accent: 204 94% 94%; + + /* Shadows */ + --shadow-mini: 0px 1px 0px 1px rgba(0, 0, 0, 0.04); } .dark { @@ -55,7 +58,7 @@ /* === Scrollbars === */ - ::-webkit-scrollbar { + /* ::-webkit-scrollbar { @apply w-2; @apply h-2; } @@ -64,13 +67,13 @@ @apply !bg-muted; } ::-webkit-scrollbar-thumb { - @apply rounded-sm !bg-muted-foreground/30; - } + @apply rounded-sm !bg-muted-foreground; + } */ /* Firefox */ /* https://developer.mozilla.org/en-US/docs/Web/CSS/scrollbar-color#browser_compatibility */ - html { + /* html { scrollbar-color: hsl(215.4 16.3% 46.9% / 0.3); } @@ -85,7 +88,7 @@ .hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; - } + } */ .antialised { -webkit-font-smoothing: antialiased; diff --git a/src/styles/markdown.postcss b/src/styles/markdown.postcss index 74258cce2..95ed0a6c1 100644 --- a/src/styles/markdown.postcss +++ b/src/styles/markdown.postcss @@ -41,7 +41,7 @@ @apply relative; & pre { - @apply mb-4 mt-6 overflow-x-auto rounded-lg border border-border py-4 px-2.5 text-sm font-semibold; + @apply mb-4 mt-6 overflow-x-auto rounded-card w-full py-4 px-2.5 text-sm font-semibold; } & code { diff --git a/tailwind.config.ts b/tailwind.config.ts index 6d6367397..a7c1569bb 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -53,6 +53,9 @@ export default { height: { input: "3rem", "input-sm": "2.5rem" + }, + boxShadow: { + mini: "var(--shadow-mini)" } } }, From 01ce79365dd8423c247d3f53bb136628ad7c2557 Mon Sep 17 00:00:00 2001 From: Hunter Johnston Date: Wed, 15 Nov 2023 13:57:09 -0500 Subject: [PATCH 009/217] more styles --- .../api-tables/data-attrs-table.svelte | 10 +- src/components/api-tables/props-table.svelte | 26 ++--- src/components/component-preview.svelte | 107 +++++++++--------- src/components/markdown/code.svelte | 4 +- src/components/page-header/page-header.svelte | 2 +- src/components/ui/button/index.ts | 2 +- src/components/ui/table/table-cell.svelte | 2 +- src/components/ui/table/table-head.svelte | 2 +- src/components/ui/table/table-header.svelte | 2 +- src/components/ui/table/table.svelte | 2 +- src/styles/app.postcss | 2 + tailwind.config.ts | 5 +- 12 files changed, 82 insertions(+), 84 deletions(-) diff --git a/src/components/api-tables/data-attrs-table.svelte b/src/components/api-tables/data-attrs-table.svelte index 20bbb559b..2987158df 100644 --- a/src/components/api-tables/data-attrs-table.svelte +++ b/src/components/api-tables/data-attrs-table.svelte @@ -19,17 +19,19 @@ {#each dataAttrs as attr} - data-{attr.name} + data-{attr.name} - {#if attr.value} - {attr.value} - {/if} {#if attr.description}

{@html parseMarkdown(attr.description)}

{/if} + {#if attr.value} + Value: {attr.value} + {:else} + Value: '' + {/if}
{/each} diff --git a/src/components/api-tables/props-table.svelte b/src/components/api-tables/props-table.svelte index 2d41b574a..ccee1c84d 100644 --- a/src/components/api-tables/props-table.svelte +++ b/src/components/api-tables/props-table.svelte @@ -10,29 +10,27 @@ - Prop - Default - Type/Description + Property + Type + Description {#each props as prop} - - {prop.name} + + {prop.name} - - {#if prop.default} - {prop.default} - {:else} -

-

- {/if} + + {prop.type} - - {prop.type} -

+ +

{@html parseMarkdown(prop.description)}

+
+ Default: {prop.default ?? "undefined"} +
{/each} diff --git a/src/components/component-preview.svelte b/src/components/component-preview.svelte index 9267b3b14..37307fa5f 100644 --- a/src/components/component-preview.svelte +++ b/src/components/component-preview.svelte @@ -1,6 +1,5 @@ -{#if dev} -
- - - - Preview - - <Code> - - -
- -
-
- -
- -
-
-
-
-{/if} +
+ + + + Preview + + <Code> + + +
+ +
+
+ +
+ +
+
+
+
diff --git a/src/components/markdown/code.svelte b/src/components/markdown/code.svelte index 862473a0f..f2dfb74e3 100644 --- a/src/components/markdown/code.svelte +++ b/src/components/markdown/code.svelte @@ -2,13 +2,11 @@ import { cn } from "@/utils"; let className: string | undefined | null = undefined; export { className as class }; - export let neutral = false; diff --git a/src/components/page-header/page-header.svelte b/src/components/page-header/page-header.svelte index 4bab88095..f645c26eb 100644 --- a/src/components/page-header/page-header.svelte +++ b/src/components/page-header/page-header.svelte @@ -4,6 +4,6 @@ export { className as class }; -
+
diff --git a/src/components/ui/button/index.ts b/src/components/ui/button/index.ts index 64acd1ca9..5338bc0b6 100644 --- a/src/components/ui/button/index.ts +++ b/src/components/ui/button/index.ts @@ -10,7 +10,7 @@ export const buttonVariants = tv({ outline: "border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground", secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80", - ghost: "hover:bg-accent hover:text-accent-foreground", + ghost: "hover:text-muted-foreground text-foreground", link: "text-primary underline-offset-4 hover:underline" }, size: { diff --git a/src/components/ui/table/table-cell.svelte b/src/components/ui/table/table-cell.svelte index 9e326e035..a7f1a3a65 100644 --- a/src/components/ui/table/table-cell.svelte +++ b/src/components/ui/table/table-cell.svelte @@ -10,7 +10,7 @@ [role=checkbox]]:translate-y-[2px]", + "py-[18px] align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className )} {...$$restProps} diff --git a/src/components/ui/table/table-head.svelte b/src/components/ui/table/table-head.svelte index bb4829f72..804a16caf 100644 --- a/src/components/ui/table/table-head.svelte +++ b/src/components/ui/table/table-head.svelte @@ -10,7 +10,7 @@ [role=checkbox]]:translate-y-[2px]", + "h-10 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className )} {...$$restProps} diff --git a/src/components/ui/table/table-header.svelte b/src/components/ui/table/table-header.svelte index c9be778a7..012ef212c 100644 --- a/src/components/ui/table/table-header.svelte +++ b/src/components/ui/table/table-header.svelte @@ -8,6 +8,6 @@ export { className as class }; - + diff --git a/src/components/ui/table/table.svelte b/src/components/ui/table/table.svelte index 5dfc770c6..876e8541f 100644 --- a/src/components/ui/table/table.svelte +++ b/src/components/ui/table/table.svelte @@ -8,7 +8,7 @@ export { className as class }; -
+
diff --git a/src/styles/app.postcss b/src/styles/app.postcss index 69b9c75c9..e573904f2 100644 --- a/src/styles/app.postcss +++ b/src/styles/app.postcss @@ -1,3 +1,5 @@ +@import url("https://fonts.googleapis.com/css2?family=Source+Code+Pro:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&display=swap"); + @tailwind base; @tailwind components; @tailwind utilities; diff --git a/tailwind.config.ts b/tailwind.config.ts index a7c1569bb..4772a9d88 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -29,7 +29,7 @@ export default { }, muted: { DEFAULT: "hsl(var(--muted) / )", - foreground: "hsl(var(--muted-foreground) / )" + foreground: "hsl(var(--muted-foreground))" }, dark: { DEFAULT: "hsl(var(--dark) / )", @@ -38,7 +38,8 @@ export default { accent: "hsl(var(--accent) / )" }, fontFamily: { - sans: ["Inter", ...fontFamily.sans] + sans: ["Inter", ...fontFamily.sans], + mono: ["Source Code Pro", ...fontFamily.mono] }, borderWidth: { 6: "6px" From 7809d062f2b9fba5a586f8f843efca74c52e7c99 Mon Sep 17 00:00:00 2001 From: Hunter Johnston Date: Wed, 15 Nov 2023 14:09:06 -0500 Subject: [PATCH 010/217] more --- src/components/api-section.svelte | 13 ++++++++++--- src/components/markdown/h2.svelte | 2 +- tailwind.config.ts | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/components/api-section.svelte b/src/components/api-section.svelte index 45539c102..a6b2d400d 100644 --- a/src/components/api-section.svelte +++ b/src/components/api-section.svelte @@ -1,6 +1,7 @@

diff --git a/tailwind.config.ts b/tailwind.config.ts index 4772a9d88..73ed95f66 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -49,7 +49,7 @@ export default { "card-lg": "1.25rem", "card-sm": "0.625rem", input: "0.563rem", - button: "0.313" + button: "0.313rem" }, height: { input: "3rem", From 2f90c0b15f1d7834c9ca042a45d3e18405c4e79c Mon Sep 17 00:00:00 2001 From: Hunter Johnston Date: Wed, 15 Nov 2023 14:09:51 -0500 Subject: [PATCH 011/217] typo --- content/components/accordion.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/components/accordion.md b/content/components/accordion.md index a9a1e5c55..a2f94b846 100644 --- a/content/components/accordion.md +++ b/content/components/accordion.md @@ -1,6 +1,6 @@ --- title: Accordion -description: Organizes content into collapsable sections. +description: Organizes content into collapsible sections. --- - - Is it accessible? - Yes. It adheres to the WAI-ARIA design pattern. - - - Is it styled? - - Yes. It comes with default styles that matches the other components' aesthetic. - - - - Is it animated? - - Yes. It's animated by default, but you can disable it if you prefer. - - + {#each items as item, i} + + + {item.title} + + + + + + {item.content} + + + {/each} From 931606587781c6298dfd73bc3dc51b7df8086168 Mon Sep 17 00:00:00 2001 From: Hunter Johnston Date: Wed, 15 Nov 2023 15:20:30 -0500 Subject: [PATCH 014/217] accordion updates --- src/components/demos/accordion-demo.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/demos/accordion-demo.svelte b/src/components/demos/accordion-demo.svelte index 8e38327ac..2cf8ba6b0 100644 --- a/src/components/demos/accordion-demo.svelte +++ b/src/components/demos/accordion-demo.svelte @@ -26,7 +26,7 @@ {#each items as item, i} {item.title} Date: Wed, 15 Nov 2023 16:28:55 -0500 Subject: [PATCH 015/217] sidebar spacing --- src/components/navigation/sidebar-nav-items.svelte | 6 +++--- src/components/navigation/sidebar-nav.svelte | 2 +- tailwind.config.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/navigation/sidebar-nav-items.svelte b/src/components/navigation/sidebar-nav-items.svelte index 71720d3b6..ec2833009 100644 --- a/src/components/navigation/sidebar-nav-items.svelte +++ b/src/components/navigation/sidebar-nav-items.svelte @@ -7,13 +7,13 @@ {#if items.length} -
+
{#each items as item, index (index)} {#if item.href} {:else} {item.title} diff --git a/src/components/navigation/sidebar-nav.svelte b/src/components/navigation/sidebar-nav.svelte index 87db12b1b..8bd4a513a 100644 --- a/src/components/navigation/sidebar-nav.svelte +++ b/src/components/navigation/sidebar-nav.svelte @@ -8,7 +8,7 @@