@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,200 @@
|
|
|
1
|
+
import { splitProps, type Component, type JSX, type ValidComponent, Show } from "solid-js";
|
|
2
|
+
import * as DialogPrimitive from "@kobalte/core/dialog";
|
|
3
|
+
import type { PolymorphicProps } from "@kobalte/core/polymorphic";
|
|
4
|
+
import { ScrollArea } from "@/components/ui/scroll-area";
|
|
5
|
+
import { cn } from "@/lib/cn";
|
|
6
|
+
|
|
7
|
+
export type DialogRootProps = DialogPrimitive.DialogRootProps;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Root Dialog component managing modal open state.
|
|
11
|
+
*/
|
|
12
|
+
export const Dialog: Component<DialogRootProps> = (props) => {
|
|
13
|
+
return <DialogPrimitive.Root {...props} />;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const DialogTrigger = DialogPrimitive.Trigger;
|
|
17
|
+
|
|
18
|
+
export type DialogOverlayProps<T extends ValidComponent = "div"> =
|
|
19
|
+
DialogPrimitive.DialogOverlayProps<T> & {
|
|
20
|
+
/** Whether to apply background blur effect (default: true) */
|
|
21
|
+
blur?: boolean;
|
|
22
|
+
class?: string;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Backdrop overlay wrapper with optional backdrop blur styling.
|
|
27
|
+
*/
|
|
28
|
+
export const DialogOverlay = <T extends ValidComponent = "div">(
|
|
29
|
+
props: PolymorphicProps<T, DialogOverlayProps<T>>
|
|
30
|
+
) => {
|
|
31
|
+
const [local, rest] = splitProps(props as DialogOverlayProps, ["class", "blur"]);
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<DialogPrimitive.Overlay
|
|
35
|
+
class={cn(
|
|
36
|
+
"fixed inset-0 z-50 bg-black/80 data-expanded:animate-in data-closed:animate-out data-[closed]:fade-out-0 data-[expanded]:fade-in-0",
|
|
37
|
+
local.blur !== false && "backdrop-blur-sm",
|
|
38
|
+
local.class
|
|
39
|
+
)}
|
|
40
|
+
{...(rest as any)}
|
|
41
|
+
/>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export type DialogContentProps<T extends ValidComponent = "div"> =
|
|
46
|
+
DialogPrimitive.DialogContentProps<T> & {
|
|
47
|
+
/** Whether to show the top-right close (X) button (default: true) */
|
|
48
|
+
showCloseButton?: boolean;
|
|
49
|
+
/** Whether clicking outside closes the dialog (default: true) */
|
|
50
|
+
closeOnOutsideClick?: boolean;
|
|
51
|
+
/** Whether to apply background backdrop blur (default: true) */
|
|
52
|
+
blur?: boolean;
|
|
53
|
+
class?: string;
|
|
54
|
+
children?: JSX.Element;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Main dialog popup window housing header, content, and footer.
|
|
59
|
+
*/
|
|
60
|
+
export const DialogContent = <T extends ValidComponent = "div">(
|
|
61
|
+
props: PolymorphicProps<T, DialogContentProps<T>>
|
|
62
|
+
) => {
|
|
63
|
+
const [local, rest] = splitProps(props as DialogContentProps, [
|
|
64
|
+
"class",
|
|
65
|
+
"children",
|
|
66
|
+
"showCloseButton",
|
|
67
|
+
"closeOnOutsideClick",
|
|
68
|
+
"blur",
|
|
69
|
+
"onPointerDownOutside",
|
|
70
|
+
"onInteractOutside",
|
|
71
|
+
]);
|
|
72
|
+
|
|
73
|
+
const handlePointerDownOutside = (e: Event) => {
|
|
74
|
+
if (local.closeOnOutsideClick === false) {
|
|
75
|
+
e.preventDefault();
|
|
76
|
+
}
|
|
77
|
+
if (typeof local.onPointerDownOutside === "function") {
|
|
78
|
+
local.onPointerDownOutside(e as any);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const handleInteractOutside = (e: Event) => {
|
|
83
|
+
if (local.closeOnOutsideClick === false) {
|
|
84
|
+
e.preventDefault();
|
|
85
|
+
}
|
|
86
|
+
if (typeof local.onInteractOutside === "function") {
|
|
87
|
+
local.onInteractOutside(e as any);
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
return (
|
|
92
|
+
<DialogPrimitive.Portal>
|
|
93
|
+
{/* Forward blur prop to DialogOverlay */}
|
|
94
|
+
<DialogOverlay blur={local.blur} />
|
|
95
|
+
<DialogPrimitive.Content
|
|
96
|
+
onPointerDownOutside={handlePointerDownOutside}
|
|
97
|
+
onInteractOutside={handleInteractOutside}
|
|
98
|
+
class={cn(
|
|
99
|
+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] border border-border bg-popover shadow-lg duration-200 data-expanded:animate-in data-closed:animate-out data-[closed]:fade-out-0 data-[expanded]:fade-in-0 data-closed:zoom-out-95 data-expanded:zoom-in-95 data-[closed]:slide-out-to-left-1/2 data-[closed]:slide-out-to-top-[48%] data-[expanded]:slide-in-from-left-1/2 data-[expanded]:slide-in-from-top-[48%] sm:rounded-lg text-card-foreground overflow-hidden max-h-[80vh]",
|
|
100
|
+
local.class
|
|
101
|
+
)}
|
|
102
|
+
{...(rest as any)}
|
|
103
|
+
>
|
|
104
|
+
<ScrollArea class="max-h-[80vh] w-full">
|
|
105
|
+
<div class="p-6 space-y-4">
|
|
106
|
+
{local.children}
|
|
107
|
+
</div>
|
|
108
|
+
</ScrollArea>
|
|
109
|
+
<Show when={local.showCloseButton !== false}>
|
|
110
|
+
<DialogPrimitive.CloseButton class="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-expanded:bg-accent data-expanded:text-muted-foreground cursor-pointer z-50">
|
|
111
|
+
<svg class="h-4 w-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
112
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
|
|
113
|
+
</svg>
|
|
114
|
+
<span class="sr-only">Close</span>
|
|
115
|
+
</DialogPrimitive.CloseButton>
|
|
116
|
+
</Show>
|
|
117
|
+
</DialogPrimitive.Content>
|
|
118
|
+
</DialogPrimitive.Portal>
|
|
119
|
+
);
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export interface DialogHeaderProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
123
|
+
class?: string;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Dialog top header container.
|
|
128
|
+
*/
|
|
129
|
+
export const DialogHeader: Component<DialogHeaderProps> = (props) => {
|
|
130
|
+
const [local, rest] = splitProps(props, ["class"]);
|
|
131
|
+
|
|
132
|
+
return (
|
|
133
|
+
<div
|
|
134
|
+
class={cn("flex flex-col space-y-1.5 text-center sm:text-left", local.class)}
|
|
135
|
+
{...rest}
|
|
136
|
+
/>
|
|
137
|
+
);
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
export interface DialogFooterProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
141
|
+
class?: string;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Dialog bottom action buttons area.
|
|
146
|
+
*/
|
|
147
|
+
export const DialogFooter: Component<DialogFooterProps> = (props) => {
|
|
148
|
+
const [local, rest] = splitProps(props, ["class"]);
|
|
149
|
+
|
|
150
|
+
return (
|
|
151
|
+
<div
|
|
152
|
+
class={cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", local.class)}
|
|
153
|
+
{...rest}
|
|
154
|
+
/>
|
|
155
|
+
);
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
export type DialogTitleProps<T extends ValidComponent = "h2"> =
|
|
159
|
+
DialogPrimitive.DialogTitleProps<T> & {
|
|
160
|
+
class?: string;
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Dialog title heading.
|
|
165
|
+
*/
|
|
166
|
+
export const DialogTitle = <T extends ValidComponent = "h2">(
|
|
167
|
+
props: PolymorphicProps<T, DialogTitleProps<T>>
|
|
168
|
+
) => {
|
|
169
|
+
const [local, rest] = splitProps(props as DialogTitleProps, ["class"]);
|
|
170
|
+
|
|
171
|
+
return (
|
|
172
|
+
<DialogPrimitive.Title
|
|
173
|
+
class={cn("text-lg font-semibold leading-none tracking-tight text-foreground", local.class)}
|
|
174
|
+
{...(rest as any)}
|
|
175
|
+
/>
|
|
176
|
+
);
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
export type DialogDescriptionProps<T extends ValidComponent = "p"> =
|
|
180
|
+
DialogPrimitive.DialogDescriptionProps<T> & {
|
|
181
|
+
class?: string;
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Dialog subtitle or description text.
|
|
186
|
+
*/
|
|
187
|
+
export const DialogDescription = <T extends ValidComponent = "p">(
|
|
188
|
+
props: PolymorphicProps<T, DialogDescriptionProps<T>>
|
|
189
|
+
) => {
|
|
190
|
+
const [local, rest] = splitProps(props as DialogDescriptionProps, ["class"]);
|
|
191
|
+
|
|
192
|
+
return (
|
|
193
|
+
<DialogPrimitive.Description
|
|
194
|
+
class={cn("text-sm text-muted-foreground", local.class)}
|
|
195
|
+
{...(rest as any)}
|
|
196
|
+
/>
|
|
197
|
+
);
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
export const DialogClose = DialogPrimitive.CloseButton;
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import { splitProps, type Component, type JSX, type ValidComponent, createContext, useContext } from "solid-js";
|
|
2
|
+
import * as DropdownMenuPrimitive from "@kobalte/core/dropdown-menu";
|
|
3
|
+
import type { PolymorphicProps } from "@kobalte/core/polymorphic";
|
|
4
|
+
import { createClickOutside } from "@/hooks/create-click-outside";
|
|
5
|
+
import { ScrollArea } from "@/components/ui/scroll-area";
|
|
6
|
+
import { cn } from "@/lib/cn";
|
|
7
|
+
|
|
8
|
+
const DropdownGroupContext = createContext<boolean>(false);
|
|
9
|
+
|
|
10
|
+
export type DropdownMenuRootProps = Omit<
|
|
11
|
+
DropdownMenuPrimitive.DropdownMenuRootProps,
|
|
12
|
+
"placement"
|
|
13
|
+
> & {
|
|
14
|
+
placement?:
|
|
15
|
+
| "top"
|
|
16
|
+
| "top-start"
|
|
17
|
+
| "top-end"
|
|
18
|
+
| "right"
|
|
19
|
+
| "right-start"
|
|
20
|
+
| "right-end"
|
|
21
|
+
| "bottom"
|
|
22
|
+
| "bottom-start"
|
|
23
|
+
| "bottom-end"
|
|
24
|
+
| "left"
|
|
25
|
+
| "left-start"
|
|
26
|
+
| "left-end";
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const DropdownMenu: Component<DropdownMenuRootProps> = (props) => {
|
|
30
|
+
return <DropdownMenuPrimitive.Root {...props} />;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
34
|
+
|
|
35
|
+
export const DropdownMenuGroup: Component<DropdownMenuPrimitive.DropdownMenuGroupProps> = (props) => {
|
|
36
|
+
return (
|
|
37
|
+
<DropdownGroupContext.Provider value={true}>
|
|
38
|
+
<DropdownMenuPrimitive.Group {...props} />
|
|
39
|
+
</DropdownGroupContext.Provider>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
44
|
+
export const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
45
|
+
|
|
46
|
+
export type DropdownMenuSubTriggerProps<T extends ValidComponent = "div"> =
|
|
47
|
+
DropdownMenuPrimitive.DropdownMenuSubTriggerProps<T> & {
|
|
48
|
+
class?: string;
|
|
49
|
+
children?: JSX.Element;
|
|
50
|
+
inset?: boolean;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const DropdownMenuSubTrigger = <T extends ValidComponent = "div">(
|
|
54
|
+
props: PolymorphicProps<T, DropdownMenuSubTriggerProps<T>>
|
|
55
|
+
) => {
|
|
56
|
+
const [local, rest] = splitProps(props as DropdownMenuSubTriggerProps, ["class", "children", "inset"]);
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<DropdownMenuPrimitive.SubTrigger
|
|
60
|
+
class={cn(
|
|
61
|
+
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent text-foreground",
|
|
62
|
+
local.inset && "pl-8",
|
|
63
|
+
local.class
|
|
64
|
+
)}
|
|
65
|
+
{...(rest as any)}
|
|
66
|
+
>
|
|
67
|
+
{local.children}
|
|
68
|
+
<svg class="ml-auto h-4 w-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
69
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M9 5l7 7-7 7" />
|
|
70
|
+
</svg>
|
|
71
|
+
</DropdownMenuPrimitive.SubTrigger>
|
|
72
|
+
);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export type DropdownMenuSubContentProps<T extends ValidComponent = "div"> =
|
|
76
|
+
DropdownMenuPrimitive.DropdownMenuSubContentProps<T> & {
|
|
77
|
+
class?: string;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export const DropdownMenuSubContent = <T extends ValidComponent = "div">(
|
|
81
|
+
props: PolymorphicProps<T, DropdownMenuSubContentProps<T>>
|
|
82
|
+
) => {
|
|
83
|
+
const [local, rest] = splitProps(props as DropdownMenuSubContentProps, ["class"]);
|
|
84
|
+
|
|
85
|
+
return (
|
|
86
|
+
<DropdownMenuPrimitive.Portal>
|
|
87
|
+
<DropdownMenuPrimitive.SubContent
|
|
88
|
+
class={cn(
|
|
89
|
+
"z-50 min-w-32 overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-lg data-expanded:animate-in data-closed:animate-out data-[closed]:fade-out-0 data-[expanded]:fade-in-0",
|
|
90
|
+
local.class
|
|
91
|
+
)}
|
|
92
|
+
{...(rest as any)}
|
|
93
|
+
/>
|
|
94
|
+
</DropdownMenuPrimitive.Portal>
|
|
95
|
+
);
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export type DropdownMenuContentProps<T extends ValidComponent = "div"> =
|
|
99
|
+
DropdownMenuPrimitive.DropdownMenuContentProps<T> & {
|
|
100
|
+
class?: string;
|
|
101
|
+
children?: JSX.Element;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export const DropdownMenuContent = <T extends ValidComponent = "div">(
|
|
105
|
+
props: PolymorphicProps<T, DropdownMenuContentProps<T>>
|
|
106
|
+
) => {
|
|
107
|
+
const [local, rest] = splitProps(props as DropdownMenuContentProps, ["class", "children"]);
|
|
108
|
+
let contentRef: HTMLElement | undefined;
|
|
109
|
+
|
|
110
|
+
createClickOutside({
|
|
111
|
+
target: () => contentRef,
|
|
112
|
+
onInteractOutside: (e) => {
|
|
113
|
+
if (typeof (props as any).onInteractOutside === "function") {
|
|
114
|
+
(props as any).onInteractOutside(e);
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
return (
|
|
120
|
+
<DropdownMenuPrimitive.Portal>
|
|
121
|
+
<DropdownMenuPrimitive.Content
|
|
122
|
+
ref={(el) => {
|
|
123
|
+
contentRef = el;
|
|
124
|
+
if (typeof (props as any).ref === "function") (props as any).ref(el);
|
|
125
|
+
}}
|
|
126
|
+
{...(rest as any)}
|
|
127
|
+
sideOffset={(rest as any).sideOffset ?? 8}
|
|
128
|
+
class={cn(
|
|
129
|
+
"z-50 min-w-32 overflow-hidden rounded-md border border-border bg-popover text-popover-foreground shadow-md animate-in fade-in-80 max-h-72 flex flex-col mt-1",
|
|
130
|
+
local.class
|
|
131
|
+
)}
|
|
132
|
+
>
|
|
133
|
+
<ScrollArea class="max-h-72 w-full">
|
|
134
|
+
<div class="p-1">
|
|
135
|
+
{local.children}
|
|
136
|
+
</div>
|
|
137
|
+
</ScrollArea>
|
|
138
|
+
</DropdownMenuPrimitive.Content>
|
|
139
|
+
</DropdownMenuPrimitive.Portal>
|
|
140
|
+
);
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
export type DropdownMenuItemProps<T extends ValidComponent = "div"> =
|
|
144
|
+
DropdownMenuPrimitive.DropdownMenuItemProps<T> & {
|
|
145
|
+
class?: string;
|
|
146
|
+
inset?: boolean;
|
|
147
|
+
variant?: "default" | "destructive";
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
export const DropdownMenuItem = <T extends ValidComponent = "div">(
|
|
151
|
+
props: PolymorphicProps<T, DropdownMenuItemProps<T>>
|
|
152
|
+
) => {
|
|
153
|
+
const [local, rest] = splitProps(props as DropdownMenuItemProps, [
|
|
154
|
+
"class",
|
|
155
|
+
"inset",
|
|
156
|
+
"variant",
|
|
157
|
+
]);
|
|
158
|
+
|
|
159
|
+
return (
|
|
160
|
+
<DropdownMenuPrimitive.Item
|
|
161
|
+
class={cn(
|
|
162
|
+
"relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
163
|
+
local.inset && "pl-8",
|
|
164
|
+
local.variant === "destructive" &&
|
|
165
|
+
"text-destructive focus:bg-destructive/15 focus:text-destructive",
|
|
166
|
+
local.class
|
|
167
|
+
)}
|
|
168
|
+
{...(rest as any)}
|
|
169
|
+
/>
|
|
170
|
+
);
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
export type DropdownMenuCheckboxItemProps<T extends ValidComponent = "div"> =
|
|
174
|
+
DropdownMenuPrimitive.DropdownMenuCheckboxItemProps<T> & {
|
|
175
|
+
class?: string;
|
|
176
|
+
children?: JSX.Element;
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
export const DropdownMenuCheckboxItem = <T extends ValidComponent = "div">(
|
|
180
|
+
props: PolymorphicProps<T, DropdownMenuCheckboxItemProps<T>>
|
|
181
|
+
) => {
|
|
182
|
+
const [local, rest] = splitProps(props as DropdownMenuCheckboxItemProps, ["class", "children"]);
|
|
183
|
+
|
|
184
|
+
return (
|
|
185
|
+
<DropdownMenuPrimitive.CheckboxItem
|
|
186
|
+
class={cn(
|
|
187
|
+
"relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
188
|
+
local.class
|
|
189
|
+
)}
|
|
190
|
+
{...(rest as any)}
|
|
191
|
+
>
|
|
192
|
+
<span class="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
193
|
+
<DropdownMenuPrimitive.ItemIndicator>
|
|
194
|
+
<svg class="h-4 w-4 fill-none stroke-current stroke-2" viewBox="0 0 24 24">
|
|
195
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7" />
|
|
196
|
+
</svg>
|
|
197
|
+
</DropdownMenuPrimitive.ItemIndicator>
|
|
198
|
+
</span>
|
|
199
|
+
{local.children}
|
|
200
|
+
</DropdownMenuPrimitive.CheckboxItem>
|
|
201
|
+
);
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
export type DropdownMenuRadioItemProps<T extends ValidComponent = "div"> =
|
|
205
|
+
DropdownMenuPrimitive.DropdownMenuRadioItemProps<T> & {
|
|
206
|
+
class?: string;
|
|
207
|
+
children?: JSX.Element;
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
export const DropdownMenuRadioItem = <T extends ValidComponent = "div">(
|
|
211
|
+
props: PolymorphicProps<T, DropdownMenuRadioItemProps<T>>
|
|
212
|
+
) => {
|
|
213
|
+
const [local, rest] = splitProps(props as DropdownMenuRadioItemProps, ["class", "children"]);
|
|
214
|
+
|
|
215
|
+
return (
|
|
216
|
+
<DropdownMenuPrimitive.RadioItem
|
|
217
|
+
class={cn(
|
|
218
|
+
"relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
219
|
+
local.class
|
|
220
|
+
)}
|
|
221
|
+
{...(rest as any)}
|
|
222
|
+
>
|
|
223
|
+
<span class="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
224
|
+
<DropdownMenuPrimitive.ItemIndicator>
|
|
225
|
+
<span class="h-2 w-2 rounded-lg bg-current" />
|
|
226
|
+
</DropdownMenuPrimitive.ItemIndicator>
|
|
227
|
+
</span>
|
|
228
|
+
{local.children}
|
|
229
|
+
</DropdownMenuPrimitive.RadioItem>
|
|
230
|
+
);
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
export const DropdownMenuGroupLabel = DropdownMenuPrimitive.GroupLabel;
|
|
234
|
+
|
|
235
|
+
export interface DropdownMenuLabelProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
236
|
+
class?: string;
|
|
237
|
+
inset?: boolean;
|
|
238
|
+
children?: JSX.Element;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export const DropdownMenuLabel: Component<DropdownMenuLabelProps> = (props) => {
|
|
242
|
+
const [local, rest] = splitProps(props, ["class", "inset", "children"]);
|
|
243
|
+
const isInsideGroup = useContext(DropdownGroupContext);
|
|
244
|
+
|
|
245
|
+
const classes = () =>
|
|
246
|
+
cn(
|
|
247
|
+
"px-2 py-1.5 text-sm font-semibold text-foreground",
|
|
248
|
+
local.inset && "pl-8",
|
|
249
|
+
local.class
|
|
250
|
+
);
|
|
251
|
+
|
|
252
|
+
return (
|
|
253
|
+
<>
|
|
254
|
+
{isInsideGroup ? (
|
|
255
|
+
<DropdownMenuPrimitive.GroupLabel class={classes()} {...(rest as any)}>
|
|
256
|
+
{local.children}
|
|
257
|
+
</DropdownMenuPrimitive.GroupLabel>
|
|
258
|
+
) : (
|
|
259
|
+
<div class={classes()} {...rest}>
|
|
260
|
+
{local.children}
|
|
261
|
+
</div>
|
|
262
|
+
)}
|
|
263
|
+
</>
|
|
264
|
+
);
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
export type DropdownMenuSeparatorProps<T extends ValidComponent = "hr"> =
|
|
268
|
+
DropdownMenuPrimitive.DropdownMenuSeparatorProps<T> & {
|
|
269
|
+
class?: string;
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
export const DropdownMenuSeparator = <T extends ValidComponent = "hr">(
|
|
273
|
+
props: PolymorphicProps<T, DropdownMenuSeparatorProps<T>>
|
|
274
|
+
) => {
|
|
275
|
+
const [local, rest] = splitProps(props as DropdownMenuSeparatorProps, ["class"]);
|
|
276
|
+
|
|
277
|
+
return (
|
|
278
|
+
<DropdownMenuPrimitive.Separator
|
|
279
|
+
class={cn("-mx-1 my-1 h-px bg-border", local.class)}
|
|
280
|
+
{...(rest as any)}
|
|
281
|
+
/>
|
|
282
|
+
);
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
export interface DropdownMenuShortcutProps extends JSX.HTMLAttributes<HTMLSpanElement> {
|
|
286
|
+
class?: string;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
export const DropdownMenuShortcut: Component<DropdownMenuShortcutProps> = (props) => {
|
|
290
|
+
const [local, rest] = splitProps(props, ["class"]);
|
|
291
|
+
|
|
292
|
+
return (
|
|
293
|
+
<span
|
|
294
|
+
class={cn("ml-auto text-xs tracking-widest text-muted-foreground", local.class)}
|
|
295
|
+
{...rest}
|
|
296
|
+
/>
|
|
297
|
+
);
|
|
298
|
+
};
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { splitProps, type Component, type JSX } from "solid-js";
|
|
2
|
+
import { cn } from "@/lib/cn";
|
|
3
|
+
import { CloudUpload, FileText, X, AlertCircle } from "lucide-solid";
|
|
4
|
+
|
|
5
|
+
export interface DropzoneProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
class?: string;
|
|
7
|
+
isOver?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Root container for the Dropzone file upload component.
|
|
13
|
+
*/
|
|
14
|
+
export const Dropzone: Component<DropzoneProps> = (props) => {
|
|
15
|
+
const [local, rest] = splitProps(props, ["class", "isOver", "disabled"]);
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<div
|
|
19
|
+
class={cn(
|
|
20
|
+
"group relative flex w-full flex-col items-center justify-center rounded-lg border-2 border-dashed border-border bg-card/50 p-8 text-center transition-all",
|
|
21
|
+
"hover:border-primary/50 hover:bg-card/80",
|
|
22
|
+
local.isOver && "border-primary bg-primary/5 ring-2 ring-primary/20",
|
|
23
|
+
local.disabled && "pointer-events-none opacity-50",
|
|
24
|
+
local.class
|
|
25
|
+
)}
|
|
26
|
+
{...rest}
|
|
27
|
+
/>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export interface DropzoneIconProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
32
|
+
class?: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Centered icon placeholder for Dropzone.
|
|
37
|
+
*/
|
|
38
|
+
export const DropzoneIcon: Component<DropzoneIconProps> = (props) => {
|
|
39
|
+
const [local, rest] = splitProps(props, ["class", "children"]);
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<div
|
|
43
|
+
class={cn(
|
|
44
|
+
"mb-3 flex size-12 items-center justify-center rounded-lg bg-primary/10 text-primary transition-transform group-hover:scale-105",
|
|
45
|
+
local.class
|
|
46
|
+
)}
|
|
47
|
+
{...rest}
|
|
48
|
+
>
|
|
49
|
+
{local.children || <CloudUpload class="size-6" />}
|
|
50
|
+
</div>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export interface DropzoneTitleProps extends JSX.HTMLAttributes<HTMLHeadingElement> {
|
|
55
|
+
class?: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Primary title text for the dropzone prompt.
|
|
60
|
+
*/
|
|
61
|
+
export const DropzoneTitle: Component<DropzoneTitleProps> = (props) => {
|
|
62
|
+
const [local, rest] = splitProps(props, ["class"]);
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<h4
|
|
66
|
+
class={cn("text-sm font-semibold tracking-tight text-foreground", local.class)}
|
|
67
|
+
{...rest}
|
|
68
|
+
/>
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export interface DropzoneDescriptionProps extends JSX.HTMLAttributes<HTMLParagraphElement> {
|
|
73
|
+
class?: string;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Subtitle description text for dropzone file specifications.
|
|
78
|
+
*/
|
|
79
|
+
export const DropzoneDescription: Component<DropzoneDescriptionProps> = (props) => {
|
|
80
|
+
const [local, rest] = splitProps(props, ["class"]);
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
<p
|
|
84
|
+
class={cn("mt-1 text-xs text-muted-foreground", local.class)}
|
|
85
|
+
{...rest}
|
|
86
|
+
/>
|
|
87
|
+
);
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export interface DropzoneFileListProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
91
|
+
class?: string;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Container list for uploaded files.
|
|
96
|
+
*/
|
|
97
|
+
export const DropzoneFileList: Component<DropzoneFileListProps> = (props) => {
|
|
98
|
+
const [local, rest] = splitProps(props, ["class"]);
|
|
99
|
+
|
|
100
|
+
return (
|
|
101
|
+
<div
|
|
102
|
+
class={cn("mt-4 flex w-full flex-col gap-2", local.class)}
|
|
103
|
+
{...rest}
|
|
104
|
+
/>
|
|
105
|
+
);
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export interface DropzoneFileItemProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
109
|
+
class?: string;
|
|
110
|
+
name: string;
|
|
111
|
+
size?: string;
|
|
112
|
+
onRemove?: () => void;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Individual uploaded file card with name, formatted size, and remove button.
|
|
117
|
+
*/
|
|
118
|
+
export const DropzoneFileItem: Component<DropzoneFileItemProps> = (props) => {
|
|
119
|
+
const [local, rest] = splitProps(props, ["class", "name", "size", "onRemove", "children"]);
|
|
120
|
+
|
|
121
|
+
return (
|
|
122
|
+
<div
|
|
123
|
+
class={cn(
|
|
124
|
+
"flex items-center justify-between gap-3 rounded-md border border-border bg-card p-2.5 text-xs transition-colors",
|
|
125
|
+
local.class
|
|
126
|
+
)}
|
|
127
|
+
{...rest}
|
|
128
|
+
>
|
|
129
|
+
<div class="flex min-w-0 items-center gap-2.5">
|
|
130
|
+
<div class="flex size-8 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground">
|
|
131
|
+
{local.children || <FileText class="size-4" />}
|
|
132
|
+
</div>
|
|
133
|
+
<div class="flex min-w-0 flex-col text-left">
|
|
134
|
+
<span class="truncate font-medium text-foreground">{local.name}</span>
|
|
135
|
+
{local.size && (
|
|
136
|
+
<span class="font-mono text-[11px] text-muted-foreground">{local.size}</span>
|
|
137
|
+
)}
|
|
138
|
+
</div>
|
|
139
|
+
</div>
|
|
140
|
+
|
|
141
|
+
{local.onRemove && (
|
|
142
|
+
<button
|
|
143
|
+
type="button"
|
|
144
|
+
onClick={(e) => {
|
|
145
|
+
e.stopPropagation();
|
|
146
|
+
local.onRemove?.();
|
|
147
|
+
}}
|
|
148
|
+
class="flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive"
|
|
149
|
+
aria-label="Remove file"
|
|
150
|
+
>
|
|
151
|
+
<X class="size-3.5" />
|
|
152
|
+
</button>
|
|
153
|
+
)}
|
|
154
|
+
</div>
|
|
155
|
+
);
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
export interface DropzoneRejectedItemProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
159
|
+
class?: string;
|
|
160
|
+
name: string;
|
|
161
|
+
error?: string;
|
|
162
|
+
size?: string;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Card for displaying rejected files and validation errors.
|
|
167
|
+
*/
|
|
168
|
+
export const DropzoneRejectedItem: Component<DropzoneRejectedItemProps> = (props) => {
|
|
169
|
+
const [local, rest] = splitProps(props, ["class", "name", "error", "size"]);
|
|
170
|
+
|
|
171
|
+
return (
|
|
172
|
+
<div
|
|
173
|
+
class={cn(
|
|
174
|
+
"flex items-center justify-between gap-3 rounded-md border border-destructive/30 bg-destructive/10 p-2.5 text-xs text-destructive",
|
|
175
|
+
local.class
|
|
176
|
+
)}
|
|
177
|
+
{...rest}
|
|
178
|
+
>
|
|
179
|
+
<div class="flex min-w-0 items-center gap-2">
|
|
180
|
+
<AlertCircle class="size-4 shrink-0" />
|
|
181
|
+
<span class="truncate font-medium">{local.name}</span>
|
|
182
|
+
{local.size && <span class="font-mono text-[11px] opacity-80">({local.size})</span>}
|
|
183
|
+
</div>
|
|
184
|
+
{local.error && (
|
|
185
|
+
<span class="shrink-0 text-[11px] font-medium">{local.error}</span>
|
|
186
|
+
)}
|
|
187
|
+
</div>
|
|
188
|
+
);
|
|
189
|
+
};
|