@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,81 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
4
|
+
import { ChevronLeft, ChevronRight, X } from "lucide-react";
|
|
5
|
+
import { useEffect, useRef } from "react";
|
|
6
|
+
import { Button } from "./button.js";
|
|
7
|
+
import { cn } from "../../lib/utils.js";
|
|
8
|
+
/* One picture at a time, as large as the room allows, with a way to the next:
|
|
9
|
+
a carousel that is also a lightbox.
|
|
10
|
+
|
|
11
|
+
- Left and right arrows step; each picture slides in from the side it came
|
|
12
|
+
from. Its neighbours are fetched ahead.
|
|
13
|
+
- The picture is sized with container units from its aspect ratio, so it
|
|
14
|
+
fills the space both ways without distorting and before it has loaded.
|
|
15
|
+
- `toolbar` goes at the right of the header, `panel` beside the picture.
|
|
16
|
+
The panel slides open and shut like a sidebar; you own `panelOpen`.
|
|
17
|
+
- `transitionName` puts a view-transition name on the picture, so opening
|
|
18
|
+
and closing can grow it out of, and shrink it into, the element it was
|
|
19
|
+
opened from (see `useSharedTransition`).
|
|
20
|
+
- Pass `modal={false}` and a `className` with an inset to lay it beside a
|
|
21
|
+
sidebar that should stay usable; keys typed into a field elsewhere are
|
|
22
|
+
ignored either way. */
|
|
23
|
+
export function ImageViewer({ items, id, onShow, onClose, title, toolbar, panel, panelOpen = false, overlay, modal = true, transitionName, filter, className, }) {
|
|
24
|
+
const index = items.findIndex((item) => item.id === id);
|
|
25
|
+
const item = items[index];
|
|
26
|
+
const before = index > 0 ? items[index - 1] : undefined;
|
|
27
|
+
const after = index !== -1 ? items[index + 1] : undefined;
|
|
28
|
+
// Which way the last step went, so the new picture arrives from that side.
|
|
29
|
+
const last = useRef(index);
|
|
30
|
+
const from = index >= last.current ? 1 : -1;
|
|
31
|
+
const stepped = last.current !== index;
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
last.current = index;
|
|
34
|
+
}, [index]);
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
const onKey = (event) => {
|
|
37
|
+
const target = event.target;
|
|
38
|
+
// A slider is not typing: the arrows still step from it.
|
|
39
|
+
const slider = target instanceof HTMLInputElement && target.type === "range";
|
|
40
|
+
if (target !== null && !slider && (target.isContentEditable || /^(INPUT|TEXTAREA|SELECT)$/.test(target.tagName)))
|
|
41
|
+
return;
|
|
42
|
+
if (event.metaKey || event.ctrlKey || event.altKey)
|
|
43
|
+
return;
|
|
44
|
+
if (event.key === "ArrowLeft" && before !== undefined)
|
|
45
|
+
onShow(before.id);
|
|
46
|
+
else if (event.key === "ArrowRight" && after !== undefined)
|
|
47
|
+
onShow(after.id);
|
|
48
|
+
};
|
|
49
|
+
window.addEventListener("keydown", onKey);
|
|
50
|
+
return () => window.removeEventListener("keydown", onKey);
|
|
51
|
+
});
|
|
52
|
+
// The neighbours are the likeliest next request; have them in the cache.
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
for (const next of [after, before])
|
|
55
|
+
if (next !== undefined)
|
|
56
|
+
new window.Image().src = next.src;
|
|
57
|
+
}, [before, after]);
|
|
58
|
+
const arrow = "affordance absolute top-1/2 -translate-y-1/2 rounded-full bg-surface-overlay shadow-sm hover:bg-surface-overlay max-md:opacity-100";
|
|
59
|
+
return (_jsx(DialogPrimitive.Root, { open: true, modal: modal, onOpenChange: (open) => !open && onClose(), children: _jsx(DialogPrimitive.Portal, { children: _jsxs(DialogPrimitive.Content, { "aria-describedby": undefined,
|
|
60
|
+
// Focus the sheet, not its first button: a focused button shows its
|
|
61
|
+
// tooltip, and the picture should be all there is to look at.
|
|
62
|
+
onOpenAutoFocus: (event) => {
|
|
63
|
+
event.preventDefault();
|
|
64
|
+
event.currentTarget.focus();
|
|
65
|
+
},
|
|
66
|
+
// Not modal means a sidebar, a menu or a tray outside it may be
|
|
67
|
+
// used; using them must not close it.
|
|
68
|
+
onInteractOutside: (event) => !modal && event.preventDefault(), className: cn("fixed inset-0 z-30 flex flex-col bg-surface text-ink outline-none", className), children: [_jsx(DialogPrimitive.Title, { className: "sr-only", children: title ?? item?.alt ?? "Picture" }), _jsxs("header", { className: "flex h-12 shrink-0 items-center gap-1 px-2", children: [_jsx(Button, { variant: "ghost", size: "icon", "aria-label": "Close", onClick: onClose, children: _jsx(X, {}) }), _jsx("span", { className: "min-w-0 flex-1 truncate px-1 text-sm text-ink-secondary tabular-nums", children: index !== -1 && `${(index + 1).toLocaleString()} of ${items.length.toLocaleString()}` }), toolbar] }), _jsxs("div", { className: "flex min-h-0 flex-1 flex-col md:flex-row", children: [_jsxs("div", { className: "group relative flex min-h-0 min-w-0 flex-1 items-center justify-center p-3 [container-type:size] md:p-6", children: [item !== undefined && (_jsx("img", { src: item.src, alt: item.alt, style: {
|
|
69
|
+
width: `min(100cqw, calc(100cqh * ${item.aspect}))`,
|
|
70
|
+
aspectRatio: item.aspect,
|
|
71
|
+
backgroundImage: item.placeholder !== undefined ? `url(${item.placeholder})` : undefined,
|
|
72
|
+
backgroundSize: "cover",
|
|
73
|
+
viewTransitionName: transitionName,
|
|
74
|
+
filter: filter ?? "none",
|
|
75
|
+
"--from": from,
|
|
76
|
+
},
|
|
77
|
+
// Only a step slides in. The first picture may arrive by a
|
|
78
|
+
// view transition, and must not also slide.
|
|
79
|
+
className: cn("rounded-[6px] shadow-md transition-[filter] duration-150 ease-out-notion", stepped && "animate-step-in") }, item.id)), overlay, before !== undefined && (_jsx(Button, { variant: "subtle", size: "icon", "aria-label": "Previous", onClick: () => onShow(before.id), className: cn(arrow, "left-3"), children: _jsx(ChevronLeft, {}) })), after !== undefined && (_jsx(Button, { variant: "subtle", size: "icon", "aria-label": "Next", onClick: () => onShow(after.id), className: cn(arrow, "right-3"), children: _jsx(ChevronRight, {}) }))] }), panel !== undefined && (_jsx("aside", { inert: !panelOpen, className: cn("shrink-0 overflow-hidden bg-surface-sunken transition-[width,max-height] duration-150 ease-out-notion", "max-md:shadow-[inset_0_1px_0_var(--hairline)] md:shadow-[inset_1px_0_0_var(--hairline)]", panelOpen ? "max-md:max-h-[46dvh] md:w-80" : "max-md:max-h-0 md:w-0"), children: _jsx("div", { className: "h-full overflow-y-auto md:w-80", children: panel }) }))] })] }) }) }));
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=image-viewer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-viewer.js","sourceRoot":"","sources":["../../../src/components/ui/image-viewer.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,YAAY,EA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GD,cAAK,SAAS,EAAC,gCAAgC,YAAE,KAAK,GAAO,GACzD,CACX,IACC,IACgB,GACL,GACN,CAC1B,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef } from "react";
|
|
2
|
+
export declare function Image({ src, alt, placeholder, aspect, fit, className, imgClassName, style, onLoad, ...props }: Omit<ComponentPropsWithoutRef<"img">, "placeholder"> & {
|
|
3
|
+
/** A very small version of the same picture, shown blurred while the real one loads. */
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
/** Width over height. */
|
|
6
|
+
aspect?: number;
|
|
7
|
+
fit?: "cover" | "contain";
|
|
8
|
+
/** Extra classes for the <img> itself; `className` goes on the box. */
|
|
9
|
+
imgClassName?: string;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=image.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../src/components/ui/image.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,wBAAwB,EAAsB,MAAM,OAAO,CAAC;AAapF,wBAAgB,KAAK,CAAC,EAClB,GAAG,EACH,GAAG,EACH,WAAW,EACX,MAAM,EACN,GAAa,EACb,SAAS,EACT,YAAY,EACZ,KAAK,EACL,MAAM,EACN,GAAG,KAAK,EACX,EAAE,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,aAAa,CAAC,GAAG;IACtD,wFAAwF;IACxF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yBAAyB;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1B,uEAAuE;IACvE,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB,+BA6DA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { ImageOff } from "lucide-react";
|
|
5
|
+
import { cn } from "../../lib/utils.js";
|
|
6
|
+
/* An image that arrives gracefully. Until it has loaded the box holds its
|
|
7
|
+
shape and shows a blurred, tiny stand-in (or just the sunken surface);
|
|
8
|
+
then the real picture fades and settles in over it.
|
|
9
|
+
|
|
10
|
+
One already in the browser's cache is shown at once: scrolling back to
|
|
11
|
+
images already seen must not replay the fade.
|
|
12
|
+
|
|
13
|
+
Give it `aspect` (width over height) whenever it is known, so nothing below
|
|
14
|
+
it moves when it loads. */
|
|
15
|
+
export function Image({ src, alt, placeholder, aspect, fit = "cover", className, imgClassName, style, onLoad, ...props }) {
|
|
16
|
+
const [loaded, setLoaded] = useState(false);
|
|
17
|
+
// A picture on someone else's site can vanish; say so rather than leave an empty box.
|
|
18
|
+
const [failed, setFailed] = useState(null);
|
|
19
|
+
if (failed !== null && failed === src) {
|
|
20
|
+
return (_jsxs("span", { role: "img", "aria-label": alt ? `${alt} (could not be loaded)` : "A picture that could not be loaded", className: cn("@container flex flex-col items-center justify-center gap-1.5 bg-surface-sunken p-1 text-center text-caption text-ink-tertiary", className), style: { ...(aspect !== undefined ? { aspectRatio: aspect } : null), ...style }, children: [_jsx(ImageOff, { className: "size-5 shrink-0" }), _jsx("span", { className: "hidden px-2 @min-[9rem]:inline", children: "This picture couldn't be loaded" })] }));
|
|
21
|
+
}
|
|
22
|
+
return (_jsxs("span", { className: cn("relative block overflow-hidden bg-surface-sunken", className), style: { ...(aspect !== undefined ? { aspectRatio: aspect } : null), ...style }, children: [placeholder !== undefined && (
|
|
23
|
+
// Scaled up a touch so the blur's soft edge falls outside the box.
|
|
24
|
+
_jsx("img", { src: placeholder, alt: "", "aria-hidden": true, draggable: false, className: cn("absolute inset-0 h-full w-full scale-110 blur-lg transition-opacity duration-300", fit === "cover" ? "object-cover" : "object-contain", loaded && "opacity-0") })), _jsx("img", { ref: (img) => {
|
|
25
|
+
if (img?.complete && img.naturalWidth > 0)
|
|
26
|
+
setLoaded(true);
|
|
27
|
+
}, src: src, alt: alt, decoding: "async", onLoad: (event) => {
|
|
28
|
+
setLoaded(true);
|
|
29
|
+
onLoad?.(event);
|
|
30
|
+
}, onError: () => setFailed(typeof src === "string" ? src : null), className: cn("relative h-full w-full transition-[opacity,scale,filter] duration-300 ease-out-notion", fit === "cover" ? "object-cover" : "object-contain", loaded ? "opacity-100" : "scale-[1.02] opacity-0", imgClassName), ...props })] }));
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=image.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image.js","sourceRoot":"","sources":["../../../src/components/ui/image.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,QAAQ,EAAqD,MAAM,OAAO,CAAC;AACpF,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC;;;;;;;;6BAQ6B;AAC7B,MAAM,UAAU,KAAK,CAAC,EAClB,GAAG,EACH,GAAG,EACH,WAAW,EACX,MAAM,EACN,GAAG,GAAG,OAAO,EACb,SAAS,EACT,YAAY,EACZ,KAAK,EACL,MAAM,EACN,GAAG,KAAK,EASX;IACG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC5C,sFAAsF;IACtF,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAE1D,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;QACpC,OAAO,CACH,gBACI,IAAI,EAAC,KAAK,gBACE,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,wBAAwB,CAAC,CAAC,CAAC,oCAAoC,EACvF,SAAS,EAAE,EAAE,CAAC,+HAA+H,EAAE,SAAS,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Q,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAC9D,SAAS,EAAE,EAAE,CACT,uFAAuF,EACvF,GAAG,KAAK,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,gBAAgB,EACnD,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,wBAAwB,EACjD,YAAY,CACf,KACG,KAAK,GACX,IACC,CACV,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export { Button, buttonVariants, type ButtonProps } from "./button.js";
|
|
2
|
+
export { Badge, TAG_COLORS, tagColorFor, type TagColor } from "./badge.js";
|
|
3
|
+
export { Callout } from "./callout.js";
|
|
4
|
+
export { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter, } from "./card.js";
|
|
5
|
+
export { Dialog, DialogTrigger, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogBody, DialogFooter, DialogClose, } from "./dialog.js";
|
|
6
|
+
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, } from "./dropdown-menu.js";
|
|
7
|
+
export { Input, Textarea, Label, Field } from "./input.js";
|
|
8
|
+
export { Separator } from "./separator.js";
|
|
9
|
+
export { Tooltip, TooltipProvider, TooltipRoot, TooltipTrigger, TooltipContent, } from "./tooltip.js";
|
|
10
|
+
export { Heading, Text, Code, Kbd, Prose } from "./typography.js";
|
|
11
|
+
export { ThemeToggle } from "./theme-toggle.js";
|
|
12
|
+
export { MacCard, MacWindowHeader } from "./mac-card.js";
|
|
13
|
+
export { DropdownMenuRadioGroup, DropdownMenuRadioItem } from "./dropdown-menu.js";
|
|
14
|
+
export { Checkbox } from "./checkbox.js";
|
|
15
|
+
export { SelectMenu } from "./select-menu.js";
|
|
16
|
+
export { AccentPicker } from "./accent-picker.js";
|
|
17
|
+
export { Property, PropertyList, QuietInput, NumberInput, quietField } from "./property.js";
|
|
18
|
+
export { StatTile } from "./stat-tile.js";
|
|
19
|
+
export { Progress } from "./progress.js";
|
|
20
|
+
export { Table, Th, Td, ClickableRow } from "./table.js";
|
|
21
|
+
export { Breadcrumbs, type Crumb } from "./breadcrumbs.js";
|
|
22
|
+
export { NavTree, type NavNode } from "./nav-tree.js";
|
|
23
|
+
export { AppShell, SidebarFrame, SidebarSection, type ShellControls } from "./app-shell.js";
|
|
24
|
+
export { EditableText } from "./editable-text.js";
|
|
25
|
+
export { CommandMenu, type Command } from "./command-menu.js";
|
|
26
|
+
export { HandleRow, type DropSide } from "./handle-row.js";
|
|
27
|
+
export { toggleSidebar } from "./app-shell.js";
|
|
28
|
+
export { Image } from "./image.js";
|
|
29
|
+
export { ImageCard, ImageCardButton, ImageCardBadge } from "./image-card.js";
|
|
30
|
+
export { ImageViewer, type ViewerItem } from "./image-viewer.js";
|
|
31
|
+
export { Stepper, StepDialog } from "./step-dialog.js";
|
|
32
|
+
export { SelectionBar } from "./selection-bar.js";
|
|
33
|
+
export { Segmented } from "./segmented.js";
|
|
34
|
+
export { Page, PageHeader } from "./page.js";
|
|
35
|
+
export { FilePreview } from "./file-preview.js";
|
|
36
|
+
export { FileDropArea, FileUploader } from "./file-uploader.js";
|
|
37
|
+
export { Popover, PopoverTrigger, PopoverAnchor, PopoverClose, PopoverContent } from "./popover.js";
|
|
38
|
+
export { FieldButton, type FieldButtonProps } from "./field-button.js";
|
|
39
|
+
export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectItem, SelectLabel, SelectSeparator } from "./select.js";
|
|
40
|
+
export { Calendar, focusCalendarDay } from "./calendar.js";
|
|
41
|
+
export { DatePicker, DateRangePicker, type DatePickerProps, type DateRangePickerProps, type DateRange } from "./date-picker.js";
|
|
42
|
+
export { TimePicker, TimeColumns, type TimePickerProps } from "./time-picker.js";
|
|
43
|
+
export { DateTimePicker, type DateTimePickerProps } from "./date-time-picker.js";
|
|
44
|
+
export { ImageBlock, MIN_IMAGE_WIDTH } from "./image-block.js";
|
|
45
|
+
export { VideoBlock } from "./video-block.js";
|
|
46
|
+
export { LinkBlock } from "./link-block.js";
|
|
47
|
+
export { AddressField } from "./address-field.js";
|
|
48
|
+
export { Spotlight, useSpotlightShortcut, type SpotlightItem } from "./spotlight.js";
|
|
49
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ui/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EACH,IAAI,EACJ,UAAU,EACV,SAAS,EACT,eAAe,EACf,WAAW,EACX,UAAU,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EACH,MAAM,EACN,aAAa,EACb,aAAa,EACb,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,WAAW,GACd,MAAM,cAAc,CAAC;AACtB,OAAO,EACH,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,EACxB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,GACzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EACH,OAAO,EACP,eAAe,EACf,WAAW,EACX,cAA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B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export { Button, buttonVariants } from "./button.js";
|
|
2
|
+
export { Badge, TAG_COLORS, tagColorFor } from "./badge.js";
|
|
3
|
+
export { Callout } from "./callout.js";
|
|
4
|
+
export { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter, } from "./card.js";
|
|
5
|
+
export { Dialog, DialogTrigger, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogBody, DialogFooter, DialogClose, } from "./dialog.js";
|
|
6
|
+
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, } from "./dropdown-menu.js";
|
|
7
|
+
export { Input, Textarea, Label, Field } from "./input.js";
|
|
8
|
+
export { Separator } from "./separator.js";
|
|
9
|
+
export { Tooltip, TooltipProvider, TooltipRoot, TooltipTrigger, TooltipContent, } from "./tooltip.js";
|
|
10
|
+
export { Heading, Text, Code, Kbd, Prose } from "./typography.js";
|
|
11
|
+
export { ThemeToggle } from "./theme-toggle.js";
|
|
12
|
+
export { MacCard, MacWindowHeader } from "./mac-card.js";
|
|
13
|
+
export { DropdownMenuRadioGroup, DropdownMenuRadioItem } from "./dropdown-menu.js";
|
|
14
|
+
export { Checkbox } from "./checkbox.js";
|
|
15
|
+
export { SelectMenu } from "./select-menu.js";
|
|
16
|
+
export { AccentPicker } from "./accent-picker.js";
|
|
17
|
+
export { Property, PropertyList, QuietInput, NumberInput, quietField } from "./property.js";
|
|
18
|
+
export { StatTile } from "./stat-tile.js";
|
|
19
|
+
export { Progress } from "./progress.js";
|
|
20
|
+
export { Table, Th, Td, ClickableRow } from "./table.js";
|
|
21
|
+
export { Breadcrumbs } from "./breadcrumbs.js";
|
|
22
|
+
export { NavTree } from "./nav-tree.js";
|
|
23
|
+
export { AppShell, SidebarFrame, SidebarSection } from "./app-shell.js";
|
|
24
|
+
export { EditableText } from "./editable-text.js";
|
|
25
|
+
export { CommandMenu } from "./command-menu.js";
|
|
26
|
+
export { HandleRow } from "./handle-row.js";
|
|
27
|
+
export { toggleSidebar } from "./app-shell.js";
|
|
28
|
+
export { Image } from "./image.js";
|
|
29
|
+
export { ImageCard, ImageCardButton, ImageCardBadge } from "./image-card.js";
|
|
30
|
+
export { ImageViewer } from "./image-viewer.js";
|
|
31
|
+
export { Stepper, StepDialog } from "./step-dialog.js";
|
|
32
|
+
export { SelectionBar } from "./selection-bar.js";
|
|
33
|
+
export { Segmented } from "./segmented.js";
|
|
34
|
+
export { Page, PageHeader } from "./page.js";
|
|
35
|
+
export { FilePreview } from "./file-preview.js";
|
|
36
|
+
export { FileDropArea, FileUploader } from "./file-uploader.js";
|
|
37
|
+
export { Popover, PopoverTrigger, PopoverAnchor, PopoverClose, PopoverContent } from "./popover.js";
|
|
38
|
+
export { FieldButton } from "./field-button.js";
|
|
39
|
+
export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectItem, SelectLabel, SelectSeparator } from "./select.js";
|
|
40
|
+
export { Calendar, focusCalendarDay } from "./calendar.js";
|
|
41
|
+
export { DatePicker, DateRangePicker } from "./date-picker.js";
|
|
42
|
+
export { TimePicker, TimeColumns } from "./time-picker.js";
|
|
43
|
+
export { DateTimePicker } from "./date-time-picker.js";
|
|
44
|
+
export { ImageBlock, MIN_IMAGE_WIDTH } from "./image-block.js";
|
|
45
|
+
export { VideoBlock } from "./video-block.js";
|
|
46
|
+
export { LinkBlock } from "./link-block.js";
|
|
47
|
+
export { AddressField } from "./address-field.js";
|
|
48
|
+
export { Spotlight, useSpotlightShortcut } from "./spotlight.js";
|
|
49
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ui/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAoB,MAAM,aAAc,CAAC;AACxE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAiB,MAAM,YAAa,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,cAAe,CAAC;AACxC,OAAO,EACH,IAAI,EACJ,UAAU,EACV,SAAS,EACT,eAAe,EACf,WAAW,EACX,UAAU,GACb,MAAM,WAAY,CAAC;AACpB,OAAO,EACH,MAAM,EACN,aAAa,EACb,aAAa,EACb,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,WAAW,GACd,MAAM,aAAc,CAAC;AACtB,OAAO,EACH,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,EACxB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,GACzB,MAAM,oBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,YAAa,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAiB,CAAC;AAC5C,OAAO,EACH,OAAO,EACP,eAAe,EACf,WAAW,EACX,cAAc,EACd,cAAc,GACjB,MAAM,cAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,iBAAkB,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAoB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,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EAAE,MAAM,gBAAiB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,WAAY,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAoB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAqB,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,cAAe,CAAC;AACrG,OAAO,EAAE,WAAW,EAAyB,MAAM,mBAAoB,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAc,CAAC;AACxI,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,eAAgB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,eAAe,EAAmE,MAAM,kBAAmB,CAAC;AACjI,OAAO,EAAE,UAAU,EAAE,WAAW,EAAwB,MAAM,kBAAmB,CAAC;AAClF,OAAO,EAAE,cAAc,EAA4B,MAAM,uBAAwB,CAAC;AAClF,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,kBAAmB,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAmB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAkB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAqB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAsB,MAAM,gBAAiB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef } from "react";
|
|
2
|
+
declare const fieldBase: string[];
|
|
3
|
+
export declare function Input({ className, type, ...props }: ComponentPropsWithoutRef<"input">): import("react").JSX.Element;
|
|
4
|
+
export declare function Textarea({ className, rows, ...props }: ComponentPropsWithoutRef<"textarea">): import("react").JSX.Element;
|
|
5
|
+
export declare function Label({ className, ...props }: ComponentPropsWithoutRef<"label">): import("react").JSX.Element;
|
|
6
|
+
/** Label + control + hint/error, with the spacing already correct. */
|
|
7
|
+
export declare function Field({ label, hint, error, htmlFor, children, className, }: {
|
|
8
|
+
label?: string;
|
|
9
|
+
hint?: string;
|
|
10
|
+
error?: string;
|
|
11
|
+
htmlFor?: string;
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
className?: string;
|
|
14
|
+
}): import("react").JSX.Element;
|
|
15
|
+
export { fieldBase };
|
|
16
|
+
//# sourceMappingURL=input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/components/ui/input.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAOtD,QAAA,MAAM,SAAS,UAUd,CAAC;AAEF,wBAAgB,KAAK,CAAC,EAClB,SAAS,EACT,IAAa,EACb,GAAG,KAAK,EACX,EAAE,wBAAwB,CAAC,OAAO,CAAC,+BAQnC;AAED,wBAAgB,QAAQ,CAAC,EACrB,SAAS,EACT,IAAQ,EACR,GAAG,KAAK,EACX,EAAE,wBAAwB,CAAC,UAAU,CAAC,+BAQtC;AAED,wBAAgB,KAAK,CAAC,EAClB,SAAS,EACT,GAAG,KAAK,EACX,EAAE,wBAAwB,CAAC,OAAO,CAAC,+BAUnC;AAED,sEAAsE;AACtE,wBAAgB,KAAK,CAAC,EAClB,KAAK,EACL,IAAI,EACJ,KAAK,EACL,OAAO,EACP,QAAQ,EACR,SAAS,GACZ,EAAE;IACC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,+BAiBA;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "../../lib/utils.js";
|
|
4
|
+
/* Fields read as sunken, not outlined: a soft inset well rather than a
|
|
5
|
+
hard 1px box. On focus the well lifts to white and gains the accent
|
|
6
|
+
ring, so the active field is the brightest thing on the row. */
|
|
7
|
+
const fieldBase = [
|
|
8
|
+
"w-full rounded-control bg-tint-hover px-2.5 text-ink",
|
|
9
|
+
"placeholder:text-ink-tertiary",
|
|
10
|
+
"shadow-[inset_0_0_0_1px_transparent]",
|
|
11
|
+
"transition-[background-color,box-shadow] duration-100 ease-out-notion",
|
|
12
|
+
"hover:bg-tint-active",
|
|
13
|
+
"focus:bg-surface focus:outline-none",
|
|
14
|
+
"focus:shadow-[inset_0_0_0_1px_var(--accent),0_0_0_3px_var(--accent-tint)]",
|
|
15
|
+
"disabled:text-ink-disabled disabled:hover:bg-tint-hover disabled:cursor-not-allowed",
|
|
16
|
+
"aria-[invalid=true]:shadow-[inset_0_0_0_1px_var(--danger)]",
|
|
17
|
+
];
|
|
18
|
+
export function Input({ className, type = "text", ...props }) {
|
|
19
|
+
return (_jsx("input", { type: type, className: cn(fieldBase, "h-8 text-sm", className), ...props }));
|
|
20
|
+
}
|
|
21
|
+
export function Textarea({ className, rows = 4, ...props }) {
|
|
22
|
+
return (_jsx("textarea", { rows: rows, className: cn(fieldBase, "py-2 text-sm resize-y", className), ...props }));
|
|
23
|
+
}
|
|
24
|
+
export function Label({ className, ...props }) {
|
|
25
|
+
return (_jsx("label", { className: cn("block mb-1.5 font-medium text-ink-secondary text-caption", className), ...props }));
|
|
26
|
+
}
|
|
27
|
+
/** Label + control + hint/error, with the spacing already correct. */
|
|
28
|
+
export function Field({ label, hint, error, htmlFor, children, className, }) {
|
|
29
|
+
return (_jsxs("div", { className: cn("w-full", className), children: [label && _jsx(Label, { htmlFor: htmlFor, children: label }), children, (error || hint) && (_jsx("p", { className: cn("mt-1.5 text-caption", error ? "text-danger" : "text-ink-tertiary"), children: error ?? hint }))] }));
|
|
30
|
+
}
|
|
31
|
+
export { fieldBase };
|
|
32
|
+
//# sourceMappingURL=input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.js","sourceRoot":"","sources":["../../../src/components/ui/input.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC;;kEAEkE;AAElE,MAAM,SAAS,GAAG;IACd,sDAAsD;IACtD,+BAA+B;IAC/B,sCAAsC;IACtC,uEAAuE;IACvE,sBAAsB;IACtB,qCAAqC;IACrC,2EAA2E;IAC3E,qFAAqF;IACrF,4DAA4D;CAC/D,CAAC;AAEF,MAAM,UAAU,KAAK,CAAC,EAClB,SAAS,EACT,IAAI,GAAG,MAAM,EACb,GAAG,KAAK,EACwB;IAChC,OAAO,CACH,gBACI,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,aAAa,EAAE,SAAS,CAAC,KAC9C,KAAK,GACX,CACL,CAAC;AACN,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,EACrB,SAAS,EACT,IAAI,GAAG,CAAC,EACR,GAAG,KAAK,EAC2B;IACnC,OAAO,CACH,mBACI,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,uBAAuB,EAAE,SAAS,CAAC,KACxD,KAAK,GACX,CACL,CAAC;AACN,CAAC;AAED,MAAM,UAAU,KAAK,CAAC,EAClB,SAAS,EACT,GAAG,KAAK,EACwB;IAChC,OAAO,CACH,gBACI,SAAS,EAAE,EAAE,CACT,0DAA0D,EAC1D,SAAS,CACZ,KACG,KAAK,GACX,CACL,CAAC;AACN,CAAC;AAED,sEAAsE;AACtE,MAAM,UAAU,KAAK,CAAC,EAClB,KAAK,EACL,IAAI,EACJ,KAAK,EACL,OAAO,EACP,QAAQ,EACR,SAAS,GAQZ;IACG,OAAO,CACH,eAAK,SAAS,EAAE,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC,aAClC,KAAK,IAAI,KAAC,KAAK,IAAC,OAAO,EAAE,OAAO,YAAG,KAAK,GAAS,EACjD,QAAQ,EACR,CAAC,KAAK,IAAI,IAAI,CAAC,IAAI,CAChB,YACI,SAAS,EAAE,EAAE,CACT,qBAAqB,EACrB,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,mBAAmB,CAC9C,YAEA,KAAK,IAAI,IAAI,GACd,CACP,IACC,CACT,CAAC;AACN,CAAC;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare function LinkBlock({ url, title, onTitleChange, onTitleEnter, onLink, check, className, }: {
|
|
2
|
+
url?: string;
|
|
3
|
+
title?: string;
|
|
4
|
+
/** Called on every keystroke; debounce saving in the owner. */
|
|
5
|
+
onTitleChange?: (title: string) => void;
|
|
6
|
+
/** Enter in the name: in a document, the writing goes on below the card. */
|
|
7
|
+
onTitleEnter?: () => void;
|
|
8
|
+
onLink?: (url: string) => void;
|
|
9
|
+
/** The owner's own rule for a link, after this block's: why it is refused, or null. */
|
|
10
|
+
check?: (url: string) => string | null;
|
|
11
|
+
className?: string;
|
|
12
|
+
}): import("react").JSX.Element | null;
|
|
13
|
+
//# sourceMappingURL=link-block.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link-block.d.ts","sourceRoot":"","sources":["../../../src/components/ui/link-block.tsx"],"names":[],"mappings":"AAUA,wBAAgB,SAAS,CAAC,EACtB,GAAG,EACH,KAAU,EACV,aAAa,EACb,YAAY,EACZ,MAAM,EACN,KAAK,EACL,SAAS,GACZ,EAAE;IACC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+DAA+D;IAC/D,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,4EAA4E;IAC5E,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,uFAAuF;IACvF,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,sCAoDA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ExternalLink, Globe } from "lucide-react";
|
|
4
|
+
import { hostOf, isWebUrl } from "../../lib/embed.js";
|
|
5
|
+
import { cn } from "../../lib/utils.js";
|
|
6
|
+
import { AddressField } from "./address-field.js";
|
|
7
|
+
/* A web page in a document, as a card: a name for it, which can be typed over and
|
|
8
|
+
falls back to its site, and the address under it. Nothing is fetched from the
|
|
9
|
+
page. Until it has an address it asks for one. */
|
|
10
|
+
export function LinkBlock({ url, title = "", onTitleChange, onTitleEnter, onLink, check, className, }) {
|
|
11
|
+
if (!url || !isWebUrl(url))
|
|
12
|
+
return onLink ? (_jsx(AddressField, { icon: _jsx(Globe, {}), placeholder: "Paste a link to a web page, then Enter", check: (link) => (isWebUrl(link) ? null : "That needs to be a web address, starting http:// or https://.") ?? check?.(link) ?? null, onCommit: onLink, className: className })) : null;
|
|
13
|
+
const site = hostOf(url);
|
|
14
|
+
return (_jsxs("div", { className: cn("flex items-center gap-3 rounded-surface px-3.5 py-3 shadow-[inset_0_0_0_1px_var(--hairline)] transition-colors duration-100 hover:bg-tint-hover", className), children: [_jsx("span", { className: "flex size-9 shrink-0 items-center justify-center rounded-control bg-accent-tint text-accent-text", children: _jsx(Globe, { className: "size-4" }) }), _jsxs("div", { className: "min-w-0 flex-1", children: [onTitleChange ? (_jsx("input", { defaultValue: title, placeholder: site, "aria-label": "Name of the link", onChange: (e) => onTitleChange(e.target.value), onKeyDown: (e) => {
|
|
15
|
+
if (e.key !== "Enter" || !onTitleEnter)
|
|
16
|
+
return;
|
|
17
|
+
e.preventDefault();
|
|
18
|
+
onTitleEnter();
|
|
19
|
+
}, className: "w-full truncate bg-transparent font-medium text-ink outline-none placeholder:text-ink" })) : (_jsx("p", { className: "truncate font-medium text-ink", children: title || site })), _jsx("p", { className: "truncate text-sm text-ink-tertiary", children: url })] }), _jsx("a", { href: url, target: "_blank", rel: "noreferrer", "aria-label": `Open ${site}`, className: "flex size-8 shrink-0 items-center justify-center rounded-control text-ink-secondary transition-colors hover:bg-tint-active hover:text-ink", children: _jsx(ExternalLink, { className: "size-4" }) })] }));
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=link-block.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link-block.js","sourceRoot":"","sources":["../../../src/components/ui/link-block.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAqB,CAAC;AAEnD;;oDAEoD;AACpD,MAAM,UAAU,SAAS,CAAC,EACtB,GAAG,EACH,KAAK,GAAG,EAAE,EACV,aAAa,EACb,YAAY,EACZ,MAAM,EACN,KAAK,EACL,SAAS,GAYZ;IACG,IAAI,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;QACtB,OAAO,MAAM,CAAC,CAAC,CAAC,CACZ,KAAC,YAAY,IACT,IAAI,EAAE,KAA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1B,SAAS,EAAC,2IAA2I,YAErJ,KAAC,YAAY,IAAC,SAAS,EAAC,QAAQ,GAAG,GACnC,IACF,CACT,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
interface MacWindowHeaderProps {
|
|
3
|
+
title: ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function MacWindowHeader({ title, className }: MacWindowHeaderProps): import("react").JSX.Element;
|
|
7
|
+
interface MacCardProps {
|
|
8
|
+
title: ReactNode;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
className?: string;
|
|
11
|
+
headerClassName?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function MacCard({ title, children, className, headerClassName, }: MacCardProps): import("react").JSX.Element;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=mac-card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mac-card.d.ts","sourceRoot":"","sources":["../../../src/components/ui/mac-card.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,UAAU,oBAAoB;IAC1B,KAAK,EAAE,SAAS,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,oBAAoB,+BAgBzE;AAED,UAAU,YAAY;IAClB,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,wBAAgB,OAAO,CAAC,EACpB,KAAK,EACL,QAAQ,EACR,SAAS,EACT,eAAe,GAClB,EAAE,YAAY,+BAOd"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../lib/utils.js";
|
|
3
|
+
export function MacWindowHeader({ title, className }) {
|
|
4
|
+
return (_jsxs("div", { className: cn("flex items-center gap-1.5 bg-muted/40 px-4 py-2.5 border-b", className), children: [_jsx("span", { className: "bg-red-400/70 rounded-full size-2.5" }), _jsx("span", { className: "bg-yellow-400/70 rounded-full size-2.5" }), _jsx("span", { className: "bg-green-400/70 rounded-full size-2.5" }), _jsx("span", { className: "ml-auto font-mono text-foreground/60 text-xs", children: title })] }));
|
|
5
|
+
}
|
|
6
|
+
export function MacCard({ title, children, className, headerClassName, }) {
|
|
7
|
+
return (_jsxs("div", { className: cn("overflow-hidden", className), children: [_jsx(MacWindowHeader, { title: title, className: headerClassName }), children] }));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=mac-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mac-card.js","sourceRoot":"","sources":["../../../src/components/ui/mac-card.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAQxC,MAAM,UAAU,eAAe,CAAC,EAAE,KAAK,EAAE,SAAS,EAAwB;IACtE,OAAO,CACH,eACI,SAAS,EAAE,EAAE,CACT,4DAA4D,EAC5D,SAAS,CACZ,aAED,eAAM,SAAS,EAAC,qCAAqC,GAAG,EACxD,eAAM,SAAS,EAAC,wCAAwC,GAAG,EAC3D,eAAM,SAAS,EAAC,uCAAuC,GAAG,EAC1D,eAAM,SAAS,EAAC,8CAA8C,YACzD,KAAK,GACH,IACL,CACT,CAAC;AACN,CAAC;AASD,MAAM,UAAU,OAAO,CAAC,EACpB,KAAK,EACL,QAAQ,EACR,SAAS,EACT,eAAe,GACJ;IACX,OAAO,CACH,eAAK,SAAS,EAAE,EAAE,CAAC,iBAAiB,EAAE,SAAS,CAAC,aAC5C,KAAC,eAAe,IAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,eAAe,GAAI,EAC5D,QAAQ,IACP,CACT,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type LucideIcon } from "lucide-react";
|
|
2
|
+
import { type ElementType } from "react";
|
|
3
|
+
export type NavNode = {
|
|
4
|
+
id: string;
|
|
5
|
+
title: string;
|
|
6
|
+
href: string;
|
|
7
|
+
icon?: LucideIcon;
|
|
8
|
+
children?: NavNode[];
|
|
9
|
+
};
|
|
10
|
+
export declare function NavTree({ nodes, activeId, depth, link, }: {
|
|
11
|
+
nodes: NavNode[];
|
|
12
|
+
activeId?: string;
|
|
13
|
+
depth?: number;
|
|
14
|
+
link?: ElementType;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
16
|
+
//# sourceMappingURL=nav-tree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nav-tree.d.ts","sourceRoot":"","sources":["../../../src/components/ui/nav-tree.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA0B,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AACvE,OAAO,EAAY,KAAK,WAAW,EAAE,MAAM,OAAO,CAAC;AAGnD,MAAM,MAAM,OAAO,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAA;CAAE,CAAC;AA6D3G,wBAAgB,OAAO,CAAC,EACpB,KAAK,EACL,QAAQ,EACR,KAAS,EACT,IAAU,GACb,EAAE;IACC,KAAK,EAAE,OAAO,EAAE,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,WAAW,CAAC;CACtB,+BAQA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ChevronRight, FileText } from "lucide-react";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
import { cn } from "../../lib/utils.js";
|
|
6
|
+
// Each entry keeps one of the nine tag colours for its icon, picked from its id, so
|
|
7
|
+
// a sidebar has some colour and an entry is recognisable by more than its name.
|
|
8
|
+
const ICON_COLORS = [
|
|
9
|
+
"text-tag-gray-ink", "text-tag-brown-ink", "text-tag-orange-ink", "text-tag-yellow-ink", "text-tag-green-ink",
|
|
10
|
+
"text-tag-blue-ink", "text-tag-purple-ink", "text-tag-pink-ink", "text-tag-red-ink",
|
|
11
|
+
];
|
|
12
|
+
function iconColor(id) {
|
|
13
|
+
let hash = 0;
|
|
14
|
+
for (const ch of id)
|
|
15
|
+
hash = (hash * 31 + ch.charCodeAt(0)) | 0;
|
|
16
|
+
return ICON_COLORS[Math.abs(hash) % ICON_COLORS.length];
|
|
17
|
+
}
|
|
18
|
+
const holds = (node, id) => (node.children ?? []).some((c) => c.id === id || holds(c, id));
|
|
19
|
+
function Row({ node, depth, activeId, link: Link }) {
|
|
20
|
+
const children = node.children ?? [];
|
|
21
|
+
const [open, setOpen] = useState(activeId !== undefined && holds(node, activeId));
|
|
22
|
+
const current = node.id === activeId;
|
|
23
|
+
const Icon = node.icon ?? FileText;
|
|
24
|
+
return (_jsxs("li", { children: [_jsxs("div", { className: cn("group flex h-[30px] items-center rounded-control pr-2 text-sm font-medium transition-colors duration-100", current ? "bg-accent-tint text-accent-text" : "text-ink-secondary hover:bg-tint-hover"), style: { paddingLeft: 8 + depth * 16 }, children: [_jsxs("span", { className: "relative mr-1.5 flex size-5 shrink-0 items-center justify-center", children: [_jsx(Icon, { className: cn("size-4", iconColor(node.id), children.length > 0 && "group-hover:opacity-0") }), children.length > 0 && (_jsx("button", { type: "button", "aria-label": open ? `Collapse ${node.title}` : `Expand ${node.title}`, "aria-expanded": open, onClick: () => setOpen(!open), className: "affordance absolute inset-0 flex items-center justify-center rounded-[3px] hover:bg-tint-active", children: _jsx(ChevronRight, { className: cn("size-3.5 transition-transform duration-100", open && "rotate-90") }) }))] }), _jsx(Link, { href: node.href, "aria-current": current ? "page" : undefined, className: "flex h-full min-w-0 flex-1 items-center outline-offset-[-2px]", children: _jsx("span", { className: "truncate", children: node.title }) })] }), children.length > 0 && open && _jsx(NavTree, { nodes: children, depth: depth + 1, activeId: activeId, link: Link })] }));
|
|
25
|
+
}
|
|
26
|
+
/* A sidebar's tree of destinations. The entry matching `activeId` is highlighted
|
|
27
|
+
in the accent, and its ancestors start open. Pass your router's link as `link`.
|
|
28
|
+
|
|
29
|
+
Put the tree inside something that is not itself a `group`, or use a named group
|
|
30
|
+
there: the rows use `group` to reveal their chevrons. */
|
|
31
|
+
export function NavTree({ nodes, activeId, depth = 0, link = "a", }) {
|
|
32
|
+
return (_jsx("ul", { className: "flex flex-col gap-px", children: nodes.map((node) => (_jsx(Row, { node: node, depth: depth, activeId: activeId, link: link }, node.id))) }));
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=nav-tree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nav-tree.js","sourceRoot":"","sources":["../../../src/components/ui/nav-tree.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAmB,MAAM,cAAc,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAoB,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAIxC,oFAAoF;AACpF,gFAAgF;AAChF,MAAM,WAAW,GAAG;IAChB,mBAAmB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,oBAAoB;IAC7G,mBAAmB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,kBAAkB;CACtF,CAAC;AACF,SAAS,SAAS,CAAC,EAAU;IACzB,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,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,EAAE,IAAI,IAAjE,IAAI,CAAC,EAAE,CAA8D,CAClF,CAAC,GACD,CACR,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export declare function Page({ children, className }: {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
}): import("react").JSX.Element;
|
|
6
|
+
export declare function PageHeader({ title, lead, note, actions }: {
|
|
7
|
+
title: ReactNode;
|
|
8
|
+
lead?: ReactNode;
|
|
9
|
+
note?: ReactNode;
|
|
10
|
+
actions?: ReactNode;
|
|
11
|
+
}): import("react").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=page.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../src/components/ui/page.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOvC,wBAAgB,IAAI,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,+BAExF;AAID,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;IAAE,KAAK,EAAE,SAAS,CAAC;IAAC,IAAI,CAAC,EAAE,SAAS,CAAC;IAAC,IAAI,CAAC,EAAE,SAAS,CAAC;IAAC,OAAO,CAAC,EAAE,SAAS,CAAA;CAAE,+BAWvI"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../lib/utils.js";
|
|
3
|
+
/* Every page of an app sits in this: one width and one set of margins, so
|
|
4
|
+
moving between views does not shift the left edge. Meant for inside
|
|
5
|
+
`AppShell`, whose main area is a container (the `@4xl` here answers to the
|
|
6
|
+
room the page really has, sidebar open or shut). */
|
|
7
|
+
export function Page({ children, className }) {
|
|
8
|
+
return _jsx("div", { className: cn("mx-auto w-full max-w-[1500px] px-5 pt-10 pb-24 @4xl:px-10", className), children: children });
|
|
9
|
+
}
|
|
10
|
+
/* A page's name at the display size, the line under it, and room on the right
|
|
11
|
+
for its actions. */
|
|
12
|
+
export function PageHeader({ title, lead, note, actions }) {
|
|
13
|
+
return (_jsxs("header", { className: "mb-8 flex flex-wrap items-end gap-x-4 gap-y-3", children: [_jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("h1", { className: "text-display text-ink", children: title }), lead !== undefined && _jsx("p", { className: "mt-2 text-ink-secondary", children: lead }), note !== undefined && _jsx("p", { className: "mt-2 max-w-2xl text-sm text-ink-tertiary", children: note })] }), actions !== undefined && _jsx("div", { className: "flex shrink-0 items-center gap-1 pb-1", children: actions })] }));
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page.js","sourceRoot":"","sources":["../../../src/components/ui/page.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC;;;sDAGsD;AACtD,MAAM,UAAU,IAAI,CAAC,EAAE,QAAQ,EAAE,SAAS,EAA+C;IACrF,OAAO,cAAK,SAAS,EAAE,EAAE,CAAC,2DAA2D,EAAE,SAAS,CAAC,YAAG,QAAQ,GAAO,CAAC;AACxH,CAAC;AAED;sBACsB;AACtB,MAAM,UAAU,UAAU,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAiF;IACpI,OAAO,CACH,kBAAQ,SAAS,EAAC,+CAA+C,aAC7D,eAAK,SAAS,EAAC,gBAAgB,aAC3B,aAAI,SAAS,EAAC,uBAAuB,YAAE,KAAK,GAAM,EACjD,IAAI,KAAK,SAAS,IAAI,YAAG,SAAS,EAAC,yBAAyB,YAAE,IAAI,GAAK,EACvE,IAAI,KAAK,SAAS,IAAI,YAAG,SAAS,EAAC,0CAA0C,YAAE,IAAI,GAAK,IACvF,EACL,OAAO,KAAK,SAAS,IAAI,cAAK,SAAS,EAAC,uCAAuC,YAAE,OAAO,GAAO,IAC3F,CACZ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
2
|
+
import type { ComponentPropsWithoutRef } from "react";
|
|
3
|
+
export declare const Popover: import("react").FC<PopoverPrimitive.PopoverProps>;
|
|
4
|
+
export declare const PopoverTrigger: import("react").ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
export declare const PopoverAnchor: import("react").ForwardRefExoticComponent<PopoverPrimitive.PopoverAnchorProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export declare const PopoverClose: import("react").ForwardRefExoticComponent<PopoverPrimitive.PopoverCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
export declare function PopoverContent({ className, align, sideOffset, collisionPadding, ...props }: ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>): import("react").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=popover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../../src/components/ui/popover.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAOtD,eAAO,MAAM,OAAO,mDAAwB,CAAC;AAC7C,eAAO,MAAM,cAAc,oIAA2B,CAAC;AACvD,eAAO,MAAM,aAAa,gIAA0B,CAAC;AACrD,eAAO,MAAM,YAAY,kIAAyB,CAAC;AAEnD,wBAAgB,cAAc,CAAC,EAC3B,SAAS,EACT,KAAe,EACf,UAAc,EACd,gBAAoB,EACpB,GAAG,KAAK,EACX,EAAE,wBAAwB,CAAC,OAAO,gBAAgB,CAAC,OAAO,CAAC,+BAoB3D"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
4
|
+
import { cn } from "../../lib/utils.js";
|
|
5
|
+
/* A panel anchored to the thing that opened it, for content richer than a menu: a
|
|
6
|
+
calendar, a few fields. The same surface as a dropdown, without its padding, so
|
|
7
|
+
what goes inside decides its own. */
|
|
8
|
+
export const Popover = PopoverPrimitive.Root;
|
|
9
|
+
export const PopoverTrigger = PopoverPrimitive.Trigger;
|
|
10
|
+
export const PopoverAnchor = PopoverPrimitive.Anchor;
|
|
11
|
+
export const PopoverClose = PopoverPrimitive.Close;
|
|
12
|
+
export function PopoverContent({ className, align = "start", sideOffset = 6, collisionPadding = 8, ...props }) {
|
|
13
|
+
return (_jsx(PopoverPrimitive.Portal, { children: _jsx(PopoverPrimitive.Content, { align: align, sideOffset: sideOffset, collisionPadding: collisionPadding, className: cn("z-50 bg-surface-overlay shadow-popover rounded-overlay outline-none",
|
|
14
|
+
// Never larger than the room there is: a tall panel on a short screen
|
|
15
|
+
// scrolls inside itself rather than running off the edge.
|
|
16
|
+
"max-w-[calc(100vw-1rem)] max-h-[var(--radix-popover-content-available-height)] overflow-y-auto overscroll-contain", "data-[state=open]:animate-slide-in data-[state=closed]:animate-fade-out", "origin-[--radix-popover-content-transform-origin]", className), ...props }) }));
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=popover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popover.js","sourceRoot":"","sources":["../../../src/components/ui/popover.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC;;uCAEuC;AAEvC,MAAM,CAAC,MAAM,OAAO,GAAG,gBAAgB,CAAC,IAAI,CAAC;AAC7C,MAAM,CAAC,MAAM,cAAc,GAAG,gBAAgB,CAAC,OAAO,CAAC;AACvD,MAAM,CAAC,MAAM,aAAa,GAAG,gBAAgB,CAAC,MAAM,CAAC;AACrD,MAAM,CAAC,MAAM,YAAY,GAAG,gBAAgB,CAAC,KAAK,CAAC;AAEnD,MAAM,UAAU,cAAc,CAAC,EAC3B,SAAS,EACT,KAAK,GAAG,OAAO,EACf,UAAU,GAAG,CAAC,EACd,gBAAgB,GAAG,CAAC,EACpB,GAAG,KAAK,EACgD;IACxD,OAAO,CACH,KAAC,gBAAgB,CAAC,MAAM,cACpB,KAAC,gBAAgB,CAAC,OAAO,IACrB,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,UAAU,EACtB,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,EAAE,CACT,qEAAqE;YACrE,sEAAsE;YACtE,0DAA0D;YAC1D,mHAAmH,EACnH,yEAAyE,EACzE,mDAAmD,EACnD,SAAS,CACZ,KACG,KAAK,GACX,GACoB,CAC7B,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export declare function Progress({ value, max, label, action, className, }: {
|
|
3
|
+
value: number;
|
|
4
|
+
max: number;
|
|
5
|
+
label?: ReactNode;
|
|
6
|
+
action?: ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=progress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../src/components/ui/progress.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC,wBAAgB,QAAQ,CAAC,EACrB,KAAK,EACL,GAAG,EACH,KAAK,EACL,MAAM,EACN,SAAS,GACZ,EAAE;IACC,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IAEZ,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,+BAiBA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../lib/utils.js";
|
|
3
|
+
/* How far along something is: "n of m", a bar, and room for one action on the
|
|
4
|
+
right (a reset, usually). The row wraps on a narrow screen. */
|
|
5
|
+
export function Progress({ value, max, label, action, className, }) {
|
|
6
|
+
const share = max === 0 ? 0 : Math.min(value / max, 1);
|
|
7
|
+
return (_jsxs("div", { className: cn("flex flex-wrap items-center gap-x-3 rounded-surface bg-surface-sunken py-2 pr-2 pl-4", className), children: [_jsx("span", { className: "text-sm font-medium text-accent-text tabular-nums", children: label ?? `${value} of ${max}` }), _jsx("div", { role: "progressbar", "aria-valuemin": 0, "aria-valuemax": max, "aria-valuenow": value, className: "h-1.5 min-w-16 flex-1 overflow-hidden rounded-full bg-tint-active", children: _jsx("div", { className: "h-full rounded-full bg-accent transition-[width] duration-150 ease-out-notion", style: { width: `${share * 100}%` } }) }), action] }));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=progress.js.map
|