@taiv/ui 1.10.9 → 1.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,19 @@
1
1
  import React from 'react';
2
2
  import { formats } from '../../../constants/data';
3
- import { ChartSeries } from '../../../types/types';
3
+ import { ChartFormatOptions, ChartSeries } from '../../../types/types';
4
+ type ChartFormat = keyof typeof formats;
5
+ interface AxisFormat {
6
+ format: ChartFormat;
7
+ options?: ChartFormatOptions;
8
+ }
4
9
  export interface ChartProps {
5
10
  series: ChartSeries[];
6
- yAxisFormat?: keyof typeof formats;
7
- xAxisFormat?: keyof typeof formats;
11
+ yAxisFormat?: ChartFormat | AxisFormat;
12
+ xAxisFormat?: ChartFormat | AxisFormat;
8
13
  height?: string | number;
9
14
  showLegend?: boolean;
10
15
  loading?: boolean;
11
16
  }
12
17
  export declare const Chart: React.FC<ChartProps>;
18
+ export {};
13
19
  //# sourceMappingURL=Chart.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Chart.d.ts","sourceRoot":"","sources":["../../../../src/components/Data/Chart/Chart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAIlD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGnD,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,OAAO,OAAO,CAAC;IACnC,WAAW,CAAC,EAAE,MAAM,OAAO,OAAO,CAAC;IACnC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAmKtC,CAAC"}
1
+ {"version":3,"file":"Chart.d.ts","sourceRoot":"","sources":["../../../../src/components/Data/Chart/Chart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAIlD,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGvE,KAAK,WAAW,GAAG,MAAM,OAAO,OAAO,CAAC;AAExC,UAAU,UAAU;IAClB,MAAM,EAAE,WAAW,CAAC;IACpB,OAAO,CAAC,EAAE,kBAAkB,CAAC;CAC9B;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,WAAW,CAAC,EAAE,WAAW,GAAG,UAAU,CAAC;IACvC,WAAW,CAAC,EAAE,WAAW,GAAG,UAAU,CAAC;IACvC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAwLtC,CAAC"}
@@ -10,8 +10,20 @@ import { fontStyle } from '../../../constants/font';
10
10
  import { primary, neutral } from '../../../constants/colors';
11
11
  import { createStyles } from '@mantine/core';
12
12
  export const Chart = ({ series, yAxisFormat = 'decimal', xAxisFormat = 'string', showLegend = true, loading = false, height = '100%' }) => {
13
- const formatYAxisValue = getChartFormatter(yAxisFormat);
14
- const formatXAxisValue = getChartFormatter(xAxisFormat);
13
+ const parseFormat = (format) => {
14
+ var _a;
15
+ if (typeof format === 'string') {
16
+ return { format: format, options: {} };
17
+ }
18
+ return {
19
+ format: format.format,
20
+ options: (_a = format.options) !== null && _a !== void 0 ? _a : {}
21
+ };
22
+ };
23
+ const parsedYAxis = parseFormat(yAxisFormat);
24
+ const parsedXAxis = parseFormat(xAxisFormat);
25
+ const formatYAxisValue = getChartFormatter(parsedYAxis.format, parsedYAxis.options);
26
+ const formatXAxisValue = getChartFormatter(parsedXAxis.format, parsedXAxis.options);
15
27
  const hasData = series.some((s) => s.data.length > 0);
16
28
  // Transform our ChartSeries array to match the Recharts format (just a singular data array keyed by the series name)
17
29
  const transformedData = (() => {
@@ -0,0 +1,17 @@
1
+ import type { Meta, StoryObj } from "@storybook/react-vite";
2
+ import type { ChartProps } from "./Chart";
3
+ declare const meta: Meta<ChartProps>;
4
+ export default meta;
5
+ type Story = StoryObj<ChartProps>;
6
+ export declare const Default: Story;
7
+ export declare const SeriesTypes: Story;
8
+ export declare const MultiSeries: Story;
9
+ export declare const MixedBarAndLine: Story;
10
+ export declare const YAxisFormats: Story;
11
+ export declare const YAxisDecimalPlaces: Story;
12
+ export declare const YAxisTruncation: Story;
13
+ export declare const XAxisNumericFormats: Story;
14
+ export declare const WithoutLegend: Story;
15
+ export declare const Loading: Story;
16
+ export declare const Empty: Story;
17
+ //# sourceMappingURL=Chart.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Chart.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Data/Chart/Chart.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAO5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AA8D1C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,UAAU,CA0D1B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC;AAElC,eAAO,MAAM,OAAO,EAAE,KAcrB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAczB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAMzB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAM7B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAqB1B,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KAmBhC,CAAC;AAgBF,eAAO,MAAM,eAAe,EAAE,KA+B7B,CAAC;AAgBF,eAAO,MAAM,mBAAmB,EAAE,KAuCjC,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAM3B,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KASnB,CAAC"}
@@ -0,0 +1,192 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { formats } from "../../../constants/data";
3
+ import { primary, success, warning } from "../../../constants/colors";
4
+ import { Box } from "../../Layout/Box/Box";
5
+ import { Group } from "../../Layout/Group/Group";
6
+ import { Stack } from "../../Layout/Stack/Stack";
7
+ import { Chart } from "./Chart";
8
+ const months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun"];
9
+ const sampleLineSeries = [
10
+ {
11
+ name: "Units sold",
12
+ type: "line",
13
+ data: months.map((m, i) => ({ key: m, value: 100 + i * 25 })),
14
+ color: primary[200],
15
+ },
16
+ ];
17
+ const sampleAreaSeries = [
18
+ {
19
+ name: "Revenue",
20
+ type: "area",
21
+ data: months.map((m, i) => ({ key: m, value: 1200 + i * 180 })),
22
+ color: primary[200],
23
+ },
24
+ ];
25
+ const sampleBarSeries = [
26
+ {
27
+ name: "Orders",
28
+ type: "bar",
29
+ data: months.map((m, i) => ({ key: m, value: 42 + i * 8 })),
30
+ color: success[200],
31
+ },
32
+ ];
33
+ const sampleMultiSeries = [
34
+ {
35
+ name: "Product A",
36
+ type: "line",
37
+ data: months.map((m, i) => ({ key: m, value: 120 + i * 20 })),
38
+ color: primary[200],
39
+ },
40
+ {
41
+ name: "Product B",
42
+ type: "line",
43
+ data: months.map((m, i) => ({ key: m, value: 80 + i * 15 })),
44
+ color: success[200],
45
+ },
46
+ ];
47
+ const sampleMixedSeries = [
48
+ {
49
+ name: "Actuals",
50
+ type: "bar",
51
+ data: months.map((m, i) => ({ key: m, value: 55 + i * 6 })),
52
+ color: primary[200],
53
+ },
54
+ {
55
+ name: "Target",
56
+ type: "line",
57
+ data: months.map((m, i) => ({ key: m, value: 50 + i * 7 })),
58
+ color: warning[200],
59
+ },
60
+ ];
61
+ const meta = {
62
+ title: "Components/Data/Chart",
63
+ component: Chart,
64
+ parameters: {
65
+ layout: "padded",
66
+ docs: {
67
+ description: {
68
+ component: "A composed chart (line, area, bar) built on Recharts with shared X/Y axes, tooltips, and optional legend. `yAxisFormat` and `xAxisFormat` accept either a `formats` key string (e.g. `'currency'`) or `{ format, options? }` for `decimalPlaces` / `truncateAt`; the chart normalizes both via an internal `parseFormat` before calling `getChartFormatter`.",
69
+ },
70
+ },
71
+ },
72
+ argTypes: {
73
+ series: {
74
+ control: { type: "object" },
75
+ description: "ChartSeries[] — each series: name, data (DataPoint[]), optional color and type (line | area | bar)",
76
+ table: { type: { summary: "ChartSeries[]" } },
77
+ },
78
+ yAxisFormat: {
79
+ control: { type: "select" },
80
+ options: Object.keys(formats),
81
+ description: "Format key string (default formatting) or pass `{ format, options }` in code for `decimalPlaces` / `truncateAt`. Tooltip values use the Y formatter.",
82
+ table: {
83
+ type: { summary: "ChartFormat | AxisFormat" },
84
+ defaultValue: { summary: "'decimal'" },
85
+ },
86
+ },
87
+ xAxisFormat: {
88
+ control: { type: "select" },
89
+ options: Object.keys(formats),
90
+ description: "Format key string or `{ format, options }`. Use `string` for categorical X keys; numeric `formats` when keys parse as numbers.",
91
+ table: {
92
+ type: { summary: "ChartFormat | AxisFormat" },
93
+ defaultValue: { summary: "'string'" },
94
+ },
95
+ },
96
+ height: {
97
+ control: { type: "text" },
98
+ description: "Chart height (CSS length or number)",
99
+ table: {
100
+ type: { summary: "string | number" },
101
+ defaultValue: { summary: "'100%'" },
102
+ },
103
+ },
104
+ showLegend: {
105
+ control: { type: "boolean" },
106
+ description: "Show Recharts legend below the chart",
107
+ table: { defaultValue: { summary: "true" } },
108
+ },
109
+ loading: {
110
+ control: { type: "boolean" },
111
+ description: "Placeholder state while data is loading",
112
+ table: { defaultValue: { summary: "false" } },
113
+ },
114
+ },
115
+ };
116
+ export default meta;
117
+ export const Default = {
118
+ args: {
119
+ series: sampleLineSeries,
120
+ yAxisFormat: "decimal",
121
+ xAxisFormat: "string",
122
+ height: "100%",
123
+ showLegend: true,
124
+ loading: false,
125
+ },
126
+ render: (args) => (_jsx(Box, { w: "100%", maw: 720, h: 360, children: _jsx(Chart, { ...args }) })),
127
+ };
128
+ export const SeriesTypes = {
129
+ render: () => (_jsxs(Stack, { gap: "2.4rem", children: [_jsx(Box, { w: "100%", h: 280, children: _jsx(Chart, { series: sampleLineSeries, height: "100%", yAxisFormat: "integer" }) }), _jsx(Box, { w: "100%", h: 280, children: _jsx(Chart, { series: sampleAreaSeries, height: "100%", yAxisFormat: "currency" }) }), _jsx(Box, { w: "100%", h: 280, children: _jsx(Chart, { series: sampleBarSeries, height: "100%", yAxisFormat: "integer" }) })] })),
130
+ };
131
+ export const MultiSeries = {
132
+ render: () => (_jsx(Box, { w: "100%", h: 320, children: _jsx(Chart, { series: sampleMultiSeries, height: "100%", yAxisFormat: "decimal" }) })),
133
+ };
134
+ export const MixedBarAndLine = {
135
+ render: () => (_jsx(Box, { w: "100%", h: 320, children: _jsx(Chart, { series: sampleMixedSeries, height: "100%", yAxisFormat: "integer" }) })),
136
+ };
137
+ export const YAxisFormats = {
138
+ render: () => (_jsx(Group, { align: "flex-start", gap: "1.6rem", styles: { root: { flexWrap: "wrap" } }, children: ["integer", "decimal", "currency", "percentage", "multiple"].map((fmt) => (_jsx(Box, { w: 280, h: 220, children: _jsx(Chart, { series: sampleLineSeries, height: "100%", yAxisFormat: fmt, showLegend: false }) }, fmt))) })),
139
+ };
140
+ export const YAxisDecimalPlaces = {
141
+ render: () => (_jsx(Group, { align: "flex-start", gap: "1.6rem", styles: { root: { flexWrap: "wrap" } }, children: [1, 2, 3].map((dp) => (_jsx(Box, { w: 280, h: 220, children: _jsx(Chart, { series: sampleLineSeries, height: "100%", yAxisFormat: { format: "decimal", options: { decimalPlaces: dp } }, showLegend: false }) }, dp))) })),
142
+ };
143
+ const largeValueSeries = [
144
+ {
145
+ name: "Volume",
146
+ type: "line",
147
+ data: [
148
+ { key: "Q1", value: 850 },
149
+ { key: "Q2", value: 4200 },
150
+ { key: "Q3", value: 1550000 },
151
+ { key: "Q4", value: 2100000 },
152
+ ],
153
+ color: primary[200],
154
+ },
155
+ ];
156
+ export const YAxisTruncation = {
157
+ render: () => (_jsxs(Group, { align: "flex-start", gap: "1.6rem", styles: { root: { flexWrap: "wrap" } }, children: [_jsx(Box, { w: 280, h: 220, children: _jsx(Chart, { series: largeValueSeries, height: "100%", yAxisFormat: {
158
+ format: "decimal",
159
+ options: { truncateAt: "thousand" },
160
+ }, showLegend: false }) }), _jsx(Box, { w: 280, h: 220, children: _jsx(Chart, { series: largeValueSeries, height: "100%", yAxisFormat: {
161
+ format: "decimal",
162
+ options: { truncateAt: "million" },
163
+ }, showLegend: false }) })] })),
164
+ };
165
+ const numericKeySeries = [
166
+ {
167
+ name: "Score",
168
+ type: "bar",
169
+ data: [
170
+ { key: "1000", value: 12 },
171
+ { key: "2500", value: 24 },
172
+ { key: "5000", value: 18 },
173
+ { key: "10000", value: 30 },
174
+ ],
175
+ color: success[200],
176
+ },
177
+ ];
178
+ export const XAxisNumericFormats = {
179
+ render: () => (_jsxs(Group, { align: "flex-start", gap: "1.6rem", styles: { root: { flexWrap: "wrap" } }, children: [_jsx(Box, { w: 280, h: 220, children: _jsx(Chart, { series: numericKeySeries, height: "100%", xAxisFormat: "integer", yAxisFormat: "integer", showLegend: false }) }), _jsx(Box, { w: 280, h: 220, children: _jsx(Chart, { series: numericKeySeries, height: "100%", xAxisFormat: { format: "currency", options: { decimalPlaces: 0 } }, yAxisFormat: "integer", showLegend: false }) }), _jsx(Box, { w: 280, h: 220, children: _jsx(Chart, { series: numericKeySeries, height: "100%", xAxisFormat: {
180
+ format: "decimal",
181
+ options: { truncateAt: "thousand" },
182
+ }, yAxisFormat: "integer", showLegend: false }) })] })),
183
+ };
184
+ export const WithoutLegend = {
185
+ render: () => (_jsx(Box, { w: "100%", h: 300, children: _jsx(Chart, { series: sampleMultiSeries, height: "100%", showLegend: false }) })),
186
+ };
187
+ export const Loading = {
188
+ render: () => (_jsx(Box, { w: "100%", h: 300, children: _jsx(Chart, { series: sampleLineSeries, height: "100%", loading: true }) })),
189
+ };
190
+ export const Empty = {
191
+ render: () => (_jsx(Box, { w: "100%", h: 300, children: _jsx(Chart, { series: [{ name: "Empty", data: [], color: primary[200] }], height: "100%" }) })),
192
+ };
@@ -9,7 +9,7 @@ import { Box } from '../../Layout/Box/Box';
9
9
  import { neutral } from '../../../constants/colors';
10
10
  import { textStyle } from '../../../constants/font';
11
11
  import { getChartFormatter } from '../../../utils/charts';
12
- export const PieChart = ({ data, showLegend = true, innerRadius = 80, outerRadius = 100, paddingAngle = 5, format = 'percentage', loading = false, centerContent, height = '100%', }) => {
12
+ export const PieChart = ({ data, showLegend = true, innerRadius = 80, outerRadius = 100, paddingAngle = 0, format = 'percentage', loading = false, centerContent, height = '100%', }) => {
13
13
  const hasData = data && data.length > 0;
14
14
  const transformedData = data.map((item) => ({
15
15
  ...item,
@@ -37,7 +37,7 @@ export const PieChart = ({ data, showLegend = true, innerRadius = 80, outerRadiu
37
37
  }
38
38
  return null;
39
39
  };
40
- return (_jsxs(_Fragment, { children: [loading || !hasData ? (_jsx(Center, { style: { backgroundColor: neutral[25], borderRadius: '8px' }, children: _jsx(Text, { variant: "label", color: neutral[200], children: loading ? 'Loading...' : 'No data available' }) })) : (_jsx(Center, { h: height, w: "100%", style: { position: 'relative' }, children: _jsx(ResponsiveContainer, { width: "100%", height: "100%", style: { outline: 'none' }, children: _jsxs(RechartsPieChart, { style: { outline: 'none' }, children: [_jsxs(Pie, { data: transformedData, innerRadius: innerRadius, outerRadius: outerRadius, paddingAngle: paddingAngle, dataKey: "value", style: { outline: 'none' }, children: [_jsx(Label, { content: getCenterContent(), position: "center" }), data.map((entry, index) => (_jsx(Cell, { fill: entry.color, style: { outline: 'none' } }, `cell-${entry.key}`)))] }), _jsx(Tooltip, { content: getTooltip }), showLegend && _jsx(Legend, { iconType: "circle", iconSize: 8, wrapperStyle: { paddingTop: '0.6rem' } })] }) }) })), _jsx("style", { children: `
40
+ return (_jsxs(_Fragment, { children: [loading || !hasData ? (_jsx(Center, { style: { height, backgroundColor: neutral[25], borderRadius: '8px' }, children: _jsx(Text, { variant: "label", color: neutral[200], children: loading ? 'Loading...' : 'No data available' }) })) : (_jsx(Center, { h: height, w: "100%", style: { position: 'relative' }, children: _jsx(ResponsiveContainer, { width: "100%", height: "100%", style: { outline: 'none' }, children: _jsxs(RechartsPieChart, { style: { outline: 'none' }, children: [_jsxs(Pie, { data: transformedData, innerRadius: innerRadius, outerRadius: outerRadius, paddingAngle: paddingAngle, dataKey: "value", style: { outline: 'none' }, children: [_jsx(Label, { content: getCenterContent(), position: "center" }), data.map((entry, index) => (_jsx(Cell, { fill: entry.color, style: { outline: 'none' } }, `cell-${entry.key}`)))] }), _jsx(Tooltip, { content: getTooltip }), showLegend && _jsx(Legend, { iconType: "circle", iconSize: 8, wrapperStyle: { paddingTop: '0.6rem' } })] }) }) })), _jsx("style", { children: `
41
41
  .recharts-legend-item-text {
42
42
  font-family: ${textStyle.label.fontFamily};
43
43
  font-size: ${textStyle.label.fontSize};
@@ -0,0 +1,14 @@
1
+ import type { Meta, StoryObj } from "@storybook/react-vite";
2
+ import type { PieChartProps } from "./PieChart";
3
+ declare const meta: Meta<PieChartProps>;
4
+ export default meta;
5
+ type Story = StoryObj<PieChartProps>;
6
+ export declare const Default: Story;
7
+ export declare const Formats: Story;
8
+ export declare const WithCenterContent: Story;
9
+ export declare const DonutGeometry: Story;
10
+ export declare const PaddingAngle: Story;
11
+ export declare const WithoutLegend: Story;
12
+ export declare const Loading: Story;
13
+ export declare const Empty: Story;
14
+ //# sourceMappingURL=PieChart.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PieChart.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Data/PieChart/PieChart.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAM5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAShD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,aAAa,CAmE7B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAC;AAErC,eAAO,MAAM,OAAO,EAAE,KAarB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAqBrB,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,KAe/B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KA6B3B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAoC1B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAW3B,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAMnB,CAAC"}
@@ -0,0 +1,121 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { numberFormats } from "../../../constants/data";
3
+ import { primary, success, warning } from "../../../constants/colors";
4
+ import { Box } from "../../Layout/Box/Box";
5
+ import { Group } from "../../Layout/Group/Group";
6
+ import { PieChart } from "./PieChart";
7
+ const samplePieData = [
8
+ { key: "Product A", value: 45, color: primary[200] },
9
+ { key: "Product B", value: 30, color: success[200] },
10
+ { key: "Product C", value: 25, color: warning[200] },
11
+ ];
12
+ const meta = {
13
+ title: "Components/Data/PieChart",
14
+ component: PieChart,
15
+ parameters: {
16
+ layout: "padded",
17
+ docs: {
18
+ description: {
19
+ component: "A pie / donut chart built on Recharts. Slice values are formatted with `getChartFormatter` via the `format` prop (key of `numberFormats`). Optional `centerContent` renders a label in the donut hole. `paddingAngle` defaults to `0` (no gap between slices); increase it for separation. Use a parent with a definite height when `height` is `'100%'` (see stories).",
20
+ },
21
+ },
22
+ },
23
+ argTypes: {
24
+ data: {
25
+ control: { type: "object" },
26
+ description: "PieDataPoint[] — key, value, optional color per slice",
27
+ table: { type: { summary: "PieDataPoint[]" } },
28
+ },
29
+ format: {
30
+ control: { type: "select" },
31
+ options: Object.keys(numberFormats),
32
+ description: "Format key for tooltip and optional center value",
33
+ table: {
34
+ type: { summary: "keyof typeof numberFormats" },
35
+ defaultValue: { summary: "'percentage'" },
36
+ },
37
+ },
38
+ height: {
39
+ control: { type: "text" },
40
+ description: "Chart height (CSS length or number); loading and empty states match this height",
41
+ table: {
42
+ type: { summary: "string | number" },
43
+ defaultValue: { summary: "'100%'" },
44
+ },
45
+ },
46
+ showLegend: {
47
+ control: { type: "boolean" },
48
+ description: "Show Recharts legend below the chart",
49
+ table: { defaultValue: { summary: "true" } },
50
+ },
51
+ loading: {
52
+ control: { type: "boolean" },
53
+ description: "Placeholder state while data is loading",
54
+ table: { defaultValue: { summary: "false" } },
55
+ },
56
+ innerRadius: {
57
+ control: { type: "number" },
58
+ description: "Inner radius in px (larger = more donut, 0 = pie)",
59
+ table: { defaultValue: { summary: "80" } },
60
+ },
61
+ outerRadius: {
62
+ control: { type: "number" },
63
+ description: "Outer radius in px",
64
+ table: { defaultValue: { summary: "100" } },
65
+ },
66
+ paddingAngle: {
67
+ control: { type: "number" },
68
+ description: "Angular gap between slices in degrees (Recharts `Pie` `paddingAngle`). Default **0** — slices touch; increase for visible separation.",
69
+ table: { defaultValue: { summary: "0" } },
70
+ },
71
+ centerContent: {
72
+ control: { type: "object" },
73
+ description: "Optional center: title, subtitle, value",
74
+ table: { type: { summary: "PieCardCenterContentProps" } },
75
+ },
76
+ },
77
+ };
78
+ export default meta;
79
+ export const Default = {
80
+ args: {
81
+ data: samplePieData,
82
+ format: "percentage",
83
+ height: "100%",
84
+ showLegend: true,
85
+ loading: false,
86
+ },
87
+ render: (args) => (_jsx(Box, { w: "100%", maw: 480, h: 360, children: _jsx(PieChart, { ...args }) })),
88
+ };
89
+ export const Formats = {
90
+ render: () => (_jsx(Group, { align: "flex-start", gap: "1.6rem", styles: { root: { flexWrap: "wrap" } }, children: ["integer", "decimal", "currency", "percentage", "multiple"].map((fmt) => (_jsx(Box, { w: 400, h: 400, children: _jsx(PieChart, { data: samplePieData, format: fmt, height: "100%", showLegend: false }) }, fmt))) })),
91
+ };
92
+ export const WithCenterContent = {
93
+ render: () => (_jsx(Box, { w: "100%", maw: 480, h: 360, children: _jsx(PieChart, { data: samplePieData, format: "percentage", height: "100%", centerContent: {
94
+ value: 100,
95
+ title: "Share",
96
+ subtitle: "Q1 2026",
97
+ } }) })),
98
+ };
99
+ export const DonutGeometry = {
100
+ render: () => (_jsxs(Group, { align: "flex-start", gap: "1.6rem", styles: { root: { flexWrap: "wrap" } }, children: [_jsx(Box, { w: 400, h: 400, children: _jsx(PieChart, { data: samplePieData, format: "percentage", height: "100%", innerRadius: 0, outerRadius: 100, showLegend: false }) }), _jsx(Box, { w: 400, h: 400, children: _jsx(PieChart, { data: samplePieData, format: "percentage", height: "100%", innerRadius: 80, outerRadius: 100, showLegend: false }) })] })),
101
+ };
102
+ export const PaddingAngle = {
103
+ name: "Slice gaps (paddingAngle)",
104
+ parameters: {
105
+ docs: {
106
+ description: {
107
+ story: "The component defaults **`paddingAngle` to `0`**, so slices meet with no gap. Pass a positive value (degrees) when you want separation between segments—the background shows through in those gaps.",
108
+ },
109
+ },
110
+ },
111
+ render: () => (_jsxs(Group, { align: "flex-start", gap: "1.6rem", styles: { root: { flexWrap: "wrap" } }, children: [_jsx(Box, { w: 400, h: 400, children: _jsx(PieChart, { data: samplePieData, format: "percentage", height: "100%", paddingAngle: 0, showLegend: false }) }), _jsx(Box, { w: 400, h: 400, children: _jsx(PieChart, { data: samplePieData, format: "percentage", height: "100%", paddingAngle: 8, showLegend: false }) })] })),
112
+ };
113
+ export const WithoutLegend = {
114
+ render: () => (_jsx(Box, { w: "100%", h: 320, children: _jsx(PieChart, { data: samplePieData, format: "percentage", height: "100%", showLegend: false }) })),
115
+ };
116
+ export const Loading = {
117
+ render: () => (_jsx(Box, { w: "100%", h: 300, children: _jsx(PieChart, { data: samplePieData, format: "percentage", height: "100%", loading: true }) })),
118
+ };
119
+ export const Empty = {
120
+ render: () => (_jsx(Box, { w: "100%", h: 300, children: _jsx(PieChart, { data: [], format: "percentage", height: "100%" }) })),
121
+ };
@@ -0,0 +1,10 @@
1
+ import { type ProgressProps as MantineProgressProps } from '@mantine/core';
2
+ import type { ProgressDataPoint } from '../../../types';
3
+ export interface ProgressProps extends Omit<MantineProgressProps, 'animate' | 'style' | 'size' | 'radius' | 'sections'> {
4
+ width?: string | number;
5
+ scale?: string;
6
+ cornerRadius?: string;
7
+ data?: ProgressDataPoint[];
8
+ }
9
+ export declare const Progress: ({ width, color, data, scale, cornerRadius, ...props }: ProgressProps) => import("react/jsx-runtime").JSX.Element;
10
+ //# sourceMappingURL=Progress.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Progress.d.ts","sourceRoot":"","sources":["../../../../src/components/Data/Progress/Progress.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,aAAa,IAAI,oBAAoB,EAC3C,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD,MAAM,WAAW,aACf,SAAQ,IAAI,CACV,oBAAoB,EACpB,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,CACrD;IACD,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,iBAAiB,EAAE,CAAC;CAC5B;AAED,eAAO,MAAM,QAAQ,GAAI,uDAOtB,aAAa,4CAcf,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Progress as MantineProgress, } from '@mantine/core';
3
+ import { primary } from '../../../constants/colors';
4
+ export const Progress = ({ width, color, data, scale = 'md', cornerRadius = 'md', ...props }) => {
5
+ const hasData = Array.isArray(data) && data.length > 0;
6
+ const resolvedColor = !hasData && color === undefined ? primary[200] : color;
7
+ return (_jsx(MantineProgress, { ...props, radius: cornerRadius, size: scale, sections: data, color: resolvedColor, style: width ? { width } : undefined }));
8
+ };
@@ -0,0 +1,15 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import { Progress } from './Progress';
3
+ declare const meta: Meta<typeof Progress>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof meta>;
6
+ export declare const Default: Story;
7
+ export declare const Values: Story;
8
+ export declare const Scale: Story;
9
+ export declare const CornerRadius: Story;
10
+ export declare const Striped: Story;
11
+ export declare const WithLabel: Story;
12
+ export declare const Data: Story;
13
+ export declare const WithTooltips: Story;
14
+ export declare const Width: Story;
15
+ //# sourceMappingURL=Progress.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Progress.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Data/Progress/Progress.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAG5D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAItC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,QAAQ,CA6E/B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAUrB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KASpB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAQnB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAQ1B,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAOvB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,KAYlB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KA2B1B,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAOnB,CAAC"}
@@ -0,0 +1,146 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { primary, purple, success } from '../../../constants/colors';
3
+ import { Stack } from '../../Layout/Stack/Stack';
4
+ import { Progress } from './Progress';
5
+ const presetOptions = ['xs', 'sm', 'md', 'lg', 'xl'];
6
+ const meta = {
7
+ title: 'Components/Data/Progress',
8
+ component: Progress,
9
+ decorators: [
10
+ (Story) => (_jsx("div", { style: { width: '25rem' }, children: _jsx(Story, {}) })),
11
+ ],
12
+ parameters: {
13
+ layout: 'centered',
14
+ docs: {
15
+ description: {
16
+ component: 'Horizontal progress bar. **`data`** (`ProgressDataPoint[]`) for multi-part segments; **`value`** / **`color`** for a single fill. Root width: **`width`** (**rem** or **`%`**). Bar thickness and corners: **`scale`** and **`cornerRadius`** (`xs`–`xl` preset strings). **`styles`** for Mantine styling hooks when needed.',
17
+ },
18
+ },
19
+ },
20
+ argTypes: {
21
+ scale: {
22
+ control: { type: 'select' },
23
+ options: [...presetOptions],
24
+ description: 'Bar height on the xs–xl scale',
25
+ table: {
26
+ type: { summary: 'string' },
27
+ defaultValue: { summary: "'md'" },
28
+ },
29
+ },
30
+ cornerRadius: {
31
+ control: { type: 'select' },
32
+ options: [...presetOptions],
33
+ description: 'Corner rounding on the xs–xl scale',
34
+ table: {
35
+ type: { summary: 'string' },
36
+ defaultValue: { summary: undefined },
37
+ },
38
+ },
39
+ value: {
40
+ control: { type: 'range', min: 0, max: 100, step: 1 },
41
+ description: 'Filled percent (single-bar mode; use `data` for multiple segments)',
42
+ table: { type: { summary: 'number' }, defaultValue: { summary: '0' } },
43
+ },
44
+ color: {
45
+ control: { type: 'text' },
46
+ description: 'Theme color of the bar (single-bar mode)',
47
+ table: {
48
+ type: { summary: 'string' },
49
+ defaultValue: { summary: 'primary[200]' },
50
+ },
51
+ },
52
+ width: {
53
+ control: { type: 'text' },
54
+ description: 'Root width (e.g. rem string or percentage)',
55
+ table: {
56
+ type: { summary: 'string | number' },
57
+ },
58
+ },
59
+ data: {
60
+ control: { type: 'object' },
61
+ description: 'Multi-segment bar data',
62
+ table: { type: { summary: 'ProgressDataPoint[]' } },
63
+ },
64
+ striped: {
65
+ control: { type: 'boolean' },
66
+ table: {
67
+ type: { summary: 'boolean' },
68
+ defaultValue: { summary: 'false' },
69
+ },
70
+ },
71
+ label: {
72
+ control: { type: 'text' },
73
+ description: 'Label inside the bar (single-bar mode)',
74
+ table: { type: { summary: 'string' } },
75
+ },
76
+ },
77
+ };
78
+ export default meta;
79
+ export const Default = {
80
+ args: {
81
+ value: 50,
82
+ scale: 'md',
83
+ cornerRadius: 'md',
84
+ width: undefined,
85
+ striped: false,
86
+ data: undefined,
87
+ label: undefined,
88
+ },
89
+ };
90
+ export const Values = {
91
+ render: () => (_jsxs(Stack, { spacing: "md", children: [_jsx(Progress, { value: 0, scale: "xl", cornerRadius: "xl" }), _jsx(Progress, { value: 25, scale: "xl", cornerRadius: "xl" }), _jsx(Progress, { value: 50, scale: "xl", cornerRadius: "xl" }), _jsx(Progress, { value: 100, scale: "xl", cornerRadius: "xl" })] })),
92
+ };
93
+ export const Scale = {
94
+ render: () => (_jsx(Stack, { spacing: "md", children: presetOptions.map((preset) => (_jsx(Progress, { value: 60, scale: preset, cornerRadius: "md" }, preset))) })),
95
+ };
96
+ export const CornerRadius = {
97
+ render: () => (_jsx(Stack, { spacing: "md", children: presetOptions.map((radius) => (_jsx(Progress, { value: 60, scale: "xl", cornerRadius: radius }, radius))) })),
98
+ };
99
+ export const Striped = {
100
+ render: () => (_jsx(Stack, { spacing: "md", children: _jsx(Progress, { value: 55, scale: "xl", cornerRadius: "xl", striped: true }) })),
101
+ };
102
+ export const WithLabel = {
103
+ args: {
104
+ value: 70,
105
+ scale: 'xl',
106
+ cornerRadius: 'xl',
107
+ label: '70%',
108
+ },
109
+ };
110
+ export const Data = {
111
+ render: () => (_jsx(Progress, { scale: "xl", cornerRadius: "xl", data: [
112
+ { value: 35, color: primary[200], label: '35%' },
113
+ { value: 25, color: success[200], label: '25%' },
114
+ { value: 30, color: purple[200], label: '30%' },
115
+ ] })),
116
+ };
117
+ export const WithTooltips = {
118
+ render: () => (_jsx(Progress, { scale: "xl", cornerRadius: "xl", data: [
119
+ {
120
+ value: 40,
121
+ color: primary[200],
122
+ label: '40%',
123
+ tooltip: 'Completed tasks — 40%',
124
+ },
125
+ {
126
+ value: 35,
127
+ color: success[200],
128
+ label: '35%',
129
+ tooltip: 'In progress — 35%',
130
+ },
131
+ {
132
+ value: 25,
133
+ color: purple[200],
134
+ label: '25%',
135
+ tooltip: 'Remaining — 25%',
136
+ },
137
+ ] })),
138
+ };
139
+ export const Width = {
140
+ args: {
141
+ value: 45,
142
+ scale: 'xl',
143
+ cornerRadius: 'xl',
144
+ width: '24rem',
145
+ },
146
+ };
@@ -6,6 +6,7 @@ export { PieChartCard } from './Data/Cards/PieChartCard/PieChartCard';
6
6
  export { RemovableItemList } from './Data/RemovableItemList/RemovableItemList';
7
7
  export { StatsCard } from './Data/Cards/StatsCard/StatsCard';
8
8
  export { StatsBadge } from './Data/StatsBadge/StatsBadge';
9
+ export { Progress } from './Data/Progress/Progress';
9
10
  export { Modal } from './Info/Modals/Modal/Modal';
10
11
  export { FormModal } from './Info/Modals/FormModal/FormModal';
11
12
  export { ModalProvider } from './Info/Modals/ModalProvider/ModalProvider';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OA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,4BAA4B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC"}
@@ -7,6 +7,7 @@ export { PieChartCard } from './Data/Cards/PieChartCard/PieChartCard';
7
7
  export { RemovableItemList } from './Data/RemovableItemList/RemovableItemList';
8
8
  export { StatsCard } from './Data/Cards/StatsCard/StatsCard';
9
9
  export { StatsBadge } from './Data/StatsBadge/StatsBadge';
10
+ export { Progress } from './Data/Progress/Progress';
10
11
  //Info
11
12
  export { Modal } from './Info/Modals/Modal/Modal';
12
13
  export { FormModal } from './Info/Modals/FormModal/FormModal';
@@ -1,3 +1,4 @@
1
+ import { truncation } from "../constants";
1
2
  export type SelectOption = {
2
3
  value: string;
3
4
  label: string;
@@ -17,4 +18,14 @@ export type ChartSeries = {
17
18
  color?: string;
18
19
  type?: 'line' | 'area' | 'bar';
19
20
  };
21
+ export type ChartFormatOptions = {
22
+ truncateAt?: keyof typeof truncation;
23
+ decimalPlaces?: number;
24
+ };
25
+ export type ProgressDataPoint = {
26
+ value: number;
27
+ color: string;
28
+ label?: string;
29
+ tooltip?: string;
30
+ };
20
31
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,EAAE,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC;CAChC,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,EAAE,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,UAAU,CAAC,EAAE,MAAM,OAAO,UAAU,CAAC;IACrC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC"}
@@ -1,13 +1,8 @@
1
- import { formats, truncation } from '../constants/data';
2
- import { DataPoint } from '../types/types';
3
- interface FormatOptions {
4
- truncateAt?: keyof typeof truncation;
5
- decimalPlaces?: number;
6
- }
7
- export declare const getChartFormatter: (format: keyof typeof formats, options?: FormatOptions) => ((value: string | number) => string);
1
+ import { formats } from '../constants/data';
2
+ import { ChartFormatOptions, DataPoint } from '../types/types';
3
+ export declare const getChartFormatter: (format: keyof typeof formats, options?: ChartFormatOptions) => ((value: string | number) => string);
8
4
  export declare const aggregateDataByDate: (data: DataPoint[]) => {
9
5
  key: string;
10
6
  value: number;
11
7
  }[];
12
- export {};
13
8
  //# sourceMappingURL=charts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"charts.d.ts","sourceRoot":"","sources":["../../src/utils/charts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAiB,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,UAAU,aAAa;IACrB,UAAU,CAAC,EAAE,MAAM,OAAO,UAAU,CAAC;IACrC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAeD,eAAO,MAAM,iBAAiB,GAAI,QAAQ,MAAM,OAAO,OAAO,EAAE,UAAU,aAAa,KAAG,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,KAAK,MAAM,CAa5H,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,MAAM,SAAS,EAAE;;;GAmBpD,CAAC"}
1
+ {"version":3,"file":"charts.d.ts","sourceRoot":"","sources":["../../src/utils/charts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAA6B,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAe/D,eAAO,MAAM,iBAAiB,GAAI,QAAQ,MAAM,OAAO,OAAO,EAAE,UAAU,kBAAkB,KAAG,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,KAAK,MAAM,CAajI,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,MAAM,SAAS,EAAE;;;GAmBpD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taiv/ui",
3
- "version": "1.10.9",
3
+ "version": "1.11.0",
4
4
  "author": "Taiv",
5
5
  "description": "Taiv's web UI Toolkit built on Mantine v6",
6
6
  "main": "dist/index.js",