@mittwald/flow-react-components 1.2.0-next.5 → 1.2.0-next.7
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/MIGRATION.md +5 -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/default.mjs +2 -1
- package/dist/js/packages/components/src/components/CartesianChart/CartesianChart.mjs +34 -26
- package/dist/js/packages/components/src/components/CartesianChart/CartesianChart.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CartesianChart/components/Bar/Bar.mjs +40 -0
- package/dist/js/packages/components/src/components/CartesianChart/components/Bar/Bar.mjs.map +1 -0
- package/dist/js/packages/components/src/components/CartesianChart/components/XAxis/XAxis.mjs +3 -1
- package/dist/js/packages/components/src/components/CartesianChart/components/XAxis/XAxis.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CartesianChart/components/YAxis/YAxis.mjs +2 -1
- package/dist/js/packages/components/src/components/CartesianChart/components/YAxis/YAxis.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CartesianChart/context.mjs +11 -0
- package/dist/js/packages/components/src/components/CartesianChart/context.mjs.map +1 -0
- package/dist/js/packages/components/src/components/CartesianChart/types.mjs.map +1 -1
- package/dist/js/packages/design-tokens/dist/json-runtime/all-dark.mjs +6 -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 +6 -1
- package/dist/js/packages/design-tokens/dist/json-runtime/all-light.mjs.map +1 -1
- package/dist/types/components/CartesianChart/CartesianChart.d.ts +12 -1
- package/dist/types/components/CartesianChart/CartesianChart.d.ts.map +1 -1
- package/dist/types/components/CartesianChart/components/Bar/Bar.d.ts +19 -0
- package/dist/types/components/CartesianChart/components/Bar/Bar.d.ts.map +1 -0
- package/dist/types/components/CartesianChart/components/Bar/index.d.ts +3 -0
- package/dist/types/components/CartesianChart/components/Bar/index.d.ts.map +1 -0
- package/dist/types/components/CartesianChart/components/Bar/view.d.ts +8 -0
- package/dist/types/components/CartesianChart/components/Bar/view.d.ts.map +1 -0
- package/dist/types/components/CartesianChart/components/XAxis/XAxis.d.ts.map +1 -1
- package/dist/types/components/CartesianChart/components/YAxis/YAxis.d.ts.map +1 -1
- package/dist/types/components/CartesianChart/context.d.ts +8 -0
- package/dist/types/components/CartesianChart/context.d.ts.map +1 -0
- package/dist/types/components/CartesianChart/index.d.ts +1 -0
- package/dist/types/components/CartesianChart/index.d.ts.map +1 -1
- package/dist/types/components/CartesianChart/stories/Default.stories.d.ts +4 -0
- package/dist/types/components/CartesianChart/stories/Default.stories.d.ts.map +1 -1
- package/dist/types/components/CartesianChart/types.d.ts +6 -0
- package/dist/types/components/CartesianChart/types.d.ts.map +1 -1
- package/dist/types/lib/theming/hooks/useDesignTokens.d.ts +6 -0
- package/dist/types/lib/theming/hooks/useDesignTokens.d.ts.map +1 -1
- package/dist/types/views/BarView.d.ts +5 -0
- package/dist/types/views/BarView.d.ts.map +1 -0
- package/package.json +9 -9
package/dist/js/default.mjs
CHANGED
|
@@ -195,6 +195,7 @@ import { isDateRangeValue } from "./packages/components/src/components/Calendar/
|
|
|
195
195
|
import { Div } from "./packages/components/src/components/Div/Div.mjs";
|
|
196
196
|
import { AreaDot } from "./packages/components/src/components/CartesianChart/components/AreaDot/AreaDot.mjs";
|
|
197
197
|
import { Area, TypedArea } from "./packages/components/src/components/CartesianChart/components/Area/Area.mjs";
|
|
198
|
+
import { Bar, TypedBar } from "./packages/components/src/components/CartesianChart/components/Bar/Bar.mjs";
|
|
198
199
|
import { TypedXAxis } from "./packages/components/src/components/CartesianChart/components/XAxis/types.mjs";
|
|
199
200
|
import { XAxis } from "./packages/components/src/components/CartesianChart/components/XAxis/XAxis.mjs";
|
|
200
201
|
import { TypedYAxis } from "./packages/components/src/components/CartesianChart/components/YAxis/types.mjs";
|
|
@@ -334,4 +335,4 @@ import { TextField } from "./packages/components/src/components/TextField/TextFi
|
|
|
334
335
|
import { TimeField } from "./packages/components/src/components/TimeField/TimeField.mjs";
|
|
335
336
|
import { Truncate } from "./packages/components/src/components/Truncate/Truncate.mjs";
|
|
336
337
|
import { TunnelEntry } from "./packages/components/src/components/TunnelEntry/TunnelEntry.mjs";
|
|
337
|
-
export { AbortActionError, AccentBox, Accordion, Action, ActionBatch, ActionGroup, Activity, Alert, AlertBadge, AlertIcon, AlertText, Align, Area, AreaDot, Autocomplete, Avatar, AvatarStack, Badge, BigNumber, Breadcrumb, BrowserOnly, Button, CartesianChart, CartesianGrid, ChartGrid, ChartLegend, ChartTooltip, Chat, Checkbox, CheckboxButton, CheckboxGroup, ClearPropsContext, 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, 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, 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 };
|
|
338
|
+
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, 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, 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 };
|
|
@@ -5,7 +5,9 @@ import { Wrap } from "../Wrap/Wrap.mjs";
|
|
|
5
5
|
import CartesianChart_module_default from "./CartesianChart.module.mjs";
|
|
6
6
|
import { useChartClipRect } from "./hooks/useChartClipRect.mjs";
|
|
7
7
|
import DivView from "../../views/DivView.mjs";
|
|
8
|
+
import { CartesianChartContextProvider } from "./context.mjs";
|
|
8
9
|
import { TypedArea } from "./components/Area/Area.mjs";
|
|
10
|
+
import { TypedBar } from "./components/Bar/Bar.mjs";
|
|
9
11
|
import { TypedXAxis } from "./components/XAxis/types.mjs";
|
|
10
12
|
import { TypedYAxis } from "./components/YAxis/types.mjs";
|
|
11
13
|
import { TypedChartGrid } from "./components/ChartGrid/ChartGrid.mjs";
|
|
@@ -19,7 +21,7 @@ import { ComposedChart, ResponsiveContainer } from "recharts";
|
|
|
19
21
|
//#region src/components/CartesianChart/CartesianChart.tsx
|
|
20
22
|
/** @flr-generate all */
|
|
21
23
|
var CartesianChart = (props) => {
|
|
22
|
-
const { children, data, className, height, flexGrow, emptyView, ...rest } = props;
|
|
24
|
+
const { children, data, className, height, flexGrow, emptyView, layout = "horizontal", ...rest } = props;
|
|
23
25
|
const warnDeprecation = useWarnDeprecation();
|
|
24
26
|
const { viewDimensions, ref: containerRef } = useChartClipRect();
|
|
25
27
|
const showEmptyView = !!((!data || data.length === 0) && emptyView);
|
|
@@ -30,32 +32,37 @@ var CartesianChart = (props) => {
|
|
|
30
32
|
if (!emptyView) return;
|
|
31
33
|
return null;
|
|
32
34
|
}, [emptyView]);
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
width: 1,
|
|
43
|
-
height: 1
|
|
35
|
+
const contextValue = useMemo(() => ({ layout }), [layout]);
|
|
36
|
+
return /* @__PURE__ */ jsx(CartesianChartContextProvider, {
|
|
37
|
+
value: contextValue,
|
|
38
|
+
children: /* @__PURE__ */ jsx(Wrap, {
|
|
39
|
+
if: height,
|
|
40
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
41
|
+
style: {
|
|
42
|
+
height,
|
|
43
|
+
flex: flexGrow ? 1 : void 0
|
|
44
44
|
},
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
45
|
+
children: /* @__PURE__ */ jsx(ResponsiveContainer, {
|
|
46
|
+
initialDimension: {
|
|
47
|
+
width: 1,
|
|
48
|
+
height: 1
|
|
49
|
+
},
|
|
50
|
+
width: height ? void 0 : "100%",
|
|
51
|
+
aspect: height ? void 0 : 3,
|
|
52
|
+
ref: containerRef,
|
|
53
|
+
children: /* @__PURE__ */ jsxs(ComposedChart, {
|
|
54
|
+
data,
|
|
55
|
+
className: rootClassName,
|
|
56
|
+
layout,
|
|
57
|
+
...rest,
|
|
58
|
+
children: [children, showEmptyView && viewDimensions && /* @__PURE__ */ jsx("foreignObject", {
|
|
59
|
+
...viewDimensions,
|
|
60
|
+
children: /* @__PURE__ */ jsx(DivView, {
|
|
61
|
+
className: CartesianChart_module_default.emptyViewContainer,
|
|
62
|
+
children: emptyElement
|
|
63
|
+
})
|
|
64
|
+
})]
|
|
65
|
+
})
|
|
59
66
|
})
|
|
60
67
|
})
|
|
61
68
|
})
|
|
@@ -64,6 +71,7 @@ var CartesianChart = (props) => {
|
|
|
64
71
|
var typedCartesianChart = () => ({
|
|
65
72
|
Chart: CartesianChart,
|
|
66
73
|
Area: TypedArea(),
|
|
74
|
+
Bar: TypedBar(),
|
|
67
75
|
XAxis: TypedXAxis(),
|
|
68
76
|
YAxis: TypedYAxis(),
|
|
69
77
|
Grid: TypedChartGrid(),
|
|
@@ -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 ChartDataValue,\n DataKeyProp,\n} from \"@/components/CartesianChart/types\";\nimport { TypedArea } from \"@/components/CartesianChart/components/Area\";\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 /** 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 {
|
|
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 }), [layout]);\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":";;;;;;;;;;;;;;;;;;;;;;AAuEA,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,eAAe,eAAe,EAAE,OAAO,IAAI,CAAC,MAAM,CAAC;CAEzD,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"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
import { useDesignTokens } from "../../../../lib/theming/hooks/useDesignTokens.mjs";
|
|
4
|
+
import { useCartesianChartContext } from "../../context.mjs";
|
|
5
|
+
import { isCategoricalColor } from "../../../../lib/tokens/isCategoricalColor.mjs";
|
|
6
|
+
import { isDataKeyWithLabel } from "../../types.mjs";
|
|
7
|
+
import "react";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
import * as Recharts from "recharts";
|
|
10
|
+
//#region src/components/CartesianChart/components/Bar/Bar.tsx
|
|
11
|
+
/** @flr-generate all */
|
|
12
|
+
var Bar = (props) => {
|
|
13
|
+
const { color: colorFromProps = "sea-green", ...rest } = props;
|
|
14
|
+
const tokens = useDesignTokens();
|
|
15
|
+
const { layout } = useCartesianChartContext();
|
|
16
|
+
const color = isCategoricalColor(colorFromProps) ? `var(--color--categorical--${colorFromProps})` : colorFromProps;
|
|
17
|
+
const cornerRadius = parseInt(tokens.bar["corner-radius"].value);
|
|
18
|
+
const radius = props.stackId !== void 0 ? 0 : layout === "vertical" ? [
|
|
19
|
+
0,
|
|
20
|
+
cornerRadius,
|
|
21
|
+
cornerRadius,
|
|
22
|
+
0
|
|
23
|
+
] : [
|
|
24
|
+
cornerRadius,
|
|
25
|
+
cornerRadius,
|
|
26
|
+
0,
|
|
27
|
+
0
|
|
28
|
+
];
|
|
29
|
+
return /* @__PURE__ */ jsx(Recharts.Bar, {
|
|
30
|
+
name: isDataKeyWithLabel(props) ? props.dataKeyLabel : props.dataKey,
|
|
31
|
+
...rest,
|
|
32
|
+
fill: color,
|
|
33
|
+
radius
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
var TypedBar = () => Bar;
|
|
37
|
+
//#endregion
|
|
38
|
+
export { Bar, Bar as default, TypedBar };
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=Bar.mjs.map
|
|
@@ -0,0 +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 props.stackId !== undefined\n ? 0\n : layout === \"vertical\"\n ? [0, cornerRadius, cornerRadius, 0]\n : [cornerRadius, cornerRadius, 0, 0];\n\n return (\n <Recharts.Bar\n name={isDataKeyWithLabel(props) ? props.dataKeyLabel : props.dataKey}\n {...rest}\n fill={color}\n radius={radius}\n />\n );\n};\n\nexport const TypedBar = <TData extends ChartDataValue = ChartDataValue>() =>\n Bar as ComponentType<BarPropsByDataKeyProp<TData>>;\n\nexport default Bar;\n"],"mappings":";;;;;;;;;;;AA4CA,IAAa,OAAqB,UAAU;CAC1C,MAAM,EAAE,OAAO,iBAAiB,aAAa,GAAG,SAAS;CAEzD,MAAM,SAAS,gBAAgB;CAC/B,MAAM,EAAE,WAAW,yBAAyB;CAE5C,MAAM,QAAQ,mBAAmB,cAAc,IAC3C,6BAA6B,eAAe,KAC5C;CAEJ,MAAM,eAAe,SAAS,OAAO,IAAI,gBAAgB,CAAC,KAAK;CAC/D,MAAM,SACJ,MAAM,YAAY,KAAA,IACd,IACA,WAAW,aACT;EAAC;EAAG;EAAc;EAAc;CAAC,IACjC;EAAC;EAAc;EAAc;EAAG;CAAC;CAEzC,OACE,oBAAC,SAAS,KAAV;EACE,MAAM,mBAAmB,KAAK,IAAI,MAAM,eAAe,MAAM;EAC7D,GAAI;EACJ,MAAM;EACE;CACT,CAAA;AAEL;AAEA,IAAa,iBACX"}
|
package/dist/js/packages/components/src/components/CartesianChart/components/XAxis/XAxis.mjs
CHANGED
|
@@ -7,9 +7,11 @@ import * as Recharts from "recharts";
|
|
|
7
7
|
//#region src/components/CartesianChart/components/XAxis/XAxis.tsx
|
|
8
8
|
/** @flr-generate all */
|
|
9
9
|
var XAxis = (props) => {
|
|
10
|
+
const { type = "auto", ...rest } = props;
|
|
10
11
|
const tokens = useDesignTokens();
|
|
11
12
|
return /* @__PURE__ */ jsx(Recharts.XAxis, {
|
|
12
|
-
...
|
|
13
|
+
...rest,
|
|
14
|
+
type,
|
|
13
15
|
fontSize: tokens.axis["font-size"].value,
|
|
14
16
|
tick: { fill: tokens.axis["color"].value },
|
|
15
17
|
tickMargin: parseInt(tokens.axis.spacing.value),
|
package/dist/js/packages/components/src/components/CartesianChart/components/XAxis/XAxis.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XAxis.mjs","names":[],"sources":["../../../../../../../../../src/components/CartesianChart/components/XAxis/XAxis.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport * as Recharts from \"recharts\";\nimport type {\n ChartDataValue,\n DataKey,\n DataKeyValue,\n} from \"@/components/CartesianChart/types\";\nimport { useDesignTokens } from \"@/lib/theming\";\n\nexport type XAxisProps<\n TData extends ChartDataValue = ChartDataValue,\n TDataKey extends DataKey<TData> = DataKey<TData>,\n TDataKeyValue = DataKeyValue<TData, TDataKey>,\n> = Pick<\n Recharts.XAxisProps,\n | \"className\"\n | \"orientation\"\n | \"allowDecimals\"\n | \"allowDataOverflow\"\n | \"interval\"\n | \"minTickGap\"\n | \"scale\"\n | \"type\"\n | \"domain\"\n | \"hide\"\n | \"unit\"\n> & {\n dataKey?: TDataKey;\n tickFormatter?: (value: TDataKeyValue, index: number) => string;\n};\n\n/** @flr-generate all */\nexport const XAxis: FC<XAxisProps> = (props) => {\n const tokens = useDesignTokens();\n\n return (\n <Recharts.XAxis\n {...
|
|
1
|
+
{"version":3,"file":"XAxis.mjs","names":[],"sources":["../../../../../../../../../src/components/CartesianChart/components/XAxis/XAxis.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport * as Recharts from \"recharts\";\nimport type {\n ChartDataValue,\n DataKey,\n DataKeyValue,\n} from \"@/components/CartesianChart/types\";\nimport { useDesignTokens } from \"@/lib/theming\";\n\nexport type XAxisProps<\n TData extends ChartDataValue = ChartDataValue,\n TDataKey extends DataKey<TData> = DataKey<TData>,\n TDataKeyValue = DataKeyValue<TData, TDataKey>,\n> = Pick<\n Recharts.XAxisProps,\n | \"className\"\n | \"orientation\"\n | \"allowDecimals\"\n | \"allowDataOverflow\"\n | \"interval\"\n | \"minTickGap\"\n | \"scale\"\n | \"type\"\n | \"domain\"\n | \"hide\"\n | \"unit\"\n> & {\n dataKey?: TDataKey;\n tickFormatter?: (value: TDataKeyValue, index: number) => string;\n};\n\n/** @flr-generate all */\nexport const XAxis: FC<XAxisProps> = (props) => {\n const { type = \"auto\", ...rest } = props;\n\n const tokens = useDesignTokens();\n\n return (\n <Recharts.XAxis\n {...rest}\n type={type}\n fontSize={tokens.axis[\"font-size\"].value}\n tick={{\n fill: tokens.axis[\"color\"].value,\n }}\n tickMargin={parseInt(tokens.axis.spacing.value)}\n tickSize={parseInt(tokens.axis[\"tick-size\"].value)}\n />\n );\n};\n\nexport { TypedXAxis } from \"./types\";\n\nexport default XAxis;\n"],"mappings":";;;;;;;;AAgCA,IAAa,SAAyB,UAAU;CAC9C,MAAM,EAAE,OAAO,QAAQ,GAAG,SAAS;CAEnC,MAAM,SAAS,gBAAgB;CAE/B,OACE,oBAAC,SAAS,OAAV;EACE,GAAI;EACE;EACN,UAAU,OAAO,KAAK,YAAY,CAAC;EACnC,MAAM,EACJ,MAAM,OAAO,KAAK,QAAQ,CAAC,MAC7B;EACA,YAAY,SAAS,OAAO,KAAK,QAAQ,KAAK;EAC9C,UAAU,SAAS,OAAO,KAAK,YAAY,CAAC,KAAK;CAClD,CAAA;AAEL"}
|
package/dist/js/packages/components/src/components/CartesianChart/components/YAxis/YAxis.mjs
CHANGED
|
@@ -7,12 +7,13 @@ import * as Recharts from "recharts";
|
|
|
7
7
|
//#region src/components/CartesianChart/components/YAxis/YAxis.tsx
|
|
8
8
|
/** @flr-generate all */
|
|
9
9
|
var YAxis = (props) => {
|
|
10
|
-
const { domain, ...rest } = props;
|
|
10
|
+
const { domain, type = "auto", ...rest } = props;
|
|
11
11
|
const tokens = useDesignTokens();
|
|
12
12
|
return /* @__PURE__ */ jsx(Recharts.YAxis, {
|
|
13
13
|
...rest,
|
|
14
14
|
allowDataOverflow: true,
|
|
15
15
|
domain,
|
|
16
|
+
type,
|
|
16
17
|
fontSize: tokens.axis["font-size"].value,
|
|
17
18
|
tick: { fill: tokens.axis["color"].value },
|
|
18
19
|
tickMargin: parseInt(tokens.axis.spacing.value),
|
package/dist/js/packages/components/src/components/CartesianChart/components/YAxis/YAxis.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YAxis.mjs","names":[],"sources":["../../../../../../../../../src/components/CartesianChart/components/YAxis/YAxis.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport * as Recharts from \"recharts\";\nimport type {\n ChartDataValue,\n DataKey,\n DataKeyValue,\n} from \"@/components/CartesianChart/types\";\nimport { useDesignTokens } from \"@/lib/theming\";\n\nexport type YAxisProps<\n TData extends ChartDataValue = ChartDataValue,\n TDataKey extends DataKey<TData> = DataKey<TData>,\n TDataMatch = DataKeyValue<TData, TDataKey>,\n> = Pick<\n Recharts.YAxisProps,\n | \"className\"\n | \"orientation\"\n | \"allowDecimals\"\n | \"interval\"\n | \"minTickGap\"\n | \"scale\"\n | \"type\"\n | \"domain\"\n | \"hide\"\n | \"unit\"\n> & {\n dataKey?: TDataKey;\n tickFormatter?: (value: TDataMatch, index: number) => string;\n};\n\n/** @flr-generate all */\nexport const YAxis: FC<YAxisProps> = (props) => {\n const { domain, ...rest } = props;\n\n const tokens = useDesignTokens();\n\n return (\n <Recharts.YAxis\n {...rest}\n allowDataOverflow\n domain={domain}\n fontSize={tokens.axis[\"font-size\"].value}\n tick={{\n fill: tokens.axis[\"color\"].value,\n }}\n tickMargin={parseInt(tokens.axis.spacing.value)}\n tickSize={parseInt(tokens.axis[\"tick-size\"].value)}\n />\n );\n};\n\nexport { TypedYAxis } from \"./types\";\n\nexport default YAxis;\n"],"mappings":";;;;;;;;AA+BA,IAAa,SAAyB,UAAU;CAC9C,MAAM,EAAE,QAAQ,GAAG,SAAS;
|
|
1
|
+
{"version":3,"file":"YAxis.mjs","names":[],"sources":["../../../../../../../../../src/components/CartesianChart/components/YAxis/YAxis.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport * as Recharts from \"recharts\";\nimport type {\n ChartDataValue,\n DataKey,\n DataKeyValue,\n} from \"@/components/CartesianChart/types\";\nimport { useDesignTokens } from \"@/lib/theming\";\n\nexport type YAxisProps<\n TData extends ChartDataValue = ChartDataValue,\n TDataKey extends DataKey<TData> = DataKey<TData>,\n TDataMatch = DataKeyValue<TData, TDataKey>,\n> = Pick<\n Recharts.YAxisProps,\n | \"className\"\n | \"orientation\"\n | \"allowDecimals\"\n | \"interval\"\n | \"minTickGap\"\n | \"scale\"\n | \"type\"\n | \"domain\"\n | \"hide\"\n | \"unit\"\n> & {\n dataKey?: TDataKey;\n tickFormatter?: (value: TDataMatch, index: number) => string;\n};\n\n/** @flr-generate all */\nexport const YAxis: FC<YAxisProps> = (props) => {\n const { domain, type = \"auto\", ...rest } = props;\n\n const tokens = useDesignTokens();\n\n return (\n <Recharts.YAxis\n {...rest}\n allowDataOverflow\n domain={domain}\n type={type}\n fontSize={tokens.axis[\"font-size\"].value}\n tick={{\n fill: tokens.axis[\"color\"].value,\n }}\n tickMargin={parseInt(tokens.axis.spacing.value)}\n tickSize={parseInt(tokens.axis[\"tick-size\"].value)}\n />\n );\n};\n\nexport { TypedYAxis } from \"./types\";\n\nexport default YAxis;\n"],"mappings":";;;;;;;;AA+BA,IAAa,SAAyB,UAAU;CAC9C,MAAM,EAAE,QAAQ,OAAO,QAAQ,GAAG,SAAS;CAE3C,MAAM,SAAS,gBAAgB;CAE/B,OACE,oBAAC,SAAS,OAAV;EACE,GAAI;EACJ,mBAAA;EACQ;EACF;EACN,UAAU,OAAO,KAAK,YAAY,CAAC;EACnC,MAAM,EACJ,MAAM,OAAO,KAAK,QAAQ,CAAC,MAC7B;EACA,YAAY,SAAS,OAAO,KAAK,QAAQ,KAAK;EAC9C,UAAU,SAAS,OAAO,KAAK,YAAY,CAAC,KAAK;CAClD,CAAA;AAEL"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
import { createContext, useContext } from "react";
|
|
4
|
+
//#region src/components/CartesianChart/context.ts
|
|
5
|
+
var cartesianChartContext = createContext({ layout: "horizontal" });
|
|
6
|
+
var useCartesianChartContext = () => useContext(cartesianChartContext);
|
|
7
|
+
var CartesianChartContextProvider = cartesianChartContext.Provider;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { CartesianChartContextProvider, useCartesianChartContext };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=context.mjs.map
|
|
@@ -0,0 +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":";;;;AAOA,IAAM,wBAAwB,cAAqC,EACjE,QAAQ,aACV,CAAC;AAED,IAAa,iCACX,WAAW,qBAAqB;AAElC,IAAa,gCAAgC,sBAAsB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.mjs","names":[],"sources":["../../../../../../../src/components/CartesianChart/types.ts"],"sourcesContent":["export type ChartDataValue<TValue = unknown> = Record<string, TValue>;\n\nexport interface DataKeyWithLabel<TData extends ChartDataValue> {\n dataKey: DataKeyFn<TData>;\n dataKeyLabel: DataKeyProp<TData>;\n}\n\nexport type DataKeyFn<\n TData extends ChartDataValue = ChartDataValue,\n TValue = unknown,\n> = (data: TData) => TValue;\n\nexport type DataKeyProp<TData extends ChartDataValue = ChartDataValue> =\n keyof TData;\n\nexport type DataKey<\n TData extends ChartDataValue = ChartDataValue,\n TValue = unknown,\n> = DataKeyProp<TData> | DataKeyFn<TData, TValue>;\n\nexport type DataKeyValue<\n TData extends ChartDataValue,\n TDataKey extends DataKey<TData>,\n> = TDataKey extends (data: TData) => infer R\n ? R\n : TDataKey extends keyof TData\n ? TData[TDataKey]\n : never;\n\nexport const isDataKeyWithLabel = <TData extends ChartDataValue>(\n obj: unknown,\n): obj is DataKeyWithLabel<TData> => {\n return (\n typeof obj === \"object\" &&\n obj !== null &&\n \"dataKeyLabel\" in obj &&\n typeof obj.dataKeyLabel === \"string\"\n );\n};\n"],"mappings":";;;AA6BA,IAAa,sBACX,QACmC;CACnC,OACE,OAAO,QAAQ,YACf,QAAQ,QACR,kBAAkB,OAClB,OAAO,IAAI,iBAAiB;AAEhC"}
|
|
1
|
+
{"version":3,"file":"types.mjs","names":[],"sources":["../../../../../../../src/components/CartesianChart/types.ts"],"sourcesContent":["export type ChartDataValue<TValue = unknown> = Record<string, TValue>;\n\nexport interface DataKeyWithLabel<TData extends ChartDataValue> {\n dataKey: DataKeyFn<TData>;\n dataKeyLabel: DataKeyProp<TData>;\n}\n\nexport type DataKeyFn<\n TData extends ChartDataValue = ChartDataValue,\n TValue = unknown,\n> = (data: TData) => TValue;\n\nexport type DataKeyProp<TData extends ChartDataValue = ChartDataValue> =\n keyof TData;\n\nexport type DataKey<\n TData extends ChartDataValue = ChartDataValue,\n TValue = unknown,\n> = DataKeyProp<TData> | DataKeyFn<TData, TValue>;\n\nexport type DataKeyValue<\n TData extends ChartDataValue,\n TDataKey extends DataKey<TData>,\n> = TDataKey extends (data: TData) => infer R\n ? R\n : TDataKey extends keyof TData\n ? TData[TDataKey]\n : never;\n\nexport const isDataKeyWithLabel = <TData extends ChartDataValue>(\n obj: unknown,\n): obj is DataKeyWithLabel<TData> => {\n return (\n typeof obj === \"object\" &&\n obj !== null &&\n \"dataKeyLabel\" in obj &&\n typeof obj.dataKeyLabel === \"string\"\n );\n};\n\n/**\n * The orientation of the chart's axes and graphical items. `\"horizontal\"` puts\n * the category axis on the x-axis (bars grow upwards), `\"vertical\"` puts it on\n * the y-axis (bars grow to the side).\n */\nexport type CartesianChartLayout = \"horizontal\" | \"vertical\";\n"],"mappings":";;;AA6BA,IAAa,sBACX,QACmC;CACnC,OACE,OAAO,QAAQ,YACf,QAAQ,QACR,kBAAkB,OAClB,OAAO,IAAI,iBAAiB;AAEhC"}
|
|
@@ -1341,6 +1341,10 @@ var axis = {
|
|
|
1341
1341
|
"path": ["axis", "tick-size"]
|
|
1342
1342
|
}
|
|
1343
1343
|
};
|
|
1344
|
+
var bar = { "corner-radius": {
|
|
1345
|
+
"value": "4px",
|
|
1346
|
+
"path": ["bar", "corner-radius"]
|
|
1347
|
+
} };
|
|
1344
1348
|
var legend = {
|
|
1345
1349
|
"spacing-x": {
|
|
1346
1350
|
"value": "16px",
|
|
@@ -4295,6 +4299,7 @@ var all_dark_default = {
|
|
|
4295
4299
|
text,
|
|
4296
4300
|
area,
|
|
4297
4301
|
axis,
|
|
4302
|
+
bar,
|
|
4298
4303
|
"big-number": {
|
|
4299
4304
|
"spacing": {
|
|
4300
4305
|
"value": "0.25rem",
|
|
@@ -5784,6 +5789,6 @@ var all_dark_default = {
|
|
|
5784
5789
|
}
|
|
5785
5790
|
};
|
|
5786
5791
|
//#endregion
|
|
5787
|
-
export { accordion, alert, area, avatar, axis, badge, blur, breadcrumb, button, calendar, chat, choice, color, combine, danger, dark, decorative, all_dark_default as default, focus, heading, icon, image, info, initials, kbd, label, legend, light, line, link, list, markdown, menu, message, modal, neutral, notification, overlay, popover, primary, rating, scrollbar, section, separator, shadow, slider, success, table, tabs, text, tooltip, transition, unavailable, warning };
|
|
5792
|
+
export { accordion, alert, area, avatar, axis, badge, bar, blur, breadcrumb, button, calendar, chat, choice, color, combine, danger, dark, decorative, all_dark_default as default, focus, heading, icon, image, info, initials, kbd, label, legend, light, line, link, list, markdown, menu, message, modal, neutral, notification, overlay, popover, primary, rating, scrollbar, section, separator, shadow, slider, success, table, tabs, text, tooltip, transition, unavailable, warning };
|
|
5788
5793
|
|
|
5789
5794
|
//# sourceMappingURL=all-dark.mjs.map
|