@app-studio/web 0.9.6 → 0.9.7

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.
@@ -31,6 +31,33 @@ export interface WallProps extends ViewProps {
31
31
  cols?: number;
32
32
  squareSize?: number;
33
33
  }
34
+ /**
35
+ * Particles component props
36
+ */
37
+ export interface ParticlesProps extends Omit<ViewProps, 'colors'> {
38
+ count?: number;
39
+ colors?: string[];
40
+ speed?: 'slow' | 'medium' | 'fast';
41
+ shapes?: ('circle' | 'square' | 'triangle')[];
42
+ }
43
+ /**
44
+ * Grid component props
45
+ */
46
+ export interface GridProps extends ViewProps {
47
+ gridSize?: number;
48
+ lineColor?: string;
49
+ pulseColor?: string;
50
+ animationSpeed?: 'slow' | 'medium' | 'fast';
51
+ }
52
+ /**
53
+ * Ripples component props
54
+ */
55
+ export interface RipplesProps extends Omit<ViewProps, 'colors'> {
56
+ rippleCount?: number;
57
+ colors?: string[];
58
+ maxSize?: number;
59
+ frequency?: number;
60
+ }
34
61
  /**
35
62
  * Background styles for customization
36
63
  */
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { BackgroundProps, AuroraBackgroundProps, MeteorsProps, WallProps } from './Background.props';
2
+ import { BackgroundProps, AuroraBackgroundProps, MeteorsProps, WallProps, ParticlesProps, GridProps, RipplesProps } from './Background.props';
3
3
  /**
4
4
  * Main Background View Component with compound pattern
5
5
  */
@@ -7,6 +7,9 @@ interface BackgroundViewComponent extends React.FC<BackgroundProps> {
7
7
  Aurora: React.FC<AuroraBackgroundProps>;
8
8
  Meteors: React.FC<MeteorsProps>;
9
9
  Wall: React.FC<WallProps>;
10
+ Particles: React.FC<ParticlesProps>;
11
+ Grid: React.FC<GridProps>;
12
+ Ripples: React.FC<RipplesProps>;
10
13
  }
11
14
  export declare const BackgroundView: BackgroundViewComponent;
12
15
  export {};
@@ -10,4 +10,7 @@ export declare const Background: React.ForwardRefExoticComponent<Pick<Background
10
10
  Aurora: React.FC<import("./Background/Background.props").AuroraBackgroundProps>;
11
11
  Meteors: React.FC<import("./Background/Background.props").MeteorsProps>;
12
12
  Wall: React.FC<import("./Background/Background.props").WallProps>;
13
+ Particles: React.FC<import("./Background/Background.props").ParticlesProps>;
14
+ Grid: React.FC<import("./Background/Background.props").GridProps>;
15
+ Ripples: React.FC<import("./Background/Background.props").RipplesProps>;
13
16
  };
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const GridDemo: () => React.JSX.Element;
@@ -2,4 +2,7 @@ export { DefaultDemo } from './default';
2
2
  export { AuroraDemo } from './aurora';
3
3
  export { MeteorsDemo } from './meteors';
4
4
  export { WallDemo } from './wall';
5
+ export { ParticlesDemo } from './particles';
6
+ export { GridDemo } from './grid';
7
+ export { RipplesDemo } from './ripples';
5
8
  export { CombinedEffectsDemo } from './combinedEffects';
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const ParticlesDemo: () => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const RipplesDemo: () => React.JSX.Element;
@@ -1,3 +1,3 @@
1
1
  export { Background } from './Background';
2
- export type { BackgroundProps, AuroraBackgroundProps, MeteorsProps, BackgroundStyles, } from './Background/Background.props';
2
+ export type { BackgroundProps, AuroraBackgroundProps, MeteorsProps, WallProps, ParticlesProps, GridProps, RipplesProps, BackgroundStyles, } from './Background/Background.props';
3
3
  export type { BackgroundEffect, AuroraDirection, MeteorTiming, BorderAnimationStyles, StrokeAnimationStyles, BackgroundContextType, } from './Background/Background.type';
@@ -25552,7 +25552,10 @@ var AuroraStyles = {
25552
25552
  var _excluded$1c = ["children", "showRadialGradient", "views", "themeMode"],
25553
25553
  _excluded2$l = ["number"],
25554
25554
  _excluded3$g = ["rows", "cols", "squareSize"],
25555
- _excluded4$d = ["children", "views"];
25555
+ _excluded4$d = ["count", "colors", "speed", "shapes"],
25556
+ _excluded5$6 = ["gridSize", "lineColor", "pulseColor", "animationSpeed"],
25557
+ _excluded6$4 = ["rippleCount", "colors", "maxSize", "frequency"],
25558
+ _excluded7$1 = ["children", "views"];
25556
25559
  // Background Context
25557
25560
  var BackgroundContext = /*#__PURE__*/React.createContext({});
25558
25561
  /**
@@ -25679,12 +25682,258 @@ var Wall = _ref3 => {
25679
25682
  }
25680
25683
  })))))));
25681
25684
  };
25682
- var BackgroundViewBase = _ref4 => {
25685
+ /**
25686
+ * Particles Component
25687
+ */
25688
+ var defaultParticleColors = ['rgb(59, 130, 246)', 'rgb(147, 51, 234)', 'rgb(236, 72, 153)', 'rgb(34, 197, 94)', 'rgb(251, 146, 60)', 'rgb(168, 85, 247)'];
25689
+ var Particles = _ref4 => {
25683
25690
  var {
25684
- children,
25685
- views
25691
+ count = 50,
25692
+ colors = defaultParticleColors,
25693
+ speed = 'medium',
25694
+ shapes = ['circle']
25686
25695
  } = _ref4,
25687
25696
  props = _objectWithoutPropertiesLoose(_ref4, _excluded4$d);
25697
+ var particles = Array.from({
25698
+ length: count
25699
+ }, (_, i) => i);
25700
+ var getSpeedMultiplier = () => {
25701
+ switch (speed) {
25702
+ case 'slow':
25703
+ return 0.5;
25704
+ case 'fast':
25705
+ return 2;
25706
+ default:
25707
+ return 1;
25708
+ }
25709
+ };
25710
+ var getRandomShape = () => shapes[Math.floor(Math.random() * shapes.length)];
25711
+ var getRandomColor = () => colors[Math.floor(Math.random() * colors.length)];
25712
+ return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
25713
+ width: 400,
25714
+ height: 300,
25715
+ position: "relative",
25716
+ overflow: "hidden",
25717
+ backgroundColor: "color.gray.900"
25718
+ }, props), particles.map(idx => {
25719
+ var size = Math.random() * 8 + 4; // 4-12px
25720
+ var startX = Math.random() * 400;
25721
+ var startY = Math.random() * 300;
25722
+ var endX = Math.random() * 400;
25723
+ var endY = Math.random() * 300;
25724
+ var duration = (Math.random() * 10 + 5) / getSpeedMultiplier(); // 5-15s adjusted by speed
25725
+ var delay = Math.random() * 5; // 0-5s delay
25726
+ var shape = getRandomShape();
25727
+ var color = getRandomColor();
25728
+ var shapeStyles = {
25729
+ circle: {
25730
+ borderRadius: '50%'
25731
+ },
25732
+ square: {
25733
+ borderRadius: '2px'
25734
+ },
25735
+ triangle: {
25736
+ borderRadius: '0',
25737
+ clipPath: 'polygon(50% 0%, 0% 100%, 100% 100%)'
25738
+ }
25739
+ };
25740
+ return /*#__PURE__*/React__default.createElement(appStudio.View, {
25741
+ key: idx,
25742
+ position: "absolute",
25743
+ width: size,
25744
+ height: size,
25745
+ backgroundColor: color,
25746
+ opacity: 0.7,
25747
+ style: Object.assign({
25748
+ left: startX,
25749
+ top: startY
25750
+ }, shapeStyles[shape]),
25751
+ animate: {
25752
+ from: {
25753
+ transform: "translate(0px, 0px) scale(0.5)",
25754
+ opacity: 0
25755
+ },
25756
+ to: {
25757
+ transform: "translate(" + (endX - startX) + "px, " + (endY - startY) + "px) scale(1)",
25758
+ opacity: 0.7
25759
+ },
25760
+ iterationCount: 'infinite',
25761
+ direction: 'alternate',
25762
+ timingFunction: 'ease-in-out',
25763
+ duration: duration + "s",
25764
+ delay: delay + "s"
25765
+ }
25766
+ });
25767
+ }));
25768
+ };
25769
+ /**
25770
+ * Grid Component
25771
+ */
25772
+ var Grid = _ref5 => {
25773
+ var {
25774
+ gridSize = 30,
25775
+ lineColor = 'rgba(59, 130, 246, 0.3)',
25776
+ pulseColor = 'rgba(59, 130, 246, 0.8)',
25777
+ animationSpeed = 'medium'
25778
+ } = _ref5,
25779
+ props = _objectWithoutPropertiesLoose(_ref5, _excluded5$6);
25780
+ var getSpeedValue = () => {
25781
+ switch (animationSpeed) {
25782
+ case 'slow':
25783
+ return 4;
25784
+ case 'fast':
25785
+ return 1;
25786
+ default:
25787
+ return 2;
25788
+ }
25789
+ };
25790
+ var cols = Math.floor(400 / gridSize);
25791
+ var rows = Math.floor(300 / gridSize);
25792
+ var totalCells = cols * rows;
25793
+ var cells = Array.from({
25794
+ length: totalCells
25795
+ }, (_, i) => i);
25796
+ return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
25797
+ width: 400,
25798
+ height: 300,
25799
+ position: "relative",
25800
+ overflow: "hidden",
25801
+ backgroundColor: "color.gray.900"
25802
+ }, props), Array.from({
25803
+ length: cols + 1
25804
+ }, (_, i) => (/*#__PURE__*/React__default.createElement(appStudio.View, {
25805
+ key: "v-line-" + i,
25806
+ position: "absolute",
25807
+ left: i * gridSize,
25808
+ top: 0,
25809
+ width: 1,
25810
+ height: "100%",
25811
+ backgroundColor: lineColor
25812
+ }))), Array.from({
25813
+ length: rows + 1
25814
+ }, (_, i) => (/*#__PURE__*/React__default.createElement(appStudio.View, {
25815
+ key: "h-line-" + i,
25816
+ position: "absolute",
25817
+ left: 0,
25818
+ top: i * gridSize,
25819
+ width: "100%",
25820
+ height: 1,
25821
+ backgroundColor: lineColor
25822
+ }))), cells.map(cellIndex => {
25823
+ var col = cellIndex % cols;
25824
+ var row = Math.floor(cellIndex / cols);
25825
+ var delay = (col + row) * 0.1; // Diagonal wave effect
25826
+ return /*#__PURE__*/React__default.createElement(appStudio.View, {
25827
+ key: cellIndex,
25828
+ position: "absolute",
25829
+ left: col * gridSize + 1,
25830
+ top: row * gridSize + 1,
25831
+ width: gridSize - 2,
25832
+ height: gridSize - 2,
25833
+ backgroundColor: "transparent",
25834
+ animate: {
25835
+ from: {
25836
+ backgroundColor: 'transparent'
25837
+ },
25838
+ to: {
25839
+ backgroundColor: pulseColor
25840
+ },
25841
+ iterationCount: 'infinite',
25842
+ direction: 'alternate',
25843
+ timingFunction: 'ease-in-out',
25844
+ duration: getSpeedValue() + "s",
25845
+ delay: delay + "s"
25846
+ }
25847
+ });
25848
+ }));
25849
+ };
25850
+ /**
25851
+ * Ripples Component
25852
+ */
25853
+ var defaultRippleColors = ['rgba(59, 130, 246, 0.6)', 'rgba(147, 51, 234, 0.6)', 'rgba(236, 72, 153, 0.6)', 'rgba(34, 197, 94, 0.6)'];
25854
+ var Ripples = _ref6 => {
25855
+ var {
25856
+ rippleCount = 5,
25857
+ colors = defaultRippleColors,
25858
+ maxSize = 200,
25859
+ frequency = 3
25860
+ } = _ref6,
25861
+ props = _objectWithoutPropertiesLoose(_ref6, _excluded6$4);
25862
+ var ripples = Array.from({
25863
+ length: rippleCount
25864
+ }, (_, i) => ({
25865
+ id: i,
25866
+ x: Math.random() * 400,
25867
+ y: Math.random() * 300,
25868
+ color: colors[i % colors.length],
25869
+ delay: i * (frequency / rippleCount),
25870
+ duration: 3 + Math.random() * 2
25871
+ }));
25872
+ return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
25873
+ width: 400,
25874
+ height: 300,
25875
+ position: "relative",
25876
+ overflow: "hidden",
25877
+ backgroundColor: "color.gray.100"
25878
+ }, props), ripples.map(ripple => (/*#__PURE__*/React__default.createElement(appStudio.View, {
25879
+ key: ripple.id,
25880
+ position: "absolute",
25881
+ width: 20,
25882
+ height: 20,
25883
+ borderRadius: "50%",
25884
+ style: {
25885
+ left: ripple.x - 10,
25886
+ top: ripple.y - 10,
25887
+ border: "2px solid " + ripple.color,
25888
+ backgroundColor: 'transparent'
25889
+ },
25890
+ animate: {
25891
+ from: {
25892
+ transform: 'scale(0)',
25893
+ opacity: 1
25894
+ },
25895
+ to: {
25896
+ transform: "scale(" + maxSize / 20 + ")",
25897
+ opacity: 0
25898
+ },
25899
+ iterationCount: 'infinite',
25900
+ timingFunction: 'ease-out',
25901
+ duration: ripple.duration + "s",
25902
+ delay: ripple.delay + "s"
25903
+ }
25904
+ }))), ripples.map(ripple => (/*#__PURE__*/React__default.createElement(appStudio.View, {
25905
+ key: "secondary-" + ripple.id,
25906
+ position: "absolute",
25907
+ width: 10,
25908
+ height: 10,
25909
+ borderRadius: "50%",
25910
+ style: {
25911
+ left: ripple.x - 5,
25912
+ top: ripple.y - 5,
25913
+ backgroundColor: ripple.color
25914
+ },
25915
+ animate: {
25916
+ from: {
25917
+ transform: 'scale(1)',
25918
+ opacity: 0.8
25919
+ },
25920
+ to: {
25921
+ transform: "scale(" + maxSize / 40 + ")",
25922
+ opacity: 0
25923
+ },
25924
+ iterationCount: 'infinite',
25925
+ timingFunction: 'ease-out',
25926
+ duration: ripple.duration * 1.2 + "s",
25927
+ delay: ripple.delay + 0.5 + "s"
25928
+ }
25929
+ }))));
25930
+ };
25931
+ var BackgroundViewBase = _ref7 => {
25932
+ var {
25933
+ children,
25934
+ views
25935
+ } = _ref7,
25936
+ props = _objectWithoutPropertiesLoose(_ref7, _excluded7$1);
25688
25937
  return /*#__PURE__*/React__default.createElement(BackgroundContext.Provider, {
25689
25938
  value: {}
25690
25939
  }, /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, DefaultBackgroundStyles.container, views == null ? void 0 : views.container, props), children));
@@ -25695,6 +25944,9 @@ var BackgroundView = BackgroundViewBase;
25695
25944
  BackgroundView.Aurora = AuroraBackground;
25696
25945
  BackgroundView.Meteors = Meteors;
25697
25946
  BackgroundView.Wall = Wall;
25947
+ BackgroundView.Particles = Particles;
25948
+ BackgroundView.Grid = Grid;
25949
+ BackgroundView.Ripples = Ripples;
25698
25950
 
25699
25951
  /**
25700
25952
  * Background Component with compound pattern
@@ -25712,6 +25964,18 @@ BackgroundView.Wall = Wall;
25712
25964
  * @example
25713
25965
  * // Wall effect
25714
25966
  * <Background.Wall rows={15} cols={10} squareSize={40} />
25967
+ *
25968
+ * @example
25969
+ * // Particles effect
25970
+ * <Background.Particles count={50} speed="medium" shapes={['circle', 'square']} />
25971
+ *
25972
+ * @example
25973
+ * // Grid effect
25974
+ * <Background.Grid gridSize={30} animationSpeed="medium" />
25975
+ *
25976
+ * @example
25977
+ * // Ripples effect
25978
+ * <Background.Ripples rippleCount={5} maxSize={200} frequency={3} />
25715
25979
  */
25716
25980
  var BackgroundComponent = /*#__PURE__*/React__default.forwardRef((props, ref) => /*#__PURE__*/React__default.createElement(BackgroundView, Object.assign({}, props, {
25717
25981
  ref: ref
@@ -25720,7 +25984,10 @@ BackgroundComponent.displayName = 'Background';
25720
25984
  var Background = /*#__PURE__*/Object.assign(BackgroundComponent, {
25721
25985
  Aurora: BackgroundView.Aurora,
25722
25986
  Meteors: BackgroundView.Meteors,
25723
- Wall: BackgroundView.Wall
25987
+ Wall: BackgroundView.Wall,
25988
+ Particles: BackgroundView.Particles,
25989
+ Grid: BackgroundView.Grid,
25990
+ Ripples: BackgroundView.Ripples
25724
25991
  });
25725
25992
  Background.displayName = 'Background';
25726
25993