@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,117 @@
|
|
|
1
|
+
import {
|
|
2
|
+
splitProps,
|
|
3
|
+
For,
|
|
4
|
+
Show,
|
|
5
|
+
type JSX,
|
|
6
|
+
type Component,
|
|
7
|
+
} from "solid-js";
|
|
8
|
+
import { SectionHeading } from "@/components/ui/section-heading";
|
|
9
|
+
import {
|
|
10
|
+
Table,
|
|
11
|
+
TableHeader,
|
|
12
|
+
TableBody,
|
|
13
|
+
TableRow,
|
|
14
|
+
TableHead,
|
|
15
|
+
TableCell,
|
|
16
|
+
} from "@/components/ui/table";
|
|
17
|
+
import { cn } from "@/lib/cn";
|
|
18
|
+
|
|
19
|
+
export interface ApiTableItem {
|
|
20
|
+
/** Property, attribute, or method name */
|
|
21
|
+
prop: string;
|
|
22
|
+
/** TypeScript type definition string */
|
|
23
|
+
type: string;
|
|
24
|
+
/** Default value if optional */
|
|
25
|
+
default?: string;
|
|
26
|
+
/** Detailed description of purpose and usage */
|
|
27
|
+
description: string;
|
|
28
|
+
/** Whether the property is strictly required */
|
|
29
|
+
required?: boolean;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface ApiTableProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
33
|
+
/** Title header for this API section (e.g. component or interface name) */
|
|
34
|
+
title?: string;
|
|
35
|
+
/** Subtitle or explanatory note */
|
|
36
|
+
description?: string;
|
|
37
|
+
/** Badge label next to the title (defaults to "Props") */
|
|
38
|
+
badge?: string;
|
|
39
|
+
/** List of API properties to render in the table */
|
|
40
|
+
items: ApiTableItem[];
|
|
41
|
+
class?: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Clean, structured API reference table component composed from Table and Badge primitives.
|
|
46
|
+
*/
|
|
47
|
+
export const ApiTable: Component<ApiTableProps> = (props) => {
|
|
48
|
+
const [local, rest] = splitProps(props, [
|
|
49
|
+
"title",
|
|
50
|
+
"description",
|
|
51
|
+
"badge",
|
|
52
|
+
"items",
|
|
53
|
+
"class",
|
|
54
|
+
]);
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<div class={cn("my-6 space-y-3", local.class)} {...rest}>
|
|
58
|
+
{/* Header */}
|
|
59
|
+
<Show when={local.title}>
|
|
60
|
+
<SectionHeading
|
|
61
|
+
variant="compact"
|
|
62
|
+
title={local.title!}
|
|
63
|
+
badge={local.badge || "Props"}
|
|
64
|
+
description={local.description}
|
|
65
|
+
/>
|
|
66
|
+
</Show>
|
|
67
|
+
|
|
68
|
+
{/* Responsive Table Container Composed from Nikala Table Primitives */}
|
|
69
|
+
<div class="rounded-lg border border-border bg-card/50 shadow-2xs overflow-hidden">
|
|
70
|
+
<Table class="text-xs">
|
|
71
|
+
<TableHeader class="bg-muted/40 font-mono text-[11px] uppercase tracking-wider text-muted-foreground select-none">
|
|
72
|
+
<TableRow class="hover:bg-transparent">
|
|
73
|
+
<TableHead class="h-9 px-4 font-semibold">Prop</TableHead>
|
|
74
|
+
<TableHead class="h-9 px-4 font-semibold">Type</TableHead>
|
|
75
|
+
<TableHead class="h-9 px-4 font-semibold">Default</TableHead>
|
|
76
|
+
<TableHead class="h-9 px-4 font-semibold">Description</TableHead>
|
|
77
|
+
</TableRow>
|
|
78
|
+
</TableHeader>
|
|
79
|
+
<TableBody class="font-mono text-xs">
|
|
80
|
+
<For each={local.items}>
|
|
81
|
+
{(item) => (
|
|
82
|
+
<TableRow class="transition-colors hover:bg-muted/20">
|
|
83
|
+
<TableCell class="px-4 py-3 font-semibold text-primary">
|
|
84
|
+
<span class="inline-flex items-center gap-1">
|
|
85
|
+
{item.prop}
|
|
86
|
+
<Show when={item.required}>
|
|
87
|
+
<span class="text-rose-500 font-bold" title="Required">*</span>
|
|
88
|
+
</Show>
|
|
89
|
+
</span>
|
|
90
|
+
</TableCell>
|
|
91
|
+
<TableCell class="px-4 py-3 text-muted-foreground">
|
|
92
|
+
<code class="rounded-md bg-muted px-1.5 py-0.5 font-mono text-[11px] text-foreground">
|
|
93
|
+
{item.type}
|
|
94
|
+
</code>
|
|
95
|
+
</TableCell>
|
|
96
|
+
<TableCell class="px-4 py-3 text-muted-foreground">
|
|
97
|
+
<Show
|
|
98
|
+
when={item.default}
|
|
99
|
+
fallback={<span class="text-muted-foreground/40 font-mono">-</span>}
|
|
100
|
+
>
|
|
101
|
+
<code class="rounded-md bg-muted/60 px-1 py-0.5 font-mono text-[11px]">
|
|
102
|
+
{item.default}
|
|
103
|
+
</code>
|
|
104
|
+
</Show>
|
|
105
|
+
</TableCell>
|
|
106
|
+
<TableCell class="px-4 py-3 font-sans font-normal leading-relaxed text-muted-foreground">
|
|
107
|
+
{item.description}
|
|
108
|
+
</TableCell>
|
|
109
|
+
</TableRow>
|
|
110
|
+
)}
|
|
111
|
+
</For>
|
|
112
|
+
</TableBody>
|
|
113
|
+
</Table>
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
116
|
+
);
|
|
117
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { splitProps, type Component, type JSX } from "solid-js";
|
|
2
|
+
import { cn } from "@/lib/cn";
|
|
3
|
+
|
|
4
|
+
export interface AspectRatioProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
ratio?: number;
|
|
6
|
+
class?: string;
|
|
7
|
+
children?: JSX.Element;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Nikala UI AspectRatio Component.
|
|
12
|
+
* Displays content within a specific aspect ratio (e.g. 16/9, 4/3, 1/1) using CSS aspect-ratio.
|
|
13
|
+
*/
|
|
14
|
+
export const AspectRatio: Component<AspectRatioProps> = (props) => {
|
|
15
|
+
const [local, rest] = splitProps(props, ["ratio", "class", "children", "style"]);
|
|
16
|
+
|
|
17
|
+
const computedRatio = () => (local.ratio !== undefined ? local.ratio : 16 / 9);
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<div
|
|
21
|
+
class={cn("relative w-full overflow-hidden", local.class)}
|
|
22
|
+
style={{
|
|
23
|
+
"aspect-ratio": `${computedRatio()}`,
|
|
24
|
+
...(typeof local.style === "object" ? local.style : {}),
|
|
25
|
+
}}
|
|
26
|
+
{...rest}
|
|
27
|
+
>
|
|
28
|
+
{local.children}
|
|
29
|
+
</div>
|
|
30
|
+
);
|
|
31
|
+
};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createSignal,
|
|
3
|
+
createEffect,
|
|
4
|
+
Show,
|
|
5
|
+
splitProps,
|
|
6
|
+
type Component,
|
|
7
|
+
type JSX,
|
|
8
|
+
} from "solid-js";
|
|
9
|
+
import { cn } from "@/lib/cn";
|
|
10
|
+
|
|
11
|
+
export interface AvatarProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
12
|
+
class?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Root Avatar container component.
|
|
17
|
+
*/
|
|
18
|
+
export const Avatar: Component<AvatarProps> = (props) => {
|
|
19
|
+
const [local, rest] = splitProps(props, ["class"]);
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<div
|
|
23
|
+
class={cn(
|
|
24
|
+
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-lg border border-border bg-muted",
|
|
25
|
+
local.class
|
|
26
|
+
)}
|
|
27
|
+
{...rest}
|
|
28
|
+
/>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export interface AvatarImageProps
|
|
33
|
+
extends JSX.ImgHTMLAttributes<HTMLImageElement> {
|
|
34
|
+
class?: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Image element for the Avatar component with background status loader.
|
|
39
|
+
*/
|
|
40
|
+
export const AvatarImage: Component<AvatarImageProps> = (props) => {
|
|
41
|
+
const [local, rest] = splitProps(props, [
|
|
42
|
+
"class",
|
|
43
|
+
"src",
|
|
44
|
+
"alt",
|
|
45
|
+
"onLoad",
|
|
46
|
+
"onError",
|
|
47
|
+
]);
|
|
48
|
+
const [status, setStatus] = createSignal<"loading" | "loaded" | "error">(
|
|
49
|
+
"loading"
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
/* Pre-test image loading in background JS to prevent native broken icon flashes */
|
|
53
|
+
createEffect(() => {
|
|
54
|
+
const src = local.src;
|
|
55
|
+
if (!src) {
|
|
56
|
+
setStatus("error");
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const img = new Image();
|
|
61
|
+
img.src = src;
|
|
62
|
+
img.onload = () => setStatus("loaded");
|
|
63
|
+
img.onerror = () => setStatus("error");
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
const handleLoad: JSX.EventHandlerUnion<HTMLImageElement, Event> = (e) => {
|
|
67
|
+
setStatus("loaded");
|
|
68
|
+
if (typeof local.onLoad === "function") {
|
|
69
|
+
(local.onLoad as (e: Event) => void)(e);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const handleError: JSX.EventHandlerUnion<HTMLImageElement, Event> = (e) => {
|
|
74
|
+
setStatus("error");
|
|
75
|
+
if (typeof local.onError === "function") {
|
|
76
|
+
(local.onError as (e: Event) => void)(e);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
return (
|
|
81
|
+
<Show when={status() === "loaded"}>
|
|
82
|
+
<img
|
|
83
|
+
src={local.src}
|
|
84
|
+
alt={local.alt}
|
|
85
|
+
class={cn("aspect-square h-full w-full object-cover", local.class)}
|
|
86
|
+
onLoad={handleLoad}
|
|
87
|
+
onError={handleError}
|
|
88
|
+
{...rest}
|
|
89
|
+
/>
|
|
90
|
+
</Show>
|
|
91
|
+
);
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export interface AvatarFallbackProps
|
|
95
|
+
extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
96
|
+
class?: string;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Fallback container for rendering initials or icons when avatar image is missing/broken.
|
|
101
|
+
*/
|
|
102
|
+
export const AvatarFallback: Component<AvatarFallbackProps> = (props) => {
|
|
103
|
+
const [local, rest] = splitProps(props, ["class"]);
|
|
104
|
+
|
|
105
|
+
return (
|
|
106
|
+
<div
|
|
107
|
+
class={cn(
|
|
108
|
+
"flex h-full w-full items-center justify-center bg-muted text-sm font-medium text-muted-foreground select-none",
|
|
109
|
+
local.class
|
|
110
|
+
)}
|
|
111
|
+
{...rest}
|
|
112
|
+
/>
|
|
113
|
+
);
|
|
114
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { splitProps, type Component, type JSX } from "solid-js";
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
|
+
import { cn } from "@/lib/cn";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Class variance authority configuration for badge styling variants.
|
|
7
|
+
*/
|
|
8
|
+
export const badgeVariants = cva(
|
|
9
|
+
"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
10
|
+
{
|
|
11
|
+
variants: {
|
|
12
|
+
variant: {
|
|
13
|
+
default:
|
|
14
|
+
"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",
|
|
15
|
+
secondary:
|
|
16
|
+
"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
17
|
+
destructive:
|
|
18
|
+
"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
|
|
19
|
+
outline:
|
|
20
|
+
"text-foreground border-border",
|
|
21
|
+
success:
|
|
22
|
+
"border-transparent bg-green-600 text-zinc-50 shadow-sm hover:bg-green-600/90 dark:bg-green-900 dark:text-zinc-50 dark:hover:bg-green-900/90",
|
|
23
|
+
warning:
|
|
24
|
+
"border-transparent bg-yellow-600 text-zinc-50 shadow-sm hover:bg-yellow-600/90 dark:bg-yellow-900 dark:text-zinc-50 dark:hover:bg-yellow-900/90",
|
|
25
|
+
info:
|
|
26
|
+
"border-transparent bg-blue-600 text-zinc-50 shadow-sm hover:bg-blue-600/90 dark:bg-blue-900 dark:text-zinc-50 dark:hover:bg-blue-900/90",
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
defaultVariants: {
|
|
30
|
+
variant: "default",
|
|
31
|
+
},
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Props interface for the Badge component extending standard HTML div attributes.
|
|
37
|
+
*/
|
|
38
|
+
export interface BadgeProps
|
|
39
|
+
extends JSX.HTMLAttributes<HTMLDivElement>,
|
|
40
|
+
VariantProps<typeof badgeVariants> {
|
|
41
|
+
class?: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Nikala UI Badge component built for SolidJS with Tailwind CSS v4 styling.
|
|
46
|
+
*/
|
|
47
|
+
export const Badge: Component<BadgeProps> = (props) => {
|
|
48
|
+
// Use splitProps to preserve SolidJS reactivity
|
|
49
|
+
const [local, rest] = splitProps(props, ["variant", "class", "children"]);
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<div class={cn(badgeVariants({ variant: local.variant }), local.class)} {...rest}>
|
|
53
|
+
{local.children}
|
|
54
|
+
</div>
|
|
55
|
+
);
|
|
56
|
+
};
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
// src/components/ui/banner.tsx
|
|
2
|
+
import {
|
|
3
|
+
createSignal,
|
|
4
|
+
onMount,
|
|
5
|
+
onCleanup,
|
|
6
|
+
Show,
|
|
7
|
+
splitProps,
|
|
8
|
+
type Component,
|
|
9
|
+
type JSX,
|
|
10
|
+
} from "solid-js";
|
|
11
|
+
import { Dynamic } from "solid-js/web";
|
|
12
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
13
|
+
import { Info, AlertTriangle, CheckCircle, AlertCircle, X } from "lucide-solid";
|
|
14
|
+
import { cn } from "@/lib/cn";
|
|
15
|
+
|
|
16
|
+
export const bannerVariants = cva(
|
|
17
|
+
"relative flex w-full items-center justify-between gap-3 px-4 py-2.5 text-sm transition-all duration-300 ease-in-out",
|
|
18
|
+
{
|
|
19
|
+
variants: {
|
|
20
|
+
variant: {
|
|
21
|
+
default:
|
|
22
|
+
"bg-zinc-900 text-zinc-50 dark:bg-zinc-100 dark:text-zinc-900",
|
|
23
|
+
warning:
|
|
24
|
+
"bg-amber-500/15 text-amber-900 border-b border-amber-500/20 dark:text-amber-200",
|
|
25
|
+
info:
|
|
26
|
+
"bg-sky-500/15 text-sky-900 border-b border-sky-500/20 dark:text-sky-200",
|
|
27
|
+
success:
|
|
28
|
+
"bg-emerald-500/15 text-emerald-900 border-b border-emerald-500/20 dark:text-emerald-200",
|
|
29
|
+
destructive:
|
|
30
|
+
"bg-rose-500/15 text-rose-900 border-b border-rose-500/20 dark:text-rose-200",
|
|
31
|
+
},
|
|
32
|
+
sticky: {
|
|
33
|
+
true: "sticky top-0 z-50 backdrop-blur-sm",
|
|
34
|
+
false: "relative",
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
defaultVariants: {
|
|
38
|
+
variant: "default",
|
|
39
|
+
sticky: false,
|
|
40
|
+
},
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
export interface BannerProps
|
|
45
|
+
extends JSX.HTMLAttributes<HTMLDivElement>,
|
|
46
|
+
VariantProps<typeof bannerVariants> {
|
|
47
|
+
dismissible?: boolean;
|
|
48
|
+
autoHideDelay?: number;
|
|
49
|
+
storageKey?: string;
|
|
50
|
+
showIcon?: boolean;
|
|
51
|
+
icon?: Component<{ class?: string }>;
|
|
52
|
+
link?: string;
|
|
53
|
+
linkText?: string;
|
|
54
|
+
linkTarget?: string;
|
|
55
|
+
onDismiss?: () => void;
|
|
56
|
+
class?: string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Nikala UI Banner Component.
|
|
61
|
+
*/
|
|
62
|
+
export const Banner: Component<BannerProps> = (props) => {
|
|
63
|
+
const [local, rest] = splitProps(props, [
|
|
64
|
+
"variant",
|
|
65
|
+
"sticky",
|
|
66
|
+
"dismissible",
|
|
67
|
+
"autoHideDelay",
|
|
68
|
+
"storageKey",
|
|
69
|
+
"showIcon",
|
|
70
|
+
"icon",
|
|
71
|
+
"link",
|
|
72
|
+
"linkText",
|
|
73
|
+
"linkTarget",
|
|
74
|
+
"onDismiss",
|
|
75
|
+
"class",
|
|
76
|
+
"children",
|
|
77
|
+
]);
|
|
78
|
+
|
|
79
|
+
const [visible, setVisible] = createSignal(true);
|
|
80
|
+
let timerId: ReturnType<typeof setTimeout> | undefined;
|
|
81
|
+
|
|
82
|
+
onMount(() => {
|
|
83
|
+
if (local.storageKey) {
|
|
84
|
+
try {
|
|
85
|
+
const isDismissed = localStorage.getItem(local.storageKey);
|
|
86
|
+
if (isDismissed === "true") {
|
|
87
|
+
setVisible(false);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
} catch (e) { }
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (local.autoHideDelay && local.autoHideDelay > 0) {
|
|
94
|
+
timerId = setTimeout(() => {
|
|
95
|
+
handleDismiss();
|
|
96
|
+
}, local.autoHideDelay);
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
onCleanup(() => {
|
|
101
|
+
if (timerId) clearTimeout(timerId);
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
const handleDismiss = () => {
|
|
105
|
+
setVisible(false);
|
|
106
|
+
|
|
107
|
+
if (local.storageKey) {
|
|
108
|
+
try {
|
|
109
|
+
localStorage.setItem(local.storageKey, "true");
|
|
110
|
+
} catch (e) {}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if (typeof local.onDismiss === "function") {
|
|
114
|
+
local.onDismiss();
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
/* Default icon selector based on banner variant */
|
|
119
|
+
const getDefaultIcon = () => {
|
|
120
|
+
switch (local.variant) {
|
|
121
|
+
case "warning":
|
|
122
|
+
return AlertTriangle;
|
|
123
|
+
case "success":
|
|
124
|
+
return CheckCircle;
|
|
125
|
+
case "destructive":
|
|
126
|
+
return AlertCircle;
|
|
127
|
+
default:
|
|
128
|
+
return Info;
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
const activeIcon = () => local.icon || getDefaultIcon();
|
|
133
|
+
const shouldShowIcon = () => local.showIcon !== false;
|
|
134
|
+
const shouldBeDismissible = () => local.dismissible !== false;
|
|
135
|
+
|
|
136
|
+
return (
|
|
137
|
+
<Show when={visible()}>
|
|
138
|
+
<div
|
|
139
|
+
class={cn(
|
|
140
|
+
bannerVariants({ variant: local.variant, sticky: local.sticky }),
|
|
141
|
+
local.class
|
|
142
|
+
)}
|
|
143
|
+
{...rest}
|
|
144
|
+
>
|
|
145
|
+
<div class="flex flex-1 items-center justify-center gap-2 text-center sm:text-left">
|
|
146
|
+
{/* Dynamic Lucide Icon */}
|
|
147
|
+
<Show when={shouldShowIcon()}>
|
|
148
|
+
<span class="inline-flex shrink-0 items-center justify-center">
|
|
149
|
+
<Dynamic component={activeIcon()} class="h-4 w-4 opacity-80" />
|
|
150
|
+
</span>
|
|
151
|
+
</Show>
|
|
152
|
+
|
|
153
|
+
{/* Text Content */}
|
|
154
|
+
<div class="flex-1 text-xs font-medium sm:text-sm">
|
|
155
|
+
{local.children}
|
|
156
|
+
</div>
|
|
157
|
+
|
|
158
|
+
{/* Action Link */}
|
|
159
|
+
<Show when={local.link}>
|
|
160
|
+
<div class="shrink-0">
|
|
161
|
+
<a
|
|
162
|
+
href={local.link}
|
|
163
|
+
target={local.linkTarget || "_blank"}
|
|
164
|
+
rel="noreferrer"
|
|
165
|
+
class="underline font-semibold hover:opacity-80 transition-opacity"
|
|
166
|
+
>
|
|
167
|
+
{local.linkText || "Learn more"}
|
|
168
|
+
</a>
|
|
169
|
+
</div>
|
|
170
|
+
</Show>
|
|
171
|
+
</div>
|
|
172
|
+
|
|
173
|
+
{/* Close Button */}
|
|
174
|
+
<Show when={shouldBeDismissible()}>
|
|
175
|
+
<button
|
|
176
|
+
type="button"
|
|
177
|
+
onClick={handleDismiss}
|
|
178
|
+
class="shrink-0 rounded-md p-1 opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring"
|
|
179
|
+
aria-label="Dismiss banner"
|
|
180
|
+
>
|
|
181
|
+
<X class="h-4 w-4" />
|
|
182
|
+
</button>
|
|
183
|
+
</Show>
|
|
184
|
+
</div>
|
|
185
|
+
</Show>
|
|
186
|
+
);
|
|
187
|
+
};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { splitProps, type Component, type JSX } from "solid-js";
|
|
2
|
+
import { cn } from "@/lib/cn";
|
|
3
|
+
|
|
4
|
+
export interface BreadcrumbProps extends JSX.HTMLAttributes<HTMLElement> {
|
|
5
|
+
class?: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Root navigation container for the Nikala UI Breadcrumb hierarchy.
|
|
10
|
+
*/
|
|
11
|
+
export const Breadcrumb: Component<BreadcrumbProps> = (props) => {
|
|
12
|
+
const [local, rest] = splitProps(props, ["class"]);
|
|
13
|
+
return <nav aria-label="breadcrumb" class={cn("relative w-full", local.class)} {...rest} />;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export interface BreadcrumbListProps extends JSX.HTMLAttributes<HTMLOListElement> {
|
|
17
|
+
class?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Ordered list container housing all breadcrumb path items.
|
|
22
|
+
*/
|
|
23
|
+
export const BreadcrumbList: Component<BreadcrumbListProps> = (props) => {
|
|
24
|
+
const [local, rest] = splitProps(props, ["class"]);
|
|
25
|
+
return (
|
|
26
|
+
<ol
|
|
27
|
+
class={cn(
|
|
28
|
+
"flex flex-wrap items-center gap-1.5 text-sm text-muted-foreground break-words sm:gap-2.5",
|
|
29
|
+
local.class
|
|
30
|
+
)}
|
|
31
|
+
{...rest}
|
|
32
|
+
/>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export interface BreadcrumbItemProps extends JSX.HTMLAttributes<HTMLLIElement> {
|
|
37
|
+
class?: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Individual list item element wrapper in the breadcrumb hierarchy.
|
|
42
|
+
*/
|
|
43
|
+
export const BreadcrumbItem: Component<BreadcrumbItemProps> = (props) => {
|
|
44
|
+
const [local, rest] = splitProps(props, ["class"]);
|
|
45
|
+
return <li class={cn("inline-flex items-center gap-1.5", local.class)} {...rest} />;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export interface BreadcrumbLinkProps extends JSX.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
49
|
+
class?: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Clickable breadcrumb trail link element.
|
|
54
|
+
*/
|
|
55
|
+
export const BreadcrumbLink: Component<BreadcrumbLinkProps> = (props) => {
|
|
56
|
+
const [local, rest] = splitProps(props, ["class"]);
|
|
57
|
+
return (
|
|
58
|
+
<a
|
|
59
|
+
class={cn(
|
|
60
|
+
"transition-colors hover:text-foreground underline-offset-4 hover:underline",
|
|
61
|
+
local.class
|
|
62
|
+
)}
|
|
63
|
+
{...rest}
|
|
64
|
+
/>
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export interface BreadcrumbPageProps extends JSX.HTMLAttributes<HTMLSpanElement> {
|
|
69
|
+
class?: string;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Non-clickable active page indicator in breadcrumb hierarchy.
|
|
74
|
+
*/
|
|
75
|
+
export const BreadcrumbPage: Component<BreadcrumbPageProps> = (props) => {
|
|
76
|
+
const [local, rest] = splitProps(props, ["class"]);
|
|
77
|
+
return (
|
|
78
|
+
<span
|
|
79
|
+
role="link"
|
|
80
|
+
aria-disabled="true"
|
|
81
|
+
aria-current="page"
|
|
82
|
+
class={cn("font-normal text-foreground", local.class)}
|
|
83
|
+
{...rest}
|
|
84
|
+
/>
|
|
85
|
+
);
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export interface BreadcrumbSeparatorProps extends JSX.HTMLAttributes<HTMLLIElement> {
|
|
89
|
+
class?: string;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Visual separator icon rendered between breadcrumb path links.
|
|
94
|
+
*/
|
|
95
|
+
export const BreadcrumbSeparator: Component<BreadcrumbSeparatorProps> = (props) => {
|
|
96
|
+
const [local, rest] = splitProps(props, ["class", "children"]);
|
|
97
|
+
return (
|
|
98
|
+
<li
|
|
99
|
+
role="presentation"
|
|
100
|
+
aria-hidden="true"
|
|
101
|
+
class={cn("[&>svg]:size-3.5 text-muted-foreground", local.class)}
|
|
102
|
+
{...rest}
|
|
103
|
+
>
|
|
104
|
+
{local.children || (
|
|
105
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
106
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M9 5l7 7-7 7" />
|
|
107
|
+
</svg>
|
|
108
|
+
)}
|
|
109
|
+
</li>
|
|
110
|
+
);
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
export interface BreadcrumbEllipsisProps extends JSX.HTMLAttributes<HTMLSpanElement> {
|
|
114
|
+
class?: string;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Ellipsis element representing truncated intermediate breadcrumb items.
|
|
119
|
+
*/
|
|
120
|
+
export const BreadcrumbEllipsis: Component<BreadcrumbEllipsisProps> = (props) => {
|
|
121
|
+
const [local, rest] = splitProps(props, ["class"]);
|
|
122
|
+
return (
|
|
123
|
+
<span
|
|
124
|
+
role="presentation"
|
|
125
|
+
aria-hidden="true"
|
|
126
|
+
class={cn("flex h-9 w-9 items-center justify-center text-muted-foreground", local.class)}
|
|
127
|
+
{...rest}
|
|
128
|
+
>
|
|
129
|
+
<svg class="h-4 w-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
130
|
+
<circle cx="12" cy="12" r="1" />
|
|
131
|
+
<circle cx="19" cy="12" r="1" />
|
|
132
|
+
<circle cx="5" cy="12" r="1" />
|
|
133
|
+
</svg>
|
|
134
|
+
</span>
|
|
135
|
+
);
|
|
136
|
+
};
|