@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,45 @@
|
|
|
1
|
+
import { cn } from "./cn.js";
|
|
2
|
+
import { SilverMetallicBorderOverlay, SilverShineOverlay } from "./silver-shine.js";
|
|
3
|
+
import { VARIANT_GRADIENT_BACKDROP_BASE, VARIANT_GRADIENT_HOVER_OVERLAY_CLASS } from "./variant.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region src/utils/variant-gradient-underlay.tsx
|
|
7
|
+
/**
|
|
8
|
+
* Smooth gradient hover uses two stacked backgrounds and fades the hover layer in with
|
|
9
|
+
* `opacity` (`group-hover`). Two different `background-image` values on one element cannot
|
|
10
|
+
* interpolate in CSS.
|
|
11
|
+
*/
|
|
12
|
+
function VariantGradientUnderlay({ layers, layersInline, silverShine = false, silverBorder = false }) {
|
|
13
|
+
const shine = silverShine ? /* @__PURE__ */ jsx(SilverShineOverlay, {}) : null;
|
|
14
|
+
const border = silverBorder ? /* @__PURE__ */ jsx(SilverMetallicBorderOverlay, {}) : null;
|
|
15
|
+
if (layers != null) return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
16
|
+
/* @__PURE__ */ jsx("span", {
|
|
17
|
+
"aria-hidden": true,
|
|
18
|
+
className: cn(VARIANT_GRADIENT_BACKDROP_BASE, layers.idle)
|
|
19
|
+
}),
|
|
20
|
+
/* @__PURE__ */ jsx("span", {
|
|
21
|
+
"aria-hidden": true,
|
|
22
|
+
className: cn(VARIANT_GRADIENT_BACKDROP_BASE, layers.hover, VARIANT_GRADIENT_HOVER_OVERLAY_CLASS)
|
|
23
|
+
}),
|
|
24
|
+
shine,
|
|
25
|
+
border
|
|
26
|
+
] });
|
|
27
|
+
if (layersInline != null) return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
28
|
+
/* @__PURE__ */ jsx("span", {
|
|
29
|
+
"aria-hidden": true,
|
|
30
|
+
className: VARIANT_GRADIENT_BACKDROP_BASE,
|
|
31
|
+
style: layersInline.idle
|
|
32
|
+
}),
|
|
33
|
+
/* @__PURE__ */ jsx("span", {
|
|
34
|
+
"aria-hidden": true,
|
|
35
|
+
className: cn(VARIANT_GRADIENT_BACKDROP_BASE, VARIANT_GRADIENT_HOVER_OVERLAY_CLASS),
|
|
36
|
+
style: layersInline.hover
|
|
37
|
+
}),
|
|
38
|
+
shine,
|
|
39
|
+
border
|
|
40
|
+
] });
|
|
41
|
+
if (shine || border) return /* @__PURE__ */ jsxs(Fragment$1, { children: [shine, border] });
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
export { VariantGradientUnderlay };
|
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
import { cn } from "./cn.js";
|
|
2
|
+
import { isPresetColor, resolveColor } from "./color.js";
|
|
3
|
+
import { SILVER_SOLID_SURFACE_STYLE } from "./silver-shine.js";
|
|
4
|
+
//#region src/utils/variant.ts
|
|
5
|
+
var VARIANTS = [
|
|
6
|
+
"outline",
|
|
7
|
+
"solid",
|
|
8
|
+
"soft",
|
|
9
|
+
"gradient"
|
|
10
|
+
];
|
|
11
|
+
/** Duration (ms) for shared gradient hover animations (preset surfaces + overlay crossfade). */
|
|
12
|
+
var VARIANT_GRADIENT_TRANSITION_DURATION_MS = 2e3;
|
|
13
|
+
/**
|
|
14
|
+
* Tailwind duration class — keep in sync with {@link VARIANT_GRADIENT_TRANSITION_DURATION_MS}
|
|
15
|
+
* so preset gradients, arbitrary gradient styles, and gradient backdrop overlays feel consistent.
|
|
16
|
+
*/
|
|
17
|
+
var VARIANT_GRADIENT_DURATION_CLASS = "duration-[2000ms]";
|
|
18
|
+
/**
|
|
19
|
+
* Gradient hover cannot interpolate between two Tailwind `background-image` values on one
|
|
20
|
+
* element (it snaps). Preset gradients use crossfading absolute underlays + `opacity` instead.
|
|
21
|
+
*/
|
|
22
|
+
var VARIANT_GRADIENT_BACKDROP_BASE = "pointer-events-none absolute inset-0 -z-10 rounded-[inherit] bg-[length:100%_100%]";
|
|
23
|
+
var VARIANT_GRADIENT_HOVER_OVERLAY_CLASS = cn("opacity-0 transition-opacity ease-in-out group-hover:opacity-100", VARIANT_GRADIENT_DURATION_CLASS);
|
|
24
|
+
/** Transparent frame + text/icon tint — gradients paint on {@link PRESET_GRADIENT_BACKDROP} layers. */
|
|
25
|
+
var PRESET_GRADIENT_FRAME = {
|
|
26
|
+
primary: "border border-primary/20 bg-transparent text-primary [&>svg]:text-primary",
|
|
27
|
+
secondary: "border border-secondary/20 bg-transparent text-secondary [&>svg]:text-secondary",
|
|
28
|
+
info: "border border-info/20 bg-transparent text-info [&>svg]:text-info",
|
|
29
|
+
warning: "border border-warning/20 bg-transparent text-warning [&>svg]:text-warning",
|
|
30
|
+
error: "border border-error/20 bg-transparent text-error [&>svg]:text-error",
|
|
31
|
+
success: "border border-success/20 bg-transparent text-success [&>svg]:text-success",
|
|
32
|
+
disabled: "border border-disabled/20 bg-transparent text-disabled [&>svg]:text-disabled",
|
|
33
|
+
gray: "border border-gray/20 bg-transparent text-gray [&>svg]:text-gray",
|
|
34
|
+
mist: "border border-mist-border bg-transparent text-mist-foreground [&>svg]:text-mist-foreground"
|
|
35
|
+
};
|
|
36
|
+
var PRESET_GRADIENT_BACKDROP = {
|
|
37
|
+
primary: {
|
|
38
|
+
idle: "bg-gradient-to-r from-primary/5 via-primary/10 to-primary/5",
|
|
39
|
+
hover: "bg-gradient-to-r from-primary/10 via-primary/5 to-primary/10"
|
|
40
|
+
},
|
|
41
|
+
secondary: {
|
|
42
|
+
idle: "bg-gradient-to-r from-secondary/5 via-secondary/10 to-secondary/5",
|
|
43
|
+
hover: "bg-gradient-to-r from-secondary/10 via-secondary/5 to-secondary/10"
|
|
44
|
+
},
|
|
45
|
+
info: {
|
|
46
|
+
idle: "bg-gradient-to-r from-info/5 via-info/10 to-info/5",
|
|
47
|
+
hover: "bg-gradient-to-r from-info/10 via-info/5 to-info/10"
|
|
48
|
+
},
|
|
49
|
+
warning: {
|
|
50
|
+
idle: "bg-gradient-to-r from-warning/5 via-warning/10 to-warning/5",
|
|
51
|
+
hover: "bg-gradient-to-r from-warning/10 via-warning/5 to-warning/10"
|
|
52
|
+
},
|
|
53
|
+
error: {
|
|
54
|
+
idle: "bg-gradient-to-r from-error/5 via-error/10 to-error/5",
|
|
55
|
+
hover: "bg-gradient-to-r from-error/10 via-error/5 to-error/10"
|
|
56
|
+
},
|
|
57
|
+
success: {
|
|
58
|
+
idle: "bg-gradient-to-r from-success/5 via-success/10 to-success/5",
|
|
59
|
+
hover: "bg-gradient-to-r from-success/10 via-success/5 to-success/10"
|
|
60
|
+
},
|
|
61
|
+
disabled: {
|
|
62
|
+
idle: "bg-gradient-to-r from-disabled/5 via-disabled/10 to-disabled/5",
|
|
63
|
+
hover: "bg-gradient-to-r from-disabled/10 via-disabled/5 to-disabled/10"
|
|
64
|
+
},
|
|
65
|
+
gray: {
|
|
66
|
+
idle: "bg-gradient-to-r from-gray/5 via-gray/10 to-gray/5",
|
|
67
|
+
hover: "bg-gradient-to-r from-gray/10 via-gray/5 to-gray/10"
|
|
68
|
+
},
|
|
69
|
+
mist: {
|
|
70
|
+
idle: "bg-gradient-to-r from-mist via-mist-border to-mist",
|
|
71
|
+
hover: "bg-gradient-to-r from-mist-border via-mist to-mist-border"
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Backdrop layers for `color === "silver" + variant === "gradient"`. Intentionally lighter than
|
|
76
|
+
* {@link PRESET_GRADIENT_BACKDROP.gray} (roughly half the gray opacity) so the surface reads as
|
|
77
|
+
* a polished, brighter "silver" instead of just a shinier `gray`. The cool/metallic feel comes
|
|
78
|
+
* from `SilverShineOverlay` painted on top.
|
|
79
|
+
*/
|
|
80
|
+
var SILVER_GRADIENT_BACKDROP = {
|
|
81
|
+
idle: "bg-gradient-to-r from-gray/2 via-gray/5 to-gray/2",
|
|
82
|
+
hover: "bg-gradient-to-r from-gray/5 via-gray/2 to-gray/5"
|
|
83
|
+
};
|
|
84
|
+
/** Non-preset `gradient` variant: `backgroundImage` for arbitrary colors (`idle` / `hover`). */
|
|
85
|
+
function arbitraryGradientBackgroundImage(color, emphasis) {
|
|
86
|
+
const mix = (pct) => `color-mix(in srgb, ${color} ${pct}%, transparent)`;
|
|
87
|
+
const [a, b, c] = emphasis === "idle" ? [
|
|
88
|
+
5,
|
|
89
|
+
10,
|
|
90
|
+
5
|
|
91
|
+
] : [
|
|
92
|
+
10,
|
|
93
|
+
5,
|
|
94
|
+
10
|
|
95
|
+
];
|
|
96
|
+
return `linear-gradient(to right, ${mix(a)}, ${mix(b)}, ${mix(c)})`;
|
|
97
|
+
}
|
|
98
|
+
var PRESET_VARIANT_STYLES = {
|
|
99
|
+
primary: {
|
|
100
|
+
soft: {
|
|
101
|
+
container: "border border-primary/10 bg-primary/5 text-primary [&>svg]:text-primary",
|
|
102
|
+
foreground: "text-primary",
|
|
103
|
+
description: "text-primary/80"
|
|
104
|
+
},
|
|
105
|
+
outline: {
|
|
106
|
+
container: "bg-transparent border border-primary/50 dark:border-primary/30 text-primary [&>svg]:text-primary",
|
|
107
|
+
foreground: "text-primary",
|
|
108
|
+
description: "text-primary/80"
|
|
109
|
+
},
|
|
110
|
+
solid: {
|
|
111
|
+
container: "border border-transparent bg-primary text-primary-foreground [&>svg]:text-primary-foreground",
|
|
112
|
+
foreground: "text-primary-foreground",
|
|
113
|
+
description: "text-primary-foreground/80"
|
|
114
|
+
},
|
|
115
|
+
gradient: {
|
|
116
|
+
container: "",
|
|
117
|
+
foreground: "text-primary",
|
|
118
|
+
description: "text-primary/60"
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
secondary: {
|
|
122
|
+
soft: {
|
|
123
|
+
container: "border border-secondary/10 bg-secondary/5 text-secondary [&>svg]:text-secondary",
|
|
124
|
+
foreground: "text-secondary",
|
|
125
|
+
description: "text-secondary/80"
|
|
126
|
+
},
|
|
127
|
+
outline: {
|
|
128
|
+
container: "bg-transparent border border-secondary/50 dark:border-secondary/30 text-secondary [&>svg]:text-secondary",
|
|
129
|
+
foreground: "text-secondary",
|
|
130
|
+
description: "text-secondary/80"
|
|
131
|
+
},
|
|
132
|
+
solid: {
|
|
133
|
+
container: "border border-transparent bg-secondary text-secondary-foreground [&>svg]:text-secondary-foreground",
|
|
134
|
+
foreground: "text-secondary-foreground",
|
|
135
|
+
description: "text-secondary-foreground/80"
|
|
136
|
+
},
|
|
137
|
+
gradient: {
|
|
138
|
+
container: "",
|
|
139
|
+
foreground: "text-secondary",
|
|
140
|
+
description: "text-secondary/60"
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
info: {
|
|
144
|
+
soft: {
|
|
145
|
+
container: "border border-info/10 bg-info/5 text-info [&>svg]:text-info",
|
|
146
|
+
foreground: "text-info",
|
|
147
|
+
description: "text-info/80"
|
|
148
|
+
},
|
|
149
|
+
outline: {
|
|
150
|
+
container: "bg-transparent border border-info/50 dark:border-info/30 text-info [&>svg]:text-info",
|
|
151
|
+
foreground: "text-info",
|
|
152
|
+
description: "text-info/80"
|
|
153
|
+
},
|
|
154
|
+
solid: {
|
|
155
|
+
container: "border border-transparent bg-info text-info-foreground [&>svg]:text-info-foreground",
|
|
156
|
+
foreground: "text-info-foreground",
|
|
157
|
+
description: "text-info-foreground/80"
|
|
158
|
+
},
|
|
159
|
+
gradient: {
|
|
160
|
+
container: "",
|
|
161
|
+
foreground: "text-info",
|
|
162
|
+
description: "text-info/60"
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
warning: {
|
|
166
|
+
soft: {
|
|
167
|
+
container: "border border-warning/10 bg-warning/5 text-warning [&>svg]:text-warning",
|
|
168
|
+
foreground: "text-warning",
|
|
169
|
+
description: "text-warning"
|
|
170
|
+
},
|
|
171
|
+
outline: {
|
|
172
|
+
container: "bg-transparent border border-warning/50 dark:border-warning/30 text-warning [&>svg]:text-warning",
|
|
173
|
+
foreground: "text-warning",
|
|
174
|
+
description: "text-warning"
|
|
175
|
+
},
|
|
176
|
+
solid: {
|
|
177
|
+
container: "border border-transparent bg-warning text-warning-foreground [&>svg]:text-warning-foreground",
|
|
178
|
+
foreground: "text-warning-foreground",
|
|
179
|
+
description: "text-warning-foreground/80"
|
|
180
|
+
},
|
|
181
|
+
gradient: {
|
|
182
|
+
container: "",
|
|
183
|
+
foreground: "text-warning",
|
|
184
|
+
description: "text-warning/60"
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
error: {
|
|
188
|
+
soft: {
|
|
189
|
+
container: "border border-error/10 bg-error/5 text-error [&>svg]:text-error",
|
|
190
|
+
foreground: "text-error",
|
|
191
|
+
description: "text-error/80"
|
|
192
|
+
},
|
|
193
|
+
outline: {
|
|
194
|
+
container: "bg-transparent border border-error/50 dark:border-error/30 text-error [&>svg]:text-error",
|
|
195
|
+
foreground: "text-error",
|
|
196
|
+
description: "text-error/80"
|
|
197
|
+
},
|
|
198
|
+
solid: {
|
|
199
|
+
container: "border border-transparent bg-error text-error-foreground [&>svg]:text-error-foreground",
|
|
200
|
+
foreground: "text-error-foreground",
|
|
201
|
+
description: "text-error-foreground/80"
|
|
202
|
+
},
|
|
203
|
+
gradient: {
|
|
204
|
+
container: "",
|
|
205
|
+
foreground: "text-error",
|
|
206
|
+
description: "text-error/60"
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
success: {
|
|
210
|
+
soft: {
|
|
211
|
+
container: "border border-success/10 bg-success/5 text-success [&>svg]:text-success",
|
|
212
|
+
foreground: "text-success",
|
|
213
|
+
description: "text-success/80"
|
|
214
|
+
},
|
|
215
|
+
outline: {
|
|
216
|
+
container: "bg-transparent border border-success/50 dark:border-success/30 text-success [&>svg]:text-success",
|
|
217
|
+
foreground: "text-success",
|
|
218
|
+
description: "text-success/80"
|
|
219
|
+
},
|
|
220
|
+
solid: {
|
|
221
|
+
container: "border border-transparent bg-success text-success-foreground [&>svg]:text-success-foreground",
|
|
222
|
+
foreground: "text-success-foreground",
|
|
223
|
+
description: "text-success-foreground/80"
|
|
224
|
+
},
|
|
225
|
+
gradient: {
|
|
226
|
+
container: "",
|
|
227
|
+
foreground: "text-success",
|
|
228
|
+
description: "text-success/60"
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
disabled: {
|
|
232
|
+
soft: {
|
|
233
|
+
container: "border border-disabled/10 bg-disabled/5 text-disabled [&>svg]:text-disabled",
|
|
234
|
+
foreground: "text-disabled",
|
|
235
|
+
description: "text-disabled/80"
|
|
236
|
+
},
|
|
237
|
+
outline: {
|
|
238
|
+
container: "bg-transparent border border-disabled/50 dark:border-disabled/30 text-disabled [&>svg]:text-disabled",
|
|
239
|
+
foreground: "text-disabled",
|
|
240
|
+
description: "text-disabled/80"
|
|
241
|
+
},
|
|
242
|
+
solid: {
|
|
243
|
+
container: "border border-transparent bg-disabled text-disabled-foreground [&>svg]:text-disabled-foreground",
|
|
244
|
+
foreground: "text-disabled-foreground",
|
|
245
|
+
description: "text-disabled-foreground/80"
|
|
246
|
+
},
|
|
247
|
+
gradient: {
|
|
248
|
+
container: "",
|
|
249
|
+
foreground: "text-disabled",
|
|
250
|
+
description: "text-disabled/60"
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
gray: {
|
|
254
|
+
soft: {
|
|
255
|
+
container: "border border-gray/10 bg-gray/5 text-gray [&>svg]:text-gray",
|
|
256
|
+
foreground: "text-gray",
|
|
257
|
+
description: "text-gray/80"
|
|
258
|
+
},
|
|
259
|
+
outline: {
|
|
260
|
+
container: "bg-transparent border border-gray/50 dark:border-gray/30 text-gray [&>svg]:text-gray",
|
|
261
|
+
foreground: "text-gray",
|
|
262
|
+
description: "text-gray/80"
|
|
263
|
+
},
|
|
264
|
+
solid: {
|
|
265
|
+
container: "border border-transparent bg-gray text-gray-foreground [&>svg]:text-gray-foreground",
|
|
266
|
+
foreground: "text-gray-foreground",
|
|
267
|
+
description: "text-gray-foreground/80"
|
|
268
|
+
},
|
|
269
|
+
gradient: {
|
|
270
|
+
container: "",
|
|
271
|
+
foreground: "text-gray",
|
|
272
|
+
description: "text-gray/60"
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
mist: {
|
|
276
|
+
soft: {
|
|
277
|
+
container: "border border-mist-border bg-mist text-mist-foreground [&>svg]:text-mist-foreground",
|
|
278
|
+
foreground: "text-mist-foreground",
|
|
279
|
+
description: "text-mist-secondary"
|
|
280
|
+
},
|
|
281
|
+
outline: {
|
|
282
|
+
container: "bg-transparent border border-mist-border text-mist-foreground [&>svg]:text-mist-foreground",
|
|
283
|
+
foreground: "text-mist-foreground",
|
|
284
|
+
description: "text-mist-secondary"
|
|
285
|
+
},
|
|
286
|
+
solid: {
|
|
287
|
+
container: "border border-transparent bg-mist text-mist-foreground [&>svg]:text-mist-foreground",
|
|
288
|
+
foreground: "text-mist-foreground",
|
|
289
|
+
description: "text-mist-secondary"
|
|
290
|
+
},
|
|
291
|
+
gradient: {
|
|
292
|
+
container: "",
|
|
293
|
+
foreground: "text-mist-foreground",
|
|
294
|
+
description: "text-mist-secondary"
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
};
|
|
298
|
+
/**
|
|
299
|
+
* Brand-specific `silver` color (not a `PresetColor` — see {@link resolveVariantStyles}).
|
|
300
|
+
* Visually a gray surface with a {@link SilverShineOverlay} on top; soft uses the very subtle
|
|
301
|
+
* tint requested by design (`bg-gray/2 border-gray/5`).
|
|
302
|
+
*/
|
|
303
|
+
var SILVER_VARIANT_ROWS = {
|
|
304
|
+
soft: {
|
|
305
|
+
container: "border border-gray/5 bg-gray/2 text-gray [&>svg]:text-gray",
|
|
306
|
+
foreground: "text-gray",
|
|
307
|
+
description: "text-gray/80"
|
|
308
|
+
},
|
|
309
|
+
outline: {
|
|
310
|
+
/** No `border-*` here — the metallic ring is painted by `SilverMetallicBorderOverlay`. */
|
|
311
|
+
container: "bg-transparent border-0 text-gray [&>svg]:text-gray",
|
|
312
|
+
foreground: "text-gray",
|
|
313
|
+
description: "text-gray/80"
|
|
314
|
+
},
|
|
315
|
+
solid: {
|
|
316
|
+
/** Metallic surface gradient layered on top of `bg-gray` via `SILVER_SOLID_SURFACE_STYLE`. */
|
|
317
|
+
container: "border border-transparent bg-gray text-gray-foreground [&>svg]:text-gray-foreground",
|
|
318
|
+
foreground: "text-gray-foreground",
|
|
319
|
+
description: "text-gray-foreground/80"
|
|
320
|
+
},
|
|
321
|
+
gradient: {
|
|
322
|
+
container: "",
|
|
323
|
+
foreground: "text-gray",
|
|
324
|
+
description: "text-gray/60"
|
|
325
|
+
}
|
|
326
|
+
};
|
|
327
|
+
function getArbitraryVariantStyles(variant, color) {
|
|
328
|
+
const text = resolveColor(color, "text");
|
|
329
|
+
const border = resolveColor(color, "border");
|
|
330
|
+
if (variant === "soft") return {
|
|
331
|
+
container: cn("border [&>svg]:text-current", text.className),
|
|
332
|
+
foreground: text.className ?? "",
|
|
333
|
+
foregroundStyle: text.style,
|
|
334
|
+
description: "text-current/80",
|
|
335
|
+
containerStyle: {
|
|
336
|
+
backgroundColor: `color-mix(in srgb, ${color} 5%, transparent)`,
|
|
337
|
+
borderColor: `color-mix(in srgb, ${color} 10%, transparent)`,
|
|
338
|
+
...text.style
|
|
339
|
+
}
|
|
340
|
+
};
|
|
341
|
+
if (variant === "outline") return {
|
|
342
|
+
container: cn("bg-transparent border [&>svg]:text-current", border.className, text.className),
|
|
343
|
+
foreground: text.className ?? "",
|
|
344
|
+
foregroundStyle: text.style,
|
|
345
|
+
description: "text-current/80",
|
|
346
|
+
containerStyle: {
|
|
347
|
+
borderColor: `light-dark(
|
|
348
|
+
color-mix(in srgb, ${color} 50%, transparent),
|
|
349
|
+
color-mix(in srgb, ${color} 28%, transparent)
|
|
350
|
+
)`,
|
|
351
|
+
...text.style
|
|
352
|
+
}
|
|
353
|
+
};
|
|
354
|
+
if (variant === "solid") return {
|
|
355
|
+
container: "border border-transparent text-white [&>svg]:text-white",
|
|
356
|
+
foreground: "text-white",
|
|
357
|
+
foregroundStyle: { color: "#fff" },
|
|
358
|
+
description: "text-white/80",
|
|
359
|
+
containerStyle: {
|
|
360
|
+
backgroundColor: color,
|
|
361
|
+
color: "#fff"
|
|
362
|
+
}
|
|
363
|
+
};
|
|
364
|
+
return {
|
|
365
|
+
container: cn("relative isolate overflow-hidden group border [&>svg]:text-current", text.className),
|
|
366
|
+
foreground: text.className ?? "",
|
|
367
|
+
foregroundStyle: text.style,
|
|
368
|
+
description: "text-current/60",
|
|
369
|
+
containerStyle: {
|
|
370
|
+
borderColor: `color-mix(in srgb, ${color} 20%, transparent)`,
|
|
371
|
+
...text.style
|
|
372
|
+
},
|
|
373
|
+
gradientHoverLayersInline: {
|
|
374
|
+
idle: {
|
|
375
|
+
backgroundImage: arbitraryGradientBackgroundImage(color, "idle"),
|
|
376
|
+
backgroundSize: "100% 100%"
|
|
377
|
+
},
|
|
378
|
+
hover: {
|
|
379
|
+
backgroundImage: arbitraryGradientBackgroundImage(color, "hover"),
|
|
380
|
+
backgroundSize: "100% 100%"
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Resolve a `(variant, color)` tuple to container/foreground/description
|
|
387
|
+
* classes (and inline styles for arbitrary colors). Single source of truth
|
|
388
|
+
* for the four standard variants across Alert, Badge, Tag, SimpleClickableCard.
|
|
389
|
+
*/
|
|
390
|
+
function resolveVariantStyles(variant, color) {
|
|
391
|
+
if (color === "silver") {
|
|
392
|
+
const row = SILVER_VARIANT_ROWS[variant];
|
|
393
|
+
if (variant === "gradient") return {
|
|
394
|
+
container: cn("relative isolate overflow-hidden group", PRESET_GRADIENT_FRAME.gray),
|
|
395
|
+
gradientHoverLayers: SILVER_GRADIENT_BACKDROP,
|
|
396
|
+
foreground: row.foreground,
|
|
397
|
+
description: row.description,
|
|
398
|
+
silverShine: true
|
|
399
|
+
};
|
|
400
|
+
return {
|
|
401
|
+
container: cn("relative isolate overflow-hidden", row.container),
|
|
402
|
+
containerStyle: variant === "solid" ? SILVER_SOLID_SURFACE_STYLE : void 0,
|
|
403
|
+
foreground: row.foreground,
|
|
404
|
+
description: row.description,
|
|
405
|
+
silverBorder: variant === "outline"
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
if (isPresetColor(color)) {
|
|
409
|
+
const preset = color;
|
|
410
|
+
const row = PRESET_VARIANT_STYLES[preset][variant];
|
|
411
|
+
if (variant === "gradient") return {
|
|
412
|
+
container: cn("relative isolate overflow-hidden group", PRESET_GRADIENT_FRAME[preset]),
|
|
413
|
+
gradientHoverLayers: PRESET_GRADIENT_BACKDROP[preset],
|
|
414
|
+
foreground: row.foreground,
|
|
415
|
+
description: row.description
|
|
416
|
+
};
|
|
417
|
+
return {
|
|
418
|
+
container: row.container,
|
|
419
|
+
foreground: row.foreground,
|
|
420
|
+
description: row.description
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
return getArbitraryVariantStyles(variant, color);
|
|
424
|
+
}
|
|
425
|
+
//#endregion
|
|
426
|
+
export { PRESET_GRADIENT_BACKDROP, PRESET_GRADIENT_FRAME, SILVER_GRADIENT_BACKDROP, VARIANTS, VARIANT_GRADIENT_BACKDROP_BASE, VARIANT_GRADIENT_DURATION_CLASS, VARIANT_GRADIENT_HOVER_OVERLAY_CLASS, VARIANT_GRADIENT_TRANSITION_DURATION_MS, arbitraryGradientBackgroundImage, resolveVariantStyles };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@espressif/dashboard-ui-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"description": "Reusable React UI components, page layouts, and utilities — Espressif's dashboard design system.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -89,12 +89,13 @@
|
|
|
89
89
|
".claude/rules/dashboard-ui-consumption.md"
|
|
90
90
|
],
|
|
91
91
|
"scripts": {
|
|
92
|
-
"build": "tsup",
|
|
93
|
-
"dev:lib": "tsup --watch",
|
|
94
|
-
"prepublishOnly": "
|
|
92
|
+
"build": "vite build --config vite.lib.config.ts && tsup",
|
|
93
|
+
"dev:lib": "tsup && vite build --config vite.lib.config.ts --watch",
|
|
94
|
+
"prepublishOnly": "npm run build",
|
|
95
95
|
"typecheck": "tsc --noEmit",
|
|
96
96
|
"lint": "eslint",
|
|
97
97
|
"test": "vitest run",
|
|
98
|
+
"size": "node scripts/check-bundle-size.mjs",
|
|
98
99
|
"clean": "rm -rf dist",
|
|
99
100
|
"dev:demo": "cd demo && npm run dev",
|
|
100
101
|
"build:demo": "cd demo && npm run build",
|
|
@@ -161,6 +162,7 @@
|
|
|
161
162
|
"@types/lodash-es": "^4.17.12",
|
|
162
163
|
"@types/react": "^19.0.0",
|
|
163
164
|
"@types/react-dom": "^19.0.0",
|
|
165
|
+
"esbuild": "^0.28.1",
|
|
164
166
|
"eslint": "10.10.0",
|
|
165
167
|
"jsdom": "29.1.1",
|
|
166
168
|
"react": "^19.0.0",
|
|
@@ -171,6 +173,7 @@
|
|
|
171
173
|
"tsup": "^8.0.0",
|
|
172
174
|
"typescript": "^5.5.0",
|
|
173
175
|
"typescript-eslint": "8.70.0",
|
|
176
|
+
"vite": "8.1.1",
|
|
174
177
|
"vitest": "4.1.6"
|
|
175
178
|
}
|
|
176
179
|
}
|