@flamingo-stack/openframe-frontend-core 0.0.213 → 0.0.214-snapshot.20260528192313
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/dist/{chunk-35XIT2CF.cjs → chunk-2G3NXF6J.cjs} +17 -17
- package/dist/{chunk-35XIT2CF.cjs.map → chunk-2G3NXF6J.cjs.map} +1 -1
- package/dist/{chunk-IK2X5YJU.js → chunk-7PCP7YQR.js} +2 -2
- package/dist/{chunk-ZDF6F7ED.cjs → chunk-D4MNFY67.cjs} +4 -3
- package/dist/chunk-D4MNFY67.cjs.map +1 -0
- package/dist/{chunk-OTKJASSX.cjs → chunk-NGFP4RVL.cjs} +24 -24
- package/dist/{chunk-OTKJASSX.cjs.map → chunk-NGFP4RVL.cjs.map} +1 -1
- package/dist/{chunk-3JWIJJ44.js → chunk-R6MLPU4A.js} +2 -2
- package/dist/{chunk-ZTJVRSN5.js → chunk-WQZP3JIZ.js} +4 -3
- package/dist/chunk-WQZP3JIZ.js.map +1 -0
- package/dist/components/chat/index.cjs +2 -2
- package/dist/components/chat/index.js +1 -1
- package/dist/components/contact/index.cjs +3 -3
- package/dist/components/contact/index.js +2 -2
- package/dist/components/features/index.cjs +2 -2
- package/dist/components/features/index.js +1 -1
- package/dist/components/index.cjs +49 -49
- package/dist/components/index.js +2 -2
- package/dist/components/navigation/index.cjs +2 -2
- package/dist/components/navigation/index.js +1 -1
- package/dist/components/tickets/index.cjs +61 -61
- package/dist/components/tickets/index.js +3 -3
- package/dist/components/ui/index.cjs +2 -2
- package/dist/components/ui/index.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/.index.md +36 -34
- package/src/components/.alert-dialog.md +27 -23
- package/src/components/.announcement-bar.md +26 -21
- package/src/components/.breadcrumb.md +19 -15
- package/src/components/.calendar.md +24 -19
- package/src/components/.categories-cart.md +29 -24
- package/src/components/.checkbox.md +23 -25
- package/src/components/.chevron-button.md +37 -32
- package/src/components/.comment-card.md +32 -62
- package/src/components/.dialog.md +26 -26
- package/src/components/.dynamic-skeleton.md +54 -57
- package/src/components/.empty-state.md +42 -51
- package/src/components/.faq-accordion.md +27 -21
- package/src/components/.filter-chip.md +41 -24
- package/src/components/.flamingo-logo.md +20 -23
- package/src/components/.footer-waitlist-button.md +29 -22
- package/src/components/.footer.md +32 -32
- package/src/components/.icons-block.md +27 -17
- package/src/components/.image-cropper.md +41 -32
- package/src/components/.index.md +33 -39
- package/src/components/.input.md +31 -35
- package/src/components/.logs-list.md +31 -20
- package/src/components/.media-carousel.md +35 -36
- package/src/components/.open-source-features.md +33 -16
- package/src/components/.pagination.md +52 -51
- package/src/components/.provider-button.md +21 -23
- package/src/components/.select.md +31 -20
- package/src/components/.sidebar.md +34 -24
- package/src/components/.smooth-accordion.md +29 -24
- package/src/components/.social-icon-row.md +36 -32
- package/src/components/.textarea.md +25 -31
- package/src/components/.tool-icon.md +24 -26
- package/src/components/.unified-filter-logic.md +37 -30
- package/src/components/.unified-pagination.md +23 -22
- package/src/components/.user-summary-stub.md +38 -22
- package/src/components/.vendor-display-button.md +25 -25
- package/src/components/.vendor-icon.md +33 -25
- package/src/components/.why-it-matters.md +28 -25
- package/src/components/chat/.approval-batch-message.md +51 -0
- package/src/components/chat/.approval-request-message.md +35 -34
- package/src/components/chat/.chat-attachment-bar.md +64 -0
- package/src/components/chat/.chat-container.md +36 -18
- package/src/components/chat/.chat-input.md +37 -20
- package/src/components/chat/.chat-message-enhanced.md +30 -49
- package/src/components/chat/.chat-message-list.md +45 -32
- package/src/components/chat/.chat-message-skeleton.md +26 -22
- package/src/components/chat/.chat-panel-context.md +52 -0
- package/src/components/chat/.chat-ref.types.md +42 -0
- package/src/components/chat/.chat-sidebar-skeleton.md +34 -25
- package/src/components/chat/.chat-sidebar.md +31 -26
- package/src/components/chat/.chat-ticket-list.md +39 -0
- package/src/components/chat/.context-compaction-display.md +36 -0
- package/src/components/chat/.cycling-phrase.md +52 -0
- package/src/components/chat/.embeddable-chat.md +48 -0
- package/src/components/chat/.expand-chevron.md +24 -0
- package/src/components/chat/.index.md +31 -35
- package/src/components/chat/.mingo-onboarding-card-skeleton.md +44 -0
- package/src/components/chat/.mingo-onboarding-card.md +62 -0
- package/src/components/chat/.model-display.md +32 -30
- package/src/components/chat/.nav-link-anchor-via-runtime.md +40 -0
- package/src/components/chat/.remark-card-links.md +38 -0
- package/src/components/chat/.slash-command-suggestions.md +47 -0
- package/src/components/chat/.source-action-button.md +48 -0
- package/src/components/chat/.thinking-display.md +42 -0
- package/src/components/chat/.tool-call-blocks.md +45 -0
- package/src/components/chat/.tool-execution-display.md +44 -36
- package/src/components/chat/chat-container.tsx +1 -1
- package/src/components/chat/entity-cards/.admin-content-card.md +43 -0
- package/src/components/chat/entity-cards/.block-card.md +47 -0
- package/src/components/chat/entity-cards/.blog-card.md +52 -0
- package/src/components/chat/entity-cards/.blog-image-placeholder.md +39 -0
- package/src/components/chat/entity-cards/.campaign-card-admin.md +47 -0
- package/src/components/chat/entity-cards/.case-study-card.md +58 -0
- package/src/components/chat/entity-cards/.chat-ticket-item.md +40 -0
- package/src/components/chat/entity-cards/.chat-video-entity-card.md +43 -0
- package/src/components/chat/entity-cards/.customer-interview-card.md +53 -0
- package/src/components/chat/entity-cards/.data-room-doc-card.md +47 -0
- package/src/components/chat/entity-cards/.dispatch.md +39 -0
- package/src/components/chat/entity-cards/.entity-author-card.md +51 -0
- package/src/components/chat/entity-cards/.generic-entity-card.md +62 -0
- package/src/components/chat/entity-cards/.github-activity-card.md +61 -0
- package/src/components/chat/entity-cards/.hubspot-ticket-card.md +53 -0
- package/src/components/chat/entity-cards/.index.md +66 -0
- package/src/components/chat/entity-cards/.investor-update-card.md +47 -0
- package/src/components/chat/entity-cards/.onboarding-guide-card.md +58 -0
- package/src/components/chat/entity-cards/.product-release-card-defaults.md +31 -0
- package/src/components/chat/entity-cards/.product-release-card.md +29 -0
- package/src/components/chat/entity-cards/.program-card-defaults.md +41 -0
- package/src/components/chat/entity-cards/.program-card.md +59 -0
- package/src/components/chat/entity-cards/.roadmap-card.md +46 -0
- package/src/components/chat/entity-cards/.roadmap-vote-button.md +52 -0
- package/src/components/chat/entity-cards/.slack-message-card.md +48 -0
- package/src/components/chat/entity-cards/.task-type-icon.md +47 -0
- package/src/components/chat/hooks/.index.md +36 -21
- package/src/components/chat/hooks/.use-chat-attachment-image-gallery.md +51 -0
- package/src/components/chat/hooks/.use-chat-attachments.md +48 -0
- package/src/components/chat/hooks/.use-chat-card-item.md +39 -0
- package/src/components/chat/hooks/.use-chat-identity.md +45 -0
- package/src/components/chat/hooks/.use-chat.md +58 -0
- package/src/components/chat/hooks/.use-chunk-catchup.md +46 -48
- package/src/components/chat/hooks/.use-close-on-navigation.md +44 -0
- package/src/components/chat/hooks/.use-collapsible.md +48 -0
- package/src/components/chat/hooks/.use-embedded-chat.md +32 -0
- package/src/components/chat/hooks/.use-jetstream-dialog-subscription.md +40 -0
- package/src/components/chat/hooks/.use-nats-chat-adapter.md +52 -0
- package/src/components/chat/hooks/.use-nats-dialog-subscription.md +49 -30
- package/src/components/chat/hooks/.use-proxied-image-url.md +40 -0
- package/src/components/chat/hooks/.use-realtime-chunk-processor.md +43 -40
- package/src/components/chat/hooks/.use-slash-commands.md +46 -0
- package/src/components/chat/hooks/.use-sse-chat-adapter.md +34 -0
- package/src/components/chat/hooks/.use-sse.md +60 -0
- package/src/components/chat/hooks/.use-unified-chat.md +57 -0
- package/src/components/chat/types/.api.types.md +52 -38
- package/src/components/chat/types/.chat.types.md +43 -34
- package/src/components/chat/types/.component.types.md +47 -48
- package/src/components/chat/types/.index.md +20 -27
- package/src/components/chat/types/.message.types.md +58 -48
- package/src/components/chat/types/.network.types.md +57 -31
- package/src/components/chat/types/.processing.types.md +49 -31
- package/src/components/chat/types/.unified-chat-state.types.md +41 -0
- package/src/components/chat/types/entities/.blog.md +43 -0
- package/src/components/chat/types/entities/.case-study.md +26 -0
- package/src/components/chat/types/entities/.content-ref.md +41 -0
- package/src/components/chat/types/entities/.customer-interview.md +28 -0
- package/src/components/chat/types/entities/.data-room-doc.md +36 -0
- package/src/components/chat/types/entities/.github-activity.md +43 -0
- package/src/components/chat/types/entities/.hubspot-ticket.md +53 -0
- package/src/components/chat/types/entities/.index.md +42 -0
- package/src/components/chat/types/entities/.investor-update.md +45 -0
- package/src/components/chat/types/entities/.onboarding-guide.md +50 -0
- package/src/components/chat/types/entities/.program-types.md +57 -0
- package/src/components/chat/types/entities/.roadmap-item.md +58 -0
- package/src/components/chat/types/entities/.slack-message.md +35 -0
- package/src/components/chat/utils/.agent-status-message.md +45 -0
- package/src/components/chat/utils/.auto-continuation-directive.md +58 -0
- package/src/components/chat/utils/.chat-attachment-markdown.md +54 -0
- package/src/components/chat/utils/.chat-authed-fetch.md +25 -0
- package/src/components/chat/utils/.chat-nav-resolution.md +46 -0
- package/src/components/chat/utils/.chat-proxy-auth-storage.md +38 -0
- package/src/components/chat/utils/.chip-action-class.md +34 -0
- package/src/components/chat/utils/.chip-styles.md +46 -0
- package/src/components/chat/utils/.chunk-parser.md +38 -28
- package/src/components/chat/utils/.clickup-task-type-utils.md +48 -0
- package/src/components/chat/utils/.compact-card-classes.md +62 -0
- package/src/components/chat/utils/.decide-new-tab.md +51 -0
- package/src/components/chat/utils/.external-app-urls.md +29 -0
- package/src/components/chat/utils/.extract-incomplete-message-state.md +25 -29
- package/src/components/chat/utils/.flatten-assistant-content.md +34 -0
- package/src/components/chat/utils/.icon-registry.md +46 -0
- package/src/components/chat/utils/.index.md +37 -32
- package/src/components/chat/utils/.is-cross-origin-url.md +35 -0
- package/src/components/chat/utils/.message-segment-accumulator.md +25 -34
- package/src/components/chat/utils/.nav-anchor-props.md +44 -0
- package/src/components/chat/utils/.nav-click-handler.md +47 -0
- package/src/components/chat/utils/.onboarding-icons.md +28 -0
- package/src/components/chat/utils/.process-historical-messages.md +46 -35
- package/src/components/chat/utils/.scroll-anchor.md +40 -0
- package/src/components/chat/utils/.slash-dispatch-utils.md +44 -0
- package/src/components/chat/utils/.source-icons.md +35 -0
- package/src/components/chat/utils/.source-row-cta.md +54 -0
- package/src/components/chat/utils/.tool-call-helpers.md +42 -0
- package/src/components/contact/.contact-form.md +43 -0
- package/src/components/contact/.index.md +27 -0
- package/src/components/features/.array-entry-manager.md +36 -45
- package/src/components/features/.changelog-manager.md +47 -21
- package/src/components/features/.changelog-sections-manager.md +21 -26
- package/src/components/features/.command-box.md +31 -28
- package/src/components/features/.entity-summary-editor.md +46 -0
- package/src/components/features/.entity-video-section.md +51 -0
- package/src/components/features/.figma-prototype-viewer.md +48 -29
- package/src/components/features/.filters-dropdown.md +33 -46
- package/src/components/features/.highlight-config-section.md +42 -0
- package/src/components/features/.highlight-generation-section.md +46 -0
- package/src/components/features/.highlight-video-combined-section.md +47 -0
- package/src/components/features/.highlight-video-preview.md +44 -0
- package/src/components/features/.highlight-video-section.md +47 -0
- package/src/components/features/.index.md +40 -66
- package/src/components/features/.media-gallery-manager.md +48 -38
- package/src/components/features/.more-about-button.md +22 -19
- package/src/components/features/.og-editor-preview.md +40 -36
- package/src/components/features/.parallax-image-showcase.md +33 -26
- package/src/components/features/.paths-display.md +42 -43
- package/src/components/features/.platform-badge.md +37 -36
- package/src/components/features/.platform-filter.md +23 -16
- package/src/components/features/.policy-configuration-panel.md +48 -56
- package/src/components/features/.provider-button.md +33 -36
- package/src/components/features/.push-button-selector.md +40 -29
- package/src/components/features/.release-media-manager.md +46 -31
- package/src/components/features/.section-selector.md +26 -31
- package/src/components/features/.select-button.md +35 -25
- package/src/components/features/.seo-editor-preview.md +41 -44
- package/src/components/features/.social-links-manager.md +25 -19
- package/src/components/features/.start-with-openframe-button.md +37 -29
- package/src/components/features/.status-filter-component.md +36 -20
- package/src/components/features/.tags-selector.md +40 -24
- package/src/components/features/.transcribe-and-summarize-combined-section.md +45 -0
- package/src/components/features/.transcribe-summarize-section.md +48 -0
- package/src/components/features/.transcript-summary-editor.md +53 -0
- package/src/components/features/.video-bites-display.md +46 -0
- package/src/components/features/.video-clips-section.md +41 -0
- package/src/components/features/.video-ratio-tabs.md +56 -0
- package/src/components/features/.video-source-selector.md +60 -0
- package/src/components/features/.video.md +44 -0
- package/src/components/features/.waitlist-form.md +60 -0
- package/src/components/features/ai-enrich/.AIEnrichButton.md +30 -27
- package/src/components/features/ai-enrich/.AIEnrichSection.md +46 -42
- package/src/components/features/board/.board-column-header.md +38 -0
- package/src/components/features/board/.board-column.md +43 -0
- package/src/components/features/board/.board.md +51 -0
- package/src/components/features/board/.color-utils.md +26 -0
- package/src/components/features/board/.index.md +56 -0
- package/src/components/features/board/.ticket-card-skeleton.md +38 -0
- package/src/components/features/board/.ticket-card.md +47 -0
- package/src/components/features/board/.types.md +45 -0
- package/src/components/features/board/.use-board-collapse.md +34 -0
- package/src/components/features/notifications/.index.md +57 -0
- package/src/components/features/notifications/.notification-drawer.md +34 -0
- package/src/components/features/notifications/.notification-tile.md +39 -0
- package/src/components/features/notifications/.notifications-context.md +73 -0
- package/src/components/features/notifications/.types.md +45 -0
- package/src/components/icons/.about-icon.md +20 -28
- package/src/components/icons/.ai-robot-icon.md +15 -17
- package/src/components/icons/.bash-icon.md +16 -23
- package/src/components/icons/.buildings-icon.md +10 -24
- package/src/components/icons/.capterra-icon.md +30 -26
- package/src/components/icons/.carta-icon.md +29 -0
- package/src/components/icons/.clickup-icon.md +26 -0
- package/src/components/icons/.cmd-icon.md +15 -22
- package/src/components/icons/.coins-icon.md +17 -25
- package/src/components/icons/.community-hub-icon.md +19 -25
- package/src/components/icons/.community-icon.md +24 -21
- package/src/components/icons/.compare-icon.md +32 -19
- package/src/components/icons/.copy-icon.md +29 -15
- package/src/components/icons/.custom-external-link-icon.md +19 -17
- package/src/components/icons/.custom-fork-icon.md +32 -21
- package/src/components/icons/.custom-license-icon.md +29 -25
- package/src/components/icons/.custom-star-icon.md +20 -28
- package/src/components/icons/.custom-time-icon.md +21 -22
- package/src/components/icons/.cut-vendor-costs-icon.md +6 -19
- package/src/components/icons/.dashboard-icon.md +13 -18
- package/src/components/icons/.deno-icon.md +16 -23
- package/src/components/icons/.donut-icon.md +12 -23
- package/src/components/icons/.double-chevron-icon.md +28 -36
- package/src/components/icons/.elestio-logo.md +13 -23
- package/src/components/icons/.empty-vendor-icon.md +16 -18
- package/src/components/icons/.explore-categories-icon.md +18 -29
- package/src/components/icons/.eye-icon.md +16 -26
- package/src/components/icons/.facebook-icon.md +9 -20
- package/src/components/icons/.figma-icon.md +8 -17
- package/src/components/icons/.filter-icon.md +15 -17
- package/src/components/icons/.flamingo-logo.md +28 -27
- package/src/components/icons/.folder-shield-icon.md +28 -19
- package/src/components/icons/.g2-icon.md +22 -21
- package/src/components/icons/.getapp-icon.md +25 -21
- package/src/components/icons/.github-icon.md +13 -25
- package/src/components/icons/.globe-icon.md +14 -19
- package/src/components/icons/.google-gemini-icon.md +16 -19
- package/src/components/icons/.google-logo.md +15 -21
- package/src/components/icons/.grid-view-icon.md +30 -19
- package/src/components/icons/.hamburger-icon.md +22 -20
- package/src/components/icons/.hand-dollar-icon.md +24 -34
- package/src/components/icons/.hotel-icon.md +27 -21
- package/src/components/icons/.icon-utils.md +28 -29
- package/src/components/icons/.image-icon.md +15 -22
- package/src/components/icons/.index.md +25 -28
- package/src/components/icons/.info-circle-icon.md +29 -30
- package/src/components/icons/.instagram-icon.md +10 -24
- package/src/components/icons/.jump-in-icon.md +18 -18
- package/src/components/icons/.linux-icon.md +18 -18
- package/src/components/icons/.log-out-icon.md +15 -23
- package/src/components/icons/.logs-icon.md +14 -23
- package/src/components/icons/.margin-crisis-icon.md +21 -20
- package/src/components/icons/.menu-icon.md +18 -19
- package/src/components/icons/.miami-cyber-gang-logo-face-only.md +18 -21
- package/src/components/icons/.miami-cyber-gang-logo.md +22 -14
- package/src/components/icons/.mlg-logo.md +18 -16
- package/src/components/icons/.moon-icon.md +32 -22
- package/src/components/icons/.ms-icon.md +30 -19
- package/src/components/icons/.nushell-icon.md +7 -21
- package/src/components/icons/.open-source-icon.md +19 -23
- package/src/components/icons/.openai-icon.md +9 -24
- package/src/components/icons/.openframe-ai-icons.md +25 -26
- package/src/components/icons/.openframe-logo.md +28 -22
- package/src/components/icons/.openframe-text.md +24 -27
- package/src/components/icons/.openmsp-logo.md +26 -23
- package/src/components/icons/.pilot-icon.md +23 -0
- package/src/components/icons/.powershell-icon.md +17 -22
- package/src/components/icons/.python-icon.md +16 -23
- package/src/components/icons/.queries-icon.md +13 -21
- package/src/components/icons/.reddit-icon.md +28 -24
- package/src/components/icons/.remote-control-icon.md +13 -17
- package/src/components/icons/.script-icon.md +27 -19
- package/src/components/icons/.search-icon.md +21 -21
- package/src/components/icons/.send-icon.md +14 -16
- package/src/components/icons/.settings-icon.md +30 -19
- package/src/components/icons/.shape-circle-dash-icon.md +16 -21
- package/src/components/icons/.shell-icon.md +15 -19
- package/src/components/icons/.shield-check-icon.md +18 -31
- package/src/components/icons/.shield-key-icon.md +25 -25
- package/src/components/icons/.shield-lock-icon.md +8 -18
- package/src/components/icons/.slack-icon.md +28 -32
- package/src/components/icons/.sparkles-icon.md +18 -23
- package/src/components/icons/.sso-configuration-icon.md +29 -16
- package/src/components/icons/.sun-icon.md +20 -18
- package/src/components/icons/.table-view-icon.md +17 -19
- package/src/components/icons/.telegram-icon.md +8 -22
- package/src/components/icons/.thumbs-down-icon.md +10 -19
- package/src/components/icons/.thumbs-up-icon.md +8 -17
- package/src/components/icons/.tool-directory-icons.md +24 -28
- package/src/components/icons/.trustpilot-icon.md +25 -22
- package/src/components/icons/.user-icon.md +26 -28
- package/src/components/icons/.users-group-icon.md +28 -24
- package/src/components/icons/.vendor-showcase-icons.md +21 -29
- package/src/components/icons/.vendors-icon.md +18 -22
- package/src/components/icons/.whatsapp-icon.md +30 -14
- package/src/components/icons/.x-icon.md +18 -23
- package/src/components/icons/.x-logo.md +13 -38
- package/src/components/icons/.youtube-icon.md +8 -19
- package/src/components/icons/device-type-icons/.get-device-type-icon.md +26 -34
- package/src/components/icons-v2-generated/.index.md +52 -0
- package/src/components/icons-v2-generated/alphabet/.index.md +33 -0
- package/src/components/icons-v2-generated/arrows/.index.md +39 -0
- package/src/components/icons-v2-generated/audio-and-visual/.index.md +40 -0
- package/src/components/icons-v2-generated/brand-logos/.elestio-logo-icon.md +40 -0
- package/src/components/icons-v2-generated/brand-logos/.gemini-logo-icon.md +37 -0
- package/src/components/icons-v2-generated/brand-logos/.google-gemini-logo-icon.md +33 -0
- package/src/components/icons-v2-generated/brand-logos/.index.md +38 -0
- package/src/components/icons-v2-generated/brand-logos/.meshcentral-logo-grey-icon.md +35 -0
- package/src/components/icons-v2-generated/brand-logos/.meshcentral-logo-icon.md +36 -0
- package/src/components/icons-v2-generated/buildings/.index.md +48 -0
- package/src/components/icons-v2-generated/charts/.index.md +40 -0
- package/src/components/icons-v2-generated/clothes/.index.md +48 -0
- package/src/components/icons-v2-generated/coding/.index.md +42 -0
- package/src/components/icons-v2-generated/communication/.index.md +39 -0
- package/src/components/icons-v2-generated/date-and-time/.index.md +29 -0
- package/src/components/icons-v2-generated/design/.index.md +39 -0
- package/src/components/icons-v2-generated/devices/.index.md +38 -0
- package/src/components/icons-v2-generated/documents/.index.md +38 -0
- package/src/components/icons-v2-generated/finance/.index.md +34 -0
- package/src/components/icons-v2-generated/food-and-drinks/.index.md +34 -0
- package/src/components/icons-v2-generated/food-and-drinks/.leafy-green-icon.md +36 -0
- package/src/components/icons-v2-generated/food-and-drinks/.strawberry-icon.md +39 -0
- package/src/components/icons-v2-generated/health/.index.md +40 -0
- package/src/components/icons-v2-generated/household/.index.md +45 -0
- package/src/components/icons-v2-generated/interface/.index.md +36 -0
- package/src/components/icons-v2-generated/map-and-travel/.index.md +41 -0
- package/src/components/icons-v2-generated/media-playback/.index.md +51 -0
- package/src/components/icons-v2-generated/number/.index.md +41 -0
- package/src/components/icons-v2-generated/school/.index.md +37 -0
- package/src/components/icons-v2-generated/security/.fingerprint-icon.md +38 -0
- package/src/components/icons-v2-generated/security/.index.md +39 -0
- package/src/components/icons-v2-generated/shopping/.index.md +42 -0
- package/src/components/icons-v2-generated/signs-and-symbols/.index.md +32 -0
- package/src/components/icons-v2-generated/sort-and-filter/.index.md +35 -0
- package/src/components/icons-v2-generated/sport/.index.md +41 -0
- package/src/components/icons-v2-generated/text-editor/.index.md +44 -0
- package/src/components/icons-v2-generated/users/.index.md +45 -0
- package/src/components/icons-v2-generated/vehicles-and-delivery/.index.md +36 -0
- package/src/components/icons-v2-generated/weather-and-nature/.flower-sakura-icon.md +36 -0
- package/src/components/icons-v2-generated/weather-and-nature/.index.md +34 -0
- package/src/components/layout/.article-detail-layout.md +43 -0
- package/src/components/layout/.back-button.md +40 -0
- package/src/components/layout/.list-page-layout.md +35 -26
- package/src/components/layout/.page-container.md +27 -38
- package/src/components/layout/.page-layout.md +50 -0
- package/src/components/layout/.title-block.md +42 -0
- package/src/components/loading/.card-skeleton.md +38 -29
- package/src/components/loading/.device-card-skeleton.md +29 -25
- package/src/components/loading/.index.md +39 -46
- package/src/components/loading/.margin-report-skeleton.md +45 -34
- package/src/components/loading/.organization-card-skeleton.md +39 -44
- package/src/components/loading/.page-layout-skeleton.md +34 -45
- package/src/components/loading/.unified-skeleton.md +62 -36
- package/src/components/navigation/.app-header.md +40 -29
- package/src/components/navigation/.app-layout.md +25 -26
- package/src/components/navigation/.header-global-search.md +34 -37
- package/src/components/navigation/.header-organization-filter.md +23 -22
- package/src/components/navigation/.header.md +31 -35
- package/src/components/navigation/.mobile-burger-menu.md +39 -47
- package/src/components/navigation/.mobile-nav-panel.md +51 -32
- package/src/components/navigation/.navigation-sidebar-header.md +36 -0
- package/src/components/navigation/.navigation-sidebar-item.md +45 -0
- package/src/components/navigation/.navigation-sidebar-toggle.md +38 -0
- package/src/components/navigation/.navigation-sidebar.md +33 -34
- package/src/components/navigation/.sliding-sidebar.md +52 -41
- package/src/components/navigation/.sticky-section-nav.md +56 -48
- package/src/components/platform/.ScriptArguments.md +39 -25
- package/src/components/platform/.ScriptInfoSection.md +30 -26
- package/src/components/platform/.ShellTypeBadge.md +18 -13
- package/src/components/platform/.SoftwareInfo.md +23 -27
- package/src/components/platform/.SoftwareSourceBadge.md +28 -19
- package/src/components/platform/.ToolBadge.md +25 -26
- package/src/components/platform/ShellTypeBadge.tsx +2 -2
- package/src/components/providers/.theme-provider.md +52 -0
- package/src/components/shared/delivery/.delivery-lists.md +39 -0
- package/src/components/shared/delivery/.delivery-row.md +41 -0
- package/src/components/shared/delivery/.delivery-table.md +41 -0
- package/src/components/shared/delivery/.index.md +38 -0
- package/src/components/shared/dev-section/.dev-card-row.md +60 -0
- package/src/components/shared/dev-section/.dev-section-page.md +48 -0
- package/src/components/shared/dev-section/.dev-section-view.md +43 -0
- package/src/components/shared/dev-section/.index.md +38 -0
- package/src/components/shared/legal-document/.index.md +40 -0
- package/src/components/shared/legal-document/.legal-document-page.md +50 -0
- package/src/components/shared/legal-document/.use-legal-docs.md +42 -0
- package/src/components/shared/onboarding/.onboarding-step-card.md +32 -31
- package/src/components/shared/onboarding/.onboarding-walkthrough.md +39 -43
- package/src/components/shared/product-release/.index.md +28 -30
- package/src/components/shared/product-release/.product-release-card-skeleton.md +28 -28
- package/src/components/shared/product-release/.product-release-card.md +45 -27
- package/src/components/shared/product-release/.release-detail-page.md +23 -24
- package/src/components/shared/roadmap/.index.md +37 -0
- package/src/components/shared/roadmap/.roadmap-grid-skeleton.md +39 -0
- package/src/components/shared/roadmap/.roadmap-grid.md +66 -0
- package/src/components/shared/roadmap/.use-roadmap-voting.md +68 -0
- package/src/components/tickets/.help-center-card.md +51 -0
- package/src/components/tickets/.help-center-create-form.md +38 -0
- package/src/components/tickets/.help-center-list.md +40 -0
- package/src/components/tickets/.index.md +65 -0
- package/src/components/tickets/.ticket-center.md +51 -0
- package/src/components/tickets/.ticket-detail-drawer.md +48 -0
- package/src/components/tickets/.ticket-linked-delivery-card.md +36 -0
- package/src/components/tickets/.ticket-open-form.md +50 -0
- package/src/components/tickets/.ticket-row.md +30 -0
- package/src/components/tickets/.types.md +57 -0
- package/src/components/tickets/hooks/.use-ticket-actions.md +77 -0
- package/src/components/tickets/hooks/.use-ticket-engagements.md +42 -0
- package/src/components/tickets/hooks/.use-tickets-list.md +54 -0
- package/src/components/ui/.actions-menu.md +66 -41
- package/src/components/ui/.alert-dialog.md +29 -26
- package/src/components/ui/.allowed-domains-input.md +29 -21
- package/src/components/ui/.assignee-dropdown.md +45 -0
- package/src/components/ui/.autocomplete.md +47 -41
- package/src/components/ui/.benefit-card.md +51 -36
- package/src/components/ui/.brand-association-card.md +30 -27
- package/src/components/ui/.breadcrumb.md +17 -15
- package/src/components/ui/.checkbox-block.md +39 -35
- package/src/components/ui/.checkbox-with-description.md +23 -16
- package/src/components/ui/.checkbox.md +31 -23
- package/src/components/ui/.circular-progress.md +49 -19
- package/src/components/ui/.content-loader.md +32 -20
- package/src/components/ui/.cursor-pagination.md +41 -52
- package/src/components/ui/.dashboard-info-card.md +33 -26
- package/src/components/ui/.date-picker.md +27 -25
- package/src/components/ui/.device-card-compact.md +28 -29
- package/src/components/ui/.device-card.md +27 -27
- package/src/components/ui/.dialog.md +25 -16
- package/src/components/ui/.drawer.md +86 -0
- package/src/components/ui/.dropdown-button.md +45 -0
- package/src/components/ui/.entity-image.md +46 -0
- package/src/components/ui/.error-state.md +41 -28
- package/src/components/ui/.feature-card.md +35 -31
- package/src/components/ui/.feature-list.md +48 -0
- package/src/components/ui/.field-wrapper.md +47 -0
- package/src/components/ui/.file-upload.md +42 -0
- package/src/components/ui/.filter-checkbox-item.md +43 -0
- package/src/components/ui/.filter-list.md +57 -0
- package/src/components/ui/.filter-modal.md +59 -0
- package/src/components/ui/.floating-tooltip.md +43 -26
- package/src/components/ui/.hidden-tags-popup.md +49 -0
- package/src/components/ui/.hover-dropdown.md +54 -0
- package/src/components/ui/.image-gallery-modal.md +41 -34
- package/src/components/ui/.image-uploader.md +53 -0
- package/src/components/ui/.index.md +40 -34
- package/src/components/ui/.info-card.md +31 -31
- package/src/components/ui/.info-row.md +31 -27
- package/src/components/ui/.input-trigger.md +44 -0
- package/src/components/ui/.input.md +37 -31
- package/src/components/ui/.markdown-editor.md +57 -0
- package/src/components/ui/.modal-v2.md +51 -0
- package/src/components/ui/.modal.md +32 -31
- package/src/components/ui/.more-actions-menu.md +45 -38
- package/src/components/ui/.organization-card.md +31 -37
- package/src/components/ui/.page-actions.md +44 -54
- package/src/components/ui/.phone-input.md +54 -0
- package/src/components/ui/.progress-bar.md +35 -27
- package/src/components/ui/.radio-group.md +39 -27
- package/src/components/ui/.release-changelog-section.md +34 -34
- package/src/components/ui/.search-input.md +48 -0
- package/src/components/ui/.select.md +54 -34
- package/src/components/ui/.service-card.md +42 -40
- package/src/components/ui/.sheet.md +27 -18
- package/src/components/ui/.simple-markdown-renderer.md +29 -31
- package/src/components/ui/.sort-column-item.md +42 -0
- package/src/components/ui/.square-avatar.md +34 -24
- package/src/components/ui/.status-badge.md +26 -38
- package/src/components/ui/.switch.md +22 -35
- package/src/components/ui/.tab-navigation.md +56 -53
- package/src/components/ui/.tab-selector.md +40 -0
- package/src/components/ui/.tag-key-value-filter.md +56 -0
- package/src/components/ui/.tag-search-input.md +53 -0
- package/src/components/ui/.tag.md +49 -31
- package/src/components/ui/.tags-manager.md +60 -0
- package/src/components/ui/.textarea.md +44 -34
- package/src/components/ui/.ticket-attachments-list.md +45 -0
- package/src/components/ui/.ticket-detail-section.md +29 -0
- package/src/components/ui/.ticket-info-section.md +56 -0
- package/src/components/ui/.ticket-note-card.md +53 -0
- package/src/components/ui/.ticket-notes-section.md +54 -0
- package/src/components/ui/.ticket-status-tag.md +49 -0
- package/src/components/ui/.title-content-block.md +25 -26
- package/src/components/ui/.toaster.md +40 -28
- package/src/components/ui/.tooltip.md +22 -11
- package/src/components/ui/.truncate-text.md +39 -0
- package/src/components/ui/button/.button-styles.md +35 -0
- package/src/components/ui/button/.button.md +53 -0
- package/src/components/ui/button/.split-button.md +48 -0
- package/src/components/ui/data-table/.data-table-body.md +48 -0
- package/src/components/ui/data-table/.data-table-column-filter.md +45 -0
- package/src/components/ui/data-table/.data-table-cursor-footer.md +45 -0
- package/src/components/ui/data-table/.data-table-empty.md +43 -0
- package/src/components/ui/data-table/.data-table-header.md +55 -0
- package/src/components/ui/data-table/.data-table-infinite-footer.md +44 -0
- package/src/components/ui/data-table/.data-table-row-count.md +43 -0
- package/src/components/ui/data-table/.data-table-row.md +47 -0
- package/src/components/ui/data-table/.data-table-skeleton.md +42 -0
- package/src/components/ui/data-table/.data-table.md +47 -0
- package/src/components/ui/data-table/.index.md +55 -0
- package/src/components/ui/data-table/.types.md +54 -0
- package/src/components/ui/data-table/.use-data-table.md +45 -0
- package/src/components/ui/data-table/.utils.md +38 -0
- package/src/components/ui/file-manager/.file-manager-action-bar.md +39 -30
- package/src/components/ui/file-manager/.file-manager-breadcrumb.md +29 -27
- package/src/components/ui/file-manager/.file-manager-context-menu.md +38 -42
- package/src/components/ui/file-manager/.file-manager-empty.md +26 -39
- package/src/components/ui/file-manager/.file-manager-table-row.md +33 -41
- package/src/components/ui/file-manager/.file-manager.md +35 -31
- package/src/components/ui/query-report-table/.index.md +43 -0
- package/src/components/ui/query-report-table/.query-report-table-header.md +36 -0
- package/src/components/ui/query-report-table/.query-report-table-row.md +40 -0
- package/src/components/ui/query-report-table/.query-report-table-skeleton.md +44 -0
- package/src/components/ui/query-report-table/.query-report-table.md +47 -0
- package/src/components/ui/query-report-table/.types.md +41 -0
- package/src/components/ui/query-report-table/.utils.md +35 -0
- package/src/components/ui/table/.index.md +27 -48
- package/src/components/ui/table/.table-cell.md +18 -27
- package/src/components/ui/table/.table-column-filter-dropdown.md +40 -0
- package/src/components/ui/table/.table-description-cell.md +24 -14
- package/src/components/ui/table/.table-empty-state.md +21 -22
- package/src/components/ui/table/.table-header.md +25 -40
- package/src/components/ui/table/.table-row.md +22 -40
- package/src/components/ui/table/.table-skeleton.md +33 -26
- package/src/components/ui/table/.table-timestamp-cell.md +26 -16
- package/src/components/ui/table/.table.md +39 -59
- package/src/components/ui/table/.types.md +44 -36
- package/src/components/ui/table/.utils.md +18 -20
- package/src/contexts/.chat-runtime-context.md +54 -0
- package/src/contexts/.endpoints-runtime-context.md +58 -0
- package/src/contexts/.index.md +53 -0
- package/src/contexts/.use-outer-or-default.md +36 -0
- package/src/embed-shims/.index.md +45 -0
- package/src/embed-shims/.next-dynamic.md +43 -0
- package/src/embed-shims/.next-image.md +45 -0
- package/src/embed-shims/.next-link.md +59 -0
- package/src/embed-shims/.next-navigation.md +59 -0
- package/src/hooks/.index.md +34 -29
- package/src/hooks/.use-access-code-integration.md +49 -0
- package/src/hooks/.use-contact-submission.md +37 -26
- package/src/hooks/.use-copy-to-clipboard.md +42 -0
- package/src/hooks/.use-near-viewport.md +44 -0
- package/src/hooks/.use-og-placeholder.md +51 -0
- package/src/hooks/.use-toast.md +36 -35
- package/src/hooks/state/.use-api-params.md +29 -46
- package/src/hooks/state/.use-query-params.md +37 -33
- package/src/hooks/ui/.index.md +33 -32
- package/src/hooks/ui/.use-auto-limit-tags.md +54 -0
- package/src/hooks/ui/.use-horizontal-scrollbar.md +74 -0
- package/src/hooks/ui/.use-image-edge-color.md +42 -0
- package/src/hooks/ui/.use-media-query.md +33 -25
- package/src/hooks/ui/.use-search.md +51 -0
- package/src/nats/.nats.md +49 -28
- package/src/schemas/.contact-schema.md +45 -0
- package/src/stories/.AnnouncementBar.stories.md +45 -0
- package/src/stories/.AppLayout.stories.md +20 -21
- package/src/stories/.Autocomplete.stories.md +48 -34
- package/src/stories/.Board.stories.md +35 -0
- package/src/stories/.Button.stories.md +36 -33
- package/src/stories/.ChatTicketList.stories.md +33 -0
- package/src/stories/.CheckboxBlock.stories.md +40 -28
- package/src/stories/.ContentLoader.stories.md +47 -0
- package/src/stories/.DashboardInfoCard.stories.md +57 -0
- package/src/stories/.DataTable.stories.md +41 -0
- package/src/stories/.DatePicker.stories.md +66 -52
- package/src/stories/.DeviceCard.stories.md +41 -40
- package/src/stories/.DeviceCardCompact.stories.md +41 -0
- package/src/stories/.DotsLoaderIcon.stories.md +36 -0
- package/src/stories/.Drawer.stories.md +58 -0
- package/src/stories/.EmbeddableChat.stories.md +41 -0
- package/src/stories/.FileManager.stories.md +41 -0
- package/src/stories/.FileManagerActionBar.stories.md +38 -0
- package/src/stories/.FileUpload.stories.md +53 -0
- package/src/stories/.FilterList.stories.md +54 -0
- package/src/stories/.FilterModal.stories.md +72 -0
- package/src/stories/.FiltersDropdown.stories.md +57 -0
- package/src/stories/.Header.stories.md +48 -0
- package/src/stories/.ImageUploader.stories.md +49 -0
- package/src/stories/.InfoCard.stories.md +54 -0
- package/src/stories/.Input.stories.md +48 -30
- package/src/stories/.ListPageLayout.stories.md +56 -43
- package/src/stories/.MingoOnboardingCard.stories.md +42 -0
- package/src/stories/.MingoOnboardingCardSkeleton.stories.md +35 -0
- package/src/stories/.Modal.stories.md +40 -31
- package/src/stories/.NotificationDrawer.stories.md +55 -0
- package/src/stories/.OnboardingStepCard.stories.md +41 -0
- package/src/stories/.OrganizationCard.stories.md +61 -0
- package/src/stories/.PageActions.stories.md +52 -49
- package/src/stories/.PageContainer.stories.md +41 -35
- package/src/stories/.PageLayout.stories.md +60 -0
- package/src/stories/.ParallaxImageShowcase.stories.md +49 -0
- package/src/stories/.PhoneInput.stories.md +53 -0
- package/src/stories/.QueryReportTable.stories.md +44 -0
- package/src/stories/.RadioGroup.stories.md +46 -0
- package/src/stories/.RadioGroupBlock.stories.md +45 -0
- package/src/stories/.Select.stories.md +29 -15
- package/src/stories/.SlashCommandSuggestions.stories.md +41 -0
- package/src/stories/.SplitButton.stories.md +62 -0
- package/src/stories/.TabNavigation.stories.md +47 -38
- package/src/stories/.TabSelector.stories.md +65 -0
- package/src/stories/.Table.stories.md +38 -46
- package/src/stories/.TableColumnFilterDropdown.stories.md +46 -0
- package/src/stories/.Tag.stories.md +43 -32
- package/src/stories/.TagKeyValueFilter.stories.md +44 -0
- package/src/stories/.TagSearchInput.stories.md +61 -0
- package/src/stories/.Textarea.stories.md +49 -26
- package/src/stories/.Theme.stories.md +41 -0
- package/src/stories/.TicketAttachmentsList.stories.md +39 -0
- package/src/stories/.TicketDescriptionViewer.stories.md +39 -0
- package/src/stories/.TicketInfoSection.stories.md +40 -0
- package/src/stories/.TicketKnowledgeBaseList.stories.md +36 -0
- package/src/stories/.TicketNotesSection.stories.md +50 -0
- package/src/stories/.Toaster.stories.md +40 -0
- package/src/stories/.ToolExecutionDisplay.stories.md +41 -0
- package/src/stories/.Tooltip.stories.md +41 -0
- package/src/stories/.UserSummary.stories.md +41 -0
- package/src/stories/.WaitlistForm.stories.md +42 -0
- package/src/stories/BlogCard.stories.tsx +61 -0
- package/src/stories/CampaignCardAdmin.stories.tsx +52 -0
- package/src/stories/CaseStudyCard.stories.tsx +42 -0
- package/src/stories/ChatContainer.stories.tsx +186 -0
- package/src/stories/ChatInlineVideoPill.stories.tsx +63 -0
- package/src/stories/CustomerInterviewCard.stories.tsx +42 -0
- package/src/stories/DataRoomDocCard.stories.tsx +52 -0
- package/src/stories/GenericEntityCard.stories.tsx +66 -0
- package/src/stories/GitHubActivityCard.stories.tsx +61 -0
- package/src/stories/HubspotTicketCard.stories.tsx +98 -0
- package/src/stories/InvestorUpdateCard.stories.tsx +42 -0
- package/src/stories/OnboardingGuideCard.stories.tsx +52 -0
- package/src/stories/ProductReleaseCard.stories.tsx +61 -0
- package/src/stories/ProgramCard.stories.tsx +79 -0
- package/src/stories/RoadmapCard.stories.tsx +75 -0
- package/src/stories/SlackMessageCard.stories.tsx +41 -0
- package/src/stories/__fixtures__/chat-cards.ts +604 -0
- package/src/types/.blog.md +53 -29
- package/src/types/.case-study.md +44 -27
- package/src/types/.customer-interview.md +66 -44
- package/src/types/.delivery.md +40 -0
- package/src/types/.employee.md +24 -30
- package/src/types/.index.md +33 -47
- package/src/types/.marketing.md +49 -44
- package/src/types/.navigation.md +33 -25
- package/src/types/.os.types.md +32 -27
- package/src/types/.platform.md +31 -28
- package/src/types/.product-release.md +65 -38
- package/src/types/.supabase.md +37 -29
- package/src/types/.team.md +41 -33
- package/src/types/.video-processing.md +54 -0
- package/src/types/.waitlist.md +40 -36
- package/src/utils/.access-code-client.md +37 -36
- package/src/utils/.cn.md +31 -23
- package/src/utils/.color-analysis.md +35 -0
- package/src/utils/.country-phone-utils.md +39 -0
- package/src/utils/.date-formatters.md +19 -18
- package/src/utils/.embed-authed-fetch.md +39 -0
- package/src/utils/.embed-proxy-auth-storage.md +38 -0
- package/src/utils/.fetch-priority.md +41 -0
- package/src/utils/.format.md +74 -25
- package/src/utils/.generic-domain-utils.md +42 -0
- package/src/utils/.image-proxy.md +59 -23
- package/src/utils/.index.md +42 -49
- package/src/utils/.local-storage-adapter.md +50 -0
- package/src/utils/.ods-color-utils.md +55 -38
- package/src/utils/.platform-config.md +45 -25
- package/src/utils/.scroll-into-view.md +40 -0
- package/src/utils/.source-icons.md +53 -0
- package/src/utils/.sse-decision-frame.md +46 -0
- package/src/utils/dev-sections/.index.md +34 -0
- package/src/utils/dev-sections/.openframe-dev-sections.md +49 -0
- package/dist/chunk-ZDF6F7ED.cjs.map +0 -1
- package/dist/chunk-ZTJVRSN5.js.map +0 -1
- package/src/components/.card.md +0 -42
- package/src/components/.contact-button.md +0 -30
- package/src/components/.drawer.md +0 -46
- package/src/components/.fixed-layout-container.md +0 -47
- package/src/components/.footer-waitlist-card.md +0 -29
- package/src/components/.join-waitlist-cta.md +0 -29
- package/src/components/.sheet.md +0 -47
- package/src/components/.sliding-panel.md +0 -48
- package/src/components/.tooltip.md +0 -48
- package/src/components/.use-mobile.md +0 -42
- package/src/components/.vendor-compact-card.md +0 -66
- package/src/components/.x-button.md +0 -42
- package/src/components/features/.github-repo-button.md +0 -40
- package/src/components/features/.organization-icon.md +0 -47
- package/src/components/features/.organization-selector.md +0 -45
- package/src/components/icons/.fleet-icon.md +0 -39
- package/src/components/icons/.meshcentral-icon.md +0 -35
- package/src/components/icons/.refresh-icon.md +0 -34
- package/src/components/icons/.tactical-icon.md +0 -35
- package/src/components/ui/.button.md +0 -69
- package/src/components/ui/.log-table-row.md +0 -47
- package/src/components/ui/.selectable-device-card.md +0 -46
- package/src/hooks/.api-hooks-stub.md +0 -45
- package/src/hooks/api/.use-product-releases.md +0 -53
- package/src/stories/.OrganizationSelector.stories.md +0 -42
- package/src/stories/.SelectableDeviceCard.stories.md +0 -30
- package/src/utils/.lite-youtube-embed-stub.md +0 -37
- package/src/utils/.lite-youtube-embed.md +0 -33
- /package/dist/{chunk-IK2X5YJU.js.map → chunk-7PCP7YQR.js.map} +0 -0
- /package/dist/{chunk-3JWIJJ44.js.map → chunk-R6MLPU4A.js.map} +0 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<!-- source-hash: ef396b17d63aed7d69a637d3e4442715 -->
|
|
2
|
+
React hook that wraps the browser Clipboard API, providing toast notifications on success or failure and a timed `copied` state reset.
|
|
3
|
+
|
|
4
|
+
## Key Components
|
|
5
|
+
|
|
6
|
+
| Export | Type | Description |
|
|
7
|
+
|--------|------|-------------|
|
|
8
|
+
| `useCopyToClipboard` | Hook | Copies text to clipboard with toast feedback and `copied` state |
|
|
9
|
+
| `UseCopyToClipboardOptions` | Interface | Configuration options for toast messages and reset delay |
|
|
10
|
+
|
|
11
|
+
**Options:**
|
|
12
|
+
|
|
13
|
+
| Option | Default | Description |
|
|
14
|
+
|--------|---------|-------------|
|
|
15
|
+
| `successTitle` | `'Copied'` | Toast title on success |
|
|
16
|
+
| `successDescription` | `'Copied to clipboard'` | Toast body on success |
|
|
17
|
+
| `errorTitle` | `'Copy failed'` | Toast title on failure |
|
|
18
|
+
| `errorDescription` | `'Could not copy to clipboard'` | Toast body on failure |
|
|
19
|
+
| `resetDelay` | `2000` | Milliseconds before `copied` resets to `false` |
|
|
20
|
+
|
|
21
|
+
**Returns:** `{ copy, copied }` — the async copy function and a boolean state flag.
|
|
22
|
+
|
|
23
|
+
## Usage Example
|
|
24
|
+
|
|
25
|
+
```typescript
|
|
26
|
+
import { useCopyToClipboard } from '@/hooks/use-copy-to-clipboard';
|
|
27
|
+
|
|
28
|
+
function ApiKeyDisplay({ apiKey }: { apiKey: string }) {
|
|
29
|
+
const { copy, copied } = useCopyToClipboard({
|
|
30
|
+
successTitle: 'API Key Copied',
|
|
31
|
+
resetDelay: 3000,
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<button onClick={() => copy(apiKey)}>
|
|
36
|
+
{copied ? 'Copied!' : 'Copy API Key'}
|
|
37
|
+
</button>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
> **Note:** This hook is client-only (`'use client'`). It depends on `navigator.clipboard`, which requires a secure context (HTTPS or localhost). Failures are caught silently and surfaced via the destructive toast variant.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<!-- source-hash: 22dd3f53bc1b8db26b9d173ca6be7427 -->
|
|
2
|
+
A React hook that detects when an element is approaching the viewport using a shared, module-level `IntersectionObserver` pool — one observer instance per unique `rootMargin` value, shared across all components using the hook.
|
|
3
|
+
|
|
4
|
+
## Key Components
|
|
5
|
+
|
|
6
|
+
| Export | Type | Description |
|
|
7
|
+
|--------|------|-------------|
|
|
8
|
+
| `useNearViewport` | Hook | Main hook; returns `ref` and `isNear` state |
|
|
9
|
+
| `UseNearViewportResult` | Interface | Return type generic over element type `T` |
|
|
10
|
+
| `getObserverFor` | Internal | Lazily creates/retrieves a shared `IntersectionObserver` per `rootMargin` |
|
|
11
|
+
| `observers` | `Map<string, IntersectionObserver>` | Module-level singleton pool keyed by `rootMargin` |
|
|
12
|
+
| `subscribers` | `WeakMap<Element, () => void>` | Tracks per-element callbacks; auto-GC'd when elements are removed |
|
|
13
|
+
|
|
14
|
+
## Usage Example
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import { useNearViewport } from './use-near-viewport';
|
|
18
|
+
|
|
19
|
+
// Basic lazy-render pattern
|
|
20
|
+
function MediaCard() {
|
|
21
|
+
const { ref, isNear } = useNearViewport('500px');
|
|
22
|
+
return (
|
|
23
|
+
<div ref={ref}>
|
|
24
|
+
{isNear ? <HeavyMediaComponent /> : <Placeholder />}
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// Strict on-screen detection
|
|
30
|
+
function AnalyticsTracker() {
|
|
31
|
+
const { ref, isNear } = useNearViewport('0px');
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
if (isNear) trackImpression();
|
|
34
|
+
}, [isNear]);
|
|
35
|
+
return <div ref={ref} />;
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Behavior Notes
|
|
40
|
+
|
|
41
|
+
- **Fires once**: `isNear` flips to `true` on first intersection and never resets; the element is unobserved immediately after
|
|
42
|
+
- **Shared observers**: All components using the same `rootMargin` share a single `IntersectionObserver` — efficient for grid/list pages with many cards
|
|
43
|
+
- **StrictMode safe**: Cleanup uses callback identity checks to survive React's dev-mode double-mount cycle without dropping subscriptions
|
|
44
|
+
- **Race safe**: IO callback re-reads `subscribers` at fire time so late-firing callbacks after unmount cannot invoke stale state setters
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<!-- source-hash: ef127df882f0312f1636164b044502e4 -->
|
|
2
|
+
Thin client-side React hook that generates a branded OG placeholder image URL by delegating to a caller-supplied URL builder, keeping the lib layer free of hub-specific dependencies.
|
|
3
|
+
|
|
4
|
+
## Key Components
|
|
5
|
+
|
|
6
|
+
### `useOgPlaceholder`
|
|
7
|
+
A memoized hook that wraps any `buildUrl` function to conditionally produce a placeholder image URL.
|
|
8
|
+
|
|
9
|
+
| Parameter | Type | Default | Description |
|
|
10
|
+
|-----------|------|---------|-------------|
|
|
11
|
+
| `buildUrl` | `(title, options) => string` | — | URL builder function (e.g. `buildOgPlaceholderUrl` from `lib/utils/entity-image.ts`) |
|
|
12
|
+
| `title` | `string \| undefined \| null` | — | Text displayed on the placeholder image |
|
|
13
|
+
| `siteName` | `string` | `''` | Optional site name shown below the title |
|
|
14
|
+
| `enabled` | `boolean` | `true` | Gates URL generation; returns `null` when `false` |
|
|
15
|
+
| `aspect` | `'wide' \| 'square'` | `'wide'` | `'wide'` = 1200×630 social card; `'square'` = 1024×1024 for compact chat-inline slots |
|
|
16
|
+
|
|
17
|
+
**Returns:** `string | null` — the generated URL, or `null` if disabled or `title` is falsy.
|
|
18
|
+
|
|
19
|
+
## Usage Example
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
import { useOgPlaceholder } from './use-og-placeholder'
|
|
23
|
+
import { buildOgPlaceholderUrl } from 'lib/utils/entity-image'
|
|
24
|
+
|
|
25
|
+
function ArticleCard({ title, site }: { title: string; site: string }) {
|
|
26
|
+
// Wide social-card placeholder (default)
|
|
27
|
+
const placeholderUrl = useOgPlaceholder(
|
|
28
|
+
buildOgPlaceholderUrl,
|
|
29
|
+
title,
|
|
30
|
+
site,
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
// Square placeholder for compact chat-inline card slots
|
|
34
|
+
const squarePlaceholder = useOgPlaceholder(
|
|
35
|
+
buildOgPlaceholderUrl,
|
|
36
|
+
title,
|
|
37
|
+
site,
|
|
38
|
+
true,
|
|
39
|
+
'square',
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<img
|
|
44
|
+
src={placeholderUrl ?? '/fallback.png'}
|
|
45
|
+
alt={title}
|
|
46
|
+
/>
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
> **Architecture note:** The hook is intentionally a thin client wrapper — the URL-building logic lives in `lib/utils/entity-image.ts` and is injected via `buildUrl`, so embedded apps can substitute their own `/api/og-placeholder` route without pulling in hub dependencies.
|
package/src/hooks/.use-toast.md
CHANGED
|
@@ -1,50 +1,51 @@
|
|
|
1
|
-
<!-- source-hash:
|
|
2
|
-
A
|
|
1
|
+
<!-- source-hash: 5d93c58eb240b757da31978ae31d869b -->
|
|
2
|
+
A composable hook and utility for displaying toast notifications, wrapping the Sonner toast library with a custom `showToast` component and normalized variant system.
|
|
3
3
|
|
|
4
4
|
## Key Components
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
| Export | Type | Description |
|
|
7
|
+
|--------|------|-------------|
|
|
8
|
+
| `ToastOptions` | Interface | Configuration options for toast notifications |
|
|
9
|
+
| `toast` | Function | Displays a toast notification; accepts a string or `ToastOptions` |
|
|
10
|
+
| `useToast` | Function | Composable returning `toast`, `dismiss`, and `promise` helpers |
|
|
11
|
+
| `normalizeVariant` | Internal | Maps `'destructive'` → `'error'` for internal variant compatibility |
|
|
12
|
+
|
|
13
|
+
### `ToastOptions` Fields
|
|
14
|
+
|
|
15
|
+
| Field | Type | Description |
|
|
16
|
+
|-------|------|-------------|
|
|
17
|
+
| `title` | `string` | Toast heading text |
|
|
18
|
+
| `description` | `string` | Optional body text |
|
|
19
|
+
| `variant` | `string` | Visual style: `default`, `success`, `destructive`, `info`, `warning`, `error` |
|
|
20
|
+
| `duration` | `number` | Display duration in milliseconds |
|
|
21
|
+
| `dismissible` | `boolean` | Whether the user can manually dismiss the toast |
|
|
9
22
|
|
|
10
23
|
## Usage Example
|
|
11
24
|
|
|
12
25
|
```typescript
|
|
13
|
-
import {
|
|
26
|
+
import { useToast, toast } from '@/hooks/use-toast'
|
|
14
27
|
|
|
15
|
-
//
|
|
28
|
+
// Direct usage
|
|
16
29
|
toast('Operation completed successfully')
|
|
17
30
|
|
|
18
|
-
// With options object
|
|
19
31
|
toast({
|
|
20
|
-
title: '
|
|
21
|
-
description: '
|
|
22
|
-
variant: '
|
|
23
|
-
duration:
|
|
32
|
+
title: 'Error',
|
|
33
|
+
description: 'Something went wrong.',
|
|
34
|
+
variant: 'destructive',
|
|
35
|
+
duration: 5000,
|
|
24
36
|
})
|
|
25
37
|
|
|
26
|
-
//
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
} catch (error) {
|
|
38
|
-
toast({
|
|
39
|
-
title: 'Error saving data',
|
|
40
|
-
description: error.message,
|
|
41
|
-
variant: 'destructive'
|
|
42
|
-
})
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return <button onClick={handleSave}>Save</button>
|
|
47
|
-
}
|
|
38
|
+
// Via composable
|
|
39
|
+
const { toast, dismiss, promise } = useToast()
|
|
40
|
+
|
|
41
|
+
toast({ title: 'Saved', variant: 'success' })
|
|
42
|
+
|
|
43
|
+
// Promise-based toast
|
|
44
|
+
promise(fetchData(), {
|
|
45
|
+
loading: 'Loading...',
|
|
46
|
+
success: 'Data loaded!',
|
|
47
|
+
error: 'Failed to load.',
|
|
48
|
+
})
|
|
48
49
|
```
|
|
49
50
|
|
|
50
|
-
The
|
|
51
|
+
> **Note:** The `'destructive'` variant is automatically normalized to `'error'` internally to align with the underlying `ToastVariant` type used by the `toaster` component.
|
|
@@ -1,64 +1,47 @@
|
|
|
1
|
-
<!-- source-hash:
|
|
2
|
-
|
|
1
|
+
<!-- source-hash: 05189ee6bb31560bd75b396ab69f4552 -->
|
|
2
|
+
Provides URL state management for REST APIs by syncing typed parameters to/from URL search params without requiring GraphQL schema introspection.
|
|
3
3
|
|
|
4
4
|
## Key Components
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
6
|
+
### Types & Interfaces
|
|
7
|
+
- **`ParamConfig<T>`** — Defines type, default value, and required flag for a single URL parameter
|
|
8
|
+
- **`ParamSchema`** — Record mapping parameter names to their `ParamConfig`
|
|
9
|
+
- **`InferParamsFromSchema<TSchema>`** — Utility type that infers the typed output shape from a schema
|
|
10
|
+
- **`InferInputParamsFromSchema<TSchema>`** — More permissive input variant allowing `null`/`undefined`
|
|
11
|
+
- **`UseApiParamsReturn<TSchema>`** — Full return type including `params`, `setParam`, `setParams`, `clearParams`, `resetParams`, and `urlSearchParams`
|
|
12
|
+
|
|
13
|
+
### Functions
|
|
14
|
+
- **`defineParamSchema<T>`** — Identity helper that preserves literal types on schema definitions
|
|
15
|
+
- **`useApiParams<TSchema>`** — Primary hook; reads, coerces, and syncs URL search params using a manual schema
|
|
16
|
+
- **`useContentStable<T>`** *(internal)* — Stabilizes object references across renders using JSON key comparison
|
|
17
|
+
- **`reuseIfShallowEqual<T>`** *(internal)* — Prevents array reference churn when content is unchanged
|
|
11
18
|
|
|
12
19
|
## Usage Example
|
|
13
20
|
|
|
14
21
|
```typescript
|
|
15
|
-
import {
|
|
22
|
+
import { defineParamSchema, useApiParams } from './use-api-params'
|
|
16
23
|
|
|
17
|
-
|
|
18
|
-
const searchSchema = defineParamSchema({
|
|
24
|
+
const schema = defineParamSchema({
|
|
19
25
|
search: { type: 'string', default: '' },
|
|
20
|
-
page:
|
|
21
|
-
tags:
|
|
22
|
-
sortBy: { type: 'string', default: 'name' }
|
|
26
|
+
page: { type: 'number', default: 1 },
|
|
27
|
+
tags: { type: 'array', default: [] },
|
|
23
28
|
})
|
|
24
29
|
|
|
25
|
-
function
|
|
26
|
-
const { params, setParam, setParams, urlSearchParams } = useApiParams(
|
|
27
|
-
|
|
28
|
-
// params is fully typed: { search: string, page: number, tags: string[], sortBy: string }
|
|
29
|
-
|
|
30
|
-
// Fetch data using URLSearchParams
|
|
31
|
-
const fetchData = async () => {
|
|
32
|
-
const response = await fetch(`/api/items?${urlSearchParams}`)
|
|
33
|
-
return response.json()
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// Type-safe parameter updates
|
|
37
|
-
const handleSearch = (query: string) => {
|
|
38
|
-
setParam('search', query)
|
|
39
|
-
setParam('page', 1) // Reset to first page
|
|
40
|
-
}
|
|
30
|
+
function ProductList() {
|
|
31
|
+
const { params, setParam, setParams, urlSearchParams } = useApiParams(schema)
|
|
41
32
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
page: 1
|
|
47
|
-
})
|
|
48
|
-
}
|
|
33
|
+
// params is fully typed: { search: string; page: number; tags: string[] }
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
fetch(`/api/products?${urlSearchParams}`)
|
|
36
|
+
}, [urlSearchParams])
|
|
49
37
|
|
|
50
38
|
return (
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
placeholder="Search..."
|
|
56
|
-
/>
|
|
57
|
-
<div>Page: {params.page}</div>
|
|
58
|
-
<div>Tags: {params.tags.join(', ')}</div>
|
|
59
|
-
</div>
|
|
39
|
+
<input
|
|
40
|
+
value={params.search}
|
|
41
|
+
onChange={e => setParam('search', e.target.value)}
|
|
42
|
+
/>
|
|
60
43
|
)
|
|
61
44
|
}
|
|
62
45
|
```
|
|
63
46
|
|
|
64
|
-
|
|
47
|
+
> **Reference stability:** Internal memoization ensures `params`, array fields, and setter callbacks keep stable references across renders unless the URL or schema content actually changes — safe to use directly in `useEffect` dependency arrays.
|
|
@@ -1,12 +1,27 @@
|
|
|
1
|
-
<!-- source-hash:
|
|
2
|
-
|
|
1
|
+
<!-- source-hash: 3c17907a5e162575a9da5189c583b2d4 -->
|
|
2
|
+
Bidirectional URL state management hook that automatically generates GraphQL-compatible variables from URL search parameters by parsing a GraphQL `DocumentNode` AST, optionally enriching it via schema introspection, and flattening nested input types into flat URL params.
|
|
3
3
|
|
|
4
4
|
## Key Components
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
| Export | Type | Description |
|
|
7
|
+
|--------|------|-------------|
|
|
8
|
+
| `useQueryParams` | Hook | Core hook — parses query AST, fetches schema, syncs URL ↔ GraphQL variables |
|
|
9
|
+
| `UseQueryParamsOptions` | Interface | Configuration: defaults, introspection endpoint/headers, param mapping, debug |
|
|
10
|
+
| `UseQueryParamsReturn` | Interface | Hook return shape: `variables`, `params`, `schema`, setters, state flags |
|
|
11
|
+
| `applyParamMapping` | Function (internal) | Remaps flattened schema keys using a custom `paramMapping` record |
|
|
12
|
+
|
|
13
|
+
### Initialization Flow
|
|
14
|
+
|
|
15
|
+
```mermaid
|
|
16
|
+
graph TD
|
|
17
|
+
A["Parse Query AST"] --> B{"skipIntrospection?"}
|
|
18
|
+
B -- No --> C["Fetch GraphQL Schema"]
|
|
19
|
+
B -- Yes --> D["Flatten Schema"]
|
|
20
|
+
C --> D
|
|
21
|
+
D --> E["Apply paramMapping"]
|
|
22
|
+
E --> F["Merge Defaults"]
|
|
23
|
+
F --> G["setSchema / setIsReady"]
|
|
24
|
+
```
|
|
10
25
|
|
|
11
26
|
## Usage Example
|
|
12
27
|
|
|
@@ -25,37 +40,26 @@ const LOGS_QUERY = gql`
|
|
|
25
40
|
`
|
|
26
41
|
|
|
27
42
|
function LogsPage() {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
43
|
+
const { variables, setParam, setParams, clearParams, resetParams, isReady } =
|
|
44
|
+
useQueryParams(LOGS_QUERY, {
|
|
45
|
+
defaultValues: { filter: { severity: ['info'] } },
|
|
46
|
+
introspectionEndpoint: 'https://api.example.com/graphql',
|
|
47
|
+
introspectionHeaders: { Authorization: 'Bearer token' },
|
|
48
|
+
debug: true,
|
|
49
|
+
})
|
|
35
50
|
|
|
36
|
-
|
|
51
|
+
const { data } = useQuery(LOGS_QUERY, { variables, skip: !isReady })
|
|
37
52
|
|
|
38
53
|
return (
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
<select
|
|
47
|
-
onChange={(e) => setParam('filter.severity', [e.target.value])}
|
|
48
|
-
>
|
|
49
|
-
<option value="info">Info</option>
|
|
50
|
-
<option value="warning">Warning</option>
|
|
51
|
-
<option value="error">Error</option>
|
|
52
|
-
</select>
|
|
53
|
-
|
|
54
|
-
{/* URL automatically updates: /logs?search=error&filter.severity=critical */}
|
|
55
|
-
{data?.logs?.map(log => <div key={log.id}>{log.message}</div>)}
|
|
56
|
-
</div>
|
|
54
|
+
<>
|
|
55
|
+
{/* URL: /logs?search=error&severity=critical */}
|
|
56
|
+
{/* variables: { search: 'error', filter: { severity: ['critical'] } } */}
|
|
57
|
+
<input onChange={e => setParam('search', e.target.value)} />
|
|
58
|
+
<button onClick={() => clearParams(['search'])}>Clear</button>
|
|
59
|
+
<button onClick={resetParams}>Reset All</button>
|
|
60
|
+
</>
|
|
57
61
|
)
|
|
58
62
|
}
|
|
59
63
|
```
|
|
60
64
|
|
|
61
|
-
|
|
65
|
+
> **Note:** Schema introspection results are cached via `introspector` — subsequent calls with the same endpoint skip the network fetch. Set `skipIntrospection: true` if your input types are shallow (no nested objects) to avoid the extra request.
|
package/src/hooks/ui/.index.md
CHANGED
|
@@ -1,40 +1,41 @@
|
|
|
1
|
-
<!-- source-hash:
|
|
2
|
-
|
|
1
|
+
<!-- source-hash: fc4a9d5f3d9a97f43016324c6310b828 -->
|
|
2
|
+
Barrel export file that re-exports all UI hooks from the hooks package, providing a single entry point for consuming hook utilities across the application.
|
|
3
3
|
|
|
4
4
|
## Key Components
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
| Hook | Description |
|
|
7
|
+
|------|-------------|
|
|
8
|
+
| `use-debounce` | Delays value updates until after a specified wait period |
|
|
9
|
+
| `use-local-storage` | Persists and retrieves state from browser local storage |
|
|
10
|
+
| `use-media-query` | Evaluates CSS media queries reactively |
|
|
11
|
+
| `use-memoized-callback` | Memoizes callback functions to prevent unnecessary re-renders |
|
|
12
|
+
| `use-onboarding-state` | Manages onboarding flow state and progress |
|
|
13
|
+
| `use-table-pagination` | Handles pagination logic for data tables |
|
|
14
|
+
| `use-throttle` | Limits function call frequency to a specified interval |
|
|
15
|
+
| `use-window-size` | Tracks browser window dimensions reactively |
|
|
16
|
+
| `use-horizontal-scrollbar` | Detects and manages horizontal scrollbar visibility |
|
|
17
|
+
| `use-image-edge-color` | Extracts dominant edge color from an image |
|
|
18
|
+
| `use-search` | Manages search input state and filtering logic |
|
|
19
|
+
| `use-auto-limit-tags` | Automatically limits visible tags based on available space |
|
|
16
20
|
|
|
17
21
|
## Usage Example
|
|
18
22
|
|
|
19
23
|
```typescript
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
return <div>...</div>
|
|
24
|
+
import {
|
|
25
|
+
useDebounce,
|
|
26
|
+
useLocalStorage,
|
|
27
|
+
useWindowSize,
|
|
28
|
+
useSearch,
|
|
29
|
+
useTablePagination,
|
|
30
|
+
} from '@your-package/hooks'
|
|
31
|
+
|
|
32
|
+
const MyComponent = () => {
|
|
33
|
+
const { width, height } = useWindowSize()
|
|
34
|
+
const [query, setQuery] = useLocalStorage('search-query', '')
|
|
35
|
+
const debouncedQuery = useDebounce(query, 300)
|
|
36
|
+
const { results } = useSearch(debouncedQuery, items)
|
|
37
|
+
const { page, pageSize, onPageChange } = useTablePagination()
|
|
38
|
+
|
|
39
|
+
return <Table data={results} page={page} pageSize={pageSize} />
|
|
37
40
|
}
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
This barrel export pattern simplifies imports and provides a clean API surface for the UI hooks library.
|
|
41
|
+
```
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<!-- source-hash: 4ddac380d848a0dcab830bec82a667f6 -->
|
|
2
|
+
Calculates how many tags fit within a single-line container using real DOM measurements, supporting both a fixed numeric limit and an automatic layout-aware mode.
|
|
3
|
+
|
|
4
|
+
## Key Components
|
|
5
|
+
|
|
6
|
+
### `useAutoLimitTags(options)`
|
|
7
|
+
Main hook that returns layout refs and the computed `visibleCount`.
|
|
8
|
+
|
|
9
|
+
**Options**
|
|
10
|
+
| Option | Type | Default | Description |
|
|
11
|
+
|---|---|---|---|
|
|
12
|
+
| `count` | `number` | — | Total number of tags |
|
|
13
|
+
| `limitTags` | `number \| "auto"` | `"auto"` | Fixed cap or DOM-measured auto mode |
|
|
14
|
+
| `placeholder` | `string` | `""` | Input placeholder used to reserve width |
|
|
15
|
+
|
|
16
|
+
**Returns (`UseAutoLimitTagsReturn`)**
|
|
17
|
+
| Ref | Element | Purpose |
|
|
18
|
+
|---|---|---|
|
|
19
|
+
| `middleRef` | `HTMLDivElement` | Container with tags + input (reads padding/gap from here) |
|
|
20
|
+
| `measureRef` | `HTMLDivElement` | Off-screen container holding copies of all tags |
|
|
21
|
+
| `textMeasureRef` | `HTMLSpanElement` | Hidden span measuring placeholder text width |
|
|
22
|
+
| `badgeRef` | `HTMLButtonElement` | The `+N` overflow badge (measures its width) |
|
|
23
|
+
| `inputRef` | `HTMLInputElement` | The text input (reads its `min-width`) |
|
|
24
|
+
| `visibleCount` | `number` | How many tags to render visibly |
|
|
25
|
+
|
|
26
|
+
## Usage Example
|
|
27
|
+
|
|
28
|
+
```typescript
|
|
29
|
+
const { visibleCount, middleRef, measureRef, textMeasureRef, badgeRef, inputRef } =
|
|
30
|
+
useAutoLimitTags({ count: tags.length, placeholder: "Search..." })
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<>
|
|
34
|
+
{/* Off-screen measurement container */}
|
|
35
|
+
<div ref={measureRef} style={{ position: "absolute", visibility: "hidden" }}>
|
|
36
|
+
{tags.map((tag) => <TagChip key={tag.id} tag={tag} />)}
|
|
37
|
+
</div>
|
|
38
|
+
<span ref={textMeasureRef} style={{ visibility: "hidden", position: "absolute" }}>
|
|
39
|
+
Search...
|
|
40
|
+
</span>
|
|
41
|
+
|
|
42
|
+
{/* Visible tag zone */}
|
|
43
|
+
<div ref={middleRef} className="flex overflow-hidden gap-1 px-2">
|
|
44
|
+
{tags.slice(0, visibleCount).map((tag) => <TagChip key={tag.id} tag={tag} />)}
|
|
45
|
+
{visibleCount < tags.length && (
|
|
46
|
+
<button ref={badgeRef}>+{tags.length - visibleCount}</button>
|
|
47
|
+
)}
|
|
48
|
+
<input ref={inputRef} placeholder="Search..." />
|
|
49
|
+
</div>
|
|
50
|
+
</>
|
|
51
|
+
)
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
> **Note:** `middleRef` must have `overflow-hidden`, explicit `gap`, and `padding` set via CSS — the hook reads these values directly with `getComputedStyle` and uses a `ResizeObserver` to recalculate on container width changes.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<!-- source-hash: 9f63d7c2dd408b85d0a130f82da97780 -->
|
|
2
|
+
Custom React hook for building a fully controlled horizontal scrollbar with drag, click-to-seek, wheel forwarding, edge-fade indicators, and RAF-throttled sync — all driven directly against the DOM without relying on native scrollbar styling.
|
|
3
|
+
|
|
4
|
+
## Key Components
|
|
5
|
+
|
|
6
|
+
| Export | Type | Description |
|
|
7
|
+
|--------|------|-------------|
|
|
8
|
+
| `useHorizontalScrollbar` | Hook | Main hook returning all refs, state, and event handlers |
|
|
9
|
+
| `scrollRef` | Callback ref | Attach to the scrollable container; auto-sets up `ResizeObserver` |
|
|
10
|
+
| `trackRef` | `RefObject<HTMLDivElement>` | Attach to the scrollbar track element |
|
|
11
|
+
| `thumbRef` | `RefObject<HTMLDivElement>` | Attach to the draggable thumb element |
|
|
12
|
+
| `thumbRatio` | `number` | Thumb width as a fraction of track width (`0` = hidden) |
|
|
13
|
+
| `canScrollLeft` | `boolean` | Whether content can scroll further left (for edge fades) |
|
|
14
|
+
| `canScrollRight` | `boolean` | Whether content can scroll further right (for edge fades) |
|
|
15
|
+
|
|
16
|
+
**Event Handlers Returned:**
|
|
17
|
+
|
|
18
|
+
| Handler | Attach To |
|
|
19
|
+
|---------|-----------|
|
|
20
|
+
| `onScroll` | Scrollable container `onScroll` |
|
|
21
|
+
| `onTrackClick` | Track element `onClick` |
|
|
22
|
+
| `onTrackWheel` | Track element `onWheel` |
|
|
23
|
+
| `onThumbPointerDown` | Thumb `onPointerDown` |
|
|
24
|
+
| `onThumbPointerMove` | Thumb `onPointerMove` |
|
|
25
|
+
| `onThumbPointerUp` | Thumb `onPointerUp` |
|
|
26
|
+
|
|
27
|
+
## Usage Example
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
import { useHorizontalScrollbar } from './use-horizontal-scrollbar'
|
|
31
|
+
|
|
32
|
+
function ScrollableTable() {
|
|
33
|
+
const {
|
|
34
|
+
scrollRef, trackRef, thumbRef,
|
|
35
|
+
thumbRatio, canScrollLeft, canScrollRight,
|
|
36
|
+
onScroll, onTrackClick, onTrackWheel,
|
|
37
|
+
onThumbPointerDown, onThumbPointerMove, onThumbPointerUp,
|
|
38
|
+
} = useHorizontalScrollbar()
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<div>
|
|
42
|
+
{canScrollLeft && <div className="fade-left" />}
|
|
43
|
+
|
|
44
|
+
{/* Scrollable content */}
|
|
45
|
+
<div ref={scrollRef} onScroll={onScroll} style={{ overflowX: 'auto' }}>
|
|
46
|
+
<table>{/* wide content */}</table>
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
{canScrollRight && <div className="fade-right" />}
|
|
50
|
+
|
|
51
|
+
{/* Custom scrollbar */}
|
|
52
|
+
{thumbRatio > 0 && (
|
|
53
|
+
<div
|
|
54
|
+
ref={trackRef}
|
|
55
|
+
onClick={onTrackClick}
|
|
56
|
+
onWheel={onTrackWheel}
|
|
57
|
+
style={{ position: 'relative', height: 8 }}
|
|
58
|
+
>
|
|
59
|
+
<div
|
|
60
|
+
ref={thumbRef}
|
|
61
|
+
data-scrollbar-thumb
|
|
62
|
+
onPointerDown={onThumbPointerDown}
|
|
63
|
+
onPointerMove={onThumbPointerMove}
|
|
64
|
+
onPointerUp={onThumbPointerUp}
|
|
65
|
+
style={{ position: 'absolute', width: `${thumbRatio * 100}%`, cursor: 'grab' }}
|
|
66
|
+
/>
|
|
67
|
+
</div>
|
|
68
|
+
)}
|
|
69
|
+
</div>
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
> **Performance note:** Thumb position is written directly to `thumb.style.left` via `requestAnimationFrame`, bypassing React re-renders on every scroll event. Only `thumbRatio`, `canScrollLeft`, and `canScrollRight` trigger state updates.
|