@app-studio/web 0.9.10 → 0.9.11

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/web.esm.js CHANGED
@@ -26571,14 +26571,305 @@ var AuroraStyles = {
26571
26571
  backgroundPosition: '50% 50%, 50% 50%'
26572
26572
  }
26573
26573
  };
26574
+ /**
26575
+ * Background Image styles
26576
+ */
26577
+ var BackgroundImageStyles = {
26578
+ container: {
26579
+ position: 'relative',
26580
+ display: 'flex',
26581
+ flexDirection: 'column',
26582
+ alignItems: 'center',
26583
+ justifyContent: 'center',
26584
+ overflow: 'hidden'
26585
+ },
26586
+ image: {
26587
+ position: 'absolute',
26588
+ top: 0,
26589
+ left: 0,
26590
+ width: '100%',
26591
+ height: '100%',
26592
+ backgroundSize: 'cover',
26593
+ backgroundPosition: 'center',
26594
+ backgroundRepeat: 'no-repeat',
26595
+ backgroundAttachment: 'scroll'
26596
+ },
26597
+ overlay: {
26598
+ position: 'absolute',
26599
+ top: 0,
26600
+ left: 0,
26601
+ width: '100%',
26602
+ height: '100%',
26603
+ pointerEvents: 'none'
26604
+ },
26605
+ content: {
26606
+ position: 'relative',
26607
+ zIndex: 2
26608
+ }
26609
+ };
26574
26610
 
26575
- var _excluded$1e = ["children", "showRadialGradient", "views", "themeMode"],
26611
+ /**
26612
+ * Gradient Styles
26613
+ *
26614
+ * Defines the styles for the Gradient component following the design guidelines:
26615
+ * - Typography: Inter/Geist font, specific sizes/weights
26616
+ * - Spacing: 4px grid system
26617
+ * - Colors: Neutral palette with semantic colors
26618
+ * - Rounded corners: Consistent border radius
26619
+ * - Transitions: Subtle animations
26620
+ */
26621
+ /**
26622
+ * Maps direction strings to CSS gradient directions
26623
+ */
26624
+ var DirectionMap = {
26625
+ 'to-right': 'to right',
26626
+ 'to-left': 'to left',
26627
+ 'to-bottom': 'to bottom',
26628
+ 'to-top': 'to top',
26629
+ 'to-top-right': 'to top right',
26630
+ 'to-top-left': 'to top left',
26631
+ 'to-bottom-right': 'to bottom right',
26632
+ 'to-bottom-left': 'to bottom left'
26633
+ };
26634
+ /**
26635
+ * Maps position strings to CSS position values
26636
+ */
26637
+ var PositionMap = {
26638
+ center: 'center',
26639
+ top: 'top',
26640
+ right: 'right',
26641
+ bottom: 'bottom',
26642
+ left: 'left',
26643
+ 'top-right': 'top right',
26644
+ 'top-left': 'top left',
26645
+ 'bottom-right': 'bottom right',
26646
+ 'bottom-left': 'bottom left'
26647
+ };
26648
+ /**
26649
+ * Default color stops for different gradient types
26650
+ */
26651
+ var DefaultColorStops = {
26652
+ linear: [{
26653
+ color: 'color.blue.500',
26654
+ position: '0%'
26655
+ }, {
26656
+ color: 'color.purple.500',
26657
+ position: '100%'
26658
+ }],
26659
+ radial: [{
26660
+ color: 'color.blue.500',
26661
+ position: '0%'
26662
+ }, {
26663
+ color: 'color.purple.500',
26664
+ position: '100%'
26665
+ }],
26666
+ conic: [{
26667
+ color: 'color.red.500',
26668
+ position: '0deg'
26669
+ }, {
26670
+ color: 'color.yellow.500',
26671
+ position: '90deg'
26672
+ }, {
26673
+ color: 'color.green.500',
26674
+ position: '180deg'
26675
+ }, {
26676
+ color: 'color.blue.500',
26677
+ position: '270deg'
26678
+ }, {
26679
+ color: 'color.red.500',
26680
+ position: '360deg'
26681
+ }]
26682
+ };
26683
+ /**
26684
+ * Generates a CSS gradient string based on the provided parameters
26685
+ */
26686
+ var generateGradientString = (type, colors, direction, shape, position) => {
26687
+ // Format color stops
26688
+ var colorStopsString = colors.map(stop => stop.color + " " + (stop.position || '')).join(', ');
26689
+ // Generate the appropriate gradient string based on type
26690
+ switch (type) {
26691
+ case 'linear':
26692
+ var dir = direction && DirectionMap[direction] ? DirectionMap[direction] : direction || 'to right';
26693
+ return "linear-gradient(" + dir + ", " + colorStopsString + ")";
26694
+ case 'radial':
26695
+ var pos = position && PositionMap[position] ? PositionMap[position] : position || 'center';
26696
+ var shapeValue = shape || 'circle';
26697
+ return "radial-gradient(" + shapeValue + " at " + pos + ", " + colorStopsString + ")";
26698
+ case 'conic':
26699
+ var conicPos = position && PositionMap[position] ? PositionMap[position] : position || 'center';
26700
+ return "conic-gradient(from 0deg at " + conicPos + ", " + colorStopsString + ")";
26701
+ default:
26702
+ return "linear-gradient(to right, " + colorStopsString + ")";
26703
+ }
26704
+ };
26705
+ /**
26706
+ * Animation styles for animated gradients using app-studio's animation system
26707
+ */
26708
+ var GradientAnimations = {
26709
+ linear: {
26710
+ backgroundSize: '200% 200%',
26711
+ transition: 'background-position 3s ease-in-out',
26712
+ animate: {
26713
+ from: {
26714
+ backgroundPosition: '0% 50%'
26715
+ },
26716
+ '50%': {
26717
+ backgroundPosition: '100% 50%'
26718
+ },
26719
+ to: {
26720
+ backgroundPosition: '0% 50%'
26721
+ }
26722
+ }
26723
+ },
26724
+ radial: {
26725
+ backgroundSize: '100% 100%',
26726
+ transition: 'all 3s ease-in-out',
26727
+ animate: {
26728
+ from: {
26729
+ backgroundPosition: 'center',
26730
+ backgroundSize: '100% 100%'
26731
+ },
26732
+ '50%': {
26733
+ backgroundSize: '120% 120%'
26734
+ },
26735
+ to: {
26736
+ backgroundPosition: 'center',
26737
+ backgroundSize: '100% 100%'
26738
+ }
26739
+ }
26740
+ },
26741
+ conic: {
26742
+ transition: 'transform 3s linear',
26743
+ animate: {
26744
+ from: {
26745
+ transform: 'rotate(0deg)'
26746
+ },
26747
+ to: {
26748
+ transform: 'rotate(360deg)'
26749
+ }
26750
+ }
26751
+ }
26752
+ };
26753
+ /**
26754
+ * Default styles for the Gradient component
26755
+ */
26756
+ var DefaultGradientStyles = {
26757
+ container: {
26758
+ position: 'relative',
26759
+ overflow: 'hidden',
26760
+ borderRadius: '8px',
26761
+ transition: 'all 0.2s ease'
26762
+ },
26763
+ content: {
26764
+ position: 'relative',
26765
+ zIndex: 1,
26766
+ width: '100%',
26767
+ height: '100%',
26768
+ padding: '16px'
26769
+ }
26770
+ };
26771
+
26772
+ var _excluded$1e = ["type", "direction", "shape", "position", "from", "to", "colors", "animate", "animationDuration", "children", "views", "themeMode"];
26773
+ var GradientView = _ref => {
26774
+ var {
26775
+ type = 'linear',
26776
+ direction = 'to-right',
26777
+ shape = 'circle',
26778
+ position = 'center',
26779
+ from,
26780
+ to,
26781
+ colors,
26782
+ animate = false,
26783
+ animationDuration = 3,
26784
+ children,
26785
+ views,
26786
+ themeMode: elementMode
26787
+ } = _ref,
26788
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$1e);
26789
+ var {
26790
+ getColor,
26791
+ themeMode
26792
+ } = useTheme();
26793
+ // Determine color stops to use
26794
+ var colorStops = useMemo(() => {
26795
+ // If colors array is provided, use it
26796
+ if (colors && colors.length > 0) {
26797
+ return colors;
26798
+ }
26799
+ // If from and to are provided, create a two-color gradient
26800
+ if (from && to) {
26801
+ return [{
26802
+ color: from,
26803
+ position: '0%'
26804
+ }, {
26805
+ color: to,
26806
+ position: '100%'
26807
+ }];
26808
+ }
26809
+ // Otherwise use default colors for the selected gradient type
26810
+ return DefaultColorStops[type];
26811
+ }, [colors, from, to, type]);
26812
+ // Generate the gradient string
26813
+ var gradientString = useMemo(() => {
26814
+ // Process color stops to resolve theme colors
26815
+ var processedColorStops = colorStops.map(stop => Object.assign({}, stop, {
26816
+ color: getColor(stop.color, elementMode ? {
26817
+ themeMode: elementMode
26818
+ } : undefined)
26819
+ }));
26820
+ return generateGradientString(type, processedColorStops, direction, shape, position);
26821
+ }, [type, colorStops, direction, shape, position, getColor, themeMode, elementMode]);
26822
+ // Prepare animation styles if animation is enabled
26823
+ var animationStyles = useMemo(() => {
26824
+ if (!animate) return {};
26825
+ var baseAnimation = GradientAnimations[type];
26826
+ return Object.assign({}, baseAnimation, {
26827
+ transition: baseAnimation.transition.replace('3s', animationDuration + "s"),
26828
+ // Apply animation properties
26829
+ animationDuration: animationDuration + "s",
26830
+ animationIterationCount: 'infinite',
26831
+ animationTimingFunction: type === 'conic' ? 'linear' : 'ease-in-out'
26832
+ });
26833
+ }, [animate, animationDuration, type]);
26834
+ return /*#__PURE__*/React.createElement(View, Object.assign({
26835
+ background: gradientString
26836
+ }, DefaultGradientStyles.container, animationStyles, views == null ? void 0 : views.container, props), children && (/*#__PURE__*/React.createElement(View, Object.assign({}, DefaultGradientStyles.content, views == null ? void 0 : views.content), children)));
26837
+ };
26838
+
26839
+ /**
26840
+ * Gradient Component
26841
+ *
26842
+ * @example
26843
+ * // Basic linear gradient
26844
+ * <Gradient from="blue.500" to="purple.500" height="200px" width="100%" />
26845
+ *
26846
+ * @example
26847
+ * // Radial gradient with content
26848
+ * <Gradient
26849
+ * type="radial"
26850
+ * colors={[
26851
+ * { color: 'red.500', position: '0%' },
26852
+ * { color: 'orange.500', position: '50%' },
26853
+ * { color: 'yellow.500', position: '100%' }
26854
+ * ]}
26855
+ * height="200px"
26856
+ * >
26857
+ * <Text color="white">Content inside gradient</Text>
26858
+ * </Gradient>
26859
+ */
26860
+ var Gradient = props => {
26861
+ return /*#__PURE__*/React.createElement(GradientView, Object.assign({}, props));
26862
+ };
26863
+
26864
+ var _excluded$1f = ["children", "showRadialGradient", "views", "themeMode"],
26576
26865
  _excluded2$l = ["number"],
26577
26866
  _excluded3$g = ["rows", "cols", "squareSize"],
26578
26867
  _excluded4$d = ["count", "colors", "speed", "shapes"],
26579
26868
  _excluded5$6 = ["gridSize", "lineColor", "pulseColor", "animationSpeed"],
26580
26869
  _excluded6$4 = ["rippleCount", "colors", "maxSize", "frequency"],
26581
- _excluded7$1 = ["children", "views"];
26870
+ _excluded7$1 = ["children", "src", "backgroundSize", "backgroundPosition", "backgroundRepeat", "backgroundAttachment", "imageOpacity", "overlay", "blendMode", "views", "themeMode"],
26871
+ _excluded8$1 = ["children"],
26872
+ _excluded9$1 = ["children", "views"];
26582
26873
  // Background Context
26583
26874
  var BackgroundContext = /*#__PURE__*/createContext({});
26584
26875
  /**
@@ -26590,7 +26881,7 @@ var AuroraBackground = _ref => {
26590
26881
  showRadialGradient = true,
26591
26882
  views
26592
26883
  } = _ref,
26593
- props = _objectWithoutPropertiesLoose(_ref, _excluded$1e);
26884
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$1f);
26594
26885
  var gradientColors = {
26595
26886
  white: 'rgba(255,255,255,1)',
26596
26887
  transparent: 'rgba(255,255,255,0)'
@@ -26951,12 +27242,64 @@ var Ripples = _ref6 => {
26951
27242
  }
26952
27243
  }))));
26953
27244
  };
26954
- var BackgroundViewBase = _ref7 => {
27245
+ /**
27246
+ * Background Image Component
27247
+ */
27248
+ var BackgroundImage = _ref7 => {
26955
27249
  var {
26956
27250
  children,
26957
- views
27251
+ src,
27252
+ backgroundSize = 'cover',
27253
+ backgroundPosition = 'center',
27254
+ backgroundRepeat = 'no-repeat',
27255
+ backgroundAttachment = 'scroll',
27256
+ imageOpacity = 1,
27257
+ overlay,
27258
+ blendMode = 'normal',
27259
+ views,
27260
+ themeMode: elementMode
26958
27261
  } = _ref7,
26959
27262
  props = _objectWithoutPropertiesLoose(_ref7, _excluded7$1);
27263
+ var {
27264
+ getColor
27265
+ } = useTheme();
27266
+ var imageStyle = Object.assign({}, BackgroundImageStyles.image, {
27267
+ backgroundImage: "url(" + src + ")",
27268
+ backgroundSize,
27269
+ backgroundPosition,
27270
+ backgroundRepeat,
27271
+ backgroundAttachment,
27272
+ opacity: imageOpacity
27273
+ });
27274
+ var overlayStyle = overlay ? Object.assign({}, BackgroundImageStyles.overlay, {
27275
+ backgroundColor: getColor(overlay, elementMode ? {
27276
+ themeMode: elementMode
27277
+ } : undefined),
27278
+ mixBlendMode: blendMode
27279
+ }) : {};
27280
+ return /*#__PURE__*/React.createElement(View, Object.assign({}, BackgroundImageStyles.container, views == null ? void 0 : views.container, props), /*#__PURE__*/React.createElement(View, Object.assign({
27281
+ style: imageStyle
27282
+ }, views == null ? void 0 : views.image)), overlay && /*#__PURE__*/React.createElement(View, {
27283
+ style: overlayStyle
27284
+ }), children && (/*#__PURE__*/React.createElement(View, Object.assign({}, BackgroundImageStyles.content, views == null ? void 0 : views.content), children)));
27285
+ };
27286
+ /**
27287
+ * Background Gradient Component
27288
+ * Uses the existing Gradient component as a background
27289
+ */
27290
+ var BackgroundGradient = _ref8 => {
27291
+ var {
27292
+ children
27293
+ } = _ref8,
27294
+ gradientProps = _objectWithoutPropertiesLoose(_ref8, _excluded8$1);
27295
+ return /*#__PURE__*/React.createElement(Gradient, Object.assign({}, gradientProps), children);
27296
+ };
27297
+ var BackgroundViewBase = _ref9 => {
27298
+ var {
27299
+ children,
27300
+ views
27301
+ } = _ref9,
27302
+ props = _objectWithoutPropertiesLoose(_ref9, _excluded9$1);
26960
27303
  return /*#__PURE__*/React.createElement(BackgroundContext.Provider, {
26961
27304
  value: {}
26962
27305
  }, /*#__PURE__*/React.createElement(View, Object.assign({}, DefaultBackgroundStyles.container, views == null ? void 0 : views.container, props), children));
@@ -26970,6 +27313,8 @@ BackgroundView.Wall = Wall;
26970
27313
  BackgroundView.Particles = Particles;
26971
27314
  BackgroundView.Grid = Grid;
26972
27315
  BackgroundView.Ripples = Ripples;
27316
+ BackgroundView.Image = BackgroundImage;
27317
+ BackgroundView.Gradient = BackgroundGradient;
26973
27318
 
26974
27319
  /**
26975
27320
  * Background Component with compound pattern
@@ -26999,6 +27344,18 @@ BackgroundView.Ripples = Ripples;
26999
27344
  * @example
27000
27345
  * // Ripples effect
27001
27346
  * <Background.Ripples rippleCount={5} maxSize={200} frequency={3} />
27347
+ *
27348
+ * @example
27349
+ * // Background Image
27350
+ * <Background.Image src="/path/to/image.jpg" size="cover" overlay="rgba(0,0,0,0.5)">
27351
+ * <Text color="white">Content over image</Text>
27352
+ * </Background.Image>
27353
+ *
27354
+ * @example
27355
+ * // Background Gradient
27356
+ * <Background.Gradient from="blue.500" to="purple.500" animate={true}>
27357
+ * <Text color="white">Content over gradient</Text>
27358
+ * </Background.Gradient>
27002
27359
  */
27003
27360
  var BackgroundComponent = /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/React.createElement(BackgroundView, Object.assign({}, props, {
27004
27361
  ref: ref
@@ -27010,7 +27367,9 @@ var Background = /*#__PURE__*/Object.assign(BackgroundComponent, {
27010
27367
  Wall: BackgroundView.Wall,
27011
27368
  Particles: BackgroundView.Particles,
27012
27369
  Grid: BackgroundView.Grid,
27013
- Ripples: BackgroundView.Ripples
27370
+ Ripples: BackgroundView.Ripples,
27371
+ Image: BackgroundView.Image,
27372
+ Gradient: BackgroundView.Gradient
27014
27373
  });
27015
27374
  Background.displayName = 'Background';
27016
27375