@app-studio/web 0.9.9 → 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
@@ -15294,7 +15294,7 @@ var TitleSizes = {
15294
15294
  */
15295
15295
  var LineHeights$1 = {
15296
15296
  xs: 32,
15297
- sm: 40,
15297
+ sm: 48,
15298
15298
  md: 56,
15299
15299
  lg: 72,
15300
15300
  xl: 80
@@ -16208,13 +16208,7 @@ var DropdownMenuContent = _ref3 => {
16208
16208
  item: item,
16209
16209
  views: views
16210
16210
  });
16211
- }), process.env.NODE_ENV === 'development' && (/*#__PURE__*/React.createElement("div", {
16212
- style: {
16213
- fontSize: '10px',
16214
- opacity: 0.7,
16215
- padding: '4px'
16216
- }
16217
- }, "Placement: ", optimalPosition.placement)));
16211
+ }));
16218
16212
  };
16219
16213
  // DropdownMenu Item component
16220
16214
  var DropdownMenuItem = _ref4 => {
@@ -19519,13 +19513,7 @@ var HoverCardContent = _ref3 => {
19519
19513
  maxWidth: maxWidth,
19520
19514
  // Combine intelligent position styles with user styles
19521
19515
  style: Object.assign({}, positionStyles, userStyle)
19522
- }, views == null ? void 0 : views.container, props), children, process.env.NODE_ENV === 'development' && (/*#__PURE__*/React.createElement("div", {
19523
- style: {
19524
- fontSize: '10px',
19525
- opacity: 0.7,
19526
- marginTop: '4px'
19527
- }
19528
- }, "Placement: ", optimalPosition.placement)));
19516
+ }, views == null ? void 0 : views.container, props), children);
19529
19517
  };
19530
19518
 
19531
19519
  var _excluded$X = ["children", "views", "openDelay", "closeDelay"];
@@ -19924,13 +19912,7 @@ var MenubarContent = _ref5 => {
19924
19912
  boxShadow: "0px 2px 8px rgba(0, 0, 0, 0.15)",
19925
19913
  overflow: "hidden",
19926
19914
  style: positionStyles
19927
- }, views == null ? void 0 : views.content), children, process.env.NODE_ENV === 'development' && (/*#__PURE__*/React.createElement("div", {
19928
- style: {
19929
- fontSize: '8px',
19930
- opacity: 0.7,
19931
- padding: '4px'
19932
- }
19933
- }, "Placement: ", optimalPosition.placement)));
19915
+ }, views == null ? void 0 : views.content), children);
19934
19916
  };
19935
19917
  // Menubar Item component
19936
19918
  var MenubarItem = _ref6 => {
@@ -23091,13 +23073,7 @@ var TooltipView = _ref4 => {
23091
23073
  borderRadius: 4,
23092
23074
  boxShadow: "0px 2px 8px rgba(0, 0, 0, 0.15)",
23093
23075
  style: positionStyles
23094
- }, TooltipSizes[size], TooltipVariants[variant], views == null ? void 0 : views.content), typeof content === 'string' ? (/*#__PURE__*/React.createElement(Text$1, Object.assign({}, views == null ? void 0 : views.text), content)) : content, showArrow && /*#__PURE__*/React.createElement(View, Object.assign({}, arrowStyles, views == null ? void 0 : views.arrow)), process.env.NODE_ENV === 'development' && (/*#__PURE__*/React.createElement("div", {
23095
- style: {
23096
- fontSize: '8px',
23097
- opacity: 0.7,
23098
- marginTop: '2px'
23099
- }
23100
- }, "Placement: ", optimalPosition.placement)))));
23076
+ }, TooltipSizes[size], TooltipVariants[variant], views == null ? void 0 : views.content), typeof content === 'string' ? (/*#__PURE__*/React.createElement(Text$1, Object.assign({}, views == null ? void 0 : views.text), content)) : content, showArrow && /*#__PURE__*/React.createElement(View, Object.assign({}, arrowStyles, views == null ? void 0 : views.arrow)))));
23101
23077
  };
23102
23078
 
23103
23079
  var _excluded$18 = ["content", "children", "position", "align", "size", "variant", "openDelay", "closeDelay", "showArrow", "defaultOpen", "isDisabled", "views"];
@@ -26595,14 +26571,305 @@ var AuroraStyles = {
26595
26571
  backgroundPosition: '50% 50%, 50% 50%'
26596
26572
  }
26597
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
+ };
26598
26610
 
26599
- 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"],
26600
26865
  _excluded2$l = ["number"],
26601
26866
  _excluded3$g = ["rows", "cols", "squareSize"],
26602
26867
  _excluded4$d = ["count", "colors", "speed", "shapes"],
26603
26868
  _excluded5$6 = ["gridSize", "lineColor", "pulseColor", "animationSpeed"],
26604
26869
  _excluded6$4 = ["rippleCount", "colors", "maxSize", "frequency"],
26605
- _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"];
26606
26873
  // Background Context
26607
26874
  var BackgroundContext = /*#__PURE__*/createContext({});
26608
26875
  /**
@@ -26614,7 +26881,7 @@ var AuroraBackground = _ref => {
26614
26881
  showRadialGradient = true,
26615
26882
  views
26616
26883
  } = _ref,
26617
- props = _objectWithoutPropertiesLoose(_ref, _excluded$1e);
26884
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$1f);
26618
26885
  var gradientColors = {
26619
26886
  white: 'rgba(255,255,255,1)',
26620
26887
  transparent: 'rgba(255,255,255,0)'
@@ -26975,12 +27242,64 @@ var Ripples = _ref6 => {
26975
27242
  }
26976
27243
  }))));
26977
27244
  };
26978
- var BackgroundViewBase = _ref7 => {
27245
+ /**
27246
+ * Background Image Component
27247
+ */
27248
+ var BackgroundImage = _ref7 => {
26979
27249
  var {
26980
27250
  children,
26981
- 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
26982
27261
  } = _ref7,
26983
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);
26984
27303
  return /*#__PURE__*/React.createElement(BackgroundContext.Provider, {
26985
27304
  value: {}
26986
27305
  }, /*#__PURE__*/React.createElement(View, Object.assign({}, DefaultBackgroundStyles.container, views == null ? void 0 : views.container, props), children));
@@ -26994,6 +27313,8 @@ BackgroundView.Wall = Wall;
26994
27313
  BackgroundView.Particles = Particles;
26995
27314
  BackgroundView.Grid = Grid;
26996
27315
  BackgroundView.Ripples = Ripples;
27316
+ BackgroundView.Image = BackgroundImage;
27317
+ BackgroundView.Gradient = BackgroundGradient;
26997
27318
 
26998
27319
  /**
26999
27320
  * Background Component with compound pattern
@@ -27023,6 +27344,18 @@ BackgroundView.Ripples = Ripples;
27023
27344
  * @example
27024
27345
  * // Ripples effect
27025
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>
27026
27359
  */
27027
27360
  var BackgroundComponent = /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/React.createElement(BackgroundView, Object.assign({}, props, {
27028
27361
  ref: ref
@@ -27034,7 +27367,9 @@ var Background = /*#__PURE__*/Object.assign(BackgroundComponent, {
27034
27367
  Wall: BackgroundView.Wall,
27035
27368
  Particles: BackgroundView.Particles,
27036
27369
  Grid: BackgroundView.Grid,
27037
- Ripples: BackgroundView.Ripples
27370
+ Ripples: BackgroundView.Ripples,
27371
+ Image: BackgroundView.Image,
27372
+ Gradient: BackgroundView.Gradient
27038
27373
  });
27039
27374
  Background.displayName = 'Background';
27040
27375