@sovereignsquad/gds-core 6.11.0 → 6.12.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/dist/AISearchCard.js +97 -0
- package/dist/AISearchCard.mjs +73 -0
- package/dist/AccentPanel.js +94 -0
- package/dist/AccentPanel.mjs +69 -0
- package/dist/AccessRecoveryPanel.js +164 -0
- package/dist/AccessRecoveryPanel.mjs +140 -0
- package/dist/AccessSummary.js +57 -0
- package/dist/AccessSummary.mjs +33 -0
- package/dist/AccessibilityEvidence.js +131 -0
- package/dist/AccessibilityEvidence.mjs +104 -0
- package/dist/ActionBar.js +84 -0
- package/dist/ActionBar.mjs +60 -0
- package/dist/AdvancedDataTable.client.js +204 -0
- package/dist/AdvancedDataTable.client.mjs +180 -0
- package/dist/ArticleShell.js +43 -0
- package/dist/ArticleShell.mjs +19 -0
- package/dist/AsyncSurface.js +156 -0
- package/dist/AsyncSurface.mjs +132 -0
- package/dist/AuthShell.js +72 -0
- package/dist/AuthShell.mjs +48 -0
- package/dist/BottomTabBar.js +152 -0
- package/dist/BottomTabBar.mjs +128 -0
- package/dist/BottomTabBar.shared.js +31 -0
- package/dist/BottomTabBar.shared.mjs +6 -0
- package/dist/BoundedPreviewSurface.js +54 -0
- package/dist/BoundedPreviewSurface.mjs +30 -0
- package/dist/BrowseSelection.client.js +50 -0
- package/dist/BrowseSelection.client.mjs +26 -0
- package/dist/BrowseSurface.js +151 -0
- package/dist/BrowseSurface.mjs +127 -0
- package/dist/CardContracts.js +97 -0
- package/dist/CardContracts.mjs +68 -0
- package/dist/ChartTokenPanel.js +102 -0
- package/dist/ChartTokenPanel.mjs +78 -0
- package/dist/ChatSurface.js +217 -0
- package/dist/ChatSurface.mjs +190 -0
- package/dist/ChoiceChip.js +257 -0
- package/dist/ChoiceChip.mjs +230 -0
- package/dist/CommandPalette.client.js +129 -0
- package/dist/CommandPalette.client.mjs +103 -0
- package/dist/ConfirmDialog.js +65 -0
- package/dist/ConfirmDialog.mjs +41 -0
- package/dist/ConsumerDashboardGrid.js +35 -0
- package/dist/ConsumerDashboardGrid.mjs +11 -0
- package/dist/ConsumerSection.js +38 -0
- package/dist/ConsumerSection.mjs +14 -0
- package/dist/CreatorTheme.js +146 -0
- package/dist/CreatorTheme.mjs +120 -0
- package/dist/CtaButtonGroup.js +38 -0
- package/dist/CtaButtonGroup.mjs +14 -0
- package/dist/DataToolbar.js +63 -0
- package/dist/DataToolbar.mjs +39 -0
- package/dist/DetailFactsTable.js +134 -0
- package/dist/DetailFactsTable.mjs +110 -0
- package/dist/DetailFactsTable.shared.js +41 -0
- package/dist/DetailFactsTable.shared.mjs +16 -0
- package/dist/DetailProfileShell.js +52 -0
- package/dist/DetailProfileShell.mjs +28 -0
- package/dist/DiscoveryShell.js +189 -0
- package/dist/DiscoveryShell.mjs +164 -0
- package/dist/DocsCodeBlock.js +67 -0
- package/dist/DocsCodeBlock.mjs +43 -0
- package/dist/DocsCodeDisclosure.js +74 -0
- package/dist/DocsCodeDisclosure.mjs +50 -0
- package/dist/DocsPageShell.js +55 -0
- package/dist/DocsPageShell.mjs +31 -0
- package/dist/DocsShell.js +205 -0
- package/dist/DocsShell.mjs +180 -0
- package/dist/EditorialCard.js +140 -0
- package/dist/EditorialCard.mjs +116 -0
- package/dist/EditorialHero.js +247 -0
- package/dist/EditorialHero.mjs +223 -0
- package/dist/EmptyState.js +37 -0
- package/dist/EmptyState.mjs +13 -0
- package/dist/EvidencePanel.js +85 -0
- package/dist/EvidencePanel.mjs +61 -0
- package/dist/FeatureBand.js +90 -0
- package/dist/FeatureBand.mjs +66 -0
- package/dist/FeedbackRuntime.client.js +264 -0
- package/dist/FeedbackRuntime.client.mjs +237 -0
- package/dist/FilterDrawer.js +67 -0
- package/dist/FilterDrawer.mjs +43 -0
- package/dist/FitScoreChip.js +72 -0
- package/dist/FitScoreChip.mjs +48 -0
- package/dist/FoodMenuSection.js +79 -0
- package/dist/FoodMenuSection.mjs +55 -0
- package/dist/FormField.js +37 -0
- package/dist/FormField.mjs +13 -0
- package/dist/GameBoardTile.js +63 -0
- package/dist/GameBoardTile.mjs +39 -0
- package/dist/GdsAccentContrastMatrix.js +102 -0
- package/dist/GdsAccentContrastMatrix.mjs +85 -0
- package/dist/GdsAccessGate.js +226 -0
- package/dist/GdsAccessGate.mjs +204 -0
- package/dist/GdsAccessGateRuntime.js +236 -0
- package/dist/GdsAccessGateRuntime.mjs +203 -0
- package/dist/GdsAccessibilitySystemReference.js +78 -0
- package/dist/GdsAccessibilitySystemReference.mjs +54 -0
- package/dist/GdsAssetManager.client.js +208 -0
- package/dist/GdsAssetManager.client.mjs +180 -0
- package/dist/GdsBadge.js +115 -0
- package/dist/GdsBadge.mjs +91 -0
- package/dist/GdsBadge.shared-D2Cs4eos.d.mts +35 -0
- package/dist/GdsBadge.shared-D2Cs4eos.d.ts +35 -0
- package/dist/GdsBadge.shared.js +42 -0
- package/dist/GdsBadge.shared.mjs +16 -0
- package/dist/GdsBadgeStack.js +58 -0
- package/dist/GdsBadgeStack.mjs +33 -0
- package/dist/GdsBreadcrumbs.js +42 -0
- package/dist/GdsBreadcrumbs.mjs +18 -0
- package/dist/GdsBulkActionBar.js +73 -0
- package/dist/GdsBulkActionBar.mjs +49 -0
- package/dist/GdsButtonFeedbackReference.js +289 -0
- package/dist/GdsButtonFeedbackReference.mjs +273 -0
- package/dist/GdsChart.js +169 -0
- package/dist/GdsChart.mjs +145 -0
- package/dist/GdsChart.shared.js +247 -0
- package/dist/GdsChart.shared.mjs +215 -0
- package/dist/GdsColorSystemReference.js +116 -0
- package/dist/GdsColorSystemReference.mjs +100 -0
- package/dist/GdsCompareButton.js +79 -0
- package/dist/GdsCompareButton.mjs +55 -0
- package/dist/GdsContentDesign.js +371 -0
- package/dist/GdsContentDesign.mjs +339 -0
- package/dist/GdsCountBadge.js +70 -0
- package/dist/GdsCountBadge.mjs +46 -0
- package/dist/GdsDataTable.client.js +412 -0
- package/dist/GdsDataTable.client.mjs +385 -0
- package/dist/GdsDateInput.client.js +116 -0
- package/dist/GdsDateInput.client.mjs +90 -0
- package/dist/GdsDensity.js +46 -0
- package/dist/GdsDensity.mjs +20 -0
- package/dist/GdsDensitySpacingSystemReference.js +70 -0
- package/dist/GdsDensitySpacingSystemReference.mjs +52 -0
- package/dist/GdsDesignHandoff.js +250 -0
- package/dist/GdsDesignHandoff.mjs +222 -0
- package/dist/GdsDesignRuleProfilePanel.js +80 -0
- package/dist/GdsDesignRuleProfilePanel.mjs +61 -0
- package/dist/GdsForm.client.js +303 -0
- package/dist/GdsForm.client.mjs +271 -0
- package/dist/GdsFormControls.js +193 -0
- package/dist/GdsFormControls.mjs +166 -0
- package/dist/GdsGeneratedAvatar.js +86 -0
- package/dist/GdsGeneratedAvatar.mjs +65 -0
- package/dist/GdsGeneratedAvatar.shared.js +34 -0
- package/dist/GdsGeneratedAvatar.shared.mjs +10 -0
- package/dist/GdsGeneratedHero.js +277 -0
- package/dist/GdsGeneratedHero.mjs +256 -0
- package/dist/GdsGeneratedMark.js +90 -0
- package/dist/GdsGeneratedMark.mjs +66 -0
- package/dist/GdsGeneratedThumbnail.js +301 -0
- package/dist/GdsGeneratedThumbnail.mjs +280 -0
- package/dist/GdsI18nRuntime.js +83 -0
- package/dist/GdsI18nRuntime.mjs +52 -0
- package/dist/GdsI18nRuntime.shared.js +232 -0
- package/dist/GdsI18nRuntime.shared.mjs +198 -0
- package/dist/GdsIconBadge.js +60 -0
- package/dist/GdsIconBadge.mjs +36 -0
- package/dist/GdsIconSystemReference.js +128 -0
- package/dist/GdsIconSystemReference.mjs +104 -0
- package/dist/GdsInlineLink.js +42 -0
- package/dist/{chunk-W5O2JSVK.mjs → GdsInlineLink.mjs} +1 -3
- package/dist/GdsLogoLockup.js +131 -0
- package/dist/GdsLogoLockup.mjs +107 -0
- package/dist/GdsMap.client.js +395 -0
- package/dist/GdsMap.client.mjs +358 -0
- package/dist/GdsMapBasemapWash.js +51 -0
- package/dist/GdsMapBasemapWash.mjs +25 -0
- package/dist/GdsMapFilterRail.js +84 -0
- package/dist/GdsMapFilterRail.mjs +60 -0
- package/dist/GdsMapPinBadge.js +95 -0
- package/dist/{chunk-NTNVQZJU.mjs → GdsMapPinBadge.mjs} +12 -30
- package/dist/GdsMapPinBadge.shared.js +43 -0
- package/dist/GdsMapPinBadge.shared.mjs +14 -0
- package/dist/GdsMapPinPreviewCard.js +134 -0
- package/dist/GdsMapPinPreviewCard.mjs +110 -0
- package/dist/GdsMessageThread.js +92 -0
- package/dist/GdsMessageThread.mjs +68 -0
- package/dist/GdsMeter.js +46 -0
- package/dist/GdsMeter.mjs +22 -0
- package/dist/GdsMotionSystemReference.js +124 -0
- package/dist/GdsMotionSystemReference.mjs +106 -0
- package/dist/GdsNotificationBell.js +78 -0
- package/dist/GdsNotificationBell.mjs +54 -0
- package/dist/GdsPageTemplateFrame.js +178 -0
- package/dist/GdsPageTemplateFrame.mjs +150 -0
- package/dist/GdsPageTemplates.client.js +129 -0
- package/dist/GdsPageTemplates.client.mjs +104 -0
- package/dist/GdsPageTemplates.js +279 -0
- package/dist/GdsPageTemplates.mjs +247 -0
- package/dist/GdsPageTemplates.shared.js +331 -0
- package/dist/GdsPageTemplates.shared.mjs +303 -0
- package/dist/GdsPictogramSystemReference.js +288 -0
- package/dist/GdsPictogramSystemReference.mjs +264 -0
- package/dist/GdsPinSystemReference.js +164 -0
- package/dist/GdsPinSystemReference.mjs +147 -0
- package/dist/GdsPrimitives.js +84 -0
- package/dist/GdsPrimitives.mjs +62 -0
- package/dist/GdsRatingDisplay.js +61 -0
- package/dist/GdsRatingDisplay.mjs +37 -0
- package/dist/GdsReleaseNotes.client.js +126 -0
- package/dist/GdsReleaseNotes.client.mjs +102 -0
- package/dist/GdsRemovableTag.js +61 -0
- package/dist/GdsRemovableTag.mjs +37 -0
- package/dist/GdsResourceManager.client.js +280 -0
- package/dist/GdsResourceManager.client.mjs +254 -0
- package/dist/GdsRichTextEditor.client.js +146 -0
- package/dist/GdsRichTextEditor.client.mjs +112 -0
- package/dist/GdsSavedIndicator.js +62 -0
- package/dist/GdsSavedIndicator.mjs +38 -0
- package/dist/GdsSchemaForm.client.js +679 -0
- package/dist/GdsSchemaForm.client.mjs +650 -0
- package/dist/GdsShapeElevationSystemReference.js +140 -0
- package/dist/GdsShapeElevationSystemReference.mjs +125 -0
- package/dist/GdsShapeScope.js +44 -0
- package/dist/GdsShapeScope.mjs +19 -0
- package/dist/GdsTableScrollContainer.js +46 -0
- package/dist/GdsTableScrollContainer.mjs +22 -0
- package/dist/GdsThreadList.js +118 -0
- package/dist/GdsThreadList.mjs +94 -0
- package/dist/GdsTour.client.js +399 -0
- package/dist/GdsTour.client.mjs +380 -0
- package/dist/GdsTreeView.js +194 -0
- package/dist/GdsTreeView.mjs +170 -0
- package/dist/GdsTypographySystemReference.js +77 -0
- package/dist/GdsTypographySystemReference.mjs +57 -0
- package/dist/GdsViewToggle.js +48 -0
- package/dist/GdsViewToggle.mjs +24 -0
- package/dist/GdsViewportFrame.js +61 -0
- package/dist/GdsViewportFrame.mjs +37 -0
- package/dist/HeroSearchPanel.client.js +135 -0
- package/dist/HeroSearchPanel.client.mjs +109 -0
- package/dist/KanbanBoard.client.js +400 -0
- package/dist/KanbanBoard.client.mjs +382 -0
- package/dist/LayoutBlocks.js +331 -0
- package/dist/LayoutBlocks.mjs +301 -0
- package/dist/LayoutPrimitives.js +501 -0
- package/dist/LayoutPrimitives.mjs +465 -0
- package/dist/LayoutTemplatePreview.client.js +172 -0
- package/dist/LayoutTemplatePreview.client.mjs +151 -0
- package/dist/ListingCard.js +397 -0
- package/dist/ListingCard.mjs +373 -0
- package/dist/ListingCard.shared.js +49 -0
- package/dist/ListingCard.shared.mjs +18 -0
- package/dist/ListingPrimitives.js +116 -0
- package/dist/ListingPrimitives.mjs +89 -0
- package/dist/ListingState.client.js +98 -0
- package/dist/ListingState.client.mjs +72 -0
- package/dist/MapPanel.js +93 -0
- package/dist/MapPanel.mjs +69 -0
- package/dist/MaturityCapabilities.js +211 -0
- package/dist/MaturityCapabilities.mjs +184 -0
- package/dist/MeaningBadge.js +65 -0
- package/dist/MeaningBadge.mjs +41 -0
- package/dist/MediaCard.js +61 -0
- package/dist/MediaCard.mjs +37 -0
- package/dist/MediaField.js +117 -0
- package/dist/MediaField.mjs +93 -0
- package/dist/MediaPreviewCard.js +90 -0
- package/dist/MediaPreviewCard.mjs +66 -0
- package/dist/MediaWithFallback.js +112 -0
- package/dist/MediaWithFallback.mjs +88 -0
- package/dist/MetricCard.js +60 -0
- package/dist/MetricCard.mjs +36 -0
- package/dist/Notifications.client.js +301 -0
- package/dist/Notifications.client.mjs +273 -0
- package/dist/Notifications.js +220 -0
- package/dist/Notifications.mjs +194 -0
- package/dist/Notifications.shared.js +52 -0
- package/dist/Notifications.shared.mjs +26 -0
- package/dist/NumberStepper.js +124 -0
- package/dist/NumberStepper.mjs +100 -0
- package/dist/OverlayManager.client.js +300 -0
- package/dist/OverlayManager.client.mjs +270 -0
- package/dist/OwnedContrastSurface.js +83 -0
- package/dist/OwnedContrastSurface.mjs +58 -0
- package/dist/PageHeader.js +48 -0
- package/dist/PageHeader.mjs +24 -0
- package/dist/{PartnerDiscovery-pdJmaKwq.d.ts → PartnerDiscovery-BUwzROQc.d.mts} +37 -35
- package/dist/{PartnerDiscovery-Dy3YnO02.d.mts → PartnerDiscovery-DmIj5bAw.d.ts} +37 -35
- package/dist/PartnerDiscovery.js +629 -0
- package/dist/{chunk-PCG34VRY.mjs → PartnerDiscovery.mjs} +19 -106
- package/dist/PartnerDiscovery.shared.js +116 -0
- package/dist/PartnerDiscovery.shared.mjs +84 -0
- package/dist/PeriodSelector.js +69 -0
- package/dist/PeriodSelector.mjs +45 -0
- package/dist/PlaceholderPanel.js +59 -0
- package/dist/PlaceholderPanel.mjs +35 -0
- package/dist/PlaybackControls.client.js +91 -0
- package/dist/PlaybackControls.client.mjs +65 -0
- package/dist/PlaybackSurface.js +107 -0
- package/dist/PlaybackSurface.mjs +83 -0
- package/dist/ProductCard.js +75 -0
- package/dist/ProductCard.mjs +51 -0
- package/dist/ProgressCard.js +58 -0
- package/dist/ProgressCard.mjs +34 -0
- package/dist/ProviderCTA.js +104 -0
- package/dist/ProviderCTA.mjs +80 -0
- package/dist/ProviderIdentityButtons.js +221 -0
- package/dist/ProviderIdentityButtons.mjs +192 -0
- package/dist/PublicBrandFooter.js +70 -0
- package/dist/PublicBrandFooter.mjs +46 -0
- package/dist/PublicCaptureFlow.js +125 -0
- package/dist/PublicCaptureFlow.mjs +95 -0
- package/dist/PublicFlowShell.js +128 -0
- package/dist/PublicFlowShell.mjs +104 -0
- package/dist/PublicFoodCard.js +153 -0
- package/dist/PublicFoodCard.mjs +129 -0
- package/dist/PublicNav.js +51 -0
- package/dist/PublicNav.mjs +27 -0
- package/dist/PublicProductCard.js +145 -0
- package/dist/PublicProductCard.mjs +121 -0
- package/dist/PublicShell.js +168 -0
- package/dist/PublicShell.mjs +144 -0
- package/dist/PublicSiteFooter.js +35 -0
- package/dist/PublicSiteFooter.mjs +11 -0
- package/dist/{QuickStartCard-BhNYAGG3.d.ts → QuickStartCard-CYKhDjvS.d.ts} +551 -158
- package/dist/{QuickStartCard-BztqkfQK.d.mts → QuickStartCard-DT2GgJrP.d.mts} +551 -158
- package/dist/QuickStartCard.js +85 -0
- package/dist/QuickStartCard.mjs +60 -0
- package/dist/ReferenceLinkGrid.js +66 -0
- package/dist/ReferenceLinkGrid.mjs +42 -0
- package/dist/ReferenceLocaleNotice.js +32 -0
- package/dist/ReferenceLocaleNotice.mjs +8 -0
- package/dist/ReferenceSection.js +58 -0
- package/dist/ReferenceSection.mjs +34 -0
- package/dist/ReferenceThemeExplorer.copy.js +1209 -0
- package/dist/ReferenceThemeExplorer.copy.mjs +1184 -0
- package/dist/ReferenceThemeExplorer.js +801 -0
- package/dist/ReferenceThemeExplorer.mjs +802 -0
- package/dist/ReportingSection.js +72 -0
- package/dist/ReportingSection.mjs +48 -0
- package/dist/SafeStyles.js +303 -0
- package/dist/SafeStyles.mjs +274 -0
- package/dist/SearchableSelect.js +195 -0
- package/dist/SearchableSelect.mjs +171 -0
- package/dist/SectionPanel.js +96 -0
- package/dist/SectionPanel.mjs +72 -0
- package/dist/SemanticButton.js +326 -0
- package/dist/SemanticButton.mjs +296 -0
- package/dist/SemanticCharts.js +120 -0
- package/dist/SemanticCharts.mjs +77 -0
- package/dist/ShareButtonGroup.js +117 -0
- package/dist/ShareButtonGroup.mjs +93 -0
- package/dist/SidebarNav.js +92 -0
- package/dist/SidebarNav.mjs +66 -0
- package/dist/SimpleDataTable.js +59 -0
- package/dist/SimpleDataTable.mjs +35 -0
- package/dist/SocialAuthButtons.js +71 -0
- package/dist/SocialAuthButtons.mjs +49 -0
- package/dist/StateBlock.js +118 -0
- package/dist/StateBlock.mjs +95 -0
- package/dist/StatsSection.js +63 -0
- package/dist/StatsSection.mjs +39 -0
- package/dist/StatusBadge.js +94 -0
- package/dist/StatusBadge.mjs +68 -0
- package/dist/StyleUtilities.js +123 -0
- package/dist/StyleUtilities.mjs +91 -0
- package/dist/SurfacePresentation.js +63 -0
- package/dist/SurfacePresentation.mjs +38 -0
- package/dist/TaskPatterns.js +206 -0
- package/dist/TaskPatterns.mjs +180 -0
- package/dist/Telemetry.client.js +273 -0
- package/dist/Telemetry.client.mjs +243 -0
- package/dist/ThemeToggle.js +53 -0
- package/dist/{chunk-ZFGYQSNR.mjs → ThemeToggle.mjs} +3 -7
- package/dist/TrustLayer.client.js +184 -0
- package/dist/TrustLayer.client.mjs +158 -0
- package/dist/TrustLayer.js +94 -0
- package/dist/TrustLayer.mjs +68 -0
- package/dist/TrustLayer.shared.js +37 -0
- package/dist/TrustLayer.shared.mjs +13 -0
- package/dist/Typography.js +68 -0
- package/dist/Typography.mjs +37 -0
- package/dist/UploadDropzone.js +144 -0
- package/dist/UploadDropzone.mjs +120 -0
- package/dist/badge-shapes.js +75 -0
- package/dist/badge-shapes.mjs +44 -0
- package/dist/breakpoints.js +34 -0
- package/dist/breakpoints.mjs +10 -0
- package/dist/category-registry.js +33 -0
- package/dist/category-registry.mjs +9 -0
- package/dist/chart-colors.js +73 -0
- package/dist/chart-colors.mjs +44 -0
- package/dist/chart-primitives.js +169 -0
- package/dist/chart-primitives.mjs +144 -0
- package/dist/client.d.mts +3 -3
- package/dist/client.d.ts +3 -3
- package/dist/client.js +378 -23816
- package/dist/client.mjs +161 -959
- package/dist/dom-phrase-translation.js +130 -0
- package/dist/dom-phrase-translation.mjs +104 -0
- package/dist/generated-art-engine.js +119 -0
- package/dist/generated-art-engine.mjs +93 -0
- package/dist/generated-art-svg.js +263 -0
- package/dist/generated-art-svg.mjs +238 -0
- package/dist/generated-brand-badge.js +160 -0
- package/dist/generated-brand-badge.mjs +136 -0
- package/dist/generated-design-rule-coverage.js +54 -0
- package/dist/generated-design-rule-coverage.mjs +30 -0
- package/dist/icons.js +371 -0
- package/dist/{chunk-J66ITCXC.mjs → icons.mjs} +22 -15
- package/dist/index.d.mts +13 -12
- package/dist/index.d.ts +13 -12
- package/dist/index.js +448 -26750
- package/dist/index.mjs +192 -3030
- package/dist/locales/ar.js +477 -0
- package/dist/{chunk-EYRLICSG.mjs → locales/ar.mjs} +1 -3
- package/dist/locales/de.js +477 -0
- package/dist/{chunk-TVGDH5O5.mjs → locales/de.mjs} +1 -3
- package/dist/locales/en.js +477 -0
- package/dist/{chunk-D65VHUXK.mjs → locales/en.mjs} +1 -3
- package/dist/locales/es.js +477 -0
- package/dist/{chunk-J4TSXITU.mjs → locales/es.mjs} +1 -3
- package/dist/locales/fr.js +477 -0
- package/dist/{chunk-Z6XXK57E.mjs → locales/fr.mjs} +1 -3
- package/dist/locales/he.js +477 -0
- package/dist/{chunk-GAPCKZGX.mjs → locales/he.mjs} +1 -3
- package/dist/locales/hu.js +477 -0
- package/dist/{chunk-CWMDWMYL.mjs → locales/hu.mjs} +1 -3
- package/dist/locales/index.js +83 -0
- package/dist/locales/index.mjs +45 -0
- package/dist/locales/it.js +477 -0
- package/dist/{chunk-3UYDQTAZ.mjs → locales/it.mjs} +1 -3
- package/dist/locales/ja.js +477 -0
- package/dist/{chunk-FPDTLFIB.mjs → locales/ja.mjs} +1 -3
- package/dist/locales/ko.js +477 -0
- package/dist/{chunk-PLJT4I7B.mjs → locales/ko.mjs} +1 -3
- package/dist/locales/lazy/all.js +23 -5449
- package/dist/locales/lazy/all.mjs +12 -39
- package/dist/locales/lazy/ar.js +3 -919
- package/dist/locales/lazy/ar.mjs +2 -9
- package/dist/locales/lazy/de.js +3 -919
- package/dist/locales/lazy/de.mjs +2 -9
- package/dist/locales/lazy/es.js +3 -919
- package/dist/locales/lazy/es.mjs +2 -9
- package/dist/locales/lazy/fr.js +3 -919
- package/dist/locales/lazy/fr.mjs +2 -9
- package/dist/locales/lazy/he.js +3 -919
- package/dist/locales/lazy/he.mjs +2 -9
- package/dist/locales/lazy/hu.js +3 -919
- package/dist/locales/lazy/hu.mjs +2 -9
- package/dist/locales/lazy/index.js +3 -477
- package/dist/locales/lazy/index.mjs +1 -5
- package/dist/locales/lazy/it.js +3 -919
- package/dist/locales/lazy/it.mjs +2 -9
- package/dist/locales/lazy/ja.js +3 -919
- package/dist/locales/lazy/ja.mjs +2 -9
- package/dist/locales/lazy/ko.js +3 -919
- package/dist/locales/lazy/ko.mjs +2 -9
- package/dist/locales/lazy/registry.js +47 -0
- package/dist/{chunk-TD3JPMMO.mjs → locales/lazy/registry.mjs} +6 -11
- package/dist/locales/lazy/ru.js +3 -919
- package/dist/locales/lazy/ru.mjs +2 -9
- package/dist/locales/lazy/zh.js +3 -919
- package/dist/locales/lazy/zh.mjs +2 -9
- package/dist/locales/ru.js +477 -0
- package/dist/{chunk-RBXAJJB2.mjs → locales/ru.mjs} +1 -3
- package/dist/locales/zh.js +477 -0
- package/dist/{chunk-V6SP5O4D.mjs → locales/zh.mjs} +1 -3
- package/dist/map-tile-policy.js +55 -0
- package/dist/map-tile-policy.mjs +29 -0
- package/dist/map.d.mts +1 -3
- package/dist/map.d.ts +1 -3
- package/dist/map.js +6 -749
- package/dist/map.mjs +2 -389
- package/dist/pictograms.js +112 -0
- package/dist/pictograms.mjs +88 -0
- package/dist/pictograms.shared.js +262 -0
- package/dist/pictograms.shared.mjs +226 -0
- package/dist/reference-theme-explorer.js +3 -10401
- package/dist/reference-theme-explorer.mjs +1 -2008
- package/dist/rich-text-editor.js +3 -450
- package/dist/rich-text-editor.mjs +1 -115
- package/dist/server.d.mts +6 -5
- package/dist/server.d.ts +6 -5
- package/dist/server.js +304 -18097
- package/dist/server.mjs +120 -1122
- package/dist/useGdsDomPhraseTranslation.client.js +49 -0
- package/dist/useGdsDomPhraseTranslation.client.mjs +25 -0
- package/dist/vocabulary.js +166 -0
- package/dist/vocabulary.mjs +137 -0
- package/package.json +5 -5
- package/dist/GdsBadge-j_kQnIL0.d.mts +0 -417
- package/dist/GdsBadge-j_kQnIL0.d.ts +0 -417
- package/dist/chunk-ADNXPSGK.mjs +0 -6695
- package/dist/chunk-MQDFB3AS.mjs +0 -8311
- package/dist/chunk-RMPMU4MB.mjs +0 -2468
- package/dist/chunk-RSA7INLU.mjs +0 -246
- package/dist/chunk-SPPTDVJC.mjs +0 -211
package/dist/chunk-RMPMU4MB.mjs
DELETED
|
@@ -1,2468 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
GdsBadgeShapes,
|
|
3
|
-
GdsBadgeStack,
|
|
4
|
-
GdsBadgeStackLayer,
|
|
5
|
-
StateBlock,
|
|
6
|
-
resolveSurfacePresentationStyles
|
|
7
|
-
} from "./chunk-SPPTDVJC.mjs";
|
|
8
|
-
import {
|
|
9
|
-
GdsIcon,
|
|
10
|
-
GdsIcons
|
|
11
|
-
} from "./chunk-J66ITCXC.mjs";
|
|
12
|
-
import {
|
|
13
|
-
ko
|
|
14
|
-
} from "./chunk-PLJT4I7B.mjs";
|
|
15
|
-
import {
|
|
16
|
-
ru
|
|
17
|
-
} from "./chunk-RBXAJJB2.mjs";
|
|
18
|
-
import {
|
|
19
|
-
zh
|
|
20
|
-
} from "./chunk-V6SP5O4D.mjs";
|
|
21
|
-
import {
|
|
22
|
-
de
|
|
23
|
-
} from "./chunk-TVGDH5O5.mjs";
|
|
24
|
-
import {
|
|
25
|
-
es
|
|
26
|
-
} from "./chunk-J4TSXITU.mjs";
|
|
27
|
-
import {
|
|
28
|
-
fr
|
|
29
|
-
} from "./chunk-Z6XXK57E.mjs";
|
|
30
|
-
import {
|
|
31
|
-
he
|
|
32
|
-
} from "./chunk-GAPCKZGX.mjs";
|
|
33
|
-
import {
|
|
34
|
-
hu
|
|
35
|
-
} from "./chunk-CWMDWMYL.mjs";
|
|
36
|
-
import {
|
|
37
|
-
it
|
|
38
|
-
} from "./chunk-3UYDQTAZ.mjs";
|
|
39
|
-
import {
|
|
40
|
-
ja
|
|
41
|
-
} from "./chunk-FPDTLFIB.mjs";
|
|
42
|
-
import {
|
|
43
|
-
ar
|
|
44
|
-
} from "./chunk-EYRLICSG.mjs";
|
|
45
|
-
import {
|
|
46
|
-
en
|
|
47
|
-
} from "./chunk-D65VHUXK.mjs";
|
|
48
|
-
|
|
49
|
-
// src/LayoutPrimitives.tsx
|
|
50
|
-
import { forwardRef } from "react";
|
|
51
|
-
import { Box } from "@mantine/core";
|
|
52
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
53
|
-
var breakpointPixels = {
|
|
54
|
-
xs: 480,
|
|
55
|
-
sm: 640,
|
|
56
|
-
md: 768,
|
|
57
|
-
lg: 1024,
|
|
58
|
-
xl: 1280
|
|
59
|
-
};
|
|
60
|
-
var GdsMantineBox = Box;
|
|
61
|
-
var spacingTokenMap = {
|
|
62
|
-
none: "0",
|
|
63
|
-
xs: "var(--mantine-spacing-xs)",
|
|
64
|
-
sm: "var(--mantine-spacing-sm)",
|
|
65
|
-
md: "var(--mantine-spacing-md)",
|
|
66
|
-
lg: "var(--mantine-spacing-lg)",
|
|
67
|
-
xl: "var(--mantine-spacing-xl)",
|
|
68
|
-
"2xl": "calc(var(--mantine-spacing-xl) * 1.5)"
|
|
69
|
-
};
|
|
70
|
-
var sizeTokenMap = {
|
|
71
|
-
none: "0",
|
|
72
|
-
xs: "var(--mantine-spacing-xs)",
|
|
73
|
-
sm: "var(--mantine-spacing-sm)",
|
|
74
|
-
md: "var(--mantine-spacing-md)",
|
|
75
|
-
lg: "var(--mantine-spacing-lg)",
|
|
76
|
-
xl: "var(--mantine-spacing-xl)",
|
|
77
|
-
"2xl": "calc(var(--mantine-spacing-xl) * 1.5)",
|
|
78
|
-
aside: "18rem",
|
|
79
|
-
content: "42rem",
|
|
80
|
-
narrow: "56rem",
|
|
81
|
-
page: "72rem",
|
|
82
|
-
wide: "88rem",
|
|
83
|
-
full: "100%"
|
|
84
|
-
};
|
|
85
|
-
var alignMap = {
|
|
86
|
-
start: "flex-start",
|
|
87
|
-
center: "center",
|
|
88
|
-
end: "flex-end",
|
|
89
|
-
stretch: "stretch",
|
|
90
|
-
baseline: "baseline"
|
|
91
|
-
};
|
|
92
|
-
var justifyMap = {
|
|
93
|
-
start: "flex-start",
|
|
94
|
-
center: "center",
|
|
95
|
-
end: "flex-end",
|
|
96
|
-
between: "space-between",
|
|
97
|
-
around: "space-around",
|
|
98
|
-
evenly: "space-evenly"
|
|
99
|
-
};
|
|
100
|
-
var wrapMap = {
|
|
101
|
-
wrap: "wrap",
|
|
102
|
-
nowrap: "nowrap",
|
|
103
|
-
reverse: "wrap-reverse"
|
|
104
|
-
};
|
|
105
|
-
function isResponsiveRecord(value) {
|
|
106
|
-
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
107
|
-
}
|
|
108
|
-
function normalizeGdsResponsiveValue(value) {
|
|
109
|
-
if (value === void 0) {
|
|
110
|
-
return { breakpoints: {} };
|
|
111
|
-
}
|
|
112
|
-
if (!isResponsiveRecord(value)) {
|
|
113
|
-
return { base: value, breakpoints: {} };
|
|
114
|
-
}
|
|
115
|
-
const { base, xs, sm, md, lg, xl } = value;
|
|
116
|
-
return { base, breakpoints: { xs, sm, md, lg, xl } };
|
|
117
|
-
}
|
|
118
|
-
function resolveSpacing(value) {
|
|
119
|
-
if (value === void 0) return void 0;
|
|
120
|
-
if (value === 0) return "0";
|
|
121
|
-
return spacingTokenMap[value];
|
|
122
|
-
}
|
|
123
|
-
function resolveSize(value) {
|
|
124
|
-
if (value === void 0) return void 0;
|
|
125
|
-
return sizeTokenMap[value];
|
|
126
|
-
}
|
|
127
|
-
function hashLayoutSignature(input) {
|
|
128
|
-
let hash = 0;
|
|
129
|
-
for (let index = 0; index < input.length; index += 1) {
|
|
130
|
-
hash = (hash << 5) - hash + input.charCodeAt(index) | 0;
|
|
131
|
-
}
|
|
132
|
-
return `gds-layout-${Math.abs(hash).toString(36)}`;
|
|
133
|
-
}
|
|
134
|
-
function hasBreakpoints(value) {
|
|
135
|
-
return Object.values(normalizeGdsResponsiveValue(value).breakpoints).some((entry) => entry !== void 0);
|
|
136
|
-
}
|
|
137
|
-
function responsiveCss(className, property, value, resolver, fallback) {
|
|
138
|
-
if (!hasBreakpoints(value)) return "";
|
|
139
|
-
const normalized = normalizeGdsResponsiveValue(value);
|
|
140
|
-
const base = normalized.base ?? fallback;
|
|
141
|
-
const resolvedBase = base === void 0 ? void 0 : resolver(base);
|
|
142
|
-
const baseRule = resolvedBase === void 0 ? "" : `.${className}{${property}:${resolvedBase};}`;
|
|
143
|
-
const rules = Object.entries(normalized.breakpoints).filter((entry) => entry[1] !== void 0).map(([breakpoint, nextValue]) => {
|
|
144
|
-
const resolved = resolver(nextValue);
|
|
145
|
-
return resolved === void 0 ? "" : `@media (min-width: ${breakpointPixels[breakpoint]}px){.${className}{${property}:${resolved};}}`;
|
|
146
|
-
}).filter(Boolean);
|
|
147
|
-
return baseRule + rules.join("");
|
|
148
|
-
}
|
|
149
|
-
function baseValue(value, fallback) {
|
|
150
|
-
const normalized = normalizeGdsResponsiveValue(value);
|
|
151
|
-
return normalized.base ?? fallback;
|
|
152
|
-
}
|
|
153
|
-
function composeResponsiveClass(signature) {
|
|
154
|
-
return hashLayoutSignature(JSON.stringify(signature));
|
|
155
|
-
}
|
|
156
|
-
function renderResponsiveStyle(css) {
|
|
157
|
-
return css ? /* @__PURE__ */ jsx("style", { "data-gds-layout": true, children: css }) : null;
|
|
158
|
-
}
|
|
159
|
-
function resolveGdsLayoutStyle({
|
|
160
|
-
display = "block",
|
|
161
|
-
gap,
|
|
162
|
-
padding,
|
|
163
|
-
margin,
|
|
164
|
-
align,
|
|
165
|
-
justify,
|
|
166
|
-
overflow,
|
|
167
|
-
minWidth,
|
|
168
|
-
maxWidth,
|
|
169
|
-
style
|
|
170
|
-
}) {
|
|
171
|
-
return {
|
|
172
|
-
boxSizing: "border-box",
|
|
173
|
-
display: baseValue(display, "block"),
|
|
174
|
-
gap: resolveSpacing(baseValue(gap, "none")),
|
|
175
|
-
padding: resolveSpacing(baseValue(padding, "none")),
|
|
176
|
-
margin: resolveSpacing(baseValue(margin, "none")),
|
|
177
|
-
alignItems: alignMap[baseValue(align, "stretch")],
|
|
178
|
-
justifyContent: justifyMap[baseValue(justify, "start")],
|
|
179
|
-
overflow,
|
|
180
|
-
minWidth: minWidth === "zero" ? 0 : minWidth === "content" ? "max-content" : void 0,
|
|
181
|
-
maxWidth: resolveSize(baseValue(maxWidth, "full")),
|
|
182
|
-
...style
|
|
183
|
-
};
|
|
184
|
-
}
|
|
185
|
-
function sharedResponsiveCss(className, props) {
|
|
186
|
-
return [
|
|
187
|
-
responsiveCss(className, "display", props.display, (value) => String(value), "block"),
|
|
188
|
-
responsiveCss(className, "gap", props.gap, resolveSpacing, "none"),
|
|
189
|
-
responsiveCss(className, "padding", props.padding, resolveSpacing, "none"),
|
|
190
|
-
responsiveCss(className, "margin", props.margin, resolveSpacing, "none"),
|
|
191
|
-
responsiveCss(className, "align-items", props.align, (value) => alignMap[value], "stretch"),
|
|
192
|
-
responsiveCss(className, "justify-content", props.justify, (value) => justifyMap[value], "start"),
|
|
193
|
-
responsiveCss(className, "max-width", props.maxWidth, resolveSize, "full")
|
|
194
|
-
].join("");
|
|
195
|
-
}
|
|
196
|
-
function withoutResponsiveInline(computed, explicit, entries) {
|
|
197
|
-
const next = { ...computed };
|
|
198
|
-
for (const [value, key] of entries) {
|
|
199
|
-
if (hasBreakpoints(value) && !(explicit && key in explicit)) delete next[key];
|
|
200
|
-
}
|
|
201
|
-
return next;
|
|
202
|
-
}
|
|
203
|
-
function joinClassNames(...classNames) {
|
|
204
|
-
return classNames.filter(Boolean).join(" ") || void 0;
|
|
205
|
-
}
|
|
206
|
-
var GdsBox = forwardRef(function GdsBox2({
|
|
207
|
-
children,
|
|
208
|
-
className,
|
|
209
|
-
component = "div",
|
|
210
|
-
display = "block",
|
|
211
|
-
gap,
|
|
212
|
-
padding,
|
|
213
|
-
margin,
|
|
214
|
-
align,
|
|
215
|
-
justify,
|
|
216
|
-
overflow,
|
|
217
|
-
minWidth = "zero",
|
|
218
|
-
maxWidth,
|
|
219
|
-
style,
|
|
220
|
-
...props
|
|
221
|
-
}, ref) {
|
|
222
|
-
const generatedClassName = composeResponsiveClass({ display, gap, padding, margin, align, justify, maxWidth });
|
|
223
|
-
const css = sharedResponsiveCss(generatedClassName, { display, gap, padding, margin, align, justify, maxWidth });
|
|
224
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
225
|
-
renderResponsiveStyle(css),
|
|
226
|
-
/* @__PURE__ */ jsx(
|
|
227
|
-
GdsMantineBox,
|
|
228
|
-
{
|
|
229
|
-
ref,
|
|
230
|
-
component,
|
|
231
|
-
className: joinClassNames(generatedClassName, className),
|
|
232
|
-
style: withoutResponsiveInline(
|
|
233
|
-
resolveGdsLayoutStyle({ display, gap, padding, margin, align, justify, overflow, minWidth, maxWidth, style }),
|
|
234
|
-
style,
|
|
235
|
-
[[display, "display"], [gap, "gap"], [padding, "padding"], [margin, "margin"], [align, "alignItems"], [justify, "justifyContent"], [maxWidth, "maxWidth"]]
|
|
236
|
-
),
|
|
237
|
-
...props,
|
|
238
|
-
children
|
|
239
|
-
}
|
|
240
|
-
)
|
|
241
|
-
] });
|
|
242
|
-
});
|
|
243
|
-
var GdsStack = forwardRef(function GdsStack2({
|
|
244
|
-
reverse = false,
|
|
245
|
-
gap = "md",
|
|
246
|
-
align = "stretch",
|
|
247
|
-
component = "div",
|
|
248
|
-
style,
|
|
249
|
-
...props
|
|
250
|
-
}, ref) {
|
|
251
|
-
return /* @__PURE__ */ jsx(
|
|
252
|
-
GdsBox,
|
|
253
|
-
{
|
|
254
|
-
ref,
|
|
255
|
-
component,
|
|
256
|
-
display: "flex",
|
|
257
|
-
gap,
|
|
258
|
-
align,
|
|
259
|
-
style: { flexDirection: reverse ? "column-reverse" : "column", ...style },
|
|
260
|
-
...props
|
|
261
|
-
}
|
|
262
|
-
);
|
|
263
|
-
});
|
|
264
|
-
var GdsInline = forwardRef(function GdsInline2({
|
|
265
|
-
gap = "sm",
|
|
266
|
-
align = "center",
|
|
267
|
-
justify = "start",
|
|
268
|
-
wrap = "wrap",
|
|
269
|
-
component = "div",
|
|
270
|
-
className,
|
|
271
|
-
style,
|
|
272
|
-
...props
|
|
273
|
-
}, ref) {
|
|
274
|
-
const generatedClassName = composeResponsiveClass({ wrap });
|
|
275
|
-
const css = responsiveCss(generatedClassName, "flex-wrap", wrap, (value) => wrapMap[value], "wrap");
|
|
276
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
277
|
-
renderResponsiveStyle(css),
|
|
278
|
-
/* @__PURE__ */ jsx(
|
|
279
|
-
GdsBox,
|
|
280
|
-
{
|
|
281
|
-
ref,
|
|
282
|
-
component,
|
|
283
|
-
display: "flex",
|
|
284
|
-
gap,
|
|
285
|
-
align,
|
|
286
|
-
justify,
|
|
287
|
-
className: joinClassNames(generatedClassName, className),
|
|
288
|
-
style: { flexWrap: hasBreakpoints(wrap) ? void 0 : wrapMap[baseValue(wrap, "wrap")], minWidth: 0, ...style },
|
|
289
|
-
...props
|
|
290
|
-
}
|
|
291
|
-
)
|
|
292
|
-
] });
|
|
293
|
-
});
|
|
294
|
-
var GdsCluster = forwardRef(function GdsCluster2({
|
|
295
|
-
align = "center",
|
|
296
|
-
justify = "between",
|
|
297
|
-
gap = "sm",
|
|
298
|
-
...props
|
|
299
|
-
}, ref) {
|
|
300
|
-
return /* @__PURE__ */ jsx(GdsInline, { ref, align, justify, gap, ...props });
|
|
301
|
-
});
|
|
302
|
-
function resolveGridColumns(columns, minColumnWidth) {
|
|
303
|
-
if (typeof columns === "number") {
|
|
304
|
-
return `repeat(${columns}, minmax(0, 1fr))`;
|
|
305
|
-
}
|
|
306
|
-
if (columns === "auto-fill" || columns === "auto-fit") {
|
|
307
|
-
return `repeat(${columns}, minmax(min(100%, ${resolveSize(minColumnWidth)}), 1fr))`;
|
|
308
|
-
}
|
|
309
|
-
return "repeat(1, minmax(0, 1fr))";
|
|
310
|
-
}
|
|
311
|
-
var GdsGrid = forwardRef(function GdsGrid2({
|
|
312
|
-
columns = { base: 1, md: 2 },
|
|
313
|
-
minColumnWidth = "content",
|
|
314
|
-
gap = "md",
|
|
315
|
-
component = "div",
|
|
316
|
-
className,
|
|
317
|
-
style,
|
|
318
|
-
...props
|
|
319
|
-
}, ref) {
|
|
320
|
-
const generatedClassName = composeResponsiveClass({ columns, minColumnWidth });
|
|
321
|
-
const css = responsiveCss(generatedClassName, "grid-template-columns", columns, (value) => resolveGridColumns(value, minColumnWidth), 1);
|
|
322
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
323
|
-
renderResponsiveStyle(css),
|
|
324
|
-
/* @__PURE__ */ jsx(
|
|
325
|
-
GdsBox,
|
|
326
|
-
{
|
|
327
|
-
ref,
|
|
328
|
-
component,
|
|
329
|
-
display: "grid",
|
|
330
|
-
gap,
|
|
331
|
-
className: joinClassNames(generatedClassName, className),
|
|
332
|
-
style: { gridTemplateColumns: hasBreakpoints(columns) ? void 0 : resolveGridColumns(baseValue(columns, 1), minColumnWidth), minWidth: 0, ...style },
|
|
333
|
-
...props
|
|
334
|
-
}
|
|
335
|
-
)
|
|
336
|
-
] });
|
|
337
|
-
});
|
|
338
|
-
var GdsColumnGrid = forwardRef(function GdsColumnGrid2({
|
|
339
|
-
columns = 12,
|
|
340
|
-
gap = "md",
|
|
341
|
-
component = "div",
|
|
342
|
-
className,
|
|
343
|
-
style,
|
|
344
|
-
...props
|
|
345
|
-
}, ref) {
|
|
346
|
-
const generatedClassName = composeResponsiveClass({ columns, type: "column-grid" });
|
|
347
|
-
const css = responsiveCss(generatedClassName, "grid-template-columns", columns, (value) => `repeat(${value}, minmax(0, 1fr))`, 12);
|
|
348
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
349
|
-
renderResponsiveStyle(css),
|
|
350
|
-
/* @__PURE__ */ jsx(
|
|
351
|
-
GdsBox,
|
|
352
|
-
{
|
|
353
|
-
ref,
|
|
354
|
-
component,
|
|
355
|
-
display: "grid",
|
|
356
|
-
gap,
|
|
357
|
-
className: joinClassNames(generatedClassName, className),
|
|
358
|
-
style: { gridTemplateColumns: hasBreakpoints(columns) ? void 0 : `repeat(${baseValue(columns, 12)}, minmax(0, 1fr))`, minWidth: 0, ...style },
|
|
359
|
-
...props
|
|
360
|
-
}
|
|
361
|
-
)
|
|
362
|
-
] });
|
|
363
|
-
});
|
|
364
|
-
var GdsColumnGridItem = forwardRef(function GdsColumnGridItem2({
|
|
365
|
-
span,
|
|
366
|
-
start,
|
|
367
|
-
component = "div",
|
|
368
|
-
className,
|
|
369
|
-
style,
|
|
370
|
-
...props
|
|
371
|
-
}, ref) {
|
|
372
|
-
const generatedClassName = composeResponsiveClass({ span, start, type: "column-grid-item" });
|
|
373
|
-
const css = [
|
|
374
|
-
responsiveCss(generatedClassName, "grid-column-start", start, (value) => value),
|
|
375
|
-
responsiveCss(generatedClassName, "grid-column-end", span, (value) => `span ${value}`)
|
|
376
|
-
].join("");
|
|
377
|
-
const baseSpan = normalizeGdsResponsiveValue(span).base;
|
|
378
|
-
const baseStart = normalizeGdsResponsiveValue(start).base;
|
|
379
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
380
|
-
renderResponsiveStyle(css),
|
|
381
|
-
/* @__PURE__ */ jsx(
|
|
382
|
-
GdsBox,
|
|
383
|
-
{
|
|
384
|
-
ref,
|
|
385
|
-
component,
|
|
386
|
-
className: joinClassNames(generatedClassName, className),
|
|
387
|
-
style: {
|
|
388
|
-
gridColumnStart: hasBreakpoints(start) ? void 0 : baseStart,
|
|
389
|
-
gridColumnEnd: hasBreakpoints(span) || baseSpan === void 0 ? void 0 : `span ${baseSpan}`,
|
|
390
|
-
minWidth: 0,
|
|
391
|
-
...style
|
|
392
|
-
},
|
|
393
|
-
...props
|
|
394
|
-
}
|
|
395
|
-
)
|
|
396
|
-
] });
|
|
397
|
-
});
|
|
398
|
-
function splitTemplate(ratio) {
|
|
399
|
-
const [start, end] = ratio.split(":").map(Number);
|
|
400
|
-
return `minmax(0, ${start}fr) minmax(0, ${end}fr)`;
|
|
401
|
-
}
|
|
402
|
-
var GdsSplit = forwardRef(function GdsSplit2({
|
|
403
|
-
ratio = "1:1",
|
|
404
|
-
collapseBelow = "md",
|
|
405
|
-
gap = "lg",
|
|
406
|
-
className,
|
|
407
|
-
style,
|
|
408
|
-
...props
|
|
409
|
-
}, ref) {
|
|
410
|
-
const generatedClassName = composeResponsiveClass({ ratio, collapseBelow, type: "split" });
|
|
411
|
-
const css = `.${generatedClassName}{grid-template-columns:minmax(0, 1fr);}@media (min-width: ${breakpointPixels[collapseBelow]}px){.${generatedClassName}{grid-template-columns:${splitTemplate(ratio)};}}`;
|
|
412
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
413
|
-
renderResponsiveStyle(css),
|
|
414
|
-
/* @__PURE__ */ jsx(
|
|
415
|
-
GdsBox,
|
|
416
|
-
{
|
|
417
|
-
ref,
|
|
418
|
-
display: "grid",
|
|
419
|
-
gap,
|
|
420
|
-
className: joinClassNames(generatedClassName, className),
|
|
421
|
-
style: { alignItems: "start", ...style },
|
|
422
|
-
...props
|
|
423
|
-
}
|
|
424
|
-
)
|
|
425
|
-
] });
|
|
426
|
-
});
|
|
427
|
-
var GdsSidebar = forwardRef(function GdsSidebar2({
|
|
428
|
-
side = "start",
|
|
429
|
-
sidebarWidth = "content",
|
|
430
|
-
collapseBelow = "md",
|
|
431
|
-
gap = "lg",
|
|
432
|
-
className,
|
|
433
|
-
style,
|
|
434
|
-
...props
|
|
435
|
-
}, ref) {
|
|
436
|
-
const generatedClassName = composeResponsiveClass({ side, sidebarWidth, collapseBelow, type: "sidebar" });
|
|
437
|
-
const sidebarTrack = `minmax(min(100%, ${resolveSize(sidebarWidth)}), ${resolveSize(sidebarWidth)})`;
|
|
438
|
-
const template = side === "start" ? `${sidebarTrack} minmax(0, 1fr)` : `minmax(0, 1fr) ${sidebarTrack}`;
|
|
439
|
-
const css = `.${generatedClassName}{grid-template-columns:minmax(0, 1fr);}@media (min-width: ${breakpointPixels[collapseBelow]}px){.${generatedClassName}{grid-template-columns:${template};}}`;
|
|
440
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
441
|
-
renderResponsiveStyle(css),
|
|
442
|
-
/* @__PURE__ */ jsx(
|
|
443
|
-
GdsBox,
|
|
444
|
-
{
|
|
445
|
-
ref,
|
|
446
|
-
display: "grid",
|
|
447
|
-
gap,
|
|
448
|
-
className: joinClassNames(generatedClassName, className),
|
|
449
|
-
style: { alignItems: "start", ...style },
|
|
450
|
-
...props
|
|
451
|
-
}
|
|
452
|
-
)
|
|
453
|
-
] });
|
|
454
|
-
});
|
|
455
|
-
var GdsBleed = forwardRef(function GdsBleed2({
|
|
456
|
-
bleed = "md",
|
|
457
|
-
className,
|
|
458
|
-
style,
|
|
459
|
-
...props
|
|
460
|
-
}, ref) {
|
|
461
|
-
const generatedClassName = composeResponsiveClass({ bleed, type: "bleed" });
|
|
462
|
-
const css = responsiveCss(generatedClassName, "margin-inline", bleed, (value) => {
|
|
463
|
-
const resolved = resolveSpacing(value);
|
|
464
|
-
return resolved ? `calc(${resolved} * -1)` : void 0;
|
|
465
|
-
}, "md");
|
|
466
|
-
const baseBleed = resolveSpacing(baseValue(bleed, "md"));
|
|
467
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
468
|
-
renderResponsiveStyle(css),
|
|
469
|
-
/* @__PURE__ */ jsx(
|
|
470
|
-
GdsBox,
|
|
471
|
-
{
|
|
472
|
-
ref,
|
|
473
|
-
className: joinClassNames(generatedClassName, className),
|
|
474
|
-
style: { marginInline: !hasBreakpoints(bleed) && baseBleed ? `calc(${baseBleed} * -1)` : void 0, ...style },
|
|
475
|
-
...props
|
|
476
|
-
}
|
|
477
|
-
)
|
|
478
|
-
] });
|
|
479
|
-
});
|
|
480
|
-
var GdsContainer = forwardRef(function GdsContainer2({
|
|
481
|
-
size = "page",
|
|
482
|
-
center = true,
|
|
483
|
-
padding = { base: "md", md: "lg" },
|
|
484
|
-
className,
|
|
485
|
-
style,
|
|
486
|
-
...props
|
|
487
|
-
}, ref) {
|
|
488
|
-
return /* @__PURE__ */ jsx(
|
|
489
|
-
GdsBox,
|
|
490
|
-
{
|
|
491
|
-
ref,
|
|
492
|
-
maxWidth: size,
|
|
493
|
-
padding,
|
|
494
|
-
className,
|
|
495
|
-
style: { width: "100%", marginInline: center ? "auto" : void 0, ...style },
|
|
496
|
-
...props
|
|
497
|
-
}
|
|
498
|
-
);
|
|
499
|
-
});
|
|
500
|
-
|
|
501
|
-
// src/vocabulary.ts
|
|
502
|
-
var GdsVocabulary = {
|
|
503
|
-
settings: { id: "gds.action.settings", defaultMessage: "Settings", icon: GdsIcons.Settings, feedback: { icon: GdsIcons.Settings, color: "teal", messageId: "gds.feedback.saved" }, motion: { press: "turn" } },
|
|
504
|
-
analytics: { id: "gds.action.analytics", defaultMessage: "Analytics", icon: GdsIcons.Analytics, feedback: { icon: GdsIcons.Analytics, color: "teal", messageId: "gds.feedback.loaded" }, motion: { press: "bars" } },
|
|
505
|
-
dashboard: { id: "gds.action.dashboard", defaultMessage: "Dashboard", icon: GdsIcons.Dashboard, feedback: { icon: GdsIcons.Dashboard, color: "teal", messageId: "gds.feedback.loaded" }, motion: { press: "needle" } },
|
|
506
|
-
play: { id: "gds.action.play", defaultMessage: "Play", icon: GdsIcons.Play, feedback: { icon: GdsIcons.Play, color: "teal", messageId: "gds.feedback.started" }, motion: { press: "nudge-right" } },
|
|
507
|
-
start: { id: "gds.action.start", defaultMessage: "Start", icon: GdsIcons.Start, feedback: { icon: GdsIcons.Start, color: "teal", messageId: "gds.feedback.started" }, motion: { press: "launch" } },
|
|
508
|
-
users: { id: "gds.action.users", defaultMessage: "Users", icon: GdsIcons.Users, feedback: { icon: GdsIcons.Users, color: "teal", messageId: "gds.feedback.loaded" }, motion: { press: "join" } },
|
|
509
|
-
add: { id: "gds.action.add", defaultMessage: "Add", icon: GdsIcons.Add, feedback: { icon: GdsIcons.Success, color: "teal", messageId: "gds.feedback.added" }, motion: { press: "quarter", pending: "spinner", success: "turn" } },
|
|
510
|
-
edit: { id: "gds.action.edit", defaultMessage: "Edit", icon: GdsIcons.Edit, feedback: { icon: GdsIcons.Edit, color: "teal", messageId: "gds.feedback.edited" }, motion: { press: "scribble" } },
|
|
511
|
-
delete: { id: "gds.action.delete", defaultMessage: "Delete", icon: GdsIcons.Delete, feedback: { icon: GdsIcons.Success, color: "red", messageId: "gds.feedback.deleted" }, motion: { press: "lid", pending: "spinner", success: "check-pop", confirm: true } },
|
|
512
|
-
save: { id: "gds.action.save", defaultMessage: "Save", icon: GdsIcons.Save, feedback: { icon: GdsIcons.Success, color: "teal", messageId: "gds.feedback.saved" }, motion: { press: "pop", pending: "spinner", success: "check-draw" } },
|
|
513
|
-
cancel: { id: "gds.action.cancel", defaultMessage: "Cancel", icon: GdsIcons.Cancel, feedback: { icon: GdsIcons.Cancel, color: "red", messageId: "gds.feedback.canceled" }, motion: { press: "quarter" } },
|
|
514
|
-
confirm: { id: "gds.action.confirm", defaultMessage: "Confirm", icon: GdsIcons.Confirm, feedback: { icon: GdsIcons.Confirm, color: "teal", messageId: "gds.feedback.confirmed" }, motion: { press: "bounce" } },
|
|
515
|
-
close: { id: "gds.action.close", defaultMessage: "Close", icon: GdsIcons.Close, feedback: { icon: GdsIcons.Close, color: "gray", messageId: "gds.feedback.closed" }, motion: { press: "draw" } },
|
|
516
|
-
language: { id: "gds.action.language", defaultMessage: "Language", icon: GdsIcons.Language, feedback: { icon: GdsIcons.Language, color: "teal", messageId: "gds.feedback.changed" }, motion: { press: "draw-stagger" } },
|
|
517
|
-
theme: { id: "gds.action.theme", defaultMessage: "Theme", icon: GdsIcons.Theme, feedback: { icon: GdsIcons.Theme, color: "teal", messageId: "gds.feedback.changed" }, motion: { press: "rock" } },
|
|
518
|
-
home: { id: "gds.action.home", defaultMessage: "Home", icon: GdsIcons.Home, feedback: { icon: GdsIcons.Home, color: "teal", messageId: "gds.feedback.opened" }, motion: { press: "draw" } },
|
|
519
|
-
inbox: { id: "gds.action.inbox", defaultMessage: "Inbox", icon: GdsIcons.Inbox, feedback: { icon: GdsIcons.Inbox, color: "teal", messageId: "gds.feedback.opened" }, motion: { press: "drop" } },
|
|
520
|
-
calendar: { id: "gds.action.calendar", defaultMessage: "Calendar", icon: GdsIcons.Calendar, feedback: { icon: GdsIcons.Calendar, color: "teal", messageId: "gds.feedback.opened" }, motion: { press: "date" } },
|
|
521
|
-
gallery: { id: "gds.action.gallery", defaultMessage: "Gallery", icon: GdsIcons.Gallery, feedback: { icon: GdsIcons.Gallery, color: "teal", messageId: "gds.feedback.opened" }, motion: { press: "pop" } },
|
|
522
|
-
history: { id: "gds.action.history", defaultMessage: "History", icon: GdsIcons.History, feedback: { icon: GdsIcons.History, color: "teal", messageId: "gds.feedback.opened" }, motion: { press: "rewind" } },
|
|
523
|
-
profile: { id: "gds.action.profile", defaultMessage: "Profile", icon: GdsIcons.Profile, feedback: { icon: GdsIcons.Profile, color: "teal", messageId: "gds.feedback.opened" }, motion: { press: "draw" } },
|
|
524
|
-
send: { id: "gds.action.send", defaultMessage: "Send", icon: GdsIcons.Send, feedback: { icon: GdsIcons.Success, color: "blue", messageId: "gds.feedback.sent" }, motion: { press: "launch", pending: "spinner", success: "fly-off" } },
|
|
525
|
-
reply: { id: "gds.action.reply", defaultMessage: "Reply", icon: GdsIcons.Reply, feedback: { icon: GdsIcons.Reply, color: "blue", messageId: "gds.feedback.replied" }, motion: { press: "nudge-left" } },
|
|
526
|
-
forward: { id: "gds.action.forward", defaultMessage: "Forward", icon: GdsIcons.Forward, feedback: { icon: GdsIcons.Forward, color: "blue", messageId: "gds.feedback.forwarded" }, motion: { press: "nudge-right" } },
|
|
527
|
-
attach: { id: "gds.action.attach", defaultMessage: "Attach", icon: GdsIcons.Attach, feedback: { icon: GdsIcons.Attach, color: "teal", messageId: "gds.feedback.attached" }, motion: { press: "swing" } },
|
|
528
|
-
upload: { id: "gds.action.upload", defaultMessage: "Upload", icon: GdsIcons.Upload, feedback: { icon: GdsIcons.Success, color: "teal", messageId: "gds.feedback.uploaded" }, motion: { press: "nudge-up-right", pending: "bob-up", success: "check-draw" } },
|
|
529
|
-
download: { id: "gds.action.download", defaultMessage: "Download", icon: GdsIcons.Download, feedback: { icon: GdsIcons.Success, color: "teal", messageId: "gds.feedback.downloaded" }, motion: { press: "drop", pending: "bob-down", success: "check-draw" } },
|
|
530
|
-
print: { id: "gds.action.print", defaultMessage: "Print", icon: GdsIcons.Print, feedback: { icon: GdsIcons.Print, color: "teal", messageId: "gds.feedback.printed" }, motion: { press: "feed", pending: "feed" } },
|
|
531
|
-
copy: { id: "gds.action.copy", defaultMessage: "Copy", icon: GdsIcons.Copy, feedback: { icon: GdsIcons.Success, color: "teal", messageId: "gds.feedback.copied" }, motion: { press: "separate", pending: "spinner", success: "check-pop" } },
|
|
532
|
-
duplicate: { id: "gds.action.duplicate", defaultMessage: "Duplicate", icon: GdsIcons.Duplicate, feedback: { icon: GdsIcons.Duplicate, color: "teal", messageId: "gds.feedback.duplicated" }, motion: { press: "separate" } },
|
|
533
|
-
check: { id: "gds.action.check", defaultMessage: "Check", icon: GdsIcons.Check, feedback: { icon: GdsIcons.Check, color: "teal", messageId: "gds.feedback.checked" }, motion: { press: "draw-last" } },
|
|
534
|
-
uncheck: { id: "gds.action.uncheck", defaultMessage: "Uncheck", icon: GdsIcons.Uncheck, feedback: { icon: GdsIcons.Uncheck, color: "red", messageId: "gds.feedback.unchecked" }, motion: { press: "draw-last" } },
|
|
535
|
-
complete: { id: "gds.action.complete", defaultMessage: "Complete", icon: GdsIcons.Complete, feedback: { icon: GdsIcons.Complete, color: "teal", messageId: "gds.feedback.completed" }, motion: { press: "draw-stagger", pending: "spinner", success: "draw" } },
|
|
536
|
-
clear: { id: "gds.action.clear", defaultMessage: "Clear", icon: GdsIcons.Clear, feedback: { icon: GdsIcons.Clear, color: "red", messageId: "gds.feedback.cleared" }, motion: { press: "sweep" } },
|
|
537
|
-
capture: { id: "gds.action.capture", defaultMessage: "Capture", icon: GdsIcons.Capture, feedback: { icon: GdsIcons.Capture, color: "teal", messageId: "gds.feedback.captured" }, motion: { press: "shutter" } },
|
|
538
|
-
record: { id: "gds.action.record", defaultMessage: "Record", icon: GdsIcons.Record, feedback: { icon: GdsIcons.Record, color: "teal", messageId: "gds.feedback.recorded" }, motion: { press: "pop", pending: "breathe" } },
|
|
539
|
-
flip: { id: "gds.action.flip", defaultMessage: "Flip", icon: GdsIcons.Flip, feedback: { icon: GdsIcons.Flip, color: "teal", messageId: "gds.feedback.flipped" }, motion: { press: "flip" } },
|
|
540
|
-
flash: { id: "gds.action.flash", defaultMessage: "Flash", icon: GdsIcons.Flash, feedback: { icon: GdsIcons.Flash, color: "teal", messageId: "gds.feedback.flashed" }, motion: { press: "flicker" } },
|
|
541
|
-
course: { id: "gds.action.course", defaultMessage: "Course", icon: GdsIcons.Course, feedback: { icon: GdsIcons.Course, color: "teal", messageId: "gds.feedback.done" }, motion: { press: "page" } },
|
|
542
|
-
lesson: { id: "gds.action.lesson", defaultMessage: "Lesson", icon: GdsIcons.Lesson, feedback: { icon: GdsIcons.Lesson, color: "teal", messageId: "gds.feedback.done" }, motion: { press: "page" } },
|
|
543
|
-
certificate: { id: "gds.action.certificate", defaultMessage: "Certificate", icon: GdsIcons.Certificate, feedback: { icon: GdsIcons.Certificate, color: "teal", messageId: "gds.feedback.done" }, motion: { press: "celebrate" } },
|
|
544
|
-
student: { id: "gds.action.student", defaultMessage: "Student", icon: GdsIcons.Student, feedback: { icon: GdsIcons.Student, color: "teal", messageId: "gds.feedback.done" }, motion: { press: "bounce" } },
|
|
545
|
-
class: { id: "gds.action.class", defaultMessage: "Class", icon: GdsIcons.Class, feedback: { icon: GdsIcons.Class, color: "teal", messageId: "gds.feedback.done" }, motion: { press: "page" } },
|
|
546
|
-
grade: { id: "gds.action.grade", defaultMessage: "Grade", icon: GdsIcons.Grade, feedback: { icon: GdsIcons.Grade, color: "teal", messageId: "gds.feedback.done" }, motion: { press: "celebrate" } },
|
|
547
|
-
child: { id: "gds.action.child", defaultMessage: "Child", icon: GdsIcons.Child, feedback: { icon: GdsIcons.Child, color: "teal", messageId: "gds.feedback.done" }, motion: { press: "bounce" } },
|
|
548
|
-
family: { id: "gds.action.family", defaultMessage: "Family", icon: GdsIcons.Family, feedback: { icon: GdsIcons.Family, color: "teal", messageId: "gds.feedback.done" }, motion: { press: "bounce" } },
|
|
549
|
-
habit: { id: "gds.action.habit", defaultMessage: "Habit", icon: GdsIcons.Habit, feedback: { icon: GdsIcons.Habit, color: "teal", messageId: "gds.feedback.done" }, motion: { press: "rings", pending: "rings" } },
|
|
550
|
-
goal: { id: "gds.action.goal", defaultMessage: "Goal", icon: GdsIcons.Goal, feedback: { icon: GdsIcons.Goal, color: "teal", messageId: "gds.feedback.done" }, motion: { press: "wave" } },
|
|
551
|
-
streak: { id: "gds.action.streak", defaultMessage: "Streak", icon: GdsIcons.Streak, feedback: { icon: GdsIcons.Streak, color: "teal", messageId: "gds.feedback.done" }, motion: { press: "draw" } },
|
|
552
|
-
reward: { id: "gds.action.reward", defaultMessage: "Reward", icon: GdsIcons.Reward, feedback: { icon: GdsIcons.Reward, color: "yellow", messageId: "gds.feedback.rewarded" }, motion: { press: "pop", pending: "spinner", success: "pop" } },
|
|
553
|
-
trophy: { id: "gds.action.trophy", defaultMessage: "Trophy", icon: GdsIcons.Trophy, feedback: { icon: GdsIcons.Trophy, color: "yellow", messageId: "gds.feedback.rewarded" }, motion: { press: "celebrate" } },
|
|
554
|
-
crown: { id: "gds.action.crown", defaultMessage: "Crown", icon: GdsIcons.Crown, feedback: { icon: GdsIcons.Crown, color: "yellow", messageId: "gds.feedback.rewarded" }, motion: { press: "celebrate" } },
|
|
555
|
-
pause: { id: "gds.action.pause", defaultMessage: "Pause", icon: GdsIcons.Pause, feedback: { icon: GdsIcons.Pause, color: "teal", messageId: "gds.feedback.paused" }, motion: { press: "dip" } },
|
|
556
|
-
message: { id: "gds.action.message", defaultMessage: "Message", icon: GdsIcons.Message, feedback: { icon: GdsIcons.Message, color: "blue", messageId: "gds.feedback.sent" }, motion: { press: "bounce" } },
|
|
557
|
-
mail: { id: "gds.action.mail", defaultMessage: "Mail", icon: GdsIcons.Mail, feedback: { icon: GdsIcons.Mail, color: "blue", messageId: "gds.feedback.mailed" }, motion: { press: "flap" } },
|
|
558
|
-
refresh: { id: "gds.action.refresh", defaultMessage: "Refresh", icon: GdsIcons.Refresh, feedback: { icon: GdsIcons.Success, color: "teal", messageId: "gds.feedback.refreshed" }, motion: { press: "rewind", pending: "spin", success: "check-pop" } },
|
|
559
|
-
trendingUp: { id: "gds.action.trendingUp", defaultMessage: "Trending Up", icon: GdsIcons.TrendingUp, feedback: { icon: GdsIcons.TrendingUp, color: "teal", messageId: "gds.feedback.done" }, motion: { press: "nudge-up-right" } },
|
|
560
|
-
trendingDown: { id: "gds.action.trendingDown", defaultMessage: "Trending Down", icon: GdsIcons.TrendingDown, feedback: { icon: GdsIcons.TrendingDown, color: "teal", messageId: "gds.feedback.done" }, motion: { press: "nudge-down-right" } },
|
|
561
|
-
currency: { id: "gds.action.currency", defaultMessage: "Currency", icon: GdsIcons.Currency, feedback: { icon: GdsIcons.Currency, color: "teal", messageId: "gds.feedback.done" }, motion: { press: "flip" } },
|
|
562
|
-
grid: { id: "gds.action.grid", defaultMessage: "Grid", icon: GdsIcons.Grid, feedback: { icon: GdsIcons.Grid, color: "teal", messageId: "gds.feedback.done" }, motion: { press: "cells" } },
|
|
563
|
-
list: { id: "gds.action.list", defaultMessage: "List", icon: GdsIcons.List, feedback: { icon: GdsIcons.List, color: "teal", messageId: "gds.feedback.done" }, motion: { press: "rows" } },
|
|
564
|
-
logout: { id: "gds.action.logout", defaultMessage: "Logout", icon: GdsIcons.Logout, feedback: { icon: GdsIcons.Logout, color: "teal", messageId: "gds.feedback.loggedOut" }, motion: { press: "arrow-out" } },
|
|
565
|
-
notifications: { id: "gds.action.notifications", defaultMessage: "Notifications", icon: GdsIcons.Notifications, feedback: { icon: GdsIcons.Notifications, color: "teal", messageId: "gds.feedback.done" }, motion: { press: "ring" } },
|
|
566
|
-
back: { id: "gds.action.back", defaultMessage: "Back", icon: GdsIcons.Back, feedback: { icon: GdsIcons.Back, color: "teal", messageId: "gds.feedback.done" }, motion: { press: "nudge-left" } },
|
|
567
|
-
eye: { id: "gds.action.eye", defaultMessage: "View", icon: GdsIcons.Eye, feedback: { icon: GdsIcons.Eye, color: "teal", messageId: "gds.feedback.done" }, motion: { press: "blink" } },
|
|
568
|
-
eyeOff: { id: "gds.action.eyeOff", defaultMessage: "Hide", icon: GdsIcons.EyeOff, feedback: { icon: GdsIcons.EyeOff, color: "teal", messageId: "gds.feedback.done" }, motion: { press: "draw-last" } },
|
|
569
|
-
help: { id: "gds.action.help", defaultMessage: "Help", icon: GdsIcons.Help, feedback: { icon: GdsIcons.Help, color: "teal", messageId: "gds.feedback.done" }, motion: { press: "rock" } },
|
|
570
|
-
filter: { id: "gds.action.filter", defaultMessage: "Filter", icon: GdsIcons.Filter, feedback: { icon: GdsIcons.Filter, color: "teal", messageId: "gds.feedback.filtered" }, motion: { press: "squeeze" } },
|
|
571
|
-
sort: { id: "gds.action.sort", defaultMessage: "Sort", icon: GdsIcons.Sort, feedback: { icon: GdsIcons.Sort, color: "teal", messageId: "gds.feedback.sorted" }, motion: { press: "swap" } },
|
|
572
|
-
export: { id: "gds.action.export", defaultMessage: "Export", icon: GdsIcons.Export, feedback: { icon: GdsIcons.Export, color: "teal", messageId: "gds.feedback.exported" }, motion: { press: "nudge-up-right", pending: "bob-up" } },
|
|
573
|
-
import: { id: "gds.action.import", defaultMessage: "Import", icon: GdsIcons.Import, feedback: { icon: GdsIcons.Import, color: "teal", messageId: "gds.feedback.imported" }, motion: { press: "drop", pending: "bob-down" } },
|
|
574
|
-
preview: { id: "gds.action.preview", defaultMessage: "Preview", icon: GdsIcons.Preview, feedback: { icon: GdsIcons.Preview, color: "teal", messageId: "gds.feedback.previewed" }, motion: { press: "blink" } },
|
|
575
|
-
clone: { id: "gds.action.clone", defaultMessage: "Clone", icon: GdsIcons.Clone, feedback: { icon: GdsIcons.Clone, color: "teal", messageId: "gds.feedback.cloned" }, motion: { press: "separate" } },
|
|
576
|
-
restore: { id: "gds.action.restore", defaultMessage: "Restore", icon: GdsIcons.Restore, feedback: { icon: GdsIcons.Restore, color: "teal", messageId: "gds.feedback.restored" }, motion: { press: "rewind", pending: "rewind" } },
|
|
577
|
-
toggle: { id: "gds.action.toggle", defaultMessage: "Toggle", icon: GdsIcons.Toggle, feedback: { icon: GdsIcons.Toggle, color: "teal", messageId: "gds.feedback.toggled" }, motion: { press: "knob" } },
|
|
578
|
-
search: { id: "gds.action.search", defaultMessage: "Search", icon: GdsIcons.Search, feedback: { icon: GdsIcons.Search, color: "teal", messageId: "gds.feedback.searched" }, motion: { press: "orbit", pending: "orbit" } },
|
|
579
|
-
submit: { id: "gds.action.submit", defaultMessage: "Submit", icon: GdsIcons.Submit, feedback: { icon: GdsIcons.Submit, color: "teal", messageId: "gds.feedback.submitted" }, motion: { press: "draw" } },
|
|
580
|
-
reset: { id: "gds.action.reset", defaultMessage: "Reset", icon: GdsIcons.Reset, feedback: { icon: GdsIcons.Reset, color: "red", messageId: "gds.feedback.reset" }, motion: { press: "rewind", pending: "rewind" } },
|
|
581
|
-
login: { id: "gds.action.login", defaultMessage: "Login", icon: GdsIcons.Login, feedback: { icon: GdsIcons.Login, color: "teal", messageId: "gds.feedback.loggedIn" }, motion: { press: "arrow-in" } },
|
|
582
|
-
register: { id: "gds.action.register", defaultMessage: "Register", icon: GdsIcons.Register, feedback: { icon: GdsIcons.Register, color: "teal", messageId: "gds.feedback.registered" }, motion: { press: "plus" } },
|
|
583
|
-
verify: { id: "gds.action.verify", defaultMessage: "Verify", icon: GdsIcons.Verify, feedback: { icon: GdsIcons.Verify, color: "teal", messageId: "gds.feedback.verified" }, motion: { press: "draw-last" } },
|
|
584
|
-
launch: { id: "gds.action.launch", defaultMessage: "Launch", icon: GdsIcons.Launch, feedback: { icon: GdsIcons.Launch, color: "purple", messageId: "gds.feedback.launched" }, motion: { press: "launch" } },
|
|
585
|
-
draft: { id: "gds.action.draft", defaultMessage: "Draft", icon: GdsIcons.Draft, feedback: { icon: GdsIcons.Draft, color: "teal", messageId: "gds.feedback.drafted" }, motion: { press: "scribble" } },
|
|
586
|
-
refer: { id: "gds.action.refer", defaultMessage: "Refer", icon: GdsIcons.Refer, feedback: { icon: GdsIcons.Refer, color: "teal", messageId: "gds.feedback.referred" }, motion: { press: "share" } },
|
|
587
|
-
evidence: { id: "gds.action.evidence", defaultMessage: "Evidence", icon: GdsIcons.Evidence, feedback: { icon: GdsIcons.Evidence, color: "teal", messageId: "gds.feedback.added" }, motion: { press: "swing" } }
|
|
588
|
-
};
|
|
589
|
-
function createGdsVocabularyPack(namespace, actions) {
|
|
590
|
-
return {
|
|
591
|
-
namespace,
|
|
592
|
-
actions: Object.fromEntries(
|
|
593
|
-
Object.entries(actions).map(([key, definition]) => [
|
|
594
|
-
`${namespace}:${key}`,
|
|
595
|
-
{
|
|
596
|
-
...definition,
|
|
597
|
-
id: `gds.action.${namespace}.${key}`
|
|
598
|
-
}
|
|
599
|
-
])
|
|
600
|
-
)
|
|
601
|
-
};
|
|
602
|
-
}
|
|
603
|
-
function mergeGdsVocabularyPacks(packs = []) {
|
|
604
|
-
return packs.reduce((acc, pack) => {
|
|
605
|
-
for (const [key, definition] of Object.entries(pack.actions)) {
|
|
606
|
-
acc[key] = definition;
|
|
607
|
-
}
|
|
608
|
-
return acc;
|
|
609
|
-
}, {});
|
|
610
|
-
}
|
|
611
|
-
function resolveSemanticActionConfig(action, packs = []) {
|
|
612
|
-
const baseConfig = GdsVocabulary[action];
|
|
613
|
-
if (baseConfig) {
|
|
614
|
-
return baseConfig;
|
|
615
|
-
}
|
|
616
|
-
const merged = mergeGdsVocabularyPacks(packs);
|
|
617
|
-
const packConfig = merged[action];
|
|
618
|
-
if (packConfig) {
|
|
619
|
-
return packConfig;
|
|
620
|
-
}
|
|
621
|
-
throw new Error(`Unknown semantic action: ${action}`);
|
|
622
|
-
}
|
|
623
|
-
function getSemanticActionConfig(action, packs = []) {
|
|
624
|
-
return resolveSemanticActionConfig(action, packs);
|
|
625
|
-
}
|
|
626
|
-
function getSemanticActionLabel(action, translate, packs = []) {
|
|
627
|
-
const config = resolveSemanticActionConfig(action, packs);
|
|
628
|
-
return translate ? translate(config.id, config.defaultMessage) : config.defaultMessage;
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
// src/GdsBadge.tsx
|
|
632
|
-
import { Badge } from "@mantine/core";
|
|
633
|
-
import { GDS_ACCENT_NAMES, GDS_ACCENT_SHADES, gdsDevWarnOnce, resolveGdsAccentTokens, useGdsBadgeIconStyle } from "@sovereignsquad/gds-theme";
|
|
634
|
-
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
635
|
-
var toneColors = {
|
|
636
|
-
success: { bg: "var(--gds-badge-solid-success)", fg: "var(--gds-badge-solid-success-fg)" },
|
|
637
|
-
warning: { bg: "var(--gds-badge-solid-warning)", fg: "var(--gds-badge-solid-warning-fg)" },
|
|
638
|
-
danger: { bg: "var(--gds-badge-solid-danger)", fg: "var(--gds-badge-solid-danger-fg)" },
|
|
639
|
-
info: { bg: "var(--gds-badge-solid-info)", fg: "var(--gds-badge-solid-info-fg)" },
|
|
640
|
-
neutral: {
|
|
641
|
-
bg: "var(--gds-bg-card, var(--mantine-color-gray-1, #f1f3f5))",
|
|
642
|
-
fg: "var(--gds-text-primary, var(--mantine-color-dark-7, #1f2937))",
|
|
643
|
-
border: "1px solid var(--gds-border-card, var(--mantine-color-gray-4, #ced4da))"
|
|
644
|
-
}
|
|
645
|
-
};
|
|
646
|
-
var gdsResolvedAccentTokens = resolveGdsAccentTokens(void 0, "light");
|
|
647
|
-
var accentToken = (accent, shade = "base") => `var(--gds-accent-${accent}-${shade}, ${gdsResolvedAccentTokens[`--gds-accent-${accent}-${shade}`]})`;
|
|
648
|
-
var gdsBadgeAccentColors = Object.fromEntries(
|
|
649
|
-
GDS_ACCENT_NAMES.map((name) => [name, gdsResolvedAccentTokens[`--gds-accent-${name}-base`]])
|
|
650
|
-
);
|
|
651
|
-
var gdsBadgeAccentShades = Object.fromEntries(
|
|
652
|
-
GDS_ACCENT_NAMES.map((name) => [
|
|
653
|
-
name,
|
|
654
|
-
Object.fromEntries(GDS_ACCENT_SHADES.map((shade) => [shade, gdsResolvedAccentTokens[`--gds-accent-${name}-${shade}`]]))
|
|
655
|
-
])
|
|
656
|
-
);
|
|
657
|
-
function GdsBadgeEmojiCoin({ emoji }) {
|
|
658
|
-
return /* @__PURE__ */ jsx2(
|
|
659
|
-
"span",
|
|
660
|
-
{
|
|
661
|
-
"data-gds-badge-emoji-coin": "",
|
|
662
|
-
"aria-hidden": "true",
|
|
663
|
-
style: {
|
|
664
|
-
display: "inline-flex",
|
|
665
|
-
alignItems: "center",
|
|
666
|
-
justifyContent: "center",
|
|
667
|
-
width: "1.35em",
|
|
668
|
-
height: "1.35em",
|
|
669
|
-
borderRadius: "50%",
|
|
670
|
-
background: "var(--mantine-color-dark-7, #1f2937)",
|
|
671
|
-
fontSize: "0.75em",
|
|
672
|
-
lineHeight: 1,
|
|
673
|
-
flexShrink: 0
|
|
674
|
-
},
|
|
675
|
-
children: emoji
|
|
676
|
-
}
|
|
677
|
-
);
|
|
678
|
-
}
|
|
679
|
-
function GdsBadge(props) {
|
|
680
|
-
const { label, icon, shape, tone, accent, emoji, iconStyle, style, ...rest } = props;
|
|
681
|
-
const resolvedIconStyle = useGdsBadgeIconStyle(iconStyle);
|
|
682
|
-
if (!label) {
|
|
683
|
-
return null;
|
|
684
|
-
}
|
|
685
|
-
const colors = accent ? { bg: accentToken(accent), fg: `var(--gds-accent-${accent}-on, #ffffff)` } : toneColors[tone ?? "neutral"];
|
|
686
|
-
const useEmoji = resolvedIconStyle === "emoji" && Boolean(emoji);
|
|
687
|
-
let leading = null;
|
|
688
|
-
if (useEmoji) {
|
|
689
|
-
if (shape) {
|
|
690
|
-
gdsDevWarnOnce(
|
|
691
|
-
"GdsBadge:emoji-with-shape",
|
|
692
|
-
"GdsBadge received both `shape` and an active `emoji` glyph \u2014 shape composition is not supported in emoji mode yet, so `shape` is ignored and the emoji renders on its own disc instead."
|
|
693
|
-
);
|
|
694
|
-
}
|
|
695
|
-
leading = /* @__PURE__ */ jsx2(GdsBadgeEmojiCoin, { emoji });
|
|
696
|
-
} else if (shape) {
|
|
697
|
-
const Shape = GdsBadgeShapes[shape];
|
|
698
|
-
leading = /* @__PURE__ */ jsxs2(GdsBadgeStack, { size: "1.1em", children: [
|
|
699
|
-
/* @__PURE__ */ jsx2(GdsBadgeStackLayer, { children: /* @__PURE__ */ jsx2(Shape, { size: "100%", stroke: 1.75, "aria-hidden": "true" }) }),
|
|
700
|
-
icon ? /* @__PURE__ */ jsx2(
|
|
701
|
-
GdsBadgeStackLayer,
|
|
702
|
-
{
|
|
703
|
-
scale: shape === "pin" ? 0.42 : 0.55,
|
|
704
|
-
style: shape === "pin" ? { transform: "translateY(-4.1667%) scale(0.42)" } : void 0,
|
|
705
|
-
children: /* @__PURE__ */ jsx2(GdsIcon, { icon, size: "100%" })
|
|
706
|
-
}
|
|
707
|
-
) : null
|
|
708
|
-
] });
|
|
709
|
-
} else if (icon) {
|
|
710
|
-
leading = /* @__PURE__ */ jsx2(GdsIcon, { icon, size: "xs" });
|
|
711
|
-
}
|
|
712
|
-
return /* @__PURE__ */ jsx2(
|
|
713
|
-
Badge,
|
|
714
|
-
{
|
|
715
|
-
"data-gds-badge": "",
|
|
716
|
-
"data-gds-badge-fixed-tone": "true",
|
|
717
|
-
variant: "filled",
|
|
718
|
-
leftSection: leading,
|
|
719
|
-
...rest,
|
|
720
|
-
style: { backgroundColor: colors.bg, color: colors.fg, border: colors.border ?? "none", ...style },
|
|
721
|
-
children: label
|
|
722
|
-
}
|
|
723
|
-
);
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
// src/SectionPanel.tsx
|
|
727
|
-
import { Box as Box2, Divider, Group, Paper, Stack, Text, Title } from "@mantine/core";
|
|
728
|
-
import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
729
|
-
var toneBackgrounds = {
|
|
730
|
-
default: "var(--mantine-color-body)",
|
|
731
|
-
supporting: "light-dark(var(--mantine-color-gray-0), color-mix(in srgb, var(--mantine-color-dark-7) 92%, black))",
|
|
732
|
-
warning: "light-dark(var(--mantine-color-yellow-0), color-mix(in srgb, var(--mantine-color-yellow-9) 18%, var(--mantine-color-body)))",
|
|
733
|
-
critical: "light-dark(var(--mantine-color-red-0), color-mix(in srgb, var(--mantine-color-red-9) 18%, var(--mantine-color-body)))"
|
|
734
|
-
};
|
|
735
|
-
function SectionPanel({
|
|
736
|
-
eyebrow,
|
|
737
|
-
title,
|
|
738
|
-
titleOrder = 3,
|
|
739
|
-
description,
|
|
740
|
-
action,
|
|
741
|
-
children,
|
|
742
|
-
tone = "default",
|
|
743
|
-
id,
|
|
744
|
-
divided = true,
|
|
745
|
-
presentation = "inline",
|
|
746
|
-
minHeight,
|
|
747
|
-
contentAlign,
|
|
748
|
-
contentJustify
|
|
749
|
-
}) {
|
|
750
|
-
const bodyLayout = resolveSurfacePresentationStyles({
|
|
751
|
-
presentation,
|
|
752
|
-
minHeight,
|
|
753
|
-
contentAlign,
|
|
754
|
-
contentJustify
|
|
755
|
-
});
|
|
756
|
-
return (
|
|
757
|
-
// Responsive padding, not a flat `p="lg"`: this Paper is the outer shell
|
|
758
|
-
// every SectionPanel consumer nests further Paper-based cards inside (see
|
|
759
|
-
// ReferenceThemeExplorer's grid cards). Two flat-`lg` Paper shells
|
|
760
|
-
// stacking their own full padding ate up to ~35% of a narrow mobile
|
|
761
|
-
// viewport in unusable side margin before either card's own content
|
|
762
|
-
// started — confirmed live on a 390px viewport. `radius` drops one token
|
|
763
|
-
// (`xl` → `lg`) rather than going responsive: Mantine's `radius` prop is
|
|
764
|
-
// typed as a single `MantineRadius`, not the breakpoint-object `StyleProp`
|
|
765
|
-
// that spacing props like `p` accept, and a flat `lg` still keeps the
|
|
766
|
-
// corner proportional enough not to visually clip content at the new
|
|
767
|
-
// smaller mobile padding (the original `xl` would, at `xs` padding).
|
|
768
|
-
/* @__PURE__ */ jsx3(
|
|
769
|
-
Paper,
|
|
770
|
-
{
|
|
771
|
-
id,
|
|
772
|
-
"data-gds-section-panel": "",
|
|
773
|
-
withBorder: true,
|
|
774
|
-
radius: "lg",
|
|
775
|
-
p: { base: "xs", sm: "sm", md: "lg" },
|
|
776
|
-
style: { background: toneBackgrounds[tone] },
|
|
777
|
-
children: /* @__PURE__ */ jsxs3(Stack, { gap: "md", children: [
|
|
778
|
-
eyebrow || title || description || action ? /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
779
|
-
/* @__PURE__ */ jsxs3(Group, { justify: "space-between", align: "flex-start", gap: "md", wrap: "wrap", children: [
|
|
780
|
-
eyebrow || title || description ? /* @__PURE__ */ jsxs3(Stack, { gap: 4, children: [
|
|
781
|
-
eyebrow ? /* @__PURE__ */ jsx3(Text, { size: "xs", fw: 700, c: "dimmed", children: eyebrow }) : null,
|
|
782
|
-
title ? /* @__PURE__ */ jsx3(Title, { order: titleOrder, children: title }) : null,
|
|
783
|
-
description ? /* @__PURE__ */ jsx3(Text, { size: "sm", c: "dimmed", children: description }) : null
|
|
784
|
-
] }) : null,
|
|
785
|
-
action
|
|
786
|
-
] }),
|
|
787
|
-
divided ? /* @__PURE__ */ jsx3(Divider, {}) : null
|
|
788
|
-
] }) : null,
|
|
789
|
-
/* @__PURE__ */ jsx3(Box2, { style: bodyLayout, children })
|
|
790
|
-
] })
|
|
791
|
-
}
|
|
792
|
-
)
|
|
793
|
-
);
|
|
794
|
-
}
|
|
795
|
-
|
|
796
|
-
// src/ReferenceSection.tsx
|
|
797
|
-
import { Anchor } from "@mantine/core";
|
|
798
|
-
import { useGdsTranslation } from "@sovereignsquad/gds-theme";
|
|
799
|
-
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
800
|
-
function ReferenceSection({
|
|
801
|
-
title,
|
|
802
|
-
description,
|
|
803
|
-
eyebrow,
|
|
804
|
-
action,
|
|
805
|
-
href,
|
|
806
|
-
linkLabel,
|
|
807
|
-
tone = "default",
|
|
808
|
-
id,
|
|
809
|
-
children
|
|
810
|
-
}) {
|
|
811
|
-
const { t } = useGdsTranslation();
|
|
812
|
-
return /* @__PURE__ */ jsx4(
|
|
813
|
-
SectionPanel,
|
|
814
|
-
{
|
|
815
|
-
id,
|
|
816
|
-
tone,
|
|
817
|
-
eyebrow,
|
|
818
|
-
title,
|
|
819
|
-
description,
|
|
820
|
-
action: action ?? (href ? /* @__PURE__ */ jsx4(Anchor, { href, fw: 600, children: linkLabel ?? t("gds.reference.openSection", "Open section") }) : null),
|
|
821
|
-
divided: false,
|
|
822
|
-
children
|
|
823
|
-
}
|
|
824
|
-
);
|
|
825
|
-
}
|
|
826
|
-
|
|
827
|
-
// src/ActionBar.tsx
|
|
828
|
-
import { ActionIcon, Button, Group as Group2, Stack as Stack2 } from "@mantine/core";
|
|
829
|
-
import { useGdsTranslation as useGdsTranslation2 } from "@sovereignsquad/gds-theme";
|
|
830
|
-
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
831
|
-
function renderSemanticAction(action, slot, vocabularyPacks, t) {
|
|
832
|
-
const { action: actionId, variant, ariaLabel, ...props } = action;
|
|
833
|
-
const fallbackVariant = slot === "primary" ? "filled" : slot === "secondary" ? "default" : "subtle";
|
|
834
|
-
const config = resolveSemanticActionConfig(actionId, vocabularyPacks);
|
|
835
|
-
const Icon = config.icon;
|
|
836
|
-
const label = getSemanticActionLabel(actionId, t, vocabularyPacks);
|
|
837
|
-
return /* @__PURE__ */ jsx5(
|
|
838
|
-
Button,
|
|
839
|
-
{
|
|
840
|
-
leftSection: /* @__PURE__ */ jsx5(Icon, { size: "1rem", stroke: 1.75 }),
|
|
841
|
-
"aria-label": ariaLabel ?? label,
|
|
842
|
-
variant: variant ?? fallbackVariant,
|
|
843
|
-
...props,
|
|
844
|
-
children: label
|
|
845
|
-
},
|
|
846
|
-
`${slot}-${actionId}`
|
|
847
|
-
);
|
|
848
|
-
}
|
|
849
|
-
function ActionBar({
|
|
850
|
-
primary,
|
|
851
|
-
secondary = [],
|
|
852
|
-
tertiary = [],
|
|
853
|
-
iconOnly = [],
|
|
854
|
-
gap = "sm",
|
|
855
|
-
vocabularyPacks = []
|
|
856
|
-
}) {
|
|
857
|
-
const { t } = useGdsTranslation2();
|
|
858
|
-
return /* @__PURE__ */ jsx5(Stack2, { gap, children: /* @__PURE__ */ jsxs4(Group2, { justify: "space-between", align: "center", gap, wrap: "wrap", children: [
|
|
859
|
-
/* @__PURE__ */ jsxs4(Group2, { gap, wrap: "wrap", children: [
|
|
860
|
-
secondary.map((action) => renderSemanticAction(action, "secondary", vocabularyPacks, t)),
|
|
861
|
-
tertiary.map((action) => renderSemanticAction(action, "tertiary", vocabularyPacks, t))
|
|
862
|
-
] }),
|
|
863
|
-
/* @__PURE__ */ jsxs4(Group2, { gap, wrap: "wrap", justify: "flex-end", children: [
|
|
864
|
-
iconOnly.map(({ action, ariaLabel, ...props }) => {
|
|
865
|
-
const config = resolveSemanticActionConfig(action, vocabularyPacks);
|
|
866
|
-
const Icon = config.icon;
|
|
867
|
-
return /* @__PURE__ */ jsx5(
|
|
868
|
-
ActionIcon,
|
|
869
|
-
{
|
|
870
|
-
variant: "subtle",
|
|
871
|
-
size: "lg",
|
|
872
|
-
"aria-label": ariaLabel ?? getSemanticActionLabel(action, t, vocabularyPacks),
|
|
873
|
-
...props,
|
|
874
|
-
children: /* @__PURE__ */ jsx5(Icon, { size: "1rem", stroke: 1.75 })
|
|
875
|
-
},
|
|
876
|
-
`icon-${action}`
|
|
877
|
-
);
|
|
878
|
-
}),
|
|
879
|
-
primary ? renderSemanticAction(primary, "primary", vocabularyPacks, t) : null
|
|
880
|
-
] })
|
|
881
|
-
] }) });
|
|
882
|
-
}
|
|
883
|
-
|
|
884
|
-
// src/generated-art-engine.ts
|
|
885
|
-
import { mixCssColors, resolveGdsAccentTokens as resolveGdsAccentTokens2 } from "@sovereignsquad/gds-theme";
|
|
886
|
-
import { getGdsVibeThemeCssVariables, resolveGdsVibeTheme } from "@sovereignsquad/gds-theme";
|
|
887
|
-
var gdsResolvedAccentFallback = resolveGdsAccentTokens2(void 0, "light");
|
|
888
|
-
function gdsSeededRandom(seed) {
|
|
889
|
-
let hash = 2166136261;
|
|
890
|
-
for (let i = 0; i < seed.length; i += 1) {
|
|
891
|
-
hash ^= seed.charCodeAt(i);
|
|
892
|
-
hash = Math.imul(hash, 16777619);
|
|
893
|
-
}
|
|
894
|
-
let state = hash >>> 0;
|
|
895
|
-
return () => {
|
|
896
|
-
state |= 0;
|
|
897
|
-
state = state + 1831565813 | 0;
|
|
898
|
-
let t = Math.imul(state ^ state >>> 15, 1 | state);
|
|
899
|
-
t = t + Math.imul(t ^ t >>> 7, 61 | t) ^ t;
|
|
900
|
-
return ((t ^ t >>> 14) >>> 0) / 4294967296;
|
|
901
|
-
};
|
|
902
|
-
}
|
|
903
|
-
var DEFAULT_VIBE = resolveGdsVibeTheme("default");
|
|
904
|
-
function resolveCategoryColorToken(options) {
|
|
905
|
-
if (!options.category) {
|
|
906
|
-
throw new Error("gds-core generated-art-engine: paletteSource 'category' requires a `category` option (a GdsBadgeAccentName).");
|
|
907
|
-
}
|
|
908
|
-
const shade = options.shade ?? "base";
|
|
909
|
-
return `var(--gds-accent-${options.category}-${shade}, ${gdsResolvedAccentFallback[`--gds-accent-${options.category}-${shade}`]})`;
|
|
910
|
-
}
|
|
911
|
-
function resolveCategoryColorHex(options) {
|
|
912
|
-
if (!options.category) {
|
|
913
|
-
throw new Error("gds-core generated-art-engine: paletteSource 'category' requires a `category` option (a GdsBadgeAccentName).");
|
|
914
|
-
}
|
|
915
|
-
const shade = options.shade ?? "base";
|
|
916
|
-
const tokens = options.themePresetId ? getGdsVibeThemeCssVariables(options.themePresetId, options.colorScheme ?? "light") : gdsResolvedAccentFallback;
|
|
917
|
-
const resolved = tokens[`--gds-accent-${options.category}-${shade}`];
|
|
918
|
-
if (!resolved) {
|
|
919
|
-
throw new Error(
|
|
920
|
-
`gds-core generated-art-engine: no resolved value for --gds-accent-${options.category}-${shade}. A missing accent token must fail here rather than emit an unpainted shape.`
|
|
921
|
-
);
|
|
922
|
-
}
|
|
923
|
-
return resolved;
|
|
924
|
-
}
|
|
925
|
-
function applyCssTint(color, options) {
|
|
926
|
-
if (!options.tintWithBackground || options.mixRatio === void 0) {
|
|
927
|
-
return color;
|
|
928
|
-
}
|
|
929
|
-
return `color-mix(in srgb, ${color} ${Math.round(options.mixRatio * 100)}%, ${options.tintWithBackground})`;
|
|
930
|
-
}
|
|
931
|
-
function gdsGeneratedPaletteCssRefs(options = {}) {
|
|
932
|
-
if (options.colors) {
|
|
933
|
-
return { ...options.colors, source: "override" };
|
|
934
|
-
}
|
|
935
|
-
const source = options.paletteSource ?? "theme";
|
|
936
|
-
if (source === "category") {
|
|
937
|
-
const color = applyCssTint(resolveCategoryColorToken(options), options);
|
|
938
|
-
return { primary: color, accent: color, source: "category" };
|
|
939
|
-
}
|
|
940
|
-
return {
|
|
941
|
-
primary: applyCssTint(`var(--gds-brand-primary, ${DEFAULT_VIBE.primary})`, options),
|
|
942
|
-
accent: applyCssTint(`var(--gds-brand-accent, ${DEFAULT_VIBE.accent})`, options),
|
|
943
|
-
source: "theme"
|
|
944
|
-
};
|
|
945
|
-
}
|
|
946
|
-
function applyHexTint(color, options) {
|
|
947
|
-
if (!options.tintWithBackground || options.mixRatio === void 0) {
|
|
948
|
-
return color;
|
|
949
|
-
}
|
|
950
|
-
return mixCssColors(color, options.tintWithBackground, options.mixRatio, "#ffffff");
|
|
951
|
-
}
|
|
952
|
-
function resolveGdsGeneratedPaletteHex(options = {}) {
|
|
953
|
-
if (options.colors) {
|
|
954
|
-
return { ...options.colors, source: "override" };
|
|
955
|
-
}
|
|
956
|
-
const source = options.paletteSource ?? "theme";
|
|
957
|
-
if (source === "category") {
|
|
958
|
-
const color = applyHexTint(resolveCategoryColorHex(options), options);
|
|
959
|
-
return { primary: color, accent: color, source: "category" };
|
|
960
|
-
}
|
|
961
|
-
if (!options.themePresetId) {
|
|
962
|
-
throw new Error(
|
|
963
|
-
"gds-core generated-art-engine: resolveGdsGeneratedPaletteHex with paletteSource 'theme' requires either `themePresetId` (one of the built-in presets) or an explicit `colors` override for a custom brand theme \u2014 there is no live DOM to read CSS variables from outside a browser."
|
|
964
|
-
);
|
|
965
|
-
}
|
|
966
|
-
const variables = getGdsVibeThemeCssVariables(options.themePresetId, options.colorScheme ?? "light");
|
|
967
|
-
return {
|
|
968
|
-
primary: applyHexTint(variables["--gds-brand-primary"] ?? DEFAULT_VIBE.primary, options),
|
|
969
|
-
accent: applyHexTint(variables["--gds-brand-accent"] ?? DEFAULT_VIBE.accent, options),
|
|
970
|
-
source: "theme"
|
|
971
|
-
};
|
|
972
|
-
}
|
|
973
|
-
|
|
974
|
-
// src/GdsGeneratedThumbnail.tsx
|
|
975
|
-
import { cloneElement, isValidElement, useId, useMemo } from "react";
|
|
976
|
-
import { Fragment as Fragment3, jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
977
|
-
var ASPECT_RATIO_VIEWBOX = {
|
|
978
|
-
"3:2": { width: 300, height: 200 },
|
|
979
|
-
"16:9": { width: 320, height: 180 },
|
|
980
|
-
"4:3": { width: 320, height: 240 },
|
|
981
|
-
"1:1": { width: 240, height: 240 }
|
|
982
|
-
};
|
|
983
|
-
var isIconKey = (icon) => typeof icon === "string";
|
|
984
|
-
function renderIcon(icon, size = "100%") {
|
|
985
|
-
if (isIconKey(icon)) {
|
|
986
|
-
return /* @__PURE__ */ jsx6(GdsIcon, { icon, size, tone: "default" });
|
|
987
|
-
}
|
|
988
|
-
if (isValidElement(icon)) {
|
|
989
|
-
return cloneElement(icon, { stroke: 1.75 });
|
|
990
|
-
}
|
|
991
|
-
return icon;
|
|
992
|
-
}
|
|
993
|
-
function darkSurface(colorRef) {
|
|
994
|
-
return `color-mix(in srgb, ${colorRef} 30%, black)`;
|
|
995
|
-
}
|
|
996
|
-
function computeMotifTransform(seed, viewBoxWidth, viewBoxHeight) {
|
|
997
|
-
const next = gdsSeededRandom(seed);
|
|
998
|
-
const rotationDeg = (next() - 0.5) * 26;
|
|
999
|
-
const scale = viewBoxHeight / 24 * (1.7 + next() * 0.3);
|
|
1000
|
-
const centerX = viewBoxWidth * (0.78 + (next() - 0.5) * 0.12);
|
|
1001
|
-
const centerY = viewBoxHeight * (0.28 + (next() - 0.5) * 0.14);
|
|
1002
|
-
return { rotationDeg, scale, centerX, centerY };
|
|
1003
|
-
}
|
|
1004
|
-
function computeMosaicTiles(seed, viewBoxWidth, viewBoxHeight) {
|
|
1005
|
-
const next = gdsSeededRandom(`${seed}:mosaic`);
|
|
1006
|
-
const columns = 9;
|
|
1007
|
-
const rows = 4;
|
|
1008
|
-
const cellWidth = viewBoxWidth / columns;
|
|
1009
|
-
const cellHeight = viewBoxHeight / rows;
|
|
1010
|
-
const tiles = [];
|
|
1011
|
-
for (let row = 0; row < rows; row += 1) {
|
|
1012
|
-
for (let col = 0; col < columns; col += 1) {
|
|
1013
|
-
if (next() < 0.32) {
|
|
1014
|
-
continue;
|
|
1015
|
-
}
|
|
1016
|
-
const inset = 0.08 + next() * 0.1;
|
|
1017
|
-
tiles.push({
|
|
1018
|
-
x: col * cellWidth + cellWidth * inset,
|
|
1019
|
-
y: row * cellHeight + cellHeight * inset,
|
|
1020
|
-
width: cellWidth * (1 - inset * 2),
|
|
1021
|
-
height: cellHeight * (1 - inset * 2),
|
|
1022
|
-
opacity: 0.05 + next() * 0.11,
|
|
1023
|
-
usePrimary: next() < 0.5
|
|
1024
|
-
});
|
|
1025
|
-
}
|
|
1026
|
-
}
|
|
1027
|
-
return tiles;
|
|
1028
|
-
}
|
|
1029
|
-
function computeIconFieldPlacements(seed, count, viewBoxWidth, viewBoxHeight) {
|
|
1030
|
-
const next = gdsSeededRandom(`${seed}:icon-field`);
|
|
1031
|
-
return Array.from({ length: count }, () => ({
|
|
1032
|
-
x: viewBoxWidth * (0.08 + next() * 0.84),
|
|
1033
|
-
y: viewBoxHeight * (0.1 + next() * 0.8),
|
|
1034
|
-
size: viewBoxHeight * (0.22 + next() * 0.16),
|
|
1035
|
-
rotationDeg: (next() - 0.5) * 40
|
|
1036
|
-
}));
|
|
1037
|
-
}
|
|
1038
|
-
function renderBackground(background, categories, seed, palette, viewBoxWidth, viewBoxHeight) {
|
|
1039
|
-
if (background === "mosaic-abstract") {
|
|
1040
|
-
const tiles = computeMosaicTiles(seed, viewBoxWidth, viewBoxHeight);
|
|
1041
|
-
return /* @__PURE__ */ jsx6(Fragment3, { children: tiles.map((tile, index) => /* @__PURE__ */ jsx6(
|
|
1042
|
-
"rect",
|
|
1043
|
-
{
|
|
1044
|
-
x: tile.x,
|
|
1045
|
-
y: tile.y,
|
|
1046
|
-
width: tile.width,
|
|
1047
|
-
height: tile.height,
|
|
1048
|
-
rx: Math.min(tile.width, tile.height) * 0.12,
|
|
1049
|
-
fill: tile.usePrimary ? palette.primary : palette.accent,
|
|
1050
|
-
opacity: tile.opacity
|
|
1051
|
-
},
|
|
1052
|
-
index
|
|
1053
|
-
)) });
|
|
1054
|
-
}
|
|
1055
|
-
if (background === "icon-field") {
|
|
1056
|
-
if (categories.length === 0) {
|
|
1057
|
-
return null;
|
|
1058
|
-
}
|
|
1059
|
-
const next = gdsSeededRandom(`${seed}:icon-field-pick`);
|
|
1060
|
-
const placements = computeIconFieldPlacements(seed, Math.min(categories.length, 8), viewBoxWidth, viewBoxHeight);
|
|
1061
|
-
return /* @__PURE__ */ jsx6(Fragment3, { children: placements.map((placement, index) => {
|
|
1062
|
-
const entry = categories[Math.floor(next() * categories.length)];
|
|
1063
|
-
return /* @__PURE__ */ jsx6(
|
|
1064
|
-
"g",
|
|
1065
|
-
{
|
|
1066
|
-
transform: `translate(${placement.x} ${placement.y}) rotate(${placement.rotationDeg}) scale(${placement.size / 24})`,
|
|
1067
|
-
opacity: 0.1,
|
|
1068
|
-
style: { color: "var(--gds-text-on-inverse, var(--mantine-color-white))" },
|
|
1069
|
-
children: /* @__PURE__ */ jsx6("svg", { x: -12, y: -12, width: 24, height: 24, viewBox: "0 0 24 24", children: renderIcon(entry.icon) })
|
|
1070
|
-
},
|
|
1071
|
-
index
|
|
1072
|
-
);
|
|
1073
|
-
}) });
|
|
1074
|
-
}
|
|
1075
|
-
return /* @__PURE__ */ jsx6(Fragment3, { children: background.regions.map((region, index) => {
|
|
1076
|
-
const weight = region.weight ?? 1;
|
|
1077
|
-
return /* @__PURE__ */ jsx6(
|
|
1078
|
-
"rect",
|
|
1079
|
-
{
|
|
1080
|
-
x: region.x0 * viewBoxWidth,
|
|
1081
|
-
y: region.y0 * viewBoxHeight,
|
|
1082
|
-
width: (region.x1 - region.x0) * viewBoxWidth,
|
|
1083
|
-
height: (region.y1 - region.y0) * viewBoxHeight,
|
|
1084
|
-
fill: palette.accent,
|
|
1085
|
-
opacity: Math.min(0.85, 0.06 + weight * 0.05)
|
|
1086
|
-
},
|
|
1087
|
-
index
|
|
1088
|
-
);
|
|
1089
|
-
}) });
|
|
1090
|
-
}
|
|
1091
|
-
function GdsGeneratedThumbnail({
|
|
1092
|
-
seed,
|
|
1093
|
-
categories,
|
|
1094
|
-
paletteSource,
|
|
1095
|
-
category,
|
|
1096
|
-
shade,
|
|
1097
|
-
colors,
|
|
1098
|
-
tintWithBackground,
|
|
1099
|
-
mixRatio,
|
|
1100
|
-
aspectRatio = "3:2",
|
|
1101
|
-
maxBadges = 3,
|
|
1102
|
-
badges = "ranked",
|
|
1103
|
-
motifOpacity = 0.14,
|
|
1104
|
-
background = "wash",
|
|
1105
|
-
label,
|
|
1106
|
-
className,
|
|
1107
|
-
style
|
|
1108
|
-
}) {
|
|
1109
|
-
if (categories.length === 0) {
|
|
1110
|
-
throw new Error("GdsGeneratedThumbnail: `categories` must contain at least one entry.");
|
|
1111
|
-
}
|
|
1112
|
-
const gradientId = useId();
|
|
1113
|
-
const palette = useMemo(
|
|
1114
|
-
() => gdsGeneratedPaletteCssRefs({ paletteSource, category, shade, colors, tintWithBackground, mixRatio }),
|
|
1115
|
-
[paletteSource, category, shade, colors, tintWithBackground, mixRatio]
|
|
1116
|
-
);
|
|
1117
|
-
const { width: viewBoxWidth, height: viewBoxHeight } = ASPECT_RATIO_VIEWBOX[aspectRatio];
|
|
1118
|
-
const motif = useMemo(() => computeMotifTransform(seed, viewBoxWidth, viewBoxHeight), [seed, viewBoxWidth, viewBoxHeight]);
|
|
1119
|
-
const lead = categories[0];
|
|
1120
|
-
const secondary = categories.slice(1, Math.max(maxBadges, 1));
|
|
1121
|
-
const inverseColor = "var(--gds-text-on-inverse, var(--mantine-color-white))";
|
|
1122
|
-
const pillBg = darkSurface(palette.accent);
|
|
1123
|
-
return /* @__PURE__ */ jsxs5(
|
|
1124
|
-
"div",
|
|
1125
|
-
{
|
|
1126
|
-
"data-gds-generated-thumbnail": "",
|
|
1127
|
-
role: label ? "group" : void 0,
|
|
1128
|
-
"aria-label": label || void 0,
|
|
1129
|
-
className,
|
|
1130
|
-
style: {
|
|
1131
|
-
position: "relative",
|
|
1132
|
-
aspectRatio: aspectRatio.replace(":", " / "),
|
|
1133
|
-
overflow: "hidden",
|
|
1134
|
-
borderRadius: "var(--mantine-radius-md, 12px)",
|
|
1135
|
-
...style
|
|
1136
|
-
},
|
|
1137
|
-
children: [
|
|
1138
|
-
/* @__PURE__ */ jsxs5(
|
|
1139
|
-
"svg",
|
|
1140
|
-
{
|
|
1141
|
-
viewBox: `0 0 ${viewBoxWidth} ${viewBoxHeight}`,
|
|
1142
|
-
preserveAspectRatio: "xMidYMid slice",
|
|
1143
|
-
"aria-hidden": "true",
|
|
1144
|
-
style: { position: "absolute", inset: 0, width: "100%", height: "100%", display: "block" },
|
|
1145
|
-
children: [
|
|
1146
|
-
/* @__PURE__ */ jsx6("defs", { children: /* @__PURE__ */ jsxs5("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
1147
|
-
/* @__PURE__ */ jsx6("stop", { offset: "0%", stopColor: palette.primary }),
|
|
1148
|
-
/* @__PURE__ */ jsx6("stop", { offset: "100%", stopColor: darkSurface(palette.primary) })
|
|
1149
|
-
] }) }),
|
|
1150
|
-
/* @__PURE__ */ jsx6("rect", { width: viewBoxWidth, height: viewBoxHeight, fill: `url(#${gradientId})` }),
|
|
1151
|
-
background === "wash" ? /* @__PURE__ */ jsx6(
|
|
1152
|
-
"g",
|
|
1153
|
-
{
|
|
1154
|
-
transform: `translate(${motif.centerX} ${motif.centerY}) rotate(${motif.rotationDeg}) scale(${motif.scale})`,
|
|
1155
|
-
opacity: motifOpacity,
|
|
1156
|
-
style: { color: inverseColor },
|
|
1157
|
-
children: /* @__PURE__ */ jsx6("svg", { x: -12, y: -12, width: 24, height: 24, viewBox: "0 0 24 24", children: renderIcon(lead.icon) })
|
|
1158
|
-
}
|
|
1159
|
-
) : renderBackground(background, categories, seed, palette, viewBoxWidth, viewBoxHeight)
|
|
1160
|
-
]
|
|
1161
|
-
}
|
|
1162
|
-
),
|
|
1163
|
-
badges === "none" ? null : /* @__PURE__ */ jsxs5(
|
|
1164
|
-
"div",
|
|
1165
|
-
{
|
|
1166
|
-
style: {
|
|
1167
|
-
position: "absolute",
|
|
1168
|
-
insetInline: 0,
|
|
1169
|
-
insetBlockEnd: 0,
|
|
1170
|
-
padding: "var(--gds-space-xs) var(--gds-space-sm)",
|
|
1171
|
-
display: "flex",
|
|
1172
|
-
alignItems: "center",
|
|
1173
|
-
background: `linear-gradient(to top, ${darkSurface(palette.primary)} 0%, transparent 100%)`
|
|
1174
|
-
},
|
|
1175
|
-
children: [
|
|
1176
|
-
(() => {
|
|
1177
|
-
const LeadTag = lead.onSelect ? "button" : "span";
|
|
1178
|
-
return /* @__PURE__ */ jsxs5(
|
|
1179
|
-
LeadTag,
|
|
1180
|
-
{
|
|
1181
|
-
"data-gds-generated-thumbnail-badge": "lead",
|
|
1182
|
-
type: lead.onSelect ? "button" : void 0,
|
|
1183
|
-
onClick: lead.onSelect ? () => lead.onSelect?.(lead.key) : void 0,
|
|
1184
|
-
style: {
|
|
1185
|
-
display: "inline-flex",
|
|
1186
|
-
alignItems: "center",
|
|
1187
|
-
gap: "0.35em",
|
|
1188
|
-
padding: "0.3em 0.65em 0.3em 0.45em",
|
|
1189
|
-
borderRadius: "var(--gds-radius-pill)",
|
|
1190
|
-
background: pillBg,
|
|
1191
|
-
color: inverseColor,
|
|
1192
|
-
fontSize: "13px",
|
|
1193
|
-
fontWeight: 600,
|
|
1194
|
-
lineHeight: 1.2,
|
|
1195
|
-
whiteSpace: "nowrap",
|
|
1196
|
-
border: "none",
|
|
1197
|
-
font: lead.onSelect ? "inherit" : void 0,
|
|
1198
|
-
cursor: lead.onSelect ? "pointer" : void 0
|
|
1199
|
-
},
|
|
1200
|
-
children: [
|
|
1201
|
-
/* @__PURE__ */ jsx6("span", { "aria-hidden": "true", style: { width: "1.1em", height: "1.1em", display: "inline-flex" }, children: renderIcon(lead.icon, "100%") }),
|
|
1202
|
-
lead.label
|
|
1203
|
-
]
|
|
1204
|
-
}
|
|
1205
|
-
);
|
|
1206
|
-
})(),
|
|
1207
|
-
secondary.map((entry, index) => {
|
|
1208
|
-
const SecondaryTag = entry.onSelect ? "button" : "span";
|
|
1209
|
-
return /* @__PURE__ */ jsx6(
|
|
1210
|
-
SecondaryTag,
|
|
1211
|
-
{
|
|
1212
|
-
"data-gds-generated-thumbnail-badge": "secondary",
|
|
1213
|
-
type: entry.onSelect ? "button" : void 0,
|
|
1214
|
-
onClick: entry.onSelect ? () => entry.onSelect?.(entry.key) : void 0,
|
|
1215
|
-
role: entry.onSelect ? void 0 : "img",
|
|
1216
|
-
"aria-label": entry.label,
|
|
1217
|
-
title: entry.onSelect ? void 0 : entry.label,
|
|
1218
|
-
style: {
|
|
1219
|
-
display: "inline-flex",
|
|
1220
|
-
alignItems: "center",
|
|
1221
|
-
justifyContent: "center",
|
|
1222
|
-
width: "1.9em",
|
|
1223
|
-
height: "1.9em",
|
|
1224
|
-
marginInlineStart: index === 0 ? "-0.3em" : "-0.5em",
|
|
1225
|
-
borderRadius: "50%",
|
|
1226
|
-
background: pillBg,
|
|
1227
|
-
color: inverseColor,
|
|
1228
|
-
border: "2px solid " + darkSurface(palette.primary),
|
|
1229
|
-
opacity: 1 - index * 0.12,
|
|
1230
|
-
flexShrink: 0,
|
|
1231
|
-
font: entry.onSelect ? "inherit" : void 0,
|
|
1232
|
-
cursor: entry.onSelect ? "pointer" : void 0
|
|
1233
|
-
},
|
|
1234
|
-
children: /* @__PURE__ */ jsx6("span", { "aria-hidden": "true", style: { width: "1em", height: "1em", display: "inline-flex" }, children: renderIcon(entry.icon, "100%") })
|
|
1235
|
-
},
|
|
1236
|
-
entry.key
|
|
1237
|
-
);
|
|
1238
|
-
})
|
|
1239
|
-
]
|
|
1240
|
-
}
|
|
1241
|
-
)
|
|
1242
|
-
]
|
|
1243
|
-
}
|
|
1244
|
-
);
|
|
1245
|
-
}
|
|
1246
|
-
|
|
1247
|
-
// src/CardContracts.ts
|
|
1248
|
-
var gdsCardSizePaddingMap = {
|
|
1249
|
-
xs: "xs",
|
|
1250
|
-
sm: "sm",
|
|
1251
|
-
md: "md",
|
|
1252
|
-
lg: "lg",
|
|
1253
|
-
xl: "xl"
|
|
1254
|
-
};
|
|
1255
|
-
var gdsCardDensityPaddingMap = {
|
|
1256
|
-
xs: { compact: "xs", comfortable: "xs", spacious: "sm" },
|
|
1257
|
-
sm: { compact: "xs", comfortable: "sm", spacious: "md" },
|
|
1258
|
-
md: { compact: "sm", comfortable: "md", spacious: "lg" },
|
|
1259
|
-
lg: { compact: "md", comfortable: "lg", spacious: "xl" },
|
|
1260
|
-
xl: { compact: "lg", comfortable: "xl", spacious: "xl" }
|
|
1261
|
-
};
|
|
1262
|
-
var gdsCardTitleOrderMap = {
|
|
1263
|
-
xs: 6,
|
|
1264
|
-
sm: 5,
|
|
1265
|
-
md: 4,
|
|
1266
|
-
lg: 4,
|
|
1267
|
-
xl: 3
|
|
1268
|
-
};
|
|
1269
|
-
var gdsCardGapMap = {
|
|
1270
|
-
compact: "sm",
|
|
1271
|
-
comfortable: "md",
|
|
1272
|
-
spacious: "lg"
|
|
1273
|
-
};
|
|
1274
|
-
var gdsCardMediaRatioMap = {
|
|
1275
|
-
default: 4 / 3,
|
|
1276
|
-
"media-top": 4 / 3,
|
|
1277
|
-
"media-left": 1,
|
|
1278
|
-
compact: 16 / 9
|
|
1279
|
-
};
|
|
1280
|
-
function resolveGdsCardContract({
|
|
1281
|
-
size = "md",
|
|
1282
|
-
density = "comfortable",
|
|
1283
|
-
variant = "default",
|
|
1284
|
-
compact = false
|
|
1285
|
-
} = {}) {
|
|
1286
|
-
const resolvedSize = compact ? "sm" : size;
|
|
1287
|
-
const resolvedDensity = compact ? "compact" : density;
|
|
1288
|
-
const resolvedVariant = compact ? "compact" : variant;
|
|
1289
|
-
return {
|
|
1290
|
-
size: resolvedSize,
|
|
1291
|
-
density: resolvedDensity,
|
|
1292
|
-
variant: resolvedVariant,
|
|
1293
|
-
padding: gdsCardDensityPaddingMap[resolvedSize][resolvedDensity],
|
|
1294
|
-
gap: gdsCardGapMap[resolvedDensity],
|
|
1295
|
-
titleOrder: gdsCardTitleOrderMap[resolvedSize],
|
|
1296
|
-
descriptionClamp: resolvedDensity === "compact" ? 2 : resolvedSize === "xl" ? 4 : 3,
|
|
1297
|
-
mediaRatio: gdsCardMediaRatioMap[resolvedVariant],
|
|
1298
|
-
mediaPlacement: resolvedVariant === "media-left" ? "left" : "top",
|
|
1299
|
-
actionWrap: resolvedDensity === "compact" ? "nowrap" : "wrap",
|
|
1300
|
-
minTouchTarget: resolvedDensity === "compact" ? 40 : 44,
|
|
1301
|
-
dataAttributes: {
|
|
1302
|
-
"data-gds-card-size": resolvedSize,
|
|
1303
|
-
"data-gds-card-density": resolvedDensity,
|
|
1304
|
-
"data-gds-card-variant": resolvedVariant
|
|
1305
|
-
}
|
|
1306
|
-
};
|
|
1307
|
-
}
|
|
1308
|
-
|
|
1309
|
-
// src/ListingCard.tsx
|
|
1310
|
-
import { useState } from "react";
|
|
1311
|
-
import { useGdsTranslation as useGdsTranslation3 } from "@sovereignsquad/gds-theme";
|
|
1312
|
-
import { ActionIcon as ActionIcon2, Badge as Badge2, Box as Box3, Card, Group as Group3, Stack as Stack3, Text as Text2, Title as Title2 } from "@mantine/core";
|
|
1313
|
-
import { Fragment as Fragment4, jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1314
|
-
var toneColorMap = {
|
|
1315
|
-
default: void 0,
|
|
1316
|
-
positive: "teal",
|
|
1317
|
-
warning: "orange",
|
|
1318
|
-
muted: "gray"
|
|
1319
|
-
};
|
|
1320
|
-
var MAX_LISTING_CARD_ACTIONS = 4;
|
|
1321
|
-
var GDS_LISTING_TILE_SIZE_PX = 96;
|
|
1322
|
-
var GDS_LISTING_PICK_BADGE_INSET_PX = 6;
|
|
1323
|
-
var GDS_LISTING_PICK_BADGE_ICON_PX = 9;
|
|
1324
|
-
var GDS_LISTING_PICK_BADGE_FONT_SIZE_PX = 9;
|
|
1325
|
-
var GDS_LISTING_PICK_BADGE_LINE_HEIGHT_PX = 13.5;
|
|
1326
|
-
var GDS_LISTING_PICK_BADGE_PADDING_BLOCK_PX = 2;
|
|
1327
|
-
var GDS_LISTING_PICK_BADGE_PADDING_INLINE_PX = 6;
|
|
1328
|
-
function resolveCardActions(actions) {
|
|
1329
|
-
if (!actions || actions.length === 0) {
|
|
1330
|
-
return null;
|
|
1331
|
-
}
|
|
1332
|
-
if (actions.length > MAX_LISTING_CARD_ACTIONS) {
|
|
1333
|
-
throw new Error(`ListingCard supports at most ${MAX_LISTING_CARD_ACTIONS} actions, received ${actions.length}.`);
|
|
1334
|
-
}
|
|
1335
|
-
return actions;
|
|
1336
|
-
}
|
|
1337
|
-
function isNestedInteractiveTarget(eventTarget, currentTarget) {
|
|
1338
|
-
if (!(eventTarget instanceof Element) || !(currentTarget instanceof Element)) {
|
|
1339
|
-
return false;
|
|
1340
|
-
}
|
|
1341
|
-
const nestedInteractive = eventTarget.closest('a, button, input, select, textarea, [role="button"], [role="link"]');
|
|
1342
|
-
return Boolean(nestedInteractive && nestedInteractive !== currentTarget);
|
|
1343
|
-
}
|
|
1344
|
-
function ListingImageFallback({
|
|
1345
|
-
mediaRatio,
|
|
1346
|
-
seed,
|
|
1347
|
-
title
|
|
1348
|
-
}) {
|
|
1349
|
-
return /* @__PURE__ */ jsx7(
|
|
1350
|
-
GdsGeneratedThumbnail,
|
|
1351
|
-
{
|
|
1352
|
-
seed,
|
|
1353
|
-
categories: [{ key: "listing", label: title, icon: "Gallery" }],
|
|
1354
|
-
badges: "none",
|
|
1355
|
-
aspectRatio: mediaRatio === "1:1" ? "1:1" : mediaRatio === "16:9" ? "16:9" : "4:3"
|
|
1356
|
-
}
|
|
1357
|
-
);
|
|
1358
|
-
}
|
|
1359
|
-
function ListingAffordance({ affordance }) {
|
|
1360
|
-
const config = GdsVocabulary[affordance.action];
|
|
1361
|
-
const Icon = config.icon;
|
|
1362
|
-
const label = affordance.ariaLabel ?? getSemanticActionLabel(affordance.action);
|
|
1363
|
-
const onMedia = affordance.presentation === "outline-on-media";
|
|
1364
|
-
const mediaStyle = onMedia ? {
|
|
1365
|
-
background: "transparent",
|
|
1366
|
-
color: "var(--gds-text-on-inverse, var(--mantine-color-white))",
|
|
1367
|
-
filter: "drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55))"
|
|
1368
|
-
} : void 0;
|
|
1369
|
-
const activeStyle = affordance.active ? {
|
|
1370
|
-
// Accent on its own tint is 1.60:1 in high-contrast dark; use the tint's derived foreground.
|
|
1371
|
-
color: "var(--gds-brand-accent-tint-fg, var(--gds-brand-accent-action, var(--gds-vibe-accent, var(--mantine-primary-color-filled))))",
|
|
1372
|
-
background: "var(--gds-brand-accent-tint, var(--mantine-color-default-hover))"
|
|
1373
|
-
} : void 0;
|
|
1374
|
-
if (affordance.href) {
|
|
1375
|
-
return /* @__PURE__ */ jsx7(
|
|
1376
|
-
ActionIcon2,
|
|
1377
|
-
{
|
|
1378
|
-
component: "a",
|
|
1379
|
-
href: affordance.href,
|
|
1380
|
-
variant: onMedia ? "transparent" : "subtle",
|
|
1381
|
-
size: "xl",
|
|
1382
|
-
"aria-label": label,
|
|
1383
|
-
"data-gds-active": affordance.active ? "true" : void 0,
|
|
1384
|
-
style: { ...mediaStyle, ...activeStyle },
|
|
1385
|
-
disabled: affordance.disabled,
|
|
1386
|
-
children: /* @__PURE__ */ jsx7(Icon, { size: "1rem", stroke: 1.75 })
|
|
1387
|
-
}
|
|
1388
|
-
);
|
|
1389
|
-
}
|
|
1390
|
-
return /* @__PURE__ */ jsx7(
|
|
1391
|
-
ActionIcon2,
|
|
1392
|
-
{
|
|
1393
|
-
variant: onMedia ? "transparent" : "subtle",
|
|
1394
|
-
size: "xl",
|
|
1395
|
-
"aria-label": label,
|
|
1396
|
-
onClick: affordance.onClick,
|
|
1397
|
-
"data-gds-active": affordance.active ? "true" : void 0,
|
|
1398
|
-
style: { ...mediaStyle, ...activeStyle },
|
|
1399
|
-
disabled: affordance.disabled,
|
|
1400
|
-
children: /* @__PURE__ */ jsx7(Icon, { size: "1rem", stroke: 1.75 })
|
|
1401
|
-
}
|
|
1402
|
-
);
|
|
1403
|
-
}
|
|
1404
|
-
function ListingPickBadge({
|
|
1405
|
-
config,
|
|
1406
|
-
defaultLabel
|
|
1407
|
-
}) {
|
|
1408
|
-
const override = typeof config === "object" ? config : void 0;
|
|
1409
|
-
const label = override?.label ?? defaultLabel;
|
|
1410
|
-
const ariaLabel = override?.ariaLabel ?? (typeof label === "string" ? label : defaultLabel);
|
|
1411
|
-
return /* @__PURE__ */ jsxs6(
|
|
1412
|
-
Group3,
|
|
1413
|
-
{
|
|
1414
|
-
gap: 4,
|
|
1415
|
-
wrap: "nowrap",
|
|
1416
|
-
align: "center",
|
|
1417
|
-
role: "group",
|
|
1418
|
-
"aria-label": ariaLabel,
|
|
1419
|
-
"data-gds-listing-pick-badge": true,
|
|
1420
|
-
style: {
|
|
1421
|
-
width: "fit-content",
|
|
1422
|
-
borderRadius: "var(--gds-radius-pill)",
|
|
1423
|
-
backgroundColor: "var(--gds-badge-pick-bg, color-mix(in srgb, var(--gds-text-primary) 60%, transparent))",
|
|
1424
|
-
color: "var(--gds-text-on-inverse, var(--mantine-color-white))",
|
|
1425
|
-
fontSize: `${GDS_LISTING_PICK_BADGE_FONT_SIZE_PX}px`,
|
|
1426
|
-
lineHeight: `${GDS_LISTING_PICK_BADGE_LINE_HEIGHT_PX}px`,
|
|
1427
|
-
fontWeight: 700,
|
|
1428
|
-
paddingBlock: `${GDS_LISTING_PICK_BADGE_PADDING_BLOCK_PX}px`,
|
|
1429
|
-
paddingInline: `${GDS_LISTING_PICK_BADGE_PADDING_INLINE_PX}px`
|
|
1430
|
-
},
|
|
1431
|
-
children: [
|
|
1432
|
-
/* @__PURE__ */ jsx7(GdsIcons.Star, { size: GDS_LISTING_PICK_BADGE_ICON_PX, stroke: 1.75, fill: "currentColor", "aria-hidden": "true" }),
|
|
1433
|
-
/* @__PURE__ */ jsx7("span", { children: label })
|
|
1434
|
-
]
|
|
1435
|
-
}
|
|
1436
|
-
);
|
|
1437
|
-
}
|
|
1438
|
-
function ListingCard({
|
|
1439
|
-
title,
|
|
1440
|
-
href,
|
|
1441
|
-
description,
|
|
1442
|
-
image,
|
|
1443
|
-
imageAlt,
|
|
1444
|
-
mediaSeed,
|
|
1445
|
-
mediaRatio = "4:3",
|
|
1446
|
-
metadata = [],
|
|
1447
|
-
featured = false,
|
|
1448
|
-
selected = false,
|
|
1449
|
-
sponsoredDisclosure,
|
|
1450
|
-
price,
|
|
1451
|
-
rating,
|
|
1452
|
-
ratingLabel: ratingLabelProp,
|
|
1453
|
-
primaryAction,
|
|
1454
|
-
reason,
|
|
1455
|
-
reasonLabel: reasonLabelProp,
|
|
1456
|
-
score,
|
|
1457
|
-
actions,
|
|
1458
|
-
mediaOverlay,
|
|
1459
|
-
mediaAffordance,
|
|
1460
|
-
pickBadge,
|
|
1461
|
-
saveAction,
|
|
1462
|
-
saved = false,
|
|
1463
|
-
shareAction,
|
|
1464
|
-
compact = false,
|
|
1465
|
-
size = "md",
|
|
1466
|
-
density = "comfortable",
|
|
1467
|
-
variant = "default",
|
|
1468
|
-
interactiveMode = "none",
|
|
1469
|
-
revealContent,
|
|
1470
|
-
onSurfaceActivate,
|
|
1471
|
-
defaultFlipped = false
|
|
1472
|
-
}) {
|
|
1473
|
-
const { t } = useGdsTranslation3();
|
|
1474
|
-
const ratingLabel = ratingLabelProp ?? t("gds.listingCard.ratingLabel", "Rating");
|
|
1475
|
-
const reasonLabel = reasonLabelProp ?? t("gds.listingCard.reasonLabel", "Why this fits");
|
|
1476
|
-
const featuredLabel = t("gds.listingCard.featuredLabel", "Featured");
|
|
1477
|
-
const pickLabel = t("gds.listingCard.pickLabel", "Pick");
|
|
1478
|
-
const [flipped, setFlipped] = useState(defaultFlipped);
|
|
1479
|
-
const resolvedActions = resolveCardActions(actions);
|
|
1480
|
-
const contract = resolveGdsCardContract({ compact, size, density, variant });
|
|
1481
|
-
const resolvedSaveAction = saveAction ? { ...saveAction, active: saveAction.active ?? saved } : void 0;
|
|
1482
|
-
const cardPadding = contract.padding;
|
|
1483
|
-
const isInteractive = interactiveMode !== "none";
|
|
1484
|
-
const isFlipMode = interactiveMode === "flip" && Boolean(revealContent);
|
|
1485
|
-
const isRowTile = contract.mediaPlacement === "left";
|
|
1486
|
-
const emphasized = featured || selected;
|
|
1487
|
-
const titleContent = href && typeof title === "string" && interactiveMode === "none" ? /* @__PURE__ */ jsx7(Text2, { component: "a", href, inherit: true, td: "none", children: title }) : title;
|
|
1488
|
-
const activateSurface = (event) => {
|
|
1489
|
-
if (isNestedInteractiveTarget(event.target, event.currentTarget)) {
|
|
1490
|
-
return;
|
|
1491
|
-
}
|
|
1492
|
-
if (isFlipMode) {
|
|
1493
|
-
setFlipped((current) => !current);
|
|
1494
|
-
onSurfaceActivate?.();
|
|
1495
|
-
return;
|
|
1496
|
-
}
|
|
1497
|
-
if (interactiveMode === "surface-button") {
|
|
1498
|
-
onSurfaceActivate?.();
|
|
1499
|
-
return;
|
|
1500
|
-
}
|
|
1501
|
-
if (interactiveMode === "surface-link" && href) {
|
|
1502
|
-
onSurfaceActivate?.();
|
|
1503
|
-
if (typeof window !== "undefined") {
|
|
1504
|
-
window.location.assign(href);
|
|
1505
|
-
}
|
|
1506
|
-
}
|
|
1507
|
-
};
|
|
1508
|
-
const handleKeyDown = (event) => {
|
|
1509
|
-
if (!isInteractive || isNestedInteractiveTarget(event.target, event.currentTarget)) {
|
|
1510
|
-
return;
|
|
1511
|
-
}
|
|
1512
|
-
if (event.key === "Enter" || event.key === " ") {
|
|
1513
|
-
event.preventDefault();
|
|
1514
|
-
activateSurface(event);
|
|
1515
|
-
}
|
|
1516
|
-
};
|
|
1517
|
-
const surfaceLabel = typeof title === "string" ? title : "listing";
|
|
1518
|
-
const interactiveProps = isInteractive ? {
|
|
1519
|
-
role: interactiveMode === "surface-link" ? "link" : "button",
|
|
1520
|
-
tabIndex: 0,
|
|
1521
|
-
onClick: activateSurface,
|
|
1522
|
-
onKeyDown: handleKeyDown,
|
|
1523
|
-
"aria-expanded": isFlipMode ? flipped : void 0,
|
|
1524
|
-
"aria-current": selected && interactiveMode === "surface-link" ? "true" : void 0,
|
|
1525
|
-
"aria-label": isFlipMode ? `Toggle details for ${surfaceLabel}` : surfaceLabel
|
|
1526
|
-
} : {};
|
|
1527
|
-
const mediaSeedValue = mediaSeed ?? href ?? imageAlt ?? (typeof title === "string" ? title : "gds-listing");
|
|
1528
|
-
const fallbackTitle = typeof title === "string" ? title : imageAlt ?? "Listing";
|
|
1529
|
-
const mediaContent = image ?? /* @__PURE__ */ jsx7(
|
|
1530
|
-
ListingImageFallback,
|
|
1531
|
-
{
|
|
1532
|
-
mediaRatio: isRowTile ? "1:1" : mediaRatio,
|
|
1533
|
-
seed: mediaSeedValue,
|
|
1534
|
-
title: fallbackTitle
|
|
1535
|
-
}
|
|
1536
|
-
);
|
|
1537
|
-
const pickBadgeElement = pickBadge ? /* @__PURE__ */ jsx7(ListingPickBadge, { config: pickBadge, defaultLabel: pickLabel }) : null;
|
|
1538
|
-
const topLeftOverlay = pickBadgeElement ? /* @__PURE__ */ jsx7(
|
|
1539
|
-
Box3,
|
|
1540
|
-
{
|
|
1541
|
-
style: {
|
|
1542
|
-
position: "absolute",
|
|
1543
|
-
insetBlockStart: `${GDS_LISTING_PICK_BADGE_INSET_PX}px`,
|
|
1544
|
-
insetInlineStart: `${GDS_LISTING_PICK_BADGE_INSET_PX}px`,
|
|
1545
|
-
zIndex: 1
|
|
1546
|
-
},
|
|
1547
|
-
children: mediaOverlay ? /* @__PURE__ */ jsxs6(Stack3, { gap: "xs", children: [
|
|
1548
|
-
pickBadgeElement,
|
|
1549
|
-
mediaOverlay
|
|
1550
|
-
] }) : pickBadgeElement
|
|
1551
|
-
}
|
|
1552
|
-
) : mediaOverlay ? /* @__PURE__ */ jsx7(Box3, { style: { position: "absolute", top: "var(--mantine-spacing-xs)", left: "var(--mantine-spacing-xs)", zIndex: 1 }, children: mediaOverlay }) : null;
|
|
1553
|
-
const affordanceOverlay = mediaAffordance ? /* @__PURE__ */ jsx7(Box3, { style: { position: "absolute", top: 0, right: 0, zIndex: 1 }, children: /* @__PURE__ */ jsx7(ListingAffordance, { affordance: mediaAffordance }) }) : null;
|
|
1554
|
-
const hasMediaOverlayContent = Boolean(mediaOverlay || mediaAffordance || pickBadge);
|
|
1555
|
-
const mediaBlock = isRowTile ? /* @__PURE__ */ jsxs6(
|
|
1556
|
-
Box3,
|
|
1557
|
-
{
|
|
1558
|
-
"data-gds-listing-row-tile": true,
|
|
1559
|
-
style: {
|
|
1560
|
-
position: "relative",
|
|
1561
|
-
flex: `0 0 ${GDS_LISTING_TILE_SIZE_PX}px`,
|
|
1562
|
-
width: GDS_LISTING_TILE_SIZE_PX,
|
|
1563
|
-
height: GDS_LISTING_TILE_SIZE_PX,
|
|
1564
|
-
overflow: "hidden",
|
|
1565
|
-
borderRadius: "var(--gds-radius-thumbnail)"
|
|
1566
|
-
},
|
|
1567
|
-
children: [
|
|
1568
|
-
mediaContent,
|
|
1569
|
-
topLeftOverlay,
|
|
1570
|
-
affordanceOverlay
|
|
1571
|
-
]
|
|
1572
|
-
}
|
|
1573
|
-
) : hasMediaOverlayContent ? (
|
|
1574
|
-
// Positioned wrapper only when something is actually overlaid, so a card without
|
|
1575
|
-
// overlays keeps its previous DOM exactly (issue 679).
|
|
1576
|
-
/* @__PURE__ */ jsxs6(Box3, { style: { position: "relative" }, children: [
|
|
1577
|
-
mediaContent,
|
|
1578
|
-
topLeftOverlay,
|
|
1579
|
-
affordanceOverlay
|
|
1580
|
-
] })
|
|
1581
|
-
) : mediaContent;
|
|
1582
|
-
const contentItems = /* @__PURE__ */ jsxs6(Fragment4, { children: [
|
|
1583
|
-
featured || sponsoredDisclosure ? /* @__PURE__ */ jsxs6(Group3, { justify: "space-between", gap: "sm", wrap: "wrap", children: [
|
|
1584
|
-
featured ? /* @__PURE__ */ jsx7(
|
|
1585
|
-
Badge2,
|
|
1586
|
-
{
|
|
1587
|
-
variant: "light",
|
|
1588
|
-
style: {
|
|
1589
|
-
color: "var(--gds-brand-accent-tint-fg, var(--gds-brand-accent-action, var(--gds-vibe-accent, var(--mantine-primary-color-filled))))",
|
|
1590
|
-
backgroundColor: "var(--gds-brand-accent-tint, var(--mantine-color-default-hover))"
|
|
1591
|
-
},
|
|
1592
|
-
children: featuredLabel
|
|
1593
|
-
}
|
|
1594
|
-
) : /* @__PURE__ */ jsx7("span", {}),
|
|
1595
|
-
sponsoredDisclosure ? /* @__PURE__ */ jsx7(Text2, { size: "xs", c: "dimmed", children: sponsoredDisclosure }) : null
|
|
1596
|
-
] }) : null,
|
|
1597
|
-
/* @__PURE__ */ jsxs6(Stack3, { gap: 4, children: [
|
|
1598
|
-
/* @__PURE__ */ jsx7(Title2, { order: contract.titleOrder, lineClamp: 2, children: titleContent }),
|
|
1599
|
-
description ? /* @__PURE__ */ jsx7(Text2, { size: "sm", c: "dimmed", lineClamp: contract.descriptionClamp, children: description }) : null
|
|
1600
|
-
] }),
|
|
1601
|
-
metadata.length ? /* @__PURE__ */ jsx7(Stack3, { gap: "xs", children: metadata.map((item) => /* @__PURE__ */ jsxs6(Group3, { justify: "space-between", align: "flex-start", gap: "sm", wrap: "nowrap", children: [
|
|
1602
|
-
/* @__PURE__ */ jsxs6(Group3, { gap: "xs", wrap: "nowrap", style: { minWidth: 0, flex: 1 }, children: [
|
|
1603
|
-
item.icon,
|
|
1604
|
-
/* @__PURE__ */ jsx7(Text2, { size: "sm", c: item.tone ? toneColorMap[item.tone] : "dimmed", lineClamp: 1, children: item.label })
|
|
1605
|
-
] }),
|
|
1606
|
-
item.value ? /* @__PURE__ */ jsx7(Text2, { size: "sm", fw: 500, ta: "right", children: item.value }) : null
|
|
1607
|
-
] }, item.id)) }) : null,
|
|
1608
|
-
reason ? /* @__PURE__ */ jsxs6(Stack3, { gap: 4, role: "group", "aria-label": reasonLabel, children: [
|
|
1609
|
-
/* @__PURE__ */ jsx7(Text2, { size: "xs", fw: 700, tt: "uppercase", c: "dimmed", children: reasonLabel }),
|
|
1610
|
-
reason
|
|
1611
|
-
] }) : null,
|
|
1612
|
-
/* @__PURE__ */ jsxs6(Group3, { justify: "space-between", align: "center", gap: "sm", wrap: "wrap", children: [
|
|
1613
|
-
/* @__PURE__ */ jsxs6(Stack3, { gap: 2, style: { minWidth: 0, flex: 1 }, children: [
|
|
1614
|
-
price ? /* @__PURE__ */ jsx7(
|
|
1615
|
-
Text2,
|
|
1616
|
-
{
|
|
1617
|
-
fw: 700,
|
|
1618
|
-
size: contract.size === "xs" || contract.size === "sm" ? "md" : "lg",
|
|
1619
|
-
style: { color: "var(--gds-price, var(--gds-brand-accent-action, var(--gds-vibe-accent, var(--mantine-primary-color-filled))))" },
|
|
1620
|
-
children: price
|
|
1621
|
-
}
|
|
1622
|
-
) : null,
|
|
1623
|
-
rating ? /* @__PURE__ */ jsxs6(Group3, { gap: 4, wrap: "nowrap", "aria-label": ratingLabel, children: [
|
|
1624
|
-
/* @__PURE__ */ jsx7(
|
|
1625
|
-
GdsIcons.Star,
|
|
1626
|
-
{
|
|
1627
|
-
size: "1rem",
|
|
1628
|
-
stroke: 1.75,
|
|
1629
|
-
fill: "currentColor",
|
|
1630
|
-
style: { color: "var(--gds-star, var(--gds-brand-accent-action, var(--gds-vibe-accent, var(--mantine-primary-color-filled))))" }
|
|
1631
|
-
}
|
|
1632
|
-
),
|
|
1633
|
-
/* @__PURE__ */ jsx7(Text2, { size: "sm", fw: 600, style: { color: "var(--gds-star, var(--gds-brand-accent-action, var(--gds-vibe-accent, var(--mantine-primary-color-filled))))" }, children: rating })
|
|
1634
|
-
] }) : null
|
|
1635
|
-
] }),
|
|
1636
|
-
score ? /* @__PURE__ */ jsx7(Group3, { gap: "xs", wrap: "nowrap", children: score }) : null,
|
|
1637
|
-
/* @__PURE__ */ jsxs6(Group3, { gap: "xs", wrap: "nowrap", justify: "flex-end", style: { marginInlineStart: "auto" }, children: [
|
|
1638
|
-
resolvedSaveAction ? /* @__PURE__ */ jsx7(ListingAffordance, { affordance: resolvedSaveAction }) : null,
|
|
1639
|
-
shareAction ? /* @__PURE__ */ jsx7(ListingAffordance, { affordance: shareAction }) : null,
|
|
1640
|
-
resolvedActions ? null : primaryAction,
|
|
1641
|
-
isFlipMode ? /* @__PURE__ */ jsx7(Text2, { size: "xs", c: "dimmed", children: "Press Enter or Space to reveal details." }) : null
|
|
1642
|
-
] })
|
|
1643
|
-
] }),
|
|
1644
|
-
resolvedActions ? /* @__PURE__ */ jsx7(Group3, { gap: "sm", wrap: "wrap", role: "group", "aria-label": "Listing actions", children: resolvedActions.map((action, index) => (
|
|
1645
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
1646
|
-
/* @__PURE__ */ jsx7("span", { children: action }, index)
|
|
1647
|
-
)) }) : null
|
|
1648
|
-
] });
|
|
1649
|
-
return /* @__PURE__ */ jsx7(
|
|
1650
|
-
Card,
|
|
1651
|
-
{
|
|
1652
|
-
withBorder: true,
|
|
1653
|
-
radius: "lg",
|
|
1654
|
-
padding: cardPadding,
|
|
1655
|
-
...contract.dataAttributes,
|
|
1656
|
-
"data-gds-listing-card": true,
|
|
1657
|
-
"data-gds-card-interactive-mode": interactiveMode,
|
|
1658
|
-
"data-gds-card-flipped": isFlipMode ? String(flipped) : void 0,
|
|
1659
|
-
"data-gds-listing-featured": featured ? "true" : void 0,
|
|
1660
|
-
"data-gds-listing-selected": selected ? "true" : void 0,
|
|
1661
|
-
style: {
|
|
1662
|
-
background: "var(--gds-bg-card, var(--gds-vibe-surface, var(--mantine-color-body)))",
|
|
1663
|
-
borderColor: "var(--gds-border-card, var(--gds-vibe-border, var(--mantine-color-default-border)))",
|
|
1664
|
-
...isInteractive ? { cursor: "pointer", transition: "transform var(--gds-motion-duration-fast) var(--gds-motion-ease-standard), box-shadow var(--gds-motion-duration-fast) var(--gds-motion-ease-standard)" } : {},
|
|
1665
|
-
// Emphasis is a ring, never a lift: no transform is set here, in any state.
|
|
1666
|
-
...emphasized ? {
|
|
1667
|
-
borderColor: "var(--gds-listing-featured-border, var(--gds-brand-accent-action, var(--gds-vibe-accent, var(--mantine-primary-color-filled))))",
|
|
1668
|
-
boxShadow: "var(--gds-ring-featured, 0 0 0 3px color-mix(in srgb, var(--gds-vibe-accent) 14%, transparent)), var(--gds-elevation-panel)"
|
|
1669
|
-
} : {}
|
|
1670
|
-
},
|
|
1671
|
-
...interactiveProps,
|
|
1672
|
-
children: /* @__PURE__ */ jsx7(Stack3, { gap: contract.gap, children: isFlipMode && flipped ? revealContent : isRowTile ? /* @__PURE__ */ jsxs6(Group3, { gap: contract.gap, wrap: "nowrap", align: "flex-start", "data-gds-listing-row": true, children: [
|
|
1673
|
-
mediaBlock,
|
|
1674
|
-
/* @__PURE__ */ jsx7(Stack3, { gap: contract.gap, style: { minWidth: 0, flex: 1 }, children: contentItems })
|
|
1675
|
-
] }) : /* @__PURE__ */ jsxs6(Fragment4, { children: [
|
|
1676
|
-
mediaBlock,
|
|
1677
|
-
contentItems
|
|
1678
|
-
] }) })
|
|
1679
|
-
}
|
|
1680
|
-
);
|
|
1681
|
-
}
|
|
1682
|
-
|
|
1683
|
-
// src/locales/index.ts
|
|
1684
|
-
var gdsLocales = {
|
|
1685
|
-
en,
|
|
1686
|
-
es,
|
|
1687
|
-
hu,
|
|
1688
|
-
de,
|
|
1689
|
-
fr,
|
|
1690
|
-
it,
|
|
1691
|
-
ru,
|
|
1692
|
-
he,
|
|
1693
|
-
ar,
|
|
1694
|
-
zh,
|
|
1695
|
-
ja,
|
|
1696
|
-
ko
|
|
1697
|
-
};
|
|
1698
|
-
function getGdsMessages(locale) {
|
|
1699
|
-
return gdsLocales[locale] ?? en;
|
|
1700
|
-
}
|
|
1701
|
-
|
|
1702
|
-
// src/OwnedContrastSurface.tsx
|
|
1703
|
-
import { getGdsVibeThemeCssVariables as getGdsVibeThemeCssVariables2 } from "@sovereignsquad/gds-theme";
|
|
1704
|
-
function createGdsOwnedContrastTokens(vibe, options) {
|
|
1705
|
-
const text = options.text ?? vibe.textLight;
|
|
1706
|
-
const muted = options.muted ?? vibe.mutedLight;
|
|
1707
|
-
const surface = options.surface ?? vibe.surfaceLight;
|
|
1708
|
-
const border = options.border ?? vibe.borderLight;
|
|
1709
|
-
const emitted = getGdsVibeThemeCssVariables2(vibe.id, "light");
|
|
1710
|
-
const primary = emitted["--gds-vibe-primary"];
|
|
1711
|
-
return {
|
|
1712
|
-
text,
|
|
1713
|
-
muted,
|
|
1714
|
-
background: options.background,
|
|
1715
|
-
radius: options.radius,
|
|
1716
|
-
primary,
|
|
1717
|
-
primaryFg: emitted["--gds-action-fill-fg"],
|
|
1718
|
-
accent: emitted["--gds-vibe-accent"],
|
|
1719
|
-
surface,
|
|
1720
|
-
border,
|
|
1721
|
-
link: options.link ?? `color-mix(in srgb, ${primary} 64%, ${text})`,
|
|
1722
|
-
control: options.control ?? `color-mix(in srgb, ${surface} 88%, ${primary} 8%)`,
|
|
1723
|
-
controlText: options.controlText ?? text,
|
|
1724
|
-
backgroundColor: options.backgroundColor ?? surface,
|
|
1725
|
-
borderColor: options.borderColor ?? border,
|
|
1726
|
-
boxShadow: options.boxShadow
|
|
1727
|
-
};
|
|
1728
|
-
}
|
|
1729
|
-
function getGdsOwnedContrastProps({ role, tokens }) {
|
|
1730
|
-
const style = {
|
|
1731
|
-
"--mantine-color-text": tokens.text,
|
|
1732
|
-
"--mantine-color-dimmed": tokens.muted,
|
|
1733
|
-
"--gds-local-background": tokens.background,
|
|
1734
|
-
"--gds-local-radius": tokens.radius,
|
|
1735
|
-
"--gds-vibe-primary": tokens.primary,
|
|
1736
|
-
...tokens.primaryFg ? { "--gds-action-fill-fg": tokens.primaryFg } : {},
|
|
1737
|
-
"--gds-vibe-accent": tokens.accent,
|
|
1738
|
-
"--gds-vibe-surface": tokens.surface,
|
|
1739
|
-
"--gds-vibe-border": tokens.border,
|
|
1740
|
-
"--gds-vibe-text": tokens.text,
|
|
1741
|
-
"--gds-vibe-muted": tokens.muted,
|
|
1742
|
-
"--gds-vibe-link": tokens.link,
|
|
1743
|
-
"--gds-vibe-control": tokens.control,
|
|
1744
|
-
"--gds-vibe-control-text": tokens.controlText,
|
|
1745
|
-
color: tokens.text,
|
|
1746
|
-
backgroundColor: tokens.backgroundColor,
|
|
1747
|
-
backgroundImage: "var(--gds-local-background)",
|
|
1748
|
-
borderColor: tokens.borderColor,
|
|
1749
|
-
boxShadow: tokens.boxShadow
|
|
1750
|
-
};
|
|
1751
|
-
return {
|
|
1752
|
-
"data-gds-owned-contrast": role,
|
|
1753
|
-
"data-gds-local-contrast": role,
|
|
1754
|
-
style
|
|
1755
|
-
};
|
|
1756
|
-
}
|
|
1757
|
-
|
|
1758
|
-
// src/FormField.tsx
|
|
1759
|
-
import { Box as Box4, Stack as Stack4, Text as Text3 } from "@mantine/core";
|
|
1760
|
-
import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1761
|
-
function FormField({ label, description, error, children }) {
|
|
1762
|
-
return /* @__PURE__ */ jsx8(Box4, { component: "label", children: /* @__PURE__ */ jsxs7(Stack4, { gap: 4, children: [
|
|
1763
|
-
typeof label === "string" ? /* @__PURE__ */ jsx8(Text3, { size: "xs", fw: 600, c: "dimmed", children: label }) : label,
|
|
1764
|
-
description ? typeof description === "string" ? /* @__PURE__ */ jsx8(Text3, { size: "xs", c: "dimmed", children: description }) : description : null,
|
|
1765
|
-
children,
|
|
1766
|
-
error ? typeof error === "string" ? /* @__PURE__ */ jsx8(Text3, { size: "xs", c: "red.7", children: error }) : error : null
|
|
1767
|
-
] }) });
|
|
1768
|
-
}
|
|
1769
|
-
|
|
1770
|
-
// src/SimpleDataTable.tsx
|
|
1771
|
-
import { useGdsTranslation as useGdsTranslation4 } from "@sovereignsquad/gds-theme";
|
|
1772
|
-
import { ScrollArea, Table } from "@mantine/core";
|
|
1773
|
-
import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1774
|
-
function SimpleDataTable({
|
|
1775
|
-
columns,
|
|
1776
|
-
rows,
|
|
1777
|
-
loading = false,
|
|
1778
|
-
error = null,
|
|
1779
|
-
emptyTitle: emptyTitleProp,
|
|
1780
|
-
emptyDescription: emptyDescriptionProp,
|
|
1781
|
-
getRowKey,
|
|
1782
|
-
stateTitleOrder
|
|
1783
|
-
}) {
|
|
1784
|
-
const { t } = useGdsTranslation4();
|
|
1785
|
-
const emptyTitle = emptyTitleProp ?? t("gds.simpleDataTable.emptyTitle", "No data available");
|
|
1786
|
-
const emptyDescription = emptyDescriptionProp ?? t("gds.simpleDataTable.emptyDescription", "There is no live data to show yet.");
|
|
1787
|
-
if (error) {
|
|
1788
|
-
return /* @__PURE__ */ jsx9(StateBlock, { variant: "error", title: "Unable to load data", description: error, compact: true, titleOrder: stateTitleOrder });
|
|
1789
|
-
}
|
|
1790
|
-
if (loading) {
|
|
1791
|
-
return /* @__PURE__ */ jsx9(StateBlock, { variant: "loading", title: "Loading data", description: "Please wait while the shared dataset is prepared.", compact: true, titleOrder: stateTitleOrder });
|
|
1792
|
-
}
|
|
1793
|
-
if (!rows.length) {
|
|
1794
|
-
return /* @__PURE__ */ jsx9(StateBlock, { variant: "empty", title: emptyTitle, description: emptyDescription, compact: true, titleOrder: stateTitleOrder });
|
|
1795
|
-
}
|
|
1796
|
-
return /* @__PURE__ */ jsx9(ScrollArea, { children: /* @__PURE__ */ jsxs8(Table, { striped: true, highlightOnHover: true, withTableBorder: true, withColumnBorders: true, children: [
|
|
1797
|
-
/* @__PURE__ */ jsx9(Table.Thead, { children: /* @__PURE__ */ jsx9(Table.Tr, { children: columns.map((column) => /* @__PURE__ */ jsx9(Table.Th, { children: column.header }, String(column.key))) }) }),
|
|
1798
|
-
/* @__PURE__ */ jsx9(Table.Tbody, { children: rows.map((row, index) => /* @__PURE__ */ jsx9(Table.Tr, { children: columns.map((column) => /* @__PURE__ */ jsx9(Table.Td, { children: column.render ? column.render(row) : String(row[column.key] ?? "") }, String(column.key))) }, getRowKey ? getRowKey(row, index) : index)) })
|
|
1799
|
-
] }) });
|
|
1800
|
-
}
|
|
1801
|
-
|
|
1802
|
-
// src/chart-colors.ts
|
|
1803
|
-
var gdsSeriesPalette = {
|
|
1804
|
-
primary: "var(--gds-brand-primary, var(--gds-vibe-primary, var(--mantine-primary-color-filled)))",
|
|
1805
|
-
success: "var(--gds-state-success, var(--mantine-color-green-6))",
|
|
1806
|
-
warning: "var(--gds-state-warning, var(--mantine-color-yellow-7))",
|
|
1807
|
-
danger: "var(--gds-state-danger, var(--mantine-color-red-6))",
|
|
1808
|
-
info: "var(--gds-state-info, var(--gds-vibe-accent, var(--mantine-primary-color-filled)))",
|
|
1809
|
-
neutral: "var(--gds-text-meta, var(--gds-vibe-muted, var(--mantine-color-gray-6)))",
|
|
1810
|
-
accent: "var(--gds-brand-accent-action, var(--gds-brand-accent, var(--gds-vibe-accent, var(--mantine-primary-color-filled))))"
|
|
1811
|
-
};
|
|
1812
|
-
function getGdsSeriesColor(tone = "primary") {
|
|
1813
|
-
return gdsSeriesPalette[tone];
|
|
1814
|
-
}
|
|
1815
|
-
var GDS_CHART_SERIES_COLORS = [
|
|
1816
|
-
"var(--gds-chart-series-1)",
|
|
1817
|
-
"var(--gds-chart-series-2)",
|
|
1818
|
-
"var(--gds-chart-series-3)",
|
|
1819
|
-
"var(--gds-chart-series-4)",
|
|
1820
|
-
"var(--gds-chart-series-5)",
|
|
1821
|
-
"var(--gds-chart-series-6)",
|
|
1822
|
-
"var(--gds-chart-series-7)",
|
|
1823
|
-
"var(--gds-chart-series-8)"
|
|
1824
|
-
];
|
|
1825
|
-
var GDS_CHART_SERIES_SLOTS = GDS_CHART_SERIES_COLORS.length;
|
|
1826
|
-
function getGdsChartSeriesColor(index) {
|
|
1827
|
-
const slot = Number.isFinite(index) ? Math.max(1, Math.trunc(index)) : 1;
|
|
1828
|
-
return GDS_CHART_SERIES_COLORS[(slot - 1) % GDS_CHART_SERIES_SLOTS];
|
|
1829
|
-
}
|
|
1830
|
-
function resolveGdsChartTokenColor(token) {
|
|
1831
|
-
const value = token.trim();
|
|
1832
|
-
if (Object.hasOwn(gdsSeriesPalette, value)) return gdsSeriesPalette[value];
|
|
1833
|
-
if (value.startsWith("--")) return `var(${value})`;
|
|
1834
|
-
if (/^[a-z][\w-]*(\.[\w-]+)+$/i.test(value)) {
|
|
1835
|
-
return `var(--gds-${value.replace(/\./g, "-")})`;
|
|
1836
|
-
}
|
|
1837
|
-
return value;
|
|
1838
|
-
}
|
|
1839
|
-
|
|
1840
|
-
// src/ChartTokenPanel.tsx
|
|
1841
|
-
import { Badge as Badge3, Box as Box5, Group as Group4, Paper as Paper2, Stack as Stack5, Text as Text4, Title as Title3 } from "@mantine/core";
|
|
1842
|
-
import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1843
|
-
function ChartTokenPanel({
|
|
1844
|
-
title,
|
|
1845
|
-
description,
|
|
1846
|
-
summary,
|
|
1847
|
-
state = "ready",
|
|
1848
|
-
legend = [],
|
|
1849
|
-
children,
|
|
1850
|
-
tableFallback,
|
|
1851
|
-
retryAction
|
|
1852
|
-
}) {
|
|
1853
|
-
if (state === "loading") {
|
|
1854
|
-
return /* @__PURE__ */ jsx10(StateBlock, { variant: "loading", title: "Loading chart", description: summary, compact: true, action: retryAction });
|
|
1855
|
-
}
|
|
1856
|
-
if (state === "empty") {
|
|
1857
|
-
return /* @__PURE__ */ jsx10(StateBlock, { variant: "empty", title: "No chart data", description: summary, compact: true, action: retryAction });
|
|
1858
|
-
}
|
|
1859
|
-
if (state === "below-threshold") {
|
|
1860
|
-
return /* @__PURE__ */ jsx10(StateBlock, { variant: "not-enough-data", title: "Not enough data for chart", description: summary, compact: true, action: retryAction });
|
|
1861
|
-
}
|
|
1862
|
-
if (state === "error") {
|
|
1863
|
-
return /* @__PURE__ */ jsx10(StateBlock, { variant: "error", title: "Unable to load chart", description: summary, compact: true, action: retryAction });
|
|
1864
|
-
}
|
|
1865
|
-
return /* @__PURE__ */ jsx10(Paper2, { withBorder: true, radius: "xl", p: "lg", children: /* @__PURE__ */ jsxs9(Stack5, { gap: "md", children: [
|
|
1866
|
-
/* @__PURE__ */ jsxs9(Group4, { justify: "space-between", align: "flex-start", gap: "sm", children: [
|
|
1867
|
-
/* @__PURE__ */ jsxs9(Stack5, { gap: 4, children: [
|
|
1868
|
-
/* @__PURE__ */ jsx10(Title3, { order: 4, children: title }),
|
|
1869
|
-
description ? /* @__PURE__ */ jsx10(Text4, { size: "sm", c: "dimmed", children: description }) : null
|
|
1870
|
-
] }),
|
|
1871
|
-
state !== "ready" ? /* @__PURE__ */ jsx10(
|
|
1872
|
-
Badge3,
|
|
1873
|
-
{
|
|
1874
|
-
variant: "filled",
|
|
1875
|
-
style: {
|
|
1876
|
-
background: `var(--gds-badge-soft-${state === "permission-limited" ? "info" : "warning"})`,
|
|
1877
|
-
color: `var(--gds-badge-soft-${state === "permission-limited" ? "info" : "warning"}-fg)`
|
|
1878
|
-
},
|
|
1879
|
-
children: state.replace("-", " ")
|
|
1880
|
-
}
|
|
1881
|
-
) : null
|
|
1882
|
-
] }),
|
|
1883
|
-
/* @__PURE__ */ jsx10(Text4, { size: "sm", children: summary }),
|
|
1884
|
-
legend.length ? /* @__PURE__ */ jsx10(Group4, { component: "ul", role: "list", gap: "md", wrap: "wrap", "aria-label": "Chart legend", className: "gds-chart-legend", children: legend.map((item, index) => /* @__PURE__ */ jsxs9(
|
|
1885
|
-
Group4,
|
|
1886
|
-
{
|
|
1887
|
-
component: "li",
|
|
1888
|
-
gap: "xs",
|
|
1889
|
-
wrap: "nowrap",
|
|
1890
|
-
"data-token": item.token,
|
|
1891
|
-
title: typeof item.description === "string" ? item.description : void 0,
|
|
1892
|
-
children: [
|
|
1893
|
-
/* @__PURE__ */ jsx10(
|
|
1894
|
-
Box5,
|
|
1895
|
-
{
|
|
1896
|
-
component: "span",
|
|
1897
|
-
"aria-hidden": true,
|
|
1898
|
-
className: "gds-chart-legend-swatch",
|
|
1899
|
-
style: { background: resolveGdsChartTokenColor(item.token) }
|
|
1900
|
-
}
|
|
1901
|
-
),
|
|
1902
|
-
/* @__PURE__ */ jsx10(Text4, { component: "span", size: "sm", children: item.label })
|
|
1903
|
-
]
|
|
1904
|
-
},
|
|
1905
|
-
`${String(item.label)}-${index}`
|
|
1906
|
-
)) }) : null,
|
|
1907
|
-
children,
|
|
1908
|
-
tableFallback ? /* @__PURE__ */ jsxs9(Stack5, { gap: "xs", children: [
|
|
1909
|
-
/* @__PURE__ */ jsx10(Text4, { size: "sm", fw: 600, children: "Accessible data fallback" }),
|
|
1910
|
-
tableFallback
|
|
1911
|
-
] }) : null
|
|
1912
|
-
] }) });
|
|
1913
|
-
}
|
|
1914
|
-
|
|
1915
|
-
// src/chart-primitives.tsx
|
|
1916
|
-
import { useId as useId2 } from "react";
|
|
1917
|
-
import { Box as Box6, Group as Group5, Paper as Paper3, Stack as Stack6, Text as Text5 } from "@mantine/core";
|
|
1918
|
-
import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1919
|
-
function SemanticChartFrame({ title, summary, children, labelledBy, describedBy }) {
|
|
1920
|
-
return /* @__PURE__ */ jsx11(Paper3, { withBorder: true, radius: "md", p: "md", role: "img", "aria-labelledby": labelledBy, "aria-describedby": describedBy, children: /* @__PURE__ */ jsxs10(Stack6, { gap: "sm", children: [
|
|
1921
|
-
/* @__PURE__ */ jsx11(Text5, { id: labelledBy, fw: 700, children: title }),
|
|
1922
|
-
/* @__PURE__ */ jsx11(Text5, { id: describedBy, size: "sm", c: "dimmed", children: summary }),
|
|
1923
|
-
children
|
|
1924
|
-
] }) });
|
|
1925
|
-
}
|
|
1926
|
-
function getMaxValue(data) {
|
|
1927
|
-
return Math.max(1, ...data.map((item) => Math.abs(item.value ?? 0)));
|
|
1928
|
-
}
|
|
1929
|
-
function Bars({ data, tone = "primary" }) {
|
|
1930
|
-
const max = getMaxValue(data);
|
|
1931
|
-
return /* @__PURE__ */ jsx11(Stack6, { gap: "xs", children: data.map((item) => /* @__PURE__ */ jsxs10(Group5, { gap: "xs", wrap: "nowrap", children: [
|
|
1932
|
-
/* @__PURE__ */ jsx11(Text5, { size: "xs", miw: 96, children: item.label }),
|
|
1933
|
-
/* @__PURE__ */ jsx11(Box6, { h: 12, bg: getGdsSeriesColor(tone), style: { width: `${Math.max(4, Math.abs(item.value ?? 0) / max * 100)}%`, borderRadius: "var(--mantine-radius-sm)" } }),
|
|
1934
|
-
/* @__PURE__ */ jsx11(Text5, { size: "xs", c: "dimmed", children: item.value ?? "-" })
|
|
1935
|
-
] }, `${item.group ?? "series"}-${item.label}`)) });
|
|
1936
|
-
}
|
|
1937
|
-
var PLOT_TOP = 10;
|
|
1938
|
-
var GRID_LINES = [PLOT_TOP, 40, 70, 100];
|
|
1939
|
-
function plotPoints(data) {
|
|
1940
|
-
const max = getMaxValue(data);
|
|
1941
|
-
return data.map((item, index) => `${index / Math.max(1, data.length - 1) * 100},${100 - Math.abs(item.value ?? 0) / max * (100 - PLOT_TOP)}`).join(" ");
|
|
1942
|
-
}
|
|
1943
|
-
function Gridlines() {
|
|
1944
|
-
return /* @__PURE__ */ jsx11("g", { "aria-hidden": true, children: GRID_LINES.map((y) => /* @__PURE__ */ jsx11("line", { className: "gds-chart-grid", x1: "0", x2: "100", y1: y, y2: y, style: { stroke: "var(--gds-chart-grid)" }, strokeWidth: "1", vectorEffect: "non-scaling-stroke" }, y)) });
|
|
1945
|
-
}
|
|
1946
|
-
function AxisLabels({ data }) {
|
|
1947
|
-
if (data.length === 0) return null;
|
|
1948
|
-
const picks = data.length > 2 ? [data[0], data[Math.floor((data.length - 1) / 2)], data[data.length - 1]] : data;
|
|
1949
|
-
return /* @__PURE__ */ jsx11(Group5, { justify: "space-between", gap: "xs", wrap: "nowrap", "aria-hidden": true, className: "gds-chart-axis", children: picks.map((item, index) => /* @__PURE__ */ jsx11(Text5, { size: "xs", className: "gds-chart-axis-label", style: { color: "var(--gds-chart-axis-text)" }, children: item.label }, `${item.label}-${index}`)) });
|
|
1950
|
-
}
|
|
1951
|
-
function PlotSvg({ children }) {
|
|
1952
|
-
return /* @__PURE__ */ jsx11(Box6, { component: "svg", viewBox: "0 0 100 100", preserveAspectRatio: "none", h: 140, w: "100%", role: "presentation", "aria-hidden": true, style: { display: "block", overflow: "visible" }, children });
|
|
1953
|
-
}
|
|
1954
|
-
function SeriesLine({ points, color }) {
|
|
1955
|
-
return /* @__PURE__ */ jsx11("polyline", { className: "gds-chart-line", points, fill: "none", style: { stroke: color }, strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" });
|
|
1956
|
-
}
|
|
1957
|
-
function Line({ data, tone = "primary", axisLabels = false }) {
|
|
1958
|
-
return /* @__PURE__ */ jsxs10(Stack6, { gap: 4, children: [
|
|
1959
|
-
/* @__PURE__ */ jsxs10(PlotSvg, { children: [
|
|
1960
|
-
/* @__PURE__ */ jsx11(Gridlines, {}),
|
|
1961
|
-
/* @__PURE__ */ jsx11(SeriesLine, { points: plotPoints(data), color: getGdsSeriesColor(tone) })
|
|
1962
|
-
] }),
|
|
1963
|
-
axisLabels ? /* @__PURE__ */ jsx11(AxisLabels, { data }) : null
|
|
1964
|
-
] });
|
|
1965
|
-
}
|
|
1966
|
-
function Area({ data, tone = "primary", axisLabels = false }) {
|
|
1967
|
-
const gradientId = `gds-chart-fill-${useId2().replace(/[^\w-]/g, "")}`;
|
|
1968
|
-
const points = plotPoints(data);
|
|
1969
|
-
const color = getGdsSeriesColor(tone);
|
|
1970
|
-
return /* @__PURE__ */ jsxs10(Stack6, { gap: 4, children: [
|
|
1971
|
-
/* @__PURE__ */ jsxs10(PlotSvg, { children: [
|
|
1972
|
-
/* @__PURE__ */ jsx11("defs", { children: /* @__PURE__ */ jsxs10("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
1973
|
-
/* @__PURE__ */ jsx11("stop", { offset: "0%", style: { stopColor: color, stopOpacity: "var(--gds-chart-area-opacity-start)" } }),
|
|
1974
|
-
/* @__PURE__ */ jsx11("stop", { offset: "100%", style: { stopColor: color, stopOpacity: "var(--gds-chart-area-opacity-end)" } })
|
|
1975
|
-
] }) }),
|
|
1976
|
-
/* @__PURE__ */ jsx11(Gridlines, {}),
|
|
1977
|
-
/* @__PURE__ */ jsx11("polygon", { className: "gds-chart-area-fill", points: `0,100 ${points} 100,100`, fill: `url(#${gradientId})` }),
|
|
1978
|
-
/* @__PURE__ */ jsx11(SeriesLine, { points, color })
|
|
1979
|
-
] }),
|
|
1980
|
-
axisLabels ? /* @__PURE__ */ jsx11(AxisLabels, { data }) : null
|
|
1981
|
-
] });
|
|
1982
|
-
}
|
|
1983
|
-
function Sparkline({ data, tone = "primary" }) {
|
|
1984
|
-
const max = getMaxValue(data);
|
|
1985
|
-
const points = data.map((item, index) => `${index / Math.max(1, data.length - 1) * 100},${24 - Math.abs(item.value ?? 0) / max * 20}`).join(" ");
|
|
1986
|
-
return /* @__PURE__ */ jsx11(Box6, { component: "svg", viewBox: "0 0 100 28", h: 48, w: "100%", role: "presentation", "aria-hidden": true, children: /* @__PURE__ */ jsx11("polyline", { points, fill: "none", stroke: getGdsSeriesColor(tone), strokeWidth: "4", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1987
|
-
}
|
|
1988
|
-
function Radar({ data, tone = "primary" }) {
|
|
1989
|
-
const max = getMaxValue(data);
|
|
1990
|
-
const center = 50;
|
|
1991
|
-
const radius = 42;
|
|
1992
|
-
const points = data.map((item, index) => {
|
|
1993
|
-
const angle = Math.PI * 2 / data.length * index - Math.PI / 2;
|
|
1994
|
-
const ratio = Math.abs(item.value ?? 0) / max;
|
|
1995
|
-
return `${center + Math.cos(angle) * radius * ratio},${center + Math.sin(angle) * radius * ratio}`;
|
|
1996
|
-
}).join(" ");
|
|
1997
|
-
return /* @__PURE__ */ jsxs10(Box6, { component: "svg", viewBox: "0 0 100 100", h: 160, w: "100%", role: "presentation", "aria-hidden": true, children: [
|
|
1998
|
-
/* @__PURE__ */ jsx11("circle", { cx: center, cy: center, r: radius, fill: "none", stroke: "var(--gds-border-card, var(--mantine-color-gray-3))", strokeWidth: "1" }),
|
|
1999
|
-
/* @__PURE__ */ jsx11("polygon", { points, fill: getGdsSeriesColor(tone), opacity: "0.2" }),
|
|
2000
|
-
/* @__PURE__ */ jsx11("polyline", { points: `${points} ${points.split(" ")[0]}`, fill: "none", stroke: getGdsSeriesColor(tone), strokeWidth: "2.5", strokeLinejoin: "round" })
|
|
2001
|
-
] });
|
|
2002
|
-
}
|
|
2003
|
-
function Gauge({ data, tone = "primary" }) {
|
|
2004
|
-
const max = getMaxValue(data);
|
|
2005
|
-
const current = Math.max(0, data[0]?.value ?? 0);
|
|
2006
|
-
const width = `${Math.min(100, current / max * 100)}%`;
|
|
2007
|
-
return /* @__PURE__ */ jsxs10(Stack6, { gap: "xs", children: [
|
|
2008
|
-
/* @__PURE__ */ jsx11(Box6, { h: 18, bg: "var(--gds-bg-info-tag, var(--mantine-color-gray-1))", style: { borderRadius: "var(--mantine-radius-xl)", overflow: "hidden" }, children: /* @__PURE__ */ jsx11(Box6, { h: "100%", bg: getGdsSeriesColor(tone), style: { width, borderRadius: "var(--mantine-radius-xl)" } }) }),
|
|
2009
|
-
/* @__PURE__ */ jsxs10(Text5, { size: "xs", c: "dimmed", children: [
|
|
2010
|
-
data[0]?.label ?? "Current",
|
|
2011
|
-
": ",
|
|
2012
|
-
data[0]?.value ?? "-"
|
|
2013
|
-
] })
|
|
2014
|
-
] });
|
|
2015
|
-
}
|
|
2016
|
-
function Heatmap({ data, tone = "primary" }) {
|
|
2017
|
-
const max = getMaxValue(data);
|
|
2018
|
-
return /* @__PURE__ */ jsx11(
|
|
2019
|
-
Box6,
|
|
2020
|
-
{
|
|
2021
|
-
style: {
|
|
2022
|
-
display: "grid",
|
|
2023
|
-
gridTemplateColumns: "repeat(auto-fit, minmax(56px, 1fr))",
|
|
2024
|
-
gap: "var(--mantine-spacing-xs)"
|
|
2025
|
-
},
|
|
2026
|
-
children: data.map((item) => /* @__PURE__ */ jsx11(
|
|
2027
|
-
Box6,
|
|
2028
|
-
{
|
|
2029
|
-
p: "xs",
|
|
2030
|
-
style: {
|
|
2031
|
-
minHeight: 48,
|
|
2032
|
-
borderRadius: "var(--mantine-radius-sm)",
|
|
2033
|
-
background: getGdsSeriesColor(tone),
|
|
2034
|
-
opacity: Math.max(0.22, Math.abs(item.value ?? 0) / max)
|
|
2035
|
-
},
|
|
2036
|
-
children: /* @__PURE__ */ jsx11(Text5, { size: "xs", c: "var(--gds-text-on-inverse, var(--mantine-color-white))", children: item.label })
|
|
2037
|
-
},
|
|
2038
|
-
`${item.group ?? "row"}-${item.label}`
|
|
2039
|
-
))
|
|
2040
|
-
}
|
|
2041
|
-
);
|
|
2042
|
-
}
|
|
2043
|
-
function semanticRenderer(kind, tone, axisLabels = false) {
|
|
2044
|
-
return ({ title, summary, data, labelledBy, describedBy }) => /* @__PURE__ */ jsxs10(SemanticChartFrame, { title, summary, labelledBy, describedBy, children: [
|
|
2045
|
-
kind === "line" ? /* @__PURE__ */ jsx11(Line, { data, tone, axisLabels }) : null,
|
|
2046
|
-
kind === "area" ? /* @__PURE__ */ jsx11(Area, { data, tone, axisLabels }) : null,
|
|
2047
|
-
kind === "sparkline" ? /* @__PURE__ */ jsx11(Sparkline, { data, tone }) : null,
|
|
2048
|
-
kind === "radar" ? /* @__PURE__ */ jsx11(Radar, { data, tone }) : null,
|
|
2049
|
-
kind === "gauge" ? /* @__PURE__ */ jsx11(Gauge, { data, tone }) : null,
|
|
2050
|
-
kind === "heatmap" ? /* @__PURE__ */ jsx11(Heatmap, { data, tone }) : null,
|
|
2051
|
-
kind === "bar" || kind === "stacked-bar" ? /* @__PURE__ */ jsx11(Bars, { data, tone }) : null
|
|
2052
|
-
] });
|
|
2053
|
-
}
|
|
2054
|
-
|
|
2055
|
-
// src/GdsChart.tsx
|
|
2056
|
-
import { useId as useId3 } from "react";
|
|
2057
|
-
import { Badge as Badge4, Group as Group6, Paper as Paper4, Stack as Stack7, Text as Text6 } from "@mantine/core";
|
|
2058
|
-
import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2059
|
-
var gdsChartTypeRegistry = {
|
|
2060
|
-
line: { type: "line", label: "Line", family: "cartesian", minDataPoints: 2, maxDataPoints: 500, summaryHint: "Trend over an ordered series." },
|
|
2061
|
-
area: { type: "area", label: "Area", family: "cartesian", minDataPoints: 2, maxDataPoints: 500, summaryHint: "Filled trend over an ordered series." },
|
|
2062
|
-
bar: { type: "bar", label: "Bar", family: "cartesian", minDataPoints: 1, maxDataPoints: 200, summaryHint: "Category comparison." },
|
|
2063
|
-
"stacked-bar": { type: "stacked-bar", label: "Stacked bar", family: "cartesian", minDataPoints: 2, maxDataPoints: 300, requiresGroup: true, summaryHint: "Grouped category contribution." },
|
|
2064
|
-
pie: { type: "pie", label: "Pie", family: "part-to-whole", minDataPoints: 2, maxDataPoints: 12, summaryHint: "Part-to-whole split." },
|
|
2065
|
-
donut: { type: "donut", label: "Donut", family: "part-to-whole", minDataPoints: 2, maxDataPoints: 12, summaryHint: "Part-to-whole split with center context." },
|
|
2066
|
-
radar: { type: "radar", label: "Radar", family: "radial", minDataPoints: 3, maxDataPoints: 24, summaryHint: "Multi-dimension profile." },
|
|
2067
|
-
scatter: { type: "scatter", label: "Scatter", family: "cartesian", minDataPoints: 2, maxDataPoints: 500, supportsSecondaryValue: true, summaryHint: "Correlation or distribution map." },
|
|
2068
|
-
bubble: { type: "bubble", label: "Bubble", family: "cartesian", minDataPoints: 2, maxDataPoints: 300, supportsSecondaryValue: true, summaryHint: "Weighted distribution map." },
|
|
2069
|
-
heatmap: { type: "heatmap", label: "Heatmap", family: "matrix", minDataPoints: 2, maxDataPoints: 400, summaryHint: "Intensity matrix." },
|
|
2070
|
-
funnel: { type: "funnel", label: "Funnel", family: "process", minDataPoints: 2, maxDataPoints: 12, summaryHint: "Stage conversion progression." },
|
|
2071
|
-
treemap: { type: "treemap", label: "Treemap", family: "hierarchy", minDataPoints: 2, maxDataPoints: 200, summaryHint: "Hierarchical distribution." },
|
|
2072
|
-
candlestick: { type: "candlestick", label: "Candlestick", family: "cartesian", minDataPoints: 1, maxDataPoints: 500, summaryHint: "Open-high-low-close price movement over time." },
|
|
2073
|
-
sankey: { type: "sankey", label: "Sankey", family: "process", minDataPoints: 1, maxDataPoints: 200, requiresGroup: false, summaryHint: "Flow volume between source and target stages." }
|
|
2074
|
-
};
|
|
2075
|
-
var gdsDefaultChartLegend = [
|
|
2076
|
-
{ label: "Primary series", token: "chart.series-1", description: "Primary measured value" },
|
|
2077
|
-
{ label: "Secondary series", token: "chart.series-2", description: "Grouped or comparative value" }
|
|
2078
|
-
];
|
|
2079
|
-
var gdsChartSetATypeRegistry = {
|
|
2080
|
-
line: gdsChartTypeRegistry.line,
|
|
2081
|
-
area: gdsChartTypeRegistry.area,
|
|
2082
|
-
bar: gdsChartTypeRegistry.bar,
|
|
2083
|
-
"stacked-bar": gdsChartTypeRegistry["stacked-bar"],
|
|
2084
|
-
pie: gdsChartTypeRegistry.pie,
|
|
2085
|
-
donut: gdsChartTypeRegistry.donut,
|
|
2086
|
-
radar: gdsChartTypeRegistry.radar,
|
|
2087
|
-
scatter: gdsChartTypeRegistry.scatter
|
|
2088
|
-
};
|
|
2089
|
-
var gdsChartSetBTypeRegistry = {
|
|
2090
|
-
bubble: gdsChartTypeRegistry.bubble,
|
|
2091
|
-
heatmap: gdsChartTypeRegistry.heatmap,
|
|
2092
|
-
funnel: gdsChartTypeRegistry.funnel,
|
|
2093
|
-
treemap: gdsChartTypeRegistry.treemap
|
|
2094
|
-
};
|
|
2095
|
-
var gdsChartSetCTypeRegistry = {
|
|
2096
|
-
candlestick: gdsChartTypeRegistry.candlestick,
|
|
2097
|
-
sankey: gdsChartTypeRegistry.sankey
|
|
2098
|
-
};
|
|
2099
|
-
function isGdsChartSetAType(type) {
|
|
2100
|
-
return type in gdsChartSetATypeRegistry;
|
|
2101
|
-
}
|
|
2102
|
-
function isGdsChartSetBType(type) {
|
|
2103
|
-
return type in gdsChartSetBTypeRegistry;
|
|
2104
|
-
}
|
|
2105
|
-
function isGdsChartSetCType(type) {
|
|
2106
|
-
return type in gdsChartSetCTypeRegistry;
|
|
2107
|
-
}
|
|
2108
|
-
function isFiniteNumber(value) {
|
|
2109
|
-
return typeof value === "number" && Number.isFinite(value);
|
|
2110
|
-
}
|
|
2111
|
-
function decimateGdsChartData(data, maxDataPoints) {
|
|
2112
|
-
if (data.length <= maxDataPoints) {
|
|
2113
|
-
return data;
|
|
2114
|
-
}
|
|
2115
|
-
if (maxDataPoints <= 1) {
|
|
2116
|
-
return data.slice(0, 1);
|
|
2117
|
-
}
|
|
2118
|
-
const lastIndex = data.length - 1;
|
|
2119
|
-
const selectedIndexes = /* @__PURE__ */ new Set();
|
|
2120
|
-
for (let index = 0; index < maxDataPoints; index += 1) {
|
|
2121
|
-
selectedIndexes.add(Math.round(index * lastIndex / (maxDataPoints - 1)));
|
|
2122
|
-
}
|
|
2123
|
-
return Array.from(selectedIndexes).sort((a, b) => a - b).map((index) => data[index]);
|
|
2124
|
-
}
|
|
2125
|
-
function getSetARendererLabel(type) {
|
|
2126
|
-
const labels = {
|
|
2127
|
-
line: "ordered trend path",
|
|
2128
|
-
area: "filled trend surface",
|
|
2129
|
-
bar: "category bars",
|
|
2130
|
-
"stacked-bar": "grouped category stacks",
|
|
2131
|
-
pie: "part-to-whole slices",
|
|
2132
|
-
donut: "part-to-whole ring",
|
|
2133
|
-
radar: "radial dimension profile",
|
|
2134
|
-
scatter: "x/y point field"
|
|
2135
|
-
};
|
|
2136
|
-
return labels[type] ?? "vendor-neutral chart surface";
|
|
2137
|
-
}
|
|
2138
|
-
function getSetBRendererLabel(type) {
|
|
2139
|
-
const labels = {
|
|
2140
|
-
bubble: "weighted x/y bubble field",
|
|
2141
|
-
heatmap: "row/column intensity matrix",
|
|
2142
|
-
funnel: "stage conversion progression",
|
|
2143
|
-
treemap: "hierarchical area distribution"
|
|
2144
|
-
};
|
|
2145
|
-
return labels[type] ?? "advanced chart surface";
|
|
2146
|
-
}
|
|
2147
|
-
function getSetCRendererLabel(type) {
|
|
2148
|
-
const labels = {
|
|
2149
|
-
candlestick: "open-high-low-close price series",
|
|
2150
|
-
sankey: "source-to-target flow diagram"
|
|
2151
|
-
};
|
|
2152
|
-
return labels[type] ?? "specialized chart surface";
|
|
2153
|
-
}
|
|
2154
|
-
function validateGdsChartData(type, data, config = {}) {
|
|
2155
|
-
const definition = gdsChartTypeRegistry[type];
|
|
2156
|
-
const minDataPoints = config.minDataPoints ?? definition.minDataPoints;
|
|
2157
|
-
const maxDataPoints = config.maxDataPoints ?? definition.maxDataPoints;
|
|
2158
|
-
const issues = [];
|
|
2159
|
-
let visibleData = data;
|
|
2160
|
-
let decimated = false;
|
|
2161
|
-
if (!data.length) {
|
|
2162
|
-
return { state: "empty", issues: ["Dataset is empty."], visibleData: [], definition };
|
|
2163
|
-
}
|
|
2164
|
-
if (data.length < minDataPoints) {
|
|
2165
|
-
return {
|
|
2166
|
-
state: "below-threshold",
|
|
2167
|
-
issues: [`${definition.label} charts require at least ${minDataPoints} data points.`],
|
|
2168
|
-
visibleData: data,
|
|
2169
|
-
definition
|
|
2170
|
-
};
|
|
2171
|
-
}
|
|
2172
|
-
if (data.length > maxDataPoints) {
|
|
2173
|
-
if (!config.decimateLargeSeries) {
|
|
2174
|
-
return {
|
|
2175
|
-
state: "error",
|
|
2176
|
-
issues: [`Dataset has ${data.length} points, above the ${maxDataPoints} point rendering budget.`],
|
|
2177
|
-
visibleData: data.slice(0, maxDataPoints),
|
|
2178
|
-
definition
|
|
2179
|
-
};
|
|
2180
|
-
}
|
|
2181
|
-
visibleData = decimateGdsChartData(data, maxDataPoints);
|
|
2182
|
-
decimated = true;
|
|
2183
|
-
issues.push(`Dataset has ${data.length} points and was decimated to ${visibleData.length} points for rendering.`);
|
|
2184
|
-
}
|
|
2185
|
-
visibleData.forEach((item, index) => {
|
|
2186
|
-
if (!item.label.trim()) {
|
|
2187
|
-
issues.push(`Point ${index + 1} is missing a visible label.`);
|
|
2188
|
-
}
|
|
2189
|
-
if (item.value === null && (type === "line" || type === "area") && "connectNulls" in config && config.connectNulls) {
|
|
2190
|
-
return;
|
|
2191
|
-
}
|
|
2192
|
-
if (type === "candlestick") {
|
|
2193
|
-
return;
|
|
2194
|
-
}
|
|
2195
|
-
if (!isFiniteNumber(item.value)) {
|
|
2196
|
-
issues.push(`Point ${index + 1} has an invalid numeric value.`);
|
|
2197
|
-
}
|
|
2198
|
-
});
|
|
2199
|
-
if (definition.requiresGroup && visibleData.some((item) => !item.group)) {
|
|
2200
|
-
issues.push(`${definition.label} charts require a group value for every data point.`);
|
|
2201
|
-
}
|
|
2202
|
-
if (type === "pie" || type === "donut") {
|
|
2203
|
-
const numericValues = visibleData.map((item) => item.value).filter(isFiniteNumber);
|
|
2204
|
-
const total = numericValues.reduce((sum, value) => sum + value, 0);
|
|
2205
|
-
if (numericValues.some((value) => value < 0)) {
|
|
2206
|
-
issues.push(`${definition.label} charts cannot render negative slice values.`);
|
|
2207
|
-
}
|
|
2208
|
-
if (total <= 0) {
|
|
2209
|
-
issues.push(`${definition.label} charts require a positive total.`);
|
|
2210
|
-
}
|
|
2211
|
-
}
|
|
2212
|
-
if (type === "radar") {
|
|
2213
|
-
const numericValues = visibleData.map((item) => item.value).filter(isFiniteNumber);
|
|
2214
|
-
if (numericValues.some((value) => value < 0)) {
|
|
2215
|
-
issues.push("Radar charts cannot render negative axis values.");
|
|
2216
|
-
}
|
|
2217
|
-
}
|
|
2218
|
-
if (type === "scatter" && (!("requireSecondaryValue" in config) || config.requireSecondaryValue !== false)) {
|
|
2219
|
-
visibleData.forEach((item, index) => {
|
|
2220
|
-
if (!isFiniteNumber(item.secondaryValue)) {
|
|
2221
|
-
issues.push(`Scatter point ${index + 1} requires a numeric secondaryValue.`);
|
|
2222
|
-
}
|
|
2223
|
-
});
|
|
2224
|
-
}
|
|
2225
|
-
if (type === "bubble") {
|
|
2226
|
-
visibleData.forEach((item, index) => {
|
|
2227
|
-
if (!isFiniteNumber(item.secondaryValue)) {
|
|
2228
|
-
issues.push(`Bubble point ${index + 1} requires a numeric secondaryValue for bubble size.`);
|
|
2229
|
-
} else if (item.secondaryValue <= 0) {
|
|
2230
|
-
issues.push(`Bubble point ${index + 1} requires a positive secondaryValue for bubble size.`);
|
|
2231
|
-
}
|
|
2232
|
-
});
|
|
2233
|
-
}
|
|
2234
|
-
if (type === "heatmap") {
|
|
2235
|
-
visibleData.forEach((item, index) => {
|
|
2236
|
-
if (!item.group) {
|
|
2237
|
-
issues.push(`Heatmap cell ${index + 1} requires a group value for the matrix row.`);
|
|
2238
|
-
}
|
|
2239
|
-
});
|
|
2240
|
-
}
|
|
2241
|
-
if (type === "funnel") {
|
|
2242
|
-
const numericValues = visibleData.map((item) => item.value).filter(isFiniteNumber);
|
|
2243
|
-
if (numericValues.some((value) => value < 0)) {
|
|
2244
|
-
issues.push("Funnel charts cannot render negative stage values.");
|
|
2245
|
-
}
|
|
2246
|
-
const shouldEnforceDescending = !("enforceDescending" in config) || config.enforceDescending !== false;
|
|
2247
|
-
if (shouldEnforceDescending) {
|
|
2248
|
-
numericValues.forEach((value, index) => {
|
|
2249
|
-
const previousValue = numericValues[index - 1];
|
|
2250
|
-
if (index > 0 && value > previousValue) {
|
|
2251
|
-
issues.push(`Funnel stage ${index + 1} cannot be greater than the previous stage.`);
|
|
2252
|
-
}
|
|
2253
|
-
});
|
|
2254
|
-
}
|
|
2255
|
-
}
|
|
2256
|
-
if (type === "treemap") {
|
|
2257
|
-
visibleData.forEach((item, index) => {
|
|
2258
|
-
if (isFiniteNumber(item.value) && item.value <= 0) {
|
|
2259
|
-
issues.push(`Treemap node ${index + 1} requires a positive area value.`);
|
|
2260
|
-
}
|
|
2261
|
-
});
|
|
2262
|
-
}
|
|
2263
|
-
if (type === "candlestick") {
|
|
2264
|
-
visibleData.forEach((item, index) => {
|
|
2265
|
-
const { open, high, low, close } = item;
|
|
2266
|
-
if (![open, high, low, close].every(isFiniteNumber)) {
|
|
2267
|
-
issues.push(`Candlestick point ${index + 1} requires numeric open, high, low, and close values.`);
|
|
2268
|
-
return;
|
|
2269
|
-
}
|
|
2270
|
-
if (high < Math.max(open, close) || low > Math.min(open, close)) {
|
|
2271
|
-
issues.push(`Candlestick point ${index + 1} has a high/low range that doesn't contain its open/close values.`);
|
|
2272
|
-
}
|
|
2273
|
-
});
|
|
2274
|
-
}
|
|
2275
|
-
if (type === "sankey") {
|
|
2276
|
-
visibleData.forEach((item, index) => {
|
|
2277
|
-
if (!item.source || !item.target) {
|
|
2278
|
-
issues.push(`Sankey flow ${index + 1} requires both a source and a target node.`);
|
|
2279
|
-
}
|
|
2280
|
-
if (isFiniteNumber(item.value) && item.value < 0) {
|
|
2281
|
-
issues.push(`Sankey flow ${index + 1} cannot render a negative flow value.`);
|
|
2282
|
-
}
|
|
2283
|
-
});
|
|
2284
|
-
}
|
|
2285
|
-
return {
|
|
2286
|
-
state: issues.length ? decimated && issues.length === 1 ? "partial" : "error" : "ready",
|
|
2287
|
-
issues,
|
|
2288
|
-
visibleData,
|
|
2289
|
-
definition
|
|
2290
|
-
};
|
|
2291
|
-
}
|
|
2292
|
-
var DRAWN_CHART_TYPES = {
|
|
2293
|
-
line: "line",
|
|
2294
|
-
area: "area",
|
|
2295
|
-
bar: "bar",
|
|
2296
|
-
"stacked-bar": "stacked-bar",
|
|
2297
|
-
radar: "radar",
|
|
2298
|
-
heatmap: "heatmap"
|
|
2299
|
-
};
|
|
2300
|
-
function DefaultChartRenderer(context) {
|
|
2301
|
-
const { type, title, summary, data, definition, labelledBy, describedBy } = context;
|
|
2302
|
-
const drawn = DRAWN_CHART_TYPES[type];
|
|
2303
|
-
if (drawn) return semanticRenderer(drawn, "primary")(context);
|
|
2304
|
-
return /* @__PURE__ */ jsx12(Paper4, { withBorder: true, radius: "md", p: "md", role: "img", "aria-labelledby": labelledBy, "aria-describedby": describedBy, children: /* @__PURE__ */ jsxs11(Stack7, { gap: "sm", children: [
|
|
2305
|
-
/* @__PURE__ */ jsxs11(Group6, { justify: "space-between", children: [
|
|
2306
|
-
/* @__PURE__ */ jsx12(Text6, { id: labelledBy, fw: 700, children: title }),
|
|
2307
|
-
/* @__PURE__ */ jsx12(Badge4, { variant: "light", children: type })
|
|
2308
|
-
] }),
|
|
2309
|
-
/* @__PURE__ */ jsx12(Text6, { id: describedBy, size: "sm", c: "dimmed", children: summary }),
|
|
2310
|
-
/* @__PURE__ */ jsxs11(Text6, { size: "xs", c: "dimmed", children: [
|
|
2311
|
-
"Type lane: ",
|
|
2312
|
-
type
|
|
2313
|
-
] }),
|
|
2314
|
-
/* @__PURE__ */ jsxs11(Text6, { size: "xs", c: "dimmed", children: [
|
|
2315
|
-
"Registry family: ",
|
|
2316
|
-
definition.family
|
|
2317
|
-
] }),
|
|
2318
|
-
isGdsChartSetAType(type) ? /* @__PURE__ */ jsxs11(Text6, { size: "xs", c: "dimmed", children: [
|
|
2319
|
-
"Set A primitive: ",
|
|
2320
|
-
getSetARendererLabel(type)
|
|
2321
|
-
] }) : null,
|
|
2322
|
-
isGdsChartSetBType(type) ? /* @__PURE__ */ jsxs11(Text6, { size: "xs", c: "dimmed", children: [
|
|
2323
|
-
"Set B primitive: ",
|
|
2324
|
-
getSetBRendererLabel(type)
|
|
2325
|
-
] }) : null,
|
|
2326
|
-
isGdsChartSetCType(type) ? /* @__PURE__ */ jsxs11(Text6, { size: "xs", c: "dimmed", children: [
|
|
2327
|
-
"Set C primitive: ",
|
|
2328
|
-
getSetCRendererLabel(type)
|
|
2329
|
-
] }) : null,
|
|
2330
|
-
/* @__PURE__ */ jsxs11(Text6, { size: "xs", c: "dimmed", children: [
|
|
2331
|
-
"Data points: ",
|
|
2332
|
-
data.length
|
|
2333
|
-
] })
|
|
2334
|
-
] }) });
|
|
2335
|
-
}
|
|
2336
|
-
function GdsChart({
|
|
2337
|
-
type,
|
|
2338
|
-
title,
|
|
2339
|
-
summary,
|
|
2340
|
-
data,
|
|
2341
|
-
config = {},
|
|
2342
|
-
legend = gdsDefaultChartLegend,
|
|
2343
|
-
state,
|
|
2344
|
-
retryAction,
|
|
2345
|
-
renderer
|
|
2346
|
-
}) {
|
|
2347
|
-
const labelledBy = useId3();
|
|
2348
|
-
const describedBy = useId3();
|
|
2349
|
-
const validation = validateGdsChartData(type, data, config);
|
|
2350
|
-
const resolvedState = state ?? validation.state;
|
|
2351
|
-
const tableRows = validation.visibleData.map((item) => ({
|
|
2352
|
-
label: item.label,
|
|
2353
|
-
value: config.valueFormatter ? config.valueFormatter(item.value) : String(item.value ?? "missing"),
|
|
2354
|
-
secondaryValue: item.secondaryValue === void 0 || item.secondaryValue === null ? "-" : String(item.secondaryValue),
|
|
2355
|
-
group: item.group ?? "-"
|
|
2356
|
-
}));
|
|
2357
|
-
const Renderer = renderer ?? DefaultChartRenderer;
|
|
2358
|
-
const hasSecondary = tableRows.some((row) => row.secondaryValue !== "-");
|
|
2359
|
-
const hasGroup = tableRows.some((row) => row.group !== "-");
|
|
2360
|
-
return /* @__PURE__ */ jsx12(
|
|
2361
|
-
ChartTokenPanel,
|
|
2362
|
-
{
|
|
2363
|
-
title,
|
|
2364
|
-
description: `${validation.definition.label} chart. ${validation.definition.summaryHint}`,
|
|
2365
|
-
summary: validation.issues.length ? `${summary} ${validation.issues.join(" ")}` : summary,
|
|
2366
|
-
state: resolvedState,
|
|
2367
|
-
retryAction,
|
|
2368
|
-
legend,
|
|
2369
|
-
tableFallback: /* @__PURE__ */ jsx12(
|
|
2370
|
-
SimpleDataTable,
|
|
2371
|
-
{
|
|
2372
|
-
columns: [
|
|
2373
|
-
{ key: "label", header: "Label" },
|
|
2374
|
-
{ key: "value", header: config.tableValueHeader ?? "Value" },
|
|
2375
|
-
...hasSecondary ? [{ key: "secondaryValue", header: "Secondary value" }] : [],
|
|
2376
|
-
...hasGroup ? [{ key: "group", header: config.groupLabel ?? "Group" }] : []
|
|
2377
|
-
],
|
|
2378
|
-
rows: tableRows
|
|
2379
|
-
}
|
|
2380
|
-
),
|
|
2381
|
-
children: resolvedState === "ready" || resolvedState === "partial" || resolvedState === "permission-limited" ? /* @__PURE__ */ jsx12(
|
|
2382
|
-
Renderer,
|
|
2383
|
-
{
|
|
2384
|
-
type,
|
|
2385
|
-
title,
|
|
2386
|
-
summary,
|
|
2387
|
-
data: validation.visibleData,
|
|
2388
|
-
config,
|
|
2389
|
-
definition: validation.definition,
|
|
2390
|
-
labelledBy,
|
|
2391
|
-
describedBy
|
|
2392
|
-
}
|
|
2393
|
-
) : null
|
|
2394
|
-
}
|
|
2395
|
-
);
|
|
2396
|
-
}
|
|
2397
|
-
|
|
2398
|
-
export {
|
|
2399
|
-
normalizeGdsResponsiveValue,
|
|
2400
|
-
resolveGdsLayoutStyle,
|
|
2401
|
-
GdsBox,
|
|
2402
|
-
GdsStack,
|
|
2403
|
-
GdsInline,
|
|
2404
|
-
GdsCluster,
|
|
2405
|
-
GdsGrid,
|
|
2406
|
-
GdsColumnGrid,
|
|
2407
|
-
GdsColumnGridItem,
|
|
2408
|
-
GdsSplit,
|
|
2409
|
-
GdsSidebar,
|
|
2410
|
-
GdsBleed,
|
|
2411
|
-
GdsContainer,
|
|
2412
|
-
GdsVocabulary,
|
|
2413
|
-
createGdsVocabularyPack,
|
|
2414
|
-
mergeGdsVocabularyPacks,
|
|
2415
|
-
resolveSemanticActionConfig,
|
|
2416
|
-
getSemanticActionConfig,
|
|
2417
|
-
getSemanticActionLabel,
|
|
2418
|
-
gdsBadgeAccentColors,
|
|
2419
|
-
gdsBadgeAccentShades,
|
|
2420
|
-
GdsBadge,
|
|
2421
|
-
SectionPanel,
|
|
2422
|
-
ReferenceSection,
|
|
2423
|
-
ActionBar,
|
|
2424
|
-
gdsSeededRandom,
|
|
2425
|
-
gdsGeneratedPaletteCssRefs,
|
|
2426
|
-
resolveGdsGeneratedPaletteHex,
|
|
2427
|
-
GdsGeneratedThumbnail,
|
|
2428
|
-
gdsCardSizePaddingMap,
|
|
2429
|
-
gdsCardDensityPaddingMap,
|
|
2430
|
-
gdsCardTitleOrderMap,
|
|
2431
|
-
gdsCardGapMap,
|
|
2432
|
-
gdsCardMediaRatioMap,
|
|
2433
|
-
resolveGdsCardContract,
|
|
2434
|
-
MAX_LISTING_CARD_ACTIONS,
|
|
2435
|
-
GDS_LISTING_TILE_SIZE_PX,
|
|
2436
|
-
GDS_LISTING_PICK_BADGE_INSET_PX,
|
|
2437
|
-
GDS_LISTING_PICK_BADGE_ICON_PX,
|
|
2438
|
-
GDS_LISTING_PICK_BADGE_FONT_SIZE_PX,
|
|
2439
|
-
GDS_LISTING_PICK_BADGE_LINE_HEIGHT_PX,
|
|
2440
|
-
GDS_LISTING_PICK_BADGE_PADDING_BLOCK_PX,
|
|
2441
|
-
GDS_LISTING_PICK_BADGE_PADDING_INLINE_PX,
|
|
2442
|
-
ListingCard,
|
|
2443
|
-
gdsLocales,
|
|
2444
|
-
getGdsMessages,
|
|
2445
|
-
createGdsOwnedContrastTokens,
|
|
2446
|
-
getGdsOwnedContrastProps,
|
|
2447
|
-
FormField,
|
|
2448
|
-
SimpleDataTable,
|
|
2449
|
-
gdsSeriesPalette,
|
|
2450
|
-
getGdsSeriesColor,
|
|
2451
|
-
GDS_CHART_SERIES_COLORS,
|
|
2452
|
-
GDS_CHART_SERIES_SLOTS,
|
|
2453
|
-
getGdsChartSeriesColor,
|
|
2454
|
-
resolveGdsChartTokenColor,
|
|
2455
|
-
ChartTokenPanel,
|
|
2456
|
-
SemanticChartFrame,
|
|
2457
|
-
semanticRenderer,
|
|
2458
|
-
gdsChartTypeRegistry,
|
|
2459
|
-
gdsDefaultChartLegend,
|
|
2460
|
-
gdsChartSetATypeRegistry,
|
|
2461
|
-
gdsChartSetBTypeRegistry,
|
|
2462
|
-
gdsChartSetCTypeRegistry,
|
|
2463
|
-
isGdsChartSetAType,
|
|
2464
|
-
isGdsChartSetBType,
|
|
2465
|
-
isGdsChartSetCType,
|
|
2466
|
-
validateGdsChartData,
|
|
2467
|
-
GdsChart
|
|
2468
|
-
};
|