@espressif/dashboard-ui-components 1.11.2 → 1.13.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 +196 -5
- package/.cursor/rules/dashboard-ui-consumption.mdc +183 -4
- package/CHANGELOG.md +1048 -0
- package/README.md +246 -8
- 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 +160 -27
- 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 +77 -0
- package/dist/components/floating-window/_hooks/use-resize.js +133 -0
- package/dist/components/floating-window/floating-window.js +124 -0
- package/dist/components/floating-window/index.d.ts +64 -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 +181 -19529
- package/dist/components/index.js +71 -15
- 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/keyframes/index.d.ts +53 -0
- package/dist/components/keyframes/index.js +3 -0
- package/dist/components/keyframes/keyframes-motion.js +23 -0
- package/dist/components/keyframes/keyframes.js +37 -0
- 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/qr-code/index.d.ts +26 -0
- package/dist/components/qr-code/index.js +2 -0
- package/dist/components/qr-code/qr-code.js +69 -0
- package/dist/components/radio-group/index.d.ts +24 -0
- package/dist/components/radio-group/index.js +2 -0
- package/dist/components/range-field/index.d.ts +45 -0
- package/dist/components/range-field/index.js +2 -0
- package/dist/components/range-field/range-field.js +164 -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 +26 -0
- package/dist/components/reveal/index.js +2 -0
- package/dist/components/reveal/reveal.js +27 -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 +34 -0
- package/dist/components/search-box/index.js +2 -0
- package/dist/components/search-box/search-box.js +24 -14
- 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 +64 -0
- package/dist/components/showcase-card/index.js +2 -0
- package/dist/components/showcase-card/showcase-card.js +116 -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 +5 -3
- 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/trace/index.d.ts +49 -0
- package/dist/components/trace/index.js +2 -0
- package/dist/components/trace/trace.js +109 -0
- 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 +40 -10
- 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 +173 -15
- package/dist/index.js +73 -15
- 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-DONJJXIy.d.ts +30 -0
- package/package.json +58 -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 +711 -0
- package/dist/app-logo.props-Ct7QBdTd.d.ts +0 -40
- package/dist/popover-ByLD3-Qv.d.ts +0 -204
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
3
|
+
import { k as StyleAxisProps } from '../../style-axes-DSQ2DGc5.js';
|
|
4
|
+
|
|
5
|
+
interface PopoverProps extends React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Root> {
|
|
6
|
+
/**
|
|
7
|
+
* Also open when a mouse rests on the trigger or focus lands on it, and stay
|
|
8
|
+
* open while the pointer is over the content. A click still toggles it, so
|
|
9
|
+
* touch screens (which have no hover) open it the usual way; a click on a
|
|
10
|
+
* popover that hover opened keeps it open instead of closing it.
|
|
11
|
+
*/
|
|
12
|
+
openOnHover?: boolean;
|
|
13
|
+
/** Milliseconds the pointer rests before a hover opens it. Defaults to 120. */
|
|
14
|
+
openDelay?: number;
|
|
15
|
+
/** Milliseconds after the pointer leaves before it closes. Defaults to 150. */
|
|
16
|
+
closeDelay?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Inside a PopoverGroup: this popover's key, what the group's `value` and
|
|
19
|
+
* `onValueChange` name. Defaults to a generated one. Ignored outside a group.
|
|
20
|
+
*/
|
|
21
|
+
value?: string;
|
|
22
|
+
}
|
|
23
|
+
declare function Popover({ openOnHover, openDelay, closeDelay, open: openProp, defaultOpen, onOpenChange, value, ...props }: PopoverProps): React.JSX.Element;
|
|
24
|
+
declare const PopoverTrigger: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
25
|
+
declare const PopoverAnchor: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverAnchorProps & React.RefAttributes<HTMLDivElement>>;
|
|
26
|
+
declare const PopoverContent: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & Pick<StyleAxisProps, "radius" | "elevation"> & {
|
|
27
|
+
/**
|
|
28
|
+
* Render the content in a portal at the document body. Defaults to `true`.
|
|
29
|
+
* Set `false` to render inline in the DOM tree, e.g. to keep the content
|
|
30
|
+
* within a specific stacking context. Positioning is unaffected either way:
|
|
31
|
+
* Radix Popper uses a fixed strategy.
|
|
32
|
+
*/
|
|
33
|
+
portal?: boolean;
|
|
34
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
35
|
+
|
|
36
|
+
interface PopoverGroupProps {
|
|
37
|
+
/** The `value` of the open popover, or null for none. Controlled. */
|
|
38
|
+
value?: string | null;
|
|
39
|
+
/** The open popover when uncontrolled. Defaults to none. */
|
|
40
|
+
defaultValue?: string | null;
|
|
41
|
+
/** Called when a popover in the group opens (its `value`) or the open one closes (null). */
|
|
42
|
+
onValueChange?: (value: string | null) => void;
|
|
43
|
+
/**
|
|
44
|
+
* Milliseconds the pointer must rest on another trigger before its popover
|
|
45
|
+
* replaces the open one. Longer than a first open, so crossing triggers on
|
|
46
|
+
* the way to the open content does not switch it. Defaults to 350.
|
|
47
|
+
*/
|
|
48
|
+
switchDelay?: number;
|
|
49
|
+
children: React.ReactNode;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Popovers that share one place on screen: at most one is open, and with
|
|
53
|
+
* `openOnHover` a hover moves the open panel from trigger to trigger with
|
|
54
|
+
* intent — the first opens after the popover's `openDelay`, another takes over
|
|
55
|
+
* only after `switchDelay`, and reaching the open content cancels a pending
|
|
56
|
+
* switch. For a grid or a row of items that each preview on hover.
|
|
57
|
+
*/
|
|
58
|
+
declare function PopoverGroup({ value: valueProp, defaultValue, onValueChange, switchDelay, children, }: PopoverGroupProps): React.JSX.Element;
|
|
59
|
+
|
|
60
|
+
export { Popover, PopoverAnchor, PopoverContent, PopoverGroup, type PopoverGroupProps, type PopoverProps, PopoverTrigger };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { PreviewCard as PreviewCard$1 } from '@base-ui/react/preview-card';
|
|
3
|
+
import { SpringOptions, HTMLMotionProps } from 'motion/react';
|
|
4
|
+
import { k as StyleAxisProps } from '../../style-axes-DSQ2DGc5.js';
|
|
5
|
+
|
|
6
|
+
type PreviewCardProps$1 = React.ComponentProps<typeof PreviewCard$1.Root> & {
|
|
7
|
+
followCursor?: boolean | 'x' | 'y';
|
|
8
|
+
followCursorSpringOptions?: SpringOptions;
|
|
9
|
+
};
|
|
10
|
+
type PreviewCardTriggerProps$1 = React.ComponentProps<typeof PreviewCard$1.Trigger>;
|
|
11
|
+
type PreviewCardPositionerProps = React.ComponentProps<typeof PreviewCard$1.Positioner>;
|
|
12
|
+
type PreviewCardPopupProps = Omit<React.ComponentProps<typeof PreviewCard$1.Popup>, 'render'> & HTMLMotionProps<'div'>;
|
|
13
|
+
type PreviewCardBackdropProps$1 = React.ComponentProps<typeof PreviewCard$1.Backdrop>;
|
|
14
|
+
|
|
15
|
+
type PreviewCardProps = PreviewCardProps$1;
|
|
16
|
+
declare function PreviewCard(props: PreviewCardProps): React.JSX.Element;
|
|
17
|
+
type PreviewCardTriggerProps = PreviewCardTriggerProps$1;
|
|
18
|
+
declare function PreviewCardTrigger(props: PreviewCardTriggerProps): React.JSX.Element;
|
|
19
|
+
type PreviewCardPanelProps = PreviewCardPositionerProps & PreviewCardPopupProps & Pick<StyleAxisProps, 'radius' | 'elevation'>;
|
|
20
|
+
declare function PreviewCardPanel({ className, align, sideOffset, style, children, radius, elevation, ...props }: PreviewCardPanelProps): React.JSX.Element;
|
|
21
|
+
type PreviewCardBackdropProps = PreviewCardBackdropProps$1;
|
|
22
|
+
declare function PreviewCardBackdrop(props: PreviewCardBackdropProps): React.JSX.Element;
|
|
23
|
+
|
|
24
|
+
export { PreviewCard, PreviewCardBackdrop, type PreviewCardBackdropProps, PreviewCardPanel, type PreviewCardPanelProps, type PreviewCardProps, PreviewCardTrigger, type PreviewCardTriggerProps };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Progress } from '@base-ui/react/progress';
|
|
3
|
+
import { C as Color } from '../../index-BQANnKs9.js';
|
|
4
|
+
|
|
5
|
+
type ProgressProps$1 = React.ComponentProps<typeof Progress.Root>;
|
|
6
|
+
|
|
7
|
+
type ProgressProps = ProgressProps$1;
|
|
8
|
+
|
|
9
|
+
type ProgressBarSegment = {
|
|
10
|
+
value: number;
|
|
11
|
+
color: Color;
|
|
12
|
+
label?: string;
|
|
13
|
+
/** Shown on hover over this segment ("5 published with source"). */
|
|
14
|
+
tooltip?: React.ReactNode;
|
|
15
|
+
};
|
|
16
|
+
type ProgressBarProps = Omit<ProgressProps, 'value'> & {
|
|
17
|
+
value?: number;
|
|
18
|
+
showFakeProgress?: boolean;
|
|
19
|
+
label?: string;
|
|
20
|
+
showPercentage?: boolean;
|
|
21
|
+
color?: Color;
|
|
22
|
+
segments?: ProgressBarSegment[];
|
|
23
|
+
/**
|
|
24
|
+
* Segments only: draw each segment as its own rounded piece with a small gap
|
|
25
|
+
* between them, on no track, instead of one bar cut into colours. Reads as
|
|
26
|
+
* "parts of a whole" when neighbouring colours are close.
|
|
27
|
+
*/
|
|
28
|
+
gapped?: boolean;
|
|
29
|
+
};
|
|
30
|
+
declare function ProgressBar({ showFakeProgress, value: valueProp, label, showPercentage, color, segments, gapped, className, ...props }: ProgressBarProps): React.JSX.Element;
|
|
31
|
+
|
|
32
|
+
export { ProgressBar, type ProgressBarProps, type ProgressBarSegment };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../../utils/cn.js";
|
|
3
3
|
import { isPresetColor, resolveColor } from "../../utils/color.js";
|
|
4
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../../core/animate-ui/components/animate/tooltip.js";
|
|
4
5
|
import { Progress, ProgressLabel, ProgressTrack, ProgressValue } from "../../core/animate-ui/components/base/progress.js";
|
|
5
6
|
import * as React$1 from "react";
|
|
6
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -31,7 +32,7 @@ var presetIndicatorBgMap = {
|
|
|
31
32
|
gray: "bg-gray",
|
|
32
33
|
mist: "bg-mist"
|
|
33
34
|
};
|
|
34
|
-
function ProgressBar({ showFakeProgress = false, value: valueProp, label, showPercentage = false, color = "primary", segments, className, ...props }) {
|
|
35
|
+
function ProgressBar({ showFakeProgress = false, value: valueProp, label, showPercentage = false, color = "primary", segments, gapped = false, className, ...props }) {
|
|
35
36
|
const [fakeValue, setFakeValue] = React$1.useState(FAKE_PROGRESS_MIN);
|
|
36
37
|
const intervalRef = React$1.useRef(null);
|
|
37
38
|
React$1.useEffect(() => {
|
|
@@ -56,7 +57,8 @@ function ProgressBar({ showFakeProgress = false, value: valueProp, label, showPe
|
|
|
56
57
|
const showHeader = label != null || showPercentage;
|
|
57
58
|
if (segments && segments.length > 0) {
|
|
58
59
|
const total = segments.reduce((sum, s) => sum + Math.max(0, s.value), 0);
|
|
59
|
-
|
|
60
|
+
const withTooltips = segments.some((s) => s.tooltip != null);
|
|
61
|
+
const segmented = /* @__PURE__ */ jsxs("div", {
|
|
60
62
|
className: cn("space-y-2", className),
|
|
61
63
|
children: [showHeader && /* @__PURE__ */ jsx("div", {
|
|
62
64
|
className: "flex items-center justify-between gap-1",
|
|
@@ -65,27 +67,41 @@ function ProgressBar({ showFakeProgress = false, value: valueProp, label, showPe
|
|
|
65
67
|
children: label
|
|
66
68
|
})
|
|
67
69
|
}), /* @__PURE__ */ jsx("div", {
|
|
68
|
-
className: "
|
|
70
|
+
className: cn("relative flex h-2 w-full", gapped ? "gap-0.5" : "bg-mist-border overflow-hidden rounded-full"),
|
|
69
71
|
children: total === 0 ? null : segments.map((seg, idx) => {
|
|
70
72
|
const widthPct = Math.max(0, seg.value) / total * 100;
|
|
71
73
|
if (widthPct === 0) return null;
|
|
72
74
|
const isPreset = isPresetColor(seg.color);
|
|
73
|
-
|
|
74
|
-
className: cn("h-full", isPreset ? presetIndicatorBgMap[seg.color] : void 0),
|
|
75
|
+
const bar = /* @__PURE__ */ jsx("div", {
|
|
76
|
+
className: cn("h-full", gapped && "rounded-full", isPreset ? presetIndicatorBgMap[seg.color] : void 0),
|
|
75
77
|
style: {
|
|
76
78
|
width: `${widthPct}%`,
|
|
77
79
|
...isPreset ? {} : resolveColor(seg.color, "bg").style
|
|
78
80
|
},
|
|
79
81
|
"aria-label": seg.label
|
|
80
82
|
}, idx);
|
|
83
|
+
if (seg.tooltip == null) return bar;
|
|
84
|
+
return /* @__PURE__ */ jsxs(Tooltip, {
|
|
85
|
+
side: "top",
|
|
86
|
+
sideOffset: 6,
|
|
87
|
+
children: [/* @__PURE__ */ jsx(TooltipTrigger, {
|
|
88
|
+
asChild: true,
|
|
89
|
+
children: bar
|
|
90
|
+
}), /* @__PURE__ */ jsx(TooltipContent, { children: seg.tooltip })]
|
|
91
|
+
}, idx);
|
|
81
92
|
})
|
|
82
93
|
})]
|
|
83
94
|
});
|
|
95
|
+
return withTooltips ? /* @__PURE__ */ jsx(TooltipProvider, {
|
|
96
|
+
openDelay: 0,
|
|
97
|
+
closeDelay: 0,
|
|
98
|
+
children: segmented
|
|
99
|
+
}) : segmented;
|
|
84
100
|
}
|
|
85
101
|
return /* @__PURE__ */ jsxs(Progress, {
|
|
86
102
|
value: (showFakeProgress ? fakeValue : valueProp) ?? 0,
|
|
87
103
|
max: 100,
|
|
88
|
-
className: cn("space-y-2", className),
|
|
104
|
+
className: cn("space-y-2 [&>[data-slot=progress-track]]:mb-0", className),
|
|
89
105
|
...props,
|
|
90
106
|
children: [showHeader && /* @__PURE__ */ jsxs("div", {
|
|
91
107
|
className: "flex items-center justify-between gap-1",
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface QrCodeProps {
|
|
4
|
+
/** Exactly what the code encodes. */
|
|
5
|
+
text: string;
|
|
6
|
+
/** What the picture is, read out in its place (the code itself is not words). */
|
|
7
|
+
label: string;
|
|
8
|
+
/** Shown in its place when the code cannot be made (no `qrcode` installed, text too long). */
|
|
9
|
+
fallback: string;
|
|
10
|
+
/** Sizes the code (`size-40`); it is square. */
|
|
11
|
+
className?: string;
|
|
12
|
+
/** The modules' colour. Default black: a phone reads dark on light, so keep it dark in every theme. */
|
|
13
|
+
ink?: string;
|
|
14
|
+
/** The background and quiet zone. Default white. */
|
|
15
|
+
paper?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* A QR code, drawn as SVG from the encoder's modules, dark on light in every
|
|
20
|
+
* theme so a phone can read it. The encoder (`qrcode`, an optional peer
|
|
21
|
+
* dependency) is loaded only when a code is shown. A placeholder while it
|
|
22
|
+
* loads; `fallback` in its place when the code cannot be made.
|
|
23
|
+
*/
|
|
24
|
+
declare function QrCode({ text, label, fallback, className, ink, paper }: QrCodeProps): React.JSX.Element;
|
|
25
|
+
|
|
26
|
+
export { QrCode, type QrCodeProps };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { cn } from "../../utils/cn.js";
|
|
2
|
+
import { Skeleton } from "../../core/skeleton.js";
|
|
3
|
+
import { Typography } from "../typography/typography.js";
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/qr-code/qr-code.tsx
|
|
7
|
+
/** The quiet margin around the modules, in modules: what lets a camera find the code's edge. */
|
|
8
|
+
var QUIET = 2;
|
|
9
|
+
/** One path of every dark module, each a unit square at its row and column. */
|
|
10
|
+
async function draw(text) {
|
|
11
|
+
const { create } = await import("qrcode");
|
|
12
|
+
const { modules } = create(text, { errorCorrectionLevel: "M" });
|
|
13
|
+
let path = "";
|
|
14
|
+
for (let row = 0; row < modules.size; row += 1) for (let col = 0; col < modules.size; col += 1) if (modules.get(row, col)) path += `M${col + QUIET} ${row + QUIET}h1v1h-1z`;
|
|
15
|
+
return {
|
|
16
|
+
text,
|
|
17
|
+
size: modules.size,
|
|
18
|
+
path
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* A QR code, drawn as SVG from the encoder's modules, dark on light in every
|
|
23
|
+
* theme so a phone can read it. The encoder (`qrcode`, an optional peer
|
|
24
|
+
* dependency) is loaded only when a code is shown. A placeholder while it
|
|
25
|
+
* loads; `fallback` in its place when the code cannot be made.
|
|
26
|
+
*/
|
|
27
|
+
function QrCode({ text, label, fallback, className, ink = "#000000", paper = "#ffffff" }) {
|
|
28
|
+
const [drawn, setDrawn] = useState(null);
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
let alive = true;
|
|
31
|
+
draw(text).then((next) => alive && setDrawn(next)).catch(() => alive && setDrawn({
|
|
32
|
+
text,
|
|
33
|
+
size: 0,
|
|
34
|
+
path: ""
|
|
35
|
+
}));
|
|
36
|
+
return () => {
|
|
37
|
+
alive = false;
|
|
38
|
+
};
|
|
39
|
+
}, [text]);
|
|
40
|
+
if (drawn?.text !== text) return /* @__PURE__ */ jsx(Skeleton, {
|
|
41
|
+
role: "img",
|
|
42
|
+
"aria-label": label,
|
|
43
|
+
className: cn("aspect-square rounded-md", className)
|
|
44
|
+
});
|
|
45
|
+
if (drawn.size === 0) return /* @__PURE__ */ jsx(Typography, {
|
|
46
|
+
variant: "body2",
|
|
47
|
+
className: "m-0 text-sm text-muted-foreground",
|
|
48
|
+
children: fallback
|
|
49
|
+
});
|
|
50
|
+
const side = drawn.size + QUIET * 2;
|
|
51
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
52
|
+
"data-slot": "qr-code",
|
|
53
|
+
role: "img",
|
|
54
|
+
"aria-label": label,
|
|
55
|
+
viewBox: `0 0 ${side} ${side}`,
|
|
56
|
+
shapeRendering: "crispEdges",
|
|
57
|
+
className: cn("aspect-square", className),
|
|
58
|
+
children: [/* @__PURE__ */ jsx("rect", {
|
|
59
|
+
width: side,
|
|
60
|
+
height: side,
|
|
61
|
+
fill: paper
|
|
62
|
+
}), /* @__PURE__ */ jsx("path", {
|
|
63
|
+
d: drawn.path,
|
|
64
|
+
fill: ink
|
|
65
|
+
})]
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
//#endregion
|
|
69
|
+
export { QrCode };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { S as Size } from '../../index-BQANnKs9.js';
|
|
4
|
+
|
|
5
|
+
interface RadioOption {
|
|
6
|
+
value: string;
|
|
7
|
+
label: string | ReactNode;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
type RadioGroupSize = Size;
|
|
11
|
+
interface RadioGroupProps {
|
|
12
|
+
options: RadioOption[];
|
|
13
|
+
value?: string;
|
|
14
|
+
defaultValue?: string;
|
|
15
|
+
onValueChange?: (value: string) => void;
|
|
16
|
+
orientation?: 'horizontal' | 'vertical';
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
className?: string;
|
|
19
|
+
size?: RadioGroupSize;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
declare function RadioGroup({ options, value, defaultValue, onValueChange, orientation, disabled, className, size, }: RadioGroupProps): React.JSX.Element;
|
|
23
|
+
|
|
24
|
+
export { RadioGroup, type RadioGroupProps, type RadioGroupSize, type RadioOption };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface RangeFieldLabels {
|
|
4
|
+
/** The − button's name ("Temperature down by 2"). */
|
|
5
|
+
down: string;
|
|
6
|
+
/** The + button's name. */
|
|
7
|
+
up: string;
|
|
8
|
+
/** The slider's name. */
|
|
9
|
+
slider: string;
|
|
10
|
+
}
|
|
11
|
+
interface RangeFieldProps {
|
|
12
|
+
label: string;
|
|
13
|
+
value: number;
|
|
14
|
+
onChange: (value: number) => void;
|
|
15
|
+
min: number;
|
|
16
|
+
max: number;
|
|
17
|
+
/** The display precision, and the slider's step. */
|
|
18
|
+
step: number;
|
|
19
|
+
unit?: string;
|
|
20
|
+
/** How far − and + move it. Default ten steps, at most the whole range. */
|
|
21
|
+
by?: number;
|
|
22
|
+
/** A compass: − and + go round, the last position to the first. */
|
|
23
|
+
wrap?: boolean;
|
|
24
|
+
/** The range in words ("−40 to 80 °C"), beside the label. */
|
|
25
|
+
rangeText?: string;
|
|
26
|
+
labels: RangeFieldLabels;
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* One number in a range, on three short rows that need no width: its name,
|
|
32
|
+
* with the range after it in brackets (reference, in a quiet hand — one
|
|
33
|
+
* phrase, so a narrow panel wraps it rather than squeezing two ends of a
|
|
34
|
+
* row); the slider alone on its own row, as wide as the panel, drawn in the
|
|
35
|
+
* scope's own corners; then the exact value as ONE control — a box to type
|
|
36
|
+
* it (kept as typed until Enter or leaving it, then clamped) between − and +
|
|
37
|
+
* for a step either way — and its unit, at the left, under the name and the
|
|
38
|
+
* slider's start, where the eye already is. The slider is the quick way, the
|
|
39
|
+
* box the precise one; − and + stay because a compass goes round (the last
|
|
40
|
+
* position to the first), which neither of the others can do. Nothing here
|
|
41
|
+
* shares a row with the slider, so a narrow panel squeezes nothing.
|
|
42
|
+
*/
|
|
43
|
+
declare function RangeField({ label, value, onChange, min, max, step: by, unit, by: nudgeBy, wrap, rangeText, labels, disabled }: RangeFieldProps): React.JSX.Element;
|
|
44
|
+
|
|
45
|
+
export { RangeField, type RangeFieldLabels, type RangeFieldProps };
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { cn } from "../../utils/cn.js";
|
|
2
|
+
import { Button } from "../button/button.js";
|
|
3
|
+
import { Input } from "../../core/input/input.js";
|
|
4
|
+
import { Label } from "../../core/label.js";
|
|
5
|
+
import { useLayoutEffect, useRef, useState } from "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { Minus, Plus } from "lucide-react";
|
|
8
|
+
//#region src/components/range-field/range-field.tsx
|
|
9
|
+
/** Decimal places a step shows: 0.1 -> 1, 0.25 -> 2, 5 -> 0. */
|
|
10
|
+
function placesOf(step) {
|
|
11
|
+
const s = String(step);
|
|
12
|
+
return s.includes(".") ? (s.split(".")[1] ?? "").length : 0;
|
|
13
|
+
}
|
|
14
|
+
/** `n` brought back into the range by going round it, as a compass does: one step past the last is the first. */
|
|
15
|
+
function wrapped(n, range) {
|
|
16
|
+
const span = range.max - range.min + range.step;
|
|
17
|
+
return range.min + ((n - range.min) % span + span) % span;
|
|
18
|
+
}
|
|
19
|
+
var step = {
|
|
20
|
+
type: "button",
|
|
21
|
+
size: "icon",
|
|
22
|
+
fullWidth: false,
|
|
23
|
+
variant: "ghost",
|
|
24
|
+
color: "gray",
|
|
25
|
+
hideRingOnHover: true
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* The slider drawn by us, not the browser: a hairline track, the part of it
|
|
29
|
+
* below the value filled, and a thumb — all in the scope's control radius
|
|
30
|
+
* (`--espd-radius-control`, the token every library control rounds by; the
|
|
31
|
+
* library's own classes read the same variable), so it is square where the
|
|
32
|
+
* scope's controls are square and round where they are round. The native slider's own
|
|
33
|
+
* drawing is turned off (`appearance-none`) and its thumb restyled through
|
|
34
|
+
* the two vendors' pseudo-elements; the input stays a real range input, so
|
|
35
|
+
* the keyboard, the wheel and assistive tech see nothing different.
|
|
36
|
+
*/
|
|
37
|
+
var SLIDER = cn("relative z-10 h-5 w-full cursor-pointer appearance-none bg-transparent outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-default disabled:opacity-50", "[&::-webkit-slider-runnable-track]:h-5 [&::-webkit-slider-runnable-track]:bg-transparent", "[&::-webkit-slider-thumb]:mt-0.5 [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-(--espd-radius-control) [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-background [&::-webkit-slider-thumb]:bg-primary [&::-webkit-slider-thumb]:shadow-sm", "[&::-moz-range-thumb]:h-4 [&::-moz-range-thumb]:w-4 [&::-moz-range-thumb]:appearance-none [&::-moz-range-thumb]:rounded-(--espd-radius-control) [&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-background [&::-moz-range-thumb]:bg-primary [&::-moz-range-thumb]:shadow-sm");
|
|
38
|
+
/** The filled part of the track, as a share of it: it moves with every drag frame, so it is written to the element, never a class. */
|
|
39
|
+
function useFill(share) {
|
|
40
|
+
const ref = useRef(null);
|
|
41
|
+
useLayoutEffect(() => {
|
|
42
|
+
if (ref.current) ref.current.style.width = `${share}%`;
|
|
43
|
+
}, [share]);
|
|
44
|
+
return ref;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* One number in a range, on three short rows that need no width: its name,
|
|
48
|
+
* with the range after it in brackets (reference, in a quiet hand — one
|
|
49
|
+
* phrase, so a narrow panel wraps it rather than squeezing two ends of a
|
|
50
|
+
* row); the slider alone on its own row, as wide as the panel, drawn in the
|
|
51
|
+
* scope's own corners; then the exact value as ONE control — a box to type
|
|
52
|
+
* it (kept as typed until Enter or leaving it, then clamped) between − and +
|
|
53
|
+
* for a step either way — and its unit, at the left, under the name and the
|
|
54
|
+
* slider's start, where the eye already is. The slider is the quick way, the
|
|
55
|
+
* box the precise one; − and + stay because a compass goes round (the last
|
|
56
|
+
* position to the first), which neither of the others can do. Nothing here
|
|
57
|
+
* shares a row with the slider, so a narrow panel squeezes nothing.
|
|
58
|
+
*/
|
|
59
|
+
function RangeField({ label, value, onChange, min, max, step: by, unit, by: nudgeBy, wrap = false, rangeText, labels, disabled = false }) {
|
|
60
|
+
const [draft, setDraft] = useState(null);
|
|
61
|
+
const nudge = nudgeBy ?? Math.min(by * 10, max - min);
|
|
62
|
+
const fill = useFill(max > min ? Math.min(100, Math.max(0, (value - min) / (max - min) * 100)) : 0);
|
|
63
|
+
function set(n) {
|
|
64
|
+
setDraft(null);
|
|
65
|
+
onChange(wrap ? wrapped(n, {
|
|
66
|
+
min,
|
|
67
|
+
max,
|
|
68
|
+
step: by
|
|
69
|
+
}) : Math.min(max, Math.max(min, n)));
|
|
70
|
+
}
|
|
71
|
+
function commit() {
|
|
72
|
+
const n = Number(draft);
|
|
73
|
+
if (draft === null || draft.trim() === "" || !Number.isFinite(n)) {
|
|
74
|
+
setDraft(null);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
set(n);
|
|
78
|
+
}
|
|
79
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
80
|
+
className: "flex flex-col gap-1",
|
|
81
|
+
children: [
|
|
82
|
+
/* @__PURE__ */ jsxs(Label, {
|
|
83
|
+
className: "text-xs",
|
|
84
|
+
children: [label, rangeText && /* @__PURE__ */ jsxs("span", {
|
|
85
|
+
className: "ml-1.5 font-mono text-xs font-normal text-foreground-muted tabular-nums",
|
|
86
|
+
children: [
|
|
87
|
+
"(",
|
|
88
|
+
rangeText,
|
|
89
|
+
")"
|
|
90
|
+
]
|
|
91
|
+
})]
|
|
92
|
+
}),
|
|
93
|
+
/* @__PURE__ */ jsxs("span", {
|
|
94
|
+
className: "relative flex h-5 w-full items-center",
|
|
95
|
+
children: [
|
|
96
|
+
/* @__PURE__ */ jsx("span", {
|
|
97
|
+
"aria-hidden": true,
|
|
98
|
+
className: "absolute inset-x-0 h-1 rounded-(--espd-radius-control) bg-border"
|
|
99
|
+
}),
|
|
100
|
+
/* @__PURE__ */ jsx("span", {
|
|
101
|
+
ref: fill,
|
|
102
|
+
"aria-hidden": true,
|
|
103
|
+
className: cn("absolute left-0 h-1 w-0 rounded-(--espd-radius-control) bg-primary", disabled && "opacity-50")
|
|
104
|
+
}),
|
|
105
|
+
/* @__PURE__ */ jsx("input", {
|
|
106
|
+
type: "range",
|
|
107
|
+
"aria-label": labels.slider,
|
|
108
|
+
min,
|
|
109
|
+
max,
|
|
110
|
+
step: by,
|
|
111
|
+
value,
|
|
112
|
+
disabled,
|
|
113
|
+
onChange: (event) => set(Number(event.target.value)),
|
|
114
|
+
className: SLIDER
|
|
115
|
+
})
|
|
116
|
+
]
|
|
117
|
+
}),
|
|
118
|
+
/* @__PURE__ */ jsxs("div", {
|
|
119
|
+
className: "flex items-center gap-2",
|
|
120
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
121
|
+
className: "inline-flex items-center rounded-xs border border-border",
|
|
122
|
+
children: [
|
|
123
|
+
/* @__PURE__ */ jsx(Button, {
|
|
124
|
+
...step,
|
|
125
|
+
disabled,
|
|
126
|
+
"aria-label": labels.down,
|
|
127
|
+
onClick: () => set(value - nudge),
|
|
128
|
+
className: "size-7 rounded-none",
|
|
129
|
+
children: /* @__PURE__ */ jsx(Minus, { className: "h-3.5 w-3.5" })
|
|
130
|
+
}),
|
|
131
|
+
/* @__PURE__ */ jsx(Input, {
|
|
132
|
+
size: "sm",
|
|
133
|
+
type: "number",
|
|
134
|
+
inputMode: "decimal",
|
|
135
|
+
"aria-label": label,
|
|
136
|
+
min,
|
|
137
|
+
max,
|
|
138
|
+
step: by,
|
|
139
|
+
disabled,
|
|
140
|
+
value: draft ?? value.toFixed(placesOf(by)),
|
|
141
|
+
onChange: (event) => setDraft(event.target.value),
|
|
142
|
+
onBlur: commit,
|
|
143
|
+
onKeyDown: (event) => event.key === "Enter" && commit(),
|
|
144
|
+
className: "h-7 w-20 rounded-none border-x border-y-0 border-border text-center font-mono tabular-nums shadow-none"
|
|
145
|
+
}),
|
|
146
|
+
/* @__PURE__ */ jsx(Button, {
|
|
147
|
+
...step,
|
|
148
|
+
disabled,
|
|
149
|
+
"aria-label": labels.up,
|
|
150
|
+
onClick: () => set(value + nudge),
|
|
151
|
+
className: "size-7 rounded-none",
|
|
152
|
+
children: /* @__PURE__ */ jsx(Plus, { className: "h-3.5 w-3.5" })
|
|
153
|
+
})
|
|
154
|
+
]
|
|
155
|
+
}), unit && /* @__PURE__ */ jsx("span", {
|
|
156
|
+
className: "w-7 font-mono text-xs text-foreground-secondary",
|
|
157
|
+
children: unit
|
|
158
|
+
})]
|
|
159
|
+
})
|
|
160
|
+
]
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
//#endregion
|
|
164
|
+
export { RangeField, placesOf, wrapped };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
type RankNumeralSize = "default" | "lg";
|
|
4
|
+
type RankNumeralFill = "none" | "card";
|
|
5
|
+
interface RankNumeralProps {
|
|
6
|
+
/** The rank to draw (1, 2, 3…). */
|
|
7
|
+
value: number;
|
|
8
|
+
/** `default` is 72px, `lg` 128px. Default `default`. */
|
|
9
|
+
size?: RankNumeralSize;
|
|
10
|
+
/**
|
|
11
|
+
* Inside the outline: `none` lets the background through (a flat tint);
|
|
12
|
+
* `card` fills it with the card colour so it reads over a photo. Default `none`.
|
|
13
|
+
*/
|
|
14
|
+
fill?: RankNumeralFill;
|
|
15
|
+
/**
|
|
16
|
+
* Position and colour. The outline is drawn in the text colour
|
|
17
|
+
* (`text-primary`, `text-white`…); place it with absolute classes — it is
|
|
18
|
+
* made to bleed off the bottom edge of a media block (`absolute -bottom-6 left-3`).
|
|
19
|
+
*/
|
|
20
|
+
className?: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* A large outlined numeral for a ranked list — the "1", "2", "3" a top-N
|
|
25
|
+
* shelf draws in the corner of each card. Decorative: it is hidden from
|
|
26
|
+
* assistive technology, so the card's own accessible name must carry the rank.
|
|
27
|
+
*/
|
|
28
|
+
declare function RankNumeral({ value, size, fill, className }: RankNumeralProps): React.JSX.Element;
|
|
29
|
+
|
|
30
|
+
export { RankNumeral, type RankNumeralFill, type RankNumeralProps, type RankNumeralSize };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { cn } from "../../utils/cn.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/rank-numeral/rank-numeral.tsx
|
|
4
|
+
var SIZE = {
|
|
5
|
+
default: "text-7xl [-webkit-text-stroke-width:1.5px]",
|
|
6
|
+
lg: "text-9xl [-webkit-text-stroke-width:2px]"
|
|
7
|
+
};
|
|
8
|
+
var FILL = {
|
|
9
|
+
none: "[-webkit-text-fill-color:transparent]",
|
|
10
|
+
card: "[-webkit-text-fill-color:var(--color-card)]"
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* A large outlined numeral for a ranked list — the "1", "2", "3" a top-N
|
|
14
|
+
* shelf draws in the corner of each card. Decorative: it is hidden from
|
|
15
|
+
* assistive technology, so the card's own accessible name must carry the rank.
|
|
16
|
+
*/
|
|
17
|
+
function RankNumeral({ value, size = "default", fill = "none", className }) {
|
|
18
|
+
return /* @__PURE__ */ jsx("span", {
|
|
19
|
+
"aria-hidden": true,
|
|
20
|
+
"data-slot": "rank-numeral",
|
|
21
|
+
className: cn("pointer-events-none select-none font-extrabold leading-none tracking-tighter tabular-nums", "[-webkit-text-stroke-color:currentColor]", FILL[fill], SIZE[size], className),
|
|
22
|
+
children: value
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { RankNumeral };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ReactElement } from 'react';
|
|
3
|
+
import { P as PresetColor } from '../../index-BQANnKs9.js';
|
|
4
|
+
|
|
5
|
+
interface ReactionButtonProps {
|
|
6
|
+
/** Whether the viewer has reacted (a like, an upvote, a want). */
|
|
7
|
+
pressed: boolean;
|
|
8
|
+
/** How many have reacted, the viewer included. */
|
|
9
|
+
count: number;
|
|
10
|
+
/** Called with the new state on click. */
|
|
11
|
+
onPressedChange: (pressed: boolean) => void;
|
|
12
|
+
/** The mark — a Lucide element such as `<Heart />`. Filled while pressed. */
|
|
13
|
+
icon: ReactElement<{
|
|
14
|
+
className?: string;
|
|
15
|
+
}>;
|
|
16
|
+
/** The accessible name for a state and count ("I want Desk clock, 3 so far"). */
|
|
17
|
+
ariaLabel: (pressed: boolean, count: number) => string;
|
|
18
|
+
/** Default `secondary`. */
|
|
19
|
+
color?: PresetColor;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* A reaction with its count: a like, an upvote, "I want this too". Switching
|
|
26
|
+
* it ON is celebrated once — the mark pops, a ring spreads, six dots burst out
|
|
27
|
+
* and the count ticks into place; switching it off plays nothing. Motion only
|
|
28
|
+
* when the person allows it.
|
|
29
|
+
*/
|
|
30
|
+
declare function ReactionButton({ pressed, count, onPressedChange, icon, ariaLabel, color, disabled, className, }: ReactionButtonProps): React.JSX.Element;
|
|
31
|
+
|
|
32
|
+
export { ReactionButton, type ReactionButtonProps };
|