nurseitaly-components 0.0.1 → 0.0.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/basic/ProfileDropdown/ProfileDropdown.d.ts +13 -0
- package/dist/basic/ProfileDropdown/ProfileDropdown.js +17 -0
- package/dist/basic/ProfileDropdown/index.d.ts +2 -0
- package/dist/basic/ProfileDropdown/index.js +2 -0
- package/dist/basic/ProfileDropdown/styles.scss +28 -0
- package/dist/basic/index.d.ts +2 -0
- package/dist/basic/index.js +2 -0
- package/dist/configs/useMessageUtils.d.ts +5 -4
- package/package.json +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import './styles.scss';
|
|
2
|
+
export declare const ProfileColors: readonly ["white", "blue"];
|
|
3
|
+
type ProfileColors = (typeof ProfileColors)[number];
|
|
4
|
+
export type Props = {
|
|
5
|
+
src?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
color?: ProfileColors;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
title?: string;
|
|
10
|
+
onClick?: (b: boolean) => void;
|
|
11
|
+
};
|
|
12
|
+
export default function ProfileDropdown({ src, className, color, disabled, title, onClick, }: Props): import("react").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import cx from 'classnames';
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import Avatar from '../Avatar';
|
|
5
|
+
import Icon from '../Icon';
|
|
6
|
+
import './styles.scss';
|
|
7
|
+
export const ProfileColors = ['white', 'blue'];
|
|
8
|
+
export default function ProfileDropdown({ src, className, color = 'white', disabled = false, title, onClick, }) {
|
|
9
|
+
const [active, setActive] = useState(false);
|
|
10
|
+
const getClassNames = cx('ds-profile-dropdown', className, color, {
|
|
11
|
+
disabled: disabled,
|
|
12
|
+
});
|
|
13
|
+
return (_jsxs("div", { className: getClassNames, onClick: () => {
|
|
14
|
+
setActive(!active);
|
|
15
|
+
onClick && onClick(!active);
|
|
16
|
+
}, children: [_jsx(Avatar, { size: "small", src: src, title: title }), _jsx(Icon, { name: "arrow_drop_down", className: "arrow" })] }));
|
|
17
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
.ds-profile-dropdown {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
|
|
5
|
+
&.disabled {
|
|
6
|
+
> .arrow {
|
|
7
|
+
color: var(--icon-disabled) !important;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
&.white {
|
|
12
|
+
> .arrow {
|
|
13
|
+
color: var(--icon-light-fixed);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&.blue {
|
|
18
|
+
> .arrow {
|
|
19
|
+
color: var(--icon-accent);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&:hover.blue {
|
|
24
|
+
> .arrow {
|
|
25
|
+
color: var(--icon-accent-hover);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
package/dist/basic/index.d.ts
CHANGED
|
@@ -15,6 +15,8 @@ export { IconSizes } from './Icon/Icon';
|
|
|
15
15
|
export { ICON_SIZE_PX, iconSizeToPx } from './Icon/IconSizes';
|
|
16
16
|
export { default as IconButton } from './IconButton';
|
|
17
17
|
export { default as Pill } from './Pill';
|
|
18
|
+
export { default as ProfileDropdown } from './ProfileDropdown';
|
|
19
|
+
export { ProfileColors } from './ProfileDropdown/ProfileDropdown';
|
|
18
20
|
export { default as SelectField } from './SelectField';
|
|
19
21
|
export { default as AsyncSelectField } from './SelectField/AsyncSelectField';
|
|
20
22
|
export type { SelectItem } from './SelectField/SelectField';
|
package/dist/basic/index.js
CHANGED
|
@@ -14,6 +14,8 @@ export { IconSizes } from './Icon/Icon';
|
|
|
14
14
|
export { ICON_SIZE_PX, iconSizeToPx } from './Icon/IconSizes';
|
|
15
15
|
export { default as IconButton } from './IconButton';
|
|
16
16
|
export { default as Pill } from './Pill';
|
|
17
|
+
export { default as ProfileDropdown } from './ProfileDropdown';
|
|
18
|
+
export { ProfileColors } from './ProfileDropdown/ProfileDropdown';
|
|
17
19
|
export { default as SelectField } from './SelectField';
|
|
18
20
|
export { default as AsyncSelectField } from './SelectField/AsyncSelectField';
|
|
19
21
|
export { default as SelectMultipleField } from './SelectField/SelectMultipleField';
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { TFunction } from 'i18next';
|
|
2
1
|
type MessageDispatcher = {
|
|
3
2
|
key: string;
|
|
4
3
|
ns?: string;
|
|
5
|
-
t
|
|
4
|
+
/** Consumer `t` / `i18n.t` — kept loose across i18next major versions. */
|
|
5
|
+
t: any;
|
|
6
6
|
};
|
|
7
7
|
type ErrorDispatcher = {
|
|
8
8
|
err: any;
|
|
9
|
-
t
|
|
9
|
+
/** Consumer `t` / `i18n.t` — kept loose across i18next major versions. */
|
|
10
|
+
t?: any;
|
|
10
11
|
key?: string;
|
|
11
12
|
};
|
|
12
|
-
export declare const getErrorMessageValue: ({ err, t, key }: ErrorDispatcher) =>
|
|
13
|
+
export declare const getErrorMessageValue: ({ err, t, key }: ErrorDispatcher) => any;
|
|
13
14
|
export declare const useMessageUtils: () => {
|
|
14
15
|
dispatchLoading: (val: boolean, text?: string) => void;
|
|
15
16
|
dispatchError: ({ err, t, key }: ErrorDispatcher) => void;
|