@app-studio/web 0.8.81 → 0.8.83

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.
@@ -34,6 +34,7 @@ require('core-js/modules/es.string.match.js');
34
34
  require('core-js/modules/es.string.search.js');
35
35
  require('core-js/modules/es.array.flat-map.js');
36
36
  require('core-js/modules/es.array.unscopables.flat-map.js');
37
+ require('core-js/modules/es.string.trim.js');
37
38
 
38
39
  function _objectWithoutPropertiesLoose(r, e) {
39
40
  if (null == r) return {};
@@ -2820,71 +2821,70 @@ var Icon = {
2820
2821
  * Get theme styles for different alert variants based on theme mode
2821
2822
  */
2822
2823
  var getThemes = themeMode => {
2823
- var isDarkMode = themeMode === 'dark';
2824
2824
  return {
2825
2825
  default: {
2826
2826
  container: {
2827
- backgroundColor: isDarkMode ? 'color.gray.800' : 'color.gray.50',
2828
- borderColor: isDarkMode ? 'color.gray.700' : 'color.gray.200',
2829
- boxShadow: isDarkMode ? '0 1px 2px rgba(0, 0, 0, 0.2)' : '0 1px 2px rgba(0, 0, 0, 0.05)'
2827
+ backgroundColor: 'color.gray.50',
2828
+ borderColor: 'color.gray.200',
2829
+ boxShadow: '0 1px 2px rgba(0, 0, 0, 0.05)'
2830
2830
  },
2831
2831
  content: {
2832
- color: isDarkMode ? 'color.gray.300' : 'color.gray.700'
2832
+ color: 'color.gray.700'
2833
2833
  },
2834
2834
  icon: {
2835
- color: isDarkMode ? 'color.gray.400' : 'color.gray.500'
2835
+ color: 'color.gray.500'
2836
2836
  }
2837
2837
  },
2838
2838
  info: {
2839
2839
  container: {
2840
- backgroundColor: isDarkMode ? 'color.blue.900' : 'color.blue.50',
2841
- borderColor: isDarkMode ? 'color.blue.800' : 'color.blue.200',
2842
- boxShadow: isDarkMode ? '0 1px 2px rgba(59, 130, 246, 0.2)' : '0 1px 2px rgba(59, 130, 246, 0.05)'
2840
+ backgroundColor: 'color.blue.50',
2841
+ borderColor: 'color.blue.200',
2842
+ boxShadow: '0 1px 2px rgba(59, 130, 246, 0.05)'
2843
2843
  },
2844
2844
  content: {
2845
- color: isDarkMode ? 'color.blue.300' : 'color.blue.700'
2845
+ color: 'color.blue.700'
2846
2846
  },
2847
2847
  icon: {
2848
- color: isDarkMode ? 'color.blue.400' : 'color.blue.500'
2848
+ color: 'color.blue.500'
2849
2849
  }
2850
2850
  },
2851
2851
  success: {
2852
2852
  container: {
2853
- backgroundColor: isDarkMode ? 'color.green.900' : 'color.green.50',
2854
- borderColor: isDarkMode ? 'color.green.800' : 'color.green.200',
2855
- boxShadow: isDarkMode ? '0 1px 2px rgba(34, 197, 94, 0.2)' : '0 1px 2px rgba(34, 197, 94, 0.05)'
2853
+ backgroundColor: 'color.green.50',
2854
+ borderColor: 'color.green.200',
2855
+ boxShadow: '0 1px 2px rgba(34, 197, 94, 0.05)'
2856
2856
  },
2857
2857
  content: {
2858
- color: isDarkMode ? 'color.green.300' : 'color.green.700'
2858
+ color: 'color.green.700'
2859
2859
  },
2860
2860
  icon: {
2861
- color: isDarkMode ? 'color.green.400' : 'color.green.500'
2861
+ color: 'color.green.500'
2862
2862
  }
2863
2863
  },
2864
2864
  error: {
2865
2865
  container: {
2866
- backgroundColor: isDarkMode ? 'color.red.900' : 'color.red.50',
2867
- borderColor: isDarkMode ? 'color.red.800' : 'color.red.200',
2868
- boxShadow: isDarkMode ? '0 1px 2px rgba(239, 68, 68, 0.2)' : '0 1px 2px rgba(239, 68, 68, 0.05)'
2866
+ backgroundColor: 'color.red.50',
2867
+ borderColor: 'color.red.200',
2868
+ boxShadow: '0 1px 2px rgba(239, 68, 68, 0.05)'
2869
2869
  },
2870
2870
  content: {
2871
- color: isDarkMode ? 'color.red.300' : 'color.red.700'
2871
+ color: 'color.red.700'
2872
2872
  },
2873
2873
  icon: {
2874
- color: isDarkMode ? 'color.red.400' : 'color.red.500'
2874
+ color: 'color.red.500'
2875
2875
  }
2876
2876
  },
2877
2877
  warning: {
2878
2878
  container: {
2879
- backgroundColor: isDarkMode ? 'color.orange.900' : 'color.orange.50',
2880
- borderColor: isDarkMode ? 'color.orange.800' : 'color.orange.200',
2881
- boxShadow: isDarkMode ? '0 1px 2px rgba(249, 115, 22, 0.2)' : '0 1px 2px rgba(249, 115, 22, 0.05)'
2879
+ backgroundColor: 'color.orange.50',
2880
+ borderColor: 'color.orange.200',
2881
+ boxShadow: '0 1px 2px rgba(249, 115, 22, 0.05)'
2882
2882
  },
2883
2883
  content: {
2884
- color: isDarkMode ? 'color.orange.300' : 'color.orange.700'
2884
+ color: 'color.orange.700'
2885
2885
  },
2886
2886
  icon: {
2887
- color: isDarkMode ? 'color.orange.400' : 'color.orange.500'
2887
+ color: 'color.orange.500'
2888
2888
  }
2889
2889
  }
2890
2890
  };
@@ -2907,8 +2907,7 @@ var AlertView = _ref => {
2907
2907
  var {
2908
2908
  themeMode
2909
2909
  } = appStudio.useTheme();
2910
- var currentThemeMode = elementMode || themeMode;
2911
- var themes = getThemes(currentThemeMode);
2910
+ var themes = getThemes();
2912
2911
  // Select the appropriate icon based on the variant
2913
2912
  var getIcon = () => {
2914
2913
  var _views$icon$color, _views$icon;
@@ -3237,11 +3236,10 @@ var PositionStyles = {
3237
3236
  * Get badge variants with consistent styling based on theme mode
3238
3237
  */
3239
3238
  var getBadgeVariants = themeMode => {
3240
- var isDarkMode = themeMode === 'dark';
3241
3239
  return {
3242
3240
  filled: {
3243
3241
  backgroundColor: 'theme.primary',
3244
- color: isDarkMode ? 'color.gray.900' : 'color.white',
3242
+ color: 'color.white',
3245
3243
  borderWidth: '1px',
3246
3244
  borderStyle: 'solid',
3247
3245
  borderColor: 'transparent',
@@ -3267,7 +3265,7 @@ var getBadgeVariants = themeMode => {
3267
3265
  },
3268
3266
  ghost: {
3269
3267
  backgroundColor: 'transparent',
3270
- color: isDarkMode ? 'color.gray.400' : 'color.gray.500',
3268
+ color: 'color.gray.500',
3271
3269
  borderWidth: '1px',
3272
3270
  borderStyle: 'solid',
3273
3271
  borderColor: 'transparent',
@@ -3295,8 +3293,7 @@ var BadgeView = _ref => {
3295
3293
  var {
3296
3294
  themeMode
3297
3295
  } = appStudio.useTheme();
3298
- var currentThemeMode = elementMode || themeMode;
3299
- var variantStyles = getBadgeVariants(currentThemeMode)[variant];
3296
+ var variantStyles = getBadgeVariants()[variant];
3300
3297
  // Combine styles for the badge
3301
3298
  var combinedStyles = Object.assign({
3302
3299
  // Base styles
@@ -3558,7 +3555,9 @@ var DefaultSpinner = _ref => {
3558
3555
  getColor,
3559
3556
  themeMode
3560
3557
  } = appStudio.useTheme();
3561
- var colorStyle = getColor(color, elementMode ? elementMode : themeMode);
3558
+ var colorStyle = getColor(color, {
3559
+ themeMode: elementMode ? elementMode : themeMode
3560
+ });
3562
3561
  var sizeStyle = typeof size === 'number' ? size : DefaultSizes[size];
3563
3562
  var [angle, setAngle] = React.useState(0);
3564
3563
  React.useEffect(() => {
@@ -3605,7 +3604,9 @@ var Dotted = _ref2 => {
3605
3604
  getColor,
3606
3605
  themeMode
3607
3606
  } = appStudio.useTheme();
3608
- var colorStyle = getColor(color, elementMode ? elementMode : themeMode);
3607
+ var colorStyle = getColor(color, {
3608
+ themeMode: elementMode ? elementMode : themeMode
3609
+ });
3609
3610
  var sizeStyle = typeof size === 'number' ? size : DefaultSizes[size];
3610
3611
  var [angle, setAngle] = React.useState(0);
3611
3612
  React.useEffect(() => {
@@ -3651,7 +3652,9 @@ var Quarter = _ref3 => {
3651
3652
  getColor,
3652
3653
  themeMode
3653
3654
  } = appStudio.useTheme();
3654
- var colorStyle = getColor(color, elementMode ? elementMode : themeMode);
3655
+ var colorStyle = getColor(color, {
3656
+ themeMode: elementMode ? elementMode : themeMode
3657
+ });
3655
3658
  var sizeStyle = typeof size === 'number' ? size : DefaultSizes[size];
3656
3659
  var [angle, setAngle] = React.useState(0);
3657
3660
  React.useEffect(() => {
@@ -3718,9 +3721,10 @@ React__default.createElement(LoaderView, Object.assign({}, props)));
3718
3721
  // Exports the LoaderComponent as Loader, making it available for use in other parts of the application.
3719
3722
  var Loader = LoaderComponent;
3720
3723
 
3721
- var _excluded$a = ["icon", "shadow", "children", "ariaLabel", "to", "isAuto", "isFilled", "isIconRounded", "isLoading", "isDisabled", "size", "variant", "iconPosition", "shape", "onClick", "loaderProps", "loaderPosition", "effect", "isHovered", "setIsHovered", "isExternal", "themeMode", "views", "colorScheme"],
3724
+ var _excluded$a = ["icon", "shadow", "children", "ariaLabel", "to", "isAuto", "isFilled", "isIconRounded", "isLoading", "isDisabled", "size", "variant", "iconPosition", "shape", "onClick", "loaderProps", "loaderPosition", "effect", "isHovered", "setIsHovered", "isExternal", "themeMode", "views", "color", "backgroundColor"],
3722
3725
  _excluded2$3 = ["_hover", "_active"],
3723
3726
  _excluded3$3 = ["height"];
3727
+ // Using require for contrast as it seems to be a common pattern in your code
3724
3728
  var contrast = /*#__PURE__*/require('contrast');
3725
3729
  var ButtonView = _ref => {
3726
3730
  var _props$onClick;
@@ -3742,13 +3746,16 @@ var ButtonView = _ref => {
3742
3746
  onClick = () => {},
3743
3747
  loaderProps = {},
3744
3748
  loaderPosition = 'left',
3745
- effect = 'default',
3746
- isHovered,
3749
+ effect = 'default' // 'default', 'hover', 'reverse'
3750
+ ,
3747
3751
  setIsHovered = () => {},
3748
3752
  isExternal = false,
3749
3753
  themeMode: elementMode,
3754
+ // Allow overriding themeMode for this element
3750
3755
  views,
3751
- colorScheme = 'theme.primary'
3756
+ color,
3757
+ // Text color prop
3758
+ backgroundColor = 'theme.primary' // Background color prop
3752
3759
  } = _ref,
3753
3760
  props = _objectWithoutPropertiesLoose(_ref, _excluded$a);
3754
3761
  var {
@@ -3760,81 +3767,170 @@ var ButtonView = _ref => {
3760
3767
  var defaultNativeProps = {
3761
3768
  disabled: !isActive
3762
3769
  };
3763
- var buttonColor = isActive ? colorScheme : 'theme.disabled';
3764
- var hovering = isHovered && effect === 'hover';
3765
- var reverse = isHovered && effect === 'reverse';
3766
- // Determine if the button color is light or dark for proper contrast
3767
- var isLight = contrast(getColor(buttonColor, elementMode ? elementMode : themeMode)) == 'light';
3768
- // Define button variants with effect support
3769
- var ButtonVariants = {
3770
- filled: {
3771
- backgroundColor: reverse ? 'transparent' : buttonColor,
3772
- color: reverse ? isLight ? 'white' : buttonColor : isLight ? buttonColor : 'white',
3773
- borderWidth: 1,
3774
- borderStyle: 'solid',
3775
- borderColor: reverse ? buttonColor : 'transparent',
3776
- _hover: {
3777
- backgroundColor: reverse ? buttonColor + "10" : "" + buttonColor,
3778
- transform: 'translateY(-2px)',
3779
- boxShadow: '0 4px 8px rgba(0, 0, 0, 0.1)'
3770
+ // Determine the base background color key/value, considering disabled state
3771
+ var buttonBackgroundColorKey = isActive ? backgroundColor : 'theme.disabled';
3772
+ // --- Provided Color Logic ---
3773
+ // Determine the effective theme mode for this button
3774
+ var mode = elementMode != null ? elementMode : themeMode; // effective mode
3775
+ // Resolve the base background color string
3776
+ var bg = getColor(buttonBackgroundColorKey, {
3777
+ themeMode: mode
3778
+ });
3779
+ // Resolve the background color string in the opposite theme mode (for reverse effect, though not directly used for ghost/outline text contrast)
3780
+ // const bgHover = getColor(buttonBackgroundColorKey, {
3781
+ // themeMode: mode === 'light' ? 'dark' : 'light',
3782
+ // }); // bgHover is not strictly needed for the text contrast logic below
3783
+ // Check contrast of base background
3784
+ var isBgLight = contrast(bg) === mode;
3785
+ // Determine contrasting text color key for the base background
3786
+ var txtOnBgKey = isBgLight ? 'color.black' : 'color.white';
3787
+ // --- End Provided Color Logic ---
3788
+ // Determine the default text color key/value if 'color' prop is not provided
3789
+ // For filled buttons, default text color should contrast with the background (use txtOnBgKey).
3790
+ // For outline/link/ghost, a theme-appropriate text color is usually better (e.g., theme.text or theme.primary).
3791
+ var defaultTextColorKey;
3792
+ if (variant === 'filled') {
3793
+ defaultTextColorKey = txtOnBgKey; // Use the calculated contrasting color key
3794
+ } else {
3795
+ // For non-filled variants, default to theme's text color or primary color
3796
+ defaultTextColorKey = 'theme.primary'; // Or 'theme.primary' depending on design system
3797
+ }
3798
+ // Determine the actual key/value for the base text color
3799
+ // Use the provided 'color' prop if available, otherwise use the calculated default
3800
+ var baseTextColorKey = color || defaultTextColorKey;
3801
+ // Resolve the actual base text color string
3802
+ var resolvedBaseTextColor = getColor(baseTextColorKey, {
3803
+ themeMode: mode
3804
+ });
3805
+ // Resolve the contrasting color string for the base background (used for text in outline/ghost reverse)
3806
+ var contrastingColorForBg = getColor(txtOnBgKey, {
3807
+ themeMode: mode
3808
+ });
3809
+ // Resolve the contrasting color string for the base text color (used for text in ghost reverse)
3810
+ var isBaseTextLight = contrast(resolvedBaseTextColor) === 'light';
3811
+ var contrastingColorForBaseText = getColor(isBaseTextLight ? 'color.black' : 'color.white', {
3812
+ themeMode: mode
3813
+ });
3814
+ // --- Button Variant Styles Function ---
3815
+ // This function calculates the styles based on the current state (base, hover, active)
3816
+ var getButtonVariantStyles = _ref2 => {
3817
+ var {
3818
+ currentVariant,
3819
+ currentEffect,
3820
+ resolvedBg,
3821
+ // Resolved base background color string (bg)
3822
+ resolvedBaseTextColor,
3823
+ // Resolved base text color string
3824
+ contrastingColorForBg,
3825
+ // Resolved contrasting color string for resolvedBg
3826
+ contrastingColorForBaseText,
3827
+ // Resolved contrasting color string for resolvedBaseTextColor
3828
+ resolvedBorderColor
3829
+ } = _ref2;
3830
+ // Define the base styles for each variant
3831
+ var baseStyles = {
3832
+ filled: {
3833
+ backgroundColor: resolvedBg,
3834
+ color: resolvedBaseTextColor,
3835
+ borderWidth: 1,
3836
+ borderStyle: 'solid',
3837
+ borderColor: 'transparent'
3780
3838
  },
3781
- _active: {
3782
- backgroundColor: reverse ? buttonColor + "20" : "" + buttonColor,
3783
- transform: 'translateY(0)',
3784
- boxShadow: '0 2px 4px rgba(0, 0, 0, 0.1)'
3785
- }
3786
- },
3787
- outline: {
3788
- backgroundColor: reverse ? buttonColor : 'transparent',
3789
- borderWidth: 1,
3790
- borderStyle: 'solid',
3791
- borderColor: reverse ? buttonColor : colorScheme,
3792
- color: reverse ? 'white' : buttonColor,
3793
- _hover: {
3794
- backgroundColor: reverse ? "" + buttonColor : buttonColor + "10",
3795
- transform: 'translateY(-2px)',
3796
- boxShadow: '0 4px 8px rgba(0, 0, 0, 0.05)'
3839
+ outline: {
3840
+ backgroundColor: 'transparent',
3841
+ color: resolvedBaseTextColor,
3842
+ borderWidth: 1,
3843
+ borderStyle: 'solid',
3844
+ borderColor: resolvedBorderColor
3797
3845
  },
3798
- _active: {
3799
- backgroundColor: reverse ? buttonColor + "b0" : buttonColor + "20",
3800
- transform: 'translateY(0)',
3801
- boxShadow: '0 2px 4px rgba(0, 0, 0, 0.05)'
3802
- }
3803
- },
3804
- link: {
3805
- backgroundColor: 'transparent',
3806
- borderWidth: 0,
3807
- borderStyle: 'none',
3808
- borderColor: 'transparent',
3809
- color: buttonColor,
3810
- textDecoration: reverse ? 'none' : 'underline',
3811
- _hover: {
3812
- opacity: 0.8,
3813
- textDecorationThickness: '2px'
3846
+ link: {
3847
+ backgroundColor: 'transparent',
3848
+ color: resolvedBg,
3849
+ borderWidth: 0,
3850
+ borderStyle: 'none',
3851
+ borderColor: 'transparent',
3852
+ textDecoration: 'underline'
3814
3853
  },
3815
- _active: {
3816
- opacity: 0.8,
3817
- textDecorationThickness: '2px'
3854
+ ghost: {
3855
+ backgroundColor: 'transparent',
3856
+ color: resolvedBaseTextColor,
3857
+ borderWidth: 0,
3858
+ borderStyle: 'none',
3859
+ borderColor: 'transparent'
3818
3860
  }
3819
- },
3820
- ghost: {
3821
- backgroundColor: reverse ? buttonColor : 'transparent',
3822
- color: reverse ? 'white' : buttonColor,
3823
- borderWidth: 0,
3824
- borderStyle: 'none',
3825
- borderColor: 'transparent',
3826
- _hover: {
3827
- backgroundColor: reverse ? "" + buttonColor : buttonColor + "10",
3828
- transform: 'translateY(-2px)'
3861
+ };
3862
+ // Define the styles applied on hover/active when effect is 'reverse'
3863
+ var reverseHoverActiveStyles = {
3864
+ filled: {
3865
+ backgroundColor: 'transparent',
3866
+ color: resolvedBg,
3867
+ borderWidth: 1,
3868
+ borderStyle: 'solid',
3869
+ borderColor: resolvedBg
3829
3870
  },
3830
- _active: {
3831
- backgroundColor: reverse ? buttonColor + "b0" : buttonColor + "20",
3832
- transform: 'translateY(0)'
3871
+ outline: {
3872
+ backgroundColor: resolvedBg,
3873
+ color: contrastingColorForBg,
3874
+ borderWidth: 1,
3875
+ borderStyle: 'solid',
3876
+ borderColor: 'transparent'
3877
+ },
3878
+ link: {
3879
+ backgroundColor: 'transparent',
3880
+ color: resolvedBg,
3881
+ borderWidth: 0,
3882
+ borderStyle: 'none',
3883
+ borderColor: 'transparent',
3884
+ textDecoration: 'none'
3885
+ },
3886
+ ghost: {
3887
+ backgroundColor: resolvedBg,
3888
+ color: contrastingColorForBaseText,
3889
+ borderWidth: 0,
3890
+ borderStyle: 'none',
3891
+ borderColor: 'transparent'
3833
3892
  }
3834
- }
3893
+ };
3894
+ // General hover/active effects (transform, shadow, opacity, etc.)
3895
+ var generalHoverStyles = {
3896
+ transform: 'translateY(2px)',
3897
+ boxShadow: currentVariant === 'link' ? undefined : '0 4px 8px rgba(0, 0, 0, 0.1)',
3898
+ // opacity: currentVariant === 'link' ? 0.8 : undefined,
3899
+ textDecorationThickness: currentVariant === 'link' ? '2px' : undefined
3900
+ };
3901
+ var generalActiveStyles = {
3902
+ transform: 'translateY(-1px)',
3903
+ boxShadow: '0 2px 4px rgba(0, 0, 0, 0.1)',
3904
+ opacity: currentVariant === 'link' ? 0.8 : undefined,
3905
+ textDecorationThickness: currentVariant === 'link' ? '2px' : undefined
3906
+ };
3907
+ // Combine base styles with conditional hover/active overrides
3908
+ return Object.assign({}, baseStyles[currentVariant], {
3909
+ _hover: Object.assign({}, currentEffect === 'reverse' ? reverseHoverActiveStyles[currentVariant] : {}, currentEffect === 'hover' ? {
3910
+ filter: 'brightness(0.85)'
3911
+ } : {}, generalHoverStyles),
3912
+ _active: Object.assign({}, currentEffect === 'reverse' ? reverseHoverActiveStyles[currentVariant] : {}, currentEffect === 'hover' ? {
3913
+ filter: 'brightness(0.7)'
3914
+ } : {}, generalActiveStyles)
3915
+ });
3835
3916
  };
3917
+ // Get the calculated variant styles for the current state
3918
+ var buttonVariantStyles = getButtonVariantStyles({
3919
+ currentVariant: variant,
3920
+ currentEffect: effect,
3921
+ resolvedBg: bg,
3922
+ resolvedBaseTextColor: resolvedBaseTextColor,
3923
+ contrastingColorForBg: contrastingColorForBg,
3924
+ contrastingColorForBaseText: contrastingColorForBaseText,
3925
+ resolvedBorderColor: bg
3926
+ });
3927
+ // Extract hover and active styles from the calculated styles
3928
+ var {
3929
+ _hover,
3930
+ _active
3931
+ } = buttonVariantStyles,
3932
+ baseButtonVariantStyles = _objectWithoutPropertiesLoose(buttonVariantStyles, _excluded2$3);
3836
3933
  var buttonSizeStyles = ButtonSizes[size];
3837
- var buttonVariant = ButtonVariants[variant];
3838
3934
  var scaleWidth = {
3839
3935
  width: isAuto === true ? 'fit-content' : isFilled ? '100%' : buttonSizeStyles.width
3840
3936
  };
@@ -3847,62 +3943,68 @@ var ButtonView = _ref => {
3847
3943
  alignItems: "center",
3848
3944
  justifyContent: "center"
3849
3945
  }, views == null ? void 0 : views.container), isLoading && loaderPosition === 'left' && (/*#__PURE__*/React__default.createElement(Loader, Object.assign({
3850
- size: size === 'xs' || size === 'sm' ? 'sm' : 'md'
3946
+ size: size === 'xs' || size === 'sm' ? 'sm' : 'md',
3947
+ color: baseButtonVariantStyles.color
3851
3948
  }, loaderProps))), icon && ['left', 'top'].includes(iconPosition) && !isLoading && (/*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
3852
3949
  display: "flex",
3853
3950
  alignItems: "center",
3854
- justifyContent: "center"
3951
+ justifyContent: "center",
3952
+ color: baseButtonVariantStyles.color
3855
3953
  }, views == null ? void 0 : views.icon), icon)), children, icon && ['right', 'bottom'].includes(iconPosition) && !isLoading && (/*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
3856
3954
  display: "flex",
3857
3955
  alignItems: "center",
3858
- justifyContent: "center"
3956
+ justifyContent: "center",
3957
+ color: baseButtonVariantStyles.color
3859
3958
  }, views == null ? void 0 : views.icon), icon)), isLoading && loaderPosition === 'right' && (/*#__PURE__*/React__default.createElement(Loader, Object.assign({
3860
- size: size === 'xs' || size === 'sm' ? 'sm' : 'md'
3959
+ size: size === 'xs' || size === 'sm' ? 'sm' : 'md',
3960
+ color: baseButtonVariantStyles.color
3861
3961
  }, loaderProps))));
3862
- // Extract hover and active styles from buttonVariant
3863
- var _ref2 = buttonVariant || {},
3864
- {
3865
- _hover,
3866
- _active
3867
- } = _ref2,
3868
- baseButtonVariant = _objectWithoutPropertiesLoose(_ref2, _excluded2$3);
3962
+ // Determine if the button should render as a Link or a button Element
3963
+ var isLink = variant === 'link' && to;
3869
3964
  return /*#__PURE__*/React__default.createElement(appStudio.Element, Object.assign({
3870
3965
  gap: 8,
3871
- as: "button",
3872
- type: "button",
3966
+ as: isLink ? 'div' : 'button',
3967
+ type: isLink ? undefined : 'button',
3873
3968
  display: "flex",
3874
3969
  alignItems: "center",
3875
3970
  justifyContent: "center",
3876
3971
  "aria-label": ariaLabel,
3877
- backgroundColor: "transparent",
3972
+ // backgroundColor="transparent" // Remove this unless it's intended to override variant styles
3878
3973
  borderRadius: ButtonShapes[shape],
3879
3974
  onClick: (_props$onClick = props.onClick) != null ? _props$onClick : onClick,
3880
3975
  onMouseEnter: () => handleHover(true),
3881
3976
  onMouseLeave: () => handleHover(false),
3882
- cursor: isActive ? 'pointer' : 'default',
3883
- filter: hovering && effect === 'hover' ? 'brightness(0.85)' : 'brightness(1)',
3977
+ cursor: isActive ? isLink ? 'pointer' : 'pointer' : 'default',
3884
3978
  transition: "all 0.2s ease",
3885
- transform: hovering && effect === 'hover' && !isDisabled ? 'translateY(-5px)' : '',
3886
- // Apply consistent styling according to design guidelines
3979
+ // filter and transform are now handled within _hover/_active styles
3887
3980
  // Apply shadow if provided
3888
3981
  boxShadow: shadow ? shadow : undefined
3889
3982
  }, defaultNativeProps, (_ref3 => {
3890
3983
  var rest = _objectWithoutPropertiesLoose(_ref3, _excluded3$3);
3891
3984
  return rest;
3892
- })(props), buttonSizeStyles, baseButtonVariant, scaleWidth, props.padding || props.paddingHorizontal || props.paddingVertical || props.paddingLeft || props.paddingRight || props.paddingTop || props.paddingBottom ? {} : changePadding, {
3985
+ })(props), buttonSizeStyles, baseButtonVariantStyles, scaleWidth, props.padding || props.paddingHorizontal || props.paddingVertical || props.paddingLeft || props.paddingRight || props.paddingTop || props.paddingBottom ? {} : changePadding, {
3893
3986
  // Apply hover and active styles
3894
3987
  _hover: _hover,
3895
3988
  _active: _active
3896
- }, views == null ? void 0 : views.container), variant === 'link' && to ? (/*#__PURE__*/React__default.createElement(Link, Object.assign({
3989
+ }), to ? (/*#__PURE__*/React__default.createElement(Link, Object.assign({
3897
3990
  to: to,
3898
- textDecorationColor: colorScheme,
3899
- textDecorationThickness: "1px",
3991
+ isExternal: isExternal,
3992
+ // Link styles should inherit from the button's calculated styles or be defined here
3993
+ // Let's apply relevant styles from the button variant to the Link
3994
+ color: baseButtonVariantStyles.color,
3995
+ textDecoration: baseButtonVariantStyles.textDecoration,
3996
+ textDecorationColor: baseButtonVariantStyles.color,
3997
+ textDecorationThickness: "1px" // Base thickness
3998
+ ,
3900
3999
  textUnderlineOffset: "2px",
3901
4000
  transition: "all 0.2s ease",
3902
- isExternal: isExternal,
3903
- _hover: {
4001
+ // Apply Link-specific hover/active styles if needed, or let Element's _hover/_active handle it
4002
+ _hover: Object.assign({}, _hover, {
3904
4003
  textDecorationThickness: '2px'
3905
- }
4004
+ }),
4005
+ _active: Object.assign({}, _active, {
4006
+ textDecorationThickness: '2px'
4007
+ })
3906
4008
  }, views == null ? void 0 : views.link), content)) : content);
3907
4009
  };
3908
4010
 
@@ -3955,30 +4057,29 @@ var CardShapes = {
3955
4057
  * Get card variants with consistent styling based on theme mode
3956
4058
  */
3957
4059
  var getCardVariants = themeMode => {
3958
- var isDarkMode = themeMode === 'dark';
3959
4060
  return {
3960
4061
  default: {
3961
- backgroundColor: isDarkMode ? 'color.gray.800' : 'white',
4062
+ backgroundColor: 'color.white',
3962
4063
  border: 'none',
3963
4064
  transition: 'all 0.2s ease'
3964
4065
  },
3965
4066
  outlined: {
3966
- backgroundColor: isDarkMode ? 'color.gray.800' : 'white',
4067
+ backgroundColor: 'color.white',
3967
4068
  borderWidth: '1px',
3968
4069
  borderStyle: 'solid',
3969
- borderColor: isDarkMode ? 'color.gray.700' : 'color.gray.200',
4070
+ borderColor: 'color.gray.200',
3970
4071
  transition: 'all 0.2s ease',
3971
4072
  _hover: {
3972
- borderColor: isDarkMode ? 'color.gray.600' : 'color.gray.300'
4073
+ borderColor: 'color.gray.300'
3973
4074
  }
3974
4075
  },
3975
4076
  elevated: {
3976
- backgroundColor: isDarkMode ? 'color.gray.800' : 'white',
3977
- boxShadow: isDarkMode ? '0px 2px 8px rgba(0, 0, 0, 0.2)' : '0px 2px 8px rgba(0, 0, 0, 0.08)',
4077
+ backgroundColor: 'color.white',
4078
+ boxShadow: '0px 2px 8px rgba(0, 0, 0, 0.08)',
3978
4079
  border: 'none',
3979
4080
  transition: 'all 0.2s ease',
3980
4081
  _hover: {
3981
- boxShadow: isDarkMode ? '0px 4px 12px rgba(0, 0, 0, 0.25)' : '0px 4px 12px rgba(0, 0, 0, 0.12)',
4082
+ boxShadow: '0px 4px 12px rgba(0, 0, 0, 0.12)',
3982
4083
  transform: 'translateY(-2px)'
3983
4084
  }
3984
4085
  }
@@ -3989,14 +4090,10 @@ var getCardVariants = themeMode => {
3989
4090
  * @param theme - Theme object from useTheme hook
3990
4091
  */
3991
4092
  var getDefaultCardStyles = theme => {
3992
- var {
3993
- themeMode
3994
- } = theme;
3995
- var isDarkMode = themeMode === 'dark';
3996
4093
  return {
3997
4094
  container: {
3998
- backgroundColor: isDarkMode ? 'color.gray.800' : 'white',
3999
- color: isDarkMode ? 'color.gray.100' : 'color.gray.900',
4095
+ backgroundColor: 'color.white',
4096
+ color: 'color.black',
4000
4097
  borderRadius: '8px',
4001
4098
  overflow: 'hidden',
4002
4099
  transition: 'all 0.2s ease'
@@ -4005,17 +4102,18 @@ var getDefaultCardStyles = theme => {
4005
4102
  padding: '16px',
4006
4103
  borderBottomWidth: '1px',
4007
4104
  borderBottomStyle: 'solid',
4008
- borderBottomColor: isDarkMode ? 'color.gray.700' : 'color.gray.200'
4105
+ borderBottomColor: 'color.gray.200',
4106
+ color: 'color.black'
4009
4107
  },
4010
4108
  content: {
4011
4109
  padding: '16px',
4012
- color: isDarkMode ? 'color.gray.100' : 'color.gray.900'
4110
+ color: 'color.black'
4013
4111
  },
4014
4112
  footer: {
4015
4113
  padding: '16px',
4016
4114
  borderTopWidth: '1px',
4017
4115
  borderTopStyle: 'solid',
4018
- borderTopColor: isDarkMode ? 'color.gray.700' : 'color.gray.200'
4116
+ borderTopColor: 'color.gray.200'
4019
4117
  }
4020
4118
  };
4021
4119
  };
@@ -4040,7 +4138,7 @@ var CardHeader = _ref => {
4040
4138
  var {
4041
4139
  styles: contextStyles
4042
4140
  } = useCardContext();
4043
- var defaultStyles = getDefaultCardStyles(theme).header;
4141
+ var defaultStyles = getDefaultCardStyles().header;
4044
4142
  // Merge styles: Default < Context Override < Direct Props/Style
4045
4143
  var mergedProps = Object.assign({}, defaultStyles, contextStyles == null ? void 0 : contextStyles.header, props, {
4046
4144
  style: Object.assign({}, defaultStyles == null ? void 0 : defaultStyles.style, contextStyles == null || (_contextStyles$header = contextStyles.header) == null ? void 0 : _contextStyles$header.style, style)
@@ -4058,7 +4156,7 @@ var CardContent = _ref2 => {
4058
4156
  var {
4059
4157
  styles: contextStyles
4060
4158
  } = useCardContext();
4061
- var defaultStyles = getDefaultCardStyles(theme).content;
4159
+ var defaultStyles = getDefaultCardStyles().content;
4062
4160
  // Merge styles: Default < Context Override < Direct Props/Style
4063
4161
  var mergedProps = Object.assign({}, defaultStyles, contextStyles == null ? void 0 : contextStyles.content, props, {
4064
4162
  style: Object.assign({}, defaultStyles == null ? void 0 : defaultStyles.style, contextStyles == null || (_contextStyles$conten = contextStyles.content) == null ? void 0 : _contextStyles$conten.style, style)
@@ -4076,7 +4174,7 @@ var CardFooter = _ref3 => {
4076
4174
  var {
4077
4175
  styles: contextStyles
4078
4176
  } = useCardContext();
4079
- var defaultStyles = getDefaultCardStyles(theme).footer;
4177
+ var defaultStyles = getDefaultCardStyles().footer;
4080
4178
  // Merge styles: Default < Context Override < Direct Props/Style
4081
4179
  var mergedProps = Object.assign({}, defaultStyles, contextStyles == null ? void 0 : contextStyles.footer, props, {
4082
4180
  style: Object.assign({}, defaultStyles == null ? void 0 : defaultStyles.style, contextStyles == null || (_contextStyles$footer = contextStyles.footer) == null ? void 0 : _contextStyles$footer.style, style)
@@ -4099,7 +4197,7 @@ var CardView = _ref4 => {
4099
4197
  } = _ref4,
4100
4198
  props = _objectWithoutPropertiesLoose(_ref4, _excluded4$3);
4101
4199
  var theme = appStudio.useTheme();
4102
- var defaultStyles = getDefaultCardStyles(theme);
4200
+ var defaultStyles = getDefaultCardStyles();
4103
4201
  // Prepare context value, merging default styles with user's `views` overrides
4104
4202
  var contextValue = React.useMemo(() => ({
4105
4203
  styles: {
@@ -4112,12 +4210,7 @@ var CardView = _ref4 => {
4112
4210
  // Determine if we have explicit Card.Header, Card.Content, Card.Footer components
4113
4211
  // or if we need to wrap children in a default layout
4114
4212
  var hasExplicitStructure = React__default.Children.toArray(children).some(child => /*#__PURE__*/React__default.isValidElement(child) && (child.type === CardHeader || child.type === CardContent || child.type === CardFooter));
4115
- // Get the appropriate variant styles based on theme mode
4116
- var {
4117
- themeMode
4118
- } = theme;
4119
- var currentThemeMode = elementMode || themeMode;
4120
- var variantStyles = getCardVariants(currentThemeMode)[variant];
4213
+ var variantStyles = getCardVariants()[variant];
4121
4214
  // Merge styles for the root element
4122
4215
  var mergedRootProps = Object.assign({
4123
4216
  width: isFullWidth ? '100%' : 'auto',
@@ -4364,7 +4457,7 @@ var ActiveIndicatorStyles = {
4364
4457
  },
4365
4458
  number: {
4366
4459
  backgroundColor: 'theme.primary',
4367
- color: 'white'
4460
+ color: 'color.white'
4368
4461
  }
4369
4462
  };
4370
4463
  var NavigationButtonStyles = {
@@ -4439,7 +4532,7 @@ var _excluded$c = ["children", "isActive", "views"],
4439
4532
  _excluded3$5 = ["views", "children"],
4440
4533
  _excluded4$4 = ["children", "views"],
4441
4534
  _excluded5$1 = ["children", "views", "style"],
4442
- _excluded6$1 = ["children", "defaultActiveIndex", "activeIndex", "onChange", "showNavigation", "navigationPosition", "prevButton", "nextButton", "showIndicators", "indicatorPosition", "indicatorVariant", "autoPlay", "autoPlayInterval", "pauseOnHover", "infinite", "direction", "transitionDuration", "views", "themeMode"];
4535
+ _excluded6$1 = ["children", "defaultActiveIndex", "activeIndex", "onChange", "showNavigation", "navigationPosition", "prevButton", "nextButton", "showIndicators", "indicatorPosition", "indicatorVariant", "autoPlay", "autoPlayInterval", "pauseOnHover", "infinite", "direction", "transitionDuration", "views", "stepIndices", "themeMode"];
4443
4536
  var CarouselSlide = _ref => {
4444
4537
  var {
4445
4538
  children,
@@ -4809,7 +4902,7 @@ var LegendTextStyles = {
4809
4902
  // Default styles for tooltip
4810
4903
  var TooltipStyles = {
4811
4904
  position: 'absolute',
4812
- backgroundColor: 'white',
4905
+ backgroundColor: 'color.white',
4813
4906
  padding: '8px 12px',
4814
4907
  borderRadius: '4px',
4815
4908
  boxShadow: '0 2px 5px rgba(0, 0, 0, 0.1)',
@@ -5646,7 +5739,7 @@ var ContextMenuSizes = {
5646
5739
  };
5647
5740
  var ContextMenuVariants = {
5648
5741
  default: {
5649
- backgroundColor: 'white',
5742
+ backgroundColor: 'color.white',
5650
5743
  color: 'color.gray.800'
5651
5744
  },
5652
5745
  filled: {
@@ -5654,7 +5747,7 @@ var ContextMenuVariants = {
5654
5747
  color: 'color.gray.800'
5655
5748
  },
5656
5749
  outline: {
5657
- backgroundColor: 'white',
5750
+ backgroundColor: 'color.white',
5658
5751
  borderWidth: '1px',
5659
5752
  borderStyle: 'solid',
5660
5753
  borderColor: 'color.gray.200',
@@ -6324,7 +6417,7 @@ var InputVariants = {
6324
6417
  borderWidth: '1px',
6325
6418
  borderStyle: 'solid',
6326
6419
  borderColor: 'color.gray.200',
6327
- backgroundColor: 'white',
6420
+ backgroundColor: 'color.white',
6328
6421
  transition: 'all 0.2s ease',
6329
6422
  _hover: {
6330
6423
  borderColor: 'color.gray.300'
@@ -6332,17 +6425,6 @@ var InputVariants = {
6332
6425
  _focus: {
6333
6426
  borderColor: 'theme.primary',
6334
6427
  boxShadow: '0 0 0 1px rgba(66, 153, 225, 0.2)'
6335
- },
6336
- '@media (prefers-color-scheme: dark)': {
6337
- backgroundColor: 'color.gray.800',
6338
- borderColor: 'color.gray.700',
6339
- _hover: {
6340
- borderColor: 'color.gray.600'
6341
- },
6342
- _focus: {
6343
- borderColor: 'theme.primary',
6344
- boxShadow: '0 0 0 1px rgba(66, 153, 225, 0.4)'
6345
- }
6346
6428
  }
6347
6429
  },
6348
6430
  default: {
@@ -6351,23 +6433,13 @@ var InputVariants = {
6351
6433
  borderBottomStyle: 'solid',
6352
6434
  borderBottomColor: 'color.gray.200',
6353
6435
  borderRadius: 0,
6354
- backgroundColor: 'white',
6436
+ backgroundColor: 'color.white',
6355
6437
  transition: 'all 0.2s ease',
6356
6438
  _hover: {
6357
6439
  borderBottomColor: 'color.gray.300'
6358
6440
  },
6359
6441
  _focus: {
6360
6442
  borderBottomColor: 'theme.primary'
6361
- },
6362
- '@media (prefers-color-scheme: dark)': {
6363
- backgroundColor: 'color.gray.800',
6364
- borderBottomColor: 'color.gray.700',
6365
- _hover: {
6366
- borderBottomColor: 'color.gray.600'
6367
- },
6368
- _focus: {
6369
- borderBottomColor: 'theme.primary'
6370
- }
6371
6443
  }
6372
6444
  },
6373
6445
  none: {
@@ -6499,7 +6571,7 @@ var HeadingSizes$1 = {
6499
6571
  }
6500
6572
  };
6501
6573
 
6502
- var _excluded$l = ["children", "heading", "isItalic", "isUnderlined", "isStriked", "weight", "size"];
6574
+ var _excluded$l = ["children", "heading", "isItalic", "isUnderlined", "isStriked", "weight", "size", "dropDown"];
6503
6575
  var LabelView = _ref => {
6504
6576
  var {
6505
6577
  children,
@@ -6709,11 +6781,7 @@ var SelectBox = _ref2 => {
6709
6781
  // State properties
6710
6782
  cursor: isDisabled ? 'not-allowed' : 'pointer',
6711
6783
  // Animation
6712
- transition: 'all 0.2s ease',
6713
- // Dark mode support
6714
- '@media (prefers-color-scheme: dark)': {
6715
- color: isDisabled ? 'color.gray.600' : 'color.gray.100'
6716
- }
6784
+ transition: 'all 0.2s ease'
6717
6785
  }, views['field'], views['text']);
6718
6786
  var option = options.length > 0 && options.find(option => option.value === value);
6719
6787
  return /*#__PURE__*/React__default.createElement(Text, Object.assign({}, fieldStyles), (value === '' || Array.isArray(value) && value.length === 0) && !!placeholder ? placeholder : (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, typeof value === 'string' ? (_ref3 = option && option.label) != null ? _ref3 : value :
@@ -6772,9 +6840,7 @@ var HiddenSelect = _ref4 => {
6772
6840
  var DropDown = _ref5 => {
6773
6841
  var {
6774
6842
  size,
6775
- views = {
6776
- dropDown: {}
6777
- },
6843
+ views = {},
6778
6844
  options,
6779
6845
  callback = () => {},
6780
6846
  highlightedIndex,
@@ -6803,7 +6869,7 @@ var DropDown = _ref5 => {
6803
6869
  ,
6804
6870
  overflowY: "auto",
6805
6871
  zIndex: 1000,
6806
- backgroundColor: "white",
6872
+ backgroundColor: "color.white",
6807
6873
  borderRadius: "8px" // Consistent with design system (rounded-md)
6808
6874
  ,
6809
6875
  borderWidth: "1px",
@@ -6824,7 +6890,7 @@ var DropDown = _ref5 => {
6824
6890
  borderRadius: '4px'
6825
6891
  }
6826
6892
  }
6827
- }, shadow, views['dropDown']), options.length > 0 && options.map((option, index) => (/*#__PURE__*/React__default.createElement(Item, Object.assign({
6893
+ }, shadow, views == null ? void 0 : views.dropDown), options.length > 0 && options.map((option, index) => (/*#__PURE__*/React__default.createElement(Item, Object.assign({
6828
6894
  key: option.value,
6829
6895
  size: size,
6830
6896
  style: views['text'],
@@ -7134,7 +7200,7 @@ var ColorSchemes = {
7134
7200
  }
7135
7201
  };
7136
7202
 
7137
- var _excluded$p = ["id", "name", "label", "inActiveChild", "activeChild", "labelPosition", "shadow", "size", "value", "isHovered", "isDisabled", "isReadOnly", "on", "setOn", "onChange", "setValue", "setIsHovered", "helperText", "views"];
7203
+ var _excluded$p = ["id", "name", "label", "inActiveChild", "isChecked", "activeChild", "labelPosition", "shadow", "size", "value", "isHovered", "isDisabled", "isReadOnly", "on", "setOn", "onChange", "setValue", "setIsHovered", "helperText", "views"];
7138
7204
  var SwitchContent = props => /*#__PURE__*/React__default.createElement(appStudio.Input, Object.assign({
7139
7205
  type: "checkbox"
7140
7206
  }, props));
@@ -7512,7 +7578,9 @@ var TextFieldView = _ref => {
7512
7578
  getColor,
7513
7579
  themeMode
7514
7580
  } = appStudio.useTheme();
7515
- var IconColor = getColor('color.blueGray.700', elementMode ? elementMode : themeMode);
7581
+ var IconColor = getColor('color.blueGray.700', {
7582
+ themeMode: elementMode ? elementMode : themeMode
7583
+ });
7516
7584
  var showLabel = !!(isFocused && label);
7517
7585
  /**
7518
7586
  * Styles for the input field
@@ -7541,11 +7609,7 @@ var TextFieldView = _ref => {
7541
7609
  // State properties
7542
7610
  cursor: isDisabled ? 'not-allowed' : 'text',
7543
7611
  // Animation
7544
- transition: 'all 0.2s ease',
7545
- // Dark mode support
7546
- '@media (prefers-color-scheme: dark)': {
7547
- color: isDisabled ? 'color.gray.600' : 'color.gray.100'
7548
- }
7612
+ transition: 'all 0.2s ease'
7549
7613
  }, views['field']);
7550
7614
  var handleFocus = () => {
7551
7615
  setIsFocused(true);
@@ -7702,19 +7766,19 @@ var VariantStyles = {
7702
7766
  selected: {
7703
7767
  backgroundColor: 'theme.primary',
7704
7768
  borderColor: 'theme.primary',
7705
- color: 'white'
7769
+ color: 'color.white'
7706
7770
  },
7707
7771
  unselected: {
7708
- backgroundColor: 'transparent',
7772
+ backgroundColor: 'color.white',
7709
7773
  borderWidth: '2px',
7710
7774
  borderStyle: 'solid',
7711
7775
  borderColor: 'color.gray.300',
7712
- color: 'transparent'
7776
+ color: 'color.black'
7713
7777
  },
7714
7778
  indeterminate: {
7715
7779
  backgroundColor: 'theme.primary',
7716
7780
  borderColor: 'theme.primary',
7717
- color: 'white'
7781
+ color: 'color.white'
7718
7782
  }
7719
7783
  };
7720
7784
  /**
@@ -9448,7 +9512,7 @@ var DropDown$1 = _ref4 => {
9448
9512
  borderRadius: 4,
9449
9513
  position: "absolute",
9450
9514
  flexDirection: "column",
9451
- backgroundColor: "white",
9515
+ backgroundColor: "color.white",
9452
9516
  boxShadow: "rgba(0, 0, 0, 0.07) 0px 1px 1px, rgba(0, 0, 0, 0.07) 0px 2px 2px, rgba(0, 0, 0, 0.07) 0px 4px 4px, rgba(0, 0, 0, 0.07) 0px 8px 8px, rgba(0, 0, 0, 0.07) 0px 16px 16px"
9453
9517
  }, views['dropDown']), options.map(option => (/*#__PURE__*/React__default.createElement(DropDownItem, Object.assign({
9454
9518
  key: option.code,
@@ -9498,7 +9562,9 @@ var CountryPickerView = _ref5 => {
9498
9562
  getColor,
9499
9563
  themeMode
9500
9564
  } = appStudio.useTheme();
9501
- var IconColor = getColor('color.blueGray.700', elementMode ? elementMode : themeMode);
9565
+ var IconColor = getColor('color.blueGray.700', {
9566
+ themeMode: elementMode ? elementMode : themeMode
9567
+ });
9502
9568
  var handleHover = () => setIsHovered(!isHovered);
9503
9569
  var handleFocus = () => setIsFocused(true);
9504
9570
  var handleCallback = option => {
@@ -9526,8 +9592,8 @@ var CountryPickerView = _ref5 => {
9526
9592
  var showLabel = !!(label && (isFocused || value));
9527
9593
  var fieldStyles = Object.assign({
9528
9594
  margin: 0,
9529
- paddingVerical: 8,
9530
- paddingHorizonatl: 0,
9595
+ paddingVertical: 8,
9596
+ paddingHorizontal: 0,
9531
9597
  width: '100%',
9532
9598
  heigth: '100%',
9533
9599
  border: 'none',
@@ -9875,7 +9941,7 @@ var ComboBoxView = _ref => {
9875
9941
  position: "relative"
9876
9942
  }, /*#__PURE__*/React__default.createElement(appStudio.Horizontal, Object.assign({
9877
9943
  cursor: "pointer",
9878
- backgroundColor: "white",
9944
+ backgroundColor: "color.white",
9879
9945
  boxShadow: "rgba(0, 0, 0, 0.16) 0px 1px 4px",
9880
9946
  padding: "12px",
9881
9947
  display: "flex",
@@ -9897,7 +9963,7 @@ var ComboBoxView = _ref => {
9897
9963
  }, views == null ? void 0 : views.label), selectedItem.label)), right, isDropdownVisible && (/*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
9898
9964
  id: "combobox-dropdown",
9899
9965
  position: "absolute",
9900
- backgroundColor: "white",
9966
+ backgroundColor: "color.white",
9901
9967
  boxShadow: "rgba(0, 0 ,0 ,0.16) 0px 1px 4px",
9902
9968
  width: "100%",
9903
9969
  overflowY: "auto",
@@ -9991,6 +10057,12 @@ var useOTPInputState = _ref => {
9991
10057
  onChange,
9992
10058
  onChangeText,
9993
10059
  onComplete,
10060
+ onKeyDown,
10061
+ onKeyPress,
10062
+ onBlur,
10063
+ onFocus,
10064
+ isReadOnly,
10065
+ isDisabled,
9994
10066
  pattern,
9995
10067
  stepValues,
9996
10068
  pasteTransformer
@@ -10104,6 +10176,16 @@ var useOTPInputState = _ref => {
10104
10176
  var handleKeyDown = React.useCallback(_ => {
10105
10177
  // Handle special keys like backspace, arrows, etc.
10106
10178
  // This is handled by the browser for the single input
10179
+ if (onKeyDown) {
10180
+ onKeyDown(_);
10181
+ }
10182
+ }, []);
10183
+ var handleKeyPress = React.useCallback(e => {
10184
+ // Handle key press events
10185
+ // This is handled by the browser for the single input
10186
+ if (onKeyPress) {
10187
+ onKeyPress(e);
10188
+ }
10107
10189
  }, []);
10108
10190
  var handlePaste = React.useCallback(e => {
10109
10191
  var input = inputRef.current;
@@ -10260,11 +10342,12 @@ var useOTPInputState = _ref => {
10260
10342
  handleFocus,
10261
10343
  handleBlur,
10262
10344
  handleKeyDown,
10345
+ handleKeyPress,
10263
10346
  handlePaste
10264
10347
  };
10265
10348
  };
10266
10349
 
10267
- var _excluded$y = ["id", "name", "label", "value", "length", "onChange", "onChangeText", "onComplete", "helperText", "placeholder", "shadow", "views", "size", "shape", "variant", "gap", "type", "error", "isFocused", "isHovered", "isDisabled", "isReadOnly", "isAutoFocus", "setValue", "setIsFocused", "setIsHovered", "inputRef", "containerRef", "mirrorSelectionStart", "mirrorSelectionEnd", "setMirrorSelectionStart", "setMirrorSelectionEnd", "handlePaste", "handleChange", "handleFocus", "handleBlur", "handleKeyDown", "stepValues", "setInputRef", "onBlur", "onClick", "onFocus"];
10350
+ var _excluded$y = ["id", "name", "label", "value", "length", "onChange", "onChangeText", "onComplete", "helperText", "placeholder", "shadow", "views", "size", "shape", "variant", "gap", "type", "error", "isFocused", "isHovered", "isDisabled", "isReadOnly", "isAutoFocus", "setValue", "setIsFocused", "setIsHovered", "inputRef", "containerRef", "mirrorSelectionStart", "mirrorSelectionEnd", "setMirrorSelectionStart", "setMirrorSelectionEnd", "handlePaste", "handleChange", "handleFocus", "handleBlur", "handleKeyDown", "handleKeyPress", "secureTextEntry", "isFirstColumn", "stepValues", "setInputRef", "onBlur", "onClick", "onFocus"];
10268
10351
  // Create a context for OTP input slots
10269
10352
  var OTPInputContext = /*#__PURE__*/React.createContext({
10270
10353
  slots: [],
@@ -10272,7 +10355,7 @@ var OTPInputContext = /*#__PURE__*/React.createContext({
10272
10355
  isHovering: false
10273
10356
  });
10274
10357
  // CSS for noscript fallback
10275
- var NOSCRIPT_CSS_FALLBACK = "\n@keyframes blink {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0; }\n}\n\n[data-input-otp] {\n --nojs-bg: white !important;\n --nojs-fg: black !important;\n\n background-color: var(--nojs-bg) !important;\n color: var(--nojs-fg) !important;\n caret-color: var(--nojs-fg) !important;\n letter-spacing: .25em !important;\n text-align: center !important;\n border: 1px solid var(--nojs-fg) !important;\n border-radius: 4px !important;\n width: 100% !important;\n}\n@media (prefers-color-scheme: dark) {\n [data-input-otp] {\n --nojs-bg: black !important;\n --nojs-fg: white !important;\n }\n}";
10358
+ var NOSCRIPT_CSS_FALLBACK = "\n@keyframes blink {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0; }\n}\n\n[data-input-otp] {\n --nojs-bg: white !important;\n --nojs-fg: black !important;\n\n background-color: var(--nojs-bg) !important;\n color: var(--nojs-fg) !important;\n caret-color: var(--nojs-fg) !important;\n letter-spacing: .25em !important;\n text-align: center !important;\n border: 1px solid var(--nojs-fg) !important;\n border-radius: 4px !important;\n width: 100% !important;\n}\n";
10276
10359
  // Helper function to safely insert CSS rules
10277
10360
  function safeInsertRule(sheet, rule) {
10278
10361
  try {
@@ -10520,7 +10603,8 @@ var OTPInputComponent = props => {
10520
10603
  handleFocus,
10521
10604
  handleBlur,
10522
10605
  handleKeyDown,
10523
- handlePaste
10606
+ handlePaste,
10607
+ handleKeyPress
10524
10608
  } = useOTPInputState(props);
10525
10609
  // Use the controlled value if it exists, otherwise use the internal state value
10526
10610
  var displayValue = controlledValue !== undefined ? controlledValue : value;
@@ -10542,6 +10626,7 @@ var OTPInputComponent = props => {
10542
10626
  handleFocus: handleFocus,
10543
10627
  handleBlur: handleBlur,
10544
10628
  handleKeyDown: handleKeyDown,
10629
+ handleKeyPress: handleKeyPress,
10545
10630
  handlePaste: handlePaste,
10546
10631
  stepValues: props.stepValues
10547
10632
  }));
@@ -11095,7 +11180,7 @@ var OrientationStyles = {
11095
11180
  }
11096
11181
  };
11097
11182
 
11098
- var _excluded$F = ["min", "max", "step", "currentValue", "stepValues", "shape", "size", "variant", "orientation", "isDisabled", "showValue", "showTooltip", "colorScheme", "label", "helperText", "themeMode", "shadow", "isDragging", "isHovered", "setIsHovered", "trackRef", "thumbRef", "handleThumbMouseDown", "handleTrackMouseDown", "handleKeyDown", "thumbPositionPercent", "ariaLabel", "views"];
11183
+ var _excluded$F = ["min", "max", "step", "currentValue", "stepValues", "shape", "size", "variant", "orientation", "isDisabled", "showValue", "showTooltip", "backgroundColor", "label", "helperText", "themeMode", "shadow", "isDragging", "isHovered", "setIsHovered", "trackRef", "thumbRef", "handleThumbMouseDown", "handleTrackMouseDown", "handleKeyDown", "thumbPositionPercent", "ariaLabel", "views"];
11099
11184
  var SliderView = _ref => {
11100
11185
  var _views$tooltip, _views$tooltip2;
11101
11186
  var {
@@ -11111,7 +11196,7 @@ var SliderView = _ref => {
11111
11196
  isDisabled = false,
11112
11197
  showValue = false,
11113
11198
  showTooltip = false,
11114
- colorScheme = 'theme.primary',
11199
+ backgroundColor = 'theme.primary',
11115
11200
  label,
11116
11201
  helperText,
11117
11202
  themeMode: elementMode,
@@ -11143,9 +11228,15 @@ var SliderView = _ref => {
11143
11228
  getColor,
11144
11229
  themeMode
11145
11230
  } = appStudio.useTheme();
11146
- var themeColor = getColor(colorScheme, elementMode || themeMode);
11147
- var disabledColor = getColor('theme.disabled', elementMode || themeMode);
11148
- var trackColor = getColor(SliderVariants[variant].backgroundColor, elementMode || themeMode);
11231
+ var themeColor = getColor(backgroundColor, {
11232
+ themeMode: elementMode || themeMode
11233
+ });
11234
+ var disabledColor = getColor('theme.disabled', {
11235
+ themeMode: elementMode || themeMode
11236
+ });
11237
+ var trackColor = getColor(SliderVariants[variant].backgroundColor, {
11238
+ themeMode: elementMode || themeMode
11239
+ });
11149
11240
  var isVertical = orientation === 'vertical';
11150
11241
  var {
11151
11242
  trackCrossAxisSize,
@@ -11215,7 +11306,7 @@ var SliderView = _ref => {
11215
11306
  top: "50%",
11216
11307
  left: thumbPositionPercent + "%",
11217
11308
  borderRadius: "50%",
11218
- backgroundColor: "white",
11309
+ backgroundColor: "color.white",
11219
11310
  boxShadow: "0 2px 4px rgba(0, 0, 0, 0.2)",
11220
11311
  border: "2px solid " + (isDisabled ? disabledColor : themeColor),
11221
11312
  transition: isDragging ? 'none' : 'transform 0.1s ease-in-out',
@@ -11959,12 +12050,12 @@ var UploadView = _ref => {
11959
12050
  } = _ref;
11960
12051
  var finalPreviewUrl = externalPreviewUrl || previewUrl;
11961
12052
  // Debug log to help troubleshoot
11962
- console.log('Uploader state:', {
11963
- fileType,
11964
- finalPreviewUrl,
11965
- selectedFile: selectedFile == null ? void 0 : selectedFile.name,
11966
- progress
11967
- });
12053
+ // console.log('Uploader state:', {
12054
+ // fileType,
12055
+ // finalPreviewUrl,
12056
+ // selectedFile: selectedFile?.name,
12057
+ // progress,
12058
+ // });
11968
12059
  return /*#__PURE__*/React__default.createElement(appStudio.Center, Object.assign({
11969
12060
  onClick: handleClick,
11970
12061
  cursor: "pointer",
@@ -12215,7 +12306,7 @@ var ModalTypography = {
12215
12306
  };
12216
12307
 
12217
12308
  var _excluded$H = ["children", "blur", "isOpen", "isClosePrevented", "onClose", "position", "views"],
12218
- _excluded2$c = ["children", "shadow", "isFullScreen", "shape", "views"],
12309
+ _excluded2$c = ["children", "shadow", "isFullScreen", "shape", "views", "isOpen"],
12219
12310
  _excluded3$9 = ["children", "buttonColor", "iconSize", "buttonPosition", "views"],
12220
12311
  _excluded4$7 = ["children", "views"],
12221
12312
  _excluded5$3 = ["children", "views"];
@@ -12283,7 +12374,7 @@ var ModalContainer = _ref2 => {
12283
12374
  };
12284
12375
  return /*#__PURE__*/React__default.createElement(appStudio.Vertical, Object.assign({
12285
12376
  cursor: "default",
12286
- backgroundColor: "white",
12377
+ backgroundColor: "color.white",
12287
12378
  width: isFullScreen ? '100%' : 600,
12288
12379
  height: isFullScreen ? '100%' : 'fit-content',
12289
12380
  onClick: handleClick,
@@ -13101,7 +13192,9 @@ var useTabsState = (propTabs, initialTabValue) => {
13101
13192
  return foundTab;
13102
13193
  }
13103
13194
  // Warn if initialTabValue is provided but not found
13104
- console.warn("Tabs: initialTabValue \"" + initialTabValue + "\" not found in tabs. Defaulting to the first tab.");
13195
+ // console.warn(
13196
+ // `Tabs: initialTabValue "${initialTabValue}" not found in tabs. Defaulting to the first tab.`
13197
+ // );
13105
13198
  }
13106
13199
  return propTabs[0]; // Default to the first tab
13107
13200
  };
@@ -13688,7 +13781,7 @@ var DropdownMenuSizes = {
13688
13781
  };
13689
13782
  var DropdownMenuVariants = {
13690
13783
  default: {
13691
- backgroundColor: 'white',
13784
+ backgroundColor: 'color.white',
13692
13785
  color: 'color.gray.800'
13693
13786
  },
13694
13787
  filled: {
@@ -13696,7 +13789,7 @@ var DropdownMenuVariants = {
13696
13789
  color: 'color.gray.800'
13697
13790
  },
13698
13791
  outline: {
13699
- backgroundColor: 'white',
13792
+ backgroundColor: 'color.white',
13700
13793
  borderWidth: '1px',
13701
13794
  borderStyle: 'solid',
13702
13795
  borderColor: 'color.gray.200',
@@ -14576,7 +14669,7 @@ var MenubarContent = _ref5 => {
14576
14669
  position: "absolute",
14577
14670
  zIndex: 1000,
14578
14671
  minWidth: "200px",
14579
- backgroundColor: "white",
14672
+ backgroundColor: "color.white",
14580
14673
  borderRadius: 4,
14581
14674
  boxShadow: "0px 2px 8px rgba(0, 0, 0, 0.15)",
14582
14675
  overflow: "hidden"
@@ -14828,7 +14921,7 @@ var PaginationShapes = {
14828
14921
  };
14829
14922
  var ActivePageButtonStyles = {
14830
14923
  backgroundColor: 'color.blue.500',
14831
- color: 'white',
14924
+ color: 'color.white',
14832
14925
  _hover: {
14833
14926
  backgroundColor: 'color.blue.600'
14834
14927
  }
@@ -14981,7 +15074,7 @@ var PaginationView = _ref => {
14981
15074
  borderWidth: "1px",
14982
15075
  borderStyle: "solid",
14983
15076
  borderColor: "color.gray.200",
14984
- backgroundColor: "white",
15077
+ backgroundColor: "color.white",
14985
15078
  cursor: "pointer",
14986
15079
  value: pageSize,
14987
15080
  onChange: handlePageSizeChange
@@ -15257,7 +15350,7 @@ var SidebarSizes = {
15257
15350
  var getSidebar = themeMode => {
15258
15351
  return {
15259
15352
  default: {
15260
- backgroundColor: 'white',
15353
+ backgroundColor: 'color.white',
15261
15354
  color: 'color.gray.800',
15262
15355
  transition: 'all 0.2s ease'
15263
15356
  },
@@ -15267,7 +15360,7 @@ var getSidebar = themeMode => {
15267
15360
  transition: 'all 0.2s ease'
15268
15361
  },
15269
15362
  outline: {
15270
- backgroundColor: 'white',
15363
+ backgroundColor: 'color.white',
15271
15364
  borderWidth: '1px',
15272
15365
  borderStyle: 'solid',
15273
15366
  borderColor: 'color.gray.200',
@@ -15280,7 +15373,7 @@ var getSidebar = themeMode => {
15280
15373
  transition: 'all 0.2s ease'
15281
15374
  },
15282
15375
  elevated: {
15283
- backgroundColor: 'white',
15376
+ backgroundColor: 'color.white',
15284
15377
  boxShadow: '0px 4px 8px rgba(0, 0, 0, 0.1)',
15285
15378
  color: 'color.gray.800',
15286
15379
  transition: 'all 0.2s ease'
@@ -16009,7 +16102,7 @@ var HandleIconStyles = {
16009
16102
 
16010
16103
  var _excluded$X = ["children", "id", "defaultSize", "minSize", "maxSize", "collapsible", "defaultCollapsed", "onCollapseChange", "views"],
16011
16104
  _excluded2$g = ["id", "position", "disabled", "withVisualIndicator", "withCollapseButton", "collapseTarget", "views"],
16012
- _excluded3$c = ["children", "orientation", "size", "variant", "defaultSizes", "minSize", "maxSize", "collapsible", "containerRef", "views"];
16105
+ _excluded3$c = ["children", "orientation", "size", "variant", "defaultSizes", "minSize", "maxSize", "collapsible", "containerRef", "autoSaveId", "views"];
16013
16106
  // Create context for the Resizable component
16014
16107
  var ResizableContext = /*#__PURE__*/React.createContext({
16015
16108
  orientation: 'horizontal',
@@ -16805,6 +16898,16 @@ var Toast = /*#__PURE__*/Object.assign(ToastComponent, {
16805
16898
  // Export the hook for component usage
16806
16899
  var useToast$1 = useToast;
16807
16900
 
16901
+ // Default filter function defined outside the hook to avoid recreating it on each render
16902
+ var defaultFilterFn = (value, item) => {
16903
+ var _item$description, _item$keywords;
16904
+ if (!value) return true;
16905
+ var searchValue = value.toLowerCase();
16906
+ var matchesName = item.name.toLowerCase().includes(searchValue);
16907
+ var matchesDescription = ((_item$description = item.description) == null ? void 0 : _item$description.toLowerCase().includes(searchValue)) || false;
16908
+ var matchesKeywords = ((_item$keywords = item.keywords) == null ? void 0 : _item$keywords.some(keyword => keyword.toLowerCase().includes(searchValue))) || false;
16909
+ return matchesName || matchesDescription || matchesKeywords;
16910
+ };
16808
16911
  var useCommandState = _ref => {
16809
16912
  var {
16810
16913
  open,
@@ -16813,46 +16916,36 @@ var useCommandState = _ref => {
16813
16916
  commands = [],
16814
16917
  filter
16815
16918
  } = _ref;
16816
- // Combine commands from groups and flat list
16817
- var allCommands = React.useCallback(() => {
16818
- var groupCommands = groups.flatMap(group => group.commands);
16819
- return [...groupCommands, ...commands];
16820
- }, [groups, commands]);
16821
16919
  // State for search input
16822
16920
  var [search, setSearch] = React.useState('');
16823
16921
  // State for selected item index
16824
16922
  var [selectedIndex, setSelectedIndex] = React.useState(0);
16825
16923
  // Ref for the command list element
16826
16924
  var listRef = React.useRef(null);
16827
- // Default filter function
16828
- var defaultFilter = (value, item) => {
16829
- var _item$description, _item$keywords;
16830
- if (!value) return true;
16831
- var searchValue = value.toLowerCase();
16832
- var matchesName = item.name.toLowerCase().includes(searchValue);
16833
- var matchesDescription = ((_item$description = item.description) == null ? void 0 : _item$description.toLowerCase().includes(searchValue)) || false;
16834
- var matchesKeywords = ((_item$keywords = item.keywords) == null ? void 0 : _item$keywords.some(keyword => keyword.toLowerCase().includes(searchValue))) || false;
16835
- return matchesName || matchesDescription || matchesKeywords;
16836
- };
16837
- // Filter commands based on search
16838
- var filterCommands = React.useCallback(searchValue => {
16839
- var filterFn = filter || defaultFilter;
16840
- return allCommands().filter(item => filterFn(searchValue, item));
16841
- }, [allCommands, filter, defaultFilter]);
16842
- // Filtered commands based on search
16843
- var [filteredCommands, setFilteredCommands] = React.useState(allCommands());
16844
- // Filtered groups based on search
16845
- var filteredGroups = React.useCallback(() => {
16925
+ // Use the provided filter or fall back to the default
16926
+ var filterFn = React.useMemo(() => filter || defaultFilterFn, [filter]);
16927
+ // Combine and memoize all commands from groups and flat list
16928
+ var allCommands = React.useMemo(() => {
16929
+ var groupCommands = groups.flatMap(group => group.commands);
16930
+ return [...groupCommands, ...commands];
16931
+ }, [groups, commands]);
16932
+ // Filter and memoize commands based on search
16933
+ var filteredCommands = React.useMemo(() => {
16934
+ if (!search.trim()) return allCommands;
16935
+ return allCommands.filter(item => filterFn(search, item));
16936
+ }, [allCommands, search, filterFn]);
16937
+ // Filter and memoize groups based on search
16938
+ var filteredGroups = React.useMemo(() => {
16846
16939
  if (!search) return groups;
16847
- return groups.map(group => Object.assign({}, group, {
16848
- commands: group.commands.filter(command => (filter || defaultFilter)(search, command))
16849
- })).filter(group => group.commands.length > 0);
16850
- }, [groups, search, filter, defaultFilter]);
16851
- // Update filtered commands when search changes
16940
+ var filterFn = filter || defaultFilterFn;
16941
+ return groups.map(g => Object.assign({}, g, {
16942
+ commands: g.commands.filter(c => filterFn(search, c))
16943
+ })).filter(g => g.commands.length);
16944
+ }, [groups, search, filter]);
16945
+ // Reset selected index when filtered commands change
16852
16946
  React.useEffect(() => {
16853
- setFilteredCommands(filterCommands(search));
16854
16947
  setSelectedIndex(0);
16855
- }, [search, filterCommands]);
16948
+ }, [filteredCommands.length]);
16856
16949
  // Handle keyboard navigation
16857
16950
  var handleKeyDown = React.useCallback(e => {
16858
16951
  if (!open) return;
@@ -16902,6 +16995,9 @@ var useCommandState = _ref => {
16902
16995
  React.useEffect(() => {
16903
16996
  if (open) {
16904
16997
  setSelectedIndex(0);
16998
+ } else {
16999
+ // Clear search when closed
17000
+ setSearch('');
16905
17001
  }
16906
17002
  }, [open]);
16907
17003
  return {
@@ -16910,7 +17006,7 @@ var useCommandState = _ref => {
16910
17006
  selectedIndex,
16911
17007
  setSelectedIndex,
16912
17008
  filteredCommands,
16913
- filteredGroups: filteredGroups(),
17009
+ filteredGroups,
16914
17010
  listRef
16915
17011
  };
16916
17012
  };
@@ -16932,7 +17028,7 @@ var CommandSizes = {
16932
17028
  var getCommand = themeMode => {
16933
17029
  return {
16934
17030
  default: {
16935
- backgroundColor: 'white',
17031
+ backgroundColor: 'color.white',
16936
17032
  borderWidth: '1px',
16937
17033
  borderStyle: 'solid',
16938
17034
  borderColor: 'color.gray.200',
@@ -16946,7 +17042,7 @@ var getCommand = themeMode => {
16946
17042
  boxShadow: '0px 4px 20px rgba(0, 0, 0, 0.1)'
16947
17043
  },
16948
17044
  outline: {
16949
- backgroundColor: 'white',
17045
+ backgroundColor: 'color.white',
16950
17046
  borderWidth: '2px',
16951
17047
  borderStyle: 'solid',
16952
17048
  borderColor: 'color.gray.300',
@@ -17179,26 +17275,21 @@ var CommandView = _ref7 => {
17179
17275
  } = _ref7,
17180
17276
  props = _objectWithoutPropertiesLoose(_ref7, _excluded6$3);
17181
17277
  if (!open) return null;
17182
- var handleItemSelect = item => {
17183
- if (!item.disabled) {
17184
- item.onSelect();
17185
- onOpenChange(false);
17186
- setSearch('');
17187
- }
17188
- };
17189
- var handleBackdropClick = e => {
17190
- if (e.target === e.currentTarget) {
17191
- onOpenChange(false);
17192
- }
17193
- };
17194
- var contextValue = {
17278
+ var handleItemSelect = React__default.useCallback(item => {
17279
+ if (item.disabled) return;
17280
+ item.onSelect();
17281
+ onOpenChange(false);
17282
+ setSearch('');
17283
+ }, [onOpenChange, setSearch]);
17284
+ var handleBackdropClick = React__default.useCallback(e => e.target === e.currentTarget && onOpenChange(false), [onOpenChange]);
17285
+ var contextValue = React__default.useMemo(() => ({
17195
17286
  search,
17196
17287
  setSearch,
17197
17288
  selectedIndex,
17198
17289
  setSelectedIndex,
17199
17290
  filteredCommands,
17200
17291
  onSelect: handleItemSelect
17201
- };
17292
+ }), [search, selectedIndex, filteredCommands, handleItemSelect, setSearch, setSelectedIndex]);
17202
17293
  var hasGroups = groups.length > 0;
17203
17294
  // const hasCommands = commands.length > 0;
17204
17295
  var isEmpty = filteredCommands.length === 0;