@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,100 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { S as Size } from '../../index-BQANnKs9.js';
|
|
4
|
+
import { k as StyleAxisProps } from '../../style-axes-DSQ2DGc5.js';
|
|
5
|
+
|
|
6
|
+
declare const PRESET_IDS: readonly ["today", "yesterday", "this-week", "last-week", "this-month", "last-month", "this-year", "last-year", "last-1-hour", "last-24-hours", "last-1-day", "past-7-days", "last-7-days", "last-14-days", "last-15-days", "past-30-days", "last-30-days", "last-4-weeks", "last-90-days", "last-3-months", "last-6-months", "last-1-year", "last-5-years"];
|
|
7
|
+
type DateRangePickerPresetId = (typeof PRESET_IDS)[number];
|
|
8
|
+
declare const PRESET_LABELS: Record<DateRangePickerPresetId, string>;
|
|
9
|
+
/**
|
|
10
|
+
* Presets that end at the current moment instead of snapping to day
|
|
11
|
+
* boundaries. `past-7-days` and `past-30-days` include today, unlike
|
|
12
|
+
* `last-7-days` and `last-30-days`, which end yesterday at 23:59.
|
|
13
|
+
*/
|
|
14
|
+
declare const ROLLING_PRESET_IDS: readonly ["last-1-hour", "last-24-hours", "past-7-days", "past-30-days"];
|
|
15
|
+
declare function computeDateRange(id: DateRangePickerPresetId): {
|
|
16
|
+
startDate: Date;
|
|
17
|
+
endDate: Date;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
interface DateRangePickerCommittedRange {
|
|
21
|
+
startDate: Date;
|
|
22
|
+
endDate: Date;
|
|
23
|
+
}
|
|
24
|
+
interface DateRangePickerDraftRange {
|
|
25
|
+
startDate: Date | null;
|
|
26
|
+
endDate: Date | null;
|
|
27
|
+
}
|
|
28
|
+
interface DateRangePickerProps extends Pick<StyleAxisProps, "radius"> {
|
|
29
|
+
/** Which presets to show. If omitted, all presets are shown. */
|
|
30
|
+
presets?: DateRangePickerPresetId[];
|
|
31
|
+
/** Override labels for presets (i18n). Merged with built-in English defaults. Also accepts `"custom"` key. */
|
|
32
|
+
presetLabels?: Partial<Record<DateRangePickerPresetId | "custom", string>>;
|
|
33
|
+
/** Show the "Custom" sub-menu with Calendar. */
|
|
34
|
+
allowCustom?: boolean;
|
|
35
|
+
/** When `true`, end date is locked to today. One click produces a complete range. */
|
|
36
|
+
lockEndToToday?: boolean;
|
|
37
|
+
/** When `true`, dates after today are unselectable on the calendar. */
|
|
38
|
+
disableFutureDates?: boolean;
|
|
39
|
+
/** date-fns format string for the footer date inputs. */
|
|
40
|
+
dateFormat?: string;
|
|
41
|
+
/** Fires when a preset is clicked or a custom date is applied. `presetId` is `undefined` for custom apply. */
|
|
42
|
+
onChange?: (data: {
|
|
43
|
+
presetId?: DateRangePickerPresetId;
|
|
44
|
+
startDate: Date;
|
|
45
|
+
endDate: Date;
|
|
46
|
+
}) => void;
|
|
47
|
+
/** Fires when a preset is clicked. Always emits committed, valid dates. */
|
|
48
|
+
onPresetChange?: (presetId: DateRangePickerPresetId, range: DateRangePickerCommittedRange) => void;
|
|
49
|
+
/** Fires while editing custom range. Partial values are represented as `null`. */
|
|
50
|
+
onDraftChange?: (range: DateRangePickerDraftRange) => void;
|
|
51
|
+
/** Controlled: highlights the selected preset in the menu. */
|
|
52
|
+
selectedPresetId?: DateRangePickerPresetId;
|
|
53
|
+
/** Controlled: pre-selects date(s) on the Calendar. */
|
|
54
|
+
selectedStartDate?: Date;
|
|
55
|
+
/** Controlled: Calendar range end. */
|
|
56
|
+
selectedEndDate?: Date;
|
|
57
|
+
/**
|
|
58
|
+
* Show a "Clear" item at the bottom of the menu while a preset or custom
|
|
59
|
+
* range is selected. Selecting it calls `onClear` and closes the menu.
|
|
60
|
+
*/
|
|
61
|
+
clearable?: boolean;
|
|
62
|
+
/** Label for the "Clear" menu item (i18n). Default: `"Clear"`. */
|
|
63
|
+
clearLabel?: string;
|
|
64
|
+
/** Fires when the "Clear" menu item is selected. The consumer resets its selection. */
|
|
65
|
+
onClear?: () => void;
|
|
66
|
+
/** Custom trigger element. Overrides the default Input trigger entirely. */
|
|
67
|
+
trigger?: React__default.ReactNode;
|
|
68
|
+
placeholder?: string;
|
|
69
|
+
label?: React__default.ReactNode;
|
|
70
|
+
size?: Size;
|
|
71
|
+
hideIcon?: boolean;
|
|
72
|
+
disabled?: boolean;
|
|
73
|
+
required?: boolean;
|
|
74
|
+
/** Fully rounded trigger. Same as `radius="full"` (the trigger's radius); `radius` wins when both are set. */
|
|
75
|
+
rounded?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Corner radius of the calendar popover (overlay role), like `radius` on
|
|
78
|
+
* `PopoverContent`. `radius` shapes the trigger only.
|
|
79
|
+
*/
|
|
80
|
+
popoverRadius?: StyleAxisProps["radius"];
|
|
81
|
+
/** Shadow of the calendar popover (overlay role), like `elevation` on `PopoverContent`. */
|
|
82
|
+
popoverElevation?: StyleAxisProps["elevation"];
|
|
83
|
+
error?: boolean;
|
|
84
|
+
errorContent?: React__default.ReactNode;
|
|
85
|
+
startHelperContent?: React__default.ReactNode;
|
|
86
|
+
endHelperContent?: React__default.ReactNode;
|
|
87
|
+
hintContent?: React__default.ReactNode;
|
|
88
|
+
/** Dropdown alignment relative to trigger. */
|
|
89
|
+
align?: "start" | "center" | "end";
|
|
90
|
+
/** Dropdown side. */
|
|
91
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
92
|
+
className?: string;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
declare function DateRangePicker({ presets, presetLabels, allowCustom, lockEndToToday, disableFutureDates, dateFormat, onChange, onPresetChange, onDraftChange, selectedPresetId, selectedStartDate, selectedEndDate, clearable, clearLabel, onClear, trigger, placeholder, label, size, hideIcon, disabled, required, rounded, radius, popoverRadius, popoverElevation, error, errorContent, startHelperContent, endHelperContent, hintContent, align, side, className, }: DateRangePickerProps): React.JSX.Element;
|
|
96
|
+
declare namespace DateRangePicker {
|
|
97
|
+
var displayName: string;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export { DateRangePicker, type DateRangePickerCommittedRange, type DateRangePickerDraftRange, type DateRangePickerPresetId, type DateRangePickerProps, PRESET_IDS, PRESET_LABELS, ROLLING_PRESET_IDS, computeDateRange };
|
|
@@ -26,7 +26,7 @@ var OPEN_KEYS = /* @__PURE__ */ new Set([
|
|
|
26
26
|
* open so the time can be set in the same interaction.
|
|
27
27
|
*/
|
|
28
28
|
function DateTimePicker(props) {
|
|
29
|
-
const { value, onChange, defaultValue, defaultTime = DEFAULT_TIME, timeStep = DEFAULT_TIME_STEP_SECONDS, clearable = false, clearLabel = "Clear", timeAriaLabel = "Time", formatDate, placeholder = "Pick date and time", label, size, hideIcon = false, disabled = false, required = false, rounded = false, error, errorContent, hintContent, calendarProps, open: controlledOpen, onOpenChange, name, className } = props;
|
|
29
|
+
const { value, onChange, defaultValue, defaultTime = DEFAULT_TIME, timeStep = DEFAULT_TIME_STEP_SECONDS, clearable = false, clearLabel = "Clear", timeAriaLabel = "Time", formatDate, placeholder = "Pick date and time", label, size, hideIcon = false, disabled = false, required = false, rounded = false, radius, popoverRadius, popoverElevation, error, errorContent, hintContent, calendarProps, open: controlledOpen, onOpenChange, name, className } = props;
|
|
30
30
|
const isControlled = "value" in props;
|
|
31
31
|
const [uncontrolledValue, setUncontrolledValue] = React$1.useState(defaultValue);
|
|
32
32
|
const current = isControlled ? value : uncontrolledValue;
|
|
@@ -100,6 +100,7 @@ function DateTimePicker(props) {
|
|
|
100
100
|
disabled,
|
|
101
101
|
required,
|
|
102
102
|
rounded,
|
|
103
|
+
radius,
|
|
103
104
|
error,
|
|
104
105
|
errorContent,
|
|
105
106
|
hintContent,
|
|
@@ -110,7 +111,9 @@ function DateTimePicker(props) {
|
|
|
110
111
|
})
|
|
111
112
|
}), /* @__PURE__ */ jsxs(PopoverContent, {
|
|
112
113
|
align: "start",
|
|
113
|
-
|
|
114
|
+
radius: popoverRadius,
|
|
115
|
+
elevation: popoverElevation,
|
|
116
|
+
className: "w-auto overflow-hidden rounded-[var(--espd-own-radius,var(--espd-radius-overlay,var(--radius-2xl)))] p-1 shadow-[shadow:var(--espd-own-elevation,var(--espd-elevation-overlay,var(--shadow-lg)))]",
|
|
114
117
|
children: [/* @__PURE__ */ jsx(Calendar, {
|
|
115
118
|
mode: "single",
|
|
116
119
|
selected: current,
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { C as CalendarProps } from '../../calendar.props-BtCzuWH1.js';
|
|
4
|
+
import { S as Size } from '../../index-BQANnKs9.js';
|
|
5
|
+
import { k as StyleAxisProps } from '../../style-axes-DSQ2DGc5.js';
|
|
6
|
+
import 'react-day-picker';
|
|
7
|
+
|
|
8
|
+
interface DateTimePickerProps extends Pick<StyleAxisProps, "radius"> {
|
|
9
|
+
/**
|
|
10
|
+
* Controlled value. Local wall-clock time; callers convert to UTC or epoch
|
|
11
|
+
* themselves. Pass `undefined` for "nothing selected".
|
|
12
|
+
*/
|
|
13
|
+
value?: Date;
|
|
14
|
+
onChange?: (date: Date | undefined) => void;
|
|
15
|
+
defaultValue?: Date;
|
|
16
|
+
/**
|
|
17
|
+
* Time of day applied when a day is picked before any time was typed.
|
|
18
|
+
* `"HH:mm"` or `"HH:mm:ss"`.
|
|
19
|
+
* @default "00:00"
|
|
20
|
+
*/
|
|
21
|
+
defaultTime?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Native `step` of the time input in seconds. Values below 60 show a
|
|
24
|
+
* seconds field.
|
|
25
|
+
* @default 60
|
|
26
|
+
*/
|
|
27
|
+
timeStep?: number;
|
|
28
|
+
/** Shows an X inside the trigger that clears both the day and the time. */
|
|
29
|
+
clearable?: boolean;
|
|
30
|
+
/** Accessible name of the clear button. @default "Clear" */
|
|
31
|
+
clearLabel?: string;
|
|
32
|
+
/** Accessible name of the time input inside the dropdown. @default "Time" */
|
|
33
|
+
timeAriaLabel?: string;
|
|
34
|
+
/** Formats the value shown in the trigger. Defaults to date-fns `PPP, p`. */
|
|
35
|
+
formatDate?: (date: Date) => string;
|
|
36
|
+
/** @default "Pick date and time" */
|
|
37
|
+
placeholder?: string;
|
|
38
|
+
label?: React__default.ReactNode;
|
|
39
|
+
size?: Size;
|
|
40
|
+
/** Hides the decorative calendar icon in the trigger. */
|
|
41
|
+
hideIcon?: boolean;
|
|
42
|
+
disabled?: boolean;
|
|
43
|
+
required?: boolean;
|
|
44
|
+
/** Fully rounded trigger. Same as `radius="full"` (the trigger's radius); `radius` wins when both are set. */
|
|
45
|
+
rounded?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Corner radius of the calendar popover (overlay role), like `radius` on
|
|
48
|
+
* `PopoverContent`. `radius` shapes the trigger only.
|
|
49
|
+
*/
|
|
50
|
+
popoverRadius?: StyleAxisProps["radius"];
|
|
51
|
+
/** Shadow of the calendar popover (overlay role), like `elevation` on `PopoverContent`. */
|
|
52
|
+
popoverElevation?: StyleAxisProps["elevation"];
|
|
53
|
+
error?: boolean;
|
|
54
|
+
errorContent?: React__default.ReactNode;
|
|
55
|
+
hintContent?: React__default.ReactNode;
|
|
56
|
+
calendarProps?: Omit<CalendarProps, "mode" | "selected" | "onSelect">;
|
|
57
|
+
/** Controlled open state of the dropdown. */
|
|
58
|
+
open?: boolean;
|
|
59
|
+
onOpenChange?: (open: boolean) => void;
|
|
60
|
+
/** When set, renders a hidden input carrying the ISO string of the value. */
|
|
61
|
+
name?: string;
|
|
62
|
+
className?: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* One read-only input that opens a dropdown holding a `Calendar` and a
|
|
67
|
+
* `TimePicker`. Both edit a single `Date`.
|
|
68
|
+
*
|
|
69
|
+
* The time input is driven by a local draft string so a time typed before a
|
|
70
|
+
* day is picked is kept, and so an incomplete time (the browser reports `""`
|
|
71
|
+
* mid-edit) never snaps the committed value. Picking a day keeps the dropdown
|
|
72
|
+
* open so the time can be set in the same interaction.
|
|
73
|
+
*/
|
|
74
|
+
declare function DateTimePicker(props: DateTimePickerProps): React.JSX.Element;
|
|
75
|
+
declare namespace DateTimePicker {
|
|
76
|
+
var displayName: string;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export { DateTimePicker, type DateTimePickerProps };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ComponentType } from 'react';
|
|
3
|
+
import { C as Color } from '../../index-BQANnKs9.js';
|
|
4
|
+
|
|
5
|
+
interface DeviceIconProps {
|
|
6
|
+
type: string;
|
|
7
|
+
size?: number;
|
|
8
|
+
color?: Color;
|
|
9
|
+
fallback?: ComponentType<{
|
|
10
|
+
size?: number;
|
|
11
|
+
}>;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
declare function DeviceIcon({ type, size, color, fallback: Fallback, className }: DeviceIconProps): React.JSX.Element | null;
|
|
16
|
+
|
|
17
|
+
export { DeviceIcon, type DeviceIconProps };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Dialog as Dialog$1 } from 'radix-ui';
|
|
3
|
+
import { HTMLMotionProps } from 'motion/react';
|
|
4
|
+
import { k as StyleAxisProps, d as DensityProps } from '../../style-axes-DSQ2DGc5.js';
|
|
5
|
+
|
|
6
|
+
type DialogProps$1 = React.ComponentProps<typeof Dialog$1.Root>;
|
|
7
|
+
type DialogTriggerProps$1 = React.ComponentProps<typeof Dialog$1.Trigger>;
|
|
8
|
+
type DialogFlipDirection = 'top' | 'bottom' | 'left' | 'right';
|
|
9
|
+
type DialogContentProps$1 = Omit<React.ComponentProps<typeof Dialog$1.Content>, 'forceMount' | 'asChild'> & HTMLMotionProps<'div'> & {
|
|
10
|
+
from?: DialogFlipDirection;
|
|
11
|
+
};
|
|
12
|
+
type DialogCloseProps$1 = React.ComponentProps<typeof Dialog$1.Close>;
|
|
13
|
+
type DialogHeaderProps$1 = React.ComponentProps<'div'>;
|
|
14
|
+
type DialogFooterProps$1 = React.ComponentProps<'div'>;
|
|
15
|
+
type DialogTitleProps$1 = React.ComponentProps<typeof Dialog$1.Title>;
|
|
16
|
+
type DialogDescriptionProps$1 = React.ComponentProps<typeof Dialog$1.Description>;
|
|
17
|
+
|
|
18
|
+
type DialogProps = DialogProps$1;
|
|
19
|
+
declare function Dialog(props: DialogProps): React.JSX.Element;
|
|
20
|
+
type DialogTriggerProps = DialogTriggerProps$1;
|
|
21
|
+
declare function DialogTrigger(props: DialogTriggerProps): React.JSX.Element;
|
|
22
|
+
type DialogCloseProps = DialogCloseProps$1;
|
|
23
|
+
declare function DialogClose(props: DialogCloseProps): React.JSX.Element;
|
|
24
|
+
type DialogContentProps = DialogContentProps$1 & Pick<StyleAxisProps, 'radius' | 'elevation'> & DensityProps & {
|
|
25
|
+
showCloseButton?: boolean;
|
|
26
|
+
closeButtonClassName?: string;
|
|
27
|
+
};
|
|
28
|
+
declare function DialogContent({ className, children, showCloseButton, closeButtonClassName, radius, elevation, density, style, ...props }: DialogContentProps): React.JSX.Element;
|
|
29
|
+
type DialogHeaderProps = DialogHeaderProps$1;
|
|
30
|
+
declare function DialogHeader({ className, ...props }: DialogHeaderProps): React.JSX.Element;
|
|
31
|
+
type DialogFooterProps = DialogFooterProps$1;
|
|
32
|
+
declare function DialogFooter({ className, ...props }: DialogFooterProps): React.JSX.Element;
|
|
33
|
+
type DialogTitleProps = DialogTitleProps$1;
|
|
34
|
+
declare function DialogTitle({ className, ...props }: DialogTitleProps): React.JSX.Element;
|
|
35
|
+
type DialogDescriptionProps = DialogDescriptionProps$1;
|
|
36
|
+
declare function DialogDescription({ className, ...props }: DialogDescriptionProps): React.JSX.Element;
|
|
37
|
+
|
|
38
|
+
export { Dialog, DialogClose, type DialogCloseProps, DialogContent, type DialogContentProps, DialogDescription, type DialogDescriptionProps, DialogFooter, type DialogFooterProps, DialogHeader, type DialogHeaderProps, type DialogProps, DialogTitle, type DialogTitleProps, DialogTrigger, type DialogTriggerProps };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "../../core/animate-ui/components/radix/dialog.js";
|
|
2
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { DropdownMenu as DropdownMenu$1 } from 'radix-ui';
|
|
3
|
+
import { HTMLMotionProps } from 'motion/react';
|
|
4
|
+
import { k as StyleAxisProps } from '../../style-axes-DSQ2DGc5.js';
|
|
5
|
+
|
|
6
|
+
type DropdownMenuProps$1 = React.ComponentProps<typeof DropdownMenu$1.Root>;
|
|
7
|
+
type DropdownMenuTriggerProps$1 = React.ComponentProps<typeof DropdownMenu$1.Trigger>;
|
|
8
|
+
type DropdownMenuGroupProps$1 = React.ComponentProps<typeof DropdownMenu$1.Group>;
|
|
9
|
+
type DropdownMenuSubProps$1 = React.ComponentProps<typeof DropdownMenu$1.Sub>;
|
|
10
|
+
type DropdownMenuRadioGroupProps$1 = React.ComponentProps<typeof DropdownMenu$1.RadioGroup>;
|
|
11
|
+
type DropdownMenuSubTriggerProps$1 = Omit<React.ComponentProps<typeof DropdownMenu$1.SubTrigger>, 'asChild'> & HTMLMotionProps<'div'>;
|
|
12
|
+
type DropdownMenuSubContentProps$1 = Omit<React.ComponentProps<typeof DropdownMenu$1.SubContent>, 'forceMount' | 'asChild'> & Omit<React.ComponentProps<typeof DropdownMenu$1.Portal>, 'forceMount'> & HTMLMotionProps<'div'>;
|
|
13
|
+
type DropdownMenuContentProps$1 = Omit<React.ComponentProps<typeof DropdownMenu$1.Content>, 'forceMount' | 'asChild'> & Omit<React.ComponentProps<typeof DropdownMenu$1.Portal>, 'forceMount'> & HTMLMotionProps<'div'>;
|
|
14
|
+
type DropdownMenuItemProps$1 = Omit<React.ComponentProps<typeof DropdownMenu$1.Item>, 'asChild'> & HTMLMotionProps<'div'>;
|
|
15
|
+
type DropdownMenuCheckboxItemProps$1 = Omit<React.ComponentProps<typeof DropdownMenu$1.CheckboxItem>, 'asChild'> & HTMLMotionProps<'div'>;
|
|
16
|
+
type DropdownMenuRadioItemProps$1 = Omit<React.ComponentProps<typeof DropdownMenu$1.RadioItem>, 'asChild'> & HTMLMotionProps<'div'>;
|
|
17
|
+
type DropdownMenuLabelProps$1 = React.ComponentProps<typeof DropdownMenu$1.Label>;
|
|
18
|
+
type DropdownMenuSeparatorProps$1 = React.ComponentProps<typeof DropdownMenu$1.Separator>;
|
|
19
|
+
type DropdownMenuShortcutProps$1 = React.ComponentProps<'span'>;
|
|
20
|
+
|
|
21
|
+
type DropdownMenuProps = DropdownMenuProps$1;
|
|
22
|
+
declare function DropdownMenu(props: DropdownMenuProps): React.JSX.Element;
|
|
23
|
+
type DropdownMenuTriggerProps = DropdownMenuTriggerProps$1;
|
|
24
|
+
declare function DropdownMenuTrigger(props: DropdownMenuTriggerProps): React.JSX.Element;
|
|
25
|
+
type DropdownMenuContentProps = DropdownMenuContentProps$1 & Pick<StyleAxisProps, 'radius' | 'elevation'>;
|
|
26
|
+
declare function DropdownMenuContent({ sideOffset, className, children, radius, elevation, style, ...props }: DropdownMenuContentProps): React.JSX.Element;
|
|
27
|
+
type DropdownMenuGroupProps = DropdownMenuGroupProps$1;
|
|
28
|
+
declare function DropdownMenuGroup({ ...props }: DropdownMenuGroupProps): React.JSX.Element;
|
|
29
|
+
type DropdownMenuItemProps = DropdownMenuItemProps$1 & {
|
|
30
|
+
inset?: boolean;
|
|
31
|
+
variant?: 'default' | 'destructive';
|
|
32
|
+
};
|
|
33
|
+
declare function DropdownMenuItem({ className, inset, variant, disabled, ...props }: DropdownMenuItemProps): React.JSX.Element;
|
|
34
|
+
type DropdownMenuCheckboxItemProps = DropdownMenuCheckboxItemProps$1;
|
|
35
|
+
declare function DropdownMenuCheckboxItem({ className, children, checked, disabled, ...props }: DropdownMenuCheckboxItemProps): React.JSX.Element;
|
|
36
|
+
type DropdownMenuRadioGroupProps = DropdownMenuRadioGroupProps$1;
|
|
37
|
+
declare function DropdownMenuRadioGroup(props: DropdownMenuRadioGroupProps): React.JSX.Element;
|
|
38
|
+
type DropdownMenuRadioItemProps = DropdownMenuRadioItemProps$1;
|
|
39
|
+
declare function DropdownMenuRadioItem({ className, children, disabled, ...props }: DropdownMenuRadioItemProps): React.JSX.Element;
|
|
40
|
+
type DropdownMenuLabelProps = DropdownMenuLabelProps$1 & {
|
|
41
|
+
inset?: boolean;
|
|
42
|
+
};
|
|
43
|
+
declare function DropdownMenuLabel({ className, inset, ...props }: DropdownMenuLabelProps): React.JSX.Element;
|
|
44
|
+
type DropdownMenuSeparatorProps = DropdownMenuSeparatorProps$1;
|
|
45
|
+
declare function DropdownMenuSeparator({ className, ...props }: DropdownMenuSeparatorProps): React.JSX.Element;
|
|
46
|
+
type DropdownMenuShortcutProps = DropdownMenuShortcutProps$1;
|
|
47
|
+
declare function DropdownMenuShortcut({ className, ...props }: DropdownMenuShortcutProps): React.JSX.Element;
|
|
48
|
+
type DropdownMenuSubProps = DropdownMenuSubProps$1;
|
|
49
|
+
declare function DropdownMenuSub(props: DropdownMenuSubProps): React.JSX.Element;
|
|
50
|
+
type DropdownMenuSubTriggerProps = DropdownMenuSubTriggerProps$1 & {
|
|
51
|
+
inset?: boolean;
|
|
52
|
+
};
|
|
53
|
+
declare function DropdownMenuSubTrigger({ disabled, className, inset, children, ...props }: DropdownMenuSubTriggerProps): React.JSX.Element;
|
|
54
|
+
type DropdownMenuSubContentProps = DropdownMenuSubContentProps$1 & Pick<StyleAxisProps, 'radius' | 'elevation'>;
|
|
55
|
+
declare function DropdownMenuSubContent({ className, radius, elevation, style, ...props }: DropdownMenuSubContentProps): React.JSX.Element;
|
|
56
|
+
|
|
57
|
+
export { DropdownMenu, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, type DropdownMenuGroupProps, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, type DropdownMenuProps, DropdownMenuRadioGroup, type DropdownMenuRadioGroupProps, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuShortcut, type DropdownMenuShortcutProps, DropdownMenuSub, DropdownMenuSubContent, type DropdownMenuSubContentProps, type DropdownMenuSubProps, DropdownMenuSubTrigger, type DropdownMenuSubTriggerProps, DropdownMenuTrigger, type DropdownMenuTriggerProps };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from "../../core/animate-ui/components/radix/dropdown-menu.js";
|
|
2
|
+
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger };
|
|
@@ -2,10 +2,10 @@ import { cn } from "../../utils/cn.js";
|
|
|
2
2
|
import { Avatar, AvatarFallback } from "../../core/avatar.js";
|
|
3
3
|
import { BasicDetailsCard } from "../cards/basic-details-card.js";
|
|
4
4
|
import { Badge } from "../../core/badge.js";
|
|
5
|
-
import { Link } from "../link/link.js";
|
|
6
|
-
import { CopiableText } from "../copiable-text/copiable-text.js";
|
|
7
|
-
import { Tag as Tag$1 } from "../tag/tag.js";
|
|
8
5
|
import { Alert } from "../alert/alert.js";
|
|
6
|
+
import { Tag as Tag$1 } from "../tag/tag.js";
|
|
7
|
+
import { Link as Link$1 } from "../link/link.js";
|
|
8
|
+
import { CopiableText } from "../copiable-text/copiable-text.js";
|
|
9
9
|
import { Code } from "../../core/animate-ui/components/animate/code.js";
|
|
10
10
|
import { MonospaceContent } from "../monospace-content/monospace-content.js";
|
|
11
11
|
import { SimpleList } from "../simple-list/simple-list.js";
|
|
@@ -293,7 +293,7 @@ function wrapTypedValue(value, rowMeta, key, opts, effectiveType) {
|
|
|
293
293
|
{
|
|
294
294
|
const href = value.trim();
|
|
295
295
|
if (href.length === 0 || !isLikelyUrlString(href)) return base;
|
|
296
|
-
return /* @__PURE__ */ jsx(Link, {
|
|
296
|
+
return /* @__PURE__ */ jsx(Link$1, {
|
|
297
297
|
to: href,
|
|
298
298
|
color: "info",
|
|
299
299
|
className: "min-w-0 break-all font-normal",
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { LucideIcon } from 'lucide-react';
|
|
4
|
+
|
|
5
|
+
type DynamicListMetaType = "badge" | "info" | "error" | "mono" | "timestamp" | "url";
|
|
6
|
+
type DynamicListSize = "sm" | "default" | "lg";
|
|
7
|
+
interface DynamicListEntry {
|
|
8
|
+
key: string;
|
|
9
|
+
value: unknown;
|
|
10
|
+
}
|
|
11
|
+
interface DynamicListMetaEntry {
|
|
12
|
+
/** When set, used as the row label instead of `startCase(key)`. */
|
|
13
|
+
label?: string;
|
|
14
|
+
/** When set, replaces the default row leading icon (Bolt). Ignored when `hideIcon` is true. */
|
|
15
|
+
icon?: LucideIcon | ReactNode;
|
|
16
|
+
/** When set, output replaces default `formatValue(value)` for that row. */
|
|
17
|
+
valueFormatter?: (value: unknown) => string;
|
|
18
|
+
/**
|
|
19
|
+
* When set, used as the row value instead of `valueFormatter` / default formatting.
|
|
20
|
+
* Use for rich content (e.g. date components).
|
|
21
|
+
*/
|
|
22
|
+
valueRender?: (value: unknown) => ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* Visual treatment for the value. `info`, `error`, `mono`, and `url` always use column layout for that row
|
|
25
|
+
* (overrides list `direction`). Default rendering of objects/arrays as `Code`, and string[] values whose
|
|
26
|
+
* key contains `"tags"`, also use column layout. `badge` and `timestamp` honour list `direction`.
|
|
27
|
+
* `timestamp` auto-formats numeric values as unix/ms/us/ns timestamps when no formatter/renderer is supplied.
|
|
28
|
+
* `url` renders string values with `Link` when neither `valueFormatter` nor `valueRender` is set.
|
|
29
|
+
*/
|
|
30
|
+
type?: DynamicListMetaType;
|
|
31
|
+
}
|
|
32
|
+
interface DynamicListProps {
|
|
33
|
+
items: DynamicListEntry[];
|
|
34
|
+
/** Optional per-item overrides keyed by `DynamicListEntry.key`. */
|
|
35
|
+
meta?: Record<string, DynamicListMetaEntry>;
|
|
36
|
+
className?: string;
|
|
37
|
+
/** Overall list spacing and typography scale. Default: `"default"`. */
|
|
38
|
+
size?: DynamicListSize;
|
|
39
|
+
/** Extra classes for each row label. */
|
|
40
|
+
labelClassName?: string;
|
|
41
|
+
/** Extra classes for each row value. */
|
|
42
|
+
valueClassName?: string;
|
|
43
|
+
/**
|
|
44
|
+
* When true, rows are rendered with `SimpleList` (inline icons by default). Default false.
|
|
45
|
+
*/
|
|
46
|
+
simple?: boolean;
|
|
47
|
+
/** When true, no leading icon is shown. Default false. */
|
|
48
|
+
hideIcon?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Stack key/value vertically (column) or show icon, key, and value on one line (row). Default "column".
|
|
51
|
+
* Row layout applies from the `sm` breakpoint (640px) up; below it, rows stack like column rows.
|
|
52
|
+
*/
|
|
53
|
+
direction?: "row" | "column";
|
|
54
|
+
/**
|
|
55
|
+
* Share of the key+value row reserved for the key label (1–100). Only applies when `direction` is `"row"`
|
|
56
|
+
* (from the `sm` breakpoint up).
|
|
57
|
+
* Default 30 (value uses the remaining width).
|
|
58
|
+
*/
|
|
59
|
+
keyWidth?: number;
|
|
60
|
+
/**
|
|
61
|
+
* When true, boolean values render as check (success) and cross (error) icons instead of text.
|
|
62
|
+
* Ignored for rows that define `meta.valueFormatter` or `meta.valueRender`. Default false.
|
|
63
|
+
*/
|
|
64
|
+
useIconsForBoolean?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* When true, row labels use the raw `key` string instead of lodash `startCase(key)`.
|
|
67
|
+
* `meta.label` still overrides when set. Default false.
|
|
68
|
+
*/
|
|
69
|
+
verbatimKeyLabels?: boolean;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
declare function DynamicList({ items, meta, className, size, labelClassName, valueClassName, simple, hideIcon, direction, keyWidth, useIconsForBoolean, verbatimKeyLabels, }: DynamicListProps): React.JSX.Element;
|
|
73
|
+
|
|
74
|
+
export { DynamicList, type DynamicListEntry, type DynamicListMetaEntry, type DynamicListMetaType, type DynamicListProps };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
interface FullSizeErrorProps {
|
|
5
|
+
title?: ReactNode;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
illustration?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
declare function FullSizeError({ title, children, illustration }: FullSizeErrorProps): React.JSX.Element;
|
|
10
|
+
|
|
11
|
+
interface InlineErrorProps {
|
|
12
|
+
title?: ReactNode;
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
declare function InlineError({ title, children }: InlineErrorProps): React.JSX.Element;
|
|
16
|
+
|
|
17
|
+
export { FullSizeError, type FullSizeErrorProps, InlineError, type InlineErrorProps };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { cn } from "../../utils/cn.js";
|
|
2
|
+
import { useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { X } from "lucide-react";
|
|
5
|
+
//#region src/components/expandable-text/expandable-text-overlay.tsx
|
|
6
|
+
/** How long the closing circle runs before the overlay unmounts (its transition is 0.32s). */
|
|
7
|
+
var CLOSE_MS = 320;
|
|
8
|
+
/**
|
|
9
|
+
* The full text over the nearest positioned ancestor. Opens as a circle from
|
|
10
|
+
* the link in 0.5s and closes back into it in 0.32s; under reduced motion it
|
|
11
|
+
* simply appears and goes. Escape closes it.
|
|
12
|
+
*/
|
|
13
|
+
function ExpandableTextOverlay({ text, header, footer, closeLabel, origin, open, onClose, onClosed }) {
|
|
14
|
+
const panel = useRef(null);
|
|
15
|
+
const closeButton = useRef(null);
|
|
16
|
+
const [at, setAt] = useState("50% 50%");
|
|
17
|
+
const [grown, setGrown] = useState(false);
|
|
18
|
+
useLayoutEffect(() => {
|
|
19
|
+
const from = origin.current?.getBoundingClientRect();
|
|
20
|
+
const box = panel.current?.getBoundingClientRect();
|
|
21
|
+
if (from && box) setAt(`${from.left + from.width / 2 - box.left}px ${from.top + from.height / 2 - box.top}px`);
|
|
22
|
+
}, [origin]);
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
if (!open) {
|
|
25
|
+
setGrown(false);
|
|
26
|
+
const timer = setTimeout(onClosed, CLOSE_MS);
|
|
27
|
+
return () => clearTimeout(timer);
|
|
28
|
+
}
|
|
29
|
+
const frame = requestAnimationFrame(() => setGrown(true));
|
|
30
|
+
closeButton.current?.focus();
|
|
31
|
+
return () => cancelAnimationFrame(frame);
|
|
32
|
+
}, [open, onClosed]);
|
|
33
|
+
function handleKeyDown(event) {
|
|
34
|
+
if (event.key === "Escape") {
|
|
35
|
+
event.stopPropagation();
|
|
36
|
+
onClose();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
const style = { clipPath: `circle(${grown ? "150%" : "0%"} at ${at})` };
|
|
40
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
41
|
+
ref: panel,
|
|
42
|
+
"data-slot": "expandable-text-overlay",
|
|
43
|
+
"data-state": open ? "open" : "closed",
|
|
44
|
+
onKeyDown: handleKeyDown,
|
|
45
|
+
style,
|
|
46
|
+
className: cn("absolute inset-0 z-30 flex flex-col gap-3 bg-popover p-4 text-popover-foreground transition-clip motion-reduce:transition-none", grown ? "duration-500 ease-emphasized" : "duration-300 ease-in"),
|
|
47
|
+
children: [
|
|
48
|
+
/* @__PURE__ */ jsxs("div", {
|
|
49
|
+
className: "flex items-start justify-between gap-3",
|
|
50
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
51
|
+
className: "min-w-0 flex-1",
|
|
52
|
+
children: header
|
|
53
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
54
|
+
ref: closeButton,
|
|
55
|
+
type: "button",
|
|
56
|
+
"aria-label": closeLabel,
|
|
57
|
+
onClick: onClose,
|
|
58
|
+
className: "inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground outline-none hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",
|
|
59
|
+
children: /* @__PURE__ */ jsx(X, {
|
|
60
|
+
"aria-hidden": true,
|
|
61
|
+
className: "size-4"
|
|
62
|
+
})
|
|
63
|
+
})]
|
|
64
|
+
}),
|
|
65
|
+
/* @__PURE__ */ jsx("p", {
|
|
66
|
+
tabIndex: 0,
|
|
67
|
+
className: "m-0 min-h-0 flex-1 overflow-y-auto overscroll-contain text-sm whitespace-pre-line text-foreground-secondary outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
68
|
+
children: text
|
|
69
|
+
}),
|
|
70
|
+
footer && /* @__PURE__ */ jsx("div", {
|
|
71
|
+
className: "shrink-0",
|
|
72
|
+
children: footer
|
|
73
|
+
})
|
|
74
|
+
]
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
//#endregion
|
|
78
|
+
export { ExpandableTextOverlay };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { cn } from "../../utils/cn.js";
|
|
2
|
+
import { ExpandableTextOverlay } from "./expandable-text-overlay.js";
|
|
3
|
+
import { useClamped } from "./use-clamped.js";
|
|
4
|
+
import { useCallback, useRef, useState } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/expandable-text/expandable-text.tsx
|
|
7
|
+
var CLAMP = {
|
|
8
|
+
1: "line-clamp-1",
|
|
9
|
+
2: "line-clamp-2",
|
|
10
|
+
3: "line-clamp-3",
|
|
11
|
+
4: "line-clamp-4",
|
|
12
|
+
5: "line-clamp-5",
|
|
13
|
+
6: "line-clamp-6"
|
|
14
|
+
};
|
|
15
|
+
var LINK = "cursor-pointer self-start rounded-sm p-0 font-semibold text-primary underline-offset-2 outline-none hover:underline focus-visible:ring-2 focus-visible:ring-ring";
|
|
16
|
+
/**
|
|
17
|
+
* Text clamped to a few lines with a "Show more" link — shown only when the
|
|
18
|
+
* text really is cut off. `inline` grows in place; `overlay` opens the full
|
|
19
|
+
* text over its card, so the card never changes height.
|
|
20
|
+
*/
|
|
21
|
+
function ExpandableText({ children, lines = 2, mode = "inline", labels, header, footer, className }) {
|
|
22
|
+
const text = useRef(null);
|
|
23
|
+
const more = useRef(null);
|
|
24
|
+
const [expanded, setExpanded] = useState(false);
|
|
25
|
+
const [overlay, setOverlay] = useState("closed");
|
|
26
|
+
const inlineOpen = mode === "inline" && expanded;
|
|
27
|
+
const clamped = useClamped(text, !inlineOpen);
|
|
28
|
+
const close = useCallback(() => setOverlay((state) => state === "open" ? "closing" : state), []);
|
|
29
|
+
const closed = useCallback(() => {
|
|
30
|
+
setOverlay("closed");
|
|
31
|
+
more.current?.focus();
|
|
32
|
+
}, []);
|
|
33
|
+
function handleMore() {
|
|
34
|
+
if (mode === "overlay") {
|
|
35
|
+
setOverlay("open");
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
setExpanded((value) => !value);
|
|
39
|
+
}
|
|
40
|
+
const showLink = clamped || inlineOpen;
|
|
41
|
+
const open = mode === "overlay" ? overlay !== "closed" : inlineOpen;
|
|
42
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
43
|
+
"data-slot": "expandable-text",
|
|
44
|
+
className: cn("flex min-w-0 flex-col gap-1", className),
|
|
45
|
+
children: [
|
|
46
|
+
/* @__PURE__ */ jsx("p", {
|
|
47
|
+
ref: text,
|
|
48
|
+
className: cn("m-0 whitespace-pre-line", !inlineOpen && CLAMP[lines]),
|
|
49
|
+
children
|
|
50
|
+
}),
|
|
51
|
+
showLink && /* @__PURE__ */ jsx("button", {
|
|
52
|
+
ref: more,
|
|
53
|
+
type: "button",
|
|
54
|
+
"aria-expanded": open,
|
|
55
|
+
onClick: handleMore,
|
|
56
|
+
className: LINK,
|
|
57
|
+
children: inlineOpen ? labels.less : labels.more
|
|
58
|
+
}),
|
|
59
|
+
mode === "overlay" && overlay !== "closed" && /* @__PURE__ */ jsx(ExpandableTextOverlay, {
|
|
60
|
+
text: children,
|
|
61
|
+
header,
|
|
62
|
+
footer,
|
|
63
|
+
closeLabel: labels.close,
|
|
64
|
+
origin: more,
|
|
65
|
+
open: overlay === "open",
|
|
66
|
+
onClose: close,
|
|
67
|
+
onClosed: closed
|
|
68
|
+
})
|
|
69
|
+
]
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
//#endregion
|
|
73
|
+
export { ExpandableText };
|