@espressif/dashboard-ui-components 1.9.1 → 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 +179 -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 +159 -63
- 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.d.ts +1 -1
- 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-ABBHGIFI.js +0 -733
- package/dist/chunk-HIUBSBAP.js +0 -59
- package/dist/chunk-OKB2WTX7.js +0 -363
- package/dist/chunk-P6F6UWV2.js +0 -323
- package/dist/chunk-TRTQSARU.js +0 -31
- package/dist/chunk-VU4CZ76T.js +0 -43
- package/dist/chunk-XFYL5IZU.js +0 -69604
- package/dist/chunk-XW6Z6VO4.js +0 -505
- package/dist/chunk-ZFYUONPY.js +0 -4321
- 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
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../../../utils/cn.js";
|
|
3
|
+
import { useControlledState } from "../../../hooks/use-controlled-state.js";
|
|
4
|
+
import { Button } from "../../primitives/buttons/button.js";
|
|
5
|
+
import * as React$1 from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import { CheckIcon, CopyIcon } from "lucide-react";
|
|
8
|
+
import { AnimatePresence, motion } from "motion/react";
|
|
9
|
+
import { cva } from "class-variance-authority";
|
|
10
|
+
//#region src/core/animate-ui/components/buttons/copy.tsx
|
|
11
|
+
var buttonVariants = cva("flex items-center justify-center rounded-md transition-[box-shadow,_color,_background-color,_border-color,_outline-color,_text-decoration-color,_fill,_stroke] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", {
|
|
12
|
+
variants: {
|
|
13
|
+
variant: {
|
|
14
|
+
default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
|
|
15
|
+
accent: "bg-accent text-accent-foreground shadow-xs hover:bg-accent/90",
|
|
16
|
+
destructive: "bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
17
|
+
outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
18
|
+
secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
|
|
19
|
+
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
20
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
21
|
+
},
|
|
22
|
+
size: {
|
|
23
|
+
default: "size-9",
|
|
24
|
+
sm: "size-8 rounded-md",
|
|
25
|
+
lg: "size-10 rounded-md"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
defaultVariants: {
|
|
29
|
+
variant: "default",
|
|
30
|
+
size: "default"
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
function CopyButton({ className, content, copied, onCopiedChange, onClick, variant, size, delay = 3e3, ...props }) {
|
|
34
|
+
const [isCopied, setIsCopied] = useControlledState({
|
|
35
|
+
value: copied,
|
|
36
|
+
onChange: onCopiedChange
|
|
37
|
+
});
|
|
38
|
+
const handleCopy = React$1.useCallback((e) => {
|
|
39
|
+
onClick?.(e);
|
|
40
|
+
if (copied) return;
|
|
41
|
+
if (content) navigator.clipboard.writeText(content).then(() => {
|
|
42
|
+
setIsCopied(true);
|
|
43
|
+
onCopiedChange?.(true, content);
|
|
44
|
+
setTimeout(() => {
|
|
45
|
+
setIsCopied(false);
|
|
46
|
+
onCopiedChange?.(false);
|
|
47
|
+
}, delay);
|
|
48
|
+
}).catch((error) => {
|
|
49
|
+
console.error("Error copying command", error);
|
|
50
|
+
});
|
|
51
|
+
}, [
|
|
52
|
+
onClick,
|
|
53
|
+
copied,
|
|
54
|
+
content,
|
|
55
|
+
setIsCopied,
|
|
56
|
+
onCopiedChange,
|
|
57
|
+
delay
|
|
58
|
+
]);
|
|
59
|
+
const Icon = isCopied ? CheckIcon : CopyIcon;
|
|
60
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
61
|
+
"data-slot": "copy-button",
|
|
62
|
+
className: cn(buttonVariants({
|
|
63
|
+
variant,
|
|
64
|
+
size,
|
|
65
|
+
className
|
|
66
|
+
})),
|
|
67
|
+
onClick: handleCopy,
|
|
68
|
+
...props,
|
|
69
|
+
children: /* @__PURE__ */ jsx(AnimatePresence, {
|
|
70
|
+
mode: "popLayout",
|
|
71
|
+
children: /* @__PURE__ */ jsx(motion.span, {
|
|
72
|
+
"data-slot": "copy-button-icon",
|
|
73
|
+
initial: {
|
|
74
|
+
scale: 0,
|
|
75
|
+
opacity: .4,
|
|
76
|
+
filter: "blur(4px)"
|
|
77
|
+
},
|
|
78
|
+
animate: {
|
|
79
|
+
scale: 1,
|
|
80
|
+
opacity: 1,
|
|
81
|
+
filter: "blur(0px)"
|
|
82
|
+
},
|
|
83
|
+
exit: {
|
|
84
|
+
scale: 0,
|
|
85
|
+
opacity: .4,
|
|
86
|
+
filter: "blur(4px)"
|
|
87
|
+
},
|
|
88
|
+
transition: { duration: .25 },
|
|
89
|
+
children: /* @__PURE__ */ jsx(Icon, {})
|
|
90
|
+
}, isCopied ? "check" : "copy")
|
|
91
|
+
})
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
//#endregion
|
|
95
|
+
export { CopyButton, buttonVariants };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { cn } from "../../../../utils/cn.js";
|
|
2
|
+
import { Accordion as Accordion$1, AccordionContent as AccordionContent$1, AccordionHeader, AccordionItem as AccordionItem$1, AccordionTrigger as AccordionTrigger$1 } from "../../primitives/radix/accordion.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { ChevronDownIcon } from "lucide-react";
|
|
6
|
+
//#region src/core/animate-ui/components/radix/accordion.tsx
|
|
7
|
+
function Accordion(props) {
|
|
8
|
+
return /* @__PURE__ */ jsx(Accordion$1, { ...props });
|
|
9
|
+
}
|
|
10
|
+
function AccordionItem({ className, ...props }) {
|
|
11
|
+
return /* @__PURE__ */ jsx(AccordionItem$1, {
|
|
12
|
+
className: cn("border-b last:border-b-0", className),
|
|
13
|
+
...props
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function AccordionTrigger({ className, children, showArrow = true, ...props }) {
|
|
17
|
+
return /* @__PURE__ */ jsx(AccordionHeader, {
|
|
18
|
+
className: "flex",
|
|
19
|
+
children: /* @__PURE__ */ jsxs(AccordionTrigger$1, {
|
|
20
|
+
className: cn("flex flex-1 items-center justify-between py-4 text-left text-sm font-medium transition-all [&[data-state=open]>svg]:rotate-180", className),
|
|
21
|
+
...props,
|
|
22
|
+
children: [children, showArrow && /* @__PURE__ */ jsx(ChevronDownIcon, { className: "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-px transition-transform duration-200" })]
|
|
23
|
+
})
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function AccordionContent({ className, children, ...props }) {
|
|
27
|
+
return /* @__PURE__ */ jsx(AccordionContent$1, {
|
|
28
|
+
...props,
|
|
29
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
30
|
+
className: cn("pb-4 text-sm", className),
|
|
31
|
+
children
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { cn } from "../../../../utils/cn.js";
|
|
2
|
+
import { Dialog as Dialog$1, DialogClose as DialogClose$1, DialogContent as DialogContent$1, DialogDescription as DialogDescription$1, DialogFooter as DialogFooter$1, DialogHeader as DialogHeader$1, DialogOverlay as DialogOverlay$1, DialogPortal, DialogTitle as DialogTitle$1, DialogTrigger as DialogTrigger$1 } from "../../primitives/radix/dialog.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { XIcon } from "lucide-react";
|
|
6
|
+
//#region src/core/animate-ui/components/radix/dialog.tsx
|
|
7
|
+
function Dialog(props) {
|
|
8
|
+
return /* @__PURE__ */ jsx(Dialog$1, { ...props });
|
|
9
|
+
}
|
|
10
|
+
function DialogTrigger(props) {
|
|
11
|
+
return /* @__PURE__ */ jsx(DialogTrigger$1, { ...props });
|
|
12
|
+
}
|
|
13
|
+
function DialogClose(props) {
|
|
14
|
+
return /* @__PURE__ */ jsx(DialogClose$1, { ...props });
|
|
15
|
+
}
|
|
16
|
+
function DialogOverlay({ className, ...props }) {
|
|
17
|
+
return /* @__PURE__ */ jsx(DialogOverlay$1, {
|
|
18
|
+
className: cn("fixed inset-0 z-50 bg-black/50", className),
|
|
19
|
+
...props
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function DialogContent({ className, children, showCloseButton = true, closeButtonClassName, ...props }) {
|
|
23
|
+
return /* @__PURE__ */ jsxs(DialogPortal, { children: [/* @__PURE__ */ jsx(DialogOverlay, {}), /* @__PURE__ */ jsxs(DialogContent$1, {
|
|
24
|
+
className: cn("bg-background fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg sm:max-w-lg", className),
|
|
25
|
+
...props,
|
|
26
|
+
children: [children, showCloseButton && /* @__PURE__ */ jsxs(DialogClose$1, {
|
|
27
|
+
className: cn("ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 z-50 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", closeButtonClassName),
|
|
28
|
+
children: [/* @__PURE__ */ jsx(XIcon, {}), /* @__PURE__ */ jsx("span", {
|
|
29
|
+
className: "sr-only",
|
|
30
|
+
children: "Close"
|
|
31
|
+
})]
|
|
32
|
+
})]
|
|
33
|
+
})] });
|
|
34
|
+
}
|
|
35
|
+
function DialogHeader({ className, ...props }) {
|
|
36
|
+
return /* @__PURE__ */ jsx(DialogHeader$1, {
|
|
37
|
+
className: cn("flex flex-col gap-2 text-center sm:text-left", className),
|
|
38
|
+
...props
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function DialogFooter({ className, ...props }) {
|
|
42
|
+
return /* @__PURE__ */ jsx(DialogFooter$1, {
|
|
43
|
+
className: cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className),
|
|
44
|
+
...props
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function DialogTitle({ className, ...props }) {
|
|
48
|
+
return /* @__PURE__ */ jsx(DialogTitle$1, {
|
|
49
|
+
className: cn("text-lg leading-none font-semibold", className),
|
|
50
|
+
...props
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function DialogDescription({ className, ...props }) {
|
|
54
|
+
return /* @__PURE__ */ jsx(DialogDescription$1, {
|
|
55
|
+
className: cn("text-muted-foreground text-sm", className),
|
|
56
|
+
...props
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
//#endregion
|
|
60
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger };
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { cn } from "../../../../utils/cn.js";
|
|
2
|
+
import { DropdownMenu as DropdownMenu$1, DropdownMenuCheckboxItem as DropdownMenuCheckboxItem$1, DropdownMenuContent as DropdownMenuContent$1, DropdownMenuGroup as DropdownMenuGroup$1, DropdownMenuHighlight, DropdownMenuHighlightItem, DropdownMenuItem as DropdownMenuItem$1, DropdownMenuItemIndicator, DropdownMenuLabel as DropdownMenuLabel$1, DropdownMenuRadioGroup as DropdownMenuRadioGroup$1, DropdownMenuRadioItem as DropdownMenuRadioItem$1, DropdownMenuSeparator as DropdownMenuSeparator$1, DropdownMenuShortcut as DropdownMenuShortcut$1, DropdownMenuSub as DropdownMenuSub$1, DropdownMenuSubContent as DropdownMenuSubContent$1, DropdownMenuSubTrigger as DropdownMenuSubTrigger$1, DropdownMenuTrigger as DropdownMenuTrigger$1 } from "../../primitives/radix/dropdown-menu.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react";
|
|
6
|
+
//#region src/core/animate-ui/components/radix/dropdown-menu.tsx
|
|
7
|
+
function DropdownMenu(props) {
|
|
8
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1, { ...props });
|
|
9
|
+
}
|
|
10
|
+
function DropdownMenuTrigger(props) {
|
|
11
|
+
return /* @__PURE__ */ jsx(DropdownMenuTrigger$1, { ...props });
|
|
12
|
+
}
|
|
13
|
+
function DropdownMenuContent({ sideOffset = 4, className, children, ...props }) {
|
|
14
|
+
return /* @__PURE__ */ jsx(DropdownMenuContent$1, {
|
|
15
|
+
sideOffset,
|
|
16
|
+
className: cn("bg-popover text-popover-foreground z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] max-w-xs origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-2xl border px-1 py-1.5 shadow-lg outline-none will-change-[opacity,transform] select-none", className),
|
|
17
|
+
...props,
|
|
18
|
+
children: /* @__PURE__ */ jsx(DropdownMenuHighlight, {
|
|
19
|
+
className: "absolute inset-0 bg-accent z-0 rounded-sm",
|
|
20
|
+
children
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function DropdownMenuGroup({ ...props }) {
|
|
25
|
+
return /* @__PURE__ */ jsx(DropdownMenuGroup$1, { ...props });
|
|
26
|
+
}
|
|
27
|
+
function DropdownMenuItem({ className, inset, variant = "default", disabled, ...props }) {
|
|
28
|
+
return /* @__PURE__ */ jsx(DropdownMenuHighlightItem, {
|
|
29
|
+
activeClassName: variant === "destructive" ? "bg-destructive/10 dark:bg-destructive/20" : "",
|
|
30
|
+
disabled,
|
|
31
|
+
children: /* @__PURE__ */ jsx(DropdownMenuItem$1, {
|
|
32
|
+
disabled,
|
|
33
|
+
"data-inset": inset,
|
|
34
|
+
"data-variant": variant,
|
|
35
|
+
className: cn("focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
36
|
+
...props
|
|
37
|
+
})
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function DropdownMenuCheckboxItem({ className, children, checked, disabled, ...props }) {
|
|
41
|
+
return /* @__PURE__ */ jsx(DropdownMenuHighlightItem, {
|
|
42
|
+
disabled,
|
|
43
|
+
children: /* @__PURE__ */ jsxs(DropdownMenuCheckboxItem$1, {
|
|
44
|
+
disabled,
|
|
45
|
+
className: cn("focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
46
|
+
checked,
|
|
47
|
+
...props,
|
|
48
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
49
|
+
className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",
|
|
50
|
+
children: /* @__PURE__ */ jsx(DropdownMenuItemIndicator, {
|
|
51
|
+
initial: {
|
|
52
|
+
opacity: 0,
|
|
53
|
+
scale: .5
|
|
54
|
+
},
|
|
55
|
+
animate: {
|
|
56
|
+
opacity: 1,
|
|
57
|
+
scale: 1
|
|
58
|
+
},
|
|
59
|
+
children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" })
|
|
60
|
+
})
|
|
61
|
+
}), children]
|
|
62
|
+
})
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function DropdownMenuRadioGroup(props) {
|
|
66
|
+
return /* @__PURE__ */ jsx(DropdownMenuRadioGroup$1, { ...props });
|
|
67
|
+
}
|
|
68
|
+
function DropdownMenuRadioItem({ className, children, disabled, ...props }) {
|
|
69
|
+
return /* @__PURE__ */ jsx(DropdownMenuHighlightItem, {
|
|
70
|
+
disabled,
|
|
71
|
+
children: /* @__PURE__ */ jsxs(DropdownMenuRadioItem$1, {
|
|
72
|
+
disabled,
|
|
73
|
+
className: cn("focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
74
|
+
...props,
|
|
75
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
76
|
+
className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",
|
|
77
|
+
children: /* @__PURE__ */ jsx(DropdownMenuItemIndicator, {
|
|
78
|
+
layoutId: "dropdown-menu-item-indicator-radio",
|
|
79
|
+
children: /* @__PURE__ */ jsx(CircleIcon, { className: "size-2 fill-current" })
|
|
80
|
+
})
|
|
81
|
+
}), children]
|
|
82
|
+
})
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
function DropdownMenuLabel({ className, inset, ...props }) {
|
|
86
|
+
return /* @__PURE__ */ jsx(DropdownMenuLabel$1, {
|
|
87
|
+
"data-inset": inset,
|
|
88
|
+
className: cn("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8", className),
|
|
89
|
+
...props
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
function DropdownMenuSeparator({ className, ...props }) {
|
|
93
|
+
return /* @__PURE__ */ jsx(DropdownMenuSeparator$1, {
|
|
94
|
+
className: cn("bg-border -mx-1 my-1 h-px", className),
|
|
95
|
+
...props
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
function DropdownMenuShortcut({ className, ...props }) {
|
|
99
|
+
return /* @__PURE__ */ jsx(DropdownMenuShortcut$1, {
|
|
100
|
+
className: cn("text-muted-foreground ml-auto text-xs tracking-widest", className),
|
|
101
|
+
...props
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
function DropdownMenuSub(props) {
|
|
105
|
+
return /* @__PURE__ */ jsx(DropdownMenuSub$1, { ...props });
|
|
106
|
+
}
|
|
107
|
+
function DropdownMenuSubTrigger({ disabled, className, inset, children, ...props }) {
|
|
108
|
+
return /* @__PURE__ */ jsx(DropdownMenuHighlightItem, {
|
|
109
|
+
disabled,
|
|
110
|
+
children: /* @__PURE__ */ jsxs(DropdownMenuSubTrigger$1, {
|
|
111
|
+
disabled,
|
|
112
|
+
"data-inset": inset,
|
|
113
|
+
className: cn("focus:text-accent-foreground data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8", "data-[state=open]:[&_[data-slot=chevron]]:rotate-90 [&_[data-slot=chevron]]:transition-transform [&_[data-slot=chevron]]:duration-300 [&_[data-slot=chevron]]:ease-in-out", className),
|
|
114
|
+
...props,
|
|
115
|
+
children: [children, /* @__PURE__ */ jsx(ChevronRightIcon, {
|
|
116
|
+
"data-slot": "chevron",
|
|
117
|
+
className: "ml-auto size-4"
|
|
118
|
+
})]
|
|
119
|
+
})
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
function DropdownMenuSubContent({ className, ...props }) {
|
|
123
|
+
return /* @__PURE__ */ jsx(DropdownMenuSubContent$1, {
|
|
124
|
+
className: cn("bg-popover text-popover-foreground z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg outline-none", className),
|
|
125
|
+
...props
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
//#endregion
|
|
129
|
+
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger };
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { cn } from "../../../../utils/cn.js";
|
|
2
|
+
import { Sheet as Sheet$1, SheetClose as SheetClose$1, SheetContent as SheetContent$1, SheetDescription as SheetDescription$1, SheetFooter as SheetFooter$1, SheetHeader as SheetHeader$1, SheetOverlay as SheetOverlay$1, SheetPortal, SheetTitle as SheetTitle$1, SheetTrigger as SheetTrigger$1 } from "../../primitives/radix/sheet.js";
|
|
3
|
+
import * as React$1 from "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { XIcon } from "lucide-react";
|
|
6
|
+
//#region src/core/animate-ui/components/radix/sheet.tsx
|
|
7
|
+
var SheetFloatingContext = React$1.createContext(false);
|
|
8
|
+
var SheetDismissContext = React$1.createContext({
|
|
9
|
+
closeOnEscape: true,
|
|
10
|
+
closeOnOutsideClick: true
|
|
11
|
+
});
|
|
12
|
+
function Sheet({ floating = false, closeOnEscape = true, closeOnOutsideClick = true, ...props }) {
|
|
13
|
+
const dismissBehavior = React$1.useMemo(() => ({
|
|
14
|
+
closeOnEscape,
|
|
15
|
+
closeOnOutsideClick
|
|
16
|
+
}), [closeOnEscape, closeOnOutsideClick]);
|
|
17
|
+
return /* @__PURE__ */ jsx(SheetFloatingContext.Provider, {
|
|
18
|
+
value: floating,
|
|
19
|
+
children: /* @__PURE__ */ jsx(SheetDismissContext.Provider, {
|
|
20
|
+
value: dismissBehavior,
|
|
21
|
+
children: /* @__PURE__ */ jsx(Sheet$1, { ...props })
|
|
22
|
+
})
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function SheetTrigger(props) {
|
|
26
|
+
return /* @__PURE__ */ jsx(SheetTrigger$1, { ...props });
|
|
27
|
+
}
|
|
28
|
+
function SheetOverlay({ className, ...props }) {
|
|
29
|
+
return /* @__PURE__ */ jsx(SheetOverlay$1, {
|
|
30
|
+
className: cn("fixed inset-0 z-50 bg-black/50", className),
|
|
31
|
+
...props
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function SheetClose(props) {
|
|
35
|
+
return /* @__PURE__ */ jsx(SheetClose$1, { ...props });
|
|
36
|
+
}
|
|
37
|
+
function SheetContent({ className, children, side = "right", showCloseButton = true, onEscapeKeyDown, onPointerDownOutside, ...props }) {
|
|
38
|
+
const floating = React$1.useContext(SheetFloatingContext);
|
|
39
|
+
const { closeOnEscape, closeOnOutsideClick } = React$1.useContext(SheetDismissContext);
|
|
40
|
+
const closeClassName = "ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none";
|
|
41
|
+
if (floating) return /* @__PURE__ */ jsxs(SheetPortal, { children: [/* @__PURE__ */ jsx(SheetOverlay, {}), /* @__PURE__ */ jsx(SheetContent$1, {
|
|
42
|
+
className: cn("fixed z-50 !p-3", side === "right" && "h-full w-[350px] max-w-full", side === "left" && "h-full w-[350px] max-w-full", side === "top" && "h-[350px] w-full", side === "bottom" && "h-[350px] w-full", className),
|
|
43
|
+
side,
|
|
44
|
+
onEscapeKeyDown: (event) => {
|
|
45
|
+
onEscapeKeyDown?.(event);
|
|
46
|
+
if (!closeOnEscape) event.preventDefault();
|
|
47
|
+
},
|
|
48
|
+
onPointerDownOutside: (event) => {
|
|
49
|
+
onPointerDownOutside?.(event);
|
|
50
|
+
if (!closeOnOutsideClick) event.preventDefault();
|
|
51
|
+
},
|
|
52
|
+
...props,
|
|
53
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
54
|
+
className: "bg-background relative flex h-full flex-col gap-0 rounded-lg shadow-lg overflow-auto",
|
|
55
|
+
children: [children, showCloseButton && /* @__PURE__ */ jsxs(SheetClose, {
|
|
56
|
+
className: closeClassName,
|
|
57
|
+
children: [/* @__PURE__ */ jsx(XIcon, { className: "size-4" }), /* @__PURE__ */ jsx("span", {
|
|
58
|
+
className: "sr-only",
|
|
59
|
+
children: "Close"
|
|
60
|
+
})]
|
|
61
|
+
})]
|
|
62
|
+
})
|
|
63
|
+
})] });
|
|
64
|
+
return /* @__PURE__ */ jsxs(SheetPortal, { children: [/* @__PURE__ */ jsx(SheetOverlay, {}), /* @__PURE__ */ jsxs(SheetContent$1, {
|
|
65
|
+
className: cn("bg-background fixed z-50 flex flex-col gap-0 shadow-lg", side === "right" && "h-full w-[350px] max-w-full border-l", side === "left" && "h-full w-[350px] max-w-full border-r", side === "top" && "h-[350px] w-full border-b", side === "bottom" && "h-[350px] w-full border-t", className),
|
|
66
|
+
side,
|
|
67
|
+
onEscapeKeyDown: (event) => {
|
|
68
|
+
onEscapeKeyDown?.(event);
|
|
69
|
+
if (!closeOnEscape) event.preventDefault();
|
|
70
|
+
},
|
|
71
|
+
onPointerDownOutside: (event) => {
|
|
72
|
+
onPointerDownOutside?.(event);
|
|
73
|
+
if (!closeOnOutsideClick) event.preventDefault();
|
|
74
|
+
},
|
|
75
|
+
...props,
|
|
76
|
+
children: [children, showCloseButton && /* @__PURE__ */ jsxs(SheetClose, {
|
|
77
|
+
className: closeClassName,
|
|
78
|
+
children: [/* @__PURE__ */ jsx(XIcon, { className: "size-4" }), /* @__PURE__ */ jsx("span", {
|
|
79
|
+
className: "sr-only",
|
|
80
|
+
children: "Close"
|
|
81
|
+
})]
|
|
82
|
+
})]
|
|
83
|
+
})] });
|
|
84
|
+
}
|
|
85
|
+
function SheetHeader({ className, ...props }) {
|
|
86
|
+
return /* @__PURE__ */ jsx(SheetHeader$1, {
|
|
87
|
+
className: cn("flex flex-col gap-1.5 p-4", className),
|
|
88
|
+
...props
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
function SheetFooter({ className, ...props }) {
|
|
92
|
+
return /* @__PURE__ */ jsx(SheetFooter$1, {
|
|
93
|
+
className: cn("mt-auto flex flex-col gap-2 p-4", className),
|
|
94
|
+
...props
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
function SheetTitle({ className, ...props }) {
|
|
98
|
+
return /* @__PURE__ */ jsx(SheetTitle$1, {
|
|
99
|
+
className: cn("text-foreground font-semibold", className),
|
|
100
|
+
...props
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
function SheetDescription({ className, ...props }) {
|
|
104
|
+
return /* @__PURE__ */ jsx(SheetDescription$1, {
|
|
105
|
+
className: cn("text-muted-foreground text-sm", className),
|
|
106
|
+
...props
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
//#endregion
|
|
110
|
+
export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger };
|