@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.
@@ -1,6 +1,6 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('core-js/modules/es.object.assign.js'), require('react'), require('core-js/modules/es.array.includes.js'), require('core-js/modules/es.array.iterator.js'), require('core-js/modules/es.string.includes.js'), require('core-js/modules/web.dom-collections.iterator.js'), require('core-js/modules/es.regexp.to-string.js'), require('app-studio'), require('core-js/modules/es.symbol.description.js'), require('core-js/modules/es.parse-float.js'), require('react-router-dom'), require('core-js/modules/es.promise.js'), require('core-js/modules/es.array.reduce.js'), require('core-js/modules/es.number.to-fixed.js'), require('core-js/modules/es.string.starts-with.js'), require('date-fns/format'), require('core-js/modules/es.parse-int.js'), require('core-js/modules/es.regexp.constructor.js'), require('core-js/modules/es.regexp.exec.js'), require('formik'), require('core-js/modules/web.url.js'), require('core-js/modules/web.url.to-json.js'), require('core-js/modules/web.url-search-params.js'), require('zustand'), require('core-js/modules/es.string.ends-with.js'), require('core-js/modules/es.string.match.js'), require('core-js/modules/es.string.search.js'), require('core-js/modules/es.array.flat-map.js'), require('core-js/modules/es.array.unscopables.flat-map.js')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'core-js/modules/es.object.assign.js', 'react', 'core-js/modules/es.array.includes.js', 'core-js/modules/es.array.iterator.js', 'core-js/modules/es.string.includes.js', 'core-js/modules/web.dom-collections.iterator.js', 'core-js/modules/es.regexp.to-string.js', 'app-studio', 'core-js/modules/es.symbol.description.js', 'core-js/modules/es.parse-float.js', 'react-router-dom', 'core-js/modules/es.promise.js', 'core-js/modules/es.array.reduce.js', 'core-js/modules/es.number.to-fixed.js', 'core-js/modules/es.string.starts-with.js', 'date-fns/format', 'core-js/modules/es.parse-int.js', 'core-js/modules/es.regexp.constructor.js', 'core-js/modules/es.regexp.exec.js', 'formik', 'core-js/modules/web.url.js', 'core-js/modules/web.url.to-json.js', 'core-js/modules/web.url-search-params.js', 'zustand', 'core-js/modules/es.string.ends-with.js', 'core-js/modules/es.string.match.js', 'core-js/modules/es.string.search.js', 'core-js/modules/es.array.flat-map.js', 'core-js/modules/es.array.unscopables.flat-map.js'], factory) :
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('core-js/modules/es.object.assign.js'), require('react'), require('core-js/modules/es.array.includes.js'), require('core-js/modules/es.array.iterator.js'), require('core-js/modules/es.string.includes.js'), require('core-js/modules/web.dom-collections.iterator.js'), require('core-js/modules/es.regexp.to-string.js'), require('app-studio'), require('core-js/modules/es.symbol.description.js'), require('core-js/modules/es.parse-float.js'), require('react-router-dom'), require('core-js/modules/es.promise.js'), require('core-js/modules/es.array.reduce.js'), require('core-js/modules/es.number.to-fixed.js'), require('core-js/modules/es.string.starts-with.js'), require('date-fns/format'), require('core-js/modules/es.parse-int.js'), require('core-js/modules/es.regexp.constructor.js'), require('core-js/modules/es.regexp.exec.js'), require('formik'), require('core-js/modules/web.url.js'), require('core-js/modules/web.url.to-json.js'), require('core-js/modules/web.url-search-params.js'), require('zustand'), require('core-js/modules/es.string.ends-with.js'), require('core-js/modules/es.string.match.js'), require('core-js/modules/es.string.search.js'), require('core-js/modules/es.array.flat-map.js'), require('core-js/modules/es.array.unscopables.flat-map.js'), require('core-js/modules/es.string.trim.js')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'core-js/modules/es.object.assign.js', 'react', 'core-js/modules/es.array.includes.js', 'core-js/modules/es.array.iterator.js', 'core-js/modules/es.string.includes.js', 'core-js/modules/web.dom-collections.iterator.js', 'core-js/modules/es.regexp.to-string.js', 'app-studio', 'core-js/modules/es.symbol.description.js', 'core-js/modules/es.parse-float.js', 'react-router-dom', 'core-js/modules/es.promise.js', 'core-js/modules/es.array.reduce.js', 'core-js/modules/es.number.to-fixed.js', 'core-js/modules/es.string.starts-with.js', 'date-fns/format', 'core-js/modules/es.parse-int.js', 'core-js/modules/es.regexp.constructor.js', 'core-js/modules/es.regexp.exec.js', 'formik', 'core-js/modules/web.url.js', 'core-js/modules/web.url.to-json.js', 'core-js/modules/web.url-search-params.js', 'zustand', 'core-js/modules/es.string.ends-with.js', 'core-js/modules/es.string.match.js', 'core-js/modules/es.string.search.js', 'core-js/modules/es.array.flat-map.js', 'core-js/modules/es.array.unscopables.flat-map.js', 'core-js/modules/es.string.trim.js'], factory) :
4
4
  (global = global || self, factory(global['@app-studio/web'] = {}, null, global.React, null, null, null, null, null, global.appStudio, null, null, global.reactRouterDom, null, null, null, null, global.format, null, null, null, global.formik, null, null, null, global.zustand));
5
5
  }(this, (function (exports, es_object_assign_js, React, es_array_includes_js, es_array_iterator_js, es_string_includes_js, web_domCollections_iterator_js, es_regexp_toString_js, appStudio, es_symbol_description_js, es_parseFloat_js, reactRouterDom, es_promise_js, es_array_reduce_js, es_number_toFixed_js, es_string_startsWith_js, format, es_parseInt_js, es_regexp_constructor_js, es_regexp_exec_js, formik, web_url_js, web_url_toJson_js, web_urlSearchParams_js, zustand) { 'use strict';
6
6
 
@@ -2792,71 +2792,70 @@
2792
2792
  * Get theme styles for different alert variants based on theme mode
2793
2793
  */
2794
2794
  var getThemes = themeMode => {
2795
- var isDarkMode = themeMode === 'dark';
2796
2795
  return {
2797
2796
  default: {
2798
2797
  container: {
2799
- backgroundColor: isDarkMode ? 'color.gray.800' : 'color.gray.50',
2800
- borderColor: isDarkMode ? 'color.gray.700' : 'color.gray.200',
2801
- boxShadow: isDarkMode ? '0 1px 2px rgba(0, 0, 0, 0.2)' : '0 1px 2px rgba(0, 0, 0, 0.05)'
2798
+ backgroundColor: 'color.gray.50',
2799
+ borderColor: 'color.gray.200',
2800
+ boxShadow: '0 1px 2px rgba(0, 0, 0, 0.05)'
2802
2801
  },
2803
2802
  content: {
2804
- color: isDarkMode ? 'color.gray.300' : 'color.gray.700'
2803
+ color: 'color.gray.700'
2805
2804
  },
2806
2805
  icon: {
2807
- color: isDarkMode ? 'color.gray.400' : 'color.gray.500'
2806
+ color: 'color.gray.500'
2808
2807
  }
2809
2808
  },
2810
2809
  info: {
2811
2810
  container: {
2812
- backgroundColor: isDarkMode ? 'color.blue.900' : 'color.blue.50',
2813
- borderColor: isDarkMode ? 'color.blue.800' : 'color.blue.200',
2814
- boxShadow: isDarkMode ? '0 1px 2px rgba(59, 130, 246, 0.2)' : '0 1px 2px rgba(59, 130, 246, 0.05)'
2811
+ backgroundColor: 'color.blue.50',
2812
+ borderColor: 'color.blue.200',
2813
+ boxShadow: '0 1px 2px rgba(59, 130, 246, 0.05)'
2815
2814
  },
2816
2815
  content: {
2817
- color: isDarkMode ? 'color.blue.300' : 'color.blue.700'
2816
+ color: 'color.blue.700'
2818
2817
  },
2819
2818
  icon: {
2820
- color: isDarkMode ? 'color.blue.400' : 'color.blue.500'
2819
+ color: 'color.blue.500'
2821
2820
  }
2822
2821
  },
2823
2822
  success: {
2824
2823
  container: {
2825
- backgroundColor: isDarkMode ? 'color.green.900' : 'color.green.50',
2826
- borderColor: isDarkMode ? 'color.green.800' : 'color.green.200',
2827
- boxShadow: isDarkMode ? '0 1px 2px rgba(34, 197, 94, 0.2)' : '0 1px 2px rgba(34, 197, 94, 0.05)'
2824
+ backgroundColor: 'color.green.50',
2825
+ borderColor: 'color.green.200',
2826
+ boxShadow: '0 1px 2px rgba(34, 197, 94, 0.05)'
2828
2827
  },
2829
2828
  content: {
2830
- color: isDarkMode ? 'color.green.300' : 'color.green.700'
2829
+ color: 'color.green.700'
2831
2830
  },
2832
2831
  icon: {
2833
- color: isDarkMode ? 'color.green.400' : 'color.green.500'
2832
+ color: 'color.green.500'
2834
2833
  }
2835
2834
  },
2836
2835
  error: {
2837
2836
  container: {
2838
- backgroundColor: isDarkMode ? 'color.red.900' : 'color.red.50',
2839
- borderColor: isDarkMode ? 'color.red.800' : 'color.red.200',
2840
- boxShadow: isDarkMode ? '0 1px 2px rgba(239, 68, 68, 0.2)' : '0 1px 2px rgba(239, 68, 68, 0.05)'
2837
+ backgroundColor: 'color.red.50',
2838
+ borderColor: 'color.red.200',
2839
+ boxShadow: '0 1px 2px rgba(239, 68, 68, 0.05)'
2841
2840
  },
2842
2841
  content: {
2843
- color: isDarkMode ? 'color.red.300' : 'color.red.700'
2842
+ color: 'color.red.700'
2844
2843
  },
2845
2844
  icon: {
2846
- color: isDarkMode ? 'color.red.400' : 'color.red.500'
2845
+ color: 'color.red.500'
2847
2846
  }
2848
2847
  },
2849
2848
  warning: {
2850
2849
  container: {
2851
- backgroundColor: isDarkMode ? 'color.orange.900' : 'color.orange.50',
2852
- borderColor: isDarkMode ? 'color.orange.800' : 'color.orange.200',
2853
- boxShadow: isDarkMode ? '0 1px 2px rgba(249, 115, 22, 0.2)' : '0 1px 2px rgba(249, 115, 22, 0.05)'
2850
+ backgroundColor: 'color.orange.50',
2851
+ borderColor: 'color.orange.200',
2852
+ boxShadow: '0 1px 2px rgba(249, 115, 22, 0.05)'
2854
2853
  },
2855
2854
  content: {
2856
- color: isDarkMode ? 'color.orange.300' : 'color.orange.700'
2855
+ color: 'color.orange.700'
2857
2856
  },
2858
2857
  icon: {
2859
- color: isDarkMode ? 'color.orange.400' : 'color.orange.500'
2858
+ color: 'color.orange.500'
2860
2859
  }
2861
2860
  }
2862
2861
  };
@@ -2879,8 +2878,7 @@
2879
2878
  var {
2880
2879
  themeMode
2881
2880
  } = appStudio.useTheme();
2882
- var currentThemeMode = elementMode || themeMode;
2883
- var themes = getThemes(currentThemeMode);
2881
+ var themes = getThemes();
2884
2882
  // Select the appropriate icon based on the variant
2885
2883
  var getIcon = () => {
2886
2884
  var _views$icon$color, _views$icon;
@@ -3209,11 +3207,10 @@
3209
3207
  * Get badge variants with consistent styling based on theme mode
3210
3208
  */
3211
3209
  var getBadgeVariants = themeMode => {
3212
- var isDarkMode = themeMode === 'dark';
3213
3210
  return {
3214
3211
  filled: {
3215
3212
  backgroundColor: 'theme.primary',
3216
- color: isDarkMode ? 'color.gray.900' : 'color.white',
3213
+ color: 'color.white',
3217
3214
  borderWidth: '1px',
3218
3215
  borderStyle: 'solid',
3219
3216
  borderColor: 'transparent',
@@ -3239,7 +3236,7 @@
3239
3236
  },
3240
3237
  ghost: {
3241
3238
  backgroundColor: 'transparent',
3242
- color: isDarkMode ? 'color.gray.400' : 'color.gray.500',
3239
+ color: 'color.gray.500',
3243
3240
  borderWidth: '1px',
3244
3241
  borderStyle: 'solid',
3245
3242
  borderColor: 'transparent',
@@ -3267,8 +3264,7 @@
3267
3264
  var {
3268
3265
  themeMode
3269
3266
  } = appStudio.useTheme();
3270
- var currentThemeMode = elementMode || themeMode;
3271
- var variantStyles = getBadgeVariants(currentThemeMode)[variant];
3267
+ var variantStyles = getBadgeVariants()[variant];
3272
3268
  // Combine styles for the badge
3273
3269
  var combinedStyles = Object.assign({
3274
3270
  // Base styles
@@ -3530,7 +3526,9 @@
3530
3526
  getColor,
3531
3527
  themeMode
3532
3528
  } = appStudio.useTheme();
3533
- var colorStyle = getColor(color, elementMode ? elementMode : themeMode);
3529
+ var colorStyle = getColor(color, {
3530
+ themeMode: elementMode ? elementMode : themeMode
3531
+ });
3534
3532
  var sizeStyle = typeof size === 'number' ? size : DefaultSizes[size];
3535
3533
  var [angle, setAngle] = React.useState(0);
3536
3534
  React.useEffect(() => {
@@ -3577,7 +3575,9 @@
3577
3575
  getColor,
3578
3576
  themeMode
3579
3577
  } = appStudio.useTheme();
3580
- var colorStyle = getColor(color, elementMode ? elementMode : themeMode);
3578
+ var colorStyle = getColor(color, {
3579
+ themeMode: elementMode ? elementMode : themeMode
3580
+ });
3581
3581
  var sizeStyle = typeof size === 'number' ? size : DefaultSizes[size];
3582
3582
  var [angle, setAngle] = React.useState(0);
3583
3583
  React.useEffect(() => {
@@ -3623,7 +3623,9 @@
3623
3623
  getColor,
3624
3624
  themeMode
3625
3625
  } = appStudio.useTheme();
3626
- var colorStyle = getColor(color, elementMode ? elementMode : themeMode);
3626
+ var colorStyle = getColor(color, {
3627
+ themeMode: elementMode ? elementMode : themeMode
3628
+ });
3627
3629
  var sizeStyle = typeof size === 'number' ? size : DefaultSizes[size];
3628
3630
  var [angle, setAngle] = React.useState(0);
3629
3631
  React.useEffect(() => {
@@ -3690,9 +3692,10 @@
3690
3692
  // Exports the LoaderComponent as Loader, making it available for use in other parts of the application.
3691
3693
  var Loader = LoaderComponent;
3692
3694
 
3693
- 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"],
3695
+ 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"],
3694
3696
  _excluded2$3 = ["_hover", "_active"],
3695
3697
  _excluded3$3 = ["height"];
3698
+ // Using require for contrast as it seems to be a common pattern in your code
3696
3699
  var contrast = /*#__PURE__*/require('contrast');
3697
3700
  var ButtonView = _ref => {
3698
3701
  var _props$onClick;
@@ -3714,13 +3717,16 @@
3714
3717
  onClick = () => {},
3715
3718
  loaderProps = {},
3716
3719
  loaderPosition = 'left',
3717
- effect = 'default',
3718
- isHovered,
3720
+ effect = 'default' // 'default', 'hover', 'reverse'
3721
+ ,
3719
3722
  setIsHovered = () => {},
3720
3723
  isExternal = false,
3721
3724
  themeMode: elementMode,
3725
+ // Allow overriding themeMode for this element
3722
3726
  views,
3723
- colorScheme = 'theme.primary'
3727
+ color,
3728
+ // Text color prop
3729
+ backgroundColor = 'theme.primary' // Background color prop
3724
3730
  } = _ref,
3725
3731
  props = _objectWithoutPropertiesLoose(_ref, _excluded$a);
3726
3732
  var {
@@ -3732,81 +3738,170 @@
3732
3738
  var defaultNativeProps = {
3733
3739
  disabled: !isActive
3734
3740
  };
3735
- var buttonColor = isActive ? colorScheme : 'theme.disabled';
3736
- var hovering = isHovered && effect === 'hover';
3737
- var reverse = isHovered && effect === 'reverse';
3738
- // Determine if the button color is light or dark for proper contrast
3739
- var isLight = contrast(getColor(buttonColor, elementMode ? elementMode : themeMode)) == 'light';
3740
- // Define button variants with effect support
3741
- var ButtonVariants = {
3742
- filled: {
3743
- backgroundColor: reverse ? 'transparent' : buttonColor,
3744
- color: reverse ? isLight ? 'white' : buttonColor : isLight ? buttonColor : 'white',
3745
- borderWidth: 1,
3746
- borderStyle: 'solid',
3747
- borderColor: reverse ? buttonColor : 'transparent',
3748
- _hover: {
3749
- backgroundColor: reverse ? buttonColor + "10" : "" + buttonColor,
3750
- transform: 'translateY(-2px)',
3751
- boxShadow: '0 4px 8px rgba(0, 0, 0, 0.1)'
3741
+ // Determine the base background color key/value, considering disabled state
3742
+ var buttonBackgroundColorKey = isActive ? backgroundColor : 'theme.disabled';
3743
+ // --- Provided Color Logic ---
3744
+ // Determine the effective theme mode for this button
3745
+ var mode = elementMode != null ? elementMode : themeMode; // effective mode
3746
+ // Resolve the base background color string
3747
+ var bg = getColor(buttonBackgroundColorKey, {
3748
+ themeMode: mode
3749
+ });
3750
+ // Resolve the background color string in the opposite theme mode (for reverse effect, though not directly used for ghost/outline text contrast)
3751
+ // const bgHover = getColor(buttonBackgroundColorKey, {
3752
+ // themeMode: mode === 'light' ? 'dark' : 'light',
3753
+ // }); // bgHover is not strictly needed for the text contrast logic below
3754
+ // Check contrast of base background
3755
+ var isBgLight = contrast(bg) === mode;
3756
+ // Determine contrasting text color key for the base background
3757
+ var txtOnBgKey = isBgLight ? 'color.black' : 'color.white';
3758
+ // --- End Provided Color Logic ---
3759
+ // Determine the default text color key/value if 'color' prop is not provided
3760
+ // For filled buttons, default text color should contrast with the background (use txtOnBgKey).
3761
+ // For outline/link/ghost, a theme-appropriate text color is usually better (e.g., theme.text or theme.primary).
3762
+ var defaultTextColorKey;
3763
+ if (variant === 'filled') {
3764
+ defaultTextColorKey = txtOnBgKey; // Use the calculated contrasting color key
3765
+ } else {
3766
+ // For non-filled variants, default to theme's text color or primary color
3767
+ defaultTextColorKey = 'theme.primary'; // Or 'theme.primary' depending on design system
3768
+ }
3769
+ // Determine the actual key/value for the base text color
3770
+ // Use the provided 'color' prop if available, otherwise use the calculated default
3771
+ var baseTextColorKey = color || defaultTextColorKey;
3772
+ // Resolve the actual base text color string
3773
+ var resolvedBaseTextColor = getColor(baseTextColorKey, {
3774
+ themeMode: mode
3775
+ });
3776
+ // Resolve the contrasting color string for the base background (used for text in outline/ghost reverse)
3777
+ var contrastingColorForBg = getColor(txtOnBgKey, {
3778
+ themeMode: mode
3779
+ });
3780
+ // Resolve the contrasting color string for the base text color (used for text in ghost reverse)
3781
+ var isBaseTextLight = contrast(resolvedBaseTextColor) === 'light';
3782
+ var contrastingColorForBaseText = getColor(isBaseTextLight ? 'color.black' : 'color.white', {
3783
+ themeMode: mode
3784
+ });
3785
+ // --- Button Variant Styles Function ---
3786
+ // This function calculates the styles based on the current state (base, hover, active)
3787
+ var getButtonVariantStyles = _ref2 => {
3788
+ var {
3789
+ currentVariant,
3790
+ currentEffect,
3791
+ resolvedBg,
3792
+ // Resolved base background color string (bg)
3793
+ resolvedBaseTextColor,
3794
+ // Resolved base text color string
3795
+ contrastingColorForBg,
3796
+ // Resolved contrasting color string for resolvedBg
3797
+ contrastingColorForBaseText,
3798
+ // Resolved contrasting color string for resolvedBaseTextColor
3799
+ resolvedBorderColor
3800
+ } = _ref2;
3801
+ // Define the base styles for each variant
3802
+ var baseStyles = {
3803
+ filled: {
3804
+ backgroundColor: resolvedBg,
3805
+ color: resolvedBaseTextColor,
3806
+ borderWidth: 1,
3807
+ borderStyle: 'solid',
3808
+ borderColor: 'transparent'
3752
3809
  },
3753
- _active: {
3754
- backgroundColor: reverse ? buttonColor + "20" : "" + buttonColor,
3755
- transform: 'translateY(0)',
3756
- boxShadow: '0 2px 4px rgba(0, 0, 0, 0.1)'
3757
- }
3758
- },
3759
- outline: {
3760
- backgroundColor: reverse ? buttonColor : 'transparent',
3761
- borderWidth: 1,
3762
- borderStyle: 'solid',
3763
- borderColor: reverse ? buttonColor : colorScheme,
3764
- color: reverse ? 'white' : buttonColor,
3765
- _hover: {
3766
- backgroundColor: reverse ? "" + buttonColor : buttonColor + "10",
3767
- transform: 'translateY(-2px)',
3768
- boxShadow: '0 4px 8px rgba(0, 0, 0, 0.05)'
3810
+ outline: {
3811
+ backgroundColor: 'transparent',
3812
+ color: resolvedBaseTextColor,
3813
+ borderWidth: 1,
3814
+ borderStyle: 'solid',
3815
+ borderColor: resolvedBorderColor
3769
3816
  },
3770
- _active: {
3771
- backgroundColor: reverse ? buttonColor + "b0" : buttonColor + "20",
3772
- transform: 'translateY(0)',
3773
- boxShadow: '0 2px 4px rgba(0, 0, 0, 0.05)'
3774
- }
3775
- },
3776
- link: {
3777
- backgroundColor: 'transparent',
3778
- borderWidth: 0,
3779
- borderStyle: 'none',
3780
- borderColor: 'transparent',
3781
- color: buttonColor,
3782
- textDecoration: reverse ? 'none' : 'underline',
3783
- _hover: {
3784
- opacity: 0.8,
3785
- textDecorationThickness: '2px'
3817
+ link: {
3818
+ backgroundColor: 'transparent',
3819
+ color: resolvedBg,
3820
+ borderWidth: 0,
3821
+ borderStyle: 'none',
3822
+ borderColor: 'transparent',
3823
+ textDecoration: 'underline'
3786
3824
  },
3787
- _active: {
3788
- opacity: 0.8,
3789
- textDecorationThickness: '2px'
3825
+ ghost: {
3826
+ backgroundColor: 'transparent',
3827
+ color: resolvedBaseTextColor,
3828
+ borderWidth: 0,
3829
+ borderStyle: 'none',
3830
+ borderColor: 'transparent'
3790
3831
  }
3791
- },
3792
- ghost: {
3793
- backgroundColor: reverse ? buttonColor : 'transparent',
3794
- color: reverse ? 'white' : buttonColor,
3795
- borderWidth: 0,
3796
- borderStyle: 'none',
3797
- borderColor: 'transparent',
3798
- _hover: {
3799
- backgroundColor: reverse ? "" + buttonColor : buttonColor + "10",
3800
- transform: 'translateY(-2px)'
3832
+ };
3833
+ // Define the styles applied on hover/active when effect is 'reverse'
3834
+ var reverseHoverActiveStyles = {
3835
+ filled: {
3836
+ backgroundColor: 'transparent',
3837
+ color: resolvedBg,
3838
+ borderWidth: 1,
3839
+ borderStyle: 'solid',
3840
+ borderColor: resolvedBg
3801
3841
  },
3802
- _active: {
3803
- backgroundColor: reverse ? buttonColor + "b0" : buttonColor + "20",
3804
- transform: 'translateY(0)'
3842
+ outline: {
3843
+ backgroundColor: resolvedBg,
3844
+ color: contrastingColorForBg,
3845
+ borderWidth: 1,
3846
+ borderStyle: 'solid',
3847
+ borderColor: 'transparent'
3848
+ },
3849
+ link: {
3850
+ backgroundColor: 'transparent',
3851
+ color: resolvedBg,
3852
+ borderWidth: 0,
3853
+ borderStyle: 'none',
3854
+ borderColor: 'transparent',
3855
+ textDecoration: 'none'
3856
+ },
3857
+ ghost: {
3858
+ backgroundColor: resolvedBg,
3859
+ color: contrastingColorForBaseText,
3860
+ borderWidth: 0,
3861
+ borderStyle: 'none',
3862
+ borderColor: 'transparent'
3805
3863
  }
3806
- }
3864
+ };
3865
+ // General hover/active effects (transform, shadow, opacity, etc.)
3866
+ var generalHoverStyles = {
3867
+ transform: 'translateY(2px)',
3868
+ boxShadow: currentVariant === 'link' ? undefined : '0 4px 8px rgba(0, 0, 0, 0.1)',
3869
+ // opacity: currentVariant === 'link' ? 0.8 : undefined,
3870
+ textDecorationThickness: currentVariant === 'link' ? '2px' : undefined
3871
+ };
3872
+ var generalActiveStyles = {
3873
+ transform: 'translateY(-1px)',
3874
+ boxShadow: '0 2px 4px rgba(0, 0, 0, 0.1)',
3875
+ opacity: currentVariant === 'link' ? 0.8 : undefined,
3876
+ textDecorationThickness: currentVariant === 'link' ? '2px' : undefined
3877
+ };
3878
+ // Combine base styles with conditional hover/active overrides
3879
+ return Object.assign({}, baseStyles[currentVariant], {
3880
+ _hover: Object.assign({}, currentEffect === 'reverse' ? reverseHoverActiveStyles[currentVariant] : {}, currentEffect === 'hover' ? {
3881
+ filter: 'brightness(0.85)'
3882
+ } : {}, generalHoverStyles),
3883
+ _active: Object.assign({}, currentEffect === 'reverse' ? reverseHoverActiveStyles[currentVariant] : {}, currentEffect === 'hover' ? {
3884
+ filter: 'brightness(0.7)'
3885
+ } : {}, generalActiveStyles)
3886
+ });
3807
3887
  };
3888
+ // Get the calculated variant styles for the current state
3889
+ var buttonVariantStyles = getButtonVariantStyles({
3890
+ currentVariant: variant,
3891
+ currentEffect: effect,
3892
+ resolvedBg: bg,
3893
+ resolvedBaseTextColor: resolvedBaseTextColor,
3894
+ contrastingColorForBg: contrastingColorForBg,
3895
+ contrastingColorForBaseText: contrastingColorForBaseText,
3896
+ resolvedBorderColor: bg
3897
+ });
3898
+ // Extract hover and active styles from the calculated styles
3899
+ var {
3900
+ _hover,
3901
+ _active
3902
+ } = buttonVariantStyles,
3903
+ baseButtonVariantStyles = _objectWithoutPropertiesLoose(buttonVariantStyles, _excluded2$3);
3808
3904
  var buttonSizeStyles = ButtonSizes[size];
3809
- var buttonVariant = ButtonVariants[variant];
3810
3905
  var scaleWidth = {
3811
3906
  width: isAuto === true ? 'fit-content' : isFilled ? '100%' : buttonSizeStyles.width
3812
3907
  };
@@ -3819,62 +3914,68 @@
3819
3914
  alignItems: "center",
3820
3915
  justifyContent: "center"
3821
3916
  }, views == null ? void 0 : views.container), isLoading && loaderPosition === 'left' && (/*#__PURE__*/React__default.createElement(Loader, Object.assign({
3822
- size: size === 'xs' || size === 'sm' ? 'sm' : 'md'
3917
+ size: size === 'xs' || size === 'sm' ? 'sm' : 'md',
3918
+ color: baseButtonVariantStyles.color
3823
3919
  }, loaderProps))), icon && ['left', 'top'].includes(iconPosition) && !isLoading && (/*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
3824
3920
  display: "flex",
3825
3921
  alignItems: "center",
3826
- justifyContent: "center"
3922
+ justifyContent: "center",
3923
+ color: baseButtonVariantStyles.color
3827
3924
  }, views == null ? void 0 : views.icon), icon)), children, icon && ['right', 'bottom'].includes(iconPosition) && !isLoading && (/*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
3828
3925
  display: "flex",
3829
3926
  alignItems: "center",
3830
- justifyContent: "center"
3927
+ justifyContent: "center",
3928
+ color: baseButtonVariantStyles.color
3831
3929
  }, views == null ? void 0 : views.icon), icon)), isLoading && loaderPosition === 'right' && (/*#__PURE__*/React__default.createElement(Loader, Object.assign({
3832
- size: size === 'xs' || size === 'sm' ? 'sm' : 'md'
3930
+ size: size === 'xs' || size === 'sm' ? 'sm' : 'md',
3931
+ color: baseButtonVariantStyles.color
3833
3932
  }, loaderProps))));
3834
- // Extract hover and active styles from buttonVariant
3835
- var _ref2 = buttonVariant || {},
3836
- {
3837
- _hover,
3838
- _active
3839
- } = _ref2,
3840
- baseButtonVariant = _objectWithoutPropertiesLoose(_ref2, _excluded2$3);
3933
+ // Determine if the button should render as a Link or a button Element
3934
+ var isLink = variant === 'link' && to;
3841
3935
  return /*#__PURE__*/React__default.createElement(appStudio.Element, Object.assign({
3842
3936
  gap: 8,
3843
- as: "button",
3844
- type: "button",
3937
+ as: isLink ? 'div' : 'button',
3938
+ type: isLink ? undefined : 'button',
3845
3939
  display: "flex",
3846
3940
  alignItems: "center",
3847
3941
  justifyContent: "center",
3848
3942
  "aria-label": ariaLabel,
3849
- backgroundColor: "transparent",
3943
+ // backgroundColor="transparent" // Remove this unless it's intended to override variant styles
3850
3944
  borderRadius: ButtonShapes[shape],
3851
3945
  onClick: (_props$onClick = props.onClick) != null ? _props$onClick : onClick,
3852
3946
  onMouseEnter: () => handleHover(true),
3853
3947
  onMouseLeave: () => handleHover(false),
3854
- cursor: isActive ? 'pointer' : 'default',
3855
- filter: hovering && effect === 'hover' ? 'brightness(0.85)' : 'brightness(1)',
3948
+ cursor: isActive ? isLink ? 'pointer' : 'pointer' : 'default',
3856
3949
  transition: "all 0.2s ease",
3857
- transform: hovering && effect === 'hover' && !isDisabled ? 'translateY(-5px)' : '',
3858
- // Apply consistent styling according to design guidelines
3950
+ // filter and transform are now handled within _hover/_active styles
3859
3951
  // Apply shadow if provided
3860
3952
  boxShadow: shadow ? shadow : undefined
3861
3953
  }, defaultNativeProps, (_ref3 => {
3862
3954
  var rest = _objectWithoutPropertiesLoose(_ref3, _excluded3$3);
3863
3955
  return rest;
3864
- })(props), buttonSizeStyles, baseButtonVariant, scaleWidth, props.padding || props.paddingHorizontal || props.paddingVertical || props.paddingLeft || props.paddingRight || props.paddingTop || props.paddingBottom ? {} : changePadding, {
3956
+ })(props), buttonSizeStyles, baseButtonVariantStyles, scaleWidth, props.padding || props.paddingHorizontal || props.paddingVertical || props.paddingLeft || props.paddingRight || props.paddingTop || props.paddingBottom ? {} : changePadding, {
3865
3957
  // Apply hover and active styles
3866
3958
  _hover: _hover,
3867
3959
  _active: _active
3868
- }, views == null ? void 0 : views.container), variant === 'link' && to ? (/*#__PURE__*/React__default.createElement(Link, Object.assign({
3960
+ }), to ? (/*#__PURE__*/React__default.createElement(Link, Object.assign({
3869
3961
  to: to,
3870
- textDecorationColor: colorScheme,
3871
- textDecorationThickness: "1px",
3962
+ isExternal: isExternal,
3963
+ // Link styles should inherit from the button's calculated styles or be defined here
3964
+ // Let's apply relevant styles from the button variant to the Link
3965
+ color: baseButtonVariantStyles.color,
3966
+ textDecoration: baseButtonVariantStyles.textDecoration,
3967
+ textDecorationColor: baseButtonVariantStyles.color,
3968
+ textDecorationThickness: "1px" // Base thickness
3969
+ ,
3872
3970
  textUnderlineOffset: "2px",
3873
3971
  transition: "all 0.2s ease",
3874
- isExternal: isExternal,
3875
- _hover: {
3972
+ // Apply Link-specific hover/active styles if needed, or let Element's _hover/_active handle it
3973
+ _hover: Object.assign({}, _hover, {
3876
3974
  textDecorationThickness: '2px'
3877
- }
3975
+ }),
3976
+ _active: Object.assign({}, _active, {
3977
+ textDecorationThickness: '2px'
3978
+ })
3878
3979
  }, views == null ? void 0 : views.link), content)) : content);
3879
3980
  };
3880
3981
 
@@ -3927,30 +4028,29 @@
3927
4028
  * Get card variants with consistent styling based on theme mode
3928
4029
  */
3929
4030
  var getCardVariants = themeMode => {
3930
- var isDarkMode = themeMode === 'dark';
3931
4031
  return {
3932
4032
  default: {
3933
- backgroundColor: isDarkMode ? 'color.gray.800' : 'white',
4033
+ backgroundColor: 'color.white',
3934
4034
  border: 'none',
3935
4035
  transition: 'all 0.2s ease'
3936
4036
  },
3937
4037
  outlined: {
3938
- backgroundColor: isDarkMode ? 'color.gray.800' : 'white',
4038
+ backgroundColor: 'color.white',
3939
4039
  borderWidth: '1px',
3940
4040
  borderStyle: 'solid',
3941
- borderColor: isDarkMode ? 'color.gray.700' : 'color.gray.200',
4041
+ borderColor: 'color.gray.200',
3942
4042
  transition: 'all 0.2s ease',
3943
4043
  _hover: {
3944
- borderColor: isDarkMode ? 'color.gray.600' : 'color.gray.300'
4044
+ borderColor: 'color.gray.300'
3945
4045
  }
3946
4046
  },
3947
4047
  elevated: {
3948
- backgroundColor: isDarkMode ? 'color.gray.800' : 'white',
3949
- boxShadow: isDarkMode ? '0px 2px 8px rgba(0, 0, 0, 0.2)' : '0px 2px 8px rgba(0, 0, 0, 0.08)',
4048
+ backgroundColor: 'color.white',
4049
+ boxShadow: '0px 2px 8px rgba(0, 0, 0, 0.08)',
3950
4050
  border: 'none',
3951
4051
  transition: 'all 0.2s ease',
3952
4052
  _hover: {
3953
- boxShadow: isDarkMode ? '0px 4px 12px rgba(0, 0, 0, 0.25)' : '0px 4px 12px rgba(0, 0, 0, 0.12)',
4053
+ boxShadow: '0px 4px 12px rgba(0, 0, 0, 0.12)',
3954
4054
  transform: 'translateY(-2px)'
3955
4055
  }
3956
4056
  }
@@ -3961,14 +4061,10 @@
3961
4061
  * @param theme - Theme object from useTheme hook
3962
4062
  */
3963
4063
  var getDefaultCardStyles = theme => {
3964
- var {
3965
- themeMode
3966
- } = theme;
3967
- var isDarkMode = themeMode === 'dark';
3968
4064
  return {
3969
4065
  container: {
3970
- backgroundColor: isDarkMode ? 'color.gray.800' : 'white',
3971
- color: isDarkMode ? 'color.gray.100' : 'color.gray.900',
4066
+ backgroundColor: 'color.white',
4067
+ color: 'color.black',
3972
4068
  borderRadius: '8px',
3973
4069
  overflow: 'hidden',
3974
4070
  transition: 'all 0.2s ease'
@@ -3977,17 +4073,18 @@
3977
4073
  padding: '16px',
3978
4074
  borderBottomWidth: '1px',
3979
4075
  borderBottomStyle: 'solid',
3980
- borderBottomColor: isDarkMode ? 'color.gray.700' : 'color.gray.200'
4076
+ borderBottomColor: 'color.gray.200',
4077
+ color: 'color.black'
3981
4078
  },
3982
4079
  content: {
3983
4080
  padding: '16px',
3984
- color: isDarkMode ? 'color.gray.100' : 'color.gray.900'
4081
+ color: 'color.black'
3985
4082
  },
3986
4083
  footer: {
3987
4084
  padding: '16px',
3988
4085
  borderTopWidth: '1px',
3989
4086
  borderTopStyle: 'solid',
3990
- borderTopColor: isDarkMode ? 'color.gray.700' : 'color.gray.200'
4087
+ borderTopColor: 'color.gray.200'
3991
4088
  }
3992
4089
  };
3993
4090
  };
@@ -4012,7 +4109,7 @@
4012
4109
  var {
4013
4110
  styles: contextStyles
4014
4111
  } = useCardContext();
4015
- var defaultStyles = getDefaultCardStyles(theme).header;
4112
+ var defaultStyles = getDefaultCardStyles().header;
4016
4113
  // Merge styles: Default < Context Override < Direct Props/Style
4017
4114
  var mergedProps = Object.assign({}, defaultStyles, contextStyles == null ? void 0 : contextStyles.header, props, {
4018
4115
  style: Object.assign({}, defaultStyles == null ? void 0 : defaultStyles.style, contextStyles == null || (_contextStyles$header = contextStyles.header) == null ? void 0 : _contextStyles$header.style, style)
@@ -4030,7 +4127,7 @@
4030
4127
  var {
4031
4128
  styles: contextStyles
4032
4129
  } = useCardContext();
4033
- var defaultStyles = getDefaultCardStyles(theme).content;
4130
+ var defaultStyles = getDefaultCardStyles().content;
4034
4131
  // Merge styles: Default < Context Override < Direct Props/Style
4035
4132
  var mergedProps = Object.assign({}, defaultStyles, contextStyles == null ? void 0 : contextStyles.content, props, {
4036
4133
  style: Object.assign({}, defaultStyles == null ? void 0 : defaultStyles.style, contextStyles == null || (_contextStyles$conten = contextStyles.content) == null ? void 0 : _contextStyles$conten.style, style)
@@ -4048,7 +4145,7 @@
4048
4145
  var {
4049
4146
  styles: contextStyles
4050
4147
  } = useCardContext();
4051
- var defaultStyles = getDefaultCardStyles(theme).footer;
4148
+ var defaultStyles = getDefaultCardStyles().footer;
4052
4149
  // Merge styles: Default < Context Override < Direct Props/Style
4053
4150
  var mergedProps = Object.assign({}, defaultStyles, contextStyles == null ? void 0 : contextStyles.footer, props, {
4054
4151
  style: Object.assign({}, defaultStyles == null ? void 0 : defaultStyles.style, contextStyles == null || (_contextStyles$footer = contextStyles.footer) == null ? void 0 : _contextStyles$footer.style, style)
@@ -4071,7 +4168,7 @@
4071
4168
  } = _ref4,
4072
4169
  props = _objectWithoutPropertiesLoose(_ref4, _excluded4$3);
4073
4170
  var theme = appStudio.useTheme();
4074
- var defaultStyles = getDefaultCardStyles(theme);
4171
+ var defaultStyles = getDefaultCardStyles();
4075
4172
  // Prepare context value, merging default styles with user's `views` overrides
4076
4173
  var contextValue = React.useMemo(() => ({
4077
4174
  styles: {
@@ -4084,12 +4181,7 @@
4084
4181
  // Determine if we have explicit Card.Header, Card.Content, Card.Footer components
4085
4182
  // or if we need to wrap children in a default layout
4086
4183
  var hasExplicitStructure = React__default.Children.toArray(children).some(child => /*#__PURE__*/React__default.isValidElement(child) && (child.type === CardHeader || child.type === CardContent || child.type === CardFooter));
4087
- // Get the appropriate variant styles based on theme mode
4088
- var {
4089
- themeMode
4090
- } = theme;
4091
- var currentThemeMode = elementMode || themeMode;
4092
- var variantStyles = getCardVariants(currentThemeMode)[variant];
4184
+ var variantStyles = getCardVariants()[variant];
4093
4185
  // Merge styles for the root element
4094
4186
  var mergedRootProps = Object.assign({
4095
4187
  width: isFullWidth ? '100%' : 'auto',
@@ -4336,7 +4428,7 @@
4336
4428
  },
4337
4429
  number: {
4338
4430
  backgroundColor: 'theme.primary',
4339
- color: 'white'
4431
+ color: 'color.white'
4340
4432
  }
4341
4433
  };
4342
4434
  var NavigationButtonStyles = {
@@ -4411,7 +4503,7 @@
4411
4503
  _excluded3$5 = ["views", "children"],
4412
4504
  _excluded4$4 = ["children", "views"],
4413
4505
  _excluded5$1 = ["children", "views", "style"],
4414
- _excluded6$1 = ["children", "defaultActiveIndex", "activeIndex", "onChange", "showNavigation", "navigationPosition", "prevButton", "nextButton", "showIndicators", "indicatorPosition", "indicatorVariant", "autoPlay", "autoPlayInterval", "pauseOnHover", "infinite", "direction", "transitionDuration", "views", "themeMode"];
4506
+ _excluded6$1 = ["children", "defaultActiveIndex", "activeIndex", "onChange", "showNavigation", "navigationPosition", "prevButton", "nextButton", "showIndicators", "indicatorPosition", "indicatorVariant", "autoPlay", "autoPlayInterval", "pauseOnHover", "infinite", "direction", "transitionDuration", "views", "stepIndices", "themeMode"];
4415
4507
  var CarouselSlide = _ref => {
4416
4508
  var {
4417
4509
  children,
@@ -4781,7 +4873,7 @@
4781
4873
  // Default styles for tooltip
4782
4874
  var TooltipStyles = {
4783
4875
  position: 'absolute',
4784
- backgroundColor: 'white',
4876
+ backgroundColor: 'color.white',
4785
4877
  padding: '8px 12px',
4786
4878
  borderRadius: '4px',
4787
4879
  boxShadow: '0 2px 5px rgba(0, 0, 0, 0.1)',
@@ -5618,7 +5710,7 @@
5618
5710
  };
5619
5711
  var ContextMenuVariants = {
5620
5712
  default: {
5621
- backgroundColor: 'white',
5713
+ backgroundColor: 'color.white',
5622
5714
  color: 'color.gray.800'
5623
5715
  },
5624
5716
  filled: {
@@ -5626,7 +5718,7 @@
5626
5718
  color: 'color.gray.800'
5627
5719
  },
5628
5720
  outline: {
5629
- backgroundColor: 'white',
5721
+ backgroundColor: 'color.white',
5630
5722
  borderWidth: '1px',
5631
5723
  borderStyle: 'solid',
5632
5724
  borderColor: 'color.gray.200',
@@ -6296,7 +6388,7 @@
6296
6388
  borderWidth: '1px',
6297
6389
  borderStyle: 'solid',
6298
6390
  borderColor: 'color.gray.200',
6299
- backgroundColor: 'white',
6391
+ backgroundColor: 'color.white',
6300
6392
  transition: 'all 0.2s ease',
6301
6393
  _hover: {
6302
6394
  borderColor: 'color.gray.300'
@@ -6304,17 +6396,6 @@
6304
6396
  _focus: {
6305
6397
  borderColor: 'theme.primary',
6306
6398
  boxShadow: '0 0 0 1px rgba(66, 153, 225, 0.2)'
6307
- },
6308
- '@media (prefers-color-scheme: dark)': {
6309
- backgroundColor: 'color.gray.800',
6310
- borderColor: 'color.gray.700',
6311
- _hover: {
6312
- borderColor: 'color.gray.600'
6313
- },
6314
- _focus: {
6315
- borderColor: 'theme.primary',
6316
- boxShadow: '0 0 0 1px rgba(66, 153, 225, 0.4)'
6317
- }
6318
6399
  }
6319
6400
  },
6320
6401
  default: {
@@ -6323,23 +6404,13 @@
6323
6404
  borderBottomStyle: 'solid',
6324
6405
  borderBottomColor: 'color.gray.200',
6325
6406
  borderRadius: 0,
6326
- backgroundColor: 'white',
6407
+ backgroundColor: 'color.white',
6327
6408
  transition: 'all 0.2s ease',
6328
6409
  _hover: {
6329
6410
  borderBottomColor: 'color.gray.300'
6330
6411
  },
6331
6412
  _focus: {
6332
6413
  borderBottomColor: 'theme.primary'
6333
- },
6334
- '@media (prefers-color-scheme: dark)': {
6335
- backgroundColor: 'color.gray.800',
6336
- borderBottomColor: 'color.gray.700',
6337
- _hover: {
6338
- borderBottomColor: 'color.gray.600'
6339
- },
6340
- _focus: {
6341
- borderBottomColor: 'theme.primary'
6342
- }
6343
6414
  }
6344
6415
  },
6345
6416
  none: {
@@ -6471,7 +6542,7 @@
6471
6542
  }
6472
6543
  };
6473
6544
 
6474
- var _excluded$l = ["children", "heading", "isItalic", "isUnderlined", "isStriked", "weight", "size"];
6545
+ var _excluded$l = ["children", "heading", "isItalic", "isUnderlined", "isStriked", "weight", "size", "dropDown"];
6475
6546
  var LabelView = _ref => {
6476
6547
  var {
6477
6548
  children,
@@ -6681,11 +6752,7 @@
6681
6752
  // State properties
6682
6753
  cursor: isDisabled ? 'not-allowed' : 'pointer',
6683
6754
  // Animation
6684
- transition: 'all 0.2s ease',
6685
- // Dark mode support
6686
- '@media (prefers-color-scheme: dark)': {
6687
- color: isDisabled ? 'color.gray.600' : 'color.gray.100'
6688
- }
6755
+ transition: 'all 0.2s ease'
6689
6756
  }, views['field'], views['text']);
6690
6757
  var option = options.length > 0 && options.find(option => option.value === value);
6691
6758
  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 :
@@ -6744,9 +6811,7 @@
6744
6811
  var DropDown = _ref5 => {
6745
6812
  var {
6746
6813
  size,
6747
- views = {
6748
- dropDown: {}
6749
- },
6814
+ views = {},
6750
6815
  options,
6751
6816
  callback = () => {},
6752
6817
  highlightedIndex,
@@ -6775,7 +6840,7 @@
6775
6840
  ,
6776
6841
  overflowY: "auto",
6777
6842
  zIndex: 1000,
6778
- backgroundColor: "white",
6843
+ backgroundColor: "color.white",
6779
6844
  borderRadius: "8px" // Consistent with design system (rounded-md)
6780
6845
  ,
6781
6846
  borderWidth: "1px",
@@ -6796,7 +6861,7 @@
6796
6861
  borderRadius: '4px'
6797
6862
  }
6798
6863
  }
6799
- }, shadow, views['dropDown']), options.length > 0 && options.map((option, index) => (/*#__PURE__*/React__default.createElement(Item, Object.assign({
6864
+ }, shadow, views == null ? void 0 : views.dropDown), options.length > 0 && options.map((option, index) => (/*#__PURE__*/React__default.createElement(Item, Object.assign({
6800
6865
  key: option.value,
6801
6866
  size: size,
6802
6867
  style: views['text'],
@@ -7106,7 +7171,7 @@
7106
7171
  }
7107
7172
  };
7108
7173
 
7109
- var _excluded$p = ["id", "name", "label", "inActiveChild", "activeChild", "labelPosition", "shadow", "size", "value", "isHovered", "isDisabled", "isReadOnly", "on", "setOn", "onChange", "setValue", "setIsHovered", "helperText", "views"];
7174
+ var _excluded$p = ["id", "name", "label", "inActiveChild", "isChecked", "activeChild", "labelPosition", "shadow", "size", "value", "isHovered", "isDisabled", "isReadOnly", "on", "setOn", "onChange", "setValue", "setIsHovered", "helperText", "views"];
7110
7175
  var SwitchContent = props => /*#__PURE__*/React__default.createElement(appStudio.Input, Object.assign({
7111
7176
  type: "checkbox"
7112
7177
  }, props));
@@ -7484,7 +7549,9 @@
7484
7549
  getColor,
7485
7550
  themeMode
7486
7551
  } = appStudio.useTheme();
7487
- var IconColor = getColor('color.blueGray.700', elementMode ? elementMode : themeMode);
7552
+ var IconColor = getColor('color.blueGray.700', {
7553
+ themeMode: elementMode ? elementMode : themeMode
7554
+ });
7488
7555
  var showLabel = !!(isFocused && label);
7489
7556
  /**
7490
7557
  * Styles for the input field
@@ -7513,11 +7580,7 @@
7513
7580
  // State properties
7514
7581
  cursor: isDisabled ? 'not-allowed' : 'text',
7515
7582
  // Animation
7516
- transition: 'all 0.2s ease',
7517
- // Dark mode support
7518
- '@media (prefers-color-scheme: dark)': {
7519
- color: isDisabled ? 'color.gray.600' : 'color.gray.100'
7520
- }
7583
+ transition: 'all 0.2s ease'
7521
7584
  }, views['field']);
7522
7585
  var handleFocus = () => {
7523
7586
  setIsFocused(true);
@@ -7674,19 +7737,19 @@
7674
7737
  selected: {
7675
7738
  backgroundColor: 'theme.primary',
7676
7739
  borderColor: 'theme.primary',
7677
- color: 'white'
7740
+ color: 'color.white'
7678
7741
  },
7679
7742
  unselected: {
7680
- backgroundColor: 'transparent',
7743
+ backgroundColor: 'color.white',
7681
7744
  borderWidth: '2px',
7682
7745
  borderStyle: 'solid',
7683
7746
  borderColor: 'color.gray.300',
7684
- color: 'transparent'
7747
+ color: 'color.black'
7685
7748
  },
7686
7749
  indeterminate: {
7687
7750
  backgroundColor: 'theme.primary',
7688
7751
  borderColor: 'theme.primary',
7689
- color: 'white'
7752
+ color: 'color.white'
7690
7753
  }
7691
7754
  };
7692
7755
  /**
@@ -9420,7 +9483,7 @@
9420
9483
  borderRadius: 4,
9421
9484
  position: "absolute",
9422
9485
  flexDirection: "column",
9423
- backgroundColor: "white",
9486
+ backgroundColor: "color.white",
9424
9487
  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"
9425
9488
  }, views['dropDown']), options.map(option => (/*#__PURE__*/React__default.createElement(DropDownItem, Object.assign({
9426
9489
  key: option.code,
@@ -9470,7 +9533,9 @@
9470
9533
  getColor,
9471
9534
  themeMode
9472
9535
  } = appStudio.useTheme();
9473
- var IconColor = getColor('color.blueGray.700', elementMode ? elementMode : themeMode);
9536
+ var IconColor = getColor('color.blueGray.700', {
9537
+ themeMode: elementMode ? elementMode : themeMode
9538
+ });
9474
9539
  var handleHover = () => setIsHovered(!isHovered);
9475
9540
  var handleFocus = () => setIsFocused(true);
9476
9541
  var handleCallback = option => {
@@ -9498,8 +9563,8 @@
9498
9563
  var showLabel = !!(label && (isFocused || value));
9499
9564
  var fieldStyles = Object.assign({
9500
9565
  margin: 0,
9501
- paddingVerical: 8,
9502
- paddingHorizonatl: 0,
9566
+ paddingVertical: 8,
9567
+ paddingHorizontal: 0,
9503
9568
  width: '100%',
9504
9569
  heigth: '100%',
9505
9570
  border: 'none',
@@ -9847,7 +9912,7 @@
9847
9912
  position: "relative"
9848
9913
  }, /*#__PURE__*/React__default.createElement(appStudio.Horizontal, Object.assign({
9849
9914
  cursor: "pointer",
9850
- backgroundColor: "white",
9915
+ backgroundColor: "color.white",
9851
9916
  boxShadow: "rgba(0, 0, 0, 0.16) 0px 1px 4px",
9852
9917
  padding: "12px",
9853
9918
  display: "flex",
@@ -9869,7 +9934,7 @@
9869
9934
  }, views == null ? void 0 : views.label), selectedItem.label)), right, isDropdownVisible && (/*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({
9870
9935
  id: "combobox-dropdown",
9871
9936
  position: "absolute",
9872
- backgroundColor: "white",
9937
+ backgroundColor: "color.white",
9873
9938
  boxShadow: "rgba(0, 0 ,0 ,0.16) 0px 1px 4px",
9874
9939
  width: "100%",
9875
9940
  overflowY: "auto",
@@ -9963,6 +10028,12 @@
9963
10028
  onChange,
9964
10029
  onChangeText,
9965
10030
  onComplete,
10031
+ onKeyDown,
10032
+ onKeyPress,
10033
+ onBlur,
10034
+ onFocus,
10035
+ isReadOnly,
10036
+ isDisabled,
9966
10037
  pattern,
9967
10038
  stepValues,
9968
10039
  pasteTransformer
@@ -10076,6 +10147,16 @@
10076
10147
  var handleKeyDown = React.useCallback(_ => {
10077
10148
  // Handle special keys like backspace, arrows, etc.
10078
10149
  // This is handled by the browser for the single input
10150
+ if (onKeyDown) {
10151
+ onKeyDown(_);
10152
+ }
10153
+ }, []);
10154
+ var handleKeyPress = React.useCallback(e => {
10155
+ // Handle key press events
10156
+ // This is handled by the browser for the single input
10157
+ if (onKeyPress) {
10158
+ onKeyPress(e);
10159
+ }
10079
10160
  }, []);
10080
10161
  var handlePaste = React.useCallback(e => {
10081
10162
  var input = inputRef.current;
@@ -10232,11 +10313,12 @@
10232
10313
  handleFocus,
10233
10314
  handleBlur,
10234
10315
  handleKeyDown,
10316
+ handleKeyPress,
10235
10317
  handlePaste
10236
10318
  };
10237
10319
  };
10238
10320
 
10239
- 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"];
10321
+ 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"];
10240
10322
  // Create a context for OTP input slots
10241
10323
  var OTPInputContext = /*#__PURE__*/React.createContext({
10242
10324
  slots: [],
@@ -10244,7 +10326,7 @@
10244
10326
  isHovering: false
10245
10327
  });
10246
10328
  // CSS for noscript fallback
10247
- 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}";
10329
+ 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";
10248
10330
  // Helper function to safely insert CSS rules
10249
10331
  function safeInsertRule(sheet, rule) {
10250
10332
  try {
@@ -10492,7 +10574,8 @@
10492
10574
  handleFocus,
10493
10575
  handleBlur,
10494
10576
  handleKeyDown,
10495
- handlePaste
10577
+ handlePaste,
10578
+ handleKeyPress
10496
10579
  } = useOTPInputState(props);
10497
10580
  // Use the controlled value if it exists, otherwise use the internal state value
10498
10581
  var displayValue = controlledValue !== undefined ? controlledValue : value;
@@ -10514,6 +10597,7 @@
10514
10597
  handleFocus: handleFocus,
10515
10598
  handleBlur: handleBlur,
10516
10599
  handleKeyDown: handleKeyDown,
10600
+ handleKeyPress: handleKeyPress,
10517
10601
  handlePaste: handlePaste,
10518
10602
  stepValues: props.stepValues
10519
10603
  }));
@@ -11067,7 +11151,7 @@
11067
11151
  }
11068
11152
  };
11069
11153
 
11070
- 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"];
11154
+ 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"];
11071
11155
  var SliderView = _ref => {
11072
11156
  var _views$tooltip, _views$tooltip2;
11073
11157
  var {
@@ -11083,7 +11167,7 @@
11083
11167
  isDisabled = false,
11084
11168
  showValue = false,
11085
11169
  showTooltip = false,
11086
- colorScheme = 'theme.primary',
11170
+ backgroundColor = 'theme.primary',
11087
11171
  label,
11088
11172
  helperText,
11089
11173
  themeMode: elementMode,
@@ -11115,9 +11199,15 @@
11115
11199
  getColor,
11116
11200
  themeMode
11117
11201
  } = appStudio.useTheme();
11118
- var themeColor = getColor(colorScheme, elementMode || themeMode);
11119
- var disabledColor = getColor('theme.disabled', elementMode || themeMode);
11120
- var trackColor = getColor(SliderVariants[variant].backgroundColor, elementMode || themeMode);
11202
+ var themeColor = getColor(backgroundColor, {
11203
+ themeMode: elementMode || themeMode
11204
+ });
11205
+ var disabledColor = getColor('theme.disabled', {
11206
+ themeMode: elementMode || themeMode
11207
+ });
11208
+ var trackColor = getColor(SliderVariants[variant].backgroundColor, {
11209
+ themeMode: elementMode || themeMode
11210
+ });
11121
11211
  var isVertical = orientation === 'vertical';
11122
11212
  var {
11123
11213
  trackCrossAxisSize,
@@ -11187,7 +11277,7 @@
11187
11277
  top: "50%",
11188
11278
  left: thumbPositionPercent + "%",
11189
11279
  borderRadius: "50%",
11190
- backgroundColor: "white",
11280
+ backgroundColor: "color.white",
11191
11281
  boxShadow: "0 2px 4px rgba(0, 0, 0, 0.2)",
11192
11282
  border: "2px solid " + (isDisabled ? disabledColor : themeColor),
11193
11283
  transition: isDragging ? 'none' : 'transform 0.1s ease-in-out',
@@ -11931,12 +12021,12 @@
11931
12021
  } = _ref;
11932
12022
  var finalPreviewUrl = externalPreviewUrl || previewUrl;
11933
12023
  // Debug log to help troubleshoot
11934
- console.log('Uploader state:', {
11935
- fileType,
11936
- finalPreviewUrl,
11937
- selectedFile: selectedFile == null ? void 0 : selectedFile.name,
11938
- progress
11939
- });
12024
+ // console.log('Uploader state:', {
12025
+ // fileType,
12026
+ // finalPreviewUrl,
12027
+ // selectedFile: selectedFile?.name,
12028
+ // progress,
12029
+ // });
11940
12030
  return /*#__PURE__*/React__default.createElement(appStudio.Center, Object.assign({
11941
12031
  onClick: handleClick,
11942
12032
  cursor: "pointer",
@@ -12187,7 +12277,7 @@
12187
12277
  };
12188
12278
 
12189
12279
  var _excluded$H = ["children", "blur", "isOpen", "isClosePrevented", "onClose", "position", "views"],
12190
- _excluded2$c = ["children", "shadow", "isFullScreen", "shape", "views"],
12280
+ _excluded2$c = ["children", "shadow", "isFullScreen", "shape", "views", "isOpen"],
12191
12281
  _excluded3$9 = ["children", "buttonColor", "iconSize", "buttonPosition", "views"],
12192
12282
  _excluded4$7 = ["children", "views"],
12193
12283
  _excluded5$3 = ["children", "views"];
@@ -12255,7 +12345,7 @@
12255
12345
  };
12256
12346
  return /*#__PURE__*/React__default.createElement(appStudio.Vertical, Object.assign({
12257
12347
  cursor: "default",
12258
- backgroundColor: "white",
12348
+ backgroundColor: "color.white",
12259
12349
  width: isFullScreen ? '100%' : 600,
12260
12350
  height: isFullScreen ? '100%' : 'fit-content',
12261
12351
  onClick: handleClick,
@@ -13073,7 +13163,9 @@
13073
13163
  return foundTab;
13074
13164
  }
13075
13165
  // Warn if initialTabValue is provided but not found
13076
- console.warn("Tabs: initialTabValue \"" + initialTabValue + "\" not found in tabs. Defaulting to the first tab.");
13166
+ // console.warn(
13167
+ // `Tabs: initialTabValue "${initialTabValue}" not found in tabs. Defaulting to the first tab.`
13168
+ // );
13077
13169
  }
13078
13170
  return propTabs[0]; // Default to the first tab
13079
13171
  };
@@ -13660,7 +13752,7 @@
13660
13752
  };
13661
13753
  var DropdownMenuVariants = {
13662
13754
  default: {
13663
- backgroundColor: 'white',
13755
+ backgroundColor: 'color.white',
13664
13756
  color: 'color.gray.800'
13665
13757
  },
13666
13758
  filled: {
@@ -13668,7 +13760,7 @@
13668
13760
  color: 'color.gray.800'
13669
13761
  },
13670
13762
  outline: {
13671
- backgroundColor: 'white',
13763
+ backgroundColor: 'color.white',
13672
13764
  borderWidth: '1px',
13673
13765
  borderStyle: 'solid',
13674
13766
  borderColor: 'color.gray.200',
@@ -14548,7 +14640,7 @@
14548
14640
  position: "absolute",
14549
14641
  zIndex: 1000,
14550
14642
  minWidth: "200px",
14551
- backgroundColor: "white",
14643
+ backgroundColor: "color.white",
14552
14644
  borderRadius: 4,
14553
14645
  boxShadow: "0px 2px 8px rgba(0, 0, 0, 0.15)",
14554
14646
  overflow: "hidden"
@@ -14800,7 +14892,7 @@
14800
14892
  };
14801
14893
  var ActivePageButtonStyles = {
14802
14894
  backgroundColor: 'color.blue.500',
14803
- color: 'white',
14895
+ color: 'color.white',
14804
14896
  _hover: {
14805
14897
  backgroundColor: 'color.blue.600'
14806
14898
  }
@@ -14953,7 +15045,7 @@
14953
15045
  borderWidth: "1px",
14954
15046
  borderStyle: "solid",
14955
15047
  borderColor: "color.gray.200",
14956
- backgroundColor: "white",
15048
+ backgroundColor: "color.white",
14957
15049
  cursor: "pointer",
14958
15050
  value: pageSize,
14959
15051
  onChange: handlePageSizeChange
@@ -15229,7 +15321,7 @@
15229
15321
  var getSidebar = themeMode => {
15230
15322
  return {
15231
15323
  default: {
15232
- backgroundColor: 'white',
15324
+ backgroundColor: 'color.white',
15233
15325
  color: 'color.gray.800',
15234
15326
  transition: 'all 0.2s ease'
15235
15327
  },
@@ -15239,7 +15331,7 @@
15239
15331
  transition: 'all 0.2s ease'
15240
15332
  },
15241
15333
  outline: {
15242
- backgroundColor: 'white',
15334
+ backgroundColor: 'color.white',
15243
15335
  borderWidth: '1px',
15244
15336
  borderStyle: 'solid',
15245
15337
  borderColor: 'color.gray.200',
@@ -15252,7 +15344,7 @@
15252
15344
  transition: 'all 0.2s ease'
15253
15345
  },
15254
15346
  elevated: {
15255
- backgroundColor: 'white',
15347
+ backgroundColor: 'color.white',
15256
15348
  boxShadow: '0px 4px 8px rgba(0, 0, 0, 0.1)',
15257
15349
  color: 'color.gray.800',
15258
15350
  transition: 'all 0.2s ease'
@@ -15981,7 +16073,7 @@
15981
16073
 
15982
16074
  var _excluded$X = ["children", "id", "defaultSize", "minSize", "maxSize", "collapsible", "defaultCollapsed", "onCollapseChange", "views"],
15983
16075
  _excluded2$g = ["id", "position", "disabled", "withVisualIndicator", "withCollapseButton", "collapseTarget", "views"],
15984
- _excluded3$c = ["children", "orientation", "size", "variant", "defaultSizes", "minSize", "maxSize", "collapsible", "containerRef", "views"];
16076
+ _excluded3$c = ["children", "orientation", "size", "variant", "defaultSizes", "minSize", "maxSize", "collapsible", "containerRef", "autoSaveId", "views"];
15985
16077
  // Create context for the Resizable component
15986
16078
  var ResizableContext = /*#__PURE__*/React.createContext({
15987
16079
  orientation: 'horizontal',
@@ -16777,6 +16869,16 @@
16777
16869
  // Export the hook for component usage
16778
16870
  var useToast$1 = useToast;
16779
16871
 
16872
+ // Default filter function defined outside the hook to avoid recreating it on each render
16873
+ var defaultFilterFn = (value, item) => {
16874
+ var _item$description, _item$keywords;
16875
+ if (!value) return true;
16876
+ var searchValue = value.toLowerCase();
16877
+ var matchesName = item.name.toLowerCase().includes(searchValue);
16878
+ var matchesDescription = ((_item$description = item.description) == null ? void 0 : _item$description.toLowerCase().includes(searchValue)) || false;
16879
+ var matchesKeywords = ((_item$keywords = item.keywords) == null ? void 0 : _item$keywords.some(keyword => keyword.toLowerCase().includes(searchValue))) || false;
16880
+ return matchesName || matchesDescription || matchesKeywords;
16881
+ };
16780
16882
  var useCommandState = _ref => {
16781
16883
  var {
16782
16884
  open,
@@ -16785,46 +16887,36 @@
16785
16887
  commands = [],
16786
16888
  filter
16787
16889
  } = _ref;
16788
- // Combine commands from groups and flat list
16789
- var allCommands = React.useCallback(() => {
16790
- var groupCommands = groups.flatMap(group => group.commands);
16791
- return [...groupCommands, ...commands];
16792
- }, [groups, commands]);
16793
16890
  // State for search input
16794
16891
  var [search, setSearch] = React.useState('');
16795
16892
  // State for selected item index
16796
16893
  var [selectedIndex, setSelectedIndex] = React.useState(0);
16797
16894
  // Ref for the command list element
16798
16895
  var listRef = React.useRef(null);
16799
- // Default filter function
16800
- var defaultFilter = (value, item) => {
16801
- var _item$description, _item$keywords;
16802
- if (!value) return true;
16803
- var searchValue = value.toLowerCase();
16804
- var matchesName = item.name.toLowerCase().includes(searchValue);
16805
- var matchesDescription = ((_item$description = item.description) == null ? void 0 : _item$description.toLowerCase().includes(searchValue)) || false;
16806
- var matchesKeywords = ((_item$keywords = item.keywords) == null ? void 0 : _item$keywords.some(keyword => keyword.toLowerCase().includes(searchValue))) || false;
16807
- return matchesName || matchesDescription || matchesKeywords;
16808
- };
16809
- // Filter commands based on search
16810
- var filterCommands = React.useCallback(searchValue => {
16811
- var filterFn = filter || defaultFilter;
16812
- return allCommands().filter(item => filterFn(searchValue, item));
16813
- }, [allCommands, filter, defaultFilter]);
16814
- // Filtered commands based on search
16815
- var [filteredCommands, setFilteredCommands] = React.useState(allCommands());
16816
- // Filtered groups based on search
16817
- var filteredGroups = React.useCallback(() => {
16896
+ // Use the provided filter or fall back to the default
16897
+ var filterFn = React.useMemo(() => filter || defaultFilterFn, [filter]);
16898
+ // Combine and memoize all commands from groups and flat list
16899
+ var allCommands = React.useMemo(() => {
16900
+ var groupCommands = groups.flatMap(group => group.commands);
16901
+ return [...groupCommands, ...commands];
16902
+ }, [groups, commands]);
16903
+ // Filter and memoize commands based on search
16904
+ var filteredCommands = React.useMemo(() => {
16905
+ if (!search.trim()) return allCommands;
16906
+ return allCommands.filter(item => filterFn(search, item));
16907
+ }, [allCommands, search, filterFn]);
16908
+ // Filter and memoize groups based on search
16909
+ var filteredGroups = React.useMemo(() => {
16818
16910
  if (!search) return groups;
16819
- return groups.map(group => Object.assign({}, group, {
16820
- commands: group.commands.filter(command => (filter || defaultFilter)(search, command))
16821
- })).filter(group => group.commands.length > 0);
16822
- }, [groups, search, filter, defaultFilter]);
16823
- // Update filtered commands when search changes
16911
+ var filterFn = filter || defaultFilterFn;
16912
+ return groups.map(g => Object.assign({}, g, {
16913
+ commands: g.commands.filter(c => filterFn(search, c))
16914
+ })).filter(g => g.commands.length);
16915
+ }, [groups, search, filter]);
16916
+ // Reset selected index when filtered commands change
16824
16917
  React.useEffect(() => {
16825
- setFilteredCommands(filterCommands(search));
16826
16918
  setSelectedIndex(0);
16827
- }, [search, filterCommands]);
16919
+ }, [filteredCommands.length]);
16828
16920
  // Handle keyboard navigation
16829
16921
  var handleKeyDown = React.useCallback(e => {
16830
16922
  if (!open) return;
@@ -16874,6 +16966,9 @@
16874
16966
  React.useEffect(() => {
16875
16967
  if (open) {
16876
16968
  setSelectedIndex(0);
16969
+ } else {
16970
+ // Clear search when closed
16971
+ setSearch('');
16877
16972
  }
16878
16973
  }, [open]);
16879
16974
  return {
@@ -16882,7 +16977,7 @@
16882
16977
  selectedIndex,
16883
16978
  setSelectedIndex,
16884
16979
  filteredCommands,
16885
- filteredGroups: filteredGroups(),
16980
+ filteredGroups,
16886
16981
  listRef
16887
16982
  };
16888
16983
  };
@@ -16904,7 +16999,7 @@
16904
16999
  var getCommand = themeMode => {
16905
17000
  return {
16906
17001
  default: {
16907
- backgroundColor: 'white',
17002
+ backgroundColor: 'color.white',
16908
17003
  borderWidth: '1px',
16909
17004
  borderStyle: 'solid',
16910
17005
  borderColor: 'color.gray.200',
@@ -16918,7 +17013,7 @@
16918
17013
  boxShadow: '0px 4px 20px rgba(0, 0, 0, 0.1)'
16919
17014
  },
16920
17015
  outline: {
16921
- backgroundColor: 'white',
17016
+ backgroundColor: 'color.white',
16922
17017
  borderWidth: '2px',
16923
17018
  borderStyle: 'solid',
16924
17019
  borderColor: 'color.gray.300',
@@ -17151,26 +17246,21 @@
17151
17246
  } = _ref7,
17152
17247
  props = _objectWithoutPropertiesLoose(_ref7, _excluded6$3);
17153
17248
  if (!open) return null;
17154
- var handleItemSelect = item => {
17155
- if (!item.disabled) {
17156
- item.onSelect();
17157
- onOpenChange(false);
17158
- setSearch('');
17159
- }
17160
- };
17161
- var handleBackdropClick = e => {
17162
- if (e.target === e.currentTarget) {
17163
- onOpenChange(false);
17164
- }
17165
- };
17166
- var contextValue = {
17249
+ var handleItemSelect = React__default.useCallback(item => {
17250
+ if (item.disabled) return;
17251
+ item.onSelect();
17252
+ onOpenChange(false);
17253
+ setSearch('');
17254
+ }, [onOpenChange, setSearch]);
17255
+ var handleBackdropClick = React__default.useCallback(e => e.target === e.currentTarget && onOpenChange(false), [onOpenChange]);
17256
+ var contextValue = React__default.useMemo(() => ({
17167
17257
  search,
17168
17258
  setSearch,
17169
17259
  selectedIndex,
17170
17260
  setSelectedIndex,
17171
17261
  filteredCommands,
17172
17262
  onSelect: handleItemSelect
17173
- };
17263
+ }), [search, selectedIndex, filteredCommands, handleItemSelect, setSearch, setSelectedIndex]);
17174
17264
  var hasGroups = groups.length > 0;
17175
17265
  // const hasCommands = commands.length > 0;
17176
17266
  var isEmpty = filteredCommands.length === 0;