@kujoforall/paper-ui 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/LICENSE +21 -0
- package/README.md +252 -2
- package/dist/components/editor/block-text.d.ts +8 -0
- package/dist/components/editor/block-text.d.ts.map +1 -0
- package/dist/components/editor/block-text.js +213 -0
- package/dist/components/editor/block-text.js.map +1 -0
- package/dist/components/editor/blocks.d.ts +33 -0
- package/dist/components/editor/blocks.d.ts.map +1 -0
- package/dist/components/editor/blocks.js +187 -0
- package/dist/components/editor/blocks.js.map +1 -0
- package/dist/components/editor/document-editor.d.ts +27 -0
- package/dist/components/editor/document-editor.d.ts.map +1 -0
- package/dist/components/editor/document-editor.js +40 -0
- package/dist/components/editor/document-editor.js.map +1 -0
- package/dist/components/editor/document-view.d.ts +22 -0
- package/dist/components/editor/document-view.d.ts.map +1 -0
- package/dist/components/editor/document-view.js +105 -0
- package/dist/components/editor/document-view.js.map +1 -0
- package/dist/components/editor/editor-state.d.ts +100 -0
- package/dist/components/editor/editor-state.d.ts.map +1 -0
- package/dist/components/editor/editor-state.js +192 -0
- package/dist/components/editor/editor-state.js.map +1 -0
- package/dist/components/editor/extensions/spoiler.d.ts +8 -0
- package/dist/components/editor/extensions/spoiler.d.ts.map +1 -0
- package/dist/components/editor/extensions/spoiler.js +36 -0
- package/dist/components/editor/extensions/spoiler.js.map +1 -0
- package/dist/components/editor/index.d.ts +9 -0
- package/dist/components/editor/index.d.ts.map +1 -0
- package/dist/components/editor/index.js +9 -0
- package/dist/components/editor/index.js.map +1 -0
- package/dist/components/editor/kinds.d.ts +99 -0
- package/dist/components/editor/kinds.d.ts.map +1 -0
- package/dist/components/editor/kinds.js +74 -0
- package/dist/components/editor/kinds.js.map +1 -0
- package/dist/components/sketch/rough.d.ts +38 -0
- package/dist/components/sketch/rough.d.ts.map +1 -0
- package/dist/components/sketch/rough.js +57 -0
- package/dist/components/sketch/rough.js.map +1 -0
- package/dist/components/ui/accent-picker.d.ts +2 -0
- package/dist/components/ui/accent-picker.d.ts.map +1 -0
- package/dist/components/ui/accent-picker.js +44 -0
- package/dist/components/ui/accent-picker.js.map +1 -0
- package/dist/components/ui/address-field.d.ts +10 -0
- package/dist/components/ui/address-field.d.ts.map +1 -0
- package/dist/components/ui/address-field.js +24 -0
- package/dist/components/ui/address-field.js.map +1 -0
- package/dist/components/ui/app-shell.d.ts +25 -0
- package/dist/components/ui/app-shell.d.ts.map +1 -0
- package/dist/components/ui/app-shell.js +69 -0
- package/dist/components/ui/app-shell.js.map +1 -0
- package/dist/components/ui/badge.d.ts +19 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/badge.js +62 -0
- package/dist/components/ui/badge.js.map +1 -0
- package/dist/components/ui/breadcrumbs.d.ts +10 -0
- package/dist/components/ui/breadcrumbs.d.ts.map +1 -0
- package/dist/components/ui/breadcrumbs.js +9 -0
- package/dist/components/ui/breadcrumbs.js.map +1 -0
- package/dist/components/ui/button.d.ts +13 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.js +45 -0
- package/dist/components/ui/button.js.map +1 -0
- package/dist/components/ui/calendar.d.ts +5 -0
- package/dist/components/ui/calendar.d.ts.map +1 -0
- package/dist/components/ui/calendar.js +64 -0
- package/dist/components/ui/calendar.js.map +1 -0
- package/dist/components/ui/callout.d.ts +13 -0
- package/dist/components/ui/callout.d.ts.map +1 -0
- package/dist/components/ui/callout.js +27 -0
- package/dist/components/ui/callout.js.map +1 -0
- package/dist/components/ui/card.d.ts +13 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/card.js +27 -0
- package/dist/components/ui/card.js.map +1 -0
- package/dist/components/ui/checkbox.d.ts +6 -0
- package/dist/components/ui/checkbox.d.ts.map +1 -0
- package/dist/components/ui/checkbox.js +10 -0
- package/dist/components/ui/checkbox.js.map +1 -0
- package/dist/components/ui/command-menu.d.ts +15 -0
- package/dist/components/ui/command-menu.d.ts.map +1 -0
- package/dist/components/ui/command-menu.js +24 -0
- package/dist/components/ui/command-menu.js.map +1 -0
- package/dist/components/ui/date-picker.d.ts +35 -0
- package/dist/components/ui/date-picker.d.ts.map +1 -0
- package/dist/components/ui/date-picker.js +56 -0
- package/dist/components/ui/date-picker.js.map +1 -0
- package/dist/components/ui/date-time-picker.d.ts +19 -0
- package/dist/components/ui/date-time-picker.d.ts.map +1 -0
- package/dist/components/ui/date-time-picker.js +32 -0
- package/dist/components/ui/date-time-picker.js.map +1 -0
- package/dist/components/ui/dialog.d.ts +17 -0
- package/dist/components/ui/dialog.d.ts.map +1 -0
- package/dist/components/ui/dialog.js +33 -0
- package/dist/components/ui/dialog.js.map +1 -0
- package/dist/components/ui/dropdown-menu.d.ts +20 -0
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/components/ui/dropdown-menu.js +56 -0
- package/dist/components/ui/dropdown-menu.js.map +1 -0
- package/dist/components/ui/editable-text.d.ts +17 -0
- package/dist/components/ui/editable-text.d.ts.map +1 -0
- package/dist/components/ui/editable-text.js +68 -0
- package/dist/components/ui/editable-text.js.map +1 -0
- package/dist/components/ui/field-button.d.ts +14 -0
- package/dist/components/ui/field-button.d.ts.map +1 -0
- package/dist/components/ui/field-button.js +16 -0
- package/dist/components/ui/field-button.js.map +1 -0
- package/dist/components/ui/file-preview.d.ts +5 -0
- package/dist/components/ui/file-preview.d.ts.map +1 -0
- package/dist/components/ui/file-preview.js +66 -0
- package/dist/components/ui/file-preview.js.map +1 -0
- package/dist/components/ui/file-uploader.d.ts +39 -0
- package/dist/components/ui/file-uploader.d.ts.map +1 -0
- package/dist/components/ui/file-uploader.js +110 -0
- package/dist/components/ui/file-uploader.js.map +1 -0
- package/dist/components/ui/handle-row.d.ts +15 -0
- package/dist/components/ui/handle-row.d.ts.map +1 -0
- package/dist/components/ui/handle-row.js +41 -0
- package/dist/components/ui/handle-row.js.map +1 -0
- package/dist/components/ui/image-block.d.ts +31 -0
- package/dist/components/ui/image-block.d.ts.map +1 -0
- package/dist/components/ui/image-block.js +103 -0
- package/dist/components/ui/image-block.js.map +1 -0
- package/dist/components/ui/image-card.d.ts +17 -0
- package/dist/components/ui/image-card.d.ts.map +1 -0
- package/dist/components/ui/image-card.js +38 -0
- package/dist/components/ui/image-card.js.map +1 -0
- package/dist/components/ui/image-viewer.d.ts +31 -0
- package/dist/components/ui/image-viewer.d.ts.map +1 -0
- package/dist/components/ui/image-viewer.js +81 -0
- package/dist/components/ui/image-viewer.js.map +1 -0
- package/dist/components/ui/image.d.ts +11 -0
- package/dist/components/ui/image.d.ts.map +1 -0
- package/dist/components/ui/image.js +32 -0
- package/dist/components/ui/image.js.map +1 -0
- package/dist/components/ui/index.d.ts +49 -0
- package/dist/components/ui/index.d.ts.map +1 -0
- package/dist/components/ui/index.js +49 -0
- package/dist/components/ui/index.js.map +1 -0
- package/dist/components/ui/input.d.ts +16 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/input.js +32 -0
- package/dist/components/ui/input.js.map +1 -0
- package/dist/components/ui/link-block.d.ts +13 -0
- package/dist/components/ui/link-block.d.ts.map +1 -0
- package/dist/components/ui/link-block.js +21 -0
- package/dist/components/ui/link-block.js.map +1 -0
- package/dist/components/ui/mac-card.d.ts +15 -0
- package/dist/components/ui/mac-card.d.ts.map +1 -0
- package/dist/components/ui/mac-card.js +9 -0
- package/dist/components/ui/mac-card.js.map +1 -0
- package/dist/components/ui/nav-tree.d.ts +16 -0
- package/dist/components/ui/nav-tree.d.ts.map +1 -0
- package/dist/components/ui/nav-tree.js +34 -0
- package/dist/components/ui/nav-tree.js.map +1 -0
- package/dist/components/ui/page.d.ts +12 -0
- package/dist/components/ui/page.d.ts.map +1 -0
- package/dist/components/ui/page.js +15 -0
- package/dist/components/ui/page.js.map +1 -0
- package/dist/components/ui/popover.d.ts +8 -0
- package/dist/components/ui/popover.d.ts.map +1 -0
- package/dist/components/ui/popover.js +18 -0
- package/dist/components/ui/popover.js.map +1 -0
- package/dist/components/ui/progress.d.ts +9 -0
- package/dist/components/ui/progress.d.ts.map +1 -0
- package/dist/components/ui/progress.js +9 -0
- package/dist/components/ui/progress.js.map +1 -0
- package/dist/components/ui/property.d.ts +15 -0
- package/dist/components/ui/property.d.ts.map +1 -0
- package/dist/components/ui/property.js +34 -0
- package/dist/components/ui/property.js.map +1 -0
- package/dist/components/ui/segmented.d.ts +13 -0
- package/dist/components/ui/segmented.d.ts.map +1 -0
- package/dist/components/ui/segmented.js +10 -0
- package/dist/components/ui/segmented.js.map +1 -0
- package/dist/components/ui/select-menu.d.ts +10 -0
- package/dist/components/ui/select-menu.d.ts.map +1 -0
- package/dist/components/ui/select-menu.js +10 -0
- package/dist/components/ui/select-menu.js.map +1 -0
- package/dist/components/ui/select.d.ts +11 -0
- package/dist/components/ui/select.d.ts.map +1 -0
- package/dist/components/ui/select.js +31 -0
- package/dist/components/ui/select.js.map +1 -0
- package/dist/components/ui/selection-bar.d.ts +12 -0
- package/dist/components/ui/selection-bar.d.ts.map +1 -0
- package/dist/components/ui/selection-bar.js +15 -0
- package/dist/components/ui/selection-bar.js.map +1 -0
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/separator.d.ts.map +1 -0
- package/dist/components/ui/separator.js +12 -0
- package/dist/components/ui/separator.js.map +1 -0
- package/dist/components/ui/spotlight.d.ts +23 -0
- package/dist/components/ui/spotlight.d.ts.map +1 -0
- package/dist/components/ui/spotlight.js +107 -0
- package/dist/components/ui/spotlight.js.map +1 -0
- package/dist/components/ui/stat-tile.d.ts +8 -0
- package/dist/components/ui/stat-tile.d.ts.map +1 -0
- package/dist/components/ui/stat-tile.js +9 -0
- package/dist/components/ui/stat-tile.js.map +1 -0
- package/dist/components/ui/step-dialog.d.ts +20 -0
- package/dist/components/ui/step-dialog.d.ts.map +1 -0
- package/dist/components/ui/step-dialog.js +36 -0
- package/dist/components/ui/step-dialog.js.map +1 -0
- package/dist/components/ui/table.d.ts +8 -0
- package/dist/components/ui/table.d.ts.map +1 -0
- package/dist/components/ui/table.js +23 -0
- package/dist/components/ui/table.js.map +1 -0
- package/dist/components/ui/theme-toggle.d.ts +2 -0
- package/dist/components/ui/theme-toggle.d.ts.map +1 -0
- package/dist/components/ui/theme-toggle.js +49 -0
- package/dist/components/ui/theme-toggle.js.map +1 -0
- package/dist/components/ui/time-picker.d.ts +21 -0
- package/dist/components/ui/time-picker.d.ts.map +1 -0
- package/dist/components/ui/time-picker.js +63 -0
- package/dist/components/ui/time-picker.js.map +1 -0
- package/dist/components/ui/tooltip.d.ts +15 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -0
- package/dist/components/ui/tooltip.js +21 -0
- package/dist/components/ui/tooltip.js.map +1 -0
- package/dist/components/ui/typography.d.ts +34 -0
- package/dist/components/ui/typography.d.ts.map +1 -0
- package/dist/components/ui/typography.js +72 -0
- package/dist/components/ui/typography.js.map +1 -0
- package/dist/components/ui/video-block.d.ts +14 -0
- package/dist/components/ui/video-block.d.ts.map +1 -0
- package/dist/components/ui/video-block.js +18 -0
- package/dist/components/ui/video-block.js.map +1 -0
- package/dist/hooks/use-save-queue.d.ts +13 -0
- package/dist/hooks/use-save-queue.d.ts.map +1 -0
- package/dist/hooks/use-save-queue.js +45 -0
- package/dist/hooks/use-save-queue.js.map +1 -0
- package/dist/hooks/use-selection.d.ts +10 -0
- package/dist/hooks/use-selection.d.ts.map +1 -0
- package/dist/hooks/use-selection.js +43 -0
- package/dist/hooks/use-selection.js.map +1 -0
- package/dist/hooks/use-shared-transition.d.ts +3 -0
- package/dist/hooks/use-shared-transition.d.ts.map +1 -0
- package/dist/hooks/use-shared-transition.js +38 -0
- package/dist/hooks/use-shared-transition.js.map +1 -0
- package/dist/hooks/use-upload-queue.d.ts +22 -0
- package/dist/hooks/use-upload-queue.d.ts.map +1 -0
- package/dist/hooks/use-upload-queue.js +78 -0
- package/dist/hooks/use-upload-queue.js.map +1 -0
- package/dist/lib/accent.d.ts +5 -0
- package/dist/lib/accent.d.ts.map +1 -0
- package/dist/lib/accent.js +10 -0
- package/dist/lib/accent.js.map +1 -0
- package/dist/lib/bento.d.ts +17 -0
- package/dist/lib/bento.d.ts.map +1 -0
- package/dist/lib/bento.js +92 -0
- package/dist/lib/bento.js.map +1 -0
- package/dist/lib/dates.d.ts +14 -0
- package/dist/lib/dates.d.ts.map +1 -0
- package/dist/lib/dates.js +34 -0
- package/dist/lib/dates.js.map +1 -0
- package/dist/lib/document.d.ts +79 -0
- package/dist/lib/document.d.ts.map +1 -0
- package/dist/lib/document.js +11 -0
- package/dist/lib/document.js.map +1 -0
- package/dist/lib/embed.d.ts +14 -0
- package/dist/lib/embed.d.ts.map +1 -0
- package/dist/lib/embed.js +63 -0
- package/dist/lib/embed.js.map +1 -0
- package/dist/lib/files.d.ts +23 -0
- package/dist/lib/files.d.ts.map +1 -0
- package/dist/lib/files.js +69 -0
- package/dist/lib/files.js.map +1 -0
- package/dist/lib/justified.d.ts +50 -0
- package/dist/lib/justified.d.ts.map +1 -0
- package/dist/lib/justified.js +78 -0
- package/dist/lib/justified.js.map +1 -0
- package/dist/lib/rich-text-dom.d.ts +14 -0
- package/dist/lib/rich-text-dom.d.ts.map +1 -0
- package/dist/lib/rich-text-dom.js +143 -0
- package/dist/lib/rich-text-dom.js.map +1 -0
- package/dist/lib/rich-text.d.ts +15 -0
- package/dist/lib/rich-text.d.ts.map +1 -0
- package/dist/lib/rich-text.js +35 -0
- package/dist/lib/rich-text.js.map +1 -0
- package/dist/lib/spotlight.d.ts +22 -0
- package/dist/lib/spotlight.d.ts.map +1 -0
- package/dist/lib/spotlight.js +66 -0
- package/dist/lib/spotlight.js.map +1 -0
- package/dist/lib/tree.d.ts +17 -0
- package/dist/lib/tree.d.ts.map +1 -0
- package/dist/lib/tree.js +35 -0
- package/dist/lib/tree.js.map +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +6 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/styles/notion.css +526 -0
- package/package.json +106 -5
- package/src/components/editor/block-text.tsx +230 -0
- package/src/components/editor/blocks.tsx +368 -0
- package/src/components/editor/document-editor.tsx +101 -0
- package/src/components/editor/document-view.tsx +192 -0
- package/src/components/editor/editor-state.tsx +270 -0
- package/src/components/editor/extensions/spoiler.tsx +76 -0
- package/src/components/editor/index.ts +9 -0
- package/src/components/editor/kinds.ts +158 -0
- package/src/components/sketch/rough.tsx +90 -0
- package/src/components/ui/accent-picker.tsx +72 -0
- package/src/components/ui/address-field.tsx +57 -0
- package/src/components/ui/app-shell.tsx +138 -0
- package/src/components/ui/badge.tsx +81 -0
- package/src/components/ui/breadcrumbs.tsx +25 -0
- package/src/components/ui/button.tsx +73 -0
- package/src/components/ui/calendar.tsx +100 -0
- package/src/components/ui/callout.tsx +62 -0
- package/src/components/ui/card.tsx +90 -0
- package/src/components/ui/checkbox.tsx +32 -0
- package/src/components/ui/command-menu.tsx +72 -0
- package/src/components/ui/date-picker.tsx +170 -0
- package/src/components/ui/date-time-picker.tsx +117 -0
- package/src/components/ui/dialog.tsx +124 -0
- package/src/components/ui/dropdown-menu.tsx +183 -0
- package/src/components/ui/editable-text.tsx +109 -0
- package/src/components/ui/field-button.tsx +68 -0
- package/src/components/ui/file-preview.tsx +80 -0
- package/src/components/ui/file-uploader.tsx +376 -0
- package/src/components/ui/handle-row.tsx +116 -0
- package/src/components/ui/image-block.tsx +238 -0
- package/src/components/ui/image-card.tsx +102 -0
- package/src/components/ui/image-viewer.tsx +187 -0
- package/src/components/ui/image.tsx +96 -0
- package/src/components/ui/index.ts +83 -0
- package/src/components/ui/input.tsx +99 -0
- package/src/components/ui/link-block.tsx +82 -0
- package/src/components/ui/mac-card.tsx +46 -0
- package/src/components/ui/nav-tree.tsx +86 -0
- package/src/components/ui/page.tsx +25 -0
- package/src/components/ui/popover.tsx +42 -0
- package/src/components/ui/progress.tsx +36 -0
- package/src/components/ui/property.tsx +64 -0
- package/src/components/ui/segmented.tsx +42 -0
- package/src/components/ui/select-menu.tsx +46 -0
- package/src/components/ui/select.tsx +124 -0
- package/src/components/ui/selection-bar.tsx +50 -0
- package/src/components/ui/separator.tsx +30 -0
- package/src/components/ui/spotlight.tsx +222 -0
- package/src/components/ui/stat-tile.tsx +25 -0
- package/src/components/ui/step-dialog.tsx +104 -0
- package/src/components/ui/table.tsx +42 -0
- package/src/components/ui/theme-toggle.tsx +101 -0
- package/src/components/ui/time-picker.tsx +173 -0
- package/src/components/ui/tooltip.tsx +64 -0
- package/src/components/ui/typography.tsx +168 -0
- package/src/components/ui/video-block.tsx +60 -0
- package/src/hooks/use-save-queue.ts +66 -0
- package/src/hooks/use-selection.ts +44 -0
- package/src/hooks/use-shared-transition.ts +40 -0
- package/src/hooks/use-upload-queue.ts +111 -0
- package/src/lib/accent.ts +11 -0
- package/src/lib/bento.ts +87 -0
- package/src/lib/dates.ts +39 -0
- package/src/lib/document.ts +55 -0
- package/src/lib/embed.ts +62 -0
- package/src/lib/files.ts +73 -0
- package/src/lib/justified.ts +106 -0
- package/src/lib/rich-text-dom.ts +136 -0
- package/src/lib/rich-text.ts +50 -0
- package/src/lib/spotlight.ts +78 -0
- package/src/lib/tree.ts +41 -0
- package/src/lib/utils.ts +6 -0
- package/src/styles/notion.css +526 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ChevronsUpDown } from "lucide-react";
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
5
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuTrigger } from "./dropdown-menu.js";
|
|
6
|
+
import { ACCENTS, ACCENT_KEY } from "../../lib/accent.js";
|
|
7
|
+
const label = (accent) => accent[0].toUpperCase() + accent.slice(1);
|
|
8
|
+
// A dot in a theme's colour. It carries its own data-accent, so it shows that
|
|
9
|
+
// theme's colour in whichever mode is on, whatever the page's theme is. Paper has no
|
|
10
|
+
// colour of its own, so its dot is a plain one with a ring.
|
|
11
|
+
function Swatch({ accent }) {
|
|
12
|
+
if (accent === "paper")
|
|
13
|
+
return _jsx("span", { className: "size-3 shrink-0 rounded-full bg-tag-gray-bg shadow-[inset_0_0_0_1px_var(--hairline-strong)]" });
|
|
14
|
+
return _jsx("span", { "data-accent": accent, className: "size-3 shrink-0 rounded-full bg-accent" });
|
|
15
|
+
}
|
|
16
|
+
/* The colour theme: which colour titles, markers and controls take, and the wash it
|
|
17
|
+
gives every surface, so the background matches. Separate from light and dark, and
|
|
18
|
+
remembered per browser. One row in the sidebar shows the current theme and opens
|
|
19
|
+
the list of them. */
|
|
20
|
+
export function AccentPicker() {
|
|
21
|
+
const [accent, setAccent] = useState("paper");
|
|
22
|
+
// The <head> script has already applied the stored choice; this only reads it back.
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
const stored = document.documentElement.dataset.accent;
|
|
25
|
+
if (stored && ACCENTS.includes(stored))
|
|
26
|
+
setAccent(stored);
|
|
27
|
+
}, []);
|
|
28
|
+
const choose = (next) => {
|
|
29
|
+
setAccent(next);
|
|
30
|
+
// Paper is the absence of a theme, so the stylesheet's defaults apply.
|
|
31
|
+
if (next === "paper")
|
|
32
|
+
delete document.documentElement.dataset.accent;
|
|
33
|
+
else
|
|
34
|
+
document.documentElement.dataset.accent = next;
|
|
35
|
+
try {
|
|
36
|
+
localStorage.setItem(ACCENT_KEY, next);
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
// Private mode: the choice lasts for this page view only.
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs("button", { type: "button", "aria-label": `Colour theme: ${label(accent)}`, className: "flex h-[30px] w-full items-center gap-2 rounded-control px-2 text-sm font-medium text-ink-secondary transition-colors duration-100 hover:bg-tint-hover data-[state=open]:bg-tint-hover", children: [_jsx("span", { className: "flex size-5 items-center justify-center", children: _jsx(Swatch, { accent: accent }) }), _jsx("span", { className: "min-w-0 flex-1 truncate text-left", children: "Colour" }), _jsx("span", { className: "text-ink-tertiary", children: label(accent) }), _jsx(ChevronsUpDown, { className: "size-3.5 text-ink-tertiary" })] }) }), _jsxs(DropdownMenuContent, { side: "top", align: "start", className: "w-[var(--radix-dropdown-menu-trigger-width)]", children: [_jsx(DropdownMenuLabel, { children: "Colour theme" }), _jsx(DropdownMenuRadioGroup, { value: accent, onValueChange: (next) => choose(next), children: ACCENTS.map((a) => (_jsxs(DropdownMenuRadioItem, { value: a, children: [_jsx(Swatch, { accent: a }), label(a)] }, a))) })] })] }));
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=accent-picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accent-picker.js","sourceRoot":"","sources":["../../../src/components/ui/accent-picker.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,oBAAqB,CAAC;AAC/J,OAAO,EAAE,OAAO,EAAE,UAAU,EAAe,MAAM,qBAAqB,CAAC;AAEvE,MAAM,KAAK,GAAG,CAAC,MAAc,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAE5E,8EAA8E;AAC9E,qFAAqF;AACrF,4DAA4D;AAC5D,SAAS,MAAM,CAAC,EAAE,MAAM,EAAsB;IAC1C,IAAI,MAAM,KAAK,OAAO;QAAE,OA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AE,KAAK,CAAC,MAAM,CAAC,GAAQ,EAC1D,KAAC,cAAc,IAAC,SAAS,EAAC,4BAA4B,GAAG,IACpD,GACS,EACtB,MAAC,mBAAmB,IAAC,IAAI,EAAC,KAAK,EAAC,KAAK,EAAC,OAAO,EAAC,SAAS,EAAC,8CAA8C,aAClG,KAAC,iBAAiB,+BAAiC,EACnD,KAAC,sBAAsB,IAAC,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,IAAc,CAAC,YACjF,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAChB,MAAC,qBAAqB,IAAS,KAAK,EAAE,CAAC,aACnC,KAAC,MAAM,IAAC,MAAM,EAAE,CAAC,GAAI,EACpB,KAAK,CAAC,CAAC,CAAC,KAFe,CAAC,CAGL,CAC3B,CAAC,GACmB,IACP,IACX,CAClB,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export declare function AddressField({ icon, placeholder, check, onCommit, autoFocus, className, }: {
|
|
3
|
+
icon?: ReactNode;
|
|
4
|
+
placeholder: string;
|
|
5
|
+
check: (url: string) => string | null;
|
|
6
|
+
onCommit: (url: string) => void;
|
|
7
|
+
autoFocus?: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=address-field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"address-field.d.ts","sourceRoot":"","sources":["../../../src/components/ui/address-field.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAMjD,wBAAgB,YAAY,CAAC,EACzB,IAAI,EACJ,WAAW,EACX,KAAK,EACL,QAAQ,EACR,SAAgB,EAChB,SAAS,GACZ,EAAE;IACC,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IACtC,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,+BAkCA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { cn } from "../../lib/utils.js";
|
|
5
|
+
/* Where an empty block asks for a link: one field that commits on Enter, and
|
|
6
|
+
says why when what was pasted will not do. `check` returns that reason, or
|
|
7
|
+
null for an address it accepts. */
|
|
8
|
+
export function AddressField({ icon, placeholder, check, onCommit, autoFocus = true, className, }) {
|
|
9
|
+
const [value, setValue] = useState("");
|
|
10
|
+
const [error, setError] = useState(null);
|
|
11
|
+
return (_jsxs("form", { className: cn("flex flex-wrap items-center gap-2 rounded-surface bg-tint-hover px-4 py-3 text-sm", className), onSubmit: (e) => {
|
|
12
|
+
e.preventDefault();
|
|
13
|
+
const url = value.trim();
|
|
14
|
+
const problem = check(url);
|
|
15
|
+
if (problem === null)
|
|
16
|
+
onCommit(url);
|
|
17
|
+
else
|
|
18
|
+
setError(problem);
|
|
19
|
+
}, children: [icon && _jsx("span", { className: "text-ink-tertiary [&_svg]:size-4", children: icon }), _jsx("input", { autoFocus: autoFocus, value: value, onChange: (e) => {
|
|
20
|
+
setValue(e.target.value);
|
|
21
|
+
setError(null);
|
|
22
|
+
}, placeholder: placeholder, "aria-label": placeholder, "aria-invalid": error !== null || undefined, className: "h-8 min-w-0 flex-1 bg-transparent text-ink outline-none placeholder:text-ink-tertiary" }), error !== null && (_jsx("span", { role: "alert", className: "w-full text-danger", children: error }))] }));
|
|
23
|
+
}
|
|
24
|
+
//# sourceMapp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AW,kBACT,KAAK,KAAK,IAAI,IAAI,SAAS,EACzC,SAAS,EAAC,uFAAuF,GACnG,EACD,KAAK,KAAK,IAAI,IAAI,CACf,eAAM,IAAI,EAAC,OAAO,EAAC,SAAS,EAAC,oBAAoB,YAC5C,KAAK,GACH,CACV,IACE,CACV,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
/** Opens or closes the sidebar from anywhere, as the shortcut does. */
|
|
3
|
+
export declare const toggleSidebar: () => void;
|
|
4
|
+
export type ShellControls = {
|
|
5
|
+
sidebarOpen: boolean;
|
|
6
|
+
openSidebar: () => void;
|
|
7
|
+
closeSidebar: () => void;
|
|
8
|
+
};
|
|
9
|
+
export declare function AppShell({ sidebar, topbar, children, routeKey, }: {
|
|
10
|
+
sidebar: (controls: ShellControls) => ReactNode;
|
|
11
|
+
topbar: (controls: ShellControls) => ReactNode;
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
routeKey?: string;
|
|
14
|
+
}): import("react").JSX.Element;
|
|
15
|
+
export declare function SidebarFrame({ header, footer, children, label }: {
|
|
16
|
+
header?: ReactNode;
|
|
17
|
+
footer?: ReactNode;
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
label: string;
|
|
20
|
+
}): import("react").JSX.Element;
|
|
21
|
+
export declare function SidebarSection({ title, children }: {
|
|
22
|
+
title: string;
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
}): import("react").JSX.Element;
|
|
25
|
+
//# sourceMappingURL=app-shell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-shell.d.ts","sourceRoot":"","sources":["../../../src/components/ui/app-shell.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAuB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAK5D,uEAAuE;AACvE,eAAO,MAAM,aAAa,QAAO,IAA4D,CAAC;AAE9F,MAAM,MAAM,aAAa,GAAG;IAExB,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,YAAY,EAAE,MAAM,IAAI,CAAC;CAC5B,CAAC;AAaF,wBAAgB,QAAQ,CAAC,EACrB,OAAO,EACP,MAAM,EACN,QAAQ,EACR,QAAQ,GACX,EAAE;IACC,OAAO,EAAE,CAAC,QAAQ,EAAE,aAAa,KAAK,SAAS,CAAC;IAChD,MAAM,EAAE,CAAC,QAAQ,EAAE,aAAa,KAAK,SAAS,CAAC;IAC/C,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB,+BA4EA;AAKD,wBAAgB,YAAY,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE;IAAE,MAAM,CAAC,EAAE,SAAS,CAAC;IAAC,MAAM,CAAC,EAAE,SAAS,CAAC;IAAC,QAAQ,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,+BAQ/I;AAGD,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,SAAS,CAAA;CAAE,+BAOzF"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
import { cn } from "../../lib/utils.js";
|
|
5
|
+
const TOGGLE_SIDEBAR = "ui:toggle-sidebar";
|
|
6
|
+
/** Opens or closes the sidebar from anywhere, as the shortcut does. */
|
|
7
|
+
export const toggleSidebar = () => void window.dispatchEvent(new Event(TOGGLE_SIDEBAR));
|
|
8
|
+
/* The frame of a Notion-like app: a sidebar beside a top bar and a scrolling main
|
|
9
|
+
area. On a wide screen the sidebar is a column that collapses to nothing (⌘\ or
|
|
10
|
+
Ctrl-\ toggles it). Below the `md` breakpoint it is a drawer over a scrim, closed
|
|
11
|
+
until asked for.
|
|
12
|
+
|
|
13
|
+
`sidebar` and `topbar` are functions so they can render their own open and close
|
|
14
|
+
buttons. Pass something that changes on navigation as `routeKey` (the pathname)
|
|
15
|
+
and the drawer closes when a destination is chosen from it.
|
|
16
|
+
|
|
17
|
+
`main` is a container: size content to the room it actually has with container
|
|
18
|
+
variants (`@6xl:max-w-…`), which account for the sidebar being open or shut. */
|
|
19
|
+
export function AppShell({ sidebar, topbar, children, routeKey, }) {
|
|
20
|
+
const [open, setOpen] = useState(true);
|
|
21
|
+
const [drawer, setDrawer] = useState(false);
|
|
22
|
+
useEffect(() => setDrawer(false), [routeKey]);
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
const onKey = (e) => {
|
|
25
|
+
if ((e.metaKey || e.ctrlKey) && e.key === "\\") {
|
|
26
|
+
e.preventDefault();
|
|
27
|
+
setOpen((o) => !o);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
// Anything outside the shell may ask for the sidebar: a full-window view
|
|
31
|
+
// with its own button for it. On a small screen that means the drawer.
|
|
32
|
+
const onToggle = () => {
|
|
33
|
+
if (window.matchMedia("(min-width: 768px)").matches)
|
|
34
|
+
setOpen((o) => !o);
|
|
35
|
+
else
|
|
36
|
+
setDrawer((d) => !d);
|
|
37
|
+
};
|
|
38
|
+
window.addEventListener("keydown", onKey);
|
|
39
|
+
window.addEventListener(TOGGLE_SIDEBAR, onToggle);
|
|
40
|
+
return () => {
|
|
41
|
+
window.removeEventListener("keydown", onKey);
|
|
42
|
+
window.removeEventListener(TOGGLE_SIDEBAR, onToggle);
|
|
43
|
+
};
|
|
44
|
+
}, []);
|
|
45
|
+
// How much of the window the sidebar takes, published as `--sidebar-w` for
|
|
46
|
+
// anything laid over the page that should leave the sidebar showing or
|
|
47
|
+
// centre itself on what is left (an image viewer, a selection bar).
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
document.documentElement.style.setProperty("--sidebar-w", open ? "15rem" : "0px");
|
|
50
|
+
return () => void document.documentElement.style.removeProperty("--sidebar-w");
|
|
51
|
+
}, [open]);
|
|
52
|
+
const desktop = { sidebarOpen: open, openSidebar: () => setOpen(true), closeSidebar: () => setOpen(false) };
|
|
53
|
+
// On a small screen the bar always offers to open the drawer.
|
|
54
|
+
const mobile = { sidebarOpen: false, openSidebar: () => setDrawer(true), closeSidebar: () => setDrawer(false) };
|
|
55
|
+
return (_jsxs("div", { className: "flex h-dvh", children: [_jsx("div", { className: cn("hidden shrink-0 overflow-hidden transition-[width] duration-150 ease-out-notion md:block", open ? "w-60" : "w-0"), inert: !open, children: sidebar(desktop) }), _jsxs("div", { className: cn("fixed inset-0 z-40 md:hidden", !drawer && "pointer-events-none"), inert: !drawer, children: [_jsx("div", { className: cn("absolute inset-0 bg-black/30 transition-opacity duration-150", drawer ? "opacity-100" : "opacity-0"), onClick: () => setDrawer(false) }), _jsx("div", { className: cn("absolute inset-y-0 left-0 transition-transform duration-150 ease-out-notion",
|
|
56
|
+
// The shadow would otherwise spill onto the page from off-screen.
|
|
57
|
+
drawer ? "translate-x-0 shadow-dialog" : "-translate-x-full"), children: sidebar(mobile) })] }), _jsxs("div", { className: "flex min-w-0 flex-1 flex-col", children: [_jsx("div", { className: "md:hidden", children: topbar(mobile) }), _jsx("div", { className: "hidden md:block", children: topbar(desktop) }), _jsx("main", { className: "@container flex-1 overflow-y-auto", children: children })] })] }));
|
|
58
|
+
}
|
|
59
|
+
/* The sidebar's own frame: a fixed-width sunken column with a header, a scrolling
|
|
60
|
+
middle and an optional footer. It is a named group, `group/sidebar`, so controls
|
|
61
|
+
in the header can stay hidden until the sidebar is hovered. */
|
|
62
|
+
export function SidebarFrame({ header, footer, children, label }) {
|
|
63
|
+
return (_jsxs("nav", { "aria-label": label, className: "group/sidebar flex h-full w-60 flex-col bg-surface-sunken shadow-[inset_-1px_0_0_var(--hairline)]", children: [header && _jsx("div", { className: "flex h-11 shrink-0 items-center gap-2 pr-2 pl-3", children: header }), _jsx("div", { className: "min-h-0 flex-1 overflow-y-auto px-1 pb-6", children: children }), footer && _jsx("div", { className: "shrink-0 p-1 shadow-[inset_0_1px_0_var(--hairline)]", children: footer })] }));
|
|
64
|
+
}
|
|
65
|
+
/* A labelled group of entries inside the sidebar. */
|
|
66
|
+
export function SidebarSection({ title, children }) {
|
|
67
|
+
return (_jsxs("section", { className: "mt-4 first:mt-1", children: [_jsx("h2", { className: "truncate px-2 pb-1 text-caption font-medium text-accent-text/80", children: title }), children] }));
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=app-shell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-shell.js","sourceRoot":"","sources":["../../../src/components/ui/app-shell.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC,MAAM,cAAc,GAAG,mBAAmB,CAAC;AAE3C,uEAAuE;AACvE,MAAM,CAAC,MAAM,aAAa,GAAG,GAAS,EAAE,CAAC,KAAK,MAAM,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC;AAS9F;;;;;;;;;;kFAUkF;AAClF,MAAM,UAAU,QAAQ,CAAC,EACrB,OAAO,EACP,MAAM,EACN,QAAQ,EACR,QAAQ,GAMX;IACG,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IACvC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE5C,SAAS,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAE9C,SAAS,CAAC,GAAG,EAAE;QACX,MAAM,KAAK,GAAG,CAAC,CAAgB,EA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AC,GAAO,EACxD,eAAM,SAAS,EAAC,mCAAmC,YAAE,QAAQ,GAAQ,IACnE,IACJ,CACT,CAAC;AACN,CAAC;AAED;;iEAEiE;AACjE,MAAM,UAAU,YAAY,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAkF;IAC5I,OAAO,CACH,6BAAiB,KAAK,EAAE,SAAS,EAAC,mGAAmG,aAChI,MAAM,IAAI,cAAK,SAAS,EAAC,iDAAiD,YAAE,MAAM,GAAO,EAC1F,cAAK,SAAS,EAAC,0CAA0C,YAAE,QAAQ,GAAO,EACzE,MAAM,IAAI,cAAK,SAAS,EAAC,qDAAqD,YAAE,MAAM,GAAO,IAC5F,CACT,CAAC;AACN,CAAC;AAED,qDAAqD;AACrD,MAAM,UAAU,cAAc,CAAC,EAAE,KAAK,EAAE,QAAQ,EAA0C;IACtF,OAAO,CACH,mBAAS,SAAS,EAAC,iBAAiB,aAChC,aAAI,SAAS,EAAC,iEAAiE,YAAE,KAAK,GAAM,EAC3F,QAAQ,IACH,CACb,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import type { ComponentPropsWithoutRef } from "react";
|
|
3
|
+
export declare const TAG_COLORS: readonly ["gray", "brown", "orange", "yellow", "green", "blue", "purple", "pink", "red"];
|
|
4
|
+
export type TagColor = (typeof TAG_COLORS)[number];
|
|
5
|
+
declare const badgeVariants: (props?: ({
|
|
6
|
+
color?: "blue" | "brown" | "gray" | "green" | "orange" | "pink" | "purple" | "red" | "yellow" | null | undefined;
|
|
7
|
+
size?: "sm" | "md" | null | undefined;
|
|
8
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
|
+
export interface BadgeProps extends Omit<ComponentPropsWithoutRef<"span">, "color">, VariantProps<typeof badgeVariants> {
|
|
10
|
+
}
|
|
11
|
+
export declare function Badge({ className, color, size, ...props }: BadgeProps): import("react").JSX.Element;
|
|
12
|
+
/**
|
|
13
|
+
* Deterministically maps any string to one of the nine. Use it for tags,
|
|
14
|
+
* owners, labels — anything user-generated that needs a stable colour
|
|
15
|
+
* without anyone choosing one.
|
|
16
|
+
*/
|
|
17
|
+
export declare function tagColorFor(value: string): TagColor;
|
|
18
|
+
export { badgeVariants };
|
|
19
|
+
//# sourceMappingURL=badge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../src/components/ui/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC;AActD,eAAO,MAAM,UAAU,0FAUb,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnD,QAAA,MAAM,aAAa;;;8EAsBlB,CAAC;AAEF,MAAM,WAAW,UACb,SAAQ,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,EACnD,YAAY,CAAC,OAAO,aAAa,CAAC;CAAG;AAE7C,wBAAgB,KAAK,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,+BAOrE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,CAOnD;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { cn } from "../../lib/utils.js";
|
|
4
|
+
/* ────────────────────────────────────────────────────────────────────────
|
|
5
|
+
The nine.
|
|
6
|
+
|
|
7
|
+
This is the highest-leverage idea borrowed from Notion: there is no
|
|
8
|
+
colour picker. Nine desaturated pairs, each a tinted background with
|
|
9
|
+
same-hue ink. Because every pair is pre-harmonised at low chroma, a
|
|
10
|
+
board with forty tags on it still reads calm — and a user cannot
|
|
11
|
+
produce an ugly combination, because they cannot produce an arbitrary
|
|
12
|
+
one. Resist adding a tenth.
|
|
13
|
+
──────────────────────────────────────────────────────────────────────── */
|
|
14
|
+
export const TAG_COLORS = [
|
|
15
|
+
"gray",
|
|
16
|
+
"brown",
|
|
17
|
+
"orange",
|
|
18
|
+
"yellow",
|
|
19
|
+
"green",
|
|
20
|
+
"blue",
|
|
21
|
+
"purple",
|
|
22
|
+
"pink",
|
|
23
|
+
"red",
|
|
24
|
+
];
|
|
25
|
+
const badgeVariants = cva("inline-flex items-center gap-1 rounded-[3px] font-medium whitespace-nowrap [&_svg]:size-3 [&_svg]:shrink-0", {
|
|
26
|
+
variants: {
|
|
27
|
+
color: {
|
|
28
|
+
gray: "bg-tag-gray-bg text-tag-gray-ink",
|
|
29
|
+
brown: "bg-tag-brown-bg text-tag-brown-ink",
|
|
30
|
+
orange: "bg-tag-orange-bg text-tag-orange-ink",
|
|
31
|
+
yellow: "bg-tag-yellow-bg text-tag-yellow-ink",
|
|
32
|
+
green: "bg-tag-green-bg text-tag-green-ink",
|
|
33
|
+
blue: "bg-tag-blue-bg text-tag-blue-ink",
|
|
34
|
+
purple: "bg-tag-purple-bg text-tag-purple-ink",
|
|
35
|
+
pink: "bg-tag-pink-bg text-tag-pink-ink",
|
|
36
|
+
red: "bg-tag-red-bg text-tag-red-ink",
|
|
37
|
+
},
|
|
38
|
+
size: {
|
|
39
|
+
sm: "h-[18px] px-1.5 text-[11px]",
|
|
40
|
+
md: "h-5 px-2 text-caption",
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
defaultVariants: { color: "gray", size: "md" },
|
|
44
|
+
});
|
|
45
|
+
export function Badge({ className, color, size, ...props }) {
|
|
46
|
+
return (_jsx("span", { className: cn(badgeVariants({ color, size }), className), ...props }));
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Deterministically maps any string to one of the nine. Use it for tags,
|
|
50
|
+
* owners, labels — anything user-generated that needs a stable colour
|
|
51
|
+
* without anyone choosing one.
|
|
52
|
+
*/
|
|
53
|
+
export function tagColorFor(value) {
|
|
54
|
+
let hash = 0;
|
|
55
|
+
for (let i = 0; i < value.length; i++) {
|
|
56
|
+
hash = (hash << 5) - hash + value.charCodeAt(i);
|
|
57
|
+
hash |= 0;
|
|
58
|
+
}
|
|
59
|
+
return TAG_COLORS[Math.abs(hash) % TAG_COLORS.length];
|
|
60
|
+
}
|
|
61
|
+
export { badgeVariants };
|
|
62
|
+
//# sourceMappingURL=badge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge.js","sourceRoot":"","sources":["../../../src/components/ui/badge.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC;;;;;;;;;8EAS8E;AAE9E,MAAM,CAAC,MAAM,UAAU,GAAG;IACtB,MAAM;IACN,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,MAAM;IACN,QAAQ;IACR,MAAM;IACN,KAAK;CACC,CAAC;AAIX,MAAM,aAAa,GAAG,GAAG,CACrB,4GAA4G,EAC5G;IACI,QAAQ,EAAE;QACN,KAAK,EAAE;YACH,IAAI,EAAE,kCAAkC;YACxC,KAAK,EAAE,oCAAoC;YAC3C,MAAM,EAAE,sCAAsC;YAC9C,MAAM,EAAE,sCAAsC;YAC9C,KAAK,EAAE,oCAAoC;YAC3C,IAAI,EAAE,kCAAkC;YACxC,MAAM,EAAE,sCAAsC;YAC9C,IAAI,EAAE,kCAAkC;YACxC,GAAG,EAAE,gCAAgC;SACxC;QACD,IAAI,EAAE;YACF,EAAE,EAAE,6BAA6B;YACjC,EAAE,EAAE,uBAAuB;SAC9B;KACJ;IACD,eAAe,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE;CACjD,CACJ,CAAC;AAMF,MAAM,UAAU,KAAK,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,KAAK,EAAc;IAClE,OAAO,CACH,eACI,SAAS,EAAE,EAAE,CAAC,aAAa,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,CAAC,KACpD,KAAK,GACX,CACL,CAAC;AACN,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,KAAa;IACrC,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACpC,IAAI,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAChD,IAAI,IAAI,CAAC,CAAC;IACd,CAAC;IACD,OAAO,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;AAC1D,CAAC;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ElementType } from "react";
|
|
2
|
+
export type Crumb = {
|
|
3
|
+
title: string;
|
|
4
|
+
href?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function Breadcrumbs({ crumbs, link: Link }: {
|
|
7
|
+
crumbs: Crumb[];
|
|
8
|
+
link?: ElementType;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=breadcrumbs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breadcrumbs.d.ts","sourceRoot":"","sources":["../../../src/components/ui/breadcrumbs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,WAAW,EAAE,MAAM,OAAO,CAAC;AAEnD,MAAM,MAAM,KAAK,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAKrD,wBAAgB,WAAW,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,IAAU,EAAE,EAAE;IAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAAC,IAAI,CAAC,EAAE,WAAW,CAAA;CAAE,+BAiBhG"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment } from "react";
|
|
3
|
+
/* Where you are. A crumb with an href is a link; the last one usually has none.
|
|
4
|
+
Pass your router's link as `link` (next/link, react-router's Link); it gets
|
|
5
|
+
`href`, `className` and children. */
|
|
6
|
+
export function Breadcrumbs({ crumbs, link: Link = "a" }) {
|
|
7
|
+
return (_jsx("nav", { "aria-label": "Breadcrumb", className: "flex min-w-0 items-center text-sm", children: crumbs.map((crumb, i) => (_jsxs(Fragment, { children: [i > 0 && _jsx("span", { className: "px-0.5 text-ink-tertiary", children: "/" }), crumb.href ? (_jsx(Link, { href: crumb.href, className: "truncate rounded-control px-1.5 py-0.5 transition-colors duration-100 hover:bg-tint-hover", children: crumb.title })) : (_jsx("span", { className: "truncate px-1.5 py-0.5 text-ink-secondary", children: crumb.title }))] }, i))) }));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=breadcrumbs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breadcrumbs.js","sourceRoot":"","sources":["../../../src/components/ui/breadcrumbs.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAoB,MAAM,OAAO,CAAC;AAInD;;uCAEuC;AACvC,MAAM,UAAU,WAAW,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,GAAG,EAA2C;IAC7F,OAAO,CACH,4BAAgB,YAAY,EAAC,SAAS,EAAC,mCAAmC,YACrE,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,CACtB,MAAC,QAAQ,eACJ,CAAC,GAAG,CAAC,IAAI,eAAM,SAAS,EAAC,0BAA0B,kBAAS,EAC5D,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CACV,KAAC,IAAI,IAAC,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,SAAS,EAAC,2FAA2F,YACxH,KAAK,CAAC,KAAK,GACT,CACV,CAAC,CAAC,CAAC,CACA,eAAM,SAAS,EAAC,2CAA2C,YAAE,KAAK,CAAC,KAAK,GAAQ,CACnF,KARU,CAAC,CASL,CACd,CAAC,GACA,CACT,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import type { ComponentPropsWithoutRef } from "react";
|
|
3
|
+
declare const buttonVariants: (props?: ({
|
|
4
|
+
variant?: "link" | "danger" | "primary" | "secondary" | "ghost" | "subtle" | "danger-ghost" | null | undefined;
|
|
5
|
+
size?: "icon" | "sm" | "md" | "lg" | "icon-sm" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
export interface ButtonProps extends ComponentPropsWithoutRef<"button">, VariantProps<typeof buttonVariants> {
|
|
8
|
+
/** Render as the single child element instead of a <button>. */
|
|
9
|
+
asChild?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function Button({ className, variant, size, asChild, ...props }: ButtonProps): import("react").JSX.Element;
|
|
12
|
+
export { buttonVariants };
|
|
13
|
+
//# sourceMappingURL=button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/ui/button.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAOtD,QAAA,MAAM,cAAc;;;8EAoCnB,CAAC;AAEF,MAAM,WAAW,WACb,SAAQ,wBAAwB,CAAC,QAAQ,CAAC,EACtC,YAAY,CAAC,OAAO,cAAc,CAAC;IACvC,gEAAgE;IAChE,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,wBAAgB,MAAM,CAAC,EACnB,SAAS,EACT,OAAO,EACP,IAAI,EACJ,OAAe,EACf,GAAG,KAAK,EACX,EAAE,WAAW,+BAQb;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { cn } from "../../lib/utils.js";
|
|
6
|
+
/* Buttons are small (28–32px), lightly weighted and 4px-rounded. The
|
|
7
|
+
loudest thing a Notion button ever does is fill with accent blue, and
|
|
8
|
+
only one button per view earns that. Everything else is a tint. */
|
|
9
|
+
const buttonVariants = cva([
|
|
10
|
+
"inline-flex items-center justify-center gap-1.5 shrink-0",
|
|
11
|
+
"rounded-control font-medium whitespace-nowrap select-none",
|
|
12
|
+
"transition-[background-color,box-shadow,opacity] duration-100 ease-out-notion",
|
|
13
|
+
"disabled:pointer-events-none disabled:text-ink-disabled disabled:shadow-none",
|
|
14
|
+
"[&_svg]:shrink-0 [&_svg]:pointer-events-none",
|
|
15
|
+
], {
|
|
16
|
+
variants: {
|
|
17
|
+
variant: {
|
|
18
|
+
/** The one loud option. Max one per view. */
|
|
19
|
+
primary: "bg-accent text-accent-ink hover:bg-accent-hover disabled:bg-tint-active disabled:text-ink-disabled",
|
|
20
|
+
/** The workhorse: white, hairline ring, whisper of lift. */
|
|
21
|
+
secondary: "bg-surface text-ink shadow-xs hover:bg-tint-hover disabled:bg-surface",
|
|
22
|
+
/** Invisible until hovered — toolbars, row actions. */
|
|
23
|
+
ghost: "text-ink hover:bg-tint-hover",
|
|
24
|
+
/** Pre-tinted, for a secondary action that needs weight. */
|
|
25
|
+
subtle: "bg-tint-hover text-ink hover:bg-tint-active",
|
|
26
|
+
danger: "bg-danger text-white hover:bg-danger-hover",
|
|
27
|
+
"danger-ghost": "text-danger hover:bg-danger-tint disabled:text-ink-disabled",
|
|
28
|
+
link: "text-ink underline decoration-ink-tertiary underline-offset-2 hover:decoration-ink",
|
|
29
|
+
},
|
|
30
|
+
size: {
|
|
31
|
+
sm: "h-7 px-2 text-sm [&_svg]:size-3.5",
|
|
32
|
+
md: "h-8 px-3 text-sm [&_svg]:size-4",
|
|
33
|
+
lg: "h-10 px-4 text-body [&_svg]:size-4",
|
|
34
|
+
icon: "size-8 [&_svg]:size-4",
|
|
35
|
+
"icon-sm": "size-7 [&_svg]:size-3.5",
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
defaultVariants: { variant: "secondary", size: "md" },
|
|
39
|
+
});
|
|
40
|
+
export function Button({ className, variant, size, asChild = false, ...props }) {
|
|
41
|
+
const Comp = asChild ? Slot : "button";
|
|
42
|
+
return (_jsx(Comp, { className: cn(buttonVariants({ variant, size }), className), ...props }));
|
|
43
|
+
}
|
|
44
|
+
export { buttonVariants };
|
|
45
|
+
//# sourceMappingURL=button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../../src/components/ui/button.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC;;qEAEqE;AAErE,MAAM,cAAc,GAAG,GAAG,CACtB;IACI,0DAA0D;IAC1D,2DAA2D;IAC3D,+EAA+E;IAC/E,8EAA8E;IAC9E,8CAA8C;CACjD,EACD;IACI,QAAQ,EAAE;QACN,OAAO,EAAE;YACL,6CAA6C;YAC7C,OAAO,EACH,oGAAoG;YACxG,4DAA4D;YAC5D,SAAS,EACL,uEAAuE;YAC3E,uDAAuD;YACvD,KAAK,EAAE,8BAA8B;YACrC,4DAA4D;YAC5D,MAAM,EAAE,6CAA6C;YACrD,MAAM,EAAE,4CAA4C;YACpD,cAAc,EACV,6DAA6D;YACjE,IAAI,EAAE,oFAAoF;SAC7F;QACD,IAAI,EAAE;YACF,EAAE,EAAE,mCAAmC;YACvC,EAAE,EAAE,iCAAiC;YACrC,EAAE,EAAE,oCAAoC;YACxC,IAAI,EAAE,uBAAuB;YAC7B,SAAS,EAAE,yBAAyB;SACvC;KACJ;IACD,eAAe,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE;CACxD,CACJ,CAAC;AASF,MAAM,UAAU,MAAM,CAAC,EACnB,SAAS,EACT,OAAO,EACP,IAAI,EACJ,OAAO,GAAG,KAAK,EACf,GAAG,KAAK,EACE;IACV,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC;IACvC,OAAO,CACH,KAAC,IAAI,IACD,SAAS,EAAE,EAAE,CAAC,cAAc,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,CAAC,KACvD,KAAK,GACX,CACL,CAAC;AACN,CAAC;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type ComponentProps } from "react";
|
|
2
|
+
import { DayPicker } from "react-day-picker";
|
|
3
|
+
export declare function Calendar({ className, classNames, components, ...props }: ComponentProps<typeof DayPicker>): import("react").JSX.Element;
|
|
4
|
+
export declare function focusCalendarDay(event: Event): void;
|
|
5
|
+
//# sourceMappingURL=calendar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../src/components/ui/calendar.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAqB,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAkB,MAAM,kBAAkB,CAAC;AAQ7D,wBAAgB,QAAQ,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,OAAO,SAAS,CAAC,+BAuCzG;AA6CD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAGnD"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
4
|
+
import { useEffect, useRef } from "react";
|
|
5
|
+
import { DayPicker } from "react-day-picker";
|
|
6
|
+
import { cn } from "../../lib/utils.js";
|
|
7
|
+
/* A month of days, on react-day-picker: it supplies the grid, the keyboard and the
|
|
8
|
+
screen-reader labels; everything visible is here. Its own stylesheet is not
|
|
9
|
+
imported, so every part it draws has a class below.
|
|
10
|
+
|
|
11
|
+
The week starts on Monday. Pass `weekStartsOn={0}` for Sunday. */
|
|
12
|
+
export function Calendar({ className, classNames, components, ...props }) {
|
|
13
|
+
return (_jsx(DayPicker, { showOutsideDays: true,
|
|
14
|
+
// Always six rows, so the panel does not change height from month to month.
|
|
15
|
+
fixedWeeks: true, weekStartsOn: 1, className: cn("relative w-fit p-3 select-none", className), classNames: {
|
|
16
|
+
months: "flex flex-col gap-4 sm:flex-row",
|
|
17
|
+
month: "flex flex-col gap-2",
|
|
18
|
+
month_caption: "flex h-7 items-center justify-center px-8",
|
|
19
|
+
caption_label: "text-sm font-medium text-ink",
|
|
20
|
+
// Laid over the caption row; the buttons take the clicks, the gap between them does not.
|
|
21
|
+
nav: "absolute inset-x-3 top-3 flex h-7 items-center justify-between pointer-events-none",
|
|
22
|
+
button_previous: NAV_BUTTON,
|
|
23
|
+
button_next: NAV_BUTTON,
|
|
24
|
+
month_grid: "border-collapse",
|
|
25
|
+
weekday: "size-8 p-0 text-caption font-normal text-ink-tertiary",
|
|
26
|
+
day: "size-8 p-0 text-center",
|
|
27
|
+
range_start: "rounded-l-control bg-accent-tint",
|
|
28
|
+
range_middle: "bg-accent-tint",
|
|
29
|
+
range_end: "rounded-r-control bg-accent-tint",
|
|
30
|
+
hidden: "invisible",
|
|
31
|
+
...classNames,
|
|
32
|
+
}, components: {
|
|
33
|
+
Chevron: ({ orientation, className: chevronClass }) => orientation === "left" ? (_jsx(ChevronLeft, { className: cn("size-4", chevronClass) })) : (_jsx(ChevronRight, { className: cn("size-4", chevronClass) })),
|
|
34
|
+
DayButton: CalendarDayButton,
|
|
35
|
+
...components,
|
|
36
|
+
}, ...props }));
|
|
37
|
+
}
|
|
38
|
+
const NAV_BUTTON = "pointer-events-auto inline-flex size-7 items-center justify-center rounded-control text-ink-secondary transition-colors duration-100 hover:bg-tint-hover hover:text-ink aria-disabled:pointer-events-none aria-disabled:text-ink-disabled";
|
|
39
|
+
/* The day itself. The states are resolved here, in order, rather than as classes on
|
|
40
|
+
the cell, because several hold at once (today, outside the month, chosen) and the
|
|
41
|
+
last one named has to win whatever order the stylesheet was built in. */
|
|
42
|
+
function CalendarDayButton({ className, day: _day, modifiers, ...props }) {
|
|
43
|
+
const ref = useRef(null);
|
|
44
|
+
// The library moves focus by flag, not by calling focus, so arrow keys need this.
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
if (modifiers.focused)
|
|
47
|
+
ref.current?.focus();
|
|
48
|
+
}, [modifiers.focused]);
|
|
49
|
+
const inRange = modifiers.range_middle === true;
|
|
50
|
+
const chosen = modifiers.selected === true && !inRange;
|
|
51
|
+
return (_jsx("button", { ref: ref, type: "button", className: cn("inline-flex size-8 items-center justify-center rounded-control text-sm text-ink tabular-nums cursor-pointer", "transition-colors duration-75 hover:bg-tint-hover", modifiers.outside && "text-ink-tertiary", modifiers.today && "font-semibold shadow-[inset_0_0_0_1px_var(--hairline-strong)]", inRange && "rounded-none hover:bg-accent-tint", chosen && "bg-accent font-medium text-accent-ink shadow-none hover:bg-accent-hover", modifiers.disabled && "pointer-events-none text-ink-disabled shadow-none", className), ...props }));
|
|
52
|
+
}
|
|
53
|
+
/* For `onOpenAutoFocus` on a popover that holds a calendar: puts focus on the day
|
|
54
|
+
the arrow keys start from (the chosen one, or today) rather than on the first
|
|
55
|
+
thing in the panel, which is the previous-month arrow.
|
|
56
|
+
|
|
57
|
+
It has to happen here and not through the calendar's own `autoFocus`. Inside a
|
|
58
|
+
dialog that fires before the popover has taken over the dialog's focus trap, and
|
|
59
|
+
the dialog pulls focus straight back. */
|
|
60
|
+
export function focusCalendarDay(event) {
|
|
61
|
+
event.preventDefault();
|
|
62
|
+
event.currentTarget?.querySelector('td button[tabindex="0"]')?.focus();
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=calendar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar.js","sourceRoot":"","sources":["../../../src/components/ui/calendar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAuB,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAkB,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC;;;;oEAIoE;AACpE,MAAM,UAAU,QAAQ,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,KAAK,EAAoC;IACtG,OAAO,CACH,KAAC,SAAS,IACN,eAAe;QACf,4EAA4E;QAC5E,UAAU,QACV,YAAY,EAAE,CAAC,EACf,SA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AAC,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;IAExB,MAAM,OAAO,GAAG,SAAS,CAAC,YAAY,KAAK,IAAI,CAAC;IAChD,MAAM,MAAM,GAAG,SAAS,CAAC,QAAQ,KAAK,IAAI,IAAI,CAAC,OAAO,CAAC;IAEvD,OAAO,CACH,iBACI,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,EAAE,CACT,6GAA6G,EAC7G,mDAAmD,EACnD,SAAS,CAAC,OAAO,IAAI,mBAAmB,EACxC,SAAS,CAAC,KAAK,IAAI,+DAA+D,EAClF,OAAO,IAAI,mCAAmC,EAC9C,MAAM,IAAI,yEAAyE,EACnF,SAAS,CAAC,QAAQ,IAAI,mDAAmD,EACzE,SAAS,CACZ,KACG,KAAK,GACX,CACL,CAAC;AACN,CAAC;AAED;;;;;;2CAM2C;AAC3C,MAAM,UAAU,gBAAgB,CAAC,KAAY;IACzC,KAAK,CAAC,cAAc,EAAE,CAAC;IACtB,KAAK,CAAC,aAAoC,EAAE,aAAa,CAAc,yBAAyB,CAAC,EAAE,KAAK,EAAE,CAAC;AAChH,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import type { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
3
|
+
declare const calloutVariants: (props?: ({
|
|
4
|
+
color?: "blue" | "brown" | "gray" | "green" | "orange" | "pink" | "purple" | "red" | "yellow" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
export interface CalloutProps extends Omit<ComponentPropsWithoutRef<"div">, "color" | "title">, VariantProps<typeof calloutVariants> {
|
|
7
|
+
/** An emoji string or a lucide icon element. */
|
|
8
|
+
icon?: ReactNode;
|
|
9
|
+
title?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export declare function Callout({ className, color, icon, title, children, ...props }: CalloutProps): import("react").JSX.Element;
|
|
12
|
+
export { calloutVariants };
|
|
13
|
+
//# sourceMappingURL=callout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callout.d.ts","sourceRoot":"","sources":["../../../src/components/ui/callout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,wBAAwB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOjE,QAAA,MAAM,eAAe;;8EAkBpB,CAAC;AAEF,MAAM,WAAW,YACb,SAAQ,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,EAC5D,YAAY,CAAC,OAAO,eAAe,CAAC;IACxC,gDAAgD;IAChD,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,OAAO,CAAC,EACpB,SAAS,EACT,KAAK,EACL,IAAW,EACX,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACX,EAAE,YAAY,+BAgBd;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { cn } from "../../lib/utils.js";
|
|
4
|
+
/* Notion's callout block. A tinted panel with an emoji or icon in the
|
|
5
|
+
gutter. It reuses the nine so a callout never introduces a new colour
|
|
6
|
+
into the page — it just borrows one. */
|
|
7
|
+
const calloutVariants = cva("flex gap-3 rounded-surface p-4 text-sm leading-[1.6]", {
|
|
8
|
+
variants: {
|
|
9
|
+
color: {
|
|
10
|
+
gray: "bg-tag-gray-bg text-ink",
|
|
11
|
+
brown: "bg-tag-brown-bg text-ink",
|
|
12
|
+
orange: "bg-tag-orange-bg text-ink",
|
|
13
|
+
yellow: "bg-tag-yellow-bg text-ink",
|
|
14
|
+
green: "bg-tag-green-bg text-ink",
|
|
15
|
+
blue: "bg-tag-blue-bg text-ink",
|
|
16
|
+
purple: "bg-tag-purple-bg text-ink",
|
|
17
|
+
pink: "bg-tag-pink-bg text-ink",
|
|
18
|
+
red: "bg-tag-red-bg text-ink",
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
defaultVariants: { color: "gray" },
|
|
22
|
+
});
|
|
23
|
+
export function Callout({ className, color, icon = "💡", title, children, ...props }) {
|
|
24
|
+
return (_jsxs("div", { className: cn(calloutVariants({ color }), className), ...props, children: [_jsx("span", { className: "flex-shrink-0 mt-px text-base leading-[1.4] [&_svg]:size-4 [&_svg]:mt-0.5", children: icon }), _jsxs("div", { className: "min-w-0", children: [title && (_jsx("p", { className: "mb-1 font-semibold text-ink", children: title })), _jsx("div", { className: "text-ink-secondary [&_p+p]:mt-2", children: children })] })] }));
|
|
25
|
+
}
|
|
26
|
+
export { calloutVariants };
|
|
27
|
+
//# sourceMappingURL=callout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callout.js","sourceRoot":"","sources":["../../../src/components/ui/callout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC;;0CAE0C;AAE1C,MAAM,eAAe,GAAG,GAAG,CACvB,sDAAsD,EACtD;IACI,QAAQ,EAAE;QACN,KAAK,EAAE;YACH,IAAI,EAAE,yBAAyB;YAC/B,KAAK,EAAE,0BAA0B;YACjC,MAAM,EAAE,2BAA2B;YACnC,MAAM,EAAE,2BAA2B;YACnC,KAAK,EAAE,0BAA0B;YACjC,IAAI,EAAE,yBAAyB;YAC/B,MAAM,EAAE,2BAA2B;YACnC,IAAI,EAAE,yBAAyB;YAC/B,GAAG,EAAE,wBAAwB;SAChC;KACJ;IACD,eAAe,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;CACrC,CACJ,CAAC;AAUF,MAAM,UAAU,OAAO,CAAC,EACpB,SAAS,EACT,KAAK,EACL,IAAI,GAAG,IAAI,EACX,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACG;IACX,OAAO,CACH,eAAK,SAAS,EAAE,EAAE,CAAC,eAAe,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,SAAS,CAAC,KAAM,KAAK,aAChE,eAAM,SAAS,EAAC,2EAA2E,YACtF,IAAI,GACF,EACP,eAAK,SAAS,EAAC,SAAS,aACnB,KAAK,IAAI,CACN,YAAG,SAAS,EAAC,6BAA6B,YAAE,KAAK,GAAK,CACzD,EACD,cAAK,SAAS,EAAC,iCAAiC,YAC3C,QAAQ,GACP,IACJ,IACJ,CACT,CAAC;AACN,CAAC;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef } from "react";
|
|
2
|
+
export interface CardProps extends ComponentPropsWithoutRef<"div"> {
|
|
3
|
+
interactive?: boolean;
|
|
4
|
+
/** Sit flush on a sunken surface with no lift of its own. */
|
|
5
|
+
flat?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function Card({ className, interactive, flat, ...props }: CardProps): import("react").JSX.Element;
|
|
8
|
+
export declare function CardHeader({ className, ...props }: ComponentPropsWithoutRef<"div">): import("react").JSX.Element;
|
|
9
|
+
export declare function CardTitle({ className, ...props }: ComponentPropsWithoutRef<"h3">): import("react").JSX.Element;
|
|
10
|
+
export declare function CardDescription({ className, ...props }: ComponentPropsWithoutRef<"p">): import("react").JSX.Element;
|
|
11
|
+
export declare function CardContent({ className, ...props }: ComponentPropsWithoutRef<"div">): import("react").JSX.Element;
|
|
12
|
+
export declare function CardFooter({ className, ...props }: ComponentPropsWithoutRef<"div">): import("react").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../src/components/ui/card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAOtD,MAAM,WAAW,SAAU,SAAQ,wBAAwB,CAAC,KAAK,CAAC;IAC9D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,6DAA6D;IAC7D,IAAI,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,IAAI,CAAC,EACjB,SAAS,EACT,WAAW,EACX,IAAI,EACJ,GAAG,KAAK,EACX,EAAE,SAAS,+BAkBX;AAED,wBAAgB,UAAU,CAAC,EACvB,SAAS,EACT,GAAG,KAAK,EACX,EAAE,wBAAwB,CAAC,KAAK,CAAC,+BAEjC;AAED,wBAAgB,SAAS,CAAC,EACtB,SAAS,EACT,GAAG,KAAK,EACX,EAAE,wBAAwB,CAAC,IAAI,CAAC,+BAOhC;AAED,wBAAgB,eAAe,CAAC,EAC5B,SAAS,EACT,GAAG,KAAK,EACX,EAAE,wBAAwB,CAAC,GAAG,CAAC,+BAO/B;AAED,wBAAgB,WAAW,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACX,EAAE,wBAAwB,CAAC,KAAK,CAAC,+BAEjC;AAED,wBAAgB,UAAU,CAAC,EACvB,SAAS,EACT,GAAG,KAAK,EACX,EAAE,wBAAwB,CAAC,KAAK,CAAC,+BAUjC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../lib/utils.js";
|
|
3
|
+
export function Card({ className, interactive, flat, ...props }) {
|
|
4
|
+
return (_jsx("div", { className: cn("bg-surface-raised rounded-surface overflow-hidden", flat
|
|
5
|
+
? "border border-hairline"
|
|
6
|
+
: "shadow-sm", interactive && [
|
|
7
|
+
"transition-[box-shadow,transform] duration-150 ease-out-notion",
|
|
8
|
+
"hover:shadow-md hover:-translate-y-px cursor-pointer",
|
|
9
|
+
"active:translate-y-0 active:shadow-sm",
|
|
10
|
+
], className), ...props }));
|
|
11
|
+
}
|
|
12
|
+
export function CardHeader({ className, ...props }) {
|
|
13
|
+
return _jsx("div", { className: cn("px-4 pt-4 pb-0", className), ...props });
|
|
14
|
+
}
|
|
15
|
+
export function CardTitle({ className, ...props }) {
|
|
16
|
+
return (_jsx("h3", { className: cn("font-semibold text-ink text-h3 my-0", className), ...props }));
|
|
17
|
+
}
|
|
18
|
+
export function CardDescription({ className, ...props }) {
|
|
19
|
+
return (_jsx("p", { className: cn("mt-1 text-ink-secondary text-sm", className), ...props }));
|
|
20
|
+
}
|
|
21
|
+
export function CardContent({ className, ...props }) {
|
|
22
|
+
return _jsx("div", { className: cn("p-4", className), ...props });
|
|
23
|
+
}
|
|
24
|
+
export function CardFooter({ className, ...props }) {
|
|
25
|
+
return (_jsx("div", { className: cn("flex items-center gap-2 px-4 py-3 border-hairline border-t", className), ...props }));
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.js","sourceRoot":"","sources":["../../../src/components/ui/card.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAYxC,MAAM,UAAU,IAAI,CAAC,EACjB,SAAS,EACT,WAAW,EACX,IAAI,EACJ,GAAG,KAAK,EACA;IACR,OAAO,CACH,cACI,SAAS,EAAE,EAAE,CACT,mDAAmD,EACnD,IAAI;YACA,CAAC,CAAC,wBAAwB;YAC1B,CAAC,CAAC,WAAW,EACjB,WAAW,IAAI;YACX,gEAAgE;YAChE,sDAAsD;YACtD,uCAAuC;SAC1C,EACD,SAAS,CACZ,KACG,KAAK,GACX,CACL,CAAC;AACN,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,EACvB,SAAS,EACT,GAAG,KAAK,EACsB;IAC9B,OAAO,cAAK,SAAS,EAAE,EAAE,CAAC,gBAAgB,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAC;AAC1E,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,EACtB,SAAS,EACT,GAAG,KAAK,EACqB;IAC7B,OAAO,CACH,aACI,SAAS,EAAE,EAAE,CAAC,qCAAqC,EAAE,SAAS,CAAC,KAC3D,KAAK,GACX,CACL,CAAC;AACN,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,EAC5B,SAAS,EACT,GAAG,KAAK,EACoB;IAC5B,OAAO,CACH,YACI,SAAS,EAAE,EAAE,CAAC,iCAAiC,EAAE,SAAS,CAAC,KACvD,KAAK,GACX,CACL,CAAC;AACN,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACsB;IAC9B,OAAO,cAAK,SAAS,EAAE,EAAE,CAAC,KAAK,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAC;AAC/D,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,EACvB,SAAS,EACT,GAAG,KAAK,EACsB;IAC9B,OAAO,CACH,cACI,SAAS,EAAE,EAAE,CACT,4DAA4D,EAC5D,SAAS,CACZ,KACG,KAAK,GACX,CACL,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/ui/checkbox.tsx"],"names":[],"mappings":"AAOA,wBAAgB,QAAQ,CAAC,EACrB,OAAO,EACP,eAAe,EACf,SAAS,GACZ,EAAE;IACC,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,+BAgBA"}
|