@mittwald/flow-react-components 1.3.0-next.3 → 1.3.0-next.30
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 +56 -1
- package/MIGRATION.md +24 -0
- package/USAGE.md +14 -6
- 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/_24.locale.mjs +10 -2
- package/dist/js/_virtual/_28.locale.mjs +10 -0
- package/dist/js/packages/components/src/components/Accordion/Accordion.mjs +26 -15
- package/dist/js/packages/components/src/components/Accordion/Accordion.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Avatar/Avatar.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Calendar/Calendar.module.mjs +3 -1
- package/dist/js/packages/components/src/components/Calendar/Calendar.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Calendar/components/CalendarHeader/CalendarHeader.mjs +19 -15
- package/dist/js/packages/components/src/components/Calendar/components/CalendarHeader/CalendarHeader.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/CartesianChart.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CartesianChart/components/Area/Area.mjs +7 -2
- 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 +15 -3
- package/dist/js/packages/components/src/components/CartesianChart/components/Bar/Bar.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CartesianChart/components/Line/Line.mjs +4 -1
- package/dist/js/packages/components/src/components/CartesianChart/components/Line/Line.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/useChartAnimation.mjs +27 -0
- package/dist/js/packages/components/src/components/CartesianChart/hooks/useChartAnimation.mjs.map +1 -0
- 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/Chat/Chat.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CheckboxGroup/CheckboxGroup.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CodeBlock/CodeBlock.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CodeBlock/CodeBlock.module.mjs.map +1 -1
- 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/ComboBox/ComboBox.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ContextMenu/ContextMenu.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CopyButton/CopyButton.mjs +4 -3
- package/dist/js/packages/components/src/components/CopyButton/CopyButton.mjs.map +1 -1
- package/dist/js/packages/components/src/components/DateRangePicker/components/DateRangeInput/DateRangeInput.mjs +14 -11
- package/dist/js/packages/components/src/components/DateRangePicker/components/DateRangeInput/DateRangeInput.mjs.map +1 -1
- package/dist/js/packages/components/src/components/DateRangePicker/components/DateRangeInput/DateRangeInput.module.mjs +4 -2
- package/dist/js/packages/components/src/components/DateRangePicker/components/DateRangeInput/DateRangeInput.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/DonutChart/DonutChart.module.mjs +6 -3
- package/dist/js/packages/components/src/components/DonutChart/DonutChart.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/DonutChart/components/DonutChartFill.mjs +13 -2
- package/dist/js/packages/components/src/components/DonutChart/components/DonutChartFill.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/HeaderNavigation/HeaderNavigation.mjs +9 -6
- package/dist/js/packages/components/src/components/HeaderNavigation/HeaderNavigation.mjs.map +1 -1
- package/dist/js/packages/components/src/components/HeaderNavigation/HeaderNavigation.module.mjs +5 -1
- package/dist/js/packages/components/src/components/HeaderNavigation/HeaderNavigation.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Heading/Heading.mjs +1 -1
- package/dist/js/packages/components/src/components/Heading/Heading.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Heading/Heading.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Image/Image.mjs +2 -2
- package/dist/js/packages/components/src/components/Image/Image.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Image/Image.module.mjs +3 -1
- package/dist/js/packages/components/src/components/Image/Image.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/LayoutCard/LayoutCard.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/LightBox/LightBox.module.mjs.map +1 -1
- 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/Header/components/SearchField/SearchField.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Items/Items.mjs +3 -6
- package/dist/js/packages/components/src/components/List/components/Items/Items.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Items/components/Item/Item.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/List/components/Table/Table.mjs +6 -2
- package/dist/js/packages/components/src/components/List/components/Table/Table.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/{components/Items/hooks → hooks}/useInfiniteScrollTrigger.mjs +11 -12
- package/dist/js/packages/components/src/components/List/hooks/useInfiniteScrollTrigger.mjs.map +1 -0
- package/dist/js/packages/components/src/components/Markdown/Markdown.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/MarkdownEditor/MarkdownEditor.mjs +16 -3
- package/dist/js/packages/components/src/components/MarkdownEditor/MarkdownEditor.mjs.map +1 -1
- package/dist/js/packages/components/src/components/MarkdownEditor/MarkdownEditor.module.mjs +4 -2
- package/dist/js/packages/components/src/components/MarkdownEditor/MarkdownEditor.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/MarkdownEditor/components/AttachmentButton.mjs +47 -0
- package/dist/js/packages/components/src/components/MarkdownEditor/components/AttachmentButton.mjs.map +1 -0
- package/dist/js/packages/components/src/components/MarkdownEditor/components/Toolbar.mjs +21 -20
- package/dist/js/packages/components/src/components/MarkdownEditor/components/Toolbar.mjs.map +1 -1
- package/dist/js/packages/components/src/components/MarkdownEditor/components/ToolbarButton.mjs +1 -1
- package/dist/js/packages/components/src/components/MarkdownEditor/components/ToolbarButton.mjs.map +1 -1
- package/dist/js/packages/components/src/components/MarkdownEditor/lib/fileUpload.mjs +73 -0
- package/dist/js/packages/components/src/components/MarkdownEditor/lib/fileUpload.mjs.map +1 -0
- package/dist/js/packages/components/src/components/MarkdownEditor/lib/useFileUpload.mjs +141 -0
- package/dist/js/packages/components/src/components/MarkdownEditor/lib/useFileUpload.mjs.map +1 -0
- package/dist/js/packages/components/src/components/MessageThread/MessageThread.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Modal/Modal.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Navigation/Navigation.module.mjs +3 -1
- package/dist/js/packages/components/src/components/Navigation/Navigation.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Navigation/components/LinkListTunnelExit/LinkListTunnelExit.mjs +5 -1
- package/dist/js/packages/components/src/components/Navigation/components/LinkListTunnelExit/LinkListTunnelExit.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Navigation/components/NavigationGroup/NavigationGroup.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/NumberField/NumberField.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Overlay/Overlay.module.mjs +3 -1
- package/dist/js/packages/components/src/components/Overlay/Overlay.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Overlay/components/OverlayContent.mjs +47 -9
- 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/Popover.module.mjs +3 -1
- package/dist/js/packages/components/src/components/Popover/Popover.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Popover/components/NonModalPopoverContent/NonModalPopoverContent.mjs +20 -11
- package/dist/js/packages/components/src/components/Popover/components/NonModalPopoverContent/NonModalPopoverContent.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Popover/components/PopoverContent/PopoverContent.mjs +1 -0
- package/dist/js/packages/components/src/components/Popover/components/PopoverContent/PopoverContent.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ProgressBar/ProgressBar.module.mjs +1 -0
- package/dist/js/packages/components/src/components/ProgressBar/ProgressBar.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/SearchField/SearchField.module.mjs +3 -3
- package/dist/js/packages/components/src/components/SearchField/SearchField.module.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/Section/components/SectionHeader/SectionHeader.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Slider/Slider.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/TabNavigation/TabNavigation.mjs +2 -1
- package/dist/js/packages/components/src/components/TabNavigation/TabNavigation.mjs.map +1 -1
- package/dist/js/packages/components/src/components/TabNavigation/TabNavigation.module.mjs +5 -1
- package/dist/js/packages/components/src/components/TabNavigation/TabNavigation.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Table/Table.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Tabs/components/TabTitle/TabTitle.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Text/Text.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.mjs +1 -0
- package/dist/js/packages/components/src/components/Tooltip/Tooltip.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Tooltip/Tooltip.module.mjs +3 -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/js/packages/design-tokens/dist/json-runtime/all-dark.mjs +13 -1
- package/dist/js/packages/design-tokens/dist/json-runtime/all-dark.mjs.map +1 -1
- package/dist/js/packages/design-tokens/dist/json-runtime/all-light.mjs +13 -1
- package/dist/js/packages/design-tokens/dist/json-runtime/all-light.mjs.map +1 -1
- package/dist/types/components/CartesianChart/context.d.ts +6 -0
- package/dist/types/components/CartesianChart/hooks/useChartAnimation.d.ts +1 -0
- package/dist/types/components/CartesianChart/hooks/useScopedStackId.d.ts +6 -0
- package/dist/types/components/CopyButton/CopyButton.d.ts +5 -0
- package/dist/types/components/Image/Image.d.ts +7 -1
- package/dist/types/components/List/hooks/useInfiniteScrollTrigger.d.ts +17 -0
- package/dist/types/components/MarkdownEditor/MarkdownEditor.d.ts +20 -0
- package/dist/types/components/MarkdownEditor/components/AttachmentButton.d.ts +1 -0
- package/dist/types/components/MarkdownEditor/components/Toolbar.d.ts +11 -2
- package/dist/types/components/MarkdownEditor/components/ToolbarButton.d.ts +8 -2
- package/dist/types/components/MarkdownEditor/index.d.ts +1 -1
- package/dist/types/components/MarkdownEditor/lib/fileUpload.d.ts +19 -0
- package/dist/types/components/MarkdownEditor/lib/useFileUpload.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/dist/types/lib/theming/hooks/useDesignTokens.d.ts +14 -0
- package/package.json +10 -10
- package/dist/js/packages/components/src/components/List/components/Items/hooks/useInfiniteScrollTrigger.mjs.map +0 -1
- package/dist/types/components/List/components/Items/hooks/useInfiniteScrollTrigger.d.ts +0 -3
|
@@ -5,6 +5,7 @@ var __locale_default = {
|
|
|
5
5
|
"de-DE": {
|
|
6
6
|
"mode.editor": "Vorschau beenden",
|
|
7
7
|
"mode.preview": "Vorschau",
|
|
8
|
+
"toolbar.attachment": "Datei anhängen",
|
|
8
9
|
"toolbar.bold": "Fett",
|
|
9
10
|
"toolbar.code": "Code",
|
|
10
11
|
"toolbar.italic": "Kursiv",
|
|
@@ -12,11 +13,15 @@ var __locale_default = {
|
|
|
12
13
|
"toolbar.orderedList": "Sortierte Liste",
|
|
13
14
|
"toolbar.quote": "Zitat",
|
|
14
15
|
"toolbar.strikeThrough": "Durchgestrichen",
|
|
15
|
-
"toolbar.unorderedList": "Liste"
|
|
16
|
+
"toolbar.unorderedList": "Liste",
|
|
17
|
+
"upload.failed": "{name} konnte nicht hochgeladen werden",
|
|
18
|
+
"upload.pending": "{name} wird hochgeladen",
|
|
19
|
+
"upload.succeeded": "{name} wurde hochgeladen"
|
|
16
20
|
},
|
|
17
21
|
"en-US": {
|
|
18
22
|
"mode.editor": "Exit Preview",
|
|
19
23
|
"mode.preview": "Preview",
|
|
24
|
+
"toolbar.attachment": "Attach file",
|
|
20
25
|
"toolbar.bold": "Bold",
|
|
21
26
|
"toolbar.code": "Code",
|
|
22
27
|
"toolbar.italic": "Italic",
|
|
@@ -24,7 +29,10 @@ var __locale_default = {
|
|
|
24
29
|
"toolbar.orderedList": "Ordered List",
|
|
25
30
|
"toolbar.quote": "Quote",
|
|
26
31
|
"toolbar.strikeThrough": "Strike through",
|
|
27
|
-
"toolbar.unorderedList": "List"
|
|
32
|
+
"toolbar.unorderedList": "List",
|
|
33
|
+
"upload.failed": "Could not upload {name}",
|
|
34
|
+
"upload.pending": "Uploading {name}",
|
|
35
|
+
"upload.succeeded": "Uploaded {name}"
|
|
28
36
|
}
|
|
29
37
|
};
|
|
30
38
|
//#endregion
|
|
@@ -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",
|
|
@@ -9,9 +9,22 @@ 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, id, contentId, isExpanded, onToggle } = props;
|
|
17
|
+
return /* @__PURE__ */ jsxs(Button, {
|
|
18
|
+
tunnel: null,
|
|
19
|
+
unstyled: true,
|
|
20
|
+
id,
|
|
21
|
+
"aria-expanded": isExpanded,
|
|
22
|
+
className: Accordion_module_default.headerButton,
|
|
23
|
+
onPress: onToggle,
|
|
24
|
+
"aria-controls": contentId,
|
|
25
|
+
children: [children, /* @__PURE__ */ jsx(IconChevronDown, { className: Accordion_module_default.chevron })]
|
|
26
|
+
});
|
|
27
|
+
};
|
|
15
28
|
/**
|
|
16
29
|
* @flr-generate all
|
|
17
30
|
* @flowStatus beta
|
|
@@ -22,18 +35,14 @@ var Accordion = flowComponent("Accordion", (props) => {
|
|
|
22
35
|
const rootClassName = clsx(Accordion_module_default.accordion, expanded && Accordion_module_default.expanded, variant === "outline" && Accordion_module_default.outline, className);
|
|
23
36
|
const headerId = useId();
|
|
24
37
|
const contentId = useId();
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"aria-controls": contentId,
|
|
34
|
-
children: [children, /* @__PURE__ */ jsx(IconChevronDown, { className: Accordion_module_default.chevron })]
|
|
35
|
-
});
|
|
36
|
-
};
|
|
38
|
+
const toggle = useCallback(() => setExpanded((expanded) => !expanded), []);
|
|
39
|
+
const renderHeaderButton = (children) => /* @__PURE__ */ jsx(HeaderButton, {
|
|
40
|
+
id: headerId,
|
|
41
|
+
contentId,
|
|
42
|
+
isExpanded: expanded,
|
|
43
|
+
onToggle: toggle,
|
|
44
|
+
children
|
|
45
|
+
});
|
|
37
46
|
const propsContext = {
|
|
38
47
|
Content: {
|
|
39
48
|
className: Accordion_module_default.contentInner,
|
|
@@ -46,18 +55,20 @@ var Accordion = flowComponent("Accordion", (props) => {
|
|
|
46
55
|
className: Accordion_module_default.header,
|
|
47
56
|
level: 4,
|
|
48
57
|
size: "xs",
|
|
49
|
-
children: dynamic((props) =>
|
|
58
|
+
children: dynamic((props) => renderHeaderButton(props.children)),
|
|
50
59
|
Button: { size: "m" }
|
|
51
60
|
},
|
|
52
61
|
Label: {
|
|
53
62
|
className: Accordion_module_default.header,
|
|
54
|
-
|
|
63
|
+
elementType: "span",
|
|
64
|
+
children: dynamic((props) => renderHeaderButton(props.children))
|
|
55
65
|
}
|
|
56
66
|
};
|
|
57
67
|
return /* @__PURE__ */ jsx("div", {
|
|
58
68
|
...rest,
|
|
59
69
|
className: rootClassName,
|
|
60
70
|
children: /* @__PURE__ */ jsxs(PropsContextProvider, {
|
|
71
|
+
dependencies: [expanded],
|
|
61
72
|
props: propsContext,
|
|
62
73
|
children: [children, /* @__PURE__ */ jsx("div", {
|
|
63
74
|
"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 id: string;\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, id, contentId, isExpanded, onToggle } = props;\n\n return (\n <Button\n tunnel={null}\n unstyled\n id={id}\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 id={headerId}\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 /*\n * A <label> names the first labelable element below it — here the\n * toggle, whose own text is the label's only content. The name\n * computation walks into the label, meets the button it started from\n * and stops, so the toggle ends up with an empty name. A <span> names\n * nothing and the name comes from the toggle's content again.\n */\n elementType: \"span\",\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 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":";;;;;;;;;;;;;;AAiCA,IAAM,gBAAuC,UAAU;CACrD,MAAM,EAAE,UAAU,IAAI,WAAW,YAAY,aAAa;CAE1D,OACE,qBAAC,QAAD;EACE,QAAQ;EACR,UAAA;EACI;EACJ,iBAAe;EACf,WAAW,yBAAO;EAClB,SAAS;EACT,iBAAe;EAPjB,UAAA,CASG,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;EACE,IAAI;EACO;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;GAQlB,aAAa;GACb,UAAU,SAAS,UAAU,mBAAmB,MAAM,QAAQ,CAAC;EACjE;CACF;CAEA,OACE,oBAAC,OAAD;EAAK,GAAI;EAAM,WAAW;EAMxB,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.module.mjs","names":[],"sources":["../../../../../../../src/components/Avatar/Avatar.module.scss"],"sourcesContent":[".avatar {\n border-radius: var(--corner-radius--round);\n width: var(--avatar-size);\n height: var(--avatar-size);\n overflow: hidden;\n flex-shrink: 0;\n font-weight: var(--font-weight--bold);\n font-size: calc(var(--avatar-size) * 0.35);\n background-color: var(--background-color);\n color: var(--content-color);\n display: flex;\n align-items: center;\n justify-content: center;\n\n /* Elements */\n\n img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n .icon {\n width: calc(var(--avatar-size) * 0.7);\n height: calc(var(--avatar-size) * 0.7);\n }\n\n .initials {\n font-size: calc(var(--avatar-size) * 0.4);\n }\n\n @extend .size-m;\n @extend .blue;\n\n /* Sizes */\n\n @mixin size($size) {\n &.size-#{$size} {\n --avatar-size: var(--avatar--size--#{$size});\n }\n }\n\n @include size(m);\n @include size(xs);\n @include size(s);\n @include size(l);\n\n /* Colors */\n\n @mixin color($color) {\n &:has(.initials[data-dynamic-color=\"#{$color}\"]),\n &.#{$color} {\n --background-color: var(--decorative--#{$color}-background-color);\n --content-color: var(--decorative--#{$color}-content-color);\n --content-accent-color: var(--decorative--#{$color}-content-accent-color);\n }\n }\n\n @include color(\"blue\");\n @include color(\"teal\");\n @include color(\"green\");\n @include color(\"violet\");\n @include color(\"lilac\");\n\n /* Status */\n\n @mixin status($status) {\n &.#{$status} {\n --background-color: var(--avatar--#{$status}-status-background-color);\n }\n }\n\n @include status(\"info\");\n @include status(\"success\");\n @include status(\"warning\");\n @include status(\"danger\");\n @include status(\"unavailable\");\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"Avatar.module.mjs","names":[],"sources":["../../../../../../../src/components/Avatar/Avatar.module.scss"],"sourcesContent":[".avatar {\n border-radius: var(--corner-radius--round);\n width: var(--avatar-size);\n height: var(--avatar-size);\n overflow: hidden;\n flex-shrink: 0;\n font-weight: var(--font-weight--bold);\n font-size: calc(var(--avatar-size) * 0.35);\n background-color: var(--background-color);\n color: var(--content-color);\n display: flex;\n align-items: center;\n justify-content: center;\n\n /* Elements */\n\n // The image is a child the consumer passes — Flow `Image` or a bare `<img>`.\n // stylelint-disable-next-line selector-max-type -- bare `<img>` has no class\n img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n .icon {\n width: calc(var(--avatar-size) * 0.7);\n height: calc(var(--avatar-size) * 0.7);\n }\n\n .initials {\n font-size: calc(var(--avatar-size) * 0.4);\n }\n\n @extend .size-m;\n @extend .blue;\n\n /* Sizes */\n\n @mixin size($size) {\n &.size-#{$size} {\n --avatar-size: var(--avatar--size--#{$size});\n }\n }\n\n @include size(m);\n @include size(xs);\n @include size(s);\n @include size(l);\n\n /* Colors */\n\n @mixin color($color) {\n &:has(.initials[data-dynamic-color=\"#{$color}\"]),\n &.#{$color} {\n --background-color: var(--decorative--#{$color}-background-color);\n --content-color: var(--decorative--#{$color}-content-color);\n --content-accent-color: var(--decorative--#{$color}-content-accent-color);\n }\n }\n\n @include color(\"blue\");\n @include color(\"teal\");\n @include color(\"green\");\n @include color(\"violet\");\n @include color(\"lilac\");\n\n /* Status */\n\n @mixin status($status) {\n &.#{$status} {\n --background-color: var(--avatar--#{$status}-status-background-color);\n }\n }\n\n @include status(\"info\");\n @include status(\"success\");\n @include status(\"warning\");\n @include status(\"danger\");\n @include status(\"unavailable\");\n}\n"],"mappings":""}
|
|
@@ -2,16 +2,18 @@
|
|
|
2
2
|
/* */
|
|
3
3
|
//#region src/components/Calendar/Calendar.module.scss
|
|
4
4
|
var calendar = "flow--calendar";
|
|
5
|
+
var calendarHeader = "flow--calendar--calendar-header";
|
|
5
6
|
var container = "flow--calendar--container";
|
|
6
7
|
var presetMenu = "flow--calendar--preset-menu";
|
|
7
8
|
var range = "flow--calendar--range";
|
|
8
9
|
var Calendar_module_default = {
|
|
9
10
|
calendar,
|
|
11
|
+
calendarHeader,
|
|
10
12
|
container,
|
|
11
13
|
presetMenu,
|
|
12
14
|
range
|
|
13
15
|
};
|
|
14
16
|
//#endregion
|
|
15
|
-
export { calendar, container, Calendar_module_default as default, presetMenu, range };
|
|
17
|
+
export { calendar, calendarHeader, container, Calendar_module_default as default, presetMenu, range };
|
|
16
18
|
|
|
17
19
|
//# sourceMappingURL=Calendar.module.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Calendar.module.mjs","names":[],"sources":["../../../../../../../src/components/Calendar/Calendar.module.scss"],"sourcesContent":["@use \"@/styles/mixins/focus\";\n\n.calendar {\n width: fit-content;\n\n
|
|
1
|
+
{"version":3,"file":"Calendar.module.mjs","names":[],"sources":["../../../../../../../src/components/Calendar/Calendar.module.scss"],"sourcesContent":["@use \"@/styles/mixins/focus\";\n\n.calendar {\n width: fit-content;\n\n .calendarHeader {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: var(--calendar--spacing);\n\n /* react-aria's Heading — CalendarHeader passes no className, so its\n default class is the handle. */\n :global(.react-aria-Heading) {\n font-size: var(--calendar--heading-font-size);\n }\n }\n\n .container {\n display: flex;\n flex-direction: row;\n gap: var(--popover--padding--m);\n\n .presetMenu {\n max-width: 200px;\n }\n }\n\n @media (max-width: 530px) {\n .container {\n flex-direction: column-reverse;\n }\n }\n\n :global(.react-aria-CalendarHeaderCell) {\n font-size: var(--calendar--cell-font-size);\n height: var(--calendar--cell-size);\n }\n\n :global(.react-aria-CalendarGrid) {\n border-spacing: var(--calendar--spacing);\n }\n\n :global(.react-aria-CalendarCell) {\n width: var(--calendar--cell-size);\n height: var(--calendar--cell-size);\n display: inline-flex;\n align-items: center;\n justify-content: center;\n cursor: default;\n border-radius: var(--calendar--cell-corner-radius);\n font-size: var(--calendar--cell-font-size);\n transition-property: background-color;\n transition-duration: var(--transition--duration--default);\n\n @include focus.focus;\n\n &[data-outside-month] {\n display: none;\n }\n\n &:hover {\n background: var(--calendar--cell-background-color--hover);\n }\n\n &[data-pressed] {\n background: var(--calendar--cell-background-color--pressed);\n }\n\n &[data-selected] {\n background: var(--calendar--cell-background-color--selected);\n color: var(--calendar--cell-content-color--selected);\n }\n\n &[data-disabled],\n &[data-unavailable=\"true\"] {\n background: var(--calendar--cell-background-color--disabled);\n color: var(--calendar--cell-content-color--disabled);\n }\n\n @include focus.focus;\n }\n\n &.range {\n :global(.react-aria-CalendarCell) {\n position: relative;\n isolation: isolate;\n transition-duration: 0s;\n\n &[data-selected] {\n &::before {\n content: \"\";\n background: var(--calendar--range-background-color);\n border-block: var(--calendar--range-border-width)\n var(--calendar--range-border-style)\n var(--calendar--range-border-color);\n width: calc(100% + 0.375rem);\n height: 100%;\n position: absolute;\n z-index: -1;\n }\n\n &::after {\n content: \"\";\n width: 100%;\n height: 100%;\n position: absolute;\n z-index: -1;\n border-radius: var(--calendar--cell-corner-radius);\n }\n\n &:hover {\n &::after {\n background: var(--calendar--cell-background-color--hover);\n }\n }\n\n &[data-pressed] {\n &::after {\n background: var(--calendar--cell-background-color--pressed);\n }\n }\n\n &[data-selection-start],\n &[data-selection-end] {\n &::after {\n background: var(--calendar--cell-background-color--selected);\n }\n }\n\n &[data-selection-start] {\n &::before {\n border-start-start-radius: var(--calendar--cell-corner-radius);\n border-end-start-radius: var(--calendar--cell-corner-radius);\n inset-inline-start: 0;\n }\n }\n\n &[data-selection-end] {\n &::before {\n border-start-end-radius: var(--calendar--cell-corner-radius);\n border-end-end-radius: var(--calendar--cell-corner-radius);\n inset-inline-end: 0;\n }\n }\n\n &:not([data-selection-start], [data-selection-end]) {\n color: var(--text--color--default);\n background: none;\n }\n\n &[data-selection-start][data-selection-end] {\n &::before {\n display: none;\n }\n }\n }\n }\n }\n}\n\n@media (max-width: 360px) {\n .calendar {\n --calendar--cell-size: 2.1rem;\n --calendar--cell-font-size: 0.8rem;\n }\n}\n"],"mappings":""}
|
|
@@ -3,25 +3,29 @@
|
|
|
3
3
|
import { IconChevronLeft } from "../../../Icon/components/icons/IconChevronLeft.mjs";
|
|
4
4
|
import { IconChevronRight } from "../../../Icon/components/icons/IconChevronRight.mjs";
|
|
5
5
|
import { Button } from "../../../Button/Button.mjs";
|
|
6
|
+
import Calendar_module_default from "../../Calendar.module.mjs";
|
|
6
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
8
|
import * as Aria from "react-aria-components";
|
|
8
9
|
//#region src/components/Calendar/components/CalendarHeader/CalendarHeader.tsx
|
|
9
10
|
var CalendarHeader = () => {
|
|
10
|
-
return /* @__PURE__ */ jsxs("header", {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
11
|
+
return /* @__PURE__ */ jsxs("header", {
|
|
12
|
+
className: Calendar_module_default.calendarHeader,
|
|
13
|
+
children: [
|
|
14
|
+
/* @__PURE__ */ jsx(Button, {
|
|
15
|
+
ariaSlot: "previous",
|
|
16
|
+
variant: "plain",
|
|
17
|
+
color: "secondary",
|
|
18
|
+
children: /* @__PURE__ */ jsx(IconChevronLeft, {})
|
|
19
|
+
}),
|
|
20
|
+
/* @__PURE__ */ jsx(Aria.Heading, {}),
|
|
21
|
+
/* @__PURE__ */ jsx(Button, {
|
|
22
|
+
ariaSlot: "next",
|
|
23
|
+
variant: "plain",
|
|
24
|
+
color: "secondary",
|
|
25
|
+
children: /* @__PURE__ */ jsx(IconChevronRight, {})
|
|
26
|
+
})
|
|
27
|
+
]
|
|
28
|
+
});
|
|
25
29
|
};
|
|
26
30
|
//#endregion
|
|
27
31
|
export { CalendarHeader, CalendarHeader as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CalendarHeader.mjs","names":[],"sources":["../../../../../../../../../src/components/Calendar/components/CalendarHeader/CalendarHeader.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport { Button } from \"@/components/Button\";\nimport * as Aria from \"react-aria-components\";\nimport {\n IconChevronLeft,\n IconChevronRight,\n} from \"@/components/Icon/components/icons\";\n\nexport const CalendarHeader: FC = () => {\n return (\n <header>\n <Button ariaSlot=\"previous\" variant=\"plain\" color=\"secondary\">\n <IconChevronLeft />\n </Button>\n <Aria.Heading />\n <Button ariaSlot=\"next\" variant=\"plain\" color=\"secondary\">\n <IconChevronRight />\n </Button>\n </header>\n );\n};\n\nexport default CalendarHeader;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"CalendarHeader.mjs","names":[],"sources":["../../../../../../../../../src/components/Calendar/components/CalendarHeader/CalendarHeader.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport { Button } from \"@/components/Button\";\nimport * as Aria from \"react-aria-components\";\nimport {\n IconChevronLeft,\n IconChevronRight,\n} from \"@/components/Icon/components/icons\";\nimport styles from \"../../Calendar.module.scss\";\n\nexport const CalendarHeader: FC = () => {\n return (\n <header className={styles.calendarHeader}>\n <Button ariaSlot=\"previous\" variant=\"plain\" color=\"secondary\">\n <IconChevronLeft />\n </Button>\n <Aria.Heading />\n <Button ariaSlot=\"next\" variant=\"plain\" color=\"secondary\">\n <IconChevronRight />\n </Button>\n </header>\n );\n};\n\nexport default CalendarHeader;\n"],"mappings":";;;;;;;;;AASA,IAAa,uBAA2B;CACtC,OACE,qBAAC,UAAD;EAAQ,WAAW,wBAAO;EAA1B,UAAA;GACE,oBAAC,QAAD;IAAQ,UAAS;IAAW,SAAQ;IAAQ,OAAM;IAChD,UAAA,oBAAC,iBAAD,CAAkB,CAAA;GACZ,CAAA;GACR,oBAAC,KAAK,SAAN,CAAe,CAAA;GACf,oBAAC,QAAD;IAAQ,UAAS;IAAO,SAAQ;IAAQ,OAAM;IAC5C,UAAA,oBAAC,kBAAD,CAAmB,CAAA;GACb,CAAA;EACF;;AAEZ"}
|
|
@@ -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"}
|
package/dist/js/packages/components/src/components/CartesianChart/CartesianChart.module.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CartesianChart.module.mjs","names":[],"sources":["../../../../../../../src/components/CartesianChart/CartesianChart.module.scss"],"sourcesContent":[".cartesianChart {\n font-family: Inter, sans-serif;\n isolation: isolate;\n\n *:focus:not(:focus-visible) {\n outline: none !important;\n }\n\n
|
|
1
|
+
{"version":3,"file":"CartesianChart.module.mjs","names":[],"sources":["../../../../../../../src/components/CartesianChart/CartesianChart.module.scss"],"sourcesContent":[".cartesianChart {\n font-family: Inter, sans-serif;\n isolation: isolate;\n\n *:focus:not(:focus-visible) {\n outline: none !important;\n }\n\n .emptyViewContainer {\n height: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n }\n\n &.emptyView {\n :global(.recharts-cartesian-grid) {\n display: none;\n }\n }\n\n // recharts renders every svg here; only its outermost surface is classed.\n // stylelint-disable-next-line selector-max-type -- third-party svgs\n svg {\n overflow: visible;\n }\n\n :global(.recharts-tooltip-wrapper) {\n z-index: 1;\n }\n}\n"],"mappings":""}
|
|
@@ -4,14 +4,18 @@ 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";
|
|
8
|
+
import { useChartAnimation } from "../../hooks/useChartAnimation.mjs";
|
|
7
9
|
import "react";
|
|
8
10
|
import { jsx } from "react/jsx-runtime";
|
|
9
11
|
import * as Recharts from "recharts";
|
|
10
12
|
//#region src/components/CartesianChart/components/Area/Area.tsx
|
|
11
13
|
/** @flr-generate all */
|
|
12
14
|
var Area = (props) => {
|
|
13
|
-
const { color: colorFromProps = "sea-green", stackId = 1, fillOpacity = 1, ...rest } = props;
|
|
15
|
+
const { color: colorFromProps = "sea-green", stackId: stackIdFromProps = 1, fillOpacity = 1, ...rest } = props;
|
|
14
16
|
const tokens = useDesignTokens();
|
|
17
|
+
const stackId = useScopedStackId(stackIdFromProps);
|
|
18
|
+
const animation = useChartAnimation();
|
|
15
19
|
const color = isCategoricalColor(colorFromProps) ? `var(--color--categorical--${colorFromProps})` : colorFromProps;
|
|
16
20
|
return /* @__PURE__ */ jsx(Recharts.Area, {
|
|
17
21
|
name: isDataKeyWithLabel(props) ? props.dataKeyLabel : props.dataKey,
|
|
@@ -21,7 +25,8 @@ var Area = (props) => {
|
|
|
21
25
|
activeDot: /* @__PURE__ */ jsx(AreaDot, { color }),
|
|
22
26
|
fill: color,
|
|
23
27
|
stroke: tokens.area["border-color"].value,
|
|
24
|
-
strokeWidth: tokens.area["border-width"].value
|
|
28
|
+
strokeWidth: tokens.area["border-width"].value,
|
|
29
|
+
...animation
|
|
25
30
|
});
|
|
26
31
|
};
|
|
27
32
|
var TypedArea = () => Area;
|
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 { useChartAnimation } from \"@/components/CartesianChart/hooks/useChartAnimation\";\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 const animation = useChartAnimation();\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 {...animation}\n />\n );\n};\n\nexport const TypedArea = <TData extends ChartDataValue = ChartDataValue>() =>\n Area as ComponentType<AreaPropsByDataKeyProp<TData>>;\n\nexport default Area;\n"],"mappings":";;;;;;;;;;;;;AA6CA,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;CACjD,MAAM,YAAY,kBAAkB;CAEpC,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;EACzC,GAAI;CACL,CAAA;AAEL;AAEA,IAAa,kBACX"}
|
|
@@ -4,6 +4,8 @@ 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";
|
|
8
|
+
import { useChartAnimation } from "../../hooks/useChartAnimation.mjs";
|
|
7
9
|
import "react";
|
|
8
10
|
import { jsx } from "react/jsx-runtime";
|
|
9
11
|
import * as Recharts from "recharts";
|
|
@@ -12,10 +14,12 @@ import * as Recharts from "recharts";
|
|
|
12
14
|
var Bar = (props) => {
|
|
13
15
|
const { color: colorFromProps = "sea-green", ...rest } = props;
|
|
14
16
|
const tokens = useDesignTokens();
|
|
17
|
+
const animation = useChartAnimation();
|
|
15
18
|
const { layout } = useCartesianChartContext();
|
|
19
|
+
const stackId = useScopedStackId(props.stackId);
|
|
16
20
|
const color = isCategoricalColor(colorFromProps) ? `var(--color--categorical--${colorFromProps})` : colorFromProps;
|
|
17
21
|
const cornerRadius = parseInt(tokens.bar["corner-radius"].value);
|
|
18
|
-
const radius =
|
|
22
|
+
const radius = layout === "vertical" ? [
|
|
19
23
|
0,
|
|
20
24
|
cornerRadius,
|
|
21
25
|
cornerRadius,
|
|
@@ -26,11 +30,19 @@ var Bar = (props) => {
|
|
|
26
30
|
0,
|
|
27
31
|
0
|
|
28
32
|
];
|
|
29
|
-
|
|
33
|
+
const bar = /* @__PURE__ */ jsx(Recharts.Bar, {
|
|
30
34
|
name: isDataKeyWithLabel(props) ? props.dataKeyLabel : props.dataKey,
|
|
31
35
|
...rest,
|
|
36
|
+
stackId,
|
|
32
37
|
fill: color,
|
|
33
|
-
radius
|
|
38
|
+
radius: stackId === void 0 ? radius : 0,
|
|
39
|
+
...animation
|
|
40
|
+
});
|
|
41
|
+
if (stackId === void 0) return bar;
|
|
42
|
+
return /* @__PURE__ */ jsx(Recharts.BarStack, {
|
|
43
|
+
stackId,
|
|
44
|
+
radius,
|
|
45
|
+
children: bar
|
|
34
46
|
});
|
|
35
47
|
};
|
|
36
48
|
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 { useChartAnimation } from \"@/components/CartesianChart/hooks/useChartAnimation\";\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 animation = useChartAnimation();\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 {...animation}\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":";;;;;;;;;;;;;AA8CA,IAAa,OAAqB,UAAU;CAC1C,MAAM,EAAE,OAAO,iBAAiB,aAAa,GAAG,SAAS;CAEzD,MAAM,SAAS,gBAAgB;CAC/B,MAAM,YAAY,kBAAkB;CACpC,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;EACzC,GAAI;CACL,CAAA;CAGH,IAAI,YAAY,KAAA,GACd,OAAO;CAMT,OACE,oBAAC,SAAS,UAAV;EAA4B;EAAiB;EAC1C,UAAA;CACgB,CAAA;AAEvB;AAEA,IAAa,iBACX"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { useDesignTokens } from "../../../../lib/theming/hooks/useDesignTokens.mjs";
|
|
4
4
|
import { AreaDot } from "../AreaDot/AreaDot.mjs";
|
|
5
5
|
import { isCategoricalColor } from "../../../../lib/tokens/isCategoricalColor.mjs";
|
|
6
|
+
import { useChartAnimation } from "../../hooks/useChartAnimation.mjs";
|
|
6
7
|
import "react";
|
|
7
8
|
import { jsx } from "react/jsx-runtime";
|
|
8
9
|
import * as Recharts from "recharts";
|
|
@@ -11,6 +12,7 @@ import * as Recharts from "recharts";
|
|
|
11
12
|
var Line = (props) => {
|
|
12
13
|
const { color: colorFromProps = "sea-green", ...rest } = props;
|
|
13
14
|
const tokens = useDesignTokens();
|
|
15
|
+
const animation = useChartAnimation();
|
|
14
16
|
const color = isCategoricalColor(colorFromProps) ? `var(--color--categorical--${colorFromProps})` : colorFromProps;
|
|
15
17
|
return /* @__PURE__ */ jsx(Recharts.Line, {
|
|
16
18
|
...rest,
|
|
@@ -18,7 +20,8 @@ var Line = (props) => {
|
|
|
18
20
|
activeDot: /* @__PURE__ */ jsx(AreaDot, { color }),
|
|
19
21
|
dot: false,
|
|
20
22
|
stroke: color,
|
|
21
|
-
strokeWidth: tokens.line["border-width"].value
|
|
23
|
+
strokeWidth: tokens.line["border-width"].value,
|
|
24
|
+
...animation
|
|
22
25
|
});
|
|
23
26
|
};
|
|
24
27
|
var TypedLine = () => Line;
|
package/dist/js/packages/components/src/components/CartesianChart/components/Line/Line.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Line.mjs","names":[],"sources":["../../../../../../../../../src/components/CartesianChart/components/Line/Line.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 type {\n ChartDataValue,\n DataKey,\n} from \"@/components/CartesianChart/types\";\nimport { useDesignTokens } from \"@/lib/theming\";\n\nexport interface LineProps<\n TData extends ChartDataValue = ChartDataValue,\n> extends Pick<\n Recharts.LineProps,\n \"className\" | \"key\" | \"xAxisId\" | \"yAxisId\" | \"type\" | \"unit\"\n> {\n dataKey?: DataKey<TData>;\n /** The color of the line. @default \"sea-green\" */\n color?: CategoricalWithCustomColor;\n}\n\n/** @flr-generate all */\nexport const Line: FC<LineProps> = (props) => {\n const { color: colorFromProps = \"sea-green\", ...rest } = props;\n\n const tokens = useDesignTokens();\n\n const color = isCategoricalColor(colorFromProps)\n ? `var(--color--categorical--${colorFromProps})`\n : colorFromProps;\n\n return (\n <Recharts.Line\n {...rest}\n fill={color}\n activeDot={<AreaDot color={color} />}\n dot={false}\n stroke={color}\n strokeWidth={tokens.line[\"border-width\"].value}\n />\n );\n};\n\nexport const TypedLine = <T extends ChartDataValue = ChartDataValue>() =>\n Line as ComponentType<LineProps<T>>;\n\nexport default Line;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Line.mjs","names":[],"sources":["../../../../../../../../../src/components/CartesianChart/components/Line/Line.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 type {\n ChartDataValue,\n DataKey,\n} from \"@/components/CartesianChart/types\";\nimport { useChartAnimation } from \"@/components/CartesianChart/hooks/useChartAnimation\";\nimport { useDesignTokens } from \"@/lib/theming\";\n\nexport interface LineProps<\n TData extends ChartDataValue = ChartDataValue,\n> extends Pick<\n Recharts.LineProps,\n \"className\" | \"key\" | \"xAxisId\" | \"yAxisId\" | \"type\" | \"unit\"\n> {\n dataKey?: DataKey<TData>;\n /** The color of the line. @default \"sea-green\" */\n color?: CategoricalWithCustomColor;\n}\n\n/** @flr-generate all */\nexport const Line: FC<LineProps> = (props) => {\n const { color: colorFromProps = \"sea-green\", ...rest } = props;\n\n const tokens = useDesignTokens();\n const animation = useChartAnimation();\n\n const color = isCategoricalColor(colorFromProps)\n ? `var(--color--categorical--${colorFromProps})`\n : colorFromProps;\n\n return (\n <Recharts.Line\n {...rest}\n fill={color}\n activeDot={<AreaDot color={color} />}\n dot={false}\n stroke={color}\n strokeWidth={tokens.line[\"border-width\"].value}\n {...animation}\n />\n );\n};\n\nexport const TypedLine = <T extends ChartDataValue = ChartDataValue>() =>\n Line as ComponentType<LineProps<T>>;\n\nexport default Line;\n"],"mappings":";;;;;;;;;;;AAwBA,IAAa,QAAuB,UAAU;CAC5C,MAAM,EAAE,OAAO,iBAAiB,aAAa,GAAG,SAAS;CAEzD,MAAM,SAAS,gBAAgB;CAC/B,MAAM,YAAY,kBAAkB;CAEpC,MAAM,QAAQ,mBAAmB,cAAc,IAC3C,6BAA6B,eAAe,KAC5C;CAEJ,OACE,oBAAC,SAAS,MAAV;EACE,GAAI;EACJ,MAAM;EACN,WAAW,oBAAC,SAAD,EAAgB,MAAQ,CAAA;EACnC,KAAK;EACL,QAAQ;EACR,aAAa,OAAO,KAAK,eAAe,CAAC;EACzC,GAAI;CACL,CAAA;AAEL;AAEA,IAAa,kBACX"}
|
|
@@ -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,27 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
import { useDesignTokens } from "../../../lib/theming/hooks/useDesignTokens.mjs";
|
|
4
|
+
import { useReducedMotion } from "framer-motion";
|
|
5
|
+
//#region src/components/CartesianChart/hooks/useChartAnimation.ts
|
|
6
|
+
/**
|
|
7
|
+
* Animation props for the chart's graphical items. Recharts animates on mount
|
|
8
|
+
* by default and does not look at the user's motion preference on its own.
|
|
9
|
+
*
|
|
10
|
+
* Replaces recharts' default `"auto"`, which means "not during SSR" – moot
|
|
11
|
+
* here, since `ResponsiveContainer` renders nothing on the server.
|
|
12
|
+
*
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
var useChartAnimation = () => {
|
|
16
|
+
const prefersReducedMotion = useReducedMotion();
|
|
17
|
+
const tokens = useDesignTokens();
|
|
18
|
+
return {
|
|
19
|
+
isAnimationActive: !prefersReducedMotion,
|
|
20
|
+
animationDuration: parseInt(tokens["cartesian-chart"]["transition-duration"].value),
|
|
21
|
+
animationEasing: "ease"
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
export { useChartAnimation };
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=useChartAnimation.mjs.map
|
package/dist/js/packages/components/src/components/CartesianChart/hooks/useChartAnimation.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useChartAnimation.mjs","names":[],"sources":["../../../../../../../../src/components/CartesianChart/hooks/useChartAnimation.ts"],"sourcesContent":["import { useReducedMotion } from \"framer-motion\";\nimport { useDesignTokens } from \"@/lib/theming\";\n\n/**\n * Animation props for the chart's graphical items. Recharts animates on mount\n * by default and does not look at the user's motion preference on its own.\n *\n * Replaces recharts' default `\"auto\"`, which means \"not during SSR\" – moot\n * here, since `ResponsiveContainer` renders nothing on the server.\n *\n * @internal\n */\nexport const useChartAnimation = () => {\n const prefersReducedMotion = useReducedMotion();\n const tokens = useDesignTokens();\n\n return {\n isAnimationActive: !prefersReducedMotion,\n animationDuration: parseInt(\n tokens[\"cartesian-chart\"][\"transition-duration\"].value,\n ),\n // Recharts' own default, pinned to match the CSS `ease` of the DonutChart\n // and the ProgressBar.\n animationEasing: \"ease\" as const,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;AAYA,IAAa,0BAA0B;CACrC,MAAM,uBAAuB,iBAAiB;CAC9C,MAAM,SAAS,gBAAgB;CAE/B,OAAO;EACL,mBAAmB,CAAC;EACpB,mBAAmB,SACjB,OAAO,kBAAkB,CAAC,sBAAsB,CAAC,KACnD;EAGA,iBAAiB;CACnB;AACF"}
|
|
@@ -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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chat.module.mjs","names":[],"sources":["../../../../../../../src/components/Chat/Chat.module.scss"],"sourcesContent":["@use \"@/styles/mixins/scrollbar\";\n\n.chat {\n display: flex;\n flex-direction: column;\n width: 100%;\n\n .messageThreadContainer {\n @include scrollbar.scrollbar;\n\n overflow: auto;\n padding-bottom: var(--chat--spacing);\n padding-inline-end: var(--size-px--m);\n margin-inline-end: calc(var(--size-px--m) * -1);\n flex-grow: 1;\n display: flex;\n flex-direction: column-reverse;\n }\n\n .fileCardList {\n margin-top: var(--chat--spacing);\n }\n\n .controls:not(:has(form)),\n .controls form {\n display: flex;\n align-items: flex-start;\n gap: var(--chat--spacing);\n flex-wrap: wrap;\n padding-top: var(--chat--spacing);\n\n > :first-child {\n order: 0;\n width: 100%;\n }\n\n .successButton,\n .button {\n order: 1;\n }\n\n .successButton {\n margin-inline-start: auto;\n }\n }\n}\n\n@media (max-width: 550px) {\n .successButton,\n .button {\n flex-grow: 1;\n }\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"Chat.module.mjs","names":[],"sources":["../../../../../../../src/components/Chat/Chat.module.scss"],"sourcesContent":["@use \"@/styles/mixins/scrollbar\";\n\n.chat {\n display: flex;\n flex-direction: column;\n width: 100%;\n\n .messageThreadContainer {\n @include scrollbar.scrollbar;\n\n overflow: auto;\n padding-bottom: var(--chat--spacing);\n padding-inline-end: var(--size-px--m);\n margin-inline-end: calc(var(--size-px--m) * -1);\n flex-grow: 1;\n display: flex;\n flex-direction: column-reverse;\n }\n\n .fileCardList {\n margin-top: var(--chat--spacing);\n }\n\n /* The `<form>` comes from the consumer wrapping the controls in the\n react-hook-form `Form` (or its own `formComponent`). `Form` is a plain FC,\n not a flowComponent, so Chat's props context cannot give it a class. */\n // stylelint-disable selector-max-type -- consumer-supplied form, no class\n .controls:not(:has(form)),\n .controls form {\n display: flex;\n align-items: flex-start;\n gap: var(--chat--spacing);\n flex-wrap: wrap;\n padding-top: var(--chat--spacing);\n\n > :first-child {\n order: 0;\n width: 100%;\n }\n\n .successButton,\n .button {\n order: 1;\n }\n\n .successButton {\n margin-inline-start: auto;\n }\n }\n // stylelint-enable selector-max-type\n}\n\n@media (max-width: 550px) {\n .successButton,\n .button {\n flex-grow: 1;\n }\n}\n"],"mappings":""}
|