@app-studio/web 0.9.26 → 0.9.28
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/Calendar/Calendar/Calendar.props.d.ts +70 -0
- package/dist/components/Calendar/Calendar/Calendar.utils.d.ts +10 -0
- package/dist/components/Calendar/Calendar/Calendar.view.d.ts +20 -0
- package/dist/components/Calendar/Calendar.d.ts +3 -0
- package/dist/components/ChatInput/ChatInput/ChatInput.props.d.ts +8 -0
- package/dist/components/ChatInput/ChatInput/ChatInput.state.d.ts +2 -0
- package/dist/components/Formik/Formik.Uploader.d.ts +38 -0
- package/dist/components/Formik/index.d.ts +1 -0
- package/dist/components/KanbanBoard/KanbanBoard/KanbanBoard.props.d.ts +46 -0
- package/dist/components/KanbanBoard/KanbanBoard/KanbanBoard.state.d.ts +12 -0
- package/dist/components/KanbanBoard/KanbanBoard/KanbanBoard.view.d.ts +3 -0
- package/dist/components/KanbanBoard/KanbanBoard.d.ts +3 -0
- package/dist/components/ShareButton/ShareButton/ShareButton.props.d.ts +38 -0
- package/dist/components/ShareButton/ShareButton/ShareButton.state.d.ts +6 -0
- package/dist/components/ShareButton/ShareButton/ShareButton.view.d.ts +4 -0
- package/dist/components/ShareButton/ShareButton.d.ts +3 -0
- package/dist/components/Text/Text/Text.props.d.ts +1 -0
- package/dist/components/Text/Text/Text.utils.d.ts +2 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/pages/calendar.page.d.ts +3 -0
- package/dist/pages/kanbanBoard.page.d.ts +3 -0
- package/dist/web.cjs.development.js +6419 -5341
- package/dist/web.cjs.development.js.map +1 -1
- package/dist/web.cjs.production.min.js +1 -1
- package/dist/web.cjs.production.min.js.map +1 -1
- package/dist/web.esm.js +6419 -5345
- package/dist/web.esm.js.map +1 -1
- package/dist/web.umd.development.js +6673 -5601
- package/dist/web.umd.development.js.map +1 -1
- package/dist/web.umd.production.min.js +1 -1
- package/dist/web.umd.production.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ViewProps } from 'app-studio';
|
|
3
|
+
import { ButtonProps } from '../../Button/Button/Button.props';
|
|
4
|
+
import { TextProps } from '../../Text/Text/Text.props';
|
|
5
|
+
export declare type CalendarView = 'day' | 'week' | 'month';
|
|
6
|
+
export interface CalendarEvent {
|
|
7
|
+
/** Unique identifier for the event. */
|
|
8
|
+
id?: string | number;
|
|
9
|
+
/** Event title shown in the calendar cell. */
|
|
10
|
+
title: string;
|
|
11
|
+
/** Start date/time of the event. */
|
|
12
|
+
start: Date | string;
|
|
13
|
+
/** Optional end date/time of the event. */
|
|
14
|
+
end?: Date | string;
|
|
15
|
+
/** Optional description or supporting information. */
|
|
16
|
+
description?: string;
|
|
17
|
+
/** Additional metadata the consumer wants to keep with the event. */
|
|
18
|
+
metadata?: Record<string, unknown>;
|
|
19
|
+
}
|
|
20
|
+
export interface CalendarRenderEventContext {
|
|
21
|
+
/** Date of the cell currently being rendered. */
|
|
22
|
+
day: Date;
|
|
23
|
+
/** Active calendar view. */
|
|
24
|
+
view: CalendarView;
|
|
25
|
+
/** Whether the given day is today. */
|
|
26
|
+
isToday: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface CalendarViews {
|
|
29
|
+
container?: ViewProps;
|
|
30
|
+
header?: ViewProps;
|
|
31
|
+
headerTitle?: TextProps;
|
|
32
|
+
navigation?: ViewProps;
|
|
33
|
+
viewSwitcher?: ViewProps;
|
|
34
|
+
grid?: ViewProps;
|
|
35
|
+
weekdayRow?: ViewProps;
|
|
36
|
+
weekdayHeader?: ViewProps;
|
|
37
|
+
weekdayLabel?: TextProps;
|
|
38
|
+
weekRow?: ViewProps;
|
|
39
|
+
dayColumn?: ViewProps;
|
|
40
|
+
dayHeader?: ViewProps;
|
|
41
|
+
dayNumber?: TextProps;
|
|
42
|
+
dayMeta?: TextProps;
|
|
43
|
+
events?: ViewProps;
|
|
44
|
+
event?: ViewProps;
|
|
45
|
+
eventTitle?: TextProps;
|
|
46
|
+
eventTime?: TextProps;
|
|
47
|
+
emptyState?: TextProps;
|
|
48
|
+
navigationButton?: Partial<ButtonProps>;
|
|
49
|
+
viewButton?: Partial<ButtonProps>;
|
|
50
|
+
}
|
|
51
|
+
export interface CalendarProps {
|
|
52
|
+
/** Calendar events to render. */
|
|
53
|
+
events?: CalendarEvent[];
|
|
54
|
+
/** Starting date displayed in the calendar. */
|
|
55
|
+
initialDate?: Date | string;
|
|
56
|
+
/** Initial visible view. */
|
|
57
|
+
initialView?: CalendarView;
|
|
58
|
+
/** First day of the week, defaults to Sunday. */
|
|
59
|
+
weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
60
|
+
/** Height of the calendar container. */
|
|
61
|
+
height?: string | number;
|
|
62
|
+
/** Optional custom render method for events. */
|
|
63
|
+
renderEvent?: (event: CalendarEvent, context: CalendarRenderEventContext) => React.ReactNode;
|
|
64
|
+
/** Called when the visible anchor date changes. */
|
|
65
|
+
onDateChange?: (date: Date) => void;
|
|
66
|
+
/** Called when the active view changes. */
|
|
67
|
+
onViewChange?: (view: CalendarView) => void;
|
|
68
|
+
/** Customise styling of calendar areas. */
|
|
69
|
+
views?: CalendarViews;
|
|
70
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CalendarEvent } from './Calendar.props';
|
|
2
|
+
export interface CalendarEventInternal extends CalendarEvent {
|
|
3
|
+
startDate: Date;
|
|
4
|
+
endDate: Date;
|
|
5
|
+
}
|
|
6
|
+
export declare const toDate: (value: Date | string) => Date;
|
|
7
|
+
export declare const normalizeEvent: (event: CalendarEvent) => CalendarEventInternal;
|
|
8
|
+
export declare const formatDayKey: (date: Date) => string;
|
|
9
|
+
export declare const getEventsForDay: (events: CalendarEventInternal[], day: Date) => CalendarEventInternal[];
|
|
10
|
+
export declare const chunk: <T>(items: T[], size: number) => T[][];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CalendarEvent, CalendarRenderEventContext, CalendarView, CalendarViews } from './Calendar.props';
|
|
3
|
+
import { CalendarEventInternal } from './Calendar.utils';
|
|
4
|
+
interface CalendarViewProps {
|
|
5
|
+
currentDate: Date;
|
|
6
|
+
view: CalendarView;
|
|
7
|
+
label: string;
|
|
8
|
+
weeks: Date[][];
|
|
9
|
+
weekdayLabels: Date[];
|
|
10
|
+
eventsByDay: Map<string, CalendarEventInternal[]>;
|
|
11
|
+
onPrevious: () => void;
|
|
12
|
+
onNext: () => void;
|
|
13
|
+
onToday: () => void;
|
|
14
|
+
onViewChange: (view: CalendarView) => void;
|
|
15
|
+
renderEvent?: (event: CalendarEvent, context: CalendarRenderEventContext) => React.ReactNode;
|
|
16
|
+
views?: CalendarViews;
|
|
17
|
+
height?: string | number;
|
|
18
|
+
}
|
|
19
|
+
declare const CalendarViewComponent: React.FC<CalendarViewProps>;
|
|
20
|
+
export default CalendarViewComponent;
|
|
@@ -176,6 +176,10 @@ export interface ChatInputViewProps extends ChatInputProps {
|
|
|
176
176
|
* Whether files are being uploaded
|
|
177
177
|
*/
|
|
178
178
|
isUploading: boolean;
|
|
179
|
+
/**
|
|
180
|
+
* Current upload progress (0-100)
|
|
181
|
+
*/
|
|
182
|
+
uploadProgress?: number;
|
|
179
183
|
leftButtons?: React.ReactNode;
|
|
180
184
|
rightButtons?: React.ReactNode;
|
|
181
185
|
/**
|
|
@@ -202,6 +206,10 @@ export interface ChatInputViewProps extends ChatInputProps {
|
|
|
202
206
|
* Callback function to set whether files are being uploaded
|
|
203
207
|
*/
|
|
204
208
|
setIsUploading: React.Dispatch<React.SetStateAction<boolean>>;
|
|
209
|
+
/**
|
|
210
|
+
* Start uploading newly added files
|
|
211
|
+
*/
|
|
212
|
+
startUpload: (files: File[]) => void;
|
|
205
213
|
/**
|
|
206
214
|
* Currently selected model
|
|
207
215
|
*/
|
|
@@ -11,6 +11,7 @@ export declare const useChatInputState: (props: ChatInputProps) => {
|
|
|
11
11
|
editableRef: import("react").MutableRefObject<HTMLDivElement | null>;
|
|
12
12
|
fileInputRef: import("react").MutableRefObject<HTMLInputElement | null>;
|
|
13
13
|
isUploading: boolean;
|
|
14
|
+
uploadProgress: number;
|
|
14
15
|
isDraggingOver: boolean;
|
|
15
16
|
uploadedFiles: File[];
|
|
16
17
|
pendingFiles: File[];
|
|
@@ -18,6 +19,7 @@ export declare const useChatInputState: (props: ChatInputProps) => {
|
|
|
18
19
|
setPendingFiles: import("react").Dispatch<import("react").SetStateAction<File[]>>;
|
|
19
20
|
setUploadedFiles: import("react").Dispatch<import("react").SetStateAction<File[]>>;
|
|
20
21
|
setIsUploading: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
22
|
+
startUpload: (files: File[]) => void;
|
|
21
23
|
selectedModel: string;
|
|
22
24
|
handleModelChange: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
23
25
|
modelOptions: ModelOption[];
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { UploadProps } from '../Uploader/Uploader/Uploader.props';
|
|
3
|
+
export declare type UploadFileHandler = (file: File, onProgress: (progress: number) => void) => Promise<any>;
|
|
4
|
+
export interface FormikUploaderProps extends Omit<UploadProps, 'onFileSelect' | 'onMultipleFileSelect' | 'isLoading' | 'progress'> {
|
|
5
|
+
/**
|
|
6
|
+
* Name of the field that will receive the uploaded file responses
|
|
7
|
+
*/
|
|
8
|
+
name: string;
|
|
9
|
+
/**
|
|
10
|
+
* Custom upload handler. Defaults to the platform UploadService
|
|
11
|
+
*/
|
|
12
|
+
uploadFile?: UploadFileHandler;
|
|
13
|
+
/**
|
|
14
|
+
* Callback fired when a single file upload succeeds
|
|
15
|
+
*/
|
|
16
|
+
onUploadSuccess?: (file: File, response: any) => void;
|
|
17
|
+
/**
|
|
18
|
+
* Callback fired when a single file upload fails
|
|
19
|
+
*/
|
|
20
|
+
onUploadError?: (file: File, error: unknown) => void;
|
|
21
|
+
/**
|
|
22
|
+
* Transform the raw upload response before storing it in the form state
|
|
23
|
+
*/
|
|
24
|
+
transformResponse?: (response: any, file: File) => any;
|
|
25
|
+
/**
|
|
26
|
+
* Optional external handler mirroring the Uploader prop
|
|
27
|
+
*/
|
|
28
|
+
onMultipleFileSelect?: (files: File[]) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Optional external handler mirroring the Uploader prop for single upload mode
|
|
31
|
+
*/
|
|
32
|
+
onFileSelect?: (file: File) => void;
|
|
33
|
+
/**
|
|
34
|
+
* Enable/disable multiple uploads. Defaults to true
|
|
35
|
+
*/
|
|
36
|
+
multiple?: boolean;
|
|
37
|
+
}
|
|
38
|
+
export declare const FormikUploader: React.FC<FormikUploaderProps>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ViewProps } from 'app-studio';
|
|
3
|
+
import { TextProps } from '../../Text/Text/Text.props';
|
|
4
|
+
export interface KanbanBoardCard {
|
|
5
|
+
id: string;
|
|
6
|
+
title: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
metadata?: Record<string, unknown>;
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
}
|
|
11
|
+
export interface KanbanBoardColumn {
|
|
12
|
+
id: string;
|
|
13
|
+
title: string;
|
|
14
|
+
cards: KanbanBoardCard[];
|
|
15
|
+
footer?: React.ReactNode;
|
|
16
|
+
metadata?: Record<string, unknown>;
|
|
17
|
+
[key: string]: unknown;
|
|
18
|
+
}
|
|
19
|
+
export interface KanbanBoardProps {
|
|
20
|
+
columns: KanbanBoardColumn[];
|
|
21
|
+
onChange?: (columns: KanbanBoardColumn[]) => void;
|
|
22
|
+
renderCard?: (card: KanbanBoardCard, column: KanbanBoardColumn) => React.ReactNode;
|
|
23
|
+
renderColumnHeader?: (column: KanbanBoardColumn) => React.ReactNode;
|
|
24
|
+
renderEmptyState?: (column: KanbanBoardColumn) => React.ReactNode;
|
|
25
|
+
views?: {
|
|
26
|
+
board?: ViewProps;
|
|
27
|
+
column?: ViewProps;
|
|
28
|
+
columnHeader?: ViewProps;
|
|
29
|
+
columnTitle?: TextProps;
|
|
30
|
+
columnBody?: ViewProps;
|
|
31
|
+
columnFooter?: ViewProps;
|
|
32
|
+
card?: ViewProps;
|
|
33
|
+
cardContent?: ViewProps;
|
|
34
|
+
emptyState?: ViewProps;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export interface KanbanBoardViewProps extends KanbanBoardProps {
|
|
38
|
+
columns: KanbanBoardColumn[];
|
|
39
|
+
draggedCardId: string | null;
|
|
40
|
+
onCardDragStart: (columnId: string, cardId: string, event: React.DragEvent<HTMLDivElement>) => void;
|
|
41
|
+
onCardDragEnd: () => void;
|
|
42
|
+
onCardDrop: (columnId: string, cardId: string | null, event: React.DragEvent<HTMLDivElement>) => void;
|
|
43
|
+
onColumnDrop: (columnId: string, event: React.DragEvent<HTMLDivElement>) => void;
|
|
44
|
+
onCardDragOver: (columnId: string, cardId: string | null, event: React.DragEvent<HTMLDivElement>) => void;
|
|
45
|
+
onColumnDragOver: (columnId: string, event: React.DragEvent<HTMLDivElement>) => void;
|
|
46
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { KanbanBoardProps } from './KanbanBoard.props';
|
|
3
|
+
export declare const useKanbanBoardState: ({ columns: initialColumns, onChange, }: KanbanBoardProps) => {
|
|
4
|
+
columns: import("./KanbanBoard.props").KanbanBoardColumn[];
|
|
5
|
+
draggedCardId: string | null;
|
|
6
|
+
onCardDragStart: (columnId: string, cardId: string, event: React.DragEvent<HTMLDivElement>) => void;
|
|
7
|
+
onCardDragEnd: () => void;
|
|
8
|
+
onColumnDragOver: (_columnId: string, event: React.DragEvent<HTMLDivElement>) => void;
|
|
9
|
+
onCardDragOver: (_columnId: string, _cardId: string | null, event: React.DragEvent<HTMLDivElement>) => void;
|
|
10
|
+
onColumnDrop: (columnId: string, event: React.DragEvent<HTMLDivElement>) => void;
|
|
11
|
+
onCardDrop: (columnId: string, cardId: string | null, event: React.DragEvent<HTMLDivElement>) => void;
|
|
12
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ButtonProps } from '../../Button/Button/Button.props';
|
|
3
|
+
export declare type NavigatorShareData = Parameters<Navigator['share']>[0];
|
|
4
|
+
/**
|
|
5
|
+
* Properties for the ShareButton component.
|
|
6
|
+
* Extends the design-system Button while wiring the Web Share API workflow.
|
|
7
|
+
*/
|
|
8
|
+
export interface ShareButtonProps extends Omit<ButtonProps, 'onClick'> {
|
|
9
|
+
/** Data passed to the `navigator.share` call. */
|
|
10
|
+
shareData: NavigatorShareData;
|
|
11
|
+
/** Optional label rendered when no custom children are provided. Defaults to "Share". */
|
|
12
|
+
label?: React.ReactNode;
|
|
13
|
+
/** Called immediately before invoking the Web Share API. */
|
|
14
|
+
onShareStart?: () => void;
|
|
15
|
+
/** Called when the share sheet completes successfully. */
|
|
16
|
+
onShareSuccess?: () => void;
|
|
17
|
+
/** Called when the user dismisses the native share sheet. */
|
|
18
|
+
onShareCancel?: () => void;
|
|
19
|
+
/** Called when the share operation throws an unexpected error. */
|
|
20
|
+
onShareError?: (error: unknown) => void;
|
|
21
|
+
/** Called when the Web Share API is not available for the provided data. */
|
|
22
|
+
onUnsupported?: () => void;
|
|
23
|
+
/**
|
|
24
|
+
* When true the button is disabled if the Web Share API is unavailable.
|
|
25
|
+
* Defaults to true to avoid misleading interactions.
|
|
26
|
+
*/
|
|
27
|
+
disableWhenUnsupported?: boolean;
|
|
28
|
+
/** Additional click handler fired alongside the share workflow. */
|
|
29
|
+
onClick?: ButtonProps['onClick'];
|
|
30
|
+
}
|
|
31
|
+
export interface ShareButtonViewProps extends Omit<ShareButtonProps, 'shareData' | 'onShareStart' | 'onShareSuccess' | 'onShareCancel' | 'onShareError' | 'onUnsupported' | 'onClick'> {
|
|
32
|
+
/** Flag indicating if the current environment can use the Web Share API. */
|
|
33
|
+
isSupported: boolean;
|
|
34
|
+
/** True while awaiting the native share sheet to resolve. */
|
|
35
|
+
isSharing: boolean;
|
|
36
|
+
/** Internal handler that triggers the sharing flow. */
|
|
37
|
+
onShare: ButtonProps['onClick'];
|
|
38
|
+
}
|
|
@@ -3,6 +3,7 @@ import type { TextProps as TextAppProps } from 'app-studio';
|
|
|
3
3
|
import { Headings, Size, TextWeights } from './Text.type';
|
|
4
4
|
export interface TextProps extends Omit<TextAppProps, 'children' | 'style' | 'pointerEvents'> {
|
|
5
5
|
children?: React.ReactNode;
|
|
6
|
+
backgroundColor?: string;
|
|
6
7
|
heading?: Headings;
|
|
7
8
|
isItalic?: boolean;
|
|
8
9
|
isStriked?: boolean;
|
|
@@ -9,6 +9,8 @@ export * from './Button/Button';
|
|
|
9
9
|
export * from './Card/Card';
|
|
10
10
|
export * from './Carousel/Carousel';
|
|
11
11
|
export * from './Chart/Chart';
|
|
12
|
+
export * from './KanbanBoard/KanbanBoard';
|
|
13
|
+
export * from './Calendar/Calendar';
|
|
12
14
|
export * from './CookieConsent/CookieConsent';
|
|
13
15
|
export * from './ContextMenu/ContextMenu';
|
|
14
16
|
export * from './File/File';
|
|
@@ -51,6 +53,7 @@ export * from './Menubar/Menubar';
|
|
|
51
53
|
export * from './Pagination/Pagination';
|
|
52
54
|
export * from './ProgressBar/ProgressBar';
|
|
53
55
|
export * from './Separator/Separator';
|
|
56
|
+
export * from './ShareButton/ShareButton';
|
|
54
57
|
export * from './StatusIndicator/StatusIndicator';
|
|
55
58
|
export * from './Sidebar/Sidebar';
|
|
56
59
|
export * from './Resizable/Resizable';
|
|
@@ -73,8 +76,10 @@ export * from './Avatar/Avatar/Avatar.props';
|
|
|
73
76
|
export * from './Badge/Badge/Badge.props';
|
|
74
77
|
export * from './Button/Button/Button.props';
|
|
75
78
|
export * from './Card/Card/Card.props';
|
|
79
|
+
export * from './KanbanBoard/KanbanBoard/KanbanBoard.props';
|
|
76
80
|
export * from './Carousel/Carousel/Carousel.props';
|
|
77
81
|
export * from './Chart/Chart/Chart.props';
|
|
82
|
+
export * from './Calendar/Calendar/Calendar.props';
|
|
78
83
|
export * from './CookieConsent/CookieConsent/CookieConsent.props';
|
|
79
84
|
export * from './ContextMenu/ContextMenu/ContextMenu.props';
|
|
80
85
|
export * from './Form/Select/Select/Select.props';
|
|
@@ -108,6 +113,7 @@ export * from './Menubar/Menubar/Menubar.props';
|
|
|
108
113
|
export * from './Pagination/Pagination/Pagination.props';
|
|
109
114
|
export * from './ProgressBar/ProgressBar/ProgressBar.props';
|
|
110
115
|
export * from './Separator/Separator/Separator.props';
|
|
116
|
+
export * from './ShareButton/ShareButton/ShareButton.props';
|
|
111
117
|
export * from './StatusIndicator/StatusIndicator/StatusIndicator.props';
|
|
112
118
|
export * from './Sidebar/Sidebar/Sidebar.props';
|
|
113
119
|
export * from './Resizable/Resizable/Resizable.props';
|