@espressif/dashboard-ui-components 1.11.2 → 1.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/.claude/rules/dashboard-ui-consumption.md +176 -5
- package/.cursor/rules/dashboard-ui-consumption.mdc +163 -4
- package/CHANGELOG.md +1005 -0
- package/README.md +240 -7
- package/THIRD-PARTY-NOTICES.md +2 -1
- package/dist/alert.props-CcKo49Rb.d.ts +44 -0
- package/dist/animation/index.d.ts +3 -0
- package/dist/animation/index.js +3 -0
- package/dist/avatar.props-2q5BsX-R.d.ts +29 -0
- package/dist/button-BK-DIR_L.d.ts +21 -0
- package/dist/button-BxJ7s6sR.d.ts +76 -0
- package/dist/calendar.props-BtCzuWH1.d.ts +12 -0
- package/dist/carousel/index.d.ts +2 -0
- package/dist/carousel/index.js +2 -0
- package/dist/charts/index.d.ts +5 -0
- package/dist/charts/index.js +9 -0
- package/dist/common/app-logo/app-logo.js +1 -1
- package/dist/common/index.d.ts +9 -20
- package/dist/common/my-account-menu/my-account-menu.js +45 -13
- package/dist/common/profile-card/profile-card.js +3 -2
- package/dist/components/accordion/accordion.js +14 -5
- package/dist/components/accordion/index.d.ts +36 -0
- package/dist/components/accordion/index.js +2 -0
- package/dist/components/advanced-search-box/advanced-search-box.js +8 -2
- package/dist/components/advanced-search-box/index.d.ts +29 -0
- package/dist/components/advanced-search-box/index.js +2 -0
- package/dist/components/alert/alert.js +2 -1
- package/dist/components/alert/index.d.ts +12 -0
- package/dist/components/alert/index.js +2 -0
- package/dist/components/anchored-panel/anchored-panel.js +83 -0
- package/dist/components/anchored-panel/index.d.ts +31 -0
- package/dist/components/anchored-panel/index.js +2 -0
- package/dist/components/animated-containers/index.d.ts +13 -0
- package/dist/components/animated-containers/index.js +2 -0
- package/dist/components/async-multi-select/async-multi-select.js +48 -7
- package/dist/components/async-multi-select/index.d.ts +63 -0
- package/dist/components/async-multi-select/index.js +2 -0
- package/dist/components/avatar/avatar.js +11 -4
- package/dist/components/avatar/index.d.ts +8 -0
- package/dist/components/avatar/index.js +2 -0
- package/dist/components/avatar-group/avatar-group.js +35 -0
- package/dist/components/avatar-group/index.d.ts +31 -0
- package/dist/components/avatar-group/index.js +2 -0
- package/dist/components/badge/index.d.ts +14 -0
- package/dist/components/badge/index.js +2 -0
- package/dist/components/breadcrumb/index.d.ts +21 -0
- package/dist/components/breadcrumb/index.js +2 -0
- package/dist/components/bubble/bubble.js +18 -0
- package/dist/components/bubble/index.d.ts +19 -0
- package/dist/components/bubble/index.js +2 -0
- package/dist/components/button/button.js +87 -25
- package/dist/components/button/flash-button.js +9 -3
- package/dist/components/button/index.d.ts +56 -0
- package/dist/components/button/index.js +6 -0
- package/dist/components/button-group/index.d.ts +16 -0
- package/dist/components/button-group/index.js +2 -0
- package/dist/components/calendar/calendar.js +5 -5
- package/dist/components/calendar/index.d.ts +11 -0
- package/dist/components/calendar/index.js +2 -0
- package/dist/components/card/index.d.ts +11 -0
- package/dist/components/card/index.js +2 -0
- package/dist/components/card-rail/card-rail.js +50 -0
- package/dist/components/card-rail/index.d.ts +30 -0
- package/dist/components/card-rail/index.js +2 -0
- package/dist/components/cards/collapsible-card.js +5 -2
- package/dist/components/cards/index.d.ts +16200 -0
- package/dist/components/cards/index.js +8 -0
- package/dist/components/cards/section-card.js +133 -8
- package/dist/components/cards/simple-card.js +5 -2
- package/dist/components/carousel/carousel.js +137 -49
- package/dist/components/carousel/index.d.ts +130 -0
- package/dist/components/carousel/index.js +2 -0
- package/dist/components/category-card/category-card.js +111 -0
- package/dist/components/category-card/index.d.ts +55 -0
- package/dist/components/category-card/index.js +2 -0
- package/dist/components/chart/area-chart.js +95 -85
- package/dist/components/chart/bar-chart.js +123 -60
- package/dist/components/chart/chart.js +127 -3
- package/dist/components/chart/composed-chart.js +109 -98
- package/dist/components/chart/donut-chart.js +23 -5
- package/dist/components/chart/index.d.ts +732 -0
- package/dist/components/chart/index.js +9 -0
- package/dist/components/chart/line-chart.js +93 -83
- package/dist/components/chart/treemap-chart.js +71 -58
- package/dist/components/check-badge/check-badge.js +25 -0
- package/dist/components/check-badge/index.d.ts +13 -0
- package/dist/components/check-badge/index.js +2 -0
- package/dist/components/checkbox/index.d.ts +8 -0
- package/dist/components/checkbox/index.js +2 -0
- package/dist/components/choice-card/choice-card.js +99 -0
- package/dist/components/choice-card/index.d.ts +41 -0
- package/dist/components/choice-card/index.js +2 -0
- package/dist/components/circular-progress/circular-progress.js +5 -2
- package/dist/components/circular-progress/index.d.ts +23 -0
- package/dist/components/circular-progress/index.js +2 -0
- package/dist/components/code/index.d.ts +40 -0
- package/dist/components/code/index.js +2 -0
- package/dist/components/code-editor/code-editor.js +9 -3
- package/dist/components/code-editor/index.d.ts +82 -0
- package/dist/components/code-editor/index.js +2 -0
- package/dist/components/collapsible/index.d.ts +42 -0
- package/dist/components/collapsible/index.js +2 -0
- package/dist/components/column-panel/column-panel.js +38 -0
- package/dist/components/column-panel/index.d.ts +37 -0
- package/dist/components/column-panel/index.js +3 -0
- package/dist/components/column-panel/use-panel-flag.js +27 -0
- package/dist/components/combobox/index.d.ts +28 -0
- package/dist/components/combobox/index.js +2 -0
- package/dist/components/confirmation-dialog/confirmation-dialog.js +1 -1
- package/dist/components/confirmation-dialog/index.d.ts +40 -0
- package/dist/components/confirmation-dialog/index.js +3 -0
- package/dist/components/content-container/index.d.ts +16 -0
- package/dist/components/content-container/index.js +2 -0
- package/dist/components/copiable-text/index.d.ts +33 -0
- package/dist/components/copiable-text/index.js +2 -0
- package/dist/components/coverflow/_constants/coverflow-poses.js +23 -0
- package/dist/components/coverflow/_constants/coverflow-shapes.js +23 -0
- package/dist/components/coverflow/_hooks/use-coverflow.js +90 -0
- package/dist/components/coverflow/_utils/ring.js +24 -0
- package/dist/components/coverflow/coverflow.js +198 -0
- package/dist/components/coverflow/index.d.ts +105 -0
- package/dist/components/coverflow/index.js +2 -0
- package/dist/components/data-table/data-table.js +9 -2
- package/dist/components/data-table/index.d.ts +120 -0
- package/dist/components/data-table/index.js +3 -0
- package/dist/components/date-picker/date-picker.js +5 -2
- package/dist/components/date-picker/index.d.ts +50 -0
- package/dist/components/date-picker/index.js +2 -0
- package/dist/components/date-range-picker/date-range-picker.js +11 -2
- package/dist/components/date-range-picker/index.d.ts +100 -0
- package/dist/components/date-range-picker/index.js +3 -0
- package/dist/components/date-time-picker/date-time-picker.js +5 -2
- package/dist/components/date-time-picker/index.d.ts +79 -0
- package/dist/components/date-time-picker/index.js +2 -0
- package/dist/components/device-icon/index.d.ts +17 -0
- package/dist/components/device-icon/index.js +2 -0
- package/dist/components/dialog/index.d.ts +38 -0
- package/dist/components/dialog/index.js +2 -0
- package/dist/components/dropdown-menu/index.d.ts +57 -0
- package/dist/components/dropdown-menu/index.js +2 -0
- package/dist/components/dynamic-list/dynamic-list.js +4 -4
- package/dist/components/dynamic-list/index.d.ts +74 -0
- package/dist/components/dynamic-list/index.js +2 -0
- package/dist/components/error-display/index.d.ts +17 -0
- package/dist/components/error-display/index.js +3 -0
- package/dist/components/expandable-text/expandable-text-overlay.js +78 -0
- package/dist/components/expandable-text/expandable-text.js +73 -0
- package/dist/components/expandable-text/index.d.ts +39 -0
- package/dist/components/expandable-text/index.js +2 -0
- package/dist/components/expandable-text/use-clamped.js +23 -0
- package/dist/components/facet-filters/_hooks/use-filter-group.js +51 -0
- package/dist/components/facet-filters/active-filters.js +31 -0
- package/dist/components/facet-filters/filter-group.js +110 -0
- package/dist/components/facet-filters/filters-panel.js +59 -0
- package/dist/components/facet-filters/filters-pill.js +40 -0
- package/dist/components/facet-filters/index.d.ts +104 -0
- package/dist/components/facet-filters/index.js +6 -0
- package/dist/components/facet-filters/use-filters-collapsed.js +21 -0
- package/dist/components/feature-grid/feature-grid.js +115 -0
- package/dist/components/feature-grid/index.d.ts +53 -0
- package/dist/components/feature-grid/index.js +2 -0
- package/dist/components/file-input/file-input.js +9 -3
- package/dist/components/file-input/index.d.ts +78 -0
- package/dist/components/file-input/index.js +2 -0
- package/dist/components/file-upload/file-upload.js +10 -5
- package/dist/components/file-upload/index.d.ts +38 -0
- package/dist/components/file-upload/index.js +2 -0
- package/dist/components/filters-bar/filters-bar.js +5 -1
- package/dist/components/filters-bar/index.d.ts +26 -0
- package/dist/components/filters-bar/index.js +2 -0
- package/dist/components/flip-card/flip-card.js +147 -0
- package/dist/components/flip-card/index.d.ts +43 -0
- package/dist/components/flip-card/index.js +2 -0
- package/dist/components/floating-window/_hooks/use-drag-move.js +76 -0
- package/dist/components/floating-window/floating-window.js +97 -0
- package/dist/components/floating-window/index.d.ts +45 -0
- package/dist/components/floating-window/index.js +2 -0
- package/dist/components/form/index.d.ts +28 -0
- package/dist/components/form/index.js +2 -0
- package/dist/components/fullscreen-dialog/fullscreen-dialog.js +6 -2
- package/dist/components/fullscreen-dialog/index.d.ts +38 -0
- package/dist/components/fullscreen-dialog/index.js +2 -0
- package/dist/components/horizontal-stepper/horizontal-stepper.js +122 -0
- package/dist/components/horizontal-stepper/index.d.ts +70 -0
- package/dist/components/horizontal-stepper/index.js +2 -0
- package/dist/components/icon-avatar/index.d.ts +9 -0
- package/dist/components/icon-avatar/index.js +2 -0
- package/dist/components/icon-text-action-card/icon-text-action-card.js +9 -5
- package/dist/components/icon-text-action-card/index.d.ts +11 -0
- package/dist/components/icon-text-action-card/index.js +2 -0
- package/dist/components/identicon/identicon.js +33 -0
- package/dist/components/identicon/index.d.ts +26 -0
- package/dist/components/identicon/index.js +2 -0
- package/dist/components/illustration/index.d.ts +37 -0
- package/dist/components/illustration/index.js +3 -0
- package/dist/components/index.d.ts +177 -19529
- package/dist/components/index.js +61 -10
- package/dist/components/input/index.d.ts +15 -0
- package/dist/components/input/index.js +3 -0
- package/dist/components/input-group/index.d.ts +35 -0
- package/dist/components/input-group/index.js +2 -0
- package/dist/components/input-group/input-group.js +41 -0
- package/dist/components/input-otp/index.d.ts +63 -0
- package/dist/components/input-otp/index.js +2 -0
- package/dist/components/key-value-manager/index.d.ts +63 -0
- package/dist/components/key-value-manager/index.js +2 -0
- package/dist/components/key-value-manager/key-value-manager-table.js +7 -5
- package/dist/components/label/index.d.ts +8 -0
- package/dist/components/label/index.js +2 -0
- package/dist/components/link/index.d.ts +33 -0
- package/dist/components/link/index.js +2 -0
- package/dist/components/list/index.d.ts +9 -0
- package/dist/components/list/index.js +3 -0
- package/dist/components/list/list-item.utils.js +1 -1
- package/dist/components/list/list.js +3 -1
- package/dist/components/list-details/index.d.ts +51 -0
- package/dist/components/list-details/index.js +2 -0
- package/dist/components/list-details/list-details.js +5 -2
- package/dist/components/lottie-animation-container/index.d.ts +10 -0
- package/dist/components/lottie-animation-container/index.js +2 -0
- package/dist/components/lottie-animation-container/lottie-animation-container.js +22 -3
- package/dist/components/lottie-animations/index.d.ts +8 -0
- package/dist/components/lottie-animations/index.js +2 -0
- package/dist/components/markdown-content/index.d.ts +32 -0
- package/dist/components/markdown-content/index.js +2 -0
- package/dist/components/media-card/index.d.ts +125 -0
- package/dist/components/media-card/index.js +4 -0
- package/dist/components/media-card/media-card-image.js +59 -0
- package/dist/components/media-card/media-card-reveal.js +76 -0
- package/dist/components/media-card/media-card.classes.js +37 -0
- package/dist/components/media-card/media-card.js +91 -0
- package/dist/components/media-stage/index.d.ts +41 -0
- package/dist/components/media-stage/index.js +2 -0
- package/dist/components/media-stage/media-stage.js +48 -0
- package/dist/components/menu/index.d.ts +14 -0
- package/dist/components/menu/index.js +2 -0
- package/dist/components/message-scroller/_hooks/use-follow-bottom.js +85 -0
- package/dist/components/message-scroller/index.d.ts +29 -0
- package/dist/components/message-scroller/index.js +2 -0
- package/dist/components/message-scroller/message-scroller.js +65 -0
- package/dist/components/mini-bar-chart/index.d.ts +40 -0
- package/dist/components/mini-bar-chart/index.js +2 -0
- package/dist/components/mini-bar-chart/mini-bar-chart.js +93 -0
- package/dist/components/monospace-content/index.d.ts +43 -0
- package/dist/components/monospace-content/index.js +2 -0
- package/dist/components/monospace-content/monospace-content.js +1 -1
- package/dist/components/nav-bar/index.d.ts +148 -0
- package/dist/components/nav-bar/index.js +2 -0
- package/dist/components/nav-bar/nav-bar-details-panel.js +158 -44
- package/dist/components/nav-bar/nav-bar-mobile-menu.js +93 -27
- package/dist/components/nav-bar/nav-bar.js +256 -138
- package/dist/components/nav-bar/use-nav-bar-hover-details.js +80 -0
- package/dist/components/nav-bar/use-nav-bar-overflow.js +5 -5
- package/dist/components/notice-strip/index.d.ts +32 -0
- package/dist/components/notice-strip/index.js +2 -0
- package/dist/components/notice-strip/notice-strip.js +57 -0
- package/dist/components/option-card-group/index.d.ts +50 -0
- package/dist/components/option-card-group/index.js +2 -0
- package/dist/components/option-card-group/option-card-group.js +76 -0
- package/dist/components/overflow-badge-list/index.d.ts +63 -0
- package/dist/components/overflow-badge-list/index.js +2 -0
- package/dist/components/overflow-badge-list/overflow-badge-list.js +78 -19
- package/dist/components/page-banner/index.d.ts +33 -0
- package/dist/components/page-banner/index.js +2 -0
- package/dist/components/page-banner/page-banner.js +56 -0
- package/dist/components/page-container/index.d.ts +20 -0
- package/dist/components/page-container/index.js +3 -0
- package/dist/components/page-container/page-container.js +5 -5
- package/dist/components/pagination/index.d.ts +31 -0
- package/dist/components/pagination/index.js +3 -0
- package/dist/components/popover/index.d.ts +60 -0
- package/dist/components/popover/index.js +3 -0
- package/dist/components/preview-card/index.d.ts +24 -0
- package/dist/components/preview-card/index.js +2 -0
- package/dist/components/progress-bar/index.d.ts +32 -0
- package/dist/components/progress-bar/index.js +2 -0
- package/dist/components/progress-bar/progress-bar.js +22 -6
- package/dist/components/radio-group/index.d.ts +24 -0
- package/dist/components/radio-group/index.js +2 -0
- package/dist/components/rank-numeral/index.d.ts +30 -0
- package/dist/components/rank-numeral/index.js +2 -0
- package/dist/components/rank-numeral/rank-numeral.js +26 -0
- package/dist/components/reaction-button/index.d.ts +32 -0
- package/dist/components/reaction-button/index.js +2 -0
- package/dist/components/reaction-button/reaction-button.js +50 -0
- package/dist/components/readout/index.d.ts +31 -0
- package/dist/components/readout/index.js +2 -0
- package/dist/components/readout/readout.js +63 -0
- package/dist/components/requirement-list/index.d.ts +52 -0
- package/dist/components/requirement-list/index.js +2 -0
- package/dist/components/requirement-list/requirement-list.js +29 -8
- package/dist/components/resizable/index.d.ts +31 -0
- package/dist/components/resizable/index.js +4 -0
- package/dist/components/resizable/resizable-group.js +23 -0
- package/dist/components/resizable/resizable-panel.js +28 -0
- package/dist/components/resizable/resizable-separator.js +24 -0
- package/dist/components/reveal/index.d.ts +23 -0
- package/dist/components/reveal/index.js +2 -0
- package/dist/components/reveal/reveal.js +24 -0
- package/dist/components/scroll-area/index.d.ts +27 -0
- package/dist/components/scroll-area/index.js +2 -0
- package/dist/components/scrollable-sections/index.d.ts +58 -0
- package/dist/components/scrollable-sections/index.js +2 -0
- package/dist/components/scrollable-sections/scrollable-sections.js +11 -3
- package/dist/components/search-box/index.d.ts +32 -0
- package/dist/components/search-box/index.js +2 -0
- package/dist/components/search-box/search-box.js +18 -3
- package/dist/components/search-field-shell.js +1 -1
- package/dist/components/select/index.d.ts +44 -0
- package/dist/components/select/index.js +2 -0
- package/dist/components/selectable-card-list/checkbox-card-list.js +5 -3
- package/dist/components/selectable-card-list/index.d.ts +76 -0
- package/dist/components/selectable-card-list/index.js +2 -0
- package/dist/components/selectable-card-list/radio-card-list.js +12 -6
- package/dist/components/selectable-card-list/selectable-card-list-shared.js +24 -12
- package/dist/components/selectable-card-list/selectable-card-list.js +12 -3
- package/dist/components/separator/index.d.ts +24 -0
- package/dist/components/separator/index.js +2 -0
- package/dist/components/share-menu/index.d.ts +55 -0
- package/dist/components/share-menu/index.js +2 -0
- package/dist/components/share-menu/share-marks.js +31 -0
- package/dist/components/share-menu/share-menu.js +140 -0
- package/dist/components/share-menu/share-urls.js +15 -0
- package/dist/components/sheet/index.d.ts +41 -0
- package/dist/components/sheet/index.js +2 -0
- package/dist/components/showcase-card/index.d.ts +53 -0
- package/dist/components/showcase-card/index.js +2 -0
- package/dist/components/showcase-card/showcase-card.js +75 -0
- package/dist/components/sidebar/index.d.ts +109 -0
- package/dist/components/sidebar/index.js +4 -0
- package/dist/components/sidebar/sidebar.js +56 -40
- package/dist/components/simple-clickable-card/index.d.ts +11 -0
- package/dist/components/simple-clickable-card/index.js +2 -0
- package/dist/components/simple-clickable-card/simple-clickable-card-shared.js +2 -2
- package/dist/components/simple-clickable-card/simple-clickable-card.js +5 -2
- package/dist/components/simple-info-card/index.d.ts +25 -0
- package/dist/components/simple-info-card/index.js +2 -0
- package/dist/components/simple-info-card/simple-info-card.js +6 -3
- package/dist/components/simple-list/index.d.ts +63 -0
- package/dist/components/simple-list/index.js +2 -0
- package/dist/components/simple-list/simple-list.js +3 -1
- package/dist/components/simple-paginated-list/index.d.ts +20 -0
- package/dist/components/simple-paginated-list/index.js +2 -0
- package/dist/components/simplified-date/index.d.ts +18 -0
- package/dist/components/simplified-date/index.js +2 -0
- package/dist/components/skeleton/index.d.ts +5 -0
- package/dist/components/skeleton/index.js +2 -0
- package/dist/components/skeletons/index.d.ts +11 -0
- package/dist/components/skeletons/index.js +2 -0
- package/dist/components/sort-menu/index.d.ts +34 -0
- package/dist/components/sort-menu/index.js +2 -0
- package/dist/components/sort-menu/sort-menu.js +39 -0
- package/dist/components/spinner/index.d.ts +15 -0
- package/dist/components/spinner/index.js +2 -0
- package/dist/components/stat-card/index.d.ts +43 -0
- package/dist/components/stat-card/index.js +2 -0
- package/dist/components/stat-card/stat-card.js +31 -12
- package/dist/components/status-badge/index.d.ts +24 -0
- package/dist/components/status-badge/index.js +2 -0
- package/dist/components/status-badge/status-badge.js +3 -2
- package/dist/components/status-card-list/index.d.ts +24 -0
- package/dist/components/status-card-list/index.js +2 -0
- package/dist/components/status-card-list/status-card-list.js +8 -4
- package/dist/components/step-tabs/index.d.ts +94 -0
- package/dist/components/step-tabs/index.js +2 -0
- package/dist/components/step-tabs/step-tabs.js +202 -0
- package/dist/components/style-scope/index.d.ts +32 -0
- package/dist/components/style-scope/index.js +2 -0
- package/dist/components/style-scope/style-scope.js +49 -0
- package/dist/components/switch/index.d.ts +15 -0
- package/dist/components/switch/index.js +2 -0
- package/dist/components/table/index.d.ts +18 -0
- package/dist/components/table/index.js +2 -0
- package/dist/components/tabs/index.d.ts +103 -0
- package/dist/components/tabs/index.js +2 -0
- package/dist/components/tag/index.d.ts +31 -0
- package/dist/components/tag/index.js +2 -0
- package/dist/components/tag/tag.js +79 -28
- package/dist/components/tag-input/index.d.ts +36 -0
- package/dist/components/tag-input/index.js +2 -0
- package/dist/components/tag-input/tag-input.js +10 -4
- package/dist/components/text-effects/index.d.ts +53 -0
- package/dist/components/text-effects/index.js +6 -0
- package/dist/components/textarea/index.d.ts +16 -0
- package/dist/components/textarea/index.js +2 -0
- package/dist/components/thumbnail-strip/index.d.ts +42 -0
- package/dist/components/thumbnail-strip/index.js +2 -0
- package/dist/components/thumbnail-strip/thumbnail-strip.js +124 -0
- package/dist/components/thumbnail-strip/use-scroll-edges.js +41 -0
- package/dist/components/time-picker/index.d.ts +13 -0
- package/dist/components/time-picker/index.js +2 -0
- package/dist/components/timeline/index.d.ts +39 -0
- package/dist/components/timeline/index.js +2 -0
- package/dist/components/timeline/timeline.js +85 -0
- package/dist/components/toast/index.d.ts +56 -0
- package/dist/components/toast/index.js +2 -0
- package/dist/components/toast/toast.js +42 -32
- package/dist/components/togglable-items-list/index.d.ts +28 -0
- package/dist/components/togglable-items-list/index.js +2 -0
- package/dist/components/toggle-group/index.d.ts +35 -0
- package/dist/components/toggle-group/index.js +2 -0
- package/dist/components/toolbar/index.d.ts +58 -0
- package/dist/components/toolbar/index.js +3 -0
- package/dist/components/toolbar/toolbar-button.js +40 -0
- package/dist/components/toolbar/toolbar.js +56 -0
- package/dist/components/tooltip/index.d.ts +29 -0
- package/dist/components/tooltip/index.js +3 -0
- package/dist/components/tooltip/tooltip.js +12 -2
- package/dist/components/transfer-list/index.d.ts +36 -0
- package/dist/components/transfer-list/index.js +2 -0
- package/dist/components/transfer-list/transfer-list.js +1 -1
- package/dist/components/truncated-line-with-tooltip/index.d.ts +22 -0
- package/dist/components/truncated-line-with-tooltip/index.js +2 -0
- package/dist/components/truncated-line-with-tooltip/truncated-line-with-tooltip.js +26 -8
- package/dist/components/typography/index.d.ts +19 -0
- package/dist/components/typography/index.js +3 -0
- package/dist/components/use-mobile/index.d.ts +3 -0
- package/dist/components/use-mobile/index.js +2 -0
- package/dist/components/user-type-badge/index.d.ts +39 -0
- package/dist/components/user-type-badge/index.js +3 -0
- package/dist/components/user-type-badge/user-type-badge.js +2 -1
- package/dist/components/vertical-stepper/index.d.ts +7 -0
- package/dist/components/vertical-stepper/index.js +2 -0
- package/dist/components/vertical-stepper/vertical-stepper.js +33 -6
- package/dist/components/view-toggle/index.d.ts +38 -0
- package/dist/components/view-toggle/index.js +2 -0
- package/dist/components/view-toggle/view-toggle.js +56 -0
- package/dist/core/animate-ui/components/animate/code.js +83 -9
- package/dist/core/animate-ui/components/animate/tabs.js +234 -19
- package/dist/core/animate-ui/components/animate/tooltip.js +10 -2
- package/dist/core/animate-ui/components/base/preview-card.js +20 -3
- package/dist/core/animate-ui/components/buttons/copy.js +12 -6
- package/dist/core/animate-ui/components/radix/dialog.js +17 -3
- package/dist/core/animate-ui/components/radix/dropdown-menu.js +26 -9
- package/dist/core/animate-ui/components/radix/sheet.js +20 -4
- package/dist/core/animate-ui/components/radix/sidebar.js +9 -9
- package/dist/core/animate-ui/components/radix/toggle-group.js +103 -13
- package/dist/core/animate-ui/components/radix/toggle.js +5 -5
- package/dist/core/animate-ui/primitives/animate/code-block.js +31 -4
- package/dist/core/animate-ui/primitives/animate/shiki-highlighter.js +5 -2
- package/dist/core/animate-ui/primitives/animate/tabs.js +7 -4
- package/dist/core/animate-ui/primitives/animate/tooltip.js +10 -3
- package/dist/core/animate-ui/primitives/base/preview-card.js +2 -2
- package/dist/core/animate-ui/primitives/base/progress.js +1 -1
- package/dist/core/animate-ui/primitives/base/radio.js +3 -3
- package/dist/core/animate-ui/primitives/effects/highlight.js +1 -0
- package/dist/core/animate-ui/primitives/radix/accordion.js +1 -1
- package/dist/core/animate-ui/primitives/radix/dialog.js +6 -3
- package/dist/core/animate-ui/primitives/radix/dropdown-menu.js +2 -2
- package/dist/core/animate-ui/primitives/radix/sheet.js +7 -3
- package/dist/core/animate-ui/primitives/radix/switch.js +2 -2
- package/dist/core/animate-ui/primitives/radix/toggle-group.js +2 -2
- package/dist/core/badge.js +5 -2
- package/dist/core/breadcrumb.js +1 -1
- package/dist/core/button/button.js +8 -8
- package/dist/core/button/craft-button.js +8 -2
- package/dist/core/button.js +17 -7
- package/dist/core/card.js +23 -5
- package/dist/core/combobox/combobox.js +8 -2
- package/dist/core/command.js +3 -3
- package/dist/core/form.js +1 -1
- package/dist/core/hooks/use-nested-layer-press-guard.js +46 -0
- package/dist/core/hooks/use-on-screen.js +33 -0
- package/dist/core/hooks/use-prefers-reduced-motion.js +19 -0
- package/dist/core/hooks/use-scroll-overflow.js +20 -0
- package/dist/core/index.d.ts +30 -5
- package/dist/core/index.js +5 -2
- package/dist/core/input/input-password.js +13 -9
- package/dist/core/input/input.js +38 -12
- package/dist/core/input-otp/input-otp.js +9 -5
- package/dist/core/popover-group.js +48 -0
- package/dist/core/popover-hover.js +127 -0
- package/dist/core/popover.js +75 -6
- package/dist/core/select.js +35 -20
- package/dist/core/table.js +5 -3
- package/dist/core/textarea/textarea.js +11 -3
- package/dist/data-table/index.d.ts +4 -0
- package/dist/data-table/index.js +3 -0
- package/dist/date/index.d.ts +11 -0
- package/dist/date/index.js +7 -0
- package/dist/forms/index.d.ts +4 -0
- package/dist/forms/index.js +2 -0
- package/dist/icon-avatar.props-RYtw2eSW.d.ts +31 -0
- package/dist/icon-text-action-card.props-B2ggncUK.d.ts +53 -0
- package/dist/index.d.ts +169 -15
- package/dist/index.js +63 -10
- package/dist/input-CYI1hhGc.d.ts +38 -0
- package/dist/layouts/index.d.ts +132 -8
- package/dist/layouts/index.js +3 -1
- package/dist/layouts/minimal-workspace-layout/minimal-workspace-layout-context.js +5 -0
- package/dist/layouts/minimal-workspace-layout/minimal-workspace-layout.js +404 -0
- package/dist/layouts/minimal-workspace-layout/rail-logo.js +90 -0
- package/dist/layouts/minimal-workspace-layout/sidebar-trigger.js +42 -0
- package/dist/layouts/shared/account-menu-props.js +21 -0
- package/dist/layouts/shared/footer-branding.js +34 -0
- package/dist/layouts/shared/sidebar-logo.js +59 -0
- package/dist/layouts/workspace-layout/account-menu/account-menu.js +9 -3
- package/dist/layouts/workspace-layout/footer/footer.js +1 -1
- package/dist/layouts/workspace-layout/header/header.js +1 -1
- package/dist/layouts/workspace-layout/workspace-layout.js +28 -80
- package/dist/{list.props-x1j3CbcF.d.ts → list.props-DP_xPTqU.d.ts} +2 -1
- package/dist/markdown/index.d.ts +11 -0
- package/dist/markdown/index.js +5 -0
- package/dist/my-account-menu.props-C7DK71WC.d.ts +67 -0
- package/dist/page-container.props-JutTvKFq.d.ts +48 -0
- package/dist/resizable.props-RxFY5tm_.d.ts +44 -0
- package/dist/section-card-B7c5uc08.d.ts +84 -0
- package/dist/simple-clickable-card.props-BrPCw7CR.d.ts +51 -0
- package/dist/slot-DGErA9zi.d.ts +10 -0
- package/dist/status-badge.props-lKlEOfRt.d.ts +32 -0
- package/dist/style-axes-DSQ2DGc5.d.ts +133 -0
- package/dist/toast/index.d.ts +6 -0
- package/dist/toast/index.js +2 -0
- package/dist/tooltip-C0bYa8a3.d.ts +37 -0
- package/dist/{types-DtUxK-Am.d.ts → types-CkXflqg7.d.ts} +31 -1
- package/dist/utils/cn.js +6 -1
- package/dist/utils/color.js +35 -10
- package/dist/utils/index.d.ts +18 -2
- package/dist/utils/index.js +4 -1
- package/dist/utils/silver-shine.js +16 -1
- package/dist/utils/style-axes.js +227 -0
- package/dist/utils/variant.js +104 -8
- package/dist/utils/view-transition.js +21 -0
- package/dist/variant-D81RhpbR.d.ts +104 -0
- package/dist/vertical-stepper.props-BXYcbW70.d.ts +29 -0
- package/package.json +52 -6
- package/src/styles/colors.css +100 -4
- package/src/styles/globals.css +8 -131
- package/src/styles/style-axes.css +21 -0
- package/src/styles/theme.css +696 -0
- package/dist/app-logo.props-Ct7QBdTd.d.ts +0 -40
- package/dist/popover-ByLD3-Qv.d.ts +0 -204
|
@@ -6,13 +6,13 @@ import { Button } from "../../core/button.js";
|
|
|
6
6
|
import { useIsMobile } from "../../core/hooks/use-mobile.js";
|
|
7
7
|
import { useNavBarOverflow } from "./use-nav-bar-overflow.js";
|
|
8
8
|
import { useNavBarScroll } from "./use-nav-bar-scroll.js";
|
|
9
|
+
import { useNavBarHoverDetails } from "./use-nav-bar-hover-details.js";
|
|
9
10
|
import { NavBarDetailsPanel } from "./nav-bar-details-panel.js";
|
|
10
11
|
import { NavBarMobileMenu } from "./nav-bar-mobile-menu.js";
|
|
11
12
|
import * as React$1 from "react";
|
|
12
13
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { createPortal } from "react-dom";
|
|
14
|
+
import { LayoutGroup, motion } from "motion/react";
|
|
15
|
+
import { ChevronDown, Menu } from "lucide-react";
|
|
16
16
|
//#region src/components/nav-bar/nav-bar.tsx
|
|
17
17
|
var PRESET_TEXT = {
|
|
18
18
|
primary: "text-primary",
|
|
@@ -74,7 +74,9 @@ function resolveNavColor(color) {
|
|
|
74
74
|
bgStyle: { backgroundColor: `color-mix(in srgb, ${color} 10%, transparent)` }
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
|
-
|
|
77
|
+
var PILL_PANEL_RADIUS = 24;
|
|
78
|
+
var TRANSLUCENT_BACKGROUND = "backdrop-blur-md supports-[backdrop-filter]:bg-background/80";
|
|
79
|
+
function NavBar({ logo, items, rightContent, activeId: activeIdProp, defaultActiveId, onActiveChange, openDetailsId: openDetailsIdProp, onDetailsPanelChange, openDetailsOn = "click", position = "sticky", height, morphOnScroll = false, morphScrollThreshold = 50, morphScrollContainer, moreLabel = "More", linkComponent, color = "primary", mobileMenuTitle, mobileMenuTrigger, className, topClassName, topBackground = "translucent", itemsClassName }) {
|
|
78
80
|
const isMobile = useIsMobile();
|
|
79
81
|
const resolvedColor = resolveNavColor(color);
|
|
80
82
|
const navRef = React$1.useRef(null);
|
|
@@ -89,49 +91,113 @@ function NavBar({ logo, items, rightContent, activeId: activeIdProp, defaultActi
|
|
|
89
91
|
onChange: onDetailsPanelChange
|
|
90
92
|
});
|
|
91
93
|
const [mobileMenuOpen, setMobileMenuOpen] = React$1.useState(false);
|
|
92
|
-
const
|
|
94
|
+
const hoverDetails = openDetailsOn === "hover" && !isMobile;
|
|
95
|
+
const { triggerHandlers, panelHandlers, clearTimers } = useNavBarHoverDetails({
|
|
96
|
+
enabled: hoverDetails,
|
|
97
|
+
openDetailsId,
|
|
98
|
+
setOpenDetailsId
|
|
99
|
+
});
|
|
100
|
+
const focusPanelOnOpen = React$1.useRef(false);
|
|
101
|
+
const [frame, setFrame] = React$1.useState({
|
|
93
102
|
bottom: 0,
|
|
103
|
+
left: 0,
|
|
94
104
|
width: 0,
|
|
95
|
-
|
|
105
|
+
borderWidth: "0px",
|
|
106
|
+
borderColor: "transparent",
|
|
107
|
+
radius: 0
|
|
96
108
|
});
|
|
97
|
-
const
|
|
109
|
+
const panelRef = React$1.useRef(null);
|
|
110
|
+
const [panelVisible, setPanelVisible] = React$1.useState(false);
|
|
111
|
+
const [barHeight, setBarHeight] = React$1.useState(0);
|
|
112
|
+
const { containerRef, measureRef, moreButtonMeasureRef, visibleIds, overflowIds, showMore, measuring } = useNavBarOverflow(items, !isMobile);
|
|
98
113
|
const { isScrolled } = useNavBarScroll({
|
|
99
114
|
enabled: morphOnScroll && !isMobile,
|
|
100
115
|
threshold: morphScrollThreshold,
|
|
101
116
|
scrollContainerRef: morphScrollContainer
|
|
102
117
|
});
|
|
118
|
+
const { isScrolled: isPastTop } = useNavBarScroll({
|
|
119
|
+
enabled: Boolean(topClassName),
|
|
120
|
+
threshold: morphScrollThreshold,
|
|
121
|
+
scrollContainerRef: morphScrollContainer
|
|
122
|
+
});
|
|
123
|
+
const atTop = Boolean(topClassName) && !isPastTop;
|
|
124
|
+
const atTopClassName = atTop ? topClassName : void 0;
|
|
125
|
+
const isPill = isScrolled && morphOnScroll && !isMobile;
|
|
126
|
+
const background = panelVisible && !isPill || atTop && topBackground === "solid" ? "bg-background" : TRANSLUCENT_BACKGROUND;
|
|
127
|
+
const pillRadius = barHeight > 0 ? barHeight / 2 : 9999;
|
|
103
128
|
React$1.useEffect(() => {
|
|
104
|
-
if (
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
129
|
+
if (openDetailsId) setPanelVisible(true);
|
|
130
|
+
}, [openDetailsId]);
|
|
131
|
+
const updateFrame = React$1.useCallback(() => {
|
|
132
|
+
const nav = navRef.current;
|
|
133
|
+
if (!nav) return;
|
|
134
|
+
const rect = nav.getBoundingClientRect();
|
|
135
|
+
const style = getComputedStyle(nav);
|
|
136
|
+
const hasSideBorder = parseFloat(style.borderLeftWidth) > 0;
|
|
137
|
+
setFrame({
|
|
138
|
+
bottom: rect.bottom,
|
|
139
|
+
left: rect.left,
|
|
140
|
+
width: rect.width,
|
|
141
|
+
borderWidth: hasSideBorder ? style.borderLeftWidth : style.borderBottomWidth,
|
|
142
|
+
borderColor: hasSideBorder ? style.borderLeftColor : style.borderBottomColor,
|
|
143
|
+
radius: isPill ? PILL_PANEL_RADIUS : Math.min(parseFloat(style.borderTopLeftRadius) || PILL_PANEL_RADIUS, PILL_PANEL_RADIUS)
|
|
144
|
+
});
|
|
145
|
+
}, [isPill]);
|
|
146
|
+
React$1.useEffect(() => {
|
|
147
|
+
const nav = navRef.current;
|
|
148
|
+
if (!openDetailsId || !nav) return;
|
|
149
|
+
updateFrame();
|
|
150
|
+
window.addEventListener("scroll", updateFrame, {
|
|
151
|
+
passive: true,
|
|
152
|
+
capture: true
|
|
153
|
+
});
|
|
154
|
+
window.addEventListener("resize", updateFrame, { passive: true });
|
|
155
|
+
const ro = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(updateFrame);
|
|
156
|
+
ro?.observe(nav);
|
|
118
157
|
return () => {
|
|
119
|
-
window.removeEventListener("scroll",
|
|
120
|
-
window.removeEventListener("resize",
|
|
158
|
+
window.removeEventListener("scroll", updateFrame, { capture: true });
|
|
159
|
+
window.removeEventListener("resize", updateFrame);
|
|
160
|
+
ro?.disconnect();
|
|
121
161
|
};
|
|
122
|
-
}, [openDetailsId]);
|
|
162
|
+
}, [openDetailsId, updateFrame]);
|
|
163
|
+
React$1.useEffect(() => {
|
|
164
|
+
const nav = navRef.current;
|
|
165
|
+
if (!morphOnScroll || !nav || typeof ResizeObserver === "undefined") return;
|
|
166
|
+
const ro = new ResizeObserver(() => setBarHeight(nav.offsetHeight));
|
|
167
|
+
ro.observe(nav);
|
|
168
|
+
setBarHeight(nav.offsetHeight);
|
|
169
|
+
return () => ro.disconnect();
|
|
170
|
+
}, [morphOnScroll, isMobile]);
|
|
123
171
|
React$1.useEffect(() => {
|
|
124
172
|
if (!openDetailsId) return;
|
|
125
173
|
const handleKeyDown = (e) => {
|
|
126
|
-
if (e.key === "Escape")
|
|
174
|
+
if (e.key === "Escape") {
|
|
175
|
+
if (panelRef.current?.contains(document.activeElement)) {
|
|
176
|
+
const triggers = navRef.current?.querySelectorAll("[data-nav-details-trigger]") ?? [];
|
|
177
|
+
Array.from(triggers).find((el) => el.dataset.navDetailsTrigger === openDetailsId)?.focus();
|
|
178
|
+
}
|
|
179
|
+
clearTimers();
|
|
180
|
+
setOpenDetailsId(null);
|
|
181
|
+
}
|
|
127
182
|
};
|
|
128
183
|
document.addEventListener("keydown", handleKeyDown);
|
|
129
184
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
130
|
-
}, [
|
|
185
|
+
}, [
|
|
186
|
+
openDetailsId,
|
|
187
|
+
setOpenDetailsId,
|
|
188
|
+
clearTimers
|
|
189
|
+
]);
|
|
190
|
+
React$1.useEffect(() => {
|
|
191
|
+
if (!openDetailsId || !focusPanelOnOpen.current) return;
|
|
192
|
+
focusPanelOnOpen.current = false;
|
|
193
|
+
panelRef.current?.querySelector("a[href], button:not([disabled]), input, select, textarea, [tabindex]:not([tabindex=\"-1\"])")?.focus();
|
|
194
|
+
}, [openDetailsId]);
|
|
131
195
|
React$1.useEffect(() => {
|
|
132
196
|
if (!openDetailsId) return;
|
|
133
197
|
const handleMouseDown = (e) => {
|
|
134
|
-
|
|
198
|
+
const target = e.target;
|
|
199
|
+
if (navRef.current?.contains(target) || panelRef.current?.contains(target) || target.closest?.("[data-radix-popper-content-wrapper]")) return;
|
|
200
|
+
setOpenDetailsId(null);
|
|
135
201
|
};
|
|
136
202
|
document.addEventListener("mousedown", handleMouseDown);
|
|
137
203
|
return () => document.removeEventListener("mousedown", handleMouseDown);
|
|
@@ -146,51 +212,48 @@ function NavBar({ logo, items, rightContent, activeId: activeIdProp, defaultActi
|
|
|
146
212
|
setActiveId,
|
|
147
213
|
setOpenDetailsId
|
|
148
214
|
]);
|
|
215
|
+
const handleHoverLinkClick = React$1.useCallback((item) => {
|
|
216
|
+
item.onClick?.();
|
|
217
|
+
setActiveId(item.id);
|
|
218
|
+
clearTimers();
|
|
219
|
+
setOpenDetailsId(null);
|
|
220
|
+
}, [
|
|
221
|
+
setActiveId,
|
|
222
|
+
setOpenDetailsId,
|
|
223
|
+
clearTimers
|
|
224
|
+
]);
|
|
225
|
+
const handleHoverLinkKeyDown = React$1.useCallback((item, e) => {
|
|
226
|
+
if (e.key !== "ArrowDown") return;
|
|
227
|
+
e.preventDefault();
|
|
228
|
+
clearTimers();
|
|
229
|
+
focusPanelOnOpen.current = true;
|
|
230
|
+
setOpenDetailsId(item.id);
|
|
231
|
+
}, [setOpenDetailsId, clearTimers]);
|
|
149
232
|
React$1.useEffect(() => {
|
|
150
|
-
if (isMobile)
|
|
233
|
+
if (isMobile) {
|
|
234
|
+
setOpenDetailsId(null);
|
|
235
|
+
setPanelVisible(false);
|
|
236
|
+
}
|
|
151
237
|
}, [isMobile, setOpenDetailsId]);
|
|
152
238
|
const resolvedHeight = height ?? "var(--espd-navbar-height)";
|
|
153
239
|
const activeDetailsItem = openDetailsId ? items.find((i) => i.id === openDetailsId) : void 0;
|
|
154
|
-
const
|
|
155
|
-
const
|
|
156
|
-
const moreButtonRef = React$1.useRef(null);
|
|
157
|
-
const [overflowPanelPos, setOverflowPanelPos] = React$1.useState({
|
|
158
|
-
top: 0,
|
|
159
|
-
right: 0
|
|
160
|
-
});
|
|
161
|
-
React$1.useEffect(() => {
|
|
162
|
-
if (!overflowDetailsItem || !moreButtonRef.current) return;
|
|
163
|
-
const rect = moreButtonRef.current.getBoundingClientRect();
|
|
164
|
-
setOverflowPanelPos({
|
|
165
|
-
top: rect.bottom + 8,
|
|
166
|
-
right: window.innerWidth - rect.right
|
|
167
|
-
});
|
|
168
|
-
}, [overflowDetailsItem]);
|
|
169
|
-
React$1.useEffect(() => {
|
|
170
|
-
if (!overflowDetailsItem) return;
|
|
171
|
-
const handleMouseDown = (e) => {
|
|
172
|
-
if (overflowDetailsRef.current && !overflowDetailsRef.current.contains(e.target) && moreButtonRef.current && !moreButtonRef.current.contains(e.target)) setOverflowDetailsItem(null);
|
|
173
|
-
};
|
|
174
|
-
const handleKeyDown = (e) => {
|
|
175
|
-
if (e.key === "Escape") setOverflowDetailsItem(null);
|
|
176
|
-
};
|
|
177
|
-
document.addEventListener("mousedown", handleMouseDown);
|
|
178
|
-
document.addEventListener("keydown", handleKeyDown);
|
|
179
|
-
return () => {
|
|
180
|
-
document.removeEventListener("mousedown", handleMouseDown);
|
|
181
|
-
document.removeEventListener("keydown", handleKeyDown);
|
|
182
|
-
};
|
|
183
|
-
}, [overflowDetailsItem]);
|
|
240
|
+
const detailsDirection = useDetailsDirection(items, openDetailsId ?? null);
|
|
241
|
+
const highlightId = React$1.useId();
|
|
184
242
|
const hasActiveOverflowItem = overflowIds.some((id) => id === activeId);
|
|
185
|
-
const
|
|
243
|
+
const isOverflowDetailsOpen = openDetailsId != null && overflowIds.includes(openDetailsId);
|
|
244
|
+
const navClasses = cn("relative z-50 w-full transition-[color,background-color,border-color,box-shadow] duration-300", background, position === "sticky" && "sticky", position === "fixed" && "fixed left-0", morphOnScroll && "mx-auto overflow-hidden", isScrolled && morphOnScroll ? "border border-header-border" : "border-b border-header-border", className, atTopClassName, panelVisible && "rounded-b-none border-b-border/60", isScrolled && morphOnScroll && "shadow-[shadow:var(--espd-elevation-navbar,var(--espd-elevation-overlay,var(--shadow-lg)))]", isScrolled && morphOnScroll && panelVisible && "[clip-path:inset(-80px_-80px_0_-80px)]");
|
|
245
|
+
const topRadius = isScrolled ? panelVisible ? PILL_PANEL_RADIUS : pillRadius : 0;
|
|
186
246
|
const morphAnimateProps = morphOnScroll ? {
|
|
187
247
|
initial: false,
|
|
188
248
|
animate: {
|
|
189
249
|
maxWidth: isScrolled ? 896 : 3e3,
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
250
|
+
borderTopLeftRadius: topRadius,
|
|
251
|
+
borderTopRightRadius: topRadius,
|
|
252
|
+
borderBottomLeftRadius: panelVisible ? 0 : topRadius,
|
|
253
|
+
borderBottomRightRadius: panelVisible ? 0 : topRadius,
|
|
254
|
+
top: isScrolled ? 12 : 0
|
|
193
255
|
},
|
|
256
|
+
onUpdate: openDetailsId ? updateFrame : void 0,
|
|
194
257
|
transition: {
|
|
195
258
|
type: "spring",
|
|
196
259
|
stiffness: 300,
|
|
@@ -199,7 +262,7 @@ function NavBar({ logo, items, rightContent, activeId: activeIdProp, defaultActi
|
|
|
199
262
|
} : { style: { top: 0 } };
|
|
200
263
|
if (isMobile) return /* @__PURE__ */ jsxs("nav", {
|
|
201
264
|
ref: navRef,
|
|
202
|
-
className: cn("relative z-50 w-full border-b border-header-border",
|
|
265
|
+
className: cn("relative z-50 w-full border-b border-header-border", background, position === "sticky" && "sticky top-0", position === "fixed" && "fixed top-0 left-0", className, atTopClassName),
|
|
203
266
|
"aria-label": "Main navigation",
|
|
204
267
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
205
268
|
className: "flex items-center gap-3 px-4",
|
|
@@ -247,6 +310,7 @@ function NavBar({ logo, items, rightContent, activeId: activeIdProp, defaultActi
|
|
|
247
310
|
return /* @__PURE__ */ jsxs(motion.nav, {
|
|
248
311
|
ref: navRef,
|
|
249
312
|
className: navClasses,
|
|
313
|
+
"data-details-open": panelVisible ? "" : void 0,
|
|
250
314
|
...morphAnimateProps,
|
|
251
315
|
"aria-label": "Main navigation",
|
|
252
316
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
@@ -286,74 +350,68 @@ function NavBar({ logo, items, rightContent, activeId: activeIdProp, defaultActi
|
|
|
286
350
|
hasActiveOverflowItem: false
|
|
287
351
|
})
|
|
288
352
|
}),
|
|
289
|
-
/* @__PURE__ */ jsx(
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
353
|
+
/* @__PURE__ */ jsx(LayoutGroup, {
|
|
354
|
+
id: highlightId,
|
|
355
|
+
children: /* @__PURE__ */ jsx("ul", {
|
|
356
|
+
className: cn("flex items-center gap-1 list-none m-0 p-0", measuring && "opacity-0"),
|
|
357
|
+
role: "menubar",
|
|
358
|
+
"aria-label": "Main navigation",
|
|
359
|
+
children: items.filter((item) => visibleIds.includes(item.id)).map((item) => {
|
|
360
|
+
const hoverLink = hoverDetails && Boolean(item.details && item.href);
|
|
361
|
+
return /* @__PURE__ */ jsx("li", {
|
|
362
|
+
role: "none",
|
|
363
|
+
className: "shrink-0",
|
|
364
|
+
children: /* @__PURE__ */ jsx(NavBarItemTrigger, {
|
|
365
|
+
item,
|
|
366
|
+
isActive: activeId === item.id,
|
|
367
|
+
isDetailsOpen: openDetailsId === item.id,
|
|
368
|
+
onClick: () => hoverLink ? handleHoverLinkClick(item) : handleItemClick(item),
|
|
369
|
+
linkComponent,
|
|
370
|
+
resolvedColor,
|
|
371
|
+
isPill: isScrolled && morphOnScroll,
|
|
372
|
+
detailsAsLink: hoverLink,
|
|
373
|
+
highlightLayoutId: hoverDetails ? void 0 : `${highlightId}-details-highlight`,
|
|
374
|
+
plainHover: hoverDetails,
|
|
375
|
+
hoverHandlers: item.details ? triggerHandlers(item.id) : void 0,
|
|
376
|
+
onKeyDown: hoverLink ? (e) => handleHoverLinkKeyDown(item, e) : void 0
|
|
377
|
+
})
|
|
378
|
+
}, item.id);
|
|
304
379
|
})
|
|
305
|
-
}
|
|
380
|
+
})
|
|
306
381
|
}),
|
|
307
382
|
showMore && /* @__PURE__ */ jsx("div", {
|
|
308
|
-
ref: moreButtonRef,
|
|
309
383
|
className: cn("shrink-0 ml-1", measuring && "opacity-0"),
|
|
310
|
-
children: /* @__PURE__ */ jsxs(DropdownMenu, {
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
}),
|
|
342
|
-
overflowDetailsItem?.details && createPortal(/* @__PURE__ */ jsxs("div", {
|
|
343
|
-
ref: overflowDetailsRef,
|
|
344
|
-
className: cn("fixed z-50", "w-max max-w-[min(24rem,calc(100vw-2rem))]", "rounded-lg border border-border bg-background p-4 shadow-lg", "animate-in fade-in-0 zoom-in-95"),
|
|
345
|
-
style: {
|
|
346
|
-
top: overflowPanelPos.top,
|
|
347
|
-
right: overflowPanelPos.right
|
|
348
|
-
},
|
|
349
|
-
children: [/* @__PURE__ */ jsx("button", {
|
|
350
|
-
type: "button",
|
|
351
|
-
onClick: () => setOverflowDetailsItem(null),
|
|
352
|
-
className: cn("absolute top-2 right-2 p-1 rounded-md", "text-foreground/40 hover:text-foreground hover:bg-foreground/5", "transition-colors cursor-pointer"),
|
|
353
|
-
"aria-label": "Close panel",
|
|
354
|
-
children: /* @__PURE__ */ jsx(X, { className: "size-4" })
|
|
355
|
-
}), overflowDetailsItem.details]
|
|
356
|
-
}), document.body)
|
|
384
|
+
children: /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
|
|
385
|
+
asChild: true,
|
|
386
|
+
children: /* @__PURE__ */ jsx(MoreButton, {
|
|
387
|
+
label: moreLabel,
|
|
388
|
+
hasActiveOverflowItem,
|
|
389
|
+
isDetailsOpen: isOverflowDetailsOpen,
|
|
390
|
+
resolvedColor
|
|
391
|
+
})
|
|
392
|
+
}), /* @__PURE__ */ jsx(DropdownMenuContent, {
|
|
393
|
+
align: "end",
|
|
394
|
+
sideOffset: 8,
|
|
395
|
+
children: items.filter((item) => overflowIds.includes(item.id)).map((item) => /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
396
|
+
onClick: () => handleItemClick(item),
|
|
397
|
+
"aria-haspopup": item.details ? "true" : void 0,
|
|
398
|
+
className: cn(activeId === item.id && `${resolvedColor.textClass} ${resolvedColor.bgClass}`),
|
|
399
|
+
style: activeId === item.id && resolvedColor.textStyle ? {
|
|
400
|
+
...resolvedColor.textStyle,
|
|
401
|
+
...resolvedColor.bgStyle
|
|
402
|
+
} : void 0,
|
|
403
|
+
disabled: item.disabled,
|
|
404
|
+
children: [
|
|
405
|
+
item.icon,
|
|
406
|
+
item.label,
|
|
407
|
+
item.details && /* @__PURE__ */ jsx(ChevronDown, {
|
|
408
|
+
className: cn("ml-auto size-3.5 opacity-60 transition-transform duration-200", openDetailsId === item.id && "rotate-180"),
|
|
409
|
+
"aria-hidden": "true"
|
|
410
|
+
})
|
|
411
|
+
]
|
|
412
|
+
}, item.id))
|
|
413
|
+
})] })
|
|
414
|
+
})
|
|
357
415
|
]
|
|
358
416
|
}),
|
|
359
417
|
rightContent && /* @__PURE__ */ jsx("div", {
|
|
@@ -362,36 +420,80 @@ function NavBar({ logo, items, rightContent, activeId: activeIdProp, defaultActi
|
|
|
362
420
|
})
|
|
363
421
|
]
|
|
364
422
|
}), /* @__PURE__ */ jsx(NavBarDetailsPanel, {
|
|
423
|
+
ref: panelRef,
|
|
365
424
|
item: activeDetailsItem,
|
|
366
425
|
openDetailsId: openDetailsId ?? null,
|
|
367
426
|
onClose: () => setOpenDetailsId(null),
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
427
|
+
frame,
|
|
428
|
+
direction: detailsDirection,
|
|
429
|
+
backgroundClassName: isPill ? TRANSLUCENT_BACKGROUND : "bg-background",
|
|
430
|
+
themeClassName: atTopClassName,
|
|
431
|
+
backdropCoversBar: isPill,
|
|
432
|
+
onExitComplete: () => {
|
|
433
|
+
if (!openDetailsId) setPanelVisible(false);
|
|
434
|
+
},
|
|
435
|
+
onPointerEnter: panelHandlers?.onPointerEnter,
|
|
436
|
+
onPointerLeave: panelHandlers?.onPointerLeave
|
|
371
437
|
})]
|
|
372
438
|
});
|
|
373
439
|
}
|
|
374
|
-
var
|
|
440
|
+
var HIGHLIGHT_TRANSITION = {
|
|
441
|
+
type: "spring",
|
|
442
|
+
stiffness: 520,
|
|
443
|
+
damping: 40,
|
|
444
|
+
mass: .8
|
|
445
|
+
};
|
|
446
|
+
/**
|
|
447
|
+
* Where the open item sits relative to the one open before it, for the
|
|
448
|
+
* panel's content to slide that way: `1` right, `-1` left, `0` fresh.
|
|
449
|
+
*/
|
|
450
|
+
function useDetailsDirection(items, openId) {
|
|
451
|
+
const [state, setState] = React$1.useState({
|
|
452
|
+
id: openId,
|
|
453
|
+
direction: 0
|
|
454
|
+
});
|
|
455
|
+
if (state.id !== openId) {
|
|
456
|
+
const from = state.id ? items.findIndex((i) => i.id === state.id) : -1;
|
|
457
|
+
const to = openId ? items.findIndex((i) => i.id === openId) : -1;
|
|
458
|
+
setState({
|
|
459
|
+
id: openId,
|
|
460
|
+
direction: openId ? from < 0 || to < 0 || from === to ? 0 : to > from ? 1 : -1 : state.direction
|
|
461
|
+
});
|
|
462
|
+
}
|
|
463
|
+
return state.direction;
|
|
464
|
+
}
|
|
465
|
+
var MoreButton = React$1.forwardRef(function MoreButton({ label, hasActiveOverflowItem, isDetailsOpen = false, resolvedColor, ...props }, ref) {
|
|
466
|
+
const highlighted = hasActiveOverflowItem || isDetailsOpen;
|
|
375
467
|
return /* @__PURE__ */ jsxs("button", {
|
|
376
468
|
ref,
|
|
377
469
|
type: "button",
|
|
378
|
-
className: cn("inline-flex items-center gap-1 px-3 h-8 rounded-md", "text-sm font-medium whitespace-nowrap cursor-pointer", "transition-colors duration-
|
|
379
|
-
style:
|
|
470
|
+
className: cn("inline-flex items-center gap-1 px-3 h-8 rounded-[var(--espd-own-radius,var(--espd-radius-item,var(--radius-md)))]", "text-sm font-medium whitespace-nowrap cursor-pointer", "transition-colors duration-[var(--espd-duration-fast,150ms)]", "text-foreground/80 hover:text-foreground", resolvedColor ? resolvedColor.hoverBgClass : "hover:bg-foreground/5", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", highlighted && resolvedColor && `${resolvedColor.textClass} ${resolvedColor.bgClass}`),
|
|
471
|
+
style: highlighted && resolvedColor?.textStyle ? {
|
|
380
472
|
...resolvedColor.textStyle,
|
|
381
473
|
...resolvedColor.bgStyle
|
|
382
474
|
} : void 0,
|
|
383
475
|
"aria-label": "More navigation items",
|
|
384
476
|
...props,
|
|
385
|
-
children: [/* @__PURE__ */ jsx("span", { children: label }), /* @__PURE__ */ jsx(ChevronDown, { className: "size-3.5" })]
|
|
477
|
+
children: [/* @__PURE__ */ jsx("span", { children: label }), /* @__PURE__ */ jsx(ChevronDown, { className: cn("size-3.5 transition-transform duration-200", isDetailsOpen && "rotate-180") })]
|
|
386
478
|
});
|
|
387
479
|
});
|
|
388
|
-
function NavBarItemTrigger({ item, isActive, isDetailsOpen, onClick, linkComponent, tabIndex, resolvedColor, isPill }) {
|
|
389
|
-
const
|
|
390
|
-
const
|
|
480
|
+
function NavBarItemTrigger({ item, isActive, isDetailsOpen, onClick, linkComponent, tabIndex, resolvedColor, isPill, detailsAsLink = false, hoverHandlers, onKeyDown, highlightLayoutId, plainHover = false }) {
|
|
481
|
+
const slidingHighlight = isDetailsOpen && Boolean(highlightLayoutId);
|
|
482
|
+
const classes = cn("relative isolate inline-flex items-center gap-1 px-3 h-8", isPill ? "rounded-full" : "rounded-[var(--espd-own-radius,var(--espd-radius-item,var(--radius-md)))]", "text-sm font-medium whitespace-nowrap cursor-pointer", "transition-colors duration-[var(--espd-duration-fast,150ms)]", "text-foreground/80 hover:text-foreground", !plainHover && (resolvedColor ? resolvedColor.hoverBgClass : "hover:bg-foreground/5"), "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", isActive && !slidingHighlight && resolvedColor && `${resolvedColor.textClass} ${resolvedColor.bgClass}`, isDetailsOpen && !isActive && plainHover && "text-foreground", isDetailsOpen && !plainHover && resolvedColor && (slidingHighlight ? resolvedColor.textClass : `${resolvedColor.textClass} ${resolvedColor.bgClass}`), item.disabled && "opacity-50 pointer-events-none");
|
|
483
|
+
const colorStyle = resolvedColor?.textStyle && (isActive || isDetailsOpen && !plainHover) ? {
|
|
391
484
|
...resolvedColor.textStyle,
|
|
392
|
-
...resolvedColor.bgStyle
|
|
485
|
+
...slidingHighlight ? void 0 : resolvedColor.bgStyle
|
|
393
486
|
} : void 0;
|
|
487
|
+
const detailsTriggerId = tabIndex === -1 ? void 0 : item.id;
|
|
394
488
|
const content = /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
489
|
+
slidingHighlight && /* @__PURE__ */ jsx(motion.span, {
|
|
490
|
+
layoutId: highlightLayoutId,
|
|
491
|
+
"aria-hidden": "true",
|
|
492
|
+
"data-slot": "nav-bar-details-highlight",
|
|
493
|
+
className: cn("absolute inset-0 -z-10 rounded-[inherit]", resolvedColor?.bgClass),
|
|
494
|
+
style: resolvedColor?.bgStyle,
|
|
495
|
+
transition: HIGHLIGHT_TRANSITION
|
|
496
|
+
}),
|
|
395
497
|
item.icon && /* @__PURE__ */ jsx("span", {
|
|
396
498
|
className: "shrink-0",
|
|
397
499
|
children: item.icon
|
|
@@ -402,14 +504,30 @@ function NavBarItemTrigger({ item, isActive, isDetailsOpen, onClick, linkCompone
|
|
|
402
504
|
"aria-hidden": "true"
|
|
403
505
|
})
|
|
404
506
|
] });
|
|
507
|
+
if (item.details && item.href && detailsAsLink) return /* @__PURE__ */ jsx(linkComponent ?? "a", {
|
|
508
|
+
...linkComponent ? { to: item.href } : { href: item.href },
|
|
509
|
+
...hoverHandlers,
|
|
510
|
+
className: classes,
|
|
511
|
+
style: colorStyle,
|
|
512
|
+
onClick,
|
|
513
|
+
onKeyDown,
|
|
514
|
+
role: "menuitem",
|
|
515
|
+
"aria-expanded": isDetailsOpen,
|
|
516
|
+
"aria-haspopup": "true",
|
|
517
|
+
"data-nav-details-trigger": detailsTriggerId,
|
|
518
|
+
tabIndex,
|
|
519
|
+
children: content
|
|
520
|
+
});
|
|
405
521
|
if (item.details) return /* @__PURE__ */ jsx("button", {
|
|
406
522
|
type: "button",
|
|
523
|
+
...hoverHandlers,
|
|
407
524
|
className: classes,
|
|
408
525
|
style: colorStyle,
|
|
409
526
|
onClick,
|
|
410
527
|
role: "menuitem",
|
|
411
528
|
"aria-expanded": isDetailsOpen,
|
|
412
529
|
"aria-haspopup": "true",
|
|
530
|
+
"data-nav-details-trigger": detailsTriggerId,
|
|
413
531
|
disabled: item.disabled,
|
|
414
532
|
tabIndex,
|
|
415
533
|
children: content
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
//#region src/components/nav-bar/use-nav-bar-hover-details.ts
|
|
3
|
+
/** Pause before a hovered item opens its panel, so a pointer passing over the bar opens nothing. */
|
|
4
|
+
var HOVER_OPEN_DELAY = 120;
|
|
5
|
+
/** Grace before the panel closes once the pointer leaves, long enough to cross from the item into the panel. */
|
|
6
|
+
var HOVER_CLOSE_DELAY = 250;
|
|
7
|
+
var isTouch = (event) => event.pointerType === "touch";
|
|
8
|
+
/**
|
|
9
|
+
* Hover intent for the details panels: an item opens its panel after a short
|
|
10
|
+
* pause, the panel stays open while the pointer is over the item or the panel
|
|
11
|
+
* itself, and closes a moment after it has left both. With a panel already
|
|
12
|
+
* open, moving to another item switches at once. Touch never opens on hover
|
|
13
|
+
* (a tap is a click, and a click follows the link).
|
|
14
|
+
*/
|
|
15
|
+
function useNavBarHoverDetails({ enabled, openDetailsId, setOpenDetailsId }) {
|
|
16
|
+
const openTimer = React$1.useRef(null);
|
|
17
|
+
const closeTimer = React$1.useRef(null);
|
|
18
|
+
const openIdRef = React$1.useRef(openDetailsId);
|
|
19
|
+
openIdRef.current = openDetailsId;
|
|
20
|
+
const clearTimers = React$1.useCallback(() => {
|
|
21
|
+
if (openTimer.current) clearTimeout(openTimer.current);
|
|
22
|
+
if (closeTimer.current) clearTimeout(closeTimer.current);
|
|
23
|
+
openTimer.current = null;
|
|
24
|
+
closeTimer.current = null;
|
|
25
|
+
}, []);
|
|
26
|
+
React$1.useEffect(() => clearTimers, [clearTimers]);
|
|
27
|
+
const scheduleClose = React$1.useCallback(() => {
|
|
28
|
+
if (openTimer.current) clearTimeout(openTimer.current);
|
|
29
|
+
openTimer.current = null;
|
|
30
|
+
if (closeTimer.current) clearTimeout(closeTimer.current);
|
|
31
|
+
closeTimer.current = setTimeout(() => {
|
|
32
|
+
closeTimer.current = null;
|
|
33
|
+
setOpenDetailsId(null);
|
|
34
|
+
}, HOVER_CLOSE_DELAY);
|
|
35
|
+
}, [setOpenDetailsId]);
|
|
36
|
+
const cancelClose = React$1.useCallback(() => {
|
|
37
|
+
if (closeTimer.current) clearTimeout(closeTimer.current);
|
|
38
|
+
closeTimer.current = null;
|
|
39
|
+
}, []);
|
|
40
|
+
return {
|
|
41
|
+
triggerHandlers: React$1.useCallback((id) => {
|
|
42
|
+
if (!enabled) return void 0;
|
|
43
|
+
return {
|
|
44
|
+
onPointerEnter: (event) => {
|
|
45
|
+
if (isTouch(event)) return;
|
|
46
|
+
cancelClose();
|
|
47
|
+
if (openTimer.current) clearTimeout(openTimer.current);
|
|
48
|
+
if (openIdRef.current) {
|
|
49
|
+
setOpenDetailsId(id);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
openTimer.current = setTimeout(() => {
|
|
53
|
+
openTimer.current = null;
|
|
54
|
+
setOpenDetailsId(id);
|
|
55
|
+
}, HOVER_OPEN_DELAY);
|
|
56
|
+
},
|
|
57
|
+
onPointerLeave: (event) => {
|
|
58
|
+
if (isTouch(event)) return;
|
|
59
|
+
scheduleClose();
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
}, [
|
|
63
|
+
enabled,
|
|
64
|
+
cancelClose,
|
|
65
|
+
scheduleClose,
|
|
66
|
+
setOpenDetailsId
|
|
67
|
+
]),
|
|
68
|
+
panelHandlers: enabled ? {
|
|
69
|
+
onPointerEnter: (event) => {
|
|
70
|
+
if (!isTouch(event)) cancelClose();
|
|
71
|
+
},
|
|
72
|
+
onPointerLeave: (event) => {
|
|
73
|
+
if (!isTouch(event)) scheduleClose();
|
|
74
|
+
}
|
|
75
|
+
} : void 0,
|
|
76
|
+
clearTimers
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
//#endregion
|
|
80
|
+
export { HOVER_CLOSE_DELAY, HOVER_OPEN_DELAY, useNavBarHoverDetails };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useCallback, useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
2
2
|
//#region src/components/nav-bar/use-nav-bar-overflow.ts
|
|
3
3
|
var ITEM_GAP = 4;
|
|
4
|
-
function useNavBarOverflow(items) {
|
|
4
|
+
function useNavBarOverflow(items, enabled = true) {
|
|
5
5
|
const containerRef = useRef(null);
|
|
6
6
|
const measureRef = useRef(null);
|
|
7
7
|
const moreButtonMeasureRef = useRef(null);
|
|
@@ -49,17 +49,17 @@ function useNavBarOverflow(items) {
|
|
|
49
49
|
setMeasuring(false);
|
|
50
50
|
}, [items]);
|
|
51
51
|
useLayoutEffect(() => {
|
|
52
|
-
recalculate();
|
|
53
|
-
}, [recalculate]);
|
|
52
|
+
if (enabled) recalculate();
|
|
53
|
+
}, [recalculate, enabled]);
|
|
54
54
|
useEffect(() => {
|
|
55
55
|
const container = containerRef.current;
|
|
56
|
-
if (!container || typeof ResizeObserver === "undefined") return;
|
|
56
|
+
if (!container || !enabled || typeof ResizeObserver === "undefined") return;
|
|
57
57
|
const ro = new ResizeObserver(() => {
|
|
58
58
|
recalculate();
|
|
59
59
|
});
|
|
60
60
|
ro.observe(container);
|
|
61
61
|
return () => ro.disconnect();
|
|
62
|
-
}, [recalculate]);
|
|
62
|
+
}, [recalculate, enabled]);
|
|
63
63
|
return {
|
|
64
64
|
containerRef,
|
|
65
65
|
measureRef,
|