@taiv/ui 1.4.5 → 1.4.6
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/Misc/LoadingOverlay/LoadingOverlay.d.ts +5 -0
- package/dist/components/Misc/LoadingOverlay/LoadingOverlay.d.ts.map +1 -0
- package/dist/components/Misc/LoadingOverlay/LoadingOverlay.js +9 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -0
- package/package.json +1 -1
- package/dist/components/Data/JustChart.d.ts +0 -23
- package/dist/components/Data/JustChart.d.ts.map +0 -1
- package/dist/components/Data/JustChart.js +0 -70
- package/dist/components/Data/JustPieChart.d.ts +0 -20
- package/dist/components/Data/JustPieChart.d.ts.map +0 -1
- package/dist/components/Data/JustPieChart.js +0 -63
- package/dist/components/Data/StatsCard.d.ts +0 -17
- package/dist/components/Data/StatsCard.d.ts.map +0 -1
- package/dist/components/Data/StatsCard.js +0 -38
- package/dist/components/Data/shared/chartFormats.d.ts +0 -8
- package/dist/components/Data/shared/chartFormats.d.ts.map +0 -1
- package/dist/components/Data/shared/chartFormats.js +0 -29
- package/dist/components/Data/shared/dataFormats.d.ts +0 -9
- package/dist/components/Data/shared/dataFormats.d.ts.map +0 -1
- package/dist/components/Data/shared/dataFormats.js +0 -20
- package/dist/components/Inputs/Buttons/Button.d.ts +0 -12
- package/dist/components/Inputs/Buttons/Button.d.ts.map +0 -1
- package/dist/components/Inputs/Buttons/Button.js +0 -37
- package/dist/components/Inputs/Buttons/UnstyledButton.d.ts +0 -10
- package/dist/components/Inputs/Buttons/UnstyledButton.d.ts.map +0 -1
- package/dist/components/Inputs/Buttons/UnstyledButton.js +0 -6
- package/dist/components/Inputs/Buttons/shared/sizes.d.ts +0 -25
- package/dist/components/Inputs/Buttons/shared/sizes.d.ts.map +0 -1
- package/dist/components/Inputs/Buttons/shared/sizes.js +0 -7
- package/dist/components/Inputs/Buttons/shared/variants.d.ts +0 -191
- package/dist/components/Inputs/Buttons/shared/variants.d.ts.map +0 -1
- package/dist/components/Inputs/Buttons/shared/variants.js +0 -191
- package/dist/components/Inputs/Controls/Checkbox.d.ts +0 -27
- package/dist/components/Inputs/Controls/Checkbox.d.ts.map +0 -1
- package/dist/components/Inputs/Controls/Checkbox.js +0 -55
- package/dist/components/Inputs/Controls/Radio.d.ts +0 -8
- package/dist/components/Inputs/Controls/Radio.d.ts.map +0 -1
- package/dist/components/Inputs/Controls/Radio.js +0 -43
- package/dist/components/Inputs/Controls/RadioList.d.ts +0 -16
- package/dist/components/Inputs/Controls/RadioList.d.ts.map +0 -1
- package/dist/components/Inputs/Controls/RadioList.js +0 -24
- package/dist/components/Inputs/Controls/Toggle.d.ts +0 -29
- package/dist/components/Inputs/Controls/Toggle.d.ts.map +0 -1
- package/dist/components/Inputs/Controls/Toggle.js +0 -42
- package/dist/components/Inputs/DatePickers/DatePicker.d.ts +0 -12
- package/dist/components/Inputs/DatePickers/DatePicker.d.ts.map +0 -1
- package/dist/components/Inputs/DatePickers/DatePicker.js +0 -71
- package/dist/components/Inputs/Dates/DatePicker.d.ts +0 -12
- package/dist/components/Inputs/Dates/DatePicker.d.ts.map +0 -1
- package/dist/components/Inputs/Dates/DatePicker.js +0 -71
- package/dist/components/Inputs/Dropdowns/CascadingSelect.d.ts +0 -17
- package/dist/components/Inputs/Dropdowns/CascadingSelect.d.ts.map +0 -1
- package/dist/components/Inputs/Dropdowns/CascadingSelect.js +0 -70
- package/dist/components/Inputs/Dropdowns/FontSelect.d.ts +0 -11
- package/dist/components/Inputs/Dropdowns/FontSelect.d.ts.map +0 -1
- package/dist/components/Inputs/Dropdowns/FontSelect.js +0 -48
- package/dist/components/Inputs/Dropdowns/MultiSelect.d.ts +0 -12
- package/dist/components/Inputs/Dropdowns/MultiSelect.d.ts.map +0 -1
- package/dist/components/Inputs/Dropdowns/MultiSelect.js +0 -94
- package/dist/components/Inputs/Dropdowns/NestedSelect.d.ts +0 -17
- package/dist/components/Inputs/Dropdowns/NestedSelect.d.ts.map +0 -1
- package/dist/components/Inputs/Dropdowns/NestedSelect.js +0 -70
- package/dist/components/Inputs/Dropdowns/Select.d.ts +0 -11
- package/dist/components/Inputs/Dropdowns/Select.d.ts.map +0 -1
- package/dist/components/Inputs/Dropdowns/Select.js +0 -62
- package/dist/components/Inputs/Dropdowns/shared/fontSelectList.d.ts +0 -9
- package/dist/components/Inputs/Dropdowns/shared/fontSelectList.d.ts.map +0 -1
- package/dist/components/Inputs/Dropdowns/shared/fontSelectList.js +0 -65
- package/dist/components/Inputs/Sliders/Slider.d.ts +0 -16
- package/dist/components/Inputs/Sliders/Slider.d.ts.map +0 -1
- package/dist/components/Inputs/Sliders/Slider.js +0 -91
- package/dist/components/Inputs/Sliders/VolumeSlider.d.ts +0 -6
- package/dist/components/Inputs/Sliders/VolumeSlider.d.ts.map +0 -1
- package/dist/components/Inputs/Sliders/VolumeSlider.js +0 -37
- package/dist/components/Inputs/TextInputs/AutoComplete.d.ts +0 -11
- package/dist/components/Inputs/TextInputs/AutoComplete.d.ts.map +0 -1
- package/dist/components/Inputs/TextInputs/AutoComplete.js +0 -57
- package/dist/components/Inputs/TextInputs/PasswordInput.d.ts +0 -12
- package/dist/components/Inputs/TextInputs/PasswordInput.d.ts.map +0 -1
- package/dist/components/Inputs/TextInputs/PasswordInput.js +0 -52
- package/dist/components/Inputs/TextInputs/SearchBar.d.ts +0 -7
- package/dist/components/Inputs/TextInputs/SearchBar.d.ts.map +0 -1
- package/dist/components/Inputs/TextInputs/SearchBar.js +0 -23
- package/dist/components/Inputs/TextInputs/TextArea.d.ts +0 -12
- package/dist/components/Inputs/TextInputs/TextArea.d.ts.map +0 -1
- package/dist/components/Inputs/TextInputs/TextArea.js +0 -33
- package/dist/components/Inputs/TextInputs/TextInput.d.ts +0 -12
- package/dist/components/Inputs/TextInputs/TextInput.d.ts.map +0 -1
- package/dist/components/Inputs/TextInputs/TextInput.js +0 -32
- package/dist/components/Layout/AutoGrid.d.ts +0 -8
- package/dist/components/Layout/AutoGrid.d.ts.map +0 -1
- package/dist/components/Layout/AutoGrid.js +0 -6
- package/dist/components/Layout/Box.d.ts +0 -10
- package/dist/components/Layout/Box.d.ts.map +0 -1
- package/dist/components/Layout/Box.js +0 -6
- package/dist/components/Layout/Card.d.ts +0 -8
- package/dist/components/Layout/Card.d.ts.map +0 -1
- package/dist/components/Layout/Card.js +0 -16
- package/dist/components/Layout/Center.d.ts +0 -9
- package/dist/components/Layout/Center.d.ts.map +0 -1
- package/dist/components/Layout/Center.js +0 -6
- package/dist/components/Layout/Divider.d.ts +0 -10
- package/dist/components/Layout/Divider.d.ts.map +0 -1
- package/dist/components/Layout/Divider.js +0 -7
- package/dist/components/Layout/Frame.d.ts +0 -12
- package/dist/components/Layout/Frame.d.ts.map +0 -1
- package/dist/components/Layout/Frame.js +0 -7
- package/dist/components/Layout/Grid.d.ts +0 -10
- package/dist/components/Layout/Grid.d.ts.map +0 -1
- package/dist/components/Layout/Grid.js +0 -9
- package/dist/components/Layout/Group.d.ts +0 -10
- package/dist/components/Layout/Group.d.ts.map +0 -1
- package/dist/components/Layout/Group.js +0 -6
- package/dist/components/Layout/Loader.d.ts +0 -8
- package/dist/components/Layout/Loader.d.ts.map +0 -1
- package/dist/components/Layout/Loader.js +0 -6
- package/dist/components/Layout/SectionCard.d.ts +0 -11
- package/dist/components/Layout/SectionCard.d.ts.map +0 -1
- package/dist/components/Layout/SectionCard.js +0 -13
- package/dist/components/Layout/Stack.d.ts +0 -10
- package/dist/components/Layout/Stack.d.ts.map +0 -1
- package/dist/components/Layout/Stack.js +0 -6
- package/dist/components/Layout/Tabs.d.ts +0 -17
- package/dist/components/Layout/Tabs.d.ts.map +0 -1
- package/dist/components/Layout/Tabs.js +0 -48
- package/dist/components/Misc/IconBadge.d.ts +0 -8
- package/dist/components/Misc/IconBadge.d.ts.map +0 -1
- package/dist/components/Misc/IconBadge.js +0 -28
- package/dist/components/Misc/Transition.d.ts +0 -4
- package/dist/components/Misc/Transition.d.ts.map +0 -1
- package/dist/components/Misc/Transition.js +0 -6
- package/dist/hooks/useDropdowns.d.ts +0 -9
- package/dist/hooks/useDropdowns.d.ts.map +0 -1
- package/dist/hooks/useDropdowns.js +0 -12
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { LoadingOverlayProps as MantineLoadingOverlayProps } from '@mantine/core';
|
|
2
|
+
export interface LoadingOverlayProps extends MantineLoadingOverlayProps {
|
|
3
|
+
}
|
|
4
|
+
export declare const LoadingOverlay: ({ ...props }: LoadingOverlayProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
//# sourceMappingURL=LoadingOverlay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoadingOverlay.d.ts","sourceRoot":"","sources":["../../../../src/components/Misc/LoadingOverlay/LoadingOverlay.tsx"],"names":[],"mappings":"AAGA,OAAO,EAA2C,mBAAmB,IAAI,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAE3H,MAAM,WAAW,mBAAoB,SAAQ,0BAA0B;CACtE;AAGD,eAAO,MAAM,cAAc,GAAI,cAAe,mBAAmB,4CAYhE,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { primary } from '../../../constants';
|
|
3
|
+
import { LoadingOverlay as MantineLoadingOverlay } from '@mantine/core';
|
|
4
|
+
export const LoadingOverlay = ({ ...props }) => {
|
|
5
|
+
return _jsx(MantineLoadingOverlay, { ...props, overlayBlur: 3, overlayOpacity: 0.5, loaderProps: {
|
|
6
|
+
size: 'xl',
|
|
7
|
+
color: `${primary[200]}`,
|
|
8
|
+
} });
|
|
9
|
+
};
|
|
@@ -51,4 +51,5 @@ export { Fraction } from './Typography/Fraction';
|
|
|
51
51
|
export { Formula } from './Typography/Formula';
|
|
52
52
|
export { Transition } from './Misc/Transition/Transition';
|
|
53
53
|
export { IconBadge } from './Misc/IconBadge/IconBadge';
|
|
54
|
+
export { LoadingOverlay } from './Misc/LoadingOverlay/LoadingOverlay';
|
|
54
55
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG/C,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAG3C,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAC7E,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAC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B,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAG1C,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAG/C,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC"}
|
package/dist/components/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { formats } from '../../constants/data';
|
|
3
|
-
export interface ChartDataPoint {
|
|
4
|
-
date: string | number;
|
|
5
|
-
value: number;
|
|
6
|
-
label?: string;
|
|
7
|
-
}
|
|
8
|
-
export interface ChartSeries {
|
|
9
|
-
name: string;
|
|
10
|
-
data: ChartDataPoint[];
|
|
11
|
-
color?: string;
|
|
12
|
-
type?: 'line' | 'area' | 'bar';
|
|
13
|
-
}
|
|
14
|
-
export interface ChartProps {
|
|
15
|
-
series: ChartSeries[];
|
|
16
|
-
height?: string | number;
|
|
17
|
-
yAxisFormat?: keyof typeof formats;
|
|
18
|
-
xAxisFormat?: keyof typeof formats;
|
|
19
|
-
showLegend?: boolean;
|
|
20
|
-
loading?: boolean;
|
|
21
|
-
}
|
|
22
|
-
export declare const Chart: React.FC<ChartProps>;
|
|
23
|
-
//# sourceMappingURL=JustChart.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"JustChart.d.ts","sourceRoot":"","sources":["../../../src/components/Data/JustChart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAK/C,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,cAAc,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC;CAChC;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,OAAO,OAAO,CAAC;IACnC,WAAW,CAAC,EAAE,MAAM,OAAO,OAAO,CAAC;IACnC,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,70 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { Text } from '../Typography/Text';
|
|
3
|
-
import { Center } from '../Layout/Center';
|
|
4
|
-
import { primary, neutral } from '../../constants/colors';
|
|
5
|
-
import { Area, Bar, CartesianGrid, ComposedChart, Legend, Line, ResponsiveContainer, Tooltip, XAxis, YAxis } from 'recharts';
|
|
6
|
-
import { Group } from '../Layout/Group';
|
|
7
|
-
import { getChartFormat } from './shared/dataFormats';
|
|
8
|
-
import { Box } from '../Layout/Box';
|
|
9
|
-
import { Stack } from '../Layout/Stack';
|
|
10
|
-
export const Chart = ({ series, height = 300, yAxisFormat = 'decimal', xAxisFormat = 'string', showLegend = true, loading = false }) => {
|
|
11
|
-
var _a;
|
|
12
|
-
const formatYAxisValue = getChartFormat[yAxisFormat];
|
|
13
|
-
const formatXAxisValue = (value) => value.toString();
|
|
14
|
-
// Transform data to match Recharts format
|
|
15
|
-
// TODO: This is a hack to get the data in the correct format - we should use the data in the correct format from the start
|
|
16
|
-
const chartData = (_a = series[0]) === null || _a === void 0 ? void 0 : _a.data.map((point, index) => {
|
|
17
|
-
const dataPoint = { date: point.date };
|
|
18
|
-
series.forEach((s) => {
|
|
19
|
-
if (s.data[index]) {
|
|
20
|
-
dataPoint[s.name] = s.data[index].value;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
return dataPoint;
|
|
24
|
-
});
|
|
25
|
-
const hasData = series.some((s) => s.data.length > 0);
|
|
26
|
-
// Single reusable tick component
|
|
27
|
-
const CustomTick = ({ x, y, payload, formatter }) => {
|
|
28
|
-
return (_jsx("g", { transform: `translate(${x},${y})`, children: _jsx("foreignObject", { x: 0, y: 0, width: 100, height: 20, children: _jsx("div", { style: { display: 'flex', justifyContent: 'center', alignItems: 'center', height: '100%' }, children: _jsx(Text, { variant: "label", children: formatter(payload.value) }) }) }) }));
|
|
29
|
-
};
|
|
30
|
-
const getTooltipContent = (props) => {
|
|
31
|
-
const { active, payload, label } = props;
|
|
32
|
-
if (active && payload && payload.length) {
|
|
33
|
-
return (_jsx(Box, { sx: {
|
|
34
|
-
backgroundColor: 'white',
|
|
35
|
-
padding: '1rem',
|
|
36
|
-
border: `1px solid ${neutral[100]}`,
|
|
37
|
-
borderRadius: '8px',
|
|
38
|
-
boxShadow: '0 2px 8px rgba(0,0,0,0.1)',
|
|
39
|
-
}, children: _jsxs(Stack, { gap: "0.25rem", children: [_jsx(Text, { weight: "semibold", color: neutral[300], children: formatXAxisValue(label) }), payload.map((entry) => (_jsxs(Group, { gap: "0.5rem", children: [_jsx("div", { style: {
|
|
40
|
-
width: '8px',
|
|
41
|
-
height: '8px',
|
|
42
|
-
borderRadius: '50%',
|
|
43
|
-
backgroundColor: entry.color,
|
|
44
|
-
} }), _jsxs(Group, { gap: "0.25rem", children: [_jsxs(Text, { variant: "label", color: neutral[300], children: [entry.name, ":"] }), _jsx(Text, { variant: "label", children: formatYAxisValue(entry.value) })] })] }, entry.name)))] }) }));
|
|
45
|
-
}
|
|
46
|
-
return null;
|
|
47
|
-
};
|
|
48
|
-
return (_jsx(_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' }) })) : (_jsxs(_Fragment, { children: [_jsx(Center, { style: { height, width: '100%' }, children: _jsx(ResponsiveContainer, { width: "100%", height: "100%", children: _jsxs(ComposedChart, { data: chartData, children: [_jsx("defs", { children: series.map((s, index) => (_jsxs("linearGradient", { id: `gradient-${index}`, x1: "0", y1: "0", x2: "0", y2: "1", children: [_jsx("stop", { offset: "0%", stopColor: s.color || primary[200], stopOpacity: 0.3 }), _jsx("stop", { offset: "99%", stopColor: s.color || primary[200], stopOpacity: 0.05 })] }, s.name))) }), _jsx(XAxis, { dataKey: "date", axisLine: { stroke: neutral[50] }, tickLine: { stroke: neutral[50] }, tick: (props) => _jsx(CustomTick, { ...props, formatter: formatXAxisValue }) }), _jsx(YAxis, { width: 40, axisLine: false, tickLine: false, tick: (props) => _jsx(CustomTick, { ...props, formatter: formatYAxisValue }) }), _jsx(CartesianGrid, { strokeDasharray: "0", stroke: neutral[50], horizontal: true, vertical: false }), series.map((s, index) => {
|
|
49
|
-
const seriesType = s.type || 'line';
|
|
50
|
-
if (seriesType === 'area') {
|
|
51
|
-
return (_jsx(Area, { type: "monotone", dataKey: s.name, stroke: s.color || primary[200], strokeWidth: 2, fill: `url(#gradient-${index})`, baseValue: "dataMin", style: { outline: 'none' } }, s.name));
|
|
52
|
-
}
|
|
53
|
-
else if (seriesType === 'bar') {
|
|
54
|
-
return (_jsx(Bar, { dataKey: s.name, fill: s.color || primary[200], radius: [8, 8, 0, 0], style: { outline: 'none' }, onMouseEnter: (data, index, event) => {
|
|
55
|
-
const barElement = event.target;
|
|
56
|
-
if (barElement) {
|
|
57
|
-
barElement.style.opacity = '0.8';
|
|
58
|
-
}
|
|
59
|
-
}, onMouseLeave: (data, index, event) => {
|
|
60
|
-
const barElement = event.target;
|
|
61
|
-
if (barElement) {
|
|
62
|
-
barElement.style.opacity = '1';
|
|
63
|
-
}
|
|
64
|
-
} }, s.name));
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
67
|
-
return _jsx(Line, { type: "monotone", dataKey: s.name, stroke: s.color || primary[200], strokeWidth: 2, dot: false, style: { outline: 'none' } }, s.name);
|
|
68
|
-
}
|
|
69
|
-
}), _jsx(Tooltip, { content: getTooltipContent, cursor: series.some((s) => s.type === 'bar') ? false : true }), showLegend && (_jsx(Legend, { iconType: "circle", iconSize: 8, formatter: (value) => (_jsx(Text, { variant: "label", sx: { color: neutral[300], display: 'inline', whiteSpace: 'nowrap' }, children: value })) }))] }) }) }), _jsx("style", { children: `.recharts-surface { outline: none; }` })] })) }));
|
|
70
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { numberFormats } from '../../constants/data';
|
|
3
|
-
export interface PieChartDataPoint {
|
|
4
|
-
name: string;
|
|
5
|
-
value: number;
|
|
6
|
-
color?: string;
|
|
7
|
-
}
|
|
8
|
-
export interface JustPieChartProps {
|
|
9
|
-
data: PieChartDataPoint[];
|
|
10
|
-
height?: string | number;
|
|
11
|
-
showLegend?: boolean;
|
|
12
|
-
innerRadius?: number;
|
|
13
|
-
outerRadius?: number;
|
|
14
|
-
paddingAngle?: number;
|
|
15
|
-
format?: keyof typeof numberFormats;
|
|
16
|
-
loading?: boolean;
|
|
17
|
-
centerTitle?: string;
|
|
18
|
-
}
|
|
19
|
-
export declare const JustPieChart: React.FC<JustPieChartProps>;
|
|
20
|
-
//# sourceMappingURL=JustPieChart.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"JustPieChart.d.ts","sourceRoot":"","sources":["../../../src/components/Data/JustPieChart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,iBAAiB,EAAE,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,OAAO,aAAa,CAAC;IACpC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA+IpD,CAAC"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { Text } from '../Typography/Text';
|
|
3
|
-
import { Center } from '../Layout/Center';
|
|
4
|
-
import { Group } from '../Layout/Group';
|
|
5
|
-
import { neutral } from '../../constants/colors';
|
|
6
|
-
import { PieChart as RechartsPieChart, Pie, Cell, ResponsiveContainer, Tooltip, Legend } from 'recharts';
|
|
7
|
-
import { Title } from '../Typography/Title';
|
|
8
|
-
import { Stack } from '../Layout/Stack';
|
|
9
|
-
import { getChartFormatter } from './shared/chartFormats';
|
|
10
|
-
export const JustPieChart = ({ data, height = '30rem', showLegend = true, innerRadius = 80, outerRadius = 100, paddingAngle = 5, format = 'decimal', loading = false, centerTitle, }) => {
|
|
11
|
-
const hasData = data && data.length > 0;
|
|
12
|
-
const totalValue = hasData ? data.reduce((sum, item) => sum + item.value, 0) : 0;
|
|
13
|
-
const firstDataPoint = hasData ? data[0] : null;
|
|
14
|
-
const firstDataPercentage = firstDataPoint && totalValue > 0 ? Math.round((firstDataPoint.value / totalValue) * 100) : 0;
|
|
15
|
-
const valueFormatter = (value) => getChartFormatter(format)(value);
|
|
16
|
-
// Custom tooltip component
|
|
17
|
-
const CustomTooltip = ({ active, payload, label }) => {
|
|
18
|
-
if (active && payload && payload.length) {
|
|
19
|
-
return (_jsxs("div", { style: {
|
|
20
|
-
backgroundColor: 'white',
|
|
21
|
-
padding: '10px',
|
|
22
|
-
border: `1px solid ${neutral[100]}`,
|
|
23
|
-
borderRadius: '8px',
|
|
24
|
-
boxShadow: '0 2px 8px rgba(0,0,0,0.1)',
|
|
25
|
-
zIndex: 1000,
|
|
26
|
-
position: 'relative',
|
|
27
|
-
}, children: [_jsx(Text, { weight: "semibold", color: neutral[300], children: label }), payload.map((entry) => (_jsxs(Group, { children: [_jsx("div", { style: {
|
|
28
|
-
width: '8px',
|
|
29
|
-
height: '8px',
|
|
30
|
-
borderRadius: '50%',
|
|
31
|
-
backgroundColor: entry.payload.color,
|
|
32
|
-
} }), _jsxs(Group, { gap: "0.25rem", children: [_jsxs(Text, { variant: "label", color: neutral[300], children: [entry.payload.name, ":"] }), _jsx(Text, { variant: "label", children: valueFormatter(entry.payload.value) })] })] }, entry.name)))] }));
|
|
33
|
-
}
|
|
34
|
-
return null;
|
|
35
|
-
};
|
|
36
|
-
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' }) })) : (_jsxs(Center, { style: { height, width: '100%', position: 'relative' }, children: [_jsx(ResponsiveContainer, { width: "100%", height: "100%", style: { outline: 'none' }, children: _jsxs(RechartsPieChart, { style: { outline: 'none' }, children: [_jsx(Pie, { data: data, innerRadius: innerRadius, outerRadius: outerRadius, paddingAngle: paddingAngle, dataKey: "value", style: { outline: 'none' }, children: data.map((entry, index) => (_jsx(Cell, { fill: entry.color, style: { outline: 'none' } }, `cell-${entry.name}`))) }), _jsx(Tooltip, { content: _jsx(CustomTooltip, {}), wrapperStyle: {
|
|
37
|
-
border: 'none',
|
|
38
|
-
outline: 'none',
|
|
39
|
-
boxShadow: 'none',
|
|
40
|
-
zIndex: 1000,
|
|
41
|
-
}, contentStyle: {
|
|
42
|
-
border: 'none',
|
|
43
|
-
outline: 'none',
|
|
44
|
-
boxShadow: 'none',
|
|
45
|
-
padding: 0,
|
|
46
|
-
margin: 0,
|
|
47
|
-
backgroundColor: 'transparent',
|
|
48
|
-
} }), showLegend && (_jsx(Legend, { iconType: "circle", iconSize: 8, style: {
|
|
49
|
-
marginTop: '1rem',
|
|
50
|
-
}, formatter: (value) => (_jsx(Text, { variant: "label", style: {
|
|
51
|
-
color: neutral[300],
|
|
52
|
-
display: 'inline',
|
|
53
|
-
whiteSpace: 'nowrap',
|
|
54
|
-
}, children: value })) }))] }) }), _jsx(Center, { style: {
|
|
55
|
-
position: 'absolute',
|
|
56
|
-
top: '45%',
|
|
57
|
-
left: '50%',
|
|
58
|
-
transform: 'translate(-50%, -50%)',
|
|
59
|
-
textAlign: 'center',
|
|
60
|
-
zIndex: 1,
|
|
61
|
-
pointerEvents: 'none',
|
|
62
|
-
}, children: _jsxs(Stack, { gap: "0", align: "center", children: [_jsxs(Title, { variant: "cardHeader", color: neutral[300], children: [firstDataPercentage, "%"] }), _jsx(Text, { variant: "label", children: centerTitle })] }) })] })), _jsx("style", { children: `.recharts-surface { outline: none; }` })] }));
|
|
63
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { CardProps } from '../Layout/Card';
|
|
3
|
-
import { primitives } from '../../constants/colors';
|
|
4
|
-
import { dataFormats } from './shared/dataFormats';
|
|
5
|
-
export interface StatsCardProps extends Omit<CardProps, 'children'> {
|
|
6
|
-
value: number;
|
|
7
|
-
title: string;
|
|
8
|
-
description?: string;
|
|
9
|
-
format?: keyof typeof dataFormats;
|
|
10
|
-
isDelta?: boolean;
|
|
11
|
-
icon?: React.ReactNode;
|
|
12
|
-
iconColor?: keyof typeof primitives;
|
|
13
|
-
tooltip?: React.ReactNode;
|
|
14
|
-
increaseDescription?: string;
|
|
15
|
-
}
|
|
16
|
-
export declare const StatsCard: ({ value, format, isDelta, title, description, increaseDescription, icon: Icon, iconColor, tooltip, ...cardProps }: StatsCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
//# sourceMappingURL=StatsCard.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StatsCard.d.ts","sourceRoot":"","sources":["../../../src/components/Data/StatsCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAQ,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAMjD,OAAO,EAAE,UAAU,EAAoB,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGnD,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IACjE,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,OAAO,WAAW,CAAC;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,OAAO,UAAU,CAAC;IACpC,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,eAAO,MAAM,SAAS,GAAI,mHAAgJ,cAAc,4CA4DvL,CAAC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Card } from '../Layout/Card';
|
|
3
|
-
import { InfoTooltip } from '../Info/Tooltips/InfoTooltip';
|
|
4
|
-
import { Text } from '../Typography/Text';
|
|
5
|
-
import { Title } from '../Typography/Title';
|
|
6
|
-
import { Group } from '../Layout/Group';
|
|
7
|
-
import { Stack } from '../Layout/Stack';
|
|
8
|
-
import { success, neutral } from '../../constants/colors';
|
|
9
|
-
import { dataFormats } from './shared/dataFormats';
|
|
10
|
-
import { IconBadge } from '../Misc/IconBadge';
|
|
11
|
-
export const StatsCard = ({ value, format = 'decimal', isDelta = false, title, description, increaseDescription, icon: Icon, iconColor = 'blue', tooltip, ...cardProps }) => {
|
|
12
|
-
const getDelta = () => {
|
|
13
|
-
const currentDirection = isDelta ? (value > 0 ? 'positive' : value < 0 ? 'negative' : null) : null;
|
|
14
|
-
return {
|
|
15
|
-
direction: currentDirection,
|
|
16
|
-
color: currentDirection === 'positive' ? success[200] : currentDirection === 'negative' ? neutral[200] : undefined,
|
|
17
|
-
showIncrementalText: currentDirection === 'positive',
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
const delta = getDelta();
|
|
21
|
-
const formatValue = () => {
|
|
22
|
-
const config = dataFormats[format];
|
|
23
|
-
const formattedNumber = value.toLocaleString('en-US', {
|
|
24
|
-
minimumFractionDigits: config.decimalPlaces,
|
|
25
|
-
maximumFractionDigits: config.decimalPlaces,
|
|
26
|
-
});
|
|
27
|
-
let result = formattedNumber;
|
|
28
|
-
if (delta.direction === 'positive') {
|
|
29
|
-
result = `+${result}`;
|
|
30
|
-
}
|
|
31
|
-
else if (delta.direction === 'negative') {
|
|
32
|
-
result = `-${result}`;
|
|
33
|
-
}
|
|
34
|
-
result = `${config.prefix}${result}${config.suffix}`;
|
|
35
|
-
return result;
|
|
36
|
-
};
|
|
37
|
-
return (_jsx(Card, { bg: neutral[25], animate: true, ...cardProps, children: _jsxs(Stack, { gap: "1.6rem", children: [_jsxs(Stack, { gap: "0.25rem", children: [_jsxs(Group, { position: "apart", children: [_jsx(Title, { size: "3xl", weight: "bold", children: formatValue() }), Icon && _jsx(IconBadge, { icon: Icon, color: iconColor })] }), _jsxs(Group, { gap: "0.75rem", children: [_jsx(Title, { variant: "cardHeader", color: "#6D6D6D", weight: "medium", children: title }), tooltip && _jsx(InfoTooltip, { text: tooltip })] })] }), _jsxs(Stack, { gap: "0", children: [description && _jsx(Text, { variant: "label", children: description }), delta.showIncrementalText && increaseDescription && (_jsx(Text, { variant: "label", color: delta.color, children: increaseDescription }))] })] }) }));
|
|
38
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { formats, truncation } from '../../../constants/data';
|
|
2
|
-
interface FormatOptions {
|
|
3
|
-
truncateAt?: keyof typeof truncation;
|
|
4
|
-
decimalPlaces?: number;
|
|
5
|
-
}
|
|
6
|
-
export declare const getChartFormatter: (format: keyof typeof formats, options?: FormatOptions) => ((value: string | number) => string);
|
|
7
|
-
export {};
|
|
8
|
-
//# sourceMappingURL=chartFormats.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chartFormats.d.ts","sourceRoot":"","sources":["../../../../src/components/Data/shared/chartFormats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAiB,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE7E,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"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { numberFormats, truncation } from '../../../constants/data';
|
|
2
|
-
const formatAndTruncate = (value, format, options) => {
|
|
3
|
-
var _a, _b;
|
|
4
|
-
const absValue = Math.abs(value);
|
|
5
|
-
const config = numberFormats[format];
|
|
6
|
-
const truncateConfig = truncation[(_a = options === null || options === void 0 ? void 0 : options.truncateAt) !== null && _a !== void 0 ? _a : 'thousand'];
|
|
7
|
-
const computedDecimalPlaces = (_b = options === null || options === void 0 ? void 0 : options.decimalPlaces) !== null && _b !== void 0 ? _b : config.decimalPlaces;
|
|
8
|
-
if (absValue >= truncateConfig.threshold) {
|
|
9
|
-
return `${config.prefix}${(value / truncateConfig.threshold).toFixed(1)}${truncateConfig.suffix}${config.suffix}`;
|
|
10
|
-
}
|
|
11
|
-
else {
|
|
12
|
-
return `${config.prefix}${value.toFixed(computedDecimalPlaces)}${config.suffix}`;
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
export const getChartFormatter = (format, options) => {
|
|
16
|
-
if (format === 'string') {
|
|
17
|
-
return (value) => String(value);
|
|
18
|
-
}
|
|
19
|
-
else if (format in numberFormats) {
|
|
20
|
-
return (value) => {
|
|
21
|
-
const numValue = typeof value === 'string' ? parseFloat(value) : value;
|
|
22
|
-
if (isNaN(numValue)) {
|
|
23
|
-
return String(value);
|
|
24
|
-
}
|
|
25
|
-
return formatAndTruncate(numValue, format, options);
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
throw new Error(`Invalid format: ${format}`);
|
|
29
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const getChartFormat: {
|
|
2
|
-
string: (value: string) => string;
|
|
3
|
-
integer: (value: number) => string;
|
|
4
|
-
decimal: (value: number) => string;
|
|
5
|
-
currency: (value: number) => string;
|
|
6
|
-
percentage: (value: number) => string;
|
|
7
|
-
multiple: (value: number) => string;
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=dataFormats.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dataFormats.d.ts","sourceRoot":"","sources":["../../../../src/components/Data/shared/dataFormats.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,cAAc;oBACT,MAAM,KAAG,MAAM;qBACd,MAAM,KAAG,MAAM;qBACf,MAAM,KAAG,MAAM;sBACd,MAAM,KAAG,MAAM;wBACb,MAAM,KAAG,MAAM;sBACjB,MAAM,KAAG,MAAM;CAClC,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { formats, truncation } from '../../../constants/data';
|
|
2
|
-
const formatAndTruncate = (value, format, threshold = 'million') => {
|
|
3
|
-
const absValue = Math.abs(value);
|
|
4
|
-
const config = formats[format];
|
|
5
|
-
const truncateConfig = truncation[threshold];
|
|
6
|
-
if (absValue >= truncateConfig.threshold) {
|
|
7
|
-
return `${config.prefix}${(value / truncateConfig.threshold).toFixed(1)}${truncateConfig.suffix}${config.suffix}`;
|
|
8
|
-
}
|
|
9
|
-
else {
|
|
10
|
-
return `${config.prefix}${value.toFixed(config.decimalPlaces)}${config.suffix}`;
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
export const getChartFormat = {
|
|
14
|
-
string: (value) => value,
|
|
15
|
-
integer: (value) => formatAndTruncate(value, 'integer', 'thousand'),
|
|
16
|
-
decimal: (value) => formatAndTruncate(value, 'decimal', 'thousand'),
|
|
17
|
-
currency: (value) => formatAndTruncate(value, 'currency', 'thousand'),
|
|
18
|
-
percentage: (value) => formatAndTruncate(value, 'percentage', 'thousand'),
|
|
19
|
-
multiple: (value) => formatAndTruncate(value, 'multiple', 'thousand'),
|
|
20
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ButtonProps as MantineButtonProps } from '@mantine/core';
|
|
2
|
-
import { componentSizes } from './shared/sizes';
|
|
3
|
-
import { componentVariants } from './shared/variants';
|
|
4
|
-
export interface ButtonProps extends MantineButtonProps {
|
|
5
|
-
onClick?: () => void;
|
|
6
|
-
size?: keyof typeof componentSizes;
|
|
7
|
-
variant?: keyof typeof componentVariants;
|
|
8
|
-
fullWidth?: boolean;
|
|
9
|
-
toggled?: boolean;
|
|
10
|
-
}
|
|
11
|
-
export declare const Button: ({ onClick, size, variant, fullWidth, toggled, styles, ...props }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/components/Inputs/Buttons/Button.tsx"],"names":[],"mappings":"AACA,OAAO,EAA2B,WAAW,IAAI,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAE3F,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,WAAW,WAAY,SAAQ,kBAAkB;IACrD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,OAAO,cAAc,CAAC;IACnC,OAAO,CAAC,EAAE,MAAM,OAAO,iBAAiB,CAAC;IACzC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,MAAM,GAAI,kEAAqG,WAAW,4CAkCtI,CAAC"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Button as MantineButton } from '@mantine/core';
|
|
3
|
-
import { fontBase, fontWeight } from '../../../constants/font';
|
|
4
|
-
import { componentSizes } from './shared/sizes';
|
|
5
|
-
import { componentVariants } from './shared/variants';
|
|
6
|
-
export const Button = ({ onClick, size = 'md', variant = 'primary', fullWidth = false, toggled = false, styles, ...props }) => {
|
|
7
|
-
const selectedVariant = componentVariants[variant];
|
|
8
|
-
const selectedSize = componentSizes[size];
|
|
9
|
-
// Apply active styles for nav variant when isActive is true
|
|
10
|
-
const getVariantStyles = () => {
|
|
11
|
-
if (toggled) {
|
|
12
|
-
return {
|
|
13
|
-
...selectedVariant,
|
|
14
|
-
...selectedVariant['&:toggled'],
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
return selectedVariant;
|
|
18
|
-
};
|
|
19
|
-
const style = {
|
|
20
|
-
root: {
|
|
21
|
-
borderRadius: '8px',
|
|
22
|
-
border: '1px solid white',
|
|
23
|
-
width: fullWidth ? '100%' : 'fit-content',
|
|
24
|
-
height: `${selectedSize.height}rem`,
|
|
25
|
-
padding: selectedSize.padding,
|
|
26
|
-
minWidth: `${selectedSize.minWidth}rem`,
|
|
27
|
-
fontSize: selectedSize.fontSize,
|
|
28
|
-
...getVariantStyles(),
|
|
29
|
-
},
|
|
30
|
-
label: {
|
|
31
|
-
...fontBase,
|
|
32
|
-
fontWeight: fontWeight['semibold'],
|
|
33
|
-
},
|
|
34
|
-
...styles,
|
|
35
|
-
};
|
|
36
|
-
return _jsx(MantineButton, { styles: style, size: size, onClick: onClick, ...props });
|
|
37
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { UnstyledButtonProps as MantineUnstyledButtonProps } from '@mantine/core';
|
|
3
|
-
import { CSSObject } from '@mantine/styles';
|
|
4
|
-
interface UnstyledButtonProps extends MantineUnstyledButtonProps {
|
|
5
|
-
styles?: Record<string, CSSObject>;
|
|
6
|
-
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
7
|
-
}
|
|
8
|
-
declare const UnstyledButton: ({ styles, onClick, ...props }: UnstyledButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export { UnstyledButton };
|
|
10
|
-
//# sourceMappingURL=UnstyledButton.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UnstyledButton.d.ts","sourceRoot":"","sources":["../../../../src/components/Inputs/Buttons/UnstyledButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAEL,mBAAmB,IAAI,0BAA0B,EAClD,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,UAAU,mBAAoB,SAAQ,0BAA0B;IAC9D,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACnC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;CAChE;AAED,QAAA,MAAM,cAAc,GAAI,+BAA+B,mBAAmB,4CAEzE,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { UnstyledButton as MantineUnstyledButton, } from '@mantine/core';
|
|
3
|
-
const UnstyledButton = ({ styles, onClick, ...props }) => {
|
|
4
|
-
return _jsx(MantineUnstyledButton, { styles: styles, onClick: onClick, ...props });
|
|
5
|
-
};
|
|
6
|
-
export { UnstyledButton };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
declare const componentSizes: {
|
|
2
|
-
sm: {
|
|
3
|
-
padding: string;
|
|
4
|
-
minWidth: number;
|
|
5
|
-
fontSize: string;
|
|
6
|
-
lineHeight: string;
|
|
7
|
-
height: number;
|
|
8
|
-
};
|
|
9
|
-
md: {
|
|
10
|
-
padding: string;
|
|
11
|
-
minWidth: number;
|
|
12
|
-
fontSize: string;
|
|
13
|
-
lineHeight: string;
|
|
14
|
-
height: number;
|
|
15
|
-
};
|
|
16
|
-
lg: {
|
|
17
|
-
padding: string;
|
|
18
|
-
minWidth: number;
|
|
19
|
-
fontSize: string;
|
|
20
|
-
lineHeight: string;
|
|
21
|
-
height: number;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
export { componentSizes };
|
|
25
|
-
//# sourceMappingURL=sizes.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sizes.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/Buttons/shared/sizes.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;CAInB,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { fontSize } from '../../../../constants/font';
|
|
2
|
-
const componentSizes = {
|
|
3
|
-
sm: { height: 3, ...fontSize['sm'], padding: '0.8rem 1.8rem', minWidth: 6.8 },
|
|
4
|
-
md: { height: 4, ...fontSize['md'], padding: '0.8rem 2.4rem', minWidth: 11.2 },
|
|
5
|
-
lg: { height: 4.8, ...fontSize['lg'], padding: '0.8rem 4rem', minWidth: 15.2 },
|
|
6
|
-
};
|
|
7
|
-
export { componentSizes };
|