@taiv/ui 1.10.10 → 1.12.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.
- package/dist/components/Data/PieChart/PieChart.js +2 -2
- package/dist/components/Data/PieChart/PieChart.stories.d.ts +14 -0
- package/dist/components/Data/PieChart/PieChart.stories.d.ts.map +1 -0
- package/dist/components/Data/PieChart/PieChart.stories.js +121 -0
- package/dist/components/Data/Progress/Progress.d.ts +10 -0
- package/dist/components/Data/Progress/Progress.d.ts.map +1 -0
- package/dist/components/Data/Progress/Progress.js +8 -0
- package/dist/components/Data/Progress/Progress.stories.d.ts +15 -0
- package/dist/components/Data/Progress/Progress.stories.d.ts.map +1 -0
- package/dist/components/Data/Progress/Progress.stories.js +146 -0
- package/dist/components/Inputs/Controls/SegmentedControl/SegmentedControl.d.ts +26 -0
- package/dist/components/Inputs/Controls/SegmentedControl/SegmentedControl.d.ts.map +1 -0
- package/dist/components/Inputs/Controls/SegmentedControl/SegmentedControl.js +41 -0
- package/dist/components/Inputs/Controls/SegmentedControl/SegmentedControl.stories.d.ts +13 -0
- package/dist/components/Inputs/Controls/SegmentedControl/SegmentedControl.stories.d.ts.map +1 -0
- package/dist/components/Inputs/Controls/SegmentedControl/SegmentedControl.stories.js +231 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +2 -0
- package/dist/types/types.d.ts +6 -0
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -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 =
|
|
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
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SegmentedControlProps as MantineSegmentedControlProps } from '@mantine/core';
|
|
2
|
+
import { CSSObject } from '@mantine/styles';
|
|
3
|
+
declare const componentSizes: {
|
|
4
|
+
readonly sm: {
|
|
5
|
+
readonly fontSize: string;
|
|
6
|
+
readonly lineHeight: string;
|
|
7
|
+
readonly mantineSize: "md";
|
|
8
|
+
};
|
|
9
|
+
readonly md: {
|
|
10
|
+
readonly fontSize: string;
|
|
11
|
+
readonly lineHeight: string;
|
|
12
|
+
readonly mantineSize: "lg";
|
|
13
|
+
};
|
|
14
|
+
readonly lg: {
|
|
15
|
+
readonly fontSize: string;
|
|
16
|
+
readonly lineHeight: string;
|
|
17
|
+
readonly mantineSize: "xl";
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
interface SegmentedControlProps extends Omit<MantineSegmentedControlProps, 'size'> {
|
|
21
|
+
size?: keyof typeof componentSizes;
|
|
22
|
+
styles?: Record<string, CSSObject>;
|
|
23
|
+
}
|
|
24
|
+
declare const SegmentedControl: ({ styles, size, color, ...props }: SegmentedControlProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export { SegmentedControl };
|
|
26
|
+
//# sourceMappingURL=SegmentedControl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegmentedControl.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/Controls/SegmentedControl/SegmentedControl.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,qBAAqB,IAAI,4BAA4B,EACtD,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;CAIV,CAAC;AAEX,UAAU,qBAAsB,SAAQ,IAAI,CAAC,4BAA4B,EAAE,MAAM,CAAC;IAChF,IAAI,CAAC,EAAE,MAAM,OAAO,cAAc,CAAC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CACpC;AAED,QAAA,MAAM,gBAAgB,GAAI,mCAA0C,qBAAqB,4CA+BxF,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { SegmentedControl as MantineSegmentedControl, } from '@mantine/core';
|
|
3
|
+
import { primary, neutral, white } from '../../../../constants/colors';
|
|
4
|
+
import { fontBase, fontSize, fontWeight } from '../../../../constants/font';
|
|
5
|
+
const componentSizes = {
|
|
6
|
+
sm: { mantineSize: 'md', ...fontSize['xs'] },
|
|
7
|
+
md: { mantineSize: 'lg', ...fontSize['sm'] },
|
|
8
|
+
lg: { mantineSize: 'xl', ...fontSize['md'] },
|
|
9
|
+
};
|
|
10
|
+
const SegmentedControl = ({ styles, size = 'md', color, ...props }) => {
|
|
11
|
+
const selectedSize = componentSizes[size];
|
|
12
|
+
const style = {
|
|
13
|
+
root: {
|
|
14
|
+
backgroundColor: neutral[50],
|
|
15
|
+
},
|
|
16
|
+
controlActive: {
|
|
17
|
+
backgroundColor: white,
|
|
18
|
+
},
|
|
19
|
+
label: {
|
|
20
|
+
...fontBase,
|
|
21
|
+
fontSize: selectedSize.fontSize,
|
|
22
|
+
'&:not([data-active])': {
|
|
23
|
+
color: neutral[200],
|
|
24
|
+
},
|
|
25
|
+
'&[data-active]': {
|
|
26
|
+
'&, &:hover': {
|
|
27
|
+
color: primary[200],
|
|
28
|
+
fontWeight: fontWeight.semibold,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
control: {
|
|
33
|
+
'&:not(:first-of-type)': {
|
|
34
|
+
borderColor: neutral[100],
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
...styles,
|
|
38
|
+
};
|
|
39
|
+
return _jsx(MantineSegmentedControl, { radius: 'md', color: color, size: selectedSize.mantineSize, styles: style, transitionTimingFunction: 'linear', transitionDuration: 300, ...props });
|
|
40
|
+
};
|
|
41
|
+
export { SegmentedControl };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { SegmentedControl } from './SegmentedControl';
|
|
3
|
+
declare const meta: Meta<typeof SegmentedControl>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Sizes: Story;
|
|
8
|
+
export declare const StringData: Story;
|
|
9
|
+
export declare const States: Story;
|
|
10
|
+
export declare const FullWidth: Story;
|
|
11
|
+
export declare const Orientation: Story;
|
|
12
|
+
export declare const CustomStyles: Story;
|
|
13
|
+
//# sourceMappingURL=SegmentedControl.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegmentedControl.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/Controls/SegmentedControl/SegmentedControl.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAUtD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,gBAAgB,CAkHvC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KA8BrB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAenB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAWxB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAwBpB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAavB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAczB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KA2B1B,CAAC"}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { SegmentedControl } from './SegmentedControl';
|
|
4
|
+
import { Group } from '../../../Layout/Group/Group';
|
|
5
|
+
import { Stack } from '../../../Layout/Stack/Stack';
|
|
6
|
+
const sampleData = [
|
|
7
|
+
{ label: 'React', value: 'react' },
|
|
8
|
+
{ label: 'Angular', value: 'ng' },
|
|
9
|
+
{ label: 'Vue', value: 'vue' },
|
|
10
|
+
];
|
|
11
|
+
const meta = {
|
|
12
|
+
title: 'Components/Inputs/Controls/SegmentedControl',
|
|
13
|
+
component: SegmentedControl,
|
|
14
|
+
parameters: {
|
|
15
|
+
layout: 'centered',
|
|
16
|
+
},
|
|
17
|
+
argTypes: {
|
|
18
|
+
size: {
|
|
19
|
+
control: { type: 'select' },
|
|
20
|
+
options: ['sm', 'md', 'lg'],
|
|
21
|
+
description: 'Controls segment padding and label font size',
|
|
22
|
+
table: {
|
|
23
|
+
type: { summary: "'sm' | 'md' | 'lg'" },
|
|
24
|
+
defaultValue: { summary: "'md'" },
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
data: {
|
|
28
|
+
control: { type: 'object' },
|
|
29
|
+
description: 'Segments as strings or { value, label, disabled? } objects',
|
|
30
|
+
table: {
|
|
31
|
+
type: { summary: "string[] | SegmentedControlItem[]" },
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
value: {
|
|
35
|
+
control: { type: 'text' },
|
|
36
|
+
description: 'Selected segment value (controlled)',
|
|
37
|
+
table: {
|
|
38
|
+
type: { summary: 'string' },
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
defaultValue: {
|
|
42
|
+
control: { type: 'text' },
|
|
43
|
+
description: 'Default value when uncontrolled',
|
|
44
|
+
table: {
|
|
45
|
+
type: { summary: 'string' },
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
disabled: {
|
|
49
|
+
control: { type: 'boolean' },
|
|
50
|
+
description: 'Disables the entire control',
|
|
51
|
+
table: {
|
|
52
|
+
type: { summary: 'boolean' },
|
|
53
|
+
defaultValue: { summary: 'false' },
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
fullWidth: {
|
|
57
|
+
control: { type: 'boolean' },
|
|
58
|
+
description: 'Stretch to 100% of the container width',
|
|
59
|
+
table: {
|
|
60
|
+
type: { summary: 'boolean' },
|
|
61
|
+
defaultValue: { summary: 'false' },
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
orientation: {
|
|
65
|
+
control: { type: 'select' },
|
|
66
|
+
options: ['horizontal', 'vertical'],
|
|
67
|
+
description: 'Layout direction of segments',
|
|
68
|
+
table: {
|
|
69
|
+
type: { summary: "'horizontal' | 'vertical'" },
|
|
70
|
+
defaultValue: { summary: "'horizontal'" },
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
readOnly: {
|
|
74
|
+
control: { type: 'boolean' },
|
|
75
|
+
description: 'Non-interactive but not visually disabled',
|
|
76
|
+
table: {
|
|
77
|
+
type: { summary: 'boolean' },
|
|
78
|
+
defaultValue: { summary: 'false' },
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
color: {
|
|
82
|
+
control: { type: 'color' },
|
|
83
|
+
description: 'Active segment color (Mantine color key or CSS color)',
|
|
84
|
+
table: {
|
|
85
|
+
type: { summary: 'MantineColor' },
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
radius: {
|
|
89
|
+
control: { type: 'text' },
|
|
90
|
+
description: 'Border radius (theme key or CSS value)',
|
|
91
|
+
table: {
|
|
92
|
+
type: { summary: "MantineNumberSize" },
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
transitionDuration: {
|
|
96
|
+
control: { type: 'number' },
|
|
97
|
+
description: 'Transition duration in ms (0 to disable)',
|
|
98
|
+
table: {
|
|
99
|
+
type: { summary: 'number' },
|
|
100
|
+
defaultValue: { summary: '200' },
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
name: {
|
|
104
|
+
control: { type: 'text' },
|
|
105
|
+
description: 'Name attribute for the underlying radio group',
|
|
106
|
+
table: {
|
|
107
|
+
type: { summary: 'string' },
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
styles: {
|
|
111
|
+
control: { type: 'object' },
|
|
112
|
+
description: 'Custom styles object (Mantine Styles API)',
|
|
113
|
+
table: {
|
|
114
|
+
type: { summary: 'Record<string, CSSObject>' },
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
onChange: {
|
|
118
|
+
action: 'changed',
|
|
119
|
+
description: 'Called with the new value when selection changes',
|
|
120
|
+
table: {
|
|
121
|
+
type: { summary: '(value: string) => void' },
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
};
|
|
126
|
+
export default meta;
|
|
127
|
+
export const Default = {
|
|
128
|
+
render: (args) => {
|
|
129
|
+
var _a, _b;
|
|
130
|
+
const [value, setValue] = useState((_a = args.value) !== null && _a !== void 0 ? _a : 'react');
|
|
131
|
+
return _jsx(SegmentedControl, { ...args, data: (_b = args.data) !== null && _b !== void 0 ? _b : sampleData, value: value, onChange: setValue });
|
|
132
|
+
},
|
|
133
|
+
args: {
|
|
134
|
+
data: sampleData,
|
|
135
|
+
size: 'md',
|
|
136
|
+
disabled: false,
|
|
137
|
+
fullWidth: false,
|
|
138
|
+
orientation: 'horizontal',
|
|
139
|
+
readOnly: false,
|
|
140
|
+
},
|
|
141
|
+
parameters: {
|
|
142
|
+
docs: {
|
|
143
|
+
source: {
|
|
144
|
+
code: `const [value, setValue] = useState('react');
|
|
145
|
+
|
|
146
|
+
<SegmentedControl
|
|
147
|
+
data={[
|
|
148
|
+
{ label: 'React', value: 'react' },
|
|
149
|
+
{ label: 'Angular', value: 'ng' },
|
|
150
|
+
{ label: 'Vue', value: 'vue' },
|
|
151
|
+
]}
|
|
152
|
+
value={value}
|
|
153
|
+
onChange={setValue}
|
|
154
|
+
/>`,
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
};
|
|
159
|
+
export const Sizes = {
|
|
160
|
+
render: () => (_jsxs(Stack, { gap: "1.6rem", children: [_jsx(SegmentedControl, { size: "sm", data: sampleData, value: "react", onChange: () => { } }), _jsx(SegmentedControl, { size: "md", data: sampleData, value: "ng", onChange: () => { } }), _jsx(SegmentedControl, { size: "lg", data: sampleData, value: "vue", onChange: () => { } })] })),
|
|
161
|
+
parameters: {
|
|
162
|
+
docs: {
|
|
163
|
+
source: {
|
|
164
|
+
code: false,
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
};
|
|
169
|
+
export const StringData = {
|
|
170
|
+
render: () => (_jsx(SegmentedControl, { data: ['Day', 'Week', 'Month', 'Year'], value: "Week", onChange: () => { } })),
|
|
171
|
+
parameters: {
|
|
172
|
+
docs: {
|
|
173
|
+
source: {
|
|
174
|
+
code: false,
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
};
|
|
179
|
+
export const States = {
|
|
180
|
+
render: () => (_jsxs(Stack, { gap: "1.6rem", style: { minWidth: '28rem' }, children: [_jsx(SegmentedControl, { data: sampleData, value: "react", onChange: () => { } }), _jsx(SegmentedControl, { data: sampleData, value: "react", onChange: () => { }, disabled: true }), _jsx(SegmentedControl, { data: [
|
|
181
|
+
{ value: 'preview', label: 'Preview', disabled: true },
|
|
182
|
+
{ value: 'code', label: 'Code' },
|
|
183
|
+
{ value: 'export', label: 'Export' },
|
|
184
|
+
], value: "code", onChange: () => { } }), _jsx(SegmentedControl, { data: sampleData, value: "vue", onChange: () => { }, readOnly: true })] })),
|
|
185
|
+
parameters: {
|
|
186
|
+
docs: {
|
|
187
|
+
source: {
|
|
188
|
+
code: false,
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
};
|
|
193
|
+
export const FullWidth = {
|
|
194
|
+
render: () => (_jsx("div", { style: { width: '36rem', maxWidth: '100%' }, children: _jsx(SegmentedControl, { fullWidth: true, data: sampleData, value: "react", onChange: () => { } }) })),
|
|
195
|
+
parameters: {
|
|
196
|
+
docs: {
|
|
197
|
+
source: {
|
|
198
|
+
code: false,
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
};
|
|
203
|
+
export const Orientation = {
|
|
204
|
+
render: () => (_jsxs(Group, { gap: "3rem", align: "flex-start", children: [_jsx(SegmentedControl, { data: sampleData, value: "ng", onChange: () => { }, orientation: "horizontal" }), _jsx(SegmentedControl, { data: sampleData, value: "vue", onChange: () => { }, orientation: "vertical" })] })),
|
|
205
|
+
parameters: {
|
|
206
|
+
docs: {
|
|
207
|
+
source: {
|
|
208
|
+
code: false,
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
};
|
|
213
|
+
export const CustomStyles = {
|
|
214
|
+
render: () => (_jsx(Group, { gap: "2rem", children: _jsx(SegmentedControl, { data: sampleData, value: "react", onChange: () => { }, styles: {
|
|
215
|
+
root: {
|
|
216
|
+
backgroundColor: '#f0f4f8',
|
|
217
|
+
},
|
|
218
|
+
label: {
|
|
219
|
+
'&:not([data-active])': {
|
|
220
|
+
color: '#495057',
|
|
221
|
+
},
|
|
222
|
+
},
|
|
223
|
+
} }) })),
|
|
224
|
+
parameters: {
|
|
225
|
+
docs: {
|
|
226
|
+
source: {
|
|
227
|
+
code: false,
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
};
|
|
@@ -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';
|
|
@@ -23,6 +24,7 @@ export { Checkbox } from './Inputs/Controls/Checkbox/Checkbox';
|
|
|
23
24
|
export { Radio } from './Inputs/Controls/Radio/Radio';
|
|
24
25
|
export { RadioList } from './Inputs/Controls/RadioList/RadioList';
|
|
25
26
|
export { Toggle } from './Inputs/Controls/Toggle/Toggle';
|
|
27
|
+
export { SegmentedControl } from './Inputs/Controls/SegmentedControl/SegmentedControl';
|
|
26
28
|
export { FontSelect } from './Inputs/Dropdowns/FontSelect/FontSelect';
|
|
27
29
|
export { MultiSelect } from './Inputs/Dropdowns/MultiSelect/MultiSelect';
|
|
28
30
|
export { CascadingSelect } from './Inputs/Dropdowns/CascadingSelect/CascadingSelect';
|
|
@@ -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,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,M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MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAG1C,OAAO,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AAClF,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAGvD,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC"}
|
package/dist/components/index.js
CHANGED
|
@@ -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';
|
|
@@ -26,6 +27,7 @@ export { Checkbox } from './Inputs/Controls/Checkbox/Checkbox';
|
|
|
26
27
|
export { Radio } from './Inputs/Controls/Radio/Radio';
|
|
27
28
|
export { RadioList } from './Inputs/Controls/RadioList/RadioList';
|
|
28
29
|
export { Toggle } from './Inputs/Controls/Toggle/Toggle';
|
|
30
|
+
export { SegmentedControl } from './Inputs/Controls/SegmentedControl/SegmentedControl';
|
|
29
31
|
export { FontSelect } from './Inputs/Dropdowns/FontSelect/FontSelect';
|
|
30
32
|
export { MultiSelect } from './Inputs/Dropdowns/MultiSelect/MultiSelect';
|
|
31
33
|
export { CascadingSelect } from './Inputs/Dropdowns/CascadingSelect/CascadingSelect';
|
package/dist/types/types.d.ts
CHANGED
|
@@ -22,4 +22,10 @@ export type ChartFormatOptions = {
|
|
|
22
22
|
truncateAt?: keyof typeof truncation;
|
|
23
23
|
decimalPlaces?: number;
|
|
24
24
|
};
|
|
25
|
+
export type ProgressDataPoint = {
|
|
26
|
+
value: number;
|
|
27
|
+
color: string;
|
|
28
|
+
label?: string;
|
|
29
|
+
tooltip?: string;
|
|
30
|
+
};
|
|
25
31
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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,KA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