@app-studio/web 0.8.80 → 0.8.82

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 {};
@@ -3525,78 +3526,6 @@ var IconSizes$1 = {
3525
3526
  padding: 14
3526
3527
  }
3527
3528
  };
3528
- /**
3529
- * Button variants with consistent styling
3530
- */
3531
- var getButtonVariants = (color, isLight) => ({
3532
- filled: {
3533
- backgroundColor: color,
3534
- color: isLight ? 'color.gray.900' : 'color.white',
3535
- borderWidth: 1,
3536
- borderStyle: 'solid',
3537
- borderColor: 'transparent',
3538
- on: {
3539
- hover: {
3540
- filter: 'brightness(0.9)',
3541
- transform: 'translateY(-1px)'
3542
- },
3543
- active: {
3544
- filter: 'brightness(0.85)',
3545
- transform: 'translateY(0)'
3546
- }
3547
- },
3548
- transition: 'all 0.2s ease'
3549
- },
3550
- outline: {
3551
- backgroundColor: 'transparent',
3552
- borderWidth: 1,
3553
- borderStyle: 'solid',
3554
- borderColor: color,
3555
- color: color,
3556
- on: {
3557
- hover: {
3558
- backgroundColor: color + "10",
3559
- transform: 'translateY(-1px)'
3560
- },
3561
- active: {
3562
- backgroundColor: color + "20",
3563
- transform: 'translateY(0)'
3564
- }
3565
- },
3566
- transition: 'all 0.2s ease'
3567
- },
3568
- ghost: {
3569
- backgroundColor: 'transparent',
3570
- color: color,
3571
- borderWidth: 0,
3572
- borderStyle: 'none',
3573
- borderColor: 'transparent',
3574
- on: {
3575
- hover: {
3576
- backgroundColor: color + "10",
3577
- transform: 'translateY(-1px)'
3578
- },
3579
- active: {
3580
- backgroundColor: color + "20",
3581
- transform: 'translateY(0)'
3582
- }
3583
- },
3584
- transition: 'all 0.2s ease'
3585
- },
3586
- link: {
3587
- backgroundColor: 'transparent',
3588
- color: color,
3589
- textDecoration: 'underline',
3590
- textUnderlineOffset: 2,
3591
- on: {
3592
- hover: {
3593
- textDecoration: 'underline',
3594
- textDecorationThickness: 2
3595
- }
3596
- },
3597
- transition: 'all 0.2s ease'
3598
- }
3599
- });
3600
3529
 
3601
3530
  // Defines a mapping of spinning speed labels to their respective duration in seconds for the Loader component animations.
3602
3531
  // Sets up a scale of sizes, mapping size labels to numerical values to be used for Loader component dimensions.
@@ -3790,7 +3719,9 @@ React__default.createElement(LoaderView, Object.assign({}, props)));
3790
3719
  // Exports the LoaderComponent as Loader, making it available for use in other parts of the application.
3791
3720
  var Loader = LoaderComponent;
3792
3721
 
3793
- 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", "containerProps", "linkProps", "views"];
3722
+ 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"],
3723
+ _excluded2$3 = ["_hover", "_active"],
3724
+ _excluded3$3 = ["height"];
3794
3725
  var contrast = /*#__PURE__*/require('contrast');
3795
3726
  var ButtonView = _ref => {
3796
3727
  var _props$onClick;
@@ -3813,11 +3744,12 @@ var ButtonView = _ref => {
3813
3744
  loaderProps = {},
3814
3745
  loaderPosition = 'left',
3815
3746
  effect = 'default',
3747
+ isHovered,
3816
3748
  setIsHovered = () => {},
3817
3749
  isExternal = false,
3818
3750
  themeMode: elementMode,
3819
- linkProps,
3820
- views
3751
+ views,
3752
+ colorScheme = 'theme.primary'
3821
3753
  } = _ref,
3822
3754
  props = _objectWithoutPropertiesLoose(_ref, _excluded$a);
3823
3755
  var {
@@ -3829,13 +3761,81 @@ var ButtonView = _ref => {
3829
3761
  var defaultNativeProps = {
3830
3762
  disabled: !isActive
3831
3763
  };
3832
- var buttonColor = isActive ? 'theme.primary' : 'theme.disabled';
3833
- // We'll handle hover effects through CSS transitions in the style
3764
+ var buttonColor = isActive ? colorScheme : 'theme.disabled';
3765
+ var hovering = isHovered && effect === 'hover';
3766
+ var reverse = isHovered && effect === 'reverse';
3834
3767
  // Determine if the button color is light or dark for proper contrast
3835
- var isLight = contrast(getColor(buttonColor, elementMode ? elementMode : themeMode)) == 'light';
3836
- // Get button variants based on color and light/dark status
3837
- var ButtonVariants = getButtonVariants(buttonColor, isLight);
3838
- // Note: Effects are now handled through CSS transitions in the style definitions
3768
+ var buttonMode = elementMode ? elementMode : themeMode;
3769
+ var reverseMode = reverse && buttonMode == 'light' ? 'dark' : "light"; // Slightly darker
3770
+ var isLight = contrast(getColor(buttonColor, buttonMode)) == 'light';
3771
+ // Define button variants with effect support
3772
+ var ButtonVariants = {
3773
+ filled: {
3774
+ backgroundColor: reverse ? 'transparent' : buttonColor,
3775
+ color: reverse ? isLight ? 'white' : buttonColor : isLight ? buttonColor : 'white',
3776
+ borderWidth: 1,
3777
+ borderStyle: 'solid',
3778
+ borderColor: reverse ? buttonColor : 'transparent',
3779
+ _hover: {
3780
+ themeMode: reverse && buttonMode == 'light' ? 'light' : "dark",
3781
+ transform: 'translateY(-1px)',
3782
+ boxShadow: '0 4px 8px rgba(0, 0, 0, 0.1)'
3783
+ },
3784
+ _active: {
3785
+ themeMode: reverse && buttonMode == 'light' ? 'light' : "dark",
3786
+ transform: 'translateY(0)',
3787
+ boxShadow: '0 2px 4px rgba(0, 0, 0, 0.1)'
3788
+ }
3789
+ },
3790
+ outline: {
3791
+ backgroundColor: reverse ? buttonColor : 'transparent',
3792
+ borderWidth: 1,
3793
+ borderStyle: 'solid',
3794
+ borderColor: reverse ? buttonColor : colorScheme,
3795
+ color: reverse ? 'white' : buttonColor,
3796
+ _hover: {
3797
+ themeMode: reverse ? reverseMode : buttonMode,
3798
+ transform: 'translateY(-1px)',
3799
+ boxShadow: '0 4px 8px rgba(0, 0, 0, 0.05)'
3800
+ },
3801
+ _active: {
3802
+ themeMode: reverse ? reverseMode : buttonMode,
3803
+ transform: 'translateY(0)',
3804
+ boxShadow: '0 2px 4px rgba(0, 0, 0, 0.05)'
3805
+ }
3806
+ },
3807
+ link: {
3808
+ backgroundColor: 'transparent',
3809
+ borderWidth: 0,
3810
+ borderStyle: 'none',
3811
+ borderColor: 'transparent',
3812
+ color: buttonColor,
3813
+ textDecoration: reverse ? 'none' : 'underline',
3814
+ _hover: {
3815
+ opacity: 0.8,
3816
+ textDecorationThickness: '2px'
3817
+ },
3818
+ _active: {
3819
+ opacity: 0.8,
3820
+ textDecorationThickness: '2px'
3821
+ }
3822
+ },
3823
+ ghost: {
3824
+ backgroundColor: reverse ? buttonColor : 'transparent',
3825
+ color: reverse ? 'white' : buttonColor,
3826
+ borderWidth: 0,
3827
+ borderStyle: 'none',
3828
+ borderColor: 'transparent',
3829
+ _hover: {
3830
+ themeMode: reverse ? reverseMode : buttonMode,
3831
+ transform: 'translateY(-1px)'
3832
+ },
3833
+ _active: {
3834
+ themeMode: reverse ? reverseMode : buttonMode,
3835
+ transform: 'translateY(0)'
3836
+ }
3837
+ }
3838
+ };
3839
3839
  var buttonSizeStyles = ButtonSizes[size];
3840
3840
  var buttonVariant = ButtonVariants[variant];
3841
3841
  var scaleWidth = {
@@ -3862,6 +3862,13 @@ var ButtonView = _ref => {
3862
3862
  }, views == null ? void 0 : views.icon), icon)), isLoading && loaderPosition === 'right' && (/*#__PURE__*/React__default.createElement(Loader, Object.assign({
3863
3863
  size: size === 'xs' || size === 'sm' ? 'sm' : 'md'
3864
3864
  }, loaderProps))));
3865
+ // Extract hover and active styles from buttonVariant
3866
+ var _ref2 = buttonVariant || {},
3867
+ {
3868
+ _hover,
3869
+ _active
3870
+ } = _ref2,
3871
+ baseButtonVariant = _objectWithoutPropertiesLoose(_ref2, _excluded2$3);
3865
3872
  return /*#__PURE__*/React__default.createElement(appStudio.Element, Object.assign({
3866
3873
  gap: 8,
3867
3874
  as: "button",
@@ -3876,12 +3883,22 @@ var ButtonView = _ref => {
3876
3883
  onMouseEnter: () => handleHover(true),
3877
3884
  onMouseLeave: () => handleHover(false),
3878
3885
  cursor: isActive ? 'pointer' : 'default',
3886
+ filter: hovering && effect === 'hover' ? 'brightness(0.85)' : 'brightness(1)',
3887
+ transition: "all 0.2s ease",
3888
+ transform: hovering && effect === 'hover' && !isDisabled ? 'translateY(-5px)' : '',
3879
3889
  // Apply consistent styling according to design guidelines
3880
3890
  // Apply shadow if provided
3881
3891
  boxShadow: shadow ? shadow : undefined
3882
- }, defaultNativeProps, buttonSizeStyles, buttonVariant, scaleWidth, props.padding || props.paddingHorizontal || props.paddingVertical || props.paddingLeft || props.paddingRight || props.paddingTop || props.paddingBottom ? {} : changePadding, props, views == null ? void 0 : views.container), variant === 'link' && to ? (/*#__PURE__*/React__default.createElement(Link, Object.assign({
3892
+ }, defaultNativeProps, (_ref3 => {
3893
+ var rest = _objectWithoutPropertiesLoose(_ref3, _excluded3$3);
3894
+ return rest;
3895
+ })(props), buttonSizeStyles, baseButtonVariant, scaleWidth, props.padding || props.paddingHorizontal || props.paddingVertical || props.paddingLeft || props.paddingRight || props.paddingTop || props.paddingBottom ? {} : changePadding, {
3896
+ // Apply hover and active styles
3897
+ _hover: _hover,
3898
+ _active: _active
3899
+ }, views == null ? void 0 : views.container), variant === 'link' && to ? (/*#__PURE__*/React__default.createElement(Link, Object.assign({
3883
3900
  to: to,
3884
- textDecorationColor: 'theme.primary',
3901
+ textDecorationColor: colorScheme,
3885
3902
  textDecorationThickness: "1px",
3886
3903
  textUnderlineOffset: "2px",
3887
3904
  transition: "all 0.2s ease",
@@ -3889,7 +3906,7 @@ var ButtonView = _ref => {
3889
3906
  _hover: {
3890
3907
  textDecorationThickness: '2px'
3891
3908
  }
3892
- }, linkProps, views == null ? void 0 : views.link), content)) : content);
3909
+ }, views == null ? void 0 : views.link), content)) : content);
3893
3910
  };
3894
3911
 
3895
3912
  // Importing a custom hook to manage the state specific to the button component.
@@ -4012,8 +4029,8 @@ var useCardContext = () => {
4012
4029
  };
4013
4030
 
4014
4031
  var _excluded$b = ["children", "views", "style", "themeMode"],
4015
- _excluded2$3 = ["children", "views", "style", "themeMode"],
4016
- _excluded3$3 = ["children", "views", "style", "themeMode"],
4032
+ _excluded2$4 = ["children", "views", "style", "themeMode"],
4033
+ _excluded3$4 = ["children", "views", "style", "themeMode"],
4017
4034
  _excluded4$3 = ["variant", "size", "shape", "children", "header", "footer", "isFullWidth", "views", "style", "themeMode"];
4018
4035
  var CardHeader = _ref => {
4019
4036
  var _contextStyles$header;
@@ -4039,7 +4056,7 @@ var CardContent = _ref2 => {
4039
4056
  children,
4040
4057
  style
4041
4058
  } = _ref2,
4042
- props = _objectWithoutPropertiesLoose(_ref2, _excluded2$3);
4059
+ props = _objectWithoutPropertiesLoose(_ref2, _excluded2$4);
4043
4060
  var theme = appStudio.useTheme();
4044
4061
  var {
4045
4062
  styles: contextStyles
@@ -4057,7 +4074,7 @@ var CardFooter = _ref3 => {
4057
4074
  children,
4058
4075
  style
4059
4076
  } = _ref3,
4060
- props = _objectWithoutPropertiesLoose(_ref3, _excluded3$3);
4077
+ props = _objectWithoutPropertiesLoose(_ref3, _excluded3$4);
4061
4078
  var theme = appStudio.useTheme();
4062
4079
  var {
4063
4080
  styles: contextStyles
@@ -4421,11 +4438,11 @@ var useCarouselContext = () => {
4421
4438
  };
4422
4439
 
4423
4440
  var _excluded$c = ["children", "isActive", "views"],
4424
- _excluded2$4 = ["views", "children"],
4425
- _excluded3$4 = ["views", "children"],
4441
+ _excluded2$5 = ["views", "children"],
4442
+ _excluded3$5 = ["views", "children"],
4426
4443
  _excluded4$4 = ["children", "views"],
4427
4444
  _excluded5$1 = ["children", "views", "style"],
4428
- _excluded6$1 = ["children", "defaultActiveIndex", "activeIndex", "onChange", "showNavigation", "navigationPosition", "prevButton", "nextButton", "showIndicators", "indicatorPosition", "indicatorVariant", "autoPlay", "autoPlayInterval", "pauseOnHover", "infinite", "direction", "transitionDuration", "views", "themeMode"];
4445
+ _excluded6$1 = ["children", "defaultActiveIndex", "activeIndex", "onChange", "showNavigation", "navigationPosition", "prevButton", "nextButton", "showIndicators", "indicatorPosition", "indicatorVariant", "autoPlay", "autoPlayInterval", "pauseOnHover", "infinite", "direction", "transitionDuration", "views", "stepIndices", "themeMode"];
4429
4446
  var CarouselSlide = _ref => {
4430
4447
  var {
4431
4448
  children,
@@ -4448,7 +4465,7 @@ var CarouselPreviousComponent = _ref2 => {
4448
4465
  children // Allow custom content/icon
4449
4466
  // Spread remaining ButtonProps
4450
4467
  } = _ref2,
4451
- props = _objectWithoutPropertiesLoose(_ref2, _excluded2$4);
4468
+ props = _objectWithoutPropertiesLoose(_ref2, _excluded2$5);
4452
4469
  var {
4453
4470
  goToPrevious,
4454
4471
  canGoPrevious,
@@ -4471,7 +4488,7 @@ var CarouselNextComponent = _ref3 => {
4471
4488
  views,
4472
4489
  children
4473
4490
  } = _ref3,
4474
- props = _objectWithoutPropertiesLoose(_ref3, _excluded3$4);
4491
+ props = _objectWithoutPropertiesLoose(_ref3, _excluded3$5);
4475
4492
  var {
4476
4493
  goToNext,
4477
4494
  canGoNext,
@@ -5715,8 +5732,8 @@ var calculateMenuPosition = function calculateMenuPosition(x, y, menuWidth, menu
5715
5732
  };
5716
5733
 
5717
5734
  var _excluded$e = ["children", "disableNativeContextMenu", "asChild", "isDisabled", "views"],
5718
- _excluded2$5 = ["items", "children", "position", "side", "align", "views", "style"],
5719
- _excluded3$5 = ["item", "children", "onSelect", "isDisabled", "views"],
5735
+ _excluded2$6 = ["items", "children", "position", "side", "align", "views", "style"],
5736
+ _excluded3$6 = ["item", "children", "onSelect", "isDisabled", "views"],
5720
5737
  _excluded4$5 = ["views"],
5721
5738
  _excluded5$2 = ["views"],
5722
5739
  _excluded6$2 = ["children", "items", "size", "variant", "disableNativeContextMenu", "views", "themeMode"];
@@ -5824,7 +5841,7 @@ var ContextMenuContent = _ref3 => {
5824
5841
  views,
5825
5842
  style // Capture user-provided style
5826
5843
  } = _ref3,
5827
- props = _objectWithoutPropertiesLoose(_ref3, _excluded2$5);
5844
+ props = _objectWithoutPropertiesLoose(_ref3, _excluded2$6);
5828
5845
  var {
5829
5846
  isOpen,
5830
5847
  position: contextPosition,
@@ -5895,7 +5912,7 @@ var ContextMenuItem = _ref4 => {
5895
5912
  isDisabled = false,
5896
5913
  views
5897
5914
  } = _ref4,
5898
- props = _objectWithoutPropertiesLoose(_ref4, _excluded3$5);
5915
+ props = _objectWithoutPropertiesLoose(_ref4, _excluded3$6);
5899
5916
  var {
5900
5917
  activeSubmenuId,
5901
5918
  setActiveSubmenuId,
@@ -6121,7 +6138,7 @@ ContextMenu.Divider = ContextMenuDivider;
6121
6138
  ContextMenu.Separator = ContextMenuSeparator; // Add the Separator component
6122
6139
 
6123
6140
  var _excluded$g = ["src", "color", "views", "themeMode"],
6124
- _excluded2$6 = ["path"];
6141
+ _excluded2$7 = ["path"];
6125
6142
  var FileSVG = _ref => {
6126
6143
  var {
6127
6144
  src,
@@ -6151,7 +6168,7 @@ var FileImage = _ref2 => {
6151
6168
  var {
6152
6169
  path
6153
6170
  } = _ref2,
6154
- props = _objectWithoutPropertiesLoose(_ref2, _excluded2$6);
6171
+ props = _objectWithoutPropertiesLoose(_ref2, _excluded2$7);
6155
6172
  return /*#__PURE__*/React__default.createElement(appStudio.Image, Object.assign({
6156
6173
  src: path
6157
6174
  }, props));
@@ -6318,17 +6335,6 @@ var InputVariants = {
6318
6335
  _focus: {
6319
6336
  borderColor: 'theme.primary',
6320
6337
  boxShadow: '0 0 0 1px rgba(66, 153, 225, 0.2)'
6321
- },
6322
- '@media (prefers-color-scheme: dark)': {
6323
- backgroundColor: 'color.gray.800',
6324
- borderColor: 'color.gray.700',
6325
- _hover: {
6326
- borderColor: 'color.gray.600'
6327
- },
6328
- _focus: {
6329
- borderColor: 'theme.primary',
6330
- boxShadow: '0 0 0 1px rgba(66, 153, 225, 0.4)'
6331
- }
6332
6338
  }
6333
6339
  },
6334
6340
  default: {
@@ -6344,16 +6350,6 @@ var InputVariants = {
6344
6350
  },
6345
6351
  _focus: {
6346
6352
  borderBottomColor: 'theme.primary'
6347
- },
6348
- '@media (prefers-color-scheme: dark)': {
6349
- backgroundColor: 'color.gray.800',
6350
- borderBottomColor: 'color.gray.700',
6351
- _hover: {
6352
- borderBottomColor: 'color.gray.600'
6353
- },
6354
- _focus: {
6355
- borderBottomColor: 'theme.primary'
6356
- }
6357
6353
  }
6358
6354
  },
6359
6355
  none: {
@@ -6485,7 +6481,7 @@ var HeadingSizes$1 = {
6485
6481
  }
6486
6482
  };
6487
6483
 
6488
- var _excluded$l = ["children", "heading", "isItalic", "isUnderlined", "isStriked", "weight", "size"];
6484
+ var _excluded$l = ["children", "heading", "isItalic", "isUnderlined", "isStriked", "weight", "size", "dropDown"];
6489
6485
  var LabelView = _ref => {
6490
6486
  var {
6491
6487
  children,
@@ -6604,8 +6600,8 @@ var IconSizes$2 = {
6604
6600
  };
6605
6601
 
6606
6602
  var _excluded$o = ["isHovered", "setIsHovered", "option", "size", "callback", "style"],
6607
- _excluded2$7 = ["id", "name", "value", "onChange", "isMulti", "isDisabled", "isReadOnly", "options"],
6608
- _excluded3$6 = ["option", "size", "removeOption"],
6603
+ _excluded2$8 = ["id", "name", "value", "onChange", "isMulti", "isDisabled", "isReadOnly", "options"],
6604
+ _excluded3$7 = ["option", "size", "removeOption"],
6609
6605
  _excluded4$6 = ["id", "name", "label", "value", "placeholder", "helperText", "hide", "error", "isMulti", "isFocused", "isHovered", "isDisabled", "isReadOnly", "options", "shadow", "size", "shape", "variant", "views", "onChange", "setHide", "setValue", "setIsHovered", "setIsFocused", "setHighlightedIndex", "highlightedIndex"];
6610
6606
  /**
6611
6607
  * Item Component
@@ -6695,11 +6691,7 @@ var SelectBox = _ref2 => {
6695
6691
  // State properties
6696
6692
  cursor: isDisabled ? 'not-allowed' : 'pointer',
6697
6693
  // Animation
6698
- transition: 'all 0.2s ease',
6699
- // Dark mode support
6700
- '@media (prefers-color-scheme: dark)': {
6701
- color: isDisabled ? 'color.gray.600' : 'color.gray.100'
6702
- }
6694
+ transition: 'all 0.2s ease'
6703
6695
  }, views['field'], views['text']);
6704
6696
  var option = options.length > 0 && options.find(option => option.value === value);
6705
6697
  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 :
@@ -6726,7 +6718,7 @@ var HiddenSelect = _ref4 => {
6726
6718
  isReadOnly = false,
6727
6719
  options = []
6728
6720
  } = _ref4,
6729
- props = _objectWithoutPropertiesLoose(_ref4, _excluded2$7);
6721
+ props = _objectWithoutPropertiesLoose(_ref4, _excluded2$8);
6730
6722
  var handleChange = event => {
6731
6723
  if (onChange) onChange(event);
6732
6724
  };
@@ -6758,9 +6750,7 @@ var HiddenSelect = _ref4 => {
6758
6750
  var DropDown = _ref5 => {
6759
6751
  var {
6760
6752
  size,
6761
- views = {
6762
- dropDown: {}
6763
- },
6753
+ views = {},
6764
6754
  options,
6765
6755
  callback = () => {},
6766
6756
  highlightedIndex,
@@ -6810,7 +6800,7 @@ var DropDown = _ref5 => {
6810
6800
  borderRadius: '4px'
6811
6801
  }
6812
6802
  }
6813
- }, shadow, views['dropDown']), options.length > 0 && options.map((option, index) => (/*#__PURE__*/React__default.createElement(Item, Object.assign({
6803
+ }, shadow, views == null ? void 0 : views.dropDown), options.length > 0 && options.map((option, index) => (/*#__PURE__*/React__default.createElement(Item, Object.assign({
6814
6804
  key: option.value,
6815
6805
  size: size,
6816
6806
  style: views['text'],
@@ -6831,7 +6821,7 @@ var MultiSelect = _ref6 => {
6831
6821
  size = 'md',
6832
6822
  removeOption = () => {}
6833
6823
  } = _ref6,
6834
- props = _objectWithoutPropertiesLoose(_ref6, _excluded3$6);
6824
+ props = _objectWithoutPropertiesLoose(_ref6, _excluded3$7);
6835
6825
  var handleClick = () => removeOption(option);
6836
6826
  return /*#__PURE__*/React__default.createElement(appStudio.Horizontal, Object.assign({
6837
6827
  gap: 8,
@@ -7120,7 +7110,7 @@ var ColorSchemes = {
7120
7110
  }
7121
7111
  };
7122
7112
 
7123
- var _excluded$p = ["id", "name", "label", "inActiveChild", "activeChild", "labelPosition", "shadow", "size", "value", "isHovered", "isDisabled", "isReadOnly", "on", "setOn", "onChange", "setValue", "setIsHovered", "helperText", "views"];
7113
+ var _excluded$p = ["id", "name", "label", "inActiveChild", "isChecked", "activeChild", "labelPosition", "shadow", "size", "value", "isHovered", "isDisabled", "isReadOnly", "on", "setOn", "onChange", "setValue", "setIsHovered", "helperText", "views"];
7124
7114
  var SwitchContent = props => /*#__PURE__*/React__default.createElement(appStudio.Input, Object.assign({
7125
7115
  type: "checkbox"
7126
7116
  }, props));
@@ -7527,11 +7517,7 @@ var TextFieldView = _ref => {
7527
7517
  // State properties
7528
7518
  cursor: isDisabled ? 'not-allowed' : 'text',
7529
7519
  // Animation
7530
- transition: 'all 0.2s ease',
7531
- // Dark mode support
7532
- '@media (prefers-color-scheme: dark)': {
7533
- color: isDisabled ? 'color.gray.600' : 'color.gray.100'
7534
- }
7520
+ transition: 'all 0.2s ease'
7535
7521
  }, views['field']);
7536
7522
  var handleFocus = () => {
7537
7523
  setIsFocused(true);
@@ -9365,8 +9351,8 @@ var IconSizes$4 = {
9365
9351
  };
9366
9352
 
9367
9353
  var _excluded$t = ["size"],
9368
- _excluded2$8 = ["size"],
9369
- _excluded3$7 = ["id", "name", "label", "value", "placeholder", "helperText", "hide", "error", "isHovered", "isFocused", "isAutoFocus", "isDisabled", "isReadOnly", "shadow", "newOptions", "size", "variant", "shape", "onChange", "onBlur", "setHide", "setNewOptions", "setIsHovered", "setIsFocused", "setValue", "views", "themeMode"];
9354
+ _excluded2$9 = ["size"],
9355
+ _excluded3$8 = ["id", "name", "label", "value", "placeholder", "helperText", "hide", "error", "isHovered", "isFocused", "isAutoFocus", "isDisabled", "isReadOnly", "shadow", "newOptions", "size", "variant", "shape", "onChange", "onBlur", "setHide", "setNewOptions", "setIsHovered", "setIsFocused", "setValue", "views", "themeMode"];
9370
9356
  var CountryList = _ref => {
9371
9357
  var props = _objectWithoutPropertiesLoose(_ref, _excluded$t);
9372
9358
  return /*#__PURE__*/React__default.createElement(appStudio.Element, Object.assign({
@@ -9377,7 +9363,7 @@ var CountrySelector = props => (/*#__PURE__*/React__default.createElement(appStu
9377
9363
  type: "country"
9378
9364
  }, props)));
9379
9365
  var CountryItem = _ref2 => {
9380
- var props = _objectWithoutPropertiesLoose(_ref2, _excluded2$8);
9366
+ var props = _objectWithoutPropertiesLoose(_ref2, _excluded2$9);
9381
9367
  return /*#__PURE__*/React__default.createElement(appStudio.Element, Object.assign({
9382
9368
  as: "li"
9383
9369
  }, props));
@@ -9479,7 +9465,7 @@ var CountryPickerView = _ref5 => {
9479
9465
  },
9480
9466
  themeMode: elementMode
9481
9467
  } = _ref5,
9482
- props = _objectWithoutPropertiesLoose(_ref5, _excluded3$7);
9468
+ props = _objectWithoutPropertiesLoose(_ref5, _excluded3$8);
9483
9469
  var {
9484
9470
  getColor,
9485
9471
  themeMode
@@ -9512,8 +9498,8 @@ var CountryPickerView = _ref5 => {
9512
9498
  var showLabel = !!(label && (isFocused || value));
9513
9499
  var fieldStyles = Object.assign({
9514
9500
  margin: 0,
9515
- paddingVerical: 8,
9516
- paddingHorizonatl: 0,
9501
+ paddingVertical: 8,
9502
+ paddingHorizontal: 0,
9517
9503
  width: '100%',
9518
9504
  heigth: '100%',
9519
9505
  border: 'none',
@@ -9728,7 +9714,7 @@ var usePasswordState = props => {
9728
9714
  };
9729
9715
 
9730
9716
  var _excluded$v = ["visibleIcon", "hiddenIcon"],
9731
- _excluded2$9 = ["isVisible", "setIsVisible"];
9717
+ _excluded2$a = ["isVisible", "setIsVisible"];
9732
9718
  var PasswordComponent = _ref => {
9733
9719
  var {
9734
9720
  visibleIcon = /*#__PURE__*/React__default.createElement(OpenEyeIcon, {
@@ -9744,7 +9730,7 @@ var PasswordComponent = _ref => {
9744
9730
  isVisible,
9745
9731
  setIsVisible
9746
9732
  } = _usePasswordState,
9747
- passwordProps = _objectWithoutPropertiesLoose(_usePasswordState, _excluded2$9);
9733
+ passwordProps = _objectWithoutPropertiesLoose(_usePasswordState, _excluded2$a);
9748
9734
  return /*#__PURE__*/React__default.createElement(TextFieldView, Object.assign({}, passwordProps, {
9749
9735
  type: isVisible ? 'text' : 'password',
9750
9736
  isClearable: false,
@@ -9977,6 +9963,12 @@ var useOTPInputState = _ref => {
9977
9963
  onChange,
9978
9964
  onChangeText,
9979
9965
  onComplete,
9966
+ onKeyDown,
9967
+ onKeyPress,
9968
+ onBlur,
9969
+ onFocus,
9970
+ isReadOnly,
9971
+ isDisabled,
9980
9972
  pattern,
9981
9973
  stepValues,
9982
9974
  pasteTransformer
@@ -10090,6 +10082,16 @@ var useOTPInputState = _ref => {
10090
10082
  var handleKeyDown = React.useCallback(_ => {
10091
10083
  // Handle special keys like backspace, arrows, etc.
10092
10084
  // This is handled by the browser for the single input
10085
+ if (onKeyDown) {
10086
+ onKeyDown(_);
10087
+ }
10088
+ }, []);
10089
+ var handleKeyPress = React.useCallback(e => {
10090
+ // Handle key press events
10091
+ // This is handled by the browser for the single input
10092
+ if (onKeyPress) {
10093
+ onKeyPress(e);
10094
+ }
10093
10095
  }, []);
10094
10096
  var handlePaste = React.useCallback(e => {
10095
10097
  var input = inputRef.current;
@@ -10246,11 +10248,12 @@ var useOTPInputState = _ref => {
10246
10248
  handleFocus,
10247
10249
  handleBlur,
10248
10250
  handleKeyDown,
10251
+ handleKeyPress,
10249
10252
  handlePaste
10250
10253
  };
10251
10254
  };
10252
10255
 
10253
- 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"];
10256
+ 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"];
10254
10257
  // Create a context for OTP input slots
10255
10258
  var OTPInputContext = /*#__PURE__*/React.createContext({
10256
10259
  slots: [],
@@ -10258,7 +10261,7 @@ var OTPInputContext = /*#__PURE__*/React.createContext({
10258
10261
  isHovering: false
10259
10262
  });
10260
10263
  // CSS for noscript fallback
10261
- 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}";
10264
+ 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";
10262
10265
  // Helper function to safely insert CSS rules
10263
10266
  function safeInsertRule(sheet, rule) {
10264
10267
  try {
@@ -10506,7 +10509,8 @@ var OTPInputComponent = props => {
10506
10509
  handleFocus,
10507
10510
  handleBlur,
10508
10511
  handleKeyDown,
10509
- handlePaste
10512
+ handlePaste,
10513
+ handleKeyPress
10510
10514
  } = useOTPInputState(props);
10511
10515
  // Use the controlled value if it exists, otherwise use the internal state value
10512
10516
  var displayValue = controlledValue !== undefined ? controlledValue : value;
@@ -10528,6 +10532,7 @@ var OTPInputComponent = props => {
10528
10532
  handleFocus: handleFocus,
10529
10533
  handleBlur: handleBlur,
10530
10534
  handleKeyDown: handleKeyDown,
10535
+ handleKeyPress: handleKeyPress,
10531
10536
  handlePaste: handlePaste,
10532
10537
  stepValues: props.stepValues
10533
10538
  }));
@@ -10758,7 +10763,7 @@ var TextFieldComponent$1 = props => {
10758
10763
  var FormikTextField = TextFieldComponent$1;
10759
10764
 
10760
10765
  var _excluded$D = ["visibleIcon", "hiddenIcon"],
10761
- _excluded2$a = ["isVisible", "setIsVisible"];
10766
+ _excluded2$b = ["isVisible", "setIsVisible"];
10762
10767
  var PasswordComponent$1 = _ref => {
10763
10768
  var {
10764
10769
  visibleIcon = /*#__PURE__*/React__default.createElement(OpenEyeIcon, {
@@ -10775,7 +10780,7 @@ var PasswordComponent$1 = _ref => {
10775
10780
  isVisible,
10776
10781
  setIsVisible
10777
10782
  } = _usePasswordState,
10778
- passwordProps = _objectWithoutPropertiesLoose(_usePasswordState, _excluded2$a);
10783
+ passwordProps = _objectWithoutPropertiesLoose(_usePasswordState, _excluded2$b);
10779
10784
  return /*#__PURE__*/React__default.createElement(TextFieldView, Object.assign({}, passwordProps, {
10780
10785
  type: isVisible ? 'text' : 'password',
10781
10786
  isClearable: false,
@@ -11945,12 +11950,12 @@ var UploadView = _ref => {
11945
11950
  } = _ref;
11946
11951
  var finalPreviewUrl = externalPreviewUrl || previewUrl;
11947
11952
  // Debug log to help troubleshoot
11948
- console.log('Uploader state:', {
11949
- fileType,
11950
- finalPreviewUrl,
11951
- selectedFile: selectedFile == null ? void 0 : selectedFile.name,
11952
- progress
11953
- });
11953
+ // console.log('Uploader state:', {
11954
+ // fileType,
11955
+ // finalPreviewUrl,
11956
+ // selectedFile: selectedFile?.name,
11957
+ // progress,
11958
+ // });
11954
11959
  return /*#__PURE__*/React__default.createElement(appStudio.Center, Object.assign({
11955
11960
  onClick: handleClick,
11956
11961
  cursor: "pointer",
@@ -12201,8 +12206,8 @@ var ModalTypography = {
12201
12206
  };
12202
12207
 
12203
12208
  var _excluded$H = ["children", "blur", "isOpen", "isClosePrevented", "onClose", "position", "views"],
12204
- _excluded2$b = ["children", "shadow", "isFullScreen", "shape", "views"],
12205
- _excluded3$8 = ["children", "buttonColor", "iconSize", "buttonPosition", "views"],
12209
+ _excluded2$c = ["children", "shadow", "isFullScreen", "shape", "views", "isOpen"],
12210
+ _excluded3$9 = ["children", "buttonColor", "iconSize", "buttonPosition", "views"],
12206
12211
  _excluded4$7 = ["children", "views"],
12207
12212
  _excluded5$3 = ["children", "views"];
12208
12213
  var ModalOverlay = _ref => {
@@ -12251,7 +12256,7 @@ var ModalContainer = _ref2 => {
12251
12256
  shape = 'rounded',
12252
12257
  views
12253
12258
  } = _ref2,
12254
- props = _objectWithoutPropertiesLoose(_ref2, _excluded2$b);
12259
+ props = _objectWithoutPropertiesLoose(_ref2, _excluded2$c);
12255
12260
  var defaultShadow = typeof document !== undefined ? {
12256
12261
  boxShadow: '0px 4px 16px rgba(0, 0, 0, 0.15)'
12257
12262
  } : {
@@ -12284,7 +12289,7 @@ var ModalHeader = _ref3 => {
12284
12289
  buttonPosition = 'right',
12285
12290
  views
12286
12291
  } = _ref3,
12287
- props = _objectWithoutPropertiesLoose(_ref3, _excluded3$8);
12292
+ props = _objectWithoutPropertiesLoose(_ref3, _excluded3$9);
12288
12293
  var onClose = props.onClose ? props.onClose : hideModal;
12289
12294
  var buttonIcon = /*#__PURE__*/React__default.createElement(appStudio.View, {
12290
12295
  onClick: onClose
@@ -13087,7 +13092,9 @@ var useTabsState = (propTabs, initialTabValue) => {
13087
13092
  return foundTab;
13088
13093
  }
13089
13094
  // Warn if initialTabValue is provided but not found
13090
- console.warn("Tabs: initialTabValue \"" + initialTabValue + "\" not found in tabs. Defaulting to the first tab.");
13095
+ // console.warn(
13096
+ // `Tabs: initialTabValue "${initialTabValue}" not found in tabs. Defaulting to the first tab.`
13097
+ // );
13091
13098
  }
13092
13099
  return propTabs[0]; // Default to the first tab
13093
13100
  };
@@ -13759,8 +13766,8 @@ var getDropdownPosition = function getDropdownPosition(side, align) {
13759
13766
  };
13760
13767
 
13761
13768
  var _excluded$M = ["children", "views"],
13762
- _excluded2$c = ["items", "side", "align", "views"],
13763
- _excluded3$9 = ["item", "views"],
13769
+ _excluded2$d = ["items", "side", "align", "views"],
13770
+ _excluded3$a = ["item", "views"],
13764
13771
  _excluded4$8 = ["views"],
13765
13772
  _excluded5$4 = ["trigger", "items", "side", "align", "views", "themeMode"];
13766
13773
  // Create context for the DropdownMenu
@@ -13821,7 +13828,7 @@ var DropdownMenuContent = _ref3 => {
13821
13828
  align = 'start',
13822
13829
  views
13823
13830
  } = _ref3,
13824
- props = _objectWithoutPropertiesLoose(_ref3, _excluded2$c);
13831
+ props = _objectWithoutPropertiesLoose(_ref3, _excluded2$d);
13825
13832
  var {
13826
13833
  isOpen,
13827
13834
  //activeSubmenuId, setActiveSubmenuId, size,
@@ -13857,7 +13864,7 @@ var DropdownMenuItem = _ref4 => {
13857
13864
  item,
13858
13865
  views
13859
13866
  } = _ref4,
13860
- props = _objectWithoutPropertiesLoose(_ref4, _excluded3$9);
13867
+ props = _objectWithoutPropertiesLoose(_ref4, _excluded3$a);
13861
13868
  var {
13862
13869
  activeSubmenuId,
13863
13870
  setActiveSubmenuId,
@@ -14170,7 +14177,7 @@ var useRect = ref => {
14170
14177
  };
14171
14178
 
14172
14179
  var _excluded$O = ["children", "views", "asChild"],
14173
- _excluded2$d = ["children", "views", "side", "align", "sideOffset", "style", "backgroundColor", "borderRadius", "boxShadow", "padding", "minWidth", "maxWidth"];
14180
+ _excluded2$e = ["children", "views", "side", "align", "sideOffset", "style", "backgroundColor", "borderRadius", "boxShadow", "padding", "minWidth", "maxWidth"];
14174
14181
  // Create context for the HoverCard
14175
14182
  var HoverCardContext = /*#__PURE__*/React.createContext({
14176
14183
  isOpen: false,
@@ -14256,7 +14263,7 @@ var HoverCardContent = _ref3 => {
14256
14263
  minWidth = '200px',
14257
14264
  maxWidth = '300px'
14258
14265
  } = _ref3,
14259
- props = _objectWithoutPropertiesLoose(_ref3, _excluded2$d);
14266
+ props = _objectWithoutPropertiesLoose(_ref3, _excluded2$e);
14260
14267
  var {
14261
14268
  isOpen,
14262
14269
  cancelCloseTimer,
@@ -15319,8 +15326,8 @@ var SidebarTransitions = {
15319
15326
  };
15320
15327
 
15321
15328
  var _excluded$V = ["children", "showToggleButton", "views"],
15322
- _excluded2$e = ["children", "views"],
15323
- _excluded3$a = ["children", "views"],
15329
+ _excluded2$f = ["children", "views"],
15330
+ _excluded3$b = ["children", "views"],
15324
15331
  _excluded4$9 = ["children", "position", "size", "variant", "fixed", "hasBackdrop", "expandedWidth", "collapsedWidth", "breakpointBehavior", "elevation", "transitionPreset", "ariaLabel", "isExpanded", "isMobile", "collapse", "views", "themeMode"];
15325
15332
  // Create context for the Sidebar
15326
15333
  var SidebarContext = /*#__PURE__*/React.createContext({
@@ -15418,7 +15425,7 @@ var SidebarContent = _ref3 => {
15418
15425
  children,
15419
15426
  views
15420
15427
  } = _ref3,
15421
- props = _objectWithoutPropertiesLoose(_ref3, _excluded2$e);
15428
+ props = _objectWithoutPropertiesLoose(_ref3, _excluded2$f);
15422
15429
  var {
15423
15430
  isExpanded
15424
15431
  } = useSidebarContext();
@@ -15436,7 +15443,7 @@ var SidebarFooter = _ref4 => {
15436
15443
  children,
15437
15444
  views
15438
15445
  } = _ref4,
15439
- props = _objectWithoutPropertiesLoose(_ref4, _excluded3$a);
15446
+ props = _objectWithoutPropertiesLoose(_ref4, _excluded3$b);
15440
15447
  var {
15441
15448
  isExpanded
15442
15449
  } = useSidebarContext();
@@ -15994,8 +16001,8 @@ var HandleIconStyles = {
15994
16001
  };
15995
16002
 
15996
16003
  var _excluded$X = ["children", "id", "defaultSize", "minSize", "maxSize", "collapsible", "defaultCollapsed", "onCollapseChange", "views"],
15997
- _excluded2$f = ["id", "position", "disabled", "withVisualIndicator", "withCollapseButton", "collapseTarget", "views"],
15998
- _excluded3$b = ["children", "orientation", "size", "variant", "defaultSizes", "minSize", "maxSize", "collapsible", "containerRef", "views"];
16004
+ _excluded2$g = ["id", "position", "disabled", "withVisualIndicator", "withCollapseButton", "collapseTarget", "views"],
16005
+ _excluded3$c = ["children", "orientation", "size", "variant", "defaultSizes", "minSize", "maxSize", "collapsible", "containerRef", "autoSaveId", "views"];
15999
16006
  // Create context for the Resizable component
16000
16007
  var ResizableContext = /*#__PURE__*/React.createContext({
16001
16008
  orientation: 'horizontal',
@@ -16102,7 +16109,7 @@ var ResizableHandle = _ref3 => {
16102
16109
  collapseTarget,
16103
16110
  views
16104
16111
  } = _ref3,
16105
- props = _objectWithoutPropertiesLoose(_ref3, _excluded2$f);
16112
+ props = _objectWithoutPropertiesLoose(_ref3, _excluded2$g);
16106
16113
  var {
16107
16114
  orientation,
16108
16115
  size,
@@ -16242,7 +16249,7 @@ var ResizableView = _ref4 => {
16242
16249
  containerRef,
16243
16250
  views
16244
16251
  } = _ref4,
16245
- props = _objectWithoutPropertiesLoose(_ref4, _excluded3$b);
16252
+ props = _objectWithoutPropertiesLoose(_ref4, _excluded3$c);
16246
16253
  var Container = orientation === 'horizontal' ? appStudio.Horizontal : appStudio.Vertical;
16247
16254
  return /*#__PURE__*/React__default.createElement(Container, Object.assign({
16248
16255
  ref: containerRef,
@@ -16791,6 +16798,16 @@ var Toast = /*#__PURE__*/Object.assign(ToastComponent, {
16791
16798
  // Export the hook for component usage
16792
16799
  var useToast$1 = useToast;
16793
16800
 
16801
+ // Default filter function defined outside the hook to avoid recreating it on each render
16802
+ var defaultFilterFn = (value, item) => {
16803
+ var _item$description, _item$keywords;
16804
+ if (!value) return true;
16805
+ var searchValue = value.toLowerCase();
16806
+ var matchesName = item.name.toLowerCase().includes(searchValue);
16807
+ var matchesDescription = ((_item$description = item.description) == null ? void 0 : _item$description.toLowerCase().includes(searchValue)) || false;
16808
+ var matchesKeywords = ((_item$keywords = item.keywords) == null ? void 0 : _item$keywords.some(keyword => keyword.toLowerCase().includes(searchValue))) || false;
16809
+ return matchesName || matchesDescription || matchesKeywords;
16810
+ };
16794
16811
  var useCommandState = _ref => {
16795
16812
  var {
16796
16813
  open,
@@ -16799,46 +16816,36 @@ var useCommandState = _ref => {
16799
16816
  commands = [],
16800
16817
  filter
16801
16818
  } = _ref;
16802
- // Combine commands from groups and flat list
16803
- var allCommands = React.useCallback(() => {
16804
- var groupCommands = groups.flatMap(group => group.commands);
16805
- return [...groupCommands, ...commands];
16806
- }, [groups, commands]);
16807
16819
  // State for search input
16808
16820
  var [search, setSearch] = React.useState('');
16809
16821
  // State for selected item index
16810
16822
  var [selectedIndex, setSelectedIndex] = React.useState(0);
16811
16823
  // Ref for the command list element
16812
16824
  var listRef = React.useRef(null);
16813
- // Default filter function
16814
- var defaultFilter = (value, item) => {
16815
- var _item$description, _item$keywords;
16816
- if (!value) return true;
16817
- var searchValue = value.toLowerCase();
16818
- var matchesName = item.name.toLowerCase().includes(searchValue);
16819
- var matchesDescription = ((_item$description = item.description) == null ? void 0 : _item$description.toLowerCase().includes(searchValue)) || false;
16820
- var matchesKeywords = ((_item$keywords = item.keywords) == null ? void 0 : _item$keywords.some(keyword => keyword.toLowerCase().includes(searchValue))) || false;
16821
- return matchesName || matchesDescription || matchesKeywords;
16822
- };
16823
- // Filter commands based on search
16824
- var filterCommands = React.useCallback(searchValue => {
16825
- var filterFn = filter || defaultFilter;
16826
- return allCommands().filter(item => filterFn(searchValue, item));
16827
- }, [allCommands, filter, defaultFilter]);
16828
- // Filtered commands based on search
16829
- var [filteredCommands, setFilteredCommands] = React.useState(allCommands());
16830
- // Filtered groups based on search
16831
- var filteredGroups = React.useCallback(() => {
16825
+ // Use the provided filter or fall back to the default
16826
+ var filterFn = React.useMemo(() => filter || defaultFilterFn, [filter]);
16827
+ // Combine and memoize all commands from groups and flat list
16828
+ var allCommands = React.useMemo(() => {
16829
+ var groupCommands = groups.flatMap(group => group.commands);
16830
+ return [...groupCommands, ...commands];
16831
+ }, [groups, commands]);
16832
+ // Filter and memoize commands based on search
16833
+ var filteredCommands = React.useMemo(() => {
16834
+ if (!search.trim()) return allCommands;
16835
+ return allCommands.filter(item => filterFn(search, item));
16836
+ }, [allCommands, search, filterFn]);
16837
+ // Filter and memoize groups based on search
16838
+ var filteredGroups = React.useMemo(() => {
16832
16839
  if (!search) return groups;
16833
- return groups.map(group => Object.assign({}, group, {
16834
- commands: group.commands.filter(command => (filter || defaultFilter)(search, command))
16835
- })).filter(group => group.commands.length > 0);
16836
- }, [groups, search, filter, defaultFilter]);
16837
- // Update filtered commands when search changes
16840
+ var filterFn = filter || defaultFilterFn;
16841
+ return groups.map(g => Object.assign({}, g, {
16842
+ commands: g.commands.filter(c => filterFn(search, c))
16843
+ })).filter(g => g.commands.length);
16844
+ }, [groups, search, filter]);
16845
+ // Reset selected index when filtered commands change
16838
16846
  React.useEffect(() => {
16839
- setFilteredCommands(filterCommands(search));
16840
16847
  setSelectedIndex(0);
16841
- }, [search, filterCommands]);
16848
+ }, [filteredCommands.length]);
16842
16849
  // Handle keyboard navigation
16843
16850
  var handleKeyDown = React.useCallback(e => {
16844
16851
  if (!open) return;
@@ -16888,6 +16895,9 @@ var useCommandState = _ref => {
16888
16895
  React.useEffect(() => {
16889
16896
  if (open) {
16890
16897
  setSelectedIndex(0);
16898
+ } else {
16899
+ // Clear search when closed
16900
+ setSearch('');
16891
16901
  }
16892
16902
  }, [open]);
16893
16903
  return {
@@ -16896,7 +16906,7 @@ var useCommandState = _ref => {
16896
16906
  selectedIndex,
16897
16907
  setSelectedIndex,
16898
16908
  filteredCommands,
16899
- filteredGroups: filteredGroups(),
16909
+ filteredGroups,
16900
16910
  listRef
16901
16911
  };
16902
16912
  };
@@ -17039,8 +17049,8 @@ var CommandFooterStyles = {
17039
17049
  };
17040
17050
 
17041
17051
  var _excluded$Z = ["value", "onValueChange", "placeholder", "views"],
17042
- _excluded2$g = ["children", "views"],
17043
- _excluded3$c = ["heading", "children", "views"],
17052
+ _excluded2$h = ["children", "views"],
17053
+ _excluded3$d = ["heading", "children", "views"],
17044
17054
  _excluded4$a = ["item", "selected", "onSelect", "views"],
17045
17055
  _excluded5$5 = ["children", "views"],
17046
17056
  _excluded6$3 = ["open", "onOpenChange", "groups", "commands", "placeholder", "size", "variant", "emptyState", "footer", "search", "setSearch", "selectedIndex", "setSelectedIndex", "filteredCommands", "filteredGroups", "listRef", "views", "filter"];
@@ -17102,7 +17112,7 @@ var CommandList = _ref3 => {
17102
17112
  children,
17103
17113
  views
17104
17114
  } = _ref3,
17105
- props = _objectWithoutPropertiesLoose(_ref3, _excluded2$g);
17115
+ props = _objectWithoutPropertiesLoose(_ref3, _excluded2$h);
17106
17116
  return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, CommandListStyles, views == null ? void 0 : views.container, props), children);
17107
17117
  };
17108
17118
  // Command Group component
@@ -17112,7 +17122,7 @@ var CommandGroup = _ref4 => {
17112
17122
  children,
17113
17123
  views
17114
17124
  } = _ref4,
17115
- props = _objectWithoutPropertiesLoose(_ref4, _excluded3$c);
17125
+ props = _objectWithoutPropertiesLoose(_ref4, _excluded3$d);
17116
17126
  return /*#__PURE__*/React__default.createElement(appStudio.View, Object.assign({}, CommandGroupStyles, views == null ? void 0 : views.container, props), /*#__PURE__*/React__default.createElement(Text, Object.assign({}, CommandGroupHeadingStyles, views == null ? void 0 : views.heading), heading), children);
17117
17127
  };
17118
17128
  // Command Item component
@@ -17165,26 +17175,21 @@ var CommandView = _ref7 => {
17165
17175
  } = _ref7,
17166
17176
  props = _objectWithoutPropertiesLoose(_ref7, _excluded6$3);
17167
17177
  if (!open) return null;
17168
- var handleItemSelect = item => {
17169
- if (!item.disabled) {
17170
- item.onSelect();
17171
- onOpenChange(false);
17172
- setSearch('');
17173
- }
17174
- };
17175
- var handleBackdropClick = e => {
17176
- if (e.target === e.currentTarget) {
17177
- onOpenChange(false);
17178
- }
17179
- };
17180
- var contextValue = {
17178
+ var handleItemSelect = React__default.useCallback(item => {
17179
+ if (item.disabled) return;
17180
+ item.onSelect();
17181
+ onOpenChange(false);
17182
+ setSearch('');
17183
+ }, [onOpenChange, setSearch]);
17184
+ var handleBackdropClick = React__default.useCallback(e => e.target === e.currentTarget && onOpenChange(false), [onOpenChange]);
17185
+ var contextValue = React__default.useMemo(() => ({
17181
17186
  search,
17182
17187
  setSearch,
17183
17188
  selectedIndex,
17184
17189
  setSelectedIndex,
17185
17190
  filteredCommands,
17186
17191
  onSelect: handleItemSelect
17187
- };
17192
+ }), [search, selectedIndex, filteredCommands, handleItemSelect, setSearch, setSelectedIndex]);
17188
17193
  var hasGroups = groups.length > 0;
17189
17194
  // const hasCommands = commands.length > 0;
17190
17195
  var isEmpty = filteredCommands.length === 0;
@@ -17564,8 +17569,8 @@ var getArrowStyles = position => {
17564
17569
  };
17565
17570
 
17566
17571
  var _excluded$$ = ["children", "views", "asChild"],
17567
- _excluded2$h = ["children", "views"],
17568
- _excluded3$d = ["content", "children", "position", "align", "size", "variant", "showArrow", "views", "themeMode"];
17572
+ _excluded2$i = ["children", "views"],
17573
+ _excluded3$e = ["content", "children", "position", "align", "size", "variant", "showArrow", "views", "themeMode"];
17569
17574
  // Create context for the Tooltip
17570
17575
  var TooltipContext = /*#__PURE__*/React.createContext({
17571
17576
  isOpen: false,
@@ -17635,7 +17640,7 @@ var TooltipContent = _ref3 => {
17635
17640
  children,
17636
17641
  views
17637
17642
  } = _ref3,
17638
- props = _objectWithoutPropertiesLoose(_ref3, _excluded2$h);
17643
+ props = _objectWithoutPropertiesLoose(_ref3, _excluded2$i);
17639
17644
  var {
17640
17645
  isOpen,
17641
17646
  contentRef,
@@ -17665,7 +17670,7 @@ var TooltipView = _ref4 => {
17665
17670
  showArrow = true,
17666
17671
  views
17667
17672
  } = _ref4,
17668
- props = _objectWithoutPropertiesLoose(_ref4, _excluded3$d);
17673
+ props = _objectWithoutPropertiesLoose(_ref4, _excluded3$e);
17669
17674
  var {
17670
17675
  isOpen,
17671
17676
  // openTooltip,