@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,33 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
//#region src/core/hooks/use-on-screen.tsx
|
|
3
|
+
function subscribeVisibility(onChange) {
|
|
4
|
+
if (typeof document === "undefined") return () => {};
|
|
5
|
+
document.addEventListener("visibilitychange", onChange);
|
|
6
|
+
return () => document.removeEventListener("visibilitychange", onChange);
|
|
7
|
+
}
|
|
8
|
+
var isDocumentVisible = () => !document.hidden;
|
|
9
|
+
/**
|
|
10
|
+
* True while any part of the element is on screen AND the tab is visible:
|
|
11
|
+
* the signal for pausing loops nobody can see (autoplay, animation).
|
|
12
|
+
*
|
|
13
|
+
* Unlike `useIsInView` (motion's observer, for reveal-on-scroll), this one
|
|
14
|
+
* also goes false when the tab is hidden. Where `IntersectionObserver` is
|
|
15
|
+
* missing (SSR, jsdom) the element counts as on screen.
|
|
16
|
+
*/
|
|
17
|
+
function useOnScreen(ref) {
|
|
18
|
+
const [intersecting, setIntersecting] = React$1.useState(true);
|
|
19
|
+
const visible = React$1.useSyncExternalStore(subscribeVisibility, isDocumentVisible, () => true);
|
|
20
|
+
React$1.useEffect(() => {
|
|
21
|
+
const element = ref.current;
|
|
22
|
+
if (!element || typeof IntersectionObserver === "undefined") return void 0;
|
|
23
|
+
const observer = new IntersectionObserver((entries) => {
|
|
24
|
+
const entry = entries[entries.length - 1];
|
|
25
|
+
if (entry) setIntersecting(entry.isIntersecting);
|
|
26
|
+
});
|
|
27
|
+
observer.observe(element);
|
|
28
|
+
return () => observer.disconnect();
|
|
29
|
+
}, [ref]);
|
|
30
|
+
return intersecting && visible;
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { useOnScreen };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
//#region src/core/hooks/use-prefers-reduced-motion.tsx
|
|
3
|
+
var REDUCED_MOTION_QUERY = "(prefers-reduced-motion: reduce)";
|
|
4
|
+
function subscribe(onChange) {
|
|
5
|
+
if (typeof window === "undefined" || !window.matchMedia) return () => {};
|
|
6
|
+
const query = window.matchMedia(REDUCED_MOTION_QUERY);
|
|
7
|
+
query.addEventListener?.("change", onChange);
|
|
8
|
+
return () => query.removeEventListener?.("change", onChange);
|
|
9
|
+
}
|
|
10
|
+
function read() {
|
|
11
|
+
if (typeof window === "undefined" || !window.matchMedia) return false;
|
|
12
|
+
return window.matchMedia(REDUCED_MOTION_QUERY).matches;
|
|
13
|
+
}
|
|
14
|
+
/** True while the person asks their system for reduced motion; autoplay never runs then. */
|
|
15
|
+
function usePrefersReducedMotion() {
|
|
16
|
+
return React$1.useSyncExternalStore(subscribe, read, () => false);
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { usePrefersReducedMotion };
|
|
@@ -4,6 +4,13 @@ var NO_OVERFLOW = {
|
|
|
4
4
|
start: false,
|
|
5
5
|
end: false
|
|
6
6
|
};
|
|
7
|
+
/**
|
|
8
|
+
* After a resize, keep measuring for this long. Content that animates to its
|
|
9
|
+
* new size (a tab highlight springing narrower when the list folds) overflows
|
|
10
|
+
* for a moment and settles without another resize, which would otherwise leave
|
|
11
|
+
* a stale "more this way" edge behind.
|
|
12
|
+
*/
|
|
13
|
+
var SETTLE_MS = 800;
|
|
7
14
|
/** Tracks whether a horizontal scroller has content hidden on either side. */
|
|
8
15
|
function useScrollOverflow(ref, { enabled = true, getContent, onResize } = {}) {
|
|
9
16
|
const [overflow, setOverflow] = React$1.useState(NO_OVERFLOW);
|
|
@@ -29,11 +36,23 @@ function useScrollOverflow(ref, { enabled = true, getContent, onResize } = {}) {
|
|
|
29
36
|
end
|
|
30
37
|
});
|
|
31
38
|
};
|
|
39
|
+
let frame = 0;
|
|
40
|
+
let settleUntil = 0;
|
|
41
|
+
const settle = () => {
|
|
42
|
+
settleUntil = performance.now() + SETTLE_MS;
|
|
43
|
+
if (frame) return;
|
|
44
|
+
const tick = () => {
|
|
45
|
+
update();
|
|
46
|
+
frame = performance.now() < settleUntil ? requestAnimationFrame(tick) : 0;
|
|
47
|
+
};
|
|
48
|
+
frame = requestAnimationFrame(tick);
|
|
49
|
+
};
|
|
32
50
|
update();
|
|
33
51
|
scroller.addEventListener("scroll", update, { passive: true });
|
|
34
52
|
if (typeof ResizeObserver === "undefined") return () => scroller.removeEventListener("scroll", update);
|
|
35
53
|
const observer = new ResizeObserver(() => {
|
|
36
54
|
update();
|
|
55
|
+
settle();
|
|
37
56
|
onResizeRef.current?.();
|
|
38
57
|
});
|
|
39
58
|
observer.observe(scroller);
|
|
@@ -42,6 +61,7 @@ function useScrollOverflow(ref, { enabled = true, getContent, onResize } = {}) {
|
|
|
42
61
|
return () => {
|
|
43
62
|
scroller.removeEventListener("scroll", update);
|
|
44
63
|
observer.disconnect();
|
|
64
|
+
cancelAnimationFrame(frame);
|
|
45
65
|
};
|
|
46
66
|
}, [ref, enabled]);
|
|
47
67
|
return overflow;
|
package/dist/core/index.d.ts
CHANGED
|
@@ -2,14 +2,26 @@ import * as class_variance_authority_types from 'class-variance-authority/types'
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
4
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
5
|
-
export {
|
|
5
|
+
export { Badge, BadgeProps, badgeVariants } from '../components/badge/index.js';
|
|
6
|
+
export { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from '../components/breadcrumb/index.js';
|
|
7
|
+
export { a as Button, B as ButtonProps, b as buttonVariants } from '../button-BK-DIR_L.js';
|
|
8
|
+
export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants } from '../components/button-group/index.js';
|
|
9
|
+
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '../components/card/index.js';
|
|
10
|
+
export { Collapsible, CollapsibleContent, CollapsibleTrigger } from '../components/collapsible/index.js';
|
|
11
|
+
export { Label } from '../components/label/index.js';
|
|
12
|
+
export { Popover, PopoverAnchor, PopoverContent, PopoverGroup, PopoverGroupProps, PopoverProps, PopoverTrigger } from '../components/popover/index.js';
|
|
13
|
+
export { Separator, SeparatorProps } from '../components/separator/index.js';
|
|
14
|
+
export { Skeleton } from '../components/skeleton/index.js';
|
|
6
15
|
export { u as useControlledState } from '../use-controlled-state-BL9NoHu8.js';
|
|
16
|
+
export { useIsMobile } from '../components/use-mobile/index.js';
|
|
7
17
|
import { UseInViewOptions } from 'motion/react';
|
|
8
|
-
import '
|
|
9
|
-
import '
|
|
10
|
-
import '@radix-ui/react-collapsible';
|
|
18
|
+
import '../style-axes-DSQ2DGc5.js';
|
|
19
|
+
import '../variant-D81RhpbR.js';
|
|
11
20
|
import '../index-BQANnKs9.js';
|
|
21
|
+
import '@radix-ui/react-collapsible';
|
|
22
|
+
import '@radix-ui/react-label';
|
|
12
23
|
import '@radix-ui/react-popover';
|
|
24
|
+
import '@radix-ui/react-separator';
|
|
13
25
|
|
|
14
26
|
interface UseIsInViewOptions {
|
|
15
27
|
inView?: boolean;
|
|
@@ -34,6 +46,19 @@ declare const AvatarFallback: React.ForwardRefExoticComponent<Omit<AvatarPrimiti
|
|
|
34
46
|
type DataStateValue = string | boolean | null;
|
|
35
47
|
declare function useDataState<T extends HTMLElement = HTMLElement>(key: string, forwardedRef?: React.Ref<T | null>, onChange?: (value: DataStateValue) => void): [DataStateValue, React.RefObject<T | null>];
|
|
36
48
|
|
|
49
|
+
/**
|
|
50
|
+
* True while any part of the element is on screen AND the tab is visible:
|
|
51
|
+
* the signal for pausing loops nobody can see (autoplay, animation).
|
|
52
|
+
*
|
|
53
|
+
* Unlike `useIsInView` (motion's observer, for reveal-on-scroll), this one
|
|
54
|
+
* also goes false when the tab is hidden. Where `IntersectionObserver` is
|
|
55
|
+
* missing (SSR, jsdom) the element counts as on screen.
|
|
56
|
+
*/
|
|
57
|
+
declare function useOnScreen(ref: React.RefObject<Element | null>): boolean;
|
|
58
|
+
|
|
59
|
+
/** True while the person asks their system for reduced motion; autoplay never runs then. */
|
|
60
|
+
declare function usePrefersReducedMotion(): boolean;
|
|
61
|
+
|
|
37
62
|
declare function getStrictContext<T>(name?: string): readonly [
|
|
38
63
|
({ value, children, }: {
|
|
39
64
|
value: T;
|
|
@@ -42,4 +67,4 @@ declare function getStrictContext<T>(name?: string): readonly [
|
|
|
42
67
|
() => T
|
|
43
68
|
];
|
|
44
69
|
|
|
45
|
-
export { Alert, AlertDescription, AlertTitle, Avatar, AvatarFallback, AvatarImage, type DataStateValue, type UseIsInViewOptions, getStrictContext, useDataState, useIsInView };
|
|
70
|
+
export { Alert, AlertDescription, AlertTitle, Avatar, AvatarFallback, AvatarImage, type DataStateValue, type UseIsInViewOptions, getStrictContext, useDataState, useIsInView, useOnScreen, usePrefersReducedMotion };
|
package/dist/core/index.js
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
import { useControlledState } from "./hooks/use-controlled-state.js";
|
|
2
1
|
import { getStrictContext } from "./utils/get-strict-context.js";
|
|
2
|
+
import { useControlledState } from "./hooks/use-controlled-state.js";
|
|
3
3
|
import { Avatar, AvatarFallback, AvatarImage } from "./avatar.js";
|
|
4
4
|
import { useDataState } from "./hooks/use-data-state.js";
|
|
5
5
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./collapsible.js";
|
|
6
6
|
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "./card.js";
|
|
7
7
|
import { Button, buttonVariants } from "./button.js";
|
|
8
|
+
import { PopoverGroup } from "./popover-group.js";
|
|
8
9
|
import { Popover, PopoverAnchor, PopoverContent, PopoverTrigger } from "./popover.js";
|
|
9
10
|
import { useIsMobile } from "./hooks/use-mobile.js";
|
|
10
11
|
import { Separator } from "./separator.js";
|
|
11
12
|
import { Skeleton } from "./skeleton.js";
|
|
12
13
|
import { Label } from "./label.js";
|
|
13
14
|
import { Badge, badgeVariants } from "./badge.js";
|
|
15
|
+
import { usePrefersReducedMotion } from "./hooks/use-prefers-reduced-motion.js";
|
|
14
16
|
import { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants } from "./button-group.js";
|
|
17
|
+
import { useOnScreen } from "./hooks/use-on-screen.js";
|
|
15
18
|
import { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from "./breadcrumb.js";
|
|
16
19
|
import { useIsInView } from "./hooks/use-is-in-view.js";
|
|
17
20
|
import { Alert, AlertDescription, AlertTitle } from "./alert.js";
|
|
18
|
-
export { Alert, AlertDescription, AlertTitle, Avatar, AvatarFallback, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Collapsible, CollapsibleContent, CollapsibleTrigger, Label, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Separator, Skeleton, badgeVariants, buttonGroupVariants, buttonVariants, getStrictContext, useControlledState, useDataState, useIsInView, useIsMobile };
|
|
21
|
+
export { Alert, AlertDescription, AlertTitle, Avatar, AvatarFallback, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Collapsible, CollapsibleContent, CollapsibleTrigger, Label, Popover, PopoverAnchor, PopoverContent, PopoverGroup, PopoverTrigger, Separator, Skeleton, badgeVariants, buttonGroupVariants, buttonVariants, getStrictContext, useControlledState, useDataState, useIsInView, useIsMobile, useOnScreen, usePrefersReducedMotion };
|
|
@@ -3,24 +3,28 @@ import { cn } from "../../utils/cn.js";
|
|
|
3
3
|
import { Input } from "./input.js";
|
|
4
4
|
import * as React$1 from "react";
|
|
5
5
|
import { useState } from "react";
|
|
6
|
-
import { jsx
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
import { EyeIcon, EyeOffIcon } from "lucide-react";
|
|
8
8
|
//#region src/core/input/input-password.tsx
|
|
9
|
-
var InputPassword = React$1.forwardRef(({ className, ...props }, ref) => {
|
|
9
|
+
var InputPassword = React$1.forwardRef(({ className, showPasswordLabel = "Show password", hidePasswordLabel = "Hide password", ...props }, ref) => {
|
|
10
10
|
const [isVisible, setIsVisible] = useState(false);
|
|
11
11
|
return /* @__PURE__ */ jsx(Input, {
|
|
12
12
|
ref,
|
|
13
13
|
type: isVisible ? "text" : "password",
|
|
14
14
|
className: cn("pr-9", className),
|
|
15
|
-
endIcon: /* @__PURE__ */
|
|
15
|
+
endIcon: /* @__PURE__ */ jsx("button", {
|
|
16
16
|
type: "button",
|
|
17
17
|
onClick: () => setIsVisible((prev) => !prev),
|
|
18
|
-
className: "pointer-events-auto cursor-pointer text-muted-foreground hover:text-foreground",
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
className: "pointer-events-auto cursor-pointer rounded-sm text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
19
|
+
"aria-label": isVisible ? hidePasswordLabel : showPasswordLabel,
|
|
20
|
+
"aria-pressed": isVisible,
|
|
21
|
+
children: isVisible ? /* @__PURE__ */ jsx(EyeOffIcon, {
|
|
22
|
+
size: 16,
|
|
23
|
+
"aria-hidden": "true"
|
|
24
|
+
}) : /* @__PURE__ */ jsx(EyeIcon, {
|
|
25
|
+
size: 16,
|
|
26
|
+
"aria-hidden": "true"
|
|
27
|
+
})
|
|
24
28
|
}),
|
|
25
29
|
...props
|
|
26
30
|
});
|
package/dist/core/input/input.js
CHANGED
|
@@ -1,14 +1,27 @@
|
|
|
1
1
|
import { cn } from "../../utils/cn.js";
|
|
2
|
+
import { useStyleAxes } from "../../utils/style-axes.js";
|
|
2
3
|
import { FieldLabelRow, fieldHintClassName, inputLabelClassName } from "../field-label-row.js";
|
|
3
4
|
import * as React$1 from "react";
|
|
4
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
6
|
//#region src/core/input/input.tsx
|
|
6
7
|
var sizeClasses = {
|
|
7
|
-
sm: "h-8 px-2 text-xs",
|
|
8
|
-
default: "h-10 px-3 py-2 text-base md:text-sm",
|
|
8
|
+
sm: "h-[var(--espd-control-height-sm,calc(var(--spacing)*8))] px-2 text-xs",
|
|
9
|
+
default: "h-[var(--espd-control-height-lg,calc(var(--spacing)*10))] px-3 py-2 text-base md:text-sm",
|
|
9
10
|
lg: "h-12 px-4 text-lg"
|
|
10
11
|
};
|
|
11
|
-
|
|
12
|
+
/**
|
|
13
|
+
* An add-on segment beside the field. A text add-on is a padded box. An
|
|
14
|
+
* action add-on is a control that fills the box: no padding, stretched to the
|
|
15
|
+
* field's height, square where it meets the text and clipped to the field's
|
|
16
|
+
* outer corners. Its own focus ring is drawn as the segment's border plus one
|
|
17
|
+
* inset pixel, so it sits exactly on the box's edges (the segment rises above
|
|
18
|
+
* the field so the shared edge takes the ring colour too).
|
|
19
|
+
*/
|
|
20
|
+
function addOnClassName(side, action, full) {
|
|
21
|
+
const start = side === "start";
|
|
22
|
+
return cn("border-[length:var(--espd-own-border-width,var(--espd-border-width-control,1px))] border-input bg-background", start ? "-me-px" : "-ms-px", start && (full ? "rounded-s-full" : "rounded-s-[var(--espd-own-radius,var(--espd-radius-control,var(--radius-lg)))]"), !start && (full ? "rounded-e-full" : "rounded-e-[var(--espd-own-radius,var(--espd-radius-control,var(--radius-lg)))]"), action ? "relative flex shrink-0 overflow-hidden has-[:focus-visible]:z-20 has-[:focus-visible]:border-ring [&>*]:h-auto! [&>*]:self-stretch [&>*]:rounded-none! [&>*]:px-3! [&>*]:shadow-none! [&>*:focus-visible]:ring-1! [&>*:focus-visible]:ring-inset! [&>*:focus-visible]:ring-offset-0!" : "inline-flex items-center px-3 text-sm text-muted-foreground");
|
|
23
|
+
}
|
|
24
|
+
var Input = React$1.forwardRef(({ className, type, label, size, rounded, startHelperContent, endHelperContent, hintContent, error, errorContent, startIcon, endIcon, startAddOnContent, endAddOnContent, startAddOn, endAddOn, startAddOnAction, endAddOnAction, floatingLabel, charLimit, onChange, value, defaultValue, id, required, placeholder, radius, border, style, ...restProps }, ref) => {
|
|
12
25
|
const autoId = React$1.useId();
|
|
13
26
|
const inputId = id || autoId;
|
|
14
27
|
const [charCount, setCharCount] = React$1.useState(() => {
|
|
@@ -20,16 +33,22 @@ var Input = React$1.forwardRef(({ className, type, label, size, rounded, startHe
|
|
|
20
33
|
React$1.useEffect(() => {
|
|
21
34
|
if (charLimit !== void 0 && typeof value === "string") setCharCount(value.length);
|
|
22
35
|
}, [value, charLimit]);
|
|
23
|
-
|
|
36
|
+
const axes = useStyleAxes({
|
|
37
|
+
radius,
|
|
38
|
+
border,
|
|
39
|
+
style
|
|
40
|
+
}, ["radius", "border"]);
|
|
41
|
+
if (!(label !== void 0 || size !== void 0 || rounded !== void 0 || startHelperContent !== void 0 || endHelperContent !== void 0 || hintContent !== void 0 || error !== void 0 || errorContent !== void 0 || startIcon !== void 0 || endIcon !== void 0 || startAddOnContent !== void 0 || endAddOnContent !== void 0 || startAddOn !== void 0 || endAddOn !== void 0 || startAddOnAction !== void 0 || endAddOnAction !== void 0 || floatingLabel !== void 0 || charLimit !== void 0)) return /* @__PURE__ */ jsx("input", {
|
|
24
42
|
type,
|
|
25
43
|
id,
|
|
26
|
-
className: cn("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background transition-[box-shadow,border-color] duration-
|
|
44
|
+
className: cn("flex h-[var(--espd-control-height-lg,calc(var(--spacing)*10))] w-full rounded-[var(--espd-own-radius,var(--espd-radius-control,var(--radius-md)))] border-[length:var(--espd-own-border-width,var(--espd-border-width-control,1px))] border-input bg-background px-3 py-2 text-base ring-offset-background transition-[box-shadow,border-color] duration-[var(--espd-duration-normal,200ms)] ease-in-out file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 read-only:bg-muted md:text-sm", className),
|
|
27
45
|
ref,
|
|
28
46
|
onChange,
|
|
29
47
|
value,
|
|
30
48
|
defaultValue,
|
|
31
49
|
required,
|
|
32
50
|
placeholder,
|
|
51
|
+
style: axes.style,
|
|
33
52
|
...restProps
|
|
34
53
|
});
|
|
35
54
|
const effectiveSize = size || "default";
|
|
@@ -39,9 +58,12 @@ var Input = React$1.forwardRef(({ className, type, label, size, rounded, startHe
|
|
|
39
58
|
onChange?.(e);
|
|
40
59
|
};
|
|
41
60
|
const effectivePlaceholder = floatingLabel ? " " : placeholder;
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
const
|
|
61
|
+
const present = (node) => node != null && node !== false && node !== "";
|
|
62
|
+
const resolveAddOn = (content, text) => present(content) ? content : text || void 0;
|
|
63
|
+
const startIsAction = present(startAddOnAction);
|
|
64
|
+
const endIsAction = present(endAddOnAction);
|
|
65
|
+
const startAddOnNode = startIsAction ? startAddOnAction : resolveAddOn(startAddOnContent, startAddOn);
|
|
66
|
+
const endAddOnNode = endIsAction ? endAddOnAction : resolveAddOn(endAddOnContent, endAddOn);
|
|
45
67
|
const hasAddOn = startAddOnNode != null || endAddOnNode != null;
|
|
46
68
|
const hasOverlay = !!startIcon || !!endIcon || charLimit !== void 0 || !!floatingLabel;
|
|
47
69
|
const helperStartId = `${inputId}-helper-start`;
|
|
@@ -55,7 +77,7 @@ var Input = React$1.forwardRef(({ className, type, label, size, rounded, startHe
|
|
|
55
77
|
type,
|
|
56
78
|
id: inputId,
|
|
57
79
|
ref,
|
|
58
|
-
className: cn("flex w-full border border-input bg-background ring-offset-background transition-[box-shadow,border-color] duration-
|
|
80
|
+
className: cn("flex w-full border-[length:var(--espd-own-border-width,var(--espd-border-width-control,1px))] border-input bg-background ring-offset-background transition-[box-shadow,border-color] duration-[var(--espd-duration-normal,200ms)] ease-in-out file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 read-only:bg-muted z-10", floatingLabel ? "h-12 px-3 pt-4 pb-1 text-base md:text-sm" : sizeClasses[effectiveSize], rounded && radius === void 0 ? "rounded-full" : "rounded-[var(--espd-own-radius,var(--espd-radius-control,var(--radius-md)))]", hasError && "border-destructive focus-visible:ring-destructive", startIcon && "ps-9", endIcon && "pe-9", charLimit !== void 0 && !endIcon && "pe-14", charLimit !== void 0 && endIcon && "pe-20", startAddOnNode != null && "rounded-s-none shadow-none", endAddOnNode != null && "rounded-e-none shadow-none", hasAddOn && "focus-visible:ring-0 focus-visible:ring-offset-0", "peer", floatingLabel && "placeholder:text-transparent", className),
|
|
59
81
|
required,
|
|
60
82
|
"aria-invalid": hasError || void 0,
|
|
61
83
|
"aria-describedby": describedBy,
|
|
@@ -64,6 +86,7 @@ var Input = React$1.forwardRef(({ className, type, label, size, rounded, startHe
|
|
|
64
86
|
defaultValue,
|
|
65
87
|
maxLength: charLimit,
|
|
66
88
|
placeholder: effectivePlaceholder,
|
|
89
|
+
style: axes.style,
|
|
67
90
|
...restProps
|
|
68
91
|
});
|
|
69
92
|
let inputContainer = inputElement;
|
|
@@ -97,15 +120,18 @@ var Input = React$1.forwardRef(({ className, type, label, size, rounded, startHe
|
|
|
97
120
|
]
|
|
98
121
|
});
|
|
99
122
|
if (hasAddOn) inputContainer = /* @__PURE__ */ jsxs("div", {
|
|
100
|
-
className: "flex rounded-lg",
|
|
123
|
+
className: cn("flex ring-offset-background transition-shadow duration-[var(--espd-duration-normal,200ms)] ease-in-out has-[input:focus-visible]:ring-2 has-[input:focus-visible]:ring-offset-2", hasError ? "has-[input:focus-visible]:ring-destructive" : "has-[input:focus-visible]:ring-ring", rounded && radius === void 0 ? "rounded-full" : "rounded-[var(--espd-own-radius,var(--espd-radius-control,var(--radius-lg)))]"),
|
|
124
|
+
style: axes.partStyle,
|
|
101
125
|
children: [
|
|
102
126
|
startAddOnNode != null && /* @__PURE__ */ jsx("span", {
|
|
103
|
-
|
|
127
|
+
style: axes.partStyle,
|
|
128
|
+
className: addOnClassName("start", startIsAction, rounded && radius === void 0),
|
|
104
129
|
children: startAddOnNode
|
|
105
130
|
}),
|
|
106
131
|
inputContainer,
|
|
107
132
|
endAddOnNode != null && /* @__PURE__ */ jsx("span", {
|
|
108
|
-
|
|
133
|
+
style: axes.partStyle,
|
|
134
|
+
className: addOnClassName("end", endIsAction, rounded && radius === void 0),
|
|
109
135
|
children: endAddOnNode
|
|
110
136
|
})
|
|
111
137
|
]
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../../utils/cn.js";
|
|
3
|
+
import { useStyleAxes } from "../../utils/style-axes.js";
|
|
3
4
|
import { inputLabelClassName } from "../field-label-row.js";
|
|
4
5
|
import * as React$1 from "react";
|
|
5
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -38,13 +39,14 @@ InputOTPSeparator.displayName = "InputOTPSeparator";
|
|
|
38
39
|
* Renders one slot box. Mirrors `Input`'s border/focus/error tokens so a row of
|
|
39
40
|
* slots visually lines up with an `Input` of the same `size`.
|
|
40
41
|
*/
|
|
41
|
-
var SlotBox = ({ index, size, expand, rounded, hasError, cornerClass }) => {
|
|
42
|
+
var SlotBox = ({ index, size, expand, rounded, hasError, cornerClass, axisStyle }) => {
|
|
42
43
|
const slot = React$1.useContext(OTPInputContext).slots[index];
|
|
43
44
|
if (!slot) return null;
|
|
44
45
|
const { char, hasFakeCaret, isActive } = slot;
|
|
45
46
|
return /* @__PURE__ */ jsxs("div", {
|
|
46
47
|
"data-active": isActive || void 0,
|
|
47
|
-
|
|
48
|
+
style: axisStyle,
|
|
49
|
+
className: cn("relative flex items-center justify-center border-[length:var(--espd-own-border-width,var(--espd-border-width-control,1px))] border-input bg-background font-medium text-foreground shadow-xs", "transition-[box-shadow,border-color] duration-200 ease-in-out", "ring-offset-background", "data-[active=true]:z-10 data-[active=true]:ring-2 data-[active=true]:ring-ring data-[active=true]:ring-offset-2", hasError && "border-destructive data-[active=true]:ring-destructive", rounded ? "rounded-full" : "rounded-[var(--espd-own-radius,var(--espd-radius-control,var(--radius-md)))]", cornerClass, expand ? cn("min-w-0 flex-1", slotExpandedSizeClasses[size]) : slotSizeClasses[size]),
|
|
48
50
|
children: [char, hasFakeCaret && /* @__PURE__ */ jsx("div", {
|
|
49
51
|
className: "pointer-events-none absolute inset-0 flex items-center justify-center",
|
|
50
52
|
children: /* @__PURE__ */ jsx("div", { className: "h-4 w-px animate-caret-blink bg-foreground duration-1000" })
|
|
@@ -81,7 +83,8 @@ function clampLength(raw) {
|
|
|
81
83
|
}
|
|
82
84
|
return rounded;
|
|
83
85
|
}
|
|
84
|
-
var InputOTP = React$1.forwardRef(({ length, allowAlphaNumeric, regex, separators, expand, value, defaultValue, onChange, onComplete, label, required, size, rounded, disabled, startHelperContent, endHelperContent, hintContent, error, errorContent, id, name, autoFocus, autoComplete, className, containerClassName, ...restProps }, ref) => {
|
|
86
|
+
var InputOTP = React$1.forwardRef(({ length, allowAlphaNumeric, regex, separators, expand, value, defaultValue, onChange, onComplete, label, required, size, rounded, radius, disabled, startHelperContent, endHelperContent, hintContent, error, errorContent, id, name, autoFocus, autoComplete, className, containerClassName, ...restProps }, ref) => {
|
|
87
|
+
const axes = useStyleAxes({ radius }, ["radius"]);
|
|
85
88
|
const autoId = React$1.useId();
|
|
86
89
|
const inputId = id || autoId;
|
|
87
90
|
const effectiveLength = React$1.useMemo(() => clampLength(length), [length]);
|
|
@@ -153,9 +156,10 @@ var InputOTP = React$1.forwardRef(({ length, allowAlphaNumeric, regex, separator
|
|
|
153
156
|
index: slotIndex,
|
|
154
157
|
size: effectiveSize,
|
|
155
158
|
expand: !!expand,
|
|
156
|
-
rounded: !!rounded,
|
|
159
|
+
rounded: !!rounded && radius === void 0,
|
|
157
160
|
hasError,
|
|
158
|
-
cornerClass
|
|
161
|
+
cornerClass,
|
|
162
|
+
axisStyle: axes.partStyle
|
|
159
163
|
}, slotIndex);
|
|
160
164
|
})
|
|
161
165
|
})] }, `g-${groupIndex}`))
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { useControlledState } from "./hooks/use-controlled-state.js";
|
|
2
|
+
import { useHoverRefs } from "./popover-hover.js";
|
|
3
|
+
import * as React$1 from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/core/popover-group.tsx
|
|
6
|
+
var PopoverGroupContext = React$1.createContext(null);
|
|
7
|
+
function usePopoverGroupContext() {
|
|
8
|
+
return React$1.useContext(PopoverGroupContext);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Popovers that share one place on screen: at most one is open, and with
|
|
12
|
+
* `openOnHover` a hover moves the open panel from trigger to trigger with
|
|
13
|
+
* intent — the first opens after the popover's `openDelay`, another takes over
|
|
14
|
+
* only after `switchDelay`, and reaching the open content cancels a pending
|
|
15
|
+
* switch. For a grid or a row of items that each preview on hover.
|
|
16
|
+
*/
|
|
17
|
+
function PopoverGroup({ value: valueProp, defaultValue = null, onValueChange, switchDelay = 350, children }) {
|
|
18
|
+
const [value, setValue] = useControlledState({
|
|
19
|
+
value: valueProp,
|
|
20
|
+
defaultValue,
|
|
21
|
+
onChange: onValueChange
|
|
22
|
+
});
|
|
23
|
+
const valueRef = React$1.useRef(value);
|
|
24
|
+
valueRef.current = value;
|
|
25
|
+
const hover = useHoverRefs();
|
|
26
|
+
const setGroupValue = React$1.useCallback((next) => {
|
|
27
|
+
valueRef.current = next;
|
|
28
|
+
setValue(next);
|
|
29
|
+
}, [setValue]);
|
|
30
|
+
const context = React$1.useMemo(() => ({
|
|
31
|
+
value,
|
|
32
|
+
valueRef,
|
|
33
|
+
setValue: setGroupValue,
|
|
34
|
+
switchDelay,
|
|
35
|
+
hover
|
|
36
|
+
}), [
|
|
37
|
+
value,
|
|
38
|
+
setGroupValue,
|
|
39
|
+
switchDelay,
|
|
40
|
+
hover
|
|
41
|
+
]);
|
|
42
|
+
return /* @__PURE__ */ jsx(PopoverGroupContext.Provider, {
|
|
43
|
+
value: context,
|
|
44
|
+
children
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
export { PopoverGroup, PopoverGroupContext, usePopoverGroupContext };
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
//#region src/core/popover-hover.tsx
|
|
3
|
+
/** A fresh set of hover refs, for a lone popover or a group. */
|
|
4
|
+
function useHoverRefs() {
|
|
5
|
+
const timer = React$1.useRef(void 0);
|
|
6
|
+
const openedByHover = React$1.useRef(false);
|
|
7
|
+
const closedAt = React$1.useRef(0);
|
|
8
|
+
const closedByHover = React$1.useRef(false);
|
|
9
|
+
React$1.useEffect(() => () => clearTimeout(timer.current), []);
|
|
10
|
+
return React$1.useMemo(() => ({
|
|
11
|
+
timer,
|
|
12
|
+
openedByHover,
|
|
13
|
+
closedAt,
|
|
14
|
+
closedByHover
|
|
15
|
+
}), []);
|
|
16
|
+
}
|
|
17
|
+
/** How long after a close a focus on the trigger counts as focus returning. */
|
|
18
|
+
var RETURN_FOCUS_WINDOW_MS = 400;
|
|
19
|
+
var passThrough = {
|
|
20
|
+
onOpenChange: () => {},
|
|
21
|
+
triggerProps: (props) => props,
|
|
22
|
+
contentProps: (props) => props
|
|
23
|
+
};
|
|
24
|
+
var PopoverHoverContext = React$1.createContext(passThrough);
|
|
25
|
+
function usePopoverHoverContext() {
|
|
26
|
+
return React$1.useContext(PopoverHoverContext);
|
|
27
|
+
}
|
|
28
|
+
function chain(own, theirs) {
|
|
29
|
+
return (event) => {
|
|
30
|
+
theirs?.(event);
|
|
31
|
+
own(event);
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Hover-to-open for a Radix popover. Opening and closing are delayed so the
|
|
36
|
+
* pointer can cross the gap between trigger and content; only a mouse hovers
|
|
37
|
+
* (a touch "enter" is followed by the click, which toggles as usual).
|
|
38
|
+
*/
|
|
39
|
+
function usePopoverHover({ enabled, open, setOpen, openDelay, closeDelay, shared, replaced }) {
|
|
40
|
+
const own = useHoverRefs();
|
|
41
|
+
const { timer, openedByHover, closedAt, closedByHover } = shared ?? own;
|
|
42
|
+
const pinning = React$1.useRef(false);
|
|
43
|
+
return React$1.useMemo(() => {
|
|
44
|
+
const schedule = (next, delay) => {
|
|
45
|
+
clearTimeout(timer.current);
|
|
46
|
+
timer.current = setTimeout(() => {
|
|
47
|
+
openedByHover.current = next;
|
|
48
|
+
closedByHover.current = true;
|
|
49
|
+
setOpen(next, true);
|
|
50
|
+
}, delay);
|
|
51
|
+
};
|
|
52
|
+
const show = () => {
|
|
53
|
+
if (!open) schedule(true, openDelay);
|
|
54
|
+
else clearTimeout(timer.current);
|
|
55
|
+
};
|
|
56
|
+
const hide = () => {
|
|
57
|
+
if (openedByHover.current) schedule(false, closeDelay);
|
|
58
|
+
else if (!open) clearTimeout(timer.current);
|
|
59
|
+
};
|
|
60
|
+
const onOpenChange = (next) => {
|
|
61
|
+
if (!next && pinning.current) {
|
|
62
|
+
pinning.current = false;
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
clearTimeout(timer.current);
|
|
66
|
+
openedByHover.current = false;
|
|
67
|
+
closedByHover.current = false;
|
|
68
|
+
if (!next) closedAt.current = Date.now();
|
|
69
|
+
setOpen(next);
|
|
70
|
+
};
|
|
71
|
+
const onFocus = () => {
|
|
72
|
+
if (Date.now() - closedAt.current > RETURN_FOCUS_WINDOW_MS) show();
|
|
73
|
+
};
|
|
74
|
+
const keepFocus = (e) => {
|
|
75
|
+
if (replaced?.() || enabled && closedByHover.current) e.preventDefault();
|
|
76
|
+
};
|
|
77
|
+
if (!enabled) return {
|
|
78
|
+
...passThrough,
|
|
79
|
+
onOpenChange,
|
|
80
|
+
contentProps: (props) => ({
|
|
81
|
+
...props,
|
|
82
|
+
onCloseAutoFocus: chain(keepFocus, props.onCloseAutoFocus)
|
|
83
|
+
})
|
|
84
|
+
};
|
|
85
|
+
const isMouse = (event) => event.pointerType === "mouse";
|
|
86
|
+
return {
|
|
87
|
+
onOpenChange,
|
|
88
|
+
triggerProps: (props) => ({
|
|
89
|
+
...props,
|
|
90
|
+
onPointerEnter: chain((e) => isMouse(e) && show(), props.onPointerEnter),
|
|
91
|
+
onPointerLeave: chain((e) => isMouse(e) && hide(), props.onPointerLeave),
|
|
92
|
+
onFocus: chain(onFocus, props.onFocus),
|
|
93
|
+
onBlur: chain(hide, props.onBlur),
|
|
94
|
+
onClick: chain(() => {
|
|
95
|
+
if (open && openedByHover.current) {
|
|
96
|
+
clearTimeout(timer.current);
|
|
97
|
+
openedByHover.current = false;
|
|
98
|
+
pinning.current = true;
|
|
99
|
+
queueMicrotask(() => {
|
|
100
|
+
pinning.current = false;
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}, props.onClick)
|
|
104
|
+
}),
|
|
105
|
+
contentProps: (props) => ({
|
|
106
|
+
...props,
|
|
107
|
+
onPointerEnter: chain(() => clearTimeout(timer.current), props.onPointerEnter),
|
|
108
|
+
onPointerLeave: chain((e) => isMouse(e) && hide(), props.onPointerLeave),
|
|
109
|
+
onOpenAutoFocus: chain((e) => openedByHover.current && e.preventDefault(), props.onOpenAutoFocus),
|
|
110
|
+
onCloseAutoFocus: chain(keepFocus, props.onCloseAutoFocus)
|
|
111
|
+
})
|
|
112
|
+
};
|
|
113
|
+
}, [
|
|
114
|
+
enabled,
|
|
115
|
+
open,
|
|
116
|
+
setOpen,
|
|
117
|
+
openDelay,
|
|
118
|
+
closeDelay,
|
|
119
|
+
timer,
|
|
120
|
+
openedByHover,
|
|
121
|
+
closedAt,
|
|
122
|
+
closedByHover,
|
|
123
|
+
replaced
|
|
124
|
+
]);
|
|
125
|
+
}
|
|
126
|
+
//#endregion
|
|
127
|
+
export { PopoverHoverContext, useHoverRefs, usePopoverHover, usePopoverHoverContext };
|