@app-studio/web 0.9.69 → 0.9.70
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 +13 -0
- package/dist/components/Background/Background/Background.view.d.ts +3 -1
- package/dist/components/Background/Background.d.ts +1 -0
- package/dist/web.cjs.development.js +81 -6
- 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 +81 -6
- package/dist/web.esm.js.map +1 -1
- package/dist/web.umd.development.js +81 -6
- 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/components/Icon.mdx +139 -304
- package/package.json +1 -1
|
@@ -12,6 +12,19 @@ export interface BackgroundProps extends ViewProps {
|
|
|
12
12
|
content?: ViewProps;
|
|
13
13
|
};
|
|
14
14
|
themeMode?: 'light' | 'dark';
|
|
15
|
+
shape?: 'square' | 'rounded' | 'pill';
|
|
16
|
+
decorationRotation?: number;
|
|
17
|
+
decorationScale?: number;
|
|
18
|
+
decorationOpacity?: number;
|
|
19
|
+
}
|
|
20
|
+
export interface BackgroundLayoutProps extends BackgroundProps {
|
|
21
|
+
shape?: 'square' | 'rounded' | 'pill';
|
|
22
|
+
views?: {
|
|
23
|
+
container?: ViewProps;
|
|
24
|
+
content?: ViewProps;
|
|
25
|
+
back?: ViewProps;
|
|
26
|
+
front?: ViewProps;
|
|
27
|
+
};
|
|
15
28
|
}
|
|
16
29
|
/**
|
|
17
30
|
* Aurora Background component props
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { BackgroundProps, AuroraBackgroundProps, MeteorsProps, WallProps, ParticlesProps, GridProps, RipplesProps, BackgroundImageProps, BackgroundVideoProps, BackgroundGradientProps, BackgroundOverlayProps } from './Background.props';
|
|
2
|
+
import { BackgroundProps, AuroraBackgroundProps, MeteorsProps, WallProps, ParticlesProps, GridProps, RipplesProps, BackgroundImageProps, BackgroundVideoProps, BackgroundGradientProps, BackgroundOverlayProps, BackgroundLayoutProps } from './Background.props';
|
|
3
3
|
/**
|
|
4
4
|
* Main Background View Component with compound pattern
|
|
5
5
|
*/
|
|
@@ -14,6 +14,8 @@ interface BackgroundViewComponent extends React.FC<BackgroundProps> {
|
|
|
14
14
|
Video: React.FC<BackgroundVideoProps>;
|
|
15
15
|
Gradient: React.FC<BackgroundGradientProps>;
|
|
16
16
|
Overlay: React.FC<BackgroundOverlayProps>;
|
|
17
|
+
Layout: React.FC<BackgroundLayoutProps>;
|
|
17
18
|
}
|
|
19
|
+
export declare const BackgroundLayout: React.ForwardRefExoticComponent<Pick<BackgroundLayoutProps, string | number> & React.RefAttributes<HTMLDivElement>>;
|
|
18
20
|
export declare const BackgroundView: BackgroundViewComponent;
|
|
19
21
|
export {};
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import { BackgroundProps } from './Background/Background.props';
|
|
11
11
|
export declare const Background: React.ForwardRefExoticComponent<Pick<BackgroundProps, string | number> & React.RefAttributes<HTMLDivElement>> & {
|
|
12
|
+
Layout: React.FC<import("./Background/Background.props").BackgroundLayoutProps>;
|
|
12
13
|
Aurora: React.FC<import("./Background/Background.props").AuroraBackgroundProps>;
|
|
13
14
|
Meteors: React.FC<import("./Background/Background.props").MeteorsProps>;
|
|
14
15
|
Wall: React.FC<import("./Background/Background.props").WallProps>;
|
|
@@ -25785,7 +25785,8 @@ var _excluded$1o = ["children", "showRadialGradient", "views", "themeMode"],
|
|
|
25785
25785
|
_excluded8 = ["children", "src", "autoPlay", "loop", "muted", "playsInline", "overlay", "blendMode", "views", "themeMode"],
|
|
25786
25786
|
_excluded9 = ["children"],
|
|
25787
25787
|
_excluded10 = ["contentPosition"],
|
|
25788
|
-
_excluded11 = ["children", "views"]
|
|
25788
|
+
_excluded11 = ["children", "views"],
|
|
25789
|
+
_excluded12 = ["children", "designProps", "shape", "decorationRotation", "decorationScale", "decorationOpacity", "views"];
|
|
25789
25790
|
// Background Context
|
|
25790
25791
|
var BackgroundContext = /*#__PURE__*/React.createContext({});
|
|
25791
25792
|
/**
|
|
@@ -26244,15 +26245,15 @@ var BackgroundOverlay = _ref10 => {
|
|
|
26244
26245
|
var getDefaultOverlay = () => {
|
|
26245
26246
|
switch (contentPosition) {
|
|
26246
26247
|
case 'left':
|
|
26247
|
-
return 'radial-gradient(circle at
|
|
26248
|
+
return 'radial-gradient(circle at 80% 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) 80%, rgba(0,0,0,0.2) 100%)';
|
|
26248
26249
|
case 'right':
|
|
26249
|
-
return 'radial-gradient(circle at
|
|
26250
|
+
return 'radial-gradient(circle at 20% 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) 80%, rgba(0,0,0,0.2) 100%)';
|
|
26250
26251
|
case 'top':
|
|
26251
|
-
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)
|
|
26252
|
+
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) 80%, rgba(0,0,0,0.1) 100%)';
|
|
26252
26253
|
case 'bottom':
|
|
26253
|
-
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)
|
|
26254
|
+
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) 80%, rgba(0,0,0,0.1) 100%)';
|
|
26254
26255
|
case 'center':
|
|
26255
|
-
return 'radial-gradient(circle at 50%
|
|
26256
|
+
return 'radial-gradient(circle at 50% 70%, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%)';
|
|
26256
26257
|
default:
|
|
26257
26258
|
return 'rgba(0,0,0,0.5)';
|
|
26258
26259
|
}
|
|
@@ -26279,6 +26280,78 @@ var BackgroundViewBase = _ref11 => {
|
|
|
26279
26280
|
value: {}
|
|
26280
26281
|
}, /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, DefaultBackgroundStyles.container, views == null ? void 0 : views.container, props), children));
|
|
26281
26282
|
};
|
|
26283
|
+
var BackgroundLayout = /*#__PURE__*/React__default.forwardRef((_ref12, ref) => {
|
|
26284
|
+
var _props$backgroundColo, _props$padding;
|
|
26285
|
+
var {
|
|
26286
|
+
children,
|
|
26287
|
+
shape = 'rounded',
|
|
26288
|
+
decorationRotation = 5,
|
|
26289
|
+
decorationScale = 1,
|
|
26290
|
+
decorationOpacity = 0.8,
|
|
26291
|
+
views
|
|
26292
|
+
} = _ref12,
|
|
26293
|
+
props = _objectWithoutPropertiesLoose(_ref12, _excluded12);
|
|
26294
|
+
var getBorderRadius = shape => {
|
|
26295
|
+
switch (shape) {
|
|
26296
|
+
case 'square':
|
|
26297
|
+
return '0px';
|
|
26298
|
+
case 'pill':
|
|
26299
|
+
return '9999px';
|
|
26300
|
+
case 'rounded':
|
|
26301
|
+
default:
|
|
26302
|
+
return '16px';
|
|
26303
|
+
}
|
|
26304
|
+
};
|
|
26305
|
+
var radius = getBorderRadius(shape);
|
|
26306
|
+
// Calculate the extra space needed for the rotated/scaled decoration
|
|
26307
|
+
// When rotated, corners extend beyond the original bounds
|
|
26308
|
+
// Extra space ≈ sin(rotation) × dimension + (scale - 1) × dimension
|
|
26309
|
+
var rotationRad = Math.abs(decorationRotation) * (Math.PI / 180);
|
|
26310
|
+
var rotationOffset = Math.sin(rotationRad) * 100; // percentage-based estimate
|
|
26311
|
+
var scaleOffset = (decorationScale - 1) * 100 / 2;
|
|
26312
|
+
var extraPadding = Math.ceil(rotationOffset + scaleOffset);
|
|
26313
|
+
var backgroundColor = (_props$backgroundColo = props.backgroundColor) != null ? _props$backgroundColo : 'theme.primary';
|
|
26314
|
+
return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, props, {
|
|
26315
|
+
ref: ref,
|
|
26316
|
+
backgroundColor: 'transparent',
|
|
26317
|
+
position: "relative",
|
|
26318
|
+
overflow: "visible"
|
|
26319
|
+
}, views == null ? void 0 : views.container), /*#__PURE__*/React__default.createElement(appStudio.View, {
|
|
26320
|
+
padding: (_props$padding = props.padding) != null ? _props$padding : 96 + extraPadding + "px " + extraPadding + "px",
|
|
26321
|
+
position: "relative",
|
|
26322
|
+
overflow: "visible"
|
|
26323
|
+
}, /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
26324
|
+
position: "absolute",
|
|
26325
|
+
top: extraPadding,
|
|
26326
|
+
left: extraPadding,
|
|
26327
|
+
right: extraPadding,
|
|
26328
|
+
bottom: extraPadding,
|
|
26329
|
+
backgroundColor: backgroundColor,
|
|
26330
|
+
borderRadius: radius,
|
|
26331
|
+
opacity: decorationOpacity / 1.5,
|
|
26332
|
+
transform: "scale(" + decorationScale + ")",
|
|
26333
|
+
pointerEvents: "none",
|
|
26334
|
+
zIndex: 1
|
|
26335
|
+
}, views == null ? void 0 : views.back)), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
26336
|
+
position: "absolute",
|
|
26337
|
+
top: extraPadding,
|
|
26338
|
+
left: extraPadding,
|
|
26339
|
+
right: extraPadding,
|
|
26340
|
+
bottom: extraPadding,
|
|
26341
|
+
transform: "rotate(" + decorationRotation + "deg) scale(" + decorationScale + ")",
|
|
26342
|
+
opacity: decorationOpacity / 1.2,
|
|
26343
|
+
backgroundColor: backgroundColor,
|
|
26344
|
+
borderRadius: radius,
|
|
26345
|
+
pointerEvents: "none",
|
|
26346
|
+
zIndex: 2
|
|
26347
|
+
}, views == null ? void 0 : views.front)), /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
|
|
26348
|
+
margin: "0 auto",
|
|
26349
|
+
//width="100%"
|
|
26350
|
+
position: "relative",
|
|
26351
|
+
zIndex: 3
|
|
26352
|
+
}, views == null ? void 0 : views.content), children)));
|
|
26353
|
+
});
|
|
26354
|
+
BackgroundLayout.displayName = 'Background.Layout';
|
|
26282
26355
|
// Create the compound component
|
|
26283
26356
|
var BackgroundView = BackgroundViewBase;
|
|
26284
26357
|
// Attach compound components
|
|
@@ -26292,6 +26365,7 @@ BackgroundView.Image = BackgroundImage;
|
|
|
26292
26365
|
BackgroundView.Video = BackgroundVideo;
|
|
26293
26366
|
BackgroundView.Gradient = BackgroundGradient;
|
|
26294
26367
|
BackgroundView.Overlay = BackgroundOverlay;
|
|
26368
|
+
BackgroundView.Layout = BackgroundLayout;
|
|
26295
26369
|
|
|
26296
26370
|
/**
|
|
26297
26371
|
* Background Component with compound pattern
|
|
@@ -26345,6 +26419,7 @@ var BackgroundComponent = /*#__PURE__*/React__default.forwardRef((props, ref) =>
|
|
|
26345
26419
|
})));
|
|
26346
26420
|
BackgroundComponent.displayName = 'Background';
|
|
26347
26421
|
var Background = /*#__PURE__*/Object.assign(BackgroundComponent, {
|
|
26422
|
+
Layout: BackgroundView.Layout,
|
|
26348
26423
|
Aurora: BackgroundView.Aurora,
|
|
26349
26424
|
Meteors: BackgroundView.Meteors,
|
|
26350
26425
|
Wall: BackgroundView.Wall,
|