@ssa-ui-kit/core 3.1.0 → 3.2.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/Button/Button.d.ts +8 -8
- package/dist/components/Button/types.d.ts +12 -8
- package/dist/components/Chip/constants.d.ts +7 -0
- package/dist/components/Chip/helpers.d.ts +1 -1
- package/dist/components/Chip/styles.d.ts +4 -0
- package/dist/components/CollapsibleNavBar/CollapsibleNavBar.d.ts +1 -1
- package/dist/components/CollapsibleNavBar/types.d.ts +13 -0
- package/dist/components/Dropdown/Dropdown.d.ts +1 -1
- package/dist/components/Dropdown/types.d.ts +9 -0
- package/dist/components/Icon/icons/EmployeeBlackboard.d.ts +3 -0
- package/dist/components/Icon/icons/FileMark.d.ts +3 -0
- package/dist/components/Icon/icons/FilePdf.d.ts +3 -0
- package/dist/components/Icon/icons/FileWord.d.ts +3 -0
- package/dist/components/Icon/icons/all.d.ts +4 -0
- package/dist/components/Icon/icons/iconsList.d.ts +1 -1
- package/dist/components/MultipleDropdown/types.d.ts +9 -0
- package/dist/components/PersonInfo/PersonInfo.d.ts +78 -0
- package/dist/components/PersonInfo/PersonInfoAvatar.d.ts +6 -0
- package/dist/components/PersonInfo/PersonInfoBadges.d.ts +6 -0
- package/dist/components/PersonInfo/PersonInfoCounter.d.ts +6 -0
- package/dist/components/PersonInfo/PersonInfoIcon.d.ts +5 -0
- package/dist/components/PersonInfo/PersonInfoValue.d.ts +5 -0
- package/dist/components/PersonInfo/constants.d.ts +5 -0
- package/dist/components/PersonInfo/helpers.d.ts +5 -0
- package/dist/components/PersonInfo/index.d.ts +4 -0
- package/dist/components/PersonInfo/types.d.ts +54 -0
- package/dist/index.js +392 -55
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -2,16 +2,16 @@ import { ButtonProps } from './types';
|
|
|
2
2
|
/**
|
|
3
3
|
* Button - Interactive button component for user actions.
|
|
4
4
|
*
|
|
5
|
-
* Variant colors are driven entirely by `theme.palette` — each
|
|
6
|
-
* `palette.<variant>.main`
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* affecting other components.
|
|
5
|
+
* Variant colors are driven entirely by `theme.palette` for solid variants — each
|
|
6
|
+
* reads `palette.<variant>.main` (default), `palette.<variant>.dark` (hover/active),
|
|
7
|
+
* `palette.<variant>.light` (focus). Override any palette entry in a custom theme
|
|
8
|
+
* to restyle a variant without affecting other components.
|
|
10
9
|
*
|
|
11
|
-
* ### Variants (default: `
|
|
10
|
+
* ### Variants (default: `custom`)
|
|
11
|
+
* - `custom` — transparent, dark text; recommended for low-emphasis actions (default)
|
|
12
12
|
* - `primary` — blue, high emphasis, white text
|
|
13
13
|
* - `secondary` — grey, medium emphasis, dark text
|
|
14
|
-
* - `tertiary` —
|
|
14
|
+
* - `tertiary` — legacy; same as custom; prefer `custom` instead
|
|
15
15
|
* - `error` — red, destructive actions, white text
|
|
16
16
|
* - `warning` — orange, caution actions, white text
|
|
17
17
|
* - `success` — green, confirmation actions, white text
|
|
@@ -21,7 +21,7 @@ import { ButtonProps } from './types';
|
|
|
21
21
|
*
|
|
22
22
|
* @example
|
|
23
23
|
* ```tsx
|
|
24
|
-
* // No variant passed →
|
|
24
|
+
* // No variant passed → custom (transparent, recommended)
|
|
25
25
|
* <Button text="Cancel" onClick={handleCancel} />
|
|
26
26
|
* ```
|
|
27
27
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AriaAttributes } from 'react';
|
|
1
|
+
import React, { AriaAttributes } from 'react';
|
|
2
2
|
import { SerializedStyles, Theme } from '@emotion/react';
|
|
3
3
|
import { MouseEventHandler } from 'react';
|
|
4
4
|
/**
|
|
@@ -72,9 +72,11 @@ export interface ButtonProps extends ButtonAriaProps {
|
|
|
72
72
|
*/
|
|
73
73
|
endIconClassName?: string;
|
|
74
74
|
/**
|
|
75
|
-
* Visual style variant of the button (uses theme.palette)
|
|
76
|
-
* - `
|
|
77
|
-
*
|
|
75
|
+
* Visual style variant of the button (uses theme.palette for solid variants).
|
|
76
|
+
* - `custom` — transparent, dark text; recommended for low-emphasis actions (default)
|
|
77
|
+
* - `primary` | `secondary` | `error` | `warning` | `success` — use theme.palette
|
|
78
|
+
* - `tertiary` — legacy; same as custom; prefer `custom` instead
|
|
79
|
+
* @default 'custom'
|
|
78
80
|
*/
|
|
79
81
|
variant?: keyof ButtonVariants;
|
|
80
82
|
/**
|
|
@@ -108,14 +110,16 @@ export interface ButtonProps extends ButtonAriaProps {
|
|
|
108
110
|
}
|
|
109
111
|
/**
|
|
110
112
|
* Button variant style functions.
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
* - `light` → focus background
|
|
113
|
+
* Solid variants (primary, secondary, error, warning, success) read from
|
|
114
|
+
* `theme.palette.<variant>`: main (default), dark (hover/active), light (focus).
|
|
115
|
+
* Custom and tertiary are transparent (no palette); prefer custom to tertiary.
|
|
115
116
|
*/
|
|
116
117
|
export interface ButtonVariants {
|
|
118
|
+
/** Recommended transparent variant; no focus outline. */
|
|
119
|
+
custom: (theme: Theme) => SerializedStyles;
|
|
117
120
|
primary: (theme: Theme) => SerializedStyles;
|
|
118
121
|
secondary: (theme: Theme) => SerializedStyles;
|
|
122
|
+
/** Legacy transparent variant; prefer custom. */
|
|
119
123
|
tertiary: (theme: Theme) => SerializedStyles;
|
|
120
124
|
error: (theme: Theme) => SerializedStyles;
|
|
121
125
|
warning: (theme: Theme) => SerializedStyles;
|
|
@@ -10,6 +10,13 @@ export declare const COLORS: {
|
|
|
10
10
|
readonly ERROR: "error";
|
|
11
11
|
readonly WARNING: "warning";
|
|
12
12
|
};
|
|
13
|
+
/** Outlined variant background opacity (light color with opacity) */
|
|
14
|
+
export declare const OUTLINED_BG_OPACITY: {
|
|
15
|
+
readonly DEFAULT: 0.08;
|
|
16
|
+
readonly HOVER: 0.24;
|
|
17
|
+
readonly ACTIVE: 0.4;
|
|
18
|
+
readonly DISABLED: 0.24;
|
|
19
|
+
};
|
|
13
20
|
export declare const mapSizes: {
|
|
14
21
|
small: import("@emotion/react").SerializedStyles;
|
|
15
22
|
medium: import("@emotion/react").SerializedStyles;
|
|
@@ -12,7 +12,7 @@ type ColorConfig = {
|
|
|
12
12
|
darkText?: boolean;
|
|
13
13
|
};
|
|
14
14
|
export declare const colorMap: (theme: Theme) => Record<SemanticColor, ColorConfig>;
|
|
15
|
-
export declare const getVariantColors: (theme: Theme, variant: ChipProps["variant"], color: ChipProps["color"], disabled: boolean) => {
|
|
15
|
+
export declare const getVariantColors: (theme: Theme, variant: ChipProps["variant"], color: ChipProps["color"], disabled: boolean, isClickable?: boolean) => {
|
|
16
16
|
chipStyles: import("@emotion/react").SerializedStyles;
|
|
17
17
|
iconColor: string | undefined;
|
|
18
18
|
};
|
|
@@ -11,7 +11,11 @@ export declare const filled: (theme: Theme) => import("@emotion/react").Serializ
|
|
|
11
11
|
export declare const filledDisabled: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
12
12
|
export declare const outlined: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
13
13
|
export declare const outlinedDisabled: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
14
|
+
/** Hover/active bg opacity for default (grey) outlined clickable chip */
|
|
15
|
+
export declare const clickableOutlinedDefault: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
14
16
|
export declare const clickable: import("@emotion/react").SerializedStyles;
|
|
17
|
+
/** cursor + transition only; hover/active handled by variant (e.g. outlined bg opacity) */
|
|
18
|
+
export declare const clickableBase: import("@emotion/react").SerializedStyles;
|
|
15
19
|
export declare const clickableDisabled: import("@emotion/react").SerializedStyles;
|
|
16
20
|
export declare const IconWrapper: import("@emotion/styled").StyledComponent<{
|
|
17
21
|
theme?: Theme;
|
|
@@ -2,4 +2,4 @@ import { CollapsibleNavBarExtendedProps } from './types';
|
|
|
2
2
|
/**
|
|
3
3
|
* UI Component that shows the collapsible navigation bar
|
|
4
4
|
*/
|
|
5
|
-
export declare const CollapsibleNavBar: ({ items, renderLogo, theme, subMenuMaxWidth, showIconTooltip, className, useMatchPattern, onChange, exactMatch, }: CollapsibleNavBarExtendedProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare const CollapsibleNavBar: ({ items, renderLogo, theme, subMenuMaxWidth, showIconTooltip, className, useMatchPattern, onChange, exactMatch, defaultExpanded, }: CollapsibleNavBarExtendedProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -12,13 +12,21 @@ export interface CollapsibleNavBarGroup<T extends NavBarExtendedSubItem = NavBar
|
|
|
12
12
|
prefix: string;
|
|
13
13
|
}
|
|
14
14
|
export interface CollapsibleNavBarExtendedProps<T extends NavBarExtendedSubItem = NavBarExtendedSubItem> {
|
|
15
|
+
/** Nav items: link items (path, iconName, iconSize, title) or groups with prefix, iconName, iconSize, title, items (sub-items: path, title). */
|
|
15
16
|
items: Array<CollapsibleNavBarItem | CollapsibleNavBarGroup<T>>;
|
|
17
|
+
/** Logo or branding element (e.g. image or div) shown above the nav. */
|
|
16
18
|
renderLogo: React.ReactElement;
|
|
19
|
+
/** Visual theme: dark (default) or light sidebar. */
|
|
17
20
|
theme?: 'default' | 'light';
|
|
21
|
+
/** Optional CSS class for the root. */
|
|
18
22
|
className?: string;
|
|
23
|
+
/** Max width for submenu panels (e.g. 220). */
|
|
19
24
|
subMenuMaxWidth?: CSSProperties['maxWidth'];
|
|
25
|
+
/** When true, show tooltips on nav icons when sidebar is collapsed. */
|
|
20
26
|
showIconTooltip?: boolean;
|
|
27
|
+
/** Custom route matching for active state (e.g. for React Router). */
|
|
21
28
|
useMatchPattern?: (prefix: string) => string | PathPattern<string>;
|
|
29
|
+
/** Called when the sidebar expand/collapse state changes. */
|
|
22
30
|
onChange?: (isChecked: boolean) => void;
|
|
23
31
|
/**
|
|
24
32
|
* If true, only exact path matches will be considered active.
|
|
@@ -26,4 +34,9 @@ export interface CollapsibleNavBarExtendedProps<T extends NavBarExtendedSubItem
|
|
|
26
34
|
* @default false
|
|
27
35
|
*/
|
|
28
36
|
exactMatch?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Initial expanded state (sidebar shows icon + text). When false, only icons are shown until the user toggles.
|
|
39
|
+
* @default false
|
|
40
|
+
*/
|
|
41
|
+
defaultExpanded?: boolean;
|
|
29
42
|
}
|
|
@@ -88,5 +88,5 @@ import { DropdownProps } from './types';
|
|
|
88
88
|
*
|
|
89
89
|
* @see https://www.w3.org/WAI/ARIA/apg/example-index/combobox/combobox-select-only.html
|
|
90
90
|
*/
|
|
91
|
-
declare const Dropdown: <T extends DropdownOptionProps>({ selectedItem, isDisabled, isOpen: isInitOpen, children, onChange: handleChange, className, placeholder, dropdownProps: componentProps, }: DropdownProps<T>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
91
|
+
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;
|
|
92
92
|
export default Dropdown;
|
|
@@ -71,6 +71,11 @@ export interface DropdownProps<P extends DropdownOptionProps> extends CommonProp
|
|
|
71
71
|
* When provided, controls dropdown open/closed state externally
|
|
72
72
|
*/
|
|
73
73
|
isOpen?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Max height (px) of the options list; overflow scrolls.
|
|
76
|
+
* @default 200
|
|
77
|
+
*/
|
|
78
|
+
maxHeight?: number;
|
|
74
79
|
/**
|
|
75
80
|
* Props object for sub-components
|
|
76
81
|
* Allows fine-grained control over component parts
|
|
@@ -121,4 +126,8 @@ export interface DropdownContextType {
|
|
|
121
126
|
* Used to highlight the selected option
|
|
122
127
|
*/
|
|
123
128
|
activeItem?: DropdownOptionProps | null;
|
|
129
|
+
/**
|
|
130
|
+
* Max height (px) of the options list
|
|
131
|
+
*/
|
|
132
|
+
maxHeight?: number;
|
|
124
133
|
}
|
|
@@ -48,8 +48,12 @@ export * as Email from './Email';
|
|
|
48
48
|
export * as Employee from './Employee';
|
|
49
49
|
export * as EmployeeProfile from './EmployeeProfile';
|
|
50
50
|
export * as EmployeeTerminated from './EmployeeTerminated';
|
|
51
|
+
export * as EmployeeBlackboard from './EmployeeBlackboard';
|
|
51
52
|
export * as ExcelDownload from './ExcelDownload';
|
|
52
53
|
export * as Export from './Export';
|
|
54
|
+
export * as FileMark from './FileMark';
|
|
55
|
+
export * as FilePdf from './FilePdf';
|
|
56
|
+
export * as FileWord from './FileWord';
|
|
53
57
|
export * as Filter from './Filter';
|
|
54
58
|
export * as FilterFunnel from './FilterFunnel';
|
|
55
59
|
export * as FollowLink from './FollowLink';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const iconsList: ("visible" | "warning" | "archive" | "document" | "link" | "search" | "arrow-down" | "arrow-up" | "clipboard-assessment" | "attention" | "award" | "ban-user" | "bench" | "bin" | "calendar" | "calendar-schedule" | "carrot-down" | "carrot-left" | "carrot-right" | "carrot-up" | "card-text" | "case" | "certification" | "certification-expiring" | "camera" | "change" | "chart" | "check" | "check-circle" | "check-circle-inverted" | "children" | "circle" | "circular" | "clock" | "cogwheel" | "comments" | "briefcase" | "building" | "compensation" | "confirm-email" | "contacts" | "copy" | "copy-link" | "cross" | "delete" | "diamond-ring" | "diet" | "documents" | "edit" | "education" | "email" | "employee" | "employee-profile" | "employee-terminated" | "excel-download" | "export" | "filter" | "filter-funnel" | "follow-link" | "fte" | "clipboard-form" | "geography" | "gender" | "gift" | "home" | "import" | "information" | "inventory" | "invisible" | "language" | "lock" | "log-in" | "log-out" | "maximize" | "measurements" | "message" | "minus" | "minus-circle" | "minus-circle-inverted" | "more" | "more-vertical" | "notification" | "office-chair" | "open-book" | "pages" | "party" | "plus" | "plus-circle" | "plus-circle-inverted" | "probation-period" | "profiles-changes" | "radio-on" | "clipboard-report" | "clipboard-result" | "robot" | "roles" | "seniority" | "settings" | "signature" | "sleep" | "staff-growth-coefficient" | "staff-turnover-coefficient" | "stats" | "clipboard-summary" | "team" | "clipboard-star" | "time-tracking" | "timeline" | "tennis-ball" | "trainings" | "unarchive" | "union" | "union-circle" | "unlock" | "url" | "user")[];
|
|
1
|
+
export declare const iconsList: ("visible" | "warning" | "archive" | "document" | "link" | "search" | "arrow-down" | "arrow-up" | "clipboard-assessment" | "attention" | "award" | "ban-user" | "bench" | "bin" | "calendar" | "calendar-schedule" | "carrot-down" | "carrot-left" | "carrot-right" | "carrot-up" | "card-text" | "case" | "certification" | "certification-expiring" | "camera" | "change" | "chart" | "check" | "check-circle" | "check-circle-inverted" | "children" | "circle" | "circular" | "clock" | "cogwheel" | "comments" | "briefcase" | "building" | "compensation" | "confirm-email" | "contacts" | "copy" | "copy-link" | "cross" | "delete" | "diamond-ring" | "diet" | "documents" | "edit" | "education" | "email" | "employee" | "employee-profile" | "employee-terminated" | "employee-blackboard" | "excel-download" | "export" | "file-mark" | "file-pdf" | "file-word" | "filter" | "filter-funnel" | "follow-link" | "fte" | "clipboard-form" | "geography" | "gender" | "gift" | "home" | "import" | "information" | "inventory" | "invisible" | "language" | "lock" | "log-in" | "log-out" | "maximize" | "measurements" | "message" | "minus" | "minus-circle" | "minus-circle-inverted" | "more" | "more-vertical" | "notification" | "office-chair" | "open-book" | "pages" | "party" | "plus" | "plus-circle" | "plus-circle-inverted" | "probation-period" | "profiles-changes" | "radio-on" | "clipboard-report" | "clipboard-result" | "robot" | "roles" | "seniority" | "settings" | "signature" | "sleep" | "staff-growth-coefficient" | "staff-turnover-coefficient" | "stats" | "clipboard-summary" | "team" | "clipboard-star" | "time-tracking" | "timeline" | "tennis-ball" | "trainings" | "unarchive" | "union" | "union-circle" | "unlock" | "url" | "user")[];
|
|
@@ -72,6 +72,11 @@ export type DropdownProps<P extends DropdownOptionProps> = {
|
|
|
72
72
|
* @param isSelected - `true` if the option was just selected, `false` if deselected
|
|
73
73
|
*/
|
|
74
74
|
onChange?: (selectedItem: string | number, isSelected: boolean) => void;
|
|
75
|
+
/**
|
|
76
|
+
* Max height (px) of the options list; overflow scrolls.
|
|
77
|
+
* @default 200
|
|
78
|
+
*/
|
|
79
|
+
maxHeight?: number;
|
|
75
80
|
};
|
|
76
81
|
/**
|
|
77
82
|
* Context value shared with child DropdownOption components via MultipleDropdownContext
|
|
@@ -89,4 +94,8 @@ export interface DropdownContextType<T extends DropdownOptionProps> {
|
|
|
89
94
|
* Map of all option values to their current state (including `isSelected`)
|
|
90
95
|
*/
|
|
91
96
|
allItems: Record<string | number, T>;
|
|
97
|
+
/**
|
|
98
|
+
* Max height (px) of the options list
|
|
99
|
+
*/
|
|
100
|
+
maxHeight?: number;
|
|
92
101
|
}
|
|
@@ -1,3 +1,81 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PersonInfoProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* PersonInfo - Compact row for displaying a person or entity with title, value, and optional metadata.
|
|
5
|
+
*
|
|
6
|
+
* Uses `theme.colors` only (e.g. greyDropdownFocused, greyDarker, blue for link hover). Does not use
|
|
7
|
+
* `theme.palette`. Link and value hover use theme.colors.blue. Badge colors come from BADGE_COLORS(theme).
|
|
8
|
+
*
|
|
9
|
+
* ### Structure
|
|
10
|
+
* - Optional leading icon (name or custom ReactNode)
|
|
11
|
+
* - Title (required) and a row with: optional avatar + value (optionally a link), optional counter with tooltip
|
|
12
|
+
* - Optional badges (Badge components or strings)
|
|
13
|
+
* - Optional attributes list (strings or ReactNodes)
|
|
14
|
+
* - Optional description text
|
|
15
|
+
*
|
|
16
|
+
* ### Key props
|
|
17
|
+
* - `title` (required) — main label
|
|
18
|
+
* - `value` — primary value; use with `link` / `openLinkInNewTab` for a clickable value
|
|
19
|
+
* - `icon` — Icon name or custom node before the title
|
|
20
|
+
* - `avatar` — image URL; shown next to value
|
|
21
|
+
* - `badges` — ReactNode or array of ReactNode/string; rendered as badges below the row
|
|
22
|
+
* - `counterTooltip` — { users: [{ id, name, avatar, link?, openLinkInNewTab? }] } for a count + tooltip
|
|
23
|
+
* - `attributes` — array of strings or ReactNodes below the row
|
|
24
|
+
* - `description` — extra text block
|
|
25
|
+
* - `styles` — optional overrides for title, avatarName, counter, attributes, badge, badgeItem, value, description
|
|
26
|
+
*
|
|
27
|
+
* @category Components
|
|
28
|
+
* @subcategory Display
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```tsx
|
|
32
|
+
* <PersonInfo title="Assignee" value="John Doe" />
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```tsx
|
|
37
|
+
* <PersonInfo
|
|
38
|
+
* title="Owner"
|
|
39
|
+
* value="Jane Smith"
|
|
40
|
+
* icon="user"
|
|
41
|
+
* avatar="/avatar.jpg"
|
|
42
|
+
* link="/users/jane"
|
|
43
|
+
* openLinkInNewTab={false}
|
|
44
|
+
* />
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```tsx
|
|
49
|
+
* <PersonInfo
|
|
50
|
+
* title="Status"
|
|
51
|
+
* value="In progress"
|
|
52
|
+
* badges={[<Badge key="1">Active</Badge>]}
|
|
53
|
+
* attributes={['Due: Jan 15', 'Priority: High']}
|
|
54
|
+
* description="Additional context text."
|
|
55
|
+
* />
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```tsx
|
|
60
|
+
* <PersonInfo
|
|
61
|
+
* title="Participants"
|
|
62
|
+
* value="3"
|
|
63
|
+
* counterTooltip={{
|
|
64
|
+
* users: [
|
|
65
|
+
* { id: 1, name: 'Alice', avatar: '/a.jpg', link: '/users/1' },
|
|
66
|
+
* { id: 2, name: 'Bob', avatar: '/b.jpg' },
|
|
67
|
+
* ],
|
|
68
|
+
* }}
|
|
69
|
+
* />
|
|
70
|
+
* ```
|
|
71
|
+
*
|
|
72
|
+
* @see {@link Avatar} - Often used for avatar prop or inside counter tooltip
|
|
73
|
+
* @see {@link Icon} - Common choice for icon prop
|
|
74
|
+
* @see {@link Badge} - Used when badges prop contains Badge components
|
|
75
|
+
*
|
|
76
|
+
* @accessibility
|
|
77
|
+
* - Semantic structure (heading-like title, list of attributes)
|
|
78
|
+
* - Links support openLinkInNewTab and get appropriate attributes
|
|
79
|
+
* - Counter tooltip is focusable and keyboard-accessible via Tooltip
|
|
80
|
+
*/
|
|
3
81
|
export declare const PersonInfo: React.ForwardRefExoticComponent<PersonInfoProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PersonInfoAvatar - Avatar + value row for PersonInfo.
|
|
3
|
+
* Renders optional Avatar (image URL) and PersonInfoValue. When link is set, wraps in anchor
|
|
4
|
+
* using helpers.getLinkAttributes; link hover uses theme.colors.blue (avatarWrapperLinkStyles).
|
|
5
|
+
* Uses styles.avatarName when avatar present, styles.value when only value. Used only by PersonInfo.
|
|
6
|
+
*/
|
|
1
7
|
import React from 'react';
|
|
2
8
|
import { PersonInfoAvatarProps } from './types';
|
|
3
9
|
export declare const PersonInfoAvatar: React.FC<PersonInfoAvatarProps>;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PersonInfoBadges - Badge row for PersonInfo.
|
|
3
|
+
* badges can be a single ReactNode or array of string | ReactNode. Strings are rendered with
|
|
4
|
+
* CustomBadge using DEFAULT_BADGE_COLORS (cycled by index) and BADGE_COLORS(theme) for text/bg.
|
|
5
|
+
* Other items rendered as-is (e.g. <Badge>). Uses styles.badge and styles.badgeItem.
|
|
6
|
+
*/
|
|
1
7
|
import React from 'react';
|
|
2
8
|
import { PersonInfoStyles } from './types';
|
|
3
9
|
interface PersonInfoBadgesProps {
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PersonInfoCounter - “+N” counter with tooltip for PersonInfo.
|
|
3
|
+
* Renders counter value from counterTooltip.users.length; tooltip lists users via ImageItem
|
|
4
|
+
* (image, name, optional link). Uses Tooltip (hover, no click). Counter text uses
|
|
5
|
+
* theme.colors.greyDropdownFocused (S.Counter). Used only by PersonInfo when counterTooltip is set.
|
|
6
|
+
*/
|
|
1
7
|
import React from 'react';
|
|
2
8
|
import { PersonInfoCounterProps } from './types';
|
|
3
9
|
export declare const PersonInfoCounter: React.FC<PersonInfoCounterProps>;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PersonInfoIcon - Leading icon for PersonInfo row.
|
|
3
|
+
* Renders Icon with theme.colors.greyDarker when icon is a string; otherwise renders custom ReactNode.
|
|
4
|
+
* Used only by PersonInfo when icon prop is set.
|
|
5
|
+
*/
|
|
1
6
|
import React from 'react';
|
|
2
7
|
import type { IconProps } from '../Icon/types';
|
|
3
8
|
interface PersonInfoIconProps {
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PersonInfoValue - Primary value cell for PersonInfo, optionally a link.
|
|
3
|
+
* When linkAttributes (from getLinkAttributes) are provided, renders as <a> with
|
|
4
|
+
* personInfoValueLinkStyles: theme.colors.greyDarker, hover theme.colors.blue. Used by PersonInfoAvatar.
|
|
5
|
+
*/
|
|
1
6
|
import React from 'react';
|
|
2
7
|
import { PersonInfoValueProps } from './types';
|
|
3
8
|
export declare const PersonInfoValue: React.FC<PersonInfoValueProps>;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PersonInfo badge color config. Uses theme.colors only (no palette).
|
|
3
|
+
* DEFAULT_BADGE_COLORS: order of MainColors keys used when badges are strings (cycled by index).
|
|
4
|
+
* BADGE_COLORS(theme): map of MainColors key → { text, bg } using theme.colors.* and theme.colors.*20.
|
|
5
|
+
*/
|
|
1
6
|
import type { Theme } from '@emotion/react';
|
|
2
7
|
type BadgeColorName = keyof MainColors;
|
|
3
8
|
export declare const DEFAULT_BADGE_COLORS: Array<keyof MainColors>;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns link props for PersonInfo value/avatar when link is set.
|
|
3
|
+
* For AI: used by PersonInfoAvatar and PersonInfoValue. Returns { as: 'a', href, target?, rel? }
|
|
4
|
+
* when link is truthy; otherwise {}. openLinkInNewTab sets target="_blank" and rel="noreferrer".
|
|
5
|
+
*/
|
|
1
6
|
export declare const getLinkAttributes: (link?: string, openLinkInNewTab?: boolean) => {
|
|
2
7
|
as: "a";
|
|
3
8
|
href: string | undefined;
|
|
@@ -3,8 +3,16 @@ import { Interpolation, Theme } from '@emotion/react';
|
|
|
3
3
|
import { CommonProps } from '../../types/emotion';
|
|
4
4
|
import { IconProps } from '../Icon/types';
|
|
5
5
|
import { getLinkAttributes } from './helpers';
|
|
6
|
+
/**
|
|
7
|
+
* Style keys that can be overridden via PersonInfoProps.styles.
|
|
8
|
+
* All PersonInfo sub-components accept optional css from this map.
|
|
9
|
+
*/
|
|
6
10
|
type PersonInfoStyleKeys = 'title' | 'avatarName' | 'counter' | 'attributes' | 'badge' | 'badgeItem' | 'value' | 'description';
|
|
7
11
|
export type PersonInfoStyles = Partial<Record<PersonInfoStyleKeys, Interpolation<Theme>>>;
|
|
12
|
+
/**
|
|
13
|
+
* Single user entry for the counter tooltip list.
|
|
14
|
+
* Used by PersonInfoCounter; avatar is image URL, link opens in same/new tab per openLinkInNewTab.
|
|
15
|
+
*/
|
|
8
16
|
export interface PersonInfoCounterTooltipUser {
|
|
9
17
|
id: string | number;
|
|
10
18
|
name: string;
|
|
@@ -12,28 +20,70 @@ export interface PersonInfoCounterTooltipUser {
|
|
|
12
20
|
link?: string;
|
|
13
21
|
openLinkInNewTab?: boolean;
|
|
14
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Tooltip payload for the “+N” counter next to the value.
|
|
25
|
+
* users array is rendered as a list inside the tooltip (e.g. via ImageItem).
|
|
26
|
+
*/
|
|
15
27
|
export interface PersonInfoCounterTooltip {
|
|
16
28
|
users: PersonInfoCounterTooltipUser[];
|
|
17
29
|
}
|
|
18
30
|
export type PersonInfoLinkAttributes = ReturnType<typeof getLinkAttributes>;
|
|
31
|
+
/**
|
|
32
|
+
* Props for the value sub-component (avatar row value, optionally a link).
|
|
33
|
+
* linkAttributes come from helpers.getLinkAttributes(link, openLinkInNewTab).
|
|
34
|
+
*/
|
|
19
35
|
export interface PersonInfoValueProps {
|
|
20
36
|
value: string;
|
|
21
37
|
css?: Interpolation<Theme>;
|
|
22
38
|
linkAttributes?: PersonInfoLinkAttributes;
|
|
23
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Props for the PersonInfo component.
|
|
42
|
+
* Uses theme.colors only (no theme.palette). See PersonInfo.tsx JSDoc for structure and examples.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```tsx
|
|
46
|
+
* <PersonInfo title="Assignee" value="John Doe" />
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```tsx
|
|
51
|
+
* <PersonInfo title="Owner" value="Jane" avatar="/j.jpg" link="/users/jane" />
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```tsx
|
|
56
|
+
* <PersonInfo title="Status" value="3" counterTooltip={{ users: [...] }} />
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
24
59
|
export interface PersonInfoProps extends CommonProps {
|
|
60
|
+
/** Main label (required). */
|
|
25
61
|
title: string;
|
|
62
|
+
/** Icon name or custom ReactNode before the title. */
|
|
26
63
|
icon?: IconProps['name'] | ReactNode;
|
|
64
|
+
/** Primary value; with link becomes a link. */
|
|
27
65
|
value?: string;
|
|
66
|
+
/** Badge(s): single node or array of string | ReactNode. Strings use DEFAULT_BADGE_COLORS. */
|
|
28
67
|
badges?: ReactNode | (string | ReactNode)[];
|
|
68
|
+
/** Avatar image URL, shown next to value. */
|
|
29
69
|
avatar?: string;
|
|
70
|
+
/** “+N” counter with tooltip listing users. */
|
|
30
71
|
counterTooltip?: PersonInfoCounterTooltip;
|
|
72
|
+
/** List of strings or ReactNodes below the row. */
|
|
31
73
|
attributes?: (string | ReactNode)[];
|
|
74
|
+
/** Extra description text. */
|
|
32
75
|
description?: string;
|
|
76
|
+
/** Optional style overrides per PersonInfoStyleKeys. */
|
|
33
77
|
styles?: PersonInfoStyles;
|
|
78
|
+
/** If set, value (or avatar+value) renders as a link. */
|
|
34
79
|
link?: string;
|
|
80
|
+
/** When link is set, open in new tab and use rel="noreferrer". */
|
|
35
81
|
openLinkInNewTab?: boolean;
|
|
36
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* Props for PersonInfoAvatar (value + optional avatar, optional link).
|
|
85
|
+
* Used internally by PersonInfo.
|
|
86
|
+
*/
|
|
37
87
|
export interface PersonInfoAvatarProps {
|
|
38
88
|
avatar?: string;
|
|
39
89
|
value?: string;
|
|
@@ -41,6 +91,10 @@ export interface PersonInfoAvatarProps {
|
|
|
41
91
|
link?: string;
|
|
42
92
|
openLinkInNewTab?: boolean;
|
|
43
93
|
}
|
|
94
|
+
/**
|
|
95
|
+
* Props for PersonInfoCounter (“+N” with tooltip).
|
|
96
|
+
* css overrides styles.counter.
|
|
97
|
+
*/
|
|
44
98
|
export interface PersonInfoCounterProps {
|
|
45
99
|
counterTooltip?: PersonInfoCounterTooltip;
|
|
46
100
|
css?: PersonInfoStyles['counter'];
|