@galaxy-io/dls 1.0.3
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/README.md +42 -0
- package/dist/accordion/Accordion.d.ts +30 -0
- package/dist/accordion/Accordion.js +147 -0
- package/dist/animations/Fade.d.ts +6 -0
- package/dist/animations/Fade.js +22 -0
- package/dist/animations/Flashing.d.ts +3 -0
- package/dist/animations/Flashing.js +14 -0
- package/dist/animations/RotateWithTransition.d.ts +8 -0
- package/dist/animations/RotateWithTransition.js +28 -0
- package/dist/animations/ScaleFade.d.ts +6 -0
- package/dist/animations/ScaleFade.js +31 -0
- package/dist/animations/SpinAnimation.d.ts +7 -0
- package/dist/animations/SpinAnimation.js +20 -0
- package/dist/animations/SpinVerticalAnimation.d.ts +6 -0
- package/dist/animations/SpinVerticalAnimation.js +19 -0
- package/dist/assets/components/GalaxyLogomarkDark.d.ts +3 -0
- package/dist/assets/components/GalaxyLogomarkDark.js +11 -0
- package/dist/assets/components/GalaxyLogomarkLight.d.ts +3 -0
- package/dist/assets/components/GalaxyLogomarkLight.js +17 -0
- package/dist/assets/components/GalaxyWordmarkDark.d.ts +3 -0
- package/dist/assets/components/GalaxyWordmarkDark.js +15 -0
- package/dist/assets/components/GalaxyWordmarkLight.d.ts +3 -0
- package/dist/assets/components/GalaxyWordmarkLight.js +28 -0
- package/dist/assets/components/enrichment/PerplexityIcon.d.ts +3 -0
- package/dist/assets/components/enrichment/PerplexityIcon.js +35 -0
- package/dist/assets/components/enrichment/TavilyIcon.d.ts +3 -0
- package/dist/assets/components/enrichment/TavilyIcon.js +15 -0
- package/dist/assets/components/onboarding/TenantSetupDark.d.ts +3 -0
- package/dist/assets/components/onboarding/TenantSetupDark.js +498 -0
- package/dist/assets/components/onboarding/TenantSetupLight.d.ts +3 -0
- package/dist/assets/components/onboarding/TenantSetupLight.js +482 -0
- package/dist/assets/components/onboarding/UserSetupDark.d.ts +3 -0
- package/dist/assets/components/onboarding/UserSetupDark.js +1086 -0
- package/dist/assets/components/onboarding/UserSetupLight.d.ts +3 -0
- package/dist/assets/components/onboarding/UserSetupLight.js +1024 -0
- package/dist/assets/components/onboarding/WorkspaceSetupBuildDark.d.ts +3 -0
- package/dist/assets/components/onboarding/WorkspaceSetupBuildDark.js +466 -0
- package/dist/assets/components/onboarding/WorkspaceSetupBuildLight.d.ts +3 -0
- package/dist/assets/components/onboarding/WorkspaceSetupBuildLight.js +460 -0
- package/dist/assets/components/onboarding/WorkspaceSetupConnectDark.d.ts +3 -0
- package/dist/assets/components/onboarding/WorkspaceSetupConnectDark.js +336 -0
- package/dist/assets/components/onboarding/WorkspaceSetupConnectLight.d.ts +3 -0
- package/dist/assets/components/onboarding/WorkspaceSetupConnectLight.js +336 -0
- package/dist/assets/components/onboarding/WorkspaceSetupIntegrateDark.d.ts +3 -0
- package/dist/assets/components/onboarding/WorkspaceSetupIntegrateDark.js +153 -0
- package/dist/assets/components/onboarding/WorkspaceSetupIntegrateLight.d.ts +3 -0
- package/dist/assets/components/onboarding/WorkspaceSetupIntegrateLight.js +153 -0
- package/dist/assets/components/projects/MappingMethodAutoIntrospectDark.d.ts +3 -0
- package/dist/assets/components/projects/MappingMethodAutoIntrospectDark.js +117 -0
- package/dist/assets/components/projects/MappingMethodAutoIntrospectLight.d.ts +3 -0
- package/dist/assets/components/projects/MappingMethodAutoIntrospectLight.js +117 -0
- package/dist/assets/components/projects/MappingMethodBlankDark.d.ts +3 -0
- package/dist/assets/components/projects/MappingMethodBlankDark.js +150 -0
- package/dist/assets/components/projects/MappingMethodBlankDarkHovered.d.ts +3 -0
- package/dist/assets/components/projects/MappingMethodBlankDarkHovered.js +150 -0
- package/dist/assets/components/projects/MappingMethodBlankLight.d.ts +3 -0
- package/dist/assets/components/projects/MappingMethodBlankLight.js +150 -0
- package/dist/assets/components/projects/MappingMethodBlankLightHovered.d.ts +3 -0
- package/dist/assets/components/projects/MappingMethodBlankLightHovered.js +150 -0
- package/dist/assets/components/projects/MappingMethodJsonDark.d.ts +3 -0
- package/dist/assets/components/projects/MappingMethodJsonDark.js +90 -0
- package/dist/assets/components/projects/MappingMethodJsonDarkHovered.d.ts +3 -0
- package/dist/assets/components/projects/MappingMethodJsonDarkHovered.js +90 -0
- package/dist/assets/components/projects/MappingMethodJsonLight.d.ts +3 -0
- package/dist/assets/components/projects/MappingMethodJsonLight.js +90 -0
- package/dist/assets/components/projects/MappingMethodJsonLightHovered.d.ts +3 -0
- package/dist/assets/components/projects/MappingMethodJsonLightHovered.js +90 -0
- package/dist/assets/components/projects/ProjectsEmptyStateDark.d.ts +3 -0
- package/dist/assets/components/projects/ProjectsEmptyStateDark.js +454 -0
- package/dist/assets/components/projects/ProjectsEmptyStateLight.d.ts +3 -0
- package/dist/assets/components/projects/ProjectsEmptyStateLight.js +456 -0
- package/dist/assets/components/root/CreateProjectActionCardDark.d.ts +3 -0
- package/dist/assets/components/root/CreateProjectActionCardDark.js +1796 -0
- package/dist/assets/components/root/CreateProjectActionCardDarkHovered.d.ts +3 -0
- package/dist/assets/components/root/CreateProjectActionCardDarkHovered.js +1796 -0
- package/dist/assets/components/root/CreateProjectActionCardLight.d.ts +3 -0
- package/dist/assets/components/root/CreateProjectActionCardLight.js +1786 -0
- package/dist/assets/components/root/CreateProjectActionCardLightHovered.d.ts +3 -0
- package/dist/assets/components/root/CreateProjectActionCardLightHovered.js +1786 -0
- package/dist/assets/components/root/CreateSourceActionCardDark.d.ts +3 -0
- package/dist/assets/components/root/CreateSourceActionCardDark.js +879 -0
- package/dist/assets/components/root/CreateSourceActionCardDarkHovered.d.ts +3 -0
- package/dist/assets/components/root/CreateSourceActionCardDarkHovered.js +879 -0
- package/dist/assets/components/root/CreateSourceActionCardLight.d.ts +3 -0
- package/dist/assets/components/root/CreateSourceActionCardLight.js +889 -0
- package/dist/assets/components/root/CreateSourceActionCardLightHovered.d.ts +3 -0
- package/dist/assets/components/root/CreateSourceActionCardLightHovered.js +889 -0
- package/dist/assets/components/sources/AttioIcon.d.ts +3 -0
- package/dist/assets/components/sources/AttioIcon.js +11 -0
- package/dist/assets/components/sources/BigquerySourceIcon.d.ts +3 -0
- package/dist/assets/components/sources/BigquerySourceIcon.js +39 -0
- package/dist/assets/components/sources/BrowserbaseSourceIcon.d.ts +3 -0
- package/dist/assets/components/sources/BrowserbaseSourceIcon.js +35 -0
- package/dist/assets/components/sources/ClickhouseLogoSourceIconDark.d.ts +3 -0
- package/dist/assets/components/sources/ClickhouseLogoSourceIconDark.js +13 -0
- package/dist/assets/components/sources/ClickhouseLogoSourceIconLight.d.ts +3 -0
- package/dist/assets/components/sources/ClickhouseLogoSourceIconLight.js +13 -0
- package/dist/assets/components/sources/ConfluenceSourceIcon.d.ts +3 -0
- package/dist/assets/components/sources/ConfluenceSourceIcon.js +30 -0
- package/dist/assets/components/sources/GalaxyFileUploadSourceIcon.d.ts +3 -0
- package/dist/assets/components/sources/GalaxyFileUploadSourceIcon.js +16 -0
- package/dist/assets/components/sources/GalaxyTextSourceIcon.d.ts +3 -0
- package/dist/assets/components/sources/GalaxyTextSourceIcon.js +16 -0
- package/dist/assets/components/sources/GalaxyWebhookSourceIcon.d.ts +3 -0
- package/dist/assets/components/sources/GalaxyWebhookSourceIcon.js +16 -0
- package/dist/assets/components/sources/GithubSourceIcon.d.ts +3 -0
- package/dist/assets/components/sources/GithubSourceIcon.js +27 -0
- package/dist/assets/components/sources/GoogleDriveIcon.d.ts +3 -0
- package/dist/assets/components/sources/GoogleDriveIcon.js +45 -0
- package/dist/assets/components/sources/HubspotSourceIcon.d.ts +3 -0
- package/dist/assets/components/sources/HubspotSourceIcon.js +14 -0
- package/dist/assets/components/sources/JiraSourceIcon.d.ts +3 -0
- package/dist/assets/components/sources/JiraSourceIcon.js +54 -0
- package/dist/assets/components/sources/LinearSourceIcon.d.ts +3 -0
- package/dist/assets/components/sources/LinearSourceIcon.js +14 -0
- package/dist/assets/components/sources/MysqlLogoSourceIconDark.d.ts +3 -0
- package/dist/assets/components/sources/MysqlLogoSourceIconDark.js +17 -0
- package/dist/assets/components/sources/MysqlLogoSourceIconLight.d.ts +3 -0
- package/dist/assets/components/sources/MysqlLogoSourceIconLight.js +17 -0
- package/dist/assets/components/sources/NetsuiteSourceIcon.d.ts +3 -0
- package/dist/assets/components/sources/NetsuiteSourceIcon.js +32 -0
- package/dist/assets/components/sources/NotionIcon.d.ts +3 -0
- package/dist/assets/components/sources/NotionIcon.js +20 -0
- package/dist/assets/components/sources/NotionLogoSourceIconDark.d.ts +3 -0
- package/dist/assets/components/sources/NotionLogoSourceIconDark.js +10 -0
- package/dist/assets/components/sources/NotionLogoSourceIconLight.d.ts +3 -0
- package/dist/assets/components/sources/NotionLogoSourceIconLight.js +13 -0
- package/dist/assets/components/sources/PostgresLogoSourceIconDark.d.ts +3 -0
- package/dist/assets/components/sources/PostgresLogoSourceIconDark.js +28 -0
- package/dist/assets/components/sources/PostgresLogoSourceIconLight.d.ts +3 -0
- package/dist/assets/components/sources/PostgresLogoSourceIconLight.js +28 -0
- package/dist/assets/components/sources/PostgresqlIcon.d.ts +3 -0
- package/dist/assets/components/sources/PostgresqlIcon.js +61 -0
- package/dist/assets/components/sources/PostgresqlLogoSourceIconDark.d.ts +3 -0
- package/dist/assets/components/sources/PostgresqlLogoSourceIconDark.js +10 -0
- package/dist/assets/components/sources/PostgresqlLogoSourceIconLight.d.ts +3 -0
- package/dist/assets/components/sources/PostgresqlLogoSourceIconLight.js +13 -0
- package/dist/assets/components/sources/S3Icon.d.ts +3 -0
- package/dist/assets/components/sources/S3Icon.js +76 -0
- package/dist/assets/components/sources/S3LogoSourceIconDark.d.ts +3 -0
- package/dist/assets/components/sources/S3LogoSourceIconDark.js +10 -0
- package/dist/assets/components/sources/S3LogoSourceIconLight.d.ts +3 -0
- package/dist/assets/components/sources/S3LogoSourceIconLight.js +13 -0
- package/dist/assets/components/sources/SalesforceSourceIcon.d.ts +3 -0
- package/dist/assets/components/sources/SalesforceSourceIcon.js +23 -0
- package/dist/assets/components/sources/SlackIcon.d.ts +3 -0
- package/dist/assets/components/sources/SlackIcon.js +32 -0
- package/dist/assets/components/sources/SlackLogoSourceIconDark.d.ts +3 -0
- package/dist/assets/components/sources/SlackLogoSourceIconDark.js +15 -0
- package/dist/assets/components/sources/SlackLogoSourceIconLight.d.ts +3 -0
- package/dist/assets/components/sources/SlackLogoSourceIconLight.js +15 -0
- package/dist/assets/components/sources/SnowflakeLogoSourceIconDark.d.ts +3 -0
- package/dist/assets/components/sources/SnowflakeLogoSourceIconDark.js +14 -0
- package/dist/assets/components/sources/SnowflakeLogoSourceIconLight.d.ts +3 -0
- package/dist/assets/components/sources/SnowflakeLogoSourceIconLight.js +14 -0
- package/dist/assets/components/sources/SourcesEmptyStateDark.d.ts +3 -0
- package/dist/assets/components/sources/SourcesEmptyStateDark.js +432 -0
- package/dist/assets/components/sources/SourcesEmptyStateLight.d.ts +3 -0
- package/dist/assets/components/sources/SourcesEmptyStateLight.js +434 -0
- package/dist/assets/components/sources/WikipediaSourceIcon.d.ts +3 -0
- package/dist/assets/components/sources/WikipediaSourceIcon.js +1490 -0
- package/dist/assets/models/galaxy-logomark.js +4 -0
- package/dist/avatar/Avatar.d.ts +9 -0
- package/dist/avatar/Avatar.js +52 -0
- package/dist/avatar/AvatarEmpty.d.ts +36 -0
- package/dist/avatar/AvatarEmpty.js +43 -0
- package/dist/avatar/AvatarShimmer.d.ts +28 -0
- package/dist/avatar/AvatarShimmer.js +21 -0
- package/dist/avatar/GalaxyAvatar.d.ts +6 -0
- package/dist/avatar/GalaxyAvatar.js +36 -0
- package/dist/avatar/types.d.ts +5 -0
- package/dist/avatar/types.js +9 -0
- package/dist/backgrounds/CellGridBackground.d.ts +13 -0
- package/dist/backgrounds/CellGridBackground.js +39 -0
- package/dist/backgrounds/CrossGridBackground.d.ts +14 -0
- package/dist/backgrounds/CrossGridBackground.js +45 -0
- package/dist/backgrounds/DotGridBackground.d.ts +13 -0
- package/dist/backgrounds/DotGridBackground.js +43 -0
- package/dist/badge/Badge.d.ts +30 -0
- package/dist/badge/Badge.js +92 -0
- package/dist/beacons/Beacon.d.ts +43 -0
- package/dist/beacons/Beacon.js +68 -0
- package/dist/buttons/Button.d.ts +30 -0
- package/dist/buttons/Button.js +173 -0
- package/dist/charts/BarChart.d.ts +21 -0
- package/dist/charts/BarChart.js +264 -0
- package/dist/charts/ChartAxis.d.ts +28 -0
- package/dist/charts/ChartAxis.js +94 -0
- package/dist/charts/ChartLegend.d.ts +7 -0
- package/dist/charts/ChartLegend.js +30 -0
- package/dist/charts/ChartTooltip.d.ts +7 -0
- package/dist/charts/ChartTooltip.js +66 -0
- package/dist/charts/LineChart.d.ts +22 -0
- package/dist/charts/LineChart.js +250 -0
- package/dist/charts/PieChart.d.ts +35 -0
- package/dist/charts/PieChart.js +183 -0
- package/dist/charts/constants.d.ts +22 -0
- package/dist/charts/constants.js +38 -0
- package/dist/charts/types.d.ts +80 -0
- package/dist/charts/types.js +0 -0
- package/dist/charts/utils.d.ts +29 -0
- package/dist/charts/utils.js +62 -0
- package/dist/chips/Chip.d.ts +39 -0
- package/dist/chips/Chip.js +185 -0
- package/dist/containers/FlexItem.d.ts +28 -0
- package/dist/containers/FlexItem.js +93 -0
- package/dist/containers/FlexWrapper.d.ts +147 -0
- package/dist/containers/FlexWrapper.js +122 -0
- package/dist/containers/GridWrapper.d.ts +120 -0
- package/dist/containers/GridWrapper.js +117 -0
- package/dist/containers/Spacing.d.ts +13 -0
- package/dist/containers/Spacing.js +52 -0
- package/dist/containers/Wrapper.d.ts +16 -0
- package/dist/containers/Wrapper.js +50 -0
- package/dist/dividers/HorizontalDivider.d.ts +2 -0
- package/dist/dividers/HorizontalDivider.js +17 -0
- package/dist/dividers/VerticalDivider.d.ts +2 -0
- package/dist/dividers/VerticalDivider.js +17 -0
- package/dist/drawer/Drawer.d.ts +13 -0
- package/dist/drawer/Drawer.js +70 -0
- package/dist/dropdown/Dropdown.d.ts +51 -0
- package/dist/dropdown/Dropdown.js +136 -0
- package/dist/dropdown/DropdownButton.d.ts +18 -0
- package/dist/dropdown/DropdownButton.js +179 -0
- package/dist/dropdown/DropdownFooter.d.ts +10 -0
- package/dist/dropdown/DropdownFooter.js +35 -0
- package/dist/dropdown/DropdownItem.d.ts +10 -0
- package/dist/dropdown/DropdownItem.js +38 -0
- package/dist/editor/CodeEditor.d.ts +68 -0
- package/dist/editor/CodeEditor.js +435 -0
- package/dist/editor/CodeEditorReactWidget.d.ts +35 -0
- package/dist/editor/CodeEditorReactWidget.js +47 -0
- package/dist/hooks/useDismiss.d.ts +27 -0
- package/dist/hooks/useDismiss.js +37 -0
- package/dist/hooks/useElementWidth.d.ts +22 -0
- package/dist/hooks/useElementWidth.js +44 -0
- package/dist/hooks/useResize.d.ts +83 -0
- package/dist/hooks/useResize.js +114 -0
- package/dist/hotkeys/HotKeyBindings.d.ts +7 -0
- package/dist/hotkeys/HotKeyBindings.js +23 -0
- package/dist/hotkeys/HotKeySymbol.d.ts +13 -0
- package/dist/hotkeys/HotKeySymbol.js +49 -0
- package/dist/icons/BackIcon.d.ts +3 -0
- package/dist/icons/BackIcon.js +13 -0
- package/dist/icons/CloseIcon.d.ts +3 -0
- package/dist/icons/CloseIcon.js +13 -0
- package/dist/icons/CreateIcon.d.ts +3 -0
- package/dist/icons/CreateIcon.js +13 -0
- package/dist/icons/ForwardIcon.d.ts +3 -0
- package/dist/icons/ForwardIcon.js +13 -0
- package/dist/icons/GalaxyLogomark.d.ts +5 -0
- package/dist/icons/GalaxyLogomark.js +21 -0
- package/dist/icons/GalaxyLogomark3D.d.ts +41 -0
- package/dist/icons/GalaxyLogomark3D.js +310 -0
- package/dist/icons/GalaxyWordmark.d.ts +5 -0
- package/dist/icons/GalaxyWordmark.js +21 -0
- package/dist/icons/HelpIcon.d.ts +3 -0
- package/dist/icons/HelpIcon.js +14 -0
- package/dist/icons/Icon.d.ts +41 -0
- package/dist/icons/Icon.js +51 -0
- package/dist/icons/ProjectsIcon.d.ts +3 -0
- package/dist/icons/ProjectsIcon.js +12 -0
- package/dist/icons/SearchIcon.d.ts +3 -0
- package/dist/icons/SearchIcon.js +12 -0
- package/dist/icons/SourcesIcon.d.ts +3 -0
- package/dist/icons/SourcesIcon.js +12 -0
- package/dist/icons/TextIcon.d.ts +4 -0
- package/dist/icons/TextIcon.js +22 -0
- package/dist/icons/WebScrapeIcon.d.ts +4 -0
- package/dist/icons/WebScrapeIcon.js +22 -0
- package/dist/icons/WebhookIcon.d.ts +4 -0
- package/dist/icons/WebhookIcon.js +22 -0
- package/dist/icons/sources/AttioLogomark.d.ts +4 -0
- package/dist/icons/sources/AttioLogomark.js +8 -0
- package/dist/icons/sources/BrowserbaseLogomark.d.ts +4 -0
- package/dist/icons/sources/BrowserbaseLogomark.js +8 -0
- package/dist/icons/sources/ClickhouseLogomark.d.ts +4 -0
- package/dist/icons/sources/ClickhouseLogomark.js +16 -0
- package/dist/icons/sources/ConfluenceLogomark.d.ts +4 -0
- package/dist/icons/sources/ConfluenceLogomark.js +8 -0
- package/dist/icons/sources/GithubLogomark.d.ts +4 -0
- package/dist/icons/sources/GithubLogomark.js +8 -0
- package/dist/icons/sources/GoogleBigqueryLogomark.d.ts +4 -0
- package/dist/icons/sources/GoogleBigqueryLogomark.js +8 -0
- package/dist/icons/sources/GoogleDriveLogomark.d.ts +4 -0
- package/dist/icons/sources/GoogleDriveLogomark.js +8 -0
- package/dist/icons/sources/HubspotLogomark.d.ts +4 -0
- package/dist/icons/sources/HubspotLogomark.js +8 -0
- package/dist/icons/sources/JiraLogomark.d.ts +4 -0
- package/dist/icons/sources/JiraLogomark.js +8 -0
- package/dist/icons/sources/LinearLogomark.d.ts +4 -0
- package/dist/icons/sources/LinearLogomark.js +8 -0
- package/dist/icons/sources/MySQLLogomark.d.ts +4 -0
- package/dist/icons/sources/MySQLLogomark.js +8 -0
- package/dist/icons/sources/NetsuiteLogomark.d.ts +4 -0
- package/dist/icons/sources/NetsuiteLogomark.js +8 -0
- package/dist/icons/sources/NotionLogomark.d.ts +4 -0
- package/dist/icons/sources/NotionLogomark.js +8 -0
- package/dist/icons/sources/PostgresLogomark.d.ts +4 -0
- package/dist/icons/sources/PostgresLogomark.js +8 -0
- package/dist/icons/sources/S3Logomark.d.ts +4 -0
- package/dist/icons/sources/S3Logomark.js +8 -0
- package/dist/icons/sources/SalesforceLogomark.d.ts +4 -0
- package/dist/icons/sources/SalesforceLogomark.js +8 -0
- package/dist/icons/sources/SlackLogoIconmark.d.ts +4 -0
- package/dist/icons/sources/SlackLogoIconmark.js +8 -0
- package/dist/icons/sources/SnowflakeLogomark.d.ts +4 -0
- package/dist/icons/sources/SnowflakeLogomark.js +16 -0
- package/dist/icons/sources/WikipediaLogomark.d.ts +4 -0
- package/dist/icons/sources/WikipediaLogomark.js +8 -0
- package/dist/inputs/CheckboxInput.d.ts +20 -0
- package/dist/inputs/CheckboxInput.js +97 -0
- package/dist/inputs/ColorInput.d.ts +20 -0
- package/dist/inputs/ColorInput.js +368 -0
- package/dist/inputs/CopyInput.d.ts +15 -0
- package/dist/inputs/CopyInput.js +46 -0
- package/dist/inputs/DateInput.d.ts +19 -0
- package/dist/inputs/DateInput.js +498 -0
- package/dist/inputs/Input.d.ts +91 -0
- package/dist/inputs/Input.js +205 -0
- package/dist/inputs/MultiSelectInput.d.ts +38 -0
- package/dist/inputs/MultiSelectInput.js +566 -0
- package/dist/inputs/MultiTextInput.d.ts +27 -0
- package/dist/inputs/MultiTextInput.js +178 -0
- package/dist/inputs/NumberInput.d.ts +4 -0
- package/dist/inputs/NumberInput.js +34 -0
- package/dist/inputs/PasswordInput.d.ts +4 -0
- package/dist/inputs/PasswordInput.js +40 -0
- package/dist/inputs/RadioInput.d.ts +20 -0
- package/dist/inputs/RadioInput.js +108 -0
- package/dist/inputs/SelectInput.d.ts +51 -0
- package/dist/inputs/SelectInput.js +528 -0
- package/dist/inputs/SliderInput.d.ts +16 -0
- package/dist/inputs/SliderInput.js +172 -0
- package/dist/inputs/TextAreaInput.d.ts +40 -0
- package/dist/inputs/TextAreaInput.js +238 -0
- package/dist/inputs/TextInput.d.ts +4 -0
- package/dist/inputs/TextInput.js +53 -0
- package/dist/inputs/ToggleInput.d.ts +11 -0
- package/dist/inputs/ToggleInput.js +100 -0
- package/dist/inputs/hooks.d.ts +10 -0
- package/dist/inputs/hooks.js +22 -0
- package/dist/links/Link.d.ts +2 -0
- package/dist/links/Link.js +10 -0
- package/dist/lists/BulletedList.d.ts +11 -0
- package/dist/lists/BulletedList.js +41 -0
- package/dist/metrics/MetricItem.d.ts +15 -0
- package/dist/metrics/MetricItem.js +53 -0
- package/dist/metrics/ProgressBar.d.ts +15 -0
- package/dist/metrics/ProgressBar.js +60 -0
- package/dist/modal/Modal.d.ts +7 -0
- package/dist/modal/Modal.js +52 -0
- package/dist/overlay/OverlayProvider.d.ts +26 -0
- package/dist/overlay/OverlayProvider.js +92 -0
- package/dist/overlay/constants.d.ts +27 -0
- package/dist/overlay/constants.js +36 -0
- package/dist/overlay/useOverlay.d.ts +7 -0
- package/dist/overlay/useOverlay.js +46 -0
- package/dist/resizable/HorizontalResizeHandle.d.ts +10 -0
- package/dist/resizable/HorizontalResizeHandle.js +32 -0
- package/dist/resizable/VerticalResizeHandle.d.ts +11 -0
- package/dist/resizable/VerticalResizeHandle.js +33 -0
- package/dist/shapes/Circle.d.ts +6 -0
- package/dist/shapes/Circle.js +25 -0
- package/dist/spreadsheet/InfiniteSpreadsheet.d.ts +3 -0
- package/dist/spreadsheet/InfiniteSpreadsheet.js +265 -0
- package/dist/spreadsheet/SpreadsheetAddColumnButton.d.ts +6 -0
- package/dist/spreadsheet/SpreadsheetAddColumnButton.js +32 -0
- package/dist/spreadsheet/SpreadsheetCell.d.ts +19 -0
- package/dist/spreadsheet/SpreadsheetCell.js +115 -0
- package/dist/spreadsheet/SpreadsheetCellEditor.d.ts +11 -0
- package/dist/spreadsheet/SpreadsheetCellEditor.js +95 -0
- package/dist/spreadsheet/SpreadsheetHeaderCell.d.ts +13 -0
- package/dist/spreadsheet/SpreadsheetHeaderCell.js +125 -0
- package/dist/spreadsheet/SpreadsheetRow.d.ts +21 -0
- package/dist/spreadsheet/SpreadsheetRow.js +68 -0
- package/dist/spreadsheet/SpreadsheetRowActionCell.d.ts +11 -0
- package/dist/spreadsheet/SpreadsheetRowActionCell.js +60 -0
- package/dist/spreadsheet/hooks/useColumnResize.d.ts +6 -0
- package/dist/spreadsheet/hooks/useColumnResize.js +46 -0
- package/dist/spreadsheet/hooks/useSpreadsheetEditing.d.ts +13 -0
- package/dist/spreadsheet/hooks/useSpreadsheetEditing.js +41 -0
- package/dist/spreadsheet/types.d.ts +92 -0
- package/dist/spreadsheet/types.js +21 -0
- package/dist/styles.css +213 -0
- package/dist/switcher/Switcher.d.ts +11 -0
- package/dist/switcher/Switcher.js +41 -0
- package/dist/table/InfiniteTable.d.ts +83 -0
- package/dist/table/InfiniteTable.js +711 -0
- package/dist/table/VirtualizedInfiniteTable.d.ts +28 -0
- package/dist/table/VirtualizedInfiniteTable.js +359 -0
- package/dist/text/Bold.d.ts +3 -0
- package/dist/text/Bold.js +17 -0
- package/dist/text/Code.d.ts +3 -0
- package/dist/text/Code.js +27 -0
- package/dist/text/EditableText.d.ts +7 -0
- package/dist/text/EditableText.js +141 -0
- package/dist/text/Ellipsis.d.ts +10 -0
- package/dist/text/Ellipsis.js +28 -0
- package/dist/text/MarkdownText.d.ts +7 -0
- package/dist/text/MarkdownText.js +295 -0
- package/dist/text/Paragraph.d.ts +16 -0
- package/dist/text/Paragraph.js +76 -0
- package/dist/text/RequiredMarker.d.ts +6 -0
- package/dist/text/RequiredMarker.js +44 -0
- package/dist/text/Selectable.d.ts +3 -0
- package/dist/text/Selectable.js +15 -0
- package/dist/text/Text.d.ts +47 -0
- package/dist/text/Text.js +104 -0
- package/dist/text/TextShimmer.d.ts +7 -0
- package/dist/text/TextShimmer.js +30 -0
- package/dist/theme/GalaxyTheme.d.ts +36 -0
- package/dist/theme/GalaxyTheme.js +107 -0
- package/dist/theme/constants.d.ts +13 -0
- package/dist/theme/constants.js +43 -0
- package/dist/theme/index.d.ts +6 -0
- package/dist/theme/index.js +6 -0
- package/dist/theme/types.d.ts +174 -0
- package/dist/theme/types.js +0 -0
- package/dist/theme/typography.d.ts +2 -0
- package/dist/theme/typography.js +73 -0
- package/dist/theme/variants/dark.d.ts +2 -0
- package/dist/theme/variants/dark.js +125 -0
- package/dist/theme/variants/light.d.ts +2 -0
- package/dist/theme/variants/light.js +125 -0
- package/dist/tooltip/Tooltip.d.ts +37 -0
- package/dist/tooltip/Tooltip.js +79 -0
- package/dist/utils/colors.d.ts +84 -0
- package/dist/utils/colors.js +323 -0
- package/dist/utils/linaria.d.ts +1 -0
- package/dist/utils/linaria.js +8 -0
- package/dist/widget/Widget.d.ts +28 -0
- package/dist/widget/Widget.js +99 -0
- package/package.json +268 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { withTheme } from "../theme/GalaxyTheme.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import { styled } from "@linaria/react";
|
|
4
|
+
import { match } from "ts-pattern";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region src/beacons/Beacon.tsx
|
|
7
|
+
var BeaconSize = /* @__PURE__ */ function(BeaconSize) {
|
|
8
|
+
BeaconSize["SMALL"] = "SMALL";
|
|
9
|
+
BeaconSize["MEDIUM"] = "MEDIUM";
|
|
10
|
+
BeaconSize["LARGE"] = "LARGE";
|
|
11
|
+
return BeaconSize;
|
|
12
|
+
}({});
|
|
13
|
+
var BeaconVariant = /* @__PURE__ */ function(BeaconVariant) {
|
|
14
|
+
BeaconVariant["BASE"] = "BASE";
|
|
15
|
+
BeaconVariant["PRIMARY"] = "PRIMARY";
|
|
16
|
+
BeaconVariant["SECONDARY"] = "SECONDARY";
|
|
17
|
+
BeaconVariant["TERTIARY"] = "TERTIARY";
|
|
18
|
+
BeaconVariant["SUCCESS"] = "SUCCESS";
|
|
19
|
+
BeaconVariant["ERROR"] = "ERROR";
|
|
20
|
+
BeaconVariant["WARNING"] = "WARNING";
|
|
21
|
+
BeaconVariant["LIME"] = "LIME";
|
|
22
|
+
BeaconVariant["YELLOW"] = "YELLOW";
|
|
23
|
+
BeaconVariant["BLUE"] = "BLUE";
|
|
24
|
+
BeaconVariant["ORANGE"] = "ORANGE";
|
|
25
|
+
BeaconVariant["PINK"] = "PINK";
|
|
26
|
+
BeaconVariant["PURPLE"] = "PURPLE";
|
|
27
|
+
BeaconVariant["TEAL"] = "TEAL";
|
|
28
|
+
BeaconVariant["DISABLED"] = "DISABLED";
|
|
29
|
+
return BeaconVariant;
|
|
30
|
+
}({});
|
|
31
|
+
var _exp2 = () => ({ $size }) => match($size).returnType().with("SMALL", () => "6px").with("MEDIUM", () => "8px").with("LARGE", () => "10px").exhaustive();
|
|
32
|
+
var BeaconWrapper = /*#__PURE__*/ styled("div")({
|
|
33
|
+
name: "BeaconWrapper",
|
|
34
|
+
class: "bjccs5e",
|
|
35
|
+
propsAsIs: false,
|
|
36
|
+
vars: { "bjccs5e-0": [_exp2()] }
|
|
37
|
+
});
|
|
38
|
+
var _exp3 = () => ({ $speed }) => $speed ?? 2;
|
|
39
|
+
var _exp4 = () => ({ $variant, theme }) => {
|
|
40
|
+
return match($variant).returnType().with("BASE", () => theme.color.icon.primary).with("PRIMARY", () => theme.color.icon.primary).with("SECONDARY", () => theme.color.icon.secondary).with("TERTIARY", () => theme.color.background.tertiaryAlt).with("SUCCESS", () => theme.color.border.success).with("ERROR", () => theme.color.border.error).with("WARNING", () => theme.color.border.warning).with("LIME", () => theme.color.background.limeAlt).with("YELLOW", () => theme.color.background.yellowAlt).with("BLUE", () => theme.color.icon.blue).with("ORANGE", () => theme.color.background.orangeAlt).with("PINK", () => theme.color.background.pinkAlt).with("PURPLE", () => theme.color.background.purpleAlt).with("TEAL", () => theme.color.background.tealAlt).with("DISABLED", () => theme.color.background.disabled).exhaustive();
|
|
41
|
+
};
|
|
42
|
+
var BeaconPulse = withTheme(/*#__PURE__*/ styled("span")({
|
|
43
|
+
name: "BeaconPulse",
|
|
44
|
+
class: "barhcbn",
|
|
45
|
+
propsAsIs: false,
|
|
46
|
+
vars: {
|
|
47
|
+
"barhcbn-0": [_exp3(), "s"],
|
|
48
|
+
"barhcbn-1": [_exp4()]
|
|
49
|
+
}
|
|
50
|
+
}));
|
|
51
|
+
var _exp5 = () => ({ $variant, theme }) => {
|
|
52
|
+
return match($variant).returnType().with("BASE", () => theme.color.background.baseAlt).with("PRIMARY", () => theme.color.background.primaryAlt).with("SECONDARY", () => theme.color.background.secondaryAlt).with("TERTIARY", () => theme.color.background.tertiaryAlt).with("SUCCESS", () => theme.color.icon.success).with("ERROR", () => theme.color.icon.error).with("WARNING", () => theme.color.icon.warning).with("LIME", () => theme.color.background.limeAlt).with("YELLOW", () => theme.color.background.yellowAlt).with("BLUE", () => theme.color.icon.blue).with("ORANGE", () => theme.color.background.orangeAlt).with("PINK", () => theme.color.background.pinkAlt).with("PURPLE", () => theme.color.background.purpleAlt).with("TEAL", () => theme.color.background.tealAlt).with("DISABLED", () => theme.color.border.disabled).exhaustive();
|
|
53
|
+
};
|
|
54
|
+
var BeaconDot = withTheme(/*#__PURE__*/ styled("span")({
|
|
55
|
+
name: "BeaconDot",
|
|
56
|
+
class: "bv9nmr4",
|
|
57
|
+
propsAsIs: false,
|
|
58
|
+
vars: { "bv9nmr4-0": [_exp5()] }
|
|
59
|
+
}));
|
|
60
|
+
var Beacon = ({ variant = "BASE", size = "MEDIUM", speed, isPulse }) => /* @__PURE__ */ jsxs(BeaconWrapper, {
|
|
61
|
+
$size: size,
|
|
62
|
+
children: [isPulse && /* @__PURE__ */ jsx(BeaconPulse, {
|
|
63
|
+
$variant: variant,
|
|
64
|
+
$speed: speed
|
|
65
|
+
}), /* @__PURE__ */ jsx(BeaconDot, { $variant: variant })]
|
|
66
|
+
});
|
|
67
|
+
//#endregion
|
|
68
|
+
export { BeaconSize, BeaconVariant, Beacon as default };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Icon as PhosphorIcon } from "@phosphor-icons/react";
|
|
2
|
+
export interface ButtonProps {
|
|
3
|
+
label?: string;
|
|
4
|
+
icon?: PhosphorIcon;
|
|
5
|
+
variant?: ButtonVariant;
|
|
6
|
+
size?: ButtonSize;
|
|
7
|
+
onClick: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
8
|
+
onMouseEnter?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
9
|
+
onMouseLeave?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
10
|
+
isLoading?: boolean;
|
|
11
|
+
isDisabled?: boolean;
|
|
12
|
+
isIconTrailing?: boolean;
|
|
13
|
+
fillWidth?: boolean;
|
|
14
|
+
isEllipsis?: boolean;
|
|
15
|
+
cursor?: React.CSSProperties["cursor"];
|
|
16
|
+
}
|
|
17
|
+
export declare enum ButtonVariant {
|
|
18
|
+
PRIMARY = "PRIMARY",
|
|
19
|
+
SECONDARY = "SECONDARY",
|
|
20
|
+
TERTIARY = "TERTIARY",
|
|
21
|
+
SUCCESS = "SUCCESS",
|
|
22
|
+
ERROR = "ERROR"
|
|
23
|
+
}
|
|
24
|
+
export declare enum ButtonSize {
|
|
25
|
+
SMALL = "SMALL",
|
|
26
|
+
MEDIUM = "MEDIUM",
|
|
27
|
+
LARGE = "LARGE"
|
|
28
|
+
}
|
|
29
|
+
declare const Button: ({ label, icon, variant, size, onClick, onMouseEnter, onMouseLeave, fillWidth, isLoading, isDisabled, isIconTrailing, isEllipsis, cursor, }: ButtonProps) => import("react").JSX.Element;
|
|
30
|
+
export default Button;
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { GalaxyTheme } from "../theme/constants.js";
|
|
2
|
+
import { useGalaxyTheme, withTheme } from "../theme/GalaxyTheme.js";
|
|
3
|
+
import Text, { TextSize, TextVariant, TextWeight } from "../text/Text.js";
|
|
4
|
+
import FlexItem from "../containers/FlexItem.js";
|
|
5
|
+
import Icon, { IconVariant } from "../icons/Icon.js";
|
|
6
|
+
/* empty css */
|
|
7
|
+
import { styled } from "@linaria/react";
|
|
8
|
+
import { match } from "ts-pattern";
|
|
9
|
+
import { useCallback } from "react";
|
|
10
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
//#region src/buttons/Button.tsx
|
|
12
|
+
var ButtonVariant = /* @__PURE__ */ function(ButtonVariant) {
|
|
13
|
+
ButtonVariant["PRIMARY"] = "PRIMARY";
|
|
14
|
+
ButtonVariant["SECONDARY"] = "SECONDARY";
|
|
15
|
+
ButtonVariant["TERTIARY"] = "TERTIARY";
|
|
16
|
+
ButtonVariant["SUCCESS"] = "SUCCESS";
|
|
17
|
+
ButtonVariant["ERROR"] = "ERROR";
|
|
18
|
+
return ButtonVariant;
|
|
19
|
+
}({});
|
|
20
|
+
var ButtonSize = /* @__PURE__ */ function(ButtonSize) {
|
|
21
|
+
ButtonSize["SMALL"] = "SMALL";
|
|
22
|
+
ButtonSize["MEDIUM"] = "MEDIUM";
|
|
23
|
+
ButtonSize["LARGE"] = "LARGE";
|
|
24
|
+
return ButtonSize;
|
|
25
|
+
}({});
|
|
26
|
+
var _exp = () => ({ $fillWidth }) => $fillWidth ? "100%" : "auto";
|
|
27
|
+
var _exp2 = () => ({ $isEllipsis }) => $isEllipsis ? "0" : "auto";
|
|
28
|
+
var _exp3 = () => ({ $isEllipsis }) => $isEllipsis ? "hidden" : "visible";
|
|
29
|
+
var _exp4 = () => ({ $size }) => {
|
|
30
|
+
return match($size).with("SMALL", () => "4px").with("MEDIUM", () => "6px").with("LARGE", () => "6px").exhaustive();
|
|
31
|
+
};
|
|
32
|
+
var _exp5 = () => ({ $size, $noLabel }) => {
|
|
33
|
+
return match($size).with("SMALL", () => $noLabel ? "0 6px" : "0 6px").with("MEDIUM", () => $noLabel ? "0 6px" : "0 8px").with("LARGE", () => $noLabel ? "0 8px" : "0 12px").exhaustive();
|
|
34
|
+
};
|
|
35
|
+
var _exp6 = () => ({ $size }) => {
|
|
36
|
+
return match($size).with("SMALL", () => "24px").with("MEDIUM", () => "28px").with("LARGE", () => "32px").exhaustive();
|
|
37
|
+
};
|
|
38
|
+
var _exp7 = () => ({ theme, $variant }) => {
|
|
39
|
+
return match($variant).with("PRIMARY", () => theme.color.background.galaxy).with("SECONDARY", () => theme.color.background.primary).with("TERTIARY", () => "transparent").with("SUCCESS", () => theme.color.icon.success).with("ERROR", () => theme.color.icon.error).exhaustive();
|
|
40
|
+
};
|
|
41
|
+
var _exp8 = () => ({ theme, $variant }) => {
|
|
42
|
+
return match($variant).with("PRIMARY", () => "0.5px solid transparent").with("SECONDARY", () => `0.5px solid ${theme.color.border.primary}`).with("TERTIARY", () => "0.5px solid transparent").with("SUCCESS", () => "0.5px solid transparent").with("ERROR", () => "0.5px solid transparent").exhaustive();
|
|
43
|
+
};
|
|
44
|
+
var _exp9 = () => ({ $cursor }) => $cursor ?? "pointer";
|
|
45
|
+
var _exp0 = () => ({ theme, $variant }) => {
|
|
46
|
+
return match($variant).with("PRIMARY", () => theme.color.background.galaxyAlt).with("SECONDARY", () => theme.color.background.tertiary).with("TERTIARY", () => theme.color.background.secondary).with("SUCCESS", () => theme.color.background.successAlt).with("ERROR", () => theme.color.background.errorAlt).exhaustive();
|
|
47
|
+
};
|
|
48
|
+
var _exp1 = () => ({ theme, $variant }) => {
|
|
49
|
+
return match($variant).with("PRIMARY", () => theme.color.border.primary).with("SECONDARY", () => theme.color.border.primary).with("TERTIARY", () => theme.color.border.primary).with("SUCCESS", () => "transparent").with("ERROR", () => "transparent").exhaustive();
|
|
50
|
+
};
|
|
51
|
+
var _exp10 = () => ({ theme, $variant }) => {
|
|
52
|
+
return match($variant).with("PRIMARY", () => theme.color.background.disabled).with("SECONDARY", () => theme.color.background.disabled).with("TERTIARY", () => "transparent").with("SUCCESS", () => theme.color.background.successAlt).with("ERROR", () => theme.color.background.errorAlt).exhaustive();
|
|
53
|
+
};
|
|
54
|
+
var StyledButton = withTheme(/*#__PURE__*/ styled("button")({
|
|
55
|
+
name: "StyledButton",
|
|
56
|
+
class: "s99zquh",
|
|
57
|
+
propsAsIs: false,
|
|
58
|
+
vars: {
|
|
59
|
+
"s99zquh-0": [_exp()],
|
|
60
|
+
"s99zquh-1": [_exp2()],
|
|
61
|
+
"s99zquh-2": [_exp3()],
|
|
62
|
+
"s99zquh-3": [_exp4()],
|
|
63
|
+
"s99zquh-4": [_exp5()],
|
|
64
|
+
"s99zquh-5": [_exp6()],
|
|
65
|
+
"s99zquh-6": [_exp7()],
|
|
66
|
+
"s99zquh-7": [_exp8()],
|
|
67
|
+
"s99zquh-8": [_exp9()],
|
|
68
|
+
"s99zquh-9": [_exp0()],
|
|
69
|
+
"s99zquh-10": [_exp1()],
|
|
70
|
+
"s99zquh-11": [_exp10()]
|
|
71
|
+
}
|
|
72
|
+
}));
|
|
73
|
+
var _exp11 = () => ({ $isEllipsis }) => $isEllipsis ? "1" : "0 1 auto";
|
|
74
|
+
var _exp12 = () => ({ $isEllipsis }) => $isEllipsis ? "0" : "auto";
|
|
75
|
+
var LabelWrapper = /*#__PURE__*/ styled("span")({
|
|
76
|
+
name: "LabelWrapper",
|
|
77
|
+
class: "l9yox33",
|
|
78
|
+
propsAsIs: false,
|
|
79
|
+
vars: {
|
|
80
|
+
"l9yox33-0": [_exp11()],
|
|
81
|
+
"l9yox33-1": [_exp12()]
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
function getTextVariant(variant, galaxyTheme) {
|
|
85
|
+
return match(variant).with("PRIMARY", () => galaxyTheme === GalaxyTheme.DARK ? TextVariant.PRIMARY : TextVariant.PRIMARY_ALT).with("SECONDARY", () => TextVariant.PRIMARY).with("TERTIARY", () => TextVariant.PRIMARY).with("SUCCESS", () => TextVariant.PRIMARY_ALT).with("ERROR", () => TextVariant.PRIMARY_ALT).exhaustive();
|
|
86
|
+
}
|
|
87
|
+
function getIconVariant(variant, galaxyTheme) {
|
|
88
|
+
return match(variant).with("PRIMARY", () => galaxyTheme === GalaxyTheme.DARK ? IconVariant.PRIMARY : IconVariant.PRIMARY_ALT).with("SECONDARY", () => IconVariant.PRIMARY).with("TERTIARY", () => IconVariant.PRIMARY).with("SUCCESS", () => IconVariant.PRIMARY_ALT).with("ERROR", () => IconVariant.PRIMARY_ALT).exhaustive();
|
|
89
|
+
}
|
|
90
|
+
var BUTTON_SIZE_TO_TEXT_SIZE_MAP = {
|
|
91
|
+
["SMALL"]: TextSize.BODY_SM,
|
|
92
|
+
["MEDIUM"]: TextSize.BODY_MD,
|
|
93
|
+
["LARGE"]: TextSize.BODY_LG
|
|
94
|
+
};
|
|
95
|
+
var BUTTON_SIZE_TO_ICON_SIZE_MAP = {
|
|
96
|
+
["SMALL"]: 12,
|
|
97
|
+
["MEDIUM"]: 14,
|
|
98
|
+
["LARGE"]: 16
|
|
99
|
+
};
|
|
100
|
+
var Button = ({ label, icon, variant = "PRIMARY", size = "MEDIUM", onClick, onMouseEnter, onMouseLeave, fillWidth, isLoading, isDisabled, isIconTrailing, isEllipsis, cursor }) => {
|
|
101
|
+
const { galaxyTheme } = useGalaxyTheme();
|
|
102
|
+
const handleClick = useCallback((e) => {
|
|
103
|
+
if (isDisabled || isLoading) return;
|
|
104
|
+
onClick(e);
|
|
105
|
+
}, [
|
|
106
|
+
isDisabled,
|
|
107
|
+
isLoading,
|
|
108
|
+
onClick
|
|
109
|
+
]);
|
|
110
|
+
const renderIcon = useCallback(() => {
|
|
111
|
+
if (!icon) return null;
|
|
112
|
+
let iconVariant = getIconVariant(variant, galaxyTheme);
|
|
113
|
+
if (isDisabled) iconVariant = IconVariant.TERTIARY;
|
|
114
|
+
return /* @__PURE__ */ jsx(FlexItem, {
|
|
115
|
+
shrink: 0,
|
|
116
|
+
grow: 0,
|
|
117
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
118
|
+
component: icon,
|
|
119
|
+
variant: iconVariant,
|
|
120
|
+
size: BUTTON_SIZE_TO_ICON_SIZE_MAP[size]
|
|
121
|
+
})
|
|
122
|
+
});
|
|
123
|
+
}, [
|
|
124
|
+
icon,
|
|
125
|
+
variant,
|
|
126
|
+
size,
|
|
127
|
+
isDisabled,
|
|
128
|
+
galaxyTheme
|
|
129
|
+
]);
|
|
130
|
+
const renderLabel = useCallback(() => {
|
|
131
|
+
if (!label) return null;
|
|
132
|
+
let textVariant = getTextVariant(variant, galaxyTheme);
|
|
133
|
+
if (isDisabled) textVariant = TextVariant.TERTIARY_ALT;
|
|
134
|
+
return /* @__PURE__ */ jsx(LabelWrapper, {
|
|
135
|
+
$isEllipsis: isEllipsis,
|
|
136
|
+
children: /* @__PURE__ */ jsx(Text, {
|
|
137
|
+
variant: textVariant,
|
|
138
|
+
weight: TextWeight.MEDIUM,
|
|
139
|
+
size: BUTTON_SIZE_TO_TEXT_SIZE_MAP[size],
|
|
140
|
+
cursor: isDisabled ? "not-allowed" : cursor,
|
|
141
|
+
isEllipsis,
|
|
142
|
+
children: label
|
|
143
|
+
})
|
|
144
|
+
});
|
|
145
|
+
}, [
|
|
146
|
+
label,
|
|
147
|
+
variant,
|
|
148
|
+
size,
|
|
149
|
+
isDisabled,
|
|
150
|
+
isEllipsis,
|
|
151
|
+
cursor,
|
|
152
|
+
galaxyTheme
|
|
153
|
+
]);
|
|
154
|
+
return /* @__PURE__ */ jsxs(StyledButton, {
|
|
155
|
+
$variant: variant,
|
|
156
|
+
$size: size,
|
|
157
|
+
$fillWidth: fillWidth,
|
|
158
|
+
$noLabel: !label,
|
|
159
|
+
$isEllipsis: isEllipsis,
|
|
160
|
+
$cursor: cursor,
|
|
161
|
+
onClick: handleClick,
|
|
162
|
+
disabled: isDisabled || isLoading,
|
|
163
|
+
onMouseEnter,
|
|
164
|
+
onMouseLeave,
|
|
165
|
+
children: [
|
|
166
|
+
!isIconTrailing && renderIcon(),
|
|
167
|
+
label && renderLabel(),
|
|
168
|
+
isIconTrailing && renderIcon()
|
|
169
|
+
]
|
|
170
|
+
});
|
|
171
|
+
};
|
|
172
|
+
//#endregion
|
|
173
|
+
export { ButtonSize, ButtonVariant, Button as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { BaseChartProps } from "./types";
|
|
2
|
+
export declare enum BarChartMode {
|
|
3
|
+
GROUPED = "GROUPED",
|
|
4
|
+
STACKED = "STACKED"
|
|
5
|
+
}
|
|
6
|
+
export interface BarChartProps extends BaseChartProps {
|
|
7
|
+
/** Stacked or grouped bar mode */
|
|
8
|
+
mode?: BarChartMode;
|
|
9
|
+
/** Corner radius for bar tops (px) */
|
|
10
|
+
barRadius?: number;
|
|
11
|
+
/** Padding between bars within a group (0-1 fraction of bandwidth) */
|
|
12
|
+
barPaddingInner?: number;
|
|
13
|
+
/** Padding around outer bar groups (0-1 fraction of step) */
|
|
14
|
+
barPaddingOuter?: number;
|
|
15
|
+
/** Show value labels on bars */
|
|
16
|
+
showValues?: boolean;
|
|
17
|
+
/** Show grid lines */
|
|
18
|
+
showGrid?: boolean;
|
|
19
|
+
}
|
|
20
|
+
declare const BarChart: ({ data, series, width, height, margin: marginOverride, fillWidth, aspectRatio, mode, barRadius, barPaddingInner, barPaddingOuter, valueFormatter, labelFormatter, tooltipRenderer, noTooltip, showLegend, showValues, showGrid, ariaLabel, }: BarChartProps) => import("react").JSX.Element;
|
|
21
|
+
export default BarChart;
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import { useGalaxyTheme, withTheme } from "../theme/GalaxyTheme.js";
|
|
2
|
+
import Text, { TextSize, TextWeight } from "../text/Text.js";
|
|
3
|
+
import FlexWrapper, { AlignItems, FlexDirection, JustifyContent } from "../containers/FlexWrapper.js";
|
|
4
|
+
import { useElementWidth } from "../hooks/useElementWidth.js";
|
|
5
|
+
import Wrapper from "../containers/Wrapper.js";
|
|
6
|
+
import { DEFAULT_BAR_PADDING_INNER, DEFAULT_BAR_PADDING_OUTER, getChartPalette } from "./constants.js";
|
|
7
|
+
import { buildBandScale, buildLinearScale, defaultLabelFormatter, defaultValueFormatter, getGroupedMax, getPlotDimensions, getStackedMax, resolveMargin, resolveSeriesColor, roundedTopRectPath } from "./utils.js";
|
|
8
|
+
import ChartLegend from "./ChartLegend.js";
|
|
9
|
+
import ChartTooltip from "./ChartTooltip.js";
|
|
10
|
+
import { XAxis, YAxis } from "./ChartAxis.js";
|
|
11
|
+
/* empty css */
|
|
12
|
+
import { styled } from "@linaria/react";
|
|
13
|
+
import { useCallback, useMemo, useRef, useState } from "react";
|
|
14
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
+
//#region src/charts/BarChart.tsx
|
|
16
|
+
var BarChartMode = /* @__PURE__ */ function(BarChartMode) {
|
|
17
|
+
BarChartMode["GROUPED"] = "GROUPED";
|
|
18
|
+
BarChartMode["STACKED"] = "STACKED";
|
|
19
|
+
return BarChartMode;
|
|
20
|
+
}({});
|
|
21
|
+
var _exp = () => ({ $fillWidth }) => $fillWidth ? "flex" : "inline-flex";
|
|
22
|
+
var _exp2 = () => ({ $fillWidth }) => $fillWidth ? "100%" : "auto";
|
|
23
|
+
var ChartWrapper = withTheme(/*#__PURE__*/ styled("div")({
|
|
24
|
+
name: "ChartWrapper",
|
|
25
|
+
class: "c16zjhoz",
|
|
26
|
+
propsAsIs: false,
|
|
27
|
+
vars: {
|
|
28
|
+
"c16zjhoz-0": [_exp()],
|
|
29
|
+
"c16zjhoz-1": [_exp2()]
|
|
30
|
+
}
|
|
31
|
+
}));
|
|
32
|
+
var BarChart = ({ data, series, width, height, margin: marginOverride, fillWidth = false, aspectRatio, mode = "STACKED", barRadius = 4, barPaddingInner = DEFAULT_BAR_PADDING_INNER, barPaddingOuter = DEFAULT_BAR_PADDING_OUTER, valueFormatter = defaultValueFormatter, labelFormatter = defaultLabelFormatter, tooltipRenderer, noTooltip = false, showLegend = true, showValues = false, showGrid = true, ariaLabel }) => {
|
|
33
|
+
const { theme } = useGalaxyTheme();
|
|
34
|
+
const containerRef = useRef(null);
|
|
35
|
+
const svgRef = useRef(null);
|
|
36
|
+
const [tooltip, setTooltip] = useState(null);
|
|
37
|
+
const [hoveredDatumIndex, setHoveredDatumIndex] = useState(null);
|
|
38
|
+
const measuredWidth = useElementWidth(containerRef);
|
|
39
|
+
const resolvedWidth = fillWidth ? measuredWidth ?? 0 : width ?? 0;
|
|
40
|
+
const resolvedHeight = aspectRatio ? resolvedWidth / aspectRatio : height ?? 0;
|
|
41
|
+
const palette = useMemo(() => getChartPalette(theme), [theme]);
|
|
42
|
+
const margin = useMemo(() => resolveMargin(marginOverride), [marginOverride]);
|
|
43
|
+
const { plotWidth, plotHeight } = useMemo(() => getPlotDimensions(resolvedWidth, resolvedHeight, margin), [
|
|
44
|
+
resolvedWidth,
|
|
45
|
+
resolvedHeight,
|
|
46
|
+
margin
|
|
47
|
+
]);
|
|
48
|
+
const seriesKeys = useMemo(() => series.map((s) => s.key), [series]);
|
|
49
|
+
const labels = useMemo(() => data.map((d) => d.label), [data]);
|
|
50
|
+
const xScale = useMemo(() => buildBandScale(labels, [0, plotWidth], barPaddingInner, barPaddingOuter), [
|
|
51
|
+
labels,
|
|
52
|
+
plotWidth,
|
|
53
|
+
barPaddingInner,
|
|
54
|
+
barPaddingOuter
|
|
55
|
+
]);
|
|
56
|
+
const yMax = useMemo(() => mode === "STACKED" ? getStackedMax(data, seriesKeys) : getGroupedMax(data, seriesKeys), [
|
|
57
|
+
data,
|
|
58
|
+
seriesKeys,
|
|
59
|
+
mode
|
|
60
|
+
]);
|
|
61
|
+
const yScale = useMemo(() => buildLinearScale(yMax, [plotHeight, 0]), [yMax, plotHeight]);
|
|
62
|
+
const innerScale = useMemo(() => {
|
|
63
|
+
if (mode !== "GROUPED") return null;
|
|
64
|
+
return buildBandScale(seriesKeys, [0, xScale.bandwidth()], .05, 0);
|
|
65
|
+
}, [
|
|
66
|
+
mode,
|
|
67
|
+
seriesKeys,
|
|
68
|
+
xScale
|
|
69
|
+
]);
|
|
70
|
+
const handleBarMouseEnter = useCallback((datumIndex, x, y) => {
|
|
71
|
+
const datum = data[datumIndex];
|
|
72
|
+
if (!datum) return;
|
|
73
|
+
setHoveredDatumIndex(datumIndex);
|
|
74
|
+
setTooltip({
|
|
75
|
+
label: datum.label,
|
|
76
|
+
items: series.map((s, i) => ({
|
|
77
|
+
seriesKey: s.key,
|
|
78
|
+
seriesName: s.name,
|
|
79
|
+
value: datum.values[s.key] ?? 0,
|
|
80
|
+
color: resolveSeriesColor(s, i, palette)
|
|
81
|
+
})),
|
|
82
|
+
x: x + margin.left,
|
|
83
|
+
y: y + margin.top
|
|
84
|
+
});
|
|
85
|
+
}, [
|
|
86
|
+
data,
|
|
87
|
+
series,
|
|
88
|
+
palette,
|
|
89
|
+
margin
|
|
90
|
+
]);
|
|
91
|
+
const handleBarMouseLeave = useCallback(() => {
|
|
92
|
+
setHoveredDatumIndex(null);
|
|
93
|
+
setTooltip(null);
|
|
94
|
+
}, []);
|
|
95
|
+
const handleBarFocus = useCallback((datumIndex, x, y) => {
|
|
96
|
+
handleBarMouseEnter(datumIndex, x, y);
|
|
97
|
+
}, [handleBarMouseEnter]);
|
|
98
|
+
const handleBarBlur = useCallback(() => {
|
|
99
|
+
handleBarMouseLeave();
|
|
100
|
+
}, [handleBarMouseLeave]);
|
|
101
|
+
if (resolvedWidth === 0 || resolvedHeight === 0) return /* @__PURE__ */ jsx(ChartWrapper, {
|
|
102
|
+
ref: containerRef,
|
|
103
|
+
$fillWidth: fillWidth
|
|
104
|
+
});
|
|
105
|
+
const renderStackedBars = () => {
|
|
106
|
+
return data.map((datum, datumIndex) => {
|
|
107
|
+
const x = xScale(datum.label) ?? 0;
|
|
108
|
+
const bandWidth = xScale.bandwidth();
|
|
109
|
+
let cumulativeY = plotHeight;
|
|
110
|
+
return /* @__PURE__ */ jsx("g", { children: series.map((s, seriesIndex) => {
|
|
111
|
+
const value = datum.values[s.key] ?? 0;
|
|
112
|
+
if (value === 0) return null;
|
|
113
|
+
const barHeight = plotHeight - yScale(value);
|
|
114
|
+
const barY = cumulativeY - barHeight;
|
|
115
|
+
cumulativeY = barY;
|
|
116
|
+
const color = resolveSeriesColor(s, seriesIndex, palette);
|
|
117
|
+
const isTopSegment = seriesIndex === series.length - 1 || series.slice(seriesIndex + 1).every((next) => (datum.values[next.key] ?? 0) === 0);
|
|
118
|
+
const isDimmed = hoveredDatumIndex !== null && hoveredDatumIndex !== datumIndex;
|
|
119
|
+
return /* @__PURE__ */ jsxs("g", { children: [isTopSegment ? /* @__PURE__ */ jsx("path", {
|
|
120
|
+
d: roundedTopRectPath(x, barY, bandWidth, barHeight, barRadius),
|
|
121
|
+
fill: color,
|
|
122
|
+
opacity: isDimmed ? .3 : 1,
|
|
123
|
+
style: { transition: `opacity 150ms ease-in-out` },
|
|
124
|
+
onMouseEnter: () => handleBarMouseEnter(datumIndex, x + bandWidth / 2, barY),
|
|
125
|
+
onMouseLeave: handleBarMouseLeave,
|
|
126
|
+
onFocus: () => handleBarFocus(datumIndex, x + bandWidth / 2, barY),
|
|
127
|
+
onBlur: handleBarBlur,
|
|
128
|
+
tabIndex: 0,
|
|
129
|
+
role: "graphics-symbol",
|
|
130
|
+
"aria-roledescription": "bar",
|
|
131
|
+
"aria-label": `${s.name} for ${datum.label}: ${valueFormatter(value)}`
|
|
132
|
+
}) : /* @__PURE__ */ jsx("rect", {
|
|
133
|
+
x,
|
|
134
|
+
y: barY,
|
|
135
|
+
width: bandWidth,
|
|
136
|
+
height: barHeight,
|
|
137
|
+
fill: color,
|
|
138
|
+
opacity: isDimmed ? .3 : 1,
|
|
139
|
+
style: { transition: `opacity 150ms ease-in-out` },
|
|
140
|
+
onMouseEnter: () => handleBarMouseEnter(datumIndex, x + bandWidth / 2, barY),
|
|
141
|
+
onMouseLeave: handleBarMouseLeave,
|
|
142
|
+
onFocus: () => handleBarFocus(datumIndex, x + bandWidth / 2, barY),
|
|
143
|
+
onBlur: handleBarBlur,
|
|
144
|
+
tabIndex: 0,
|
|
145
|
+
role: "graphics-symbol",
|
|
146
|
+
"aria-roledescription": "bar",
|
|
147
|
+
"aria-label": `${s.name} for ${datum.label}: ${valueFormatter(value)}`
|
|
148
|
+
}), showValues && isTopSegment && /* @__PURE__ */ jsx("foreignObject", {
|
|
149
|
+
x,
|
|
150
|
+
y: barY - 20,
|
|
151
|
+
width: bandWidth,
|
|
152
|
+
height: 20,
|
|
153
|
+
children: /* @__PURE__ */ jsx(FlexWrapper, {
|
|
154
|
+
justifyContent: JustifyContent.CENTER,
|
|
155
|
+
alignItems: AlignItems.END,
|
|
156
|
+
fillWidth: true,
|
|
157
|
+
fillHeight: true,
|
|
158
|
+
children: /* @__PURE__ */ jsx(Text, {
|
|
159
|
+
size: TextSize.CAPTION,
|
|
160
|
+
weight: TextWeight.MEDIUM,
|
|
161
|
+
children: valueFormatter(value)
|
|
162
|
+
})
|
|
163
|
+
})
|
|
164
|
+
})] }, s.key);
|
|
165
|
+
}) }, datum.label);
|
|
166
|
+
});
|
|
167
|
+
};
|
|
168
|
+
const renderGroupedBars = () => {
|
|
169
|
+
if (!innerScale) return null;
|
|
170
|
+
return data.map((datum, datumIndex) => {
|
|
171
|
+
const groupX = xScale(datum.label) ?? 0;
|
|
172
|
+
const isDimmed = hoveredDatumIndex !== null && hoveredDatumIndex !== datumIndex;
|
|
173
|
+
return /* @__PURE__ */ jsx("g", {
|
|
174
|
+
transform: `translate(${groupX}, 0)`,
|
|
175
|
+
children: series.map((s, seriesIndex) => {
|
|
176
|
+
const value = datum.values[s.key] ?? 0;
|
|
177
|
+
if (value === 0) return null;
|
|
178
|
+
const barX = innerScale(s.key) ?? 0;
|
|
179
|
+
const barWidth = innerScale.bandwidth();
|
|
180
|
+
const barHeight = plotHeight - yScale(value);
|
|
181
|
+
const barY = yScale(value);
|
|
182
|
+
const color = resolveSeriesColor(s, seriesIndex, palette);
|
|
183
|
+
return /* @__PURE__ */ jsxs("g", { children: [/* @__PURE__ */ jsx("path", {
|
|
184
|
+
d: roundedTopRectPath(barX, barY, barWidth, barHeight, barRadius),
|
|
185
|
+
fill: color,
|
|
186
|
+
opacity: isDimmed ? .3 : 1,
|
|
187
|
+
style: { transition: `opacity 150ms ease-in-out` },
|
|
188
|
+
onMouseEnter: () => handleBarMouseEnter(datumIndex, groupX + barX + barWidth / 2, barY),
|
|
189
|
+
onMouseLeave: handleBarMouseLeave,
|
|
190
|
+
onFocus: () => handleBarFocus(datumIndex, groupX + barX + barWidth / 2, barY),
|
|
191
|
+
onBlur: handleBarBlur,
|
|
192
|
+
tabIndex: 0,
|
|
193
|
+
role: "graphics-symbol",
|
|
194
|
+
"aria-roledescription": "bar",
|
|
195
|
+
"aria-label": `${s.name} for ${datum.label}: ${valueFormatter(value)}`
|
|
196
|
+
}), showValues && /* @__PURE__ */ jsx("foreignObject", {
|
|
197
|
+
x: barX,
|
|
198
|
+
y: barY - 20,
|
|
199
|
+
width: barWidth,
|
|
200
|
+
height: 20,
|
|
201
|
+
children: /* @__PURE__ */ jsx(FlexWrapper, {
|
|
202
|
+
justifyContent: JustifyContent.CENTER,
|
|
203
|
+
alignItems: AlignItems.END,
|
|
204
|
+
fillWidth: true,
|
|
205
|
+
fillHeight: true,
|
|
206
|
+
children: /* @__PURE__ */ jsx(Text, {
|
|
207
|
+
size: TextSize.CAPTION,
|
|
208
|
+
weight: TextWeight.MEDIUM,
|
|
209
|
+
children: valueFormatter(value)
|
|
210
|
+
})
|
|
211
|
+
})
|
|
212
|
+
})] }, s.key);
|
|
213
|
+
})
|
|
214
|
+
}, datum.label);
|
|
215
|
+
});
|
|
216
|
+
};
|
|
217
|
+
const defaultAriaLabel = `Bar chart with ${data.length} categories and ${series.length} series`;
|
|
218
|
+
return /* @__PURE__ */ jsxs(ChartWrapper, {
|
|
219
|
+
ref: containerRef,
|
|
220
|
+
$fillWidth: fillWidth,
|
|
221
|
+
children: [/* @__PURE__ */ jsxs(Wrapper, {
|
|
222
|
+
position: "relative",
|
|
223
|
+
children: [/* @__PURE__ */ jsx("svg", {
|
|
224
|
+
ref: svgRef,
|
|
225
|
+
width: resolvedWidth,
|
|
226
|
+
height: resolvedHeight,
|
|
227
|
+
role: "img",
|
|
228
|
+
"aria-label": ariaLabel ?? defaultAriaLabel,
|
|
229
|
+
children: /* @__PURE__ */ jsxs("g", {
|
|
230
|
+
transform: `translate(${margin.left}, ${margin.top})`,
|
|
231
|
+
children: [
|
|
232
|
+
/* @__PURE__ */ jsx(YAxis, {
|
|
233
|
+
scale: yScale,
|
|
234
|
+
transform: "translate(0, 0)",
|
|
235
|
+
plotWidth,
|
|
236
|
+
formatter: valueFormatter,
|
|
237
|
+
showGrid,
|
|
238
|
+
theme
|
|
239
|
+
}),
|
|
240
|
+
/* @__PURE__ */ jsx(XAxis, {
|
|
241
|
+
scale: xScale,
|
|
242
|
+
transform: `translate(0, ${plotHeight})`,
|
|
243
|
+
plotWidth,
|
|
244
|
+
formatter: labelFormatter
|
|
245
|
+
}),
|
|
246
|
+
mode === "STACKED" ? renderStackedBars() : renderGroupedBars()
|
|
247
|
+
]
|
|
248
|
+
})
|
|
249
|
+
}), !noTooltip && (tooltipRenderer ? tooltip && tooltipRenderer(tooltip) : /* @__PURE__ */ jsx(ChartTooltip, {
|
|
250
|
+
data: tooltip,
|
|
251
|
+
valueFormatter
|
|
252
|
+
}))]
|
|
253
|
+
}), showLegend && /* @__PURE__ */ jsxs(FlexWrapper, {
|
|
254
|
+
direction: FlexDirection.ROW,
|
|
255
|
+
gap: 0,
|
|
256
|
+
children: [/* @__PURE__ */ jsx(Wrapper, { minWidth: margin.left }), /* @__PURE__ */ jsx(ChartLegend, {
|
|
257
|
+
series,
|
|
258
|
+
palette
|
|
259
|
+
})]
|
|
260
|
+
})]
|
|
261
|
+
});
|
|
262
|
+
};
|
|
263
|
+
//#endregion
|
|
264
|
+
export { BarChartMode, BarChart as default };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ScaleBand, ScaleLinear, ScalePoint } from "d3-scale";
|
|
2
|
+
import type { Theme } from "../theme/types";
|
|
3
|
+
import type { ChartLabelFormatter, ChartValueFormatter } from "./types";
|
|
4
|
+
interface XAxisProps {
|
|
5
|
+
scale: ScaleBand<string>;
|
|
6
|
+
transform: string;
|
|
7
|
+
plotWidth: number;
|
|
8
|
+
formatter?: ChartLabelFormatter;
|
|
9
|
+
}
|
|
10
|
+
export declare const XAxis: ({ scale, transform, formatter }: XAxisProps) => import("react").JSX.Element;
|
|
11
|
+
interface XAxisPointProps {
|
|
12
|
+
scale: ScalePoint<string>;
|
|
13
|
+
transform: string;
|
|
14
|
+
plotWidth: number;
|
|
15
|
+
formatter?: ChartLabelFormatter;
|
|
16
|
+
}
|
|
17
|
+
export declare const XAxisPoint: ({ scale, transform, formatter, }: XAxisPointProps) => import("react").JSX.Element;
|
|
18
|
+
interface YAxisProps {
|
|
19
|
+
scale: ScaleLinear<number, number>;
|
|
20
|
+
transform: string;
|
|
21
|
+
plotWidth: number;
|
|
22
|
+
tickCount?: number;
|
|
23
|
+
formatter?: ChartValueFormatter;
|
|
24
|
+
showGrid?: boolean;
|
|
25
|
+
theme: Theme;
|
|
26
|
+
}
|
|
27
|
+
export declare const YAxis: ({ scale, transform, plotWidth, tickCount, formatter, showGrid, theme, }: YAxisProps) => import("react").JSX.Element;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import Text, { TextSize, TextVariant } from "../text/Text.js";
|
|
2
|
+
import FlexWrapper, { AlignItems, JustifyContent } from "../containers/FlexWrapper.js";
|
|
3
|
+
import "./constants.js";
|
|
4
|
+
import { defaultLabelFormatter, defaultValueFormatter } from "./utils.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region src/charts/ChartAxis.tsx
|
|
7
|
+
var XAxis = ({ scale, transform, formatter = defaultLabelFormatter }) => {
|
|
8
|
+
return /* @__PURE__ */ jsx("g", {
|
|
9
|
+
transform,
|
|
10
|
+
children: scale.domain().map((label) => {
|
|
11
|
+
return /* @__PURE__ */ jsx("foreignObject", {
|
|
12
|
+
x: (scale(label) ?? 0) + scale.bandwidth() / 2 - scale.bandwidth() / 2,
|
|
13
|
+
y: 8,
|
|
14
|
+
width: scale.bandwidth(),
|
|
15
|
+
height: 24,
|
|
16
|
+
children: /* @__PURE__ */ jsx(FlexWrapper, {
|
|
17
|
+
justifyContent: JustifyContent.CENTER,
|
|
18
|
+
alignItems: AlignItems.CENTER,
|
|
19
|
+
fillWidth: true,
|
|
20
|
+
fillHeight: true,
|
|
21
|
+
children: /* @__PURE__ */ jsx(Text, {
|
|
22
|
+
size: TextSize.CAPTION,
|
|
23
|
+
variant: TextVariant.TERTIARY,
|
|
24
|
+
align: "center",
|
|
25
|
+
children: formatter(label)
|
|
26
|
+
})
|
|
27
|
+
})
|
|
28
|
+
}, label);
|
|
29
|
+
})
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
var XAxisPoint = ({ scale, transform, formatter = defaultLabelFormatter }) => {
|
|
33
|
+
const step = scale.step();
|
|
34
|
+
return /* @__PURE__ */ jsx("g", {
|
|
35
|
+
transform,
|
|
36
|
+
children: scale.domain().map((label) => {
|
|
37
|
+
return /* @__PURE__ */ jsx("foreignObject", {
|
|
38
|
+
x: (scale(label) ?? 0) - step / 2,
|
|
39
|
+
y: 8,
|
|
40
|
+
width: step,
|
|
41
|
+
height: 24,
|
|
42
|
+
children: /* @__PURE__ */ jsx(FlexWrapper, {
|
|
43
|
+
justifyContent: JustifyContent.CENTER,
|
|
44
|
+
alignItems: AlignItems.CENTER,
|
|
45
|
+
fillWidth: true,
|
|
46
|
+
fillHeight: true,
|
|
47
|
+
children: /* @__PURE__ */ jsx(Text, {
|
|
48
|
+
size: TextSize.CAPTION,
|
|
49
|
+
variant: TextVariant.TERTIARY,
|
|
50
|
+
align: "center",
|
|
51
|
+
children: formatter(label)
|
|
52
|
+
})
|
|
53
|
+
})
|
|
54
|
+
}, label);
|
|
55
|
+
})
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
var YAxis = ({ scale, transform, plotWidth, tickCount = 5, formatter = defaultValueFormatter, showGrid = true, theme }) => {
|
|
59
|
+
return /* @__PURE__ */ jsx("g", {
|
|
60
|
+
transform,
|
|
61
|
+
children: scale.ticks(tickCount).map((tick) => {
|
|
62
|
+
return /* @__PURE__ */ jsxs("g", {
|
|
63
|
+
transform: `translate(0, ${scale(tick)})`,
|
|
64
|
+
children: [/* @__PURE__ */ jsx("foreignObject", {
|
|
65
|
+
x: -48,
|
|
66
|
+
y: -10,
|
|
67
|
+
width: 36,
|
|
68
|
+
height: 20,
|
|
69
|
+
children: /* @__PURE__ */ jsx(FlexWrapper, {
|
|
70
|
+
justifyContent: JustifyContent.END,
|
|
71
|
+
alignItems: AlignItems.CENTER,
|
|
72
|
+
fillWidth: true,
|
|
73
|
+
fillHeight: true,
|
|
74
|
+
children: /* @__PURE__ */ jsx(Text, {
|
|
75
|
+
size: TextSize.CAPTION,
|
|
76
|
+
variant: TextVariant.TERTIARY,
|
|
77
|
+
children: formatter(tick)
|
|
78
|
+
})
|
|
79
|
+
})
|
|
80
|
+
}), showGrid && /* @__PURE__ */ jsx("line", {
|
|
81
|
+
x1: 0,
|
|
82
|
+
x2: plotWidth,
|
|
83
|
+
y1: 0,
|
|
84
|
+
y2: 0,
|
|
85
|
+
stroke: theme.color.border.primary,
|
|
86
|
+
strokeOpacity: .5,
|
|
87
|
+
strokeDasharray: "2,2"
|
|
88
|
+
})]
|
|
89
|
+
}, tick);
|
|
90
|
+
})
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
//#endregion
|
|
94
|
+
export { XAxis, XAxisPoint, YAxis };
|