@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,228 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createSignal,
|
|
3
|
+
createEffect,
|
|
4
|
+
onCleanup,
|
|
5
|
+
splitProps,
|
|
6
|
+
type Component,
|
|
7
|
+
type JSX,
|
|
8
|
+
type Accessor,
|
|
9
|
+
} from "solid-js";
|
|
10
|
+
import { createScrollPosition } from "@/hooks/create-scroll-position";
|
|
11
|
+
import { createElementSize } from "@/hooks/create-resize-observer";
|
|
12
|
+
import { cn } from "@/lib/cn";
|
|
13
|
+
|
|
14
|
+
export interface ScrollAreaProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
15
|
+
orientation?: "vertical" | "horizontal" | "both";
|
|
16
|
+
scrollHideDelay?: number;
|
|
17
|
+
class?: string;
|
|
18
|
+
children?: JSX.Element;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const ScrollArea: Component<ScrollAreaProps> = (props) => {
|
|
22
|
+
const [local, rest] = splitProps(props, [
|
|
23
|
+
"orientation",
|
|
24
|
+
"scrollHideDelay",
|
|
25
|
+
"class",
|
|
26
|
+
"children",
|
|
27
|
+
]);
|
|
28
|
+
|
|
29
|
+
const orientation = () => local.orientation || "vertical";
|
|
30
|
+
let viewportRef: HTMLDivElement | undefined;
|
|
31
|
+
let verticalTrackRef: HTMLDivElement | undefined;
|
|
32
|
+
let horizontalTrackRef: HTMLDivElement | undefined;
|
|
33
|
+
|
|
34
|
+
const scrollPos = createScrollPosition({
|
|
35
|
+
target: () => viewportRef,
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const viewportSize = createElementSize(() => viewportRef);
|
|
39
|
+
|
|
40
|
+
const [thumbHeight, setThumbHeight] = createSignal(0);
|
|
41
|
+
const [thumbTop, setThumbTop] = createSignal(0);
|
|
42
|
+
const [thumbWidth, setThumbWidth] = createSignal(0);
|
|
43
|
+
const [thumbLeft, setThumbLeft] = createSignal(0);
|
|
44
|
+
const [isDragging, setIsDragging] = createSignal(false);
|
|
45
|
+
|
|
46
|
+
const updateThumbMetrics = () => {
|
|
47
|
+
if (!viewportRef) return;
|
|
48
|
+
|
|
49
|
+
const scrollHeight = viewportRef.scrollHeight;
|
|
50
|
+
const clientHeight = viewportRef.clientHeight;
|
|
51
|
+
const scrollWidth = viewportRef.scrollWidth;
|
|
52
|
+
const clientWidth = viewportRef.clientWidth;
|
|
53
|
+
|
|
54
|
+
// Track available lengths (considering 4px track padding)
|
|
55
|
+
const trackHeight = verticalTrackRef ? verticalTrackRef.clientHeight - 4 : clientHeight - 4;
|
|
56
|
+
const trackWidth = horizontalTrackRef ? horizontalTrackRef.clientWidth - 4 : clientWidth - 4;
|
|
57
|
+
|
|
58
|
+
// Vertical thumb metrics
|
|
59
|
+
if (scrollHeight > clientHeight && clientHeight > 0) {
|
|
60
|
+
const vRatio = clientHeight / scrollHeight;
|
|
61
|
+
const calculatedHeight = Math.max(vRatio * trackHeight, 20);
|
|
62
|
+
const maxTop = trackHeight - calculatedHeight;
|
|
63
|
+
const topPct = scrollPos.y() / (scrollHeight - clientHeight);
|
|
64
|
+
setThumbHeight(calculatedHeight);
|
|
65
|
+
setThumbTop(topPct * maxTop);
|
|
66
|
+
} else {
|
|
67
|
+
setThumbHeight(0);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Horizontal thumb metrics
|
|
71
|
+
if (scrollWidth > clientWidth && clientWidth > 0) {
|
|
72
|
+
const hRatio = clientWidth / scrollWidth;
|
|
73
|
+
const calculatedWidth = Math.max(hRatio * trackWidth, 20);
|
|
74
|
+
const maxLeft = trackWidth - calculatedWidth;
|
|
75
|
+
const leftPct = scrollPos.x() / (scrollWidth - clientWidth);
|
|
76
|
+
setThumbWidth(calculatedWidth);
|
|
77
|
+
setThumbLeft(leftPct * maxLeft);
|
|
78
|
+
} else {
|
|
79
|
+
setThumbWidth(0);
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
createEffect(() => {
|
|
84
|
+
viewportSize.width();
|
|
85
|
+
viewportSize.height();
|
|
86
|
+
scrollPos.x();
|
|
87
|
+
scrollPos.y();
|
|
88
|
+
updateThumbMetrics();
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
// Enable mouse drag on Vertical Thumb
|
|
92
|
+
const handleVerticalThumbPointerDown = (e: PointerEvent) => {
|
|
93
|
+
if (!viewportRef || !verticalTrackRef) return;
|
|
94
|
+
e.preventDefault();
|
|
95
|
+
e.stopPropagation();
|
|
96
|
+
|
|
97
|
+
setIsDragging(true);
|
|
98
|
+
const startY = e.clientY;
|
|
99
|
+
const startScrollTop = viewportRef.scrollTop;
|
|
100
|
+
const scrollHeight = viewportRef.scrollHeight;
|
|
101
|
+
const clientHeight = viewportRef.clientHeight;
|
|
102
|
+
const trackHeight = verticalTrackRef.clientHeight - 4;
|
|
103
|
+
|
|
104
|
+
const maxScrollTop = scrollHeight - clientHeight;
|
|
105
|
+
const maxThumbTop = trackHeight - thumbHeight();
|
|
106
|
+
const ratio = maxThumbTop > 0 ? maxScrollTop / maxThumbTop : 0;
|
|
107
|
+
|
|
108
|
+
const onPointerMove = (moveEvent: PointerEvent) => {
|
|
109
|
+
const deltaY = moveEvent.clientY - startY;
|
|
110
|
+
viewportRef!.scrollTop = Math.max(0, Math.min(maxScrollTop, startScrollTop + deltaY * ratio));
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
const onPointerUp = () => {
|
|
114
|
+
setIsDragging(false);
|
|
115
|
+
window.removeEventListener("pointermove", onPointerMove);
|
|
116
|
+
window.removeEventListener("pointerup", onPointerUp);
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
window.addEventListener("pointermove", onPointerMove);
|
|
120
|
+
window.addEventListener("pointerup", onPointerUp);
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
// Enable mouse drag on Horizontal Thumb
|
|
124
|
+
const handleHorizontalThumbPointerDown = (e: PointerEvent) => {
|
|
125
|
+
if (!viewportRef || !horizontalTrackRef) return;
|
|
126
|
+
e.preventDefault();
|
|
127
|
+
e.stopPropagation();
|
|
128
|
+
|
|
129
|
+
setIsDragging(true);
|
|
130
|
+
const startX = e.clientX;
|
|
131
|
+
const startScrollLeft = viewportRef.scrollLeft;
|
|
132
|
+
const scrollWidth = viewportRef.scrollWidth;
|
|
133
|
+
const clientWidth = viewportRef.clientWidth;
|
|
134
|
+
const trackWidth = horizontalTrackRef.clientWidth - 4;
|
|
135
|
+
|
|
136
|
+
const maxScrollLeft = scrollWidth - clientWidth;
|
|
137
|
+
const maxThumbLeft = trackWidth - thumbWidth();
|
|
138
|
+
const ratio = maxThumbLeft > 0 ? maxScrollLeft / maxThumbLeft : 0;
|
|
139
|
+
|
|
140
|
+
const onPointerMove = (moveEvent: PointerEvent) => {
|
|
141
|
+
const deltaX = moveEvent.clientX - startX;
|
|
142
|
+
viewportRef!.scrollLeft = Math.max(0, Math.min(maxScrollLeft, startScrollLeft + deltaX * ratio));
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
const onPointerUp = () => {
|
|
146
|
+
setIsDragging(false);
|
|
147
|
+
window.removeEventListener("pointermove", onPointerMove);
|
|
148
|
+
window.removeEventListener("pointerup", onPointerUp);
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
window.addEventListener("pointermove", onPointerMove);
|
|
152
|
+
window.addEventListener("pointerup", onPointerUp);
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
// Convert vertical mouse wheel into horizontal scroll proportionally
|
|
156
|
+
const handleWheel = (e: WheelEvent) => {
|
|
157
|
+
if (orientation() === "horizontal" && viewportRef) {
|
|
158
|
+
if (Math.abs(e.deltaY) > Math.abs(e.deltaX)) {
|
|
159
|
+
e.preventDefault();
|
|
160
|
+
viewportRef.scrollLeft += e.deltaY;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
return (
|
|
166
|
+
<div
|
|
167
|
+
class={cn("relative overflow-hidden group/scroll-area", local.class)}
|
|
168
|
+
onWheel={handleWheel}
|
|
169
|
+
{...rest}
|
|
170
|
+
>
|
|
171
|
+
{/* Scroll Viewport Container */}
|
|
172
|
+
<div
|
|
173
|
+
ref={viewportRef}
|
|
174
|
+
class="h-full w-full max-h-[inherit] overflow-auto scrollbar-none rounded-[inherit]"
|
|
175
|
+
style={{
|
|
176
|
+
"scrollbar-width": "none",
|
|
177
|
+
"-ms-overflow-style": "none",
|
|
178
|
+
}}
|
|
179
|
+
>
|
|
180
|
+
{local.children}
|
|
181
|
+
</div>
|
|
182
|
+
|
|
183
|
+
{/* Vertical Scrollbar Track & Thumb */}
|
|
184
|
+
{(orientation() === "vertical" || orientation() === "both") && thumbHeight() > 0 && (
|
|
185
|
+
<div
|
|
186
|
+
ref={verticalTrackRef}
|
|
187
|
+
class={cn(
|
|
188
|
+
"absolute right-0 top-0 bottom-0 w-2.5 p-0.5 select-none transition-opacity duration-300 pointer-events-none",
|
|
189
|
+
scrollPos.isScrolling() || isDragging()
|
|
190
|
+
? "opacity-100"
|
|
191
|
+
: "opacity-0 group-hover/scroll-area:opacity-100"
|
|
192
|
+
)}
|
|
193
|
+
>
|
|
194
|
+
<div
|
|
195
|
+
class="w-1.5 rounded-lg bg-border hover:bg-muted-foreground/50 transition-colors cursor-pointer pointer-events-auto"
|
|
196
|
+
style={{
|
|
197
|
+
height: `${thumbHeight()}px`,
|
|
198
|
+
transform: `translateY(${thumbTop()}px)`,
|
|
199
|
+
}}
|
|
200
|
+
onPointerDown={handleVerticalThumbPointerDown}
|
|
201
|
+
/>
|
|
202
|
+
</div>
|
|
203
|
+
)}
|
|
204
|
+
|
|
205
|
+
{/* Horizontal Scrollbar Track & Thumb */}
|
|
206
|
+
{(orientation() === "horizontal" || orientation() === "both") && thumbWidth() > 0 && (
|
|
207
|
+
<div
|
|
208
|
+
ref={horizontalTrackRef}
|
|
209
|
+
class={cn(
|
|
210
|
+
"absolute bottom-0 left-0 right-0 h-2.5 p-0.5 select-none transition-opacity duration-300 pointer-events-none",
|
|
211
|
+
scrollPos.isScrolling() || isDragging()
|
|
212
|
+
? "opacity-100"
|
|
213
|
+
: "opacity-0 group-hover/scroll-area:opacity-100"
|
|
214
|
+
)}
|
|
215
|
+
>
|
|
216
|
+
<div
|
|
217
|
+
class="h-1.5 rounded-lg bg-border hover:bg-muted-foreground/50 transition-colors cursor-pointer pointer-events-auto"
|
|
218
|
+
style={{
|
|
219
|
+
width: `${thumbWidth()}px`,
|
|
220
|
+
transform: `translateX(${thumbLeft()}px)`,
|
|
221
|
+
}}
|
|
222
|
+
onPointerDown={handleHorizontalThumbPointerDown}
|
|
223
|
+
/>
|
|
224
|
+
</div>
|
|
225
|
+
)}
|
|
226
|
+
</div>
|
|
227
|
+
);
|
|
228
|
+
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import {
|
|
2
|
+
splitProps,
|
|
3
|
+
Show,
|
|
4
|
+
type JSX,
|
|
5
|
+
type Component,
|
|
6
|
+
} from "solid-js";
|
|
7
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
8
|
+
import { Badge } from "@/components/ui/badge";
|
|
9
|
+
import { cn } from "@/lib/cn";
|
|
10
|
+
|
|
11
|
+
const headingVariants = cva("tracking-tight", {
|
|
12
|
+
variants: {
|
|
13
|
+
variant: {
|
|
14
|
+
page: "text-3xl sm:text-4xl font-bold",
|
|
15
|
+
section: "text-2xl font-semibold border-b border-border/50 pb-2",
|
|
16
|
+
compact: "text-base font-semibold",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
defaultVariants: {
|
|
20
|
+
variant: "section",
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const descriptionVariants = cva("text-muted-foreground leading-relaxed", {
|
|
25
|
+
variants: {
|
|
26
|
+
variant: {
|
|
27
|
+
page: "text-lg",
|
|
28
|
+
section: "text-sm",
|
|
29
|
+
compact: "text-xs",
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
defaultVariants: {
|
|
33
|
+
variant: "section",
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export interface SectionHeadingProps
|
|
38
|
+
extends Omit<JSX.HTMLAttributes<HTMLDivElement>, "title">,
|
|
39
|
+
VariantProps<typeof headingVariants> {
|
|
40
|
+
/** Heading text content */
|
|
41
|
+
title: string;
|
|
42
|
+
/** Optional badge label displayed next to the title */
|
|
43
|
+
badge?: string;
|
|
44
|
+
/** Badge style variant */
|
|
45
|
+
badgeVariant?: "default" | "secondary" | "outline" | "destructive";
|
|
46
|
+
/** Optional subtitle or explanatory note below the title */
|
|
47
|
+
description?: string;
|
|
48
|
+
class?: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Reusable heading block with title, optional badge, and description.
|
|
53
|
+
* Supports "page" (h1), "section" (h2 with divider), and "compact" (h3) variants.
|
|
54
|
+
*/
|
|
55
|
+
export const SectionHeading: Component<SectionHeadingProps> = (props) => {
|
|
56
|
+
const [local, rest] = splitProps(props, [
|
|
57
|
+
"title",
|
|
58
|
+
"badge",
|
|
59
|
+
"badgeVariant",
|
|
60
|
+
"description",
|
|
61
|
+
"variant",
|
|
62
|
+
"class",
|
|
63
|
+
]);
|
|
64
|
+
|
|
65
|
+
const v = () => local.variant || "section";
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<div class={cn("space-y-2", local.class)} {...rest}>
|
|
69
|
+
<div class={cn("flex items-center gap-2", v() === "section" && "w-full")}>
|
|
70
|
+
<Show when={v() === "page"}>
|
|
71
|
+
<h1 class={headingVariants({ variant: v() })}>
|
|
72
|
+
{local.title}
|
|
73
|
+
</h1>
|
|
74
|
+
</Show>
|
|
75
|
+
|
|
76
|
+
<Show when={v() === "section"}>
|
|
77
|
+
<h2 class={cn("w-full", headingVariants({ variant: v() }))}>
|
|
78
|
+
{local.title}
|
|
79
|
+
</h2>
|
|
80
|
+
</Show>
|
|
81
|
+
|
|
82
|
+
<Show when={v() === "compact"}>
|
|
83
|
+
<h3 class={headingVariants({ variant: v() })}>
|
|
84
|
+
{local.title}
|
|
85
|
+
</h3>
|
|
86
|
+
</Show>
|
|
87
|
+
|
|
88
|
+
<Show when={local.badge}>
|
|
89
|
+
<Badge
|
|
90
|
+
variant={local.badgeVariant || "outline"}
|
|
91
|
+
class={cn(
|
|
92
|
+
"select-none",
|
|
93
|
+
v() === "page" ? "text-xs" : "font-mono text-[10px] py-0 px-1.5 font-medium"
|
|
94
|
+
)}
|
|
95
|
+
>
|
|
96
|
+
{local.badge}
|
|
97
|
+
</Badge>
|
|
98
|
+
</Show>
|
|
99
|
+
</div>
|
|
100
|
+
|
|
101
|
+
<Show when={local.description}>
|
|
102
|
+
<p class={descriptionVariants({ variant: v() })}>
|
|
103
|
+
{local.description}
|
|
104
|
+
</p>
|
|
105
|
+
</Show>
|
|
106
|
+
</div>
|
|
107
|
+
);
|
|
108
|
+
};
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { splitProps, type JSX, type ValidComponent } from "solid-js";
|
|
2
|
+
import * as SelectPrimitive from "@kobalte/core/select";
|
|
3
|
+
import type { PolymorphicProps } from "@kobalte/core/polymorphic";
|
|
4
|
+
import { createClickOutside } from "@/hooks/create-click-outside";
|
|
5
|
+
import { ScrollArea } from "@/components/ui/scroll-area";
|
|
6
|
+
import { cn } from "@/lib/cn";
|
|
7
|
+
|
|
8
|
+
export type SelectRootProps<Option = any, OptGroup = any, T extends ValidComponent = "div"> =
|
|
9
|
+
SelectPrimitive.SelectRootProps<Option, OptGroup, T> & {
|
|
10
|
+
class?: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Root Select component built on top of Kobalte headless primitives.
|
|
15
|
+
*/
|
|
16
|
+
export const Select = <Option = any, OptGroup = any, T extends ValidComponent = "div">(
|
|
17
|
+
props: PolymorphicProps<T, SelectRootProps<Option, OptGroup, T>>
|
|
18
|
+
) => {
|
|
19
|
+
const [local, rest] = splitProps(props as SelectRootProps, ["class"]);
|
|
20
|
+
|
|
21
|
+
return <SelectPrimitive.Root class={cn("relative w-full", local.class)} {...(rest as any)} />;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type SelectTriggerProps<T extends ValidComponent = "button"> =
|
|
25
|
+
SelectPrimitive.SelectTriggerProps<T> & {
|
|
26
|
+
class?: string;
|
|
27
|
+
children?: JSX.Element;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Trigger button opening the Select options list.
|
|
32
|
+
*/
|
|
33
|
+
export const SelectTrigger = <T extends ValidComponent = "button">(
|
|
34
|
+
props: PolymorphicProps<T, SelectTriggerProps<T>>
|
|
35
|
+
) => {
|
|
36
|
+
const [local, rest] = splitProps(props as SelectTriggerProps, ["class", "children"]);
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<SelectPrimitive.Trigger
|
|
40
|
+
class={cn(
|
|
41
|
+
"flex h-9 w-full items-center justify-between rounded-md border border-input bg-muted px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary disabled:cursor-not-allowed disabled:opacity-50 cursor-pointer text-foreground",
|
|
42
|
+
local.class
|
|
43
|
+
)}
|
|
44
|
+
{...rest}
|
|
45
|
+
>
|
|
46
|
+
{local.children}
|
|
47
|
+
<SelectPrimitive.Icon
|
|
48
|
+
as="svg"
|
|
49
|
+
class="h-4 w-4 opacity-50 transition-transform"
|
|
50
|
+
viewBox="0 0 24 24"
|
|
51
|
+
fill="none"
|
|
52
|
+
stroke="currentColor"
|
|
53
|
+
stroke-width="2"
|
|
54
|
+
>
|
|
55
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M19 9l-7 7-7-7" />
|
|
56
|
+
</SelectPrimitive.Icon>
|
|
57
|
+
</SelectPrimitive.Trigger>
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export type SelectValueProps<Option, T extends ValidComponent = "span"> =
|
|
62
|
+
SelectPrimitive.SelectValueProps<Option, T> & {
|
|
63
|
+
class?: string;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Renders the currently selected option text or placeholder.
|
|
68
|
+
*/
|
|
69
|
+
export const SelectValue = <Option = any, T extends ValidComponent = "span">(
|
|
70
|
+
props: PolymorphicProps<T, SelectValueProps<Option, T>>
|
|
71
|
+
) => {
|
|
72
|
+
const [local, rest] = splitProps(props as SelectValueProps<Option>, ["class"]);
|
|
73
|
+
|
|
74
|
+
return (
|
|
75
|
+
<SelectPrimitive.Value
|
|
76
|
+
class={cn("block truncate", local.class)}
|
|
77
|
+
{...(rest as any)}
|
|
78
|
+
/>
|
|
79
|
+
);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export type SelectContentProps<T extends ValidComponent = "div"> =
|
|
83
|
+
SelectPrimitive.SelectContentProps<T> & {
|
|
84
|
+
class?: string;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Portaled overlay container rendering the listbox options.
|
|
89
|
+
*/
|
|
90
|
+
export const SelectContent = <T extends ValidComponent = "div">(
|
|
91
|
+
props: PolymorphicProps<T, SelectContentProps<T>>
|
|
92
|
+
) => {
|
|
93
|
+
const [local, rest] = splitProps(props as SelectContentProps, ["class"]);
|
|
94
|
+
let contentRef: HTMLElement | undefined;
|
|
95
|
+
|
|
96
|
+
createClickOutside({
|
|
97
|
+
target: () => contentRef,
|
|
98
|
+
onInteractOutside: (e) => {
|
|
99
|
+
if (typeof (props as any).onInteractOutside === "function") {
|
|
100
|
+
(props as any).onInteractOutside(e);
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
return (
|
|
106
|
+
<SelectPrimitive.Portal>
|
|
107
|
+
<SelectPrimitive.Content
|
|
108
|
+
ref={(el) => {
|
|
109
|
+
contentRef = el;
|
|
110
|
+
if (typeof (props as any).ref === "function") (props as any).ref(el);
|
|
111
|
+
}}
|
|
112
|
+
class={cn(
|
|
113
|
+
"relative z-50 min-w-8rem overflow-hidden rounded-md border border-border bg-popover text-popover-foreground shadow-md animate-in fade-in-80 max-h-60",
|
|
114
|
+
local.class
|
|
115
|
+
)}
|
|
116
|
+
{...rest}
|
|
117
|
+
>
|
|
118
|
+
<ScrollArea class="max-h-60 w-full">
|
|
119
|
+
<SelectPrimitive.Listbox class="p-1 outline-none" />
|
|
120
|
+
</ScrollArea>
|
|
121
|
+
</SelectPrimitive.Content>
|
|
122
|
+
</SelectPrimitive.Portal>
|
|
123
|
+
);
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
export type SelectItemProps<T extends ValidComponent = "li"> =
|
|
127
|
+
SelectPrimitive.SelectItemProps<T> & {
|
|
128
|
+
class?: string;
|
|
129
|
+
children?: JSX.Element;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Individual option item choice inside SelectContent.
|
|
134
|
+
*/
|
|
135
|
+
export const SelectItem = <T extends ValidComponent = "li">(
|
|
136
|
+
props: PolymorphicProps<T, SelectItemProps<T>>
|
|
137
|
+
) => {
|
|
138
|
+
const [local, rest] = splitProps(props as SelectItemProps, ["class", "children"]);
|
|
139
|
+
|
|
140
|
+
return (
|
|
141
|
+
<SelectPrimitive.Item
|
|
142
|
+
class={cn(
|
|
143
|
+
"relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-disabled:pointer-events-none data-highlighted:bg-accent data-highlighted:text-accent-foreground",
|
|
144
|
+
local.class
|
|
145
|
+
)}
|
|
146
|
+
{...rest}
|
|
147
|
+
>
|
|
148
|
+
<SelectPrimitive.ItemIndicator class="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
149
|
+
<svg class="h-4 w-4 fill-none stroke-current stroke-2" viewBox="0 0 24 24">
|
|
150
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7" />
|
|
151
|
+
</svg>
|
|
152
|
+
</SelectPrimitive.ItemIndicator>
|
|
153
|
+
<SelectPrimitive.ItemLabel>{local.children}</SelectPrimitive.ItemLabel>
|
|
154
|
+
</SelectPrimitive.Item>
|
|
155
|
+
);
|
|
156
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { splitProps, type Component, type JSX } from "solid-js";
|
|
2
|
+
import { cn } from "@/lib/cn";
|
|
3
|
+
|
|
4
|
+
export interface SeparatorProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
/** Orientation of the separator line */
|
|
6
|
+
orientation?: "horizontal" | "vertical";
|
|
7
|
+
/** Whether the element is purely visual or semantic for screen readers */
|
|
8
|
+
decorative?: boolean;
|
|
9
|
+
class?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Nikala UI Separator component used to divide content visually or semantically.
|
|
14
|
+
*/
|
|
15
|
+
export const Separator: Component<SeparatorProps> = (props) => {
|
|
16
|
+
const [local, rest] = splitProps(props, [
|
|
17
|
+
"orientation",
|
|
18
|
+
"decorative",
|
|
19
|
+
"class",
|
|
20
|
+
]);
|
|
21
|
+
|
|
22
|
+
const orientation = () => local.orientation || "horizontal";
|
|
23
|
+
const isDecorative = () => local.decorative ?? true;
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<div
|
|
27
|
+
role={isDecorative() ? "none" : "separator"}
|
|
28
|
+
aria-orientation={isDecorative() ? undefined : orientation()}
|
|
29
|
+
class={cn(
|
|
30
|
+
"shrink-0 bg-border",
|
|
31
|
+
orientation() === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
|
|
32
|
+
local.class
|
|
33
|
+
)}
|
|
34
|
+
{...rest}
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
37
|
+
};
|