@xqmsg/ui-core 0.19.0 → 0.19.2
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/hooks/useToast.d.ts +2 -2
- package/dist/ui-core.cjs.development.js +37 -19
- package/dist/ui-core.cjs.development.js.map +1 -1
- package/dist/ui-core.cjs.production.min.js +1 -1
- package/dist/ui-core.cjs.production.min.js.map +1 -1
- package/dist/ui-core.esm.js +37 -19
- package/dist/ui-core.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/breadcrumbs/index.tsx +1 -0
- package/src/components/form/section/index.tsx +1 -0
- package/src/components/input/StackedMultiSelect/index.tsx +8 -2
- package/src/components/input/StackedPilledInput/index.tsx +1 -1
- package/src/components/input/components/dropdown/index.tsx +3 -3
- package/src/components/navigation/index.tsx +4 -3
- package/src/components/table/empty/index.tsx +1 -1
- package/src/components/table/index.tsx +6 -6
- package/src/components/tabs/index.tsx +2 -2
- package/src/components/toolbar/components/breadcrumbs/index.tsx +1 -1
- package/src/components/toolbar/components/breadcrumbs/item/index.tsx +0 -1
- package/src/components/toolbar/components/dropdown/index.tsx +2 -2
- package/src/hooks/useToast.tsx +10 -7
package/package.json
CHANGED
|
@@ -34,6 +34,7 @@ export const Breadcrumbs: React.FC<BreadcrumbsProps> = ({
|
|
|
34
34
|
<Flex flexDir={orientation === 'horizontal' ? 'row' : 'column'}>
|
|
35
35
|
{steps.map((step, idx) => (
|
|
36
36
|
<Flex
|
|
37
|
+
key={idx}
|
|
37
38
|
alignItems="center"
|
|
38
39
|
pr={orientation === 'horizontal' ? '16px' : 0}
|
|
39
40
|
py="4px"
|
|
@@ -298,8 +298,14 @@ const StackedMultiSelect = React.forwardRef<
|
|
|
298
298
|
ref={scrollRef}
|
|
299
299
|
>
|
|
300
300
|
{localValues.length ? (
|
|
301
|
-
localValues.map(option => (
|
|
302
|
-
<Box
|
|
301
|
+
localValues.map((option, idx) => (
|
|
302
|
+
<Box
|
|
303
|
+
key={idx}
|
|
304
|
+
mr="4px"
|
|
305
|
+
width="fit-content"
|
|
306
|
+
h="16px"
|
|
307
|
+
borderRadius="full"
|
|
308
|
+
>
|
|
303
309
|
<Token
|
|
304
310
|
label={option.label}
|
|
305
311
|
onDelete={() => handleDelete(option)}
|
|
@@ -230,7 +230,6 @@ const StackedPilledInput = React.forwardRef<
|
|
|
230
230
|
ref: inputWrapperRef,
|
|
231
231
|
handler: () => {
|
|
232
232
|
onBlur();
|
|
233
|
-
console.log('hi');
|
|
234
233
|
},
|
|
235
234
|
});
|
|
236
235
|
|
|
@@ -278,6 +277,7 @@ const StackedPilledInput = React.forwardRef<
|
|
|
278
277
|
{lastestFormValueToArray.length
|
|
279
278
|
? lastestFormValueToArray.map((label, index) => (
|
|
280
279
|
<Box
|
|
280
|
+
key={index}
|
|
281
281
|
mr="4px"
|
|
282
282
|
border={
|
|
283
283
|
tokenIndex === index
|
|
@@ -23,14 +23,14 @@ export const Dropdown: React.FC<DropdownProps> = ({
|
|
|
23
23
|
}) => {
|
|
24
24
|
const DropdownContent = useMemo(() => {
|
|
25
25
|
return options.map((option, idx) => (
|
|
26
|
-
|
|
26
|
+
<Box key={idx} width="100%">
|
|
27
27
|
{option.value === 'section_header' &&
|
|
28
28
|
options[idx + 1] &&
|
|
29
29
|
options[idx + 1].value !== 'section_header' && (
|
|
30
30
|
<Box
|
|
31
31
|
color={colors.label.secondary.light}
|
|
32
32
|
fontSize="13px"
|
|
33
|
-
width="
|
|
33
|
+
width="100%"
|
|
34
34
|
fontWeight="bold"
|
|
35
35
|
px="8px"
|
|
36
36
|
bg="inherit"
|
|
@@ -75,7 +75,7 @@ export const Dropdown: React.FC<DropdownProps> = ({
|
|
|
75
75
|
{option.label}
|
|
76
76
|
</Box>
|
|
77
77
|
)}
|
|
78
|
-
|
|
78
|
+
</Box>
|
|
79
79
|
));
|
|
80
80
|
}, [onSelectItem, optionIndex, options]);
|
|
81
81
|
|
|
@@ -48,14 +48,15 @@ export const NavigationMenu: React.FC<NavigationMenuProps> = ({
|
|
|
48
48
|
overflowY="auto"
|
|
49
49
|
width="220px"
|
|
50
50
|
>
|
|
51
|
-
{sortedGroupedMenuItems?.map(menuItemGroup => (
|
|
52
|
-
<Box _notLast={{ paddingBottom: '8px' }}>
|
|
51
|
+
{sortedGroupedMenuItems?.map((menuItemGroup, idx) => (
|
|
52
|
+
<Box key={idx} _notLast={{ paddingBottom: '8px' }}>
|
|
53
53
|
{menuItemGroup.groupHeader && (
|
|
54
54
|
<NavigationMenuHeader label={menuItemGroup.groupHeader} />
|
|
55
55
|
)}
|
|
56
|
-
{menuItemGroup.groupMenuItems.map(item => (
|
|
56
|
+
{menuItemGroup.groupMenuItems.map((item, idx) => (
|
|
57
57
|
<NavigationMenuItem
|
|
58
58
|
{...item}
|
|
59
|
+
key={idx}
|
|
59
60
|
isSelected={selectedMenuItem === item.label}
|
|
60
61
|
onClick={() => setSelectedMenuItem(item.label)}
|
|
61
62
|
/>
|
|
@@ -55,19 +55,19 @@ export function Table<T extends ReadonlyTableColumns>({
|
|
|
55
55
|
{headers && (
|
|
56
56
|
<Thead>
|
|
57
57
|
<Tr _odd={{ bg: colors.label.primary.dark }}>
|
|
58
|
-
{columnsAsConst.map(column => (
|
|
58
|
+
{columnsAsConst.map((column, idx) => (
|
|
59
59
|
// @ts-ignore
|
|
60
|
-
<Th>{headers[column]}</Th>
|
|
60
|
+
<Th key={idx}>{headers[column]}</Th>
|
|
61
61
|
))}
|
|
62
62
|
</Tr>
|
|
63
63
|
</Thead>
|
|
64
64
|
)}
|
|
65
65
|
<Tbody>
|
|
66
|
-
{body.map(row => (
|
|
67
|
-
<Tr>
|
|
68
|
-
{columnsAsConst.map(column => (
|
|
66
|
+
{body.map((row, idx) => (
|
|
67
|
+
<Tr key={idx}>
|
|
68
|
+
{columnsAsConst.map((column, idx) => (
|
|
69
69
|
// @ts-ignore
|
|
70
|
-
<Td>{row[column]}</Td>
|
|
70
|
+
<Td key={idx}>{row[column]}</Td>
|
|
71
71
|
))}
|
|
72
72
|
</Tr>
|
|
73
73
|
))}
|
|
@@ -29,8 +29,8 @@ export const TabsWrapper: React.FC<TabsWrapperProps> = ({
|
|
|
29
29
|
borderBottomLeftRadius={0}
|
|
30
30
|
borderBottomRightRadius={0}
|
|
31
31
|
>
|
|
32
|
-
{navItems.map(navItem => (
|
|
33
|
-
<Tab>{navItem}</Tab>
|
|
32
|
+
{navItems.map((navItem, idx) => (
|
|
33
|
+
<Tab key={idx}>{navItem}</Tab>
|
|
34
34
|
))}
|
|
35
35
|
</TabList>
|
|
36
36
|
{children}
|
|
@@ -45,7 +45,7 @@ export const ToolbarBreadcrumbs: React.FC<ToolbarBreadcrumbsProps> = ({
|
|
|
45
45
|
return (
|
|
46
46
|
<Flex height="26px">
|
|
47
47
|
{filteredPageList.map((page, i) => (
|
|
48
|
-
<Flex alignItems="center">
|
|
48
|
+
<Flex alignItems="center" key={i}>
|
|
49
49
|
<ToolbarBreadcrumbItem
|
|
50
50
|
page={getPageType(i)}
|
|
51
51
|
pageLabel={page.label}
|
|
@@ -26,7 +26,7 @@ export const Dropdown: React.FC<DropdownProps> = ({
|
|
|
26
26
|
}) => {
|
|
27
27
|
const DropdownContent = useMemo(() => {
|
|
28
28
|
return options.map((option, idx) => (
|
|
29
|
-
|
|
29
|
+
<Box key={idx}>
|
|
30
30
|
{option.value === 'section_header' &&
|
|
31
31
|
options[idx + 1] &&
|
|
32
32
|
options[idx + 1].value !== 'section_header' && (
|
|
@@ -74,7 +74,7 @@ export const Dropdown: React.FC<DropdownProps> = ({
|
|
|
74
74
|
{option.label}
|
|
75
75
|
</Flex>
|
|
76
76
|
)}
|
|
77
|
-
|
|
77
|
+
</Box>
|
|
78
78
|
));
|
|
79
79
|
}, [onSelectItem, optionIndex, options, setOptionIndex]);
|
|
80
80
|
|
package/src/hooks/useToast.tsx
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { ToastPosition, useToast as useChakraToast } from '@chakra-ui/react';
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { useCallback } from 'react';
|
|
3
3
|
import { Toast, ToastProps } from '../components/toast';
|
|
4
4
|
|
|
5
|
-
export const useToast = (
|
|
5
|
+
export const useToast = () => {
|
|
6
6
|
const toast = useChakraToast();
|
|
7
7
|
|
|
8
|
-
return (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
return useCallback(
|
|
9
|
+
(props: ToastProps & { position: ToastPosition }) =>
|
|
10
|
+
toast({
|
|
11
|
+
position: props.position,
|
|
12
|
+
render: () => <Toast {...props} />,
|
|
13
|
+
}),
|
|
14
|
+
[toast]
|
|
15
|
+
);
|
|
13
16
|
};
|