@espressif/dashboard-ui-components 1.11.1 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/rules/dashboard-ui-consumption.md +176 -5
- package/.cursor/rules/dashboard-ui-consumption.mdc +163 -4
- package/CHANGELOG.md +1020 -0
- package/README.md +240 -7
- package/THIRD-PARTY-NOTICES.md +2 -1
- package/dist/alert.props-CcKo49Rb.d.ts +44 -0
- package/dist/animation/index.d.ts +3 -0
- package/dist/animation/index.js +3 -0
- package/dist/avatar.props-2q5BsX-R.d.ts +29 -0
- package/dist/button-BK-DIR_L.d.ts +21 -0
- package/dist/button-BxJ7s6sR.d.ts +76 -0
- package/dist/calendar.props-BtCzuWH1.d.ts +12 -0
- package/dist/carousel/index.d.ts +2 -0
- package/dist/carousel/index.js +2 -0
- package/dist/charts/index.d.ts +5 -0
- package/dist/charts/index.js +9 -0
- package/dist/common/app-logo/app-logo.js +1 -1
- package/dist/common/index.d.ts +9 -20
- package/dist/common/my-account-menu/my-account-menu.js +45 -13
- package/dist/common/profile-card/profile-card.js +3 -2
- package/dist/components/accordion/accordion.js +14 -5
- package/dist/components/accordion/index.d.ts +36 -0
- package/dist/components/accordion/index.js +2 -0
- package/dist/components/advanced-search-box/advanced-search-box.js +8 -2
- package/dist/components/advanced-search-box/index.d.ts +29 -0
- package/dist/components/advanced-search-box/index.js +2 -0
- package/dist/components/alert/alert.js +2 -1
- package/dist/components/alert/index.d.ts +12 -0
- package/dist/components/alert/index.js +2 -0
- package/dist/components/anchored-panel/anchored-panel.js +83 -0
- package/dist/components/anchored-panel/index.d.ts +31 -0
- package/dist/components/anchored-panel/index.js +2 -0
- package/dist/components/animated-containers/index.d.ts +13 -0
- package/dist/components/animated-containers/index.js +2 -0
- package/dist/components/async-multi-select/async-multi-select.js +48 -7
- package/dist/components/async-multi-select/index.d.ts +63 -0
- package/dist/components/async-multi-select/index.js +2 -0
- package/dist/components/avatar/avatar.js +11 -4
- package/dist/components/avatar/index.d.ts +8 -0
- package/dist/components/avatar/index.js +2 -0
- package/dist/components/avatar-group/avatar-group.js +35 -0
- package/dist/components/avatar-group/index.d.ts +31 -0
- package/dist/components/avatar-group/index.js +2 -0
- package/dist/components/badge/index.d.ts +14 -0
- package/dist/components/badge/index.js +2 -0
- package/dist/components/breadcrumb/index.d.ts +21 -0
- package/dist/components/breadcrumb/index.js +2 -0
- package/dist/components/bubble/bubble.js +18 -0
- package/dist/components/bubble/index.d.ts +19 -0
- package/dist/components/bubble/index.js +2 -0
- package/dist/components/button/button.js +87 -25
- package/dist/components/button/flash-button.js +9 -3
- package/dist/components/button/index.d.ts +56 -0
- package/dist/components/button/index.js +6 -0
- package/dist/components/button-group/index.d.ts +16 -0
- package/dist/components/button-group/index.js +2 -0
- package/dist/components/calendar/calendar.js +5 -5
- package/dist/components/calendar/index.d.ts +11 -0
- package/dist/components/calendar/index.js +2 -0
- package/dist/components/card/index.d.ts +11 -0
- package/dist/components/card/index.js +2 -0
- package/dist/components/card-rail/card-rail.js +50 -0
- package/dist/components/card-rail/index.d.ts +30 -0
- package/dist/components/card-rail/index.js +2 -0
- package/dist/components/cards/collapsible-card.js +5 -2
- package/dist/components/cards/index.d.ts +16200 -0
- package/dist/components/cards/index.js +8 -0
- package/dist/components/cards/section-card.js +133 -8
- package/dist/components/cards/simple-card.js +5 -2
- package/dist/components/carousel/carousel.js +137 -49
- package/dist/components/carousel/index.d.ts +130 -0
- package/dist/components/carousel/index.js +2 -0
- package/dist/components/category-card/category-card.js +111 -0
- package/dist/components/category-card/index.d.ts +55 -0
- package/dist/components/category-card/index.js +2 -0
- package/dist/components/chart/area-chart.js +95 -85
- package/dist/components/chart/bar-chart.js +123 -60
- package/dist/components/chart/chart.js +127 -3
- package/dist/components/chart/composed-chart.js +109 -98
- package/dist/components/chart/donut-chart.js +23 -5
- package/dist/components/chart/index.d.ts +732 -0
- package/dist/components/chart/index.js +9 -0
- package/dist/components/chart/line-chart.js +93 -83
- package/dist/components/chart/treemap-chart.js +71 -58
- package/dist/components/check-badge/check-badge.js +25 -0
- package/dist/components/check-badge/index.d.ts +13 -0
- package/dist/components/check-badge/index.js +2 -0
- package/dist/components/checkbox/index.d.ts +8 -0
- package/dist/components/checkbox/index.js +2 -0
- package/dist/components/choice-card/choice-card.js +99 -0
- package/dist/components/choice-card/index.d.ts +41 -0
- package/dist/components/choice-card/index.js +2 -0
- package/dist/components/circular-progress/circular-progress.js +5 -2
- package/dist/components/circular-progress/index.d.ts +23 -0
- package/dist/components/circular-progress/index.js +2 -0
- package/dist/components/code/index.d.ts +40 -0
- package/dist/components/code/index.js +2 -0
- package/dist/components/code-editor/code-editor.js +9 -3
- package/dist/components/code-editor/index.d.ts +82 -0
- package/dist/components/code-editor/index.js +2 -0
- package/dist/components/collapsible/index.d.ts +42 -0
- package/dist/components/collapsible/index.js +2 -0
- package/dist/components/column-panel/column-panel.js +38 -0
- package/dist/components/column-panel/index.d.ts +37 -0
- package/dist/components/column-panel/index.js +3 -0
- package/dist/components/column-panel/use-panel-flag.js +27 -0
- package/dist/components/combobox/index.d.ts +28 -0
- package/dist/components/combobox/index.js +2 -0
- package/dist/components/confirmation-dialog/confirmation-dialog.js +1 -1
- package/dist/components/confirmation-dialog/index.d.ts +40 -0
- package/dist/components/confirmation-dialog/index.js +3 -0
- package/dist/components/content-container/index.d.ts +16 -0
- package/dist/components/content-container/index.js +2 -0
- package/dist/components/copiable-text/index.d.ts +33 -0
- package/dist/components/copiable-text/index.js +2 -0
- package/dist/components/coverflow/_constants/coverflow-poses.js +23 -0
- package/dist/components/coverflow/_constants/coverflow-shapes.js +23 -0
- package/dist/components/coverflow/_hooks/use-coverflow.js +90 -0
- package/dist/components/coverflow/_utils/ring.js +24 -0
- package/dist/components/coverflow/coverflow.js +198 -0
- package/dist/components/coverflow/index.d.ts +105 -0
- package/dist/components/coverflow/index.js +2 -0
- package/dist/components/data-table/data-table.js +9 -2
- package/dist/components/data-table/index.d.ts +120 -0
- package/dist/components/data-table/index.js +3 -0
- package/dist/components/date-picker/date-picker.js +5 -2
- package/dist/components/date-picker/index.d.ts +50 -0
- package/dist/components/date-picker/index.js +2 -0
- package/dist/components/date-range-picker/date-range-picker.js +11 -2
- package/dist/components/date-range-picker/index.d.ts +100 -0
- package/dist/components/date-range-picker/index.js +3 -0
- package/dist/components/date-time-picker/date-time-picker.js +5 -2
- package/dist/components/date-time-picker/index.d.ts +79 -0
- package/dist/components/date-time-picker/index.js +2 -0
- package/dist/components/device-icon/index.d.ts +17 -0
- package/dist/components/device-icon/index.js +2 -0
- package/dist/components/dialog/index.d.ts +38 -0
- package/dist/components/dialog/index.js +2 -0
- package/dist/components/dropdown-menu/index.d.ts +57 -0
- package/dist/components/dropdown-menu/index.js +2 -0
- package/dist/components/dynamic-list/dynamic-list.js +4 -4
- package/dist/components/dynamic-list/index.d.ts +74 -0
- package/dist/components/dynamic-list/index.js +2 -0
- package/dist/components/error-display/index.d.ts +17 -0
- package/dist/components/error-display/index.js +3 -0
- package/dist/components/expandable-text/expandable-text-overlay.js +78 -0
- package/dist/components/expandable-text/expandable-text.js +73 -0
- package/dist/components/expandable-text/index.d.ts +39 -0
- package/dist/components/expandable-text/index.js +2 -0
- package/dist/components/expandable-text/use-clamped.js +23 -0
- package/dist/components/facet-filters/_hooks/use-filter-group.js +51 -0
- package/dist/components/facet-filters/active-filters.js +31 -0
- package/dist/components/facet-filters/filter-group.js +110 -0
- package/dist/components/facet-filters/filters-panel.js +59 -0
- package/dist/components/facet-filters/filters-pill.js +40 -0
- package/dist/components/facet-filters/index.d.ts +104 -0
- package/dist/components/facet-filters/index.js +6 -0
- package/dist/components/facet-filters/use-filters-collapsed.js +21 -0
- package/dist/components/feature-grid/feature-grid.js +115 -0
- package/dist/components/feature-grid/index.d.ts +53 -0
- package/dist/components/feature-grid/index.js +2 -0
- package/dist/components/file-input/file-input.js +9 -3
- package/dist/components/file-input/index.d.ts +78 -0
- package/dist/components/file-input/index.js +2 -0
- package/dist/components/file-upload/file-upload.js +10 -5
- package/dist/components/file-upload/index.d.ts +38 -0
- package/dist/components/file-upload/index.js +2 -0
- package/dist/components/filters-bar/filters-bar.js +5 -1
- package/dist/components/filters-bar/index.d.ts +26 -0
- package/dist/components/filters-bar/index.js +2 -0
- package/dist/components/flip-card/flip-card.js +147 -0
- package/dist/components/flip-card/index.d.ts +43 -0
- package/dist/components/flip-card/index.js +2 -0
- package/dist/components/floating-window/_hooks/use-drag-move.js +76 -0
- package/dist/components/floating-window/floating-window.js +97 -0
- package/dist/components/floating-window/index.d.ts +45 -0
- package/dist/components/floating-window/index.js +2 -0
- package/dist/components/form/index.d.ts +28 -0
- package/dist/components/form/index.js +2 -0
- package/dist/components/fullscreen-dialog/fullscreen-dialog.js +6 -2
- package/dist/components/fullscreen-dialog/index.d.ts +38 -0
- package/dist/components/fullscreen-dialog/index.js +2 -0
- package/dist/components/horizontal-stepper/horizontal-stepper.js +122 -0
- package/dist/components/horizontal-stepper/index.d.ts +70 -0
- package/dist/components/horizontal-stepper/index.js +2 -0
- package/dist/components/icon-avatar/index.d.ts +9 -0
- package/dist/components/icon-avatar/index.js +2 -0
- package/dist/components/icon-text-action-card/icon-text-action-card.js +9 -5
- package/dist/components/icon-text-action-card/index.d.ts +11 -0
- package/dist/components/icon-text-action-card/index.js +2 -0
- package/dist/components/identicon/identicon.js +33 -0
- package/dist/components/identicon/index.d.ts +26 -0
- package/dist/components/identicon/index.js +2 -0
- package/dist/components/illustration/index.d.ts +37 -0
- package/dist/components/illustration/index.js +3 -0
- package/dist/components/index.d.ts +177 -19529
- package/dist/components/index.js +61 -10
- package/dist/components/input/index.d.ts +15 -0
- package/dist/components/input/index.js +3 -0
- package/dist/components/input-group/index.d.ts +35 -0
- package/dist/components/input-group/index.js +2 -0
- package/dist/components/input-group/input-group.js +41 -0
- package/dist/components/input-otp/index.d.ts +63 -0
- package/dist/components/input-otp/index.js +2 -0
- package/dist/components/key-value-manager/index.d.ts +63 -0
- package/dist/components/key-value-manager/index.js +2 -0
- package/dist/components/key-value-manager/key-value-manager-table.js +7 -5
- package/dist/components/label/index.d.ts +8 -0
- package/dist/components/label/index.js +2 -0
- package/dist/components/link/index.d.ts +33 -0
- package/dist/components/link/index.js +2 -0
- package/dist/components/list/index.d.ts +9 -0
- package/dist/components/list/index.js +3 -0
- package/dist/components/list/list-item.utils.js +1 -1
- package/dist/components/list/list.js +3 -1
- package/dist/components/list-details/index.d.ts +51 -0
- package/dist/components/list-details/index.js +2 -0
- package/dist/components/list-details/list-details.js +5 -2
- package/dist/components/lottie-animation-container/index.d.ts +10 -0
- package/dist/components/lottie-animation-container/index.js +2 -0
- package/dist/components/lottie-animation-container/lottie-animation-container.js +22 -3
- package/dist/components/lottie-animations/index.d.ts +8 -0
- package/dist/components/lottie-animations/index.js +2 -0
- package/dist/components/markdown-content/index.d.ts +32 -0
- package/dist/components/markdown-content/index.js +2 -0
- package/dist/components/media-card/index.d.ts +125 -0
- package/dist/components/media-card/index.js +4 -0
- package/dist/components/media-card/media-card-image.js +59 -0
- package/dist/components/media-card/media-card-reveal.js +76 -0
- package/dist/components/media-card/media-card.classes.js +37 -0
- package/dist/components/media-card/media-card.js +91 -0
- package/dist/components/media-stage/index.d.ts +41 -0
- package/dist/components/media-stage/index.js +2 -0
- package/dist/components/media-stage/media-stage.js +48 -0
- package/dist/components/menu/index.d.ts +14 -0
- package/dist/components/menu/index.js +2 -0
- package/dist/components/message-scroller/_hooks/use-follow-bottom.js +85 -0
- package/dist/components/message-scroller/index.d.ts +29 -0
- package/dist/components/message-scroller/index.js +2 -0
- package/dist/components/message-scroller/message-scroller.js +65 -0
- package/dist/components/mini-bar-chart/index.d.ts +40 -0
- package/dist/components/mini-bar-chart/index.js +2 -0
- package/dist/components/mini-bar-chart/mini-bar-chart.js +93 -0
- package/dist/components/monospace-content/index.d.ts +43 -0
- package/dist/components/monospace-content/index.js +2 -0
- package/dist/components/monospace-content/monospace-content.js +1 -1
- package/dist/components/nav-bar/index.d.ts +148 -0
- package/dist/components/nav-bar/index.js +2 -0
- package/dist/components/nav-bar/nav-bar-details-panel.js +158 -44
- package/dist/components/nav-bar/nav-bar-mobile-menu.js +93 -27
- package/dist/components/nav-bar/nav-bar.js +256 -138
- package/dist/components/nav-bar/use-nav-bar-hover-details.js +80 -0
- package/dist/components/nav-bar/use-nav-bar-overflow.js +5 -5
- package/dist/components/notice-strip/index.d.ts +32 -0
- package/dist/components/notice-strip/index.js +2 -0
- package/dist/components/notice-strip/notice-strip.js +57 -0
- package/dist/components/option-card-group/index.d.ts +50 -0
- package/dist/components/option-card-group/index.js +2 -0
- package/dist/components/option-card-group/option-card-group.js +76 -0
- package/dist/components/overflow-badge-list/index.d.ts +63 -0
- package/dist/components/overflow-badge-list/index.js +2 -0
- package/dist/components/overflow-badge-list/overflow-badge-list.js +78 -19
- package/dist/components/page-banner/index.d.ts +33 -0
- package/dist/components/page-banner/index.js +2 -0
- package/dist/components/page-banner/page-banner.js +56 -0
- package/dist/components/page-container/index.d.ts +20 -0
- package/dist/components/page-container/index.js +3 -0
- package/dist/components/page-container/page-container.js +5 -5
- package/dist/components/pagination/index.d.ts +31 -0
- package/dist/components/pagination/index.js +3 -0
- package/dist/components/popover/index.d.ts +60 -0
- package/dist/components/popover/index.js +3 -0
- package/dist/components/preview-card/index.d.ts +24 -0
- package/dist/components/preview-card/index.js +2 -0
- package/dist/components/progress-bar/index.d.ts +32 -0
- package/dist/components/progress-bar/index.js +2 -0
- package/dist/components/progress-bar/progress-bar.js +22 -6
- package/dist/components/radio-group/index.d.ts +24 -0
- package/dist/components/radio-group/index.js +2 -0
- package/dist/components/rank-numeral/index.d.ts +30 -0
- package/dist/components/rank-numeral/index.js +2 -0
- package/dist/components/rank-numeral/rank-numeral.js +26 -0
- package/dist/components/reaction-button/index.d.ts +32 -0
- package/dist/components/reaction-button/index.js +2 -0
- package/dist/components/reaction-button/reaction-button.js +50 -0
- package/dist/components/readout/index.d.ts +31 -0
- package/dist/components/readout/index.js +2 -0
- package/dist/components/readout/readout.js +63 -0
- package/dist/components/requirement-list/index.d.ts +52 -0
- package/dist/components/requirement-list/index.js +2 -0
- package/dist/components/requirement-list/requirement-list.js +29 -8
- package/dist/components/resizable/index.d.ts +31 -0
- package/dist/components/resizable/index.js +4 -0
- package/dist/components/resizable/resizable-group.js +23 -0
- package/dist/components/resizable/resizable-panel.js +28 -0
- package/dist/components/resizable/resizable-separator.js +24 -0
- package/dist/components/reveal/index.d.ts +23 -0
- package/dist/components/reveal/index.js +2 -0
- package/dist/components/reveal/reveal.js +24 -0
- package/dist/components/scroll-area/index.d.ts +27 -0
- package/dist/components/scroll-area/index.js +2 -0
- package/dist/components/scrollable-sections/index.d.ts +58 -0
- package/dist/components/scrollable-sections/index.js +2 -0
- package/dist/components/scrollable-sections/scrollable-sections.js +11 -3
- package/dist/components/search-box/index.d.ts +32 -0
- package/dist/components/search-box/index.js +2 -0
- package/dist/components/search-box/search-box.js +18 -3
- package/dist/components/search-field-shell.js +1 -1
- package/dist/components/select/index.d.ts +44 -0
- package/dist/components/select/index.js +2 -0
- package/dist/components/selectable-card-list/checkbox-card-list.js +5 -3
- package/dist/components/selectable-card-list/index.d.ts +76 -0
- package/dist/components/selectable-card-list/index.js +2 -0
- package/dist/components/selectable-card-list/radio-card-list.js +12 -6
- package/dist/components/selectable-card-list/selectable-card-list-shared.js +24 -12
- package/dist/components/selectable-card-list/selectable-card-list.js +12 -3
- package/dist/components/separator/index.d.ts +24 -0
- package/dist/components/separator/index.js +2 -0
- package/dist/components/share-menu/index.d.ts +55 -0
- package/dist/components/share-menu/index.js +2 -0
- package/dist/components/share-menu/share-marks.js +31 -0
- package/dist/components/share-menu/share-menu.js +140 -0
- package/dist/components/share-menu/share-urls.js +15 -0
- package/dist/components/sheet/index.d.ts +41 -0
- package/dist/components/sheet/index.js +2 -0
- package/dist/components/showcase-card/index.d.ts +53 -0
- package/dist/components/showcase-card/index.js +2 -0
- package/dist/components/showcase-card/showcase-card.js +75 -0
- package/dist/components/sidebar/index.d.ts +109 -0
- package/dist/components/sidebar/index.js +4 -0
- package/dist/components/sidebar/sidebar.js +56 -40
- package/dist/components/simple-clickable-card/index.d.ts +11 -0
- package/dist/components/simple-clickable-card/index.js +2 -0
- package/dist/components/simple-clickable-card/simple-clickable-card-shared.js +2 -2
- package/dist/components/simple-clickable-card/simple-clickable-card.js +5 -2
- package/dist/components/simple-info-card/index.d.ts +25 -0
- package/dist/components/simple-info-card/index.js +2 -0
- package/dist/components/simple-info-card/simple-info-card.js +6 -3
- package/dist/components/simple-list/index.d.ts +63 -0
- package/dist/components/simple-list/index.js +2 -0
- package/dist/components/simple-list/simple-list.js +3 -1
- package/dist/components/simple-paginated-list/index.d.ts +20 -0
- package/dist/components/simple-paginated-list/index.js +2 -0
- package/dist/components/simplified-date/index.d.ts +18 -0
- package/dist/components/simplified-date/index.js +2 -0
- package/dist/components/skeleton/index.d.ts +5 -0
- package/dist/components/skeleton/index.js +2 -0
- package/dist/components/skeletons/index.d.ts +11 -0
- package/dist/components/skeletons/index.js +2 -0
- package/dist/components/sort-menu/index.d.ts +34 -0
- package/dist/components/sort-menu/index.js +2 -0
- package/dist/components/sort-menu/sort-menu.js +39 -0
- package/dist/components/spinner/index.d.ts +15 -0
- package/dist/components/spinner/index.js +2 -0
- package/dist/components/stat-card/index.d.ts +43 -0
- package/dist/components/stat-card/index.js +2 -0
- package/dist/components/stat-card/stat-card.js +31 -12
- package/dist/components/status-badge/index.d.ts +24 -0
- package/dist/components/status-badge/index.js +2 -0
- package/dist/components/status-badge/status-badge.js +3 -2
- package/dist/components/status-card-list/index.d.ts +24 -0
- package/dist/components/status-card-list/index.js +2 -0
- package/dist/components/status-card-list/status-card-list.js +8 -4
- package/dist/components/step-tabs/index.d.ts +94 -0
- package/dist/components/step-tabs/index.js +2 -0
- package/dist/components/step-tabs/step-tabs.js +202 -0
- package/dist/components/style-scope/index.d.ts +32 -0
- package/dist/components/style-scope/index.js +2 -0
- package/dist/components/style-scope/style-scope.js +49 -0
- package/dist/components/switch/index.d.ts +15 -0
- package/dist/components/switch/index.js +2 -0
- package/dist/components/table/index.d.ts +18 -0
- package/dist/components/table/index.js +2 -0
- package/dist/components/tabs/index.d.ts +103 -0
- package/dist/components/tabs/index.js +2 -0
- package/dist/components/tag/index.d.ts +31 -0
- package/dist/components/tag/index.js +2 -0
- package/dist/components/tag/tag.js +79 -28
- package/dist/components/tag-input/index.d.ts +36 -0
- package/dist/components/tag-input/index.js +2 -0
- package/dist/components/tag-input/tag-input.js +10 -4
- package/dist/components/text-effects/index.d.ts +53 -0
- package/dist/components/text-effects/index.js +6 -0
- package/dist/components/textarea/index.d.ts +16 -0
- package/dist/components/textarea/index.js +2 -0
- package/dist/components/thumbnail-strip/index.d.ts +42 -0
- package/dist/components/thumbnail-strip/index.js +2 -0
- package/dist/components/thumbnail-strip/thumbnail-strip.js +124 -0
- package/dist/components/thumbnail-strip/use-scroll-edges.js +41 -0
- package/dist/components/time-picker/index.d.ts +13 -0
- package/dist/components/time-picker/index.js +2 -0
- package/dist/components/timeline/index.d.ts +39 -0
- package/dist/components/timeline/index.js +2 -0
- package/dist/components/timeline/timeline.js +85 -0
- package/dist/components/toast/index.d.ts +56 -0
- package/dist/components/toast/index.js +2 -0
- package/dist/components/toast/toast.js +42 -32
- package/dist/components/togglable-items-list/index.d.ts +28 -0
- package/dist/components/togglable-items-list/index.js +2 -0
- package/dist/components/toggle-group/index.d.ts +35 -0
- package/dist/components/toggle-group/index.js +2 -0
- package/dist/components/toolbar/index.d.ts +58 -0
- package/dist/components/toolbar/index.js +3 -0
- package/dist/components/toolbar/toolbar-button.js +40 -0
- package/dist/components/toolbar/toolbar.js +56 -0
- package/dist/components/tooltip/index.d.ts +29 -0
- package/dist/components/tooltip/index.js +3 -0
- package/dist/components/tooltip/tooltip.js +12 -2
- package/dist/components/transfer-list/index.d.ts +36 -0
- package/dist/components/transfer-list/index.js +2 -0
- package/dist/components/transfer-list/transfer-list.js +1 -1
- package/dist/components/truncated-line-with-tooltip/index.d.ts +22 -0
- package/dist/components/truncated-line-with-tooltip/index.js +2 -0
- package/dist/components/truncated-line-with-tooltip/truncated-line-with-tooltip.js +26 -8
- package/dist/components/typography/index.d.ts +19 -0
- package/dist/components/typography/index.js +3 -0
- package/dist/components/use-mobile/index.d.ts +3 -0
- package/dist/components/use-mobile/index.js +2 -0
- package/dist/components/user-type-badge/index.d.ts +39 -0
- package/dist/components/user-type-badge/index.js +3 -0
- package/dist/components/user-type-badge/user-type-badge.js +2 -1
- package/dist/components/vertical-stepper/index.d.ts +7 -0
- package/dist/components/vertical-stepper/index.js +2 -0
- package/dist/components/vertical-stepper/vertical-stepper.js +33 -6
- package/dist/components/view-toggle/index.d.ts +38 -0
- package/dist/components/view-toggle/index.js +2 -0
- package/dist/components/view-toggle/view-toggle.js +56 -0
- package/dist/core/animate-ui/components/animate/code.js +83 -9
- package/dist/core/animate-ui/components/animate/tabs.js +234 -19
- package/dist/core/animate-ui/components/animate/tooltip.js +10 -2
- package/dist/core/animate-ui/components/base/preview-card.js +20 -3
- package/dist/core/animate-ui/components/buttons/copy.js +12 -6
- package/dist/core/animate-ui/components/radix/dialog.js +17 -3
- package/dist/core/animate-ui/components/radix/dropdown-menu.js +26 -9
- package/dist/core/animate-ui/components/radix/sheet.js +20 -4
- package/dist/core/animate-ui/components/radix/sidebar.js +9 -9
- package/dist/core/animate-ui/components/radix/toggle-group.js +103 -13
- package/dist/core/animate-ui/components/radix/toggle.js +5 -5
- package/dist/core/animate-ui/primitives/animate/code-block.js +31 -4
- package/dist/core/animate-ui/primitives/animate/shiki-highlighter.js +5 -2
- package/dist/core/animate-ui/primitives/animate/tabs.js +7 -4
- package/dist/core/animate-ui/primitives/animate/tooltip.js +10 -3
- package/dist/core/animate-ui/primitives/base/preview-card.js +2 -2
- package/dist/core/animate-ui/primitives/base/progress.js +1 -1
- package/dist/core/animate-ui/primitives/base/radio.js +3 -3
- package/dist/core/animate-ui/primitives/effects/highlight.js +1 -0
- package/dist/core/animate-ui/primitives/radix/accordion.js +1 -1
- package/dist/core/animate-ui/primitives/radix/dialog.js +6 -3
- package/dist/core/animate-ui/primitives/radix/dropdown-menu.js +2 -2
- package/dist/core/animate-ui/primitives/radix/sheet.js +7 -3
- package/dist/core/animate-ui/primitives/radix/switch.js +2 -2
- package/dist/core/animate-ui/primitives/radix/toggle-group.js +2 -2
- package/dist/core/badge.js +5 -2
- package/dist/core/breadcrumb.js +1 -1
- package/dist/core/button/button.js +8 -8
- package/dist/core/button/craft-button.js +8 -2
- package/dist/core/button.js +17 -7
- package/dist/core/card.js +23 -5
- package/dist/core/combobox/combobox.js +8 -2
- package/dist/core/command.js +3 -3
- package/dist/core/form.js +1 -1
- package/dist/core/hooks/use-nested-layer-press-guard.js +46 -0
- package/dist/core/hooks/use-on-screen.js +33 -0
- package/dist/core/hooks/use-prefers-reduced-motion.js +19 -0
- package/dist/core/hooks/use-scroll-overflow.js +20 -0
- package/dist/core/index.d.ts +30 -5
- package/dist/core/index.js +5 -2
- package/dist/core/input/input-password.js +13 -9
- package/dist/core/input/input.js +38 -12
- package/dist/core/input-otp/input-otp.js +9 -5
- package/dist/core/popover-group.js +48 -0
- package/dist/core/popover-hover.js +127 -0
- package/dist/core/popover.js +75 -6
- package/dist/core/select.js +50 -19
- package/dist/core/table.js +5 -3
- package/dist/core/textarea/textarea.js +11 -3
- package/dist/data-table/index.d.ts +4 -0
- package/dist/data-table/index.js +3 -0
- package/dist/date/index.d.ts +11 -0
- package/dist/date/index.js +7 -0
- package/dist/forms/index.d.ts +4 -0
- package/dist/forms/index.js +2 -0
- package/dist/icon-avatar.props-RYtw2eSW.d.ts +31 -0
- package/dist/icon-text-action-card.props-B2ggncUK.d.ts +53 -0
- package/dist/index.d.ts +169 -15
- package/dist/index.js +63 -10
- package/dist/input-CYI1hhGc.d.ts +38 -0
- package/dist/layouts/index.d.ts +132 -8
- package/dist/layouts/index.js +3 -1
- package/dist/layouts/minimal-workspace-layout/minimal-workspace-layout-context.js +5 -0
- package/dist/layouts/minimal-workspace-layout/minimal-workspace-layout.js +404 -0
- package/dist/layouts/minimal-workspace-layout/rail-logo.js +90 -0
- package/dist/layouts/minimal-workspace-layout/sidebar-trigger.js +42 -0
- package/dist/layouts/shared/account-menu-props.js +21 -0
- package/dist/layouts/shared/footer-branding.js +34 -0
- package/dist/layouts/shared/sidebar-logo.js +59 -0
- package/dist/layouts/workspace-layout/account-menu/account-menu.js +9 -3
- package/dist/layouts/workspace-layout/footer/footer.js +1 -1
- package/dist/layouts/workspace-layout/header/header.js +1 -1
- package/dist/layouts/workspace-layout/workspace-layout.js +28 -80
- package/dist/{list.props-x1j3CbcF.d.ts → list.props-DP_xPTqU.d.ts} +2 -1
- package/dist/markdown/index.d.ts +11 -0
- package/dist/markdown/index.js +5 -0
- package/dist/my-account-menu.props-C7DK71WC.d.ts +67 -0
- package/dist/page-container.props-JutTvKFq.d.ts +48 -0
- package/dist/resizable.props-RxFY5tm_.d.ts +44 -0
- package/dist/section-card-B7c5uc08.d.ts +84 -0
- package/dist/simple-clickable-card.props-BrPCw7CR.d.ts +51 -0
- package/dist/slot-DGErA9zi.d.ts +10 -0
- package/dist/status-badge.props-lKlEOfRt.d.ts +32 -0
- package/dist/style-axes-DSQ2DGc5.d.ts +133 -0
- package/dist/toast/index.d.ts +6 -0
- package/dist/toast/index.js +2 -0
- package/dist/tooltip-C0bYa8a3.d.ts +37 -0
- package/dist/{types-DtUxK-Am.d.ts → types-CkXflqg7.d.ts} +31 -1
- package/dist/utils/cn.js +6 -1
- package/dist/utils/color.js +35 -10
- package/dist/utils/index.d.ts +18 -2
- package/dist/utils/index.js +4 -1
- package/dist/utils/silver-shine.js +16 -1
- package/dist/utils/style-axes.js +227 -0
- package/dist/utils/variant.js +104 -8
- package/dist/utils/view-transition.js +21 -0
- package/dist/variant-D81RhpbR.d.ts +104 -0
- package/dist/vertical-stepper.props-BXYcbW70.d.ts +29 -0
- package/package.json +52 -6
- package/src/styles/colors.css +100 -4
- package/src/styles/globals.css +8 -131
- package/src/styles/style-axes.css +21 -0
- package/src/styles/theme.css +696 -0
- package/dist/app-logo.props-Ct7QBdTd.d.ts +0 -40
- package/dist/popover-ByLD3-Qv.d.ts +0 -204
|
@@ -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 };
|
package/dist/core/popover.js
CHANGED
|
@@ -1,12 +1,79 @@
|
|
|
1
1
|
import { cn } from "../utils/cn.js";
|
|
2
|
+
import { useStyleAxes } from "../utils/style-axes.js";
|
|
3
|
+
import { useControlledState } from "./hooks/use-controlled-state.js";
|
|
4
|
+
import { useNestedLayerPressGuard } from "./hooks/use-nested-layer-press-guard.js";
|
|
5
|
+
import { PopoverHoverContext, usePopoverHover, usePopoverHoverContext } from "./popover-hover.js";
|
|
6
|
+
import { usePopoverGroupContext } from "./popover-group.js";
|
|
2
7
|
import * as React$1 from "react";
|
|
3
8
|
import { jsx } from "react/jsx-runtime";
|
|
4
9
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
5
10
|
//#region src/core/popover.tsx
|
|
6
|
-
|
|
7
|
-
|
|
11
|
+
function Popover({ openOnHover = false, openDelay = 120, closeDelay = 150, open: openProp, defaultOpen, onOpenChange, value, ...props }) {
|
|
12
|
+
const group = usePopoverGroupContext();
|
|
13
|
+
const generatedKey = React$1.useId();
|
|
14
|
+
const key = value ?? generatedKey;
|
|
15
|
+
const [ownOpen, setOwnOpen] = useControlledState({
|
|
16
|
+
value: openProp,
|
|
17
|
+
defaultValue: defaultOpen ?? false,
|
|
18
|
+
onChange: onOpenChange
|
|
19
|
+
});
|
|
20
|
+
const inGroup = group !== null && openProp === void 0;
|
|
21
|
+
const open = inGroup ? group.value === key : ownOpen;
|
|
22
|
+
const setOpen = React$1.useCallback((next, viaHover = false) => {
|
|
23
|
+
if (!inGroup) {
|
|
24
|
+
setOwnOpen(next);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
if (next) group.setValue(key);
|
|
28
|
+
else if (viaHover ? group.valueRef.current !== null : group.valueRef.current === key) group.setValue(null);
|
|
29
|
+
onOpenChange?.(next);
|
|
30
|
+
}, [
|
|
31
|
+
inGroup,
|
|
32
|
+
group,
|
|
33
|
+
key,
|
|
34
|
+
setOwnOpen,
|
|
35
|
+
onOpenChange
|
|
36
|
+
]);
|
|
37
|
+
const replaced = React$1.useCallback(() => inGroup && group.valueRef.current !== null && group.valueRef.current !== key, [
|
|
38
|
+
inGroup,
|
|
39
|
+
group,
|
|
40
|
+
key
|
|
41
|
+
]);
|
|
42
|
+
const hover = usePopoverHover({
|
|
43
|
+
enabled: openOnHover,
|
|
44
|
+
open,
|
|
45
|
+
setOpen,
|
|
46
|
+
openDelay: inGroup && group.value !== null && group.value !== key ? group.switchDelay : openDelay,
|
|
47
|
+
closeDelay,
|
|
48
|
+
shared: inGroup ? group.hover : void 0,
|
|
49
|
+
replaced
|
|
50
|
+
});
|
|
51
|
+
return /* @__PURE__ */ jsx(PopoverHoverContext.Provider, {
|
|
52
|
+
value: hover,
|
|
53
|
+
children: /* @__PURE__ */ jsx(PopoverPrimitive.Root, {
|
|
54
|
+
open,
|
|
55
|
+
onOpenChange: hover.onOpenChange,
|
|
56
|
+
...props
|
|
57
|
+
})
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
var PopoverTrigger = React$1.forwardRef((props, ref) => {
|
|
61
|
+
const hover = usePopoverHoverContext();
|
|
62
|
+
return /* @__PURE__ */ jsx(PopoverPrimitive.Trigger, {
|
|
63
|
+
ref,
|
|
64
|
+
...hover.triggerProps(props)
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
PopoverTrigger.displayName = PopoverPrimitive.Trigger.displayName;
|
|
8
68
|
var PopoverAnchor = PopoverPrimitive.Anchor;
|
|
9
|
-
var PopoverContent = React$1.forwardRef(({ className, align = "center", sideOffset = 4, portal = true, onWheel, onTouchMove, ...props }, ref) => {
|
|
69
|
+
var PopoverContent = React$1.forwardRef(({ className, align = "center", sideOffset = 4, portal = true, onWheel, onTouchMove, onPointerDownOutside, radius, elevation, style, ...props }, ref) => {
|
|
70
|
+
const axes = useStyleAxes({
|
|
71
|
+
radius,
|
|
72
|
+
elevation,
|
|
73
|
+
style
|
|
74
|
+
}, ["radius", "elevation"]);
|
|
75
|
+
const pressGuard = useNestedLayerPressGuard(ref, onPointerDownOutside);
|
|
76
|
+
const hover = usePopoverHoverContext();
|
|
10
77
|
const handleWheel = (event) => {
|
|
11
78
|
onWheel?.(event);
|
|
12
79
|
event.stopPropagation();
|
|
@@ -16,13 +83,15 @@ var PopoverContent = React$1.forwardRef(({ className, align = "center", sideOffs
|
|
|
16
83
|
event.stopPropagation();
|
|
17
84
|
};
|
|
18
85
|
const content = /* @__PURE__ */ jsx(PopoverPrimitive.Content, {
|
|
19
|
-
ref,
|
|
86
|
+
ref: pressGuard.ref,
|
|
87
|
+
onPointerDownOutside: pressGuard.onPointerDownOutside,
|
|
20
88
|
align,
|
|
21
89
|
sideOffset,
|
|
22
90
|
onWheel: handleWheel,
|
|
23
91
|
onTouchMove: handleTouchMove,
|
|
24
|
-
className: cn("z-50 w-72 rounded-2xl border bg-popover p-4 text-popover-foreground shadow-lg outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-
|
|
25
|
-
|
|
92
|
+
className: cn("z-50 w-72 rounded-[var(--espd-own-radius,var(--espd-radius-overlay,var(--radius-2xl)))] border bg-popover p-4 text-popover-foreground shadow-[shadow:var(--espd-own-elevation,var(--espd-elevation-overlay,var(--shadow-lg)))] outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-popover-content-transform-origin)", className),
|
|
93
|
+
style: axes.style,
|
|
94
|
+
...hover.contentProps(props)
|
|
26
95
|
});
|
|
27
96
|
return portal ? /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: content }) : content;
|
|
28
97
|
});
|
package/dist/core/select.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { cn } from "../utils/cn.js";
|
|
2
|
+
import { useStyleAxes } from "../utils/style-axes.js";
|
|
2
3
|
import { FieldLabelRow, fieldHintClassName } from "./field-label-row.js";
|
|
3
4
|
import * as React$1 from "react";
|
|
4
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -9,8 +10,8 @@ var Select = SelectPrimitive.Root;
|
|
|
9
10
|
var SelectGroup = SelectPrimitive.Group;
|
|
10
11
|
var SelectValue = SelectPrimitive.Value;
|
|
11
12
|
var triggerSizeClasses = {
|
|
12
|
-
sm: "h-8 px-3 text-xs",
|
|
13
|
-
default: "h-10 px-3.5 py-2 text-base md:text-sm",
|
|
13
|
+
sm: "h-[var(--espd-control-height-sm,calc(var(--spacing)*8))] px-3 text-xs",
|
|
14
|
+
default: "h-[var(--espd-control-height-lg,calc(var(--spacing)*10))] px-3.5 py-2 text-base md:text-sm",
|
|
14
15
|
lg: "h-12 px-5 text-lg"
|
|
15
16
|
};
|
|
16
17
|
/**
|
|
@@ -19,8 +20,13 @@ var triggerSizeClasses = {
|
|
|
19
20
|
* Input shows matching icon dimensions whatever `size` they share.
|
|
20
21
|
*/
|
|
21
22
|
var triggerIconClassName = "size-4 shrink-0 opacity-50";
|
|
22
|
-
var SelectTrigger = React$1.forwardRef(({ className, children, size = "default", label, required, hintContent, error, errorContent, id, "aria-describedby": ariaDescribedBy, ...props }, ref) => {
|
|
23
|
+
var SelectTrigger = React$1.forwardRef(({ className, children, size = "default", label, required, hintContent, error, errorContent, id, "aria-describedby": ariaDescribedBy, radius, border, style, ...props }, ref) => {
|
|
23
24
|
const autoId = React$1.useId();
|
|
25
|
+
const axes = useStyleAxes({
|
|
26
|
+
radius,
|
|
27
|
+
border,
|
|
28
|
+
style
|
|
29
|
+
}, ["radius", "border"]);
|
|
24
30
|
const hasEnhancedProps = label !== void 0 || required !== void 0 || hintContent !== void 0 || error !== void 0 || errorContent !== void 0;
|
|
25
31
|
const hasError = error || !!errorContent;
|
|
26
32
|
const triggerId = id ?? (hasEnhancedProps ? autoId : void 0);
|
|
@@ -32,7 +38,8 @@ var SelectTrigger = React$1.forwardRef(({ className, children, size = "default",
|
|
|
32
38
|
"aria-required": required || void 0,
|
|
33
39
|
"aria-invalid": hasError || void 0,
|
|
34
40
|
"aria-describedby": describedBy,
|
|
35
|
-
className: cn("flex w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-background ring-offset-background transition-[box-shadow,border-color] duration-200 ease-in-out data-[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 [&>span]:line-clamp-1", triggerSizeClasses[size], hasError && "border-destructive focus-visible:ring-destructive", className),
|
|
41
|
+
className: cn("flex w-full items-center justify-between whitespace-nowrap 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 ring-offset-background transition-[box-shadow,border-color] duration-200 ease-in-out data-[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 [&>span]:line-clamp-1", triggerSizeClasses[size], hasError && "border-destructive focus-visible:ring-destructive", className),
|
|
42
|
+
style: axes.style,
|
|
36
43
|
...props,
|
|
37
44
|
children: [children, /* @__PURE__ */ jsx(SelectPrimitive.Icon, {
|
|
38
45
|
asChild: true,
|
|
@@ -80,20 +87,44 @@ var SelectScrollDownButton = React$1.forwardRef(({ className, ...props }, ref) =
|
|
|
80
87
|
children: /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4" })
|
|
81
88
|
}));
|
|
82
89
|
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
90
|
+
/**
|
|
91
|
+
* When a scroll arrow mounts, Radix scrolls the focused item back into view.
|
|
92
|
+
* Focus only follows a mouse, so a touch swipe or scrollbar drag that starts
|
|
93
|
+
* at the top snaps straight back. Once the focused item leaves the viewport,
|
|
94
|
+
* hand focus to the listbox (as Radix does when the pointer leaves an item).
|
|
95
|
+
*/
|
|
96
|
+
function releaseFocusScrolledOutOfView(event) {
|
|
97
|
+
const viewport = event.currentTarget;
|
|
98
|
+
const focused = document.activeElement;
|
|
99
|
+
if (!(focused instanceof HTMLElement) || !viewport.contains(focused)) return;
|
|
100
|
+
const itemRect = focused.getBoundingClientRect();
|
|
101
|
+
const viewportRect = viewport.getBoundingClientRect();
|
|
102
|
+
if (itemRect.top >= viewportRect.top && itemRect.bottom <= viewportRect.bottom) return;
|
|
103
|
+
viewport.closest("[role=\"listbox\"]")?.focus({ preventScroll: true });
|
|
104
|
+
}
|
|
105
|
+
var SelectContent = React$1.forwardRef(({ className, children, position = "popper", radius, elevation, style, ...props }, ref) => {
|
|
106
|
+
const axes = useStyleAxes({
|
|
107
|
+
radius,
|
|
108
|
+
elevation,
|
|
109
|
+
style
|
|
110
|
+
}, ["radius", "elevation"]);
|
|
111
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs(SelectPrimitive.Content, {
|
|
112
|
+
ref,
|
|
113
|
+
className: cn("relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-[var(--espd-own-radius,var(--espd-radius-overlay,var(--radius-2xl)))] border bg-popover px-1.5 py-2 text-popover-foreground shadow-[shadow:var(--espd-own-elevation,var(--espd-elevation-overlay,var(--shadow-lg)))] outline-none will-change-[opacity,transform] select-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-select-content-transform-origin)", position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className),
|
|
114
|
+
position,
|
|
115
|
+
style: axes.style,
|
|
116
|
+
...props,
|
|
117
|
+
children: [
|
|
118
|
+
/* @__PURE__ */ jsx(SelectScrollUpButton, {}),
|
|
119
|
+
/* @__PURE__ */ jsx(SelectPrimitive.Viewport, {
|
|
120
|
+
className: cn("p-0", position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),
|
|
121
|
+
onScroll: releaseFocusScrolledOutOfView,
|
|
122
|
+
children
|
|
123
|
+
}),
|
|
124
|
+
/* @__PURE__ */ jsx(SelectScrollDownButton, {})
|
|
125
|
+
]
|
|
126
|
+
}) });
|
|
127
|
+
});
|
|
97
128
|
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
98
129
|
var SelectLabel = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(SelectPrimitive.Label, {
|
|
99
130
|
ref,
|
|
@@ -103,7 +134,7 @@ var SelectLabel = React$1.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
103
134
|
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
104
135
|
var SelectItem = React$1.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(SelectPrimitive.Item, {
|
|
105
136
|
ref,
|
|
106
|
-
className: cn("relative flex w-full cursor-default select-none items-center rounded-sm py-2 pl-2.5 pr-9 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className),
|
|
137
|
+
className: cn("relative flex w-full cursor-default select-none items-center rounded-[var(--espd-own-radius,var(--espd-radius-item,var(--radius-sm)))] py-2 pl-2.5 pr-9 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className),
|
|
107
138
|
...props,
|
|
108
139
|
children: [/* @__PURE__ */ jsx("span", {
|
|
109
140
|
className: "absolute right-2.5 flex h-3.5 w-3.5 items-center justify-center",
|
package/dist/core/table.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { cn } from "../utils/cn.js";
|
|
2
|
+
import { densityStyle } from "../utils/style-axes.js";
|
|
2
3
|
import * as React$1 from "react";
|
|
3
4
|
import { jsx } from "react/jsx-runtime";
|
|
4
5
|
//#region src/core/table.tsx
|
|
5
|
-
var Table = React$1.forwardRef(({ className, containerRef, containerClassName, ...props }, ref) => /* @__PURE__ */ jsx("div", {
|
|
6
|
+
var Table = React$1.forwardRef(({ className, containerRef, containerClassName, density, ...props }, ref) => /* @__PURE__ */ jsx("div", {
|
|
6
7
|
ref: containerRef,
|
|
7
8
|
"data-slot": "table-container",
|
|
9
|
+
style: densityStyle(density),
|
|
8
10
|
className: cn("relative w-full overflow-auto", containerClassName),
|
|
9
11
|
children: /* @__PURE__ */ jsx("table", {
|
|
10
12
|
ref,
|
|
@@ -39,13 +41,13 @@ var TableRow = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
39
41
|
TableRow.displayName = "TableRow";
|
|
40
42
|
var TableHead = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("th", {
|
|
41
43
|
ref,
|
|
42
|
-
className: cn("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className),
|
|
44
|
+
className: cn("h-[var(--espd-table-head-height,calc(var(--spacing)*10))] px-[var(--espd-table-cell-padding,calc(var(--spacing)*2))] text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className),
|
|
43
45
|
...props
|
|
44
46
|
}));
|
|
45
47
|
TableHead.displayName = "TableHead";
|
|
46
48
|
var TableCell = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("td", {
|
|
47
49
|
ref,
|
|
48
|
-
className: cn("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className),
|
|
50
|
+
className: cn("p-[var(--espd-table-cell-padding,calc(var(--spacing)*2))] align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className),
|
|
49
51
|
...props
|
|
50
52
|
}));
|
|
51
53
|
TableCell.displayName = "TableCell";
|