@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,82 @@
|
|
|
1
|
+
import { createEffect, createSignal, onCleanup, type Accessor } from "solid-js";
|
|
2
|
+
|
|
3
|
+
export interface CreateIntersectionObserverOptions extends IntersectionObserverInit {
|
|
4
|
+
/** Whether the observer is active. Defaults to true. */
|
|
5
|
+
enabled?: boolean | Accessor<boolean>;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* SolidJS reactive primitive for observing element visibility and intersection with viewport or root element.
|
|
10
|
+
*
|
|
11
|
+
* @param target Target element or accessor returning HTML element.
|
|
12
|
+
* @param callback Observer callback invoked on intersection state change.
|
|
13
|
+
* @param options IntersectionObserver options (root, rootMargin, threshold, enabled).
|
|
14
|
+
*/
|
|
15
|
+
export function createIntersectionObserver(
|
|
16
|
+
target: HTMLElement | Accessor<HTMLElement | undefined>,
|
|
17
|
+
callback: IntersectionObserverCallback,
|
|
18
|
+
options: CreateIntersectionObserverOptions = {}
|
|
19
|
+
): void {
|
|
20
|
+
const getTarget = (): HTMLElement | undefined => {
|
|
21
|
+
if (typeof target === "function") {
|
|
22
|
+
return (target as Accessor<HTMLElement | undefined>)();
|
|
23
|
+
}
|
|
24
|
+
return target;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const isEnabled = (): boolean => {
|
|
28
|
+
if (typeof options.enabled === "function") {
|
|
29
|
+
return options.enabled();
|
|
30
|
+
}
|
|
31
|
+
return options.enabled ?? true;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
createEffect(() => {
|
|
35
|
+
if (typeof window === "undefined" || !window.IntersectionObserver) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (!isEnabled()) return;
|
|
40
|
+
|
|
41
|
+
const el = getTarget();
|
|
42
|
+
if (!el) return;
|
|
43
|
+
|
|
44
|
+
const observer = new IntersectionObserver(callback, {
|
|
45
|
+
root: options.root,
|
|
46
|
+
rootMargin: options.rootMargin,
|
|
47
|
+
threshold: options.threshold,
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
observer.observe(el);
|
|
51
|
+
|
|
52
|
+
onCleanup(() => {
|
|
53
|
+
observer.disconnect();
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* SolidJS reactive primitive returning a boolean accessor indicating if element is currently visible in viewport.
|
|
60
|
+
*
|
|
61
|
+
* @param target Target element or accessor returning HTML element.
|
|
62
|
+
* @param options IntersectionObserver options.
|
|
63
|
+
*/
|
|
64
|
+
export function createInView(
|
|
65
|
+
target: HTMLElement | Accessor<HTMLElement | undefined>,
|
|
66
|
+
options: CreateIntersectionObserverOptions = {}
|
|
67
|
+
): Accessor<boolean> {
|
|
68
|
+
const [isInView, setIsInView] = createSignal(false);
|
|
69
|
+
|
|
70
|
+
createIntersectionObserver(
|
|
71
|
+
target,
|
|
72
|
+
(entries) => {
|
|
73
|
+
const entry = entries[0];
|
|
74
|
+
if (entry) {
|
|
75
|
+
setIsInView(entry.isIntersecting);
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
options
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
return isInView;
|
|
82
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { onMount, onCleanup, type Accessor } from "solid-js";
|
|
2
|
+
|
|
3
|
+
export interface KeybindingDefinition {
|
|
4
|
+
/** Key combination string, e.g. "meta+k", "ctrl+k", "Escape", "Shift+Enter" */
|
|
5
|
+
key: string | string[];
|
|
6
|
+
/** Callback handler invoked when the key combination is triggered */
|
|
7
|
+
handler: (event: KeyboardEvent) => void;
|
|
8
|
+
/** Whether to prevent default browser action. Defaults to false. */
|
|
9
|
+
preventDefault?: boolean;
|
|
10
|
+
/** Whether to stop event propagation. Defaults to false. */
|
|
11
|
+
stopPropagation?: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface CreateKeybindingsOptions {
|
|
15
|
+
/** Event target to attach listener to. Defaults to window. */
|
|
16
|
+
target?: HTMLElement | Window | Accessor<HTMLElement | Window | undefined>;
|
|
17
|
+
/** Event type: "keydown" (default) or "keyup" */
|
|
18
|
+
eventType?: "keydown" | "keyup";
|
|
19
|
+
/** Whether keybinding listeners are active. Defaults to true. */
|
|
20
|
+
enabled?: boolean | Accessor<boolean>;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Normalizes key string into standardized combination signature (e.g. "ctrl+meta+k").
|
|
25
|
+
*/
|
|
26
|
+
function normalizeKeyCombination(keyStr: string): string {
|
|
27
|
+
const parts = keyStr.toLowerCase().split("+").map((p) => p.trim());
|
|
28
|
+
const modifiers = new Set<string>();
|
|
29
|
+
let mainKey = "";
|
|
30
|
+
|
|
31
|
+
for (const part of parts) {
|
|
32
|
+
if (part === "meta" || part === "cmd" || part === "command" || part === "⌘") {
|
|
33
|
+
modifiers.add("meta");
|
|
34
|
+
} else if (part === "ctrl" || part === "control") {
|
|
35
|
+
modifiers.add("ctrl");
|
|
36
|
+
} else if (part === "alt" || part === "option" || part === "⌥") {
|
|
37
|
+
modifiers.add("alt");
|
|
38
|
+
} else if (part === "shift" || part === "⇧") {
|
|
39
|
+
modifiers.add("shift");
|
|
40
|
+
} else {
|
|
41
|
+
mainKey = part;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const sortedMods = Array.from(modifiers).sort();
|
|
46
|
+
return [...sortedMods, mainKey].join("+");
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Checks if a KeyboardEvent matches a normalized key combination.
|
|
51
|
+
*/
|
|
52
|
+
function isEventMatch(event: KeyboardEvent, targetCombination: string): boolean {
|
|
53
|
+
const modifiers = new Set<string>();
|
|
54
|
+
if (event.metaKey) modifiers.add("meta");
|
|
55
|
+
if (event.ctrlKey) modifiers.add("ctrl");
|
|
56
|
+
if (event.altKey) modifiers.add("alt");
|
|
57
|
+
if (event.shiftKey) modifiers.add("shift");
|
|
58
|
+
|
|
59
|
+
const mainKey = event.key.toLowerCase();
|
|
60
|
+
const eventCombination = [...Array.from(modifiers).sort(), mainKey].join("+");
|
|
61
|
+
|
|
62
|
+
return eventCombination === targetCombination;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* SolidJS reactive primitive for listening to single or multiple keyboard shortcuts.
|
|
67
|
+
*
|
|
68
|
+
* @param bindings Array of keybinding definitions or single definition object.
|
|
69
|
+
* @param options Configuration options including target, event type, and enabled state.
|
|
70
|
+
*/
|
|
71
|
+
export function createKeybindings(
|
|
72
|
+
bindings: KeybindingDefinition | KeybindingDefinition[],
|
|
73
|
+
options: CreateKeybindingsOptions = {}
|
|
74
|
+
): void {
|
|
75
|
+
const bindingList = Array.isArray(bindings) ? bindings : [bindings];
|
|
76
|
+
|
|
77
|
+
const isEnabled = () => {
|
|
78
|
+
if (typeof options.enabled === "function") {
|
|
79
|
+
return options.enabled();
|
|
80
|
+
}
|
|
81
|
+
return options.enabled ?? true;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const getTargetElement = (): HTMLElement | Window | undefined => {
|
|
85
|
+
if (!options.target) {
|
|
86
|
+
return typeof window !== "undefined" ? window : undefined;
|
|
87
|
+
}
|
|
88
|
+
if (typeof options.target === "function") {
|
|
89
|
+
return (options.target as Accessor<HTMLElement | Window | undefined>)();
|
|
90
|
+
}
|
|
91
|
+
return options.target;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
const handleKeyboardEvent = (event: KeyboardEvent) => {
|
|
95
|
+
if (!isEnabled()) return;
|
|
96
|
+
|
|
97
|
+
for (const binding of bindingList) {
|
|
98
|
+
const keys = Array.isArray(binding.key) ? binding.key : [binding.key];
|
|
99
|
+
|
|
100
|
+
for (const keyCombo of keys) {
|
|
101
|
+
const normalizedCombo = normalizeKeyCombination(keyCombo);
|
|
102
|
+
|
|
103
|
+
if (isEventMatch(event, normalizedCombo)) {
|
|
104
|
+
if (binding.preventDefault) {
|
|
105
|
+
event.preventDefault();
|
|
106
|
+
}
|
|
107
|
+
if (binding.stopPropagation) {
|
|
108
|
+
event.stopPropagation();
|
|
109
|
+
}
|
|
110
|
+
binding.handler(event);
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
onMount(() => {
|
|
118
|
+
const target = getTargetElement();
|
|
119
|
+
if (!target) return;
|
|
120
|
+
|
|
121
|
+
const eventType = options.eventType || "keydown";
|
|
122
|
+
target.addEventListener(eventType, handleKeyboardEvent as EventListener);
|
|
123
|
+
|
|
124
|
+
onCleanup(() => {
|
|
125
|
+
target.removeEventListener(eventType, handleKeyboardEvent as EventListener);
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* SolidJS primitive specialized for handling Escape key presses.
|
|
132
|
+
*
|
|
133
|
+
* @param handler Callback invoked when Escape key is pressed.
|
|
134
|
+
* @param options Keybindings options.
|
|
135
|
+
*/
|
|
136
|
+
export function createEscapeKey(
|
|
137
|
+
handler: (event: KeyboardEvent) => void,
|
|
138
|
+
options: CreateKeybindingsOptions = {}
|
|
139
|
+
): void {
|
|
140
|
+
createKeybindings(
|
|
141
|
+
{
|
|
142
|
+
key: "Escape",
|
|
143
|
+
handler,
|
|
144
|
+
preventDefault: true,
|
|
145
|
+
},
|
|
146
|
+
options
|
|
147
|
+
);
|
|
148
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { createEffect, createSignal, onCleanup, type Accessor } from "solid-js";
|
|
2
|
+
|
|
3
|
+
export interface CreateLockScrollOptions {
|
|
4
|
+
/** Target element to lock scroll for. Defaults to document.body. */
|
|
5
|
+
target?: HTMLElement | Accessor<HTMLElement | undefined>;
|
|
6
|
+
/** Initial lock state. Defaults to true. */
|
|
7
|
+
enabled?: boolean | Accessor<boolean>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface CreateLockScrollReturn {
|
|
11
|
+
/** Accessor indicating whether scroll is currently locked */
|
|
12
|
+
isLocked: Accessor<boolean>;
|
|
13
|
+
/** Setter function to programmatically lock or unlock scroll */
|
|
14
|
+
setLocked: (locked: boolean) => void;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* SolidJS reactive primitive for locking target element (or document.body) scroll.
|
|
19
|
+
*
|
|
20
|
+
* @param options Configuration options including target element and initial enabled state.
|
|
21
|
+
*/
|
|
22
|
+
export function createLockScroll(options: CreateLockScrollOptions = {}): CreateLockScrollReturn {
|
|
23
|
+
const [internalLocked, setInternalLocked] = createSignal(false);
|
|
24
|
+
|
|
25
|
+
const getTarget = (): HTMLElement | undefined => {
|
|
26
|
+
if (typeof window === "undefined") return undefined;
|
|
27
|
+
|
|
28
|
+
if (!options.target) {
|
|
29
|
+
return document.body;
|
|
30
|
+
}
|
|
31
|
+
if (typeof options.target === "function") {
|
|
32
|
+
return (options.target as Accessor<HTMLElement | undefined>)();
|
|
33
|
+
}
|
|
34
|
+
return options.target;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const isEnabled = (): boolean => {
|
|
38
|
+
if (typeof options.enabled === "function") {
|
|
39
|
+
return options.enabled();
|
|
40
|
+
}
|
|
41
|
+
return options.enabled ?? true;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
let originalOverflow: string | undefined;
|
|
45
|
+
|
|
46
|
+
const applyLock = (element: HTMLElement) => {
|
|
47
|
+
if (originalOverflow === undefined) {
|
|
48
|
+
originalOverflow = element.style.overflow;
|
|
49
|
+
}
|
|
50
|
+
element.style.overflow = "hidden";
|
|
51
|
+
setInternalLocked(true);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const removeLock = (element: HTMLElement) => {
|
|
55
|
+
if (originalOverflow !== undefined) {
|
|
56
|
+
element.style.overflow = originalOverflow;
|
|
57
|
+
originalOverflow = undefined;
|
|
58
|
+
} else {
|
|
59
|
+
element.style.overflow = "";
|
|
60
|
+
}
|
|
61
|
+
setInternalLocked(false);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
createEffect(() => {
|
|
65
|
+
const el = getTarget();
|
|
66
|
+
if (!el) return;
|
|
67
|
+
|
|
68
|
+
if (isEnabled()) {
|
|
69
|
+
applyLock(el);
|
|
70
|
+
} else {
|
|
71
|
+
removeLock(el);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
onCleanup(() => {
|
|
76
|
+
const el = getTarget();
|
|
77
|
+
if (el) {
|
|
78
|
+
removeLock(el);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
const setLocked = (locked: boolean) => {
|
|
83
|
+
const el = getTarget();
|
|
84
|
+
if (!el) return;
|
|
85
|
+
|
|
86
|
+
if (locked) {
|
|
87
|
+
applyLock(el);
|
|
88
|
+
} else {
|
|
89
|
+
removeLock(el);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
return {
|
|
94
|
+
isLocked: internalLocked,
|
|
95
|
+
setLocked,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { createSignal, onCleanup } from "solid-js";
|
|
2
|
+
|
|
3
|
+
export interface CreateLongPressOptions {
|
|
4
|
+
/** Long press hold threshold duration in milliseconds. Defaults to 500. */
|
|
5
|
+
threshold?: number;
|
|
6
|
+
/** Callback fired when long press hold starts */
|
|
7
|
+
onStart?: () => void;
|
|
8
|
+
/** Callback fired when long press is successfully completed */
|
|
9
|
+
onFinish?: () => void;
|
|
10
|
+
/** Callback fired when long press is cancelled before threshold */
|
|
11
|
+
onCancel?: () => void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface CreateLongPressReturn {
|
|
15
|
+
/** Accessor indicating if long press is currently being held */
|
|
16
|
+
isPressed: () => boolean;
|
|
17
|
+
/** JSX Event Handlers object to spread or attach onto target element */
|
|
18
|
+
props: {
|
|
19
|
+
onPointerDown: (e: PointerEvent) => void;
|
|
20
|
+
onPointerUp: (e: PointerEvent) => void;
|
|
21
|
+
onPointerLeave: (e: PointerEvent) => void;
|
|
22
|
+
onCancel: (e: Event) => void;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* SolidJS reactive primitive for detecting long press / hold interactions on elements.
|
|
28
|
+
*
|
|
29
|
+
* @param handler Callback function invoked when long press threshold is reached.
|
|
30
|
+
* @param options Options for threshold duration and state callbacks.
|
|
31
|
+
*/
|
|
32
|
+
export function createLongPress(
|
|
33
|
+
handler: (event: Event) => void,
|
|
34
|
+
options: CreateLongPressOptions = {}
|
|
35
|
+
): CreateLongPressReturn {
|
|
36
|
+
const threshold = options.threshold ?? 500;
|
|
37
|
+
const [isPressed, setIsPressed] = createSignal(false);
|
|
38
|
+
let timer: ReturnType<typeof setTimeout> | undefined;
|
|
39
|
+
|
|
40
|
+
const cancel = (e?: Event) => {
|
|
41
|
+
if (timer) {
|
|
42
|
+
clearTimeout(timer);
|
|
43
|
+
timer = undefined;
|
|
44
|
+
}
|
|
45
|
+
if (isPressed()) {
|
|
46
|
+
setIsPressed(false);
|
|
47
|
+
options.onCancel?.();
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const start = (e: Event) => {
|
|
52
|
+
cancel();
|
|
53
|
+
setIsPressed(true);
|
|
54
|
+
options.onStart?.();
|
|
55
|
+
|
|
56
|
+
timer = setTimeout(() => {
|
|
57
|
+
handler(e);
|
|
58
|
+
options.onFinish?.();
|
|
59
|
+
timer = undefined;
|
|
60
|
+
}, threshold);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const finish = (e: Event) => {
|
|
64
|
+
if (timer) {
|
|
65
|
+
clearTimeout(timer);
|
|
66
|
+
timer = undefined;
|
|
67
|
+
options.onCancel?.();
|
|
68
|
+
}
|
|
69
|
+
setIsPressed(false);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
onCleanup(() => {
|
|
73
|
+
cancel();
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
return {
|
|
77
|
+
isPressed,
|
|
78
|
+
props: {
|
|
79
|
+
onPointerDown: start,
|
|
80
|
+
onPointerUp: finish,
|
|
81
|
+
onPointerLeave: cancel,
|
|
82
|
+
onCancel: cancel,
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { createEffect, createSignal, onCleanup, type Accessor } from "solid-js";
|
|
2
|
+
|
|
3
|
+
export const DEFAULT_BREAKPOINTS = {
|
|
4
|
+
sm: "(min-width: 640px)",
|
|
5
|
+
md: "(min-width: 768px)",
|
|
6
|
+
lg: "(min-width: 1024px)",
|
|
7
|
+
xl: "(min-width: 1280px)",
|
|
8
|
+
"2xl": "(min-width: 1536px)",
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* SolidJS reactive primitive for tracking CSS media query match state.
|
|
13
|
+
*
|
|
14
|
+
* @param query Media query string or accessor returning media query string.
|
|
15
|
+
*/
|
|
16
|
+
export function createMediaQuery(query: string | Accessor<string>): Accessor<boolean> {
|
|
17
|
+
const getQuery = (): string => {
|
|
18
|
+
return typeof query === "function" ? query() : query;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const [matches, setMatches] = createSignal<boolean>(false);
|
|
22
|
+
|
|
23
|
+
createEffect(() => {
|
|
24
|
+
if (typeof window === "undefined" || !window.matchMedia) {
|
|
25
|
+
setMatches(false);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const currentQuery = getQuery();
|
|
30
|
+
const mediaQueryList = window.matchMedia(currentQuery);
|
|
31
|
+
|
|
32
|
+
setMatches(mediaQueryList.matches);
|
|
33
|
+
|
|
34
|
+
const listener = (event: MediaQueryListEvent) => {
|
|
35
|
+
setMatches(event.matches);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
if (mediaQueryList.addEventListener) {
|
|
39
|
+
mediaQueryList.addEventListener("change", listener);
|
|
40
|
+
onCleanup(() => mediaQueryList.removeEventListener("change", listener));
|
|
41
|
+
} else {
|
|
42
|
+
mediaQueryList.addListener(listener);
|
|
43
|
+
onCleanup(() => mediaQueryList.removeListener(listener));
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
return matches;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface CreateBreakpointReturn {
|
|
51
|
+
/** Accessor returning active breakpoint key (e.g. 'sm', 'md', 'lg') */
|
|
52
|
+
active: Accessor<string>;
|
|
53
|
+
/** Accessor indicating if screen width matches mobile (<768px) */
|
|
54
|
+
isMobile: Accessor<boolean>;
|
|
55
|
+
/** Accessor indicating if screen width matches tablet (768px - 1024px) */
|
|
56
|
+
isTablet: Accessor<boolean>;
|
|
57
|
+
/** Accessor indicating if screen width matches desktop (>=1024px) */
|
|
58
|
+
isDesktop: Accessor<boolean>;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* SolidJS reactive primitive for tracking responsive Tailwind CSS design breakpoints.
|
|
63
|
+
*
|
|
64
|
+
* @param customBreakpoints Custom breakpoint definitions mapping key names to media query strings.
|
|
65
|
+
*/
|
|
66
|
+
export function createBreakpoint(
|
|
67
|
+
customBreakpoints: Record<string, string> = DEFAULT_BREAKPOINTS
|
|
68
|
+
): CreateBreakpointReturn {
|
|
69
|
+
const isSm = createMediaQuery(customBreakpoints.sm || DEFAULT_BREAKPOINTS.sm);
|
|
70
|
+
const isMd = createMediaQuery(customBreakpoints.md || DEFAULT_BREAKPOINTS.md);
|
|
71
|
+
const isLg = createMediaQuery(customBreakpoints.lg || DEFAULT_BREAKPOINTS.lg);
|
|
72
|
+
const isXl = createMediaQuery(customBreakpoints.xl || DEFAULT_BREAKPOINTS.xl);
|
|
73
|
+
const is2Xl = createMediaQuery(customBreakpoints["2xl"] || DEFAULT_BREAKPOINTS["2xl"]);
|
|
74
|
+
|
|
75
|
+
const active = (): string => {
|
|
76
|
+
if (is2Xl()) return "2xl";
|
|
77
|
+
if (isXl()) return "xl";
|
|
78
|
+
if (isLg()) return "lg";
|
|
79
|
+
if (isMd()) return "md";
|
|
80
|
+
if (isSm()) return "sm";
|
|
81
|
+
return "xs";
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const isMobile = (): boolean => !isMd();
|
|
85
|
+
const isTablet = (): boolean => isMd() && !isLg();
|
|
86
|
+
const isDesktop = (): boolean => isLg();
|
|
87
|
+
|
|
88
|
+
return {
|
|
89
|
+
active,
|
|
90
|
+
isMobile,
|
|
91
|
+
isTablet,
|
|
92
|
+
isDesktop,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { createEffect, createSignal, onCleanup, type Accessor } from "solid-js";
|
|
2
|
+
|
|
3
|
+
export interface CreateMousePositionOptions {
|
|
4
|
+
/** Target element to calculate element-relative mouse coordinates for. Defaults to window. */
|
|
5
|
+
target?: HTMLElement | Window | Accessor<HTMLElement | Window | undefined>;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface CreateMousePositionReturn {
|
|
9
|
+
/** Accessor for global page X mouse position */
|
|
10
|
+
x: Accessor<number>;
|
|
11
|
+
/** Accessor for global page Y mouse position */
|
|
12
|
+
y: Accessor<number>;
|
|
13
|
+
/** Accessor for element-relative X mouse coordinate */
|
|
14
|
+
elementX: Accessor<number>;
|
|
15
|
+
/** Accessor for element-relative Y mouse coordinate */
|
|
16
|
+
elementY: Accessor<number>;
|
|
17
|
+
/** Accessor indicating if mouse pointer is inside target element bounds */
|
|
18
|
+
isInside: Accessor<boolean>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* SolidJS reactive primitive for tracking global and element-relative mouse pointer coordinates.
|
|
23
|
+
*
|
|
24
|
+
* @param options Configuration options including target element.
|
|
25
|
+
*/
|
|
26
|
+
export function createMousePosition(
|
|
27
|
+
options: CreateMousePositionOptions = {}
|
|
28
|
+
): CreateMousePositionReturn {
|
|
29
|
+
const [x, setX] = createSignal(0);
|
|
30
|
+
const [y, setY] = createSignal(0);
|
|
31
|
+
const [elementX, setElementX] = createSignal(0);
|
|
32
|
+
const [elementY, setElementY] = createSignal(0);
|
|
33
|
+
const [isInside, setIsInside] = createSignal(false);
|
|
34
|
+
|
|
35
|
+
const getTarget = (): HTMLElement | Window | undefined => {
|
|
36
|
+
if (typeof window === "undefined") return undefined;
|
|
37
|
+
if (!options.target) return window;
|
|
38
|
+
if (typeof options.target === "function") {
|
|
39
|
+
return (options.target as Accessor<HTMLElement | Window | undefined>)();
|
|
40
|
+
}
|
|
41
|
+
return options.target;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const handleMouseMove = (event: MouseEvent) => {
|
|
45
|
+
const pageX = event.pageX;
|
|
46
|
+
const pageY = event.pageY;
|
|
47
|
+
|
|
48
|
+
setX(pageX);
|
|
49
|
+
setY(pageY);
|
|
50
|
+
|
|
51
|
+
const target = getTarget();
|
|
52
|
+
if (target && target !== window) {
|
|
53
|
+
const el = target as HTMLElement;
|
|
54
|
+
const rect = el.getBoundingClientRect();
|
|
55
|
+
const relX = event.clientX - rect.left;
|
|
56
|
+
const relY = event.clientY - rect.top;
|
|
57
|
+
|
|
58
|
+
setElementX(relX);
|
|
59
|
+
setElementY(relY);
|
|
60
|
+
|
|
61
|
+
const inside =
|
|
62
|
+
relX >= 0 && relX <= rect.width && relY >= 0 && relY <= rect.height;
|
|
63
|
+
setIsInside(inside);
|
|
64
|
+
} else {
|
|
65
|
+
setElementX(pageX);
|
|
66
|
+
setElementY(pageY);
|
|
67
|
+
setIsInside(true);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
createEffect(() => {
|
|
72
|
+
if (typeof window === "undefined") return;
|
|
73
|
+
|
|
74
|
+
window.addEventListener("mousemove", handleMouseMove, { passive: true });
|
|
75
|
+
onCleanup(() => {
|
|
76
|
+
window.removeEventListener("mousemove", handleMouseMove);
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
return {
|
|
81
|
+
x,
|
|
82
|
+
y,
|
|
83
|
+
elementX,
|
|
84
|
+
elementY,
|
|
85
|
+
isInside,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { createEffect, createSignal, onCleanup, type Accessor } from "solid-js";
|
|
2
|
+
|
|
3
|
+
export interface CreateNetworkStatusReturn {
|
|
4
|
+
/** Accessor indicating if browser is currently connected to the network */
|
|
5
|
+
isOnline: Accessor<boolean>;
|
|
6
|
+
/** Date timestamp when network went offline, if applicable */
|
|
7
|
+
offlineAt: Accessor<Date | undefined>;
|
|
8
|
+
/** Date timestamp when network re-connected online, if applicable */
|
|
9
|
+
onlineAt: Accessor<Date | undefined>;
|
|
10
|
+
/** Network connection estimated downlink speed in Mbps */
|
|
11
|
+
downlink: Accessor<number | undefined>;
|
|
12
|
+
/** Network connection estimated round-trip time in ms */
|
|
13
|
+
rtt: Accessor<number | undefined>;
|
|
14
|
+
/** Network connection data saver mode enabled status */
|
|
15
|
+
saveData: Accessor<boolean | undefined>;
|
|
16
|
+
/** Network connection effective type ('slow-2g', '2g', '3g', '4g') */
|
|
17
|
+
effectiveType: Accessor<"slow-2g" | "2g" | "3g" | "4g" | undefined>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* SolidJS reactive primitive for tracking browser network connectivity and connection quality metrics.
|
|
22
|
+
*/
|
|
23
|
+
export function createNetworkStatus(): CreateNetworkStatusReturn {
|
|
24
|
+
const getInitialOnline = () => (typeof navigator !== "undefined" ? navigator.onLine : true);
|
|
25
|
+
|
|
26
|
+
const [isOnline, setIsOnline] = createSignal(getInitialOnline());
|
|
27
|
+
const [offlineAt, setOfflineAt] = createSignal<Date | undefined>(undefined);
|
|
28
|
+
const [onlineAt, setOnlineAt] = createSignal<Date | undefined>(undefined);
|
|
29
|
+
|
|
30
|
+
const getNetworkConnection = () => {
|
|
31
|
+
if (typeof navigator === "undefined") return undefined;
|
|
32
|
+
return (navigator as any).connection || (navigator as any).mozConnection || (navigator as any).webkitConnection;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const conn = getNetworkConnection();
|
|
36
|
+
|
|
37
|
+
const [downlink, setDownlink] = createSignal<number | undefined>(conn?.downlink);
|
|
38
|
+
const [rtt, setRtt] = createSignal<number | undefined>(conn?.rtt);
|
|
39
|
+
const [saveData, setSaveData] = createSignal<boolean | undefined>(conn?.saveData);
|
|
40
|
+
const [effectiveType, setEffectiveType] = createSignal<"slow-2g" | "2g" | "3g" | "4g" | undefined>(conn?.effectiveType);
|
|
41
|
+
|
|
42
|
+
const updateNetworkInfo = () => {
|
|
43
|
+
const currentConn = getNetworkConnection();
|
|
44
|
+
if (currentConn) {
|
|
45
|
+
setDownlink(currentConn.downlink);
|
|
46
|
+
setRtt(currentConn.rtt);
|
|
47
|
+
setSaveData(currentConn.saveData);
|
|
48
|
+
setEffectiveType(currentConn.effectiveType);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const handleOnline = () => {
|
|
53
|
+
setIsOnline(true);
|
|
54
|
+
setOnlineAt(new Date());
|
|
55
|
+
updateNetworkInfo();
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const handleOffline = () => {
|
|
59
|
+
setIsOnline(false);
|
|
60
|
+
setOfflineAt(new Date());
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
createEffect(() => {
|
|
64
|
+
if (typeof window === "undefined") return;
|
|
65
|
+
|
|
66
|
+
window.addEventListener("online", handleOnline);
|
|
67
|
+
window.addEventListener("offline", handleOffline);
|
|
68
|
+
|
|
69
|
+
const currentConn = getNetworkConnection();
|
|
70
|
+
if (currentConn && currentConn.addEventListener) {
|
|
71
|
+
currentConn.addEventListener("change", updateNetworkInfo);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
onCleanup(() => {
|
|
75
|
+
window.removeEventListener("online", handleOnline);
|
|
76
|
+
window.removeEventListener("offline", handleOffline);
|
|
77
|
+
if (currentConn && currentConn.removeEventListener) {
|
|
78
|
+
currentConn.removeEventListener("change", updateNetworkInfo);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
return {
|
|
84
|
+
isOnline,
|
|
85
|
+
offlineAt,
|
|
86
|
+
onlineAt,
|
|
87
|
+
downlink,
|
|
88
|
+
rtt,
|
|
89
|
+
saveData,
|
|
90
|
+
effectiveType,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* SolidJS reactive primitive for checking if browser is connected online.
|
|
96
|
+
*/
|
|
97
|
+
export function createOnline(): Accessor<boolean> {
|
|
98
|
+
const { isOnline } = createNetworkStatus();
|
|
99
|
+
return isOnline;
|
|
100
|
+
}
|