@taiv/ui 1.3.3 → 1.4.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/Cards/ChartCard.d.ts +2 -1
- package/dist/components/Data/Cards/ChartCard.d.ts.map +1 -1
- package/dist/components/Data/Cards/ChartCard.js +6 -4
- package/dist/components/Data/Cards/PieChartCard.d.ts +2 -1
- package/dist/components/Data/Cards/PieChartCard.d.ts.map +1 -1
- package/dist/components/Data/Cards/PieChartCard.js +6 -4
- package/dist/components/Data/Cards/StatsCard.d.ts +1 -1
- package/dist/components/Data/Cards/StatsCard.d.ts.map +1 -1
- package/dist/components/Data/Cards/StatsCard.js +4 -4
- package/dist/components/Data/Chart.js +4 -4
- package/dist/components/Data/CheckboxTable.d.ts +1 -1
- package/dist/components/Data/CheckboxTable.d.ts.map +1 -1
- package/dist/components/Data/CheckboxTable.js +6 -6
- package/dist/components/Data/PieChart.js +4 -4
- package/dist/components/Info/InfoCard.d.ts +1 -1
- package/dist/components/Info/InfoCard.d.ts.map +1 -1
- package/dist/components/Info/InfoCard.js +2 -2
- package/dist/components/Info/Modals/Modal.js +2 -2
- package/dist/components/Info/Notifications/variants.js +1 -1
- package/dist/components/Info/Tooltips/FormulaTooltip.js +3 -3
- package/dist/components/Info/Tooltips/InfoTooltip.d.ts +16 -1
- package/dist/components/Info/Tooltips/InfoTooltip.d.ts.map +1 -1
- package/dist/components/Info/Tooltips/InfoTooltip.js +18 -4
- package/dist/components/Inputs/Buttons/Button/Button.d.ts +12 -0
- package/dist/components/Inputs/Buttons/Button/Button.d.ts.map +1 -0
- package/dist/components/Inputs/Buttons/Button/Button.js +37 -0
- package/dist/components/Inputs/Buttons/Button/Button.stories.d.ts +11 -0
- package/dist/components/Inputs/Buttons/Button/Button.stories.d.ts.map +1 -0
- package/dist/components/Inputs/Buttons/Button/Button.stories.js +176 -0
- package/dist/components/Inputs/Buttons/Button/sizes.d.ts +25 -0
- package/dist/components/Inputs/Buttons/Button/sizes.d.ts.map +1 -0
- package/dist/components/Inputs/Buttons/Button/sizes.js +7 -0
- package/dist/components/Inputs/Buttons/Button/variants.d.ts +191 -0
- package/dist/components/Inputs/Buttons/Button/variants.d.ts.map +1 -0
- package/dist/components/Inputs/Buttons/Button/variants.js +191 -0
- package/dist/components/Inputs/Buttons/UnstyledButton/UnstyledButton.d.ts +10 -0
- package/dist/components/Inputs/Buttons/UnstyledButton/UnstyledButton.d.ts.map +1 -0
- package/dist/components/Inputs/Buttons/UnstyledButton/UnstyledButton.js +6 -0
- package/dist/components/Inputs/Buttons/UnstyledButton/UnstyledButton.stories.d.ts +8 -0
- package/dist/components/Inputs/Buttons/UnstyledButton/UnstyledButton.stories.d.ts.map +1 -0
- package/dist/components/Inputs/Buttons/UnstyledButton/UnstyledButton.stories.js +97 -0
- package/dist/components/Inputs/Controls/Checkbox/Checkbox.d.ts +27 -0
- package/dist/components/Inputs/Controls/Checkbox/Checkbox.d.ts.map +1 -0
- package/dist/components/Inputs/Controls/Checkbox/Checkbox.js +55 -0
- package/dist/components/Inputs/Controls/Checkbox/Checkbox.stories.d.ts +10 -0
- package/dist/components/Inputs/Controls/Checkbox/Checkbox.stories.d.ts.map +1 -0
- package/dist/components/Inputs/Controls/Checkbox/Checkbox.stories.js +154 -0
- package/dist/components/Inputs/Controls/Radio/Radio.d.ts +8 -0
- package/dist/components/Inputs/Controls/Radio/Radio.d.ts.map +1 -0
- package/dist/components/Inputs/Controls/Radio/Radio.js +43 -0
- package/dist/components/Inputs/Controls/Radio/Radio.stories.d.ts +10 -0
- package/dist/components/Inputs/Controls/Radio/Radio.stories.d.ts.map +1 -0
- package/dist/components/Inputs/Controls/Radio/Radio.stories.js +143 -0
- package/dist/components/Inputs/Controls/RadioList/RadioList.d.ts +16 -0
- package/dist/components/Inputs/Controls/RadioList/RadioList.d.ts.map +1 -0
- package/dist/components/Inputs/Controls/RadioList/RadioList.js +24 -0
- package/dist/components/Inputs/Controls/RadioList/RadioList.stories.d.ts +11 -0
- package/dist/components/Inputs/Controls/RadioList/RadioList.stories.d.ts.map +1 -0
- package/dist/components/Inputs/Controls/RadioList/RadioList.stories.js +138 -0
- package/dist/components/Inputs/Controls/Toggle/Toggle.d.ts +29 -0
- package/dist/components/Inputs/Controls/Toggle/Toggle.d.ts.map +1 -0
- package/dist/components/Inputs/Controls/Toggle/Toggle.js +40 -0
- package/dist/components/Inputs/Controls/Toggle/Toggle.stories.d.ts +11 -0
- package/dist/components/Inputs/Controls/Toggle/Toggle.stories.d.ts.map +1 -0
- package/dist/components/Inputs/Controls/Toggle/Toggle.stories.js +179 -0
- package/dist/components/Inputs/Dates/DatePicker/DatePicker.d.ts +12 -0
- package/dist/components/Inputs/Dates/DatePicker/DatePicker.d.ts.map +1 -0
- package/dist/components/Inputs/Dates/DatePicker/DatePicker.js +74 -0
- package/dist/components/Inputs/Dates/DatePicker/DatePicker.stories.d.ts +12 -0
- package/dist/components/Inputs/Dates/DatePicker/DatePicker.stories.d.ts.map +1 -0
- package/dist/components/Inputs/Dates/DatePicker/DatePicker.stories.js +203 -0
- package/dist/components/Inputs/Dropdowns/CascadingSelect/CascadingSelect.d.ts +17 -0
- package/dist/components/Inputs/Dropdowns/CascadingSelect/CascadingSelect.d.ts.map +1 -0
- package/dist/components/Inputs/Dropdowns/CascadingSelect/CascadingSelect.js +70 -0
- package/dist/components/Inputs/Dropdowns/CascadingSelect/CascadingSelect.stories.d.ts +14 -0
- package/dist/components/Inputs/Dropdowns/CascadingSelect/CascadingSelect.stories.d.ts.map +1 -0
- package/dist/components/Inputs/Dropdowns/CascadingSelect/CascadingSelect.stories.js +362 -0
- package/dist/components/Inputs/Dropdowns/FontSelect/FontSelect.d.ts +11 -0
- package/dist/components/Inputs/Dropdowns/FontSelect/FontSelect.d.ts.map +1 -0
- package/dist/components/Inputs/Dropdowns/FontSelect/FontSelect.js +48 -0
- package/dist/components/Inputs/Dropdowns/FontSelect/FontSelect.stories.d.ts +12 -0
- package/dist/components/Inputs/Dropdowns/FontSelect/FontSelect.stories.d.ts.map +1 -0
- package/dist/components/Inputs/Dropdowns/FontSelect/FontSelect.stories.js +215 -0
- package/dist/components/Inputs/Dropdowns/FontSelect/font-options.d.ts +9 -0
- package/dist/components/Inputs/Dropdowns/FontSelect/font-options.d.ts.map +1 -0
- package/dist/components/Inputs/Dropdowns/FontSelect/font-options.js +65 -0
- package/dist/components/Inputs/Dropdowns/MultiSelect/MultiSelect.d.ts +12 -0
- package/dist/components/Inputs/Dropdowns/MultiSelect/MultiSelect.d.ts.map +1 -0
- package/dist/components/Inputs/Dropdowns/MultiSelect/MultiSelect.js +94 -0
- package/dist/components/Inputs/Dropdowns/MultiSelect/MultiSelect.stories.d.ts +12 -0
- package/dist/components/Inputs/Dropdowns/MultiSelect/MultiSelect.stories.d.ts.map +1 -0
- package/dist/components/Inputs/Dropdowns/MultiSelect/MultiSelect.stories.js +260 -0
- package/dist/components/Inputs/Dropdowns/Select/Select.d.ts +11 -0
- package/dist/components/Inputs/Dropdowns/Select/Select.d.ts.map +1 -0
- package/dist/components/Inputs/Dropdowns/Select/Select.js +62 -0
- package/dist/components/Inputs/Dropdowns/Select/Select.stories.d.ts +12 -0
- package/dist/components/Inputs/Dropdowns/Select/Select.stories.d.ts.map +1 -0
- package/dist/components/Inputs/Dropdowns/Select/Select.stories.js +242 -0
- package/dist/components/Inputs/Sliders/Slider/Slider.d.ts +16 -0
- package/dist/components/Inputs/Sliders/Slider/Slider.d.ts.map +1 -0
- package/dist/components/Inputs/Sliders/Slider/Slider.js +91 -0
- package/dist/components/Inputs/Sliders/VolumeSlider/VolumeSlider.d.ts +6 -0
- package/dist/components/Inputs/Sliders/VolumeSlider/VolumeSlider.d.ts.map +1 -0
- package/dist/components/Inputs/Sliders/VolumeSlider/VolumeSlider.js +37 -0
- package/dist/components/Inputs/TextInputs/AutoComplete/AutoComplete.d.ts +11 -0
- package/dist/components/Inputs/TextInputs/AutoComplete/AutoComplete.d.ts.map +1 -0
- package/dist/components/Inputs/TextInputs/AutoComplete/AutoComplete.js +57 -0
- package/dist/components/Inputs/TextInputs/AutoComplete/AutoComplete.stories.d.ts +12 -0
- package/dist/components/Inputs/TextInputs/AutoComplete/AutoComplete.stories.d.ts.map +1 -0
- package/dist/components/Inputs/TextInputs/AutoComplete/AutoComplete.stories.js +218 -0
- package/dist/components/Inputs/TextInputs/PasswordInput/PasswordInput.d.ts +12 -0
- package/dist/components/Inputs/TextInputs/PasswordInput/PasswordInput.d.ts.map +1 -0
- package/dist/components/Inputs/TextInputs/PasswordInput/PasswordInput.js +52 -0
- package/dist/components/Inputs/TextInputs/PasswordInput/PasswordInput.stories.d.ts +12 -0
- package/dist/components/Inputs/TextInputs/PasswordInput/PasswordInput.stories.d.ts.map +1 -0
- package/dist/components/Inputs/TextInputs/PasswordInput/PasswordInput.stories.js +235 -0
- package/dist/components/Inputs/TextInputs/SearchBar/SearchBar.d.ts +7 -0
- package/dist/components/Inputs/TextInputs/SearchBar/SearchBar.d.ts.map +1 -0
- package/dist/components/Inputs/TextInputs/SearchBar/SearchBar.js +23 -0
- package/dist/components/Inputs/TextInputs/SearchBar/SearchBar.stories.d.ts +12 -0
- package/dist/components/Inputs/TextInputs/SearchBar/SearchBar.stories.d.ts.map +1 -0
- package/dist/components/Inputs/TextInputs/SearchBar/SearchBar.stories.js +202 -0
- package/dist/components/Inputs/TextInputs/TextArea/TextArea.d.ts +12 -0
- package/dist/components/Inputs/TextInputs/TextArea/TextArea.d.ts.map +1 -0
- package/dist/components/Inputs/TextInputs/TextArea/TextArea.js +33 -0
- package/dist/components/Inputs/TextInputs/TextArea/TextArea.stories.d.ts +12 -0
- package/dist/components/Inputs/TextInputs/TextArea/TextArea.stories.d.ts.map +1 -0
- package/dist/components/Inputs/TextInputs/TextArea/TextArea.stories.js +231 -0
- package/dist/components/Inputs/TextInputs/TextInput/TextInput.d.ts +12 -0
- package/dist/components/Inputs/TextInputs/TextInput/TextInput.d.ts.map +1 -0
- package/dist/components/Inputs/TextInputs/TextInput/TextInput.js +32 -0
- package/dist/components/Inputs/TextInputs/TextInput/TextInput.stories.d.ts +12 -0
- package/dist/components/Inputs/TextInputs/TextInput/TextInput.stories.d.ts.map +1 -0
- package/dist/components/Inputs/TextInputs/TextInput/TextInput.stories.js +219 -0
- package/dist/components/Layout/AutoGrid/AutoGrid.d.ts +8 -0
- package/dist/components/Layout/AutoGrid/AutoGrid.d.ts.map +1 -0
- package/dist/components/Layout/AutoGrid/AutoGrid.js +6 -0
- package/dist/components/Layout/Box/Box.d.ts +10 -0
- package/dist/components/Layout/Box/Box.d.ts.map +1 -0
- package/dist/components/Layout/Box/Box.js +6 -0
- package/dist/components/Layout/Box/Box.stories.d.ts +9 -0
- package/dist/components/Layout/Box/Box.stories.d.ts.map +1 -0
- package/dist/components/Layout/Box/Box.stories.js +121 -0
- package/dist/components/Layout/Card/Card.d.ts +8 -0
- package/dist/components/Layout/Card/Card.d.ts.map +1 -0
- package/dist/components/Layout/Card/Card.js +16 -0
- package/dist/components/Layout/Center/Center.d.ts +9 -0
- package/dist/components/Layout/Center/Center.d.ts.map +1 -0
- package/dist/components/Layout/Center/Center.js +6 -0
- package/dist/components/Layout/Divider/Divider.d.ts +10 -0
- package/dist/components/Layout/Divider/Divider.d.ts.map +1 -0
- package/dist/components/Layout/Divider/Divider.js +7 -0
- package/dist/components/Layout/Frame/Frame.d.ts +12 -0
- package/dist/components/Layout/Frame/Frame.d.ts.map +1 -0
- package/dist/components/Layout/Frame/Frame.js +7 -0
- package/dist/components/Layout/Grid/Grid.d.ts +10 -0
- package/dist/components/Layout/Grid/Grid.d.ts.map +1 -0
- package/dist/components/Layout/Grid/Grid.js +9 -0
- package/dist/components/Layout/Group/Group.d.ts +10 -0
- package/dist/components/Layout/Group/Group.d.ts.map +1 -0
- package/dist/components/Layout/Group/Group.js +6 -0
- package/dist/components/Layout/Loader/Loader.d.ts +8 -0
- package/dist/components/Layout/Loader/Loader.d.ts.map +1 -0
- package/dist/components/Layout/Loader/Loader.js +6 -0
- package/dist/components/Layout/SectionCard/SectionCard.d.ts +11 -0
- package/dist/components/Layout/SectionCard/SectionCard.d.ts.map +1 -0
- package/dist/components/Layout/SectionCard/SectionCard.js +13 -0
- package/dist/components/Layout/Stack/Stack.d.ts +10 -0
- package/dist/components/Layout/Stack/Stack.d.ts.map +1 -0
- package/dist/components/Layout/Stack/Stack.js +6 -0
- package/dist/components/Layout/Stack/Stack.stories.d.ts +9 -0
- package/dist/components/Layout/Stack/Stack.stories.d.ts.map +1 -0
- package/dist/components/Layout/Stack/Stack.stories.js +108 -0
- package/dist/components/Layout/Tabs/Tabs.d.ts +17 -0
- package/dist/components/Layout/Tabs/Tabs.d.ts.map +1 -0
- package/dist/components/Layout/Tabs/Tabs.js +48 -0
- package/dist/components/Misc/IconBadge/IconBadge.d.ts +8 -0
- package/dist/components/Misc/IconBadge/IconBadge.d.ts.map +1 -0
- package/dist/components/Misc/IconBadge/IconBadge.js +28 -0
- package/dist/components/Misc/Transition/Transition.d.ts +4 -0
- package/dist/components/Misc/Transition/Transition.d.ts.map +1 -0
- package/dist/components/Misc/Transition/Transition.js +6 -0
- package/dist/components/Typography/CollapsibleText.js +4 -4
- package/dist/components/Typography/Formula.d.ts.map +1 -1
- package/dist/components/Typography/Formula.js +2 -6
- package/dist/components/Typography/Fraction.js +2 -2
- package/dist/components/Typography/Text.d.ts.map +1 -1
- package/dist/components/Typography/Text.js +0 -2
- package/dist/components/index.d.ts +32 -32
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +32 -32
- package/dist/hooks/useConfirmationModal.d.ts.map +1 -1
- package/dist/hooks/useConfirmationModal.js +6 -6
- package/dist/hooks/useInfoModal.d.ts.map +1 -1
- package/dist/hooks/useInfoModal.js +4 -4
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/select.d.ts +1 -0
- package/dist/utils/select.d.ts.map +1 -1
- package/dist/utils/select.js +18 -0
- package/package.json +10 -2
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { CardProps } from '../../Layout/Card';
|
|
2
|
+
import { CardProps } from '../../Layout/Card/Card';
|
|
3
3
|
import { ChartProps } from '../Chart';
|
|
4
4
|
export interface ChartCardProps extends ChartProps, Omit<CardProps, 'children'> {
|
|
5
5
|
title: string;
|
|
6
6
|
subtitle?: string;
|
|
7
|
+
tooltip?: React.ReactNode;
|
|
7
8
|
}
|
|
8
9
|
export declare const ChartCard: React.FC<ChartCardProps>;
|
|
9
10
|
//# sourceMappingURL=ChartCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartCard.d.ts","sourceRoot":"","sources":["../../../../src/components/Data/Cards/ChartCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAQ,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ChartCard.d.ts","sourceRoot":"","sources":["../../../../src/components/Data/Cards/ChartCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAQ,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAS,UAAU,EAAE,MAAM,UAAU,CAAC;AAO7C,MAAM,WAAW,cAAe,SAAQ,UAAU,EAAE,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IAC7E,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAkB9C,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { Card } from '../../Layout/Card';
|
|
2
|
+
import { Card } from '../../Layout/Card/Card';
|
|
3
3
|
import { Chart } from '../Chart';
|
|
4
|
-
import { Stack } from '../../Layout/Stack';
|
|
4
|
+
import { Stack } from '../../Layout/Stack/Stack';
|
|
5
5
|
import { Title } from '../../Typography/Title';
|
|
6
6
|
import { Text } from '../../Typography/Text';
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
import { InfoTooltip } from '../../Info/Tooltips/InfoTooltip';
|
|
8
|
+
import { Group } from '@mantine/core';
|
|
9
|
+
export const ChartCard = ({ title, subtitle, series, yAxisFormat, xAxisFormat, showLegend, loading, height = '30rem', tooltip, ...cardProps }) => {
|
|
10
|
+
return (_jsxs(_Fragment, { children: [_jsx(Card, { ...cardProps, h: height, children: _jsxs(Stack, { gap: "2.4rem", h: "100%", w: "100%", children: [_jsxs(Stack, { gap: "0.5rem", children: [_jsxs(Group, { position: "apart", children: [_jsx(Title, { variant: "cardHeader", children: title }), tooltip && _jsx(InfoTooltip, { text: tooltip, maxWidth: "600px" })] }), subtitle && _jsx(Text, { variant: "label", children: subtitle })] }), _jsx(Chart, { series: series, yAxisFormat: yAxisFormat, xAxisFormat: xAxisFormat, showLegend: showLegend, loading: loading })] }) }), _jsx("style", { children: `.recharts-surface { outline: none; }` })] }));
|
|
9
11
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { CardProps } from '../../Layout/Card';
|
|
2
|
+
import { CardProps } from '../../Layout/Card/Card';
|
|
3
3
|
import { PieChartProps } from '../PieChart';
|
|
4
4
|
export interface PieChartCardProps extends PieChartProps, Omit<CardProps, 'children'> {
|
|
5
5
|
title: string;
|
|
6
6
|
subtitle?: string;
|
|
7
|
+
tooltip?: React.ReactNode;
|
|
7
8
|
height?: number | string;
|
|
8
9
|
}
|
|
9
10
|
export declare const PieChartCard: React.FC<PieChartCardProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PieChartCard.d.ts","sourceRoot":"","sources":["../../../../src/components/Data/Cards/PieChartCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAQ,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"PieChartCard.d.ts","sourceRoot":"","sources":["../../../../src/components/Data/Cards/PieChartCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAQ,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAY,aAAa,EAAE,MAAM,aAAa,CAAC;AAOtD,MAAM,WAAW,iBAAkB,SAAQ,aAAa,EAAE,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IACnF,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC1B;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAyCpD,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { Card } from '../../Layout/Card';
|
|
2
|
+
import { Card } from '../../Layout/Card/Card';
|
|
3
3
|
import { PieChart } from '../PieChart';
|
|
4
|
-
import { Stack } from '../../Layout/Stack';
|
|
4
|
+
import { Stack } from '../../Layout/Stack/Stack';
|
|
5
5
|
import { Title } from '../../Typography/Title';
|
|
6
6
|
import { Text } from '../../Typography/Text';
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
import { InfoTooltip } from '../../Info/Tooltips/InfoTooltip';
|
|
8
|
+
import { Group } from '@mantine/core';
|
|
9
|
+
export const PieChartCard = ({ title, subtitle, data, tooltip, height = '100%', showLegend, innerRadius, outerRadius, paddingAngle, format = 'percentage', loading, centerContent, ...cardProps }) => {
|
|
10
|
+
return (_jsxs(_Fragment, { children: [_jsx(Card, { ...cardProps, h: height, children: _jsxs(Stack, { gap: "0rem", h: "100%", w: "100%", children: [_jsxs(Stack, { gap: "0.5rem", children: [_jsxs(Group, { children: [_jsx(Title, { variant: "cardHeader", children: title }), tooltip && _jsx(InfoTooltip, { text: tooltip, maxWidth: "600px" })] }), subtitle && _jsx(Text, { variant: "label", children: subtitle })] }), _jsx(PieChart, { data: data, showLegend: showLegend, innerRadius: innerRadius, outerRadius: outerRadius, paddingAngle: paddingAngle, format: format, loading: loading, centerContent: centerContent })] }) }), _jsx("style", { children: `.recharts-surface { outline: none; }` })] }));
|
|
9
11
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { CardProps } from '../../Layout/Card';
|
|
2
|
+
import { CardProps } from '../../Layout/Card/Card';
|
|
3
3
|
import { primitives } from '../../../constants/colors';
|
|
4
4
|
import { formats } from '../../../constants/data';
|
|
5
5
|
export interface StatsCardProps extends Omit<CardProps, 'children'> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatsCard.d.ts","sourceRoot":"","sources":["../../../../src/components/Data/Cards/StatsCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAQ,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"StatsCard.d.ts","sourceRoot":"","sources":["../../../../src/components/Data/Cards/StatsCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAQ,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAOzD,OAAO,EAAE,UAAU,EAAoB,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,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,OAAO,CAAC;IAC9B,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,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Card } from '../../Layout/Card';
|
|
2
|
+
import { Card } from '../../Layout/Card/Card';
|
|
3
3
|
import { InfoTooltip } from '../../Info/Tooltips/InfoTooltip';
|
|
4
4
|
import { Text } from '../../Typography/Text';
|
|
5
5
|
import { Title } from '../../Typography/Title';
|
|
6
|
-
import { Group } from '../../Layout/Group';
|
|
7
|
-
import { Stack } from '../../Layout/Stack';
|
|
8
|
-
import { IconBadge } from '../../Misc/IconBadge';
|
|
6
|
+
import { Group } from '../../Layout/Group/Group';
|
|
7
|
+
import { Stack } from '../../Layout/Stack/Stack';
|
|
8
|
+
import { IconBadge } from '../../Misc/IconBadge/IconBadge';
|
|
9
9
|
import { success, neutral } from '../../../constants/colors';
|
|
10
10
|
import { formats } from '../../../constants/data';
|
|
11
11
|
export const StatsCard = ({ value, format = 'decimal', isDelta = false, title, description, increaseDescription, icon: Icon, iconColor = 'blue', tooltip, ...cardProps }) => {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { Text } from '../Typography/Text';
|
|
3
|
-
import { Center } from '../Layout/Center';
|
|
4
|
-
import { Box } from '../Layout/Box';
|
|
5
|
-
import { Stack } from '../Layout/Stack';
|
|
6
|
-
import { Group } from '../Layout/Group';
|
|
3
|
+
import { Center } from '../Layout/Center/Center';
|
|
4
|
+
import { Box } from '../Layout/Box/Box';
|
|
5
|
+
import { Stack } from '../Layout/Stack/Stack';
|
|
6
|
+
import { Group } from '../Layout/Group/Group';
|
|
7
7
|
import { Area, Bar, CartesianGrid, ComposedChart, Legend, Line, ResponsiveContainer, Tooltip, XAxis, YAxis } from 'recharts';
|
|
8
8
|
import { getChartFormatter } from '../../utils/charts';
|
|
9
9
|
import { fontStyle } from '../../constants/font';
|
|
@@ -16,6 +16,6 @@ interface CheckboxTableProps {
|
|
|
16
16
|
showColumnTitles?: boolean;
|
|
17
17
|
outlines?: boolean;
|
|
18
18
|
}
|
|
19
|
-
declare const CheckboxTable: ({ columns, data, className, onRowClick, title, subtitle, showColumnTitles, outlines
|
|
19
|
+
declare const CheckboxTable: ({ columns, data, className, onRowClick, title, subtitle, showColumnTitles, outlines }: CheckboxTableProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
20
|
export { CheckboxTable };
|
|
21
21
|
//# sourceMappingURL=CheckboxTable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxTable.d.ts","sourceRoot":"","sources":["../../../src/components/Data/CheckboxTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,GAAG,EAAE,MAAM,CAAC;CACb;AAED,UAAU,kBAAkB;IAC1B,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,QAAA,MAAM,aAAa,GAAI,
|
|
1
|
+
{"version":3,"file":"CheckboxTable.d.ts","sourceRoot":"","sources":["../../../src/components/Data/CheckboxTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,GAAG,EAAE,MAAM,CAAC;CACb;AAED,UAAU,kBAAkB;IAC1B,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,QAAA,MAAM,aAAa,GAAI,uFAAgH,kBAAkB,4CAuHxJ,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useMobile } from '../../hooks/useMediaQuery';
|
|
3
|
-
import { Checkbox } from '../Inputs/Controls/Checkbox';
|
|
4
|
-
import { Group } from '../Layout/Group';
|
|
5
|
-
import { Box } from '../Layout/Box';
|
|
6
|
-
import { Center } from '../Layout/Center';
|
|
7
|
-
import { Stack } from '../Layout/Stack';
|
|
3
|
+
import { Checkbox } from '../Inputs/Controls/Checkbox/Checkbox';
|
|
4
|
+
import { Group } from '../Layout/Group/Group';
|
|
5
|
+
import { Box } from '../Layout/Box/Box';
|
|
6
|
+
import { Center } from '../Layout/Center/Center';
|
|
7
|
+
import { Stack } from '../Layout/Stack/Stack';
|
|
8
8
|
import { Title } from '../Typography/Title';
|
|
9
9
|
import { neutral } from '../../constants/colors';
|
|
10
10
|
import { fontStyle } from '../../constants/font';
|
|
11
|
-
const CheckboxTable = ({ columns, data, className = 'none', onRowClick, title, subtitle, showColumnTitles = false, outlines = false
|
|
11
|
+
const CheckboxTable = ({ columns, data, className = 'none', onRowClick, title, subtitle, showColumnTitles = false, outlines = false }) => {
|
|
12
12
|
const isMobile = useMobile();
|
|
13
13
|
const style = {
|
|
14
14
|
container: {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { PieChart as RechartsPieChart, Pie, Cell, ResponsiveContainer, Tooltip, Legend, Label } from 'recharts';
|
|
3
3
|
import { Text } from '../Typography/Text';
|
|
4
|
-
import { Center } from '../Layout/Center';
|
|
5
|
-
import { Group } from '../Layout/Group';
|
|
4
|
+
import { Center } from '../Layout/Center/Center';
|
|
5
|
+
import { Group } from '../Layout/Group/Group';
|
|
6
6
|
import { Title } from '../Typography/Title';
|
|
7
|
-
import { Stack } from '../Layout/Stack';
|
|
8
|
-
import { Box } from '../Layout/Box';
|
|
7
|
+
import { Stack } from '../Layout/Stack/Stack';
|
|
8
|
+
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';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { CardProps } from '../Layout/Card';
|
|
2
|
+
import { CardProps } from '../Layout/Card/Card';
|
|
3
3
|
import { colors } from '../../constants/colors';
|
|
4
4
|
export interface InfoCardProps extends Omit<CardProps, 'children'> {
|
|
5
5
|
children: React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InfoCard.d.ts","sourceRoot":"","sources":["../../../src/components/Info/InfoCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAQ,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"InfoCard.d.ts","sourceRoot":"","sources":["../../../src/components/Info/InfoCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAQ,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IAChE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,OAAO,MAAM,CAAC;CAC/B;AAED,eAAO,MAAM,QAAQ,GAAI,qCAAiD,aAAa,4CAwBtF,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Card } from '../Layout/Card';
|
|
3
|
-
import { Center } from '../Layout/Center';
|
|
2
|
+
import { Card } from '../Layout/Card/Card';
|
|
3
|
+
import { Center } from '../Layout/Center/Center';
|
|
4
4
|
import { colors } from '../../constants/colors';
|
|
5
5
|
export const InfoCard = ({ children, variant = 'primary', ...cardProps }) => {
|
|
6
6
|
const colorPalette = colors[variant];
|
|
@@ -2,8 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Modal as MantineModal } from '@mantine/core';
|
|
3
3
|
import { neutral } from '../../../constants/colors';
|
|
4
4
|
import { Title } from '../../Typography/Title';
|
|
5
|
-
import { Stack } from '../../Layout/Stack';
|
|
6
|
-
import { Center } from '../../Layout/Center';
|
|
5
|
+
import { Stack } from '../../Layout/Stack/Stack';
|
|
6
|
+
import { Center } from '../../Layout/Center/Center';
|
|
7
7
|
// Base modal is intended to be extended and customized - use InfoModal or ConfirmationModal for common use cases
|
|
8
8
|
export const Modal = ({ opened, onClose, icon, title, subtitle, children, width = '40rem' }) => {
|
|
9
9
|
return (_jsx(MantineModal, { opened: opened, onClose: onClose, centered: true, radius: '16px', overlayProps: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { primary, error, success, warning } from '../../../constants/colors';
|
|
3
|
-
import { Loader } from '../../Layout/Loader';
|
|
3
|
+
import { Loader } from '../../Layout/Loader/Loader';
|
|
4
4
|
export const componentVariants = {
|
|
5
5
|
success: {
|
|
6
6
|
defaultTitle: 'Success!',
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box } from '../../Layout/Box';
|
|
2
|
+
import { Box } from '../../Layout/Box/Box';
|
|
3
3
|
import { Text } from '../../Typography/Text';
|
|
4
4
|
import { Formula } from '../../Typography/Formula';
|
|
5
|
-
import { Stack } from '../../Layout/Stack';
|
|
5
|
+
import { Stack } from '../../Layout/Stack/Stack';
|
|
6
6
|
import { blue } from '../../../constants/colors';
|
|
7
|
-
import { Center } from '../../Layout/Center';
|
|
7
|
+
import { Center } from '../../Layout/Center/Center';
|
|
8
8
|
const FormulaTooltip = ({ title, description, expression }) => {
|
|
9
9
|
return (_jsx(Box, { p: "0.8rem", children: _jsxs(Stack, { gap: "1.6rem", children: [_jsxs(Stack, { gap: "0.8rem", sx: { maxWidth: '375px' }, children: [_jsx(Text, { weight: "semibold", children: title }), _jsx(Text, { variant: "label", children: description })] }), _jsx("div", { style: { padding: '1.6rem 2.4rem', borderRadius: '16px', backgroundColor: blue[25], width: '100%' }, children: _jsx(Center, { children: _jsx(Formula, { expression: expression, color: blue[300] }) }) })] }) }));
|
|
10
10
|
};
|
|
@@ -9,13 +9,28 @@ interface InfoTooltipProps {
|
|
|
9
9
|
className?: string;
|
|
10
10
|
styles?: Record<string, CSSObject>;
|
|
11
11
|
maxWidth?: string;
|
|
12
|
+
variant?: keyof typeof componentVariants;
|
|
12
13
|
}
|
|
14
|
+
declare const componentVariants: {
|
|
15
|
+
info: {
|
|
16
|
+
color: "#D9D9D9";
|
|
17
|
+
icon: string;
|
|
18
|
+
};
|
|
19
|
+
warning: {
|
|
20
|
+
color: "#FE9A00";
|
|
21
|
+
icon: string;
|
|
22
|
+
};
|
|
23
|
+
error: {
|
|
24
|
+
color: "#FB2C36";
|
|
25
|
+
icon: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
13
28
|
declare const componentSizes: {
|
|
14
29
|
readonly sm: "1.2rem";
|
|
15
30
|
readonly md: "1.6rem";
|
|
16
31
|
readonly lg: "2rem";
|
|
17
32
|
readonly xl: "2.4rem";
|
|
18
33
|
};
|
|
19
|
-
declare const InfoTooltip: ({ text, content, position, size, offset, className, styles, maxWidth }: InfoTooltipProps) => import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
declare const InfoTooltip: ({ text, content, position, size, offset, className, styles, maxWidth, variant }: InfoTooltipProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
35
|
export { InfoTooltip };
|
|
21
36
|
//# sourceMappingURL=InfoTooltip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InfoTooltip.d.ts","sourceRoot":"","sources":["../../../../src/components/Info/Tooltips/InfoTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,UAAU,gBAAgB;IACxB,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,SAAS,GAAG,YAAY,GAAG,WAAW,GAAG,cAAc,CAAC;IACnE,IAAI,CAAC,EAAE,MAAM,OAAO,cAAc,CAAC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"InfoTooltip.d.ts","sourceRoot":"","sources":["../../../../src/components/Info/Tooltips/InfoTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,UAAU,gBAAgB;IACxB,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,SAAS,GAAG,YAAY,GAAG,WAAW,GAAG,cAAc,CAAC;IACnE,IAAI,CAAC,EAAE,MAAM,OAAO,cAAc,CAAC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,OAAO,iBAAiB,CAAC;CAC1C;AAED,QAAA,MAAM,iBAAiB;;;;;;;;;;;;;CAatB,CAAC;AAEF,QAAA,MAAM,cAAc;;;;;CAKV,CAAC;AAEX,QAAA,MAAM,WAAW,GAAI,iFAA+G,gBAAgB,4CAcnJ,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -1,20 +1,34 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { neutral } from '../../../constants/colors';
|
|
2
|
+
import { error, neutral, warning } from '../../../constants/colors';
|
|
3
3
|
import { Tooltip } from './Tooltip';
|
|
4
|
+
const componentVariants = {
|
|
5
|
+
info: {
|
|
6
|
+
color: neutral[100],
|
|
7
|
+
icon: 'fas fa-info-circle',
|
|
8
|
+
},
|
|
9
|
+
warning: {
|
|
10
|
+
color: warning[100],
|
|
11
|
+
icon: 'fas fa-exclamation-circle',
|
|
12
|
+
},
|
|
13
|
+
error: {
|
|
14
|
+
color: error[100],
|
|
15
|
+
icon: 'fas fa-exclamation-circle',
|
|
16
|
+
},
|
|
17
|
+
};
|
|
4
18
|
const componentSizes = {
|
|
5
19
|
sm: '1.2rem',
|
|
6
20
|
md: '1.6rem',
|
|
7
21
|
lg: '2rem',
|
|
8
22
|
xl: '2.4rem',
|
|
9
23
|
};
|
|
10
|
-
const InfoTooltip = ({ text, content, position = 'top-start', size = 'md', offset, className, styles, maxWidth }) => {
|
|
24
|
+
const InfoTooltip = ({ text, content, position = 'top-start', size = 'md', offset, className, styles, maxWidth, variant = 'info' }) => {
|
|
11
25
|
const style = {
|
|
12
26
|
icon: {
|
|
13
|
-
color:
|
|
27
|
+
color: componentVariants[variant].color,
|
|
14
28
|
fontSize: componentSizes[size],
|
|
15
29
|
},
|
|
16
30
|
...styles,
|
|
17
31
|
};
|
|
18
|
-
return (_jsx(Tooltip, { text: text || content, position: position, offset: offset, className: className, maxWidth: maxWidth, children: _jsx("i", { className:
|
|
32
|
+
return (_jsx(Tooltip, { text: text || content, position: position, offset: offset, className: className, maxWidth: maxWidth, children: _jsx("i", { className: componentVariants[variant].icon, style: style.icon }) }));
|
|
19
33
|
};
|
|
20
34
|
export { InfoTooltip };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ButtonProps as MantineButtonProps } from '@mantine/core';
|
|
2
|
+
import { componentSizes } from './sizes';
|
|
3
|
+
import { componentVariants } from './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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/Buttons/Button/Button.tsx"],"names":[],"mappings":"AACA,OAAO,EAA2B,WAAW,IAAI,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAE3F,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,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"}
|
|
@@ -0,0 +1,37 @@
|
|
|
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 './sizes';
|
|
5
|
+
import { componentVariants } from './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
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { Button } from './Button';
|
|
3
|
+
declare const meta: Meta<typeof Button>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Variants: Story;
|
|
8
|
+
export declare const Sizes: Story;
|
|
9
|
+
export declare const States: Story;
|
|
10
|
+
export declare const CustomStyles: Story;
|
|
11
|
+
//# sourceMappingURL=Button.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/Buttons/Button/Button.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,MAAM,CA2F7B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAarB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAWtB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAQnB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAQpB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAsE1B,CAAC"}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from './Button';
|
|
3
|
+
import { Group } from '../../../Layout/Group/Group';
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Components/Inputs/Buttons/Button',
|
|
6
|
+
component: Button,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: 'centered',
|
|
9
|
+
docs: {
|
|
10
|
+
description: {
|
|
11
|
+
component: "[View Mantine Docs](https://v6.mantine.dev/core/button/)\n\nThe Button component is a customizable wrapper around Mantine's Button component that provides consistent styling and behavior across your application. It extends Mantine v6's ButtonProps while adding custom variants and sizing options.",
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
argTypes: {
|
|
16
|
+
size: {
|
|
17
|
+
control: { type: 'select' },
|
|
18
|
+
options: ['sm', 'md', 'lg'],
|
|
19
|
+
description: "Controls the button's height, padding, and font size",
|
|
20
|
+
table: {
|
|
21
|
+
type: { summary: "'sm' | 'md' | 'lg'" },
|
|
22
|
+
defaultValue: { summary: "'md'" },
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
variant: {
|
|
26
|
+
control: { type: 'select' },
|
|
27
|
+
options: ['primary', 'secondary', 'cancel', 'success', 'warning', 'text', 'nav'],
|
|
28
|
+
description: "Defines the button's visual style and color scheme",
|
|
29
|
+
table: {
|
|
30
|
+
type: { summary: "'primary' | 'secondary' | 'cancel' | 'success' | 'warning' | 'text' | 'nav'" },
|
|
31
|
+
defaultValue: { summary: "'primary'" },
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
children: {
|
|
35
|
+
control: { type: 'text' },
|
|
36
|
+
description: 'Button label or content',
|
|
37
|
+
table: {
|
|
38
|
+
type: { summary: 'ReactNode' },
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
fullWidth: {
|
|
42
|
+
control: { type: 'boolean' },
|
|
43
|
+
description: 'Makes the button span the full width of its container. Useful for modals, forms, etc. with a proper Grid layout',
|
|
44
|
+
table: {
|
|
45
|
+
type: { summary: 'boolean' },
|
|
46
|
+
defaultValue: { summary: 'false' },
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
leftIcon: {
|
|
50
|
+
control: { type: 'text' },
|
|
51
|
+
description: 'Adds icon before button label',
|
|
52
|
+
table: {
|
|
53
|
+
type: { summary: 'ReactNode' },
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
rightIcon: {
|
|
57
|
+
control: { type: 'text' },
|
|
58
|
+
description: 'Adds icon after button label',
|
|
59
|
+
table: {
|
|
60
|
+
type: { summary: 'ReactNode' },
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
styles: {
|
|
64
|
+
control: { type: 'object' },
|
|
65
|
+
description: 'Custom styles object',
|
|
66
|
+
table: {
|
|
67
|
+
type: { summary: 'MantineStylesObject' },
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
disabled: {
|
|
71
|
+
control: { type: 'boolean' },
|
|
72
|
+
description: 'Disabled state',
|
|
73
|
+
table: {
|
|
74
|
+
type: { summary: 'boolean' },
|
|
75
|
+
defaultValue: { summary: 'false' },
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
loading: {
|
|
79
|
+
control: { type: 'boolean' },
|
|
80
|
+
description: 'Indicate loading state',
|
|
81
|
+
table: {
|
|
82
|
+
type: { summary: 'boolean' },
|
|
83
|
+
defaultValue: { summary: 'false' },
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
onClick: {
|
|
87
|
+
action: 'clicked',
|
|
88
|
+
description: 'Click handler function',
|
|
89
|
+
table: {
|
|
90
|
+
type: { summary: '() => void' },
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
export default meta;
|
|
96
|
+
export const Default = {
|
|
97
|
+
args: {
|
|
98
|
+
children: 'Button',
|
|
99
|
+
size: 'md',
|
|
100
|
+
variant: 'primary',
|
|
101
|
+
disabled: false,
|
|
102
|
+
loading: false,
|
|
103
|
+
fullWidth: false,
|
|
104
|
+
leftIcon: undefined,
|
|
105
|
+
rightIcon: undefined,
|
|
106
|
+
styles: {},
|
|
107
|
+
onClick: () => { },
|
|
108
|
+
},
|
|
109
|
+
};
|
|
110
|
+
export const Variants = {
|
|
111
|
+
render: () => (_jsxs(Group, { gap: "1.6rem", children: [_jsx(Button, { variant: "primary", children: "Primary" }), _jsx(Button, { variant: "secondary", children: "Secondary" }), _jsx(Button, { variant: "cancel", children: "Cancel" }), _jsx(Button, { variant: "success", children: "Success" }), _jsx(Button, { variant: "warning", children: "Warning" }), _jsx(Button, { variant: "text", children: "Text" })] })),
|
|
112
|
+
};
|
|
113
|
+
export const Sizes = {
|
|
114
|
+
render: () => (_jsxs(Group, { gap: "1.6rem", children: [_jsx(Button, { size: "sm", children: "Small" }), _jsx(Button, { size: "md", children: "Medium" }), _jsx(Button, { size: "lg", children: "Large" })] })),
|
|
115
|
+
};
|
|
116
|
+
export const States = {
|
|
117
|
+
render: () => (_jsxs(Group, { gap: "1.6rem", children: [_jsx(Button, { children: "Normal" }), _jsx(Button, { disabled: true, children: "Disabled" }), _jsx(Button, { loading: true, children: "Loading" })] })),
|
|
118
|
+
};
|
|
119
|
+
export const CustomStyles = {
|
|
120
|
+
render: () => (_jsxs(Group, { gap: "1.6rem", children: [_jsx(Button, { styles: {
|
|
121
|
+
root: {
|
|
122
|
+
borderRadius: '20px',
|
|
123
|
+
background: 'linear-gradient(45deg, #ff6b6b, #ee5a24)',
|
|
124
|
+
'&:hover': {
|
|
125
|
+
background: 'linear-gradient(45deg, #ee5a24, #ff6b6b)',
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
}, children: "Gradient Button" }), _jsx(Button, { styles: {
|
|
129
|
+
root: {
|
|
130
|
+
borderRadius: '0px',
|
|
131
|
+
background: 'black',
|
|
132
|
+
color: 'white',
|
|
133
|
+
border: '2px solid white',
|
|
134
|
+
'&:hover': {
|
|
135
|
+
background: 'white',
|
|
136
|
+
color: 'black',
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
}, children: "Custom Border" })] })),
|
|
140
|
+
parameters: {
|
|
141
|
+
docs: {
|
|
142
|
+
source: {
|
|
143
|
+
code: `<Button
|
|
144
|
+
styles={{
|
|
145
|
+
root: {
|
|
146
|
+
borderRadius: '20px',
|
|
147
|
+
background: 'linear-gradient(45deg, #ff6b6b, #ee5a24)',
|
|
148
|
+
'&:hover': {
|
|
149
|
+
background: 'linear-gradient(45deg, #ee5a24, #ff6b6b)',
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
}}
|
|
153
|
+
>
|
|
154
|
+
Gradient Button
|
|
155
|
+
</Button>
|
|
156
|
+
|
|
157
|
+
<Button
|
|
158
|
+
styles={{
|
|
159
|
+
root: {
|
|
160
|
+
borderRadius: '0px',
|
|
161
|
+
background: 'black',
|
|
162
|
+
color: 'white',
|
|
163
|
+
border: '2px solid white',
|
|
164
|
+
'&:hover': {
|
|
165
|
+
background: 'white',
|
|
166
|
+
color: 'black',
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
}}
|
|
170
|
+
>
|
|
171
|
+
Custom Border
|
|
172
|
+
</Button>`,
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sizes.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/Buttons/Button/sizes.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;CAInB,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
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 };
|