@ssa-ui-kit/core 3.10.5 → 3.12.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/Avatar/Avatar.d.ts +21 -22
- package/dist/components/Avatar/index.d.ts +1 -0
- package/dist/components/Avatar/styles.d.ts +13 -0
- package/dist/components/Avatar/types.d.ts +66 -0
- package/dist/components/Dropdown/Dropdown.d.ts +1 -1
- package/dist/components/Dropdown/types.d.ts +5 -0
- package/dist/components/FileUpload/FileUpload.d.ts +37 -0
- package/dist/components/FileUpload/FileUploadItem.d.ts +7 -0
- package/dist/components/FileUpload/index.d.ts +3 -0
- package/dist/components/FileUpload/styles.d.ts +24 -0
- package/dist/components/FileUpload/types.d.ts +21 -0
- package/dist/components/ImageItem/ImageItem.d.ts +1 -1
- package/dist/components/ImageItem/types.d.ts +4 -1
- package/dist/components/JsonSchemaForm/constants.d.ts +2 -1
- package/dist/components/JsonSchemaForm/types.d.ts +4 -1
- package/dist/components/PersonInfo/types.d.ts +4 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/index.js +163 -33
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,42 +1,41 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AvatarProps } from './types';
|
|
2
2
|
/**
|
|
3
|
-
* Avatar - Circular
|
|
3
|
+
* Avatar - Circular component for displaying user identity.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* Renders one of three visual states based on the supplied props:
|
|
6
|
+
* 1. **Custom image** — when `image` is provided, displays the photo inside a circle.
|
|
7
|
+
* 2. **Colored placeholder** — when `color` and/or `text` are provided, renders a
|
|
8
|
+
* flat-color circle with up to two initials.
|
|
9
|
+
* 3. **Default placeholder** — when no props are given, shows the standard user icon.
|
|
7
10
|
*
|
|
8
11
|
* @category Components
|
|
9
12
|
* @subcategory Display
|
|
10
13
|
*
|
|
11
14
|
* @example
|
|
12
15
|
* ```tsx
|
|
13
|
-
* //
|
|
14
|
-
* <Avatar
|
|
16
|
+
* // Standard color + initial letter
|
|
17
|
+
* <Avatar color="purple" text="J" />
|
|
15
18
|
* ```
|
|
16
19
|
*
|
|
17
20
|
* @example
|
|
18
21
|
* ```tsx
|
|
19
|
-
* //
|
|
20
|
-
* <Avatar
|
|
22
|
+
* // Custom profile photo
|
|
23
|
+
* <Avatar image="/users/jane.jpg" />
|
|
21
24
|
* ```
|
|
22
25
|
*
|
|
23
26
|
* @example
|
|
24
27
|
* ```tsx
|
|
25
|
-
* //
|
|
26
|
-
* <Avatar
|
|
27
|
-
* size={60}
|
|
28
|
-
* image="/avatar.png"
|
|
29
|
-
* css={{ border: '2px solid blue' }}
|
|
30
|
-
* />
|
|
28
|
+
* // Default placeholder (no props)
|
|
29
|
+
* <Avatar />
|
|
31
30
|
* ```
|
|
32
31
|
*
|
|
33
|
-
* @
|
|
32
|
+
* @example
|
|
33
|
+
* ```tsx
|
|
34
|
+
* // User-defined hex color + letter
|
|
35
|
+
* <Avatar color="#F7931A" text="A" />
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @see {@link UserProfile} - For a complete user-profile panel that accepts Avatar as a trigger
|
|
34
39
|
*/
|
|
35
|
-
declare const Avatar: import("@emotion/
|
|
36
|
-
theme?: import("@emotion/react").Theme;
|
|
37
|
-
as?: React.ElementType;
|
|
38
|
-
} & {
|
|
39
|
-
size: number;
|
|
40
|
-
image: string;
|
|
41
|
-
} & CommonProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
40
|
+
declare const Avatar: ({ size, color, text, image, border, borderColor, css, }: AvatarProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
42
41
|
export default Avatar;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CommonProps } from '../../types/emotion';
|
|
2
|
+
export declare const AvatarContainer: import("@emotion/styled").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme;
|
|
4
|
+
as?: React.ElementType;
|
|
5
|
+
} & {
|
|
6
|
+
size: number;
|
|
7
|
+
} & CommonProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
8
|
+
export declare const AvatarText: import("@emotion/styled").StyledComponent<{
|
|
9
|
+
theme?: import("@emotion/react").Theme;
|
|
10
|
+
as?: React.ElementType;
|
|
11
|
+
} & {
|
|
12
|
+
fontSize: number;
|
|
13
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Interpolation, Theme } from '@emotion/react';
|
|
2
|
+
import { ColorsKeys } from '../../types/emotion';
|
|
3
|
+
export declare enum AvatarSizes {
|
|
4
|
+
small = "small",
|
|
5
|
+
medium = "medium",
|
|
6
|
+
large = "large"
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Props for the Avatar component.
|
|
10
|
+
*
|
|
11
|
+
* Display priority:
|
|
12
|
+
* 1. `image` — renders the supplied URL as a circular photo.
|
|
13
|
+
* 2. `color` / `text` — renders a colored placeholder circle with up to two letters.
|
|
14
|
+
* 3. No props (or only `size`) — renders the default user-icon placeholder.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* // Standard color + initial letter
|
|
19
|
+
* <Avatar color="purple" text="J" />
|
|
20
|
+
*
|
|
21
|
+
* // Custom profile photo
|
|
22
|
+
* <Avatar image="/users/jane.jpg" />
|
|
23
|
+
*
|
|
24
|
+
* // Default placeholder
|
|
25
|
+
* <Avatar />
|
|
26
|
+
*
|
|
27
|
+
* // User-defined hex color and letter
|
|
28
|
+
* <Avatar color="#F7931A" text="A" />
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export interface AvatarProps {
|
|
32
|
+
/**
|
|
33
|
+
* Avatar size variant.
|
|
34
|
+
* @default AvatarSizes.medium
|
|
35
|
+
*/
|
|
36
|
+
size?: AvatarSizes;
|
|
37
|
+
/**
|
|
38
|
+
* Background color of the placeholder circle.
|
|
39
|
+
* Accepts a `theme.colors` key (e.g. `'purple'`, `'green'`)
|
|
40
|
+
* or any valid CSS color string (e.g. `'#F7931A'`, `'rgb(0,128,0)'`).
|
|
41
|
+
*/
|
|
42
|
+
color?: ColorsKeys | string;
|
|
43
|
+
/**
|
|
44
|
+
* One or two characters displayed inside the colored placeholder.
|
|
45
|
+
* Only the first two characters are rendered.
|
|
46
|
+
*/
|
|
47
|
+
text?: string;
|
|
48
|
+
/**
|
|
49
|
+
* URL of the user's profile photo.
|
|
50
|
+
* When provided, the image is displayed instead of the placeholder.
|
|
51
|
+
*/
|
|
52
|
+
image?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Shows or hides the avatar border.
|
|
55
|
+
* Defaults to visible for image avatars and hidden otherwise.
|
|
56
|
+
*/
|
|
57
|
+
border?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Border color. Accepts a `theme.colors` key or any CSS color string.
|
|
60
|
+
*/
|
|
61
|
+
borderColor?: ColorsKeys | string;
|
|
62
|
+
/**
|
|
63
|
+
* Emotion CSS override applied after all internal styles.
|
|
64
|
+
*/
|
|
65
|
+
css?: Interpolation<Theme>;
|
|
66
|
+
}
|
|
@@ -94,5 +94,5 @@ import { DropdownProps } from './types';
|
|
|
94
94
|
*
|
|
95
95
|
* @see https://www.w3.org/WAI/ARIA/apg/example-index/combobox/combobox-select-only.html
|
|
96
96
|
*/
|
|
97
|
-
declare const Dropdown: <T extends DropdownOptionProps>({ selectedItem, isDisabled, isOpen: isInitOpen, children, onChange: handleChange, className, placeholder, maxHeight, dropdownProps: componentProps, }: DropdownProps<T>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
97
|
+
declare const Dropdown: <T extends DropdownOptionProps>({ selectedItem, isDisabled, isOpen: isInitOpen, children, onChange: handleChange, className, placeholder, maxHeight, avatarBorder, dropdownProps: componentProps, }: DropdownProps<T>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
98
98
|
export default Dropdown;
|
|
@@ -94,6 +94,11 @@ export interface DropdownProps<P extends DropdownOptionProps> extends CommonProp
|
|
|
94
94
|
* @default 200
|
|
95
95
|
*/
|
|
96
96
|
maxHeight?: number;
|
|
97
|
+
/**
|
|
98
|
+
* Shows a border around the avatar in the selected-item display.
|
|
99
|
+
* @default false
|
|
100
|
+
*/
|
|
101
|
+
avatarBorder?: boolean;
|
|
97
102
|
/**
|
|
98
103
|
* Props object for sub-components
|
|
99
104
|
* Allows fine-grained control over component parts
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { FileUploadProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* FileUpload - File input component with optional drag-and-drop support
|
|
4
|
+
*
|
|
5
|
+
* Supports single and multi-file selection with built-in validation for
|
|
6
|
+
* file formats and size. In multi-file mode, selected files are listed
|
|
7
|
+
* below the input with individual remove controls.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* // Single file
|
|
12
|
+
* <FileUpload
|
|
13
|
+
* label="Attachment"
|
|
14
|
+
* placeholder="No file selected"
|
|
15
|
+
* actionText="Choose File"
|
|
16
|
+
* allowedFormats={['pdf', 'doc']}
|
|
17
|
+
* maxFileSize={5 * 1024 * 1024}
|
|
18
|
+
* onChange={(files) => console.log(files)}
|
|
19
|
+
* />
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* // Multi-file with drop area
|
|
25
|
+
* <FileUpload
|
|
26
|
+
* label="Documents"
|
|
27
|
+
* isMultiFile
|
|
28
|
+
* maxFiles={5}
|
|
29
|
+
* withDropArea
|
|
30
|
+
* uploadedSectionTitle="Uploaded files"
|
|
31
|
+
* value={files}
|
|
32
|
+
* onChange={setFiles}
|
|
33
|
+
* />
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
declare const FileUpload: ({ label, placeholder, helperText, actionText, error, disabled, css, className, allowedFormats, maxFileSize, isMultiFile, maxFiles, withDropArea, uploadedSectionTitle, value, onChange, onFileRejected, }: FileUploadProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
37
|
+
export default FileUpload;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
interface FileUploadItemProps {
|
|
2
|
+
file: File;
|
|
3
|
+
onRemove: (file: File) => void;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
}
|
|
6
|
+
declare const FileUploadItem: ({ file, onRemove, disabled }: FileUploadItemProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default FileUploadItem;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Theme } from '@emotion/react';
|
|
2
|
+
export declare const wrapper: import("@emotion/react").SerializedStyles;
|
|
3
|
+
export declare const hiddenInput: import("@emotion/react").SerializedStyles;
|
|
4
|
+
export declare const inputRow: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
5
|
+
export declare const inputRowError: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
6
|
+
export declare const inputRowDisabled: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
7
|
+
export declare const fileNameText: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
8
|
+
export declare const placeholderText: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
9
|
+
export declare const dropArea: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
10
|
+
export declare const dropAreaActive: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
11
|
+
export declare const dropAreaError: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
12
|
+
export declare const dropAreaDisabled: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
13
|
+
export declare const dropAreaTitle: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
14
|
+
export declare const dropAreaHint: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
15
|
+
export declare const dropAreaAction: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
16
|
+
export declare const dropAreaClearButton: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
17
|
+
export declare const filesList: import("@emotion/react").SerializedStyles;
|
|
18
|
+
export declare const filesListTitle: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
19
|
+
export declare const fileItem: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
20
|
+
export declare const fileIconWrapper: import("@emotion/react").SerializedStyles;
|
|
21
|
+
export declare const fileInfo: import("@emotion/react").SerializedStyles;
|
|
22
|
+
export declare const fileName: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
23
|
+
export declare const fileSize: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
24
|
+
export declare const deleteButton: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Interpolation, Theme } from '@emotion/react';
|
|
2
|
+
export type FileRejectionReason = 'size' | 'format';
|
|
3
|
+
export interface FileUploadProps {
|
|
4
|
+
label?: string;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
helperText?: string;
|
|
7
|
+
actionText?: string;
|
|
8
|
+
error?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
css?: Interpolation<Theme>;
|
|
11
|
+
allowedFormats?: string[];
|
|
12
|
+
maxFileSize?: number;
|
|
13
|
+
isMultiFile?: boolean;
|
|
14
|
+
maxFiles?: number;
|
|
15
|
+
withDropArea?: boolean;
|
|
16
|
+
uploadedSectionTitle?: string;
|
|
17
|
+
className?: string;
|
|
18
|
+
value?: File | File[];
|
|
19
|
+
onChange?: (files: File[]) => void;
|
|
20
|
+
onFileRejected?: (file: File, reason: FileRejectionReason) => void;
|
|
21
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ImageItemProps } from './types';
|
|
2
|
-
export declare const ImageItem: ({ children, image, avatarSize, link, openLinkInNewTab, className, }: ImageItemProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const ImageItem: ({ children, image, avatarSize, avatarBorder, link, openLinkInNewTab, className, }: ImageItemProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { AvatarSizes } from '../Avatar/types';
|
|
1
2
|
export type ImageItemProps = React.PropsWithChildren<{
|
|
2
3
|
image: string;
|
|
3
|
-
avatarSize?:
|
|
4
|
+
avatarSize?: AvatarSizes;
|
|
5
|
+
/** Shows a border around the avatar. @default false */
|
|
6
|
+
avatarBorder?: boolean;
|
|
4
7
|
link?: string;
|
|
5
8
|
className?: string;
|
|
6
9
|
openLinkInNewTab?: boolean;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { AvatarSizes } from '../Avatar/types';
|
|
2
|
+
export declare const DEFAULT_AVATAR_SIZE = AvatarSizes.small;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { AvatarSizes } from '../Avatar/types';
|
|
1
2
|
export type SelectOptionSchemaExtension = {
|
|
2
3
|
avatar?: string;
|
|
3
4
|
};
|
|
4
5
|
export type SelectWidgetUiOptions = {
|
|
5
|
-
typeaheadAvatarSize?:
|
|
6
|
+
typeaheadAvatarSize?: AvatarSizes;
|
|
7
|
+
/** Shows a border around avatars in the typeahead list. @default false */
|
|
8
|
+
typeaheadAvatarBorder?: boolean;
|
|
6
9
|
};
|
|
@@ -79,6 +79,8 @@ export interface PersonInfoProps extends CommonProps {
|
|
|
79
79
|
link?: string;
|
|
80
80
|
/** When link is set, open in new tab and use rel="noreferrer". */
|
|
81
81
|
openLinkInNewTab?: boolean;
|
|
82
|
+
/** Shows a border around the avatar. @default false */
|
|
83
|
+
avatarBorder?: boolean;
|
|
82
84
|
}
|
|
83
85
|
/**
|
|
84
86
|
* Props for PersonInfoAvatar (value + optional avatar, optional link).
|
|
@@ -90,6 +92,8 @@ export interface PersonInfoAvatarProps {
|
|
|
90
92
|
styles?: PersonInfoStyles;
|
|
91
93
|
link?: string;
|
|
92
94
|
openLinkInNewTab?: boolean;
|
|
95
|
+
/** Shows a border around the avatar. @default false */
|
|
96
|
+
avatarBorder?: boolean;
|
|
93
97
|
}
|
|
94
98
|
/**
|
|
95
99
|
* Props for PersonInfoCounter (“+N” with tooltip).
|
|
@@ -78,6 +78,7 @@ export type * from './Tag/types';
|
|
|
78
78
|
export * from './Chip';
|
|
79
79
|
export type * from './Chip/types';
|
|
80
80
|
export { default as Avatar } from './Avatar';
|
|
81
|
+
export * from './Avatar/types';
|
|
81
82
|
export { default as Label } from './Label';
|
|
82
83
|
export type * from './Label/types';
|
|
83
84
|
export { default as Indicator } from './Indicator';
|
package/dist/index.js
CHANGED
|
@@ -7957,6 +7957,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
7957
7957
|
Alert: () => (/* reexport */ Alert_Alert),
|
|
7958
7958
|
AlertVariants: () => (/* reexport */ AlertVariants),
|
|
7959
7959
|
Avatar: () => (/* reexport */ Avatar_Avatar),
|
|
7960
|
+
AvatarSizes: () => (/* reexport */ AvatarSizes),
|
|
7960
7961
|
Badge: () => (/* reexport */ Badge_Badge),
|
|
7961
7962
|
BarGaugeChart: () => (/* reexport */ BarGaugeChart),
|
|
7962
7963
|
BarGaugeChartComponent: () => (/* reexport */ BarGaugeChartComponent),
|
|
@@ -17473,50 +17474,166 @@ const DropdownOptions = ({
|
|
|
17473
17474
|
});
|
|
17474
17475
|
};
|
|
17475
17476
|
/* harmony default export */ const DropdownOptions_DropdownOptions = (DropdownOptions);
|
|
17477
|
+
;// ./src/components/Avatar/types.ts
|
|
17478
|
+
let AvatarSizes = /*#__PURE__*/function (AvatarSizes) {
|
|
17479
|
+
AvatarSizes["small"] = "small";
|
|
17480
|
+
AvatarSizes["medium"] = "medium";
|
|
17481
|
+
AvatarSizes["large"] = "large";
|
|
17482
|
+
return AvatarSizes;
|
|
17483
|
+
}({});
|
|
17484
|
+
|
|
17485
|
+
/**
|
|
17486
|
+
* Props for the Avatar component.
|
|
17487
|
+
*
|
|
17488
|
+
* Display priority:
|
|
17489
|
+
* 1. `image` — renders the supplied URL as a circular photo.
|
|
17490
|
+
* 2. `color` / `text` — renders a colored placeholder circle with up to two letters.
|
|
17491
|
+
* 3. No props (or only `size`) — renders the default user-icon placeholder.
|
|
17492
|
+
*
|
|
17493
|
+
* @example
|
|
17494
|
+
* ```tsx
|
|
17495
|
+
* // Standard color + initial letter
|
|
17496
|
+
* <Avatar color="purple" text="J" />
|
|
17497
|
+
*
|
|
17498
|
+
* // Custom profile photo
|
|
17499
|
+
* <Avatar image="/users/jane.jpg" />
|
|
17500
|
+
*
|
|
17501
|
+
* // Default placeholder
|
|
17502
|
+
* <Avatar />
|
|
17503
|
+
*
|
|
17504
|
+
* // User-defined hex color and letter
|
|
17505
|
+
* <Avatar color="#F7931A" text="A" />
|
|
17506
|
+
* ```
|
|
17507
|
+
*/
|
|
17508
|
+
;// ./src/components/Avatar/styles.ts
|
|
17509
|
+
|
|
17510
|
+
const AvatarContainer = /*#__PURE__*/base_default()("div", true ? {
|
|
17511
|
+
target: "e1w4ysav1"
|
|
17512
|
+
} : 0)("display:flex;align-items:center;justify-content:center;flex-shrink:0;border-radius:50%;overflow:hidden;width:", ({
|
|
17513
|
+
size
|
|
17514
|
+
}) => size, "px;height:", ({
|
|
17515
|
+
size
|
|
17516
|
+
}) => size, "px;" + ( true ? "" : 0));
|
|
17517
|
+
const AvatarText = /*#__PURE__*/base_default()("span", true ? {
|
|
17518
|
+
target: "e1w4ysav0"
|
|
17519
|
+
} : 0)("color:rgba(255, 255, 255, 1);font-family:Manrope,sans-serif;font-weight:600;font-size:", ({
|
|
17520
|
+
fontSize
|
|
17521
|
+
}) => fontSize, "px;line-height:1;user-select:none;text-transform:uppercase;" + ( true ? "" : 0));
|
|
17476
17522
|
;// ./src/components/Avatar/Avatar.tsx
|
|
17477
17523
|
|
|
17524
|
+
|
|
17525
|
+
|
|
17526
|
+
|
|
17527
|
+
|
|
17528
|
+
const SIZE_MAP = {
|
|
17529
|
+
[AvatarSizes.small]: 24,
|
|
17530
|
+
[AvatarSizes.medium]: 32,
|
|
17531
|
+
[AvatarSizes.large]: 46
|
|
17532
|
+
};
|
|
17533
|
+
const BORDER_WIDTH_MAP = {
|
|
17534
|
+
small: 1,
|
|
17535
|
+
medium: 1,
|
|
17536
|
+
large: 2
|
|
17537
|
+
};
|
|
17538
|
+
|
|
17539
|
+
/** Proportion of the avatar diameter used as the initials font-size. */
|
|
17540
|
+
const TEXT_SIZE_RATIO = 0.4;
|
|
17541
|
+
|
|
17542
|
+
/** Proportion of the avatar diameter used as the default icon size. */
|
|
17543
|
+
const ICON_SIZE_RATIO = 0.75;
|
|
17544
|
+
const DEFAULT_BORDER_COLOR = 'blue';
|
|
17545
|
+
const resolveThemeColor = (color, themeColors) => {
|
|
17546
|
+
if (!color) return undefined;
|
|
17547
|
+
if (color in themeColors) {
|
|
17548
|
+
return themeColors[color];
|
|
17549
|
+
}
|
|
17550
|
+
return color;
|
|
17551
|
+
};
|
|
17552
|
+
|
|
17478
17553
|
/**
|
|
17479
|
-
* Avatar - Circular
|
|
17554
|
+
* Avatar - Circular component for displaying user identity.
|
|
17480
17555
|
*
|
|
17481
|
-
*
|
|
17482
|
-
*
|
|
17556
|
+
* Renders one of three visual states based on the supplied props:
|
|
17557
|
+
* 1. **Custom image** — when `image` is provided, displays the photo inside a circle.
|
|
17558
|
+
* 2. **Colored placeholder** — when `color` and/or `text` are provided, renders a
|
|
17559
|
+
* flat-color circle with up to two initials.
|
|
17560
|
+
* 3. **Default placeholder** — when no props are given, shows the standard user icon.
|
|
17483
17561
|
*
|
|
17484
17562
|
* @category Components
|
|
17485
17563
|
* @subcategory Display
|
|
17486
17564
|
*
|
|
17487
17565
|
* @example
|
|
17488
17566
|
* ```tsx
|
|
17489
|
-
* //
|
|
17490
|
-
* <Avatar
|
|
17567
|
+
* // Standard color + initial letter
|
|
17568
|
+
* <Avatar color="purple" text="J" />
|
|
17491
17569
|
* ```
|
|
17492
17570
|
*
|
|
17493
17571
|
* @example
|
|
17494
17572
|
* ```tsx
|
|
17495
|
-
* //
|
|
17496
|
-
* <Avatar
|
|
17573
|
+
* // Custom profile photo
|
|
17574
|
+
* <Avatar image="/users/jane.jpg" />
|
|
17497
17575
|
* ```
|
|
17498
17576
|
*
|
|
17499
17577
|
* @example
|
|
17500
17578
|
* ```tsx
|
|
17501
|
-
* //
|
|
17502
|
-
* <Avatar
|
|
17503
|
-
* size={60}
|
|
17504
|
-
* image="/avatar.png"
|
|
17505
|
-
* css={{ border: '2px solid blue' }}
|
|
17506
|
-
* />
|
|
17579
|
+
* // Default placeholder (no props)
|
|
17580
|
+
* <Avatar />
|
|
17507
17581
|
* ```
|
|
17508
17582
|
*
|
|
17509
|
-
* @
|
|
17583
|
+
* @example
|
|
17584
|
+
* ```tsx
|
|
17585
|
+
* // User-defined hex color + letter
|
|
17586
|
+
* <Avatar color="#F7931A" text="A" />
|
|
17587
|
+
* ```
|
|
17588
|
+
*
|
|
17589
|
+
* @see {@link UserProfile} - For a complete user-profile panel that accepts Avatar as a trigger
|
|
17510
17590
|
*/
|
|
17511
|
-
const Avatar =
|
|
17512
|
-
|
|
17513
|
-
|
|
17514
|
-
|
|
17515
|
-
|
|
17516
|
-
|
|
17517
|
-
|
|
17518
|
-
|
|
17519
|
-
}) =>
|
|
17591
|
+
const Avatar = ({
|
|
17592
|
+
size = AvatarSizes.medium,
|
|
17593
|
+
color,
|
|
17594
|
+
text,
|
|
17595
|
+
image,
|
|
17596
|
+
border,
|
|
17597
|
+
borderColor,
|
|
17598
|
+
css
|
|
17599
|
+
}) => {
|
|
17600
|
+
const theme = (0,react_namespaceObject.useTheme)();
|
|
17601
|
+
const sizePx = SIZE_MAP[size];
|
|
17602
|
+
const shouldShowBorder = border ?? Boolean(image);
|
|
17603
|
+
const resolvedBorderColor = resolveThemeColor(borderColor ?? DEFAULT_BORDER_COLOR, theme.colors) ?? theme.colors.blue;
|
|
17604
|
+
const borderStyle = shouldShowBorder ? {
|
|
17605
|
+
border: `${BORDER_WIDTH_MAP[size]}px solid ${resolvedBorderColor}`
|
|
17606
|
+
} : undefined;
|
|
17607
|
+
|
|
17608
|
+
// ── Scenario 3: custom profile image ──────────────────────────────────────
|
|
17609
|
+
|
|
17610
|
+
if (image) {
|
|
17611
|
+
return (0,jsx_runtime_namespaceObject.jsx)(AvatarContainer, {
|
|
17612
|
+
size: sizePx,
|
|
17613
|
+
css: [{
|
|
17614
|
+
background: `url(${image}) center / cover no-repeat`
|
|
17615
|
+
}, borderStyle, css, true ? "" : 0, true ? "" : 0],
|
|
17616
|
+
"data-testid": "avatar"
|
|
17617
|
+
});
|
|
17618
|
+
}
|
|
17619
|
+
const resolvedColor = resolveThemeColor(color, theme.colors) ?? theme.colors.greyFocused;
|
|
17620
|
+
const fontSize = Math.round(sizePx * TEXT_SIZE_RATIO);
|
|
17621
|
+
return (0,jsx_runtime_namespaceObject.jsx)(AvatarContainer, {
|
|
17622
|
+
size: sizePx,
|
|
17623
|
+
css: [{
|
|
17624
|
+
background: resolvedColor
|
|
17625
|
+
}, borderStyle, css, true ? "" : 0, true ? "" : 0],
|
|
17626
|
+
"data-testid": "avatar",
|
|
17627
|
+
children: text ? (0,jsx_runtime_namespaceObject.jsx)(AvatarText, {
|
|
17628
|
+
fontSize: fontSize,
|
|
17629
|
+
children: text.slice(0, 2)
|
|
17630
|
+
}) : (0,jsx_runtime_namespaceObject.jsx)(Icon_Icon, {
|
|
17631
|
+
name: "user",
|
|
17632
|
+
size: Math.round(sizePx * ICON_SIZE_RATIO),
|
|
17633
|
+
color: theme.colors.white
|
|
17634
|
+
})
|
|
17635
|
+
});
|
|
17636
|
+
};
|
|
17520
17637
|
/* harmony default export */ const Avatar_Avatar = (Avatar);
|
|
17521
17638
|
;// ./src/components/Dropdown/types.ts
|
|
17522
17639
|
let DropdownPositions = /*#__PURE__*/function (DropdownPositions) {
|
|
@@ -17705,6 +17822,7 @@ const Dropdown = ({
|
|
|
17705
17822
|
className,
|
|
17706
17823
|
placeholder = 'Select something',
|
|
17707
17824
|
maxHeight = 200,
|
|
17825
|
+
avatarBorder = false,
|
|
17708
17826
|
dropdownProps: componentProps
|
|
17709
17827
|
}) => {
|
|
17710
17828
|
const {
|
|
@@ -17784,8 +17902,9 @@ const Dropdown = ({
|
|
|
17784
17902
|
const value = activeItem ? activeItem.label || activeItem.children || activeItem.value || activeItem || placeholder : placeholder;
|
|
17785
17903
|
const rawAvatar = activeItem && activeItem.avatar;
|
|
17786
17904
|
const selectedAvatar = rawAvatar != null ? typeof rawAvatar === 'string' ? (0,jsx_runtime_namespaceObject.jsx)(Avatar_Avatar, {
|
|
17787
|
-
size:
|
|
17788
|
-
image: rawAvatar
|
|
17905
|
+
size: AvatarSizes.small,
|
|
17906
|
+
image: rawAvatar,
|
|
17907
|
+
border: avatarBorder
|
|
17789
17908
|
}) : /*#__PURE__*/external_react_default().isValidElement(rawAvatar) ? rawAvatar : null : null;
|
|
17790
17909
|
const toggleContent = selectedAvatar != null ? (0,jsx_runtime_namespaceObject.jsxs)(SelectedContent, {
|
|
17791
17910
|
children: [selectedAvatar, (0,jsx_runtime_namespaceObject.jsx)("span", {
|
|
@@ -27366,7 +27485,8 @@ const RadioWidget = props => {
|
|
|
27366
27485
|
});
|
|
27367
27486
|
};
|
|
27368
27487
|
;// ./src/components/JsonSchemaForm/constants.ts
|
|
27369
|
-
|
|
27488
|
+
|
|
27489
|
+
const DEFAULT_AVATAR_SIZE = AvatarSizes.small;
|
|
27370
27490
|
;// ./src/components/JsonSchemaForm/utils/selectWidget.ts
|
|
27371
27491
|
/**
|
|
27372
27492
|
* Props that need special handling (computed from RJSF state) or are RJSF-controlled
|
|
@@ -27403,9 +27523,11 @@ const getAvatarNode = (option, uiOptions) => {
|
|
|
27403
27523
|
const avatar = option.schema?.avatar;
|
|
27404
27524
|
if (!avatar) return;
|
|
27405
27525
|
const avatarSize = uiOptions.typeaheadAvatarSize ?? DEFAULT_AVATAR_SIZE;
|
|
27526
|
+
const avatarBorder = uiOptions.typeaheadAvatarBorder ?? false;
|
|
27406
27527
|
return (0,jsx_runtime_namespaceObject.jsx)(Avatar_Avatar, {
|
|
27407
27528
|
size: avatarSize,
|
|
27408
|
-
image: avatar
|
|
27529
|
+
image: avatar,
|
|
27530
|
+
border: avatarBorder
|
|
27409
27531
|
});
|
|
27410
27532
|
};
|
|
27411
27533
|
const SelectWidget = props => {
|
|
@@ -48369,6 +48491,7 @@ function ImageItem_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to
|
|
|
48369
48491
|
|
|
48370
48492
|
|
|
48371
48493
|
|
|
48494
|
+
|
|
48372
48495
|
var ImageItem_ref = true ? {
|
|
48373
48496
|
name: "c5ejfv",
|
|
48374
48497
|
styles: "gap:8px;text-decoration:none"
|
|
@@ -48376,7 +48499,8 @@ var ImageItem_ref = true ? {
|
|
|
48376
48499
|
const ImageItem = ({
|
|
48377
48500
|
children,
|
|
48378
48501
|
image,
|
|
48379
|
-
avatarSize =
|
|
48502
|
+
avatarSize = AvatarSizes.small,
|
|
48503
|
+
avatarBorder = false,
|
|
48380
48504
|
link = '',
|
|
48381
48505
|
openLinkInNewTab = false,
|
|
48382
48506
|
className
|
|
@@ -48394,7 +48518,8 @@ const ImageItem = ({
|
|
|
48394
48518
|
...additionalProps,
|
|
48395
48519
|
children: [(0,jsx_runtime_namespaceObject.jsx)(Avatar_Avatar, {
|
|
48396
48520
|
size: avatarSize,
|
|
48397
|
-
image: image
|
|
48521
|
+
image: image,
|
|
48522
|
+
border: avatarBorder
|
|
48398
48523
|
}), (0,jsx_runtime_namespaceObject.jsx)("span", {
|
|
48399
48524
|
css: /*#__PURE__*/(0,react_namespaceObject.css)({
|
|
48400
48525
|
color: theme.colors.greyDarker,
|
|
@@ -53606,7 +53731,8 @@ const PersonInfoAvatar = ({
|
|
|
53606
53731
|
value,
|
|
53607
53732
|
styles,
|
|
53608
53733
|
link,
|
|
53609
|
-
openLinkInNewTab
|
|
53734
|
+
openLinkInNewTab,
|
|
53735
|
+
avatarBorder = false
|
|
53610
53736
|
}) => {
|
|
53611
53737
|
const hasAvatar = Boolean(avatar);
|
|
53612
53738
|
const hasValue = Boolean(value);
|
|
@@ -53625,8 +53751,9 @@ const PersonInfoAvatar = ({
|
|
|
53625
53751
|
css: isLink ? avatarWrapperLinkStyles : undefined,
|
|
53626
53752
|
...linkAttributes,
|
|
53627
53753
|
children: [(0,jsx_runtime_namespaceObject.jsx)(Avatar_Avatar, {
|
|
53628
|
-
size:
|
|
53629
|
-
image: avatar
|
|
53754
|
+
size: AvatarSizes.small,
|
|
53755
|
+
image: avatar,
|
|
53756
|
+
border: avatarBorder
|
|
53630
53757
|
}), valueNode]
|
|
53631
53758
|
});
|
|
53632
53759
|
};
|
|
@@ -53824,6 +53951,7 @@ const PersonInfo = /*#__PURE__*/external_react_default().forwardRef(function Per
|
|
|
53824
53951
|
className,
|
|
53825
53952
|
link,
|
|
53826
53953
|
openLinkInNewTab,
|
|
53954
|
+
avatarBorder,
|
|
53827
53955
|
...props
|
|
53828
53956
|
}, ref) {
|
|
53829
53957
|
return (0,jsx_runtime_namespaceObject.jsx)(PersonInfoBase, {
|
|
@@ -53843,7 +53971,8 @@ const PersonInfo = /*#__PURE__*/external_react_default().forwardRef(function Per
|
|
|
53843
53971
|
value: value,
|
|
53844
53972
|
styles: styles,
|
|
53845
53973
|
link: link,
|
|
53846
|
-
openLinkInNewTab: openLinkInNewTab
|
|
53974
|
+
openLinkInNewTab: openLinkInNewTab,
|
|
53975
|
+
avatarBorder: avatarBorder
|
|
53847
53976
|
}), counterTooltip && (0,jsx_runtime_namespaceObject.jsx)(PersonInfoCounter, {
|
|
53848
53977
|
counterTooltip: counterTooltip,
|
|
53849
53978
|
css: styles?.counter
|
|
@@ -54153,6 +54282,7 @@ const UserProfile = ({
|
|
|
54153
54282
|
|
|
54154
54283
|
|
|
54155
54284
|
|
|
54285
|
+
|
|
54156
54286
|
|
|
54157
54287
|
|
|
54158
54288
|
// ============================================================================
|