@espressif/dashboard-ui-components 1.11.1 → 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 +1020 -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 +50 -19
- 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
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { k as StyleAxisProps } from './style-axes-DSQ2DGc5.js';
|
|
3
|
+
import { S as Size } from './index-BQANnKs9.js';
|
|
4
|
+
|
|
5
|
+
interface InputProps extends Omit<React.ComponentProps<"input">, "size">, Pick<StyleAxisProps, "radius" | "border"> {
|
|
6
|
+
label?: React.ReactNode;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
size?: Size;
|
|
9
|
+
/** Fully rounded. Same as `radius="full"`; `radius` wins when both are set. */
|
|
10
|
+
rounded?: boolean;
|
|
11
|
+
startHelperContent?: React.ReactNode;
|
|
12
|
+
endHelperContent?: React.ReactNode;
|
|
13
|
+
hintContent?: React.ReactNode;
|
|
14
|
+
error?: boolean;
|
|
15
|
+
errorContent?: React.ReactNode;
|
|
16
|
+
startIcon?: React.ReactNode;
|
|
17
|
+
endIcon?: React.ReactNode;
|
|
18
|
+
/** Leading add-on box. Takes precedence over `startAddOn` when both are set. */
|
|
19
|
+
startAddOnContent?: React.ReactNode;
|
|
20
|
+
/** Trailing add-on box. Takes precedence over `endAddOn` when both are set. */
|
|
21
|
+
endAddOnContent?: React.ReactNode;
|
|
22
|
+
startAddOn?: string;
|
|
23
|
+
endAddOn?: string;
|
|
24
|
+
/**
|
|
25
|
+
* A control that IS the leading add-on (a button): it fills the segment edge
|
|
26
|
+
* to edge, takes the field's outer corners and none where it meets the text,
|
|
27
|
+
* and its focus ring sits on the segment's edges. Takes precedence over
|
|
28
|
+
* `startAddOnContent` and `startAddOn`.
|
|
29
|
+
*/
|
|
30
|
+
startAddOnAction?: React.ReactNode;
|
|
31
|
+
/** The trailing counterpart of `startAddOnAction` (a "Save" or "Use this" button). */
|
|
32
|
+
endAddOnAction?: React.ReactNode;
|
|
33
|
+
floatingLabel?: boolean;
|
|
34
|
+
charLimit?: number;
|
|
35
|
+
}
|
|
36
|
+
declare const Input: React.ForwardRefExoticComponent<Omit<InputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
37
|
+
|
|
38
|
+
export { Input as I, type InputProps as a };
|
package/dist/layouts/index.d.ts
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { ReactNode, ComponentType } from 'react';
|
|
3
|
-
import { d as SidebarNavEntry, c as SidebarLinkComponentProps } from '../types-
|
|
4
|
-
export { f as SidebarTopLevelLinkConfig, i as isSidebarGroup } from '../types-
|
|
5
|
-
import { a as ListGroup } from '../list.props-
|
|
6
|
-
import {
|
|
7
|
-
import { a as LogoAssetConfig } from '../
|
|
2
|
+
import { ReactNode, ComponentType, ComponentProps } from 'react';
|
|
3
|
+
import { d as SidebarNavEntry, c as SidebarLinkComponentProps } from '../types-CkXflqg7.js';
|
|
4
|
+
export { f as SidebarTopLevelLinkConfig, i as isSidebarGroup } from '../types-CkXflqg7.js';
|
|
5
|
+
import { a as ListGroup } from '../list.props-DP_xPTqU.js';
|
|
6
|
+
import { A as AppName, C as Color } from '../index-BQANnKs9.js';
|
|
7
|
+
import { a as LogoAssetConfig, M as MyAccountMenuProps } from '../my-account-menu.props-C7DK71WC.js';
|
|
8
|
+
import { B as Button } from '../button-BxJ7s6sR.js';
|
|
9
|
+
import '../style-axes-DSQ2DGc5.js';
|
|
10
|
+
import '../button-BK-DIR_L.js';
|
|
11
|
+
import 'class-variance-authority/types';
|
|
12
|
+
import 'class-variance-authority';
|
|
8
13
|
|
|
9
14
|
interface WorkspaceSidebarConfig {
|
|
10
15
|
/**
|
|
@@ -45,6 +50,8 @@ interface WorkspaceHeaderConfig {
|
|
|
45
50
|
userName?: string;
|
|
46
51
|
userEmail?: string;
|
|
47
52
|
userProfilePictureUrl?: string;
|
|
53
|
+
/** The avatar's fill behind the initial, when there is no picture; default `primary`. */
|
|
54
|
+
avatarColor?: Color;
|
|
48
55
|
/** Avatar status dot; preset tokens or CSS color string — see `resolveColor` in `@/utils/color`. */
|
|
49
56
|
avatarBadgeColor?: Color;
|
|
50
57
|
breadcrumbs?: BreadcrumbItemConfig[];
|
|
@@ -121,6 +128,8 @@ interface AccountMenuProps {
|
|
|
121
128
|
userName?: string;
|
|
122
129
|
userEmail?: string;
|
|
123
130
|
userProfilePictureUrl?: string;
|
|
131
|
+
/** The avatar's fill behind the initial (the trigger's and the profile card's); default `primary`. */
|
|
132
|
+
avatarColor?: Color;
|
|
124
133
|
avatarBadgeColor?: Color;
|
|
125
134
|
onLogoutClick?: () => void;
|
|
126
135
|
onProfileCardClick?: () => void;
|
|
@@ -133,9 +142,15 @@ interface AccountMenuProps {
|
|
|
133
142
|
}[];
|
|
134
143
|
currentLanguage?: string;
|
|
135
144
|
additionalItems?: ListGroup[];
|
|
145
|
+
/** See `MyAccountMenuProps.triggerVariant`; default `avatar`. */
|
|
146
|
+
triggerVariant?: MyAccountMenuProps["triggerVariant"];
|
|
147
|
+
/** Menu placement; default `bottom`. */
|
|
148
|
+
side?: MyAccountMenuProps["side"];
|
|
149
|
+
/** Menu alignment; default `end`. */
|
|
150
|
+
align?: MyAccountMenuProps["align"];
|
|
136
151
|
}
|
|
137
152
|
|
|
138
|
-
declare function AccountMenu({ userName, userEmail, userProfilePictureUrl, avatarBadgeColor, onLogoutClick, onProfileCardClick, onColorThemeChange, colorTheme, onLanguageChange, languages, currentLanguage, additionalItems, }: AccountMenuProps): React.JSX.Element | null;
|
|
153
|
+
declare function AccountMenu({ userName, userEmail, userProfilePictureUrl, avatarColor, avatarBadgeColor, onLogoutClick, onProfileCardClick, onColorThemeChange, colorTheme, onLanguageChange, languages, currentLanguage, additionalItems, triggerVariant, side, align, }: AccountMenuProps): React.JSX.Element | null;
|
|
139
154
|
|
|
140
155
|
interface HeaderProps {
|
|
141
156
|
leftContent?: ReactNode;
|
|
@@ -156,6 +171,115 @@ interface FooterProps {
|
|
|
156
171
|
|
|
157
172
|
declare function Footer({ hidden }: FooterProps): React.JSX.Element;
|
|
158
173
|
|
|
174
|
+
interface MinimalWorkspaceSidebarState {
|
|
175
|
+
/**
|
|
176
|
+
* True while the desktop sidebar is the icon rail (or, with
|
|
177
|
+
* `hideWhenCollapsed`, hidden). Always false in the mobile sheet.
|
|
178
|
+
*/
|
|
179
|
+
collapsed: boolean;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* {@link WorkspaceSidebarConfig} without `allowCollapsible` and `variant`: the
|
|
183
|
+
* sidebar is an icon rail that expands, or, with `hideWhenCollapsed`, hidden
|
|
184
|
+
* until it is shown.
|
|
185
|
+
*/
|
|
186
|
+
interface MinimalWorkspaceSidebarConfig extends Omit<WorkspaceSidebarConfig, "allowCollapsible" | "variant"> {
|
|
187
|
+
/**
|
|
188
|
+
* Region between the logo and the menu, e.g. a "New" button. A function
|
|
189
|
+
* receives the sidebar state, to render an icon-only version in the rail.
|
|
190
|
+
*/
|
|
191
|
+
header?: ReactNode | ((state: MinimalWorkspaceSidebarState) => ReactNode);
|
|
192
|
+
/**
|
|
193
|
+
* When false the sidebar stays a rail: no expand / collapse buttons, no
|
|
194
|
+
* click-to-expand, and ⌘/Ctrl+B does nothing. Default true. With
|
|
195
|
+
* `hideWhenCollapsed` it stays hidden instead.
|
|
196
|
+
*/
|
|
197
|
+
expandable?: boolean;
|
|
198
|
+
/**
|
|
199
|
+
* Collapsed, the sidebar is gone entirely instead of an icon rail: the
|
|
200
|
+
* content takes the full width. It comes back two ways. Hovering the left
|
|
201
|
+
* edge of the content shows a strip; resting the pointer there for a
|
|
202
|
+
* moment, or a click, slides the full sidebar in over the content (a peek),
|
|
203
|
+
* and it slides out again once the pointer leaves it. A peek is never reported through `onSidebarOpenChange`. A
|
|
204
|
+
* `MinimalWorkspaceSidebarTrigger` (put it in `topRightContent`), or
|
|
205
|
+
* ⌘/Ctrl+B, opens it inline beside the content and closes it again, which
|
|
206
|
+
* is the `sidebarOpen` state. Default false. Not meant to change at
|
|
207
|
+
* runtime.
|
|
208
|
+
*/
|
|
209
|
+
hideWhenCollapsed?: boolean;
|
|
210
|
+
/**
|
|
211
|
+
* With `hideWhenCollapsed`: whether resting the pointer on the edge peeks
|
|
212
|
+
* the sidebar (default true), or only a click there does. A pointer parked
|
|
213
|
+
* at the screen edge while reading is the one gesture a hover reveal cannot
|
|
214
|
+
* tell from an intentional one; an app whose users mind can turn it off.
|
|
215
|
+
*/
|
|
216
|
+
peekOnHover?: boolean;
|
|
217
|
+
}
|
|
218
|
+
interface MinimalWorkspaceLayoutLabels {
|
|
219
|
+
/** Expand button on the collapsed rail. Default "Expand sidebar". */
|
|
220
|
+
expandSidebar?: string;
|
|
221
|
+
/** Collapse button beside the expanded logo. Default "Collapse sidebar". */
|
|
222
|
+
collapseSidebar?: string;
|
|
223
|
+
/** Menu button in the mobile top bar. Default "Open menu". */
|
|
224
|
+
openMenu?: string;
|
|
225
|
+
/**
|
|
226
|
+
* `MinimalWorkspaceSidebarTrigger` while a `hideWhenCollapsed` sidebar is
|
|
227
|
+
* hidden. Default "Show sidebar".
|
|
228
|
+
*/
|
|
229
|
+
showSidebar?: string;
|
|
230
|
+
/**
|
|
231
|
+
* `MinimalWorkspaceSidebarTrigger` and the button beside the logo while a
|
|
232
|
+
* `hideWhenCollapsed` sidebar is showing. Default "Hide sidebar".
|
|
233
|
+
*/
|
|
234
|
+
hideSidebar?: string;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Same props as {@link WorkspaceLayoutProps}, minus the header bar and the
|
|
238
|
+
* status footer: switching is a rename of the component plus, optionally,
|
|
239
|
+
* `topRightContent`.
|
|
240
|
+
*/
|
|
241
|
+
interface MinimalWorkspaceLayoutProps extends Omit<WorkspaceLayoutProps, "sidebarConfig" | "headerConfig" | "footerConfig" | "hideBreadcrumbs"> {
|
|
242
|
+
sidebarConfig: MinimalWorkspaceSidebarConfig;
|
|
243
|
+
/**
|
|
244
|
+
* Account details for the menu at the bottom of the sidebar. `rightContent`
|
|
245
|
+
* is used as `topRightContent` when that is unset. `breadcrumbs` and
|
|
246
|
+
* `collapseBreadcrumbsOnMobile` are ignored: there is no header bar.
|
|
247
|
+
*/
|
|
248
|
+
headerConfig?: WorkspaceHeaderConfig;
|
|
249
|
+
/**
|
|
250
|
+
* Floats over the main content at its top-right corner (desktop); sits at the
|
|
251
|
+
* end of the top bar on mobile. Any node. It catches pointer events only on
|
|
252
|
+
* itself, not on the space around it.
|
|
253
|
+
*/
|
|
254
|
+
topRightContent?: ReactNode;
|
|
255
|
+
/**
|
|
256
|
+
* Whether the sidebar starts expanded when uncontrolled. **Defaults to
|
|
257
|
+
* `false`** (WorkspaceLayout's defaults to `true`).
|
|
258
|
+
*/
|
|
259
|
+
defaultSidebarOpen?: boolean;
|
|
260
|
+
/** Accessible names of the layout's own buttons, for translation. */
|
|
261
|
+
labels?: MinimalWorkspaceLayoutLabels;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Header-less app shell: an icon rail that expands into a labelled sidebar
|
|
266
|
+
* (or, with `sidebarConfig.hideWhenCollapsed`, a hidden sidebar that peeks
|
|
267
|
+
* over the content from its left edge and opens inline from a trigger), and
|
|
268
|
+
* the page content on a canvas beside it. Takes WorkspaceLayout's props; see
|
|
269
|
+
* {@link MinimalWorkspaceLayoutProps} for the differences.
|
|
270
|
+
*/
|
|
271
|
+
declare function MinimalWorkspaceLayout(props: MinimalWorkspaceLayoutProps): React.JSX.Element;
|
|
272
|
+
|
|
273
|
+
type MinimalWorkspaceSidebarTriggerProps = Omit<ComponentProps<typeof Button>, "children" | "onClick" | "aria-label" | "aria-expanded" | "aria-controls">;
|
|
274
|
+
/**
|
|
275
|
+
* A button that opens the sidebar inline and closes it again: the app's own
|
|
276
|
+
* handle on a `hideWhenCollapsed` sidebar, usually placed in `topRightContent`
|
|
277
|
+
* (it also expands and collapses the icon rail). Must render inside
|
|
278
|
+
* `MinimalWorkspaceLayout`. Renders nothing when the sidebar is not
|
|
279
|
+
* `expandable`, and on mobile, where the top bar has its own menu button.
|
|
280
|
+
*/
|
|
281
|
+
declare function MinimalWorkspaceSidebarTrigger({ className, ...props }: MinimalWorkspaceSidebarTriggerProps): React.JSX.Element | null;
|
|
282
|
+
|
|
159
283
|
interface EntryLayoutProps {
|
|
160
284
|
/**
|
|
161
285
|
* Internal preset key. When set, the left-panel logo defaults to
|
|
@@ -189,4 +313,4 @@ interface EntryLayoutProps {
|
|
|
189
313
|
|
|
190
314
|
declare function EntryLayout({ appName, children, backgroundImageUrl, heading, darkMode, logo, logoAssets, customRightPanel, disableBackgroundImage, hideLogo, hideFooter, hideRightPanel, }: EntryLayoutProps): React.JSX.Element;
|
|
191
315
|
|
|
192
|
-
export { AccountMenu, type AccountMenuProps, type BreadcrumbItemConfig, EntryLayout, type EntryLayoutProps, type LanguageOption, SidebarNavEntry, Footer as WorkspaceFooter, type WorkspaceFooterConfig, type FooterProps as WorkspaceFooterProps, Header as WorkspaceHeader, type WorkspaceHeaderConfig, type HeaderProps as WorkspaceHeaderProps, WorkspaceLayout, type WorkspaceLayoutProps, type WorkspaceSidebarConfig };
|
|
316
|
+
export { AccountMenu, type AccountMenuProps, type BreadcrumbItemConfig, EntryLayout, type EntryLayoutProps, type LanguageOption, MinimalWorkspaceLayout, type MinimalWorkspaceLayoutLabels, type MinimalWorkspaceLayoutProps, type MinimalWorkspaceSidebarConfig, type MinimalWorkspaceSidebarState, MinimalWorkspaceSidebarTrigger, type MinimalWorkspaceSidebarTriggerProps, SidebarNavEntry, Footer as WorkspaceFooter, type WorkspaceFooterConfig, type FooterProps as WorkspaceFooterProps, Header as WorkspaceHeader, type WorkspaceHeaderConfig, type HeaderProps as WorkspaceHeaderProps, WorkspaceLayout, type WorkspaceLayoutProps, type WorkspaceSidebarConfig };
|
package/dist/layouts/index.js
CHANGED
|
@@ -3,5 +3,7 @@ import Header from "./workspace-layout/header/header.js";
|
|
|
3
3
|
import Footer from "./workspace-layout/footer/footer.js";
|
|
4
4
|
import AccountMenu from "./workspace-layout/account-menu/account-menu.js";
|
|
5
5
|
import WorkspaceLayout from "./workspace-layout/workspace-layout.js";
|
|
6
|
+
import MinimalWorkspaceLayout from "./minimal-workspace-layout/minimal-workspace-layout.js";
|
|
7
|
+
import { MinimalWorkspaceSidebarTrigger } from "./minimal-workspace-layout/sidebar-trigger.js";
|
|
6
8
|
import EntryLayout from "./entry-layout/entry-layout.js";
|
|
7
|
-
export { AccountMenu, EntryLayout, Footer as WorkspaceFooter, Header as WorkspaceHeader, WorkspaceLayout, isSidebarGroup };
|
|
9
|
+
export { AccountMenu, EntryLayout, MinimalWorkspaceLayout, MinimalWorkspaceSidebarTrigger, Footer as WorkspaceFooter, Header as WorkspaceHeader, WorkspaceLayout, isSidebarGroup };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { getStrictContext } from "../../core/utils/get-strict-context.js";
|
|
2
|
+
//#region src/layouts/minimal-workspace-layout/minimal-workspace-layout-context.ts
|
|
3
|
+
var [MinimalWorkspaceLayoutContextProvider, useMinimalWorkspaceLayout] = getStrictContext("MinimalWorkspaceLayout");
|
|
4
|
+
//#endregion
|
|
5
|
+
export { MinimalWorkspaceLayoutContextProvider, useMinimalWorkspaceLayout };
|
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
import { cn } from "../../utils/cn.js";
|
|
2
|
+
import { Button } from "../../components/button/button.js";
|
|
3
|
+
import { SidebarInset, SidebarProvider, useSidebar } from "../../core/animate-ui/components/radix/sidebar.js";
|
|
4
|
+
import Sidebar from "../../components/sidebar/sidebar.js";
|
|
5
|
+
import AccountMenu from "../workspace-layout/account-menu/account-menu.js";
|
|
6
|
+
import { mobileLogo } from "../shared/sidebar-logo.js";
|
|
7
|
+
import { resolveFooterBranding } from "../shared/footer-branding.js";
|
|
8
|
+
import { accountMenuProps } from "../shared/account-menu-props.js";
|
|
9
|
+
import { RailLogo } from "./rail-logo.js";
|
|
10
|
+
import { MinimalWorkspaceLayoutContextProvider } from "./minimal-workspace-layout-context.js";
|
|
11
|
+
import { useCallback, useEffect, useId, useLayoutEffect, useRef, useState } from "react";
|
|
12
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { Menu } from "lucide-react";
|
|
14
|
+
//#region src/layouts/minimal-workspace-layout/minimal-workspace-layout.tsx
|
|
15
|
+
var LOGO_HEIGHT = "var(--espd-minimal-workspace-layout-logo-height,3.5rem)";
|
|
16
|
+
/**
|
|
17
|
+
* Clicks on these inside the collapsed rail do their own thing; a click
|
|
18
|
+
* anywhere else in the rail expands it.
|
|
19
|
+
*/
|
|
20
|
+
var INTERACTIVE = "a, button, input, select, textarea, label, summary, [role=button], [role=link], [role=menuitem], [role=checkbox], [role=switch], [tabindex]:not([tabindex='-1']), [data-rail-ignore]";
|
|
21
|
+
/**
|
|
22
|
+
* The reveal that plays right after the rail expands (applied only then, see
|
|
23
|
+
* `revealing`). Menu rows pop in one by one down the menu: each top-level
|
|
24
|
+
* entry gets an index (`--espd-mwl-i`, 60ms apart) and each row within a menu
|
|
25
|
+
* another (`--espd-mwl-j`, 30ms apart, starting one step after its group's
|
|
26
|
+
* header), so a group's children cascade after it. Rows slide
|
|
27
|
+
* in with a small springy overshoot and lose a slight blur; their icons pop a
|
|
28
|
+
* beat later with a twist. Everything waits until the sidebar is about a third
|
|
29
|
+
* open, so labels never show squeezed into the narrow rail. Indexes are capped
|
|
30
|
+
* so a long menu finishes promptly. `--espd-mwl-duration` is the layout's
|
|
31
|
+
* duration (set on the container).
|
|
32
|
+
*/
|
|
33
|
+
var revealMotion = cn("[&_[data-radix-scroll-area-viewport]>div>div>*:nth-child(2)]:[--espd-mwl-i:1]", "[&_[data-radix-scroll-area-viewport]>div>div>*:nth-child(3)]:[--espd-mwl-i:2]", "[&_[data-radix-scroll-area-viewport]>div>div>*:nth-child(4)]:[--espd-mwl-i:3]", "[&_[data-radix-scroll-area-viewport]>div>div>*:nth-child(5)]:[--espd-mwl-i:4]", "[&_[data-radix-scroll-area-viewport]>div>div>*:nth-child(6)]:[--espd-mwl-i:5]", "[&_[data-radix-scroll-area-viewport]>div>div>*:nth-child(7)]:[--espd-mwl-i:6]", "[&_[data-radix-scroll-area-viewport]>div>div>*:nth-child(8)]:[--espd-mwl-i:7]", "[&_[data-radix-scroll-area-viewport]>div>div>*:nth-child(9)]:[--espd-mwl-i:8]", "[&_[data-radix-scroll-area-viewport]>div>div>*:nth-child(10)]:[--espd-mwl-i:9]", "[&_[data-radix-scroll-area-viewport]>div>div>*:nth-child(n+11)]:[--espd-mwl-i:10]", "[&_[data-slot=sidebar-menu-item]:nth-child(1)]:[--espd-mwl-j:1]", "[&_[data-slot=sidebar-menu-item]:nth-child(2)]:[--espd-mwl-j:2]", "[&_[data-slot=sidebar-menu-item]:nth-child(3)]:[--espd-mwl-j:3]", "[&_[data-slot=sidebar-menu-item]:nth-child(4)]:[--espd-mwl-j:4]", "[&_[data-slot=sidebar-menu-item]:nth-child(5)]:[--espd-mwl-j:5]", "[&_[data-slot=sidebar-menu-item]:nth-child(6)]:[--espd-mwl-j:6]", "[&_[data-slot=sidebar-menu-item]:nth-child(7)]:[--espd-mwl-j:7]", "[&_[data-slot=sidebar-menu-item]:nth-child(8)]:[--espd-mwl-j:8]", "[&_[data-slot=sidebar-menu-item]:nth-child(n+9)]:[--espd-mwl-j:9]", "[&_:is([data-slot=sidebar-group]>button,[data-slot=sidebar-menu-item])]:animate-[espd-pop-in_420ms_cubic-bezier(0.34,1.56,0.64,1)_both]", "[&_:is([data-slot=sidebar-group]>button,[data-slot=sidebar-menu-item])]:[animation-delay:calc(var(--espd-mwl-duration)*0.3+var(--espd-mwl-i,0)*60ms+var(--espd-mwl-j,0)*30ms)]!", "[&_:is([data-slot=sidebar-group]>button>svg:first-child,[data-slot=sidebar-menu-item]_a_span>svg:first-child)]:animate-[espd-icon-pop_480ms_cubic-bezier(0.34,1.56,0.64,1)_both]", "[&_:is([data-slot=sidebar-group]>button>svg:first-child,[data-slot=sidebar-menu-item]_a_span>svg:first-child)]:[animation-delay:calc(var(--espd-mwl-duration)*0.3+var(--espd-mwl-i,0)*60ms+var(--espd-mwl-j,0)*30ms+70ms)]!", "[&_[data-slot=minimal-workspace-layout-sidebar-header]]:animate-[espd-pop-in_420ms_cubic-bezier(0.34,1.56,0.64,1)_both]", "[&_[data-slot=minimal-workspace-layout-sidebar-header]]:[animation-delay:calc(var(--espd-mwl-duration)*0.25)]!", "[&_[data-slot=sidebar-footer]]:animate-[espd-fade-in_var(--espd-duration-slow,300ms)_ease-out_both]", "[&_[data-slot=sidebar-footer]]:[animation-delay:calc(var(--espd-mwl-duration)*0.5)]!", "motion-reduce:[&_*]:animate-none!");
|
|
34
|
+
/** Long enough for the last capped row (10 × 60ms + 9 × 30ms after the start delay) to land. */
|
|
35
|
+
var REVEAL_MS = 1800;
|
|
36
|
+
/** How long the pointer may be off a peeking sidebar before it slides out. */
|
|
37
|
+
var PEEK_CLOSE_GRACE_MS = 200;
|
|
38
|
+
/**
|
|
39
|
+
* How long the pointer rests on the edge before the sidebar peeks on its
|
|
40
|
+
* own. Long enough that a pointer passing through to the screen edge does not
|
|
41
|
+
* open it, short enough to feel like a reveal rather than a wait.
|
|
42
|
+
*/
|
|
43
|
+
var PEEK_HOVER_MS = 300;
|
|
44
|
+
/** Ends a slide-out whose `transitionend` never comes (reduced motion). */
|
|
45
|
+
var CLOSE_FALLBACK_MS = 1e3;
|
|
46
|
+
/** Floating content the sidebar owns: its account menu and tooltips render in portals. */
|
|
47
|
+
var PORTAL = "[data-radix-popper-content-wrapper], [data-slot=tooltip-overlay]";
|
|
48
|
+
/**
|
|
49
|
+
* Colours that follow the surface (`--espd-mwl-surface`), shared by the desktop
|
|
50
|
+
* container and the mobile sheet: text, the right border, and the selected and
|
|
51
|
+
* hovered rows (the library's sidebar accent, redefined as a shade of the
|
|
52
|
+
* surface: darker on a light one, lighter on a dark one).
|
|
53
|
+
*/
|
|
54
|
+
var surfaceColours = cn("bg-[var(--espd-mwl-surface)]", "text-[color:var(--espd-minimal-workspace-layout-sidebar-foreground,var(--color-foreground))]", "border-[color:var(--espd-minimal-workspace-layout-sidebar-border-color,color-mix(in_oklab,var(--espd-mwl-surface)_95%,var(--color-foreground)))]", "[--color-sidebar-accent:var(--espd-minimal-workspace-layout-sidebar-accent,color-mix(in_oklab,var(--espd-mwl-surface)_93%,var(--color-foreground)))]", "[--color-sidebar-accent-foreground:var(--espd-minimal-workspace-layout-sidebar-accent-foreground,var(--color-foreground))]", "[&_[data-slot=account-menu-card]:is(:hover,[data-state=open])]:bg-sidebar-accent");
|
|
55
|
+
/**
|
|
56
|
+
* Mobile sheet (rendered in a portal, outside the layout's tree): always the
|
|
57
|
+
* full sidebar, so it takes the expanded surface.
|
|
58
|
+
*/
|
|
59
|
+
var mobileSheetClass = cn("[--espd-mwl-surface:var(--espd-minimal-workspace-layout-sidebar-background-expanded,var(--espd-minimal-workspace-layout-sidebar-background,var(--color-background)))]", surfaceColours);
|
|
60
|
+
/**
|
|
61
|
+
* Desktop sidebar container.
|
|
62
|
+
*
|
|
63
|
+
* Its surface is the page background, so the rail reads as part of the canvas;
|
|
64
|
+
* `--espd-mwl-surface` (private, set here) holds the surface for the current
|
|
65
|
+
* state, and the border and the expanded shadow are mixed from it, so they
|
|
66
|
+
* follow any surface an app sets, light or dark. Also: the layout's own timing
|
|
67
|
+
* for the width and shadow, the double-arrow cursor on the empty parts of the
|
|
68
|
+
* collapsed rail, and rail icons and avatar centred.
|
|
69
|
+
*/
|
|
70
|
+
var sidebarClass = cn("[--espd-mwl-duration:var(--espd-minimal-workspace-layout-duration,450ms)]", "[--espd-mwl-surface:var(--espd-minimal-workspace-layout-sidebar-background,var(--color-background))]", "group-data-[state=expanded]:[--espd-mwl-surface:var(--espd-minimal-workspace-layout-sidebar-background-expanded,var(--espd-minimal-workspace-layout-sidebar-background,var(--color-background)))]", surfaceColours, "[&_[data-slot=sidebar-inner]]:bg-[var(--espd-mwl-surface)] [&_[data-slot=sidebar-inner]]:transition-colors [&_[data-slot=sidebar-inner]]:duration-[inherit]", "group-data-[state=expanded]:shadow-[shadow:var(--espd-minimal-workspace-layout-sidebar-elevation,12px_0_48px_-16px_color-mix(in_oklab,color-mix(in_oklab,var(--espd-mwl-surface)_85%,black)_45%,transparent))]", "transition-[left,right,width,box-shadow] duration-[var(--espd-mwl-duration)] ease-[var(--espd-minimal-workspace-layout-ease,cubic-bezier(0.4,0,0.2,1))] motion-reduce:transition-none", "top-auto h-[var(--espd-minimal-workspace-layout-height,100dvh)]", "group-data-[state=collapsed]:cursor-ew-resize", "group-data-[state=collapsed]:[&_:is(a,button,[role=button],[role=menuitem])]:cursor-pointer", "group-data-[state=collapsed]:[&_[data-slot=sidebar-group]]:items-center", "group-data-[state=collapsed]:[&_[data-slot=sidebar-footer]]:px-1", "group-data-[state=collapsed]:[&_[data-slot=account-menu-card]]:justify-center group-data-[state=collapsed]:[&_[data-slot=account-menu-card]]:p-0.5", "group-data-[state=collapsed]:[&_[data-slot=account-menu-card]>:not(:first-child,.sr-only)]:hidden");
|
|
71
|
+
/**
|
|
72
|
+
* Added to the desktop container with `hideWhenCollapsed`. The sidebar is
|
|
73
|
+
* `collapsible="offcanvas"`, so hidden it already sits off screen with no gap
|
|
74
|
+
* beside it; these cover the states the primitive has no word for. Peeking it
|
|
75
|
+
* is expanded over the content: above the top-right slot (z-20), with the
|
|
76
|
+
* wider shadow, read through the expanded-shadow rule's token. Closing it is
|
|
77
|
+
* still expanded (labels intact) while it slides off screen. Hidden it leaves
|
|
78
|
+
* the tab order; the mode flips to hidden once the slide-out has ended, so
|
|
79
|
+
* that needs no transition.
|
|
80
|
+
*/
|
|
81
|
+
var hiddenSidebarClass = cn("group-data-[sidebar-mode=hidden]/sidebar-wrapper:invisible", "group-data-[sidebar-mode=closing]/sidebar-wrapper:left-[calc(var(--sidebar-width)*-1)]", "group-data-[sidebar-mode=peek]/sidebar-wrapper:z-30 group-data-[sidebar-mode=closing]/sidebar-wrapper:z-30", "group-data-[sidebar-mode=peek]/sidebar-wrapper:[--espd-minimal-workspace-layout-sidebar-elevation:var(--espd-minimal-workspace-layout-sidebar-overlay-elevation,24px_0_96px_-8px_color-mix(in_oklab,color-mix(in_oklab,var(--espd-mwl-surface)_80%,black)_55%,transparent))]");
|
|
82
|
+
/** On the layout: the gap beside the sidebar stays closed while it peeks or slides out. */
|
|
83
|
+
var hiddenGapClass = "data-[sidebar-mode=peek]:[&_[data-slot=sidebar-gap]]:w-0 data-[sidebar-mode=closing]:[&_[data-slot=sidebar-gap]]:w-0";
|
|
84
|
+
/**
|
|
85
|
+
* The hot zone along the content's left edge while the sidebar is hidden: a
|
|
86
|
+
* thin strip in the edge colour appears on hover, and the sidebar peeks once
|
|
87
|
+
* the pointer has rested there for a moment, or at once on a click. The zone
|
|
88
|
+
* is wider than the strip (a token), because the first pixels of a window
|
|
89
|
+
* often belong to the OS: a maximised window pins the cursor on its edge,
|
|
90
|
+
* inside the window manager's resize grip, where the page sees nothing.
|
|
91
|
+
* Mouse-only by design (the trigger and ⌘/Ctrl+B serve the keyboard).
|
|
92
|
+
*/
|
|
93
|
+
var edgeClass = cn("absolute inset-y-0 left-0 z-10 w-[var(--espd-minimal-workspace-layout-edge-hit-width,12px)] cursor-e-resize select-none", "before:absolute before:inset-y-0 before:left-0 before:w-[var(--espd-minimal-workspace-layout-edge-width,3px)] before:bg-[var(--espd-minimal-workspace-layout-edge-color,var(--color-primary))]", "before:opacity-0 before:transition-opacity before:duration-[var(--espd-duration-fast,150ms)] motion-reduce:before:transition-none hover:before:opacity-100");
|
|
94
|
+
function MinimalWorkspaceShell({ appName, logo, logoCollapsed, logoMobile, logoAssets, footerBranding, children, sidebarConfig, headerConfig, topRightContent, labels, onLogoutClick, onProfileCardClick, onColorThemeChange, colorTheme, onLanguageChange, languages, currentLanguage, accountMenuItems, hiddenSidebar }) {
|
|
95
|
+
const { state, isMobile, setOpen } = useSidebar();
|
|
96
|
+
const sidebarId = useId();
|
|
97
|
+
const expandable = sidebarConfig.expandable ?? true;
|
|
98
|
+
const hide = sidebarConfig.hideWhenCollapsed ?? false;
|
|
99
|
+
const collapsed = state === "collapsed" && !isMobile;
|
|
100
|
+
const darkMode = colorTheme === "dark";
|
|
101
|
+
const LinkComponent = sidebarConfig.linkComponent;
|
|
102
|
+
const topRight = topRightContent ?? headerConfig?.rightContent;
|
|
103
|
+
const showLabel = hide ? labels?.showSidebar ?? "Show sidebar" : labels?.expandSidebar ?? "Expand sidebar";
|
|
104
|
+
const hideLabel = hide ? labels?.hideSidebar ?? "Hide sidebar" : labels?.collapseSidebar ?? "Collapse sidebar";
|
|
105
|
+
const [triggers, setTriggers] = useState(0);
|
|
106
|
+
const registerTrigger = useCallback(() => {
|
|
107
|
+
setTriggers((count) => count + 1);
|
|
108
|
+
return () => setTriggers((count) => count - 1);
|
|
109
|
+
}, []);
|
|
110
|
+
const peekOnHover = sidebarConfig.peekOnHover ?? true;
|
|
111
|
+
const hoverTimer = useRef(void 0);
|
|
112
|
+
const cancelHoverPeek = useCallback(() => {
|
|
113
|
+
if (hoverTimer.current === void 0) return;
|
|
114
|
+
clearTimeout(hoverTimer.current);
|
|
115
|
+
hoverTimer.current = void 0;
|
|
116
|
+
}, []);
|
|
117
|
+
const { startPeek } = hiddenSidebar;
|
|
118
|
+
const onEdgePointerEnter = (event) => {
|
|
119
|
+
if (!peekOnHover || event.pointerType === "touch" || event.pointerType === "pen") return;
|
|
120
|
+
if (event.buttons !== 0) return;
|
|
121
|
+
cancelHoverPeek();
|
|
122
|
+
hoverTimer.current = setTimeout(() => {
|
|
123
|
+
hoverTimer.current = void 0;
|
|
124
|
+
startPeek();
|
|
125
|
+
}, PEEK_HOVER_MS);
|
|
126
|
+
};
|
|
127
|
+
useEffect(() => cancelHoverPeek, [cancelHoverPeek]);
|
|
128
|
+
const { mode, closePeek } = hiddenSidebar;
|
|
129
|
+
useEffect(() => {
|
|
130
|
+
if (mode !== "peek" || isMobile) return;
|
|
131
|
+
const container = document.getElementById(sidebarId);
|
|
132
|
+
if (!container) return;
|
|
133
|
+
let entered = false;
|
|
134
|
+
let timer;
|
|
135
|
+
const inside = (node) => node instanceof Element && (container.contains(node) || node.closest(PORTAL) !== null);
|
|
136
|
+
const ownsOpenPopup = () => container.querySelector("[aria-haspopup][aria-expanded=\"true\"]") !== null;
|
|
137
|
+
const cancel = () => {
|
|
138
|
+
if (timer === void 0) return;
|
|
139
|
+
clearTimeout(timer);
|
|
140
|
+
timer = void 0;
|
|
141
|
+
};
|
|
142
|
+
const schedule = () => {
|
|
143
|
+
timer ?? (timer = setTimeout(closePeek, PEEK_CLOSE_GRACE_MS));
|
|
144
|
+
};
|
|
145
|
+
const onPointerOver = (event) => {
|
|
146
|
+
if (inside(event.target)) {
|
|
147
|
+
entered = true;
|
|
148
|
+
cancel();
|
|
149
|
+
} else if (ownsOpenPopup()) cancel();
|
|
150
|
+
else if (entered) schedule();
|
|
151
|
+
};
|
|
152
|
+
const onPointerLeave = (event) => {
|
|
153
|
+
if (entered && !inside(event.relatedTarget) && !ownsOpenPopup()) schedule();
|
|
154
|
+
};
|
|
155
|
+
const onFocusOut = (event) => {
|
|
156
|
+
if (event.relatedTarget && !inside(event.relatedTarget) && !ownsOpenPopup()) closePeek();
|
|
157
|
+
};
|
|
158
|
+
const onKeyDown = (event) => {
|
|
159
|
+
if (event.key === "Escape" && !ownsOpenPopup() && !document.querySelector("[data-radix-popper-content-wrapper]")) closePeek();
|
|
160
|
+
};
|
|
161
|
+
document.addEventListener("pointerover", onPointerOver);
|
|
162
|
+
container.addEventListener("pointerleave", onPointerLeave);
|
|
163
|
+
container.addEventListener("focusout", onFocusOut);
|
|
164
|
+
document.addEventListener("keydown", onKeyDown);
|
|
165
|
+
return () => {
|
|
166
|
+
cancel();
|
|
167
|
+
document.removeEventListener("pointerover", onPointerOver);
|
|
168
|
+
container.removeEventListener("pointerleave", onPointerLeave);
|
|
169
|
+
container.removeEventListener("focusout", onFocusOut);
|
|
170
|
+
document.removeEventListener("keydown", onKeyDown);
|
|
171
|
+
};
|
|
172
|
+
}, [
|
|
173
|
+
mode,
|
|
174
|
+
isMobile,
|
|
175
|
+
sidebarId,
|
|
176
|
+
closePeek
|
|
177
|
+
]);
|
|
178
|
+
useEffect(() => {
|
|
179
|
+
if (mode !== "hidden") return;
|
|
180
|
+
const active = document.activeElement;
|
|
181
|
+
if (active instanceof HTMLElement && document.getElementById(sidebarId)?.contains(active)) active.blur();
|
|
182
|
+
}, [mode, sidebarId]);
|
|
183
|
+
const [revealing, setRevealing] = useState(false);
|
|
184
|
+
const wasCollapsed = useRef(collapsed);
|
|
185
|
+
useLayoutEffect(() => {
|
|
186
|
+
const expanded = wasCollapsed.current && !collapsed;
|
|
187
|
+
wasCollapsed.current = collapsed;
|
|
188
|
+
if (!expanded) {
|
|
189
|
+
if (collapsed) setRevealing(false);
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
setRevealing(true);
|
|
193
|
+
const timer = setTimeout(() => setRevealing(false), REVEAL_MS);
|
|
194
|
+
return () => clearTimeout(timer);
|
|
195
|
+
}, [collapsed]);
|
|
196
|
+
const expandFromRail = (event) => {
|
|
197
|
+
if (!expandable || !collapsed) return;
|
|
198
|
+
const target = event.target;
|
|
199
|
+
if (!event.currentTarget.contains(target)) return;
|
|
200
|
+
if (target.closest(INTERACTIVE)) return;
|
|
201
|
+
setOpen(true);
|
|
202
|
+
};
|
|
203
|
+
const header = typeof sidebarConfig.header === "function" ? sidebarConfig.header({ collapsed }) : sidebarConfig.header;
|
|
204
|
+
const footerBrandingNode = resolveFooterBranding({
|
|
205
|
+
footerBranding,
|
|
206
|
+
appName,
|
|
207
|
+
hideCompanyBranding: sidebarConfig.hideCompanyBranding,
|
|
208
|
+
darkMode
|
|
209
|
+
});
|
|
210
|
+
const accountMenu = /* @__PURE__ */ jsx(AccountMenu, {
|
|
211
|
+
...accountMenuProps({
|
|
212
|
+
headerConfig,
|
|
213
|
+
onLogoutClick,
|
|
214
|
+
onProfileCardClick,
|
|
215
|
+
onColorThemeChange,
|
|
216
|
+
colorTheme,
|
|
217
|
+
onLanguageChange,
|
|
218
|
+
languages,
|
|
219
|
+
currentLanguage,
|
|
220
|
+
accountMenuItems
|
|
221
|
+
}),
|
|
222
|
+
triggerVariant: "card",
|
|
223
|
+
side: collapsed ? "right" : "top",
|
|
224
|
+
align: collapsed ? "end" : "start"
|
|
225
|
+
});
|
|
226
|
+
const footer = /* @__PURE__ */ jsxs("div", {
|
|
227
|
+
className: "flex w-full min-w-0 flex-col gap-2",
|
|
228
|
+
children: [
|
|
229
|
+
sidebarConfig.footer,
|
|
230
|
+
footerBrandingNode,
|
|
231
|
+
accountMenu
|
|
232
|
+
]
|
|
233
|
+
});
|
|
234
|
+
return /* @__PURE__ */ jsxs(MinimalWorkspaceLayoutContextProvider, {
|
|
235
|
+
value: {
|
|
236
|
+
sidebarId,
|
|
237
|
+
pinned: hiddenSidebar.pinned,
|
|
238
|
+
expandable,
|
|
239
|
+
hidden: hide,
|
|
240
|
+
showLabel,
|
|
241
|
+
hideLabel,
|
|
242
|
+
registerTrigger
|
|
243
|
+
},
|
|
244
|
+
children: [/* @__PURE__ */ jsx(Sidebar, {
|
|
245
|
+
id: sidebarId,
|
|
246
|
+
items: sidebarConfig.items,
|
|
247
|
+
currentPath: sidebarConfig.currentPath,
|
|
248
|
+
linkComponent: LinkComponent,
|
|
249
|
+
focusActiveGroup: sidebarConfig.focusActiveGroup,
|
|
250
|
+
collapsible: hide ? "offcanvas" : "icon",
|
|
251
|
+
header: /* @__PURE__ */ jsx(RailLogo, {
|
|
252
|
+
logo,
|
|
253
|
+
logoCollapsed,
|
|
254
|
+
logoAssets,
|
|
255
|
+
appName,
|
|
256
|
+
darkMode,
|
|
257
|
+
indexPath: sidebarConfig.indexPath,
|
|
258
|
+
linkComponent: LinkComponent,
|
|
259
|
+
sidebarId,
|
|
260
|
+
expandable,
|
|
261
|
+
expandLabel: showLabel,
|
|
262
|
+
collapseLabel: hideLabel,
|
|
263
|
+
showCollapse: triggers === 0
|
|
264
|
+
}),
|
|
265
|
+
headerHeight: LOGO_HEIGHT,
|
|
266
|
+
headerClassName: "px-[var(--espd-minimal-workspace-layout-logo-padding,0.75rem)]",
|
|
267
|
+
beforeContent: header != null ? /* @__PURE__ */ jsx("div", {
|
|
268
|
+
"data-slot": "minimal-workspace-layout-sidebar-header",
|
|
269
|
+
className: cn("flex shrink-0 flex-col gap-1 px-2 pb-2", collapsed && "items-center"),
|
|
270
|
+
children: header
|
|
271
|
+
}) : void 0,
|
|
272
|
+
footer,
|
|
273
|
+
className: cn(sidebarClass, hide && hiddenSidebarClass, revealing && revealMotion),
|
|
274
|
+
mobileClassName: mobileSheetClass,
|
|
275
|
+
onClick: hide ? void 0 : expandFromRail
|
|
276
|
+
}), /* @__PURE__ */ jsxs(SidebarInset, {
|
|
277
|
+
"data-slot": "minimal-workspace-layout-main",
|
|
278
|
+
className: "h-[var(--espd-minimal-workspace-layout-height,100dvh)] max-h-[var(--espd-minimal-workspace-layout-height,100dvh)] overflow-hidden bg-[var(--espd-minimal-workspace-layout-content-background,var(--color-background))]",
|
|
279
|
+
children: [isMobile && /* @__PURE__ */ jsxs("div", {
|
|
280
|
+
className: "flex h-12 shrink-0 items-center gap-2 border-b border-[color:color-mix(in_oklab,var(--espd-minimal-workspace-layout-content-background,var(--color-background))_90%,var(--color-foreground))] px-2",
|
|
281
|
+
children: [
|
|
282
|
+
/* @__PURE__ */ jsx(MobileMenuButton, { label: labels?.openMenu ?? "Open menu" }),
|
|
283
|
+
mobileLogo({
|
|
284
|
+
logoMobile,
|
|
285
|
+
logoAssets,
|
|
286
|
+
appName,
|
|
287
|
+
darkMode,
|
|
288
|
+
indexPath: sidebarConfig.indexPath,
|
|
289
|
+
linkComponent: LinkComponent
|
|
290
|
+
}),
|
|
291
|
+
topRight != null && /* @__PURE__ */ jsx("div", {
|
|
292
|
+
className: "ml-auto flex items-center gap-2",
|
|
293
|
+
children: topRight
|
|
294
|
+
})
|
|
295
|
+
]
|
|
296
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
297
|
+
className: "relative min-h-0 flex-1 overflow-hidden",
|
|
298
|
+
children: [
|
|
299
|
+
/* @__PURE__ */ jsx("div", {
|
|
300
|
+
"data-slot": "minimal-workspace-layout-content",
|
|
301
|
+
className: "h-full overflow-y-auto",
|
|
302
|
+
children
|
|
303
|
+
}),
|
|
304
|
+
hiddenSidebar.enabled && !isMobile && (mode === "hidden" || mode === "closing") && /* @__PURE__ */ jsx("div", {
|
|
305
|
+
"data-slot": "minimal-workspace-layout-edge",
|
|
306
|
+
"aria-hidden": "true",
|
|
307
|
+
className: edgeClass,
|
|
308
|
+
onClick: startPeek,
|
|
309
|
+
onPointerEnter: onEdgePointerEnter,
|
|
310
|
+
onPointerLeave: cancelHoverPeek
|
|
311
|
+
}),
|
|
312
|
+
!isMobile && topRight != null && /* @__PURE__ */ jsx("div", {
|
|
313
|
+
"data-slot": "minimal-workspace-layout-top-right",
|
|
314
|
+
className: "pointer-events-none absolute top-[var(--espd-minimal-workspace-layout-top-right-offset-y,0.75rem)] right-[var(--espd-minimal-workspace-layout-top-right-offset-x,1rem)] z-20 flex",
|
|
315
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
316
|
+
className: "pointer-events-auto flex items-center gap-2 animate-[espd-fade-in_var(--espd-duration-slow,300ms)_ease-out_both] motion-reduce:animate-none",
|
|
317
|
+
children: topRight
|
|
318
|
+
})
|
|
319
|
+
})
|
|
320
|
+
]
|
|
321
|
+
})]
|
|
322
|
+
})]
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
function MobileMenuButton({ label }) {
|
|
326
|
+
const { setOpenMobile } = useSidebar();
|
|
327
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
328
|
+
variant: "ghost",
|
|
329
|
+
size: "icon",
|
|
330
|
+
hideRingOnHover: true,
|
|
331
|
+
"aria-label": label,
|
|
332
|
+
className: "size-9 shrink-0",
|
|
333
|
+
onClick: () => setOpenMobile(true),
|
|
334
|
+
children: /* @__PURE__ */ jsx(Menu, { className: "size-5" })
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Header-less app shell: an icon rail that expands into a labelled sidebar
|
|
339
|
+
* (or, with `sidebarConfig.hideWhenCollapsed`, a hidden sidebar that peeks
|
|
340
|
+
* over the content from its left edge and opens inline from a trigger), and
|
|
341
|
+
* the page content on a canvas beside it. Takes WorkspaceLayout's props; see
|
|
342
|
+
* {@link MinimalWorkspaceLayoutProps} for the differences.
|
|
343
|
+
*/
|
|
344
|
+
function MinimalWorkspaceLayout(props) {
|
|
345
|
+
const { sidebarConfig, sidebarOpen, defaultSidebarOpen, onSidebarOpenChange } = props;
|
|
346
|
+
const expandable = sidebarConfig.expandable ?? true;
|
|
347
|
+
const hide = sidebarConfig.hideWhenCollapsed ?? false;
|
|
348
|
+
const [internalOpen, setInternalOpen] = useState(defaultSidebarOpen ?? false);
|
|
349
|
+
const open = sidebarOpen ?? internalOpen;
|
|
350
|
+
const setOpen = (next) => {
|
|
351
|
+
if (onSidebarOpenChange) onSidebarOpenChange(next);
|
|
352
|
+
else setInternalOpen(next);
|
|
353
|
+
};
|
|
354
|
+
const [overlay, setOverlay] = useState("none");
|
|
355
|
+
const [prevOpen, setPrevOpen] = useState(open);
|
|
356
|
+
if (open !== prevOpen) {
|
|
357
|
+
setPrevOpen(open);
|
|
358
|
+
setOverlay(!open && hide && expandable ? "closing" : "none");
|
|
359
|
+
}
|
|
360
|
+
const startPeek = useCallback(() => setOverlay("peek"), []);
|
|
361
|
+
const closePeek = useCallback(() => setOverlay((current) => current === "peek" ? "closing" : current), []);
|
|
362
|
+
const finishClosing = useCallback(() => setOverlay((current) => current === "closing" ? "none" : current), []);
|
|
363
|
+
useEffect(() => {
|
|
364
|
+
if (overlay !== "closing") return;
|
|
365
|
+
const timer = setTimeout(finishClosing, CLOSE_FALLBACK_MS);
|
|
366
|
+
return () => clearTimeout(timer);
|
|
367
|
+
}, [overlay, finishClosing]);
|
|
368
|
+
const onTransitionEnd = (event) => {
|
|
369
|
+
if (overlay !== "closing") return;
|
|
370
|
+
if (event.target.dataset?.slot === "sidebar-container") finishClosing();
|
|
371
|
+
};
|
|
372
|
+
const providerOpen = expandable && (open || overlay !== "none");
|
|
373
|
+
const mode = !hide ? void 0 : !expandable ? "hidden" : open ? "pinned" : overlay === "none" ? "hidden" : overlay;
|
|
374
|
+
const handleOpenChange = (next) => {
|
|
375
|
+
if (!expandable) return;
|
|
376
|
+
if (!hide || overlay === "none") setOpen(next);
|
|
377
|
+
else if (next) setOpen(true);
|
|
378
|
+
else if (overlay === "peek") setOverlay("closing");
|
|
379
|
+
};
|
|
380
|
+
return /* @__PURE__ */ jsx(SidebarProvider, {
|
|
381
|
+
"data-slot": "minimal-workspace-layout",
|
|
382
|
+
"data-sidebar-mode": mode,
|
|
383
|
+
open: providerOpen,
|
|
384
|
+
onOpenChange: handleOpenChange,
|
|
385
|
+
onTransitionEnd,
|
|
386
|
+
className: cn("min-h-0", "[&_[data-slot=sidebar-gap]]:duration-[var(--espd-minimal-workspace-layout-duration,450ms)] [&_[data-slot=sidebar-gap]]:ease-[var(--espd-minimal-workspace-layout-ease,cubic-bezier(0.4,0,0.2,1))] motion-reduce:[&_[data-slot=sidebar-gap]]:transition-none", hide && hiddenGapClass),
|
|
387
|
+
style: {
|
|
388
|
+
"--sidebar-width": "var(--espd-minimal-workspace-layout-sidebar-width, var(--espd-sidebar-width))",
|
|
389
|
+
"--sidebar-width-collapsed": "var(--espd-minimal-workspace-layout-sidebar-width-collapsed,3.5rem)"
|
|
390
|
+
},
|
|
391
|
+
children: /* @__PURE__ */ jsx(MinimalWorkspaceShell, {
|
|
392
|
+
...props,
|
|
393
|
+
hiddenSidebar: {
|
|
394
|
+
enabled: hide && expandable,
|
|
395
|
+
mode,
|
|
396
|
+
pinned: expandable && open,
|
|
397
|
+
startPeek,
|
|
398
|
+
closePeek
|
|
399
|
+
}
|
|
400
|
+
})
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
//#endregion
|
|
404
|
+
export { MinimalWorkspaceLayout as default };
|