@espressif/dashboard-ui-components 1.10.0 → 1.11.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/CHANGELOG.md +65 -0
- package/dist/_vendor/@radix-ui/primitive/dist/index.js +9 -0
- package/dist/_vendor/@radix-ui/react-checkbox/dist/index.js +185 -0
- package/dist/_vendor/@radix-ui/react-compose-refs/dist/index.js +28 -0
- package/dist/_vendor/@radix-ui/react-context/dist/index.js +68 -0
- package/dist/_vendor/@radix-ui/react-presence/dist/index.js +127 -0
- package/dist/_vendor/@radix-ui/react-primitive/dist/index.js +42 -0
- package/dist/_vendor/@radix-ui/react-use-controllable-state/dist/index.js +55 -0
- package/dist/_vendor/@radix-ui/react-use-layout-effect/dist/index.js +5 -0
- package/dist/_vendor/@radix-ui/react-use-previous/dist/index.js +17 -0
- package/dist/_vendor/@radix-ui/react-use-size/dist/index.js +39 -0
- package/dist/_vendor/lottie-react/build/index.es.js +537 -0
- package/dist/_vendor/lottie-web/build/player/lottie.js +14149 -0
- package/dist/_virtual/_rolldown/runtime.js +24 -0
- package/dist/assets/illustrations/bulb-cloud-drawing.js +4 -0
- package/dist/assets/illustrations/rm-dashboard-update.js +4 -0
- package/dist/assets/illustrations/rm-data-download.js +4 -0
- package/dist/assets/logos/espressif/espressif-no-text.js +4 -0
- package/dist/assets/logos/espressif/espressif-with-text-dm.js +4 -0
- package/dist/assets/logos/espressif/espressif-with-text.js +4 -0
- package/dist/assets/logos/insights/insights-no-text.js +4 -0
- package/dist/assets/logos/insights/insights-with-text-dm.js +4 -0
- package/dist/assets/logos/insights/insights-with-text.js +4 -0
- package/dist/assets/logos/launchpad/launchpad-no-text-dm.js +4 -0
- package/dist/assets/logos/launchpad/launchpad-no-text.js +4 -0
- package/dist/assets/logos/launchpad/launchpad-with-text-dm.js +4 -0
- package/dist/assets/logos/launchpad/launchpad-with-text.js +4 -0
- package/dist/assets/logos/private-agents/private-agents-no-text.js +4 -0
- package/dist/assets/logos/private-agents/private-agents-with-text-dm.js +4 -0
- package/dist/assets/logos/private-agents/private-agents-with-text.js +4 -0
- package/dist/assets/logos/rainmaker/rainmaker-no-text.js +4 -0
- package/dist/assets/logos/rainmaker/rainmaker-with-text-dm.js +4 -0
- package/dist/assets/logos/rainmaker/rainmaker-with-text.js +4 -0
- package/dist/assets/logos/rainmaker-classic/rainmaker-classic-no-text-dm.js +4 -0
- package/dist/assets/logos/rainmaker-classic/rainmaker-classic-no-text.js +4 -0
- package/dist/assets/logos/rainmaker-classic/rainmaker-classic-with-text-dm.js +4 -0
- package/dist/assets/logos/rainmaker-classic/rainmaker-classic-with-text.js +4 -0
- package/dist/assets/logos/rainmaker-neo/rainmaker-neo-no-text.js +4 -0
- package/dist/assets/logos/rainmaker-neo/rainmaker-neo-with-text-dm.js +4 -0
- package/dist/assets/logos/rainmaker-neo/rainmaker-neo-with-text.js +4 -0
- package/dist/assets/logos/ui-components/ui-components-no-text.js +4 -0
- package/dist/assets/logos/ui-components/ui-components-with-text-dm.js +4 -0
- package/dist/assets/logos/ui-components/ui-components-with-text.js +4 -0
- package/dist/assets/logos/zerocode/zerocode-no-text.js +4 -0
- package/dist/assets/logos/zerocode/zerocode-with-text-dm.js +4 -0
- package/dist/assets/logos/zerocode/zerocode-with-text.js +4 -0
- package/dist/assets/logos/zerocode-ai/zerocode-ai-no-text.js +4 -0
- package/dist/assets/logos/zerocode-ai/zerocode-ai-with-text-dm.js +4 -0
- package/dist/assets/logos/zerocode-ai/zerocode-ai-with-text.js +4 -0
- package/dist/common/animated-rainmaker-logo/animated-rainmaker-logo.constants.js +18 -0
- package/dist/common/animated-rainmaker-logo/animated-rainmaker-logo.js +24 -0
- package/dist/common/animated-rainmaker-logo/rainmaker-c-logo.js +50 -0
- package/dist/common/animated-rainmaker-logo/use-animated-rainmaker-logo-animation.js +85 -0
- package/dist/common/app-logo/app-logo.js +59 -0
- package/dist/common/app-logo/logo-config.js +297 -0
- package/dist/common/copyright-card/copyright-card.js +39 -0
- package/dist/common/footer-card/footer-card.js +22 -0
- package/dist/common/index.js +8 -8
- package/dist/common/my-account-menu/my-account-menu.js +32 -0
- package/dist/common/page-loader/page-loader.js +21 -0
- package/dist/common/profile-card/profile-card.js +26 -0
- package/dist/components/accordion/accordion.js +52 -0
- package/dist/components/advanced-search-box/advanced-search-box.js +106 -0
- package/dist/components/alert/alert.js +85 -0
- package/dist/components/animated-containers/pop-collection-item.js +28 -0
- package/dist/components/async-multi-select/async-multi-select.js +199 -0
- package/dist/components/avatar/avatar.js +41 -0
- package/dist/components/button/button.js +191 -0
- package/dist/components/button/flash-button.js +110 -0
- package/dist/components/button/invert-button.js +13 -0
- package/dist/components/calendar/calendar.js +105 -0
- package/dist/components/cards/animated-card/animated-card-animations.js +57 -0
- package/dist/components/cards/animated-card/animated-card.js +42 -0
- package/dist/components/cards/basic-details-card.js +46 -0
- package/dist/components/cards/collapsible-card.js +48 -0
- package/dist/components/cards/no-data-card/no-data-card.js +30 -0
- package/dist/components/cards/section-card.js +265 -0
- package/dist/components/cards/simple-card.js +24 -0
- package/dist/components/carousel/carousel.js +158 -0
- package/dist/components/chart/area-chart.js +135 -0
- package/dist/components/chart/bar-chart.js +151 -0
- package/dist/components/chart/chart-colors.js +85 -0
- package/dist/components/chart/chart-series-data.js +53 -0
- package/dist/components/chart/chart.js +147 -0
- package/dist/components/chart/chart.types.js +7 -0
- package/dist/components/chart/composed-chart.js +182 -0
- package/dist/components/chart/donut-chart.js +177 -0
- package/dist/components/chart/line-chart.js +137 -0
- package/dist/components/chart/treemap-chart.js +294 -0
- package/dist/components/circular-progress/circular-progress.js +125 -0
- package/dist/components/code-editor/code-editor.js +235 -0
- package/dist/components/code-editor/code-editor.utils.js +122 -0
- package/dist/components/code-editor/use-code-editor-keys.js +79 -0
- package/dist/components/code-editor/use-highlighted-html.js +102 -0
- package/dist/components/confirmation-dialog/confirmation-dialog.js +72 -0
- package/dist/components/content-container/content-container.js +20 -0
- package/dist/components/copiable-text/copiable-text.js +46 -0
- package/dist/components/data-table/data-table.js +186 -0
- package/dist/components/data-table/responsive-columns.js +65 -0
- package/dist/components/data-table/row-actions.js +27 -0
- package/dist/components/data-table/sticky-columns.js +71 -0
- package/dist/components/data-table/table-body.js +57 -0
- package/dist/components/data-table/table-header.js +21 -0
- package/dist/components/date-picker/date-picker.js +95 -0
- package/dist/components/date-range-picker/date-range-picker.js +301 -0
- package/dist/components/date-range-picker/presets.js +174 -0
- package/dist/components/date-time-picker/date-time-picker.js +144 -0
- package/dist/components/date-time-picker/date-time-picker.utils.js +32 -0
- package/dist/components/device-icon/device-icon.config.js +194 -0
- package/dist/components/device-icon/device-icon.js +17 -0
- package/dist/components/device-icon/icons/air-conditioner.js +22 -0
- package/dist/components/device-icon/icons/blind.js +24 -0
- package/dist/components/device-icon/icons/dimmer.js +14 -0
- package/dist/components/device-icon/icons/extension-board.js +42 -0
- package/dist/components/device-icon/icons/fan.js +14 -0
- package/dist/components/device-icon/icons/knob.js +14 -0
- package/dist/components/device-icon/icons/led-strip.js +22 -0
- package/dist/components/device-icon/icons/light.js +14 -0
- package/dist/components/device-icon/icons/refrigerator.js +18 -0
- package/dist/components/device-icon/icons/retro-switch.js +18 -0
- package/dist/components/device-icon/icons/router.js +20 -0
- package/dist/components/device-icon/icons/sensor.js +20 -0
- package/dist/components/device-icon/icons/socket.js +19 -0
- package/dist/components/device-icon/icons/switch.js +19 -0
- package/dist/components/device-icon/icons/thermostat.js +21 -0
- package/dist/components/device-icon/icons/washing-machine.js +22 -0
- package/dist/components/device-icon/match-device.js +61 -0
- package/dist/components/dynamic-list/dynamic-list.js +445 -0
- package/dist/components/error-display/full-size-error/full-size-error.js +20 -0
- package/dist/components/error-display/inline-error/inline-error.js +12 -0
- package/dist/components/file-input/file-input.js +318 -0
- package/dist/components/file-upload/file-upload.js +317 -0
- package/dist/components/filters-bar/filters-bar.js +36 -0
- package/dist/components/fullscreen-dialog/fullscreen-dialog.js +68 -0
- package/dist/components/icon-avatar/icon-avatar.js +130 -0
- package/dist/components/icon-text-action-card/icon-text-action-card.js +190 -0
- package/dist/components/illustration/illustration-registry.js +37 -0
- package/dist/components/illustration/illustration-variants.js +21 -0
- package/dist/components/illustration/illustration.js +68 -0
- package/dist/components/index.d.ts +0 -20
- package/dist/components/index.js +134 -6
- package/dist/components/key-value-manager/key-value-manager-add-popover.js +126 -0
- package/dist/components/key-value-manager/key-value-manager-field.js +47 -0
- package/dist/components/key-value-manager/key-value-manager-table.js +188 -0
- package/dist/components/key-value-manager/key-value-manager.js +111 -0
- package/dist/components/key-value-manager/key-value-manager.props.js +28 -0
- package/dist/components/key-value-manager/key-value-manager.utils.js +21 -0
- package/dist/components/link/link.js +67 -0
- package/dist/components/list/dropdown-list-item.js +60 -0
- package/dist/components/list/list-item.utils.js +76 -0
- package/dist/components/list/list.js +49 -0
- package/dist/components/list/list.props.js +27 -0
- package/dist/components/list/standard-list-item.js +66 -0
- package/dist/components/list-details/list-details-item-button.js +46 -0
- package/dist/components/list-details/list-details-item-dropdown.js +112 -0
- package/dist/components/list-details/list-details-item-strip.js +125 -0
- package/dist/components/list-details/list-details.js +148 -0
- package/dist/components/lottie-animation-container/lottie-animation-container.js +31 -0
- package/dist/components/lottie-animations/animation-data/access-denied.js +3980 -0
- package/dist/components/lottie-animations/animation-data/active.js +825 -0
- package/dist/components/lottie-animations/animation-data/bar-chart.js +610 -0
- package/dist/components/lottie-animations/animation-data/chart-loading.js +5368 -0
- package/dist/components/lottie-animations/animation-data/cloud-download.js +1660 -0
- package/dist/components/lottie-animations/animation-data/cloud-sync.js +932 -0
- package/dist/components/lottie-animations/animation-data/coud-upload.js +7060 -0
- package/dist/components/lottie-animations/animation-data/cross-throb.js +1506 -0
- package/dist/components/lottie-animations/animation-data/dashboard-loading.js +14330 -0
- package/dist/components/lottie-animations/animation-data/error-spread-out.js +5567 -0
- package/dist/components/lottie-animations/animation-data/error.js +1211 -0
- package/dist/components/lottie-animations/animation-data/green-success.js +14826 -0
- package/dist/components/lottie-animations/animation-data/inactive.js +723 -0
- package/dist/components/lottie-animations/animation-data/light.js +2678 -0
- package/dist/components/lottie-animations/animation-data/lock.js +900 -0
- package/dist/components/lottie-animations/animation-data/lock2.js +1686 -0
- package/dist/components/lottie-animations/animation-data/locked.js +641 -0
- package/dist/components/lottie-animations/animation-data/search-error.js +954 -0
- package/dist/components/lottie-animations/animation-data/security.js +4121 -0
- package/dist/components/lottie-animations/animation-data/success.js +404 -0
- package/dist/components/lottie-animations/animation-data/verification-in-progress.js +10138 -0
- package/dist/components/lottie-animations/animation-data/warning.js +843 -0
- package/dist/components/lottie-animations/verification-in-progress/verification-in-progress.js +19 -0
- package/dist/components/markdown-content/markdown-content.components.js +114 -0
- package/dist/components/markdown-content/markdown-content.js +39 -0
- package/dist/components/menu/menu.js +19 -0
- package/dist/components/monospace-content/monospace-content.js +80 -0
- package/dist/components/nav-bar/nav-bar-details-panel.js +51 -0
- package/dist/components/nav-bar/nav-bar-mobile-menu.js +105 -0
- package/dist/components/nav-bar/nav-bar.js +449 -0
- package/dist/components/nav-bar/use-nav-bar-overflow.js +74 -0
- package/dist/components/nav-bar/use-nav-bar-scroll.js +42 -0
- package/dist/components/overflow-badge-list/overflow-badge-list.js +58 -0
- package/dist/components/page-container/page-container-skeleton.js +72 -0
- package/dist/components/page-container/page-container.js +93 -0
- package/dist/components/pagination/pagination.js +96 -0
- package/dist/components/pagination/pagination.props.js +16 -0
- package/dist/components/progress-bar/progress-bar.js +106 -0
- package/dist/components/radio-group/radio-group.js +41 -0
- package/dist/components/requirement-list/requirement-list.js +83 -0
- package/dist/components/scrollable-sections/scrollable-sections.js +270 -0
- package/dist/components/search-box/search-box.js +54 -0
- package/dist/components/search-field-shell.js +24 -0
- package/dist/components/selectable-card-list/checkbox-card-list.js +85 -0
- package/dist/components/selectable-card-list/radio-card-list.js +99 -0
- package/dist/components/selectable-card-list/selectable-card-list-shared.js +135 -0
- package/dist/components/selectable-card-list/selectable-card-list.js +34 -0
- package/dist/components/sidebar/sidebar.js +344 -0
- package/dist/components/sidebar/types.js +6 -0
- package/dist/components/simple-clickable-card/simple-clickable-card-shared.js +309 -0
- package/dist/components/simple-clickable-card/simple-clickable-card.js +106 -0
- package/dist/components/simple-info-card/simple-info-card.js +154 -0
- package/dist/components/simple-list/simple-list.js +146 -0
- package/dist/components/simple-paginated-list/simple-paginated-list.js +178 -0
- package/dist/components/simplified-date/simplified-date.js +56 -0
- package/dist/components/skeletons/table-skeleton.js +16 -0
- package/dist/components/spinner/spinner.js +25 -0
- package/dist/components/stat-card/stat-card.js +206 -0
- package/dist/components/status-badge/status-badge.js +108 -0
- package/dist/components/status-card-list/status-card-list.js +282 -0
- package/dist/components/tag/tag.js +144 -0
- package/dist/components/tag-input/tag-input.js +161 -0
- package/dist/components/text-effects/glitch-effect/glitch-text.js +115 -0
- package/dist/components/text-effects/gradient-text/gradient-text.js +32 -0
- package/dist/components/text-effects/highlight-text/highlight-text.js +35 -0
- package/dist/components/text-effects/parse-text-markup.js +53 -0
- package/dist/components/text-effects/shimmer-text/shimmer-text.js +67 -0
- package/dist/components/time-picker/time-picker.js +23 -0
- package/dist/components/toast/toast.js +126 -0
- package/dist/components/togglable-items-list/togglable-items-list.js +28 -0
- package/dist/components/tooltip/tooltip.js +21 -0
- package/dist/components/transfer-list/transfer-list.js +413 -0
- package/dist/components/truncated-line-with-tooltip/truncated-line-with-tooltip.js +61 -0
- package/dist/components/typography/typography-variants.js +41 -0
- package/dist/components/typography/typography.js +15 -0
- package/dist/components/user-type-badge/user-type-badge.js +40 -0
- package/dist/components/user-type-badge/user-type-badge.registry.js +17 -0
- package/dist/components/vertical-stepper/vertical-stepper.js +171 -0
- package/dist/core/alert.js +33 -0
- package/dist/core/animate-ui/components/animate/code-header.js +30 -0
- package/dist/core/animate-ui/components/animate/code.js +35 -0
- package/dist/core/animate-ui/components/animate/tabs.js +188 -0
- package/dist/core/animate-ui/components/animate/tooltip.js +39 -0
- package/dist/core/animate-ui/components/base/preview-card.js +29 -0
- package/dist/core/animate-ui/components/base/progress.js +32 -0
- package/dist/core/animate-ui/components/base/radio.js +24 -0
- package/dist/core/animate-ui/components/buttons/copy.js +95 -0
- package/dist/core/animate-ui/components/radix/accordion.js +36 -0
- package/dist/core/animate-ui/components/radix/dialog.js +60 -0
- package/dist/core/animate-ui/components/radix/dropdown-menu.js +129 -0
- package/dist/core/animate-ui/components/radix/sheet.js +110 -0
- package/dist/core/animate-ui/components/radix/sidebar.js +416 -0
- package/dist/core/animate-ui/components/radix/switch.js +34 -0
- package/dist/core/animate-ui/components/radix/toggle-group.js +115 -0
- package/dist/core/animate-ui/components/radix/toggle.js +24 -0
- package/dist/core/animate-ui/primitives/animate/code-block.js +131 -0
- package/dist/core/animate-ui/primitives/animate/escape-html.js +7 -0
- package/dist/core/animate-ui/primitives/animate/shiki-highlighter.js +64 -0
- package/dist/core/animate-ui/primitives/animate/slot.js +39 -0
- package/dist/core/animate-ui/primitives/animate/tabs.js +202 -0
- package/dist/core/animate-ui/primitives/animate/tooltip.js +351 -0
- package/dist/core/animate-ui/primitives/base/preview-card.js +107 -0
- package/dist/core/animate-ui/primitives/base/progress.js +60 -0
- package/dist/core/animate-ui/primitives/base/radio.js +83 -0
- package/dist/core/animate-ui/primitives/buttons/button.js +15 -0
- package/dist/core/animate-ui/primitives/effects/highlight.js +407 -0
- package/dist/core/animate-ui/primitives/radix/accordion.js +76 -0
- package/dist/core/animate-ui/primitives/radix/dialog.js +136 -0
- package/dist/core/animate-ui/primitives/radix/dropdown-menu.js +305 -0
- package/dist/core/animate-ui/primitives/radix/sheet.js +165 -0
- package/dist/core/animate-ui/primitives/radix/switch.js +86 -0
- package/dist/core/animate-ui/primitives/radix/toggle-group.js +100 -0
- package/dist/core/animate-ui/primitives/texts/counting-number.js +75 -0
- package/dist/core/avatar.js +32 -0
- package/dist/core/badge.js +27 -0
- package/dist/core/breadcrumb.js +62 -0
- package/dist/core/button/button.js +43 -0
- package/dist/core/button/craft-button.js +78 -0
- package/dist/core/button-group.js +38 -0
- package/dist/core/button.js +40 -0
- package/dist/core/card.js +42 -0
- package/dist/core/carousel/carousel.js +149 -0
- package/dist/core/checkbox/motion-checkbox.js +103 -0
- package/dist/core/collapsible.js +54 -0
- package/dist/core/combobox/combobox.js +85 -0
- package/dist/core/command.js +61 -0
- package/dist/core/field-end-icons.js +36 -0
- package/dist/core/field-label-row.js +33 -0
- package/dist/core/form.js +92 -0
- package/dist/core/hooks/use-controlled-state.js +27 -0
- package/dist/core/hooks/use-data-state.js +39 -0
- package/dist/core/hooks/use-is-in-view.js +18 -0
- package/dist/core/hooks/use-mobile.js +19 -0
- package/dist/core/hooks/use-reveal-on-scroll-up.js +141 -0
- package/dist/core/hooks/use-scroll-overflow.js +50 -0
- package/dist/core/index.js +18 -52
- package/dist/core/input/input-password.js +30 -0
- package/dist/core/input/input.js +147 -0
- package/dist/core/input-otp/input-otp.js +183 -0
- package/dist/core/label.js +15 -0
- package/dist/core/popover.js +31 -0
- package/dist/core/scroll-area.js +42 -0
- package/dist/core/select.js +121 -0
- package/dist/core/separator.js +40 -0
- package/dist/core/skeleton.js +11 -0
- package/dist/core/table.js +59 -0
- package/dist/core/textarea/textarea.js +97 -0
- package/dist/core/utils/get-strict-context.js +18 -0
- package/dist/index.js +148 -9
- package/dist/layouts/entry-layout/entry-layout-bg.js +4 -0
- package/dist/layouts/entry-layout/entry-layout.js +52 -0
- package/dist/layouts/index.js +7 -6
- package/dist/layouts/workspace-layout/account-menu/account-menu.js +108 -0
- package/dist/layouts/workspace-layout/breadcrumbs/derive-breadcrumbs.js +37 -0
- package/dist/layouts/workspace-layout/breadcrumbs/workspace-breadcrumbs.js +22 -0
- package/dist/layouts/workspace-layout/footer/footer.js +15 -0
- package/dist/layouts/workspace-layout/header/header.js +54 -0
- package/dist/layouts/workspace-layout/workspace-layout.js +157 -0
- package/dist/tailwind-preset.js +3 -4
- package/dist/utils/cn.js +8 -0
- package/dist/utils/color.js +72 -0
- package/dist/utils/index.js +3 -2
- package/dist/utils/path-match.js +17 -0
- package/dist/utils/silver-shine.js +63 -0
- package/dist/utils/variant-gradient-underlay.js +45 -0
- package/dist/utils/variant.js +426 -0
- package/package.json +7 -4
- package/dist/chunk-2GDYZAKR.js +0 -505
- package/dist/chunk-ALCWXFUC.js +0 -733
- package/dist/chunk-CDHBLANU.js +0 -59
- package/dist/chunk-LUESSJAF.js +0 -70068
- package/dist/chunk-TMORRNEB.js +0 -323
- package/dist/chunk-TRTQSARU.js +0 -31
- package/dist/chunk-VU4CZ76T.js +0 -43
- package/dist/chunk-XNLCVHBC.js +0 -364
- package/dist/chunk-Z4776NRY.js +0 -4347
- package/src/assets/illustrations/add-to-group.svg +0 -32
- package/src/assets/illustrations/chip.svg +0 -51
- package/src/assets/illustrations/create-new-group.svg +0 -27
- package/src/assets/illustrations/new-ota.svg +0 -61
- package/src/assets/illustrations/secured-key.svg +0 -48
- /package/dist/assets/{entry-layout-bg-JPI7GJ42.webp → entry-layout-bg-DUM0UhT3.webp} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,71 @@ All notable changes to this project are documented here. The format is based on
|
|
|
4
4
|
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres
|
|
5
5
|
to [Semantic Versioning](https://semver.org/).
|
|
6
6
|
|
|
7
|
+
## [1.11.0] - 2026-10-14
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
- **Build output is now one ESM file per source module**, so consumer
|
|
11
|
+
bundlers drop the components an app never imports. Previously the library
|
|
12
|
+
shipped as a few large shared chunks, and importing one component pulled in
|
|
13
|
+
nearly all of them: a consumer importing only `Dialog` bundled about 2.2 MB
|
|
14
|
+
of minified library code, now about 35 KB. Apps that use most of the
|
|
15
|
+
library see a smaller gain in total size, but its code now loads with the
|
|
16
|
+
routes that use it instead of up front: in the RainMaker dashboard the
|
|
17
|
+
first-load JS dropped by about 44 % (gzip).
|
|
18
|
+
|
|
19
|
+
**Upgrading:** no code changes. Import paths and the `exports` map are
|
|
20
|
+
unchanged; rebuild the app to get the smaller output. To benefit, use named
|
|
21
|
+
imports (`import { Dialog } from "…/components"`) in a production build with
|
|
22
|
+
a bundler that tree-shakes ESM (Vite, webpack 5, Next.js, Rollup, esbuild).
|
|
23
|
+
The internal `dist/chunk-*.js` files are gone; they were never part of the
|
|
24
|
+
supported API.
|
|
25
|
+
- **`'use client'` directives are kept** on each module. The old build
|
|
26
|
+
stripped them, so Next.js App Router apps no longer need their own
|
|
27
|
+
`'use client'` wrapper around the library's client components.
|
|
28
|
+
|
|
29
|
+
### Removed
|
|
30
|
+
- **`Illustration`** — the unused `add-to-group`, `create-new-group`, `chip`,
|
|
31
|
+
`new-ota` and `secured-key` illustrations and their SVG assets. The
|
|
32
|
+
remaining types are `no-search-results` (the `NoDataCard` / `DataTable`
|
|
33
|
+
empty-state default), `rm-data-download` and `rm-dashboard-update`.
|
|
34
|
+
`IllustrationType`, `illustrationRegistry` and `illustrationsById` shrink
|
|
35
|
+
to match, and the `Illustration` chunk carries about 80 KB less SVG.
|
|
36
|
+
Passing a removed `type` is now a type error; at runtime it renders
|
|
37
|
+
nothing, as an unknown `type` always has. Released as a minor version
|
|
38
|
+
because no known consumer uses the removed types.
|
|
39
|
+
- **`Illustration`** — the unused `add-to-group`, `create-new-group`, `chip`,
|
|
40
|
+
`new-ota` and `secured-key` illustrations and their SVG assets. The
|
|
41
|
+
remaining types are `no-search-results` (the `NoDataCard` / `DataTable`
|
|
42
|
+
empty-state default), `rm-data-download` and `rm-dashboard-update`.
|
|
43
|
+
`IllustrationType`, `illustrationRegistry` and `illustrationsById` shrink
|
|
44
|
+
to match, and the `Illustration` chunk carries about 80 KB less SVG.
|
|
45
|
+
Passing a removed `type` is now a type error; at runtime it renders
|
|
46
|
+
nothing, as an unknown `type` always has.
|
|
47
|
+
|
|
48
|
+
### Fixed
|
|
49
|
+
- **`EntryLayout`** — the default background image now shows in consumer
|
|
50
|
+
apps. The built library referenced it as a plain `"./assets/…webp"` string,
|
|
51
|
+
which consumer bundlers don't treat as an asset: the file was left out of
|
|
52
|
+
the app's build and the browser looked for it relative to the page URL. It
|
|
53
|
+
is now referenced with `new URL(…, import.meta.url)`, which Vite, webpack 5
|
|
54
|
+
and Next.js copy into the app's output. Apps that pass `backgroundImageUrl`
|
|
55
|
+
or `disableBackgroundImage` are unaffected. No API change.
|
|
56
|
+
|
|
57
|
+
### Internal
|
|
58
|
+
Nothing in this section affects the published package.
|
|
59
|
+
|
|
60
|
+
- The library's JavaScript is built by Vite 8 in library mode with
|
|
61
|
+
`preserveModules` (`vite.lib.config.ts`); tsup now emits only the type
|
|
62
|
+
declarations and the Tailwind preset. `lottie-react` / `lottie-web` stay
|
|
63
|
+
bundled, under `dist/_vendor/`, to keep the Vite 8 interop fix from 1.1.3.
|
|
64
|
+
- New `npm run size` bundle-size check (`scripts/check-bundle-size.mjs`),
|
|
65
|
+
run in CI after the build. It bundles typical consumer imports against
|
|
66
|
+
`dist/` and fails when one exceeds its gzip budget, so a change that
|
|
67
|
+
breaks tree-shaking can't land unnoticed.
|
|
68
|
+
- `vite` and `esbuild` are now explicit dev dependencies.
|
|
69
|
+
- Demo: the `DataTable` custom empty-state example uses `rm-data-download`
|
|
70
|
+
instead of the removed `chip` illustration.
|
|
71
|
+
|
|
7
72
|
## [1.10.0] - 2026-10-11
|
|
8
73
|
|
|
9
74
|
### Changed
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
typeof window !== "undefined" && window.document && window.document.createElement;
|
|
2
|
+
function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
|
3
|
+
return function handleEvent(event) {
|
|
4
|
+
originalEventHandler?.(event);
|
|
5
|
+
if (checkForDefaultPrevented === false || !event.defaultPrevented) return ourEventHandler?.(event);
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { composeEventHandlers };
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useComposedRefs } from "../../react-compose-refs/dist/index.js";
|
|
3
|
+
import { createContextScope } from "../../react-context/dist/index.js";
|
|
4
|
+
import { composeEventHandlers } from "../../primitive/dist/index.js";
|
|
5
|
+
import { useControllableState } from "../../react-use-controllable-state/dist/index.js";
|
|
6
|
+
import { usePrevious } from "../../react-use-previous/dist/index.js";
|
|
7
|
+
import { useSize } from "../../react-use-size/dist/index.js";
|
|
8
|
+
import { Presence } from "../../react-presence/dist/index.js";
|
|
9
|
+
import { Primitive } from "../../react-primitive/dist/index.js";
|
|
10
|
+
import * as React$1 from "react";
|
|
11
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
//#region node_modules/@radix-ui/react-checkbox/dist/index.mjs
|
|
13
|
+
var CHECKBOX_NAME = "Checkbox";
|
|
14
|
+
var [createCheckboxContext, createCheckboxScope] = createContextScope(CHECKBOX_NAME);
|
|
15
|
+
var [CheckboxProviderImpl, useCheckboxContext] = createCheckboxContext(CHECKBOX_NAME);
|
|
16
|
+
function CheckboxProvider(props) {
|
|
17
|
+
const { __scopeCheckbox, checked: checkedProp, children, defaultChecked, disabled, form, name, onCheckedChange, required, value = "on", internal_do_not_use_render } = props;
|
|
18
|
+
const [checked, setChecked] = useControllableState({
|
|
19
|
+
prop: checkedProp,
|
|
20
|
+
defaultProp: defaultChecked ?? false,
|
|
21
|
+
onChange: onCheckedChange,
|
|
22
|
+
caller: CHECKBOX_NAME
|
|
23
|
+
});
|
|
24
|
+
const [control, setControl] = React$1.useState(null);
|
|
25
|
+
const [bubbleInput, setBubbleInput] = React$1.useState(null);
|
|
26
|
+
const hasConsumerStoppedPropagationRef = React$1.useRef(false);
|
|
27
|
+
const isFormControl = control ? !!form || !!control.closest("form") : true;
|
|
28
|
+
const context = {
|
|
29
|
+
checked,
|
|
30
|
+
disabled,
|
|
31
|
+
setChecked,
|
|
32
|
+
control,
|
|
33
|
+
setControl,
|
|
34
|
+
name,
|
|
35
|
+
form,
|
|
36
|
+
value,
|
|
37
|
+
hasConsumerStoppedPropagationRef,
|
|
38
|
+
required,
|
|
39
|
+
defaultChecked: isIndeterminate(defaultChecked) ? false : defaultChecked,
|
|
40
|
+
isFormControl,
|
|
41
|
+
bubbleInput,
|
|
42
|
+
setBubbleInput
|
|
43
|
+
};
|
|
44
|
+
return /* @__PURE__ */ jsx(CheckboxProviderImpl, {
|
|
45
|
+
scope: __scopeCheckbox,
|
|
46
|
+
...context,
|
|
47
|
+
children: isFunction(internal_do_not_use_render) ? internal_do_not_use_render(context) : children
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
var TRIGGER_NAME = "CheckboxTrigger";
|
|
51
|
+
var CheckboxTrigger = React$1.forwardRef(({ __scopeCheckbox, onKeyDown, onClick, ...checkboxProps }, forwardedRef) => {
|
|
52
|
+
const { control, value, disabled, checked, required, setControl, setChecked, hasConsumerStoppedPropagationRef, isFormControl, bubbleInput } = useCheckboxContext(TRIGGER_NAME, __scopeCheckbox);
|
|
53
|
+
const composedRefs = useComposedRefs(forwardedRef, setControl);
|
|
54
|
+
const initialCheckedStateRef = React$1.useRef(checked);
|
|
55
|
+
React$1.useEffect(() => {
|
|
56
|
+
const form = control?.form;
|
|
57
|
+
if (form) {
|
|
58
|
+
const reset = () => setChecked(initialCheckedStateRef.current);
|
|
59
|
+
form.addEventListener("reset", reset);
|
|
60
|
+
return () => form.removeEventListener("reset", reset);
|
|
61
|
+
}
|
|
62
|
+
}, [control, setChecked]);
|
|
63
|
+
return /* @__PURE__ */ jsx(Primitive.button, {
|
|
64
|
+
type: "button",
|
|
65
|
+
role: "checkbox",
|
|
66
|
+
"aria-checked": isIndeterminate(checked) ? "mixed" : checked,
|
|
67
|
+
"aria-required": required,
|
|
68
|
+
"data-state": getState(checked),
|
|
69
|
+
"data-disabled": disabled ? "" : void 0,
|
|
70
|
+
disabled,
|
|
71
|
+
value,
|
|
72
|
+
...checkboxProps,
|
|
73
|
+
ref: composedRefs,
|
|
74
|
+
onKeyDown: composeEventHandlers(onKeyDown, (event) => {
|
|
75
|
+
if (event.key === "Enter") event.preventDefault();
|
|
76
|
+
}),
|
|
77
|
+
onClick: composeEventHandlers(onClick, (event) => {
|
|
78
|
+
setChecked((prevChecked) => isIndeterminate(prevChecked) ? true : !prevChecked);
|
|
79
|
+
if (bubbleInput && isFormControl) {
|
|
80
|
+
hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
|
|
81
|
+
if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();
|
|
82
|
+
}
|
|
83
|
+
})
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
CheckboxTrigger.displayName = TRIGGER_NAME;
|
|
87
|
+
var Checkbox = React$1.forwardRef((props, forwardedRef) => {
|
|
88
|
+
const { __scopeCheckbox, name, checked, defaultChecked, required, disabled, value, onCheckedChange, form, ...checkboxProps } = props;
|
|
89
|
+
return /* @__PURE__ */ jsx(CheckboxProvider, {
|
|
90
|
+
__scopeCheckbox,
|
|
91
|
+
checked,
|
|
92
|
+
defaultChecked,
|
|
93
|
+
disabled,
|
|
94
|
+
required,
|
|
95
|
+
onCheckedChange,
|
|
96
|
+
name,
|
|
97
|
+
form,
|
|
98
|
+
value,
|
|
99
|
+
internal_do_not_use_render: ({ isFormControl }) => /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(CheckboxTrigger, {
|
|
100
|
+
...checkboxProps,
|
|
101
|
+
ref: forwardedRef,
|
|
102
|
+
__scopeCheckbox
|
|
103
|
+
}), isFormControl && /* @__PURE__ */ jsx(CheckboxBubbleInput, { __scopeCheckbox })] })
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
Checkbox.displayName = CHECKBOX_NAME;
|
|
107
|
+
var INDICATOR_NAME = "CheckboxIndicator";
|
|
108
|
+
var CheckboxIndicator = React$1.forwardRef((props, forwardedRef) => {
|
|
109
|
+
const { __scopeCheckbox, forceMount, ...indicatorProps } = props;
|
|
110
|
+
const context = useCheckboxContext(INDICATOR_NAME, __scopeCheckbox);
|
|
111
|
+
return /* @__PURE__ */ jsx(Presence, {
|
|
112
|
+
present: forceMount || isIndeterminate(context.checked) || context.checked === true,
|
|
113
|
+
children: /* @__PURE__ */ jsx(Primitive.span, {
|
|
114
|
+
"data-state": getState(context.checked),
|
|
115
|
+
"data-disabled": context.disabled ? "" : void 0,
|
|
116
|
+
...indicatorProps,
|
|
117
|
+
ref: forwardedRef,
|
|
118
|
+
style: {
|
|
119
|
+
pointerEvents: "none",
|
|
120
|
+
...props.style
|
|
121
|
+
}
|
|
122
|
+
})
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
CheckboxIndicator.displayName = INDICATOR_NAME;
|
|
126
|
+
var BUBBLE_INPUT_NAME = "CheckboxBubbleInput";
|
|
127
|
+
var CheckboxBubbleInput = React$1.forwardRef(({ __scopeCheckbox, ...props }, forwardedRef) => {
|
|
128
|
+
const { control, hasConsumerStoppedPropagationRef, checked, defaultChecked, required, disabled, name, value, form, bubbleInput, setBubbleInput } = useCheckboxContext(BUBBLE_INPUT_NAME, __scopeCheckbox);
|
|
129
|
+
const composedRefs = useComposedRefs(forwardedRef, setBubbleInput);
|
|
130
|
+
const prevChecked = usePrevious(checked);
|
|
131
|
+
const controlSize = useSize(control);
|
|
132
|
+
React$1.useEffect(() => {
|
|
133
|
+
const input = bubbleInput;
|
|
134
|
+
if (!input) return;
|
|
135
|
+
const inputProto = window.HTMLInputElement.prototype;
|
|
136
|
+
const setChecked = Object.getOwnPropertyDescriptor(inputProto, "checked").set;
|
|
137
|
+
const bubbles = !hasConsumerStoppedPropagationRef.current;
|
|
138
|
+
if (prevChecked !== checked && setChecked) {
|
|
139
|
+
const event = new Event("click", { bubbles });
|
|
140
|
+
input.indeterminate = isIndeterminate(checked);
|
|
141
|
+
setChecked.call(input, isIndeterminate(checked) ? false : checked);
|
|
142
|
+
input.dispatchEvent(event);
|
|
143
|
+
}
|
|
144
|
+
}, [
|
|
145
|
+
bubbleInput,
|
|
146
|
+
prevChecked,
|
|
147
|
+
checked,
|
|
148
|
+
hasConsumerStoppedPropagationRef
|
|
149
|
+
]);
|
|
150
|
+
const defaultCheckedRef = React$1.useRef(isIndeterminate(checked) ? false : checked);
|
|
151
|
+
return /* @__PURE__ */ jsx(Primitive.input, {
|
|
152
|
+
type: "checkbox",
|
|
153
|
+
"aria-hidden": true,
|
|
154
|
+
defaultChecked: defaultChecked ?? defaultCheckedRef.current,
|
|
155
|
+
required,
|
|
156
|
+
disabled,
|
|
157
|
+
name,
|
|
158
|
+
value,
|
|
159
|
+
form,
|
|
160
|
+
...props,
|
|
161
|
+
tabIndex: -1,
|
|
162
|
+
ref: composedRefs,
|
|
163
|
+
style: {
|
|
164
|
+
...props.style,
|
|
165
|
+
...controlSize,
|
|
166
|
+
position: "absolute",
|
|
167
|
+
pointerEvents: "none",
|
|
168
|
+
opacity: 0,
|
|
169
|
+
margin: 0,
|
|
170
|
+
transform: "translateX(-100%)"
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
CheckboxBubbleInput.displayName = BUBBLE_INPUT_NAME;
|
|
175
|
+
function isFunction(value) {
|
|
176
|
+
return typeof value === "function";
|
|
177
|
+
}
|
|
178
|
+
function isIndeterminate(checked) {
|
|
179
|
+
return checked === "indeterminate";
|
|
180
|
+
}
|
|
181
|
+
function getState(checked) {
|
|
182
|
+
return isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked";
|
|
183
|
+
}
|
|
184
|
+
//#endregion
|
|
185
|
+
export { Checkbox, Checkbox as Root, CheckboxIndicator, CheckboxIndicator as Indicator, CheckboxBubbleInput as unstable_BubbleInput, CheckboxBubbleInput as unstable_CheckboxBubbleInput, CheckboxProvider as unstable_CheckboxProvider, CheckboxProvider as unstable_Provider, CheckboxTrigger as unstable_CheckboxTrigger, CheckboxTrigger as unstable_Trigger };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
//#region node_modules/@radix-ui/react-compose-refs/dist/index.mjs
|
|
3
|
+
function setRef(ref, value) {
|
|
4
|
+
if (typeof ref === "function") return ref(value);
|
|
5
|
+
else if (ref !== null && ref !== void 0) ref.current = value;
|
|
6
|
+
}
|
|
7
|
+
function composeRefs(...refs) {
|
|
8
|
+
return (node) => {
|
|
9
|
+
let hasCleanup = false;
|
|
10
|
+
const cleanups = refs.map((ref) => {
|
|
11
|
+
const cleanup = setRef(ref, node);
|
|
12
|
+
if (!hasCleanup && typeof cleanup == "function") hasCleanup = true;
|
|
13
|
+
return cleanup;
|
|
14
|
+
});
|
|
15
|
+
if (hasCleanup) return () => {
|
|
16
|
+
for (let i = 0; i < cleanups.length; i++) {
|
|
17
|
+
const cleanup = cleanups[i];
|
|
18
|
+
if (typeof cleanup == "function") cleanup();
|
|
19
|
+
else setRef(refs[i], null);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function useComposedRefs(...refs) {
|
|
25
|
+
return React$1.useCallback(composeRefs(...refs), refs);
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
export { composeRefs, useComposedRefs };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region node_modules/@radix-ui/react-context/dist/index.mjs
|
|
4
|
+
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
5
|
+
let defaultContexts = [];
|
|
6
|
+
function createContext3(rootComponentName, defaultContext) {
|
|
7
|
+
const BaseContext = React$1.createContext(defaultContext);
|
|
8
|
+
BaseContext.displayName = rootComponentName + "Context";
|
|
9
|
+
const index = defaultContexts.length;
|
|
10
|
+
defaultContexts = [...defaultContexts, defaultContext];
|
|
11
|
+
const Provider = (props) => {
|
|
12
|
+
const { scope, children, ...context } = props;
|
|
13
|
+
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
14
|
+
const value = React$1.useMemo(() => context, Object.values(context));
|
|
15
|
+
return /* @__PURE__ */ jsx(Context.Provider, {
|
|
16
|
+
value,
|
|
17
|
+
children
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
Provider.displayName = rootComponentName + "Provider";
|
|
21
|
+
function useContext2(consumerName, scope) {
|
|
22
|
+
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
23
|
+
const context = React$1.useContext(Context);
|
|
24
|
+
if (context) return context;
|
|
25
|
+
if (defaultContext !== void 0) return defaultContext;
|
|
26
|
+
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
27
|
+
}
|
|
28
|
+
return [Provider, useContext2];
|
|
29
|
+
}
|
|
30
|
+
const createScope = () => {
|
|
31
|
+
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
32
|
+
return React$1.createContext(defaultContext);
|
|
33
|
+
});
|
|
34
|
+
return function useScope(scope) {
|
|
35
|
+
const contexts = scope?.[scopeName] || scopeContexts;
|
|
36
|
+
return React$1.useMemo(() => ({ [`__scope${scopeName}`]: {
|
|
37
|
+
...scope,
|
|
38
|
+
[scopeName]: contexts
|
|
39
|
+
} }), [scope, contexts]);
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
createScope.scopeName = scopeName;
|
|
43
|
+
return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
|
|
44
|
+
}
|
|
45
|
+
function composeContextScopes(...scopes) {
|
|
46
|
+
const baseScope = scopes[0];
|
|
47
|
+
if (scopes.length === 1) return baseScope;
|
|
48
|
+
const createScope = () => {
|
|
49
|
+
const scopeHooks = scopes.map((createScope2) => ({
|
|
50
|
+
useScope: createScope2(),
|
|
51
|
+
scopeName: createScope2.scopeName
|
|
52
|
+
}));
|
|
53
|
+
return function useComposedScopes(overrideScopes) {
|
|
54
|
+
const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
|
|
55
|
+
const currentScope = useScope(overrideScopes)[`__scope${scopeName}`];
|
|
56
|
+
return {
|
|
57
|
+
...nextScopes2,
|
|
58
|
+
...currentScope
|
|
59
|
+
};
|
|
60
|
+
}, {});
|
|
61
|
+
return React$1.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
createScope.scopeName = baseScope.scopeName;
|
|
65
|
+
return createScope;
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
68
|
+
export { createContextScope };
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useLayoutEffect as useLayoutEffect2 } from "../../react-use-layout-effect/dist/index.js";
|
|
3
|
+
import * as React2 from "react";
|
|
4
|
+
//#region node_modules/@radix-ui/react-presence/dist/index.mjs
|
|
5
|
+
function useStateMachine(initialState, machine) {
|
|
6
|
+
return React2.useReducer((state, event) => {
|
|
7
|
+
return machine[state][event] ?? state;
|
|
8
|
+
}, initialState);
|
|
9
|
+
}
|
|
10
|
+
var Presence = (props) => {
|
|
11
|
+
const { present, children } = props;
|
|
12
|
+
const presence = usePresence(present);
|
|
13
|
+
const child = typeof children === "function" ? children({ present: presence.isPresent }) : React2.Children.only(children);
|
|
14
|
+
const ref = useStableComposedRefs(presence.ref, getElementRef(child));
|
|
15
|
+
return typeof children === "function" || presence.isPresent ? React2.cloneElement(child, { ref }) : null;
|
|
16
|
+
};
|
|
17
|
+
Presence.displayName = "Presence";
|
|
18
|
+
function usePresence(present) {
|
|
19
|
+
const [node, setNode] = React2.useState();
|
|
20
|
+
const stylesRef = React2.useRef(null);
|
|
21
|
+
const prevPresentRef = React2.useRef(present);
|
|
22
|
+
const prevAnimationNameRef = React2.useRef("none");
|
|
23
|
+
const [state, send] = useStateMachine(present ? "mounted" : "unmounted", {
|
|
24
|
+
mounted: {
|
|
25
|
+
UNMOUNT: "unmounted",
|
|
26
|
+
ANIMATION_OUT: "unmountSuspended"
|
|
27
|
+
},
|
|
28
|
+
unmountSuspended: {
|
|
29
|
+
MOUNT: "mounted",
|
|
30
|
+
ANIMATION_END: "unmounted"
|
|
31
|
+
},
|
|
32
|
+
unmounted: { MOUNT: "mounted" }
|
|
33
|
+
});
|
|
34
|
+
React2.useEffect(() => {
|
|
35
|
+
const currentAnimationName = getAnimationName(stylesRef.current);
|
|
36
|
+
prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
|
|
37
|
+
}, [state]);
|
|
38
|
+
useLayoutEffect2(() => {
|
|
39
|
+
const styles = stylesRef.current;
|
|
40
|
+
const wasPresent = prevPresentRef.current;
|
|
41
|
+
if (wasPresent !== present) {
|
|
42
|
+
const prevAnimationName = prevAnimationNameRef.current;
|
|
43
|
+
const currentAnimationName = getAnimationName(styles);
|
|
44
|
+
if (present) send("MOUNT");
|
|
45
|
+
else if (currentAnimationName === "none" || styles?.display === "none") send("UNMOUNT");
|
|
46
|
+
else if (wasPresent && prevAnimationName !== currentAnimationName) send("ANIMATION_OUT");
|
|
47
|
+
else send("UNMOUNT");
|
|
48
|
+
prevPresentRef.current = present;
|
|
49
|
+
}
|
|
50
|
+
}, [present, send]);
|
|
51
|
+
useLayoutEffect2(() => {
|
|
52
|
+
if (node) {
|
|
53
|
+
let timeoutId;
|
|
54
|
+
const ownerWindow = node.ownerDocument.defaultView ?? window;
|
|
55
|
+
const handleAnimationEnd = (event) => {
|
|
56
|
+
const isCurrentAnimation = getAnimationName(stylesRef.current).includes(CSS.escape(event.animationName));
|
|
57
|
+
if (event.target === node && isCurrentAnimation) {
|
|
58
|
+
send("ANIMATION_END");
|
|
59
|
+
if (!prevPresentRef.current) {
|
|
60
|
+
const currentFillMode = node.style.animationFillMode;
|
|
61
|
+
node.style.animationFillMode = "forwards";
|
|
62
|
+
timeoutId = ownerWindow.setTimeout(() => {
|
|
63
|
+
if (node.style.animationFillMode === "forwards") node.style.animationFillMode = currentFillMode;
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
const handleAnimationStart = (event) => {
|
|
69
|
+
if (event.target === node) prevAnimationNameRef.current = getAnimationName(stylesRef.current);
|
|
70
|
+
};
|
|
71
|
+
node.addEventListener("animationstart", handleAnimationStart);
|
|
72
|
+
node.addEventListener("animationcancel", handleAnimationEnd);
|
|
73
|
+
node.addEventListener("animationend", handleAnimationEnd);
|
|
74
|
+
return () => {
|
|
75
|
+
ownerWindow.clearTimeout(timeoutId);
|
|
76
|
+
node.removeEventListener("animationstart", handleAnimationStart);
|
|
77
|
+
node.removeEventListener("animationcancel", handleAnimationEnd);
|
|
78
|
+
node.removeEventListener("animationend", handleAnimationEnd);
|
|
79
|
+
};
|
|
80
|
+
} else send("ANIMATION_END");
|
|
81
|
+
}, [node, send]);
|
|
82
|
+
return {
|
|
83
|
+
isPresent: ["mounted", "unmountSuspended"].includes(state),
|
|
84
|
+
ref: React2.useCallback((node2) => {
|
|
85
|
+
stylesRef.current = node2 ? getComputedStyle(node2) : null;
|
|
86
|
+
setNode(node2);
|
|
87
|
+
}, [])
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function setRef(ref, value) {
|
|
91
|
+
if (typeof ref === "function") return ref(value);
|
|
92
|
+
else if (ref !== null && ref !== void 0) ref.current = value;
|
|
93
|
+
}
|
|
94
|
+
function useStableComposedRefs(...refs) {
|
|
95
|
+
const refsRef = React2.useRef(refs);
|
|
96
|
+
refsRef.current = refs;
|
|
97
|
+
return React2.useCallback((node) => {
|
|
98
|
+
const currentRefs = refsRef.current;
|
|
99
|
+
let hasCleanup = false;
|
|
100
|
+
const cleanups = currentRefs.map((ref) => {
|
|
101
|
+
const cleanup = setRef(ref, node);
|
|
102
|
+
if (!hasCleanup && typeof cleanup === "function") hasCleanup = true;
|
|
103
|
+
return cleanup;
|
|
104
|
+
});
|
|
105
|
+
if (hasCleanup) return () => {
|
|
106
|
+
for (let i = 0; i < cleanups.length; i++) {
|
|
107
|
+
const cleanup = cleanups[i];
|
|
108
|
+
if (typeof cleanup === "function") cleanup();
|
|
109
|
+
else setRef(currentRefs[i], null);
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
}, []);
|
|
113
|
+
}
|
|
114
|
+
function getAnimationName(styles) {
|
|
115
|
+
return styles?.animationName || "none";
|
|
116
|
+
}
|
|
117
|
+
function getElementRef(element) {
|
|
118
|
+
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
119
|
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
120
|
+
if (mayWarn) return element.ref;
|
|
121
|
+
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
122
|
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
123
|
+
if (mayWarn) return element.props.ref;
|
|
124
|
+
return element.props.ref || element.ref;
|
|
125
|
+
}
|
|
126
|
+
//#endregion
|
|
127
|
+
export { Presence };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { createSlot } from "@radix-ui/react-slot";
|
|
4
|
+
import "react-dom";
|
|
5
|
+
//#region node_modules/@radix-ui/react-primitive/dist/index.mjs
|
|
6
|
+
var Primitive = [
|
|
7
|
+
"a",
|
|
8
|
+
"button",
|
|
9
|
+
"div",
|
|
10
|
+
"form",
|
|
11
|
+
"h2",
|
|
12
|
+
"h3",
|
|
13
|
+
"img",
|
|
14
|
+
"input",
|
|
15
|
+
"label",
|
|
16
|
+
"li",
|
|
17
|
+
"nav",
|
|
18
|
+
"ol",
|
|
19
|
+
"p",
|
|
20
|
+
"select",
|
|
21
|
+
"span",
|
|
22
|
+
"svg",
|
|
23
|
+
"ul"
|
|
24
|
+
].reduce((primitive, node) => {
|
|
25
|
+
const Slot = createSlot(`Primitive.${node}`);
|
|
26
|
+
const Node = React$1.forwardRef((props, forwardedRef) => {
|
|
27
|
+
const { asChild, ...primitiveProps } = props;
|
|
28
|
+
const Comp = asChild ? Slot : node;
|
|
29
|
+
if (typeof window !== "undefined") window[Symbol.for("radix-ui")] = true;
|
|
30
|
+
return /* @__PURE__ */ jsx(Comp, {
|
|
31
|
+
...primitiveProps,
|
|
32
|
+
ref: forwardedRef
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
Node.displayName = `Primitive.${node}`;
|
|
36
|
+
return {
|
|
37
|
+
...primitive,
|
|
38
|
+
[node]: Node
|
|
39
|
+
};
|
|
40
|
+
}, {});
|
|
41
|
+
//#endregion
|
|
42
|
+
export { Primitive };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { useLayoutEffect as useLayoutEffect2 } from "../../react-use-layout-effect/dist/index.js";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
//#region node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
|
|
4
|
+
var useInsertionEffect = React$1[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
|
|
5
|
+
function useControllableState({ prop, defaultProp, onChange = () => {}, caller }) {
|
|
6
|
+
const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
|
|
7
|
+
defaultProp,
|
|
8
|
+
onChange
|
|
9
|
+
});
|
|
10
|
+
const isControlled = prop !== void 0;
|
|
11
|
+
const value = isControlled ? prop : uncontrolledProp;
|
|
12
|
+
{
|
|
13
|
+
const isControlledRef = React$1.useRef(prop !== void 0);
|
|
14
|
+
React$1.useEffect(() => {
|
|
15
|
+
const wasControlled = isControlledRef.current;
|
|
16
|
+
if (wasControlled !== isControlled) console.warn(`${caller} is changing from ${wasControlled ? "controlled" : "uncontrolled"} to ${isControlled ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`);
|
|
17
|
+
isControlledRef.current = isControlled;
|
|
18
|
+
}, [isControlled, caller]);
|
|
19
|
+
}
|
|
20
|
+
return [value, React$1.useCallback((nextValue) => {
|
|
21
|
+
if (isControlled) {
|
|
22
|
+
const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
|
|
23
|
+
if (value2 !== prop) onChangeRef.current?.(value2);
|
|
24
|
+
} else setUncontrolledProp(nextValue);
|
|
25
|
+
}, [
|
|
26
|
+
isControlled,
|
|
27
|
+
prop,
|
|
28
|
+
setUncontrolledProp,
|
|
29
|
+
onChangeRef
|
|
30
|
+
])];
|
|
31
|
+
}
|
|
32
|
+
function useUncontrolledState({ defaultProp, onChange }) {
|
|
33
|
+
const [value, setValue] = React$1.useState(defaultProp);
|
|
34
|
+
const prevValueRef = React$1.useRef(value);
|
|
35
|
+
const onChangeRef = React$1.useRef(onChange);
|
|
36
|
+
useInsertionEffect(() => {
|
|
37
|
+
onChangeRef.current = onChange;
|
|
38
|
+
}, [onChange]);
|
|
39
|
+
React$1.useEffect(() => {
|
|
40
|
+
if (prevValueRef.current !== value) {
|
|
41
|
+
onChangeRef.current?.(value);
|
|
42
|
+
prevValueRef.current = value;
|
|
43
|
+
}
|
|
44
|
+
}, [value, prevValueRef]);
|
|
45
|
+
return [
|
|
46
|
+
value,
|
|
47
|
+
setValue,
|
|
48
|
+
onChangeRef
|
|
49
|
+
];
|
|
50
|
+
}
|
|
51
|
+
function isFunction(value) {
|
|
52
|
+
return typeof value === "function";
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
export { useControllableState };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
//#region node_modules/@radix-ui/react-use-previous/dist/index.mjs
|
|
3
|
+
function usePrevious(value) {
|
|
4
|
+
const ref = React$1.useRef({
|
|
5
|
+
value,
|
|
6
|
+
previous: value
|
|
7
|
+
});
|
|
8
|
+
return React$1.useMemo(() => {
|
|
9
|
+
if (ref.current.value !== value) {
|
|
10
|
+
ref.current.previous = ref.current.value;
|
|
11
|
+
ref.current.value = value;
|
|
12
|
+
}
|
|
13
|
+
return ref.current.previous;
|
|
14
|
+
}, [value]);
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { usePrevious };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { useLayoutEffect as useLayoutEffect2 } from "../../react-use-layout-effect/dist/index.js";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
//#region node_modules/@radix-ui/react-use-size/dist/index.mjs
|
|
4
|
+
function useSize(element) {
|
|
5
|
+
const [size, setSize] = React$1.useState(void 0);
|
|
6
|
+
useLayoutEffect2(() => {
|
|
7
|
+
if (element) {
|
|
8
|
+
setSize({
|
|
9
|
+
width: element.offsetWidth,
|
|
10
|
+
height: element.offsetHeight
|
|
11
|
+
});
|
|
12
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
13
|
+
if (!Array.isArray(entries)) return;
|
|
14
|
+
if (!entries.length) return;
|
|
15
|
+
const entry = entries[0];
|
|
16
|
+
let width;
|
|
17
|
+
let height;
|
|
18
|
+
if ("borderBoxSize" in entry) {
|
|
19
|
+
const borderSizeEntry = entry["borderBoxSize"];
|
|
20
|
+
const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;
|
|
21
|
+
width = borderSize["inlineSize"];
|
|
22
|
+
height = borderSize["blockSize"];
|
|
23
|
+
} else {
|
|
24
|
+
width = element.offsetWidth;
|
|
25
|
+
height = element.offsetHeight;
|
|
26
|
+
}
|
|
27
|
+
setSize({
|
|
28
|
+
width,
|
|
29
|
+
height
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
resizeObserver.observe(element, { box: "border-box" });
|
|
33
|
+
return () => resizeObserver.unobserve(element);
|
|
34
|
+
} else setSize(void 0);
|
|
35
|
+
}, [element]);
|
|
36
|
+
return size;
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
export { useSize };
|