@taiv/ui 1.9.0 → 1.10.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/Info/Badge/Badge.d.ts +10 -8
- package/dist/components/Info/Badge/Badge.d.ts.map +1 -1
- package/dist/components/Info/Badge/Badge.js +23 -45
- package/dist/components/Info/Badge/Badge.stories.d.ts +15 -0
- package/dist/components/Info/Badge/Badge.stories.d.ts.map +1 -0
- package/dist/components/Info/Badge/Badge.stories.js +92 -0
- package/dist/components/Info/Badge/sizes.d.ts +34 -0
- package/dist/components/Info/Badge/sizes.d.ts.map +1 -0
- package/dist/components/Info/Badge/sizes.js +24 -0
- package/dist/components/Info/Badge/variants.d.ts +6 -0
- package/dist/components/Info/Badge/variants.d.ts.map +1 -0
- package/dist/components/Info/Badge/variants.js +22 -0
- package/dist/components/Info/Modals/FormModal/FormModal.d.ts +16 -0
- package/dist/components/Info/Modals/FormModal/FormModal.d.ts.map +1 -0
- package/dist/components/Info/Modals/FormModal/FormModal.js +59 -0
- package/dist/components/Info/Modals/FormModal/FormModal.stories.d.ts +14 -0
- package/dist/components/Info/Modals/FormModal/FormModal.stories.d.ts.map +1 -0
- package/dist/components/Info/Modals/FormModal/FormModal.stories.js +187 -0
- package/dist/components/Inputs/Buttons/Button/Button.d.ts +2 -2
- package/dist/components/Inputs/Buttons/Button/Button.d.ts.map +1 -1
- package/dist/components/Inputs/Buttons/Button/Button.js +3 -4
- package/dist/components/Inputs/Buttons/IconButton/IconButton.d.ts +2 -2
- package/dist/components/Inputs/Buttons/IconButton/IconButton.d.ts.map +1 -1
- package/dist/components/Inputs/Buttons/IconButton/IconButton.js +23 -4
- package/dist/components/Inputs/Buttons/shared/variants.d.ts +76 -188
- package/dist/components/Inputs/Buttons/shared/variants.d.ts.map +1 -1
- package/dist/components/Inputs/Buttons/shared/variants.js +49 -88
- package/dist/components/Layout/Table/Table.d.ts +3 -1
- package/dist/components/Layout/Table/Table.d.ts.map +1 -1
- package/dist/components/Layout/Table/Table.js +3 -3
- package/dist/components/Layout/Table/Table.stories.d.ts +3 -0
- package/dist/components/Layout/Table/Table.stories.d.ts.map +1 -1
- package/dist/components/Layout/Table/Table.stories.js +60 -1
- 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/dist/hooks/useConfirmationModal.d.ts +1 -1
- package/dist/hooks/useConfirmationModal.d.ts.map +1 -1
- package/dist/hooks/useConfirmationModal.js +3 -1
- package/dist/hooks/useInfoModal.d.ts +1 -1
- package/dist/hooks/useInfoModal.d.ts.map +1 -1
- package/dist/hooks/useInfoModal.js +3 -1
- package/package.json +2 -3
|
@@ -1,29 +1,42 @@
|
|
|
1
1
|
import { primary, neutral, error, success, warning } from '../../../../constants/colors';
|
|
2
|
-
|
|
2
|
+
// Overrides mantine due to rem difference
|
|
3
|
+
const loading = {
|
|
4
|
+
top: '-0.1rem',
|
|
5
|
+
right: '-0.1rem',
|
|
6
|
+
left: '-0.1rem',
|
|
7
|
+
bottom: '-0.1rem',
|
|
8
|
+
borderRadius: '8px',
|
|
9
|
+
};
|
|
10
|
+
const disabled = {
|
|
11
|
+
background: neutral[50],
|
|
12
|
+
border: `1px solid ${neutral[50]}`,
|
|
13
|
+
color: neutral[100],
|
|
14
|
+
};
|
|
15
|
+
export const componentVariants = {
|
|
3
16
|
primary: {
|
|
4
17
|
background: `linear-gradient(to right, ${primary[300]}, ${primary[200]})`,
|
|
18
|
+
border: `1px solid ${primary[200]}`,
|
|
5
19
|
color: 'white',
|
|
6
20
|
'&:hover': {
|
|
7
21
|
background: `linear-gradient(to right, ${primary[300]}, ${primary[300]})`,
|
|
8
|
-
transition: 'background 0.3s ease-in-out',
|
|
9
22
|
},
|
|
10
23
|
'&:active': {
|
|
11
24
|
background: 'white',
|
|
12
|
-
border: `1px solid ${primary[
|
|
13
|
-
color: primary[
|
|
25
|
+
border: `1px solid ${primary[300]}`,
|
|
26
|
+
color: primary[300],
|
|
14
27
|
},
|
|
15
28
|
'&:toggled': {
|
|
16
|
-
background:
|
|
29
|
+
background: `${primary[300]}`,
|
|
17
30
|
color: 'white',
|
|
18
31
|
},
|
|
19
32
|
'&:disabled': {
|
|
20
|
-
|
|
21
|
-
color: neutral[100],
|
|
33
|
+
...disabled,
|
|
22
34
|
},
|
|
23
35
|
'&[data-loading]': {
|
|
24
36
|
'& .mantine-Button-icon svg': {
|
|
25
37
|
stroke: 'white',
|
|
26
38
|
},
|
|
39
|
+
'&:before': loading,
|
|
27
40
|
},
|
|
28
41
|
},
|
|
29
42
|
secondary: {
|
|
@@ -44,91 +57,85 @@ export const buttonVariants = {
|
|
|
44
57
|
background: neutral[100],
|
|
45
58
|
color: 'neutral[200]',
|
|
46
59
|
},
|
|
47
|
-
'&:disabled':
|
|
48
|
-
background: neutral[50],
|
|
49
|
-
border: `1px solid ${neutral[50]}`,
|
|
50
|
-
color: neutral[100],
|
|
51
|
-
},
|
|
60
|
+
'&:disabled': disabled,
|
|
52
61
|
'&[data-loading]': {
|
|
53
62
|
'& .mantine-Button-icon svg': {
|
|
54
63
|
stroke: neutral[200],
|
|
55
64
|
},
|
|
65
|
+
'&:before': loading,
|
|
56
66
|
},
|
|
57
67
|
},
|
|
58
68
|
cancel: {
|
|
59
69
|
background: error[200],
|
|
60
70
|
color: 'white',
|
|
71
|
+
border: `1px solid ${error[200]}`,
|
|
61
72
|
'&:hover': {
|
|
62
73
|
background: error[100],
|
|
74
|
+
border: `1px solid ${error[100]}`,
|
|
63
75
|
},
|
|
64
76
|
'&:active': {
|
|
65
77
|
background: 'white',
|
|
66
|
-
border: `1px solid ${error[
|
|
67
|
-
color: error[
|
|
78
|
+
border: `1px solid ${error[100]}`,
|
|
79
|
+
color: error[100],
|
|
68
80
|
},
|
|
69
81
|
'&:toggled': {
|
|
70
82
|
background: error[100],
|
|
71
83
|
color: 'white',
|
|
72
84
|
},
|
|
73
|
-
'&:disabled':
|
|
74
|
-
background: error[50],
|
|
75
|
-
border: `1px solid ${error[50]}`,
|
|
76
|
-
color: 'white',
|
|
77
|
-
},
|
|
85
|
+
'&:disabled': disabled,
|
|
78
86
|
'&[data-loading]': {
|
|
79
87
|
'& .mantine-Button-icon svg': {
|
|
80
88
|
stroke: 'white',
|
|
81
89
|
},
|
|
90
|
+
'&:before': loading,
|
|
82
91
|
},
|
|
83
92
|
},
|
|
84
93
|
success: {
|
|
85
94
|
background: success[200],
|
|
86
95
|
color: 'white',
|
|
96
|
+
border: `1px solid ${success[200]}`,
|
|
87
97
|
'&:hover': {
|
|
88
98
|
background: success[100],
|
|
99
|
+
border: `1px solid ${success[100]}`,
|
|
89
100
|
},
|
|
90
101
|
'&:active': {
|
|
91
102
|
background: 'white',
|
|
92
|
-
border: `1px solid ${success[
|
|
93
|
-
color: success[
|
|
103
|
+
border: `1px solid ${success[100]}`,
|
|
104
|
+
color: success[100],
|
|
94
105
|
},
|
|
95
106
|
'&:toggled': {
|
|
96
107
|
background: success[100],
|
|
97
108
|
},
|
|
98
|
-
'&:disabled':
|
|
99
|
-
background: success[50],
|
|
100
|
-
border: `1px solid ${success[50]}`,
|
|
101
|
-
color: 'white',
|
|
102
|
-
},
|
|
109
|
+
'&:disabled': disabled,
|
|
103
110
|
'&[data-loading]': {
|
|
104
111
|
'& .mantine-Button-icon svg': {
|
|
105
112
|
stroke: 'white',
|
|
106
113
|
},
|
|
114
|
+
'&:before': loading,
|
|
107
115
|
},
|
|
108
116
|
},
|
|
109
117
|
warning: {
|
|
110
118
|
background: warning[200],
|
|
111
119
|
color: 'white',
|
|
120
|
+
border: `1px solid ${warning[200]}`,
|
|
112
121
|
'&:hover': {
|
|
113
122
|
background: warning[100],
|
|
123
|
+
border: `1px solid ${warning[100]}`,
|
|
114
124
|
},
|
|
115
125
|
'&:active': {
|
|
116
126
|
background: 'white',
|
|
117
|
-
border: `1px solid ${warning[
|
|
118
|
-
color: warning[
|
|
127
|
+
border: `1px solid ${warning[100]}`,
|
|
128
|
+
color: warning[100],
|
|
119
129
|
},
|
|
120
130
|
'&:toggled': {
|
|
121
131
|
background: warning[100],
|
|
122
132
|
},
|
|
123
|
-
'&:disabled':
|
|
124
|
-
background: warning[50],
|
|
125
|
-
border: `1px solid ${warning[50]}`,
|
|
126
|
-
color: 'white',
|
|
127
|
-
},
|
|
133
|
+
'&:disabled': disabled,
|
|
128
134
|
'&[data-loading]': {
|
|
129
135
|
'& .mantine-Button-icon svg': {
|
|
130
136
|
stroke: 'white',
|
|
131
137
|
},
|
|
138
|
+
'&:before': loading,
|
|
132
139
|
},
|
|
133
140
|
},
|
|
134
141
|
text: {
|
|
@@ -158,6 +165,7 @@ export const buttonVariants = {
|
|
|
158
165
|
'& .mantine-Button-icon svg': {
|
|
159
166
|
stroke: neutral[200],
|
|
160
167
|
},
|
|
168
|
+
'&:before': loading,
|
|
161
169
|
},
|
|
162
170
|
},
|
|
163
171
|
nav: {
|
|
@@ -186,63 +194,16 @@ export const buttonVariants = {
|
|
|
186
194
|
'& .mantine-Button-icon svg': {
|
|
187
195
|
stroke: neutral[200],
|
|
188
196
|
},
|
|
197
|
+
'&:before': loading,
|
|
189
198
|
},
|
|
190
199
|
},
|
|
191
200
|
};
|
|
192
201
|
export const subtleVariants = {
|
|
193
|
-
primary: {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
},
|
|
201
|
-
'&:active': {
|
|
202
|
-
background: 'white',
|
|
203
|
-
border: `1px solid ${primary[200]}`,
|
|
204
|
-
color: primary[200],
|
|
205
|
-
},
|
|
206
|
-
'&:toggled': {
|
|
207
|
-
background: primary[300],
|
|
208
|
-
color: 'white',
|
|
209
|
-
},
|
|
210
|
-
},
|
|
211
|
-
secondary: {
|
|
212
|
-
...buttonVariants.secondary,
|
|
213
|
-
background: 'white',
|
|
214
|
-
color: neutral[200],
|
|
215
|
-
border: `1px solid ${neutral[50]}`,
|
|
216
|
-
},
|
|
217
|
-
cancel: {
|
|
218
|
-
...buttonVariants.cancel,
|
|
219
|
-
background: 'white',
|
|
220
|
-
color: error[200],
|
|
221
|
-
},
|
|
222
|
-
success: {
|
|
223
|
-
...buttonVariants.success,
|
|
224
|
-
background: 'white',
|
|
225
|
-
color: success[200],
|
|
226
|
-
},
|
|
227
|
-
warning: {
|
|
228
|
-
...buttonVariants.warning,
|
|
229
|
-
background: 'white',
|
|
230
|
-
color: warning[200],
|
|
231
|
-
},
|
|
232
|
-
text: {
|
|
233
|
-
...buttonVariants.text,
|
|
234
|
-
background: 'transparent',
|
|
235
|
-
color: neutral[200],
|
|
236
|
-
border: 'none',
|
|
237
|
-
padding: '0',
|
|
238
|
-
height: 'auto',
|
|
239
|
-
minWidth: 'unset',
|
|
240
|
-
},
|
|
241
|
-
nav: {
|
|
242
|
-
...buttonVariants.nav,
|
|
243
|
-
background: 'white',
|
|
244
|
-
paddingLeft: '0.8rem',
|
|
245
|
-
color: neutral[200],
|
|
246
|
-
border: 'none',
|
|
247
|
-
},
|
|
202
|
+
primary: { color: primary[200] },
|
|
203
|
+
secondary: { color: neutral[200] },
|
|
204
|
+
cancel: { color: error[200] },
|
|
205
|
+
success: { color: success[200] },
|
|
206
|
+
warning: { color: warning[200] },
|
|
207
|
+
text: { color: neutral[200] },
|
|
208
|
+
nav: { color: neutral[200] },
|
|
248
209
|
};
|
|
@@ -9,7 +9,9 @@ interface TableProps<T> {
|
|
|
9
9
|
ListItem: React.ComponentType<{
|
|
10
10
|
data: T;
|
|
11
11
|
}>;
|
|
12
|
+
placeholder?: React.ReactNode;
|
|
13
|
+
shadow?: boolean;
|
|
12
14
|
}
|
|
13
|
-
declare const Table: <T>({ columnConfigs, data, ListItem }: TableProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare const Table: <T>({ columnConfigs, data, ListItem, placeholder, shadow }: TableProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
14
16
|
export { Table, type ColumnConfig, type TableProps };
|
|
15
17
|
//# sourceMappingURL=Table.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/Table/Table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAqB,MAAM,OAAO,CAAC;AAIhE,UAAU,YAAY;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED,UAAU,UAAU,CAAC,CAAC;IACpB,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,QAAQ,EAAE,KAAK,CAAC,aAAa,CAAC;QAAE,IAAI,EAAE,CAAC,CAAA;KAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/Table/Table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAqB,MAAM,OAAO,CAAC;AAIhE,UAAU,YAAY;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED,UAAU,UAAU,CAAC,CAAC;IACpB,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,QAAQ,EAAE,KAAK,CAAC,aAAa,CAAC;QAAE,IAAI,EAAE,CAAC,CAAA;KAAE,CAAC,CAAC;IAC3C,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,QAAA,MAAM,KAAK,GAAI,CAAC,EAAG,wDAAgE,UAAU,CAAC,CAAC,CAAC,4CAsE/F,CAAC;AAEF,OAAO,EAAE,KAAK,EAAE,KAAK,YAAY,EAAE,KAAK,UAAU,EAAE,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useEffect, useRef } from 'react';
|
|
3
3
|
import { Box } from '../Box/Box';
|
|
4
4
|
import { fontWeight, neutral } from '../../../constants';
|
|
5
|
-
const Table = ({ columnConfigs, data, ListItem }) => {
|
|
5
|
+
const Table = ({ columnConfigs, data, ListItem, placeholder, shadow = false }) => {
|
|
6
6
|
const tableRef = useRef(null);
|
|
7
7
|
/**
|
|
8
8
|
* Apply column styles to the table cells.
|
|
@@ -31,7 +31,7 @@ const Table = ({ columnConfigs, data, ListItem }) => {
|
|
|
31
31
|
return (_jsx(Box, { sx: {
|
|
32
32
|
borderTopLeftRadius: '8px',
|
|
33
33
|
borderTopRightRadius: '8px',
|
|
34
|
-
boxShadow: '
|
|
34
|
+
boxShadow: shadow ? '0 8px 40px 0 rgba(112, 144, 176, 0.20)' : 'none',
|
|
35
35
|
overflow: 'hidden',
|
|
36
36
|
}, children: _jsxs("table", { ref: tableRef, style: {
|
|
37
37
|
width: '100%',
|
|
@@ -43,6 +43,6 @@ const Table = ({ columnConfigs, data, ListItem }) => {
|
|
|
43
43
|
paddingBottom: '9px',
|
|
44
44
|
paddingTop: '9px',
|
|
45
45
|
...column.style,
|
|
46
|
-
}, children: column.heading }, column.heading || `column-${index}`))) }) }), _jsx("tbody", { children: data.map((item) => (_jsx(ListItem, { data: item }, String(item).slice(0, 10)))) })] }) }));
|
|
46
|
+
}, children: column.heading }, column.heading || `column-${index}`))) }) }), _jsx("tbody", { children: (!data || data.length === 0) && placeholder ? _jsx("tr", { children: _jsx("td", { colSpan: columnConfigs.length, children: placeholder }) }) : data.map((item) => (_jsx(ListItem, { data: item }, String(item).slice(0, 10)))) })] }) }));
|
|
47
47
|
};
|
|
48
48
|
export { Table };
|
|
@@ -7,4 +7,7 @@ export declare const BasicTable: Story;
|
|
|
7
7
|
export declare const TableWithCustomComponents: Story;
|
|
8
8
|
export declare const TableWithProgressBars: Story;
|
|
9
9
|
export declare const StyledColumns: Story;
|
|
10
|
+
export declare const TableWithPlaceholder: Story;
|
|
11
|
+
export declare const TableWithoutPlaceholder: Story;
|
|
12
|
+
export declare const TableWithShadow: Story;
|
|
10
13
|
//# sourceMappingURL=Table.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/Table/Table.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Table.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/Table/Table.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAUhC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,KAAK,CAyB5B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAyPnC,eAAO,MAAM,UAAU,EAAE,KAmBxB,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,KAqBvC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,KAoBnC,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAmB3B,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,KAsBlC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,KAerC,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAa7B,CAAC"}
|
|
@@ -2,8 +2,13 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Table } from './Table';
|
|
3
3
|
import { Badge } from '../../Info/Badge/Badge';
|
|
4
4
|
import { Button } from '../../Inputs/Buttons/Button/Button';
|
|
5
|
+
import { Text } from '../../Typography/Text/Text';
|
|
6
|
+
import { Center } from '../Center/Center';
|
|
7
|
+
import { IconInfoCircle } from '@tabler/icons-react';
|
|
8
|
+
import { neutral } from '../../../constants/colors';
|
|
9
|
+
import { Group } from '../Group/Group';
|
|
5
10
|
const meta = {
|
|
6
|
-
title: '
|
|
11
|
+
title: 'Components/Layout/Table',
|
|
7
12
|
component: Table,
|
|
8
13
|
argTypes: {
|
|
9
14
|
columnConfigs: {
|
|
@@ -18,6 +23,14 @@ const meta = {
|
|
|
18
23
|
control: false,
|
|
19
24
|
description: 'Component that renders each table row',
|
|
20
25
|
},
|
|
26
|
+
placeholder: {
|
|
27
|
+
control: { type: 'object' },
|
|
28
|
+
description: 'Placeholder to display when no data is available',
|
|
29
|
+
},
|
|
30
|
+
shadow: {
|
|
31
|
+
control: { type: 'boolean' },
|
|
32
|
+
description: 'Adds shadow to the table',
|
|
33
|
+
},
|
|
21
34
|
},
|
|
22
35
|
};
|
|
23
36
|
export default meta;
|
|
@@ -255,3 +268,49 @@ export const StyledColumns = {
|
|
|
255
268
|
},
|
|
256
269
|
},
|
|
257
270
|
};
|
|
271
|
+
export const TableWithPlaceholder = {
|
|
272
|
+
args: {
|
|
273
|
+
columnConfigs: [
|
|
274
|
+
{ heading: 'Name', style: { width: '50%' } },
|
|
275
|
+
{ heading: 'Email', style: { width: '50%' } },
|
|
276
|
+
],
|
|
277
|
+
placeholder: (_jsx(Center, { py: '5rem', children: _jsxs(Group, { gap: '0.5rem', align: 'center', children: [_jsx(IconInfoCircle, { color: neutral[200], size: '2rem' }), _jsx(Text, { children: "No data available at this time" })] }) })),
|
|
278
|
+
},
|
|
279
|
+
parameters: {
|
|
280
|
+
docs: {
|
|
281
|
+
description: {
|
|
282
|
+
story: 'A table with a placeholder displayed when no data is available.',
|
|
283
|
+
},
|
|
284
|
+
},
|
|
285
|
+
},
|
|
286
|
+
};
|
|
287
|
+
export const TableWithoutPlaceholder = {
|
|
288
|
+
args: {
|
|
289
|
+
columnConfigs: [
|
|
290
|
+
{ heading: 'Name', style: { width: '50%' } },
|
|
291
|
+
{ heading: 'Email', style: { width: '50%' } },
|
|
292
|
+
],
|
|
293
|
+
data: [],
|
|
294
|
+
},
|
|
295
|
+
parameters: {
|
|
296
|
+
docs: {
|
|
297
|
+
description: {
|
|
298
|
+
story: 'A table with no placeholder displayed when no data is available.',
|
|
299
|
+
},
|
|
300
|
+
},
|
|
301
|
+
},
|
|
302
|
+
};
|
|
303
|
+
export const TableWithShadow = {
|
|
304
|
+
args: {
|
|
305
|
+
columnConfigs: [
|
|
306
|
+
{ heading: 'Name', style: { width: '25%', paddingLeft: '20px', fontWeight: '600' } },
|
|
307
|
+
{ heading: 'Email', style: { width: '30%', textAlign: 'left' } },
|
|
308
|
+
{ heading: 'Role', style: { width: '20%', textAlign: 'center' } },
|
|
309
|
+
{ heading: 'Status', style: { width: '15%', textAlign: 'center' } },
|
|
310
|
+
{ heading: 'Last Login', style: { width: '10%', textAlign: 'right', paddingRight: '20px' } },
|
|
311
|
+
],
|
|
312
|
+
data: userData,
|
|
313
|
+
ListItem: UserListItem,
|
|
314
|
+
shadow: true,
|
|
315
|
+
},
|
|
316
|
+
};
|
|
@@ -7,6 +7,7 @@ export { RemovableItemList } from './Data/RemovableItemList/RemovableItemList';
|
|
|
7
7
|
export { StatsCard } from './Data/Cards/StatsCard/StatsCard';
|
|
8
8
|
export { StatsBadge } from './Data/StatsBadge/StatsBadge';
|
|
9
9
|
export { Modal } from './Info/Modals/Modal/Modal';
|
|
10
|
+
export { FormModal } from './Info/Modals/FormModal/FormModal';
|
|
10
11
|
export { ModalProvider } from './Info/Modals/ModalProvider/ModalProvider';
|
|
11
12
|
export { NotificationProvider } from './Info/Notifications/NotificationProvider/NotificationProvider';
|
|
12
13
|
export { Badge } from './Info/Badge/Badge';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.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Cards/StatsCard/StatsCard';
|
|
|
9
9
|
export { StatsBadge } from './Data/StatsBadge/StatsBadge';
|
|
10
10
|
//Info
|
|
11
11
|
export { Modal } from './Info/Modals/Modal/Modal';
|
|
12
|
+
export { FormModal } from './Info/Modals/FormModal/FormModal';
|
|
12
13
|
export { ModalProvider } from './Info/Modals/ModalProvider/ModalProvider';
|
|
13
14
|
export { NotificationProvider } from './Info/Notifications/NotificationProvider/NotificationProvider';
|
|
14
15
|
export { Badge } from './Info/Badge/Badge';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConfirmationModal.d.ts","sourceRoot":"","sources":["../../src/hooks/useConfirmationModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAInE,eAAO,MAAM,oBAAoB;oBACR;QACrB,OAAO,CAAC,EAAE,OAAO,CAAC,MAAM,OAAO,aAAa,EAAE,OAAO,CAAC,CAAC;QACvD,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,IAAI,CAAC,EAAE,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"useConfirmationModal.d.ts","sourceRoot":"","sources":["../../src/hooks/useConfirmationModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAInE,eAAO,MAAM,oBAAoB;oBACR;QACrB,OAAO,CAAC,EAAE,OAAO,CAAC,MAAM,OAAO,aAAa,EAAE,OAAO,CAAC,CAAC;QACvD,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,IAAI,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;QAC1B,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;QACvB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;QACtB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;KACxB;qBAwFuB,MAAM;;CAa/B,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
2
3
|
import { modals } from '@mantine/modals';
|
|
3
4
|
import { neutral } from '../constants/colors';
|
|
4
5
|
import { Title } from '../components/Typography/Title/Title';
|
|
@@ -28,7 +29,8 @@ export const useConfirmationModal = () => {
|
|
|
28
29
|
backgroundColor: selectedVariant.iconBackgroundColor,
|
|
29
30
|
border: `2px solid ${selectedVariant.iconColor}`,
|
|
30
31
|
};
|
|
31
|
-
const
|
|
32
|
+
const coloredIcon = icon && React.cloneElement(icon, { color: icon.props.color || selectedVariant.iconColor });
|
|
33
|
+
const modalIcon = coloredIcon || _jsx("i", { className: selectedVariant.icon, style: { color: selectedVariant.iconColor, fontSize: '2rem' } });
|
|
32
34
|
const ConfirmModalContent = () => {
|
|
33
35
|
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: _jsxs(Group, { gap: "1rem", align: "center", children: [_jsx(Button, { onClick: handleCancel, variant: "secondary", children: cancelLabel || selectedVariant.cancelLabel }), _jsx(Button, { onClick: handleConfirm, variant: selectedVariant.buttonVariant, children: confirmLabel || selectedVariant.confirmLabel })] }) })] }) }));
|
|
34
36
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInfoModal.d.ts","sourceRoot":"","sources":["../../src/hooks/useInfoModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAGnE,eAAO,MAAM,YAAY;oBACA;QAAE,OAAO,CAAC,EAAE,MAAM,OAAO,aAAa,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"useInfoModal.d.ts","sourceRoot":"","sources":["../../src/hooks/useInfoModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAGnE,eAAO,MAAM,YAAY;oBACA;QAAE,OAAO,CAAC,EAAE,MAAM,OAAO,aAAa,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE;qBA8EpJ,MAAM;;CAa/B,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
2
3
|
import { modals } from '@mantine/modals';
|
|
3
4
|
import { neutral } from '../constants/colors';
|
|
4
5
|
import { Title } from '../components/Typography/Title/Title';
|
|
@@ -22,7 +23,8 @@ export const useInfoModal = () => {
|
|
|
22
23
|
backgroundColor: selectedVariant.iconBackgroundColor,
|
|
23
24
|
border: `2px solid ${selectedVariant.iconColor}`,
|
|
24
25
|
};
|
|
25
|
-
const
|
|
26
|
+
const coloredIcon = icon && React.cloneElement(icon, { color: icon.props.color || selectedVariant.iconColor });
|
|
27
|
+
const modalIcon = coloredIcon || _jsx("i", { className: selectedVariant.icon, style: { color: selectedVariant.iconColor, fontSize: '2rem' } });
|
|
26
28
|
const InfoModalContent = () => {
|
|
27
29
|
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
30
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taiv/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"author": "Taiv",
|
|
5
5
|
"description": "Taiv's web UI Toolkit built on Mantine v6",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -17,8 +17,7 @@
|
|
|
17
17
|
"dev": "npm link && tsc --watch",
|
|
18
18
|
"clean": "rm -rf dist",
|
|
19
19
|
"storybook": "storybook dev -p 6006",
|
|
20
|
-
"build-storybook": "storybook build"
|
|
21
|
-
"chromatic": "npx chromatic --project-token=chpt_8fb53e9533016b9"
|
|
20
|
+
"build-storybook": "storybook build"
|
|
22
21
|
},
|
|
23
22
|
"dependencies": {
|
|
24
23
|
"@emotion/react": "^11.14.0",
|