@espressif/dashboard-ui-components 1.11.2 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/rules/dashboard-ui-consumption.md +176 -5
- package/.cursor/rules/dashboard-ui-consumption.mdc +163 -4
- package/CHANGELOG.md +1005 -0
- package/README.md +240 -7
- package/THIRD-PARTY-NOTICES.md +2 -1
- package/dist/alert.props-CcKo49Rb.d.ts +44 -0
- package/dist/animation/index.d.ts +3 -0
- package/dist/animation/index.js +3 -0
- package/dist/avatar.props-2q5BsX-R.d.ts +29 -0
- package/dist/button-BK-DIR_L.d.ts +21 -0
- package/dist/button-BxJ7s6sR.d.ts +76 -0
- package/dist/calendar.props-BtCzuWH1.d.ts +12 -0
- package/dist/carousel/index.d.ts +2 -0
- package/dist/carousel/index.js +2 -0
- package/dist/charts/index.d.ts +5 -0
- package/dist/charts/index.js +9 -0
- package/dist/common/app-logo/app-logo.js +1 -1
- package/dist/common/index.d.ts +9 -20
- package/dist/common/my-account-menu/my-account-menu.js +45 -13
- package/dist/common/profile-card/profile-card.js +3 -2
- package/dist/components/accordion/accordion.js +14 -5
- package/dist/components/accordion/index.d.ts +36 -0
- package/dist/components/accordion/index.js +2 -0
- package/dist/components/advanced-search-box/advanced-search-box.js +8 -2
- package/dist/components/advanced-search-box/index.d.ts +29 -0
- package/dist/components/advanced-search-box/index.js +2 -0
- package/dist/components/alert/alert.js +2 -1
- package/dist/components/alert/index.d.ts +12 -0
- package/dist/components/alert/index.js +2 -0
- package/dist/components/anchored-panel/anchored-panel.js +83 -0
- package/dist/components/anchored-panel/index.d.ts +31 -0
- package/dist/components/anchored-panel/index.js +2 -0
- package/dist/components/animated-containers/index.d.ts +13 -0
- package/dist/components/animated-containers/index.js +2 -0
- package/dist/components/async-multi-select/async-multi-select.js +48 -7
- package/dist/components/async-multi-select/index.d.ts +63 -0
- package/dist/components/async-multi-select/index.js +2 -0
- package/dist/components/avatar/avatar.js +11 -4
- package/dist/components/avatar/index.d.ts +8 -0
- package/dist/components/avatar/index.js +2 -0
- package/dist/components/avatar-group/avatar-group.js +35 -0
- package/dist/components/avatar-group/index.d.ts +31 -0
- package/dist/components/avatar-group/index.js +2 -0
- package/dist/components/badge/index.d.ts +14 -0
- package/dist/components/badge/index.js +2 -0
- package/dist/components/breadcrumb/index.d.ts +21 -0
- package/dist/components/breadcrumb/index.js +2 -0
- package/dist/components/bubble/bubble.js +18 -0
- package/dist/components/bubble/index.d.ts +19 -0
- package/dist/components/bubble/index.js +2 -0
- package/dist/components/button/button.js +87 -25
- package/dist/components/button/flash-button.js +9 -3
- package/dist/components/button/index.d.ts +56 -0
- package/dist/components/button/index.js +6 -0
- package/dist/components/button-group/index.d.ts +16 -0
- package/dist/components/button-group/index.js +2 -0
- package/dist/components/calendar/calendar.js +5 -5
- package/dist/components/calendar/index.d.ts +11 -0
- package/dist/components/calendar/index.js +2 -0
- package/dist/components/card/index.d.ts +11 -0
- package/dist/components/card/index.js +2 -0
- package/dist/components/card-rail/card-rail.js +50 -0
- package/dist/components/card-rail/index.d.ts +30 -0
- package/dist/components/card-rail/index.js +2 -0
- package/dist/components/cards/collapsible-card.js +5 -2
- package/dist/components/cards/index.d.ts +16200 -0
- package/dist/components/cards/index.js +8 -0
- package/dist/components/cards/section-card.js +133 -8
- package/dist/components/cards/simple-card.js +5 -2
- package/dist/components/carousel/carousel.js +137 -49
- package/dist/components/carousel/index.d.ts +130 -0
- package/dist/components/carousel/index.js +2 -0
- package/dist/components/category-card/category-card.js +111 -0
- package/dist/components/category-card/index.d.ts +55 -0
- package/dist/components/category-card/index.js +2 -0
- package/dist/components/chart/area-chart.js +95 -85
- package/dist/components/chart/bar-chart.js +123 -60
- package/dist/components/chart/chart.js +127 -3
- package/dist/components/chart/composed-chart.js +109 -98
- package/dist/components/chart/donut-chart.js +23 -5
- package/dist/components/chart/index.d.ts +732 -0
- package/dist/components/chart/index.js +9 -0
- package/dist/components/chart/line-chart.js +93 -83
- package/dist/components/chart/treemap-chart.js +71 -58
- package/dist/components/check-badge/check-badge.js +25 -0
- package/dist/components/check-badge/index.d.ts +13 -0
- package/dist/components/check-badge/index.js +2 -0
- package/dist/components/checkbox/index.d.ts +8 -0
- package/dist/components/checkbox/index.js +2 -0
- package/dist/components/choice-card/choice-card.js +99 -0
- package/dist/components/choice-card/index.d.ts +41 -0
- package/dist/components/choice-card/index.js +2 -0
- package/dist/components/circular-progress/circular-progress.js +5 -2
- package/dist/components/circular-progress/index.d.ts +23 -0
- package/dist/components/circular-progress/index.js +2 -0
- package/dist/components/code/index.d.ts +40 -0
- package/dist/components/code/index.js +2 -0
- package/dist/components/code-editor/code-editor.js +9 -3
- package/dist/components/code-editor/index.d.ts +82 -0
- package/dist/components/code-editor/index.js +2 -0
- package/dist/components/collapsible/index.d.ts +42 -0
- package/dist/components/collapsible/index.js +2 -0
- package/dist/components/column-panel/column-panel.js +38 -0
- package/dist/components/column-panel/index.d.ts +37 -0
- package/dist/components/column-panel/index.js +3 -0
- package/dist/components/column-panel/use-panel-flag.js +27 -0
- package/dist/components/combobox/index.d.ts +28 -0
- package/dist/components/combobox/index.js +2 -0
- package/dist/components/confirmation-dialog/confirmation-dialog.js +1 -1
- package/dist/components/confirmation-dialog/index.d.ts +40 -0
- package/dist/components/confirmation-dialog/index.js +3 -0
- package/dist/components/content-container/index.d.ts +16 -0
- package/dist/components/content-container/index.js +2 -0
- package/dist/components/copiable-text/index.d.ts +33 -0
- package/dist/components/copiable-text/index.js +2 -0
- package/dist/components/coverflow/_constants/coverflow-poses.js +23 -0
- package/dist/components/coverflow/_constants/coverflow-shapes.js +23 -0
- package/dist/components/coverflow/_hooks/use-coverflow.js +90 -0
- package/dist/components/coverflow/_utils/ring.js +24 -0
- package/dist/components/coverflow/coverflow.js +198 -0
- package/dist/components/coverflow/index.d.ts +105 -0
- package/dist/components/coverflow/index.js +2 -0
- package/dist/components/data-table/data-table.js +9 -2
- package/dist/components/data-table/index.d.ts +120 -0
- package/dist/components/data-table/index.js +3 -0
- package/dist/components/date-picker/date-picker.js +5 -2
- package/dist/components/date-picker/index.d.ts +50 -0
- package/dist/components/date-picker/index.js +2 -0
- package/dist/components/date-range-picker/date-range-picker.js +11 -2
- package/dist/components/date-range-picker/index.d.ts +100 -0
- package/dist/components/date-range-picker/index.js +3 -0
- package/dist/components/date-time-picker/date-time-picker.js +5 -2
- package/dist/components/date-time-picker/index.d.ts +79 -0
- package/dist/components/date-time-picker/index.js +2 -0
- package/dist/components/device-icon/index.d.ts +17 -0
- package/dist/components/device-icon/index.js +2 -0
- package/dist/components/dialog/index.d.ts +38 -0
- package/dist/components/dialog/index.js +2 -0
- package/dist/components/dropdown-menu/index.d.ts +57 -0
- package/dist/components/dropdown-menu/index.js +2 -0
- package/dist/components/dynamic-list/dynamic-list.js +4 -4
- package/dist/components/dynamic-list/index.d.ts +74 -0
- package/dist/components/dynamic-list/index.js +2 -0
- package/dist/components/error-display/index.d.ts +17 -0
- package/dist/components/error-display/index.js +3 -0
- package/dist/components/expandable-text/expandable-text-overlay.js +78 -0
- package/dist/components/expandable-text/expandable-text.js +73 -0
- package/dist/components/expandable-text/index.d.ts +39 -0
- package/dist/components/expandable-text/index.js +2 -0
- package/dist/components/expandable-text/use-clamped.js +23 -0
- package/dist/components/facet-filters/_hooks/use-filter-group.js +51 -0
- package/dist/components/facet-filters/active-filters.js +31 -0
- package/dist/components/facet-filters/filter-group.js +110 -0
- package/dist/components/facet-filters/filters-panel.js +59 -0
- package/dist/components/facet-filters/filters-pill.js +40 -0
- package/dist/components/facet-filters/index.d.ts +104 -0
- package/dist/components/facet-filters/index.js +6 -0
- package/dist/components/facet-filters/use-filters-collapsed.js +21 -0
- package/dist/components/feature-grid/feature-grid.js +115 -0
- package/dist/components/feature-grid/index.d.ts +53 -0
- package/dist/components/feature-grid/index.js +2 -0
- package/dist/components/file-input/file-input.js +9 -3
- package/dist/components/file-input/index.d.ts +78 -0
- package/dist/components/file-input/index.js +2 -0
- package/dist/components/file-upload/file-upload.js +10 -5
- package/dist/components/file-upload/index.d.ts +38 -0
- package/dist/components/file-upload/index.js +2 -0
- package/dist/components/filters-bar/filters-bar.js +5 -1
- package/dist/components/filters-bar/index.d.ts +26 -0
- package/dist/components/filters-bar/index.js +2 -0
- package/dist/components/flip-card/flip-card.js +147 -0
- package/dist/components/flip-card/index.d.ts +43 -0
- package/dist/components/flip-card/index.js +2 -0
- package/dist/components/floating-window/_hooks/use-drag-move.js +76 -0
- package/dist/components/floating-window/floating-window.js +97 -0
- package/dist/components/floating-window/index.d.ts +45 -0
- package/dist/components/floating-window/index.js +2 -0
- package/dist/components/form/index.d.ts +28 -0
- package/dist/components/form/index.js +2 -0
- package/dist/components/fullscreen-dialog/fullscreen-dialog.js +6 -2
- package/dist/components/fullscreen-dialog/index.d.ts +38 -0
- package/dist/components/fullscreen-dialog/index.js +2 -0
- package/dist/components/horizontal-stepper/horizontal-stepper.js +122 -0
- package/dist/components/horizontal-stepper/index.d.ts +70 -0
- package/dist/components/horizontal-stepper/index.js +2 -0
- package/dist/components/icon-avatar/index.d.ts +9 -0
- package/dist/components/icon-avatar/index.js +2 -0
- package/dist/components/icon-text-action-card/icon-text-action-card.js +9 -5
- package/dist/components/icon-text-action-card/index.d.ts +11 -0
- package/dist/components/icon-text-action-card/index.js +2 -0
- package/dist/components/identicon/identicon.js +33 -0
- package/dist/components/identicon/index.d.ts +26 -0
- package/dist/components/identicon/index.js +2 -0
- package/dist/components/illustration/index.d.ts +37 -0
- package/dist/components/illustration/index.js +3 -0
- package/dist/components/index.d.ts +177 -19529
- package/dist/components/index.js +61 -10
- package/dist/components/input/index.d.ts +15 -0
- package/dist/components/input/index.js +3 -0
- package/dist/components/input-group/index.d.ts +35 -0
- package/dist/components/input-group/index.js +2 -0
- package/dist/components/input-group/input-group.js +41 -0
- package/dist/components/input-otp/index.d.ts +63 -0
- package/dist/components/input-otp/index.js +2 -0
- package/dist/components/key-value-manager/index.d.ts +63 -0
- package/dist/components/key-value-manager/index.js +2 -0
- package/dist/components/key-value-manager/key-value-manager-table.js +7 -5
- package/dist/components/label/index.d.ts +8 -0
- package/dist/components/label/index.js +2 -0
- package/dist/components/link/index.d.ts +33 -0
- package/dist/components/link/index.js +2 -0
- package/dist/components/list/index.d.ts +9 -0
- package/dist/components/list/index.js +3 -0
- package/dist/components/list/list-item.utils.js +1 -1
- package/dist/components/list/list.js +3 -1
- package/dist/components/list-details/index.d.ts +51 -0
- package/dist/components/list-details/index.js +2 -0
- package/dist/components/list-details/list-details.js +5 -2
- package/dist/components/lottie-animation-container/index.d.ts +10 -0
- package/dist/components/lottie-animation-container/index.js +2 -0
- package/dist/components/lottie-animation-container/lottie-animation-container.js +22 -3
- package/dist/components/lottie-animations/index.d.ts +8 -0
- package/dist/components/lottie-animations/index.js +2 -0
- package/dist/components/markdown-content/index.d.ts +32 -0
- package/dist/components/markdown-content/index.js +2 -0
- package/dist/components/media-card/index.d.ts +125 -0
- package/dist/components/media-card/index.js +4 -0
- package/dist/components/media-card/media-card-image.js +59 -0
- package/dist/components/media-card/media-card-reveal.js +76 -0
- package/dist/components/media-card/media-card.classes.js +37 -0
- package/dist/components/media-card/media-card.js +91 -0
- package/dist/components/media-stage/index.d.ts +41 -0
- package/dist/components/media-stage/index.js +2 -0
- package/dist/components/media-stage/media-stage.js +48 -0
- package/dist/components/menu/index.d.ts +14 -0
- package/dist/components/menu/index.js +2 -0
- package/dist/components/message-scroller/_hooks/use-follow-bottom.js +85 -0
- package/dist/components/message-scroller/index.d.ts +29 -0
- package/dist/components/message-scroller/index.js +2 -0
- package/dist/components/message-scroller/message-scroller.js +65 -0
- package/dist/components/mini-bar-chart/index.d.ts +40 -0
- package/dist/components/mini-bar-chart/index.js +2 -0
- package/dist/components/mini-bar-chart/mini-bar-chart.js +93 -0
- package/dist/components/monospace-content/index.d.ts +43 -0
- package/dist/components/monospace-content/index.js +2 -0
- package/dist/components/monospace-content/monospace-content.js +1 -1
- package/dist/components/nav-bar/index.d.ts +148 -0
- package/dist/components/nav-bar/index.js +2 -0
- package/dist/components/nav-bar/nav-bar-details-panel.js +158 -44
- package/dist/components/nav-bar/nav-bar-mobile-menu.js +93 -27
- package/dist/components/nav-bar/nav-bar.js +256 -138
- package/dist/components/nav-bar/use-nav-bar-hover-details.js +80 -0
- package/dist/components/nav-bar/use-nav-bar-overflow.js +5 -5
- package/dist/components/notice-strip/index.d.ts +32 -0
- package/dist/components/notice-strip/index.js +2 -0
- package/dist/components/notice-strip/notice-strip.js +57 -0
- package/dist/components/option-card-group/index.d.ts +50 -0
- package/dist/components/option-card-group/index.js +2 -0
- package/dist/components/option-card-group/option-card-group.js +76 -0
- package/dist/components/overflow-badge-list/index.d.ts +63 -0
- package/dist/components/overflow-badge-list/index.js +2 -0
- package/dist/components/overflow-badge-list/overflow-badge-list.js +78 -19
- package/dist/components/page-banner/index.d.ts +33 -0
- package/dist/components/page-banner/index.js +2 -0
- package/dist/components/page-banner/page-banner.js +56 -0
- package/dist/components/page-container/index.d.ts +20 -0
- package/dist/components/page-container/index.js +3 -0
- package/dist/components/page-container/page-container.js +5 -5
- package/dist/components/pagination/index.d.ts +31 -0
- package/dist/components/pagination/index.js +3 -0
- package/dist/components/popover/index.d.ts +60 -0
- package/dist/components/popover/index.js +3 -0
- package/dist/components/preview-card/index.d.ts +24 -0
- package/dist/components/preview-card/index.js +2 -0
- package/dist/components/progress-bar/index.d.ts +32 -0
- package/dist/components/progress-bar/index.js +2 -0
- package/dist/components/progress-bar/progress-bar.js +22 -6
- package/dist/components/radio-group/index.d.ts +24 -0
- package/dist/components/radio-group/index.js +2 -0
- package/dist/components/rank-numeral/index.d.ts +30 -0
- package/dist/components/rank-numeral/index.js +2 -0
- package/dist/components/rank-numeral/rank-numeral.js +26 -0
- package/dist/components/reaction-button/index.d.ts +32 -0
- package/dist/components/reaction-button/index.js +2 -0
- package/dist/components/reaction-button/reaction-button.js +50 -0
- package/dist/components/readout/index.d.ts +31 -0
- package/dist/components/readout/index.js +2 -0
- package/dist/components/readout/readout.js +63 -0
- package/dist/components/requirement-list/index.d.ts +52 -0
- package/dist/components/requirement-list/index.js +2 -0
- package/dist/components/requirement-list/requirement-list.js +29 -8
- package/dist/components/resizable/index.d.ts +31 -0
- package/dist/components/resizable/index.js +4 -0
- package/dist/components/resizable/resizable-group.js +23 -0
- package/dist/components/resizable/resizable-panel.js +28 -0
- package/dist/components/resizable/resizable-separator.js +24 -0
- package/dist/components/reveal/index.d.ts +23 -0
- package/dist/components/reveal/index.js +2 -0
- package/dist/components/reveal/reveal.js +24 -0
- package/dist/components/scroll-area/index.d.ts +27 -0
- package/dist/components/scroll-area/index.js +2 -0
- package/dist/components/scrollable-sections/index.d.ts +58 -0
- package/dist/components/scrollable-sections/index.js +2 -0
- package/dist/components/scrollable-sections/scrollable-sections.js +11 -3
- package/dist/components/search-box/index.d.ts +32 -0
- package/dist/components/search-box/index.js +2 -0
- package/dist/components/search-box/search-box.js +18 -3
- package/dist/components/search-field-shell.js +1 -1
- package/dist/components/select/index.d.ts +44 -0
- package/dist/components/select/index.js +2 -0
- package/dist/components/selectable-card-list/checkbox-card-list.js +5 -3
- package/dist/components/selectable-card-list/index.d.ts +76 -0
- package/dist/components/selectable-card-list/index.js +2 -0
- package/dist/components/selectable-card-list/radio-card-list.js +12 -6
- package/dist/components/selectable-card-list/selectable-card-list-shared.js +24 -12
- package/dist/components/selectable-card-list/selectable-card-list.js +12 -3
- package/dist/components/separator/index.d.ts +24 -0
- package/dist/components/separator/index.js +2 -0
- package/dist/components/share-menu/index.d.ts +55 -0
- package/dist/components/share-menu/index.js +2 -0
- package/dist/components/share-menu/share-marks.js +31 -0
- package/dist/components/share-menu/share-menu.js +140 -0
- package/dist/components/share-menu/share-urls.js +15 -0
- package/dist/components/sheet/index.d.ts +41 -0
- package/dist/components/sheet/index.js +2 -0
- package/dist/components/showcase-card/index.d.ts +53 -0
- package/dist/components/showcase-card/index.js +2 -0
- package/dist/components/showcase-card/showcase-card.js +75 -0
- package/dist/components/sidebar/index.d.ts +109 -0
- package/dist/components/sidebar/index.js +4 -0
- package/dist/components/sidebar/sidebar.js +56 -40
- package/dist/components/simple-clickable-card/index.d.ts +11 -0
- package/dist/components/simple-clickable-card/index.js +2 -0
- package/dist/components/simple-clickable-card/simple-clickable-card-shared.js +2 -2
- package/dist/components/simple-clickable-card/simple-clickable-card.js +5 -2
- package/dist/components/simple-info-card/index.d.ts +25 -0
- package/dist/components/simple-info-card/index.js +2 -0
- package/dist/components/simple-info-card/simple-info-card.js +6 -3
- package/dist/components/simple-list/index.d.ts +63 -0
- package/dist/components/simple-list/index.js +2 -0
- package/dist/components/simple-list/simple-list.js +3 -1
- package/dist/components/simple-paginated-list/index.d.ts +20 -0
- package/dist/components/simple-paginated-list/index.js +2 -0
- package/dist/components/simplified-date/index.d.ts +18 -0
- package/dist/components/simplified-date/index.js +2 -0
- package/dist/components/skeleton/index.d.ts +5 -0
- package/dist/components/skeleton/index.js +2 -0
- package/dist/components/skeletons/index.d.ts +11 -0
- package/dist/components/skeletons/index.js +2 -0
- package/dist/components/sort-menu/index.d.ts +34 -0
- package/dist/components/sort-menu/index.js +2 -0
- package/dist/components/sort-menu/sort-menu.js +39 -0
- package/dist/components/spinner/index.d.ts +15 -0
- package/dist/components/spinner/index.js +2 -0
- package/dist/components/stat-card/index.d.ts +43 -0
- package/dist/components/stat-card/index.js +2 -0
- package/dist/components/stat-card/stat-card.js +31 -12
- package/dist/components/status-badge/index.d.ts +24 -0
- package/dist/components/status-badge/index.js +2 -0
- package/dist/components/status-badge/status-badge.js +3 -2
- package/dist/components/status-card-list/index.d.ts +24 -0
- package/dist/components/status-card-list/index.js +2 -0
- package/dist/components/status-card-list/status-card-list.js +8 -4
- package/dist/components/step-tabs/index.d.ts +94 -0
- package/dist/components/step-tabs/index.js +2 -0
- package/dist/components/step-tabs/step-tabs.js +202 -0
- package/dist/components/style-scope/index.d.ts +32 -0
- package/dist/components/style-scope/index.js +2 -0
- package/dist/components/style-scope/style-scope.js +49 -0
- package/dist/components/switch/index.d.ts +15 -0
- package/dist/components/switch/index.js +2 -0
- package/dist/components/table/index.d.ts +18 -0
- package/dist/components/table/index.js +2 -0
- package/dist/components/tabs/index.d.ts +103 -0
- package/dist/components/tabs/index.js +2 -0
- package/dist/components/tag/index.d.ts +31 -0
- package/dist/components/tag/index.js +2 -0
- package/dist/components/tag/tag.js +79 -28
- package/dist/components/tag-input/index.d.ts +36 -0
- package/dist/components/tag-input/index.js +2 -0
- package/dist/components/tag-input/tag-input.js +10 -4
- package/dist/components/text-effects/index.d.ts +53 -0
- package/dist/components/text-effects/index.js +6 -0
- package/dist/components/textarea/index.d.ts +16 -0
- package/dist/components/textarea/index.js +2 -0
- package/dist/components/thumbnail-strip/index.d.ts +42 -0
- package/dist/components/thumbnail-strip/index.js +2 -0
- package/dist/components/thumbnail-strip/thumbnail-strip.js +124 -0
- package/dist/components/thumbnail-strip/use-scroll-edges.js +41 -0
- package/dist/components/time-picker/index.d.ts +13 -0
- package/dist/components/time-picker/index.js +2 -0
- package/dist/components/timeline/index.d.ts +39 -0
- package/dist/components/timeline/index.js +2 -0
- package/dist/components/timeline/timeline.js +85 -0
- package/dist/components/toast/index.d.ts +56 -0
- package/dist/components/toast/index.js +2 -0
- package/dist/components/toast/toast.js +42 -32
- package/dist/components/togglable-items-list/index.d.ts +28 -0
- package/dist/components/togglable-items-list/index.js +2 -0
- package/dist/components/toggle-group/index.d.ts +35 -0
- package/dist/components/toggle-group/index.js +2 -0
- package/dist/components/toolbar/index.d.ts +58 -0
- package/dist/components/toolbar/index.js +3 -0
- package/dist/components/toolbar/toolbar-button.js +40 -0
- package/dist/components/toolbar/toolbar.js +56 -0
- package/dist/components/tooltip/index.d.ts +29 -0
- package/dist/components/tooltip/index.js +3 -0
- package/dist/components/tooltip/tooltip.js +12 -2
- package/dist/components/transfer-list/index.d.ts +36 -0
- package/dist/components/transfer-list/index.js +2 -0
- package/dist/components/transfer-list/transfer-list.js +1 -1
- package/dist/components/truncated-line-with-tooltip/index.d.ts +22 -0
- package/dist/components/truncated-line-with-tooltip/index.js +2 -0
- package/dist/components/truncated-line-with-tooltip/truncated-line-with-tooltip.js +26 -8
- package/dist/components/typography/index.d.ts +19 -0
- package/dist/components/typography/index.js +3 -0
- package/dist/components/use-mobile/index.d.ts +3 -0
- package/dist/components/use-mobile/index.js +2 -0
- package/dist/components/user-type-badge/index.d.ts +39 -0
- package/dist/components/user-type-badge/index.js +3 -0
- package/dist/components/user-type-badge/user-type-badge.js +2 -1
- package/dist/components/vertical-stepper/index.d.ts +7 -0
- package/dist/components/vertical-stepper/index.js +2 -0
- package/dist/components/vertical-stepper/vertical-stepper.js +33 -6
- package/dist/components/view-toggle/index.d.ts +38 -0
- package/dist/components/view-toggle/index.js +2 -0
- package/dist/components/view-toggle/view-toggle.js +56 -0
- package/dist/core/animate-ui/components/animate/code.js +83 -9
- package/dist/core/animate-ui/components/animate/tabs.js +234 -19
- package/dist/core/animate-ui/components/animate/tooltip.js +10 -2
- package/dist/core/animate-ui/components/base/preview-card.js +20 -3
- package/dist/core/animate-ui/components/buttons/copy.js +12 -6
- package/dist/core/animate-ui/components/radix/dialog.js +17 -3
- package/dist/core/animate-ui/components/radix/dropdown-menu.js +26 -9
- package/dist/core/animate-ui/components/radix/sheet.js +20 -4
- package/dist/core/animate-ui/components/radix/sidebar.js +9 -9
- package/dist/core/animate-ui/components/radix/toggle-group.js +103 -13
- package/dist/core/animate-ui/components/radix/toggle.js +5 -5
- package/dist/core/animate-ui/primitives/animate/code-block.js +31 -4
- package/dist/core/animate-ui/primitives/animate/shiki-highlighter.js +5 -2
- package/dist/core/animate-ui/primitives/animate/tabs.js +7 -4
- package/dist/core/animate-ui/primitives/animate/tooltip.js +10 -3
- package/dist/core/animate-ui/primitives/base/preview-card.js +2 -2
- package/dist/core/animate-ui/primitives/base/progress.js +1 -1
- package/dist/core/animate-ui/primitives/base/radio.js +3 -3
- package/dist/core/animate-ui/primitives/effects/highlight.js +1 -0
- package/dist/core/animate-ui/primitives/radix/accordion.js +1 -1
- package/dist/core/animate-ui/primitives/radix/dialog.js +6 -3
- package/dist/core/animate-ui/primitives/radix/dropdown-menu.js +2 -2
- package/dist/core/animate-ui/primitives/radix/sheet.js +7 -3
- package/dist/core/animate-ui/primitives/radix/switch.js +2 -2
- package/dist/core/animate-ui/primitives/radix/toggle-group.js +2 -2
- package/dist/core/badge.js +5 -2
- package/dist/core/breadcrumb.js +1 -1
- package/dist/core/button/button.js +8 -8
- package/dist/core/button/craft-button.js +8 -2
- package/dist/core/button.js +17 -7
- package/dist/core/card.js +23 -5
- package/dist/core/combobox/combobox.js +8 -2
- package/dist/core/command.js +3 -3
- package/dist/core/form.js +1 -1
- package/dist/core/hooks/use-nested-layer-press-guard.js +46 -0
- package/dist/core/hooks/use-on-screen.js +33 -0
- package/dist/core/hooks/use-prefers-reduced-motion.js +19 -0
- package/dist/core/hooks/use-scroll-overflow.js +20 -0
- package/dist/core/index.d.ts +30 -5
- package/dist/core/index.js +5 -2
- package/dist/core/input/input-password.js +13 -9
- package/dist/core/input/input.js +38 -12
- package/dist/core/input-otp/input-otp.js +9 -5
- package/dist/core/popover-group.js +48 -0
- package/dist/core/popover-hover.js +127 -0
- package/dist/core/popover.js +75 -6
- package/dist/core/select.js +35 -20
- package/dist/core/table.js +5 -3
- package/dist/core/textarea/textarea.js +11 -3
- package/dist/data-table/index.d.ts +4 -0
- package/dist/data-table/index.js +3 -0
- package/dist/date/index.d.ts +11 -0
- package/dist/date/index.js +7 -0
- package/dist/forms/index.d.ts +4 -0
- package/dist/forms/index.js +2 -0
- package/dist/icon-avatar.props-RYtw2eSW.d.ts +31 -0
- package/dist/icon-text-action-card.props-B2ggncUK.d.ts +53 -0
- package/dist/index.d.ts +169 -15
- package/dist/index.js +63 -10
- package/dist/input-CYI1hhGc.d.ts +38 -0
- package/dist/layouts/index.d.ts +132 -8
- package/dist/layouts/index.js +3 -1
- package/dist/layouts/minimal-workspace-layout/minimal-workspace-layout-context.js +5 -0
- package/dist/layouts/minimal-workspace-layout/minimal-workspace-layout.js +404 -0
- package/dist/layouts/minimal-workspace-layout/rail-logo.js +90 -0
- package/dist/layouts/minimal-workspace-layout/sidebar-trigger.js +42 -0
- package/dist/layouts/shared/account-menu-props.js +21 -0
- package/dist/layouts/shared/footer-branding.js +34 -0
- package/dist/layouts/shared/sidebar-logo.js +59 -0
- package/dist/layouts/workspace-layout/account-menu/account-menu.js +9 -3
- package/dist/layouts/workspace-layout/footer/footer.js +1 -1
- package/dist/layouts/workspace-layout/header/header.js +1 -1
- package/dist/layouts/workspace-layout/workspace-layout.js +28 -80
- package/dist/{list.props-x1j3CbcF.d.ts → list.props-DP_xPTqU.d.ts} +2 -1
- package/dist/markdown/index.d.ts +11 -0
- package/dist/markdown/index.js +5 -0
- package/dist/my-account-menu.props-C7DK71WC.d.ts +67 -0
- package/dist/page-container.props-JutTvKFq.d.ts +48 -0
- package/dist/resizable.props-RxFY5tm_.d.ts +44 -0
- package/dist/section-card-B7c5uc08.d.ts +84 -0
- package/dist/simple-clickable-card.props-BrPCw7CR.d.ts +51 -0
- package/dist/slot-DGErA9zi.d.ts +10 -0
- package/dist/status-badge.props-lKlEOfRt.d.ts +32 -0
- package/dist/style-axes-DSQ2DGc5.d.ts +133 -0
- package/dist/toast/index.d.ts +6 -0
- package/dist/toast/index.js +2 -0
- package/dist/tooltip-C0bYa8a3.d.ts +37 -0
- package/dist/{types-DtUxK-Am.d.ts → types-CkXflqg7.d.ts} +31 -1
- package/dist/utils/cn.js +6 -1
- package/dist/utils/color.js +35 -10
- package/dist/utils/index.d.ts +18 -2
- package/dist/utils/index.js +4 -1
- package/dist/utils/silver-shine.js +16 -1
- package/dist/utils/style-axes.js +227 -0
- package/dist/utils/variant.js +104 -8
- package/dist/utils/view-transition.js +21 -0
- package/dist/variant-D81RhpbR.d.ts +104 -0
- package/dist/vertical-stepper.props-BXYcbW70.d.ts +29 -0
- package/package.json +52 -6
- package/src/styles/colors.css +100 -4
- package/src/styles/globals.css +8 -131
- package/src/styles/style-axes.css +21 -0
- package/src/styles/theme.css +696 -0
- package/dist/app-logo.props-Ct7QBdTd.d.ts +0 -40
- package/dist/popover-ByLD3-Qv.d.ts +0 -204
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../utils/cn.js";
|
|
3
|
+
import { resolveVariantStyles } from "../../utils/variant.js";
|
|
4
|
+
import { useStyleAxes } from "../../utils/style-axes.js";
|
|
5
|
+
import { TruncatedLineWithTooltip } from "../truncated-line-with-tooltip/truncated-line-with-tooltip.js";
|
|
6
|
+
import { Badge } from "../../core/badge.js";
|
|
7
|
+
import * as React$1 from "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
//#region src/components/category-card/category-card.tsx
|
|
10
|
+
var ROOT = cn("group/category-card @container relative isolate flex h-full w-full cursor-pointer overflow-hidden text-left", "rounded-[var(--espd-own-radius,var(--espd-radius-surface,var(--radius-2xl)))] border border-border bg-card text-card-foreground", "ring-offset-background transition-[translate,box-shadow,border-color] duration-200", "hover:-translate-y-0.5 hover:border-primary hover:shadow-lg", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", "motion-reduce:transition-none motion-reduce:hover:translate-y-0");
|
|
11
|
+
var SELECTED = "border-primary ring-1 ring-primary";
|
|
12
|
+
var DEFAULT_MAX_TAGS = 3;
|
|
13
|
+
/** The tags row: badges, the rest as "+N". Dropped when the card is narrow (below 12rem). */
|
|
14
|
+
function Tags({ tags, max }) {
|
|
15
|
+
const shown = tags.slice(0, max);
|
|
16
|
+
const rest = tags.length - shown.length;
|
|
17
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
18
|
+
"data-slot": "category-card-tags",
|
|
19
|
+
className: "mt-auto hidden flex-wrap gap-1.5 @[12rem]:flex",
|
|
20
|
+
children: [shown.map((tag) => /* @__PURE__ */ jsx(Badge, {
|
|
21
|
+
variant: "soft",
|
|
22
|
+
color: "gray",
|
|
23
|
+
radius: "full",
|
|
24
|
+
className: "font-normal",
|
|
25
|
+
children: tag
|
|
26
|
+
}, tag)), rest > 0 && /* @__PURE__ */ jsxs(Badge, {
|
|
27
|
+
variant: "soft",
|
|
28
|
+
color: "gray",
|
|
29
|
+
radius: "full",
|
|
30
|
+
className: "font-normal",
|
|
31
|
+
title: tags.slice(max).join(", "),
|
|
32
|
+
children: ["+", rest]
|
|
33
|
+
})]
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* One category of a collection, as a card that opens or filters it: its icon
|
|
38
|
+
* on a coloured tile (which tilts under the pointer), how many there are, its
|
|
39
|
+
* name, a line on what it is, and a few examples. The whole card is one
|
|
40
|
+
* button, or one link with `href`. Narrow, it tightens and drops the examples.
|
|
41
|
+
*
|
|
42
|
+
* Give it an `aria-label` when the visible text alone is not the name you
|
|
43
|
+
* want read ("Show only Drivers, 65 blocks").
|
|
44
|
+
*/
|
|
45
|
+
var CategoryCard = React$1.forwardRef(({ icon, title, description, value, tags, maxTags = DEFAULT_MAX_TAGS, color = "primary", iconClassName, selected, href, truncateTitle = true, truncateDescription = true, radius, className, style, ...rest }, ref) => {
|
|
46
|
+
const { partStyle } = useStyleAxes({ radius }, ["radius"]);
|
|
47
|
+
const tile = iconClassName ? null : resolveVariantStyles("soft", color);
|
|
48
|
+
const body = /* @__PURE__ */ jsxs("span", {
|
|
49
|
+
className: "flex w-full min-w-0 flex-col gap-3 p-4 @[12rem]:gap-4 @[12rem]:p-5",
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ jsxs("span", {
|
|
52
|
+
className: "flex items-start justify-between gap-3",
|
|
53
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
54
|
+
"data-slot": "category-card-icon",
|
|
55
|
+
"aria-hidden": true,
|
|
56
|
+
className: cn("flex size-10 shrink-0 items-center justify-center rounded-xl @[12rem]:size-12", "[&_svg]:size-5 @[12rem]:[&_svg]:size-6", "transition-transform duration-300 group-hover/category-card:scale-105 group-hover/category-card:-rotate-3 motion-reduce:transform-none", tile ? [tile.container, tile.foreground] : iconClassName),
|
|
57
|
+
style: tile?.containerStyle,
|
|
58
|
+
children: icon
|
|
59
|
+
}), value !== void 0 && /* @__PURE__ */ jsx("span", {
|
|
60
|
+
"data-slot": "category-card-value",
|
|
61
|
+
className: "font-mono text-xl font-bold leading-none tabular-nums text-foreground @[12rem]:text-2xl",
|
|
62
|
+
children: value
|
|
63
|
+
})]
|
|
64
|
+
}),
|
|
65
|
+
/* @__PURE__ */ jsxs("span", {
|
|
66
|
+
className: "flex min-w-0 flex-col gap-1",
|
|
67
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
68
|
+
className: "text-sm font-semibold text-foreground @[12rem]:text-base",
|
|
69
|
+
children: truncateTitle ? /* @__PURE__ */ jsx(TruncatedLineWithTooltip, {
|
|
70
|
+
tooltipContent: title,
|
|
71
|
+
children: title
|
|
72
|
+
}) : title
|
|
73
|
+
}), description != null && /* @__PURE__ */ jsx("span", {
|
|
74
|
+
className: cn("text-xs text-muted-foreground @[12rem]:text-sm", truncateDescription && "line-clamp-2"),
|
|
75
|
+
children: description
|
|
76
|
+
})]
|
|
77
|
+
}),
|
|
78
|
+
!!tags?.length && /* @__PURE__ */ jsx(Tags, {
|
|
79
|
+
tags,
|
|
80
|
+
max: maxTags
|
|
81
|
+
})
|
|
82
|
+
]
|
|
83
|
+
});
|
|
84
|
+
const shared = {
|
|
85
|
+
"data-slot": "category-card",
|
|
86
|
+
"data-selected": selected ? "" : void 0,
|
|
87
|
+
className: cn(ROOT, selected && SELECTED, className),
|
|
88
|
+
style: {
|
|
89
|
+
...partStyle,
|
|
90
|
+
...style
|
|
91
|
+
},
|
|
92
|
+
...rest
|
|
93
|
+
};
|
|
94
|
+
if (href !== void 0) return /* @__PURE__ */ jsx("a", {
|
|
95
|
+
ref,
|
|
96
|
+
href,
|
|
97
|
+
"aria-current": selected ? "true" : void 0,
|
|
98
|
+
...shared,
|
|
99
|
+
children: body
|
|
100
|
+
});
|
|
101
|
+
return /* @__PURE__ */ jsx("button", {
|
|
102
|
+
ref,
|
|
103
|
+
type: "button",
|
|
104
|
+
"aria-pressed": selected,
|
|
105
|
+
...shared,
|
|
106
|
+
children: body
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
CategoryCard.displayName = "CategoryCard";
|
|
110
|
+
//#endregion
|
|
111
|
+
export { CategoryCard };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
import { C as Color } from '../../index-BQANnKs9.js';
|
|
4
|
+
import { k as StyleAxisProps } from '../../style-axes-DSQ2DGc5.js';
|
|
5
|
+
|
|
6
|
+
interface CategoryCardProps extends Omit<HTMLAttributes<HTMLElement>, "title" | "color">, Pick<StyleAxisProps, "radius"> {
|
|
7
|
+
/** The category's icon, drawn on a tile in `color`. Size it with nothing: the tile sizes an svg to fit. */
|
|
8
|
+
icon: ReactNode;
|
|
9
|
+
/** The category's name. */
|
|
10
|
+
title: string;
|
|
11
|
+
/** One line on what the category is. */
|
|
12
|
+
description?: ReactNode;
|
|
13
|
+
/** In the top-right corner: how many there are. Format it (and pluralise any unit) yourself. */
|
|
14
|
+
value?: ReactNode;
|
|
15
|
+
/** A few recognisable examples, as small badges. Those past `maxTags` fold into "+N". */
|
|
16
|
+
tags?: string[];
|
|
17
|
+
/** Tags shown before the rest fold into "+N". Default `3`. */
|
|
18
|
+
maxTags?: number;
|
|
19
|
+
/**
|
|
20
|
+
* The icon tile's colour, through the same `soft` resolution as `Badge`: a
|
|
21
|
+
* preset (`primary`, `success`…) or any CSS colour. Default `primary`.
|
|
22
|
+
*/
|
|
23
|
+
color?: Color;
|
|
24
|
+
/**
|
|
25
|
+
* A token tint for the icon tile the colour presets do not cover
|
|
26
|
+
* (`bg-swatch-2-light text-swatch-2`), INSTEAD of `color`: when set, `color`
|
|
27
|
+
* is ignored and the icon takes the tint's text colour.
|
|
28
|
+
*/
|
|
29
|
+
iconClassName?: string;
|
|
30
|
+
/**
|
|
31
|
+
* The card is the chosen one, when the cards act as a filter: an accent
|
|
32
|
+
* border, and `aria-pressed` (a button) or `aria-current` (a link).
|
|
33
|
+
* Leave it unset for cards that only navigate.
|
|
34
|
+
*/
|
|
35
|
+
selected?: boolean;
|
|
36
|
+
/** Render a link to `href` instead of a button. */
|
|
37
|
+
href?: string;
|
|
38
|
+
/** Keep the title on one line, with a tooltip when it is cut. Default `true`. */
|
|
39
|
+
truncateTitle?: boolean;
|
|
40
|
+
/** Clamp the description to two lines. Default `true`. */
|
|
41
|
+
truncateDescription?: boolean;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* One category of a collection, as a card that opens or filters it: its icon
|
|
46
|
+
* on a coloured tile (which tilts under the pointer), how many there are, its
|
|
47
|
+
* name, a line on what it is, and a few examples. The whole card is one
|
|
48
|
+
* button, or one link with `href`. Narrow, it tightens and drops the examples.
|
|
49
|
+
*
|
|
50
|
+
* Give it an `aria-label` when the visible text alone is not the name you
|
|
51
|
+
* want read ("Show only Drivers, 65 blocks").
|
|
52
|
+
*/
|
|
53
|
+
declare const CategoryCard: React.ForwardRefExoticComponent<CategoryCardProps & React.RefAttributes<HTMLElement>>;
|
|
54
|
+
|
|
55
|
+
export { CategoryCard, type CategoryCardProps };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cn } from "../../utils/cn.js";
|
|
2
|
-
import { ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent } from "./chart.js";
|
|
2
|
+
import { ChartContainer, ChartLegend, ChartLegendContent, ChartLegendFrame, ChartTooltip, ChartTooltipContent, buildSeriesLegendItems, renderChartLegendList, useChartScope } from "./chart.js";
|
|
3
3
|
import { buildAutoSeriesConfig, coerceSeriesValuesToNumbers, inferCategoryKey } from "./chart-series-data.js";
|
|
4
4
|
import * as React$1 from "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -15,7 +15,8 @@ var DEFAULT_X_AXIS_PADDING = {
|
|
|
15
15
|
left: 0,
|
|
16
16
|
right: 0
|
|
17
17
|
};
|
|
18
|
-
var AreaChart$1 = React$1.forwardRef(function AreaChart$2({ data, config: explicitConfig, categoryKey, stacked = false, curveType = "monotone", showTooltip = true, showLegend = false, showGrid = false, hideXAxis = false, hideYAxis = false, xAxisTickFormatter, yAxisTickFormatter, className, margin, xAxisPadding }, ref) {
|
|
18
|
+
var AreaChart$1 = React$1.forwardRef(function AreaChart$2({ data, config: explicitConfig, tooltipRadius, tooltipElevation, categoryKey, stacked = false, curveType = "monotone", showTooltip = true, showLegend = false, showGrid = false, hideXAxis = false, hideYAxis = false, xAxisTickFormatter, yAxisTickFormatter, className, margin, xAxisPadding, ...legendOptions }, ref) {
|
|
19
|
+
const scope = useChartScope();
|
|
19
20
|
const resolvedMargin = {
|
|
20
21
|
...DEFAULT_MARGIN,
|
|
21
22
|
...margin
|
|
@@ -44,90 +45,99 @@ var AreaChart$1 = React$1.forwardRef(function AreaChart$2({ data, config: explic
|
|
|
44
45
|
mid: .1,
|
|
45
46
|
soft: .03
|
|
46
47
|
};
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
children: /* @__PURE__ */
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
48
|
+
const listLegend = renderChartLegendList(showLegend, legendOptions, buildSeriesLegendItems(seriesKeys, config, chartData));
|
|
49
|
+
return /* @__PURE__ */ jsx(ChartLegendFrame, {
|
|
50
|
+
chartId: scope.chartId,
|
|
51
|
+
legend: listLegend,
|
|
52
|
+
children: /* @__PURE__ */ jsx(ChartContainer, {
|
|
53
|
+
ref,
|
|
54
|
+
id: scope.id,
|
|
55
|
+
config,
|
|
56
|
+
className: cn("w-full", className),
|
|
57
|
+
children: /* @__PURE__ */ jsxs(AreaChart, {
|
|
58
|
+
accessibilityLayer: true,
|
|
59
|
+
data: chartData,
|
|
60
|
+
margin: resolvedMargin,
|
|
61
|
+
children: [
|
|
62
|
+
/* @__PURE__ */ jsx("defs", { children: seriesKeys.map((key) => /* @__PURE__ */ jsxs("linearGradient", {
|
|
63
|
+
id: `${gradientPrefix}-${key}`,
|
|
64
|
+
x1: "0",
|
|
65
|
+
y1: "0",
|
|
66
|
+
x2: "0",
|
|
67
|
+
y2: "1",
|
|
68
|
+
children: [
|
|
69
|
+
/* @__PURE__ */ jsx("stop", {
|
|
70
|
+
offset: "0%",
|
|
71
|
+
stopColor: `var(--color-${key})`,
|
|
72
|
+
stopOpacity: gradientStops.peak
|
|
73
|
+
}),
|
|
74
|
+
/* @__PURE__ */ jsx("stop", {
|
|
75
|
+
offset: "14%",
|
|
76
|
+
stopColor: `var(--color-${key})`,
|
|
77
|
+
stopOpacity: gradientStops.highlight
|
|
78
|
+
}),
|
|
79
|
+
/* @__PURE__ */ jsx("stop", {
|
|
80
|
+
offset: "38%",
|
|
81
|
+
stopColor: `var(--color-${key})`,
|
|
82
|
+
stopOpacity: gradientStops.mid
|
|
83
|
+
}),
|
|
84
|
+
/* @__PURE__ */ jsx("stop", {
|
|
85
|
+
offset: "70%",
|
|
86
|
+
stopColor: `var(--color-${key})`,
|
|
87
|
+
stopOpacity: gradientStops.soft
|
|
88
|
+
}),
|
|
89
|
+
/* @__PURE__ */ jsx("stop", {
|
|
90
|
+
offset: "100%",
|
|
91
|
+
stopColor: `var(--color-${key})`,
|
|
92
|
+
stopOpacity: 0
|
|
93
|
+
})
|
|
94
|
+
]
|
|
95
|
+
}, key)) }),
|
|
96
|
+
showGrid && /* @__PURE__ */ jsx(CartesianGrid, { vertical: false }),
|
|
97
|
+
/* @__PURE__ */ jsx(XAxis, {
|
|
98
|
+
type: "category",
|
|
99
|
+
dataKey: resolvedCategoryKey,
|
|
100
|
+
hide: hideXAxis,
|
|
101
|
+
tickLine: false,
|
|
102
|
+
axisLine: false,
|
|
103
|
+
tickMargin: 8,
|
|
104
|
+
tickFormatter: xAxisTickFormatter,
|
|
105
|
+
padding: resolvedXAxisPadding,
|
|
106
|
+
interval: "preserveStartEnd"
|
|
107
|
+
}),
|
|
108
|
+
/* @__PURE__ */ jsx(YAxis, {
|
|
109
|
+
type: "number",
|
|
110
|
+
hide: hideYAxis,
|
|
111
|
+
tickLine: false,
|
|
112
|
+
axisLine: false,
|
|
113
|
+
tickMargin: 8,
|
|
114
|
+
tickFormatter: yAxisTickFormatter
|
|
115
|
+
}),
|
|
116
|
+
showTooltip && /* @__PURE__ */ jsx(ChartTooltip, {
|
|
117
|
+
cursor: {
|
|
118
|
+
fill: "var(--color-muted)",
|
|
119
|
+
fillOpacity: .12
|
|
120
|
+
},
|
|
121
|
+
content: /* @__PURE__ */ jsx(ChartTooltipContent, {
|
|
122
|
+
radius: tooltipRadius,
|
|
123
|
+
elevation: tooltipElevation
|
|
87
124
|
})
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
hide: hideYAxis,
|
|
105
|
-
tickLine: false,
|
|
106
|
-
axisLine: false,
|
|
107
|
-
tickMargin: 8,
|
|
108
|
-
tickFormatter: yAxisTickFormatter
|
|
109
|
-
}),
|
|
110
|
-
showTooltip && /* @__PURE__ */ jsx(ChartTooltip, {
|
|
111
|
-
cursor: {
|
|
112
|
-
fill: "var(--color-muted)",
|
|
113
|
-
fillOpacity: .12
|
|
114
|
-
},
|
|
115
|
-
content: /* @__PURE__ */ jsx(ChartTooltipContent, {})
|
|
116
|
-
}),
|
|
117
|
-
showLegend && /* @__PURE__ */ jsx(ChartLegend, { content: /* @__PURE__ */ jsx(ChartLegendContent, {}) }),
|
|
118
|
-
seriesKeys.map((key) => /* @__PURE__ */ jsx(Area, {
|
|
119
|
-
type: curveType,
|
|
120
|
-
dataKey: key,
|
|
121
|
-
stackId: stacked ? "stack" : void 0,
|
|
122
|
-
fill: `url(#${gradientPrefix}-${key})`,
|
|
123
|
-
stroke: `var(--color-${key})`,
|
|
124
|
-
strokeWidth: 1,
|
|
125
|
-
strokeOpacity: .75,
|
|
126
|
-
strokeLinecap: "round",
|
|
127
|
-
strokeLinejoin: "round",
|
|
128
|
-
isAnimationActive: true
|
|
129
|
-
}, key))
|
|
130
|
-
]
|
|
125
|
+
}),
|
|
126
|
+
showLegend && !listLegend && /* @__PURE__ */ jsx(ChartLegend, { content: /* @__PURE__ */ jsx(ChartLegendContent, {}) }),
|
|
127
|
+
seriesKeys.map((key) => /* @__PURE__ */ jsx(Area, {
|
|
128
|
+
type: curveType,
|
|
129
|
+
dataKey: key,
|
|
130
|
+
stackId: stacked ? "stack" : void 0,
|
|
131
|
+
fill: `url(#${gradientPrefix}-${key})`,
|
|
132
|
+
stroke: `var(--color-${key})`,
|
|
133
|
+
strokeWidth: 1,
|
|
134
|
+
strokeOpacity: .75,
|
|
135
|
+
strokeLinecap: "round",
|
|
136
|
+
strokeLinejoin: "round",
|
|
137
|
+
isAnimationActive: true
|
|
138
|
+
}, key))
|
|
139
|
+
]
|
|
140
|
+
})
|
|
131
141
|
})
|
|
132
142
|
});
|
|
133
143
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { cn } from "../../utils/cn.js";
|
|
2
|
-
import { ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent } from "./chart.js";
|
|
2
|
+
import { ChartContainer, ChartLegend, ChartLegendContent, ChartLegendFrame, ChartTooltip, ChartTooltipContent, buildSeriesLegendItems, renderChartLegendList, useChartScope } from "./chart.js";
|
|
3
3
|
import { buildAutoSeriesConfig, coerceSeriesValuesToNumbers, inferCategoryKey } from "./chart-series-data.js";
|
|
4
4
|
import * as React$1 from "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
import { Bar, BarChart, CartesianGrid, XAxis, YAxis } from "recharts";
|
|
6
|
+
import { Bar, BarChart, CartesianGrid, Rectangle, XAxis, YAxis } from "recharts";
|
|
7
7
|
//#region src/components/chart/bar-chart.tsx
|
|
8
8
|
var BAR_SIZE_MAP = {
|
|
9
9
|
sm: 14,
|
|
@@ -76,7 +76,58 @@ function getBarRadius(index, total, stacked, rounded, layout) {
|
|
|
76
76
|
0
|
|
77
77
|
];
|
|
78
78
|
}
|
|
79
|
-
|
|
79
|
+
function hasValue(row, key) {
|
|
80
|
+
const v = Number(row?.[key]);
|
|
81
|
+
return Number.isFinite(v) && v !== 0;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Shape for one segment of a segmented stack: a fully rounded rect, inset by
|
|
85
|
+
* half the gap on each side that touches another non-empty segment, so the
|
|
86
|
+
* stack's outer ends stay flush with the plot.
|
|
87
|
+
*/
|
|
88
|
+
function renderSegment(props, key, keys, gap, vertical, rounded) {
|
|
89
|
+
const { fill, payload } = props;
|
|
90
|
+
let x = props.x ?? 0;
|
|
91
|
+
let y = props.y ?? 0;
|
|
92
|
+
let width = props.width ?? 0;
|
|
93
|
+
let height = props.height ?? 0;
|
|
94
|
+
if (width < 0) {
|
|
95
|
+
x += width;
|
|
96
|
+
width = -width;
|
|
97
|
+
}
|
|
98
|
+
if (height < 0) {
|
|
99
|
+
y += height;
|
|
100
|
+
height = -height;
|
|
101
|
+
}
|
|
102
|
+
if (width === 0 || height === 0) return /* @__PURE__ */ jsx("g", {});
|
|
103
|
+
const index = keys.indexOf(key);
|
|
104
|
+
const before = keys.slice(0, index).some((k) => hasValue(payload, k));
|
|
105
|
+
const after = keys.slice(index + 1).some((k) => hasValue(payload, k));
|
|
106
|
+
const half = gap / 2;
|
|
107
|
+
const minExtent = 2;
|
|
108
|
+
if (vertical) {
|
|
109
|
+
const start = before ? half : 0;
|
|
110
|
+
const end = after ? half : 0;
|
|
111
|
+
x += start;
|
|
112
|
+
width = Math.max(Math.min(width, minExtent), width - start - end);
|
|
113
|
+
} else {
|
|
114
|
+
const bottom = before ? half : 0;
|
|
115
|
+
const top = after ? half : 0;
|
|
116
|
+
y += top;
|
|
117
|
+
height = Math.max(Math.min(height, minExtent), height - top - bottom);
|
|
118
|
+
}
|
|
119
|
+
const radius = rounded ? Math.min(width, height) / 2 : 0;
|
|
120
|
+
return /* @__PURE__ */ jsx(Rectangle, {
|
|
121
|
+
x,
|
|
122
|
+
y,
|
|
123
|
+
width,
|
|
124
|
+
height,
|
|
125
|
+
fill,
|
|
126
|
+
radius
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
var BarChart$1 = React$1.forwardRef(function BarChart$2({ data, config: explicitConfig, tooltipRadius, tooltipElevation, categoryKey, layout = "horizontal", stacked = false, barSize, rounded = true, segmented = false, segmentGap = 4, showTooltip = true, showLegend = false, showGrid = false, hideXAxis = false, hideYAxis = false, xAxisTickFormatter, yAxisTickFormatter, labelFormatter, tooltipFormatter, tooltipContent, barGap, categoryGap, className, margin, ...legendOptions }, ref) {
|
|
130
|
+
const scope = useChartScope();
|
|
80
131
|
const resolvedCategoryKey = React$1.useMemo(() => categoryKey ?? inferCategoryKey(data[0]), [categoryKey, data]);
|
|
81
132
|
const config = React$1.useMemo(() => buildAutoSeriesConfig(data, resolvedCategoryKey, explicitConfig), [
|
|
82
133
|
data,
|
|
@@ -87,63 +138,75 @@ var BarChart$1 = React$1.forwardRef(function BarChart$2({ data, config: explicit
|
|
|
87
138
|
const chartData = React$1.useMemo(() => coerceSeriesValuesToNumbers(data, barKeys), [data, barKeys]);
|
|
88
139
|
const maxBarSize = resolveBarSize(barSize);
|
|
89
140
|
const isVertical = layout === "vertical";
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
children:
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
141
|
+
const isSegmented = stacked && segmented;
|
|
142
|
+
const legendLayout = legendOptions.legendLayout ?? "inline";
|
|
143
|
+
const listLegend = renderChartLegendList(showLegend, legendOptions, buildSeriesLegendItems(barKeys, config, chartData));
|
|
144
|
+
return /* @__PURE__ */ jsx(ChartLegendFrame, {
|
|
145
|
+
chartId: scope.chartId,
|
|
146
|
+
legend: listLegend,
|
|
147
|
+
children: /* @__PURE__ */ jsx(ChartContainer, {
|
|
148
|
+
ref,
|
|
149
|
+
id: scope.id,
|
|
150
|
+
config,
|
|
151
|
+
className: cn("w-full", className),
|
|
152
|
+
children: /* @__PURE__ */ jsxs(BarChart, {
|
|
153
|
+
accessibilityLayer: true,
|
|
154
|
+
layout,
|
|
155
|
+
data: chartData,
|
|
156
|
+
margin,
|
|
157
|
+
barGap,
|
|
158
|
+
barCategoryGap: categoryGap,
|
|
159
|
+
children: [
|
|
160
|
+
showGrid && /* @__PURE__ */ jsx(CartesianGrid, {
|
|
161
|
+
vertical: !isVertical,
|
|
162
|
+
horizontal: isVertical
|
|
163
|
+
}),
|
|
164
|
+
/* @__PURE__ */ jsx(XAxis, {
|
|
165
|
+
type: isVertical ? "number" : "category",
|
|
166
|
+
dataKey: isVertical ? void 0 : resolvedCategoryKey,
|
|
167
|
+
hide: hideXAxis,
|
|
168
|
+
tickLine: false,
|
|
169
|
+
axisLine: false,
|
|
170
|
+
tickMargin: 8,
|
|
171
|
+
tickFormatter: xAxisTickFormatter,
|
|
172
|
+
...isVertical ? {
|
|
173
|
+
domain: [0, "dataMax"],
|
|
174
|
+
padding: {
|
|
175
|
+
left: 0,
|
|
176
|
+
right: 0
|
|
177
|
+
}
|
|
178
|
+
} : {}
|
|
179
|
+
}),
|
|
180
|
+
/* @__PURE__ */ jsx(YAxis, {
|
|
181
|
+
type: isVertical ? "category" : "number",
|
|
182
|
+
dataKey: isVertical ? resolvedCategoryKey : void 0,
|
|
183
|
+
hide: hideYAxis,
|
|
184
|
+
tickLine: false,
|
|
185
|
+
axisLine: false,
|
|
186
|
+
tickFormatter: yAxisTickFormatter
|
|
187
|
+
}),
|
|
188
|
+
showTooltip && /* @__PURE__ */ jsx(ChartTooltip, {
|
|
189
|
+
cursor: {
|
|
190
|
+
fill: "var(--color-muted)",
|
|
191
|
+
fillOpacity: .12
|
|
192
|
+
},
|
|
193
|
+
labelFormatter,
|
|
194
|
+
content: tooltipContent ?? /* @__PURE__ */ jsx(ChartTooltipContent, {
|
|
195
|
+
radius: tooltipRadius,
|
|
196
|
+
elevation: tooltipElevation,
|
|
197
|
+
formatter: tooltipFormatter
|
|
198
|
+
})
|
|
199
|
+
}),
|
|
200
|
+
showLegend && legendLayout === "inline" && /* @__PURE__ */ jsx(ChartLegend, { content: /* @__PURE__ */ jsx(ChartLegendContent, {}) }),
|
|
201
|
+
barKeys.map((key, i) => /* @__PURE__ */ jsx(Bar, {
|
|
202
|
+
dataKey: key,
|
|
203
|
+
stackId: stacked ? "stack" : void 0,
|
|
204
|
+
fill: `var(--color-${key})`,
|
|
205
|
+
maxBarSize,
|
|
206
|
+
...isSegmented ? { shape: (props) => renderSegment(props, key, barKeys, segmentGap, isVertical, rounded) } : { radius: getBarRadius(i, barKeys.length, stacked, rounded, layout) }
|
|
207
|
+
}, key))
|
|
208
|
+
]
|
|
209
|
+
})
|
|
147
210
|
})
|
|
148
211
|
});
|
|
149
212
|
});
|