@taiv/ui 1.0.2 → 1.2.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/README.md +23 -1
- package/dist/components/Data/Chart.d.ts +32 -0
- package/dist/components/Data/Chart.d.ts.map +1 -0
- package/dist/components/Data/Chart.js +97 -0
- package/dist/components/Data/CheckboxTable.js +2 -2
- package/dist/components/Data/PieChart.d.ts +24 -0
- package/dist/components/Data/PieChart.d.ts.map +1 -0
- package/dist/components/Data/PieChart.js +61 -0
- package/dist/components/Data/StatsCard.d.ts +17 -0
- package/dist/components/Data/StatsCard.d.ts.map +1 -0
- package/dist/components/Data/StatsCard.js +38 -0
- package/dist/components/Data/shared/dataFormats.d.ts +35 -0
- package/dist/components/Data/shared/dataFormats.d.ts.map +1 -0
- package/dist/components/Data/shared/dataFormats.js +25 -0
- package/dist/components/Info/Badge.d.ts +1 -0
- package/dist/components/Info/Badge.d.ts.map +1 -0
- package/dist/components/Info/Badge.js +1 -0
- package/dist/components/Info/InfoCard.d.ts +9 -0
- package/dist/components/Info/InfoCard.d.ts.map +1 -0
- package/dist/components/Info/InfoCard.js +18 -0
- package/dist/components/Info/Notifications/NotificationProvider.js +2 -2
- package/dist/components/Info/Tooltips/InfoTooltip.d.ts +4 -2
- package/dist/components/Info/Tooltips/InfoTooltip.d.ts.map +1 -1
- package/dist/components/Info/Tooltips/InfoTooltip.js +2 -2
- package/dist/components/Info/Tooltips/Tooltip.d.ts +1 -1
- package/dist/components/Info/Tooltips/Tooltip.d.ts.map +1 -1
- package/dist/components/Info/Tooltips/Tooltip.js +1 -1
- package/dist/components/Inputs/Buttons/Button.d.ts +2 -1
- package/dist/components/Inputs/Buttons/Button.d.ts.map +1 -1
- package/dist/components/Inputs/Buttons/Button.js +12 -2
- package/dist/components/Inputs/Buttons/shared/variants.d.ts +50 -0
- package/dist/components/Inputs/Buttons/shared/variants.d.ts.map +1 -1
- package/dist/components/Inputs/Buttons/shared/variants.js +50 -0
- package/dist/components/Inputs/DatePickers/DatePicker.d.ts +12 -0
- package/dist/components/Inputs/DatePickers/DatePicker.d.ts.map +1 -0
- package/dist/components/Inputs/DatePickers/DatePicker.js +35 -0
- package/dist/components/Layout/AutoGrid.d.ts +8 -0
- package/dist/components/Layout/AutoGrid.d.ts.map +1 -0
- package/dist/components/Layout/AutoGrid.js +6 -0
- package/dist/components/Layout/Card.d.ts +8 -0
- package/dist/components/Layout/Card.d.ts.map +1 -0
- package/dist/components/Layout/Card.js +16 -0
- package/dist/components/Layout/Grid.d.ts +10 -0
- package/dist/components/Layout/Grid.d.ts.map +1 -0
- package/dist/components/Layout/Grid.js +9 -0
- package/dist/components/Layout/SectionCard.d.ts +11 -0
- package/dist/components/Layout/SectionCard.d.ts.map +1 -0
- package/dist/components/Layout/SectionCard.js +12 -0
- package/dist/components/Layout/Tabs.d.ts +17 -0
- package/dist/components/Layout/Tabs.d.ts.map +1 -0
- package/dist/components/Layout/Tabs.js +48 -0
- package/dist/components/Misc/IconBadge.d.ts +8 -0
- package/dist/components/Misc/IconBadge.d.ts.map +1 -0
- package/dist/components/Misc/IconBadge.js +29 -0
- package/dist/components/Typography/Fraction.d.ts +10 -0
- package/dist/components/Typography/Fraction.d.ts.map +1 -0
- package/dist/components/Typography/Fraction.js +7 -0
- package/dist/components/Typography/Text.d.ts.map +1 -1
- package/dist/components/Typography/Text.js +10 -2
- package/dist/components/index.d.ts +44 -32
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +44 -32
- package/dist/constants/breakpoints.d.ts +8 -0
- package/dist/constants/breakpoints.d.ts.map +1 -0
- package/dist/constants/breakpoints.js +8 -0
- package/dist/constants/colors.d.ts +97 -11
- package/dist/constants/colors.d.ts.map +1 -1
- package/dist/constants/colors.js +35 -19
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +1 -0
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/useMediaQuery.d.ts +7 -0
- package/dist/hooks/useMediaQuery.d.ts.map +1 -1
- package/dist/hooks/useMediaQuery.js +21 -0
- package/package.json +20 -4
- package/dist/components/Info/Modals/ConfirmationModal.d.ts +0 -18
- package/dist/components/Info/Modals/ConfirmationModal.d.ts.map +0 -1
- package/dist/components/Info/Modals/ConfirmationModal.js +0 -76
- package/dist/components/Info/Modals/InfoModal.d.ts +0 -15
- package/dist/components/Info/Modals/InfoModal.d.ts.map +0 -1
- package/dist/components/Info/Modals/InfoModal.js +0 -70
- package/dist/components/Info/Notifications/Notifications.d.ts +0 -16
- package/dist/components/Info/Notifications/Notifications.d.ts.map +0 -1
- package/dist/components/Info/Notifications/Notifications.js +0 -41
- package/dist/components/Misc/Copy.d.ts +0 -10
- package/dist/components/Misc/Copy.d.ts.map +0 -1
- package/dist/components/Misc/Copy.js +0 -18
- package/dist/components/Misc/MediaQuery.d.ts +0 -3
- package/dist/components/Misc/MediaQuery.d.ts.map +0 -1
- package/dist/components/Misc/MediaQuery.js +0 -2
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { modals } from '@mantine/modals';
|
|
3
|
-
import { neutral } from '../../../constants/colors';
|
|
4
|
-
import { Title } from '../../Typography/Title';
|
|
5
|
-
import { Stack } from '../../Layout/Stack';
|
|
6
|
-
import { Center } from '../../Layout/Center';
|
|
7
|
-
import { modalVariants } from './variants';
|
|
8
|
-
import { Button } from '../../Inputs/Buttons/Button';
|
|
9
|
-
export const useInfoModal = () => {
|
|
10
|
-
const show = (options) => {
|
|
11
|
-
const { variant = 'info', title, message, icon, onConfirm, size = '35rem' } = options;
|
|
12
|
-
const handleConfirm = () => {
|
|
13
|
-
if (onConfirm)
|
|
14
|
-
onConfirm();
|
|
15
|
-
modals.closeAll();
|
|
16
|
-
};
|
|
17
|
-
const selectedVariant = modalVariants[variant];
|
|
18
|
-
const iconContainer = {
|
|
19
|
-
width: '4.2rem',
|
|
20
|
-
height: '4.2rem',
|
|
21
|
-
borderRadius: '50%',
|
|
22
|
-
backgroundColor: selectedVariant.iconBackgroundColor,
|
|
23
|
-
border: `2px solid ${selectedVariant.iconColor}`,
|
|
24
|
-
};
|
|
25
|
-
const modalIcon = icon || (_jsx("i", { className: selectedVariant.icon, style: { color: selectedVariant.iconColor, fontSize: '2rem' } }));
|
|
26
|
-
const InfoModalContent = () => {
|
|
27
|
-
return (_jsx(Center, { h: "100%", w: "100%", children: _jsxs(Stack, { gap: "2rem", h: "100%", w: "100%", align: "center", children: [_jsxs(Stack, { gap: "1.5rem", align: "center", children: [_jsx(Center, { style: iconContainer, children: modalIcon }), _jsxs(Stack, { gap: "0.25rem", align: "center", children: [_jsx(Title, { variant: "cardHeader", align: "center", children: title || selectedVariant.title }), _jsx(Title, { variant: "cardSubheader", align: "center", children: message || selectedVariant.message })] })] }), _jsx(Center, { h: "100%", w: "100%", children: _jsx(Button, { onClick: handleConfirm, variant: selectedVariant.buttonVariant, children: "OK" }) })] }) }));
|
|
28
|
-
};
|
|
29
|
-
modals.open({
|
|
30
|
-
children: _jsx(InfoModalContent, {}),
|
|
31
|
-
size,
|
|
32
|
-
styles: {
|
|
33
|
-
content: {
|
|
34
|
-
borderRadius: '8px',
|
|
35
|
-
border: `1px solid ${neutral[50]}`,
|
|
36
|
-
boxShadow: '0px 0px 19px 0px #00000040',
|
|
37
|
-
},
|
|
38
|
-
header: {
|
|
39
|
-
padding: '0.8rem',
|
|
40
|
-
},
|
|
41
|
-
close: {
|
|
42
|
-
borderRadius: '16px',
|
|
43
|
-
backgroundColor: neutral[50],
|
|
44
|
-
width: '1.8rem',
|
|
45
|
-
height: '1.8rem',
|
|
46
|
-
'&:hover': {
|
|
47
|
-
backgroundColor: neutral[50],
|
|
48
|
-
},
|
|
49
|
-
'&:active': {
|
|
50
|
-
transform: 'none',
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
body: {
|
|
54
|
-
padding: '0 3.2rem 1.6rem 3.2rem',
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
const close = (modalId) => {
|
|
60
|
-
modals.close(modalId);
|
|
61
|
-
};
|
|
62
|
-
const closeAll = () => {
|
|
63
|
-
modals.closeAll();
|
|
64
|
-
};
|
|
65
|
-
return {
|
|
66
|
-
show,
|
|
67
|
-
close,
|
|
68
|
-
closeAll,
|
|
69
|
-
};
|
|
70
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { componentVariants } from './variants';
|
|
2
|
-
export declare const useNotifications: () => {
|
|
3
|
-
show: (options: {
|
|
4
|
-
variant?: keyof typeof componentVariants;
|
|
5
|
-
message: string;
|
|
6
|
-
title?: string;
|
|
7
|
-
id?: string;
|
|
8
|
-
}) => void;
|
|
9
|
-
showError: () => void;
|
|
10
|
-
showLoading: (options: {
|
|
11
|
-
message: string;
|
|
12
|
-
title?: string;
|
|
13
|
-
}) => string;
|
|
14
|
-
hide: (id: string) => Promise<void>;
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=Notifications.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Notifications.d.ts","sourceRoot":"","sources":["../../../../src/components/Info/Notifications/Notifications.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,eAAO,MAAM,gBAAgB;oBAMJ;QACrB,OAAO,CAAC,EAAE,MAAM,OAAO,iBAAiB,CAAC;QACzC,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,EAAE,CAAC,EAAE,MAAM,CAAC;KACb;;2BAmB6B;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE;eA7BzC,MAAM;CAiD/B,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { notifications as mantineNotifications } from '@mantine/notifications';
|
|
2
|
-
import { componentVariants } from './variants';
|
|
3
|
-
export const useNotifications = () => {
|
|
4
|
-
const hide = async (id) => {
|
|
5
|
-
mantineNotifications.hide(id);
|
|
6
|
-
await new Promise((resolve) => setTimeout(resolve, 200));
|
|
7
|
-
};
|
|
8
|
-
const show = (options) => {
|
|
9
|
-
const { variant = 'info', message, title, id } = options;
|
|
10
|
-
const selectedVariant = componentVariants[variant];
|
|
11
|
-
mantineNotifications.show({
|
|
12
|
-
title: title || selectedVariant.defaultTitle,
|
|
13
|
-
message,
|
|
14
|
-
icon: selectedVariant.icon,
|
|
15
|
-
autoClose: selectedVariant.autoClose,
|
|
16
|
-
id,
|
|
17
|
-
styles: {
|
|
18
|
-
root: {
|
|
19
|
-
borderLeft: `4px solid ${selectedVariant.color}`,
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
const showLoading = (options) => {
|
|
25
|
-
const notificationId = `${Math.random()}-${Math.random()}`;
|
|
26
|
-
show({
|
|
27
|
-
id: notificationId,
|
|
28
|
-
message: options.message,
|
|
29
|
-
title: options.title,
|
|
30
|
-
variant: 'loading',
|
|
31
|
-
});
|
|
32
|
-
return notificationId;
|
|
33
|
-
};
|
|
34
|
-
const showError = () => {
|
|
35
|
-
show({
|
|
36
|
-
variant: 'error',
|
|
37
|
-
message: 'An error has occurred. Please try again. If the issue persists, please contact us at support@taiv.tv',
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
return { show, showError, showLoading, hide };
|
|
41
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Copy.d.ts","sourceRoot":"","sources":["../../../src/components/Misc/Copy.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO;oBAIK;QACrB,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;QACjC,gBAAgB,CAAC,EAAE,OAAO,CAAC;QAC3B,mBAAmB,CAAC,EAAE,MAAM,CAAC;KAC9B;CAmBF,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { useClipboard } from '@mantine/hooks';
|
|
2
|
-
import { useNotifications } from '../Info/Notifications/Notifications';
|
|
3
|
-
export const useCopy = () => {
|
|
4
|
-
const clipboard = useClipboard();
|
|
5
|
-
const notifications = useNotifications();
|
|
6
|
-
const copy = (options) => {
|
|
7
|
-
const { onCopy, showNotification = true, notificationMessage = `${options.label ? `${options.label}: ` : ''}${options.value}`, } = options || {};
|
|
8
|
-
clipboard.copy(options.value);
|
|
9
|
-
onCopy === null || onCopy === void 0 ? void 0 : onCopy(options.value);
|
|
10
|
-
if (showNotification) {
|
|
11
|
-
notifications.show({
|
|
12
|
-
message: notificationMessage,
|
|
13
|
-
variant: 'copy',
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
return { copy };
|
|
18
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MediaQuery.d.ts","sourceRoot":"","sources":["../../../src/components/Misc/MediaQuery.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,IAAI,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEvE,eAAO,MAAM,aAAa,6BAAuB,CAAC"}
|