@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 @@
|
|
|
1
|
+
{"version":3,"file":"progress.js","sourceRoot":"","sources":["../../../src/components/ui/progress.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC;iEACiE;AACjE,MAAM,UAAU,QAAQ,CAAC,EACrB,KAAK,EACL,GAAG,EACH,KAAK,EACL,MAAM,EACN,SAAS,GAQZ;IACG,MAAM,KAAK,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;IACvD,OAAO,CACH,eAAK,SAAS,EAAE,EAAE,CAAC,sFAAsF,EAAE,SAAS,CAAC,aACjH,eAAM,SAAS,EAAC,mDAAmD,YAAE,KAAK,IAAI,GAAG,KAAK,OAAO,GAAG,EAAE,GAAQ,EAC1G,cACI,IAAI,EAAC,aAAa,mBACH,CAAC,mBACD,GAAG,mBACH,KAAK,EACpB,SAAS,EAAC,mEAAmE,YAE7E,cAAK,SAAS,EAAC,+EAA+E,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,KAAK,GAAG,GAAG,GAAG,EAAE,GAAI,GACpI,EACL,MAAM,IACL,CACT,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { LucideIcon } from "lucide-react";
|
|
2
|
+
import type { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
3
|
+
export declare const quietField = "min-h-7 w-full rounded-control bg-transparent px-1.5 py-1 text-sm outline-none transition-colors duration-100 placeholder:text-ink-tertiary hover:bg-tint-hover focus:bg-tint-hover";
|
|
4
|
+
export declare function PropertyList({ className, ...props }: ComponentPropsWithoutRef<"div">): import("react").JSX.Element;
|
|
5
|
+
export declare function Property({ icon: Icon, label, children }: {
|
|
6
|
+
icon?: LucideIcon;
|
|
7
|
+
label: string;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
10
|
+
export declare function QuietInput({ className, ...props }: ComponentPropsWithoutRef<"input">): import("react").JSX.Element;
|
|
11
|
+
export declare function NumberInput({ value, onChange, className, ...props }: Omit<ComponentPropsWithoutRef<"input">, "value" | "onChange" | "defaultValue"> & {
|
|
12
|
+
value: number | undefined;
|
|
13
|
+
onChange: (value: number | undefined) => void;
|
|
14
|
+
}): import("react").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=property.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"property.d.ts","sourceRoot":"","sources":["../../../src/components/ui/property.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,wBAAwB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQjE,eAAO,MAAM,UAAU,wLACkK,CAAC;AAE1L,wBAAgB,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,wBAAwB,CAAC,KAAK,CAAC,+BAEpF;AAED,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;IAAE,IAAI,CAAC,EAAE,UAAU,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,SAAS,CAAA;CAAE,+BAUlH;AAED,wBAAgB,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,wBAAwB,CAAC,OAAO,CAAC,+BAEpF;AAMD,wBAAgB,WAAW,CAAC,EACxB,KAAK,EACL,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACX,EAAE,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,cAAc,CAAC,GAAG;IAChF,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;CACjD,+BAiBA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "../../lib/utils.js";
|
|
4
|
+
/* A record's properties, Notion's way: a quiet label column on the left, values on
|
|
5
|
+
the right, and no boxes until a value is hovered or focused. Use it in a dialog
|
|
6
|
+
or a side panel for anything with a handful of fields. */
|
|
7
|
+
// The look of a value at rest: transparent, with a tint on hover and focus.
|
|
8
|
+
export const quietField = "min-h-7 w-full rounded-control bg-transparent px-1.5 py-1 text-sm outline-none transition-colors duration-100 placeholder:text-ink-tertiary hover:bg-tint-hover focus:bg-tint-hover";
|
|
9
|
+
export function PropertyList({ className, ...props }) {
|
|
10
|
+
return _jsx("div", { className: cn("flex flex-col gap-1", className), ...props });
|
|
11
|
+
}
|
|
12
|
+
export function Property({ icon: Icon, label, children }) {
|
|
13
|
+
return (_jsxs("div", { className: "flex items-start gap-2", children: [_jsxs("div", { className: "flex h-7 w-28 shrink-0 items-center gap-1.5 text-sm text-ink-secondary sm:w-32", children: [Icon && _jsx(Icon, { className: "size-4 text-ink-tertiary" }), _jsx("span", { className: "truncate", children: label })] }), _jsx("div", { className: "flex min-w-0 flex-1 flex-wrap items-center gap-1", children: children })] }));
|
|
14
|
+
}
|
|
15
|
+
export function QuietInput({ className, ...props }) {
|
|
16
|
+
return _jsx("input", { className: cn(quietField, className), ...props });
|
|
17
|
+
}
|
|
18
|
+
/* A number that is committed when the field is left, not on every keystroke, so a
|
|
19
|
+
half-typed "12." is never saved. Empty clears the value; anything that is not a
|
|
20
|
+
number is put back as it was. Currency signs and thousands separators are
|
|
21
|
+
ignored. */
|
|
22
|
+
export function NumberInput({ value, onChange, className, ...props }) {
|
|
23
|
+
return (_jsx("input", { inputMode: "decimal", placeholder: "Empty", defaultValue: value ?? "", onBlur: (e) => {
|
|
24
|
+
const raw = e.target.value.replace(/[$€£,\s]/g, "");
|
|
25
|
+
const n = Number(raw);
|
|
26
|
+
if (raw === "")
|
|
27
|
+
onChange(undefined);
|
|
28
|
+
else if (Number.isFinite(n))
|
|
29
|
+
onChange(n);
|
|
30
|
+
else
|
|
31
|
+
e.target.value = String(value ?? "");
|
|
32
|
+
}, className: cn(quietField, "w-28 tabular-nums", className), ...props }));
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=property.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"property.js","sourceRoot":"","sources":["../../../src/components/ui/property.tsx"],"names":[],"mappings":"AAA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,GAAG,CAAC,CAAC;YACtB,IAAI,GAAG,KAAK,EAAE;gBAAE,QAAQ,CAAC,SAAS,CAAC,CAAC;iBAC/B,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;gBAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;;gBACpC,CAAC,CAAC,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;QAC9C,CAAC,EACD,SAAS,EAAE,EAAE,CAAC,UAAU,EAAE,mBAAmB,EAAE,SAAS,CAAC,KACrD,KAAK,GACX,CACL,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare function Segmented<T extends string>({ options, value, onChange, label, className, }: {
|
|
2
|
+
options: readonly {
|
|
3
|
+
value: T;
|
|
4
|
+
label: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}[];
|
|
7
|
+
value: T;
|
|
8
|
+
onChange: (value: T) => void;
|
|
9
|
+
/** What is being switched, for screen readers. */
|
|
10
|
+
label: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=segmented.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segmented.d.ts","sourceRoot":"","sources":["../../../src/components/ui/segmented.tsx"],"names":[],"mappings":"AAOA,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,EAAE,EACxC,OAAO,EACP,KAAK,EACL,QAAQ,EACR,KAAK,EACL,SAAS,GACZ,EAAE;IACC,OAAO,EAAE,SAAS;QAAE,KAAK,EAAE,CAAC,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,EAAE,CAAC;IACpE,KAAK,EAAE,CAAC,CAAC;IACT,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC7B,kDAAkD;IAClD,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,+BAqBA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "../../lib/utils.js";
|
|
4
|
+
/* Two or three views of one thing, chosen like tabs: a sunken track with the
|
|
5
|
+
chosen one raised on it. For switching what a panel shows, not for
|
|
6
|
+
navigation between pages. */
|
|
7
|
+
export function Segmented({ options, value, onChange, label, className, }) {
|
|
8
|
+
return (_jsx("div", { role: "tablist", "aria-label": label, className: cn("flex gap-1 rounded-control bg-tint-hover p-0.5", className), children: options.map((option) => (_jsx("button", { type: "button", role: "tab", "aria-selected": value === option.value, disabled: option.disabled, onClick: () => onChange(option.value), className: cn("h-7 flex-1 rounded-[3px] px-3 text-sm font-medium transition-colors duration-100 disabled:text-ink-disabled", value === option.value ? "bg-surface-overlay text-ink shadow-xs" : "text-ink-secondary hover:text-ink"), children: option.label }, option.value))) }));
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=segmented.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segmented.js","sourceRoot":"","sources":["../../../src/components/ui/segmented.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC;;+BAE+B;AAC/B,MAAM,UAAU,SAAS,CAAmB,EACxC,OAAO,EACP,KAAK,EACL,QAAQ,EACR,KAAK,EACL,SAAS,GAQZ;IACG,OAAO,CACH,cAAK,IAAI,EAAC,SAAS,gBAAa,KAAK,EAAE,SAAS,EAAE,EAAE,CAAC,gDAAgD,EAAE,SAAS,CAAC,YAC5G,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CACrB,iBAEI,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,KAAK,mBACK,KAAK,KAAK,MAAM,CAAC,KAAK,EACrC,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,EACrC,SAAS,EAAE,EAAE,CACT,6GAA6G,EAC7G,KAAK,KAAK,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,uCAAuC,CAAC,CAAC,CAAC,mCAAmC,CACzG,YAEA,MAAM,CAAC,KAAK,IAXR,MAAM,CAAC,KAAK,CAYZ,CACZ,CAAC,GACA,CACT,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export declare function SelectMenu<T extends string>({ value, options, onChange, render, label, className, }: {
|
|
3
|
+
value: T;
|
|
4
|
+
options: readonly T[];
|
|
5
|
+
onChange: (value: T) => void;
|
|
6
|
+
render?: (value: T) => ReactNode;
|
|
7
|
+
label: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=select-menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select-menu.d.ts","sourceRoot":"","sources":["../../../src/components/ui/select-menu.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvC,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,EACzC,KAAK,EACL,OAAO,EACP,QAAQ,EACR,MAAiB,EACjB,KAAK,EACL,SAAS,GACZ,EAAE;IACC,KAAK,EAAE,CAAC,CAAC;IACT,OAAO,EAAE,SAAS,CAAC,EAAE,CAAC;IACtB,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC7B,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,SAAS,CAAC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,+BAuBA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuTrigger } from "./dropdown-menu.js";
|
|
4
|
+
import { cn } from "../../lib/utils.js";
|
|
5
|
+
/* Pick one of a fixed set. The trigger is whatever shows the current value, a badge
|
|
6
|
+
or plain text, so a property reads the same at rest as it does in a table. */
|
|
7
|
+
export function SelectMenu({ value, options, onChange, render = (v) => v, label, className, }) {
|
|
8
|
+
return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx("button", { type: "button", "aria-label": label, className: cn("flex min-h-7 items-center rounded-control px-1.5 text-left text-sm transition-colors duration-100 hover:bg-tint-hover", className), children: render(value) }) }), _jsx(DropdownMenuContent, { align: "start", className: "max-h-80 overflow-y-auto", children: _jsx(DropdownMenuRadioGroup, { value: value, onValueChange: (v) => onChange(v), children: options.map((option) => (_jsx(DropdownMenuRadioItem, { value: option, children: render(option) }, option))) }) })] }));
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=select-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select-menu.js","sourceRoot":"","sources":["../../../src/components/ui/select-menu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,oBAAqB,CAAC;AAC5I,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC;mFACmF;AACnF,MAAM,UAAU,UAAU,CAAmB,EACzC,KAAK,EACL,OAAO,EACP,QAAQ,EACR,MAAM,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EACjB,KAAK,EACL,SAAS,GAQZ;IACG,OAAO,CACH,MAAC,YAAY,eACT,KAAC,mBAAmB,IAAC,OAAO,kBACxB,iBACI,IAAI,EAAC,QAAQ,gBACD,KAAK,EACjB,SAAS,EAAE,EAAE,CAAC,uHAAuH,EAAE,SAAS,CAAC,YAEhJ,MAAM,CAAC,KAAK,CAAC,GACT,GACS,EACtB,KAAC,mBAAmB,IAAC,KAAK,EAAC,OAAO,EAAC,SAAS,EAAC,0BAA0B,YACnE,KAAC,sBAAsB,IAAC,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAM,CAAC,YACvE,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CACrB,KAAC,qBAAqB,IAAc,KAAK,EAAE,MAAM,YAC5C,MAAM,CAAC,MAAM,CAAC,IADS,MAAM,CAEV,CAC3B,CAAC,GACmB,GACP,IACX,CAClB,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
2
|
+
import type { ComponentPropsWithoutRef } from "react";
|
|
3
|
+
export declare const Select: import("react").FC<SelectPrimitive.SelectProps>;
|
|
4
|
+
export declare const SelectGroup: import("react").ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
5
|
+
export declare const SelectValue: import("react").ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
6
|
+
export declare function SelectTrigger({ className, children, ...props }: ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>): import("react").JSX.Element;
|
|
7
|
+
export declare function SelectContent({ className, children, sideOffset, ...props }: ComponentPropsWithoutRef<typeof SelectPrimitive.Content>): import("react").JSX.Element;
|
|
8
|
+
export declare function SelectItem({ className, children, ...props }: ComponentPropsWithoutRef<typeof SelectPrimitive.Item>): import("react").JSX.Element;
|
|
9
|
+
export declare function SelectLabel({ className, ...props }: ComponentPropsWithoutRef<typeof SelectPrimitive.Label>): import("react").JSX.Element;
|
|
10
|
+
export declare function SelectSeparator({ className, ...props }: ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>): import("react").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/components/ui/select.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAE1D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAWtD,eAAO,MAAM,MAAM,iDAAuB,CAAC;AAC3C,eAAO,MAAM,WAAW,6HAAwB,CAAC;AACjD,eAAO,MAAM,WAAW,8HAAwB,CAAC;AAEjD,wBAAgB,aAAa,CAAC,EAC1B,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACX,EAAE,wBAAwB,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,+BAmB1D;AAED,wBAAgB,aAAa,CAAC,EAC1B,SAAS,EACT,QAAQ,EACR,UAAc,EACd,GAAG,KAAK,EACX,EAAE,wBAAwB,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,+BAuB1D;AAED,wBAAgB,UAAU,CAAC,EACvB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACX,EAAE,wBAAwB,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,+BAqBvD;AAED,wBAAgB,WAAW,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACX,EAAE,wBAAwB,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,+BAOxD;AAED,wBAAgB,eAAe,CAAC,EAC5B,SAAS,EACT,GAAG,KAAK,EACX,EAAE,wBAAwB,CAAC,OAAO,eAAe,CAAC,SAAS,CAAC,+BAO5D"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
4
|
+
import { Check, ChevronDown } from "lucide-react";
|
|
5
|
+
import { fieldBase } from "./input.js";
|
|
6
|
+
import { cn } from "../../lib/utils.js";
|
|
7
|
+
/* Pick one of a list, in a form. The trigger is the same sunken well as Input and
|
|
8
|
+
the list is the same surface as a menu, so it belongs to both. For a value shown
|
|
9
|
+
as plain text or a badge that opens a list when pressed, see SelectMenu.
|
|
10
|
+
|
|
11
|
+
An option's value cannot be the empty string: Radix keeps that for "nothing
|
|
12
|
+
chosen". Give "none" a name of its own. */
|
|
13
|
+
export const Select = SelectPrimitive.Root;
|
|
14
|
+
export const SelectGroup = SelectPrimitive.Group;
|
|
15
|
+
export const SelectValue = SelectPrimitive.Value;
|
|
16
|
+
export function SelectTrigger({ className, children, ...props }) {
|
|
17
|
+
return (_jsxs(SelectPrimitive.Trigger, { className: cn(fieldBase, "flex h-8 items-center justify-between gap-2 text-left text-sm cursor-pointer", "data-[placeholder]:text-ink-tertiary", "data-[state=open]:bg-surface data-[state=open]:shadow-[inset_0_0_0_1px_var(--accent),0_0_0_3px_var(--accent-tint)]", "[&>span]:min-w-0 [&>span]:truncate", className), ...props, children: [children, _jsx(SelectPrimitive.Icon, { asChild: true, children: _jsx(ChevronDown, { className: "size-4 shrink-0 text-ink-tertiary" }) })] }));
|
|
18
|
+
}
|
|
19
|
+
export function SelectContent({ className, children, sideOffset = 6, ...props }) {
|
|
20
|
+
return (_jsx(SelectPrimitive.Portal, { children: _jsx(SelectPrimitive.Content, { position: "popper", sideOffset: sideOffset, collisionPadding: 8, className: cn("z-50 overflow-hidden bg-surface-overlay shadow-popover rounded-overlay", "min-w-[max(var(--radix-select-trigger-width),8rem)] max-h-[min(var(--radix-select-content-available-height),20rem)]", "data-[state=open]:animate-slide-in data-[state=closed]:animate-fade-out", "origin-[--radix-select-content-transform-origin]", className), ...props, children: _jsx(SelectPrimitive.Viewport, { className: "p-1.5", children: children }) }) }));
|
|
21
|
+
}
|
|
22
|
+
export function SelectItem({ className, children, ...props }) {
|
|
23
|
+
return (_jsxs(SelectPrimitive.Item, { className: cn("relative flex items-center gap-2 cursor-default select-none", "min-h-7 py-1 pr-8 pl-2 rounded-control text-sm text-ink outline-none", "transition-colors duration-75", "data-[highlighted]:bg-tint-hover", "data-[disabled]:pointer-events-none data-[disabled]:text-ink-disabled", className), ...props, children: [_jsx(SelectPrimitive.ItemText, { children: children }), _jsx("span", { className: "right-2 absolute flex justify-center items-center size-4", children: _jsx(SelectPrimitive.ItemIndicator, { children: _jsx(Check, { className: "size-4 text-ink-secondary" }) }) })] }));
|
|
24
|
+
}
|
|
25
|
+
export function SelectLabel({ className, ...props }) {
|
|
26
|
+
return (_jsx(SelectPrimitive.Label, { className: cn("px-2 pt-1.5 pb-1 font-medium text-ink-tertiary text-caption", className), ...props }));
|
|
27
|
+
}
|
|
28
|
+
export function SelectSeparator({ className, ...props }) {
|
|
29
|
+
return (_jsx(SelectPrimitive.Separator, { className: cn("-mx-1.5 my-1.5 bg-hairline h-px", className), ...props }));
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../../src/components/ui/select.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAa,CAAC;AACxC,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC;;;;;6CAK6C;AAE7C,MAAM,CAAC,MAAM,MAAM,GAAG,eAAe,CAAC,IAAI,CAAC;AAC3C,MAAM,CAAC,MAAM,WAAW,GAAG,eAAe,CAAC,KAAK,CAAC;AACjD,MAAM,CAAC,MAAM,WAAW,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AC,aAAa,cAC1B,KAAC,KAAK,IAAC,SAAS,EAAC,2BAA2B,GAAG,GACnB,GAC7B,IACY,CAC1B,CAAC;AACN,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EAC6C;IACrD,OAAO,CACH,KAAC,eAAe,CAAC,KAAK,IAClB,SAAS,EAAE,EAAE,CAAC,6DAA6D,EAAE,SAAS,CAAC,KACnF,KAAK,GACX,CACL,CAAC;AACN,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,EAC5B,SAAS,EACT,GAAG,KAAK,EACiD;IACzD,OAAO,CACH,KAAC,eAAe,CAAC,SAAS,IACtB,SAAS,EAAE,EAAE,CAAC,iCAAiC,EAAE,SAAS,CAAC,KACvD,KAAK,GACX,CACL,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export declare function SelectionBar({ count, noun, empty, onDone, children, className, }: {
|
|
3
|
+
count: number;
|
|
4
|
+
/** Singular; an "s" is added for any count but one. */
|
|
5
|
+
noun?: string;
|
|
6
|
+
/** Said while nothing is picked yet. */
|
|
7
|
+
empty?: string;
|
|
8
|
+
onDone: () => void;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
className?: string;
|
|
11
|
+
}): import("react").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=selection-bar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selection-bar.d.ts","sourceRoot":"","sources":["../../../src/components/ui/selection-bar.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAUvC,wBAAgB,YAAY,CAAC,EACzB,KAAK,EACL,IAAa,EACb,KAAmB,EACnB,MAAM,EACN,QAAQ,EACR,SAAS,GACZ,EAAE;IACC,KAAK,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,+BAoBA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { X } from "lucide-react";
|
|
4
|
+
import { Button } from "./button.js";
|
|
5
|
+
import { cn } from "../../lib/utils.js";
|
|
6
|
+
/* What can be done to the things picked: a bar that rises from the bottom of
|
|
7
|
+
the window while a selection is being made, saying how many and offering
|
|
8
|
+
the actions as its children (ghost buttons, small).
|
|
9
|
+
|
|
10
|
+
It centres on the page, not the window: if the app sets `--sidebar-w` (as
|
|
11
|
+
`AppShell` does) it clears the sidebar. Pair it with `useSelection`. */
|
|
12
|
+
export function SelectionBar({ count, noun = "item", empty = "Pick some", onDone, children, className, }) {
|
|
13
|
+
return (_jsxs("div", { role: "toolbar", "aria-label": "Selection", className: cn("fixed bottom-5 left-[calc(50%+var(--sidebar-w,0px)/2)] z-40 flex max-w-[calc(100vw-2rem)] -translate-x-1/2 animate-slide-in items-center gap-1", "rounded-overlay bg-surface-overlay py-1.5 pr-1.5 pl-4 shadow-popover", className), children: [_jsx("span", { className: "mr-2 text-sm font-medium whitespace-nowrap text-ink tabular-nums", "aria-live": "polite", children: count === 0 ? empty : `${count.toLocaleString()} ${noun}${count === 1 ? "" : "s"} selected` }), children, _jsx(Button, { variant: "ghost", size: "icon-sm", "aria-label": "Stop selecting", onClick: onDone, className: "ml-1", children: _jsx(X, {}) })] }));
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=selection-bar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selection-bar.js","sourceRoot":"","sources":["../../../src/components/ui/selection-bar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAEjC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAc,CAAC;AACtC,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC;;;;;0EAK0E;AAC1E,MAAM,UAAU,YAAY,CAAC,EACzB,KAAK,EACL,IAAI,GAAG,MAAM,EACb,KAAK,GAAG,WAAW,EACnB,MAAM,EACN,QAAQ,EACR,SAAS,GAUZ;IACG,OAAO,CACH,eACI,IAAI,EAAC,SAAS,gBACH,WAAW,EACtB,SAAS,EAAE,EAAE,CACT,gJAAgJ,EAChJ,sEAAsE,EACtE,SAAS,CACZ,aAED,eAAM,SAAS,EAAC,kEAAkE,eAAW,QAAQ,YAChG,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,cAAc,EAAE,IAAI,IAAI,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,WAAW,GACzF,EACN,QAAQ,EACT,KAAC,MAAM,IAAC,OAAO,EAAC,OAAO,EAAC,IAAI,EAAC,SAAS,gBAAY,gBAAgB,EAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAC,MAAM,YAChG,KAAC,CAAC,KAAG,GACA,IACP,CACT,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
2
|
+
import type { ComponentPropsWithoutRef } from "react";
|
|
3
|
+
export declare function Separator({ className, orientation, decorative, ...props }: ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>): import("react").JSX.Element;
|
|
4
|
+
//# sourceMappingURL=separator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"separator.d.ts","sourceRoot":"","sources":["../../../src/components/ui/separator.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,kBAAkB,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAMtD,wBAAgB,SAAS,CAAC,EACtB,SAAS,EACT,WAA0B,EAC1B,UAAiB,EACjB,GAAG,KAAK,EACX,EAAE,wBAAwB,CAAC,OAAO,kBAAkB,CAAC,IAAI,CAAC,+BAe1D"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
4
|
+
import { cn } from "../../lib/utils.js";
|
|
5
|
+
/* Dividers whisper. 1px at 9% ink — if you can see it clearly from
|
|
6
|
+
across the room, it is too strong. */
|
|
7
|
+
export function Separator({ className, orientation = "horizontal", decorative = true, ...props }) {
|
|
8
|
+
return (_jsx(SeparatorPrimitive.Root, { decorative: decorative, orientation: orientation, className: cn("bg-hairline shrink-0", orientation === "horizontal"
|
|
9
|
+
? "w-full h-px"
|
|
10
|
+
: "w-px h-full self-stretch", className), ...props }));
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=separator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"separator.js","sourceRoot":"","sources":["../../../src/components/ui/separator.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,kBAAkB,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC;wCACwC;AAExC,MAAM,UAAU,SAAS,CAAC,EACtB,SAAS,EACT,WAAW,GAAG,YAAY,EAC1B,UAAU,GAAG,IAAI,EACjB,GAAG,KAAK,EAC+C;IACvD,OAAO,CACH,KAAC,kBAAkB,CAAC,IAAI,IACpB,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,EAAE,CACT,sBAAsB,EACtB,WAAW,KAAK,YAAY;YACxB,CAAC,CAAC,aAAa;YACf,CAAC,CAAC,0BAA0B,EAChC,SAAS,CACZ,KACG,KAAK,GACX,CACL,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type LucideIcon } from "lucide-react";
|
|
2
|
+
import { type ReactNode } from "react";
|
|
3
|
+
import { type SpotlightEntry } from "../../lib/spotlight.js";
|
|
4
|
+
export type SpotlightItem = SpotlightEntry & {
|
|
5
|
+
icon?: LucideIcon;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* ⌘K (Ctrl+K elsewhere) from anywhere on the page calls `toggle`. Kept apart from
|
|
9
|
+
* the Spotlight so the owner decides what the shortcut opens and when.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useSpotlightShortcut(toggle: () => void): void;
|
|
12
|
+
export declare function Spotlight({ open, onOpenChange, items, onPick, placeholder, empty, title, }: {
|
|
13
|
+
open: boolean;
|
|
14
|
+
onOpenChange: (open: boolean) => void;
|
|
15
|
+
items: SpotlightItem[];
|
|
16
|
+
onPick: (item: SpotlightItem) => void;
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
/** Shown in place of results when nothing matches. */
|
|
19
|
+
empty?: ReactNode;
|
|
20
|
+
/** Read out to assistive technology; not shown. */
|
|
21
|
+
title?: string;
|
|
22
|
+
}): import("react").JSX.Element;
|
|
23
|
+
//# sourceMappingURL=spotlight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spotlight.d.ts","sourceRoot":"","sources":["../../../src/components/ui/spotlight.tsx"],"names":[],"mappings":"AAGA,OAAO,EAA0B,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AACvE,OAAO,EAAyD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC9F,OAAO,EAAe,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAI1E,MAAM,MAAM,aAAa,GAAG,cAAc,GAAG;IAAE,IAAI,CAAC,EAAE,UAAU,CAAA;CAAE,CAAC;AAKnE;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,IAAI,GAAG,IAAI,CAa7D;AAmCD,wBAAgB,SAAS,CAAC,EACtB,IAAI,EACJ,YAAY,EACZ,KAAK,EACL,MAAM,EACN,WAAuB,EACvB,KAAyB,EACzB,KAAe,GAClB,EAAE;IACC,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,MAAM,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sDAAsD;IACtD,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,mDAAmD;IACnD,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB,+BAyIA"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
4
|
+
import { CornerDownLeft, Search } from "lucide-react";
|
|
5
|
+
import { Fragment, useEffect, useId, useMemo, useRef, useState } from "react";
|
|
6
|
+
import { rankEntries } from "../../lib/spotlight.js";
|
|
7
|
+
import { cn } from "../../lib/utils.js";
|
|
8
|
+
import { Kbd } from "./typography.js";
|
|
9
|
+
/** Whether the platform's own shortcut modifier is ⌘ rather than Ctrl. */
|
|
10
|
+
const mac = () => typeof navigator !== "undefined" && /Mac|iPhone|iPad/.test(navigator.platform);
|
|
11
|
+
/**
|
|
12
|
+
* ⌘K (Ctrl+K elsewhere) from anywhere on the page calls `toggle`. Kept apart from
|
|
13
|
+
* the Spotlight so the owner decides what the shortcut opens and when.
|
|
14
|
+
*/
|
|
15
|
+
export function useSpotlightShortcut(toggle) {
|
|
16
|
+
const latest = useRef(toggle);
|
|
17
|
+
latest.current = toggle;
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
const onKey = (e) => {
|
|
20
|
+
if (e.key.toLowerCase() === "k" && (e.metaKey || e.ctrlKey) && !e.altKey && !e.shiftKey) {
|
|
21
|
+
e.preventDefault();
|
|
22
|
+
latest.current();
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
window.addEventListener("keydown", onKey);
|
|
26
|
+
return () => window.removeEventListener("keydown", onKey);
|
|
27
|
+
}, []);
|
|
28
|
+
}
|
|
29
|
+
/** The label with the typed letters picked out. */
|
|
30
|
+
function Marked({ text, hits }) {
|
|
31
|
+
if (hits.length === 0)
|
|
32
|
+
return _jsx(_Fragment, { children: text });
|
|
33
|
+
const at = new Set(hits);
|
|
34
|
+
const runs = [];
|
|
35
|
+
for (let i = 0; i < text.length; i++) {
|
|
36
|
+
const hit = at.has(i);
|
|
37
|
+
const last = runs.at(-1);
|
|
38
|
+
if (last && last.hit === hit)
|
|
39
|
+
last.text += text[i];
|
|
40
|
+
else
|
|
41
|
+
runs.push({ text: text[i], hit });
|
|
42
|
+
}
|
|
43
|
+
return (_jsx(_Fragment, { children: runs.map((run, i) => run.hit ? (_jsx("mark", { className: "bg-transparent font-semibold text-ink underline decoration-accent/50 underline-offset-2", children: run.text }, i)) : (_jsx(Fragment, { children: run.text }, i))) }));
|
|
44
|
+
}
|
|
45
|
+
/* Jump anywhere by typing: a search field over every place the owner lists, best
|
|
46
|
+
match first. The keyboard never leaves the field — the arrows move the highlight,
|
|
47
|
+
Enter goes, Escape closes — so a page is a few keystrokes away.
|
|
48
|
+
|
|
49
|
+
With nothing typed it lists the entries as given, under their groups, so the
|
|
50
|
+
owner decides what is offered first (the current page's neighbours, say). Once
|
|
51
|
+
something is typed it is one ranked list, each entry's group shown beside it. */
|
|
52
|
+
export function Spotlight({ open, onOpenChange, items, onPick, placeholder = "Search…", empty = "Nothing matches", title = "Go to", }) {
|
|
53
|
+
const [query, setQuery] = useState("");
|
|
54
|
+
const [index, setIndex] = useState(0);
|
|
55
|
+
const list = useRef(null);
|
|
56
|
+
const id = useId();
|
|
57
|
+
// Every opening starts afresh.
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
if (!open)
|
|
60
|
+
return;
|
|
61
|
+
setQuery("");
|
|
62
|
+
setIndex(0);
|
|
63
|
+
}, [open]);
|
|
64
|
+
const results = useMemo(() => rankEntries(items, query), [items, query]);
|
|
65
|
+
const browsing = query.trim() === "";
|
|
66
|
+
const active = Math.min(index, Math.max(results.length - 1, 0));
|
|
67
|
+
// The keyboard moves the highlight, so the list follows it out of view.
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
list.current?.querySelector('[aria-selected="true"]')?.scrollIntoView({ block: "nearest" });
|
|
70
|
+
}, [active, open]);
|
|
71
|
+
const pick = (item) => {
|
|
72
|
+
if (item === undefined)
|
|
73
|
+
return;
|
|
74
|
+
onOpenChange(false);
|
|
75
|
+
onPick(item);
|
|
76
|
+
};
|
|
77
|
+
const move = (by) => {
|
|
78
|
+
if (results.length === 0)
|
|
79
|
+
return;
|
|
80
|
+
setIndex((active + by + results.length) % results.length);
|
|
81
|
+
};
|
|
82
|
+
return (_jsx(DialogPrimitive.Root, { open: open, onOpenChange: onOpenChange, children: _jsxs(DialogPrimitive.Portal, { children: [_jsx(DialogPrimitive.Overlay, { className: "z-50 fixed inset-0 bg-black/32 data-[state=open]:animate-fade-in data-[state=closed]:animate-fade-out" }), _jsxs(DialogPrimitive.Content, { "aria-describedby": undefined, className: cn("z-50 fixed top-[12dvh] left-1/2 -translate-x-1/2 flex flex-col", "w-[calc(100vw-2rem)] max-w-xl max-h-[min(30rem,76dvh)] overflow-hidden outline-none", "bg-surface-overlay shadow-dialog rounded-overlay", "data-[state=open]:animate-scale-in data-[state=closed]:animate-scale-out"), children: [_jsx(DialogPrimitive.Title, { className: "sr-only", children: title }), _jsxs("div", { className: "flex items-center gap-2.5 shadow-[inset_0_-1px_0_var(--hairline)] px-4 h-12 shrink-0", children: [_jsx(Search, { className: "size-4 text-ink-tertiary shrink-0" }), _jsx("input", { autoFocus: true, role: "combobox", "aria-expanded": true, "aria-controls": `${id}-list`, "aria-activedescendant": results.length > 0 ? `${id}-${active}` : undefined, "aria-autocomplete": "list", value: query, placeholder: placeholder, onChange: (e) => {
|
|
83
|
+
setQuery(e.target.value);
|
|
84
|
+
setIndex(0);
|
|
85
|
+
}, onKeyDown: (e) => {
|
|
86
|
+
const ctrl = e.ctrlKey && !e.metaKey;
|
|
87
|
+
if (e.key === "ArrowDown" || (ctrl && e.key === "n")) {
|
|
88
|
+
e.preventDefault();
|
|
89
|
+
move(1);
|
|
90
|
+
}
|
|
91
|
+
else if (e.key === "ArrowUp" || (ctrl && e.key === "p")) {
|
|
92
|
+
e.preventDefault();
|
|
93
|
+
move(-1);
|
|
94
|
+
}
|
|
95
|
+
else if (e.key === "Enter" && !e.nativeEvent.isComposing) {
|
|
96
|
+
e.preventDefault();
|
|
97
|
+
pick(results[active]?.item);
|
|
98
|
+
}
|
|
99
|
+
}, className: "flex-1 bg-transparent min-w-0 text-ink placeholder:text-ink-tertiary outline-none" })] }), _jsxs("div", { ref: list, id: `${id}-list`, role: "listbox", "aria-label": title, className: "flex-1 p-1.5 min-h-0 overflow-y-auto overscroll-contain", children: [results.length === 0 && _jsx("p", { className: "px-3 py-6 text-ink-tertiary text-sm text-center", children: empty }), results.map(({ item, hits }, i) => {
|
|
100
|
+
const heading = browsing && item.group !== undefined && item.group !== results[i - 1]?.item.group;
|
|
101
|
+
const Icon = item.icon;
|
|
102
|
+
return (_jsxs(Fragment, { children: [heading && _jsx("div", { className: "px-2 pt-2.5 pb-1 font-medium text-caption text-ink-tertiary first:pt-1", children: item.group }), _jsxs("div", { id: `${id}-${i}`, role: "option", "aria-selected": i === active,
|
|
103
|
+
// Movement, not entry: a list scrolled under a still pointer keeps the keyboard's pick.
|
|
104
|
+
onPointerMove: () => i !== active && setIndex(i), onClick: () => pick(item), className: cn("flex items-center gap-2.5 px-2 rounded-control h-9 text-sm cursor-pointer select-none", i === active && "bg-tint-hover"), children: [Icon && _jsx(Icon, { className: "size-4 text-ink-secondary shrink-0" }), _jsx("span", { className: "min-w-0 text-ink truncate", children: _jsx(Marked, { text: item.label, hits: hits }) }), (item.hint ?? (!browsing ? item.group : undefined)) && (_jsx("span", { className: "min-w-0 text-ink-tertiary truncate", children: item.hint ?? item.group })), i === active && _jsx(CornerDownLeft, { className: "ml-auto size-3.5 text-ink-tertiary shrink-0" })] })] }, item.key));
|
|
105
|
+
})] }), _jsxs("div", { className: "max-sm:hidden flex items-center gap-4 shadow-[inset_0_1px_0_var(--hairline)] px-4 h-9 text-caption text-ink-tertiary shrink-0", children: [_jsxs("span", { className: "flex items-center gap-1", children: [_jsx(Kbd, { children: "\u2191" }), _jsx(Kbd, { children: "\u2193" }), "to move"] }), _jsxs("span", { className: "flex items-center gap-1", children: [_jsx(Kbd, { children: "\u21B5" }), "to open"] }), _jsxs("span", { className: "flex items-center gap-1", children: [_jsx(Kbd, { children: "esc" }), "to close"] }), _jsxs("span", { className: "flex items-center gap-1 ml-auto", children: [_jsx(Kbd, { children: mac() ? "⌘" : "Ctrl" }), _jsx(Kbd, { children: "K" }), "anywhere"] })] })] })] }) }));
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=spotlight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spotlight.js","sourceRoot":"","sources":["../../../src/components/ui/spotlight.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,EAAmB,MAAM,cAAc,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAC9F,OAAO,EAAE,WAAW,EAAuB,MAAM,wBAAwB,CAAC;AAC1E,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label: string;
|
|
4
|
+
value: ReactNode;
|
|
5
|
+
note?: ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=stat-tile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stat-tile.d.ts","sourceRoot":"","sources":["../../../src/components/ui/stat-tile.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvC,wBAAgB,QAAQ,CAAC,EACrB,KAAK,EACL,KAAK,EACL,IAAI,EACJ,SAAS,GACZ,EAAE;IACC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,+BAQA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../lib/utils.js";
|
|
3
|
+
/* One headline figure: a quiet label, the number in the accent's text shade, and an
|
|
4
|
+
optional line of context. Lay several out in a grid; `min-w-0` lets them shrink
|
|
5
|
+
in one. */
|
|
6
|
+
export function StatTile({ label, value, note, className, }) {
|
|
7
|
+
return (_jsxs("div", { className: cn("min-w-0 rounded-surface bg-surface-sunken px-4 py-3", className), children: [_jsx("div", { className: "text-caption font-medium text-ink-secondary", children: label }), _jsx("div", { className: "mt-0.5 text-h3 break-all text-accent-text tabular-nums", children: value }), note && _jsx("div", { className: "mt-0.5 text-caption text-ink-tertiary", children: note })] }));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=stat-tile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stat-tile.js","sourceRoot":"","sources":["../../../src/components/ui/stat-tile.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC;;aAEa;AACb,MAAM,UAAU,QAAQ,CAAC,EACrB,KAAK,EACL,KAAK,EACL,IAAI,EACJ,SAAS,GAMZ;IACG,OAAO,CACH,eAAK,SAAS,EAAE,EAAE,CAAC,qDAAqD,EAAE,SAAS,CAAC,aAChF,cAAK,SAAS,EAAC,6CAA6C,YAAE,KAAK,GAAO,EAC1E,cAAK,SAAS,EAAC,wDAAwD,YAAE,KAAK,GAAO,EACpF,IAAI,IAAI,cAAK,SAAS,EAAC,uCAAuC,YAAE,IAAI,GAAO,IAC1E,CACT,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export declare function Stepper({ steps, step, className }: {
|
|
3
|
+
steps: readonly string[];
|
|
4
|
+
step: number;
|
|
5
|
+
className?: string;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
7
|
+
export declare function StepDialog({ open, onOpenChange, steps, step, title, description, banner, children, footer, className, }: {
|
|
8
|
+
open: boolean;
|
|
9
|
+
onOpenChange: (open: boolean) => void;
|
|
10
|
+
steps: readonly string[];
|
|
11
|
+
step: number;
|
|
12
|
+
title: ReactNode;
|
|
13
|
+
description?: ReactNode;
|
|
14
|
+
/** Between the header and the body: a progress bar, a warning. */
|
|
15
|
+
banner?: ReactNode;
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
footer: ReactNode;
|
|
18
|
+
className?: string;
|
|
19
|
+
}): import("react").JSX.Element;
|
|
20
|
+
//# sourceMappingURL=step-dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-dialog.d.ts","sourceRoot":"","sources":["../../../src/components/ui/step-dialog.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAyC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAO9E,wBAAgB,OAAO,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;IAAE,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,+BA+BjH;AAYD,wBAAgB,UAAU,CAAC,EACvB,IAAI,EACJ,YAAY,EACZ,KAAK,EACL,IAAI,EACJ,KAAK,EACL,WAAW,EACX,MAAM,EACN,QAAQ,EACR,MAAM,EACN,SAAS,GACZ,EAAE;IACC,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,kEAAkE;IAClE,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,EAAE,SAAS,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,+BA2BA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Check } from "lucide-react";
|
|
4
|
+
import { useEffect, useRef } from "react";
|
|
5
|
+
import { Dialog, DialogContent, DialogDescription, DialogTitle } from "./dialog.js";
|
|
6
|
+
import { cn } from "../../lib/utils.js";
|
|
7
|
+
/* Where a sequence of steps stands: done ones ticked, the current one ringed,
|
|
8
|
+
the rest waiting. Numbered because it is a sequence; do not use it for
|
|
9
|
+
things that are merely a list. Labels drop away on a narrow screen. */
|
|
10
|
+
export function Stepper({ steps, step, className }) {
|
|
11
|
+
return (_jsx("ol", { className: cn("flex items-center gap-2 text-sm", className), children: steps.map((label, index) => (_jsxs("li", { className: "flex items-center gap-2", children: [index > 0 && _jsx("span", { "aria-hidden": true, className: cn("h-px w-5 transition-colors duration-200 sm:w-8", index <= step ? "bg-accent" : "bg-hairline-strong") }), _jsxs("span", { "aria-current": index === step ? "step" : undefined, className: cn("flex items-center gap-1.5 transition-colors duration-200", index === step ? "font-medium text-ink" : index < step ? "text-ink-secondary" : "text-ink-tertiary"), children: [_jsx("span", { className: cn("flex size-5 items-center justify-center rounded-full text-caption font-medium tabular-nums transition-colors duration-200", index < step
|
|
12
|
+
? "bg-accent text-accent-ink"
|
|
13
|
+
: index === step
|
|
14
|
+
? "bg-accent-tint text-accent-text shadow-[inset_0_0_0_1px_var(--accent)]"
|
|
15
|
+
: "bg-tint-active text-ink-tertiary"), children: index < step ? _jsx(Check, { className: "size-3" }) : index + 1 }), _jsx("span", { className: "max-sm:hidden", children: label })] })] }, label))) }));
|
|
16
|
+
}
|
|
17
|
+
/* A dialog that is several steps long: choose, review, send, done.
|
|
18
|
+
|
|
19
|
+
It keeps one size while its content changes, so nothing jumps. The header
|
|
20
|
+
holds the stepper and a title; the body is whatever the current step is,
|
|
21
|
+
and slides in from the side the step came from; the footer holds the
|
|
22
|
+
buttons, which you supply per step.
|
|
23
|
+
|
|
24
|
+
You own `step`. Derive it from what there is where you can (files chosen
|
|
25
|
+
but not sent, work in flight, work finished) instead of advancing it by
|
|
26
|
+
hand: then closing and reopening lands on the right step for free. */
|
|
27
|
+
export function StepDialog({ open, onOpenChange, steps, step, title, description, banner, children, footer, className, }) {
|
|
28
|
+
// Which way the last change went, so the new step arrives from that side.
|
|
29
|
+
const last = useRef(step);
|
|
30
|
+
const from = step >= last.current ? 1 : -1;
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
last.current = step;
|
|
33
|
+
}, [step]);
|
|
34
|
+
return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsxs(DialogContent, { className: cn("flex h-[min(46rem,90dvh)] max-w-4xl flex-col overflow-hidden", className), "aria-describedby": undefined, children: [_jsxs("header", { className: "shrink-0 px-6 pt-5 pr-14", children: [_jsx(Stepper, { steps: steps, step: step }), _jsx(DialogTitle, { className: "mt-4 text-h2", children: title }), _jsx(DialogDescription, { className: "min-h-5", children: description }), banner] }), _jsx("div", { className: "min-h-0 flex-1 animate-step-in overflow-y-auto px-6 py-4", style: { "--from": from }, children: children }, step), _jsx("footer", { className: "flex shrink-0 items-center gap-2 px-6 py-4 shadow-[inset_0_1px_0_var(--hairline)]", children: footer })] }) }));
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=step-dialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-dialog.js","sourceRoot":"","sources":["../../../src/components/ui/step-dialog.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAsC,MAAM,OAAO,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,aAAc,CAAC;AACrF,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC;;yEAEyE;AACzE,MAAM,UAAU,OAAO,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAkE;IAC9G,OAAO,CACH,aAAI,SAAS,EAAE,EAAE,CAAC,iCAAiC,EAAE,SAAS,CAAC,YAC1D,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CACzB,cAAgB,SAAS,EAAC,yBAAyB,aAC9C,KAAK,GAAG,CAAC,IAAI,oCAAkB,SAAS,EAAE,EAAE,CAAC,gDAAgD,EAAE,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,oBAAoB,CAAC,GAAI,EACvJ,gCACkB,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EACjD,SAAS,EAAE,EAAE,CACT,0DAA0D,EAC1D,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,sBAAsB,CAA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AK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,GAAI,EACrC,KAAC,WAAW,IAAC,SAAS,EAAC,cAAc,YAAE,KAAK,GAAe,EAE3D,KAAC,iBAAiB,IAAC,SAAS,EAAC,SAAS,YAAE,WAAW,GAAqB,EACvE,MAAM,IACF,EAET,cAAgB,SAAS,EAAC,0DAA0D,EAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAmB,YAC1H,QAAQ,IADH,IAAI,CAER,EAEN,iBAAQ,SAAS,EAAC,mFAAmF,YAAE,MAAM,GAAU,IAC3G,GACX,CACZ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef } from "react";
|
|
2
|
+
export declare function Table({ className, children, ...props }: ComponentPropsWithoutRef<"table">): import("react").JSX.Element;
|
|
3
|
+
export declare function Th({ className, ...props }: ComponentPropsWithoutRef<"th">): import("react").JSX.Element;
|
|
4
|
+
export declare function Td({ className, ...props }: ComponentPropsWithoutRef<"td">): import("react").JSX.Element;
|
|
5
|
+
export declare function ClickableRow({ className, onOpen, ...props }: ComponentPropsWithoutRef<"tr"> & {
|
|
6
|
+
onOpen: () => void;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../src/components/ui/table.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAOtD,wBAAgB,KAAK,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,wBAAwB,CAAC,OAAO,CAAC,+BAQzF;AAID,wBAAgB,EAAE,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,wBAAwB,CAAC,IAAI,CAAC,+BAEzE;AAED,wBAAgB,EAAE,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,wBAAwB,CAAC,IAAI,CAAC,+BAEzE;AAGD,wBAAgB,YAAY,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,EAAE,wBAAwB,CAAC,IAAI,CAAC,GAAG;IAAE,MAAM,EAAE,MAAM,IAAI,CAAA;CAAE,+BAWpH"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "../../lib/utils.js";
|
|
4
|
+
/* Notion's simple table: a hairline grid, a sunken header row, 14px text. It scrolls
|
|
5
|
+
sideways inside its own box rather than squeezing columns below a readable width,
|
|
6
|
+
which is what keeps a page from scrolling sideways on a phone. */
|
|
7
|
+
export function Table({ className, children, ...props }) {
|
|
8
|
+
return (_jsx("div", { className: "overflow-x-auto", children: _jsx("table", { className: cn("w-full border-collapse text-sm", className), ...props, children: children }) }));
|
|
9
|
+
}
|
|
10
|
+
const cell = "border border-hairline-strong px-[9px] py-[7px] text-left align-top";
|
|
11
|
+
export function Th({ className, ...props }) {
|
|
12
|
+
return _jsx("th", { scope: "col", className: cn(cell, "bg-surface-sunken font-medium", className), ...props });
|
|
13
|
+
}
|
|
14
|
+
export function Td({ className, ...props }) {
|
|
15
|
+
return _jsx("td", { className: cn(cell, "min-w-28", className), ...props });
|
|
16
|
+
}
|
|
17
|
+
/* A row that opens something: hover tint, pointer, and Enter from the keyboard. */
|
|
18
|
+
export function ClickableRow({ className, onOpen, ...props }) {
|
|
19
|
+
return (_jsx("tr", { tabIndex: 0,
|
|
20
|
+
// A link inside a cell keeps its own click.
|
|
21
|
+
onClick: (e) => !e.target.closest("a") && onOpen(), onKeyDown: (e) => e.key === "Enter" && onOpen(), className: cn("cursor-pointer outline-offset-[-2px] transition-colors duration-100 hover:bg-tint-hover", className), ...props }));
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=table.js.map
|
|
@@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