@soul-refiner/design-system 0.2.108 → 0.2.110
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.
|
@@ -254,7 +254,6 @@ const Dropdown = styled(Box) `
|
|
|
254
254
|
border: 1px solid var(--color-primary-blue-2);
|
|
255
255
|
justify-content: flex-start;
|
|
256
256
|
padding: 16px;
|
|
257
|
-
border-radius: 8px;
|
|
258
257
|
border: 0;
|
|
259
258
|
|
|
260
259
|
&:hover {
|
|
@@ -266,5 +265,7 @@ const Dropdown = styled(Box) `
|
|
|
266
265
|
${Styles.flex}
|
|
267
266
|
${Styles.padding}
|
|
268
267
|
|
|
268
|
+
border-radius: 8px;
|
|
269
|
+
|
|
269
270
|
${({ $sx }) => ($sx ? $sx : '')}
|
|
270
271
|
`;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { IconProps } from '../../';
|
|
2
3
|
type NativeProps = Pick<React.HTMLAttributes<HTMLDivElement>, 'children' | 'onBlur' | 'onBlurCapture' | 'onClick' | 'onChange' | 'onMouseDown' | 'onMouseDownCapture' | 'onMouseEnter' | 'onMouseLeave' | 'onMouseOut' | 'onMouseOver'>;
|
|
3
4
|
type User = {
|
|
4
5
|
id: string;
|
|
@@ -17,6 +18,7 @@ export interface UsersSelectionProps extends NativeProps, React.PropsWithChildre
|
|
|
17
18
|
title: string;
|
|
18
19
|
userIsChecked: Record<string, boolean>;
|
|
19
20
|
setUserIsChecked: React.Dispatch<React.SetStateAction<Record<string, boolean>>>;
|
|
21
|
+
icon: React.ComponentType<IconProps>;
|
|
20
22
|
}
|
|
21
|
-
export declare const UsersSelection: ({ closeOnBlur, disabled, offset, sx, containerSx, searchSx, users, label, title, userIsChecked, setUserIsChecked, ...rest }: UsersSelectionProps) => React.JSX.Element;
|
|
23
|
+
export declare const UsersSelection: ({ closeOnBlur, disabled, offset, sx, containerSx, searchSx, users, label, title, userIsChecked, setUserIsChecked, icon, ...rest }: UsersSelectionProps) => React.JSX.Element;
|
|
22
24
|
export {};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { Group } from '../../../icons';
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import styled from 'styled-components';
|
|
5
4
|
import { Button, P, Search, Checkbox, Box } from '../../';
|
|
6
|
-
export const UsersSelection = ({ closeOnBlur = true, disabled = false, offset = [0, 0], sx, containerSx, searchSx, users, label, title, userIsChecked, setUserIsChecked, ...rest }) => {
|
|
5
|
+
export const UsersSelection = ({ closeOnBlur = true, disabled = false, offset = [0, 0], sx, containerSx, searchSx, users, label, title, userIsChecked, setUserIsChecked, icon, ...rest }) => {
|
|
7
6
|
const wrapperRef = React.useRef(null);
|
|
8
|
-
const [open, setOpen] = React.useState(
|
|
7
|
+
const [open, setOpen] = React.useState(false);
|
|
9
8
|
const [searchValue, setSearchValue] = React.useState('');
|
|
10
9
|
React.useEffect(() => {
|
|
11
10
|
if (disabled) {
|
|
@@ -25,9 +24,10 @@ export const UsersSelection = ({ closeOnBlur = true, disabled = false, offset =
|
|
|
25
24
|
setOpen(false);
|
|
26
25
|
}
|
|
27
26
|
};
|
|
27
|
+
const Icon = icon;
|
|
28
28
|
return (React.createElement(Wrapper, { "$sx": sx, tabIndex: 0, ref: wrapperRef, onBlurCapture: handleBlur, ...rest },
|
|
29
29
|
React.createElement(Button, { type: "dropdown", isDropdownOpen: open, onClick: handleOpen },
|
|
30
|
-
React.createElement(
|
|
30
|
+
React.createElement(Icon, { size: 16, sx: "margin-right: 16px;" }),
|
|
31
31
|
label),
|
|
32
32
|
open && (React.createElement(Container, { "$offset": offset, "$sx": containerSx },
|
|
33
33
|
React.createElement(P, null, title),
|
|
@@ -69,6 +69,7 @@ const Container = styled.div `
|
|
|
69
69
|
border-radius: 8px;
|
|
70
70
|
overflow: auto;
|
|
71
71
|
padding: 24px;
|
|
72
|
+
z-index: 2;
|
|
72
73
|
|
|
73
74
|
${({ $sx }) => ($sx ? $sx : '')}
|
|
74
75
|
|