shadcn-glass-ui 2.2.3 → 2.3.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 +57 -1
- package/dist/cli/commands/info.d.ts +15 -0
- package/dist/cli/commands/info.d.ts.map +1 -0
- package/dist/cli/commands/list.d.ts +23 -0
- package/dist/cli/commands/list.d.ts.map +1 -0
- package/dist/cli/index.cjs +1 -1
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/{index.js → index.mjs} +1 -1
- package/dist/cli/index.mjs.map +1 -0
- package/dist/cli/utils/format.d.ts +76 -0
- package/dist/cli/utils/format.d.ts.map +1 -0
- package/dist/cli/utils/fuzzy-search.d.ts +73 -0
- package/dist/cli/utils/fuzzy-search.d.ts.map +1 -0
- package/dist/cli/utils/load-exports.d.ts +141 -0
- package/dist/cli/utils/load-exports.d.ts.map +1 -0
- package/dist/components/blocks/avatar-gallery/index.d.ts +2 -0
- package/dist/components/blocks/avatar-gallery/index.d.ts.map +1 -0
- package/dist/components/blocks/avatar-gallery/page.d.ts +7 -0
- package/dist/components/blocks/avatar-gallery/page.d.ts.map +1 -0
- package/dist/components/blocks/badges/index.d.ts +2 -0
- package/dist/components/blocks/badges/index.d.ts.map +1 -0
- package/dist/components/blocks/badges/page.d.ts +7 -0
- package/dist/components/blocks/badges/page.d.ts.map +1 -0
- package/dist/components/blocks/buttons/index.d.ts +2 -0
- package/dist/components/blocks/buttons/index.d.ts.map +1 -0
- package/dist/components/blocks/buttons/page.d.ts +7 -0
- package/dist/components/blocks/buttons/page.d.ts.map +1 -0
- package/dist/components/blocks/form-elements/index.d.ts +2 -0
- package/dist/components/blocks/form-elements/index.d.ts.map +1 -0
- package/dist/components/blocks/form-elements/page.d.ts +7 -0
- package/dist/components/blocks/form-elements/page.d.ts.map +1 -0
- package/dist/components/blocks/index.d.ts +14 -0
- package/dist/components/blocks/index.d.ts.map +1 -0
- package/dist/components/blocks/notifications/index.d.ts +2 -0
- package/dist/components/blocks/notifications/index.d.ts.map +1 -0
- package/dist/components/blocks/notifications/page.d.ts +7 -0
- package/dist/components/blocks/notifications/page.d.ts.map +1 -0
- package/dist/components/blocks/progress/index.d.ts +2 -0
- package/dist/components/blocks/progress/index.d.ts.map +1 -0
- package/dist/components/blocks/progress/page.d.ts +7 -0
- package/dist/components/blocks/progress/page.d.ts.map +1 -0
- package/dist/components/blocks/registry.d.ts +16 -0
- package/dist/components/blocks/registry.d.ts.map +1 -0
- package/dist/components/demos/AnimatedBackground.d.ts +5 -0
- package/dist/components/demos/AnimatedBackground.d.ts.map +1 -0
- package/dist/components/demos/ComponentShowcase.d.ts +6 -0
- package/dist/components/demos/ComponentShowcase.d.ts.map +1 -0
- package/dist/components/demos/DesktopShowcase.d.ts +3 -0
- package/dist/components/demos/DesktopShowcase.d.ts.map +1 -0
- package/dist/components/demos/GlassFixesDemo.d.ts +6 -0
- package/dist/components/demos/GlassFixesDemo.d.ts.map +1 -0
- package/dist/components/demos/MobileShowcase.d.ts +3 -0
- package/dist/components/demos/MobileShowcase.d.ts.map +1 -0
- package/dist/components/glass/atomic/expandable-header-glass.d.ts +16 -0
- package/dist/components/glass/atomic/expandable-header-glass.d.ts.map +1 -0
- package/dist/components/glass/atomic/icon-button-glass.d.ts +18 -0
- package/dist/components/glass/atomic/icon-button-glass.d.ts.map +1 -0
- package/dist/components/glass/atomic/index.d.ts +14 -0
- package/dist/components/glass/atomic/index.d.ts.map +1 -0
- package/dist/components/glass/atomic/insight-card-glass.d.ts +22 -0
- package/dist/components/glass/atomic/insight-card-glass.d.ts.map +1 -0
- package/dist/components/glass/atomic/search-box-glass.d.ts +17 -0
- package/dist/components/glass/atomic/search-box-glass.d.ts.map +1 -0
- package/dist/components/glass/atomic/sort-dropdown-glass.d.ts +38 -0
- package/dist/components/glass/atomic/sort-dropdown-glass.d.ts.map +1 -0
- package/dist/components/glass/atomic/stat-item-glass.d.ts +22 -0
- package/dist/components/glass/atomic/stat-item-glass.d.ts.map +1 -0
- package/dist/components/glass/atomic/theme-toggle-glass.d.ts +11 -0
- package/dist/components/glass/atomic/theme-toggle-glass.d.ts.map +1 -0
- package/dist/components/glass/composite/ai-card-glass.d.ts +7 -0
- package/dist/components/glass/composite/ai-card-glass.d.ts.map +1 -0
- package/dist/components/glass/composite/career-stats-header-glass.d.ts +15 -0
- package/dist/components/glass/composite/career-stats-header-glass.d.ts.map +1 -0
- package/dist/components/glass/composite/circular-metric-glass.d.ts +24 -0
- package/dist/components/glass/composite/circular-metric-glass.d.ts.map +1 -0
- package/dist/components/glass/composite/contribution-metrics-glass.d.ts +15 -0
- package/dist/components/glass/composite/contribution-metrics-glass.d.ts.map +1 -0
- package/dist/components/glass/composite/index.d.ts +22 -0
- package/dist/components/glass/composite/index.d.ts.map +1 -0
- package/dist/components/glass/composite/metric-card-glass.d.ts +96 -0
- package/dist/components/glass/composite/metric-card-glass.d.ts.map +1 -0
- package/dist/components/glass/composite/metrics-grid-glass.d.ts +17 -0
- package/dist/components/glass/composite/metrics-grid-glass.d.ts.map +1 -0
- package/dist/components/glass/composite/repository-card-glass.d.ts +16 -0
- package/dist/components/glass/composite/repository-card-glass.d.ts.map +1 -0
- package/dist/components/glass/composite/repository-header-glass.d.ts +16 -0
- package/dist/components/glass/composite/repository-header-glass.d.ts.map +1 -0
- package/dist/components/glass/composite/repository-metadata-glass.d.ts +13 -0
- package/dist/components/glass/composite/repository-metadata-glass.d.ts.map +1 -0
- package/dist/components/glass/composite/split-layout-glass/index.d.ts +16 -0
- package/dist/components/glass/composite/split-layout-glass/index.d.ts.map +1 -0
- package/dist/components/glass/composite/split-layout-glass/split-layout-accordion.d.ts +66 -0
- package/dist/components/glass/composite/split-layout-glass/split-layout-accordion.d.ts.map +1 -0
- package/dist/components/glass/composite/split-layout-glass/split-layout-context.d.ts +122 -0
- package/dist/components/glass/composite/split-layout-glass/split-layout-context.d.ts.map +1 -0
- package/dist/components/glass/composite/split-layout-glass/split-layout-glass.d.ts +177 -0
- package/dist/components/glass/composite/split-layout-glass/split-layout-glass.d.ts.map +1 -0
- package/dist/components/glass/composite/trust-score-display-glass.d.ts +15 -0
- package/dist/components/glass/composite/trust-score-display-glass.d.ts.map +1 -0
- package/dist/components/glass/composite/user-info-glass.d.ts +15 -0
- package/dist/components/glass/composite/user-info-glass.d.ts.map +1 -0
- package/dist/components/glass/composite/user-stats-line-glass.d.ts +15 -0
- package/dist/components/glass/composite/user-stats-line-glass.d.ts.map +1 -0
- package/dist/components/glass/composite/year-card-glass.d.ts +53 -0
- package/dist/components/glass/composite/year-card-glass.d.ts.map +1 -0
- package/dist/components/glass/index.d.ts +16 -0
- package/dist/components/glass/index.d.ts.map +1 -0
- package/dist/components/glass/primitives/form-field-wrapper.d.ts +69 -0
- package/dist/components/glass/primitives/form-field-wrapper.d.ts.map +1 -0
- package/dist/components/glass/primitives/index.d.ts +12 -0
- package/dist/components/glass/primitives/index.d.ts.map +1 -0
- package/dist/components/glass/primitives/interactive-card.d.ts +91 -0
- package/dist/components/glass/primitives/interactive-card.d.ts.map +1 -0
- package/dist/components/glass/primitives/style-utils.d.ts +147 -0
- package/dist/components/glass/primitives/style-utils.d.ts.map +1 -0
- package/dist/components/glass/primitives/touch-target.d.ts +46 -0
- package/dist/components/glass/primitives/touch-target.d.ts.map +1 -0
- package/dist/components/glass/sections/career-stats-glass.d.ts +17 -0
- package/dist/components/glass/sections/career-stats-glass.d.ts.map +1 -0
- package/dist/components/glass/sections/flags-section-glass.d.ts +13 -0
- package/dist/components/glass/sections/flags-section-glass.d.ts.map +1 -0
- package/dist/components/glass/sections/header-branding-glass.d.ts +16 -0
- package/dist/components/glass/sections/header-branding-glass.d.ts.map +1 -0
- package/dist/components/glass/sections/header-nav-glass.d.ts +7 -0
- package/dist/components/glass/sections/header-nav-glass.d.ts.map +1 -0
- package/dist/components/glass/sections/index.d.ts +13 -0
- package/dist/components/glass/sections/index.d.ts.map +1 -0
- package/dist/components/glass/sections/profile-header-glass.d.ts +16 -0
- package/dist/components/glass/sections/profile-header-glass.d.ts.map +1 -0
- package/dist/components/glass/sections/projects-list-glass.d.ts +42 -0
- package/dist/components/glass/sections/projects-list-glass.d.ts.map +1 -0
- package/dist/components/glass/sections/trust-score-card-glass.d.ts +12 -0
- package/dist/components/glass/sections/trust-score-card-glass.d.ts.map +1 -0
- package/dist/components/glass/specialized/base-progress-glass.d.ts +8 -0
- package/dist/components/glass/specialized/base-progress-glass.d.ts.map +1 -0
- package/dist/components/glass/specialized/flag-alert-glass.d.ts +8 -0
- package/dist/components/glass/specialized/flag-alert-glass.d.ts.map +1 -0
- package/dist/components/glass/specialized/index.d.ts +21 -0
- package/dist/components/glass/specialized/index.d.ts.map +1 -0
- package/dist/components/glass/specialized/language-bar-glass.d.ts +24 -0
- package/dist/components/glass/specialized/language-bar-glass.d.ts.map +1 -0
- package/dist/components/glass/specialized/profile-avatar-glass.d.ts +26 -0
- package/dist/components/glass/specialized/profile-avatar-glass.d.ts.map +1 -0
- package/dist/components/glass/specialized/progress-glass.d.ts +9 -0
- package/dist/components/glass/specialized/progress-glass.d.ts.map +1 -0
- package/dist/components/glass/specialized/rainbow-progress-glass.d.ts +8 -0
- package/dist/components/glass/specialized/rainbow-progress-glass.d.ts.map +1 -0
- package/dist/components/glass/specialized/segmented-control-glass.d.ts +11 -0
- package/dist/components/glass/specialized/segmented-control-glass.d.ts.map +1 -0
- package/dist/components/glass/specialized/sparkline-glass.d.ts +34 -0
- package/dist/components/glass/specialized/sparkline-glass.d.ts.map +1 -0
- package/dist/components/glass/specialized/status-indicator-glass.d.ts +8 -0
- package/dist/components/glass/specialized/status-indicator-glass.d.ts.map +1 -0
- package/dist/components/glass/ui/alert-glass.d.ts +13 -0
- package/dist/components/glass/ui/alert-glass.d.ts.map +1 -0
- package/dist/components/glass/ui/avatar-glass.d.ts +58 -0
- package/dist/components/glass/ui/avatar-glass.d.ts.map +1 -0
- package/dist/components/glass/ui/badge-glass.d.ts +74 -0
- package/dist/components/glass/ui/badge-glass.d.ts.map +1 -0
- package/dist/components/glass/ui/button-glass.d.ts +110 -0
- package/dist/components/glass/ui/button-glass.d.ts.map +1 -0
- package/dist/components/glass/ui/card-glass.d.ts +115 -0
- package/dist/components/glass/ui/card-glass.d.ts.map +1 -0
- package/dist/components/glass/ui/checkbox-glass.d.ts +113 -0
- package/dist/components/glass/ui/checkbox-glass.d.ts.map +1 -0
- package/dist/components/glass/ui/circular-progress-glass.d.ts +36 -0
- package/dist/components/glass/ui/circular-progress-glass.d.ts.map +1 -0
- package/dist/components/glass/ui/combobox-glass.d.ts +61 -0
- package/dist/components/glass/ui/combobox-glass.d.ts.map +1 -0
- package/dist/components/glass/ui/dropdown-glass.d.ts +83 -0
- package/dist/components/glass/ui/dropdown-glass.d.ts.map +1 -0
- package/dist/components/glass/ui/dropdown-menu-glass.d.ts +77 -0
- package/dist/components/glass/ui/dropdown-menu-glass.d.ts.map +1 -0
- package/dist/components/glass/ui/glass-card.d.ts +78 -0
- package/dist/components/glass/ui/glass-card.d.ts.map +1 -0
- package/dist/components/glass/ui/index.d.ts +44 -0
- package/dist/components/glass/ui/index.d.ts.map +1 -0
- package/dist/components/glass/ui/input-glass.d.ts +98 -0
- package/dist/components/glass/ui/input-glass.d.ts.map +1 -0
- package/dist/components/glass/ui/modal-glass.d.ts +180 -0
- package/dist/components/glass/ui/modal-glass.d.ts.map +1 -0
- package/dist/components/glass/ui/notification-glass.d.ts +13 -0
- package/dist/components/glass/ui/notification-glass.d.ts.map +1 -0
- package/dist/components/glass/ui/popover-glass.d.ts +71 -0
- package/dist/components/glass/ui/popover-glass.d.ts.map +1 -0
- package/dist/components/glass/ui/sidebar-glass/index.d.ts +100 -0
- package/dist/components/glass/ui/sidebar-glass/index.d.ts.map +1 -0
- package/dist/components/glass/ui/sidebar-glass/sidebar-context.d.ts +96 -0
- package/dist/components/glass/ui/sidebar-glass/sidebar-context.d.ts.map +1 -0
- package/dist/components/glass/ui/sidebar-glass/sidebar-glass.d.ts +88 -0
- package/dist/components/glass/ui/sidebar-glass/sidebar-glass.d.ts.map +1 -0
- package/dist/components/glass/ui/sidebar-glass/sidebar-menu.d.ts +121 -0
- package/dist/components/glass/ui/sidebar-glass/sidebar-menu.d.ts.map +1 -0
- package/dist/components/glass/ui/skeleton-glass.d.ts +8 -0
- package/dist/components/glass/ui/skeleton-glass.d.ts.map +1 -0
- package/dist/components/glass/ui/slider-glass.d.ts +38 -0
- package/dist/components/glass/ui/slider-glass.d.ts.map +1 -0
- package/dist/components/glass/ui/stepper-glass.d.ts +63 -0
- package/dist/components/glass/ui/stepper-glass.d.ts.map +1 -0
- package/dist/components/glass/ui/tabs-glass.d.ts +199 -0
- package/dist/components/glass/ui/tabs-glass.d.ts.map +1 -0
- package/dist/components/glass/ui/toggle-glass.d.ts +27 -0
- package/dist/components/glass/ui/toggle-glass.d.ts.map +1 -0
- package/dist/components/glass/ui/tooltip-glass.d.ts +65 -0
- package/dist/components/glass/ui/tooltip-glass.d.ts.map +1 -0
- package/dist/components/ui/alert.d.ts +8 -0
- package/dist/components/ui/alert.d.ts.map +1 -0
- package/dist/components/ui/avatar.d.ts +7 -0
- package/dist/components/ui/avatar.d.ts.map +1 -0
- package/dist/components/ui/badge.d.ts +8 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/button.d.ts +8 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/card.d.ts +10 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/chart.d.ts +69 -0
- package/dist/components/ui/chart.d.ts.map +1 -0
- package/dist/components/ui/checkbox.d.ts +5 -0
- package/dist/components/ui/checkbox.d.ts.map +1 -0
- package/dist/components/ui/collapsible.d.ts +6 -0
- package/dist/components/ui/collapsible.d.ts.map +1 -0
- package/dist/components/ui/command.d.ts +19 -0
- package/dist/components/ui/command.d.ts.map +1 -0
- package/dist/components/ui/dialog.d.ts +16 -0
- package/dist/components/ui/dialog.d.ts.map +1 -0
- package/dist/components/ui/dropdown-menu.d.ts +26 -0
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/components/ui/input.d.ts +4 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/popover.d.ts +8 -0
- package/dist/components/ui/popover.d.ts.map +1 -0
- package/dist/components/ui/progress.d.ts +5 -0
- package/dist/components/ui/progress.d.ts.map +1 -0
- package/dist/components/ui/scroll-area.d.ts +6 -0
- package/dist/components/ui/scroll-area.d.ts.map +1 -0
- package/dist/components/ui/separator.d.ts +5 -0
- package/dist/components/ui/separator.d.ts.map +1 -0
- package/dist/components/ui/skeleton.d.ts +3 -0
- package/dist/components/ui/skeleton.d.ts.map +1 -0
- package/dist/components/ui/slider.d.ts +5 -0
- package/dist/components/ui/slider.d.ts.map +1 -0
- package/dist/components/ui/sonner.d.ts +4 -0
- package/dist/components/ui/sonner.d.ts.map +1 -0
- package/dist/components/ui/switch.d.ts +5 -0
- package/dist/components/ui/switch.d.ts.map +1 -0
- package/dist/components/ui/tabs.d.ts +8 -0
- package/dist/components/ui/tabs.d.ts.map +1 -0
- package/dist/components/ui/tooltip.d.ts +8 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -0
- package/dist/components.cjs +4 -4
- package/dist/components.d.ts +56 -1932
- package/dist/components.d.ts.map +1 -0
- package/dist/components.mjs +5 -0
- package/dist/hooks.cjs +2 -2
- package/dist/hooks.d.ts +5 -225
- package/dist/hooks.d.ts.map +1 -0
- package/dist/{hooks.js → hooks.mjs} +2 -2
- package/dist/index.cjs +48 -1109
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +83 -1
- package/dist/index.d.ts.map +1 -0
- package/dist/{index.js → index.mjs} +29 -1115
- package/dist/index.mjs.map +1 -0
- package/dist/lib/config.d.ts +28 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/hooks/index.d.ts +11 -0
- package/dist/lib/hooks/index.d.ts.map +1 -0
- package/dist/lib/hooks/use-focus.d.ts +61 -0
- package/dist/lib/hooks/use-focus.d.ts.map +1 -0
- package/dist/lib/hooks/use-hover.d.ts +54 -0
- package/dist/lib/hooks/use-hover.d.ts.map +1 -0
- package/dist/lib/hooks/use-responsive.d.ts +44 -0
- package/dist/lib/hooks/use-responsive.d.ts.map +1 -0
- package/dist/lib/hooks/use-wallpaper-tint.d.ts +57 -0
- package/dist/lib/hooks/use-wallpaper-tint.d.ts.map +1 -0
- package/dist/lib/hooks.d.ts +92 -0
- package/dist/lib/hooks.d.ts.map +1 -0
- package/dist/lib/theme/tokens.d.ts +441 -0
- package/dist/lib/theme/tokens.d.ts.map +1 -0
- package/dist/lib/theme-context.d.ts +115 -0
- package/dist/lib/theme-context.d.ts.map +1 -0
- package/dist/lib/types.d.ts +24 -0
- package/dist/lib/types.d.ts.map +1 -0
- package/dist/lib/utils.d.ts +8 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/variants/alert-glass-variants.d.ts +10 -0
- package/dist/lib/variants/alert-glass-variants.d.ts.map +1 -0
- package/dist/lib/variants/alert-variants.d.ts +8 -0
- package/dist/lib/variants/alert-variants.d.ts.map +1 -0
- package/dist/lib/variants/avatar-glass-variants.d.ts +12 -0
- package/dist/lib/variants/avatar-glass-variants.d.ts.map +1 -0
- package/dist/lib/variants/badge-glass-variants.d.ts +10 -0
- package/dist/lib/variants/badge-glass-variants.d.ts.map +1 -0
- package/dist/lib/variants/badge-variants.d.ts +8 -0
- package/dist/lib/variants/badge-variants.d.ts.map +1 -0
- package/dist/lib/variants/button-glass-variants.d.ts +29 -0
- package/dist/lib/variants/button-glass-variants.d.ts.map +1 -0
- package/dist/lib/variants/button-variants.d.ts +9 -0
- package/dist/lib/variants/button-variants.d.ts.map +1 -0
- package/dist/lib/variants/dropdown-content-styles.d.ts +102 -0
- package/dist/lib/variants/dropdown-content-styles.d.ts.map +1 -0
- package/dist/lib/variants/dropdown-glass-variants.d.ts +9 -0
- package/dist/lib/variants/dropdown-glass-variants.d.ts.map +1 -0
- package/dist/lib/variants/glass-card-variants.d.ts +13 -0
- package/dist/lib/variants/glass-card-variants.d.ts.map +1 -0
- package/dist/lib/variants/index.d.ts +26 -0
- package/dist/lib/variants/index.d.ts.map +1 -0
- package/dist/lib/variants/input-glass-variants.d.ts +9 -0
- package/dist/lib/variants/input-glass-variants.d.ts.map +1 -0
- package/dist/lib/variants/insight-card-glass-variants.d.ts +11 -0
- package/dist/lib/variants/insight-card-glass-variants.d.ts.map +1 -0
- package/dist/lib/variants/modal-glass-variants.d.ts +9 -0
- package/dist/lib/variants/modal-glass-variants.d.ts.map +1 -0
- package/dist/lib/variants/notification-glass-variants.d.ts +9 -0
- package/dist/lib/variants/notification-glass-variants.d.ts.map +1 -0
- package/dist/lib/variants/progress-glass-variants.d.ts +10 -0
- package/dist/lib/variants/progress-glass-variants.d.ts.map +1 -0
- package/dist/lib/variants/skeleton-glass-variants.d.ts +9 -0
- package/dist/lib/variants/skeleton-glass-variants.d.ts.map +1 -0
- package/dist/lib/variants/sparkline-glass-variants.d.ts +10 -0
- package/dist/lib/variants/sparkline-glass-variants.d.ts.map +1 -0
- package/dist/lib/variants/stepper-glass-variants.d.ts +40 -0
- package/dist/lib/variants/stepper-glass-variants.d.ts.map +1 -0
- package/dist/lib/variants/toggle-glass-variants.d.ts +26 -0
- package/dist/lib/variants/toggle-glass-variants.d.ts.map +1 -0
- package/dist/lib/variants/tooltip-glass-variants.d.ts +9 -0
- package/dist/lib/variants/tooltip-glass-variants.d.ts.map +1 -0
- package/dist/r/checkbox-glass.json +3 -2
- package/dist/r/tabs-glass.json +4 -2
- package/dist/{theme-context-_T5r1KG4.js → theme-context-DLS2uAgJ.mjs} +1 -1
- package/dist/theme-context-DLS2uAgJ.mjs.map +1 -0
- package/dist/{theme-context-BEA8K_rq.cjs → theme-context-DmTETrFi.cjs} +2 -2
- package/dist/{theme-context-BEA8K_rq.cjs.map → theme-context-DmTETrFi.cjs.map} +1 -1
- package/dist/themes.cjs +1 -1
- package/dist/themes.d.ts +2 -124
- package/dist/themes.d.ts.map +1 -0
- package/dist/{themes.js → themes.mjs} +1 -1
- package/dist/trust-score-card-glass-3VBi9soW.cjs +4893 -0
- package/dist/trust-score-card-glass-3VBi9soW.cjs.map +1 -0
- package/dist/trust-score-card-glass-EfMB5l5J.mjs +4226 -0
- package/dist/trust-score-card-glass-EfMB5l5J.mjs.map +1 -0
- package/dist/{use-focus-CX0TJJIj.js → use-focus-C5kPAKr_.mjs} +1 -1
- package/dist/use-focus-C5kPAKr_.mjs.map +1 -0
- package/dist/{use-focus-CdoUzFQ8.cjs → use-focus-CswOSq71.cjs} +2 -2
- package/dist/{use-focus-CdoUzFQ8.cjs.map → use-focus-CswOSq71.cjs.map} +1 -1
- package/dist/{use-wallpaper-tint-DUgmytlY.js → use-wallpaper-tint-C0kYXNiN.mjs} +1 -1
- package/dist/use-wallpaper-tint-C0kYXNiN.mjs.map +1 -0
- package/dist/{use-wallpaper-tint-Rq5UgY9L.cjs → use-wallpaper-tint-WtRWtupA.cjs} +2 -2
- package/dist/{use-wallpaper-tint-Rq5UgY9L.cjs.map → use-wallpaper-tint-WtRWtupA.cjs.map} +1 -1
- package/dist/{utils-CcyeqpKQ.js → utils-B792GPM_.mjs} +1 -1
- package/dist/utils-B792GPM_.mjs.map +1 -0
- package/dist/{utils-NLnOCttr.cjs → utils-DX6rdBol.cjs} +2 -2
- package/dist/{utils-NLnOCttr.cjs.map → utils-DX6rdBol.cjs.map} +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.d.ts +2 -10
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.mjs +2 -0
- package/package.json +8 -8
- package/dist/cli/index.js.map +0 -1
- package/dist/components.js +0 -5
- package/dist/index.js.map +0 -1
- package/dist/theme-context-_T5r1KG4.js.map +0 -1
- package/dist/trust-score-card-glass-DTS1RdIt.cjs +0 -28660
- package/dist/trust-score-card-glass-DTS1RdIt.cjs.map +0 -1
- package/dist/trust-score-card-glass-Dg4_b_g_.js +0 -27660
- package/dist/trust-score-card-glass-Dg4_b_g_.js.map +0 -1
- package/dist/use-focus-CX0TJJIj.js.map +0 -1
- package/dist/use-wallpaper-tint-DUgmytlY.js.map +0 -1
- package/dist/utils-CcyeqpKQ.js.map +0 -1
- package/dist/utils.js +0 -2
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
3
|
-
import { n as useHover, t as useFocus } from "./use-focus-
|
|
4
|
-
import { a as getThemeConfig, i as getNextTheme, n as THEME_CONFIG, o as useTheme, r as ThemeProvider, t as THEMES } from "./theme-context-
|
|
5
|
-
import { n as useResponsive, t as useWallpaperTint } from "./use-wallpaper-tint-
|
|
6
|
-
import * as React
|
|
1
|
+
import { t as cn } from "./utils-B792GPM_.mjs";
|
|
2
|
+
import { $ as TabsTrigger, A as FlagAlertGlass, At as DropdownMenuGlassTrigger, B as IconButtonGlass, Bt as AvatarGlass, C as sparklineContainerVariants, Ct as DropdownMenuGlassRadioGroup, D as progressSizes, Dt as DropdownMenuGlassSub, E as ProgressGlass, Et as DropdownMenuGlassShortcut, F as SortDropdownGlass, Ft as CheckboxGlass, G as TooltipGlassSimple, Gt as statusSizes, H as TooltipGlass, Ht as AvatarGlassImage, I as SearchBoxGlass, It as ButtonGlass, J as toggleSizes, Jt as AlertGlassTitle, K as TooltipGlassTrigger, Kt as AlertGlass, L as InsightCardGlass, Lt as buttonGlassVariants, M as BaseProgressGlass, Mt as inputVariants, N as ThemeToggleGlass, Nt as CircularProgressGlass, O as ProfileAvatarGlass, Ot as DropdownMenuGlassSubContent, P as StatItemGlass, Pt as Checkbox, Q as TabsList, Qt as alertVariants, R as insightCardVariants, Rt as BadgeGlass, S as sparklineBarVariants, St as DropdownMenuGlassPortal, T as RainbowProgressGlass, Tt as DropdownMenuGlassSeparator, U as TooltipGlassContent, Ut as AvatarGlassSimple, V as ExpandableHeaderGlass, Vt as AvatarGlassFallback, W as TooltipGlassProvider, Wt as avatarSizes, X as TabsContent, Xt as FormFieldWrapper, Y as Tabs, Yt as InteractiveCard, Z as TabsGlass, Zt as TouchTarget, _ as ContributionMetricsGlass, _t as DropdownMenuGlassCheckboxItem, a as HeaderBrandingGlass, at as PopoverGlassContent, b as AICardGlass, bt as DropdownMenuGlassItem, c as YearCardGlass, ct as NotificationGlass, d as TrustScoreDisplayGlass, dt as modalSizes, et as SliderGlass, f as RepositoryMetadataGlass, ft as InputGlass, g as MetricCardGlass, gt as DropdownMenuGlass, h as MetricsGridGlass, ht as DropdownGlass, i as HeaderNavGlass, it as PopoverGlassAnchor, j as StatusIndicatorGlass, jt as ComboBoxGlass, k as LanguageBarGlass, kt as DropdownMenuGlassSubTrigger, l as UserStatsLineGlass, lt as notificationVariants, m as RepositoryCardGlass, mt as cardIntensity, n as ProjectsListGlass, nt as skeletonVariants, o as FlagsSectionGlass, ot as PopoverGlassLegacy, p as RepositoryHeaderGlass, pt as GlassCard, q as ToggleGlass, qt as AlertGlassDescription, r as ProfileHeaderGlass, rt as PopoverGlass, s as CareerStatsGlass, st as PopoverGlassTrigger, t as TrustScoreCardGlass, tt as SkeletonGlass, u as UserInfoGlass, ut as ModalGlass, v as CircularMetricGlass, vt as DropdownMenuGlassContent, w as SegmentedControlGlass, wt as DropdownMenuGlassRadioItem, x as SparklineGlass, xt as DropdownMenuGlassLabel, y as CareerStatsHeaderGlass, yt as DropdownMenuGlassGroup, z as insightVariantConfig, zt as badgeVariants } from "./trust-score-card-glass-EfMB5l5J.mjs";
|
|
3
|
+
import { n as useHover, t as useFocus } from "./use-focus-C5kPAKr_.mjs";
|
|
4
|
+
import { a as getThemeConfig, i as getNextTheme, n as THEME_CONFIG, o as useTheme, r as ThemeProvider, t as THEMES } from "./theme-context-DLS2uAgJ.mjs";
|
|
5
|
+
import { n as useResponsive, t as useWallpaperTint } from "./use-wallpaper-tint-C0kYXNiN.mjs";
|
|
6
|
+
import * as React from "react";
|
|
7
7
|
import { createContext, forwardRef, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
8
8
|
import { Check, ChevronDown, Menu, PanelLeft, PanelLeftClose, PanelLeftOpen, X } from "lucide-react";
|
|
9
|
-
import { clsx } from "clsx";
|
|
10
9
|
import { cva } from "class-variance-authority";
|
|
11
10
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
-
import { Slot
|
|
13
|
-
import
|
|
11
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
12
|
+
import * as RechartsPrimitive from "recharts";
|
|
13
|
+
import { Bar, BarChart, Cell, ResponsiveContainer } from "recharts";
|
|
14
|
+
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
14
15
|
var blurMap = {
|
|
15
16
|
subtle: "var(--blur-sm)",
|
|
16
17
|
medium: "var(--blur-md)",
|
|
@@ -865,1116 +866,29 @@ const SidebarGlass = {
|
|
|
865
866
|
MenuSubItem: SidebarMenuSubItem,
|
|
866
867
|
MenuSubButton: SidebarMenuSubButton
|
|
867
868
|
};
|
|
868
|
-
function _extends$1() {
|
|
869
|
-
return _extends$1 = Object.assign ? Object.assign.bind() : function(n) {
|
|
870
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
871
|
-
var t = arguments[e];
|
|
872
|
-
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
873
|
-
}
|
|
874
|
-
return n;
|
|
875
|
-
}, _extends$1.apply(null, arguments);
|
|
876
|
-
}
|
|
877
|
-
function ownKeys$1(e, r) {
|
|
878
|
-
var t = Object.keys(e);
|
|
879
|
-
if (Object.getOwnPropertySymbols) {
|
|
880
|
-
var o = Object.getOwnPropertySymbols(e);
|
|
881
|
-
r && (o = o.filter(function(r$1) {
|
|
882
|
-
return Object.getOwnPropertyDescriptor(e, r$1).enumerable;
|
|
883
|
-
})), t.push.apply(t, o);
|
|
884
|
-
}
|
|
885
|
-
return t;
|
|
886
|
-
}
|
|
887
|
-
function _objectSpread$1(e) {
|
|
888
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
889
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
890
|
-
r % 2 ? ownKeys$1(Object(t), !0).forEach(function(r$1) {
|
|
891
|
-
_defineProperty$1(e, r$1, t[r$1]);
|
|
892
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function(r$1) {
|
|
893
|
-
Object.defineProperty(e, r$1, Object.getOwnPropertyDescriptor(t, r$1));
|
|
894
|
-
});
|
|
895
|
-
}
|
|
896
|
-
return e;
|
|
897
|
-
}
|
|
898
|
-
function _defineProperty$1(e, r, t) {
|
|
899
|
-
return (r = _toPropertyKey$1(r)) in e ? Object.defineProperty(e, r, {
|
|
900
|
-
value: t,
|
|
901
|
-
enumerable: !0,
|
|
902
|
-
configurable: !0,
|
|
903
|
-
writable: !0
|
|
904
|
-
}) : e[r] = t, e;
|
|
905
|
-
}
|
|
906
|
-
function _toPropertyKey$1(t) {
|
|
907
|
-
var i = _toPrimitive$1(t, "string");
|
|
908
|
-
return "symbol" == typeof i ? i : i + "";
|
|
909
|
-
}
|
|
910
|
-
function _toPrimitive$1(t, r) {
|
|
911
|
-
if ("object" != typeof t || !t) return t;
|
|
912
|
-
var e = t[Symbol.toPrimitive];
|
|
913
|
-
if (void 0 !== e) {
|
|
914
|
-
var i = e.call(t, r || "default");
|
|
915
|
-
if ("object" != typeof i) return i;
|
|
916
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
917
|
-
}
|
|
918
|
-
return ("string" === r ? String : Number)(t);
|
|
919
|
-
}
|
|
920
|
-
var SIZE = 32;
|
|
921
|
-
var defaultLegendContentDefaultProps = {
|
|
922
|
-
align: "center",
|
|
923
|
-
iconSize: 14,
|
|
924
|
-
inactiveColor: "#ccc",
|
|
925
|
-
layout: "horizontal",
|
|
926
|
-
verticalAlign: "middle"
|
|
927
|
-
};
|
|
928
|
-
function Icon(_ref) {
|
|
929
|
-
var { data, iconType, inactiveColor } = _ref;
|
|
930
|
-
var halfSize = SIZE / 2;
|
|
931
|
-
var sixthSize = SIZE / 6;
|
|
932
|
-
var thirdSize = SIZE / 3;
|
|
933
|
-
var color = data.inactive ? inactiveColor : data.color;
|
|
934
|
-
var preferredIcon = iconType !== null && iconType !== void 0 ? iconType : data.type;
|
|
935
|
-
if (preferredIcon === "none") return null;
|
|
936
|
-
if (preferredIcon === "plainline") {
|
|
937
|
-
var _data$payload;
|
|
938
|
-
return /* @__PURE__ */ React$1.createElement("line", {
|
|
939
|
-
strokeWidth: 4,
|
|
940
|
-
fill: "none",
|
|
941
|
-
stroke: color,
|
|
942
|
-
strokeDasharray: (_data$payload = data.payload) === null || _data$payload === void 0 ? void 0 : _data$payload.strokeDasharray,
|
|
943
|
-
x1: 0,
|
|
944
|
-
y1: halfSize,
|
|
945
|
-
x2: SIZE,
|
|
946
|
-
y2: halfSize,
|
|
947
|
-
className: "recharts-legend-icon"
|
|
948
|
-
});
|
|
949
|
-
}
|
|
950
|
-
if (preferredIcon === "line") return /* @__PURE__ */ React$1.createElement("path", {
|
|
951
|
-
strokeWidth: 4,
|
|
952
|
-
fill: "none",
|
|
953
|
-
stroke: color,
|
|
954
|
-
d: "M0,".concat(halfSize, "h").concat(thirdSize, "\n A").concat(sixthSize, ",").concat(sixthSize, ",0,1,1,").concat(2 * thirdSize, ",").concat(halfSize, "\n H").concat(SIZE, "M").concat(2 * thirdSize, ",").concat(halfSize, "\n A").concat(sixthSize, ",").concat(sixthSize, ",0,1,1,").concat(thirdSize, ",").concat(halfSize),
|
|
955
|
-
className: "recharts-legend-icon"
|
|
956
|
-
});
|
|
957
|
-
if (preferredIcon === "rect") return /* @__PURE__ */ React$1.createElement("path", {
|
|
958
|
-
stroke: "none",
|
|
959
|
-
fill: color,
|
|
960
|
-
d: "M0,".concat(SIZE / 8, "h").concat(SIZE, "v").concat(SIZE * 3 / 4, "h").concat(-SIZE, "z"),
|
|
961
|
-
className: "recharts-legend-icon"
|
|
962
|
-
});
|
|
963
|
-
if (/* @__PURE__ */ React$1.isValidElement(data.legendIcon)) {
|
|
964
|
-
var iconProps = _objectSpread$1({}, data);
|
|
965
|
-
delete iconProps.legendIcon;
|
|
966
|
-
return /* @__PURE__ */ React$1.cloneElement(data.legendIcon, iconProps);
|
|
967
|
-
}
|
|
968
|
-
return /* @__PURE__ */ React$1.createElement(Symbols, {
|
|
969
|
-
fill: color,
|
|
970
|
-
cx: halfSize,
|
|
971
|
-
cy: halfSize,
|
|
972
|
-
size: SIZE,
|
|
973
|
-
sizeType: "diameter",
|
|
974
|
-
type: preferredIcon
|
|
975
|
-
});
|
|
976
|
-
}
|
|
977
|
-
function Items(props) {
|
|
978
|
-
var { payload, iconSize, layout, formatter, inactiveColor, iconType } = props;
|
|
979
|
-
var viewBox = {
|
|
980
|
-
x: 0,
|
|
981
|
-
y: 0,
|
|
982
|
-
width: SIZE,
|
|
983
|
-
height: SIZE
|
|
984
|
-
};
|
|
985
|
-
var itemStyle = {
|
|
986
|
-
display: layout === "horizontal" ? "inline-block" : "block",
|
|
987
|
-
marginRight: 10
|
|
988
|
-
};
|
|
989
|
-
var svgStyle = {
|
|
990
|
-
display: "inline-block",
|
|
991
|
-
verticalAlign: "middle",
|
|
992
|
-
marginRight: 4
|
|
993
|
-
};
|
|
994
|
-
return payload.map((entry, i) => {
|
|
995
|
-
var finalFormatter = entry.formatter || formatter;
|
|
996
|
-
var className = clsx({
|
|
997
|
-
"recharts-legend-item": true,
|
|
998
|
-
["legend-item-".concat(i)]: true,
|
|
999
|
-
inactive: entry.inactive
|
|
1000
|
-
});
|
|
1001
|
-
if (entry.type === "none") return null;
|
|
1002
|
-
var color = entry.inactive ? inactiveColor : entry.color;
|
|
1003
|
-
var finalValue = finalFormatter ? finalFormatter(entry.value, entry, i) : entry.value;
|
|
1004
|
-
return /* @__PURE__ */ React$1.createElement("li", _extends$1({
|
|
1005
|
-
className,
|
|
1006
|
-
style: itemStyle,
|
|
1007
|
-
key: "legend-item-".concat(i)
|
|
1008
|
-
}, adaptEventsOfChild(props, entry, i)), /* @__PURE__ */ React$1.createElement(Surface, {
|
|
1009
|
-
width: iconSize,
|
|
1010
|
-
height: iconSize,
|
|
1011
|
-
viewBox,
|
|
1012
|
-
style: svgStyle,
|
|
1013
|
-
"aria-label": "".concat(finalValue, " legend icon")
|
|
1014
|
-
}, /* @__PURE__ */ React$1.createElement(Icon, {
|
|
1015
|
-
data: entry,
|
|
1016
|
-
iconType,
|
|
1017
|
-
inactiveColor
|
|
1018
|
-
})), /* @__PURE__ */ React$1.createElement("span", {
|
|
1019
|
-
className: "recharts-legend-item-text",
|
|
1020
|
-
style: { color }
|
|
1021
|
-
}, finalValue));
|
|
1022
|
-
});
|
|
1023
|
-
}
|
|
1024
|
-
var DefaultLegendContent = (outsideProps) => {
|
|
1025
|
-
var props = resolveDefaultProps(outsideProps, defaultLegendContentDefaultProps);
|
|
1026
|
-
var { payload, layout, align } = props;
|
|
1027
|
-
if (!payload || !payload.length) return null;
|
|
1028
|
-
var finalStyle = {
|
|
1029
|
-
padding: 0,
|
|
1030
|
-
margin: 0,
|
|
1031
|
-
textAlign: layout === "horizontal" ? align : "left"
|
|
1032
|
-
};
|
|
1033
|
-
return /* @__PURE__ */ React$1.createElement("ul", {
|
|
1034
|
-
className: "recharts-default-legend",
|
|
1035
|
-
style: finalStyle
|
|
1036
|
-
}, /* @__PURE__ */ React$1.createElement(Items, _extends$1({}, props, { payload })));
|
|
1037
|
-
};
|
|
1038
|
-
function useLegendPayload() {
|
|
1039
|
-
return useAppSelector(selectLegendPayload);
|
|
1040
|
-
}
|
|
1041
|
-
var _excluded = ["contextPayload"];
|
|
1042
|
-
function _extends() {
|
|
1043
|
-
return _extends = Object.assign ? Object.assign.bind() : function(n) {
|
|
1044
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
1045
|
-
var t = arguments[e];
|
|
1046
|
-
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
1047
|
-
}
|
|
1048
|
-
return n;
|
|
1049
|
-
}, _extends.apply(null, arguments);
|
|
1050
|
-
}
|
|
1051
|
-
function ownKeys(e, r) {
|
|
1052
|
-
var t = Object.keys(e);
|
|
1053
|
-
if (Object.getOwnPropertySymbols) {
|
|
1054
|
-
var o = Object.getOwnPropertySymbols(e);
|
|
1055
|
-
r && (o = o.filter(function(r$1) {
|
|
1056
|
-
return Object.getOwnPropertyDescriptor(e, r$1).enumerable;
|
|
1057
|
-
})), t.push.apply(t, o);
|
|
1058
|
-
}
|
|
1059
|
-
return t;
|
|
1060
|
-
}
|
|
1061
|
-
function _objectSpread(e) {
|
|
1062
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
1063
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
1064
|
-
r % 2 ? ownKeys(Object(t), !0).forEach(function(r$1) {
|
|
1065
|
-
_defineProperty(e, r$1, t[r$1]);
|
|
1066
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r$1) {
|
|
1067
|
-
Object.defineProperty(e, r$1, Object.getOwnPropertyDescriptor(t, r$1));
|
|
1068
|
-
});
|
|
1069
|
-
}
|
|
1070
|
-
return e;
|
|
1071
|
-
}
|
|
1072
|
-
function _defineProperty(e, r, t) {
|
|
1073
|
-
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
1074
|
-
value: t,
|
|
1075
|
-
enumerable: !0,
|
|
1076
|
-
configurable: !0,
|
|
1077
|
-
writable: !0
|
|
1078
|
-
}) : e[r] = t, e;
|
|
1079
|
-
}
|
|
1080
|
-
function _toPropertyKey(t) {
|
|
1081
|
-
var i = _toPrimitive(t, "string");
|
|
1082
|
-
return "symbol" == typeof i ? i : i + "";
|
|
1083
|
-
}
|
|
1084
|
-
function _toPrimitive(t, r) {
|
|
1085
|
-
if ("object" != typeof t || !t) return t;
|
|
1086
|
-
var e = t[Symbol.toPrimitive];
|
|
1087
|
-
if (void 0 !== e) {
|
|
1088
|
-
var i = e.call(t, r || "default");
|
|
1089
|
-
if ("object" != typeof i) return i;
|
|
1090
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1091
|
-
}
|
|
1092
|
-
return ("string" === r ? String : Number)(t);
|
|
1093
|
-
}
|
|
1094
|
-
function _objectWithoutProperties(e, t) {
|
|
1095
|
-
if (null == e) return {};
|
|
1096
|
-
var o, r, i = _objectWithoutPropertiesLoose(e, t);
|
|
1097
|
-
if (Object.getOwnPropertySymbols) {
|
|
1098
|
-
var n = Object.getOwnPropertySymbols(e);
|
|
1099
|
-
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
1100
|
-
}
|
|
1101
|
-
return i;
|
|
1102
|
-
}
|
|
1103
|
-
function _objectWithoutPropertiesLoose(r, e) {
|
|
1104
|
-
if (null == r) return {};
|
|
1105
|
-
var t = {};
|
|
1106
|
-
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
1107
|
-
if (-1 !== e.indexOf(n)) continue;
|
|
1108
|
-
t[n] = r[n];
|
|
1109
|
-
}
|
|
1110
|
-
return t;
|
|
1111
|
-
}
|
|
1112
|
-
function defaultUniqBy(entry) {
|
|
1113
|
-
return entry.value;
|
|
1114
|
-
}
|
|
1115
|
-
function LegendContent(props) {
|
|
1116
|
-
var { contextPayload } = props, otherProps = _objectWithoutProperties(props, _excluded);
|
|
1117
|
-
var finalPayload = getUniqPayload(contextPayload, props.payloadUniqBy, defaultUniqBy);
|
|
1118
|
-
var contentProps = _objectSpread(_objectSpread({}, otherProps), {}, { payload: finalPayload });
|
|
1119
|
-
if (/* @__PURE__ */ React$1.isValidElement(props.content)) return /* @__PURE__ */ React$1.cloneElement(props.content, contentProps);
|
|
1120
|
-
if (typeof props.content === "function") return /* @__PURE__ */ React$1.createElement(props.content, contentProps);
|
|
1121
|
-
return /* @__PURE__ */ React$1.createElement(DefaultLegendContent, contentProps);
|
|
1122
|
-
}
|
|
1123
|
-
function getDefaultPosition(style, props, margin, chartWidth, chartHeight, box) {
|
|
1124
|
-
var { layout, align, verticalAlign } = props;
|
|
1125
|
-
var hPos, vPos;
|
|
1126
|
-
if (!style || (style.left === void 0 || style.left === null) && (style.right === void 0 || style.right === null)) if (align === "center" && layout === "vertical") hPos = { left: ((chartWidth || 0) - box.width) / 2 };
|
|
1127
|
-
else hPos = align === "right" ? { right: margin && margin.right || 0 } : { left: margin && margin.left || 0 };
|
|
1128
|
-
if (!style || (style.top === void 0 || style.top === null) && (style.bottom === void 0 || style.bottom === null)) if (verticalAlign === "middle") vPos = { top: ((chartHeight || 0) - box.height) / 2 };
|
|
1129
|
-
else vPos = verticalAlign === "bottom" ? { bottom: margin && margin.bottom || 0 } : { top: margin && margin.top || 0 };
|
|
1130
|
-
return _objectSpread(_objectSpread({}, hPos), vPos);
|
|
1131
|
-
}
|
|
1132
|
-
function LegendSettingsDispatcher(props) {
|
|
1133
|
-
var dispatch = useAppDispatch();
|
|
1134
|
-
useEffect(() => {
|
|
1135
|
-
dispatch(setLegendSettings(props));
|
|
1136
|
-
}, [dispatch, props]);
|
|
1137
|
-
return null;
|
|
1138
|
-
}
|
|
1139
|
-
function LegendSizeDispatcher(props) {
|
|
1140
|
-
var dispatch = useAppDispatch();
|
|
1141
|
-
useEffect(() => {
|
|
1142
|
-
dispatch(setLegendSize(props));
|
|
1143
|
-
return () => {
|
|
1144
|
-
dispatch(setLegendSize({
|
|
1145
|
-
width: 0,
|
|
1146
|
-
height: 0
|
|
1147
|
-
}));
|
|
1148
|
-
};
|
|
1149
|
-
}, [dispatch, props]);
|
|
1150
|
-
return null;
|
|
1151
|
-
}
|
|
1152
|
-
function getWidthOrHeight(layout, height, width, maxWidth) {
|
|
1153
|
-
if (layout === "vertical" && isNumber(height)) return { height };
|
|
1154
|
-
if (layout === "horizontal") return { width: width || maxWidth };
|
|
1155
|
-
return null;
|
|
1156
|
-
}
|
|
1157
|
-
var legendDefaultProps = {
|
|
1158
|
-
align: "center",
|
|
1159
|
-
iconSize: 14,
|
|
1160
|
-
itemSorter: "value",
|
|
1161
|
-
layout: "horizontal",
|
|
1162
|
-
verticalAlign: "bottom"
|
|
1163
|
-
};
|
|
1164
|
-
function Legend(outsideProps) {
|
|
1165
|
-
var props = resolveDefaultProps(outsideProps, legendDefaultProps);
|
|
1166
|
-
var contextPayload = useLegendPayload();
|
|
1167
|
-
var legendPortalFromContext = useLegendPortal();
|
|
1168
|
-
var margin = useMargin();
|
|
1169
|
-
var { width: widthFromProps, height: heightFromProps, wrapperStyle, portal: portalFromProps } = props;
|
|
1170
|
-
var [lastBoundingBox, updateBoundingBox] = useElementOffset([contextPayload]);
|
|
1171
|
-
var chartWidth = useChartWidth();
|
|
1172
|
-
var chartHeight = useChartHeight();
|
|
1173
|
-
if (chartWidth == null || chartHeight == null) return null;
|
|
1174
|
-
var maxWidth = chartWidth - ((margin === null || margin === void 0 ? void 0 : margin.left) || 0) - ((margin === null || margin === void 0 ? void 0 : margin.right) || 0);
|
|
1175
|
-
var widthOrHeight = getWidthOrHeight(props.layout, heightFromProps, widthFromProps, maxWidth);
|
|
1176
|
-
var outerStyle = portalFromProps ? wrapperStyle : _objectSpread(_objectSpread({
|
|
1177
|
-
position: "absolute",
|
|
1178
|
-
width: (widthOrHeight === null || widthOrHeight === void 0 ? void 0 : widthOrHeight.width) || widthFromProps || "auto",
|
|
1179
|
-
height: (widthOrHeight === null || widthOrHeight === void 0 ? void 0 : widthOrHeight.height) || heightFromProps || "auto"
|
|
1180
|
-
}, getDefaultPosition(wrapperStyle, props, margin, chartWidth, chartHeight, lastBoundingBox)), wrapperStyle);
|
|
1181
|
-
var legendPortal = portalFromProps !== null && portalFromProps !== void 0 ? portalFromProps : legendPortalFromContext;
|
|
1182
|
-
if (legendPortal == null || contextPayload == null) return null;
|
|
1183
|
-
return /* @__PURE__ */ createPortal(/* @__PURE__ */ React$1.createElement("div", {
|
|
1184
|
-
className: "recharts-legend-wrapper",
|
|
1185
|
-
style: outerStyle,
|
|
1186
|
-
ref: updateBoundingBox
|
|
1187
|
-
}, /* @__PURE__ */ React$1.createElement(LegendSettingsDispatcher, {
|
|
1188
|
-
layout: props.layout,
|
|
1189
|
-
align: props.align,
|
|
1190
|
-
verticalAlign: props.verticalAlign,
|
|
1191
|
-
itemSorter: props.itemSorter
|
|
1192
|
-
}), !portalFromProps && /* @__PURE__ */ React$1.createElement(LegendSizeDispatcher, {
|
|
1193
|
-
width: lastBoundingBox.width,
|
|
1194
|
-
height: lastBoundingBox.height
|
|
1195
|
-
}), /* @__PURE__ */ React$1.createElement(LegendContent, _extends({}, props, widthOrHeight, {
|
|
1196
|
-
margin,
|
|
1197
|
-
chartWidth,
|
|
1198
|
-
chartHeight,
|
|
1199
|
-
contextPayload
|
|
1200
|
-
}))), legendPortal);
|
|
1201
|
-
}
|
|
1202
|
-
Legend.displayName = "Legend";
|
|
1203
|
-
var Primitive = [
|
|
1204
|
-
"a",
|
|
1205
|
-
"button",
|
|
1206
|
-
"div",
|
|
1207
|
-
"form",
|
|
1208
|
-
"h2",
|
|
1209
|
-
"h3",
|
|
1210
|
-
"img",
|
|
1211
|
-
"input",
|
|
1212
|
-
"label",
|
|
1213
|
-
"li",
|
|
1214
|
-
"nav",
|
|
1215
|
-
"ol",
|
|
1216
|
-
"p",
|
|
1217
|
-
"select",
|
|
1218
|
-
"span",
|
|
1219
|
-
"svg",
|
|
1220
|
-
"ul"
|
|
1221
|
-
].reduce((primitive, node) => {
|
|
1222
|
-
const Slot$1 = createSlot(`Primitive.${node}`);
|
|
1223
|
-
const Node = React$1.forwardRef((props, forwardedRef) => {
|
|
1224
|
-
const { asChild, ...primitiveProps } = props;
|
|
1225
|
-
const Comp = asChild ? Slot$1 : node;
|
|
1226
|
-
if (typeof window !== "undefined") window[Symbol.for("radix-ui")] = true;
|
|
1227
|
-
return /* @__PURE__ */ jsx(Comp, {
|
|
1228
|
-
...primitiveProps,
|
|
1229
|
-
ref: forwardedRef
|
|
1230
|
-
});
|
|
1231
|
-
});
|
|
1232
|
-
Node.displayName = `Primitive.${node}`;
|
|
1233
|
-
return {
|
|
1234
|
-
...primitive,
|
|
1235
|
-
[node]: Node
|
|
1236
|
-
};
|
|
1237
|
-
}, {});
|
|
1238
|
-
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
1239
|
-
let defaultContexts = [];
|
|
1240
|
-
function createContext3(rootComponentName, defaultContext) {
|
|
1241
|
-
const BaseContext = React$1.createContext(defaultContext);
|
|
1242
|
-
const index = defaultContexts.length;
|
|
1243
|
-
defaultContexts = [...defaultContexts, defaultContext];
|
|
1244
|
-
const Provider = (props) => {
|
|
1245
|
-
const { scope, children, ...context } = props;
|
|
1246
|
-
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
1247
|
-
const value = React$1.useMemo(() => context, Object.values(context));
|
|
1248
|
-
return /* @__PURE__ */ jsx(Context.Provider, {
|
|
1249
|
-
value,
|
|
1250
|
-
children
|
|
1251
|
-
});
|
|
1252
|
-
};
|
|
1253
|
-
Provider.displayName = rootComponentName + "Provider";
|
|
1254
|
-
function useContext2(consumerName, scope) {
|
|
1255
|
-
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
1256
|
-
const context = React$1.useContext(Context);
|
|
1257
|
-
if (context) return context;
|
|
1258
|
-
if (defaultContext !== void 0) return defaultContext;
|
|
1259
|
-
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
1260
|
-
}
|
|
1261
|
-
return [Provider, useContext2];
|
|
1262
|
-
}
|
|
1263
|
-
const createScope = () => {
|
|
1264
|
-
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
1265
|
-
return React$1.createContext(defaultContext);
|
|
1266
|
-
});
|
|
1267
|
-
return function useScope(scope) {
|
|
1268
|
-
const contexts = scope?.[scopeName] || scopeContexts;
|
|
1269
|
-
return React$1.useMemo(() => ({ [`__scope${scopeName}`]: {
|
|
1270
|
-
...scope,
|
|
1271
|
-
[scopeName]: contexts
|
|
1272
|
-
} }), [scope, contexts]);
|
|
1273
|
-
};
|
|
1274
|
-
};
|
|
1275
|
-
createScope.scopeName = scopeName;
|
|
1276
|
-
return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
|
|
1277
|
-
}
|
|
1278
|
-
function composeContextScopes(...scopes) {
|
|
1279
|
-
const baseScope = scopes[0];
|
|
1280
|
-
if (scopes.length === 1) return baseScope;
|
|
1281
|
-
const createScope = () => {
|
|
1282
|
-
const scopeHooks = scopes.map((createScope2) => ({
|
|
1283
|
-
useScope: createScope2(),
|
|
1284
|
-
scopeName: createScope2.scopeName
|
|
1285
|
-
}));
|
|
1286
|
-
return function useComposedScopes(overrideScopes) {
|
|
1287
|
-
const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
|
|
1288
|
-
const currentScope = useScope(overrideScopes)[`__scope${scopeName}`];
|
|
1289
|
-
return {
|
|
1290
|
-
...nextScopes2,
|
|
1291
|
-
...currentScope
|
|
1292
|
-
};
|
|
1293
|
-
}, {});
|
|
1294
|
-
return React$1.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
1295
|
-
};
|
|
1296
|
-
};
|
|
1297
|
-
createScope.scopeName = baseScope.scopeName;
|
|
1298
|
-
return createScope;
|
|
1299
|
-
}
|
|
1300
|
-
function useStateMachine(initialState, machine) {
|
|
1301
|
-
return React$1.useReducer((state, event) => {
|
|
1302
|
-
return machine[state][event] ?? state;
|
|
1303
|
-
}, initialState);
|
|
1304
|
-
}
|
|
1305
|
-
var SCROLL_AREA_NAME = "ScrollArea";
|
|
1306
|
-
var [createScrollAreaContext, createScrollAreaScope] = createContextScope(SCROLL_AREA_NAME);
|
|
1307
|
-
var [ScrollAreaProvider, useScrollAreaContext] = createScrollAreaContext(SCROLL_AREA_NAME);
|
|
1308
|
-
var ScrollArea$1 = React$1.forwardRef((props, forwardedRef) => {
|
|
1309
|
-
const { __scopeScrollArea, type = "hover", dir, scrollHideDelay = 600, ...scrollAreaProps } = props;
|
|
1310
|
-
const [scrollArea, setScrollArea] = React$1.useState(null);
|
|
1311
|
-
const [viewport, setViewport] = React$1.useState(null);
|
|
1312
|
-
const [content, setContent] = React$1.useState(null);
|
|
1313
|
-
const [scrollbarX, setScrollbarX] = React$1.useState(null);
|
|
1314
|
-
const [scrollbarY, setScrollbarY] = React$1.useState(null);
|
|
1315
|
-
const [cornerWidth, setCornerWidth] = React$1.useState(0);
|
|
1316
|
-
const [cornerHeight, setCornerHeight] = React$1.useState(0);
|
|
1317
|
-
const [scrollbarXEnabled, setScrollbarXEnabled] = React$1.useState(false);
|
|
1318
|
-
const [scrollbarYEnabled, setScrollbarYEnabled] = React$1.useState(false);
|
|
1319
|
-
const composedRefs = useComposedRefs(forwardedRef, (node) => setScrollArea(node));
|
|
1320
|
-
const direction = useDirection(dir);
|
|
1321
|
-
return /* @__PURE__ */ jsx(ScrollAreaProvider, {
|
|
1322
|
-
scope: __scopeScrollArea,
|
|
1323
|
-
type,
|
|
1324
|
-
dir: direction,
|
|
1325
|
-
scrollHideDelay,
|
|
1326
|
-
scrollArea,
|
|
1327
|
-
viewport,
|
|
1328
|
-
onViewportChange: setViewport,
|
|
1329
|
-
content,
|
|
1330
|
-
onContentChange: setContent,
|
|
1331
|
-
scrollbarX,
|
|
1332
|
-
onScrollbarXChange: setScrollbarX,
|
|
1333
|
-
scrollbarXEnabled,
|
|
1334
|
-
onScrollbarXEnabledChange: setScrollbarXEnabled,
|
|
1335
|
-
scrollbarY,
|
|
1336
|
-
onScrollbarYChange: setScrollbarY,
|
|
1337
|
-
scrollbarYEnabled,
|
|
1338
|
-
onScrollbarYEnabledChange: setScrollbarYEnabled,
|
|
1339
|
-
onCornerWidthChange: setCornerWidth,
|
|
1340
|
-
onCornerHeightChange: setCornerHeight,
|
|
1341
|
-
children: /* @__PURE__ */ jsx(Primitive.div, {
|
|
1342
|
-
dir: direction,
|
|
1343
|
-
...scrollAreaProps,
|
|
1344
|
-
ref: composedRefs,
|
|
1345
|
-
style: {
|
|
1346
|
-
position: "relative",
|
|
1347
|
-
["--radix-scroll-area-corner-width"]: cornerWidth + "px",
|
|
1348
|
-
["--radix-scroll-area-corner-height"]: cornerHeight + "px",
|
|
1349
|
-
...props.style
|
|
1350
|
-
}
|
|
1351
|
-
})
|
|
1352
|
-
});
|
|
1353
|
-
});
|
|
1354
|
-
ScrollArea$1.displayName = SCROLL_AREA_NAME;
|
|
1355
|
-
var VIEWPORT_NAME = "ScrollAreaViewport";
|
|
1356
|
-
var ScrollAreaViewport = React$1.forwardRef((props, forwardedRef) => {
|
|
1357
|
-
const { __scopeScrollArea, children, nonce, ...viewportProps } = props;
|
|
1358
|
-
const context = useScrollAreaContext(VIEWPORT_NAME, __scopeScrollArea);
|
|
1359
|
-
const composedRefs = useComposedRefs(forwardedRef, React$1.useRef(null), context.onViewportChange);
|
|
1360
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("style", {
|
|
1361
|
-
dangerouslySetInnerHTML: { __html: `[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}` },
|
|
1362
|
-
nonce
|
|
1363
|
-
}), /* @__PURE__ */ jsx(Primitive.div, {
|
|
1364
|
-
"data-radix-scroll-area-viewport": "",
|
|
1365
|
-
...viewportProps,
|
|
1366
|
-
ref: composedRefs,
|
|
1367
|
-
style: {
|
|
1368
|
-
overflowX: context.scrollbarXEnabled ? "scroll" : "hidden",
|
|
1369
|
-
overflowY: context.scrollbarYEnabled ? "scroll" : "hidden",
|
|
1370
|
-
...props.style
|
|
1371
|
-
},
|
|
1372
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
1373
|
-
ref: context.onContentChange,
|
|
1374
|
-
style: {
|
|
1375
|
-
minWidth: "100%",
|
|
1376
|
-
display: "table"
|
|
1377
|
-
},
|
|
1378
|
-
children
|
|
1379
|
-
})
|
|
1380
|
-
})] });
|
|
1381
|
-
});
|
|
1382
|
-
ScrollAreaViewport.displayName = VIEWPORT_NAME;
|
|
1383
|
-
var SCROLLBAR_NAME = "ScrollAreaScrollbar";
|
|
1384
|
-
var ScrollAreaScrollbar = React$1.forwardRef((props, forwardedRef) => {
|
|
1385
|
-
const { forceMount, ...scrollbarProps } = props;
|
|
1386
|
-
const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
|
|
1387
|
-
const { onScrollbarXEnabledChange, onScrollbarYEnabledChange } = context;
|
|
1388
|
-
const isHorizontal = props.orientation === "horizontal";
|
|
1389
|
-
React$1.useEffect(() => {
|
|
1390
|
-
isHorizontal ? onScrollbarXEnabledChange(true) : onScrollbarYEnabledChange(true);
|
|
1391
|
-
return () => {
|
|
1392
|
-
isHorizontal ? onScrollbarXEnabledChange(false) : onScrollbarYEnabledChange(false);
|
|
1393
|
-
};
|
|
1394
|
-
}, [
|
|
1395
|
-
isHorizontal,
|
|
1396
|
-
onScrollbarXEnabledChange,
|
|
1397
|
-
onScrollbarYEnabledChange
|
|
1398
|
-
]);
|
|
1399
|
-
return context.type === "hover" ? /* @__PURE__ */ jsx(ScrollAreaScrollbarHover, {
|
|
1400
|
-
...scrollbarProps,
|
|
1401
|
-
ref: forwardedRef,
|
|
1402
|
-
forceMount
|
|
1403
|
-
}) : context.type === "scroll" ? /* @__PURE__ */ jsx(ScrollAreaScrollbarScroll, {
|
|
1404
|
-
...scrollbarProps,
|
|
1405
|
-
ref: forwardedRef,
|
|
1406
|
-
forceMount
|
|
1407
|
-
}) : context.type === "auto" ? /* @__PURE__ */ jsx(ScrollAreaScrollbarAuto, {
|
|
1408
|
-
...scrollbarProps,
|
|
1409
|
-
ref: forwardedRef,
|
|
1410
|
-
forceMount
|
|
1411
|
-
}) : context.type === "always" ? /* @__PURE__ */ jsx(ScrollAreaScrollbarVisible, {
|
|
1412
|
-
...scrollbarProps,
|
|
1413
|
-
ref: forwardedRef
|
|
1414
|
-
}) : null;
|
|
1415
|
-
});
|
|
1416
|
-
ScrollAreaScrollbar.displayName = SCROLLBAR_NAME;
|
|
1417
|
-
var ScrollAreaScrollbarHover = React$1.forwardRef((props, forwardedRef) => {
|
|
1418
|
-
const { forceMount, ...scrollbarProps } = props;
|
|
1419
|
-
const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
|
|
1420
|
-
const [visible, setVisible] = React$1.useState(false);
|
|
1421
|
-
React$1.useEffect(() => {
|
|
1422
|
-
const scrollArea = context.scrollArea;
|
|
1423
|
-
let hideTimer = 0;
|
|
1424
|
-
if (scrollArea) {
|
|
1425
|
-
const handlePointerEnter = () => {
|
|
1426
|
-
window.clearTimeout(hideTimer);
|
|
1427
|
-
setVisible(true);
|
|
1428
|
-
};
|
|
1429
|
-
const handlePointerLeave = () => {
|
|
1430
|
-
hideTimer = window.setTimeout(() => setVisible(false), context.scrollHideDelay);
|
|
1431
|
-
};
|
|
1432
|
-
scrollArea.addEventListener("pointerenter", handlePointerEnter);
|
|
1433
|
-
scrollArea.addEventListener("pointerleave", handlePointerLeave);
|
|
1434
|
-
return () => {
|
|
1435
|
-
window.clearTimeout(hideTimer);
|
|
1436
|
-
scrollArea.removeEventListener("pointerenter", handlePointerEnter);
|
|
1437
|
-
scrollArea.removeEventListener("pointerleave", handlePointerLeave);
|
|
1438
|
-
};
|
|
1439
|
-
}
|
|
1440
|
-
}, [context.scrollArea, context.scrollHideDelay]);
|
|
1441
|
-
return /* @__PURE__ */ jsx(Presence, {
|
|
1442
|
-
present: forceMount || visible,
|
|
1443
|
-
children: /* @__PURE__ */ jsx(ScrollAreaScrollbarAuto, {
|
|
1444
|
-
"data-state": visible ? "visible" : "hidden",
|
|
1445
|
-
...scrollbarProps,
|
|
1446
|
-
ref: forwardedRef
|
|
1447
|
-
})
|
|
1448
|
-
});
|
|
1449
|
-
});
|
|
1450
|
-
var ScrollAreaScrollbarScroll = React$1.forwardRef((props, forwardedRef) => {
|
|
1451
|
-
const { forceMount, ...scrollbarProps } = props;
|
|
1452
|
-
const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
|
|
1453
|
-
const isHorizontal = props.orientation === "horizontal";
|
|
1454
|
-
const debounceScrollEnd = useDebounceCallback(() => send("SCROLL_END"), 100);
|
|
1455
|
-
const [state, send] = useStateMachine("hidden", {
|
|
1456
|
-
hidden: { SCROLL: "scrolling" },
|
|
1457
|
-
scrolling: {
|
|
1458
|
-
SCROLL_END: "idle",
|
|
1459
|
-
POINTER_ENTER: "interacting"
|
|
1460
|
-
},
|
|
1461
|
-
interacting: {
|
|
1462
|
-
SCROLL: "interacting",
|
|
1463
|
-
POINTER_LEAVE: "idle"
|
|
1464
|
-
},
|
|
1465
|
-
idle: {
|
|
1466
|
-
HIDE: "hidden",
|
|
1467
|
-
SCROLL: "scrolling",
|
|
1468
|
-
POINTER_ENTER: "interacting"
|
|
1469
|
-
}
|
|
1470
|
-
});
|
|
1471
|
-
React$1.useEffect(() => {
|
|
1472
|
-
if (state === "idle") {
|
|
1473
|
-
const hideTimer = window.setTimeout(() => send("HIDE"), context.scrollHideDelay);
|
|
1474
|
-
return () => window.clearTimeout(hideTimer);
|
|
1475
|
-
}
|
|
1476
|
-
}, [
|
|
1477
|
-
state,
|
|
1478
|
-
context.scrollHideDelay,
|
|
1479
|
-
send
|
|
1480
|
-
]);
|
|
1481
|
-
React$1.useEffect(() => {
|
|
1482
|
-
const viewport = context.viewport;
|
|
1483
|
-
const scrollDirection = isHorizontal ? "scrollLeft" : "scrollTop";
|
|
1484
|
-
if (viewport) {
|
|
1485
|
-
let prevScrollPos = viewport[scrollDirection];
|
|
1486
|
-
const handleScroll = () => {
|
|
1487
|
-
const scrollPos = viewport[scrollDirection];
|
|
1488
|
-
if (prevScrollPos !== scrollPos) {
|
|
1489
|
-
send("SCROLL");
|
|
1490
|
-
debounceScrollEnd();
|
|
1491
|
-
}
|
|
1492
|
-
prevScrollPos = scrollPos;
|
|
1493
|
-
};
|
|
1494
|
-
viewport.addEventListener("scroll", handleScroll);
|
|
1495
|
-
return () => viewport.removeEventListener("scroll", handleScroll);
|
|
1496
|
-
}
|
|
1497
|
-
}, [
|
|
1498
|
-
context.viewport,
|
|
1499
|
-
isHorizontal,
|
|
1500
|
-
send,
|
|
1501
|
-
debounceScrollEnd
|
|
1502
|
-
]);
|
|
1503
|
-
return /* @__PURE__ */ jsx(Presence, {
|
|
1504
|
-
present: forceMount || state !== "hidden",
|
|
1505
|
-
children: /* @__PURE__ */ jsx(ScrollAreaScrollbarVisible, {
|
|
1506
|
-
"data-state": state === "hidden" ? "hidden" : "visible",
|
|
1507
|
-
...scrollbarProps,
|
|
1508
|
-
ref: forwardedRef,
|
|
1509
|
-
onPointerEnter: composeEventHandlers(props.onPointerEnter, () => send("POINTER_ENTER")),
|
|
1510
|
-
onPointerLeave: composeEventHandlers(props.onPointerLeave, () => send("POINTER_LEAVE"))
|
|
1511
|
-
})
|
|
1512
|
-
});
|
|
1513
|
-
});
|
|
1514
|
-
var ScrollAreaScrollbarAuto = React$1.forwardRef((props, forwardedRef) => {
|
|
1515
|
-
const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
|
|
1516
|
-
const { forceMount, ...scrollbarProps } = props;
|
|
1517
|
-
const [visible, setVisible] = React$1.useState(false);
|
|
1518
|
-
const isHorizontal = props.orientation === "horizontal";
|
|
1519
|
-
const handleResize = useDebounceCallback(() => {
|
|
1520
|
-
if (context.viewport) {
|
|
1521
|
-
const isOverflowX = context.viewport.offsetWidth < context.viewport.scrollWidth;
|
|
1522
|
-
const isOverflowY = context.viewport.offsetHeight < context.viewport.scrollHeight;
|
|
1523
|
-
setVisible(isHorizontal ? isOverflowX : isOverflowY);
|
|
1524
|
-
}
|
|
1525
|
-
}, 10);
|
|
1526
|
-
useResizeObserver(context.viewport, handleResize);
|
|
1527
|
-
useResizeObserver(context.content, handleResize);
|
|
1528
|
-
return /* @__PURE__ */ jsx(Presence, {
|
|
1529
|
-
present: forceMount || visible,
|
|
1530
|
-
children: /* @__PURE__ */ jsx(ScrollAreaScrollbarVisible, {
|
|
1531
|
-
"data-state": visible ? "visible" : "hidden",
|
|
1532
|
-
...scrollbarProps,
|
|
1533
|
-
ref: forwardedRef
|
|
1534
|
-
})
|
|
1535
|
-
});
|
|
1536
|
-
});
|
|
1537
|
-
var ScrollAreaScrollbarVisible = React$1.forwardRef((props, forwardedRef) => {
|
|
1538
|
-
const { orientation = "vertical", ...scrollbarProps } = props;
|
|
1539
|
-
const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
|
|
1540
|
-
const thumbRef = React$1.useRef(null);
|
|
1541
|
-
const pointerOffsetRef = React$1.useRef(0);
|
|
1542
|
-
const [sizes, setSizes] = React$1.useState({
|
|
1543
|
-
content: 0,
|
|
1544
|
-
viewport: 0,
|
|
1545
|
-
scrollbar: {
|
|
1546
|
-
size: 0,
|
|
1547
|
-
paddingStart: 0,
|
|
1548
|
-
paddingEnd: 0
|
|
1549
|
-
}
|
|
1550
|
-
});
|
|
1551
|
-
const thumbRatio = getThumbRatio(sizes.viewport, sizes.content);
|
|
1552
|
-
const commonProps = {
|
|
1553
|
-
...scrollbarProps,
|
|
1554
|
-
sizes,
|
|
1555
|
-
onSizesChange: setSizes,
|
|
1556
|
-
hasThumb: Boolean(thumbRatio > 0 && thumbRatio < 1),
|
|
1557
|
-
onThumbChange: (thumb) => thumbRef.current = thumb,
|
|
1558
|
-
onThumbPointerUp: () => pointerOffsetRef.current = 0,
|
|
1559
|
-
onThumbPointerDown: (pointerPos) => pointerOffsetRef.current = pointerPos
|
|
1560
|
-
};
|
|
1561
|
-
function getScrollPosition(pointerPos, dir) {
|
|
1562
|
-
return getScrollPositionFromPointer(pointerPos, pointerOffsetRef.current, sizes, dir);
|
|
1563
|
-
}
|
|
1564
|
-
if (orientation === "horizontal") return /* @__PURE__ */ jsx(ScrollAreaScrollbarX, {
|
|
1565
|
-
...commonProps,
|
|
1566
|
-
ref: forwardedRef,
|
|
1567
|
-
onThumbPositionChange: () => {
|
|
1568
|
-
if (context.viewport && thumbRef.current) {
|
|
1569
|
-
const scrollPos = context.viewport.scrollLeft;
|
|
1570
|
-
const offset = getThumbOffsetFromScroll(scrollPos, sizes, context.dir);
|
|
1571
|
-
thumbRef.current.style.transform = `translate3d(${offset}px, 0, 0)`;
|
|
1572
|
-
}
|
|
1573
|
-
},
|
|
1574
|
-
onWheelScroll: (scrollPos) => {
|
|
1575
|
-
if (context.viewport) context.viewport.scrollLeft = scrollPos;
|
|
1576
|
-
},
|
|
1577
|
-
onDragScroll: (pointerPos) => {
|
|
1578
|
-
if (context.viewport) context.viewport.scrollLeft = getScrollPosition(pointerPos, context.dir);
|
|
1579
|
-
}
|
|
1580
|
-
});
|
|
1581
|
-
if (orientation === "vertical") return /* @__PURE__ */ jsx(ScrollAreaScrollbarY, {
|
|
1582
|
-
...commonProps,
|
|
1583
|
-
ref: forwardedRef,
|
|
1584
|
-
onThumbPositionChange: () => {
|
|
1585
|
-
if (context.viewport && thumbRef.current) {
|
|
1586
|
-
const scrollPos = context.viewport.scrollTop;
|
|
1587
|
-
const offset = getThumbOffsetFromScroll(scrollPos, sizes);
|
|
1588
|
-
thumbRef.current.style.transform = `translate3d(0, ${offset}px, 0)`;
|
|
1589
|
-
}
|
|
1590
|
-
},
|
|
1591
|
-
onWheelScroll: (scrollPos) => {
|
|
1592
|
-
if (context.viewport) context.viewport.scrollTop = scrollPos;
|
|
1593
|
-
},
|
|
1594
|
-
onDragScroll: (pointerPos) => {
|
|
1595
|
-
if (context.viewport) context.viewport.scrollTop = getScrollPosition(pointerPos);
|
|
1596
|
-
}
|
|
1597
|
-
});
|
|
1598
|
-
return null;
|
|
1599
|
-
});
|
|
1600
|
-
var ScrollAreaScrollbarX = React$1.forwardRef((props, forwardedRef) => {
|
|
1601
|
-
const { sizes, onSizesChange, ...scrollbarProps } = props;
|
|
1602
|
-
const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
|
|
1603
|
-
const [computedStyle, setComputedStyle] = React$1.useState();
|
|
1604
|
-
const ref = React$1.useRef(null);
|
|
1605
|
-
const composeRefs = useComposedRefs(forwardedRef, ref, context.onScrollbarXChange);
|
|
1606
|
-
React$1.useEffect(() => {
|
|
1607
|
-
if (ref.current) setComputedStyle(getComputedStyle(ref.current));
|
|
1608
|
-
}, [ref]);
|
|
1609
|
-
return /* @__PURE__ */ jsx(ScrollAreaScrollbarImpl, {
|
|
1610
|
-
"data-orientation": "horizontal",
|
|
1611
|
-
...scrollbarProps,
|
|
1612
|
-
ref: composeRefs,
|
|
1613
|
-
sizes,
|
|
1614
|
-
style: {
|
|
1615
|
-
bottom: 0,
|
|
1616
|
-
left: context.dir === "rtl" ? "var(--radix-scroll-area-corner-width)" : 0,
|
|
1617
|
-
right: context.dir === "ltr" ? "var(--radix-scroll-area-corner-width)" : 0,
|
|
1618
|
-
["--radix-scroll-area-thumb-width"]: getThumbSize(sizes) + "px",
|
|
1619
|
-
...props.style
|
|
1620
|
-
},
|
|
1621
|
-
onThumbPointerDown: (pointerPos) => props.onThumbPointerDown(pointerPos.x),
|
|
1622
|
-
onDragScroll: (pointerPos) => props.onDragScroll(pointerPos.x),
|
|
1623
|
-
onWheelScroll: (event, maxScrollPos) => {
|
|
1624
|
-
if (context.viewport) {
|
|
1625
|
-
const scrollPos = context.viewport.scrollLeft + event.deltaX;
|
|
1626
|
-
props.onWheelScroll(scrollPos);
|
|
1627
|
-
if (isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos)) event.preventDefault();
|
|
1628
|
-
}
|
|
1629
|
-
},
|
|
1630
|
-
onResize: () => {
|
|
1631
|
-
if (ref.current && context.viewport && computedStyle) onSizesChange({
|
|
1632
|
-
content: context.viewport.scrollWidth,
|
|
1633
|
-
viewport: context.viewport.offsetWidth,
|
|
1634
|
-
scrollbar: {
|
|
1635
|
-
size: ref.current.clientWidth,
|
|
1636
|
-
paddingStart: toInt(computedStyle.paddingLeft),
|
|
1637
|
-
paddingEnd: toInt(computedStyle.paddingRight)
|
|
1638
|
-
}
|
|
1639
|
-
});
|
|
1640
|
-
}
|
|
1641
|
-
});
|
|
1642
|
-
});
|
|
1643
|
-
var ScrollAreaScrollbarY = React$1.forwardRef((props, forwardedRef) => {
|
|
1644
|
-
const { sizes, onSizesChange, ...scrollbarProps } = props;
|
|
1645
|
-
const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
|
|
1646
|
-
const [computedStyle, setComputedStyle] = React$1.useState();
|
|
1647
|
-
const ref = React$1.useRef(null);
|
|
1648
|
-
const composeRefs = useComposedRefs(forwardedRef, ref, context.onScrollbarYChange);
|
|
1649
|
-
React$1.useEffect(() => {
|
|
1650
|
-
if (ref.current) setComputedStyle(getComputedStyle(ref.current));
|
|
1651
|
-
}, [ref]);
|
|
1652
|
-
return /* @__PURE__ */ jsx(ScrollAreaScrollbarImpl, {
|
|
1653
|
-
"data-orientation": "vertical",
|
|
1654
|
-
...scrollbarProps,
|
|
1655
|
-
ref: composeRefs,
|
|
1656
|
-
sizes,
|
|
1657
|
-
style: {
|
|
1658
|
-
top: 0,
|
|
1659
|
-
right: context.dir === "ltr" ? 0 : void 0,
|
|
1660
|
-
left: context.dir === "rtl" ? 0 : void 0,
|
|
1661
|
-
bottom: "var(--radix-scroll-area-corner-height)",
|
|
1662
|
-
["--radix-scroll-area-thumb-height"]: getThumbSize(sizes) + "px",
|
|
1663
|
-
...props.style
|
|
1664
|
-
},
|
|
1665
|
-
onThumbPointerDown: (pointerPos) => props.onThumbPointerDown(pointerPos.y),
|
|
1666
|
-
onDragScroll: (pointerPos) => props.onDragScroll(pointerPos.y),
|
|
1667
|
-
onWheelScroll: (event, maxScrollPos) => {
|
|
1668
|
-
if (context.viewport) {
|
|
1669
|
-
const scrollPos = context.viewport.scrollTop + event.deltaY;
|
|
1670
|
-
props.onWheelScroll(scrollPos);
|
|
1671
|
-
if (isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos)) event.preventDefault();
|
|
1672
|
-
}
|
|
1673
|
-
},
|
|
1674
|
-
onResize: () => {
|
|
1675
|
-
if (ref.current && context.viewport && computedStyle) onSizesChange({
|
|
1676
|
-
content: context.viewport.scrollHeight,
|
|
1677
|
-
viewport: context.viewport.offsetHeight,
|
|
1678
|
-
scrollbar: {
|
|
1679
|
-
size: ref.current.clientHeight,
|
|
1680
|
-
paddingStart: toInt(computedStyle.paddingTop),
|
|
1681
|
-
paddingEnd: toInt(computedStyle.paddingBottom)
|
|
1682
|
-
}
|
|
1683
|
-
});
|
|
1684
|
-
}
|
|
1685
|
-
});
|
|
1686
|
-
});
|
|
1687
|
-
var [ScrollbarProvider, useScrollbarContext] = createScrollAreaContext(SCROLLBAR_NAME);
|
|
1688
|
-
var ScrollAreaScrollbarImpl = React$1.forwardRef((props, forwardedRef) => {
|
|
1689
|
-
const { __scopeScrollArea, sizes, hasThumb, onThumbChange, onThumbPointerUp, onThumbPointerDown, onThumbPositionChange, onDragScroll, onWheelScroll, onResize, ...scrollbarProps } = props;
|
|
1690
|
-
const context = useScrollAreaContext(SCROLLBAR_NAME, __scopeScrollArea);
|
|
1691
|
-
const [scrollbar, setScrollbar] = React$1.useState(null);
|
|
1692
|
-
const composeRefs = useComposedRefs(forwardedRef, (node) => setScrollbar(node));
|
|
1693
|
-
const rectRef = React$1.useRef(null);
|
|
1694
|
-
const prevWebkitUserSelectRef = React$1.useRef("");
|
|
1695
|
-
const viewport = context.viewport;
|
|
1696
|
-
const maxScrollPos = sizes.content - sizes.viewport;
|
|
1697
|
-
const handleWheelScroll = useCallbackRef(onWheelScroll);
|
|
1698
|
-
const handleThumbPositionChange = useCallbackRef(onThumbPositionChange);
|
|
1699
|
-
const handleResize = useDebounceCallback(onResize, 10);
|
|
1700
|
-
function handleDragScroll(event) {
|
|
1701
|
-
if (rectRef.current) onDragScroll({
|
|
1702
|
-
x: event.clientX - rectRef.current.left,
|
|
1703
|
-
y: event.clientY - rectRef.current.top
|
|
1704
|
-
});
|
|
1705
|
-
}
|
|
1706
|
-
React$1.useEffect(() => {
|
|
1707
|
-
const handleWheel = (event) => {
|
|
1708
|
-
const element = event.target;
|
|
1709
|
-
if (scrollbar?.contains(element)) handleWheelScroll(event, maxScrollPos);
|
|
1710
|
-
};
|
|
1711
|
-
document.addEventListener("wheel", handleWheel, { passive: false });
|
|
1712
|
-
return () => document.removeEventListener("wheel", handleWheel, { passive: false });
|
|
1713
|
-
}, [
|
|
1714
|
-
viewport,
|
|
1715
|
-
scrollbar,
|
|
1716
|
-
maxScrollPos,
|
|
1717
|
-
handleWheelScroll
|
|
1718
|
-
]);
|
|
1719
|
-
React$1.useEffect(handleThumbPositionChange, [sizes, handleThumbPositionChange]);
|
|
1720
|
-
useResizeObserver(scrollbar, handleResize);
|
|
1721
|
-
useResizeObserver(context.content, handleResize);
|
|
1722
|
-
return /* @__PURE__ */ jsx(ScrollbarProvider, {
|
|
1723
|
-
scope: __scopeScrollArea,
|
|
1724
|
-
scrollbar,
|
|
1725
|
-
hasThumb,
|
|
1726
|
-
onThumbChange: useCallbackRef(onThumbChange),
|
|
1727
|
-
onThumbPointerUp: useCallbackRef(onThumbPointerUp),
|
|
1728
|
-
onThumbPositionChange: handleThumbPositionChange,
|
|
1729
|
-
onThumbPointerDown: useCallbackRef(onThumbPointerDown),
|
|
1730
|
-
children: /* @__PURE__ */ jsx(Primitive.div, {
|
|
1731
|
-
...scrollbarProps,
|
|
1732
|
-
ref: composeRefs,
|
|
1733
|
-
style: {
|
|
1734
|
-
position: "absolute",
|
|
1735
|
-
...scrollbarProps.style
|
|
1736
|
-
},
|
|
1737
|
-
onPointerDown: composeEventHandlers(props.onPointerDown, (event) => {
|
|
1738
|
-
if (event.button === 0) {
|
|
1739
|
-
event.target.setPointerCapture(event.pointerId);
|
|
1740
|
-
rectRef.current = scrollbar.getBoundingClientRect();
|
|
1741
|
-
prevWebkitUserSelectRef.current = document.body.style.webkitUserSelect;
|
|
1742
|
-
document.body.style.webkitUserSelect = "none";
|
|
1743
|
-
if (context.viewport) context.viewport.style.scrollBehavior = "auto";
|
|
1744
|
-
handleDragScroll(event);
|
|
1745
|
-
}
|
|
1746
|
-
}),
|
|
1747
|
-
onPointerMove: composeEventHandlers(props.onPointerMove, handleDragScroll),
|
|
1748
|
-
onPointerUp: composeEventHandlers(props.onPointerUp, (event) => {
|
|
1749
|
-
const element = event.target;
|
|
1750
|
-
if (element.hasPointerCapture(event.pointerId)) element.releasePointerCapture(event.pointerId);
|
|
1751
|
-
document.body.style.webkitUserSelect = prevWebkitUserSelectRef.current;
|
|
1752
|
-
if (context.viewport) context.viewport.style.scrollBehavior = "";
|
|
1753
|
-
rectRef.current = null;
|
|
1754
|
-
})
|
|
1755
|
-
})
|
|
1756
|
-
});
|
|
1757
|
-
});
|
|
1758
|
-
var THUMB_NAME = "ScrollAreaThumb";
|
|
1759
|
-
var ScrollAreaThumb = React$1.forwardRef((props, forwardedRef) => {
|
|
1760
|
-
const { forceMount, ...thumbProps } = props;
|
|
1761
|
-
const scrollbarContext = useScrollbarContext(THUMB_NAME, props.__scopeScrollArea);
|
|
1762
|
-
return /* @__PURE__ */ jsx(Presence, {
|
|
1763
|
-
present: forceMount || scrollbarContext.hasThumb,
|
|
1764
|
-
children: /* @__PURE__ */ jsx(ScrollAreaThumbImpl, {
|
|
1765
|
-
ref: forwardedRef,
|
|
1766
|
-
...thumbProps
|
|
1767
|
-
})
|
|
1768
|
-
});
|
|
1769
|
-
});
|
|
1770
|
-
var ScrollAreaThumbImpl = React$1.forwardRef((props, forwardedRef) => {
|
|
1771
|
-
const { __scopeScrollArea, style, ...thumbProps } = props;
|
|
1772
|
-
const scrollAreaContext = useScrollAreaContext(THUMB_NAME, __scopeScrollArea);
|
|
1773
|
-
const scrollbarContext = useScrollbarContext(THUMB_NAME, __scopeScrollArea);
|
|
1774
|
-
const { onThumbPositionChange } = scrollbarContext;
|
|
1775
|
-
const composedRef = useComposedRefs(forwardedRef, (node) => scrollbarContext.onThumbChange(node));
|
|
1776
|
-
const removeUnlinkedScrollListenerRef = React$1.useRef(void 0);
|
|
1777
|
-
const debounceScrollEnd = useDebounceCallback(() => {
|
|
1778
|
-
if (removeUnlinkedScrollListenerRef.current) {
|
|
1779
|
-
removeUnlinkedScrollListenerRef.current();
|
|
1780
|
-
removeUnlinkedScrollListenerRef.current = void 0;
|
|
1781
|
-
}
|
|
1782
|
-
}, 100);
|
|
1783
|
-
React$1.useEffect(() => {
|
|
1784
|
-
const viewport = scrollAreaContext.viewport;
|
|
1785
|
-
if (viewport) {
|
|
1786
|
-
const handleScroll = () => {
|
|
1787
|
-
debounceScrollEnd();
|
|
1788
|
-
if (!removeUnlinkedScrollListenerRef.current) {
|
|
1789
|
-
removeUnlinkedScrollListenerRef.current = addUnlinkedScrollListener(viewport, onThumbPositionChange);
|
|
1790
|
-
onThumbPositionChange();
|
|
1791
|
-
}
|
|
1792
|
-
};
|
|
1793
|
-
onThumbPositionChange();
|
|
1794
|
-
viewport.addEventListener("scroll", handleScroll);
|
|
1795
|
-
return () => viewport.removeEventListener("scroll", handleScroll);
|
|
1796
|
-
}
|
|
1797
|
-
}, [
|
|
1798
|
-
scrollAreaContext.viewport,
|
|
1799
|
-
debounceScrollEnd,
|
|
1800
|
-
onThumbPositionChange
|
|
1801
|
-
]);
|
|
1802
|
-
return /* @__PURE__ */ jsx(Primitive.div, {
|
|
1803
|
-
"data-state": scrollbarContext.hasThumb ? "visible" : "hidden",
|
|
1804
|
-
...thumbProps,
|
|
1805
|
-
ref: composedRef,
|
|
1806
|
-
style: {
|
|
1807
|
-
width: "var(--radix-scroll-area-thumb-width)",
|
|
1808
|
-
height: "var(--radix-scroll-area-thumb-height)",
|
|
1809
|
-
...style
|
|
1810
|
-
},
|
|
1811
|
-
onPointerDownCapture: composeEventHandlers(props.onPointerDownCapture, (event) => {
|
|
1812
|
-
const thumbRect = event.target.getBoundingClientRect();
|
|
1813
|
-
const x = event.clientX - thumbRect.left;
|
|
1814
|
-
const y = event.clientY - thumbRect.top;
|
|
1815
|
-
scrollbarContext.onThumbPointerDown({
|
|
1816
|
-
x,
|
|
1817
|
-
y
|
|
1818
|
-
});
|
|
1819
|
-
}),
|
|
1820
|
-
onPointerUp: composeEventHandlers(props.onPointerUp, scrollbarContext.onThumbPointerUp)
|
|
1821
|
-
});
|
|
1822
|
-
});
|
|
1823
|
-
ScrollAreaThumb.displayName = THUMB_NAME;
|
|
1824
|
-
var CORNER_NAME = "ScrollAreaCorner";
|
|
1825
|
-
var ScrollAreaCorner = React$1.forwardRef((props, forwardedRef) => {
|
|
1826
|
-
const context = useScrollAreaContext(CORNER_NAME, props.__scopeScrollArea);
|
|
1827
|
-
const hasBothScrollbarsVisible = Boolean(context.scrollbarX && context.scrollbarY);
|
|
1828
|
-
return context.type !== "scroll" && hasBothScrollbarsVisible ? /* @__PURE__ */ jsx(ScrollAreaCornerImpl, {
|
|
1829
|
-
...props,
|
|
1830
|
-
ref: forwardedRef
|
|
1831
|
-
}) : null;
|
|
1832
|
-
});
|
|
1833
|
-
ScrollAreaCorner.displayName = CORNER_NAME;
|
|
1834
|
-
var ScrollAreaCornerImpl = React$1.forwardRef((props, forwardedRef) => {
|
|
1835
|
-
const { __scopeScrollArea, ...cornerProps } = props;
|
|
1836
|
-
const context = useScrollAreaContext(CORNER_NAME, __scopeScrollArea);
|
|
1837
|
-
const [width, setWidth] = React$1.useState(0);
|
|
1838
|
-
const [height, setHeight] = React$1.useState(0);
|
|
1839
|
-
const hasSize = Boolean(width && height);
|
|
1840
|
-
useResizeObserver(context.scrollbarX, () => {
|
|
1841
|
-
const height2 = context.scrollbarX?.offsetHeight || 0;
|
|
1842
|
-
context.onCornerHeightChange(height2);
|
|
1843
|
-
setHeight(height2);
|
|
1844
|
-
});
|
|
1845
|
-
useResizeObserver(context.scrollbarY, () => {
|
|
1846
|
-
const width2 = context.scrollbarY?.offsetWidth || 0;
|
|
1847
|
-
context.onCornerWidthChange(width2);
|
|
1848
|
-
setWidth(width2);
|
|
1849
|
-
});
|
|
1850
|
-
return hasSize ? /* @__PURE__ */ jsx(Primitive.div, {
|
|
1851
|
-
...cornerProps,
|
|
1852
|
-
ref: forwardedRef,
|
|
1853
|
-
style: {
|
|
1854
|
-
width,
|
|
1855
|
-
height,
|
|
1856
|
-
position: "absolute",
|
|
1857
|
-
right: context.dir === "ltr" ? 0 : void 0,
|
|
1858
|
-
left: context.dir === "rtl" ? 0 : void 0,
|
|
1859
|
-
bottom: 0,
|
|
1860
|
-
...props.style
|
|
1861
|
-
}
|
|
1862
|
-
}) : null;
|
|
1863
|
-
});
|
|
1864
|
-
function toInt(value) {
|
|
1865
|
-
return value ? parseInt(value, 10) : 0;
|
|
1866
|
-
}
|
|
1867
|
-
function getThumbRatio(viewportSize, contentSize) {
|
|
1868
|
-
const ratio = viewportSize / contentSize;
|
|
1869
|
-
return isNaN(ratio) ? 0 : ratio;
|
|
1870
|
-
}
|
|
1871
|
-
function getThumbSize(sizes) {
|
|
1872
|
-
const ratio = getThumbRatio(sizes.viewport, sizes.content);
|
|
1873
|
-
const scrollbarPadding = sizes.scrollbar.paddingStart + sizes.scrollbar.paddingEnd;
|
|
1874
|
-
const thumbSize = (sizes.scrollbar.size - scrollbarPadding) * ratio;
|
|
1875
|
-
return Math.max(thumbSize, 18);
|
|
1876
|
-
}
|
|
1877
|
-
function getScrollPositionFromPointer(pointerPos, pointerOffset, sizes, dir = "ltr") {
|
|
1878
|
-
const thumbSizePx = getThumbSize(sizes);
|
|
1879
|
-
const thumbCenter = thumbSizePx / 2;
|
|
1880
|
-
const offset = pointerOffset || thumbCenter;
|
|
1881
|
-
const thumbOffsetFromEnd = thumbSizePx - offset;
|
|
1882
|
-
const minPointerPos = sizes.scrollbar.paddingStart + offset;
|
|
1883
|
-
const maxPointerPos = sizes.scrollbar.size - sizes.scrollbar.paddingEnd - thumbOffsetFromEnd;
|
|
1884
|
-
const maxScrollPos = sizes.content - sizes.viewport;
|
|
1885
|
-
const scrollRange = dir === "ltr" ? [0, maxScrollPos] : [maxScrollPos * -1, 0];
|
|
1886
|
-
return linearScale([minPointerPos, maxPointerPos], scrollRange)(pointerPos);
|
|
1887
|
-
}
|
|
1888
|
-
function getThumbOffsetFromScroll(scrollPos, sizes, dir = "ltr") {
|
|
1889
|
-
const thumbSizePx = getThumbSize(sizes);
|
|
1890
|
-
const scrollbarPadding = sizes.scrollbar.paddingStart + sizes.scrollbar.paddingEnd;
|
|
1891
|
-
const scrollbar = sizes.scrollbar.size - scrollbarPadding;
|
|
1892
|
-
const maxScrollPos = sizes.content - sizes.viewport;
|
|
1893
|
-
const maxThumbPos = scrollbar - thumbSizePx;
|
|
1894
|
-
const scrollWithoutMomentum = clamp(scrollPos, dir === "ltr" ? [0, maxScrollPos] : [maxScrollPos * -1, 0]);
|
|
1895
|
-
return linearScale([0, maxScrollPos], [0, maxThumbPos])(scrollWithoutMomentum);
|
|
1896
|
-
}
|
|
1897
|
-
function linearScale(input, output) {
|
|
1898
|
-
return (value) => {
|
|
1899
|
-
if (input[0] === input[1] || output[0] === output[1]) return output[0];
|
|
1900
|
-
const ratio = (output[1] - output[0]) / (input[1] - input[0]);
|
|
1901
|
-
return output[0] + ratio * (value - input[0]);
|
|
1902
|
-
};
|
|
1903
|
-
}
|
|
1904
|
-
function isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos) {
|
|
1905
|
-
return scrollPos > 0 && scrollPos < maxScrollPos;
|
|
1906
|
-
}
|
|
1907
|
-
var addUnlinkedScrollListener = (node, handler = () => {}) => {
|
|
1908
|
-
let prevPosition = {
|
|
1909
|
-
left: node.scrollLeft,
|
|
1910
|
-
top: node.scrollTop
|
|
1911
|
-
};
|
|
1912
|
-
let rAF = 0;
|
|
1913
|
-
(function loop() {
|
|
1914
|
-
const position = {
|
|
1915
|
-
left: node.scrollLeft,
|
|
1916
|
-
top: node.scrollTop
|
|
1917
|
-
};
|
|
1918
|
-
const isHorizontalScroll = prevPosition.left !== position.left;
|
|
1919
|
-
const isVerticalScroll = prevPosition.top !== position.top;
|
|
1920
|
-
if (isHorizontalScroll || isVerticalScroll) handler();
|
|
1921
|
-
prevPosition = position;
|
|
1922
|
-
rAF = window.requestAnimationFrame(loop);
|
|
1923
|
-
})();
|
|
1924
|
-
return () => window.cancelAnimationFrame(rAF);
|
|
1925
|
-
};
|
|
1926
|
-
function useDebounceCallback(callback, delay) {
|
|
1927
|
-
const handleCallback = useCallbackRef(callback);
|
|
1928
|
-
const debounceTimerRef = React$1.useRef(0);
|
|
1929
|
-
React$1.useEffect(() => () => window.clearTimeout(debounceTimerRef.current), []);
|
|
1930
|
-
return React$1.useCallback(() => {
|
|
1931
|
-
window.clearTimeout(debounceTimerRef.current);
|
|
1932
|
-
debounceTimerRef.current = window.setTimeout(handleCallback, delay);
|
|
1933
|
-
}, [handleCallback, delay]);
|
|
1934
|
-
}
|
|
1935
|
-
function useResizeObserver(element, onResize) {
|
|
1936
|
-
const handleResize = useCallbackRef(onResize);
|
|
1937
|
-
useLayoutEffect2(() => {
|
|
1938
|
-
let rAF = 0;
|
|
1939
|
-
if (element) {
|
|
1940
|
-
const resizeObserver = new ResizeObserver(() => {
|
|
1941
|
-
cancelAnimationFrame(rAF);
|
|
1942
|
-
rAF = window.requestAnimationFrame(handleResize);
|
|
1943
|
-
});
|
|
1944
|
-
resizeObserver.observe(element);
|
|
1945
|
-
return () => {
|
|
1946
|
-
window.cancelAnimationFrame(rAF);
|
|
1947
|
-
resizeObserver.unobserve(element);
|
|
1948
|
-
};
|
|
1949
|
-
}
|
|
1950
|
-
}, [element, handleResize]);
|
|
1951
|
-
}
|
|
1952
|
-
var Root = ScrollArea$1;
|
|
1953
|
-
var Viewport = ScrollAreaViewport;
|
|
1954
|
-
var Corner = ScrollAreaCorner;
|
|
1955
869
|
function ScrollArea({ className, children, ...props }) {
|
|
1956
|
-
return /* @__PURE__ */ jsxs(Root, {
|
|
870
|
+
return /* @__PURE__ */ jsxs(ScrollAreaPrimitive.Root, {
|
|
1957
871
|
"data-slot": "scroll-area",
|
|
1958
872
|
className: cn("relative", className),
|
|
1959
873
|
...props,
|
|
1960
874
|
children: [
|
|
1961
|
-
/* @__PURE__ */ jsx(Viewport, {
|
|
875
|
+
/* @__PURE__ */ jsx(ScrollAreaPrimitive.Viewport, {
|
|
1962
876
|
"data-slot": "scroll-area-viewport",
|
|
1963
877
|
className: "focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",
|
|
1964
878
|
children
|
|
1965
879
|
}),
|
|
1966
880
|
/* @__PURE__ */ jsx(ScrollBar, {}),
|
|
1967
|
-
/* @__PURE__ */ jsx(Corner, {})
|
|
881
|
+
/* @__PURE__ */ jsx(ScrollAreaPrimitive.Corner, {})
|
|
1968
882
|
]
|
|
1969
883
|
});
|
|
1970
884
|
}
|
|
1971
885
|
function ScrollBar({ className, orientation = "vertical", ...props }) {
|
|
1972
|
-
return /* @__PURE__ */ jsx(ScrollAreaScrollbar, {
|
|
886
|
+
return /* @__PURE__ */ jsx(ScrollAreaPrimitive.ScrollAreaScrollbar, {
|
|
1973
887
|
"data-slot": "scroll-area-scrollbar",
|
|
1974
888
|
orientation,
|
|
1975
889
|
className: cn("flex touch-none p-px transition-colors select-none", orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent", orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent", className),
|
|
1976
890
|
...props,
|
|
1977
|
-
children: /* @__PURE__ */ jsx(ScrollAreaThumb, {
|
|
891
|
+
children: /* @__PURE__ */ jsx(ScrollAreaPrimitive.ScrollAreaThumb, {
|
|
1978
892
|
"data-slot": "scroll-area-thumb",
|
|
1979
893
|
className: "bg-border relative flex-1 rounded-full"
|
|
1980
894
|
})
|
|
@@ -2400,7 +1314,7 @@ SplitLayoutMainFooter.displayName = "SplitLayoutGlass.MainFooter";
|
|
|
2400
1314
|
var SplitLayoutTrigger = forwardRef(({ asChild = false, showOnDesktop = false, variant = "menu", className, children, ...props }, ref) => {
|
|
2401
1315
|
const { toggle, isOpen, isMobileOpen, isMobile, breakpoint } = useSplitLayout();
|
|
2402
1316
|
const currentOpen = isMobile ? isMobileOpen : isOpen;
|
|
2403
|
-
const Icon
|
|
1317
|
+
const Icon = variant === "menu" ? currentOpen ? X : Menu : currentOpen ? PanelLeftClose : PanelLeftOpen;
|
|
2404
1318
|
const visibilityClass = showOnDesktop ? "" : `${breakpoint}:hidden`;
|
|
2405
1319
|
if (asChild) return /* @__PURE__ */ jsx(Slot, {
|
|
2406
1320
|
ref,
|
|
@@ -2422,7 +1336,7 @@ var SplitLayoutTrigger = forwardRef(({ asChild = false, showOnDesktop = false, v
|
|
|
2422
1336
|
"data-state": currentOpen ? "open" : "closed",
|
|
2423
1337
|
className: cn(visibilityClass, className),
|
|
2424
1338
|
...props,
|
|
2425
|
-
children: children ?? /* @__PURE__ */ jsx(Icon
|
|
1339
|
+
children: children ?? /* @__PURE__ */ jsx(Icon, { className: "h-5 w-5" })
|
|
2426
1340
|
});
|
|
2427
1341
|
});
|
|
2428
1342
|
SplitLayoutTrigger.displayName = "SplitLayoutGlass.Trigger";
|
|
@@ -2439,14 +1353,14 @@ const SplitLayoutGlass = {
|
|
|
2439
1353
|
MainFooter: SplitLayoutMainFooter,
|
|
2440
1354
|
Trigger: SplitLayoutTrigger
|
|
2441
1355
|
};
|
|
2442
|
-
var ChartContext = React
|
|
1356
|
+
var ChartContext = React.createContext(null);
|
|
2443
1357
|
function useChart() {
|
|
2444
|
-
const context = React
|
|
1358
|
+
const context = React.useContext(ChartContext);
|
|
2445
1359
|
if (!context) throw new Error("useChart must be used within a <ChartContainer />");
|
|
2446
1360
|
return context;
|
|
2447
1361
|
}
|
|
2448
|
-
var ChartContainer = React
|
|
2449
|
-
const uniqueId = React
|
|
1362
|
+
var ChartContainer = React.forwardRef(({ id, className, children, config, ...props }, ref) => {
|
|
1363
|
+
const uniqueId = React.useId();
|
|
2450
1364
|
const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
|
|
2451
1365
|
return /* @__PURE__ */ jsx(ChartContext.Provider, {
|
|
2452
1366
|
value: { config },
|
|
@@ -2458,7 +1372,7 @@ var ChartContainer = React$1.forwardRef(({ id, className, children, config, ...p
|
|
|
2458
1372
|
children: [/* @__PURE__ */ jsx(ChartStyle, {
|
|
2459
1373
|
id: chartId,
|
|
2460
1374
|
config
|
|
2461
|
-
}), /* @__PURE__ */ jsx(ResponsiveContainer, { children })]
|
|
1375
|
+
}), /* @__PURE__ */ jsx(RechartsPrimitive.ResponsiveContainer, { children })]
|
|
2462
1376
|
})
|
|
2463
1377
|
});
|
|
2464
1378
|
});
|
|
@@ -2483,10 +1397,10 @@ ${colorConfig.map(([key, itemConfig]) => {
|
|
|
2483
1397
|
}
|
|
2484
1398
|
` } });
|
|
2485
1399
|
};
|
|
2486
|
-
var ChartTooltip = Tooltip;
|
|
2487
|
-
var ChartTooltipContent = React
|
|
1400
|
+
var ChartTooltip = RechartsPrimitive.Tooltip;
|
|
1401
|
+
var ChartTooltipContent = React.forwardRef(({ active, payload, className, indicator = "dot", hideLabel = false, hideIndicator = false, label, labelFormatter, labelClassName, nameKey, labelKey, valueFormatter }, ref) => {
|
|
2488
1402
|
const { config } = useChart();
|
|
2489
|
-
const tooltipLabel = React
|
|
1403
|
+
const tooltipLabel = React.useMemo(() => {
|
|
2490
1404
|
if (hideLabel || !payload?.length) return null;
|
|
2491
1405
|
const [item] = payload;
|
|
2492
1406
|
const itemConfig = getPayloadConfigFromPayload(config, item, `${labelKey || item?.dataKey || item?.name || "value"}`);
|
|
@@ -2551,8 +1465,8 @@ var ChartTooltipContent = React$1.forwardRef(({ active, payload, className, indi
|
|
|
2551
1465
|
});
|
|
2552
1466
|
});
|
|
2553
1467
|
ChartTooltipContent.displayName = "ChartTooltipContent";
|
|
2554
|
-
var ChartLegend = Legend;
|
|
2555
|
-
var ChartLegendContent = React
|
|
1468
|
+
var ChartLegend = RechartsPrimitive.Legend;
|
|
1469
|
+
var ChartLegendContent = React.forwardRef(({ className, hideIcon = false, payload, verticalAlign = "bottom", nameKey }, ref) => {
|
|
2556
1470
|
const { config } = useChart();
|
|
2557
1471
|
if (!payload?.length) return null;
|
|
2558
1472
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -2635,6 +1549,6 @@ const buttonVariants = cva("inline-flex items-center justify-center gap-2 whites
|
|
|
2635
1549
|
size: "default"
|
|
2636
1550
|
}
|
|
2637
1551
|
});
|
|
2638
|
-
export { AICardGlass, AlertGlass, AlertGlassDescription, AlertGlassTitle, AvatarGlass, AvatarGlassFallback, AvatarGlassImage, AvatarGlassSimple, BadgeGlass, Bar, BarChart, BaseProgressGlass, ButtonGlass, CardGlass, CardGlassAction, CardGlassContent, CardGlassDescription, CardGlassFooter, CardGlassHeader, CardGlassRoot, CardGlassTitle, CareerStatsGlass, CareerStatsHeaderGlass, Cell, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, CheckboxGlass, CircularMetricGlass, CircularProgressGlass, ComboBoxGlass, ContributionMetricsGlass, DropdownGlass, DropdownMenuGlass, DropdownMenuGlassCheckboxItem, DropdownMenuGlassContent, DropdownMenuGlassGroup, DropdownMenuGlassItem, DropdownMenuGlassLabel, DropdownMenuGlassPortal, DropdownMenuGlassRadioGroup, DropdownMenuGlassRadioItem, DropdownMenuGlassSeparator, DropdownMenuGlassShortcut, DropdownMenuGlassSub, DropdownMenuGlassSubContent, DropdownMenuGlassSubTrigger, DropdownMenuGlassTrigger, ExpandableHeaderGlass, FlagAlertGlass, FlagsSectionGlass, FormFieldWrapper, GlassCard, HeaderBrandingGlass, HeaderNavGlass, IconButtonGlass, InputGlass, InsightCardGlass, InteractiveCard, LanguageBarGlass, MetricCardGlass, MetricsGridGlass, ModalGlass, NotificationGlass, PopoverGlass, PopoverGlassAnchor, PopoverGlassContent, PopoverGlassLegacy, PopoverGlassTrigger, ProfileAvatarGlass, ProfileHeaderGlass, ProgressGlass, ProjectsListGlass, RainbowProgressGlass, RepositoryCardGlass, RepositoryHeaderGlass, RepositoryMetadataGlass, ResponsiveContainer, SearchBoxGlass, SegmentedControlGlass, SidebarGlass, SkeletonGlass, SliderGlass, SortDropdownGlass, SparklineGlass, SplitLayoutAccordion, SplitLayoutGlass, StatItemGlass, StatusIndicatorGlass, StepperGlass, THEMES, THEME_CONFIG, TabsGlass, ThemeProvider, ThemeToggleGlass, ToggleGlass, TooltipGlass, TooltipGlassContent, TooltipGlassProvider, TooltipGlassSimple, TooltipGlassTrigger, TouchTarget, TrustScoreCardGlass, TrustScoreDisplayGlass, UserInfoGlass, UserStatsLineGlass, YearCardGlass, alertVariants, avatarSizes, badgeVariants, buttonGlassVariants, cardIntensity, cn, dropdownAlign, getNextTheme, getThemeConfig, inputVariants, insightCardVariants, insightVariantConfig, modalSizes, notificationVariants, progressSizes, alertVariants$1 as shadcnAlertVariants, badgeVariants$1 as shadcnBadgeVariants, buttonVariants as shadcnButtonVariants, skeletonVariants, sparklineBarVariants, sparklineContainerVariants, statusSizes, stepperConnectorVariants, stepperContentVariants, stepperDescriptionVariants, stepperIndicatorVariants, stepperLabelVariants, stepperListVariants, stepperRootVariants, stepperStepContainerVariants, toggleSizes, tooltipPositions, useChart, useFocus, useHover, useResponsive, useSidebar, useSplitLayout, useSplitLayoutOptional, useTheme, useWallpaperTint };
|
|
1552
|
+
export { AICardGlass, AlertGlass, AlertGlassDescription, AlertGlassTitle, AvatarGlass, AvatarGlassFallback, AvatarGlassImage, AvatarGlassSimple, BadgeGlass, Bar, BarChart, BaseProgressGlass, ButtonGlass, CardGlass, CardGlassAction, CardGlassContent, CardGlassDescription, CardGlassFooter, CardGlassHeader, CardGlassRoot, CardGlassTitle, CareerStatsGlass, CareerStatsHeaderGlass, Cell, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, CheckboxGlass, CircularMetricGlass, CircularProgressGlass, ComboBoxGlass, ContributionMetricsGlass, DropdownGlass, DropdownMenuGlass, DropdownMenuGlassCheckboxItem, DropdownMenuGlassContent, DropdownMenuGlassGroup, DropdownMenuGlassItem, DropdownMenuGlassLabel, DropdownMenuGlassPortal, DropdownMenuGlassRadioGroup, DropdownMenuGlassRadioItem, DropdownMenuGlassSeparator, DropdownMenuGlassShortcut, DropdownMenuGlassSub, DropdownMenuGlassSubContent, DropdownMenuGlassSubTrigger, DropdownMenuGlassTrigger, ExpandableHeaderGlass, FlagAlertGlass, FlagsSectionGlass, FormFieldWrapper, GlassCard, HeaderBrandingGlass, HeaderNavGlass, IconButtonGlass, InputGlass, InsightCardGlass, InteractiveCard, LanguageBarGlass, MetricCardGlass, MetricsGridGlass, ModalGlass, NotificationGlass, PopoverGlass, PopoverGlassAnchor, PopoverGlassContent, PopoverGlassLegacy, PopoverGlassTrigger, ProfileAvatarGlass, ProfileHeaderGlass, ProgressGlass, ProjectsListGlass, RainbowProgressGlass, RepositoryCardGlass, RepositoryHeaderGlass, RepositoryMetadataGlass, ResponsiveContainer, SearchBoxGlass, SegmentedControlGlass, SidebarGlass, SkeletonGlass, SliderGlass, SortDropdownGlass, SparklineGlass, SplitLayoutAccordion, SplitLayoutGlass, StatItemGlass, StatusIndicatorGlass, StepperGlass, THEMES, THEME_CONFIG, Tabs, TabsContent, TabsGlass, TabsList, TabsTrigger, ThemeProvider, ThemeToggleGlass, ToggleGlass, TooltipGlass, TooltipGlassContent, TooltipGlassProvider, TooltipGlassSimple, TooltipGlassTrigger, TouchTarget, TrustScoreCardGlass, TrustScoreDisplayGlass, UserInfoGlass, UserStatsLineGlass, YearCardGlass, alertVariants, avatarSizes, badgeVariants, buttonGlassVariants, cardIntensity, cn, dropdownAlign, getNextTheme, getThemeConfig, inputVariants, insightCardVariants, insightVariantConfig, modalSizes, notificationVariants, progressSizes, alertVariants$1 as shadcnAlertVariants, badgeVariants$1 as shadcnBadgeVariants, buttonVariants as shadcnButtonVariants, skeletonVariants, sparklineBarVariants, sparklineContainerVariants, statusSizes, stepperConnectorVariants, stepperContentVariants, stepperDescriptionVariants, stepperIndicatorVariants, stepperLabelVariants, stepperListVariants, stepperRootVariants, stepperStepContainerVariants, toggleSizes, tooltipPositions, useChart, useFocus, useHover, useResponsive, useSidebar, useSplitLayout, useSplitLayoutOptional, useTheme, useWallpaperTint };
|
|
2639
1553
|
|
|
2640
|
-
//# sourceMappingURL=index.
|
|
1554
|
+
//# sourceMappingURL=index.mjs.map
|