@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,204 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createContext,
|
|
3
|
+
useContext,
|
|
4
|
+
splitProps,
|
|
5
|
+
Show,
|
|
6
|
+
type Component,
|
|
7
|
+
type JSX,
|
|
8
|
+
type Accessor,
|
|
9
|
+
} from "solid-js";
|
|
10
|
+
import { createControllableSignal } from "@/hooks/create-controllable-signal";
|
|
11
|
+
import { cn } from "@/lib/cn";
|
|
12
|
+
|
|
13
|
+
interface TabsContextValue {
|
|
14
|
+
value: Accessor<string | undefined>;
|
|
15
|
+
setValue: (value: string) => void;
|
|
16
|
+
orientation: Accessor<"horizontal" | "vertical">;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const TabsContext = createContext<TabsContextValue>();
|
|
20
|
+
|
|
21
|
+
export interface TabsProps
|
|
22
|
+
extends Omit<JSX.HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
23
|
+
/** Controlled active tab value */
|
|
24
|
+
value?: string;
|
|
25
|
+
/** Uncontrolled default active tab value */
|
|
26
|
+
defaultValue?: string;
|
|
27
|
+
/** Callback fired when active tab changes */
|
|
28
|
+
onChange?: (value: string) => void;
|
|
29
|
+
/** Layout orientation of tab triggers and content */
|
|
30
|
+
orientation?: "horizontal" | "vertical";
|
|
31
|
+
class?: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Root Tabs container component managing active tab context state and orientation.
|
|
36
|
+
*/
|
|
37
|
+
export const Tabs: Component<TabsProps> = (props) => {
|
|
38
|
+
const [local, rest] = splitProps(props, [
|
|
39
|
+
"value",
|
|
40
|
+
"defaultValue",
|
|
41
|
+
"onChange",
|
|
42
|
+
"orientation",
|
|
43
|
+
"class",
|
|
44
|
+
"children",
|
|
45
|
+
]);
|
|
46
|
+
|
|
47
|
+
const [currentValue, setCurrentValue] = createControllableSignal<string>({
|
|
48
|
+
value: () => local.value,
|
|
49
|
+
defaultValue: local.defaultValue,
|
|
50
|
+
onChange: (val) => local.onChange?.(val),
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
const orientation = () => local.orientation || "horizontal";
|
|
54
|
+
|
|
55
|
+
const contextValue: TabsContextValue = {
|
|
56
|
+
value: currentValue,
|
|
57
|
+
setValue: (val: string) => setCurrentValue(val),
|
|
58
|
+
orientation,
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<TabsContext.Provider value={contextValue}>
|
|
63
|
+
<div
|
|
64
|
+
data-orientation={orientation()}
|
|
65
|
+
class={cn(
|
|
66
|
+
"w-full",
|
|
67
|
+
orientation() === "vertical" ? "flex flex-row gap-4" : "flex flex-col gap-2",
|
|
68
|
+
local.class
|
|
69
|
+
)}
|
|
70
|
+
{...rest}
|
|
71
|
+
>
|
|
72
|
+
{local.children}
|
|
73
|
+
</div>
|
|
74
|
+
</TabsContext.Provider>
|
|
75
|
+
);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export interface TabsListProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
79
|
+
class?: string;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Container wrapper for Tab triggers.
|
|
84
|
+
*/
|
|
85
|
+
export const TabsList: Component<TabsListProps> = (props) => {
|
|
86
|
+
const [local, rest] = splitProps(props, ["class", "children"]);
|
|
87
|
+
const context = useContext(TabsContext);
|
|
88
|
+
|
|
89
|
+
const isVertical = () => context?.orientation() === "vertical";
|
|
90
|
+
|
|
91
|
+
return (
|
|
92
|
+
<div
|
|
93
|
+
role="tablist"
|
|
94
|
+
aria-orientation={context?.orientation() || "horizontal"}
|
|
95
|
+
class={cn(
|
|
96
|
+
"inline-flex rounded-lg bg-muted p-1 text-muted-foreground",
|
|
97
|
+
isVertical()
|
|
98
|
+
? "flex-col h-auto w-auto items-stretch justify-start"
|
|
99
|
+
: "h-9 items-center justify-center",
|
|
100
|
+
local.class
|
|
101
|
+
)}
|
|
102
|
+
{...rest}
|
|
103
|
+
>
|
|
104
|
+
{local.children}
|
|
105
|
+
</div>
|
|
106
|
+
);
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export interface TabsTriggerProps
|
|
110
|
+
extends Omit<JSX.ButtonHTMLAttributes<HTMLButtonElement>, "onChange"> {
|
|
111
|
+
/** Unique value identifier for this tab */
|
|
112
|
+
value: string;
|
|
113
|
+
class?: string;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Tab button trigger to activate a specific tab panel.
|
|
118
|
+
*/
|
|
119
|
+
export const TabsTrigger: Component<TabsTriggerProps> = (props) => {
|
|
120
|
+
const [local, rest] = splitProps(props, [
|
|
121
|
+
"value",
|
|
122
|
+
"disabled",
|
|
123
|
+
"class",
|
|
124
|
+
"children",
|
|
125
|
+
"onClick",
|
|
126
|
+
]);
|
|
127
|
+
const context = useContext(TabsContext);
|
|
128
|
+
|
|
129
|
+
if (!context) {
|
|
130
|
+
throw new Error("TabsTrigger must be used within a Tabs component");
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
const isSelected = () => context.value() === local.value;
|
|
134
|
+
const isVertical = () => context.orientation() === "vertical";
|
|
135
|
+
|
|
136
|
+
const handleClick = (
|
|
137
|
+
e: MouseEvent & { currentTarget: HTMLButtonElement; target: Element }
|
|
138
|
+
) => {
|
|
139
|
+
if (local.disabled) return;
|
|
140
|
+
context.setValue(local.value);
|
|
141
|
+
if (typeof local.onClick === "function") {
|
|
142
|
+
local.onClick(e);
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
return (
|
|
147
|
+
<button
|
|
148
|
+
type="button"
|
|
149
|
+
role="tab"
|
|
150
|
+
aria-selected={isSelected()}
|
|
151
|
+
data-state={isSelected() ? "active" : "inactive"}
|
|
152
|
+
data-orientation={context.orientation()}
|
|
153
|
+
disabled={local.disabled}
|
|
154
|
+
onClick={handleClick}
|
|
155
|
+
class={cn(
|
|
156
|
+
"inline-flex items-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-accent data-[state=active]:border data-[state=active]:border-border data-[state=active]:text-foreground data-[state=active]:shadow-sm cursor-pointer",
|
|
157
|
+
isVertical() ? "justify-start py-1.5" : "justify-center",
|
|
158
|
+
local.class
|
|
159
|
+
)}
|
|
160
|
+
{...rest}
|
|
161
|
+
>
|
|
162
|
+
{local.children}
|
|
163
|
+
</button>
|
|
164
|
+
);
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
export interface TabsContentProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
168
|
+
/** Value matching the corresponding tab trigger */
|
|
169
|
+
value: string;
|
|
170
|
+
class?: string;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Content panel revealed when the associated tab is active.
|
|
175
|
+
*/
|
|
176
|
+
export const TabsContent: Component<TabsContentProps> = (props) => {
|
|
177
|
+
const [local, rest] = splitProps(props, ["value", "class", "children"]);
|
|
178
|
+
const context = useContext(TabsContext);
|
|
179
|
+
|
|
180
|
+
if (!context) {
|
|
181
|
+
throw new Error("TabsContent must be used within a Tabs component");
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
const isSelected = () => context.value() === local.value;
|
|
185
|
+
const isVertical = () => context.orientation() === "vertical";
|
|
186
|
+
|
|
187
|
+
return (
|
|
188
|
+
<Show when={isSelected()}>
|
|
189
|
+
<div
|
|
190
|
+
role="tabpanel"
|
|
191
|
+
data-state={isSelected() ? "active" : "inactive"}
|
|
192
|
+
data-orientation={context.orientation()}
|
|
193
|
+
class={cn(
|
|
194
|
+
"ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
195
|
+
isVertical() ? "flex-1 mt-0" : "mt-2",
|
|
196
|
+
local.class
|
|
197
|
+
)}
|
|
198
|
+
{...rest}
|
|
199
|
+
>
|
|
200
|
+
{local.children}
|
|
201
|
+
</div>
|
|
202
|
+
</Show>
|
|
203
|
+
);
|
|
204
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// src/components/ui/textarea.tsx
|
|
2
|
+
import {
|
|
3
|
+
createSignal,
|
|
4
|
+
splitProps,
|
|
5
|
+
Show,
|
|
6
|
+
type Component,
|
|
7
|
+
type JSX,
|
|
8
|
+
} from "solid-js";
|
|
9
|
+
import { cn } from "@/lib/cn";
|
|
10
|
+
|
|
11
|
+
export interface TextareaProps
|
|
12
|
+
extends JSX.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
13
|
+
/** Uncontrolled initial default value */
|
|
14
|
+
defaultValue?: string | number;
|
|
15
|
+
/** Maximum allowed character limit */
|
|
16
|
+
maxLength?: number;
|
|
17
|
+
/** Whether to show live character count badge */
|
|
18
|
+
showCount?: boolean;
|
|
19
|
+
class?: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Nikala UI Textarea component with optional live character counter and limit indicators.
|
|
24
|
+
*/
|
|
25
|
+
export const Textarea: Component<TextareaProps> = (props) => {
|
|
26
|
+
const [local, rest] = splitProps(props, [
|
|
27
|
+
"maxLength",
|
|
28
|
+
"showCount",
|
|
29
|
+
"value",
|
|
30
|
+
"defaultValue",
|
|
31
|
+
"onInput",
|
|
32
|
+
"class",
|
|
33
|
+
]);
|
|
34
|
+
|
|
35
|
+
/* Internal reactive signal for character count tracking */
|
|
36
|
+
const [currentValue, setCurrentValue] = createSignal<string>(
|
|
37
|
+
String(local.value || local.defaultValue || "")
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
const handleInput: JSX.EventHandlerUnion<HTMLTextAreaElement, InputEvent> = (
|
|
41
|
+
e
|
|
42
|
+
) => {
|
|
43
|
+
setCurrentValue(e.currentTarget.value);
|
|
44
|
+
if (typeof local.onInput === "function") {
|
|
45
|
+
(local.onInput as (e: InputEvent) => void)(e);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const count = () => currentValue().length;
|
|
50
|
+
const isAtLimit = () =>
|
|
51
|
+
local.maxLength !== undefined && count() >= local.maxLength;
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<div class="relative flex flex-col w-full">
|
|
55
|
+
<textarea
|
|
56
|
+
value={local.value !== undefined ? String(local.value) : currentValue()}
|
|
57
|
+
maxLength={local.maxLength}
|
|
58
|
+
onInput={handleInput}
|
|
59
|
+
class={cn(
|
|
60
|
+
"flex min-h-20 w-full rounded-md border border-input bg-muted px-3 py-2 text-base shadow-2xs transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
61
|
+
local.class
|
|
62
|
+
)}
|
|
63
|
+
{...rest}
|
|
64
|
+
/>
|
|
65
|
+
|
|
66
|
+
{/* Dynamic Character Counter */}
|
|
67
|
+
<Show when={local.showCount ?? Boolean(local.maxLength)}>
|
|
68
|
+
<div
|
|
69
|
+
class={cn(
|
|
70
|
+
"mt-1 text-right text-[11px] font-mono transition-colors select-none",
|
|
71
|
+
isAtLimit() ? "text-rose-500 font-bold" : "text-muted-foreground"
|
|
72
|
+
)}
|
|
73
|
+
>
|
|
74
|
+
<span>{count()}</span>
|
|
75
|
+
<Show when={local.maxLength}>
|
|
76
|
+
<span> / {local.maxLength}</span>
|
|
77
|
+
</Show>
|
|
78
|
+
</div>
|
|
79
|
+
</Show>
|
|
80
|
+
</div>
|
|
81
|
+
);
|
|
82
|
+
};
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { splitProps, type Component, For, Show, type JSX } from "solid-js";
|
|
2
|
+
import { Sun, Moon, Monitor } from "lucide-solid";
|
|
3
|
+
import {
|
|
4
|
+
useTheme,
|
|
5
|
+
type AccentColor,
|
|
6
|
+
type Radius,
|
|
7
|
+
type Theme,
|
|
8
|
+
} from "../../providers/theme-provider";
|
|
9
|
+
import {
|
|
10
|
+
runThemeTransition,
|
|
11
|
+
type ThemeEffect,
|
|
12
|
+
} from "../../providers/theme-transitions";
|
|
13
|
+
import { Button, type ButtonProps } from "./button";
|
|
14
|
+
import {
|
|
15
|
+
DropdownMenu,
|
|
16
|
+
DropdownMenuTrigger,
|
|
17
|
+
DropdownMenuContent,
|
|
18
|
+
DropdownMenuItem,
|
|
19
|
+
DropdownMenuGroup,
|
|
20
|
+
DropdownMenuLabel,
|
|
21
|
+
DropdownMenuSeparator,
|
|
22
|
+
} from "./dropdown-menu";
|
|
23
|
+
import { cn } from "@/lib/cn";
|
|
24
|
+
|
|
25
|
+
export interface ThemeToggleProps
|
|
26
|
+
extends Omit<JSX.ButtonHTMLAttributes<HTMLButtonElement>, "onClick"> {
|
|
27
|
+
/** Display mode: "button" (direct 1-click toggle), "mini" (compact dropdown), "max" (full customizer panel). Defaults to "mini". */
|
|
28
|
+
mode?: "button" | "mini" | "max";
|
|
29
|
+
/** Transition animation effect when changing themes ("none", "circular", "fade") */
|
|
30
|
+
effect?: ThemeEffect;
|
|
31
|
+
/** Button visual style variant when rendered as a button or dropdown trigger */
|
|
32
|
+
variant?: ButtonProps["variant"];
|
|
33
|
+
/** Button size */
|
|
34
|
+
size?: ButtonProps["size"];
|
|
35
|
+
class?: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const ACCENT_OPTIONS: { name: AccentColor; label: string; color: string }[] = [
|
|
39
|
+
{ name: "yellow", label: "Yellow", color: "bg-yellow-500" },
|
|
40
|
+
{ name: "red", label: "Red", color: "bg-red-500" },
|
|
41
|
+
{ name: "violet", label: "Violet", color: "bg-violet-500" },
|
|
42
|
+
{ name: "sky", label: "Sky", color: "bg-sky-500" },
|
|
43
|
+
{ name: "emerald", label: "Emerald", color: "bg-emerald-500" },
|
|
44
|
+
{ name: "zinc", label: "Zinc", color: "bg-zinc-800 dark:bg-zinc-200" },
|
|
45
|
+
];
|
|
46
|
+
|
|
47
|
+
const RADIUS_OPTIONS: { value: Radius; label: string }[] = [
|
|
48
|
+
{ value: "0", label: "0" },
|
|
49
|
+
{ value: "0.3", label: "0.3" },
|
|
50
|
+
{ value: "0.5", label: "0.5" },
|
|
51
|
+
{ value: "0.75", label: "0.75" },
|
|
52
|
+
{ value: "1.0", label: "1.0" },
|
|
53
|
+
];
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Interactive UI theme switcher supporting button, mini (dropdown), and max (customizer panel) modes with View Transition animations.
|
|
57
|
+
*/
|
|
58
|
+
export const ThemeToggle: Component<ThemeToggleProps> = (props) => {
|
|
59
|
+
const [local, rest] = splitProps(props, ["mode", "effect", "variant", "size", "class"]);
|
|
60
|
+
const { theme, setTheme, accent, setAccent, radius, setRadius } = useTheme();
|
|
61
|
+
|
|
62
|
+
const mode = () => local.mode || "mini";
|
|
63
|
+
const effect = () => local.effect || "none";
|
|
64
|
+
|
|
65
|
+
/* Reactive accessor determining whether dark mode is active */
|
|
66
|
+
const isDarkMode = () => {
|
|
67
|
+
const currentTheme = theme();
|
|
68
|
+
if (currentTheme === "dark") return true;
|
|
69
|
+
if (currentTheme === "light") return false;
|
|
70
|
+
if (typeof window !== "undefined") {
|
|
71
|
+
return window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
72
|
+
}
|
|
73
|
+
return false;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const changeThemeWithEffect = (newTheme: Theme, e: MouseEvent) => {
|
|
77
|
+
runThemeTransition(effect(), e, () => {
|
|
78
|
+
setTheme(newTheme);
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const handleToggleClick = (e: MouseEvent) => {
|
|
83
|
+
const nextTheme: Theme = isDarkMode() ? "light" : "dark";
|
|
84
|
+
changeThemeWithEffect(nextTheme, e);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<Show
|
|
89
|
+
when={mode() !== "button"}
|
|
90
|
+
fallback={
|
|
91
|
+
/* Button Mode: Direct 1-click Dark/Light switcher without dropdown */
|
|
92
|
+
<Button
|
|
93
|
+
variant={local.variant || "ghost"}
|
|
94
|
+
size={local.size || "icon"}
|
|
95
|
+
onClick={handleToggleClick}
|
|
96
|
+
class={cn("relative cursor-pointer", local.class)}
|
|
97
|
+
aria-label="Toggle theme"
|
|
98
|
+
{...rest}
|
|
99
|
+
>
|
|
100
|
+
<Show
|
|
101
|
+
when={isDarkMode()}
|
|
102
|
+
fallback={<Sun class="h-4 w-4 text-foreground transition-transform" />}
|
|
103
|
+
>
|
|
104
|
+
<Moon class="h-4 w-4 text-foreground transition-transform" />
|
|
105
|
+
</Show>
|
|
106
|
+
<span class="sr-only">Toggle theme</span>
|
|
107
|
+
</Button>
|
|
108
|
+
}
|
|
109
|
+
>
|
|
110
|
+
<DropdownMenu placement="bottom-end">
|
|
111
|
+
<DropdownMenuTrigger
|
|
112
|
+
as={Button}
|
|
113
|
+
variant={local.variant || "ghost"}
|
|
114
|
+
size={local.size || "icon"}
|
|
115
|
+
class={cn("relative cursor-pointer", local.class)}
|
|
116
|
+
{...rest}
|
|
117
|
+
>
|
|
118
|
+
{/* Reactive Sun / Moon Icon Toggle */}
|
|
119
|
+
<Show
|
|
120
|
+
when={isDarkMode()}
|
|
121
|
+
fallback={<Sun class="h-4 w-4 text-foreground transition-transform" />}
|
|
122
|
+
>
|
|
123
|
+
<Moon class="h-4 w-4 text-foreground transition-transform" />
|
|
124
|
+
</Show>
|
|
125
|
+
<span class="sr-only">Toggle theme</span>
|
|
126
|
+
</DropdownMenuTrigger>
|
|
127
|
+
|
|
128
|
+
<Show
|
|
129
|
+
when={mode() === "max"}
|
|
130
|
+
fallback={
|
|
131
|
+
/* Mini Mode: Compact Dropdown */
|
|
132
|
+
<DropdownMenuContent>
|
|
133
|
+
<DropdownMenuItem onClick={(e: MouseEvent) => changeThemeWithEffect("light", e)}>
|
|
134
|
+
<Sun class="mr-2 h-4 w-4 text-muted-foreground" />
|
|
135
|
+
Light
|
|
136
|
+
</DropdownMenuItem>
|
|
137
|
+
|
|
138
|
+
<DropdownMenuItem onClick={(e: MouseEvent) => changeThemeWithEffect("dark", e)}>
|
|
139
|
+
<Moon class="mr-2 h-4 w-4 text-muted-foreground" />
|
|
140
|
+
Dark
|
|
141
|
+
</DropdownMenuItem>
|
|
142
|
+
|
|
143
|
+
<DropdownMenuItem onClick={(e: MouseEvent) => changeThemeWithEffect("system", e)}>
|
|
144
|
+
<Monitor class="mr-2 h-4 w-4 text-muted-foreground" />
|
|
145
|
+
System
|
|
146
|
+
</DropdownMenuItem>
|
|
147
|
+
</DropdownMenuContent>
|
|
148
|
+
}
|
|
149
|
+
>
|
|
150
|
+
{/* Max Mode: Full Theme Customizer Panel */}
|
|
151
|
+
<DropdownMenuContent class="w-64">
|
|
152
|
+
<div class="p-2 space-y-2">
|
|
153
|
+
<DropdownMenuGroup>
|
|
154
|
+
<DropdownMenuLabel class="px-0 pt-0 text-xs font-semibold uppercase tracking-wider text-muted-foreground">
|
|
155
|
+
Theme Mode
|
|
156
|
+
</DropdownMenuLabel>
|
|
157
|
+
<div class="grid grid-cols-3 gap-1 my-1.5">
|
|
158
|
+
<Button
|
|
159
|
+
variant={theme() === "light" ? "default" : "outline"}
|
|
160
|
+
size="sm"
|
|
161
|
+
onClick={(e: MouseEvent) => changeThemeWithEffect("light", e)}
|
|
162
|
+
class="h-8 text-xs cursor-pointer"
|
|
163
|
+
>
|
|
164
|
+
Light
|
|
165
|
+
</Button>
|
|
166
|
+
<Button
|
|
167
|
+
variant={theme() === "dark" ? "default" : "outline"}
|
|
168
|
+
size="sm"
|
|
169
|
+
onClick={(e: MouseEvent) => changeThemeWithEffect("dark", e)}
|
|
170
|
+
class="h-8 text-xs cursor-pointer"
|
|
171
|
+
>
|
|
172
|
+
Dark
|
|
173
|
+
</Button>
|
|
174
|
+
<Button
|
|
175
|
+
variant={theme() === "system" ? "default" : "outline"}
|
|
176
|
+
size="sm"
|
|
177
|
+
onClick={(e: MouseEvent) => changeThemeWithEffect("system", e)}
|
|
178
|
+
class="h-8 text-xs cursor-pointer"
|
|
179
|
+
>
|
|
180
|
+
System
|
|
181
|
+
</Button>
|
|
182
|
+
</div>
|
|
183
|
+
</DropdownMenuGroup>
|
|
184
|
+
|
|
185
|
+
<DropdownMenuSeparator class="my-2" />
|
|
186
|
+
|
|
187
|
+
<DropdownMenuGroup>
|
|
188
|
+
<DropdownMenuLabel class="px-0 text-xs font-semibold uppercase tracking-wider text-muted-foreground">
|
|
189
|
+
Brand Accent Color
|
|
190
|
+
</DropdownMenuLabel>
|
|
191
|
+
<div class="flex flex-wrap gap-1.5 my-1.5">
|
|
192
|
+
<For each={ACCENT_OPTIONS}>
|
|
193
|
+
{(opt) => (
|
|
194
|
+
<button
|
|
195
|
+
type="button"
|
|
196
|
+
title={opt.label}
|
|
197
|
+
onClick={() => setAccent(opt.name)}
|
|
198
|
+
class={cn(
|
|
199
|
+
"h-6 w-6 rounded-md transition-all cursor-pointer border border-border flex items-center justify-center",
|
|
200
|
+
opt.color,
|
|
201
|
+
accent() === opt.name
|
|
202
|
+
? "ring-2 ring-primary ring-offset-2 ring-offset-background scale-110"
|
|
203
|
+
: "hover:scale-105"
|
|
204
|
+
)}
|
|
205
|
+
/>
|
|
206
|
+
)}
|
|
207
|
+
</For>
|
|
208
|
+
</div>
|
|
209
|
+
</DropdownMenuGroup>
|
|
210
|
+
|
|
211
|
+
<DropdownMenuSeparator class="my-2" />
|
|
212
|
+
|
|
213
|
+
<DropdownMenuGroup>
|
|
214
|
+
<DropdownMenuLabel class="px-0 text-xs font-semibold uppercase tracking-wider text-muted-foreground">
|
|
215
|
+
Border Radius
|
|
216
|
+
</DropdownMenuLabel>
|
|
217
|
+
<div class="grid grid-cols-5 gap-1 my-1.5">
|
|
218
|
+
<For each={RADIUS_OPTIONS}>
|
|
219
|
+
{(r) => (
|
|
220
|
+
<Button
|
|
221
|
+
variant={radius() === r.value ? "default" : "outline"}
|
|
222
|
+
size="sm"
|
|
223
|
+
onClick={() => setRadius(r.value)}
|
|
224
|
+
class="h-7 text-xs px-1 cursor-pointer"
|
|
225
|
+
>
|
|
226
|
+
{r.label}
|
|
227
|
+
</Button>
|
|
228
|
+
)}
|
|
229
|
+
</For>
|
|
230
|
+
</div>
|
|
231
|
+
</DropdownMenuGroup>
|
|
232
|
+
</div>
|
|
233
|
+
</DropdownMenuContent>
|
|
234
|
+
</Show>
|
|
235
|
+
</DropdownMenu>
|
|
236
|
+
</Show>
|
|
237
|
+
);
|
|
238
|
+
};
|