@app-studio/web 0.9.57 → 0.9.59
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/Background/Background/Background.props.d.ts +15 -8
- package/dist/components/Background/Background/Background.style.d.ts +0 -2
- package/dist/components/Background/Background/Background.view.d.ts +2 -1
- package/dist/components/Background/Background.d.ts +1 -0
- package/dist/components/ChatInput/ChatInput/ChatInput.props.d.ts +17 -0
- package/dist/components/Formik/Formik.Uploader.d.ts +1 -1
- package/dist/components/ProgressBar/ProgressBar/ProgressBar.props.d.ts +36 -2
- package/dist/components/ProgressBar/ProgressBar.d.ts +1 -0
- package/dist/components/Title/Title/Title.props.d.ts +0 -5
- package/dist/web.cjs.development.js +149 -99
- 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 +149 -99
- package/dist/web.esm.js.map +1 -1
- package/dist/web.umd.development.js +153 -102
- 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/docs/app-studio/Animation.md +241 -0
- package/docs/app-studio/Components.md +192 -0
- package/docs/app-studio/Design.md +121 -0
- package/docs/app-studio/Events.md +296 -0
- package/docs/app-studio/Hooks.md +469 -0
- package/docs/app-studio/Providers.md +186 -0
- package/docs/app-studio/README.md +781 -0
- package/docs/app-studio/Responsive.md +135 -0
- package/docs/app-studio/Theming.md +488 -0
- package/docs/components/Background.mdx +2 -2
- package/docs/components/ChatInput.mdx +133 -0
- package/package.json +3 -2
|
@@ -94,15 +94,15 @@ export interface BackgroundImageProps extends Omit<BackgroundProps, 'position'>
|
|
|
94
94
|
* @default 1
|
|
95
95
|
*/
|
|
96
96
|
imageOpacity?: number;
|
|
97
|
-
/**
|
|
98
|
-
* Overlay color to blend with image
|
|
99
|
-
*/
|
|
100
|
-
overlay?: string;
|
|
101
97
|
/**
|
|
102
98
|
* Blend mode for overlay
|
|
103
99
|
* @default 'normal'
|
|
104
100
|
*/
|
|
105
101
|
blendMode?: BlendMode;
|
|
102
|
+
/**
|
|
103
|
+
* Overlay content
|
|
104
|
+
*/
|
|
105
|
+
overlay?: ReactNode;
|
|
106
106
|
/**
|
|
107
107
|
* Custom views for styling
|
|
108
108
|
*/
|
|
@@ -110,7 +110,6 @@ export interface BackgroundImageProps extends Omit<BackgroundProps, 'position'>
|
|
|
110
110
|
container?: ViewProps;
|
|
111
111
|
content?: ViewProps;
|
|
112
112
|
image?: ViewProps;
|
|
113
|
-
overlay?: ViewProps;
|
|
114
113
|
};
|
|
115
114
|
}
|
|
116
115
|
/**
|
|
@@ -144,7 +143,7 @@ export interface BackgroundVideoProps extends Omit<BackgroundProps, 'position'>
|
|
|
144
143
|
/**
|
|
145
144
|
* Overlay color to blend with video
|
|
146
145
|
*/
|
|
147
|
-
overlay?:
|
|
146
|
+
overlay?: ReactNode;
|
|
148
147
|
/**
|
|
149
148
|
* Blend mode for overlay
|
|
150
149
|
* @default 'normal'
|
|
@@ -157,7 +156,6 @@ export interface BackgroundVideoProps extends Omit<BackgroundProps, 'position'>
|
|
|
157
156
|
container?: ViewProps;
|
|
158
157
|
content?: ViewProps;
|
|
159
158
|
video?: ViewProps;
|
|
160
|
-
overlay?: ViewProps;
|
|
161
159
|
};
|
|
162
160
|
}
|
|
163
161
|
/**
|
|
@@ -166,6 +164,16 @@ export interface BackgroundVideoProps extends Omit<BackgroundProps, 'position'>
|
|
|
166
164
|
*/
|
|
167
165
|
export interface BackgroundGradientProps extends GradientProps {
|
|
168
166
|
}
|
|
167
|
+
/**
|
|
168
|
+
* Background Overlay component props
|
|
169
|
+
*/
|
|
170
|
+
export interface BackgroundOverlayProps extends ViewProps {
|
|
171
|
+
/**
|
|
172
|
+
* Position of the content relative to the overlay
|
|
173
|
+
* @default 'center'
|
|
174
|
+
*/
|
|
175
|
+
contentPosition?: 'left' | 'right' | 'center' | 'bottom' | 'top';
|
|
176
|
+
}
|
|
169
177
|
/**
|
|
170
178
|
* Background styles for customization
|
|
171
179
|
*/
|
|
@@ -176,6 +184,5 @@ export interface BackgroundStyles {
|
|
|
176
184
|
meteors?: ViewProps;
|
|
177
185
|
image?: ViewProps;
|
|
178
186
|
video?: ViewProps;
|
|
179
|
-
overlay?: ViewProps;
|
|
180
187
|
gradient?: ViewProps;
|
|
181
188
|
}
|
|
@@ -19,7 +19,6 @@ export declare const AuroraStyles: {
|
|
|
19
19
|
export declare const BackgroundImageStyles: {
|
|
20
20
|
container: ViewProps;
|
|
21
21
|
image: ViewProps;
|
|
22
|
-
overlay: ViewProps;
|
|
23
22
|
content: ViewProps;
|
|
24
23
|
};
|
|
25
24
|
/**
|
|
@@ -28,7 +27,6 @@ export declare const BackgroundImageStyles: {
|
|
|
28
27
|
export declare const BackgroundVideoStyles: {
|
|
29
28
|
container: ViewProps;
|
|
30
29
|
video: ViewProps;
|
|
31
|
-
overlay: ViewProps;
|
|
32
30
|
content: ViewProps;
|
|
33
31
|
};
|
|
34
32
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { BackgroundProps, AuroraBackgroundProps, MeteorsProps, WallProps, ParticlesProps, GridProps, RipplesProps, BackgroundImageProps, BackgroundVideoProps, BackgroundGradientProps } from './Background.props';
|
|
2
|
+
import { BackgroundProps, AuroraBackgroundProps, MeteorsProps, WallProps, ParticlesProps, GridProps, RipplesProps, BackgroundImageProps, BackgroundVideoProps, BackgroundGradientProps, BackgroundOverlayProps } from './Background.props';
|
|
3
3
|
/**
|
|
4
4
|
* Main Background View Component with compound pattern
|
|
5
5
|
*/
|
|
@@ -13,6 +13,7 @@ interface BackgroundViewComponent extends React.FC<BackgroundProps> {
|
|
|
13
13
|
Image: React.FC<BackgroundImageProps>;
|
|
14
14
|
Video: React.FC<BackgroundVideoProps>;
|
|
15
15
|
Gradient: React.FC<BackgroundGradientProps>;
|
|
16
|
+
Overlay: React.FC<BackgroundOverlayProps>;
|
|
16
17
|
}
|
|
17
18
|
export declare const BackgroundView: BackgroundViewComponent;
|
|
18
19
|
export {};
|
|
@@ -18,4 +18,5 @@ export declare const Background: React.ForwardRefExoticComponent<Pick<Background
|
|
|
18
18
|
Image: React.FC<import("./Background/Background.props").BackgroundImageProps>;
|
|
19
19
|
Video: React.FC<import("./Background/Background.props").BackgroundVideoProps>;
|
|
20
20
|
Gradient: React.FC<import("./Background/Background.props").BackgroundGradientProps>;
|
|
21
|
+
Overlay: React.FC<import("./Background/Background.props").BackgroundOverlayProps>;
|
|
21
22
|
};
|
|
@@ -61,6 +61,23 @@ export interface ChatInputProps extends ViewProps {
|
|
|
61
61
|
* ID of the sandbox
|
|
62
62
|
*/
|
|
63
63
|
sandboxId?: string;
|
|
64
|
+
/**
|
|
65
|
+
* Callback when file upload progress changes
|
|
66
|
+
*/
|
|
67
|
+
onUploadProgress?: (progress: number) => void;
|
|
68
|
+
/**
|
|
69
|
+
* Callback when file upload succeeds
|
|
70
|
+
*/
|
|
71
|
+
onUploadSuccess?: (data: any) => void;
|
|
72
|
+
/**
|
|
73
|
+
* Callback when file upload fails
|
|
74
|
+
*/
|
|
75
|
+
onUploadError?: (error: any) => void;
|
|
76
|
+
/**
|
|
77
|
+
* Function to execute file upload. Parent should provide this.
|
|
78
|
+
* Should return an object with a loading property.
|
|
79
|
+
*/
|
|
80
|
+
onFileUpload?: (file: File) => void;
|
|
64
81
|
/**
|
|
65
82
|
* Whether to hide the attachment button
|
|
66
83
|
*/
|
|
@@ -9,7 +9,7 @@ export interface FormikUploaderProps extends Omit<UploadProps, 'onFileSelect' |
|
|
|
9
9
|
/**
|
|
10
10
|
* Custom upload handler. Defaults to the platform UploadService
|
|
11
11
|
*/
|
|
12
|
-
uploadFile
|
|
12
|
+
uploadFile: UploadFileHandler;
|
|
13
13
|
/**
|
|
14
14
|
* Callback fired when a single file upload succeeds
|
|
15
15
|
*/
|
|
@@ -1,9 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { ViewProps } from 'app-studio';
|
|
2
3
|
export interface ProgressBarStyles {
|
|
3
4
|
container?: ViewProps;
|
|
4
5
|
bar?: ViewProps;
|
|
6
|
+
track?: React.SVGAttributes<SVGCircleElement>;
|
|
7
|
+
indicator?: React.SVGAttributes<SVGCircleElement>;
|
|
8
|
+
text?: ViewProps;
|
|
5
9
|
}
|
|
6
10
|
export interface ProgressBarProps extends ViewProps {
|
|
11
|
+
/**
|
|
12
|
+
* The shape of the progress bar
|
|
13
|
+
* @default 'linear'
|
|
14
|
+
*/
|
|
15
|
+
shape?: 'linear' | 'circle';
|
|
7
16
|
/**
|
|
8
17
|
* Current progress value
|
|
9
18
|
*/
|
|
@@ -21,13 +30,38 @@ export interface ProgressBarProps extends ViewProps {
|
|
|
21
30
|
*/
|
|
22
31
|
backgroundColor?: string;
|
|
23
32
|
/**
|
|
24
|
-
* Height of the progress bar
|
|
33
|
+
* Height of the progress bar (linear) or size (circle)
|
|
25
34
|
*/
|
|
26
35
|
height?: number | string;
|
|
27
36
|
/**
|
|
28
|
-
*
|
|
37
|
+
* Diameter of the circle (alias for height/width when shape is circle)
|
|
38
|
+
*/
|
|
39
|
+
size?: number;
|
|
40
|
+
/**
|
|
41
|
+
* Border radius for rounded corners (linear only)
|
|
29
42
|
*/
|
|
30
43
|
radius?: number | string;
|
|
44
|
+
/**
|
|
45
|
+
* Width of the stroke (circle only)
|
|
46
|
+
*/
|
|
47
|
+
strokeWidth?: number;
|
|
48
|
+
/**
|
|
49
|
+
* Whether to show the percentage label in the center (circle only)
|
|
50
|
+
*/
|
|
51
|
+
showLabel?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Color of the label text (circle only)
|
|
54
|
+
*/
|
|
55
|
+
labelColor?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Whether to animate the progress change smoothly
|
|
58
|
+
* @default true
|
|
59
|
+
*/
|
|
60
|
+
animated?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Duration of the animation
|
|
63
|
+
*/
|
|
64
|
+
animationDuration?: string;
|
|
31
65
|
/**
|
|
32
66
|
* Custom styles for container or bar
|
|
33
67
|
*/
|
|
@@ -102,11 +102,6 @@ export interface TitleProps extends ViewProps {
|
|
|
102
102
|
* @default false
|
|
103
103
|
*/
|
|
104
104
|
responsive?: boolean;
|
|
105
|
-
/**
|
|
106
|
-
* Whether to center the title
|
|
107
|
-
* @default false
|
|
108
|
-
*/
|
|
109
|
-
centered?: boolean;
|
|
110
105
|
/**
|
|
111
106
|
* Custom styles for different parts of the component
|
|
112
107
|
*/
|
|
@@ -40,7 +40,6 @@ require('core-js/modules/es.regexp.constructor.js');
|
|
|
40
40
|
require('core-js/modules/es.regexp.exec.js');
|
|
41
41
|
var formik = require('formik');
|
|
42
42
|
require('core-js/modules/es.string.replace.js');
|
|
43
|
-
var api = require('src/services/api');
|
|
44
43
|
require('core-js/modules/es.promise.finally.js');
|
|
45
44
|
require('core-js/modules/es.string.match.js');
|
|
46
45
|
require('core-js/modules/es.string.search.js');
|
|
@@ -14277,7 +14276,11 @@ var useChatInputState = props => {
|
|
|
14277
14276
|
disabled = false,
|
|
14278
14277
|
isAgentRunning = false,
|
|
14279
14278
|
onStopAgent,
|
|
14280
|
-
sandboxId
|
|
14279
|
+
sandboxId,
|
|
14280
|
+
onUploadProgress,
|
|
14281
|
+
onUploadSuccess,
|
|
14282
|
+
onUploadError,
|
|
14283
|
+
onFileUpload
|
|
14281
14284
|
} = props;
|
|
14282
14285
|
// Determine if the component is controlled
|
|
14283
14286
|
var isControlled = controlledValue !== undefined && controlledOnChange !== undefined;
|
|
@@ -14393,28 +14396,6 @@ var useChatInputState = props => {
|
|
|
14393
14396
|
e.stopPropagation();
|
|
14394
14397
|
setIsDraggingOver(false);
|
|
14395
14398
|
};
|
|
14396
|
-
// Upload service hook (single file at a time)
|
|
14397
|
-
var uploadFileRequest = api.UploadService.useUploadControllerFileService({
|
|
14398
|
-
onProgress: p => setUploadProgress(p || 0),
|
|
14399
|
-
onSuccess: () => {
|
|
14400
|
-
// Advance the queue
|
|
14401
|
-
setUploadQueue(prev => prev.slice(1));
|
|
14402
|
-
setIsProcessingQueue(false);
|
|
14403
|
-
currentUploadRef.current = null;
|
|
14404
|
-
setUploadProgress(0);
|
|
14405
|
-
// If queue emptied, stop uploading state
|
|
14406
|
-
setIsUploading(prev => uploadQueue.length - 1 > 0 || false);
|
|
14407
|
-
},
|
|
14408
|
-
onError: _err => {
|
|
14409
|
-
// Remove the failed file from queue and continue
|
|
14410
|
-
setUploadQueue(prev => prev.slice(1));
|
|
14411
|
-
setIsProcessingQueue(false);
|
|
14412
|
-
currentUploadRef.current = null;
|
|
14413
|
-
setUploadProgress(0);
|
|
14414
|
-
// If queue emptied, stop uploading state
|
|
14415
|
-
setIsUploading(prev => uploadQueue.length - 1 > 0 || false);
|
|
14416
|
-
}
|
|
14417
|
-
});
|
|
14418
14399
|
// Start uploading a batch of files (enqueue and process)
|
|
14419
14400
|
var startUpload = React.useCallback(files => {
|
|
14420
14401
|
if (!files || files.length === 0) return;
|
|
@@ -14427,25 +14408,33 @@ var useChatInputState = props => {
|
|
|
14427
14408
|
}, [setPendingFiles, setUploadedFiles]);
|
|
14428
14409
|
// Process upload queue sequentially
|
|
14429
14410
|
var processUploadQueue = React.useCallback(() => {
|
|
14430
|
-
if (uploadQueue.length > 0 && !isProcessingQueue &&
|
|
14411
|
+
if (uploadQueue.length > 0 && !isProcessingQueue && onFileUpload) {
|
|
14431
14412
|
setIsProcessingQueue(true);
|
|
14432
14413
|
var nextFile = uploadQueue[0];
|
|
14433
14414
|
currentUploadRef.current = nextFile;
|
|
14434
14415
|
setUploadProgress(0);
|
|
14435
|
-
//
|
|
14436
|
-
|
|
14437
|
-
|
|
14438
|
-
})
|
|
14416
|
+
// Execute user-provided upload function
|
|
14417
|
+
try {
|
|
14418
|
+
onFileUpload(nextFile);
|
|
14419
|
+
} catch (err) {
|
|
14420
|
+
// Handle synchronous errors
|
|
14421
|
+
setUploadQueue(prev => prev.slice(1));
|
|
14422
|
+
setIsProcessingQueue(false);
|
|
14423
|
+
currentUploadRef.current = null;
|
|
14424
|
+
setUploadProgress(0);
|
|
14425
|
+
setIsUploading(prev => uploadQueue.length - 1 > 0 || false);
|
|
14426
|
+
onUploadError == null || onUploadError(err);
|
|
14427
|
+
}
|
|
14439
14428
|
} else if (uploadQueue.length === 0 && isUploading) {
|
|
14440
14429
|
// Nothing left to upload
|
|
14441
14430
|
setIsUploading(false);
|
|
14442
14431
|
setUploadProgress(0);
|
|
14443
14432
|
}
|
|
14444
|
-
}, [uploadQueue, isProcessingQueue,
|
|
14445
|
-
// Effect: process whenever queue
|
|
14433
|
+
}, [uploadQueue, isProcessingQueue, onFileUpload, isUploading, onUploadError]);
|
|
14434
|
+
// Effect: process whenever queue changes
|
|
14446
14435
|
React.useEffect(() => {
|
|
14447
14436
|
processUploadQueue();
|
|
14448
|
-
}, [uploadQueue, isProcessingQueue,
|
|
14437
|
+
}, [uploadQueue, isProcessingQueue, processUploadQueue]);
|
|
14449
14438
|
// Mock function for subscription status
|
|
14450
14439
|
var subscriptionStatus = 'active';
|
|
14451
14440
|
// Mock function to check if user can access a model
|
|
@@ -16952,11 +16941,6 @@ var OTPInputComponent$1 = props => {
|
|
|
16952
16941
|
var FormikOTPInput = OTPInputComponent$1;
|
|
16953
16942
|
|
|
16954
16943
|
var _excluded$T = ["name", "uploadFile", "onUploadSuccess", "onUploadError", "transformResponse", "onMultipleFileSelect", "onFileSelect", "multiple"];
|
|
16955
|
-
var defaultUploadFile = (file, onProgress) => {
|
|
16956
|
-
return api.UploadService.uploadControllerFile({
|
|
16957
|
-
file
|
|
16958
|
-
}, onProgress);
|
|
16959
|
-
};
|
|
16960
16944
|
var toArrayValue = value => {
|
|
16961
16945
|
if (Array.isArray(value)) {
|
|
16962
16946
|
return value;
|
|
@@ -16969,7 +16953,7 @@ var toArrayValue = value => {
|
|
|
16969
16953
|
var FormikUploader = _ref => {
|
|
16970
16954
|
var {
|
|
16971
16955
|
name,
|
|
16972
|
-
uploadFile
|
|
16956
|
+
uploadFile,
|
|
16973
16957
|
onUploadSuccess,
|
|
16974
16958
|
onUploadError,
|
|
16975
16959
|
transformResponse,
|
|
@@ -19509,7 +19493,7 @@ var SlideEffect = _ref => {
|
|
|
19509
19493
|
})));
|
|
19510
19494
|
};
|
|
19511
19495
|
|
|
19512
|
-
var _excluded$$ = ["children", "highlightText", "highlightStyle", "highlightColor", "highlightSecondaryColor", "size", "responsive", "
|
|
19496
|
+
var _excluded$$ = ["children", "highlightText", "highlightStyle", "highlightColor", "highlightSecondaryColor", "size", "responsive", "views", "highlightAnimate", "animate", "animationLoop", "highlightAnimationLoop", "highlightTypewriter", "highlightTypewriterDuration", "highlightSlide", "highlightSlideDuration", "highlightSlideStagger", "highlightSlideSequential"];
|
|
19513
19497
|
function escapeRegExp(string) {
|
|
19514
19498
|
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
19515
19499
|
}
|
|
@@ -19522,7 +19506,6 @@ var TitleView = _ref => {
|
|
|
19522
19506
|
highlightSecondaryColor,
|
|
19523
19507
|
size = 'lg',
|
|
19524
19508
|
responsive = true,
|
|
19525
|
-
centered = false,
|
|
19526
19509
|
views,
|
|
19527
19510
|
highlightAnimate,
|
|
19528
19511
|
animate,
|
|
@@ -19637,7 +19620,6 @@ var TitleView = _ref => {
|
|
|
19637
19620
|
fontWeight: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.fontWeight : 'bold',
|
|
19638
19621
|
letterSpacing: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.letterSpacing : undefined,
|
|
19639
19622
|
marginBottom: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.marginBottom : undefined,
|
|
19640
|
-
textAlign: centered ? 'center' : 'left',
|
|
19641
19623
|
animate: inView ? controlledAnimate : undefined,
|
|
19642
19624
|
media: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.media : undefined
|
|
19643
19625
|
}, views == null ? void 0 : views.container, props), parts.map((part, idx) => typeof part === 'string' ? part : (/*#__PURE__*/React__default.createElement(appStudio.Text, Object.assign({
|
|
@@ -19671,7 +19653,6 @@ var TitleView = _ref => {
|
|
|
19671
19653
|
fontWeight: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.fontWeight : 'bold',
|
|
19672
19654
|
letterSpacing: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.letterSpacing : undefined,
|
|
19673
19655
|
marginBottom: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.marginBottom : undefined,
|
|
19674
|
-
textAlign: centered ? 'center' : 'left',
|
|
19675
19656
|
animate: inView ? controlledAnimate : undefined,
|
|
19676
19657
|
media: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.media : undefined
|
|
19677
19658
|
}, views == null ? void 0 : views.container, props), /*#__PURE__*/React__default.createElement(appStudio.Text, Object.assign({
|
|
@@ -19703,7 +19684,6 @@ var TitleView = _ref => {
|
|
|
19703
19684
|
fontWeight: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.fontWeight : 'bold',
|
|
19704
19685
|
letterSpacing: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.letterSpacing : undefined,
|
|
19705
19686
|
marginBottom: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.marginBottom : undefined,
|
|
19706
|
-
textAlign: centered ? 'center' : 'left',
|
|
19707
19687
|
animate: inView ? controlledAnimate : undefined,
|
|
19708
19688
|
media: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.media : undefined
|
|
19709
19689
|
}, views == null ? void 0 : views.container, props), text);
|
|
@@ -24314,15 +24294,22 @@ var PaginationComponent = _ref => {
|
|
|
24314
24294
|
};
|
|
24315
24295
|
var Pagination = PaginationComponent;
|
|
24316
24296
|
|
|
24317
|
-
var _excluded$1a = ["value", "max", "color", "backgroundColor", "height", "radius", "views", "themeMode"];
|
|
24297
|
+
var _excluded$1a = ["shape", "value", "max", "color", "backgroundColor", "height", "size", "radius", "strokeWidth", "showLabel", "labelColor", "animated", "animationDuration", "views", "themeMode"];
|
|
24318
24298
|
var ProgressBarView = _ref => {
|
|
24319
24299
|
var {
|
|
24300
|
+
shape = 'linear',
|
|
24320
24301
|
value = 0,
|
|
24321
24302
|
max = 100,
|
|
24322
24303
|
color = 'theme.primary',
|
|
24323
24304
|
backgroundColor = 'color.gray.200',
|
|
24324
|
-
height
|
|
24305
|
+
height,
|
|
24306
|
+
size,
|
|
24325
24307
|
radius = 4,
|
|
24308
|
+
strokeWidth = 10,
|
|
24309
|
+
showLabel = false,
|
|
24310
|
+
labelColor = 'theme.text.primary',
|
|
24311
|
+
animated = true,
|
|
24312
|
+
animationDuration = '0.5s',
|
|
24326
24313
|
views,
|
|
24327
24314
|
themeMode: elementMode
|
|
24328
24315
|
} = _ref,
|
|
@@ -24332,20 +24319,78 @@ var ProgressBarView = _ref => {
|
|
|
24332
24319
|
themeMode
|
|
24333
24320
|
} = appStudio.useTheme();
|
|
24334
24321
|
var currentMode = elementMode ? elementMode : themeMode;
|
|
24335
|
-
var
|
|
24322
|
+
var validValue = Math.min(max, Math.max(0, value));
|
|
24323
|
+
var percentage = validValue / max * 100;
|
|
24336
24324
|
var trackColor = getColor(backgroundColor, {
|
|
24337
24325
|
themeMode: currentMode
|
|
24338
24326
|
});
|
|
24339
24327
|
var barColor = getColor(color, {
|
|
24340
24328
|
themeMode: currentMode
|
|
24341
24329
|
});
|
|
24330
|
+
if (shape === 'circle') {
|
|
24331
|
+
var circleSize = size || (typeof height === 'number' ? height : 100);
|
|
24332
|
+
var radiusCalc = (circleSize - strokeWidth) / 2;
|
|
24333
|
+
var circumference = 2 * Math.PI * radiusCalc;
|
|
24334
|
+
var offset = circumference - percentage / 100 * circumference;
|
|
24335
|
+
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
24336
|
+
width: circleSize,
|
|
24337
|
+
height: circleSize,
|
|
24338
|
+
position: "relative",
|
|
24339
|
+
display: "flex",
|
|
24340
|
+
alignItems: "center",
|
|
24341
|
+
justifyContent: "center"
|
|
24342
|
+
}, views == null ? void 0 : views.container, props), /*#__PURE__*/React__default.createElement("svg", {
|
|
24343
|
+
width: circleSize,
|
|
24344
|
+
height: circleSize,
|
|
24345
|
+
viewBox: "0 0 " + circleSize + " " + circleSize,
|
|
24346
|
+
style: {
|
|
24347
|
+
transform: 'rotate(-90deg)'
|
|
24348
|
+
}
|
|
24349
|
+
}, /*#__PURE__*/React__default.createElement("circle", Object.assign({
|
|
24350
|
+
cx: circleSize / 2,
|
|
24351
|
+
cy: circleSize / 2,
|
|
24352
|
+
r: radiusCalc,
|
|
24353
|
+
stroke: trackColor,
|
|
24354
|
+
strokeWidth: strokeWidth,
|
|
24355
|
+
fill: "transparent"
|
|
24356
|
+
}, views == null ? void 0 : views.track)), /*#__PURE__*/React__default.createElement("circle", Object.assign({
|
|
24357
|
+
cx: circleSize / 2,
|
|
24358
|
+
cy: circleSize / 2,
|
|
24359
|
+
r: radiusCalc,
|
|
24360
|
+
stroke: barColor,
|
|
24361
|
+
strokeWidth: strokeWidth,
|
|
24362
|
+
strokeDasharray: circumference,
|
|
24363
|
+
strokeDashoffset: offset,
|
|
24364
|
+
strokeLinecap: "round",
|
|
24365
|
+
fill: "transparent",
|
|
24366
|
+
style: {
|
|
24367
|
+
transition: animated ? "stroke-dashoffset " + animationDuration + " ease-in-out" : 'none'
|
|
24368
|
+
}
|
|
24369
|
+
}, views == null ? void 0 : views.indicator))), showLabel && (/*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
24370
|
+
position: "absolute",
|
|
24371
|
+
top: 0,
|
|
24372
|
+
left: 0,
|
|
24373
|
+
right: 0,
|
|
24374
|
+
bottom: 0,
|
|
24375
|
+
display: "flex",
|
|
24376
|
+
alignItems: "center",
|
|
24377
|
+
justifyContent: "center",
|
|
24378
|
+
pointerEvents: "none"
|
|
24379
|
+
}, /*#__PURE__*/React__default.createElement(appStudio.Text, Object.assign({
|
|
24380
|
+
color: labelColor,
|
|
24381
|
+
fontSize: circleSize * 0.2 + "px",
|
|
24382
|
+
fontWeight: "bold"
|
|
24383
|
+
}, views == null ? void 0 : views.text), Math.round(percentage), "%"))));
|
|
24384
|
+
}
|
|
24385
|
+
// Linear Progress Bar
|
|
24386
|
+
var linearHeight = height || 8;
|
|
24342
24387
|
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
24343
24388
|
role: "progressbar",
|
|
24344
24389
|
"aria-valuenow": value,
|
|
24345
24390
|
"aria-valuemin": 0,
|
|
24346
24391
|
"aria-valuemax": max,
|
|
24347
24392
|
width: "100%",
|
|
24348
|
-
height:
|
|
24393
|
+
height: linearHeight,
|
|
24349
24394
|
backgroundColor: trackColor,
|
|
24350
24395
|
borderRadius: radius,
|
|
24351
24396
|
overflow: "hidden"
|
|
@@ -24353,12 +24398,16 @@ var ProgressBarView = _ref => {
|
|
|
24353
24398
|
width: percentage + "%",
|
|
24354
24399
|
height: "100%",
|
|
24355
24400
|
backgroundColor: barColor,
|
|
24356
|
-
borderRadius: radius
|
|
24401
|
+
borderRadius: radius,
|
|
24402
|
+
style: {
|
|
24403
|
+
transition: animated ? "width " + animationDuration + " ease-in-out" : 'none'
|
|
24404
|
+
}
|
|
24357
24405
|
}, views == null ? void 0 : views.bar)));
|
|
24358
24406
|
};
|
|
24359
24407
|
|
|
24360
24408
|
/**
|
|
24361
24409
|
* ProgressBar component displays completion status of a task or process.
|
|
24410
|
+
* Supports both linear and circular shapes.
|
|
24362
24411
|
*/
|
|
24363
24412
|
var ProgressBarComponent = props => (/*#__PURE__*/React__default.createElement(ProgressBarView, Object.assign({}, props)));
|
|
24364
24413
|
var ProgressBar = ProgressBarComponent;
|
|
@@ -27408,16 +27457,10 @@ var BackgroundImageStyles = {
|
|
|
27408
27457
|
backgroundRepeat: 'no-repeat',
|
|
27409
27458
|
backgroundAttachment: 'scroll'
|
|
27410
27459
|
},
|
|
27411
|
-
overlay: {
|
|
27412
|
-
position: 'absolute',
|
|
27413
|
-
top: 0,
|
|
27414
|
-
left: 0,
|
|
27415
|
-
width: '100%',
|
|
27416
|
-
height: '100%',
|
|
27417
|
-
pointerEvents: 'none'
|
|
27418
|
-
},
|
|
27419
27460
|
content: {
|
|
27420
27461
|
position: 'relative',
|
|
27462
|
+
width: '100%',
|
|
27463
|
+
height: '100%',
|
|
27421
27464
|
zIndex: 2
|
|
27422
27465
|
}
|
|
27423
27466
|
};
|
|
@@ -27441,14 +27484,6 @@ var BackgroundVideoStyles = {
|
|
|
27441
27484
|
height: '100%',
|
|
27442
27485
|
objectFit: 'cover'
|
|
27443
27486
|
},
|
|
27444
|
-
overlay: {
|
|
27445
|
-
position: 'absolute',
|
|
27446
|
-
top: 0,
|
|
27447
|
-
left: 0,
|
|
27448
|
-
width: '100%',
|
|
27449
|
-
height: '100%',
|
|
27450
|
-
pointerEvents: 'none'
|
|
27451
|
-
},
|
|
27452
27487
|
content: {
|
|
27453
27488
|
position: 'relative',
|
|
27454
27489
|
zIndex: 2
|
|
@@ -27717,7 +27752,8 @@ var _excluded$1o = ["children", "showRadialGradient", "views", "themeMode"],
|
|
|
27717
27752
|
_excluded7$1 = ["children", "src", "backgroundSize", "backgroundPosition", "backgroundRepeat", "backgroundAttachment", "imageOpacity", "overlay", "blendMode", "views", "themeMode"],
|
|
27718
27753
|
_excluded8$1 = ["children", "src", "autoPlay", "loop", "muted", "playsInline", "overlay", "blendMode", "views", "themeMode"],
|
|
27719
27754
|
_excluded9$1 = ["children"],
|
|
27720
|
-
_excluded10$1 = ["
|
|
27755
|
+
_excluded10$1 = ["contentPosition"],
|
|
27756
|
+
_excluded11$1 = ["children", "views"];
|
|
27721
27757
|
// Background Context
|
|
27722
27758
|
var BackgroundContext = /*#__PURE__*/React.createContext({});
|
|
27723
27759
|
/**
|
|
@@ -28111,15 +28147,11 @@ var BackgroundImage = _ref7 => {
|
|
|
28111
28147
|
backgroundRepeat = 'no-repeat',
|
|
28112
28148
|
backgroundAttachment = 'scroll',
|
|
28113
28149
|
imageOpacity = 1,
|
|
28114
|
-
overlay,
|
|
28150
|
+
overlay = null,
|
|
28115
28151
|
blendMode = 'normal',
|
|
28116
|
-
views
|
|
28117
|
-
themeMode: elementMode
|
|
28152
|
+
views
|
|
28118
28153
|
} = _ref7,
|
|
28119
28154
|
props = _objectWithoutPropertiesLoose(_ref7, _excluded7$1);
|
|
28120
|
-
var {
|
|
28121
|
-
getColor
|
|
28122
|
-
} = appStudio.useTheme();
|
|
28123
28155
|
var imageStyle = Object.assign({}, BackgroundImageStyles.image, {
|
|
28124
28156
|
backgroundImage: "url(" + src + ")",
|
|
28125
28157
|
backgroundSize,
|
|
@@ -28128,17 +28160,9 @@ var BackgroundImage = _ref7 => {
|
|
|
28128
28160
|
backgroundAttachment,
|
|
28129
28161
|
opacity: imageOpacity
|
|
28130
28162
|
});
|
|
28131
|
-
var overlayStyle = overlay ? Object.assign({}, BackgroundImageStyles.overlay, {
|
|
28132
|
-
backgroundColor: getColor(overlay, elementMode ? {
|
|
28133
|
-
themeMode: elementMode
|
|
28134
|
-
} : undefined),
|
|
28135
|
-
mixBlendMode: blendMode
|
|
28136
|
-
}) : {};
|
|
28137
28163
|
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, BackgroundImageStyles.container, views == null ? void 0 : views.container, props), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
28138
28164
|
style: imageStyle
|
|
28139
|
-
}, views == null ? void 0 : views.image)), overlay && /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
28140
|
-
style: overlayStyle
|
|
28141
|
-
}), children && (/*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, BackgroundImageStyles.content, views == null ? void 0 : views.content), children)));
|
|
28165
|
+
}, views == null ? void 0 : views.image)), overlay, children && (/*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, BackgroundImageStyles.content, views == null ? void 0 : views.content), children)));
|
|
28142
28166
|
};
|
|
28143
28167
|
/**
|
|
28144
28168
|
* Background Video Component
|
|
@@ -28151,21 +28175,11 @@ var BackgroundVideo = _ref8 => {
|
|
|
28151
28175
|
loop = true,
|
|
28152
28176
|
muted = true,
|
|
28153
28177
|
playsInline = true,
|
|
28154
|
-
overlay,
|
|
28178
|
+
overlay = null,
|
|
28155
28179
|
blendMode = 'normal',
|
|
28156
|
-
views
|
|
28157
|
-
themeMode: elementMode
|
|
28180
|
+
views
|
|
28158
28181
|
} = _ref8,
|
|
28159
28182
|
props = _objectWithoutPropertiesLoose(_ref8, _excluded8$1);
|
|
28160
|
-
var {
|
|
28161
|
-
getColor
|
|
28162
|
-
} = appStudio.useTheme();
|
|
28163
|
-
var overlayStyle = overlay ? Object.assign({}, BackgroundVideoStyles.overlay, {
|
|
28164
|
-
backgroundColor: getColor(overlay, elementMode ? {
|
|
28165
|
-
themeMode: elementMode
|
|
28166
|
-
} : undefined),
|
|
28167
|
-
mixBlendMode: blendMode
|
|
28168
|
-
}) : {};
|
|
28169
28183
|
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, BackgroundVideoStyles.container, views == null ? void 0 : views.container, props), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
28170
28184
|
as: "video",
|
|
28171
28185
|
src: src,
|
|
@@ -28174,9 +28188,7 @@ var BackgroundVideo = _ref8 => {
|
|
|
28174
28188
|
muted: muted,
|
|
28175
28189
|
playsInline: playsInline,
|
|
28176
28190
|
style: BackgroundVideoStyles.video
|
|
28177
|
-
}, views == null ? void 0 : views.video)), overlay && /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
28178
|
-
style: overlayStyle
|
|
28179
|
-
}, views == null ? void 0 : views.overlay)), children && (/*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, BackgroundVideoStyles.content, views == null ? void 0 : views.content), children)));
|
|
28191
|
+
}, views == null ? void 0 : views.video)), overlay, children && (/*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, BackgroundVideoStyles.content, views == null ? void 0 : views.content), children)));
|
|
28180
28192
|
};
|
|
28181
28193
|
/**
|
|
28182
28194
|
* Background Gradient Component
|
|
@@ -28189,12 +28201,48 @@ var BackgroundGradient = _ref9 => {
|
|
|
28189
28201
|
gradientProps = _objectWithoutPropertiesLoose(_ref9, _excluded9$1);
|
|
28190
28202
|
return /*#__PURE__*/React__default.createElement(Gradient, Object.assign({}, gradientProps), children);
|
|
28191
28203
|
};
|
|
28192
|
-
|
|
28204
|
+
/**
|
|
28205
|
+
* Background Overlay Component
|
|
28206
|
+
*/
|
|
28207
|
+
var BackgroundOverlay = _ref10 => {
|
|
28193
28208
|
var {
|
|
28194
|
-
|
|
28195
|
-
views
|
|
28209
|
+
contentPosition
|
|
28196
28210
|
} = _ref10,
|
|
28197
28211
|
props = _objectWithoutPropertiesLoose(_ref10, _excluded10$1);
|
|
28212
|
+
var getDefaultOverlay = () => {
|
|
28213
|
+
switch (contentPosition) {
|
|
28214
|
+
case 'left':
|
|
28215
|
+
return 'radial-gradient(circle at 70% 50%, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.1) 100%), linear-gradient(to right, rgba(0,0,0,1) 0%, rgba(0,0,0,0.6) 50%, rgba(0,0,0,0.2) 100%)';
|
|
28216
|
+
case 'right':
|
|
28217
|
+
return 'radial-gradient(circle at 30% 50%, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.1) 100%), linear-gradient(to left, rgba(0,0,0,1) 0%, rgba(0,0,0,0.6) 50%, rgba(0,0,0,0.2) 100%)';
|
|
28218
|
+
case 'top':
|
|
28219
|
+
return 'radial-gradient(circle at 50% 80%, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.1) 100%), linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0.6) 50%, rgba(0,0,0,0.1) 100%)';
|
|
28220
|
+
case 'bottom':
|
|
28221
|
+
return 'radial-gradient(circle at 50% 80%, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.1) 100%), linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,0.6) 50%, rgba(0,0,0,0.1) 100%)';
|
|
28222
|
+
case 'center':
|
|
28223
|
+
return 'radial-gradient(circle at 50% 90%, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%)';
|
|
28224
|
+
default:
|
|
28225
|
+
return 'rgba(0,0,0,0.5)';
|
|
28226
|
+
}
|
|
28227
|
+
};
|
|
28228
|
+
var background = getDefaultOverlay();
|
|
28229
|
+
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
28230
|
+
position: "absolute",
|
|
28231
|
+
top: 0,
|
|
28232
|
+
left: 0,
|
|
28233
|
+
width: "100%",
|
|
28234
|
+
height: "100%",
|
|
28235
|
+
background: background,
|
|
28236
|
+
pointerEvents: "none",
|
|
28237
|
+
zIndex: 1
|
|
28238
|
+
}, props));
|
|
28239
|
+
};
|
|
28240
|
+
var BackgroundViewBase = _ref11 => {
|
|
28241
|
+
var {
|
|
28242
|
+
children,
|
|
28243
|
+
views
|
|
28244
|
+
} = _ref11,
|
|
28245
|
+
props = _objectWithoutPropertiesLoose(_ref11, _excluded11$1);
|
|
28198
28246
|
return /*#__PURE__*/React__default.createElement(BackgroundContext.Provider, {
|
|
28199
28247
|
value: {}
|
|
28200
28248
|
}, /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, DefaultBackgroundStyles.container, views == null ? void 0 : views.container, props), children));
|
|
@@ -28211,6 +28259,7 @@ BackgroundView.Ripples = Ripples;
|
|
|
28211
28259
|
BackgroundView.Image = BackgroundImage;
|
|
28212
28260
|
BackgroundView.Video = BackgroundVideo;
|
|
28213
28261
|
BackgroundView.Gradient = BackgroundGradient;
|
|
28262
|
+
BackgroundView.Overlay = BackgroundOverlay;
|
|
28214
28263
|
|
|
28215
28264
|
/**
|
|
28216
28265
|
* Background Component with compound pattern
|
|
@@ -28272,7 +28321,8 @@ var Background = /*#__PURE__*/Object.assign(BackgroundComponent, {
|
|
|
28272
28321
|
Ripples: BackgroundView.Ripples,
|
|
28273
28322
|
Image: BackgroundView.Image,
|
|
28274
28323
|
Video: BackgroundView.Video,
|
|
28275
|
-
Gradient: BackgroundView.Gradient
|
|
28324
|
+
Gradient: BackgroundView.Gradient,
|
|
28325
|
+
Overlay: BackgroundView.Overlay
|
|
28276
28326
|
});
|
|
28277
28327
|
Background.displayName = 'Background';
|
|
28278
28328
|
|