@ssa-ui-kit/core 3.1.0 → 3.3.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/DatePicker/types.d.ts +218 -5
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +51 -0
- package/dist/components/DateRangePicker/DateRangePickerFormBridge.d.ts +29 -5
- package/dist/components/DateRangePicker/constants.d.ts +8 -0
- package/dist/components/DateRangePicker/types.d.ts +235 -11
- package/dist/components/Dropdown/Dropdown.d.ts +1 -1
- package/dist/components/Dropdown/types.d.ts +9 -0
- package/dist/components/History/History.d.ts +31 -0
- package/dist/components/History/index.d.ts +2 -0
- package/dist/components/History/styles.d.ts +9 -0
- package/dist/components/History/types.d.ts +56 -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/SettingClock.d.ts +3 -0
- package/dist/components/Icon/icons/all.d.ts +5 -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/components/index.d.ts +2 -1
- package/dist/index.js +682 -65
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -4,41 +4,142 @@ import { useMask } from '@react-input/mask';
|
|
|
4
4
|
import { FieldContextValue } from '../Field/FieldProvider';
|
|
5
5
|
import { InputProps } from '../Input/types';
|
|
6
6
|
import type { PickerCalendarType, DateFormat } from '../JsonSchemaForm/utils/dateFormats';
|
|
7
|
+
/**
|
|
8
|
+
* Which side of the range has focus for calendar selection and keyboard flow: **from** or **to**.
|
|
9
|
+
*/
|
|
7
10
|
export type LastFocusedElement = 'from' | 'to';
|
|
11
|
+
/**
|
|
12
|
+
* Calendar granularity: **days**, **months**, or **years** (same as **DatePicker** / shared **PickerCalendarType**).
|
|
13
|
+
*/
|
|
8
14
|
export type RangePickerType = PickerCalendarType;
|
|
15
|
+
/**
|
|
16
|
+
* Mask and parse format for both inputs (e.g. **`mm/dd/yyyy`**, **`dd/mm/yyyy`**, **`mm/yyyy`**, **`yyyy`**).
|
|
17
|
+
*/
|
|
9
18
|
export type Format = DateFormat;
|
|
10
19
|
/**
|
|
11
|
-
*
|
|
20
|
+
* Tuple passed to **`onChange`**: **[start, end]** in JavaScript **`Date`**, **`null`**, or **`undefined`**.
|
|
12
21
|
*
|
|
13
|
-
* - Date
|
|
14
|
-
* - null
|
|
15
|
-
* - undefined
|
|
22
|
+
* - **`Date`** — valid anchor for that side
|
|
23
|
+
* - **`null`** — **end date only**: user chose **“Present”** (open-ended range). **Start** is never **`null`**.
|
|
24
|
+
* - **`undefined`** — that side is empty / cleared
|
|
16
25
|
*/
|
|
17
26
|
export type DateRangePickerOnChangeDates = [
|
|
18
27
|
Date | null | undefined,
|
|
19
28
|
Date | null | undefined
|
|
20
29
|
];
|
|
21
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Parsed range as **Luxon** values before emitting JS dates (**`[from, to]`**).
|
|
32
|
+
*/
|
|
33
|
+
export type DateTimeTuple = [DateTime | undefined, DateTime | undefined];
|
|
34
|
+
/**
|
|
35
|
+
* Active calendar view: day grid, month grid, or year list (aligned with **rangePickerType** / header navigation).
|
|
36
|
+
*/
|
|
37
|
+
export type CalendarType = PickerCalendarType;
|
|
38
|
+
/**
|
|
39
|
+
* Props for **DateRangePicker**
|
|
40
|
+
*
|
|
41
|
+
* Two masked inputs registered as **`${name}From`** and **`${name}To`** under **react-hook-form**
|
|
42
|
+
* **`FormProvider`**. Stored values are **formatted strings**; **`onChange`** receives **`DateRangePickerOnChangeDates`**.
|
|
43
|
+
* Optional **“Present”** applies only to the **end** date (**`showPresentOption`**).
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```tsx
|
|
47
|
+
* <DateRangePicker
|
|
48
|
+
* name="employment"
|
|
49
|
+
* label="Employment period"
|
|
50
|
+
* messages={{ description: 'Start and end dates' }}
|
|
51
|
+
* onChange={(dates) => console.log(dates)}
|
|
52
|
+
* />
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```tsx
|
|
57
|
+
* <DateRangePicker
|
|
58
|
+
* name="period"
|
|
59
|
+
* rangePickerType="months"
|
|
60
|
+
* format="mm/yyyy"
|
|
61
|
+
* dateMin="01/2020"
|
|
62
|
+
* dateMax="12/2030"
|
|
63
|
+
* showPresentOption
|
|
64
|
+
* />
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
export interface DateRangePickerProps {
|
|
68
|
+
/**
|
|
69
|
+
* Base field name; registers **`${name}From`** and **`${name}To`** with react-hook-form.
|
|
70
|
+
*/
|
|
22
71
|
name: string;
|
|
72
|
+
/**
|
|
73
|
+
* Optional label (**`Field.Label`**); **`htmlFor`** follows the focused input.
|
|
74
|
+
*/
|
|
23
75
|
label?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Date string format for both fields. Defaults from **`rangePickerType`** if omitted.
|
|
78
|
+
*/
|
|
24
79
|
format?: Format;
|
|
80
|
+
/**
|
|
81
|
+
* Initial open state for the calendar popover (controlled open seed).
|
|
82
|
+
*/
|
|
25
83
|
isOpenState?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Controlled tuple of string values matching **format**; **`null`** at index **1** means **“Present”** end.
|
|
86
|
+
*/
|
|
26
87
|
value?: [string | undefined | null, string | undefined | null];
|
|
88
|
+
/**
|
|
89
|
+
* Initial tuple; **`[string, null]`** end means **Present** (open-ended).
|
|
90
|
+
*/
|
|
27
91
|
defaultValue?: [string, string | null] | [string, string];
|
|
92
|
+
/**
|
|
93
|
+
* Options for **`@react-input/mask`** (shared pattern for both inputs).
|
|
94
|
+
*/
|
|
28
95
|
maskOptions?: Parameters<typeof useMask>[0];
|
|
96
|
+
/**
|
|
97
|
+
* Extra props for the underlying **Input** fields.
|
|
98
|
+
*/
|
|
29
99
|
inputProps?: Partial<InputProps>;
|
|
100
|
+
/**
|
|
101
|
+
* Visual status for **`Field.Root`** (**error** / **success** / **basic**).
|
|
102
|
+
*/
|
|
30
103
|
status?: FieldContextValue['status'];
|
|
104
|
+
/**
|
|
105
|
+
* Whether **`messages`** render in **`TriggerStatusArea`** below the inputs.
|
|
106
|
+
* @default true
|
|
107
|
+
*/
|
|
31
108
|
showStatusArea?: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Inclusive minimum date string (shape matches **format** and **rangePickerType**).
|
|
111
|
+
*/
|
|
32
112
|
dateMin?: string;
|
|
113
|
+
/**
|
|
114
|
+
* Inclusive maximum date string (shape matches **format** and **rangePickerType**).
|
|
115
|
+
*/
|
|
33
116
|
dateMax?: string;
|
|
117
|
+
/**
|
|
118
|
+
* Disables both inputs and the calendar trigger.
|
|
119
|
+
* @default false
|
|
120
|
+
*/
|
|
34
121
|
disabled?: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* Shows the calendar icon button to open the popover.
|
|
124
|
+
* @default true
|
|
125
|
+
*/
|
|
35
126
|
showCalendarIcon?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* **days** | **months** | **years** — drives default **format**, mask, and calendar chrome.
|
|
129
|
+
* @default 'days'
|
|
130
|
+
*/
|
|
36
131
|
rangePickerType?: RangePickerType;
|
|
132
|
+
/**
|
|
133
|
+
* Optional copy for the status area (description / success / error messaging).
|
|
134
|
+
*/
|
|
37
135
|
messages?: {
|
|
38
136
|
description?: string;
|
|
39
137
|
success?: string;
|
|
40
138
|
error?: string;
|
|
41
139
|
};
|
|
140
|
+
/**
|
|
141
|
+
* Optional class names for trigger layout, inputs, icon, calendar shell, and label.
|
|
142
|
+
*/
|
|
42
143
|
classNames?: {
|
|
43
144
|
trigger?: {
|
|
44
145
|
root?: string;
|
|
@@ -51,54 +152,177 @@ export type DateRangePickerProps = {
|
|
|
51
152
|
calendar?: string;
|
|
52
153
|
label?: string;
|
|
53
154
|
};
|
|
155
|
+
/**
|
|
156
|
+
* Emits **`[start, end]`** as **`Date`**, **`null`** (Present end only), or **`undefined`** per side.
|
|
157
|
+
*/
|
|
54
158
|
onChange?: (dates?: DateRangePickerOnChangeDates) => void;
|
|
159
|
+
/**
|
|
160
|
+
* Calendar popover opened.
|
|
161
|
+
*/
|
|
55
162
|
onOpen?: () => void;
|
|
163
|
+
/**
|
|
164
|
+
* Calendar popover closed.
|
|
165
|
+
*/
|
|
56
166
|
onClose?: () => void;
|
|
167
|
+
/**
|
|
168
|
+
* Validation or parse error: raw input value and message (e.g. invalid / out of range).
|
|
169
|
+
*/
|
|
57
170
|
onError?: (date: unknown, error?: string | null) => void;
|
|
171
|
+
/**
|
|
172
|
+
* Visible month changed (prev/next) while in day view.
|
|
173
|
+
*/
|
|
58
174
|
onMonthChange?: (date: Date) => void;
|
|
175
|
+
/**
|
|
176
|
+
* Year changed from year list or header drill-down.
|
|
177
|
+
*/
|
|
59
178
|
onYearChange?: (date: Date) => void;
|
|
179
|
+
/**
|
|
180
|
+
* Blur handler composed with internal validation.
|
|
181
|
+
*/
|
|
60
182
|
onBlur?: FocusEventHandler<HTMLInputElement>;
|
|
183
|
+
/**
|
|
184
|
+
* If the user picks an end before a start, swap the two dates instead of rejecting.
|
|
185
|
+
* @default false
|
|
186
|
+
*/
|
|
61
187
|
allowReverseSelection?: boolean;
|
|
188
|
+
/**
|
|
189
|
+
* Shows a **Present** control in the calendar (end date only — ongoing range).
|
|
190
|
+
* @default false
|
|
191
|
+
*/
|
|
62
192
|
showPresentOption?: boolean;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Context value for **DateRangePicker** (provider + subcomponents). Extends picker props but
|
|
196
|
+
* replaces **`dateMin`** / **`dateMax`** strings with **Luxon** bounds and segment arrays; adds
|
|
197
|
+
* dual field names, refs, range selection step, and **Present** end state.
|
|
198
|
+
*
|
|
199
|
+
* Most apps use **DateRangePicker** only; this documents **useDateRangePickerContext** consumers.
|
|
200
|
+
*/
|
|
201
|
+
export interface DateRangePickerContextProps extends Omit<DateRangePickerProps, 'dateMin' | 'dateMax'> {
|
|
202
|
+
/**
|
|
203
|
+
* Registered field name for the **start** input (**`${name}From`**).
|
|
204
|
+
*/
|
|
66
205
|
nameFrom: string;
|
|
206
|
+
/**
|
|
207
|
+
* Registered field name for the **end** input (**`${name}To`**).
|
|
208
|
+
*/
|
|
67
209
|
nameTo: string;
|
|
210
|
+
/**
|
|
211
|
+
* Whether the calendar popover is open.
|
|
212
|
+
*/
|
|
68
213
|
isOpen: boolean;
|
|
214
|
+
/**
|
|
215
|
+
* **Luxon** date for the calendar header / navigation (current visible month or year).
|
|
216
|
+
*/
|
|
69
217
|
currentCalendarViewDT: DateTime;
|
|
218
|
+
/**
|
|
219
|
+
* **`0`** when **from** is focused, **`1`** when **to** is focused.
|
|
220
|
+
*/
|
|
70
221
|
currentIndex: number;
|
|
222
|
+
/**
|
|
223
|
+
* Per-side calendar view anchors (**`[fromView, toView]`**).
|
|
224
|
+
*/
|
|
71
225
|
calendarViewDateTime: DateTimeTuple;
|
|
226
|
+
/**
|
|
227
|
+
* Active popover view: **days**, **months**, or **years**.
|
|
228
|
+
*/
|
|
72
229
|
calendarType: CalendarType;
|
|
230
|
+
/**
|
|
231
|
+
* Watched form value for the **from** field.
|
|
232
|
+
*/
|
|
73
233
|
inputValueFrom?: string;
|
|
234
|
+
/**
|
|
235
|
+
* Watched form value for the **to** field.
|
|
236
|
+
*/
|
|
74
237
|
inputValueTo?: string;
|
|
238
|
+
/**
|
|
239
|
+
* Ref for the **from** masked input (merged).
|
|
240
|
+
*/
|
|
75
241
|
inputFromRef: React.ForwardedRef<HTMLInputElement | null>;
|
|
242
|
+
/**
|
|
243
|
+
* Ref for the **to** masked input (merged).
|
|
244
|
+
*/
|
|
76
245
|
inputToRef: React.ForwardedRef<HTMLInputElement | null>;
|
|
246
|
+
/**
|
|
247
|
+
* Parsed **Luxon** range (**`[from, to]`**).
|
|
248
|
+
*/
|
|
77
249
|
dateTime: DateTimeTuple;
|
|
250
|
+
/**
|
|
251
|
+
* **`dateMin`** split by **`/`** into numeric segments (index **i** matches **format** segment **i**).
|
|
252
|
+
*/
|
|
78
253
|
dateMinParts: number[];
|
|
254
|
+
/**
|
|
255
|
+
* **`dateMax`** split by **`/`** into numeric segments (index **i** matches **format** segment **i**).
|
|
256
|
+
*/
|
|
79
257
|
dateMaxParts: number[];
|
|
258
|
+
/**
|
|
259
|
+
* Inclusive minimum as **DateTime**.
|
|
260
|
+
*/
|
|
80
261
|
dateMinDT: DateTime;
|
|
262
|
+
/**
|
|
263
|
+
* Inclusive maximum as **DateTime**.
|
|
264
|
+
*/
|
|
81
265
|
dateMaxDT: DateTime;
|
|
266
|
+
/**
|
|
267
|
+
* Indices of **dd**, **mm**, **yyyy** in the **format** string.
|
|
268
|
+
*/
|
|
82
269
|
formatIndexes: {
|
|
83
270
|
day: number;
|
|
84
271
|
month: number;
|
|
85
272
|
year: number;
|
|
86
273
|
};
|
|
274
|
+
/**
|
|
275
|
+
* Which input is focused for calendar and validation.
|
|
276
|
+
*/
|
|
87
277
|
lastFocusedElement: LastFocusedElement;
|
|
278
|
+
/**
|
|
279
|
+
* Last **`onChange`** tuple in **JS** dates (supports **Present** as **`null`** on end).
|
|
280
|
+
*/
|
|
88
281
|
lastChangedDate?: [Date | undefined | null, Date | undefined | null];
|
|
282
|
+
/**
|
|
283
|
+
* Internal change handler (Luxon) used when selecting from the calendar.
|
|
284
|
+
*/
|
|
89
285
|
safeOnChange?: (date?: DateTime) => void;
|
|
286
|
+
/**
|
|
287
|
+
* Sets **from** vs **to** focus.
|
|
288
|
+
*/
|
|
90
289
|
setLastFocusedElement: Dispatch<SetStateAction<LastFocusedElement>>;
|
|
290
|
+
/**
|
|
291
|
+
* Updates last emitted **Date** tuple for parents and highlights.
|
|
292
|
+
*/
|
|
91
293
|
setLastChangedDate: Dispatch<SetStateAction<[Date | undefined | null, Date | undefined | null]>>;
|
|
294
|
+
/**
|
|
295
|
+
* Toggles popover from icon or input (**implementation**-specific rules).
|
|
296
|
+
*/
|
|
92
297
|
handleToggleOpen: MouseEventHandler<HTMLButtonElement | HTMLInputElement>;
|
|
298
|
+
/**
|
|
299
|
+
* Updates one or both calendar view anchors.
|
|
300
|
+
*/
|
|
93
301
|
setCalendarViewDateTime: Dispatch<SetStateAction<DateTimeTuple>>;
|
|
302
|
+
/**
|
|
303
|
+
* Sets the selected **Luxon** range.
|
|
304
|
+
*/
|
|
94
305
|
setDateTime: Dispatch<SetStateAction<DateTimeTuple>>;
|
|
306
|
+
/**
|
|
307
|
+
* Opens or closes the popover.
|
|
308
|
+
*/
|
|
95
309
|
setIsOpen: Dispatch<SetStateAction<boolean>>;
|
|
310
|
+
/**
|
|
311
|
+
* Switches day / month / year surface in the popover.
|
|
312
|
+
*/
|
|
96
313
|
setCalendarType: Dispatch<SetStateAction<CalendarType>>;
|
|
314
|
+
/**
|
|
315
|
+
* **start** → **end** two-step calendar selection, or **null** when not in that flow.
|
|
316
|
+
*/
|
|
97
317
|
rangeSelectionStep: 'start' | 'end' | null;
|
|
98
318
|
setRangeSelectionStep: Dispatch<SetStateAction<'start' | 'end' | null>>;
|
|
319
|
+
/**
|
|
320
|
+
* Clears **from** or **to** and syncs form state.
|
|
321
|
+
*/
|
|
99
322
|
clearInputValue: (field: 'from' | 'to') => void;
|
|
100
|
-
|
|
323
|
+
/**
|
|
324
|
+
* End field shows **Present** (open-ended); form **to** value may be empty while flag is true.
|
|
325
|
+
*/
|
|
101
326
|
isEndDatePresent: boolean;
|
|
102
327
|
setIsEndDatePresent: Dispatch<SetStateAction<boolean>>;
|
|
103
|
-
}
|
|
104
|
-
export type CalendarType = PickerCalendarType;
|
|
328
|
+
}
|
|
@@ -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
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { HistoryProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* History - Vertical timeline component for chronological events.
|
|
4
|
+
*
|
|
5
|
+
* Renders a date column and content column for each item, connected by
|
|
6
|
+
* timeline markers. Marker colors can be set per item or via defaults.
|
|
7
|
+
*
|
|
8
|
+
* ### Color behavior
|
|
9
|
+
* - `item.color` overrides the marker color for a specific row
|
|
10
|
+
* - `defaultColor` is used when `item.color` is not provided
|
|
11
|
+
* - fallback default marker color: `theme.palette.primary.main`
|
|
12
|
+
* - fallback connector color: `theme.colors.greyLighter`
|
|
13
|
+
*
|
|
14
|
+
* ### Alignment behavior
|
|
15
|
+
* The marker is vertically aligned to the first text line and adapts when
|
|
16
|
+
* `circleSize` changes.
|
|
17
|
+
*
|
|
18
|
+
* @category Components
|
|
19
|
+
* @subcategory Display
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* <History
|
|
24
|
+
* items={[
|
|
25
|
+
* { date: '01.01.2026', content: 'Account created' },
|
|
26
|
+
* { date: '03.01.2026', content: 'Plan upgraded', color: '#10b981' },
|
|
27
|
+
* ]}
|
|
28
|
+
* />
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export declare const History: ({ items, defaultColor, lineColor, dateWidth, circleSize, sx, }: HistoryProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const FIRST_LINE_TOP_PADDING = 2;
|
|
2
|
+
export declare const FIRST_LINE_HEIGHT = 20;
|
|
3
|
+
export declare const container: import("@emotion/react").SerializedStyles;
|
|
4
|
+
export declare const row: import("@emotion/react").SerializedStyles;
|
|
5
|
+
export declare const leftColumn: (width: number) => import("@emotion/react").SerializedStyles;
|
|
6
|
+
export declare const circle: (color: string, size: number, topOffset: number) => import("@emotion/react").SerializedStyles;
|
|
7
|
+
export declare const connector: (color: string, circleTopOffset: number, circleSize: number) => import("@emotion/react").SerializedStyles;
|
|
8
|
+
export declare const dateColumn: (width: number) => import("@emotion/react").SerializedStyles;
|
|
9
|
+
export declare const contentColumn: import("@emotion/react").SerializedStyles;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Single timeline row model for `History`.
|
|
4
|
+
*/
|
|
5
|
+
export interface HistoryItemType {
|
|
6
|
+
/**
|
|
7
|
+
* Left column value (date/time/period label).
|
|
8
|
+
*/
|
|
9
|
+
date: React.ReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* Main row content shown in the right column.
|
|
12
|
+
*/
|
|
13
|
+
content: React.ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* Optional marker color for this row.
|
|
16
|
+
* If omitted, `defaultColor` from `HistoryProps` is used.
|
|
17
|
+
*/
|
|
18
|
+
color?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Optional stable React key.
|
|
21
|
+
*/
|
|
22
|
+
key?: string | number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Props for the `History` timeline component.
|
|
26
|
+
*/
|
|
27
|
+
export interface HistoryProps {
|
|
28
|
+
/**
|
|
29
|
+
* Timeline rows to render from top to bottom.
|
|
30
|
+
*/
|
|
31
|
+
items: HistoryItemType[];
|
|
32
|
+
/**
|
|
33
|
+
* Default marker color for rows without `item.color`.
|
|
34
|
+
* Falls back to `theme.palette.primary.main`.
|
|
35
|
+
*/
|
|
36
|
+
defaultColor?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Connector line color between markers.
|
|
39
|
+
* Falls back to `theme.colors.greyLighter`.
|
|
40
|
+
*/
|
|
41
|
+
lineColor?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Width of the date column in pixels.
|
|
44
|
+
* @default 120
|
|
45
|
+
*/
|
|
46
|
+
dateWidth?: number;
|
|
47
|
+
/**
|
|
48
|
+
* Marker circle diameter in pixels.
|
|
49
|
+
* @default 12
|
|
50
|
+
*/
|
|
51
|
+
circleSize?: number;
|
|
52
|
+
/**
|
|
53
|
+
* Inline style for the root container.
|
|
54
|
+
*/
|
|
55
|
+
sx?: React.CSSProperties;
|
|
56
|
+
}
|
|
@@ -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';
|
|
@@ -94,6 +98,7 @@ export * as Roles from './Roles';
|
|
|
94
98
|
export * as Search from './Search';
|
|
95
99
|
export * as Seniority from './Seniority';
|
|
96
100
|
export * as Settings from './Settings';
|
|
101
|
+
export * as SettingClock from './SettingClock';
|
|
97
102
|
export * as Signature from './Signature';
|
|
98
103
|
export * as Sleep from './Sleep';
|
|
99
104
|
export * as StaffGrowthCoefficient from './StaffGrowthCoefficient';
|
|
@@ -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" | "setting-clock" | "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 {
|