@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,363 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createSignal,
|
|
3
|
+
splitProps,
|
|
4
|
+
Show,
|
|
5
|
+
type JSX,
|
|
6
|
+
type ParentComponent,
|
|
7
|
+
} from "solid-js";
|
|
8
|
+
import { Portal } from "solid-js/web";
|
|
9
|
+
import {
|
|
10
|
+
Monitor,
|
|
11
|
+
Tablet,
|
|
12
|
+
Smartphone,
|
|
13
|
+
Sparkles,
|
|
14
|
+
RotateCcw,
|
|
15
|
+
Terminal,
|
|
16
|
+
Check,
|
|
17
|
+
Maximize2,
|
|
18
|
+
Minimize2,
|
|
19
|
+
Grid,
|
|
20
|
+
} from "lucide-solid";
|
|
21
|
+
import { Tabs, TabsList, TabsTrigger, TabsContent } from "@/components/ui/tabs";
|
|
22
|
+
import { Button } from "@/components/ui/button";
|
|
23
|
+
import { Tooltip, TooltipTrigger, TooltipContent } from "@/components/ui/tooltip";
|
|
24
|
+
import { CodeBlock } from "@/components/ui/code-block";
|
|
25
|
+
import { createClipboard } from "@/hooks/create-clipboard";
|
|
26
|
+
import { cn } from "@/lib/cn";
|
|
27
|
+
|
|
28
|
+
export type ComponentViewerViewport = "desktop" | "tablet" | "mobile";
|
|
29
|
+
|
|
30
|
+
export interface ComponentViewerProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
31
|
+
/** Name of the component or UI primitive (e.g. "button", "dialog") */
|
|
32
|
+
name?: string;
|
|
33
|
+
/** Title label displayed in the viewer header */
|
|
34
|
+
title?: string;
|
|
35
|
+
/** Raw TSX/JSX source code to display in the Code tab and copy */
|
|
36
|
+
code: string;
|
|
37
|
+
/** Programming language for syntax highlighting (defaults to "tsx") */
|
|
38
|
+
lang?: string;
|
|
39
|
+
/** Alignment of the preview canvas: "center" (default), "start", or "end" */
|
|
40
|
+
align?: "center" | "start" | "end";
|
|
41
|
+
/** Optional CLI command to install this component (e.g. "bunx @nikala-ui/cli add button") */
|
|
42
|
+
command?: string;
|
|
43
|
+
/** Initial responsive viewport (default: "desktop") */
|
|
44
|
+
defaultViewport?: ComponentViewerViewport;
|
|
45
|
+
/** Whether to allow overflowing elements in the canvas (e.g. popovers, dropdowns) */
|
|
46
|
+
allowOverflow?: boolean;
|
|
47
|
+
/** Enables responsive screen size toggle controls (Desktop, Tablet, Mobile) */
|
|
48
|
+
responsive?: boolean;
|
|
49
|
+
/** Enables canvas grid pattern toggle */
|
|
50
|
+
showGridToggle?: boolean;
|
|
51
|
+
/** Enables a reset button to re-mount the preview canvas */
|
|
52
|
+
reRenderable?: boolean;
|
|
53
|
+
class?: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Advanced component inspection and preview container with responsive viewport emulation,
|
|
58
|
+
* background grid patterns, live re-mounting, AI context generation, and syntax-highlighted code.
|
|
59
|
+
*/
|
|
60
|
+
export const ComponentViewer: ParentComponent<ComponentViewerProps> = (props) => {
|
|
61
|
+
const [local, rest] = splitProps(props, [
|
|
62
|
+
"name",
|
|
63
|
+
"title",
|
|
64
|
+
"code",
|
|
65
|
+
"lang",
|
|
66
|
+
"align",
|
|
67
|
+
"command",
|
|
68
|
+
"defaultViewport",
|
|
69
|
+
"allowOverflow",
|
|
70
|
+
"responsive",
|
|
71
|
+
"showGridToggle",
|
|
72
|
+
"reRenderable",
|
|
73
|
+
"class",
|
|
74
|
+
"children",
|
|
75
|
+
]);
|
|
76
|
+
|
|
77
|
+
const [viewport, setViewport] = createSignal<ComponentViewerViewport>(
|
|
78
|
+
local.defaultViewport || "desktop"
|
|
79
|
+
);
|
|
80
|
+
const [showGrid, setShowGrid] = createSignal(true);
|
|
81
|
+
const [isFullscreen, setIsFullscreen] = createSignal(false);
|
|
82
|
+
const aiClipboard = createClipboard();
|
|
83
|
+
const cmdClipboard = createClipboard();
|
|
84
|
+
const [mounted, setMounted] = createSignal(true);
|
|
85
|
+
|
|
86
|
+
const cliCommand = () => local.command;
|
|
87
|
+
|
|
88
|
+
const handleCopyAi = async () => {
|
|
89
|
+
const cmd = cliCommand();
|
|
90
|
+
const prompt = `// ${local.title || local.name || "Component"}
|
|
91
|
+
${cmd ? `// Installation: ${cmd}\n` : ""}// Usage Code:
|
|
92
|
+
${local.code}`;
|
|
93
|
+
await aiClipboard.copy(prompt);
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const handleCopyCmd = async () => {
|
|
97
|
+
const cmd = cliCommand();
|
|
98
|
+
if (!cmd) return;
|
|
99
|
+
await cmdClipboard.copy(cmd);
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
const handleReset = () => {
|
|
103
|
+
setMounted(false);
|
|
104
|
+
setTimeout(() => setMounted(true), 20);
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
const alignmentClass = () => {
|
|
108
|
+
if (local.align === "start") return "items-start justify-start";
|
|
109
|
+
if (local.align === "end") return "items-end justify-end";
|
|
110
|
+
return "items-center justify-center";
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
const viewportWidthClass = () => {
|
|
114
|
+
switch (viewport()) {
|
|
115
|
+
case "mobile":
|
|
116
|
+
return "max-w-[375px]";
|
|
117
|
+
case "tablet":
|
|
118
|
+
return "max-w-[768px]";
|
|
119
|
+
default:
|
|
120
|
+
return "max-w-full";
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const renderViewerContent = (isModal = false) => (
|
|
125
|
+
<div
|
|
126
|
+
class={cn(
|
|
127
|
+
"group relative flex flex-col rounded-lg border border-border bg-card/60 shadow-2xs transition-all w-full",
|
|
128
|
+
isModal && "h-full flex-1 bg-background shadow-2xl",
|
|
129
|
+
!isModal && "my-6",
|
|
130
|
+
local.class
|
|
131
|
+
)}
|
|
132
|
+
{...rest}
|
|
133
|
+
>
|
|
134
|
+
<Tabs defaultValue="preview" class="relative w-full flex flex-col h-full flex-1 gap-0">
|
|
135
|
+
{/* Top Header & Toolbar */}
|
|
136
|
+
<div class="flex flex-wrap items-center justify-between border-b border-border/70 px-3 py-2 gap-2 bg-muted/30 shrink-0">
|
|
137
|
+
<div class="flex items-center gap-3">
|
|
138
|
+
<TabsList class="h-8 rounded-md bg-muted/60 p-0.5 gap-1">
|
|
139
|
+
<TabsTrigger value="preview" class="h-7 px-3 text-xs cursor-pointer data-[state=active]:bg-background data-[state=active]:shadow-2xs">
|
|
140
|
+
Preview
|
|
141
|
+
</TabsTrigger>
|
|
142
|
+
<TabsTrigger value="code" class="h-7 px-3 text-xs cursor-pointer data-[state=active]:bg-background data-[state=active]:shadow-2xs">
|
|
143
|
+
Code
|
|
144
|
+
</TabsTrigger>
|
|
145
|
+
</TabsList>
|
|
146
|
+
|
|
147
|
+
<Show when={local.title}>
|
|
148
|
+
<span class="text-xs font-semibold text-foreground tracking-tight hidden sm:inline-block">
|
|
149
|
+
{local.title}
|
|
150
|
+
</span>
|
|
151
|
+
</Show>
|
|
152
|
+
</div>
|
|
153
|
+
|
|
154
|
+
{/* Right Action Tools */}
|
|
155
|
+
<div class="flex flex-wrap items-center gap-1.5 ml-auto">
|
|
156
|
+
{/* Responsive Viewport Switcher */}
|
|
157
|
+
<Show when={local.responsive ?? true}>
|
|
158
|
+
<div class="flex items-center rounded-md border border-border/60 bg-muted/40 p-0.5 gap-0.5 mr-1">
|
|
159
|
+
<Tooltip>
|
|
160
|
+
<TooltipTrigger
|
|
161
|
+
as={Button}
|
|
162
|
+
variant="ghost"
|
|
163
|
+
size="icon"
|
|
164
|
+
onClick={() => setViewport("desktop")}
|
|
165
|
+
aria-label="Desktop viewport"
|
|
166
|
+
class={cn(
|
|
167
|
+
"size-6.5 p-0 rounded-sm cursor-pointer text-muted-foreground",
|
|
168
|
+
viewport() === "desktop" && "bg-background text-foreground shadow-2xs font-semibold"
|
|
169
|
+
)}
|
|
170
|
+
>
|
|
171
|
+
<Monitor class="size-3.5" />
|
|
172
|
+
</TooltipTrigger>
|
|
173
|
+
<TooltipContent class="text-[10px] py-1 px-2">Desktop (100%)</TooltipContent>
|
|
174
|
+
</Tooltip>
|
|
175
|
+
|
|
176
|
+
<Tooltip>
|
|
177
|
+
<TooltipTrigger
|
|
178
|
+
as={Button}
|
|
179
|
+
variant="ghost"
|
|
180
|
+
size="icon"
|
|
181
|
+
onClick={() => setViewport("tablet")}
|
|
182
|
+
aria-label="Tablet viewport"
|
|
183
|
+
class={cn(
|
|
184
|
+
"size-6.5 p-0 rounded-sm cursor-pointer text-muted-foreground",
|
|
185
|
+
viewport() === "tablet" && "bg-background text-foreground shadow-2xs font-semibold"
|
|
186
|
+
)}
|
|
187
|
+
>
|
|
188
|
+
<Tablet class="size-3.5" />
|
|
189
|
+
</TooltipTrigger>
|
|
190
|
+
<TooltipContent class="text-[10px] py-1 px-2">Tablet (768px)</TooltipContent>
|
|
191
|
+
</Tooltip>
|
|
192
|
+
|
|
193
|
+
<Tooltip>
|
|
194
|
+
<TooltipTrigger
|
|
195
|
+
as={Button}
|
|
196
|
+
variant="ghost"
|
|
197
|
+
size="icon"
|
|
198
|
+
onClick={() => setViewport("mobile")}
|
|
199
|
+
aria-label="Mobile viewport"
|
|
200
|
+
class={cn(
|
|
201
|
+
"size-6.5 p-0 rounded-sm cursor-pointer text-muted-foreground",
|
|
202
|
+
viewport() === "mobile" && "bg-background text-foreground shadow-2xs font-semibold"
|
|
203
|
+
)}
|
|
204
|
+
>
|
|
205
|
+
<Smartphone class="size-3.5" />
|
|
206
|
+
</TooltipTrigger>
|
|
207
|
+
<TooltipContent class="text-[10px] py-1 px-2">Mobile (375px)</TooltipContent>
|
|
208
|
+
</Tooltip>
|
|
209
|
+
</div>
|
|
210
|
+
</Show>
|
|
211
|
+
|
|
212
|
+
{/* Grid Pattern Toggle */}
|
|
213
|
+
<Show when={local.showGridToggle ?? true}>
|
|
214
|
+
<Tooltip>
|
|
215
|
+
<TooltipTrigger
|
|
216
|
+
as={Button}
|
|
217
|
+
variant="ghost"
|
|
218
|
+
size="icon"
|
|
219
|
+
onClick={() => setShowGrid(!showGrid())}
|
|
220
|
+
aria-label="Toggle background grid"
|
|
221
|
+
class={cn(
|
|
222
|
+
"size-7 rounded-md border border-border/50 text-muted-foreground hover:text-foreground cursor-pointer",
|
|
223
|
+
showGrid() && "text-foreground bg-muted/60"
|
|
224
|
+
)}
|
|
225
|
+
>
|
|
226
|
+
<Grid class="size-3.5" />
|
|
227
|
+
</TooltipTrigger>
|
|
228
|
+
<TooltipContent class="text-[10px] py-1 px-2">Toggle Canvas Grid</TooltipContent>
|
|
229
|
+
</Tooltip>
|
|
230
|
+
</Show>
|
|
231
|
+
|
|
232
|
+
{/* Re-render Reset Canvas */}
|
|
233
|
+
<Show when={local.reRenderable ?? true}>
|
|
234
|
+
<Tooltip>
|
|
235
|
+
<TooltipTrigger
|
|
236
|
+
as={Button}
|
|
237
|
+
variant="ghost"
|
|
238
|
+
size="icon"
|
|
239
|
+
onClick={handleReset}
|
|
240
|
+
aria-label="Reset preview canvas"
|
|
241
|
+
class="size-7 rounded-md border border-border/50 text-muted-foreground hover:text-foreground cursor-pointer"
|
|
242
|
+
>
|
|
243
|
+
<RotateCcw class="size-3.5" />
|
|
244
|
+
</TooltipTrigger>
|
|
245
|
+
<TooltipContent class="text-[10px] py-1 px-2">Reset canvas</TooltipContent>
|
|
246
|
+
</Tooltip>
|
|
247
|
+
</Show>
|
|
248
|
+
|
|
249
|
+
{/* Copy for AI */}
|
|
250
|
+
<Tooltip>
|
|
251
|
+
<TooltipTrigger
|
|
252
|
+
as={Button}
|
|
253
|
+
variant="ghost"
|
|
254
|
+
size="sm"
|
|
255
|
+
onClick={handleCopyAi}
|
|
256
|
+
aria-label="Copy context formatted for AI assistants"
|
|
257
|
+
class="h-7 px-2 text-xs text-muted-foreground hover:text-foreground border border-border/50 rounded-md cursor-pointer flex items-center gap-1.5"
|
|
258
|
+
>
|
|
259
|
+
<Show when={aiClipboard.copied()} fallback={<Sparkles class="size-3" />}>
|
|
260
|
+
<Check class="size-3 text-emerald-500" />
|
|
261
|
+
</Show>
|
|
262
|
+
<span class="hidden sm:inline">{aiClipboard.copied() ? "Copied!" : "Prompt"}</span>
|
|
263
|
+
</TooltipTrigger>
|
|
264
|
+
<TooltipContent class="text-[10px] py-1 px-2">Copy code formatted for AI</TooltipContent>
|
|
265
|
+
</Tooltip>
|
|
266
|
+
|
|
267
|
+
{/* Copy CLI Installation Command (only when command prop is provided) */}
|
|
268
|
+
<Show when={cliCommand()}>
|
|
269
|
+
<Tooltip>
|
|
270
|
+
<TooltipTrigger
|
|
271
|
+
as={Button}
|
|
272
|
+
variant="ghost"
|
|
273
|
+
size="sm"
|
|
274
|
+
onClick={handleCopyCmd}
|
|
275
|
+
aria-label="Copy CLI installation command"
|
|
276
|
+
class="h-7 px-2 text-xs font-mono text-muted-foreground hover:text-foreground border border-border/50 rounded-md cursor-pointer flex items-center gap-1.5"
|
|
277
|
+
>
|
|
278
|
+
<Show when={cmdClipboard.copied()} fallback={<Terminal class="size-3" />}>
|
|
279
|
+
<Check class="size-3 text-emerald-500" />
|
|
280
|
+
</Show>
|
|
281
|
+
<span class="hidden md:inline">{cmdClipboard.copied() ? "Copied!" : cliCommand()}</span>
|
|
282
|
+
</TooltipTrigger>
|
|
283
|
+
<TooltipContent class="text-[10px] py-1 px-2">Copy CLI command</TooltipContent>
|
|
284
|
+
</Tooltip>
|
|
285
|
+
</Show>
|
|
286
|
+
|
|
287
|
+
{/* Fullscreen Expand Button */}
|
|
288
|
+
<Tooltip>
|
|
289
|
+
<TooltipTrigger
|
|
290
|
+
as={Button}
|
|
291
|
+
variant="ghost"
|
|
292
|
+
size="icon"
|
|
293
|
+
onClick={() => setIsFullscreen(!isFullscreen())}
|
|
294
|
+
aria-label={isFullscreen() ? "Exit fullscreen" : "Expand to fullscreen"}
|
|
295
|
+
class="size-7 rounded-md border border-border/50 text-muted-foreground hover:text-foreground cursor-pointer"
|
|
296
|
+
>
|
|
297
|
+
<Show when={isFullscreen()} fallback={<Maximize2 class="size-3.5" />}>
|
|
298
|
+
<Minimize2 class="size-3.5 text-primary" />
|
|
299
|
+
</Show>
|
|
300
|
+
</TooltipTrigger>
|
|
301
|
+
<TooltipContent class="text-[10px] py-1 px-2">
|
|
302
|
+
{isFullscreen() ? "Exit Fullscreen" : "Fullscreen Preview"}
|
|
303
|
+
</TooltipContent>
|
|
304
|
+
</Tooltip>
|
|
305
|
+
</div>
|
|
306
|
+
</div>
|
|
307
|
+
|
|
308
|
+
{/* Live Preview Canvas Content */}
|
|
309
|
+
<TabsContent
|
|
310
|
+
value="preview"
|
|
311
|
+
class={cn(
|
|
312
|
+
"relative flex-1 p-4 sm:p-6 md:p-10 flex flex-col items-center justify-center transition-all",
|
|
313
|
+
isModal ? "min-h-[450px] flex-1" : "min-h-[280px]",
|
|
314
|
+
showGrid() &&
|
|
315
|
+
"bg-[radial-gradient(#e5e7eb_1px,transparent_1px)] dark:bg-[radial-gradient(#27272a_1px,transparent_1px)] [background-size:16px_16px]",
|
|
316
|
+
local.allowOverflow ? "overflow-visible" : "overflow-x-auto"
|
|
317
|
+
)}
|
|
318
|
+
>
|
|
319
|
+
<div
|
|
320
|
+
class={cn(
|
|
321
|
+
"w-full transition-all duration-300 flex",
|
|
322
|
+
viewportWidthClass(),
|
|
323
|
+
alignmentClass(),
|
|
324
|
+
viewport() !== "desktop" &&
|
|
325
|
+
"rounded-lg border border-dashed border-border/80 p-4 bg-background/80 shadow-xs"
|
|
326
|
+
)}
|
|
327
|
+
>
|
|
328
|
+
<Show when={mounted()}>
|
|
329
|
+
{local.children}
|
|
330
|
+
</Show>
|
|
331
|
+
</div>
|
|
332
|
+
</TabsContent>
|
|
333
|
+
|
|
334
|
+
{/* Source Code View Content */}
|
|
335
|
+
<TabsContent value="code" class={cn("p-0 m-0", isModal && "flex-1 overflow-auto")}>
|
|
336
|
+
<CodeBlock
|
|
337
|
+
code={local.code}
|
|
338
|
+
lang={local.lang || "tsx"}
|
|
339
|
+
filename={local.name ? `${local.name}.tsx` : undefined}
|
|
340
|
+
class="my-0 border-0 rounded-t-none"
|
|
341
|
+
/>
|
|
342
|
+
</TabsContent>
|
|
343
|
+
</Tabs>
|
|
344
|
+
</div>
|
|
345
|
+
);
|
|
346
|
+
|
|
347
|
+
return (
|
|
348
|
+
<>
|
|
349
|
+
<Show when={!isFullscreen()}>
|
|
350
|
+
{renderViewerContent(false)}
|
|
351
|
+
</Show>
|
|
352
|
+
|
|
353
|
+
{/* Fullscreen Portal Modal */}
|
|
354
|
+
<Show when={isFullscreen()}>
|
|
355
|
+
<Portal mount={typeof document !== "undefined" ? document.body : undefined}>
|
|
356
|
+
<div class="fixed inset-0 z-[9999] flex flex-col bg-background/95 backdrop-blur-md p-4 sm:p-8 animate-in fade-in duration-200">
|
|
357
|
+
{renderViewerContent(true)}
|
|
358
|
+
</div>
|
|
359
|
+
</Portal>
|
|
360
|
+
</Show>
|
|
361
|
+
</>
|
|
362
|
+
);
|
|
363
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { splitProps, type JSX, type ValidComponent } from "solid-js";
|
|
2
|
+
import { Dynamic } from "solid-js/web";
|
|
3
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
4
|
+
import { cn } from "@/lib/cn";
|
|
5
|
+
|
|
6
|
+
export const containerVariants = cva("w-full mx-auto px-4 sm:px-6 lg:px-8", {
|
|
7
|
+
variants: {
|
|
8
|
+
size: {
|
|
9
|
+
sm: "max-w-screen-sm",
|
|
10
|
+
md: "max-w-screen-md",
|
|
11
|
+
lg: "max-w-screen-lg",
|
|
12
|
+
xl: "max-w-screen-xl",
|
|
13
|
+
"2xl": "max-w-screen-2xl",
|
|
14
|
+
full: "max-w-full",
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
defaultVariants: {
|
|
18
|
+
size: "2xl",
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export interface ContainerProps<T extends ValidComponent = "div">
|
|
23
|
+
extends JSX.HTMLAttributes<HTMLDivElement>,
|
|
24
|
+
VariantProps<typeof containerVariants> {
|
|
25
|
+
/** Underlying HTML element or Solid component tag (defaults to "div") */
|
|
26
|
+
as?: T;
|
|
27
|
+
class?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Responsive container primitive constraining max-width with semantic padding tokens.
|
|
32
|
+
*/
|
|
33
|
+
export const Container = <T extends ValidComponent = "div">(props: ContainerProps<T>) => {
|
|
34
|
+
const [local, rest] = splitProps(props as ContainerProps, ["as", "size", "class", "children"]);
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<Dynamic
|
|
38
|
+
component={local.as || "div"}
|
|
39
|
+
class={cn(containerVariants({ size: local.size }), local.class)}
|
|
40
|
+
{...rest}
|
|
41
|
+
>
|
|
42
|
+
{local.children}
|
|
43
|
+
</Dynamic>
|
|
44
|
+
);
|
|
45
|
+
};
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { splitProps, type Component, type JSX, type ValidComponent } from "solid-js";
|
|
2
|
+
import * as ContextMenuPrimitive from "@kobalte/core/context-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 { Separator } from "@/components/ui/separator";
|
|
7
|
+
import { Kbd } from "@/components/ui/kbd";
|
|
8
|
+
import { cn } from "@/lib/cn";
|
|
9
|
+
|
|
10
|
+
export const ContextMenu = ContextMenuPrimitive.Root;
|
|
11
|
+
export const ContextMenuTrigger = ContextMenuPrimitive.Trigger;
|
|
12
|
+
export const ContextMenuGroup = ContextMenuPrimitive.Group;
|
|
13
|
+
export const ContextMenuPortal = ContextMenuPrimitive.Portal;
|
|
14
|
+
export const ContextMenuSub = ContextMenuPrimitive.Sub;
|
|
15
|
+
export const ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;
|
|
16
|
+
|
|
17
|
+
export type ContextMenuSubTriggerProps<T extends ValidComponent = "div"> =
|
|
18
|
+
ContextMenuPrimitive.ContextMenuSubTriggerProps<T> & {
|
|
19
|
+
class?: string;
|
|
20
|
+
children?: JSX.Element;
|
|
21
|
+
inset?: boolean;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const ContextMenuSubTrigger = <T extends ValidComponent = "div">(
|
|
25
|
+
props: PolymorphicProps<T, ContextMenuSubTriggerProps<T>>
|
|
26
|
+
) => {
|
|
27
|
+
const [local, rest] = splitProps(props as ContextMenuSubTriggerProps, ["class", "children", "inset"]);
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<ContextMenuPrimitive.SubTrigger
|
|
31
|
+
class={cn(
|
|
32
|
+
"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",
|
|
33
|
+
local.inset && "pl-8",
|
|
34
|
+
local.class
|
|
35
|
+
)}
|
|
36
|
+
{...(rest as any)}
|
|
37
|
+
>
|
|
38
|
+
{local.children}
|
|
39
|
+
<svg class="ml-auto h-4 w-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
40
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M9 5l7 7-7 7" />
|
|
41
|
+
</svg>
|
|
42
|
+
</ContextMenuPrimitive.SubTrigger>
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export type ContextMenuSubContentProps<T extends ValidComponent = "div"> =
|
|
47
|
+
ContextMenuPrimitive.ContextMenuSubContentProps<T> & {
|
|
48
|
+
class?: string;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const ContextMenuSubContent = <T extends ValidComponent = "div">(
|
|
52
|
+
props: PolymorphicProps<T, ContextMenuSubContentProps<T>>
|
|
53
|
+
) => {
|
|
54
|
+
const [local, rest] = splitProps(props as ContextMenuSubContentProps, ["class"]);
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<ContextMenuPrimitive.Portal>
|
|
58
|
+
<ContextMenuPrimitive.SubContent
|
|
59
|
+
class={cn(
|
|
60
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md transition-all animate-in fade-in-80 slide-in-from-top-1",
|
|
61
|
+
local.class
|
|
62
|
+
)}
|
|
63
|
+
{...(rest as any)}
|
|
64
|
+
/>
|
|
65
|
+
</ContextMenuPrimitive.Portal>
|
|
66
|
+
);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export type ContextMenuContentProps<T extends ValidComponent = "div"> =
|
|
70
|
+
ContextMenuPrimitive.ContextMenuContentProps<T> & {
|
|
71
|
+
class?: string;
|
|
72
|
+
ref?: (el: HTMLElement) => void;
|
|
73
|
+
children?: JSX.Element;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export const ContextMenuContent = <T extends ValidComponent = "div">(
|
|
77
|
+
props: PolymorphicProps<T, ContextMenuContentProps<T>>
|
|
78
|
+
) => {
|
|
79
|
+
const [local, rest] = splitProps(props as ContextMenuContentProps, ["class", "ref", "children"]);
|
|
80
|
+
let menuRef: HTMLElement | undefined;
|
|
81
|
+
|
|
82
|
+
createClickOutside({
|
|
83
|
+
target: () => menuRef,
|
|
84
|
+
onInteractOutside: () => {
|
|
85
|
+
// Automatic portal dismiss on outside click
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
return (
|
|
90
|
+
<ContextMenuPrimitive.Portal>
|
|
91
|
+
<ContextMenuPrimitive.Content
|
|
92
|
+
ref={(el) => {
|
|
93
|
+
menuRef = el;
|
|
94
|
+
if (typeof local.ref === "function") local.ref(el);
|
|
95
|
+
}}
|
|
96
|
+
class={cn(
|
|
97
|
+
"z-50 min-w-[8rem] rounded-md border border-border bg-popover text-popover-foreground shadow-md transition-all animate-in fade-in-80 slide-in-from-top-1 max-h-72 flex flex-col",
|
|
98
|
+
local.class
|
|
99
|
+
)}
|
|
100
|
+
{...(rest as any)}
|
|
101
|
+
>
|
|
102
|
+
<ScrollArea class="max-h-72 w-full rounded-[inherit]">
|
|
103
|
+
<div class="p-1">
|
|
104
|
+
{local.children}
|
|
105
|
+
</div>
|
|
106
|
+
</ScrollArea>
|
|
107
|
+
</ContextMenuPrimitive.Content>
|
|
108
|
+
</ContextMenuPrimitive.Portal>
|
|
109
|
+
);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
export type ContextMenuItemProps<T extends ValidComponent = "div"> =
|
|
113
|
+
ContextMenuPrimitive.ContextMenuItemProps<T> & {
|
|
114
|
+
class?: string;
|
|
115
|
+
inset?: boolean;
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export const ContextMenuItem = <T extends ValidComponent = "div">(
|
|
119
|
+
props: PolymorphicProps<T, ContextMenuItemProps<T>>
|
|
120
|
+
) => {
|
|
121
|
+
const [local, rest] = splitProps(props as ContextMenuItemProps, ["class", "inset"]);
|
|
122
|
+
|
|
123
|
+
return (
|
|
124
|
+
<ContextMenuPrimitive.Item
|
|
125
|
+
class={cn(
|
|
126
|
+
"relative flex cursor-default 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",
|
|
127
|
+
local.inset && "pl-8",
|
|
128
|
+
local.class
|
|
129
|
+
)}
|
|
130
|
+
{...(rest as any)}
|
|
131
|
+
/>
|
|
132
|
+
);
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
export type ContextMenuCheckboxItemProps<T extends ValidComponent = "div"> =
|
|
136
|
+
ContextMenuPrimitive.ContextMenuCheckboxItemProps<T> & {
|
|
137
|
+
class?: string;
|
|
138
|
+
children?: JSX.Element;
|
|
139
|
+
checked?: boolean;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
export const ContextMenuCheckboxItem = <T extends ValidComponent = "div">(
|
|
143
|
+
props: PolymorphicProps<T, ContextMenuCheckboxItemProps<T>>
|
|
144
|
+
) => {
|
|
145
|
+
const [local, rest] = splitProps(props as ContextMenuCheckboxItemProps, ["class", "children", "checked"]);
|
|
146
|
+
|
|
147
|
+
return (
|
|
148
|
+
<ContextMenuPrimitive.CheckboxItem
|
|
149
|
+
checked={local.checked}
|
|
150
|
+
class={cn(
|
|
151
|
+
"relative flex cursor-default 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",
|
|
152
|
+
local.class
|
|
153
|
+
)}
|
|
154
|
+
{...(rest as any)}
|
|
155
|
+
>
|
|
156
|
+
<span class="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
157
|
+
<ContextMenuPrimitive.ItemIndicator>
|
|
158
|
+
<svg class="h-4 w-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
159
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7" />
|
|
160
|
+
</svg>
|
|
161
|
+
</ContextMenuPrimitive.ItemIndicator>
|
|
162
|
+
</span>
|
|
163
|
+
{local.children}
|
|
164
|
+
</ContextMenuPrimitive.CheckboxItem>
|
|
165
|
+
);
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
export type ContextMenuRadioItemProps<T extends ValidComponent = "div"> =
|
|
169
|
+
ContextMenuPrimitive.ContextMenuRadioItemProps<T> & {
|
|
170
|
+
class?: string;
|
|
171
|
+
children?: JSX.Element;
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
export const ContextMenuRadioItem = <T extends ValidComponent = "div">(
|
|
175
|
+
props: PolymorphicProps<T, ContextMenuRadioItemProps<T>>
|
|
176
|
+
) => {
|
|
177
|
+
const [local, rest] = splitProps(props as ContextMenuRadioItemProps, ["class", "children"]);
|
|
178
|
+
|
|
179
|
+
return (
|
|
180
|
+
<ContextMenuPrimitive.RadioItem
|
|
181
|
+
class={cn(
|
|
182
|
+
"relative flex cursor-default 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",
|
|
183
|
+
local.class
|
|
184
|
+
)}
|
|
185
|
+
{...(rest as any)}
|
|
186
|
+
>
|
|
187
|
+
<span class="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
188
|
+
<ContextMenuPrimitive.ItemIndicator>
|
|
189
|
+
<svg class="h-2 w-2 fill-current" viewBox="0 0 8 8">
|
|
190
|
+
<circle cx="4" cy="4" r="3" />
|
|
191
|
+
</svg>
|
|
192
|
+
</ContextMenuPrimitive.ItemIndicator>
|
|
193
|
+
</span>
|
|
194
|
+
{local.children}
|
|
195
|
+
</ContextMenuPrimitive.RadioItem>
|
|
196
|
+
);
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
export interface ContextMenuLabelProps {
|
|
200
|
+
class?: string;
|
|
201
|
+
inset?: boolean;
|
|
202
|
+
children?: JSX.Element;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export const ContextMenuLabel: Component<ContextMenuLabelProps> = (props) => {
|
|
206
|
+
const [local, rest] = splitProps(props, ["class", "inset", "children"]);
|
|
207
|
+
|
|
208
|
+
return (
|
|
209
|
+
<ContextMenuPrimitive.GroupLabel
|
|
210
|
+
class={cn("px-2 py-1.5 text-sm font-semibold text-foreground", local.inset && "pl-8", local.class)}
|
|
211
|
+
{...rest}
|
|
212
|
+
>
|
|
213
|
+
{local.children}
|
|
214
|
+
</ContextMenuPrimitive.GroupLabel>
|
|
215
|
+
);
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
export const ContextMenuSeparator: Component<{ class?: string }> = (props) => {
|
|
219
|
+
return <Separator class={cn("-mx-1 my-1", props.class)} />;
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
export interface ContextMenuShortcutProps {
|
|
223
|
+
class?: string;
|
|
224
|
+
children?: JSX.Element;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export const ContextMenuShortcut: Component<ContextMenuShortcutProps> = (props) => {
|
|
228
|
+
const [local, rest] = splitProps(props, ["class", "children"]);
|
|
229
|
+
|
|
230
|
+
return (
|
|
231
|
+
<span class={cn("ml-auto pl-4 text-xs tracking-widest text-muted-foreground", local.class)} {...rest}>
|
|
232
|
+
<Kbd size="sm" variant="outline">
|
|
233
|
+
{local.children}
|
|
234
|
+
</Kbd>
|
|
235
|
+
</span>
|
|
236
|
+
);
|
|
237
|
+
};
|