@andreyfedkovich/cozy-ui 0.2.0 → 0.2.1
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/CHANGELOG.md +6 -0
- package/dist-lib/index.d.ts +732 -2
- package/dist-lib/svg-react-shim.d.ts +5 -0
- package/package.json +3 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.2.1
|
|
4
|
+
|
|
5
|
+
- **fix:** Published `dist-lib/index.d.ts` is now the real rolled-up declaration bundle (no broken stub pointing at `../dist/lib/index`). `vite-plugin-dts` writes types to the same `outDir` as the library build (`dist-lib`).
|
|
6
|
+
- **fix:** Ship `dist-lib/svg-react-shim.d.ts` and a `/// <reference />` in `index.d.ts` so consumers typecheck `*.svg?react` imports from the bundle without missing-module errors (including with `skipLibCheck: false`).
|
package/dist-lib/index.d.ts
CHANGED
|
@@ -1,2 +1,732 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/// <reference path="./svg-react-shim.d.ts" />
|
|
2
|
+
import { default as ArrowDownBlueIcon } from './arrowDownBlue.svg?react';
|
|
3
|
+
import { default as ArrowDownIcon } from './arrowDown.svg?react';
|
|
4
|
+
import { default as ArrowRightIcon } from './arrowRight.svg?react';
|
|
5
|
+
import { ButtonHTMLAttributes } from 'react';
|
|
6
|
+
import { default as CameraIcon } from './camera.svg?react';
|
|
7
|
+
import { default as CancelIcon } from './cancel.svg?react';
|
|
8
|
+
import { default as ChartIcon } from './chart.svg?react';
|
|
9
|
+
import { default as ChatIcon } from './chat.svg?react';
|
|
10
|
+
import { default as CheckGreen } from './checkGreen.svg?react';
|
|
11
|
+
import { default as ClockFilledIcon } from './clockFilled.svg?react';
|
|
12
|
+
import { default as ClockIcon } from './clock.svg?react';
|
|
13
|
+
import { default as CloseRed } from './closeRed.svg?react';
|
|
14
|
+
import { default as CopyIcon } from './copy.svg?react';
|
|
15
|
+
import { default as CrossIcon } from './cross.svg?react';
|
|
16
|
+
import { default as default_2 } from 'react';
|
|
17
|
+
import { default as DoneIcon } from './done.svg?react';
|
|
18
|
+
import { default as DownloadIcon } from './download.svg?react';
|
|
19
|
+
import { default as EditIcon } from './edit.svg?react';
|
|
20
|
+
import { default as EmptyIcon } from './empty.svg?react';
|
|
21
|
+
import { default as EnvelopIcon } from './envelop.svg?react';
|
|
22
|
+
import { FC } from 'react';
|
|
23
|
+
import { default as FeedbackIcon } from './feedback.svg?react';
|
|
24
|
+
import { default as FileReloadIcon } from './fileReload.svg?react';
|
|
25
|
+
import { default as FileSync } from './fileSync.svg?react';
|
|
26
|
+
import { default as FilterIcon } from './filter.svg?react';
|
|
27
|
+
import { default as FolderEditIcon } from './folderEdit.svg?react';
|
|
28
|
+
import { default as GraduateIcon } from './graduate.svg?react';
|
|
29
|
+
import { default as GridIcon } from './grid.svg?react';
|
|
30
|
+
import { default as HeartIcon } from './heart.svg?react';
|
|
31
|
+
import { default as HelpIcon } from './help.svg?react';
|
|
32
|
+
import { default as HistoryBlue } from './historyBlue.svg?react';
|
|
33
|
+
import { default as HomeIcon } from './home.svg?react';
|
|
34
|
+
import { HTMLAttributes } from 'react';
|
|
35
|
+
import { default as InfoIcon } from './info.svg?react';
|
|
36
|
+
import { default as IslandIcon } from './island.svg?react';
|
|
37
|
+
import { JSX } from 'react/jsx-runtime';
|
|
38
|
+
import { default as ListIcon } from './list.svg?react';
|
|
39
|
+
import { default as MarketIcon } from './market.svg?react';
|
|
40
|
+
import { default as MegaphoneIcon } from './megaphone.svg?react';
|
|
41
|
+
import { MemoExoticComponent } from 'react';
|
|
42
|
+
import { default as MessageIcon } from './message.svg?react';
|
|
43
|
+
import { default as NotebookIcon } from './notebook.svg?react';
|
|
44
|
+
import { default as PhoneIcon } from './phone.svg?react';
|
|
45
|
+
import { default as PlaneIcon } from './plane.svg?react';
|
|
46
|
+
import { default as ProfileIcon } from './profile.svg?react';
|
|
47
|
+
import { default as ProfileSearchIcon } from './profileSearch.svg?react';
|
|
48
|
+
import { PropsWithChildren } from 'react';
|
|
49
|
+
import * as React_2 from 'react';
|
|
50
|
+
import { ReactNode } from 'react';
|
|
51
|
+
import { RefObject } from 'react';
|
|
52
|
+
import { default as ReloadIcon } from './reload.svg?react';
|
|
53
|
+
import { default as SchoolIcon } from './school.svg?react';
|
|
54
|
+
import { default as SearchIcon } from './search.svg?react';
|
|
55
|
+
import { default as SettingsIcon } from './settings.svg?react';
|
|
56
|
+
import { default as TaskListIcon } from './taskList.svg?react';
|
|
57
|
+
import { default as TimesheetIcon } from './timesheet.svg?react';
|
|
58
|
+
import { default as TrendUpIcon } from './trendUp.svg?react';
|
|
59
|
+
import { default as UserSwitchIcon } from './userSwitch.svg?react';
|
|
60
|
+
import { default as WalletIcon } from './wallet.svg?react';
|
|
61
|
+
import { default as WarnIcon } from './warn.svg?react';
|
|
62
|
+
|
|
63
|
+
export declare type ApprovalLevel = {
|
|
64
|
+
id: string;
|
|
65
|
+
name: string;
|
|
66
|
+
status: "completed" | "current" | "pending";
|
|
67
|
+
stages: ApprovalStage[];
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export declare const ApprovalRoute: default_2.FC<ApprovalRouteProps>;
|
|
71
|
+
|
|
72
|
+
export declare interface ApprovalRouteProps {
|
|
73
|
+
levels: ApprovalLevel[];
|
|
74
|
+
editable?: boolean;
|
|
75
|
+
title?: string;
|
|
76
|
+
eyebrow?: string;
|
|
77
|
+
className?: string;
|
|
78
|
+
loadApprovers?: (params: LoadOptionsParams_2) => Promise<LoadOptionsResult_2>;
|
|
79
|
+
onAddLevel?: (name: string) => void;
|
|
80
|
+
onRemoveLevel?: (levelId: string) => void;
|
|
81
|
+
onAddStage?: (levelId: string, name: string) => void;
|
|
82
|
+
onRemoveStage?: (levelId: string, stageId: string) => void;
|
|
83
|
+
onAddApprover?: (levelId: string, stageId: string, person: CustomOption<unknown, string>) => void;
|
|
84
|
+
onRemoveApprover?: (levelId: string, stageId: string, approverId: string) => void;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export declare type ApprovalStage = {
|
|
88
|
+
id: string;
|
|
89
|
+
name: string;
|
|
90
|
+
approvers: Approver[];
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export declare type ApprovalStatus = "pending" | "approved" | "rejected";
|
|
94
|
+
|
|
95
|
+
export declare type Approver = {
|
|
96
|
+
id: string;
|
|
97
|
+
fullName: string;
|
|
98
|
+
status?: ApprovalStatus;
|
|
99
|
+
actedAt?: string;
|
|
100
|
+
rejectReason?: string;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export { ArrowDownBlueIcon }
|
|
104
|
+
|
|
105
|
+
export { ArrowDownIcon }
|
|
106
|
+
|
|
107
|
+
export { ArrowRightIcon }
|
|
108
|
+
|
|
109
|
+
export declare const BaseBlock: FC<BaseBlockProps>;
|
|
110
|
+
|
|
111
|
+
declare interface BaseBlockProps {
|
|
112
|
+
id?: string;
|
|
113
|
+
title?: string | ReactNode;
|
|
114
|
+
subtitle?: ReactNode;
|
|
115
|
+
children: ReactNode;
|
|
116
|
+
className?: string;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export declare const Button: default_2.ForwardRefExoticComponent<ButtonProps & default_2.RefAttributes<HTMLButtonElement>>;
|
|
120
|
+
|
|
121
|
+
declare interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
122
|
+
variant?: ButtonVariant;
|
|
123
|
+
size?: ButtonSize;
|
|
124
|
+
className?: string;
|
|
125
|
+
loading?: boolean;
|
|
126
|
+
disabled?: boolean;
|
|
127
|
+
children?: default_2.ReactNode;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
declare type ButtonSize = "small" | "medium" | "large";
|
|
131
|
+
|
|
132
|
+
declare type ButtonVariant = "default" | "primary" | "secondary" | "text" | "link" | "danger";
|
|
133
|
+
|
|
134
|
+
export { CameraIcon }
|
|
135
|
+
|
|
136
|
+
export { CancelIcon }
|
|
137
|
+
|
|
138
|
+
export declare const Card: FC<CardProps>;
|
|
139
|
+
|
|
140
|
+
declare interface CardProps {
|
|
141
|
+
text: string;
|
|
142
|
+
width?: number;
|
|
143
|
+
height?: number;
|
|
144
|
+
className?: string;
|
|
145
|
+
backgroundColor?: string;
|
|
146
|
+
imageUrl?: string;
|
|
147
|
+
textColor?: string;
|
|
148
|
+
link?: string;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export declare const Carousel: <T extends {
|
|
152
|
+
id: string | number;
|
|
153
|
+
caption?: string;
|
|
154
|
+
}>(props: CarouselProps<T>) => JSX.Element | null;
|
|
155
|
+
|
|
156
|
+
export declare type CarouselProps<T extends {
|
|
157
|
+
id: string | number;
|
|
158
|
+
caption?: string;
|
|
159
|
+
}> = (CarouselSharedProps & {
|
|
160
|
+
items: T[];
|
|
161
|
+
renderItem: (item: T) => ReactNode;
|
|
162
|
+
}) | (CarouselSharedProps & {
|
|
163
|
+
children: ReactNode;
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
declare type CarouselSharedProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
167
|
+
dark?: boolean;
|
|
168
|
+
enableTouch?: boolean;
|
|
169
|
+
fade?: boolean;
|
|
170
|
+
interval?: number | string | boolean;
|
|
171
|
+
keyboard?: boolean;
|
|
172
|
+
pause?: "hover" | false;
|
|
173
|
+
ride?: "carousel";
|
|
174
|
+
slide?: boolean;
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
export { ChartIcon }
|
|
178
|
+
|
|
179
|
+
export { ChatIcon }
|
|
180
|
+
|
|
181
|
+
export { CheckGreen }
|
|
182
|
+
|
|
183
|
+
export { ClockFilledIcon }
|
|
184
|
+
|
|
185
|
+
export { ClockIcon }
|
|
186
|
+
|
|
187
|
+
export { CloseRed }
|
|
188
|
+
|
|
189
|
+
export declare const CollapsableBlock: React_2.FC<Props_2>;
|
|
190
|
+
|
|
191
|
+
export declare const Collapse: FC<CollapseProps>;
|
|
192
|
+
|
|
193
|
+
declare interface CollapseProps {
|
|
194
|
+
header: ReactNode;
|
|
195
|
+
content: ReactNode;
|
|
196
|
+
onToggle?: () => void;
|
|
197
|
+
isOpen?: boolean;
|
|
198
|
+
defaultOpen?: boolean;
|
|
199
|
+
className?: string;
|
|
200
|
+
id?: string;
|
|
201
|
+
headerClassName?: string;
|
|
202
|
+
contentClassName?: string;
|
|
203
|
+
iconClassName?: string;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export declare enum Colors {
|
|
207
|
+
BLUE_01 = "#D3E8FA",
|
|
208
|
+
BLUE_02 = "#4573D9",
|
|
209
|
+
BLUE_03 = "#4573D9",
|
|
210
|
+
BLUE_04 = "#4573D9",
|
|
211
|
+
BLUE_05 = "#001A3D",
|
|
212
|
+
GRAY_01 = "#F4F7FA",
|
|
213
|
+
GRAY_02 = "#c8c7cc",
|
|
214
|
+
GRAY_03 = "#808080",
|
|
215
|
+
GRAY_04 = "#525252",
|
|
216
|
+
GRAY_05 = "#2A2A2A",
|
|
217
|
+
GRAY_06 = "#AEBFDE",
|
|
218
|
+
GRAY_07 = "#DDE5F5",
|
|
219
|
+
WHITE_01 = "#FFFFFF",
|
|
220
|
+
BLACK_01 = "#000000",
|
|
221
|
+
GREEN_01 = "#C4F2E8",
|
|
222
|
+
GREEN_02 = "#00A582",
|
|
223
|
+
ORANGE_01 = "#F9E1D7",
|
|
224
|
+
ORANGE_02 = "#FF6B2C",
|
|
225
|
+
RED_01 = "#FFEEEE",
|
|
226
|
+
RED_02 = "#D72D40",
|
|
227
|
+
YELLOW_01 = "#FFF1D8",
|
|
228
|
+
YELLOW_02 = "#FFA300"
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export { CopyIcon }
|
|
232
|
+
|
|
233
|
+
export declare const CopyTextTrigger: MemoExoticComponent<({ children, onClick, copied, tooltipText, ariaLabel, showIcon, className, }: CopyTextTriggerProps) => JSX.Element>;
|
|
234
|
+
|
|
235
|
+
export declare interface CopyTextTriggerProps {
|
|
236
|
+
children: ReactNode;
|
|
237
|
+
onClick: () => void;
|
|
238
|
+
copied: boolean;
|
|
239
|
+
tooltipText?: string;
|
|
240
|
+
ariaLabel?: string;
|
|
241
|
+
showIcon?: boolean;
|
|
242
|
+
className?: string;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
export { CrossIcon }
|
|
246
|
+
|
|
247
|
+
export declare interface CustomOption<T, S = string> {
|
|
248
|
+
value: S;
|
|
249
|
+
label: string;
|
|
250
|
+
meta?: T;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
declare type CustomSelectProps<T, S> = {
|
|
254
|
+
onChange?: (option: CustomOption<T, S>) => void;
|
|
255
|
+
options?: CustomOption<T, S>[];
|
|
256
|
+
placeholder: string;
|
|
257
|
+
dropdownRender?: (menu: ReactNode) => ReactNode;
|
|
258
|
+
optionRender?: (option: CustomOption<T, S>) => ReactNode;
|
|
259
|
+
selectedOptionRender?: (option: CustomOption<T, S>) => ReactNode;
|
|
260
|
+
tagRender?: (option: CustomOption<T, S>) => ReactNode;
|
|
261
|
+
emptyComponent?: ReactNode;
|
|
262
|
+
dropdownIcon?: ReactNode;
|
|
263
|
+
dropDownClassName?: string;
|
|
264
|
+
optionClassName?: string;
|
|
265
|
+
inputClassName?: string;
|
|
266
|
+
tagClassName?: string;
|
|
267
|
+
searchClassName?: string;
|
|
268
|
+
searchPlaceholder?: string;
|
|
269
|
+
deleteIconClassName?: string;
|
|
270
|
+
onDelete?: (option: CustomOption<T, S>) => void;
|
|
271
|
+
onClear?: () => void;
|
|
272
|
+
icon?: ReactNode;
|
|
273
|
+
label?: ReactNode;
|
|
274
|
+
onSearch?: (value: string) => void;
|
|
275
|
+
isLoading?: boolean;
|
|
276
|
+
disabled?: boolean;
|
|
277
|
+
onClose?: () => void;
|
|
278
|
+
portalTarget?: Element;
|
|
279
|
+
error?: string | null;
|
|
280
|
+
fixedHeight?: boolean;
|
|
281
|
+
template?: "list" | "table";
|
|
282
|
+
columns?: SelectColumn<T, S>[];
|
|
283
|
+
total?: number;
|
|
284
|
+
} & ModeProps<T, S>;
|
|
285
|
+
|
|
286
|
+
export declare const DialogSelect: <T, S extends string | number>({ value, placeholder, loadOptions, onChange, onClear, columns, label, title, searchPlaceholder, selectButtonText, closeButtonText, manualButtonText, onManualAdd, pageSize, debounceMs, disabled, error, className, inputClassName, selectedOptionRender, }: DialogSelectProps<T, S>) => JSX.Element;
|
|
287
|
+
|
|
288
|
+
export declare type DialogSelectColumn<T, S extends string | number> = {
|
|
289
|
+
key: string;
|
|
290
|
+
title: ReactNode;
|
|
291
|
+
className?: string;
|
|
292
|
+
render: (option: CustomOption<T, S>) => ReactNode;
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
export declare interface DialogSelectProps<T, S extends string | number> {
|
|
296
|
+
value?: CustomOption<T, S> | null;
|
|
297
|
+
placeholder: string;
|
|
298
|
+
loadOptions: (params: LoadOptionsParams) => Promise<LoadOptionsResult<T, S>>;
|
|
299
|
+
onChange?: (option: CustomOption<T, S>) => void;
|
|
300
|
+
onClear?: () => void;
|
|
301
|
+
columns?: DialogSelectColumn<T, S>[];
|
|
302
|
+
label?: ReactNode;
|
|
303
|
+
title?: ReactNode;
|
|
304
|
+
searchPlaceholder?: string;
|
|
305
|
+
selectButtonText?: string;
|
|
306
|
+
closeButtonText?: string;
|
|
307
|
+
manualButtonText?: string;
|
|
308
|
+
onManualAdd?: () => void;
|
|
309
|
+
pageSize?: number;
|
|
310
|
+
debounceMs?: number;
|
|
311
|
+
disabled?: boolean;
|
|
312
|
+
error?: string | null;
|
|
313
|
+
className?: string;
|
|
314
|
+
inputClassName?: string;
|
|
315
|
+
selectedOptionRender?: (option: CustomOption<T, S>) => ReactNode;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export { DoneIcon }
|
|
319
|
+
|
|
320
|
+
export { DownloadIcon }
|
|
321
|
+
|
|
322
|
+
declare type DropdownPosition = "top" | "bottom";
|
|
323
|
+
|
|
324
|
+
export { EditIcon }
|
|
325
|
+
|
|
326
|
+
export declare const EmptyComponent: default_2.FC<EmptyComponentProps>;
|
|
327
|
+
|
|
328
|
+
declare interface EmptyComponentProps {
|
|
329
|
+
svg?: default_2.ReactNode;
|
|
330
|
+
title?: string;
|
|
331
|
+
/** Secondary line under the title (alias of {@link subtitle}). */
|
|
332
|
+
description?: string;
|
|
333
|
+
subtitle?: string;
|
|
334
|
+
content?: ReactNode;
|
|
335
|
+
className?: string;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
export { EmptyIcon }
|
|
339
|
+
|
|
340
|
+
export { EnvelopIcon }
|
|
341
|
+
|
|
342
|
+
export { FeedbackIcon }
|
|
343
|
+
|
|
344
|
+
export { FileReloadIcon }
|
|
345
|
+
|
|
346
|
+
export { FileSync }
|
|
347
|
+
|
|
348
|
+
export { FilterIcon }
|
|
349
|
+
|
|
350
|
+
export { FolderEditIcon }
|
|
351
|
+
|
|
352
|
+
export { GraduateIcon }
|
|
353
|
+
|
|
354
|
+
export { GridIcon }
|
|
355
|
+
|
|
356
|
+
export { HeartIcon }
|
|
357
|
+
|
|
358
|
+
export { HelpIcon }
|
|
359
|
+
|
|
360
|
+
export { HistoryBlue }
|
|
361
|
+
|
|
362
|
+
export { HomeIcon }
|
|
363
|
+
|
|
364
|
+
export { InfoIcon }
|
|
365
|
+
|
|
366
|
+
export declare const InputCaption: React_2.FC<PropsWithChildren<InputCaptionProps>>;
|
|
367
|
+
|
|
368
|
+
declare interface InputCaptionProps {
|
|
369
|
+
isFullWidth?: boolean;
|
|
370
|
+
/** Visual tone. Defaults to `error` for backwards compatibility with validation messages. */
|
|
371
|
+
variant?: InputCaptionVariant;
|
|
372
|
+
/** @deprecated Use {@link variant} */
|
|
373
|
+
type?: InputCaptionVariant;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
export declare type InputCaptionVariant = "neutral" | "error" | "success";
|
|
377
|
+
|
|
378
|
+
export { IslandIcon }
|
|
379
|
+
|
|
380
|
+
export declare const Label: ({ htmlFor, children, className }: LabelProps) => JSX.Element;
|
|
381
|
+
|
|
382
|
+
declare interface LabelProps {
|
|
383
|
+
htmlFor?: string;
|
|
384
|
+
children: ReactNode;
|
|
385
|
+
className?: string;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
export { ListIcon }
|
|
389
|
+
|
|
390
|
+
declare type LoadOptionsParams = {
|
|
391
|
+
search: string;
|
|
392
|
+
page: number;
|
|
393
|
+
pageSize: number;
|
|
394
|
+
};
|
|
395
|
+
|
|
396
|
+
declare type LoadOptionsParams_2 = {
|
|
397
|
+
search: string;
|
|
398
|
+
page: number;
|
|
399
|
+
pageSize: number;
|
|
400
|
+
};
|
|
401
|
+
|
|
402
|
+
declare type LoadOptionsResult<T, S extends string | number> = {
|
|
403
|
+
options: CustomOption<T, S>[];
|
|
404
|
+
total?: number;
|
|
405
|
+
hasNextPage?: boolean;
|
|
406
|
+
};
|
|
407
|
+
|
|
408
|
+
declare type LoadOptionsResult_2 = {
|
|
409
|
+
options: CustomOption<unknown, string>[];
|
|
410
|
+
total?: number;
|
|
411
|
+
};
|
|
412
|
+
|
|
413
|
+
export { MarketIcon }
|
|
414
|
+
|
|
415
|
+
export { MegaphoneIcon }
|
|
416
|
+
|
|
417
|
+
export { MessageIcon }
|
|
418
|
+
|
|
419
|
+
declare type ModeProps<T, S> = {
|
|
420
|
+
mode: "single";
|
|
421
|
+
value?: CustomOption<T, S> | null;
|
|
422
|
+
} | {
|
|
423
|
+
mode: "multiple";
|
|
424
|
+
value: CustomOption<T, S>[];
|
|
425
|
+
};
|
|
426
|
+
|
|
427
|
+
export { NotebookIcon }
|
|
428
|
+
|
|
429
|
+
export { PhoneIcon }
|
|
430
|
+
|
|
431
|
+
export { PlaneIcon }
|
|
432
|
+
|
|
433
|
+
export declare const Popover: (props: PopoverProps) => JSX.Element;
|
|
434
|
+
|
|
435
|
+
declare type PopoverPlacement = "top" | "bottom" | "left" | "right" | `${"top" | "bottom" | "left" | "right"}-${"start" | "end"}`;
|
|
436
|
+
|
|
437
|
+
declare type PopoverProps = PopoverSharedProps & ({
|
|
438
|
+
trigger: ReactNode;
|
|
439
|
+
target?: never;
|
|
440
|
+
} | {
|
|
441
|
+
/** Legacy: ref to an existing element that toggles the popover. */ target: RefObject<HTMLElement | null>;
|
|
442
|
+
trigger?: never;
|
|
443
|
+
});
|
|
444
|
+
|
|
445
|
+
declare interface PopoverSharedProps {
|
|
446
|
+
children?: ReactNode;
|
|
447
|
+
placement?: PopoverPlacement;
|
|
448
|
+
className?: string;
|
|
449
|
+
isOpen?: boolean;
|
|
450
|
+
toggle?: () => void;
|
|
451
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
export { ProfileIcon }
|
|
455
|
+
|
|
456
|
+
export { ProfileSearchIcon }
|
|
457
|
+
|
|
458
|
+
declare interface Props {
|
|
459
|
+
marginTop?: React_2.CSSProperties["marginTop"];
|
|
460
|
+
marginBottom?: React_2.CSSProperties["marginBottom"];
|
|
461
|
+
marginLeft?: React_2.CSSProperties["marginLeft"];
|
|
462
|
+
/** `medium` → small wheel, `large` → big wheel; legacy names `big` \| `small` \| `extraSmall` unchanged. */
|
|
463
|
+
size?: SpinnerSize;
|
|
464
|
+
className?: string;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
declare interface Props_2 extends CollapseProps {
|
|
468
|
+
infoTooltipContent?: ReactNode;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
declare interface Props_3 {
|
|
472
|
+
className?: string;
|
|
473
|
+
tabsClassName?: string;
|
|
474
|
+
items: TabItemRounded[];
|
|
475
|
+
value?: string | number;
|
|
476
|
+
onValueChange?: (value: string | number) => void;
|
|
477
|
+
/** Legacy */
|
|
478
|
+
activeTab?: number;
|
|
479
|
+
onClick?: (activeTabIndex: number) => void;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
declare interface Props_4 {
|
|
483
|
+
className?: string;
|
|
484
|
+
onClick?: () => void;
|
|
485
|
+
isSubjectEmployee?: boolean;
|
|
486
|
+
isSmall?: boolean;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
export declare const RadioGroupButton: <T extends string | number>({ options, value, defaultValue, data, activeButton, defaultActiveButton, onChange, }: RadioGroupButtonProps<T>) => JSX.Element;
|
|
490
|
+
|
|
491
|
+
export declare interface RadioGroupButtonChoice<T extends string | number> {
|
|
492
|
+
value: T;
|
|
493
|
+
label: string;
|
|
494
|
+
additionalComponent?: React.ReactNode;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
export declare interface RadioGroupButtonOption<T> {
|
|
498
|
+
id: T;
|
|
499
|
+
label: string;
|
|
500
|
+
additionalComponent?: React.ReactNode;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
declare interface RadioGroupButtonProps<T extends string | number> {
|
|
504
|
+
/** Preferred API — matches typical form control naming. */
|
|
505
|
+
options?: RadioGroupButtonChoice<T>[];
|
|
506
|
+
value?: T;
|
|
507
|
+
defaultValue?: T;
|
|
508
|
+
/** @deprecated Use {@link options} with `{ value, label }`. */
|
|
509
|
+
data?: RadioGroupButtonOption<T>[];
|
|
510
|
+
/** @deprecated Use {@link value}. */
|
|
511
|
+
activeButton?: T;
|
|
512
|
+
/** @deprecated Use {@link defaultValue}. */
|
|
513
|
+
defaultActiveButton?: T;
|
|
514
|
+
onChange?: (value: T) => void;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
export { ReloadIcon }
|
|
518
|
+
|
|
519
|
+
export { SchoolIcon }
|
|
520
|
+
|
|
521
|
+
export { SearchIcon }
|
|
522
|
+
|
|
523
|
+
export declare const Select: <T, S extends string | number>({ options, value, mode, placeholder, onChange, dropdownRender, optionRender, selectedOptionRender, dropdownIcon, tagRender, dropDownClassName, optionClassName, inputClassName, deleteIconClassName, onDelete, onClear, label, onSearch, searchClassName, searchPlaceholder, isLoading, disabled, onClose, portalTarget, error, fixedHeight, template, columns, total, }: CustomSelectProps<T, S>) => JSX.Element;
|
|
524
|
+
|
|
525
|
+
export declare type SelectColumn<T, S> = {
|
|
526
|
+
key: string;
|
|
527
|
+
title: ReactNode;
|
|
528
|
+
className?: string;
|
|
529
|
+
render: (option: CustomOption<T, S>) => ReactNode;
|
|
530
|
+
};
|
|
531
|
+
|
|
532
|
+
export { SettingsIcon }
|
|
533
|
+
|
|
534
|
+
export declare const Spinner: React_2.FC<Props>;
|
|
535
|
+
|
|
536
|
+
declare type SpinnerSize = "big" | "small" | "extraSmall" | "medium" | "large";
|
|
537
|
+
|
|
538
|
+
export declare const Stepper: default_2.FC<StepperProps>;
|
|
539
|
+
|
|
540
|
+
export declare type StepperItem = {
|
|
541
|
+
label?: ReactNode;
|
|
542
|
+
content?: ReactNode;
|
|
543
|
+
};
|
|
544
|
+
|
|
545
|
+
export declare interface StepperProps {
|
|
546
|
+
items: StepperItem[];
|
|
547
|
+
current: number;
|
|
548
|
+
onChange?: (index: number) => void;
|
|
549
|
+
showCheckOnCompleted?: boolean;
|
|
550
|
+
className?: string;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
export declare type TabItem = TabItemLegacy_2 | {
|
|
554
|
+
value: string | number;
|
|
555
|
+
label: string;
|
|
556
|
+
className?: string;
|
|
557
|
+
header?: string;
|
|
558
|
+
};
|
|
559
|
+
|
|
560
|
+
declare type TabItemLegacy = {
|
|
561
|
+
title: string;
|
|
562
|
+
className?: string;
|
|
563
|
+
needNotification?: boolean;
|
|
564
|
+
header?: string;
|
|
565
|
+
};
|
|
566
|
+
|
|
567
|
+
declare type TabItemLegacy_2 = {
|
|
568
|
+
title: string;
|
|
569
|
+
className?: string;
|
|
570
|
+
header?: string;
|
|
571
|
+
};
|
|
572
|
+
|
|
573
|
+
export declare type TabItemRounded = TabItemLegacy | {
|
|
574
|
+
value: string | number;
|
|
575
|
+
label: string;
|
|
576
|
+
className?: string;
|
|
577
|
+
needNotification?: boolean;
|
|
578
|
+
header?: string;
|
|
579
|
+
};
|
|
580
|
+
|
|
581
|
+
export declare const Tabs: React_2.MemoExoticComponent<({ items, value, onValueChange, activeTab, className, tabsClassName, changesIndex, badgeValue, sliderClassName, onClick, }: TabsProps) => JSX.Element>;
|
|
582
|
+
|
|
583
|
+
declare interface TabsProps {
|
|
584
|
+
items: TabItem[];
|
|
585
|
+
/** Preferred: controlled tab id (matches `items[].value`). */
|
|
586
|
+
value?: string | number;
|
|
587
|
+
onValueChange?: (value: string | number) => void;
|
|
588
|
+
/** Legacy: controlled tab index */
|
|
589
|
+
activeTab?: number;
|
|
590
|
+
/** Legacy */
|
|
591
|
+
onClick?: (activeTabIndex: number) => void;
|
|
592
|
+
changesIndex?: number;
|
|
593
|
+
/** Arbitrary numeric label for the tab at `changesIndex` (semantics defined by the consumer). */
|
|
594
|
+
badgeValue?: number;
|
|
595
|
+
className?: string;
|
|
596
|
+
tabsClassName?: string;
|
|
597
|
+
sliderClassName?: string;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
export declare const TabsRounded: React_2.FC<Props_3>;
|
|
601
|
+
|
|
602
|
+
export declare const Tag: FC<PropsWithChildren<Props_4>>;
|
|
603
|
+
|
|
604
|
+
export { TaskListIcon }
|
|
605
|
+
|
|
606
|
+
export { TimesheetIcon }
|
|
607
|
+
|
|
608
|
+
export declare const TooltipDark: MemoExoticComponent<({ title, content, open: openProp, defaultOpen, trigger, mouseEnterDelay, mouseLeaveDelay, onOpenChange, placement, arrow, children, overlayClassName, getPopupContainer, }: TooltipProps) => JSX.Element>;
|
|
609
|
+
|
|
610
|
+
export declare const TooltipLight: FC<TooltipLightProps>;
|
|
611
|
+
|
|
612
|
+
declare interface TooltipLightProps {
|
|
613
|
+
children?: ReactNode;
|
|
614
|
+
target: TooltipTarget;
|
|
615
|
+
placement?: TooltipPlacement_2;
|
|
616
|
+
popperClassName?: string;
|
|
617
|
+
isOpen?: boolean;
|
|
618
|
+
toggle?: () => void;
|
|
619
|
+
delay?: number | {
|
|
620
|
+
show?: number;
|
|
621
|
+
hide?: number;
|
|
622
|
+
};
|
|
623
|
+
autohide?: boolean;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
export declare type TooltipPlacement = "top" | "topLeft" | "topRight" | "bottom" | "bottomLeft" | "bottomRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom";
|
|
627
|
+
|
|
628
|
+
declare type TooltipPlacement_2 = "top" | "bottom" | "left" | "right" | `${"top" | "bottom" | "left" | "right"}-${"start" | "end"}`;
|
|
629
|
+
|
|
630
|
+
export declare interface TooltipProps {
|
|
631
|
+
title?: ReactNode;
|
|
632
|
+
/** Alias for {@link title}. If both are set, `title` wins. */
|
|
633
|
+
content?: ReactNode;
|
|
634
|
+
open?: boolean;
|
|
635
|
+
defaultOpen?: boolean;
|
|
636
|
+
trigger?: TooltipTrigger | TooltipTrigger[];
|
|
637
|
+
mouseEnterDelay?: number;
|
|
638
|
+
mouseLeaveDelay?: number;
|
|
639
|
+
onOpenChange?: (open: boolean) => void;
|
|
640
|
+
placement?: TooltipPlacement;
|
|
641
|
+
arrow?: boolean;
|
|
642
|
+
children: ReactNode;
|
|
643
|
+
overlayClassName?: string;
|
|
644
|
+
getPopupContainer?: () => HTMLElement;
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
declare type TooltipTarget = string | HTMLElement | RefObject<HTMLElement | null>;
|
|
648
|
+
|
|
649
|
+
export declare type TooltipTrigger = "hover" | "click";
|
|
650
|
+
|
|
651
|
+
export declare const TreeDialogSelect: <T, S extends string | number>({ value, placeholder, loadChildren: loadChildrenProp, loadNodes, searchNodes, onChange, onClear, label, title, searchPlaceholder, selectButtonText, closeButtonText, confirmButtonText, debounceMs, disabled, error, className, inputClassName, selectedOptionRender, nodeRender, }: TreeDialogSelectProps<T, S>) => JSX.Element;
|
|
652
|
+
|
|
653
|
+
/** Pass either {@link loadNodes} or {@link loadChildren} (deprecated alias). */
|
|
654
|
+
export declare type TreeDialogSelectProps<T, S extends string | number> = TreeDialogSelectShared<T, S> & ({
|
|
655
|
+
/** Loads nodes for a tree level (`parentId` null = roots). */ loadNodes: TreeLoader<T, S>;
|
|
656
|
+
loadChildren?: TreeLoader<T, S>;
|
|
657
|
+
} | {
|
|
658
|
+
/** @deprecated Use {@link loadNodes} */ loadChildren: TreeLoader<T, S>;
|
|
659
|
+
loadNodes?: TreeLoader<T, S>;
|
|
660
|
+
});
|
|
661
|
+
|
|
662
|
+
declare interface TreeDialogSelectShared<T, S extends string | number> {
|
|
663
|
+
value?: TreeNode<T, S> | null;
|
|
664
|
+
placeholder: string;
|
|
665
|
+
searchNodes?: (search: string) => Promise<TreeSearchResult<T, S>>;
|
|
666
|
+
onChange?: (node: TreeNode<T, S>) => void;
|
|
667
|
+
onClear?: () => void;
|
|
668
|
+
label?: ReactNode;
|
|
669
|
+
title?: ReactNode;
|
|
670
|
+
searchPlaceholder?: string;
|
|
671
|
+
selectButtonText?: string;
|
|
672
|
+
closeButtonText?: string;
|
|
673
|
+
confirmButtonText?: string;
|
|
674
|
+
debounceMs?: number;
|
|
675
|
+
disabled?: boolean;
|
|
676
|
+
error?: string | null;
|
|
677
|
+
className?: string;
|
|
678
|
+
inputClassName?: string;
|
|
679
|
+
selectedOptionRender?: (node: TreeNode<T, S>) => ReactNode;
|
|
680
|
+
nodeRender?: (node: TreeNode<T, S>) => ReactNode;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
declare type TreeLoader<T, S extends string | number> = (params: TreeLoadParams<S>) => Promise<TreeLoadResult<T, S>>;
|
|
684
|
+
|
|
685
|
+
export declare type TreeLoadParams<S extends string | number> = {
|
|
686
|
+
parentId: S | null;
|
|
687
|
+
search: string;
|
|
688
|
+
};
|
|
689
|
+
|
|
690
|
+
export declare type TreeLoadResult<T, S extends string | number> = {
|
|
691
|
+
nodes: TreeNode<T, S>[];
|
|
692
|
+
};
|
|
693
|
+
|
|
694
|
+
export declare type TreeNode<T, S extends string | number> = {
|
|
695
|
+
value: S;
|
|
696
|
+
label: string;
|
|
697
|
+
hasChildren?: boolean;
|
|
698
|
+
meta?: T;
|
|
699
|
+
};
|
|
700
|
+
|
|
701
|
+
export declare type TreeSearchResult<T, S extends string | number> = {
|
|
702
|
+
matches: Array<{
|
|
703
|
+
node: TreeNode<T, S>;
|
|
704
|
+
path: TreeNode<T, S>[];
|
|
705
|
+
}>;
|
|
706
|
+
};
|
|
707
|
+
|
|
708
|
+
export { TrendUpIcon }
|
|
709
|
+
|
|
710
|
+
export declare const useDropdownPosition: ({ triggerRef, dropdownHeight, offset, enabled, onAnchorFrame, }: UseDropdownPositionProps) => DropdownPosition;
|
|
711
|
+
|
|
712
|
+
declare interface UseDropdownPositionProps {
|
|
713
|
+
triggerRef: React.RefObject<HTMLElement | null>;
|
|
714
|
+
dropdownHeight: number;
|
|
715
|
+
offset?: number;
|
|
716
|
+
/** When false, skips scroll/layout listeners (e.g. closed dropdown). Defaults to true. */
|
|
717
|
+
enabled?: boolean;
|
|
718
|
+
onAnchorFrame?: (placement: DropdownPosition) => void;
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
export declare const useMeasureElement: (element?: HTMLElement | null) => {
|
|
722
|
+
height: number;
|
|
723
|
+
width: number;
|
|
724
|
+
};
|
|
725
|
+
|
|
726
|
+
export { UserSwitchIcon }
|
|
727
|
+
|
|
728
|
+
export { WalletIcon }
|
|
729
|
+
|
|
730
|
+
export { WarnIcon }
|
|
731
|
+
|
|
732
|
+
export { }
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@andreyfedkovich/cozy-ui",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.1",
|
|
5
5
|
"description": "Cozy UI — a premium, opinionated React component library for crafted product UIs. Typed, themeable, SSR-safe, tree-shakeable.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"react",
|
|
@@ -44,10 +44,12 @@
|
|
|
44
44
|
},
|
|
45
45
|
"files": [
|
|
46
46
|
"dist-lib/index.d.ts",
|
|
47
|
+
"dist-lib/svg-react-shim.d.ts",
|
|
47
48
|
"dist-lib/styles.css",
|
|
48
49
|
"dist-lib/ui-library.es.js",
|
|
49
50
|
"dist-lib/ui-library.cjs.js",
|
|
50
51
|
"dist-lib/*.map",
|
|
52
|
+
"CHANGELOG.md",
|
|
51
53
|
"README.md"
|
|
52
54
|
],
|
|
53
55
|
"peerDependencies": {
|