@nikala-ui/docs 0.12.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/README.md +22 -0
- package/dist/cli/commands/build.d.ts +5 -0
- package/dist/cli/commands/build.d.ts.map +1 -0
- package/dist/cli/commands/build.js +27 -0
- package/dist/cli/commands/build.js.map +1 -0
- package/dist/cli/commands/dev.d.ts +7 -0
- package/dist/cli/commands/dev.d.ts.map +1 -0
- package/dist/cli/commands/dev.js +32 -0
- package/dist/cli/commands/dev.js.map +1 -0
- package/dist/cli/commands/init.d.ts +2 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +308 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/preview.d.ts +7 -0
- package/dist/cli/commands/preview.d.ts.map +1 -0
- package/dist/cli/commands/preview.js +24 -0
- package/dist/cli/commands/preview.js.map +1 -0
- package/dist/cli/commands/serve.d.ts +7 -0
- package/dist/cli/commands/serve.d.ts.map +1 -0
- package/dist/cli/commands/serve.js +33 -0
- package/dist/cli/commands/serve.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +53 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/client/App.d.ts +5 -0
- package/dist/client/App.d.ts.map +1 -0
- package/dist/client/App.jsx +31 -0
- package/dist/client/App.jsx.map +1 -0
- package/dist/client/app-types.d.ts +14 -0
- package/dist/client/app-types.d.ts.map +1 -0
- package/dist/client/app-types.js +2 -0
- package/dist/client/app-types.js.map +1 -0
- package/dist/client/components/DocsLayoutShell.d.ts +21 -0
- package/dist/client/components/DocsLayoutShell.d.ts.map +1 -0
- package/dist/client/components/DocsLayoutShell.jsx +14 -0
- package/dist/client/components/DocsLayoutShell.jsx.map +1 -0
- package/dist/client/components/DocsPageContent.d.ts +9 -0
- package/dist/client/components/DocsPageContent.d.ts.map +1 -0
- package/dist/client/components/DocsPageContent.jsx +10 -0
- package/dist/client/components/DocsPageContent.jsx.map +1 -0
- package/dist/client/entry.d.ts +2 -0
- package/dist/client/entry.d.ts.map +1 -0
- package/dist/client/entry.jsx +28 -0
- package/dist/client/entry.jsx.map +1 -0
- package/dist/client/index.html +21 -0
- package/dist/client/navigation/page-navigation.d.ts +9 -0
- package/dist/client/navigation/page-navigation.d.ts.map +1 -0
- package/dist/client/navigation/page-navigation.js +51 -0
- package/dist/client/navigation/page-navigation.js.map +1 -0
- package/dist/client/routing/use-docs-router.d.ts +17 -0
- package/dist/client/routing/use-docs-router.d.ts.map +1 -0
- package/dist/client/routing/use-docs-router.js +71 -0
- package/dist/client/routing/use-docs-router.js.map +1 -0
- package/dist/client/ssr-entry.d.ts +3 -0
- package/dist/client/ssr-entry.d.ts.map +1 -0
- package/dist/client/ssr-entry.jsx +13 -0
- package/dist/client/ssr-entry.jsx.map +1 -0
- package/dist/client/style.css +183 -0
- package/dist/client/utils/sidebar.d.ts +2 -0
- package/dist/client/utils/sidebar.d.ts.map +1 -0
- package/dist/client/utils/sidebar.js +2 -0
- package/dist/client/utils/sidebar.js.map +1 -0
- package/dist/components/mdx-components.d.ts +34 -0
- package/dist/components/mdx-components.d.ts.map +1 -0
- package/dist/components/mdx-components.jsx +131 -0
- package/dist/components/mdx-components.jsx.map +1 -0
- package/dist/config.d.ts +6 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +105 -0
- package/dist/config.js.map +1 -0
- package/dist/core/content-scanner.d.ts +10 -0
- package/dist/core/content-scanner.d.ts.map +1 -0
- package/dist/core/content-scanner.js +153 -0
- package/dist/core/content-scanner.js.map +1 -0
- package/dist/core/route-tree.d.ts +19 -0
- package/dist/core/route-tree.d.ts.map +1 -0
- package/dist/core/route-tree.js +176 -0
- package/dist/core/route-tree.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/cn.d.ts +6 -0
- package/dist/lib/cn.d.ts.map +1 -0
- package/dist/lib/cn.js +9 -0
- package/dist/lib/cn.js.map +1 -0
- package/dist/mdx/compiler.d.ts +13 -0
- package/dist/mdx/compiler.d.ts.map +1 -0
- package/dist/mdx/compiler.js +38 -0
- package/dist/mdx/compiler.js.map +1 -0
- package/dist/mdx/highlighter.d.ts +22 -0
- package/dist/mdx/highlighter.d.ts.map +1 -0
- package/dist/mdx/highlighter.js +139 -0
- package/dist/mdx/highlighter.js.map +1 -0
- package/dist/mdx/rehype-shiki.d.ts +3 -0
- package/dist/mdx/rehype-shiki.d.ts.map +1 -0
- package/dist/mdx/rehype-shiki.js +83 -0
- package/dist/mdx/rehype-shiki.js.map +1 -0
- package/dist/navigation/index.d.ts +2 -0
- package/dist/navigation/index.d.ts.map +1 -0
- package/dist/navigation/index.js +2 -0
- package/dist/navigation/index.js.map +1 -0
- package/dist/navigation/sidebar-state.d.ts +6 -0
- package/dist/navigation/sidebar-state.d.ts.map +1 -0
- package/dist/navigation/sidebar-state.js +20 -0
- package/dist/navigation/sidebar-state.js.map +1 -0
- package/dist/navigation/sidebar-tree.d.ts +7 -0
- package/dist/navigation/sidebar-tree.d.ts.map +1 -0
- package/dist/navigation/sidebar-tree.js +11 -0
- package/dist/navigation/sidebar-tree.js.map +1 -0
- package/dist/registry/accordion.json +18 -0
- package/dist/registry/alert.json +18 -0
- package/dist/registry/api-table.json +21 -0
- package/dist/registry/aspect-ratio.json +17 -0
- package/dist/registry/avatar.json +17 -0
- package/dist/registry/badge.json +18 -0
- package/dist/registry/banner.json +19 -0
- package/dist/registry/breadcrumb.json +17 -0
- package/dist/registry/bubble.json +18 -0
- package/dist/registry/button-group.json +20 -0
- package/dist/registry/button.json +21 -0
- package/dist/registry/callout.json +19 -0
- package/dist/registry/card.json +17 -0
- package/dist/registry/checkbox.json +20 -0
- package/dist/registry/code-block.json +26 -0
- package/dist/registry/code-group.json +20 -0
- package/dist/registry/collapsible.json +18 -0
- package/dist/registry/combobox.json +21 -0
- package/dist/registry/command.json +27 -0
- package/dist/registry/component-viewer.json +25 -0
- package/dist/registry/container.json +18 -0
- package/dist/registry/context-menu.json +24 -0
- package/dist/registry/create-active-element.json +13 -0
- package/dist/registry/create-app-updater.json +13 -0
- package/dist/registry/create-audio.json +7 -0
- package/dist/registry/create-battery.json +13 -0
- package/dist/registry/create-chat-scroll.json +13 -0
- package/dist/registry/create-click-outside.json +13 -0
- package/dist/registry/create-clipboard.json +13 -0
- package/dist/registry/create-color-mode.json +13 -0
- package/dist/registry/create-controllable-signal.json +13 -0
- package/dist/registry/create-debounce.json +13 -0
- package/dist/registry/create-disclosure.json +13 -0
- package/dist/registry/create-document-tabs.json +13 -0
- package/dist/registry/create-document-title.json +13 -0
- package/dist/registry/create-drop-zone.json +13 -0
- package/dist/registry/create-event-source.json +13 -0
- package/dist/registry/create-favicon.json +13 -0
- package/dist/registry/create-fetch.json +13 -0
- package/dist/registry/create-focus-trap.json +13 -0
- package/dist/registry/create-form.json +13 -0
- package/dist/registry/create-fullscreen.json +13 -0
- package/dist/registry/create-geolocation.json +13 -0
- package/dist/registry/create-global-shortcut.json +13 -0
- package/dist/registry/create-hover.json +13 -0
- package/dist/registry/create-idle.json +13 -0
- package/dist/registry/create-infinite-scroll.json +13 -0
- package/dist/registry/create-input-mask.json +13 -0
- package/dist/registry/create-intersection-observer.json +13 -0
- package/dist/registry/create-keybindings.json +13 -0
- package/dist/registry/create-lock-scroll.json +13 -0
- package/dist/registry/create-long-press.json +13 -0
- package/dist/registry/create-media-query.json +13 -0
- package/dist/registry/create-mouse-position.json +13 -0
- package/dist/registry/create-network-status.json +13 -0
- package/dist/registry/create-orientation.json +13 -0
- package/dist/registry/create-pagination.json +13 -0
- package/dist/registry/create-permission.json +13 -0
- package/dist/registry/create-previous.json +13 -0
- package/dist/registry/create-resize-observer.json +13 -0
- package/dist/registry/create-scroll-into-view.json +13 -0
- package/dist/registry/create-scroll-position.json +13 -0
- package/dist/registry/create-storage.json +13 -0
- package/dist/registry/create-tauri-window.json +13 -0
- package/dist/registry/create-timer.json +13 -0
- package/dist/registry/create-tiptap-editor.json +34 -0
- package/dist/registry/create-undo-redo.json +13 -0
- package/dist/registry/create-web-notification.json +13 -0
- package/dist/registry/create-websocket.json +13 -0
- package/dist/registry/create-window-size.json +13 -0
- package/dist/registry/dialog.json +21 -0
- package/dist/registry/dropdown-menu.json +22 -0
- package/dist/registry/dropzone.json +21 -0
- package/dist/registry/empty.json +17 -0
- package/dist/registry/field.json +20 -0
- package/dist/registry/file-tree.json +21 -0
- package/dist/registry/footer.json +18 -0
- package/dist/registry/forgot-password-01.json +28 -0
- package/dist/registry/form-message.json +17 -0
- package/dist/registry/form.json +17 -0
- package/dist/registry/hero-01.json +22 -0
- package/dist/registry/hover-card.json +18 -0
- package/dist/registry/icon-button.json +20 -0
- package/dist/registry/index.json +1489 -0
- package/dist/registry/input-group.json +21 -0
- package/dist/registry/input.json +17 -0
- package/dist/registry/kbd.json +18 -0
- package/dist/registry/label.json +18 -0
- package/dist/registry/list.json +20 -0
- package/dist/registry/login-01.json +28 -0
- package/dist/registry/logo.json +17 -0
- package/dist/registry/marker.json +17 -0
- package/dist/registry/marquee.json +17 -0
- package/dist/registry/message.json +17 -0
- package/dist/registry/navbar.json +19 -0
- package/dist/registry/navigation-menu.json +22 -0
- package/dist/registry/number-input.json +24 -0
- package/dist/registry/otp-verification-01.json +26 -0
- package/dist/registry/package-manager-tabs.json +24 -0
- package/dist/registry/pager.json +21 -0
- package/dist/registry/pagination.json +22 -0
- package/dist/registry/pin-input.json +17 -0
- package/dist/registry/popover.json +22 -0
- package/dist/registry/progress.json +18 -0
- package/dist/registry/radio-group.json +18 -0
- package/dist/registry/rating.json +19 -0
- package/dist/registry/register-01.json +31 -0
- package/dist/registry/resizable.json +21 -0
- package/dist/registry/review-card.json +23 -0
- package/dist/registry/rich-text-editor.json +95 -0
- package/dist/registry/scroll-area.json +21 -0
- package/dist/registry/section-heading.json +21 -0
- package/dist/registry/select.json +22 -0
- package/dist/registry/separator.json +17 -0
- package/dist/registry/sheet.json +22 -0
- package/dist/registry/sidebar.json +24 -0
- package/dist/registry/skeleton.json +17 -0
- package/dist/registry/slider.json +18 -0
- package/dist/registry/spinner.json +18 -0
- package/dist/registry/stat.json +19 -0
- package/dist/registry/status.json +18 -0
- package/dist/registry/steps.json +20 -0
- package/dist/registry/switch.json +20 -0
- package/dist/registry/table-of-contents.json +23 -0
- package/dist/registry/table.json +17 -0
- package/dist/registry/tabs.json +20 -0
- package/dist/registry/textarea.json +17 -0
- package/dist/registry/theme-manager.json +39 -0
- package/dist/registry/timeline.json +18 -0
- package/dist/registry/titlebar-tabs.json +24 -0
- package/dist/registry/titlebar.json +26 -0
- package/dist/registry/toast.json +20 -0
- package/dist/registry/toggle-group.json +21 -0
- package/dist/registry/toggle.json +18 -0
- package/dist/registry/tooltip.json +18 -0
- package/dist/registry/updater-modal.json +26 -0
- package/dist/server/index.d.ts +18 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +526 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/plugin.d.ts +10 -0
- package/dist/server/plugin.d.ts.map +1 -0
- package/dist/server/plugin.js +271 -0
- package/dist/server/plugin.js.map +1 -0
- package/dist/themes/default/content/breadcrumbs.d.ts +4 -0
- package/dist/themes/default/content/breadcrumbs.d.ts.map +1 -0
- package/dist/themes/default/content/breadcrumbs.jsx +31 -0
- package/dist/themes/default/content/breadcrumbs.jsx.map +1 -0
- package/dist/themes/default/content/pager.d.ts +5 -0
- package/dist/themes/default/content/pager.d.ts.map +1 -0
- package/dist/themes/default/content/pager.jsx +9 -0
- package/dist/themes/default/content/pager.jsx.map +1 -0
- package/dist/themes/default/content/table-of-contents.d.ts +4 -0
- package/dist/themes/default/content/table-of-contents.d.ts.map +1 -0
- package/dist/themes/default/content/table-of-contents.jsx +19 -0
- package/dist/themes/default/content/table-of-contents.jsx.map +1 -0
- package/dist/themes/default/index.d.ts +11 -0
- package/dist/themes/default/index.d.ts.map +1 -0
- package/dist/themes/default/index.js +30 -0
- package/dist/themes/default/index.js.map +1 -0
- package/dist/themes/default/layout.d.ts +4 -0
- package/dist/themes/default/layout.d.ts.map +1 -0
- package/dist/themes/default/layout.jsx +75 -0
- package/dist/themes/default/layout.jsx.map +1 -0
- package/dist/themes/default/navbar.d.ts +4 -0
- package/dist/themes/default/navbar.d.ts.map +1 -0
- package/dist/themes/default/navbar.jsx +74 -0
- package/dist/themes/default/navbar.jsx.map +1 -0
- package/dist/themes/default/navigation/mobile-table-of-contents.d.ts +4 -0
- package/dist/themes/default/navigation/mobile-table-of-contents.d.ts.map +1 -0
- package/dist/themes/default/navigation/mobile-table-of-contents.jsx +22 -0
- package/dist/themes/default/navigation/mobile-table-of-contents.jsx.map +1 -0
- package/dist/themes/default/navigation/sidebar-tree.d.ts +8 -0
- package/dist/themes/default/navigation/sidebar-tree.d.ts.map +1 -0
- package/dist/themes/default/navigation/sidebar-tree.jsx +100 -0
- package/dist/themes/default/navigation/sidebar-tree.jsx.map +1 -0
- package/dist/themes/default/overlays/search-dialog.d.ts +4 -0
- package/dist/themes/default/overlays/search-dialog.d.ts.map +1 -0
- package/dist/themes/default/overlays/search-dialog.jsx +34 -0
- package/dist/themes/default/overlays/search-dialog.jsx.map +1 -0
- package/dist/themes/default/sidebar.d.ts +4 -0
- package/dist/themes/default/sidebar.d.ts.map +1 -0
- package/dist/themes/default/sidebar.jsx +60 -0
- package/dist/themes/default/sidebar.jsx.map +1 -0
- package/dist/themes/index.d.ts +4 -0
- package/dist/themes/index.d.ts.map +1 -0
- package/dist/themes/index.js +5 -0
- package/dist/themes/index.js.map +1 -0
- package/dist/themes/types.d.ts +83 -0
- package/dist/themes/types.d.ts.map +1 -0
- package/dist/themes/types.js +2 -0
- package/dist/themes/types.js.map +1 -0
- package/dist/types.d.ts +97 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/vendor/core-src/index.css +11 -0
- package/dist/vendor/core-src/index.ts +48 -0
- package/dist/vendor/core-src/lib/cn.ts +9 -0
- package/dist/vendor/core-src/registry/blocks/forgot-password-01.tsx +141 -0
- package/dist/vendor/core-src/registry/blocks/hero-01.tsx +28 -0
- package/dist/vendor/core-src/registry/blocks/login-01.tsx +231 -0
- package/dist/vendor/core-src/registry/blocks/otp-verification-01.tsx +170 -0
- package/dist/vendor/core-src/registry/blocks/register-01.tsx +318 -0
- package/dist/vendor/core-src/registry/components/ui/accordion.tsx +128 -0
- package/dist/vendor/core-src/registry/components/ui/alert.tsx +155 -0
- package/dist/vendor/core-src/registry/components/ui/api-table.tsx +117 -0
- package/dist/vendor/core-src/registry/components/ui/aspect-ratio.tsx +31 -0
- package/dist/vendor/core-src/registry/components/ui/avatar.tsx +114 -0
- package/dist/vendor/core-src/registry/components/ui/badge.tsx +56 -0
- package/dist/vendor/core-src/registry/components/ui/banner.tsx +187 -0
- package/dist/vendor/core-src/registry/components/ui/breadcrumb.tsx +136 -0
- package/dist/vendor/core-src/registry/components/ui/bubble.tsx +142 -0
- package/dist/vendor/core-src/registry/components/ui/button-group.tsx +42 -0
- package/dist/vendor/core-src/registry/components/ui/button.tsx +82 -0
- package/dist/vendor/core-src/registry/components/ui/callout.tsx +137 -0
- package/dist/vendor/core-src/registry/components/ui/card.tsx +113 -0
- package/dist/vendor/core-src/registry/components/ui/checkbox.tsx +74 -0
- package/dist/vendor/core-src/registry/components/ui/code-block.tsx +326 -0
- package/dist/vendor/core-src/registry/components/ui/code-group.tsx +105 -0
- package/dist/vendor/core-src/registry/components/ui/collapsible.tsx +73 -0
- package/dist/vendor/core-src/registry/components/ui/combobox.tsx +299 -0
- package/dist/vendor/core-src/registry/components/ui/command.tsx +378 -0
- package/dist/vendor/core-src/registry/components/ui/component-viewer.tsx +363 -0
- package/dist/vendor/core-src/registry/components/ui/container.tsx +45 -0
- package/dist/vendor/core-src/registry/components/ui/context-menu.tsx +237 -0
- package/dist/vendor/core-src/registry/components/ui/dialog.tsx +200 -0
- package/dist/vendor/core-src/registry/components/ui/dropdown-menu.tsx +298 -0
- package/dist/vendor/core-src/registry/components/ui/dropzone.tsx +189 -0
- package/dist/vendor/core-src/registry/components/ui/empty.tsx +83 -0
- package/dist/vendor/core-src/registry/components/ui/field.tsx +71 -0
- package/dist/vendor/core-src/registry/components/ui/file-tree.tsx +181 -0
- package/dist/vendor/core-src/registry/components/ui/footer.tsx +247 -0
- package/dist/vendor/core-src/registry/components/ui/form-message.tsx +36 -0
- package/dist/vendor/core-src/registry/components/ui/form.tsx +21 -0
- package/dist/vendor/core-src/registry/components/ui/hover-card.tsx +105 -0
- package/dist/vendor/core-src/registry/components/ui/icon-button.tsx +34 -0
- package/dist/vendor/core-src/registry/components/ui/input-group.tsx +80 -0
- package/dist/vendor/core-src/registry/components/ui/input.tsx +28 -0
- package/dist/vendor/core-src/registry/components/ui/kbd.tsx +73 -0
- package/dist/vendor/core-src/registry/components/ui/label.tsx +30 -0
- package/dist/vendor/core-src/registry/components/ui/list.tsx +222 -0
- package/dist/vendor/core-src/registry/components/ui/logo.tsx +68 -0
- package/dist/vendor/core-src/registry/components/ui/marker.tsx +102 -0
- package/dist/vendor/core-src/registry/components/ui/marquee.tsx +118 -0
- package/dist/vendor/core-src/registry/components/ui/message.tsx +168 -0
- package/dist/vendor/core-src/registry/components/ui/navbar.tsx +375 -0
- package/dist/vendor/core-src/registry/components/ui/navigation-menu.tsx +358 -0
- package/dist/vendor/core-src/registry/components/ui/number-input.tsx +150 -0
- package/dist/vendor/core-src/registry/components/ui/package-manager-tabs.tsx +226 -0
- package/dist/vendor/core-src/registry/components/ui/pager.tsx +102 -0
- package/dist/vendor/core-src/registry/components/ui/pagination.tsx +258 -0
- package/dist/vendor/core-src/registry/components/ui/pin-input.tsx +198 -0
- package/dist/vendor/core-src/registry/components/ui/popover.tsx +90 -0
- package/dist/vendor/core-src/registry/components/ui/progress.tsx +66 -0
- package/dist/vendor/core-src/registry/components/ui/radio-group.tsx +95 -0
- package/dist/vendor/core-src/registry/components/ui/rating.tsx +185 -0
- package/dist/vendor/core-src/registry/components/ui/resizable.tsx +195 -0
- package/dist/vendor/core-src/registry/components/ui/review-card.tsx +195 -0
- package/dist/vendor/core-src/registry/components/ui/rich-text-editor/bubble-menu.tsx +236 -0
- package/dist/vendor/core-src/registry/components/ui/rich-text-editor/editor.tsx +308 -0
- package/dist/vendor/core-src/registry/components/ui/rich-text-editor/extensions.ts +116 -0
- package/dist/vendor/core-src/registry/components/ui/rich-text-editor/footer.tsx +36 -0
- package/dist/vendor/core-src/registry/components/ui/rich-text-editor/image-dialog.tsx +75 -0
- package/dist/vendor/core-src/registry/components/ui/rich-text-editor/index.ts +11 -0
- package/dist/vendor/core-src/registry/components/ui/rich-text-editor/link-dialog.tsx +48 -0
- package/dist/vendor/core-src/registry/components/ui/rich-text-editor/markdown.ts +170 -0
- package/dist/vendor/core-src/registry/components/ui/rich-text-editor/slash-command.tsx +301 -0
- package/dist/vendor/core-src/registry/components/ui/rich-text-editor/table-controls.tsx +68 -0
- package/dist/vendor/core-src/registry/components/ui/rich-text-editor/toolbar.tsx +465 -0
- package/dist/vendor/core-src/registry/components/ui/rich-text-editor/use-editor.ts +231 -0
- package/dist/vendor/core-src/registry/components/ui/scroll-area.tsx +228 -0
- package/dist/vendor/core-src/registry/components/ui/section-heading.tsx +108 -0
- package/dist/vendor/core-src/registry/components/ui/select.tsx +156 -0
- package/dist/vendor/core-src/registry/components/ui/separator.tsx +37 -0
- package/dist/vendor/core-src/registry/components/ui/sheet.tsx +220 -0
- package/dist/vendor/core-src/registry/components/ui/sidebar.tsx +692 -0
- package/dist/vendor/core-src/registry/components/ui/skeleton.tsx +24 -0
- package/dist/vendor/core-src/registry/components/ui/slider.tsx +153 -0
- package/dist/vendor/core-src/registry/components/ui/spinner.tsx +41 -0
- package/dist/vendor/core-src/registry/components/ui/stat.tsx +245 -0
- package/dist/vendor/core-src/registry/components/ui/status.tsx +121 -0
- package/dist/vendor/core-src/registry/components/ui/steps.tsx +198 -0
- package/dist/vendor/core-src/registry/components/ui/switch.tsx +68 -0
- package/dist/vendor/core-src/registry/components/ui/table-of-contents.tsx +131 -0
- package/dist/vendor/core-src/registry/components/ui/table.tsx +160 -0
- package/dist/vendor/core-src/registry/components/ui/tabs.tsx +204 -0
- package/dist/vendor/core-src/registry/components/ui/textarea.tsx +82 -0
- package/dist/vendor/core-src/registry/components/ui/theme-toggle.tsx +238 -0
- package/dist/vendor/core-src/registry/components/ui/timeline.tsx +350 -0
- package/dist/vendor/core-src/registry/components/ui/titlebar-tabs.tsx +773 -0
- package/dist/vendor/core-src/registry/components/ui/titlebar.tsx +468 -0
- package/dist/vendor/core-src/registry/components/ui/toast.tsx +124 -0
- package/dist/vendor/core-src/registry/components/ui/toggle-group.tsx +203 -0
- package/dist/vendor/core-src/registry/components/ui/toggle.tsx +101 -0
- package/dist/vendor/core-src/registry/components/ui/tooltip.tsx +41 -0
- package/dist/vendor/core-src/registry/components/ui/updater-modal.tsx +254 -0
- package/dist/vendor/core-src/registry/index.ts +50 -0
- package/dist/vendor/core-src/registry/metadata.ts +742 -0
- package/dist/vendor/core-src/registry/providers/theme-provider.tsx +216 -0
- package/dist/vendor/core-src/registry/providers/theme-script.tsx +78 -0
- package/dist/vendor/core-src/registry/providers/theme-transitions.ts +139 -0
- package/dist/vendor/hooks-src/create-active-element.ts +51 -0
- package/dist/vendor/hooks-src/create-app-updater.ts +272 -0
- package/dist/vendor/hooks-src/create-audio-video.ts +444 -0
- package/dist/vendor/hooks-src/create-battery.ts +78 -0
- package/dist/vendor/hooks-src/create-chat-scroll.ts +113 -0
- package/dist/vendor/hooks-src/create-click-outside.ts +82 -0
- package/dist/vendor/hooks-src/create-clipboard.ts +69 -0
- package/dist/vendor/hooks-src/create-color-mode.ts +115 -0
- package/dist/vendor/hooks-src/create-controllable-signal.ts +56 -0
- package/dist/vendor/hooks-src/create-debounce.ts +90 -0
- package/dist/vendor/hooks-src/create-disclosure.ts +82 -0
- package/dist/vendor/hooks-src/create-document-tabs.ts +267 -0
- package/dist/vendor/hooks-src/create-document-title.ts +33 -0
- package/dist/vendor/hooks-src/create-drop-zone.ts +317 -0
- package/dist/vendor/hooks-src/create-event-source.ts +126 -0
- package/dist/vendor/hooks-src/create-favicon.ts +52 -0
- package/dist/vendor/hooks-src/create-fetch.ts +93 -0
- package/dist/vendor/hooks-src/create-focus-trap.ts +94 -0
- package/dist/vendor/hooks-src/create-form.ts +200 -0
- package/dist/vendor/hooks-src/create-fullscreen.ts +105 -0
- package/dist/vendor/hooks-src/create-geolocation.ts +140 -0
- package/dist/vendor/hooks-src/create-global-shortcut.ts +140 -0
- package/dist/vendor/hooks-src/create-hover.ts +88 -0
- package/dist/vendor/hooks-src/create-idle.ts +109 -0
- package/dist/vendor/hooks-src/create-infinite-scroll.ts +90 -0
- package/dist/vendor/hooks-src/create-input-mask.ts +109 -0
- package/dist/vendor/hooks-src/create-intersection-observer.ts +82 -0
- package/dist/vendor/hooks-src/create-keybindings.ts +148 -0
- package/dist/vendor/hooks-src/create-lock-scroll.ts +97 -0
- package/dist/vendor/hooks-src/create-long-press.ts +85 -0
- package/dist/vendor/hooks-src/create-media-query.ts +94 -0
- package/dist/vendor/hooks-src/create-mouse-position.ts +87 -0
- package/dist/vendor/hooks-src/create-network-status.ts +100 -0
- package/dist/vendor/hooks-src/create-orientation.ts +129 -0
- package/dist/vendor/hooks-src/create-pagination.ts +208 -0
- package/dist/vendor/hooks-src/create-permission.ts +91 -0
- package/dist/vendor/hooks-src/create-previous.ts +21 -0
- package/dist/vendor/hooks-src/create-resize-observer.ts +89 -0
- package/dist/vendor/hooks-src/create-scroll-into-view.ts +57 -0
- package/dist/vendor/hooks-src/create-scroll-position.ts +129 -0
- package/dist/vendor/hooks-src/create-storage.ts +106 -0
- package/dist/vendor/hooks-src/create-tauri-window.ts +628 -0
- package/dist/vendor/hooks-src/create-timer.ts +150 -0
- package/dist/vendor/hooks-src/create-tiptap-editor.ts +326 -0
- package/dist/vendor/hooks-src/create-undo-redo.ts +100 -0
- package/dist/vendor/hooks-src/create-web-notification.ts +111 -0
- package/dist/vendor/hooks-src/create-websocket.ts +179 -0
- package/dist/vendor/hooks-src/create-window-size.ts +41 -0
- package/dist/vendor/hooks-src/index.ts +48 -0
- package/package.json +87 -0
|
@@ -0,0 +1,468 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createContext,
|
|
3
|
+
useContext,
|
|
4
|
+
splitProps,
|
|
5
|
+
createMemo,
|
|
6
|
+
Show,
|
|
7
|
+
type Component,
|
|
8
|
+
type JSX,
|
|
9
|
+
type ParentComponent,
|
|
10
|
+
type Accessor,
|
|
11
|
+
} from "solid-js";
|
|
12
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
13
|
+
import { createTauriWindow, type TauriPlatform, detectPlatform } from "@/hooks/create-tauri-window";
|
|
14
|
+
import { cn } from "@/lib/cn";
|
|
15
|
+
|
|
16
|
+
/* --- 1. Context & Types --- */
|
|
17
|
+
export type TitlebarPlatform = "macos" | "windows" | "auto";
|
|
18
|
+
|
|
19
|
+
export interface TitlebarContextValue {
|
|
20
|
+
platform: Accessor<"macos" | "windows">;
|
|
21
|
+
isMaximized: Accessor<boolean>;
|
|
22
|
+
minimize: () => Promise<void> | void;
|
|
23
|
+
toggleMaximize: () => Promise<void> | void;
|
|
24
|
+
close: () => Promise<void> | void;
|
|
25
|
+
destroy?: () => Promise<void> | void;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const TitlebarContext = createContext<TitlebarContextValue>();
|
|
29
|
+
|
|
30
|
+
export function useTitlebar() {
|
|
31
|
+
const context = useContext(TitlebarContext);
|
|
32
|
+
if (!context) {
|
|
33
|
+
throw new Error("useTitlebar must be used within a <Titlebar />");
|
|
34
|
+
}
|
|
35
|
+
return context;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* --- 2. Titlebar Variants --- */
|
|
39
|
+
export const titlebarVariants = cva(
|
|
40
|
+
"relative flex w-full select-none items-center justify-between border-b transition-colors shrink-0 sticky top-0 z-50",
|
|
41
|
+
{
|
|
42
|
+
variants: {
|
|
43
|
+
variant: {
|
|
44
|
+
default: "border-border/50 bg-background text-foreground",
|
|
45
|
+
translucent: "border-border/40 bg-background/80 backdrop-blur-md text-foreground",
|
|
46
|
+
floating: "m-2 rounded-lg border border-border bg-card shadow-sm text-card-foreground",
|
|
47
|
+
transparent: "border-transparent bg-transparent text-foreground",
|
|
48
|
+
},
|
|
49
|
+
size: {
|
|
50
|
+
sm: "h-8 text-xs px-2.5",
|
|
51
|
+
default: "h-9 text-xs px-3",
|
|
52
|
+
lg: "h-11 text-sm px-4",
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
defaultVariants: {
|
|
56
|
+
variant: "default",
|
|
57
|
+
size: "default",
|
|
58
|
+
},
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
/* --- 3. Root Titlebar Component --- */
|
|
63
|
+
export interface TitlebarProps
|
|
64
|
+
extends JSX.HTMLAttributes<HTMLElement>,
|
|
65
|
+
VariantProps<typeof titlebarVariants> {
|
|
66
|
+
/** Explicit platform style, or 'auto' to detect host OS. */
|
|
67
|
+
platform?: TitlebarPlatform;
|
|
68
|
+
/** Optional controlled maximize state override. */
|
|
69
|
+
isMaximized?: boolean;
|
|
70
|
+
/** Optional minimize callback override. */
|
|
71
|
+
onMinimize?: () => void | Promise<void>;
|
|
72
|
+
/** Optional maximize callback override. */
|
|
73
|
+
onToggleMaximize?: () => void | Promise<void>;
|
|
74
|
+
/** Optional close callback override. */
|
|
75
|
+
onClose?: () => void | Promise<void>;
|
|
76
|
+
/** Whether double-clicking the titlebar toggles window maximize state. Defaults to true. */
|
|
77
|
+
doubleClickToMaximize?: boolean;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export const Titlebar: ParentComponent<TitlebarProps> = (props) => {
|
|
81
|
+
const [local, rest] = splitProps(props, [
|
|
82
|
+
"platform",
|
|
83
|
+
"isMaximized",
|
|
84
|
+
"onMinimize",
|
|
85
|
+
"onToggleMaximize",
|
|
86
|
+
"onClose",
|
|
87
|
+
"variant",
|
|
88
|
+
"size",
|
|
89
|
+
"class",
|
|
90
|
+
"children",
|
|
91
|
+
"doubleClickToMaximize",
|
|
92
|
+
"onMouseDown",
|
|
93
|
+
"onDblClick",
|
|
94
|
+
]);
|
|
95
|
+
|
|
96
|
+
const windowCtrl = createTauriWindow();
|
|
97
|
+
|
|
98
|
+
const resolvedPlatform = createMemo<"macos" | "windows">(() => {
|
|
99
|
+
if (local.platform && local.platform !== "auto") {
|
|
100
|
+
return local.platform;
|
|
101
|
+
}
|
|
102
|
+
const detected = detectPlatform();
|
|
103
|
+
return detected === "macos" ? "macos" : "windows";
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
const isMaximized = () =>
|
|
107
|
+
local.isMaximized !== undefined ? local.isMaximized : windowCtrl.isMaximized();
|
|
108
|
+
|
|
109
|
+
const minimize = () => (local.onMinimize ? local.onMinimize() : windowCtrl.minimize());
|
|
110
|
+
const toggleMaximize = () =>
|
|
111
|
+
local.onToggleMaximize ? local.onToggleMaximize() : windowCtrl.toggleMaximize();
|
|
112
|
+
const close = () => (local.onClose ? local.onClose() : windowCtrl.close());
|
|
113
|
+
const destroy = () => windowCtrl.destroy();
|
|
114
|
+
|
|
115
|
+
const handleMouseDown: JSX.EventHandlerUnion<HTMLElement, MouseEvent> = (e) => {
|
|
116
|
+
if (e.button === 0) {
|
|
117
|
+
const target = e.target as HTMLElement;
|
|
118
|
+
if (!target.closest("button, a, input, select, textarea, [data-no-drag], [data-tauri-drag-region='false']")) {
|
|
119
|
+
if (e.detail === 2 && local.doubleClickToMaximize !== false) {
|
|
120
|
+
// Double-click detected on mousedown detail - toggles maximize immediately without initiating a drag
|
|
121
|
+
toggleMaximize();
|
|
122
|
+
} else if (e.detail === 1) {
|
|
123
|
+
// Single-click: initiate window drag
|
|
124
|
+
windowCtrl.startDragging(e);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
if (typeof local.onMouseDown === "function") {
|
|
129
|
+
(local.onMouseDown as any)(e);
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
let lastDblClickTime = 0;
|
|
134
|
+
const handleDoubleClick: JSX.EventHandlerUnion<HTMLElement, MouseEvent> = (e) => {
|
|
135
|
+
const now = Date.now();
|
|
136
|
+
if (now - lastDblClickTime < 350) {
|
|
137
|
+
return; // Deduplicate rapid triggers
|
|
138
|
+
}
|
|
139
|
+
lastDblClickTime = now;
|
|
140
|
+
|
|
141
|
+
if (local.doubleClickToMaximize !== false) {
|
|
142
|
+
// Don't maximize if user double-clicked an interactive control
|
|
143
|
+
const target = e.target as HTMLElement;
|
|
144
|
+
if (!target.closest("button, a, input, select, textarea, [data-no-drag], [data-tauri-drag-region='false']")) {
|
|
145
|
+
toggleMaximize();
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
if (typeof local.onDblClick === "function") {
|
|
149
|
+
(local.onDblClick as any)(e);
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
const contextValue: TitlebarContextValue = {
|
|
154
|
+
platform: resolvedPlatform,
|
|
155
|
+
isMaximized,
|
|
156
|
+
minimize,
|
|
157
|
+
toggleMaximize,
|
|
158
|
+
close,
|
|
159
|
+
destroy,
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
return (
|
|
163
|
+
<TitlebarContext.Provider value={contextValue}>
|
|
164
|
+
<header
|
|
165
|
+
onMouseDown={handleMouseDown}
|
|
166
|
+
onDblClick={handleDoubleClick}
|
|
167
|
+
class={cn(
|
|
168
|
+
titlebarVariants({ variant: local.variant, size: local.size }),
|
|
169
|
+
"select-none cursor-default",
|
|
170
|
+
local.class
|
|
171
|
+
)}
|
|
172
|
+
{...rest}
|
|
173
|
+
>
|
|
174
|
+
{local.children}
|
|
175
|
+
</header>
|
|
176
|
+
</TitlebarContext.Provider>
|
|
177
|
+
);
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
/* --- 4. Subcomponents --- */
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Traffic light buttons for macOS or Fluent control buttons for Windows.
|
|
184
|
+
*/
|
|
185
|
+
export interface TitlebarControlsProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
186
|
+
/** Optional override platform style. Defaults to Titlebar context or detected OS. */
|
|
187
|
+
platform?: "macos" | "windows";
|
|
188
|
+
/** Optional controlled maximize state override. */
|
|
189
|
+
isMaximized?: boolean;
|
|
190
|
+
/** Optional minimize callback override. */
|
|
191
|
+
onMinimize?: () => void | Promise<void>;
|
|
192
|
+
/** Optional maximize callback override. */
|
|
193
|
+
onToggleMaximize?: () => void | Promise<void>;
|
|
194
|
+
/** Optional close callback override. */
|
|
195
|
+
onClose?: () => void | Promise<void>;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export const TitlebarControls: Component<TitlebarControlsProps> = (props) => {
|
|
199
|
+
const [local, rest] = splitProps(props, [
|
|
200
|
+
"platform",
|
|
201
|
+
"class",
|
|
202
|
+
"style",
|
|
203
|
+
"isMaximized",
|
|
204
|
+
"onMinimize",
|
|
205
|
+
"onToggleMaximize",
|
|
206
|
+
"onClose",
|
|
207
|
+
]);
|
|
208
|
+
const ctx = useContext(TitlebarContext);
|
|
209
|
+
let fallbackCtrl: ReturnType<typeof createTauriWindow> | null = null;
|
|
210
|
+
if (!ctx) {
|
|
211
|
+
fallbackCtrl = createTauriWindow();
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
const activePlatform = createMemo<"macos" | "windows">(() => {
|
|
215
|
+
if (local.platform) return local.platform;
|
|
216
|
+
if (ctx?.platform) return ctx.platform();
|
|
217
|
+
const detected = detectPlatform();
|
|
218
|
+
return detected === "macos" ? "macos" : "windows";
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
const isMaximized = () => {
|
|
222
|
+
if (local.isMaximized !== undefined) return local.isMaximized;
|
|
223
|
+
if (ctx?.isMaximized) return ctx.isMaximized();
|
|
224
|
+
return fallbackCtrl ? fallbackCtrl.isMaximized() : false;
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
const handleMinimize = (e: MouseEvent) => {
|
|
228
|
+
e.stopPropagation();
|
|
229
|
+
if (local.onMinimize) return local.onMinimize();
|
|
230
|
+
if (ctx?.minimize) return ctx.minimize();
|
|
231
|
+
return fallbackCtrl?.minimize();
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
const handleToggleMaximize = (e: MouseEvent) => {
|
|
235
|
+
e.stopPropagation();
|
|
236
|
+
if (local.onToggleMaximize) return local.onToggleMaximize();
|
|
237
|
+
if (ctx?.toggleMaximize) return ctx.toggleMaximize();
|
|
238
|
+
return fallbackCtrl?.toggleMaximize();
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
const handleClose = (e: MouseEvent) => {
|
|
242
|
+
e.stopPropagation();
|
|
243
|
+
if (local.onClose) return local.onClose();
|
|
244
|
+
if (ctx?.close) return ctx.close();
|
|
245
|
+
return fallbackCtrl?.close();
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
return (
|
|
249
|
+
<div
|
|
250
|
+
data-no-drag
|
|
251
|
+
data-tauri-drag-region="false"
|
|
252
|
+
style={("-webkit-app-region: no-drag; app-region: no-drag;" + (typeof local.style === "string" ? ` ${local.style}` : "")) as any}
|
|
253
|
+
class={cn(
|
|
254
|
+
"flex items-center z-10 self-stretch shrink-0 pointer-events-auto [app-region:no-drag] [-webkit-app-region:no-drag]",
|
|
255
|
+
activePlatform() === "macos"
|
|
256
|
+
? "gap-2 px-1 order-first"
|
|
257
|
+
: "gap-0 -mr-3 h-full order-last ml-auto",
|
|
258
|
+
local.class
|
|
259
|
+
)}
|
|
260
|
+
{...rest}
|
|
261
|
+
>
|
|
262
|
+
<Show
|
|
263
|
+
when={activePlatform() === "macos"}
|
|
264
|
+
fallback={
|
|
265
|
+
/* Windows 11 Fluent Window Controls */
|
|
266
|
+
<div class="flex items-center h-full self-stretch">
|
|
267
|
+
{/* Minimize */}
|
|
268
|
+
<button
|
|
269
|
+
type="button"
|
|
270
|
+
onClick={handleMinimize}
|
|
271
|
+
class="inline-flex h-full w-11 items-center justify-center text-muted-foreground hover:bg-muted hover:text-foreground transition-colors cursor-pointer"
|
|
272
|
+
aria-label="Minimize Window"
|
|
273
|
+
>
|
|
274
|
+
<svg class="h-3 w-3" fill="none" viewBox="0 0 12 12">
|
|
275
|
+
<path stroke="currentColor" stroke-width="1" d="M1.5 6h9" />
|
|
276
|
+
</svg>
|
|
277
|
+
</button>
|
|
278
|
+
|
|
279
|
+
{/* Maximize / Restore */}
|
|
280
|
+
<button
|
|
281
|
+
type="button"
|
|
282
|
+
onClick={handleToggleMaximize}
|
|
283
|
+
class="inline-flex h-full w-11 items-center justify-center text-muted-foreground hover:bg-muted hover:text-foreground transition-colors cursor-pointer"
|
|
284
|
+
aria-label={isMaximized() ? "Restore Window" : "Maximize Window"}
|
|
285
|
+
>
|
|
286
|
+
<Show
|
|
287
|
+
when={isMaximized()}
|
|
288
|
+
fallback={
|
|
289
|
+
<svg class="h-3 w-3" fill="none" viewBox="0 0 12 12">
|
|
290
|
+
<rect width="8" height="8" x="2" y="2" stroke="currentColor" stroke-width="1" rx="0.5" />
|
|
291
|
+
</svg>
|
|
292
|
+
}
|
|
293
|
+
>
|
|
294
|
+
<svg class="h-3 w-3" fill="none" viewBox="0 0 12 12">
|
|
295
|
+
<path stroke="currentColor" stroke-width="1" d="M3.5 3.5v-1.5h6v6h-1.5M2 4.5h6v6h-6z" />
|
|
296
|
+
</svg>
|
|
297
|
+
</Show>
|
|
298
|
+
</button>
|
|
299
|
+
|
|
300
|
+
{/* Close */}
|
|
301
|
+
<button
|
|
302
|
+
type="button"
|
|
303
|
+
onClick={handleClose}
|
|
304
|
+
class="inline-flex h-full w-11 items-center justify-center text-muted-foreground hover:bg-destructive hover:text-destructive-foreground transition-colors cursor-pointer"
|
|
305
|
+
aria-label="Close Window"
|
|
306
|
+
>
|
|
307
|
+
<svg class="h-3 w-3" fill="none" viewBox="0 0 12 12">
|
|
308
|
+
<path stroke="currentColor" stroke-width="1" d="M2.5 2.5l7 7M9.5 2.5l-7 7" />
|
|
309
|
+
</svg>
|
|
310
|
+
</button>
|
|
311
|
+
</div>
|
|
312
|
+
}
|
|
313
|
+
>
|
|
314
|
+
{/* macOS Traffic Lights */}
|
|
315
|
+
<div class="group/traffic flex items-center gap-2">
|
|
316
|
+
{/* Close */}
|
|
317
|
+
<button
|
|
318
|
+
type="button"
|
|
319
|
+
onClick={handleClose}
|
|
320
|
+
class="flex size-3 items-center justify-center rouded-lg bg-[#ff5f57] border border-[#e0443e] cursor-pointer"
|
|
321
|
+
aria-label="Close Window"
|
|
322
|
+
>
|
|
323
|
+
<svg
|
|
324
|
+
class="size-1.5 text-[#4c0000] opacity-0 group-hover/traffic:opacity-100 transition-opacity"
|
|
325
|
+
viewBox="0 0 6 6"
|
|
326
|
+
fill="none"
|
|
327
|
+
stroke="currentColor"
|
|
328
|
+
stroke-width="1.2"
|
|
329
|
+
>
|
|
330
|
+
<path d="M1 1l4 4M5 1L1 5" />
|
|
331
|
+
</svg>
|
|
332
|
+
</button>
|
|
333
|
+
|
|
334
|
+
{/* Minimize */}
|
|
335
|
+
<button
|
|
336
|
+
type="button"
|
|
337
|
+
onClick={handleMinimize}
|
|
338
|
+
class="flex size-3 items-center justify-center rouded-lg bg-[#febc2e] border border-[#d89e24] cursor-pointer"
|
|
339
|
+
aria-label="Minimize Window"
|
|
340
|
+
>
|
|
341
|
+
<svg
|
|
342
|
+
class="size-1.5 text-[#5c3e00] opacity-0 group-hover/traffic:opacity-100 transition-opacity"
|
|
343
|
+
viewBox="0 0 6 6"
|
|
344
|
+
fill="none"
|
|
345
|
+
stroke="currentColor"
|
|
346
|
+
stroke-width="1.2"
|
|
347
|
+
>
|
|
348
|
+
<path d="M1 3h4" />
|
|
349
|
+
</svg>
|
|
350
|
+
</button>
|
|
351
|
+
|
|
352
|
+
{/* Maximize */}
|
|
353
|
+
<button
|
|
354
|
+
type="button"
|
|
355
|
+
onClick={handleToggleMaximize}
|
|
356
|
+
class="flex size-3 items-center justify-center rouded-lg bg-[#28c840] border border-[#1aab29] cursor-pointer"
|
|
357
|
+
aria-label="Maximize Window"
|
|
358
|
+
>
|
|
359
|
+
<svg
|
|
360
|
+
class="size-1.5 text-[#003d07] opacity-0 group-hover/traffic:opacity-100 transition-opacity"
|
|
361
|
+
viewBox="0 0 6 6"
|
|
362
|
+
fill="none"
|
|
363
|
+
stroke="currentColor"
|
|
364
|
+
stroke-width="1.2"
|
|
365
|
+
>
|
|
366
|
+
<path d="M1 4.5l3.5-3.5M4.5 1h-3M4.5 1v3" />
|
|
367
|
+
</svg>
|
|
368
|
+
</button>
|
|
369
|
+
</div>
|
|
370
|
+
</Show>
|
|
371
|
+
</div>
|
|
372
|
+
);
|
|
373
|
+
};
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Title text container. Placed naturally in JSX flow by default, or centered with align="center".
|
|
377
|
+
*/
|
|
378
|
+
export interface TitlebarTitleProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
379
|
+
align?: "center" | "start";
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
export const TitlebarTitle: ParentComponent<TitlebarTitleProps> = (props) => {
|
|
383
|
+
const [local, rest] = splitProps(props, ["align", "class", "children"]);
|
|
384
|
+
|
|
385
|
+
const isCentered = () => local.align === "center";
|
|
386
|
+
|
|
387
|
+
return (
|
|
388
|
+
<div
|
|
389
|
+
class={cn(
|
|
390
|
+
"flex items-center gap-2 font-medium truncate text-xs text-foreground",
|
|
391
|
+
isCentered()
|
|
392
|
+
? "absolute left-1/2 -translate-x-1/2 pointer-events-none text-center justify-center max-w-[calc(100%-160px)]"
|
|
393
|
+
: "shrink-0",
|
|
394
|
+
local.class
|
|
395
|
+
)}
|
|
396
|
+
{...rest}
|
|
397
|
+
>
|
|
398
|
+
{local.children}
|
|
399
|
+
</div>
|
|
400
|
+
);
|
|
401
|
+
};
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* App icon slot within Titlebar.
|
|
405
|
+
*/
|
|
406
|
+
export const TitlebarIcon: ParentComponent<JSX.HTMLAttributes<HTMLDivElement>> = (props) => {
|
|
407
|
+
const [local, rest] = splitProps(props, ["class", "children"]);
|
|
408
|
+
return (
|
|
409
|
+
<div
|
|
410
|
+
data-no-drag
|
|
411
|
+
data-tauri-drag-region="false"
|
|
412
|
+
class={cn(
|
|
413
|
+
"flex shrink-0 items-center justify-center size-4 text-muted-foreground pointer-events-auto [app-region:no-drag] [-webkit-app-region:no-drag]",
|
|
414
|
+
local.class
|
|
415
|
+
)}
|
|
416
|
+
{...rest}
|
|
417
|
+
>
|
|
418
|
+
{local.children}
|
|
419
|
+
</div>
|
|
420
|
+
);
|
|
421
|
+
};
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* Action buttons container (Search, Settings, ThemeToggle, Navigation) placed in the titlebar.
|
|
425
|
+
* Supports start, end, center, or natural flow alignment.
|
|
426
|
+
*/
|
|
427
|
+
export interface TitlebarActionsProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
428
|
+
/** Alignment of the actions container within the titlebar. Defaults to 'end'. */
|
|
429
|
+
align?: "start" | "end" | "center" | "none";
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
export const TitlebarActions: ParentComponent<TitlebarActionsProps> = (props) => {
|
|
433
|
+
const [local, rest] = splitProps(props, ["align", "class", "children", "style"]);
|
|
434
|
+
|
|
435
|
+
const alignClass = () => {
|
|
436
|
+
switch (local.align) {
|
|
437
|
+
case "start":
|
|
438
|
+
return "mr-auto";
|
|
439
|
+
case "center":
|
|
440
|
+
return "mx-auto";
|
|
441
|
+
case "none":
|
|
442
|
+
return "";
|
|
443
|
+
case "end":
|
|
444
|
+
default:
|
|
445
|
+
return "ml-auto";
|
|
446
|
+
}
|
|
447
|
+
};
|
|
448
|
+
|
|
449
|
+
return (
|
|
450
|
+
<div
|
|
451
|
+
data-no-drag
|
|
452
|
+
data-tauri-drag-region="false"
|
|
453
|
+
style={("-webkit-app-region: no-drag; app-region: no-drag;" + (typeof local.style === "string" ? ` ${local.style}` : "")) as any}
|
|
454
|
+
class={cn(
|
|
455
|
+
"flex items-center gap-1 shrink-0 z-10 px-1 pointer-events-auto [app-region:no-drag] [-webkit-app-region:no-drag]",
|
|
456
|
+
alignClass(),
|
|
457
|
+
local.class
|
|
458
|
+
)}
|
|
459
|
+
{...rest}
|
|
460
|
+
>
|
|
461
|
+
{local.children}
|
|
462
|
+
</div>
|
|
463
|
+
);
|
|
464
|
+
};
|
|
465
|
+
|
|
466
|
+
/* --- 6. Re-export TitlebarTabs Suite --- */
|
|
467
|
+
export * from "./titlebar-tabs";
|
|
468
|
+
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { splitProps, type Component, type JSX, type ComponentProps } from "solid-js";
|
|
2
|
+
import { Toast as KobalteToast, toaster } from "@kobalte/core/toast";
|
|
3
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
4
|
+
import { X, CircleCheck, Info, CircleAlert, TriangleAlert } from "lucide-solid";
|
|
5
|
+
import { cn } from "@/lib/cn";
|
|
6
|
+
|
|
7
|
+
export const toastVariants = cva(
|
|
8
|
+
"group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-lg border p-4 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--kb-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--kb-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[opened]:animate-in data-[closed]:animate-out data-[swipe=end]:animate-out data-[closed]:fade-out-80 data-[closed]:slide-out-to-right-full data-[opened]:slide-in-from-top-full data-[opened]:sm:slide-in-from-bottom-full",
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
default: "border-border bg-background text-foreground",
|
|
13
|
+
success: "border-emerald-500/20 bg-emerald-500/10 text-emerald-900 dark:text-emerald-200 border-emerald-500/30",
|
|
14
|
+
destructive: "border-destructive/30 bg-destructive/10 text-destructive dark:text-red-300",
|
|
15
|
+
warning: "border-amber-500/20 bg-amber-500/10 text-amber-900 dark:text-amber-200 border-amber-500/30",
|
|
16
|
+
info: "border-sky-500/20 bg-sky-500/10 text-sky-900 dark:text-sky-200 border-sky-500/30",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
defaultVariants: {
|
|
20
|
+
variant: "default",
|
|
21
|
+
},
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
export interface ToastProps
|
|
26
|
+
extends ComponentProps<typeof KobalteToast>,
|
|
27
|
+
VariantProps<typeof toastVariants> {
|
|
28
|
+
class?: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const Toast: Component<ToastProps> = (props) => {
|
|
32
|
+
const [local, rest] = splitProps(props, ["class", "variant"]);
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<KobalteToast
|
|
36
|
+
class={cn(toastVariants({ variant: local.variant }), local.class)}
|
|
37
|
+
{...rest}
|
|
38
|
+
/>
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const ToastTitle: Component<ComponentProps<typeof KobalteToast.Title>> = (props) => {
|
|
43
|
+
const [local, rest] = splitProps(props, ["class"]);
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<KobalteToast.Title
|
|
47
|
+
class={cn("text-sm font-semibold [&+div]:text-xs", local.class)}
|
|
48
|
+
{...rest}
|
|
49
|
+
/>
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const ToastDescription: Component<ComponentProps<typeof KobalteToast.Description>> = (props) => {
|
|
54
|
+
const [local, rest] = splitProps(props, ["class"]);
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<KobalteToast.Description
|
|
58
|
+
class={cn("text-sm opacity-90", local.class)}
|
|
59
|
+
{...rest}
|
|
60
|
+
/>
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const ToastCloseButton: Component<ComponentProps<typeof KobalteToast.CloseButton>> = (props) => {
|
|
65
|
+
const [local, rest] = splitProps(props, ["class", "children"]);
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<KobalteToast.CloseButton
|
|
69
|
+
class={cn(
|
|
70
|
+
"absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100",
|
|
71
|
+
local.class
|
|
72
|
+
)}
|
|
73
|
+
{...rest}
|
|
74
|
+
>
|
|
75
|
+
{local.children || <X class="h-4 w-4" />}
|
|
76
|
+
</KobalteToast.CloseButton>
|
|
77
|
+
);
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export const ToastRegion: Component<ComponentProps<typeof KobalteToast.Region>> = (props) => {
|
|
81
|
+
const [local, rest] = splitProps(props, ["class"]);
|
|
82
|
+
|
|
83
|
+
return (
|
|
84
|
+
<KobalteToast.Region
|
|
85
|
+
class={cn(
|
|
86
|
+
"fixed top-0 z-100 flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-105",
|
|
87
|
+
local.class
|
|
88
|
+
)}
|
|
89
|
+
{...rest}
|
|
90
|
+
/>
|
|
91
|
+
);
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export const ToastList: Component<ComponentProps<typeof KobalteToast.List>> = (props) => {
|
|
95
|
+
const [local, rest] = splitProps(props, ["class"]);
|
|
96
|
+
|
|
97
|
+
return <KobalteToast.List class={cn("flex flex-col gap-2", local.class)} {...rest} />;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
/* --- Helper Function to Trigger Toast Notifications --- */
|
|
101
|
+
export interface ShowToastOptions {
|
|
102
|
+
title: string;
|
|
103
|
+
description?: string;
|
|
104
|
+
variant?: "default" | "success" | "destructive" | "warning" | "info";
|
|
105
|
+
duration?: number;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export const showToast = (options: ShowToastOptions) => {
|
|
109
|
+
return toaster.show((props) => (
|
|
110
|
+
<Toast toastId={props.toastId} variant={options.variant || "default"}>
|
|
111
|
+
<div class="flex items-start gap-3">
|
|
112
|
+
{options.variant === "success" && <CircleCheck class="h-5 w-5 text-emerald-500 shrink-0 mt-0.5" />}
|
|
113
|
+
{options.variant === "destructive" && <CircleAlert class="h-5 w-5 text-red-500 shrink-0 mt-0.5" />}
|
|
114
|
+
{options.variant === "warning" && <TriangleAlert class="h-5 w-5 text-amber-500 shrink-0 mt-0.5" />}
|
|
115
|
+
{options.variant === "info" && <Info class="h-5 w-5 text-sky-500 shrink-0 mt-0.5" />}
|
|
116
|
+
<div class="grid gap-1">
|
|
117
|
+
<ToastTitle>{options.title}</ToastTitle>
|
|
118
|
+
{options.description && <ToastDescription>{options.description}</ToastDescription>}
|
|
119
|
+
</div>
|
|
120
|
+
</div>
|
|
121
|
+
<ToastCloseButton />
|
|
122
|
+
</Toast>
|
|
123
|
+
));
|
|
124
|
+
};
|