@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,8 @@
|
|
|
1
|
+
import { SimpleCard } from "./simple-card.js";
|
|
2
|
+
import { BasicDetailsCard } from "./basic-details-card.js";
|
|
3
|
+
import NoDataCard from "./no-data-card/no-data-card.js";
|
|
4
|
+
import { CollapsibleCard } from "./collapsible-card.js";
|
|
5
|
+
import { SectionCard } from "./section-card.js";
|
|
6
|
+
import { animatedCardAnimations, animatedCardTypeKeys } from "./animated-card/animated-card-animations.js";
|
|
7
|
+
import { AnimatedCard } from "./animated-card/animated-card.js";
|
|
8
|
+
export { AnimatedCard, BasicDetailsCard, CollapsibleCard, NoDataCard, SectionCard, SimpleCard, animatedCardAnimations, animatedCardTypeKeys };
|
|
@@ -2,15 +2,89 @@
|
|
|
2
2
|
import { cn } from "../../utils/cn.js";
|
|
3
3
|
import { isPresetColor } from "../../utils/color.js";
|
|
4
4
|
import { resolveVariantStyles } from "../../utils/variant.js";
|
|
5
|
+
import { useHasTooltipProvider } from "../../core/animate-ui/primitives/animate/tooltip.js";
|
|
6
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../../core/animate-ui/components/animate/tooltip.js";
|
|
5
7
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../../core/collapsible.js";
|
|
6
8
|
import { Card } from "../../core/card.js";
|
|
7
|
-
import { Tooltip, TooltipContent, TooltipTrigger } from "../../core/animate-ui/components/animate/tooltip.js";
|
|
8
9
|
import { Button } from "../button/button.js";
|
|
9
10
|
import { VariantGradientUnderlay } from "../../utils/variant-gradient-underlay.js";
|
|
10
|
-
import { Children, cloneElement, isValidElement, useCallback, useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
11
|
+
import { Children, cloneElement, isValidElement, useCallback, useEffect, useId, useLayoutEffect, useRef, useState } from "react";
|
|
11
12
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
12
13
|
import { ChevronDown, ChevronUp } from "lucide-react";
|
|
13
14
|
//#region src/components/cards/section-card.tsx
|
|
15
|
+
/** Hover intent: a pointer just passing over the card does not open it. */
|
|
16
|
+
var HOVER_OPEN_DELAY_MS = 80;
|
|
17
|
+
/** Grace period so brushing past the card's edge does not collapse it. */
|
|
18
|
+
var HOVER_CLOSE_DELAY_MS = 160;
|
|
19
|
+
var HOVER_BODY_CLASS = cn("grid motion-safe:transition-[grid-template-rows]", "motion-safe:duration-[calc(var(--espd-duration-slow,300ms)*5/3)] motion-safe:ease-[cubic-bezier(0.32,0.72,0,1)]", "data-[state=closed]:grid-rows-[0fr] data-[state=open]:grid-rows-[1fr]", "data-[state=closed]:motion-safe:duration-[calc(var(--espd-duration-slow,300ms)*7/6)] data-[state=closed]:motion-safe:ease-[cubic-bezier(0.4,0,0.2,1)]");
|
|
20
|
+
var HOVER_BODY_INNER_CLASS = cn("min-h-0 overflow-hidden motion-safe:transition-[opacity,translate]", "motion-safe:duration-[calc(var(--espd-duration-slow,300ms)*3/2)] motion-safe:delay-[calc(var(--espd-duration-fast,150ms)/2)] motion-safe:ease-out", "group-data-[state=closed]/hover-body:opacity-0 group-data-[state=closed]/hover-body:-translate-y-1", "group-data-[state=closed]/hover-body:motion-safe:duration-[var(--espd-duration-normal,200ms)] group-data-[state=closed]/hover-body:motion-safe:delay-0");
|
|
21
|
+
var HOVER_ICON_CLASS = cn("motion-safe:transition-[scale,rotate]", "motion-safe:duration-[calc(var(--espd-duration-slow,300ms)*3/2)] motion-safe:ease-[cubic-bezier(0.34,1.56,0.64,1)]", "group-data-[state=open]/section-card:scale-115 group-data-[state=open]/section-card:-rotate-8", "group-data-[state=closed]/section-card:motion-safe:duration-[var(--espd-duration-slow,300ms)] group-data-[state=closed]/section-card:motion-safe:ease-out");
|
|
22
|
+
function useHoverExpand(enabled, onOpenChange) {
|
|
23
|
+
const [hovered, setHovered] = useState(false);
|
|
24
|
+
const [focusWithin, setFocusWithin] = useState(false);
|
|
25
|
+
const [tapOpen, setTapOpen] = useState(false);
|
|
26
|
+
const rootRef = useRef(null);
|
|
27
|
+
const timerRef = useRef(null);
|
|
28
|
+
const lastPointerTypeRef = useRef("");
|
|
29
|
+
const bodyRef = useRef(null);
|
|
30
|
+
const clearTimer = () => {
|
|
31
|
+
if (timerRef.current != null) clearTimeout(timerRef.current);
|
|
32
|
+
timerRef.current = null;
|
|
33
|
+
};
|
|
34
|
+
useEffect(() => clearTimer, []);
|
|
35
|
+
const open = enabled && (hovered || focusWithin || tapOpen);
|
|
36
|
+
const onOpenChangeRef = useRef(onOpenChange);
|
|
37
|
+
onOpenChangeRef.current = onOpenChange;
|
|
38
|
+
const prevOpenRef = useRef(open);
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
if (prevOpenRef.current === open) return;
|
|
41
|
+
prevOpenRef.current = open;
|
|
42
|
+
onOpenChangeRef.current?.(open);
|
|
43
|
+
}, [open]);
|
|
44
|
+
useLayoutEffect(() => {
|
|
45
|
+
if (bodyRef.current) bodyRef.current.inert = !open;
|
|
46
|
+
});
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
if (!tapOpen) return;
|
|
49
|
+
const onDown = (e) => {
|
|
50
|
+
if (!rootRef.current?.contains(e.target)) setTapOpen(false);
|
|
51
|
+
};
|
|
52
|
+
document.addEventListener("pointerdown", onDown);
|
|
53
|
+
return () => document.removeEventListener("pointerdown", onDown);
|
|
54
|
+
}, [tapOpen]);
|
|
55
|
+
const rootProps = enabled ? {
|
|
56
|
+
ref: rootRef,
|
|
57
|
+
onPointerDown: (e) => {
|
|
58
|
+
lastPointerTypeRef.current = e.pointerType;
|
|
59
|
+
},
|
|
60
|
+
onPointerEnter: (e) => {
|
|
61
|
+
if (e.pointerType === "touch") return;
|
|
62
|
+
clearTimer();
|
|
63
|
+
timerRef.current = setTimeout(() => setHovered(true), HOVER_OPEN_DELAY_MS);
|
|
64
|
+
},
|
|
65
|
+
onPointerLeave: (e) => {
|
|
66
|
+
if (e.pointerType === "touch") return;
|
|
67
|
+
clearTimer();
|
|
68
|
+
timerRef.current = setTimeout(() => setHovered(false), HOVER_CLOSE_DELAY_MS);
|
|
69
|
+
},
|
|
70
|
+
onFocus: (e) => {
|
|
71
|
+
if (e.target.matches?.(":focus-visible")) setFocusWithin(true);
|
|
72
|
+
},
|
|
73
|
+
onBlur: (e) => {
|
|
74
|
+
if (!e.currentTarget.contains(e.relatedTarget)) setFocusWithin(false);
|
|
75
|
+
}
|
|
76
|
+
} : void 0;
|
|
77
|
+
const onHeaderClick = () => {
|
|
78
|
+
if (lastPointerTypeRef.current === "touch") setTapOpen((v) => !v);
|
|
79
|
+
lastPointerTypeRef.current = "";
|
|
80
|
+
};
|
|
81
|
+
return {
|
|
82
|
+
open,
|
|
83
|
+
rootProps,
|
|
84
|
+
bodyRef,
|
|
85
|
+
onHeaderClick
|
|
86
|
+
};
|
|
87
|
+
}
|
|
14
88
|
var sizeStyles = {
|
|
15
89
|
sm: {
|
|
16
90
|
pad: "p-3",
|
|
@@ -74,7 +148,7 @@ function iconSizedForSection(icon, iconClass) {
|
|
|
74
148
|
var HEADER_WRAP_ROW_CLASS = "flex-wrap";
|
|
75
149
|
var HEADER_MAIN_BASIS_CLASS = "basis-48";
|
|
76
150
|
var HEADER_RIGHT_CLASS = "ml-auto max-w-full shrink-0";
|
|
77
|
-
var cardClassName = "rounded-lg border-border bg-card shadow-
|
|
151
|
+
var cardClassName = "rounded-[var(--espd-own-radius,var(--espd-radius-surface,var(--radius-lg)))] border-border bg-card shadow-[shadow:var(--espd-own-elevation,var(--espd-elevation-surface,0_0_#0000))] overflow-hidden";
|
|
78
152
|
function hasTooltipContent(content) {
|
|
79
153
|
if (content == null) return false;
|
|
80
154
|
if (typeof content === "string") return content.length > 0;
|
|
@@ -89,6 +163,7 @@ function hasRenderableContent(content) {
|
|
|
89
163
|
function TruncatedLineWithTooltip({ className, textStyle, tooltipContent, children }) {
|
|
90
164
|
const textRef = useRef(null);
|
|
91
165
|
const [isTruncated, setIsTruncated] = useState(false);
|
|
166
|
+
const hasTooltipProvider = useHasTooltipProvider();
|
|
92
167
|
const measure = useCallback(() => {
|
|
93
168
|
const el = textRef.current;
|
|
94
169
|
if (!el) return;
|
|
@@ -115,7 +190,7 @@ function TruncatedLineWithTooltip({ className, textStyle, tooltipContent, childr
|
|
|
115
190
|
children
|
|
116
191
|
});
|
|
117
192
|
if (!(isTruncated && hasTooltipContent(tooltipContent))) return line;
|
|
118
|
-
|
|
193
|
+
const tooltip = /* @__PURE__ */ jsxs(Tooltip, {
|
|
119
194
|
side: "top",
|
|
120
195
|
children: [/* @__PURE__ */ jsx(TooltipTrigger, {
|
|
121
196
|
className: "block min-w-0 w-full cursor-inherit text-left",
|
|
@@ -128,8 +203,18 @@ function TruncatedLineWithTooltip({ className, textStyle, tooltipContent, childr
|
|
|
128
203
|
})
|
|
129
204
|
})]
|
|
130
205
|
});
|
|
206
|
+
if (hasTooltipProvider) return tooltip;
|
|
207
|
+
return /* @__PURE__ */ jsx(TooltipProvider, {
|
|
208
|
+
openDelay: 300,
|
|
209
|
+
closeDelay: 100,
|
|
210
|
+
children: tooltip
|
|
211
|
+
});
|
|
131
212
|
}
|
|
132
|
-
function SectionCard({ icon, primaryText, secondaryText, truncateSecondaryText = true, actions, allowCollapse = true, hideCollapseIcon = false, defaultOpen = true, open: controlledOpen, size = "default", variant = "outline", color = "gray", children, className, style, fillHeight = false, onOpenChange }) {
|
|
213
|
+
function SectionCard({ icon, primaryText, secondaryText, truncateSecondaryText = true, actions, allowCollapse: allowCollapseProp = true, hideCollapseIcon = false, defaultOpen = true, open: controlledOpen, size = "default", variant = "outline", color = "gray", children, className, style, fillHeight: fillHeightProp = false, onOpenChange, expandOnHover = false, radius, elevation }) {
|
|
214
|
+
const allowCollapse = expandOnHover ? false : allowCollapseProp;
|
|
215
|
+
const fillHeight = expandOnHover ? false : fillHeightProp;
|
|
216
|
+
const hover = useHoverExpand(expandOnHover, onOpenChange);
|
|
217
|
+
const hoverBodyId = useId();
|
|
133
218
|
const s = sizeStyles[size];
|
|
134
219
|
const resolvedColor = color;
|
|
135
220
|
const variantStyles = variant != null ? resolveVariantStyles(variant, resolvedColor) : null;
|
|
@@ -154,7 +239,7 @@ function SectionCard({ icon, primaryText, secondaryText, truncateSecondaryText =
|
|
|
154
239
|
const isHeaderRequired = hasIcon || hasHeaderText || hasHeaderRight;
|
|
155
240
|
const hasBody = hasRenderableContent(children);
|
|
156
241
|
const headerMain = /* @__PURE__ */ jsxs(Fragment$1, { children: [hasIcon && /* @__PURE__ */ jsx("div", {
|
|
157
|
-
className: "flex shrink-0 self-center items-center justify-center",
|
|
242
|
+
className: cn("flex shrink-0 self-center items-center justify-center", expandOnHover && HOVER_ICON_CLASS),
|
|
158
243
|
style: variantStyles?.foregroundStyle,
|
|
159
244
|
children: iconSizedForSection(icon, cn(s.icon, variantStyles?.foreground))
|
|
160
245
|
}), hasHeaderText && /* @__PURE__ */ jsxs("div", {
|
|
@@ -201,7 +286,17 @@ function SectionCard({ icon, primaryText, secondaryText, truncateSecondaryText =
|
|
|
201
286
|
className: cn("flex items-center gap-2", HEADER_RIGHT_CLASS, s.headerRightPad),
|
|
202
287
|
children: [actions, showCollapseIcon ? chevronButton : null]
|
|
203
288
|
}) : null;
|
|
204
|
-
const header =
|
|
289
|
+
const header = expandOnHover ? /* @__PURE__ */ jsxs("div", {
|
|
290
|
+
className: headerRowClass,
|
|
291
|
+
children: [/* @__PURE__ */ jsx("button", {
|
|
292
|
+
type: "button",
|
|
293
|
+
className: cn("section-card-header", "flex min-w-0 flex-1 items-center text-left rounded-md", headerMainPad, s.gap, "cursor-default outline-none", "focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"),
|
|
294
|
+
"aria-expanded": hasBody ? hover.open : void 0,
|
|
295
|
+
"aria-controls": hasBody ? hoverBodyId : void 0,
|
|
296
|
+
onClick: hover.onHeaderClick,
|
|
297
|
+
children: headerMain
|
|
298
|
+
}), headerRight]
|
|
299
|
+
}) : allowCollapse ? /* @__PURE__ */ jsxs("div", {
|
|
205
300
|
className: headerRowClass,
|
|
206
301
|
children: [/* @__PURE__ */ jsx(CollapsibleTrigger, {
|
|
207
302
|
asChild: true,
|
|
@@ -224,7 +319,7 @@ function SectionCard({ icon, primaryText, secondaryText, truncateSecondaryText =
|
|
|
224
319
|
children
|
|
225
320
|
}) : null;
|
|
226
321
|
const isGradientVariant = variant === "gradient";
|
|
227
|
-
const cardSurfaceClass = variantStyles != null ? cn("rounded-lg shadow-
|
|
322
|
+
const cardSurfaceClass = variantStyles != null ? cn("rounded-[var(--espd-own-radius,var(--espd-radius-surface,var(--radius-lg)))] shadow-[shadow:var(--espd-own-elevation,var(--espd-elevation-surface,0_0_#0000))] overflow-hidden", fillHeight && "flex min-h-0 flex-col", variantStyles.container, isGradientVariant && "border-transparent", className) : cn(cardClassName, fillHeight && "flex min-h-0 flex-col", className);
|
|
228
323
|
const cardSurfaceStyle = variantStyles != null && isGradientVariant ? {
|
|
229
324
|
...variantStyles.containerStyle,
|
|
230
325
|
borderColor: "transparent",
|
|
@@ -239,9 +334,37 @@ function SectionCard({ icon, primaryText, secondaryText, truncateSecondaryText =
|
|
|
239
334
|
silverShine: variantStyles?.silverShine,
|
|
240
335
|
silverBorder: variantStyles?.silverBorder
|
|
241
336
|
}) : null;
|
|
337
|
+
if (expandOnHover) {
|
|
338
|
+
const state = hover.open ? "open" : "closed";
|
|
339
|
+
return /* @__PURE__ */ jsxs(Card, {
|
|
340
|
+
radius,
|
|
341
|
+
elevation,
|
|
342
|
+
className: cn("group/section-card", cardSurfaceClass),
|
|
343
|
+
style: cardSurfaceStyle,
|
|
344
|
+
"data-state": state,
|
|
345
|
+
...hover.rootProps,
|
|
346
|
+
children: [
|
|
347
|
+
gradientUnderlay,
|
|
348
|
+
isHeaderRequired ? header : null,
|
|
349
|
+
hasBody ? /* @__PURE__ */ jsx("div", {
|
|
350
|
+
id: hoverBodyId,
|
|
351
|
+
"data-state": state,
|
|
352
|
+
ref: hover.bodyRef,
|
|
353
|
+
className: cn("group/hover-body", HOVER_BODY_CLASS),
|
|
354
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
355
|
+
className: HOVER_BODY_INNER_CLASS,
|
|
356
|
+
children: body
|
|
357
|
+
})
|
|
358
|
+
}) : null
|
|
359
|
+
]
|
|
360
|
+
});
|
|
361
|
+
}
|
|
242
362
|
if (allowCollapse) return /* @__PURE__ */ jsxs(Card, {
|
|
363
|
+
radius,
|
|
364
|
+
elevation,
|
|
243
365
|
className: cardSurfaceClass,
|
|
244
366
|
style: cardSurfaceStyle,
|
|
367
|
+
"data-state": open ? "open" : "closed",
|
|
245
368
|
children: [gradientUnderlay, /* @__PURE__ */ jsxs(Collapsible, {
|
|
246
369
|
open,
|
|
247
370
|
onOpenChange: (next) => {
|
|
@@ -252,6 +375,8 @@ function SectionCard({ icon, primaryText, secondaryText, truncateSecondaryText =
|
|
|
252
375
|
})]
|
|
253
376
|
});
|
|
254
377
|
return /* @__PURE__ */ jsxs(Card, {
|
|
378
|
+
radius,
|
|
379
|
+
elevation,
|
|
255
380
|
className: cardSurfaceClass,
|
|
256
381
|
style: cardSurfaceStyle,
|
|
257
382
|
children: [
|
|
@@ -3,10 +3,13 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "../..
|
|
|
3
3
|
import * as React$1 from "react";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/cards/simple-card.tsx
|
|
6
|
-
var SimpleCard = React$1.forwardRef(({ noShadow, noBorder, transparent, title, description, children, className }, ref) => {
|
|
6
|
+
var SimpleCard = React$1.forwardRef(({ noShadow, noBorder, transparent, title, description, children, className, radius, elevation, border }, ref) => {
|
|
7
7
|
return /* @__PURE__ */ jsxs(Card, {
|
|
8
8
|
ref,
|
|
9
|
-
|
|
9
|
+
radius,
|
|
10
|
+
elevation,
|
|
11
|
+
border,
|
|
12
|
+
className: cn(noShadow && elevation === void 0 && "shadow-none", noBorder && border === void 0 && "border-0", transparent && "bg-transparent", className),
|
|
10
13
|
children: [(title || description) && /* @__PURE__ */ jsxs(CardHeader, {
|
|
11
14
|
className: "space-y-1",
|
|
12
15
|
children: [title && /* @__PURE__ */ jsx(CardTitle, {
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../../utils/cn.js";
|
|
3
|
+
import { Button } from "../button/button.js";
|
|
4
|
+
import { usePrefersReducedMotion } from "../../core/hooks/use-prefers-reduced-motion.js";
|
|
3
5
|
import { Carousel as Carousel$1, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious } from "../../core/carousel/carousel.js";
|
|
4
6
|
import * as React$1 from "react";
|
|
5
7
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
6
9
|
import Autoplay from "embla-carousel-autoplay";
|
|
7
10
|
//#region src/components/carousel/carousel.tsx
|
|
8
11
|
var MAX_DOTS_MIN = 1;
|
|
@@ -46,32 +49,65 @@ function DotsRow({ total, maxDots, selectedIndex, orientation, onDotClick }) {
|
|
|
46
49
|
})
|
|
47
50
|
});
|
|
48
51
|
}
|
|
49
|
-
/**
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
52
|
+
/** Two round icon Buttons drawn inside the slide area (`navigationPlacement="overlay"`). */
|
|
53
|
+
function OverlayArrows({ state, labels, className }) {
|
|
54
|
+
const arrowClass = "size-11 rounded-full bg-card shadow-md";
|
|
55
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
56
|
+
"data-slot": "carousel-overlay-navigation",
|
|
57
|
+
className: cn("absolute bottom-4 right-4 z-10 flex gap-2", className),
|
|
58
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
59
|
+
variant: "outline",
|
|
60
|
+
size: "icon",
|
|
61
|
+
fullWidth: false,
|
|
62
|
+
usePrimaryColorOnHover: true,
|
|
63
|
+
className: arrowClass,
|
|
64
|
+
onClick: state.scrollPrev,
|
|
65
|
+
disabled: !state.canScrollPrev,
|
|
66
|
+
"aria-label": labels?.previous ?? "Previous slide",
|
|
67
|
+
startIcon: /* @__PURE__ */ jsx(ChevronLeft, { "aria-hidden": true })
|
|
68
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
69
|
+
variant: "outline",
|
|
70
|
+
size: "icon",
|
|
71
|
+
fullWidth: false,
|
|
72
|
+
usePrimaryColorOnHover: true,
|
|
73
|
+
className: arrowClass,
|
|
74
|
+
onClick: state.scrollNext,
|
|
75
|
+
disabled: !state.canScrollNext,
|
|
76
|
+
"aria-label": labels?.next ?? "Next slide",
|
|
77
|
+
startIcon: /* @__PURE__ */ jsx(ChevronRight, { "aria-hidden": true })
|
|
78
|
+
})]
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/** The navigation that belongs at `placement`; nothing when it belongs elsewhere. */
|
|
82
|
+
function CarouselNavigation({ props, state, placement, maxDots }) {
|
|
83
|
+
const { data, navigation = "dots", navigationPlacement = "below", navigationClassName, orientation = "horizontal", renderNavigation, labels } = props;
|
|
84
|
+
if ((navigationPlacement === "beside" ? "below" : navigationPlacement) !== placement) return null;
|
|
85
|
+
if (placement === "overlay") {
|
|
86
|
+
if (navigation === "custom") return renderNavigation ? /* @__PURE__ */ jsx("div", {
|
|
87
|
+
className: cn("absolute bottom-4 right-4 z-10", navigationClassName),
|
|
88
|
+
children: renderNavigation(state)
|
|
89
|
+
}) : null;
|
|
90
|
+
return data.length > 1 ? /* @__PURE__ */ jsx(OverlayArrows, {
|
|
91
|
+
state,
|
|
92
|
+
labels,
|
|
93
|
+
className: navigationClassName
|
|
94
|
+
}) : null;
|
|
95
|
+
}
|
|
96
|
+
if (navigation === "dots" && data.length > 1) return /* @__PURE__ */ jsx(DotsRow, {
|
|
97
|
+
total: data.length,
|
|
98
|
+
maxDots,
|
|
99
|
+
selectedIndex: state.selectedIndex,
|
|
100
|
+
orientation,
|
|
101
|
+
onDotClick: state.scrollTo
|
|
102
|
+
});
|
|
103
|
+
if (navigation === "custom" && renderNavigation) return /* @__PURE__ */ jsx("div", {
|
|
104
|
+
className: cn(orientation === "horizontal" ? "mt-3" : "ml-3"),
|
|
105
|
+
children: renderNavigation(state)
|
|
106
|
+
});
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
/** Mirrors Embla's selection into React state and reports the direction of each move. */
|
|
110
|
+
function useCarouselState({ api, loop, onNext, onPrevious }) {
|
|
75
111
|
const [selectedIndex, setSelectedIndex] = React$1.useState(0);
|
|
76
112
|
const [scrollSnaps, setScrollSnaps] = React$1.useState([]);
|
|
77
113
|
const [canScrollPrev, setCanScrollPrev] = React$1.useState(false);
|
|
@@ -117,7 +153,7 @@ function Carousel({ data, orientation = "horizontal", navigation = "dots", maxDo
|
|
|
117
153
|
onPrevious
|
|
118
154
|
]);
|
|
119
155
|
const scrollTo = React$1.useCallback((index) => api?.scrollTo(index), [api]);
|
|
120
|
-
|
|
156
|
+
return {
|
|
121
157
|
canScrollPrev,
|
|
122
158
|
canScrollNext,
|
|
123
159
|
selectedIndex,
|
|
@@ -126,32 +162,84 @@ function Carousel({ data, orientation = "horizontal", navigation = "dots", maxDo
|
|
|
126
162
|
scrollNext: React$1.useCallback(() => api?.scrollNext(), [api]),
|
|
127
163
|
scrollTo
|
|
128
164
|
};
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* High-level, data-driven carousel. Wraps shadcn/ui's Embla-based primitives
|
|
168
|
+
* with a batteries-included API: pass `data`, pick a `navigation` style, and
|
|
169
|
+
* everything else — autoplay, looping, keyboard arrow keys, dot pagination —
|
|
170
|
+
* is wired up for you.
|
|
171
|
+
*
|
|
172
|
+
* Autoplay never runs while the person asks for reduced motion, and Embla's
|
|
173
|
+
* autoplay already holds while the tab is hidden. With `pauseOnHover` it
|
|
174
|
+
* also holds while the pointer or focus is inside.
|
|
175
|
+
*
|
|
176
|
+
* For advanced composition (non-uniform slide widths, controlling multiple
|
|
177
|
+
* carousels from one API, etc.) use `navigation="custom"` with
|
|
178
|
+
* `renderNavigation`; the underlying Embla instance is not exposed.
|
|
179
|
+
*/
|
|
180
|
+
function Carousel(props) {
|
|
181
|
+
const { data, orientation = "horizontal", navigation = "dots", navigationPlacement = "below", maxDots = MAX_DOTS_DEFAULT, autoplay = false, delay = DELAY_DEFAULT, loop = true, align = "center", pauseOnHover = false, labels, onNext, onPrevious, className, itemClassName } = props;
|
|
182
|
+
const clampedMaxDots = clamp(maxDots, MAX_DOTS_MIN, MAX_DOTS_MAX, MAX_DOTS_DEFAULT);
|
|
183
|
+
const clampedDelay = clamp(delay, DELAY_MIN, DELAY_MAX, DELAY_DEFAULT);
|
|
184
|
+
const reducedMotion = usePrefersReducedMotion();
|
|
185
|
+
const autoplaying = autoplay && !reducedMotion;
|
|
186
|
+
const plugins = React$1.useMemo(() => autoplaying ? [Autoplay({
|
|
187
|
+
delay: clampedDelay,
|
|
188
|
+
stopOnInteraction: !pauseOnHover,
|
|
189
|
+
stopOnMouseEnter: pauseOnHover,
|
|
190
|
+
stopOnFocusIn: true
|
|
191
|
+
})] : [], [
|
|
192
|
+
autoplaying,
|
|
193
|
+
clampedDelay,
|
|
194
|
+
pauseOnHover
|
|
195
|
+
]);
|
|
196
|
+
const [api, setApi] = React$1.useState();
|
|
197
|
+
const state = useCarouselState({
|
|
198
|
+
api,
|
|
199
|
+
loop,
|
|
200
|
+
onNext,
|
|
201
|
+
onPrevious
|
|
202
|
+
});
|
|
203
|
+
const sideArrows = navigation === "arrows" && (navigationPlacement === "below" || navigationPlacement === "beside");
|
|
204
|
+
const beside = sideArrows && navigationPlacement === "beside";
|
|
129
205
|
return /* @__PURE__ */ jsxs("div", {
|
|
130
206
|
className: cn(orientation === "horizontal" ? "flex flex-col" : "flex flex-row", className),
|
|
131
|
-
children: [
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
207
|
+
children: [/* @__PURE__ */ jsxs(Carousel$1, {
|
|
208
|
+
setApi,
|
|
209
|
+
orientation,
|
|
210
|
+
opts: {
|
|
211
|
+
loop,
|
|
212
|
+
align
|
|
213
|
+
},
|
|
214
|
+
plugins,
|
|
215
|
+
className: cn("min-w-0 flex-1", beside && (orientation === "horizontal" ? "px-11" : "py-11")),
|
|
216
|
+
"aria-label": labels?.carousel,
|
|
217
|
+
children: [
|
|
218
|
+
/* @__PURE__ */ jsx(CarouselContent, { children: data.map((item, index) => /* @__PURE__ */ jsx(CarouselItem, {
|
|
139
219
|
className: itemClassName,
|
|
220
|
+
"aria-label": labels?.slide?.(index + 1, data.length),
|
|
140
221
|
children: item.content
|
|
141
|
-
}, item.id)) }),
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
222
|
+
}, item.id)) }),
|
|
223
|
+
sideArrows && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(CarouselPrevious, {
|
|
224
|
+
"aria-label": labels?.previous,
|
|
225
|
+
className: cn(beside && (orientation === "horizontal" ? "left-0" : "top-0"))
|
|
226
|
+
}), /* @__PURE__ */ jsx(CarouselNext, {
|
|
227
|
+
"aria-label": labels?.next,
|
|
228
|
+
className: cn(beside && (orientation === "horizontal" ? "right-0" : "bottom-0"))
|
|
229
|
+
})] }),
|
|
230
|
+
/* @__PURE__ */ jsx(CarouselNavigation, {
|
|
231
|
+
props,
|
|
232
|
+
state,
|
|
233
|
+
placement: "overlay",
|
|
234
|
+
maxDots: clampedMaxDots
|
|
235
|
+
})
|
|
236
|
+
]
|
|
237
|
+
}), /* @__PURE__ */ jsx(CarouselNavigation, {
|
|
238
|
+
props,
|
|
239
|
+
state,
|
|
240
|
+
placement: "below",
|
|
241
|
+
maxDots: clampedMaxDots
|
|
242
|
+
})]
|
|
155
243
|
});
|
|
156
244
|
}
|
|
157
245
|
//#endregion
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
type CarouselOrientation = 'horizontal' | 'vertical';
|
|
4
|
+
type CarouselNavigationStyle = 'dots' | 'arrows' | 'custom';
|
|
5
|
+
/**
|
|
6
|
+
* Where the navigation sits: `'below'` (default — dots and custom controls
|
|
7
|
+
* under the slides, arrows on the sides, over the slides' edges), `'overlay'`
|
|
8
|
+
* (inside the slide area, absolutely placed by `navigationClassName`) or
|
|
9
|
+
* `'beside'` (arrows in their own gutters to the left and right of the slides,
|
|
10
|
+
* never over one — for a row of cards or chips; dots and custom controls go
|
|
11
|
+
* below, as with `'below'`).
|
|
12
|
+
*/
|
|
13
|
+
type CarouselNavigationPlacement = 'below' | 'overlay' | 'beside';
|
|
14
|
+
/** Accessible names. Pass translated strings; English is the fallback. */
|
|
15
|
+
interface CarouselLabels {
|
|
16
|
+
/** Names the carousel region ("Featured projects"). */
|
|
17
|
+
carousel?: string;
|
|
18
|
+
/** The previous-slide arrow. Default "Previous slide". */
|
|
19
|
+
previous?: string;
|
|
20
|
+
/** The next-slide arrow. Default "Next slide". */
|
|
21
|
+
next?: string;
|
|
22
|
+
/** Each slide's name, 1-based ("2 of 5: Air Mouse"). */
|
|
23
|
+
slide?: (index: number, total: number) => string;
|
|
24
|
+
}
|
|
25
|
+
/** Where a slide comes to rest in the viewport when it is selected. */
|
|
26
|
+
type CarouselAlign = 'start' | 'center' | 'end';
|
|
27
|
+
interface CarouselItem {
|
|
28
|
+
id: string | number;
|
|
29
|
+
content: React.ReactNode;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* State passed to `renderNavigation` when `navigation === 'custom'`.
|
|
33
|
+
* Everything a caller needs to build their own controls without touching
|
|
34
|
+
* the underlying Embla API.
|
|
35
|
+
*/
|
|
36
|
+
interface CarouselNavigationState {
|
|
37
|
+
canScrollPrev: boolean;
|
|
38
|
+
canScrollNext: boolean;
|
|
39
|
+
/** 0-based index of the currently selected slide. */
|
|
40
|
+
selectedIndex: number;
|
|
41
|
+
/** One entry per snap point (usually one per item). */
|
|
42
|
+
scrollSnaps: number[];
|
|
43
|
+
scrollPrev: () => void;
|
|
44
|
+
scrollNext: () => void;
|
|
45
|
+
scrollTo: (index: number) => void;
|
|
46
|
+
}
|
|
47
|
+
interface CarouselProps {
|
|
48
|
+
/** Slides to render. `id` is used as the React key. */
|
|
49
|
+
data: CarouselItem[];
|
|
50
|
+
/** Layout axis. Vertical carousels need a bounded `className` height. */
|
|
51
|
+
orientation?: CarouselOrientation;
|
|
52
|
+
/**
|
|
53
|
+
* Built-in navigation style:
|
|
54
|
+
* - `'dots'` — pagination dots below the carousel (default).
|
|
55
|
+
* - `'arrows'` — prev/next buttons on the sides.
|
|
56
|
+
* - `'custom'` — invokes `renderNavigation` below the carousel.
|
|
57
|
+
*/
|
|
58
|
+
navigation?: CarouselNavigationStyle;
|
|
59
|
+
/**
|
|
60
|
+
* Cap on dots rendered when `navigation === 'dots'`. When `data.length`
|
|
61
|
+
* exceeds this, a sliding window of dots is rendered so the row width is
|
|
62
|
+
* constant. Clamped to `[1, 10]`. Default `5`.
|
|
63
|
+
*/
|
|
64
|
+
maxDots?: number;
|
|
65
|
+
/** Advance slides automatically. Default `false`. */
|
|
66
|
+
autoplay?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Milliseconds between autoplay advances. Clamped to `[1000, 10000]`.
|
|
69
|
+
* Ignored when `autoplay` is `false`. Default `3000`.
|
|
70
|
+
*/
|
|
71
|
+
delay?: number;
|
|
72
|
+
/**
|
|
73
|
+
* Where the selected slide rests: `'center'` (default) or `'start'` / `'end'`.
|
|
74
|
+
* Use `'start'` for slides of different widths (chips, tags): centring them
|
|
75
|
+
* and then keeping the row inside its bounds makes the first step barely
|
|
76
|
+
* move and the next one jump.
|
|
77
|
+
*/
|
|
78
|
+
align?: CarouselAlign;
|
|
79
|
+
/**
|
|
80
|
+
* Where the navigation renders. With `'overlay'`, arrows (or the custom
|
|
81
|
+
* renderer's output) are drawn inside the slide area at the position
|
|
82
|
+
* `navigationClassName` gives them; no side arrows render. With `'beside'`,
|
|
83
|
+
* the arrows sit in gutters beside the slides, which the carousel keeps
|
|
84
|
+
* clear of them. Default `'below'`.
|
|
85
|
+
*/
|
|
86
|
+
navigationPlacement?: CarouselNavigationPlacement;
|
|
87
|
+
/** Positions the overlay navigation (`'absolute bottom-4 right-4'` by default). */
|
|
88
|
+
navigationClassName?: string;
|
|
89
|
+
/**
|
|
90
|
+
* Pause autoplay while the pointer is over the carousel or focus is inside
|
|
91
|
+
* it, and resume when it leaves. Default `false` (any interaction stops
|
|
92
|
+
* autoplay for good, as before).
|
|
93
|
+
*/
|
|
94
|
+
pauseOnHover?: boolean;
|
|
95
|
+
/** Accessible names for the region, the arrows and each slide. */
|
|
96
|
+
labels?: CarouselLabels;
|
|
97
|
+
/** Wrap around at the ends. Default `true`. */
|
|
98
|
+
loop?: boolean;
|
|
99
|
+
/** Called after every forward advance (user, keyboard, autoplay, or custom). */
|
|
100
|
+
onNext?: () => void;
|
|
101
|
+
/** Called after every backward advance (user, keyboard, autoplay, or custom). */
|
|
102
|
+
onPrevious?: () => void;
|
|
103
|
+
/**
|
|
104
|
+
* Custom navigation renderer. Rendered below the carousel (like dots).
|
|
105
|
+
* Only invoked when `navigation === 'custom'`.
|
|
106
|
+
*/
|
|
107
|
+
renderNavigation?: (state: CarouselNavigationState) => React.ReactNode;
|
|
108
|
+
/** Applied to the outer wrapper. */
|
|
109
|
+
className?: string;
|
|
110
|
+
/** Applied to each slide's outer element. */
|
|
111
|
+
itemClassName?: string;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* High-level, data-driven carousel. Wraps shadcn/ui's Embla-based primitives
|
|
116
|
+
* with a batteries-included API: pass `data`, pick a `navigation` style, and
|
|
117
|
+
* everything else — autoplay, looping, keyboard arrow keys, dot pagination —
|
|
118
|
+
* is wired up for you.
|
|
119
|
+
*
|
|
120
|
+
* Autoplay never runs while the person asks for reduced motion, and Embla's
|
|
121
|
+
* autoplay already holds while the tab is hidden. With `pauseOnHover` it
|
|
122
|
+
* also holds while the pointer or focus is inside.
|
|
123
|
+
*
|
|
124
|
+
* For advanced composition (non-uniform slide widths, controlling multiple
|
|
125
|
+
* carousels from one API, etc.) use `navigation="custom"` with
|
|
126
|
+
* `renderNavigation`; the underlying Embla instance is not exposed.
|
|
127
|
+
*/
|
|
128
|
+
declare function Carousel(props: CarouselProps): React.JSX.Element;
|
|
129
|
+
|
|
130
|
+
export { Carousel, type CarouselAlign, type CarouselItem, type CarouselLabels, type CarouselNavigationPlacement, type CarouselNavigationState, type CarouselNavigationStyle, type CarouselOrientation, type CarouselProps };
|