@mittwald/flow-react-components 1.3.0-next.2 → 1.3.0-next.20
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/AGENTS.md +32 -0
- package/dist/assets/component-index.json +1 -1
- package/dist/assets/doc-properties.json +1 -1
- package/dist/css/all-layered.css +1 -1
- package/dist/css/all.css +1 -1
- package/dist/js/_virtual/_28.locale.mjs +10 -0
- package/dist/js/default.mjs +2 -1
- package/dist/js/flr-universal.mjs +2 -1
- package/dist/js/packages/components/src/components/Accordion/Accordion.mjs +23 -15
- package/dist/js/packages/components/src/components/Accordion/Accordion.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CartesianChart/CartesianChart.mjs +6 -2
- package/dist/js/packages/components/src/components/CartesianChart/CartesianChart.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CartesianChart/components/Area/Area.mjs +3 -1
- package/dist/js/packages/components/src/components/CartesianChart/components/Area/Area.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CartesianChart/components/Bar/Bar.mjs +12 -3
- package/dist/js/packages/components/src/components/CartesianChart/components/Bar/Bar.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CartesianChart/context.mjs +4 -1
- package/dist/js/packages/components/src/components/CartesianChart/context.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CartesianChart/hooks/useScopedStackId.mjs +16 -0
- package/dist/js/packages/components/src/components/CartesianChart/hooks/useScopedStackId.mjs.map +1 -0
- package/dist/js/packages/components/src/components/Combine/Combine.mjs +4 -1
- package/dist/js/packages/components/src/components/Combine/Combine.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Combine/Combine.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/DonutChart/DonutChart.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/FileDropZone/FileDropZone.mjs +2 -2
- package/dist/js/packages/components/src/components/FileDropZone/FileDropZone.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Icon/components/icons/IconAIHosting.mjs +19 -0
- package/dist/js/packages/components/src/components/Icon/components/icons/IconAIHosting.mjs.map +1 -0
- package/dist/js/packages/components/src/components/LightBox/components/LightBoxGallery/Controls.mjs +1 -1
- package/dist/js/packages/components/src/components/LightBox/components/LightBoxGallery/Controls.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/List.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/ListItemView/ListItemView.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Overlay/components/OverlayContent.mjs +37 -2
- package/dist/js/packages/components/src/components/Overlay/components/OverlayContent.mjs.map +1 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/PasswordCreationField.mjs +8 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/PasswordCreationField.mjs.map +1 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/components/PasswordGenerateButton/PasswordGenerateButton.mjs +2 -0
- package/dist/js/packages/components/src/components/PasswordCreationField/components/PasswordGenerateButton/PasswordGenerateButton.mjs.map +1 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/components/ValidationResultButton/ValidationResultButton.mjs +13 -7
- package/dist/js/packages/components/src/components/PasswordCreationField/components/ValidationResultButton/ValidationResultButton.mjs.map +1 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/components/ValidationResultButton/ValidationResultButton.module.mjs +9 -0
- package/dist/js/packages/components/src/components/PasswordCreationField/components/ValidationResultButton/ValidationResultButton.module.mjs.map +1 -0
- package/dist/js/packages/components/src/components/PasswordCreationField/components/ValidationResultEntry/ValidationResultEntry.mjs +12 -4
- package/dist/js/packages/components/src/components/PasswordCreationField/components/ValidationResultEntry/ValidationResultEntry.mjs.map +1 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/lib/ariaAnnounce.mjs +52 -0
- package/dist/js/packages/components/src/components/PasswordCreationField/lib/ariaAnnounce.mjs.map +1 -0
- package/dist/js/packages/components/src/components/PasswordCreationField/lib/generateValidationTranslation.mjs +1 -0
- package/dist/js/packages/components/src/components/PasswordCreationField/lib/generateValidationTranslation.mjs.map +1 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/lib/getStatusFromPolicyValidationResult.mjs +1 -0
- package/dist/js/packages/components/src/components/PasswordCreationField/lib/getStatusFromPolicyValidationResult.mjs.map +1 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/lib/usePolicyValidationResult.mjs +1 -0
- package/dist/js/packages/components/src/components/PasswordCreationField/lib/usePolicyValidationResult.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Popover/components/NonModalPopoverContent/NonModalPopoverContent.mjs +19 -11
- package/dist/js/packages/components/src/components/Popover/components/NonModalPopoverContent/NonModalPopoverContent.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Section/Section.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/TextArea/TextArea.mjs +14 -13
- package/dist/js/packages/components/src/components/TextArea/TextArea.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Tooltip/Tooltip.module.mjs.map +1 -1
- package/dist/js/packages/components/src/lib/files/acceptedFiles.mjs +34 -0
- package/dist/js/packages/components/src/lib/files/acceptedFiles.mjs.map +1 -0
- package/dist/js/packages/components/src/lib/hooks/dom/useKeepBrowserExtensionsInteractive.mjs +1 -1
- package/dist/js/packages/components/src/lib/hooks/dom/useKeepBrowserExtensionsInteractive.mjs.map +1 -1
- package/dist/types/components/CartesianChart/context.d.ts +6 -0
- package/dist/types/components/CartesianChart/hooks/useScopedStackId.d.ts +6 -0
- package/dist/types/components/Icon/components/icons/IconAIHosting.d.ts +4 -0
- package/dist/types/components/Icon/components/icons/index.d.ts +1 -0
- package/dist/types/components/PasswordCreationField/components/PasswordGenerateButton/PasswordGenerateButton.d.ts +0 -7
- package/dist/types/components/PasswordCreationField/components/ValidationResultButton/ValidationResultButton.d.ts +0 -9
- package/dist/types/components/PasswordCreationField/lib/ariaAnnounce.d.ts +1 -0
- package/dist/types/components/PasswordCreationField/lib/generateValidationTranslation.d.ts +0 -2
- package/dist/types/components/PasswordCreationField/lib/getStatusFromPolicyValidationResult.d.ts +0 -3
- package/dist/types/components/PasswordCreationField/lib/usePolicyValidationResult.d.ts +1 -7
- package/dist/types/lib/files/acceptedFiles.d.ts +1 -0
- package/dist/types/lib/hooks/dom/useKeepBrowserExtensionsInteractive.d.ts +1 -0
- package/package.json +10 -10
|
@@ -4,9 +4,14 @@
|
|
|
4
4
|
var __locale_default = {
|
|
5
5
|
"de-DE": {
|
|
6
6
|
"button.generate": "Generieren",
|
|
7
|
+
"button.generate.label": "Passwort generieren",
|
|
7
8
|
"button.generate.tooltip.hide": "Passwort verbergen",
|
|
8
9
|
"button.generate.tooltip.show": "Passwort anzeigen",
|
|
10
|
+
"password.announce.hidden": "Passwort wird verborgen",
|
|
11
|
+
"password.announce.revealed": "Passwort wird angezeigt",
|
|
9
12
|
"password.requirements.heading": "Anforderungen an dein Passwort",
|
|
13
|
+
"password.requirements.rule.fulfilled": "Erfüllt",
|
|
14
|
+
"password.requirements.rule.unfulfilled": "Nicht erfüllt",
|
|
10
15
|
"password.requirements.subject": "den Anforderungen an dein Passwort",
|
|
11
16
|
"validation.allowedSpecialCharacters": "Erlaubte Sonderzeichen: #!~%^*_+-=?()<>|.,;$:/",
|
|
12
17
|
"validation.atLeastOneCapitalLetter": "Mindestens ein Großbuchstabe",
|
|
@@ -45,9 +50,14 @@ var __locale_default = {
|
|
|
45
50
|
},
|
|
46
51
|
"en-US": {
|
|
47
52
|
"button.generate": "Generate",
|
|
53
|
+
"button.generate.label": "Generate password",
|
|
48
54
|
"button.generate.tooltip.hide": "Hide password",
|
|
49
55
|
"button.generate.tooltip.show": "Show password",
|
|
56
|
+
"password.announce.hidden": "Password is hidden",
|
|
57
|
+
"password.announce.revealed": "Password is shown",
|
|
50
58
|
"password.requirements.heading": "Requirements for your password",
|
|
59
|
+
"password.requirements.rule.fulfilled": "Fulfilled",
|
|
60
|
+
"password.requirements.rule.unfulfilled": "Not fulfilled",
|
|
51
61
|
"password.requirements.subject": "your password requirements",
|
|
52
62
|
"validation.allowedSpecialCharacters": "Allowed special characters: #!~%^*_+-=?()<>|.,;$:/",
|
|
53
63
|
"validation.atLeastOneCapitalLetter": "At least one capital letter",
|
package/dist/js/default.mjs
CHANGED
|
@@ -68,6 +68,7 @@ import { IconUnorderedList } from "./packages/components/src/components/Icon/com
|
|
|
68
68
|
import { IconUpload } from "./packages/components/src/components/Icon/components/icons/IconUpload.mjs";
|
|
69
69
|
import { IconView } from "./packages/components/src/components/Icon/components/icons/IconView.mjs";
|
|
70
70
|
import { IconAI } from "./packages/components/src/components/Icon/components/icons/IconAI.mjs";
|
|
71
|
+
import { IconAIHosting } from "./packages/components/src/components/Icon/components/icons/IconAIHosting.mjs";
|
|
71
72
|
import { IconAnalytics } from "./packages/components/src/components/Icon/components/icons/IconAnalytics.mjs";
|
|
72
73
|
import { IconApp } from "./packages/components/src/components/Icon/components/icons/IconApp.mjs";
|
|
73
74
|
import { IconAutoresponder } from "./packages/components/src/components/Icon/components/icons/IconAutoresponder.mjs";
|
|
@@ -337,4 +338,4 @@ import { TextField } from "./packages/components/src/components/TextField/TextFi
|
|
|
337
338
|
import { TimeField } from "./packages/components/src/components/TimeField/TimeField.mjs";
|
|
338
339
|
import { Truncate } from "./packages/components/src/components/Truncate/Truncate.mjs";
|
|
339
340
|
import { TunnelEntry } from "./packages/components/src/components/TunnelEntry/TunnelEntry.mjs";
|
|
340
|
-
export { AbortActionError, AccentBox, Accordion, Action, ActionBatch, ActionGroup, Activity, Alert, AlertBadge, AlertIcon, AlertText, Align, Area, AreaDot, Autocomplete, Avatar, AvatarStack, Badge, Bar, BigNumber, Breadcrumb, BrowserOnly, Button, CartesianChart, CartesianGrid, ChartGrid, ChartLegend, ChartTooltip, Chat, Checkbox, CheckboxButton, CheckboxGroup, ClearPropsContext, CoachMark, CodeBlock, CodeEditor, Color, ColumnLayout, Combine, ComboBox, ComponentDefaultsContext, ComponentDefaultsProvider, ComponentPropsContextProvider, Content, ContextMenu, ContextMenuContent, ContextMenuSection, ContextMenuTrigger, ContextualHelp, ContextualHelpTrigger, CopyButton, CounterBadge, CountryOptions, DatePicker, DateRangePicker, DeprecationWarningContext, DeprecationWarningProvider, DialogTrigger, Div, DonutChart, EmptyView, EmptyViewContainer, FieldDescription, FieldError, FileCard, FileCardList, FileDropZone, FileField, Flex, GridList, GridListItem, Header, HeaderNavigation, Heading, Icon, IconAI, IconAnalytics, IconApp, IconAscending, IconAttachment, IconAutoresponder, IconBackLink, IconBackup, IconBold, IconCamera, IconCertificate, IconChangelog, IconCheck, IconCheckboxChecked, IconCheckboxEmpty, IconCheckboxIndeterminate, IconChevronDown, IconChevronLeft, IconChevronRight, IconChevronUp, IconClose, IconCode, IconContainer, IconContextMenu, IconContextMenuVertical, IconContract, IconContractPartner, IconContributor, IconCopy, IconCronjob, IconCustomer, IconDanger, IconDashboard, IconDatabase, IconDate, IconDelete, IconDeliveryBox, IconDescending, IconDesktop, IconDirectory, IconDnsSubZone, IconDnsZone, IconDomain, IconDownload, IconEdit, IconEmail, IconEmailArchive, IconExtension, IconExternalLink, IconFailed, IconFeedback, IconFile, IconFilter, IconForwardAddress, IconForwardLink, IconHide, IconHome, IconImage, IconInfo, IconInvite, IconInvoice, IconItalic, IconKnowledgeHint, IconLanguage, IconLeadFyndr, IconLink, IconLock, IconLockOpen, IconLogout, IconMainUser, IconMarketplace, IconMaximize, IconMember, IconMenu, IconMinimize, IconMinus, IconMittwald, IconMobile, IconMonitoring, IconMove, IconNewsletter, IconNotification, IconNumber, IconOrder, IconOrderedList, IconPassword, IconPath, IconPause, IconPayment, IconPending, IconPicture, IconPlus, IconProject, IconQuote, IconRadioOff, IconRadioOn, IconRedo, IconRefresh, IconRegistry, IconSave, IconSearch, IconSecurity, IconSend, IconServer, IconSetProvider, IconSettings, IconShare, IconShow, IconSorting, IconSsh, IconSshKey, IconSshSftp, IconStack, IconStar, IconStarFilled, IconStart, IconStrikeThrough, IconSubdomain, IconSucceeded, IconSuccess, IconSupport, IconTerminate, IconTicket, IconTime, IconUnavailable, IconUndo, IconUnorderedList, IconUpload, IconUser, IconVhost, IconView, IconVolume, IconWarning, IllustratedMessage, Image, ImageCropper, Initials, InlineCode, IntlProvider, Kbd, Label, LabeledValue, LayoutCard, Legend, LegendItem, LightBox, LightBoxGallery, LightBoxGalleryItem, LightBoxTrigger, Line, Link, List, ListFilter, ListItem, ListItemView, ListItemViewContent, ListLoaderAsync, ListSorting, ListStaticData, ListSummary, LoadingSpinner, Markdown, MarkdownEditor, MenuItem, MenuTrigger, Message, MessageSeparator, MessageThread, Modal, ModalTrigger, Navigation, NavigationGroup, Notification, NotificationController, NotificationProvider, NumberField, Option, Overlay, OverlayContent, OverlayController, OverlayTrigger, PasswordCreationField, Popover, PopoverContent, PopoverTrigger, ProgressBar, PropsContextProvider, Radio, RadioButton, RadioGroup, RangeCalendar, Rating, RatingSegment, Render, RouterProvider, SearchField, Section, Segment, SegmentedControl, Select, Separator, SettingsProvider, Skeleton, SkeletonText, Slider, SortingFunctions, SuspenseTrigger, Switch, Tab, TabNavigation, TabTitle, Table, TableBody, TableCell, TableColumn, TableFooterRow, TableHeader, TableRow, Tabs, Text, TextArea, TextField, ThemedHtml, TimeField, Tooltip, TooltipTrigger, TranslationProvider, Truncate, TunnelEntry, TypedArea, TypedBar, TypedChartGrid, TypedChartLegend, TypedChartTooltip, TypedLine, TypedList, TypedListFilter, TypedListItem, TypedListLoaderAsync, TypedListSorting, TypedListStaticData, TypedXAxis, TypedYAxis, Wrap, XAxis, YAxis, abortAction, builtInComponentDefaults, dynamic, eventHandlerContext, flags, getRemoteEvent, getResolvedTheme, getTheme, iconCategories, isDateRangeValue, overlayTriggersTunneledTo, propsContext, setTheme, sortByDachFirst, themeHtmlAttribute, typedCartesianChart, typedList, useAriaAnnounceSuspense, useComponentDefaults, useControlledRemoteValueProps, useDesignTokens, useIsMounted, useLanguage, useList, useListMetadata, useLocalizedStringFormatter, useModalController, useNotificationController, useOnChange, useOverlayController, useProps, useTheme as useStoredTheme, useResolvedTheme as useTheme, useTranslationProvider, useWarnDeprecation };
|
|
341
|
+
export { AbortActionError, AccentBox, Accordion, Action, ActionBatch, ActionGroup, Activity, Alert, AlertBadge, AlertIcon, AlertText, Align, Area, AreaDot, Autocomplete, Avatar, AvatarStack, Badge, Bar, BigNumber, Breadcrumb, BrowserOnly, Button, CartesianChart, CartesianGrid, ChartGrid, ChartLegend, ChartTooltip, Chat, Checkbox, CheckboxButton, CheckboxGroup, ClearPropsContext, CoachMark, CodeBlock, CodeEditor, Color, ColumnLayout, Combine, ComboBox, ComponentDefaultsContext, ComponentDefaultsProvider, ComponentPropsContextProvider, Content, ContextMenu, ContextMenuContent, ContextMenuSection, ContextMenuTrigger, ContextualHelp, ContextualHelpTrigger, CopyButton, CounterBadge, CountryOptions, DatePicker, DateRangePicker, DeprecationWarningContext, DeprecationWarningProvider, DialogTrigger, Div, DonutChart, EmptyView, EmptyViewContainer, FieldDescription, FieldError, FileCard, FileCardList, FileDropZone, FileField, Flex, GridList, GridListItem, Header, HeaderNavigation, Heading, Icon, IconAI, IconAIHosting, IconAnalytics, IconApp, IconAscending, IconAttachment, IconAutoresponder, IconBackLink, IconBackup, IconBold, IconCamera, IconCertificate, IconChangelog, IconCheck, IconCheckboxChecked, IconCheckboxEmpty, IconCheckboxIndeterminate, IconChevronDown, IconChevronLeft, IconChevronRight, IconChevronUp, IconClose, IconCode, IconContainer, IconContextMenu, IconContextMenuVertical, IconContract, IconContractPartner, IconContributor, IconCopy, IconCronjob, IconCustomer, IconDanger, IconDashboard, IconDatabase, IconDate, IconDelete, IconDeliveryBox, IconDescending, IconDesktop, IconDirectory, IconDnsSubZone, IconDnsZone, IconDomain, IconDownload, IconEdit, IconEmail, IconEmailArchive, IconExtension, IconExternalLink, IconFailed, IconFeedback, IconFile, IconFilter, IconForwardAddress, IconForwardLink, IconHide, IconHome, IconImage, IconInfo, IconInvite, IconInvoice, IconItalic, IconKnowledgeHint, IconLanguage, IconLeadFyndr, IconLink, IconLock, IconLockOpen, IconLogout, IconMainUser, IconMarketplace, IconMaximize, IconMember, IconMenu, IconMinimize, IconMinus, IconMittwald, IconMobile, IconMonitoring, IconMove, IconNewsletter, IconNotification, IconNumber, IconOrder, IconOrderedList, IconPassword, IconPath, IconPause, IconPayment, IconPending, IconPicture, IconPlus, IconProject, IconQuote, IconRadioOff, IconRadioOn, IconRedo, IconRefresh, IconRegistry, IconSave, IconSearch, IconSecurity, IconSend, IconServer, IconSetProvider, IconSettings, IconShare, IconShow, IconSorting, IconSsh, IconSshKey, IconSshSftp, IconStack, IconStar, IconStarFilled, IconStart, IconStrikeThrough, IconSubdomain, IconSucceeded, IconSuccess, IconSupport, IconTerminate, IconTicket, IconTime, IconUnavailable, IconUndo, IconUnorderedList, IconUpload, IconUser, IconVhost, IconView, IconVolume, IconWarning, IllustratedMessage, Image, ImageCropper, Initials, InlineCode, IntlProvider, Kbd, Label, LabeledValue, LayoutCard, Legend, LegendItem, LightBox, LightBoxGallery, LightBoxGalleryItem, LightBoxTrigger, Line, Link, List, ListFilter, ListItem, ListItemView, ListItemViewContent, ListLoaderAsync, ListSorting, ListStaticData, ListSummary, LoadingSpinner, Markdown, MarkdownEditor, MenuItem, MenuTrigger, Message, MessageSeparator, MessageThread, Modal, ModalTrigger, Navigation, NavigationGroup, Notification, NotificationController, NotificationProvider, NumberField, Option, Overlay, OverlayContent, OverlayController, OverlayTrigger, PasswordCreationField, Popover, PopoverContent, PopoverTrigger, ProgressBar, PropsContextProvider, Radio, RadioButton, RadioGroup, RangeCalendar, Rating, RatingSegment, Render, RouterProvider, SearchField, Section, Segment, SegmentedControl, Select, Separator, SettingsProvider, Skeleton, SkeletonText, Slider, SortingFunctions, SuspenseTrigger, Switch, Tab, TabNavigation, TabTitle, Table, TableBody, TableCell, TableColumn, TableFooterRow, TableHeader, TableRow, Tabs, Text, TextArea, TextField, ThemedHtml, TimeField, Tooltip, TooltipTrigger, TranslationProvider, Truncate, TunnelEntry, TypedArea, TypedBar, TypedChartGrid, TypedChartLegend, TypedChartTooltip, TypedLine, TypedList, TypedListFilter, TypedListItem, TypedListLoaderAsync, TypedListSorting, TypedListStaticData, TypedXAxis, TypedYAxis, Wrap, XAxis, YAxis, abortAction, builtInComponentDefaults, dynamic, eventHandlerContext, flags, getRemoteEvent, getResolvedTheme, getTheme, iconCategories, isDateRangeValue, overlayTriggersTunneledTo, propsContext, setTheme, sortByDachFirst, themeHtmlAttribute, typedCartesianChart, typedList, useAriaAnnounceSuspense, useComponentDefaults, useControlledRemoteValueProps, useDesignTokens, useIsMounted, useLanguage, useList, useListMetadata, useLocalizedStringFormatter, useModalController, useNotificationController, useOnChange, useOverlayController, useProps, useTheme as useStoredTheme, useResolvedTheme as useTheme, useTranslationProvider, useWarnDeprecation };
|
|
@@ -58,6 +58,7 @@ import { IconUnorderedList } from "./packages/components/src/components/Icon/com
|
|
|
58
58
|
import { IconUpload } from "./packages/components/src/components/Icon/components/icons/IconUpload.mjs";
|
|
59
59
|
import { IconView } from "./packages/components/src/components/Icon/components/icons/IconView.mjs";
|
|
60
60
|
import { IconAI } from "./packages/components/src/components/Icon/components/icons/IconAI.mjs";
|
|
61
|
+
import { IconAIHosting } from "./packages/components/src/components/Icon/components/icons/IconAIHosting.mjs";
|
|
61
62
|
import { IconAnalytics } from "./packages/components/src/components/Icon/components/icons/IconAnalytics.mjs";
|
|
62
63
|
import { IconApp } from "./packages/components/src/components/Icon/components/icons/IconApp.mjs";
|
|
63
64
|
import { IconAutoresponder } from "./packages/components/src/components/Icon/components/icons/IconAutoresponder.mjs";
|
|
@@ -158,4 +159,4 @@ import { SettingsProvider } from "./packages/components/src/components/SettingsP
|
|
|
158
159
|
import { List } from "./packages/components/src/components/List/List.mjs";
|
|
159
160
|
import { typedList } from "./packages/components/src/components/List/typedList.mjs";
|
|
160
161
|
import { NotificationProvider, useNotificationController } from "./packages/components/src/components/NotificationProvider/NotificationProvider.mjs";
|
|
161
|
-
export { Action, ActionBatch, BrowserOnly, CountryOptions, DeprecationWarningProvider, IconAI, IconAnalytics, IconApp, IconAscending, IconAttachment, IconAutoresponder, IconBackLink, IconBackup, IconBold, IconCamera, IconCertificate, IconChangelog, IconCheck, IconCheckboxChecked, IconCheckboxEmpty, IconCheckboxIndeterminate, IconChevronDown, IconChevronLeft, IconChevronRight, IconChevronUp, IconClose, IconCode, IconContainer, IconContextMenu, IconContextMenuVertical, IconContract, IconContractPartner, IconContributor, IconCopy, IconCronjob, IconCustomer, IconDanger, IconDashboard, IconDatabase, IconDate, IconDelete, IconDeliveryBox, IconDescending, IconDesktop, IconDirectory, IconDnsSubZone, IconDnsZone, IconDomain, IconDownload, IconEdit, IconEmail, IconEmailArchive, IconExtension, IconExternalLink, IconFailed, IconFeedback, IconFile, IconFilter, IconForwardAddress, IconForwardLink, IconHide, IconHome, IconImage, IconInfo, IconInvite, IconInvoice, IconItalic, IconKnowledgeHint, IconLanguage, IconLeadFyndr, IconLink, IconLock, IconLockOpen, IconLogout, IconMainUser, IconMarketplace, IconMaximize, IconMember, IconMenu, IconMinimize, IconMinus, IconMittwald, IconMobile, IconMonitoring, IconMove, IconNewsletter, IconNotification, IconNumber, IconOrder, IconOrderedList, IconPassword, IconPath, IconPause, IconPayment, IconPending, IconPicture, IconPlus, IconProject, IconQuote, IconRadioOff, IconRadioOn, IconRedo, IconRefresh, IconRegistry, IconSave, IconSearch, IconSecurity, IconSend, IconServer, IconSettings, IconShare, IconShow, IconSorting, IconSsh, IconSshKey, IconSshSftp, IconStack, IconStar, IconStarFilled, IconStart, IconStrikeThrough, IconSubdomain, IconSucceeded, IconSuccess, IconSupport, IconTerminate, IconTicket, IconTime, IconUnavailable, IconUndo, IconUnorderedList, IconUpload, IconUser, IconVhost, IconView, IconVolume, IconWarning, IntlProvider, LightBox, LightBoxTrigger, List, ListItemView, Modal, ModalTrigger, NotificationProvider, OverlayController, Popover, PopoverTrigger, SettingsProvider, Wrap, typedList, useControlledRemoteValueProps, useIsMounted, useLanguage, useModalController, useNotificationController, useOnChange, useOverlayController, useProps };
|
|
162
|
+
export { Action, ActionBatch, BrowserOnly, CountryOptions, DeprecationWarningProvider, IconAI, IconAIHosting, IconAnalytics, IconApp, IconAscending, IconAttachment, IconAutoresponder, IconBackLink, IconBackup, IconBold, IconCamera, IconCertificate, IconChangelog, IconCheck, IconCheckboxChecked, IconCheckboxEmpty, IconCheckboxIndeterminate, IconChevronDown, IconChevronLeft, IconChevronRight, IconChevronUp, IconClose, IconCode, IconContainer, IconContextMenu, IconContextMenuVertical, IconContract, IconContractPartner, IconContributor, IconCopy, IconCronjob, IconCustomer, IconDanger, IconDashboard, IconDatabase, IconDate, IconDelete, IconDeliveryBox, IconDescending, IconDesktop, IconDirectory, IconDnsSubZone, IconDnsZone, IconDomain, IconDownload, IconEdit, IconEmail, IconEmailArchive, IconExtension, IconExternalLink, IconFailed, IconFeedback, IconFile, IconFilter, IconForwardAddress, IconForwardLink, IconHide, IconHome, IconImage, IconInfo, IconInvite, IconInvoice, IconItalic, IconKnowledgeHint, IconLanguage, IconLeadFyndr, IconLink, IconLock, IconLockOpen, IconLogout, IconMainUser, IconMarketplace, IconMaximize, IconMember, IconMenu, IconMinimize, IconMinus, IconMittwald, IconMobile, IconMonitoring, IconMove, IconNewsletter, IconNotification, IconNumber, IconOrder, IconOrderedList, IconPassword, IconPath, IconPause, IconPayment, IconPending, IconPicture, IconPlus, IconProject, IconQuote, IconRadioOff, IconRadioOn, IconRedo, IconRefresh, IconRegistry, IconSave, IconSearch, IconSecurity, IconSend, IconServer, IconSettings, IconShare, IconShow, IconSorting, IconSsh, IconSshKey, IconSshSftp, IconStack, IconStar, IconStarFilled, IconStart, IconStrikeThrough, IconSubdomain, IconSucceeded, IconSuccess, IconSupport, IconTerminate, IconTicket, IconTime, IconUnavailable, IconUndo, IconUnorderedList, IconUpload, IconUser, IconVhost, IconView, IconVolume, IconWarning, IntlProvider, LightBox, LightBoxTrigger, List, ListItemView, Modal, ModalTrigger, NotificationProvider, OverlayController, Popover, PopoverTrigger, SettingsProvider, Wrap, typedList, useControlledRemoteValueProps, useIsMounted, useLanguage, useModalController, useNotificationController, useOnChange, useOverlayController, useProps };
|
|
@@ -9,9 +9,21 @@ import { Button } from "../Button/Button.mjs";
|
|
|
9
9
|
import { Activity } from "../Activity/Activity.mjs";
|
|
10
10
|
import { UiComponentTunnelExit } from "../UiComponentTunnel/UiComponentTunnelExit.mjs";
|
|
11
11
|
import clsx from "clsx";
|
|
12
|
-
import { useId, useState } from "react";
|
|
12
|
+
import { useCallback, useId, useState } from "react";
|
|
13
13
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
14
|
//#region src/components/Accordion/Accordion.tsx
|
|
15
|
+
var HeaderButton = (props) => {
|
|
16
|
+
const { children, contentId, isExpanded, onToggle } = props;
|
|
17
|
+
return /* @__PURE__ */ jsxs(Button, {
|
|
18
|
+
tunnel: null,
|
|
19
|
+
unstyled: true,
|
|
20
|
+
"aria-expanded": isExpanded,
|
|
21
|
+
className: Accordion_module_default.headerButton,
|
|
22
|
+
onPress: onToggle,
|
|
23
|
+
"aria-controls": contentId,
|
|
24
|
+
children: [children, /* @__PURE__ */ jsx(IconChevronDown, { className: Accordion_module_default.chevron })]
|
|
25
|
+
});
|
|
26
|
+
};
|
|
15
27
|
/**
|
|
16
28
|
* @flr-generate all
|
|
17
29
|
* @flowStatus beta
|
|
@@ -22,18 +34,13 @@ var Accordion = flowComponent("Accordion", (props) => {
|
|
|
22
34
|
const rootClassName = clsx(Accordion_module_default.accordion, expanded && Accordion_module_default.expanded, variant === "outline" && Accordion_module_default.outline, className);
|
|
23
35
|
const headerId = useId();
|
|
24
36
|
const contentId = useId();
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
onPress: () => setExpanded((expanded) => !expanded),
|
|
33
|
-
"aria-controls": contentId,
|
|
34
|
-
children: [children, /* @__PURE__ */ jsx(IconChevronDown, { className: Accordion_module_default.chevron })]
|
|
35
|
-
});
|
|
36
|
-
};
|
|
37
|
+
const toggle = useCallback(() => setExpanded((expanded) => !expanded), []);
|
|
38
|
+
const renderHeaderButton = (children) => /* @__PURE__ */ jsx(HeaderButton, {
|
|
39
|
+
contentId,
|
|
40
|
+
isExpanded: expanded,
|
|
41
|
+
onToggle: toggle,
|
|
42
|
+
children
|
|
43
|
+
});
|
|
37
44
|
const propsContext = {
|
|
38
45
|
Content: {
|
|
39
46
|
className: Accordion_module_default.contentInner,
|
|
@@ -46,18 +53,19 @@ var Accordion = flowComponent("Accordion", (props) => {
|
|
|
46
53
|
className: Accordion_module_default.header,
|
|
47
54
|
level: 4,
|
|
48
55
|
size: "xs",
|
|
49
|
-
children: dynamic((props) =>
|
|
56
|
+
children: dynamic((props) => renderHeaderButton(props.children)),
|
|
50
57
|
Button: { size: "m" }
|
|
51
58
|
},
|
|
52
59
|
Label: {
|
|
53
60
|
className: Accordion_module_default.header,
|
|
54
|
-
children: dynamic((props) =>
|
|
61
|
+
children: dynamic((props) => renderHeaderButton(props.children))
|
|
55
62
|
}
|
|
56
63
|
};
|
|
57
64
|
return /* @__PURE__ */ jsx("div", {
|
|
58
65
|
...rest,
|
|
59
66
|
className: rootClassName,
|
|
60
67
|
children: /* @__PURE__ */ jsxs(PropsContextProvider, {
|
|
68
|
+
dependencies: [expanded],
|
|
61
69
|
props: propsContext,
|
|
62
70
|
children: [children, /* @__PURE__ */ jsx("div", {
|
|
63
71
|
"aria-labelledby": headerId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.mjs","names":[],"sources":["../../../../../../../src/components/Accordion/Accordion.tsx"],"sourcesContent":["import type { ComponentProps, FC, PropsWithChildren } from \"react\";\nimport { useId, useState } from \"react\";\nimport clsx from \"clsx\";\nimport styles from \"./Accordion.module.scss\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { dynamic, PropsContextProvider } from \"@/lib/propsContext\";\nimport { Button } from \"@/components/Button\";\nimport { IconChevronDown } from \"@/components/Icon/components/icons\";\nimport { Activity } from \"@/components/Activity\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\n\nexport interface AccordionProps extends PropsWithChildren<\n ComponentProps<\"div\">\n> {\n /** Whether the accordion should be initially expanded. */\n defaultExpanded?: boolean;\n /** The visual variant of the accordion. @default \"default\" */\n variant?: \"default\" | \"outline\";\n}\n\n/**\n * @flr-generate all\n * @flowStatus beta\n */\nexport const Accordion: FC<AccordionProps> = flowComponent(\n \"Accordion\",\n (props) => {\n const {\n children,\n className,\n defaultExpanded = false,\n variant = \"default\",\n ...rest\n } = props;\n const [expanded, setExpanded] = useState(defaultExpanded);\n\n const rootClassName = clsx(\n styles.accordion,\n expanded && styles.expanded,\n variant === \"outline\" && styles.outline,\n className,\n );\n\n const headerId = useId();\n\n const contentId = useId();\n\n const
|
|
1
|
+
{"version":3,"file":"Accordion.mjs","names":[],"sources":["../../../../../../../src/components/Accordion/Accordion.tsx"],"sourcesContent":["import type { ComponentProps, FC, PropsWithChildren, ReactNode } from \"react\";\nimport { useCallback, useId, useState } from \"react\";\nimport clsx from \"clsx\";\nimport styles from \"./Accordion.module.scss\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { dynamic, PropsContextProvider } from \"@/lib/propsContext\";\nimport { Button } from \"@/components/Button\";\nimport { IconChevronDown } from \"@/components/Icon/components/icons\";\nimport { Activity } from \"@/components/Activity\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\n\nexport interface AccordionProps extends PropsWithChildren<\n ComponentProps<\"div\">\n> {\n /** Whether the accordion should be initially expanded. */\n defaultExpanded?: boolean;\n /** The visual variant of the accordion. @default \"default\" */\n variant?: \"default\" | \"outline\";\n}\n\ninterface HeaderButtonProps extends PropsWithChildren {\n contentId: string;\n isExpanded: boolean;\n onToggle: () => void;\n}\n\n/*\n * Declared here and not inside the accordion: a component defined in a render\n * body gets a new identity on every render, so React unmounts and remounts it —\n * and the toggle loses the focus it just received on its own press.\n */\nconst HeaderButton: FC<HeaderButtonProps> = (props) => {\n const { children, contentId, isExpanded, onToggle } = props;\n\n return (\n <Button\n tunnel={null}\n unstyled\n aria-expanded={isExpanded}\n className={styles.headerButton}\n onPress={onToggle}\n aria-controls={contentId}\n >\n {children}\n <IconChevronDown className={styles.chevron} />\n </Button>\n );\n};\n\n/**\n * @flr-generate all\n * @flowStatus beta\n */\nexport const Accordion: FC<AccordionProps> = flowComponent(\n \"Accordion\",\n (props) => {\n const {\n children,\n className,\n defaultExpanded = false,\n variant = \"default\",\n ...rest\n } = props;\n const [expanded, setExpanded] = useState(defaultExpanded);\n\n const rootClassName = clsx(\n styles.accordion,\n expanded && styles.expanded,\n variant === \"outline\" && styles.outline,\n className,\n );\n\n const headerId = useId();\n\n const contentId = useId();\n\n const toggle = useCallback(() => setExpanded((expanded) => !expanded), []);\n\n const renderHeaderButton = (children: ReactNode) => (\n <HeaderButton\n contentId={contentId}\n isExpanded={expanded}\n onToggle={toggle}\n >\n {children}\n </HeaderButton>\n );\n\n const propsContext: PropsContext = {\n Content: {\n className: styles.contentInner,\n tunnel: {\n id: \"content\",\n component: \"Accordion\",\n },\n },\n Heading: {\n className: styles.header,\n level: 4,\n size: \"xs\",\n children: dynamic((props) => renderHeaderButton(props.children)),\n Button: { size: \"m\" },\n },\n Label: {\n className: styles.header,\n children: dynamic((props) => renderHeaderButton(props.children)),\n },\n };\n\n return (\n <div {...rest} className={rootClassName}>\n {/*\n * The props context is memoized, and the header button reads `expanded`\n * from it – without the dependency the toggle keeps announcing the state\n * it was first rendered with.\n */}\n {/*\n * The props context is memoized, and the header button takes `expanded`\n * from it – without the dependency the toggle keeps announcing the\n * state it was first rendered with.\n */}\n <PropsContextProvider dependencies={[expanded]} props={propsContext}>\n {children}\n <div\n aria-labelledby={headerId}\n id={contentId}\n role=\"region\"\n hidden={!expanded}\n className={styles.content}\n >\n <Activity isActive={expanded} inactiveDelay={1000}>\n <UiComponentTunnelExit id=\"content\" component=\"Accordion\" />\n </Activity>\n </div>\n </PropsContextProvider>\n </div>\n );\n },\n {\n type: \"layout\",\n },\n);\n\nexport default Accordion;\n"],"mappings":";;;;;;;;;;;;;;AAgCA,IAAM,gBAAuC,UAAU;CACrD,MAAM,EAAE,UAAU,WAAW,YAAY,aAAa;CAEtD,OACE,qBAAC,QAAD;EACE,QAAQ;EACR,UAAA;EACA,iBAAe;EACf,WAAW,yBAAO;EAClB,SAAS;EACT,iBAAe;EANjB,UAAA,CAQG,UACD,oBAAC,iBAAD,EAAiB,WAAW,yBAAO,QAAU,CAAA,CACvC;;AAEZ;;;;;AAMA,IAAa,YAAgC,cAC3C,cACC,UAAU;CACT,MAAM,EACJ,UACA,WACA,kBAAkB,OAClB,UAAU,WACV,GAAG,SACD;CACJ,MAAM,CAAC,UAAU,eAAe,SAAS,eAAe;CAExD,MAAM,gBAAgB,KACpB,yBAAO,WACP,YAAY,yBAAO,UACnB,YAAY,aAAa,yBAAO,SAChC,SACF;CAEA,MAAM,WAAW,MAAM;CAEvB,MAAM,YAAY,MAAM;CAExB,MAAM,SAAS,kBAAkB,aAAa,aAAa,CAAC,QAAQ,GAAG,CAAC,CAAC;CAEzE,MAAM,sBAAsB,aAC1B,oBAAC,cAAD;EACa;EACX,YAAY;EACZ,UAAU;EAET;CACW,CAAA;CAGhB,MAAM,eAA6B;EACjC,SAAS;GACP,WAAW,yBAAO;GAClB,QAAQ;IACN,IAAI;IACJ,WAAW;GACb;EACF;EACA,SAAS;GACP,WAAW,yBAAO;GAClB,OAAO;GACP,MAAM;GACN,UAAU,SAAS,UAAU,mBAAmB,MAAM,QAAQ,CAAC;GAC/D,QAAQ,EAAE,MAAM,IAAI;EACtB;EACA,OAAO;GACL,WAAW,yBAAO;GAClB,UAAU,SAAS,UAAU,mBAAmB,MAAM,QAAQ,CAAC;EACjE;CACF;CAEA,OACE,oBAAC,OAAD;EAAK,GAAI;EAAM,WAAW;EAWxB,UAAA,qBAAC,sBAAD;GAAsB,cAAc,CAAC,QAAQ;GAAG,OAAO;GAAvD,UAAA,CACG,UACD,oBAAC,OAAD;IACE,mBAAiB;IACjB,IAAI;IACJ,MAAK;IACL,QAAQ,CAAC;IACT,WAAW,yBAAO;IAElB,UAAA,oBAAC,UAAD;KAAU,UAAU;KAAU,eAAe;KAC3C,UAAA,oBAAC,uBAAD;MAAuB,IAAG;MAAU,WAAU;KAAa,CAAA;IACnD,CAAA;GACP,CAAA,CACe;;CACnB,CAAA;AAET,GACA,EACE,MAAM,SACR,CACF"}
|
|
@@ -15,7 +15,7 @@ import { TypedChartLegend } from "./components/ChartLegend/ChartLegend.mjs";
|
|
|
15
15
|
import { TypedChartTooltip } from "./components/ChartTooltip/types.mjs";
|
|
16
16
|
import { TypedLine } from "./components/Line/Line.mjs";
|
|
17
17
|
import clsx from "clsx";
|
|
18
|
-
import { isValidElement, useMemo } from "react";
|
|
18
|
+
import { isValidElement, useId, useMemo } from "react";
|
|
19
19
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
20
20
|
import { ComposedChart, ResponsiveContainer } from "recharts";
|
|
21
21
|
//#region src/components/CartesianChart/CartesianChart.tsx
|
|
@@ -32,7 +32,11 @@ var CartesianChart = (props) => {
|
|
|
32
32
|
if (!emptyView) return;
|
|
33
33
|
return null;
|
|
34
34
|
}, [emptyView]);
|
|
35
|
-
const
|
|
35
|
+
const chartId = useId().replaceAll(/[^\w-]/g, "");
|
|
36
|
+
const contextValue = useMemo(() => ({
|
|
37
|
+
layout,
|
|
38
|
+
stackIdPrefix: `${chartId}-`
|
|
39
|
+
}), [layout, chartId]);
|
|
36
40
|
return /* @__PURE__ */ jsx(CartesianChartContextProvider, {
|
|
37
41
|
value: contextValue,
|
|
38
42
|
children: /* @__PURE__ */ jsx(Wrap, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CartesianChart.mjs","names":[],"sources":["../../../../../../../src/components/CartesianChart/CartesianChart.tsx"],"sourcesContent":["import { ComposedChart, ResponsiveContainer } from \"recharts\";\nimport {\n type ComponentProps,\n type ComponentType,\n type FC,\n isValidElement,\n type PropsWithChildren,\n type ReactNode,\n useMemo,\n} from \"react\";\nimport clsx from \"clsx\";\nimport styles from \"./CartesianChart.module.scss\";\nimport { useChartClipRect } from \"@/components/CartesianChart/hooks/useChartClipRect\";\nimport DivView from \"@/views/DivView\";\nimport Wrap from \"@/components/Wrap\";\nimport type {\n CartesianChartLayout,\n ChartDataValue,\n DataKeyProp,\n} from \"@/components/CartesianChart/types\";\nimport { CartesianChartContextProvider } from \"@/components/CartesianChart/context\";\nimport { TypedArea } from \"@/components/CartesianChart/components/Area\";\nimport { TypedBar } from \"@/components/CartesianChart/components/Bar\";\nimport { TypedXAxis } from \"@/components/CartesianChart/components/XAxis\";\nimport { TypedYAxis } from \"@/components/CartesianChart/components/YAxis\";\nimport { TypedChartGrid } from \"@/components/CartesianChart/components/ChartGrid\";\nimport { TypedChartLegend } from \"@/components/CartesianChart/components/ChartLegend\";\nimport { TypedChartTooltip } from \"@/components/CartesianChart/components/ChartTooltip\";\nimport { TypedLine } from \"@/components/CartesianChart/components/Line\";\nimport { useWarnDeprecation } from \"@/components/DeprecationWarningProvider\";\n\n/** @deprecated Use a ReactNode instead */\nexport interface CartesianChartEmptyViewProps {\n data?: ComponentProps<typeof ComposedChart>[\"data\"];\n}\n\nexport interface CartesianChartProps<TData = ChartDataValue>\n extends\n Pick<\n ComponentProps<typeof ComposedChart>,\n \"className\" | \"syncId\" | \"syncMethod\"\n >,\n PropsWithChildren {\n /** The data points rendered by the chart. */\n data?: TData[];\n\n /** The height of the chart. */\n height?: string;\n\n /**\n * The orientation of the axes and graphical items. `\"horizontal\"` puts the\n * category axis on the x-axis — bars grow upwards. `\"vertical\"` puts it on\n * the y-axis — bars grow to the side. `XAxis` and `YAxis` follow the layout\n * on their own; only the `dataKey` moves to whichever axis is the categorical\n * one.\n *\n * @default \"horizontal\"\n */\n layout?: CartesianChartLayout;\n\n /** View that is provided when data is empty/undefined */\n emptyView?: ReactNode;\n\n /**\n * Allow the height controlling container to set flex-grow: 1. Can only be\n * used in combination with `height`\n */\n flexGrow?: boolean;\n}\n\n/** @flr-generate all */\nexport const CartesianChart: FC<CartesianChartProps> = (props) => {\n const {\n children,\n data,\n className,\n height,\n flexGrow,\n emptyView,\n layout = \"horizontal\",\n ...rest\n } = props;\n const warnDeprecation = useWarnDeprecation();\n\n const { viewDimensions, ref: containerRef } = useChartClipRect();\n\n const showEmptyView = !!((!data || data.length === 0) && emptyView);\n const rootClassName = clsx(\n styles.cartesianChart,\n showEmptyView && styles.emptyView,\n className,\n );\n const usesDeprecatedEmptyView = !!emptyView && !isValidElement(emptyView);\n\n if (usesDeprecatedEmptyView) {\n warnDeprecation(\n \"CartesianChart: emptyView as a non-element is deprecated and will be removed in a future release. Please provide an element as emptyView.\",\n );\n }\n\n const emptyElement = useMemo(() => {\n if (isValidElement(emptyView)) {\n return emptyView;\n }\n\n if (!emptyView) {\n return;\n }\n\n return null;\n }, [emptyView]);\n\n const contextValue = useMemo(() => ({ layout }),
|
|
1
|
+
{"version":3,"file":"CartesianChart.mjs","names":[],"sources":["../../../../../../../src/components/CartesianChart/CartesianChart.tsx"],"sourcesContent":["import { ComposedChart, ResponsiveContainer } from \"recharts\";\nimport {\n type ComponentProps,\n type ComponentType,\n type FC,\n isValidElement,\n type PropsWithChildren,\n type ReactNode,\n useId,\n useMemo,\n} from \"react\";\nimport clsx from \"clsx\";\nimport styles from \"./CartesianChart.module.scss\";\nimport { useChartClipRect } from \"@/components/CartesianChart/hooks/useChartClipRect\";\nimport DivView from \"@/views/DivView\";\nimport Wrap from \"@/components/Wrap\";\nimport type {\n CartesianChartLayout,\n ChartDataValue,\n DataKeyProp,\n} from \"@/components/CartesianChart/types\";\nimport { CartesianChartContextProvider } from \"@/components/CartesianChart/context\";\nimport { TypedArea } from \"@/components/CartesianChart/components/Area\";\nimport { TypedBar } from \"@/components/CartesianChart/components/Bar\";\nimport { TypedXAxis } from \"@/components/CartesianChart/components/XAxis\";\nimport { TypedYAxis } from \"@/components/CartesianChart/components/YAxis\";\nimport { TypedChartGrid } from \"@/components/CartesianChart/components/ChartGrid\";\nimport { TypedChartLegend } from \"@/components/CartesianChart/components/ChartLegend\";\nimport { TypedChartTooltip } from \"@/components/CartesianChart/components/ChartTooltip\";\nimport { TypedLine } from \"@/components/CartesianChart/components/Line\";\nimport { useWarnDeprecation } from \"@/components/DeprecationWarningProvider\";\n\n/** @deprecated Use a ReactNode instead */\nexport interface CartesianChartEmptyViewProps {\n data?: ComponentProps<typeof ComposedChart>[\"data\"];\n}\n\nexport interface CartesianChartProps<TData = ChartDataValue>\n extends\n Pick<\n ComponentProps<typeof ComposedChart>,\n \"className\" | \"syncId\" | \"syncMethod\"\n >,\n PropsWithChildren {\n /** The data points rendered by the chart. */\n data?: TData[];\n\n /** The height of the chart. */\n height?: string;\n\n /**\n * The orientation of the axes and graphical items. `\"horizontal\"` puts the\n * category axis on the x-axis — bars grow upwards. `\"vertical\"` puts it on\n * the y-axis — bars grow to the side. `XAxis` and `YAxis` follow the layout\n * on their own; only the `dataKey` moves to whichever axis is the categorical\n * one.\n *\n * @default \"horizontal\"\n */\n layout?: CartesianChartLayout;\n\n /** View that is provided when data is empty/undefined */\n emptyView?: ReactNode;\n\n /**\n * Allow the height controlling container to set flex-grow: 1. Can only be\n * used in combination with `height`\n */\n flexGrow?: boolean;\n}\n\n/** @flr-generate all */\nexport const CartesianChart: FC<CartesianChartProps> = (props) => {\n const {\n children,\n data,\n className,\n height,\n flexGrow,\n emptyView,\n layout = \"horizontal\",\n ...rest\n } = props;\n const warnDeprecation = useWarnDeprecation();\n\n const { viewDimensions, ref: containerRef } = useChartClipRect();\n\n const showEmptyView = !!((!data || data.length === 0) && emptyView);\n const rootClassName = clsx(\n styles.cartesianChart,\n showEmptyView && styles.emptyView,\n className,\n );\n const usesDeprecatedEmptyView = !!emptyView && !isValidElement(emptyView);\n\n if (usesDeprecatedEmptyView) {\n warnDeprecation(\n \"CartesianChart: emptyView as a non-element is deprecated and will be removed in a future release. Please provide an element as emptyView.\",\n );\n }\n\n const emptyElement = useMemo(() => {\n if (isValidElement(emptyView)) {\n return emptyView;\n }\n\n if (!emptyView) {\n return;\n }\n\n return null;\n }, [emptyView]);\n\n const chartId = useId().replaceAll(/[^\\w-]/g, \"\");\n const contextValue = useMemo(\n () => ({ layout, stackIdPrefix: `${chartId}-` }),\n [layout, chartId],\n );\n\n return (\n <CartesianChartContextProvider value={contextValue}>\n <Wrap if={height}>\n <div style={{ height, flex: flexGrow ? 1 : undefined }}>\n <ResponsiveContainer\n initialDimension={{\n // fix warning on initial render\n width: 1,\n height: 1,\n }}\n width={height ? undefined : \"100%\"}\n aspect={height ? undefined : 3}\n ref={containerRef}\n >\n <ComposedChart\n data={data}\n className={rootClassName}\n layout={layout}\n {...rest}\n >\n {children}\n {showEmptyView && viewDimensions && (\n <foreignObject {...viewDimensions}>\n <DivView className={styles.emptyViewContainer}>\n {emptyElement}\n </DivView>\n </foreignObject>\n )}\n </ComposedChart>\n </ResponsiveContainer>\n </div>\n </Wrap>\n </CartesianChartContextProvider>\n );\n};\n\nexport const typedCartesianChart = <\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n TData extends ChartDataValue<any> = ChartDataValue<any>,\n XAxisDataKey extends DataKeyProp<TData> = DataKeyProp<TData>,\n>() => ({\n Chart: CartesianChart as ComponentType<CartesianChartProps<TData>>,\n Area: TypedArea<TData>(),\n Bar: TypedBar<TData>(),\n XAxis: TypedXAxis<TData, XAxisDataKey>(),\n YAxis: TypedYAxis<TData>(),\n Grid: TypedChartGrid(),\n Legend: TypedChartLegend(),\n Tooltip: TypedChartTooltip<TData, XAxisDataKey>(),\n Line: TypedLine<TData>(),\n});\n\nexport default CartesianChart;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAwEA,IAAa,kBAA2C,UAAU;CAChE,MAAM,EACJ,UACA,MACA,WACA,QACA,UACA,WACA,SAAS,cACT,GAAG,SACD;CACJ,MAAM,kBAAkB,mBAAmB;CAE3C,MAAM,EAAE,gBAAgB,KAAK,iBAAiB,iBAAiB;CAE/D,MAAM,gBAAgB,CAAC,GAAG,CAAC,QAAQ,KAAK,WAAW,MAAM;CACzD,MAAM,gBAAgB,KACpB,8BAAO,gBACP,iBAAiB,8BAAO,WACxB,SACF;CAGA,IAFgC,CAAC,CAAC,aAAa,CAAC,eAAe,SAAS,GAGtE,gBACE,2IACF;CAGF,MAAM,eAAe,cAAc;EACjC,IAAI,eAAe,SAAS,GAC1B,OAAO;EAGT,IAAI,CAAC,WACH;EAGF,OAAO;CACT,GAAG,CAAC,SAAS,CAAC;CAEd,MAAM,UAAU,MAAM,CAAC,CAAC,WAAW,WAAW,EAAE;CAChD,MAAM,eAAe,eACZ;EAAE;EAAQ,eAAe,GAAG,QAAQ;CAAG,IAC9C,CAAC,QAAQ,OAAO,CAClB;CAEA,OACE,oBAAC,+BAAD;EAA+B,OAAO;EACpC,UAAA,oBAAC,MAAD;GAAM,IAAI;GACR,UAAA,oBAAC,OAAD;IAAK,OAAO;KAAE;KAAQ,MAAM,WAAW,IAAI,KAAA;IAAU;IACnD,UAAA,oBAAC,qBAAD;KACE,kBAAkB;MAEhB,OAAO;MACP,QAAQ;KACV;KACA,OAAO,SAAS,KAAA,IAAY;KAC5B,QAAQ,SAAS,KAAA,IAAY;KAC7B,KAAK;KAEL,UAAA,qBAAC,eAAD;MACQ;MACN,WAAW;MACH;MACR,GAAI;MAJN,UAAA,CAMG,UACA,iBAAiB,kBAChB,oBAAC,iBAAD;OAAe,GAAI;OACjB,UAAA,oBAAC,SAAD;QAAS,WAAW,8BAAO;QACxB,UAAA;OACM,CAAA;MACI,CAAA,CAEJ;;IACI,CAAA;GAClB,CAAA;EACD,CAAA;CACuB,CAAA;AAEnC;AAEA,IAAa,6BAIL;CACN,OAAO;CACP,MAAM,UAAiB;CACvB,KAAK,SAAgB;CACrB,OAAO,WAAgC;CACvC,OAAO,WAAkB;CACzB,MAAM,eAAe;CACrB,QAAQ,iBAAiB;CACzB,SAAS,kBAAuC;CAChD,MAAM,UAAiB;AACzB"}
|
|
@@ -4,14 +4,16 @@ import { useDesignTokens } from "../../../../lib/theming/hooks/useDesignTokens.m
|
|
|
4
4
|
import { AreaDot } from "../AreaDot/AreaDot.mjs";
|
|
5
5
|
import { isCategoricalColor } from "../../../../lib/tokens/isCategoricalColor.mjs";
|
|
6
6
|
import { isDataKeyWithLabel } from "../../types.mjs";
|
|
7
|
+
import { useScopedStackId } from "../../hooks/useScopedStackId.mjs";
|
|
7
8
|
import "react";
|
|
8
9
|
import { jsx } from "react/jsx-runtime";
|
|
9
10
|
import * as Recharts from "recharts";
|
|
10
11
|
//#region src/components/CartesianChart/components/Area/Area.tsx
|
|
11
12
|
/** @flr-generate all */
|
|
12
13
|
var Area = (props) => {
|
|
13
|
-
const { color: colorFromProps = "sea-green", stackId = 1, fillOpacity = 1, ...rest } = props;
|
|
14
|
+
const { color: colorFromProps = "sea-green", stackId: stackIdFromProps = 1, fillOpacity = 1, ...rest } = props;
|
|
14
15
|
const tokens = useDesignTokens();
|
|
16
|
+
const stackId = useScopedStackId(stackIdFromProps);
|
|
15
17
|
const color = isCategoricalColor(colorFromProps) ? `var(--color--categorical--${colorFromProps})` : colorFromProps;
|
|
16
18
|
return /* @__PURE__ */ jsx(Recharts.Area, {
|
|
17
19
|
name: isDataKeyWithLabel(props) ? props.dataKeyLabel : props.dataKey,
|
package/dist/js/packages/components/src/components/CartesianChart/components/Area/Area.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Area.mjs","names":[],"sources":["../../../../../../../../../src/components/CartesianChart/components/Area/Area.tsx"],"sourcesContent":["import { type ComponentType, type FC } from \"react\";\nimport * as Recharts from \"recharts\";\nimport { AreaDot } from \"../AreaDot\";\nimport type { CategoricalWithCustomColor } from \"@/lib/tokens/CategoricalColors\";\nimport { isCategoricalColor } from \"@/lib/tokens/isCategoricalColor\";\nimport {\n type ChartDataValue,\n type DataKeyProp,\n type DataKeyWithLabel,\n isDataKeyWithLabel,\n} from \"@/components/CartesianChart/types\";\nimport { useDesignTokens } from \"@/lib/theming\";\n\ntype AreaBaseProps = Pick<\n Recharts.AreaProps,\n | \"className\"\n | \"stackId\"\n | \"fillOpacity\"\n | \"key\"\n | \"xAxisId\"\n | \"yAxisId\"\n | \"type\"\n | \"unit\"\n> & {\n /** The color of the area. @default \"sea-green\" */\n color?: CategoricalWithCustomColor;\n};\n\nexport interface AreaPropsByDataKeyProp<\n TData extends ChartDataValue = ChartDataValue,\n> extends AreaBaseProps {\n dataKey: DataKeyProp<TData>;\n}\n\nexport interface AreaPropsByDataKey<\n TData extends ChartDataValue = ChartDataValue,\n>\n extends AreaBaseProps, DataKeyWithLabel<TData> {}\n\nexport type AreaProps<TData extends ChartDataValue = ChartDataValue> =\n AreaPropsByDataKey<TData> | AreaPropsByDataKeyProp<TData>;\n\n/** @flr-generate all */\nexport const Area: FC<AreaProps> = (props) => {\n const {\n color: colorFromProps = \"sea-green\",\n stackId = 1,\n fillOpacity = 1,\n ...rest\n } = props;\n\n const tokens = useDesignTokens();\n\n const color = isCategoricalColor(colorFromProps)\n ? `var(--color--categorical--${colorFromProps})`\n : colorFromProps;\n\n return (\n <Recharts.Area\n name={isDataKeyWithLabel(props) ? props.dataKeyLabel : props.dataKey}\n stackId={stackId}\n fillOpacity={fillOpacity}\n {...rest}\n activeDot={<AreaDot color={color} />}\n fill={color}\n stroke={tokens.area[\"border-color\"].value}\n strokeWidth={tokens.area[\"border-width\"].value}\n />\n );\n};\n\nexport const TypedArea = <TData extends ChartDataValue = ChartDataValue>() =>\n Area as ComponentType<AreaPropsByDataKeyProp<TData>>;\n\nexport default Area;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Area.mjs","names":[],"sources":["../../../../../../../../../src/components/CartesianChart/components/Area/Area.tsx"],"sourcesContent":["import { type ComponentType, type FC } from \"react\";\nimport * as Recharts from \"recharts\";\nimport { AreaDot } from \"../AreaDot\";\nimport type { CategoricalWithCustomColor } from \"@/lib/tokens/CategoricalColors\";\nimport { isCategoricalColor } from \"@/lib/tokens/isCategoricalColor\";\nimport {\n type ChartDataValue,\n type DataKeyProp,\n type DataKeyWithLabel,\n isDataKeyWithLabel,\n} from \"@/components/CartesianChart/types\";\nimport { useScopedStackId } from \"@/components/CartesianChart/hooks/useScopedStackId\";\nimport { useDesignTokens } from \"@/lib/theming\";\n\ntype AreaBaseProps = Pick<\n Recharts.AreaProps,\n | \"className\"\n | \"stackId\"\n | \"fillOpacity\"\n | \"key\"\n | \"xAxisId\"\n | \"yAxisId\"\n | \"type\"\n | \"unit\"\n> & {\n /** The color of the area. @default \"sea-green\" */\n color?: CategoricalWithCustomColor;\n};\n\nexport interface AreaPropsByDataKeyProp<\n TData extends ChartDataValue = ChartDataValue,\n> extends AreaBaseProps {\n dataKey: DataKeyProp<TData>;\n}\n\nexport interface AreaPropsByDataKey<\n TData extends ChartDataValue = ChartDataValue,\n>\n extends AreaBaseProps, DataKeyWithLabel<TData> {}\n\nexport type AreaProps<TData extends ChartDataValue = ChartDataValue> =\n AreaPropsByDataKey<TData> | AreaPropsByDataKeyProp<TData>;\n\n/** @flr-generate all */\nexport const Area: FC<AreaProps> = (props) => {\n const {\n color: colorFromProps = \"sea-green\",\n stackId: stackIdFromProps = 1,\n fillOpacity = 1,\n ...rest\n } = props;\n\n const tokens = useDesignTokens();\n const stackId = useScopedStackId(stackIdFromProps);\n\n const color = isCategoricalColor(colorFromProps)\n ? `var(--color--categorical--${colorFromProps})`\n : colorFromProps;\n\n return (\n <Recharts.Area\n name={isDataKeyWithLabel(props) ? props.dataKeyLabel : props.dataKey}\n stackId={stackId}\n fillOpacity={fillOpacity}\n {...rest}\n activeDot={<AreaDot color={color} />}\n fill={color}\n stroke={tokens.area[\"border-color\"].value}\n strokeWidth={tokens.area[\"border-width\"].value}\n />\n );\n};\n\nexport const TypedArea = <TData extends ChartDataValue = ChartDataValue>() =>\n Area as ComponentType<AreaPropsByDataKeyProp<TData>>;\n\nexport default Area;\n"],"mappings":";;;;;;;;;;;;AA4CA,IAAa,QAAuB,UAAU;CAC5C,MAAM,EACJ,OAAO,iBAAiB,aACxB,SAAS,mBAAmB,GAC5B,cAAc,GACd,GAAG,SACD;CAEJ,MAAM,SAAS,gBAAgB;CAC/B,MAAM,UAAU,iBAAiB,gBAAgB;CAEjD,MAAM,QAAQ,mBAAmB,cAAc,IAC3C,6BAA6B,eAAe,KAC5C;CAEJ,OACE,oBAAC,SAAS,MAAV;EACE,MAAM,mBAAmB,KAAK,IAAI,MAAM,eAAe,MAAM;EACpD;EACI;EACb,GAAI;EACJ,WAAW,oBAAC,SAAD,EAAgB,MAAQ,CAAA;EACnC,MAAM;EACN,QAAQ,OAAO,KAAK,eAAe,CAAC;EACpC,aAAa,OAAO,KAAK,eAAe,CAAC;CAC1C,CAAA;AAEL;AAEA,IAAa,kBACX"}
|
|
@@ -4,6 +4,7 @@ import { useDesignTokens } from "../../../../lib/theming/hooks/useDesignTokens.m
|
|
|
4
4
|
import { useCartesianChartContext } from "../../context.mjs";
|
|
5
5
|
import { isCategoricalColor } from "../../../../lib/tokens/isCategoricalColor.mjs";
|
|
6
6
|
import { isDataKeyWithLabel } from "../../types.mjs";
|
|
7
|
+
import { useScopedStackId } from "../../hooks/useScopedStackId.mjs";
|
|
7
8
|
import "react";
|
|
8
9
|
import { jsx } from "react/jsx-runtime";
|
|
9
10
|
import * as Recharts from "recharts";
|
|
@@ -13,9 +14,10 @@ var Bar = (props) => {
|
|
|
13
14
|
const { color: colorFromProps = "sea-green", ...rest } = props;
|
|
14
15
|
const tokens = useDesignTokens();
|
|
15
16
|
const { layout } = useCartesianChartContext();
|
|
17
|
+
const stackId = useScopedStackId(props.stackId);
|
|
16
18
|
const color = isCategoricalColor(colorFromProps) ? `var(--color--categorical--${colorFromProps})` : colorFromProps;
|
|
17
19
|
const cornerRadius = parseInt(tokens.bar["corner-radius"].value);
|
|
18
|
-
const radius =
|
|
20
|
+
const radius = layout === "vertical" ? [
|
|
19
21
|
0,
|
|
20
22
|
cornerRadius,
|
|
21
23
|
cornerRadius,
|
|
@@ -26,11 +28,18 @@ var Bar = (props) => {
|
|
|
26
28
|
0,
|
|
27
29
|
0
|
|
28
30
|
];
|
|
29
|
-
|
|
31
|
+
const bar = /* @__PURE__ */ jsx(Recharts.Bar, {
|
|
30
32
|
name: isDataKeyWithLabel(props) ? props.dataKeyLabel : props.dataKey,
|
|
31
33
|
...rest,
|
|
34
|
+
stackId,
|
|
32
35
|
fill: color,
|
|
33
|
-
radius
|
|
36
|
+
radius: stackId === void 0 ? radius : 0
|
|
37
|
+
});
|
|
38
|
+
if (stackId === void 0) return bar;
|
|
39
|
+
return /* @__PURE__ */ jsx(Recharts.BarStack, {
|
|
40
|
+
stackId,
|
|
41
|
+
radius,
|
|
42
|
+
children: bar
|
|
34
43
|
});
|
|
35
44
|
};
|
|
36
45
|
var TypedBar = () => Bar;
|
package/dist/js/packages/components/src/components/CartesianChart/components/Bar/Bar.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Bar.mjs","names":[],"sources":["../../../../../../../../../src/components/CartesianChart/components/Bar/Bar.tsx"],"sourcesContent":["import { type ComponentType, type FC } from \"react\";\nimport * as Recharts from \"recharts\";\nimport type { CategoricalWithCustomColor } from \"@/lib/tokens/CategoricalColors\";\nimport { isCategoricalColor } from \"@/lib/tokens/isCategoricalColor\";\nimport {\n type ChartDataValue,\n type DataKeyProp,\n type DataKeyWithLabel,\n isDataKeyWithLabel,\n} from \"@/components/CartesianChart/types\";\nimport { useCartesianChartContext } from \"@/components/CartesianChart/context\";\nimport { useDesignTokens } from \"@/lib/theming\";\n\ntype BarBaseProps = Pick<\n Recharts.BarProps,\n | \"className\"\n | \"stackId\"\n | \"key\"\n | \"xAxisId\"\n | \"yAxisId\"\n | \"unit\"\n | \"barSize\"\n | \"maxBarSize\"\n | \"minPointSize\"\n> & {\n /** The color of the bar. @default \"sea-green\" */\n color?: CategoricalWithCustomColor;\n};\n\nexport interface BarPropsByDataKeyProp<\n TData extends ChartDataValue = ChartDataValue,\n> extends BarBaseProps {\n dataKey: DataKeyProp<TData>;\n}\n\nexport interface BarPropsByDataKey<\n TData extends ChartDataValue = ChartDataValue,\n>\n extends BarBaseProps, DataKeyWithLabel<TData> {}\n\nexport type BarProps<TData extends ChartDataValue = ChartDataValue> =\n BarPropsByDataKey<TData> | BarPropsByDataKeyProp<TData>;\n\n/** @flr-generate all */\nexport const Bar: FC<BarProps> = (props) => {\n const { color: colorFromProps = \"sea-green\", ...rest } = props;\n\n const tokens = useDesignTokens();\n const { layout } = useCartesianChartContext();\n\n const color = isCategoricalColor(colorFromProps)\n ? `var(--color--categorical--${colorFromProps})`\n : colorFromProps;\n\n const cornerRadius = parseInt(tokens.bar[\"corner-radius\"].value);\n const radius: Recharts.BarProps[\"radius\"] =\n
|
|
1
|
+
{"version":3,"file":"Bar.mjs","names":[],"sources":["../../../../../../../../../src/components/CartesianChart/components/Bar/Bar.tsx"],"sourcesContent":["import { type ComponentType, type FC } from \"react\";\nimport * as Recharts from \"recharts\";\nimport type { CategoricalWithCustomColor } from \"@/lib/tokens/CategoricalColors\";\nimport { isCategoricalColor } from \"@/lib/tokens/isCategoricalColor\";\nimport {\n type ChartDataValue,\n type DataKeyProp,\n type DataKeyWithLabel,\n isDataKeyWithLabel,\n} from \"@/components/CartesianChart/types\";\nimport { useCartesianChartContext } from \"@/components/CartesianChart/context\";\nimport { useScopedStackId } from \"@/components/CartesianChart/hooks/useScopedStackId\";\nimport { useDesignTokens } from \"@/lib/theming\";\n\ntype BarBaseProps = Pick<\n Recharts.BarProps,\n | \"className\"\n | \"stackId\"\n | \"key\"\n | \"xAxisId\"\n | \"yAxisId\"\n | \"unit\"\n | \"barSize\"\n | \"maxBarSize\"\n | \"minPointSize\"\n> & {\n /** The color of the bar. @default \"sea-green\" */\n color?: CategoricalWithCustomColor;\n};\n\nexport interface BarPropsByDataKeyProp<\n TData extends ChartDataValue = ChartDataValue,\n> extends BarBaseProps {\n dataKey: DataKeyProp<TData>;\n}\n\nexport interface BarPropsByDataKey<\n TData extends ChartDataValue = ChartDataValue,\n>\n extends BarBaseProps, DataKeyWithLabel<TData> {}\n\nexport type BarProps<TData extends ChartDataValue = ChartDataValue> =\n BarPropsByDataKey<TData> | BarPropsByDataKeyProp<TData>;\n\n/** @flr-generate all */\nexport const Bar: FC<BarProps> = (props) => {\n const { color: colorFromProps = \"sea-green\", ...rest } = props;\n\n const tokens = useDesignTokens();\n const { layout } = useCartesianChartContext();\n const stackId = useScopedStackId(props.stackId);\n\n const color = isCategoricalColor(colorFromProps)\n ? `var(--color--categorical--${colorFromProps})`\n : colorFromProps;\n\n const cornerRadius = parseInt(tokens.bar[\"corner-radius\"].value);\n const radius: Recharts.BarProps[\"radius\"] =\n layout === \"vertical\"\n ? [0, cornerRadius, cornerRadius, 0]\n : [cornerRadius, cornerRadius, 0, 0];\n\n const bar = (\n <Recharts.Bar\n name={isDataKeyWithLabel(props) ? props.dataKeyLabel : props.dataKey}\n {...rest}\n stackId={stackId}\n fill={color}\n radius={stackId === undefined ? radius : 0}\n />\n );\n\n if (stackId === undefined) {\n return bar;\n }\n\n // Every Bar of a stack renders its own BarStack, because a Bar cannot know\n // its siblings — they all describe the same clip path, so the duplicates are\n // redundant rather than conflicting.\n return (\n <Recharts.BarStack stackId={stackId} radius={radius}>\n {bar}\n </Recharts.BarStack>\n );\n};\n\nexport const TypedBar = <TData extends ChartDataValue = ChartDataValue>() =>\n Bar as ComponentType<BarPropsByDataKeyProp<TData>>;\n\nexport default Bar;\n"],"mappings":";;;;;;;;;;;;AA6CA,IAAa,OAAqB,UAAU;CAC1C,MAAM,EAAE,OAAO,iBAAiB,aAAa,GAAG,SAAS;CAEzD,MAAM,SAAS,gBAAgB;CAC/B,MAAM,EAAE,WAAW,yBAAyB;CAC5C,MAAM,UAAU,iBAAiB,MAAM,OAAO;CAE9C,MAAM,QAAQ,mBAAmB,cAAc,IAC3C,6BAA6B,eAAe,KAC5C;CAEJ,MAAM,eAAe,SAAS,OAAO,IAAI,gBAAgB,CAAC,KAAK;CAC/D,MAAM,SACJ,WAAW,aACP;EAAC;EAAG;EAAc;EAAc;CAAC,IACjC;EAAC;EAAc;EAAc;EAAG;CAAC;CAEvC,MAAM,MACJ,oBAAC,SAAS,KAAV;EACE,MAAM,mBAAmB,KAAK,IAAI,MAAM,eAAe,MAAM;EAC7D,GAAI;EACK;EACT,MAAM;EACN,QAAQ,YAAY,KAAA,IAAY,SAAS;CAC1C,CAAA;CAGH,IAAI,YAAY,KAAA,GACd,OAAO;CAMT,OACE,oBAAC,SAAS,UAAV;EAA4B;EAAiB;EAC1C,UAAA;CACgB,CAAA;AAEvB;AAEA,IAAa,iBACX"}
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
/* */
|
|
3
3
|
import { createContext, useContext } from "react";
|
|
4
4
|
//#region src/components/CartesianChart/context.ts
|
|
5
|
-
var cartesianChartContext = createContext({
|
|
5
|
+
var cartesianChartContext = createContext({
|
|
6
|
+
layout: "horizontal",
|
|
7
|
+
stackIdPrefix: ""
|
|
8
|
+
});
|
|
6
9
|
var useCartesianChartContext = () => useContext(cartesianChartContext);
|
|
7
10
|
var CartesianChartContextProvider = cartesianChartContext.Provider;
|
|
8
11
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.mjs","names":[],"sources":["../../../../../../../src/components/CartesianChart/context.ts"],"sourcesContent":["import { createContext, useContext } from \"react\";\nimport type { CartesianChartLayout } from \"@/components/CartesianChart/types\";\n\ninterface CartesianChartContext {\n layout: CartesianChartLayout;\n}\n\nconst cartesianChartContext = createContext<CartesianChartContext>({\n layout: \"horizontal\",\n});\n\nexport const useCartesianChartContext = (): CartesianChartContext =>\n useContext(cartesianChartContext);\n\nexport const CartesianChartContextProvider = cartesianChartContext.Provider;\n"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"context.mjs","names":[],"sources":["../../../../../../../src/components/CartesianChart/context.ts"],"sourcesContent":["import { createContext, useContext } from \"react\";\nimport type { CartesianChartLayout } from \"@/components/CartesianChart/types\";\n\ninterface CartesianChartContext {\n layout: CartesianChartLayout;\n /**\n * Prefix that scopes a stack ID to this chart. Recharts derives DOM IDs from\n * the stack ID, so two charts on one page sharing a stack ID would otherwise\n * share their clip paths.\n */\n stackIdPrefix: string;\n}\n\nconst cartesianChartContext = createContext<CartesianChartContext>({\n layout: \"horizontal\",\n stackIdPrefix: \"\",\n});\n\nexport const useCartesianChartContext = (): CartesianChartContext =>\n useContext(cartesianChartContext);\n\nexport const CartesianChartContextProvider = cartesianChartContext.Provider;\n"],"mappings":";;;;AAaA,IAAM,wBAAwB,cAAqC;CACjE,QAAQ;CACR,eAAe;AACjB,CAAC;AAED,IAAa,iCACX,WAAW,qBAAqB;AAElC,IAAa,gCAAgC,sBAAsB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
import { useCartesianChartContext } from "../context.mjs";
|
|
4
|
+
//#region src/components/CartesianChart/hooks/useScopedStackId.ts
|
|
5
|
+
/**
|
|
6
|
+
* Scopes a stack ID to the surrounding chart, so that charts on the same page
|
|
7
|
+
* using the same stack ID do not share the DOM IDs Recharts derives from it.
|
|
8
|
+
*/
|
|
9
|
+
var useScopedStackId = (stackId) => {
|
|
10
|
+
const { stackIdPrefix } = useCartesianChartContext();
|
|
11
|
+
return stackId === void 0 ? void 0 : `${stackIdPrefix}${stackId}`;
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { useScopedStackId };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=useScopedStackId.mjs.map
|
package/dist/js/packages/components/src/components/CartesianChart/hooks/useScopedStackId.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useScopedStackId.mjs","names":[],"sources":["../../../../../../../../src/components/CartesianChart/hooks/useScopedStackId.ts"],"sourcesContent":["import type { StackId } from \"recharts/types/util/ChartUtils\";\nimport { useCartesianChartContext } from \"@/components/CartesianChart/context\";\n\n/**\n * Scopes a stack ID to the surrounding chart, so that charts on the same page\n * using the same stack ID do not share the DOM IDs Recharts derives from it.\n */\nexport const useScopedStackId = (\n stackId: StackId | undefined,\n): string | undefined => {\n const { stackIdPrefix } = useCartesianChartContext();\n return stackId === undefined ? undefined : `${stackIdPrefix}${stackId}`;\n};\n"],"mappings":";;;;;;;;AAOA,IAAa,oBACX,YACuB;CACvB,MAAM,EAAE,kBAAkB,yBAAyB;CACnD,OAAO,YAAY,KAAA,IAAY,KAAA,IAAY,GAAG,gBAAgB;AAChE"}
|
|
@@ -29,7 +29,10 @@ var CombineImplementation = (props) => {
|
|
|
29
29
|
className: Combine_module_default.icon,
|
|
30
30
|
color: "neutral"
|
|
31
31
|
},
|
|
32
|
-
ContextualHelpTrigger: { Button: {
|
|
32
|
+
ContextualHelpTrigger: { Button: {
|
|
33
|
+
className: Combine_module_default.contextualHelpTriggerButton,
|
|
34
|
+
color: "secondary"
|
|
35
|
+
} }
|
|
33
36
|
};
|
|
34
37
|
return /* @__PURE__ */ jsx(PropsContextProvider, {
|
|
35
38
|
props: propsContext,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Combine.mjs","names":[],"sources":["../../../../../../../src/components/Combine/Combine.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from \"react\";\nimport styles from \"./Combine.module.scss\";\nimport clsx from \"clsx\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\n\nexport interface CombineProps\n extends PropsWithChildren, PropsWithClassName, FlowComponentProps {}\n\n/**\n * The arrangement itself, shared with the deprecated `Align` alias so both\n * names render the exact same output.\n */\nexport const CombineImplementation: FC<CombineProps> = (props) => {\n const { children, className } = props;\n\n const rootClassName = clsx(styles.combine, className);\n\n const propsContext: PropsContext = {\n Text: { className: styles.text },\n Button: { className: styles.button },\n Avatar: { className: styles.avatar, size: \"m\" },\n CopyButton: { size: \"s\", className: styles.copyButton },\n Icon: { size: \"s\", className: styles.icon, color: \"neutral\" },\n ContextualHelpTrigger: {\n Button: {\n className: styles.contextualHelpTriggerButton,\n },\n },\n };\n\n return (\n <PropsContextProvider props={propsContext}>\n <div className={rootClassName}>{children}</div>\n </PropsContextProvider>\n );\n};\n\n/**\n * @flowStatus new\n * @flr-generate all\n */\nexport const Combine = flowComponent(\"Combine\", CombineImplementation, {\n type: \"layout\",\n});\n\nexport default Combine;\n"],"mappings":";;;;;;;;;;;;AAgBA,IAAa,yBAA2C,UAAU;CAChE,MAAM,EAAE,UAAU,cAAc;CAEhC,MAAM,gBAAgB,KAAK,uBAAO,SAAS,SAAS;CAEpD,MAAM,eAA6B;EACjC,MAAM,EAAE,WAAW,uBAAO,KAAK;EAC/B,QAAQ,EAAE,WAAW,uBAAO,OAAO;EACnC,QAAQ;GAAE,WAAW,uBAAO;GAAQ,MAAM;EAAI;EAC9C,YAAY;GAAE,MAAM;GAAK,WAAW,uBAAO;EAAW;EACtD,MAAM;GAAE,MAAM;GAAK,WAAW,uBAAO;GAAM,OAAO;EAAU;EAC5D,uBAAuB,EACrB,QAAQ,
|
|
1
|
+
{"version":3,"file":"Combine.mjs","names":[],"sources":["../../../../../../../src/components/Combine/Combine.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from \"react\";\nimport styles from \"./Combine.module.scss\";\nimport clsx from \"clsx\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\n\nexport interface CombineProps\n extends PropsWithChildren, PropsWithClassName, FlowComponentProps {}\n\n/**\n * The arrangement itself, shared with the deprecated `Align` alias so both\n * names render the exact same output.\n */\nexport const CombineImplementation: FC<CombineProps> = (props) => {\n const { children, className } = props;\n\n const rootClassName = clsx(styles.combine, className);\n\n const propsContext: PropsContext = {\n Text: { className: styles.text },\n Button: { className: styles.button },\n Avatar: { className: styles.avatar, size: \"m\" },\n CopyButton: { size: \"s\", className: styles.copyButton },\n Icon: { size: \"s\", className: styles.icon, color: \"neutral\" },\n ContextualHelpTrigger: {\n Button: {\n className: styles.contextualHelpTriggerButton,\n color: \"secondary\",\n },\n },\n };\n\n return (\n <PropsContextProvider props={propsContext}>\n <div className={rootClassName}>{children}</div>\n </PropsContextProvider>\n );\n};\n\n/**\n * @flowStatus new\n * @flr-generate all\n */\nexport const Combine = flowComponent(\"Combine\", CombineImplementation, {\n type: \"layout\",\n});\n\nexport default Combine;\n"],"mappings":";;;;;;;;;;;;AAgBA,IAAa,yBAA2C,UAAU;CAChE,MAAM,EAAE,UAAU,cAAc;CAEhC,MAAM,gBAAgB,KAAK,uBAAO,SAAS,SAAS;CAEpD,MAAM,eAA6B;EACjC,MAAM,EAAE,WAAW,uBAAO,KAAK;EAC/B,QAAQ,EAAE,WAAW,uBAAO,OAAO;EACnC,QAAQ;GAAE,WAAW,uBAAO;GAAQ,MAAM;EAAI;EAC9C,YAAY;GAAE,MAAM;GAAK,WAAW,uBAAO;EAAW;EACtD,MAAM;GAAE,MAAM;GAAK,WAAW,uBAAO;GAAM,OAAO;EAAU;EAC5D,uBAAuB,EACrB,QAAQ;GACN,WAAW,uBAAO;GAClB,OAAO;EACT,EACF;CACF;CAEA,OACE,oBAAC,sBAAD;EAAsB,OAAO;EAC3B,UAAA,oBAAC,OAAD;GAAK,WAAW;GAAgB;EAAc,CAAA;CAC1B,CAAA;AAE1B;;;;;AAMA,IAAa,UAAU,cAAc,WAAW,uBAAuB,EACrE,MAAM,SACR,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Combine.module.mjs","names":[],"sources":["../../../../../../../src/components/Combine/Combine.module.scss"],"sourcesContent":[".combine {\n &:has(.avatar):has(.text) {\n display: flex;\n gap: var(--combine--avatar-text--spacing);\n height: fit-content;\n\n --first-two-lines-height: calc(var(--line-height-s) * 2);\n\n min-height: var(--first-two-lines-height);\n\n .text {\n flex-grow: 1;\n display: flex;\n flex-direction: column;\n align-self: center;\n font-size: var(--font-size-text--s);\n }\n\n .avatar {\n margin-top: calc(\n (var(--first-two-lines-height) - var(--avatar--size--m)) / 2\n );\n }\n }\n\n &:has(:global(.flow--form-field)):has(.button) {\n display: flex;\n align-items: flex-start;\n column-gap: var(--combine--input-button--spacing);\n\n :global(.flow--form-field) {\n flex-grow: 1;\n }\n\n &:has(label) {\n .button {\n margin-top: calc(var(--line-height-s) + var(--form-control--spacing-y));\n }\n }\n }\n\n &:has(.text):has(.contextualHelpTriggerButton),\n &:has(.text):has(.copyButton) {\n display: flex;\n align-items: center;\n column-gap: var(--combine--text-button--spacing);\n }\n\n &:has(> .text):has(> .icon) {\n display: flex;\n align-items: center;\n column-gap: var(--combine--icon-text--spacing);\n }\n}\n\n@media (max-width: 550px) {\n .combine:has(:global(.flow--form-field)):has(.button) {\n flex-direction: column;\n row-gap: var(--section--spacing);\n align-items: stretch;\n\n .button {\n width: 100%;\n }\n\n &:has(label) {\n .button {\n margin-top: 0;\n }\n }\n }\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"Combine.module.mjs","names":[],"sources":["../../../../../../../src/components/Combine/Combine.module.scss"],"sourcesContent":[".combine {\n &:has(.avatar):has(.text) {\n display: flex;\n gap: var(--combine--avatar-text--spacing);\n height: fit-content;\n\n --first-two-lines-height: calc(var(--line-height-s) * 2);\n\n min-height: var(--first-two-lines-height);\n\n .text {\n flex-grow: 1;\n display: flex;\n flex-direction: column;\n align-self: center;\n font-size: var(--font-size-text--s);\n }\n\n .avatar {\n margin-top: calc(\n (var(--first-two-lines-height) - var(--avatar--size--m)) / 2\n );\n }\n }\n\n &:has(:global(.flow--form-field)):has(.button) {\n display: flex;\n align-items: flex-start;\n column-gap: var(--combine--input-button--spacing);\n\n :global(.flow--form-field) {\n flex-grow: 1;\n }\n\n &:has(label) {\n .button {\n margin-top: calc(var(--line-height-s) + var(--form-control--spacing-y));\n }\n }\n }\n\n &:has(.text):has(.contextualHelpTriggerButton),\n &:has(.text):has(.copyButton) {\n display: inline-flex;\n align-items: center;\n column-gap: var(--combine--text-button--spacing);\n }\n\n &:has(> .text):has(> .icon) {\n display: inline-flex;\n align-items: center;\n column-gap: var(--combine--icon-text--spacing);\n }\n}\n\n@media (max-width: 550px) {\n .combine:has(:global(.flow--form-field)):has(.button) {\n flex-direction: column;\n row-gap: var(--section--spacing);\n align-items: stretch;\n\n .button {\n width: 100%;\n }\n\n &:has(label) {\n .button {\n margin-top: 0;\n }\n }\n }\n}\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DonutChart.module.mjs","names":[],"sources":["../../../../../../../src/components/DonutChart/DonutChart.module.scss"],"sourcesContent":[".donutChart {\n position: relative;\n width: fit-content;\n flex-shrink: 0;\n\n .border {\n stroke: var(--donut-chart--border-color);\n }\n\n .background {\n stroke: var(--donut-chart--background-color);\n }\n\n .value {\n position: absolute;\n inset: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n text-align: center;\n overflow-wrap: anywhere;\n padding: var(--donut-chart--padding--m);\n }\n\n &.size-l {\n .value {\n font-size: var(--font-size-heading--xl);\n padding: var(--donut-chart--padding--l);\n\n small {\n font-size: var(--font-size-heading--l);\n }\n }\n }\n\n /* Variants */\n @mixin status($status) {\n &.#{$status} {\n .fill {\n stroke: var(--donut-chart--#{$status}-fill-background-color);\n }\n }\n }\n\n @include status(info);\n @include status(success);\n @include status(danger);\n @include status(warning);\n}\n\n.donutChartContainer {\n display: flex;\n gap: var(--donut-chart--spacing-y) var(--donut-chart--spacing-x);\n align-items: center;\n\n &.bottom {\n flex-direction: column;\n }\n\n &.top {\n flex-direction: column-reverse;\n }\n\n &.right {\n .legend {\n justify-content: start;\n }\n }\n\n &.left {\n flex-direction: row-reverse;\n\n .legend {\n justify-content: start;\n }\n }\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"DonutChart.module.mjs","names":[],"sources":["../../../../../../../src/components/DonutChart/DonutChart.module.scss"],"sourcesContent":[".donutChart {\n position: relative;\n width: fit-content;\n height: fit-content;\n flex-shrink: 0;\n\n .border {\n stroke: var(--donut-chart--border-color);\n }\n\n .background {\n stroke: var(--donut-chart--background-color);\n }\n\n .value {\n position: absolute;\n inset: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n text-align: center;\n overflow-wrap: anywhere;\n padding: var(--donut-chart--padding--m);\n }\n\n &.size-l {\n .value {\n font-size: var(--font-size-heading--xl);\n padding: var(--donut-chart--padding--l);\n\n small {\n font-size: var(--font-size-heading--l);\n }\n }\n }\n\n /* Variants */\n @mixin status($status) {\n &.#{$status} {\n .fill {\n stroke: var(--donut-chart--#{$status}-fill-background-color);\n }\n }\n }\n\n @include status(info);\n @include status(success);\n @include status(danger);\n @include status(warning);\n}\n\n.donutChartContainer {\n display: flex;\n gap: var(--donut-chart--spacing-y) var(--donut-chart--spacing-x);\n align-items: center;\n\n &.bottom {\n flex-direction: column;\n }\n\n &.top {\n flex-direction: column-reverse;\n }\n\n &.right {\n .legend {\n justify-content: start;\n }\n }\n\n &.left {\n flex-direction: row-reverse;\n\n .legend {\n justify-content: start;\n }\n }\n}\n"],"mappings":""}
|
|
@@ -5,6 +5,7 @@ import { flowComponent } from "../../lib/componentFactory/flowComponent.mjs";
|
|
|
5
5
|
import { useFieldComponent } from "../../lib/hooks/useFieldComponent.mjs";
|
|
6
6
|
import { IllustratedMessage } from "../IllustratedMessage/IllustratedMessage.mjs";
|
|
7
7
|
import FileDropZone_module_default from "./FileDropZone.module.mjs";
|
|
8
|
+
import { getAcceptedFiles } from "../../lib/files/acceptedFiles.mjs";
|
|
8
9
|
import clsx from "clsx";
|
|
9
10
|
import { useRef } from "react";
|
|
10
11
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -39,8 +40,7 @@ var FileDropZone = flowComponent("FileDropZone", (props) => {
|
|
|
39
40
|
};
|
|
40
41
|
const onDropHandler = async (event) => {
|
|
41
42
|
if (isReadOnly) return;
|
|
42
|
-
const
|
|
43
|
-
const files = await Promise.all(fileDropItems.filter((f) => !accept || accept?.includes(f.type)).map(async (f) => await f.getFile()));
|
|
43
|
+
const files = await getAcceptedFiles(event.items, accept);
|
|
44
44
|
if (files.length > 0) {
|
|
45
45
|
const fileTransfer = new DataTransfer();
|
|
46
46
|
for (const file of multiple ? files : [files[0]]) if (file) fileTransfer.items.add(file);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileDropZone.mjs","names":[],"sources":["../../../../../../../src/components/FileDropZone/FileDropZone.tsx"],"sourcesContent":["import { type FC, type PropsWithChildren, useRef } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport { IllustratedMessage } from \"@/components/IllustratedMessage\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport styles from \"./FileDropZone.module.scss\";\nimport clsx from \"clsx\";\nimport type { FileInputOnChangeHandler } from \"@/components/FileField/components/FileInput\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport type { DropEvent, FocusableElement } from \"@react-types/shared\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\n\nexport interface FileDropZoneProps\n extends\n PropsWithClassName,\n FlowComponentProps<FocusableElement>,\n PropsWithChildren,\n Pick<Aria.InputProps, \"accept\" | \"multiple\" | \"name\">,\n Pick<Aria.DropZoneProps, \"isDisabled\"> {\n /** Called with the dropped or selected files whenever the selection changes. */\n onChange?: FileInputOnChangeHandler;\n /** Whether the component is read only. */\n isReadOnly?: boolean;\n}\n\n/** @flr-generate all */\nexport const FileDropZone: FC<FileDropZoneProps> = flowComponent(\n \"FileDropZone\",\n (props) => {\n const {\n multiple,\n accept,\n className,\n onChange: onChangeDropZone,\n children,\n name,\n isDisabled,\n isReadOnly,\n } = props;\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldProps,\n fieldPropsContext,\n } = useFieldComponent(props, \"FileDropZone\");\n\n const fileFieldRef = useRef<HTMLInputElement>(null);\n const rootClassName = clsx(\n styles.fileDropZone,\n isDisabled && styles.disabled,\n className,\n );\n\n const propsContext: PropsContext = {\n ...fieldPropsContext,\n IllustratedMessage: {\n FileField: {\n name,\n onChange: onChangeDropZone,\n ref: fileFieldRef,\n accept: accept,\n multiple: multiple,\n Button: { variant: \"outline\", color: \"dark\" },\n isDisabled,\n isReadOnly,\n },\n Heading: {\n className: styles.heading,\n },\n Icon: { className: styles.icon },\n Text: { className: styles.text },\n },\n };\n\n const onDropHandler = async (event: DropEvent) => {\n if (isReadOnly) {\n return;\n }\n\n const
|
|
1
|
+
{"version":3,"file":"FileDropZone.mjs","names":[],"sources":["../../../../../../../src/components/FileDropZone/FileDropZone.tsx"],"sourcesContent":["import { type FC, type PropsWithChildren, useRef } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport { IllustratedMessage } from \"@/components/IllustratedMessage\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport styles from \"./FileDropZone.module.scss\";\nimport clsx from \"clsx\";\nimport type { FileInputOnChangeHandler } from \"@/components/FileField/components/FileInput\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport type { DropEvent, FocusableElement } from \"@react-types/shared\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { getAcceptedFiles } from \"@/lib/files/acceptedFiles\";\n\nexport interface FileDropZoneProps\n extends\n PropsWithClassName,\n FlowComponentProps<FocusableElement>,\n PropsWithChildren,\n Pick<Aria.InputProps, \"accept\" | \"multiple\" | \"name\">,\n Pick<Aria.DropZoneProps, \"isDisabled\"> {\n /** Called with the dropped or selected files whenever the selection changes. */\n onChange?: FileInputOnChangeHandler;\n /** Whether the component is read only. */\n isReadOnly?: boolean;\n}\n\n/** @flr-generate all */\nexport const FileDropZone: FC<FileDropZoneProps> = flowComponent(\n \"FileDropZone\",\n (props) => {\n const {\n multiple,\n accept,\n className,\n onChange: onChangeDropZone,\n children,\n name,\n isDisabled,\n isReadOnly,\n } = props;\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldProps,\n fieldPropsContext,\n } = useFieldComponent(props, \"FileDropZone\");\n\n const fileFieldRef = useRef<HTMLInputElement>(null);\n const rootClassName = clsx(\n styles.fileDropZone,\n isDisabled && styles.disabled,\n className,\n );\n\n const propsContext: PropsContext = {\n ...fieldPropsContext,\n IllustratedMessage: {\n FileField: {\n name,\n onChange: onChangeDropZone,\n ref: fileFieldRef,\n accept: accept,\n multiple: multiple,\n Button: { variant: \"outline\", color: \"dark\" },\n isDisabled,\n isReadOnly,\n },\n Heading: {\n className: styles.heading,\n },\n Icon: { className: styles.icon },\n Text: { className: styles.text },\n },\n };\n\n const onDropHandler = async (event: DropEvent) => {\n if (isReadOnly) {\n return;\n }\n\n const files = await getAcceptedFiles(event.items, accept);\n\n if (files.length > 0) {\n const fileTransfer = new DataTransfer();\n for (const file of multiple ? files : [files[0]]) {\n if (file) {\n fileTransfer.items.add(file);\n }\n }\n\n onChangeDropZone?.(fileTransfer.files);\n if (fileFieldRef.current) {\n fileFieldRef.current.files = fileTransfer.files;\n }\n }\n };\n\n return (\n <div {...fieldProps}>\n <FieldErrorCaptureContext>\n <PropsContextProvider props={propsContext}>\n <Aria.DropZone\n className={rootClassName}\n onDrop={onDropHandler}\n isDisabled={isDisabled}\n data-readonly={isReadOnly}\n >\n <IllustratedMessage color=\"dark\">{children}</IllustratedMessage>\n </Aria.DropZone>\n </PropsContextProvider>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </div>\n );\n },\n);\n\nexport default FileDropZone;\n"],"mappings":";;;;;;;;;;;;;;AA+BA,IAAa,eAAsC,cACjD,iBACC,UAAU;CACT,MAAM,EACJ,UACA,QACA,WACA,UAAU,kBACV,UACA,MACA,YACA,eACE;CAEJ,MAAM,EACJ,gBACA,0BACA,YACA,sBACE,kBAAkB,OAAO,cAAc;CAE3C,MAAM,eAAe,OAAyB,IAAI;CAClD,MAAM,gBAAgB,KACpB,4BAAO,cACP,cAAc,4BAAO,UACrB,SACF;CAEA,MAAM,eAA6B;EACjC,GAAG;EACH,oBAAoB;GAClB,WAAW;IACT;IACA,UAAU;IACV,KAAK;IACG;IACE;IACV,QAAQ;KAAE,SAAS;KAAW,OAAO;IAAO;IAC5C;IACA;GACF;GACA,SAAS,EACP,WAAW,4BAAO,QACpB;GACA,MAAM,EAAE,WAAW,4BAAO,KAAK;GAC/B,MAAM,EAAE,WAAW,4BAAO,KAAK;EACjC;CACF;CAEA,MAAM,gBAAgB,OAAO,UAAqB;EAChD,IAAI,YACF;EAGF,MAAM,QAAQ,MAAM,iBAAiB,MAAM,OAAO,MAAM;EAExD,IAAI,MAAM,SAAS,GAAG;GACpB,MAAM,eAAe,IAAI,aAAa;GACtC,KAAK,MAAM,QAAQ,WAAW,QAAQ,CAAC,MAAM,EAAE,GAC7C,IAAI,MACF,aAAa,MAAM,IAAI,IAAI;GAI/B,mBAAmB,aAAa,KAAK;GACrC,IAAI,aAAa,SACf,aAAa,QAAQ,QAAQ,aAAa;EAE9C;CACF;CAEA,OACE,qBAAC,OAAD;EAAK,GAAI;EAAT,UAAA,CACE,oBAAC,0BAAD,EAAA,UACE,oBAAC,sBAAD;GAAsB,OAAO;GAC3B,UAAA,oBAAC,KAAK,UAAN;IACE,WAAW;IACX,QAAQ;IACI;IACZ,iBAAe;IAEf,UAAA,oBAAC,oBAAD;KAAoB,OAAM;KAAQ;IAA6B,CAAA;GAClD,CAAA;EACK,CAAA,EACE,CAAA,GAC1B,oBAAC,gBAAD,CAAiB,CAAA,CACd;;AAET,CACF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
import { useContextIcon } from "../IconSetProvider.mjs";
|
|
4
|
+
import IconView$1 from "../../../../views/IconView.mjs";
|
|
5
|
+
import "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import { IconAIHosting } from "@mittwald/flow-icons";
|
|
8
|
+
//#region src/components/Icon/components/icons/IconAIHosting.tsx
|
|
9
|
+
var IconAIHosting$1 = (props) => {
|
|
10
|
+
const Icon = useContextIcon("AIHosting") ?? IconAIHosting;
|
|
11
|
+
return /* @__PURE__ */ jsx(IconView$1, {
|
|
12
|
+
...props,
|
|
13
|
+
children: /* @__PURE__ */ jsx(Icon, {})
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { IconAIHosting$1 as IconAIHosting, IconAIHosting$1 as default };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=IconAIHosting.mjs.map
|
package/dist/js/packages/components/src/components/Icon/components/icons/IconAIHosting.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconAIHosting.mjs","names":[],"sources":["../../../../../../../../../src/components/Icon/components/icons/IconAIHosting.tsx"],"sourcesContent":["/* auto-generated file */\nimport React, { type ComponentProps, type FC } from \"react\";\nimport { IconAIHosting as IconImport } from \"@mittwald/flow-icons\";\nimport { type Icon } from \"@/components/Icon\";\nimport View from \"@/views/IconView\";\nimport { useContextIcon } from \"../IconSetProvider\";\n\nexport const IconAIHosting: FC<\n Omit<ComponentProps<typeof Icon>, \"children\">\n> = (props) => {\n const fromContext = useContextIcon(\"AIHosting\");\n const Icon = fromContext ?? IconImport;\n return (\n <View {...props}>\n <Icon />\n </View>\n );\n};\n\nexport default IconAIHosting;\n"],"mappings":";;;;;;;;AAOA,IAAa,mBAER,UAAU;CAEb,MAAM,OADc,eAAe,WACtB,KAAe;CAC5B,OACE,oBAAC,YAAD;EAAM,GAAI;EACR,UAAA,oBAAC,MAAD,CAAO,CAAA;CACH,CAAA;AAEV"}
|
package/dist/js/packages/components/src/components/LightBox/components/LightBoxGallery/Controls.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
|
+
import { useLocalizedStringFormatter } from "../../../TranslationProvider/useLocalizedStringFormatter.mjs";
|
|
3
4
|
import LightBoxGallery_module_default from "./LightBoxGallery.module.mjs";
|
|
4
5
|
import __locale_default from "../../../../../../../_virtual/_20.locale.mjs";
|
|
5
6
|
import clsx from "clsx";
|
|
6
7
|
import { jsx } from "react/jsx-runtime";
|
|
7
|
-
import { useLocalizedStringFormatter } from "react-aria";
|
|
8
8
|
//#region src/components/LightBox/components/LightBoxGallery/Controls.tsx
|
|
9
9
|
var Controls = (props) => {
|
|
10
10
|
const { count, currentIndex } = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Controls.mjs","names":[],"sources":["../../../../../../../../../src/components/LightBox/components/LightBoxGallery/Controls.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport styles from \"@/components/LightBox/components/LightBoxGallery/LightBoxGallery.module.scss\";\nimport clsx from \"clsx\";\nimport { useLocalizedStringFormatter } from \"
|
|
1
|
+
{"version":3,"file":"Controls.mjs","names":[],"sources":["../../../../../../../../../src/components/LightBox/components/LightBoxGallery/Controls.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport styles from \"@/components/LightBox/components/LightBoxGallery/LightBoxGallery.module.scss\";\nimport clsx from \"clsx\";\n/*\n * Flow's own formatter, not react-aria's: the indicator's message takes\n * variables, and only this one runs them through IntlMessageFormat –\n * react-aria's hands back the raw \"{current} of {count}\".\n */\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport locales from \"../../locales/*.locale.json\";\n\ninterface Props {\n count: number;\n currentIndex: number;\n}\n\nexport const Controls: FC<Props> = (props) => {\n const { count, currentIndex } = props;\n\n const stringFormatter = useLocalizedStringFormatter(locales, \"LightBox\");\n\n const indicators = Array(count)\n .fill(\"\")\n .map((_, index) => (\n <span\n key={index}\n className={clsx(\n styles.indicator,\n currentIndex === index && styles.current,\n )}\n />\n ));\n\n return (\n <div\n className={styles.indicators}\n aria-label={stringFormatter.format(\"indicator\", {\n current: currentIndex + 1,\n count,\n })}\n >\n {indicators}\n </div>\n );\n};\n"],"mappings":";;;;;;;;AAgBA,IAAa,YAAuB,UAAU;CAC5C,MAAM,EAAE,OAAO,iBAAiB;CAEhC,MAAM,kBAAkB,4BAA4B,kBAAS,UAAU;CAEvE,MAAM,aAAa,MAAM,KAAK,CAAC,CAC5B,KAAK,EAAE,CAAC,CACR,KAAK,GAAG,UACP,oBAAC,QAAD,EAEE,WAAW,KACT,+BAAO,WACP,iBAAiB,SAAS,+BAAO,OACnC,EACD,GALM,KAKN,CACF;CAEH,OACE,oBAAC,OAAD;EACE,WAAW,+BAAO;EAClB,cAAY,gBAAgB,OAAO,aAAa;GAC9C,SAAS,eAAe;GACxB;EACF,CAAC;EAEA,UAAA;CACE,CAAA;AAET"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.module.mjs","names":[],"sources":["../../../../../../../src/components/List/List.module.scss"],"sourcesContent":[".list {\n display: flex;\n flex-direction: column;\n row-gap: var(--list--block-to-block-spacing);\n
|
|
1
|
+
{"version":3,"file":"List.module.mjs","names":[],"sources":["../../../../../../../src/components/List/List.module.scss"],"sourcesContent":[".list {\n display: flex;\n flex-direction: column;\n row-gap: var(--list--block-to-block-spacing);\n min-width: 0;\n\n :has(:global(.flow--list--list-summary--top)) {\n :global(.flow--list--items),\n :global(.flow--list--table) {\n border-start-start-radius: 0;\n border-start-end-radius: 0;\n }\n }\n\n :has(:global(.flow--list--list-summary--bottom)) {\n :global(.flow--list--items),\n :global(.flow--list--table) {\n border-end-start-radius: 0;\n border-end-end-radius: 0;\n }\n }\n\n .listWrapper {\n display: flex;\n flex-direction: column;\n\n .hideVisuallyEmptyView {\n display: none;\n }\n }\n}\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItemView.module.mjs","names":[],"sources":["../../../../../../../../../src/components/List/components/ListItemView/ListItemView.module.scss"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"ListItemView.module.mjs","names":[],"sources":["../../../../../../../../../src/components/List/components/ListItemView/ListItemView.module.scss"],"sourcesContent":[".view {\n display: flex;\n flex-direction: column;\n\n .checkboxContainer {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n\n &:empty {\n display: none;\n }\n }\n\n .content {\n min-width: 0;\n display: flex;\n gap: var(--list-item--spacing);\n flex-grow: 1;\n flex-wrap: wrap;\n }\n\n .topContent {\n overflow-wrap: anywhere;\n display: flex;\n }\n\n .bottomContent {\n width: 100%;\n overflow-wrap: anywhere;\n display: flex;\n flex-direction: column;\n }\n\n .heading {\n color: var(--text--color--default);\n overflow-wrap: anywhere;\n }\n\n .header {\n overflow-wrap: anywhere;\n display: flex;\n gap: var(--list-item--avatar-to-title-spacing);\n max-width: 100%;\n }\n\n .subTitle {\n font-size: var(--list-item--subtitle-font-size);\n\n .text:not(:last-child)::after {\n content: \"–\";\n display: inline-block;\n margin: 0 var(--size-rem--s);\n }\n }\n\n .badge {\n max-width: 100%;\n }\n\n &.listView {\n padding: var(--list-item--padding);\n gap: var(--list-item--spacing);\n\n .columnLayout {\n flex-grow: 1;\n\n > div {\n flex-grow: 1;\n align-items: center;\n }\n }\n\n .contentWrapper {\n display: flex;\n gap: var(--list-item--spacing);\n justify-content: space-between;\n flex-grow: 1;\n align-items: flex-start;\n }\n\n .content {\n align-items: center;\n align-self: center;\n max-width: 100%;\n }\n\n .title {\n max-width: 100%;\n min-width: 0;\n }\n\n .action {\n margin-inline-start: auto;\n\n button {\n margin-inline-end: 0;\n }\n }\n\n .header {\n order: 0;\n flex-grow: 1;\n align-items: center;\n\n &:empty,\n .subTitle:empty {\n display: none;\n }\n\n .avatar,\n .checkboxContainer {\n align-self: start;\n }\n\n .checkboxContainer {\n height: var(--avatar--size--m);\n }\n }\n\n &:has(.subTitle:not(:empty)) {\n .action,\n .avatar,\n .checkboxContainer {\n margin-top: var(--size-px--xxs);\n }\n }\n\n .topContent {\n order: 1;\n }\n\n :global(.flow--heading--heading-content) {\n max-width: 100%;\n }\n }\n\n &.tileView {\n gap: var(--list-item--padding);\n border-color: var(--list-item--border-color);\n border-width: var(--list-item--border-width);\n border-style: var(--list-item--border-style);\n border-radius: var(--list-item--corner-radius);\n align-content: flex-start;\n height: 100%;\n position: relative;\n overflow: hidden;\n\n .content {\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n padding-inline: var(--list-item--padding);\n padding-bottom: var(--list-item--padding);\n width: 100%;\n }\n\n .avatarContainer {\n width: 100%;\n border-bottom: var(--list-item--border-width)\n var(--list-item--border-style) var(--list-item--border-color);\n aspect-ratio: 16 / 9;\n\n img {\n overflow-clip-margin: unset;\n aspect-ratio: 16 / 9;\n }\n }\n\n .avatar {\n width: 100%;\n height: 100%;\n border-radius: 0;\n\n :global(.flow--avatar--icon) {\n width: var(--size-px--xxl);\n height: var(--size-px--xxl);\n }\n\n :global(.flow--avatar--initials) {\n font-size: var(--size-px--xxl);\n }\n }\n\n .checkboxContainer {\n position: absolute;\n top: var(--list-item--padding);\n inset-inline-start: var(--list-item--padding);\n background-color: var(--list-item--checkbox-background-color);\n border-radius: var(--list-item--checkbox-corner-radius);\n\n :global(.flow--checkbox .flow--checkbox--icon) {\n color: var(--list-item--checkbox-color);\n padding: var(--size-px--xxxs);\n }\n }\n\n .title {\n width: 100%;\n min-width: 0;\n\n :global(.flow--heading--heading-content) {\n position: absolute;\n top: var(--list-item--padding);\n inset-inline: var(--list-item--padding);\n justify-content: end;\n }\n }\n\n &:has(.checkboxContainer:not(:empty)) {\n :global(.flow--heading--heading-content) {\n inset-inline-start: calc(var(--list-item--padding) * 2 + var(--icon--size--m));\n }\n }\n\n .topContent,\n .header {\n width: 100%;\n }\n\n .action {\n align-self: start;\n }\n\n .bottomContent {\n margin-top: auto;\n }\n }\n}\n"],"mappings":""}
|