@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,72 @@
|
|
|
1
|
+
import { cn } from "../../utils/cn.js";
|
|
2
|
+
import { Skeleton } from "../../core/skeleton.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/page-container/page-container-skeleton.tsx
|
|
5
|
+
var maxWidthClasses = {
|
|
6
|
+
sm: "max-w-2xl",
|
|
7
|
+
md: "max-w-4xl",
|
|
8
|
+
lg: "max-w-5xl",
|
|
9
|
+
xl: "max-w-7xl"
|
|
10
|
+
};
|
|
11
|
+
function PageContainerSkeleton({ maxWidth, noGutters = false, showBackLink = false, showHeader = true, showActions = false, className }) {
|
|
12
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
13
|
+
className: cn("w-full", !noGutters && "mt-[72px]", maxWidth != null && maxWidthClasses[maxWidth], "mx-auto", className),
|
|
14
|
+
children: [
|
|
15
|
+
showBackLink && /* @__PURE__ */ jsx("div", {
|
|
16
|
+
className: "mb-2",
|
|
17
|
+
children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-20" })
|
|
18
|
+
}),
|
|
19
|
+
showHeader && /* @__PURE__ */ jsxs("div", {
|
|
20
|
+
className: "w-full hstack justify-between items-center min-h-[2.25rem] flex mb-2",
|
|
21
|
+
children: [/* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-48 flex-1 max-w-xs" }), showActions && /* @__PURE__ */ jsx(Skeleton, { className: "h-9 w-28 shrink-0" })]
|
|
22
|
+
}),
|
|
23
|
+
/* @__PURE__ */ jsx("main", { children: /* @__PURE__ */ jsxs("div", {
|
|
24
|
+
className: "py-4 space-y-3",
|
|
25
|
+
children: [
|
|
26
|
+
/* @__PURE__ */ jsxs("div", {
|
|
27
|
+
className: "flex items-center gap-3",
|
|
28
|
+
children: [/* @__PURE__ */ jsx(Skeleton, { className: "h-10 flex-1 max-w-md" }), /* @__PURE__ */ jsx(Skeleton, { className: "h-9 w-24 shrink-0" })]
|
|
29
|
+
}),
|
|
30
|
+
/* @__PURE__ */ jsxs("div", {
|
|
31
|
+
className: "overflow-hidden rounded-md mt-6 border border-border",
|
|
32
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
33
|
+
className: "border-b border-border px-2 py-3 flex gap-2",
|
|
34
|
+
children: [
|
|
35
|
+
1,
|
|
36
|
+
2,
|
|
37
|
+
3,
|
|
38
|
+
4,
|
|
39
|
+
5
|
|
40
|
+
].map((i) => /* @__PURE__ */ jsx(Skeleton, { className: "h-4 flex-1 min-w-0" }, i))
|
|
41
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
42
|
+
className: "divide-y divide-border",
|
|
43
|
+
children: [
|
|
44
|
+
1,
|
|
45
|
+
2,
|
|
46
|
+
3,
|
|
47
|
+
4,
|
|
48
|
+
5,
|
|
49
|
+
6
|
|
50
|
+
].map((i) => /* @__PURE__ */ jsx("div", {
|
|
51
|
+
className: "px-2 py-4 flex gap-2",
|
|
52
|
+
children: [
|
|
53
|
+
1,
|
|
54
|
+
2,
|
|
55
|
+
3,
|
|
56
|
+
4,
|
|
57
|
+
5
|
|
58
|
+
].map((j) => /* @__PURE__ */ jsx(Skeleton, { className: "h-4 flex-1 min-w-0" }, j))
|
|
59
|
+
}, i))
|
|
60
|
+
})]
|
|
61
|
+
}),
|
|
62
|
+
/* @__PURE__ */ jsxs("div", {
|
|
63
|
+
className: "flex items-center justify-between gap-2 pt-2",
|
|
64
|
+
children: [/* @__PURE__ */ jsx(Skeleton, { className: "h-9 w-32" }), /* @__PURE__ */ jsx(Skeleton, { className: "h-9 w-24" })]
|
|
65
|
+
})
|
|
66
|
+
]
|
|
67
|
+
}) })
|
|
68
|
+
]
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
//#endregion
|
|
72
|
+
export { PageContainerSkeleton as default };
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { cn } from "../../utils/cn.js";
|
|
2
|
+
import { MOBILE_MEDIA_QUERY } from "../../core/hooks/use-mobile.js";
|
|
3
|
+
import { Link } from "../link/link.js";
|
|
4
|
+
import { useRevealOnScrollUp } from "../../core/hooks/use-reveal-on-scroll-up.js";
|
|
5
|
+
import { useRef } from "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { MoveLeft } from "lucide-react";
|
|
8
|
+
import { motion } from "motion/react";
|
|
9
|
+
//#region src/components/page-container/page-container.tsx
|
|
10
|
+
var maxWidthClasses = {
|
|
11
|
+
sm: "max-w-2xl",
|
|
12
|
+
md: "max-w-4xl",
|
|
13
|
+
lg: "max-w-5xl",
|
|
14
|
+
xl: "max-w-7xl"
|
|
15
|
+
};
|
|
16
|
+
var headingTitleClasses = "min-w-0 flex-1 text-2xl text-foreground font-bold track-tight";
|
|
17
|
+
var headingContentClasses = "min-w-0 flex-1";
|
|
18
|
+
var stickyHeaderClasses = "sticky top-0 z-11 bg-background/75 backdrop-blur-xs";
|
|
19
|
+
var stickyHeaderFromMdClasses = "md:sticky md:top-0 md:z-11 md:bg-background/75 md:backdrop-blur-xs";
|
|
20
|
+
var elevatedHeaderClasses = "shadow-md shadow-accent/30";
|
|
21
|
+
var elevatedHeaderFromMdClasses = "md:shadow-md md:shadow-accent/30";
|
|
22
|
+
var revealTransitionClasses = "transition-transform duration-200 ease-out motion-reduce:transition-none";
|
|
23
|
+
function headerPinningClasses({ stickyHeadingOnMobile, elevateHeading, revealEnabled, revealState, animateReveal }) {
|
|
24
|
+
if (stickyHeadingOnMobile) return cn(stickyHeaderClasses, elevateHeading && elevatedHeaderClasses);
|
|
25
|
+
if (!revealEnabled || revealState === "static") return cn(stickyHeaderFromMdClasses, elevateHeading && elevatedHeaderFromMdClasses);
|
|
26
|
+
const revealed = revealState === "revealed";
|
|
27
|
+
return cn(stickyHeaderClasses, revealed ? "translate-y-0" : "-translate-y-full", revealed && elevateHeading && elevatedHeaderClasses, animateReveal && revealTransitionClasses);
|
|
28
|
+
}
|
|
29
|
+
function PageContainer({ maxWidth, heading, actions, children, className, noGutters = false, elevateHeading = false, stickyHeadingOnMobile = false, revealHeadingOnScrollUp = true, goBackLinkData, onBack }) {
|
|
30
|
+
const hasContainerHeading = heading != null || actions != null;
|
|
31
|
+
const showBackLink = goBackLinkData?.show === true;
|
|
32
|
+
const showStickyHeader = showBackLink || hasContainerHeading;
|
|
33
|
+
const headerRef = useRef(null);
|
|
34
|
+
const revealEnabled = revealHeadingOnScrollUp && !stickyHeadingOnMobile;
|
|
35
|
+
const { state: revealState, animate: animateReveal, reveal } = useRevealOnScrollUp(headerRef, {
|
|
36
|
+
enabled: revealEnabled,
|
|
37
|
+
mediaQuery: MOBILE_MEDIA_QUERY
|
|
38
|
+
});
|
|
39
|
+
const backLabel = goBackLinkData?.label ?? "Back";
|
|
40
|
+
const backHref = goBackLinkData?.href;
|
|
41
|
+
const LinkComponent = goBackLinkData?.linkComponent;
|
|
42
|
+
return /* @__PURE__ */ jsx("div", {
|
|
43
|
+
className: cn("w-full", !noGutters && "mt-[72px]", maxWidth != null && maxWidthClasses[maxWidth], "mx-auto", "p-3 md:p-6", className),
|
|
44
|
+
children: /* @__PURE__ */ jsxs(motion.main, {
|
|
45
|
+
className: "flex flex-col gap-6",
|
|
46
|
+
initial: { opacity: 0 },
|
|
47
|
+
animate: { opacity: 1 },
|
|
48
|
+
transition: {
|
|
49
|
+
duration: .75,
|
|
50
|
+
ease: "easeOut"
|
|
51
|
+
},
|
|
52
|
+
children: [showStickyHeader && /* @__PURE__ */ jsxs("div", {
|
|
53
|
+
ref: headerRef,
|
|
54
|
+
onFocus: reveal,
|
|
55
|
+
className: cn("flex flex-col gap-2", headerPinningClasses({
|
|
56
|
+
stickyHeadingOnMobile,
|
|
57
|
+
elevateHeading,
|
|
58
|
+
revealEnabled,
|
|
59
|
+
revealState,
|
|
60
|
+
animateReveal
|
|
61
|
+
})),
|
|
62
|
+
children: [showBackLink && /* @__PURE__ */ jsx("div", {
|
|
63
|
+
className: cn(goBackLinkData?.className),
|
|
64
|
+
children: /* @__PURE__ */ jsx(Link, {
|
|
65
|
+
to: backHref != null && backHref !== "" ? backHref : "#",
|
|
66
|
+
linkComponent: backHref != null && backHref !== "" && LinkComponent ? LinkComponent : void 0,
|
|
67
|
+
color: "gray",
|
|
68
|
+
startIcon: /* @__PURE__ */ jsx(MoveLeft, { "aria-hidden": true }),
|
|
69
|
+
onClick: backHref != null && backHref !== "" ? void 0 : (e) => {
|
|
70
|
+
e.preventDefault();
|
|
71
|
+
onBack?.();
|
|
72
|
+
},
|
|
73
|
+
children: backLabel
|
|
74
|
+
})
|
|
75
|
+
}), hasContainerHeading && /* @__PURE__ */ jsxs("div", {
|
|
76
|
+
className: "flex min-h-[2.25rem] w-full flex-wrap items-center gap-3",
|
|
77
|
+
children: [heading != null && (typeof heading === "string" ? /* @__PURE__ */ jsx("h1", {
|
|
78
|
+
className: headingTitleClasses,
|
|
79
|
+
children: heading
|
|
80
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
81
|
+
className: headingContentClasses,
|
|
82
|
+
children: heading
|
|
83
|
+
})), actions != null && /* @__PURE__ */ jsx("div", {
|
|
84
|
+
className: cn("ml-auto w-auto max-w-full shrink-0"),
|
|
85
|
+
children: actions
|
|
86
|
+
})]
|
|
87
|
+
})]
|
|
88
|
+
}), /* @__PURE__ */ jsx("div", { children })]
|
|
89
|
+
})
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
//#endregion
|
|
93
|
+
export { PageContainer as default };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { cn } from "../../utils/cn.js";
|
|
2
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuTrigger } from "../../core/animate-ui/components/radix/dropdown-menu.js";
|
|
3
|
+
import { Button } from "../button/button.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { ChevronDown, ChevronLeft, ChevronRight } from "lucide-react";
|
|
6
|
+
//#region src/components/pagination/pagination.tsx
|
|
7
|
+
var defaultPageSizeOptionLabel = (size) => `${size} / page`;
|
|
8
|
+
var sizeStyles = {
|
|
9
|
+
sm: {
|
|
10
|
+
container: "mt-4 pt-3",
|
|
11
|
+
buttonGroupGap: "gap-2",
|
|
12
|
+
icon: "h-3.5 w-3.5"
|
|
13
|
+
},
|
|
14
|
+
default: {
|
|
15
|
+
container: "mt-6 pt-4",
|
|
16
|
+
buttonGroupGap: "gap-3",
|
|
17
|
+
icon: "h-4 w-4"
|
|
18
|
+
},
|
|
19
|
+
lg: {
|
|
20
|
+
container: "mt-8 pt-5",
|
|
21
|
+
buttonGroupGap: "gap-4",
|
|
22
|
+
icon: "h-5 w-5"
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
function Pagination({ pageLabel, previousLabel = "Previous", nextLabel = "Next", onPrevPage, onNextPage, hasPrevPage, hasNextPage, disabled = false, currentPageSize, pageSizeOptions, onPageSizeChange, pageSizeOptionLabel = defaultPageSizeOptionLabel, size = "default" }) {
|
|
26
|
+
const showPageSizeSelector = pageSizeOptions !== void 0 && pageSizeOptions.length > 0;
|
|
27
|
+
const s = sizeStyles[size];
|
|
28
|
+
const handlePageSizeChange = (value) => {
|
|
29
|
+
onPageSizeChange(Number(value));
|
|
30
|
+
};
|
|
31
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
32
|
+
className: cn("@container flex flex-wrap items-center gap-x-2 gap-y-3 border-t", s.container),
|
|
33
|
+
children: [
|
|
34
|
+
pageLabel !== void 0 ? /* @__PURE__ */ jsx("span", {
|
|
35
|
+
className: "flex-1 text-sm whitespace-nowrap text-muted-foreground",
|
|
36
|
+
children: pageLabel
|
|
37
|
+
}) : /* @__PURE__ */ jsx("span", { className: "flex-1" }),
|
|
38
|
+
/* @__PURE__ */ jsxs("div", {
|
|
39
|
+
className: cn("flex items-center", s.buttonGroupGap),
|
|
40
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
41
|
+
fullWidth: false,
|
|
42
|
+
variant: "outline",
|
|
43
|
+
color: "gray",
|
|
44
|
+
usePrimaryColorOnHover: true,
|
|
45
|
+
size,
|
|
46
|
+
onClick: onPrevPage,
|
|
47
|
+
disabled: !hasPrevPage || disabled,
|
|
48
|
+
startIcon: /* @__PURE__ */ jsx(ChevronLeft, { className: s.icon }),
|
|
49
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
50
|
+
className: "@max-md:sr-only",
|
|
51
|
+
children: previousLabel
|
|
52
|
+
})
|
|
53
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
54
|
+
fullWidth: false,
|
|
55
|
+
variant: "outline",
|
|
56
|
+
color: "gray",
|
|
57
|
+
usePrimaryColorOnHover: true,
|
|
58
|
+
size,
|
|
59
|
+
onClick: onNextPage,
|
|
60
|
+
disabled: !hasNextPage || disabled,
|
|
61
|
+
endIcon: /* @__PURE__ */ jsx(ChevronRight, { className: s.icon }),
|
|
62
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
63
|
+
className: "@max-md:sr-only",
|
|
64
|
+
children: nextLabel
|
|
65
|
+
})
|
|
66
|
+
})]
|
|
67
|
+
}),
|
|
68
|
+
showPageSizeSelector ? /* @__PURE__ */ jsx("div", {
|
|
69
|
+
className: "flex flex-1 justify-end",
|
|
70
|
+
children: /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
|
|
71
|
+
asChild: true,
|
|
72
|
+
children: /* @__PURE__ */ jsxs(Button, {
|
|
73
|
+
fullWidth: false,
|
|
74
|
+
variant: "outline",
|
|
75
|
+
color: "gray",
|
|
76
|
+
usePrimaryColorOnHover: true,
|
|
77
|
+
size,
|
|
78
|
+
children: [pageSizeOptionLabel(currentPageSize), /* @__PURE__ */ jsx(ChevronDown, { className: cn(s.icon, "opacity-50") })]
|
|
79
|
+
})
|
|
80
|
+
}), /* @__PURE__ */ jsx(DropdownMenuContent, {
|
|
81
|
+
align: "end",
|
|
82
|
+
children: /* @__PURE__ */ jsx(DropdownMenuRadioGroup, {
|
|
83
|
+
value: String(currentPageSize),
|
|
84
|
+
onValueChange: handlePageSizeChange,
|
|
85
|
+
children: pageSizeOptions.map((size) => /* @__PURE__ */ jsx(DropdownMenuRadioItem, {
|
|
86
|
+
value: String(size),
|
|
87
|
+
children: pageSizeOptionLabel(size)
|
|
88
|
+
}, size))
|
|
89
|
+
})
|
|
90
|
+
})] })
|
|
91
|
+
}) : /* @__PURE__ */ jsx("div", { className: "flex flex-1" })
|
|
92
|
+
]
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
//#endregion
|
|
96
|
+
export { Pagination };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region src/components/pagination/pagination.props.ts
|
|
2
|
+
/**
|
|
3
|
+
* Default page-size choices used by `DataTable`'s page-size selector.
|
|
4
|
+
*
|
|
5
|
+
* `Pagination` itself does not default to this list — omitting `pageSizeOptions`
|
|
6
|
+
* there hides the selector.
|
|
7
|
+
*/
|
|
8
|
+
var DEFAULT_PAGE_SIZE_OPTIONS = [
|
|
9
|
+
5,
|
|
10
|
+
10,
|
|
11
|
+
15,
|
|
12
|
+
20,
|
|
13
|
+
25
|
|
14
|
+
];
|
|
15
|
+
//#endregion
|
|
16
|
+
export { DEFAULT_PAGE_SIZE_OPTIONS };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../utils/cn.js";
|
|
3
|
+
import { isPresetColor, resolveColor } from "../../utils/color.js";
|
|
4
|
+
import { Progress, ProgressLabel, ProgressTrack, ProgressValue } from "../../core/animate-ui/components/base/progress.js";
|
|
5
|
+
import * as React$1 from "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/progress-bar/progress-bar.tsx
|
|
8
|
+
var FAKE_PROGRESS_INTERVAL_MS = 100;
|
|
9
|
+
var FAKE_PROGRESS_MIN = 10;
|
|
10
|
+
var FAKE_PROGRESS_MAX = 90;
|
|
11
|
+
var FAKE_PROGRESS_INCREMENT_MIN = 1;
|
|
12
|
+
var presetTrackBgMap = {
|
|
13
|
+
primary: "bg-primary/20",
|
|
14
|
+
secondary: "bg-secondary/20",
|
|
15
|
+
error: "bg-error/20",
|
|
16
|
+
info: "bg-info/20",
|
|
17
|
+
success: "bg-success/20",
|
|
18
|
+
warning: "bg-warning/20",
|
|
19
|
+
disabled: "bg-disabled/20",
|
|
20
|
+
gray: "bg-gray/20",
|
|
21
|
+
mist: "bg-mist-border"
|
|
22
|
+
};
|
|
23
|
+
var presetIndicatorBgMap = {
|
|
24
|
+
primary: "bg-primary",
|
|
25
|
+
secondary: "bg-secondary",
|
|
26
|
+
error: "bg-error",
|
|
27
|
+
info: "bg-info",
|
|
28
|
+
success: "bg-success",
|
|
29
|
+
warning: "bg-warning",
|
|
30
|
+
disabled: "bg-disabled",
|
|
31
|
+
gray: "bg-gray",
|
|
32
|
+
mist: "bg-mist"
|
|
33
|
+
};
|
|
34
|
+
function ProgressBar({ showFakeProgress = false, value: valueProp, label, showPercentage = false, color = "primary", segments, className, ...props }) {
|
|
35
|
+
const [fakeValue, setFakeValue] = React$1.useState(FAKE_PROGRESS_MIN);
|
|
36
|
+
const intervalRef = React$1.useRef(null);
|
|
37
|
+
React$1.useEffect(() => {
|
|
38
|
+
if (!showFakeProgress) return;
|
|
39
|
+
if (intervalRef.current) clearInterval(intervalRef.current);
|
|
40
|
+
setFakeValue(FAKE_PROGRESS_MIN);
|
|
41
|
+
intervalRef.current = setInterval(() => {
|
|
42
|
+
setFakeValue((current) => {
|
|
43
|
+
const increment = FAKE_PROGRESS_INCREMENT_MIN + Math.floor(Math.random() * 9);
|
|
44
|
+
const next = Math.min(FAKE_PROGRESS_MAX, current + increment);
|
|
45
|
+
if (next >= FAKE_PROGRESS_MAX && intervalRef.current) {
|
|
46
|
+
clearInterval(intervalRef.current);
|
|
47
|
+
intervalRef.current = null;
|
|
48
|
+
}
|
|
49
|
+
return next;
|
|
50
|
+
});
|
|
51
|
+
}, FAKE_PROGRESS_INTERVAL_MS);
|
|
52
|
+
return () => {
|
|
53
|
+
if (intervalRef.current) clearInterval(intervalRef.current);
|
|
54
|
+
};
|
|
55
|
+
}, [showFakeProgress]);
|
|
56
|
+
const showHeader = label != null || showPercentage;
|
|
57
|
+
if (segments && segments.length > 0) {
|
|
58
|
+
const total = segments.reduce((sum, s) => sum + Math.max(0, s.value), 0);
|
|
59
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
60
|
+
className: cn("space-y-2", className),
|
|
61
|
+
children: [showHeader && /* @__PURE__ */ jsx("div", {
|
|
62
|
+
className: "flex items-center justify-between gap-1",
|
|
63
|
+
children: label != null && /* @__PURE__ */ jsx("span", {
|
|
64
|
+
className: "text-sm font-medium",
|
|
65
|
+
children: label
|
|
66
|
+
})
|
|
67
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
68
|
+
className: "bg-mist-border relative h-2 w-full overflow-hidden rounded-full flex",
|
|
69
|
+
children: total === 0 ? null : segments.map((seg, idx) => {
|
|
70
|
+
const widthPct = Math.max(0, seg.value) / total * 100;
|
|
71
|
+
if (widthPct === 0) return null;
|
|
72
|
+
const isPreset = isPresetColor(seg.color);
|
|
73
|
+
return /* @__PURE__ */ jsx("div", {
|
|
74
|
+
className: cn("h-full", isPreset ? presetIndicatorBgMap[seg.color] : void 0),
|
|
75
|
+
style: {
|
|
76
|
+
width: `${widthPct}%`,
|
|
77
|
+
...isPreset ? {} : resolveColor(seg.color, "bg").style
|
|
78
|
+
},
|
|
79
|
+
"aria-label": seg.label
|
|
80
|
+
}, idx);
|
|
81
|
+
})
|
|
82
|
+
})]
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
return /* @__PURE__ */ jsxs(Progress, {
|
|
86
|
+
value: (showFakeProgress ? fakeValue : valueProp) ?? 0,
|
|
87
|
+
max: 100,
|
|
88
|
+
className: cn("space-y-2", className),
|
|
89
|
+
...props,
|
|
90
|
+
children: [showHeader && /* @__PURE__ */ jsxs("div", {
|
|
91
|
+
className: "flex items-center justify-between gap-1",
|
|
92
|
+
children: [label != null && /* @__PURE__ */ jsx(ProgressLabel, { children: label }), showPercentage && /* @__PURE__ */ jsxs("span", {
|
|
93
|
+
className: "text-sm",
|
|
94
|
+
children: [/* @__PURE__ */ jsx(ProgressValue, {}), " %"]
|
|
95
|
+
})]
|
|
96
|
+
}), /* @__PURE__ */ jsx(ProgressTrack, { ...isPresetColor(color) ? {
|
|
97
|
+
className: presetTrackBgMap[color],
|
|
98
|
+
indicatorClassName: presetIndicatorBgMap[color]
|
|
99
|
+
} : {
|
|
100
|
+
style: { backgroundColor: `color-mix(in srgb, ${color} 20%, transparent)` },
|
|
101
|
+
indicatorStyle: resolveColor(color, "bg").style
|
|
102
|
+
} })]
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
//#endregion
|
|
106
|
+
export { ProgressBar };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { cn } from "../../utils/cn.js";
|
|
2
|
+
import { Radio, RadioGroup as RadioGroup$1 } from "../../core/animate-ui/components/base/radio.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/radio-group/radio-group.tsx
|
|
5
|
+
var sizeStyles = {
|
|
6
|
+
sm: {
|
|
7
|
+
radio: "size-3.5",
|
|
8
|
+
label: "text-sm"
|
|
9
|
+
},
|
|
10
|
+
default: {
|
|
11
|
+
radio: "size-4",
|
|
12
|
+
label: "text-base"
|
|
13
|
+
},
|
|
14
|
+
lg: {
|
|
15
|
+
radio: "size-5",
|
|
16
|
+
label: "text-lg"
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
function RadioGroup({ options, value, defaultValue, onValueChange, orientation = "vertical", disabled = false, className, size = "default" }) {
|
|
20
|
+
const styles = sizeStyles[size];
|
|
21
|
+
return /* @__PURE__ */ jsx(RadioGroup$1, {
|
|
22
|
+
value,
|
|
23
|
+
defaultValue,
|
|
24
|
+
onValueChange,
|
|
25
|
+
disabled,
|
|
26
|
+
className: cn(orientation === "horizontal" ? "flex flex-row gap-4" : "grid gap-3", className),
|
|
27
|
+
children: options.map((option) => /* @__PURE__ */ jsxs("label", {
|
|
28
|
+
className: cn("flex items-center gap-2 cursor-pointer", (option.disabled || disabled) && "cursor-not-allowed opacity-50"),
|
|
29
|
+
children: [/* @__PURE__ */ jsx(Radio, {
|
|
30
|
+
value: option.value,
|
|
31
|
+
disabled: option.disabled,
|
|
32
|
+
className: styles.radio
|
|
33
|
+
}), typeof option.label === "string" ? /* @__PURE__ */ jsx("span", {
|
|
34
|
+
className: cn(styles.label, "font-normal"),
|
|
35
|
+
children: option.label
|
|
36
|
+
}) : option.label]
|
|
37
|
+
}, option.value))
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
//#endregion
|
|
41
|
+
export { RadioGroup };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { cn } from "../../utils/cn.js";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { Check, Circle } from "lucide-react";
|
|
5
|
+
//#region src/components/requirement-list/requirement-list.tsx
|
|
6
|
+
/**
|
|
7
|
+
* Unmet rows use a hollow circle rather than a cross: while the user is still typing,
|
|
8
|
+
* an unsatisfied requirement is pending, not an error.
|
|
9
|
+
*/
|
|
10
|
+
var stateVisuals = {
|
|
11
|
+
met: {
|
|
12
|
+
icon: Check,
|
|
13
|
+
textClass: "text-success"
|
|
14
|
+
},
|
|
15
|
+
unmet: {
|
|
16
|
+
icon: Circle,
|
|
17
|
+
textClass: "text-muted-foreground"
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
/** Aligned with SimpleList / VerticalStepper size scales. */
|
|
21
|
+
var sizeStyles = {
|
|
22
|
+
sm: {
|
|
23
|
+
text: "text-xs",
|
|
24
|
+
icon: "h-3.5 w-3.5 shrink-0",
|
|
25
|
+
gap: "gap-2",
|
|
26
|
+
rowGap: "gap-1"
|
|
27
|
+
},
|
|
28
|
+
default: {
|
|
29
|
+
text: "text-sm",
|
|
30
|
+
icon: "size-4 shrink-0",
|
|
31
|
+
gap: "gap-2",
|
|
32
|
+
rowGap: "gap-1.5"
|
|
33
|
+
},
|
|
34
|
+
lg: {
|
|
35
|
+
text: "text-base",
|
|
36
|
+
icon: "size-5 shrink-0",
|
|
37
|
+
gap: "gap-2.5",
|
|
38
|
+
rowGap: "gap-2"
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Live checklist of requirements a value does and does not yet satisfy — password
|
|
43
|
+
* policy rules, plan prerequisites, upload conditions.
|
|
44
|
+
*
|
|
45
|
+
* Pure: labels arrive already translated and the pass/fail state is computed by the
|
|
46
|
+
* caller, so the component knows nothing about the rules themselves.
|
|
47
|
+
*
|
|
48
|
+
* Each row carries a screen-reader-only state label. Without it the met/unmet
|
|
49
|
+
* distinction would be conveyed only by icon shape and colour, both invisible to a
|
|
50
|
+
* screen reader, and the polite live region would have no text change to announce.
|
|
51
|
+
*
|
|
52
|
+
* Carries no outer spacing so the surface hosting it owns its placement.
|
|
53
|
+
*/
|
|
54
|
+
var RequirementList = forwardRef(function RequirementList({ items, size = "sm", metLabel = "Requirement met", unmetLabel = "Requirement not met", live = true, className, ...rest }, ref) {
|
|
55
|
+
const styles = sizeStyles[size];
|
|
56
|
+
return /* @__PURE__ */ jsx("ul", {
|
|
57
|
+
ref,
|
|
58
|
+
"aria-live": live ? "polite" : void 0,
|
|
59
|
+
...rest,
|
|
60
|
+
className: cn("flex flex-col", styles.rowGap, className),
|
|
61
|
+
children: items.map((item) => {
|
|
62
|
+
const visuals = stateVisuals[item.met ? "met" : "unmet"];
|
|
63
|
+
const Icon = visuals.icon;
|
|
64
|
+
return /* @__PURE__ */ jsxs("li", {
|
|
65
|
+
className: cn("flex items-center transition-colors", styles.gap, styles.text, visuals.textClass),
|
|
66
|
+
children: [
|
|
67
|
+
/* @__PURE__ */ jsx(Icon, {
|
|
68
|
+
className: styles.icon,
|
|
69
|
+
"aria-hidden": true
|
|
70
|
+
}),
|
|
71
|
+
item.label,
|
|
72
|
+
/* @__PURE__ */ jsx("span", {
|
|
73
|
+
className: "sr-only",
|
|
74
|
+
children: item.met ? metLabel : unmetLabel
|
|
75
|
+
})
|
|
76
|
+
]
|
|
77
|
+
}, item.id);
|
|
78
|
+
})
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
RequirementList.displayName = "RequirementList";
|
|
82
|
+
//#endregion
|
|
83
|
+
export { RequirementList };
|